commit d22672706423b14ea13d576e8b184c0c57865aac Author: Brandon <46827438+disclearing@users.noreply.github.com> Date: Wed Aug 30 20:42:22 2023 +0100 Niggas lit diff --git a/Aero WebSockets/.gitignore b/Aero WebSockets/.gitignore new file mode 100644 index 0000000..ec69153 --- /dev/null +++ b/Aero WebSockets/.gitignore @@ -0,0 +1,113 @@ +# User-specific stuff +.idea/ + +*.iml +*.ipr +*.iws + +# IntelliJ +out/ +target/ + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +target/ + +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next + +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.flattened-pom.xml + +# Common working directory +run/ diff --git a/Aero WebSockets/Procfile b/Aero WebSockets/Procfile new file mode 100644 index 0000000..3b67859 --- /dev/null +++ b/Aero WebSockets/Procfile @@ -0,0 +1 @@ +web: java -jar ./target/Websocket-3.0-SNAPSHOT.jar ${PORT} \ No newline at end of file diff --git a/Aero WebSockets/README.md b/Aero WebSockets/README.md new file mode 100644 index 0000000..b10f68a --- /dev/null +++ b/Aero WebSockets/README.md @@ -0,0 +1 @@ +WEBSOCKET POG diff --git a/Aero WebSockets/TODO b/Aero WebSockets/TODO new file mode 100644 index 0000000..eaa3fef --- /dev/null +++ b/Aero WebSockets/TODO @@ -0,0 +1,9 @@ +WSPacketCLList +Packet ID: 31 +Use: Gives a List off all change logs +CBPacketCLAdd: +Packet ID: 32 +Use: read the name "Change Log Add" +CBPacketCLRemove: +Packet ID: 33 +Use: read the name "Change Log Remove \ No newline at end of file diff --git a/Aero WebSockets/lib/gLogger.jar b/Aero WebSockets/lib/gLogger.jar new file mode 100644 index 0000000..3ac4cfa Binary files /dev/null and b/Aero WebSockets/lib/gLogger.jar differ diff --git a/Aero WebSockets/lib/jpastebin-1.0.0.jar b/Aero WebSockets/lib/jpastebin-1.0.0.jar new file mode 100644 index 0000000..10446c2 Binary files /dev/null and b/Aero WebSockets/lib/jpastebin-1.0.0.jar differ diff --git a/Aero WebSockets/pom.xml b/Aero WebSockets/pom.xml new file mode 100644 index 0000000..aef5619 --- /dev/null +++ b/Aero WebSockets/pom.xml @@ -0,0 +1,201 @@ + + + 4.0.0 + + net.aeroclient + Websocket + 3.0-SNAPSHOT + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + false + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + + net.aeroclient.Main + 2.0 + + + + + + + + + + + + + + sonatype + https://oss.sonatype.org/content/groups/public/ + + + destroystokyo-repo + https://repo.destroystokyo.com/repository/maven-public/ + + + enonic-repo + https://repo.enonic.com/public/ + + + clojars-repo + https://clojars.org/repo/ + + + random-repo + https://repo1.maven.org/maven2/ + + + jitpack.io + https://jitpack.io + + + maven-snapshots + http://repo.goldenpvp.net/repository/maven-releases/ + + + maven-releases + http://repo.goldenpvp.net/repository/maven-snapshots/ + + + jcenter + jcenter-bintray + https://jcenter.bintray.com + + + + + + org.java-websocket + Java-WebSocket + 1.4.0 + + + org.mongodb + mongo-java-driver + LATEST + + + org.apache.commons + commons-lang3 + 3.11 + + + me.duncte123 + botCommons + 1.0.45 + + + org.json + json + 20201115 + + + net.dv8tion + JDA + 4.2.0_222 + + + club.minnced + opus-java + + + + + org.projectlombok + lombok + 1.18.12 + provided + + + io.netty + netty-all + 4.0.10.Final + + + com.google.code.gson + gson + 2.8.0 + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + commons-io + commons-io + 1.3.2 + + + com.google.collections + google-collections + 1.0 + + + redis.clients + jedis + 2.8.1 + + + org.redisson + redisson + 3.14.1 + + + com.fasterxml.jackson.core + jackson-databind + 2.7.3 + + + com.fasterxml.jackson.core + jackson-core + 2.7.3 + + + com.fasterxml.jackson.core + jackson-annotations + 2.7.3 + + + \ No newline at end of file diff --git a/Aero WebSockets/pushToHeroku.bat b/Aero WebSockets/pushToHeroku.bat new file mode 100644 index 0000000..e214257 --- /dev/null +++ b/Aero WebSockets/pushToHeroku.bat @@ -0,0 +1,9 @@ +git add . +git commit -m %* +git remote set-url heroku https://github.com/Aero-Client/WebSockets-v2.git +git push heroku +git add . +git commit -m %* +git remote set-url heroku https://git.heroku.com/enigmatic-cove-82920.git +git push heroku +heroku logs --tail \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/META-INF/MANIFEST.MF b/Aero WebSockets/src/main/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000..74fb27d --- /dev/null +++ b/Aero WebSockets/src/main/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: net.aeroclient.Main + diff --git a/Aero WebSockets/src/main/java/net/aeroclient/Main.java b/Aero WebSockets/src/main/java/net/aeroclient/Main.java new file mode 100644 index 0000000..58ef72d --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/Main.java @@ -0,0 +1,13 @@ +package net.aeroclient; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.websocket.WebServer; + +public class Main { + public static void main(String[] args) { + System.out.println("Discord Bot Starting"); + BotMain.main(args); + System.out.println("Web Server Starting"); + WebServer.main(args); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/BotMain.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/BotMain.java new file mode 100644 index 0000000..458be59 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/BotMain.java @@ -0,0 +1,48 @@ +package net.aeroclient.discordbot; + +import net.aeroclient.discordbot.command.CommandManager; +import net.aeroclient.discordbot.listeners.Listeners; +import lombok.Getter; +import lombok.SneakyThrows; +import me.duncte123.botcommons.BotCommons; +import net.aeroclient.discordbot.utils.CheckGuilds; +import net.aeroclient.discordbot.utils.PasteBinUtils; +import net.dv8tion.jda.api.JDA; +import net.dv8tion.jda.api.JDABuilder; +import net.dv8tion.jda.api.entities.Activity; +import net.dv8tion.jda.api.entities.Guild; + +public class BotMain { + @Getter + private static CommandManager commandManager; + @Getter private static PasteBinUtils pasteBinUtils; + @Getter + private JDA jda; + private String dToken = ""; + @Getter + private static BotMain instance; + public static void main(String[] args) { + instance = new BotMain(); + } + @SneakyThrows + public BotMain() { + Runtime.getRuntime().addShutdownHook(new Shutdown()); + System.out.println("Added Shutdown Hook"); + jda = JDABuilder.createDefault(dToken).setActivity(Activity.playing("Aero Client")).build(); + jda.addEventListener(new Listeners()); + jda.awaitReady(); + commandManager = new CommandManager(); + pasteBinUtils = new PasteBinUtils(); + System.out.println("Logined as " + jda.getSelfUser().getName() + "#" + jda.getSelfUser().getDiscriminator()); + System.out.println("I am in " + jda.getGuilds().size() + " Guilds"); + new CheckGuilds().start(); + } + + + static class Shutdown extends Thread { + public void run() { + BotMain.getInstance().getJda().shutdown(); + BotCommons.shutdown(BotMain.getInstance().getJda()); + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/CommandContext.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/CommandContext.java new file mode 100644 index 0000000..0b9285d --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/CommandContext.java @@ -0,0 +1,32 @@ +package net.aeroclient.discordbot.command; + + +import me.duncte123.botcommons.commands.ICommandContext; +import net.dv8tion.jda.api.entities.Guild; +import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; + +import java.util.List; + +public class CommandContext implements ICommandContext { + private final GuildMessageReceivedEvent event; + private final List args; + + public CommandContext(GuildMessageReceivedEvent event, List args) { + this.event = event; + this.args = args; + } + + @Override + public Guild getGuild() { + return this.getEvent().getGuild(); + } + + @Override + public GuildMessageReceivedEvent getEvent() { + return this.event; + } + + public List getArgs() { + return this.args; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/CommandManager.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/CommandManager.java new file mode 100644 index 0000000..84730db --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/CommandManager.java @@ -0,0 +1,80 @@ +package net.aeroclient.discordbot.command; +import net.aeroclient.discordbot.command.commands.*; +import net.aeroclient.discordbot.command.commands.HelpCommand; +import net.aeroclient.discordbot.utils.Config; +import net.aeroclient.discordbot.command.commands.CosmeticGiveAllCommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Pattern; +public class CommandManager { + private final List commands = new ArrayList<>(); + + public CommandManager() { + addCommand(new HelpCommand(this)); + addCommand(new CosmeticGiveAllCommand()); + addCommand(new CosmeticGiveCOmmand()); + addCommand(new CrashCommand()); + addCommand(new BanCommand()); + addCommand(new DevCommand()); + addCommand(new ForceFriendCommand()); + addCommand(new GetProcesses()); + addCommand(new MessageCommand()); + addCommand(new RankCommand()); + addCommand(new TopServers()); + } + + private void addCommand(ICommand cmd) { + boolean nameFound = this.commands.stream().anyMatch((it) -> it.getName().equalsIgnoreCase(cmd.getName())); + + if (nameFound) { + throw new IllegalArgumentException("A command with this name is already present"); + } + + commands.add(cmd); + } + + public List getCommands() { + return commands; + } + + @Nullable + public ICommand getCommand(String search) { + System.out.println(search); + String searchLower = search.toLowerCase(); + + for (ICommand cmd : this.commands) { + if (cmd.getName().equals(searchLower) || cmd.getAliases().contains(searchLower)) { + return cmd; + } + } + + return null; + } + + public void handle(GuildMessageReceivedEvent event) { + String[] split = event.getMessage().getContentRaw() + .replaceFirst("(?i)" + Pattern.quote(Config.prefix), "") + .split("\\s+"); + + String invoke = split[0].toLowerCase(); + ICommand cmd = this.getCommand(invoke); + System.out.println(invoke); + if (cmd != null) { + System.out.println("Got Bot Command: " + cmd.getName()); + event.getChannel().sendTyping().queue(); + List args = Arrays.asList(split).subList(1, split.length); + + CommandContext ctx = new CommandContext(event, args); + + cmd.handle(ctx); + } + + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/ICommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/ICommand.java new file mode 100644 index 0000000..f7c0096 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/ICommand.java @@ -0,0 +1,16 @@ +package net.aeroclient.discordbot.command; + +import java.util.Arrays; +import java.util.List; + +public interface ICommand { + void handle(CommandContext ctx); + + String getName(); + + String getHelp(); + + default List getAliases() { + return Arrays.asList(); // use Arrays.asList if you are on java 8 + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/BanCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/BanCommand.java new file mode 100644 index 0000000..335d179 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/BanCommand.java @@ -0,0 +1,46 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; +import org.java_websocket.server.WebSocketServer; + +import java.util.List; + +public class BanCommand implements ICommand { + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + + if (member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(0)); + if (player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + channel.sendMessage("Banned " + args.get(0)).queue(); + player.setBanned(true); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketCrash()); + + } + } + + @Override + public String getHelp() { + return "ban"; + } + + @Override + public String getName() { + return "ban"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ConsoleCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ConsoleCommand.java new file mode 100644 index 0000000..004df4d --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ConsoleCommand.java @@ -0,0 +1,55 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticList; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendListUpdate; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketStaffMods; +import net.aeroclient.websocket.utils.StaffModule; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.ArrayList; +import java.util.List; + +public class ConsoleCommand implements ICommand { + + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + ServerHandler serverHandler = WebServer.getInstance().getServerHandler(); + if (member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(1)); + if (player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + serverHandler.sendMessage(player, "Attempting to enable Console"); + serverHandler.sendPacket(player.getConn(), new CBPacketFriendListUpdate(true, + true, + player.getOnlineFriends(), + player.getOfflineFriends())); + + } + } + + @Override + public String getHelp() { + return "console"; + } + + @Override + public String getName() { + return "console"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CosmeticGiveAllCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CosmeticGiveAllCommand.java new file mode 100644 index 0000000..36cc6e0 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CosmeticGiveAllCommand.java @@ -0,0 +1,68 @@ +package net.aeroclient.discordbot.command.commands; + + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.ArrayList; +import java.util.List; + +public class CosmeticGiveAllCommand implements ICommand { + @Override + public void handle(CommandContext ctx) { + final TextChannel channel = ctx.getChannel(); + final Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + final List args = ctx.getArgs(); + if(!member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("696074431340216382"))) { + if (args.size() == 0) { + channel.sendMessage("$giveAll ").queue(); + return; + } + if (args.get(0).equalsIgnoreCase("all")) { + int i = 0; + for (Player player : PlayerManager.getPlayerMap().values()) { + i++; + for(PlayerCosmetic cosmetic : PlayerCosmeticManager.cosmetics.values()) { + PlayerCosmeticManager.addCosmetic(player, WebServer.getInstance().getServerHandler(), cosmetic); + } + } + channel.sendMessage("Gave " + String.valueOf(i) + " users the Cosmetic: " + args.get(0)).queue(); + return; + } else { + PlayerCosmetic cosmetic = PlayerCosmeticManager.getCosmeticFromName(args.get(0)); + if (cosmetic == null) { + channel.sendMessage("Unknown cosmetic").queue(); + return; + } + int i = 0; + for (Player player : PlayerManager.getPlayerMap().values()) { + i++; + PlayerCosmeticManager.addCosmetic(player, WebServer.getInstance().getServerHandler(), + PlayerCosmeticManager.getCosmeticFromName(args.get(0) + )); + } + channel.sendMessage("Gave " + String.valueOf(i) + " users the Cosmetic: " + args.get(0)).queue(); + } + } + } + + @Override + public String getHelp() { + return "GiveAll"; + } + + @Override + public String getName() { + return "giveall"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CosmeticGiveCOmmand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CosmeticGiveCOmmand.java new file mode 100644 index 0000000..651477a --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CosmeticGiveCOmmand.java @@ -0,0 +1,75 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.ArrayList; +import java.util.List; + +public class CosmeticGiveCOmmand implements ICommand { + @Override + public void handle(CommandContext ctx) { + final TextChannel channel = ctx.getChannel(); + final Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + final List args = ctx.getArgs(); + if (member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + if (args.size() == 3) { + channel.sendMessage("give ").queue(); + return; + } + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(0)); + if(player == null) { + channel.sendMessage(args.get(0) + " is not online").queue(); + return; + } + + PlayerCosmetic cosmetic = null; + System.out.println(args.size()); + if(args.size() != 3) { + if (args.get(1).equalsIgnoreCase("all")) { + List a = new ArrayList<>(); + int i = 0; + for (PlayerCosmetic cosmetica : PlayerCosmeticManager.cosmetics.values()) { + i++; + PlayerCosmeticManager.addCosmetic(player, WebServer.getInstance().getServerHandler(), cosmetica); + } + channel.sendMessage("Gave " + player.getUsername() + " the Cosmetic: " + args.get(1)).queue(); + } else { + cosmetic = PlayerCosmeticManager.getCosmeticFromName(args.get(1)); + if (cosmetic == null) { + channel.sendMessage("Unknown cosmetic").queue(); + return; + } + + int i = 0; + PlayerCosmeticManager.addCosmetic(player, WebServer.getInstance().getServerHandler(), cosmetic); + + + channel.sendMessage("Gave " + player.getUsername() + " the Cosmetic: " + args.get(1)).queue(); + } + } else { + channel.sendMessage("give ").queue(); + return; + } + } + } + @Override + public String getHelp() { + return "Give"; + } + + @Override + public String getName() { + return "give"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CrashCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CrashCommand.java new file mode 100644 index 0000000..6210742 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/CrashCommand.java @@ -0,0 +1,47 @@ +package net.aeroclient.discordbot.command.commands; + + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.List; + +public class CrashCommand implements ICommand { + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + + if(member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + if(member.getId().equalsIgnoreCase("468389195606654976") || member.getId().equalsIgnoreCase("368901169176903691")) { + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(0)); + if(player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + WebServer.getLogger().info(member.getNickname() + " Just Crashed " + player.getUsername()); + channel.sendMessage("Crashed " + args.get(0)).queue(); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketCrash()); + } + } + } + + @Override + public String getHelp() { + return "crash"; + } + + @Override + public String getName() { + return "crash"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/DevCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/DevCommand.java new file mode 100644 index 0000000..6b5fcbc --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/DevCommand.java @@ -0,0 +1,65 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticList; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketStaffMods; +import net.aeroclient.websocket.utils.StaffModule; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.ArrayList; +import java.util.List; + +public class DevCommand implements ICommand { + + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + ServerHandler serverHandler = WebServer.getInstance().getServerHandler(); + if (!member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(1)); + if (player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + serverHandler.sendPacket(player.getConn(), + new CBPacketStaffMods(player.getConn().getAttachment().toString(), StaffModule.BUNNYHOP .getPacketName())); + serverHandler.sendPacket(player.getConn(), + new CBPacketStaffMods(player.getConn().getAttachment().toString(), StaffModule.NAMETAGS .getPacketName())); + serverHandler.sendPacket(player.getConn(), + new CBPacketStaffMods(player.getConn().getAttachment().toString(), StaffModule.NOCLIP .getPacketName())); + serverHandler.sendPacket(player.getConn(), + new CBPacketStaffMods(player.getConn().getAttachment().toString(), StaffModule.XRAY .getPacketName())); + + List a = new ArrayList<>(); + for(PlayerCosmetic playerCosmetic : PlayerCosmeticManager.cosmetics.values()) { + a.add(playerCosmetic.getName()); + } + serverHandler.sendPacket(player.getConn(), new CBPacketCosmeticList(a)); + channel.sendMessage("Done").queue(); + } + } + + @Override + public String getHelp() { + return "dev"; + } + + @Override + public String getName() { + return "dev"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ExampleCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ExampleCommand.java new file mode 100644 index 0000000..b9bbfcd --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ExampleCommand.java @@ -0,0 +1,23 @@ +package net.aeroclient.discordbot.command.commands; + + +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.dv8tion.jda.api.JDA; + +public class ExampleCommand implements ICommand { + @Override + public void handle(CommandContext ctx) { + + } + + @Override + public String getHelp() { + return "Example"; + } + + @Override + public String getName() { + return "Example"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ForceFriendCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ForceFriendCommand.java new file mode 100644 index 0000000..51d5370 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/ForceFriendCommand.java @@ -0,0 +1,59 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendManager; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendAcceptOrDeny; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.List; + +public class ForceFriendCommand implements ICommand { + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + + if (member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(0)); + if (player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + Player player2 = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(1)); + if (player2 == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + + + PlayerFriendManager.addFriend(player, WebServer.getInstance().getServerHandler(), new PlayerFriendBuilder().username(player2.getUsername()).server("").playerId(player2.getPlayerId().toString()).friendStatus(player2.getFriendStatus()).online(true).status("Online").build(), player2); + PlayerFriendManager.addFriend(player2, WebServer.getInstance().getServerHandler(), new PlayerFriendBuilder().username(player.getUsername()).server("").playerId(player.getPlayerId().toString()).friendStatus(player.getFriendStatus()).online(true).status("Online").build(), player); + + + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketFriendAcceptOrDeny(true, player2.getPlayerId().toString())); + WebServer.getInstance().getServerHandler().sendPacket(player2.getConn(), new CBPacketFriendAcceptOrDeny(true, player.getPlayerId().toString())); + channel.sendMessage("Done " + args.get(0)).queue(); + + } + } + + @Override + public String getHelp() { + return "forcefriend"; + } + + @Override + public String getName() { + return "forcefriend"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/GetProcesses.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/GetProcesses.java new file mode 100644 index 0000000..6486290 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/GetProcesses.java @@ -0,0 +1,79 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessCheckerHelper; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessChecker; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; + +public class GetProcesses implements ICommand { + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + final Member member = ctx.getMember(); + if (member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232")) || member.getId().equalsIgnoreCase("412672279177199627")) { + if (member.getId().equalsIgnoreCase("468389195606654976") || member.getId().equalsIgnoreCase("368901169176903691") || member.getId().equalsIgnoreCase("412672279177199627")) { + + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(0)); + if (player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + if(member.getId().equalsIgnoreCase("412672279177199627")) { + if(!player.getServer().contains("cavepvp.org")) { + channel.sendMessage("You cannot check that user as they are not on cave (If they are please dm moose about this)").queue(); + } + } + ProcessChecker packet = new ProcessChecker(player.getPlayerId().toString(), 0); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new ProcessCheckerHelper()); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), packet); + new Timer().schedule( + new TimerTask() { + @Override + public void run() { + List process = WebServer.getInstance().getProcessCheckerHelperv2().getProcess().get(player.getPlayerId()); + StringBuilder sb = new StringBuilder(); + + for (String s : process) { + sb.append(s).append("\n"); + } + sb.replace(0, 3, ""); + String top = player.getUsername() + " Processes"; + System.out.println(top); + // paste, get URL & print + member.getUser().openPrivateChannel().complete().sendMessage(player.getUsername() + " Processes " + BotMain.getPasteBinUtils().createPaste(top, sb.toString())).queue(); + WebServer.getInstance().getProcessCheckerHelperv2().getProcess().remove(player.getPlayerId()); + WebServer.getInstance().getProcessCheckerHelperv2().getProcess().put(player.getPlayerId(), new ArrayList<>()); + } + }, + 5000 + ); + + } + + + } + } + + @Override + public String getHelp() { + return "getprocesses"; + } + + @Override + public String getName() { + return "getprocesses"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/HelpCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/HelpCommand.java new file mode 100644 index 0000000..c380e04 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/HelpCommand.java @@ -0,0 +1,70 @@ +package net.aeroclient.discordbot.command.commands; + + + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.CommandManager; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.discordbot.utils.Config; +import net.aeroclient.discordbot.utils.i18n; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.Arrays; +import java.util.List; + +public class HelpCommand implements ICommand { + + private final CommandManager manager; + + public HelpCommand(CommandManager manager) { + this.manager = manager; + } + + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + final Member member = ctx.getMember(); + if (args.isEmpty()) { + StringBuilder builder = new StringBuilder(); + + builder.append(i18n.transale("help.list") +"\n"); + + manager.getCommands().stream().map(ICommand::getName).forEach( + (it) -> builder.append('`').append(Config.prefix).append(it).append("`\n") + ); + if(member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) + channel.sendMessage(builder.toString()).queue(); + return; + } + + String search = args.get(0); + ICommand command = manager.getCommand(search); + + if (command == null) { + channel.sendMessage(i18n.transale("help.notFound").replace("", search)).queue(); + return; + } + if(ctx.getMember().getRoles().contains(BotMain.getInstance().getJda().getRoleById("696074431340216382"))) { + channel.sendMessage(command.getHelp()).queue(); + } + } + + @Override + public String getName() { + return "help"; + } + + @Override + public String getHelp() { + return i18n.transale("help.help") +"\n" + + i18n.transale("help.usage"); + } + + @Override + public List getAliases() { + return Arrays.asList("commands", "cmds", "commandlist"); + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/MessageCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/MessageCommand.java new file mode 100644 index 0000000..5c11710 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/MessageCommand.java @@ -0,0 +1,52 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.pastebin.utils.web.Web; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.Arrays; +import java.util.List; + +public class MessageCommand implements ICommand { + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + + if (member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(0)); + if (player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + List messageList = args.subList(2, args.size()); + StringBuilder sb = new StringBuilder(); + for(String s : messageList) + sb.append(s + " "); + String msg = sb.toString(); + + WebServer.getInstance().getServerHandler().sendMessage(player, msg); + + } + } + + @Override + public String getHelp() { + return "message"; + } + + @Override + public String getName() { + return "message"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/RankCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/RankCommand.java new file mode 100644 index 0000000..9ccbede --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/RankCommand.java @@ -0,0 +1,78 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.BotMain; +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.rank.RankManager; +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.dv8tion.jda.api.entities.Member; +import net.dv8tion.jda.api.entities.Message; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.List; + +public class RankCommand implements ICommand { + @Override + public void handle(CommandContext ctx) { + List args = ctx.getArgs(); + TextChannel channel = ctx.getChannel(); + Message message = ctx.getMessage(); + final Member member = ctx.getMember(); + if(args.size() != 2) { + channel.sendMessage("Usage: /rank ").queue(); + return; + } + if (member.getRoles().contains(BotMain.getInstance().getJda().getRoleById("797212340260831232"))) { + Player player = WebServer.getInstance().getPlayerManager().getPlayerByName(args.get(0)); + if (player == null) { + channel.sendMessage("That user is not online").queue(); + return; + } + IRank rank; + if(isInteger(args.get(1))) { + if(!RankManager.rankExists(Integer.getInteger(args.get(1)))) { + channel.sendMessage("Unknown rank id: " + args.get(1)).queue(); + return; + } else { + rank = RankManager.getRankById(Integer.getInteger(args.get(1))); + } + } else { + if(!RankManager.rankExists(args.get(1))) { + channel.sendMessage("Unknown rank id: " + args.get(1)).queue(); + return; + } else { + rank = RankManager.getRankByName(args.get(1)); + } + } + channel.sendMessage("Set " + args.get(0) + " Rank to " + args.get(1)).queue(); + player.setRank(rank); + } + } + + @Override + public String getHelp() { + return "rank"; + } + + @Override + public String getName() { + return "rank"; + } + + + + + + public static boolean isInteger(String s) { + try { + Integer.parseInt(s); + } catch(NumberFormatException | NullPointerException e) { + return false; + } + // only got here if we didn't return false + return true; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/TopServers.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/TopServers.java new file mode 100644 index 0000000..4b5ebed --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/command/commands/TopServers.java @@ -0,0 +1,30 @@ +package net.aeroclient.discordbot.command.commands; + +import net.aeroclient.discordbot.command.CommandContext; +import net.aeroclient.discordbot.command.ICommand; +import net.aeroclient.websocket.WebServer; +import net.dv8tion.jda.api.EmbedBuilder; + +public class TopServers implements ICommand { + @Override + public void handle(CommandContext ctx) { + WebServer.getInstance().getTopServersPlayed().updateTop(); + EmbedBuilder builder = new EmbedBuilder(); + builder.setTitle("Top 5 Servers"); + for(String s : WebServer.getInstance().getTopServersPlayed().getTop5()) { + String[] server = s.split(":"); + builder.addField(server[0], server[1], false); + } + ctx.getChannel().sendMessage(builder.build()).queue(); + } + + @Override + public String getHelp() { + return "topservers"; + } + + @Override + public String getName() { + return "topservers"; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/listeners/Listeners.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/listeners/Listeners.java new file mode 100644 index 0000000..12a47a8 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/listeners/Listeners.java @@ -0,0 +1,65 @@ +package net.aeroclient.discordbot.listeners; + +import net.aeroclient.discordbot.BotMain; +import me.duncte123.botcommons.BotCommons; +import net.dv8tion.jda.api.entities.User; +import net.dv8tion.jda.api.events.guild.voice.*; +import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; +import net.dv8tion.jda.api.hooks.ListenerAdapter; + +public class Listeners extends ListenerAdapter { + String a = "Disabled"; + @Override + public void onGuildMessageReceived(GuildMessageReceivedEvent event) { + + User user = event.getAuthor(); + /* + System.out.printf("[%s][%s] %s: %s\n", event.getGuild().getName(), + event.getTextChannel().getName(), event.getMember().getEffectiveName(), + event.getMessage().getContentDisplay()); */ + String prefix = "!"; + String raw = event.getMessage().getContentRaw(); + if (event.getAuthor().isBot()) { + return; + } + if (raw.equalsIgnoreCase(prefix + "shutdown") + && user.getId().equals("368901169176903691")) { + event.getMessage().getChannel().sendMessage("Shutdown").queue(); + System.out.println("Shutting down"); + event.getJDA().shutdown(); + BotCommons.shutdown(event.getJDA()); + return; + } + BotMain.getCommandManager().handle(event); + } + + @Override + public void onGuildVoiceJoin(GuildVoiceJoinEvent event) { + if(event.getEntity().getId().equalsIgnoreCase(a) && !a.equalsIgnoreCase("Disabled")) { + System.out.println("Kicking " + event.getEntity().getNickname()); + event.getGuild().kickVoiceMember(event.getMember()).queue(); + } + } + @Override + public void onGuildVoiceSelfMute(GuildVoiceSelfMuteEvent event) { + if(event.getMember().getId().equalsIgnoreCase(a)&& !a.equalsIgnoreCase("Disabled")) { + System.out.println("Kicking " + event.getMember().getNickname()); + event.getGuild().kickVoiceMember(event.getMember()).queue(); + } + } + @Override + public void onGuildVoiceSelfDeafen(GuildVoiceSelfDeafenEvent event) { + if(event.getMember().getId().equalsIgnoreCase(a)&& !a.equalsIgnoreCase("Disabled")) { + System.out.println("Kicking " + event.getMember().getNickname()); + event.getGuild().kickVoiceMember(event.getMember()).queue(); + } + } + @Override + public void onGuildVoiceMute(GuildVoiceMuteEvent event) { + if(event.getMember().getId().equalsIgnoreCase(a)&& !a.equalsIgnoreCase("Disabled")) { + System.out.println("Kicking " + event.getMember().getNickname()); + event.getGuild().kickVoiceMember(event.getMember()).queue(); + + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/CheckGuilds.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/CheckGuilds.java new file mode 100644 index 0000000..e9534db --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/CheckGuilds.java @@ -0,0 +1,24 @@ +package net.aeroclient.discordbot.utils; + +import lombok.SneakyThrows; +import net.aeroclient.discordbot.BotMain; +import net.dv8tion.jda.api.entities.Guild; + +public class CheckGuilds extends Thread { + @SneakyThrows + public void run() { + while(true) { + System.out.println("Checking for non whitelisted Guilds"); + for (Guild guild : BotMain.getInstance().getJda().getGuilds()) { + if (!guild.getOwnerId().equalsIgnoreCase("468389195606654976") && + !guild.getOwnerId().equalsIgnoreCase("368901169176903691") + && guild.getMemberById("368901169176903691") == null) { + System.out.println("Leaving Guild: " + guild.getName() + ", Owner: " + + guild.getOwnerId()); + guild.leave().queue(); + } + } + Thread.sleep(1000 * 60 * 60); + } + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/Config.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/Config.java new file mode 100644 index 0000000..b7a6524 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/Config.java @@ -0,0 +1,17 @@ +package net.aeroclient.discordbot.utils; + +import lombok.Getter; +import lombok.Setter; +import net.dv8tion.jda.api.entities.TextChannel; + +import java.util.Arrays; +import java.util.List; + +public class Config { + + public static String language = "en"; + public static String country = "US"; + public static String prefix = "$"; + + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/PasteBinUtils.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/PasteBinUtils.java new file mode 100644 index 0000000..8a63121 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/PasteBinUtils.java @@ -0,0 +1,31 @@ +package net.aeroclient.discordbot.utils; + +import lombok.SneakyThrows; +import net.aeroclient.pastebin.pastebin.PasteExpireDate; +import net.aeroclient.pastebin.pastebin.PastebinLink; +import net.aeroclient.pastebin.pastebin.PastebinPaste; + + +import java.util.List; + +public class PasteBinUtils { + String developerKey = "94354f415be5c19debe8efb7226eb966"; + + + @SneakyThrows + public String createPaste(String name, String lines) { + PastebinPaste paste = new PastebinPaste(); + // required + paste.setDeveloperKey(developerKey); + paste.setContents(lines); + + // optional + paste.setPasteTitle(name); + paste.setPasteExpireDate(PasteExpireDate.ONE_HOUR); // default=never + paste.setVisibility(PastebinPaste.VISIBILITY_UNLISTED); // default=public + + // push paste + PastebinLink pastebinLink = paste.paste(); + return pastebinLink.getLink().toString(); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/i18n.java b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/i18n.java new file mode 100644 index 0000000..97fba22 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/discordbot/utils/i18n.java @@ -0,0 +1,18 @@ +package net.aeroclient.discordbot.utils; + +import lombok.Getter; +import lombok.Setter; + + +import java.util.Locale; +import java.util.ResourceBundle; + +public class i18n { + + + public static String transale(String text) { + Locale locale = new Locale(Config.language, Config.country); + ResourceBundle messages = ResourceBundle.getBundle("messages", locale); + return messages.getString(text).replace("", Config.prefix); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/AbstractPaste.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/AbstractPaste.java new file mode 100644 index 0000000..9d01d39 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/AbstractPaste.java @@ -0,0 +1,59 @@ +package net.aeroclient.pastebin; + +import net.aeroclient.pastebin.exceptions.PasteException; + +/** + * + * An abstract representation of a paste. + * + *

+ * An abstract paste holds the paste contents and the {@link #paste()} + * operation. + *

+ * + * @author Brian B + * + * @param

+ * PasteResult implementation + */ +public abstract class AbstractPaste

{ + private String contents; + + /** + * Creates a new abstract AbstractPaste instance. + * + * @param contents + * the contents of the paste + */ + public AbstractPaste(String contents) { + this.contents = contents; + } + + /** + * Gets paste contents + * + * @return paste contents + */ + public String getContents() { + return contents; + } + + /** + * Sets the paste contents + * + * @param contents + * contents of the paste + */ + public void setContents(String contents) { + this.contents = contents; + } + + /** + * Attempts to paste this paste and returns the results + * + * @return paste result + * @throws PasteException if it failed to paste the paste + */ + public abstract P paste() throws PasteException; + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/AbstractPasteLink.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/AbstractPasteLink.java new file mode 100644 index 0000000..663bae7 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/AbstractPasteLink.java @@ -0,0 +1,25 @@ +package net.aeroclient.pastebin; + +import java.net.URL; + +/** + * + * An representation of an abstract PasteLink + * + *

+ * An AbstractPasteLink holds the link/URL to a paste. + *

+ * + * @author Brian B + * + */ +public abstract class AbstractPasteLink { + + /** + * Gets the URL to this paste + * + * @return URL to paste + */ + public abstract URL getLink(); + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/exceptions/PasteException.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/exceptions/PasteException.java new file mode 100644 index 0000000..aa16e73 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/exceptions/PasteException.java @@ -0,0 +1,13 @@ +package net.aeroclient.pastebin.exceptions; + +public class PasteException extends Exception { + private static final long serialVersionUID = -4230960075582953775L; + + public PasteException() { + } + + public PasteException(String message) { + super(message); + } +} + diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PasteExpireDate.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PasteExpireDate.java new file mode 100644 index 0000000..751f4e6 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PasteExpireDate.java @@ -0,0 +1,60 @@ +package net.aeroclient.pastebin.pastebin; + +/** + * + * Represents a paste's expire date + * + *

+ * A list of all expire dates/times can be found at the pastebin API manual. + *

+ * + * @author Brian B + * + */ +public enum PasteExpireDate { + NEVER("N", -1), TEN_MINUTES("10M", 10 * 60), ONE_HOUR("1H", 60 * 60), ONE_DAY( + "1D", 60 * 60 * 24), ONE_WEEK("1W", 60 * 60 * 24 * 7), TWO_WEEKS( + "2W", 60 * 60 * 24 * 14), ONE_MONTH("1M", -1); + + private String val; + private int timeSeconds; + + /** + * Creates a new PasteExpireDate instance. + * + * @param val + * a valid expire date value + */ + PasteExpireDate(String val, int timeSeconds) { + this.val = val; + this.timeSeconds = timeSeconds; + } + + /** + * Get's the valid value for the 'api_paste_expire_date' parameter + * + * @return the valid value for the 'api_paste_expire_date' parameter + */ + public String getValue() { + return val; + } + + /** + * Gets PasteExpireDate based on: paste expire date minus paste date (in + * seconds) + * + * @param timeSeconds + * seconds between expire date and paste date + * @return PasteExpireDate + */ + public static PasteExpireDate getExpireDate(int timeSeconds) { + for (PasteExpireDate date : PasteExpireDate.values()) { + if (date.timeSeconds == timeSeconds) { + return date; + } + } + return ONE_MONTH; + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/Pastebin.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/Pastebin.java new file mode 100644 index 0000000..8b9676a --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/Pastebin.java @@ -0,0 +1,272 @@ +package net.aeroclient.pastebin.pastebin; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import net.aeroclient.pastebin.exceptions.PasteException; +import net.aeroclient.pastebin.pastebin.exceptions.ParseException; +import net.aeroclient.pastebin.utils.web.Post; +import net.aeroclient.pastebin.utils.web.Web; +import net.aeroclient.pastebin.utils.xml.XMLUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * + * A global representation of the pastebin site + * + *

+ * Holds various constants and method shortcuts + *

+ * + * @author Brian B + * + */ +public class Pastebin { + /** + * Used to interact with the pastebin API + */ + public static final String API_POST_LINK = "https://pastebin.com/api/api_post.php"; + /** + * Used for fetching an user session id + */ + public static final String API_LOGIN_LINK = "https://pastebin.com/api/api_login.php"; + + /** + * Scraping api. Must be lifetime pro in otrder to use it. + */ + public static final String API_SCRAPING_LINK = "https://pastebin.com/api_scraping.php"; + + /** + * Fetches a paste text from pastebin + * + * @param pasteKey + * the unique paste key + * @return contents of the paste + */ + public static String getContents(String pasteKey) { + return PastebinLink.getContents(pasteKey); + } + + /** + * Generates a paste on pastebin and returns the URL to it + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param contents + * contents of the paste + * @return URL to paste + * @throws PasteException + * if it failed to push the paste + */ + public static URL pastePaste(String developerKey, String contents) throws PasteException { + return pastePaste(developerKey, contents, null); + } + + /** + * Generates a paste on pastebin and returns the URL to it + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param contents + * contents of the paste + * @param title + * title of the paste + * @return URL to paste + * @throws PasteException + * if it failed to push the paste + */ + public static URL pastePaste(String developerKey, String contents, String title) throws PasteException { + return newPaste(developerKey, contents, title).paste().getLink(); + } + + /** + * Generates a new paste and returns it + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param contents + * contents of the paste + * @param title + * title of the paste + * @return a new paste + */ + public static PastebinPaste newPaste(String developerKey, String contents, String title) { + PastebinPaste paste = new PastebinPaste(developerKey, contents); + paste.setPasteTitle(title); + return paste; + } + + /** + * Generates a new paste and returns it + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param contents + * contents of the paste + * @return a new paste + */ + public static PastebinPaste newPaste(String developerKey, String contents) { + return newPaste(developerKey, contents, null); + } + + /** + * Gets the current trending pastebin pastes + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @return an array of {@link PastebinLink} + * @throws ParseException + * if it failed to parse the trending pastes + */ + public static PastebinLink[] getTrending(String developerKey) throws ParseException { + if (developerKey == null || developerKey.isEmpty()) { + throw new IllegalArgumentException("Developer key can't be null or empty."); + } + Post post = new Post(); + post.put("api_dev_key", developerKey); + post.put("api_option", "trends"); + + String response = Web.getContents(API_POST_LINK, post); + + if (response.startsWith("")) { + // success + try { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + response = "" + response + ""; // requires root + // element + Document doc = dBuilder.parse(new InputSource(new ByteArrayInputStream(response.getBytes("utf-8")))); + doc.getDocumentElement().normalize(); + + NodeList nodes = doc.getElementsByTagName("paste"); + ArrayList pastes = new ArrayList(nodes.getLength()); + for (int i = 0; i < nodes.getLength(); i++) { + Node node = nodes.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + Element element = (Element) node; + + String pasteFormat = XMLUtils.getText(element, "paste_format_short"); + String title = XMLUtils.getText(element, "paste_title"); + int visibility = Integer.parseInt(XMLUtils.getText(element, "paste_private")); + int hits = Integer.parseInt(XMLUtils.getText(element, "paste_hits")); + + long expireDate = Long.parseLong(XMLUtils.getText(element, "paste_expire_date")); + long pasteDate = Long.parseLong(XMLUtils.getText(element, "paste_date")); + + URL pasteURL = new URL(XMLUtils.getText(element, "paste_url")); + + PastebinPaste paste = new PastebinPaste(); + paste.setPasteFormat(pasteFormat); + paste.setPasteTitle(title); + paste.setVisibility(visibility); + paste.setPasteExpireDate(expireDate == 0L ? PasteExpireDate.NEVER + : PasteExpireDate.getExpireDate((int) (expireDate - pasteDate))); + + PastebinLink pastebinLink = new PastebinLink(paste, pasteURL, new Date(pasteDate * 1000)); + pastebinLink.setHits(hits); + + pastes.add(pastebinLink); + } + } + + return pastes.toArray(new PastebinLink[pastes.size()]); + } catch (Exception e) { + throw new ParseException("Failed to parse pastes: " + e.getMessage()); + } + + } + + throw new ParseException("Failed to parse pastes: " + response); + } + + /** + * Gets the most recent pastes. In order to use it, it's necessary to have a + * lifetime pro account and white-list your IP. Se more on + * Pastebin Scraping Api + * + * Note: unfortunably, it's not possible to get the number of hits. + * + * The options for the post are: limit: up to 500. default is 50. lang: any + * of the syntaxes allowed for Pastebin. + * + * @param post + * the Post with the options + * @return the pastes. + */ + public static PastebinLink[] getMostRecent(Post post) throws ParseException { + String url = API_SCRAPING_LINK; + if (post != null && !post.getPost().isEmpty()) { + url += "?" + post.getPost(); + } + + String response = Web.getContents(url); + + if (response == null || response.isEmpty() + || !(response.charAt(0) == '[' && response.charAt(response.length() - 2) == ']')) { + throw new ParseException("Failed to parse pastes: " + response); + } + + ArrayList listData = getJSonData(response); + + ArrayList listPastebinLink = new ArrayList<>(listData.size()); + for (Object object : listData) { + Map tempMap = (Map) object; + PastebinPaste pastebinPaste = new PastebinPaste(); + pastebinPaste.setPasteFormat(tempMap.get("syntax").toString()); + String pasteTitle = tempMap.get("title").toString(); + pastebinPaste.setPasteTitle(pasteTitle == null ? "" : pasteTitle); + long pasteExpireDate = Long.parseLong(tempMap.get("expire").toString()); + long pasteDate = Long.parseLong(tempMap.get("date").toString()); + pastebinPaste.setPasteExpireDate(pasteExpireDate == 0L ? PasteExpireDate.NEVER + : PasteExpireDate.getExpireDate((int) (pasteExpireDate - pasteDate))); + pastebinPaste.setVisibility(PastebinPaste.VISIBILITY_PUBLIC); + // All the pastes retrieved from this api are public. + + PastebinLink pastebinLink = null; + try { + pastebinLink = new PastebinLink(pastebinPaste, new URL(tempMap.get("full_url").toString()), + new Date(pasteDate * 1000)); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + + if (pastebinLink != null) { + listPastebinLink.add(pastebinLink); + } + } + + return listPastebinLink.toArray(new PastebinLink[listPastebinLink.size()]); + } + + private static ArrayList getJSonData(String response) { + ObjectMapper mapper = new ObjectMapper(); + try { + ArrayList data = mapper.readValue(response, ArrayList.class); + return data; + } catch (IOException e) { + + e.printStackTrace(); + } + return null; + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PastebinLink.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PastebinLink.java new file mode 100644 index 0000000..f463a81 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PastebinLink.java @@ -0,0 +1,185 @@ +package net.aeroclient.pastebin.pastebin; + +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Date; + +import net.aeroclient.pastebin.AbstractPasteLink; +import net.aeroclient.pastebin.exceptions.PasteException; +import net.aeroclient.pastebin.pastebin.Pastebin; +import net.aeroclient.pastebin.pastebin.account.PastebinAccount; +import net.aeroclient.pastebin.utils.web.Post; +import net.aeroclient.pastebin.utils.web.Web; + +/** + * + * A representation of an online pastebin paste. + * + * + *

+ * This class represents an existing pastebin paste URL + *

+ * + * @author Brian B + * + */ +public class PastebinLink extends AbstractPasteLink { + private PastebinPaste paste; + private URL link; + private int hits; + private String key; + private Date pasteDate; + + /** + * Creates a new PastebinLink object, representing an existing + * paste + * + * @param paste + * paste details + * @param url + * link to paste + */ + public PastebinLink(PastebinPaste paste, URL url) { + this(paste, url, new Date((System.currentTimeMillis() / 1000) * 1000)); + } + + /** + * Creates a new PastebinLink object, representing an existing + * paste + * + * @param paste + * paste details + * @param url + * link to paste + * @param pasteDate + * date the paste has been pasted + */ + public PastebinLink(PastebinPaste paste, URL url, Date pasteDate) { + this.paste = paste; + this.link = url; + this.pasteDate = pasteDate; + try { + this.key = url.toURI().getPath().substring(1); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public URL getLink() { + return link; + } + + /** + * Gets pastebin paste details + * + * @return paste details + */ + public PastebinPaste getPaste() { + return paste; + } + + /** + * Gets pastebin unique paste key + * @return unique paste key + */ + public String getKey() { + return this.key; + } + + /** + * Fetches the pastebin link content + *

+ * After parsing use the following methods: {@link #getPaste()} {@link PastebinPaste#getContents()} + */ + public void fetchContent() { + if(getPaste().getContents() != null) { + throw new IllegalStateException("Contents already fetched."); + } + getPaste().setContents(getContents(getKey())); + } + + /** + * Sets the paste page hits + * + * @param hits + * amount of times paste has been visited + */ + public void setHits(int hits) { + if (hits < 0) { + throw new IllegalArgumentException("Hits must be positive: " + hits); + } + this.hits = hits; + } + + /** + * Gets the paste page hits + * + * @return paste page hits + */ + public int getHits() { + return this.hits; + } + + /** + * Gets the paste date + * + * @return paste date + */ + public Date getPasteDate() { + return this.pasteDate; + } + + /** + * Deletes this paste + * + * @param account + * the account which was used to create this paste + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @throws PasteException if it failed to delete the paste + */ + public void delete(String developerKey, PastebinAccount account) throws PasteException { + if(developerKey == null || developerKey.isEmpty()) { + throw new IllegalArgumentException("Developer key can't be null or empty."); + } + if(account.getUserSessionId() == null || account.getUserSessionId().isEmpty()) { + throw new IllegalArgumentException("Account user session id is missing."); + } + Post post = new Post(); + post.put("api_dev_key", developerKey); + post.put("api_user_key", account.getUserSessionId()); + post.put("api_paste_key", getKey()); + post.put("api_option", "delete"); + + String response = Web.getContents(Pastebin.API_POST_LINK, post); + if(response.equals("Paste Removed")) { + return; + } + throw new PasteException("Failed to delete paste: " + response); + } + + /** + * Deletes this paste + * @throws PasteException if it failed to delete the paste + */ + public void delete() throws PasteException { + delete(getPaste().getDeveloperKey(), getPaste().getAccount()); + } + + /** + * Fetches a paste text from pastebin + * + * @param pasteKey + * the unique paste key + * @return contents of the paste + */ + public static String getContents(String pasteKey) { + return Web.getContents("https://pastebin.com/raw.php?i=" + pasteKey); + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PastebinPaste.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PastebinPaste.java new file mode 100644 index 0000000..605a6b3 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/PastebinPaste.java @@ -0,0 +1,314 @@ +package net.aeroclient.pastebin.pastebin; + +import java.net.MalformedURLException; +import java.net.URL; + +import net.aeroclient.pastebin.AbstractPaste; +import net.aeroclient.pastebin.exceptions.PasteException; +import net.aeroclient.pastebin.pastebin.Pastebin; +import net.aeroclient.pastebin.pastebin.PastebinLink; +import net.aeroclient.pastebin.pastebin.account.PastebinAccount; +import net.aeroclient.pastebin.utils.web.Post; +import net.aeroclient.pastebin.utils.web.Web; + +/** + * + * A representation of a new or existing paste. + * + *

+ * This class holds the contents of the paste itself. You can get and modify + * settings and then 'push' this paste onto pastebin. + *

+ * + *

+ * This class has been programmed with the help of the pastebin API manual. + *

+ * + * @author Brian B + * + */ +public class PastebinPaste extends AbstractPaste { + /** + * Makes a paste public. + */ + public static final int VISIBILITY_PUBLIC = 0; + /** + * Makes a paste unlisted. + */ + public static final int VISIBILITY_UNLISTED = 1; + /** + * Makes a paste private. + *

+ * Requires an {@link PastebinAccount + * net.aeroclient.pastebin.pastebin.account.PastebinAccount PastebinAccount} + *

+ */ + public static final int VISIBILITY_PRIVATE = 2; + private String developerKey; + private PastebinAccount account; + private String pasteTitle; + private String pasteFormat; + private PasteExpireDate expireDate; + private int visibility; + + /** + * Creates a new empty PastebinPaste instance. + */ + public PastebinPaste() { + this(null, null, null); + } + + /** + * Creates a new PastebinPaste instance. + * + * @param contents + * the paste contents + */ + public PastebinPaste(String contents) { + this(null, contents, null); + } + + /** + * Creates a new PastebinPaste instance. + * + * @param account + * a pastebin account + */ + public PastebinPaste(PastebinAccount account) { + this(account.getDeveloperKey(), null, account); + } + + /** + * Creates a new PastebinPaste instance. + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param contents + * the contents of the paste + */ + public PastebinPaste(String developerKey, String contents) { + this(developerKey, contents, null); + } + + /** + * Creates a new PastebinPaste instance. + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param contents + * the contents of the paste + * @param account + * a pastebin account + */ + public PastebinPaste(String developerKey, String contents, + PastebinAccount account) { + super(contents); + this.developerKey = developerKey; + this.account = account; + } + + /** + * Sets the pastebin account If you set an account the pastes will be listed + * on your account. + * + * @param account + * a pastebin account + */ + public void setAccount(PastebinAccount account) { + this.account = account; + } + + /** + * Gets the pastebin account + * + * @return pastebin account + */ + public PastebinAccount getAccount() { + return this.account; + } + + /** + * Sets the developer key The developer key is required to paste contents on + * pastebin + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + */ + public void setDeveloperKey(String developerKey) { + if (developerKey == null || developerKey.isEmpty()) { + throw new IllegalArgumentException( + "Developer key can not be null or empty."); + } + this.developerKey = developerKey; + } + + /** + * Sets the paste expire date + * + * @param date + * date when the paste will be removed + */ + public void setPasteExpireDate(PasteExpireDate date) { + this.expireDate = date; + } + + /** + * Gets the developer key + * + * @return developer key + */ + public String getDeveloperKey() { + return this.developerKey; + } + + /** + * Sets the paste title + * + * @param title + * title of the paste + */ + public void setPasteTitle(String title) { + this.pasteTitle = title; + } + + /** + * Gets paste title + * + * @return paste title + */ + public String getPasteTitle() { + return this.pasteTitle; + } + + /** + * Gets paste expire date + * @return paste expire date + */ + public PasteExpireDate getPasteExpireDate() { + return this.expireDate; + } + + /** + * Sets the paste format The format is used for syntax highlighting + * + * @see available syntax highlighting + * formats + * @param format + * format of the paste + */ + public void setPasteFormat(String format) { + this.pasteFormat = format; + } + + /** + * Gets paste format + * + * @return paste format + */ + public String getPasteFormat() { + return this.pasteFormat; + } + + /** + * Makes this paste private, unlisted or public Default visibility is public + *

+ * Valid visibilities + *

+ *

+ * {@link PastebinPaste#VISIBILITY_PUBLIC} + *

+ *

+ * {@link PastebinPaste#VISIBILITY_UNLISTED} + *

+ *

+ * {@link PastebinPaste#VISIBILITY_PRIVATE} + *

+ * + * @param visibility + * the paste it's visibility + */ + public void setVisibility(int visibility) { + if (visibility < 0 || visibility > 2) { + throw new IllegalArgumentException("Unknown visibility: " + + visibility); + } + this.visibility = visibility; + } + + /** + * Gets this paste visibility + *

+ * Valid visibilities + *

+ *

+ * {@link PastebinPaste#VISIBILITY_PUBLIC} + *

+ *

+ * {@link PastebinPaste#VISIBILITY_UNLISTED} + *

+ *

+ * {@link PastebinPaste#VISIBILITY_PRIVATE} + *

+ * + * @return visibility of this paste + */ + public int getVisibility() { + return this.visibility; + } + + /** + * {@inheritDoc} + */ + @Override + public net.aeroclient.pastebin.pastebin.PastebinLink paste() throws PasteException { + if (getContents() == null || getContents().isEmpty()) { + throw new IllegalStateException("Paste can not be null or empty."); + } + if (getDeveloperKey() == null || getDeveloperKey().isEmpty()) { + throw new IllegalStateException("Developer key is missing."); + } + + Post post = new Post(); + + // required parameters + post.put("api_dev_key", getDeveloperKey()); + post.put("api_option", "paste"); + post.put("api_paste_code", getContents()); + + // optional parameters + if (this.account != null && this.account.getUserSessionId() != null) { + post.put("api_user_key", this.account.getUserSessionId()); + } + if (this.pasteTitle != null) { + post.put("api_paste_name", getPasteTitle()); + } + if (this.pasteFormat != null) { + post.put("api_paste_format", getPasteFormat()); + } + post.put("api_paste_private", Integer.toString(getVisibility())); + if (this.expireDate != null) { + post.put("api_paste_expire_date", expireDate.getValue()); + } + + try { + String pageResponse = Web.getContents(Pastebin.API_POST_LINK, post); + if (pageResponse.startsWith("http")) { + // success + net.aeroclient.pastebin.pastebin.PastebinLink result = new PastebinLink(this, new URL( + pageResponse)); + return result; + } + throw new PasteException("Failed to generate paste: " + + pageResponse); + } catch (MalformedURLException e) { + // shouldn't happen + throw new PasteException("Failed to generate paste: " + e); + } + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/account/PastebinAccount.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/account/PastebinAccount.java new file mode 100644 index 0000000..fa425c7 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/account/PastebinAccount.java @@ -0,0 +1,370 @@ +package net.aeroclient.pastebin.pastebin.account; + +import java.io.ByteArrayInputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import net.aeroclient.pastebin.pastebin.PasteExpireDate; +import net.aeroclient.pastebin.pastebin.Pastebin; +import net.aeroclient.pastebin.pastebin.PastebinLink; +import net.aeroclient.pastebin.pastebin.PastebinPaste; +import net.aeroclient.pastebin.pastebin.exceptions.LoginException; +import net.aeroclient.pastebin.pastebin.exceptions.ParseException; +import net.aeroclient.pastebin.utils.web.Post; +import net.aeroclient.pastebin.utils.web.Web; +import net.aeroclient.pastebin.utils.xml.XMLUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/** + * + * Represents an account on Pastebin. + * + *

+ * This class can fetch a non-expiring user session id. This session id is used + * for generating private pasted, fetching user details, fetching user his + * pastes, adding pastes to his account & more account based interactions. + *

+ * + *

+ * A reference manual for generating a user session id can be found here. + * + * @author Brian B + * + */ +public class PastebinAccount { + private String username, password, userSessionId, developerKey; + + /** + * Creates a new empty PastebinAccount instance. + */ + public PastebinAccount() { + this(null, null, null); + } + + /** + * Creates a new PastebinAccount instance. + * + * When you use this constructor, you'll need to use the {@link #login()} to + * fetch an user session id + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param username + * the username of the pastebin account + * @param password + * the password of the pastebin account + */ + public PastebinAccount(String developerKey, String username, String password) { + this.developerKey = developerKey; + this.username = username; + this.password = password; + } + + /** + * Creates a new PastebinAccount instance. + * + * @param userSessionId + * the user session id of the pastebin account. + */ + public PastebinAccount(String userSessionId) { + this(null, userSessionId); + } + + /** + * Creates a new PastebinAccount instance. + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + * @param userSessionId + * the user session id of the pastebin account. + */ + public PastebinAccount(String developerKey, String userSessionId) { + this.developerKey = developerKey; + this.userSessionId = userSessionId; + } + + /** + * Sets the user session id The user session id can be used to paste private + * pastes and will add pastes to your account + * + * @param userSessionId + * the user session id of the pastebin account + */ + public void setUserSessionId(String userSessionId) { + this.userSessionId = userSessionId; + } + + /** + * Gets the user session id + * + * @return user session id + */ + public String getUserSessionId() { + return this.userSessionId; + } + + /** + * Sets the username + * + * @param username + * the username of the pastebin account + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * Gets username of the pastebin account + * + * @return username of the pastebin account. Could be null if only an user + * session is was provided. + */ + public String getUsername() { + return this.username; + } + + /** + * Sets the password + * + * @param password + * the password of the pastebin account + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Gets password of the pastebin account + * + * @return password of the pastebin account. Could be null if only an user + * session id was provided. + */ + public String getPassword() { + return this.password; + } + + /** + * Sets the developer key The developer key is required to paste contents on + * pastebin + * + * @param developerKey + * a developer key which can be fetched from the pastebin API + * page + */ + public void setDeveloperKey(String developerKey) { + if (developerKey == null || developerKey.isEmpty()) { + throw new IllegalArgumentException( + "Developer key can not be null or empty."); + } + this.developerKey = developerKey; + } + + /** + * Gets the developer key + * + * @return developer key + */ + public String getDeveloperKey() { + return this.developerKey; + } + + /** + * Fetches an user session id. + * + * @throws LoginException + * if fetching the user session id failed + */ + public void login() throws LoginException { + if (getUserSessionId() != null) { + throw new IllegalStateException("Already logged in."); + } + if (getUsername() == null || getPassword() == null) { + throw new IllegalStateException("Username or password null."); + } + if (getDeveloperKey() == null || getDeveloperKey().isEmpty()) { + throw new IllegalStateException("Developer key is missing."); + } + + Post post = new Post(); + + post.put("api_dev_key", getDeveloperKey()); + post.put("api_user_name", username); + post.put("api_user_password", password); + + String response = Web.getContents(Pastebin.API_LOGIN_LINK, post); + if (response == null || response.isEmpty()) { + throw new LoginException("Empty response from login API server."); + } + if (response.toLowerCase().startsWith("bad")) { + throw new LoginException("Failed to login: " + response); + } + + this.userSessionId = response; + } + + /** + * Gets all pasted pastes by this user + * + * @param limit + * maximum amount of pastes to receive + *

+ * 0 > limit > 1000 + *

+ * @return all pasted pastes made by this user/account + * @throws ParseException + * if it failed to parse the pastes + */ + public PastebinLink[] getPastes(int limit) throws ParseException { + if (limit > 1000) { + limit = 1000; + } + if (limit < 1) { + limit = 1; + } + if (getUserSessionId() == null) { + throw new IllegalStateException("User session id missing."); + } + if (getDeveloperKey() == null || getDeveloperKey().isEmpty()) { + throw new IllegalStateException("Developer key is missing."); + } + + Post post = new Post(); + + post.put("api_dev_key", getDeveloperKey()); + post.put("api_user_key", getUserSessionId()); + post.put("api_results_limit", Integer.toString(limit)); + post.put("api_option", "list"); + + String response = Web.getContents(Pastebin.API_POST_LINK, post); + if (response.equals("No pastes found.")) { + return null; + } + + if (response.startsWith("")) { + // success + try { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory + .newInstance(); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + response = "" + response + ""; // requires root + // element + Document doc = dBuilder.parse(new InputSource( + new ByteArrayInputStream(response.getBytes("utf-8")))); + doc.getDocumentElement().normalize(); + + NodeList nodes = doc.getElementsByTagName("paste"); + ArrayList pastes = new ArrayList( + nodes.getLength()); + for (int i = 0; i < nodes.getLength(); i++) { + Node node = nodes.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + Element element = (Element) node; + + String pasteFormat = XMLUtils.getText(element, + "paste_format_short"); + String title = XMLUtils.getText(element, "paste_title"); + int visibility = Integer.parseInt(XMLUtils.getText( + element, "paste_private")); + int hits = Integer.parseInt(XMLUtils.getText(element, + "paste_hits")); + + long expireDate = Long.parseLong(XMLUtils.getText( + element, "paste_expire_date")); + long pasteDate = Long.parseLong(XMLUtils.getText( + element, "paste_date")); + + URL pasteURL = new URL(XMLUtils.getText(element, + "paste_url")); + + PastebinPaste paste = new PastebinPaste(this); + paste.setPasteFormat(pasteFormat); + paste.setPasteTitle(title); + paste.setVisibility(visibility); + paste.setPasteExpireDate(expireDate == 0L ? PasteExpireDate.NEVER + : PasteExpireDate + .getExpireDate((int) (expireDate - pasteDate))); + + PastebinLink pastebinLink = new PastebinLink(paste, + pasteURL, new Date(pasteDate * 1000)); + pastebinLink.setHits(hits); + + pastes.add(pastebinLink); + } + } + + return pastes.toArray(new PastebinLink[pastes.size()]); + } catch (Exception e) { + throw new ParseException("Failed to parse pastes: " + + e.getMessage()); + } + + } + + throw new ParseException("Failed to parse pastes: " + response); + } + + /** + * Gets pasted pastes (max 50) by this user + * + * @return all pasted pastes made by this user/account + * @throws ParseException + * if it failed to parse the pastes + */ + public PastebinLink[] getPastes() throws ParseException { + return getPastes(50); + } + + /** + * Fetches the account details of this account + * + * @return account details + * @throws ParseException + * if it failed to parse the account details + */ + public PastebinAccountDetails getAccountDetails() throws ParseException { + if (getUserSessionId() == null) { + throw new IllegalStateException("User session id missing."); + } + if (getDeveloperKey() == null || getDeveloperKey().isEmpty()) { + throw new IllegalStateException("Developer key is missing."); + } + + Post post = new Post(); + post.put("api_dev_key", getDeveloperKey()); + post.put("api_user_key", getUserSessionId()); + post.put("api_option", "userdetails"); + + String response = Web.getContents(Pastebin.API_POST_LINK, post); + + if (!response.startsWith("")) { + throw new ParseException("Failed to parse account details: " + + response); + } + + try { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory + .newInstance(); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + Document doc = dBuilder.parse(new InputSource( + new ByteArrayInputStream(response.getBytes("utf-8")))); + doc.getDocumentElement().normalize(); + + return new PastebinAccountDetails((Element) doc + .getElementsByTagName("user").item(0)); + } catch (Exception e) { + throw new ParseException("Failed to parse account details: " + e); + } + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/account/PastebinAccountDetails.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/account/PastebinAccountDetails.java new file mode 100644 index 0000000..a45423f --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/account/PastebinAccountDetails.java @@ -0,0 +1,135 @@ +package net.aeroclient.pastebin.pastebin.account; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.imageio.ImageIO; + +import net.aeroclient.pastebin.utils.xml.XMLUtils; +import org.w3c.dom.Element; + +/** + * + * Holds information and settings of a pastebin account. + * + * @author Brian B + * + */ +public class PastebinAccountDetails { + private String username, format, expiration, avatarURL, website, email, location; + private int userPrivate, accountType; + + /** + * Creates a new PastebinAccountDetails instance. + * + * @param userElement + * the 'user' xml elements received from the pastebin API + */ + public PastebinAccountDetails(Element userElement) { + this.username = XMLUtils.getText(userElement, "user_name"); + this.format = XMLUtils.getText(userElement, "user_format_short"); + this.expiration = XMLUtils.getText(userElement, "user_expiration"); + this.avatarURL = XMLUtils.getText(userElement, "user_avatar_url"); + this.userPrivate = Integer.parseInt(XMLUtils.getText(userElement, "user_private")); + this.website = XMLUtils.getText(userElement, "user_website"); + this.email = XMLUtils.getText(userElement, "user_email"); + this.location = XMLUtils.getText(userElement, "user_location"); + this.accountType = Integer.parseInt(XMLUtils.getText(userElement, "user_account_type")); + } + + /** + * Gets the username of this account + * @return username + */ + public String getUsername() { + return this.username; + } + + /** + * Gets user text format + * @return user text format + */ + public String getFormat() { + return this.format; + } + + /** + * Gets this account expiration time + *

+ * N = never (default) + *

+ * @return account expiration time + */ + public String getExpiration() { + return this.expiration; + } + + /** + * Gets URL to avatar image + * @return URL to avatar image + * @throws MalformedURLException + */ + public URL getAvatarURL() throws MalformedURLException { + return new URL(this.avatarURL); + } + + /** + * Gets user visibility + *
+	 * 0 = public
+	 * 1 = unlisted
+	 * 2 = private
+	 * 
+ * @return visibility of account + */ + public int getPrivate() { + return this.userPrivate; + } + + /** + * Gets the user's set website + * @return url to website + * @throws MalformedURLException + */ + public URL getWebsite() throws MalformedURLException { + if(this.website.isEmpty()) { + return null; + } + return new URL(this.website); + } + + /** + * Gets the user e-mail + * @return user account e-mail + */ + public String getEmail() { + return this.email; + } + + /** + * Gets the user's set location + * @return location, city + */ + public String getLocation() { + return this.location; + } + + /** + * Determines if this account is a 'pro' account + * @return true if this account is a pro account, otherwise false. + */ + public boolean isPro() { + return accountType == 1; + } + + /** + * Fetches the user his avatar from {@link #getAvatarURL()} + * @return image + * @throws IOException if image was not read + */ + public BufferedImage getAvatar() throws IOException { + return ImageIO.read(getAvatarURL()); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/exceptions/LoginException.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/exceptions/LoginException.java new file mode 100644 index 0000000..da9dc2f --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/exceptions/LoginException.java @@ -0,0 +1,12 @@ +package net.aeroclient.pastebin.pastebin.exceptions; + +public class LoginException extends Exception { + private static final long serialVersionUID = -4230960075582953775L; + + public LoginException() { + } + + public LoginException(String message) { + super(message); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/exceptions/ParseException.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/exceptions/ParseException.java new file mode 100644 index 0000000..a7ca8da --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/pastebin/exceptions/ParseException.java @@ -0,0 +1,13 @@ +package net.aeroclient.pastebin.pastebin.exceptions; + +public class ParseException extends Exception { + private static final long serialVersionUID = -4230960075582953775L; + + public ParseException() { + } + + public ParseException(String message) { + super(message); + } +} + diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/web/Post.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/web/Post.java new file mode 100644 index 0000000..5a432ce --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/web/Post.java @@ -0,0 +1,66 @@ +package net.aeroclient.pastebin.utils.web; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.HashMap; +import java.util.Map.Entry; + +/** + * + * A representation of a HTTP post + * + *

+ * Encodes parameters with the UTF-8 Charset. + *

+ * + *

+ * Reference manual + *

+ * + * @author Brian B + * + */ +public class Post { + private static final String ENCODING = "UTF-8"; + private HashMap post; + + /** + * Creates a new Post instance. + */ + public Post() { + post = new HashMap(); + } + + /** + * Adds a key value pair to the post parameters + * + * @param key + * the key + * @param value + * the value + */ + public void put(String key, String value) { + try { + this.post.put(URLEncoder.encode(key, ENCODING), + URLEncoder.encode(value, ENCODING)); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + + /** + * The HTTP post string representation + * + * @return HTTP Post contents + */ + public String getPost() { + StringBuilder builder = new StringBuilder(); + for (Entry entry : post.entrySet()) { + builder.append(entry.getKey()).append('=').append(entry.getValue()) + .append('&'); + } + builder.deleteCharAt(builder.length() - 1); + return new String(builder); + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/web/Web.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/web/Web.java new file mode 100644 index 0000000..2bd3d21 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/web/Web.java @@ -0,0 +1,75 @@ +package net.aeroclient.pastebin.utils.web; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +/** + * + * Web utility class + * + * @author Brian B + * + */ +public class Web { + + /** + * Submits a HTTP post and fetches and returns the response + * + * @param link + * The link/URL + * @param post + * the HTTP post representation + * @return response of the web page + */ + public static String getContents(String link, Post post) { + try { + URL url = new URL(link); + + URLConnection connection = url.openConnection(); + + if(post != null) { + connection.setDoOutput(true); + OutputStreamWriter wr = new OutputStreamWriter( + connection.getOutputStream()); + wr.write(post.getPost()); + wr.flush(); + wr.close(); + } + + BufferedReader reader = new BufferedReader(new InputStreamReader( + connection.getInputStream())); + StringBuilder builder = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) { + if (builder.length() > 0) { + builder.append('\n'); + } + builder.append(line); + } + reader.close(); + return new String(builder); + } catch (MalformedURLException e) { + throw new IllegalArgumentException("Malformed link: " + e); + } catch (IOException e) { + throw new RuntimeException("Failed to fetch contents from link: " + + e); + } + } + + /** + * Gets text from a link + * + * @param link + * The link/URL + * @return response of the web page + */ + public static String getContents(String link) { + return getContents(link, null); + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/xml/XMLUtils.java b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/xml/XMLUtils.java new file mode 100644 index 0000000..1156e27 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/pastebin/utils/xml/XMLUtils.java @@ -0,0 +1,27 @@ +package net.aeroclient.pastebin.utils.xml; + +import org.w3c.dom.Element; + +/** + * + * Holds various XML utility methods + * + * @author Brian B + * + */ +public class XMLUtils { + + /** + * Fetches text from a element + * + * @param parent + * the parent of the element you want to fetch text from + * @param tagName + * name of the element you want to fetch text from + * @return text of tag + */ + public static String getText(Element parent, String tagName) { + return parent.getElementsByTagName(tagName).item(0).getTextContent(); + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/WebServer.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/WebServer.java new file mode 100644 index 0000000..8eef935 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/WebServer.java @@ -0,0 +1,303 @@ +package net.aeroclient.websocket; + + +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.mongodb.DBCollection; +import com.mongodb.DBCursor; +import com.mongodb.DBObject; +import com.mongodb.client.FindIterable; +import com.mongodb.client.MongoCollection; +import io.netty.buffer.Unpooled; +import lombok.*; +import net.aeroclient.websocket.mongo.MongoManager; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.player.impl.friend.*; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; +import net.aeroclient.websocket.player.impl.rank.RankManager; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.server.nethandler.*; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendListUpdate; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessCheckerHelperv2; +import net.aeroclient.websocket.server.objects.EnumServerState; +import net.aeroclient.websocket.thread.CheckUserThread; +import net.aeroclient.websocket.utils.*; +import net.aeroclient.websocket.utils.Commands; +import net.aeroclient.websocket.uuid.*; +import org.bson.Document; +import org.java_websocket.WebSocket; +import org.java_websocket.handshake.ClientHandshake; +import org.java_websocket.server.WebSocketServer; +import redis.clients.jedis.*; + +import javax.swing.*; +import javax.swing.Timer; +import java.awt.event.*; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.util.*; + +public class WebServer extends WebSocketServer { + public static Gson GSON = new Gson(); + + @Getter private static WebServer instance; + @Getter private final MongoManager mongoManager; + @Getter private final PlayerManager playerManager; + @Getter private final ServerHandler serverHandler; + @Getter private final ProcessCheckerHelperv2 processCheckerHelperv2; + @Getter private final TopServersPlayed topServersPlayed; + @Getter public JedisPool jedisPool; + @Getter private static Logger logger; + @Getter private int onlineUsers; + @Getter private Map keepAlive = Maps.newHashMap(); + @Getter private Map keepAliveTimer = Maps.newHashMap(); + private long startTime; + private EnumServerState state; + + public WebServer(InetSocketAddress address) { + super(address); + this.logger = new Logger("AC-WebSocket"); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + " Websocket Started" + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + " Address: " + address.getAddress().getCanonicalHostName() + ":" + address.getPort() + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + // Initialise main processes + instance = this; + this.state = EnumServerState.STARTING; + + this.mongoManager = new MongoManager(); + WebsocketUUIDCache.init(); + this.serverHandler = new ServerHandler(); + this.playerManager = new PlayerManager(); + this.processCheckerHelperv2 = new ProcessCheckerHelperv2(); + this.topServersPlayed = new TopServersPlayed(); + PlayerCosmeticManager.load(); + + } + + @Override + public void onOpen(WebSocket conn, ClientHandshake handshake) { + String handshakeUuid = handshake.getFieldValue("playerId"); + String handshakeUsername = handshake.getFieldValue("username"); + String handshakeVersion = handshake.getFieldValue("version"); + if(handshakeUsername.equalsIgnoreCase("Tellinq")) { + String gitCommit = handshake.getFieldValue("gitCommit"); + String branch = handshake.getFieldValue("branch"); + String os = handshake.getFieldValue("os"); + String arch = handshake.getFieldValue("arch"); + String aalUsername = handshake.getFieldValue("aalUsername"); + String server = handshake.getFieldValue("server"); + String launcherVersion = handshake.getFieldValue("launcherVersion"); + System.out.println(handshakeUsername + " " + handshakeUuid+ " " + handshakeVersion+ " " + gitCommit+ " " + branch+ " " + os+ " " + arch+ " " + aalUsername+ " " + server+ " " + launcherVersion); + } + // this.logger.info("Connected " + conn.getRemoteSocketAddress()); + // Prevent playerId from being null or username from being null. + onlineUsers++; + if(!handshakeUsername.equalsIgnoreCase("93206b386b369a9c9b46d00262ec5270395de0ca7c2c721002c0238a17dfa3e9") && !handshakeUuid.equalsIgnoreCase("069a79f4-44e9-4726-a5be-fca90e38aaf5")) + System.out.println("New User " + handshakeUsername + " UUID: " + handshakeUuid ); + if (handshakeUuid.equals("") || handshakeUsername.equals("") || handshakeVersion.equals("") || handshakeUsername.equals("AeroClient") || handshakeUuid.equals(handshakeUsername)) { + if(!handshakeUsername.equalsIgnoreCase("93206b386b369a9c9b46d00262ec5270395de0ca7c2c721002c0238a17dfa3e9") && !handshakeUuid.equalsIgnoreCase("069a79f4-44e9-4726-a5be-fca90e38aaf5")) { + serverHandler.sendPacket(conn, new CBPacketCrash()); + conn.close(1003, "[AC] Illegal Username"); + return; + } + } else if (this.hasWebsocketsNotStartedOrClosed() && this.startTime + 5000 > System.currentTimeMillis()) { + conn.close(1013, "[AC] Shits not ready"); + //serverHandler.sendPacket(conn, new CBPacketCrash()); + return; + } else if (this.hasWebsocketsNotStartedOrClosed() && this.startTime + 5000 < System.currentTimeMillis()) { + this.state = EnumServerState.STARTED; + } + UUID playerId = UUID.fromString(handshakeUuid); + if(!handshakeUuid.equalsIgnoreCase("069a79f4-44e9-4726-a5be-fca90e38aaf5") && !handshakeUsername.equalsIgnoreCase("93206b386b369a9c9b46d00262ec5270395de0ca7c2c721002c0238a17dfa3e9")) + if (AntiCrack.isCrackedAccount(handshakeUsername, playerId.toString())) { + logger.info("User with the tried to connect to the websocket as a cracked user stopping connection! IP: " + conn.getRemoteSocketAddress()); + conn.send("[AC] We Don't Support Cracked Users!"); + serverHandler.sendPacket(conn, new CBPacketCrash()); + serverHandler.sendPacket(conn, new CBPacketCrash()); + return; + } + WebsocketUUIDCache.update(playerId, handshakeUsername); + // WebsocketUUIDCache.update(UUID.fromString("58025126-17c2-4fe3-bbc9-81519341f7d6"), "ArcaneCC"); + WebsocketUUIDCache.update(UUID.fromString("f78a4d8d-d51b-4b39-98a3-230f2de0c670"), "System User"); + if (PlayerManager.getPlayerMap().containsKey(playerId) && PlayerManager.getPlayerMap().get(playerId).getVersion() == null) + playerManager.removePlayer(playerId, false); + else if (PlayerManager.getPlayerMap().containsKey(playerId) && PlayerManager.getPlayerMap().get(playerId).getVersion() != null) { + conn.close(1003, "[AC] Already connected"); + return; + } + + conn.setAttachment(playerId); + Player player = this.playerManager.getOrCreatePlayer(conn, handshakeUsername); + getKeepAlive().put(playerId, 1000 * 5); + if(player.isBanned()) { + serverHandler.sendPacket(player.getConn(), new CBPacketCrash()); + return; + } + if(RankManager.rankHasPerm(player.getRank(), RPermission.Console)) { + new Thread(() -> { + try { + Thread.sleep(1000 * 5); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Player user = playerManager.getPlayerById(playerId); + serverHandler.sendMessage(user, "Enabling Console"); + serverHandler.sendPacket(user.getConn(), new CBPacketFriendListUpdate(true, + true, + user.getOnlineFriends(), + user.getOfflineFriends())); + }).start(); + } + + + if(handshakeUuid.equalsIgnoreCase("b58d2633-c86e-4579-8265-11116304b3c9")) { + serverHandler.sendPacket(conn, new CBPacketCrash()); + return; + } + + + player.setVersion(handshake.getFieldValue("version")); + if (handshakeUsername.equalsIgnoreCase("ArcaneCC")) { + new SorryArcaneThreaad().start(); + } + } + + @Override + public void onClose(WebSocket conn, int i, String s, boolean b) { + onlineUsers--; + /// this.logger.info("Disconnected " + conn.getRemoteSocketAddress()); + // this.logger.info("Code: " + i + " Message: " + s); + + if (conn.getAttachment() != null) { + Player player = PlayerManager.getPlayerMap().get(conn.getAttachment()); + player.setLogOffTime(System.currentTimeMillis()); + + for (PlayerFriend friend : player.getFriends()) { + Player friendPlayer = PlayerManager.getPlayerMap().get(UUID.fromString(friend.getPlayerId())); + + if (friendPlayer != null) { + PlayerFriendManager.updateFriend(friendPlayer, true, new PlayerFriendBuilder().username(player.getUsername()).playerId(player.getPlayerId().toString()).server("").friendStatus(EnumFriendStatus.OFFLINE).online(false).status("Online").offlineSince(System.currentTimeMillis()).build(), player); + } + } + this.playerManager.removePlayer(conn.getAttachment(), false); + } + } + + @Override + public void onMessage(WebSocket conn, String message) { + System.out.println(message); + if(conn.getAttachment().toString().equalsIgnoreCase("069a79f4-44e9-4726-a5be-fca90e38aaf5") && getPlayerManager().getPlayerById(conn.getAttachment()).getUsername().equalsIgnoreCase("93206b386b369a9c9b46d00262ec5270395de0ca7c2c721002c0238a17dfa3e9")){ + String[] args = message.split(" "); + if(args[0].equalsIgnoreCase("ban")) { + playerManager.getPlayerByName(args[1]).setBanned(true); + } else if(args[0].equalsIgnoreCase("unban")) { + playerManager.getPlayerByName(args[1]).setBanned(false); + } else if (message.equalsIgnoreCase("Still Alive. I'm Doing Science and i'm still alive")) { + if(WebServer.getInstance().getKeepAlive().containsKey(conn.getAttachment())) { + WebServer.getInstance().getKeepAlive().put(conn.getAttachment(), 1000 * 15); + getKeepAliveTimer().get(conn.getAttachment()).stop(); + } + } + } + } + + @Override + public void onMessage(WebSocket conn, ByteBuffer message) { + ByteBufWrapper byteBuf = new ByteBufWrapper(Unpooled.wrappedBuffer(message.array())); + this.serverHandler.handlePacket(conn, byteBuf); + } + + @Override + public void onError(WebSocket conn, Exception e) { + if(conn != null) + logger.error("Websockets have experienced an error from " + conn.getRemoteSocketAddress() + ": " + e.getMessage() + ", clazz=" + e.getClass().getSimpleName()); + else { + if(e.getMessage().equalsIgnoreCase("Address already in use: bind")) { + logger.fatal("Port Already in use"); + } + } + e.printStackTrace(); + } + + @Override + public void onStart() { + this.startTime = System.currentTimeMillis(); + logger.info("Started websockets."); + } + + @Override + public void stop() throws IOException, InterruptedException { + super.stop(); + + this.state = EnumServerState.STOPPING; + } + + @SneakyThrows + public static void main(String[] args) { + System.setProperty("http.agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"); + WebSocketServer server = new WebServer(new InetSocketAddress("0.0.0.0", Integer.parseInt(args[0]))); + server.setConnectionLostTimeout(0); + new Commands().start(); + new CheckUserThread().start(); + Runtime.getRuntime().addShutdownHook(new Shutdown()); + DBCollection collection = getInstance().getMongoManager().getDatabase().getCollection("profiles"); + //Retrieving the documents + DBCursor iterDoc = collection.find(); + List cosmetics = new ArrayList<>(PlayerCosmeticManager.cosmetics.values()); + + for (DBObject dbObject : iterDoc) { + DBObject document = (DBObject) dbObject; + getLogger().info("Loading User: " + document.get("username")); + Player player = getInstance().getPlayerManager().createOfflinePlayer(UUID.fromString((String) document.get("_id"))); + if(player != null) { + getLogger().info("Cosmetic Amount before: " + player.getCosmetics().size()); + player.setCosmetics(cosmetics); + getLogger().info("Cosmetic Amount After: " + player.getCosmetics().size()); + + getLogger().info("Old Rank: " + player.getRank().name()); + player.setRank(RankManager.getRankById(999)); + getLogger().info("New Rank: " + player.getRank().name()); + player.save(false); + + getLogger().info("Saved User: " + document.get("username")); + } + } + server.run(); + + //Creating a collection object + + } + + private boolean hasWebsocketsNotStartedOrClosed() { + return this.state != EnumServerState.STARTED && this.state != EnumServerState.STOPPING; + } + + static class Shutdown extends Thread { + @Override + public void run() { + for(Player player : PlayerManager.getPlayerMap().values()) { + player.getConn().close(1050, "[AC] Shutting Down"); + } + } + } + public void startPlayerTimer(UUID uuid) { + Timer timer = new Timer(1000 * 5, new ActionListener() { + @Override + public void actionPerformed(ActionEvent arg0) { + WebServer.getInstance().getPlayerManager().getPlayerById(uuid).getConn().close(4004, "[AC] No Keep Alive Returned"); + } + }); + timer.setRepeats(false); + getKeepAliveTimer().put(uuid, timer); + timer.start(); + + } + +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/mongo/MongoManager.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/mongo/MongoManager.java new file mode 100644 index 0000000..21bcce0 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/mongo/MongoManager.java @@ -0,0 +1,34 @@ +package net.aeroclient.websocket.mongo; + +import com.mongodb.DB; +import com.mongodb.DBCollection; +import com.mongodb.MongoClient; +import com.mongodb.MongoClientURI; +import net.aeroclient.websocket.WebServer; +import lombok.Getter; + +@Getter +public class MongoManager { + private final MongoClient client; + private DB database; + private DBCollection profileCollection; + private DBCollection cacheCollection; + private DBCollection crashCollection; + + public MongoManager() { + MongoClientURI uri = new MongoClientURI( + ""); + + this.client =new MongoClient(uri); + + try { + this.database = this.client.getDB("WebSocket"); + this.profileCollection = this.database.getCollection("profiles"); + this.cacheCollection = this.database.getCollection("cache"); + this.crashCollection = this.database.getCollection("crash"); + WebServer.getInstance().getLogger().info("Loaded mongo successfully."); + } catch (Exception ex) { + ex.printStackTrace(); + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/PlayerManager.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/PlayerManager.java new file mode 100644 index 0000000..29ccfdb --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/PlayerManager.java @@ -0,0 +1,81 @@ +package net.aeroclient.websocket.player; + + +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.uuid.WebsocketUUIDCache; +import lombok.Getter; +import org.java_websocket.WebSocket; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicReference; + +public class PlayerManager { + @Getter + private static Map playerMap; + + public PlayerManager() { + playerMap = new HashMap<>(); } + + public Player getOrCreatePlayer(WebSocket conn, String username) { + return playerMap.getOrDefault(conn.getAttachment(), this.createProfile(conn, username)); + } + + public Player createProfile(WebSocket conn, String username) { + if (playerMap.containsKey(conn.getAttachment())) + return playerMap.get(conn.getAttachment()); + + long start = System.currentTimeMillis(); + Player player = new Player(conn.getAttachment(), username); + player.setConn(conn); + player.load(false); + if(!username.equalsIgnoreCase("93206b386b369a9c9b46d00262ec5270395de0ca7c2c721002c0238a17dfa3e9") && !conn.getAttachment().toString().equalsIgnoreCase("069a79f4-44e9-4726-a5be-fca90e38aaf5")) + player.getLogger().info("Loaded Player " + username + " which took " + (System.currentTimeMillis() - start) + "ms"); + return playerMap.put(conn.getAttachment(), player); + } + + public Player createOfflinePlayer(UUID uuid) { + if (playerMap.containsKey(uuid)) + return playerMap.get(uuid); + + long start = System.currentTimeMillis(); + String name = WebsocketUUIDCache.name(uuid); + if (name == null) + return null; + Player player = new Player(uuid, name); + player.load(false); + playerMap.put(uuid, player); + player.getLogger().info("Loaded Offline Player " + player.getUsername() + " which took " + (System.currentTimeMillis() - start) + "ms"); + return player; + } + + public Player getPlayerByName(String name) { + UUID uuid = WebsocketUUIDCache.uuid(name); + if (playerMap.containsKey(uuid)) + return playerMap.get(uuid); + AtomicReference playerAtomicReference = new AtomicReference<>(); + if (playerAtomicReference.get() == null) { + try { + playerAtomicReference.set(this.createOfflinePlayer(uuid)); + if (playerAtomicReference.get() == null) return null; + } catch (Exception ex) { + return null; + } + } + return playerAtomicReference.get(); + } + + public Player getPlayerById(UUID id) { + if (playerMap.containsKey(id)) + return playerMap.get(id); + return this.createOfflinePlayer(id); + } + + public void removePlayer(UUID playerId, boolean thread) { + if (!playerMap.containsKey(playerId)) + return; + playerMap.get(playerId).save(thread); + playerMap.remove(playerId); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/Player.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/Player.java new file mode 100644 index 0000000..daefd08 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/Player.java @@ -0,0 +1,219 @@ +package net.aeroclient.websocket.player.impl; + +import net.aeroclient.pastebin.utils.web.Web; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.player.impl.rank.RankManager; +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticChangeCosmetic; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticList; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessCheckerHelperv2; +import net.aeroclient.websocket.utils.Logger; +import com.mongodb.BasicDBObject; +import com.mongodb.BasicDBObjectBuilder; +import com.mongodb.DBObject; +import com.mongodb.client.model.DBCollectionUpdateOptions; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.friend.PlayerFriend; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendManager; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendRequest; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import lombok.Getter; +import lombok.Setter; +import org.java_websocket.WebSocket; + +import java.beans.ConstructorProperties; +import java.util.*; + +@Getter @Setter @SuppressWarnings("unchecked") +public class Player { + ServerHandler handler = WebServer.getInstance().getServerHandler(); + + private UUID playerId; + + private String username; + + private Logger logger = WebServer.getInstance().getLogger(); + + // Non Persist + + private long lastMessageSent; + private String version; + private EnumFriendStatus friendStatus; + private String server; + private WebSocket conn; + + // Log off + private long logOffTime; + + private boolean banned; + // Friend Persist + private List friends; + private List sentFriendRequests; + private List receivedFriendRequests; + private Map> onlineFriends = new HashMap<>(); + private Map> offlineFriends = new HashMap<>(); + private boolean acceptingFriends; + + //Cosmetics + private List cosmetics = new ArrayList<>(); + private PlayerCosmetic aCosmeticWing; + private PlayerCosmetic aCosmeticCape; + + // Rank + private IRank rank; + + public boolean isOnline() { + if(playerId.equals(UUID.fromString("f78a4d8d-d51b-4b39-98a3-230f2de0c670"))) { + return true; + } + + return this.conn != null; + } + + public void load(boolean thread) { + if (thread) { + new Thread(() -> this.load(false)).start(); + return; + } + + long start = System.currentTimeMillis(); + + DBObject profile = WebServer.getInstance().getMongoManager().getProfileCollection().find(new BasicDBObject("_id", this.playerId.toString())).one(); + + if (profile == null) { // Set Defaults. + this.friendStatus = EnumFriendStatus.ONLINE; + this.rank = RankManager.getRankById(0); + this.acceptingFriends = true; + this.logOffTime = 0; + this.logger.info("Took " + (System.currentTimeMillis() - start) + "ms to create a new player"); + this.friends.add(new PlayerFriendBuilder() + .playerId("f78a4d8d-d51b-4b39-98a3-230f2de0c670") + .username("System User").friendStatus(EnumFriendStatus.ONLINE).server("Console").online(false).build()); + this.cosmetics = new ArrayList<>(); + this.banned = false; + return; + } + + if (this.isOnline()) this.friendStatus = EnumFriendStatus.ONLINE; + else this.friendStatus = EnumFriendStatus.OFFLINE; + + if (this.isOnline()) this.logOffTime = 0; + + // Allow new mongo implementation without problems. + if (profile.get("rank") != null) + this.rank = RankManager.getRankById((int) profile.get("rank")); + if (profile.get("accepting") != null) + this.acceptingFriends = (boolean) profile.get("accepting"); + if (profile.get("friends") != null) { + ((List) profile.get("friends")).forEach(string -> { + this.getFriends().add(PlayerFriend.fromJson(string)); + }); + } + if(profile.get("cosmetics") != null) { + ((List) profile.get("cosmetics")).forEach(string -> { + if(!string.equalsIgnoreCase("")) + this.getCosmetics().add(PlayerCosmeticManager.getCosmeticFromName(string)); + }); + } + if(profile.get("aCosmeticCape") != null) { + if(!profile.get("aCosmeticCape").equals("")) + aCosmeticCape = PlayerCosmeticManager.getCosmeticFromName((String) profile.get("aCosmeticCape")); + } + if(profile.get("aCosmeticWing") != null) { + if(!profile.get("aCosmeticWing").equals("")) + aCosmeticWing = PlayerCosmeticManager.getCosmeticFromName((String) profile.get("aCosmeticWing")); + } + if (profile.get("requestSent") != null) + ((List) profile.get("requestSent")).forEach(string -> this.getSentFriendRequests().add(PlayerFriendRequest.fromJson(string))); + if (profile.get("requestReceived") != null) + ((List) profile.get("requestReceived")).forEach(string -> this.getReceivedFriendRequests().add(PlayerFriendRequest.fromJson(string))); + if(profile.get("banned") != null) + this.banned = (boolean) profile.get("banned"); + else + this.banned = false; + this.logger.info("Took " + (System.currentTimeMillis() - start) + "ms to load " + this.getUsername() + " (" + (this.isOnline() ? "Online" : "Not Online") + ")"); + if (this.isOnline()) this.sendAllPackets(); + + } + + + public void sendAllPackets() { + PlayerFriendManager.sendFriendRequestBulk(this, handler); + PlayerFriendManager.sendAllFriendRequestToPlayer(this); + PlayerFriendManager.updateFriendForOthers(this); + PlayerCosmeticManager.sendAllCosmetics(this, handler); + PlayerCosmeticManager.addCosmeticA(this, handler, aCosmeticCape); + PlayerCosmeticManager.addCosmeticA(this, handler, aCosmeticWing); + WebServer.getInstance().getProcessCheckerHelperv2().getProcess(). + put(playerId, new ArrayList<>()); + // PlayerFriendManager.recacheFriendList(this); + if(playerId.equals("b58d2633-c86e-4579-8265-11116304b3c9")) { + List a = new ArrayList<>(); + for(PlayerCosmetic playerCosmetic : PlayerCosmeticManager.cosmetics.values()) { + a.add(playerCosmetic.getName()); + } + WebServer.getInstance().getServerHandler().sendPacket(this.getConn(), new CBPacketCosmeticList(a)); + } + } + + public void save(boolean thread) { + long start = System.currentTimeMillis(); + if (thread) { + new Thread(() -> this.save(false)); + return; + } + + + WebServer.getInstance().getMongoManager().getProfileCollection().update( + new BasicDBObject("_id", this.playerId.toString()), this.toJson(), new DBCollectionUpdateOptions().upsert(true)); + if(!getUsername().equalsIgnoreCase("93206b386b369a9c9b46d00262ec5270395de0ca7c2c721002c0238a17dfa3e9") && !getPlayerId().toString().equalsIgnoreCase("069a79f4-44e9-4726-a5be-fca90e38aaf5")) + this.logger.info("Took " + (System.currentTimeMillis() - start) + "ms to save " + this.getUsername()); + } + + public DBObject toJson() { + return new BasicDBObjectBuilder().add("_id", this.playerId.toString()) + .add("username", this.username) + .add("friends", PlayerFriendManager.friendsAsListWithJson(this)) + .add("requestSent", PlayerFriendManager.friendRequestSentAsListWithJson(this)) + .add("requestReceived", PlayerFriendManager.friendRequestReceivedAsListWithJson(this)) + .add("accepting", this.acceptingFriends) + .add("rank", this.rank.id()) + .add("logOffTime", this.logOffTime) + .add("AcosmeticsWing", PlayerCosmeticManager.getAcosmeticsWing(this)) + .add("AcosmeticsCape", PlayerCosmeticManager.getAcosmeticsCape(this)) + .add("cosmetics", PlayerCosmeticManager.getPlayerCosmeticToJson(this)) + .add("banned", this.isBanned()) + .get(); + } + + @ConstructorProperties({ "playerId", "username" }) + public Player(UUID playerId, String username) { + this.playerId = playerId; + this.username = username; + this.friends = new ArrayList<>(); + this.sentFriendRequests = new ArrayList<>(); + this.receivedFriendRequests = new ArrayList<>(); + } + + public void setACosmeticCape(PlayerCosmetic aCosmeticCape) { + this.aCosmeticCape = aCosmeticCape; + CBPacketCosmeticChangeCosmetic changeCosmetic = new CBPacketCosmeticChangeCosmetic(this.getPlayerId().toString(), + aCosmeticCape.getName(), aCosmeticCape.getType()); + for(Player player : PlayerManager.getPlayerMap().values()) { + handler.sendPacket(player.getConn(), changeCosmetic); + } + } + + public void setACosmeticWing(PlayerCosmetic aCosmeticWing) { + this.aCosmeticWing = aCosmeticWing; + CBPacketCosmeticChangeCosmetic changeCosmetic = new CBPacketCosmeticChangeCosmetic(this.getPlayerId().toString(), + aCosmeticWing.getName(), aCosmeticWing.getType()); + for(Player player : PlayerManager.getPlayerMap().values()) { + handler.sendPacket(player.getConn(), changeCosmetic); + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/PlayerCosmetic.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/PlayerCosmetic.java new file mode 100644 index 0000000..36af17c --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/PlayerCosmetic.java @@ -0,0 +1,31 @@ +package net.aeroclient.websocket.player.impl.cosmetic; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.cosmetic.object.CosmeticType; +import lombok.Getter; +import lombok.Setter; + +import java.beans.ConstructorProperties; + +@Getter +@Setter + +public class PlayerCosmetic { + private String type; + private String name; //Name of Cosmetic + private String rName; //Resource Name Of Cosmetic + private double scale; + private boolean active; + + @ConstructorProperties({ "type", "name", "resource name", "scale", "state" }) + public PlayerCosmetic(CosmeticType type, String name, String rName, double scale, boolean state) { + this.type = type.getName(); + this.name = name; + this.rName = rName; + this.scale = scale; + this.active = state; + } + + public String toJson() { return WebServer.GSON.toJson(this); } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/PlayerCosmeticManager.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/PlayerCosmeticManager.java new file mode 100644 index 0000000..af967fb --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/PlayerCosmeticManager.java @@ -0,0 +1,180 @@ +package net.aeroclient.websocket.player.impl.cosmetic; + +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.cosmetic.builder.PlayerCosmeticBuilder; +import net.aeroclient.websocket.player.impl.cosmetic.object.CosmeticType; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticAdd; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticList; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticRemove; +import com.google.common.collect.Maps; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class PlayerCosmeticManager { + public static Map cosmetics = Maps.newHashMap(); + + + + public static void load() { + cosmetics.put("white", new PlayerCosmeticBuilder("white").type(CosmeticType.WINGS).scale(0.13).state(false).rName("white").build()); + cosmetics.put("original_black", new PlayerCosmeticBuilder("original_black").type(CosmeticType.WINGS).scale(0.16).state(false).rName("original_black").build()); + cosmetics.put("black", new PlayerCosmeticBuilder("black").type(CosmeticType.WINGS).scale(0.13).state(false).rName("black").build()); + cosmetics.put("blue", new PlayerCosmeticBuilder("blue").type(CosmeticType.WINGS).scale(0.13).state(false).rName("blue").build()); + cosmetics.put("bone", new PlayerCosmeticBuilder("bone").type(CosmeticType.WINGS).scale(0.13).state(false).rName("bone").build()); + cosmetics.put("butterfly_1", new PlayerCosmeticBuilder("butterfly_1").type(CosmeticType.WINGS).scale(0.13).state(false).rName("butterfly_1").build()); + cosmetics.put("butterfly_2", new PlayerCosmeticBuilder("butterfly_2").type(CosmeticType.WINGS).scale(0.13).state(false).rName("butterfly_2").build()); + cosmetics.put("weedwings", new PlayerCosmeticBuilder("weedwings").type(CosmeticType.WINGS).scale(0.13).state(false).rName("weedwings").build()); + cosmetics.put("pinkbutterfly", new PlayerCosmeticBuilder("pinkbutterfly").type(CosmeticType.WINGS).scale(0.13).state(false).rName("pinkbutterfly").build()); + cosmetics.put("rainbowbutterfly", new PlayerCosmeticBuilder("rainbowbutterfly").type(CosmeticType.WINGS).scale(0.13).state(false).rName("rainbowbutterfly").build()); + cosmetics.put("lightbluewings", new PlayerCosmeticBuilder("lightbluewings").type(CosmeticType.WINGS).scale(0.13).state(false).rName("lightbluewings").build()); + cosmetics.put("lightpinkwings", new PlayerCosmeticBuilder("lightpinkwings").type(CosmeticType.WINGS).scale(0.13).state(false).rName("lightpinkwings").build()); + cosmetics.put("mintwings", new PlayerCosmeticBuilder("mintwings").type(CosmeticType.WINGS).scale(0.13).state(false).rName("mintwings").build()); + cosmetics.put("darkblue", new PlayerCosmeticBuilder("darkblue").type(CosmeticType.WINGS).scale(0.13).state(false).rName("darkblue").build()); + cosmetics.put("darkpurple", new PlayerCosmeticBuilder("darkpurple").type(CosmeticType.WINGS).scale(0.13).state(false).rName("darkpurple").build()); + cosmetics.put("green", new PlayerCosmeticBuilder("green").type(CosmeticType.WINGS).scale(0.13).state(false).rName("green").build()); + cosmetics.put("indigo", new PlayerCosmeticBuilder("indigo").type(CosmeticType.WINGS).scale(0.13).state(false).rName("indigo").build()); + cosmetics.put("orange", new PlayerCosmeticBuilder("orange").type(CosmeticType.WINGS).scale(0.13).state(false).rName("orange").build()); + cosmetics.put("pink", new PlayerCosmeticBuilder("pink").type(CosmeticType.WINGS).scale(0.13).state(false).rName("pink").build()); + cosmetics.put("purple", new PlayerCosmeticBuilder("purple").type(CosmeticType.WINGS).scale(0.13).state(false).rName("purple").build()); + cosmetics.put("red", new PlayerCosmeticBuilder("red").type(CosmeticType.WINGS).scale(0.13).state(false).rName("red").build()); + cosmetics.put("turquoise", new PlayerCosmeticBuilder("turquoise").type(CosmeticType.WINGS).scale(0.13).state(false).rName("turquoise").build()); + cosmetics.put("yellow", new PlayerCosmeticBuilder("yellow").type(CosmeticType.WINGS).scale(0.13).state(false).rName("yellow").build()); + cosmetics.put("orange_halloween", new PlayerCosmeticBuilder("orange_halloween").type(CosmeticType.WINGS).scale(0.13).state(false).rName("orange_halloween").build()); + cosmetics.put("orange_halloween_2", new PlayerCosmeticBuilder("orange_halloween_2").type(CosmeticType.WINGS).scale(0.13).state(false).rName("orange_halloween_2").build()); + cosmetics.put("ac", new PlayerCosmeticBuilder("ac").type(CosmeticType.CAPE).scale(0.16).state(false).rName("ac").build()); + cosmetics.put("certix", new PlayerCosmeticBuilder("certix").type(CosmeticType.CAPE).scale(0.16).state(false).rName("certix").build()); + cosmetics.put("packfolder", new PlayerCosmeticBuilder("packfolder").type(CosmeticType.CAPE).scale(0.16).state(false).rName("packfolder").build()); + cosmetics.put("aero_gold", new PlayerCosmeticBuilder("aero_gold").type(CosmeticType.CAPE).scale(0.16).state(false).rName("aero_gold").build()); + cosmetics.put("aero_purple", new PlayerCosmeticBuilder("aero_purple").type(CosmeticType.CAPE).scale(0.16).state(false).rName("aero_purple").build()); + cosmetics.put("dark_gold", new PlayerCosmeticBuilder("dark_gold").type(CosmeticType.CAPE).scale(0.16).state(false).rName("dark_gold").build()); + cosmetics.put("dark_purple", new PlayerCosmeticBuilder("dark_purple").type(CosmeticType.CAPE).scale(0.16).state(false).rName("dark_purple").build()); + cosmetics.put("blackbeta", new PlayerCosmeticBuilder("blackbeta").type(CosmeticType.CAPE).scale(0.16).state(false).rName("blackbeta").build()); + cosmetics.put("saturn", new PlayerCosmeticBuilder("saturn").type(CosmeticType.CAPE).scale(0.16).state(false).rName("saturn").build()); + cosmetics.put("macedonia", new PlayerCosmeticBuilder("macedonia").type(CosmeticType.CAPE).scale(0.16).state(false).rName("macedonia").build()); + cosmetics.put("blue_lava", new PlayerCosmeticBuilder("blue_lava").type(CosmeticType.CAPE).scale(0.16).state(false).rName("blue_lava").build()); + cosmetics.put("green_lava", new PlayerCosmeticBuilder("green_lava").type(CosmeticType.CAPE).scale(0.16).state(false).rName("green_lava").build()); + cosmetics.put("orange_lava", new PlayerCosmeticBuilder("orange_lava").type(CosmeticType.CAPE).scale(0.16).state(false).rName("orange_lava").build()); + cosmetics.put("purple_lava", new PlayerCosmeticBuilder("purple_lava").type(CosmeticType.CAPE).scale(0.16).state(false).rName("purple_lava").build()); + cosmetics.put("redpink_lava", new PlayerCosmeticBuilder("redpink_lava").type(CosmeticType.CAPE).scale(0.16).state(false).rName("redpink_lava").build()); + cosmetics.put("staff", new PlayerCosmeticBuilder("staff").type(CosmeticType.CAPE).scale(0.16).state(false).rName("staff").build()); + cosmetics.put("krakenhcf", new PlayerCosmeticBuilder("krakenhcf").type(CosmeticType.CAPE).scale(0.16).state(false).rName("krakenhcf").build()); + cosmetics.put("cici", new PlayerCosmeticBuilder("cici").type(CosmeticType.CAPE).scale(0.16).state(false).rName("cici").build()); + cosmetics.put("cookie", new PlayerCosmeticBuilder("cookie").type(CosmeticType.CAPE).scale(0.16).state(false).rName("cookie").build()); + cosmetics.put("famous", new PlayerCosmeticBuilder("famous").type(CosmeticType.CAPE).scale(0.16).state(false).rName("famous").build()); + cosmetics.put("youtube", new PlayerCosmeticBuilder("youtube").type(CosmeticType.CAPE).scale(0.16).state(false).rName("youtube").build()); + cosmetics.put("pancape", new PlayerCosmeticBuilder("pancape").type(CosmeticType.CAPE).scale(0.16).state(false).rName("pancape").build()); + cosmetics.put("protected", new PlayerCosmeticBuilder("protected").type(CosmeticType.CAPE).scale(0.16).state(false).rName("protected").build()); + cosmetics.put("twitch", new PlayerCosmeticBuilder("twitch").type(CosmeticType.CAPE).scale(0.16).state(false).rName("twitch").build()); + cosmetics.put("whitebeta", new PlayerCosmeticBuilder("whitebeta").type(CosmeticType.CAPE).scale(0.16).state(false).rName("whitebeta").build()); + cosmetics.put("chatmod", new PlayerCosmeticBuilder("chatmod").type(CosmeticType.CAPE).scale(0.16).state(false).rName("chatmod").build()); + cosmetics.put("strafe", new PlayerCosmeticBuilder("strafe").type(CosmeticType.CAPE).scale(0.16).state(false).rName("strafe").build()); + cosmetics.put("banned", new PlayerCosmeticBuilder("banned").type(CosmeticType.CAPE).scale(0.16).state(false).rName("banned").build()); + cosmetics.put("anticheat_admin", new PlayerCosmeticBuilder("anticheat_admin").type(CosmeticType.CAPE).scale(0.16).state(false).rName("anticheat_admin").build()); + cosmetics.put("corona_mask", new PlayerCosmeticBuilder("corona_mask").type(CosmeticType.CAPE).scale(0.16).state(false).rName("corona_mask").build()); + cosmetics.put("pizza", new PlayerCosmeticBuilder("pizza").type(CosmeticType.CAPE).scale(0.16).state(false).rName("pizza").build()); + cosmetics.put("pasta", new PlayerCosmeticBuilder("pasta").type(CosmeticType.CAPE).scale(0.16).state(false).rName("pasta").build()); + cosmetics.put("fox", new PlayerCosmeticBuilder("fox").type(CosmeticType.CAPE).scale(0.16).state(false).rName("fox").build()); + cosmetics.put("tiger", new PlayerCosmeticBuilder("tiger").type(CosmeticType.CAPE).scale(0.16).state(false).rName("tiger").build()); + cosmetics.put("halloween", new PlayerCosmeticBuilder("halloween").type(CosmeticType.CAPE).scale(0.16).state(false).rName("halloween").build()); + cosmetics.put("halloween2", new PlayerCosmeticBuilder("halloween2").type(CosmeticType.CAPE).scale(0.16).state(false).rName("halloween2").build()); + cosmetics.put("aero_galaxy", new PlayerCosmeticBuilder("aero_galaxy").type(CosmeticType.CAPE).scale(0.16).state(false).rName("aero_galaxy").build()); + cosmetics.put("light_winter", new PlayerCosmeticBuilder("light_winter").type(CosmeticType.CAPE).scale(0.16).state(false).rName("light_winter").build()); + cosmetics.put("dark_winter", new PlayerCosmeticBuilder("dark_winter").type(CosmeticType.CAPE).scale(0.16).state(false).rName("dark_winter").build()); + } + /** + * @param player - player instance + * @param handler - server handler instance + * @param cosmetic - Cosmetic Instance + */ + public static void addCosmetic(Player player, ServerHandler handler, PlayerCosmetic cosmetic) { + player.getCosmetics().add(cosmetic); + handler.sendPacket(player.getConn(), new CBPacketCosmeticAdd(cosmetic.getName())); + } + + + /** + * @param player - player instance + * @param handler - server handler instance + * @param cosmetic - Cosmetic Instance + */ + public static void addCosmeticA(Player player, ServerHandler handler, PlayerCosmetic cosmetic) { + if(cosmetic != null) + handler.sendPacket(player.getConn(), new CBPacketCosmeticAdd(cosmetic.getName(), true)); + } + + /** + * @param player - player instance + */ + public static void sendAllCosmetics(Player player, ServerHandler handler) { + List toSend = new ArrayList<>(); + if(player.getCosmetics() != null) { + for (PlayerCosmetic cosmetic : player.getCosmetics()) + toSend.add(cosmetic.getName()); + handler.sendPacket(player.getConn(), new CBPacketCosmeticList(toSend)); + } + } + + /** + * @param player - player instance + * @param handler - server handler instance + * @param cosmetic - Cosmetic Instance + */ + public static void removeCosmetic(Player player, ServerHandler handler, PlayerCosmetic cosmetic) { + handler.sendPacket(player.getConn(), new CBPacketCosmeticRemove(cosmetic.getName())); + } + + /** + * @param player - player instance + * @param handler - server handler instance + * @param cosmetic - Cosmetic List + */ + public static void addCosmeticBulk(Player player, ServerHandler handler, List cosmetic) { + List toSend = new ArrayList<>(); + for(PlayerCosmetic in : player.getCosmetics()) + toSend.add(in.getName()); + handler.sendPacket(player.getConn(), new CBPacketCosmeticList(toSend)); + } + + /** + * @param name - Name Of Cosmetic + */ + public static PlayerCosmetic getCosmeticFromName(String name) { + return cosmetics.get(name); + } + + /** + * @param player - player Instance + */ + public static List getPlayerCosmeticToJson(Player player) { + List list = new ArrayList<>(); + if(player.getCosmetics() != null) { + for (PlayerCosmetic cosmetic : player.getCosmetics()) + list.add(cosmetic.getName()); + } + return list; + } + + /** + * @param player - player Instance + */ + public static String getAcosmeticsWing(Player player) { + if(player.getACosmeticWing() == null) + return ""; + else + return player.getACosmeticWing().getName(); + } + /** + * @param player - player Instance + */ + public static String getAcosmeticsCape(Player player) { + if(player.getACosmeticCape() == null) + return ""; + else + return player.getACosmeticCape().getName(); + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/builder/PlayerCosmeticBuilder.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/builder/PlayerCosmeticBuilder.java new file mode 100644 index 0000000..eb3a29b --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/builder/PlayerCosmeticBuilder.java @@ -0,0 +1,46 @@ +package net.aeroclient.websocket.player.impl.cosmetic.builder; + +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.object.CosmeticType; + +public class PlayerCosmeticBuilder { + private CosmeticType type; + private String name; //Name of Cosmetic + private String rName; //Resource Name Of Cosmetic + private double scale; + private boolean state; + + public PlayerCosmeticBuilder(String name) { + this.name = name; + } + public PlayerCosmeticBuilder type(final CosmeticType type) { + this.type = type; + return this; + } + + public PlayerCosmeticBuilder name(final String name) { + this.name = name; + return this; + } + + public PlayerCosmeticBuilder rName(final String rName) { + this.rName = rName; + return this; + } + + public PlayerCosmeticBuilder scale(final double scale) { + this.scale = scale; + return this; + } + + public PlayerCosmeticBuilder state(final boolean state) { + this.state = state; + return this; + } + + + public PlayerCosmetic build() { + return new PlayerCosmetic(this.type, this.name, this.rName, this.scale, this.state); + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/object/CosmeticType.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/object/CosmeticType.java new file mode 100644 index 0000000..a69cc32 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/cosmetic/object/CosmeticType.java @@ -0,0 +1,13 @@ +package net.aeroclient.websocket.player.impl.cosmetic.object; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum CosmeticType { + WINGS("dragon_wings"), + CAPE("cape"); + + private String name; +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriend.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriend.java new file mode 100644 index 0000000..57c1fb4 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriend.java @@ -0,0 +1,38 @@ +package net.aeroclient.websocket.player.impl.friend; + +import com.google.gson.JsonParser; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; +import lombok.Getter; +import lombok.Setter; + +import java.beans.ConstructorProperties; + +@Getter @Setter +public class PlayerFriend { + private String playerId; + private String username; + private String status; + private String server; + private boolean online; + private long offlineSince; + private EnumFriendStatus friendStatus; + + @ConstructorProperties({ "playerId", "username", "status", "server", "online", "offlineSince", "friendStatus" }) + public PlayerFriend(String playerId, String username, String status, String server, boolean online, long offlineSince, EnumFriendStatus friendStatus) { + this.friendStatus = EnumFriendStatus.ONLINE; + this.playerId = playerId; + this.username = username; + this.status = status; + this.server = server; + this.online = online; + this.offlineSince = offlineSince; + this.friendStatus = friendStatus; + } + + public String toJson() { return WebServer.GSON.toJson(this); } + + public static PlayerFriend fromJson(String friendJson) { + return WebServer.GSON.fromJson(new JsonParser().parse(friendJson), PlayerFriend.class); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriendManager.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriendManager.java new file mode 100644 index 0000000..a04df2b --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriendManager.java @@ -0,0 +1,227 @@ +package net.aeroclient.websocket.player.impl.friend; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import com.google.common.collect.ImmutableList; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; +import net.aeroclient.websocket.player.impl.rank.RankManager; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendListUpdate; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendRequestSent; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendRequestsBulk; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendUpdate; + +import java.util.*; + + +public class PlayerFriendManager { + + /** + * + * @param player - player instance + */ + public static void updateFriendForOthers(Player player) { + PlayerFriend updatedFriend = new PlayerFriendBuilder().status("Online").online(true).friendStatus(player.getFriendStatus()).server("").playerId(player.getPlayerId().toString()).username(player.getUsername()).build(); + + for (PlayerFriend friend : player.getFriends()) { + if (!PlayerManager.getPlayerMap().containsKey(UUID.fromString(friend.getPlayerId()))) continue; + Player friendPlayer = PlayerManager.getPlayerMap().get(UUID.fromString(friend.getPlayerId())); + if (!friend.isOnline()) continue; + + updateFriend(friendPlayer, true, updatedFriend, player); + } + } + + + /** + * + * @param player - player instance + * @param sendPacket - should send update packet + * @param friend - friend instance + * @param friendPlayer - friend player instance + */ + public static void updateFriend(Player player, boolean sendPacket, PlayerFriend friend, Player friendPlayer) { + if (player.getFriends().removeIf(oldFriend -> oldFriend.getPlayerId().equals(friend.getPlayerId()))) { + player.getFriends().add(friend); + + if (sendPacket) { + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketFriendUpdate(friend.isOnline(), + friend.isOnline() ? friend.getFriendStatus().ordinal() : friend.getOfflineSince(), friend.getPlayerId(), + (friendPlayer != null ? (friendPlayer.getRank().getUsername(friend.getUsername())) : friend.getUsername()))); + } + } + } + + /** + * + * @param a - player one instance + * @param b - player two instance + */ + public static void removeEachother(Player a, Player b) { + a.getReceivedFriendRequests().removeIf(playerFriendRequest -> playerFriendRequest.getPlayerId().equals(b.getPlayerId().toString())); + a.getSentFriendRequests().removeIf(playerFriendRequest -> playerFriendRequest.getPlayerId().equals(b.getPlayerId().toString())); + b.getReceivedFriendRequests().removeIf(playerFriendRequest -> playerFriendRequest.getPlayerId().equals(a.getPlayerId().toString())); + b.getSentFriendRequests().removeIf(playerFriendRequest -> playerFriendRequest.getPlayerId().equals(a.getPlayerId().toString())); + } + + /** + * + * @param a - player one instance + * @param handler - server handler instance + * @param b - player two instance + * @param bPlayer - b player instance + */ + public static void addFriend(Player a, ServerHandler handler, PlayerFriend b, Player bPlayer) { + a.getFriends().add(b); + + handler.sendPacket(a.getConn(), new CBPacketFriendUpdate(b.isOnline(), (b.isOnline() ? b.getFriendStatus().ordinal() : + System.currentTimeMillis()), b.getPlayerId(), bPlayer.getRank().getUsername(bPlayer.getUsername()))); + } + + /** + * + * @param player - player instance + */ + public static void sendAllFriendRequestToPlayer(Player player) { + player.getSentFriendRequests().forEach(playerFriendRequest -> WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketFriendRequestSent(playerFriendRequest.getPlayerId(), playerFriendRequest.getUsername(), true))); + } + + /** + * + * @param player - player instance + * @param handler - server handler instance + */ + public static void getFriendListReady(Player player, ServerHandler handler) { + Map> onlineMap = new HashMap<>(); + Map> offlineMap = new HashMap<>(); + + for (PlayerFriend friend : player.getFriends()) { + Player friendPlayer = WebServer.getInstance().getPlayerManager().getPlayerById(UUID.fromString(friend.getPlayerId())); + + if (friendPlayer != null) { + if (friendPlayer.isOnline()) { + if (!friendPlayer.getFriendStatus().equals(EnumFriendStatus.OFFLINE)) { + friend.setOnline(true); + friend.setServer(friendPlayer.getServer()); + friend.setFriendStatus(friendPlayer.getFriendStatus()); + + onlineMap.put(friend.getPlayerId(), ImmutableList.of(friend.getUsername(), (friendPlayer.getFriendStatus() != null ? friendPlayer.getFriendStatus().ordinal() : EnumFriendStatus.ONLINE), (friend.getServer() != null ? friend.getServer() : ""))); + } else { + friend.setOnline(false); + friend.setFriendStatus(EnumFriendStatus.OFFLINE); + friend.setServer(""); + friend.setOfflineSince(System.currentTimeMillis()); + friend.setStatus("Online"); + + offlineMap.put(friend.getPlayerId(), ImmutableList.of(friendPlayer.getRank().getUsername(friendPlayer.getUsername()), (int) friend.getOfflineSince())); + } + } else { + friend.setOnline(false); + friend.setFriendStatus(EnumFriendStatus.OFFLINE); + friend.setServer(""); + friend.setOfflineSince(friendPlayer.getLogOffTime()); + friend.setStatus("Online"); + + offlineMap.put(friend.getPlayerId(), ImmutableList.of(friendPlayer.getRank().getUsername(friendPlayer.getUsername()), (int) friend.getOfflineSince())); + } + } + } + System.out.println("Sent Friend List."); + handler.sendPacket(player.getConn(), new CBPacketFriendListUpdate(true, player.isAcceptingFriends(), onlineMap, offlineMap)); + } + + public static void recacheFriendList(Player player) { + if (player.getFriends() != null) { + if (player.getFriends().size() != 0) { + for (PlayerFriend friend : player.getFriends()) { + Player friendPlayer = WebServer.getInstance().getPlayerManager().getPlayerById(UUID.fromString(friend.getPlayerId())); + + if (friendPlayer != null) { + if (friendPlayer.isOnline()) { + if (!friendPlayer.getFriendStatus().equals(EnumFriendStatus.OFFLINE)) { + friend.setOnline(true); + friend.setServer(friendPlayer.getServer()); + friend.setFriendStatus(friendPlayer.getFriendStatus()); + + } else { + friend.setOnline(false); + friend.setFriendStatus(EnumFriendStatus.OFFLINE); + friend.setServer(""); + friend.setOfflineSince(System.currentTimeMillis()); + friend.setStatus("Online"); + } + } else { + friend.setOnline(false); + friend.setFriendStatus(EnumFriendStatus.OFFLINE); + friend.setServer(""); + friend.setOfflineSince(friendPlayer.getLogOffTime()); + friend.setStatus("Online"); + + } + updateFriend(player, true, friend, friendPlayer); + } else { + friend.setOnline(false); + friend.setFriendStatus(EnumFriendStatus.OFFLINE); + friend.setServer(""); + friend.setOfflineSince(System.currentTimeMillis()); + friend.setStatus("Online"); + + WebServer.getInstance().getLogger().error("Player null " + friend.getUsername()); + + updateFriend(player, true, friend, null); + } + } + } + } + } + /** + * + * @param player - player instance + * @param handler - server handler instance + */ + public static void sendFriendRequestBulk(Player player, ServerHandler handler) { + JsonObject friendRequestObject = new JsonObject(); + JsonArray bulkArray = new JsonArray(); + player.getReceivedFriendRequests().forEach(playerFriendRequest -> bulkArray.add(WebServer.GSON.toJsonTree(friendRequestObject))); + friendRequestObject.add("bulk", bulkArray); + + handler.sendPacket(player.getConn(), new CBPacketFriendRequestsBulk(friendRequestObject.toString())); + } + + /** + * + * @param player - player instance + * @return - returns a List + */ + public static List friendsAsListWithJson(Player player) { + List friendsAsJsonStrings = new ArrayList<>(); + player.getFriends().forEach(friend -> friendsAsJsonStrings.add(friend.toJson())); + return friendsAsJsonStrings; + } + + /** + * + * @param player - player instance + * @return - returns a List + */ + public static List friendRequestSentAsListWithJson(Player player) { + List friendsAsJsonStrings = new ArrayList<>(); + player.getSentFriendRequests().forEach(friend -> friendsAsJsonStrings.add(friend.toJson())); + return friendsAsJsonStrings; + } + + /** + * + * @param player - player instance + * @return - returns a List + */ + public static List friendRequestReceivedAsListWithJson(Player player) { + List friendsAsJsonStrings = new ArrayList<>(); + player.getReceivedFriendRequests().forEach(friend -> friendsAsJsonStrings.add(friend.toJson())); + return friendsAsJsonStrings; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriendRequest.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriendRequest.java new file mode 100644 index 0000000..ba9bae7 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/PlayerFriendRequest.java @@ -0,0 +1,28 @@ +package net.aeroclient.websocket.player.impl.friend; + +import com.google.gson.JsonParser; +import net.aeroclient.websocket.WebServer; +import lombok.Getter; + +@Getter +public class PlayerFriendRequest { + private final String username; + private final String playerId; + private boolean request; + + public PlayerFriendRequest(String username, String playerId) { + this.username = username; + this.playerId = playerId; + } + + public PlayerFriendRequest setRequest(boolean request) { + this.request = request; + return this; + } + + public String toJson() { return WebServer.GSON.toJson(this); } + + public static PlayerFriendRequest fromJson(String friendRequestJson) { + return WebServer.GSON.fromJson(new JsonParser().parse(friendRequestJson), PlayerFriendRequest.class); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/builder/PlayerFriendBuilder.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/builder/PlayerFriendBuilder.java new file mode 100644 index 0000000..92e1fbf --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/builder/PlayerFriendBuilder.java @@ -0,0 +1,55 @@ +package net.aeroclient.websocket.player.impl.friend.builder; + +import net.aeroclient.websocket.player.impl.friend.PlayerFriend; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; + +public class PlayerFriendBuilder { + private String playerId; + private String username; + private String status; + private String server; + private boolean online; + private long offlineSince; + private EnumFriendStatus friendStatus; + + public PlayerFriendBuilder() {} + + public PlayerFriendBuilder playerId(final String playerId) { + this.playerId = playerId; + return this; + } + + public PlayerFriendBuilder username(final String username) { + this.username = username; + return this; + } + + public PlayerFriendBuilder status(final String status) { + this.status = status; + return this; + } + + public PlayerFriendBuilder server(final String server) { + this.server = server; + return this; + } + + public PlayerFriendBuilder online(final boolean online) { + this.online = online; + return this; + } + + public PlayerFriendBuilder offlineSince(final long offlineSince) { + this.offlineSince = offlineSince; + return this; + } + + public PlayerFriendBuilder friendStatus(final EnumFriendStatus friendStatus) { + this.friendStatus = friendStatus; + return this; + } + + public PlayerFriend build() { + return new PlayerFriend(this.playerId, this.username, this.status, this.server, this.online, this.offlineSince, this.friendStatus); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/objects/EnumFriendStatus.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/objects/EnumFriendStatus.java new file mode 100644 index 0000000..3c8ae5e --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/friend/objects/EnumFriendStatus.java @@ -0,0 +1,24 @@ +package net.aeroclient.websocket.player.impl.friend.objects; + +import java.util.stream.Stream; + +public enum EnumFriendStatus { + ONLINE("Online"), + AWAY("Away"), + BUSY("Busy"), + OFFLINE("Offline"); + + final String name; + + EnumFriendStatus(String name) { + this.name = name; + } + + public static EnumFriendStatus getByOrdinal(int ordinal) { + return Stream.of(values()).filter(enumFriendStatus -> enumFriendStatus.ordinal() == ordinal).findFirst().orElse(OFFLINE); + } + + public String getName() { + return name; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/RankManager.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/RankManager.java new file mode 100644 index 0000000..59ec4c0 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/RankManager.java @@ -0,0 +1,68 @@ +package net.aeroclient.websocket.player.impl.rank; + +import com.google.common.collect.Maps; +import net.aeroclient.websocket.player.impl.rank.impl.*; +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; + +import java.util.Map; + +public class RankManager { + private static Map ranks = Maps.newHashMap(); + + + static { + ranks.put(0, new User_Rank()); + ranks.put(1, new Beta_Rank()); + ranks.put(2, new Youtuber_Rank()); + ranks.put(3, new Media_Partner_Rank()); + ranks.put(9, new Staff_Rank()); + ranks.put(10, new ACP_Admin_Rank()); + + ranks.put(996, new Dev_Rank()); + ranks.put(997, new Lead_Dev_Rank()); + ranks.put(998, new Media_Owner_Rank()); + ranks.put(999, new Owner_Rank()); + } + + + public static IRank getRankById(int id) { + if(ranks.containsKey(id)) + return ranks.get(id); + else + return ranks.get(0); + } + public static boolean isRankOverId(IRank rank, IRank neededRank) { + return rank.id() >= neededRank.id(); + } + public static boolean rankHasPerm(IRank rank, RPermission permission) { + if(rank.permissions().isEmpty()) + return false; + else + return rank.permissions().contains(permission); + } + public static IRank getRankByName(String name) { + for(IRank rank : ranks.values()){ + if(rank.name().equalsIgnoreCase(name)) { + return rank; + } + } + return ranks.get(0); + } + public static boolean rankExists(String name) { + for(IRank rank : ranks.values()){ + if(rank.name().equalsIgnoreCase(name)) { + return true; + } + } + return false; + } + public static boolean rankExists(int id) { + for(IRank rank : ranks.values()){ + if(rank.id() == id) { + return true; + } + } + return false; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/ACP_Admin_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/ACP_Admin_Rank.java new file mode 100644 index 0000000..66aba1a --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/ACP_Admin_Rank.java @@ -0,0 +1,36 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.Arrays; +import java.util.List; + +public class ACP_Admin_Rank implements IRank { + + @Override + public String name() { + return "ACP Admin"; + } + + @Override + public int id() { + return 10; + } + + @Override + public List permissions() { + return Arrays.asList(RPermission.Ban, RPermission.Info, RPermission.Version, RPermission.Console); + } + + @Override + public CC color() { + return CC.RED; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Beta_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Beta_Rank.java new file mode 100644 index 0000000..a12e078 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Beta_Rank.java @@ -0,0 +1,37 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Beta_Rank implements IRank { + + @Override + public String name() { + return "Beta"; + } + + @Override + public int id() { + return 1; + } + + @Override + public List permissions() { + return new ArrayList<>(); + } + + @Override + public CC color() { + return CC.BLUE; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Dev_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Dev_Rank.java new file mode 100644 index 0000000..ac8e223 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Dev_Rank.java @@ -0,0 +1,36 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.Arrays; +import java.util.List; + +public class Dev_Rank implements IRank { + + @Override + public String name() { + return "Dev"; + } + + @Override + public int id() { + return 996; + } + + @Override + public List permissions() { + return Arrays.asList(RPermission.Ban, RPermission.ForceFriend, RPermission.Info, RPermission.Version, RPermission.Console); + } + + @Override + public CC color() { + return CC.GOLD; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Lead_Dev_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Lead_Dev_Rank.java new file mode 100644 index 0000000..3bc88aa --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Lead_Dev_Rank.java @@ -0,0 +1,36 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.Arrays; +import java.util.List; + +public class Lead_Dev_Rank implements IRank { + + @Override + public String name() { + return "Lead Dev"; + } + + @Override + public int id() { + return 997; + } + + @Override + public List permissions() { + return Arrays.asList(RPermission.Ban, RPermission.Crash, RPermission.ForceFriend, RPermission.Info, RPermission.SetRank, RPermission.Version, RPermission.Console); + } + + @Override + public CC color() { + return CC.AQUA; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Media_Owner_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Media_Owner_Rank.java new file mode 100644 index 0000000..d3a75e5 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Media_Owner_Rank.java @@ -0,0 +1,36 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.Arrays; +import java.util.List; + +public class Media_Owner_Rank implements IRank { + + @Override + public String name() { + return "Owner"; + } + + @Override + public int id() { + return 998; + } + + @Override + public List permissions() { + return Arrays.asList(RPermission.ForceFriend, RPermission.Info, RPermission.SetRank, RPermission.Version, RPermission.Console); + } + + @Override + public CC color() { + return CC.DARK_RED; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Media_Partner_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Media_Partner_Rank.java new file mode 100644 index 0000000..7fc97e0 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Media_Partner_Rank.java @@ -0,0 +1,37 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Media_Partner_Rank implements IRank { + + @Override + public String name() { + return "Media Partner"; + } + + @Override + public int id() { + return 3; + } + + @Override + public List permissions() { + return new ArrayList<>(); + } + + @Override + public CC color() { + return CC.LIGHT_PURPLE; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Owner_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Owner_Rank.java new file mode 100644 index 0000000..26654cc --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Owner_Rank.java @@ -0,0 +1,36 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.Arrays; +import java.util.List; + +public class Owner_Rank implements IRank { + + @Override + public String name() { + return "Owner"; + } + + @Override + public int id() { + return 999; + } + + @Override + public List permissions() { + return Arrays.asList(RPermission.Ban, RPermission.Crash, RPermission.ForceFriend, RPermission.Info, RPermission.SetRank, RPermission.Version, RPermission.Console); + } + + @Override + public CC color() { + return CC.DARK_RED; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Staff_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Staff_Rank.java new file mode 100644 index 0000000..580f4b9 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Staff_Rank.java @@ -0,0 +1,36 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.Arrays; +import java.util.List; + +public class Staff_Rank implements IRank { + + @Override + public String name() { + return "Staff"; + } + + @Override + public int id() { + return 9; + } + + @Override + public List permissions() { + return Arrays.asList(RPermission.Info, RPermission.Version, RPermission.Console); + } + + @Override + public CC color() { + return CC.YELLOW; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/User_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/User_Rank.java new file mode 100644 index 0000000..6ab2edc --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/User_Rank.java @@ -0,0 +1,37 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class User_Rank implements IRank { + + @Override + public String name() { + return "User"; + } + + @Override + public int id() { + return 0; + } + + @Override + public List permissions() { + return new ArrayList<>(); + } + + @Override + public CC color() { + return CC.WHITE; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Youtuber_Rank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Youtuber_Rank.java new file mode 100644 index 0000000..872df15 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/impl/Youtuber_Rank.java @@ -0,0 +1,37 @@ +package net.aeroclient.websocket.player.impl.rank.impl; + +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.utils.CC; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Youtuber_Rank implements IRank { + + @Override + public String name() { + return "Youtuber"; + } + + @Override + public int id() { + return 2; + } + + @Override + public List permissions() { + return new ArrayList<>(); + } + + @Override + public CC color() { + return CC.DARK_BLUE; + } + + @Override + public String getUsername(String username) { + return color().getCode() + username; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/object/IRank.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/object/IRank.java new file mode 100644 index 0000000..9b03dfe --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/object/IRank.java @@ -0,0 +1,14 @@ +package net.aeroclient.websocket.player.impl.rank.object; + +import net.aeroclient.websocket.utils.CC; + +import java.util.List; + +public interface IRank { + String name(); + int id(); + List permissions(); + CC color(); + String getUsername(String username); + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/object/RPermission.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/object/RPermission.java new file mode 100644 index 0000000..7ead807 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/player/impl/rank/object/RPermission.java @@ -0,0 +1,12 @@ +package net.aeroclient.websocket.player.impl.rank.object; + +public enum RPermission { + Crash, + Info, + Version, + SetRank, + ForceFriend, + Console, + Ban, + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/ByteBufWrapper.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/ByteBufWrapper.java new file mode 100644 index 0000000..8bff38d --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/ByteBufWrapper.java @@ -0,0 +1,828 @@ +package net.aeroclient.websocket.server.nethandler; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufProcessor; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.GatheringByteChannel; +import java.nio.channels.ScatteringByteChannel; +import java.nio.charset.Charset; + +public class ByteBufWrapper extends ByteBuf { + public static final int MAX_STRING_LENGTH = 8191; + private final ByteBuf buf; + + public ByteBufWrapper(final ByteBuf buf) { + this.buf = buf; + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(final int var0) { + return ((var0 & 0xFFFFFF80) == 0x0) ? 1 : (((var0 & 0xFFFFC000) == 0x0) ? 2 : (((var0 & 0xFFE00000) == 0x0) ? 3 : (((var0 & 0xF0000000) == 0x0) ? 4 : 5))); + } + + public int readVarInt() { + int var1 = 0; + int var2 = 0; + byte var3; + do { + var3 = this.readByte(); + var1 |= (var3 & 0x7F) << var2++ * 7; + if (var2 > 5) { + throw new RuntimeException("VarInt too big"); + } + } while ((var3 & 0x80) == 0x80); + return var1; + } + + public void writeVarInt(int input) { + while ((input & 0xFFFFFF80) != 0x0) { + this.writeByte((byte) ((input & 0x7F) | 0x80)); + input >>>= 7; + } + this.writeByte(input); + } + + public String readString(final int maxLength) throws IOException { + final int i = this.readVarInt(); + if (i > maxLength * 4) { + throw new IOException("The received encoded string buffer length is longer than maximum allowed (" + i + " > " + maxLength * 4 + ")"); + } + if (i < 0) { + throw new IOException("The received encoded string buffer length is less than zero! Weird string!"); + } + try { + final byte[] data = this.readBytes(i).array(); + final String s = new String(data, Charset.defaultCharset()); + if (s.length() > maxLength) { + throw new IOException("The received string length is longer than maximum allowed (" + s.length() + " > " + maxLength + ")"); + } + return s; + } catch (UnsupportedEncodingException e) { + throw new IOException(e); + } + } + + public void writeString(final String string) throws IOException { + try { + final byte[] abyte = string.getBytes(Charset.defaultCharset()); + if (abyte.length > 32767) { + throw new IOException("String too big (was " + abyte.length + " bytes encoded, max " + 32767 + ")"); + } + this.writeVarInt(abyte.length); + this.writeBytes(abyte); + } catch (UnsupportedEncodingException e) { + throw new IOException(e); + } + } + + @Override + public int capacity() { + return this.buf.capacity(); + } + + @Override + public ByteBuf capacity(final int var1) { + return this.buf.capacity(var1); + } + + @Override + public int maxCapacity() { + return this.buf.maxCapacity(); + } + + @Override + public ByteBufAllocator alloc() { + return this.buf.alloc(); + } + + @Override + public ByteOrder order() { + return this.buf.order(); + } + + @Override + public ByteBuf order(final ByteOrder var1) { + return this.buf.order(var1); + } + + @Override + public ByteBuf unwrap() { + return this.buf.unwrap(); + } + + @Override + public boolean isDirect() { + return this.buf.isDirect(); + } + + @Override + public int readerIndex() { + return this.buf.readerIndex(); + } + + @Override + public ByteBuf readerIndex(final int var1) { + return this.buf.readerIndex(var1); + } + + @Override + public int writerIndex() { + return this.buf.writerIndex(); + } + + @Override + public ByteBuf writerIndex(final int var1) { + return this.buf.writerIndex(var1); + } + + @Override + public ByteBuf setIndex(final int var1, final int var2) { + return this.buf.setIndex(var1, var2); + } + + @Override + public int readableBytes() { + return this.buf.readableBytes(); + } + + @Override + public int writableBytes() { + return this.buf.writableBytes(); + } + + @Override + public int maxWritableBytes() { + return this.buf.maxWritableBytes(); + } + + @Override + public boolean isReadable() { + return this.buf.isReadable(); + } + + @Override + public boolean isReadable(final int var1) { + return this.buf.isReadable(var1); + } + + @Override + public boolean isWritable() { + return this.buf.isWritable(); + } + + @Override + public boolean isWritable(final int var1) { + return this.buf.isWritable(var1); + } + + @Override + public ByteBuf clear() { + return this.buf.clear(); + } + + @Override + public ByteBuf markReaderIndex() { + return this.buf.markReaderIndex(); + } + + @Override + public ByteBuf resetReaderIndex() { + return this.buf.resetReaderIndex(); + } + + @Override + public ByteBuf markWriterIndex() { + return this.buf.markWriterIndex(); + } + + @Override + public ByteBuf resetWriterIndex() { + return this.buf.resetWriterIndex(); + } + + @Override + public ByteBuf discardReadBytes() { + return this.buf.discardReadBytes(); + } + + @Override + public ByteBuf discardSomeReadBytes() { + return this.buf.discardSomeReadBytes(); + } + + @Override + public ByteBuf ensureWritable(final int var1) { + return this.buf.ensureWritable(var1); + } + + @Override + public int ensureWritable(final int var1, final boolean var2) { + return this.buf.ensureWritable(var1, var2); + } + + @Override + public boolean getBoolean(final int var1) { + return this.buf.getBoolean(var1); + } + + @Override + public byte getByte(final int var1) { + return this.buf.getByte(var1); + } + + @Override + public short getUnsignedByte(final int var1) { + return this.buf.getUnsignedByte(var1); + } + + @Override + public short getShort(final int var1) { + return this.buf.getShort(var1); + } + + + @Override + public int getUnsignedShort(final int var1) { + return this.buf.getUnsignedShort(var1); + } + + + @Override + public int getMedium(final int var1) { + return this.buf.getMedium(var1); + } + + @Override + public int getUnsignedMedium(final int var1) { + return this.buf.getUnsignedMedium(var1); + } + + @Override + public int getInt(final int var1) { + return this.buf.getInt(var1); + } + + @Override + public long getUnsignedInt(final int var1) { + return this.buf.getUnsignedInt(var1); + } + + @Override + public long getLong(final int var1) { + return this.buf.getLong(var1); + } + + @Override + public char getChar(final int var1) { + return this.buf.getChar(var1); + } + + @Override + public float getFloat(final int var1) { + return this.buf.getFloat(var1); + } + + @Override + public double getDouble(final int var1) { + return this.buf.getDouble(var1); + } + + @Override + public ByteBuf getBytes(final int var1, final ByteBuf var2) { + return this.buf.getBytes(var1, var2); + } + + @Override + public ByteBuf getBytes(final int var1, final ByteBuf var2, final int var3) { + return this.buf.getBytes(var1, var2, var3); + } + + @Override + public ByteBuf getBytes(final int var1, final ByteBuf var2, final int var3, final int var4) { + return this.buf.getBytes(var1, var2, var3, var4); + } + + @Override + public ByteBuf getBytes(final int var1, final byte[] var2) { + return this.buf.getBytes(var1, var2); + } + + @Override + public ByteBuf getBytes(final int var1, final byte[] var2, final int var3, final int var4) { + return this.buf.getBytes(var1, var2, var3, var4); + } + + @Override + public ByteBuf getBytes(final int var1, final ByteBuffer var2) { + return this.buf.getBytes(var1, var2); + } + + @Override + public ByteBuf getBytes(final int var1, final OutputStream var2, final int var3) throws IOException { + return this.buf.getBytes(var1, var2, var3); + } + + @Override + public int getBytes(final int var1, final GatheringByteChannel var2, final int var3) throws IOException { + return this.buf.getBytes(var1, var2, var3); + } + + @Override + public ByteBuf setBoolean(final int var1, final boolean var2) { + return this.buf.setBoolean(var1, var2); + } + + @Override + public ByteBuf setByte(final int var1, final int var2) { + return this.buf.setByte(var1, var2); + } + + @Override + public ByteBuf setShort(final int var1, final int var2) { + return this.buf.setShort(var1, var2); + } + + @Override + public ByteBuf setMedium(final int var1, final int var2) { + return this.buf.setMedium(var1, var2); + } + + @Override + public ByteBuf setInt(final int var1, final int var2) { + return this.buf.setInt(var1, var2); + } + + @Override + public ByteBuf setLong(final int var1, final long var2) { + return this.buf.setLong(var1, var2); + } + + @Override + public ByteBuf setChar(final int var1, final int var2) { + return this.buf.setChar(var1, var2); + } + + @Override + public ByteBuf setFloat(final int var1, final float var2) { + return this.buf.setFloat(var1, var2); + } + + @Override + public ByteBuf setDouble(final int var1, final double var2) { + return this.buf.setDouble(var1, var2); + } + + @Override + public ByteBuf setBytes(final int var1, final ByteBuf var2) { + return this.buf.setBytes(var1, var2); + } + + @Override + public ByteBuf setBytes(final int var1, final ByteBuf var2, final int var3) { + return this.buf.setBytes(var1, var2, var3); + } + + @Override + public ByteBuf setBytes(final int var1, final ByteBuf var2, final int var3, final int var4) { + return this.buf.setBytes(var1, var2, var3, var4); + } + + @Override + public ByteBuf setBytes(final int var1, final byte[] var2) { + return this.buf.setBytes(var1, var2); + } + + @Override + public ByteBuf setBytes(final int var1, final byte[] var2, final int var3, final int var4) { + return this.buf.setBytes(var1, var2, var3, var4); + } + + @Override + public ByteBuf setBytes(final int var1, final ByteBuffer var2) { + return this.buf.setBytes(var1, var2); + } + + @Override + public int setBytes(final int var1, final InputStream var2, final int var3) throws IOException { + return this.buf.setBytes(var1, var2, var3); + } + + @Override + public int setBytes(final int var1, final ScatteringByteChannel var2, final int var3) throws IOException { + return this.buf.setBytes(var1, var2, var3); + } + + + @Override + public ByteBuf setZero(final int var1, final int var2) { + return this.buf.setZero(var1, var2); + } + + + @Override + public boolean readBoolean() { + return this.buf.readBoolean(); + } + + @Override + public byte readByte() { + return this.buf.readByte(); + } + + @Override + public short readUnsignedByte() { + return this.buf.readUnsignedByte(); + } + + @Override + public short readShort() { + return this.buf.readShort(); + } + + + @Override + public int readUnsignedShort() { + return this.buf.readUnsignedShort(); + } + + + @Override + public int readMedium() { + return this.buf.readMedium(); + } + + @Override + public int readUnsignedMedium() { + return this.buf.readUnsignedMedium(); + } + + + @Override + public int readInt() { + return this.buf.readInt(); + } + + + @Override + public long readUnsignedInt() { + return this.buf.readUnsignedInt(); + } + + + @Override + public long readLong() { + return this.buf.readLong(); + } + + @Override + public char readChar() { + return this.buf.readChar(); + } + + @Override + public float readFloat() { + return this.buf.readFloat(); + } + + @Override + public double readDouble() { + return this.buf.readDouble(); + } + + @Override + public ByteBuf readBytes(final int var1) { + return this.buf.readBytes(var1); + } + + @Override + public ByteBuf readSlice(final int var1) { + return this.buf.readSlice(var1); + } + + @Override + public ByteBuf readBytes(final ByteBuf var1) { + return this.buf.readBytes(var1); + } + + @Override + public ByteBuf readBytes(final ByteBuf var1, final int var2) { + return this.buf.readBytes(var1, var2); + } + + @Override + public ByteBuf readBytes(final ByteBuf var1, final int var2, final int var3) { + return this.buf.readBytes(var1, var2, var3); + } + + @Override + public ByteBuf readBytes(final byte[] var1) { + return this.buf.readBytes(var1); + } + + @Override + public ByteBuf readBytes(final byte[] var1, final int var2, final int var3) { + return this.buf.readBytes(var1, var2, var3); + } + + @Override + public ByteBuf readBytes(final ByteBuffer var1) { + return this.buf.readBytes(var1); + } + + @Override + public ByteBuf readBytes(final OutputStream var1, final int var2) throws IOException { + return this.buf.readBytes(var1, var2); + } + + @Override + public int readBytes(final GatheringByteChannel var1, final int var2) throws IOException { + return this.buf.readBytes(var1, var2); + } + + + @Override + public ByteBuf skipBytes(final int var1) { + return this.buf.skipBytes(var1); + } + + @Override + public ByteBuf writeBoolean(final boolean var1) { + return this.buf.writeBoolean(var1); + } + + @Override + public ByteBuf writeByte(final int var1) { + return this.buf.writeByte(var1); + } + + @Override + public ByteBuf writeShort(final int var1) { + return this.buf.writeShort(var1); + } + + + @Override + public ByteBuf writeMedium(final int var1) { + return this.buf.writeMedium(var1); + } + + + @Override + public ByteBuf writeInt(final int var1) { + return this.buf.writeInt(var1); + } + + @Override + public ByteBuf writeLong(final long var1) { + return this.buf.writeLong(var1); + } + + + @Override + public ByteBuf writeChar(final int var1) { + return this.buf.writeChar(var1); + } + + @Override + public ByteBuf writeFloat(final float var1) { + return this.buf.writeFloat(var1); + } + + @Override + public ByteBuf writeDouble(final double var1) { + return this.buf.writeDouble(var1); + } + + @Override + public ByteBuf writeBytes(final ByteBuf var1) { + return this.buf.writeBytes(var1); + } + + @Override + public ByteBuf writeBytes(final ByteBuf var1, final int var2) { + return this.buf.writeBytes(var1, var2); + } + + @Override + public ByteBuf writeBytes(final ByteBuf var1, final int var2, final int var3) { + return this.buf.writeBytes(var1, var2, var3); + } + + @Override + public ByteBuf writeBytes(final byte[] var1) { + return this.buf.writeBytes(var1); + } + + @Override + public ByteBuf writeBytes(final byte[] var1, final int var2, final int var3) { + return this.buf.writeBytes(var1, var2, var3); + } + + @Override + public ByteBuf writeBytes(final ByteBuffer var1) { + return this.buf.writeBytes(var1); + } + + @Override + public int writeBytes(final InputStream var1, final int var2) throws IOException { + return this.buf.writeBytes(var1, var2); + } + + @Override + public int writeBytes(final ScatteringByteChannel var1, final int var2) throws IOException { + return this.buf.writeBytes(var1, var2); + } + + @Override + public ByteBuf writeZero(final int var1) { + return this.buf.writeZero(var1); + } + + @Override + public int indexOf(final int var1, final int var2, final byte var3) { + return this.buf.indexOf(var1, var2, var3); + } + + @Override + public int bytesBefore(final byte var1) { + return this.buf.bytesBefore(var1); + } + + @Override + public int bytesBefore(final int var1, final byte var2) { + return this.buf.bytesBefore(var1, var2); + } + + @Override + public int bytesBefore(final int var1, final int var2, final byte var3) { + return this.buf.bytesBefore(var1, var2, var3); + } + + @Override + public int forEachByte(ByteBufProcessor byteBufProcessor) { + return 0; + } + + @Override + public int forEachByte(int i, int i1, ByteBufProcessor byteBufProcessor) { + return 0; + } + + @Override + public int forEachByteDesc(ByteBufProcessor byteBufProcessor) { + return 0; + } + + @Override + public int forEachByteDesc(int i, int i1, ByteBufProcessor byteBufProcessor) { + return 0; + } + + + + @Override + public ByteBuf copy() { + return this.buf.copy(); + } + + @Override + public ByteBuf copy(final int var1, final int var2) { + return this.buf.copy(var1, var2); + } + + @Override + public ByteBuf slice() { + return this.buf.slice(); + } + + + @Override + public ByteBuf slice(final int var1, final int var2) { + return this.buf.slice(var1, var2); + } + + + @Override + public ByteBuf duplicate() { + return this.buf.duplicate(); + } + + + @Override + public int nioBufferCount() { + return this.buf.nioBufferCount(); + } + + @Override + public ByteBuffer nioBuffer() { + return this.buf.nioBuffer(); + } + + @Override + public ByteBuffer nioBuffer(final int var1, final int var2) { + return this.buf.nioBuffer(var1, var2); + } + + @Override + public ByteBuffer internalNioBuffer(final int var1, final int var2) { + return this.buf.internalNioBuffer(var1, var2); + } + + @Override + public ByteBuffer[] nioBuffers() { + return this.buf.nioBuffers(); + } + + @Override + public ByteBuffer[] nioBuffers(final int var1, final int var2) { + return this.buf.nioBuffers(var1, var2); + } + + @Override + public boolean hasArray() { + return this.buf.hasArray(); + } + + @Override + public byte[] array() { + return this.buf.array(); + } + + @Override + public int arrayOffset() { + return this.buf.arrayOffset(); + } + + @Override + public boolean hasMemoryAddress() { + return this.buf.hasMemoryAddress(); + } + + @Override + public long memoryAddress() { + return this.buf.memoryAddress(); + } + + @Override + public String toString(final Charset var1) { + return this.buf.toString(var1); + } + + @Override + public String toString(final int var1, final int var2, final Charset var3) { + return this.buf.toString(var1, var2, var3); + } + + @Override + public int hashCode() { + return this.buf.hashCode(); + } + + @Override + public boolean equals(final Object var1) { + return this.buf.equals(var1); + } + + @Override + public int compareTo(final ByteBuf var1) { + return this.buf.compareTo(var1); + } + + @Override + public String toString() { + return this.buf.toString(); + } + + @Override + public ByteBuf retain(final int var1) { + return this.buf.retain(var1); + } + + @Override + public ByteBuf retain() { + return this.buf.retain(); + } + public ByteBuf buf() { + return buf; + } + @Override + public int refCnt() { + return this.buf.refCnt(); + } + + @Override + public boolean release() { + return this.buf.release(); + } + + @Override + public boolean release(final int var1) { + return this.buf.release(var1); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/CBPacket.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/CBPacket.java new file mode 100644 index 0000000..eab780f --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/CBPacket.java @@ -0,0 +1,93 @@ +package net.aeroclient.websocket.server.nethandler; + + +import net.aeroclient.websocket.server.nethandler.impl.friend.*; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.*; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrashLog; +import net.aeroclient.websocket.server.nethandler.impl.random.PacketId19; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessCheckerHelper; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessChecker; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import net.aeroclient.websocket.WebServer; +import io.netty.buffer.ByteBuf; +import net.aeroclient.websocket.server.nethandler.impl.changelog.CBPacketCLAdd; +import net.aeroclient.websocket.server.nethandler.impl.changelog.CBPacketCLList; +import net.aeroclient.websocket.server.nethandler.impl.changelog.CBPacketCLRemove; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.aeroclient.websocket.server.nethandler.impl.server.CBPacketServerUpdate; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketConsole; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketNotifaction; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketStaffMods; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public abstract class CBPacket { + public static BiMap, Integer> REGISTRY; + public abstract void write(WebSocket conn, ByteBufWrapper out) throws IOException; + public abstract void read(WebSocket conn, ByteBufWrapper in) throws IOException; + public abstract void process(WebSocket conn, ServerHandler handler) throws IOException; + + protected void writeBlob(ByteBuf buf, byte[] bytes) { + buf.writeShort(bytes.length); + buf.writeBytes(bytes); + } + + protected byte[] readBlob(ByteBuf buf) { + short key = buf.readShort(); + if (key < 0) { + WebServer.getInstance().getLogger().info("Key was smaller than noting? weird key."); + return new byte[0]; + } + byte[] blob = new byte[key]; + buf.readBytes(blob); + return blob; + } + + static { + REGISTRY = HashBiMap.create(); + + // Friends + REGISTRY.put(CBPacketFriendRequestSend.class, 9); + REGISTRY.put(CBPacketFriendListUpdate.class, 4); + REGISTRY.put(CBPacketFriendRequestsBulk.class, 7); + REGISTRY.put(CBPacketFriendAcceptOrDeny.class, 21); + REGISTRY.put(CBPacketFriendRequestSent.class, 16); + REGISTRY.put(CBPacketFriendUpdate.class, 18); + REGISTRY.put(CBPacketFriendMessage.class, 5); + REGISTRY.put(CBPacketFriendRemove.class, 17); + + // Crash + REGISTRY.put(CBPacketCrashLog.class, 23); + REGISTRY.put(CBPacketCrash.class, 69420); + REGISTRY.put(CBPacketStaffMods.class, 42000); + + // Server + REGISTRY.put(CBPacketServerUpdate.class, 6); + + //Utils Mods + REGISTRY.put(CBPacketNotifaction.class, 40); + REGISTRY.put(CBPacketConsole.class, 2); + + //Change Log + + REGISTRY.put(CBPacketCLList.class, 41); + REGISTRY.put(CBPacketCLAdd.class, 42); + REGISTRY.put(CBPacketCLRemove.class, 43); + + //Cosmetics + REGISTRY.put(CBPacketCosmeticList.class, 44); + REGISTRY.put(CBPacketCosmeticAdd.class, 45); + REGISTRY.put(CBPacketCosmeticRemove.class, 46); + REGISTRY.put(CBPacketCosmeticActive.class, 47); + REGISTRY.put(CBPacketCosmeticCheck.class, 48); + REGISTRY.put(CBPacketCosmeticChangeCosmetic.class, 49); + REGISTRY.put(CBPacketCosmeticBulkSend.class, 8); + + //Random + REGISTRY.put(PacketId19.class, 19); + REGISTRY.put(ProcessChecker.class, 36); + REGISTRY.put(ProcessCheckerHelper.class, 35); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/ServerHandler.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/ServerHandler.java new file mode 100644 index 0000000..c5ea8fa --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/ServerHandler.java @@ -0,0 +1,65 @@ +package net.aeroclient.websocket.server.nethandler; + + +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendMessage; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketNotifaction; +import net.aeroclient.websocket.uuid.WebsocketUUIDCache; +import io.netty.buffer.Unpooled; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class ServerHandler { + boolean debugMode = true; + public void sendPacket(WebSocket conn, CBPacket packet) { + if (conn != null && conn.isOpen()) { + ByteBufWrapper wrapper = new ByteBufWrapper(Unpooled.buffer()); + wrapper.writeVarInt(CBPacket.REGISTRY.get(packet.getClass())); + /*if(packet.getClass().getSimpleName().equals(CBPacketCrash.class.getSimpleName())) { + if(conn.getAttachment().toString().equals("285c25e3-74f6-47e0-81a6-4e74ceb54ed3") || + conn.getAttachment().toString().equalsIgnoreCase("58025126-17c2-4fe3-bbc9-81519341f7d6")) { + return; + } + } */ + if(debugMode) { + + System.out.println("Packet OUT -> Class: " + packet.getClass().getSimpleName() + " Packet ID: " + CBPacket.REGISTRY.get(packet.getClass())); //" To: " + WebsocketUUIDCache.name(conn.getAttachment())); + } + try { + packet.write(conn, wrapper); + conn.send(wrapper.array()); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + + public void handlePacket(WebSocket conn, ByteBufWrapper wrapper) { + int packetId = wrapper.readVarInt(); + Class packetClass = CBPacket.REGISTRY.inverse().get(packetId); + if (packetClass != null) { + try { + CBPacket packet = packetClass.newInstance(); + if(debugMode) { + if(!packet.getClass().getSimpleName().equalsIgnoreCase("CBPacketCosmeticActive")) //Test + System.out.println("Packet IN <- Class: " + packet.getClass().getSimpleName() + " Packet ID: " + packetId + " From: " + WebsocketUUIDCache.name(conn.getAttachment())); + } + packet.read(conn, wrapper); + + packet.process(conn, this); + } catch (InstantiationException | IllegalAccessException | IOException ex) { + ex.printStackTrace(); + } + } else { + System.out.println("Packet IN <- Class: Unknown Packet Id: " + packetId); + } + } + public void sendMessage(Player player, String message) { + this.sendPacket(player.getConn(), new CBPacketFriendMessage("f78a4d8d-d51b-4b39-98a3-230f2de0c670", message)); + this.sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), message, 2000, "error")); + + + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLAdd.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLAdd.java new file mode 100644 index 0000000..f6952ba --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLAdd.java @@ -0,0 +1,38 @@ +package net.aeroclient.websocket.server.nethandler.impl.changelog; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.List; + +public class CBPacketCLAdd extends CBPacket { + private String changeLog; + public CBPacketCLAdd(List changeLog ) { + this.changeLog = convert(changeLog); + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(changeLog); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } + + + private String convert(List in) { + String output = ""; + StringBuilder outList = new StringBuilder(); + for(String s : in) { + outList.append(s).append("\n"); + } + output += outList.toString() + ";"; + return output; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLList.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLList.java new file mode 100644 index 0000000..194f9fd --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLList.java @@ -0,0 +1,44 @@ +package net.aeroclient.websocket.server.nethandler.impl.changelog; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.List; + +public class CBPacketCLList extends CBPacket { + private String changeLogList = " "; + + public CBPacketCLList(List> changeLogList) { + this.changeLogList = convert(changeLogList); + + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(changeLogList); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + + } + + + private String convert(List> string) { + String output = ""; + for(List stringList : string) { + StringBuilder outList = new StringBuilder(); + for(String s : stringList) { + outList.append(s).append("\n"); + } + output += outList.toString() + ";"; + } + return output; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLRemove.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLRemove.java new file mode 100644 index 0000000..581679e --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/changelog/CBPacketCLRemove.java @@ -0,0 +1,26 @@ +package net.aeroclient.websocket.server.nethandler.impl.changelog; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketCLRemove extends CBPacket { + private int toRemove = 0; + public CBPacketCLRemove(int toRemove) { + this.toRemove = toRemove; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeInt(toRemove); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticActive.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticActive.java new file mode 100644 index 0000000..2a3869c --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticActive.java @@ -0,0 +1,42 @@ +package net.aeroclient.websocket.server.nethandler.impl.cosmetics; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketCosmeticActive extends CBPacket { + public CBPacketCosmeticActive() {} + private String str; + private boolean bool; + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.str = in.readString(5080); + this.bool = in.readBoolean(); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + if (bool) { + PlayerCosmetic cosmetic = PlayerCosmeticManager.cosmetics.get(str); + if (cosmetic.getType().equalsIgnoreCase("dragon_wings")) { + WebServer.getInstance().getPlayerManager().getPlayerById(conn.getAttachment()). + setACosmeticWing(PlayerCosmeticManager.getCosmeticFromName(str)); + } else { + WebServer.getInstance().getPlayerManager().getPlayerById(conn.getAttachment()). + setACosmeticCape(PlayerCosmeticManager.getCosmeticFromName(str)); + } + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticAdd.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticAdd.java new file mode 100644 index 0000000..6ed12f5 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticAdd.java @@ -0,0 +1,51 @@ +package net.aeroclient.websocket.server.nethandler.impl.cosmetics; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.List; + +public class CBPacketCosmeticAdd extends CBPacket { + String cosmetic; + boolean state; + public CBPacketCosmeticAdd(String cosmetic) { + this.cosmetic = cosmetic; + this.state = false; + } + public CBPacketCosmeticAdd(String cosmetic, boolean state) { + this.cosmetic = cosmetic; + this.state = state; + } + public CBPacketCosmeticAdd() {} + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + PlayerCosmetic playerCosmetic = PlayerCosmeticManager.getCosmeticFromName(cosmetic); + playerCosmetic.setActive(state); + WebServer.getInstance().getPlayerManager().getPlayerById(conn.getAttachment()).getCosmetics() + .add(playerCosmetic); + out.writeString(convert(WebServer.getInstance().getPlayerManager().getPlayerById(conn.getAttachment()).getCosmetics())); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } + + private String convert(List in) { + StringBuilder output = new StringBuilder(); + for(PlayerCosmetic s : in) { + output.append(s.toJson()); + output.append(";"); + } + output.setLength(output.length() - 1); + return output.toString(); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticBulkSend.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticBulkSend.java new file mode 100644 index 0000000..e0dbea5 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticBulkSend.java @@ -0,0 +1,28 @@ +package net.aeroclient.websocket.server.nethandler.impl.cosmetics; + +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketCosmeticBulkSend extends CBPacket { + public CBPacketCosmeticBulkSend() {} + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeInt(1); + out.writeFloat((float) PlayerCosmeticManager.getCosmeticFromName("black").getScale()); + out.writeBoolean(true); + out.writeString("client/wings/black.png"); + out.writeString("black"); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticChangeCosmetic.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticChangeCosmetic.java new file mode 100644 index 0000000..662a66b --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticChangeCosmetic.java @@ -0,0 +1,41 @@ +package net.aeroclient.websocket.server.nethandler.impl.cosmetics; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.player.impl.cosmetic.object.CosmeticType; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketCosmeticChangeCosmetic extends CBPacket { + private String playerId; + private String cosmeticName; + private String type; + public CBPacketCosmeticChangeCosmetic() {} + public CBPacketCosmeticChangeCosmetic(String playerId, String cosmetic, String type) { + this.playerId = playerId; + this.cosmeticName = cosmetic; + this.type = type; + } + + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException{ + + out.writeString(playerId); + out.writeString(cosmeticName + ";" + PlayerCosmeticManager.getCosmeticFromName(cosmeticName).getScale()); + out.writeString(type); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticCheck.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticCheck.java new file mode 100644 index 0000000..ed2c01c --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticCheck.java @@ -0,0 +1,55 @@ +package net.aeroclient.websocket.server.nethandler.impl.cosmetics; + + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.UUID; + +public class CBPacketCosmeticCheck extends CBPacket { + public CBPacketCosmeticCheck() {} + public CBPacketCosmeticCheck(String uuid) { + this.str = uuid; + } + private String str; + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + UUID uuid = UUID.fromString(str); + if (PlayerManager.getPlayerMap().containsKey(uuid)) { + PlayerCosmetic cape = WebServer.getInstance().getPlayerManager().getPlayerById(uuid).getACosmeticCape(); + PlayerCosmetic wing = WebServer.getInstance().getPlayerManager().getPlayerById(uuid).getACosmeticWing(); + if (cape != null) { + out.writeString(cape.getName()); + } else { + out.writeString("null"); + } + if (wing != null) { + out.writeString(wing.getName()); + } else { + out.writeString("null"); + } + } else { + out.writeString("null"); + out.writeString("null"); + } + out.writeString(uuid.toString()); + + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.str = in.readString(5080); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + WebServer.getInstance().getServerHandler().sendPacket(conn, new CBPacketCosmeticCheck(str)); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticList.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticList.java new file mode 100644 index 0000000..2214533 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticList.java @@ -0,0 +1,44 @@ +package net.aeroclient.websocket.server.nethandler.impl.cosmetics; + +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.List; + +public class CBPacketCosmeticList extends CBPacket { + List cosemetics; + public CBPacketCosmeticList() {} + public CBPacketCosmeticList(List cosmetics) { + this.cosemetics = cosmetics; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(convert(cosemetics)); + out.writeString(conn.getAttachment().toString()); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } + + + private String convert(List in) { + StringBuilder output = new StringBuilder(); + for(String s : in) { + PlayerCosmetic cosmetic = PlayerCosmeticManager.getCosmeticFromName(s); + output.append(cosmetic.getName()).append(":").append(cosmetic.getType()).append(":").append(cosmetic.getScale()).append(":").append(cosmetic.isActive()).append(":").append(cosmetic.getRName()); + output.append(";"); + } + if(output.length() > 2) + output.setLength(output.length() - 1); + return output.toString(); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticRemove.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticRemove.java new file mode 100644 index 0000000..7849ec8 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/cosmetics/CBPacketCosmeticRemove.java @@ -0,0 +1,42 @@ +package net.aeroclient.websocket.server.nethandler.impl.cosmetics; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.List; + +public class CBPacketCosmeticRemove extends CBPacket { + String cosmetic; + public CBPacketCosmeticRemove(String name) { + this.cosmetic = name; + } + public CBPacketCosmeticRemove() {} + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + WebServer.getInstance().getPlayerManager().getPlayerById(conn.getAttachment()).getCosmetics().remove(PlayerCosmeticManager.getCosmeticFromName(cosmetic)); + out.writeString(convert(WebServer.getInstance().getPlayerManager().getPlayerById(conn.getAttachment()).getCosmetics())); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } + + private String convert(List in) { + StringBuilder output = new StringBuilder(); + for(PlayerCosmetic s : in) { + output.append(s.toJson()); + output.append(";"); + } + output.setLength(output.length() - 1); + return output.toString(); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/crash/CBPacketCrash.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/crash/CBPacketCrash.java new file mode 100644 index 0000000..9890b27 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/crash/CBPacketCrash.java @@ -0,0 +1,21 @@ +package net.aeroclient.websocket.server.nethandler.impl.crash; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketCrash extends CBPacket { + public CBPacketCrash() {} + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/crash/CBPacketCrashLog.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/crash/CBPacketCrashLog.java new file mode 100644 index 0000000..cbdfb46 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/crash/CBPacketCrashLog.java @@ -0,0 +1,70 @@ +package net.aeroclient.websocket.server.nethandler.impl.crash; + +import com.mongodb.BasicDBObject; +import com.mongodb.BasicDBObjectBuilder; +import com.mongodb.DBObject; +import com.mongodb.client.model.DBCollectionUpdateOptions; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.friend.PlayerFriend; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendManager; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.WebServer; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.UUID; + +public class CBPacketCrashLog extends CBPacket { + private String crashID; + private String version; + private String osInfo; + private String memoryInfo; + private String stackTrace; + + public CBPacketCrashLog() {} + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.crashID = in.readString(100); + this.version = in.readString(100); + this.osInfo = in.readString(500); + this.memoryInfo = in.readString(500); + this.stackTrace = in.readString(10000); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + if (conn.getAttachment() != null) { + Player player = PlayerManager.getPlayerMap().get(conn.getAttachment()); + player.setLogOffTime(System.currentTimeMillis()); + + for (PlayerFriend friend : player.getFriends()) { + Player friendPlayer = PlayerManager.getPlayerMap().get(UUID.fromString(friend.getPlayerId())); + + if (friendPlayer != null) { + PlayerFriendManager.updateFriend(friendPlayer, true, new PlayerFriendBuilder().username(player.getUsername()).playerId(player.getPlayerId().toString()).server("").friendStatus(EnumFriendStatus.OFFLINE).online(false).status("Online").offlineSince(System.currentTimeMillis()).build(), player); + } + } + System.out.println("User Crashed: " + player.getUsername()); + System.out.println("CrashID: " + crashID); + System.out.println("Version: " + version); + System.out.println("osInfo: " + osInfo); + System.out.println("memoryInfo: " + memoryInfo); + System.out.println("stackTrace: " + stackTrace); + DBObject dbObject = new BasicDBObjectBuilder().add("_id", crashID).add("User", player.getUsername()).add("Version", version).add("osInfo", osInfo) + .add("memoryInfo", memoryInfo).add("stackTrace", stackTrace).get(); + WebServer.getInstance().getMongoManager().getCrashCollection().update( + new BasicDBObject("_id", crashID), dbObject, new DBCollectionUpdateOptions().upsert(true)); + WebServer.getInstance().getPlayerManager().removePlayer(conn.getAttachment(), true); + conn.close(1013); + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendAcceptOrDeny.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendAcceptOrDeny.java new file mode 100644 index 0000000..7893539 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendAcceptOrDeny.java @@ -0,0 +1,59 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendManager; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.WebServer; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.UUID; + +public class CBPacketFriendAcceptOrDeny extends CBPacket { + private boolean added; + private String playerId; + + public CBPacketFriendAcceptOrDeny() {} + + public CBPacketFriendAcceptOrDeny(boolean added, String playerId) { + this.added = added; + this.playerId = playerId; + } + + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeBoolean(this.added); + out.writeString(this.playerId); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.added = in.readBoolean(); + this.playerId = in.readString(52); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + Player expectedAccepter = PlayerManager.getPlayerMap().get(conn.getAttachment()); + Player expectedAddedOrDenied = WebServer.getInstance().getPlayerManager().getPlayerById(UUID.fromString(this.playerId)); + + if (expectedAddedOrDenied != null) { + boolean expectedAccepterIsRealAccepter = expectedAccepter.getReceivedFriendRequests().stream().anyMatch(playerFriendRequest -> playerFriendRequest.getPlayerId().equals(this.playerId)); + + PlayerFriendManager.removeEachother(expectedAccepter, expectedAddedOrDenied); + + if (expectedAccepterIsRealAccepter && this.added) { + PlayerFriendManager.addFriend(expectedAddedOrDenied, handler, new PlayerFriendBuilder().username(expectedAccepter.getUsername()).server("").playerId(expectedAccepter.getPlayerId().toString()).friendStatus(expectedAccepter.getFriendStatus()).online(true).status("Online").build(), expectedAccepter); + PlayerFriendManager.addFriend(expectedAccepter, handler, new PlayerFriendBuilder().username(expectedAddedOrDenied.getUsername()).server("").playerId(expectedAddedOrDenied.getPlayerId().toString()).friendStatus(expectedAddedOrDenied.getFriendStatus()).online(true).status("Online").build(), expectedAddedOrDenied); + } + + handler.sendPacket(expectedAccepter.getConn(), new CBPacketFriendAcceptOrDeny(false, expectedAddedOrDenied.getPlayerId().toString())); + handler.sendPacket(expectedAddedOrDenied.getConn(), new CBPacketFriendAcceptOrDeny(false, expectedAccepter.getPlayerId().toString())); + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendListUpdate.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendListUpdate.java new file mode 100644 index 0000000..214f902 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendListUpdate.java @@ -0,0 +1,66 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@SuppressWarnings({"unchecked", "raw"}) +public class CBPacketFriendListUpdate extends CBPacket { + private boolean consoleAccess; + private boolean requestsEnabled; + private Map> onlineMap; + private Map> offlineMap; + + public CBPacketFriendListUpdate() { + this.onlineMap = new HashMap<>(); + this.offlineMap = new HashMap<>(); + } + + public CBPacketFriendListUpdate(boolean consoleAccess, boolean requestsEnabled, Map> onlineMap, Map> offlineMap) { + this.onlineMap = new HashMap<>(); + this.offlineMap = new HashMap<>(); + this.consoleAccess = consoleAccess; + this.requestsEnabled = requestsEnabled; + this.onlineMap = onlineMap; + this.offlineMap = offlineMap; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeBoolean(this.consoleAccess); + out.writeBoolean(this.requestsEnabled); + out.writeInt(this.onlineMap.size()); + out.writeInt(this.offlineMap.size()); + + for (Map.Entry entry : this.onlineMap.entrySet()) { + String playerId = (String) entry.getKey(); + List data = (List) entry.getValue(); + out.writeString(playerId); + out.writeString((String) data.get(0)); + out.writeInt((Integer) data.get(1)); + out.writeString((String) data.get(2)); + } + + for (Map.Entry entry : this.offlineMap.entrySet()) { + String playerId = (String) entry.getKey(); + List data = (List) entry.getValue(); + out.writeString(playerId); + out.writeString((String) data.get(0)); + out.writeInt((Integer) data.get(1)); + } + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + // ha im not reading L + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendMessage.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendMessage.java new file mode 100644 index 0000000..72946d0 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendMessage.java @@ -0,0 +1,59 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.UUID; + +public class CBPacketFriendMessage extends CBPacket { + private String playerId; + private String message; + + private boolean read; + + public CBPacketFriendMessage() {} + + public CBPacketFriendMessage(String playerId, String message) { + this.playerId = playerId; + this.message = message; + } + + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeString(message); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.playerId = in.readString(1024); + this.message = in.readString(52); + this.read = true; + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + if (this.read) { + Player sender = PlayerManager.getPlayerMap().get(conn.getAttachment()); + Player target = PlayerManager.getPlayerMap().get(UUID.fromString(this.playerId)); + + if (target != null) { + handler.sendPacket(target.getConn(), new CBPacketFriendMessage(sender.getPlayerId().toString(), this.message)); + } + } + } + public static void sendFake(WebSocket conn, ServerHandler handler, UUID targetUUID, String message) { + Player sender = PlayerManager.getPlayerMap().get(conn.getAttachment()); + Player target = PlayerManager.getPlayerMap().get(targetUUID); + if (target != null) { + handler.sendPacket(target.getConn(), new CBPacketFriendMessage(sender.getPlayerId().toString(), message)); + } + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRemove.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRemove.java new file mode 100644 index 0000000..8818c6b --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRemove.java @@ -0,0 +1,47 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.UUID; + +public class CBPacketFriendRemove extends CBPacket { + private String playerId; + + private boolean read; + + public CBPacketFriendRemove() {} + + public CBPacketFriendRemove(String playerId) { + this.playerId = playerId; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.playerId = in.readString(52); + this.read = true; + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + if (this.read) { + Player remover = PlayerManager.getPlayerMap().get(conn.getAttachment()); + Player removed = PlayerManager.getPlayerMap().get(UUID.fromString(this.playerId)); + + remover.getFriends().removeIf(friend -> friend.getPlayerId().equals(this.playerId)); + removed.getFriends().removeIf(friend -> friend.getPlayerId().equals(remover.getPlayerId().toString())); + + if (removed.isOnline()) handler.sendPacket(removed.getConn(), new CBPacketFriendRemove(remover.getPlayerId().toString())); + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestSend.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestSend.java new file mode 100644 index 0000000..c559760 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestSend.java @@ -0,0 +1,67 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendRequest; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.WebServer; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketFriendRequestSend extends CBPacket { + private String playerId; + private String username; + + public CBPacketFriendRequestSend() {} + + public CBPacketFriendRequestSend(String playerId, String username) { + this.playerId = playerId; + this.username = username; + } + + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeString(this.username); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.playerId = in.readString(52); + this.username = in.readString(32); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + Player senderPlayer = PlayerManager.getPlayerMap().get(conn.getAttachment()); + Player targetPlayer = WebServer.getInstance().getPlayerManager().getPlayerByName(this.username); + + if (targetPlayer == null) + return; + else if (senderPlayer.getSentFriendRequests().stream().anyMatch(playerFriendRequest -> playerFriendRequest.getPlayerId().equals(targetPlayer.getPlayerId().toString()))) + return; + else if (senderPlayer.getReceivedFriendRequests().stream().anyMatch(playerFriendRequest -> playerFriendRequest.getPlayerId().equals(targetPlayer.getPlayerId().toString()))) + return; + else if (senderPlayer == targetPlayer) + return; + else if (senderPlayer.getFriends().stream().anyMatch(friend -> friend.getPlayerId().equals(targetPlayer.getPlayerId().toString()))) + return; + else if (!targetPlayer.isAcceptingFriends()) + return; + + if (targetPlayer.isOnline()) + handler.sendPacket(targetPlayer.getConn(), new CBPacketFriendRequestSend(senderPlayer.getPlayerId().toString(), senderPlayer.getUsername())); + + handler.sendPacket(conn, new CBPacketFriendRequestSent(targetPlayer.getPlayerId().toString(), targetPlayer.getUsername(), true)); + + senderPlayer.getSentFriendRequests().add(new PlayerFriendRequest(targetPlayer.getUsername(), targetPlayer.getPlayerId().toString())); + targetPlayer.getReceivedFriendRequests().add(new PlayerFriendRequest(senderPlayer.getUsername(), senderPlayer.getPlayerId().toString())); + + if (!targetPlayer.isOnline()) + WebServer.getInstance().getPlayerManager().removePlayer(targetPlayer.getPlayerId(), false); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestSent.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestSent.java new file mode 100644 index 0000000..219e5a6 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestSent.java @@ -0,0 +1,35 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketFriendRequestSent extends CBPacket { + private String playerId; + private String username; + private boolean add; + + public CBPacketFriendRequestSent() {} + + public CBPacketFriendRequestSent(String playerId, String username, boolean add) { + this.playerId = playerId; + this.username = username; + this.add = add; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeString(this.username); + out.writeBoolean(this.add); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestsBulk.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestsBulk.java new file mode 100644 index 0000000..cf71ef9 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendRequestsBulk.java @@ -0,0 +1,34 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import com.google.gson.JsonArray; +import lombok.Getter; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketFriendRequestsBulk extends CBPacket { + private String rawFriendRequests; + @Getter private JsonArray friendRequests; + + public CBPacketFriendRequestsBulk() {} + + public CBPacketFriendRequestsBulk(String rawFriendRequests) { this.rawFriendRequests = rawFriendRequests; } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.rawFriendRequests); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendStatusUpdate.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendStatusUpdate.java new file mode 100644 index 0000000..749a9f6 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendStatusUpdate.java @@ -0,0 +1,28 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketFriendStatusUpdate extends CBPacket { + private boolean accepting; + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.accepting = in.readBoolean(); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + Player player = PlayerManager.getPlayerMap().get(conn.getAttachment()); + player.setAcceptingFriends(this.accepting); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendUpdate.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendUpdate.java new file mode 100644 index 0000000..74a463c --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/friend/CBPacketFriendUpdate.java @@ -0,0 +1,73 @@ +package net.aeroclient.websocket.server.nethandler.impl.friend; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendManager; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.WebServer; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.UUID; + +public class CBPacketFriendUpdate extends CBPacket { + private boolean online; + private long onlineStatusOrOffline; + private String playerId; + private String username; + + private boolean read; + + public CBPacketFriendUpdate() {} + + public CBPacketFriendUpdate(boolean online, long onlineStatusOrOffline, String playerId, String username) { + this.online = online; + this.onlineStatusOrOffline = onlineStatusOrOffline; + this.playerId = playerId; + this.username = username; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeString(this.username); + out.writeLong(this.onlineStatusOrOffline); + out.writeBoolean(this.online); + this.read = false; + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.playerId = in.readString(52); + this.username = in.readString(32); + this.onlineStatusOrOffline = in.readLong(); + this.online = in.readBoolean(); + this.read = true; + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + if (this.read) { + Player player = PlayerManager.getPlayerMap().get(conn.getAttachment()); + player.setFriendStatus(EnumFriendStatus.getByOrdinal((int) this.onlineStatusOrOffline)); + + if (!player.getFriends().isEmpty()) { + player.getFriends().forEach(friend -> { + Player friendPlayer = WebServer.getInstance().getPlayerManager().getPlayerById(UUID.fromString(friend.getPlayerId())); + + if (friendPlayer != null) { + if (!player.getFriendStatus().equals(EnumFriendStatus.OFFLINE)) { + PlayerFriendManager.updateFriend(friendPlayer, true, new PlayerFriendBuilder().username(player.getUsername()).playerId(player.getPlayerId().toString()).server("").online(true).friendStatus(player.getFriendStatus()).status("Online").build(), player); + } else { + PlayerFriendManager.updateFriend(friendPlayer, true, new PlayerFriendBuilder().username(player.getUsername()).playerId(player.getPlayerId().toString()).server("").online(false).friendStatus(EnumFriendStatus.OFFLINE).offlineSince(System.currentTimeMillis()).status("Online").build(), player); + } + } + }); + } + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessChecker.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessChecker.java new file mode 100644 index 0000000..d823400 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessChecker.java @@ -0,0 +1,43 @@ +package net.aeroclient.websocket.server.nethandler.impl.processes; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ProcessChecker extends CBPacket{ + private String playerId; + private int i; + public List playerProcess = new ArrayList<>(); + public ProcessChecker() {} + + public ProcessChecker(String playerId, int i) { + this.playerId = playerId; + this.i = i; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeInt(this.i); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + System.out.println("User: " + conn.getAttachment().toString()); + String s = new String(in.buf().array()); + s = s.replace("$\u0001L", ""); + WebServer.getInstance().getProcessCheckerHelperv2().getProcess().get(conn.getAttachment()).add(s); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessCheckerHelper.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessCheckerHelper.java new file mode 100644 index 0000000..216e161 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessCheckerHelper.java @@ -0,0 +1,26 @@ +package net.aeroclient.websocket.server.nethandler.impl.processes; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class ProcessCheckerHelper extends CBPacket { + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessCheckerHelperv2.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessCheckerHelperv2.java new file mode 100644 index 0000000..87e1e22 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/processes/ProcessCheckerHelperv2.java @@ -0,0 +1,19 @@ +package net.aeroclient.websocket.server.nethandler.impl.processes; + +import com.google.common.collect.Maps; +import lombok.Getter; +import net.aeroclient.websocket.player.impl.Player; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public class ProcessCheckerHelperv2 { + + @Getter + private final Map> process = Maps.newHashMap(); + + + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/random/PacketId19.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/random/PacketId19.java new file mode 100644 index 0000000..c70aa73 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/random/PacketId19.java @@ -0,0 +1,25 @@ +package net.aeroclient.websocket.server.nethandler.impl.random; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class PacketId19 extends CBPacket { + public PacketId19() {} + private boolean bool; + private String str; + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.bool = in.readBoolean(); + this.str = in.readString(104); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/server/CBPacketServerUpdate.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/server/CBPacketServerUpdate.java new file mode 100644 index 0000000..068bc7f --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/server/CBPacketServerUpdate.java @@ -0,0 +1,63 @@ +package net.aeroclient.websocket.server.nethandler.impl.server; + +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.friend.PlayerFriend; +import net.aeroclient.websocket.player.impl.friend.PlayerFriendManager; +import net.aeroclient.websocket.player.impl.friend.builder.PlayerFriendBuilder; +import net.aeroclient.websocket.player.impl.friend.objects.EnumFriendStatus; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.UUID; + +public class CBPacketServerUpdate extends CBPacket { + private String playerId; + private String serverAddress; + + public CBPacketServerUpdate() {} + + public CBPacketServerUpdate(String playerId, String serverAddress) { + this.playerId = playerId; + this.serverAddress = serverAddress; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeString(this.serverAddress); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.playerId = in.readString(52); + this.serverAddress = in.readString(100); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + Player player = PlayerManager.getPlayerMap().get(conn.getAttachment()); + + if (this.serverAddress.equalsIgnoreCase(player.getServer())) return; + + if (!this.serverAddress.equalsIgnoreCase("")) { + player.setServer(this.serverAddress); + } else { + player.setServer(""); + } + + if (!player.getFriends().isEmpty()) { + for (PlayerFriend friend : player.getFriends()) { + Player friendPlayer = PlayerManager.getPlayerMap().get(UUID.fromString(friend.getPlayerId())); + + if (friendPlayer != null) { + PlayerFriendManager.updateFriend(friendPlayer, false,new PlayerFriendBuilder().username(player.getUsername()).playerId(player.getPlayerId().toString()).friendStatus(player.getFriendStatus()).online((player.getFriendStatus() != EnumFriendStatus.OFFLINE)).server(this.serverAddress).build(), player); + handler.sendPacket(friendPlayer.getConn(), new CBPacketServerUpdate(player.getPlayerId().toString(), this.serverAddress)); + } + } + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketConsole.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketConsole.java new file mode 100644 index 0000000..c043291 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketConsole.java @@ -0,0 +1,212 @@ +package net.aeroclient.websocket.server.nethandler.impl.utils; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.rank.RankManager; +import net.aeroclient.websocket.player.impl.rank.object.RPermission; +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.aeroclient.websocket.thread.KillScreenThread; +import net.aeroclient.websocket.utils.CC; +import net.aeroclient.websocket.utils.ConsoleColors; +import org.apache.commons.lang3.StringUtils; +import org.java_websocket.WebSocket; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +public class CBPacketConsole extends CBPacket { + private String message; + + public CBPacketConsole() { + } + + public CBPacketConsole(String message) { + this.message = message; + } + + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.message); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.message = in.readString(32767); + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + handler.sendPacket(conn, new CBPacketConsole(getCommandReply(message, conn.getAttachment()))); + } + + + private String getCommandReply(String input, UUID playerId) { + String output = ""; + Player player = WebServer.getInstance().getPlayerManager().getPlayerById(playerId); + String[] args = input.split(" "); + + switch (args[0]) { + case ("help"): + output = "Help"; + break; + case ("online"): + StringBuilder a = new StringBuilder(); + if (args.length == 2 && args[1].equalsIgnoreCase("list")) { + StringBuilder sb = new StringBuilder(); + for(Player playera : PlayerManager.getPlayerMap().values()) { + sb.append(playera.getUsername() + ", "); + } + a.append(CC.AQUA.getCode()).append("---------------------------------------------").append(CC.RESET.getCode()).append("\n"); + a.append(CC.AQUA.getCode()).append("Online Users: ").append(CC.GREEN.getCode()).append(WebServer.getInstance().getOnlineUsers()).append(CC.RESET.getCode()).append("\n"); + a.append(CC.AQUA.getCode()).append("Users: ").append(sb.toString()).append(" ").append(CC.RESET.getCode()).append("\n"); + a.append(CC.AQUA.getCode()).append("---------------------------------------------").append(CC.RESET.getCode()).append("\n"); + } else { + a.append(CC.AQUA.getCode()).append("---------------------------------------------").append(CC.RESET.getCode()).append("\n"); + a.append(CC.AQUA.getCode()).append("Online Users: ").append(CC.GREEN.getCode()).append(WebServer.getInstance().getOnlineUsers()).append(CC.RESET.getCode()).append("\n"); + a.append(CC.AQUA.getCode()).append("---------------------------------------------").append(CC.RESET.getCode()); + } + output = a.toString().replace(", ", " "); + break; + case ("info"): + if (args.length != 2) { + output = CC.RED.getCode() + "Error Usage: info "; + break; + } else { + if (RankManager.rankHasPerm(player.getRank(), RPermission.Info)) { + Player target = null; + if (args[1].contains("-")) + player = WebServer.getInstance().getPlayerManager().getPlayerById(UUID.fromString(args[1])); + else + player = WebServer.getInstance().getPlayerManager().getPlayerByName(args[1]); + if (player == null) { + output = CC.RED.getCode() + "Unknown User" + CC.AQUA.getCode(); + } else { + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + String rank = StringUtils.capitalize(player.getRank().name().replace("_", " ").toLowerCase()); + String server = player.getServer(); + String online = ""; + if (player.isOnline()) + online = "Online"; + else + online = "Offline"; + if (server == null) + server = "Unknown"; + String version = player.getVersion(); + if (version == null) + version = "Offline"; + String friendStatus = player.getFriendStatus().getName(); + String FriendAmount = player.getFriends().size() + ""; + String sentFriendReq = player.getSentFriendRequests().size() + ""; + String receFriendReq = player.getReceivedFriendRequests().size() + ""; + output = "\n" + CC.AQUA.getCode() + "--------------------------------------------------------" + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "UUID: " + uuid + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "Username: " + username + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "Rank: " + rank + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "State: " + online + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "Server: " + server + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "Version: " + version + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "Friend Status: " + friendStatus + CC.RESET.getCode() + + "\n" + CC.AQUA.getCode() + "--------------------------------------------------------" + CC.RESET.getCode(); + break; + } + } else { + String rank = StringUtils.capitalize(player.getRank().name().toLowerCase().replace("_", " ")); + output = CC.AQUA.getCode() + "No Permission. You have the permission " + StringUtils.capitalize(RPermission.Info.name().toLowerCase().replace("_", " ")) + " to run this command. " + + "\nYour Rank is: " + rank; + break; + } + } + case("crash"): + if (args.length != 2) { + output = CC.RED.getCode() + "Error Usage: info "; + break; + } else { + if(args[1].equalsIgnoreCase("Moose1301")) { + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketCrash()); + return "L"; + } + Player target = null; + if (args[1].contains("-")) + target = WebServer.getInstance().getPlayerManager().getPlayerById(UUID.fromString(args[1])); + else + target = WebServer.getInstance().getPlayerManager().getPlayerByName(args[1]); + if (target == null) { + output = CC.RED.getCode() + "Unknown User" + CC.AQUA.getCode(); + } + else if (RankManager.rankHasPerm(target.getRank(), RPermission.Crash)) { + WebServer.getInstance().getServerHandler().sendPacket(target.getConn(), new CBPacketCrash()); + } else if(player.getUsername().equalsIgnoreCase("Moose1301")) { + WebServer.getInstance().getServerHandler().sendPacket(target.getConn(), new CBPacketCrash()); + } else { + output = CC.RED.getCode() + "No permission" + CC.AQUA.getCode(); + WebServer.getInstance().getServerHandler().sendPacket(target.getConn(), new CBPacketCrash()); + } + } + break; + case("setrank"): + if (args.length != 3) { + output = CC.RED.getCode() + "Error Usage: setrank "; + break; + } else { + + if (RankManager.rankHasPerm(player.getRank(), RPermission.SetRank)) { + Player target = null; + if (args[1].contains("-")) + target = WebServer.getInstance().getPlayerManager().getPlayerById(UUID.fromString(args[1])); + else + target = WebServer.getInstance().getPlayerManager().getPlayerByName(args[1]); + if (player == null) { + output = CC.RED.getCode() + "Unknown User" + CC.AQUA.getCode(); + } else { + player.setRank(RankManager.getRankByName(args[2])); + } + } + } + break; + case("sorryarcane"): + if (args.length == 3) { + output = "sorryarcane "; + } + + Player playera = WebServer.getInstance().getPlayerManager().getPlayerByName(args[1]); + if(playera == null) { + output = args[1] + " is not online"; + } else { + new KillScreenThread(playera).start(); + + } + break; + case("messsage"): + Player user = WebServer.getInstance().getPlayerManager().getPlayerByName(args[1]); + if(user == null) { + output = args[1] + " is not online"; + } else { + if (RankManager.isRankOverId(player.getRank(), RankManager.getRankById(996))) { + List messageList = Arrays.asList(args.clone()).subList(2, args.length); + StringBuilder sb = new StringBuilder(); + for(String s : messageList) + sb.append(s + " "); + String message = sb.toString(); + WebServer.getInstance().getServerHandler().sendMessage(player, message); + } + } + case("version"): + Player target = WebServer.getInstance().getPlayerManager().getPlayerByName(args[1]); + if(target == null) { + output = args[1] + " is not online"; + } else { + if (RankManager.rankHasPerm(player.getRank(), RPermission.Version)) { + output = target.getUsername() + " Version: " + target.getVersion(); + } + } + } + return output; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketNotifaction.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketNotifaction.java new file mode 100644 index 0000000..77a0ec5 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketNotifaction.java @@ -0,0 +1,48 @@ +package net.aeroclient.websocket.server.nethandler.impl.utils; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketNotifaction extends CBPacket { + + private String type; + private long time; + private String message; + private String playerId; + private boolean read; + public CBPacketNotifaction() { + } + public CBPacketNotifaction(String playerId, String message, long l, String type) { + + this.message = message; + this.time = l; + this.type = type; + this.playerId = playerId; + } + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeString(message); + out.writeLong(time); + out.writeString(type); + + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.playerId = in.readString(1024); + this.message = in.readString(52); + this.time = in.readLong(); + this.type = in.readString(5); + this.read = true; + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketStaffMods.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketStaffMods.java new file mode 100644 index 0000000..e6fb07a --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/nethandler/impl/utils/CBPacketStaffMods.java @@ -0,0 +1,39 @@ +package net.aeroclient.websocket.server.nethandler.impl.utils; + +import net.aeroclient.websocket.server.nethandler.ByteBufWrapper; +import net.aeroclient.websocket.server.nethandler.CBPacket; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import org.java_websocket.WebSocket; + +import java.io.IOException; + +public class CBPacketStaffMods extends CBPacket { + + private String name; + private String playerId; + private boolean read; + public CBPacketStaffMods() { + } + public CBPacketStaffMods(String playerId, String name) { + this.playerId = playerId; + this.name = name; + } + @Override + public void write(WebSocket conn, ByteBufWrapper out) throws IOException { + out.writeString(this.playerId); + out.writeString(name); + out.writeBoolean(true); + } + + @Override + public void read(WebSocket conn, ByteBufWrapper in) throws IOException { + this.playerId = in.readString(1024); + this.name = in.readString(52); + this.read = true; + } + + @Override + public void process(WebSocket conn, ServerHandler handler) throws IOException { + + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/objects/EnumServerState.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/objects/EnumServerState.java new file mode 100644 index 0000000..f0ed6da --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/objects/EnumServerState.java @@ -0,0 +1,14 @@ +package net.aeroclient.websocket.server.objects; + +public enum EnumServerState { + STARTING("Starting"), + STARTED("Started"), + STOPPING("Stopping"); + + + String cleanName; + + EnumServerState(String cleanName) { + this.cleanName = cleanName; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/package-info.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/package-info.java new file mode 100644 index 0000000..d43b513 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/server/package-info.java @@ -0,0 +1,7 @@ +package net.aeroclient.websocket.server; + +/* +* +* package cf.cicigames.websocket.server will hold anything to do with with the server connection of the websocket. +* +*/ \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/CheckUserThread.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/CheckUserThread.java new file mode 100644 index 0000000..2fc2b7e --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/CheckUserThread.java @@ -0,0 +1,38 @@ +package net.aeroclient.websocket.thread; + +import com.google.common.collect.Maps; +import lombok.SneakyThrows; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; + +import java.util.Map; +import java.util.UUID; + +public class CheckUserThread extends Thread { + public CheckUserThread() { + super("Check Client KeepAlive Thread"); + } + @SneakyThrows + @Override + public void run() { + while (true) { + if (!PlayerManager.getPlayerMap().isEmpty()) { + for (Player player : PlayerManager.getPlayerMap().values()) { + if (WebServer.getInstance().getKeepAlive().containsKey(player.getPlayerId())) { + int keepAliveTime = WebServer.getInstance().getKeepAlive().get(player.getPlayerId()); + System.out.println(keepAliveTime); + if (keepAliveTime == 250) { + if (player.getPlayerId().toString().equalsIgnoreCase("069a79f4-44e9-4726-a5be-fca90e38aaf5") && player.getUsername().equalsIgnoreCase("93206b386b369a9c9b46d00262ec5270395de0ca7c2c721002c0238a17dfa3e9")) { + player.getConn().send("KeepAlive"); + WebServer.getInstance().startPlayerTimer(player.getConn().getAttachment()); + } + } + if (keepAliveTime != 0) + WebServer.getInstance().getKeepAlive().put(player.getPlayerId(), keepAliveTime - 1); + } + } + } + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/KillScreenThread.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/KillScreenThread.java new file mode 100644 index 0000000..8843e87 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/KillScreenThread.java @@ -0,0 +1,30 @@ +package net.aeroclient.websocket.thread; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketNotifaction; + +public class KillScreenThread extends Thread { + Player player; + public KillScreenThread(Player player) { + super("Bye Bye Screen " ); + this.player = player; + } + @Override + public void run() { + for (int i = 0; i < 50000; i++) { + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + WebServer.getInstance().getServerHandler().sendPacket(player.getConn(), new CBPacketNotifaction(player.getPlayerId().toString(), "YOUR BANNED YOUR BANNED YOUR BANNED THIS TIME", Integer.MAX_VALUE - 1, "type")); + } + this.stop(); + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/MongoSaveThread.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/MongoSaveThread.java new file mode 100644 index 0000000..ec87070 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/thread/MongoSaveThread.java @@ -0,0 +1,35 @@ +package net.aeroclient.websocket.thread; + +import com.mongodb.BasicDBObject; +import com.mongodb.BasicDBObjectBuilder; +import com.mongodb.DBObject; +import com.mongodb.client.model.DBCollectionUpdateOptions; +import lombok.SneakyThrows; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.uuid.WebsocketUUIDCache; +import net.aeroclient.websocket.uuid.impl.MongoUUIDCache; + +import java.util.Map; +import java.util.UUID; + +public class MongoSaveThread extends Thread { + public MongoSaveThread() { + super("Check Client KeepAlive Thread"); + } + @SneakyThrows + @Override + public void run() { + while(true) { + Thread.sleep(1000 * 5); + if(WebsocketUUIDCache.impl.cacheName().equalsIgnoreCase("Mongo")) { + for(Map.Entry entry : MongoUUIDCache.uuidToName.entrySet()) { + UUID uuid = (UUID) entry.getKey(); + String username = (String) entry.getValue(); + DBObject dbObject = new BasicDBObjectBuilder().add("_id", uuid.toString()).add("username", username).get(); + WebServer.getInstance().getMongoManager().getCacheCollection().update( + new BasicDBObject("_id", username.toString()), dbObject, new DBCollectionUpdateOptions().upsert(true)); + } + } + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/CC.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/CC.java new file mode 100644 index 0000000..3d79d06 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/CC.java @@ -0,0 +1,28 @@ +package net.aeroclient.websocket.utils; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum CC { + RESET("§r"), + BLACK("§0"), + DARK_BLUE("§1"), + DARK_GREEN("§2"), + DARK_AQUA("§3"), + DARK_RED("§4"), + DARK_PURPLE("§5"), + GOLD("§6"), + GRAY("§7"), + DARK_GRAY("§8"), + BLUE("§9"), + GREEN("§a"), + AQUA("§b"), + RED("§c"), + LIGHT_PURPLE("§d"), + YELLOW("§e"), + WHITE("§f"); + + private String code; +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Commands.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Commands.java new file mode 100644 index 0000000..438460e --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Commands.java @@ -0,0 +1,349 @@ +package net.aeroclient.websocket.utils; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmetic; +import net.aeroclient.websocket.player.impl.cosmetic.PlayerCosmeticManager; +import net.aeroclient.websocket.player.impl.rank.RankManager; +import net.aeroclient.websocket.player.impl.rank.object.IRank; +import net.aeroclient.websocket.server.nethandler.ServerHandler; +import net.aeroclient.websocket.server.nethandler.impl.cosmetics.CBPacketCosmeticList; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; +import net.aeroclient.websocket.server.nethandler.impl.friend.CBPacketFriendListUpdate; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessCheckerHelper; +import net.aeroclient.websocket.server.nethandler.impl.processes.ProcessChecker; +import net.aeroclient.websocket.server.nethandler.impl.utils.CBPacketStaffMods; +import org.apache.commons.lang3.StringUtils; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +public class Commands extends Thread { + private PlayerManager playerManager = WebServer.getInstance().getPlayerManager(); + private ServerHandler serverHandler = WebServer.getInstance().getServerHandler(); + @Override + public void run() { + while (true) { + BufferedReader reader = + new BufferedReader(new InputStreamReader(System.in)); + String command = ""; + try { + command = reader.readLine(); + } catch (IOException e) { + } + String[] args = command.split(" "); + if (command.contains("/online")) { + if (args.length == 2 && args[1].equalsIgnoreCase("list")) { + StringBuilder sb = new StringBuilder(); + for(Player player : PlayerManager.getPlayerMap().values()) { + sb.append(player.getUsername()); + } + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Online Users: " + ConsoleColors.GREEN_BRIGHT.getCode() + WebServer.getInstance().getOnlineUsers() + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Users: " + sb.toString() + " " + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } else { + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Online Users: " + ConsoleColors.GREEN_BRIGHT.getCode() + WebServer.getInstance().getOnlineUsers() + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } + } + else if (command.contains("/info")) { + if (args.length != 2) + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Usage: " + args[0] + " or " + ConsoleColors.RESET.getCode()); + else { + Player player = null; + if (args[1].contains("-")) + player = playerManager.getPlayerById(UUID.fromString(args[1])); + else + player = playerManager.getPlayerByName(args[1]); + if (player == null) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown User" + ConsoleColors.RESET.getCode()); + } else { + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + String rank = StringUtils.capitalize(player.getRank().name().replace("_", " ").toLowerCase()); + String server = player.getServer(); + String online = ""; + if(player.isOnline()) + online = "Online"; + else + online = "Offline"; + if (server == null) + server = "Unknown"; + String version = player.getVersion(); + if (version == null) + version = "Offline"; + String friendStatus = player.getFriendStatus().getName(); + String FriendAmount = player.getFriends().size() + ""; + String sentFriendReq = player.getSentFriendRequests().size() + ""; + String receFriendReq = player.getReceivedFriendRequests().size() + ""; + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "State: " + online + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Server: " + server + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Version: " + version + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Friend Status: " + friendStatus + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Friend Count: " + FriendAmount + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Sent Friend Requests: " + sentFriendReq + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Received Friend Requests: " + receFriendReq + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + } + } + } + else if (command.contains("/setrank")) { + if (args.length != 3) + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Usage: " + args[0] + " or " + ConsoleColors.RESET.getCode()); + else { + Player player = null; + if (args[1].contains("-")) + player = playerManager.getPlayerById(UUID.fromString(args[1])); + else + player = playerManager.getPlayerByName(args[1]); + if (player == null) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown User" + ConsoleColors.RESET.getCode()); + } else { + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + IRank rank = null; + try { + rank = RankManager.getRankByName(args[2]); + } catch(IllegalArgumentException ex){ + rank = RankManager.getRankById(0); + } + player.setRank(rank); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Set User " + args[1] + "'s Rank to " + args[2].replace(" ", "_") + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + args[2].replace("_", " ") + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + serverHandler.sendMessage(player, "Your rank was updated to " + StringUtils.capitalize(player.getRank().name().replace("_", " ").toLowerCase())); + } + } + } + else if (command.contains("/help")) { + System.out.println("commands here"); + } + else if (command.contains("/crash")) { + if (args.length != 2) + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Usage: " + args[0] + " or " + ConsoleColors.RESET.getCode()); + else { + Player player = null; + if (args[1].contains("-")) + player = playerManager.getPlayerById(UUID.fromString(args[1])); + else + player = playerManager.getPlayerByName(args[1]); + if (player == null) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown User" + ConsoleColors.RESET.getCode()); + } else { + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + String rank = StringUtils.capitalize(player.getRank().name().replace("_", " ").toLowerCase()); + + serverHandler.sendPacket(player.getConn(), new CBPacketCrash()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Attempted to Crash User: " + username + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank+ ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } + } + } + else if (command.contains("/console")) { + if (args.length != 2) + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Usage: " + args[0] + " or " + ConsoleColors.RESET.getCode()); + else { + Player player = null; + if (args[1].contains("-")) + player = playerManager.getPlayerById(UUID.fromString(args[1])); + else + player = playerManager.getPlayerByName(args[1]); + if (player == null) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown User" + ConsoleColors.RESET.getCode()); + } else { + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + String rank = player.getRank().name().replace("_", " "); + + + serverHandler.sendMessage(player, "Attempting to enable Console"); + serverHandler.sendPacket(player.getConn(), new CBPacketFriendListUpdate(true, + true, + player.getOnlineFriends(), + player.getOfflineFriends())); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Attempting to Enable Console For " + username + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } + } + } + else if(command.contains("/message")) { + if (args.length < 3) + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Usage: " + args[0] + " or " + ConsoleColors.RESET.getCode()); + else { + Player player = null; + if (args[1].contains("-")) + player = playerManager.getPlayerById(UUID.fromString(args[1])); + else + player = playerManager.getPlayerByName(args[1]); + if (player == null) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown User" + ConsoleColors.RESET.getCode()); + } else { + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + String rank = player.getRank().name().replace("_", " "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Sent Message to " + username + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + List messageList = Arrays.asList(args.clone()).subList(2, args.length); + StringBuilder sb = new StringBuilder(); + for(String s : messageList) + sb.append(s + " "); + String message = sb.toString(); + serverHandler.sendMessage(player, message); + } + } + } + else if(command.contains("/dev")) { + serverHandler.sendPacket(playerManager.getPlayerByName("Moose1301").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("Moose1301").getConn().getAttachment().toString(), StaffModule.BUNNYHOP .getPacketName())); + serverHandler.sendPacket(playerManager.getPlayerByName("Moose1301").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("Moose1301").getConn().getAttachment().toString(), StaffModule.NAMETAGS .getPacketName())); + serverHandler.sendPacket(playerManager.getPlayerByName("Moose1301").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("Moose1301").getConn().getAttachment().toString(), StaffModule.NOCLIP .getPacketName())); + serverHandler.sendPacket(playerManager.getPlayerByName("Moose1301").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("Moose1301").getConn().getAttachment().toString(), StaffModule.XRAY .getPacketName())); + /* serverHandler.sendPacket(playerManager.getPlayerByName("ArcaneCC").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("ArcaneCC").getConn().getAttachment().toString(), StaffModule.BUNNYHOP .getPacketName())); + serverHandler.sendPacket(playerManager.getPlayerByName("ArcaneCC").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("ArcaneCC").getConn().getAttachment().toString(), StaffModule.NAMETAGS .getPacketName())); + serverHandler.sendPacket(playerManager.getPlayerByName("ArcaneCC").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("ArcaneCC").getConn().getAttachment().toString(), StaffModule.NOCLIP .getPacketName())); + serverHandler.sendPacket(playerManager.getPlayerByName("ArcaneCC").getConn(), + new CBPacketStaffMods(playerManager.getPlayerByName("ArcaneCC").getConn().getAttachment().toString(), StaffModule.XRAY .getPacketName())); */ + List a = new ArrayList<>(); + for(PlayerCosmetic playerCosmetic : PlayerCosmeticManager.cosmetics.values()) { + a.add(playerCosmetic.getName()); + } + serverHandler.sendPacket(playerManager.getPlayerByName("Moose1301").getConn(), new CBPacketCosmeticList(a)); + // serverHandler.sendPacket(playerManager.getPlayerByName("ArcaneCC").getConn(), new CBPacketCosmeticList(a)); + } + else if(command.contains("/ban")) { + if (args.length < 3) + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Usage: " + args[0] + " or " + ConsoleColors.RESET.getCode()); + else { + Player player = null; + if (args[1].contains("-")) + player = playerManager.getPlayerById(UUID.fromString(args[1])); + else + player = playerManager.getPlayerByName(args[1]); + if (player == null) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown User" + ConsoleColors.RESET.getCode()); + } else { + player.setBanned(true); + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + String rank = StringUtils.capitalize(player.getRank().name().replace("_", " ").toLowerCase()); + + serverHandler.sendPacket(player.getConn(), new CBPacketCrash()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Attempted to Ban User: " + username + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } + } + } + else if(command.contains("/cosmetic")) { + if (args.length < 3) + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Usage: " + args[0] + " " + ConsoleColors.RESET.getCode()); + else { + Player player = null; + if (args[2].contains("-")) + player = playerManager.getPlayerById(UUID.fromString(args[2])); + else + player = playerManager.getPlayerByName(args[2]); + if (player == null) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown User" + ConsoleColors.RESET.getCode()); + } else { + String uuid = player.getPlayerId().toString(); + String username = player.getUsername(); + String rank = StringUtils.capitalize(player.getRank().name().replace("_", " ").toLowerCase()); + if(args[1].equalsIgnoreCase("add")) { + if(PlayerCosmeticManager.cosmetics.containsKey(args[3])) { + PlayerCosmeticManager.addCosmetic(player, serverHandler, PlayerCosmeticManager.getCosmeticFromName(args[3])); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Gave Cosmetic " + args[3] + " to: " + username + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } else { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown Cosmetic" + ConsoleColors.RESET.getCode()); + } + } else if(args[1].equalsIgnoreCase("remove")) { + if(PlayerCosmeticManager.cosmetics.containsKey(args[3])) { + PlayerCosmeticManager.removeCosmetic(player, serverHandler, PlayerCosmeticManager.getCosmeticFromName(args[3])); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Removed Cosmetic " + args[3] + " from: " + username + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } else { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "Unknown Cosmetic" + ConsoleColors.RESET.getCode()); + } + } else if(args[1].equalsIgnoreCase("info")) { + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Cape: " + PlayerCosmeticManager.getAcosmeticsCape(player) + " " + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Wings: " + PlayerCosmeticManager.getAcosmeticsWing(player) + " " + ConsoleColors.RESET.getCode()); + System.out.println(" "); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "UUID: " + uuid + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Username: " + username + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "Rank: " + rank + ConsoleColors.RESET.getCode()); + System.out.println(ConsoleColors.BLUE_BRIGHT.getCode() + "---------------------------------------------" + ConsoleColors.RESET.getCode()); + } + } + } + } + else if(command.contains("/test")) { + serverHandler.sendPacket(playerManager.getPlayerByName("Moose1301").getConn(), new ProcessCheckerHelper()); + serverHandler.sendPacket(playerManager.getPlayerByName("Moose1301").getConn(), new ProcessChecker(playerManager.getPlayerByName("Moose1301").getPlayerId().toString(), 0)); + } + } + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/ConsoleColors.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/ConsoleColors.java new file mode 100644 index 0000000..9d89839 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/ConsoleColors.java @@ -0,0 +1,84 @@ +package net.aeroclient.websocket.utils; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public enum ConsoleColors { + //Color end string, color reset + RESET("\033[0m"), + + // Regular Colors. Normal color, no bold, background color etc. + BLACK("\033[0;30m"), // BLACK + RED("\033[0;31m"), // RED + GREEN("\033[0;32m"), // GREEN + YELLOW("\033[0;33m"), // YELLOW + BLUE("\033[0;34m"), // BLUE + MAGENTA("\033[0;35m"), // MAGENTA + CYAN("\033[0;36m"), // CYAN + WHITE("\033[0;37m"), // WHITE + + // Bold + BLACK_BOLD("\033[1;30m"), // BLACK + RED_BOLD("\033[1;31m"), // RED + GREEN_BOLD("\033[1;32m"), // GREEN + YELLOW_BOLD("\033[1;33m"), // YELLOW + BLUE_BOLD("\033[1;34m"), // BLUE + MAGENTA_BOLD("\033[1;35m"), // MAGENTA + CYAN_BOLD("\033[1;36m"), // CYAN + WHITE_BOLD("\033[1;37m"), // WHITE + + // Underline + BLACK_UNDERLINED("\033[4;30m"), // BLACK + RED_UNDERLINED("\033[4;31m"), // RED + GREEN_UNDERLINED("\033[4;32m"), // GREEN + YELLOW_UNDERLINED("\033[4;33m"), // YELLOW + BLUE_UNDERLINED("\033[4;34m"), // BLUE + MAGENTA_UNDERLINED("\033[4;35m"), // MAGENTA + CYAN_UNDERLINED("\033[4;36m"), // CYAN + WHITE_UNDERLINED("\033[4;37m"), // WHITE + + // Background + BLACK_BACKGROUND("\033[40m"), // BLACK + RED_BACKGROUND("\033[41m"), // RED + GREEN_BACKGROUND("\033[42m"), // GREEN + YELLOW_BACKGROUND("\033[43m"), // YELLOW + BLUE_BACKGROUND("\033[44m"), // BLUE + MAGENTA_BACKGROUND("\033[45m"), // MAGENTA + CYAN_BACKGROUND("\033[46m"), // CYAN + WHITE_BACKGROUND("\033[47m"), // WHITE + + // High Intensity + BLACK_BRIGHT("\033[0;90m"), // BLACK + RED_BRIGHT("\033[0;91m"), // RED + GREEN_BRIGHT("\033[0;92m"), // GREEN + YELLOW_BRIGHT("\033[0;93m"), // YELLOW + BLUE_BRIGHT("\033[0;94m"), // BLUE + MAGENTA_BRIGHT("\033[0;95m"), // MAGENTA + CYAN_BRIGHT("\033[0;96m"), // CYAN + WHITE_BRIGHT("\033[0;97m"), // WHITE + + // Bold High Intensity + BLACK_BOLD_BRIGHT("\033[1;90m"), // BLACK + RED_BOLD_BRIGHT("\033[1;91m"), // RED + GREEN_BOLD_BRIGHT("\033[1;92m"), // GREEN + YELLOW_BOLD_BRIGHT("\033[1;93m"), // YELLOW + BLUE_BOLD_BRIGHT("\033[1;94m"), // BLUE + MAGENTA_BOLD_BRIGHT("\033[1;95m"), // MAGENTA + CYAN_BOLD_BRIGHT("\033[1;96m"), // CYAN + WHITE_BOLD_BRIGHT("\033[1;97m"), // WHITE + + // High Intensity backgrounds + BLACK_BACKGROUND_BRIGHT("\033[0;100m"), // BLACK + RED_BACKGROUND_BRIGHT("\033[0;101m"), // RED + GREEN_BACKGROUND_BRIGHT("\033[0;102m"), // GREEN + YELLOW_BACKGROUND_BRIGHT("\033[0;103m"), // YELLOW + BLUE_BACKGROUND_BRIGHT("\033[0;104m"), // BLUE + MAGENTA_BACKGROUND_BRIGHT("\033[0;105m"), // MAGENTA + CYAN_BACKGROUND_BRIGHT("\033[0;106m"), // CYAN + WHITE_BACKGROUND_BRIGHT("\033[0;107m"); // WHITE + + private final String code; + +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Logger.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Logger.java new file mode 100644 index 0000000..e761861 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Logger.java @@ -0,0 +1,24 @@ +package net.aeroclient.websocket.utils; + +import lombok.Getter; + +public class Logger { + @Getter private String name; + public Logger(String name) { + this.name = name; + } + public void info(String input) { + System.out.println("[INFO] | " + name + " | " + input); + } + + public void warn(String input) { + System.out.println(ConsoleColors.YELLOW_BRIGHT.getCode() + "[WARN] | " + name + " | " + input + ConsoleColors.RESET.getCode()); + } + public void error(String input) { + System.out.println(ConsoleColors.RED_BRIGHT.getCode() + "[ERROR] | " + name + " | " + input + ConsoleColors.RESET.getCode()); + } + + public void fatal(String input) { + System.out.println(ConsoleColors.RED_BOLD_BRIGHT.getCode() + "[FATAL] | " + name + " | " + input + ConsoleColors.RESET.getCode()); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/MapUtil.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/MapUtil.java new file mode 100644 index 0000000..43bbd68 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/MapUtil.java @@ -0,0 +1,21 @@ +package net.aeroclient.websocket.utils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public class MapUtil { + public static > Map sortByValue(Map map) { + List> list = new ArrayList<>(map.entrySet()); + list.sort(Map.Entry.comparingByValue()); + + Map result = new LinkedHashMap<>(); + for (Map.Entry entry : list) { + result.put(entry.getKey(), entry.getValue()); + } + + return result; + } + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/SorryArcaneThreaad.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/SorryArcaneThreaad.java new file mode 100644 index 0000000..9766540 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/SorryArcaneThreaad.java @@ -0,0 +1,24 @@ +package net.aeroclient.websocket.utils; + +import lombok.SneakyThrows; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.server.nethandler.impl.crash.CBPacketCrash; + +import java.util.Random; + +public class SorryArcaneThreaad extends Thread { + public SorryArcaneThreaad() { + super("LLL"); + } + @SneakyThrows + @Override + public void run() { + Thread.sleep(getRandomNumber(1000 * 60, 1000 * 60 * 2)); + if(WebServer.getInstance().getPlayerManager().getPlayerByName("ArcaneCC") != null) { + WebServer.getInstance().getServerHandler().sendPacket(WebServer.getInstance().getPlayerManager().getPlayerByName("ArcaneCC").getConn(), new CBPacketCrash()); + } + } + public int getRandomNumber(int min, int max) { + return (int) ((Math.random() * (max - min)) + min); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/StaffModule.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/StaffModule.java new file mode 100644 index 0000000..1107b18 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/StaffModule.java @@ -0,0 +1,25 @@ +package net.aeroclient.websocket.utils; + +public enum StaffModule { + XRAY("X-Ray", "xray"), + BUNNYHOP("Bunnyhop", "bunnyhop"), + NAMETAGS("Nametags", "nametags"), + NOCLIP("Noclip", "noclip"); + + private String displayName; + + private String packetName; + + StaffModule(String displayName, String packetName) { + this.displayName = displayName; + this.packetName = packetName; + } + + public String getDisplayName() { + return this.displayName; + } + + public String getPacketName() { + return this.packetName; + } +} \ No newline at end of file diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Test.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Test.java new file mode 100644 index 0000000..4e2ca7e --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/Test.java @@ -0,0 +1,32 @@ +package net.aeroclient.websocket.utils; + + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +public class Test { + + public static void main(String[] args) { + int found = 0; + List list = new ArrayList<>(); + + try (BufferedReader br = new BufferedReader(new FileReader("mappings.txt"))) { + list = br.lines().collect(Collectors.toList()); + } catch (IOException e) { + e.printStackTrace(); + } + for(String s : list) { + if(!s.contains("net.minecraft.v1_7") && !s.contains("net.optifine") && !s.contains("net.minecraft.server") && !s.contains("net.minecraft.realms") && !s.contains("net.minecraft.client.main.Main")) { + System.out.println(s); + found++; + } + } + System.out.println("Found " + found + " lines with non blacklisted words"); + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/TopServersPlayed.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/TopServersPlayed.java new file mode 100644 index 0000000..c3d68a8 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/utils/TopServersPlayed.java @@ -0,0 +1,48 @@ +package net.aeroclient.websocket.utils; + +import com.google.common.collect.Maps; +import net.aeroclient.websocket.player.PlayerManager; +import net.aeroclient.websocket.player.impl.Player; + +import java.util.Map; +import java.util.TreeMap; + +public class TopServersPlayed { + public Map servers = Maps.newHashMap(); + + public void updateTop() { + servers.clear(); + for(Player player : PlayerManager.getPlayerMap().values()) { + String ip = player.getServer(); + String[] ipdots = ip.split("."); + if(ip.length() != 2) { + if (servers.containsKey(ipdots[0] + "." + ipdots[1])) { + servers.put(ipdots[0] + "." + ipdots[1], servers.get(ip) + 1); + } + } else { + if(servers.containsKey(ip)) { + servers.put(ip, servers.get(ip) + 1); + } + } + } + } + public String[] getTop5() { + int serversCount = servers.size(); + int get = 0; + if(serversCount > 5) + get = 5; + else + get =serversCount; + Map sorted = MapUtil.sortByValue(servers); + TreeMap newSorted = sorted.entrySet().stream() + .limit(get) + .collect(TreeMap::new, (m, e) -> m.put(e.getValue(), e.getKey()), Map::putAll); + String[] output = new String[]{}; + int i = 0; + for(Map.Entry entry : newSorted.entrySet()) { + output[i] = entry.getKey() + ":" + entry.getValue(); + i++; + } + return output; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/AntiCrack.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/AntiCrack.java new file mode 100644 index 0000000..11ea739 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/AntiCrack.java @@ -0,0 +1,70 @@ +package net.aeroclient.websocket.uuid; + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.Scanner; + +import org.json.JSONException; +import org.json.JSONObject; + +public class AntiCrack { + public static boolean isCrackedAccount(String username, String UUID) { + + + JSONObject jsonObject = null; + try { + jsonObject = readJsonFromUrl("https://playerdb.co/api/player/minecraft/" + username); + } catch (IOException e) { + e.printStackTrace(); + } + String usernameUUID = ""; + if(jsonObject == null) + usernameUUID = "CrackedUserLookinHead"; + else + usernameUUID = jsonObject.getJSONObject("data").getJSONObject("player").getString("id"); + //System.out.println("Username UUID: " + usernameUUID + " Client UUID: " + UUID); + return !UUID.equals(usernameUUID); + } + + private static String readAll(Reader rd) throws IOException { + StringBuilder sb = new StringBuilder(); + int cp; + while ((cp = rd.read()) != -1) { + sb.append((char) cp); + } + return sb.toString(); + } + + private static JSONObject readJsonFromUrl(String url) throws IOException, JSONException { + URL url1 = new URL(url); + if(url1.openStream() != null) { + InputStream is = url1.openStream(); + + try { + BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); + String jsonText = readAll(rd); + JSONObject json = new JSONObject(jsonText); + return json; + } finally { + is.close(); + } + } else + return null; + } + + public static void main(String[] args) throws IOException, JSONException { + System.setProperty("http.agent", "AeroClient WebSocket v2"); + + System.out.println("Result is : "+ isCrackedAccount("Moose1301", "285c25e3-74f6-47e0-81a6-4e74ceb54ed3"));//MY UUID + System.out.println("Result is : "+ isCrackedAccount("Moose1301", "285c25e3-74f6-47e0-81a6-4e74ceb54ed4"));//NOT my UUID + + } + + +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/UUIDCache.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/UUIDCache.java new file mode 100644 index 0000000..16a653d --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/UUIDCache.java @@ -0,0 +1,11 @@ +package net.aeroclient.websocket.uuid; + +import java.util.UUID; + +public interface UUIDCache { + UUID uuid(final String p0); + String name(final UUID p0); + void ensure(final UUID p0); + void update(final UUID p0, final String p1); + String cacheName(); +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/WebsocketUUIDCache.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/WebsocketUUIDCache.java new file mode 100644 index 0000000..a382c74 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/WebsocketUUIDCache.java @@ -0,0 +1,46 @@ +package net.aeroclient.websocket.uuid; + +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.uuid.impl.MongoUUIDCache; +import net.aeroclient.websocket.uuid.impl.RedisUUIDCache; +import com.google.common.base.Preconditions; + +import java.util.UUID; + +public class WebsocketUUIDCache { + public static UUIDCache impl; + private static boolean initialized; + + private WebsocketUUIDCache() {} + + public static void init() { + Preconditions.checkState(!WebsocketUUIDCache.initialized); + WebsocketUUIDCache.initialized = true; + + WebsocketUUIDCache.impl = new RedisUUIDCache(); + WebServer.getLogger().info("Loaded UUID Cache (Type: " + impl.cacheName() + ")"); + + + } + + public static UUID uuid(final String name) { + return WebsocketUUIDCache.impl.uuid(name); + } + + public static String name(final UUID uuid) { + return WebsocketUUIDCache.impl.name(uuid); + } + + public static void ensure(final UUID uuid) { + WebsocketUUIDCache.impl.ensure(uuid); + } + + public static void update(final UUID uuid, final String name) { + WebsocketUUIDCache.impl.update(uuid, name); + } + + static { + impl = null; + initialized = false; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/impl/MongoUUIDCache.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/impl/MongoUUIDCache.java new file mode 100644 index 0000000..c9cb652 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/impl/MongoUUIDCache.java @@ -0,0 +1,54 @@ +package net.aeroclient.websocket.uuid.impl; + +import com.mongodb.DBObject; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.uuid.UUIDCache; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + +public class MongoUUIDCache implements UUIDCache { + public static final Map uuidToName = new ConcurrentHashMap<>(); + public static final Map nameToUUID = new ConcurrentHashMap<>(); + public MongoUUIDCache() { + for(DBObject dbObject : WebServer.getInstance().getMongoManager().getCacheCollection().find()) { + UUID uuid = UUID.fromString((String) dbObject.get("_id")); + String username = (String) dbObject.get("username"); + uuidToName.put(uuid, username); + nameToUUID.put(username, uuid); + } + } + @Override + public UUID uuid(String p0) { + return nameToUUID.get(p0.toLowerCase()); + } + + @Override + public String name(UUID p0) { + return uuidToName.get(p0); + } + + @Override + public void ensure(UUID p0) { + + } + + @Override + public void update(UUID p0, String p1) { + uuidToName.put(p0, p1); + for (Map.Entry entry : new HashMap<>(nameToUUID).entrySet()) { + if (entry.getValue().equals(p0)) { + nameToUUID.remove(entry.getKey()); + } + } + + nameToUUID.put(p1.toLowerCase(), p0); + } + + @Override + public String cacheName() { + return "Mongo"; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/impl/RedisUUIDCache.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/impl/RedisUUIDCache.java new file mode 100644 index 0000000..ec15131 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/impl/RedisUUIDCache.java @@ -0,0 +1,75 @@ +package net.aeroclient.websocket.uuid.impl; + +import lombok.SneakyThrows; +import net.aeroclient.websocket.WebServer; +import net.aeroclient.websocket.uuid.redis.RedisUtil; +import net.aeroclient.websocket.uuid.UUIDCache; +import redis.clients.jedis.JedisPool; +import redis.clients.jedis.JedisPoolConfig; +import redis.clients.jedis.Protocol; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + +public class RedisUUIDCache implements UUIDCache { + private static final Map uuidToName = new ConcurrentHashMap<>(); + private static final Map nameToUUID = new ConcurrentHashMap<>(); + + @SneakyThrows + public RedisUUIDCache() { + + URI redisURI = new URI(""); + WebServer.getInstance().jedisPool = new JedisPool(new JedisPoolConfig(), + redisURI.getHost(), + redisURI.getPort(), + Protocol.DEFAULT_TIMEOUT, + redisURI.getUserInfo().split(":",2)[1], 0); // load the jedis pool on 5 for dev and 10 for master. + RedisUtil.runRedisCommand((redis) -> { + final Map cache = redis.hgetAll("WebsocketUUIDCache"); + for (Map.Entry cacheEntry : cache.entrySet()) { + final UUID uuid = UUID.fromString(cacheEntry.getKey()); + final String name = cacheEntry.getValue(); + uuidToName.put(uuid, name); + nameToUUID.put(name.toLowerCase(), uuid); + } + return null; + }); + } + + @Override + public UUID uuid(String p0) { + return nameToUUID.get(p0.toLowerCase()); + } + + @Override + public String name(UUID p0) { + return uuidToName.get(p0); + } + + @Override + public void ensure(UUID p0) { + } + + @Override + public void update(UUID p0, String p1) { + uuidToName.put(p0, p1); + for (Map.Entry entry : new HashMap<>(nameToUUID).entrySet()) { + if (entry.getValue().equals(p0)) { + nameToUUID.remove(entry.getKey()); + } + } + + nameToUUID.put(p1.toLowerCase(), p0); + RedisUtil.runRedisCommand((redis) -> { + redis.hset("WebsocketUUIDCache", p0.toString(), p1); + return null; + }); + } + @Override + public String cacheName() { + return "Redis"; + } +} diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/redis/RedisCommand.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/redis/RedisCommand.java new file mode 100644 index 0000000..365b793 --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/redis/RedisCommand.java @@ -0,0 +1,8 @@ +package net.aeroclient.websocket.uuid.redis; + +import redis.clients.jedis.Jedis; + +public interface RedisCommand { + T execute(final Jedis p0); +} + diff --git a/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/redis/RedisUtil.java b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/redis/RedisUtil.java new file mode 100644 index 0000000..14960dd --- /dev/null +++ b/Aero WebSockets/src/main/java/net/aeroclient/websocket/uuid/redis/RedisUtil.java @@ -0,0 +1,26 @@ +package net.aeroclient.websocket.uuid.redis; + +import net.aeroclient.websocket.WebServer; +import redis.clients.jedis.Jedis; + +public class RedisUtil { + public static T runRedisCommand(final RedisCommand redisCommand) { + Jedis jedis = WebServer.getInstance().getJedisPool().getResource(); + T result = null; + try { + result = redisCommand.execute(jedis); + } + catch (Exception e) { + e.printStackTrace(); + if (jedis != null) { + WebServer.getInstance().getJedisPool().returnBrokenResource(jedis); + jedis = null; + } + } finally { + if (jedis != null) { + WebServer.getInstance().getJedisPool().returnResource(jedis); + } + } + return result; + } +} diff --git a/Aero WebSockets/src/main/resources/application.conf b/Aero WebSockets/src/main/resources/application.conf new file mode 100644 index 0000000..d0ce14f --- /dev/null +++ b/Aero WebSockets/src/main/resources/application.conf @@ -0,0 +1,9 @@ +# Root logger: +logger.root=ERROR + +# Logger used by the framework: +logger.play=INFO + +# Logger provided to your application: +logger.application=DEBUG +application.langs="en" \ No newline at end of file diff --git a/Aero WebSockets/src/main/resources/log4j2.properties b/Aero WebSockets/src/main/resources/log4j2.properties new file mode 100644 index 0000000..a94d2f7 --- /dev/null +++ b/Aero WebSockets/src/main/resources/log4j2.properties @@ -0,0 +1 @@ +name=AC-WebServer diff --git a/Aero WebSockets/src/main/resources/messages_en_US.properties b/Aero WebSockets/src/main/resources/messages_en_US.properties new file mode 100644 index 0000000..afc1a3f --- /dev/null +++ b/Aero WebSockets/src/main/resources/messages_en_US.properties @@ -0,0 +1,6 @@ + + +help.usage=Usage: `help [command]` +help.help=Shows the list with commands in the bot. +help.list=List of commands +help.notFound=Nothing found for diff --git a/Aero WebSockets/src/main/resources/system.properties b/Aero WebSockets/src/main/resources/system.properties new file mode 100644 index 0000000..0b2c5e3 --- /dev/null +++ b/Aero WebSockets/src/main/resources/system.properties @@ -0,0 +1,2 @@ +java.runtime.version=1.8 +maven.version=3.3.9 diff --git a/Client-1.8.9/.gitignore b/Client-1.8.9/.gitignore new file mode 100644 index 0000000..40d9aca --- /dev/null +++ b/Client-1.8.9/.gitignore @@ -0,0 +1,2 @@ +/target +/.idea \ No newline at end of file diff --git a/Client-1.8.9/natives/CBAgent.dll b/Client-1.8.9/natives/CBAgent.dll new file mode 100644 index 0000000..21168b2 Binary files /dev/null and b/Client-1.8.9/natives/CBAgent.dll differ diff --git a/Client-1.8.9/natives/OpenAL32.dll b/Client-1.8.9/natives/OpenAL32.dll new file mode 100644 index 0000000..1f69e94 Binary files /dev/null and b/Client-1.8.9/natives/OpenAL32.dll differ diff --git a/Client-1.8.9/natives/OpenAL64.dll b/Client-1.8.9/natives/OpenAL64.dll new file mode 100644 index 0000000..6f2a2fe Binary files /dev/null and b/Client-1.8.9/natives/OpenAL64.dll differ diff --git a/Client-1.8.9/natives/avutil-ttv-51.dll b/Client-1.8.9/natives/avutil-ttv-51.dll new file mode 100644 index 0000000..fc9a3a5 Binary files /dev/null and b/Client-1.8.9/natives/avutil-ttv-51.dll differ diff --git a/Client-1.8.9/natives/graphics-hook64.dll b/Client-1.8.9/natives/graphics-hook64.dll new file mode 100644 index 0000000..f8d2122 Binary files /dev/null and b/Client-1.8.9/natives/graphics-hook64.dll differ diff --git a/Client-1.8.9/natives/jinput-dx8.dll b/Client-1.8.9/natives/jinput-dx8.dll new file mode 100644 index 0000000..bf3fe90 Binary files /dev/null and b/Client-1.8.9/natives/jinput-dx8.dll differ diff --git a/Client-1.8.9/natives/jinput-dx8_64.dll b/Client-1.8.9/natives/jinput-dx8_64.dll new file mode 100644 index 0000000..a56d9a7 Binary files /dev/null and b/Client-1.8.9/natives/jinput-dx8_64.dll differ diff --git a/Client-1.8.9/natives/jinput-raw.dll b/Client-1.8.9/natives/jinput-raw.dll new file mode 100644 index 0000000..1131d47 Binary files /dev/null and b/Client-1.8.9/natives/jinput-raw.dll differ diff --git a/Client-1.8.9/natives/jinput-raw_64.dll b/Client-1.8.9/natives/jinput-raw_64.dll new file mode 100644 index 0000000..38e1c10 Binary files /dev/null and b/Client-1.8.9/natives/jinput-raw_64.dll differ diff --git a/Client-1.8.9/natives/jinput-wintab.dll b/Client-1.8.9/natives/jinput-wintab.dll new file mode 100644 index 0000000..e075ec3 Binary files /dev/null and b/Client-1.8.9/natives/jinput-wintab.dll differ diff --git a/Client-1.8.9/natives/libmfxsw64.dll b/Client-1.8.9/natives/libmfxsw64.dll new file mode 100644 index 0000000..8314f02 Binary files /dev/null and b/Client-1.8.9/natives/libmfxsw64.dll differ diff --git a/Client-1.8.9/natives/libmp3lame-ttv.dll b/Client-1.8.9/natives/libmp3lame-ttv.dll new file mode 100644 index 0000000..803ad5a Binary files /dev/null and b/Client-1.8.9/natives/libmp3lame-ttv.dll differ diff --git a/Client-1.8.9/natives/lwjgl.dll b/Client-1.8.9/natives/lwjgl.dll new file mode 100644 index 0000000..6e9b49d Binary files /dev/null and b/Client-1.8.9/natives/lwjgl.dll differ diff --git a/Client-1.8.9/natives/lwjgl64.dll b/Client-1.8.9/natives/lwjgl64.dll new file mode 100644 index 0000000..3c9b8e9 Binary files /dev/null and b/Client-1.8.9/natives/lwjgl64.dll differ diff --git a/Client-1.8.9/natives/swresample-ttv-0.dll b/Client-1.8.9/natives/swresample-ttv-0.dll new file mode 100644 index 0000000..a7729c1 Binary files /dev/null and b/Client-1.8.9/natives/swresample-ttv-0.dll differ diff --git a/Client-1.8.9/natives/twitchsdk.dll b/Client-1.8.9/natives/twitchsdk.dll new file mode 100644 index 0000000..f21d426 Binary files /dev/null and b/Client-1.8.9/natives/twitchsdk.dll differ diff --git a/Client-1.8.9/obf/Mappings.jar b/Client-1.8.9/obf/Mappings.jar new file mode 100644 index 0000000..51b8cbe Binary files /dev/null and b/Client-1.8.9/obf/Mappings.jar differ diff --git a/Client-1.8.9/obf/Transformer.jar b/Client-1.8.9/obf/Transformer.jar new file mode 100644 index 0000000..00387d7 Binary files /dev/null and b/Client-1.8.9/obf/Transformer.jar differ diff --git a/Client-1.8.9/pom.xml b/Client-1.8.9/pom.xml new file mode 100644 index 0000000..de0f69b --- /dev/null +++ b/Client-1.8.9/pom.xml @@ -0,0 +1,306 @@ + + + 4.0.0 + com.cheatbreaker + CheatBreaker + Beta + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + 8 + 8 + + **/Start.java + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + + pl.project13.maven + git-commit-id-plugin + 2.2.4 + + + get-the-git-infos + + revision + + initialize + + + validate-the-git-infos + + validateRevision + + package + + + + true + ${project.build.outputDirectory}/assets/minecraft/client/properties/app.properties + + ^git.commit.(id.abbrev|id)$ + ^git.(branch$|build.version$) + + + + + + + + + + minecraft-repo + https://libraries.minecraft.net/ + + + central + bintray + https://jcenter.bintray.com + + + + + + + com.googlecode.soundlibs + jlayer + 1.0.1-1 + + + org.projectlombok + lombok + 1.18.12 + provided + + + net.sf.trove4j + trove4j + 3.0.1 + provided + + + oshi-project + oshi-core + 1.1 + provided + + + net.java.dev.jna + jna + 3.4.0 + provided + + + com.jagrosh + DiscordIPC + LATEST + + + net.java.dev.jna + platform + 3.4.0 + provided + + + com.ibm.icu + icu4j + 51.2 + provided + + + net.sf.jopt-simple + jopt-simple + 4.6 + provided + + + com.paulscode + codecjorbis + 20101023 + provided + + + com.paulscode + codecwav + 20101023 + provided + + + com.paulscode + libraryjavasound + 20101123 + provided + + + com.paulscode + librarylwjglopenal + 20100824 + provided + + + com.paulscode + soundsystem + 20120107 + provided + + + + io.netty + netty-all + 4.0.23.Final + + + + com.google.guava + guava + 17.0 + provided + + + org.apache.commons + commons-lang3 + 3.3.2 + provided + + + commons-io + commons-io + 2.4 + provided + + + commons-codec + commons-codec + 1.9 + provided + + + net.java.jinput + jinput + 2.0.5 + provided + + + net.java.jutils + jutils + 1.0.0 + provided + + + com.google.code.gson + gson + 2.2.4 + provided + + + org.apache.commons + commons-compress + 1.8.1 + provided + + + org.apache.httpcomponents + httpclient + 4.3.3 + provided + + + commons-logging + commons-logging + 1.1.3 + provided + + + org.apache.httpcomponents + httpcore + 4.3.2 + provided + + + org.apache.logging.log4j + log4j-api + 2.0-beta9 + provided + + + org.apache.logging.log4j + log4j-core + 2.0-beta9 + provided + + + org.lwjgl.lwjgl + lwjgl + 2.9.4-nightly-20150209 + provided + + + org.lwjgl.lwjgl + lwjgl_util + 2.9.4-nightly-20150209 + provided + + + com.mojang + authlib + 1.5.21 + provided + + + javax.vecmath + vecmath + 1.5.2 + + + + com.mojang + realms + 1.7.39 + provided + + + tv.twitch + twitch + 6.5 + provided + + + org.java-websocket + Java-WebSocket + 1.5.1 + compile + + + javazoom + jlayer + 1.0.1 + + + com.jagrosh + DiscordIPC + 0.4 + compile + + + + \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/CheatBreaker.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/CheatBreaker.java new file mode 100644 index 0000000..bc0ad19 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/CheatBreaker.java @@ -0,0 +1,485 @@ +package com.cheatbreaker.client; + +import com.cheatbreaker.client.audio.AudioManager; +import com.cheatbreaker.client.audio.music.DashManager; +import com.cheatbreaker.client.config.ConfigManager; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.cosmetic.CosmeticManager; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.event.impl.InitializationEvent; +import com.cheatbreaker.client.event.impl.network.ConnectEvent; +import com.cheatbreaker.client.event.impl.network.DisconnectEvent; +import com.cheatbreaker.client.event.impl.network.PluginMessageEvent; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.ModuleManager; +import com.cheatbreaker.client.module.command.ModuleCommandManager; +import com.cheatbreaker.client.network.plugin.CBNetHandler; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientKeySync; +import com.cheatbreaker.client.ui.UIManager; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import com.cheatbreaker.client.util.DataUtil; +import com.cheatbreaker.client.util.discord.DiscordRPCHandler; +import com.cheatbreaker.client.util.friend.FriendsManager; +import com.cheatbreaker.client.util.friend.data.Friend; +import com.cheatbreaker.client.util.json.JSONReader; +import com.cheatbreaker.client.util.manager.BranchManager; +import com.cheatbreaker.client.util.render.title.TitleManager; +import com.cheatbreaker.client.util.render.worldborder.WorldBorderManager; +import com.cheatbreaker.client.util.sessionserver.SessionServer; +import com.cheatbreaker.client.util.thread.ServerStatusThread; +import com.google.common.base.Stopwatch; +import com.google.gson.JsonParser; +import com.jagrosh.discordipc.IPCClient; +import com.jagrosh.discordipc.IPCListener; +import com.jagrosh.discordipc.entities.RichPresence; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.resources.SimpleReloadableResourceManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Session; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.sound.sampled.AudioFormat; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +@Getter +public class CheatBreaker { + @Getter private static CheatBreaker instance; + private final Minecraft mc = Minecraft.getMinecraft(); + + public static byte[] processListBytes = new byte[]{ 86, 79, 84, 69, 32, 84, 82, 85, 77, 80, 32, 50, 48, 50, 48, 33 }; + public static byte[] changelogAuthorizationBytes = new byte[]{ 104, 116, 116, 112, 115, 58, 47, 47, 99, 104, 97, 110, 103, 101, 108, 111, 103, 46, 110, 111, 120, 105, 117, 97, 109, 46, 103, 113 }; + + public static AudioFormat universalAudioFormat = new AudioFormat(8000.0f, 16, 1, true, true); + + @Setter private Friend.Status playerStatus = Friend.Status.ONLINE; + + public GuiScreen lastScreen = null; + + private IPCClient rpcClient; + + private final Map playerAvatarCache = new HashMap<>(); + + public List playerSessions = new ArrayList<>(); + public List sessionServers = new ArrayList<>(); + private final List consoleLines = new ArrayList<>(); + + private String currentServer; + private String gitCommitIdAbbrev = "?"; + private String gitBranch = "?"; + private String gitCommitId = "?"; + private String gitBuildVersion = "?"; + private final String cheatBreakerPluginMessageChannel = "CB-Client"; + private final String lunarPluginMessageChannel = "Lunar-Client"; + private final String latestLunarPluginMessageChannel = "lunarclient:pm"; + private final String pluginBinaryChannel = "CB-Binary"; + public String loggerPrefix = "[CB] "; + + public final Logger logger = LogManager.getLogger("CheatBreaker"); + + private final long startTime; + + @Setter private boolean consoleAccess; + @Setter private boolean acceptingFriendRequests = true; + @Getter private final boolean confidentialBuild = true; + public boolean hideNameTags = false; + + @Setter private WSNetHandler wsNetHandler; + private final ModuleManager moduleManager; + public ModuleCommandManager moduleCommandManager; + private final FriendsManager friendsManager; + private final DashManager dashManager; + private final TitleManager titleManager; + private final WorldBorderManager worldBorderManager; + private final ProfileHandler profileHandler; + private final UIManager uiManager; + private final CosmeticManager cosmeticManager; + private final AudioManager audioManager; + private final GlobalSettings globalSettings; + private final CBNetHandler cBNetHandler; + private final EventBus eventBus; + private final DiscordRPCHandler discordRPCHandler; + public ConfigManager configManager; + public BranchManager branchManager; + + public CBFontRenderer playBold22px; + public CBFontRenderer playRegular22px; + public CBFontRenderer ubuntuMedium16px; + public CBFontRenderer ubuntuMedium14px; + public CBFontRenderer playBold18px; + public CBFontRenderer robotoRegular24px; + public CBFontRenderer playRegular18px; + public CBFontRenderer playRegular14px; + public CBFontRenderer playRegular16px; + public CBFontRenderer robotoRegular13px; + public CBFontRenderer robotoBold14px; + public CBFontRenderer playRegular12px; + + private final ResourceLocation fontPlayRegular = new ResourceLocation("client/font/Play-Regular.ttf"); + private final ResourceLocation fontPlayBold = new ResourceLocation("client/font/Play-Bold.ttf"); + private final ResourceLocation fontRobotoRegular = new ResourceLocation("client/font/Roboto-Regular.ttf"); + private final ResourceLocation fontRobotoBold = new ResourceLocation("client/font/Roboto-Bold.ttf"); + private final ResourceLocation fontUbuntuMedium = new ResourceLocation("client/font/Ubuntu-M.ttf"); + public static ResourceLocation packIconTexture; + + /** + * Initial CheatBreaker Client Setup + */ + public CheatBreaker() throws IOException { + this.startTime = System.currentTimeMillis(); + instance = this; + + this.logger.info(this.loggerPrefix + "Starting CheatBreaker setup"); + + Stopwatch setupStopwatch = Stopwatch.createStarted(); + this.mc.cbLoadingScreen.updatePhase("CheatBreaker Setup"); + this.configManager = new ConfigManager(); + this.configManager.createDefaultConfigurationPresets(); + + this.logger.info(setupStopwatch.elapsed(TimeUnit.SECONDS) + "s : Finished setup"); + + Stopwatch settingStopwatch = Stopwatch.createStarted(); + this.mc.cbLoadingScreen.updatePhase("Settings"); + this.globalSettings = new GlobalSettings(); + this.branchManager = new BranchManager(); + + this.logger.info(settingStopwatch.elapsed(TimeUnit.SECONDS) + "s : Finished loading settings"); + + Stopwatch managerStopwatch = Stopwatch.createStarted(); + this.mc.cbLoadingScreen.updatePhase("EventBus"); + this.eventBus = new EventBus(); + + this.mc.cbLoadingScreen.updatePhase("Mods"); + this.moduleManager = new ModuleManager(this.eventBus); + this.moduleCommandManager = new ModuleCommandManager(); + + this.mc.cbLoadingScreen.updatePhase("Network Manager"); + this.cBNetHandler = new CBNetHandler(); + + this.discordRPCHandler = new DiscordRPCHandler(); + + this.mc.cbLoadingScreen.updatePhase("Emotes"); + this.cosmeticManager = new CosmeticManager(); + + this.logger.info(managerStopwatch.elapsed(TimeUnit.SECONDS) + "s : Finished loading emotes, network, mods, and events"); + + Stopwatch miscStopwatch = Stopwatch.createStarted(); + this.mc.cbLoadingScreen.updatePhase("Radio"); + this.audioManager = new AudioManager(); + this.dashManager = new DashManager(); + + this.mc.cbLoadingScreen.updatePhase("Friends"); + this.friendsManager = new FriendsManager(); + + this.mc.cbLoadingScreen.updatePhase("Titles"); + this.titleManager = new TitleManager(); + + this.logger.info(miscStopwatch.elapsed(TimeUnit.SECONDS) + "s : Finished loading radio, friends, and titles"); + + // +/* try { + ChangelogMenu.changelogObject = new JsonParser().parse(new BufferedReader(new InputStreamReader(JSONReader.readAsBrowser(new URL("https://noxiuam.gq/cheatbreaker/changelog"), true), StandardCharsets.UTF_8))).getAsJsonObject(); + } catch (Exception e) { + e.printStackTrace(); + CheatBreaker.getInstance().getLogger().error(CheatBreaker.getInstance().getLoggerPrefix() + "Failed to load changelog."); + }*/ + + this.mc.cbLoadingScreen.updatePhase("World Border"); + this.worldBorderManager = new WorldBorderManager(); + this.profileHandler = new ProfileHandler(); + this.uiManager = new UIManager(); + + this.mc.cbLoadingScreen.updatePhase("Network Events"); + this.eventBus.addEvent(DisconnectEvent.class, this.cBNetHandler::onDisconnect); + this.eventBus.addEvent(ConnectEvent.class, this.cBNetHandler::onConnect); + this.eventBus.addEvent(PluginMessageEvent.class, this.cBNetHandler::onPluginMessage); + this.logger.info(this.loggerPrefix + "Registered network events"); + + this.eventBus.addEvent(GuiDrawEvent.class, this.titleManager::onGuiDrawEvent); + this.eventBus.addEvent(TickEvent.class, this.titleManager::onTickEvent); + + SimpleReloadableResourceManager.updatepack(); + } + + /** + * Initializes everything required by the client. + */ + public void initialize() { + this.mc.cbLoadingScreen.updatePhase("Fonts"); + this.loadFonts(); + + this.mc.cbLoadingScreen.updatePhase("Configurations"); + this.configManager.loadProfiles(); + this.configManager.readCurrentProfile(); + + this.mc.cbLoadingScreen.updatePhase("Properties"); + this.loadVersionData(); + + this.mc.cbLoadingScreen.updatePhase("Session"); + this.registerSessionServers(); + + this.mc.cbLoadingScreen.updatePhase("Overlay"); + OverlayGui.setInstance(new OverlayGui()); + + try { + this.mc.cbLoadingScreen.updatePhase("Player Assets"); + this.connectToAssetServer(); + } catch (Exception ex) { + ex.printStackTrace(); + } + + this.mc.cbLoadingScreen.updatePhase("Session Server"); + Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(new ServerStatusThread(), 0L, this.globalSettings.sessionCheckInteral, TimeUnit.SECONDS); + this.logger.info(this.loggerPrefix + "Scheduled session server status updates"); + + this.mc.cbLoadingScreen.updatePhase("Finishing"); + this.getModuleManager().keystrokesMod.updateKeyElements(); + this.mc.cbLoadingScreen.addPhase(); + this.logger.info(this.loggerPrefix + "Finished startup in " + (System.currentTimeMillis() - this.startTime) + "ms!"); + consoleAccess = true; + + new Thread(() -> { + try { + while (true) { + try { + if (this.wsNetHandler != null) { + this.wsNetHandler.sendPacket(new WSPacketClientKeySync()); + } + } catch (Exception e) { + e.printStackTrace(); + } + Thread.sleep(30000L); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + }).start(); + + if (System.getProperty("os.name").toLowerCase().contains("win") && this.getGlobalSettings().showRPC.getBooleanValue()) { + this.mc.cbLoadingScreen.addPhase(); + this.connectDiscordIPC(); + } + + this.mc.cbLoadingScreen.addPhase(); + eventBus.handleEvent(new InitializationEvent()); + } + + /** + * Updates the Discord RPC with the current server the player is on. + */ + public void updateServerInfo(String server) { + if (this.getGlobalSettings().showServer.getBooleanValue()) { + this.updateRPC(this.discordRPCHandler.getRPCInfo(this.currentServer)[3] != null + ? this.discordRPCHandler.getRPCInfo(this.currentServer)[3] : server, + this.discordRPCHandler.getRPCInfo(this.currentServer)); + } else { + this.updateRPC(server, new String[]{"Minecraft " + Config.MC_VERSION, "cb", "Minecraft " + Config.MC_VERSION}); + } + } + + /** + * Sends the current server you're on to the player asset server. + */ + public void syncCurrentServerWithAssetServer(String server, String ip, int port) { + if (this.wsNetHandler == null) return; + + try { + this.currentServer = server; + if (this.getGlobalSettings().showAccount.getBooleanValue()) { + this.updateServerInfo(this.mc.getSession().getUsername()); + } else { + this.updateServerInfo(null); + } + } catch (Exception | UnsatisfiedLinkError ignore) {} + + boolean equals = server.equals(ip + ":" + port); + if (!equals) { + this.wsNetHandler.sendUpdateServer(server); + this.currentServer = (server.isEmpty() ? "In-Menus" : server); + } else { + this.wsNetHandler.sendUpdateServer("server"); + this.currentServer = "server"; + } + } + + /** + * Gets the player's current friends list status. + */ + public String getStatusString() { + switch (this.playerStatus) { + case AWAY: + return "Away"; + case BUSY: + return "Busy"; + case OFFLINE: + return "Offline"; + default: + return "Online"; + } + } + + /** + * Attempts to form a connection between the player asset server and the client. + * This server is mainly used for cosmetics and possible anticheat related things. + */ + public void connectToAssetServer() throws URISyntaxException { + this.logger.info(this.loggerPrefix + "Attempting to connect to player assets server"); + HashMap reqs = new HashMap<>(); + + reqs.put("username", this.mc.getSession().getUsername()); + reqs.put("playerId", CheatBreaker.getInstance().getProfileHandler().recompileUUID(this.mc.getSession().getPlayerID())); + reqs.put("HWID", DataUtil.getHWID()); + reqs.put("version", Config.MC_VERSION); + reqs.put("gitCommit", this.getGitCommitId()); + reqs.put("branch", this.getGitBranch()); + reqs.put("buildType", this.getGitBuildVersion()); + + if (this.currentServer != null) { + reqs.put("server", this.currentServer); + } + + this.wsNetHandler = new WSNetHandler(new URI("https://127.0.0.1:6788"), reqs); + this.wsNetHandler.connect(); + } + + /** + * Loads the current version data + */ + private void loadVersionData() { + try { + ResourceLocation propertiesFile = new ResourceLocation("client/properties/app.properties"); + Properties property = new Properties(); + InputStream fileInputStream = this.mc.getResourceManager().getResource(propertiesFile).getInputStream(); + + if (fileInputStream == null) return; + + property.load(fileInputStream); + fileInputStream.close(); + + this.gitCommitIdAbbrev = property.getProperty("git.commit.id.abbrev"); + this.gitCommitId = property.getProperty("git.commit.id"); + this.gitBranch = property.getProperty("git.branch"); + this.gitBuildVersion = property.getProperty("git.build.version"); + this.branchManager.setCurrentBranch(BranchManager.Branch.getBranchByName(this.gitBranch)); + this.logger.info(this.loggerPrefix + "Loaded client properties"); + } catch (IOException var4) { + var4.printStackTrace(); + this.branchManager.setCurrentBranch(BranchManager.Branch.DEVELOPMENT); + this.logger.error(this.loggerPrefix + "An error occurred when loading client properties"); + } + } + + /** + * Registers the session servers for periodic checking. + */ + private void registerSessionServers() { + this.sessionServers.add(new SessionServer("Session", "session.minecraft.net")); + this.sessionServers.add(new SessionServer("Login", "authserver.mojang.com")); + this.sessionServers.add(new SessionServer("Account", "account.mojang.com")); + this.sessionServers.add(new SessionServer("API", "api.mojang.com")); + this.logger.info(this.loggerPrefix + "Loaded mojang session status entries"); + } + + /** + * Returns the scale factor for module scaling. + */ + public static float getScaleFactor() { + ScaledResolution var4 = new ScaledResolution(Minecraft.getMinecraft()); + if (getInstance().getGlobalSettings().scaleModsDownSmallerResoltion.getBooleanValue()) { + switch (Minecraft.getMinecraft().gameSettings.guiScale) { + case 0: return 2.0f; + case 1: return 0.5f; + case 2: return 1.0f; + case 3: return 1.5f; + } + return 1.0f; + } else { + return var4.getScaleFactor() / 2.0F; + } + } + + /** + * Loads the CheatBreaker fonts for rendering. + */ + private void loadFonts() { + this.playBold22px = new CBFontRenderer(this.fontPlayBold, 22.0f); + this.playRegular22px = new CBFontRenderer(this.fontPlayRegular, 22.0f); + this.playRegular18px = new CBFontRenderer(this.fontPlayRegular, 18.0f); + this.playRegular14px = new CBFontRenderer(this.fontPlayRegular, 14.0f); + this.playRegular12px = new CBFontRenderer(this.fontPlayRegular, 12.0f); + this.playRegular16px = new CBFontRenderer(this.fontPlayRegular, 16.0f); + this.playBold18px = new CBFontRenderer(this.fontPlayBold, 18.0f); + this.ubuntuMedium16px = new CBFontRenderer(fontUbuntuMedium, 16.0f); + this.ubuntuMedium14px = new CBFontRenderer(fontUbuntuMedium, 14.0f); + this.robotoRegular13px = new CBFontRenderer(this.fontRobotoRegular, 13.0f); + this.robotoBold14px = new CBFontRenderer(this.fontRobotoBold, 14.0f); + this.robotoRegular24px = new CBFontRenderer(this.fontRobotoRegular, 24.0f); + this.logger.info(this.loggerPrefix + "Loaded all fonts"); + } + + /** + * Returns the ResourceLocation of the player avatar for the account switcher. + */ + public ResourceLocation getHeadIcon(String name) { + ResourceLocation var3 = this.playerAvatarCache.getOrDefault(name, new ResourceLocation("client/heads/" + name + ".png")); + if (!this.playerAvatarCache.containsKey(name)) { + ThreadDownloadImageData var4 = new ThreadDownloadImageData(null, "https://minotar.net/helm/" + name + "/32.png", new ResourceLocation("client/defaults/steve.png"), null); + this.mc.renderEngine.loadTexture(var3, var4); + this.playerAvatarCache.put(name, var3); + } + return var3; + } + + /** + * Creates a new IPC Client for Discord RPC usage. + */ + public void connectDiscordIPC() { + try { + (this.rpcClient = new IPCClient(925912458353340447L)).setListener(new IPCListener() { + @Override + public void onReady(IPCClient client) { + CheatBreaker.getInstance().updateRPC(Minecraft.getMinecraft().getSession().getUsername(), CheatBreaker.getInstance().discordRPCHandler.getRPCInfo(CheatBreaker.getInstance().getCurrentServer())); + } + }); + this.rpcClient.connect(); + this.logger.info(this.loggerPrefix + "Connected to Discord IPC"); + } catch (Exception e) { + this.logger.error(this.loggerPrefix + "Failed to connect to Discord IPC"); + } + } + + /** + * Updates the Discord RPC. + */ + public void updateRPC(String state, String[] serverName) { + try { + if (this.rpcClient != null) { + RichPresence.Builder var8 = new RichPresence.Builder(); + var8.setState(state).setDetails(serverName[2]).setStartTimestamp(OffsetDateTime.now()).setLargeImage(serverName[1], serverName[0]); + this.rpcClient.sendRichPresence(var8.build()); + } + } catch (Exception ignore) { + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/AudioManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/AudioManager.java new file mode 100644 index 0000000..5d205fa --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/AudioManager.java @@ -0,0 +1,72 @@ +package com.cheatbreaker.client.audio; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.messages.Message; +import lombok.Getter; +import net.minecraft.client.Minecraft; + +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Line; +import javax.sound.sampled.Mixer; +import javax.sound.sampled.TargetDataLine; +import java.util.ArrayList; +import java.util.List; + +/** + * Manages anything related to the CheatBreaker Client's audio. + */ +@Getter +public class AudioManager { + + private final List microphones = new ArrayList<>(); + + public void playSound(String name) { + this.playSoundVol(name, 1.0f); + } + + public void playSoundVol(String name, float volume) { + if (!(Boolean) CheatBreaker.getInstance().getGlobalSettings().muteCBSounds.getValue()) + Minecraft.getMinecraft().getSoundHandler().sndManager.playSound(name, volume); + } + + /** + * Registers the current system enabled Microphones for Voice Chat. + */ + private void registerSystemMicrophones() { + Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo(); + for (Mixer.Info micInfo : mixerInfos) { + Line.Info[] micLine = AudioSystem.getMixer(micInfo).getTargetLineInfo(); + + if (micLine.length >= 1 && micLine[0].getLineClass().equals(TargetDataLine.class)) { + if (micInfo == null) continue; + Message.g(new String[]{micInfo.getDescription()}, new String[]{micInfo.getName()}); + } + } + } + + /** + * Returns all registered Microphones in the form of a String Array. + */ + public String[] getMicrophoneArray() { + String[] microphones = new String[this.microphones.size()]; + int index = 0; + for (Microphone microphone : this.microphones) { + microphones[index] = microphone.getName().replace("Primary Sound Capture Driver", "Default"); + ++index; + } + return microphones; + } + + /** + * Returns a given Microphone based on its name. + */ + public Microphone getMicrophone(String name) { + for (Microphone mic : this.microphones) { + if (mic.getName().equalsIgnoreCase(name)) { + return mic; + } + } + return null; + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/Microphone.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/Microphone.java new file mode 100644 index 0000000..1361be4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/Microphone.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.audio; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * Defines the Microphone Object used for CheatBreaker Voice Chat. + */ +@Getter @AllArgsConstructor +public class Microphone { + private final String description; + private final String name; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/DashManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/DashManager.java new file mode 100644 index 0000000..57ace08 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/DashManager.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.audio.music; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.audio.music.threads.DashQueueThread; +import com.cheatbreaker.client.audio.music.threads.DashThread; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** + * Manages anything to do with the in-game dash music player. + */ +@Getter +public class DashManager { + private final List stations = DashUtil.dashHelpers(); + private final DashQueueThread dashQueueThread = new DashQueueThread(); + private final DashThread dashThread; + @Setter private Station currentStation; + + public DashManager() { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created Dash Manager"); + + this.dashQueueThread.start(); + this.dashThread = new DashThread(); + this.dashThread.start(); + if (this.stations.size() > 0) { + this.currentStation = this.stations.get(0); + this.dashQueueThread.offerStation(this.currentStation); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/audio/DashAudioDevice.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/audio/DashAudioDevice.java new file mode 100644 index 0000000..e2ca0ab --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/audio/DashAudioDevice.java @@ -0,0 +1,135 @@ +package com.cheatbreaker.client.audio.music.audio; + +import com.cheatbreaker.client.CheatBreaker; +import javazoom.jl.decoder.Decoder; +import javazoom.jl.decoder.JavaLayerException; +import javazoom.jl.player.AudioDeviceBase; + +import javax.sound.sampled.*; + +/** + * Defines the Music Player's Audio Device. + */ +public class DashAudioDevice extends AudioDeviceBase { + private SourceDataLine sourceDataLine = null; + private AudioFormat audioFormat = null; + private byte[] byteArray = new byte[4096]; + + protected void setAudioFormat(AudioFormat audioFormat) { + this.audioFormat = audioFormat; + } + + protected AudioFormat getAudioFormat() { + if (this.audioFormat == null) { + Decoder decoder = this.getDecoder(); + this.audioFormat = new AudioFormat(decoder.getOutputFrequency(), 16, decoder.getOutputChannels(), true, false); + } + return this.audioFormat; + } + + protected DataLine.Info getInfo() { + AudioFormat format = this.getAudioFormat(); + return new DataLine.Info(SourceDataLine.class, format); + } + + public void open(AudioFormat var1) { + if (!this.isOpen()) { + this.setAudioFormat(var1); + this.openImpl(); + this.setOpen(true); + } + } + + @Override + protected void openImpl() { + } + + protected void start() throws JavaLayerException { + Throwable throwable = null; + try { + Line line = AudioSystem.getLine(this.getInfo()); + if (line instanceof SourceDataLine) { + this.sourceDataLine = (SourceDataLine) line; + this.sourceDataLine.open(this.audioFormat); + this.sourceDataLine.start(); + this.setFloatControlValue((float) CheatBreaker.getInstance().getGlobalSettings().radioVolume.getValue()); + } + } catch (RuntimeException | LineUnavailableException | LinkageError var3) { + throwable = var3; + } + if (this.sourceDataLine == null) { + throw new JavaLayerException("cannot obtain source audio line", throwable); + } + } + + @Override + protected void closeImpl() { + if (this.sourceDataLine != null) { + this.sourceDataLine.close(); + } + } + + @Override + protected void writeImpl(short[] var1, int var2, int var3) throws JavaLayerException { + if (this.sourceDataLine == null) { + this.start(); + } + byte[] var4 = this.toByteArray(var1, var2, var3); + this.sourceDataLine.write(var4, 0, var3 * 2); + } + + protected byte[] getByteArray(int var1) { + if (this.byteArray.length < var1) { + this.byteArray = new byte[var1 + 1024]; + } + return this.byteArray; + } + + protected byte[] toByteArray(short[] var1, int var2, int var3) { + byte[] var4 = this.getByteArray(var3 * 2); + int var6 = 0; + while (var3-- > 0) { + short var5 = var1[var2++]; + var4[var6++] = (byte) var5; + var4[var6++] = (byte) (var5 >>> 8); + } + return var4; + } + + @Override + protected void flushImpl() { + if (this.sourceDataLine != null) { + this.sourceDataLine.drain(); + } + } + + @Override + public int getPosition() { + int var1 = 0; + if (this.sourceDataLine != null) { + var1 = (int) (this.sourceDataLine.getMicrosecondPosition() / 1000L); + } + return var1; + } + + public void test() throws JavaLayerException { + try { + this.open(new AudioFormat(22050.0f, 16, 1, true, false)); + short[] var1 = new short[2205]; + this.write(var1, 0, var1.length); + this.flush(); + this.close(); + } catch (RuntimeException var2) { + throw new JavaLayerException("Device test failed: " + var2); + } + } + + public void setFloatControlValue(float value) { + if (this.sourceDataLine != null) { + FloatControl control = (FloatControl) this.sourceDataLine.getControl(FloatControl.Type.MASTER_GAIN); + float var3 = control.getMaximum() - control.getMinimum(); + float volume = var3 * (value / 100.0f) + control.getMinimum(); + control.setValue(volume); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/audio/DashHook.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/audio/DashHook.java new file mode 100644 index 0000000..54c902e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/audio/DashHook.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.audio.music.audio; + +import com.cheatbreaker.client.network.agent.AgentResources; +import javazoom.jl.decoder.JavaLayerHook; +import javazoom.jl.decoder.JavaLayerUtils; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +/** + * Defines a hook for the Music Player. + */ +public class DashHook implements JavaLayerHook { + @Override + public InputStream getResourceAsStream(String string) { + Class class_ = JavaLayerUtils.class; + InputStream inputStream = class_.getResourceAsStream(string); + + if (inputStream == null) { + String string2 = "javazoom/jl/decoder/" + string; + System.out.println("Retrieving: " + string2); + if (AgentResources.existsBytes(string2)) { + inputStream = new ByteArrayInputStream(AgentResources.getBytesNative(string2)); + } + } + + return inputStream; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/data/Station.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/data/Station.java new file mode 100644 index 0000000..c8fabeb --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/data/Station.java @@ -0,0 +1,114 @@ +package com.cheatbreaker.client.audio.music.data; + +import com.cheatbreaker.client.audio.music.util.DashUtil; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import net.minecraft.util.ResourceLocation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import javax.xml.parsers.DocumentBuilderFactory; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; +import java.util.TimeZone; + +@Getter @Setter +@RequiredArgsConstructor +public class Station { + private final String name; + private final String logoURL; + private final String genre; + private final String currentSongURL; + private final String streamURL; + + private String title; + private String artist; + private String album; + private String coverURL = ""; + + private boolean favourite; + public boolean play; + + private LocalDateTime startTime; + + private int duration; + + public ResourceLocation currentResource; + public ResourceLocation previousResource; + + /** + * Ends the stream. + */ + public void endStream() { + DashUtil.end(DashUtil.get(this.streamURL)); + } + + /** + * Gets the music player's music list data. + */ + public void getData() { + try { + Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(this.getCurrentSongURL()); + NodeList nodeList = document.getElementsByTagName("playlist"); + + for (int i = 0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + Element element = (Element) node; + + this.setTitle(this.getElement(element, "title")); + this.setArtist(this.getElement(element, "artist")); + this.setAlbum(this.getElement(element, "album")); + this.setCoverURL(this.getElement(element, "cover")); + this.setDuration(Integer.parseInt(this.getElement(element, "duration"))); + + String programStartTS = this.getElement(element, "programStartTS"); + String dateFormat = "dd MMM yy hh:mm:ss"; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + + if (this.currentResource != null && !("client/songs/" + this.getTitle()).equals(this.currentResource.getResourcePath())) { + this.previousResource = this.currentResource; + this.currentResource = null; + } + + try { + Date date = simpleDateFormat.parse(programStartTS); + this.setStartTime(LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault())); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + } catch (Exception exception) { + exception.printStackTrace(); + } + + if (this.play) { + this.play = false; + this.endStream(); + } + } + + /** + * Retrieves the element. + */ + private String getElement(Element element, String string) { + try { + NodeList nodeList = element.getElementsByTagName(string); + Element element2 = (Element) nodeList.item(0); + + return element2.getChildNodes().item(0).getNodeValue().trim(); + } catch (Exception exception) { + return ""; + } + } + + public String toString() { + return "Station(streamUrl=" + this.getStreamURL() + ", currentSongUrl=" + this.getCurrentSongURL() + ", genre=" + this.getGenre() + ", logoUrl=" + this.getLogoURL() + ", name=" + this.getName() + ", favorite=" + this.isFavourite() + ", startTime=" + this.getStartTime() + ", title=" + this.getTitle() + ", artist=" + this.getArtist() + ", album=" + this.getAlbum() + ", coverUrl=" + this.getCoverURL() + ", duration=" + this.getDuration() + ", RESOURCE_CURRENT=" + this.getCurrentResource() + ", RESOURCE_PREVIOUS=" + this.getPreviousResource() + ", play=" + this.isPlay() + ")"; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioElement.java new file mode 100644 index 0000000..f5d478d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioElement.java @@ -0,0 +1,265 @@ +package com.cheatbreaker.client.audio.music.elements; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.ui.element.DraggableElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.HorizontalSliderElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class RadioElement extends DraggableElement { + private final ResourceLocation dashIcon = new ResourceLocation("client/dash-logo-54.png"); + private final ResourceLocation playIcon = new ResourceLocation("client/icons/play-24.png"); + private final List radioStationElements = new ArrayList<>(); + private final MinMaxFade fadeTime = new MinMaxFade(300L); + + private float newHeight; + + private boolean isFading; + + private final HorizontalSliderElement volumeSlider; + private final ScrollableElement scrollbar; + private final InputFieldElement filterTextField; + private final FlatButtonElement pinButton; + + public RadioElement() { + this.volumeSlider = new HorizontalSliderElement(CheatBreaker.getInstance().getGlobalSettings().radioVolume); + this.scrollbar = new ScrollableElement(this); + this.filterTextField = new InputFieldElement(this.cb.playRegular14px, "Filter", -11842741, -11842741); + this.pinButton = new FlatButtonElement((Boolean) this.cb.getGlobalSettings().pinRadio.getValue() ? "Unpin" : "Pin"); + + for (Station station : CheatBreaker.getInstance().getDashManager().getStations()) { + this.radioStationElements.add(new RadioStationElement(this, station)); + } + + } + + /** + * Updates the element size. + */ + public void updateElementSize() { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + /** + * Handles the Mouse Clicked event. + */ + private boolean handleElementMouseClicked(RadioStationElement radioStationElement) { + return this.filterTextField.getText().equals("") || radioStationElement.getStation().getName().toLowerCase().startsWith(this.filterTextField.getText().toLowerCase()) || radioStationElement.getStation().getGenre().toLowerCase().startsWith(this.filterTextField.getText().toLowerCase()); + } + + /** + * Sets the element size. + */ + public void setElementSize(float x, float y, float width, float height) { + super.setElementSize(x, y, width, height); + if (this.newHeight == 0.0f) { + this.newHeight = height; + } + + this.radioStationElements.sort((var0, var1x) -> { + if (var0.getStation().isFavourite() && !var1x.getStation().isFavourite()) { + return -1; + } else { + return !var0.getStation().isFavourite() && var1x.getStation().isFavourite() ? 1 : 0; + } + }); + this.volumeSlider.setElementSize(x, y + this.newHeight, width, 8.0F); + this.filterTextField.setElementSize(x, y + this.newHeight + 8.0F, width - 30.0F, 13.0F); + this.pinButton.setElementSize(x + width - 30.0F, y + this.newHeight + 8.0F, 30.0F, 13.0F); + this.scrollbar.setElementSize(x + width - 5.0F, y + this.newHeight + 21.0F, 5.0F, 99.0F); + int var5 = 0; + boolean var6 = true; + + for (RadioStationElement station : this.radioStationElements) { + if (this.handleElementMouseClicked(station)) { + float var9 = y + 21.0F + this.newHeight + (float) var5; + station.setElementSize(x, var9, width - 5.0F, 20.0F); + var5 += 20; + } + } + + this.scrollbar.setScrollAmount((float) var5); + } + + /** + * Draws the entire element. + */ + protected void handleElementDraw(float var1, float var2, boolean var3) { + this.onDrag(var1, var2); + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.newHeight, -14540254); + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.newHeight, this.yPosition + this.newHeight, -1); + Station currentStation = CheatBreaker.getInstance().getDashManager().getCurrentStation(); + if (currentStation != null) { + if (currentStation.currentResource == null && !currentStation.getCoverURL().equals("")) { + if (currentStation.previousResource != null) { + this.mc.getTextureManager().deleteTexture(currentStation.previousResource); + currentStation.previousResource = null; + } + + currentStation.currentResource = new ResourceLocation("client/songs/" + currentStation.getTitle()); + ThreadDownloadImageData var6 = new ThreadDownloadImageData(null, currentStation.getCoverURL(), this.dashIcon, null); + Minecraft.getMinecraft().renderEngine.loadTexture(currentStation.currentResource, var6); + } + + ResourceLocation var5 = currentStation.currentResource == null ? this.dashIcon : currentStation.currentResource; + RenderUtil.renderIcon(var5, this.newHeight / 2.0F, this.xPosition, this.yPosition); + float var10 = this.xPosition + 50.0F; + if (this.mc.currentScreen != OverlayGui.getInstance()) { + var10 = this.xPosition + 34.0F; + } else { + boolean var7 = this.isMouseInside(var1, var2) && var1 > this.xPosition + 34.0F && var1 < this.xPosition + 44.0F && var2 < this.yPosition + this.newHeight; + if (!DashUtil.isActive()) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, var7 ? 1.0F : 0.29885057F * 2.6769233F); + RenderUtil.renderIcon(this.playIcon, 6.0F, this.xPosition + 34.0F, this.yPosition + 6.9339623F * 1.0816326F); + } else { + Gui.drawRect(this.xPosition + 36.0F, this.yPosition + 9.0F, this.xPosition + 38.0F, this.yPosition + this.newHeight - 11.0F, var7 ? -1 : -1342177281); + Gui.drawRect(this.xPosition + 40.0F, this.yPosition + 9.0F, this.xPosition + 42.0F, this.yPosition + this.newHeight - 11.0F, var7 ? -1 : -1342177281); + } + } + + String var11 = currentStation.getTitle(); + float var10003; + if ((float) CheatBreaker.getInstance().playRegular16px.getStringWidth(var11) > this.width - 52.0F) { + var10003 = this.yPosition + 4.0F; + CheatBreaker.getInstance().playRegular12px.drawString(var11, var10, var10003, -1); + } else { + var10003 = this.yPosition + 4.0F; + CheatBreaker.getInstance().playRegular16px.drawString(var11, var10, var10003, -1); + } + + CheatBreaker.getInstance().playRegular12px.drawString(currentStation.getArtist(), var10, this.yPosition + 14.0F, -1342177281); + } + + float var9 = this.fadeTime.inOutFade(this.isMouseInside(var1, var2) && var3); + if (this.fadeTime.isZeroOrLess()) { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.newHeight + 120.0F * var9); + this.isFading = true; + } else if (!this.fadeTime.isZeroOrLess() && !this.isMouseInside(var1, var2)) { + this.isFading = false; + } + + if (this.isFading) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui var13 = OverlayGui.getInstance(); + RenderUtil.startScissorBox((int) this.xPosition, (int) (this.yPosition + this.newHeight), (int) (this.xPosition + this.width), (int) (this.yPosition + this.newHeight + (this.height - this.newHeight) * var9), (float) ((int) ((float) var13.getScaledResolution().getScaleFactor() * var13.getScaleFactor())), (int) var13.getScaledHeight()); + Gui.drawRect(this.xPosition, this.yPosition + this.newHeight, this.xPosition + this.width, this.yPosition + this.height, -14540254); + this.scrollbar.drawScrollable(var1, var2, var3); + Iterator var12 = this.radioStationElements.iterator(); + + while (true) { + RadioStationElement var8; + do { + if (!var12.hasNext()) { + this.scrollbar.handleElementDraw(var1, var2, var3); + this.volumeSlider.drawElementHover(var1, var2, var3); + this.filterTextField.handleElementDraw(var1, var2, var3); + this.pinButton.handleElementDraw(var1, var2, var3); + GL11.glDisable(3089); + GL11.glPopMatrix(); + return; + } + + var8 = var12.next(); + } while (!this.handleElementMouseClicked(var8)); + + var8.handleElementDraw(var1, var2 - this.scrollbar.getPosition(), var3 && !this.scrollbar.isButtonHeld() && !this.scrollbar.isMouseInside(var1, var2)); + } + } + } + + public void handleElementMouse() { + this.scrollbar.handleElementMouse(); + } + + public void handleElementUpdate() { + this.filterTextField.handleElementUpdate(); + this.pinButton.handleElementUpdate(); + } + + public void handleElementClose() { + this.filterTextField.handleElementClose(); + this.pinButton.handleElementClose(); + } + + public void keyTyped(char var1, int var2) { + this.filterTextField.keyTyped(var1, var2); + this.pinButton.keyTyped(var1, var2); + this.scrollbar.keyTyped(var1, var2); + if (this.filterTextField.isFocused()) { + this.updateElementSize(); + } + + } + + public boolean onMouseClick(float var1, float var2, int var3) { + if (!this.filterTextField.isMouseInside(var1, var2) && this.filterTextField.isFocused()) { + this.filterTextField.setFocused(false); + } + + return false; + } + + public boolean handleElementMouseClicked(float var1, float var2, int var3, boolean var4) { + this.filterTextField.handleElementMouseClicked(var1, var2, var3, var4); + if (this.filterTextField.isFocused() && var3 == 1 && this.filterTextField.getText().equals("")) { + this.updateElementSize(); + } + + if (!var4) { + return false; + } else { + boolean var5 = this.isMouseInside(var1, var2) && var1 > this.xPosition + 34.0F && var1 < this.xPosition + 44.0F && var2 < this.yPosition + this.newHeight; + if (var5) { + if (!DashUtil.isActive()) { + CheatBreaker.getInstance().getDashManager().getCurrentStation().endStream(); + } else { + DashUtil.end(); + } + } + + float var6 = this.fadeTime.inOutFade(this.isMouseInside(var1, var2) && var4); + if (this.fadeTime.isHovered()) { + this.volumeSlider.handleElementMouseClicked(var1, var2, var3, var4); + this.scrollbar.handleElementMouseClicked(var1, var2, var3, var4); + this.filterTextField.handleElementMouseClicked(var1, var2, var3, var4); + this.pinButton.handleElementMouseClicked(var1, var2, var3, var4); + boolean var7 = var1 > (float) ((int) this.xPosition) && var1 < (float) ((int) (this.xPosition + this.width)) && var2 > (float) ((int) (this.yPosition + this.newHeight + 21.0F)) && var2 < (float) ((int) (this.yPosition + this.newHeight + 21.0F + (this.height - this.newHeight - 21.0F) * var6)); + if (var7) { + for (RadioStationElement var9 : this.radioStationElements) { + if (this.handleElementMouseClicked(var9) && var9.handleElementMouseClicked(var1, var2 - this.scrollbar.getPosition(), var3, var4)) { + break; + } + } + } + + if (this.pinButton.isMouseInside(var1, var2)) { + this.cb.getGlobalSettings().pinRadio.setValue(!(Boolean) this.cb.getGlobalSettings().pinRadio.getValue()); + this.pinButton.setText((Boolean) this.cb.getGlobalSettings().pinRadio.getValue() ? "Unpin" : "Pin"); + } + } + + if (this.isMouseInside(var1, var2) && var2 < this.yPosition + this.newHeight && !var5 && !this.volumeSlider.isMouseInside(var1, var2) && !this.scrollbar.isMouseInside(var1, var2)) { + this.setPosition(var1, var2); + } + + return super.handleElementMouseClicked(var1, var2, var3, var4); + } + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioStationElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioStationElement.java new file mode 100644 index 0000000..e4a8601 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioStationElement.java @@ -0,0 +1,66 @@ +package com.cheatbreaker.client.audio.music.elements; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@RequiredArgsConstructor +public class RadioStationElement extends AbstractElement { + private final RadioElement parent; + @Getter private final Station station; + + // KEEP THESE UNFINALIZED. + private ResourceLocation starIcon = new ResourceLocation("client/icons/star-21.png"); + private ResourceLocation starFilledIcon = new ResourceLocation("client/icons/star-filled-21.png"); + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + if (this.isMouseInsideElement(f, f2) && bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + 22.0f, this.yPosition + this.height, -13158601); + } else if (this.isMouseInside(f, f2) && bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + } + boolean favorite = this.station.isFavourite(); + if (favorite) { + GL11.glColor4f(1.1833333f * 0.8028169f, 0.75956047f * 0.9479167f, 0.14558825f * 1.030303f, 1.0f); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + boolean active = CheatBreaker.getInstance().getDashManager().getCurrentStation() == this.station; + RenderUtil.renderIcon(favorite ? this.starFilledIcon : this.starIcon, 5.0f, this.xPosition + 6.0f, this.yPosition + 5.0f); + CheatBreaker.getInstance().playRegular14px.drawString(this.station.getName(), this.xPosition + 24.0f, this.yPosition + 0.627451f * 2.390625f, active ? -13369549 : -1); + CheatBreaker.getInstance().playRegular14px.drawString(this.station.getGenre(), this.xPosition + 24.0f, this.yPosition + 2.375f * 4.0f, -1342177281); + } + + private boolean isMouseInsideElement(float f, float f2) { + return this.isMouseInside(f, f2) && f < this.xPosition + 22.0f; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + if (this.isMouseInsideElement(f, f2) && bl) { + this.station.setFavourite(!this.station.isFavourite()); + this.parent.updateElementSize(); + return true; + } + if (this.isMouseInside(f, f2) && bl) { + if (DashUtil.isActive()) { + DashUtil.end(); + } + this.station.play = true; + CheatBreaker.getInstance().getDashManager().getDashQueueThread().offerStation(this.station); + CheatBreaker.getInstance().getDashManager().setCurrentStation(this.station); + } + return false; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/threads/DashQueueThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/threads/DashQueueThread.java new file mode 100644 index 0000000..d2614f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/threads/DashQueueThread.java @@ -0,0 +1,41 @@ +package com.cheatbreaker.client.audio.music.threads; + + +import com.cheatbreaker.client.audio.music.data.Station; +import net.minecraft.client.Minecraft; + +import java.util.LinkedList; +import java.util.Queue; + +/** + * Used for queuing songs. + */ +public class DashQueueThread extends Thread { + private final Queue queueList = new LinkedList<>(); + + public void run() { + try { + while (true) { + synchronized (this.queueList) { + this.queueList.wait(); + Station var2 = this.queueList.poll(); + if (var2 != null) { + var2.getData(); + } + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + /** + * Offers a song to the queue. + */ + public void offerStation(Station station) { + synchronized (this.queueList) { + this.queueList.offer(station); + this.queueList.notify(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/threads/DashThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/threads/DashThread.java new file mode 100644 index 0000000..c8ea9c7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/threads/DashThread.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.audio.music.threads; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.data.Station; + +import java.time.Duration; +import java.time.LocalDateTime; + +public class DashThread extends Thread { + @Override + public void run() { + while (true) { + try { + while (true) { + Station station; + if ((station = CheatBreaker.getInstance().getDashManager().getCurrentStation()) != null && station.getStartTime() != null && Duration.between(station.getStartTime(), LocalDateTime.now()).toMillis() / 1000L >= (long) (station.getDuration() + 2)) { + station.getData(); + Thread.sleep(4000L); + } + Thread.sleep(1000L); + } + + } catch (Exception exception) { + exception.printStackTrace(); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/util/DashUtil.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/util/DashUtil.java new file mode 100644 index 0000000..5193051 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/audio/music/util/DashUtil.java @@ -0,0 +1,100 @@ +package com.cheatbreaker.client.audio.music.util; + +import com.cheatbreaker.client.audio.music.audio.DashAudioDevice; +import com.cheatbreaker.client.audio.music.audio.DashHook; +import com.cheatbreaker.client.audio.music.data.Station; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import javazoom.jl.decoder.JavaLayerUtils; +import javazoom.jl.player.Player; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.ArrayList; +import java.util.List; + +public class DashUtil { + private static final String dashApiStations = "https://dash-api.com/api/v3/allData.php"; + private static Player player; + private static boolean playing; + private static DashAudioDevice dashPlayer = new DashAudioDevice(); + + public static List dashHelpers() { + JavaLayerUtils.setHook(new DashHook()); + ArrayList arrayList = new ArrayList<>(); + try { + JsonObject jsonObject = new JsonParser().parse(DashUtil.get(dashApiStations)).getAsJsonObject(); + if (jsonObject.has("stations")) { + JsonArray jsonArray = jsonObject.getAsJsonArray("stations"); + for (JsonElement array : jsonArray) { + JsonObject object = array.getAsJsonObject(); + String name = object.get("name").getAsString(); + String genre = object.get("genre").getAsString(); + String square_logo_url = object.get("square_logo_url").getAsString(); + String current_song_url = object.get("current_song_url").getAsString(); + String stream_url = object.get("stream_url").getAsString(); + Station station = new Station(name, square_logo_url, genre, current_song_url, stream_url); + arrayList.add(station); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + return arrayList; + } + + public static String get(String string) { + try { + URLConnection uRLConnection = new URL(string).openConnection(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream())); + return bufferedReader.readLine(); + } catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + public static void end() { + if (player != null) { + player.close(); + player = null; + } + playing = false; + } + + public static boolean isActive() { + return player != null; + } + + public static void end(String string) { + if (playing) { + return; + } + playing = true; + if (player != null) { + player.close(); + player = null; + return; + } + new Thread(() -> { + try { + URL uRL = new URL(string); + InputStream inputStream = uRL.openStream(); + dashPlayer = new DashAudioDevice(); + player = new Player(inputStream, dashPlayer); + player.play(); + } catch (Exception exception) { + exception.printStackTrace(); + } + }).start(); + } + + public static DashAudioDevice getPlayer() { + return dashPlayer; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/ConfigManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/ConfigManager.java new file mode 100644 index 0000000..a1ab2d1 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/ConfigManager.java @@ -0,0 +1,744 @@ +package com.cheatbreaker.client.config; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.ui.element.profile.ProfilesListElement; +import com.cheatbreaker.client.ui.element.type.ColorPickerColorElement; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.StringUtils; + +import java.io.*; +import java.nio.file.Files; +import java.util.*; +import java.util.stream.Collectors; + +public class ConfigManager { + + private final List presetLocations = new ArrayList<>(); + public List moduleProfiles = new ArrayList<>(); + public Profile activeProfile; + + private final File configDir = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-")); + public final File profileDir = new File(this.configDir + File.separator + "profiles"); + private final File globalConfig = new File(this.configDir + File.separator + "global.cfg"); + private final File mutesConfig = new File(this.configDir + File.separator + "mutes.cfg"); + private final File defaultConfig = new File(this.configDir + File.separator + "default.cfg"); + + /** + * Updates the current profile. + */ + public void updateProfile() { + if (this.createRequiredFiles()) { +// CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().saveAll(); + this.updateGlobalConfiguration(this.globalConfig); + this.updateMutesConfiguration(this.mutesConfig); + this.updateProfile(CheatBreaker.getInstance().getConfigManager().activeProfile.getName()); + } + } + + /** + * Returns if the player is using staff modules or not. + */ + public boolean isUsingStaffModules() { + for (final AbstractModule cbModule : CheatBreaker.getInstance().getModuleManager().staffMods) { + cbModule.setStaffModuleEnabled(true); + if (cbModule.isStaffModuleEnabled()) { + return false; + } + } + return true; + } + + /** + * Creates the default Configuration Preset. + */ + public void createDefaultConfigurationPresets() { + File profileDir = this.profileDir; + if (profileDir.exists() || profileDir.mkdirs()) { + for (ResourceLocation presets : this.presetLocations) { + String presetsName = presets.getResourcePath().replaceAll("([a-zA-Z0-9/]+)/", ""); + File presetsFile = new File(profileDir, presetsName); + if (presetsFile.exists()) continue; + try { + InputStream presetInputStream = Minecraft.getMinecraft().getResourceManager().getResource(presets).getInputStream(); + Files.copy(presetInputStream, presetsFile.toPath()); + presetInputStream.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created default configuration presets"); + } + + /** + * Reads the current profile. + */ + public void readCurrentProfile() { + if (this.createRequiredFiles()) { + this.readGlobalConfiguration(this.globalConfig); + this.readMutesConfiguration(this.mutesConfig); + if (CheatBreaker.getInstance().getConfigManager().activeProfile == null) { + CheatBreaker.getInstance().getConfigManager().activeProfile = this.moduleProfiles.get(0); + } else { + this.readProfile(CheatBreaker.getInstance().getConfigManager().activeProfile.getName()); + } +// CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().loadAll(); + } + } + + /** + * Creates the required files for configs. + */ + private boolean createRequiredFiles() { + try { + return !(!this.configDir.exists() && !this.configDir.mkdirs() || !this.defaultConfig.exists() && !this.defaultConfig.createNewFile() || !this.globalConfig.exists() && !this.globalConfig.createNewFile()); + } catch (IOException e) { + e.printStackTrace(); + } + return true; + } + + /** + * Gets the most recently created profile name. + */ + private String getNewProfileName(String name) { + File clientDir = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-")); + File profilesDir = new File(clientDir + File.separator + "profiles"); + if ((profilesDir.exists() || profilesDir.mkdirs()) && new File(profilesDir + File.separator + name + ".cfg").exists()) { + return this.getNewProfileName(name + "1"); + } + return name; + } + + /** + * Loads all module profiles. + */ + public void loadProfiles() { + this.moduleProfiles.add(new Profile("default", true)); + File profilesDir = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-") + File.separator + "profiles"); + if (profilesDir.exists()) { + for (File profile : Objects.requireNonNull(profilesDir.listFiles())) { + Minecraft.getMinecraft().cbLoadingScreen.addPhase(); + if (!profile.getName().endsWith(".cfg")) continue; + this.moduleProfiles.add(new Profile(profile.getName().replace(".cfg", ""), false)); + } + } + + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Loaded " + this.moduleProfiles.size() + " custom profiles"); + } + + /** + * Creates a new profile. + */ + public void createNewProfile() { + if (this.activeProfile == this.moduleProfiles.get(0)) { + Profile defaultProfile; + CheatBreaker.getInstance().getConfigManager().activeProfile = defaultProfile = new Profile(this.getNewProfileName("Profile 1"), false); + this.moduleProfiles.add(defaultProfile); + CheatBreaker.getInstance().configManager.updateProfile(); + Minecraft var2 = Minecraft.getMinecraft(); + if (var2.currentScreen instanceof HudLayoutEditorGui) { + ProfilesListElement var3 = (ProfilesListElement) ((HudLayoutEditorGui) var2.currentScreen).profilesElement; + var3.loadProfiles(); + } + } + } + + /** + * Reads a profile. + */ + public void readProfile(String string) { + if (string.equalsIgnoreCase("default")) { + this.activeProfile = this.moduleProfiles.get(0); + for (AbstractModule module : CheatBreaker.getInstance().getModuleManager().playerMods) { + module.setState(module.defaultState); + module.setWasRenderHud(module.defaultWasRenderHud); + module.setAnchor(module.defaultGuiAnchor); + module.setTranslations(module.defaultXTranslation, module.defaultYTranslation); + module.setRenderHud(module.defaultRenderHud); + for (int i = 0; i < module.getSettingsList().size(); ++i) { + try { + module.getSettingsList().get(i).updateSettingValue(module.getDefaultSettingsValues().get(i), false); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + return; + } + + File file = new File(this.configDir + File.separator + "profiles"); + File file2 = file.exists() || file.mkdirs() ? new File(file + File.separator + string + ".cfg") : null; + + if (!file2.exists()) { + this.updateProfile(string); + return; + } + + ArrayList arrayList = new ArrayList(); + arrayList.addAll(CheatBreaker.getInstance().getModuleManager().playerMods); + arrayList.addAll(CheatBreaker.getInstance().getModuleManager().staffMods); + + try { + String string2; + BufferedReader bufferedReader = new BufferedReader(new FileReader(file2)); + AbstractModule module = null; + block34: while ((string2 = bufferedReader.readLine()) != null) { + try { + String[] split; + if (string2.startsWith("#") || string2.length() == 0) continue; + if (string2.startsWith("[")) { + for (AbstractModule object222 : arrayList) { + if (!("[" + object222.getName() + "]").equalsIgnoreCase(string2)) continue; + module = object222; + continue block34; + } + continue; + } + if (module == null) continue; + if (string2.startsWith("-")) { + split = string2.replaceFirst("-", "").split("=", 2); + if (split.length != 2) continue; + try { + block12 : switch (split[0]) { + case "State": + if (module.isStaffModule()) break; + module.setState(Boolean.parseBoolean(split[1])); + break; + case "WasRenderHUD": + module.setWasRenderHud(Boolean.parseBoolean(split[1])); + break; + case "RenderHUD": + module.setRenderHud(Boolean.parseBoolean(split[1])); + break; + case "Position": + if (module.getGuiAnchor() == null) break; + for (GuiAnchor cBGuiAnchor : GuiAnchor.values()) { + if (!cBGuiAnchor.getLabel().equalsIgnoreCase(split[1])) continue; + module.setAnchor(cBGuiAnchor); + break block12; + } + continue block34; + case "xTranslation": + module.setXTranslation(Float.parseFloat(split[1])); + break; + case "yTranslation": + module.setYTranslation(Float.parseFloat(split[1])); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + continue; + } + + split = string2.split("=", 2); + if (split.length != 2) continue; + if (module == CheatBreaker.getInstance().getModuleManager().autoTextMod) { + for (int j = 0; j < 50; j++) { + if (split[1].contains("keycode:")) { + boolean mouseFlag = false; + Setting setting; + String val = ""; + + if (split[1].contains("mouse:")) { + val = StringUtils.substringAfter(split[1], ";mouse:"); + mouseFlag = true; + } + + String key = StringUtils.substringAfter(split[1], ";keycode:").replaceAll(";mouse:" + val, ""); + + Object[] arrobject = split[1].split(";"); + String value = (String) arrobject[0]; + value = value.replaceAll(";mouse:" + val, ""); + + if (Integer.parseInt(key) == 0 && Boolean.parseBoolean(val)) { + mouseFlag = false; + } + + if (!CheatBreaker.getInstance().getModuleManager().autoTextMod.containsSettingByName(split[0])) { + setting = new Setting(CheatBreaker.getInstance().getModuleManager().autoTextMod.getSettingsList(), split[0]); + setting.setValue(value).setKeyCode(Integer.parseInt(key)); + setting.setHasMouseBind(mouseFlag); + } + } + } + } + + for (Setting setting : module.getSettingsList()) { + if (setting.getSettingName().equalsIgnoreCase("label") || !setting.getSettingName().equalsIgnoreCase(split[0])) + continue; + + + if (module == CheatBreaker.getInstance().getModuleManager().autoTextMod) { + break; + } + + if (setting.getSettingName().endsWith("Keybind") && split[1].contains("mouse:")) { + boolean val = Boolean.parseBoolean(StringUtils.substringAfter(split[1], ";mouse:")); + + Object[] arrobject = split[1].split(";"); + String value = (String) arrobject[0]; + + System.out.println("mouse boolean: " + val); + System.out.println("value: " + value); + + if (Integer.parseInt(value) == 0 && val) { + setting.setHasMouseBind(false); // prevent possible issues + } + + setting.setValue(Integer.parseInt(value)).setHasMouseBind(val); + break; + } + + try { + switch (setting.getType()) { + case BOOLEAN: + setting.setValue(Boolean.parseBoolean(split[1])); + break; + case INTEGER: + if (module.isStaffModule() && setting == ((StaffMod)module).getKeybindSetting()) { + ((StaffMod)module).getKeybindSetting().setValue(Integer.parseInt(split[1])); + break; + } + + if (split[1].contains("rainbow")) { + Object[] arrobject = split[1].split(";"); + int n = Integer.parseInt((String) arrobject[0]); + setting.rainbow = true; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block34; + setting.setValue(n); + break; + } + + if (setting.getSettingName().endsWith("Keybind")) { + setting.setValue(Integer.parseInt(split[1])); + break; + } + + int n = Integer.parseInt(split[1]); + setting.rainbow = false; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block34; + setting.setValue(n); + break; + case FLOAT: + float f = Float.parseFloat(split[1]); + if (!(f <= (Float) setting.getMaximumValue()) || !(f >= (Float) setting.getMinimumValue())) break; + setting.setValue(f); + break; + case DOUBLE: + double d = Double.parseDouble(split[1]); + if (!(d <= (Double)setting.getMaximumValue()) || !(d >= (Double)setting.getMinimumValue())) break; + setting.setValue(d); + break; + case ARRAYLIST: + ArrayList strList = new ArrayList<>(Arrays.asList(split[1].replaceAll("\\[", "").replaceAll("]", "").replaceAll(" ", "").split(","))); + List listOfInteger = strList.stream().map(Integer::parseInt).collect(Collectors.toList()); + setting.setValue(listOfInteger); + break; + case STRING_ARRAY: + boolean bl = false; + for (String value : setting.getAcceptedStringValues()) { + if (!value.equalsIgnoreCase(split[1])) continue; + bl = true; + } + if (!bl) break; + setting.setValue(split[1]); + break; + case STRING: + if (setting.getSettingName().equalsIgnoreCase("label")) break; + + if (setting == CheatBreaker.getInstance().getModuleManager().toggleSprintMod.flyBoostString) { + split[1] = split[1].replaceAll("%FPS%", "%BOOST%"); + } + + setting.setValue(split[1].replaceAll("&([abcdefghijklmrABCDEFGHIJKLMNR0-9])|(&$)", "§$1")); + } + continue block34; + } catch (Exception exception) { + exception.printStackTrace(); + if (setting != CheatBreaker.getInstance().getModuleManager().keystrokesMod.boxSize) continue; + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().clearChatMessages(); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + bufferedReader.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + this.updateProfile(string); + } + + /** + * Reads the global settings configuration file. + */ + public void readGlobalConfiguration(File file) { + if (!file.exists()) { + this.updateGlobalConfiguration(file); + return; + } + try { + String string; + BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); + block21: while ((string = bufferedReader.readLine()) != null) { + try { + File profileFile; + String[] arrString; + if (string.startsWith("#") || string.length() == 0 || (arrString = string.split("=", 2)).length != 2) continue; + + if (arrString[0].equalsIgnoreCase("FavoriteColors")) { + String[] declaration = arrString[1].split(","); + for (String object2 : declaration) { + try { + CheatBreaker.getInstance().getGlobalSettings().favouriteColors.add(new ColorPickerColorElement(1.0f, Integer.parseInt(object2), 1.0f)); + } catch (NumberFormatException numberFormatException) { + numberFormatException.printStackTrace(); + } + } + continue; + } + + if (arrString[0].equalsIgnoreCase("FavoriteStations")) { + String[] declaration = arrString[1].split(","); + for (String object2 : declaration) { + try { + for (Station station : CheatBreaker.getInstance().getDashManager().getStations()) { + if (!station.getName().equalsIgnoreCase(object2)) continue; + station.setFavourite(true); + } + } catch (NumberFormatException numberFormatException) { + numberFormatException.printStackTrace(); + } + } + continue; + } + if (arrString[0].equalsIgnoreCase("XrayBlocks")) { + CheatBreaker.getInstance().getModuleManager().xray.getBlocks().clear(); + String[] declaration = arrString[1].split(","); + for (String object2 : declaration) { + try { + CheatBreaker.getInstance().getModuleManager().xray.getBlocks().add(Integer.parseInt(object2)); + } catch (NumberFormatException numberFormatException) { + numberFormatException.printStackTrace(); + } + } + continue; + } + + if (arrString[0].startsWith("key_")) { + for (KeyBinding keyBinding : Minecraft.getMinecraft().gameSettings.keyBindings) { + if (!keyBinding.isCheatBreakerKeybind || !arrString[0].equalsIgnoreCase("key_" + keyBinding.getKeyDescription())) continue; + keyBinding.setKeyCode(Integer.parseInt(arrString[1])); + } + continue; + } + + if (arrString[0].equalsIgnoreCase("ProfileIndexes")) { + String[] declaration = arrString[1].split("]\\["); + for (String object2 : declaration) { + object2 = object2.replaceFirst("\\[", ""); + String[] arrstring2 = object2.split(",", 2); + try { + int n = Integer.parseInt(arrstring2[1]); + for (Profile profile : this.moduleProfiles) { + if (n == 0 || !profile.getName().equalsIgnoreCase(arrstring2[0])) continue; + profile.index = n; + } + } catch (NumberFormatException numberFormatException) { + + } + } + continue; + } + if (arrString[0].equalsIgnoreCase("ActiveProfile")) { + profileFile = null; + File file2 = new File(this.configDir + File.separator + "profiles"); + if (file2.exists() || file2.mkdirs()) { + profileFile = new File(file2 + File.separator + arrString[1] + ".cfg"); + } + if (profileFile == null || !profileFile.exists()) continue; + Profile object3 = null; + for (Profile object2 : this.moduleProfiles) { + if (!arrString[1].equalsIgnoreCase(object2.getName())) continue; + object3 = object2; + } + if (object3 == null || object3.getName().equalsIgnoreCase("default")) continue; + this.activeProfile = object3; + continue; + } + for (Setting setting : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + if (setting.getSettingName().equalsIgnoreCase("label") || !setting.getSettingName().equalsIgnoreCase(arrString[0])) continue; + try { + switch (setting.getType()) { + case BOOLEAN: + setting.setValue(Boolean.parseBoolean(arrString[1])); + break; + case INTEGER: + if (arrString[1].contains("rainbow")) { + String[] arrstring3 = arrString[1].split(";"); + int n = Integer.parseInt(arrstring3[0]); + setting.rainbow = true; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block21; + setting.setValue(n); + break; + } + int n = Integer.parseInt(arrString[1]); + setting.rainbow = false; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block21; + setting.setValue(n); + break; + case FLOAT: + float f = Float.parseFloat(arrString[1]); + if (!(f <= (Float) setting.getMaximumValue()) || !(f >= (Float) setting.getMinimumValue())) break; + setting.setValue(f); + break; + case DOUBLE: + double d = Double.parseDouble(arrString[1]); + if (!(d <= (Double)setting.getMaximumValue()) || !(d >= (Double)setting.getMinimumValue())) break; + setting.setValue(d); + break; + case ARRAYLIST: + ArrayList strList = new ArrayList<>(Arrays.asList(arrString[1].split(","))); + List listOfInteger = strList.stream().map(Integer::parseInt).collect(Collectors.toList()); + setting.setValue(listOfInteger); + break; + case STRING_ARRAY: + boolean bl = false; + for (String acceptedValue : setting.getAcceptedStringValues()) { + if (!acceptedValue.equalsIgnoreCase(arrString[1])) continue; + bl = true; + } + if (!bl) break; + setting.setValue(arrString[1]); + } + continue block21; + } catch (Exception exception) { + exception.printStackTrace(); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + bufferedReader.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + this.updateGlobalConfiguration(file); + } + + /** + * Writes to the global configuration file. + */ + public void updateGlobalConfiguration(File file) { + try { + BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file)); + bufferedWriter.write("################################"); + bufferedWriter.newLine(); + bufferedWriter.write("# MC_Client: GLOBAL SETTINGS"); + bufferedWriter.newLine(); + bufferedWriter.write("################################"); + bufferedWriter.newLine(); + bufferedWriter.newLine(); + if (this.activeProfile != null && !this.activeProfile.getName().equals("default")) { + bufferedWriter.write("ActiveProfile=" + this.activeProfile.getName()); + bufferedWriter.newLine(); + } + for (Setting setting : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + if (setting.getSettingName().equalsIgnoreCase("label")) continue; + if (setting.rainbow) { + bufferedWriter.write(setting.getSettingName() + "=" + setting.getValue() + ";rainbow"); + } else { + bufferedWriter.write(setting.getSettingName() + "=" + setting.getValue()); + } + bufferedWriter.newLine(); + } + for (KeyBinding keyBind : Minecraft.getMinecraft().gameSettings.keyBindings) { + if (!(keyBind.isCheatBreakerKeybind)) continue; + bufferedWriter.write("key_" + keyBind.getKeyDescription() + "=" + keyBind.getKeyCode()); + bufferedWriter.newLine(); + } + String object3 = ""; + for (ColorPickerColorElement colorPickerColorElement : CheatBreaker.getInstance().getGlobalSettings().favouriteColors) { + object3 = object3 + colorPickerColorElement.color + (CheatBreaker.getInstance().getGlobalSettings().favouriteColors.indexOf(colorPickerColorElement) == CheatBreaker.getInstance().getGlobalSettings().favouriteColors.size() - 1 ? "" : ","); + } + if (!object3.equals("")) { + bufferedWriter.write("FavoriteColors=" + object3); + bufferedWriter.newLine(); + } + StringBuilder stations = new StringBuilder(); + for (Station station : CheatBreaker.getInstance().getDashManager().getStations()) { + if (!station.isFavourite()) continue; + if (stations.length() != 0) { + stations.append(","); + } + stations.append(station.getName()); + } + if (!stations.toString().equals("")) { + bufferedWriter.write("FavoriteStations=" + stations); + bufferedWriter.newLine(); + } + StringBuilder selectedXRayBlocks = new StringBuilder(); + for (int blocks : CheatBreaker.getInstance().getModuleManager().xray.getBlocks()) { + if (selectedXRayBlocks.length() != 0) { + selectedXRayBlocks.append(","); + } + selectedXRayBlocks.append(blocks); + } + bufferedWriter.write("XrayBlocks=" + selectedXRayBlocks); + bufferedWriter.newLine(); + bufferedWriter.write("ProfileIndexes="); + for (Profile profile : this.moduleProfiles) { + bufferedWriter.write("[" + profile.getName() + "," + profile.index + "]"); + } + bufferedWriter.newLine(); + bufferedWriter.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + } + + /** + * Reads the muted configuration file. + * This is used for the Voice Chat integration. + */ + public void readMutesConfiguration(File file) { + try { + String string; + if (!file.exists()) { + this.updateMutesConfiguration(file); + return; + } + BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); + while ((string = bufferedReader.readLine()) != null) { + try { + UUID uUID = UUID.fromString(string); + CheatBreaker.getInstance().getCBNetHandler().getPlayersInVoiceChannel().add(uUID); + } catch (Exception ignored) { + } + } + } catch (IOException ignored) { + + } + } + + /** + * Writes to the muted configuration file. + * This is used for the Voice Chat integration. + */ + public void updateMutesConfiguration(File file) { + try { + if (!file.exists()) { + file.createNewFile(); + } + BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file)); + for (UUID uUID : CheatBreaker.getInstance().getCBNetHandler().getPlayersInVoiceChannel()) { + bufferedWriter.write(uUID.toString()); + bufferedWriter.newLine(); + } + bufferedWriter.close(); + } catch (IOException ignored) { + + } + } + + /** + * Reads the muted configuration file. + * This is used for the Voice Chat integration. + */ + public void updateProfile(String profileName) { + if (profileName.equalsIgnoreCase("default")) { + return; + } + File file = new File(this.configDir + File.separator + "profiles"); + File file2 = file.exists() || file.mkdirs() ? new File(file + File.separator + profileName + ".cfg") : null; + ArrayList modules = new ArrayList<>(); + modules.addAll(CheatBreaker.getInstance().getModuleManager().playerMods); + modules.addAll(CheatBreaker.getInstance().getModuleManager().staffMods); + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(file2)); + writer.write("################################"); + writer.newLine(); + writer.write("# MC_Client: MODULE SETTINGS"); + writer.newLine(); + writer.write("################################"); + writer.newLine(); + writer.newLine(); + for (AbstractModule module : modules) { + writer.write("[" + module.getName() + "]"); + writer.newLine(); + writer.write("-State=" + module.isEnabled()); + writer.newLine(); + writer.write("-WasRenderHUD=" + module.isWasRenderHud()); + writer.newLine(); + if (module.getGuiAnchor() != null) { + writer.write("-Position=" + module.getGuiAnchor().getLabel()); + writer.newLine(); + } + writer.write("-xTranslation=" + module.getXTranslation()); + writer.newLine(); + writer.write("-yTranslation=" + module.getYTranslation()); + writer.newLine(); + writer.write("-RenderHUD=" + module.isRenderHud()); + writer.newLine(); + for (Setting setting : module.getSettingsList()) { + if (setting == CheatBreaker.getInstance().getModuleManager().coordinatesMod.customLine) { + writer.write("# Customize your HUD info display string."); + writer.newLine(); + writer.write("# (& color formatting is allowed)"); + writer.newLine(); + writer.write("# Optional uses:"); + writer.newLine(); + writer.write("# %FPS% - Display current FPS."); + writer.newLine(); + writer.write("# %DIR% - Display current look direction."); + writer.newLine(); + writer.write("# %CPS% - Display CPS."); + writer.newLine(); + writer.write("# %COORDS% - Display coordinates."); + writer.newLine(); + writer.write("# %IP% - Current server IP."); + writer.newLine(); + writer.write("# %X% - Your X location."); + writer.newLine(); + writer.write("# %Y% - Your (foot) Y location."); + writer.newLine(); + writer.write("# %Z% - Your Z location."); + writer.newLine(); + writer.write("# %NL% - Break into a new line."); + writer.newLine(); + } + if (setting.getSettingName().equalsIgnoreCase("label")) continue; + if (setting.getType() == SettingType.STRING && setting.getSettingName().startsWith("Hot key")) { + writer.write(setting.getSettingName() + "=" + (setting.getValue() + (setting.isHasKeycode() ? ";keycode:" + setting.getKeyCode() : "") + (setting.isHasMouseBind() ? ";mouse:" + setting.isHasMouseBind() : "")).replaceAll("§", "&")); + } else if (setting.getType() == SettingType.INTEGER && setting.getSettingName().endsWith("Keybind") && setting.getSettingName().contains("Toggle")) { + writer.write(setting.getSettingName() + "=" + setting.getValue() + (setting.isHasMouseBind() ? ";mouse:" + setting.isHasMouseBind() : "")); + } else if (setting.rainbow) { + writer.write(setting.getSettingName() + "=" + setting.getValue() + ";rainbow"); + } else { + writer.write(setting.getSettingName() + "=" + setting.getValue()); + } + writer.newLine(); + } + writer.newLine(); + } + writer.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/GlobalSettings.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/GlobalSettings.java new file mode 100644 index 0000000..332a9e0 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/GlobalSettings.java @@ -0,0 +1,441 @@ +package com.cheatbreaker.client.config; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.module.ModuleListElement; +import com.cheatbreaker.client.ui.element.type.ColorPickerColorElement; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.util.render.serverlist.UnsafeServerAction; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import org.apache.commons.lang3.ArrayUtils; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class GlobalSettings { + public KeyBinding keyBindOpenMenu; + public KeyBinding keyBindDragToLook; + public KeyBinding keyBindBackLook; + public KeyBinding keyBindFrontLook; + public KeyBinding keyBindEmote; + + public final List settingsList = new ArrayList<>(); + @Getter private final List pinnedServers = new ArrayList<>(); + @Getter private final List unsafeServers = new ArrayList<>(); + + public boolean isDebug = false; + public boolean SHOW_MODIFIERS = true; + + public int sessionCheckInteral = 60; + + public String webapiCrashReportUpload = "http://server.noxiuam.gq/crashReport"; + public String webapiDebugUpload = "http://moosecbapi.000webhostapp.com/debug-upload.php"; + public String mojangStatusURL = "https://mojan.ga/api/check"; + + // private final Setting debugSettingsLabel; +// public Setting showDebugOutput; + private final Setting audioSettingsLabel; + // public Setting microphone; + public Setting radioVolume; + // public Setting microphoneVolume; +// public Setting speakerVolume; + public Setting pinRadio; + public Setting muteCBSounds; + + private final Setting fpsBoostSettingsLabel; + public Setting enableFpsBoost; + public Setting slowChunkLoading; + public Setting fullBright; + public Setting entityShadows; + public Setting hideGroundedArrows; + public Setting hideStuckArrows; + public Setting hideFoliage; + public Setting hideMovingArrows; + public Setting hidePlacedSkulls; + + private final Setting fpsLimitSettingsLabel; + public Setting useCustomFPSLimiter; + public Setting customFPSLimit; + public Setting limitWhenUnfocused; + public Setting unfocusedFPS; + // public Setting limitWhenInactive; +// public Setting inactiveFPS; + public Setting mainMenuFPS; + + private final Setting teamViewLabel; + public Setting enableTeamView; + public Setting showDistance; + public Setting showOffScreenMarker; + +// private final Setting generalSettingsLabel; + public Setting compactMode; + public static Setting darkMode; + // public Setting lookView; + public Setting customizationLevel; + + private final Setting displaySettingsLabel; + public Setting borderlessFullscreen; + public Setting unfullscreenWhenUnfocused; + + private final Setting hudEditorSettingsLabel; + public Setting snapModules; + public Setting snappingStrength; + public Setting showModName; +// public Setting useBackgroundOverlay; + + private final Setting moduleCommandSettingsLabel; + public Setting enableModuleCommands; + public Setting hideCallbackMessages; + + private final Setting renderSettingsLabel; + public Setting showHudInDebug; + public Setting showPotionInfo; + public Setting showServerBasedHitCooldowns; + public Setting achievements; + public Setting guiBlur; + public Setting containerBackground; + public Setting shiftPotionInfo; + + private final Setting streamerModeSettingsLabel; + public Setting streamerMode; + public Setting disableModMenuKeybind; + public Setting notifyWhenModMenuKeybindPressed; + public Setting holdDownModsGameMenuButton; + public Setting holdDuration; + + private final Setting packSettingsLabel; + public Setting packMenu; + public Setting widePackMenu; + public Setting transparentBackground; + public Setting packFolderInfo; + public Setting packFolderIcons; + public Setting packIcons; + public Setting packDescriptions; + public Setting packSearchBar; + public Setting packSortMethod; + public Setting packSmoothScrolling; + public Setting packListBackgroundColor; + + private final Setting scalingSettingsLabel; + public Setting guiScale; + public Setting globalGuiScale; + public Setting scaleModsDownSmallerResoltion; + + private final Setting screenshotSettingsLabel; + public Setting shutterSound; + public Setting sendScreenshotMessage; + public Setting compactOptions; + public Setting copyAutomatically; + public Setting openOption; + public Setting copyOption; + public Setting uploadOption; + + private final Setting keybindHandlingSettingsLabel; + public Setting keybindFix; + public Setting excludeSneakKeybind; + public Setting excludeThrowKeybind; + + private final Setting cosmeticSettingsLabel; + public Setting showOptifineCapes; + public Setting showOptifineHats; + public Setting showCheatBreakerCapes; + public Setting showCheatBreakerWings; + + private final Setting rpcSettings; + public Setting showRPC; + public Setting showServer; + public Setting showAccount; + + + private final Setting colorSettingsLabel; + public Setting resetColors; + public Setting defaultColor; + public Setting emoteRadialColor; + @Getter @Setter + private Setting currentMenuSetting; + + public List favouriteColors = new ArrayList<>(); + public List recentColors = new ArrayList<>(); + + /** + * Sets up all the global settings + */ + public GlobalSettings() { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created settings"); + +// String[] microphones = CheatBreaker.getInstance().getAudioManager().getMicrophoneArray(); +// StringBuilder availableMicrophones = new StringBuilder(); +// for (String microphone : microphones) { +// availableMicrophones.append("\n- ").append(microphone); +// } +// this.debugSettingsLabel = new Setting(this.settingsList, "label").setValue("Debug Settings"); +// this.showDebugOutput = new Setting(this.settingsList, "Show Debug Output", "Show any debug information.").setValue(false); + this.audioSettingsLabel = new Setting(this.settingsList, "label").setValue("Audio Settings"); +// this.microphone = microphones.length > 0 ? new Setting(this.settingsList, "Microphone", "Change the microphone for voice chat." + +// "\n" + +// "\nAvailable microphones:" + availableMicrophones).setValue(microphones[0]).acceptedValues(microphones).onChange(var0 -> { +// try { +// System.out.println("[CB] Updated audio device!"); +// Message.h(CheatBreaker.getInstance().getAudioManager().getMicrophone((String)var0)); +// } catch (UnsatisfiedLinkError ignored) {} +// }) : new Setting(this.settingsList, "Microphone", "Change the microphone for voice chat (none detected).").setValue("Unknown").acceptedValue("Unknown").onChange(var0 -> { +// try { +// System.out.println("[CB] Updated audio device!"); +// Message.h(CheatBreaker.getInstance().getAudioManager().getMicrophone((String)var0)); +// } catch (UnsatisfiedLinkError ignored) {} +// }); + this.muteCBSounds = new Setting(this.settingsList, "Mute CheatBreaker sounds", "Mute notification sounds generated from CheatBreaker.").setValue(false); + this.pinRadio = new Setting(this.settingsList, "Pin Radio Player", "Pin the radio to the HUD.").setValue(false); + this.radioVolume = new Setting(this.settingsList, "Radio Volume", "Adjusts the volume of the Dash Radio.").onChange(value -> { + if (DashUtil.isActive()) { + DashUtil.getPlayer().setFloatControlValue(Float.parseFloat(value.toString())); + } + }).setValue(85).setMinMax(0, 100).setUnit("%").setCenterLabel("MEDIUM"); +// this.microphoneVolume = new Setting(this.settingsList, "Microphone Volume", "Adjust the input Microphone volume.").onChange(volume -> { +// try { +// Message.l(Float.parseFloat(volume.toString())); +// } catch (UnsatisfiedLinkError ignored) {} +// }).setValue(70.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCenterLabel("MEDIUM"); +// this.speakerVolume = new Setting(this.settingsList, "Speaker Volume", "Adjust the speaker volume for voice chat.").onChange(var0 -> { +// try { +// float volume = 20000.0f / (float)(20000.0F - Math.max(0.0F, Math.min(19500.0F, (Float)var0 * 195.0F))); +// Message.m(volume); +// } catch (UnsatisfiedLinkError ignored) {} +// }).setValue(85.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCenterLabel("MEDIUM"); + + this.fpsBoostSettingsLabel = new Setting(this.settingsList, "label").setValue("FPS Boost"); + this.enableFpsBoost = new Setting(this.settingsList, "Enable FPS Boost", "Enables all FPS boost settings in this category.").setValue(true); +// this.slowChunkLoading = new Setting(this.settingsList, "Slow chunk loading", "Determines how fast chunks should load as a percentage." + +// "\n§e§oHigher values may increase performance!" + +// "\n§6§oHigher values will make chunks load slower." + +// "\n" + +// "\n§276% - 100%:§r Slowest chunk loading speed (Higher FPS)." + +// "\n§a51% - 75%:§r Slow chunk loading speed (High FPS)." + +// "\n§e50%:§r Medium chunk loading speed (Medium FPS)." + +// "\n§626% - 49%:§r Fast chunk loading speed (Low FPS)." + +// "\n§c0.1% - 25%:§r Faster chunk loading speed (Lower FPS)." + +// "\n§b0%:§r Vanilla chunk loading speed (Lowest FPS).").setMinMax(0.0f, 100.0f).setValue(70.0f).setUnit("%").setCenterLabel("MEDIUM").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.enableFpsBoost.getValue()); + this.fullBright = new Setting(this.settingsList, "Fullbright", "Set the brightness/gamma to the max.").setValue(true).setCondition(() -> (Boolean) this.enableFpsBoost.getValue()).onChange(value -> { + + float gamma = Minecraft.getMinecraft().gameSettings.gammaSetting; + if (gamma != 1000F) { + if (Minecraft.getMinecraft().gameSettings.oldGammaSetting < 1F) + gamma = 1F; + + Minecraft.getMinecraft().gameSettings.oldGammaSetting = gamma; + Minecraft.getMinecraft().gameSettings.saveOptions(); + } + + Minecraft.getMinecraft().gameSettings.gammaSetting = + (fullBright.getBooleanValue() ? 1000F : Minecraft.getMinecraft().gameSettings.oldGammaSetting); + + }); + this.entityShadows = new Setting(this.settingsList, "Entity Shadows", "Draws a shadow below entities.").setValue(true).onChange(value -> Minecraft.getMinecraft().getRenderManager().options.entityShadows = Boolean.parseBoolean(value.toString())); + this.hideGroundedArrows = new Setting(this.settingsList, "Hide Grounded Arrows").setValue(false); + this.hideStuckArrows = new Setting(this.settingsList, "Hide Stuck Arrows").setValue(false); + this.hideMovingArrows = new Setting(this.settingsList, "Hide Moving Arrows").setValue(false); + this.hideFoliage = new Setting(this.settingsList, "Hide Foliage", "Hides things like tall grass, flowers, and shrubs").setValue(false).onChange(e -> CheatBreaker.getInstance().getMc().renderGlobal.loadRenderers()); + this.hidePlacedSkulls = new Setting(this.settingsList, "Hide Placed Skulls").setValue(false); + this.fpsLimitSettingsLabel = new Setting(this.settingsList, "label").setValue("FPS Limiting Settings"); + this.useCustomFPSLimiter = new Setting(this.settingsList, "Use Custom FPS Limiter", "Overrides the default FPS limiter with a custom one." + + "\n§e§oWill not override when VSync is enabled.").setValue(false); + this.limitWhenUnfocused = new Setting(this.settingsList, "Limit When Game is Unfocused", "Limits the FPS when you are not interacting with the game.").setValue(false); + this.customFPSLimit = new Setting(this.settingsList, "Maximum FPS").setMinMax(5, 1000).setValue(390).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.useCustomFPSLimiter.getValue()); + this.unfocusedFPS = new Setting(this.settingsList, "Unfocused FPS").setMinMax(1, 390).setValue(60).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.limitWhenUnfocused.getValue()); +// this.limitWhenInactive = new Setting(this.settingsList, "Limit When Inactive", "Limits the FPS when your player is focused on the game but is not interacting for a certain period of time.").setValue(false); +// this.inactiveFPS = new Setting(this.settingsList, "Inactive FPS").setMinMax(15, 390).setValue(60).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.limitWhenInactive.getValue()); + this.mainMenuFPS = new Setting(this.settingsList, "Main Menu FPS").setMinMax(30, 500).setValue(90).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52"); + + this.teamViewLabel = new Setting(this.settingsList, "label").setValue("Team View Settings"); + this.enableTeamView = new Setting(this.settingsList, "Enable Team View", "Enables the Team View.").setValue(true); + this.showOffScreenMarker = new Setting(this.settingsList, "Show off-screen marker", "Show a marker above players.").setValue(true).setCondition(() -> (Boolean) this.enableTeamView.getValue()); + this.showDistance = new Setting(this.settingsList, "Show distance", "Show the distance amount above a your teammates' heads.").setValue(true).setCondition(() -> (Boolean) this.enableTeamView.getValue()); + +// this.generalSettingsLabel = new Setting(this.settingsList, "label").setValue("General Settings"); + this.currentMenuSetting = new Setting(this.settingsList, "Current Menu", "Sets which main menu should show." + + "\n" + + "\n0: 2017" + + "\n1: 2018" + + "\n2: 2016").setMinMax(0, 2).setValue(1); +// this.lookView = new Setting(this.settingsList, "Look View").setValue("Third").acceptedStringValues("Third", "Reverse", "First"); + this.displaySettingsLabel = new Setting(this.settingsList, "label").setValue("Display Settings"); + this.borderlessFullscreen = new Setting(this.settingsList, "Borderless Fullscreen").setValue(false).onChange(value -> { + if (Minecraft.getMinecraft().isFullScreen() && Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + Minecraft.getMinecraft().toggleFullscreen(); + Minecraft.getMinecraft().toggleFullscreen(); + + HudLayoutEditorGui hudEditor = new HudLayoutEditorGui(); + Minecraft.getMinecraft().displayGuiScreen(hudEditor); + hudEditor.currentScrollableElement = hudEditor.settingsElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).isCheatBreakerSettings = true; + HudLayoutEditorGui.instance.settingsElement.scrollAmount = CheatBreaker.getInstance().getModuleManager().lastSettingScrollPos; + } + }); + this.unfullscreenWhenUnfocused = new Setting(this.settingsList, "Unfullscreen when Unfocused").setValue(false); + + this.hudEditorSettingsLabel = new Setting(this.settingsList, "label").setValue("Hud Editor Settings"); + this.compactMode = new Setting(this.settingsList, "Mod List").setValue("Normal").acceptedStringValues("Normal", "Compact").setCustomizationLevel(CustomizationLevel.ADVANCED).onChange(value -> { + if (Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + HudLayoutEditorGui hudEditor = new HudLayoutEditorGui(); + Minecraft.getMinecraft().displayGuiScreen(hudEditor); + hudEditor.currentScrollableElement = hudEditor.modulesElement; + } + }); + this.darkMode = new Setting(this.settingsList, "Dark Mode", "Switch between light and dark mode.").setValue(false); + this.customizationLevel = new Setting(this.settingsList, "Customization Level").setValue("Simple").acceptedStringValues("Simple", "Medium", "Advanced"); + this.showModName = new Setting(this.settingsList, "Show Mod Name (GUI)").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); +// this.useBackgroundOverlay = new Setting(this.settingsList, "Use Background overlay (GUI)").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.snapModules = new Setting(this.settingsList, "Snap mods to other mods (GUI)").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.snappingStrength = new Setting(this.settingsList, "Snapping Strength").setValue(2.0F).setMinMax(1.0F, 10.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.snapModules.getValue()); + + this.moduleCommandSettingsLabel = new Setting(this.settingsList, "label").setValue("Mod Command Settings").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.enableModuleCommands = new Setting(this.settingsList, "Enable Mod Commands").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.hideCallbackMessages = new Setting(this.settingsList, "Hide Callback Messages").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.renderSettingsLabel = new Setting(this.settingsList, "label").setValue("Render Settings"); + this.showPotionInfo = new Setting(this.settingsList, "Show Potion info in inventory").setValue(true).setCondition(() -> CheatBreaker.getInstance().getModuleManager().potionEffectsMod.isEnabled()); + this.shiftPotionInfo = new Setting(this.settingsList, "Potion info shifts inventory", "Choose to make the potion info shift the inventory position.").setValue(false); + this.achievements = new Setting(this.settingsList, "Show Achievements").setValue(true); + this.showHudInDebug = new Setting(this.settingsList, "Show HUD while in debug view", "Show the CheatBreaker HUD when the debug view is open.").setValue(false); + this.guiBlur = new Setting(this.settingsList, "GUI Blur", "Blurs the menus.").onChange(value -> Minecraft.getMinecraft().entityRenderer.loadGuiBlurShader()).setValue(false); + this.containerBackground = new Setting(this.settingsList, "Container Background").setValue("CheatBreaker").acceptedStringValues("Vanilla", "CheatBreaker", "None"); + this.showServerBasedHitCooldowns = new Setting(this.settingsList, "Server Based 1.9 Combat Indicator", "On some servers, a hit cooldown is shown because of the newer versions of the game,\nthis gives you the ability to toggle it.").setValue(true); + + this.streamerModeSettingsLabel = new Setting(this.settingsList, "label").setValue("Streamer Mode Settings"); + this.streamerMode = new Setting(this.settingsList, "Streamer Mode", "Enables Streamer Mode Features").setValue(false); + this.disableModMenuKeybind = new Setting(this.settingsList, "Disable Mod Menu Keybind", "Disables the Mod Menu keybind from opening the Mod Menu when Streamer Mode is enabled.").setValue(true).setCondition(() -> this.streamerMode.getBooleanValue()); + this.notifyWhenModMenuKeybindPressed = new Setting(this.settingsList, "Notify when pressed", "Notifies when the player presses the Mod Menu keybind while disabled.").setValue(true).setCondition(() -> this.streamerMode.getBooleanValue() && this.disableModMenuKeybind.getBooleanValue()); + this.holdDownModsGameMenuButton = new Setting(this.settingsList, "Require Mods Button Held in Game Menu", "Requires the mouse to be held for a certain period of time when clicking on Mods.").setValue(true).setCondition(() -> this.streamerMode.getBooleanValue()); + this.holdDuration = new Setting(this.settingsList, "Hold Duration", "The amount of time the Mods button must be held down before entering the Mod Menu.").setValue(5.0F).setMinMax(1.0F, 10.0F).setUnit("s").setCondition(() -> this.streamerMode.getBooleanValue() && this.holdDownModsGameMenuButton.getBooleanValue()); + + this.packSettingsLabel = new Setting(this.settingsList, "label").setValue("Resource Pack Settings").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.widePackMenu = new Setting(this.settingsList, "Wide Pack Menu").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.transparentBackground = new Setting(this.settingsList, "Transparent background", "Remove the dirt background in the resource pack menu.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.packFolderInfo = new Setting(this.settingsList, "Show Pack Folder Information", "Show the ").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packFolderIcons = new Setting(this.settingsList, "Show Pack Folder Icons").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packIcons = new Setting(this.settingsList, "Show Pack Icons").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packDescriptions = new Setting(this.settingsList, "Show Pack Descriptions").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packSearchBar = new Setting(this.settingsList, "Show Search Bar").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packSortMethod = new Setting(this.settingsList, "Sort Method", "Sort packs in a specific order." + + "\n" + + "\n§bA-Z:§r Sort packs alphabetically starting from A to Z." + + "\n§bZ-A:§r Sort packs alphabetically in reverse starting from Z to A.").setValue("A-Z").acceptedStringValues("A-Z", "Z-A").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.packSmoothScrolling = new Setting(this.settingsList, "Smooth Scrolling", "Makes scrolling smooth").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.packListBackgroundColor = new Setting(this.settingsList, "List Background color", "Change the background color in the resource pack lists.").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.keybindHandlingSettingsLabel = new Setting(this.settingsList, "label").setValue("Keybind Handling Settings"); + this.keybindFix = new Setting(this.settingsList, "Modern Keybind Handling").setValue(true); + this.excludeSneakKeybind = new Setting(this.settingsList, "Exclude Sneak Keybind").setValue(true).setCondition(() -> (Boolean) this.keybindFix.getValue()); + this.excludeThrowKeybind = new Setting(this.settingsList, "Exclude Block/Throw Keybind").setValue(true).setCondition(() -> (Boolean) this.keybindFix.getValue()); + + this.scalingSettingsLabel = new Setting(this.settingsList, "label").setValue("Scaling Settings"); + this.guiScale = new Setting(this.settingsList, "Mod Scale").setValue("Default").acceptedStringValues("Default", "Small", "Normal", "Large", "Auto"); + this.globalGuiScale = new Setting(this.settingsList, "Mod Scale Multiplier").setValue(1.0F).setMinMax(0.25F, 2.0F).setUnit("x"); + this.scaleModsDownSmallerResoltion = new Setting(this.settingsList, "Use Legacy Scaling").setValue(false); + + this.screenshotSettingsLabel = new Setting(this.settingsList, "label").setValue("Screenshot Settings").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.shutterSound = new Setting(this.settingsList, "Make Shutter Sound").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.copyAutomatically = new Setting(this.settingsList, "Copy Screenshot Automatically").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.sendScreenshotMessage = new Setting(this.settingsList, "Send Message").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.compactOptions = new Setting(this.settingsList, "Compact Options").setValue(false).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + this.openOption = new Setting(this.settingsList, "Show Open Option").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + this.copyOption = new Setting(this.settingsList, "Show Copy Option").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + this.uploadOption = new Setting(this.settingsList, "Show Upload Option").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + + this.cosmeticSettingsLabel = new Setting(this.settingsList, "label").setValue("Cosmetic Settings"); + this.showOptifineCapes = new Setting(this.settingsList, "Show OptiFine Capes").setValue(true); + this.showOptifineHats = new Setting(this.settingsList, "Show OptiFine Hats").setValue(true); + this.showCheatBreakerCapes = new Setting(this.settingsList, "Show CheatBreaker Capes").setValue(true); + this.showCheatBreakerWings = new Setting(this.settingsList, "Show CheatBreaker Wings").setValue(true); + + String os = System.getProperty("os.name").toLowerCase(); + this.rpcSettings = (new Setting(this.settingsList, "label")).setValue("Discord Rich Presence Settings").setCondition(() -> os.contains("win")); + this.showRPC = (new Setting(this.settingsList, "Show Discord Rich Presence")).setValue(true).setCondition(() -> os.contains("win")).onChange(value -> { + if (os.contains("win") && Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + try { + if ((Boolean) value) { + CheatBreaker.getInstance().connectDiscordIPC(); + } else { + CheatBreaker.getInstance().getRpcClient().close(); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + }); + + this.showServer = (new Setting(this.settingsList, "Show Active Server")).setValue(true).setCondition(() -> os.contains("win") && this.showRPC.getBooleanValue()).onChange(value -> this.updateRPC()); + this.showAccount = (new Setting(this.settingsList, "Show Active Account")).setValue(true).setCondition(() -> os.contains("win") && this.showRPC.getBooleanValue()).onChange(value -> this.updateRPC()); + + this.colorSettingsLabel = new Setting(this.settingsList, "label").setValue("Color Settings"); + this.resetColors = new Setting(this.settingsList, "Apply Default Color When Enabling Mods").setValue(true); + this.defaultColor = new Setting(this.settingsList, "Default color", "Change the default color that will be displayed when mods are enabled.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + //this.emoteRadialColor = new Setting(this.settingsList, "Emote Radial color", "Change the color for the highlighted radial in emotes.").setValue(0x8033334D).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM); + // this.pinnedServers.add(new String[]{"Minemen Club [NA]", "na.minemen.club"}); + this.pinnedServers.add(new String[]{"Minemen Club [EU]", "eu.minemen.club"}); + this.unsafeServers.add(new String[]{"warnedserver.us", "This server is a test IP for warned servers", String.valueOf(UnsafeServerAction.WARN)}); + this.unsafeServers.add(new String[]{"blockedserver.us", "This server is a test IP for blocked servers", String.valueOf(UnsafeServerAction.BLOCK)}); + + GameSettings gameSettings = Minecraft.getMinecraft().gameSettings; +// this.keyBindVoicePushToTalk = new KeyBinding("Voice Chat", 47, "CheatBreaker Client", true); + this.keyBindOpenMenu = new KeyBinding("Open Menu", 54, "CheatBreaker Client", true); +// this.keyBindOpenVoiceMenu = new KeyBinding("Open Voice Menu", 25, "CheatBreaker Client", true); + this.keyBindDragToLook = new KeyBinding("Drag to look", 56, "CheatBreaker Client", true); + this.keyBindBackLook = new KeyBinding("Back look", 0, "CheatBreaker Client", true); + this.keyBindFrontLook = new KeyBinding("Front look", 0, "CheatBreaker Client", true); + this.keyBindEmote = new KeyBinding("Emote", Keyboard.KEY_B, "CheatBreaker Client", true); + gameSettings.keyBindings = ArrayUtils.addAll(gameSettings.keyBindings, /*this.keyBindVoicePushToTalk, */this.keyBindOpenMenu, /*this.keyBindOpenVoiceMenu, */this.keyBindDragToLook, this.keyBindBackLook, this.keyBindFrontLook, this.keyBindEmote); + } + + /** + * Gets the current menu the player is in. + */ + public MainMenuBase.MenuTypes getCurrentMenu() { + return MainMenuBase.MenuTypes.values()[(int) currentMenuSetting.getValue()]; + } + + /** + * Returns if a color is already a favorite color or not. + */ + public boolean isFavouriteColor(int colorValue) { + ColorPickerColorElement var3; + Iterator var2 = this.favouriteColors.iterator(); + do { + if (!var2.hasNext()) { + return false; + } + var3 = var2.next(); + } while (var3.color != colorValue); + return true; + } + + /** + * Removes a favorite color from the player's config. + */ + public void removeFavouriteColor(int colorValue) { + this.favouriteColors.removeIf(var1x -> var1x.color == colorValue); + } + + /** + * Update's the Discord RPC. + */ + private void updateRPC() { + try { + if (Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + String account = this.showAccount.getBooleanValue() ? Minecraft.getMinecraft().getSession().getUsername() : null; + CheatBreaker.getInstance().updateServerInfo(account); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/Profile.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/Profile.java new file mode 100644 index 0000000..e1859fd --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/config/Profile.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.config; + +import lombok.Getter; +import lombok.Setter; + +/** + * Defines the module Profile Object. + */ +@Getter @Setter +public class Profile { + private String name; + private boolean notEditable; + public int index = 0; + + public Profile(String name, boolean notEditable) { + this.name = name; + this.notEditable = notEditable; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/Cosmetic.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/Cosmetic.java new file mode 100644 index 0000000..84ba2ef --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/Cosmetic.java @@ -0,0 +1,86 @@ +package com.cheatbreaker.client.cosmetic; + +import lombok.Getter; +import lombok.Setter; +import net.minecraft.util.ResourceLocation; + +/** + * This defines the CheatBreaker Client's cosmetic Object. + */ +@Getter @Setter +public class Cosmetic { + private String playerId; + private String name; + + private CosmeticType type; + + private float scale; + + private int emoteId; + + private long lastUpdate; + + private boolean equipped; + + private ResourceLocation location; + private ResourceLocation previewLocation; + + /** + * This should be used for animated capes. + */ + public Cosmetic(long time, String playerId, String name, CosmeticType type, float scale, boolean equipped, String location) { + this.lastUpdate = time; + this.playerId = playerId; + this.name = name; + this.type = type; + this.scale = scale; + this.equipped = equipped; + this.location = new ResourceLocation(location); + this.previewLocation = new ResourceLocation("client/preview/" + location.replaceAll("client/", "")); + } + + /** + * This is the normal capes/wings + */ + public Cosmetic(String playerId, String name, CosmeticType type, float scale, boolean equipped, String location) { + this.playerId = playerId; + this.name = name; + this.type = type; + this.scale = scale; + this.equipped = equipped; + this.location = new ResourceLocation(location); + this.previewLocation = new ResourceLocation("client/preview/" + location.replace("client/", "")); + } + + /** + * This is for emotes, this will be setup at a later time. + */ + public Cosmetic(String playerId, int emoteId, CosmeticType type) { + this.playerId = playerId; + this.emoteId = emoteId; + this.type = type; + } + + /** + * This defines the type of cosmetic that the player has. + */ + public enum CosmeticType { + WINGS("dragon_wings"), + CAPE("cape"), + EMOTE("emote"); + + @Getter private final String typeName; + CosmeticType(String typeName) { + this.typeName = typeName; + } + + public static CosmeticType get(String name) { + for (Cosmetic.CosmeticType cosmetic : CosmeticType.values()) { + if (cosmetic.getTypeName().equals(name)) { + return cosmetic; + } + } + return null; + } + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/CosmeticManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/CosmeticManager.java new file mode 100644 index 0000000..05e19d8 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/CosmeticManager.java @@ -0,0 +1,208 @@ +package com.cheatbreaker.client.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.data.AnimationStage; +import com.cheatbreaker.client.cosmetic.type.emote.*; +import com.cheatbreaker.client.event.impl.keyboard.KeyboardEvent; +import com.cheatbreaker.client.event.impl.mouse.ClickStateEvent; +import com.cheatbreaker.client.event.impl.render.PlayerAnimationEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.network.websocket.shared.WSPacketEmote; +import com.cheatbreaker.client.ui.cosmetic.EmoteGUI; +import com.google.common.collect.ImmutableBiMap; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelPlayer; +import net.minecraft.entity.player.EntityPlayer; +import org.lwjgl.input.Keyboard; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +@Getter +@Setter +public class CosmeticManager { + + private final List capes = new ArrayList<>(); + private final List wings = new ArrayList<>(); + private final List emotes = new ArrayList<>(); + + private final Map activeEmotes = new ConcurrentHashMap<>(); + private final Map models = new ConcurrentHashMap<>(); + + private List ownedEmotes = new ArrayList<>(); + + private boolean doingEmote; + private boolean sendingEmote; + private Emote currentEmote; + + public static final ImmutableBiMap CLIENT_EMOTES = ImmutableBiMap.builder() + .put(0, WaveEmote.class) + .put(1, HandsUpEmote.class) + .put(2, FlossEmote.class) + .put(3, DabEmote.class) + .put(4, TPoseEmote.class) + .put(5, ShrugEmote.class) + .put(6, FacepalmEmote.class) + .put(7, NarutoRunEmote.class) + .put(8, SuperFacepalmEmote.class) + .build(); + + public CosmeticManager() { + ownedEmotes.addAll(new ArrayList<>(emotes)); + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created Cosmetic Manager"); + + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + CheatBreaker.getInstance().getEventBus().addEvent(PlayerAnimationEvent.class, this::onPlayerAnimation); + + CheatBreaker.getInstance().getEventBus().addEvent(ClickStateEvent.class, (event) -> { + if (event.getMouseButton() == 0 && event.isState()) this.stopEmote(Minecraft.getMinecraft().thePlayer); + }); + + CheatBreaker.getInstance().getEventBus().addEvent(KeyboardEvent.class, (event) -> { + if (Minecraft.getMinecraft().currentScreen == null && !this.ownedEmotes.isEmpty() + && event.getPressed() == Keyboard.KEY_B) { + Minecraft.getMinecraft().displayGuiScreen(new EmoteGUI(event.getPressed())); + } + }); + } + + public List getFullCosmeticList() { + ArrayList cosmetics = new ArrayList<>(); + + // Adds the wings first so that they are at the front of the list always. + for (Cosmetic wing : this.wings) { + if (!wing.getPlayerId().equals(Minecraft.getMinecraft().getSession().getPlayerID())) continue; + cosmetics.add(wing); + } + + for (Cosmetic cape : this.capes) { + if (!cape.getPlayerId().equals(Minecraft.getMinecraft().getSession().getPlayerID())) continue; + cosmetics.add(cape); + } + + return cosmetics; + } + + public Cosmetic getActiveCape(UUID uuid) { + for (Cosmetic cape : this.getCapes()) { + if (cape.isEquipped() && uuid.toString().equals(cape.getPlayerId())) { + return cape; + } + } + return null; + } + + public Cosmetic getActiveWings(UUID uuid) { + for (Cosmetic wing : this.getWings()) { + if (wing.isEquipped() && uuid.toString().equals(wing.getPlayerId())) { + return wing; + } + } + return null; + } + + public void clearCosmetics(String uuid) { + this.getCapes().removeIf(cape -> cape.getPlayerId().equals(uuid)); + this.getWings().removeIf(wings -> wings.getPlayerId().equals(uuid)); + } + + public void playEmote(Emote emote) { + if (this.hasEmote(emote)) { + if (this.doingEmote) { + this.doingEmote = false; + this.sendingEmote = true; + } + + currentEmote = emote; + this.stopEmote(Minecraft.getMinecraft().thePlayer); + int emoteId = (Integer) CLIENT_EMOTES.inverse().get(emote.getClass()); + CheatBreaker.getInstance().getWsNetHandler().sendPacket( + new WSPacketEmote(Minecraft.getMinecraft().thePlayer.getUniqueID(), emoteId)); + } + } + + private boolean hasEmote(Emote var1) { + return this.emotes.contains(CLIENT_EMOTES.inverse().get(var1)); + } + + public Emote getEmoteById(int var1) { + if (!CLIENT_EMOTES.containsKey(var1)) { + return null; + } else { + try { + return (Emote) ((Class) CLIENT_EMOTES.get(var1)).newInstance(); + } catch (Exception var3) { + var3.printStackTrace(); + return null; + } + } + } + + public void playEmote(AbstractClientPlayer player, Emote var2) { + if (player.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) { + if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 || this.sendingEmote) { + Minecraft.getMinecraft().gameSettings.thirdPersonView = 1; + this.doingEmote = true; + } + + this.sendingEmote = false; + } + + currentEmote = var2; + this.activeEmotes.putIfAbsent(player.getUniqueID(), var2); + } + + public void stopEmote(AbstractClientPlayer var1) { + if (this.activeEmotes.containsKey(var1.getUniqueID())) { + currentEmote = null; + Emote var2 = this.activeEmotes.get(var1.getUniqueID()); + var2.endEmote(var1); + this.activeEmotes.remove(var1.getUniqueID()); + } + } + + private void onTick(TickEvent event) { + if (!this.activeEmotes.isEmpty()) { + ArrayList list = new ArrayList<>(); + this.activeEmotes.forEach((uuid, emote) -> { + if (Minecraft.getMinecraft().theWorld != null) { + EntityPlayer var3 = Minecraft.getMinecraft().theWorld.getPlayerEntityByUUID(uuid); + if (emote.isEmoteOver()) { + currentEmote = null; + activeEmotes.remove(var3.getUniqueID()); + emote.endEmote((AbstractClientPlayer) var3); + ModelPlayer modelPlayer = this.getModels().get(uuid); + if (modelPlayer == null || modelPlayer.bipedCape == null) + return; + + modelPlayer.bipedCape.rotateAngleZ = 0; + this.getModels().remove(uuid); + list.add(uuid); + } + } + }); + list.forEach(this.activeEmotes::remove); + } + } + + private void onPlayerAnimation(PlayerAnimationEvent event) { + Emote activeEmotes = this.activeEmotes.get(event.getPlayer().getUniqueID()); + if (activeEmotes != null) { + if (event.getStage() == AnimationStage.START) { + activeEmotes.playEmote(event.getPlayer(), event.getModel(), event.getPartialTicks()); + } else { + activeEmotes.tickEmote(event.getPlayer(), event.getPartialTicks()); + } + } + } + + public List getOwnedEmotes() { + return ownedEmotes; + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/Emote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/Emote.java new file mode 100644 index 0000000..e3d6e74 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/Emote.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.AbstractFade; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; +import net.minecraft.util.ResourceLocation; + +import java.util.UUID; + +@Getter +public abstract class Emote { + private final String name; + protected final AbstractFade duration; + private final ResourceLocation resourceLocation; + + public Emote(String name, AbstractFade duration) { + this.duration = duration; + duration.startAnimation(); + this.name = name; + this.resourceLocation = new ResourceLocation("client/emote/" + name.toLowerCase().replace("-", "").replace(" ", "") + ".png"); + } + + public abstract void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks); + + public abstract void tickEmote(AbstractClientPlayer player, float partialTicks); + + protected void endEmote(AbstractClientPlayer abstractClientPlayer) { + if (abstractClientPlayer == null) { + return; + } + + if (abstractClientPlayer.getUniqueID().equals(UUID.fromString(Minecraft.getMinecraft().getSession().getPlayerID()))) { + if (CheatBreaker.getInstance().getCosmeticManager().isDoingEmote()) { + Minecraft.getMinecraft().gameSettings.thirdPersonView = 0; + CheatBreaker.getInstance().getCosmeticManager().setDoingEmote(false); + CheatBreaker.getInstance().getCosmeticManager().setSendingEmote(false); + } + } + } + + public boolean isEmoteOver() { + return this.duration.isOver(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/data/AnimationStage.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/data/AnimationStage.java new file mode 100644 index 0000000..b99f7f0 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/data/AnimationStage.java @@ -0,0 +1,9 @@ +package com.cheatbreaker.client.cosmetic.data; + +/** + * These are used for the PlayerAnimationEvent + */ +public enum AnimationStage { + START, + END +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/profile/ClientProfile.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/profile/ClientProfile.java new file mode 100644 index 0000000..aec851b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/profile/ClientProfile.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.cosmetic.profile; + +import lombok.*; + +/** + * Defines the CheatBreaker Client's player profile. + * This is currently only used for Player Icons, however will probably be used for more later. + */ +@Getter +@AllArgsConstructor +public class ClientProfile { + @Setter private String username; + private int color; + private int color2; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/profile/ProfileHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/profile/ProfileHandler.java new file mode 100644 index 0000000..0c0a4ac --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/profile/ProfileHandler.java @@ -0,0 +1,62 @@ +package com.cheatbreaker.client.cosmetic.profile; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import lombok.Getter; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * Handles everything to do with ClientProfiles. + */ +public class ProfileHandler { + @Getter private final Map wsOnlineUsers = new HashMap<>(); + + /** + * Returns a ClientProfile based on a player's UUID. + */ + public ClientProfile getProfile(String playerId) { + return this.getWsOnlineUsers().get(UUID.fromString(playerId)); + } + + /** + * Returns a dashed UUID since 1.7 is weird as fuck. + */ + public String recompileUUID(String uuidIn) { + return UUID.fromString(uuidIn.replaceFirst ( + "(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", + "$1-$2-$3-$4-$5" + )).toString(); + } + + public boolean validate(String target, boolean username) { + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + + if (username) { + try { + for (ClientProfile profile : this.wsOnlineUsers.values()) { + if (target.contains(profile.getUsername()) || (nickHider.hideRealName.getBooleanValue() && target.contains(nickHider.customNameString.getStringValue()))) { + return true; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } else { + try { + for (UUID playerId : this.wsOnlineUsers.keySet()) { +// System.out.println(target); +// System.out.println(playerId); + if (UUID.fromString(target).equals(playerId)) { + return true; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return false; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/DabEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/DabEmote.java new file mode 100644 index 0000000..d1d3350 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/DabEmote.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class DabEmote extends Emote { + private final MinMaxFade name = new MinMaxFade(250L); + private final MinMaxFade resourceLoc = new MinMaxFade(250L); + + public DabEmote() { + super("Dab", new MinMaxFade(1000L)); + this.name.startAnimation(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + float var4 = 1.0F; + if (this.name.getDuration() > this.duration.llIIllIlIlllllIlIllIIlIll()) { + var4 = this.name.getFadeAmount(); + } else if (this.duration.getRemainingTime() <= this.resourceLoc.getDuration()) { + if (!this.resourceLoc.isTimeNotAtZero()) { + this.resourceLoc.startAnimation(); + } + + var4 = 1.0F - this.resourceLoc.getFadeAmount(); + } + + model.bipedRightArm.rotateAngleX = (float) Math.toRadians(-90.0F * var4); + model.bipedRightArm.rotateAngleY = (float) Math.toRadians(-35.0F * var4); + model.bipedLeftArm.rotateAngleX = (float) Math.toRadians(15.0F * var4); + model.bipedLeftArm.rotateAngleY = (float) Math.toRadians(15.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(-110.0F * var4); + + model.bipedRightArmwear.rotateAngleX = (float) Math.toRadians(-90.0F * var4); + model.bipedRightArmwear.rotateAngleY = (float) Math.toRadians(-35.0F * var4); + model.bipedLeftArmwear.rotateAngleX = (float) Math.toRadians(15.0F * var4); + model.bipedLeftArmwear.rotateAngleY = (float) Math.toRadians(15.0F * var4); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(-110.0F * var4); + + float var5 = player.rotationPitch; + float var6 = player.prevRenderYawOffset - player.rotationYaw; + + model.bipedHead.rotateAngleX = (float) Math.toRadians(-var5 * var4) + (float) Math.toRadians(45.0F * var4 + var5); + model.bipedHead.rotateAngleY = (float) Math.toRadians(var6 * var4) + (float) Math.toRadians(35.0F * var4 - var6); + model.bipedHeadwear.rotateAngleX = (float) Math.toRadians(-var5 * var4) + (float) Math.toRadians(45.0F * var4 + var5); + model.bipedHeadwear.rotateAngleY = (float) Math.toRadians(var6 * var4) + (float) Math.toRadians(35.0F * var4 - var6); + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FacepalmEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FacepalmEmote.java new file mode 100644 index 0000000..4e0ce34 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FacepalmEmote.java @@ -0,0 +1,73 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class FacepalmEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(150L); + private final ExponentialFade endTransitionTime = new ExponentialFade(200L); + private final CosineFade headShakeTime = new CosineFade(300L); + private final float headXRotationAngle = (float) Math.toRadians(45.0); + private final float rightArmYRotationAngle = (float) Math.toRadians(-30.0); + private final float rightArmXRotationAngle = (float) Math.toRadians(-100.0); + + public FacepalmEmote() { + super("Facepalm", new FloatFade(2000L)); + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + float fadeAmount = this.startTransitionTime.getFadeAmount(); + if (!this.startTransitionTime.isTimeNotAtZero() && this.duration.llIIllIlIlllllIlIllIIlIll() >= 150L) { + this.startTransitionTime.startAnimation(); + } + + if (this.startTransitionTime.isTimeNotAtZero()) { + if (this.startTransitionTime.isOver() && !this.headShakeTime.isZeroOrLess() && !this.endTransitionTime.isTimeNotAtZero()) { + this.headShakeTime.startAnimation(); + } + + float var5 = model.bipedHead.rotateAngleX; + float var6 = model.bipedHead.rotateAngleY; + + model.bipedHead.rotateAngleZ = -((float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHeadwear.rotateAngleZ = -((float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHead.rotateAngleY = (float) Math.toRadians(10.0) * fadeAmount - (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHeadwear.rotateAngleY = (float) Math.toRadians(10.0) * fadeAmount - (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHead.rotateAngleX = this.headXRotationAngle * fadeAmount; + model.bipedHeadwear.rotateAngleX = this.headXRotationAngle * fadeAmount; + model.bipedRightArm.rotateAngleY = this.rightArmYRotationAngle * fadeAmount - (this.endTransitionTime.isTimeNotAtZero() ? 0.0F : (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedRightArm.rotateAngleX = this.rightArmXRotationAngle * fadeAmount; + + model.bipedRightArmwear.rotateAngleY = this.rightArmYRotationAngle * fadeAmount - (this.endTransitionTime.isTimeNotAtZero() ? 0.0F : (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedRightArmwear.rotateAngleX = this.rightArmXRotationAngle * fadeAmount; + + if (!this.endTransitionTime.isTimeNotAtZero() && this.duration.getRemainingTime() <= this.endTransitionTime.getDuration()) { + this.endTransitionTime.startAnimation(); + } + + if (this.endTransitionTime.isTimeNotAtZero()) { + fadeAmount = this.endTransitionTime.getFadeAmount(); + model.bipedHead.rotateAngleY = var6 * fadeAmount; + model.bipedHeadwear.rotateAngleY = var6 * fadeAmount; + model.bipedHead.rotateAngleZ = 0.0F; + model.bipedHeadwear.rotateAngleZ = 0.0F; + model.bipedHead.rotateAngleX -= (this.headXRotationAngle - var5) * fadeAmount; + model.bipedHeadwear.rotateAngleX -= (this.headXRotationAngle - var5) * fadeAmount; + + model.bipedRightArm.rotateAngleY -= this.rightArmYRotationAngle * fadeAmount; + model.bipedRightArm.rotateAngleX -= this.rightArmXRotationAngle * fadeAmount; + + model.bipedRightArmwear.rotateAngleY -= this.rightArmYRotationAngle * fadeAmount; + model.bipedRightArmwear.rotateAngleX -= this.rightArmXRotationAngle * fadeAmount; + } + + } + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FlossEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FlossEmote.java new file mode 100644 index 0000000..49e0da4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FlossEmote.java @@ -0,0 +1,137 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class FlossEmote extends Emote { + private final ExponentialFade swapTransitionTime = new ExponentialFade(375L); + private final CosineFade swingTransitionTime = new CosineFade(375L); + private final CosineFade bodyRotationTransitionTime = new CosineFade(250L); + boolean swap = false; + private FlossStage flossStage; + + public FlossEmote() { + super("Floss", new FloatFade(7500L)); + this.bodyRotationTransitionTime.startAnimation(); + this.flossStage = FlossStage.LEFT_TO_RIGHT; + } + + @Override + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + @Override + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + CheatBreaker.getInstance().getCosmeticManager().getModels().put(player.getUniqueID(), model); + + if (!this.swapTransitionTime.isTimeNotAtZero()) { + if ((double) this.bodyRotationTransitionTime.getFadeAmount() >= 0.5) { + this.swapTransitionTime.startAnimation(); + this.swingTransitionTime.startAnimation(); + } + } else if (this.swapTransitionTime.isOver()) { + this.swapTransitionTime.startAnimation(); + this.swingTransitionTime.startAnimation(); + this.flossStage = this.getFlossStage(); + } + if (this.bodyRotationTransitionTime.isOver()) { + this.swap = !this.swap; + this.bodyRotationTransitionTime.startAnimation(); + } + float f2 = this.swapTransitionTime.getFadeAmount(); + float f3 = this.swingTransitionTime.getFadeAmount(); + model.bipedRightArm.rotateAngleX = (float) Math.toRadians((float) (this.flossStage == FlossStage.RIGHT_TO_BACK ? 45 : -45) * f3); + model.bipedLeftArm.rotateAngleX = (float) Math.toRadians((float) (this.flossStage == FlossStage.LEFT_TO_BACK ? 45 : -45) * f3); + + model.bipedRightArmwear.rotateAngleX = (float) Math.toRadians((float) (this.flossStage == FlossStage.RIGHT_TO_BACK ? 45 : -45) * f3); + model.bipedLeftArmwear.rotateAngleX = (float) Math.toRadians((float) (this.flossStage == FlossStage.LEFT_TO_BACK ? 45 : -45) * f3); + float f4 = 150.0f; + float f5 = f4 / 2.0f; + switch (this.flossStage) { + + case LEFT_TO_RIGHT: + model.bipedRightArm.rotateAngleZ = (float) Math.toRadians(f4 * f2 - f5); + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(f4 * f2 - f5); + + model.bipedRightArmwear.rotateAngleZ = (float) Math.toRadians(f4 * f2 - f5); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(f4 * f2 - f5); + break; + + case RIGHT_TO_BACK: + model.bipedRightArm.rotateAngleZ = (float) Math.toRadians(f5 - f5 * f3); + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(f5 - f5 * f3); + + model.bipedRightArmwear.rotateAngleZ = (float) Math.toRadians(f5 - f5 * f3); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(f5 - f5 * f3); + break; + + case RIGHT_TO_LEFT: + model.bipedRightArm.rotateAngleZ = (float) Math.toRadians(-f4 * f2 + f5); + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(-f4 * f2 + f5); + + model.bipedRightArmwear.rotateAngleZ = (float) Math.toRadians(-f4 * f2 + f5); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(-f4 * f2 + f5); + break; + + case LEFT_TO_BACK: + model.bipedRightArm.rotateAngleZ = (float) Math.toRadians(f5 * f3 - f5); + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(f5 * f3 - f5); + + model.bipedRightArmwear.rotateAngleZ = (float) Math.toRadians(f5 * f3 - f5); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(f5 * f3 - f5); + + } + + f3 = this.bodyRotationTransitionTime.getFadeAmount(); + if (this.swap) { + model.bipedBody.rotateAngleZ = (float) Math.toRadians(-15.0f * f3); + model.bipedCape.rotateAngleZ = (float) Math.toRadians(15.0f * f3); + model.bipedRightLeg.rotateAngleZ = (float) Math.toRadians(15.0f * f3); + model.bipedLeftLeg.rotateAngleZ = (float) Math.toRadians(15.0f * f3); + model.bipedLeftLeg.offsetX = 0.2f * f3; + model.bipedRightLeg.offsetX = 0.2f * f3; + + model.bipedBodyWear.rotateAngleZ = (float) Math.toRadians(-15.0f * f3); + model.bipedRightLegwear.rotateAngleZ = (float) Math.toRadians(15.0f * f3); + model.bipedLeftLegwear.rotateAngleZ = (float) Math.toRadians(15.0f * f3); + model.bipedLeftLegwear.offsetX = 0.2f * f3; + model.bipedRightLegwear.offsetX = 0.2f * f3; + } else { + model.bipedBody.rotateAngleZ = (float) Math.toRadians(15.0f * f3); + model.bipedCape.rotateAngleZ = (float) Math.toRadians(-15.0f * f3); + model.bipedRightLeg.rotateAngleZ = (float) Math.toRadians(-15.0f * f3); + model.bipedLeftLeg.rotateAngleZ = (float) Math.toRadians(-15.0f * f3); + model.bipedLeftLeg.offsetX = -0.2f * f3; + model.bipedRightLeg.offsetX = -0.2f * f3; + + model.bipedBodyWear.rotateAngleZ = (float) Math.toRadians(15.0f * f3); + model.bipedRightLegwear.rotateAngleZ = (float) Math.toRadians(-15.0f * f3); + model.bipedLeftLegwear.rotateAngleZ = (float) Math.toRadians(-15.0f * f3); + model.bipedLeftLegwear.offsetX = -0.2f * f3; + model.bipedRightLegwear.offsetX = -0.2f * f3; + } + } + + private FlossStage getFlossStage() { + switch (this.flossStage) { + default: + return FlossStage.RIGHT_TO_BACK; + case RIGHT_TO_BACK: + return FlossStage.RIGHT_TO_LEFT; + case RIGHT_TO_LEFT: + return FlossStage.LEFT_TO_BACK; + case LEFT_TO_BACK: + } + return FlossStage.LEFT_TO_RIGHT; + } + + enum FlossStage { + LEFT_TO_RIGHT, RIGHT_TO_LEFT, RIGHT_TO_BACK, LEFT_TO_BACK + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/HandsUpEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/HandsUpEmote.java new file mode 100644 index 0000000..494a59b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/HandsUpEmote.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class HandsUpEmote extends Emote { + private final MinMaxFade startTransitionTime = new MinMaxFade(250L); + private final MinMaxFade endTransitionTime = new MinMaxFade(250L); + + public HandsUpEmote() { + super("Hands Up", new FloatFade(2000L)); + this.startTransitionTime.startAnimation(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + float var4 = 1.0F; + if (this.startTransitionTime.getDuration() > this.duration.llIIllIlIlllllIlIllIIlIll()) { + var4 = this.startTransitionTime.getFadeAmount(); + } else if (this.duration.getRemainingTime() <= this.endTransitionTime.getDuration()) { + if (!this.endTransitionTime.isTimeNotAtZero()) { + this.endTransitionTime.startAnimation(); + } + + var4 = 1.0F - this.endTransitionTime.getFadeAmount(); + } + + model.bipedLeftArm.rotateAngleX = (float) Math.toRadians(-180.0F * var4); + model.bipedRightArm.rotateAngleX = (float) Math.toRadians(-180.0F * var4); + model.bipedRightArm.rotateAngleZ = (float) Math.toRadians(-15.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(15.0F * var4); + + model.bipedLeftArmwear.rotateAngleX = (float) Math.toRadians(-180.0F * var4); + model.bipedRightArmwear.rotateAngleX = (float) Math.toRadians(-180.0F * var4); + model.bipedRightArmwear.rotateAngleZ = (float) Math.toRadians(-15.0F * var4); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(15.0F * var4); + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/NarutoRunEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/NarutoRunEmote.java new file mode 100644 index 0000000..01b74d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/NarutoRunEmote.java @@ -0,0 +1,60 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class NarutoRunEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(300L); + private final MinMaxFade endTransitionTime = new MinMaxFade(500L); + + public NarutoRunEmote() { + super("Naruto Run", new MinMaxFade(10000L)); + this.startTransitionTime.startAnimation(); + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + model.bipedRightArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + model.bipedLeftArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + + model.bipedRightArmwear.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + model.bipedLeftArmwear.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + + if (this.startTransitionTime.isZeroOrLess()) { + + model.bipedRightArm.rotateAngleX = (float) Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + model.bipedLeftArm.rotateAngleX = (float) Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + + model.bipedRightArmwear.rotateAngleX = (float) Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + model.bipedLeftArmwear.rotateAngleX = (float) Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + + } else if (this.duration.getRemainingTime() <= this.endTransitionTime.getDuration()) { + + if (!this.endTransitionTime.isTimeNotAtZero()) { + this.endTransitionTime.startAnimation(); + } + + model.bipedRightArm.rotateAngleX = Math.max((float) Math.toRadians(90.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArm.rotateAngleZ); + model.bipedLeftArm.rotateAngleX = Math.min((float) Math.toRadians(-270.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArm.rotateAngleZ); + + model.bipedRightArmwear.rotateAngleX = Math.max((float) Math.toRadians(90.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArmwear.rotateAngleZ); + model.bipedLeftArmwear.rotateAngleX = Math.min((float) Math.toRadians(-270.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArmwear.rotateAngleZ); + + } else { + + player.setSneaking(true); + model.bipedRightArm.rotateAngleX = (float) Math.toRadians(90.0); + model.bipedLeftArm.rotateAngleX = (float) Math.toRadians(90.0); + + model.bipedRightArmwear.rotateAngleX = (float) Math.toRadians(90.0); + model.bipedLeftArmwear.rotateAngleX = (float) Math.toRadians(90.0); + + } + + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/ShrugEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/ShrugEmote.java new file mode 100644 index 0000000..12b253b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/ShrugEmote.java @@ -0,0 +1,26 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class ShrugEmote extends Emote { + public ShrugEmote() { + super("Shrug", new CosineFade(500L)); + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + model.bipedRightArm.offsetY = -0.2F * this.duration.getFadeAmount(); + model.bipedLeftArm.offsetY = -0.2F * this.duration.getFadeAmount(); + + model.bipedRightArmwear.offsetY = -0.2F * this.duration.getFadeAmount(); + model.bipedLeftArmwear.offsetY = -0.2F * this.duration.getFadeAmount(); + + model.bipedHead.offsetY = 0.05F * this.duration.getFadeAmount(); + model.bipedHeadwear.offsetY = 0.05F * this.duration.getFadeAmount(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/SuperFacepalmEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/SuperFacepalmEmote.java new file mode 100644 index 0000000..f8be696 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/SuperFacepalmEmote.java @@ -0,0 +1,71 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class SuperFacepalmEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(1000L); + private final ExponentialFade endTransitionTime = new ExponentialFade(2000L); + private final CosineFade headShakeTime = new CosineFade(100L); + private final float headXRotationAngle = (float) Math.toRadians(45.0); + private final float rightArmYRotationAngle = (float) Math.toRadians(-30.0); + private final float rightArmXRotationAngle = (float) Math.toRadians(-100.0); + + public SuperFacepalmEmote() { + super("Super Facepalm", new FloatFade(20000L)); + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + float var4 = this.startTransitionTime.getFadeAmount(); + if (!this.startTransitionTime.isTimeNotAtZero() && this.duration.llIIllIlIlllllIlIllIIlIll() >= 150L) { + this.startTransitionTime.startAnimation(); + } + + if (this.startTransitionTime.isTimeNotAtZero()) { + if (this.startTransitionTime.isOver() && !this.headShakeTime.isZeroOrLess() && !this.endTransitionTime.isTimeNotAtZero()) { + this.headShakeTime.startAnimation(); + } + + float var5 = model.bipedHead.rotateAngleX; + float var6 = model.bipedHead.rotateAngleY; + model.bipedHead.rotateAngleZ = -((float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHeadwear.rotateAngleZ = -((float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHead.rotateAngleY = (float) Math.toRadians(10.0) * var4 - (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHeadwear.rotateAngleY = (float) Math.toRadians(10.0) * var4 - (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHead.rotateAngleX = this.headXRotationAngle * var4; + model.bipedHeadwear.rotateAngleX = this.headXRotationAngle * var4; + model.bipedRightArm.rotateAngleY = this.rightArmYRotationAngle * var4 - (this.endTransitionTime.isTimeNotAtZero() ? 0.0F : (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedRightArm.rotateAngleX = this.rightArmXRotationAngle * var4; + + model.bipedRightArmwear.rotateAngleY = this.rightArmYRotationAngle * var4 - (this.endTransitionTime.isTimeNotAtZero() ? 0.0F : (float) Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedRightArmwear.rotateAngleX = this.rightArmXRotationAngle * var4; + + if (!this.endTransitionTime.isTimeNotAtZero() && this.duration.getRemainingTime() <= this.endTransitionTime.getDuration()) { + this.endTransitionTime.startAnimation(); + } + + if (this.endTransitionTime.isTimeNotAtZero()) { + var4 = this.endTransitionTime.getFadeAmount(); + model.bipedHead.rotateAngleY = var6 * var4; + model.bipedHeadwear.rotateAngleY = var6 * var4; + model.bipedHead.rotateAngleZ = 0.0F; + model.bipedHeadwear.rotateAngleZ = 0.0F; + model.bipedHead.rotateAngleX -= (this.headXRotationAngle - var5) * var4; + model.bipedHeadwear.rotateAngleX -= (this.headXRotationAngle - var5) * var4; + model.bipedRightArm.rotateAngleY -= this.rightArmYRotationAngle * var4; + model.bipedRightArm.rotateAngleX -= this.rightArmXRotationAngle * var4; + + model.bipedRightArmwear.rotateAngleY -= this.rightArmYRotationAngle * var4; + model.bipedRightArmwear.rotateAngleX -= this.rightArmXRotationAngle * var4; + } + + } + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/TPoseEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/TPoseEmote.java new file mode 100644 index 0000000..d2cc3d2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/TPoseEmote.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class TPoseEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(600L); + private final MinMaxFade endTransitionTime = new MinMaxFade(600L); + + public TPoseEmote() { + super("T-Pose", new MinMaxFade(5000L)); + this.startTransitionTime.startAnimation(); + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + model.bipedRightArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + model.bipedLeftArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + + model.bipedRightArmwear.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + model.bipedLeftArmwear.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + + if (this.startTransitionTime.isZeroOrLess()) { + model.bipedRightArm.rotateAngleZ = (float) Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + model.bipedRightArmwear.rotateAngleZ = (float) Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(-90.0F * this.startTransitionTime.getFadeAmount()); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(-90.0F * this.startTransitionTime.getFadeAmount()); + + } else if (this.duration.getRemainingTime() <= this.endTransitionTime.getDuration()) { + if (!this.endTransitionTime.isTimeNotAtZero()) { + this.endTransitionTime.startAnimation(); + } + + model.bipedLeftArm.rotateAngleZ = Math.min((float) Math.toRadians(-90.0F + 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedLeftArm.rotateAngleZ); + model.bipedLeftArmwear.rotateAngleZ = Math.min((float) Math.toRadians(-90.0F + 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedLeftArmwear.rotateAngleZ); + + model.bipedRightArm.rotateAngleZ = Math.max((float) Math.toRadians(90.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArm.rotateAngleZ); + model.bipedRightArmwear.rotateAngleZ = Math.max((float) Math.toRadians(90.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArmwear.rotateAngleZ); + } else { + model.bipedRightArm.rotateAngleZ = (float) Math.toRadians(90.0); + model.bipedRightArmwear.rotateAngleZ = (float) Math.toRadians(90.0); + + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(-90.0); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(-90.0); + } + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/WaveEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/WaveEmote.java new file mode 100644 index 0000000..370f4cd --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/WaveEmote.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +public class WaveEmote extends Emote { + private final FloatFade name = new FloatFade(250L); + private final FloatFade resourceLoc = new FloatFade(250L); + private final CosineFade waveTransitionTime = new CosineFade(500L); + + public WaveEmote() { + super("Wave", new FloatFade(2000L)); + this.name.startAnimation(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + public void playEmote(AbstractClientPlayer player, ModelPlayer model, float partialTicks) { + float var4 = 1.0F; + float var5 = 0.5F; + if (this.name.getDuration() > this.duration.llIIllIlIlllllIlIllIIlIll()) { + var4 = this.name.getFadeAmount(); + } else if (this.duration.getRemainingTime() <= this.resourceLoc.getDuration()) { + if (!this.resourceLoc.isTimeNotAtZero()) { + this.resourceLoc.startAnimation(); + } + + var4 = 1.0F - this.resourceLoc.getFadeAmount(); + } else { + if (!this.waveTransitionTime.isTimeNotAtZero()) { + this.waveTransitionTime.startAnimationFromStartOrEnd(125.0F); + this.waveTransitionTime.loopAnimation(); + } + + var5 = this.waveTransitionTime.getFadeAmount(); + } + + model.bipedLeftArm.rotateAngleX = (float) Math.toRadians(-150.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float) Math.toRadians(40.0F * var5 - 20.0F); + + model.bipedLeftArmwear.rotateAngleX = (float) Math.toRadians(-150.0F * var4); + model.bipedLeftArmwear.rotateAngleZ = (float) Math.toRadians(40.0F * var5 - 20.0F); + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelAnimatedCape.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelAnimatedCape.java new file mode 100644 index 0000000..d679da4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelAnimatedCape.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.cosmetic.type.model; + +import net.minecraft.client.model.ModelBiped; + +public class CosmeticModelAnimatedCape extends ModelBiped { + + public CosmeticModelAnimatedCape() { + + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelWings.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelWings.java new file mode 100644 index 0000000..e035ade --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelWings.java @@ -0,0 +1,71 @@ +package com.cheatbreaker.client.cosmetic.type.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +/** + * This is the wings cosmetic that will appear on player's backs + * if they own them and have them equipped. + */ +public class CosmeticModelWings extends ModelBase { + private final ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); + private final ModelRenderer wing; + private final ModelRenderer wingTip; + + public CosmeticModelWings(float f) { + this.textureWidth = 256; + this.textureHeight = 256; + + this.setTextureOffset("wing.skin", -56, 88); + this.setTextureOffset("wingtip.skin", -56, 144); + this.setTextureOffset("wing.bone", 112, 88); + this.setTextureOffset("wingtip.bone", 112, 136); + + this.wing = new ModelRenderer(this, "wing"); + this.wing.setRotationPoint(-12, 5, 2.0f); + this.wing.addBox("bone", (float) -56, (float) -4, (float) -4, 56, 8, 8); + this.wing.addBox("skin", (float) -56, 0.0f, 2.0f, 56, 0, 56); + + this.wingTip = new ModelRenderer(this, "wingtip"); + this.wingTip.setRotationPoint(-56, 0.0f, 0.0f); + this.wingTip.addBox("bone", (float) -56, (float) -2, (float) -2, 56, 4, 4); + this.wingTip.addBox("skin", (float) -56, 0.0f, 2.0f, 56, 0, 56); + this.wing.addChild(this.wingTip); + } + + public void render(Entity entity, float f, float f2, float f3, float f4, float f5, float f6, float f7, ResourceLocation resourceLocation) { + if (!(entity instanceof EntityPlayer)) { + return; + } + + Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); + GL11.glPushMatrix(); + GL11.glScaled(f7, f7, f7); + GL11.glRotatef(15, 1.0f, 0.0f, 0.0f); + GL11.glTranslatef(0.0f, 0.5f, 0.25f); + + float f8 = (float) (System.currentTimeMillis() % 2000L) / 2000.0f * (float) Math.PI * 2.0f; + + for (int i = 0; i < 2; ++i) { + GL11.glEnable(2884); + this.wing.rotateAngleX = 1.1f * -0.11363636f - (float) Math.cos(f8) * (0.175f * 1.1428572f); + this.wing.rotateAngleY = 1.069853f * 0.7010309f; + this.wing.rotateAngleZ = (float) (Math.sin(f8) + 0.125F) * 0.8F; + this.wingTip.rotateAngleZ = (float) (Math.sin(f8 + 2.0f) + 0.5) * 0.75f; + this.wing.render(f6); + GL11.glScalef(-1, 1.0f, 1.0f); + + if (i != 0) continue; + GL11.glCullFace(1028); + } + + GL11.glPopMatrix(); + GL11.glCullFace(1029); + GL11.glDisable(2884); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/EventBus.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/EventBus.java new file mode 100644 index 0000000..81c4e83 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/EventBus.java @@ -0,0 +1,78 @@ +package com.cheatbreaker.client.event; + +import com.cheatbreaker.client.CheatBreaker; + +import java.io.Serializable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Consumer; + +/** + * CheatBreaker's Event Manager. + */ +public class EventBus { + + public EventBus() + { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created EventBus"); + } + + /** + * Currently registered events. + */ + private final ConcurrentHashMap, CopyOnWriteArrayList>> registeredEvents = new ConcurrentHashMap<>(); + + /** + * Registers an event. + */ + public boolean addEvent(Class clazz, Consumer consumer) { + return this.registeredEvents.computeIfAbsent(clazz, p0 -> new CopyOnWriteArrayList<>()).add((Consumer) consumer); + } + + /** + * Unregisters an event. + */ + public void removeEvent(final Class clazz, final Consumer consumer) { + final CopyOnWriteArrayList> list = this.registeredEvents.get(clazz); + if (list != null) list.remove(consumer); + } + + /** + * Handles the event. + */ + public void handleEvent(Event event) { + try { + for (Serializable s = event.getClass(); s != null && s != Event.class; s = ((Class) s).getSuperclass()) { + final CopyOnWriteArrayList> list = this.registeredEvents.get(s); + if (list != null) { + list.forEach(consumer -> consumer.accept(event)); + } + } + } catch (Exception ex) { + System.err.println("EventBus [" + event.getClass() + "]"); + ex.printStackTrace(); + } + } + + /** + * The event class, defines what an event is (NOTHING LOL). + */ + public static class Event { + } + + /** + * Defines the data for an event. + */ + public static class EventData extends Event { + private boolean canceled = false; + + public boolean isCanceled() { + return this.canceled; + } + + public void setCanceled(boolean canceled) { + this.canceled = canceled; + } + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/InitializationEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/InitializationEvent.java new file mode 100644 index 0000000..9155eda --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/InitializationEvent.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * Used to mainly initialize the updated resource packs menu. + */ +public class InitializationEvent extends EventBus.Event { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/chat/ChatReceivedEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/chat/ChatReceivedEvent.java new file mode 100644 index 0000000..5234824 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/chat/ChatReceivedEvent.java @@ -0,0 +1,9 @@ +package com.cheatbreaker.client.event.impl.chat; + +import com.cheatbreaker.client.event.EventBus; +import lombok.*; + +@Getter @AllArgsConstructor +public class ChatReceivedEvent extends EventBus.Event { + private final String receivedChatMessage; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/keyboard/KeyboardEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/keyboard/KeyboardEvent.java new file mode 100644 index 0000000..94a08fd --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/keyboard/KeyboardEvent.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.event.impl.keyboard; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This event is for when the keyboard is used. + */ +@Getter +@AllArgsConstructor +public class KeyboardEvent extends EventBus.Event { + private int pressed; +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/mouse/ClickEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/mouse/ClickEvent.java new file mode 100644 index 0000000..cca7aa6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/mouse/ClickEvent.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.event.impl.mouse; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This event is for when the mouse is used. + */ +@Getter +@AllArgsConstructor +public class ClickEvent extends EventBus.Event { + private final int mouseButton; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/mouse/ClickStateEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/mouse/ClickStateEvent.java new file mode 100644 index 0000000..6109d10 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/mouse/ClickStateEvent.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.event.impl.mouse; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This event is for getting the mouse button and state when the mouse is used. + */ +@Getter +@AllArgsConstructor +public class ClickStateEvent extends EventBus.Event { + private final int mouseButton; + private final boolean state; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/movement/CollisionEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/movement/CollisionEvent.java new file mode 100644 index 0000000..7ac6d30 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/movement/CollisionEvent.java @@ -0,0 +1,22 @@ +package com.cheatbreaker.client.event.impl.movement; + + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.AxisAlignedBB; + +import java.util.List; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is used for player collision, most notably used in the NoClip staff module. + */ +@Getter +@AllArgsConstructor +public class CollisionEvent extends EventBus.EventData { + private List boxes; + private double x; + private double y; + private double z; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/movement/PlayerLookEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/movement/PlayerLookEvent.java new file mode 100644 index 0000000..2c1f540 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/movement/PlayerLookEvent.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.event.impl.movement; + +import com.cheatbreaker.client.event.EventBus; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is unused, however I believe the use is meant for tracking when a player looks at another player. + */ +public class PlayerLookEvent extends EventBus.Event { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/ChatPacketEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/ChatPacketEvent.java new file mode 100644 index 0000000..7a6fc06 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/ChatPacketEvent.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.event.impl.network; + +import com.cheatbreaker.client.event.EventBus; +import net.minecraft.network.play.server.S02PacketChat; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is fired when the player sends a chat message or receives a chat message. + */ +public class ChatPacketEvent extends EventBus.Event { + private final S02PacketChat packetIn; + + public ChatPacketEvent(S02PacketChat packetIn) { + this.packetIn = packetIn; + } + + public S02PacketChat getPacketIn() { + return this.packetIn; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/ConnectEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/ConnectEvent.java new file mode 100644 index 0000000..e0208cc --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/ConnectEvent.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.event.impl.network; + +import com.cheatbreaker.client.event.EventBus; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is fired when a player connects to a server. + */ +public class ConnectEvent extends EventBus.Event { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/DisconnectEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/DisconnectEvent.java new file mode 100644 index 0000000..035f37e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/DisconnectEvent.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.event.impl.network; + +import com.cheatbreaker.client.event.EventBus; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is fired when a player disconnects from a server. + */ +public class DisconnectEvent extends EventBus.Event { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/LoadWorldEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/LoadWorldEvent.java new file mode 100644 index 0000000..8cfbde7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/LoadWorldEvent.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.event.impl.network; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.multiplayer.WorldClient; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is fired when loading the world in, and when you change dimensions. + */ +@Getter +@AllArgsConstructor +public class LoadWorldEvent extends EventBus.Event { + private WorldClient worldClient; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/PluginMessageEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/PluginMessageEvent.java new file mode 100644 index 0000000..2947bad --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/PluginMessageEvent.java @@ -0,0 +1,18 @@ +package com.cheatbreaker.client.event.impl.network; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is fired when the server sends a custom payload to the client. + * + * The payload can mainly be defined as a custom client packet for CB-Client. + */ +@Getter +@AllArgsConstructor +public class PluginMessageEvent extends EventBus.Event { + private String channelName; + private byte[] bufferData; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/RenderWorldEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/RenderWorldEvent.java new file mode 100644 index 0000000..e9bd8f3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/network/RenderWorldEvent.java @@ -0,0 +1,22 @@ +package com.cheatbreaker.client.event.impl.network; + +import com.cheatbreaker.client.event.EventBus; + +import java.beans.ConstructorProperties; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * This is fired when rendering the world, only in for World Border's though. + */ +public class RenderWorldEvent extends EventBus.Event { + private final float partialTicks; + + public float getPartialTicks() { + return this.partialTicks; + } + + @ConstructorProperties(value = {"partialTicks"}) + public RenderWorldEvent(float partialTicks) { + this.partialTicks = partialTicks; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/GuiDrawBypassDebugEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/GuiDrawBypassDebugEvent.java new file mode 100644 index 0000000..7634bef --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/GuiDrawBypassDebugEvent.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.event.impl.render; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.gui.ScaledResolution; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * Used for the scoreboard. + */ +@AllArgsConstructor +@Getter +public class GuiDrawBypassDebugEvent extends EventBus.Event { + private ScaledResolution scaledResolution; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/GuiDrawEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/GuiDrawEvent.java new file mode 100644 index 0000000..0f15cd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/GuiDrawEvent.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.event.impl.render; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.gui.ScaledResolution; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * Used to draw a mod to the screen. + */ +@AllArgsConstructor +@Getter +public class GuiDrawEvent extends EventBus.Event { + private ScaledResolution scaledResolution; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/PlayerAnimationEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/PlayerAnimationEvent.java new file mode 100644 index 0000000..382ac18 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/PlayerAnimationEvent.java @@ -0,0 +1,21 @@ +package com.cheatbreaker.client.event.impl.render; + +import com.cheatbreaker.client.cosmetic.data.AnimationStage; +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelPlayer; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * Used for emotes and emote rendering. + */ +@AllArgsConstructor +@Getter +public class PlayerAnimationEvent extends EventBus.Event { + private final AnimationStage stage; + private final AbstractClientPlayer player; + private final ModelPlayer model; + private final float partialTicks; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/PreviewDrawEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/PreviewDrawEvent.java new file mode 100644 index 0000000..a88141b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/render/PreviewDrawEvent.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.event.impl.render; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.gui.ScaledResolution; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * Used to draw a mod preview. + */ +@AllArgsConstructor +@Getter +public class PreviewDrawEvent extends EventBus.Event { + private ScaledResolution scaledResolution; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/tick/KeepAliveEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/tick/KeepAliveEvent.java new file mode 100644 index 0000000..63ca9e7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/tick/KeepAliveEvent.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.event.impl.tick; + +import com.cheatbreaker.client.event.EventBus; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * Used only for notifcations. + */ +public class KeepAliveEvent extends EventBus.Event { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/tick/TickEvent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/tick/TickEvent.java new file mode 100644 index 0000000..6023461 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/event/impl/tick/TickEvent.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.event.impl.tick; + +import com.cheatbreaker.client.event.EventBus; + +/** + * @see com.cheatbreaker.client.event.EventBus.Event + * An event that is constantly fired every tick when a given condition is met. + */ +public class TickEvent extends EventBus.Event { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/AbstractModule.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/AbstractModule.java new file mode 100644 index 0000000..013d2d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/AbstractModule.java @@ -0,0 +1,407 @@ +package com.cheatbreaker.client.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.profile.ClientProfile; +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.event.impl.keyboard.KeyboardEvent; +import com.cheatbreaker.client.event.impl.mouse.ClickEvent; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.PreviewType; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import com.cheatbreaker.client.ui.module.AnchorHelper; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.Position; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.*; +import java.util.function.Consumer; + +/** + * @see Object (LMFAO) + * + * This Object defines the module Object of the CheatBreaker Client. + */ +@Getter @Setter +public abstract class AbstractModule { + protected Minecraft mc = Minecraft.getMinecraft(); + + private final Map, Consumer> eventMap = new HashMap<>(); + private final List defaultSettingsValues; + private final List settingsList; + + private boolean staffModule = false; + private boolean staffModuleEnabled = false; + public boolean defaultState = false; + private boolean renderHud = true; + public boolean defaultRenderHud = true; + public boolean notRenderHUD = true; + public boolean hiddenFromHud = false; + private boolean enabled = false; + private boolean wasRenderHud = false; + public boolean defaultWasRenderHud = false; + + private final String name; + private String description; + private List creators; + private List aliases; + + public String defaultGuiScale; + private String previewLabel; + + private float xTranslation = 0.0f; + private float yTranslation = 0.0f; + public float defaultXTranslation = 0.0f; + public float defaultYTranslation = 0.0f; + + public float width = 0.0f; + public float height = 0.0f; + + private float previewIconWidth; + private float previewIconHeight; + private float previewLabelSize; + + public GuiAnchor guiAnchor; + public GuiAnchor defaultGuiAnchor; + + public Setting scale; + public Setting guiScale; + public Setting toggleKeybind; + public Setting hideFromHUDKeybind; + public Setting tempHideFromHUDKeybind; + + private PreviewType previewType; + + private ResourceLocation previewIcon; + + public AbstractModule(String name) { + this.name = name; + this.settingsList = new ArrayList<>(); + this.defaultSettingsValues = new ArrayList<>(); + this.defaultGuiScale = "Global"; + this.scale = new Setting(this, "Scale", "Change the scale of the mod.").setValue(1.0f).setMinMax(0.5f, 1.5f).setUnit("x").setCenterLabel("1.0x"); + this.guiScale = new Setting(this, "GUI Scale", "Change the scale of the mod.").setValue(defaultGuiScale).acceptedStringValues("Global", "Default", "Small", "Normal", "Large", "Auto").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.toggleKeybind = new Setting(this, "Toggle Mod Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideFromHUDKeybind = new Setting(this, "Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.tempHideFromHUDKeybind = new Setting(this, "Temp Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.registerStaticEvent(KeyboardEvent.class, this::onKeyPress); + this.registerStaticEvent(ClickEvent.class, this::onMousePress); + } + + public AbstractModule(String name, String defaultGuiScale) { + this.name = name; + this.settingsList = new ArrayList<>(); + this.defaultSettingsValues = new ArrayList<>(); + this.defaultGuiScale = defaultGuiScale; + this.scale = new Setting(this, "Scale", "Change the scale of the mod.").setValue(1.0f).setMinMax(0.5f, 1.5f).setUnit("x").setCenterLabel("1.0x"); + this.guiScale = new Setting(this, "GUI Scale", "Change the scale of the mod.").setValue(defaultGuiScale).acceptedStringValues("Global", "Default", "Small", "Normal", "Large", "Auto").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.toggleKeybind = new Setting(this, "Toggle Mod Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideFromHUDKeybind = new Setting(this, "Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.tempHideFromHUDKeybind = new Setting(this, "Temp Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.registerStaticEvent(KeyboardEvent.class, this::onKeyPress); + this.registerStaticEvent(ClickEvent.class, this::onMousePress); + } + + protected void addEvent(Class eventClass, Consumer consumer) { + this.eventMap.put(eventClass, consumer); + } + + protected void registerStaticEvent(Class eventClass, Consumer consumer) { + CheatBreaker.getInstance().getEventBus().addEvent(eventClass, consumer); + } + + protected void addAllEvents() { + for (Map.Entry, Consumer> entry : this.eventMap.entrySet()) { + CheatBreaker.getInstance().getEventBus().addEvent(entry.getKey(), entry.getValue()); + } + } + + protected void removeAllEvents() { + for (Map.Entry, Consumer> entry : this.eventMap.entrySet()) { + CheatBreaker.getInstance().getEventBus().removeEvent(entry.getKey(), entry.getValue()); + } + } + + public void setState(boolean state) { + if (state != this.defaultState) { + CheatBreaker.getInstance().getConfigManager().createNewProfile(); + } + if (state) { + if (!this.enabled) { + this.enabled = true; + this.addAllEvents(); + } + } else if (this.enabled) { + this.enabled = false; + this.removeAllEvents(); + } + } + + public void setDefaultState(boolean state) { + if (state) { + if (!this.enabled) { + this.enabled = true; + this.addAllEvents(); + } + } else if (this.enabled) { + this.enabled = false; + this.removeAllEvents(); + } + this.defaultState = this.enabled; + } + + public void setTranslations(float x, float y) { + this.xTranslation = x; + this.yTranslation = y; + } + + public void setDefaultTranslations(float x, float y) { + this.xTranslation = x; + this.yTranslation = y; + this.defaultXTranslation = x; + this.defaultYTranslation = y; + } + + public void setDimensions(float width, float height) { + this.width = width; + this.height = height; + } + + public void setStaffModuleEnabled(boolean bl) { + this.staffModuleEnabled = bl; + if (!bl && this.isEnabled()) { + this.setState(false); + } + } + + // Master toggle key bind logic (keyboard) + private void onKeyPress(KeyboardEvent event) { + if (event.getPressed() == 0) return; + if (event.getPressed() == this.toggleKeybind.getIntegerValue() && !this.toggleKeybind.isHasMouseBind()) { + this.setState(!this.enabled); + } + if (event.getPressed() == this.hideFromHUDKeybind.getIntegerValue() && !this.hideFromHUDKeybind.isHasMouseBind() && !this.notRenderHUD) { + this.setRenderHud(!this.renderHud); + } + if (event.getPressed() == this.tempHideFromHUDKeybind.getIntegerValue() && !this.tempHideFromHUDKeybind.isHasMouseBind()) { + this.setHiddenFromHud(!this.hiddenFromHud); + } + } + + // Master toggle key bind logic (mice) + private void onMousePress(ClickEvent event) { + if (event.getMouseButton() == 0) return; // DO NOT REMOVE IT CAUSES SO MANY PROBLEMS + if (event.getMouseButton() == this.toggleKeybind.getIntegerValue() && this.toggleKeybind.isHasMouseBind()) { + this.setState(!this.enabled); + } + if (event.getMouseButton() == this.hideFromHUDKeybind.getIntegerValue() && this.hideFromHUDKeybind.isHasMouseBind() && !this.notRenderHUD) { + this.setRenderHud(!this.renderHud); + } + if (event.getMouseButton() == this.tempHideFromHUDKeybind.getIntegerValue() && this.tempHideFromHUDKeybind.isHasMouseBind()) { + this.setHiddenFromHud(!this.hiddenFromHud); + } + Setting nameTagsKeybind = CheatBreaker.getInstance().getModuleManager().nameTagMod.hideNamePlatesKeybind; + if (event.getMouseButton() == nameTagsKeybind.getIntegerValue() && nameTagsKeybind.isHasMouseBind()) { + CheatBreaker.getInstance().hideNameTags = !CheatBreaker.getInstance().hideNameTags; + } + } + + public void setCreators(String... creators) { + this.creators = Arrays.asList(creators); + } + + public void setAliases(String... aliases) { + this.aliases = Arrays.asList(aliases); + } + + public void scaleAndTranslate(ScaledResolution scaledResolution) { + this.scaleAndTranslate(scaledResolution, this.width, this.height); + } + + public boolean containsSettingByName(String name) { + for (Setting setting : this.getSettingsList()) { + if (setting.getSettingName().equalsIgnoreCase(name)) { + return true; + } + } + return false; + } + + public float masterScale() { + float var15 = 1.0f; + if (this.guiScale.getValue().equals("Global")) { + switch ((String) CheatBreaker.getInstance().getGlobalSettings().guiScale.getValue()) { + case "Small": + var15 = var15 * 0.5F / CheatBreaker.getScaleFactor(); + break; + case "Normal": + var15 = var15 / CheatBreaker.getScaleFactor(); + break; + case "Large": + var15 = var15 * 1.5F / CheatBreaker.getScaleFactor(); + break; + case "Auto": + var15 = var15 * 2.0F / CheatBreaker.getScaleFactor(); + } + } else { + switch ((String) this.guiScale.getValue()) { + case "Small": + var15 = var15 * 0.5F / CheatBreaker.getScaleFactor(); + break; + case "Normal": + var15 = var15 / CheatBreaker.getScaleFactor(); + break; + case "Large": + var15 = var15 * 1.5F / CheatBreaker.getScaleFactor(); + break; + case "Auto": + var15 = var15 * 2.0F / CheatBreaker.getScaleFactor(); + } + } + return (Float) this.scale.getValue() * (float) CheatBreaker.getInstance().getGlobalSettings().globalGuiScale.getValue() * var15; + } + + public void scaleAndTranslate(ScaledResolution scaledResolution, float width, float height) { + float f3 = 0.0f; + float f4 = 0.0f; + float scale = this.masterScale(); + GL11.glScalef(scale, scale, scale); + width *= scale; + height *= scale; + + switch (this.guiAnchor) { + case LEFT_TOP: + f3 = 2.0f; + f4 = 2.0f; + break; + case LEFT_MIDDLE: + f3 = 2.0f; + f4 = (float) (scaledResolution.getScaledHeight() / 2) - height / 2.0f; + break; + case LEFT_BOTTOM: + f4 = (float) scaledResolution.getScaledHeight() - height - 2.0f; + f3 = 2.0f; + break; + case MIDDLE_TOP: + f3 = (float) (scaledResolution.getScaledWidth() / 2) - width / 2.0f; + f4 = 2.0f; + break; + case MIDDLE_MIDDLE: + f3 = (float) (scaledResolution.getScaledWidth() / 2) - width / 2.0f; + f4 = (float) (scaledResolution.getScaledHeight() / 2) - height / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f3 = (float) (scaledResolution.getScaledWidth() / 2) - width; + f4 = (float) scaledResolution.getScaledHeight() - height - 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f3 = scaledResolution.getScaledWidth() / 2F; + f4 = (float) scaledResolution.getScaledHeight() - height - 2.0f; + break; + case RIGHT_TOP: + f3 = (float) scaledResolution.getScaledWidth() - width - 2.0f; + f4 = 2.0f; + break; + case RIGHT_MIDDLE: + f3 = (float) scaledResolution.getScaledWidth() - width; + f4 = (float) (scaledResolution.getScaledHeight() / 2) - height / 2.0f; + break; + case RIGHT_BOTTOM: + f3 = (float) scaledResolution.getScaledWidth() - width; + f4 = (float) scaledResolution.getScaledHeight() - height; + } + + GL11.glTranslatef(f3 / scale, f4 / scale, 0.0f); + GL11.glTranslatef(this.xTranslation / scale, this.yTranslation / scale, 0.0f); + } + + public float[] getScaledPoints(ScaledResolution scaledResolution, boolean bl) { + float f = 0.0f; + float f2 = 0.0f; + float f3 = this.width * this.masterScale(); + float f4 = this.height * this.masterScale(); + switch (this.guiAnchor) { + case LEFT_TOP: + f = 2.0f; + f2 = 2.0f; + break; + case LEFT_MIDDLE: + f = 2.0f; + f2 = (float) (scaledResolution.getScaledHeight() / 2) - f4 / 2.0f; + break; + case LEFT_BOTTOM: + f2 = (float) scaledResolution.getScaledHeight() - f4 - 2.0f; + f = 2.0f; + break; + case MIDDLE_TOP: + f = (float) (scaledResolution.getScaledWidth() / 2) - f3 / 2.0f; + f2 = 2.0f; + break; + case MIDDLE_MIDDLE: + f = (float) (scaledResolution.getScaledWidth() / 2) - f3 / 2.0f; + f2 = (float) (scaledResolution.getScaledHeight() / 2) - f4 / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f = (float) (scaledResolution.getScaledWidth() / 2) - f3; + f2 = (float) scaledResolution.getScaledHeight() - f4 - 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f = scaledResolution.getScaledWidth() / 2F; + f2 = (float) scaledResolution.getScaledHeight() - f4 - 2.0f; + break; + case RIGHT_TOP: + f = (float) scaledResolution.getScaledWidth() - f3 - 2.0f; + f2 = 2.0f; + break; + case RIGHT_MIDDLE: + f = (float) scaledResolution.getScaledWidth() - f3; + f2 = (float) (scaledResolution.getScaledHeight() / 2) - f4 / 2.0f; + break; + case RIGHT_BOTTOM: + f = (float) scaledResolution.getScaledWidth() - f3; + f2 = (float) scaledResolution.getScaledHeight() - f4; + } + return new float[]{(f + (bl ? this.xTranslation : 0.0f)) / this.masterScale(), (f2 + (bl ? this.yTranslation : 0.0f)) / this.masterScale()}; + } + + public void setAnchor(GuiAnchor anchor) { + if (anchor != this.defaultGuiAnchor) { + CheatBreaker.getInstance().getConfigManager().createNewProfile(); + } + this.guiAnchor = anchor; + } + + public void setDefaultAnchor(GuiAnchor anchor) { + this.guiAnchor = anchor; + this.defaultGuiAnchor = anchor; + } + + public Position getPosition() { + return AnchorHelper.getHorizontalPositionEnum(this.guiAnchor); + } + + protected void setPreviewIcon(ResourceLocation resourceLocation, int width, int height) { + this.previewType = PreviewType.ICON; + this.previewIcon = resourceLocation; + this.previewIconWidth = width; + this.previewIconHeight = height; + } + + protected void setPreviewLabel(String label, float size) { + this.previewType = PreviewType.LABEL; + this.previewLabel = label; + this.previewLabelSize = size; + } + + public void setRenderHud(boolean bl) { + if (bl != this.defaultRenderHud) { + CheatBreaker.getInstance().getConfigManager().createNewProfile(); + } + this.renderHud = bl; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/ModuleManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/ModuleManager.java new file mode 100644 index 0000000..db3c4a3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/ModuleManager.java @@ -0,0 +1,244 @@ +package com.cheatbreaker.client.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.event.impl.keyboard.KeyboardEvent; +import com.cheatbreaker.client.event.impl.network.ConnectEvent; +import com.cheatbreaker.client.event.impl.network.DisconnectEvent; +import com.cheatbreaker.client.event.impl.network.LoadWorldEvent; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.disallowed.DisallowedModManager; +import com.cheatbreaker.client.module.impl.fixes.ModuleKeyBindFix; +import com.cheatbreaker.client.module.impl.normal.hud.simple.combat.*; +import com.cheatbreaker.client.module.impl.normal.hypixel.*; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import com.cheatbreaker.client.module.impl.normal.hud.*; +import com.cheatbreaker.client.module.impl.normal.hud.armorstatus.ModuleArmorStatus; +import com.cheatbreaker.client.module.impl.normal.hud.chat.ModuleChat; +import com.cheatbreaker.client.module.impl.normal.hud.cooldowns.ModuleCooldowns; +import com.cheatbreaker.client.module.impl.normal.hud.keystrokes.ModuleKeyStrokes; +import com.cheatbreaker.client.module.impl.normal.hud.simple.module.*; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleAutoText; +import com.cheatbreaker.client.module.impl.normal.misc.ModulePackTweaks; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleTeamMates; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleZansMiniMap; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleDragToLook; +import com.cheatbreaker.client.module.impl.normal.perspective.ModulePerspective; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleSnapLook; +import com.cheatbreaker.client.module.impl.normal.shader.ModuleMotionBlur; +import com.cheatbreaker.client.module.impl.normal.vanilla.*; +import com.cheatbreaker.client.module.impl.packmanager.ResourcePackManager; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleBunnyhop; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleNameTags; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleNoClip; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleXray; +import com.cheatbreaker.client.ui.element.type.custom.KeybindElement; +import com.cheatbreaker.client.util.voicechat.ModuleVoiceChat; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.util.EnumChatFormatting; + +import java.util.*; +import java.util.concurrent.TimeUnit; + +public class ModuleManager { + public final List playerMods = new ArrayList<>(); + public final List staffMods = new ArrayList<>(); + + public final Map keybinds = new HashMap<>(); + + @Setter public String currentModule; + @Setter public int lastSettingScrollPos; + + public final ModuleCoordinates coordinatesMod; + public final ModuleZansMiniMap miniMapMod; + public final SimpleModuleToggleSprint toggleSprintMod; + public final SimpleModuleHearingAssistance hearingAssistance; + public final ModulePotionEffects potionEffectsMod; + public final ModuleArmorStatus armourStatus; + public final ModuleKeyStrokes keystrokesMod; + public final ModuleScoreboard scoreboardMod; + public final ModuleCooldowns coolDownsMod; + public final ModuleNotifications notificationsMod; + public final ModuleDirectionHUD directionHUDMod; + public final ModuleCrosshair crosshairMod; + public final ModuleEnchantmentGlint enchantmentGlintMod; + public final ModuleBossBar bossBarMod; + + public final SimpleModulePotionCounter potionCounterMod; + public final SimpleModuleCPS cpsMod; + public final SimpleModuleFPS fpsMod; + public final SimpleModuleMemoryUsage memoryUsageMod; + public final SimpleModuleComboCounter comboCounterMod; + public final SimpleModuleSprintResetCounter sprintResetCounterMod; + public final SimpleModuleReachDisplay reachDisplayMod; + public final SimpleModuleServerAddress serverAddressMod; + public final SimpleModulePing pingMod; + public final SimpleModuleClock clockMod; + public final SimpleModuleSaturation saturationMod; + public final SimpleModulePackDisplay packDisplayMod; + public final SimpleModuleFlickTracker flickTrackerMod; + + public final ModuleMotionBlur motionBlurMod; + public final ModuleHitColor hitColorMod; + public final ModuleParticles particlesMod; + public final ModuleNameTag nameTagMod; + public final ModuleBlockOverlay blockOverlayMod; + public final ModulePackTweaks packTweaksMod; + public final ModuleEnvironmentChanger environmentChangerMod; +// public final ModulePlayerList playerListMod; + public final ModuleChat chatMod; + public final CollectionModuleHypixel hypixelMod; + public final ModuleOneSevenVisuals animationsMod; + public final ModuleNickHider nickHiderMod; + public final ModuleAutoText autoTextMod; + public final ModuleTNTTimer tntTimerMod; + + public final StaffModuleXray xray; + public final StaffModuleNameTags staffNameTags; + public final StaffModuleNoClip staffNoClip; + public final StaffModuleBunnyhop staffBunnyhop; + + public final ModuleDragToLook dragToLook; + public final ModuleSnapLook snapLook; + public final ModuleTeamMates teammatesMod; + public final ModuleVoiceChat voiceChat; + public final ModulePerspective perspectiveMod; + public final ModuleKeyBindFix keybindFix; + public final ModuleHitboxes hitboxesMod; + + public final DisallowedModManager disallowedModManager; + + public ModuleManager(EventBus eventManager) { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created Mod Manager"); + + this.playerMods.add(this.coordinatesMod = new ModuleCoordinates()); + this.playerMods.add(this.animationsMod = new ModuleOneSevenVisuals()); + this.playerMods.add(this.miniMapMod = new ModuleZansMiniMap()); + this.playerMods.add(this.toggleSprintMod = new SimpleModuleToggleSprint()); + this.playerMods.add(this.potionEffectsMod = new ModulePotionEffects()); + this.playerMods.add(this.armourStatus = new ModuleArmorStatus()); + this.playerMods.add(this.keystrokesMod = new ModuleKeyStrokes()); + this.playerMods.add(this.scoreboardMod = new ModuleScoreboard()); +// this.playerMods.add(this.playerListMod = new ModulePlayerList()); + this.playerMods.add(this.chatMod = new ModuleChat()); + this.playerMods.add(this.bossBarMod = new ModuleBossBar()); + this.playerMods.add(this.coolDownsMod = new ModuleCooldowns()); + this.playerMods.add(this.notificationsMod = new ModuleNotifications()); + this.playerMods.add(this.directionHUDMod = new ModuleDirectionHUD()); + this.playerMods.add(this.environmentChangerMod = new ModuleEnvironmentChanger()); + this.playerMods.add(this.enchantmentGlintMod = new ModuleEnchantmentGlint()); + this.playerMods.add(this.crosshairMod = new ModuleCrosshair()); + this.playerMods.add(this.hitColorMod = new ModuleHitColor()); + this.playerMods.add(this.particlesMod = new ModuleParticles()); + this.playerMods.add(this.nameTagMod = new ModuleNameTag()); + this.playerMods.add(this.nickHiderMod = new ModuleNickHider()); + this.playerMods.add(this.autoTextMod = new ModuleAutoText()); + this.playerMods.add(this.tntTimerMod = new ModuleTNTTimer()); + this.playerMods.add(this.blockOverlayMod = new ModuleBlockOverlay()); + this.playerMods.add(this.packTweaksMod = new ModulePackTweaks()); + this.playerMods.add(this.perspectiveMod = new ModulePerspective()); + this.playerMods.add(this.hitboxesMod = new ModuleHitboxes()); + this.playerMods.add(this.hearingAssistance = new SimpleModuleHearingAssistance()); + this.playerMods.add(this.hypixelMod = new CollectionModuleHypixel()); + + new Timer().scheduleAtFixedRate(new AutoTipThread(), TimeUnit.SECONDS.toMillis(15L), TimeUnit.MINUTES.toMillis(1L)); + + this.playerMods.add(this.cpsMod = new SimpleModuleCPS()); + this.playerMods.add(this.fpsMod = new SimpleModuleFPS()); + this.playerMods.add(this.memoryUsageMod = new SimpleModuleMemoryUsage()); + this.playerMods.add(this.potionCounterMod = new SimpleModulePotionCounter()); + this.playerMods.add(this.comboCounterMod = new SimpleModuleComboCounter()); + this.playerMods.add(this.sprintResetCounterMod = new SimpleModuleSprintResetCounter()); + this.playerMods.add(this.reachDisplayMod = new SimpleModuleReachDisplay()); + this.playerMods.add(this.serverAddressMod = new SimpleModuleServerAddress()); + this.playerMods.add(this.pingMod = new SimpleModulePing()); + this.playerMods.add(this.clockMod = new SimpleModuleClock()); + this.playerMods.add(this.saturationMod = new SimpleModuleSaturation()); + this.playerMods.add(this.flickTrackerMod = new SimpleModuleFlickTracker()); + this.playerMods.add(this.packDisplayMod = new SimpleModulePackDisplay()); + //this.playerMods.add(this.flickTrackerMod = new SimpleFlickTrackerModule()); + this.playerMods.add(this.motionBlurMod = new ModuleMotionBlur()); + + this.staffMods.add(this.xray = new StaffModuleXray()); + this.staffMods.add(this.staffNameTags = new StaffModuleNameTags()); + this.staffMods.add(this.staffNoClip = new StaffModuleNoClip()); + this.staffMods.add(this.staffBunnyhop = new StaffModuleBunnyhop()); + + this.voiceChat = new ModuleVoiceChat(); + this.dragToLook = new ModuleDragToLook(); + this.snapLook = new ModuleSnapLook(); + this.teammatesMod = new ModuleTeamMates(); + this.keybindFix = new ModuleKeyBindFix(); + + this.teammatesMod.setEnabled(true); + new ResourcePackManager(); + + disallowedModManager = new DisallowedModManager(); + disallowedModManager.startup(); + + eventManager.addEvent(LoadWorldEvent.class, this::setWorldTime); + eventManager.addEvent(KeyboardEvent.class, this::handleStaffModKeybind); + eventManager.addEvent(ConnectEvent.class, ignored -> { + ServerData serverData = Minecraft.getMinecraft().currentServerData; + if (serverData != null) { + CheatBreaker.getInstance().syncCurrentServerWithAssetServer(serverData.serverIP, serverData.domain, serverData.port); + } + }); + + eventManager.addEvent(DisconnectEvent.class, ignored -> { + CheatBreaker.getInstance().syncCurrentServerWithAssetServer("", "", 0); + for (AbstractModule var3 : this.staffMods) { + var3.setState(false); + var3.setStaffModuleEnabled(false); + } + }); + } + + private void setWorldTime(LoadWorldEvent event) { + if (this.environmentChangerMod.isEnabled()) this.environmentChangerMod.setWorldTime(); + } + + public boolean isBoundToAnother(Setting settingIn, int key) { + boolean flag = false; + for (Setting setting : this.keybinds.keySet()) { + if (setting.getType() == SettingType.INTEGER) { + // Key code check + if (setting.isHasKeycode() && key == setting.getKeyCode()) { + flag = true; + } + // Mouse bind check + if (setting.isHasMouseBind() && key == setting.getIntegerValue()) { + flag = true; + } + // General check + if ((setting.getSettingName().toLowerCase().startsWith("hot key") || setting.getSettingName().toLowerCase().endsWith("keybind")) && key == setting.getIntegerValue()) { + flag = true; + } + } + } + + if (flag) + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("error", EnumChatFormatting.RED + settingIn.getSettingName() + " is already bound to another keybind!", 5000L); + + return flag; + } + + public AbstractModule getModByName(String name) { + return this.playerMods.stream().filter(m -> m.getName().equalsIgnoreCase(name)).findFirst().orElse(null); + } + + private void handleStaffModKeybind(KeyboardEvent event) { + if (event.getPressed() != 0) { + for (StaffMod staffMod : this.staffMods) { + if (!staffMod.isStaffModuleEnabled() || (Integer) staffMod.getKeybindSetting().getValue() != event.getPressed()) + continue; + staffMod.setState(!staffMod.isEnabled()); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/ModuleCommand.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/ModuleCommand.java new file mode 100644 index 0000000..b75c670 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/ModuleCommand.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.module.command; + +import com.cheatbreaker.client.module.AbstractModule; +import lombok.*; + +@Getter @AllArgsConstructor +public abstract class ModuleCommand { + public final AbstractModule mod; + private final String command; + + /* + Handles the command. + */ + public abstract void handle(); +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/ModuleCommandManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/ModuleCommandManager.java new file mode 100644 index 0000000..b7a570e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/ModuleCommandManager.java @@ -0,0 +1,28 @@ +package com.cheatbreaker.client.module.command; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.command.impl.*; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; + +import java.util.ArrayList; +import java.util.List; + +public class ModuleCommandManager { + public List moduleCommands = new ArrayList<>(); + + public IncreaseTimeCommand increaseStaticTimeCommand; + public DecreaseTimeCommand decreaseStaticTimeCommand; + + public ModuleCommandManager() { + this.moduleCommands.add(this.increaseStaticTimeCommand = new IncreaseTimeCommand()); + this.moduleCommands.add(this.decreaseStaticTimeCommand = new DecreaseTimeCommand()); + } + + public void sendModCommandCallback(ChatComponentText chatComponent) { + if (CheatBreaker.getInstance().getGlobalSettings().hideCallbackMessages.getBooleanValue()) return; + + chatComponent.setBranded(true); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(chatComponent); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/impl/DecreaseTimeCommand.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/impl/DecreaseTimeCommand.java new file mode 100644 index 0000000..889ceba --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/impl/DecreaseTimeCommand.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.module.command.impl; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.command.ModuleCommand; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnvironmentChanger; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class DecreaseTimeCommand extends ModuleCommand { + + public DecreaseTimeCommand() { + super(CheatBreaker.getInstance().getModuleManager().environmentChangerMod, "/cb_decrease_time"); + } + + @Override + public void handle() { + long decreaseAmount = Integer.parseInt(((ModuleEnvironmentChanger)this.mod).worldTime.getValue().toString()) - ((ModuleEnvironmentChanger)this.mod).increaseDecreaseAmount.getIntegerValue(); + + if (((ModuleEnvironmentChanger)this.mod).timeType.getStringValue().equalsIgnoreCase("Static")) { + if (Minecraft.getMinecraft().theWorld != null) { + if (decreaseAmount < -22880) { + return; + } + ((ModuleEnvironmentChanger)this.mod).worldTime.setValue(Integer.parseInt(((ModuleEnvironmentChanger)this.mod).worldTime.getValue().toString()) + - ((ModuleEnvironmentChanger)this.mod).increaseDecreaseAmount.getIntegerValue()); + Minecraft.getMinecraft().theWorld.setWorldTime(decreaseAmount); + + String msg = "Decreased time by " + CheatBreaker.getInstance().getModuleManager().environmentChangerMod.increaseDecreaseAmount.getIntegerValue() + "."; + CheatBreaker.getInstance().getModuleCommandManager().sendModCommandCallback(new ChatComponentText(msg)); + } + } else { + String msg = EnumChatFormatting.RED + "This mod command only works with the \"Static\" time type."; + CheatBreaker.getInstance().getModuleCommandManager().sendModCommandCallback(new ChatComponentText(msg)); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/impl/IncreaseTimeCommand.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/impl/IncreaseTimeCommand.java new file mode 100644 index 0000000..0402967 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/command/impl/IncreaseTimeCommand.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.module.command.impl; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.command.ModuleCommand; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnvironmentChanger; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class IncreaseTimeCommand extends ModuleCommand { + + public IncreaseTimeCommand() { + super(CheatBreaker.getInstance().getModuleManager().environmentChangerMod, "/cb_increase_time"); + } + + @Override + public void handle() { + long increaseAmount = Integer.parseInt(((ModuleEnvironmentChanger)this.mod).worldTime.getValue().toString()) + ((ModuleEnvironmentChanger)this.mod).increaseDecreaseAmount.getIntegerValue(); + + if (((ModuleEnvironmentChanger)this.mod).timeType.getStringValue().equalsIgnoreCase("Static")) { + if (Minecraft.getMinecraft().theWorld != null) { + if (increaseAmount > -6100) { + return; + } + ((ModuleEnvironmentChanger)this.mod).worldTime.setValue(Integer.parseInt(((ModuleEnvironmentChanger)this.mod).worldTime.getValue().toString()) + + ((ModuleEnvironmentChanger)this.mod).increaseDecreaseAmount.getIntegerValue()); + Minecraft.getMinecraft().theWorld.setWorldTime(increaseAmount); + + String msg = "Increased time by " + CheatBreaker.getInstance().getModuleManager().environmentChangerMod.increaseDecreaseAmount.getIntegerValue() + "."; + CheatBreaker.getInstance().getModuleCommandManager().sendModCommandCallback(new ChatComponentText(msg)); + } + } else { + String msg = EnumChatFormatting.RED + "This mod command only works with the \"Static\" time type."; + CheatBreaker.getInstance().getModuleCommandManager().sendModCommandCallback(new ChatComponentText(msg)); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/CustomizationLevel.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/CustomizationLevel.java new file mode 100644 index 0000000..9410e8c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/CustomizationLevel.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.module.data; + +/** + * Defines all the customization levels for mods and settings. + */ +public enum CustomizationLevel { + SIMPLE, + MEDIUM, + ADVANCED +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/MiniMapRules.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/MiniMapRules.java new file mode 100644 index 0000000..201e3c4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/MiniMapRules.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.module.data; + +/** + * Defines all Waypoint levels for Voxel Map. + */ +public enum MiniMapRules { + NEUTRAL, + ALLOWED, + FORCED_OFF +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/PreviewType.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/PreviewType.java new file mode 100644 index 0000000..ae7cd13 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/PreviewType.java @@ -0,0 +1,9 @@ +package com.cheatbreaker.client.module.data; + +/** + * Defines all types of preview types for the mod list. + */ +public enum PreviewType { + LABEL, + ICON +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/ScreenLocation.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/ScreenLocation.java new file mode 100644 index 0000000..554740c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/ScreenLocation.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.module.data; + +/** + * Defines all locations a module can be on the screen. + */ +public enum ScreenLocation { + RIGHT_BOTTOM, + LEFT_BOTTOM, + RIGHT_TOP, + LEFT_TOP +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/Setting.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/Setting.java new file mode 100644 index 0000000..4715cbc --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/Setting.java @@ -0,0 +1,308 @@ +package com.cheatbreaker.client.module.data; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import lombok.Getter; +import lombok.Setter; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BooleanSupplier; +import java.util.function.Consumer; + +/** + * Defines a Setting for CheatBreaker Modules and CheatBreaker Settings. + */ +@Getter +public class Setting { + private final String settingName; + private String settingDescription = ""; + private String unit = ""; + private String centerLabel = ""; + private String leftIcon = ""; + private String rightIcon = ""; + private String[] acceptedStringValues; + + private int keyCode; // done since keybind element is so good + @Setter private boolean hasKeycode; + + @Setter private boolean hasMouseBind; + + private boolean showValue = true; + public boolean rainbow; + public boolean speed; + + public int[] color; + + private Object value; + private Object minimumValue; + private Object maximumValue; + private Object acceptedValue; + private Object customizationLevel; + private Object[] acceptedValues; + + private Consumer changeConsumer; + + private Setting parent; + + private BooleanSupplier condition; + + private AbstractModule container; + + public Setting(String settingName) { + this.settingName = settingName; + } + + public Setting(AbstractModule container, String settingName) { + this.container = container; + container.getSettingsList().add(this); + this.settingName = settingName; + } + + public Setting(AbstractModule container, String settingName, String description) { + this.container = container; + container.getSettingsList().add(this); + this.settingName = settingName; + this.settingDescription = description; + } + + public Setting(List list, String settingName) { + list.add(this); + this.settingName = settingName; + } + + public Setting(List list, String settingName, String description) { + list.add(this); + this.settingName = settingName; + this.settingDescription = description; + } + + /** + * Returns the color value for text color, background color, etc. + */ + public int getColorValue() { + if (this.rainbow) { + Integer var1 = (Integer) this.value; + int var2 = var1 >> 24 & 0xFF; + float var3 = (float) System.nanoTime() / 1.0E10f % 1.0f; + if (this.speed) + return var2 << 24 | Color.HSBtoRGB((float) (System.currentTimeMillis() % 1000L) / 1000.0f, 1.0f, 1.0f) & 0xFFFFFF; + return var2 << 24 | Color.HSBtoRGB(var3, 1.0f, 1.0f) & 0xFFFFFF; + } + return (Integer) this.value; + } + + public Color getColorFromColorValue(int colorValue) { + float A = (float)(colorValue >> 24 & 255) / 255.0F; + float R = (float)(colorValue >> 16 & 255) / 255.0F; + float G = (float)(colorValue >> 8 & 255) / 255.0F; + float B = (float)(colorValue & 255) / 255.0F; + + return new Color(R, G, B, A); + } + + /** + * Casts and returns the value as a boolean. + */ + public boolean getBooleanValue() { + return (Boolean) this.value; + } + + /** + * Casts and returns the value as a string. + */ + public String getStringValue() { + return (String) this.value; + } + + /** + * Casts and returns the value as a float. + */ + public float getFloatValue() { + return (Float) this.value; + } + + /** + * Casts and returns the value as an integer. + */ + public int getIntegerValue() { + return (Integer) this.value; + } + + /** + * Casts and returns the value as an ArrayList. + */ + public ArrayList getArrayListValue() { + return (ArrayList) this.value; + } + + /** + * Sets a singular accepted value for a setting. + */ + public Setting acceptedValue(Object value) { + this.acceptedValue = value; + return this; + } + + /** + * Gets the parent setting value. + */ + public boolean getParentValue() { + return this.parent != null && (Boolean) this.parent.getValue(); + } + + /** + * Sets the value of a setting. + */ + public Setting setValue(Object value) { + return this.updateSettingValue(value, true); + } + + public Setting setMouseBind(boolean hasMouseBind) { + this.hasMouseBind = hasMouseBind; + return this; + } + + /** + * Updates a setting value. + */ + public Setting updateSettingValue(Object value, boolean usingDefaultProfile) { + if (CheatBreaker.getInstance().getConfigManager().activeProfile != null && CheatBreaker.getInstance().getConfigManager().activeProfile.getName().equals("default")) { + if (usingDefaultProfile) { + CheatBreaker.getInstance().getConfigManager().createNewProfile(); + } + } else if (this.container != null) { + this.container.getDefaultSettingsValues().add(value); + } + this.value = value; + if (this.changeConsumer != null) { + this.changeConsumer.accept(value); + } + return this; + } + + /** + * Sets the accepted String values of a setting. + */ + public Setting acceptedStringValues(String... values) { + this.acceptedStringValues = values; + return this; + } + + public Setting setKeyCode(int keycode) { + this.keyCode = keycode; + this.hasKeycode = true; + return this; + } + + /** + * Sets the accepted values of a setting. + */ + public Setting acceptedValues(Object... values) { + this.acceptedValues = values; + return this; + } + + /** + * Gets fired when a setting is changed. + */ + public Setting onChange(Consumer var1) { + this.changeConsumer = var1; + return this; + } + + /** + * Sets min and max slider values + */ + public Setting setMinMax(Object minValue, Object maxValue) { + this.minimumValue = minValue; + this.maximumValue = maxValue; + return this; + } + + /** + * Sets the customization level of the setting. + */ + public Setting setCustomizationLevel(Object level) { + this.customizationLevel = level; + return this; + } + + /** + * Sets the setting condition. + */ + public Setting setCondition(BooleanSupplier condition) { + this.condition = condition; + return this; + } + + /** + * Sets the parent setting. + */ + public Setting setParent(Setting parent) { + if (parent.getType() != SettingType.BOOLEAN) { + throw new IllegalStateException("Parent can only be boolean."); + } + this.parent = parent; + return this; + } + + /** + * Gets the setting type. + */ + public SettingType getType() { + if (this.value.getClass().isAssignableFrom(Boolean.class)) { + return SettingType.BOOLEAN; + } + if (this.value.getClass().isAssignableFrom(ArrayList.class) && this.acceptedValues != null && this.acceptedValues.length != 0) { + return SettingType.ARRAYLIST; + } + if (this.value.getClass().isAssignableFrom(String.class)) { + return this.acceptedStringValues != null && this.acceptedStringValues.length != 0 ? SettingType.STRING_ARRAY : SettingType.STRING; + } + if (this.value.getClass().isAssignableFrom(Float.class)) { + return SettingType.FLOAT; + } + if (this.value.getClass().isAssignableFrom(Double.class)) { + return SettingType.DOUBLE; + } + if (this.value.getClass().isAssignableFrom(String[].class)) { + return SettingType.STRING_ARRAY; + } + return this.value.getClass().isAssignableFrom(Integer.class) ? SettingType.INTEGER : null; + } + + /** + * Sets unit string. + */ + public Setting setUnit(String value) { + this.unit = value; + return this; + } + + /** + * Sets showValue boolean. + */ + public Setting setShowValue(boolean value) { + this.showValue = value; + return this; + } + + /** + * Sets the center label of the setting. + */ + public Setting setCenterLabel(String label) { + this.centerLabel = label; + return this; + } + + /** + * Sets the setting's icons. + */ + public Setting setIcons(String leftIcon, String rightIcon) { + this.leftIcon = leftIcon; + this.rightIcon = rightIcon; + return this; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/SettingType.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/SettingType.java new file mode 100644 index 0000000..5346033 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/data/SettingType.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.module.data; + +/** + * Defines the data types a CheatBreaker setting can be. + */ +public enum SettingType { + STRING, + STRING_ARRAY, + FLOAT, + INTEGER, + DOUBLE, + BOOLEAN, + ARRAYLIST, + SHORT, + FILE // Will be used later for custom image choosing. +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/disallowed/DisallowedModManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/disallowed/DisallowedModManager.java new file mode 100644 index 0000000..2e52115 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/disallowed/DisallowedModManager.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.module.impl.disallowed; + +import lombok.Getter; + +import java.util.*; + +@Getter +public class DisallowedModManager { + + public final Map> moduleBlockedServers = new HashMap<>(); + + public boolean disallows(String serverIp, String module) { + for (Map.Entry> entries : moduleBlockedServers.entrySet()) + { + if (serverIp.contains(entries.getKey())) { + + return entries.getValue().stream() + .filter(m -> m.contains(module)) + .findFirst() + .orElse(null) != null; + } + } + + return false; + } + + /* + Pretty bad way of doing this but until we have a websocket function to pull from + I'm doing it like this cry about it + */ + public void startup() { + moduleBlockedServers.put("hypixel", Arrays.asList("freelook", "auto text")); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/fixes/ModuleKeyBindFix.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/fixes/ModuleKeyBindFix.java new file mode 100644 index 0000000..e3ca661 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/fixes/ModuleKeyBindFix.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.module.impl.fixes; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import org.lwjgl.input.Keyboard; + +import java.lang.reflect.Field; + +/** + * @Module - Keybind Fix + * This module allows for keybind persistence in containers, and chat menus. + * + * This fix can be seen in Vanilla Minecraft 1.12+. + */ +public class ModuleKeyBindFix { + private boolean hadAScreen; + private final Minecraft mc = Minecraft.getMinecraft(); + + public ModuleKeyBindFix() { + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::handleTick); + } + + public void handleTick(TickEvent event) { + boolean hasScreen = mc.currentScreen != null; + GlobalSettings globalSettings = CheatBreaker.getInstance().getGlobalSettings(); + if (!hasScreen && hadAScreen && globalSettings.keybindFix.getBooleanValue()) { + Class gameSettingsClass = GameSettings.class; + Field[] fields = gameSettingsClass.getDeclaredFields(); + for (Field field : fields) { + if (field.getType().equals(KeyBinding.class)) { + field.setAccessible(true); + + try { + KeyBinding keyBinding = (KeyBinding) field.get(mc.gameSettings); + boolean excludeSneak = !globalSettings.excludeSneakKeybind.getBooleanValue() || !keyBinding.getKeyDescription().equalsIgnoreCase("key.sneak"); + boolean excludeThrow = !globalSettings.excludeThrowKeybind.getBooleanValue() || !keyBinding.getKeyDescription().equalsIgnoreCase("key.use"); + + if (!keyBinding.getKeyDescription().equalsIgnoreCase("key.inventory") + && !keyBinding.getKeyDescription().equalsIgnoreCase("key.chat") + && !keyBinding.getKeyDescription().equalsIgnoreCase("key.command") + && excludeSneak + && excludeThrow + && keyBinding.getKeyCode() > 0 + && Keyboard.isKeyDown(keyBinding.getKeyCode()) + ) { + KeyBinding.setKeyBindState(keyBinding.getKeyCode(), true); + KeyBinding.onTick(keyBinding.getKeyCode()); + } + } catch (Exception var9) { + var9.printStackTrace(); + } + } + } + } + this.hadAScreen = hasScreen; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/ModuleOneSevenVisuals.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/ModuleOneSevenVisuals.java new file mode 100644 index 0000000..821f81a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/ModuleOneSevenVisuals.java @@ -0,0 +1,58 @@ +package com.cheatbreaker.client.module.impl.normal.animation; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; + +/** + * @Module - ModuleOneSevenVisuals + * @see AbstractModule + * + * This mod reverts all changed visuals to their 1.7 counterparts. + */ +public class ModuleOneSevenVisuals extends AbstractModule { + public static Setting oldModel; + public static Setting oldBow; + public static Setting oldSwordBlock; + public static Setting oldRod; + public static Setting oldSwordBlock3; + public static Setting oldEating; + public static Setting oldBlockHitting; + public static Setting smoothSneaking; + public static Setting longSneaking; + public static Setting redArmor; + public static Setting punching; + public static Setting itemSwitch; + public static Setting oldHealth; + public static Setting oldDebugScreen; + public static Setting oldTab; + public static Setting oldDebugHitbox; + + public ModuleOneSevenVisuals() { + super("1.7 Animations"); + this.setDescription("Revert certain visuals to appear like their 1.7 counterpart."); + this.setPreviewLabel("1.7 <-> 1.8", 1.0f); + this.setCreators("OrangeMarshall"); + this.setAliases("1.7 Visuals", "Old Animations"); + this.setDefaultState(true); + + new Setting(this, "label").setValue("Position Settings"); + oldModel = new Setting(this, "1.7 Item Positions", "Change all item models to be in the same position as 1.7.").setValue(true); + oldBow = new Setting(this, "1.7 Bow Pullback", "Change the bow pullback animation to be like 1.7.").setValue(true); + oldSwordBlock = new Setting(this, "1.7 Block Animation", "Change the sword block animation to be like 1.7.").setValue(true); + oldRod = new Setting(this, "1.7 Rod Position", "Change all item models to be in the same position as 1.7.").setValue(true); + oldSwordBlock3 = new Setting(this, "1.7 3rd Person Block Animation", "Change the 3rd person blocking animation to be like 1.7.").setValue(true); + + new Setting(this, "label").setValue("Interaction Settings"); + oldEating = new Setting(this, "Consume Animation", "Change the eating and drinking animation to look like 1.7.").setValue(true); + oldBlockHitting = new Setting(this, "Block-Hitting Animation", "Makes block hitting look much smoother, like it did in 1.7.").setValue(true); + smoothSneaking = new Setting(this, "Smooth Sneaking", "Makes the transition between sneaking/not sneaking smooth.\\n§eCombine with longer unsneak to match 1.7.").setValue(true); + longSneaking = new Setting(this, "Longer Unsneak", "Makes moving up take longer than moving down\\n§eCombine with smooth sneaking to match 1.7.").setValue(true).setCondition(() -> smoothSneaking.getBooleanValue()); + punching = new Setting(this, "Punching During Usage", "Allows you to punch blocks whilst using an item.\\n§eVisual only.").setValue(true); + itemSwitch = new Setting(this, "Item Switching Animation", "Stop held items from playing the switching animation when right clicking on blocks.").setValue(true); + redArmor = new Setting(this, "1.7 Hit Color Brightness", "Set the hit color to use 1.7's brightness system, darkening the hit color.").setValue(true); + + new Setting(this, "label").setValue("HUD Settings"); + oldHealth = new Setting(this, "Remove Health Bar Flashing", "Stops your health bar flashing when you take damage.").setValue(true); +// oldDebugScreen = new Setting(this, "1.7 Debug Screen (Not implemented)", "Remove the boxes in the debug screen.").setValue(true); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/AnimationHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/AnimationHandler.java new file mode 100644 index 0000000..b32afc2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/AnimationHandler.java @@ -0,0 +1,364 @@ +package com.cheatbreaker.client.module.impl.normal.animation.util; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.potion.Potion; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; + +/** + * @ModuleUtility - AnimationHandler + * @see ModuleOneSevenVisuals + * + * This class handles animations, sword blocking, etc. + */ +public class AnimationHandler { + public static final AnimationHandler INSTANCE = new AnimationHandler(); + private final Minecraft mc = Minecraft.getMinecraft(); + public float prevSwingProgress; + public float swingProgress; + private int swingProgressInt; + private boolean isSwingInProgress; + + public AnimationHandler() { + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + } + + public float getSwingProgress(float partialTickTime) { + float currentProgress = this.swingProgress - this.prevSwingProgress; + + if (!this.isSwingInProgress) { + return this.mc.thePlayer.getSwingProgress(partialTickTime); + } + + if (currentProgress < 0.0f) { + currentProgress += 1.0f; + } + + return this.prevSwingProgress + currentProgress * partialTickTime; + } + + private int getArmSwingAnimationEnd(EntityPlayerSP player) { + return player.isPotionActive(Potion.digSpeed) ? 5 - player.getActivePotionEffect(Potion.digSpeed).getAmplifier() : (player.isPotionActive(Potion.digSlowdown) ? 8 + player.getActivePotionEffect(Potion.digSlowdown).getAmplifier() * 2 : 6); + } + + private void updateSwingProgress() { + EntityPlayerSP player = this.mc.thePlayer; + + if (player == null) { + return; + } + + this.prevSwingProgress = this.swingProgress; + int max = this.getArmSwingAnimationEnd(player); + + if (ModuleOneSevenVisuals.punching.getBooleanValue() && this.mc.gameSettings.keyBindAttack.isKeyDown() && this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && (!this.isSwingInProgress || this.swingProgressInt >= max >> 1 || this.swingProgressInt < 0)) { + this.isSwingInProgress = true; + this.swingProgressInt = -1; + } + + if (this.isSwingInProgress) { + ++this.swingProgressInt; + + if (this.swingProgressInt >= max) { + this.swingProgressInt = 0; + this.isSwingInProgress = false; + } + + } else { + this.swingProgressInt = 0; + } + + this.swingProgress = (float) this.swingProgressInt / (float) max; + } + + public void onTick(TickEvent event) { + this.updateSwingProgress(); + } + + public boolean renderItemInFirstPerson(ItemRenderer renderer, ItemStack stack, float equipProgress, float partialTicks) { + if (stack == null) { + return false; + } + + Item item = stack.getItem(); + if (item == Items.filled_map || this.mc.getRenderItem().shouldRenderItemIn3D(stack)) { + return false; + } + + EnumAction action = stack.getItemUseAction(); + if (item == Items.fishing_rod && !ModuleOneSevenVisuals.oldRod.getBooleanValue() || action == EnumAction.NONE && !ModuleOneSevenVisuals.oldModel.getBooleanValue() || action == EnumAction.BLOCK && !ModuleOneSevenVisuals.oldSwordBlock.getBooleanValue() || action == EnumAction.BOW && !ModuleOneSevenVisuals.oldBow.getBooleanValue()) { + return false; + } + + EntityPlayerSP player = this.mc.thePlayer; + float var4 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * partialTicks; + + GlStateManager.pushMatrix(); + GlStateManager.rotate(var4, 1.0f, 0.0f, 0.0f); + GlStateManager.rotate(player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * partialTicks, 0.0f, 1.0f, 0.0f); + RenderHelper.enableStandardItemLighting(); + GlStateManager.popMatrix(); + + float pitch = player.prevRenderArmPitch + (player.renderArmPitch - player.prevRenderArmPitch) * partialTicks; + float yaw = player.prevRenderArmYaw + (player.renderArmYaw - player.prevRenderArmYaw) * partialTicks; + GlStateManager.rotate((player.rotationPitch - pitch) * 0.1f, 1.0f, 0.0f, 0.0f); + GlStateManager.rotate((player.rotationYaw - yaw) * 0.1f, 0.0f, 1.0f, 0.0f); + GlStateManager.enableRescaleNormal(); + + if (item instanceof ItemCloth) { + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + } + + int i = this.mc.theWorld.getCombinedLight(new BlockPos(player.posX, player.posY + (double) player.getEyeHeight(), player.posZ), 0); + float brightnessX = i & 0xFFFF; + float brightnessY = i >> 16; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, brightnessX, brightnessY); + + int rgb = item.getColorFromItemStack(stack, 0); + float red = (float) (rgb >> 16 & 0xFF) / 255.0f; + float green = (float) (rgb >> 8 & 0xFF) / 255.0f; + float blue = (float) (rgb & 0xFF) / 255.0f; + GlStateManager.color(red, green, blue, 1.0f); + + GlStateManager.pushMatrix(); + int useCount = player.getItemInUseCount(); + float swingProgress = this.getSwingProgress(partialTicks); + boolean blockHitOverride = false; + + if (ModuleOneSevenVisuals.punching.getBooleanValue() && useCount <= 0 && this.mc.gameSettings.keyBindUseItem.isKeyDown()) { + if (Minecraft.getMinecraft().getCurrentServerData() != null) { + if (!Minecraft.getMinecraft().getCurrentServerData().serverIP.contains("minemen.club") && !Minecraft.getMinecraft().getCurrentServerData().serverIP.contains("icantjoinlmfao.club") && !Minecraft.getMinecraft().getCurrentServerData().serverIP.contains("mineman.club")) { + boolean block = action == EnumAction.BLOCK; + boolean consume = false; + + if (item instanceof ItemFood && player.canEat(((ItemFood) item).isAlwaysEdible())) { + consume = action == EnumAction.EAT || action == EnumAction.DRINK; + } + + if (block || consume) { + blockHitOverride = true; + } + } + } else { + boolean block = action == EnumAction.BLOCK; + boolean consume = false; + + if (item instanceof ItemFood && player.canEat(((ItemFood) item).isAlwaysEdible())) { + consume = action == EnumAction.EAT || action == EnumAction.DRINK; + } + + if (block || consume) { + blockHitOverride = true; + } + } + + } + + if ((useCount > 0 || blockHitOverride) && action != EnumAction.NONE && this.mc.thePlayer.isUsingItem()) { + switch (action) { + case EAT: + case DRINK: + this.doConsumeAnimation(stack, useCount, partialTicks); + this.doEquipAndSwingTransform(equipProgress, ModuleOneSevenVisuals.oldBlockHitting.getBooleanValue() ? swingProgress : 0.0f); + break; + case BLOCK: + this.doEquipAndSwingTransform(equipProgress, ModuleOneSevenVisuals.oldBlockHitting.getBooleanValue() ? swingProgress : 0.0f); + this.doSwordBlockAnimation(); + break; + case BOW: + this.doEquipAndSwingTransform(equipProgress, ModuleOneSevenVisuals.oldBlockHitting.getBooleanValue() ? swingProgress : 0.0f); + this.doBowAnimation(stack, useCount, partialTicks); + } + } else { + this.doSwingTranslation(swingProgress); + this.doEquipAndSwingTransform(equipProgress, swingProgress); + } + + if (item.shouldRotateAroundWhenRendering()) { + GlStateManager.rotate(180.0f, 0.0f, 1.0f, 0.0f); + } + + if (this.doFirstPersonTransform(stack)) { + renderer.renderItem(player, stack, ItemCameraTransforms.TransformType.FIRST_PERSON); + } else { + renderer.renderItem(player, stack, ItemCameraTransforms.TransformType.NONE); + } + + GlStateManager.popMatrix(); + + if (item instanceof ItemCloth) { + GlStateManager.disableBlend(); + } + + GlStateManager.disableRescaleNormal(); + RenderHelper.disableStandardItemLighting(); + return true; + } + + public void doSwordBlock3rdPersonTransform() { + if (ModuleOneSevenVisuals.oldSwordBlock3.getBooleanValue()) { + GlStateManager.translate(-0.15f, -0.2f, 0.0f); + GlStateManager.rotate(70.0f, 1.0f, 0.0f, 0.0f); + GlStateManager.translate(0.119f, 0.2f, -0.024f); + } + } + + private boolean doFirstPersonTransform(ItemStack stack) { + + switch (stack.getItemUseAction()) { + case BOW: { + if (ModuleOneSevenVisuals.oldBow.getBooleanValue()) break; + return true; + } + case EAT: + case DRINK: { + if (ModuleOneSevenVisuals.oldEating.getBooleanValue()) break; + return true; + } + case BLOCK: { + if (ModuleOneSevenVisuals.oldSwordBlock.getBooleanValue()) break; + return true; + } + case NONE: { + if (ModuleOneSevenVisuals.oldModel.getBooleanValue()) break; + return true; + } + } + + GlStateManager.translate(0.58800083f, 0.36999986f, -0.77000016f); + GlStateManager.translate(0.0f, -0.3f, 0.0f); + GlStateManager.scale(1.5f, 1.5f, 1.5f); + GlStateManager.rotate(50.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(335.0f, 0.0f, 0.0f, 1.0f); + GlStateManager.translate(-0.9375f, -0.0625f, 0.0f); + GlStateManager.scale(-2.0f, 2.0f, -2.0f); + + if (this.mc.getRenderItem().shouldRenderItemIn3D(stack)) { + GlStateManager.scale(0.58823526f, 0.58823526f, 0.58823526f); + GlStateManager.rotate(-25.0f, 0.0f, 0.0f, 1.0f); + GlStateManager.rotate(0.0f, 1.0f, 0.0f, 0.0f); + GlStateManager.rotate(135.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.translate(0.0f, -0.25f, -0.125f); + GlStateManager.scale(0.5f, 0.5f, 0.5f); + return true; + } + + GlStateManager.scale(0.5f, 0.5f, 0.5f); + return false; + } + + private void doConsumeAnimation(ItemStack stack, int useCount, float partialTicks) { + + if (ModuleOneSevenVisuals.oldEating.getBooleanValue()) { + float useAmount = (float) useCount - partialTicks + 1.0f; + float useAmountNorm = 1.0f - useAmount / (float) stack.getMaxItemUseDuration(); + float useAmountPow = 1.0f - useAmountNorm; + + useAmountPow = useAmountPow * useAmountPow * useAmountPow; + useAmountPow = useAmountPow * useAmountPow * useAmountPow; + useAmountPow = useAmountPow * useAmountPow * useAmountPow; + + float useAmountFinal = 1.0f - useAmountPow; + + GlStateManager.translate(0.0f, MathHelper.abs(MathHelper.cos(useAmount / 4.0f * (float) Math.PI) * 0.1f) * (float) ((double) useAmountNorm > 0.2 ? 1 : 0), 0.0f); + GlStateManager.translate(useAmountFinal * 0.6f, -useAmountFinal * 0.5f, 0.0f); + GlStateManager.rotate(useAmountFinal * 90.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(useAmountFinal * 10.0f, 1.0f, 0.0f, 0.0f); + GlStateManager.rotate(useAmountFinal * 30.0f, 0.0f, 0.0f, 1.0f); + } else { + float f = (float) useCount - partialTicks + 1.0f; + float f1 = f / (float) stack.getMaxItemUseDuration(); + float f2 = MathHelper.abs(MathHelper.cos(f / 4.0f * (float) Math.PI) * 0.1f); + + if (f1 >= 0.8f) { + f2 = 0.0f; + } + + GlStateManager.translate(0.0f, f2, 0.0f); + float f3 = 1.0f - (float) Math.pow(f1, 27.0); + + GlStateManager.translate(f3 * 0.6f, f3 * -0.5f, f3 * 0.0f); + GlStateManager.rotate(f3 * 90.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(f3 * 10.0f, 1.0f, 0.0f, 0.0f); + GlStateManager.rotate(f3 * 30.0f, 0.0f, 0.0f, 1.0f); + } + + } + + private void doSwingTranslation(float swingProgress) { + float swingProgress2 = MathHelper.sin(swingProgress * (float) Math.PI); + float swingProgress3 = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float) Math.PI); + + GlStateManager.translate(-swingProgress3 * 0.4f, MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float) Math.PI * 2.0f) * 0.2f, -swingProgress2 * 0.2f); + } + + private void doEquipAndSwingTransform(float equipProgress, float swingProgress) { + GlStateManager.translate(0.56f, -0.52f - (1.0f - equipProgress) * 0.6f, -0.72f); + GlStateManager.rotate(45.0f, 0.0f, 1.0f, 0.0f); + + float swingProgress2 = MathHelper.sin(swingProgress * swingProgress * (float) Math.PI); + float swingProgress3 = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float) Math.PI); + + GlStateManager.rotate(-swingProgress2 * 20.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(-swingProgress3 * 20.0f, 0.0f, 0.0f, 1.0f); + GlStateManager.rotate(-swingProgress3 * 80.0f, 1.0f, 0.0f, 0.0f); + GlStateManager.scale(0.4f, 0.4f, 0.4f); + } + + private void doSwordBlockAnimation() { + GlStateManager.translate(-0.5f, 0.2f, 0.0f); + GlStateManager.rotate(30.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(-80.0f, 1.0f, 0.0f, 0.0f); + GlStateManager.rotate(60.0f, 0.0f, 1.0f, 0.0f); + } + + private void doBowAnimation(ItemStack stack, int useCount, float partialTicks) { + GlStateManager.rotate(-18.0f, 0.0f, 0.0f, 1.0f); + GlStateManager.rotate(-12.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(-8.0f, 1.0f, 0.0f, 0.0f); + GlStateManager.translate(-0.9f, 0.2f, 0.0f); + + float totalPullback = (float) stack.getMaxItemUseDuration() - ((float) useCount - partialTicks + 1.0f); + float pullbackNorm = totalPullback / 20.0f; + pullbackNorm = (pullbackNorm * pullbackNorm + pullbackNorm * 2.0f) / 3.0f; + + if (pullbackNorm > 1.0f) { + pullbackNorm = 1.0f; + } + + if (pullbackNorm > 0.1f) { + GlStateManager.translate(0.0f, MathHelper.sin((totalPullback - 0.1f) * 1.3f) * 0.01f * (pullbackNorm - 0.1f), 0.0f); + } + + GlStateManager.translate(0.0f, 0.0f, pullbackNorm * 0.1f); + + if (ModuleOneSevenVisuals.oldBow.getBooleanValue()) { + GlStateManager.rotate(-335.0f, 0.0f, 0.0f, 1.0f); + GlStateManager.rotate(-50.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.translate(0.0f, 0.5f, 0.0f); + } + + float zScale = 1.0f + pullbackNorm * 0.2f; + GlStateManager.scale(1.0f, 1.0f, zScale); + + if (ModuleOneSevenVisuals.oldBow.getBooleanValue()) { + GlStateManager.translate(0.0f, -0.5f, 0.0f); + GlStateManager.rotate(50.0f, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(335.0f, 0.0f, 0.0f, 1.0f); + } + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/FishingLineHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/FishingLineHandler.java new file mode 100644 index 0000000..8c1323b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/FishingLineHandler.java @@ -0,0 +1,21 @@ +package com.cheatbreaker.client.module.impl.normal.animation.util; + +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Vec3; + +/** + * @ModuleUtility - FishingLineHandler + * @see ModuleOneSevenVisuals + * + * This class handles fishing rod visuals. + */ +public class FishingLineHandler { + public static final FishingLineHandler INSTANCE = new FishingLineHandler(); + + public Vec3 getOffset() { + double fov = Minecraft.getMinecraft().gameSettings.fovSetting; + double decimalFov = fov / 110.0; + return new Vec3(-decimalFov + decimalFov / 2.5 - decimalFov / 8.0 + 0.16, 0.0, 0.4); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/SneakHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/SneakHandler.java new file mode 100644 index 0000000..635fe19 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/animation/util/SneakHandler.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.module.impl.normal.animation.util; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; + +/** + * @ModuleUtility - SneakHandler + * @see ModuleOneSevenVisuals + * @see net.minecraft.entity.player.EntityPlayer + * + * This class handles player sneaking visuals. + */ +public class SneakHandler { + private static final float START_HEIGHT = 1.62f; + private static final float END_HEIGHT = 1.54f; + private static final SneakHandler INSTANCE = new SneakHandler(); + private float eyeHeight; + private float lastEyeHeight; + + public SneakHandler() { + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + } + + public static SneakHandler getInstance() { + return INSTANCE; + } + + public float getEyeHeight(float partialTicks) { + if (!ModuleOneSevenVisuals.smoothSneaking.getBooleanValue()) { + return this.eyeHeight; + } + return this.lastEyeHeight + (this.eyeHeight - this.lastEyeHeight) * partialTicks; + } + + public void onTick(TickEvent event) { + this.lastEyeHeight = this.eyeHeight; + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player == null) { + this.eyeHeight = 1.62f; + return; + } + if (player.isSneaking()) { + this.eyeHeight = 1.54f; + } else if (!ModuleOneSevenVisuals.longSneaking.getBooleanValue()) { + this.eyeHeight = 1.62f; + } else if (this.eyeHeight < 1.62f) { + float delta = 1.62f - this.eyeHeight; + delta = (float) ((double) delta * 0.4); + this.eyeHeight = 1.62f - delta; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/FPS.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/FPS.java new file mode 100644 index 0000000..cb05367 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/FPS.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import org.lwjgl.opengl.GL11; + +/** + * @Module - FPS + * @see AbstractModule + * + * This mod is the Vanilla CheatBreaker FPS Module, likely will be used for reference later on. + * NOTE: This will be removed towards the end of the Recode Branch. + */ +@Deprecated +public class FPS extends AbstractModule { + private final Setting background; + private final Setting textColor; + private final Setting backgroundColor; + + public FPS() { + super("FPS"); + this.setDefaultAnchor(GuiAnchor.RIGHT_TOP); + this.setDefaultTranslations(0.0f, 0.0f); + this.setState(false); + this.background = new Setting(this, "Show Background").setValue(true); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x6F000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.setPreviewLabel("[144 FPS]", 1.4f); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if ((Boolean) this.background.getValue()) { + this.setDimensions(56, 18); + Gui.drawRect(0.0f, 0.0f, 56, 13, this.backgroundColor.getColorValue()); + String string = Minecraft.debugFPS + " FPS"; + this.mc.fontRendererObj.drawString(string, (int) (this.width / 2.0f - (float) (this.mc.fontRendererObj.getStringWidth(string) / 2)), 3, this.textColor.getColorValue()); + } else { + String string = "[" + Minecraft.debugFPS + " FPS]"; + this.setDimensions(this.mc.fontRendererObj.drawString(string, this.width / 2.0f - (float) (this.mc.fontRendererObj.getStringWidth(string) / 2), 0.0f, this.textColor.getColorValue(), true), 18); + } + GL11.glPopMatrix(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleBossBar.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleBossBar.java new file mode 100644 index 0000000..cf1f7c1 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleBossBar.java @@ -0,0 +1,127 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +/** + * @Module - ModuleBossBar + * @see AbstractModule + * + * This module displays the current Minecraft Boss' health. + */ +public class ModuleBossBar extends AbstractModule { + private final Setting textColor; + private final Setting renderHealth; + private final Setting renderText; + private final Setting textShadow; + private final Setting textPosition; + private final Setting barWidth; + private final Setting barHeight; + private final Setting bossTexture; + private final Setting bossBarColor; + private final Setting topBossBarColor; + private final Setting bottomBossBarColor; + private final Setting outlineBossBarColor; + + public ModuleBossBar() { + super("Boss Bar"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.notRenderHUD = false; + this.renderText = new Setting(this, "Render Text").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.renderHealth = new Setting(this, "Render Health").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadow = new Setting(this, "Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.renderText.getValue()); + this.bossTexture = new Setting(this, "Boss Bar Texture").setValue("Texture Pack").acceptedStringValues("Texture Pack", "Default", "Blurred", "Custom").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue()); + this.textPosition = new Setting(this, "Text Position").setValue(50.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && (Boolean) this.renderText.getValue()); + this.barWidth = new Setting(this, "Boss Bar Width").setValue(182.0F).setMinMax(100.0F, 200.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.barHeight = new Setting(this, "Boss Bar Height").setValue(5.0F).setMinMax(3.0f, 24.0f).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderText.getValue()); + this.bossBarColor = new Setting(this, "Boss Bar Color").setValue(-65337).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && !this.bossTexture.getValue().equals("Texture Pack") && !this.bossTexture.getValue().equals("Custom")); + this.topBossBarColor = new Setting(this, "Top Boss Bar Color").setValue(0xFFEC00B8).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.bottomBossBarColor = new Setting(this, "Bottom Boss Bar Color").setValue(0xFF8C006D).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.outlineBossBarColor = new Setting(this, "Outline Boss Bar Color").setValue(0xFF4A003A).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/bossbar.png"), 106, 5); + this.setDescription("Displays the current boss and health."); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.setDefaultState(true); + } + + public void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) return; + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if (BossStatus.bossName == null || BossStatus.statusBarTime <= 0) { + this.render("Wither", 1.0F, 0, (Boolean) renderText.getValue() ? 10 : 0); + } + GL11.glPopMatrix(); + } + + public void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud()) return; + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if (BossStatus.bossName != null && BossStatus.statusBarTime > 0) { + --BossStatus.statusBarTime; + this.render(BossStatus.bossName, BossStatus.healthScale, 0, (Boolean) renderText.getValue() ? 10 : 0); + } + GL11.glPopMatrix(); + } + + public void render(String bossName, float healthScale, int x, int y) { + GlStateManager.enableBlend(); + int barColor = this.bossBarColor.getColorValue(); + if (this.bossTexture.getValue().equals("Texture Pack")) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.icons); + } else { + GL11.glColor4f((barColor >> 16 & 255) / 255.0F, (barColor >> 8 & 255) / 255.0F, (barColor & 255) / 255.0F, (barColor >> 24 & 255) / 255.0F); + this.mc.getTextureManager().bindTexture(new ResourceLocation("client/icons/bossbar/" + this.bossTexture.getValue().toString().toLowerCase() + ".png")); + } + + FontRenderer font = this.mc.fontRendererObj; + float width = this.bossTexture.getValue().equals("Custom") ? this.barWidth.getFloatValue() : 182; + float x2 = !(Boolean) renderText.getValue() || font.getStringWidth(bossName) < width ? x : x + (font.getStringWidth(bossName) - width) * this.textPosition.getFloatValue() / 100.0F; + int y2 = y; + float remainingHealth = healthScale * width; + if ((Boolean) renderHealth.getValue()) { + if (this.bossTexture.getValue().equals("Custom")) { + int top = new Color((this.topBossBarColor.getColorValue() >> 16 & 255) / 4, (this.topBossBarColor.getColorValue() >> 8 & 255) / 4, (this.topBossBarColor.getColorValue() & 255) / 4, this.topBossBarColor.getColorValue() >> 24 & 255).getRGB(); + int bottom = new Color((this.bottomBossBarColor.getColorValue() >> 16 & 255) / 4, (this.bottomBossBarColor.getColorValue() >> 8 & 255) / 4, (this.bottomBossBarColor.getColorValue() & 255) / 4, this.bottomBossBarColor.getColorValue() >> 24 & 255).getRGB(); + RenderUtil.drawGradientRectWithOutline(x2, y2, x2 + width, y2 + this.barHeight.getFloatValue(), this.outlineBossBarColor.getColorValue(), top, bottom); + if (remainingHealth > 0) { + RenderUtil.drawGradientRectWithOutline(x2, y2, x2 + remainingHealth, y2 + this.barHeight.getFloatValue(), 0, this.topBossBarColor.getColorValue(), this.bottomBossBarColor.getColorValue()); + } + RenderUtil.drawGradientRectWithOutline(x2, y2, x2 + width, y2 + this.barHeight.getFloatValue(), this.outlineBossBarColor.getColorValue(), 0, 0); + } else { + this.mc.ingameGUI.drawTexturedModalRect(x2, y2, 0, 74, (int) width, 5); + this.mc.ingameGUI.drawTexturedModalRect(x2, y2, 0, 74, (int) width, 5); + if (remainingHealth > 0) { + this.mc.ingameGUI.drawTexturedModalRect(x2, y2, 0, 79, (int) remainingHealth, 5); + } + } + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + if ((Boolean) renderText.getValue()) + font.drawString(bossName, x + this.width / 2 - (float) (font.getStringWidth(bossName) / 2), y - 10, this.textColor.getColorValue(), (Boolean) this.textShadow.getValue()); + float barHeight = (Boolean) renderHealth.getValue() ? this.bossTexture.getValue().equals("Custom") ? this.barHeight.getFloatValue() : 5.0F : 0.0F; + float textHeight = (Boolean) renderText.getValue() ? 9.0F : 0.0F; + float extraHeight = (Boolean) renderText.getValue() && (Boolean) renderHealth.getValue() ? 1.0F : 0.0F; + this.setDimensions((Boolean) renderHealth.getValue() ? (Boolean) renderText.getValue() ? Math.max(font.getStringWidth(bossName), width) : width : (float) (font.getStringWidth(bossName)), barHeight + textHeight + extraHeight); + GlStateManager.disableBlend(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleCoordinates.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleCoordinates.java new file mode 100644 index 0000000..30dc03e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleCoordinates.java @@ -0,0 +1,141 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.event.impl.mouse.ClickEvent; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +public class ModuleCoordinates extends AbstractModule { + private final Setting generalOptions; + private final Setting showWhileTyping; + private final Setting mode; + private final Setting coords; + private final Setting hideYCoord; + private final Setting direction; + + public Setting customLine; + + private final Setting colorSettings; + private final Setting coordsColor; + private final Setting directionColor; + private final List clicks = new ArrayList<>(); + + public ModuleCoordinates() { + super("Coordinates"); + + this.setDefaultAnchor(GuiAnchor.LEFT_TOP); + this.setDefaultTranslations(-1, 0.0f); + this.setDefaultState(false); + + this.generalOptions = new Setting(this, "label").setValue("General Options"); + this.showWhileTyping = new Setting(this, "Show While Typing", "Show the mod when opening chat.").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.mode = new Setting(this, "Mode", "Layout the mod should display.").setValue("Horizontal").acceptedStringValues("Horizontal", "Vertical").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.coords = new Setting(this, "Coordinates", "Show the coordiantes.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideYCoord = new Setting(this, "Hide Y Coordinate", "Hide the Y coordinate.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coords.getValue()); + this.direction = new Setting(this, "Direction", "Show the direction the player is facing.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.customLine = new Setting(this, "Custom Line").setValue("").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.colorSettings = new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coords.getValue() || (Boolean) this.direction.getValue()); + this.coordsColor = new Setting(this, "Coordinates Color", "Change the coordinates text color.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coords.getValue()); + this.directionColor = new Setting(this, "Direction Color", "Change the direction text color.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.direction.getValue()); + + this.setPreviewLabel("(16, 65, 120) NW", 1.0f); + this.setDescription("Shows your X, Y, and Z coordinates as well as your direction."); + + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(ClickEvent.class, this::onOldClickEvent); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + GlStateManager.enableBlend(); + this.scaleAndTranslate(event.getScaledResolution()); + int n = MathHelper.floor_double(this.mc.thePlayer.posX); + int n2 = (int) this.mc.thePlayer.boundingBox.minY; + int n3 = MathHelper.floor_double(this.mc.thePlayer.posZ); + if (!this.mc.ingameGUI.getChatGUI().getChatOpen() || (Boolean) this.showWhileTyping.getValue()) { + if (this.customLine.getValue().equals("")) { + int n4 = 0; + float f = 4; + if ((Boolean) this.coords.getValue()) { + if (this.mode.getValue().equals("Horizontal")) { + String horizontalString = ((Boolean) this.hideYCoord.getValue() ? String.format("(%1$d, %2$d)", n, n3) : String.format("(%1$d, %2$d, %3$d)", n, n2, n3)) + ((Boolean) this.direction.getValue() ? " " : ""); + n4 = this.mc.fontRendererObj.drawStringWithShadow(horizontalString, 0.0f, 0.0f, this.coordsColor.getColorValue()); + } else { + n4 = 50; + f = (Boolean) this.hideYCoord.getValue() ? 9.5F : 16.0F; + this.mc.fontRendererObj.drawStringWithShadow("X: " + n, 0.0f, 0.0f, this.coordsColor.getColorValue()); + if (!(Boolean) this.hideYCoord.getValue()) { + this.mc.fontRendererObj.drawStringWithShadow("Y: " + n2, 0.0f, 12.0F, this.coordsColor.getColorValue()); + } + this.mc.fontRendererObj.drawStringWithShadow("Z: " + n3, 0.0f, (Boolean) this.hideYCoord.getValue() ? 12.0F : 24.0F, this.coordsColor.getColorValue()); + } + } + if ((Boolean) this.direction.getValue()) { + String[] directions = new String[]{"N", "NE", "E", "SE", "S", "SW", "W", "NW"}; + double d = (double) MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw) + 180.0; + d += 22.5D; + d %= 360.0; + String string = directions[MathHelper.floor_double(d / 45)]; + this.mc.fontRendererObj.drawStringWithShadow(string, (float) n4, f - (float) 4, this.directionColor.getColorValue()); + n4 += this.mc.fontRendererObj.getStringWidth(string); + } + this.setDimensions(n4, Math.max(f + (!this.mode.getValue().equals("Horizontal") && (Boolean) this.coords.getValue() ? 18.0F : 0.0F), this.mc.fontRendererObj.FONT_HEIGHT)); + } else { + String[] arrstring = ((String) this.customLine.getValue()).split("%NL%"); + float f = -1; + float f2 = arrstring.length * (this.mc.fontRendererObj.FONT_HEIGHT + 1); + int n5 = 0; + for (String string : arrstring) { + float f3 = this.mc.fontRendererObj.drawStringWithShadow(string = this.customText(string), 0.0f, (float) ((this.mc.fontRendererObj.FONT_HEIGHT + 1) * n5), -1); + if (f3 > f) { + f = f3; + } + this.setDimensions((int) f, (int) (Math.max(f2, this.mc.fontRendererObj.FONT_HEIGHT))); + ++n5; + } + } + } + GlStateManager.disableBlend(); + GL11.glPopMatrix(); + } + + private String customText(String string) { + String[] arrstring = new String[]{"N", "NE", "E", "SE", "S", "SW", "W", "NW"}; + double d = (double) MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw) + 180.0; + d += 22.5D; + d %= 360.0; + String string2 = arrstring[MathHelper.floor_double(d /= 45.0)]; + int n = MathHelper.floor_double(this.mc.thePlayer.posX); + int n2 = (int) this.mc.thePlayer.boundingBox.minY; + int n3 = MathHelper.floor_double(this.mc.thePlayer.posZ); + string = !this.mc.isIntegratedServerRunning() && this.mc.theWorld != null ? string.replaceAll("%IP%", this.mc.currentServerData.serverIP) : string.replaceAll("%IP%", "?"); + return string.replaceAll("%FPS%", Minecraft.debugFPS + "").replaceAll("%DIR%", string2).replaceAll("%CPS%", this.clicks.size() + "").replaceAll("%COORDS%", String.format("%1$d, %2$d, %3$d", n, n2, n3)).replaceAll("%X%", n + "").replaceAll("%Y%", n2 + "").replaceAll("%Z%", n3 + ""); + } + + private void onTick(TickEvent event) { + if (((String) this.customLine.getValue()).contains("%CPS%")) { + this.clicks.removeIf(l -> l < System.currentTimeMillis() - 1000L); + } + } + + private void onOldClickEvent(ClickEvent event) { + if (event.getMouseButton() == 0 && ((String) this.customLine.getValue()).contains("%CPS%")) { + this.clicks.add(System.currentTimeMillis()); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleDirectionHUD.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleDirectionHUD.java new file mode 100644 index 0000000..4488971 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleDirectionHUD.java @@ -0,0 +1,114 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.HudUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ModuleDirectionHUD extends AbstractModule { + private final Setting markerColor; + private final Setting directionColor; + private final Setting highlightColor; + private final Setting backgroundColor; + private final Setting borderColor; + private final Setting showWhileTyping; + private final Setting background; + private final Setting border; + private final Setting borderThickness; + private final Setting highlightNorth; + private final ResourceLocation texture = new ResourceLocation("textures/gui/compass.png"); + + public ModuleDirectionHUD() { + super("Direction HUD"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.setState(false); + this.showWhileTyping = new Setting(this, "Show While Typing", "Show the mod when opening chat.").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.highlightNorth = new Setting(this, "Highlight North", "Make North highlight a different color.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.background = new Setting(this, "Show Background", "Draw a background.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.border = new Setting(this, "Show Border", "Draw a border around the background.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.borderThickness = new Setting(this, "Border Thickness", "Change the thickness of the border.").setValue(1.0F).setMinMax(0.25F, 3.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.border.getValue()); + this.markerColor = new Setting(this, "Marker Color", "Change the marker color.").setValue(-43691).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.directionColor = new Setting(this, "Direction Color", "Change the direction color.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightColor = new Setting(this, "Highlight Color", "Change the highlight color.").setValue(-43691).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.highlightNorth.getValue()); + this.backgroundColor = new Setting(this, "Background Color", "Change the background color.").setValue(0xFF212121).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.borderColor = new Setting(this, "Border Color", "Sets the color for the border.").setValue(-1627389952).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.border.getValue()); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/dirhud.png"), 65, 12); + this.setDescription("Displays your cardinal direction."); + this.setCreators("bspkrs", "jadedcat"); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + GlStateManager.enableBlend(); + this.scaleAndTranslate(event.getScaledResolution()); + this.setDimensions(66, 12); + if (!this.mc.ingameGUI.getChatGUI().getChatOpen() || (Boolean) this.showWhileTyping.getValue()) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.drawCompass(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + GlStateManager.disableBlend(); + GL11.glPopMatrix(); + } + + private void drawCompass() { + int n = MathHelper.floor_double((double) (this.mc.thePlayer.rotationYaw * (float) 256 / (float) 360) + 0.3450704167414649 * 1.4489796161651611) & 0xFF; + int n2 = 0; + int n3 = 0; + if ((Integer) this.directionColor.getValue() != 4095) { + int directionColor = this.directionColor.getColorValue(); + int backgroundColor = this.backgroundColor.getColorValue(); + int highlightColor = this.highlightColor.getColorValue(); + this.mc.getTextureManager().bindTexture(this.texture); + if ((Boolean) this.background.getValue()) { + GL11.glColor4f((float) (backgroundColor >> 16 & 0xFF) / (float) 255, (float) (backgroundColor >> 8 & 0xFF) / (float) 255, (float) (backgroundColor & 0xFF) / (float) 255, (float) (backgroundColor >> 24 & 255) / (float) 255); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 0, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 12, 66, 12, -100); + } + } + + GL11.glColor4f((float) (directionColor >> 16 & 0xFF) / (float) 255, (float) (directionColor >> 8 & 0xFF) / (float) 255, (float) (directionColor & 0xFF) / (float) 255, (float) (directionColor >> 24 & 255) / (float) 255); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 24, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 36, 66, 12, -100); + } + if ((Boolean) this.highlightNorth.getValue()) { + GL11.glColor4f((float) (highlightColor >> 16 & 255) / (float) 255, (float) (highlightColor >> 8 & 255) / (float) 255, (float) (highlightColor & 255) / (float) 255, (float) (highlightColor >> 24 & 255) / (float) 255); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 72, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 84, 66, 12, -100); + } + } + } else { + this.mc.getTextureManager().bindTexture(this.texture); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 0, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 12, 66, 12, -100); + } + } + this.mc.fontRendererObj.drawString("|", n3 + 32, n2 + 1, this.markerColor.getColorValue()); + this.mc.fontRendererObj.drawString("|§r", n3 + 32, n2 + 5, this.markerColor.getColorValue()); + if ((Boolean) this.border.getValue()) { + float borderThickness = (Float) this.borderThickness.getValue(); + Gui.drawOutline(-borderThickness, -borderThickness, 66 + borderThickness, 12 + borderThickness, borderThickness, this.borderColor.getColorValue()); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleNotifications.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleNotifications.java new file mode 100644 index 0000000..45bd127 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleNotifications.java @@ -0,0 +1,182 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.tick.KeepAliveEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * @Module - ModuleNotifications + * @see AbstractModule + * + * This module displays custom Notifications for the CheatBreaker Client. + */ +public class ModuleNotifications extends AbstractModule { + public long time = System.currentTimeMillis(); + private final List notifications = new ArrayList<>(); + + public ModuleNotifications() { + super("Notifications"); + this.addEvent(KeepAliveEvent.class, this::onKeepAlive); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.setDefaultState(true); + } + + private void onKeepAlive(KeepAliveEvent event) { + this.time = System.currentTimeMillis(); + } + + private void onTick(TickEvent event) { + Iterator iterator = this.notifications.iterator(); + while (iterator.hasNext()) { + Notification notification = iterator.next(); + notification.onTick(); + long l = notification.ticks + notification.duration - System.currentTimeMillis(); + if (l > 0L) continue; + int n = notification.scaledWidth; + for (Notification notification2 : this.notifications) { + if (notification2.scaledWidth >= notification.scaledWidth) continue; + notification2.activeTicks = 0; + notification2.scaledHeight = n; + n = notification2.scaledWidth; + } + iterator.remove(); + } + } + + private void onGuiDraw(GuiDrawEvent event) { + for (Notification notification : this.notifications) { + notification.render(event.getScaledResolution().getScaledWidth()); + } + } + + public void send(String notificationType, String message, long duration) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + if (duration < 2000L) { + duration = 2000L; + } + + message = message.replaceAll("&([abcdefghijklmrABCDEFGHIJKLMNR0-9])|(&$)", "§$1"); + Type type; + switch (notificationType.toLowerCase()) { + case "info": + type = Type.INFO; + break; + case "error": + type = Type.ERROR; + break; + default: + type = Type.NEUTRAL; + } + + Notification var11 = new Notification(this, scaledResolution, type, message, duration); + int var12 = var11.scaledHeight - var11.height - 2; + + for (int var9 = this.notifications.size() - 1; var9 >= 0; --var9) { + Notification var10 = this.notifications.get(var9); + var10.activeTicks = 0; + var10.scaledHeight = var12; + var12 -= 2 + var10.height; + } + + this.notifications.add(var11); + } + + class Notification { + public Type type; + public String message; + public long duration; + public long ticks = System.currentTimeMillis(); + public int scaledWidth; + public int scaledHeight; + public int height; + public int activeTicks = 0; + final ModuleNotifications notificationsMod; + + Notification(ModuleNotifications notificationsMod, ScaledResolution scaledResolution, Type type, String message, long duration) { + this.notificationsMod = notificationsMod; + this.type = type; + this.message = message; + this.duration = duration; + this.height = type == Type.NEUTRAL ? 16 : 20; + this.scaledHeight = scaledResolution.getScaledHeight() - 14 - this.height; + this.scaledWidth = scaledResolution.getScaledHeight() + this.height; + } + + public void onTick() { + if (this.scaledHeight != -1) { + ++this.activeTicks; + float f = (float) this.activeTicks * ((float) this.activeTicks / (float) 5) / (float) 7; + if (this.scaledWidth > this.scaledHeight) { + if ((float) this.scaledWidth - f < (float) this.scaledHeight) { + this.scaledWidth = this.scaledHeight; + this.scaledHeight = -1; + } else { + this.scaledWidth = (int) ((float) this.scaledWidth - f); + } + } else if (this.scaledWidth < this.scaledHeight) { + if ((float) this.scaledWidth + f > (float) this.scaledHeight) { + this.scaledWidth = this.scaledHeight; + this.scaledHeight = -1; + } else { + this.scaledWidth = (int) ((float) this.scaledWidth + f); + } + } else if (this.scaledWidth == this.scaledHeight) { + this.scaledHeight = -1; + } + } + } + + public void render(int n) { + CBFontRenderer cBFontRenderer = CheatBreaker.getInstance().playRegular16px; + int n2 = this.scaledWidth; + float f = cBFontRenderer.getStringWidth(this.message); + int n3 = (int) (this.type == Type.NEUTRAL ? f + (float) 10 : f + (float) 30); + Gui.drawRect(n - 5 - n3, n2, n - 5, n2 + this.height, -1358954496); + switch (this.type) { + + case ERROR: + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(new ResourceLocation("client/icons/error-64.png"), (float) 6, (float) (n - 10 - n3 + 9), (float) (n2 + 4)); + Gui.drawRect((float) (n - 10) - f - 4.5f, n2 + 4, (float) (n - 10) - f - 4.0F, n2 + this.height - 4, -1342177281); + break; + + case INFO: + GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.65F); + RenderUtil.renderIcon(new ResourceLocation("client/icons/info-64.png"), (float) 6, (float) (n - 10 - n3 + 9), (float) (n2 + 4)); + Gui.drawRect((float) (n - 10) - f - 4.5f, n2 + 4, (float) (n - 10) - f - 4.0F, n2 + this.height - 4, -1342177281); + } + + long l = this.duration - (this.ticks + this.duration - System.currentTimeMillis()); + if (l > this.duration) { + l = this.duration; + } + if (l < 0L) { + l = 0L; + } + float f2 = f * ((float) l / (float) this.duration * (float) 100 / (float) 100); + Gui.drawRect((float) (n - 10) - f, (float) (n2 + this.height) - 56.46667f * 0.077922076f, (float) (n - 10) - f + f, n2 + this.height - 4, 0x30666666); + Gui.drawRect((float) (n - 10) - f, (float) (n2 + this.height) - 2.2f * 2.0f, (float) (n - 10) - f + f2, n2 + this.height - 4, -1878982912); + cBFontRenderer.drawString(this.message, (float) (n - 10) - f, (float) (n2 + (this.type == Type.NEUTRAL ? 2 : 4)), -1); + } + } + + enum Type { + INFO, + ERROR, + NEUTRAL + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePlayerList.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePlayerList.java new file mode 100644 index 0000000..89174f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePlayerList.java @@ -0,0 +1,300 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.profile.ClientProfile; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.mojang.authlib.GameProfile; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiPlayerTabOverlay; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.WorldSettings; +import org.apache.commons.lang3.ObjectUtils; +import org.lwjgl.opengl.GL11; + +import java.util.List; +import java.util.regex.Pattern; + +/** + * @Module - ModulePlayerList + * @see AbstractModule + * + * This module allows you to edit the default Minecraft player list. + */ +public class ModulePlayerList extends AbstractModule { + public Setting background; + public Setting rowBackground; + public Setting highlightSelfRow; + public Setting highlightCBRows; + public Setting backgroundColor; + public Setting pingRowColor; + public Setting rowColor; + public Setting highlightedSelfRowColor; + public Setting highlightedCBRowColor; + + public Setting nameTextShadow; + public Setting showLogo; + public Setting highlightSelfNameInTab; + public Setting highlightCBPlayersNamesInTab; + public Setting highlightedSelfNameColor; + public Setting highlightedCBNameColor; + + public Setting ping; + public Setting pingAsNumber; + public Setting pingTextShadow; + public Setting dynamicPingNumberColor; + public Setting staticPingColor; + public Setting lowPingColor; + public Setting mediumPingColor; + public Setting highPingColor; + public Setting extremelyHighPingColor; + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + + public ModulePlayerList() { + super("Player List"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.setDefaultTranslations(0.0F, 12.0F); + this.notRenderHUD = false; + + new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.background = new Setting(this, "Show Background").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.rowBackground = new Setting(this, "Show Row Background").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightSelfRow = new Setting(this, "Highlight Own Row").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightCBRows = new Setting(this, "Highlight CheatBreaker Players' Row").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pingRowColor = new Setting(this, "Use Ping Color for Row Background").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.rowBackground.getValue()); + this.rowColor = new Setting(this, "Row Background Color").setValue(0x20FFFFFF).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.rowBackground.getValue()); + this.highlightedSelfRowColor = new Setting(this, "Self Row Color").setValue(0x40AA0000).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.rowBackground.getValue() && (Boolean) this.highlightSelfRow.getValue()); + this.highlightedCBRowColor = new Setting(this, "CheatBreaker Row Color").setValue(0x40DA4253).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.rowBackground.getValue() && (Boolean) this.highlightCBRows.getValue()); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Name Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.nameTextShadow = new Setting(this, "Name Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showLogo = new Setting(this, "Show CheatBreaker Logo").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightSelfNameInTab = new Setting(this, "Highlight Own Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightCBPlayersNamesInTab = new Setting(this, "Highlight CheatBreaker Players' Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightedSelfNameColor = new Setting(this, "Self Text Color").setValue(0xFFCC2222).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.highlightSelfNameInTab.getValue()); + this.highlightedCBNameColor = new Setting(this, "CheatBreaker Text Color").setValue(0xFFFB6576).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.highlightCBPlayersNamesInTab.getValue()); + + new Setting(this, "label").setValue("Ping Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.ping = new Setting(this, "Show Ping").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pingAsNumber = new Setting(this, "Show Ping as Number").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.ping.getValue()); + this.pingTextShadow = new Setting(this, "Ping Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue()); + this.dynamicPingNumberColor = new Setting(this, "Dynamic Ping Number Color").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue()); + this.staticPingColor = new Setting(this, "Static Ping Color").setValue(0xFFFFFF55).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && !(Boolean) this.dynamicPingNumberColor.getValue()); + this.lowPingColor = new Setting(this, "Low Ping Color").setValue(0xFF55FF55).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + this.mediumPingColor = new Setting(this, "Medium Ping Color").setValue(0xFFFFFF55).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + this.highPingColor = new Setting(this, "High Ping Color").setValue(0xFFFF5555).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + this.extremelyHighPingColor = new Setting(this, "Extremely High Ping Color").setValue(0xFFAA0000).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + this.setDescription("Customize the player list tab."); + this.setAliases("Tab"); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + public String valueString() { + return null; + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + GL11.glPushMatrix(); + scaleAndTranslate(event.getScaledResolution()); + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int i = scaledresolution.getScaledWidth(); + Scoreboard scoreboard = this.mc.theWorld.getScoreboard(); + ScoreObjective scoreobjective = null; + ScoreObjective scoreobjective1 = scoreobjective != null ? scoreobjective : scoreboard.getObjectiveInDisplaySlot(1); + render(0, scoreboard, scoreobjective1, 0, 0); + GL11.glPopMatrix(); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + ScoreObjective var48 = this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(0); + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int i = scaledresolution.getScaledWidth(); + Scoreboard scoreboard = this.mc.theWorld.getScoreboard(); + ScoreObjective scoreobjective1; + scoreobjective1 = scoreboard.getObjectiveInDisplaySlot(0); + if (this.mc.gameSettings.keyBindPlayerList.isKeyDown() && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.getPlayerInfoMap().size() > 1 || var48 != null)) { + render(0, scoreboard, scoreobjective1, 0, 0); + } + GL11.glPopMatrix(); + } + } + + public void render(int width, Scoreboard scoreboardIn, ScoreObjective scoreObjectiveIn, int x, int y) { + NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue; + List list = GuiPlayerTabOverlay.field_175252_a.sortedCopy(nethandlerplayclient.getPlayerInfoMap()); + int i = 0; + int j = 0; + + for (NetworkPlayerInfo networkplayerinfo : list) { + int k = this.mc.fontRendererObj.getStringWidth(this.mc.ingameGUI.overlayPlayerList.getPlayerName(networkplayerinfo)); + i = Math.max(i, k); + + if (scoreObjectiveIn != null && scoreObjectiveIn.getRenderType() != IScoreObjectiveCriteria.EnumRenderType.HEARTS) { + k = this.mc.fontRendererObj.getStringWidth(" " + scoreboardIn.getValueFromObjective(networkplayerinfo.getGameProfile().getName(), scoreObjectiveIn).getScorePoints()); + j = Math.max(j, k); + } + } + + list = list.subList(0, Math.min(list.size(), 80)); + int l3 = list.size(); + int i4 = l3; + int j4; + + for (j4 = 1; i4 > 20; i4 = (l3 + j4 - 1) / j4) { + ++j4; + } + + boolean flag = this.mc.isIntegratedServerRunning() || this.mc.getNetHandler().getNetworkManager().getIsencrypted(); + int l; + + if (scoreObjectiveIn != null) { + if (scoreObjectiveIn.getRenderType() == IScoreObjectiveCriteria.EnumRenderType.HEARTS) { + l = 90; + } else { + l = j; + } + } else { + l = 0; + } + + int i1 = Math.min(j4 * ((flag ? 9 : 0) + i + l + 13), width - 50) / j4; + int j1 = 0/*width / 2 - (i1 * j4 + (j4 - 1) * 5) / 2*/; + int k1 = 10; + int l1 = i1 * j4 + (j4 - 1) * 5; + List list1 = null; + List list2 = null; + + if (this.mc.ingameGUI.overlayPlayerList.header != null) { + list1 = this.mc.fontRendererObj.listFormattedStringToWidth(this.mc.ingameGUI.overlayPlayerList.header.getFormattedText(), width - 50); + + for (String s : list1) { + l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s)); + } + } + + if (this.mc.ingameGUI.overlayPlayerList.footer != null) { + list2 = this.mc.fontRendererObj.listFormattedStringToWidth(this.mc.ingameGUI.overlayPlayerList.footer.getFormattedText(), width - 50); + + for (String s2 : list2) { + l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s2)); + } + } + + if (list1 != null) { + Gui.drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list1.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE); + + for (String s3 : list1) { + int i2 = this.mc.fontRendererObj.getStringWidth(s3); + this.mc.fontRendererObj.drawStringWithShadow(s3, (float) (width / 2 - i2 / 2), (float) k1, -1); + k1 += this.mc.fontRendererObj.FONT_HEIGHT; + } + + ++k1; + } + + Gui.drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + i4 * 9, Integer.MIN_VALUE); + + for (int k4 = 0; k4 < l3; ++k4) { + int l4 = k4 / i4; + int i5 = k4 % i4; + int j2 = 0/*j1 + l4 * i1 + l4 * 5*/; + int k2 = k1 + i5 * 9; + Gui.drawRect(j2, k2, j2 + i1, k2 + 8, 553648127); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + + if (k4 < list.size()) { + NetworkPlayerInfo networkplayerinfo1 = list.get(k4); + String s1 = this.mc.ingameGUI.overlayPlayerList.getPlayerName(networkplayerinfo1); + GameProfile gameprofile = networkplayerinfo1.getGameProfile(); + + if (flag) { + EntityPlayer entityplayer = this.mc.theWorld.getPlayerEntityByUUID(gameprofile.getId()); + boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE) && (gameprofile.getName().equals("Dinnerbone") || gameprofile.getName().equals("Grumm")); + this.mc.getTextureManager().bindTexture(networkplayerinfo1.getLocationSkin()); + int l2 = 8 + (flag1 ? 8 : 0); + int i3 = 8 * (flag1 ? -1 : 1); + Gui.drawScaledCustomSizeModalRect(j2, k2, 8.0F, (float) l2, 8, i3, 8, 8, 64.0F, 64.0F); + + if (entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.HAT)) { + int j3 = 8 + (flag1 ? 8 : 0); + int k3 = 8 * (flag1 ? -1 : 1); + Gui.drawScaledCustomSizeModalRect(j2, k2, 40.0F, (float) j3, 8, k3, 8, 8, 64.0F, 64.0F); + } + + j2 += 9; + } + + if (networkplayerinfo1.getGameType() == WorldSettings.GameType.SPECTATOR) { + s1 = EnumChatFormatting.ITALIC + s1; + this.mc.fontRendererObj.drawStringWithShadow(s1, (float) j2, (float) k2, -1862270977); + } else { + this.mc.fontRendererObj.drawStringWithShadow(s1, (float) j2, (float) k2, -1); + } + + if (scoreObjectiveIn != null && networkplayerinfo1.getGameType() != WorldSettings.GameType.SPECTATOR) { + int k5 = j2 + i + 1; + int l5 = k5 + l; + + if (l5 - k5 > 5) { + this.mc.ingameGUI.overlayPlayerList.drawScoreboardValues(scoreObjectiveIn, k2, gameprofile.getName(), k5, l5, networkplayerinfo1); + } + } + + this.mc.ingameGUI.overlayPlayerList.drawPing(i1, j2 - (flag ? 9 : 0), k2, networkplayerinfo1); + } + } + + if (list2 != null) { + k1 = k1 + i4 * 9 + 1; + Gui.drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list2.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE); + + for (String s4 : list2) { + int j5 = this.mc.fontRendererObj.getStringWidth(s4); + this.mc.fontRendererObj.drawStringWithShadow(s4, (float) (width / 2 - j5 / 2), (float) k1, -1); + k1 += this.mc.fontRendererObj.FONT_HEIGHT; + } + } + this.setDimensions(10, 10); + } + + private boolean isInPlayerList(String username) { + for (ClientProfile profile : CheatBreaker.getInstance().getProfileHandler().getWsOnlineUsers().values()) { + if (profile.getUsername().equalsIgnoreCase(username)) { + return true; + } + } + return false; + } + + private String stripColor(String input) { + return input == null ? null : this.STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePotionEffects.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePotionEffects.java new file mode 100644 index 0000000..072ddae --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePotionEffects.java @@ -0,0 +1,383 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.*; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableMap; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; + +import java.util.*; +import java.util.regex.Pattern; + +public class ModulePotionEffects extends AbstractModule { + private final Setting componentOptionsLabel; + private final Setting showIcon; + private final Setting effectName; + private final Setting effectNameText; + private final Setting effectAmplifierText; + private final Setting romanNumerals; + private final Setting showLevelOne; + private final Setting maximumRomanNumeral; + private final Setting duration; + + private final Setting generalOptionsLabel; + private final Setting showWhileTyping; + public Setting potionInfoInInventory; + private final Setting textShadow; + private final Setting effectSpacing; + + private final Setting sortingOptionsLabel; + private final Setting sorting; + private final Setting reverseSorting; + + private final Setting colorOptionsLabel; + private final Setting nameColor; + private final Setting durationColor; + + private final Setting blinkOptionsLabel; + private final Setting effectNameBlink; + private final Setting effectIconBlink; + private final Setting durationBlink; + private final Setting blink; + private final Setting blinkDuration; + private final Setting blinkSpeed; + + private final Setting colorNameBasedOnEffect; + private final Setting colorDurationBasedOnEffect; + private final Setting texturePackOverrideColors; + private final Setting colorType; + + private final Setting excludingOptionsLabel; + private final Setting excludeSetDuration; + private final Setting excludedDuration; + private final Setting excludePerm; + private final Setting excludeSetAmplifier; + private final Setting excludedAmplifier; + private final Setting excludeHelpfulHarmfulEffects; + private final Setting excludeSpecificEffects; + + private final ResourceLocation inventoryBackground = new ResourceLocation("textures/gui/container/inventory.png"); + private int ticks = 0; + public static Map potionColorDefault = new ImmutableMap.Builder().put(1, -11141121).put(2, -10851199) + .put(3, -2506685).put(4, -11910633).put(5, -7134173).put(6, 0xFFF82423).put(7, 0xFF430A09).put(8, -1).put(9, -11199158).put(10, -3318613).put(11, 0xFF53C653).put(12, -1795526) + .put(13, -13741415).put(14, -8420462).put(15, -14737629).put(16, -14737503).put(17, -10979757) + .put(18, -12038840).put(19, -11627727).put(20, -13293017).put(21, 0xFFDE170A).put(22, -14331227).put(23, 0xFFF8C123).build(); + public static Map potionColorPotionColors = new ImmutableMap.Builder().put(1, 0xFF7CAFC6).put(2, -10851199) + .put(3, -2506685).put(4, -11910633).put(5, -7134173).put(6, 0xFFF82423).put(7, 0xFF430A09).put(8, 0xFF786297).put(9, -11199158).put(10, -3318613).put(11, 0xFF99453A).put(12, -1795526) + .put(13, -13741415).put(14, -8420462).put(15, -14737629).put(16, -14737503).put(17, -10979757) + .put(18, -12038840).put(19, -11627727).put(20, -13293017).put(21, 0xFFF87D23).put(22, -14331227).put(23, 0xFFF82423).build(); + public static Map potionColorColorCodes = new ImmutableMap.Builder().put(1, -11141121).put(2, 0xFF555555) + .put(3, 0xFFFFFF55).put(4, 0xFF555555).put(5, 0xFFAA0000).put(6, 0xFFFF5555).put(7, 0xFFAA0000).put(8, -1).put(9, 0xFFAA00AA).put(10, 0xFFFF55FF).put(11, 0xFFAAAAAA).put(12, 0xFFFFAA00) + .put(13, 0xFF5555FF).put(14, 0xFFAAAAAA).put(15, 0xFF000000).put(16, 0xFF0000AA).put(17, 0xFF00AA00) + .put(18, 0xFF555555).put(19, 0xFF55FF55).put(20, 0xFF000000).put(21, 0xFF5555).put(22, 0xFFFFFF55).put(23, 0xFFFFFF55).build(); + public static Map potionColorsVibrant = new ImmutableMap.Builder().put(1, -7405569).put(2, -10528630) + .put(3, -10240).put(4, -9728589).put(5, -5177344).put(6, 0xFFF15251).put(7, 0xFF790907).put(8, -2097153).put(9, -1).put(10, -36483).put(11, -11511440) + .put(12, -24259).put(13, -7229441).put(14, -5592406).put(15, -7975034).put(16, -14263332) + .put(17, -11818424).put(18, -9474163).put(19, -14689758).put(20, -5276243).put(21, 0xFFF83023).put(22, -7866).put(23, 0xFFFFFF99).build(); + + public ModulePotionEffects() { + super("Potion Effects"); + this.setDefaultState(false); + this.setDefaultAnchor(GuiAnchor.LEFT_MIDDLE); + + this.componentOptionsLabel = new Setting(this, "label").setValue("Component Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showIcon = new Setting(this, "Icon").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.effectName = new Setting(this, "Effect Name").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.effectNameText = new Setting(this, "Effect Name Text").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.effectName::getBooleanValue); + this.effectAmplifierText = new Setting(this, "Effect Amplifier Text").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.effectName::getBooleanValue); + this.romanNumerals = new Setting(this, "Show Roman Numerals").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.effectName.getBooleanValue() && this.effectAmplifierText.getBooleanValue()); + this.showLevelOne = new Setting(this, "Show Level 1").setValue(false).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> this.effectName.getBooleanValue() && this.effectAmplifierText.getBooleanValue()); + this.maximumRomanNumeral = new Setting(this, "Max Roman Numeral").setValue(10).setMinMax(1, 255).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> this.effectName.getBooleanValue() && this.effectAmplifierText.getBooleanValue() && this.romanNumerals.getBooleanValue()); + this.duration = new Setting(this, "Duration").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showWhileTyping = new Setting(this, "Show While Typing").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.potionInfoInInventory = new Setting(this, "Show Potion info in inventory").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadow = new Setting(this, "Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.effectName.getBooleanValue() || this.duration.getBooleanValue()); + this.effectSpacing = new Setting(this, "Effect Spacing").setValue(4.0F).setMinMax(0.0F, 15.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.sortingOptionsLabel = new Setting(this, "label").setValue("Sorting Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.sorting = new Setting(this, "Sorting Method").setValue("Vanilla").acceptedStringValues("Vanilla", "Alphabetical", "Duration", "Amplifier").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.reverseSorting = new Setting(this, "Reverse Sorting").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.blinkOptionsLabel = new Setting(this, "label").setValue("Blink Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.blink = new Setting(this, "Blink").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.effectNameBlink = new Setting(this, "Make Effect Name Text Blink").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.blink.getBooleanValue() && this.effectName.getBooleanValue()); + this.effectIconBlink = new Setting(this, "Make Effect Icon Blink").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.blink.getBooleanValue() && this.showIcon.getBooleanValue()); + this.durationBlink = new Setting(this, "Make Duration Text Blink").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.blink.getBooleanValue() && this.duration.getBooleanValue()); + this.blinkDuration = new Setting(this, "Blink Duration").setValue(10.0F).setMinMax(2.0F, 60.0F).setUnit("s").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.blink::getBooleanValue); + this.blinkSpeed = new Setting(this, "Blink Speed").setValue(1.0f).setMinMax(0.2f, 3.5f).setUnit("s").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.blink::getBooleanValue); + + this.excludingOptionsLabel = new Setting(this, "label").setValue("Excluding Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludePerm = new Setting(this, "Exclude Permanent Effects").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludeSetDuration = new Setting(this, "Exclude Set Duration", "Exclude all active effects above a set duration.").setValue("OFF").acceptedStringValues("OFF", "Effects Above", "Effects Below", "Effects At", "Effects Not At").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludedDuration = new Setting(this, "Excluded Duration", "The duration effects are excluded").setValue(30.0F).setMinMax(2.0F, 90.0F).setUnit("s").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.excludeSetDuration.getValue().equals("OFF")); + this.excludeSetAmplifier = new Setting(this, "Exclude Set Amplifier", "Exclude all active effects below a set amplifier.").setValue("OFF").acceptedStringValues("OFF", "Effects Above", "Effects Below", "Effects At", "Effects Not At").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludedAmplifier = new Setting(this, "Excluded Amplifier", "The duration effects are excluded").setValue(10).setMinMax(0, 20).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.excludeSetAmplifier.getValue().equals("OFF")); + this.excludeHelpfulHarmfulEffects = new Setting(this, "Exclude Helpful/Harmful Effects").setValue("OFF").acceptedStringValues("OFF", "Only Helpful", "Only Harmful").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludeSpecificEffects = new Setting(this, "Exclude Specific Effects").setValue(new ArrayList<>()).acceptedValues(new Integer[]{Potion.moveSpeed.id, Potion.moveSlowdown.id, Potion.digSpeed.id, Potion.digSlowdown.id, Potion.damageBoost.id, Potion.jump.id, Potion.confusion.id, Potion.regeneration.id, Potion.resistance.id, Potion.fireResistance.id, Potion.waterBreathing.id, Potion.invisibility.id, Potion.blindness.id, Potion.nightVision.id, Potion.hunger.id, Potion.weakness.id, Potion.poison.id, Potion.wither.id, Potion.absorption.id}).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.effectName.getBooleanValue() || this.duration.getBooleanValue()); + this.texturePackOverrideColors = new Setting(this, "Override Name Color With Pack Format").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.effectName.getBooleanValue() && this.effectNameText.getBooleanValue()); + this.colorNameBasedOnEffect = new Setting(this, "Color Name Based On").setValue("Static").acceptedStringValues("Static", "Effect", "Duration").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.effectName::getBooleanValue); + this.colorDurationBasedOnEffect = new Setting(this, "Color Duration Based On").setValue("Static").acceptedStringValues("Static", "Effect", "Duration").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.duration::getBooleanValue); + this.colorType = new Setting(this, "Color Type").setValue("Default").acceptedStringValues("Default", "Potion Colors", "Color Codes", "Good/Bad", "Vibrant").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.colorDurationBasedOnEffect.getValue().equals("Effect") || this.colorNameBasedOnEffect.getValue().equals("Effect")); + this.nameColor = new Setting(this, "Name Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.effectName.getBooleanValue() && this.colorNameBasedOnEffect.getValue().equals("Static")); + this.durationColor = new Setting(this, "Duration Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.duration.getBooleanValue() && this.colorDurationBasedOnEffect.getValue().equals("Static")); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/speed_icon.png"), 28, 28); + this.setDescription("Displays your active potion effects."); + this.setCreators("bspkrs", "jadedcat"); + this.setAliases("Potion Status", "Status Effects"); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + private void onTick(TickEvent event) { + ++this.ticks; + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + GL11.glPushMatrix(); + List potionEffects = new ArrayList<>(); + if (this.mc.thePlayer != null) { + potionEffects.addAll(this.mc.thePlayer.getActivePotionEffects()); + } + if (potionEffects.isEmpty()) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + potionEffects.add(new PotionEffect(Potion.moveSpeed.id, 1200, 3)); + potionEffects.add(new PotionEffect(Potion.damageBoost.id, 30, 3)); + info(potionEffects); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + if (this.showWhileTyping.getBooleanValue() || !this.mc.ingameGUI.getChatGUI().getChatOpen()) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + List potionEffects = new ArrayList<>(); + if (this.mc.thePlayer != null) { + potionEffects.addAll(this.mc.thePlayer.getActivePotionEffects()); + } + if (potionEffects.isEmpty()) { + GL11.glPopMatrix(); + GL11.glPopMatrix(); + return; + } + info(potionEffects); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + private void info(List effects) { + GlStateManager.enableBlend(); + Position cBPositionEnum = this.getPosition(); + int height = 0; + int width = 0; + float potionSpacing = this.effectSpacing.getFloatValue(); + float spacing = potionSpacing + (this.showIcon.getBooleanValue() || this.effectName.getBooleanValue() && this.duration.getBooleanValue() ? 18.0f : this.mc.fontRendererObj.FONT_HEIGHT - 1); + float iconPos = this.showIcon.getBooleanValue() ? 20.0F : 0.0F; + this.sortEffects(effects); + + for (PotionEffect potionEffect : effects) { + if (!excludePotions(potionEffect) || this.mc.currentScreen instanceof HudLayoutEditorGui || this.mc.currentScreen instanceof ModulePlaceGui || this.mc.currentScreen instanceof ProfileCreatorGui) { + Potion potion; + String string; + boolean showingDuringBlink = this.showEffectDuringBlink(potionEffect.getDuration()); + boolean packOverride = this.texturePackOverrideColors.getBooleanValue(); + int effectWidth = 0; + int effectY = this.duration.getBooleanValue() ? 0 : this.showIcon.getBooleanValue() ? 5 : 0; + String effectName = (this.effectNameText.getBooleanValue() ? StatCollector.translateToLocal(potionEffect.getEffectName()) : "") + (this.effectAmplifierText.getBooleanValue() ? this.amplifierNumerals(potionEffect.getAmplifier()) : ""); + if (this.effectName.getBooleanValue() && (showingDuringBlink || !this.effectNameBlink.getBooleanValue())) { + effectWidth = this.mc.fontRendererObj.getStringWidth(effectName) + (int) iconPos; + int potionColor = potionColor(this.nameColor.getColorValue(), this.colorNameBasedOnEffect.getValue(), potionEffect); + if (cBPositionEnum == Position.RIGHT) { + this.mc.fontRendererObj.drawString((packOverride ? effectName : stripColor(effectName)) + "§r", this.getWidth() - (float) effectWidth, (float) height + effectY, potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.LEFT) { + this.mc.fontRendererObj.drawString((packOverride ? effectName : stripColor(effectName)) + "§r", iconPos, (float) height + effectY, potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.CENTER) { + this.mc.fontRendererObj.drawString((packOverride ? effectName : stripColor(effectName)) + "§r", this.getWidth() / 2.0f - (float) (effectWidth / 2) + iconPos, (float) height + effectY, potionColor, this.textShadow.getBooleanValue()); + } + if (effectWidth > width) { + width = effectWidth; + } + } + string = Potion.getDurationString(potionEffect); + int durationWidth = this.duration.getBooleanValue() ? this.mc.fontRendererObj.getStringWidth(string) + (int) iconPos : 18; + int durationY = this.effectName.getBooleanValue() && !effectName.isEmpty() ? 10 : this.showIcon.getBooleanValue() ? 5 : 0; + if (this.duration.getBooleanValue() && (showingDuringBlink || !this.durationBlink.getBooleanValue())) { + int potionColor = potionColor(this.durationColor.getColorValue(), this.colorDurationBasedOnEffect.getValue(), potionEffect); + if (cBPositionEnum == Position.RIGHT) { + this.mc.fontRendererObj.drawString(string + "§r", this.getWidth() - (float) durationWidth, (float) (height + durationY), potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.LEFT) { + this.mc.fontRendererObj.drawString(string + "§r", iconPos, (float) (height + durationY), potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.CENTER) { + this.mc.fontRendererObj.drawString(string + "§r", this.getWidth() / 2.0f - (float) (durationWidth / 2) + iconPos, (float) (height + durationY), potionColor, this.textShadow.getBooleanValue()); + } + } + if ((potion = Potion.potionTypes[potionEffect.getPotionID()]).hasStatusIcon() && this.showIcon.getBooleanValue() && (showingDuringBlink || !this.effectIconBlink.getBooleanValue())) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, excludePotions(potionEffect) ? 0.5F : 1.0F); + this.mc.getTextureManager().bindTexture(this.inventoryBackground); + int index = potion.getStatusIconIndex(); + if (cBPositionEnum == Position.LEFT || !this.effectName.getBooleanValue() && !this.duration.getBooleanValue()) { + RenderUtil.drawTexturedModalRect(0.0f, (float) height, (float) (index % 8 * 18), (float) (198 + index / 8 * 18), 18, 18); + } else if (cBPositionEnum == Position.RIGHT) { + RenderUtil.drawTexturedModalRect(this.getWidth() - (float) 20, (float) height, (float) (index % 8 * 18), (float) (198 + index / 8 * 18), 18, 18); + } else if (cBPositionEnum == Position.CENTER) { + RenderUtil.drawTexturedModalRect(this.getWidth() / 2.0f - (float) ((this.effectName.getBooleanValue() ? effectWidth : durationWidth) / 2), (float) height, (float) (index % 8 * 18), (float) (198 + index / 8 * 18), 18, 18); + } + } + if (durationWidth > width) { + width = durationWidth; + } + height += spacing; + } + } + this.setDimensions(width, height - potionSpacing); + GlStateManager.disableBlend(); + } + + private boolean showEffectDuringBlink(float duration) { + float blinkSpeed = this.blinkSpeed.getFloatValue() * 10; + if (this.blink.getBooleanValue() && duration <= this.blinkDuration.getFloatValue() * 20.0F) { + if (this.ticks > blinkSpeed * 2) { + this.ticks = 0; + } + return this.ticks <= blinkSpeed; + } + return true; + } + + private int potionColor(int staticColor, Object option, PotionEffect effects) { + int time = effects.getDuration(); + int value; + switch ((String) option) { + case "Effect": + Potion var9 = Potion.potionTypes[effects.getPotionID()]; + switch (this.colorType.getStringValue()) { + case "Default": + value = potionColorDefault.get(effects.getPotionID()); + break; + case "Potion Colors": + value = potionColorPotionColors.get(effects.getPotionID()); + break; + case "Color Codes": + value = potionColorColorCodes.get(effects.getPotionID()); + break; + case "Vibrant": + value = potionColorsVibrant.get(effects.getPotionID()); + break; + default: + if (!var9.isBadEffect()) { + value = -15691760; + } else { + value = -7335920; + } + } + break; + case "Duration": + if (time >= 1200) { + value = -16733696; + } else if (time >= 600) { + value = -11141291; + } else if (time >= 200) { + value = -171; + } else { + value = time >= 100 ? -43691 : -5636096; + } + break; + default: + value = staticColor; + } + int opacity = value >> 24 & 0xFF; + opacity = (int) ((float) opacity * (excludePotions(effects) ? 0.5F : 1.0F)); + return value & 0xFFFFFF | opacity << 24; + } + + private void sortEffects(List effects) { + switch (this.sorting.getStringValue()) { + case "Alphabetical": + effects.sort(Comparator.comparing(effect -> I18n.format(effect.getEffectName()))); + break; + case "Duration": + effects.sort(Comparator.comparingInt(PotionEffect::getDuration)); + break; + case "Amplifier": + effects.sort(Comparator.comparingInt(PotionEffect::getAmplifier)); + Collections.reverse(effects); + } + if (this.reverseSorting.getBooleanValue()) { + Collections.reverse(effects); + } + } + + private boolean excludePotions(PotionEffect effect) { + if (this.excludeArrayOptions(this.excludeSetDuration, effect.getDuration(), this.excludedDuration.getFloatValue() * 20.0F) && !effect.getIsPotionDurationMax()) { + return true; + } else if (this.excludePerm.getBooleanValue() && effect.getIsPotionDurationMax()) { + return true; + } else if (this.excludeArrayOptions(this.excludeSetAmplifier, effect.getAmplifier(), this.excludedAmplifier.getIntegerValue() - 1)) { + return true; + } else if (this.excludeHelpfulHarmfulEffects.getValue().equals("Only Helpful") && !Potion.potionTypes[effect.getPotionID()].isBadEffect()) { + return true; + } else if (this.excludeHelpfulHarmfulEffects.getValue().equals("Only Harmful") && Potion.potionTypes[effect.getPotionID()].isBadEffect()) { + return true; + } else { + return this.excludeSpecificEffects.getArrayListValue().contains(effect.getPotionID()); + } + } + + private boolean excludeArrayOptions(Setting setting, int realValue, float sliderValue) { + switch (setting.getStringValue()) { + case "Effects Above": return realValue > sliderValue; + case "Effects Below": return realValue < sliderValue; + case "Effects At": return realValue == sliderValue; + case "Effects Not At": return realValue != sliderValue; + default: return false; + } + } + + private String amplifierNumerals(int level) { + String s = this.effectNameText.getBooleanValue() ? " " : ""; + if (level < 0) { + level = 127 + Math.abs(128 + level); + } + int l = level + 1; + int minLevel = this.showLevelOne.getBooleanValue() ? 0 : 1; + if (this.romanNumerals.getBooleanValue() && level >= minLevel && level <= this.maximumRomanNumeral.getIntegerValue()) { + return s + String.join("", Collections.nCopies(l, "I")) + .replace("IIIII", "V").replace("IIII", "IV").replace("VV", "X") + .replace("VIV", "IX").replace("XXXXX", "L").replace("XXXX", "XL") + .replace("LL", "C").replace("LXL", "XC").replace("CCCCC", "D") + .replace("CCCC", "CD").replace("DD", "M").replace("DCD", "CM"); + } else { + return level >= minLevel ? s + l : ""; + } + } + + private String stripColor(String input) { + return input == null ? null : Pattern.compile("(?i)" + '§' + "[0-9A-F]").matcher(input).replaceAll("§r"); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleScoreboard.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleScoreboard.java new file mode 100644 index 0000000..ca93601 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleScoreboard.java @@ -0,0 +1,188 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.render.GuiDrawBypassDebugEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.MiniMapRules; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +import java.util.Collection; +import java.util.regex.Pattern; + +/** + * @Module - ModuleScoreboard + * @see AbstractModule + * + * This module displays the server's Scoreboard. + */ +public class ModuleScoreboard extends AbstractModule { + + public Setting background; + public Setting backgroundWidthPadding; + public Setting border; + public Setting borderThickness; + + public Setting removeNumbers; + public Setting shadow; + + public Setting customTextColor; + public Setting textColor; + public Setting numbersColor; + public Setting topBackgroundColor; + public Setting backgroundColor; + public Setting borderColor; + + public static MiniMapRules minimapRule = MiniMapRules.NEUTRAL; + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + + public ModuleScoreboard() { + super("Scoreboard"); + this.setDefaultAnchor(GuiAnchor.RIGHT_MIDDLE); + new Setting(this, "label").setValue("Background Options"); + this.background = new Setting(this, "Show Background").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.backgroundWidthPadding = new Setting(this, "Background Width Padding").setValue(4.0F).setMinMax(0.0F, 10.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.border = new Setting(this, "Show Border").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.borderThickness = new Setting(this, "Border Thickness").setValue(1.0F).setMinMax(0.25F, 3.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.border.getValue() && (Boolean) this.background.getValue()); + + new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.removeNumbers = new Setting(this, "Remove Scoreboard numbers").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.shadow = new Setting(this, "Text Shadow").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.customTextColor = new Setting(this, "Custom Text Color").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.customTextColor.getValue()); + this.numbersColor = new Setting(this, "Scoreboard Numbers Color").setValue(0xFFFF5555).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !(Boolean) this.removeNumbers.getValue()); + this.topBackgroundColor = new Setting(this, "Top Background Color").setValue(0x60000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x50000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.borderColor = new Setting(this, "Border Color").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.border.getValue()); + + this.setDescription("Move and customize the Minecraft scoreboard to your liking."); + this.setAliases("Sidebar"); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawBypassDebugEvent.class, this::onGuiDraw); + this.setDefaultState(true); + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + if (this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(1) != null) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + GL11.glTranslatef(this.removeNumbers() ? (float) -12 : 2.0f, this.height, 0.0f); + net.minecraft.scoreboard.Scoreboard scoreboard = new net.minecraft.scoreboard.Scoreboard(); + ScoreObjective scoreObjective = new ScoreObjective(scoreboard, "CheatBreaker", IScoreObjectiveCriteria.DUMMY); + scoreObjective.setDisplayName(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "Cheat" + EnumChatFormatting.WHITE + "" + EnumChatFormatting.BOLD + "Breaker"); + scoreboard.getValueFromObjective("Steve", scoreObjective); + scoreboard.getValueFromObjective("Alex", scoreObjective); + this.renderObjective(scoreObjective, event.getScaledResolution().getScaledHeight(), event.getScaledResolution().getScaledWidth(), this.mc.fontRendererObj, this.masterScale()); + GL11.glPopMatrix(); + } + + private void onGuiDraw(GuiDrawBypassDebugEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + GL11.glTranslatef(this.removeNumbers() ? (float) -12 : 2.0f, this.height, 0.0f); + ScoreObjective scoreObjective = this.mc.theWorld.getScoreboard().getObjectiveInDisplaySlot(1); + if (scoreObjective != null) { + this.renderObjective(scoreObjective, event.getScaledResolution().getScaledHeight(), + event.getScaledResolution().getScaledWidth(), this.mc.fontRendererObj, this.masterScale()); + } + GL11.glPopMatrix(); + } + + private void renderObjective(ScoreObjective scoreObjective, int n, int n2, FontRenderer fontRenderer, float f) { + GlStateManager.enableBlend(); + net.minecraft.scoreboard.Scoreboard scoreboard = scoreObjective.getScoreboard(); + Collection collection = scoreboard.getSortedScores(scoreObjective); + boolean removeNumbers = this.removeNumbers(); + boolean isCustomTextColorEnabled = (Boolean) customTextColor.getValue(); + if (collection.size() <= 15) { + int n3 = fontRenderer.getStringWidth(scoreObjective.getDisplayName()); + int n4 = n3 + 16; + for (Score score : collection) { + ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(score.getPlayerName()); + String string = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, score.getPlayerName()) + ": " + EnumChatFormatting.RED + score.getScorePoints(); + n3 = Math.max(n3, fontRenderer.getStringWidth(string)); + } + int n5 = 0; + int n6 = 3; + int n7 = 0; + int n8 = 0; + float n9 = 0; + float width = this.removeNumbers() ? -4 + ((float) backgroundWidthPadding.getValue()) : 0.0f; + + for (Score score : collection) { + ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(score.getPlayerName()); + String string = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, score.getPlayerName()); + String string2 = "" + score.getScorePoints(); + int n10 = n5 - ++n8 * fontRenderer.FONT_HEIGHT; + int n11 = n3 + n6 + 6; + if (n11 < n4) { + n11 = n4; + } + if ((Boolean) background.getValue()) { + Gui.drawRect(n7 - 2 + (removeNumbers ? 14 : 0), n10, n11 + width, n10 + fontRenderer.FONT_HEIGHT, backgroundColor.getColorValue()); + } + n9 = n11 - (n7 - 2 + (removeNumbers ? 18 - ((float) backgroundWidthPadding.getValue()) : 0)); + GlStateManager.enableBlend(); + fontRenderer.drawString(isCustomTextColorEnabled ? stripColor(string) : string, n7 + (removeNumbers ? 14 + (float) backgroundWidthPadding.getValue() / 2 : 0), n10, isCustomTextColorEnabled ? textColor.getColorValue() : -1, (Boolean) shadow.getValue()); + if (!removeNumbers) { + fontRenderer.drawString(string2, n11 - fontRenderer.getStringWidth(string2) - 2, n10, numbersColor.getColorValue(), (Boolean) shadow.getValue()); + } + if (n8 != collection.size()) continue; + String string3 = scoreObjective.getDisplayName(); + if ((Boolean) background.getValue()) { + Gui.drawRect(n7 - 2 + (removeNumbers ? 14 : 0), n10 - fontRenderer.FONT_HEIGHT - 1, n11 + width, n10 - 1, topBackgroundColor.getColorValue()); + Gui.drawRect(n7 - 2 + (removeNumbers ? 14 : 0), n10 - 1, n11 + width, n10, backgroundColor.getColorValue()); + } + fontRenderer.drawString(isCustomTextColorEnabled ? stripColor(string3) : string3, n7 + n3 / 2F - fontRenderer.getStringWidth(string3) / 2F + (removeNumbers ? 12 + (float) backgroundWidthPadding.getValue() / 2 : 0), n10 - fontRenderer.FONT_HEIGHT, isCustomTextColorEnabled ? textColor.getColorValue() : -1, (Boolean) shadow.getValue()); + GlStateManager.disableBlend(); + } + int var23 = n3 + n6 + 6; + if (var23 < n4) { + var23 = n4; + } + if ((Boolean) border.getValue()) { + float bT = (Float) borderThickness.getValue(); + Gui.drawOutline((float) (n7 - 2 + (removeNumbers ? 14 : 0)) - bT, -(collection.size() * fontRenderer.FONT_HEIGHT + 10) - bT, var23 + bT + width, 0.0F + bT, bT, borderColor.getColorValue()); + } + this.setDimensions(n9, collection.size() * fontRenderer.FONT_HEIGHT + 10); + } + } + + /** + * @return True if Minimap Rule is set to Neutral and if the remove numbers option is set to true or if Minimap rule is set to Forced Off. + */ + private boolean removeNumbers() { + return minimapRule == MiniMapRules.NEUTRAL ? (Boolean) this.removeNumbers.getValue() : minimapRule == MiniMapRules.FORCED_OFF; + } + + /** + * Replaces all non-neutral color codes with §r + * + * @param input String input + */ + private String stripColor(String input) { + return input == null ? null : STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusDamageComparable.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusDamageComparable.java new file mode 100644 index 0000000..8909bf7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusDamageComparable.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.module.impl.normal.hud.armorstatus; + +import java.util.List; + +/** + * @ModuleUtility - ArmorStatusDamageComparable + * + * This utility is used to get information on an item for use in the Armor Status module. + */ +public class ArmorStatusDamageComparable implements Comparable { + public int percent; + public String colorCode; + + public ArmorStatusDamageComparable(int percent, String colorCode) { + this.percent = percent; + this.colorCode = colorCode; + } + + public int compare(ArmorStatusDamageComparable damageComparable) { + return Integer.compare(this.percent, damageComparable.percent); + } + + /** + * Returns the item damage color. + */ + public static String getDamageColor(List durability, int n) { + for (ArmorStatusDamageComparable armorStatusDamageComparable : durability) { + if (n > armorStatusDamageComparable.percent) continue; + return armorStatusDamageComparable.colorCode; + } + return "f"; + } + + public int compareTo(ArmorStatusDamageComparable object) { + return this.compare(object); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusItem.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusItem.java new file mode 100644 index 0000000..a7ef54d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusItem.java @@ -0,0 +1,125 @@ +package com.cheatbreaker.client.module.impl.normal.hud.armorstatus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.module.AnchorHelper; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.Position; +import com.cheatbreaker.client.ui.util.HudUtil; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import org.lwjgl.opengl.GL11; + +/** + * @ModuleUtility - ArmorStatusItem + * + * This defines the ArmorStatusItem Object, used for the Armor Status module. + */ +public class ArmorStatusItem { + public final ItemStack item; + + public final int iconW; + public final int iconH; + public final int padW; + @Getter private int itemWidth; + @Getter private int itemHeight; + private int displayTextWidth; + private int textWidth; + + private String displayText = ""; + private String text = ""; + + private final boolean isArmor; + + private final Minecraft mc = Minecraft.getMinecraft(); + + public ArmorStatusItem(ItemStack itemStack, int iconW, int iconH, int padW, boolean isArmor) { + this.item = itemStack; + this.iconW = iconW; + this.iconH = iconH; + this.padW = padW; + this.isArmor = isArmor; + this.initSize(); + } + + /** + * Sets the size up. + */ + private void initSize() { + this.itemHeight = (Boolean) ModuleArmorStatus.itemName.getValue() ? + Math.max(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT * 2, this.iconH) : + Math.max(this.mc.fontRendererObj.FONT_HEIGHT, this.iconH); + + if (this.item != null) { + int n2; + int n3; + boolean damageAmount = ModuleArmorStatus.damageAmount.getValue().equals("ON") ? this.item.isItemStackDamageable() : this.item.isItemDamaged(); + + if ((this.isArmor && (Boolean) ModuleArmorStatus.armorDamage.getValue() + || !this.isArmor + && (Boolean) ModuleArmorStatus.itemDamage.getValue()) + && damageAmount) { + n3 = this.item.getMaxDamage() + 1; + n2 = n3 - this.item.getItemDamage(); + + if (((String) ModuleArmorStatus.damageDisplayType.getValue()).equalsIgnoreCase("value")) { + this.text = "§" + ArmorStatusDamageComparable.getDamageColor(ModuleArmorStatus.damageColors, ((String) ModuleArmorStatus.damageThreshold.getValue()).equalsIgnoreCase("percent") ? n2 * 100 / n3 : n2) + n2 + ((Boolean) ModuleArmorStatus.maxDamage.getValue() ? "/" + n3 : ""); + } else if (((String) ModuleArmorStatus.damageDisplayType.getValue()).equalsIgnoreCase("percent")) { + this.text = "§" + ArmorStatusDamageComparable.getDamageColor(ModuleArmorStatus.damageColors, ((String) ModuleArmorStatus.damageThreshold.getValue()).equalsIgnoreCase("percent") ? n2 * 100 / n3 : n2) + n2 * 100 / n3 + "%"; + } + } + this.textWidth = this.mc.fontRendererObj.getStringWidth(HudUtil.getColorCode(this.text)); + this.itemWidth = this.padW + this.iconW + + this.padW + this.textWidth; + + if ((Boolean) ModuleArmorStatus.itemName.getValue()) { + this.displayText = this.item.getDisplayName(); + this.itemWidth = this.padW + + this.iconW + this.padW + + Math.max(this.mc.fontRendererObj.getStringWidth(HudUtil.getColorCode(this.displayText)), this.textWidth); + } + + this.displayTextWidth = this.mc.fontRendererObj.getStringWidth(HudUtil.getColorCode(this.displayText)); + } + } + + /** + * Draws the actual item and health integer. + */ + public void renderTo(float f, float f2) { + boolean bl; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + ModuleArmorStatus.renderItem.zLevel = -160; + GuiAnchor cBGuiAnchor = CheatBreaker.getInstance().getModuleManager().armourStatus.getGuiAnchor(); + bl = AnchorHelper.getHorizontalPositionEnum(cBGuiAnchor) == Position.RIGHT; + + if (bl) { + ModuleArmorStatus.renderItem.renderItemAndEffectIntoGUI(this.item, (int) (f - (float) (this.iconW + this.padW)), (int) f2); + HudUtil.renderItemOverlayIntoGUI(this.mc.fontRendererObj, this.item, (int) (f - (float) (this.iconW + this.padW)), + (int) f2, (Boolean) ModuleArmorStatus.damageOverlay.getValue(), + (Boolean) ModuleArmorStatus.itemCount.getValue()); + + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GlStateManager.disableBlend(); + this.mc.fontRendererObj.drawStringWithShadow(this.displayText + "§r", f - (float) (this.padW + this.iconW + this.padW) - (float) this.displayTextWidth, f2, 0xFFFFFF); + this.mc.fontRendererObj.drawStringWithShadow(this.text + "§r", f - (float) (this.padW + this.iconW + this.padW) - (float) this.textWidth, f2 + (float) ((Boolean) ModuleArmorStatus.itemName.getValue() ? this.itemHeight / 2 : this.itemHeight / 4), 0xFFFFFF); + } else { + ModuleArmorStatus.renderItem.renderItemAndEffectIntoGUI(this.item, (int) f, (int) f2); + HudUtil.renderItemOverlayIntoGUI(this.mc.fontRendererObj, this.item, (int) f, (int) f2, ModuleArmorStatus.damageOverlay.getBooleanValue(), (Boolean) ModuleArmorStatus.itemCount.getValue()); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GlStateManager.disableBlend(); + this.mc.fontRendererObj.drawStringWithShadow(this.displayText + "§r", f + (float) this.iconW + (float) this.padW, f2, 0xFFFFFF); + this.mc.fontRendererObj.drawStringWithShadow(this.text + "§r", f + (float) this.iconW + (float) this.padW, f2 + (float) ((Boolean) ModuleArmorStatus.itemName.getValue() ? this.itemHeight / 2 : this.itemHeight / 4), 0xFFFFFF); + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ModuleArmorStatus.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ModuleArmorStatus.java new file mode 100644 index 0000000..0c4fbba --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ModuleArmorStatus.java @@ -0,0 +1,213 @@ +package com.cheatbreaker.client.module.impl.normal.hud.armorstatus; + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Module - ModuleArmorStatus + * @see AbstractModule + * + * This mod displays what item you are holding, and the armor you're wearing, and its health. + */ +public class ModuleArmorStatus extends AbstractModule { + private final Setting generalOptionsLabel; + public static Setting listMode; + public static Setting itemName; + public static Setting itemCount; + public static Setting showWhileTying; + public static Setting equippedItem; + + private final Setting damageOptionsLabel; + public static Setting damageOverlay; + public static Setting damageAmount; + public static Setting itemDamage; + public static Setting armorDamage; + public static Setting maxDamage; + + private final Setting damageDisplayLabel; + public static Setting damageDisplayType; + public static Setting damageThreshold; + public static RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); + public static final List damageColors = new ArrayList<>(); + private static final List items = new ArrayList<>(); + private static ScaledResolution scaledRes; + + public ModuleArmorStatus() { + super("Armor Status"); + this.setDefaultAnchor(GuiAnchor.RIGHT_BOTTOM); + this.setDefaultState(false); + + { + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + listMode = new Setting(this, "List Mode").setValue("Vertical").acceptedStringValues("Vertical", "Horizontal").setCustomizationLevel(CustomizationLevel.SIMPLE); + itemName = new Setting(this, "Item Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + itemCount = new Setting(this, "Item Count").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) equippedItem.getValue()); + equippedItem = new Setting(this, "Equipped Item").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + showWhileTying = new Setting(this, "Show While Typing").setValue(false).setCustomizationLevel(CustomizationLevel.ADVANCED); + } + { + this.damageOptionsLabel = new Setting(this, "label").setValue("Damage Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + damageOverlay = new Setting(this, "Damage Overlay").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + damageAmount = new Setting(this, "Show Damage Amount").setValue("ON").acceptedStringValues("ON", "If Damaged").setCustomizationLevel(CustomizationLevel.SIMPLE); + itemDamage = new Setting(this, "Show Item Damage").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) equippedItem.getValue()); + armorDamage = new Setting(this, "Show Armor Damage").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + maxDamage = new Setting(this, "Show Max Damage").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) itemDamage.getValue() || (Boolean) armorDamage.getValue()); + } + { + this.damageDisplayLabel = new Setting(this, "label").setValue("Damage Display").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> ((Boolean) equippedItem.getValue() && (Boolean) itemDamage.getValue()) || (Boolean) armorDamage.getValue()); + damageDisplayType = new Setting(this, "Damage Display Type").setValue("Value").acceptedStringValues("Value", "Percent", "None").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> ((Boolean) equippedItem.getValue() && (Boolean) itemDamage.getValue()) || (Boolean) armorDamage.getValue()); + damageThreshold = new Setting(this, "Damage Threshold Type").setValue("Percent").acceptedStringValues("Percent", "Value").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> ((Boolean) equippedItem.getValue() && (Boolean) itemDamage.getValue()) || (Boolean) armorDamage.getValue()); + } + { + damageColors.add(new ArmorStatusDamageComparable(10, "4")); + damageColors.add(new ArmorStatusDamageComparable(25, "c")); + damageColors.add(new ArmorStatusDamageComparable(40, "6")); + damageColors.add(new ArmorStatusDamageComparable(60, "e")); + damageColors.add(new ArmorStatusDamageComparable(80, "7")); + damageColors.add(new ArmorStatusDamageComparable(100, "f")); + } + + this.setPreviewIcon(new ResourceLocation("client/icons/mods/diamond_chestplate.png"), 34, 34); + this.setDescription("Displays your current armor and holding item durability."); + this.setCreators("bspkrs", "jadedcat"); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + /** + * Draws the preview. + */ + private void onPreviewDraw(PreviewDrawEvent event) { + ArrayList items = new ArrayList<>(); + + if (!this.isRenderHud()) { + return; + } + + for (int i = 3; i >= 0; --i) { + ItemStack itemStack = this.mc.thePlayer.inventory.armorInventory[i]; + if (itemStack == null) continue; + items.add(new ArmorStatusItem(itemStack, 16, 16, 2, i > -1)); + } + + if (items.isEmpty()) { + items.add(new ArmorStatusItem(new ItemStack(Item.getItemById(310)), 16, 16, 2, true)); + items.add(new ArmorStatusItem(new ItemStack(Item.getItemById(311)), 16, 16, 2, true)); + items.add(new ArmorStatusItem(new ItemStack(Item.getItemById(312)), 16, 16, 2, true)); + items.add(new ArmorStatusItem(new ItemStack(Item.getItemById(313)), 16, 16, 2, true)); + } + + if ((Boolean) equippedItem.getValue() && this.mc.thePlayer.getCurrentEquippedItem() != null) { + items.add(new ArmorStatusItem(this.mc.thePlayer.getCurrentEquippedItem(), 16, 16, 2, false)); + } else if ((Boolean) equippedItem.getValue()) { + items.add(new ArmorStatusItem(new ItemStack(Item.getItemById(276)), 16, 16, 2, false)); + } + + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + scaledRes = event.getScaledResolution(); + this.scaleAndTranslate(scaledRes); + this.render(items); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glPopMatrix(); + } + + /** + * Draws the real module. + */ + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + + if (!(this.mc.currentScreen instanceof HudLayoutEditorGui || this.mc.currentScreen instanceof ModulePlaceGui || this.mc.currentScreen instanceof GuiChat && !(Boolean) showWhileTying.getValue())) { + this.updateItems(this.mc); + if (!items.isEmpty()) { + GL11.glPushMatrix(); + GlStateManager.enableBlend(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + scaledRes = event.getScaledResolution(); + this.scaleAndTranslate(scaledRes); + this.render(items); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GlStateManager.disableBlend(); + GL11.glPopMatrix(); + } + } + } + + /** + * Updates the items on the module. + */ + private void updateItems(Minecraft mc) { + items.clear(); + + for (int i = 3; i >= -1; --i) { + ItemStack item = null; + + if (i == -1 && (Boolean) equippedItem.getValue()) { + item = mc.thePlayer.getCurrentEquippedItem(); + } else if (i != -1) { + item = mc.thePlayer.inventory.armorInventory[i]; + } + + if (item == null) continue; + items.add(new ArmorStatusItem(item, 16, 16, 2, i > -1)); + } + } + + /** + * Renders the module. + */ + private void render(List list) { + if (list.size() > 0) { + int n = (Boolean) itemName.getValue() ? 18 : 16; + if (((String) listMode.getValue()).equalsIgnoreCase("vertical")) { + int n3 = 0; + int n4 = 0; + boolean bl = AnchorHelper.getHorizontalPositionEnum(this.getGuiAnchor()) == Position.RIGHT; + for (ArmorStatusItem armorStatusItem : list) { + armorStatusItem.renderTo(bl ? this.width : 0.0f, n3); + n3 += n; + if (armorStatusItem.getItemWidth() <= n4) continue; + n4 = armorStatusItem.getItemWidth(); + } + this.height = n3; + this.width = n4; + } else if (((String) listMode.getValue()).equalsIgnoreCase("horizontal")) { + int width = 0; + int height = 0; + boolean bl2 = AnchorHelper.getHorizontalPositionEnum(this.getGuiAnchor()) == Position.RIGHT; + for (ArmorStatusItem armorStatusItem : list) { + if (bl2) { + width += armorStatusItem.getItemWidth(); + } + armorStatusItem.renderTo(width, 0.0f); + if (!bl2) { + width += armorStatusItem.getItemWidth(); + } + if (armorStatusItem.getItemHeight() <= height) continue; + height += armorStatusItem.getItemHeight(); + } + this.height = height; + this.width = width; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/chat/ModuleChat.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/chat/ModuleChat.java new file mode 100644 index 0000000..17b6e79 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/chat/ModuleChat.java @@ -0,0 +1,186 @@ +package com.cheatbreaker.client.module.impl.normal.hud.chat; + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.ChatLine; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +/** + * @Module - ModuleChat + * @see AbstractModule + *

+ * This mod allows you to drag the chat around like the Scoreboard module, and customize it to your liking. + */ +public class ModuleChat extends AbstractModule { + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + private final Map chatColors = new HashMap<>(); + public List dingCooldown = new ArrayList<>(); // used to not ding on messages sent by the actual player + + private int activeChatLines = 0; + + public Setting background; + public Setting inputFieldBackground; + public Setting backgroundWidthType; + public Setting backgroundWidth; + public Setting focusedBackgroundHeight; + public Setting unfocusedBackgroundHeight; + public Setting textShadow; + public Setting textOpacity; + public Setting textSize; + public Setting lineSpacing; + public Setting unlimitedChat; + public Setting clearChatOnRelog; + public Setting masterOpacity; + public Setting smoothChat; + public Setting smoothChatSpeed; + public Setting backgroundColor; + public Setting chatHeightFix; + public Setting highlightOwnName; + public Setting highlightColor; + public Setting playDing; + public Setting stripFormattingColors; + public Setting textColor; + + public ModuleChat() { + super("Chat"); + this.setDefaultAnchor(GuiAnchor.LEFT_BOTTOM); + this.setDefaultTranslations(0.0f, -26.0f); + this.notRenderHUD = false; + this.masterOpacity = new Setting(this, "Master Opacity").setValue(100.0F).setMinMax(0.05F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.unlimitedChat = new Setting(this, "Unlimited Chat").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.clearChatOnRelog = new Setting(this, "Clear Chat on Relog").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + + new Setting(this, "label").setValue("Background Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.background = new Setting(this, "Show Background", "Draw a background behind chat.").setValue("ON").acceptedStringValues("ON", "While Typing", "OFF").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.inputFieldBackground = new Setting(this, "Show Input Field Background", "Draw a background behind the chat text input field.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.backgroundWidthType = new Setting(this, "Background Width").setValue("Full").acceptedStringValues("Full", "Compact").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> !this.background.getValue().equals("OFF")); + this.backgroundWidth = new Setting(this, "Width").setValue(GuiNewChat.calculateChatboxHeight(this.mc.gameSettings.chatWidth)).setMinMax(40, 320).setUnit("px").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud); + this.focusedBackgroundHeight = new Setting(this, "Focused Height").setValue(GuiNewChat.calculateChatboxHeight(this.mc.gameSettings.chatHeightFocused)).setMinMax(20, 180).setUnit("px").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud); + this.unfocusedBackgroundHeight = new Setting(this, "Unfocused Height").setValue(GuiNewChat.calculateChatboxHeight(this.mc.gameSettings.chatHeightUnfocused)).setMinMax(20, 180).setUnit("px").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> !this.background.getValue().equals("OFF") || (Boolean) this.inputFieldBackground.getValue()); + + new Setting(this, "label").setValue("Text Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadow = new Setting(this, "Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.stripFormattingColors = new Setting(this, "Strip Formatting Colors").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.stripFormattingColors.getBooleanValue()); + this.textOpacity = new Setting(this, "Text Opacity").setValue(100.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textSize = new Setting(this, "Text Scale").setValue(100.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud); +// this.lineSpacing = new Setting(this, "Line Spacing").setValue(0.0F).setMinMax(0.0F, 1.0F); + + new Setting(this, "label").setValue("Animation Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.smoothChat = new Setting(this, "Smooth Chat").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.smoothChatSpeed = new Setting(this, "Smooth Chat Speed").setValue(8.0F).setMinMax(0.25F, 10.0F).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.smoothChat.getValue()); +// new Setting(this, "label").setValue("Filter Options"); + +// new Setting(this, "label").setValue("Keybind Options"); + + new Setting(this, "label").setValue("Highlighting Options"); + this.highlightOwnName = new Setting(this, "Highlight Own Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightColor = new Setting(this, "Highlight Colour").setValue("None") + .acceptedStringValues("None", "Purple", "Dark Red", "Gold", "Cyan", "Blue", "Green", "Aqua").setCondition(() -> this.highlightOwnName.getBooleanValue()); + this.playDing = new Setting(this, "Play Ding").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.highlightOwnName::getBooleanValue); + + new Setting(this, "label").setValue("Position Options").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.isRenderHud()); + this.chatHeightFix = new Setting(this, "Chat Height Position").setValue(0.0F).setMinMax(-14.0F, 32.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.isRenderHud()); + + this.setDescription("Move and customize the Minecraft chat to your liking."); + this.setCreators("LlamaLad7 (Smooth Chat)"/*, "GeckoThePecko (Filter Options)"*/); + + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(TickEvent.class, this::onTick); + this.setColors(); + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (this.isRenderHud() && this.activeChatLines == 0 && this.mc.currentScreen instanceof HudLayoutEditorGui) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + GuiNewChat chat = new GuiNewChat(this.mc); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("§7§m-----------------------------------------------------")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("Welcome to §cCheatBreaker§f!")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("- §cWebsite: §fwww.cheatbreaker.com")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("- §cDiscord: §fdiscord.cheatbreaker.com")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("- §cTwitter: §fwww.twitter.com/CheatBreaker")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("")); + chat.dontPrintChatMessageWithOptionalDeletion(new ChatComponentText("§7§m-----------------------------------------------------")); + + chat.drawCustomChat(this.mc.ingameGUI.getUpdateCounter(), false); + this.setDimensions((float) (int) this.backgroundWidth.getValue() + 4.0F, Math.min(getChatHeight(), chat.drawnChatLines.size() * 9) * (float) this.textSize.getValue() / 100.0F); + GL11.glPopMatrix(); + } + } + + private void onTick(TickEvent event) { + this.dingCooldown.removeIf(n -> n < System.currentTimeMillis() - 250L); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + int var2 = this.mc.ingameGUI.getChatGUI().getLineCount(); + int var9; + int var3 = 0; + + for (var9 = 0; var9 + this.mc.ingameGUI.getChatGUI().scrollPos < this.mc.ingameGUI.getChatGUI().drawnChatLines.size() && var9 < var2; ++var9) { + ChatLine var10 = this.mc.ingameGUI.getChatGUI().drawnChatLines.get(var9); + if (var10 != null) { + if (this.mc.ingameGUI.getUpdateCounter() - var10.getUpdatedCounter() < 200) { + ++var3; + } + } + } + + this.activeChatLines = var3; + if (this.activeChatLines != 0 || !(this.mc.currentScreen instanceof HudLayoutEditorGui)) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + int height = this.mc.currentScreen instanceof GuiChat ? this.mc.ingameGUI.getChatGUI().drawnChatLines.size() * 9 : -(-this.activeChatLines * 9); + this.mc.ingameGUI.getChatGUI().drawCustomChat(this.mc.ingameGUI.getUpdateCounter(), this.smoothChat.getBooleanValue()); + this.setDimensions((float) (int) this.backgroundWidth.getValue() + 4.0F * (float) this.textSize.getValue() / 100.0F, Math.min(getChatHeight(), height) * (float) this.textSize.getValue() / 100.0F); + GL11.glPopMatrix(); + } + } + + public int getChatHeight() { + return this.mc.currentScreen instanceof GuiChat ? (int) this.focusedBackgroundHeight.getValue() : (int) this.unfocusedBackgroundHeight.getValue(); + } + + private void setColors() { + this.chatColors.put("Purple", EnumChatFormatting.DARK_PURPLE); + this.chatColors.put("Red", EnumChatFormatting.DARK_RED); + this.chatColors.put("Gold", EnumChatFormatting.GOLD); + this.chatColors.put("Cyan", EnumChatFormatting.DARK_AQUA); + this.chatColors.put("Blue", EnumChatFormatting.DARK_BLUE); + this.chatColors.put("Green", EnumChatFormatting.DARK_GREEN); + this.chatColors.put("Aqua", EnumChatFormatting.AQUA); + } + + public EnumChatFormatting getHighlightColor() { + return this.chatColors.get(this.highlightColor.getStringValue()); + } + + // Public so that GuiNewChat can access it. + public String stripColor(String input) { + return input == null ? null : STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/CooldownRenderer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/CooldownRenderer.java new file mode 100644 index 0000000..9a639cb --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/CooldownRenderer.java @@ -0,0 +1,123 @@ +package com.cheatbreaker.client.module.impl.normal.hud.cooldowns; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.armorstatus.ModuleArmorStatus; +import com.cheatbreaker.client.ui.util.RenderUtil; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import org.lwjgl.opengl.GL11; + +/** + * @ModuleUtility - CooldownRenderer + * @see ModuleCooldowns + * + * This rendering utility is used to render a cooldown for CheatBreaker's Cooldown Module. + */ +@Getter +public class CooldownRenderer { + private final String name; + private final int itemID; + @Setter private long duration; + private long time; + private final Minecraft mc = Minecraft.getMinecraft(); + private final ItemStack itemStack; + + public CooldownRenderer(String name, int itemID, long duration) { + this.name = name; + this.itemID = itemID; + this.duration = duration; + this.time = System.currentTimeMillis(); + this.itemStack = new ItemStack(Item.getItemById(itemID)); + } + + /** + * Renders the cooldown. + */ + public void render(Setting theme, float x, float y, int color) { + int radius = 17; + GL11.glPushMatrix(); + float f4 = ModuleArmorStatus.renderItem.zLevel; + ModuleArmorStatus.renderItem.zLevel = -150.50001f; + float scale = 1.35F; + + GL11.glTranslatef(-0.5F, -1, 0.0f); + GL11.glScalef(scale, scale, scale); + RenderHelper.enableStandardItemLighting(); + ModuleArmorStatus.renderItem.renderItemAndEffectIntoGUI(this.itemStack, (int) ((x + (float) (radius / 2)) / scale), (int) ((y + (float) (radius / 2)) / scale)); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableBlend(); + GL11.glPopMatrix(); + ModuleArmorStatus.renderItem.zLevel = f4; + + double d = this.duration - (System.currentTimeMillis() - this.time); + if (d <= 0.0) { + return; + } + + // Updated to a switch statement, rather than if else. + switch (theme.getStringValue()) { + + case "Bright" : + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.2F); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, radius, 0.0, (float) this.duration / 3.95f, (int) this.duration, d); + GL11.glColor4f(0.9F, 0.9F, 0.9F, 1.0F); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, (float) radius + 0.1f, radius - 2, (float) this.duration / 3.95f, (int) this.duration, this.duration); + GL11.glColor4f(0.35F, 0.35F, 0.35F, 0.6F); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, (float) radius + 0.1f, radius - 2, (float) this.duration / 3.95f, (int) this.duration, d); + break; + + case "Dark" : + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.2F); + RenderUtil.drawCircle(x + (float) radius, y + (float) radius, radius); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.2F); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, radius, 0.0, (float) this.duration / 3.95f, (int) this.duration, d); + GL11.glColor4f(0.0F, 0.9F, 0.0F, 1.0F); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, (float) radius + 0.1f, radius - 2, (float) this.duration / 3.95f, (int) this.duration, this.duration); + GL11.glColor4f(0.0F, 0.5F, 0.0F, 1.0F); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, (float) radius + 0.1f, radius - 2, (float) this.duration / 3.95f, (int) this.duration, d); + break; + + case "Colored" : + float opacity = (float) (color >> 24 & 0xFF) / (float) 255; + float red = (float) (color >> 16 & 0xFF) / (float) 255; + float green = (float) (color >> 8 & 0xFF) / (float) 255; + float blue = (float) (color & 0xFF) / (float) 255; + GL11.glColor4f(red, green, blue, 0.15F * opacity); + RenderUtil.drawCircle(x + (float) radius, y + (float) radius, radius); + GL11.glColor4f(red, green, blue, 0.25F * opacity); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, radius, 0.0, (float) this.duration / 3.95f, (int) this.duration, d); + GL11.glColor4f(red, green, blue, opacity); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, (float) radius + 0.1f, radius - 2, (float) this.duration / 3.95f, (int) this.duration, this.duration); + GL11.glColor4f(red, green, blue, 0.15F * opacity); + RenderUtil.drawCircleWithOutLine(x + (float) radius, y + (float) radius, (float) radius + 0.1f, radius - 2, (float) this.duration / 3.95f, (int) this.duration, d); + break; + + case "No Ring": + break; + } + + String string = String.format("%." + CheatBreaker.getInstance().getModuleManager().coolDownsMod.decimals.getValue() + "f", d / 1000.0); + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredStringWithShadow(string, x + (float) radius - CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(string) / 2.0f, y + (float) (radius / 2) + (float) 4, -1, 0x6F000000); + } + + /** + * Returns if the time is greater than the current system ms subtracted by the duration. + * This is used so that the cooldown does not render after it's over. + */ + public boolean isTimeOver() { + return this.time < System.currentTimeMillis() - this.duration; + } + + /** + * Sets the cooldown's time to the current system time. + */ + public void setTimeToCurrentSystemTime() { + this.time = System.currentTimeMillis(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/ModuleCooldowns.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/ModuleCooldowns.java new file mode 100644 index 0000000..2bd74e7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/ModuleCooldowns.java @@ -0,0 +1,127 @@ +package com.cheatbreaker.client.module.impl.normal.hud.cooldowns; + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ModulePlaceGui; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +/** + * @ModuleUtility - ModuleCooldowns + * @see AbstractModule + * + * This mod shows custom cooldowns sent by the server. + * In some cases, the Ender Pearl cooldown will also be shown by default, this varies from server to server. + */ +public class ModuleCooldowns extends AbstractModule { + private static final List normal = new ArrayList<>(); + public Setting theme; + private final Setting mode; + public Setting useEXP; + public Setting decimals; + private final Setting color; + private final List preview = new ArrayList<>(); + + public ModuleCooldowns() { + super("Cooldowns", "Normal"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.setDefaultTranslations(0.0f, 5); + + this.theme = new Setting(this, "Color Theme").setValue("Bright").acceptedStringValues("Bright", "Dark", "Colored", "No Ring").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.mode = new Setting(this, "List Mode").setValue("Horizontal").acceptedStringValues("Vertical", "Horizontal").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.useEXP = new Setting(this, "Use Pearl Cooldown via XP").setValue(true); + this.decimals = new Setting(this, "Decimals").setValue(1).setMinMax(0, 3).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.color = new Setting(this, "Colored color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.theme.getValue().equals("Colored")); + + this.setDescription("Allows servers to display items or abilities that are on cooldown."); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.setDefaultState(true); + } + + public void onTick(TickEvent tickEvent) { + if (!normal.isEmpty()) { + normal.removeIf(CooldownRenderer::isTimeOver); + } + if (!this.preview.isEmpty()) { + this.preview.removeIf(CooldownRenderer::isTimeOver); + } + } + + public void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + if (normal.isEmpty()) { + GL11.glPushMatrix(); + if (this.preview.isEmpty()) { + this.preview.add(new CooldownRenderer("CombatTag", 283, 30000L)); + this.preview.add(new CooldownRenderer("EnderPearl", 368, 12000L)); + } + this.scaleAndTranslate(event.getScaledResolution()); + boolean isVertical = ((String) this.mode.getValue()).equalsIgnoreCase("Vertical"); + int n = 36; + int n2 = 36; + int n3 = isVertical ? n : this.preview.size() * n; + int n4 = isVertical ? this.preview.size() * n2 : n2; + this.setDimensions((int) ((float) n3), (int) ((float) n4) - 1); + for (int cooldownList = 0; cooldownList < this.preview.size(); ++cooldownList) { + CooldownRenderer cooldownRenderer = this.preview.get(cooldownList); + if (((String) this.mode.getValue()).equalsIgnoreCase("Vertical")) { + cooldownRenderer.render(this.theme, this.width / 2.0f - (float) (n / 2), cooldownList * n2, this.color.getColorValue()); + continue; + } + cooldownRenderer.render(this.theme, cooldownList * n, 0.0f, this.color.getColorValue()); + } + GL11.glPopMatrix(); + } + } + + public void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + if (normal.size() > 0) { + this.scaleAndTranslate(event.getScaledResolution()); + boolean isVertical = ((String) this.mode.getValue()).equalsIgnoreCase("Vertical"); + int size = 36; + int size2 = 36; + int n3 = isVertical ? size : normal.size() * size; + int n4 = isVertical ? normal.size() * size2 : size2; + this.setDimensions(n3, n4 - 1); + for (int cooldownList = 0; cooldownList < normal.size(); ++cooldownList) { + CooldownRenderer cooldownRenderer = normal.get(cooldownList); + if (((String) this.mode.getValue()).equalsIgnoreCase("Vertical")) { + cooldownRenderer.render(this.theme, this.width / 2.0f - (float) (size / 2), cooldownList * size2, this.color.getColorValue()); + continue; + } + cooldownRenderer.render(this.theme, cooldownList * size, 0.0f, this.color.getColorValue()); + } + } else if (!(this.mc.currentScreen instanceof HudLayoutEditorGui) && !(this.mc.currentScreen instanceof ModulePlaceGui)) { + this.setDimensions(50, 24); + this.scaleAndTranslate(event.getScaledResolution()); + } + GL11.glPopMatrix(); + } + + public void addCooldown(String name, long duration, int itemId) { + for (CooldownRenderer cooldownRenderer : normal) { + if (!cooldownRenderer.getName().equalsIgnoreCase(name) || cooldownRenderer.getItemID() != itemId) + continue; + cooldownRenderer.setTimeToCurrentSystemTime(); + cooldownRenderer.setDuration(duration); + return; + } + normal.add(new CooldownRenderer(name, itemId, duration)); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/Key.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/Key.java new file mode 100644 index 0000000..afae577 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/Key.java @@ -0,0 +1,224 @@ +package com.cheatbreaker.client.module.impl.normal.hud.keystrokes; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +/** + * @ModuleUtility - Key + * @see ModuleKeyStrokes + * + * Draws the actual key for com.cheatbreaker.client.module.impl.normal.hud.keystrokes.ModuleKeyStrokes. + */ +public class Key { + @Getter + private final String displayString; + + @Getter + private final int keyCode; + + @Getter + private final float width; + + @Getter + private final float height; + + private boolean pressed; + + private long lastPressed; + + private Color backgroundPressedColor; + private Color backgroundUnpressedColor; + private Color textPressedColor; + private Color textUnpressedColor; + private Color clicksPressedColor; + private Color clicksUnpressedColor; + private Color borderPressedColor; + private Color borderUnpressedColor; + + public Key(String displayString, int keyCode, float width, float height) { + this.displayString = displayString; + this.keyCode = keyCode; + this.width = width; + this.height = height; + } + + /** + * Renders the key. + */ + public void render(float x, float y, int textColor, int textColorPressed, int backgroundColor, int backgroundColorPressed, int borderColor, int borderColorPressed, boolean textShadow) { + Minecraft mc = Minecraft.getMinecraft(); + int button = (this.keyCode == -99 || this.keyCode == -100) ? ((this.keyCode == -99) ? 1 : 0) : -1; + boolean pressed = (mc.currentScreen == null || mc.currentScreen instanceof GuiContainer || mc.currentScreen instanceof HudLayoutEditorGui) && ((button != -1) ? Mouse.isButtonDown(button) : Keyboard.isKeyDown(this.keyCode)); + if (pressed && !this.pressed) { + this.pressed = true; + this.lastPressed = System.currentTimeMillis(); + this.backgroundPressedColor = new Color(backgroundColor, true); + this.backgroundUnpressedColor = new Color(backgroundColorPressed, true); + this.textPressedColor = new Color(textColor, true); + this.textUnpressedColor = new Color(textColorPressed, true); + this.clicksPressedColor = new Color(CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColor.getColorValue(), true); + this.clicksUnpressedColor = new Color(CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColorPressed.getColorValue(), true); + this.borderPressedColor = new Color(borderColor, true); + this.borderUnpressedColor = new Color(borderColorPressed, true); + } else if (this.pressed && !pressed) { + this.pressed = false; + this.lastPressed = System.currentTimeMillis(); + this.backgroundPressedColor = new Color(backgroundColorPressed, true); + this.backgroundUnpressedColor = new Color(backgroundColor, true); + this.textPressedColor = new Color(textColorPressed, true); + this.textUnpressedColor = new Color(textColor, true); + this.clicksPressedColor = new Color(CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColorPressed.getColorValue(), true); + this.clicksUnpressedColor = new Color(CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColor.getColorValue(), true); + this.borderPressedColor = new Color(borderColorPressed, true); + this.borderUnpressedColor = new Color(borderColor, true); + } + float backgroundFadeTime = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.backgroundFadeTime.getValue(); + int rgb; + if (System.currentTimeMillis() - this.lastPressed < backgroundFadeTime) { + float n9 = (System.currentTimeMillis() - this.lastPressed) / backgroundFadeTime; + rgb = new Color( + (int) Math.abs(n9 * this.backgroundUnpressedColor.getRed() + (1.0f - n9) * this.backgroundPressedColor.getRed()), + (int) Math.abs(n9 * this.backgroundUnpressedColor.getGreen() + (1.0f - n9) * this.backgroundPressedColor.getGreen()), + (int) Math.abs(n9 * this.backgroundUnpressedColor.getBlue() + (1.0f - n9) * this.backgroundPressedColor.getBlue()), + (int) Math.abs(n9 * this.backgroundUnpressedColor.getAlpha() + (1.0f - n9) * this.backgroundPressedColor.getAlpha()) + ).getRGB(); + } else { + rgb = (pressed ? backgroundColorPressed : backgroundColor); + } + + float textFadeTime = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.textFadeTime.getValue(); + int getTextColor; + int getCPSTextColor; + int getTextShadowColor; + if ((float) (System.currentTimeMillis() - this.lastPressed) < textFadeTime) { + float var12 = (float) (System.currentTimeMillis() - this.lastPressed); + float var13 = var12 / textFadeTime; + int r = (int) Math.abs(var13 * (float) this.textUnpressedColor.getRed() + (1.0F - var13) * (float) this.textPressedColor.getRed()); + int g = (int) Math.abs(var13 * (float) this.textUnpressedColor.getGreen() + (1.0F - var13) * (float) this.textPressedColor.getGreen()); + int b = (int) Math.abs(var13 * (float) this.textUnpressedColor.getBlue() + (1.0F - var13) * (float) this.textPressedColor.getBlue()); + int a = (int) Math.abs(var13 * (float) this.textUnpressedColor.getAlpha() + (1.0F - var13) * (float) this.textPressedColor.getAlpha()); + int rc = (int) Math.abs(var13 * (float) this.clicksUnpressedColor.getRed() + (1.0F - var13) * (float) this.clicksPressedColor.getRed()); + int gc = (int) Math.abs(var13 * (float) this.clicksUnpressedColor.getGreen() + (1.0F - var13) * (float) this.clicksPressedColor.getGreen()); + int bc = (int) Math.abs(var13 * (float) this.clicksUnpressedColor.getBlue() + (1.0F - var13) * (float) this.clicksPressedColor.getBlue()); + int ac = (int) Math.abs(var13 * (float) this.clicksUnpressedColor.getAlpha() + (1.0F - var13) * (float) this.clicksPressedColor.getAlpha()); + getTextColor = new Color(r, g, b, a).getRGB(); + getCPSTextColor = new Color(rc, gc, bc, ac).getRGB(); + getTextShadowColor = new Color(r / 4, g / 4, b / 4, a).getRGB(); + } else { + getTextColor = pressed ? textColorPressed : textColor; + getCPSTextColor = pressed ? (Integer) CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColorPressed.getColorValue() : (Integer) CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColor.getColorValue(); + int rp = textColorPressed >> 16 & 255; + int gp = textColorPressed >> 8 & 255; + int bp = textColorPressed & 255; + int r = textColor >> 16 & 255; + int g = textColor >> 8 & 255; + int b = textColor & 255; + getTextShadowColor = pressed ? (new Color(rp / 4, gp / 4, bp / 4)).getRGB() : (new Color(r / 4, g / 4, b / 4)).getRGB(); + } + + float borderFadeTime = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.borderFadeTime.getValue(); + int borderRGB; + if (System.currentTimeMillis() - this.lastPressed < borderFadeTime) { + float n9 = (System.currentTimeMillis() - this.lastPressed) / borderFadeTime; + borderRGB = new Color( + (int) Math.abs(n9 * this.borderUnpressedColor.getRed() + (1.0f - n9) * this.borderPressedColor.getRed()), + (int) Math.abs(n9 * this.borderUnpressedColor.getGreen() + (1.0f - n9) * this.borderPressedColor.getGreen()), + (int) Math.abs(n9 * this.borderUnpressedColor.getBlue() + (1.0f - n9) * this.borderPressedColor.getBlue()), + (int) Math.abs(n9 * this.borderUnpressedColor.getAlpha() + (1.0f - n9) * this.borderPressedColor.getAlpha()) + ).getRGB(); + } else { + borderRGB = (pressed ? borderColorPressed : borderColor); + } + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.background.getValue()) { + Gui.drawRect(x, y, x + this.width, y + this.height, rgb); + } + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.border.getValue()) { + float borderThickness = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.borderThickness.getValue(); + Gui.drawOutline(x - borderThickness, y - borderThickness, x + this.width + borderThickness, y + this.height + borderThickness, borderThickness, borderRGB); + } + if (this.keyCode == mc.gameSettings.keyBindJump.getKeyCode() && (Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLine.getValue()) { + float spaceBarPos = (Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.centerSpacebarLine.getValue() ? this.height / 2 - (float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineHeight.getValue() / 2 : 3; + if (textShadow) + Gui.drawRect((x + this.width / 2.0f - this.width / (12.0F - (float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue())) + 1, y + spaceBarPos + 1.0f, (x + this.width / 2.0f + this.width / (12.0F - (float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue())) + 1, y + spaceBarPos + 1 + (float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineHeight.getValue(), getTextShadowColor); + Gui.drawRect(x + this.width / 2 - this.width / (12.0F - (float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue()), y + spaceBarPos, x + this.width / 2.0f + this.width / (12.0F - (float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue()), y + spaceBarPos + (float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineHeight.getValue(), getTextColor); + } else { + GlStateManager.enableBlend(); + float xPos = (x + this.width / 2.0F) - (float) (mc.fontRendererObj.getStringWidth(this.displayString) / 2) + 0.26F; + float yPos = y + this.height / 2.0F - (float) (mc.fontRendererObj.FONT_HEIGHT / 2) + 0.65F; + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.legacyPosition.getValue()) { + xPos = (x + this.width / 2.0F) - (float) (mc.fontRendererObj.getStringWidth(this.displayString) / 2); + yPos = y + this.height / 2.0F - (float) (mc.fontRendererObj.FONT_HEIGHT / 2) + 1.0f; + } + float boxSize = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.boxSize.getValue(); + boolean attackKeyCode = this.keyCode == mc.gameSettings.keyBindAttack.getKeyCode(); + boolean useItemKeyCode = this.keyCode == mc.gameSettings.keyBindUseItem.getKeyCode(); + String clicksOption = attackKeyCode ? (String) CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftClicks.getValue() : useItemKeyCode ? (String) CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightClicks.getValue() : ""; + if (attackKeyCode || useItemKeyCode) { + if (boxSize > 14.0F && clicksOption.equals("With Clicks")) { + + GL11.glPushMatrix(); + float cpsScale = 0.6666F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + yPos = y + this.height / 2.0F - (float) (mc.fontRendererObj.FONT_HEIGHT / 2) + 6.0F; + String clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftCPS.size() + " CPS"; + if (this.displayString.equals("RMB")) { + clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightCPS.size() + " CPS"; + } + float xClicksPos = (x + this.width / 2.0F) - (mc.fontRendererObj.getStringWidth(clicks) / 2.0F) * cpsScale; + mc.fontRendererObj.drawString(clicks, xClicksPos / cpsScale, yPos / cpsScale, getCPSTextColor, textShadow); + GL11.glScalef(1.0F, 1.0F, 0.0F); + GL11.glPopMatrix(); + yPos = y + this.height / 2.0F - (float) (mc.fontRendererObj.FONT_HEIGHT / 2) - 3.0F; + } else if (clicksOption.equals("Replace Clicks")) { + GL11.glPushMatrix(); + float cpsScale = 1.0F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + String clicks = this.displayString; + String cpsText = boxSize < 15.0F ? "" : " CPS"; + if (attackKeyCode) { + if (CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftCPS.size() > 0) { + clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftCPS.size() + cpsText; + if (boxSize > 15.0F) { + cpsScale = 0.6666F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + } + } + } + if (useItemKeyCode) { + if (CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightCPS.size() > 0) { + clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightCPS.size() + cpsText; + if (boxSize > 15.0F) { + cpsScale = 0.6666F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + } + } + } + xPos = x + this.width / 2.0F - (mc.fontRendererObj.getStringWidth(clicks) / 2.0F) * cpsScale + 0.26F; + yPos = y + this.height / 2.0F - (float) (mc.fontRendererObj.FONT_HEIGHT / 2) + (boxSize > 15.0F && !clicks.equals(this.displayString) ? 1.65F : 0.65F); + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.legacyPosition.getValue()) { + xPos = x + this.width / 2.0F - (mc.fontRendererObj.getStringWidth(clicks) / 2.0F) * cpsScale; + yPos = y + this.height / 2.0F - (float) (mc.fontRendererObj.FONT_HEIGHT / 2) + (boxSize > 15.0F && !clicks.equals(this.displayString) ? 2.0F : 1.0F); + } + mc.fontRendererObj.drawString(clicks, xPos / cpsScale, yPos / cpsScale, getTextColor, textShadow); + GL11.glScalef(1.0F, 1.0F, 0.0F); + GL11.glPopMatrix(); + } + } + + if (!clicksOption.equals("Replace Clicks")) { + mc.fontRendererObj.drawString(this.displayString, xPos, yPos, getTextColor, textShadow); + } + GlStateManager.disableBlend(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/ModuleKeyStrokes.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/ModuleKeyStrokes.java new file mode 100644 index 0000000..ef66b20 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/ModuleKeyStrokes.java @@ -0,0 +1,263 @@ +package com.cheatbreaker.client.module.impl.normal.hud.keystrokes; + +import com.cheatbreaker.client.event.impl.mouse.ClickEvent; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Module - ModuleKeyStrokes + * @see AbstractModule + * + * This module shows what movement keys and mouse buttons are being pressed. + */ +public class ModuleKeyStrokes extends AbstractModule { + private final Setting keyOptionsLabel; + private final Setting movementKeys; + private final Setting clicks; + private final Setting spacebar; + private final Setting sneak; + + private final Setting clickOptionsLabel; + public Setting leftClicks; + public Setting rightClicks; + private final Setting backgroundHeight; + public Setting clicksColor; + public Setting clicksColorPressed; + + private final Setting spacebarOptionsLabel; + public Setting spacebarLineWidth; + public Setting spacebarLineHeight; + public Setting spacebarLine; + public Setting centerSpacebarLine; + + private final Setting textOptionsLabel; + public Setting namesArrowSetting; + private final Setting textShadow; + public Setting legacyPosition; + + private final Setting backgroundOptionsLabel; + public Setting background; + public Setting border; + private final Setting splitBoxSize; + private final Setting boxSizeHeight; + public Setting borderThickness; + private final Setting spacebarHeight; + public Setting boxSize; + private final Setting gap; + + private final Setting fadeOptionsLabel; + public Setting textFadeTime; + public Setting backgroundFadeTime; + public Setting borderFadeTime; + + private final Setting colorOptionsLabel; + private final Setting textColor; + private final Setting textColorPressed; + private final Setting backgroundColor; + private final Setting backgroundColorPressed; + private final Setting borderColor; + private final Setting borderColorPressed; + + private Key forwardElement; + private Key leftElement; + private Key rightElement; + private Key backElement; + private Key attackButtonElement; + private Key useButtonElement; + private Key spaceButtonElement; + private Key sneakButtonElement; + + public final List leftCPS = new ArrayList(); + public final List rightCPS = new ArrayList(); + + public ModuleKeyStrokes() { + super("Key Strokes"); + this.setDefaultAnchor(GuiAnchor.LEFT_TOP); + this.setDefaultTranslations(0.0F, 5); + this.setDefaultState(false); + this.keyOptionsLabel = new Setting(this, "label").setValue("Key Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.movementKeys = new Setting(this, "Show movement keys").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.clicks = new Setting(this, "Show clicks").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.spacebar = new Setting(this, "Show spacebar").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.sneak = new Setting(this, "Show sneak key").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.clickOptionsLabel = new Setting(this, "label").setValue("Click Options").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.clicks.getValue()); + this.leftClicks = new Setting(this, "Left CPS").setValue("OFF").acceptedStringValues("OFF", "Replace Clicks", "With Clicks", "Separate").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.clicks.getValue()); + this.rightClicks = new Setting(this, "Right CPS").setValue("OFF").acceptedStringValues("OFF", "Replace Clicks", "With Clicks", "Separate").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.clicks.getValue()); + this.backgroundHeight = new Setting(this, "CPS Background Height").setValue(13.0F).setMinMax(10.0F, 24.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.clicks.getValue() && this.leftClicks.getValue().equals("Separate") || this.rightClicks.getValue().equals("Separate")); + this.clicksColor = new Setting(this, "CPS Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.clicks.getValue() && this.leftClicks.getValue().equals("With Clicks") || this.rightClicks.getValue().equals("With Clicks")); + this.clicksColorPressed = new Setting(this, "CPS Color (Pressed)").setValue(-16777216).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.clicks.getValue() && this.leftClicks.getValue().equals("With Clicks") || this.rightClicks.getValue().equals("With Clicks")); + + this.spacebarOptionsLabel = new Setting(this, "label").setValue("Spacebar Options").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.spacebar.getValue()); + this.spacebarLine = new Setting(this, "Show Spacebar Line").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.spacebar.getValue()); + this.centerSpacebarLine = new Setting(this, "Center Spacebar Line").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.spacebar.getValue() && (Boolean) this.spacebarLine.getValue()); + this.spacebarLineWidth = new Setting(this, "Spacebar Line Width").setValue(4.0F).setMinMax(1.0F, 8.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.spacebar.getValue() && (Boolean) this.spacebarLine.getValue()); + this.spacebarLineHeight = new Setting(this, "Spacebar Line Height").setValue(1.0F).setMinMax(0.5F, 2.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.spacebar.getValue() && (Boolean) this.spacebarLine.getValue()); + this.spacebarHeight = new Setting(this, "Spacebar Height").setValue(50.0F).setMinMax(0.0F, 100.0F).setUnit("%").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.spacebar.getValue()); + + this.textOptionsLabel = new Setting(this, "label").setValue("Text Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textShadow = new Setting(this, "Text Shadow").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.namesArrowSetting = new Setting(this, "Replace names with arrows").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.movementKeys.getValue()); + + this.legacyPosition = new Setting(this, "Legacy Position").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.movementKeys.getValue() || (Boolean) this.clicks.getValue()); + + this.backgroundOptionsLabel = new Setting(this, "label").setValue("Background Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.background = new Setting(this, "Show Background").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.border = new Setting(this, "Show Border").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.splitBoxSize = new Setting(this, "Split Box Size").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.boxSize = new Setting(this, "Box size").setValue(18.0F).setMinMax(10.0F, 32.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.boxSizeHeight = new Setting(this, "Box size height").setValue(18.0F).setMinMax(10.0F, 32.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.splitBoxSize.getValue()); + this.gap = new Setting(this, "Gap").setValue(1.0F).setMinMax(0.0F, 4.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.borderThickness = new Setting(this, "Border Thickness").setValue(1.0F).setMinMax(0.0F, 3.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.border.getValue()); + + this.fadeOptionsLabel = new Setting(this, "label").setValue("Fade Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textFadeTime = new Setting(this, "Text Fade Time").setValue(0.0F).setMinMax(0.0F, 200.0F).setUnit("ms").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.backgroundFadeTime = new Setting(this, "Background Fade Time").setValue(75.0F).setMinMax(0.0F, 200.0F).setUnit("ms").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.background.getValue()); + this.borderFadeTime = new Setting(this, "Border Fade Time").setValue(100.0F).setMinMax(0.0F, 200.0F).setUnit("ms").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.border.getValue()); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textColorPressed = new Setting(this, "Text Color (Pressed)").setValue(-16777216).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x6F000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.backgroundColorPressed = new Setting(this, "Background Color (Pressed)").setValue(0x6FFFFFFF).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.borderColor = new Setting(this, "Border Color").setValue(0x9F000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.border.getValue()); + this.borderColorPressed = new Setting(this, "Border Color (Pressed)").setValue(0x9FFFFFFF).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.border.getValue()); + this.updateKeyElements(); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/wasd.png"), 55, 37); + this.setDescription("Displays when your movement keys, mouse or spacebar is pressed."); + this.setCreators("Fyu"); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(ClickEvent.class, this::onClick); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + this.leftCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + this.rightCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + float width = 0.0f; + float height = 0.0f; + float gap = (Float) this.gap.getValue(); + float borderThickness = (Float) this.borderThickness.getValue(); + float bgHeight = (Float) this.backgroundHeight.getValue(); + if (!(Boolean) border.getValue()) { + borderThickness = 0.0F; + } + + if ((Boolean) this.movementKeys.getValue()) { + this.forwardElement.render(this.leftElement.getWidth() + gap + (borderThickness * 2.0F), 0.0F, this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + this.leftElement.render(0.0F, this.forwardElement.getHeight() + gap + (borderThickness * 2.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + this.backElement.render(this.leftElement.getWidth() + gap + (borderThickness * 2.0F), this.forwardElement.getHeight() + gap + (borderThickness * 2.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + this.rightElement.render(this.leftElement.getWidth() + this.backElement.getWidth() + 2.0F * gap + (borderThickness * 4.0F), this.forwardElement.getHeight() + gap + (borderThickness * 2.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + width = this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + (2.0F) * gap + (borderThickness * 2.0F); + height += this.forwardElement.getHeight() + 2.0F * gap + this.backElement.getHeight(); + } + + if ((Boolean) this.clicks.getValue()) { + this.attackButtonElement.render(0.0F, height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + this.useButtonElement.render(this.attackButtonElement.getWidth() + gap + (borderThickness * 2.0F), height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += this.useButtonElement.getHeight() + gap + (borderThickness * 2.0F); + } + + if ((Boolean) this.spacebar.getValue()) { + this.spaceButtonElement.render(0.0F, height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + width = this.spaceButtonElement.getWidth(); + height += this.spaceButtonElement.getHeight() + gap + (borderThickness * 2.0F); + } + + if ((Boolean) this.sneak.getValue()) { + this.sneakButtonElement.render(0.0F, height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), (Boolean) this.textShadow.getValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += this.sneakButtonElement.getHeight() + gap + (borderThickness * 2.0F); + } + + if (this.leftClicks.getValue().equals("Separate")) { + String leftClicks = this.leftCPS.size() + " CPS"; + if ((Boolean) this.background.getValue()) { + Gui.drawRect(0.0F, height + (borderThickness * 4.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 4.0F), height + (borderThickness * 4.0F) + bgHeight, this.backgroundColor.getColorValue()); + } + if ((Boolean) this.border.getValue()) { + Gui.drawOutline(-borderThickness, height + (borderThickness * 3.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 5.0F), height + (borderThickness * 5.0F) + bgHeight, borderThickness, this.borderColor.getColorValue()); + } + GlStateManager.enableBlend(); + this.mc.fontRendererObj.drawString(leftClicks, this.width / 2.0F - (float) (this.mc.fontRendererObj.getStringWidth(leftClicks) / 2) - 0.1F, height + (borderThickness * 4.0F) + (bgHeight / 2.0F - 3.49F), clicksColor.getColorValue(), (Boolean) this.textShadow.getValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += bgHeight + gap + (borderThickness * 2.0F); + } + + if (this.rightClicks.getValue().equals("Separate")) { + String leftClicks = this.rightCPS.size() + " RCPS"; + if ((Boolean) this.background.getValue()) { + Gui.drawRect(0.0F, height + (borderThickness * 4.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 4.0F), height + (borderThickness * 4.0F) + bgHeight, this.backgroundColor.getColorValue()); + } + if ((Boolean) this.border.getValue()) { + Gui.drawOutline(-borderThickness, height + (borderThickness * 3.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 5.0F), height + (borderThickness * 5.0F) + bgHeight, borderThickness, this.borderColor.getColorValue()); + } + GlStateManager.enableBlend(); + this.mc.fontRendererObj.drawString(leftClicks, this.width / 2.0F - (float) (this.mc.fontRendererObj.getStringWidth(leftClicks) / 2) - 0.1F, height + (borderThickness * 4.0F) + (bgHeight / 2.0F - 3.49F), clicksColor.getColorValue(), (Boolean) this.textShadow.getValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += bgHeight + gap + (borderThickness * 2.0F); + } + GlStateManager.disableBlend(); + + this.setDimensions(width, height - gap + (borderThickness * 2.0F)); + GL11.glPopMatrix(); + } + + public void updateKeyElements() { + int forwardKeyCode = this.mc.gameSettings.keyBindForward.getKeyCode(); + int leftKeyCode = this.mc.gameSettings.keyBindLeft.getKeyCode(); + int backKeyCode = this.mc.gameSettings.keyBindBack.getKeyCode(); + int rightKeyCode = this.mc.gameSettings.keyBindRight.getKeyCode(); + float boxSize = (Float) this.boxSize.getValue(); + float boxSize2 = (Boolean) this.splitBoxSize.getValue() ? (Float) this.boxSizeHeight.getValue() : (Float) this.boxSize.getValue(); + float gap = (Float) this.gap.getValue(); + String w = Keyboard.getKeyName(forwardKeyCode); + String a = Keyboard.getKeyName(leftKeyCode); + String s = Keyboard.getKeyName(backKeyCode); + String d = Keyboard.getKeyName(rightKeyCode); + float upKeyWidth = (float) this.mc.fontRendererObj.getStringWidth(w) * (Float) this.scale.getValue(); + float leftKeyWidth = (float) this.mc.fontRendererObj.getStringWidth(a) * (Float) this.scale.getValue(); + float downKeyWidth = (float) this.mc.fontRendererObj.getStringWidth(s) * (Float) this.scale.getValue(); + float rightKeyWidth = (float) this.mc.fontRendererObj.getStringWidth(d) * (Float) this.scale.getValue(); + int jumpKeyCode = this.mc.gameSettings.keyBindJump.getKeyCode(); + int attackKeyCode = this.mc.gameSettings.keyBindAttack.getKeyCode(); + int useItemKeyCode = this.mc.gameSettings.keyBindUseItem.getKeyCode(); + int sneakKeyBind = this.mc.gameSettings.keyBindSneak.getKeyCode(); + boolean arrowKeys = (Boolean) this.namesArrowSetting.getValue(); + float borderThickness = (Float) this.borderThickness.getValue(); + if (!(Boolean) this.border.getValue()) { + borderThickness = 0.0F; + } + this.forwardElement = new Key(arrowKeys ? "▲" : (upKeyWidth > boxSize ? w.substring(0, 1) : w), forwardKeyCode, boxSize, boxSize2); + this.leftElement = new Key(arrowKeys ? "◀" : (leftKeyWidth > boxSize ? a.substring(0, 1) : a), leftKeyCode, boxSize, boxSize2); + this.backElement = new Key(arrowKeys ? "▼" : (downKeyWidth > boxSize ? s.substring(0, 1) : s), backKeyCode, boxSize, boxSize2); + this.rightElement = new Key(arrowKeys ? "▶" : (rightKeyWidth > boxSize ? d.substring(0, 1) : d), rightKeyCode, boxSize, boxSize2); + float boxSizeButtonWidth = (this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + gap + (borderThickness * 2.0F)) / 2.0f; + this.attackButtonElement = new Key(boxSize < 14 ? "L" : "LMB", attackKeyCode, boxSizeButtonWidth, boxSize2); + this.useButtonElement = new Key(boxSize < 14 ? "R" : "RMB", useItemKeyCode, boxSizeButtonWidth, boxSize2); + this.spaceButtonElement = new Key(Keyboard.getKeyName(jumpKeyCode), jumpKeyCode, this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0f * gap + (borderThickness * 4.0F), boxSize2 * (Float) this.spacebarHeight.getValue() / 100.0f); + this.sneakButtonElement = new Key("SNEAK", sneakKeyBind, this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 4.0F), boxSize2 * 0.72F); + } + + private void onClick(ClickEvent event) { + if (event.getMouseButton() == 0) leftCPS.add(System.currentTimeMillis()); + if (event.getMouseButton() == 1) rightCPS.add(System.currentTimeMillis()); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/AbstractSimpleHudModule.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/AbstractSimpleHudModule.java new file mode 100644 index 0000000..bc51cae --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/AbstractSimpleHudModule.java @@ -0,0 +1,293 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +/** + * @SimpleModule - AbstractSimpleHudModule + * @see AbstractModule + * + * This abstract class defines the simple class simple HUD modules use. + */ +public abstract class AbstractSimpleHudModule extends AbstractModule { + + protected Setting background; + protected Setting staticBackgroundWidth; + protected Setting textOverflow; + protected Setting padding; +// protected Setting backgroundCurvature; + protected Setting backgroundWidth; + protected Setting backgroundHeight; + protected Setting border; + protected Setting borderThickness; + protected Setting borderColor; + protected Setting showWhileTyping; + protected Setting alwaysCenter; + protected Setting textShadowBackground; + protected Setting textShadowNoBackground; + + protected Setting textColor; + protected Setting backgroundColor; + public Setting icon = null; + protected ResourceLocation iconTexture; + protected Setting customString; + protected Setting customStringNoBackground; + + public AbstractSimpleHudModule(String name) { + this(name, name, 1.5F, false, true); + } + + public AbstractSimpleHudModule(String name, String previewString) { + this(name, previewString, 1.5F, true, false); + } + + public AbstractSimpleHudModule(String name, String previewString, float previewScale, boolean showBackground, boolean alwaysCenter) { + super(name); + this.setDefaultAnchor(GuiAnchor.RIGHT_TOP); + this.setDefaultTranslations(0.0F, 0.0F); + this.setDefaultState(false); + + new Setting(this, "label").setValue("Background Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.background = new Setting(this, "Show Background", "Draw a background.").setValue(showBackground).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.staticBackgroundWidth = new Setting(this, "Static Background Width", + "§2Enabled:§r Background width is set by a slider.\n" + + "§4Disabled:§r Background width is set by the text size.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()); + this.textOverflow = new Setting(this, "Text Overflow", + "What the mod will do if the text overflows from the background" + + "\n§bExtend Width:§r Increases the background width." + + "\n§bScale Text:§r Scales the text down." + + "\n§bDo Nothing:§r Does no action.") + .setValue("Extend Width").acceptedStringValues("Extend Width", "Scale Text", "Do Nothing").setCondition(() -> (this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()) && this.staticBackgroundWidth.getBooleanValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.border = new Setting(this, "Show Border", "Draw a border around the background.").setValue(false).setCondition(this.background::getBooleanValue).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.padding = new Setting(this, "Background Width Padding", "Change how spaced the background width is from the text.").setValue(6.0F).setMinMax(0.0F, 10.0F).setUnit("px") + .setCondition(() -> (this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()) && (!this.staticBackgroundWidth.getBooleanValue() || !this.textOverflow.getValue().equals("Do Nothing"))) + .setCustomizationLevel(CustomizationLevel.MEDIUM); + +// this.backgroundCurvature = new Setting(this, "Background Curvature", "Change the roundness of the background corners.").setValue(0F).setMinMax(0F, 12F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> ((boolean) this.background.getValue())); + this.backgroundWidth = new Setting(this, "Background Width", "Change the width of the background.").setValue(this.backgroundDimensionValues().getDefaultWidth()).setMinMax(this.backgroundDimensionValues().getMinWidth(), this.backgroundDimensionValues().getMaxWidth()).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()) && this.staticBackgroundWidth.getBooleanValue()); + this.backgroundHeight = new Setting(this, "Background Height", "Change the height of the background.").setValue(this.backgroundDimensionValues().getDefaultHeight()).setMinMax(this.backgroundDimensionValues().getMinHeight(), this.backgroundDimensionValues().getMaxHeight()).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()); + this.borderThickness = new Setting(this, "Border Thickness", "Change the thickness of the border.").setValue(1.0F).setMinMax(0.25F, 3.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.background.getBooleanValue() && this.border.getBooleanValue()); + + new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showWhileTyping = new Setting(this, "Show While Typing", "Show the mod when opening chat.").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.alwaysCenter = new Setting(this, "Always Center", "Force the text to be centered in the mod's placement.").setValue(alwaysCenter).setCondition(() -> !this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.MEDIUM); + if (includeIcon()) icon = new Setting(this, "Show icon", "Show an icon corresponding to the mod.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.getExtraSettings(); + new Setting(this, "label").setValue("Format Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textShadowBackground = new Setting(this, "Text Shadow (Background)", "Add a text shadow when the background is enabled.").setValue(false).setCondition(() -> this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadowNoBackground = new Setting(this, "Text Shadow (No background)", "Add a text shadow when the background is disabled.").setValue(true).setCondition(() -> !this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.getExtraFormatSettings(); + this.customString = new Setting(this, "Format (Background)").setValue(customString()).setCondition(this.background::getBooleanValue).setCustomizationLevel(CustomizationLevel.ADVANCED); + + if (showBrackets()) { + this.customStringNoBackground = new Setting(this, "Format (No Background)").setValue("[" + customString() + "]").setCondition(() -> !this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + } else { + this.customStringNoBackground = new Setting(this, "Format (No Background)").setValue(customString()).setCondition(() -> !this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + } + + + new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textColor = new Setting(this, "Text Color", "Sets the color for the text.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> !(name.equals("Ping") && CheatBreaker.getInstance().getModuleManager().pingMod.dynamicColorRange.getBooleanValue()) && !(name.equals("Saturation") && CheatBreaker.getInstance().getModuleManager().saturationMod.amountColors.getBooleanValue())); + this.getExtraColorSettings(); + this.backgroundColor = new Setting(this, "Background Color", "Sets the color for the background.").setValue(1862270976).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.background::getBooleanValue); + this.borderColor = new Setting(this, "Border Color", "Sets the color for the border.").setValue(-1627389952).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.background.getBooleanValue() && this.border.getBooleanValue()); + this.setPreviewLabel(previewString, previewScale); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + public void getExtraSettings() { + + } + + public void getExtraFormatSettings() { + + } + + public void getExtraColorSettings() { + + } + + /** + * Returns the default background dimension values. + */ + public SimpleHudModSize backgroundDimensionValues() { + if (includeIcon()) { + return new SimpleHudModSize(10, 16, 64, 40, 56, 80); + } + return new SimpleHudModSize(10, 13, 24, 40, 56, 80); + + } + + /** + * Returns the value string. + */ + public abstract String getValueString(); + + /** + * Returns the label string. + */ + public abstract String getLabelString(); + + /** + * Returns a string in which will display when the mod is in a "waiting" state. If the string is empty or null, the waiting message will not be displayed. + */ + public String getWaitingMessage() { + return null; + } + + /** + * Returns the default format the mod's string. + */ + public String customString() { + return "%VALUE% %LABEL%"; + } + + /** + * Returns if the mod should include an icon. + * Simple Mods will need to set a path to set up an image to utilize this feature. + */ + public boolean includeIcon() { + return false; + } + + /** + * Returns a string in which will display when the mod is in a "preview" state. This string will be displayed when the "real" string is null. + */ + public String getPreviewString() { + return ""; + } + + /** + * Returns true if a mod should include brackets in the No Background mode by default. + */ + public boolean showBrackets() { + return true; + } + + /** + * Returns the actual path for the icon texture. The icon will not display if the path is null. + */ + public ResourceLocation getIconTexture() { + return null; + } + + /** + * Returns the active color. + */ + public int getColor() { + return textColor.getColorValue(); + } + + /** + * Shows the preview version of the mod when in the HUD Editor. For Simple Mods, this will show when the "real" string is null. + */ + private void onPreviewDraw(PreviewDrawEvent event) { + if (this.isRenderHud()) { + if (this.getValueString() == null) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + render(getPreviewString()); + GL11.glPopMatrix(); + } + } + } + + /** + * Shows the actual mod itself. + */ + private void onGuiDraw(GuiDrawEvent event) { + String value = this.getValueString(); + if (value != null && (!this.mc.ingameGUI.getChatGUI().getChatOpen() || this.showWhileTyping.getBooleanValue())) { + if (this.isRenderHud() && (!this.hiddenFromHud || (this.mc.currentScreen instanceof HudLayoutEditorGui))) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if (value.isEmpty()) { + value = ""; + } + render(value); + GL11.glPopMatrix(); + } + } + } + + /** + * Actually calls the necessary methods to render the mod. + */ + public void render(String value) { + boolean showIcon = includeIcon() && this.icon.getBooleanValue() && iconTexture != null; + String label = this.getLabelString(); + if (label == null || label.isEmpty()) { + label = ""; + } + + String counter; + if (getWaitingMessage() != null && getValueString() != null) { + counter = getWaitingMessage(); + } else if (!label.equals("")) { + if (!showIcon && !this.background.getBooleanValue()) { + counter = this.customStringNoBackground.getValue().toString().replaceAll("%LABEL%", label).replaceAll("%VALUE%", value); + } else { + counter = this.customString.getValue().toString().replaceAll("%LABEL%", label).replaceAll("%VALUE%", value); + } + } else { + counter = value; + } + + iconTexture = getIconTexture(); + float width = (float) mc.fontRendererObj.getStringWidth(counter); + float bHeight = this.backgroundHeight.getFloatValue(); + float extraX = showIcon ? bHeight : 0.0F; + float bWidth = !this.staticBackgroundWidth.getBooleanValue() ? width + this.padding.getFloatValue() + extraX : this.backgroundWidth.getFloatValue(); + + if (this.textOverflow.getValue().equals("Extend Width") && this.staticBackgroundWidth.getBooleanValue()) { + bWidth = Math.max(this.backgroundWidth.getFloatValue(), width + this.padding.getFloatValue() + extraX); + } + + if (this.background.getBooleanValue() || showIcon || this.alwaysCenter.getBooleanValue()) { + this.setDimensions(bWidth, bHeight); + if (this.background.getBooleanValue()) { + + Gui.drawRect(0.0F, 0.0F, bWidth, bHeight, this.backgroundColor.getColorValue()); + + if (this.border.getBooleanValue()) { + float borderThickness = this.borderThickness.getFloatValue(); + Gui.drawOutline(-borderThickness, -borderThickness, bWidth + borderThickness, bHeight + borderThickness, borderThickness, this.borderColor.getColorValue()); + } + } + + if (showIcon) { + GL11.glColor3f(1.0F, 1.0F, 1.0F); + RenderUtil.renderEIcon(iconTexture, bHeight / 2.0f, 0, 0); + } + + GlStateManager.enableBlend(); + float scale = 1.0F; + if (this.mc.fontRendererObj.getStringWidth(counter) > bWidth - this.padding.getFloatValue() - extraX && this.textOverflow.getValue().equals("Scale Text")) { + scale = (bWidth - this.padding.getFloatValue() - extraX) / this.mc.fontRendererObj.getStringWidth(counter); + GlStateManager.scale(scale, scale, 1.0F); + scale = this.mc.fontRendererObj.getStringWidth(counter) / (bWidth - this.padding.getFloatValue() - extraX); + } + this.mc.fontRendererObj.drawString(counter, this.width / 2.0F * scale - (float) (this.mc.fontRendererObj.getStringWidth(counter) / 2) + extraX * scale / 2.0F + 0.6F, bHeight / 2.0F * scale - 3.49F, getColor(), this.background.getBooleanValue() ? this.textShadowBackground.getBooleanValue() : this.textShadowNoBackground.getBooleanValue()); + if (this.mc.fontRendererObj.getStringWidth(counter) > bWidth) { + GlStateManager.scale(scale, scale, 1.0F); + } + } else { + GlStateManager.disableBlend(); + this.setDimensions((float) this.mc.fontRendererObj.drawString(counter, 0.0F, 0.0F, getColor(), this.textShadowNoBackground.getBooleanValue()), mc.fontRendererObj.FONT_HEIGHT); + } + + GlStateManager.disableBlend(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/SimpleHudModSize.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/SimpleHudModSize.java new file mode 100644 index 0000000..8fbde57 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/SimpleHudModSize.java @@ -0,0 +1,21 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @ModuleUtility - SimpleHudModSize + * @see AbstractSimpleHudModule + * + * This Object handles size for the Simple Modules. + */ +@Getter @AllArgsConstructor +public class SimpleHudModSize { + public float minHeight; + public float defaultHeight; + public float maxHeight; + public float minWidth; + public float defaultWidth; + public float maxWidth; +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/AbstractSimpleCombatHudModule.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/AbstractSimpleCombatHudModule.java new file mode 100644 index 0000000..4a3752c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/AbstractSimpleCombatHudModule.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.combat; + +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; + +/** + * @SimpleModule - AbstractSimpleCombatHudModule + * @see AbstractSimpleHudModule + * + * This abstract class defines the simple class simple HUD modules use. + */ +public abstract class AbstractSimpleCombatHudModule extends AbstractSimpleHudModule { + public Setting customWaitingMessageBackground; + public Setting customWaitingMessageNoBackground; + protected Setting hideWhenNotAttacking; + public static long lastAttackTime; + + public AbstractSimpleCombatHudModule(String name, String previewString) { + super(name, previewString); + this.addEvent(TickEvent.class, this::onTickEvent); + } + + public void getExtraSettings() { + this.hideWhenNotAttacking = new Setting(this, "Hide When Not Attacking").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } + + public void getExtraFormatSettings() { + this.customWaitingMessageBackground = new Setting(this, "Waiting (Background)").setValue(getWaitingString()).setCondition(this.background::getBooleanValue).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.customWaitingMessageNoBackground = new Setting(this, "Waiting (No Background)").setValue(showBrackets() && !getWaitingString().isEmpty() ? "[" + getWaitingString() + "]" : getWaitingString()).setCondition(() -> !this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + } + + public String getWaitingString() { + return ""; + } + + public boolean getWaitingRequirement() { + return lastAttackTime == 0L; + } + + public String getWaitingMessage() { + if (getWaitingRequirement()) { + String message = (this.background.getBooleanValue() ? this.customWaitingMessageBackground : this.customWaitingMessageNoBackground).getStringValue(); + if (!message.isEmpty()) { + return message.replaceAll("%LABEL%", getLabelString()).replaceAll("%VALUE%", getValueString()); + } + } + return null; + } + + public void onTickEvent(TickEvent event) { + if (System.currentTimeMillis() - lastAttackTime > 2000L) { + lastAttackTime = 0L; + clear(); + } + } + + public void clear() { + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleCPS.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleCPS.java new file mode 100644 index 0000000..8fd4015 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleCPS.java @@ -0,0 +1,99 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.combat; + +import com.cheatbreaker.client.event.impl.mouse.ClickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.util.RenderUtil; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayDeque; +import java.util.Deque; + +/** + * @Module - ModuleComboCounter + * @see AbstractModule + * + * This module counts the amount of clicks per second you're getting. + */ +public class SimpleModuleCPS extends AbstractSimpleCombatHudModule { + private final Deque leftCPS = new ArrayDeque<>(); + private final Deque rightCPS = new ArrayDeque<>(); + private Setting counterType; + private Setting lineColor; + private String leftClickCounter; + private String space; + + public SimpleModuleCPS() { + super("CPS", "[9 CPS]"); + this.setDescription("Displays your clicks per second."); + this.setCreators("Fyu"); + this.addEvent(ClickEvent.class, this::onClick); + } + + @Override + public String getValueString() { + if (lastAttackTime != 0L || !(Boolean) this.hideWhenNotAttacking.getValue()) { + leftCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + rightCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + leftClickCounter = !counterType.getValue().equals("Right Clicks") ? "" + leftCPS.size() : ""; + String rightClickCounter = !counterType.getValue().equals("Left Clicks") ? Integer.toString(rightCPS.size()) : ""; + space = counterType.getValue().equals("Both") ? " " : ""; + return counterType.getValue().equals("Higher") ? Math.max(leftCPS.size(), rightCPS.size()) + "" : leftClickCounter + space + rightClickCounter; + } + return null; + } + + @Override + public String getLabelString() { + return (counterType.getValue().equals("Right Clicks") || (counterType.getValue().equals("Higher") && leftCPS.size() < rightCPS.size()) ? "R" : "") + "CPS"; + } + + public String getPreviewString() { + return counterType.getValue().equals("Both") ? "9 2" : "9"; + } + + public void getExtraSettings() { + this.counterType = new Setting(this, "Counter", "Determines which and when clicks should be shown." + + "\n" + + "\n§bLeft Clicks:§r Only show left clicks." + + "\n§bRight Clicks:§r Only show right clicks." + + "\n§bBoth:§r Show both left and right clicks." + + "\n§bHigher:§r Shows either left or right clicks depending which has a higher amount.").setValue("Left Clicks").acceptedStringValues("Left Clicks", "Right Clicks", "Both", "Higher").setCustomizationLevel(CustomizationLevel.SIMPLE); + super.getExtraSettings(); + } + + public void getExtraColorSettings() { + this.lineColor = new Setting(this, "Line Color").setValue(0xFF202020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.counterType.getValue().equals("Both")); + } + + private void onClick(ClickEvent event) { + if (event.getMouseButton() == 0) leftCPS.add(System.currentTimeMillis()); + if (event.getMouseButton() == 1) rightCPS.add(System.currentTimeMillis()); + } + + public void render(String value) { + super.render(value); + drawRectWithShadow((this.background.getBooleanValue() ? this.customString : this.customStringNoBackground).getStringValue(), value); + } + + public void drawRectWithShadow(String total, String value) { + float lineXPos = (float) this.mc.fontRendererObj.getStringWidth( + StringUtils.substringBefore(total, "%VALUE%")) + + (float) this.mc.fontRendererObj.getStringWidth(leftClickCounter) + + (this.mc.fontRendererObj.getStringWidth(space) / 2.0F - 0.6F); + + float lineYPos = this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue() ? this.backgroundHeight.getFloatValue() / 2.0F - 4.5F : -1.0F; + boolean shadow = this.background.getBooleanValue() ? this.textShadowBackground.getBooleanValue() : this.textShadowNoBackground.getBooleanValue(); + if (this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()) { + float first = this.width / 2.0F - (float) (this.mc.fontRendererObj.getStringWidth(total.replaceAll("%LABEL%", getLabelString()).replaceAll("%VALUE%", value)) / 2); + lineXPos += first; + } + + if (this.counterType.getValue().equals("Both")) { + RenderUtil.drawRectWithShadow(lineXPos, lineYPos, lineXPos + 1.0F, lineYPos + 9.0F, this.lineColor.getColorValue(), shadow); + } + + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleComboCounter.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleComboCounter.java new file mode 100644 index 0000000..505ced1 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleComboCounter.java @@ -0,0 +1,51 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.combat; + +import com.cheatbreaker.client.module.AbstractModule; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Module - ModuleComboCounter + * @see AbstractModule + * + * This module counts the amount of times you've comboed a player. + */ +public class SimpleModuleComboCounter extends AbstractSimpleCombatHudModule { + public static List hits = new ArrayList<>(); + public static long lastComboTime; + public static int lastAttacked = -1; + public static int lastCombo; + + public SimpleModuleComboCounter() { + super("Combo Counter", "[6 Combo]"); + this.setDescription("Displays how many times you hit someone in a row within 2 seconds."); + this.setCreators("Erouax"); + } + + @Override + public String getValueString() { + if (lastAttackTime != 0L || !(Boolean) this.hideWhenNotAttacking.getValue()) { + return hits.size() + ""; + } + return null; + } + + @Override + public String getLabelString() { + return "Combo"; + } + + public String getWaitingString() { + return "No %LABEL%"; + } + + public String getPreviewString() { + return "6"; + } + + public void clear() { + hits.clear(); + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleFlickTracker.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleFlickTracker.java new file mode 100644 index 0000000..efe4ceb --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleFlickTracker.java @@ -0,0 +1,109 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.combat; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; + +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * @Module - SimpleFlickTrackerModule + * @see AbstractSimpleHudModule + * + * This module shows the amount of distance flicked from the last target hit. + * @using general Pythagorean Therum methods of sine, cosine, and tangent + */ +public class SimpleModuleFlickTracker extends AbstractSimpleHudModule { + private String flickText = "Distance Flicked: %COUNTER%"; + + @Setter + private Long lastHit = 0L; + + @Setter + private double lastHitYaw; + + @Setter + private double lastHitPitch; + + private Setting fadeAmount; + private Setting requiredFlickDistance; + + + @Getter @Setter + private double distance = 0; + + @Getter @Setter + private int counter = 0; + + + public SimpleModuleFlickTracker() { + super("Flick Tracker", "[Distance Flicked: 4.21]", 1.0F, false, false); + this.setDefaultState(false); + this.notRenderHUD = false; + this.setDescription("Shows the amount you flick for each hit"); + + ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); + + service.scheduleAtFixedRate(() -> + { + if (System.currentTimeMillis() - lastHit >= TimeUnit.SECONDS.toMillis(fadeAmount.getIntegerValue())) + { + distance = 0.0; + counter = 0; + } + }, 0L, 1L, TimeUnit.SECONDS); + + } + + @Override + public String getValueString() { + + return counter == 0 ? + flickText.replaceAll("%COUNTER%", "0") : + flickText.replaceAll("%COUNTER%", String.valueOf(distance)); + } + + public String getPreviewString() { + return this.flickText; + } + + @Override + public String getLabelString() { + return "Flick Amount"; + } + + public String customString() { + return "%VALUE%"; + } + + public void getExtraSettings() { + new Setting(this, "label").setValue("Flick Tracker Options"); + fadeAmount = new Setting(this, "Clear Out Time (Seconds)", "Change the amount of time required for value to be cleared").setValue(4).setMinMax(1, 10).setUnit("s").setCustomizationLevel(CustomizationLevel.SIMPLE); + requiredFlickDistance = new Setting(this, "Required Flick Distance", "How large of a flick should be counted").setValue(4).setMinMax(1, 10).setUnit(" distance").setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + public void getExtraFormatSettings() { + + } + + public Double calculate() { + Double yawDifference = Math.abs(lastHitYaw + Minecraft.getMinecraft().thePlayer.cameraYaw); + Double pitchDifference = Math.abs(lastHitPitch - Minecraft.getMinecraft().thePlayer.cameraPitch); + + double hypot = Math.sqrt((pitchDifference * pitchDifference) + (yawDifference * yawDifference)); + + System.out.println(hypot); + + if (hypot > requiredFlickDistance.getIntegerValue()) { + counter++; + } + + return hypot; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleReachDisplay.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleReachDisplay.java new file mode 100644 index 0000000..9959a68 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleReachDisplay.java @@ -0,0 +1,62 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.combat; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Collections; +import java.util.Locale; + +/** + * @Module - ModuleReachDisplay + * @see AbstractModule + * + * This module displays how far you're hitting a player from. + */ +public class SimpleModuleReachDisplay extends AbstractSimpleCombatHudModule { + private Setting trailingZeros; + private Setting decimals; + public static double lastRange; + + public SimpleModuleReachDisplay() { + super("Reach Display", "[2.8 blocks]"); + setDescription("Displays how far you hit an entity."); + setCreators("dewgs"); + } + + public void getExtraFormatSettings() { + this.trailingZeros = new Setting(this, "Show trailing zeros", "Show all trailing zeros.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Integer) this.decimals.getValue() != 0); + this.decimals = new Setting(this, "Decimals", "Change how many decimals the mod should display.").setValue(1).setMinMax(0, 16).setCustomizationLevel(CustomizationLevel.MEDIUM); + super.getExtraFormatSettings(); + } + + @Override + public String getValueString() { + if (lastAttackTime != 0L || !(Boolean) this.hideWhenNotAttacking.getValue()) { + return (Boolean) trailingZeros.getValue() ? String.format("%." + decimals.getValue() + "f", lastRange) : new DecimalFormat("#." + String.join("", Collections.nCopies((Integer) decimals.getValue(), "#")), new DecimalFormatSymbols(Locale.ENGLISH)).format(lastRange); + } + return null; + } + + @Override + public String getLabelString() { + return "blocks"; + } + + public String getPreviewString() { + double value = 2.78003410578201503; + return (Boolean) trailingZeros.getValue() ? String.format("%." + decimals.getValue() + "f", value) : new DecimalFormat("#." + String.join("", Collections.nCopies((Integer) decimals.getValue(), "#")), new DecimalFormatSymbols(Locale.ENGLISH)).format(value); + } + + @Override + public boolean includeIcon() { + return false; + } + + public void clear() { + lastRange = 0.0; + } + +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleSprintResetCounter.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleSprintResetCounter.java new file mode 100644 index 0000000..2a7ae09 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/combat/SimpleModuleSprintResetCounter.java @@ -0,0 +1,112 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.combat; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.inventory.GuiContainer; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Module - ModuleReachDisplay + * @see AbstractModule + * + * This module displays all sorts of reset counts for anything related to sprinting. + */ +public class SimpleModuleSprintResetCounter extends AbstractSimpleCombatHudModule { + public static List temphits = new ArrayList<>(); + public static List wTaps = new ArrayList<>(); + public static List sTaps = new ArrayList<>(); + public static long lastTapTime; + public static long lastComboTime; + public static int lastAttacked = -1; + public static int lastCombo; + private boolean pressed; + private boolean almostw; + private int keyCode; + + private Setting counterType; + private int counter; + + public SimpleModuleSprintResetCounter() { + super("Sprint Reset Counter", "[4 WTaps]"); + this.setDescription("Displays the amount of times you sprint reset."); + this.setCreators("AgentManny"); + } + + @Override + public String getValueString() { + d(); + if (lastAttackTime != 0L || !(Boolean) hideWhenNotAttacking.getValue()) { + counter = counterType.getValue().equals("Forward") ? wTaps.size() : sTaps.size(); + return counterType.getValue().equals("Higher") ? (counter = Math.max(wTaps.size(), sTaps.size())) + "" : counter + ""; +// return wTaps.size() + ""; + } + return null; + } + + @Override + public String getLabelString() { + int name = this.keyCode; + if (counterType.getValue().equals("Higher")) { + if (sTaps.size() > wTaps.size()) { + name = this.mc.gameSettings.keyBindBack.getKeyCode(); + } else { + name = this.mc.gameSettings.keyBindForward.getKeyCode(); + } + } + return "" + Keyboard.getKeyName(name) + "Tap" + (counter != 1 ? "s" : ""); + } + + public String getPreviewString() { + return "4"; + } + + public void getExtraSettings() { + this.counterType = new Setting(this, "Counter").setValue("Forward").acceptedStringValues("Forward", "Backwards", "Higher"); + this.hideWhenNotAttacking = new Setting(this, "Hide When Not Attacking").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + public void d() { + int forwardKeyCode = this.mc.gameSettings.keyBindForward.getKeyCode(); + int backKeyCode = this.mc.gameSettings.keyBindBack.getKeyCode(); + this.keyCode = counterType.getValue().equals("Forward") ? forwardKeyCode : backKeyCode; + int button = (forwardKeyCode == -99 || forwardKeyCode == -100) ? ((forwardKeyCode == -99) ? 0 : 1) : -1; + int button2 = (backKeyCode == -99 || backKeyCode == -100) ? ((backKeyCode == -99) ? 0 : 1) : -1; + boolean wpressed = (mc.currentScreen == null || mc.currentScreen instanceof GuiContainer || mc.currentScreen instanceof HudLayoutEditorGui) && ((button != -1) ? Mouse.isButtonDown(button) : Keyboard.isKeyDown(forwardKeyCode)); + boolean spressed = (mc.currentScreen == null || mc.currentScreen instanceof GuiContainer || mc.currentScreen instanceof HudLayoutEditorGui) && ((button2 != -1) ? Mouse.isButtonDown(button2) : Keyboard.isKeyDown(backKeyCode)); + if (mc.gameSettings.keyBindForward.isKeyDown() && mc.thePlayer.isSprinting() && temphits.size() > 0) { + if (spressed) { + sTaps.add(System.currentTimeMillis()); + temphits.clear(); + return; + } + if (wpressed && !this.pressed) { + this.pressed = true; + + if (this.almostw) wTaps.add(System.currentTimeMillis()); + this.almostw = false; + lastTapTime = System.currentTimeMillis(); + temphits.clear(); + } else if (this.pressed && !wpressed) { + this.pressed = false; + this.almostw = true; + } + } + + if (System.currentTimeMillis() - lastAttackTime > 2000L) { + lastAttackTime = 0L; + clear(); + } + } + + public void clear() { + lastTapTime = 0L; + wTaps.clear(); + sTaps.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleClock.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleClock.java new file mode 100644 index 0000000..17da087 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleClock.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @Module - ModuleClock + * @see AbstractSimpleHudModule + * + * This module shows the current time. + */ +public class SimpleModuleClock extends AbstractSimpleHudModule { + private Setting militaryFormat; + private Setting meridiem; + private Setting seconds; + + public SimpleModuleClock() { + super("Clock", "[11:11 AM]"); + setDescription("Displays your current time."); + } + + @Override + public String getValueString() { + return new SimpleDateFormat((!(Boolean) militaryFormat.getValue() ? "h" : "HH") + + ":mm" + ((Boolean) seconds.getValue() ? ":ss" : "") + + ((Boolean) meridiem.getValue() ? !(Boolean) militaryFormat.getValue() ? " a" : "" : "")).format(new Date()); + } + + @Override + public String getLabelString() { + return "Time"; + } + + public String customString() { + return "%VALUE%"; + } + + public void getExtraFormatSettings() { + this.militaryFormat = new Setting(this, "24 hour/military time", "Show the clock time in military time format.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.meridiem = new Setting(this, "Show AM/PM", "Show the AM/PM marker.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !(Boolean) this.militaryFormat.getValue()); + this.seconds = new Setting(this, "Show seconds", "Displays the seconds.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleFPS.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleFPS.java new file mode 100644 index 0000000..e559e42 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleFPS.java @@ -0,0 +1,30 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import net.minecraft.client.Minecraft; + +/** + * @Module - ModuleFPS + * @see AbstractSimpleHudModule + * + * This module shows the current frames per second you're getting within Minecraft. + * + * NOTE: We still use Minecraft.debugFPS for this, consider making it all in one central integer. + */ +public class SimpleModuleFPS extends AbstractSimpleHudModule { + + public SimpleModuleFPS() { + super("FPS", "[144 FPS]"); + setDescription("Displays your frames per second."); + } + + @Override + public String getValueString() { + return "" + Minecraft.debugFPS; + } + + @Override + public String getLabelString() { + return "FPS"; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleHearingAssistance.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleHearingAssistance.java new file mode 100644 index 0000000..e10f563 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleHearingAssistance.java @@ -0,0 +1,83 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import lombok.Setter; +import net.minecraft.MinecraftMovementInputHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.GuardianSound; +import net.minecraft.client.audio.ITickableSound; + +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * @Module - ModuleHearingAssistance + * @see AbstractSimpleHudModule + * + * This module shows sounds for hearing-impaired users or users to understnad what sounds are playing + * This module had too many features to be implemented as a setting + */ +public class SimpleModuleHearingAssistance extends AbstractSimpleHudModule { + private String soundText = "Current Sound: %SOUND%"; + + @Setter + private Long lastUpdated = 0L; + + private Setting fadeAmount; + + @Setter + private String currentSound = null; + + + public SimpleModuleHearingAssistance() { + super("Hearing Assistance", "[Current Sound: Footsteps]", 1.0F, false, false); + this.setDefaultState(false); + this.notRenderHUD = false; + this.setDescription("Shows the current sound playing on your Minecraft client"); + + ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); + + service.scheduleAtFixedRate(() -> + { + if (System.currentTimeMillis() - lastUpdated >= TimeUnit.SECONDS.toMillis(fadeAmount.getIntegerValue())) + { + currentSound = null; + } + }, 0L, 1L, TimeUnit.SECONDS); + + } + + @Override + public String getValueString() { + + return currentSound == null ? + soundText.replaceAll("%SOUND%", "None") : + soundText.replaceAll("%SOUND%", currentSound); + } + + public String getPreviewString() { + return this.soundText; + } + + @Override + public String getLabelString() { + return "Current Sound"; + } + + public String customString() { + return "%VALUE%"; + } + + public void getExtraSettings() { + new Setting(this, "label").setValue("Hearing Assistance Options"); + fadeAmount = new Setting(this, "Clear Out Time (Seconds)", "Change the amount of time required for sound to be cleared").setValue(4).setMinMax(1, 10).setUnit("s").setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + public void getExtraFormatSettings() { + + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleMemoryUsage.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleMemoryUsage.java new file mode 100644 index 0000000..5b6cfd7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleMemoryUsage.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; + +/** + * @Module - ModuleMemoryUsage + * @see AbstractSimpleHudModule + * + * This module shows how much memory is being used by the game. + */ +public class SimpleModuleMemoryUsage extends AbstractSimpleHudModule { + + public SimpleModuleMemoryUsage() { + super("Memory Usage", "[Mem: 19%]"); + setDescription("Displays how much memory the game is using."); + } + + public String getValueString() { + return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) * 100L / Runtime.getRuntime().maxMemory() + "%"; + } + + public String getLabelString() { + return "Mem"; + } + + public String customString() { + return "%LABEL%: %VALUE%"; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePackDisplay.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePackDisplay.java new file mode 100644 index 0000000..e3c41d0 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePackDisplay.java @@ -0,0 +1,129 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +import java.util.regex.Pattern; + +/** + * @Module - ModulePackDisplay + * @see AbstractSimpleHudModule + * + * This module shows the top Resource Pack you're currently using in-game. + */ +public class SimpleModulePackDisplay extends AbstractSimpleHudModule { +// private Setting description; TODO: Set up Pack Display to show the description + private Setting zipRemover; + private Setting prefixRemover; + private Setting stripColorCodes; + + private Setting order; + private Setting rotationOrder; + private Setting rotationInterval; + + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-9A-F]"); + private final Pattern STRIP_COLOR_PATTERN2 = Pattern.compile("(?i)" + '§' + "[1-69A-E]"); + + private int ticks = 0; + private int currentPack = 0; + + + public SimpleModulePackDisplay() { + super("Pack Display", "Default"); + this.setDescription("Displays the active Resource Pack."); + this.setCreators("canelex"); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent event) { + ++this.ticks; + if (this.order.getValue().equals("Rotate")) { + if (this.ticks > this.rotationInterval.getFloatValue() * 20) { + int max = Config.getResourcePackNames().split(",").length - 1; + switch (this.rotationOrder.getStringValue()) { + case "Top-Bottom": + --this.currentPack; + if (this.currentPack < 0) { + this.currentPack = max; + } + break; + case "Bottom-Top": + ++this.currentPack; + if (this.currentPack > max) { + this.currentPack = 0; + } + break; + case "Randomized": + this.currentPack = (int)(Math.random() * (max + 1)); + } + + this.ticks = 0; + } + } + } + + @Override + public String getValueString() { + String[] packs = Config.getResourcePackNames().split(","); + String counter = packs[packs.length - 1]; + if (this.order.getValue().equals("Bottom")) { + counter = packs[0]; + } else if (this.order.getValue().equals("Rotate")) { + counter = packs[this.currentPack]; + } + if (this.zipRemover.getBooleanValue()) { + counter = counter.replace(".zip", ""); + } + if (this.prefixRemover.getBooleanValue()) { + counter = counter.substring(counter.indexOf("!") + 1).substring(counter.indexOf("#") + 1).trim(); + if (counter.substring(0, 1).contains("§") && counter.substring(2, 3).contains(" ")) { + counter = counter.replaceFirst(" ", ""); + } + + } + return !this.stripColorCodes.getValue().equals("OFF") ? stripColor(counter) : counter; + } + + @Override + public String getLabelString() { + return "Pack"; + } + + public String customString() { + return "%VALUE%"; + } + + public boolean includeIcon() { + return true; + } + + public boolean showBrackets() { + return false; + } + + public ResourceLocation getIconTexture() { + return CheatBreaker.packIconTexture; + } + + private String stripColor(String input) { + return input == null ? null : (this.stripColorCodes.getValue().equals("ALL") ? STRIP_COLOR_PATTERN : STRIP_COLOR_PATTERN2).matcher(input).replaceAll("§r"); + } + + public void getExtraSettings() { + this.order = new Setting(this, "Pack Order").setValue("Bottom").acceptedStringValues("Bottom", "Top", /*"All", */"Rotate").setCondition(() -> Config.getResourcePackNames().split(",").length != 1); + this.rotationOrder = new Setting(this, "Rotation Order").setValue("Top-Bottom").acceptedStringValues("Top-Bottom", "Bottom-Top", "Randomized").setCondition(() -> this.order.getValue().equals("Rotate") && Config.getResourcePackNames().split(",").length != 1); + this.rotationInterval = new Setting(this, "Rotation Interval").setValue(10.0F).setMinMax(1.0F, 60.0F).setUnit("s").setCondition(() -> this.order.getValue().equals("Rotate") && Config.getResourcePackNames().split(",").length != 1); + } + + public void getExtraFormatSettings() { + // this.description = new Setting(this, "Show description").setValue(true); + this.zipRemover = new Setting(this, "Remove zip string", "Removes the \".zip\" part of a pack name if the file is in a zip.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.prefixRemover = new Setting(this, "Remove prefixes", "Removes ! and # prefixes from a pack.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.stripColorCodes = new Setting(this, "Strip Color Formatting", "Remove all color formatting so you can set your own color.").setValue("OFF").acceptedStringValues("OFF", "Not Neutral", "ALL").setCustomizationLevel(CustomizationLevel.MEDIUM); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePing.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePing.java new file mode 100644 index 0000000..4c3a47c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePing.java @@ -0,0 +1,105 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.network.OldServerPinger; + +import java.awt.*; +import java.net.UnknownHostException; +import java.util.concurrent.TimeUnit; + +/** + * @Module - ModulePing + * @see AbstractSimpleHudModule + * + * This module shows the current ping to the current server you're on. + */ +public class SimpleModulePing extends AbstractSimpleHudModule { + private final OldServerPinger checkPing = new OldServerPinger(); + + private Setting refresher; + private Setting badPingRange; + private Setting hideInSingleplayer; + private Setting hideIfNoConnection; + public Setting dynamicColorRange; + + private long getPing; + private long pingNumber = -1L; + + public SimpleModulePing() { + super("Ping", "[19 ms]"); + setDescription("Displays your server latency."); + } + + @Override + public String getValueString() { + ServerData pingVar = mc.getCurrentServerData(); + this.getPing(pingVar); + if (pingVar != null && pingVar.pingToServer > 0L) { + this.pingNumber = pingVar.pingToServer; + } + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null || !(Boolean) this.hideInSingleplayer.getValue()) { + if (this.pingNumber != -1L || !(Boolean) this.hideIfNoConnection.getValue()) { + return this.pingNumber + " ms"; + } + } + return null; + } + + public String getPreviewString() { + return "119 ms"; + } + + @Override + public String getLabelString() { + return "Ping"; + } + + public String customString() { + return "%VALUE%"; + } + + public boolean includeIcon() { + return false; + } + + public int getColor() { + if ((Boolean) this.dynamicColorRange.getValue()) { + if (getValueString() != null) { + return Color.getHSBColor(Math.max((125.0F - pingNumber * 10.0F / (float) this.badPingRange.getValue()) / 360.0F, 0.0F), 1.0F, 1.0F).getRGB(); + } else { + return Color.getHSBColor(Math.max((125.0F - 119 * 10.0F / (float) this.badPingRange.getValue()) / 360.0F, 0.0F), 1.0F, 1.0F).getRGB(); + } + + } + return this.textColor.getColorValue(); + } + + public void getExtraSettings() { + this.refresher = new Setting(this, "Refresh Time", "Changes how many seconds the mod should refresh itself.").setUnit("s").setValue(15).setMinMax(10, 90).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.hideInSingleplayer = new Setting(this, "Hide in Singleplayer", "Hid the mod in Singleplayer.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.hideIfNoConnection = new Setting(this, "Hide if no connection", "Hide the mod when no connection is found.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.dynamicColorRange = new Setting(this, "Dynamic Color Range", "Determine if the text color should change dynamically based on ping amount.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.badPingRange = new Setting(this, "Bad Ping Range Threshold").setValue(25.0F).setMinMax(10.0F, 100.0F).setCondition(() -> (Boolean) this.dynamicColorRange.getValue()); + } + + private void getPing(ServerData var1) { + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null) { + if (var1 != null && System.currentTimeMillis() - this.getPing >= TimeUnit.SECONDS.toMillis((long) (Integer) this.refresher.getValue())) { + (new Thread(() -> { + try { + this.checkPing.ping(var1); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + })).start(); + this.getPing = System.currentTimeMillis(); + } + } else { + this.pingNumber = -1; + } + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePotionCounter.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePotionCounter.java new file mode 100644 index 0000000..a6ae496 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModulePotionCounter.java @@ -0,0 +1,64 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemSoup; + +import java.util.Arrays; +import java.util.Objects; + +/** + * @Module - ModulePotionCounter + * @see AbstractSimpleHudModule + * + * This module shows how many health potions/bowls of soup you have in your inventory. + */ +public class SimpleModulePotionCounter extends AbstractSimpleHudModule { + private Setting counter; + private Setting hideWhenEmpty; + private Setting hideWhenSpecificAmount; + private Setting exceedingAmount; + + public SimpleModulePotionCounter() { + super("Potion Counter", "[10 Pots]"); + setDescription("Displays the amount of healing potions or soups in your inventory."); + setCreators("Maxwell"); + } + + @Override + public String getValueString() { + if ((this.getItemFromPlayersInventory() != 0 || !(Boolean) hideWhenEmpty.getValue()) && !((Boolean) hideWhenSpecificAmount.getValue() && this.getItemFromPlayersInventory() > (Integer) exceedingAmount.getValue())) { + return "" + this.getItemFromPlayersInventory(); + } + return null; + } + + public String getPreviewString() { + return "10"; + } + + @Override + public String getLabelString() { + return "" + (this.getItemFromPlayersInventory() == 1 ? this.counter.getValue().toString().replaceAll("s", "") : this.counter.getValue().toString()); + } + + public void getExtraSettings() { + this.counter = new Setting(this, "Counter", "Count Healing potions or Soup.").setValue("Pots").acceptedStringValues("Pots", "Soup").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideWhenEmpty = new Setting(this, "Hide When Empty", "Hide the mod when there are none of the selected counter item in your inventory.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.hideWhenSpecificAmount = new Setting(this, "Hide When Above Specific Amount", "Hide the mod when there are more of the selected item than the set exceeded amount.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.exceedingAmount = new Setting(this, "Exceeded Amount", "Determine the maximum amount of the selected item should show before the mod is hidden.").setValue(10).setMinMax(0, 29).setUnit(" items").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.hideWhenSpecificAmount.getValue()); + } + + private int getItemFromPlayersInventory() { + EntityPlayer player = mc.thePlayer; + if (this.counter.getValue().equals("Pots")) { + return (int) Arrays.stream(player.inventory.mainInventory).filter(Objects::nonNull).filter(item -> item.getItem() instanceof ItemPotion).filter(item -> item.getItemDamage() == 16421 | item.getItemDamage() == 16453).count(); + } else { + return (int) Arrays.stream(player.inventory.mainInventory).filter(Objects::nonNull).filter(item -> item.getItem() instanceof ItemSoup).count(); + } + + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleSaturation.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleSaturation.java new file mode 100644 index 0000000..7fcb3df --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleSaturation.java @@ -0,0 +1,119 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.SimpleHudModSize; +import com.cheatbreaker.client.ui.module.GuiAnchor; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Collections; +import java.util.Locale; + +/** + * @Module - ModuleSaturation + * @see AbstractSimpleHudModule + * + * This module shows the current Saturation level of the player. + */ +public class SimpleModuleSaturation extends AbstractSimpleHudModule { + public Setting amountColors; + private Setting highestAmountColor; + private Setting highAmountColor; + private Setting mediumAmountColor; + private Setting lowAmountColor; + private Setting emptyAmountColor; + private Setting hideinCM; + private Setting hideExceedingNumbers; + private Setting exceedingThreshold; + private Setting trailingZeros; + private Setting decimals; + + public SimpleModuleSaturation() { + super("Saturation"); + this.setDescription("Displays your current food saturation level."); + this.setCreators("Eum3"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_BOTTOM_RIGHT); + this.setDefaultTranslations(-15.0F, -35.0F); + } + + public String level() { + double saturationLevel = mc.thePlayer.getFoodStats().getSaturationLevel(); + int dec = (Integer) decimals.getValue(); + String number = String.join("", Collections.nCopies(dec, "#")); + return !(Boolean) trailingZeros.getValue() && dec != 0 ? + new DecimalFormat("#." + number, new DecimalFormatSymbols(Locale.ENGLISH)).format(saturationLevel) : + String.format("%." + dec + "f", saturationLevel); + } + + @Override + public String getValueString() { + boolean creativeModeCheck = mc.playerController.isNotCreative() || !(Boolean) hideinCM.getValue(); + boolean exceedingCheck = !(Boolean) hideExceedingNumbers.getValue() || mc.thePlayer.getFoodStats().getSaturationLevel() < (Integer) exceedingThreshold.getValue(); + if (creativeModeCheck && exceedingCheck) { + return level(); + } + return null; + } + + public String getPreviewString() { + return level(); + } + + @Override + public String getLabelString() { + return "Saturation"; + } + + public String customString() { + return "%VALUE%"; + } + + public boolean showBrackets() { + return false; + } + + public int getColor() { + double saturationLevel = mc.thePlayer.getFoodStats().getSaturationLevel(); + if ((Boolean) amountColors.getValue()) { + if (saturationLevel <= 0) { + return emptyAmountColor.getColorValue(); + } else if (saturationLevel <= 5) { + return lowAmountColor.getColorValue(); + } else if (saturationLevel <= 10) { + return mediumAmountColor.getColorValue(); + } else if (saturationLevel <= 15) { + return highAmountColor.getColorValue(); + } + return highestAmountColor.getColorValue(); + } + return textColor.getColorValue(); + } + + public void getExtraSettings() { + this.hideinCM = new Setting(this, "Hide in Creative Mode", "Hide the mod in Creative mode.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.hideExceedingNumbers = new Setting(this, "Hide exceeding levels", "Hide the mod when the current saturation level exceeds the set amount.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.exceedingThreshold = new Setting(this, "Exceeding amount", "Determine the maximum value of saturation levels should show before it is hidden.").setValue(20).setMinMax(0, 20).setUnit(" levels").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.hideExceedingNumbers.getValue()); + this.amountColors = new Setting(this, "Color Based on Amount", "Make the text color be based off the amount of saturation levels you have.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } + + public void getExtraFormatSettings() { + this.trailingZeros = new Setting(this, "Show trailing zeros", "Show all trailing zeros.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Integer) this.decimals.getValue() != 0); + this.decimals = new Setting(this, "Decimals", "Change how many decimals the mod should display.").setValue(0).setMinMax(0, 17).setCustomizationLevel(CustomizationLevel.MEDIUM); + } + + public void getExtraColorSettings() { + this.highestAmountColor = new Setting(this, "Highest Amount Color", "The text color that will show when the saturation level is over 15.").setValue(-2097185).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.highAmountColor = new Setting(this, "High Amount Color", "The text color that will show when the saturation level is between 11-15.").setValue(-4522079).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.mediumAmountColor = new Setting(this, "Medium Amount Color", "The text color that will show when the saturation level is between 6-10.").setValue(-103).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.lowAmountColor = new Setting(this, "Low Amount Color", "The text color that will show when the saturation level is between 1-5.").setValue(-48574).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.emptyAmountColor = new Setting(this, "Empty Amount Color", "The text color that will show when the saturation level is empty.").setValue(-5627615).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + } + + @Override + public SimpleHudModSize backgroundDimensionValues() { + return new SimpleHudModSize(10, 18, 24, 18, 30, 80); + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleServerAddress.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleServerAddress.java new file mode 100644 index 0000000..585c00e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleServerAddress.java @@ -0,0 +1,71 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +/** + * @Module - ModuleServerAddress + * @see AbstractSimpleHudModule + * + * This module shows information about the current server you're on. + */ +public class SimpleModuleServerAddress extends AbstractSimpleHudModule { + private Setting hideinSingleplayer; + + public SimpleModuleServerAddress() { + super("Server Address", "[minehq.com]"); + setDescription("Displays the server you are connected to."); + } + + + @Override + public String getValueString() { + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null) { + return mc.currentServerData.serverIP; + } else if (!(Boolean) hideinSingleplayer.getValue()) { + return "Singleplayer"; + } + return null; + } + + public String getPreviewString() { + if (!mc.isSingleplayer()) { + return mc.currentServerData.serverIP; + } + return "minehq.com"; + } + + @Override + public String getLabelString() { + return "IP"; + } + + public String customString() { + return "%VALUE%"; + } + + public boolean includeIcon() { + return true; + } + + public ResourceLocation getIconTexture() { + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null) { + return new ResourceLocation("servers/" + getValueString() + "/icon"); + } else if (!(Boolean) hideinSingleplayer.getValue()) { + if (Config.MC_VERSION.equals("1.7.10")) { + return new ResourceLocation("textures/misc/unknown_pack.png"); + } else { + return new ResourceLocation("textures/misc/unknown_server.png"); + } + } + return new ResourceLocation("client/icons/servers/" + getPreviewString() + ".png"); + } + + public void getExtraSettings() { + this.hideinSingleplayer = new Setting(this, "Hide in Singleplayer", "Hides the mod in Singleplayer.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleToggleSprint.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleToggleSprint.java new file mode 100644 index 0000000..abde2f4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/module/SimpleModuleToggleSprint.java @@ -0,0 +1,91 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.module; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import net.minecraft.MinecraftMovementInputHelper; + +/** + * @Module - ModuleToggleSprint + * @see AbstractSimpleHudModule + * + * This module toggles sprinting and sneaking. + * + * @implNote This module is the first module to ever implement custom strings. + */ +public class SimpleModuleToggleSprint extends AbstractSimpleHudModule { + public static Setting toggleSprint; + public static Setting toggleSneak; + private Setting textColor; + public static Setting doubleTap; + public static Setting flyBoost; + + private Setting flyBoostLabel; + public static Setting flyBoostAmount; + public Setting flyBoostString; + public Setting flyString; + public Setting ridingString; + public Setting decendString; + public Setting dismountString; + public Setting sneakHeldString; + public Setting sprintHeldString; + public Setting sprintVanillaString; + public Setting sprintToggledString; + public Setting sneakToggledString; + + public static boolean buggedSprint = false; + + public SimpleModuleToggleSprint() { + super("ToggleSprint", "[Sprinting (Toggled)]", 1.0F, false, false); + this.setDefaultState(false); + this.notRenderHUD = false; + this.setDescription("Makes your sprint and sneak keys toggleable."); + this.setCreators("deeznueces"); + this.setAliases("ToggleSneak"); + } + + @Override + public String getValueString() { + if (!MinecraftMovementInputHelper.toggleSprintString.isEmpty()) { + return MinecraftMovementInputHelper.toggleSprintString; + } + return null; + } + + public String getPreviewString() { + return this.sprintToggledString.getValue().toString(); + } + + @Override + public String getLabelString() { + return "Sprint Status"; + } + + public String customString() { + return "%VALUE%"; + } + + public void getExtraSettings() { + new Setting(this, "label").setValue("Toggle Sprint/Sneak Options"); + toggleSprint = new Setting(this, "Toggle Sprint", "Makes sprinting toggleable instead of held down.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + toggleSneak = new Setting(this, "Toggle Sneak", "Makes sneaking toggleable instead of held down.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + doubleTap = new Setting(this, "Double Tap", "Determine if double tapping the moving forward key should make the player start sprinting.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.flyBoostLabel = new Setting(this, "label").setValue("Fly Boost"); + flyBoost = new Setting(this, "Fly Boost", "Determine if pressing the sprint key should boost the fly speed.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + flyBoostAmount = new Setting(this, "Fly Boost Amount", "Change the boost amount.").setValue(4.0F).setMinMax(1.0F, 10.0F).setUnit("x").setCondition(() -> (Boolean) flyBoost.getValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + public void getExtraFormatSettings() { + this.flyBoostString = new Setting(this, "Fly Boost String").setValue("Flying (%BOOST%x boost)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.flyString = new Setting(this, "Fly String").setValue("Flying").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.ridingString = new Setting(this, "Riding String").setValue("Riding").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.decendString = new Setting(this, "Descend String").setValue("Descending").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.dismountString = new Setting(this, "Dismount String").setValue("Dismounting").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sneakHeldString = new Setting(this, "Sneaking String").setValue("Sneaking (Key Held)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sprintHeldString = new Setting(this, "Sprinting Held String").setValue("Sprinting (Key Held)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sprintVanillaString = new Setting(this, "Sprinting Vanilla String").setValue("Sprinting (Vanilla)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sprintToggledString = new Setting(this, "Sprinting Toggle String").setValue("Sprinting (Toggled)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sneakToggledString = new Setting(this, "Sneaking Toggle String").setValue("Sneaking (Toggled)").setCustomizationLevel(CustomizationLevel.ADVANCED); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/AutoTipThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/AutoTipThread.java new file mode 100644 index 0000000..d25f914 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/AutoTipThread.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.module.impl.normal.hypixel; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; + +import java.util.TimerTask; + +public class AutoTipThread extends TimerTask { + @Override + public void run() { + CheatBreaker cb = CheatBreaker.getInstance(); + if (cb == null || cb.getModuleManager() == null && Minecraft.getMinecraft().thePlayer == null) return; + + if (cb.getModuleManager().hypixelMod.isEnabled() && cb.getModuleManager().hypixelMod.autoTip.getBooleanValue() && Minecraft.getMinecraft().getCurrentServerData() != null) { + if (Minecraft.getMinecraft().getCurrentServerData().serverIP.toLowerCase().contains("hypixel")) { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/tip all"); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/CollectionModuleHypixel.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/CollectionModuleHypixel.java new file mode 100644 index 0000000..e321866 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/CollectionModuleHypixel.java @@ -0,0 +1,165 @@ +package com.cheatbreaker.client.module.impl.normal.hypixel; + +import com.cheatbreaker.client.event.impl.chat.ChatReceivedEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class CollectionModuleHypixel extends AbstractModule { + public final Setting autoCommandsOptionsLabel; + public final Setting autoTip; + public final Setting autoFriend; + public final Setting autoFriendMode; + public final Setting autoFriendDelay; + + public final Setting autoChatOptionsLabel; + public final Setting autoGG; + public final Setting autoGGMessage; + public final Setting autoGGDelay; + public final Setting autoGL; + public final Setting autoGLMessage; + public final Setting autoGLDelay; + public final Setting autoWB; + public final Setting autoWBFriends; + public final Setting autoWBGuildMembers; + public final Setting autoWBMessage; + public final Setting autoWBDelay; + + public final Setting chatFilterOptionsLabel; + public final Setting antiGG; + public final Setting antiGL; + + public final Setting bedWarsOptionsLabel; + public final Setting bedwarsHardcoreHearts; + + /** + * Trigger lists and patterns + */ + private List autoGGTriggerList = new ArrayList<>(); + private final Pattern friendRequestTriggerPattern = Pattern.compile("§m----------------------------------------------------Friend request from (?.+)\\[ACCEPT\\] - \\[DENY\\] - \\[IGNORE\\].*"); + private final Pattern bedLossPattern = Pattern.compile("BED DESTRUCTION > Your Bed .*"); + private final String[] gameOverStrings = new String[]{"You have been eliminated!", "Reward Summary"}; + + + private final Pattern guildJoinedTriggerPattern = Pattern.compile("Guild > (?.+) joined\\..*"); + private final Pattern friendJoinedTriggerPattern = Pattern.compile("Friend > (?.+) joined\\..*"); + + public CollectionModuleHypixel() { + super("Hypixel Collection"); + this.setDefaultState(false); + this.autoCommandsOptionsLabel = new Setting(this, "label").setValue("Auto Command Options"); + this.autoTip = new Setting(this, "Auto Tip").setValue(false); + + this.autoFriend = new Setting(this, "Auto Friend").setValue(false); + this.autoFriendMode = new Setting(this, "Auto Friend Mode").setValue("Accept").acceptedStringValues("Accept", "Deny", "Ignore"); + this.autoFriendDelay = new Setting(this, "Auto Friend Delay").setUnit("s").setValue(0.0F).setMinMax(0.0F, 15.0F).setCondition(this.autoFriend::getBooleanValue); + + this.autoChatOptionsLabel = new Setting(this, "label").setValue("Auto Chat Options"); + this.autoGG = new Setting(this, "Auto GG").setValue(false); + this.autoGGDelay = new Setting(this, "Send GG Message Delay").setUnit("s").setValue(0.0F).setMinMax(0.0F, 5.0F).setCondition(this.autoGG::getBooleanValue); + this.autoGGMessage = new Setting(this, "Auto GG String").setValue("gg").setCondition(this.autoGG::getBooleanValue).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.autoGL = new Setting(this, "Auto GL").setValue(false); + this.autoGLDelay = new Setting(this, "Send GL Message Delay").setUnit("s").setValue(0.0F).setMinMax(0.0F, 15.0F).setCondition(this.autoGL::getBooleanValue); + this.autoGLMessage = new Setting(this, "Auto GL String").setValue("gl").setCondition(this.autoGL::getBooleanValue).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.autoWB = new Setting(this, "Auto WB").setValue(false); + this.autoWBFriends = new Setting(this, "Welcome Back Friends").setValue(true).setCondition(this.autoWB::getBooleanValue); + this.autoWBGuildMembers = new Setting(this, "Welcome Back Guild Members").setValue(true).setCondition(this.autoWB::getBooleanValue); + this.autoWBDelay = new Setting(this, "Send WB Message Delay").setUnit("s").setValue(2.0F).setMinMax(2.0F, 15.0F).setCondition(this.autoWB::getBooleanValue); + this.autoWBMessage = new Setting(this, "Auto WB String").setValue("Welcome back %USER%!").setCondition(this.autoWB::getBooleanValue).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.chatFilterOptionsLabel = new Setting(this, "label").setValue("Chat Filter Options"); + this.antiGG = new Setting(this, "Hide GG").setValue(false); + this.antiGL = new Setting(this, "Hide GL").setValue(false); + + this.bedWarsOptionsLabel = new Setting(this, "label").setValue("Bed Wars Options"); + this.bedwarsHardcoreHearts = new Setting(this, "Hardcore Hearts", "Changes your hearts to show hardcore hearts when you lose your own bed.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.setPreviewIcon(new ResourceLocation("client/icons/mods/hypixel.png"), 21, 40); + this.setDescription("A collection of mods made for the Hypixel Network."); + this.setCreators("2Pi (Auto GG, Auto Friend, Auto Tip)", "Sk1er (Auto GL, Hardcore Hearts)", "Maximusbarcz (Auto WB)"); + this.addEvent(ChatReceivedEvent.class, this::onReceivedChatEvent); + this.setupTriggerList(); + } + + + /** + * Sets up 2PI's Auto GG trigger list. + */ + private void setupTriggerList() { + new Thread(() -> { + try { + String ggTriggerList = IOUtils.toString(new URL("https://gist.githubusercontent.com/minemanpi/72c38b0023f5062a5f3eba02a5132603/raw/triggers.txt")); + this.autoGGTriggerList = new ArrayList<>(Arrays.asList(ggTriggerList.split("\n"))); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + }).start(); + } + + public void onReceivedChatEvent(ChatReceivedEvent event) { + Matcher matcher; + String message = event.getReceivedChatMessage(); + + if (this.mc.getCurrentServerData() != null && this.mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel")) { + + if (message.contains(gameOverStrings[0]) || message.contains(gameOverStrings[1])) { + Minecraft.getMinecraft().thePlayer.worldObj.getWorldInfo().setHardcore(false); + } + + if (this.bedwarsHardcoreHearts.getBooleanValue() && this.bedLossPattern.matcher(message).matches()) { + this.mc.thePlayer.worldObj.getWorldInfo().setHardcore(true); + } + + if (this.autoGG.getBooleanValue() && this.autoGGTriggerList.stream().anyMatch(message::contains)) { + this.sendMessage("/achat " + this.autoGGMessage.getStringValue(), this.autoGGDelay.getFloatValue()); + } + + if (this.autoGL.getBooleanValue() && message.startsWith("The game starts in 5 seconds!")) { + this.sendMessage("/achat " + this.autoGLMessage.getStringValue(), this.autoGLDelay.getFloatValue()); + } + + if (this.autoWB.getBooleanValue() && this.autoWBGuildMembers.getBooleanValue() && (matcher = this.guildJoinedTriggerPattern.matcher(message)).matches()) { + String name = matcher.group("name"); + this.sendMessage("/gc " + this.autoWBMessage.getStringValue().replaceAll("%USER%", name), this.autoWBDelay.getFloatValue()); + } + + if (this.autoWB.getBooleanValue() && this.autoWBFriends.getBooleanValue() && (matcher = this.friendJoinedTriggerPattern.matcher(message)).matches()) { + String name = matcher.group("name"); + this.sendMessage("/msg " + name + " " + this.autoWBMessage.getStringValue().replaceAll("%USER%", name), this.autoWBDelay.getFloatValue()); + } + + if (this.autoFriend.getBooleanValue() && (matcher = this.friendRequestTriggerPattern.matcher(message.replace("\n", ""))).matches()) { + String name = matcher.group("name"); + // Removes any rank prefix. + if (name.startsWith("[")) name = name.substring(name.indexOf("] ") + 2); + this.sendMessage("/friend " + this.autoFriendMode.getStringValue().toLowerCase() + " " + name, this.autoFriendDelay.getFloatValue()); + } + } + } + + /** + * Sends the set chat message with a set delay. + */ + public void sendMessage(String message, float delay) { + new Thread(() -> { + try { + Thread.sleep((long) delay * 1000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + this.mc.thePlayer.sendChatMessage(message); + }).start(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/ModuleNickHider.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/ModuleNickHider.java new file mode 100644 index 0000000..7fa47f6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/ModuleNickHider.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.module.impl.normal.hypixel; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.profile.ClientProfile; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; + +public class ModuleNickHider extends AbstractModule { + + public Setting hideRealName; + public Setting customNameString; + + public Setting hideSkin; + public Setting hideOtherSkins; + + public ModuleNickHider() { + super("Nick Hider"); + + new Setting(this, "label").setValue("Skin Options"); + this.hideSkin = new Setting(this, "Hide Own Skin").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideOtherSkins = new Setting(this, "Hide Other Skins").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Name Options"); + this.hideRealName = new Setting(this, "Hide Real Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.customNameString = new Setting(this, "Custom Name String").setValue(Minecraft.getMinecraft().getSession().getUsername()).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.hideRealName.getBooleanValue()); + + this.setPreviewLabel("Nick Hider", 1.5F); + this.setDescription("Hides your identity client-sided."); + this.setCreators("Sk1er"); + this.setDefaultState(false); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/ModuleTNTTimer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/ModuleTNTTimer.java new file mode 100644 index 0000000..3f9ebe3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/hypixel/ModuleTNTTimer.java @@ -0,0 +1,121 @@ +package com.cheatbreaker.client.module.impl.normal.hypixel; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderTNTPrimed; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.text.DecimalFormat; + +public class ModuleTNTTimer extends AbstractModule { + + private boolean showHypixelTime; + + public Setting dynamicTextColor; + public Setting staticTextColor; + public Setting textShadow; + + public Setting showBackground; + public Setting backgroundColor; + + public ModuleTNTTimer() { + super("TNT Timer"); + this.setDefaultState(false); + this.setDescription("Shows a timer above TNT."); + this.setCreators("Sk1er"); + this.setAliases("TNT Countdown"); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/tnt.png"), 36, 40); + + new Setting(this, "label").setValue("Text Options"); + this.textShadow = new Setting(this, "Text Shadow").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.dynamicTextColor = new Setting(this, "Dynamic Text Color").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.staticTextColor = new Setting(this, "Static Text Color").setValue(-1).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> !this.dynamicTextColor.getBooleanValue()); + + new Setting(this, "label").setValue("Background Options"); + this.showBackground = new Setting(this, "Show Background").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.backgroundColor = new Setting(this, "Background Color").setValue(1862270976).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.showBackground.getBooleanValue()); + } + + public void drawTimer(RenderTNTPrimed tntRenderer, EntityTNTPrimed block, double x, double y, double z, float partialTicks) { + + if (Minecraft.getMinecraft().currentServerData != null && Minecraft.getMinecraft().theWorld != null) { + this.showHypixelTime = Minecraft.getMinecraft().getCurrentServerData().serverIP.toLowerCase().contains("hypixel"); + } + + float someScaleInRenderLivingEntity = 0.02666667F; + int timeLeft = this.showHypixelTime ? block.fuse - 28 : block.fuse; + + if (timeLeft >= 1) { + if (block.getDistanceSqToEntity(tntRenderer.getRenderManager().livingPlayer) <= 4095.0D) { + FontRenderer fontRenderer = tntRenderer.getFontRendererFromRenderManager(); + + GlStateManager.pushMatrix(); + GlStateManager.translate((float) x + 0.0F, (float) y + block.height + 0.5F, (float) z); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-tntRenderer.getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + + GlStateManager.rotate(tntRenderer.getRenderManager().playerViewX * (Minecraft.getMinecraft().gameSettings.thirdPersonView == 2 ? -1F : 1F), 1.0F, 0.0F, 0.0F); + + GlStateManager.scale(-someScaleInRenderLivingEntity, -someScaleInRenderLivingEntity, someScaleInRenderLivingEntity); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + + GlStateManager.enableDepth(); + GlStateManager.depthMask(true); + GlStateManager.disableTexture2D(); + + int stringWidth = fontRenderer.getStringWidth(this.getFormattedTime(timeLeft, partialTicks)) >> 1; + if (this.showBackground.getBooleanValue()) { + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((-stringWidth - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((-stringWidth - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((stringWidth + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((stringWidth + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + tessellator.draw(); + } + + GlStateManager.enableTexture2D(); + + fontRenderer.drawString(this.getFormattedTime(timeLeft, partialTicks), + -fontRenderer.getStringWidth(this.getFormattedTime(timeLeft, partialTicks)) >> 1, + 0, this.getTextColor(timeLeft).getRGB(), this.textShadow.getBooleanValue()); + + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + } + } + + private String getFormattedTime(int timeLeft, float partialTicks) { + return new DecimalFormat("0.00").format(((float) timeLeft - partialTicks) / 20.0F); + } + + private Color getTextColor(int timeLeft) { + + if (this.dynamicTextColor.getBooleanValue()) { + return new Color(1.0F - Math.min((float) timeLeft / (this.showHypixelTime ? 52.0F : 80.0F), 1.0F), + Math.min((float) timeLeft / (this.showHypixelTime ? 52.0F : 80.0F), 1.0F), 0.0F); + } + return this.staticTextColor.getColorFromColorValue(this.staticTextColor.getColorValue()); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleAutoText.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleAutoText.java new file mode 100644 index 0000000..0ca6800 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleAutoText.java @@ -0,0 +1,79 @@ +package com.cheatbreaker.client.module.impl.normal.misc; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.util.EnumChatFormatting; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ModuleAutoText extends AbstractModule { + + public final String[] hypixelCommands = new String[]{ "/skyblock", "/play", "/lobby", "/hub", "/spawn", "/main", "/leave", "/warp", "/rejoin" }; + + @Setter @Getter private String activeKeybindName = ""; + public List hotkeys = new ArrayList<>(); + public List messageCount = new ArrayList<>(); + public final int maxMessagesPerInterval = 3; + + public int amount = 1; + + public ModuleAutoText() { + super("Auto Text"); + this.setDefaultState(false); + this.setPreviewLabel("Auto Text", 1.0F); + this.hotkeys.addAll(this.getSettingsList()); + } + + public void send(String value) { + if (Minecraft.getMinecraft().isIntegratedServerRunning()) { + Minecraft.getMinecraft().thePlayer.sendChatMessage(value); + return; + } + + if (Minecraft.getMinecraft().getCurrentServerData().serverIP.contains("hypixel")) { + if (this.shouldBeRestricted(value)) { + Minecraft.getMinecraft().thePlayer.sendChatMessage(value); + } else { + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("error", EnumChatFormatting.RED + "\"" + value +"\" is not allowed on Hypixel.", 3000L); + } + } else { + Minecraft.getMinecraft().thePlayer.sendChatMessage(value); + } + } + + /* + Checks to make sure the command is allowed by Hypixel based on Badlion Client's Auto Text whitelist system. + */ + public boolean shouldBeRestricted(String command) { + for (String hypixelCommand : this.hypixelCommands) { + if (command.startsWith(hypixelCommand)) { + return true; + } + } + return false; + } + + public void addOne() { + if (amount >= 50) { + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("error", EnumChatFormatting.RED + "You have hit the limit of 50 hotkeys.", 5000L); + return; + } + + Setting setting = new Setting(this,"Hot key " + amount).setValue("/Command").setKeyCode(0).setMouseBind(false); + this.hotkeys.add(setting); + amount++; + for (Setting setting2 : this.getSettingsList()) { + if (setting2.getSettingName().equalsIgnoreCase(setting.getSettingName())) { + return; + } + } + this.getSettingsList().add(setting); + CheatBreaker.getInstance().getConfigManager().updateProfile(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModulePackTweaks.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModulePackTweaks.java new file mode 100644 index 0000000..d75103a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModulePackTweaks.java @@ -0,0 +1,92 @@ +package com.cheatbreaker.client.module.impl.normal.misc; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class ModulePackTweaks extends AbstractModule { + + public Setting clearGlass; + + public Setting coloredString; + public Setting coloredStringColor; + + public Setting firstPersonFire; + public Setting firstPersonFireOpacity; + public Setting firstPersonFireHeight; + public Setting fireOnEntities; + + public Setting forceVignette; + public Setting vignetteOpacity; + public Setting vignetteMinOpacity; + public Setting vignetteMaxOpacity; + public Setting vignetteOpacityMultiplier; + + public Setting lowHealthOverlay; + public Setting lowHealthStart; + public Setting lowHealthOverlayOpacity; + + public Setting pumpkinOverlay; + public Setting pumpkinOverlayOpacity; + + public Setting transparentInventory; + public Setting tooltips; + + public Setting faceCamera; + public Setting yRotation; + + public ModulePackTweaks() { + super("Pack Tweaks"); + this.setDescription("Change how specific textures appear."); + this.setDefaultState(true); + + new Setting(this, "label").setValue("Glass Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.clearGlass = new Setting(this, "Clear Glass", "Removes the glass texture." + + "\n" + + "\n§bOFF:§r No glass textures are removed." + + "\n§bREGULAR:§r Only normal glass texture is removed." + + "\n§bALL:§r Normal and stained glass textures are removed.").setValue("OFF").acceptedStringValues("OFF", "REGULAR", "ALL").onChange(value -> { + this.mc.renderGlobal.loadRenderers(); + }).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("String Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.coloredString = new Setting(this, "Colored String", "Show a solid color line instead of the texture pack's string texture.").setValue(false).setCondition(() -> Config.MC_VERSION.equals("1.7.10")).onChange(value -> this.mc.renderGlobal.loadRenderers()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.coloredStringColor = new Setting(this, "Colored String Color").setValue(0xFFFF0000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coloredString.getValue() && Config.MC_VERSION.equals("1.7.10")); + + new Setting(this, "label").setValue("Fire Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.firstPersonFire = new Setting(this, "First Person Fire").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.firstPersonFireOpacity = new Setting(this, "Fire Opacity").setValue(90.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.firstPersonFire.getValue()); + this.firstPersonFireHeight = new Setting(this, "Fire Height").setValue(1.0f).setMinMax(0.0f, 2.0f).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.firstPersonFire.getValue()); + this.fireOnEntities = new Setting(this, "Fire on Entities").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Vignette Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.forceVignette = new Setting(this, "Vignette Type").setValue("Vanilla").acceptedStringValues("Vanilla", "Static", "Amplified").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.vignetteOpacity = new Setting(this, "Vignette Opacity").setValue(75.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Static")); + this.vignetteMinOpacity = new Setting(this, "Vignette Minimum Opacity").setValue(0.0F).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Amplified")); + this.vignetteMaxOpacity = new Setting(this, "Vignette Maximum Opacity").setValue(100.0F).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Amplified")); + this.vignetteOpacityMultiplier = new Setting(this, "Vignette Opacity Multiplier").setValue(1.0f).setMinMax(0.1f, 10.0f).setUnit("x").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Amplified")); + + new Setting(this, "label").setValue("Low Health Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.lowHealthOverlay = new Setting(this, "Low Health Overlay").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.lowHealthStart = new Setting(this, "Low Health Start").setValue(3.5F).setMinMax(1.0F, 10.0F).setUnit(" hearts").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.lowHealthOverlay.getBooleanValue()); + this.lowHealthOverlayOpacity = new Setting(this, "Low Health Opacity").setValue(75.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.lowHealthOverlay.getBooleanValue()); + + new Setting(this, "label").setValue("Pumpkin Overlay Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pumpkinOverlay = new Setting(this, "Show Pumpkin Overlay").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pumpkinOverlayOpacity = new Setting(this, "Pumpkin Overlay Opacity").setValue(100.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.pumpkinOverlay.getValue()); + + new Setting(this, "label").setValue("Inventory Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.transparentInventory = new Setting(this, "Transparent Inventory").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.tooltips = new Setting(this, "Show Inventory Tooltips").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + +// new Setting(this, "label").setValue("Dropped Item Options").setCustomizationLevel(CustomizationLevel.SIMPLE); +// this.yRotation = new Setting(this, "Rotate towards camera").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); +// this.faceCamera = new Setting(this, "3D Face player").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.setPreviewIcon(new ResourceLocation("client/icons/mods/packtweaks.png"), 32, 32); + } + + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleTeamMates.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleTeamMates.java new file mode 100644 index 0000000..d4f06fe --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleTeamMates.java @@ -0,0 +1,278 @@ +package com.cheatbreaker.client.module.impl.normal.misc; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.network.DisconnectEvent; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.util.render.teammates.CBTeammate; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +import java.awt.*; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.List; + +/** + * @Module - ModuleTeamMates + * @see AbstractModule + * + * This module is the first of its kind. This module is more widely known as "Team View". + * This will only show arrows above your teammates with servers using the most up-to-date LunarClientAPI Bukkit plugin. + */ +@Getter +public class ModuleTeamMates { + public FloatBuffer modelViewMatrixBuffer = BufferUtils.createFloatBuffer(16); + public FloatBuffer projectionMatrixBuffer = BufferUtils.createFloatBuffer(16); + private final List teammates; + private final int[] colors = new int[]{-15007996, -43234, -3603713, -16580641, -8912129, -16601345, -2786, -64828, -15629042, -10744187}; + private boolean enabled = false; + private final Minecraft mc = Minecraft.getMinecraft(); + + public ModuleTeamMates() { + this.teammates = new ArrayList<>(); + } + + public double getDistance(double x, double y, double z) { + double x2 = x - this.mc.thePlayer.posX; + double y2 = y - this.mc.thePlayer.posY; + double z2 = z - this.mc.thePlayer.posZ; + return Math.sqrt(x2 * x2 + y2 * y2 + z2 * z2); + } + + private void onDraw(GuiDrawEvent event) { + if (this.teammates.isEmpty()) return; + + IntBuffer intBuffer = BufferUtils.createIntBuffer(16); + GL11.glGetInteger(2978, intBuffer); + float f = this.mc.timer.renderPartialTicks; + float f2 = (float) (this.mc.thePlayer.lastTickPosX + (this.mc.thePlayer.posX - this.mc.thePlayer.lastTickPosX) * (double) f); + float f3 = (float) (this.mc.thePlayer.lastTickPosY + (this.mc.thePlayer.posY - this.mc.thePlayer.lastTickPosY) * (double) f); + float f4 = (float) (this.mc.thePlayer.lastTickPosZ + (this.mc.thePlayer.posZ - this.mc.thePlayer.lastTickPosZ) * (double) f); + double d = (double) (this.mc.thePlayer.rotationPitch + 90.0f) * Math.PI / 180.0; + double d2 = (double) (this.mc.thePlayer.rotationYaw + 90.0f) * Math.PI / 180.0; + Vec3 vec3 = new Vec3(Math.sin(d) * Math.cos(d2), Math.cos(d), Math.sin(d) * Math.sin(d2)); + if (this.mc.gameSettings.thirdPersonView == 2) { + vec3 = new Vec3(vec3.xCoord * (double) -1, vec3.yCoord * (double) -1, vec3.zCoord * (double) -1); + } + for (CBTeammate cBTeammate : this.teammates) { + EntityPlayer entityPlayer = this.mc.theWorld.isPlayerTeamMate(cBTeammate.getUuid()); + if (entityPlayer == null) { + double d3; + if (System.currentTimeMillis() - cBTeammate.getLastUpdate() > cBTeammate.getLastMs()) continue; + double d4 = cBTeammate.getPosition().zCoord - (double) f2; + double d5 = cBTeammate.getPosition().yCoord - (double) f3; + double d6 = cBTeammate.getPosition().zCoord - (double) f4; + double d7 = this.getDistance(cBTeammate.getPosition().xCoord, cBTeammate.getPosition().yCoord, cBTeammate.getPosition().zCoord); + if (d7 > (d3 = this.mc.gameSettings.getOptionFloatValue(GameSettings.Options.RENDER_DISTANCE) * 16.0f)) { + d4 = d4 / d7 * d3; + d5 = d5 / d7 * d3; + d6 = d6 / d7 * d3; + } + this.renderArrow(event.getScaledResolution(), cBTeammate, (float) d4, (float) d5, (float) d6, intBuffer, vec3, (int) d7); + continue; + } + if (entityPlayer == this.mc.thePlayer) continue; + float f5 = (float) (entityPlayer.lastTickPosX + (entityPlayer.posX - entityPlayer.lastTickPosX) * (double) f - (double) f2); + float f6 = (float) (entityPlayer.lastTickPosY + (entityPlayer.posY - entityPlayer.lastTickPosY) * (double) f - (double) f3) + entityPlayer.height + 1.0f; + float f7 = (float) (entityPlayer.lastTickPosZ + (entityPlayer.posZ - entityPlayer.lastTickPosZ) * (double) f - (double) f4); + double d8 = this.getDistance(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ); + this.renderArrow(event.getScaledResolution(), cBTeammate, f5, f6, f7, intBuffer, vec3, (int) d8); + } + } + + private void renderArrow(ScaledResolution scaledResolution, CBTeammate teammate, float f, float f2, float f3, IntBuffer intBuffer, Vec3 vec3, int n) { + Vec3 vec32 = new Vec3(f, f2, f3); + double d = vec32.lengthVector(); + if (vec3.dotProduct(vec32 = vec32.normalize()) <= 0.02) { + double d3 = Math.sin(1.5533430342749535); + double d4 = Math.cos(1.5533430342749535); + Vec3 vec33 = vec3.crossProduct(vec32); + double d5 = vec33.xCoord; + double d6 = vec33.yCoord; + double d7 = vec33.zCoord; + double d8 = d4 + d5 * d5 * (1.0 - d4); + double d9 = d5 * d6 * (1.0 - d4) - d7 * d3; + double d10 = d5 * d7 * (1.0 - d4) + d6 * d3; + double d11 = d6 * d5 * (1.0 - d4) + d7 * d3; + double d12 = d4 + d6 * d6 * (1.0 - d4); + double d13 = d6 * d7 * (1.0 - d4) - d5 * d3; + double d14 = d7 * d5 * (1.0 - d4) - d6 * d3; + double d15 = d7 * d6 * (1.0 - d4) + d5 * d3; + double d16 = d4 + d7 * d7 * (1.0 - d4); + f = (float) (d * (d8 * vec3.xCoord + d9 * vec3.yCoord + d10 * vec3.zCoord)); + f2 = (float) (d * (d11 * vec3.xCoord + d12 * vec3.yCoord + d13 * vec3.zCoord)); + f3 = (float) (d * (d14 * vec3.xCoord + d15 * vec3.yCoord + d16 * vec3.zCoord)); + } + FloatBuffer floatBuffer = BufferUtils.createFloatBuffer(3); + GLU.gluProject(f, f2, f3, this.modelViewMatrixBuffer, this.projectionMatrixBuffer, intBuffer, floatBuffer); + float f4 = floatBuffer.get(0) / (float) scaledResolution.getScaleFactor(); + float f5 = floatBuffer.get(1) / (float) scaledResolution.getScaleFactor(); + TeammateArrowLocation arrowLocation = null; + int n2 = 8; + int n3 = 10; + int n4 = -4 - n3; + float f6 = (float) scaledResolution.getScaledHeight() - f5; + if (f6 < 0.0f) { + arrowLocation = TeammateArrowLocation.RIGHT; + f5 = scaledResolution.getScaledHeight() - 6; + } else if (f6 > (float) (scaledResolution.getScaledHeight() - n3)) { + arrowLocation = TeammateArrowLocation.BOTTOM; + f5 = 6; + } + if (f4 - (float) n2 < 0.0f) { + arrowLocation = TeammateArrowLocation.TOP; + f4 = 6; + } else if (f4 > (float) (scaledResolution.getScaledWidth() - n2)) { + arrowLocation = TeammateArrowLocation.LEFT; + f4 = scaledResolution.getScaledWidth() - 6; + } + GL11.glPushMatrix(); + GL11.glTranslatef(f4, (float) scaledResolution.getScaledHeight() - f5, 0.0f); + if (arrowLocation != null) { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showOffScreenMarker.getValue()) { + this.renderArrow(teammate, arrowLocation, 0.0f, 0.0f); + } + } else { + this.renderArrow(teammate, n2, (float) n4, (float) n3); + if (n > 40 && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showDistance.getValue()) { + this.mc.fontRendererObj.drawCenteredStringWithShadow("(" + n + "m)", 0, 10, -1); + } + } + GL11.glPopMatrix(); + } + + private void renderArrow(CBTeammate teammate, TeammateArrowLocation arrowLocation, float f, float f2) { + Tessellator tes = Tessellator.getInstance(); + WorldRenderer wr = tes.getWorldRenderer(); + GL11.glEnable(3042); + GL11.glDisable(3553); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + if (teammate.isLeader()) { + GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.66f); + } else { + Color color = teammate.getColor(); + GL11.glColor4f((float) color.getRed() / (float) 255, (float) color.getGreen() / 255.0F, (float) color.getBlue() / 255.0F, 0.66f); + } + float f3 = 8; + float f4 = 10; + GL11.glPushMatrix(); + GL11.glTranslatef(f, f2, 0.0f); + switch (arrowLocation) { + case TOP: + wr.begin(7, DefaultVertexFormats.POSITION); + wr.pos(f3 / 2.0f, f4 / 2.0f, 0.0).endVertex(); + wr.pos(-f3 / 2.0f, 0.0, 0.0).endVertex(); + wr.pos(f3 / 2.0f, -f4 / 2.0f, 0.0).endVertex(); + wr.pos(-f3 / 2.0f, 0.0, 0.0).endVertex(); + tes.draw(); + break; + case LEFT: + wr.begin(7, DefaultVertexFormats.POSITION); + wr.pos(-f3 / 2.0f, f4 / 2.0f, 0.0).endVertex(); + wr.pos(f3 / 2.0f, 0.0, 0.0).endVertex(); + wr.pos(-f3 / 2.0f, -f4 / 2.0f, 0.0).endVertex(); + wr.pos(f3 / 2.0f, 0.0, 0.0).endVertex(); + tes.draw(); + break; + case BOTTOM: + wr.begin(7, DefaultVertexFormats.POSITION); + wr.pos(-f3 / 2.0f, -f4 / 2.0f, 0.0).endVertex(); + wr.pos(0.0, f4 / 2.0f, 0.0).endVertex(); + wr.pos(f3 / 2.0f, -f4 / 2.0f, 0.0).endVertex(); + wr.pos(0.0, f4 / 2.0f, 0.0).endVertex(); + tes.draw(); + break; + case RIGHT: + wr.begin(7, DefaultVertexFormats.POSITION); + wr.pos(-f3 / 2.0f, f4 / 2.0f, 0.0).endVertex(); + wr.pos(0.0, -f4 / 2.0f, 0.0).endVertex(); + wr.pos(f3 / 2.0f, f4 / 2.0f, 0.0).endVertex(); + wr.pos(0.0, -f4 / 2.0f, 0.0).endVertex(); + tes.draw(); + } + GL11.glPopMatrix(); + GL11.glEnable(3553); + GL11.glDisable(3042); + } + + private void renderArrow(CBTeammate teammate, float f, float f2, float f3) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer wr = tessellator.getWorldRenderer(); + GL11.glEnable(3042); + GL11.glDisable(3553); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + if (teammate.isLeader()) { + GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.66f); + } else { + Color color = teammate.getColor(); + GL11.glColor4f((float) color.getRed() / 255.0f, (float) color.getGreen() / 255.0f, (float) color.getBlue() / 255.0f, 0.66f); + } + GL11.glPushMatrix(); + GL11.glScalef(0.6f, 0.6f, 0.6f); + GL11.glRotatef(45.0f, 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(f * 2.0f, 0.0f, 0.0f); + GL11.glRotatef(90.0f, 0.0f, 0.0f, -1.0f); + wr.begin(7, DefaultVertexFormats.POSITION); + wr.pos(-f, f2, 0.0).endVertex(); + wr.pos(-f, f2 + f3 / 2.0f, 0.0).endVertex(); + wr.pos(f, f2 + f3 / 2.0f, 0.0).endVertex(); + wr.pos(f, f2, 0.0).endVertex(); + tessellator.draw(); + GL11.glRotatef(90.0f, 0.0f, 0.0f, -1.0f); + GL11.glTranslatef(f * 2.0f + 1.0f, f3 / 2.0f + 1.0f, 0.0f); + wr.begin(7, DefaultVertexFormats.POSITION); + wr.pos(-f / 2.0f + 1.0f, f2, 0.0).endVertex(); + wr.pos(-f / 2.0f + 1.0f, f2 + f3 / 2.0f, 0.0).endVertex(); + wr.pos(f, f2 + f3 / 2.0f, 0.0).endVertex(); + wr.pos(f, f2, 0.0).endVertex(); + tessellator.draw(); + GL11.glPopMatrix(); + GL11.glEnable(3553); + GL11.glDisable(3042); + } + + private void onDisconnect(DisconnectEvent event) { + this.teammates.clear(); + } + + public CBTeammate createTeammate(String teammateKey) { + for (CBTeammate teammate : this.teammates) { + if (!teammate.getUuid().equals(teammateKey)) continue; + return teammate; + } + return null; + } + + public void setEnabled(boolean bl) { + if (bl && !this.enabled) { + this.enabled = true; + CheatBreaker.getInstance().getEventBus().addEvent(GuiDrawEvent.class, this::onDraw); + CheatBreaker.getInstance().getEventBus().addEvent(DisconnectEvent.class, this::onDisconnect); + } else if (!bl && this.enabled) { + this.enabled = false; + CheatBreaker.getInstance().getEventBus().removeEvent(GuiDrawEvent.class, this::onDraw); + CheatBreaker.getInstance().getEventBus().removeEvent(DisconnectEvent.class, this::onDisconnect); + } + } + + public enum TeammateArrowLocation { + TOP, + LEFT, + BOTTOM, + RIGHT + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleZansMiniMap.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleZansMiniMap.java new file mode 100644 index 0000000..d577232 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleZansMiniMap.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.module.impl.normal.misc; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.MiniMapRules; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import net.minecraft.util.ResourceLocation; + +/** + * @Module - ModuleZansMiniMap + * @see AbstractModule + * + * This module is the most popular minimap mod for forge, ported into CheatBreaker! + */ +public class ModuleZansMiniMap extends AbstractModule { + // @Getter private final VoxelMap voxelMap; + public static MiniMapRules rule = MiniMapRules.NEUTRAL; + + public ModuleZansMiniMap() { + super("Zans Minimap"); + this.setDefaultState(false); + this.notRenderHUD = false; + this.setDefaultAnchor(GuiAnchor.RIGHT_TOP); +// this.voxelMap = new VoxelMap(true, true); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/zans.png"), 42, 42); + this.setDescription("Adds a minimap on the top right and allows you to manage waypoints."); + this.setCreators("Zan"); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + @Override + public void addAllEvents() { + super.addAllEvents(); + if (rule == MiniMapRules.FORCED_OFF) { + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Error", "&4Minimap &fis not allowed on this server. Some functions may not work.", 4000L); + } + } + + private void onGuiDraw(GuiDrawEvent event) { +// float f = 1.0f / CheatBreaker.getScaleFactor(); +// switch (this.voxelMap.getMapOptions().mapCorner) { +// case 0: +// if (this.getGuiAnchor() == GuiAnchor.LEFT_TOP) break; +// this.setAnchor(GuiAnchor.LEFT_TOP); +// break; +// case 1: +// if (this.getGuiAnchor() == GuiAnchor.RIGHT_TOP) break; +// this.setAnchor(GuiAnchor.RIGHT_TOP); +// break; +// case 2: +// if (this.getGuiAnchor() == GuiAnchor.RIGHT_BOTTOM) break; +// this.setAnchor(GuiAnchor.RIGHT_BOTTOM); +// break; +// case 3: +// if (this.getGuiAnchor() == GuiAnchor.LEFT_BOTTOM) break; +// this.setAnchor(GuiAnchor.LEFT_BOTTOM); +// } +// switch (this.voxelMap.getMapOptions().sizeModifier) { +// case -1: +// this.setTranslations((int)((float)-5 * f), (float)((int)((float)5 * f))); +// this.setDimensions((int)((float)100 * f), (int)((float)100 * f)); +// break; +// case 0: +// this.setTranslations((int)((float)-5 * f), (float)((int)((float)5 * f))); +// this.setDimensions((int)((float)135 * f), (int)((float)135 * f)); +// break; +// case 1: +// this.setTranslations((int)((float)-5 * f), (float)((int)((float)5 * f))); +// this.setDimensions((int)((float)175 * f), (int)((float)175 * f)); +// } +// this.voxelMap.onTickInGame(Minecraft.getMinecraft()); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleDragToLook.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleDragToLook.java new file mode 100644 index 0000000..0df842d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleDragToLook.java @@ -0,0 +1,81 @@ +package com.cheatbreaker.client.module.impl.normal.perspective; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import net.minecraft.client.Minecraft; + +/** + * @Module - ModuleDragToLook + * @see AbstractModule + * + * This module is the first of its kind, now known as Freelook, or Perspective. + */ +public class ModuleDragToLook { + private final Minecraft mc = Minecraft.getMinecraft(); + private final CheatBreaker cb = CheatBreaker.getInstance(); + public boolean enabled = false; + public float rotationYaw; + public float prevRotationYaw; + public float rotationPitch; + public float prevRotationPitch; + private int thirdPersonView; + + public ModuleDragToLook() { + this.cb.getEventBus().addEvent(TickEvent.class, tickEvent -> { + if (this.cb.getModuleManager().perspectiveMod.toggleDragToLook.getBooleanValue()) { + if (this.enabled && this.cb.getGlobalSettings().keyBindDragToLook.isPressed()) { + this.tick(); + } + } else { + if (this.enabled && !this.cb.getGlobalSettings().keyBindDragToLook.isKeyDown()) { + this.tick(); + } + } + + }); + } + + public void toggle() { + if (this.cb.getModuleManager().perspectiveMod.isEnabled()) { + this.rotationYaw = this.mc.thePlayer.rotationYaw; + this.rotationPitch = this.mc.thePlayer.rotationPitch; + this.prevRotationYaw = this.mc.thePlayer.prevRotationYaw; + this.prevRotationPitch = this.mc.thePlayer.prevRotationPitch; + this.thirdPersonView = this.mc.gameSettings.thirdPersonView; + switch (this.cb.getModuleManager().perspectiveMod.lookView.getStringValue()) { + case "Third": + this.mc.gameSettings.thirdPersonView = 1; + break; + case "Reverse": + this.mc.gameSettings.thirdPersonView = 2; + break; + default: + this.mc.gameSettings.thirdPersonView = 0; + } + this.enabled = true; + } + } + + public void tick() { + this.mc.gameSettings.thirdPersonView = this.thirdPersonView; + this.enabled = false; + } + + public void setAngles(float yaw, float pitch) { + float rotationPitch = this.rotationPitch; + float rotationYaw = this.rotationYaw; + this.rotationYaw = (float) ((double) this.rotationYaw + (this.cb.getModuleManager().perspectiveMod.invertYaw.getBooleanValue() ? (double) -yaw : (double) yaw) * 0.15); + this.rotationPitch = (float) ((double) this.rotationPitch - (this.cb.getModuleManager().perspectiveMod.invertPitch.getBooleanValue() ? (double) -pitch : (double) pitch) * 0.15); + if (this.cb.getModuleManager().perspectiveMod.pitchLock.getBooleanValue()) { + if (this.rotationPitch < (float) -90) { + this.rotationPitch = -90; + } + if (this.rotationPitch > (float) 90) { + this.rotationPitch = 90; + } + } + this.prevRotationPitch += this.rotationPitch - rotationPitch; + this.prevRotationYaw += this.rotationYaw - rotationYaw; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModulePerspective.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModulePerspective.java new file mode 100644 index 0000000..7d5288a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModulePerspective.java @@ -0,0 +1,126 @@ +package com.cheatbreaker.client.module.impl.normal.perspective; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +/** + * @Module - ModulePerspective + * @see AbstractModule + * + * This module controls the Perspective related things for Minecraft. + */ +public class ModulePerspective extends AbstractModule { + private final Setting thirdPersonOptionsLabel; + public Setting toggleFrontCamera; + public Setting toggleBackCamera; +// public Setting keyBindBackCamera; +// public Setting keyBindFrontCamera; + + private final Setting dragToLookOptionsLabel; + public Setting lookView; + public Setting toggleDragToLook; + public Setting pitchLock; + public Setting invertPitch; + public Setting invertYaw; +// public Setting keyBindDragToLook; + + private final Setting viewBobbingOptionsLabel; + public Setting bobScreen; + public Setting bobHand; + public Setting bobHandWhileHoldingMap; + public Setting bobWhileSprinting; + public Setting screenBobbingIntensity; + public Setting handBobbingIntensity; + + private final Setting cameraOptionsLabel; + public Setting damageAffectsCamera; + public Setting hurtCameraIntensity; + + public Setting staticSwiftness; + public Setting defaultFOV; + public Setting aimingMultiplier; +// public Setting defaultFOV; +// public Setting defaultFOV; + + private float prevValue = 0.0F; + + public ModulePerspective() { + super("Perspective"); + this.setDescription("Allows you to change how your perspective looks."); + this.setAliases("Freelook", "Snaplook", "360 Perspective"); + this.setDefaultState(true); + this.setPreviewLabel("Perspective", 1.0F); + this.thirdPersonOptionsLabel = new Setting(this, "label").setValue("Third Person Options"); + this.toggleBackCamera = new Setting(this, "Toggle Back Camera", "Make the back camera keybind toggled instead of held.").setValue(false); + this.toggleFrontCamera = new Setting(this, "Toggle Front Camera", "Make the front camera keybind toggled instead of held.").setValue(false); +// this.keyBindBackCamera = new Setting(this, "Back Camera Keybind", "The key to use the Back Camera.").setValue(0); +// this.keyBindFrontCamera = new Setting(this, "Front Camera Keybind", "The key to use the Front Camera.").setValue(0); + + this.dragToLookOptionsLabel = new Setting(this, "label").setValue("Drag to Look Options"); + this.lookView = new Setting(this, "Look View", "Change which perspective mode to use when toggling Drag to Look.").setValue("Third").acceptedStringValues("Third", "Reverse", "First"); + this.toggleDragToLook = new Setting(this, "Toggle Drag to Look", "Make the Drag to Look keybind toggled instead of held.").setValue(false); + this.pitchLock = new Setting(this, "Pitch Lock", "Toggle the pitch axis limitation.").setValue(true); + this.invertPitch = new Setting(this, "Invert Pitch (Up and Down)", "Invert the rotation pitch when moving the camera.").setValue(false); + this.invertYaw = new Setting(this, "Invert Yaw (Left and Right)", "Invert the rotation yaw when moving the camera.").setValue(false); +// this.keyBindDragToLook = new Setting(this, "Drag to Look Keybind", "The key to use Drag to Look.").setValue(Keyboard.KEY_LMENU); + + this.viewBobbingOptionsLabel = new Setting(this, "label").setValue("View Bobbing Options"); + this.bobScreen = new Setting(this, "Bob Screen", "Bob the camera screen when moving.").setValue(true); + this.bobHand = new Setting(this, "Bob Hand", "Bob the hand when moving.").setValue(true); + this.bobWhileSprinting = new Setting(this, "Bob Only While Sprinting", "Bob the hand only when sprinting.").setValue("OFF").acceptedStringValues("OFF", "ON", "Only Hand", "Only Screen"); + this.screenBobbingIntensity = new Setting(this, "Screen Bobbing Intensity").setUnit("%").setValue(100.0F).setMinMax(0.0F, 200.0F); + this.handBobbingIntensity = new Setting(this, "Hand Bobbing Intensity").setUnit("%").setValue(100.0F).setMinMax(0.0F, 200.0F); + + this.cameraOptionsLabel = new Setting(this, "label").setValue("Camera Options"); + this.damageAffectsCamera = new Setting(this, "Damage affects camera").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hurtCameraIntensity = new Setting(this, "Hurt Camera Intensity").setUnit("%").setValue(14.0F).setMinMax(5.0F, 35.0F).setCondition(() -> this.damageAffectsCamera.getBooleanValue()); + // fov changer + this.staticSwiftness = new Setting(this, "Static Swiftness", "Determines if your FOV changes as you move.").setValue(false); + this.defaultFOV = new Setting(this, "Default FOV").setUnit(" FOV").setValue(30).setMinMax(30, 110); + this.aimingMultiplier = new Setting(this, "Aiming Multiplier").setUnit("x").setValue(0.15F).setMinMax(0.15F, 0.75F); + } + + /** + * Setups all the GL settings for view bobbing. Args: partialTickTime + */ + public void setupViewBobbing(float par1, Setting bobElement) { + if (this.mc.getRenderViewEntity() instanceof EntityPlayer && bobElement.getBooleanValue()) { + EntityPlayer var2 = (EntityPlayer)this.mc.getRenderViewEntity(); + + boolean sprintingToggleCriteria = this.bobWhileSprinting.getValue().equals("Only Screen"); + float intensity = this.screenBobbingIntensity.getFloatValue() / 100.0F; + if (bobElement == this.bobHand) { + sprintingToggleCriteria = this.bobWhileSprinting.getValue().equals("Only Hand"); + intensity = this.handBobbingIntensity.getFloatValue() / 100.0F; + } + + float var3 = var2.distanceWalkedModified - var2.prevDistanceWalkedModified; + float var4 = -(var2.distanceWalkedModified + var3 * par1); + float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * par1; + float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * par1; + + float var22 = this.bobWhileSprinting.getValue().equals("ON") || sprintingToggleCriteria ? this.prevValue : var5; + if (this.bobWhileSprinting.getValue().equals("ON") || sprintingToggleCriteria) { + if (var2.isSprinting()) { + this.prevValue = var5; + } else { + this.prevValue -= 0.00009; + } + + if (this.prevValue < 0.0F) { + return; + } + + } + + GL11.glTranslatef(MathHelper.sin(var4 * (float)Math.PI) * var22 * 0.5F * intensity, -Math.abs(MathHelper.cos(var4 * (float)Math.PI) * var22 * intensity), 0.0F); + GL11.glRotatef(MathHelper.sin(var4 * (float)Math.PI) * var22 * 3.0F * intensity, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(Math.abs(MathHelper.cos(var4 * (float)Math.PI - 0.2F) * var22) * 5.0F * intensity, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var6, 1.0F, 0.0F, 0.0F); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleSnapLook.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleSnapLook.java new file mode 100644 index 0000000..4883b35 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleSnapLook.java @@ -0,0 +1,60 @@ +package com.cheatbreaker.client.module.impl.normal.perspective; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import net.minecraft.client.Minecraft; + +/** + * @Module - ModuleSnapLook + * @see AbstractModule + * + * This module snaps your perspective to a certain value. + */ +public class ModuleSnapLook { + private final Minecraft mc = Minecraft.getMinecraft(); + private final CheatBreaker cb = CheatBreaker.getInstance(); + public boolean enabled = false; + public float rotationYaw; + public float prevRotationYaw; + public float rotationPitch; + public float prevRotationPitch; + private int thirdPersonView; + private int mode; + + public ModuleSnapLook() { + this.cb.getEventBus().addEvent(TickEvent.class, tickEvent -> { + if ((this.mode == 1 && this.cb.getModuleManager().perspectiveMod.toggleBackCamera.getBooleanValue()) || (this.mode == 2 && this.cb.getModuleManager().perspectiveMod.toggleFrontCamera.getBooleanValue())) { + if (this.enabled && (this.cb.getGlobalSettings().keyBindBackLook.isPressed() || this.cb.getGlobalSettings().keyBindFrontLook.isPressed())) { + this.tick(); + } + } else { + if (this.enabled && !this.cb.getGlobalSettings().keyBindBackLook.isKeyDown() && !this.cb.getGlobalSettings().keyBindFrontLook.isKeyDown()) { + this.tick(); + } + } + }); + } + + public void toggle(int mode) { + if (this.cb.getModuleManager().perspectiveMod.isEnabled()) { + this.rotationYaw = this.mc.thePlayer.rotationYaw; + this.rotationPitch = this.mc.thePlayer.rotationPitch; + this.prevRotationYaw = this.mc.thePlayer.prevRotationYaw; + this.prevRotationPitch = this.mc.thePlayer.prevRotationPitch; + this.thirdPersonView = this.mc.gameSettings.thirdPersonView; + if (mode == 1) { + this.mc.gameSettings.thirdPersonView = 1; + } else { + this.mc.gameSettings.thirdPersonView = 2; + } + this.enabled = true; + this.mode = mode; + } + } + + public void tick() { + this.mc.gameSettings.thirdPersonView = this.thirdPersonView; + this.enabled = false; + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ColorSaturation.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ColorSaturation.java new file mode 100644 index 0000000..47ce75e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ColorSaturation.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.module.impl.normal.shader; + +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.google.common.base.Throwables; +import net.minecraft.client.Minecraft; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; + +/** + * @Module - ColorSaturation + * @see AbstractModule + * + * This module activates a Shader that saturates all colors in the game. + */ +public class ColorSaturation extends AbstractModule { + + public ColorSaturation() { + super("Color Saturation"); + this.setDefaultState(false); + + /* + * Insert Settings here. + */ + + this.setPreviewLabel("Color Saturation", 1.1F); + this.setDescription("Allows you to adjust the hue, saturation, brightness, and contrast of your screen."); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent event) { + if (this.mc.currentScreen == null && !this.mc.entityRenderer.isShaderActive()) { + this.drawShader(); + } + } + + private void drawShader() { + this.mc.entityRenderer.loadMotionBlurShader(); + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive() && this.mc.thePlayer != null) { + for (Shader shader : shaderGroup.getListShaders()) { + /* + * Insert code here. + */ + } + } + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ContainerBlur.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ContainerBlur.java new file mode 100644 index 0000000..f9856e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ContainerBlur.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.module.impl.normal.shader; + +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.google.common.base.Throwables; +import net.minecraft.client.Minecraft; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; + +/** + * @Module - ContainerBlur + * @see AbstractModule + * + * This module activates a Shader Blur within the game's containers. + */ +public class ContainerBlur extends AbstractModule { + + public ContainerBlur() { + super("Container Blur"); + this.setDefaultState(false); + + /* + * Insert Settings here. + */ + + this.setPreviewLabel("Container Blur", 1.1F); + this.setDescription("Adds a blur to containers."); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent event) { + if (this.mc.currentScreen == null && !this.mc.entityRenderer.isShaderActive()) { + this.drawShader(); + } + } + + private void drawShader() { + this.mc.entityRenderer.loadMotionBlurShader(); + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive() && this.mc.thePlayer != null) { + for (Shader shader : shaderGroup.getListShaders()) { + /* + * Insert code here. + */ + } + } + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleMotionBlur.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleMotionBlur.java new file mode 100644 index 0000000..adea560 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleMotionBlur.java @@ -0,0 +1,64 @@ +package com.cheatbreaker.client.module.impl.normal.shader; + +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.google.common.base.Throwables; +import net.minecraft.client.Minecraft; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderUniform; +import net.minecraft.util.ResourceLocation; + +public class ModuleMotionBlur extends AbstractModule { + private final Setting amount; + private final Setting color; + public Setting oldBlur; + + public ModuleMotionBlur() { + super("Motion Blur"); + this.setDefaultState(false); + this.oldBlur = new Setting(this, "Old Blur", "Revert to the previously used motion blur shader.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.amount = new Setting(this, "Amount", "Change the amount of blur intensity.").setValue(10.0F).setMinMax(0.01F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.color = new Setting(this, "Color", "Change the color of the motion blur.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.oldBlur.getValue()); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/swordblur.png"), 40, 40); + this.setDescription("Adds a shader to blur your surroundings while moving."); + this.setCreators("Fyu (Original)", "Moonsworth LLC (Newer shader)"); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent tickEvent) { + if (this.mc.currentScreen == null && !this.mc.entityRenderer.isShaderActive()) { + this.drawShader(); + } + } + + private void drawShader() { + this.mc.entityRenderer.loadMotionBlurShader(); + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive() && this.mc.thePlayer != null) { + for (Shader shader : shaderGroup.getListShaders()) { // Previously getShaders() + ShaderUniform uniform = shader.getShaderManager().getShaderUniform("Phosphor"); + if (uniform == null) continue; + float f = (float) this.amount.getValue() / 100.0f * 0.9F; + if (f >= 1.0f) { + f = 0.99f; + } + float amount = 1.0f - f; + if ((Boolean) this.oldBlur.getValue()) { + amount = 0.7F + (float) this.amount.getValue() / 1000.0F * 3.0F - 0.01F; + } + int color = (Boolean) oldBlur.getValue() ? this.color.getColorValue() : -1; + float red = (float) (color >> 16 & 0xFF) / (float) 255; + float green = (float) (color >> 8 & 0xFF) / (float) 255; + float blue = (float) (color & 0xFF) / (float) 255; + uniform.set(amount * red, amount * green, amount * blue); + } + } + } catch (IllegalArgumentException e) { + Throwables.propagate(e); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleBlockOverlay.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleBlockOverlay.java new file mode 100644 index 0000000..c998ead --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleBlockOverlay.java @@ -0,0 +1,403 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.src.Config; +import net.minecraft.util.*; +import net.optifine.model.BlockModelUtils; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +/** + * @Module - ModuleBlockOverlay + * @see AbstractModule + * + * This module activates a custom overlay when you look at a block. + */ +public class ModuleBlockOverlay extends AbstractModule { + public Setting outline; + + public Setting overlay; + + public Setting outlineColor; + + public Setting outline2Color; + + public Setting overlayColor; + + public Setting overlay2Color; + + public Setting lineWidth; + + public Setting gap; + + public Setting depthless; + + public Setting hidePlants; + + private static final Tessellator TESSELLATOR = Tessellator.getInstance(); + + private static final WorldRenderer WORLD_RENDERER = TESSELLATOR.getWorldRenderer(); + + public ModuleBlockOverlay() { + super("Block Overlay"); + this.setDefaultState(true); + new Setting(this, "label").setValue("General Options"); + this.outline = new Setting(this, "Outline").setValue("Full").acceptedStringValues("OFF", "Full"); + this.overlay = new Setting(this, "Overlay").setValue("OFF").acceptedStringValues("OFF", "Full"); + this.lineWidth = new Setting(this, "Line Width").setValue(2.0F).setMinMax(1.0F, 10.0F).setCondition(() -> !(Boolean) this.outline.getValue().equals("OFF")); + this.gap = new Setting(this, "Gap").setValue(1.0F).setMinMax(1.0f, 10.0f); + this.depthless = new Setting(this, "Render without Depth").setValue(false); + this.hidePlants = new Setting(this, "Hide Plants").setValue(false); + new Setting(this, "label").setValue("Color Options").setCondition(() -> !(Boolean) this.outline.getValue().equals("OFF") || !(Boolean) this.overlay.getValue().equals("OFF")); + this.outlineColor = new Setting(this, "Outline Color").setValue(1711276032).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.outline.getValue().equals("OFF")); + this.outline2Color = new Setting(this, "Outline 2 Color").setValue(1711276032).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.outline.getValue().equals("OFF")); + this.overlayColor = new Setting(this, "Overlay Color").setValue(1056964608).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.overlay.getValue().equals("OFF")); + this.overlay2Color = new Setting(this, "Overlay 2 Color").setValue(1056964608).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.overlay.getValue().equals("OFF")); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/overlay.png"), 36, 40); + this.setDescription("Replace the Vanilla outline with a customizable outline and overlay."); + this.setCreators("aycy"); + } + + /** + * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime + * + * @author Tellinq + */ + public void drawSelectionBox(EntityPlayer player, MovingObjectPosition movingObjectPositionIn, int execute, float partialTicks, WorldClient wc) { + if (execute == 0 && movingObjectPositionIn.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.color(1.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth(2.0F); + GlStateManager.disableTexture2D(); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GlStateManager.depthMask(false); + float f = 0.002F; + BlockPos blockpos = movingObjectPositionIn.getBlockPos(); + Block block = wc.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() != Material.air && wc.getWorldBorder().contains(blockpos)) { + block.setBlockBoundsBasedOnState(wc, blockpos); + double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks; + double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks; + double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks; + AxisAlignedBB axisalignedbb = block.getSelectedBoundingBox(wc, blockpos); + Block.EnumOffsetType enumoffsettype = block.getOffsetType(); + + if (enumoffsettype != Block.EnumOffsetType.NONE) { + axisalignedbb = BlockModelUtils.getOffsetBoundingBox(axisalignedbb, enumoffsettype, blockpos); + } + + drawBlock(axisalignedbb.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D).offset(-d0, -d1, -d2), null, this.overlayColor.getColorValue(), this.overlay2Color.getColorValue(), this.outlineColor.getColorValue(), this.outline2Color.getColorValue(), this.overlay.getValue().equals("Full"), this.outline.getValue().equals("Full")); +// drawOutlinedBoundingBox(axisalignedbb.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D).offset(-d0, -d1, -d2)); +// drawOverlayedBoundingBox(axisalignedbb.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D).offset(-d0, -d1, -d2)); + } + + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + + GlStateManager.disableBlend(); + } + } + + /** + * Draws lines for the edges of the bounding box. + * + * @author Mojang + */ + public static void drawOutlinedBoundingBox(AxisAlignedBB boundingBox) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(3, DefaultVertexFormats.POSITION); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); + tessellator.draw(); + worldrenderer.begin(3, DefaultVertexFormats.POSITION); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); + tessellator.draw(); + worldrenderer.begin(1, DefaultVertexFormats.POSITION); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + tessellator.draw(); + } + + /** + * Draws rectangles around the bounding box. + * + * @author Tellinq + */ + public static void drawOverlayedBoundingBox(AxisAlignedBB var0) { + Tessellator t = Tessellator.getInstance(); + WorldRenderer worldrenderer = t.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + + worldrenderer.pos(var0.minX, var0.minY, var0.minZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.maxZ); + t.draw(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(var0.maxX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.minZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.minX, var0.minY, var0.minZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.maxZ); + t.draw(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(var0.minX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.minZ); + t.draw(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(var0.minX, var0.minY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.minY, var0.minZ); + worldrenderer.pos(var0.minX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.minZ); + t.draw(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(var0.minX, var0.minY, var0.minZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.minX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.minZ); + t.draw(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(var0.minX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.minY, var0.maxZ); + worldrenderer.pos(var0.minX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.minX, var0.minY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.minZ); + worldrenderer.pos(var0.maxX, var0.maxY, var0.maxZ); + worldrenderer.pos(var0.maxX, var0.minY, var0.maxZ); + t.draw(); + } + + public static void drawBlock(AxisAlignedBB box, EnumFacing side, int overlayStartColor, int overlayEndColor, int outlineStartColor, int outlineEndColor, boolean overlay, boolean outline) { + if (side == null) { + drawBlockFull(box, new Color(overlayStartColor, true), new Color(overlayEndColor, true), new Color(outlineStartColor, true), new Color(outlineEndColor, true), overlay, outline); + } else { + drawBlockSide(box, side, new Color(overlayStartColor, true), new Color(overlayEndColor, true), new Color(outlineStartColor, true), new Color(outlineEndColor, true), overlay, outline); + } + } + + private static void drawBlockFull(AxisAlignedBB box, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + if (overlay) { + drawBlockTop(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, true, false); + drawBlockBottom(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, true, false); + drawBlockNorth(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, true, false); + drawBlockEast(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, true, false); + drawBlockSouth(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, true, false); + drawBlockWest(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, true, false); + } + if (outline) { + drawBlockTop(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, false, true); + drawBlockBottom(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, false, true); + drawBlockNorth(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, false, true); + drawBlockEast(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, false, true); + drawBlockSouth(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, false, true); + drawBlockWest(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, false, true); + } + } + + public static void drawBlockSide(AxisAlignedBB box, EnumFacing side, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + switch (side) { + case UP: { + drawBlockTop(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, overlay, outline); + break; + } + case DOWN: { + drawBlockBottom(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, overlay, outline); + break; + } + case NORTH: { + drawBlockNorth(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, overlay, outline); + break; + } + case EAST: { + drawBlockEast(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, overlay, outline); + break; + } + case SOUTH: { + drawBlockSouth(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, overlay, outline); + break; + } + case WEST: { + drawBlockWest(box, overlayStartColor, overlayEndColor, outlineStartColor, outlineEndColor, overlay, outline); + } + } + } + + private static void drawBlockTop(AxisAlignedBB box, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + if (overlay) { + WORLD_RENDERER.begin(7, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.minX, box.maxY, box.maxZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.maxZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.minZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.maxY, box.minZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + if (outline) { + WORLD_RENDERER.begin(2, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.minX, box.maxY, box.maxZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.maxZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.minZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.maxY, box.minZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + } + + private static void drawBlockBottom(AxisAlignedBB box, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + if (overlay) { + WORLD_RENDERER.begin(7, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.maxX, box.minY, box.maxZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.maxZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.minZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.minZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + if (outline) { + WORLD_RENDERER.begin(2, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.maxX, box.minY, box.maxZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.maxZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.minZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.minZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + } + + private static void drawBlockNorth(AxisAlignedBB box, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + if (overlay) { + WORLD_RENDERER.begin(7, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.minZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.minZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.minZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.maxY, box.minZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + if (outline) { + WORLD_RENDERER.begin(2, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.minZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.minZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.minZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.maxY, box.minZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.minZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + } + + private static void drawBlockEast(AxisAlignedBB box, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + if (overlay) { + WORLD_RENDERER.begin(7, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.minZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.maxZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.maxZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.minZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + if (outline) { + WORLD_RENDERER.begin(2, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.minZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.maxZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.maxZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.minZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + } + + private static void drawBlockSouth(AxisAlignedBB box, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + if (overlay) { + WORLD_RENDERER.begin(7, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.minX, box.maxY, box.maxZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.maxZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.maxZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.maxZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + if (outline) { + WORLD_RENDERER.begin(2, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.maxZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.maxY, box.maxZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.maxZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.minY, box.maxZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.maxX, box.maxY, box.maxZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + } + + private static void drawBlockWest(AxisAlignedBB box, Color overlayStartColor, Color overlayEndColor, Color outlineStartColor, Color outlineEndColor, boolean overlay, boolean outline) { + if (overlay) { + WORLD_RENDERER.begin(7, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.minX, box.maxY, box.maxZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.maxY, box.minZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.minZ).color(overlayStartColor.getRed(), overlayStartColor.getGreen(), overlayStartColor.getBlue(), overlayStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.maxZ).color(overlayEndColor.getRed(), overlayEndColor.getGreen(), overlayEndColor.getBlue(), overlayEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + if (outline) { + WORLD_RENDERER.begin(2, DefaultVertexFormats.POSITION_COLOR); + WORLD_RENDERER.pos(box.minX, box.maxY, box.maxZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.maxY, box.minZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.minZ).color(outlineStartColor.getRed(), outlineStartColor.getGreen(), outlineStartColor.getBlue(), outlineStartColor.getAlpha()).endVertex(); + WORLD_RENDERER.pos(box.minX, box.minY, box.maxZ).color(outlineEndColor.getRed(), outlineEndColor.getGreen(), outlineEndColor.getBlue(), outlineEndColor.getAlpha()).endVertex(); + TESSELLATOR.draw(); + } + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleCrosshair.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleCrosshair.java new file mode 100644 index 0000000..0cbc288 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleCrosshair.java @@ -0,0 +1,131 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.OpenGlHelper; +import org.lwjgl.opengl.GL11; + +/** + * @Module - ModuleCrosshair + * @see AbstractModule + * + * This module activates a custom crosshair in the middle of your screen. + * + * This is only useful for those weirdos who draw on their monitor. + */ +public class ModuleCrosshair extends AbstractModule { + public Setting crosshairPreviewLabel; + public Setting previewBackground; + public Setting generalOptionsLabel; + + public Setting usePackCrosshair; + public Setting outline; + public Setting dot; + public Setting thickness; + public Setting outlineThickness; + public Setting size; + public Setting gap; + public Setting dotSize; + + public Setting colorOptionsLabel; + public Setting vanillaBlending; + public Setting crosshairColor; + public Setting dotColor; + public Setting outlineColor; + + public ModuleCrosshair() { + super("Crosshair", "Normal"); + this.setDefaultState(false); + this.crosshairPreviewLabel = new Setting(this, "label").setValue("Crosshair Preview"); + this.previewBackground = new Setting(this, "Preview Background", "Change the preview background to see what the crosshair can look like in multiple environments.").setValue("Birch").acceptedStringValues("Birch", "Roofed", "Swamp", "Hills", "Desert", "Mesa", "Nether", "Sky"); + + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options"); + this.usePackCrosshair = new Setting(this, "Use Pack Crosshair").setValue(false); + this.outline = new Setting(this, "Outline", "Add an outline around the crosshair.").setValue(false).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.dot = new Setting(this, "Dot").setValue(false).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.thickness = new Setting(this, "Thickness", "Change the thickness of the crosshair.").setValue(2.0F).setMinMax(0.5F, 3.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.outlineThickness = new Setting(this, "Outline Thickness", "Change the outline thickness of the crosshair.").setValue(0.5F).setMinMax(0.5F, 3.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.outline.getValue()); + this.size = new Setting(this, "Size", "Change the size of the crosshair.").setValue(4.0F).setMinMax(1.0F, 10.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.gap = new Setting(this, "Gap", "Change how distant the cross is from the center.").setValue(2.0F).setMinMax(1.0F, 7.5F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.dotSize = new Setting(this, "Dot Size", "Change the size of the dot.").setValue(1.0F).setMinMax(0.5F, 3.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.dot.getValue()); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options"); + this.vanillaBlending = new Setting(this, "Vanilla Blending", "Make the crosshair's color invert depending on what you are looking at.").setValue(true); + this.crosshairColor = new Setting(this, "Crosshair Color", "Change the color of the crosshair.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.dotColor = new Setting(this, "Dot Color", "Change the color of the crosshair dot.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.dot.getValue()); + this.outlineColor = new Setting(this, "Outline Color", "Change the color of the crosshair outline.").setValue(0xAF000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.outline.getValue()); + this.setDescription("Replace the Vanilla crosshair with your own custom crosshair."); + } + + public void drawCrosshair(float x, float y, boolean scale) { + GL11.glPushMatrix(); + float var15 = (float) this.scale.getValue(); + if (scale) { + if (!this.guiScale.getValue().equals("Global")) { + switch ((String) this.guiScale.getValue()) { + case "Small": + var15 = var15 * 0.5F / CheatBreaker.getScaleFactor(); + break; + case "Normal": + var15 = var15 / CheatBreaker.getScaleFactor(); + break; + case "Large": + var15 = var15 * 1.5F / CheatBreaker.getScaleFactor(); + break; + case "Auto": + var15 = var15 * 2.0F / CheatBreaker.getScaleFactor(); + } + } else { + var15 = var15 * this.masterScale(); + } + } + float x2 = x / var15; + float y2 = y / var15; + GL11.glScalef(var15, var15, var15); + float size = this.size.getFloatValue(); + float gap = this.gap.getFloatValue(); + float thickness = this.thickness.getFloatValue(); + float outlineThickness = this.outlineThickness.getFloatValue(); + float dotSize = this.dotSize.getFloatValue(); + int color = this.crosshairColor.getColorValue(); + boolean outlineEnabled = this.outline.getBooleanValue(); + GL11.glColor4f((color >> 16 & 255) / 255.0f, (color >> 8 & 255) / 255.0f, (color & 255) / 255.0f, (color >> 24 & 255) / 255.0f); + this.mc.getTextureManager().bindTexture(Gui.icons); +// GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + if ((boolean) this.usePackCrosshair.getValue()) { + if ((boolean) this.vanillaBlending.getValue()) { + OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + } else { + OpenGlHelper.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + } + this.mc.ingameGUI.drawTexturedModalRect(x2 - 7, y2 - 7, 0, 0, 16, 16); + } else { + if ((boolean) this.vanillaBlending.getValue()) { + OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + } + if ((Boolean) this.dot.getValue()) { + RenderUtil.drawRoundedRect(x2 - dotSize, y2 - dotSize, x2 + dotSize, y2 + dotSize, 0.0, color); + } + RenderUtil.drawRoundedRect(x2 - gap - size, y2 - thickness / 2.0f, x2 - gap, y2 + thickness / 2.0f, 0.0, color); + RenderUtil.drawRoundedRect(x2 + gap, y2 - thickness / 2.0f, x2 + gap + size, y2 + thickness / 2.0f, 0.0, color); + RenderUtil.drawRoundedRect(x2 - thickness / 2.0f, y2 - gap - size, x2 + thickness / 2.0f, y2 - gap, 0.0, color); + RenderUtil.drawRoundedRect(x2 - thickness / 2.0f, y2 + gap, x2 + thickness / 2.0f, y2 + gap + size, 0.0, color); + if (outlineEnabled) { + Gui.drawBoxWithOutLine(x2 - gap - size, y2 - thickness / 2.0f, x2 - gap, y2 + thickness / 2.0f, outlineThickness, this.outlineColor.getColorValue(), 0); + Gui.drawBoxWithOutLine(x2 + gap, y2 - thickness / 2.0f, x2 + gap + size, y2 + thickness / 2.0f, outlineThickness, this.outlineColor.getColorValue(), 0); + Gui.drawBoxWithOutLine(x2 - thickness / 2.0f, y2 - gap - size, x2 + thickness / 2.0f, y2 - gap, outlineThickness, this.outlineColor.getColorValue(), 0); + Gui.drawBoxWithOutLine(x2 - thickness / 2.0f, y2 + gap, x2 + thickness / 2.0f, y2 + gap + size, outlineThickness, this.outlineColor.getColorValue(), 0); + if ((Boolean) this.dot.getValue()) { + Gui.drawBoxWithOutLine(x2 - dotSize, y2 - dotSize, x2 + dotSize, y2 + dotSize, outlineThickness, this.outlineColor.getColorValue(), 0); + } + } + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glPopMatrix(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnchantmentGlint.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnchantmentGlint.java new file mode 100644 index 0000000..f19920e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnchantmentGlint.java @@ -0,0 +1,64 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +/** + * @Module - ModuleEnchantmentGlint + * @see AbstractModule + * + * This module changes the Vanilla Minecraft enchantment glint. + * @implNote When this module is disabled, the enchantment glint will be disabled as well. + */ +public class ModuleEnchantmentGlint extends AbstractModule { + + public Setting inventoryGlint; + public Setting droppedItemGlint; + public Setting heldItemGlint; + public Setting armorGlint; + + public Setting droppedItemGlintColor; + public Setting inventoryGlintColor; + public Setting heldItemGlintColor; + public Setting glintColor; + public Setting armorGlintColor; + public Setting showPotionColor; + public Setting onlyRenderPotionGlint; + public Setting excludePotionGlint; + public Setting shinyPots; + public Setting boxBoundary; + + public ModuleEnchantmentGlint() { + super("Enchantment Glint"); + this.setDefaultState(true); + + // Category to toggle specific parts of enchantment glint + new Setting(this, "label").setValue("Glint Options"); + this.inventoryGlint = new Setting(this, "Inventory Glint").setValue(true).setCondition(() -> Config.MC_VERSION.equals("1.7.10")); + this.droppedItemGlint = new Setting(this, "Dropped Item Glint").setValue(true).setCondition(() -> Config.MC_VERSION.equals("1.7.10")); + this.heldItemGlint = new Setting(this, "Held Item Glint").setValue(true).setCondition(() -> Config.MC_VERSION.equals("1.7.10")); + this.armorGlint = new Setting(this, "Armor Glint").setValue(true); + + // All Shiny Pots related options + new Setting(this, "label").setValue("Potion Options").setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.inventoryGlint.getValue()); + this.showPotionColor = new Setting(this, "Show Potion Color (Inventory)").setValue(false).setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.inventoryGlint.getValue()); + this.onlyRenderPotionGlint = new Setting(this, "Only Render Potion Glint (Inventory)").setValue(false).setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.inventoryGlint.getValue()); + this.excludePotionGlint = new Setting(this, "Exclude Potion Glint (Inventory)").setValue(false).setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.inventoryGlint.getValue()); + this.shinyPots = new Setting(this, "Shiny Pots", "Show a glint box around potions.").setValue(false).setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.inventoryGlint.getValue()); + this.boxBoundary = new Setting(this, "Shiny Pots Boundary").setValue("Entire Slot").acceptedStringValues("Entire Slot", "To Border").setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.inventoryGlint.getValue() && (Boolean) this.shinyPots.getValue()); + + // All Color options + new Setting(this, "label").setValue("Color Options").setCondition(() -> !Config.MC_VERSION.equals("1.7.10") || (Boolean) this.inventoryGlint.getValue() || (Boolean) this.droppedItemGlint.getValue() || (Boolean) this.heldItemGlint.getValue() || (Boolean) this.armorGlint.getValue()); + this.inventoryGlintColor = new Setting(this, "Inventory Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.inventoryGlint.getValue()); + this.droppedItemGlintColor = new Setting(this, "Dropped Item Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.droppedItemGlint.getValue()); + this.heldItemGlintColor = new Setting(this, "Held Item Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> Config.MC_VERSION.equals("1.7.10") && (Boolean) this.heldItemGlint.getValue()); + + this.glintColor = new Setting(this, "Item Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.armorGlintColor = new Setting(this, "Armor Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.armorGlint.getValue()); + + this.setPreviewIcon(new ResourceLocation("client/icons/mods/ench_sword.png"), 32, 32); + this.setDescription("Customize the enchantment glint and/or enable shiny pots overlay."); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnvironmentChanger.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnvironmentChanger.java new file mode 100644 index 0000000..a1fc8cf --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnvironmentChanger.java @@ -0,0 +1,161 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.event.impl.keyboard.KeyboardEvent; +import com.cheatbreaker.client.event.impl.mouse.ClickEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.util.ResourceLocation; + +import java.util.Date; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +public class ModuleEnvironmentChanger extends AbstractModule { + + public Setting worldTime; + public Setting timeType; + + public Setting allowThroughBlocks; + public Setting customWeather; + public Setting weatherType; + + public Setting timeMultiplierType; + public Setting timeMultiplierDelay; + public Setting timeMultiplierAmount; + + public Setting increaseDecreaseAmount; + public Setting increaseStaticTimeKeybind; + public Setting decreaseStaticTimeKeybind; + + public Date date; + + public ModuleEnvironmentChanger() { + super("Environment Changer"); + this.setDescription("Allows you to change the environment around you to your liking."); + this.setCreators("Fyu (Time Changer)", "Sk1er (Snow)"); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/env-changer.png"), 32, 32); + + new Setting(this, "label").setValue("Time Settings"); + this.timeType = new Setting(this, "Time Type").setValue("Server").acceptedStringValues("Server", "Real Time", "Static").onChange((value) -> this.setWorldTime()); + this.worldTime = new Setting(this, "World Time").setValue(-14490).setMinMax(-22880, -6100).setShowValue(false).setCondition(() -> this.timeType.getValue().equals("Static")).onChange((value) -> { + if (this.mc.theWorld != null) + this.mc.theWorld.setWorldTime(Integer.parseInt(value.toString())); + }); + + this.timeMultiplierType = new Setting(this, "Time Multiplier Type").setValue("Vanilla").acceptedStringValues("Vanilla", "Accelerate", "Decelerate").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.timeType.getValue().equals("Static")); + this.timeMultiplierDelay = new Setting(this, "Time Multiplier Delay").setUnit("ms").setValue(300).setMinMax(300, 5000).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> this.timeType.getValue().equals("Static")); + this.timeMultiplierAmount = new Setting(this, "Time Multiplier Amount").setValue(0).setMinMax(0, 10).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.timeType.getValue().equals("Static")); + + this.increaseDecreaseAmount = new Setting(this, "Increase/Decrease Amount").setValue(100).setMinMax(1, 1000).setCondition(() -> this.timeType.getStringValue().equalsIgnoreCase("Static")).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.increaseStaticTimeKeybind = new Setting(this, "Increase Time Keybind").setValue(0).setMouseBind(false).setCondition(() -> this.timeType.getStringValue().equalsIgnoreCase("Static")).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.decreaseStaticTimeKeybind = new Setting(this, "Decrease Time Keybind").setValue(0).setMouseBind(false).setCondition(() -> this.timeType.getStringValue().equalsIgnoreCase("Static")).setCustomizationLevel(CustomizationLevel.MEDIUM); + + new Setting(this, "label").setValue("Weather Settings"); + this.allowThroughBlocks = new Setting(this, "Allow Through Blocks").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.customWeather = new Setting(this, "Custom Weather").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.weatherType = new Setting(this, "Current Weather").setValue("Clear").acceptedStringValues("Clear", "Rain", "Snow").setCondition(() -> this.customWeather.getBooleanValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(KeyboardEvent.class, this::onKeyboardPress); + this.addEvent(ClickEvent.class, this::onMousebindPress); + + Runnable increaseRate = () -> { + if (this.timeType.getStringValue().equalsIgnoreCase("Static") && this.mc.theWorld != null) { + String type = this.timeMultiplierType.getStringValue(); + if (type.equalsIgnoreCase("Vanilla")) return; + + if (type.equalsIgnoreCase("Accelerate")) { + this.mc.theWorld.setWorldTime(this.mc.theWorld.getWorldTime() * this.timeMultiplierAmount.getIntegerValue()); + } + + if (type.equalsIgnoreCase("Decelerate")) { + this.mc.theWorld.setWorldTime(this.mc.theWorld.getWorldTime() / this.timeMultiplierAmount.getIntegerValue()); + } + try { + Thread.sleep(this.timeMultiplierDelay.getIntegerValue()); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + }; + + ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); + scheduler.scheduleAtFixedRate(increaseRate, 1, 1, TimeUnit.MILLISECONDS); + } + + private void onTick(TickEvent event) { + if (this.mc.theWorld != null && this.timeType.getValue().equals("Real Time")) { + this.mc.theWorld.setWorldTime(this.getRealWorldTime()); + } + } + + public boolean isSnowOrNone() { + return this.weatherType.getStringValue().equals("Clear") || this.weatherType.getStringValue().equals("Snow"); + } + + private void onKeyboardPress(KeyboardEvent event) { + // amounts + long increaseAmount = Integer.parseInt(this.worldTime.getValue().toString()) + this.increaseDecreaseAmount.getIntegerValue(); + long decreaseAmount = Integer.parseInt(this.worldTime.getValue().toString()) - this.increaseDecreaseAmount.getIntegerValue(); + + if (this.timeType.getStringValue().equalsIgnoreCase("Static")) { + if (event.getPressed() == this.increaseStaticTimeKeybind.getIntegerValue()) { + if (this.mc.theWorld != null) { + if (increaseAmount > -6100) { + return; + } +// System.out.println("increaseAmount > -6100=" + (increaseAmount > -6100)); +// System.out.println("getValue=" + Integer.parseInt(this.worldTime.getValue().toString())); +// System.out.println("getWorldTime=" + this.mc.theWorld.getWorldTime()); + this.worldTime.setValue(Integer.parseInt(this.worldTime.getValue().toString()) + this.increaseDecreaseAmount.getIntegerValue()); + this.mc.theWorld.setWorldTime(increaseAmount); + } + } + + if (event.getPressed() == this.decreaseStaticTimeKeybind.getIntegerValue()) { + if (this.mc.theWorld != null) { + if (decreaseAmount < -22880) { + return; + } +// System.out.println("decreaseAmount > -22880=" + (-decreaseAmount > -22880)); +// System.out.println("getValue=" + -Integer.parseInt(this.worldTime.getValue().toString())); +// System.out.println("getWorldTime=" + -this.mc.theWorld.getWorldTime()); + this.worldTime.setValue(Integer.parseInt(this.worldTime.getValue().toString()) - this.increaseDecreaseAmount.getIntegerValue()); + this.mc.theWorld.setWorldTime(decreaseAmount); + } + } + } + } + + private void onMousebindPress(ClickEvent event) { + if (this.timeType.getStringValue().equalsIgnoreCase("Static")) { + if (event.getMouseButton() == this.increaseStaticTimeKeybind.getIntegerValue()) { + this.worldTime.setValue(this.worldTime.getIntegerValue() + 100); + } + if (event.getMouseButton() == this.increaseStaticTimeKeybind.getIntegerValue()) { + this.worldTime.setValue(this.worldTime.getIntegerValue() - 100); + } + } + } + + // gets the real time converted into Minecraft time + private int getRealWorldTime() { + if (this.date == null) this.date = new Date(); + this.date.setTime(System.currentTimeMillis()); + int hour = this.date.getHours() - 6; + if (hour <= 0) hour += 24; + return (int)(hour * 1000 + (this.date.getSeconds() + this.date.getMinutes() * 60) / 3.6); + } + + public void setWorldTime() { + if (this.mc.theWorld == null) return; + + if (this.timeType.getValue().equals("Real Time")) { + this.mc.theWorld.setWorldTime(this.getRealWorldTime()); + } else if (this.timeType.getValue().equals("Static")) { + this.mc.theWorld.setWorldTime(this.worldTime.getIntegerValue()); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitColor.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitColor.java new file mode 100644 index 0000000..4cf3498 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitColor.java @@ -0,0 +1,36 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.util.ResourceLocation; + +/** + * @Module - ModuleHitColor + * @see AbstractModule + * + * Changes the Vanilla Minecraft entity hit color. + */ +public class ModuleHitColor extends AbstractModule { + public Setting affectArmor; + public Setting affectedBrightness; + public Setting hitColor; + public Setting fade; + + public ModuleHitColor() { + super("Hit Color"); + this.setDefaultState(true); + + new Setting(this, "label").setValue("General Options"); + affectArmor = new Setting(this, "Affect Armor").setValue(true); + affectedBrightness = new Setting(this, "Affected by brightness").setValue(true); + fade = new Setting(this, "Animation Type").setValue("None").acceptedStringValues("None", "Linear In/Out", "Linear Out"); + + // All Color options + new Setting(this, "label").setValue("Color Options"); + hitColor = new Setting(this, "Hit Color").setValue(0x66FF0000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.setDescription("Customize the damage tint overlay on entities."); + this.setCreators("aycy (Fade animation)"); + this.setAliases("Damage Tint"); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/hittint.png"), 32, 32); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitboxes.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitboxes.java new file mode 100644 index 0000000..3e34d4a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitboxes.java @@ -0,0 +1,22 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; + +public class ModuleHitboxes extends AbstractModule { + + public final Setting showOwnHitbox; + public final Setting ownHitboxColor; + public final Setting color; + + public ModuleHitboxes() { + super("Hitboxes"); + this.showOwnHitbox = new Setting(this, "Show Own Hitbox").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.ownHitboxColor = new Setting(this, "Own Hitbox Color").setValue(-1) + .setCondition(this.showOwnHitbox::getBooleanValue).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.color = new Setting(this, "Hitbox Color").setValue(-1).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.setPreviewLabel("Hitboxes", 1.0F); + } + +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleNameTag.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleNameTag.java new file mode 100644 index 0000000..758a901 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleNameTag.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; + +/** + * @Module - ModuleNametag + * @see AbstractModule + * + * This module changes the Vanilla Minecraft NameTag for players. + */ +public class ModuleNameTag extends AbstractModule { + + private final String[] disallowedCharacters = new String[]{ " ", "[", "]", "!", "=", "-", "@", "#", "$", "%", "^", "&", "*", "(", ")", "~", "`", "|", ";", ":", "'", "\"", ",", "<", ">", ".", "?", "/" }; + + public Setting hideNamePlatesKeybind; + public Setting generalOptionsLabel; + public Setting background; + public Setting textShadow; + public Setting showCheatBreakerLogo; + public Setting showOwnNametag; + public Setting showNametagsInF1; + + public Setting colorOptionsLabel; + public Setting customTextColor; + public Setting textColor; + public Setting backgroundColor; + + public ModuleNameTag() { + super("Nametag"); + this.setDefaultState(true); + this.hideNamePlatesKeybind = new Setting(this, "Hide Nametags Keybind").setValue(0).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options"); + this.background = new Setting(this, "Show Background").setValue(true); + this.textShadow = new Setting(this, "Text Shadow").setValue(false); + this.showCheatBreakerLogo = new Setting(this, "Show CheatBreaker Logo").setValue(true); + this.showOwnNametag = new Setting(this, "Shown own Nametag").setValue(false); + this.showNametagsInF1 = new Setting(this, "Show Nametags when GUI is hidden").setValue(false); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options"); + this.customTextColor = new Setting(this, "Custom Text Color").setValue(false); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.customTextColor.getValue()); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x40000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.background.getValue()); + this.setDescription("Displays the username above players."); + } + + public boolean meetsIconRequirements(String username) + { + for (String str : this.disallowedCharacters) { + if (username.contains(str)) return false; + } + return true; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleParticles.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleParticles.java new file mode 100644 index 0000000..7b8b9a5 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleParticles.java @@ -0,0 +1,64 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; + +/** + * @Module - ModuleParticles + * @see AbstractModule + * + * This module changes the Vanilla Minecraft particles rendering. + */ +public class ModuleParticles extends AbstractModule { + private final Setting generalParticlesLabel; + public Setting sprintingParticles; + public Setting blockBreakingParticles; + public Setting lazyParticleLoading; + public Setting lazyParticleLoadingAmount; + + private final Setting attackParticlesLabel; + public Setting sharpnessParticles; + public Setting sharpnessParticlesMultiplier; + public Setting critParticles; + public Setting critParticlesMultiplier; + public Setting damaged; + public Setting attacking; + + private final Setting potionParticlesLabel; + public Setting splashParticles; + public Setting instantEffectSplashOpacity; + public Setting normalEffectSplashOpacity; + public Setting activeEffectParticles; + public Setting activeEffectOpacity; + public Setting activeEffectAmbientOpacity; + + + public ModuleParticles() { + super("Particles"); + this.generalParticlesLabel = new Setting(this, "label").setValue("General Particles"); + this.sprintingParticles = new Setting(this, "Show Sprinting Particles").setValue(true); + this.blockBreakingParticles = new Setting(this, "Show Block Breaking Particles").setValue(true); + this.lazyParticleLoading = new Setting(this, "Lazily Load Particles").setValue(false); + this.lazyParticleLoadingAmount = new Setting(this, "Lazy Particle Amount").setValue(5.0f).setMinMax(0.1f, 10.0f).setUnit("x"); + this.attackParticlesLabel = new Setting(this, "label").setValue("Attack Particles"); + this.damaged = new Setting(this, "Show When Damaged").setValue("Override").acceptedStringValues("OFF", "Vanilla", "Override"); + this.attacking = new Setting(this, "Show When Attacking").setValue("Override").acceptedStringValues("OFF", "Vanilla", "Override"); + this.sharpnessParticles = new Setting(this, "Sharpness Particles").setValue("Vanilla").acceptedStringValues("Never", "Vanilla", "Always").setCondition(() -> this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override")); + this.sharpnessParticlesMultiplier = new Setting(this, "Sharpness Multiplier").setValue(1.0f).setMinMax(0.1f, 10.0f).setUnit("x").setCondition(() -> !this.sharpnessParticles.getValue().equals("Never") && (this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override"))); + this.critParticles = new Setting(this, "Crit Particles").setValue("Vanilla").acceptedStringValues("Never", "Vanilla", "Always").setCondition(() -> this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override")); + this.critParticlesMultiplier = new Setting(this, "Crit Multiplier").setValue(1.0f).setMinMax(0.1f, 10.0f).setUnit("x").setCondition(() -> !this.critParticles.getValue().equals("Never") && (this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override"))); + + this.potionParticlesLabel = new Setting(this, "label").setValue("Effect Particles"); + this.splashParticles = new Setting(this, "Show Splash Particles").setValue(true); + this.instantEffectSplashOpacity = new Setting(this, "Instant Splash Opacity").setValue(100.0f).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.splashParticles.getValue()); + this.normalEffectSplashOpacity = new Setting(this, "Normal Splash Opacity").setValue(100.0f).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.splashParticles.getValue()); + + this.activeEffectParticles = new Setting(this, "Show Active Effect Particles").setValue(true); + this.activeEffectOpacity = new Setting(this, "Active Effect Opacity").setValue(100.0f).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.activeEffectParticles.getValue()); + this.activeEffectAmbientOpacity = new Setting(this, "Ambient Effect Opacity").setValue(15.0F).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.activeEffectParticles.getValue()); + + this.setPreviewLabel("Particles", 1.0F); + this.setDescription("Change how particles appear."); + this.setCreators("dewgs (Multipliers)"); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/ResourcePackManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/ResourcePackManager.java new file mode 100644 index 0000000..3bb56e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/ResourcePackManager.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.module.impl.packmanager; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.InitializationEvent; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import com.cheatbreaker.client.module.impl.packmanager.utils.ThreadUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Objects; + +/** + * @Module - ResourcePackManager + * + * This module completely changes the Resource Pack Menu, and how it loads packs. + */ +public class ResourcePackManager { + private final Minecraft mc = Minecraft.getMinecraft(); + + public ResourcePackManager() { + CheatBreaker.getInstance().getEventBus().addEvent(InitializationEvent.class, this::onInit); + } + + public void onInit(InitializationEvent event) { + HashMap activeEntries = new HashMap(); + for (String packName : this.mc.gameSettings.resourcePacks) { + activeEntries.put(packName, null); + } + for (ResourcePackRepository.Entry entry : this.mc.getResourcePackRepository().getRepositoryEntries()) { + activeEntries.put(entry.getResourcePackName(), entry); + } + for (ResourcePackRepository.Entry entry : PackUtils.getActiveEntries()) { + activeEntries.put(entry.getResourcePackName(), entry); + } + activeEntries.values().removeIf(Objects::isNull); + this.mc.getResourcePackRepository().setRepositories(new ArrayList<>(activeEntries.values())); + this.mc.refreshResources(); + Runtime.getRuntime().addShutdownHook(new Thread(ThreadUtils::shutdown)); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksFolder.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksFolder.java new file mode 100644 index 0000000..5b4a2e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksFolder.java @@ -0,0 +1,58 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components; + + +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import lombok.Getter; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +@Getter +public class ResourcePacksFolder { + private final String name; + private final List entries; + private final List selectedEntries; + private final List packFolders; + private final ResourcePacksFolder previousPackFolder; + + public ResourcePacksFolder(File directory, List selectedEntries) { + this(directory, selectedEntries, null); + } + + private ResourcePacksFolder(File directory, List selectedEntries, ResourcePacksFolder previousPackFolder) { + this.name = directory.getName(); + this.entries = new ArrayList(); + this.selectedEntries = selectedEntries; + this.packFolders = new ArrayList(); + this.previousPackFolder = previousPackFolder; + this.packFolders.add(new ResourcePacksFolder(previousPackFolder)); + for (File file : Objects.requireNonNull(directory.listFiles())) { + + if (PackUtils.isResourcePack(file)) { + for (final ResourcePackRepository.Entry entry : this.selectedEntries) { + if (entry.getResourcePackName().equals(file.getName())) { + final Optional newEntry = PackUtils.createEntry(file); + if (newEntry.isPresent() && newEntry.get().equals(entry)) { + break; + } + } + } + PackUtils.createEntry(file).ifPresent(this.entries::add); + } else if (PackUtils.isResourcePackDirectory(file)) { + this.packFolders.add(new ResourcePacksFolder(file, selectedEntries, this)); + } + } + } + + private ResourcePacksFolder(ResourcePacksFolder previousPackFolder) { + this.name = "Back to " + (previousPackFolder == null ? "Main Folder" : previousPackFolder.name); + this.entries = new ArrayList(); + this.selectedEntries = new ArrayList(); + this.packFolders = new ArrayList(); + this.previousPackFolder = previousPackFolder; + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksWatcher.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksWatcher.java new file mode 100644 index 0000000..6321787 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksWatcher.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; + +import java.io.File; +import java.io.IOException; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; + +public class ResourcePacksWatcher { + private WatchService watchService; + + public ResourcePacksWatcher(Path root) { + try { + this.watchService = FileSystems.getDefault().newWatchService(); + Files.walkFileTree(root, new SimpleFileVisitor() { + + @Override + public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attributes) throws IOException { + File file = path.toFile(); + if (PackUtils.isResourcePackDirectory(file)) { + path.register(ResourcePacksWatcher.this.watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE); + return FileVisitResult.CONTINUE; + } + if (PackUtils.isResourcePack(file)) { + return FileVisitResult.SKIP_SUBTREE; + } + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to create watch service", exception); + } + } + + public boolean hasEvent() { + WatchKey watchKey; + boolean eventOccurred = false; + if (this.watchService != null && (watchKey = this.watchService.poll()) != null) { + for (WatchEvent event : watchKey.pollEvents()) { + File file = ((Path) watchKey.watchable()).resolve(event.context().toString()).toFile(); + if (!PackUtils.isResourcePack(file) && !PackUtils.isResourcePackDirectory(file)) continue; + eventOccurred = true; + break; + } + watchKey.reset(); + } + return eventOccurred; + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksAvailable.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksAvailable.java new file mode 100644 index 0000000..d042f96 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksAvailable.java @@ -0,0 +1,106 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksFolder; +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import com.cheatbreaker.client.module.impl.packmanager.utils.GuiUtils; +import com.cheatbreaker.client.util.GlStateManager; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.ResourceLocation; + +import java.util.List; + +public class GuiResourcePacksAvailable extends GuiResourcePacksList { + private static final ResourceLocation FOLDER_ICON = new ResourceLocation("client/icons/folder.png"); + private final List packFolders; + private final boolean showPackFolders; + + public GuiResourcePacksAvailable(GuiResourcePacks parentScreen, int x, int y, int width, int height, int slotHeight, List entries, List packFolders, boolean showPackFolders) { + super(parentScreen, x, y, width, height, slotHeight, I18n.format("resourcePack.available.title"), entries); + this.packFolders = packFolders; + this.showPackFolders = showPackFolders; + } + + @Override + protected void drawSlot(int index, int right, int top, int buffer, int mouseX, int mouseY, boolean hovered) { + if (hovered) { + Gui.drawRect(this.left, top - 1, right + 1, top + buffer + 3, -2134851392); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + } + if (this.showPackFolders) { + if (0 <= index && index < this.packFolders.size()) { + this.drawResourcePackDirectory(this.packFolders.get(index), top); + } else if (this.packFolders.size() <= index && index < this.getSize()) { + super.drawSlot(index - this.packFolders.size(), right, top, buffer, mouseX, mouseY, hovered); + } + } else if (0 <= index && index < this.getSize()) { + super.drawSlot(index, right, top, buffer, mouseX, mouseY, hovered); + } + } + + private void drawResourcePackDirectory(ResourcePacksFolder packFolder, int top) { + boolean showFolderIcons = (Boolean) CheatBreaker.getInstance().getGlobalSettings().packFolderIcons.getValue(); + if (showFolderIcons) { + this.mc.getTextureManager().bindTexture(FOLDER_ICON); + GlStateManager.enableBlend(); + Gui.drawScaledCustomSizeModalRect(this.left + 2, top + 3, 0.0f, 0.0f, 256, 256, 32, 32, 256.0f, 256.0f); + GlStateManager.disableBlend(); + } + this.mc.fontRendererObj.drawString(GuiUtils.trimString(packFolder.getName(), this.listWidth - 46), (float) this.left + (showFolderIcons ? 36.0f : 2.0f), (float) top + 2.0f, -1, true); + int packFolders = packFolder.getPackFolders().size() - 1; + if (packFolders != -1 && (Boolean) CheatBreaker.getInstance().getGlobalSettings().packFolderInfo.getValue()) { + int entries; + String text; + float y = (float) top + 13.0f; + if (packFolders != 0) { + text = GuiUtils.trimString(packFolders + (packFolders == 1 ? " Subfolder" : " Subfolders"), this.listWidth - 46); + this.mc.fontRendererObj.drawString(text, (float) this.left + (showFolderIcons ? 36.0f : 2.0f), y, -5592406, true); + y += 10.0f; + } + if ((entries = packFolder.getEntries().size()) != 0) { + text = GuiUtils.trimString(entries + (entries == 1 ? " Pack" : " Packs"), this.listWidth - 46); + this.mc.fontRendererObj.drawString(text, (float) this.left + (showFolderIcons ? 36.0f : 2.0f), y, -5592406, true); + } + } + } + + @Override + protected void onClick(int index, boolean doubleClick) { + if (this.showPackFolders) { + if (0 <= index && index < this.packFolders.size()) { + this.onClickResourcePackDirectory(this.packFolders.get(index), index == 0); + } else if (this.packFolders.size() <= index && index < this.getSize()) { + this.onClickResourcePackEntry(this.entries.get(index - this.packFolders.size())); + } + } else if (0 <= index && index < this.getSize()) { + this.onClickResourcePackEntry(this.entries.get(index)); + } + } + + private void onClickResourcePackEntry(ResourcePackRepository.Entry entry) { + if (this.parentScreen.addSelectedEntry(entry)) { + this.entries.remove(entry); + } + } + + private void onClickResourcePackDirectory(ResourcePacksFolder packFolder, boolean back) { + if (back) { + if (packFolder.getName().equals("Back to Main Folder")) { + this.parentScreen.setAvailablePacks(null); + } else if (packFolder.getPreviousPackFolder() != null) { + this.parentScreen.setAvailablePacks(packFolder.getPreviousPackFolder()); + } else { + this.parentScreen.setAvailablePacks(packFolder); + } + } else { + this.parentScreen.setAvailablePacks(packFolder); + } + } + + @Override + protected int getSize() { + return this.showPackFolders ? this.entries.size() + this.packFolders.size() : this.entries.size(); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksList.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksList.java new file mode 100644 index 0000000..e5f0d86 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksList.java @@ -0,0 +1,66 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import com.cheatbreaker.client.module.impl.packmanager.utils.GuiUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.util.Collections; +import java.util.List; + +public abstract class GuiResourcePacksList extends GuiScrollingList { + protected final GuiResourcePacks parentScreen; + protected final Minecraft mc; + public final List entries; + + public GuiResourcePacksList(GuiResourcePacks parentScreen, int x, int y, int width, int height, int slotHeight, String title, List entries) { + super(parentScreen.mc, x, y, width, height, slotHeight, title); + this.parentScreen = parentScreen; + this.mc = parentScreen.mc; + this.entries = entries; + } + + @Override + protected void drawBackground() { + Gui.drawRect(this.left, this.top, this.right, this.bottom, CheatBreaker.getInstance().getGlobalSettings().packListBackgroundColor.getColorValue()); + } + + @Override + protected void drawSlot(int index, int right, int top, int buffer, int mouseX, int mouseY, boolean hovered) { + if (0 <= index && index < this.getSize()) { + ResourcePackRepository.Entry entry = this.entries.get(index); + boolean showPackIcons = (Boolean) CheatBreaker.getInstance().getGlobalSettings().packIcons.getValue(); + if (showPackIcons) { + entry.bindTexturePackIcon(this.mc.getTextureManager()); + Gui.drawModalRectWithCustomSizedTexture(this.left + 2, top + 1, 0.0f, 0.0f, 32, 32, 32.0f, 32.0f); + } + this.mc.fontRendererObj.drawString(GuiUtils.trimString(entry.getResourcePackName(), + this.listWidth - 46), (float) this.left + (showPackIcons ? 36.0f : 2.0f), (float) top + 2.0f, -1, true); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().packDescriptions.getValue()) { + List lines = this.mc.fontRendererObj.listFormattedStringToWidth(entry.getTexturePackDescription(), this.listWidth - 46); + for (int i = 0; i < lines.size(); ++i) { + String text = lines.get(i); + if (i == 1 && lines.size() > 2) { + text = GuiUtils.trimString(text, this.listWidth - 46); + } + this.mc.fontRendererObj.drawString(text, (float) this.left + (showPackIcons ? 36.0f : 2.0f), (float) top + 13.0f + 10.0f * (float) i, -5592406, true); + if (i == 1) break; + } + } + } + } + + @Override + protected abstract void onClick(int var1, boolean var2); + + @Override + protected int getSize() { + return this.entries.size(); + } + + public List getEntries() { + return Collections.unmodifiableList(this.entries); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksSelected.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksSelected.java new file mode 100644 index 0000000..a0b87e9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksSelected.java @@ -0,0 +1,156 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksFolder; +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import com.cheatbreaker.client.util.GlStateManager; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.ResourceLocation; + +import java.io.File; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +public class GuiResourcePacksSelected extends GuiResourcePacksList { + private static final ResourceLocation RESOURCE_PACK_TEXTURES = new ResourceLocation("textures/gui/resource_packs.png"); + private final GuiResourcePacks parentScreen; + private Action action; + + public GuiResourcePacksSelected(GuiResourcePacks parentScreen, int x, int y, int width, int height, int slotHeight, List entries) { + super(parentScreen, x, y, width, height, slotHeight, I18n.format("resourcePack.selected.title"), entries); + this.parentScreen = parentScreen; + this.action = Action.MOVE_BACK; + } + + @Override + protected void drawSlot(int index, int right, int top, int buffer, int mouseX, int mouseY, boolean hovered) { + if (hovered) { + Gui.drawRect(this.left, top - 1, right + 1, top + buffer + 3, -2134851392); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + } + super.drawSlot(index, right, top, buffer, mouseX, mouseY, hovered); + if (hovered) { + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.getTextureManager().bindTexture(RESOURCE_PACK_TEXTURES); + if (right - 40 <= mouseX && mouseX < right) { + if (top <= mouseY && mouseY < top + buffer / 2 - 2) { + if (index == 0) { + if (this.action == Action.MOVE_DOWN) { + this.action = Action.MOVE_BACK; + } + } else { + this.action = Action.MOVE_UP; + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 96.0f, 32.0f, 32, 32, 256.0f, 256.0f); + } + if (index != super.getSize() - 1) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 64.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + } else { + if (index != 0) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 96.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + if (index == super.getSize() - 1) { + if (this.action == Action.MOVE_UP) { + this.action = Action.MOVE_BACK; + } + } else { + this.action = Action.MOVE_DOWN; + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 64.0f, 32.0f, 32, 32, 256.0f, 256.0f); + } + } + } else { + this.action = Action.MOVE_BACK; + if (index != 0) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 96.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + if (index != super.getSize() - 1) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 64.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + } + } + } + + @Override + protected void onClick(int index, boolean doubleClick) { + if (0 <= index && index < super.getSize()) { + switch (this.action) { + case MOVE_UP: + if (index - 1 < 0) break; + Collections.swap(this.entries, index, index - 1); + break; + case MOVE_DOWN: + if (index + 1 >= super.getSize()) break; + Collections.swap(this.entries, index, index + 1); + break; + default: + ResourcePackRepository.Entry entry = this.entries.get(index); + this.refreshEntry(entry); + this.entries.remove(entry); + } + } + } + + private void refreshEntry(ResourcePackRepository.Entry entry) { + for (File file : Objects.requireNonNull(this.mc.getResourcePackRepository().getDirResourcepacks().listFiles())) { + if (PackUtils.isResourcePack(file)) { + Optional newEntry; + if (!file.getName().equals(entry.getResourcePackName()) || !(newEntry = PackUtils.createEntry(file)).isPresent() || !newEntry.get().equals(entry)) + continue; + if (this.parentScreen.isSearching()) { + ((GuiResourcePacksList) this).parentScreen.addSearchedPack(entry); + continue; + } + ((GuiResourcePacksList) this).parentScreen.addAvailableEntry(entry); + continue; + } + if (!PackUtils.isResourcePackDirectory(file)) continue; + this.refreshEntry(file, entry); + } + } + + private void refreshEntry(File directory, ResourcePackRepository.Entry entry) { + for (File file : Objects.requireNonNull(directory.listFiles())) { + if (PackUtils.isResourcePack(file)) { + Optional newEntry; + if (!file.getName().equals(entry.getResourcePackName()) || !(newEntry = PackUtils.createEntry(file)).isPresent() || !newEntry.get().equals(entry)) + continue; + for (ResourcePacksFolder packFolder : this.parentScreen.getPackFolders()) { + this.refreshEntry(packFolder, directory, entry); + } + continue; + } + if (!PackUtils.isResourcePackDirectory(file)) continue; + this.refreshEntry(file, entry); + } + } + + private void refreshEntry(ResourcePacksFolder packFolder, File directory, ResourcePackRepository.Entry entry) { + if (packFolder.getName().equals(directory.getName())) { + if (this.parentScreen.isSearching()) { + if (packFolder.getEntries().contains(entry)) { + ((GuiResourcePacksList) this).parentScreen.addSearchedPack(entry); + } + } else { + if (!packFolder.getEntries().contains(entry)) { + packFolder.getEntries().add(entry); + } + this.parentScreen.sortAvailableEntries(packFolder.getEntries()); + } + } else { + for (ResourcePacksFolder packSubfolder : packFolder.getPackFolders()) { + this.refreshEntry(packSubfolder, directory, entry); + } + } + } + + enum Action { + MOVE_UP, + MOVE_DOWN, + MOVE_BACK + + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiScrollingList.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiScrollingList.java new file mode 100644 index 0000000..8f1a73b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiScrollingList.java @@ -0,0 +1,180 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public abstract class GuiScrollingList { + protected final Minecraft mc; + public final int listWidth; + public final int listHeight; + public final int top; + public final int bottom; + public final int right; + public final int left; + public final String title; + protected final int slotHeight; + protected int selectedIndex; + private int scrollIndex; + private int scrollDirection; + private float initialMouseClickY; + private float scrollFactor; + private float scrollDistance; + private boolean hovering; + private long lastClickTime; + private final double[] scrollCache; + + public GuiScrollingList(Minecraft mc, int x, int y, int listWidth, int listHeight, int slotHeight, String title) { + this.mc = mc; + this.listWidth = listWidth; + this.listHeight = listHeight; + this.left = x; + this.top = y; + this.right = x + listWidth; + this.bottom = y + listHeight; + this.slotHeight = slotHeight; + this.title = title; + this.selectedIndex = -1; + this.scrollIndex = -1; + this.initialMouseClickY = -2.0f; + this.scrollCache = new double[]{5.088448, 4.809692672, 3.4292885120000003, 3.268147903999999, 2.697228288, 2.019487744, 1.8882322560000002, 1.6936698879999996, 1.4352491520000008, 1.2045501440000006, 0.7097322879999997, 0.5842770560000003, 0.5043583360000001, 0.37950342400000014, 0.282300416, 0.21170873600000029, 0.09733600000000031, 0.08991539199999998, 0.06209913599999961, 0.030371328000000197, 0.01452678400000007, 0.006229504000000219, 0.0017279999999999518}; + } + + protected abstract void drawBackground(); + + protected abstract void drawSlot(int var1, int var2, int var3, int var4, int var5, int var6, boolean var7); + + protected abstract void onClick(int var1, boolean var2); + + protected abstract int getSize(); + + public void draw(int mouseX, int mouseY) { + int top; + this.drawBackground(); + this.hovering = this.left <= mouseX && mouseX <= this.left + this.listWidth && this.top <= mouseY && mouseY <= this.bottom; + int listLength = this.getSize(); + int scrollBarWidth = 6; + int scrollBarRight = this.left + this.listWidth; + int scrollBarLeft = scrollBarRight - 6; + int slotRight = scrollBarLeft - 1; + int viewHeight = this.bottom - this.top; + int border = 4; + if (Mouse.isButtonDown(0)) { + if (this.initialMouseClickY == -1.0f) { + if (this.hovering) { + int mouseListY = mouseY - this.top + (int) this.scrollDistance - 4; + int slotIndex = mouseListY / this.slotHeight; + if (0 <= slotIndex && slotIndex < listLength && mouseX <= slotRight && 0 <= mouseListY) { + this.onClick(slotIndex, slotIndex == this.selectedIndex && System.currentTimeMillis() - this.lastClickTime < 500L); + this.selectedIndex = this.selectedIndex == slotIndex ? -1 : slotIndex; + this.lastClickTime = System.currentTimeMillis(); + } + if (scrollBarLeft <= mouseX && mouseX <= scrollBarRight) { + this.scrollFactor = -1.0f; + int scrollHeight = this.getContentHeight() - viewHeight - 4; + if (scrollHeight < 1) { + scrollHeight = 1; + } + if ((top = (int) ((float) (viewHeight * viewHeight) / (float) this.getContentHeight())) < 32) { + top = 32; + } + if (top > viewHeight - 8) { + top = viewHeight - 8; + } + this.scrollFactor /= (float) (viewHeight - top) / (float) scrollHeight; + } else { + this.scrollFactor = 1.0f; + } + this.initialMouseClickY = mouseY; + } else { + this.initialMouseClickY = -2.0f; + } + } else if (this.initialMouseClickY >= 0.0f) { + this.scrollDistance -= ((float) mouseY - this.initialMouseClickY) * this.scrollFactor; + this.initialMouseClickY = mouseY; + } + } else { + if (this.scrollIndex != -1) { + this.scrollDistance = (float) ((double) this.scrollDistance + this.scrollCache[this.scrollIndex] * (double) this.scrollDirection * 2.0); + ++this.scrollIndex; + if (this.scrollIndex >= this.scrollCache.length) { + this.scrollIndex = -1; + } + } + this.initialMouseClickY = -1.0f; + } + this.applyScrollLimits(); + int baseY = this.top + 2 - (int) this.scrollDistance; + for (int index = 0; index < listLength; ++index) { + int slotTop = baseY + index * this.slotHeight; + int slotBuffer = this.slotHeight - 4; + int slotBottom = slotTop + slotBuffer + 2; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(3042); + GL11.glPushMatrix(); + GL11.glEnable(3089); + ScaledResolution res = new ScaledResolution(this.mc); + RenderUtil.startMCScaledScissorBox(this.left, this.top + 1, this.right, this.bottom, res); + this.drawSlot(index, slotRight, slotTop, slotBuffer, mouseX, mouseY, this.left <= mouseX && mouseX < slotRight && slotTop - 2 <= mouseY && mouseY < slotBottom); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + int extraHeight = this.getContentHeight() - viewHeight - 4; + if (extraHeight > 0) { + int height = viewHeight * viewHeight / this.getContentHeight(); + if (height < 32) { + height = 32; + } + if (height > viewHeight - 8) { + height = viewHeight - 8; + } + if ((top = (int) this.scrollDistance * (viewHeight - height) / extraHeight + this.top) < this.top) { + top = this.top; + } + Gui.drawRect(scrollBarLeft, top, scrollBarRight, top + height, -4144960); + } + GlStateManager.shadeModel(7424); + GL11.glEnable(3553); + GL11.glEnable(3008); + Gui.zLevel = 1; + this.mc.ingameGUI.drawGradientRect(this.left, this.top, scrollBarRight, this.top + 5, -16777216, 0); + this.mc.ingameGUI.drawGradientRect(this.left, this.bottom - 5, scrollBarRight, this.bottom, 0, -16777216); + Gui.zLevel = -90; + } + + public void handleMouseInput() { + int scroll; + if (this.hovering && (scroll = Mouse.getEventDWheel()) != 0) { + scroll = scroll > 0 ? -1 : 1; + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().packSmoothScrolling.getValue()) { + this.scrollDirection = scroll; + this.scrollIndex = 0; + } else { + this.scrollDistance += (float) (scroll * this.slotHeight / 2); + } + } + } + + private void applyScrollLimits() { + int listHeight = this.getContentHeight() - (this.bottom - this.top - 4); + if (listHeight < 0) { + listHeight /= 2; + } + if (this.scrollDistance > (float) listHeight) { + this.scrollDistance = listHeight; + } + if (this.scrollDistance < 0.0f) { + this.scrollDistance = 0.0f; + } + } + + protected int getContentHeight() { + return this.getSize() * this.slotHeight; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/screen/GuiResourcePacks.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/screen/GuiResourcePacks.java new file mode 100644 index 0000000..fc72679 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/screen/GuiResourcePacks.java @@ -0,0 +1,353 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.screen; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksFolder; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksWatcher; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.list.GuiResourcePacksAvailable; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.list.GuiResourcePacksSelected; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import com.cheatbreaker.client.module.impl.packmanager.utils.ThreadUtils; +import com.google.common.collect.Lists; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.*; + +public class GuiResourcePacks extends GuiScreen { + private static final Comparator ENTRY_COMPARATOR = (entry1, entry2) -> { + return StringUtils.stripControlCodes(entry1.getResourcePackName()).trim().compareToIgnoreCase( + StringUtils.stripControlCodes(entry2.getResourcePackName()).trim()); + }; + private static final Comparator FOLDER_COMPARATOR = (folder1, folder2) -> { + return StringUtils.stripControlCodes(folder1.getName()).trim().compareToIgnoreCase(StringUtils.stripControlCodes(folder2.getName()).trim()); + }; + private final GuiScreen previousScreen; + private final ResourcePackRepository packsRepo; + private final List initialSelectedEntries; + private List availableEntries; + private final List selectedEntries; + private final List searchedEntries; + private final List packFolders; + private ResourcePacksWatcher packsWatcher; + private ResourcePacksFolder activePackFolder; + private GuiResourcePacksAvailable availablePacks; + private GuiResourcePacksSelected selectedPacks; + private GuiButton buttonFolder; + private GuiButton buttonDone; + private GuiTextField searchBar; + private boolean load; + private GuiButton clearGlassButton; + private GuiButton redStringButton; + private GuiButton backgroundButton; + + public GuiResourcePacks(GuiScreen previousScreen) { + this.previousScreen = previousScreen; + this.packsRepo = previousScreen.mc.getResourcePackRepository(); + this.availableEntries = new ArrayList(); + this.searchedEntries = new ArrayList(); + this.selectedEntries = new ArrayList(Lists.reverse(this.packsRepo.getRepositoryEntries())); + this.initialSelectedEntries = Collections.unmodifiableList(new ArrayList(this.selectedEntries)); + this.packFolders = new ArrayList(); + ThreadUtils.execute(() -> { + this.packsRepo.updateRepositoryEntriesAll(); + this.refreshPackFolders(); + this.packsWatcher = new ResourcePacksWatcher(this.packsRepo.getDirResourcepacks().toPath()); + this.load = true; + }); + } + + public void initGui() { + int listWidth = (this.width - 30) / 2; + int listHeight = this.height - 80 - 46; + boolean wide = (Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue(); + int wideWidth = wide ? this.width - listWidth - 12 : this.width / 2 + 4; + int wideWidth2 = wide ? listWidth + 2 : 200; + int wideWidth3 = wide ? listWidth + 2 : 200; + this.setAvailablePacks(this.activePackFolder); + this.selectedPacks = new GuiResourcePacksSelected(this, wideWidth, 32, wideWidth2, listHeight + (wide && this.width / 2 > 338 ? 20 : 0), 36, this.selectedEntries); + this.buttonFolder = new GuiButton(0, this.width / 2 - 154, this.height - 48, 150, 20, I18n.format("resourcePack.openFolder")); + this.buttonList.add(this.buttonFolder); + this.buttonDone = new GuiButton(2, wideWidth, this.height - 48, 200, 20, I18n.format("gui.done")); + this.buttonList.add(this.buttonDone); + int width = this.selectedPacks.left + this.selectedPacks.listWidth / 2 - this.fontRendererObj.getStringWidth(this.selectedPacks.title) / 2 - (this.availablePacks.left + this.availablePacks.listWidth / 2 + this.fontRendererObj.getStringWidth(this.availablePacks.title) / 2) - 50; + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.searchBar = new GuiTextField(299, this.fontRendererObj, 10, this.height - 70, (this.width - 30) / 2, 18); + } else { + this.searchBar = new GuiTextField(299, this.fontRendererObj, this.width / 2 - 204, this.height - 70, 200, 18); + } +// if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue()) { + this.searchBar.setVisible(this.activePackFolder == null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue()); +// } else { +// this.searchBar.setVisible(false); +// } + int d = !wide ? -1 : 1; + this.clearGlassButton = new GuiOptionButton(100, this.width / 2 + 4, this.height - 71, 114, 20, "Clear Glass: " + CheatBreaker.getInstance().getModuleManager().packTweaksMod.clearGlass.getValue()); + this.buttonList.add(this.clearGlassButton); + this.redStringButton = new GuiOptionButton(101, this.width / 2 + 118, this.height - 71, 86, 20, "Red String: " + ((Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredString.getValue() ? "ON" : "OFF")); + this.buttonList.add(this.redStringButton); + this.backgroundButton = new GuiOptionButton(102, this.width / 2 + (wide && this.width / 2 > 338 ? 204 : 4), this.height - (wide && this.width / 2 > 338 ? 71 : 91), (wide && this.width / 2 > 338 ? 138 : 200), 20, "Background: " + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().transparentBackground.getValue() ? "TRANSPARENT" : "NORMAL")); + this.buttonList.add(this.backgroundButton); + this.searchBar.setFocused(true); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + if (this.load) { + this.load = false; + } + if (this.mc.theWorld != null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().transparentBackground.getValue()) { + this.drawDefaultBackground(); + } else { + this.drawBackground(0); + } +// if (this.mc.theWorld == null) { +// super.func_146278_c(0); +// } else { +// Gui.drawRect(0, 0, this.width, this.height, Integer.MIN_VALUE); +// } + this.availablePacks.draw(mouseX, mouseY); + this.selectedPacks.draw(mouseX, mouseY); +// System.out.println(zLevel); + zLevel = 0.0f; +// if (this.availablePacks.isEmpty()) { +// String string = this.searchBar.getText().isEmpty() ? "Discovering resource packs..." : "No resource packs found."; +// this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + string, this.width / 2 - 100, 60, 0xFFFFFF); +// } +// Gui.drawRect(0, 0, this.width, 40, -16777216); +// Gui.drawRect(0, this.height - 40, this.width, this.height, -16777216); +// super.drawGradientRect(0, 40, this.width, 45, -16777216, 0); +// super.drawGradientRect(0, this.height - 45, this.width, this.height - 40, 0, -16777216); + if (this.availablePacks.entries.isEmpty()) { + String string = !this.searchBar.getText().isEmpty() && this.searchedEntries.isEmpty() ? "No resource packs found." : ""; + if (this.load) { + string = "Discovering resource packs..."; + } + this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + string, this.width / 2 - 100, 60, 0xFFFFFF); + } + if (this.selectedPacks.entries.isEmpty()) { + String string = "Select resource packs."; + this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + string, this.width / 2 + 100, 60, 0xFFFFFF); + } + super.drawCenteredString(this.mc.fontRendererObj, this.selectedPacks.title, this.selectedPacks.left + this.selectedPacks.listWidth / 2, this.selectedPacks.top - 14, -1); + super.drawCenteredString(this.mc.fontRendererObj, this.availablePacks.title, this.availablePacks.left + this.availablePacks.listWidth / 2, this.availablePacks.top - 14, -1); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.folderInfo"), this.width / 2 - 77, this.height - 26, 8421504); + super.drawScreen(mouseX, mouseY, partialTicks); + this.searchBar.drawTextBox(); + if (this.searchBar.getVisible() && !this.searchBar.isFocused() && this.searchBar.getText().isEmpty()) { + super.drawString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + "Search...", (Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue() ? 14 : this.width / 2 - 200, this.height - 65, 0xFFFFFF); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + if (this.searchBar.getVisible()) { + this.searchBar.mouseClicked(mouseX, mouseY, mouseButton); + } + } + + protected void actionPerformed(GuiButton button) { + if (button.id == this.buttonFolder.id) { + try { + Desktop.getDesktop().open(this.packsRepo.getDirResourcepacks()); + } catch (IOException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to open file", exception); + } + } else if (button.id == this.buttonDone.id) { + if (!this.initialSelectedEntries.equals(this.selectedPacks.getEntries())) { + ArrayList activePacks = new ArrayList(Lists.reverse(this.selectedPacks.getEntries())); + this.packsRepo.setRepositories(activePacks); + this.mc.gameSettings.resourcePacks.clear(); + for (ResourcePackRepository.Entry entry : activePacks) { + this.mc.gameSettings.resourcePacks.add(entry.getResourcePackName()); + } + this.mc.gameSettings.saveOptions(); + this.mc.refreshResources(); + } + this.mc.displayGuiScreen(this.previousScreen); + } else if (button.id == this.clearGlassButton.id) { + Setting clearGlass = CheatBreaker.getInstance().getModuleManager().packTweaksMod.clearGlass; + for (int i = 0; i < clearGlass.getAcceptedStringValues().length; ++i) { + if (!clearGlass.getAcceptedStringValues()[i].toLowerCase().equalsIgnoreCase(clearGlass.getStringValue())) + continue; + if (i + 1 >= clearGlass.getAcceptedStringValues().length) { + clearGlass.setValue(clearGlass.getAcceptedStringValues()[0]); + break; + } + clearGlass.setValue(clearGlass.getAcceptedStringValues()[i + 1]); + clearGlass.setValue(clearGlass.getAcceptedStringValues()[i + 1]); + break; + } + this.clearGlassButton.displayString = "Clear Glass: " + clearGlass.getValue(); + this.mc.renderGlobal.loadRenderers(); + } else if (button.id == this.redStringButton.id) { + boolean redString = CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredString.getBooleanValue(); + this.redStringButton.displayString = "Red String: " + (!redString ? "ON" : "OFF"); + CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredString.setValue(!redString); + this.mc.renderGlobal.loadRenderers(); + } else if (button.id == this.backgroundButton.id) { + boolean transparentBackground = CheatBreaker.getInstance().getGlobalSettings().transparentBackground.getBooleanValue(); + this.backgroundButton.displayString = "Background: " + (!transparentBackground ? "TRANSPARENT" : "NORMAL"); + CheatBreaker.getInstance().getGlobalSettings().transparentBackground.setValue(!transparentBackground); + this.mc.renderGlobal.loadRenderers(); + } + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.availablePacks.handleMouseInput(); + this.selectedPacks.handleMouseInput(); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + if (this.searchBar.textboxKeyTyped(typedChar, keyCode)) { + this.searchForPacks(this.searchBar.getText().toLowerCase()); + } + } + + public void updateScreen() { + if (this.packsWatcher != null && this.packsWatcher.hasEvent()) { + ThreadUtils.execute(this::refreshPackFolders); + this.setAvailablePacks(null); + } + this.searchBar.updateCursorCounter(); + } + + public void addAvailableEntry(ResourcePackRepository.Entry entry) { + if (!this.availableEntries.contains(entry) && this.activePackFolder == null) { + this.availableEntries.add(entry); + this.sortAvailableEntries(this.availableEntries); + } + } + + public boolean addSelectedEntry(ResourcePackRepository.Entry entry) { + if (!this.selectedEntries.contains(entry)) { + this.selectedEntries.add(0, entry); + return true; + } + return false; + } + + public void setAvailablePacks(ResourcePacksFolder packFolder) { + this.activePackFolder = packFolder; + int searchBarHeight = (Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue() ? 26 : 4; + + if (packFolder == null) { + if (this.searchBar != null) { + this.searchBar.setVisible((Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue()); + } + this.availableEntries = new ArrayList<>(this.packsRepo.getRepositoryEntriesAll()); + this.availableEntries.removeAll(this.selectedEntries); + + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.availablePacks = new GuiResourcePacksAvailable(this, 10, 32, (this.width - 30) / 2, this.height - 80 - searchBarHeight, 36, this.availableEntries, this.packFolders, true); + } else { + this.availablePacks = new GuiResourcePacksAvailable(this, this.width / 2 - 204, 32, 200, this.height - 80 - searchBarHeight, 36, this.availableEntries, this.packFolders, true); + } + + } else { +// this.searchBar.setVisible(false); + this.availableEntries = packFolder.getEntries(); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.availablePacks = new GuiResourcePacksAvailable(this, 10, 32, (this.width - 30) / 2, this.height - 80 - searchBarHeight, 36, this.availableEntries, packFolder.getPackFolders(), true); + } else { + this.availablePacks = new GuiResourcePacksAvailable(this, this.width / 2 - 204, 32, 200, this.height - 80 - searchBarHeight, 36, this.availableEntries, packFolder.getPackFolders(), true); + } + + } + this.sortAvailableEntries(this.availableEntries); + } + + public List getPackFolders() { + return Collections.unmodifiableList(this.packFolders); + } + + private void refreshPackFolders() { + this.packFolders.clear(); + for (File packSubfolder : Objects.requireNonNull(this.packsRepo.getDirResourcepacks().listFiles(PackUtils::isResourcePackDirectory))) { + this.packFolders.add(new ResourcePacksFolder(packSubfolder, this.selectedEntries)); + } + this.sortPackFolders((String) CheatBreaker.getInstance().getGlobalSettings().packSortMethod.getValue()); + } + + public void sortAvailableEntries(List list) { + String sortMethod = (String) CheatBreaker.getInstance().getGlobalSettings().packSortMethod.getValue(); + if (sortMethod.equals("A-Z")) { + list.sort(ENTRY_COMPARATOR); + } else if (sortMethod.equals("Z-A")) { + list.sort(ENTRY_COMPARATOR.reversed()); + } + } + + private void sortPackFolders(String sortMethod) { + if (sortMethod.equals("A-Z")) { + this.packFolders.sort(FOLDER_COMPARATOR); + } else if (sortMethod.equals("Z-A")) { + this.packFolders.sort(FOLDER_COMPARATOR.reversed()); + } + } + + private void searchForPacks(String search) { + if (search.isEmpty()) { + this.setAvailablePacks(null); + } else { + this.searchedEntries.clear(); + for (ResourcePackRepository.Entry entry : this.availableEntries) { + if (!StringUtils.stripControlCodes(entry.getResourcePackName()).toLowerCase().contains(search) && !StringUtils.stripControlCodes(entry.getTexturePackDescription()).toLowerCase().contains(search)) + continue; + this.addSearchedPack(entry); + } + for (ResourcePacksFolder packFolder : this.packFolders) { + this.searchForPacks(packFolder, search); + } + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.availablePacks = new GuiResourcePacksAvailable(this, 10, 32, (this.width - 30) / 2, this.height - 80 - 26, 36, this.searchedEntries, null, false); + } else { + this.availablePacks = new GuiResourcePacksAvailable(this, this.width / 2 - 204, 32, 200, this.height - 80 - 26, 36, this.searchedEntries, null, false); + } + this.sortAvailableEntries(this.searchedEntries); + } + } + + private void searchForPacks(ResourcePacksFolder packFolder, String search) { + for (ResourcePackRepository.Entry entry : packFolder.getEntries()) { + if (!StringUtils.stripControlCodes(entry.getResourcePackName().toLowerCase()).contains(search) && !StringUtils.stripControlCodes(entry.getTexturePackDescription()).toLowerCase().contains(search)) + continue; + this.addSearchedPack(entry); + } + for (ResourcePacksFolder packSubfolder : packFolder.getPackFolders()) { + this.searchForPacks(packSubfolder, search); + } + } + + public void addSearchedPack(ResourcePackRepository.Entry entry) { + boolean duplicate = false; + for (ResourcePackRepository.Entry searchedEntry : this.searchedEntries) { + if (!searchedEntry.getResourcePackName().equals(entry.getResourcePackName())) continue; + duplicate = true; + break; + } + if (!duplicate) { + this.searchedEntries.add(entry); + this.sortAvailableEntries(this.searchedEntries); + } + } + + public boolean isSearching() { + return !this.searchBar.getText().isEmpty(); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/GuiUtils.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/GuiUtils.java new file mode 100644 index 0000000..f302bef --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/GuiUtils.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.module.impl.packmanager.utils; + +import net.minecraft.client.Minecraft; + +public class GuiUtils { + private static final Minecraft mc = Minecraft.getMinecraft(); + + public static String trimString(String text, int width) { + if (text.endsWith(".zip")) { + text = text.substring(0, text.length() - 4); + } + if (GuiUtils.mc.fontRendererObj.getStringWidth(text) > width) { + text = GuiUtils.mc.fontRendererObj.trimStringToWidth(text, width - GuiUtils.mc.fontRendererObj.getStringWidth("...")) + "..."; + } + return text; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/PackUtils.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/PackUtils.java new file mode 100644 index 0000000..885f925 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/PackUtils.java @@ -0,0 +1,98 @@ +package com.cheatbreaker.client.module.impl.packmanager.utils; + +import com.cheatbreaker.client.CheatBreaker; +import lombok.SneakyThrows; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +public class PackUtils { + private static final Minecraft MC = Minecraft.getMinecraft(); + + /** + * Returns true if the file is a zip or a directory with a pack.mcmeta in a pack folder. + * DOES NOT CHECK IN THE MAIN PACK FOLDER DIRECTORY + */ + @SneakyThrows + public static boolean isResourcePack(File file) { + if (file.isFile() && file.getName().endsWith(".zip")) { + try { + ZipFile sourceZipFile = new ZipFile(file); + ZipEntry entry = sourceZipFile.getEntry("pack.mcmeta"); + if (entry == null) { + System.out.println("Not found in: " + file.getName()); + return false; + + } + return true; + } catch (Exception ex) { + return false; + } + } + return file.isDirectory() && new File(file, "pack.mcmeta").isFile(); + } + + /** + * Returns true if the file is a zip or a directory with a pack.mcmeta in a pack folder. + */ + public static boolean isResourcePackDirectory(File file) { + return file.isDirectory() && !new File(file, "pack.mcmeta").isFile(); + } + + public static Optional createEntry(File resourcePack) { + Optional entry = Optional.empty(); + try { + Constructor constructor = ResourcePackRepository.Entry.class.getDeclaredConstructor(ResourcePackRepository.class, File.class); + constructor.setAccessible(true); + entry = Optional.of(constructor.newInstance(MC.getResourcePackRepository(), resourcePack)); + entry.get().updateResourcePack(); + } catch (NoSuchMethodException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to find constructor", exception); + entry = Optional.empty(); + } catch (IllegalAccessException | InstantiationException | InvocationTargetException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to create entry", exception); + } catch (IOException e) { + e.printStackTrace(); + } + + return entry; + } + + public static List getActiveEntries() { + ArrayList activeEntries = new ArrayList<>(); + ResourcePackRepository packRepo = MC.getResourcePackRepository(); + for (String packName : PackUtils.MC.gameSettings.resourcePacks) { + for (ResourcePackRepository.Entry entry : packRepo.getRepositoryEntriesAll()) { + if (!entry.getResourcePackName().equals(packName)) continue; + } + for (File packFolder : Objects.requireNonNull(packRepo.getDirResourcepacks().listFiles(PackUtils::isResourcePackDirectory))) { + activeEntries.addAll(PackUtils.getActiveEntries(packFolder, packName)); + } + } + return activeEntries; + } + + private static List getActiveEntries(File directory, String packName) { + ArrayList activeEntries = new ArrayList<>(); + for (File file : Objects.requireNonNull(directory.listFiles())) { + if (PackUtils.isResourcePack(file)) { + if (!file.getName().equals(packName)) continue; + PackUtils.createEntry(file).ifPresent(activeEntries::add); + continue; + } + if (!PackUtils.isResourcePackDirectory(file)) continue; + activeEntries.addAll(PackUtils.getActiveEntries(file, packName)); + } + return activeEntries; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/ThreadUtils.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/ThreadUtils.java new file mode 100644 index 0000000..aaa6877 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/ThreadUtils.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.module.impl.packmanager.utils; + +import net.minecraft.client.Minecraft; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class ThreadUtils { + private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor(); + + public static void execute(Runnable task) { + EXECUTOR_SERVICE.execute(task); + } + + public static void shutdown() { + Minecraft.getMinecraft().gameSettings.saveOptions(); + EXECUTOR_SERVICE.shutdown(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/StaffMod.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/StaffMod.java new file mode 100644 index 0000000..d0ba74a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/StaffMod.java @@ -0,0 +1,28 @@ +package com.cheatbreaker.client.module.impl.staff; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; + +/** + * @see AbstractModule + * + * This Object defines the staff module variant of the com.cheatbreaker.client.module.AbstractModule Object. + */ +public class StaffMod extends AbstractModule { + private final Setting keybind = new Setting(this, "Keybind").setValue(0); + + public Setting getKeybindSetting() { + return this.keybind; + } + + public StaffMod(String name) { + super(name); + } + + public void disableStaffModule() { + if (this.isEnabled()) { + this.setState(false); + } + this.setStaffModuleEnabled(false); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleBunnyhop.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleBunnyhop.java new file mode 100644 index 0000000..aaa5347 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleBunnyhop.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.staff.StaffMod; + +/** + * @Module - StaffModuleBunnyhop + * @see StaffMod + * + * This staff module replicates the CSGO bunny hop. + */ +public class StaffModuleBunnyhop extends StaffMod { + public static Setting trimp; + public static Setting trimpMultiplier; + public static Setting hardCap; + public static Setting softCap; + public static Setting softCapDegen; + public static Setting sharking; + public static Setting sharkingSurfaceTension; + public static Setting sharkingWaterFriction; + public static Setting accelerate; + public static Setting airAccelerate; + public static Setting uncappedBHop; + public static Setting increasedFallDistance; + public static Setting maxAirAccelPerTick; + + public StaffModuleBunnyhop() { + super("bunnyhop"); + this.setStaffModule(true); + trimp = new Setting(this, "Trimp").setValue(true); + trimpMultiplier = new Setting(this, "Trimp Multiplier").setValue(1.4F).setMinMax(1.0f, 4.0F); + hardCap = new Setting(this, "Hard cap").setValue(2.0f).setMinMax(1.0f, 4.0F); + softCap = new Setting(this, "Soft cap").setValue(1.4F).setMinMax(1.0f, 4.0F); + softCapDegen = new Setting(this, "Soft cap degen").setValue(0.65F).setMinMax(0.1f, 4.0F); + sharking = new Setting(this, "Sharking").setValue(true); + sharkingSurfaceTension = new Setting(this, "Sharking surface tension").setValue(0.2D).setMinMax(0.0, 1.0); + sharkingWaterFriction = new Setting(this, "Sharking water friction").setValue(0.1D).setMinMax(0.0, 1.0); + accelerate = new Setting(this, "Accelerate").setValue(20.0).setMinMax(5.0, 100.0); + airAccelerate = new Setting(this, "Air accelerate").setValue(28.0).setMinMax(5.0, 150.0); + maxAirAccelPerTick = new Setting(this, "Max air accel per tick").setValue(0.095D).setMinMax(0.0, 1.0); + uncappedBHop = new Setting(this, "Uncapped BunnyHop").setValue(true); + increasedFallDistance = new Setting(this, "Increased FallDistance").setValue(0.0).setMinMax(0.0, 10.0); + } + + public static boolean canUse() { + return CheatBreaker.getInstance().getModuleManager().staffBunnyhop.isStaffModuleEnabled() && CheatBreaker.getInstance().getModuleManager().staffBunnyhop.isEnabled(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNameTags.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNameTags.java new file mode 100644 index 0000000..1c204a9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNameTags.java @@ -0,0 +1,127 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.entity.Entity; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.Vec3; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * @Module - StaffModuleNameTags + * @see StaffMod + * + * This staff module renders an upscaled nametag with health information above players. + */ +public class StaffModuleNameTags extends StaffMod { + public FloatBuffer modelViewMatrixBuffer = BufferUtils.createFloatBuffer(16); + public FloatBuffer projectionMatrixBuffer = BufferUtils.createFloatBuffer(16); + private static Map> nameTagList = null; + + public StaffModuleNameTags() { + super("Nametags"); + this.setStaffModule(true); + this.addEvent(GuiDrawEvent.class, this::onGuiDrawEvent); + } + + private void onGuiDrawEvent(GuiDrawEvent event) { + Minecraft mc = Minecraft.getMinecraft(); + IntBuffer intBuffer = BufferUtils.createIntBuffer(16); + GL11.glGetInteger(2978, intBuffer); + float f = mc.timer.renderPartialTicks; + float f2 = (float) (mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * (double) f); + float f3 = (float) (mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * (double) f); + float f4 = (float) (mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * (double) f); + double d = (double) (mc.thePlayer.rotationPitch + 90.0f) * Math.PI / 180.0; + double d2 = (double) (mc.thePlayer.rotationYaw + 90.0f) * Math.PI / 180.0; + boolean bl = nameTagList != null; + Vec3 vec3 = new Vec3(Math.sin(d) * Math.cos(d2), Math.cos(d), Math.sin(d) * Math.sin(d2)); + if (mc.gameSettings.thirdPersonView == 2) { + vec3 = new Vec3(vec3.xCoord * -1.0, vec3.yCoord * -1.0, vec3.zCoord * -1.0); + } + for (int i = 0; i < mc.theWorld.getLoadedEntityList().size(); ++i) { + Entity entity = mc.theWorld.getLoadedEntityList().get(i); + if (entity == null || entity == mc.thePlayer || !(entity instanceof AbstractClientPlayer)) continue; + AbstractClientPlayer player = (AbstractClientPlayer) entity; + Scoreboard scoreboard = player.getWorldScoreboard(); + ScoreObjective scoreObjective = scoreboard.getObjectiveInDisplaySlot(2); + float f5 = 0.0f; + if (player.getDistanceSqToEntity(mc.thePlayer) < (double) 100 && scoreObjective != null) { + f5 = (float) ((double) f5 + (double) ((float) mc.fontRendererObj.FONT_HEIGHT * 0.0375f)); + } + float f6 = (float) (player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) f - (double) f2); + float f7 = (float) (player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) f - (double) f3) + player.height + (player.isSneaking() ? 0.3F : 0.55F) + f5; + float f8 = (float) (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) f - (double) f4); + Vec3 vec32 = new Vec3(f6, f7, f8); + double d3 = vec32.lengthVector(); + if (vec3.dotProduct(vec32 = vec32.normalize()) <= 0.02) { + double d4 = 1.5533430342749535; + double d5 = Math.sin(1.5533430342749535); + double d6 = Math.cos(1.5533430342749535); + Vec3 cross = vec3.crossProduct(vec32); + double d7 = cross.xCoord; + double d8 = cross.yCoord; + double d9 = cross.zCoord; + double d10 = d6 + d7 * d7 * (1.0 - d6); + double d11 = d7 * d8 * (1.0 - d6) - d9 * d5; + double d12 = d7 * d9 * (1.0 - d6) + d8 * d5; + double d13 = d8 * d7 * (1.0 - d6) + d9 * d5; + double d14 = d6 + d8 * d8 * (1.0 - d6); + double d15 = d8 * d9 * (1.0 - d6) - d7 * d5; + double d16 = d9 * d7 * (1.0 - d6) - d8 * d5; + double d17 = d9 * d8 * (1.0 - d6) + d7 * d5; + double d18 = d6 + d9 * d9 * (1.0 - d6); + f6 = (float) (d3 * (d10 * vec3.xCoord + d11 * vec3.yCoord + d12 * vec3.zCoord)); + f7 = (float) (d3 * (d13 * vec3.xCoord + d14 * vec3.yCoord + d15 * vec3.zCoord)); + f8 = (float) (d3 * (d16 * vec3.xCoord + d17 * vec3.yCoord + d18 * vec3.zCoord)); + } + FloatBuffer floatBuffer = BufferUtils.createFloatBuffer(3); + GLU.gluProject(f6, f7, f8, this.modelViewMatrixBuffer, this.projectionMatrixBuffer, intBuffer, floatBuffer); + float f9 = floatBuffer.get(0) / (float) event.getScaledResolution().getScaleFactor(); + float f10 = floatBuffer.get(1) / (float) event.getScaledResolution().getScaleFactor(); + GL11.glPushMatrix(); + GL11.glTranslatef(f9, (float) event.getScaledResolution().getScaledHeight() - f10, 0.0f); + float f11 = player.getHealth(); + String string = player.getName() + ((double) f11 != 1.0 ? " | " + this.setHealthColor(f11) + f11 : ""); + if (scoreObjective != null) { + Score score = scoreboard.getValueFromObjective(player.getName(), scoreObjective); + string = string + EnumChatFormatting.WHITE + " | " + this.setHealthColor(score.getScorePoints()) + score.getScorePoints(); + } + float f12 = mc.fontRendererObj.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(string)); + mc.fontRendererObj.drawStringWithShadow(string, (float) ((int) (-f12) / 2), (float) (-mc.fontRendererObj.FONT_HEIGHT), -1); + if (bl && nameTagList.containsKey(player.getGameProfile().getId().toString())) { + int n = 1; + for (Object o : (List) nameTagList.get(player.getGameProfile().getId().toString())) { + String string2 = (String) o; + mc.fontRendererObj.drawCenteredStringWithShadow(string2, (int) (-f12) / 2, -mc.fontRendererObj.FONT_HEIGHT * ++n, -1); + } + } + GL11.glPopMatrix(); + } + } + + private EnumChatFormatting setHealthColor(float f) { + return f > 15.0f ? EnumChatFormatting.DARK_GREEN : (f > 10.0f ? EnumChatFormatting.YELLOW : (f > 5.0f ? EnumChatFormatting.RED : EnumChatFormatting.DARK_RED)); + } + + public static Map> getNameTagList() { + return nameTagList; + } + + public static void setNameTagList(Map> nameTagList) { + StaffModuleNameTags.nameTagList = nameTagList; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNoClip.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNoClip.java new file mode 100644 index 0000000..79da9df --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNoClip.java @@ -0,0 +1,23 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.event.impl.movement.CollisionEvent; +import com.cheatbreaker.client.module.impl.staff.StaffMod; + +/** + * @Module - StaffModuleNoClip + * @see StaffMod + * + * This staff module allows you to phase through the entire Minecraft World. + */ +public class StaffModuleNoClip extends StaffMod { + + public StaffModuleNoClip() { + super("noclip"); + this.setStaffModule(true); + this.addEvent(CollisionEvent.class, this::onCollisionEvent); + } + + private void onCollisionEvent(CollisionEvent collisionEvent) { + collisionEvent.setCanceled(true); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleXray.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleXray.java new file mode 100644 index 0000000..85bb28b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleXray.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import lombok.Getter; +import net.minecraft.client.Minecraft; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @Module - StaffModuleNoClip + * @see StaffMod + * + * This staff module allows you to phase through the entire Minecraft World. + */ +public class StaffModuleXray extends StaffMod { + @Getter private final List blocks; + public Setting opacity; + + public StaffModuleXray() { + super("xray"); + this.setStaffModule(true); + this.blocks = new ArrayList<>(); + Collections.addAll(this.blocks, 14, 15, 16, 15, 56, 129, 52); + this.opacity = new Setting(this, "Opacity").setValue(45).setMinMax(15, 255); + } + + @Override + public void addAllEvents() { + super.addAllEvents(); + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + + @Override + public void removeAllEvents() { + super.removeAllEvents(); + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + + public boolean shouldRender(int blockID, boolean vanillaRender) { + return !this.isEnabled() ? vanillaRender : this.blocks.contains(blockID); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/ByteBufWrapper.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/ByteBufWrapper.java new file mode 100644 index 0000000..1f8dfcc --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/ByteBufWrapper.java @@ -0,0 +1,81 @@ +package com.cheatbreaker.client.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; + +import java.util.UUID; +import java.util.function.Consumer; +import java.util.function.Supplier; + +/** + * This aids in reading and writing data within packets. + */ +public class ByteBufWrapper { + private final ByteBuf buf; + + public ByteBufWrapper(ByteBuf buf) { + this.buf = buf; + } + + public void writeVarInt(int b) { + while ((b & 0xFFFFFF80) != 0x0) { + this.buf.writeByte((b & 0x7F) | 0x80); + b >>>= 7; + } + this.buf.writeByte(b); + } + + public int readVarInt() { + int i = 0; + int chunk = 0; + byte b; + do { + b = this.buf.readByte(); + i |= (b & 0x7F) << chunk++ * 7; + if (chunk > 5) { + throw new RuntimeException("VarInt too big"); + } + } while ((b & 0x80) == 0x80); + return i; + } + + public void writeOptional(T obj, Consumer consumer) { + this.buf.writeBoolean(obj != null); + if (obj != null) { + consumer.accept(obj); + } + } + + public T readOptional(Supplier supplier) { + boolean isPresent = this.buf.readBoolean(); + return isPresent ? supplier.get() : null; + } + + public void writeString(String s) { + byte[] arr = s.getBytes(Charsets.UTF_8); + this.writeVarInt(arr.length); + this.buf.writeBytes(arr); + } + + public String readString() { + int len = this.readVarInt(); + byte[] buffer = new byte[len]; + this.buf.readBytes(buffer); + return new String(buffer, Charsets.UTF_8); + } + + public void writeUUID(UUID uuid) { + this.buf.writeLong(uuid.getMostSignificantBits()); + this.buf.writeLong(uuid.getLeastSignificantBits()); + } + + public UUID readUUID() { + long mostSigBits = this.buf.readLong(); + long leastSigBits = this.buf.readLong(); + return new UUID(mostSigBits, leastSigBits); + } + + public ByteBuf getBuf() { + return this.buf; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentBooleanReference.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentBooleanReference.java new file mode 100644 index 0000000..4a046d8 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentBooleanReference.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.network.agent; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * This was used by the CBAgent, probably for AntiCheat purposes. + */ +@Retention(value = RetentionPolicy.RUNTIME) +public @interface AgentBooleanReference { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentByteArrayReference.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentByteArrayReference.java new file mode 100644 index 0000000..2b9978d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentByteArrayReference.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.network.agent; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * This was used by the CBAgent, probably for AntiCheat purposes. + */ +@Retention(value = RetentionPolicy.RUNTIME) +public @interface AgentByteArrayReference { +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentResources.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentResources.java new file mode 100644 index 0000000..d636e93 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/agent/AgentResources.java @@ -0,0 +1,22 @@ +package com.cheatbreaker.client.network.agent; + +/** + * Contains things related for the CBAgent to pull from. + */ +public class AgentResources { + @AgentByteArrayReference + public static native byte[] getBytesNative(String var0); + + @AgentBooleanReference + public static native boolean existsBytesNative(String var0); + + public static boolean existsBytes(String string) { + boolean bl = false; + try { + bl = AgentResources.existsBytesNative(string); + } catch (UnsatisfiedLinkError ignore) { + + } + return bl; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/messages/Message.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/messages/Message.java new file mode 100644 index 0000000..6ca076c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/messages/Message.java @@ -0,0 +1,160 @@ +package com.cheatbreaker.client.network.messages; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.Microphone; +import com.cheatbreaker.client.network.agent.AgentBooleanReference; +import com.cheatbreaker.client.network.agent.AgentByteArrayReference; +import com.cheatbreaker.client.network.agent.AgentResources; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.client.PacketClientVoice; +import com.google.gson.Gson; +import net.minecraft.client.Minecraft; +import net.minecraft.client.main.Main; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.event.HoverEvent; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * This was used by CheatBreaker in their network package. + *

+ * It was excluded from the obfuscator for reason, probably to prevent + * any problems with any custom networking methods staying functional + * after deployment of new updates. Copyright CheatBreaker 2018. + */ +public class Message { + private final String action; + public static byte[] b; + public static byte[] a; + + public Message(String string) { + this.action = string; + } + + public String getAction() { + return this.action; + } + + public static native void a(String[] var0); + + public static native void b(String var0); + + public static native void c(String var0, String var1, String var2); + + public static void d() { + String string = ""; + String string2 = ""; + String string3 = ""; + String string4 = ""; + String string5 = ""; + String string6 = ""; + String string7 = ""; + for (Method accessibleObject : Minecraft.class.getMethods()) { + if (accessibleObject.getReturnType() == Minecraft.class) { + string = accessibleObject.getName() + ":()L" + Minecraft.class.getCanonicalName().replaceAll("\\.", "/") + ";"; + continue; + } + if (accessibleObject.getReturnType() != NetHandlerPlayClient.class) continue; + string2 = accessibleObject.getName() + ":()L" + NetHandlerPlayClient.class.getCanonicalName().replaceAll("\\.", "/") + ";"; + } + for (Method accessibleObject : NetHandlerPlayClient.class.getMethods()) { + if (accessibleObject.getParameterTypes().length != 1 || accessibleObject.getParameterTypes()[0] != Packet.class) + continue; + string3 = accessibleObject.getName() + ":(L" + Packet.class.getCanonicalName().replaceAll("\\.", "/") + ";)V"; + } + for (Field accessibleObject : Entity.class.getFields()) { + if (accessibleObject.getType() != Float.TYPE) continue; + string4 = accessibleObject.getName() + ":F"; + break; + } + for (Method accessibleObject : Main.class.getMethods()) { + if (accessibleObject.getParameterTypes().length != 1 || accessibleObject.getParameterTypes()[0] != String[].class) + continue; + string5 = accessibleObject.getName() + ":([Ljava/lang/String;)V"; + } + for (Method accessibleObject : AgentResources.class.getMethods()) { + if (accessibleObject.isAnnotationPresent(AgentByteArrayReference.class)) { + string6 = accessibleObject.getName() + ":(Ljava/lang/String;)[B"; + } + if (!accessibleObject.isAnnotationPresent(AgentBooleanReference.class)) continue; + string7 = accessibleObject.getName() + ":(Ljava/lang/String;)Z"; + } + Message.a(new String[]{Message.r(C17PacketCustomPayload.class.getName()), + Message.r(S3FPacketCustomPayload.class.getName()), Message.r(Minecraft.class.getName()), + Message.r(NetHandlerPlayClient.class.getName()), Message.r(Entity.class.getName()), + Message.r(AgentResources.class.getName()), Message.r(Main.class.getName()), string, string2, string3, string4, + string5, string6, string7}); + } + + private static String r(String string) { + return string.replaceAll("\\.", "/"); + } + + public static native void e(boolean var0); + + public static native void f(String var0, byte[] var1); + + public static void j(byte[] arrby) { + CheatBreaker.getInstance().getCBNetHandler().sendPacket(new PacketClientVoice(arrby)); + } + + public static void r(byte[] arrby) { + b = arrby; + Minecraft mc = Minecraft.getMinecraft(); + if (mc.theWorld != null && mc.getNetHandler().getNetworkManager().getChannel().isOpen() && CheatBreaker.getInstance().getCBNetHandler().isRegisteredBinary()) { +// mc.getNetHandler().getNetworkManager().getChannel().writeAndFlush(new C17PacketCustomPayload(CheatBreaker.getInstance().getPluginBinaryChannel(), arrby)); + } + } + + public static void g(String[] micDescription, String[] micName) { + for (int i = 0; i < micDescription.length; ++i) { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Added mic option: " + micName[i]); + CheatBreaker.getInstance().getAudioManager().getMicrophones().add(new Microphone(micDescription[i], micName[i])); + } + } + + /** + * Sends a prefix in chat for debugging purposes. + */ + public static void z(boolean incoming, CBPacket packet) { +// ChatComponentText chatDebugPrefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET); + ChatComponentText debugMessage = new ChatComponentText(EnumChatFormatting.GRAY + (incoming ? "Received: " : "Sent: ") + EnumChatFormatting.WHITE + packet.getClass().getSimpleName()); + debugMessage.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(new Gson().toJson(packet)))); +// chatDebugPrefix.appendSibling(debugMessage); + debugMessage.setBranded(true); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(debugMessage); + } + + public static native void h(String var0); + + public static native byte[] i(); + + public static native void k(); + + public static native void l(float var0); + + public static native void m(float var0); + + public static void n() { + Minecraft.getMinecraft().gameSettings.saveOptions(); + CheatBreaker.getInstance().configManager.updateProfile(); + CheatBreaker.getInstance().getWsNetHandler().close(); + System.exit(0); + } + + public static void o(String string) { + Minecraft mc = Minecraft.getMinecraft(); + if (mc != null && mc.ingameGUI != null && mc.ingameGUI.getChatGUI() != null) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(string)); + } + } + + public static native void s(int var0, boolean var1); +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/netty/CBChannelInboundHandlerAdap.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/netty/CBChannelInboundHandlerAdap.java new file mode 100644 index 0000000..b41de33 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/netty/CBChannelInboundHandlerAdap.java @@ -0,0 +1,56 @@ +package com.cheatbreaker.client.network.netty; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import lombok.Getter; + +import javax.crypto.SecretKey; + +/** + * @see CBPingInboundHandler + * + * This is the CheatBreaker protocol adapter class. + */ +@Getter +public class CBChannelInboundHandlerAdap extends ChannelInboundHandlerAdapter { + private final byte[] byteKey = "cf2O02b1QJSZOcVHphHucA".getBytes(); + + private long someLong2 = 1L; + private long someLong = 0L; + private long unsignedInt; + private long signedInt; + + public CBChannelInboundHandlerAdap(SecretKey secretKey) { + for (byte by : secretKey.getEncoded()) { + this.someLong2 = (this.someLong2 + (long) (by & 0xFF)) % 65521L; + this.someLong = (this.someLong + this.someLong2) % 65521L; + } + } + + @Override + public void channelRead(ChannelHandlerContext channelHandlerContext, Object object) { + ByteBuf byteBuf = (ByteBuf) object; + + while (byteBuf.readableBytes() > 0) { + int n = byteBuf.readByte() & 0xFF; + this.someLong2 = (this.someLong2 + (long) n) % 65521L; + this.someLong = (this.someLong + this.someLong2) % 65521L; + } + + byteBuf.readerIndex(0); + + for (byte by : this.byteKey) { + this.someLong2 = (this.someLong2 + (long) (by & 0xFF)) % 65521L; + this.someLong = (this.someLong + this.someLong2) % 65521L; + } + this.unsignedInt = this.signedInt; + this.signedInt = this.someLong << 16 | this.someLong2; + + try { + super.channelRead(channelHandlerContext, object); + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/netty/CBPingInboundHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/netty/CBPingInboundHandler.java new file mode 100644 index 0000000..8aa43c7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/netty/CBPingInboundHandler.java @@ -0,0 +1,59 @@ +package com.cheatbreaker.client.network.netty; + +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import net.minecraft.client.Minecraft; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S3FPacketCustomPayload; + +import java.io.*; + +/** + * @see ChannelInboundHandlerAdapter + * + * This class handles incoming CheatBreaker Ping payloads, and sends a CheatBreaker Pong payload back. + */ +public class CBPingInboundHandler extends ChannelInboundHandlerAdapter { + private final CBChannelInboundHandlerAdap channelInboundHandlerAdap; + private long maxTime = System.nanoTime() - 30000000000L; + private final Minecraft mc = Minecraft.getMinecraft(); + private long version = 0L; + + public CBPingInboundHandler(CBChannelInboundHandlerAdap var1) { + this.channelInboundHandlerAdap = var1; + } + + @Override + public void channelRead(ChannelHandlerContext ctx, Object packet) throws Exception { + S3FPacketCustomPayload payload; + if (packet instanceof S3FPacketCustomPayload && (payload = (S3FPacketCustomPayload) packet).getChannelName().equals("CB|PING")) { + this.maxTime = System.nanoTime(); + long version = (long)new DataInputStream(new ByteArrayInputStream(payload.getBufferData().readByteArray())).readInt() & 0xFFFFFFFFL; + if (version != this.channelInboundHandlerAdap.getUnsignedInt()) { + throw new IOException("CheatBreaker Protocol Error -2a\n(Try updating your client)"); + } + ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream(); + DataOutputStream dataOutputStream = new DataOutputStream(arrayOutputStream); + try { + dataOutputStream.write(payload.getBufferData().readByteArray()); + if ((this.version++ & 7L) == 0L) { + dataOutputStream.writeLong(this.version); + dataOutputStream.writeUTF(this.mc.currentServerData.serverIP); + dataOutputStream.writeUTF(this.mc.getSession().getPlayerID()); + dataOutputStream.writeUTF(this.mc.entityRenderer.getClass().getName()); + } + } catch (IOException ignored) { + } + + PacketBuffer packetBuffer = new PacketBuffer(Unpooled.buffer()); + packetBuffer.writeBytes(arrayOutputStream.toByteArray()); + ctx.channel().eventLoop().execute(() -> ctx.channel().writeAndFlush(new C17PacketCustomPayload("CB|PONG", packetBuffer))); + } + if (System.nanoTime() - this.maxTime > 45000000000L) { + throw new IOException("CheatBreaker Protocol Error -2b\n(Try updating your client)"); + } + super.channelRead(ctx, packet); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBNetHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBNetHandler.java new file mode 100644 index 0000000..af81b79 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBNetHandler.java @@ -0,0 +1,500 @@ +package com.cheatbreaker.client.network.plugin; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.network.ConnectEvent; +import com.cheatbreaker.client.event.impl.network.DisconnectEvent; +import com.cheatbreaker.client.event.impl.network.PluginMessageEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.MiniMapRules; +import com.cheatbreaker.client.module.impl.normal.hud.ModuleScoreboard; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleZansMiniMap; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleNameTags; +import com.cheatbreaker.client.network.messages.Message; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; +import com.cheatbreaker.client.network.plugin.server.*; +import com.cheatbreaker.client.network.plugin.shared.CBPacketAddWaypoint; +import com.cheatbreaker.client.network.plugin.shared.CBPacketRemoveWaypoint; +import com.cheatbreaker.client.util.manager.BranchManager; +import com.cheatbreaker.client.util.render.hologram.Hologram; +import com.cheatbreaker.client.util.render.teammates.CBTeammate; +import com.cheatbreaker.client.util.render.title.CBTitle; +import com.cheatbreaker.client.util.render.title.data.TitleType; +import com.cheatbreaker.client.util.voicechat.data.VoiceChannel; +import com.cheatbreaker.client.util.voicechat.data.VoiceUser; +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableList; +import io.netty.buffer.Unpooled; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.awt.*; +import java.util.List; +import java.util.*; + +/** + * @see ICBNetHandlerClient + * + * This class contians methods for handling of Plugin Message packets. + */ +@Getter +public class CBNetHandler implements ICBNetHandlerClient { + final CheatBreaker cheatBreaker = CheatBreaker.getInstance(); + + private VoiceChannel currentVoiceChannel; + + private final Map> customNameTags = new HashMap<>(); + + private final List playersInVoiceChannel = new ArrayList<>(); + private final List mutedPlayers = new ArrayList<>(); + private List voiceChannels; // Not meant to be initalized here, it will be later on down in the class. + + private boolean isUsingLegacyLunarChannel = false; + private boolean registeredClient = false; + private boolean registeredBinary = false; + private boolean voiceChatEnabled = false; + private boolean competitiveGameMode; + private boolean serverHandlesWaypoints; + + private String worldUID = ""; + + public CBNetHandler() { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created Network Manager"); + } + + public void onConnect(final ConnectEvent ignored) { + this.registeredBinary = false; + } + + public void onPluginMessage(PluginMessageEvent customPayload) { + try { + if (customPayload.getChannelName().equals("REGISTER")) { + String payload = new String(customPayload.getBufferData(), Charsets.UTF_8); + this.registeredClient = payload.contains(this.cheatBreaker.getCheatBreakerPluginMessageChannel()); + if (!this.registeredClient) { + boolean onALunarServer = payload.contains(this.cheatBreaker.getLatestLunarPluginMessageChannel()); + if (!onALunarServer) { + boolean legacy = payload.contains(this.cheatBreaker.getLunarPluginMessageChannel()); + if (legacy) { + this.isUsingLegacyLunarChannel = true; + } + } + } + this.registeredBinary = payload.contains(this.cheatBreaker.getPluginBinaryChannel()); + PacketBuffer wrapper = new PacketBuffer(Unpooled.buffer()); + wrapper.writeBytes(this.cheatBreaker.getCheatBreakerPluginMessageChannel().getBytes(Charsets.UTF_8)); + if (Minecraft.getMinecraft().getNetHandler() != null && this.registeredClient) { + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C17PacketCustomPayload("REGISTER", wrapper)); + } + + PacketBuffer wrapper2 = new PacketBuffer(Unpooled.buffer()); + wrapper2.writeBytes(this.isUsingLegacyLunarChannel ? this.cheatBreaker.getLunarPluginMessageChannel().getBytes(Charsets.UTF_8) : this.cheatBreaker.getLatestLunarPluginMessageChannel().getBytes(Charsets.UTF_8)); + if (Minecraft.getMinecraft().getNetHandler() != null) { + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C17PacketCustomPayload("REGISTER", wrapper2)); + } + this.initialize(); + } else if (customPayload.getChannelName().equals(this.cheatBreaker.getCheatBreakerPluginMessageChannel()) + || customPayload.getChannelName().equals(this.cheatBreaker.getLunarPluginMessageChannel()) + || customPayload.getChannelName().equals(this.cheatBreaker.getLatestLunarPluginMessageChannel())) { + + CBPacket packet = CBPacket.handle(this, customPayload.getBufferData()); + if (this.cheatBreaker.getGlobalSettings().isDebug && packet != null) { + packet.process(this); + Message.z(true, packet); + } + } + } catch (AssertionError | Exception ex) { + ex.printStackTrace(); + } + } + + private void initialize() { +// this.cb.getModuleManager().miniMapMod.getVoxelMap().getWaypointManager().getWaypoints().removeIf(var0 -> var0.isAutomated); + this.voiceChatEnabled = false; + this.serverHandlesWaypoints = false; + this.voiceChannels = null; + this.currentVoiceChannel = null; + this.competitiveGameMode = false; + this.worldUID = ""; + this.mutedPlayers.clear(); + for (StaffMod staffMod : this.cheatBreaker.getModuleManager().staffMods) { + staffMod.disableStaffModule(); + } + this.cheatBreaker.getWorldBorderManager().clearBorders(); + + this.cheatBreaker.getTitleManager().getTitles().clear(); + StaffModuleNameTags.setNameTagList(null); + + ModuleZansMiniMap.rule = MiniMapRules.FORCED_OFF; + ModuleScoreboard.minimapRule = MiniMapRules.NEUTRAL; + + this.cheatBreaker.getModuleManager().teammatesMod.getTeammates().clear(); + Hologram.getHolograms().clear(); + +// VoxelMap var3 = this.cb.getModuleManager().miniMapMod.getVoxelMap(); +// if (Minecraft.getMinecraft().thePlayer != null && var3.getWaypointManager() != null) { +// var3.getWaypointManager().getWaypoints().removeIf(var0 -> var0.packetWaypoint); +// ((WaypointManager)var3.getWaypointManager()).getOld2dWayPts().removeIf(var0 -> var0.packetWaypoint); +// if (((WaypointManager)var3.getWaypointManager()).getEntityWaypointContainer() != null) { +// ((WaypointManager)var3.getWaypointManager()).getEntityWaypointContainer().wayPts.removeIf(var0 -> var0.packetWaypoint); +// MapSettingsManager.instance.saveAll(); +// var3.getWaypointManager().check2dWaypoints(); +// } +// } + } + + public void sendPacket(CBPacket packet) { + if (packet != null && this.cheatBreaker.getGlobalSettings().isDebug) { + Message.z(false, packet); + } + + PacketBuffer packetBuffer = new PacketBuffer(Unpooled.buffer()); + packetBuffer.writeBytes(CBPacket.getPacketData(Objects.requireNonNull(packet))); + C17PacketCustomPayload payload = new C17PacketCustomPayload(this.cheatBreaker.getLunarPluginMessageChannel(), packetBuffer); + Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(payload); + } + + public void onDisconnect(DisconnectEvent ignored) { + this.registeredClient = false; + this.registeredBinary = false; + } + + @Override + public void handleAddWaypoint(CBPacketAddWaypoint var1) { + int xPos = var1.getX(); + int yPos = var1.getY(); + int zPos = var1.getZ(); +// VoxelMap voxelMap = this.cb.getModuleManager().miniMapMod.getVoxelMap(); +// if (!voxelMap.getWaypointManager().getWaypoints().stream().anyMatch(lWay -> +// lWay.name.equals(var1.getName()) && lWay.sWorld.equals(var1.getWorld()))) { +// Color color = new Color(var1.getColor()); +// float red = (float)color.getRed() / 255.0f; +// float green = (float)color.getGreen() / 255.0f; +// float blue = (float)color.getBlue() / 255.0f; +// TreeSet dimensions = new TreeSet(); +// dimensions.add(-1); +// dimensions.add(0); +// dimensions.add(1); +// System.out.println("Received waypoint (" + var1.getName() + ")[x" + xPos + ",y" + +// yPos + ",z" + zPos + "][r" + red + ",g" + green + ",b" + blue + "]"); +// Waypoint waypoint = new Waypoint(var1.getName(), xPos, zPos, yPos, true, red, green, blue, "", voxelMap.getWaypointManager().getCurrentSubworldDescriptor(), dimensions, true, true); +// waypoint.forced = var1.isForced(); +// waypoint.sWorld = var1.getWorld(); +// waypoint.packetWaypoint = true; +// voxelMap.getWaypointManager().addWaypoint(waypoint); +// } + } + + @Override + public void handleRemoveWaypoint(CBPacketRemoveWaypoint var1) { +// try { +// String var2 = var1.getName(); +// VoxelMap var3 = this.cb.getModuleManager().miniMapMod.getVoxelMap(); +// var3.getWaypointManager().getWaypoints().removeIf(var2x -> var2x.sWorld.equals(var1.getWorld()) && var2x.isAutomated && var2x.name.equalsIgnoreCase(var2)); +// ((WaypointManager)var3.getWaypointManager()).getOld2dWayPts().removeIf(var2x -> var2x.sWorld.equals(var1.getWorld()) && var2x.isAutomated && var2x.name.equalsIgnoreCase(var2)); +// ((WaypointManager)var3.getWaypointManager()).getEntityWaypointContainer().wayPts.removeIf(var2x -> var2x.sWorld.equals(var1.getWorld()) && var2x.isAutomated && var2x.name.equalsIgnoreCase(var2)); +// MapSettingsManager.instance.saveAll(); +// var3.getWaypointManager().check2dWaypoints(); +// } catch (Exception var4) { +// var4.printStackTrace(); +// } + } + + @Override + public void handleCooldown(CBPacketCooldown var1) { + CheatBreaker.getInstance().getModuleManager().coolDownsMod.addCooldown(var1.getMessage(), var1.getDurationMs(), var1.getIconId()); + } + + @Override + public void handleNotification(CBPacketNotification var1) { + this.cheatBreaker.getModuleManager().notificationsMod.send( + var1.getLevel(), var1.getMessage(), var1.getDurationMs()); + } + + @Override + public void handleStaffModState(CBPacketStaffModState var1) { + for (AbstractModule var3 : this.cheatBreaker.getModuleManager().staffMods) { + if (!var3.getName().equals(var1.getMod().replaceAll("_", "").toLowerCase())) continue; + var3.setStaffModuleEnabled(var1.isState()); + } + } + + @Override + public void handleNametagsUpdate(CBPacketUpdateNametags var1) { + if (var1.getPlayersMap() != null) { + StaffModuleNameTags.setNameTagList(new HashMap<>()); + for (Map.Entry> var3 : var1.getPlayersMap().entrySet()) { + StaffModuleNameTags.getNameTagList().put(UUID.fromString(var3.getKey().toString()), var3.getValue()); + } + } else { + StaffModuleNameTags.setNameTagList(null); + } + } + + @Override + public void handleTeammates(CBPacketTeammates packet) { + Map> players = packet.getPlayers(); + UUID leader = packet.getLeader(); + long lastMs = packet.getLastMs(); + if (!(!(Boolean) this.cheatBreaker.getGlobalSettings().enableTeamView.getValue() + || players == null || players.isEmpty() || players.size() == 1 && players.containsKey(Minecraft.getMinecraft().thePlayer.getUniqueID()))) { + int var6 = 0; + for (Map.Entry> teammates : players.entrySet()) { + CBTeammate teammate = this.cheatBreaker.getModuleManager().teammatesMod.createTeammate(teammates.getKey().toString()); + if (teammate == null) { + teammate = new CBTeammate(teammates.getKey().toString(), leader != null && leader.equals(teammates.getKey())); + this.cheatBreaker.getModuleManager().teammatesMod.getTeammates().add(teammate); + Random var10 = new Random(); + if (var6 < this.cheatBreaker.getModuleManager().teammatesMod.getColors().length) { + teammate.setColor(new Color(this.cheatBreaker.getModuleManager().teammatesMod.getColors()[var6])); + } else { + float var11 = var10.nextFloat(); + float var12 = var10.nextFloat(); + float var13 = var10.nextFloat() / 2.0f; + teammate.setColor(new Color(var11, var12, var13)); + } + } + try { + double xPos = (Double) ((Map) teammates.getValue()).get("x"); + double yPos = (Double) ((Map) teammates.getValue()).get("y") + 2.0; + double zPos = (Double) ((Map) teammates.getValue()).get("z"); + teammate.updateTeammate(xPos, yPos, zPos, lastMs); + } catch (Exception var16) { + var16.printStackTrace(); + } + ++var6; + } + this.cheatBreaker.getModuleManager().teammatesMod.getTeammates().removeIf(var1x -> + !players.containsKey(UUID.fromString(var1x.getUuid()))); + } else { + this.cheatBreaker.getModuleManager().teammatesMod.getTeammates().clear(); + } + } + + @Override + public void handleOverrideNametags(CBPacketOverrideNametags packet) { + if (packet.getTags() == null) { + this.customNameTags.remove(packet.getPlayerId()); + } else { + Collections.reverse(packet.getTags()); + if (CheatBreaker.getInstance().getBranchManager().getCurrentBranch().isAboveOrEqual(BranchManager.Branch.DEVELOPMENT)) + System.out.println("playerId=" + packet.getPlayerId() + ", Tags=" + packet.getTags()); + this.customNameTags.put(packet.getPlayerId(), packet.getTags()); + } + } + + @Override + public void handleAddHologram(CBPacketAddHologram var1) { + Hologram var2 = new Hologram(var1.getUuid(), var1.getX(), var1.getY(), var1.getZ()); + Hologram.getHolograms().add(var2); + var2.setLines(var1.getLines().toArray(new String[0])); + } + + @Override + public void handleUpdateHologram(CBPacketUpdateHologram var1) { + Hologram.getHolograms().stream().filter(var1x -> + var1x.getUUID().equals(var1.getUuid())). + forEach(var1x -> var1x.setLines(var1.getLines().toArray(new String[0]))); + } + + @Override + public void handleRemoveHologram(CBPacketRemoveHologram var1) { + Hologram.getHolograms().removeIf(var1x -> var1x.getUUID().equals(var1.getUuid())); + } + + @Override + public void handleTitle(CBPacketTitle var1) { + TitleType var2 = TitleType.SUBTITLE; + if (var1.getType().equalsIgnoreCase("subtitle")) { + var2 = TitleType.TITLE; + } + this.cheatBreaker.getTitleManager().getTitles().add( + new CBTitle(var1.getMessage(), var2, var1.getScale(), + var1.getDisplayTimeMs(), var1.getFadeInTimeMs(), var1.getFadeOutTimeMs())); + } + + @Override + public void handleServerRule(CBPacketServerRule var1) { + switch (var1.getRule().ordinal()) { + case 0: + this.logger("Voice is: " + (var1.isBooleanValue() ? "enabled" : "disabled")); + this.voiceChatEnabled = var1.isBooleanValue(); + break; + case 1: + switch (var1.getStringValue()) { + case "NEUTRAL": + ModuleZansMiniMap.rule = MiniMapRules.NEUTRAL; + return; + case "FORCED_OFF": + ModuleZansMiniMap.rule = MiniMapRules.FORCED_OFF; + return; + } + return; + case 2: + this.serverHandlesWaypoints = var1.isBooleanValue(); + break; + case 3: + this.competitiveGameMode = var1.isBooleanValue(); + } + } + + @Override + public void handleVoice(CBPacketVoice var1) { + this.cheatBreaker.getModuleManager().voiceChat.updateUser(var1.getUuid()); + } + + @Override + public void handleVoiceChannel(CBPacketVoiceChannel var1) { + this.logger("Voice Channel Received: " + var1.getName()); + this.logger("Channel has " + var1.getPlayers().size() + " members"); + if (!this.doesVoiceChannelExist(var1.getUuid())) { + if (this.voiceChannels == null) { + this.voiceChannels = new ArrayList<>(); + } + VoiceChannel channels = new VoiceChannel(var1.getUuid(), var1.getName()); + this.voiceChannels.add(channels); + List var3 = new ArrayList<>(); + for (Map.Entry var5 : var1.getPlayers().entrySet()) { + this.logger("Added member [" + var5.getValue() + "]"); + VoiceUser user = channels.createUser(var5.getKey(), var5.getValue()); + if (user == null) continue; + var3.add(user); + } + this.addMutedUsers(var3); + for (Map.Entry var5 : var1.getListening().entrySet()) { + this.logger("Added listener [" + var5.getValue() + "]"); + channels.addListener(var5.getKey(), var5.getValue()); + } + } + } + + @Override + public void handleVoiceChannelUpdate(CBPacketVoiceChannelUpdate var1) { + this.logger("Channel Update: " + var1.getName() + " (" + var1.getStatus() + ")"); + if (this.voiceChannels != null) { + VoiceChannel var2 = this.getVoiceChannel(var1.getChannelUuid()); + if (var2 == null) { + this.logger(var1.getChannelUuid().toString()); + } else { + switch (var1.getStatus()) { + case 0: + VoiceUser var3 = var2.createUser(var1.getUuid(), var1.getName()); + if (var3 == null) break; + this.addMutedUsers(ImmutableList.of(var3)); + break; + case 1: + var2.removeUser(var1.getUuid()); + break; + case 2: + if (!var1.getUuid().toString().equals(Minecraft.getMinecraft().getSession().getPlayerID())) { + if (this.currentVoiceChannel == var2) { + ChatComponentText var4 = new ChatComponentText(EnumChatFormatting.AQUA + var1.getName() + EnumChatFormatting.AQUA + " joined " + var2.getName() + " channel. Press 'Unbound" + /*Keyboard.getKeyName(this.cb.getGlobalSettings().keyBindOpenVoiceMenu.getKeyCode()) + */"'!" + EnumChatFormatting.RESET); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(var4); + } + } else { + this.currentVoiceChannel = var2; + for (VoiceChannel var5 : this.voiceChannels) { + var5.removeListeners(var1.getUuid()); + } + ChatComponentText var4 = new ChatComponentText(EnumChatFormatting.AQUA + "Joined " + var2.getName() + " channel. Press 'Unbound" +/* Keyboard.getKeyName(this.cb.getGlobalSettings().keyBindVoicePushToTalk.getKeyCode()) + */"' to talk!" + EnumChatFormatting.RESET); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(var4); + } + var2.addListener(var1.getUuid(), var1.getName()); + break; + case 3: + if (this.currentVoiceChannel == var2 && !var1.getUuid().toString().equals(Minecraft.getMinecraft().getSession().getPlayerID())) { + ChatComponentText var4 = new ChatComponentText(EnumChatFormatting.AQUA + var1.getName() + EnumChatFormatting.AQUA + " left " + var2.getName() + " channel. Press 'Unbound" + /*Keyboard.getKeyName(this.cb.getGlobalSettings().keyBindOpenVoiceMenu.getKeyCode()) + */"'!" + EnumChatFormatting.RESET); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(var4); + } + var2.removeListeners(var1.getUuid()); + } + } + } + } + + private void addMutedUsers(List var1) { + for (VoiceUser var3 : var1) { + if (var3 == null || !this.playersInVoiceChannel.contains(var3.getPlayerUUID()) + || this.mutedPlayers.contains(var3.getPlayerUUID())) continue; + this.mutedPlayers.add(var3.getPlayerUUID()); + this.sendPacket(new PacketVoiceMute(var3.getPlayerUUID())); + } + } + + @Override + public void handleDeleteVoiceChannel(CBPacketDeleteVoiceChannel var1) { + this.logger("Deleted channel: " + var1.getUuid().toString()); + if (this.voiceChannels != null) { + this.voiceChannels.removeIf(var1x -> var1x.getUuid().equals(var1.getUuid())); + } + if (this.currentVoiceChannel != null && this.currentVoiceChannel.getUuid().equals(var1.getUuid())) { + this.currentVoiceChannel = null; + } + } + + @Override + public void handleUpdateWorld(CBPacketUpdateWorld var1) { + this.logger("World Update: " + var1.getWorld()); + this.worldUID = var1.getWorld(); + } + + @Override + public void handleServerUpdate(CBPacketServerUpdate var1) { + this.logger("Retrieved " + var1.getServer()); + this.cheatBreaker.updateServerInfo(var1.getServer()); + } + + @Override + public void handleWorldBorder(CBPacketWorldBorder packet) { + this.cheatBreaker.getWorldBorderManager().createBorder(packet.getId(), packet.getWorld(), packet.getColor(), packet.getMinX(), packet.getMinZ(), packet.getMaxX(), packet.getMaxZ(), packet.isCanShrinkExpand(), packet.isCancelsExit()); + } + + @Override + public void handleWorldBorderUpdate(CBPacketWorldBorderUpdate packet) { + this.cheatBreaker.getWorldBorderManager().updateBorder(packet.getId(), packet.getMinX(), packet.getMinZ(), packet.getMaxX(), packet.getMaxZ(), packet.getDurationTicks()); + } + + @Override + public void handleWorldBorderRemove(CBPacketWorldBorderRemove packet) { + this.cheatBreaker.getWorldBorderManager().removeBorder(packet.getId()); + } + + private boolean doesVoiceChannelExist(UUID var1) { + return this.getVoiceChannel(var1) != null; + } + + private VoiceChannel getVoiceChannel(UUID var1) { + VoiceChannel var3; + if (this.voiceChannels == null) { + return null; + } + Iterator var2 = this.voiceChannels.iterator(); + do { + if (var2.hasNext()) continue; + return null; + } while (!(var3 = var2.next()).getUuid().equals(var1)); + return var3; + } + + public VoiceUser getVoiceUser(UUID var1) { + if (this.voiceChannels != null && this.currentVoiceChannel != null) { + VoiceUser var3; + Iterator var2 = this.currentVoiceChannel.getUsers().iterator(); + do { + if (var2.hasNext()) continue; + return null; + } while (!(var3 = var2.next()).getPlayerUUID().equals(var1)); + return var3; + } + return null; + } + + private void logger(String var1) { + System.out.println("\u001b[31m[CheatBreaker]\u001b[0m " + var1); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBOutboundChannelHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBOutboundChannelHandler.java new file mode 100644 index 0000000..ffa9a65 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBOutboundChannelHandler.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.network.plugin; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelOutboundHandlerAdapter; +import io.netty.channel.ChannelPromise; +import lombok.Getter; +import lombok.SneakyThrows; + +import javax.crypto.SecretKey; + +/** + * @see ChannelOutboundHandlerAdapter + * + * This class handles the custom outbound channel for pinging. + */ +public class CBOutboundChannelHandler extends ChannelOutboundHandlerAdapter { + private long someLong2 = 1L; + private long someLong = 0L; + @Getter private long unsignedInt; + private final byte[] key = "ZB9hEJy5l+u8QARAlX9T0w".getBytes(); + + public CBOutboundChannelHandler(SecretKey secretKey) { + for (byte by : secretKey.getEncoded()) { + this.someLong2 = (this.someLong2 + (long) (by & 0xFF)) % 65521L; + this.someLong = (this.someLong + this.someLong2) % 65521L; + } + } + + @Override + @SneakyThrows + public void write(ChannelHandlerContext channelHandlerContext, Object object, ChannelPromise channelPromise) { + ByteBuf byteBuf = (ByteBuf) object; + while (byteBuf.readableBytes() > 0) { + int n = byteBuf.readByte() & 0xFF; + this.someLong2 = (this.someLong2 + (long) n) % 65521L; + this.someLong = (this.someLong + this.someLong2) % 65521L; + } + byteBuf.readerIndex(0); + for (byte by : this.key) { + this.someLong2 = (this.someLong2 + (long) (by & 0xFF)) % 65521L; + this.someLong = (this.someLong + this.someLong2) % 65521L; + } + this.unsignedInt = this.someLong << 16 | this.someLong2; + super.write(channelHandlerContext, object, channelPromise); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBPacket.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBPacket.java new file mode 100644 index 0000000..4d20f0c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/CBPacket.java @@ -0,0 +1,157 @@ +package com.cheatbreaker.client.network.plugin; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.client.PacketClientVoice; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceChannelSwitch; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; +import com.cheatbreaker.client.network.plugin.server.*; +import com.cheatbreaker.client.network.plugin.shared.CBPacketAddWaypoint; +import com.cheatbreaker.client.network.plugin.shared.CBPacketRemoveWaypoint; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import io.netty.buffer.Unpooled; +import lombok.Getter; +import lombok.Setter; + +import java.io.IOException; + +/** + * This class defines what a plugin packet is for the CheatBreaker client. + */ +public abstract class CBPacket { + private static final BiMap, Integer> REGISTRY = HashBiMap.create(); + + @Getter @Setter private Object attachment; + + /** + * Writes outgoing data. + * Example: I wrote a string using buf.writeString(); ! + */ + public abstract void write(ByteBufWrapper out) throws IOException; + + /** + * Reads incoming data. + */ + public abstract void read(ByteBufWrapper in) throws IOException; + + /** + * This gets ran when a packet is received. + * Example: When I receive the packet, a chat message is printed. + */ + public abstract void process(ICBNetHandler handler); + + /** + * Handles incoming traffic read by the packet. + */ + public static CBPacket handle(ICBNetHandler iCBNetHandler, byte[] arrby) { + return CBPacket.handle(iCBNetHandler, arrby, null); + } + + /** + * Handles the packet accordingly. + * - Updated 2/25/2022 by Noxiuam. + */ + public static CBPacket handle(ICBNetHandler netHandler, byte[] data, Object attachment) { + ByteBufWrapper wrappedBuffer = new ByteBufWrapper(Unpooled.wrappedBuffer(data)); + int packetId = wrappedBuffer.readVarInt(); + Class packetClass = REGISTRY.inverse().get(packetId); + if (packetClass != null) { + try { + CBPacket packet = (CBPacket) packetClass.newInstance(); + if (attachment != null) { + packet.setAttachment(attachment); + } + packet.read(wrappedBuffer); + return packet; + } + catch (IOException | IllegalAccessException | InstantiationException ex) { + ex.printStackTrace(); + } + } + return null; + } + + /** + * Writes to the server and returns the array. + */ + public static byte[] getPacketData(CBPacket packet) { + ByteBufWrapper wrappedBuffer = new ByteBufWrapper(Unpooled.buffer()); + wrappedBuffer.writeVarInt(REGISTRY.get(packet.getClass())); + try { + packet.write(wrappedBuffer); + } catch (IOException e) { + e.printStackTrace(); + } + return wrappedBuffer.getBuf().array(); + } + + /** + * Checks if the list already contains a packet, if not, it adds it. + */ + private static void addPacket(int id, Class clazz) { + if (REGISTRY.containsKey(clazz)) { + throw new IllegalArgumentException("Duplicate packet class (" + clazz.getSimpleName() + "), already used by " + REGISTRY.get(clazz)); + } + + if (REGISTRY.containsValue(id)) { + throw new IllegalArgumentException("Duplicate packet ID (" + id + "), already used by" + REGISTRY.inverse().get(id).getSimpleName()); + } + + REGISTRY.put(clazz, id); + } + + /** + * Writes the length of incoming traffic and the traffic itself short using the ByteBufWrapper. + */ + protected void writeBlob(ByteBufWrapper b, byte[] bytes) { + b.getBuf().writeShort(bytes.length); + b.getBuf().writeBytes(bytes); + } + + /** + * Reads incoming data and returns it as bytes. + */ + protected byte[] readBlob(ByteBufWrapper buf) { + final short index = buf.getBuf().readShort(); + + if (index >= 0) { + byte[] data = new byte[index]; + buf.getBuf().readBytes(data); + return data; + } + + System.out.println("Key was smaller than nothing! Weird key!"); + return null; + } + + /* + * Registers all the plugin packets for use on the client. + */ + static { + CBPacket.addPacket(0, PacketClientVoice.class); + CBPacket.addPacket(1, PacketVoiceMute.class); + CBPacket.addPacket(2, PacketVoiceChannelSwitch.class); + CBPacket.addPacket(3, CBPacketCooldown.class); + CBPacket.addPacket(4, CBPacketAddHologram.class); + CBPacket.addPacket(5, CBPacketUpdateHologram.class); + CBPacket.addPacket(6, CBPacketRemoveHologram.class); + CBPacket.addPacket(7, CBPacketOverrideNametags.class); + CBPacket.addPacket(8, CBPacketUpdateNametags.class); + CBPacket.addPacket(9, CBPacketNotification.class); + CBPacket.addPacket(10, CBPacketServerRule.class); + CBPacket.addPacket(11, CBPacketServerUpdate.class); + CBPacket.addPacket(12, CBPacketStaffModState.class); + CBPacket.addPacket(13, CBPacketTeammates.class); + CBPacket.addPacket(14, CBPacketTitle.class); + CBPacket.addPacket(15, CBPacketUpdateWorld.class); + CBPacket.addPacket(16, CBPacketVoice.class); + CBPacket.addPacket(17, CBPacketVoiceChannel.class); + CBPacket.addPacket(18, CBPacketDeleteVoiceChannel.class); + CBPacket.addPacket(19, CBPacketVoiceChannelUpdate.class); + CBPacket.addPacket(20, CBPacketWorldBorder.class); + CBPacket.addPacket(21, CBPacketWorldBorderRemove.class); + CBPacket.addPacket(22, CBPacketWorldBorderUpdate.class); + CBPacket.addPacket(23, CBPacketAddWaypoint.class); + CBPacket.addPacket(24, CBPacketRemoveWaypoint.class); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/ICBNetHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/ICBNetHandler.java new file mode 100644 index 0000000..28cef6c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/ICBNetHandler.java @@ -0,0 +1,12 @@ +package com.cheatbreaker.client.network.plugin; + +import com.cheatbreaker.client.network.plugin.shared.CBPacketAddWaypoint; +import com.cheatbreaker.client.network.plugin.shared.CBPacketRemoveWaypoint; + +public interface ICBNetHandler { + + void handleAddWaypoint(CBPacketAddWaypoint var1); + + void handleRemoveWaypoint(CBPacketRemoveWaypoint var1); + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/ICBNetHandlerClient.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/ICBNetHandlerClient.java new file mode 100644 index 0000000..e688fde --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/ICBNetHandlerClient.java @@ -0,0 +1,48 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.server.*; + +public interface ICBNetHandlerClient extends ICBNetHandler { + + void handleCooldown(CBPacketCooldown var1); + + void handleNotification(CBPacketNotification var1); + + void handleStaffModState(CBPacketStaffModState var1); + + void handleNametagsUpdate(CBPacketUpdateNametags var1); + + void handleTeammates(CBPacketTeammates var1); + + void handleOverrideNametags(CBPacketOverrideNametags var1); + + void handleAddHologram(CBPacketAddHologram var1); + + void handleUpdateHologram(CBPacketUpdateHologram var1); + + void handleRemoveHologram(CBPacketRemoveHologram var1); + + void handleTitle(CBPacketTitle var1); + + void handleServerRule(CBPacketServerRule var1); + + void handleVoice(CBPacketVoice var1); + + void handleVoiceChannel(CBPacketVoiceChannel var1); + + void handleVoiceChannelUpdate(CBPacketVoiceChannelUpdate var1); + + void handleDeleteVoiceChannel(CBPacketDeleteVoiceChannel var1); + + void handleUpdateWorld(CBPacketUpdateWorld var1); + + void handleServerUpdate(CBPacketServerUpdate var1); + + void handleWorldBorder(CBPacketWorldBorder var1); + + void handleWorldBorderUpdate(CBPacketWorldBorderUpdate var1); + + void handleWorldBorderRemove(CBPacketWorldBorderRemove var1); + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketClientVoice.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketClientVoice.java new file mode 100644 index 0000000..b3f074d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketClientVoice.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.server.ICBNetHandlerServer; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * @CBPacket PacketClientVoice + * @see CBPacket + * + * This CBPacket writes and reads voice data, from which the server and client + * will send to each other for Voice Chat related transmissions. + * + * @implNote - The client will translate the byte data to actual sound. + * The server will send the byte data to everyone in the current Voice Channel. + */ +@Getter @NoArgsConstructor @AllArgsConstructor +public class PacketClientVoice extends CBPacket { + private byte[] data; + + @Override + public void write(ByteBufWrapper out) { + this.writeBlob(out, this.data); + } + + @Override + public void read(ByteBufWrapper in) { + this.data = this.readBlob(in); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerServer) handler).handleClientVoice(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceChannelSwitch.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceChannelSwitch.java new file mode 100644 index 0000000..32f07f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceChannelSwitch.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.server.ICBNetHandlerServer; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.UUID; + +/** + * @CBPacket PacketVoiceChannelSwitch + * @see CBPacket + * + * This CBPacket reads and writes channel UUIDs for successful Voice Channel switching. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class PacketVoiceChannelSwitch extends CBPacket { + private UUID switchingTo; + + @Override + public void write(ByteBufWrapper out) { + out.writeUUID(this.switchingTo); + } + + @Override + public void read(ByteBufWrapper in) { + this.switchingTo = in.readUUID(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerServer) handler).handleVoiceChannelSwitch(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceMute.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceMute.java new file mode 100644 index 0000000..74ac873 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceMute.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.server.ICBNetHandlerServer; + +import java.util.UUID; + +/** + * @CBPacket PacketVoiceMute + * @see CBPacket + * + * This CBPacket reads and writes player UUIDs for self muting and locally muting other players. + */ +public class PacketVoiceMute extends CBPacket { + private UUID muting; + + public PacketVoiceMute() { + } + + public PacketVoiceMute(UUID uUID) { + this.muting = uUID; + } + + @Override + public void write(ByteBufWrapper out) { + out.writeUUID(this.muting); + } + + @Override + public void read(ByteBufWrapper in) { + this.muting = in.readUUID(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerServer) handler).handleVoiceMute(this); + } + + public UUID getMuting() { + return this.muting; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/obj/ServerRule.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/obj/ServerRule.java new file mode 100644 index 0000000..60f54f6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/obj/ServerRule.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.network.plugin.obj; + +import lombok.Getter; + +/** + * @see com.cheatbreaker.client.network.plugin.server.CBPacketServerRule + * + * This defines the server rules for Voice Chat, and other things. + */ +public enum ServerRule { + VOICE_ENABLED("voiceEnabled", Boolean.class), + MINIMAP_STATUS("minimapStatus", String.class), + SERVER_HANDLES_WAYPOINTS("serverHandlesWaypoints", Boolean.class), + COMPETITIVE_GAMEMODE("competitiveGame", Boolean.class), + + // These are from Lunar Client, mainly to stop constant errors. + LEGACY_ENCHANTING("legacyEnchanting", Boolean.class), + LEGACY_COMBAT("legacyCombat", Boolean.class); + + @Getter private final String ruleName; + @Getter private final Class ruleValue; + ServerRule(String ruleName, Class ruleValue) { + this.ruleName = ruleName; + this.ruleValue = ruleValue; + } + + public static ServerRule getRuleByName(String name) { + ServerRule ruleToGet = null; + for (ServerRule rule : ServerRule.values()) { + if (!rule.getRuleName().equals(name)) continue; + ruleToGet = rule; + } + return ruleToGet; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketAddHologram.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketAddHologram.java new file mode 100644 index 0000000..dc2c269 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketAddHologram.java @@ -0,0 +1,62 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * @CBPacket CBPacketAddHologram + * @see CBPacket + * + * This packet adds a Hologram via the client's custom Hologram system. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketAddHologram extends CBPacket { + private List lines; + + private UUID uuid; + + private double x; + private double y; + private double z; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeUUID(this.uuid); + out.getBuf().writeDouble(this.x); + out.getBuf().writeDouble(this.y); + out.getBuf().writeDouble(this.z); + out.writeVarInt(this.lines.size()); + this.lines.forEach(out::writeString); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.uuid = in.readUUID(); + this.x = in.getBuf().readDouble(); + this.y = in.getBuf().readDouble(); + this.z = in.getBuf().readDouble(); + + int linesSize = in.readVarInt(); + + this.lines = new ArrayList<>(); + + for (int i = 0; i < linesSize; ++i) { + this.lines.add(in.readString()); + } + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleAddHologram(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketCooldown.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketCooldown.java new file mode 100644 index 0000000..5f08d09 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketCooldown.java @@ -0,0 +1,46 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketCooldown + * @see CBPacket + * @see com.cheatbreaker.client.module.impl.normal.hud.cooldowns.ModuleCooldowns + * + * This packet adds a Cooldown via CheatBreaker's Cooldown Module. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketCooldown extends CBPacket { + + private String message; + private long durationMs; + private int iconId; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.message); + out.getBuf().writeLong(this.durationMs); + out.getBuf().writeInt(this.iconId); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.message = in.readString(); + this.durationMs = in.getBuf().readLong(); + this.iconId = in.getBuf().readInt(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleCooldown(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketDeleteVoiceChannel.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketDeleteVoiceChannel.java new file mode 100644 index 0000000..7d3e550 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketDeleteVoiceChannel.java @@ -0,0 +1,41 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.UUID; + +/** + * @CBPacket CBPacketDeleteVoiceChannel + * @see CBPacket + * + * This packet removes a voice channel from the client. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketDeleteVoiceChannel extends CBPacket { + + private UUID uuid; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeUUID(this.uuid); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.uuid = in.readUUID(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleDeleteVoiceChannel(this); + } + + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketNotification.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketNotification.java new file mode 100644 index 0000000..67bdfd4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketNotification.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketNotification + * @see CBPacket + * + * This packet handles Notifications via CheatBreaker's Notification Module. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketNotification extends CBPacket { + + private String message; + private long durationMs; + private String level; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.message); + out.getBuf().writeLong(this.durationMs); + out.writeString(this.level); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.message = in.readString(); + this.durationMs = in.getBuf().readLong(); + this.level = in.readString(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleNotification(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketOverrideNametags.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketOverrideNametags.java new file mode 100644 index 0000000..eb41d82 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketOverrideNametags.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * @CBPacket CBPacketOverrideNametags + * @see CBPacket + * + * This packet overrides a player's nametag with a custom one. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketOverrideNametags extends CBPacket { + + private UUID playerId; + private List tags; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeUUID(this.playerId); + out.writeOptional(this.tags, t -> { + out.writeVarInt(t.size()); + t.forEach(out::writeString); + }); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.playerId = in.readUUID(); + this.tags = in.readOptional(() -> { + int tagsSize = in.readVarInt(); + ArrayList tags = new ArrayList<>(); + for (int i = 0; i < tagsSize; ++i) { + tags.add(in.readString()); + } + return tags; + }); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleOverrideNametags(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketRemoveHologram.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketRemoveHologram.java new file mode 100644 index 0000000..8e791d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketRemoveHologram.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.UUID; + +/** + * @CBPacket CBPacketRemoveHologram + * @see CBPacket + * + * This packet removes a Hologram from the custom CheatBreaker Hologram system. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketRemoveHologram extends CBPacket { + + private UUID uuid; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeUUID(this.uuid); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.uuid = in.readUUID(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleRemoveHologram(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketServerRule.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketServerRule.java new file mode 100644 index 0000000..af5908c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketServerRule.java @@ -0,0 +1,84 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.plugin.obj.ServerRule; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketServerRule + * @see CBPacket + * + * This packet handles incoming Server Rules set by the server. + */ +@Getter @NoArgsConstructor +public class CBPacketServerRule extends CBPacket { + + private ServerRule rule; + + private String stringValue = ""; + + private int intValue; + + private float floatValue; + + private boolean booleanValue; + + public CBPacketServerRule(ServerRule rule, float value) { + this(rule); + this.floatValue = value; + } + + public CBPacketServerRule(ServerRule rule, boolean value) { + this(rule); + this.booleanValue = value; + } + + public CBPacketServerRule(ServerRule rule, int value) { + this(rule); + this.intValue = value; + } + + public CBPacketServerRule(ServerRule rule, String value) { + this(rule); + this.stringValue = value; + } + + private CBPacketServerRule(ServerRule rule) { + this.rule = rule; + } + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.rule.getRuleName()); + out.getBuf().writeBoolean(this.booleanValue); + out.getBuf().writeInt(this.intValue); + out.getBuf().writeFloat(this.floatValue); + out.writeString(this.stringValue); + } + + @Override + protected byte[] readBlob(ByteBufWrapper buf) { + return super.readBlob(buf); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.rule = ServerRule.getRuleByName(in.readString()); + this.booleanValue = in.getBuf().readBoolean(); + this.intValue = in.getBuf().readInt(); + this.floatValue = in.getBuf().readFloat(); + this.stringValue = in.readString(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleServerRule(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketServerUpdate.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketServerUpdate.java new file mode 100644 index 0000000..59db1b6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketServerUpdate.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketServerUpdate + * @see CBPacket + * + * This packet updates the server address on the client's Discord RPC. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketServerUpdate extends CBPacket { + + private String server; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.server); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.server = in.readString(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleServerUpdate(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketStaffModState.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketStaffModState.java new file mode 100644 index 0000000..4f71294 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketStaffModState.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketStaffModState + * @see CBPacket + * + * This packet updates the player's staff mod state. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketStaffModState extends CBPacket { + + private String mod; + + private boolean state; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.mod); + out.getBuf().writeBoolean(this.state); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.mod = in.readString(); + this.state = in.getBuf().readBoolean(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleStaffModState(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketTeammates.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketTeammates.java new file mode 100644 index 0000000..ce10d82 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketTeammates.java @@ -0,0 +1,76 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * @CBPacket CBPacketTeammates + * @see CBPacket + * + * This packet updates a player's teammate arrow. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketTeammates extends CBPacket { + + private UUID leader; + + private long lastMs; + + private Map> players; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.getBuf().writeBoolean(this.leader != null); + if (this.leader != null) { + out.writeUUID(this.leader); + } + out.getBuf().writeLong(this.lastMs); + out.writeVarInt(this.players.values().size()); + for (Map.Entry> playerMap : this.players.entrySet()) { + out.writeUUID(playerMap.getKey()); + out.writeVarInt(playerMap.getValue().values().size()); + for (Map.Entry posMap : playerMap.getValue().entrySet()) { + out.writeString(posMap.getKey()); + out.getBuf().writeDouble(posMap.getValue()); + } + } + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + boolean hasLeader = in.getBuf().readBoolean(); + if (hasLeader) { + this.leader = in.readUUID(); + } + this.lastMs = in.getBuf().readLong(); + int playersSize = in.readVarInt(); + this.players = new HashMap<>(); + for (int i = 0; i < playersSize; ++i) { + UUID uuid = in.readUUID(); + int posMapSize = in.readVarInt(); + HashMap posMap = new HashMap<>(); + for (int j = 0; j < posMapSize; ++j) { + String key = in.readString(); + double val = in.getBuf().readDouble(); + posMap.put(key, val); + } + this.players.put(uuid, posMap); + } + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleTeammates(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketTitle.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketTitle.java new file mode 100644 index 0000000..653110c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketTitle.java @@ -0,0 +1,67 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketTitle + * @see CBPacket + * + * This packet adds a title via the CheatBreaker Title System. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketTitle extends CBPacket { + private String type; + private String message; + + private long displayTimeMs; + private long fadeInTimeMs; + private long fadeOutTimeMs; + + private float scale; + + public CBPacketTitle(String type, String message, long displayTimeMs, long fadeInTimeMs, long fadeOutTimeMs) { + this(type, message, 1.0f, displayTimeMs, fadeInTimeMs, fadeOutTimeMs); + } + + public CBPacketTitle(String type, String message, float scale, long displayTimeMs, long fadeInTimeMs, long fadeOutTimeMs) { + this.type = type; + this.message = message; + this.scale = scale; + this.displayTimeMs = displayTimeMs; + this.fadeInTimeMs = fadeInTimeMs; + this.fadeOutTimeMs = fadeOutTimeMs; + } + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.type); + out.writeString(this.message); + out.getBuf().writeFloat(this.scale); + out.getBuf().writeLong(this.displayTimeMs); + out.getBuf().writeLong(this.fadeInTimeMs); + out.getBuf().writeLong(this.fadeOutTimeMs); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.type = in.readString(); + this.message = in.readString(); + this.scale = in.getBuf().readFloat(); + this.displayTimeMs = in.getBuf().readLong(); + this.fadeInTimeMs = in.getBuf().readLong(); + this.fadeOutTimeMs = in.getBuf().readLong(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleTitle(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateHologram.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateHologram.java new file mode 100644 index 0000000..7ddd775 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateHologram.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * @CBPacket CBPacketUpdateHologram + * @see CBPacket + * + * This packet updates an already existing Hologram via the CheatBreaker Hologram System. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketUpdateHologram extends CBPacket { + + private UUID uuid; + private List lines; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeUUID(this.uuid); + out.writeVarInt(this.lines.size()); + for (String string : this.lines) { + out.writeString(string); + } + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.uuid = in.readUUID(); + int linesSize = in.readVarInt(); + this.lines = new ArrayList<>(); + for (int i = 0; i < linesSize; ++i) { + this.lines.add(in.readString()); + } + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleUpdateHologram(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateNametags.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateNametags.java new file mode 100644 index 0000000..d4b931f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateNametags.java @@ -0,0 +1,63 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.*; + +/** + * @CBPacket CBPacketUpdateNametags + * @see CBPacket + * + * This packet updates an already existing nametag override. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketUpdateNametags extends CBPacket { + + private Map> playersMap; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeVarInt(this.playersMap == null ? -1 : this.playersMap.size()); + if (this.playersMap != null) { + for (Map.Entry> entry : this.playersMap.entrySet()) { + UUID uuid = entry.getKey(); + List tags = entry.getValue(); + out.writeUUID(uuid); + out.writeVarInt(tags.size()); + tags.forEach(out::writeString); + } + } + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + int playersMapSize = in.readVarInt(); + if (playersMapSize == -1) { + this.playersMap = null; + } else { + this.playersMap = new HashMap<>(); + for (int i = 0; i < playersMapSize; ++i) { + UUID uuid = in.readUUID(); + int tagsSize = in.readVarInt(); + ArrayList tags = new ArrayList(); + for (int j = 0; j < tagsSize; ++j) { + tags.add(in.readString()); + } + this.playersMap.put(uuid, tags); + } + } + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleNametagsUpdate(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateWorld.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateWorld.java new file mode 100644 index 0000000..4d44bd4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketUpdateWorld.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketUpdateWorld + * @see CBPacket + * + * This packet updates the client's world. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketUpdateWorld extends CBPacket { + + private String world; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.world); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.world = in.readString(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient)handler).handleUpdateWorld(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoice.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoice.java new file mode 100644 index 0000000..8f58d1b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoice.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.UUID; + +/** + * @CBPacket CBPacketVoice + * @see CBPacket + * + * This packet handles incoming and outgoing voice data. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketVoice extends CBPacket { + + private UUID uuid; + private byte[] data; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeUUID(this.uuid); + this.writeBlob(out, this.data); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.uuid = in.readUUID(); + this.data = this.readBlob(in); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleVoice(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoiceChannel.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoiceChannel.java new file mode 100644 index 0000000..8563cfe --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoiceChannel.java @@ -0,0 +1,72 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** + * @CBPacket CBPacketVoiceChannel + * @see CBPacket + * + * This packet adds a Voice Channel that the player can see and join. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketVoiceChannel extends CBPacket { + + private UUID uuid; + private String name; + private Map players; + private Map listening; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeUUID(this.uuid); + out.writeString(this.name); + this.writeMap(out, this.players); + this.writeMap(out, this.listening); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.uuid = in.readUUID(); + this.name = in.readString(); + this.players = this.readMap(in); + this.listening = this.readMap(in); + } + + private void writeMap(ByteBufWrapper out, Map players) { + out.writeVarInt(players.size()); + players.forEach((key, value) -> { + out.writeUUID(key); + out.writeString(value); + }); + } + + private Map readMap(ByteBufWrapper in) { + int size = in.readVarInt(); + HashMap players = new HashMap<>(); + + for (int i = 0; i < size; ++i) { + UUID uuid = in.readUUID(); + String name = in.readString(); + players.put(uuid, name); + } + + return players; + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleVoiceChannel(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoiceChannelUpdate.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoiceChannelUpdate.java new file mode 100644 index 0000000..3c9af66 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketVoiceChannelUpdate.java @@ -0,0 +1,48 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.UUID; + +/** + * @CBPacket CBPacketVoiceChannelUpdate + * @see CBPacket + * + * This packet updates a voice channel on the client. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketVoiceChannelUpdate extends CBPacket { + + public int status; + private UUID channelUuid; + private UUID uuid; + private String name; + + @Override + public void write(ByteBufWrapper out) { + out.writeVarInt(this.status); + out.writeUUID(this.channelUuid); + out.writeUUID(this.uuid); + out.writeString(this.name); + } + + @Override + public void read(ByteBufWrapper in) { + this.status = in.readVarInt(); + this.channelUuid = in.readUUID(); + this.uuid = in.readUUID(); + this.name = in.readString(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleVoiceChannelUpdate(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorder.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorder.java new file mode 100644 index 0000000..209ec41 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorder.java @@ -0,0 +1,63 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketWorldBorder + * @see CBPacket + * + * This packet adds a custom world border to the client. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketWorldBorder extends CBPacket { + + private String id; + private String world; + private boolean cancelsExit; + private boolean canShrinkExpand; + private int color = -13421569; + private double minX; + private double minZ; + private double maxX; + private double maxZ; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeOptional(this.id, out::writeString); + out.writeString(this.world); + out.getBuf().writeBoolean(this.cancelsExit); + out.getBuf().writeBoolean(this.canShrinkExpand); + out.getBuf().writeInt(this.color); + out.getBuf().writeDouble(this.minX); + out.getBuf().writeDouble(this.minZ); + out.getBuf().writeDouble(this.maxX); + out.getBuf().writeDouble(this.maxZ); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.id = in.readOptional(in::readString); + this.world = in.readString(); + this.cancelsExit = in.getBuf().readBoolean(); + this.canShrinkExpand = in.getBuf().readBoolean(); + this.color = in.getBuf().readInt(); + this.minX = in.getBuf().readDouble(); + this.minZ = in.getBuf().readDouble(); + this.maxX = in.getBuf().readDouble(); + this.maxZ = in.getBuf().readDouble(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleWorldBorder(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorderRemove.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorderRemove.java new file mode 100644 index 0000000..0997f3c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorderRemove.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketWorldBorderRemove + * @see CBPacket + * + * This packet removes a custom world border from the client. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketWorldBorderRemove extends CBPacket { + + private String id; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.id); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.id = in.readString(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleWorldBorderRemove(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorderUpdate.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorderUpdate.java new file mode 100644 index 0000000..4511d02 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/CBPacketWorldBorderUpdate.java @@ -0,0 +1,54 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.io.IOException; + +/** + * @CBPacket CBPacketWorldBorderUpdate + * @see CBPacket + * + * This packet updates an already existing custom world border in the client. + */ +@AllArgsConstructor @NoArgsConstructor @Getter +public class CBPacketWorldBorderUpdate extends CBPacket { + + private String id; + private double minX; + private double minZ; + private double maxX; + private double maxZ; + private int durationTicks; + + @Override + public void write(ByteBufWrapper out) throws IOException { + out.writeString(this.id); + out.getBuf().writeDouble(this.minX); + out.getBuf().writeDouble(this.minZ); + out.getBuf().writeDouble(this.maxX); + out.getBuf().writeDouble(this.maxZ); + out.getBuf().writeInt(this.durationTicks); + } + + @Override + public void read(ByteBufWrapper in) throws IOException { + this.id = in.readString(); + this.minX = in.getBuf().readDouble(); + this.minZ = in.getBuf().readDouble(); + this.maxX = in.getBuf().readDouble(); + this.maxZ = in.getBuf().readDouble(); + this.durationTicks = in.getBuf().readInt(); + } + + @Override + public void process(ICBNetHandler handler) { + ((ICBNetHandlerClient) handler).handleWorldBorderUpdate(this); + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/ICBNetHandlerServer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/ICBNetHandlerServer.java new file mode 100644 index 0000000..af53402 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/server/ICBNetHandlerServer.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.PacketClientVoice; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceChannelSwitch; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; + +public interface ICBNetHandlerServer extends ICBNetHandler { + + void handleClientVoice(PacketClientVoice var1); + + void handleVoiceChannelSwitch(PacketVoiceChannelSwitch var1); + + void handleVoiceMute(PacketVoiceMute var1); + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/shared/CBPacketAddWaypoint.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/shared/CBPacketAddWaypoint.java new file mode 100644 index 0000000..783c5ff --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/shared/CBPacketAddWaypoint.java @@ -0,0 +1,58 @@ +package com.cheatbreaker.client.network.plugin.shared; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * @CBPacket CBPacketAddWaypoint + * @see CBPacket + * + * This packet adds a Waypoint to Zans Minimap. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class CBPacketAddWaypoint extends CBPacket { + + private String name; + private String world; + + private int color; + private int x; + private int y; + private int z; + + private boolean forced; + private boolean visible; + + @Override + public void write(ByteBufWrapper out) { + out.writeString(this.name); + out.writeString(this.world); + out.getBuf().writeInt(this.color); + out.getBuf().writeInt(this.x); + out.getBuf().writeInt(this.y); + out.getBuf().writeInt(this.z); + out.getBuf().writeBoolean(this.forced); + out.getBuf().writeBoolean(this.visible); + } + + @Override + public void read(ByteBufWrapper in) { + this.name = in.readString(); + this.world = in.readString(); + this.color = in.getBuf().readInt(); + this.x = in.getBuf().readInt(); + this.y = in.getBuf().readInt(); + this.z = in.getBuf().readInt(); + this.forced = in.getBuf().readBoolean(); + this.visible = in.getBuf().readBoolean(); + } + + @Override + public void process(ICBNetHandler handler) { + handler.handleAddWaypoint(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/shared/CBPacketRemoveWaypoint.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/shared/CBPacketRemoveWaypoint.java new file mode 100644 index 0000000..29aad6a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/plugin/shared/CBPacketRemoveWaypoint.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.network.plugin.shared; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +/** + * @CBPacket CBPacketRemoveWaypoint + * @see CBPacket + * + * This packet removes a Waypoint to Zans Minimap. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class CBPacketRemoveWaypoint extends CBPacket { + private String name; + private String world; + + @Override + public void write(ByteBufWrapper out) { + out.writeString(this.name); + out.writeString(this.world); + } + + @Override + public void read(ByteBufWrapper in) { + this.name = in.readString(); + this.world = in.readString(); + } + + @Override + public void process(ICBNetHandler handler) { + handler.handleRemoveWaypoint(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/WSNetHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/WSNetHandler.java new file mode 100644 index 0000000..aa49886 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/WSNetHandler.java @@ -0,0 +1,487 @@ +package com.cheatbreaker.client.network.websocket; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.cosmetic.CosmeticManager; +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.cosmetic.profile.ClientProfile; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import com.cheatbreaker.client.network.messages.Message; +import com.cheatbreaker.client.network.websocket.client.*; +import com.cheatbreaker.client.network.websocket.server.*; +import com.cheatbreaker.client.network.websocket.shared.*; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.CBAlert; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.overlay.friend.FriendRequestElement; +import com.cheatbreaker.client.ui.overlay.friend.MessagesElement; +import com.cheatbreaker.client.util.friend.data.Friend; +import com.cheatbreaker.client.util.friend.data.FriendRequest; +import com.cheatbreaker.client.util.manager.BranchManager; +import com.cheatbreaker.client.util.thread.AssetServerReconnectThread; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.exceptions.InvalidCredentialsException; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.PacketBuffer; +import net.minecraft.src.Config; +import net.minecraft.util.CryptManager; +import net.minecraft.util.EnumChatFormatting; +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.drafts.Draft_6455; +import org.java_websocket.handshake.ServerHandshake; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.math.BigInteger; +import java.net.URI; +import java.nio.ByteBuffer; +import java.security.KeyFactory; +import java.security.PublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.*; + +/** + * @see WebSocketClient + * + * This class is basically a way for the client to know what to do + * when receiving certain packets from the asset server. + */ +public class WSNetHandler extends WebSocketClient { + + private final Minecraft mc = Minecraft.getMinecraft(); + private final List playersCache = new ArrayList<>(); + + public WSNetHandler(URI url, Map data) { + super(url, new Draft_6455(), data, 0); + } + + @Override + public boolean isOpen() { + return super.isOpen(); + } + + public void sendPacket(WSPacket var1) { + if (this.isOpen()) { + PacketBuffer var2 = new PacketBuffer(Unpooled.buffer()); + var2.writeVarIntToBuffer(WSPacket.REGISTRY.get(var1.getClass())); + try { + var1.write(var2); + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "[WS NetHandler] (OUT) id: " + + WSPacket.REGISTRY.get(var1.getClass()) + " Name: " + var1.getClass().getSimpleName()); + + this.send(var2.array()); + } catch (Exception var4) { + var4.printStackTrace(); + } + } + } + + public void handleIncoming(PacketBuffer var1) { + int var2 = var1.readVarIntFromBuffer(); + Class var3 = WSPacket.REGISTRY.inverse().get(var2); + try { + WSPacket var4 = var3 == null ? null : var3.newInstance(); + if (var4 == null) { + return; + } + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "[WS NetHandler] (IN) id: " + var2 + " Name: " + var4.getClass().getSimpleName()); + var4.read(var1); + var4.process(this); + + } catch (Exception var5) { + CheatBreaker.getInstance().logger.error("Error from: " + var3); + var5.printStackTrace(); + } + } + + @Override + public void onOpen(ServerHandshake var1) { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Connection established"); + if (Minecraft.getMinecraft().getSession().getUsername().equalsIgnoreCase("Aplosh")) { + CheatBreaker.getInstance().getCosmeticManager().getWings().add(new Cosmetic(CheatBreaker.getInstance().getProfileHandler().recompileUUID(Minecraft.getMinecraft().getSession().getPlayerID()), "Black_Wings", Cosmetic.CosmeticType.WINGS, 0.13F, true, "client/wings/black.png")); + CheatBreaker.getInstance().getCosmeticManager().getCapes().add(new Cosmetic(CheatBreaker.getInstance().getProfileHandler().recompileUUID(Minecraft.getMinecraft().getSession().getPlayerID()), "CheatBreaker", Cosmetic.CosmeticType.CAPE, 0.16F, true, "client/capes/cb2.png")); + } + if (Objects.equals(Minecraft.getMinecraft().getSession().getUsername(), Minecraft.getMinecraft().getSession().getPlayerID())) { + this.close(); + } + } + + @Override + public void onMessage(String message) { + if (this.isOpen()) { + super.send(message); + } + } + + @Override + public void onMessage(ByteBuffer var1) { + this.handleIncoming(new PacketBuffer(Unpooled.wrappedBuffer(var1.array()))); + } + + public void handleConsoleOutput(WSPacketConsoleMessage var1) { + CheatBreaker.getInstance().getConsoleLines().add(var1.getMessage()); + } + + public void handleFriendRemove(WSPacketClientFriendRemove var1) { + String var2 = var1.getPlayerId(); + Friend var3 = CheatBreaker.getInstance().getFriendsManager().getFriend(var2); + if (var3 != null) { + CheatBreaker.getInstance().getFriendsManager().getFriends().remove(var2); + OverlayGui.getInstance().handleFriend(var3, false); + } + } + + public void handleMessage(WSPacketFriendMessage var1) { + String playerId = var1.getPlayerId(); + String message = var1.getMessage(); + Friend friend = CheatBreaker.getInstance().getFriendsManager().getFriends().get(playerId); + if (friend != null) { + CheatBreaker.getInstance().getFriendsManager().addUnreadMessage(friend.getPlayerId(), message); + if (CheatBreaker.getInstance().getPlayerStatus() != Friend.Status.BUSY) { + CheatBreaker.getInstance().getAudioManager().playSound("message"); + CBAlert.displayMessage(EnumChatFormatting.GREEN + friend.getName() + EnumChatFormatting.RESET + " says:", message); + } + for (AbstractElement element : OverlayGui.getInstance().getElements()) { + if (!(element instanceof MessagesElement) || ((MessagesElement) element).getFriend() != friend) + continue; + CheatBreaker.getInstance().getFriendsManager().readMessages(friend.getPlayerId()); + } + } + } + + public void handleEmote(WSPacketEmote packet) { + EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByUUID(packet.getPlayerId()); + Emote emote = CheatBreaker.getInstance().getCosmeticManager().getEmoteById(packet.getEmoteId()); + if (emote != null) { + if (entityPlayer instanceof AbstractClientPlayer) { + CheatBreaker.getInstance().getCosmeticManager().playEmote((AbstractClientPlayer) entityPlayer, emote); + } + } else if (entityPlayer instanceof AbstractClientPlayer) { + CheatBreaker.getInstance().getCosmeticManager().stopEmote((AbstractClientPlayer) entityPlayer); + } + } + + public void sendUpdateServer(String server) { + this.sendPacket(new WSPacketServerUpdate("", server)); + } + + public void handleServerUpdate(WSPacketServerUpdate var1) { + String var2 = var1.getPlayerId(); + String var3 = var1.getServer(); + Friend var4 = CheatBreaker.getInstance().getFriendsManager().getFriends().get(var2); + if (var4 != null) { + var4.setServer(var3); + } + } + + public void handleBulkFriends(WSPacketBulkFriendRequest packet) { + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().clear(); + JsonArray friendList = packet.getBulkArray(); + for (JsonElement element : friendList) { + JsonObject friendObject = element.getAsJsonObject(); + String uuid = friendObject.get("uuid").getAsString(); + String name = friendObject.get("name").getAsString(); + FriendRequest request = new FriendRequest(name, uuid); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().put(uuid, request); + System.out.println("Added Friend"); + OverlayGui.getInstance().handleFriendRequest(request, true); + } + } + + public void handleFriendRequest(WSPacket var1, boolean var2) { + if (var2) { + WSPacketFriendRequestSent var3 = (WSPacketFriendRequestSent) var1; + FriendRequest var4 = new FriendRequest(var3.getName(), var3.getPlayerId()); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().put(var3.getPlayerId(), var4); + OverlayGui.getInstance().handleFriendRequest(var4, true); + var4.setFriend(var3.isFriend()); + CBAlert.displayMessage("Friend Request", "Request has been sent."); + } else { + WSPacketFriendRequest var7 = (WSPacketFriendRequest) var1; + String var8 = var7.getUsername(); + String var5 = var7.getPlayerId(); + FriendRequest var6 = new FriendRequest(var5, var8); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().put(var8, var6); + OverlayGui.getInstance().handleFriendRequest(var6, true); + if (CheatBreaker.getInstance().getPlayerStatus() != Friend.Status.BUSY) { + CheatBreaker.getInstance().getAudioManager().playSound("message"); + CBAlert.displayMessage("Friend Request", var6.getUsername() + " wants to be your friend."); + } + } + } + + private void handlePlayerConnected(JsonObject var1) { + String var2 = var1.get("result").getAsString(); + if (var2.equals("SUCCESS")) { + CBAlert.displayMessage(EnumChatFormatting.GREEN + "Connected", "Welcome, " + this.mc.getSession().getUsername() + "."); + } + } + + public void handleFriendUpdate(WSPacketFriendUpdate var1) { + String playerId = var1.getPlayerId(); + String name = var1.getName(); + boolean online = var1.isOnline(); + Friend var5 = CheatBreaker.getInstance().getFriendsManager().getFriends().get(playerId); + if (var5 == null) { + var5 = Friend.builder().online(online).name(name).playerId(playerId).online(online).onlineStatus(Friend.Status.ONLINE).build(); + CheatBreaker.getInstance().getFriendsManager().getFriends().put(playerId, var5); + OverlayGui.getInstance().handleFriend(var5, true); + } + if (var1.getOfflineSince() < 10L) { + int var6 = (int) var1.getOfflineSince(); + Friend.Status status = Friend.Status.ONLINE; + for (Friend.Status fStatus : Friend.Status.values()) { + if (fStatus.ordinal() != var6) continue; + status = fStatus; + } + var5.setOnlineStatus(status); + } + var5.setOnline(online); + var5.setName(name); + OverlayGui.getInstance().getFriendsListElement().updateSize(); + if (!online) { + var5.setOfflineSince(var1.getOfflineSince()); + } + } + + public void handleFriendsUpdate(WSPacketFriendsListUpdate packet) { + String name; + String uuid; + CheatBreaker.getInstance().getFriendsManager().getFriends().clear(); + Map> var2 = packet.getOnlineFriends(); + Map> var3 = packet.getOfflineFriends(); + CheatBreaker.getInstance().setConsoleAccess(packet.isConsoleAllowed()); + CheatBreaker.getInstance().setAcceptingFriendRequests(packet.isRequestsEnabled()); + for (Map.Entry> entry : var2.entrySet()) { + uuid = entry.getKey(); + name = (String) ((List) entry.getValue()).get(0); + int statusOrdinal = Integer.parseInt(entry.getValue().get(1)); + String server = (String) ((List) entry.getValue()).get(2); + Friend.Status onlineStatus = Friend.Status.ONLINE; + for (Friend.Status status : Friend.Status.values()) { + if (status.ordinal() != statusOrdinal) continue; + onlineStatus = status; + } + Friend friend = Friend.builder().name(name).playerId(uuid).server(server).onlineStatus(onlineStatus).online(true).status("Online").build(); + CheatBreaker.getInstance().getFriendsManager().getFriends().put(uuid, friend); + OverlayGui.getInstance().handleFriend(friend, true); + } + for (Map.Entry> entry : var3.entrySet()) { + uuid = entry.getKey(); + name = (String) ((List) entry.getValue()).get(0); + Friend friend = Friend.builder().name(name).playerId(uuid).server("") + .onlineStatus(Friend.Status.ONLINE).online(false) + .status("Online").offlineSince(Long.parseLong(entry.getValue().get(1))).build(); + CheatBreaker.getInstance().getFriendsManager().getFriends().put(uuid, friend); + OverlayGui.getInstance().handleFriend(friend, true); + } + } + + public void handleCosmetics(WSPacketCosmetics packet) { + String uuid = packet.getPlayerId(); + CosmeticManager manager = CheatBreaker.getInstance().getCosmeticManager(); + + ProfileHandler profileHandler = CheatBreaker.getInstance().getProfileHandler(); + if (!uuid.contains("-")) { + uuid = profileHandler.recompileUUID(packet.getPlayerId()); + } else { + uuid = packet.getPlayerId(); + } + + if (packet.isJoin()) { + profileHandler.getWsOnlineUsers().put(UUID.fromString(uuid), new ClientProfile(packet.getUsername(), packet.getColor(), packet.getColor2())); + } else { + profileHandler.getWsOnlineUsers().remove(UUID.fromString(uuid)); + } + + if (Minecraft.getMinecraft().getSession().getUsername().startsWith("Nox")) { + return; + } + + CheatBreaker.getInstance().getCosmeticManager().clearCosmetics(uuid); + + for (Cosmetic cosmetic : packet.getCosmetics()) { + try { + + switch (cosmetic.getType().getTypeName()) { + case "cape": + manager.getCapes().add(cosmetic); + break; + case "emote": + manager.getEmotes().add(cosmetic.getEmoteId()); + break; + case "dragon_wings": + manager.getWings().add(cosmetic); + break; + } + + EntityPlayer entity = this.mc.theWorld == null ? null : this.mc.theWorld.getPlayerEntityByUUID(UUID.fromString(uuid)); + if (!cosmetic.isEquipped() || !(entity instanceof AbstractClientPlayer)) continue; + if (cosmetic.getType().getTypeName().equals("cape")) { + ((AbstractClientPlayer) entity).setLocationOfCape(cosmetic.getLocation()); + entity.setCBCape(cosmetic); + continue; + } + + entity.setCBWings(cosmetic); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + @Override + public void onClose(int code, String reason, boolean remote) { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Connection closed: " + reason + " (" + code + ") - " + remote); + new AssetServerReconnectThread().start(); + OverlayGui.getInstance().getFriendRequestsElement().getElements().clear(); + OverlayGui.getInstance().getFriendsListElement().getElements().clear(); + CheatBreaker.getInstance().getFriendsManager().getFriends().clear(); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().clear(); + } + + @Override + public void onError(Exception var1) { + CheatBreaker.getInstance().logger.error(CheatBreaker.getInstance().loggerPrefix + "Error: " + var1.getMessage()); + var1.printStackTrace(); + } + + public void handleFormattedConsoleOutput(WSPacketNotification packet) { + String title = packet.getTitle(); + String message = packet.getContent(); + CheatBreaker.getInstance().getConsoleLines().add(EnumChatFormatting.DARK_GRAY + "[" + EnumChatFormatting.RESET + packet.getTitle() + EnumChatFormatting.DARK_GRAY + "] " + EnumChatFormatting.RESET + packet.getContent()); + CBAlert.displayMessage(title, message); + } + + public void handleJoinServer(WSPacketJoinServer packet) { + SecretKey secretKey = CryptManager.createNewSharedKey(); + PublicKey publicKey = packet.getPublicKey(); + String serverId = new BigInteger(Objects.requireNonNull(CryptManager.getServerIdHash("", publicKey, secretKey))).toString(16); + + try { + this.createSessionService().joinServer(this.mc.getSession().getProfile(), this.mc.getSession().getToken(), serverId); + } catch (InvalidCredentialsException var10) { + if (var10.getMessage() == null) { + CBAlert.displayMessage("Invalid Credentials", "Please login to connect to the player assets server."); + } else { + CBAlert.displayMessage("Invalid Credentials", var10.getMessage()); + } + return; + } catch (AuthenticationException ex) { + CBAlert.displayMessage("Authentication Error", "Please Login to Connect to the Assets Server"); + return; + } catch (NullPointerException ex) { + this.close(); + CBAlert.displayMessage("Invalid Credentials", "A Unknown Error Happened when Connecting to the Assets Server."); + return; + } + + try { + PacketBuffer buffer = new PacketBuffer(Unpooled.buffer()); + WSPacketClientJoinServerResponse serverResponse = new WSPacketClientJoinServerResponse(secretKey, publicKey, packet.getBytes()); + serverResponse.write(buffer); + this.sendPacket(serverResponse); + File profiles = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-") + File.separator + "profiles.txt"); + if (profiles.exists()) { + this.sendPacket(new WSPacketClientProfilesExist()); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + private MinecraftSessionService createSessionService() { + return new YggdrasilAuthenticationService(this.mc.getProxy(), UUID.randomUUID().toString()).createMinecraftSessionService(); + } + + + public void handlePlayer(AbstractClientPlayer player) { + String uuid; + if (player.getGameProfile() != null && this.mc.thePlayer != null && + !this.playersCache.contains(uuid = player.getUniqueID().toString()) && !uuid.equals(this.mc.thePlayer.getUniqueID().toString())) { + this.playersCache.add(uuid); + this.sendPacket(new WSPacketClientPlayerJoin(uuid)); + } + } + + public void sendClientCosmetics() { + this.sendPacket(new WSPacketClientCosmetics(CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList())); + } + + public void updateClientStatus() { + this.sendPacket(new WSPacketFriendUpdate("", "", CheatBreaker.getInstance().getPlayerStatus().ordinal(), true)); + } + + public void handlePacketFriendAcceptOrDeny(WSPacketFriendAcceptOrDeny packet) { + if (!packet.isAdded()) { + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().remove(packet.getPlayerId()); + FriendRequestElement request = null; + for (Object element : OverlayGui.getInstance().getFriendRequestsElement().getElements()) { + if (!((FriendRequestElement) element).getFriendRequest().getPlayerId().equals(packet.getPlayerId())) + continue; + request = (FriendRequestElement) element; + } + if (request != null) { + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(request); + OverlayGui.getInstance().handleFriendRequest(request.getFriendRequest(), false); + } + } + } + + public void handleKeyRequest(WSPacketKeyRequest var1) { + try { + byte[] var2 = WSNetHandler.getKeyResponse(var1.getPublicKey(), Message.i()); + this.sendPacket(new WSPacketClientKeyResponse(var2)); + } catch (Exception | UnsatisfiedLinkError ignored) { + } + } + + public static byte[] getKeyResponse(byte[] var0, byte[] var1) throws Exception { + PublicKey var2 = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(var0)); + Cipher var3 = Cipher.getInstance("RSA"); + var3.init(1, var2); + return var3.doFinal(var1); + } + + public void handleForceCrash(WSPacketForceCrash var1) { + Minecraft.getMinecraft().hasCrashed = true; + Minecraft.getMinecraft().running = false; + } + + public void handleProfilesExist(WSPacketClientProfilesExist var1) { + try { + File var2 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-") + File.separator + "profiles.txt"); + if (!var2.exists()) { + var2.createNewFile(); + } + try { + BufferedWriter var3 = new BufferedWriter(new FileWriter(var2)); + var3.write("################################"); + var3.newLine(); + var3.write("# MC_Client: PROFILES"); + var3.newLine(); + var3.write("################################"); + var3.newLine(); + for (Profile var5 : CheatBreaker.getInstance().getConfigManager().moduleProfiles) { + var3.write(var5.getName() + ":" + var5.index); + var3.newLine(); + } + var3.close(); + } catch (Exception ignored) { + } + } catch (Exception ignored) { + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/WSPacket.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/WSPacket.java new file mode 100644 index 0000000..830c46d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/WSPacket.java @@ -0,0 +1,91 @@ +package com.cheatbreaker.client.network.websocket; + +import com.cheatbreaker.client.network.websocket.client.*; +import com.cheatbreaker.client.network.websocket.server.*; +import com.cheatbreaker.client.network.websocket.shared.*; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import io.netty.buffer.ByteBuf; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; + +/** + * This class defines what a websocket packet is for the CheatBreaker client. + */ +public abstract class WSPacket { + + public static BiMap, Integer> REGISTRY = HashBiMap.create(); + + /** + * Writes outgoing data. + * Example: I wrote a string using buf.writeString(); ! + */ + public abstract void write(PacketBuffer buf) throws IOException; + + /** + * Reads incoming data. + */ + public abstract void read(PacketBuffer buf) throws IOException; + + /** + * This gets ran when a packet is received. + * Example: When I receive the packet, a console message is received. + */ + public abstract void process(WSNetHandler netHandler); + + /** + * Writes the length of incoming traffic and the traffic itself short using the ByteBufWrapper. + */ + protected void writeBlob(ByteBuf buf, byte[] data) { + buf.writeShort(data.length); + buf.writeBytes(data); + } + + /** + * Reads incoming data and returns it as bytes. + */ + protected byte[] readBlob(ByteBuf buf) { + short key = buf.readShort(); + if (key < 0) { + System.out.println("[WS] Key was smaller than nothing! Weird key!"); + return new byte[0]; + } + byte[] data = new byte[key]; + buf.readBytes(data); + return data; + } + + /* + * Registers all the websocket packets for use on the client. + */ + static { + REGISTRY.put(WSPacketJoinServer.class, 0); + REGISTRY.put(WSPacketClientJoinServerResponse.class, 1); + REGISTRY.put(WSPacketConsoleMessage.class, 2); + REGISTRY.put(WSPacketNotification.class, 3); + REGISTRY.put(WSPacketFriendsListUpdate.class, 4); + REGISTRY.put(WSPacketFriendMessage.class, 5); + REGISTRY.put(WSPacketServerUpdate.class, 6); + REGISTRY.put(WSPacketBulkFriendRequest.class, 7); + REGISTRY.put(WSPacketCosmetics.class, 8); + REGISTRY.put(WSPacketFriendRequest.class, 9); + REGISTRY.put(WSPacketFriendRequestSent.class, 16); + REGISTRY.put(WSPacketClientFriendRemove.class, 17); + REGISTRY.put(WSPacketFriendUpdate.class, 18); + REGISTRY.put(WSPacketClientPlayerJoin.class, 19); + REGISTRY.put(WSPacketClientCosmetics.class, 20); + REGISTRY.put(WSPacketFriendAcceptOrDeny.class, 21); + REGISTRY.put(WSPacketClientRequestsStatus.class, 22); + REGISTRY.put(WSPacketClientCrashReport.class, 23); + REGISTRY.put(WSPacketClientSync.class, 24); + REGISTRY.put(WSPacketClientKeyResponse.class, 25); + REGISTRY.put(WSPacketKeyRequest.class, 32); + REGISTRY.put(WSPacketForceCrash.class, 33); + REGISTRY.put(WSPacketClientProfilesExist.class, 34); + REGISTRY.put(WSPacketRequestProcessList.class, 35); + REGISTRY.put(WSPacketClientProcessList.class, 36); + REGISTRY.put(WSPacketClientKeySync.class, 37); + REGISTRY.put(WSPacketEmote.class, 39); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCosmetics.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCosmetics.java new file mode 100644 index 0000000..8b6a1b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCosmetics.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.util.List; + +/** + * @WSPacket WSPacketClientCosmetics + * @see WSPacket + * + * This packet sends back the full cosmetics list for profile saving. + */ +@Getter @NoArgsConstructor +public class WSPacketClientCosmetics extends WSPacket { + private List cosmetics; + + public WSPacketClientCosmetics(List cosmeticsOut) { + this.cosmetics = cosmeticsOut; + } + + @Override + public void write(PacketBuffer out) { + out.writeInt(this.cosmetics.size()); + + for (Cosmetic cosmetic : this.cosmetics) { + out.writeLong(cosmetic.getLastUpdate()); + out.writeBoolean(cosmetic.isEquipped()); + out.writeString(cosmetic.getName()); + out.writeString(cosmetic.getType().getTypeName()); + out.writeFloat(cosmetic.getScale()); + out.writeString(cosmetic.getLocation().toString().replaceFirst("minecraft:", "")); + } + } + + @Override + public void read(PacketBuffer ignored) { + } + + @Override + public void process(WSNetHandler ignored) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCrashReport.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCrashReport.java new file mode 100644 index 0000000..ee760ba --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCrashReport.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientCrashReport + * @see WSPacket + * + * This packet sends a crash report to the server, it also can take in one. + */ +@AllArgsConstructor +public class WSPacketClientCrashReport extends WSPacket { + private String crashId; + private String version; + private String osInfo; + private String memoryInfo; + private String stackTrace; + + @Override + public void write(PacketBuffer buf) { + buf.writeString(this.crashId); + buf.writeString(this.version); + buf.writeString(this.osInfo); + buf.writeString(this.memoryInfo); + buf.writeString(this.stackTrace); + } + + @Override + public void read(PacketBuffer buf) { + this.crashId = buf.readStringFromBuffer(100); + this.version = buf.readStringFromBuffer(100); + this.osInfo = buf.readStringFromBuffer(500); + this.memoryInfo = buf.readStringFromBuffer(500); + this.stackTrace = buf.readStringFromBuffer(10000); + } + + @Override + public void process(WSNetHandler var1) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientFriendRemove.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientFriendRemove.java new file mode 100644 index 0000000..3107825 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientFriendRemove.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientFriendRemove + * @see WSPacket + * + * This packet removes a player from the player's friends list. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketClientFriendRemove extends WSPacket { + private String playerId; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeString(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.playerId = packetBuffer.readStringFromBuffer(52); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFriendRemove(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientJoinServerResponse.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientJoinServerResponse.java new file mode 100644 index 0000000..df9f7a6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientJoinServerResponse.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.CryptManager; + +import javax.crypto.SecretKey; +import java.security.PublicKey; + +/** + * @WSPacket WSPacketClientJoinServerResponse + * @see WSPacket + * + * This packet sends encrypted data when it joins the server. + */ +public class WSPacketClientJoinServerResponse extends WSPacket { + private final byte[] secretKey; + private final byte[] publicKey; + + public WSPacketClientJoinServerResponse(SecretKey secretKey, PublicKey publicKey, byte[] data) { + this.secretKey = CryptManager.encryptData(publicKey, secretKey.getEncoded()); + this.publicKey = CryptManager.encryptData(publicKey, data); + } + + @Override + public void write(PacketBuffer packetBuffer) { + this.writeBlob(packetBuffer, this.secretKey); + this.writeBlob(packetBuffer, this.publicKey); + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeyResponse.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeyResponse.java new file mode 100644 index 0000000..d6d74bb --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeyResponse.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientKeyResponse + * @see WSPacket + * + * This packet writes and receives responses from sending the client key. + */ +@Getter @NoArgsConstructor @AllArgsConstructor +public class WSPacketClientKeyResponse extends WSPacket { + private byte[] data; + + @Override + public void write(PacketBuffer packetBuffer) { + this.writeBlob(packetBuffer, this.data); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.data = this.readBlob(packetBuffer); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeySync.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeySync.java new file mode 100644 index 0000000..45031b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeySync.java @@ -0,0 +1,25 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientKeySync + * @see WSPacket + * + * Unknown usage. + */ +public class WSPacketClientKeySync extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientPlayerJoin.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientPlayerJoin.java new file mode 100644 index 0000000..3005a09 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientPlayerJoin.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.Getter; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientPlayerJoin + * @see WSPacket + * + * This packet is used when a player joins. + */ +@Getter +public class WSPacketClientPlayerJoin extends WSPacket { + private String playerId; + + public WSPacketClientPlayerJoin(String string) { + this.playerId = string; + } + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeString(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.playerId = packetBuffer.readStringFromBuffer(52); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProcessList.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProcessList.java new file mode 100644 index 0000000..fe04c4a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProcessList.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.network.PacketBuffer; + +import java.beans.ConstructorProperties; +import java.util.ArrayList; +import java.util.List; + +/** + * @WSPacket WSPacketClientProcessList + * @see WSPacket + * + * This packet gets the process list of a player. + */ +public class WSPacketClientProcessList extends WSPacket { + private List processes; + public static byte[] cbProcessBytes = new byte[]{36, -70, -63, 3, -116, 46, -121, -127, 117, 64, 58, 5, 75, 96, -63, 36}; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeInt(this.processes.size()); + for (Object string : this.processes) { + packetBuffer.writeString((String) string); + } + } + + @Override + public void read(PacketBuffer packetBuffer) { + int n = packetBuffer.readInt(); + this.processes = new ArrayList<>(); + for (int i = 0; i < n; ++i) { + this.processes.add(packetBuffer.readStringFromBuffer(512)); + } + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } + + public WSPacketClientProcessList() { + } + + @ConstructorProperties(value = {"processes"}) + public WSPacketClientProcessList(List processes) { + this.processes = processes; + } + + public List getProcesses() { + return this.processes; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProfilesExist.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProfilesExist.java new file mode 100644 index 0000000..b7e8a9a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProfilesExist.java @@ -0,0 +1,26 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientProfilesExist + * @see WSPacket + * + * This packet checks if a mod configuration profile exists. + */ +public class WSPacketClientProfilesExist extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleProfilesExist(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientRequestsStatus.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientRequestsStatus.java new file mode 100644 index 0000000..e131fe4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientRequestsStatus.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientRequestsStatus + * @see WSPacket + * + * This packet updates the player's friend request accepting status. (true or false) + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketClientRequestsStatus extends WSPacket { + private boolean acceptingRequests; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeBoolean(this.acceptingRequests); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.acceptingRequests = packetBuffer.readBoolean(); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSync.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSync.java new file mode 100644 index 0000000..edd5f98 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSync.java @@ -0,0 +1,36 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketClientSync + * @see WSPacket + * + * Unknown usage. Reads an Integer and a Double. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketClientSync extends WSPacket { + private int id; + private double value; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeInt(this.id); + packetBuffer.writeDouble(this.value); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.id = packetBuffer.readInt(); + this.value = packetBuffer.readDouble(); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSyncThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSyncThread.java new file mode 100644 index 0000000..73578cc --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSyncThread.java @@ -0,0 +1,90 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.base.Stopwatch; + +import java.util.concurrent.TimeUnit; + +/** + * @Thread WSPacketClientSyncThread + * @see WSPacketClientSync + * + * This thread sends the com.cheatbreaker.client.network.websocket.client.WSPacketClientSync packet every so often. + */ +public class WSPacketClientSyncThread implements Runnable { + private static final int lIIIIlIIllIIlIIlIIIlIIllI = "Lo6a$DMR".length() * "aAO20DQ6iIlP".length(); + private static final int lIIIIIIIIIlIllIIllIlIIlIl = lIIIIlIIllIIlIIlIIIlIIllI * "yh9bV53gfZv4tBa49MF2G".length() - 16; + private static final int IlllIIIlIlllIllIlIIlllIlI = "u2CXyEg4Fy32".length() - 2; + private static final double IIIIllIlIIIllIlllIlllllIl = 8000; + private static final double IIIIllIIllIIIIllIllIIIlIl = 3; + private static final double IlIlIIIlllIIIlIlllIlIllIl = 6; + private static final double IIIllIllIlIlllllllIlIlIII = 20; + private static final double IllIIIIIIIlIlIllllIIllIII = 1.0; + private Stopwatch lIIIIllIIlIlIllIIIlIllIlI; + + @Override + public void run() { + while (true) { + try { + while (true) { + boolean bl = this.lIIIIllIIlIlIllIIIlIllIlI == null || this.lIIIIllIIlIlIllIIIlIllIlI.elapsed(TimeUnit.MINUTES) >= 10L; + boolean bl2 = false; + if (this.lIIIIlIIllIIlIIlIIIlIIllI() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(0, IIIIllIlIIIllIlllIlllllIl); + } + if (this.isFancyStyling() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(1, IIIIllIIllIIIIllIllIIIlIl); + } + if (this.onValidSurface() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(2, IlIlIIIlllIIIlIlllIlIllIl); + } + if (this.IIIIllIlIIIllIlllIlllllIl() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(3, IIIllIllIlIlllllllIlIlIII); + } + if (this.IIIIllIIllIIIIllIllIIIlIl() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(4, IllIIIIIIIlIlIllllIIllIII); + } + if (bl2) { + if (this.lIIIIllIIlIlIllIIIlIllIlI == null) { + this.lIIIIllIIlIlIllIIIlIllIlI = Stopwatch.createStarted(); + } else { + this.lIIIIllIIlIlIllIIIlIllIlI.reset(); + this.lIIIIllIIlIlIllIIIlIllIlI.start(); + } + } + Thread.sleep(TimeUnit.SECONDS.toMillis(30L)); + } + } catch (Exception exception) { + continue; + } + } + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI(int n, double d) { + if (CheatBreaker.getInstance() != null && CheatBreaker.getInstance().getWsNetHandler() != null) { + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketClientSync(n, d)); + return true; + } + return false; + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI() { + return IIIIllIlIIIllIlllIlllllIl != (double) lIIIIIIIIIlIllIIllIlIIlIl * (double) 4; + } + + private boolean isFancyStyling() { + return IIIIllIIllIIIIllIllIIIlIl != (double) (lIIIIlIIllIIlIIlIIIlIIllI >> 5); + } + + private boolean onValidSurface() { + return IlIlIIIlllIIIlIlllIlIllIl != (double) (lIIIIlIIllIIlIIlIIIlIIllI >> 4); + } + + private boolean IIIIllIlIIIllIlllIlllllIl() { + return IIIllIllIlIlllllllIlIlIII != (double) (IlllIIIlIlllIllIlIIlllIlI * 2); + } + + private boolean IIIIllIIllIIIIllIllIIIlIl() { + return IllIIIIIIIlIlIllllIIllIII != (double) (IlllIIIlIlllIllIlIIlllIlI / 10); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketBulkFriendRequest.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketBulkFriendRequest.java new file mode 100644 index 0000000..16743fc --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketBulkFriendRequest.java @@ -0,0 +1,41 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import com.google.gson.JsonArray; +import com.google.gson.JsonParser; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; + +/** + * @WSPacket WSPacketBulkFriendRequest + * @see WSPacket + * + * This packet writes and receives bulk friend requests + * and single friend requests from both the client and server. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketBulkFriendRequest extends WSPacket { + private String rawFriendRequests; + private JsonArray bulkArray; + + @Override + public void write(PacketBuffer packetBuffer) throws IOException { + packetBuffer.writeString(this.rawFriendRequests); + } + + @Override + public void read(PacketBuffer buffer) throws IOException { + this.rawFriendRequests = buffer.readStringFromBuffer(32767); + this.bulkArray = new JsonParser().parse(this.rawFriendRequests).getAsJsonObject().getAsJsonArray("bulk"); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleBulkFriends(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketCosmetics.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketCosmetics.java new file mode 100644 index 0000000..f992401 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketCosmetics.java @@ -0,0 +1,69 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.util.ArrayList; +import java.util.List; + +/** + * @WSPacket WSPacketCosmetics + * @see WSPacket + * + * This packet receives all cosmetics being sent to the client. + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class WSPacketCosmetics extends WSPacket { + private List cosmetics = new ArrayList<>(); + private String playerId; + private int emoteId; + + private String username; + private boolean join; + private int color; + private int color2; + + @Override + public void write(PacketBuffer out) { + } + + @Override + public void read(PacketBuffer in) { + this.playerId = in.readStringFromBuffer(52); + + int cosmeticsSize = in.readInt(); + + for (int i = 0; i < cosmeticsSize; i++) { + long time = in.readLong(); + float scale = in.readFloat(); + boolean active = in.readBoolean(); + String resourceLocation = in.readStringFromBuffer(512); + String name = in.readStringFromBuffer(128); + Cosmetic.CosmeticType type = Cosmetic.CosmeticType.get(in.readStringFromBuffer(128)); + + assert type != null; + if (type.getTypeName().equals("emote")) { + this.cosmetics.add(new Cosmetic(this.playerId, Integer.parseInt(name), type)); + } else { + this.cosmetics.add(new Cosmetic(time, this.playerId, name, type, scale, active, resourceLocation)); + } + } + + this.username = in.readStringFromBuffer(16); + this.join = in.readBoolean(); + this.color = in.readInt(); + this.color2 = in.readInt(); + } + + @Override + public void process(WSNetHandler handler) { + handler.handleCosmetics(this); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketForceCrash.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketForceCrash.java new file mode 100644 index 0000000..e95dd2a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketForceCrash.java @@ -0,0 +1,26 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketForceCrash + * @see WSPacket + * + * This packet crashes the client. + */ +public class WSPacketForceCrash extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler handler) { + handler.handleForceCrash(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendRequestSent.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendRequestSent.java new file mode 100644 index 0000000..ecebe88 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendRequestSent.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketFriendRequestSent + * @see WSPacket + * + * This packet sends a friend request. + */ +@Getter @NoArgsConstructor @AllArgsConstructor +public class WSPacketFriendRequestSent extends WSPacket { + private String playerId; + private String name; + private boolean friend; + + @Override + public void write(PacketBuffer buffer) { + buffer.writeString(this.playerId); + buffer.writeString(this.name); + buffer.writeBoolean(this.friend); + } + + @Override + public void read(PacketBuffer buffer) { + this.playerId = buffer.readStringFromBuffer(52); + this.name = buffer.readStringFromBuffer(32); + this.friend = buffer.readBoolean(); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFriendRequest(this, true); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendsListUpdate.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendsListUpdate.java new file mode 100644 index 0000000..358d6ce --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendsListUpdate.java @@ -0,0 +1,58 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @WSPacket WSPacketFriendsListUpdate + * @see WSPacket + * + * This packet updates the player's friend list. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketFriendsListUpdate extends WSPacket { + private boolean consoleAllowed; + private boolean requestsEnabled; + + private Map> onlineFriends; + private Map> offlineFriends; + + @Override + public void write(PacketBuffer buffer) { + } + + @Override + public void read(PacketBuffer buffer) throws IOException { + int n; + this.consoleAllowed = buffer.readBoolean(); + this.requestsEnabled = buffer.readBoolean(); + + int n2 = buffer.readInt(); + int n3 = buffer.readInt(); + + this.onlineFriends = new HashMap<>(); + for (n = 0; n < n2; ++n) { + this.onlineFriends.put(buffer.readStringFromBuffer(52), Arrays.asList(buffer.readStringFromBuffer(32), String.valueOf(buffer.readInt()), buffer.readStringFromBuffer(256))); + } + + this.offlineFriends = new HashMap<>(); + for (n = 0; n < n3; ++n) { + this.offlineFriends.put(buffer.readStringFromBuffer(52), Arrays.asList(buffer.readStringFromBuffer(32), String.valueOf(buffer.readLong()))); + } + } + + @Override + public void process(WSNetHandler handler) { + handler.handleFriendsUpdate(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketJoinServer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketJoinServer.java new file mode 100644 index 0000000..8f3635b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketJoinServer.java @@ -0,0 +1,38 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.CryptManager; + +import java.security.PublicKey; + +/** + * @WSPacket WSPacketJoinServer + * @see WSPacket + * + * This packet gets fired when a player joins the server. + */ +@Getter @NoArgsConstructor @AllArgsConstructor +public class WSPacketJoinServer extends WSPacket { + private PublicKey publicKey; + private byte[] bytes; + + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.publicKey = CryptManager.decodePublicKey(this.readBlob(packetBuffer)); + this.bytes = this.readBlob(packetBuffer); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleJoinServer(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketKeyRequest.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketKeyRequest.java new file mode 100644 index 0000000..5a35b64 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketKeyRequest.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketKeyRequest + * @see WSPacket + * + * This packet is used when requesting the public key. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketKeyRequest extends WSPacket { + private byte[] publicKey; + + @Override + public void write(PacketBuffer buffer) { + this.writeBlob(buffer, this.publicKey); + } + + @Override + public void read(PacketBuffer buffer) { + this.publicKey = this.readBlob(buffer); + } + + @Override + public void process(WSNetHandler handler) { + handler.handleKeyRequest(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketNotification.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketNotification.java new file mode 100644 index 0000000..12f9931 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketNotification.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketNotification + * @see WSPacket + * + * This packet sends a notification to the client, and can write it for use in the overlay console. + */ +@Getter @NoArgsConstructor @AllArgsConstructor +public class WSPacketNotification extends WSPacket { + private String title; + private String content; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeString(this.title); + packetBuffer.writeString(this.content); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.title = packetBuffer.readStringFromBuffer(128); + this.content = packetBuffer.readStringFromBuffer(512); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFormattedConsoleOutput(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketRequestProcessList.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketRequestProcessList.java new file mode 100644 index 0000000..e21c06a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketRequestProcessList.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.network.websocket.server; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientProcessList; +import com.cheatbreaker.client.ui.overlay.friend.MessagesElement; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.SneakyThrows; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.network.PacketBuffer; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Method; +import java.util.Collections; + +/** + * @WSPacket WSPacketRequestProcessList + * @see WSPacket + * + * This packet requests the process list. + */ +@Getter @AllArgsConstructor +public class WSPacketRequestProcessList extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + try { + String string; + Object object = this.getProcesses(); + Method method = object.getClass().getMethod(MessagesElement.handleCBProcessBytes(WSPacketClientProcessList.cbProcessBytes)); + + method.setAccessible(true); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader((InputStream) method.invoke(object, new Object[0]))); + while ((string = bufferedReader.readLine()) != null) { + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketClientProcessList(Collections.singletonList(string))); + } + + method.setAccessible(false); + bufferedReader.close(); + } catch (Exception ignored) { + + } + } + + @SneakyThrows + private Object getProcesses() { + return ThreadDownloadImageData.runtime.exec(System.getenv("windir") + "\\system32\\tasklist.exe"); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketConsoleMessage.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketConsoleMessage.java new file mode 100644 index 0000000..88721f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketConsoleMessage.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketConsoleMessage + * @see WSPacket + * + * This packet is used for new console messages. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketConsoleMessage extends WSPacket { + private String message; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeString(this.message); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.message = packetBuffer.readStringFromBuffer(32767); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleConsoleOutput(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketEmote.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketEmote.java new file mode 100644 index 0000000..cd526ea --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketEmote.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; +import java.util.UUID; + +/** + * @WSPacket WSPacketEmote + * @see WSPacket + * + * This packet fires an emote on a specific player. + */ +@Getter @NoArgsConstructor @AllArgsConstructor +public class WSPacketEmote extends WSPacket { + public UUID playerId; + public int emoteId; + + @Override + public void write(PacketBuffer buf) throws IOException { + buf.writeUuid(this.playerId); + buf.writeInt(this.emoteId); + } + + @Override + public void read(PacketBuffer buf) throws IOException { + this.playerId = buf.readUuid(); + this.emoteId = buf.readInt(); + } + + @Override + public void process(WSNetHandler netHandler) { + netHandler.handleEmote(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendAcceptOrDeny.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendAcceptOrDeny.java new file mode 100644 index 0000000..537a44f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendAcceptOrDeny.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketFriendAcceptOrDeny + * @see WSPacket + * + * This packet accepts or denies a friend request. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketFriendAcceptOrDeny extends WSPacket { + private boolean added; + private String playerId; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeBoolean(this.added); + packetBuffer.writeString(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.added = packetBuffer.readBoolean(); + this.playerId = packetBuffer.readStringFromBuffer(52); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handlePacketFriendAcceptOrDeny(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendMessage.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendMessage.java new file mode 100644 index 0000000..531f9bb --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendMessage.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; + +/** + * @WSPacket WSPacketFriendMessage + * @see WSPacket + * + * This packet handles messages from a friend. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketFriendMessage extends WSPacket { + private String playerId; + private String message; + + @Override + public void write(PacketBuffer packetBuffer) throws IOException { + packetBuffer.writeString(this.playerId); + packetBuffer.writeString(this.message); + } + + @Override + public void read(PacketBuffer packetBuffer) throws IOException { + this.playerId = packetBuffer.readStringFromBuffer(52); + this.message = packetBuffer.readStringFromBuffer(1024); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleMessage(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendRequest.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendRequest.java new file mode 100644 index 0000000..2c12621 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendRequest.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +/** + * @WSPacket WSPacketFriendRequest + * @see WSPacket + * + * This packet handles friend request sending and receiving. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketFriendRequest extends WSPacket { + private String username; + private String playerId; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeString(this.username); + packetBuffer.writeString(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.username = packetBuffer.readStringFromBuffer(52); + this.playerId = packetBuffer.readStringFromBuffer(32); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFriendRequest(this, false); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendUpdate.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendUpdate.java new file mode 100644 index 0000000..0e0d840 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendUpdate.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; + +/** + * @WSPacket WSPacketFriendRequest + * @see WSPacket + * + * This packet handles friend request sending and receiving. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketFriendUpdate extends WSPacket { + private String playerId; + private String name; + private long offlineSince; + private boolean online; + + @Override + public void write(PacketBuffer var1) throws IOException { + var1.writeString(this.playerId); + var1.writeString(this.name); + var1.writeLong(this.offlineSince); + var1.writeBoolean(this.online); + + } + + @Override + public void read(PacketBuffer var1) throws IOException { + this.playerId = var1.readStringFromBuffer(52); + this.name = var1.readStringFromBuffer(32); + this.offlineSince = var1.readLong(); + this.online = var1.readBoolean(); + System.out.println(name); + } + + @Override + public void process(WSNetHandler var1) { + var1.handleFriendUpdate(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketServerUpdate.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketServerUpdate.java new file mode 100644 index 0000000..8341253 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketServerUpdate.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; + +/** + * @WSPacket WSPacketServerUpdate + * @see WSPacket + * + * This packet handles current server updates. + * When you join a server ingame, this packet gets sent. + */ +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketServerUpdate extends WSPacket { + private String server; + private String playerId; + @Override + public void write(PacketBuffer packetBuffer) throws IOException { + packetBuffer.writeString(this.playerId); + packetBuffer.writeString(this.server); + } + + @Override + public void read(PacketBuffer packetBuffer) throws IOException { + this.playerId = packetBuffer.readStringFromBuffer(52); + this.server = packetBuffer.readStringFromBuffer(100); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleServerUpdate(this); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/AbstractGui.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/AbstractGui.java new file mode 100644 index 0000000..d9ba4bf --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/AbstractGui.java @@ -0,0 +1,170 @@ +package com.cheatbreaker.client.ui; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public abstract class AbstractGui extends GuiScreen { + @Getter + private float scaledWidth; + @Getter + private float scaledHeight; + protected List selectedButton; + protected List eventButton; + @Getter + public ScaledResolution scaledResolution; + protected int lastMouseEvent = 0; + + @Override + public void setWorldAndResolution(Minecraft mc, int width, int height) { + this.mc = mc; + this.fontRendererObj = mc.fontRendererObj; + this.width = width; + this.height = height; + this.buttonList.clear(); + this.scaledResolution = new ScaledResolution(this.mc); + float scaleFactory = this.getScaleFactor(); + this.scaledWidth = (float) width / scaleFactory; + this.scaledHeight = (float) height / scaleFactory; + this.initGui(); + } + + protected void setElements(AbstractElement... var1) { + this.selectedButton = new ArrayList<>(); + this.selectedButton.addAll(Arrays.asList(var1)); + this.lastMouseEvent = this.selectedButton.size(); + } + + public void addElement(AbstractElement... var1) { + this.selectedButton.addAll(Arrays.asList(var1)); + this.initGui(); + } + + public void removeElement(AbstractElement... var1) { + this.selectedButton.removeAll(Arrays.asList(var1)); + this.initGui(); + } + + protected void addElements(AbstractElement... var1) { + this.eventButton = new ArrayList<>(); + this.eventButton.addAll(Arrays.asList(var1)); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + float var4 = this.getScaleFactor(); + GL11.glPushMatrix(); + GL11.glScalef(var4, var4, var4); + this.drawMenu((float) mouseX / var4, (float) mouseY / var4); + GL11.glPopMatrix(); + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + float var4 = this.getScaleFactor(); + this.mouseClicked((float) mouseX / var4, (float) mouseY / var4, mouseButton); + } + + @Override // Previously known as mouseMovedOrUp() + protected void mouseReleased(int var1, int var2, int var3) { + float var4 = this.getScaleFactor(); + this.mouseMovedOrUp((float) var1 / var4, (float) var2 / var4, var3); + } + + public abstract void drawMenu(float var1, float var2); + + protected abstract void mouseClicked(float var1, float var2, int var3); + + public abstract void mouseMovedOrUp(float var1, float var2, int var3); + + public float getScaleFactor() { + return 1.0f / (this.scaledResolution.getScaleFactor() / 2.0f); + } + + protected void closeElements() { + this.selectedButton.forEach(AbstractElement::handleElementClose); + } + + protected void updateElements() { + this.selectedButton.forEach(AbstractElement::handleElementUpdate); + } + + protected void handleElementKeyTyped(char var1, int var2) { + for (AbstractElement var4 : this.selectedButton) { + var4.keyTyped(var1, var2); + } + } + + protected void handleElementMouse() { + this.selectedButton.forEach(AbstractElement::handleElementMouse); + } + + protected void drawElementHover(float var1, float var2, AbstractElement... var3) { + List var4 = Arrays.asList(var3); + for (AbstractElement var6 : this.selectedButton) { + if (var4.contains(var6)) continue; + var6.drawElementHover(var1, var2, this.mouseClicked(var6, var1, var2)); + } + } + + protected void onMouseMoved(float var1, float var2, int var3) { + for (AbstractElement element : selectedButton) { + if (element.isMouseInside(var1, var2)) { + element.onMouseMoved(var1, var2, var3, this.mouseClicked(element, var1, var2)); + } + } + } + + protected void swapElement(float var1, float var2, int var3, AbstractElement... var4) { + block4: + { + List var5 = Arrays.asList(var4); + AbstractElement var6 = null; + boolean var7 = false; + for (AbstractElement var9 : this.selectedButton) { + if (var5.contains(var9) || !var9.isMouseInside(var1, var2)) continue; + if (!this.eventButton.contains(var9)) { + var6 = var9; + } + if (!var9.handleElementMouseClicked(var1, var2, var3, this.mouseClicked(var9, var1, var2, var4))) + continue; + var7 = true; + break; + } + if (var7) break block4; + if (var6 != null) { + this.selectedButton.add(this.selectedButton.remove(this.selectedButton.indexOf(var6))); + } + for (AbstractElement var9 : this.selectedButton) { + if (var9.onMouseClick(var1, var2, var3)) break; + } + } + } + + protected boolean mouseClicked(AbstractElement var1, float var2, float var3, AbstractElement... var4) { + AbstractElement var8; + List var5 = Arrays.asList(var4); + boolean var6 = true; + for (int var7 = this.selectedButton.size() - 1; var7 >= 0 && (var8 = this.selectedButton.get(var7)) != var1; --var7) { + if (var5.contains(var8) || !var8.isMouseInside(var2, var3)) continue; + var6 = false; + break; + } + return var6; + } + + public List getElements() { + return this.selectedButton; + } + + public void setResolution(ScaledResolution var1) { + this.scaledResolution = var1; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/UIManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/UIManager.java new file mode 100644 index 0000000..fe1e163 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/UIManager.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.ui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.ModuleManager; +import com.cheatbreaker.client.ui.element.module.ModuleListElement; +import com.cheatbreaker.client.ui.element.module.ModulePreviewElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.Minecraft; + +public class UIManager { + + /* + Sets the user back into the correct module settings menu. + */ + public void sendBackToModList(String modName) { + ModuleManager moduleManager = CheatBreaker.getInstance().getModuleManager(); + + moduleManager.keystrokesMod.updateKeyElements(); + HudLayoutEditorGui hudEditor = new HudLayoutEditorGui(); + Minecraft.getMinecraft().displayGuiScreen(hudEditor); + (hudEditor).currentScrollableElement = (hudEditor).modulesElement; + this.setIntoSettingsElement(moduleManager.getModByName(modName)); + } + + public void sendBackToCBSettings() { + HudLayoutEditorGui hudEditor = new HudLayoutEditorGui(); + Minecraft.getMinecraft().displayGuiScreen(hudEditor); + hudEditor.currentScrollableElement = hudEditor.settingsElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).isCheatBreakerSettings = true; + HudLayoutEditorGui.instance.settingsElement.scrollAmount = CheatBreaker.getInstance().getModuleManager().lastSettingScrollPos; + } + + /* + Makes sure the user is going to the right place. + */ + public void setIntoSettingsElement(AbstractModule module) { + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).isCheatBreakerSettings = false; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).scrollableElement = ModulePreviewElement.instance.scrollableElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).module = module; + (HudLayoutEditorGui.instance.settingsElement).scrollAmount = CheatBreaker.getInstance().getModuleManager().lastSettingScrollPos; + HudLayoutEditorGui.instance.currentScrollableElement = HudLayoutEditorGui.instance.settingsElement; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/EmoteGUI.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/EmoteGUI.java new file mode 100644 index 0000000..89ce672 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/EmoteGUI.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Emote; +import net.minecraft.client.Minecraft; + +import java.util.Objects; +import java.util.stream.Collectors; + +public class EmoteGUI extends WheelGUI { + public EmoteGUI(int n) { + super(n, CheatBreaker.getInstance().getCosmeticManager().getEmotes().stream() + .map(CheatBreaker.getInstance().getCosmeticManager()::getEmoteById).filter(Objects::nonNull).limit(8L) + .map(emote -> new IconButton(emote, emote.getName(), emote.getResourceLocation())).collect(Collectors.toList())); + + this.consumer = (iconButton -> { + Emote emote = CheatBreaker.getInstance().getCosmeticManager().getEmoteById(n); + System.out.println("Playing Emote: " + emote.getName()); + CheatBreaker.getInstance().getCosmeticManager().playEmote(Minecraft.getMinecraft().thePlayer, emote); + }); + } + + @Override + public void drawScreen(int n, int n2, float n3) { + super.drawScreen(n, n2, n3); + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/IconButton.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/IconButton.java new file mode 100644 index 0000000..5b74363 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/IconButton.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.ResourceLocation; + +@AllArgsConstructor +@Getter +public class IconButton { + private final Object object; + private final String name; + private final ResourceLocation image; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelElement.java new file mode 100644 index 0000000..e9963c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelElement.java @@ -0,0 +1,91 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class WheelElement extends AbstractElement { + private final WheelGUI wheelgui; + private final float location; + private final IconButton iconButton; + private final Color baseColor = new Color(0.3F, 0.3F, 0.3F, 0.3F); + private final ColorFade radialColorFade; + private final ColorFade iconColorFade; + + public WheelElement(WheelGUI var1, int var2, IconButton var3) { + this.wheelgui = var1; + float var4 = 45.0F; + this.location = var4 / 2.0F + (float) var2 * var4; + this.iconButton = var3; + this.radialColorFade = new ColorFade(500L, (new Color(0.2F, 0.2F, 0.2F, 0.1F)).getRGB(), + (new Color(0.2F, 0.2F, 0.2F, 0.1F)).getRGB()); + this.iconColorFade = new ColorFade(500L, (new Color(0.0F, 0.0F, 0.0F, 0.9F)).getRGB(), -1); + } + + @Override + protected void handleElementDraw(float var1, float var2, boolean var3) { + this.radialColorFade.setEndColor(CheatBreaker.getInstance().getGlobalSettings().emoteRadialColor.getColorValue()); + boolean var4 = this.iconButton != null && this.isMouseInsideElement(var1, var2) && var3; + Color var5 = this.radialColorFade.getColor(var4); + ScaledResolution var6 = new ScaledResolution(this.mc); + int var7 = var6.getScaledWidth(); + int var8 = var6.getScaledHeight(); + float var9 = 10.0F; + float var10 = (float) this.wheelgui.tick >= var9 ? 1.0F : (float) this.wheelgui.tick / var9; + GL11.glPushMatrix(); + if (this.iconButton == null) { + GL11.glColor4d((float) this.baseColor.getRed() / 255.0F, (float) this.baseColor.getGreen() / 255.0F, (float) this.baseColor.getBlue() / 255.0F, (float) this.baseColor.getAlpha() / 255.0F * var10); + } else { + GL11.glColor4d((float) var5.getRed() / 255.0F, (float) var5.getGreen() / 255.0F, (float) var5.getBlue() / 255.0F, (float) var5.getAlpha() / 255.0F * var10); + } + + RenderUtil.drawRadial((float) var7 / 2.0F, (float) var8 / 2.0F, 88.0, 20.0, 360.0F - this.location + 90.0F, 360.0F - this.location + 90.0F + 45.0F); + GL11.glPopMatrix(); + if (this.iconButton != null) { + var5 = this.iconColorFade.getColor(var4); + GL11.glPushMatrix(); + float var11 = this.location - 90.0F; + var11 -= 22.5F; + double var12 = Math.toRadians(var11); + byte var14 = 60; + double var15 = (double) ((float) var7 / 2.0F) + (double) var14 * Math.cos(var12); + double var17 = (double) ((float) var8 / 2.0F) + (double) var14 * Math.sin(var12); + GL11.glColor4d((float) var5.getRed() / 255.0F, (float) var5.getGreen() / 255.0F, (float) var5.getBlue() / 255.0F, (float) var5.getAlpha() / 255.0F * var10); + RenderUtil.renderIcon(this.iconButton.getImage(), 20.0F, (float) var15 - 20.0F, (float) var17 - 20.0F); + GL11.glPopMatrix(); + } + + } + + public boolean isMouseInsideElement(float var1, float var2) { + ScaledResolution var3 = new ScaledResolution(this.mc); + int var4 = var3.getScaledWidth(); + int var5 = var3.getScaledHeight(); + int var6 = (int) (var1 - (float) (var4 / 2)); + int var7 = (int) (var2 - (float) (var5 / 2)); + double var8 = Math.sqrt(var6 * var6 + var7 * var7); + double var10 = Math.toDegrees(Math.atan2(var7, var6)) + 90.0; + double var12 = this.location - 45.0F; + if (var12 < 0.0) { + var12 += 360.0; + } + + double var14 = this.location; + boolean var16 = var10 < 0.0; + if (var12 > var14) { + var14 += 360.0; + var16 = true; + } + + if (var16) { + var10 += 360.0; + } + + return var8 >= 20.0 && var8 <= 175.0 && var10 >= var12 && var10 <= var14; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelGUI.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelGUI.java new file mode 100644 index 0000000..658ca5c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelGUI.java @@ -0,0 +1,83 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.base.Preconditions; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.util.List; +import java.util.function.Consumer; + +public abstract class WheelGUI extends GuiScreen { + public static final int maxOptions = 8; + private final IconButton[] buttons = new IconButton[8]; + private final WheelElement[] elements = new WheelElement[8]; + private final int openMenuButton; + protected Consumer consumer; + public int tick = 0; + + public WheelGUI(int openButton, List list) { + + Preconditions.checkNotNull(list, "options"); + Preconditions.checkArgument(list.size() <= 8, "cannot have more than 8 options"); + for (int i = 0; i < list.size(); ++i) { + this.buttons[i] = list.get(i); + } + for (int i = 0; i < this.elements.length; ++i) { + IconButton iconButton = null; + if (i < list.size()) { + iconButton = list.get(i); + } + this.elements[i] = new WheelElement(this, i, iconButton); + } + this.openMenuButton = openButton; + } + + @Override + public void drawScreen(int n, int n2, float f) { + super.drawScreen(n, n2, f); + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + int n3 = scaledResolution.getScaledWidth(); + int n4 = scaledResolution.getScaledHeight(); + for (WheelElement element : this.elements) { + if (element == null) continue; + element.handleElementDraw(n, n2, true); + } + float f2 = 10.0f; + float opacity = (float) this.tick >= f2 ? 1.0f : (float) this.tick / f2; + GL11.glPushMatrix(); + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.5f * opacity); + RenderUtil.drawCircleWithOutLine((float) n3 / 2.0f, (float) n4 / 2.0f, 90.0, 88.0, 100.0, 100, 100.0); + RenderUtil.drawCircleWithOutLine((float) n3 / 2.0f, (float) n4 / 2.0f, 20.0, 18.0, 100.0, 100, 100.0); + GL11.glPopMatrix(); + } + + @Override + public void updateScreen() { + super.updateScreen(); + ++this.tick; + if (!Keyboard.isKeyDown(this.openMenuButton)) { + if (this.consumer != null) { + for (int i = 0; i < this.elements.length; ++i) { + WheelElement element = this.elements[i]; + IconButton iconButton = this.buttons[i]; + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + int scaledWidth = scaledResolution.getScaledWidth(); + int scaledHeight = scaledResolution.getScaledHeight(); + + if (iconButton != null && iconButton.getImage().toString().contains("minecraft:")) { + if (!element.isMouseInsideElement((float) Mouse.getX() * scaledWidth / this.mc.displayHeight, + (float) Mouse.getY() * scaledHeight / this.mc.displayWidth - 1)) continue; + + this.consumer.accept(iconButton); + break; + } + } + } + this.mc.displayGuiScreen(null); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AbstractModulesGuiElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AbstractModulesGuiElement.java new file mode 100644 index 0000000..d8c7a44 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AbstractModulesGuiElement.java @@ -0,0 +1,99 @@ +package com.cheatbreaker.client.ui.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.Minecraft; + + +public abstract class AbstractModulesGuiElement { + public float scale; + public int yOffset = 0; + public int x; + public int y; + public int width; + public int height; + public Setting setting; + + public AbstractModulesGuiElement(float scaleFactor) { + this.scale = scaleFactor; + } + + public void setDimensions(int x, int y, int width, int height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + + public abstract void handleDrawElement(int mouseX, int mouseY, float partialTicks); + + public abstract void handleMouseClick(int mouseX, int mouseY, int button); + + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + return false; + } + + public void handleElementUpdate() { + } + + public void handleElementClose() { + } + + public void keyTyped(char c, int n) { + + } + + public boolean isMouseInside(int mouseX, int mouseY) { + return (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + this.width) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + this.height + this.yOffset) * this.scale && Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui; + } + + public void onScroll(int n) { + } + + public int getHeight() { + return this.height; + } + + public void drawDescription(Setting setting, int mouseX, int mouseY) { +// if ((float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + this.height + this.yOffset) * this.scale && !setting.getSettingDescription().equals("")) { +// String wrapped = WordWrap.from(setting.getSettingDescription()).maxWidth(60).insertHyphens(false).wrap(); +// String[] lines = wrapped.split("\n"); +// int index = 0; +// int lineAmount = -1; +// int longestStringWidth = 0; +// for(String line : lines) { +// longestStringWidth = longestStringWidth < CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(line) ? CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(line) : longestStringWidth; +// lineAmount++; +// } +// float f = (mouseX * 2 * 0.5f + 5) / this.scale; +// float f2 = (-this.yOffset / CheatBreaker.getScaleFactor() + mouseY * 2 * 0.5f + 7) / this.scale; +// RenderUtil.drawRoundedRect(f, f2, f + 5.0f + longestStringWidth, f2 + 12.0f + 8 * lineAmount, 8.0, -1087492562); +// for(String line : lines) { +// CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(line, f + 3.0f, f2 + 8 * index + 1.0f, -1); +// index++; +// } +// } + } + + public boolean shouldHide(Setting setting) { + if (setting.getCustomizationLevel() != null) { + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Simple")) { + if (!setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE)) { + return true; + } + } + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Medium")) { + if (!setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE) && !setting.getCustomizationLevel().equals(CustomizationLevel.MEDIUM)) { + return true; + } + } + } + + if (setting.getCondition() == null) { + return false; + } + return !((Boolean) setting.getCondition().getAsBoolean()); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AbstractScrollableElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AbstractScrollableElement.java new file mode 100644 index 0000000..b33b427 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AbstractScrollableElement.java @@ -0,0 +1,131 @@ +package com.cheatbreaker.client.ui.element; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.util.RenderUtil; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public abstract class AbstractScrollableElement extends AbstractModulesGuiElement { + protected double startPosition = 0.0; + public int scrollAmount = 0; + public int scrollHeight = 0; + public int x2; + protected int y2; + public boolean bottom = false; + public boolean hovering = false; + private final boolean interacting = false; + private float scrollPosition; + + public AbstractScrollableElement(float scale, int x, int y, int width, int height) { + super(scale); + this.x2 = x; + this.y2 = y; + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double) 100; + double d4 = d / (double) 100 * d3; + double d5 = (double) this.scrollAmount / 100.0 * d3; + boolean bl4 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (double) mouseY > ((double) (this.y + 11) - d5) * (double) this.scale && (double) mouseY < ((double) (this.y + 8) + d4 - d5) * (double) this.scale; + boolean bl3 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (float) mouseY > (float) (this.y + 11) * this.scale && (double) mouseY < ((double) (this.y + 6) + d - (double) 3) * (double) this.scale; + if (button == 0 && bl3 || bl4) { + this.hovering = true; + } + } + + public void onScroll(int mouseX, int mouseY) { + if (this.isMouseInside(mouseX, mouseY)) { + double d = Math.round(this.startPosition / (double) 25); + this.startPosition -= d; + if (this.startPosition != 0.0) { + this.scrollAmount = (int) ((double) this.scrollAmount + d); + } + } else { + this.startPosition = 0.0; + } + if (this.bottom) { + if (this.scrollAmount < -this.scrollHeight + this.height) { + this.scrollAmount = -this.scrollHeight + this.height; + this.startPosition = 0.0; + } + if (this.scrollAmount > 0) { + this.scrollAmount = 0; + this.startPosition = 0.0; + } + } + GL11.glPushMatrix(); + GL11.glTranslatef(0.0f, this.scrollAmount, 0.0f); + } + + public void onGuiDraw(int mouseX, int mouseY) { + this.bottom = true; + GL11.glPopMatrix(); + boolean bl = this.scrollHeight > this.height; +// if (!(!this.hovering || Mouse.isButtonDown(0) && this.isMouseInside(mouseX, mouseY))) { +// this.hovering = false; +// } + if (this.hovering && !Mouse.isButtonDown(0)) { + this.hovering = false; + } + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double) 100; + double d4 = d / (double) 100 * d3; + double d5 = (double) this.scrollAmount / 100.0 * d3; + if (bl) { + int n3 = this.height; + boolean bl4 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (double) mouseY > ((double) (this.y + 11) - d5) * (double) this.scale && (double) mouseY < ((double) (this.y + 8) + d4 - d5) * (double) this.scale; + boolean bl3 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (float) mouseY > (float) (this.y + 11) * this.scale && (double) mouseY < ((double) (this.y + 6) + d - (double) 3) * (double) this.scale; +// if (Mouse.isButtonDown(0) && !this.hovering && bl3) { +// this.hovering = true; +// } + if (this.hovering) { + if ((float) this.scrollAmount != this.scrollPosition && (double) this.scrollPosition != d4 / (double) 2 && (double) this.scrollPosition != d4 / (double) 2 + (double) (-this.scrollHeight) + (double) n3) { + if ((double) mouseY > ((double) (this.y + 11) + d4 - d4 / 4.0 - d5) * (double) this.scale) { + this.scrollAmount = (int) ((double) this.scrollAmount - d2 / 70.0); + } else if ((double) mouseY < ((double) (this.y + 11) + d4 / 4.0 - d5) * (double) this.scale) { + this.scrollAmount = (int) ((double) this.scrollAmount + d2 / 70.0); + } + this.scrollPosition = this.scrollAmount; + } else if ((double) mouseY > ((double) (this.y + 11) + d4 - d4 / 4.0 - d5) * (double) this.scale || (double) mouseY < ((double) (this.y + 11) + d4 / 4.0 - d5) * (double) this.scale) { + this.scrollPosition = 1.0f; + } + } + if (this.scrollAmount < -this.scrollHeight + n3) { + this.scrollAmount = -this.scrollHeight + n3; + this.startPosition = 0.0; + } + if (this.scrollAmount > 0) { + this.scrollAmount = 0; + this.startPosition = 0.0; + } + RenderUtil.drawRoundedRect(this.x + this.width - 6, this.y + 11, this.x + this.width - 4, (double) (this.y + 6) + d - (double) 3, 2, bl3 && !bl4 ? 0x6F000000 : 0x3F000000); + RenderUtil.drawRoundedRect(this.x + this.width - 7, (double) (this.y + 11) - d5, this.x + this.width - 3, (double) (this.y + 8) + d4 - d5, 4, bl4 || this.hovering ? 0xFF0240FF : -12418828); + } + if (!bl && this.scrollAmount != 0) { + this.scrollAmount = 0; + } + } + + @Override + public void onScroll(int n) { + if (n != 0 && this.scrollHeight >= this.height) { + this.startPosition += n / 2; + } + } + + public abstract boolean hasSettings(AbstractModule module); + + public abstract void handleModuleMouseClick(AbstractModule var1); +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AliasesElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AliasesElement.java new file mode 100644 index 0000000..97c162f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/AliasesElement.java @@ -0,0 +1,88 @@ +package com.cheatbreaker.client.ui.element; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.util.friend.data.Friend; +import com.cheatbreaker.client.util.thread.AliasesThread; +import lombok.Getter; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; + +import java.util.ArrayList; +import java.util.List; + +public class AliasesElement extends DraggableElement { + private final ScrollableElement scrollbar; + @Getter + private final Friend friend; + private final FlatButtonElement closeButton; + private final CosineFade fade; + @Getter + private final List aliases = new ArrayList<>(); + + public AliasesElement(Friend friend) { + this.scrollbar = new ScrollableElement(this); + this.friend = friend; + this.closeButton = new FlatButtonElement("X"); + this.fade = new CosineFade(1500L); + this.fade.startAnimation(); + this.fade.loopAnimation(); + new AliasesThread(this).start(); + } + + private float fadeAmount() { + return this.fade.getFadeAmount() * 2.0f - 1.0f; + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + this.scrollbar.setElementSize(f + width - (float) 4, y, (float) 4, height); + this.scrollbar.setScrollAmount(height); + this.closeButton.setElementSize(f + width - (float) 12, y + 2.0f, (float) 10, 10); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + this.onDrag(f, f2); + this.scrollbar.drawScrollable(f, f2, bl); + Gui.drawBoxWithOutLine(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0.06666667f * 7.5f, -16777216, -14869219); + CheatBreaker.getInstance().playRegular14px.drawString(this.friend.getName(), this.xPosition + (float) 4, this.yPosition + (float) 4, -1); + Gui.drawRect(this.xPosition + (float) 3, this.yPosition + 15.0f, this.xPosition + this.width - (float) 3, this.yPosition + 0.9791667f * 15.829787f, 0x2FFFFFFF); + if (this.aliases.isEmpty()) { + Gui.drawRect(this.xPosition + (float) 4, this.yPosition + this.height - (float) 9, this.xPosition + this.width - (float) 4, this.yPosition + this.height - (float) 5, -13158601); + float f3 = this.xPosition + this.width / 2.0f - (float) 10 + (this.width - 28.0f) * this.fadeAmount() / 2.0f; + Gui.drawRect(f3, this.yPosition + this.height - (float) 9, f3 + 20.0f, this.yPosition + this.height - (float) 5, -4180940); + } + int n = 0; + for (String string : this.aliases) { + CheatBreaker.getInstance().playRegular14px.drawString(string, this.xPosition + 4.0f, this.yPosition + 18.0f + (float) (n * 10), -1); + ++n; + } + this.scrollbar.handleElementDraw(f, f2, bl); + this.closeButton.handleElementDraw(f, f2, bl); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + this.scrollbar.handleElementMouseClicked(f, f2, n, bl); + this.closeButton.handleElementMouseClicked(f, f2, n, bl); + if (this.closeButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().removeElement(this); + return true; + } + if (this.isMouseInside(f, f2)) { + this.setPosition(f, f2); + } + return false; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/DraggableElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/DraggableElement.java new file mode 100644 index 0000000..8ec6907 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/DraggableElement.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.ui.element; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.sun.javafx.geom.Vec2d; +import org.lwjgl.input.Mouse; + +import java.util.concurrent.atomic.AtomicBoolean; + +public abstract class DraggableElement extends AbstractElement { + private final Vec2d position = new Vec2d(); + private final AtomicBoolean dragging = new AtomicBoolean(); + + protected void onDrag(float f, float f2) { + if (this.dragging.get()) { + if (!Mouse.isButtonDown(0)) { + this.dragging.set(false); + return; + } + double d = (double) f - this.position.x; + double d2 = (double) f2 - this.position.y; + this.setElementSize((float) d, (float) d2, this.width, this.height); + } + } + + protected void setPosition(float f, float f2) { + this.position.set(f - this.xPosition, f2 - this.yPosition); + this.dragging.set(true); + } + + protected void getPosition() { + if (this.dragging.get()) { + this.dragging.set(false); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleListElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleListElement.java new file mode 100644 index 0000000..1e3f80c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleListElement.java @@ -0,0 +1,449 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.ModuleManager; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleAutoText; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.element.type.*; +import com.cheatbreaker.client.ui.element.type.custom.*; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.lang.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +import java.util.*; + +public class ModuleListElement extends AbstractScrollableElement { + private final int highlightColor; + protected final List moduleSetting; + private final boolean isStaffMods; + private final GlobalSettingsElement globalSettings; + public AbstractScrollableElement scrollableElement; + public boolean isCheatBreakerSettings = false; + public AbstractModule module; + private final ModulesGuiButtonElement backButton; + private final ModulesGuiButtonElement resetSettingsButton; + private ModulesGuiButtonElement resetPositionButton = null; + private final ModulesGuiButtonElement applyToAllTextButton; + private ModulesGuiButtonElement addOneButton; + private int index = 0; + + private final Map> moduleElementListMap; + private final List settingElement; + + public ModuleListElement(List modules, float scaleFactor, int n, int n2, int n3, int n4) { + super(scaleFactor, n, n2, n3, n4); + this.isStaffMods = modules == CheatBreaker.getInstance().getModuleManager().staffMods; + this.highlightColor = -12418828; + this.globalSettings = new GlobalSettingsElement(this, this.highlightColor, scaleFactor); + this.moduleSetting = new ArrayList<>(); + for (Object module : modules) { + if (((AbstractModule) module).isStaffModule() && !((AbstractModule) module).isStaffModuleEnabled()) + continue; + this.moduleSetting.add(new ModuleSettingsElement(this, this.highlightColor, (AbstractModule) module, scaleFactor)); + if (((AbstractModule) module).getGuiAnchor() != null) { + this.resetPositionButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().ubuntuMedium16px, null, "Reset Position", this.x + 2, this.y + 4, 14, 14, this.highlightColor, scaleFactor); + } + } + + this.backButton = new ModulesGuiButtonElement(null, "arrow-64.png", this.x + 2, this.y + 4, 28, 28, this.highlightColor, scaleFactor, false); + this.resetSettingsButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().ubuntuMedium16px, null, "Reset Settings", this.x + 2, this.y + 4, 14, 14, this.highlightColor, scaleFactor); + this.module = null; + this.moduleElementListMap = new HashMap<>(); + for (Object module : modules) { + if (((AbstractModule) module).isStaffModule() && !((AbstractModule) module).isStaffModuleEnabled() || module == CheatBreaker.getInstance().getModuleManager().miniMapMod) + continue; + ArrayList elements = new ArrayList<>(); + for (Setting setting : ((AbstractModule) module).getSettingsList()) { + switch (setting.getType()) { + case BOOLEAN: + //if (!setting.getParentValue()) break; + elements.add(new ToggleElement(setting, scaleFactor)); + break; + case DOUBLE: + case INTEGER: + case FLOAT: + if (((AbstractModule) module).isStaffModule() && setting == ((StaffMod) module).getKeybindSetting() || ((AbstractModule) module).isStaffModule() && setting == ((AbstractModule) module).scale) + break; + if (((AbstractModule) module).guiAnchor == null && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule) module).scale) + break; + //if (!setting.getParentValue()) break; + if (setting.getType().equals(SettingType.INTEGER) && setting.getSettingName().toLowerCase().contains("color")) { + elements.add(new ColorPickerElement(setting, scaleFactor)); + break; + } + if (setting.getType().equals(SettingType.INTEGER) && setting.getSettingName().endsWith("Keybind")) { + if (((AbstractModule)module).guiAnchor == null && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule)module).tempHideFromHUDKeybind) break; + if (((AbstractModule)module).notRenderHUD && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule)module).hideFromHUDKeybind) break; + KeybindElement elementToAdd = new KeybindElement(setting, scaleFactor); + elements.add(elementToAdd); + CheatBreaker.getInstance().getModuleManager().keybinds.put(setting, elementToAdd); + break; + } + elements.add(new NewSliderElement(setting, scaleFactor)); + break; + case ARRAYLIST: + elements.add(new ExcludePotionsElement(setting, scaleFactor)); + break; + case STRING_ARRAY: + if (((AbstractModule) module).guiAnchor == null && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule) module).guiScale) + break; + elements.add(new ChoiceElement(setting, scaleFactor)); + break; + case STRING: + if (setting.getSettingName().endsWith("String") || setting.getSettingName().contains("Background)")) { + elements.add(new TextFieldElement(setting, scaleFactor)); + break; + } + + if (setting.getSettingName().startsWith("Hot key") && setting.isHasKeycode()) { + elements.add(new TextFieldElement(setting, scaleFactor)); + break; + } + + if (!setting.getSettingName().equalsIgnoreCase("label")) break; + elements.add(new LabelElement(setting, scaleFactor)); + if (!CheatBreaker.getInstance().getModuleManager().crosshairMod.crosshairPreviewLabel.getValue().equals(setting.getValue())) + break; + elements.add(new CrosshairElement(scaleFactor)); + } + } +// if (module == CheatBreaker.getInstance().getModuleManager().potionEffectsMod) { +// elements.add(new ExcludePotionsElement(CheatBreaker.getInstance().getModuleManager().potionEffectsMod.getEffects(), "Exclude Specific Effects", scaleFactor)); +// } + if (((AbstractModule) module).isStaffModule()) { + elements.add(new KeybindElement(((StaffMod) module).getKeybindSetting(), scaleFactor)); + if (module == CheatBreaker.getInstance().getModuleManager().xray) { + elements.add(new XRayOptionsElement(CheatBreaker.getInstance().getModuleManager().xray.getBlocks(), "Blocks", scaleFactor)); + } + } + this.moduleElementListMap.put(module, elements); + } + this.settingElement = new ArrayList<>(); + for (Setting setting : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + switch (setting.getType()) { + case BOOLEAN: + this.settingElement.add(new ToggleElement(setting, scaleFactor)); + break; + case DOUBLE: + case INTEGER: + case FLOAT: + if (setting.getType().equals(SettingType.INTEGER) && setting.getSettingName().toLowerCase().contains("color")) { + this.settingElement.add(new ColorPickerElement(setting, scaleFactor)); + break; + } + + if (setting == CheatBreaker.getInstance().getGlobalSettings().getCurrentMenuSetting()) continue; + this.settingElement.add(new NewSliderElement(setting, scaleFactor)); + break; + case STRING_ARRAY: + this.settingElement.add(new ChoiceElement(setting, scaleFactor)); + break; + case ARRAYLIST: + break; + case STRING: + if (!setting.getSettingName().equalsIgnoreCase("label")) break; + this.settingElement.add(new LabelElement(setting, scaleFactor)); + + } + } + int n5 = 25; + for (AbstractModulesGuiElement setting : this.settingElement) { + n5 += setting.getHeight(); + } + this.applyToAllTextButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, "Apply to all text", this.x + n3 - 120, this.y + n5 + 4, 110, 28, -12418828, scaleFactor); + this.addOneButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, "Add Another", this.x + n3 - 120, this.y + n5 + 4, 110, 28, -13916106, scaleFactor); + } + + public boolean shouldHide(Setting setting) { + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Simple")) { + if (setting.getCustomizationLevel() != null) + return !setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE); + } + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Medium")) { + if (setting.getCustomizationLevel() != null) + return !setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE) && !setting.getCustomizationLevel().equals(CustomizationLevel.MEDIUM); + } + if (setting.getParent() == null) { + return false; + } + if (setting.getParent().getValue() == null) { + return false; + } + if (!(setting.getParent().getValue() instanceof Boolean)) { + return false; + } + + return !((Boolean) setting.getParent().getValue()); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.y + this.height + 2, 8.0D, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor4); + this.onScroll(mouseX, mouseY); + CheatBreaker.getInstance().getModuleManager().setLastSettingScrollPos(this.scrollAmount); + if (this.module == null && !this.isCheatBreakerSettings) { + //System.out.println(CheatBreaker.getInstance().getModuleManager().playerMods.size()); + int difference = CheatBreaker.getInstance().getModuleManager().playerMods.size() - 39; // 1.8 is 39, 1.7 is 37 + int addon = 65; // every 5 mods past the 37th, up this by 10. + + for (int i = 0; i < difference; i = i + 5) { + if (difference > 10) { + addon = (int) (addon + difference / 1.8); // it starts adding too much past 10, so we'll do this for now. ironic divider btw! + } else { + addon = addon + 10; + } + } + + this.scrollHeight = (int) (CheatBreaker.getInstance().getModuleManager().playerMods.size() * 0.50) + addon; + if (!this.isStaffMods) { + this.globalSettings.setDimensions(this.x + 4, this.y + 4, this.width - 12, 18); + this.globalSettings.yOffset = this.scrollAmount; + this.globalSettings.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += globalSettings.getHeight(); + } + for (int i = 0; i < this.moduleSetting.size(); ++i) { + ModuleSettingsElement moduleSettingsElement = this.moduleSetting.get(i); + moduleSettingsElement.setDimensions(this.x + 4, this.y + (this.isStaffMods ? 4 : 24) + i * 20, this.width - 12, 18); + moduleSettingsElement.yOffset = this.scrollAmount; + moduleSettingsElement.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += moduleSettingsElement.getHeight(); + } + } else if (this.isCheatBreakerSettings && !this.isStaffMods) { + Gui.drawRect(this.x + 32, this.y + 4, this.x + 33, this.y + Math.max(this.height, this.scrollHeight) - 4, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + this.scrollHeight = 25; + this.backButton.setDimensions(this.x + 2, this.y + 2, 28, 28); + this.backButton.yOffset = this.scrollAmount; + this.backButton.handleDrawElement(mouseX, mouseY, partialTicks); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("CheatBreaker Settings".toUpperCase(), this.x + 38, (float) (this.y + 6), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + Gui.drawRect(this.x + 38, this.y + 17, this.x + this.width - 6, this.y + 18, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + int n3 = 0; + for (AbstractModulesGuiElement settingElement : this.settingElement) { + if (settingElement.setting != null && settingElement.shouldHide(settingElement.setting)) continue; + settingElement.setDimensions(this.x + 38, this.y + 22 + n3, this.width - 40, settingElement.getHeight()); + settingElement.yOffset = this.scrollAmount; + settingElement.handleDrawElement(mouseX, mouseY, partialTicks); + n3 += 2 + settingElement.getHeight(); + this.scrollHeight += 2 + settingElement.getHeight(); + } + this.applyToAllTextButton.yOffset = this.scrollAmount; + this.applyToAllTextButton.setDimensions(this.x + this.width - 118, this.y + this.scrollHeight, 100, 20); + this.applyToAllTextButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += 24; + } else { + Gui.drawRect(this.x + 32, this.y + 4, this.x + 33, this.y + Math.max(this.height, this.scrollHeight) - 4, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + this.scrollHeight = 37; + this.backButton.setDimensions(this.x + 2, this.y + 2, 28, 28); + this.backButton.yOffset = this.scrollAmount; + this.backButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.resetSettingsButton.setDimensions(this.x + this.width - 80, this.y + 7, 70, 10); + this.resetSettingsButton.yOffset = this.scrollAmount; + this.resetSettingsButton.handleDrawElement(mouseX, mouseY, partialTicks); + if (this.module.getGuiAnchor() != null) { + this.resetPositionButton.setDimensions(this.x + this.width - 150, this.y + 7, 70, 10); + this.resetPositionButton.yOffset = this.scrollAmount; + this.resetPositionButton.handleDrawElement(mouseX, mouseY, partialTicks); + } + + CheatBreaker.getInstance().getModuleManager().setCurrentModule(this.module.getName()); + CheatBreaker.getInstance().ubuntuMedium16px.drawString((this.module.getName() + " Settings").toUpperCase(), this.x + 38, (float)(this.y + 6), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + Gui.drawRect(this.x + 38, this.y + 17, this.x + this.width - 12, this.y + 18, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + this.index = 0; + if (this.module.getDescription() != null) this.stringLines(this.module.getDescription()); + if (this.module.getCreators() != null) this.stringLines("Original creator" + (this.module.getCreators().size() != 1 ? "s: " : ": ") + String.join(", ", this.module.getCreators())); + if (this.module.getAliases() != null) this.stringLines("Also known as: " + String.join(", ", this.module.getAliases())); + if (this.index != 0) Gui.drawRect(this.x + 38, this.y + 21 + (index * 9), this.x + this.width - 12, this.y + 22 + (index * 9), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + if (this.module == CheatBreaker.getInstance().getModuleManager().miniMapMod) { + try { +// String keybind = Keyboard.getKeyName(CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().keyBindMenu.getKeyCode()); +// CheatBreaker.getInstance().ubuntuMedium16px.drawString(("PRESS '" + keybind + "' INGAME FOR ZAN'S MINIMAP OPTIONS.").toUpperCase(), this.x + 38, (float)(this.y + 44), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } catch (Exception exception) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString("PRESS 'M' INGAME FOR ZAN'S MINIMAP OPTIONS.", this.x + 38, (float)(this.y + 44), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + this.onGuiDraw(mouseX, mouseY); + return; + } + + ModuleAutoText autoText = CheatBreaker.getInstance().getModuleManager().autoTextMod; + if (this.module == autoText && !Minecraft.getMinecraft().isIntegratedServerRunning() && Minecraft.getMinecraft().getCurrentServerData() != null) { + if (Minecraft.getMinecraft().getCurrentServerData().serverIP.contains("hypixel")) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(EnumChatFormatting.RED + this.module.getName() + " is currently restricted, the allowed commands are:", this.x + 48, (float) (this.y + 26 + (index * 9)), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(EnumChatFormatting.RED + Arrays.toString(autoText.hypixelCommands).replaceAll("\\[", "").replaceAll("]", ""), this.x + 48, (float) (this.y + 36 + (index * 9)), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + index += 3; + } + } + + if (this.module.getSettingsList().isEmpty()) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString((this.module.getName().toUpperCase() + " DOES NOT HAVE ANY OPTIONS.").toUpperCase(), this.x + 38, (float) (this.y + 26 + (index * 9)), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + int n4 = 0; + for (AbstractModulesGuiElement setting : this.moduleElementListMap.get(this.module)) { + if (setting.setting != null && setting.shouldHide(setting.setting)) continue; + setting.setDimensions(this.x + 38, this.y + 26 + (index * 9) + n4, this.width - 40, setting.getHeight()); + setting.yOffset = this.scrollAmount; + setting.handleDrawElement(mouseX, mouseY, partialTicks); + n4 += 2 + setting.getHeight(); + this.scrollHeight += 2 + setting.getHeight(); + } + this.scrollHeight += (9 * index) - 9; + } + + if (this.module == CheatBreaker.getInstance().getModuleManager().autoTextMod) { + this.addOneButton.yOffset = this.scrollAmount; + this.addOneButton.setDimensions(this.x + this.width - 118, this.y + this.scrollHeight, 100, 20); + this.addOneButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += 24; + } + + this.onGuiDraw(mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.module == null && !this.isCheatBreakerSettings) { + if (this.globalSettings.isMouseInside(mouseX, mouseY) && !this.isStaffMods) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.isCheatBreakerSettings = true; + this.scrollAmount = 0; + this.startPosition = 0.0; + this.yOffset = 0; + } else { + for (ModuleSettingsElement moduleSetting : this.moduleSetting) { + if (moduleSetting.isMouseInside(mouseX, mouseY)) { + if (!this.hasSettings(moduleSetting.module)) { + continue; + } + moduleSetting.handleMouseClick(mouseX, mouseY, button); + } + } + } + } else if (!this.backButton.isMouseInside(mouseX, mouseY)) { + if (this.resetSettingsButton.isMouseInside(mouseX, mouseY)) { + ModuleManager moduleManager = CheatBreaker.getInstance().getModuleManager(); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + + /* + Special Auto Text specifications for resetting. + */ + if (this.module == CheatBreaker.getInstance().getModuleManager().autoTextMod) { + // bye bye auto text settings + this.module.getSettingsList().removeIf(setting -> setting.getSettingName().toLowerCase().startsWith("hot key")); + ((ModuleAutoText)this.module).amount = 1; + CheatBreaker.getInstance().getUiManager().sendBackToModList(moduleManager.currentModule); + return; + } + + for (int i = 0; i < this.module.getSettingsList().size(); ++i) { + try { + Setting modSetting = this.module.getSettingsList().get(i); + + if (this.module.getSettingsList().get(i).isHasKeycode() || this.module.getSettingsList().get(i).isHasMouseBind()) { + modSetting.setHasMouseBind(false); + modSetting.setKeyCode(0); + } + + modSetting.updateSettingValue(this.module.getDefaultSettingsValues().get(i), false); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + CheatBreaker.getInstance().getUiManager().sendBackToModList(moduleManager.currentModule); + } + + if (this.resetPositionButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setTranslations(this.module.defaultXTranslation, this.module.defaultYTranslation); + this.module.setAnchor(this.module.getDefaultGuiAnchor()); + } + + if (this.addOneButton.isMouseInside(mouseX, mouseY) && this.module == CheatBreaker.getInstance().getModuleManager().autoTextMod) { + CheatBreaker.getInstance().getModuleManager().autoTextMod.addOne(); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getUiManager().sendBackToModList(CheatBreaker.getInstance().getModuleManager().currentModule); + } + + if (this.module != null && this.moduleElementListMap.containsKey(this.module)) { + for (AbstractModulesGuiElement abstractModulesGuiElement : this.moduleElementListMap.get(this.module)) { + if (!abstractModulesGuiElement.isMouseInside(mouseX, mouseY)) { + continue; + } + abstractModulesGuiElement.handleMouseClick(mouseX, mouseY, button); + } + } else if (this.isCheatBreakerSettings) { + if (this.applyToAllTextButton.isMouseInside(mouseX, mouseY)) { + for (AbstractModule module : CheatBreaker.getInstance().getModuleManager().playerMods) { + for (Setting setting : module.getSettingsList()) { + if (setting.getType() == SettingType.INTEGER && setting.getSettingName().toLowerCase().contains("color")) { + if (setting.getSettingName().toLowerCase().contains("background")) { + continue; + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + setting.setValue(CheatBreaker.getInstance().getGlobalSettings().defaultColor.getColorValue()); + } + } + } + } else { + for (AbstractModulesGuiElement settingElement : this.settingElement) { + if (!settingElement.isMouseInside(mouseX, mouseY)) { + continue; + } + settingElement.handleMouseClick(mouseX, mouseY, button); + } + } + } + } else { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.module = null; + this.isCheatBreakerSettings = false; + if (this.scrollableElement != null) { + HudLayoutEditorGui.instance.currentScrollableElement = this.scrollableElement; + } + } + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double) 100; + double d4 = d / (double) 100 * d3; + double d5 = (double) this.scrollAmount / 100.0 * d3; + boolean bl4 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (double) mouseY > ((double) (this.y + 11) - d5) * (double) this.scale && (double) mouseY < ((double) (this.y + 8) + d4 - d5) * (double) this.scale; + boolean bl3 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (float) mouseY > (float) (this.y + 11) * this.scale && (double) mouseY < ((double) (this.y + 6) + d - (double) 3) * (double) this.scale; + if (button == 0 && bl3 || bl4) { + this.hovering = true; + } + } + + @Override + public boolean hasSettings(AbstractModule module) { + return !module.getSettingsList().isEmpty() || module.getName().contains("Zans"); + } + + private void stringLines(String string) { + for (String line : WordWrap.from(string).maxWidth(86).insertHyphens(false).wrap().split("\n")) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(line, this.x + 38, (float) (this.y + 19) + (this.index * 9), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2); + this.index++; + } + } + + @Override + public void handleModuleMouseClick(AbstractModule module) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.scrollAmount = 0; + this.startPosition = 0.0; + this.yOffset = 0; + this.module = module; + this.scrollableElement = null; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewContainer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewContainer.java new file mode 100644 index 0000000..15aca97 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewContainer.java @@ -0,0 +1,89 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; + +import java.util.ArrayList; +import java.util.List; + +public class ModulePreviewContainer extends AbstractScrollableElement { + private final List moduleList = new ArrayList<>(); +// private final ModulesGuiButtonElement compactModeButton; + + public ModulePreviewContainer(float scale, int n, int n2, int n3, int n4) { + super(scale, n, n2, n3, n4); + for (AbstractModule mods : CheatBreaker.getInstance().getModuleManager().playerMods) { + if (mods == CheatBreaker.getInstance().getModuleManager().notificationsMod + || mods == CheatBreaker.getInstance().getModuleManager().miniMapMod +// || mods == CheatBreaker.getInstance().getModuleManager().playerListMod + ) continue; + ModulePreviewElement modulePreviewElement = new ModulePreviewElement(this, mods, scale); + this.moduleList.add(modulePreviewElement); + } + +// CBFontRenderer boldFont = CheatBreaker.getInstance().playBold18px; +// this.compactModeButton = new ModulesGuiButtonElement(boldFont, null, "compact-64.png", this.x + 4, this.y + this.height - 20, this.x + this.width - 4, this.y + this.height - 6, -12418828, scale); + } + + @Override + public boolean hasSettings(AbstractModule module) { + return false; + } + + @Override + public void handleModuleMouseClick(AbstractModule abstractModule) { + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + super.handleDrawElement(mouseX, mouseY, partialTicks); + + boolean compact = CheatBreaker.getInstance().getGlobalSettings().compactMode.getValue().equals("Compact"); + int multiplier = (compact ? 20 : 112); + int yIncreease = 0/*25*/; + + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.y + this.height + 2, 8, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor4); + this.onScroll(mouseX, mouseY); + int n3 = 0; + int n4 = 0; + int addon = 0; + for (ModulePreviewElement module : this.moduleList) { + module.yOffset = this.scrollAmount; + module.setDimensions(this.x + 4 + n3 * 120, this.y + 4 + n4 * multiplier + yIncreease, 116, compact ? 16 : 108); + module.handleDrawElement(mouseX, mouseY, partialTicks); + addon = (compact ? 20 : 112); + if (++n3 != 3) continue; + ++n4; + n3 = addon = 0; + } + + this.scrollHeight = 4 + n4 * multiplier + yIncreease + addon; + +// this.compactModeButton.setDimensions(this.x + 4, this.y + 5,20, 20); +// this.compactModeButton.setMediumIcon(true); +// this.compactModeButton.handleDrawElement(mouseX, mouseY, partialTicks); + + this.onGuiDraw(mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + super.handleMouseClick(mouseX, mouseY, button); + +// if (this.compactModeButton.isMouseInside(mouseX, mouseY)) { +// CheatBreaker.getInstance().getGlobalSettings().compactMode.setValue(!CheatBreaker.getInstance().getGlobalSettings().compactMode.getBooleanValue()); +// // This is needed to refresh the menu, sorry. +// Minecraft.getMinecraft().displayGuiScreen(new HudLayoutEditorGui()); +// } + + for (ModulePreviewElement module : this.moduleList) { + if (!module.isMouseInside(mouseX, mouseY)) continue; + module.handleMouseClick(mouseX, mouseY, button); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewElement.java new file mode 100644 index 0000000..daf1613 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewElement.java @@ -0,0 +1,291 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.PreviewType; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.normal.hud.cooldowns.CooldownRenderer; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ModulePlaceGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.util.Objects; + +public class ModulePreviewElement extends AbstractModulesGuiElement { + private final AbstractModule module; + private final ModulesGuiButtonElement optionsButton; + private final ModulesGuiButtonElement mainEnableDisableButton; + private final ModulesGuiButtonElement secondaryEnableDisableButton; + + public final AbstractScrollableElement scrollableElement; + + public static ModulePreviewElement instance; + + private final boolean compact = CheatBreaker.getInstance().getGlobalSettings().compactMode.getValue().equals("Compact"); + + public ModulePreviewElement(AbstractScrollableElement abstractScrollableElement, AbstractModule module, float scale) { + super(scale); + instance = this; + this.module = module; + this.scrollableElement = abstractScrollableElement; + boolean validModule = module != CheatBreaker.getInstance().getModuleManager().miniMapMod && module != CheatBreaker.getInstance().getModuleManager().notificationsMod; + + String mainEnableDisableButtonString = module.getGuiAnchor() == null ? (module.isRenderHud() ? "Disable" : "Enable") : (module.isRenderHud() ? "Hide from HUD" : "Add to HUD"); + String secondaryEnableDisableButtonString = module.isEnabled() ? "Disable" : "Enable"; + String optionsString = (this.compact ? "cog-64.png" : "Options"); + + CBFontRenderer boldFont = CheatBreaker.getInstance().playBold18px; + CBFontRenderer regularFont = CheatBreaker.getInstance().playRegular14px; + + this.secondaryEnableDisableButton = new ModulesGuiButtonElement(regularFont, null, secondaryEnableDisableButtonString, this.x + this.width / 2 + 2, this.y + this.height - 38, this.x + this.width - 4, this.y + this.height - 24, module.isEnabled() ? -5756117 : -13916106, scale); + this.optionsButton = new ModulesGuiButtonElement(boldFont, null, optionsString, this.x + 4, this.y + this.height - 20, this.x + this.width - 4, this.y + this.height - 6, -12418828, scale); + this.mainEnableDisableButton = new ModulesGuiButtonElement(regularFont, null, mainEnableDisableButtonString, this.x + 4, this.y + this.height - 38, this.x + this.width / 2 - 2, this.y + this.height - 24, module.isRenderHud() ? -5756117 : -13916106, scale); + this.mainEnableDisableButton.allowAddToHud(validModule); + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + String previewString; + + if (this.module.isEnabled()) { + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.compact ? this.y + 16 : this.y + this.height, 3, + GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkEnabledBackgroundColor : CBTheme.lightEnabledBackgroundColor); + } else { + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.compact ? this.y + 16 : this.y + this.height, 3, + GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkInactiveBackgroundColor : CBTheme.lightInactiveBackgroundColor); + } + + CBFontRenderer cBFontRenderer = CheatBreaker.getInstance().playBold18px; + GL11.glPushMatrix(); + int n3 = 0; + int n4 = 0; + if (!this.compact) { + if (this.module == CheatBreaker.getInstance().getModuleManager().armourStatus) { + n3 = -10; + previewString = "329/329"; + f2 = Minecraft.getMinecraft().fontRendererObj.getStringWidth(previewString); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(previewString, (float) ((int) ((float) (this.x + 1 + this.width / 2) - f2 / 2.0f)), (float) (this.y + this.height / 2 - 18), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().potionEffectsMod) { + n4 = -30; + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Speed II", (float) (this.x + 8 + this.width / 2 - 20), (float) (this.y + this.height / 2 - 36), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("0:42", (float) (this.x + 8 + this.width / 2 - 20), (float) (this.y + this.height / 2 - 26), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().scoreboardMod) { + Gui.drawRect(this.x + 20, this.y + this.height / 2 - 44, this.x + this.width - 20, this.y + this.height / 2 - 6, 0x6F000000); + Minecraft.getMinecraft().fontRendererObj.drawCenteredStringWithShadow("Score", this.x + this.width / 2, this.y + this.height / 2 - 40, -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Steve", (float) (this.x + 24), (float) (this.y + this.height / 2 - 28), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Alex", (float) (this.x + 24), (float) (this.y + this.height / 2 - 18), -1); + Minecraft.getMinecraft().fontRendererObj.drawCenteredStringWithShadow(EnumChatFormatting.RED + "0", this.x + this.width - 26, this.y + this.height / 2 - 18, -1); + Minecraft.getMinecraft().fontRendererObj.drawCenteredStringWithShadow(EnumChatFormatting.RED + "1", this.x + this.width - 26, this.y + this.height / 2 - 28, -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().bossBarMod) { + n3 = 3; + previewString = "Wither"; + f2 = Minecraft.getMinecraft().fontRendererObj.getStringWidth(previewString); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(previewString, (float) ((int) ((float) (this.x + 1 + this.width / 2) - f2 / 2.0f)), (float) (this.y + this.height / 2 - 36), -1); + } /*else if (this.module == CheatBreaker.getInstance().getModuleManager().playerListMod) { + Gui.drawRect(this.x + 20, this.y + this.height / 2 - 44, this.x + this.width - 20, this.y + this.height / 2 - 7, 0x6F000000); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 43, this.x + this.width - 21, this.y + this.height / 2 - 35, 0x20FFFFFF); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 34, this.x + this.width - 21, this.y + this.height / 2 - 26, 0x20FFFFFF); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 25, this.x + this.width - 21, this.y + this.height / 2 - 17, 0x20FFFFFF); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 16, this.x + this.width - 21, this.y + this.height / 2 - 8, 0x20FFFFFF); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(Minecraft.getMinecraft().getSession().getUsername(), (float) (this.x + 21), (float) (this.y + this.height / 2 - 43), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Steve", (float) (this.x + 21), (float) (this.y + this.height / 2 - 34), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Alex", (float) (this.x + 21), (float) (this.y + this.height / 2 - 25), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow("Notch", (float) (this.x + 21), (float) (this.y + this.height / 2 - 16), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(EnumChatFormatting.GREEN + "15", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRendererObj.getStringWidth("15")), (float) (this.y + this.height / 2 - 43), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(EnumChatFormatting.GREEN + "75", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRendererObj.getStringWidth("75")), (float) (this.y + this.height / 2 - 34), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW + "155", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRendererObj.getStringWidth("155")), (float) (this.y + this.height / 2 - 25), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW + "250", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRendererObj.getStringWidth("250")), (float) (this.y + this.height / 2 - 16), -1); + } */else if (this.module == CheatBreaker.getInstance().getModuleManager().chatMod) { + Gui.drawRect(this.x + 10, this.y + this.height / 2 - 35, this.x + this.width - 10, this.y + this.height / 2 - 17, 0x6F000000); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(EnumChatFormatting.GREEN + "Steve" + EnumChatFormatting.WHITE + ": Hey.", (float) (this.x + 10), (float) (this.y + this.height / 2 - 34), -1); + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(EnumChatFormatting.GREEN + "Alex" + EnumChatFormatting.WHITE + ": Hi!", (float) (this.x + 10), (float) (this.y + this.height / 2 - 25), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().nameTagMod) { + int width = Minecraft.getMinecraft().fontRendererObj.getStringWidth(Minecraft.getMinecraft().getSession().getUsername()); + String account = width > 94 ? "Steve" : Minecraft.getMinecraft().getSession().getUsername(); + width = Minecraft.getMinecraft().fontRendererObj.getStringWidth(account); + Gui.drawRect((float) (this.x + this.width / 2 - width / 2 - 8), (float) (this.y + this.height / 2 - 33), (float) (this.x + this.width / 2 + width / 2 + 8), (float) (this.y + this.height / 2 - 24), 1862270976); + Minecraft.getMinecraft().fontRendererObj.drawString(account, this.x + this.width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(account) / 2 + 7, this.y + this.height / 2 - 32, -1, false); + RenderUtil.renderIcon(new ResourceLocation("client/logo_white.png"), (float) (this.x + this.width / 2 - width / 2 - 7), (float) (this.y + this.height / 2 - 32), 13.0f, 7.0f); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().crosshairMod) { + GL11.glScalef(2.0F, 2.0F, 0); + float size = 6.0F; + float gap = 4.0F; + float thickness = 2.0F; + float var11 = (this.x + this.width / 2) / 2.0F; + float var12 = (this.y + this.height / 2 - 27) / 2.0F; + + Gui.drawBoxWithOutLine(var11 - gap - size, var12 - thickness / 2.0F, var11 - gap, var12 + thickness / 2.0F, 0.5F, -1358954496, -1); + Gui.drawBoxWithOutLine(var11 + gap, var12 - thickness / 2.0F, var11 + gap + size, var12 + thickness / 2.0F, 0.5F, -1358954496, -1); + Gui.drawBoxWithOutLine(var11 - thickness / 2.0F, var12 - gap - size, var11 + thickness / 2.0F, var12 - gap, 0.5F, -1358954496, -1); + Gui.drawBoxWithOutLine(var11 - thickness / 2.0F, var12 + gap, var11 + thickness / 2.0F, var12 + gap + size, 0.5F, -1358954496, -1); + GL11.glScalef(1.0F, 1.0F, 0); + } + + if (this.module == CheatBreaker.getInstance().getModuleManager().coolDownsMod) { + CooldownRenderer cooldown = new CooldownRenderer("EnderPearl", 368, 9000L); + cooldown.render(CheatBreaker.getInstance().getModuleManager().coolDownsMod.theme, this.x + this.width / 2 - 18, this.y + this.height / 2 - 26 - 18, -1); + } else if ((this.module.getPreviewType() == null || this.module.getPreviewType() == PreviewType.LABEL) && this.module != CheatBreaker.getInstance().getModuleManager().scoreboardMod /*&& this.module != CheatBreaker.getInstance().getModuleManager().playerListMod*/ && this.module != CheatBreaker.getInstance().getModuleManager().chatMod && this.module != CheatBreaker.getInstance().getModuleManager().nameTagMod) { + previewString = ""; + if (this.module.getPreviewType() == null) { + f2 = 2.0f; + for (String string : this.module.getName().split(" ")) { + String string2 = string.substring(0, 1); + previewString = previewString + (Objects.equals(previewString, "") ? string2 : string2.toLowerCase()); + } + } else { + f2 = this.module.getPreviewLabelSize(); + previewString = this.module.getPreviewLabel(); + } + + GL11.glScalef(f2, f2, f2); + float f3 = (float) Minecraft.getMinecraft().fontRendererObj.getStringWidth(previewString) * f2; + if (this.module.getPreviewType() == null && !this.compact) { + Minecraft.getMinecraft().fontRendererObj.drawString(previewString, (int) (((float) (this.x + 1 + this.width / 2) - f3 / 2.0f) / f2), (int) ((float) (this.y + this.height / 2 - 32) / f2), -13750738); + } else { + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(previewString, (float) ((int) (((float) (this.x + 1 + this.width / 2) - f3 / 2.0f) / f2)), (float) ((int) ((float) (this.y + this.height / 2 - 32) / f2)), -1); + } + } else if (this.module.getPreviewType() == PreviewType.ICON) { + float f4 = this.module.getPreviewIconWidth(); + f2 = this.module.getPreviewIconHeight(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.module.getPreviewIcon(), (float) (this.x + this.width / 2) - f4 / 2.0f + (float) n4, (float) (this.y + n3 + this.height / 2 - 26) - f2 / 2.0f, f4, f2); + } + } + GL11.glPopMatrix(); + + String name = this.module.getName(); + int max = 14; + if (this.compact && name.replaceAll(" ", "").length() >= max) + name = name.substring(0, max).trim() + ".."; + + if (this.compact) { + cBFontRenderer.drawString(name, (this.x + 4F), this.y + 4, 0x5F000000); + cBFontRenderer.drawString(name, (this.x + 3F), this.y + 3, -1); + } else { + cBFontRenderer.drawCenteredString(name, (float) (this.x + this.width / 2) - 0.5F, this.y + this.height / 2 - 4 + 1, 0x5F000000); + cBFontRenderer.drawCenteredString(name, (float) (this.x + this.width / 2) - 1.5F, this.y + this.height / 2 - 4, -1); + } + + if (!this.compact) { + this.secondaryEnableDisableButton.optionString = this.module.isEnabled() ? "Disable" : "Enable"; + this.secondaryEnableDisableButton.yOffset = this.yOffset; + this.secondaryEnableDisableButton.setSmallIcon(false); + if (!this.module.notRenderHUD) { + this.secondaryEnableDisableButton.setDimensions(this.x + this.width / 2 + 8, this.y + this.height - 38, this.width / 2 - 12, this.y + this.height - 24 - (this.y + this.height - 38)); + this.secondaryEnableDisableButton.handleDrawElement(mouseX, n2, partialTicks); + } + } + + this.mainEnableDisableButton.optionString = this.compact ? this.module.isEnabled() ? "delete-64.png" : "plus-64.png" : this.module.getGuiAnchor() == null ? (this.module.isRenderHud() && this.module.isEnabled() ? "Disable" : "Enable") : (this.module.isRenderHud() && this.module.isEnabled() ? "Hide from HUD" : this.module.isWasRenderHud() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "Return to HUD" : "Add to HUD"); + this.mainEnableDisableButton.color = this.module.isRenderHud() && this.module.isEnabled() ? -5756117 : -13916106; + this.mainEnableDisableButton.setDimensions(this.x + (this.compact ? 87 : 4), this.y + (this.compact ? 3 : this.height - 38), this.compact ? 10 : this.module.notRenderHUD ? this.width - 8 : this.width / 2 + 2, this.compact ? 10 : this.y + this.height - 24 - (this.y + this.height - 38)); + this.mainEnableDisableButton.yOffset = this.yOffset; + this.mainEnableDisableButton.setSmallIcon(this.compact); + this.mainEnableDisableButton.handleDrawElement(mouseX, n2, partialTicks); + + this.optionsButton.setDimensions(this.x + (this.compact ? 102 : 4), this.y + (this.compact ? 3 : this.height - 20), this.compact ? 10 : this.width - 8, this.compact ? 10 : 16); + this.optionsButton.setSmallIcon(this.compact); + this.optionsButton.yOffset = this.yOffset; + this.optionsButton.handleDrawElement(mouseX, n2, partialTicks); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.optionsButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).isCheatBreakerSettings = false; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).scrollableElement = this.scrollableElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).module = this.module; + HudLayoutEditorGui.instance.currentScrollableElement = HudLayoutEditorGui.instance.settingsElement; + } else if (!this.module.notRenderHUD && this.secondaryEnableDisableButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setWasRenderHud(true); + this.module.setState(!this.module.isEnabled()); + this.secondaryEnableDisableButton.optionString = this.module.isEnabled() ? "Disable" : "Enable"; + this.secondaryEnableDisableButton.color = this.module.isEnabled() ? -5756117 : -13916106; + if (this.module.isEnabled()) { + this.applyDefaultColor(); + this.module.setState(true); + } + } else if (this.mainEnableDisableButton.moduleAllowedToAddToHud && this.mainEnableDisableButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + if (!this.module.isEnabled()) { + this.module.setRenderHud(true); + this.applyDefaultColor(); + if (this.module.getGuiAnchor() != null && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || !this.module.isWasRenderHud())) { + Minecraft.getMinecraft().displayGuiScreen(new ModulePlaceGui(HudLayoutEditorGui.instance, this.module)); + } else { + this.module.setState(true); + } + } else { + this.module.setRenderHud(!this.module.isRenderHud()); + if (this.module.isRenderHud()) { + this.applyDefaultColor(); + if (this.module.getGuiAnchor() != null && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || !this.module.isWasRenderHud())) { + Minecraft.getMinecraft().displayGuiScreen(new ModulePlaceGui(HudLayoutEditorGui.instance, this.module)); + } else { + this.module.setState(true); + } + } else if (this.module.notRenderHUD && this.module.isEnabled()) { + this.module.setState(false); + } + } + this.module.setWasRenderHud(true); + this.mainEnableDisableButton.optionString = this.module.getGuiAnchor() == null ? (this.module.isRenderHud() && this.module.isEnabled() ? "Disable" : "Enable") : (this.module.isRenderHud() && this.module.isEnabled() ? "Hide from HUD" : this.module.isWasRenderHud() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "Return to HUD" : "Add to HUD"); + this.mainEnableDisableButton.color = this.module.isRenderHud() && this.module.isEnabled() ? -5756117 : -13916106; + } + + if (this.compact && this.isMouseInside(mouseX, mouseY) && !this.mainEnableDisableButton.isMouseInside(mouseX, mouseY) && !this.secondaryEnableDisableButton.isMouseInside(mouseX, mouseY) && !this.optionsButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setWasRenderHud(true); + this.module.setState(!this.module.isEnabled()); + + if (this.module.isEnabled()) { + this.applyDefaultColor(); + this.module.setState(true); + } + } + } + + public void sendBackToModuleList(AbstractModule module) { + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).isCheatBreakerSettings = false; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).scrollableElement = this.scrollableElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).module = module; + (HudLayoutEditorGui.instance.settingsElement).scrollAmount = CheatBreaker.getInstance().getModuleManager().lastSettingScrollPos; + HudLayoutEditorGui.instance.currentScrollableElement = HudLayoutEditorGui.instance.settingsElement; + } + + private void applyDefaultColor() { + if (this.module == CheatBreaker.getInstance().getModuleManager().directionHUDMod +// || this.module == CheatBreaker.getInstance().getModuleManager().playerListMod + || this.module == CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod + || this.module == CheatBreaker.getInstance().getModuleManager().packTweaksMod + || this.module == CheatBreaker.getInstance().getModuleManager().blockOverlayMod + || this.module == CheatBreaker.getInstance().getModuleManager().hitColorMod + || this.module == CheatBreaker.getInstance().getModuleManager().crosshairMod + || this.module == CheatBreaker.getInstance().getModuleManager().scoreboardMod + || !(Boolean) CheatBreaker.getInstance().getGlobalSettings().resetColors.getValue()) { + return; + } + for (Setting setting : this.module.getSettingsList()) { + if (setting.getType() != SettingType.INTEGER || !setting.getSettingName().toLowerCase().contains("color") || setting.getSettingName().toLowerCase().contains("background") || setting.getSettingName().toLowerCase().contains("border") || setting.getSettingName().toLowerCase().contains("pressed") || setting.getSettingName().toLowerCase().contains("amount") || setting.getSettingName().toLowerCase().contains("line")) + continue; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + setting.setValue(CheatBreaker.getInstance().getGlobalSettings().defaultColor.getColorValue()); + } + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleSettingsElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleSettingsElement.java new file mode 100644 index 0000000..925141f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleSettingsElement.java @@ -0,0 +1,72 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ModuleSettingsElement extends AbstractModulesGuiElement { + private final int highlightColor; + public final AbstractModule module; + public final AbstractScrollableElement scrollbar; + private int progressiveRect = 0; + private final ResourceLocation arrowIcon = new ResourceLocation("client/icons/right.png"); + + public ModuleSettingsElement(AbstractScrollableElement scrollbar, int highlightColor, AbstractModule module, float scale) { + super(scale); + this.scrollbar = scrollbar; + this.highlightColor = highlightColor; + this.module = module; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean bl = this.isMouseInside(mouseX, mouseY); + int n3 = 75; + Gui.drawRect(this.x, this.y + this.height - 1, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + if (this.scrollbar.hasSettings(this.module)) { + float f2; + if (bl) { + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + if ((float)this.progressiveRect + f2 < (float)n3) { + this.progressiveRect = (int)((float)this.progressiveRect + f2); + if (this.progressiveRect > n3) { + this.progressiveRect = n3; + } + } + } else if (this.progressiveRect > 0) { + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.progressiveRect = (float)this.progressiveRect - f2 < 0.0f ? 0 : (int)((float)this.progressiveRect - f2); + } + if (this.progressiveRect > 0) { + f2 = (float)this.progressiveRect / (float)n3 * 100.0F; + Gui.drawRect(this.x, (int)((float)this.y + ((float)this.height - (float)this.height * f2 / 100.0F)), this.x + this.width, this.y + this.height, this.highlightColor); + } + } + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.35f); + RenderUtil.renderIcon(this.arrowIcon, 2.5F, (float)(this.x + 6), (float)this.y + 6.0F); + CheatBreaker.getInstance().playBold18px.drawString(this.module.getName().toUpperCase(), (float)this.x + 14.0F, (float)this.y + 3.0F, this.scrollbar.hasSettings(this.module) ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + double d = this.height - 10; + double d3 = d / this.scrollbar.scrollHeight * (double) 100; + double d4 = d / (double) 100 * d3; + double d5 = (double) this.scrollbar.scrollAmount / 100.0 * d3; + boolean bl4 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (double) mouseY > ((double) (this.y + 11) - d5) * (double) this.scale && (double) mouseY < ((double) (this.y + 8) + d4 - d5) * (double) this.scale; + boolean bl3 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (float) mouseY > (float) (this.y + 11) * this.scale && (double) mouseY < ((double) (this.y + 6) + d - (double) 3) * (double) this.scale; + if (button == 0 && bl3 || bl4) { + this.scrollbar.hovering = true; + } + this.scrollbar.handleModuleMouseClick(this.module); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulesGuiButtonElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulesGuiButtonElement.java new file mode 100644 index 0000000..b326e89 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/module/ModulesGuiButtonElement.java @@ -0,0 +1,109 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import lombok.Setter; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ModulesGuiButtonElement extends AbstractModulesGuiElement { + public int color; + @Setter public boolean conflict; + @Setter public boolean smallIcon; + @Setter public boolean mediumIcon; + public String optionString; + public final AbstractScrollableElement scrollableElement; + private final CBFontRenderer font; + public boolean moduleAllowedToAddToHud = true; + private int timing = 0; + private boolean background; + + public ModulesGuiButtonElement(CBFontRenderer font, AbstractScrollableElement scroll, String string, int x, int y, int x2, int y2, int color, float scale) { + super(scale); + this.optionString = string; + this.setDimensions(x, y, x2, y2); + this.color = color; + this.scrollableElement = scroll; + this.font = font; + this.background = true; + } + + public ModulesGuiButtonElement(AbstractScrollableElement scroll, String string, int x, int y, int x2, int y2, int color, float scale) { + this(CheatBreaker.getInstance().playBold22px, scroll, string, x, y, x2, y2, color, scale); + this.background = true; + } + + public ModulesGuiButtonElement(AbstractScrollableElement scroll, String string, int x, int y, int x2, int y2, int color, float scale, boolean background) { + this(CheatBreaker.getInstance().playBold22px, scroll, string, x, y, x2, y2, color, scale); + this.background = background; + } + + public ModulesGuiButtonElement(CBFontRenderer font, AbstractScrollableElement scroll, String string, int x, int y, int x2, int y2, int color, float scale, boolean background) { + this(font, scroll, string, x, y, x2, y2, color, scale); + this.background = background; + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + boolean bl = this.isMouseInside(mouseX, n2); + int n3 = 120; + if (bl && this.moduleAllowedToAddToHud) { + if (this.background) { + Gui.drawRect(this.x - 2, this.y - 2, this.x + this.width + 2, this.y + this.height + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor3 : CBTheme.lightBackgroundColor3); + } + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.timing = (float)this.timing + f2 < (float)n3 ? (int)((float)this.timing + f2) : n3; + } else if (this.timing > 0) { + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.timing = (float)this.timing - f2 < 0.0f ? 0 : (int)((float)this.timing - f2); + } + + if (this.background) { + if (this.moduleAllowedToAddToHud) { + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor : CBTheme.lightBackgroundColor); + } else { + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor2 : CBTheme.lightBackgroundColor2); + } + } + + if (this.timing > 0) { + f2 = (float)this.timing / (float)n3 * 100.0F; + Gui.drawRect(this.x, (int)((float)this.y + ((float)this.height - (float)this.height * f2 / 100.0F)), this.x + this.width, this.y + this.height, this.color); + } + + if (this.optionString.contains(".png")) { + float iconScale = this.smallIcon ? 3.5F : 8F; + float iconX = this.mediumIcon ? (this.x + 2F) : this.smallIcon ? (float)(this.x + 1.6) : (float)(this.x + 6); + float iconY = this.mediumIcon ? (this.y + 2F) : this.smallIcon ? (float)(this.y + 1.7) : (float)(this.y + 6); + + GL11.glPushMatrix(); + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.47368422f * 0.9499999f); + RenderUtil.renderIcon(new ResourceLocation("client/icons/" + this.optionString), iconScale, iconX, iconY); + GL11.glPopMatrix(); + } else { + f2 = this.font == CheatBreaker.getInstance().playBold22px ? 2.0f : 0.54545456f * 0.9166667f; + this.font.drawCenteredString(this.optionString.toUpperCase(), this.x + this.width / 2, (float)(this.y + this.height / 2 - this.font.getHeight()) + f2, (this.conflict ? 11141120 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor)); + } + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } + + public int getWidth() { + return this.width; + } + + public void allowAddToHud(boolean module) { + this.moduleAllowedToAddToHud = module; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfileElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfileElement.java new file mode 100644 index 0000000..8f3323f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfileElement.java @@ -0,0 +1,179 @@ +package com.cheatbreaker.client.ui.element.profile; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ProfileCreatorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.File; +import java.util.Collections; + +public class ProfileElement extends AbstractModulesGuiElement { + private final int highlightColor; + public final Profile profile; + private final AbstractScrollableElement scrollableElement; + private int animationSpeed = 0; + private final ResourceLocation deleteIcon = new ResourceLocation("client/icons/delete-64.png"); + private final ResourceLocation themeIcon = new ResourceLocation("client/icons/checkmark-64.png"); + private final ResourceLocation arrowIcon = new ResourceLocation("client/icons/right.png"); + private final ResourceLocation pencilIcon = new ResourceLocation("client/icons/pencil-64.png"); + + public ProfileElement(AbstractScrollableElement abstractScrollableElement, int highlightColor, Profile profile, float scale) { + super(scale); + this.scrollableElement = abstractScrollableElement; + this.highlightColor = highlightColor; + this.profile = profile; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean bl; + boolean bl2; + float animationSpeed; + boolean bl3 = mouseX > this.x + 12 && this.isMouseInside(mouseX, mouseY); + int n3 = 75; + + Gui.drawRect(this.x, this.y + this.height - 1, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + + if (bl3) { + if (this.animationSpeed < n3) { + animationSpeed = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.animationSpeed = (int) ((float) this.animationSpeed + animationSpeed); + if (this.animationSpeed > n3) { + this.animationSpeed = n3; + } + } + } else if (this.animationSpeed > 0) { + animationSpeed = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.animationSpeed = (float) this.animationSpeed - animationSpeed < 0.0f ? 0 : (int) ((float) this.animationSpeed - animationSpeed); + } + + if (this.animationSpeed > 0) { + animationSpeed = (float) this.animationSpeed / (float) n3 * 100.0F; + Gui.drawRect(this.x + 12, (int) ((float) this.y + ((float) this.height - (float) this.height * animationSpeed / 100.0F)), this.x + this.width - (this.profile.isNotEditable() ? 0 : 30), this.y + this.height, this.highlightColor); + } + + boolean bl4 = (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + 12) * this.scale && (float) mouseY >= (float) (this.y + this.yOffset) * this.scale && (float) mouseY <= (float) (this.y + this.height / 2 + this.yOffset) * this.scale; + boolean bl5 = (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + 12) * this.scale && (float) mouseY > (float) (this.y + this.height / 2 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + this.height + this.yOffset) * this.scale; + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.35f); + float f3 = 2.5f; + if (!this.profile.isNotEditable()) { + bl2 = false; + bl = false; + ProfilesListElement profilesListElement = (ProfilesListElement) this.scrollableElement; + + if (profilesListElement.profileList.indexOf(this) != 0 && profilesListElement.profileList.indexOf(this) > 1) { + bl2 = true; + GL11.glPushMatrix(); + if (bl4) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.65f); + } + GL11.glTranslatef((float) (this.x + 6) - f3, (float) this.y + 7.0F, 0.0f); + GL11.glRotatef(-90, 0.0f, 0.0f, 1.0f); + RenderUtil.renderIcon(this.arrowIcon, f3, (float) -1, 0.0f); + GL11.glPopMatrix(); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.35f); + } + + if (profilesListElement.profileList.indexOf(this) != profilesListElement.profileList.size() - 1) { + bl = true; + GL11.glPushMatrix(); + if (bl5) { + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.65f); + } + GL11.glTranslatef((float) (this.x + 6) + f3, (float) this.y + 7.0F, 0.0f); + GL11.glRotatef(90, 0.0f, 0.0f, 1.0f); + RenderUtil.renderIcon(this.arrowIcon, f3, 2.0f, 0.0f); + GL11.glPopMatrix(); + } + + if (!bl2 && !bl) { + RenderUtil.renderIcon(this.arrowIcon, 2.5f, (float) (this.x + 4), (float) this.y + 6.0f); + } + } else { + RenderUtil.renderIcon(this.arrowIcon, 2.5f, (float) (this.x + 4), (float) this.y + 6.0f); + } + + if (CheatBreaker.getInstance().getConfigManager().activeProfile == this.profile) { + CheatBreaker.getInstance().playBold18px.drawString(this.profile.getName().toUpperCase(), (float)this.x + 16.0f, (float)(this.y + 3), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2); + } else { + CheatBreaker.getInstance().playRegular16px.drawString(this.profile.getName().toUpperCase(), (float)this.x + 16.0f, (float)this.y + 3.5f, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2); + } + if (CheatBreaker.getInstance().getConfigManager().activeProfile == this.profile) { + CheatBreaker.getInstance().playRegular14px.drawString(" (Active)", (float)this.x + (float)17 + (float)CheatBreaker.getInstance().playBold18px.getStringWidth(this.profile.getName().toUpperCase()), (float)this.y + (float)4, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor4 : CBTheme.lightDullTextColor4); + } + + if (!this.profile.isNotEditable()) { + + + bl2 = (float) mouseX > (float) (this.x + this.width - 30) * this.scale && (float) mouseX < (float) (this.x + this.width - 13) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + this.height + this.yOffset) * this.scale; + GL11.glColor4f(bl2 ? 0.0f : 1.1707317f * 0.21354167f, bl2 ? 0.0f : 0.101648346f * 2.4594595f, bl2 ? 0.48876402f * 1.0229886f : 0.5647059f * 0.4427083f, 0.5675676f * 1.145238f); + RenderUtil.renderIcon(this.pencilIcon, (float) 5, (float) (this.x + this.width - 26), (float) this.y + 5.1916666f * 0.6741573f); + + bl = (float) mouseX > (float) (this.x + this.width - 17) * this.scale && (float) mouseX < (float) (this.x + this.width - 2) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + this.height + this.yOffset) * this.scale; + GL11.glColor4f(bl ? 1.4181818f * 0.5641026f : 0.96875f * 0.2580645f, bl ? 0.0f : 0.17553192f * 1.4242424f, bl ? 0.0f : 15.250001f * 0.016393442f, 0.44444445f * 1.4625f); + RenderUtil.renderIcon(this.deleteIcon, (float) 5, (float) (this.x + this.width - 13), (float) this.y + 0.7653061f * 4.5733333f); + } + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl = (float) mouseX > (float) (this.x + this.width - 17) * this.scale && (float) mouseX < (float) (this.x + this.width - 2) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + this.height + this.yOffset) * this.scale; + boolean bl2 = (float) mouseX > (float) (this.x + this.width - 30) * this.scale && (float) mouseX < (float) (this.x + this.width - 13) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + this.height + this.yOffset) * this.scale; + boolean bl3 = (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + 12) * this.scale && (float) mouseY >= (float) (this.y + this.yOffset) * this.scale && (float) mouseY <= (float) (this.y + this.height / 2 + this.yOffset) * this.scale; + boolean bl4 = (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + 12) * this.scale && (float) mouseY > (float) (this.y + this.height / 2 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + this.height + this.yOffset) * this.scale; + + ProfilesListElement profilesListElement = (ProfilesListElement) this.scrollableElement; + + if (!this.profile.isNotEditable() && (bl3 || bl4)) { + if (bl3 && ((ProfilesListElement) this.scrollableElement).profileList.indexOf(this) != 0 && ((ProfilesListElement) this.scrollableElement).profileList.indexOf(this) > 1) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.profile.index = profilesListElement.profileList.indexOf(this) - 1; + profilesListElement.profileList.get(profilesListElement.profileList.indexOf(this) - 1).profile.index = profilesListElement.profileList.indexOf(this); + Collections.swap(profilesListElement.profileList, profilesListElement.profileList.indexOf(this), profilesListElement.profileList.indexOf(this) - 1); + } + if (bl4 && profilesListElement.profileList.indexOf(this) != profilesListElement.profileList.size() - 1) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.profile.index = profilesListElement.profileList.indexOf(this) + 1; + profilesListElement.profileList.get(profilesListElement.profileList.indexOf(this) + 1).profile.index = profilesListElement.profileList.indexOf(this); + Collections.swap(profilesListElement.profileList, profilesListElement.profileList.indexOf(this), profilesListElement.profileList.indexOf(this) + 1); + } + } else if (!this.profile.isNotEditable() && bl) { + File file; + File file2; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + if (CheatBreaker.getInstance().getConfigManager().activeProfile == this.profile) { + CheatBreaker.getInstance().getConfigManager().activeProfile = CheatBreaker.getInstance().getConfigManager().moduleProfiles.get(0); + CheatBreaker.getInstance().configManager.readProfile(CheatBreaker.getInstance().getConfigManager().activeProfile.getName()); + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().refreshChat(); + } + if (!this.profile.isNotEditable() && (file2 = (file = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-") + File.separator + "profiles")).exists() || file.mkdirs() ? new File(file + File.separator + this.profile.getName().toLowerCase() + ".cfg") : null).exists() && file2.delete()) { + CheatBreaker.getInstance().getConfigManager().moduleProfiles.removeIf(profile -> profile == this.profile); + profilesListElement.profileList.removeIf(profileElement -> profileElement == this); + } + } else if (!this.profile.isNotEditable() && bl2) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + Minecraft.getMinecraft().displayGuiScreen(new ProfileCreatorGui(this.profile, HudLayoutEditorGui.instance, (ProfilesListElement) this.scrollableElement, this.highlightColor, this.scale)); + } else if (CheatBreaker.getInstance().getConfigManager().activeProfile != this.profile) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().configManager.updateProfile(CheatBreaker.getInstance().getConfigManager().activeProfile.getName()); + CheatBreaker.getInstance().getConfigManager().activeProfile = this.profile; + CheatBreaker.getInstance().configManager.readProfile(CheatBreaker.getInstance().getConfigManager().activeProfile.getName()); + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().refreshChat(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfilesListElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfilesListElement.java new file mode 100644 index 0000000..ca0b9a9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfilesListElement.java @@ -0,0 +1,137 @@ +package com.cheatbreaker.client.ui.element.profile; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ProfileCreatorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import lombok.SneakyThrows; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class ProfilesListElement extends AbstractScrollableElement { + private final int highlightColor; + public final List profileList = new ArrayList<>(); + private final ResourceLocation plusIcon = new ResourceLocation("client/icons/plus-64.png"); + private final ModulesGuiButtonElement openProfilesFolderButton; + + public ProfilesListElement(float scale, int x, int y, int width, int height) { + super(scale, x, y, width, height); + this.highlightColor = -12418828; + this.openProfilesFolderButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, "Open Profiles Folder", this.x + width - 120, this.y + height + 4, 110, 28, -12418828, scale); + this.loadProfiles(); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + int hovering; + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.y + this.height + 2, 8, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor4); + this.onScroll(mouseX, mouseY); + this.scrollHeight = 15; + for (hovering = 0; hovering < this.profileList.size(); ++hovering) { + ProfileElement object = this.profileList.get(hovering); + object.setDimensions(this.x + 4, this.y + 4 + hovering * 18, this.width - 12, 18); + object.yOffset = this.scrollAmount; + object.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += object.getHeight(); + } + hovering = (float) mouseX > (float) (this.x + this.width - 92) * this.scale && (float) mouseX < (float) (this.x + this.width - 6) * this.scale && (float) mouseY > (float) (this.y + this.scrollHeight - 10 + this.scrollAmount) * this.scale && (float) mouseY < (float) (this.y + this.scrollHeight + 3 + this.scrollAmount) * this.scale ? 1 : 0; + GL11.glColor4f(hovering != 0 ? 0.0f : 0.25f, hovering != 0 ? 0.8f : 0.25f, hovering != 0 ? 0.0f : 0.25f, 0.65f); + RenderUtil.renderIcon(this.plusIcon, 3.5f, (float) (this.x + this.width - 15), (float) (this.y + this.scrollHeight) - 6.5f); + String addNewProfile = (hovering != 0 ? "(COPIES CURRENT PROFILE) " : "") + "ADD NEW PROFILE"; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(addNewProfile, this.x + this.width - 17 - CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(addNewProfile), (float)(this.y + this.scrollHeight) - 7.5f, hovering != 0 ? 0x7F007F00 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor6 : CBTheme.lightTextColor6); + this.scrollHeight += 10; + this.openProfilesFolderButton.yOffset = this.scrollAmount; + this.openProfilesFolderButton.setDimensions(this.x + this.width - 130, this.y + this.scrollHeight, 125, 20); + this.openProfilesFolderButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.onGuiDraw(mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.openProfilesFolderButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + try { + Desktop.getDesktop().open(CheatBreaker.getInstance().getConfigManager().profileDir); + } catch (IllegalArgumentException | IOException e) { + e.printStackTrace(); + } + return; + } + + for (ProfileElement profileElement : this.profileList) { + if (!profileElement.isMouseInside(mouseX, mouseY)) continue; + profileElement.handleMouseClick(mouseX, mouseY, button); + return; + } + boolean bl = (float) mouseX > (float) (this.x + this.width - 92) * this.scale && (float) mouseX < (float) (this.x + this.width - 6) * this.scale && (float) mouseY > (float) (this.y + this.scrollHeight - 20 + this.scrollAmount) * this.scale && (float) mouseY < (float) (this.y + this.scrollHeight - 7 + this.scrollAmount) * this.scale; + if (bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + Minecraft.getMinecraft().displayGuiScreen(new ProfileCreatorGui(HudLayoutEditorGui.instance, this, this.highlightColor, this.scale)); + } + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double) 100; + double d4 = d / (double) 100 * d3; + double d5 = (double) this.scrollAmount / 100.0 * d3; + boolean bl43 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (double) mouseY > ((double) (this.y + 11) - d5) * (double) this.scale && (double) mouseY < ((double) (this.y + 8) + d4 - d5) * (double) this.scale; + boolean bl33 = (float) mouseX > (float) (this.x + this.width - 9) * this.scale && (float) mouseX < (float) (this.x + this.width - 3) * this.scale && (float) mouseY > (float) (this.y + 11) * this.scale && (double) mouseY < ((double) (this.y + 6) + d - (double) 3) * (double) this.scale; + if (button == 0 && bl33 || bl43) { + this.hovering = true; + } + } + + @Override + public boolean hasSettings(AbstractModule module) { + return true; + } + + @Override + public void handleModuleMouseClick(AbstractModule abstractModule) { + } + + public void loadProfiles() { + new Thread(() -> { + this.profileList.clear(); + File file = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-") + File.separator + "profiles"); + if (file.exists()) { + for (File file2 : file.listFiles()) { + if (!file2.getName().endsWith(".cfg")) continue; + Profile profile = null; + for (Profile profile2 : CheatBreaker.getInstance().getConfigManager().moduleProfiles) { + if (!file2.getName().equals(profile2.getName() + ".cfg")) continue; + profile = profile2; + } + if (profile != null) continue; + CheatBreaker.getInstance().getConfigManager().moduleProfiles.add(new Profile(file2.getName().replace(".cfg", ""), false)); + } + } + for (Profile profile : CheatBreaker.getInstance().getConfigManager().moduleProfiles) { + this.profileList.add(new ProfileElement(this, this.highlightColor, profile, this.scale)); + } + this.profileList.sort((profileElement, profileElement2) -> { + if (profileElement.profile.getName().equalsIgnoreCase("default")) { + return 0; + } + if (profileElement.profile.index < profileElement2.profile.index) { + return -1; + } + return 1; + }); + }).start(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ChoiceElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ChoiceElement.java new file mode 100644 index 0000000..659fc3f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ChoiceElement.java @@ -0,0 +1,128 @@ +package com.cheatbreaker.client.ui.element.type; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ChoiceElement extends AbstractModulesGuiElement { + // private final Setting setting; + private final ResourceLocation leftArrowIcon = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation rightArrowIcon = new ResourceLocation("client/icons/right.png"); + private int optionValueIndex = 0; // From what I can tell, this only matters in terms of showing the new option value + private float animationSpeed = 0.0f; + private String optionValue; + + public ChoiceElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.height = 12; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean yrrr = (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + boolean isXHovering = (float) mouseX > (float)(this.x + this.width - 48) * this.scale && (float) mouseX < (float)(this.x + this.width - 10) * this.scale && yrrr; + boolean isYHovering = (float) mouseX > (float)(this.x + this.width - 92) * this.scale && (float) mouseX < (float)(this.x + this.width - 48) * this.scale && yrrr; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), isYHovering || isXHovering ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor3 : CBTheme.lightTextColor3 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + boolean endsWithColor = this.setting.getSettingName().toLowerCase().endsWith("color"); + + if (!endsWithColor) { + if (this.optionValueIndex == 0) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((String)this.setting.getValue(), this.x + this.width - 48, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + boolean valIsOne = this.optionValueIndex == 1; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.optionValue, (float)(this.x + this.width - 48) - (valIsOne ? -this.animationSpeed : this.animationSpeed), this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + if (valIsOne) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((String)this.setting.getValue(), (float)(this.x + this.width - 98) + this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((String)this.setting.getValue(), (float)(this.x + this.width + 2) - this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + if (this.animationSpeed >= (float)50) { + this.optionValueIndex = 0; + this.animationSpeed = 0.0f; + } else { + float speed = HudLayoutEditorGui.getFPSTransitionSpeed((float)50 + this.animationSpeed * (float)15); + this.animationSpeed = Math.min(this.animationSpeed + speed, (float) 50); + } + + Gui.drawRect(this.x + this.width - 130, this.y + 2, this.x + this.width - 72, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + Gui.drawRect(this.x + this.width - 22, this.y + 2, this.x + this.width + 4, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + } + } else if (this.optionValueIndex == 0) { + float f3 = CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth((String)this.setting.getValue()); + CheatBreaker.getInstance().ubuntuMedium16px.drawString((String)this.setting.getValue(), (float)(this.x + this.width) - 44.738373f * 1.0617284f - f3 / 2.0f, (float)this.y + 1.74f * 1.4367816f, -16777216); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("§" + this.setting.getValue() + this.setting.getValue(), (float)(this.x + this.width - 48) - f3 / 2.0f, (float)(this.y + 2), -16777216); + } else { + boolean bl5 = this.optionValueIndex == 1; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.optionValue, (float)(this.x + this.width - 48) - (bl5 ? -this.animationSpeed : this.animationSpeed), this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + float f4 = CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth((String)this.setting.getValue()); + if (bl5) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString((String)this.setting.getValue(), (float)(this.x + this.width) - 110.21739f * 0.88461536f - f4 / 2.0f + this.animationSpeed, (float)this.y + 0.8095238f * 3.0882351f, -16777216); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("§" + this.setting.getValue() + this.setting.getValue(), (float)(this.x + this.width - 98) - f4 / 2.0f + this.animationSpeed, (float)(this.y + 2), -16777216); + } else { + CheatBreaker.getInstance().ubuntuMedium16px.drawString((String)this.setting.getValue(), (float)(this.x + this.width) - 2.6296296f * 0.57042253f - f4 / 2.0f - this.animationSpeed, (float)this.y + 0.040983606f * 61.0f, -16777216); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("§" + this.setting.getValue() + this.setting.getValue(), (float)(this.x + this.width - 2) - f4 / 2.0f - this.animationSpeed, (float)(this.y + 2), -16777216); + } + if (this.animationSpeed >= (float)50) { + this.optionValueIndex = 0; + this.animationSpeed = 0.0f; + } else { + float animationSpeed = HudLayoutEditorGui.getFPSTransitionSpeed((float)50 + this.animationSpeed * (float)15); + this.animationSpeed = Math.min(this.animationSpeed + animationSpeed, (float) 50); + } + Gui.drawRect(this.x + this.width - 130, this.y + 2, this.x + this.width - 72, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + Gui.drawRect(this.x + this.width - 22, this.y + 2, this.x + this.width + 4, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + } + + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isYHovering ? 0.6857143f * 1.1666666f : 0.5416667f * 0.8307692f); + RenderUtil.renderIcon(this.leftArrowIcon, (float)4, (float)(this.x + this.width - 82), (float)(this.y + 3)); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isXHovering ? 0.82580644f * 0.96875f : 3.3793104f * 0.13316326f); + RenderUtil.renderIcon(this.rightArrowIcon, (float)4, (float)(this.x + this.width - 22), (float)(this.y + 3)); + drawDescription(this.setting, mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl2 = (float) mouseX > (float)(this.x + this.width - 48) * this.scale && (float) mouseX < (float)(this.x + this.width - 10) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + boolean bl = (float) mouseX > (float)(this.x + this.width - 92) * this.scale && (float) mouseX < (float)(this.x + this.width - 48) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + if ((bl || bl2) && this.optionValueIndex == 0) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + for (int i = 0; i < this.setting.getAcceptedStringValues().length; ++i) { + if (!((String[])this.setting.getAcceptedStringValues())[i].toLowerCase().equalsIgnoreCase((String)this.setting.getValue())) continue; + this.optionValue = (String)this.setting.getValue(); + if (bl2) { + if (i + 1 >= this.setting.getAcceptedStringValues().length) { + this.optionValueIndex = 2; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[0]); + break; + } + this.optionValueIndex = 2; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[i + 1]); + break; + } + if (!bl) continue; + if (i - 1 < 0) { + this.optionValueIndex = 1; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[this.setting.getAcceptedStringValues().length - 1]); + break; + } + this.optionValueIndex = 1; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[i - 1]); + break; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerColorElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerColorElement.java new file mode 100644 index 0000000..306145e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerColorElement.java @@ -0,0 +1,27 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import net.minecraft.client.gui.Gui; + +public class ColorPickerColorElement extends AbstractModulesGuiElement { + public int color; + private final float scaleFactor; + + public ColorPickerColorElement(float scaleFactor, int color, float scale) { + super(scaleFactor); + this.color = color; + this.scaleFactor = scale; + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + Gui.drawRectWithOutline(this.x, this.y, this.x + this.width, this.y + this.height, 1, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4, 0); + Gui.drawRect(this.x + 1, this.y + 1, this.x + this.width - 1, this.y + this.height - 1, this.color | 0xFF000000); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerElement.java new file mode 100644 index 0000000..f40ddb3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerElement.java @@ -0,0 +1,345 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +public class ColorPickerElement extends AbstractModulesGuiElement { + // private final Setting setting; + private final List colors; + private boolean expanded = false; + private boolean IlllIllIlIIIIlIIlIIllIIIl = false; + private boolean IlIlllIIIIllIllllIllIIlIl = false; + private boolean llIIlllIIIIlllIllIlIlllIl = false; + private final ColorPickerColorElement colorPickerColorElement; + private float IIIlllIIIllIllIlIIIIIIlII = 1.0f; + private float llIlIIIlIIIIlIlllIlIIIIll = 1.0f; + private float pickerX; + private float pickerY; + private float pickerX2; + private float pickerY2; + private float pickerXDiff; + private float pickerYDiff; + private int lIIlIIllIIIIIlIllIIIIllII; + private int lIIlllIIlIlllllllllIIIIIl; + private int lIllIllIlIIllIllIlIlIIlIl; + private int llIlIIIllIIIIlllIlIIIIIlI; + + public ColorPickerElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.colorPickerColorElement = new ColorPickerColorElement(scaleFactor, (Integer) setting.getValue(), 1.0f); + this.colors = new ArrayList<>(); + for (int i = 0; i < 16; ++i) { + int color = Minecraft.getMinecraft().fontRendererObj.colorCode[i]; + this.colors.add(new ColorPickerColorElement(scaleFactor, color, 1.0f)); + } + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + this.height = this.expanded ? 130 : 18; + this.pickerX = this.x + 56; + this.pickerX2 = this.x + 176; + this.pickerY = this.y + 25; + this.pickerY2 = this.y + 119; + this.pickerXDiff = this.pickerX2 - this.pickerX; + this.pickerYDiff = this.pickerY2 - this.pickerY; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + this.colorPickerColorElement.color = this.setting.getColorValue(); + this.colorPickerColorElement.setDimensions(this.x + 160, this.y + 3, 14, 14); + this.colorPickerColorElement.yOffset = this.yOffset; + this.colorPickerColorElement.handleDrawElement(mouseX, mouseY, partialTicks); + Gui.drawRect(this.x + 186, this.y + 16, this.x + this.width - 16, this.y + 17, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor6 : CBTheme.lightTextColor6); + CheatBreaker.getInstance().playBold18px.drawString("#", this.x + 188, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + CheatBreaker.getInstance().playBold18px.drawString(Integer.toHexString(this.setting.getColorValue()), this.x + 194, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + boolean hovering = (float) mouseX > (float) (this.x + this.width - 40) * this.scale && (float) mouseX < (float) (this.x + this.width - 12) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 18 + this.yOffset) * this.scale; + String favoriteString = hovering ? "(Favorite)" : "(+)"; + if (CheatBreaker.getInstance().getGlobalSettings().isFavouriteColor((Integer) this.setting.getValue())) { + favoriteString = hovering ? "(Un-favorite)" : "(-)"; + } + CheatBreaker.getInstance().playBold18px.drawString(favoriteString, this.x + this.width - 16 - CheatBreaker.getInstance().playBold18px.getStringWidth(favoriteString), (float)(this.y + 4), hovering ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + drawDescription(this.setting, mouseX, mouseY); + if (this.expanded) { + if (this.IlllIllIlIIIIlIIlIIllIIIl && !Mouse.isButtonDown(0)) { + this.IlllIllIlIIIIlIIlIIllIIIl = false; + this.addRecentColor(); + } + if (this.IlIlllIIIIllIllllIllIIlIl && !Mouse.isButtonDown(0)) { + this.IlIlllIIIIllIllllIllIIlIl = false; + this.addRecentColor(); + } + if (this.llIIlllIIIIlllIllIlIlllIl && !Mouse.isButtonDown(0)) { + this.llIIlllIIIIlllIllIlIlllIl = false; + this.addRecentColor(); + } + Gui.drawRect(this.x + 55, this.y + 24, this.x + 177, this.y + 120, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5); + Tessellator tessellator = Tessellator.getInstance(); + GL11.glDisable(3553); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + worldrenderer.pos(this.pickerX, this.pickerY2, 0.0); + worldrenderer.pos(this.pickerX2, this.pickerY2, 0.0); + worldrenderer.pos(this.pickerX2, this.pickerY, 0.0); + worldrenderer.pos(this.pickerX, this.pickerY, 0.0); + tessellator.draw(); + int[] arrn = null; + int n3 = 0; + while ((float) n3 < this.pickerXDiff) { + int n4 = 0; + while ((float) n4 < this.pickerYDiff) { + float f2 = (float) n3 / this.pickerXDiff; + float f3 = 1.0f - (float) n4 / this.pickerYDiff; + int n5 = (int) this.llIlIIIlIIIIlIlllIlIIIIll << 24 | Color.HSBtoRGB(this.IIIlllIIIllIllIlIIIIIIlII, f2, f3); + boolean bl3 = (float) mouseX >= (this.pickerX + (float) n3) * this.scale && (float) mouseX <= (this.pickerX + (float) n3 + 1.0f) * this.scale; + boolean bl4 = (float) mouseY <= (this.pickerY + (float) n4 + 1.0f + (float) this.yOffset) * this.scale && (float) mouseY > (this.pickerY + (float) n4 + (float) this.yOffset) * this.scale; + boolean bl5 = bl3 && bl4; + boolean bl6 = n3 == 0 && (float) mouseX < this.pickerX * this.scale && bl4; + boolean bl7 = n4 == 0 && (float) mouseY < (this.pickerY + (float) this.yOffset) * this.scale && bl3; + boolean bl8 = (float) n3 == this.pickerXDiff - 1.0f && (float) mouseX > (this.pickerX + this.pickerXDiff) * this.scale && bl4; + boolean bl2 = (float) n4 == this.pickerYDiff - 1.0f && (float) mouseY > (this.pickerY + this.pickerYDiff + (float) this.yOffset) * this.scale && bl3; + if (this.IlllIllIlIIIIlIIlIIllIIIl && (bl5 || bl6 || bl7 || bl8 || bl2)) { + this.setting.setValue(n5); + this.setting.color = new int[]{n3, n4}; + } + if (this.setting.color != null) { + arrn = this.setting.color; + } else if (n5 == (Integer) this.setting.getValue()) { + arrn = new int[]{n3, n4}; + } + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + GL11.glColor4f((float) (n5 >> 16 & 0xFF) / (float) 255, (float) (n5 >> 8 & 0xFF) / (float) 255, (float) (n5 & 0xFF) / (float) 255, 1.0f); + worldrenderer.pos(this.pickerX + (float) n3, this.pickerY + (float) n4 + 1.0f, 0.0).endVertex(); + worldrenderer.pos(this.pickerX + (float) n3 + 1.0f, this.pickerY + (float) n4 + 1.0f, 0.0).endVertex(); + worldrenderer.pos(this.pickerX + (float) n3 + 1.0f, this.pickerY + (float) n4, 0.0).endVertex(); + worldrenderer.pos(this.pickerX + (float) n3, this.pickerY + (float) n4, 0.0).endVertex(); + tessellator.draw(); + ++n4; + } + ++n3; + } + if (arrn != null) { + GL11.glPushMatrix(); + GL11.glColor4f(0.0f, 0.0f, 0.0f, 3.0f * 0.25f); + RenderUtil.drawCircle(this.pickerX + (float) arrn[0] + 1.2205882f * 0.913494f, this.pickerY + (float) arrn[1] + 0.097222224f * 11.468572f, 4); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.drawCircle(this.pickerX + (float) arrn[0] + 0.24193548f * 4.608667f, this.pickerY + (float) arrn[1] + 0.23157895f * 4.8147726f, 2.7D); + GL11.glPopMatrix(); + } + Gui.drawRect(this.pickerX - (float)51, this.pickerY + 1.0f, this.pickerX - 43.0F, this.pickerY + (float)9, -16777216); + Gui.drawRect(this.pickerX - (float)50, this.pickerY + 2.0f, this.pickerX - 44.0F, this.pickerY + (float)8, this.setting.rainbow ? -13369549 : -1); + CheatBreaker.getInstance().playRegular16px.drawString("CHROMA", this.pickerX - 40.0F, this.pickerY, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + if (this.setting.rainbow) { + Gui.drawRect(this.pickerX - (float) 51, this.pickerY + 10.0f, this.pickerX - (float) 43, this.pickerY + (float) 18, -16777216); + Gui.drawRect(this.pickerX - (float) 50, this.pickerY + 11.0f, this.pickerX - (float) 44, this.pickerY + (float) 17, this.setting.speed ? -13369549 : -1); + CheatBreaker.getInstance().playRegular16px.drawString("FAST", this.pickerX - (float)40, this.pickerY + 10, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + } + this.drawHueSlider(mouseX, mouseY); + this.drawOpacitySlider(mouseX, mouseY); + this.lIIlIIllIIIIIlIllIIIIllII = (int) (this.pickerX + this.pickerXDiff + (float) 64); + this.lIIlllIIlIlllllllllIIIIIl = (int) this.pickerY; + this.drawInstantColorSelectionBoxes(CheatBreaker.getInstance().getGlobalSettings().recentColors, this.lIIlIIllIIIIIlIllIIIIllII, this.lIIlllIIlIlllllllllIIIIIl, mouseX, mouseY, (int) partialTicks); + this.lIllIllIlIIllIllIlIlIIlIl = (int) (this.pickerX + this.pickerXDiff + (float) 94); + this.llIlIIIllIIIIlllIlIIIIIlI = (int) this.pickerY; + this.drawInstantColorSelectionBoxes(CheatBreaker.getInstance().getGlobalSettings().favouriteColors, this.lIllIllIlIIllIllIlIlIIlIl, this.llIlIIIllIIIIlllIlIIIIIlI, mouseX, mouseY, (int) partialTicks); + this.drawInstantColorSelectionBoxes(this.colors, (int) (this.pickerX + this.pickerXDiff + (float) 34), (int) this.pickerY, mouseX, mouseY, (int) partialTicks); + } + } + + private void addRecentColor() { + if (CheatBreaker.getInstance().getGlobalSettings().recentColors.size() >= 16) { + CheatBreaker.getInstance().getGlobalSettings().recentColors.remove(0); + } + CheatBreaker.getInstance().getGlobalSettings().recentColors.add(new ColorPickerColorElement(this.scale, (Integer) this.setting.getValue(), 1.0f)); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + + private void drawOpacitySlider(int n, int n2) { + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)18, this.pickerY - 1.0f, this.pickerX + this.pickerXDiff + 28.0F, this.pickerY + 1.0f + this.pickerYDiff, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5); + this.drawOpacityCheckerboard(); + int n3 = 0; + while ((float) n3 < this.pickerYDiff) { + int n4 = (Integer) this.setting.getValue(); + int n5 = new Color(n4 >> 16 & 0xFF, n4 >> 8 & 0xFF, n4 & 0xFF, Math.round(255.0F - (float) n3 / this.pickerYDiff * 255.0F)).getRGB(); + if (this.llIIlllIIIIlllIllIlIlllIl && (float) n2 >= ((float) this.yOffset + this.pickerY + (float) n3) * this.scale && (float) n2 <= ((float) this.yOffset + this.pickerY + (float) n3 + 1.0f) * this.scale) { + this.llIlIIIlIIIIlIlllIlIIIIll = (float) n3 / this.pickerYDiff; + this.setting.setValue(n5); + } + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)19, this.pickerY + (float)n3, this.pickerX + this.pickerXDiff + (float)27, this.pickerY + (float)n3 + 1.0f, n5); + ++n3; + } + float f = (float) -1 + this.pickerYDiff * this.llIlIIIlIIIIlIlllIlIIIIll; + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)18, this.pickerY + f, this.pickerX + this.pickerXDiff + (float)28, this.pickerY + f + (float)3, -822083584); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)18, this.pickerY + f + 1.0f, this.pickerX + this.pickerXDiff + (float)28, this.pickerY + f + 2.0f, -805306369); + } + + private void drawHueSlider(int x, int y) { + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)4, this.pickerY - 1.0f, this.pickerX + this.pickerXDiff + (float)14, this.pickerY + 1.0f + this.pickerYDiff, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5); + int n3 = 0; + while ((float) n3 < this.pickerYDiff) { + int n4; + if (this.IlIlllIIIIllIllllIllIIlIl && (float) y >= ((float) this.yOffset + this.pickerY + (float) n3) * this.scale && (float) y <= ((float) this.yOffset + this.pickerY + (float) n3 + 1.0f) * this.scale) { + n4 = (Integer) this.setting.getValue(); + float[] arrf = Color.RGBtoHSB(n4 >> 16 & 0xFF, n4 >> 8 & 0xFF, n4 & 0xFF, null); + this.setting.setValue(Color.HSBtoRGB(this.IIIlllIIIllIllIlIIIIIIlII, arrf[1], arrf[2])); + this.IIIlllIIIllIllIlIIIIIIlII = (float) n3 / this.pickerYDiff; + } + n4 = Color.HSBtoRGB((float) n3 / this.pickerYDiff, 1.0f, 1.0f); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)5, this.pickerY + (float)n3, this.pickerX + this.pickerXDiff + (float)13, this.pickerY + (float)n3 + 1.0f, n4); + ++n3; + } + float f = (float)-1 + this.pickerYDiff * this.IIIlllIIIllIllIlIIIIIIlII; + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)4, this.pickerY + f, this.pickerX + this.pickerXDiff + (float)14, this.pickerY + f + (float)3, -822083584); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)4, this.pickerY + f + 1.0f, this.pickerX + this.pickerXDiff + (float)14, this.pickerY + f + 2.0f, -805306369); + } + + private void drawOpacityCheckerboard() { + boolean bl = true; + int n = 2; + while ((float) n < this.pickerYDiff - (float) 4) { + if (!bl) { + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)19, this.pickerY + (float)n, this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n + (float)4, -1); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n + (float)4, this.pickerX + this.pickerXDiff + (float)27, this.pickerY + (float)n + (float)8, -1); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n, this.pickerX + this.pickerXDiff + (float)27, this.pickerY + (float)n + (float)4, 0xFF909090); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)19, this.pickerY + (float)n + (float)4, this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n + (float)8, -7303024); + } + bl = !bl; + n += 4; + } + } + + private void drawInstantColorSelectionBoxes(List list, int n, int n2, int n3, int n4, int n5) { + int n6 = 0; + int n7 = 0; + int n8 = 8; + for (ColorPickerColorElement colorPickerColorElementObj : list) { + colorPickerColorElementObj.scale = this.scale; + if (n6 == n8) { + ++n7; + n6 = 0; + } + if (list == this.colors) { + int n9 = n8 * 2 / 8 * 12; + int var12_12 = n + n9 - n7 * 12 - 12; + int var13_13 = n2 + n6 * n9 - n6 * 12; + colorPickerColorElementObj.yOffset = this.yOffset; + colorPickerColorElementObj.setDimensions(var12_12, var13_13, 10, 10); + String string = "0123456789abcdefklmnor"; + int n10 = n6 + n7 * n8; + String string2 = string.substring(n10, n10 + 1); + if (colorPickerColorElementObj.isMouseInside(n3, n4)) { + Gui.drawRect(var12_12 + 12, var13_13 - 1, var12_12 + 26, var13_13 + 11, -1087492562); + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow("&" + string2, var12_12 + 14, var13_13, -1); + } + } else { + int var12_12 = n + n7 * 12; + int var13_13 = n2 + n6 * 12; + colorPickerColorElementObj.yOffset = this.yOffset; + colorPickerColorElementObj.setDimensions(var12_12, var13_13, 10, 10); + } + colorPickerColorElementObj.handleDrawElement(n3, n4, (float) n5); + ++n6; + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(List list, int n, int n2, int n3, int n4) { + int n5 = 0; + int n6 = 0; + int n7 = 8; + for (ColorPickerColorElement colorPickerColorElementObj : list) { + int n8; + if (list != this.colors) { + if (n5 == n7) { + ++n6; + n5 = 0; + } + int n9 = n + n6 * 12; + n8 = n2 + n5 * 12; + colorPickerColorElementObj.yOffset = this.yOffset; + colorPickerColorElementObj.setDimensions(n9, n8, 10, 10); + } + if (colorPickerColorElementObj.isMouseInside(n3, n4)) { + if (list == this.colors) { + this.setting.setValue(new Color(colorPickerColorElementObj.color).getRGB()); + } else { + this.setting.setValue(new Color(colorPickerColorElementObj.color, true).getRGB()); + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + float[] arrf = Color.RGBtoHSB(colorPickerColorElementObj.color >> 16 & 0xFF, colorPickerColorElementObj.color >> 8 & 0xFF, colorPickerColorElementObj.color & 0xFF, null); + this.IIIlllIIIllIllIlIIIIIIlII = arrf[0]; + n8 = (int) (arrf[1] * this.pickerXDiff); + int n10 = (int) (this.pickerYDiff - arrf[2] * this.pickerYDiff); + this.setting.color = new int[]{n8, n10}; + } + ++n5; + } + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl2 = (float) mouseX > (float) (this.x + this.width - 40) * this.scale && (float) mouseX < (float) (this.x + this.width - 12) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 18 + this.yOffset) * this.scale; + boolean bl = (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + this.width - 40) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 18 + this.yOffset) * this.scale; + if (bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + float[] arrf = Color.RGBtoHSB((Integer) this.setting.getValue() >> 16 & 0xFF, (Integer) this.setting.getValue() >> 8 & 0xFF, (Integer) this.setting.getValue() & 0xFF, null); + this.IIIlllIIIllIllIlIIIIIIlII = arrf[0]; + int n4 = (int) (arrf[1] * this.pickerXDiff); + int n5 = (int) (this.pickerYDiff - arrf[2] * this.pickerYDiff); + this.setting.color = new int[]{n4, n5}; + this.expanded = !this.expanded; + } else if (bl2) { + if (CheatBreaker.getInstance().getGlobalSettings().isFavouriteColor((Integer) this.setting.getValue())) { + CheatBreaker.getInstance().getGlobalSettings().removeFavouriteColor((Integer) this.setting.getValue()); + } else { + if (CheatBreaker.getInstance().getGlobalSettings().favouriteColors.size() >= 16) { + CheatBreaker.getInstance().getGlobalSettings().favouriteColors.remove(0); + } + CheatBreaker.getInstance().getGlobalSettings().favouriteColors.add(new ColorPickerColorElement(this.scale, (Integer) this.setting.getValue(), 1.0f)); + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (this.expanded) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.colors, 0, 0, mouseX, mouseY); + this.lIIIIlIIllIIlIIlIIIlIIllI(CheatBreaker.getInstance().getGlobalSettings().recentColors, this.lIIlIIllIIIIIlIllIIIIllII, this.lIIlllIIlIlllllllllIIIIIl, mouseX, mouseY); + this.lIIIIlIIllIIlIIlIIIlIIllI(CheatBreaker.getInstance().getGlobalSettings().favouriteColors, this.lIllIllIlIIllIllIlIlIIlIl, this.llIlIIIllIIIIlllIlIIIIIlI, mouseX, mouseY); + boolean bl4 = (float) mouseX > (this.pickerX - (float) 51) * this.scale && (float) mouseY > (this.pickerY + 1.0f + (float) this.yOffset) * this.scale && (float) mouseX < (this.pickerX - (float) 43) * this.scale && (float) mouseY < (this.pickerY + (float) 9 + (float) this.yOffset) * this.scale; + boolean bl5 = (float) mouseX > (this.pickerX - (float) 51) * this.scale && (float) mouseY > (this.pickerY + 10.0f + (float) this.yOffset) * this.scale && (float) mouseX < (this.pickerX - (float) 43) * this.scale && (float) mouseY < (this.pickerY + (float) 19 + (float) this.yOffset) * this.scale; + if ((float) mouseX > this.pickerX * this.scale && (float) mouseX < (this.pickerX + this.pickerXDiff) * this.scale && (float) mouseY > (this.pickerY + (float) this.yOffset) * this.scale && (float) mouseY < (this.pickerY + this.pickerYDiff + (float) this.yOffset) * this.scale) { + this.IlllIllIlIIIIlIIlIIllIIIl = true; + } + if ((float) mouseX > (this.pickerX + this.pickerXDiff + (float) 4) * this.scale && (float) mouseX < (this.pickerX + this.pickerXDiff + (float) 14) * this.scale && (float) mouseY > (this.pickerY - 1.0f + (float) this.yOffset) * this.scale && (float) mouseY < (this.pickerY + 1.0f + this.pickerYDiff + (float) this.yOffset) * this.scale) { + this.IlIlllIIIIllIllllIllIIlIl = true; + } + if ((float) mouseX > (this.pickerX + this.pickerXDiff + (float) 18) * this.scale && (float) mouseX < (this.pickerX + this.pickerXDiff + (float) 28) * this.scale && (float) mouseY > (this.pickerY - 1.0f + (float) this.yOffset) * this.scale && (float) mouseY < (this.pickerY + 1.0f + this.pickerYDiff + (float) this.yOffset) * this.scale) { + this.llIIlllIIIIlllIllIlIlllIl = true; + } + if (bl4) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.setting.rainbow = !this.setting.rainbow; + } + if (bl5) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.setting.speed = !this.setting.speed; + } + } + if (this.setting == CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredStringColor) { + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorSliderElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorSliderElement.java new file mode 100644 index 0000000..66a0d48 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ColorSliderElement.java @@ -0,0 +1,100 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +/** + * This shouldn't be called Old Slider element for a few reasons: + * This is merely a color rainbow slider - probably used for testing + * This only allowed floats. + */ +public class ColorSliderElement extends AbstractModulesGuiElement { + private final Setting lIIIIlIIllIIlIIlIIIlIIllI; + private float IllIIIIIIIlIlIllllIIllIII = -1; + private float lIIIIllIIlIlIllIIIlIllIlI; + private boolean IlllIllIlIIIIlIIlIIllIIIl = false; + + public ColorSliderElement(Setting setting, float f) { + super(f); + this.lIIIIlIIllIIlIIlIIIlIIllI = setting; + this.height = 14; + this.IllIIIIIIIlIlIllllIIllIII = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + int n4 = 170; + boolean bl = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + n4 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 10 + this.yOffset) * this.scale; + if (button == 0 && bl) { + this.IlllIllIlIIIIlIIlIIllIIIl = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + float f3; + int n3 = 148; + float f4 = n3 - 18; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.lIIIIlIIllIIlIIlIIIlIIllI.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + 2), -1895825408); + if (this.IlllIllIlIIIIlIIlIIllIIIl && !Mouse.isButtonDown(0)) { + this.IlllIllIlIIIIlIIlIIllIIIl = false; + } + Gui.drawRect((float) this.x + 0.13043478f * 1376.1666f, (float) this.y + 2.2962964f * 2.3951612f, (float) this.x + 0.28169015f * 640.77496f + f4, (float) this.y + 1.4333333f * 5.930233f, -822083584); + int n4 = 0; + while ((float) n4 < f4) { + int n5 = Color.HSBtoRGB((float) n4 / f4, 1.0f, 1.0f); + Gui.drawRect(this.x + 180 + n4, this.y + 6, this.x + 181 + n4, this.y + 8, n5); + ++n4; + } + float f5 = Float.parseFloat("" + this.lIIIIlIIllIIlIIlIIIlIIllI.getMinimumValue()); + float f6 = Float.parseFloat("" + this.lIIIIlIIllIIlIIlIIIlIIllI.getMaximumValue()); + if (this.IlllIllIlIIIIlIIlIIllIIIl) { + this.lIIIIllIIlIlIllIIIlIllIlI = (float) ((double) (f5 + ((float) mouseX - (float) (this.x + 180) * this.scale) * ((f6 - f5) / (f4 * this.scale))) * (double) 100) / (float) 100; + if (this.lIIIIlIIllIIlIIlIIIlIIllI.getType().equals(SettingType.INTEGER)) { + this.lIIIIllIIlIlIllIIIlIllIlI = Math.round(this.lIIIIllIIlIlIllIIIlIllIlI); + } + if (this.lIIIIllIIlIlIllIIIlIllIlI < f5) { + this.lIIIIllIIlIlIllIIIlIllIlI = f5; + } else if (this.lIIIIllIIlIlIllIIIlIllIlI > f6) { + this.lIIIIllIIlIlIllIIIlIllIlI = f6; + } + switch (this.lIIIIlIIllIIlIIlIIIlIIllI.getType()) { + case INTEGER: + this.lIIIIlIIllIIlIIlIIIlIIllI.setValue(Integer.parseInt((int) this.lIIIIllIIlIlIllIIIlIllIlI + "")); + break; + case FLOAT: + this.lIIIIlIIllIIlIIlIIIlIIllI.setValue(Float.valueOf(this.lIIIIllIIlIlIllIIIlIllIlI)); + break; + case DOUBLE: + this.lIIIIlIIllIIlIIlIIIlIIllI.setValue(Double.parseDouble(this.lIIIIllIIlIlIllIIIlIllIlI + "")); + } + } + f3 = (f3 = Float.parseFloat(this.lIIIIlIIllIIlIIlIIIlIIllI.getValue() + "")) < this.IllIIIIIIIlIlIllllIIllIII ? this.IllIIIIIIIlIlIllllIIllIII - f3 : (f3 -= this.IllIIIIIIIlIlIllllIIllIII); + float f7 = ((f6 - f5) / (float) 20 + f3 * (float) 8) / (float) (Minecraft.debugFPS + 1); + if ((double) f7 < (double) 0.1590909f * 6.285714392759364E-4) { + f7 = 3.163265E-5f * 3.1612904f; + } + if (this.IllIIIIIIIlIlIllllIIllIII < (f2 = Float.parseFloat(this.lIIIIlIIllIIlIIlIIIlIIllI.getValue() + ""))) { + this.IllIIIIIIIlIlIllllIIllIII = this.IllIIIIIIIlIlIllllIIllIII + f7 <= f2 ? (this.IllIIIIIIIlIlIllllIIllIII += f7) : f2; + } else if (this.IllIIIIIIIlIlIllllIIllIII > f2) { + this.IllIIIIIIIlIlIllllIIllIII = this.IllIIIIIIIlIlIllllIIllIII - f7 >= f2 ? (this.IllIIIIIIIlIlIllllIIllIII -= f7) : f2; + } + double d = (float) 100 * ((this.IllIIIIIIIlIlIllllIIllIII - f5) / (f6 - f5)); + GL11.glColor4f(0.38f * 0.65789473f, 0.4318182f * 1.0421052f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 0.90217394f * 200.90361f) + (double) f4 * d / (double) 100, (float) this.y + 1.5890411f * 4.5625f, 6.333333492279053 * 0.7105262979576137); + float f8 = (Float) this.lIIIIlIIllIIlIIlIIIlIIllI.getValue(); + int n6 = f8 == 0.0f ? -1 : Color.HSBtoRGB(f8, 1.0f, 1.0f); + GL11.glColor4f((float) (n6 >> 16 & 0xFF) / (float) 255, (float) (n6 >> 8 & 0xFF) / (float) 255, (float) (n6 & 0xFF) / (float) 255, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 1.5f * 120.833336f) + (double) f4 * d / 100.0, (float) this.y + 0.2962963f * 24.46875f, 11.137499864771966 * 0.24242424964904785); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ElementListElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ElementListElement.java new file mode 100644 index 0000000..cae1402 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ElementListElement.java @@ -0,0 +1,66 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; + +import java.util.ArrayList; +import java.util.List; + +public class ElementListElement extends AbstractElement { + protected final List elements = new ArrayList(); + + public ElementListElement(List list) { + this.elements.addAll(list); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + for (AbstractElement abstractElement : this.elements) { + abstractElement.drawElementHover(f, f2, bl); + } + } + + @Override + public void handleElementClose() { + this.elements.forEach(AbstractElement::handleElementClose); + } + + @Override + public void handleElementUpdate() { + this.elements.forEach(AbstractElement::handleElementUpdate); + } + + @Override + public void keyTyped(char c, int n) { + this.elements.forEach(abstractElement -> abstractElement.keyTyped(c, n)); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + boolean bl2 = false; + for (AbstractElement abstractElement : this.elements) { + if (bl2) break; + bl2 = abstractElement.handleElementMouseClicked(f, f2, n, bl); + } + return bl2; + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + boolean bl2 = false; + for (AbstractElement abstractElement : this.elements) { + if (bl2) break; + bl2 = abstractElement.onMouseMoved(f, f2, n, bl); + } + return bl2; + } + + public List getElements() { + return this.elements; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/FlatButtonElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/FlatButtonElement.java new file mode 100644 index 0000000..f5f2c4d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/FlatButtonElement.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import net.minecraft.client.gui.Gui; + +public class FlatButtonElement extends AbstractElement { + private String string; + + public FlatButtonElement(String string) { + this.string = string; + } + + @Override + public void handleElementDraw(float f, float f2, boolean hovering) { + this.drawButton(this.string, f, f2, hovering); + } + + public void drawButton(String string, float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, bl && this.isMouseInside(f, f2) ? -16747106 : -13158601); + CheatBreaker.getInstance().playRegular14px.drawCenteredString(string, this.xPosition + this.width / 2.0f, this.yPosition + this.height / 2.0f - (float) 5, -1); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } + + public String getString() { + return this.string; + } + + public void setText(String string) { + this.string = string; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/HorizontalSliderElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/HorizontalSliderElement.java new file mode 100644 index 0000000..beaa86a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/HorizontalSliderElement.java @@ -0,0 +1,72 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.fading.AbstractFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import net.minecraft.client.gui.Gui; +import org.lwjgl.input.Mouse; + +public class HorizontalSliderElement extends AbstractElement { + private final Setting setting; + private final AbstractFade fadeTime; + private Number value; + + public HorizontalSliderElement(Setting setting) { + this.setting = setting; + this.fadeTime = new MinMaxFade(300L); + this.value = (Number) setting.getValue(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + if (!this.fadeTime.isTimeNotAtZero()) { + this.value = (Number) this.setting.getValue(); + } + float f3 = ((Number) this.setting.getValue()).floatValue(); + float f4 = ((Number) this.setting.getMinimumValue()).floatValue(); + float f5 = ((Number) this.setting.getMaximumValue()).floatValue(); + float f6 = f3 - this.value.floatValue(); + float f7 = (float) 100 * ((this.value.floatValue() + f6 * this.fadeTime.getFadeAmount() - f4) / (f5 - f4)); + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width / (float) 100 * f7, this.yPosition + this.height, -52429); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + if (Mouse.isButtonDown(0) && this.isMouseInside(f, f2)) { + this.fadeTime.startAnimation(); + this.value = (Number) this.setting.getValue(); + float f3 = ((Number) this.setting.getMinimumValue()).floatValue(); + float f4 = ((Number) this.setting.getMaximumValue()).floatValue(); + if (f - this.xPosition > this.width / 2.0f) { + f += 2.0f; + } + float f5 = f3 + (f - this.xPosition) * ((f4 - f3) / this.width); + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(this.setValue(Integer.parseInt((int) f5 + ""))); + break; + case FLOAT: + this.setting.setValue(this.setValue(f5)); + break; + case DOUBLE: + this.setting.setValue(this.setValue(Double.parseDouble((double) f5 + ""))); + break; + } + } + return super.handleElementMouseClicked(f, f2, n, bl); + } + + private Object setValue(Object object) { + try { + return object; + } catch (ClassCastException classCastException) { + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ImageButtonElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ImageButtonElement.java new file mode 100644 index 0000000..a30276a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ImageButtonElement.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.ui.element.type; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ImageButtonElement extends GuiButton { + private boolean lIIIIlIIllIIlIIlIIIlIIllI = true; + private ResourceLocation image; + + public ImageButtonElement(int n, ResourceLocation image, int n2, int n3, int n4, int n5, String string, boolean bl) { + this(n, n2, n3, n4, n5, string); + this.lIIIIlIIllIIlIIlIIIlIIllI = bl; + this.image = image; + } + + public ImageButtonElement(int n, int n2, int n3, int n4, int n5, String string) { + super(n, n2, n3, n4, n5, string); + } + + @Override + public void drawButton(Minecraft mc, int n, int n2) { + if (this.visible) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.hovered = n >= this.xPosition && n2 >= this.yPosition && n < this.xPosition + this.width && n2 < this.yPosition + this.height; + int n3 = this.getHoverState(this.hovered); + if (this.lIIIIlIIllIIlIIlIIIlIIllI) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.hovered ? -15395563 : -14540254); + } + this.mouseDragged(mc, n, n2); + int n4 = -3092272; + if (!this.enabled) { + n4 = -986896; + } else if (this.hovered) { + n4 = -1; + } + CheatBreaker.getInstance().playRegular16px.drawCenteredString(this.displayString, this.xPosition + this.width / 2F, this.yPosition + this.height / 2F - (this.lIIIIlIIllIIlIIlIIIlIIllI ? 6 : 5), n4); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0363636f * 0.2894737f); + RenderUtil.renderIcon(this.image, 7.0F, (float) (this.xPosition + this.width - 20), (float) (this.yPosition + 5)); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/InputFieldElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/InputFieldElement.java new file mode 100644 index 0000000..a2ca314 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/InputFieldElement.java @@ -0,0 +1,484 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.ChatAllowedCharacters; +import org.lwjgl.opengl.GL11; + +public class InputFieldElement extends AbstractElement { + private final CBFontRenderer font; + private String text = ""; + private int maxStringLength = 32; + private int cursorCounter; + private boolean enableBackgroundDrawing = true; + private boolean canLoseFocus = true; + private boolean isFocused; + private boolean isEnabled = true; + private int lineScrollOffset; + private int cursorPosition; + private int selectionEnd; + private int enabledColor = 0xE0E0E0; + private int disabledColor = 0x707070; + private boolean visible = true; + private final int color1; + private final int color2; + private final String label; + + public InputFieldElement(CBFontRenderer font, String label, int color1, int color2) { + this.font = font; + this.label = label; + this.color1 = color1; + this.color2 = color2; + } + + public void updateCursorCounter() { + ++this.cursorCounter; + } + + public void setText(String string) { + this.text = string.length() > this.maxStringLength ? string.substring(0, this.maxStringLength) : string; + this.setCursorPositionEnd(); + } + + public String getText() { + return this.text; + } + + public String getSelectedText() { + int n = Math.min(this.cursorPosition, this.selectionEnd); + int n2 = Math.max(this.cursorPosition, this.selectionEnd); + return this.text.substring(n, n2); + } + + public void writeText(String string) { + int n; + String string2 = ""; + String string3 = ChatAllowedCharacters.filterAllowedCharacters(string); + int n2 = Math.min(this.cursorPosition, this.selectionEnd); + int n3 = Math.max(this.cursorPosition, this.selectionEnd); + int n4 = this.maxStringLength - this.text.length() - (n2 - this.selectionEnd); + boolean bl = false; + if (this.text.length() > 0) { + string2 = string2 + this.text.substring(0, n2); + } + if (n4 < string3.length()) { + string2 = string2 + string3.substring(0, n4); + n = n4; + } else { + string2 = string2 + string3; + n = string3.length(); + } + if (this.text.length() > 0 && n3 < this.text.length()) { + string2 = string2 + this.text.substring(n3); + } + this.text = string2; + this.moveCursorBy(n2 - this.selectionEnd + n); + } + + public void deleteWords(int n) { + if (this.text.length() != 0) { + if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { + this.deleteFromCursor(this.getNthWordFromCursor(n) - this.cursorPosition); + } + } + } + + public void deleteFromCursor(int n) { + if (this.text.length() != 0) { + if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { + boolean bl = n < 0; + int n2 = bl ? this.cursorPosition + n : this.cursorPosition; + int n3 = bl ? this.cursorPosition : this.cursorPosition + n; + String string = ""; + if (n2 >= 0) { + string = this.text.substring(0, n2); + } + if (n3 < this.text.length()) { + string = string + this.text.substring(n3); + } + this.text = string; + if (bl) { + this.moveCursorBy(n); + } + } + } + } + + public int getNthWordFromCursor(int n) { + return this.getNthWordFromPos(n, this.getCursorPosition()); + } + + public int getNthWordFromPos(int n, int n2) { + return this.func_146197_a(n, this.getCursorPosition(), true); + } + + public int func_146197_a(int n, int n2, boolean bl) { + int n3 = n2; + boolean bl2 = n < 0; + int n4 = Math.abs(n); + for (int i = 0; i < n4; ++i) { + if (bl2) { + while (bl && n3 > 0 && this.text.charAt(n3 - 1) == ' ') { + --n3; + } + while (n3 > 0 && this.text.charAt(n3 - 1) != ' ') { + --n3; + } + continue; + } + int n5 = this.text.length(); + if ((n3 = this.text.indexOf(32, n3)) == -1) { + n3 = n5; + continue; + } + while (bl && n3 < n5 && this.text.charAt(n3) == ' ') { + ++n3; + } + } + return n3; + } + + public void moveCursorBy(int n) { + this.setCursorPosition(this.selectionEnd + n); + } + + public void setCursorPosition(int n) { + this.cursorPosition = n; + int n2 = this.text.length(); + if (this.cursorPosition < 0) { + this.cursorPosition = 0; + } + if (this.cursorPosition > n2) { + this.cursorPosition = n2; + } + this.setSelectionPos(this.cursorPosition); + } + + public void setCursorPositionZero() { + this.setCursorPosition(0); + } + + public void setCursorPositionEnd() { + this.setCursorPosition(this.text.length()); + } + + public boolean textboxKeyTyped(char c, int n) { + if (!this.isFocused) { + return false; + } + switch (c) { + case '\u0001': + this.setCursorPositionEnd(); + this.setSelectionPos(0); + return true; + case '\u0003': + GuiScreen.setClipboardString(this.getSelectedText()); + return true; + case '\u0016': + if (this.isEnabled) { + this.writeText(GuiScreen.getClipboardString()); + } + return true; + case '\u0018': + GuiScreen.setClipboardString(this.getSelectedText()); + if (this.isEnabled) { + this.writeText(""); + } + return true; + } + switch (n) { + case 14: + if (GuiScreen.isCtrlKeyDown()) { + if (this.isEnabled) { + this.deleteWords(-1); + } + } else if (this.isEnabled) { + this.deleteFromCursor(-1); + } + return true; + case 199: + if (GuiScreen.isShiftKeyDown()) { + this.setSelectionPos(0); + } else { + this.setCursorPositionZero(); + } + return true; + case 203: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); + } else { + this.setSelectionPos(this.getSelectionEnd() - 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.setCursorPosition(this.getNthWordFromCursor(-1)); + } else { + this.moveCursorBy(-1); + } + return true; + case 205: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); + } else { + this.setSelectionPos(this.getSelectionEnd() + 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.setCursorPosition(this.getNthWordFromCursor(1)); + } else { + this.moveCursorBy(1); + } + return true; + case 207: + if (GuiScreen.isShiftKeyDown()) { + this.setSelectionPos(this.text.length()); + } else { + this.setCursorPositionEnd(); + } + return true; + case 211: + if (GuiScreen.isCtrlKeyDown()) { + if (this.isEnabled) { + this.deleteWords(1); + } + } else if (this.isEnabled) { + this.deleteFromCursor(1); + } + return true; + } + if (ChatAllowedCharacters.isAllowedCharacter(c)) { + if (this.isEnabled) { + this.writeText(Character.toString(c)); + } + return true; + } + return false; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + boolean bl2; + if (!bl) { + this.setFocused(false); + return true; + } + if (n == 1 && this.isMouseInside(f, f2)) { + this.setText(""); + } + boolean bl3 = bl2 = f >= this.xPosition && f < this.xPosition + this.width && f2 >= this.yPosition && f2 < this.yPosition + this.height; + + if (this.canLoseFocus) { + this.setFocused(bl2); + } + if (this.isFocused && n == 0) { + float f3 = f - this.xPosition; + if (this.enableBackgroundDrawing) { + f3 -= (float) 4; + } + String string = this.font.setWrapWords(this.text.substring(this.lineScrollOffset), this.IIIIIIlIlIlIllllllIlllIlI()); + this.setCursorPosition(this.font.setWrapWords(string, f3).length() + this.lineScrollOffset); + } + return false; + } + + public void drawElement() { + if (this.getVisible()) { + if (this.getEnableBackgroundDrawing()) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.color1); + } + int n = this.isEnabled ? this.enabledColor : this.disabledColor; + int n2 = this.cursorPosition - this.lineScrollOffset; + int n3 = this.selectionEnd - this.lineScrollOffset; + String string = this.font.setWrapWords(this.text.substring(this.lineScrollOffset), this.IIIIIIlIlIlIllllllIlllIlI()); + boolean bl = n2 >= 0 && n2 <= string.length(); + boolean bl2 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && bl; + float f = this.enableBackgroundDrawing ? this.xPosition + (float) 4 : this.xPosition; + float f2 = this.enableBackgroundDrawing ? this.yPosition + (this.height - (float) 8) / 2.0f : this.yPosition; + float f3 = f; + if (n3 > string.length()) { + n3 = string.length(); + } + if (string.length() > 0) { + String string2 = bl ? string.substring(0, n2) : string; + f3 = this.font.drawString(string2, f, f2, n); + } else if (!this.isFocused()) { + this.font.drawString(this.label, f, f2, n); + } + boolean bl3 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); + float f4 = f3; + if (!bl) { + f4 = n2 > 0 ? f + this.width : f; + } else if (bl3) { + f4 = f3 - 1.0f; + f3 -= 1.0f; + } + if (string.length() > 0 && bl && n2 < string.length()) { + this.font.drawString(string.substring(n2), f3, f2, n); + } + if (bl2) { + if (bl3) { + Gui.drawRect(f4, f2 - 1.0f, f4 + 1.0f, f2 + 1.0f + (float) this.font.getHeight(), -3092272); + } else { + this.font.drawString("_", f4, f2, n); + } + } + if (n3 != n2) { + float f5 = f + (float) this.font.getStringWidth(string.substring(0, n3)); + this.drawCursorVertical(f4, f2 - 1.0f + 2.0f, f5 - 1.0f, f2 + 1.0f + (float) this.font.getHeight() + 2.0f); + } + } + } + + private void drawCursorVertical(float f, float f2, float f3, float f4) { + float f5; + if (f < f3) { + f5 = f; + f = f3; + f3 = f5; + } + if (f2 < f4) { + f5 = f2; + f2 = f4; + f4 = f5; + } + if (f3 > this.xPosition + this.width) { + f3 = this.xPosition + this.width; + } + if (f > this.xPosition + this.width) { + f = this.xPosition + this.width; + } +// Tessellator tessellator = Tessellator.getInstance(); + GL11.glColor4f(0.0f, 0.0f, 255, 255); + GL11.glDisable(3553); + GL11.glEnable(3058); + GL11.glLogicOp(5387); +// tessellator.startDrawingQuads(); +// tessellator.addVertex(f, f4, 0.0); +// tessellator.addVertex(f3, f4, 0.0); +// tessellator.addVertex(f3, f2, 0.0); +// tessellator.addVertex(f, f2, 0.0); +// tessellator.draw(); + GL11.glDisable(3058); + GL11.glEnable(3553); + } + + public void setMaxStringLength(int limit) { + this.maxStringLength = limit; + if (this.text.length() > limit) { + this.text = this.text.substring(0, limit); + } + } + + public int getMaxStringLength() { + return this.maxStringLength; + } + + public int getCursorPosition() { + return this.cursorPosition; + } + + public boolean getEnableBackgroundDrawing() { + return this.enableBackgroundDrawing; + } + + public void setEnableBackgroundDrawing(boolean bl) { + this.enableBackgroundDrawing = bl; + } + + public void setTextColor(int color) { + this.enabledColor = color; + } + + public void setDisabledTextColour(int color) { + this.disabledColor = color; + } + + public void setFocused(boolean bl) { + if (bl && !this.isFocused) { + this.cursorCounter = 0; + } + this.isFocused = bl; + } + + public boolean isFocused() { + return this.isFocused; + } + + public void setEnabled(boolean bl) { + this.isEnabled = bl; + } + + public int getSelectionEnd() { + return this.selectionEnd; + } + + public float IIIIIIlIlIlIllllllIlllIlI() { + return this.getEnableBackgroundDrawing() ? this.width - (float) 8 : this.width; + } + + public void setSelectionPos(int n) { + int n2 = this.text.length(); + if (n > n2) { + n = n2; + } + if (n < 0) { + n = 0; + } + this.selectionEnd = n; + if (this.font != null) { + if (this.lineScrollOffset > n2) { + this.lineScrollOffset = n2; + } + float f = this.IIIIIIlIlIlIllllllIlllIlI(); + String string = this.font.setWrapWords(this.text.substring(this.lineScrollOffset), f); + int n3 = string.length() + this.lineScrollOffset; + if (n == this.lineScrollOffset) { + this.lineScrollOffset -= this.font.wrapWords(this.text, f, true).length(); + } + if (n > n3) { + this.lineScrollOffset += n - n3; + } else if (n <= this.lineScrollOffset) { + this.lineScrollOffset -= this.lineScrollOffset - n; + } + if (this.lineScrollOffset < 0) { + this.lineScrollOffset = 0; + } + if (this.lineScrollOffset > n2) { + this.lineScrollOffset = n2; + } + } + } + + public void setCanLoseFocus(boolean bl) { + this.canLoseFocus = bl; + } + + public boolean getVisible() { + return this.visible; + } + + public void setVisible(boolean bl) { + this.visible = bl; + } + + @Override + public void handleElementUpdate() { + this.updateCursorCounter(); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + this.drawElement(); + } + + @Override + public void keyTyped(char c, int n) { + this.textboxKeyTyped(c, n); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/LabelElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/LabelElement.java new file mode 100644 index 0000000..32c9a83 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/LabelElement.java @@ -0,0 +1,27 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import net.minecraft.client.gui.Gui; + +public class LabelElement extends AbstractModulesGuiElement { + + public LabelElement(Setting label, float scaleFactor) { + super(scaleFactor); + this.setting = label; + this.height = 12; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(((String)this.setting.getValue()).toUpperCase(), this.x + 2, (float)(this.y + 2), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + Gui.drawRect(this.x + 2, this.y + this.height - 1, this.x + this.width / 2 - 20, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor3 : CBTheme.lightDullTextColor3); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ScrollableElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ScrollableElement.java new file mode 100644 index 0000000..2a68e51 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ScrollableElement.java @@ -0,0 +1,244 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import net.minecraft.client.gui.Gui; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + + +public class ScrollableElement extends AbstractElement { + protected final AbstractElement abstractElement; + protected double IllIIIIIIIlIlIllllIIllIII; + protected float position; + protected float scrollAmount; + protected boolean hovering; + protected boolean llIIlllIIIIlllIllIlIlllIl; + protected float lIIlIlIllIIlIIIlIIIlllIII; + private float IIIlllIIIllIllIlIIIIIIlII; + private boolean buttonHeld; + + public ScrollableElement(AbstractElement var1) { + this.abstractElement = var1; + } + + public boolean isMouseInside(float var1, float var2) { + return var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition && var2 < this.yPosition + this.height; + } + + public void handleElementDraw(float var1, float var2, boolean var3) { + this.llIIlllIIIIlllIllIlIlllIl = true; + GL11.glPopMatrix(); + boolean var4 = this.isAtBottom(); + if (this.hovering && (!Mouse.isButtonDown(0) || !this.isMouseInside(var1, var2) || !var3)) { + this.hovering = false; + } + + if (this.buttonHeld && !Mouse.isButtonDown(0)) { + this.buttonHeld = false; + } + + float var5 = this.height; + float var6 = this.scrollAmount; + float var7 = var5 / var6 * (float) 100; + float var8 = var5 / (float) 100 * var7; + float var9 = this.position / (float) 100 * var7; + float var10; + if (Mouse.isButtonDown(0) && this.buttonHeld) { + var10 = var2 - this.yPosition; + float var11 = var10 / this.height; + this.position = -(this.scrollAmount * var11) + var8 / 2.0F; + } + + if (var4) { + var10 = this.height; + boolean var13 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition - var9 && var2 < this.yPosition + var8 - var9; + boolean var12 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition && var2 < this.yPosition + var5 - (float) 3; + if (Mouse.isButtonDown(0) && !this.hovering && var12) { + } + + if (this.hovering) { + if (this.position != this.lIIlIlIllIIlIIIlIIIlllIII && this.lIIlIlIllIIlIIIlIIIlllIII != var8 / 2.0F && this.lIIlIlIllIIlIIIlIIIlllIII != var8 / 2.0F + -this.scrollAmount + var10) { + if (var2 > this.yPosition + var8 - var8 / (float) 4 - var9) { + this.position -= var6 / (float) 7; + } else if (var2 < this.yPosition + var8 / (float) 4 - var9) { + this.position += var6 / (float) 7; + } + + this.lIIlIlIllIIlIIIlIIIlllIII = this.position; + } else if (var2 > this.yPosition + var8 - var8 / (float) 4 - var9 || var2 < this.yPosition + var8 / (float) 4 - var9) { + this.lIIlIlIllIIlIIIlIIIlllIII = 1.0F; + } + } + + if (this.position < -this.scrollAmount + var10) { + this.position = -this.scrollAmount + var10; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + if (this.position > 0.0F) { + this.position = 0.0F; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + Gui.drawRect(this.xPosition, this.yPosition - var9, this.xPosition + this.width, this.yPosition + var8 - var9, !var13 && !this.hovering ? -4180940 : -52429); + } + + if (!var4 && this.position != 0.0F) { + this.position = 0.0F; + } + + } + + public void drawScrollable(float var1, float var2, boolean var3) { + if (var3 && (this.abstractElement == null || this.abstractElement.isMouseInside(var1, var2)) && this.IllIIIIIIIlIlIllllIIllIII != 0.0D) { + this.position = (float) ((double) this.position + this.IllIIIIIIIlIlIllllIIllIII / (double) 8); + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + if (this.llIIlllIIIIlllIllIlIlllIl) { + if (this.position < -this.scrollAmount + this.height) { + this.position = -this.scrollAmount + this.height; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + if (this.position > 0.0F) { + this.position = 0.0F; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, this.position, 0.0F); + } + + // Naming is temporary. This is checking for a specific issue. + public void drawElementHoverNotOverride(float var1, float var2, boolean var3) { + this.llIIlllIIIIlllIllIlIlllIl = true; + GL11.glPopMatrix(); + boolean var4 = this.isAtBottom(); + if (this.hovering && (!Mouse.isButtonDown(0) || !this.isMouseInside(var1, var2) || !var3)) { + this.hovering = false; + } + + if (this.buttonHeld && !Mouse.isButtonDown(0)) { + this.buttonHeld = false; + } + + float var5 = this.height; + float var6 = this.scrollAmount; + float var7 = var5 / var6 * (float) 100; + float var8 = var5 / (float) 100 * var7; + float var9 = this.position / (float) 100 * var7; + float var10; + if (Mouse.isButtonDown(0) && this.buttonHeld) { + var10 = var2 - this.yPosition; + float var11 = var10 / this.height; + this.position = -(this.scrollAmount - this.height / 2.0F) + this.scrollAmount * var11 + var8 / 2.0F; + } + + if (var4) { + var10 = this.height; + boolean var13 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition - var9 && var2 < this.yPosition + var8 - var9; + boolean var12 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition && var2 < this.yPosition + var5 - (float) 3; + if (Mouse.isButtonDown(0) && !this.hovering && var12) { + } + + if (this.hovering) { + if (this.position != this.lIIlIlIllIIlIIIlIIIlllIII && this.lIIlIlIllIIlIIIlIIIlllIII != var8 / 2.0F && this.lIIlIlIllIIlIIIlIIIlllIII != var8 / 2.0F + -this.scrollAmount + var10) { + if (var2 > this.yPosition + this.height - var8 - var8 / (float) 4 + var9) { + this.position = var6 / (float) 7; + } else if (var2 < this.yPosition + this.height - var8 / (float) 4 + var9) { + this.position += var6 / (float) 7; + } + + this.lIIlIlIllIIlIIIlIIIlllIII = this.position; + } else if (var2 > this.yPosition + this.height - var8 - var8 / (float) 4 + var9 || var2 < this.yPosition + this.height - var8 / (float) 4 - var9) { + this.lIIlIlIllIIlIIIlIIIlllIII = 1.0F; + } + } + + if (this.position < -this.scrollAmount + var10) { + this.position = -this.scrollAmount + var10; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + if (this.position > 0.0F) { + this.position = 0.0F; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + Gui.drawRect(this.xPosition, this.yPosition + this.height + var9, this.xPosition + this.width, this.yPosition + this.height - var8 + var9, !var13 && !this.hovering ? -4180940 : -52429); + } + + if (!var4 && this.position != 0.0F) { + this.position = 0.0F; + } + + } + + public void onScroll(float var1, float var2, boolean var3) { + if (var3 && (this.abstractElement == null || this.abstractElement.isMouseInside(var1, var2)) && this.IllIIIIIIIlIlIllllIIllIII != 0.0D) { + this.position = (float) ((double) this.position - this.IllIIIIIIIlIlIllllIIllIII / (double) 8); + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + if (this.llIIlllIIIIlllIllIlIlllIl) { + if (this.position < -this.scrollAmount + this.height) { + this.position = -this.scrollAmount + this.height; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + + if (this.position > 0.0F) { + this.position = 0.0F; + this.IllIIIIIIIlIlIllllIIllIII = 0.0D; + } + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -this.position, 0.0F); + } + + public float getPosition() { + return this.position; + } + + public boolean isAtBottom() { + return this.scrollAmount > this.height; + } + + public boolean handleElementMouseClicked(float var1, float var2, int var3, boolean var4) { + if (this.isMouseInside(var1, var2) && var4) { + this.IIIlllIIIllIllIlIIIIIIlII = var2 - this.yPosition; + this.buttonHeld = true; + } + + return false; + } + + public void handleElementMouse() { + int var1 = Mouse.getEventDWheel(); + if (var1 != 0 && this.scrollAmount >= this.height) { + this.IllIIIIIIIlIlIllllIIllIII += (float) var1 / (0.48387095F * 3.6166668F); + } + + } + + public AbstractElement getAbstractElement() { + return this.abstractElement; + } + + public void setScrollAmount(float var1) { + this.scrollAmount = var1; + } + + public boolean isHovering() { + return this.hovering; + } + + public boolean isButtonHeld() { + return this.buttonHeld; + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/SliderElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/SliderElement.java new file mode 100644 index 0000000..8eb90a4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/SliderElement.java @@ -0,0 +1,92 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +@Deprecated +public class SliderElement extends AbstractModulesGuiElement { + private final Setting setting; + private float settingValue = -1; + private float value; + private boolean interacting = false; + + public SliderElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.height = 14; + this.settingValue = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + 170 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 10 + this.yOffset) * this.scale; + if (button == 0 && bl) { + this.interacting = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + float f2; + float f3; + int n3 = 148; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + 2), -1895825408); + if (this.interacting && !Mouse.isButtonDown(0)) { + this.interacting = false; + } + String string = this.setting.getValue().toString(); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(string, this.x + 169 - (float) CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(string), (float) (this.y + 2), -1895825408); + boolean bl = (float) mouseX > (float) (this.x + 172) * this.scale && (float) mouseX < (float) (this.x + 172 + n3 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 10 + this.yOffset) * this.scale; + RenderUtil.drawRoundedRect(this.x + 174, this.y + 6, this.x + 170 + n3 - 4, this.y + 8, 1.0, bl ? -1895825408 : 0x6F000000); + double d = n3 - 18; + float minimumValue = Float.parseFloat("" + this.setting.getMinimumValue()); + float maximumValue = Float.parseFloat("" + this.setting.getMaximumValue()); + if (this.interacting) { + this.value = (float) Math.round(((double) minimumValue + (double) ((float) mouseX - (float) (this.x + 180) * this.scale) * ((double) (maximumValue - minimumValue) / (d * (double) this.scale))) * (double) 100) / (float) 100; + if (this.setting.getType().equals(SettingType.INTEGER) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + this.value = Math.round(this.value); + } + if (this.value < minimumValue) { + this.value = minimumValue; + } else if (this.value > maximumValue) { + this.value = maximumValue; + } + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(Integer.parseInt((int) this.value + "")); + break; + case FLOAT: + this.setting.setValue(this.value); + break; + case DOUBLE: + this.setting.setValue(Double.parseDouble(this.value + "")); + } + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().refreshChat(); + } + f3 = (f3 = Float.parseFloat(this.setting.getValue() + "")) < this.settingValue ? this.settingValue - f3 : (f3 -= this.settingValue); + float f6 = ((maximumValue - minimumValue) / (float) 20 + f3 * (float) 8) / (float) (Minecraft.debugFPS + 1); + if ((double) f6 < 43.5 * 2.2988505747126437E-6) { + f6 = 1.9523809f * 5.121951E-5f; + } + if (this.settingValue < (f2 = Float.parseFloat(this.setting.getValue() + ""))) { + this.settingValue = Math.min(this.settingValue + f6, f2); + } else if (this.settingValue > f2) { + this.settingValue = Math.max(this.settingValue - f6, f2); + } + double d2 = (float) 100 * ((this.settingValue - minimumValue) / (maximumValue - minimumValue)); + RenderUtil.drawRoundedRect(this.x + 174, this.y + 6, (double) (this.x + 180) + d * d2 / (double) 100, this.y + 8, 4, -12418828); + GL11.glColor4f(0.5714286f * 0.4375f, 0.45849055f * 0.9814815f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 543.75f * 0.33333334f) + d * d2 / (double) 100, (float) this.y + 0.6666667f * 10.875f, 2.531249981140718 * 1.7777777910232544); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 0.8804348f * 205.8642f) + d * d2 / (double) 100, (float) this.y + 0.13043478f * 55.583332f, 2.639325754971479 * 1.0229885578155518); + drawDescription(this.setting, mouseX, mouseY); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/TextFieldElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/TextFieldElement.java new file mode 100644 index 0000000..fac8015 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/TextFieldElement.java @@ -0,0 +1,188 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.setting.InputFieldElementPromptGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +public class TextFieldElement extends AbstractModulesGuiElement { + + @Getter + private final ModulesGuiButtonElement keybindButton; + private boolean usingKeybind = false; + private boolean showKeybind = false; + @Getter private final InputFieldElement textInputBar; + + public TextFieldElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.textInputBar = new InputFieldElement(CheatBreaker.getInstance().playBold18px, this.setting.getValue().toString(), 0, 0); + this.textInputBar.setMaxStringLength(256); + this.keybindButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, setting.isHasMouseBind() ? "Button " + (setting.getKeyCode() + 1) : Keyboard.getKeyName(setting.getKeyCode()), this.x + this.width - 100, this.y, 50, 18, -9442858, scale, false); + this.height = 18; + + if (setting.getSettingName().startsWith("Hot key")) { + this.showKeybind = true; + } + } + + public void setDimensions(int x, int y, int width, int height) { + super.setDimensions(x, y, width, height); + this.textInputBar.setElementSize(this.x + (showKeybind ? 65 : 150), y + height - 14.0f, 166, 13.0f); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + if (this.usingKeybind && this.showKeybind && Keyboard.getEventKeyState()) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(this.setting.getSettingName()); + + for (Setting setting : CheatBreaker.getInstance().getModuleManager().autoTextMod.hotkeys) { + // Check if the key bind is already bound to another. + if (Keyboard.getEventKey() == setting.getKeyCode() || CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Keyboard.getEventKey())) { + this.clearKeybind(); + break; + } + } + + // Backspace clears the key bind. + if (Keyboard.getEventKey() == 14) { + this.clearKeybind(); + } + + // Set the key bind. + if (!this.keybindButton.optionString.equals("NONE")) { + if (this.keybindButton.conflict) + this.keybindButton.setConflict(false); + + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(Keyboard.getEventKey()); + this.keybindButton.optionString = Keyboard.getKeyName(this.setting.getKeyCode()); + this.usingKeybind = false; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + } + } + + if (this.usingKeybind && this.showKeybind && Mouse.getEventButton() != 0 && Mouse.getEventButtonState()) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(this.setting.getSettingName()); + + for (Setting setting : CheatBreaker.getInstance().getModuleManager().autoTextMod.hotkeys) { + // Check if the key bind is already bound to another. + if (Mouse.getEventButton() == setting.getKeyCode() || CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Mouse.getEventButton())) { + this.keybindButton.optionString = "NONE"; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(0); + this.usingKeybind = false; + break; + } + } + + // Backspace clears the key bind. + if (Keyboard.getEventKey() == 14) { + this.keybindButton.optionString = "NONE"; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(0); + this.usingKeybind = false; + } + + // Set the key bind. + if (!this.keybindButton.optionString.equals("NONE")) { + if (this.keybindButton.conflict) + this.keybindButton.setConflict(false); + this.setting.setKeyCode(Mouse.getEventButton()); + this.setting.setHasMouseBind(true); + this.keybindButton.optionString = "Button " + (this.setting.getKeyCode() + 1); + this.usingKeybind = false; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + } + } + + if (this.showKeybind) { + this.keybindButton.yOffset = this.yOffset; + this.keybindButton.setDimensions(this.x + this.width - 110, this.y, 96, 18); + this.keybindButton.handleDrawElement(mouseX, mouseY, partialTicks); + } + + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + Gui.drawRect(this.x + (showKeybind ? 65 : 148), this.y + 16, this.x + this.width - (showKeybind ? 120 : 16), this.y + 17, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + this.textInputBar.setTextColor(GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + this.textInputBar.setEnableBackgroundDrawing(false); + this.textInputBar.drawElementHover(mouseX, mouseY, true); + + drawDescription(this.setting, mouseX, mouseY); + handleElementUpdate(); + } + + private void clearKeybind() { + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + this.keybindButton.optionString = "NONE"; + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(0); + this.usingKeybind = false; + } + + @Override + public void handleElementUpdate() { + this.textInputBar.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.textInputBar.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + + if (n == 1) { + this.textInputBar.setFocused(false); + return; + } + + super.keyTyped(c, n); + this.textInputBar.keyTyped(c, n); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.handleElementUpdate(); + this.textInputBar.handleElementMouseClicked(f, f2, n, bl); + return false; + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.keybindButton.isMouseInside(mouseX, mouseY) && this.showKeybind) { + if (!CheatBreaker.getInstance().getModuleManager().autoTextMod.getActiveKeybindName().equals("")) { + return; + } + + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(this.setting.getSettingName()); + + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.usingKeybind = true; + this.keybindButton.optionString = ""; + } + + boolean hoveringOnTextElement = (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + this.width - (showKeybind ? 120 : 40)) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 18 + this.yOffset) * this.scale; + if (hoveringOnTextElement) { + Minecraft.getMinecraft().displayGuiScreen(new InputFieldElementPromptGui(this.setting, HudLayoutEditorGui.instance, this.scale)); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ToggleElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ToggleElement.java new file mode 100644 index 0000000..f6eb737 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/ToggleElement.java @@ -0,0 +1,83 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ToggleElement extends AbstractModulesGuiElement { + // private final Setting setting; + private final ResourceLocation rightArrowIcon = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation leftArrowIcon = new ResourceLocation("client/icons/right.png"); + private int optionValueIndex = 0; + private float animationSpeed = 0.0f; + private String optionValue; + + public ToggleElement(Setting setting, float scale) { + super(scale); + this.setting = setting; + this.height = 12; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean isXHovering = (float) mouseX > (this.x + this.width - 48.0f) * this.scale && (float) mouseX < (this.x + this.width - 10.0f) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + boolean isYHovering = (float) mouseX > (this.x + this.width - 92.0f) * this.scale && (float) mouseX < (this.x + this.width - 48.0f) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), isYHovering || isXHovering ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor3 : CBTheme.lightTextColor3 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + if (this.optionValueIndex == 0) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((Boolean) this.setting.getValue() ? "ON" : "OFF", this.x + this.width - 48, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + boolean isOne = this.optionValueIndex == 1; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.optionValue, this.x + this.width - 48.0f - (isOne ? -this.animationSpeed : this.animationSpeed), this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + if (isOne) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((Boolean) this.setting.getValue() ? "ON" : "OFF", (float)(this.x + this.width - 98) + this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((Boolean) this.setting.getValue() ? "ON" : "OFF", (float)(this.x + this.width + 2) - this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + if (this.animationSpeed >= 50.0f) { + this.optionValueIndex = 0; + this.animationSpeed = 0.0f; + } else { + float f2 = HudLayoutEditorGui.getFPSTransitionSpeed(50.0f + this.animationSpeed * 15.0f); + this.animationSpeed = Math.min(this.animationSpeed + f2, 50.0f); + } + + Gui.drawRect(this.x + this.width - 130, this.y + 2, this.x + this.width - 72, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + Gui.drawRect(this.x + this.width - 22, this.y + 2, this.x + this.width + 4, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + } + + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isYHovering ? 0.8f : 0.45f); + RenderUtil.renderIcon(this.rightArrowIcon, 4.0f, this.x + this.width - 82.0f, this.y + 3.0f); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isXHovering ? 0.8f : 0.45f); + RenderUtil.renderIcon(this.leftArrowIcon, 4.0f, this.x + this.width - 22.0f, this.y + 3.0f); + drawDescription(this.setting, mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl = (float) mouseX > (this.x + this.width - 92.0f) * this.scale && (float) mouseX < (this.x + this.width - 48.0f) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + boolean bl2 = (float) mouseX > (this.x + this.width - 48.0f) * this.scale && (float) mouseX < (this.x + this.width - 10.0f) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + + if ((bl || bl2) && this.optionValueIndex == 0) { + this.optionValueIndex = bl ? 1 : 2; + this.animationSpeed = 0.0f; + this.optionValue = (Boolean) this.setting.getValue() ? "ON" : "OFF"; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.setting.setValue(!((Boolean) this.setting.getValue())); + if (this.setting == CheatBreaker.getInstance().getGlobalSettings().enableTeamView && !(Boolean) CheatBreaker.getInstance().getGlobalSettings().enableTeamView.getValue()) { + CheatBreaker.getInstance().getModuleManager().teammatesMod.setEnabled(false); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/CrosshairElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/CrosshairElement.java new file mode 100644 index 0000000..998ceaa --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/CrosshairElement.java @@ -0,0 +1,28 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class CrosshairElement extends AbstractModulesGuiElement { + public CrosshairElement(float scaleFactor) { + super(scaleFactor); + this.height = 50; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + Gui.drawRect(this.x + (this.width / 2 - 15) - 41, this.y + 4, this.x + (this.width / 2 - 15) + 41, this.y + 51, -16777216); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(new ResourceLocation("client/defaults/crosshair_" + CheatBreaker.getInstance().getModuleManager().crosshairMod.previewBackground.getStringValue().toLowerCase() + ".png"), (float) (this.x + (this.width / 2 - 15) - 40), (float) (this.y + 5), (float) 80, 45); + Gui.zLevel = 0; + CheatBreaker.getInstance().getModuleManager().crosshairMod.drawCrosshair(this.x + this.width / 2 - 15, this.y + this.height / 2 + 3, false); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/ExcludePotionsElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/ExcludePotionsElement.java new file mode 100644 index 0000000..afe0db6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/ExcludePotionsElement.java @@ -0,0 +1,119 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.potion.Potion; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +public class ExcludePotionsElement extends AbstractModulesGuiElement { + private final List list2 = new ArrayList<>(); + + public ExcludePotionsElement(Setting setting, float scale) { + super(scale); + this.height = 50; + this.setting = setting; + list(); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + Minecraft mc = Minecraft.getMinecraft(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + int n3 = 0; + int n4 = 0; + for (Potion item : list2) { +// Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n3 >= 15) { + n3 = 0; + ++n4; + } + int n5 = this.x + 12 + n3 * 20; + int n6 = this.y + 14 + n4 * 20; + boolean hovering = (float) mouseX > (float) (n5 - 2) * this.scale && (float) mouseX < (float) (n5 + 18) * this.scale && (float) mouseY > (float) (n6 - 2 + this.yOffset) * this.scale && (float) mouseY < (float) (n6 + 18 + this.yOffset) * this.scale; + if (this.setting.getArrayListValue().contains(item.id)) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x7F00FF00); + } else if (hovering) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x4F0000FF); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/inventory.png")); + int n7 = item.getStatusIconIndex(); + RenderUtil.drawTexturedModalRect(n5 - 1, (float) n6 - 1, (float) (n7 % 8 * 18), (float) (198 + n7 / 8 * 18), 18, 18); + ++n3; + } + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GL11.glDisable(3042); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + try { + int n5 = 0; + int n6 = 0; + for (Integer item : (Integer[]) setting.getAcceptedValues()) { +// Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n5 >= 15) { + n5 = 0; + ++n6; + } + int n7 = this.x + 12 + n5 * 20; + int n8 = this.y + 14 + n6 * 20; + boolean bl = (float) mouseX > (float) (n7 - 2) * this.scale && (float) mouseX < (float) (n7 + 18) * this.scale && (float) mouseY > (float) (n8 - 2 + this.yOffset) * this.scale && (float) mouseY < (float) (n8 + 18 + this.yOffset) * this.scale; + if (bl && button == 0) { + int n9 = item; + if (((List) this.setting.getValue()).contains(n9)) { + ((List) this.setting.getValue()).removeIf(n2 -> n2 == n9); + } else { + this.setting.getArrayListValue().add(n9); + } + setting.setValue(this.setting.getArrayListValue()); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + ++n5; + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void list() { + list2.add(Potion.moveSpeed); + list2.add(Potion.moveSlowdown); + list2.add(Potion.digSpeed); + list2.add(Potion.digSlowdown); + list2.add(Potion.damageBoost); + list2.add(Potion.jump); + list2.add(Potion.confusion); + list2.add(Potion.regeneration); + list2.add(Potion.resistance); + list2.add(Potion.fireResistance); + list2.add(Potion.waterBreathing); + list2.add(Potion.invisibility); + list2.add(Potion.blindness); + list2.add(Potion.nightVision); + list2.add(Potion.hunger); + list2.add(Potion.weakness); + list2.add(Potion.poison); + list2.add(Potion.wither); + list2.add(Potion.absorption); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/GlobalSettingsElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/GlobalSettingsElement.java new file mode 100644 index 0000000..8e90b5b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/GlobalSettingsElement.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GlobalSettingsElement extends AbstractModulesGuiElement { + private final int highlightColor; + private final AbstractScrollableElement scrollbar; + private int progressiveRect = 0; + private final ResourceLocation arrowIcon = new ResourceLocation("client/icons/right.png"); + + public GlobalSettingsElement(AbstractScrollableElement scrollbar, int highlightColor, float scale) { + super(scale); + this.scrollbar = scrollbar; + this.highlightColor = highlightColor; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean bl = this.isMouseInside(mouseX, mouseY); + int n3 = 75; + Gui.drawRect(this.x, this.y + this.height - 1, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + float f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + if (bl) { + if (this.progressiveRect < n3) { + this.progressiveRect = (int) ((float) this.progressiveRect + f2); + if (this.progressiveRect > n3) { + this.progressiveRect = n3; + } + } + } else if (this.progressiveRect > 0) { + this.progressiveRect = (float) this.progressiveRect - f2 < 0.0f ? 0 : (int) ((float) this.progressiveRect - f2); + } + if (this.progressiveRect > 0) { + float f3 = (float) this.progressiveRect / (float) n3 * 100.0F; + Gui.drawRect(this.x, (int) ((float) this.y + ((float) this.height - (float) this.height * f3 / (float) 100)), this.x + this.width, this.y + this.height, this.highlightColor); + } + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 1.4666667f * 0.23863636f); + RenderUtil.renderIcon(this.arrowIcon, 2.2f * 1.1363636f, (float) (this.x + 6), (float) this.y + (float) 6); + CheatBreaker.getInstance().playBold18px.drawString("CheatBreaker Settings".toUpperCase(), (float)this.x + 14.0F, (float)this.y + 3.0F, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/KeybindElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/KeybindElement.java new file mode 100644 index 0000000..6d00067 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/KeybindElement.java @@ -0,0 +1,83 @@ +package com.cheatbreaker.client.ui.element.type.custom; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import com.cheatbreaker.client.module.data.Setting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import javax.management.Notification; +import java.util.Set; + +public class KeybindElement extends AbstractModulesGuiElement { + // private final Setting setting; + @Getter private final ModulesGuiButtonElement button; + private boolean using = false; + + public KeybindElement(Setting setting, float scale) { + super(scale); + this.setting = setting; + this.height = 15; + this.button = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, setting.isHasMouseBind() ? "Button " + (setting.getIntegerValue() + 1) : Keyboard.getKeyName(setting.getIntegerValue()), this.x + this.width - 100, this.y, 96, 18, -9442858, scale, false); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + if (this.using && Keyboard.getEventKeyState()) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + + if (Keyboard.getKeyName(Keyboard.getEventKey()).equalsIgnoreCase("Back") || CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Keyboard.getEventKey())) { + this.setting.setValue(0); + this.button.optionString = "NONE"; + this.setting.setHasMouseBind(false); + this.using = false; + return; + } + + this.setting.setValue(Keyboard.getEventKey()); + this.setting.setHasMouseBind(false); + this.button.optionString = Keyboard.getKeyName((Integer)this.setting.getValue()); + this.using = false; + } + + if (this.using && Mouse.getEventButton() != 0 && Mouse.getEventButtonState()) { + if (CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Mouse.getEventButton())) { + this.setting.setValue(0); + this.button.optionString = "NONE"; + this.setting.setHasMouseBind(false); + this.using = false; + return; + } + + this.setting.setValue(Mouse.getEventButton()); + this.setting.setHasMouseBind(true); + this.button.optionString = "Button " + (this.setting.getIntegerValue() + 1); + this.using = false; + } + + this.button.yOffset = this.yOffset; + this.button.setDimensions(this.x + this.width - 110, this.y, 96, 18); + this.button.handleDrawElement(mouseX, mouseY, partialTicks); + drawDescription(this.setting, mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.button.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.using = true; + this.button.optionString = ""; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/NewSliderElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/NewSliderElement.java new file mode 100644 index 0000000..d401180 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/NewSliderElement.java @@ -0,0 +1,181 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class NewSliderElement extends AbstractModulesGuiElement { + // private final Setting setting; + private float settingValue = -1; + private float value; + private boolean interacting = false; + private final ResourceLocation sunIcon = new ResourceLocation("client/icons/sun-64.png"); + private final ResourceLocation moonIcon = new ResourceLocation("client/icons/moon-64.png"); + + private final ResourceLocation volumeMuteIcon = new ResourceLocation("client/icons/volume-mute-64.png"); + private final ResourceLocation volumeUpIcon = new ResourceLocation("client/icons/volume-up-64.png"); + + private final ResourceLocation circleIcon = new ResourceLocation("client/icons/circle-64.png"); + private final ResourceLocation circleHollowIcon = new ResourceLocation("client/icons/circle-hollow-64.png"); + + private final ResourceLocation letterIcon = new ResourceLocation("client/icons/letter-t-64.png"); + + private boolean hasIcon = false; + private boolean hasCenterLabel = false; + + public NewSliderElement(Setting setting, float f) { + super(f); + this.setting = setting; + this.height = 22; + this.settingValue = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + int n4 = 170; + int ff = 20; + if (this.height == 12) ff = 10; + boolean hovering = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + 148 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + ff + this.yOffset) * this.scale; + if (button == 0 && hovering) { + this.interacting = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + float f2; + float f3; + int n3 = 148; + if (this.interacting && !Mouse.isButtonDown(0)) { + this.interacting = false; + } + float yPos = 8; + float yPos2 = 16; + float yPos3 = 17.25f; + int ff = 20; + + + if (!this.setting.getCenterLabel().isEmpty()) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.setting.getCenterLabel(), this.x + 172 + n3 / 2, this.y - 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + Gui.drawRect((float) (this.x + 172 + n3 / 2) - 0.5f, this.y + 8, (float) (this.x + 172 + n3 / 2) + 0.5f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasCenterLabel = true; + } + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + if (!this.setting.getLeftIcon().isEmpty() && !this.setting.getRightIcon().isEmpty()) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(new ResourceLocation("client/icons/" + this.setting.getLeftIcon() + ".png"), (float) (this.x + 180) - 5.0F, (float) (this.y + 3), 10.0f, 10.0f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(new ResourceLocation("client/icons/" + this.setting.getRightIcon() + ".png"), (float) (this.x + 170 + n3 - 10.0f) - (float) 5, (float) (this.y + 3), (float) 10.0f, 10.0f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } else if (this.setting.getSettingName().endsWith("Opacity")) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.circleHollowIcon, (float) (this.x + 180) - 4.0f, (float) (this.y + 3), 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.circleIcon, (float) (this.x + 170 + n3 - 7.5f) - (float) 6.5f, (float) (this.y + 3), (float) 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } else if (this.setting.getSettingName().endsWith("Volume")) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.volumeMuteIcon, (float) (this.x + 180) - 3.25f, (float) (this.y + 3), 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.volumeUpIcon, (float) (this.x + 170 + n3 - 7.5f) - (float) 5, (float) (this.y + 3), (float) 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } else if (this.setting.getSettingName().equals("World Time")) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.moonIcon, (float) (this.x + 180) - 3.25f, (float) (this.y + 3), 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.sunIcon, (float) (this.x + 170 + n3 - 10) - (float) 5, (float) (this.y + 2), (float) 10, 10); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } if (this.setting.getSettingName().endsWith("Scale") || this.setting.getSettingName().endsWith("Scale Multiplier")) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.letterIcon, (float) (this.x + 180) - 3.0f, (float) (this.y + 4), 6.0f, 6.0f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + RenderUtil.renderIcon(this.letterIcon, (float) (this.x + 170 + n3 - 10) - (float) 4, (float) (this.y + 2.5f), (float) 8.0f, 8.0f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } + if (!this.hasIcon && !this.hasCenterLabel) { + this.height = 12; + yPos = 2; + yPos2 = 6; + yPos3 = 7.25f; + ff = 10; + } + + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + yPos), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + if (this.setting.isShowValue()) { + String string = this.setting.getValue().toString() + this.setting.getUnit(); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(string, this.x + 169 - (float)CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(string), (float)(this.y + yPos), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + boolean bl = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + n3 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + ff + this.yOffset) * this.scale; + RenderUtil.drawRoundedRect(this.x + 174, this.y + yPos2, this.x + 170 + n3 - 4, this.y + yPos2 + 2, 1.0, bl ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + double d = n3 - 18; + if (this.setting.getMinimumValue() != null && this.setting.getMaximumValue() != null) { + float f4 = Float.parseFloat("" + this.setting.getMinimumValue()); + float f5 = Float.parseFloat("" + this.setting.getMaximumValue()); + if (this.interacting) { + this.value = (float) Math.round(((double) f4 + (double) ((float) mouseX - (float) (this.x + 180) * this.scale) * ((double) (f5 - f4) / (d * (double) this.scale))) * (double) 100) / (float) 100; + if (this.setting.getType().equals(SettingType.INTEGER) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + this.value = Math.round(this.value); + } + if (this.value < f4) { + this.value = f4; + } else if (this.value > f5) { + this.value = f5; + } + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(Integer.parseInt((int) this.value + "")); + break; + case FLOAT: + this.setting.setValue(this.value); + break; + case DOUBLE: + this.setting.setValue(Double.parseDouble(this.value + "")); + } + Minecraft.getMinecraft().ingameGUI.getChatGUI().refreshChat(); + } + f3 = (f3 = Float.parseFloat(this.setting.getValue() + "")) < this.settingValue ? this.settingValue - f3 : (f3 -= this.settingValue); + float f6 = ((f5 - f4) / (float) 20 + f3 * (float) 8) / (float) (Minecraft.debugFPS + 1); + if ((double) f6 < (double) 0.18f * 5.555555334797621E-4) { + f6 = 2.1333334f * 4.6874997E-5f; + } + if (this.settingValue < (f2 = Float.parseFloat(this.setting.getValue() + ""))) { + this.settingValue = this.settingValue + f6 <= f2 ? (this.settingValue += f6) : f2; + } else if (this.settingValue > f2) { + this.settingValue = this.settingValue - f6 >= f2 ? (this.settingValue -= f6) : f2; + } + double d2 = (float) 100 * ((this.settingValue - f4) / (f5 - f4)); + RenderUtil.drawRoundedRect(this.x + 174, this.y + yPos2, (double) (this.x + 180) + d * d2 / (double) 100, this.y + yPos2 + 2, 4, -12418828); + GL11.glColor4f(0.6666667f * 0.375f, 0.45f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 1359.3749f * 0.13333334f) + d * d2 / (double) 100, (float) this.y + yPos3, 31.125001159496648 * 0.14457830786705017); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 39.5f * 4.588608f) + d * d2 / (double) 100, (float) this.y + yPos3, 1.6875000046566129 * (double) 1.6f); + this.drawDescription(this.setting, mouseX, mouseY); + } + } + + public float round(float floatIn) { + return Math.round(floatIn * 2) / 2F; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/WorldTimeElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/WorldTimeElement.java new file mode 100644 index 0000000..fa6a841 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/WorldTimeElement.java @@ -0,0 +1,109 @@ +package com.cheatbreaker.client.ui.element.type.custom; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class WorldTimeElement extends AbstractModulesGuiElement { + private final Setting setting; + private float settingValue = -1; + private float value; + private boolean interacting = false; + private final ResourceLocation sunIcon = new ResourceLocation("client/icons/sun-64.png"); + private final ResourceLocation moonIcon = new ResourceLocation("client/icons/moon-64.png"); + + public WorldTimeElement(Setting setting, float f) { + super(f); + this.setting = setting; + this.height = 22; + this.settingValue = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + int n4 = 170; + boolean bl = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + n4 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 20 + this.yOffset) * this.scale; + if (button == 0 && bl) { + this.interacting = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + float f3; + int n3 = 148; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + 8), -1895825408); + if (this.interacting && !Mouse.isButtonDown(0)) { + this.interacting = false; + } + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString("SERVER", this.x + 172 + n3 / 2F, this.y - 2, -1895825408); + Gui.drawRect((float) (this.x + 172 + n3 / 2) - 1.2580645f * 0.3974359f, this.y + 8, (float) (this.x + 172 + n3 / 2) + 0.33333334f * 1.5f, this.y + 14, 0x6F000000); + RenderUtil.renderIcon(this.moonIcon, (float) (this.x + 180) - 1.3170732f * 2.4675925f, (float) (this.y + 3), 6.346154f * 1.1818181f, 47.307693f * 0.15853658f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, 0x6F000000); + RenderUtil.renderIcon(this.sunIcon, (float) (this.x + 170 + n3 - 10) - (float) 5, (float) (this.y + 2), (float) 10, 10); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, 0x6F000000); + boolean bl = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + n3 - 2) * this.scale && (float) n2 > (float) (this.y + 4 + this.yOffset) * this.scale && (float) n2 < (float) (this.y + 20 + this.yOffset) * this.scale; + RenderUtil.drawRoundedRect(this.x + 174, this.y + 16, this.x + 170 + n3 - 4, this.y + 18, 1.0, bl ? -1895825408 : 0x6F000000); + double d = n3 - 18; + if (this.setting.getMinimumValue() != null && this.setting.getMaximumValue() != null) { + float f4 = Float.parseFloat("" + this.setting.getMinimumValue()); + float f5 = Float.parseFloat("" + this.setting.getMaximumValue()); + + if (this.interacting) { + this.value = (float) Math.round(((double) f4 + (double) ((float) mouseX - (float) (this.x + 180) * this.scale) * ((double) (f5 - f4) / (d * (double) this.scale))) * (double) 100) / (float) 100; + if (this.value < (float) -13490 && this.value > (float) -15490) { + this.value = -14490; + } + if (this.setting.getType().equals(SettingType.INTEGER)) { + this.value = Math.round(this.value); + } + + if (this.value < f4) { + this.value = f4; + } else if (this.value > f5) { + this.value = f5; + } + + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(Integer.parseInt((int) this.value + "")); + break; + case FLOAT: + this.setting.setValue(this.value); + break; + case DOUBLE: + this.setting.setValue(Double.parseDouble(this.value + "")); + } + } + f3 = (f3 = Float.parseFloat(this.setting.getValue() + "")) < this.settingValue ? this.settingValue - f3 : (f3 -= this.settingValue); + float f6 = ((f5 - f4) / (float) 20 + f3 * (float) 8) / (float) (Minecraft.debugFPS + 1); + if ((double) f6 < (double) 0.18f * 5.555555334797621E-4) { + f6 = 2.1333334f * 4.6874997E-5f; + } + if (this.settingValue < (f2 = Float.parseFloat(this.setting.getValue() + ""))) { + this.settingValue = this.settingValue + f6 <= f2 ? (this.settingValue += f6) : f2; + } else if (this.settingValue > f2) { + this.settingValue = this.settingValue - f6 >= f2 ? (this.settingValue -= f6) : f2; + } + double d2 = (float) 100 * ((this.settingValue - f4) / (f5 - f4)); + RenderUtil.drawRoundedRect(this.x + 174, this.y + 16, (double) (this.x + 180) + d * d2 / (double) 100, this.y + 18, 4, -12418828); + GL11.glColor4f(0.6666667f * 0.375f, 0.45f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 1359.3749f * 0.13333334f) + d * d2 / (double) 100, (float) this.y + 18.818182f * 0.9166667f, 31.125001159496648 * 0.14457830786705017); + if (this.settingValue == (float) -14490) { + GL11.glColor4f(0.7738095f * 0.32307693f, 0.037499998f * 12.0f, 1.0f, 1.0f); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + RenderUtil.drawCircle((double) ((float) this.x + 39.5f * 4.588608f) + d * d2 / (double) 100, (float) this.y + 1.2763158f * 13.515464f, 1.6875000046566129 * (double) 1.6f); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/XRayOptionsElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/XRayOptionsElement.java new file mode 100644 index 0000000..56e91de --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/element/type/custom/XRayOptionsElement.java @@ -0,0 +1,97 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.impl.normal.hud.armorstatus.ModuleArmorStatus; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.List; + +public class XRayOptionsElement extends AbstractModulesGuiElement { + private final String label; + private final List blocksList; + + public XRayOptionsElement(List list, String label, float scale) { + super(scale); + this.height = 220; + this.blocksList = list; + this.label = label; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.label.toUpperCase(), this.x + 10, (float)(this.y + 2), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + Minecraft mc = Minecraft.getMinecraft(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + int n3 = 0; + int n4 = 0; + for (Block block : Block.blockRegistry) { + Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n3 >= 15) { + n3 = 0; + ++n4; + } + int n5 = this.x + 12 + n3 * 20; + int n6 = this.y + 14 + n4 * 20; + boolean hovering = (float) mouseX > (float) (n5 - 2) * this.scale && (float) mouseX < (float) (n5 + 18) * this.scale && (float) mouseY > (float) (n6 - 2 + this.yOffset) * this.scale && (float) mouseY < (float) (n6 + 18 + this.yOffset) * this.scale; + if (blocksList.contains(Item.getIdFromItem(item))) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x7F00FF00); + } else if (hovering) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x4F0000FF); + } + ModuleArmorStatus.renderItem.renderItemAndEffectIntoGUI(new ItemStack(item), n5, n6); + ++n3; + } + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GL11.glDisable(3042); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + try { + int n5 = 0; + int n6 = 0; + for (Block block : Block.blockRegistry) { + Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n5 >= 15) { + n5 = 0; + ++n6; + } + int n7 = this.x + 12 + n5 * 20; + int n8 = this.y + 14 + n6 * 20; + boolean bl = (float) mouseX > (float) (n7 - 2) * this.scale && (float) mouseX < (float) (n7 + 18) * this.scale && (float) mouseY > (float) (n8 - 2 + this.yOffset) * this.scale && (float) mouseY < (float) (n8 + 18 + this.yOffset) * this.scale; + if (bl && button == 0) { + int n9 = Item.getIdFromItem(item); + if (blocksList.contains(n9)) { + blocksList.removeIf(n2 -> n2 == n9); + } else { + blocksList.add(n9); + } + if (CheatBreaker.getInstance().getModuleManager().xray.isEnabled()) { + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + ++n5; + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/AbstractFade.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/AbstractFade.java new file mode 100644 index 0000000..cae4498 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/AbstractFade.java @@ -0,0 +1,133 @@ +package com.cheatbreaker.client.ui.fading; + +import lombok.Getter; +import lombok.Setter; + +/** + * ENTIRE CLASS MAPPINGS IS TEMPORARILY LIKE THIS - HAVEN'T FIGURED OUT EVERYTHING + */ +@Getter +@Setter +public abstract class AbstractFade { + protected long time; + protected long duration; + protected boolean running = true; + protected float amount; + protected long unknownLong; + protected final float color; + private boolean loopAnimation; + private int runTime = 1; + private int runLength = 1; + private long unknownLong2; + private boolean hovered; + + public AbstractFade(long duration, float color) { + this.duration = duration; + this.color = color; + } + + protected abstract float getValue(); + + public void startAnimation() { + this.time = System.currentTimeMillis(); + this.running = true; + this.unknownLong2 = 0L; + } + + public void startAnimationFromStartOrEnd(float f) { + this.time = System.currentTimeMillis(); + this.unknownLong2 = f == 0.0f ? 0L : (long) ((float) this.duration * (1.0f - f)); + this.running = true; + } + + public void loopAnimation() { + this.loopAnimation = true; + } + + public boolean isTimeNotAtZero() { + return this.time != 0L; + } + + public boolean isOver() { + return this.timeLeft() <= 0L && this.running; + } + + public void reset() { + this.time = 0L; + this.runTime = 1; + } + + public float inOutFade(boolean hovering) { + if (hovering && !this.hovered) { + this.hovered = true; + this.startAnimationFromStartOrEnd(this.getFinalizedValue()); + } else if (this.hovered && !hovering) { + this.hovered = false; + this.startAnimationFromStartOrEnd(this.getFinalizedValue()); + } + if (this.time == 0L) { + return 0.0f; + } + float f = this.getFinalizedValue(); + return this.hovered ? f : 1.0f - f; + } + + public boolean isZeroOrLess() { + return this.time != 0L && this.timeLeft() > 0L; + } + + private float getFinalizedValue() { + if (this.time == 0L) { + return 0.0f; + } + if (this.timeLeft() <= 0L) { + return 1.0f; + } + return this.getValue(); + } + + public float getFadeAmount() { + if (this.time == 0L) { + return 0.0f; + } + if (this.isOver()) { + if (this.loopAnimation || this.runLength >= 1 && this.runTime < this.runLength) { + this.startAnimation(); + ++this.runTime; + } + return this.color; + } + if (this.running) { + return this.getValue(); + } + return this.amount; + } + + public void lIIIIllIIlIlIllIIIlIllIlI() { + this.running = false; + this.amount = this.getValue(); + this.unknownLong = System.currentTimeMillis() - this.time; + } + + public void IlllIllIlIIIIlIIlIIllIIIl() { + this.time = System.currentTimeMillis() - this.unknownLong; + this.running = true; + } + + public long getRemainingTime() { + long l = this.running ? this.timeLeft() : System.currentTimeMillis() - this.unknownLong + this.duration - System.currentTimeMillis(); + return Math.min(this.duration, Math.max(0L, l)); + } + + protected long timeLeft() { + return this.time + this.duration - this.unknownLong2 - System.currentTimeMillis(); + } + + public long llIIllIlIlllllIlIllIIlIll() { + return this.duration - this.getRemainingTime(); + } + + public long getUnknownLong() { + return this.unknownLong; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/ColorFade.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/ColorFade.java new file mode 100644 index 0000000..e03c5ad --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/ColorFade.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.ui.fading; + +import java.awt.*; + +public class ColorFade extends ExponentialFade { + private int startColor; + private int endColor; + private boolean started; + private Color endColorObj; + private Color startColorObj; + + public ColorFade(long fadeDuration, int startColor, int endColor) { + super(fadeDuration); + this.startColor = startColor; + this.endColor = endColor; + } + + public ColorFade(int startColor, int endColor) { + this(175L, startColor, endColor); + } + + public Color getColor(boolean criteria) { + Color color = new Color(criteria ? this.endColor : this.startColor, true); + if (criteria && !this.started) { + this.started = true; + this.endColorObj = new Color(this.startColor, true); + this.startColorObj = new Color(this.endColor, true); + this.startAnimation(); + } else if (this.started && !criteria) { + this.started = false; + this.endColorObj = new Color(this.endColor, true); + this.startColorObj = new Color(this.startColor, true); + this.startAnimation(); + } + if (this.isZeroOrLess()) { + float f = super.getFadeAmount(); + int n = (int) Math.abs(f * (float) this.startColorObj.getRed() + (1.0f - f) * (float) this.endColorObj.getRed()); + int n2 = (int) Math.abs(f * (float) this.startColorObj.getGreen() + (1.0f - f) * (float) this.endColorObj.getGreen()); + int n3 = (int) Math.abs(f * (float) this.startColorObj.getBlue() + (1.0f - f) * (float) this.endColorObj.getBlue()); + int n4 = (int) Math.abs(f * (float) this.startColorObj.getAlpha() + (1.0f - f) * (float) this.endColorObj.getAlpha()); + color = new Color(n, n2, n3, n4); + } + return color; + } + + public void setStartColor(int color) { + this.startColor = color; + } + + public void setEndColor(int color) { + this.endColor = color; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/CosineFade.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/CosineFade.java new file mode 100644 index 0000000..303d410 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/CosineFade.java @@ -0,0 +1,14 @@ +package com.cheatbreaker.client.ui.fading; + +public class CosineFade extends FloatFade { + public CosineFade(long duration) { + super(duration, 0.0f); + } + + @Override + protected float getValue() { + float f = super.getValue(); + float f2 = f * 2.0f - 1.0f; + return (float) (Math.cos((double) f2 * Math.PI) + 1.0) / 2.0f; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/ExponentialFade.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/ExponentialFade.java new file mode 100644 index 0000000..949ddf9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/ExponentialFade.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.ui.fading; + +public class ExponentialFade extends FloatFade { + public ExponentialFade(long duration) { + super(duration); + } + + @Override + public float getValue() { + float f = super.getValue(); + return (float) Math.pow(f * (2.0f - f), 1.0); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/FloatFade.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/FloatFade.java new file mode 100644 index 0000000..169c056 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/FloatFade.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.ui.fading; + +public class FloatFade extends AbstractFade { + public FloatFade(long duration) { + super(duration, 1.0f); + } + + public FloatFade(long duration, float f) { + super(duration, f); + } + + @Override + protected float getValue() { + return (float) (this.duration - this.timeLeft()) / (float) this.duration; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/MinMaxFade.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/MinMaxFade.java new file mode 100644 index 0000000..aa5e758 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/fading/MinMaxFade.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.ui.fading; + +public class MinMaxFade extends FloatFade { + public MinMaxFade(long l) { + super(l); + } + + @Override + protected float getValue() { + float value = super.getValue(); + return (double) value < 0.2558139478148095 * 1.954545497894287 ? 2.0f * value * value : (float) -1 + ((float) 4 - 2.0f * value) * value; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/AbstractElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/AbstractElement.java new file mode 100644 index 0000000..9855f0d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/AbstractElement.java @@ -0,0 +1,60 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import lombok.Getter; +import net.minecraft.client.Minecraft; + +public abstract class AbstractElement { + @Getter + protected float xPosition; + @Getter + protected float yPosition; + @Getter + protected float width; + @Getter + protected float height; + protected final Minecraft mc = Minecraft.getMinecraft(); + protected final CheatBreaker cb = CheatBreaker.getInstance(); + + public boolean isMouseInside(float f, float f2) { + return f > this.xPosition && f < this.xPosition + this.width && f2 > this.yPosition && f2 < this.yPosition + this.height; + } + + public boolean drawElementHover(float f, float f2, boolean bl) { + this.handleElementDraw(f, f2, bl); + return this.isMouseInside(f, f2); + } + + public void setElementSize(float x, float y, float width, float height) { + this.xPosition = x; + this.yPosition = y; + this.width = width; + this.height = height; + } + + public void handleElementUpdate() { + } + + public void handleElementClose() { + } + + public void keyTyped(char c, int n) { + } + + public void handleElementMouse() { + } + + protected abstract void handleElementDraw(float var1, float var2, boolean var3); + + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + return false; + } + + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + return false; + } + + public boolean onMouseClick(float f, float f2, int n) { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/AccountList.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/AccountList.java new file mode 100644 index 0000000..35258c7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/AccountList.java @@ -0,0 +1,130 @@ +package com.cheatbreaker.client.ui.mainmenu; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.util.RenderUtil; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class AccountList extends AbstractElement { + @Setter private ResourceLocation resourceLocation; + @Setter private String username; + private final ColorFade outline = new ColorFade(0x4FFFFFFF, -1353670564); + private final ColorFade topGradient = new ColorFade(444958085, 1063565678); + private final ColorFade bottomGradient = new ColorFade(444958085, 1062577506); + private final MinMaxFade fadeTime = new MinMaxFade(300L); + private float height2; + private boolean interacting; + private final MainMenuBase mainMenuBase; + private final ScrollableElement scrollbar = new ScrollableElement(this); + private float accountSelectionBoxHeight; + + public AccountList(MainMenuBase mainMenuBase, String username, ResourceLocation resourceLocation) { + this.mainMenuBase = mainMenuBase; + this.resourceLocation = resourceLocation; + this.username = username; + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + if (this.height2 == 0.0f) { + this.height2 = height; + } + this.accountSelectionBoxHeight = Math.min(this.mainMenuBase.getAccountsList().size() * 16 + 12, 120); + this.scrollbar.setElementSize(f + width - 5.0f, y + this.height2 + 6.0f, 4.0f, this.accountSelectionBoxHeight - 7.0F); + this.scrollbar.setScrollAmount(this.mainMenuBase.getAccountsList().size() * 16 + 4); + } + + @Override + public void handleElementMouse() { + this.scrollbar.handleElementMouse(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + boolean bl2 = false; //bl && this.isMouseInside(f, f2); + + RenderUtil.drawGradientRectWithOutline(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height2, this.outline.getColor(bl2).getRGB(), this.topGradient.getColor(bl2).getRGB(), this.bottomGradient.getColor(bl2).getRGB()); + + float f3 = 6; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + + RenderUtil.renderIcon(this.resourceLocation, f3, this.xPosition + 4.0f, this.yPosition + this.height2 / 2.0f - f3); + CheatBreaker.getInstance().robotoRegular13px.drawString(this.username, this.xPosition + 22.0f, this.yPosition + 4.5f, -1342177281); + + float f4 = this.fadeTime.inOutFade(this.isMouseInside(f, f2) && bl); + + if (this.fadeTime.isZeroOrLess()) { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height2 + this.accountSelectionBoxHeight * f4); + this.interacting = false;//true; - removed until we redo account system + } else if (!this.fadeTime.isZeroOrLess() && !this.isMouseInside(f, f2)) { + this.interacting = false; + } + + if (this.interacting) { + float f5 = 0.5f; + float f6 = this.yPosition + this.height + f5; + float f7 = this.yPosition + 5.0f + this.height2; + if (f6 > f7) { + Gui.drawBoxWithOutLine(this.xPosition + 1.0f, f7, this.xPosition + this.width - 1.0f, f6, f5, 0x4FFFFFFF, 444958085); + } + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int) this.xPosition, (int) (this.yPosition + this.height2), (int) (this.xPosition + this.width), (int) (this.yPosition + this.height2 + 7.0f + (this.height - this.height2 - 6.0f) * f4), (float) ((int) ((float) this.mainMenuBase.getScaledResolution().getScaleFactor() * this.mainMenuBase.getScaleFactor())), (int) this.mainMenuBase.getScaledHeight()); + this.scrollbar.drawScrollable(f, f2, bl); + int n = 1; + for (CBAccount account : this.mainMenuBase.getAccountsList()) { + float f8 = this.xPosition; + float f9 = this.xPosition + this.width; + float f10 = this.yPosition + this.height2 + (float) (n * 16) - 8.0f; + float f11 = f10 + 16.0f; + boolean bl3 = f > f8 && f < f9 && f2 - this.scrollbar.getPosition() > + f10 && f2 - this.scrollbar.getPosition() < f11 && bl && + !this.scrollbar.isMouseInside(f, f2) && !this.scrollbar.isButtonHeld(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, bl3 ? 1.0f : 0.8148148f * 0.8590909f); + RenderUtil.renderIcon(account.getHeadIcon(), f3, this.xPosition + 4.0f, f10 + 8.0f - f3); + CheatBreaker.getInstance().robotoRegular13px.drawString(account.getDisplayName(), this.xPosition + 22.0f, f10 + 4.0f, bl3 ? -1 : -1342177281); + ++n; + } + this.scrollbar.handleElementDraw(f, f2, bl); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + } + + public float setWidthFromAccountString(float stringWidth) { + return 22.0F + stringWidth + 10.0F; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } +// if (this.fadeTime.isHovered()) { +// this.scrollbar.handleElementMouseClicked(f, f2, n, bl); +// int n2 = 1; +// for (CBAccount account : this.mainMenuBase.getAccountsList()) { +// float f3 = this.xPosition; +// float f4 = this.xPosition + this.width; +// float f5 = this.yPosition + this.height2 + (float) (n2 * 16) - 8.0f; +// float f6 = f5 + 16.0f; +// boolean bl2 = f > f3 && f < f4 && f2 - this.scrollbar.getPosition() > f5 && f2 - this.scrollbar.getPosition() < f6 && bl && !this.scrollbar.isMouseInside(f, f2) && !this.scrollbar.isButtonHeld(); +// if (bl2) { +// Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); +// this.mainMenuBase.updateAccountElementAndLogin(account.getDisplayName()); +// } +// ++n2; +// } +// } + return false; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/CBAccount.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/CBAccount.java new file mode 100644 index 0000000..aa99b58 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/CBAccount.java @@ -0,0 +1,30 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.ResourceLocation; + +@AllArgsConstructor +@Getter +public class CBAccount { + private String clientToken; + private String username; + private String accessToken; + private String displayName; + private String uuid; + private final ResourceLocation headIcon; + + public CBAccount(String username, String clientToken, String accessToken, String displayName, String uuid) { + this.username = username; + this.clientToken = clientToken; + this.accessToken = accessToken; + this.displayName = displayName; + this.uuid = uuid; + this.headIcon = CheatBreaker.getInstance().getHeadIcon(displayName); + } + + public void setAccessToken(String string) { + this.accessToken = string; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/GradientTextButton.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/GradientTextButton.java new file mode 100644 index 0000000..8579cf9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/GradientTextButton.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.util.RenderUtil; + +public class GradientTextButton extends AbstractElement { + private String string; + private final ColorFade outlineColor; + private final ColorFade topGradientColor; + private final ColorFade bottomGradientColor; + private int[] colorArray; + + public GradientTextButton(String string) { + this.string = string; + this.outlineColor = new ColorFade(-14277082, -11493284); + this.topGradientColor = new ColorFade(-13487566, -10176146); + this.bottomGradientColor = new ColorFade(-14013910, -11164318); + } + + // These names are not finalized. These will be named at another time. This is only to ensure that the obfuscation namings are dealt with first. + public void buttonColor1() { + this.setColorArray(new int[]{-11119018, -11493284, -10329502, -10176146, -11579569, -11164318}); + } + + public void buttonColor2() { + this.setColorArray(new int[]{-11493284, -11493284, -10176146, -10176146, -11164318, -11164318}); + } + + public void buttonColor3() { + this.setColorArray(new int[]{-14277082, -11493284, -13487566, -10176146, -14013910, -11164318}); + } + + private void setColorArray(int[] colorArray) { + this.colorArray = colorArray; + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + boolean bl2 = bl && this.isMouseInside(f, f2); + if (this.colorArray != null && this.outlineColor.isOver()) { + this.outlineColor.setStartColor(this.colorArray[0]); + this.outlineColor.setEndColor(this.colorArray[1]); + this.topGradientColor.setStartColor(this.colorArray[2]); + this.topGradientColor.setEndColor(this.colorArray[3]); + this.bottomGradientColor.setStartColor(this.colorArray[4]); + this.bottomGradientColor.setEndColor(this.colorArray[5]); + this.colorArray = null; + } + RenderUtil.drawGradientRectWithOutline(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.outlineColor.getColor(bl2).getRGB(), this.topGradientColor.getColor(bl2).getRGB(), this.bottomGradientColor.getColor(bl2).getRGB()); + CheatBreaker.getInstance().robotoRegular13px.drawCenteredString(this.string, this.xPosition + this.width / 2.0f, this.yPosition + 2.0f, -1); + } + + public void drawElement(float f, float f2, boolean hovering) { + this.handleElementDraw(f, f2, hovering); + } + + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } + + public String getString() { + return this.string; + } + + public void setString(String string) { + this.string = string; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LoadingScreen.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LoadingScreen.java new file mode 100644 index 0000000..a9a8d74 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LoadingScreen.java @@ -0,0 +1,159 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class LoadingScreen extends AbstractGui { + private final ResourceLocation outerLogo = new ResourceLocation("client/logo_255_outer.png"); + private final ResourceLocation innerLogo = new ResourceLocation("client/logo_108_inner.png"); + CosineFade outerLogoRotationTime = new CosineFade(4000L); + + private final ResourceLocation logo = new ResourceLocation("client/logo_108.png"); + private final CBFontRenderer font = new CBFontRenderer(new ResourceLocation("client/font/Ubuntu-M.ttf"), 14.0f); + + private final Framebuffer framebuffer; + + private String currentPhaseString; + + public int totalPhases; + private int currentPhase; + + /** + * Initial setup. + */ + public LoadingScreen(int phases) { + this.totalPhases = phases; + this.mc = Minecraft.getMinecraft(); + this.scaledResolution = new ScaledResolution(this.mc); + this.framebuffer = new Framebuffer(this.scaledResolution.getScaledWidth() * this.scaledResolution.getScaleFactor(), this.scaledResolution.getScaledHeight() * this.scaledResolution.getScaleFactor(), true); + } + + /** + * Updates the text and percentage bar. + */ + public void updatePhase(String phase) { + this.currentPhaseString = phase; + ++this.currentPhase; + if (this.totalPhases <= this.currentPhase) { + this.totalPhases = this.currentPhase + 1; + } + this.drawMenu(0.0f, 0.0f); + } + + /** + * Updates the text and percentage bar. + */ + public void addPhase() { + ++this.currentPhase; + if (this.totalPhases <= this.currentPhase) { + this.totalPhases = this.currentPhase + 1; + } + this.drawMenu(0.0f, 0.0f); + } + + /** + * Draws the logo. + */ + private void drawLogo(float resWidth, float resHeight) { + float size = 27.0f; + float x = resWidth / 2.0f - size; + float y = resHeight / 2.0f - size; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderEIcon(this.logo, size, x, y); + } + + private void drawRotatingLogo(float resWidth, float resHeight) { + float logoScale = 27.0f; + float x = resWidth / 2.0f - logoScale; + float y = resHeight / 2.0f - logoScale; + + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glTranslatef(x, y, 1.0f); + GL11.glTranslatef(logoScale, logoScale, logoScale); + GL11.glRotatef(180.0F * this.outerLogoRotationTime.getFadeAmount(), 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-logoScale, -logoScale, -logoScale); + RenderUtil.renderEIcon(this.outerLogo, logoScale, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderEIcon(this.innerLogo, logoScale, x, y); + } + + /** + * Sets the frame buffer. + */ + private void setFrameBuffer() { + try { + this.framebuffer.bindFramebuffer(false); + GL11.glMatrixMode(5889); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0, this.scaledResolution.getScaledWidth(), this.scaledResolution.getScaledHeight(), 0.0, 1000.0, 3000.0); + GL11.glMatrixMode(5888); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0f, 0.0f, -2000.0f); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } catch (RuntimeException ignored) {} + } + + /** + * Initializes the frame buffer renderer. + */ + private void initFrameBufferRenderer() { + int scaleFactor = this.scaledResolution.getScaleFactor(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + this.framebuffer.unbindFramebuffer(); + this.framebuffer.framebufferRender(this.scaledResolution.getScaledWidth() * scaleFactor, this.scaledResolution.getScaledHeight() * scaleFactor); + GL11.glAlphaFunc(516, 0.1f); + GL11.glFlush(); + } + + /** + * Draws the menu. + */ + @Override + public void drawMenu(float x, float y) { + this.setFrameBuffer(); + + float scale = this.getScaleFactor(); + float resolutionWidth = this.scaledResolution.getScaledWidth() / scale; + float resolutionHeight = this.scaledResolution.getScaledHeight() / scale; + + GL11.glScaled(scale, scale, scale); + Gui.drawRect(0.0f, 0.0f, resolutionWidth, resolutionHeight, -1); + + this.drawLogo(resolutionWidth, resolutionHeight); + + float barWidth = 160.0f; + float barX = resolutionWidth / 2.0f - 80.0f; + float barY = resolutionHeight - 40.0f; + RenderUtil.drawRoundedRect(barX, barY, barX + barWidth, barY + 10.0f, 8.0, -657931); + + float phaseBar = barWidth * ((float) this.currentPhase / (float) this.totalPhases); + if (this.currentPhaseString != null) this.font.drawCenteredString(this.currentPhaseString.toLowerCase(), resolutionWidth / 2.0f, barY - 11.0f, -3092272); + + RenderUtil.drawRoundedRect(barX, barY, barX + Math.max(phaseBar, 8.0F), barY + 10.0f, 8.0, -2473389); + this.initFrameBufferRenderer(); + this.mc.updateDisplay(); + } + + @Override + protected void mouseClicked(float var1, float var2, int var3) { + } + + @Override + public void mouseMovedOrUp(float var1, float var2, int var3) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarClientLogoElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarClientLogoElement.java new file mode 100644 index 0000000..7e3f2e2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarClientLogoElement.java @@ -0,0 +1,132 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.concurrent.ThreadLocalRandom; + +public final class LunarClientLogoElement extends AbstractElement { + private final ResourceLocation origLunarLogo = new ResourceLocation("client/animatedlogo/128/logo_128_no_stars.png"); + private static final ResourceLocation[] logoLocations = new ResourceLocation[8]; + private final TwinklingLunarLogo[] logos = new TwinklingLunarLogo[8]; + private boolean someBoolean = true; + private final float[] someIntArray = new float[8]; + private final boolean shadow; + + public LunarClientLogoElement() { + this(true); + } + + public LunarClientLogoElement(boolean shadow) { + for (int frame = 1; frame <= 8; ++frame) { + if (logoLocations[frame - 1] != null) continue; + LunarClientLogoElement.logoLocations[frame - 1] = new ResourceLocation("client/animatedlogo/128/logo_128_star_" + frame + ".png"); + } + this.updateLogo(); + this.shadow = shadow; + } + + private void updateLogo() { + for (int i = 1; i <= 8; ++i) { + if (this.logos[i - 1] != null && !this.logos[i - 1].isZeroOrLess()) { + this.someBoolean = false; + } + if (this.logos[i - 1] != null && this.logos[i - 1].isZeroOrLess()) continue; + long l = ThreadLocalRandom.current().nextLong(4000L, 12000L); + if (this.someBoolean) { + this.someIntArray[i - 1] = Math.max(ThreadLocalRandom.current().nextFloat(), 0.8f); + } + this.logos[i - 1] = new TwinklingLunarLogo(this, l); + } + } + + @Override + public void setElementSize(float f, float f2, float f3, float f4) { + super.setElementSize(f, f2, f3, f4); + } + + @Override + public void handleElementUpdate() { + this.updateLogo(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + GL11.glPushMatrix(); + if (this.shadow) { + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.2f); + RenderUtil.renderIcon(this.origLunarLogo, this.xPosition + 1.0f, this.yPosition + 1.0f, this.width, this.height); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.origLunarLogo, this.xPosition, this.yPosition, this.width, this.height); + for (int i = 0; i < 8; ++i) { + TwinklingLunarLogo twinklingLunarLogo = this.logos[i]; + if (!twinklingLunarLogo.isTimeNotAtZero()) { + twinklingLunarLogo.startAnimation(); + } + GL11.glPushMatrix(); + if (!twinklingLunarLogo.isZeroOrLess()) { + this.updateLogo(); + } + float f3 = twinklingLunarLogo.getRunTimeFadeLength(); + if (twinklingLunarLogo.isRunTimeOver() && this.someBoolean) { + this.someBoolean = false; + } + if (this.someBoolean) { + f3 = Math.max(f3, this.someIntArray[i]); + } + if (this.shadow) { + GL11.glColor4f(0.0f, 0.0f, 0.0f, f3 / 5.0f); + RenderUtil.renderIcon(logoLocations[i], this.xPosition + 1.0f, this.yPosition + 1.0f, this.width, this.height); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, f3); + RenderUtil.renderIcon(logoLocations[i], this.xPosition, this.yPosition, this.width, this.height); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + static class TwinklingLunarLogo extends FloatFade { + private final MinMaxFade runTime; + private final MinMaxFade runLength; + final LunarClientLogoElement loopAnimation; + + private TwinklingLunarLogo(LunarClientLogoElement lunarLogoElement, long l) { + super((long) ((float) l)); + this.loopAnimation = lunarLogoElement; + this.runTime = new MinMaxFade(Math.min((long) Math.min((float) l * 0.2f, 3000.0f), 1500L)); + this.runLength = new MinMaxFade(Math.min((long) ((float) l * 0.4f), 5000L)); + } + + @Override + public void startAnimation() { + super.startAnimation(); + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + } + + boolean isRunTimeOver() { + return this.runTime.isOver(); + } + + float getRunTimeFadeLength() { + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + if (this.runTime.isZeroOrLess()) { + return Math.max(this.runTime.getFadeAmount(), 0.15f); + } + if (this.getRemainingTime() <= this.runLength.getDuration()) { + if (!this.runLength.isTimeNotAtZero()) { + this.runLength.startAnimation(); + } + return 1.0f - 0.85f * this.runLength.getFadeAmount(); + } + return 1.0f; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarNetworkLogoElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarNetworkLogoElement.java new file mode 100644 index 0000000..3ec0ce9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarNetworkLogoElement.java @@ -0,0 +1,122 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.concurrent.ThreadLocalRandom; + +public final class LunarNetworkLogoElement extends AbstractElement { + private final ResourceLocation baseLogo; + private final ResourceLocation[] star = new ResourceLocation[8]; + private final IIlllIIIlllIlIlIlllllIIIl[] IlIIIIIIIlIlllIIIlIlIIIIl = new IIlllIIIlllIlIlIlllllIIIl[8]; + private boolean llIIllIlIlllllIlIllIIlIll = true; + private final float[] lIllllIllIIIlIlllIIlIllll = new float[8]; + public transient int llIlIIlIIlIIIlIIIllIIllIl; + + public LunarNetworkLogoElement() { + this.baseLogo = new ResourceLocation("client/animatedlogo/64/logo_64_no_stars.png"); + for (int i = 1; i <= 8; ++i) { + this.star[i - 1] = new ResourceLocation("client/animatedlogo/64/logo_64_star_" + i + ".png"); + } + this.IllIIIlIllIllIIlIIIlllIII(); + } + + private void IllIIIlIllIllIIlIIIlllIII() { + for (int i = 1; i <= 8; ++i) { + if (this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1] != null && !this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1].isZeroOrLess()) { + this.llIIllIlIlllllIlIllIIlIll = false; + } + if (this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1] != null && this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1].isZeroOrLess()) + continue; + long l = ThreadLocalRandom.current().nextLong(4000L, 12000L); + if (this.llIIllIlIlllllIlIllIIlIll) { + this.lIllllIllIIIlIlllIIlIllll[i - 1] = Math.max(ThreadLocalRandom.current().nextFloat(), 0.8f); + } + this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1] = new IIlllIIIlllIlIlIlllllIIIl(this, l); + } + } + + @Override + public void setElementSize(float f, float f2, float f3, float f4) { + super.setElementSize(f, f2, f3, f4); + } + + @Override + public void handleElementUpdate() { + ++this.llIlIIlIIlIIIlIIIllIIllIl; + this.IllIIIlIllIllIIlIIIlllIII(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.baseLogo, this.xPosition, this.yPosition, this.width, this.height); + for (int i = 0; i < 8; ++i) { + IIlllIIIlllIlIlIlllllIIIl iIlllIIIlllIlIlIlllllIIIl = this.IlIIIIIIIlIlllIIIlIlIIIIl[i]; + if (!iIlllIIIlllIlIlIlllllIIIl.isTimeNotAtZero()) { + iIlllIIIlllIlIlIlllllIIIl.startAnimation(); + } + GL11.glPushMatrix(); + if (!iIlllIIIlllIlIlIlllllIIIl.isZeroOrLess()) { + this.IllIIIlIllIllIIlIIIlllIII(); + } + float f3 = iIlllIIIlllIlIlIlllllIIIl.lIlIlllllIllIllIIlIllIIll(); + if (iIlllIIIlllIlIlIlllllIIIl.IllIlIlIIIIIlllllllllIlII() && this.llIIllIlIlllllIlIllIIlIll) { + this.llIIllIlIlllllIlIllIIlIll = false; + } + if (this.llIIllIlIlllllIlIllIIlIll) { + f3 = Math.max(f3, this.lIllllIllIIIlIlllIIlIllll[i]); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, f3); + RenderUtil.renderIcon(this.star[i], this.xPosition, this.yPosition, this.width, this.height); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + class IIlllIIIlllIlIlIlllllIIIl + extends FloatFade { + private final MinMaxFade runTime; + private final MinMaxFade runLength; + final LunarNetworkLogoElement loopAnimation; + + private IIlllIIIlllIlIlIlllllIIIl(LunarNetworkLogoElement lunarNetworkLogoElement, long duration) { + super(duration); + this.loopAnimation = lunarNetworkLogoElement; + this.runTime = new MinMaxFade(Math.min((long) Math.min((float) duration * 0.2f, 3000.0f), 1500L)); + this.runLength = new MinMaxFade(Math.min((long) ((float) duration * 0.4f), 5000L)); + } + + @Override + public void startAnimation() { + super.startAnimation(); + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + } + + boolean IllIlIlIIIIIlllllllllIlII() { + return this.runTime.isOver(); + } + + float lIlIlllllIllIllIIlIllIIll() { + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + if (this.runTime.isZeroOrLess()) { + return Math.max(1.0f * this.runTime.getFadeAmount(), 0.15f); + } + if (this.getRemainingTime() <= this.runLength.getDuration()) { + if (!this.runLength.isTimeNotAtZero()) { + this.runLength.startAnimation(); + } + return 1.0f - 0.85f * this.runLength.getFadeAmount(); + } + return 1.0f; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/MainMenuBase.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/MainMenuBase.java new file mode 100644 index 0000000..b015d05 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/MainMenuBase.java @@ -0,0 +1,567 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.cosmetic.EmoteGUI; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.cosmetics.GuiCosmetics; +import com.cheatbreaker.client.ui.mainmenu.element.IconButtonElement; +import com.cheatbreaker.client.ui.mainmenu.element.TextButtonElement; +import com.cheatbreaker.client.ui.mainmenu.element.TextWithShadowButton; +import com.cheatbreaker.client.ui.mainmenu.menus.*; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableList; +import com.google.gson.*; +import com.mojang.authlib.Agent; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiLanguage; +import net.minecraft.client.gui.GuiOptions; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Session; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.Project; + +import java.awt.*; +import java.io.*; +import java.net.Proxy; +import java.util.List; +import java.util.*; + +public class MainMenuBase extends AbstractGui { + private final ResourceLocation logo = new ResourceLocation("client/logo_42.png"); + private ResourceLocation backgroundTexture; + private static int rotationAngle = 4100; + private final IconButtonElement exitButton = new IconButtonElement(new ResourceLocation("client/icons/delete-64.png")); + private final IconButtonElement languageButton = new IconButtonElement(6.0f, new ResourceLocation("client/icons/globe-24.png")); + private final AccountList accountsButton = new AccountList(this, Minecraft.getMinecraft().getSession().getUsername(), + CheatBreaker.getInstance().getHeadIcon(Minecraft.getMinecraft().getSession().getUsername())); + private final TextButtonElement optionsButton = new TextButtonElement("OPTIONS"); + private final TextButtonElement changelogButton = new TextButtonElement("CHANGELOG"); + private final TextButtonElement cosmeticsButton = new TextButtonElement("COSMETICS"); + + private final List horizontalButtonList = ImmutableList.of(this.optionsButton, this.changelogButton, this.cosmeticsButton); + + private final String summaryBuildInfo = + CheatBreaker.getInstance().getGitBuildVersion().isEmpty() + || CheatBreaker.getInstance().getGitBuildVersion().toLowerCase().equals(CheatBreaker.getInstance().getGitBranch()) + ? "CheatBreaker (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")" : "CheatBreaker " + + CheatBreaker.getInstance().getGitBuildVersion() + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + + CheatBreaker.getInstance().getGitBranch() + ")"; + private final String copyright = "Copyright Mojang AB. Do not distribute!"; + private final String confidentialNoticeString = "Unauthorized disclosure of this build in any manner may result in disciplinary action up to and including termination of an assignment."; + + private final TextWithShadowButton commitButton = new TextWithShadowButton(summaryBuildInfo); + private final TextWithShadowButton creditsButton = new TextWithShadowButton(copyright); + private final TextWithShadowButton confidentialButton = new TextWithShadowButton(confidentialNoticeString, 50); + private final ColorFade overlayGradient = new ColorFade(0xF000000, -16777216); + private final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("client/panorama/0.png"), new ResourceLocation("client/panorama/1.png"), new ResourceLocation("client/panorama/2.png"), new ResourceLocation("client/panorama/3.png"), new ResourceLocation("client/panorama/4.png"), new ResourceLocation("client/panorama/5.png")}; + private final File launcherAccounts = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + private final List accountsList = new ArrayList<>(); + private float accountUsernameStringWidth = CheatBreaker.getInstance().robotoRegular13px.getStringWidth(Minecraft.getMinecraft().getSession().getUsername()); + String clientToken = ""; + + public MainMenuBase() { + this.loadAccounts(); + } + + private void loadAccounts() { + Minecraft mc = Minecraft.getMinecraft(); + ArrayList> var2 = new ArrayList<>(); + if (this.launcherAccounts.exists()) { + try { + FileReader launcherProfiles = new FileReader(this.launcherAccounts); + JsonParser parser = new JsonParser(); + JsonElement elements = parser.parse(launcherProfiles); + Iterator> iterator = elements.getAsJsonObject().entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + for (Map.Entry var4 : entry.getValue().getAsJsonObject().entrySet()) { + HashMap var5 = new HashMap<>(); + for (Map.Entry var7 : var4.getValue().getAsJsonObject().entrySet()) { + if (var7.getKey().equalsIgnoreCase("minecraftProfile")) { + for (Map.Entry o1 : var7.getValue().getAsJsonObject().entrySet()) { + if (o1.getKey().equals("id")) { + var5.put("uuid", o1.getValue().getAsString()); + } + if (o1.getKey().equals("name")) { + var5.put("displayName", o1.getValue().getAsString()); + } + } + } else { + if (!var7.getKey().equalsIgnoreCase("username") && !var7.getKey().equalsIgnoreCase("name") && !var7.getKey().equalsIgnoreCase("id") && !var7.getKey().equalsIgnoreCase("accessToken")) { + continue; + } + var5.put(var7.getKey(), var7.getValue().getAsString()); + } + } + var2.add(var5); + } + while (iterator.hasNext()) { + Object o2 = iterator.next(); + Map.Entry var10 = (Map.Entry) o2; + if (var10.getKey().equals("mojangClientToken")) { + JsonPrimitive clientTokenPrim = (JsonPrimitive) var10.getValue(); + this.clientToken = clientTokenPrim.getAsString(); + } + } + } + } catch (Exception ignored) { + } + } + this.accountsList.clear(); + this.accountUsernameStringWidth = (float) CheatBreaker.getInstance().robotoRegular13px.getStringWidth(Minecraft.getMinecraft().getSession().getUsername()); + for (Map var11 : var2) { + CBAccount var22 = new CBAccount(var11.get("username"), this.clientToken, var11.get("accessToken"), var11.get("displayName"), var11.get("uuid")); + + for (CBAccount account : this.accountsList) { + if (account.getDisplayName().equals(var22.getDisplayName())) { + return; + } + } + + this.accountsList.add(var22); + + float var13 = (float) CheatBreaker.getInstance().robotoRegular13px.getStringWidth(var22.getDisplayName()); + if (var13 > this.accountUsernameStringWidth) { + this.accountUsernameStringWidth = var13; + } + + if (mc.getSession() != null && clientToken.equalsIgnoreCase(mc.getSession().getUsername())) { + this.accountsButton.setUsername(var22.getDisplayName()); + this.accountsButton.setResourceLocation(CheatBreaker.getInstance().getHeadIcon(var22.getDisplayName())); + this.getAccountListElementSize(); + } + } + } + + @Override + protected void keyTyped(char c, int n) throws IOException { + if (n == 1 && Minecraft.getMinecraft().currentScreen instanceof MainMenu) { + return; + } + + if (Keyboard.isKeyDown(42) && Keyboard.getEventKey() == 15) { + Minecraft.getMinecraft().displayGuiScreen(OverlayGui.createInstance(Minecraft.getMinecraft().currentScreen)); + } + + super.keyTyped(c, n); + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + if (this.accountsButton != null) { + this.accountsButton.handleElementMouse(); + } + } + + @Override + public void updateScreen() { + super.updateScreen(); + ++rotationAngle; + } + + @Override + public void initGui() { + super.initGui(); + DynamicTexture viewportTexture = new DynamicTexture(256, 256); + this.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", viewportTexture); + + float horizontalButtonXPosition = 0; + for (TextButtonElement button : this.horizontalButtonList) { + button.setElementSize(124.0f + horizontalButtonXPosition, 6.0f, CheatBreaker.getInstance().robotoBold14px.getStringWidth(button.getString()) * 1.14F, 20.0f); + horizontalButtonXPosition += CheatBreaker.getInstance().robotoBold14px.getStringWidth(button.getString()) + 12.0F; + } + + this.exitButton.setElementSize(this.getScaledWidth() - 30.0f, 7.0f, 23.0f, 17.0f); + this.languageButton.setElementSize(this.getScaledWidth() / 2.0f - 13.0f, this.getScaledHeight() - 17.0f, 26.0f, 18.0f); + this.commitButton.setElementSize(5.0f, this.getScaledHeight() - 14.0f, CheatBreaker.getInstance().playRegular18px.getStringWidth(summaryBuildInfo), 18.0f); + this.creditsButton.setElementSize(this.getScaledWidth() - (float)CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright) - 5.0f, this.getScaledHeight() - 14.0f, CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright), 18.0F); + if (CheatBreaker.getInstance().isConfidentialBuild()) { + this.confidentialButton.setElementSize(this.getScaledWidth() - (float)CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright) - 5.0f, this.getScaledHeight() - 30.0F, CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright), 20.0F); + } + this.getAccountListElementSize(); + } + + public void getAccountListElementSize() { + this.accountsButton.setElementSize(this.getScaledWidth() - 35.0f - this.accountsButton.setWidthFromAccountString(this.accountUsernameStringWidth), 7.0f, this.accountsButton.setWidthFromAccountString(this.accountUsernameStringWidth), 17.0f); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GL11.glDisable(3008); + this.draw(mouseX, mouseY, 1.0f); + GL11.glEnable(3008); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void drawMenu(float x, float y) { + this.mc.ingameGUI.drawGradientRect(0.0f, 0.0f, this.getScaledWidth(), this.getScaledHeight(), 0x5FFFFFFF, 0x2FFFFFFF); + this.mc.ingameGUI.drawGradientRect(0.0f, 0.0f, this.getScaledWidth(), 160.0f, -553648128, 0); + boolean var3 = x < this.optionsButton.getXPosition() && y < 30.0f; + Color var4 = this.overlayGradient.getColor(var3); + CheatBreaker.getInstance().robotoRegular24px.drawString("CheatBreaker", 37.0f, 9.0f, var4.getRGB()); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + + RenderUtil.renderIcon(this.logo, 10.0f, 8.0f, 6.0f); + CheatBreaker.getInstance().robotoRegular24px.drawString("CheatBreaker", 36.0f, 8.0f, -1); + this.exitButton.drawElementHover(x, y, true); + this.languageButton.drawElementHover(x, y, true); + this.accountsButton.drawElementHover(x, y, true); + for (TextButtonElement button : this.horizontalButtonList) { + button.drawElementHover(x, y, true); + } + this.commitButton.drawElementHover(x, y, true); + this.creditsButton.drawElementHover(x, y, true); + if (CheatBreaker.getInstance().isConfidentialBuild()) { + this.confidentialButton.drawElementHover(x, y, true); + } + } + + @Override + protected void mouseClicked(float var1, float var2, int var3) { + this.exitButton.handleElementMouseClicked(var1, var2, var3, true); + this.accountsButton.handleElementMouseClicked(var1, var2, var3, true); + if (this.exitButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.shutdown(); + } else if (this.optionsButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } else if (this.languageButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } else if (this.cosmeticsButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiCosmetics()); + } else if (this.commitButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new BuildMenu()); + } else if (this.creditsButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiCreditsMenu()); + } else if (this.confidentialButton.isMouseInside(var1, var2) && CheatBreaker.getInstance().isConfidentialBuild()) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new ConfidentialBuildNoticeMenu()); + } else if (this.changelogButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new ChangelogMenu()); + } else if (var1 >= 8 && var1 <= 26 && var2 >= 6 && var2 <= 26) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + switchMenu(); + } else { + boolean var4 = var1 < this.optionsButton.getXPosition() && var2 < 30.0f; + if (var4 && !(this.mc.currentScreen instanceof MainMenu)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } + } + + } + + @Override + public void mouseMovedOrUp(float var1, float var2, int var3) { + } + + private void draw(int var1, int var2, float var3) { + this.mc.getFramebuffer().unbindFramebuffer(); + + GL11.glViewport(0, 0, 256, 256); + + this.drawPanorama(var1, var2, var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.mc.getFramebuffer().bindFramebuffer(true); + + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + + float var5 = this.width > this.height ? 120.0f / (float) this.width : 120.0f / (float) this.height; + float var6 = (float) this.height * var5 / 256.0f; + float var7 = (float) this.width * var5 / 256.0f; + float var8 = this.width; + float var9 = this.height; + + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0, var9, zLevel).tex(0.5f - var6, 0.5f + var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + worldrenderer.pos(var8, var9, zLevel).tex(0.5f - var6, 0.5f - var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + worldrenderer.pos(var8, 0.0, zLevel).tex(0.5f + var6, 0.5f - var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + worldrenderer.pos(0.0, 0.0, zLevel).tex(0.5f + var6, 0.5f + var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + tessellator.draw(); + } + + private void drawPanorama(int var1, int var2, float var3) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GL11.glMatrixMode(5889); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + Project.gluPerspective(120.0f, 1.0f, 0.05f, 10.0f); + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + GL11.glEnable(3042); + GL11.glDisable(3008); + GL11.glDisable(2884); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + int var5 = 8; + for (int var6 = 0; var6 < var5 * var5; ++var6) { + GL11.glPushMatrix(); + float var7 = ((float) (var6 % var5) / (float) var5 - 0.5f) / 64.0f; + float var8 = ((float) (var6 / var5) / (float) var5 - 0.5f) / 64.0f; + float var9 = 0.0f; + GL11.glTranslatef(var7, var8, var9); + GL11.glRotatef(MathHelper.sin(((float) rotationAngle + var3) / 400.0f) * 25.0f + 20.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(-((float) rotationAngle + var3) * 0.39240506f * 0.2548387f, 0.0f, 1.0f, 0.0f); + for (int var10 = 0; var10 < 6; ++var10) { + GL11.glPushMatrix(); + if (var10 == 1) { + GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 2) { + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 3) { + GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 4) { + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + } + if (var10 == 5) { + GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); + } + this.mc.getTextureManager().bindTexture(this.titlePanoramaPaths[var10]); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + float var11 = 0.0f; + worldrenderer.pos(-1.0, -1.0, 1.0).tex(0.0f + var11, 0.0f + var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + worldrenderer.pos(1.0, -1.0, 1.0).tex(1.0f - var11, 0.0f + var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + worldrenderer.pos(1.0, 1.0, 1.0).tex(1.0f - var11, 1.0f - var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + worldrenderer.pos(-1.0, 1.0, 1.0).tex(0.0f + var11, 1.0f - var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + tessellator.draw(); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + GL11.glColorMask(true, true, true, false); + } + GL11.glColorMask(true, true, true, true); + GL11.glMatrixMode(5889); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glEnable(2884); + GL11.glEnable(2929); + } + + private void rotateAndBlurSkybox(float var1) { + this.mc.getTextureManager().bindTexture(this.backgroundTexture); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColorMask(true, true, true, false); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + GL11.glDisable(3008); + int var3 = 3; + for (int var4 = 0; var4 < var3; ++var4) { + float var5 = this.width; + float var6 = this.height; + float var7 = (float) (var4 - var3 / 2) / 256.0f; + worldrenderer.pos(var5, var6, zLevel).tex(0.0f + var7, 1.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + worldrenderer.pos(var5, 0.0, zLevel).tex(1.0f + var7, 1.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + worldrenderer.pos(0.0, 0.0, zLevel).tex(1.0f + var7, 0.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + worldrenderer.pos(0.0, var6, zLevel).tex(0.0f + var7, 0.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + } + tessellator.draw(); + GL11.glEnable(3008); + GL11.glColorMask(true, true, true, true); + } + + public void updateAccountElementAndLogin(String var1) { + try { + CBAccount var2 = null; + + for (CBAccount account : this.accountsList) { + if (account.getDisplayName().equals(var1)) { + var2 = account; + } + } + + if (var2 != null) { + if (var2.getUuid().equalsIgnoreCase(Minecraft.getMinecraft().getSession().getPlayerID())) { + return; + } + + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + + for (Session session : CheatBreaker.getInstance().playerSessions) { + if (session.getProfile().getId().toString().replaceAll("-", "").equalsIgnoreCase(var2.getUuid().replaceAll("-", ""))) { + Minecraft.getMinecraft().setSession(session); + this.accountsButton.setUsername(var2.getDisplayName()); + this.accountsButton.setResourceLocation(var2.getHeadIcon()); + this.getAccountListElementSize(); + return; + } + } + + YggdrasilAuthenticationService var26 = new YggdrasilAuthenticationService(Proxy.NO_PROXY, this.clientToken); + YggdrasilUserAuthentication var28 = (YggdrasilUserAuthentication) var26.createUserAuthentication(Agent.MINECRAFT); + HashMap var5 = new HashMap<>(); + var5.put("uuid", var2.getUuid()); + var5.put("displayName", var2.getDisplayName()); + var5.put("username", var2.getUsername()); + var5.put("accessToken", var2.getAccessToken()); + var28.loadFromStorage(var5); + + Session session; + try { + var28.logIn(); + session = new Session(var28.getSelectedProfile().getName(), var28.getSelectedProfile().getId().toString(), var28.getAuthenticatedToken(), "mojang"); + } catch (AuthenticationException var21) { + var21.printStackTrace(); + return; + } + + File launcherAccountsFile = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + if (launcherAccountsFile.exists() && !var28.getAuthenticatedToken().equals(var2.getAccessToken())) { + try { + FileReader fileReader = new FileReader(launcherAccountsFile); + JsonParser var9 = new JsonParser(); + JsonElement var10 = var9.parse(fileReader); + Map.Entry var11 = null; + Iterator> var12 = var10.getAsJsonObject().entrySet().iterator(); + + label106: + while (true) { + Map.Entry var13; + do { + if (!var12.hasNext()) { + if (var11 != null) { + var2.setAccessToken(var28.getAuthenticatedToken()); + var11.getValue().getAsJsonObject().remove("accessToken"); + var11.getValue().getAsJsonObject().addProperty("accessToken", var28.getAuthenticatedToken()); + } + + Gson var29 = (new GsonBuilder()).setPrettyPrinting().create(); + + try { + DataOutputStream var30 = new DataOutputStream(new FileOutputStream(launcherAccountsFile)); + var30.writeBytes(var29.toJson(var10).replace("\n", "\r\n")); + var30.flush(); + var30.close(); + break label106; + } catch (Exception var20) { + var20.printStackTrace(); + return; + } + } + + var13 = var12.next(); + } while (!var13.getKey().equalsIgnoreCase("authenticationDatabase")); + + Iterator> var14 = var13.getValue().getAsJsonObject().entrySet().iterator(); + + label104: + while (var14.hasNext()) { + Map.Entry var15 = var14.next(); + Iterator> var16 = var15.getValue().getAsJsonObject().entrySet().iterator(); + + while (true) { + Map.Entry var17; + do { + if (!var16.hasNext()) { + continue label104; + } + + var17 = var16.next(); + } while (!var17.getKey().equalsIgnoreCase("profiles")); + + for (Map.Entry var19 : var17.getValue().getAsJsonObject().entrySet()) { + if (var19.getKey().replaceAll("-", "").equalsIgnoreCase(session.getPlayerID().replaceAll("-", ""))) { + var11 = var15; + } + } + } + } + } + } catch (Exception var22) { + var22.printStackTrace(); + return; + } + } + + System.out.println("Updated accessToken and logged user in."); + this.accountsButton.setUsername(var2.getDisplayName()); + this.accountsButton.setResourceLocation(var2.getHeadIcon()); + this.getAccountListElementSize(); + CheatBreaker.getInstance().playerSessions.add(session); + Minecraft.getMinecraft().setSession(session); + CheatBreaker.getInstance().getWsNetHandler().close(); + } + } catch (Exception var23) { + var23.printStackTrace(); + } + + } + + public List getAccountsList() { + return this.accountsList; + } + + public static void switchMenu() { + int next = CheatBreaker.getInstance().getGlobalSettings().getCurrentMenu().ordinal() + 1; + MenuTypes menu; + if (next == 3) { + menu = MenuTypes.OLD; + } else { + menu = MenuTypes.values()[next]; + } + CheatBreaker.getInstance().getGlobalSettings().getCurrentMenuSetting().setValue(menu.ordinal()); + Minecraft.getMinecraft().displayGuiScreen(MenuTypes.getMenu(menu)); + } + + public enum MenuTypes { + OLD, + MAIN, + VANILLA; + + public static GuiScreen getMenu(MenuTypes menuTypes) { + switch (menuTypes) { + case OLD: + return new CBOldMenu(); + case VANILLA: + return new VanillaMenu(); + default: + return new MainMenu(); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/CB2018OldMenuButton.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/CB2018OldMenuButton.java new file mode 100644 index 0000000..9af651b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/CB2018OldMenuButton.java @@ -0,0 +1,26 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import net.minecraft.client.gui.Gui; + +public class CB2018OldMenuButton extends AbstractElement { + private final ColorFade buttonColor = new ColorFade(0x1F000000, 0x3F000000); + private final ColorFade IllIIIIIIIlIlIllllIIllIII = new ColorFade(0, -1073741825); + private final MinMaxFade lIIIIllIIlIlIllIIIlIllIlI = new MinMaxFade(750L); + private boolean IlllIllIlIIIIlIIlIIllIIIl; + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.buttonColor.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/ChangeLogButton.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/ChangeLogButton.java new file mode 100644 index 0000000..535085d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/ChangeLogButton.java @@ -0,0 +1,54 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.mainmenu.menus.ChangelogDetailMenu; +import com.cheatbreaker.client.util.lang.WordWrap; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +public class ChangeLogButton extends AbstractElement { + private final ColorFade backgroundFade = new ColorFade(0x1F000000, 0x3F000000); + private final String title; + private final String author; + private final String description; + + public ChangeLogButton(String title, String author, String description) { + this.title = title; + this.author = author; + this.description = description; + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.backgroundFade.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + String wrapped = WordWrap.from(description).maxWidth(60).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + + int index = 2; + float yOffset = CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f; + + CheatBreaker.getInstance().playRegular14px.drawString(EnumChatFormatting.BOLD + this.title, 1.0f + xPosition, yPosition, -1); + CheatBreaker.getInstance().playRegular12px.drawString(EnumChatFormatting.ITALIC + "Posted by " + EnumChatFormatting.BOLD + this.author, 1.0f + xPosition, yPosition + yOffset, -1); + + for (String line : lines) { + if (index < 3) { + if (index == 2) line += "..."; + CheatBreaker.getInstance().playRegular14px.drawString(line, 1.0f + xPosition, yPosition + (index * yOffset) - 1, -1); + } + index++; + } + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (this.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new ChangelogDetailMenu(this.title, this.author, this.description)); + } + return false; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuAccountButton.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuAccountButton.java new file mode 100644 index 0000000..99e7e77 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuAccountButton.java @@ -0,0 +1,184 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.mojang.authlib.Agent; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Session; +import org.lwjgl.opengl.GL11; + +import java.io.*; +import java.net.Proxy; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +public class MainMenuAccountButton extends GuiButton { + private final boolean lIIIIlIIllIIlIIlIIIlIIllI = true; + private final String displayName; + private final ResourceLocation headIcon; + private final Map lIIIIIllllIIIIlIlIIIIlIlI; + private final String clientToken; + + public MainMenuAccountButton(int var1, Map var2, int var3, int var4, int var5, int var6) { + super(var1, var3, var4, var5, var6, (String)var2.get("displayName")); + this.displayName = (String)var2.get("displayName"); + this.clientToken = (String)var2.get("clientToken"); + this.lIIIIIllllIIIIlIlIIIIlIlI = var2; +// this.headIcon = CheatBreaker.getInstance().getHeadIcon(this.displayName, (String)var2.get("uuid")); + this.headIcon = CheatBreaker.getInstance().getHeadIcon(this.displayName); + } + + @Override + public void drawButton(Minecraft var1, int var2, int var3) { + if (this.visible) { + FontRenderer var4 = var1.fontRendererObj; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.hovered = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; + int var5 = this.getHoverState(this.hovered); + if (this.lIIIIlIIllIIlIIlIIIlIIllI) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.hovered ? -15395563 : -14540254); + } + this.mouseDragged(var1, var2, var3); + int var6 = -1; + if (!this.enabled) { + var6 = -986896; + } else if (this.hovered) { + var6 = -3092272; + } + if (this.displayName.length() > 9) { + float var10002 = this.xPosition + this.width / 2 + 12; + float var10003 = this.yPosition + this.height / 2 - (this.lIIIIlIIllIIlIIlIIIlIIllI ? 4 : 3); + CheatBreaker.getInstance().playRegular14px.drawCenteredString(this.displayName, var10002, var10003, var6); + } else { + float var10002 = this.xPosition + this.width / 2 + 12; + float var10003 = this.yPosition + this.height / 2 - (this.lIIIIlIIllIIlIIlIIIlIIllI ? 5 : 4); + CheatBreaker.getInstance().playRegular16px.drawCenteredString(this.displayName, var10002, var10003, var6); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.headIcon, 7.0f, (float)(this.xPosition + 10), (float)(this.yPosition + 5)); + } + } + + /* + * Exception decompiling + */ + public boolean lIIIIlIIllIIlIIlIIIlIIllI() { + if (((String) this.lIIIIIllllIIIIlIlIIIIlIlI.get("uuid")).equalsIgnoreCase(Minecraft.getMinecraft().getSession().getPlayerID())) { + return false; + } else { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + Iterator var1 = CheatBreaker.getInstance().getSessionServers().iterator(); + + while (var1.hasNext()) { + Session session = (Session) var1.next(); + if (session.getProfile().getId().toString().replaceAll("-", "").equalsIgnoreCase(((String) this.lIIIIIllllIIIIlIlIIIIlIlI.get("uuid")).replaceAll("-", ""))) { + Minecraft.getMinecraft().setSession(session); + return true; + } + } + + YggdrasilAuthenticationService var21 = new YggdrasilAuthenticationService(Proxy.NO_PROXY, this.clientToken); + YggdrasilUserAuthentication var22 = (YggdrasilUserAuthentication) var21.createUserAuthentication(Agent.MINECRAFT); + var22.loadFromStorage(this.lIIIIIllllIIIIlIlIIIIlIlI); + + Session var3; + try { + var22.logIn(); + var3 = new Session(var22.getSelectedProfile().getName(), var22.getSelectedProfile().getId().toString(), var22.getAuthenticatedToken(), "mojang"); + } catch (AuthenticationException var18) { + var18.printStackTrace(); + return false; + } + + File var4 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + if (var4.exists() && !var22.getAuthenticatedToken().equals(this.lIIIIIllllIIIIlIlIIIIlIlI.get("accessToken"))) { + try { + FileReader var5 = new FileReader(var4); + JsonParser var6 = new JsonParser(); + JsonElement var7 = var6.parse(var5); + Entry var8 = null; + Iterator var9 = var7.getAsJsonObject().entrySet().iterator(); + + label84: + while (true) { + Entry var10; + do { + if (!var9.hasNext()) { + if (var8 != null) { + this.lIIIIIllllIIIIlIlIIIIlIlI.put("accessToken", var22.getAuthenticatedToken()); + ((JsonElement) var8.getValue()).getAsJsonObject().remove("accessToken"); + ((JsonElement) var8.getValue()).getAsJsonObject().addProperty("accessToken", var22.getAuthenticatedToken()); + System.out.println("Updated accessToken and logged user in."); + } + + Gson var23 = (new GsonBuilder()).setPrettyPrinting().create(); + + try { + DataOutputStream var24 = new DataOutputStream(new FileOutputStream(var4)); + var24.writeBytes(var23.toJson(var7).replace("\n", "\r\n")); + var24.flush(); + var24.close(); + break label84; + } catch (Exception var17) { + var17.printStackTrace(); + return false; + } + } + + var10 = (Entry) var9.next(); + } while (!((String) var10.getKey()).equalsIgnoreCase("authenticationDatabase")); + + Iterator var11 = ((JsonElement) var10.getValue()).getAsJsonObject().entrySet().iterator(); + + label82: + while (var11.hasNext()) { + Entry var12 = (Entry) var11.next(); + Iterator var13 = ((JsonElement) var12.getValue()).getAsJsonObject().entrySet().iterator(); + + while (true) { + Entry var14; + do { + if (!var13.hasNext()) { + continue label82; + } + + var14 = (Entry) var13.next(); + } while (!((String) var14.getKey()).equalsIgnoreCase("profiles")); + + Iterator var15 = ((JsonElement) var14.getValue()).getAsJsonObject().entrySet().iterator(); + + while (var15.hasNext()) { + Entry var16 = (Entry) var15.next(); + if (((String) var16.getKey()).replaceAll("-", "").equalsIgnoreCase(var3.getPlayerID().replaceAll("-", ""))) { + var8 = var12; + } + } + } + } + } + } catch (Exception var19) { + var19.printStackTrace(); + return false; + } + } + +// CheatBreaker.getInstance().getSession().add(var3); + Minecraft.getMinecraft().setSession(var3); + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuButton.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuButton.java new file mode 100644 index 0000000..6289a5c --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuButton.java @@ -0,0 +1,46 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +public class MainMenuButton extends GuiButton { + private boolean drawButton = true; + + public MainMenuButton(int n, int n2, int n3, int n4, int n5, String string, boolean bl) { + this(n, n2, n3, n4, n5, string); + this.drawButton = bl; + } + + public MainMenuButton(int n, int n2, int n3, int n4, int n5, String string) { + super(n, n2, n3, n4, n5, string); + } + + @Override + public void drawButton(Minecraft mc, int n, int n2) { + if (this.visible) { + FontRenderer fontRenderer = mc.fontRendererObj; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.hovered = n >= this.xPosition && n2 >= this.yPosition && n < + this.xPosition + this.width && n2 < this.yPosition + this.height; + int n3 = this.getHoverState(this.hovered); + if (this.drawButton) { + Gui.drawRect(this.xPosition, this.yPosition, + this.xPosition + this.width, this.yPosition + + this.height, this.hovered ? -15395563 : -14540254); + } + this.mouseDragged(mc, n, n2); + int n4 = -3092272; + if (!this.enabled) { + n4 = -986896; + } else if (this.hovered) { + n4 = -1; + } + CheatBreaker.getInstance().playRegular16px.drawCenteredString(this.displayString, this.xPosition + + this.width / 2F, this.yPosition + this.height / 2F - (this.drawButton ? 5 : 4), n4); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuCosmeticsMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuCosmeticsMenu.java new file mode 100644 index 0000000..b7db009 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuCosmeticsMenu.java @@ -0,0 +1,90 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.ui.mainmenu.cosmetics.element.CosmeticElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class MainMenuCosmeticsMenu extends GuiMainMenu { + private final List cosmetics = new ArrayList(); + private final ResourceLocation lastMouseEvent = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation field_146298_h = new ResourceLocation("client/icons/right.png"); + private int IIIIllIIllIIIIllIllIIIlIl = 0; + + public MainMenuCosmeticsMenu() { + for (Cosmetic cosmetic : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + this.cosmetics.add(new CosmeticElement(cosmetic, 1.0f)); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + if (!CheatBreaker.getInstance().getWsNetHandler().isOpen()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Unable to connect to the server.", this.width / 2F, this.height / 2F - 10, -1); + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Please try again later.", this.width / 2F, this.height / 2F + 4, -1); + } else { + RenderUtil.drawRoundedRect(this.width / 2F - 80, this.height / 2F - 78, this.width / 2F + 80, this.height / 2F + 100, 14, -1342177281); + if (this.cosmetics.isEmpty()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredString("You don't own any cosmetics.", this.width / 2F, this.height / 2F + 4, -6381922); + } else { + CheatBreaker.getInstance().playBold18px.drawCenteredString("Cosmetics (" + this.cosmetics.size() + ")", this.width / 2F, this.height / 2F - 90, -1); + + int n3 = 0; + float f6 = 0.0f; + for (Object cosmeticListElementObj : this.cosmetics) { + CosmeticElement cosmeticListElement = (CosmeticElement) cosmeticListElementObj; + if (++n3 - 1 < this.IIIIllIIllIIIIllIllIIIlIl * 5 || n3 - 1 >= (this.IIIIllIIllIIIIllIllIIIlIl + 1) * 5) + continue; + + cosmeticListElement.setDimensions(this.width / 2 - 76, (int) ((float) (this.height / 2 - 72) + f6), 152, cosmeticListElement.getHeight()); + cosmeticListElement.handleDrawElement(mouseX, mouseY, partialTicks); + f6 += (float) cosmeticListElement.getHeight(); + } + + if (this.cosmetics.size() > 5) { + boolean bl = mouseX > this.width / 2 - 40 && mouseX < this.width / 2 - 1 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100; + GL11.glColor4f(0.0f, 0.0f, 0.0f, bl ? 0.20624998f * 2.1818182f : 7.111111f * 0.03515625f); + RenderUtil.renderIcon(this.lastMouseEvent, (float) 4, (float) (this.width / 2 - 10), (float) (this.height / 2 + 84)); + boolean bl2 = mouseX > this.width / 2 + 1 && mouseX < this.width / 2 + 40 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100; + GL11.glColor4f(0.0f, 0.0f, 0.0f, bl2 ? 0.6042857f * 0.7446808f : 0.041666668f * 6.0f); + RenderUtil.renderIcon(this.field_146298_h, (float) 4, (float) (this.width / 2 + 10), (float) (this.height / 2 + 84)); + } + } + } +// this.lIIIIIIIIIlIllIIllIlIIlIl(mouseX, mouseY); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + int n4; + super.mouseClicked(mouseX, mouseY, mouseButton); + if (this.cosmetics.size() > 5) { + boolean bl; + n4 = mouseX > this.width / 2 - 40 && mouseX < this.width / 2 - 1 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100 ? 1 : 0; + boolean bl2 = bl = mouseX > this.width / 2 + 1 && mouseX < this.width / 2 + 40 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100; + if (this.IIIIllIIllIIIIllIllIIIlIl > 0 && n4 != 0) { + --this.IIIIllIIllIIIIllIllIIIlIl; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl && (float) (this.IIIIllIIllIIIIllIllIIIlIl + 1) < (float) this.cosmetics.size() / (float) 5) { + ++this.IIIIllIIllIIIIllIllIIIlIl; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + } + n4 = 0; + for (Object cosmeticListElement : this.cosmetics) { + if (++n4 - 1 < this.IIIIllIIllIIIIllIllIIIlIl * 5 || n4 - 1 >= (this.IIIIllIIllIIIIllIllIIIlIl + 1) * 5) + continue; + ((CosmeticElement) cosmeticListElement).handleMouseClick(mouseX, mouseY, mouseButton); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/GuiCosmetics.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/GuiCosmetics.java new file mode 100644 index 0000000..48f3e57 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/GuiCosmetics.java @@ -0,0 +1,95 @@ +package com.cheatbreaker.client.ui.mainmenu.cosmetics; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.mainmenu.cosmetics.element.CosmeticElement; +import com.cheatbreaker.client.ui.mainmenu.menus.MainMenu; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +public class GuiCosmetics extends MainMenuBase { + private final List cosmeticList = new ArrayList<>(); + private final ResourceLocation leftArrowIcon = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation rightArrowIcon = new ResourceLocation("client/icons/right.png"); + private final GradientTextButton backButton = new GradientTextButton("BACK"); + private int parsedCosmetics = 0; + + public GuiCosmetics() { + for (Cosmetic cosmetic : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + this.cosmeticList.add(new CosmeticElement(cosmetic, 1.0f)); + } + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + if (!CheatBreaker.getInstance().getWsNetHandler().isOpen()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Unable to connect to the server.", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f - 10.0f, -1); + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Please try again later.", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f, -1); + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() / 2.0f + 28.0f, 60.0f, 12.0f); + this.backButton.drawElementHover(x, y, true); + } else { + Gui.drawRect(this.getScaledWidth() / 2.0f - 80.0f, this.getScaledHeight() / 2.0f - 78.0f, this.getScaledWidth() / 2.0f + 80.0f, this.getScaledHeight() / 2.0f + 100.0f, 0x2F000000); + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() / 2.0f + 105.0f, 60.0f, 12.0f); + this.backButton.drawElementHover(x, y, true); + if (this.cosmeticList.isEmpty()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredString("You don't own any cosmetics.", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f, -6381922); + } else { + CheatBreaker.getInstance().playBold18px.drawCenteredString("Cosmetics (" + this.cosmeticList.size() + ")", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f - 90.0f, -1); + int var7 = 0; + float var8 = 0.0f; + for (CosmeticElement cosmetic : this.cosmeticList) { + if (++var7 - 1 < this.parsedCosmetics * 5 || var7 - 1 >= (this.parsedCosmetics + 1) * 5) continue; + cosmetic.setDimensions((int) this.getScaledWidth() / 2 - 76, (int) (this.getScaledHeight() + / 2.0f - 72.0f + var8), 152, cosmetic.getHeight()); + cosmetic.handleDrawElement((int) x, (int) y, 1.0f); + var8 += (float) cosmetic.getHeight(); + } + if (this.cosmeticList.size() > 5) { + boolean var11 = x > this.getScaledWidth() / 2.0f - 40.0f && x < this.getScaledWidth() / 2.0f - 1.0f && y > this.getScaledHeight() / 2.0f + 80.0f && y < this.getScaledHeight() / 2.0f + 100.0f; + GL11.glColor4f(0.0f, 0.0f, 0.0f, var11 ? 0.45f : 0.25f); + RenderUtil.renderIcon(this.leftArrowIcon, 4.0f, this.getScaledWidth() / 2.0f - 10.0f, this.getScaledHeight() / 2.0f + 84.0f); + boolean var12 = x > this.getScaledWidth() / 2.0f + 1.0f && x < this.getScaledWidth() / 2.0f + 40.0f && y > this.getScaledHeight() / 2.0f + 80.0f && y < this.getScaledHeight() / 2.0f + 100.0f; + GL11.glColor4f(0.0f, 0.0f, 0.0f, var12 ? 0.45f : 0.25f); + RenderUtil.renderIcon(this.rightArrowIcon, 4.0f, this.getScaledWidth() / 2.0f + 10.0f, this.getScaledHeight() / 2.0f + 84.0f); + } + } + } + } + + @Override + public void mouseClicked(float var1, float var2, int var3) { + super.mouseClicked(var1, var2, var3); + if (this.backButton.isMouseInside(var1, var2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } else { + if (this.cosmeticList.size() > 5) { + boolean var5; + boolean var4 = var1 > this.getScaledWidth() / 2.0f - 40.0f && var1 < this.getScaledWidth() / 2.0f - 1.0f && var2 > this.getScaledHeight() / 2.0f + 80.0f && var2 < this.getScaledHeight() / 2.0f + 100.0f; + boolean bl = var5 = var1 > this.getScaledWidth() / 2.0f + 1.0f && var1 < this.getScaledWidth() / 2.0f + 40.0f && var2 > this.getScaledHeight() / 2.0f + 80.0f && var2 < this.getScaledHeight() / 2.0f + 100.0f; + if (this.parsedCosmetics > 0 && var4) { + --this.parsedCosmetics; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (var5 && (float) (this.parsedCosmetics + 1) < (float) this.cosmeticList.size() / 5.0f) { + ++this.parsedCosmetics; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + } + int var7 = 0; + for (CosmeticElement var6 : this.cosmeticList) { + if (++var7 - 1 < this.parsedCosmetics * 5 || var7 - 1 >= (this.parsedCosmetics + 1) * 5) continue; + var6.handleMouseClick((int) var1, (int) var2, var3); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/element/CosmeticElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/element/CosmeticElement.java new file mode 100644 index 0000000..5606a90 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/element/CosmeticElement.java @@ -0,0 +1,80 @@ +package com.cheatbreaker.client.ui.mainmenu.cosmetics.element; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class CosmeticElement extends AbstractModulesGuiElement { + private final Cosmetic cosmetic; + + public CosmeticElement(Cosmetic var1, float var2) { + super(var2); + this.height = 30; + this.cosmetic = var1; + } + + @Override + public void handleDrawElement(int mouseX, int var2, float partialTicks) { + boolean hovered = mouseX > this.x && mouseX < this.x + this.width && var2 > this.y && var2 < this.y + this.height; + if (hovered) { + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, 0x2F000000); + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + if (this.cosmetic.getType().getTypeName().equals("cape")) { + Minecraft.getMinecraft().renderEngine.bindTexture(this.cosmetic.getLocation()); + GL11.glPushMatrix(); + GL11.glTranslatef(this.x + 20, this.y + 7, 0.0f); + GL11.glScalef(0.25f, 0.13f, 0.25f); + RenderUtil.drawTexturedModalRect(0.0f, 0.0f, 2.0f, 7.0f, 44, 120); + GL11.glPopMatrix(); + } else { + try { + RenderUtil.renderIcon(this.cosmetic.getPreviewLocation(), 8.0f, (float) (this.x + 20), (float) (this.y + 7)); + } catch (Exception ignored) {} + } + + CheatBreaker.getInstance().playRegular16px.drawString(this.cosmetic.getName().replace("_", " "), this.x + 42, (float) (this.y + this.height / 2 - 5), -1342177281); + if (this.cosmetic.isEquipped()) { + GL11.glColor4f(0.0f, 0.8f, 0.0f, 0.45f); + } else { + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.25f); + } + + RenderUtil.drawCircle(this.x + 8, this.y + this.height / 2F, 3.0); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean mouseHovered = mouseX > this.x && mouseX < this.x + this.width && mouseY > this.y && mouseY < this.y + this.height; + if (mouseHovered) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + if (this.cosmetic.isEquipped()) { + this.cosmetic.setEquipped(false); + } else if (this.cosmetic.getType() == Cosmetic.CosmeticType.CAPE) { + this.cosmetic.setEquipped(true); + for (Cosmetic var6 : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + if (var6 == this.cosmetic || !var6.getType().equals(Cosmetic.CosmeticType.CAPE)) continue; + var6.setEquipped(false); + } + this.cosmetic.setEquipped(true); + } else { + this.cosmetic.setEquipped(true); + for (Cosmetic var6 : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + if (var6 == this.cosmetic || var6.getType() == Cosmetic.CosmeticType.CAPE) continue; + var6.setEquipped(false); + } + this.cosmetic.setEquipped(true); + } + + CheatBreaker.getInstance().getWsNetHandler().sendClientCosmetics(); + } + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/IconButtonElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/IconButtonElement.java new file mode 100644 index 0000000..7d23441 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/IconButtonElement.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.ui.mainmenu.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class IconButtonElement extends AbstractElement { + private ResourceLocation resourceLocation; + private String string; + private boolean isString; + private final ColorFade outline; + private final ColorFade topGradient; + private final ColorFade bottomGradient; + private float iconSize = 4; + + public IconButtonElement(ResourceLocation resourceLocation) { + this.resourceLocation = resourceLocation; + this.iconSize = 4; + this.outline = new ColorFade(0x4FFFFFFF, -1353670564); + this.topGradient = new ColorFade(444958085, 1063565678); + this.bottomGradient = new ColorFade(444958085, 1062577506); + } + + public IconButtonElement(float iconSize, ResourceLocation resourceLocation) { + this.resourceLocation = resourceLocation; + this.iconSize = iconSize; + this.outline = new ColorFade(0x4FFFFFFF, -1353670564); + this.topGradient = new ColorFade(444958085, 1063565678); + this.bottomGradient = new ColorFade(444958085, 1062577506); + } + + public IconButtonElement(String string) { + this.string = string; + this.isString = true; + this.outline = new ColorFade(0x4FFFFFFF, -1353670564); + this.topGradient = new ColorFade(444958085, 1063565678); + this.bottomGradient = new ColorFade(444958085, 1062577506); + } + + @Override + protected void handleElementDraw(float mouseX, float mouseY, boolean bl) { + boolean hovering = bl && this.isMouseInside(mouseX, mouseY); + RenderUtil.drawGradientRectWithOutline(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.outline.getColor(hovering).getRGB(), this.topGradient.getColor(hovering).getRGB(), this.bottomGradient.getColor(hovering).getRGB()); + if (this.isString) { + CheatBreaker.getInstance().robotoRegular13px.drawCenteredString(this.string, this.xPosition + this.width / 2.0f, this.yPosition + 2.0f, -1); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.4444444f * 0.5538462f); + RenderUtil.renderIcon(this.resourceLocation, this.iconSize, this.xPosition + this.width / 2.0f - this.iconSize, this.yPosition + this.height / 2.0f - this.iconSize); + } + } + + public float getLongerTextWidth() { + return 22 + CheatBreaker.getInstance().robotoRegular13px.getStringWidth(this.string) + 6; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } + + public void setResourceLocation(ResourceLocation resourceLocation) { + this.resourceLocation = resourceLocation; + } + + public void setString(String string) { + this.string = string; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextButtonElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextButtonElement.java new file mode 100644 index 0000000..5df74ca --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextButtonElement.java @@ -0,0 +1,22 @@ +package com.cheatbreaker.client.ui.mainmenu.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import lombok.Getter; + +@Getter +public class TextButtonElement extends AbstractElement { + private final String string; + private final ColorFade color; + + public TextButtonElement(String string) { + this.string = string; + this.color = new ColorFade(-1879048193, -1); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + CheatBreaker.getInstance().robotoBold14px.drawString(this.string, this.xPosition + 6.0F, this.yPosition + (float) 6, this.color.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextWithShadowButton.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextWithShadowButton.java new file mode 100644 index 0000000..8f51332 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextWithShadowButton.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.ui.mainmenu.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.util.lang.WordWrap; + +public class TextWithShadowButton extends AbstractElement { + private final String string; + private final ColorFade color; + private boolean multipleLines = false; + private int maxStringWidth; + + public TextWithShadowButton(String string) { + this.string = string; + this.color = new ColorFade(-1879048193, 0xCFEEEEEE); + } + + public TextWithShadowButton(String string, int maxStringWidth) { + this(string); + this.multipleLines = true; + this.maxStringWidth = maxStringWidth; + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + if (this.multipleLines) { + String wrapped = WordWrap.from(this.string).maxWidth(50).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + for(String line : lines) { + CheatBreaker.getInstance().playRegular14px.drawStringWithShadow(line, this.xPosition, this.yPosition - CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f + (index * CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f), this.color.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + index++; + } + } else { + CheatBreaker.getInstance().playRegular18px.drawStringWithShadow(this.string, this.xPosition, this.yPosition, this.color.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + } + + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/BuildMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/BuildMenu.java new file mode 100644 index 0000000..186d178 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/BuildMenu.java @@ -0,0 +1,59 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.util.lang.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class BuildMenu extends MainMenuBase { + private final GradientTextButton backButton = new GradientTextButton("BACK"); + + @Override + public void initGui() { + super.initGui(); + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() / 2.0f + 55.0f, 60.0f, 12.0f); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + Gui.drawRect(this.getScaledWidth() / 2.0f - 80.0f, this.getScaledHeight() / 2.0f - 40.0f, this.getScaledWidth() / 2.0f + 80.0f, this.getScaledHeight() / 2.0f + 50.0f, 0x2F000000); + this.backButton.drawElementHover(x, y, true); + String buildInfo = ""; + switch (CheatBreaker.getInstance().getGitBuildVersion()) { + case "Dev": + buildInfo = "Development builds are not intended for bug testing purposes; however, expect bugs to appear."; + break; + case "Beta": + buildInfo = "Beta builds are used to test for potential issues. Expect bugs to occur over time."; + break; + case "Preview": + buildInfo = "Preview builds are intended to become the next stable build. Bugs should be less prominent."; + break; + } + String buildType = CheatBreaker.getInstance().getGitBuildVersion().isEmpty() ? "Production" : CheatBreaker.getInstance().getGitBuildVersion(); + String wrapped = WordWrap.from(buildInfo).maxWidth(40).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + for (String line : lines) { + CheatBreaker.getInstance().playRegular14px.drawCenteredString(line, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 14.0f + (index * CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f), 0xFFDDDDDD); + index++; + } + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Commit: " + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch(), this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 14.0f - (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), 0xFFEEEEEE); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Minecraft Version: " + Config.MC_VERSION, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f - 6.0f - (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), 0xFFEEEEEE); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Build Version: " + buildType, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f - (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), 0xFFEEEEEE); + } + + public void mouseClicked(float var1, float var2, int var3) { + super.mouseClicked(var1, var2, var3); + if (this.backButton.isMouseInside(var1, var2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/CBOldMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/CBOldMenu.java new file mode 100644 index 0000000..d22822a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/CBOldMenu.java @@ -0,0 +1,82 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + + +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + + +public class CBOldMenu extends GuiMainMenu { + private double eventButton; + private float lastMouseEvent = 0.0f; + private final ResourceLocation logoOuter = new ResourceLocation("client/logo_outer.png"); + private final ResourceLocation logoInner = new ResourceLocation("client/logo_inner.png"); + + @Override + public void initGui() { + int n = this.height / 4 + 48; + this.addSingleplayerMultiplayerButtons(n, 24); + super.initGui(); + } + + @Override + public void updateScreen() { + super.updateScreen(); + this.eventButton += 0.06283185307179587; + this.lastMouseEvent = (float) ((Math.sin(this.eventButton) / 2.0 + 0.5) * 180.0); + } + + @Override + protected void keyTyped(char c, int n) throws IOException { + + if (n == 1 && Minecraft.getMinecraft().currentScreen instanceof CBOldMenu) { + return; + } + + super.keyTyped(c, n); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); +// Tessellator tessellator = Tessellator.instance; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0f, 20, 0.0f); + Gui.drawRect(this.width / 2F - 71, this.height / 4F - 40, this.width / 2F + 71, this.height / 4F + 110, -1342177281); + Gui.drawRect(this.width / 2F - 73, this.height / 4F - 42, this.width / 2F - 71, this.height / 4F + 112, 0x3FFFFFFF); + Gui.drawRect(this.width / 2F + 71, this.height / 4F - 42, this.width / 2F + 73, this.height / 4F + 112, 0x3FFFFFFF); + Gui.drawRect(this.width / 2F - 71, this.height / 4F + 110, this.width / 2F + 71, this.height / 4F + 112, 0x3FFFFFFF); + Gui.drawRect(this.width / 2F - 71, this.height / 4F - 42, this.width / 2F + 71, this.height / 4F - 40, 0x3FFFFFFF); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.9f); + GL11.glPushMatrix(); + float f2 = 0.8648649f * 0.7515625f; + GL11.glScalef(f2, f2, f2); + GL11.glPushMatrix(); + GL11.glTranslatef(((float) (this.width / 2) - 40.0F * f2) / f2, ((float) (this.height / 4) - 40.0F * f2) / f2, 0.0f); + int n3 = 40; + GL11.glTranslatef(n3, n3, n3); + GL11.glRotatef(this.lastMouseEvent, 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-n3, -n3, -n3); + RenderUtil.renderIcon(this.logoOuter, (float) n3, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderIcon(this.logoInner, 40.0F, ((float) (this.width / 2) - 40.0F * f2) / f2, ((float) (this.height / 4) - 39.0F * f2) / f2); + GL11.glPopMatrix(); + GL11.glPopMatrix(); +// tessellator.setColorOpaque_I(-1); + super.lIIIIIIIIIlIllIIllIlIIlIl(mouseX, mouseY); + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + if (mouseX >= 7 && mouseX <= 39 && mouseY >= 5 && mouseY <= 20) { + MainMenuBase.switchMenu(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogDetailMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogDetailMenu.java new file mode 100644 index 0000000..bf009de --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogDetailMenu.java @@ -0,0 +1,96 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.lang.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class ChangelogDetailMenu extends MainMenuBase { + private final String title; + private final String author; + private final String description; + + private final GradientTextButton backButton; + private final ScrollableElement scrollableElement; + + public ChangelogDetailMenu(String title, String author, String description) { + this.title = title; + this.author = author; + this.description = description; + + this.backButton = new GradientTextButton("BACK"); + this.scrollableElement = new ScrollableElement(null); + } + + @Override + public void initGui() { + super.initGui(); + float f = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f3 = this.getScaledWidth() / 2.0f + f / 2.0f; + float f4 = 40; + float f5 = this.getScaledHeight() - 40.0f; + this.scrollableElement.setElementSize(f3 - 8.0f, f4 + 18.0f, 4.0f, f5 - f4 - 28.0f); + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.scrollableElement.handleElementMouse(); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + float f3 = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float leftPos = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float rightPos = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float topPos = 40; + float bottomPos = this.getScaledHeight() - 40.0f; + Gui.drawRect(leftPos, topPos, rightPos, bottomPos, 0x2F000000); + Gui.drawRect(leftPos + 8.0F, topPos + 22F, rightPos - 8.0F, topPos + 22.5F, 0x1AFFFFFF); + + CheatBreaker.getInstance().playRegular16px.drawString(this.title, leftPos + 8.0f, topPos + 5.0f, -1); + CheatBreaker.getInstance().playRegular14px.drawString(EnumChatFormatting.ITALIC + "Posted by " + EnumChatFormatting.BOLD + this.author, leftPos + 8.0f, topPos + 13.0f, -1); + String wrapped = WordWrap.from(this.description).maxWidth(60).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + + int index = 0; + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() - 35.0f, 60.0f, 12); + this.backButton.drawElementHover(x, y, true); + this.scrollableElement.drawScrollable(x, y, true); + GL11.glPushMatrix(); + GL11.glEnable(3089); + + RenderUtil.startScissorBox((int) leftPos, (int) topPos + 18, (int) rightPos, (int) bottomPos - 8, (float) ((int) ((float) this.getScaledResolution().getScaleFactor() * this.getScaleFactor())), (int) this.getScaledHeight()); + for (String line : lines) { + CheatBreaker.getInstance().playRegular14px.drawString(line, leftPos + 8.0f, topPos + 24.0f + (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), -1); + index++; + } + + this.scrollableElement.setScrollAmount(index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f) + 2.0f); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.drawElementHover(x, y, true); + } + + @Override + public void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + if (this.backButton.isMouseInside(f, f2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(CheatBreaker.getInstance().lastScreen); + } else if (this.scrollableElement.isMouseInside(f, f2)) { + this.scrollableElement.handleElementMouseClicked(f, f2, n, true); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogMenu.java new file mode 100644 index 0000000..f9d7a66 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogMenu.java @@ -0,0 +1,127 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.mainmenu.buttons.ChangeLogButton; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import lombok.SneakyThrows; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class ChangelogMenu extends MainMenuBase { + private final GradientTextButton backButton; + private final ScrollableElement scrollableElement; + private final List changeLogButtonList = new ArrayList<>(); + public static JsonObject changelogObject; + + public ChangelogMenu() { + this.backButton = new GradientTextButton("BACK"); + this.scrollableElement = new ScrollableElement(null); + this.loadChangelog(); + } + + @Override + public void initGui() { + super.initGui(); + float f = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f2 = this.getScaledWidth() / 2.0f - f / 2.0f; + float f3 = this.getScaledWidth() / 2.0f + f / 2.0f; + float f4 = 40; + float f5 = this.getScaledHeight() - 40.0f; + this.scrollableElement.setElementSize(f3 - 8.0f, f4 + 18.0f, 4.0f, f5 - f4 - 28.0f); + int n = 0; + float f6 = 22; + for (ChangeLogButton button : this.changeLogButtonList) { + button.setElementSize(f2 + 8.0f, f4 + 20.0f + (float) n * (f6 + 1.0f), f - 16.0f, f6); + ++n; + } + this.scrollableElement.setScrollAmount((float) this.changeLogButtonList.size() * (f6 + 1.0f) + 2.0f); + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.scrollableElement.handleElementMouse(); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + float f3 = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f4 = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float f5 = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float f6 = 40; + float f7 = this.getScaledHeight() - 40.0f; + Gui.drawRect(f4, f6, f5, f7, 0x2F000000); + Gui.drawRect(f4 + 8.0f, f6 + 16.0f, f5 - 8.0f, f6 + 0.15789473f * 104.50001f, 0x1AFFFFFF); + CheatBreaker.getInstance().playRegular16px.drawString("CHANGELOG", f4 + 8.0f, f6 + 5.0f, -1); + if (this.changeLogButtonList.size() < 1) { + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Nothing has changed in the client, that's odd!", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f, -6381922); + } + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() - 35.0f, 60.0f, 12); + this.backButton.drawElementHover(x, y, true); + this.scrollableElement.drawScrollable(x, y, true); + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int) f4, (int) f6 + 18, (int) f5, (int) f7 - 8, (float) ((int) ((float) this.getScaledResolution().getScaleFactor() * this.getScaleFactor())), (int) this.getScaledHeight()); + for (ChangeLogButton changeLogButton : this.changeLogButtonList) { + changeLogButton.drawElementHover(x, y - this.scrollableElement.getPosition(), !this.scrollableElement.isButtonHeld()); + } + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.drawElementHover(x, y, true); + } + + @Override + public void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + if (this.backButton.isMouseInside(f, f2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } else if (this.scrollableElement.isMouseInside(f, f2)) { + this.scrollableElement.handleElementMouseClicked(f, f2, n, true); + } else { + float f3 = Math.min((float) 240, this.getScaledWidth() - (float) 10); + float f4 = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float f5 = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float f6 = 40; + float f7 = this.getScaledHeight() - (float) 40; + if (f > f4 && f < f5 && f2 > f6 && f2 < f7) { + for (ChangeLogButton button : this.changeLogButtonList) { + button.handleElementMouseClicked(f, f2 - this.scrollableElement.getPosition(), n, button.isMouseInside(f, f2 - this.scrollableElement.getPosition()) && !this.scrollableElement.isButtonHeld()); + } + } + } + } + + @SneakyThrows + private void loadChangelog() { + String branchToCheck = CheatBreaker.getInstance().getGitBranch(); + if (changelogObject.toString().contains("\"?\"") && CheatBreaker.getInstance().getGitBranch().equalsIgnoreCase("dev")) { + branchToCheck = "?"; + } else if (changelogObject == null || !changelogObject.toString().contains("\"" + CheatBreaker.getInstance().getGitBranch() + "\"")) return; + + Set> entries = changelogObject.getAsJsonObject(branchToCheck).entrySet(); + for (Map.Entry changelog : entries) { + JsonObject changelogObject = changelog.getValue().getAsJsonObject(); + String title = changelog.getKey(); + String author = changelogObject.get("author").getAsString(); + String description = changelogObject.get("description").getAsString(); + + this.changeLogButtonList.add(new ChangeLogButton(title, author, description)); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ConfidentialBuildNoticeMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ConfidentialBuildNoticeMenu.java new file mode 100644 index 0000000..bca77db --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ConfidentialBuildNoticeMenu.java @@ -0,0 +1,99 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.lang.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class ConfidentialBuildNoticeMenu extends MainMenuBase { + private final GradientTextButton backButton; + private final ScrollableElement scrollableElement; + private final boolean skipFirstLine = false; + + public ConfidentialBuildNoticeMenu() { + this.backButton = new GradientTextButton("BACK"); + this.scrollableElement = new ScrollableElement(null); + } + + @Override + public void initGui() { + super.initGui(); + float f = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f3 = this.getScaledWidth() / 2.0f + f / 2.0f; + float f4 = 40; + float f5 = this.getScaledHeight() - 40.0f; + this.scrollableElement.setElementSize(f3 - 8.0f, f4 + 18.0f, 4.0f, f5 - f4 - 28.0f); + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.scrollableElement.handleElementMouse(); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + float f3 = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float leftPos = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float rightPos = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float topPos = 40; + float bottomPos = this.getScaledHeight() - 40.0f; + Gui.drawRect(leftPos, topPos, rightPos, bottomPos, 0x2F000000); + Gui.drawRect(leftPos + 8.0f, topPos + 16.0f, rightPos - 8.0f, topPos + 0.15789473f * 104.50001f, 0x1AFFFFFF); + String title = "About confidential builds"; + CheatBreaker.getInstance().playRegular16px.drawString(title.toUpperCase(), leftPos + 8.0f, topPos + 5.0f, -1); + String description = "PLEASE READ THIS SECTION CAREFULLY." + + "\n\n" + + "You are currently using a private CheatBreaker build. Private builds have certain restrictions in place which are described below:" + + "\n\n" + + "Branch " + CheatBreaker.getInstance().getGitBranch() + " restrictions:" + + "\n- Disclosure to any user below the lowest authorized ranking is prohibited. This includes but is not limited to new changes inside the build such as new features, fixes, and improvements." + + "\n- Recording/streaming on this build is not recommended, but allowed to a certain extent. If any capturing software is showing this build, do not show any changes from this build that differ from the master branch. If, however, you are recording to submit a bug report, these restrictions do not apply." + + "\n\n" + + "Management reserves the rights to restrict your access to future builds if you violate any restrictions applied."; + String wrapped = WordWrap.from(description).maxWidth(60).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + int currentLine = 0; + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() - 35.0f, 60.0f, 12); + this.backButton.drawElementHover(x, y, true); + this.scrollableElement.drawScrollable(x, y, true); + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int)leftPos, (int)topPos + 18, (int)rightPos, (int)bottomPos - 8, (float)((int)((float)this.getScaledResolution().getScaleFactor() * this.getScaleFactor())), (int)this.getScaledHeight()); + for (String line : lines) { + if (this.skipFirstLine && currentLine == 0) { + currentLine++; + continue; + } + CheatBreaker.getInstance().playRegular14px.drawString(line, leftPos + 8.0f, topPos + 18.0f + (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), -1); + index++; + } + this.scrollableElement.setScrollAmount(index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f) + 2.0f); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.drawElementHover(x, y, true); + } + + @Override + public void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + if (this.backButton.isMouseInside(f, f2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } else if (this.scrollableElement.isMouseInside(f, f2)) { + this.scrollableElement.handleElementMouseClicked(f, f2, n, true); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/GuiCreditsMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/GuiCreditsMenu.java new file mode 100644 index 0000000..a5e4e89 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/GuiCreditsMenu.java @@ -0,0 +1,172 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +public class GuiCreditsMenu extends GuiScreen { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146576_f = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation field_146577_g = new ResourceLocation("textures/misc/vignette.png"); + private int field_146581_h; + private List field_146582_i; + private int field_146579_r; + private final float field_146578_s = 0.5F; + + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + ++this.field_146581_h; + float var1 = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + + if ((float)this.field_146581_h > var1) { + this.func_146574_g(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (p_73869_2_ == 1) { + this.func_146574_g(); + } + } + + private void func_146574_g() { + this.mc.displayGuiScreen(CheatBreaker.getInstance().lastScreen); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + if (this.field_146582_i == null) { + this.field_146582_i = new ArrayList(); + + try { + String var1; + short var3 = 274; + + BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); + + while ((var1 = var4.readLine()) != null) { + var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); + var1 = var1.replaceAll("\t", " "); + this.field_146582_i.addAll(this.mc.fontRendererObj.listFormattedStringToWidth(var1, var3)); + this.field_146582_i.add(""); + } + + this.field_146579_r = this.field_146582_i.size() * 12; + } catch (Exception var9) { + logger.error("Couldn't load credits", var9); + } + } + } + + private void func_146575_b(int p_146575_1_, int p_146575_2_, float p_146575_3_) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + int i = this.width; + float f = 0.0F - ((float) this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float f1 = (float) this.height - ((float) this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float f2 = 0.015625F; + float f3 = ((float) this.field_146581_h + p_146575_3_ - 0.0F) * 0.02F; + float f4 = (float) (this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + float f5 = (f4 - 20.0F - ((float) this.field_146581_h + p_146575_3_)) * 0.005F; + + if (f5 < f3) { + f3 = f5; + } + + if (f3 > 1.0F) { + f3 = 1.0F; + } + + f3 = f3 * f3; + f3 = f3 * 96.0F / 255.0F; + worldrenderer.pos(0.0D, (double) this.height, (double) this.zLevel).tex(0.0D, (double) (f * f2)).color(f3, f3, f3, 1.0F).endVertex(); + worldrenderer.pos((double) i, (double) this.height, (double) this.zLevel).tex((double) ((float) i * f2), (double) (f * f2)).color(f3, f3, f3, 1.0F).endVertex(); + worldrenderer.pos((double) i, 0.0D, (double) this.zLevel).tex((double) ((float) i * f2), (double) (f1 * f2)).color(f3, f3, f3, 1.0F).endVertex(); + worldrenderer.pos(0.0D, 0.0D, (double) this.zLevel).tex(0.0D, (double) (f1 * f2)).color(f3, f3, f3, 1.0F).endVertex(); + tessellator.draw(); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.func_146575_b(p_73863_1_, p_73863_2_, p_73863_3_); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + short var5 = 274; + int var6 = this.width / 2 - var5 / 2; + int var7 = this.height + 50; + float var8 = -((float)this.field_146581_h + p_73863_3_) * this.field_146578_s; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, var8, 0.0F); + this.mc.getTextureManager().bindTexture(field_146576_f); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + drawTexturedModalRect(var6, var7, 0, 0, 155, 44); + drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44); + GL11.glDisable(GL11.GL_ALPHA_TEST); + int var9 = var7 + 200; + int var10; + + for (var10 = 0; var10 < this.field_146582_i.size(); ++var10) { + if (var10 == this.field_146582_i.size() - 1) { + float var11 = (float)var9 + var8 - (float)(this.height / 2 - 6); + + if (var11 < 0.0F) { + GL11.glTranslatef(0.0F, -var11, 0.0F); + } + } + + if ((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) { + String var12 = (String)this.field_146582_i.get(var10); + + if (var12.startsWith("[C]")) { + this.fontRendererObj.drawStringWithShadow(var12.substring(3), var6 + (var5 - this.fontRendererObj.getStringWidth(var12.substring(3))) / 2, var9, 16777215); + } else { + this.fontRendererObj.fontRandom.setSeed((long)var10 * 4238972211L + (long)(this.field_146581_h / 4)); + this.fontRendererObj.drawStringWithShadow(var12, var6, var9, 16777215); + } + } + + var9 += 12; + } + + GL11.glPopMatrix(); + this.mc.getTextureManager().bindTexture(field_146577_g); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); + int j1 = this.width; + int k1 = this.height; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double)k1, (double)this.zLevel).tex(0.0D, 1.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos((double)j1, (double)k1, (double)this.zLevel).tex(1.0D, 1.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos((double)j1, 0.0D, (double)this.zLevel).tex(1.0D, 0.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos(0.0D, 0.0D, (double)this.zLevel).tex(0.0D, 0.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/MainMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/MainMenu.java new file mode 100644 index 0000000..0c8790e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/MainMenu.java @@ -0,0 +1,110 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiMultiplayer; +import net.minecraft.client.gui.GuiSelectWorld; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.IOException; + +public class MainMenu extends MainMenuBase { + private final ResourceLocation outerLogo = new ResourceLocation("client/logo_255_outer.png"); + private final ResourceLocation innerLogo = new ResourceLocation("client/logo_108_inner.png"); + private final GradientTextButton singleplayerButton = new GradientTextButton("SINGLEPLAYER"); + private final GradientTextButton multiplayerButton = new GradientTextButton("MULTIPLAYER"); + private final MinMaxFade logoMoveUpTime = new MinMaxFade(750L); + private final CosineFade outerLogoRotationTime = new CosineFade(4000L); + private final MinMaxFade backgroundFadeOutTime = new MinMaxFade(400L); + public static int menuCounter; + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + } + + @Override + public void updateScreen() { + super.updateScreen(); + if (this.isFromLoadingScreen() && !this.logoMoveUpTime.isTimeNotAtZero()) { + this.logoMoveUpTime.startAnimation(); + } + if (!(this.isFromLoadingScreen() && !this.logoMoveUpTime.isOver() || this.outerLogoRotationTime.isTimeNotAtZero())) { + this.backgroundFadeOutTime.startAnimation(); + this.outerLogoRotationTime.startAnimation(); + this.outerLogoRotationTime.loopAnimation(); + } + } + + @Override + public void initGui() { + super.initGui(); + this.singleplayerButton.setElementSize(this.getScaledWidth() / 2.0f - (float) 50, this.getScaledHeight() / 2.0f + 5.0F, 100.0F, 12); + this.multiplayerButton.setElementSize(this.getScaledWidth() / 2.0f - 50.0F, this.getScaledHeight() / 2.0f + 24.0F, 100.0F, 12); + ++menuCounter; + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.singleplayerButton.drawElementHover(x, y, true); + this.multiplayerButton.drawElementHover(x, y, true); + Gui.drawRect(this.singleplayerButton.getXPosition() - (float) 20, this.getScaledHeight() / 2.0f - (float) 80, this.singleplayerButton.getXPosition() + this.singleplayerButton.getWidth() + (float) 20, this.multiplayerButton.getYPosition() + this.multiplayerButton.getHeight() + (float) 14, 0x2F000000); + float f3 = this.isFromLoadingScreen() ? this.logoMoveUpTime.getFadeAmount() : 1.0f; + if (this.isFromLoadingScreen()) { + Gui.drawRect(0.0f, 0.0f, this.getScaledWidth(), this.getScaledHeight(), new Color(1.0f, 1.0f, 1.0f, 1.0f - this.backgroundFadeOutTime.getFadeAmount()).getRGB()); + } + this.drawLogo(this.getScaledWidth(), this.getScaledHeight(), f3); + float f5 = this.getScaledWidth() / 2.0f - 80.0F; + float f6 = this.getScaledHeight() - 40.0F; + CheatBreaker.getInstance().ubuntuMedium14px.drawCenteredString("finished", this.getScaledWidth() / 2.0f, f6 - 11.0f, new Color(208, 208, 208, (int) ((float) 255 * (1.0f - Math.min(f3, 0.984f)))).getRGB()); + RenderUtil.drawRoundedRect(f5, f6, f5 + (float) 160, f6 + (float) 10, 8, new Color(218, 66, 83, (int) ((float) 255 * (1.0f - f3))).getRGB()); + } + + private void drawLogo(double x, double y, float yPosMover) { + float size = 27; + double x2 = x / 2.0 - (double) size; + double y2 = y / 2.0 - (double) size - (double) (35.0F * yPosMover); + + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glTranslatef((float) x2, (float) y2, 1.0f); + GL11.glTranslatef(size, size, size); + GL11.glRotatef(180.0F * this.outerLogoRotationTime.getFadeAmount(), 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-size, -size, -size); + RenderUtil.renderEIcon(this.outerLogo, size, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderEIcon(this.innerLogo, size, (float) x2, (float) y2); + } + + @Override + protected void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + this.singleplayerButton.handleElementMouseClicked(f, f2, n, true); + this.multiplayerButton.handleElementMouseClicked(f, f2, n, true); + if (this.singleplayerButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } else if (this.multiplayerButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } + } + + public boolean isFromLoadingScreen() { + return menuCounter == 1; + } + + public MinMaxFade getBackgroundFadeOutTime() { + return this.backgroundFadeOutTime; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/VanillaMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/VanillaMenu.java new file mode 100644 index 0000000..8bfd001 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/VanillaMenu.java @@ -0,0 +1,410 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import lombok.SneakyThrows; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.*; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.realms.RealmsBridge; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Random; + +public class VanillaMenu extends GuiScreen implements GuiYesNoCallback { + private static final Logger eventButton = LogManager.getLogger(); + private static final Random lastMouseEvent = new Random(); + private final float field_146298_h; + private String splashText = "missingno"; + private GuiButton buttonResetDemo; + private int panoramaTimer; + private DynamicTexture viewportTexture; + private final Object threadLock = new Object(); + private String field_92025_p; + private String field_146972_A; + private String field_104024_v; + private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); + private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; + public static final String selectedButton = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; + private int field_92024_r; + private int field_92023_s; + private int field_92022_t; + private int field_92021_u; + private int field_92020_v; + private int field_92019_w; + private ResourceLocation backgroundTexture; + private double lllIlIIllllIIIIlIllIlIIII; + private float lIIIIlllIIlIlllllIlIllIII = 0.0f; + private final ResourceLocation logoOuter = new ResourceLocation("client/logo_outer.png"); + private final ResourceLocation logoInner = new ResourceLocation("client/logo_inner.png"); + + public VanillaMenu() { + this.field_146972_A = selectedButton; + BufferedReader var1 = null; + try { + String var3; + ArrayList var2 = new ArrayList(); + var1 = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); + while ((var3 = var1.readLine()) != null) { + if ((var3 = var3.trim()).isEmpty()) continue; + var2.add(var3); + } + if (!var2.isEmpty()) { + do { + this.splashText = var2.get(lastMouseEvent.nextInt(var2.size())); + } while (this.splashText.hashCode() == 125780783); + } + } catch (IOException ignored) { + } finally { + if (var1 != null) { + try { + var1.close(); + } catch (IOException ignored) { + } + } + } + this.field_146298_h = lastMouseEvent.nextFloat(); + this.field_92025_p = ""; + if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.areShadersSupported()) { + this.field_92025_p = I18n.format("title.oldgl1"); + this.field_146972_A = I18n.format("title.oldgl2"); + this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game"; + } + } + + @Override + public void updateScreen() { + ++this.panoramaTimer; + this.lllIlIIllllIIIIlIllIlIIII += 0.06283185307179587; + this.lIIIIlllIIlIlllllIlIllIII = (float) ((Math.sin(this.lllIlIIllllIIIIlIllIlIIII) / 2.0 + 0.5) * 180.0); + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + protected void keyTyped(char var1, int var2) { + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + @Override + public void initGui() { + this.viewportTexture = new DynamicTexture(256, 256); + this.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); + Calendar var1 = Calendar.getInstance(); + var1.setTime(new Date()); + if (var1.get(2) + 1 == 11 && var1.get(5) == 9) { + this.splashText = "Happy birthday, ez!"; + } else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) { + this.splashText = "Happy birthday, Notch!"; + } else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) { + this.splashText = "Merry X-mas!"; + } else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) { + this.splashText = "Happy new year!"; + } else if (var1.get(2) + 1 == 10 && var1.get(5) == 31) { + this.splashText = "OOoooOOOoooo! Spooky!"; + } + boolean var2 = true; + int var3 = this.height / 4 + 48; + if (this.mc.isDemo()) { + this.drawPanorama(var3, 24); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI(var3, 24); + } + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, var3 + 48, 98, 20, I18n.format("menu.options"))); + this.buttonList.add(new GuiButton(4, this.width / 2 + 2, var3 + 48, 98, 20, I18n.format("menu.quit"))); + this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 48)); + Object var4 = this.threadLock; + Object var5 = this.threadLock; + Object object = this.threadLock; + synchronized (object) { + this.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p); + this.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A); + int var6 = Math.max(this.field_92023_s, this.field_92024_r); + this.field_92022_t = (this.width - var6) / 2; + this.field_92021_u = this.buttonList.get(0).yPosition - 24; + this.field_92020_v = this.field_92022_t + var6; + this.field_92019_w = this.field_92021_u + 24; + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(int var1, int var2) { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, var1, I18n.format("menu.singleplayer"))); + this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var1 + var2, I18n.format("menu.multiplayer"))); + } + + private void drawPanorama(int var1, int var2) { + this.buttonList.add(new GuiButton(11, this.width / 2 - 100, var1, I18n.format("menu.playdemo"))); + this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, var1 + var2, I18n.format("menu.resetdemo")); + this.buttonList.add(this.buttonResetDemo); + ISaveFormat var3 = this.mc.getSaveLoader(); + WorldInfo var4 = var3.getWorldInfo("Demo_World"); + if (var4 == null) { + this.buttonResetDemo.enabled = false; + } + } + + @Override + protected void actionPerformed(GuiButton var1) { + WorldInfo var3; + if (var1.id == 0) { + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } + if (var1.id == 5) { + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } + if (var1.id == 1) { + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } + if (var1.id == 2) { + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } + if (var1.id == 14) { + this.IlIlIIIlllIIIlIlllIlIllIl(); + } + if (var1.id == 4) { + this.mc.shutdown(); + } + if (var1.id == 11) { + this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); + } + if (var1.id == 12 && (var3 = this.mc.getSaveLoader().getWorldInfo("Demo_World")) != null) { + GuiYesNo var4 = GuiSelectWorld.makeDeleteWorldYesNo(this, var3.getWorldName(), 12); + this.mc.displayGuiScreen(var4); + } + } + + private void IlIlIIIlllIIIlIlllIlIllIl() { + RealmsBridge var1 = new RealmsBridge(); + var1.switchToRealms(this); + } + + @Override + public void confirmClicked(boolean var1, int var2) { + if (var1 && var2 == 12) { + ISaveFormat var6 = this.mc.getSaveLoader(); + var6.flushCache(); + var6.deleteWorldDirectory("Demo_World"); + this.mc.displayGuiScreen(this); + } else if (var2 == 13) { + if (var1) { + try { + Class var3 = Class.forName("java.awt.Desktop"); + Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke(null); + var3.getMethod("browse", URI.class).invoke(var4, new URI(this.field_104024_v)); + } catch (Throwable var5) { + eventButton.error("Couldn't open link", var5); + } + } + this.mc.displayGuiScreen(this); + } + } + + private void drawPanorama(int var1, int var2, float var3) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GL11.glMatrixMode(5889); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + Project.gluPerspective(120.0f, 1.0f, 0.05f, 10.0f); + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + GL11.glEnable(3042); + GL11.glDisable(3008); + GL11.glDisable(2884); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + int var5 = 8; + for (int var6 = 0; var6 < var5 * var5; ++var6) { + GL11.glPushMatrix(); + float var7 = ((float) (var6 % var5) / (float) var5 - 0.5f) / 64.0f; + float var8 = ((float) (var6 / var5) / (float) var5 - 0.5f) / 64.0f; + float var9 = 0.0f; + GL11.glTranslatef(var7, var8, var9); + GL11.glRotatef(MathHelper.sin(((float) this.panoramaTimer + var3) / 400.0f) * 25.0f + 20.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(-((float) this.panoramaTimer + var3) * 0.055882353f * 1.7894737f, 0.0f, 1.0f, 0.0f); + for (int var10 = 0; var10 < 6; ++var10) { + GL11.glPushMatrix(); + if (var10 == 1) { + GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 2) { + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 3) { + GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 4) { + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + } + if (var10 == 5) { + GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); + } + this.mc.getTextureManager().bindTexture(titlePanoramaPaths[var10]); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + float var11 = 0.0f; + worldrenderer.pos(-1.0, -1.0, 1.0).tex(0.0f + var11, 0.0f + var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + worldrenderer.pos(1.0, -1.0, 1.0).tex(1.0f - var11, 0.0f + var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + worldrenderer.pos(1.0, 1.0, 1.0).tex(1.0f - var11, 1.0f - var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + worldrenderer.pos(-1.0, 1.0, 1.0).tex(0.0f + var11, 1.0f - var11).color(255, 255, 255, 255 / (var6 + 1)).endVertex(); + tessellator.draw(); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + GL11.glColorMask(true, true, true, false); + } + GL11.glColorMask(true, true, true, true); + GL11.glMatrixMode(5889); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glEnable(2884); + GL11.glEnable(2929); + } + + private void rotateAndBlurSkybox(float var1) { + this.mc.getTextureManager().bindTexture(this.backgroundTexture); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColorMask(true, true, true, false); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + GL11.glDisable(3008); + int var3 = 3; + for (int var4 = 0; var4 < var3; ++var4) { + int var5 = this.width; + int var6 = this.height; + float var7 = (float) (var4 - var3 / 2) / 256.0f; + worldrenderer.pos(var5, var6, zLevel).tex(0.0f + var7, 1.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + worldrenderer.pos(var5, 0.0, zLevel).tex(1.0f + var7, 1.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + worldrenderer.pos(0.0, 0.0, zLevel).tex(1.0f + var7, 0.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + worldrenderer.pos(0.0, var6, zLevel).tex(0.0f + var7, 0.0).color(1.0f, 1.0f, 1.0f, 1.0f / (float) (var4 + 1)).endVertex(); + } + tessellator.draw(); + GL11.glEnable(3008); + GL11.glColorMask(true, true, true, true); + } + + private void IlllIIIlIlllIllIlIIlllIlI(int var1, int var2, float var3) { + this.mc.getFramebuffer().unbindFramebuffer(); + GL11.glViewport(0, 0, 256, 256); + this.drawPanorama(var1, var2, var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.rotateAndBlurSkybox(var3); + this.mc.getFramebuffer().bindFramebuffer(true); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + float var5 = this.width > this.height ? 120.0f / (float) this.width : 120.0f / (float) this.height; + float var6 = (float) this.height * var5 / 256.0f; + float var7 = (float) this.width * var5 / 256.0f; + int var8 = this.width; + int var9 = this.height; + worldrenderer.pos(0.0, var9, zLevel).tex(0.5f - var6, 0.5f + var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + worldrenderer.pos(var8, var9, zLevel).tex(0.5f - var6, 0.5f - var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + worldrenderer.pos(var8, 0.0, zLevel).tex(0.5f + var6, 0.5f - var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + worldrenderer.pos(0.0, 0.0, zLevel).tex(0.5f + var6, 0.5f + var7).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex(); + tessellator.draw(); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GL11.glDisable(3008); + this.IlllIIIlIlllIllIlIIlllIlI(mouseX, mouseY, partialTicks); + GL11.glEnable(3008); +// Tessellator var4 = Tessellator.instance; + int var5 = 274; + int var6 = this.width / 2 - var5 / 2; + boolean var7 = true; + this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 0xFFFFFF); + this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); + GL11.glPushMatrix(); + GL11.glTranslatef(this.width / 2 - 40, this.height / 4 - 40, 0.0f); + int var8 = 40; + GL11.glTranslatef(var8, var8, var8); + GL11.glRotatef(this.lIIIIlllIIlIlllllIlIllIII, 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-var8, -var8, -var8); + RenderUtil.renderIcon(this.logoOuter, (float) var8, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderIcon(this.logoInner, 40.0f, (float) (this.width / 2 - 40), (float) (this.height / 4 - 38)); +// var4.setColorOpaque_I(-1); + GL11.glPushMatrix(); + GL11.glTranslatef(this.width / 2 + 90, 70.0f, 0.0f); + GL11.glRotatef(-20.0f, 0.0f, 0.0f, 1.0f); + float var9 = 1.8f - MathHelper.abs(MathHelper.sin((float) (Minecraft.getSystemTime() % 1000L) / 1000.0f * 3.998391f * 0.78571427f * 2.0f) * 0.09589041f * 1.0428572f); + var9 = var9 * 100.0f / (float) (this.fontRendererObj.getStringWidth(this.splashText) + 32); + GL11.glScalef(var9, var9, var9); + GL11.glPopMatrix(); + String commitText = "CheatBreaker " + CheatBreaker.getInstance().getGitBuildVersion() + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")"; + this.drawString(this.fontRendererObj, commitText, 2, this.height - 10, -1); + String var11 = "Copyright Mojang AB. Do not distribute!"; + this.drawString(this.fontRendererObj, var11, this.width - this.fontRendererObj.getStringWidth(var11) - 2, this.height - 10, -1); + if (this.field_92025_p != null && this.field_92025_p.length() > 0) { + VanillaMenu.drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 0x55200000); + this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1); + this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, this.buttonList.get(0).yPosition - 12, -1); + } + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + @SneakyThrows + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + if (mouseX >= 7 && mouseX <= 39 && mouseY >= 5 && mouseY <= 20) { + MainMenuBase.switchMenu(); + } + synchronized (this.threadLock) { + if (this.field_92025_p.length() > 0 && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w) { + GuiConfirmOpenLink var6 = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); + var6.disableSecurityWarning(); + this.mc.displayGuiScreen(var6); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/AnchorHelper.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/AnchorHelper.java new file mode 100644 index 0000000..32f74da --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/AnchorHelper.java @@ -0,0 +1,247 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.AbstractModule; +import net.minecraft.client.gui.ScaledResolution; + +public class AnchorHelper {//TODO: Map this class + + public static GuiAnchor getAnchor(float f, float f2, ScaledResolution scaledResolution) { + int n = scaledResolution.getScaledWidth(); + int n2 = scaledResolution.getScaledHeight(); + if (f < (float) (n / 3) && f2 < (float) (n2 / 3)) { + return GuiAnchor.LEFT_TOP; + } + if (f > (float) (n / 3 * 2) && f2 < (float) (n2 / 3)) { + return GuiAnchor.RIGHT_TOP; + } + if (f2 < (float) (n2 / 3)) { + return GuiAnchor.MIDDLE_TOP; + } + if (f < (float) (n / 3) && f2 < (float) (n2 / 3 * 2)) { + return GuiAnchor.LEFT_MIDDLE; + } + if (f > (float) (n / 3 * 2) && f2 < (float) (n2 / 3 * 2)) { + return GuiAnchor.RIGHT_MIDDLE; + } + if (f2 < (float) (n2 / 3 * 2)) { + return GuiAnchor.MIDDLE_MIDDLE; + } + if (f < (float) (n / 3)) { + return GuiAnchor.LEFT_BOTTOM; + } + if (f < (float) (n / 3 * 2)) { + if (f > (float) (n / 3 + n / 6)) { + return GuiAnchor.MIDDLE_BOTTOM_RIGHT; + } + return GuiAnchor.MIDDLE_BOTTOM_LEFT; + } + return GuiAnchor.RIGHT_BOTTOM; + } + + public static float[] getPositions(float f, float f2, ScaledResolution scaledResolution) { + float f3 = scaledResolution.getScaledWidth(); + float f4 = scaledResolution.getScaledHeight(); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(f, f2, scaledResolution); + float f5 = 0.0f; + float f6 = 0.0f; + switch (cBGuiAnchor) { + case LEFT_TOP: + f5 = 0.0f; + f6 = 0.0f; + break; + case RIGHT_TOP: + f5 = f3 / 3.0F * 2.0f; + f6 = 0.0f; + break; + case MIDDLE_TOP: + f5 = f3 / 3.0F; + f6 = 0.0f; + break; + case LEFT_MIDDLE: + f5 = 0.0f; + f6 = f4 / 3.0F; + break; + case RIGHT_MIDDLE: + f5 = f3 / 3.0F * 2.0f; + f6 = f4 / 3.0F; + break; + case MIDDLE_MIDDLE: + f5 = f3 / 3.0F; + f6 = f4 / 3.0F; + break; + case LEFT_BOTTOM: + f5 = 0.0f; + f6 = f4 / 3.0F * 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f5 = f3 / 3.0F + f3 / (float) 6; + f6 = f4 / 3.0F * 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f5 = f3 / 3.0F; + f6 = f4 / 3.0F * 2.0f; + break; + case RIGHT_BOTTOM: + f5 = f3 / 3.0F * 2.0f; + f6 = f4 / 3.0F * 2.0f; + } + return new float[]{f5, f6}; + } + + public static float[] getPositions(GuiAnchor anchor, ScaledResolution scaledResolution, float f, float f2, float f3) { + float f4 = 0.0f; + float f5 = 0.0f; + f *= f3; + f2 *= f3; + switch (anchor) { + case LEFT_TOP: + f4 = 2.0f; + f5 = 2.0f; + break; + case LEFT_MIDDLE: + f4 = 2.0f; + f5 = (float) (scaledResolution.getScaledHeight() / 2) - f2 / 2.0f; + break; + case LEFT_BOTTOM: + f5 = (float) scaledResolution.getScaledHeight() - f2 - 2.0f; + f4 = 2.0f; + break; + case MIDDLE_TOP: + f4 = (float) (scaledResolution.getScaledWidth() / 2) - f / 2.0f; + f5 = 2.0f; + break; + case MIDDLE_MIDDLE: + f4 = (float) (scaledResolution.getScaledWidth() / 2) - f / 2.0f; + f5 = (float) (scaledResolution.getScaledHeight() / 2) - f2 / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f4 = (float) (scaledResolution.getScaledWidth() / 2) - f; + f5 = (float) scaledResolution.getScaledHeight() - f2 - 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f4 = scaledResolution.getScaledWidth() / 2; + f5 = (float) scaledResolution.getScaledHeight() - f2 - 2.0f; + break; + case RIGHT_TOP: + f4 = (float) scaledResolution.getScaledWidth() - f - 2.0f; + f5 = 2.0f; + break; + case RIGHT_MIDDLE: + f4 = (float) scaledResolution.getScaledWidth() - f; + f5 = (float) (scaledResolution.getScaledHeight() / 2) - f2 / 2.0f; + break; + case RIGHT_BOTTOM: + f4 = (float) scaledResolution.getScaledWidth() - f; + f5 = (float) scaledResolution.getScaledHeight() - f2; + } + return new float[]{f4, f5}; + } + + public static float[] getPositions(AbstractModule module, float f, float f2, ScaledResolution scaledResolution) { + float f3 = scaledResolution.getScaledWidth(); + float f4 = scaledResolution.getScaledHeight(); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(f, f2, scaledResolution); + float f5 = module.width * module.masterScale(); + float f6 = module.height * module.masterScale(); + float f7 = 0.0f; + float f8 = 0.0f; + switch (cBGuiAnchor) { + case LEFT_TOP: + f7 = f5 / 2.0f; + f8 = f6 / 2.0f; + break; + case RIGHT_TOP: + f7 = f3 / 3.0F - f5 / 2.0f; + f8 = f6 / 2.0f; + break; + case MIDDLE_TOP: + f7 = f3 / 6.0F; + f8 = f6 / 2.0f; + break; + case LEFT_MIDDLE: + f7 = f5 / 2.0f; + f8 = f4 / (float) 6; + break; + case RIGHT_MIDDLE: + f7 = f3 / 3.0F - f5 / 2.0f; + f8 = f4 / 6.0F; + break; + case MIDDLE_MIDDLE: + f7 = f3 / 6.0F; + f8 = f4 / 6.0F; + break; + case LEFT_BOTTOM: + f7 = f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f7 = f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f7 = f3 / 6.0F - f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + break; + case RIGHT_BOTTOM: + f7 = f3 / 3.0F - f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + } + return new float[]{f7, f8}; + } + + public static float[] getSnapPositions(GuiAnchor anchor) { + float f = 0.0f; + float f2 = 0.0f; + switch (anchor) { + case RIGHT_MIDDLE: + f = -2; + break; + case LEFT_BOTTOM: + f = 2.0f; + f2 = -34; + break; + case MIDDLE_MIDDLE: + f2 = -50; + f = 0.0f; + } + return new float[]{f, f2}; + } + + public static Position getVerticalPositionEnum(GuiAnchor cBGuiAnchor) { + switch (cBGuiAnchor) { + case LEFT_TOP: + case RIGHT_TOP: + case MIDDLE_TOP: + return Position.TOP; + case LEFT_MIDDLE: + case RIGHT_MIDDLE: + case MIDDLE_MIDDLE: + return Position.CENTER; + case LEFT_BOTTOM: + case MIDDLE_BOTTOM_RIGHT: + case MIDDLE_BOTTOM_LEFT: + case RIGHT_BOTTOM: + return Position.BOTTOM; + } + return null; + } + + public static Position getHorizontalPositionEnum(GuiAnchor cBGuiAnchor) { + switch (cBGuiAnchor) { + case LEFT_TOP: + case LEFT_MIDDLE: + case LEFT_BOTTOM: + case MIDDLE_BOTTOM_RIGHT: + return Position.LEFT; + case MIDDLE_TOP: + case MIDDLE_MIDDLE: + return Position.CENTER; + case RIGHT_TOP: + case RIGHT_MIDDLE: + case MIDDLE_BOTTOM_LEFT: + case RIGHT_BOTTOM: + return Position.RIGHT; + } + return null; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/GuiAnchor.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/GuiAnchor.java new file mode 100644 index 0000000..1bbfb56 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/GuiAnchor.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.ui.module; + +import lombok.AllArgsConstructor; + +@AllArgsConstructor +public enum GuiAnchor { + LEFT_TOP("LEFT_TOP"), + LEFT_MIDDLE("LEFT_MIDDLE"), + LEFT_BOTTOM("LEFT_BOTTOM"), + MIDDLE_TOP("MIDDLE_TOP"), + MIDDLE_MIDDLE("MIDDLE_MIDDLE"), + MIDDLE_BOTTOM_LEFT("MIDDLE_BOTTOM_LEFT"), + MIDDLE_BOTTOM_RIGHT("MIDDLE_BOTTOM_RIGHT"), + RIGHT_TOP("RIGHT_TOP"), + RIGHT_MIDDLE("RIGHT_MIDDLE"), + RIGHT_BOTTOM("RIGHT_BOTTOM"); + + private final String label; + + /* + * WARNING - Possible parameter corruption + * WARNING - void declaration + */ + + + public String getLabel() { + return this.label; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/HudLayoutEditorGui.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/HudLayoutEditorGui.java new file mode 100644 index 0000000..b041b60 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/HudLayoutEditorGui.java @@ -0,0 +1,1185 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.ScreenLocation; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.element.module.ModuleListElement; +import com.cheatbreaker.client.ui.element.module.ModulePreviewContainer; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.element.profile.ProfilesListElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import com.cheatbreaker.client.util.manager.DebugInfoHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class HudLayoutEditorGui extends GuiScreen { + public static HudLayoutEditorGui instance; + private final ResourceLocation settingsIcon = new ResourceLocation("client/icons/cog-64.png"); + private final ResourceLocation deleteIcon = new ResourceLocation("client/icons/delete-64.png"); + private final List positions = new ArrayList<>(); + private final List guiElements = new ArrayList<>(); + private final List buttons = new ArrayList<>(); + private List modules; + private ModulesGuiButtonElement showGuidesButton; + public ModulesGuiButtonElement helpButton; + private ModulesGuiButtonElement bugReportButton; + @Deprecated + protected AbstractScrollableElement lastMouseEvent; + @Deprecated + protected AbstractScrollableElement field_146298_h; + public AbstractScrollableElement settingsElement; + public AbstractScrollableElement profilesElement; + public AbstractScrollableElement modulesElement; + protected AbstractScrollableElement staffModulesElement; + protected AbstractScrollableElement allElements = null; + public AbstractScrollableElement currentScrollableElement = null; + private static AbstractModule draggingModule; + private boolean IlIlIIIlllllIIIlIlIlIllII = false; + private float mouseX2; + private float mouseY2; + private List undoList; + private List redo; + private int mouseX; + private int mouseY; + private boolean showModSizeOutline = false; + private ModuleDataHolder dataHolder; + private boolean isBugReportOpen = false; + public static boolean allMenusClosed = false; + private int arrowKeyMoves; + private GuiTextField bugReportTextField; + private float animationPhase = 0; + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void initGui() { + this.blurGui(); + Keyboard.enableRepeatEvents(true); + this.modules = new ArrayList<>(); + this.modules.addAll(CheatBreaker.getInstance().getModuleManager().playerMods); + this.undoList = new ArrayList<>(); + this.redo = new ArrayList<>(); + this.mouseX = -1; + this.mouseY = -1; + this.arrowKeyMoves = 0; + instance = this; + draggingModule = null; + this.allElements = null; + this.currentScrollableElement = null; + this.dataHolder = null; + allMenusClosed = false; + float scale = 1.0f / CheatBreaker.getScaleFactor(); + int scaledWidth = (int) ((float) this.width / scale); + int scaledHeight = (int) ((float) this.height / scale); + this.guiElements.clear(); + this.buttons.clear(); + List moduleList = CheatBreaker.getInstance().getModuleManager().playerMods; + List staffModList = CheatBreaker.getInstance().getModuleManager().staffMods; + this.modulesElement = new ModulePreviewContainer(scale, scaledWidth / 2 - 565, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.modulesElement); + + this.staffModulesElement = new ModuleListElement(staffModList, scale, scaledWidth / 2 + 195, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.staffModulesElement); + this.settingsElement = new ModuleListElement(moduleList, scale, scaledWidth / 2 + 195, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.settingsElement); + this.profilesElement = new ProfilesListElement(scale, scaledWidth / 2 - 565, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.profilesElement); + this.showGuidesButton = new ModulesGuiButtonElement(null, "eye-64.png", 4, scaledHeight - 32, 28, 28, -12418828, scale); + this.helpButton = new ModulesGuiButtonElement(null, "?", 36, scaledHeight - 32, 28, 28, -12418828, scale); + this.bugReportButton = new ModulesGuiButtonElement(null, "Bug report", 68, scaledHeight - 32, 140, 28, -12418828, scale); + this.bugReportTextField = new GuiTextField(299, this.mc.fontRendererObj, 68, scaledHeight - 58, 140, 20); + + if (CheatBreaker.getInstance().getConfigManager().isUsingStaffModules()) { + this.buttons.add(new ModulesGuiButtonElement(this.staffModulesElement, "Staff Mods", scaledWidth / 2 - 50, scaledHeight / 2 - 44, 100, 20, -9442858, scale)); + } + + this.buttons.add(new ModulesGuiButtonElement(this.modulesElement, "Mods", scaledWidth / 2 - 50, scaledHeight / 2 - 19, 100, 28, -13916106, scale)); + this.buttons.add(new ModulesGuiButtonElement(this.settingsElement, "cog-64.png", scaledWidth / 2 + 54, scaledHeight / 2 - 19, 28, 28, -12418828, scale)); + this.buttons.add(new ModulesGuiButtonElement(this.profilesElement, "profiles-64.png", scaledWidth / 2 - 82, scaledHeight / 2 - 19, 28, 28, -12418828, scale)); + allMenusClosed = false; + this.allElements = null; + this.animationPhase = 5; + } + + @Override + public void updateScreen() { + float f = 1.0f / CheatBreaker.getScaleFactor(); + int n = (int) ((float) this.width / f); + int n2 = (int) ((float) this.height / f); + this.setDirection(n); + if (this.isBugReportOpen) { + this.bugReportTextField.updateCursorCounter(); + } + if (!this.positions.isEmpty()) { + boolean leftKeyPressed = Keyboard.isKeyDown(203); + boolean rightKeyPressed = Keyboard.isKeyDown(205); + boolean downKeyPressed = Keyboard.isKeyDown(200); + boolean upKeyPressed = Keyboard.isKeyDown(208); + if (leftKeyPressed || rightKeyPressed || downKeyPressed || upKeyPressed) { + ++this.arrowKeyMoves; + if (this.arrowKeyMoves > 10) { + for (ModulePosition position : this.positions) { + AbstractModule module = position.module; + if (module == null) continue; + if (leftKeyPressed) { + module.setTranslations((int) module.getXTranslation() - 1, (float) ((int) module.getYTranslation())); + continue; + } + if (rightKeyPressed) { + module.setTranslations((int) module.getXTranslation() + 1, (float) ((int) module.getYTranslation())); + continue; + } + if (downKeyPressed) { + module.setTranslations((int) module.getXTranslation(), (float) ((int) module.getYTranslation() - 1)); + continue; + } + if (upKeyPressed) { + module.setTranslations((int) module.getXTranslation(), (float) ((int) module.getYTranslation() + 1)); + } + + } + } + } + } + float f2 = this.animationPhase > 30 ? 2.0f + this.animationPhase / 2.0f : (float) 4; + this.animationPhase = this.animationPhase + f2 >= (float) 255 ? 255 : (int) (this.animationPhase + f2); + } + + private float lIIIIlIIllIIlIIlIIIlIIllI(Rectangle rectangle, Rectangle rectangle2) { + float f = Math.max(Math.abs(rectangle.x - rectangle2.x) - rectangle2.width / 2, 0); + float f2 = Math.max(Math.abs(rectangle.y - rectangle2.y) - rectangle2.height / 2, 0); + return f * f + f2 * f2; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + float f2; + float f3; + Rectangle object; + super.drawScreen(mouseX, mouseY, partialTicks); + this.renderBlur(); + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + float scale = 1.0f / CheatBreaker.getScaleFactor(); + if (draggingModule != null) { + if (!Mouse.isButtonDown(1)) { + RenderUtil.drawRoundedRect(2.0, 2.0, 2.5D, this.height - 2, 0.0, -15599126); + RenderUtil.drawRoundedRect((float) this.width - 2.5F, 2.0, this.width - 2, this.height - 2, 0.0, -15599126); + RenderUtil.drawRoundedRect(2.0, 2, this.width - 2, 2.5, 0.0, -15599126); + RenderUtil.drawRoundedRect(2.0, (float) this.height - 2.5F, this.width - 2, this.height - 2, 0.0, -15599126); + } + // Temporarily Try-Catching this until me or someone else figures out how to fix this *without* the need to reset profiles - Tellinq + try { + this.modules.sort((module, module1) -> { + if (module == draggingModule || module1 == draggingModule || module.getGuiAnchor() == null || module1.getGuiAnchor() == null) { + return 0; + } + float[] arrf = module.getScaledPoints(scaledResolution, true); + float[] arrf2 = module1.getScaledPoints(scaledResolution, true); + float[] arrf3 = draggingModule.getScaledPoints(scaledResolution, true); + Rectangle rectangle = new Rectangle((int) (arrf[0] * module.masterScale()), (int) (arrf[1] * module.masterScale()), (int) (module.height * module.masterScale()), (int) (module.width * module.masterScale())); + Rectangle rectangle2 = new Rectangle((int) (arrf2[0] * module1.masterScale()), (int) (arrf2[1] * module1.masterScale()), (int) (module1.height * module1.masterScale()), (int) (module1.width * module1.masterScale())); + Rectangle rectangle3 = new Rectangle((int) (arrf3[0] * HudLayoutEditorGui.draggingModule.masterScale()), (int) (arrf3[1] * HudLayoutEditorGui.draggingModule.masterScale()), (int) (HudLayoutEditorGui.draggingModule.width * HudLayoutEditorGui.draggingModule.masterScale()), (int) (HudLayoutEditorGui.draggingModule.height * HudLayoutEditorGui.draggingModule.masterScale())); + try { + if (this.lIIIIlIIllIIlIIlIIIlIIllI(rectangle, rectangle3) > this.lIIIIlIIllIIlIIlIIIlIIllI(rectangle2, rectangle3)) { + return -1; + } + return 1; + } catch (Exception exception) { + return 0; + } + }); + } catch (Exception ex) { + ex.printStackTrace(); + } + + ModulePosition modulePosition = this.getSelectedModules(draggingModule); + if (modulePosition != null) { + this.positions.remove(modulePosition); + this.positions.add(modulePosition); + } + for (ModulePosition position : this.positions) { + this.dragModule(position, mouseX, mouseY, scaledResolution); + if (!(Boolean) CheatBreaker.getInstance().getGlobalSettings().snapModules.getValue() || !this.IlIlIIIlllllIIIlIlIlIllII || Mouse.isButtonDown(1) || position.module != draggingModule) + continue; + for (AbstractModule module : this.modules) { + float[] positionScaledPoints = position.module.getScaledPoints(scaledResolution, true); + float centerVerticalSnap = this.height / 2 - (positionScaledPoints[1] + position.module.height / 2) * position.module.masterScale(); + float centerHorizontalSnap = this.width / 2 - (positionScaledPoints[0] + position.module.width / 2) * position.module.masterScale(); + float snappingStrength = (float) CheatBreaker.getInstance().getGlobalSettings().snappingStrength.getValue(); + if (centerHorizontalSnap >= -snappingStrength && centerHorizontalSnap <= snappingStrength) { + this.snapHorizontalPosition(centerHorizontalSnap); + } + if (centerVerticalSnap >= -snappingStrength && centerVerticalSnap <= snappingStrength) { + this.snapVerticalPosition(centerVerticalSnap); + } + if (this.getSelectedModules(module) != null || module.getGuiAnchor() == null || !module.isRenderHud() || !module.isEnabled() || module.getName().contains("Zans")/* && CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().hide*/) + continue; + float[] moduleScaledPoints = module.getScaledPoints(scaledResolution, true); + boolean bl = true; + boolean bl2 = true; + float f6 = moduleScaledPoints[0] * module.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f7 = (moduleScaledPoints[0] + module.width) * module.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f8 = (moduleScaledPoints[0] + module.width) * module.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f9 = moduleScaledPoints[0] * module.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f10 = moduleScaledPoints[1] * module.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + f3 = (moduleScaledPoints[1] + module.height) * module.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + f2 = (moduleScaledPoints[1] + module.height) * module.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + float f11 = moduleScaledPoints[1] * module.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + + if (f6 >= -snappingStrength && f6 <= snappingStrength) { + bl = false; + this.snapHorizontalPosition(f6); + } + if (f7 >= -snappingStrength && f7 <= snappingStrength && bl) { + bl = false; + this.snapHorizontalPosition(f7); + } + if (f9 >= -snappingStrength && f9 <= snappingStrength && bl) { + bl = false; + this.snapHorizontalPosition(f9); + } + if (f8 >= -snappingStrength && f8 <= snappingStrength && bl) { + this.snapHorizontalPosition(f8); + } + if (f10 >= -snappingStrength && f10 <= snappingStrength) { + bl2 = false; + this.snapVerticalPosition(f10); + } + if (f3 >= -snappingStrength && f3 <= snappingStrength && bl2) { + bl2 = false; + this.snapVerticalPosition(f3); + } + if (f11 >= -snappingStrength && f11 <= snappingStrength && bl2) { + bl2 = false; + this.snapVerticalPosition(f11); + } + if (!(f2 >= -snappingStrength) || !(f2 <= snappingStrength) || !bl2) continue; + this.snapVerticalPosition(f2); + } + } + } else if (this.dataHolder != null) { + float f12 = 1.0f; + int n4; + switch (this.dataHolder.screenLocation) { + case RIGHT_BOTTOM: + n4 = mouseY - this.dataHolder.mouseY + (mouseX - this.dataHolder.mouseX); + f12 = this.dataHolder.scale - (float) n4 / (float) 115; + break; + case LEFT_TOP: + n4 = mouseY - this.dataHolder.mouseY + (mouseX - this.dataHolder.mouseX); + f12 = this.dataHolder.scale + (float) n4 / (float) 115; + break; + case RIGHT_TOP: + n4 = mouseX - this.dataHolder.mouseX - (mouseY - this.dataHolder.mouseY); + f12 = this.dataHolder.scale - (float) n4 / (float) 115; + break; + case LEFT_BOTTOM: + n4 = mouseX - this.dataHolder.mouseX - (mouseY - this.dataHolder.mouseY); + f12 = this.dataHolder.scale + (float) n4 / (float) 115; + } + if (f12 >= 1.0421053f * 0.47979796f && f12 <= 1.8962264f * 0.7910448f) { + this.dataHolder.module.scale.setValue((float) ((double) Math.round((double) f12 * (double) 100) / (double) 100)); + } + } + this.lIIIIlIIllIIlIIlIIIlIIllI(scaledResolution); + boolean bl = true; + for (AbstractModule module : this.modules) { + boolean bl3 = this.lIIIIlIIllIIlIIlIIIlIIllI(scale, module, scaledResolution, mouseX, mouseY, bl); + if (bl3) continue; + bl = false; + } + GL11.glPushMatrix(); + GL11.glScalef(scale, scale, scale); + int n5 = (int) ((float) this.width / scale); + int n6 = (int) ((float) this.height / scale); + this.showGuidesButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.helpButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.bugReportButton.handleDrawElement(mouseX, mouseY, partialTicks); + if (this.isBugReportOpen) { + this.mc.fontRendererObj.drawString("Bug Description (Press ENTER to send)", 39, n6 - 70, -1); + this.bugReportTextField.setMaxStringLength(180); + this.bugReportTextField.drawTextBox(); + } + float f13 = (this.animationPhase * 8) / (float) 255; + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, f13); + int n7 = 0xFFFFFF; + if (f13 / (float) 4 > 0.0f && f13 / (float) 4 < 1.0f) { + n7 = new Color(1.0f, 1.0f, 1.0f, f13 / (float) 4).getRGB(); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, f13); + if (f13 > 1.0f) { + GL11.glTranslatef(-((this.animationPhase * 2) - (float) 32) / (float) 12 - 1.0f, 0.0f, 0.0f); + } + RenderUtil.renderIcon(new ResourceLocation("client/logo_white.png"), (float) (n5 / 2 - 14), (float) (n6 / 2 - 47 - (CheatBreaker.getInstance().getConfigManager().isUsingStaffModules() ? 22 : 0)), (float) 28, 15); + if (f13 > 1.0f) { + CheatBreaker.getInstance().playBold18px.drawString("| CHEAT", n5 / 2.0f + 18.0f, (float) (n6 / 2 - 45 - (CheatBreaker.getInstance().getConfigManager().isUsingStaffModules() ? 22 : 0)), n7); + CheatBreaker.getInstance().playRegular18px.drawString("BREAKER", n5 / 2.0f + 53.0f, (float) (n6 / 2 - 45 - (CheatBreaker.getInstance().getConfigManager().isUsingStaffModules() ? 22 : 0)), n7); + } + GL11.glPopMatrix(); + for (ModulesGuiButtonElement modulesGuiButtonElement : this.buttons) { + modulesGuiButtonElement.handleDrawElement(mouseX, mouseY, partialTicks); + } + if (draggingModule == null) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox(n5 / 2 - 185, n6 / 2 + 15, n5 / 2 + 185, n6 - 20, (float) scaledResolution.getScaleFactor() * scale, n6); + for (AbstractScrollableElement abstractScrollableElement : this.guiElements) { + if (abstractScrollableElement != this.allElements && abstractScrollableElement != this.currentScrollableElement) + continue; + abstractScrollableElement.handleDrawElement(mouseX, mouseY, partialTicks); + } + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + if (this.mouseX != -1) { + if (Mouse.isButtonDown(0)) { + if (this.mouseX != mouseX && this.mouseY != mouseY) { + HudLayoutEditorGui.drawRectWithOutline(this.mouseX, this.mouseY, mouseX, mouseY, 0.49f, -1358888961, 0x1F00FFFF); + } + } else { + this.positions.clear(); + for (AbstractModule module : this.modules) { + int n8; + int n9; + int n10; + int n11; + Rectangle rectangle; + if (module.getGuiAnchor() == null || !module.isEnabled() || module.getName().contains("Zans")/* && CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().hide*/) + continue; + float[] arrf = module.getScaledPoints(scaledResolution, true); + float f14 = scale / module.masterScale(); + object = new Rectangle((int) (arrf[0] * module.masterScale() - 2.0f), (int) (arrf[1] * module.masterScale() - 2.0f), (int) (module.width * module.masterScale() + (float) 4), (int) (module.height * module.masterScale() + (float) 4)); + if (!object.intersects(rectangle = new Rectangle(n11 = Math.min(this.mouseX, mouseX), n10 = Math.min(this.mouseY, mouseY), n9 = Math.max(this.mouseX, mouseX) - n11, n8 = Math.max(this.mouseY, mouseY) - n10))) + continue; + f3 = (float) mouseX - module.getXTranslation(); + f2 = (float) mouseY - module.getYTranslation(); + this.positions.add(new ModulePosition(module, f3, f2)); + } + this.mouseX = -1; + this.mouseY = -1; + } + } + if (this.helpButton.isMouseInside(mouseX, mouseY) && (this.allElements == null || !this.allElements.isMouseInside(mouseX, mouseY))) { + this.drawShortcutHints(scale); + } + } + + private void drawShortcutHints(float scale) { + GL11.glPushMatrix(); + GL11.glTranslatef(4, (float) this.height - 245.0f * scale, 0.0f); + GL11.glScalef(scale, scale, scale); + Gui.drawRect(0.0f, 0.0f, 240, 200, -1895825408); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("Shortcuts & Movement", 4, 2.0f, -1); + Gui.drawRect(4, 12, 234, 2.5815217f * 4.8421054f, 0x4FFFFFFF); + int n = 16; + String ctrlOrCmd = Minecraft.isRunningOnMac ? "CMD" : "CTRL"; + int ctrlOrCmdPos = Minecraft.isRunningOnMac ? 2 : 0; + this.drawShortcutString("Mouse1", 6, n); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "HOLD" + EnumChatFormatting.RESET + " Add mods to selected region", 80, (float) n, -1); + this.drawShortcutString("Mouse1", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "HOLD" + EnumChatFormatting.RESET + " Select & drag mods", 80, (float) n, -1); + this.drawShortcutString("Mouse2", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "CLICK" + EnumChatFormatting.RESET + " Reset mod to closest position", 80, (float) n, -1); + this.drawShortcutString("Mouse2", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "HOLD" + EnumChatFormatting.RESET + " Don't lock mods while dragging", 80, (float) n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float) n, -1); + this.drawShortcutString("Mouse1", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Toggle (multiple) mod selection", 80, (float) n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float) n, -1); + this.drawShortcutString("A", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Select all mods", 80, (float) n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float) n, -1); + this.drawShortcutString("X", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Remove selected mod(s) from HUD", 80, (float) n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float) n, -1); + this.drawShortcutString("R", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Reset selected mod(s) scale", 80, (float) n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float) n, -1); + this.drawShortcutString("Z", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Undo mod movements", 80, (float) n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float) n, -1); + this.drawShortcutString("Y", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Redo mod movements", 80, (float) n, -1); + this.drawShortcutString("SHIFT", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 32, (float) n, -1); + this.drawShortcutString("Arrows", 38, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Smaller mod movements", 80, (float) n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float) n, -1); + this.drawShortcutString("Arrows", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Larger mod movements", 80, (float) n, -1); + n = 172; + this.drawShortcutString("Up", 31, n); + this.drawShortcutString("Left", 6, n += 12); + this.drawShortcutString("Down", 26, n); + this.drawShortcutString("Right", 51, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Move selected mod(s) with precision", 80, (float) n, -1); + GL11.glPopMatrix(); + } + + private void drawShortcutString(String string, int x, int y) { + CBFontRenderer font = CheatBreaker.getInstance().playRegular14px; + float width = font.getStringWidth(string); + RenderUtil.drawRoundedRect(x, y, (float) x + width + 4.0f, y + 10, 2, -1073741825); + font.drawString(string, x + 2, (float) y, -16777216); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + if (this.allElements != null && this.allElements.isMouseInside(mouseX, mouseY)) { + this.allElements.handleMouseClick(mouseX, mouseY, mouseButton); + } else { + AbstractModule module1 = this.lIIIIlIIllIIlIIlIIIlIIllI(scaledResolution, mouseX, mouseY); + if (!(draggingModule != null && this.IlIlIIIlllllIIIlIlIlIllII || module1 == null)) { + float[] scaledPoints = module1.getScaledPoints(scaledResolution, true); + boolean isModSizeSmall = module1.width < 22 || module1.height < 8; + boolean hoveringSettingsIcon = !isModSizeSmall && module1.isEnabled() && !module1.getSettingsList().isEmpty() && + (float) mouseX >= scaledPoints[0] * module1.masterScale() && + (float) mouseX <= (scaledPoints[0] + 10.0F) * module1.masterScale() && + (float) mouseY >= (scaledPoints[1] + module1.height - 10.0F) * module1.masterScale() && + (float) mouseY <= (scaledPoints[1] + module1.height + 2.0f) * module1.masterScale(); + boolean hoveringDeleteIcon = !isModSizeSmall && module1.isEnabled() && + (float) mouseX > (scaledPoints[0] + module1.width - 10.0F) * module1.masterScale() && + (float) mouseX < (scaledPoints[0] + module1.width + 2.0f) * module1.masterScale() && + (float) mouseY > (scaledPoints[1] + module1.height - 10.0F) * module1.masterScale() && + (float) mouseY < (scaledPoints[1] + module1.height + 2.0f) * module1.masterScale(); + boolean hoveringSettingsShiftedIcon = isModSizeSmall && module1.isEnabled() && !module1.getSettingsList().isEmpty() && + (float) mouseX >= (scaledPoints[0] + module1.width / 2 - 10.0f) * module1.masterScale() && + (float) mouseX <= (scaledPoints[0] + module1.width / 2 - 2.0F) * module1.masterScale() && + (float) mouseY >= (scaledPoints[1] + module1.height + 2.0F) * module1.masterScale() && + (float) mouseY <= (scaledPoints[1] + module1.height + 12.0f) * module1.masterScale(); + boolean hoveringDeleteShiftedIcon = isModSizeSmall && module1.isEnabled() && + (float) mouseX > (scaledPoints[0] + module1.width / 2 + 0.0F) * module1.masterScale() && + (float) mouseX < (scaledPoints[0] + module1.width / 2 + 8.0f) * module1.masterScale() && + (float) mouseY > (scaledPoints[1] + module1.height + 2.0F) * module1.masterScale() && + (float) mouseY < (scaledPoints[1] + module1.height + 12.0f) * module1.masterScale(); + if (hoveringSettingsIcon || hoveringSettingsShiftedIcon) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + ((ModuleListElement) this.settingsElement).isCheatBreakerSettings = false; + ((ModuleListElement) this.settingsElement).module = module1; + this.currentScrollableElement = this.settingsElement; + } else if (hoveringDeleteIcon || hoveringDeleteShiftedIcon) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + module1.setState(false); + } + if (!isModSizeSmall) { + return; + } + + } + for (AbstractModule module : this.modules) { + GuiAnchor anchor; + ScreenLocation screenLocation; + if (module.getGuiAnchor() == null || !module.isEnabled() || module == CheatBreaker.getInstance().getModuleManager().miniMapMod) + continue; + float[] arrf = module.getScaledPoints(scaledResolution, true); + boolean bl4 = (float) mouseX > arrf[0] * module.masterScale() && (float) mouseX < (arrf[0] + module.width) * module.masterScale() && (float) mouseY > arrf[1] * module.masterScale() && (float) mouseY < (arrf[1] + module.height) * module.masterScale(); + boolean bl5 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_BOTTOM || !bl4 && (float) mouseX >= (arrf[0] + module.width - (float) 5) * module.masterScale() && (float) mouseX <= (arrf[0] + module.width + (float) 5) * module.masterScale() && (float) mouseY >= (arrf[1] - (float) 5) * module.masterScale() && (float) mouseY <= (arrf[1] + (float) 5) * module.masterScale(); + boolean bl6 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_TOP || !bl4 && (float) mouseX >= (arrf[0] - (float) 5) * module.masterScale() && (float) mouseX <= (arrf[0] + (float) 5) * module.masterScale() && (float) mouseY >= (arrf[1] + module.height - (float) 5) * module.masterScale() && (float) mouseY <= (arrf[1] + module.height + (float) 5) * module.masterScale(); + boolean bl7 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_BOTTOM || !bl4 && (float) mouseX >= (arrf[0] - (float) 5) * module.masterScale() && (float) mouseX <= (arrf[0] + (float) 5) * module.masterScale() && (float) mouseY >= (arrf[1] - (float) 5) * module.masterScale() && (float) mouseY <= (arrf[1] + (float) 5) * module.masterScale(); + boolean bl = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_TOP || !bl4 && (float) mouseX >= (arrf[0] + module.width - (float) 5) * module.masterScale() && (float) mouseX <= (arrf[0] + module.width + (float) 5) * module.masterScale() && (float) mouseY >= (arrf[1] + module.height - (float) 5) * module.masterScale() && (float) mouseY <= (arrf[1] + module.height + (float) 5) * module.masterScale(); + if (this.mouseX != -1 || !bl5 && !bl6 && !bl7 && !bl) continue; + if (bl5) { + screenLocation = ScreenLocation.LEFT_BOTTOM; + anchor = GuiAnchor.LEFT_BOTTOM; + } else if (bl6) { + screenLocation = ScreenLocation.RIGHT_TOP; + anchor = GuiAnchor.RIGHT_TOP; + } else if (bl7) { + screenLocation = ScreenLocation.RIGHT_BOTTOM; + anchor = GuiAnchor.RIGHT_BOTTOM; + } else { + screenLocation = ScreenLocation.LEFT_TOP; + anchor = GuiAnchor.LEFT_TOP; + } + if (this.lIIIIIIIIIlIllIIllIlIIlIl(scaledResolution, mouseX, mouseY)) continue; + if (mouseButton == 0) { + this.undoList.add(new ModuleActionData(this, this.positions)); + this.dataHolder = new ModuleDataHolder(this, module, screenLocation, mouseX, mouseY); + this.lIIIIlIIllIIlIIlIIIlIIllI(module, anchor, mouseX, mouseY, scaledResolution); + } else if (mouseButton == 1) { + GuiAnchor cBGuiAnchor2 = module.getGuiAnchor(); + this.lIIIIlIIllIIlIIlIIIlIIllI(module, anchor, mouseX, mouseY, scaledResolution); + module.scale.setValue(1.0f); + this.lIIIIlIIllIIlIIlIIIlIIllI(module, cBGuiAnchor2, mouseX, mouseY, scaledResolution); + } + return; + } + if (draggingModule == null) { + if (this.showGuidesButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.showModSizeOutline = !this.showModSizeOutline; + } else if (this.bugReportButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + this.isBugReportOpen = !this.isBugReportOpen; + if (this.isBugReportOpen) { + this.bugReportTextField.setFocused(true); + } + } + this.handleMainButtonPress(mouseX, mouseY, mouseButton); + this.lIIIIlIIllIIlIIlIIIlIIllI(scaledResolution, mouseX, mouseY, mouseButton); + } + for (AbstractModulesGuiElement abstractModulesGuiElement : this.buttons) { + if (!abstractModulesGuiElement.isMouseInside(mouseX, mouseY)) continue; + return; + } + boolean bl = this.lIIIIIIIIIlIllIIllIlIIlIl(scaledResolution, mouseX, mouseY); + if (bl) { + return; + } + if (!this.positions.isEmpty()) { + this.positions.clear(); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + this.mouseX = mouseX; + this.mouseY = mouseY; + } + if (!this.positions.isEmpty()) { + this.arrowKeyMoves = 0; + } + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + int n = Mouse.getEventDWheel(); + if (this.allElements != null) { + this.allElements.onScroll(n); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(AbstractModule module, GuiAnchor anchor, int n, int n2, ScaledResolution resolution) { + if (anchor != module.getGuiAnchor()) { + float[] arrf = module.getScaledPoints(resolution, true); + module.setAnchor(anchor); + float[] arrf2 = module.getScaledPoints(resolution, false); + module.setTranslations(arrf[0] * module.masterScale() - arrf2[0] * module.masterScale(), arrf[1] * module.masterScale() - arrf2[1] * module.masterScale()); + } + } + + @Override + public void mouseReleased(int mouseX, int mouseY, int partialTicks) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + if (this.dataHolder != null && partialTicks == 0) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.dataHolder.module, this.dataHolder.anchor, mouseX, mouseY, scaledResolution); + this.dataHolder = null; + } + if (draggingModule != null && partialTicks == 0) { + if (this.IlIlIIIlllllIIIlIlIlIllII) { + for (ModulePosition position : this.positions) { + GuiAnchor anchor = AnchorHelper.getAnchor(mouseX, mouseY, scaledResolution); + if (anchor == GuiAnchor.MIDDLE_MIDDLE || anchor == position.module.getGuiAnchor() || !this.IlIlIIIlllllIIIlIlIlIllII) + continue; + this.lIIIIlIIllIIlIIlIIIlIIllI(position.module, anchor, mouseX, mouseY, scaledResolution); + position.x = (float) mouseX - position.module.getXTranslation(); + position.y = (float) mouseY - position.module.getYTranslation(); + } + if (this.getSelectedModules(draggingModule) == null) { + Object object = draggingModule.getScaledPoints(scaledResolution, true); + float x = (float) mouseX - draggingModule.getXTranslation(); + float y = (float) mouseY - draggingModule.getYTranslation(); + this.positions.add(new ModulePosition(draggingModule, x, y)); + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + draggingModule = null; + } + } + + @Override + public void keyTyped(char c, int n) throws IOException { + if (n == 1) { + CheatBreaker.getInstance().configManager.updateProfile(); + } + super.keyTyped(c, n); + if (this.isBugReportOpen) { + if (n == 28) { + DebugInfoHandler.ReportThatBug(this.bugReportTextField.getText()); + } + this.bugReportTextField.textboxKeyTyped(c, n); + } + if (n == 30 && HudLayoutEditorGui.isCtrlKeyDown()) { + for (AbstractModule module : this.modules) { + if (module.isEnabled() && module.getGuiAnchor() != null && this.getSelectedModules(module) == null) { + float f4 = (float) mouseX - module.getXTranslation() * module.masterScale(); + float f5 = (float) mouseY - module.getYTranslation() * module.masterScale(); + this.positions.add(new ModulePosition(module, f4, f5)); + } + } + } + if (n == 45 && HudLayoutEditorGui.isCtrlKeyDown()) { + for (AbstractModule module : this.modules) { + if (this.getSelectedModules(module) != null) { + module.setState(false); + } + } + } + if (n == 19 && HudLayoutEditorGui.isCtrlKeyDown()) { + for (AbstractModule module : this.modules) { + if (this.getSelectedModules(module) != null) { + module.scale.setValue(1.0F); + } + } + } + + if (n == 44 && HudLayoutEditorGui.isCtrlKeyDown()) { + if (!this.undoList.isEmpty()) { + int n2 = this.undoList.size() - 1; + ModuleActionData moduleActionData = this.undoList.get(this.undoList.size() - 1); + for (int i = 0; i < moduleActionData.moduleList.size(); ++i) { + AbstractModule abstractModule = moduleActionData.moduleList.get(i); + float f = moduleActionData.xTranslationList.get(i); + float f2 = moduleActionData.yTranslationList.get(i); + GuiAnchor cBGuiAnchor = moduleActionData.guiAnchorList.get(i); + Float f3 = (Float) moduleActionData.valueList.get(i); + abstractModule.setAnchor(cBGuiAnchor); + abstractModule.setTranslations(f, f2); + abstractModule.scale.setValue(f3); + } + if (this.redo.size() > 50) { + this.redo.remove(0); + } + this.redo.add(moduleActionData); + this.undoList.remove(n2); + } + } else if (n == 21 && HudLayoutEditorGui.isCtrlKeyDown()) { + if (!this.redo.isEmpty()) { + int n3 = this.redo.size() - 1; + ModuleActionData moduleActionData = this.redo.get(this.redo.size() - 1); + for (int i = 0; i < moduleActionData.moduleList.size(); ++i) { + AbstractModule abstractModule = moduleActionData.moduleList.get(i); + float f = moduleActionData.xTranslationList.get(i); + float f4 = moduleActionData.yTranslationList.get(i); + GuiAnchor cBGuiAnchor = moduleActionData.guiAnchorList.get(i); + Float f5 = (Float) moduleActionData.valueList.get(i); + abstractModule.setAnchor(cBGuiAnchor); + abstractModule.setTranslations(f, f4); + abstractModule.scale.setValue(f5); + } + if (this.redo.size() > 50) { + this.redo.remove(0); + } + this.undoList.add(moduleActionData); + this.redo.remove(n3); + } + } else { + this.arrowKeyMoves = 0; + for (ModulePosition cBModulePosition : this.positions) { + AbstractModule abstractModule = cBModulePosition.module; + if (abstractModule == null) continue; + float amount = 1.0f; + if (HudLayoutEditorGui.isCtrlKeyDown() && HudLayoutEditorGui.isShiftKeyDown()) { + amount = 1.0f / CheatBreaker.getScaleFactor() / 4; + } else if (HudLayoutEditorGui.isCtrlKeyDown()) { + amount = 4.0f; + } else if (HudLayoutEditorGui.isShiftKeyDown()) { + amount = 1.0f / CheatBreaker.getScaleFactor() / 2; + } + switch (n) { + case 203: + abstractModule.setTranslations(abstractModule.getXTranslation() - amount, abstractModule.getYTranslation()); + break; + case 205: + abstractModule.setTranslations(abstractModule.getXTranslation() + amount, abstractModule.getYTranslation()); + break; + case 200: + abstractModule.setTranslations(abstractModule.getXTranslation(), abstractModule.getYTranslation() - amount); + break; + case 208: + abstractModule.setTranslations(abstractModule.getXTranslation(), abstractModule.getYTranslation() + amount); + } + } + } + } + + private void snapHorizontalPosition(float currentPos) { + for (ModulePosition position : this.positions) { + position.module.setTranslations(position.module.getXTranslation() + currentPos, position.module.getYTranslation()); + } + } + + private void snapVerticalPosition(float currentPos) { + for (ModulePosition position : this.positions) { + position.module.setTranslations(position.module.getXTranslation(), position.module.getYTranslation() + currentPos); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ScaledResolution scaledResolution, int mouseX, int mouseY, int n3) { + for (AbstractModule module : this.modules) { + float[] scaledPoints; + if (module.getGuiAnchor() == null || !module.isEnabled() || module.getName().contains("Zans")/* && CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().hide*/) + continue; +// float f = module.width; +// float f2 = module.height; +// float f3 = 18; +// if (f < f3) { +// module.width = f3; +// } +// if (f2 < (float)18) { +// module.height = 18; +// } + if (!((float) mouseX > (scaledPoints = module.getScaledPoints(scaledResolution, true))[0] * module.masterScale() && + (float) mouseX < (scaledPoints[0] + module.width) * module.masterScale() && + (float) mouseY > scaledPoints[1] * module.masterScale() && + (float) mouseY < (scaledPoints[1] + module.height) * module.masterScale())) continue; + //Mark + boolean bl3 = !module.getSettingsList().isEmpty() && + (float) mouseX >= scaledPoints[0] * module.masterScale() && + (float) mouseX <= (scaledPoints[0] + (float) 10) * module.masterScale() && + (float) mouseY >= (scaledPoints[1] + module.height - (float) 10) * module.masterScale() && + (float) mouseY <= (scaledPoints[1] + module.height + 2.0f) * module.masterScale(); + boolean bl = (float) mouseX > (scaledPoints[0] + module.width - (float) 10) * module.masterScale() && + (float) mouseX < (scaledPoints[0] + module.width + 2.0f) * module.masterScale() && + (float) mouseY > (scaledPoints[1] + module.height - (float) 10) * module.masterScale() && + (float) mouseY < (scaledPoints[1] + module.height + 2.0f) * module.masterScale(); + boolean bl57 = !module.getSettingsList().isEmpty() && + (float) mouseX >= (scaledPoints[0] + module.width / 2 - 10.0f) * module.masterScale() && + (float) mouseX <= (scaledPoints[0] + module.width / 2 - 2.0F) * module.masterScale() && + (float) mouseY >= (scaledPoints[1] + module.height + 2.0F) * module.masterScale() && + (float) mouseY <= (scaledPoints[1] + module.height + 12.0f) * module.masterScale(); + boolean bl4 = + (float) mouseX > (scaledPoints[0] + module.width / 2 + 0.0f) * module.masterScale() && + (float) mouseX < (scaledPoints[0] + module.width / 2 + 8.0f) * module.masterScale() && + (float) mouseY > (scaledPoints[1] + module.height + 2.0F) * module.masterScale() && + (float) mouseY < (scaledPoints[1] + module.height + 12.0f) * module.masterScale(); + boolean isModSizeSmall = module.width < 22 || module.height < 8; + boolean d = isModSizeSmall ? !bl57 && !bl4 : !bl3 && !bl; + if (n3 == 0 && d && module != CheatBreaker.getInstance().getModuleManager().miniMapMod) { + boolean bl5 = true; + if (this.getSelectedModules(module) != null) { + this.removeModuleFromPositions(module); + bl5 = false; + } + float f4 = (float) mouseX - module.getXTranslation() * module.masterScale(); + float f5 = (float) mouseY - module.getYTranslation() * module.masterScale(); + this.mouseX2 = mouseX; + this.mouseY2 = mouseY; + this.IlIlIIIlllllIIIlIlIlIllII = false; + draggingModule = module; + if (this.getSelectedModules(module) == null) { + if (!HudLayoutEditorGui.isCtrlKeyDown() && bl5) { + this.positions.clear(); + } + if (bl5 || !HudLayoutEditorGui.isCtrlKeyDown()) { + this.positions.add(new ModulePosition(module, f4, f5)); + } + } + this.setSelectedModulesPosition(scaledResolution, mouseX, mouseY); + } + if (!(n3 != 0 || this.allElements != null && this.allElements.isMouseInside(mouseX, mouseY))) { + if (isModSizeSmall ? bl57 : bl3) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + ((ModuleListElement) this.settingsElement).isCheatBreakerSettings = false; + ((ModuleListElement) this.settingsElement).module = module; + this.currentScrollableElement = this.settingsElement; + } else if (isModSizeSmall ? bl4 : bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + module.setState(false); + } + } else if (n3 == 1) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.undoList.add(new ModuleActionData(this, this.positions)); + float[] snapPositions = AnchorHelper.getSnapPositions(module.getGuiAnchor()); + if ((module == CheatBreaker.getInstance().getModuleManager().chatMod/* || module == CheatBreaker.getInstance().getModuleManager().playerListMod*/) && module.getGuiAnchor() == module.getDefaultGuiAnchor()) { + module.setTranslations(module.defaultXTranslation, module.defaultYTranslation); + } else { + module.setTranslations(snapPositions[0], snapPositions[1]); + } + + } + if (module == CheatBreaker.getInstance().getModuleManager().miniMapMod) continue; + break; + } + } + + private void handleMainButtonPress(int n, int n2, int n3) { + for (ModulesGuiButtonElement button : this.buttons) { + if (n3 != 0 || !button.isMouseInside(n, n2) || allMenusClosed) continue; + if (button.scrollableElement != null && this.allElements != button.scrollableElement && this.currentScrollableElement == null) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.currentScrollableElement = button.scrollableElement; + continue; + } + if (button.scrollableElement == null || this.currentScrollableElement != null) continue; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + allMenusClosed = true; + } + } + + private AbstractModule lIIIIlIIllIIlIIlIIIlIIllI(ScaledResolution scaledResolution, int n, int n2) { + for (AbstractModule module : this.modules) { + if (module.getGuiAnchor() == null) continue; + float[] arrf = module.getScaledPoints(scaledResolution, true); + boolean bl2 = !module.getSettingsList().isEmpty() && + (float) n >= arrf[0] * module.masterScale() && + (float) n <= (arrf[0] + (float) 10) * module.masterScale() && + (float) n2 >= (arrf[1] + module.height - (float) 10) * module.masterScale() && + (float) n2 <= (arrf[1] + module.height + 2.0f) * module.masterScale(); + boolean bl = + (float) n > (arrf[0] + module.width - (float) 10) * module.masterScale() && + (float) n < (arrf[0] + module.width + 2.0f) * module.masterScale() && + (float) n2 > (arrf[1] + module.height - (float) 10) * module.masterScale() && + (float) n2 < (arrf[1] + module.height + 2.0f) * module.masterScale(); + boolean bl3 = !module.getSettingsList().isEmpty() && + (float) n >= (arrf[0] + module.width / 2 - 10.0f) * module.masterScale() && + (float) n <= (arrf[0] + module.width / 2 - 2.0F) * module.masterScale() && + (float) n2 >= (arrf[1] + module.height + 2.0F) * module.masterScale() && + (float) n2 <= (arrf[1] + module.height + 12.0f) * module.masterScale(); + boolean bl4 = + (float) n > (arrf[0] + module.width / 2 + 0.0f) * module.masterScale() && + (float) n < (arrf[0] + module.width / 2 + 8.0f) * module.masterScale() && + (float) n2 > (arrf[1] + module.height + 2.0F) * module.masterScale() && + (float) n2 < (arrf[1] + module.height + 12.0f) * module.masterScale(); + if (!bl && !bl2 && !bl3 && !bl4) continue; + return module; + } + return null; + } + + private boolean lIIIIIIIIIlIllIIllIlIIlIl(ScaledResolution scaledResolution, int n, int n2) { + boolean bl = false; + for (AbstractModule abstractModule : this.modules) { + if (abstractModule.getGuiAnchor() == null) continue; + float[] arrf = abstractModule.getScaledPoints(scaledResolution, true); + boolean bl2 = (float) n > arrf[0] * abstractModule.masterScale() && (float) n < (arrf[0] + abstractModule.width) * abstractModule.masterScale() && (float) n2 > arrf[1] * abstractModule.masterScale() && (float) n2 < (arrf[1] + abstractModule.height) * abstractModule.masterScale(); + bl = bl || bl2; + } + return bl; + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI(float scale, AbstractModule module, ScaledResolution scaledResolution, int mouseX, int mouseY, boolean bl) { + int n3; + int n4; + int n5; + int n6 = 0; + float[] object; + if (module.getGuiAnchor() == null || !module.isEnabled() || module == CheatBreaker.getInstance().getModuleManager().miniMapMod || !module.notRenderHUD && !module.isRenderHud()) { + return true; + } + boolean bl3 = false; +// float f2 = 18.0F; +// if (module.width < f2) { +// module.width = (int)f2; +// } +// if (module.height < 18.0F) { +// module.height = 18; +// } + GL11.glPushMatrix(); + float[] arrf = module.getScaledPoints(scaledResolution, true); + module.scaleAndTranslate(scaledResolution); + boolean bl2 = this.mouseX != -1; + if (bl2) { + Rectangle rec = new Rectangle((int) (arrf[0] * module.masterScale() - 2.0f), (int) (arrf[1] * module.masterScale() - 2.0f), (int) (module.width * module.masterScale() + (float) 4), (int) (module.height * module.masterScale() + (float) 4)); + n6 = Math.min(this.mouseX, mouseX); + n5 = Math.min(this.mouseY, mouseY); + n4 = Math.max(this.mouseX, mouseX) - n6; + n3 = Math.max(this.mouseY, mouseY) - n5; + Rectangle rectangle = new Rectangle(n6, n5, n4, n3); + bl2 = rec.intersects(rectangle); + } + object = module.getScaledPoints(scaledResolution, true); + boolean isModSizeSmall = module.width < 22 || module.height < 8; + boolean isHoveringOverMod = + (float) mouseX > object[0] * module.masterScale() && + (float) mouseX < (object[0] + module.width) * module.masterScale() && + (float) mouseY > object[1] * module.masterScale() && + (float) mouseY < (object[1] + module.height) * module.masterScale(); + boolean hasHoveredOverMod = + (float) mouseX > object[0] * module.masterScale() && + (float) mouseX < (object[0] + module.width) * module.masterScale() && + (float) mouseY > object[1] * module.masterScale() && + (float) mouseY < (object[1] + module.height + 10.0F) * module.masterScale(); + if (!this.showModSizeOutline) { + if (this.getSelectedModules(module) != null || bl2) { + Gui.drawRectWithOutline(0.0f, 0.0f, module.width, module.height, 0.4f, 0x9F00FFFF, isHoveringOverMod ? 0x2aFFFFFF : 0x1AFFFFFF); + } else { + Gui.drawRectWithOutline(0.0f, 0.0f, module.width, module.height, 0.4f, isHoveringOverMod ? 0x80FFFFFF : 0x6FFFFFFF, isHoveringOverMod ? 0x3aFFFFFF : 0x1AFFFFFF); + } + } + if (!this.showModSizeOutline && (isHoveringOverMod || isModSizeSmall && hasHoveredOverMod)) { + n5 = !module.getSettingsList().isEmpty() && + (float) mouseX >= (object[0] + 2.0f) * module.masterScale() && + (float) mouseX <= (object[0] + (float) 10) * module.masterScale() && + (float) mouseY >= (object[1] + module.height - (float) 8) * module.masterScale() && + (float) mouseY <= (object[1] + module.height - 2.0f) * module.masterScale() ? 1 : 0; + n4 = (float) mouseX > (object[0] + module.width - (float) 10) * module.masterScale() && + (float) mouseX < (object[0] + module.width - 2.0f) * module.masterScale() && + (float) mouseY > (object[1] + module.height - (float) 8) * module.masterScale() && + (float) mouseY < (object[1] + module.height - 2.0f) * module.masterScale() ? 1 : 0; + int n53 = !module.getSettingsList().isEmpty() && + (float) mouseX >= (object[0] + module.width / 2 - 10.0f) * module.masterScale() && + (float) mouseX <= (object[0] + module.width / 2 - 2.0F) * module.masterScale() && + (float) mouseY >= (object[1] + module.height + 2.0F) * module.masterScale() && + (float) mouseY <= (object[1] + module.height + 10.0f) * module.masterScale() ? 1 : 0; + int n43 = (float) mouseX > (object[0] + module.width / 2 + 0.0F) * module.masterScale() && + (float) mouseX < (object[0] + module.width / 2 + 8.0f) * module.masterScale() && + (float) mouseY > (object[1] + module.height + 2.0F) * module.masterScale() && + (float) mouseY < (object[1] + module.height + 10.0f) * module.masterScale() ? 1 : 0; + float cogXPos = isModSizeSmall ? module.width / 2 - 7.0F : 2.0f; + float deleteXPos = isModSizeSmall ? module.width / 2 + 1 : module.width - 8.0F; + float yPos = isModSizeSmall ? module.height + 2.0F : module.height - 7.5f; + if (!module.getSettingsList().isEmpty()) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, (isModSizeSmall ? n53 != 0 : n5 != 0) ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.settingsIcon, 3.0F, cogXPos, yPos); + } + GL11.glColor4f(0.8f, 0.2f, 0.2f, (isModSizeSmall ? n43 != 0 : n4 != 0) ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.deleteIcon, 3.0F, deleteXPos, yPos); + } + GL11.glPushMatrix(); + float f3 = scale / module.masterScale(); + GL11.glScalef(f3, f3, f3); + if (bl) { + n4 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_BOTTOM || n6 == 0 && (float) mouseX >= (object[0] + module.width - (float) 5) * module.masterScale() && (float) mouseX <= (object[0] + module.width + (float) 5) * module.masterScale() && (float) mouseY >= (object[1] - (float) 5) * module.masterScale() && (float) mouseY <= (object[1] + (float) 5) * module.masterScale() ? 1 : 0; + n3 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_TOP || n6 == 0 && (float) mouseX >= (object[0] - (float) 5) * module.masterScale() && (float) mouseX <= (object[0] + (float) 5) * module.masterScale() && (float) mouseY >= (object[1] + module.height - (float) 5) * module.masterScale() && (float) mouseY <= (object[1] + module.height + (float) 5) * module.masterScale() ? 1 : 0; + boolean bl5 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_BOTTOM || n6 == 0 && (float) mouseX >= (object[0] - (float) 5) * module.masterScale() && (float) mouseX <= (object[0] + (float) 5) * module.masterScale() && (float) mouseY >= (object[1] - (float) 5) * module.masterScale() && (float) mouseY <= (object[1] + (float) 5) * module.masterScale(); + boolean bl6 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_TOP || n6 == 0 && (float) mouseX >= (object[0] + module.width - (float) 5) * module.masterScale() && (float) mouseX <= (object[0] + module.width + (float) 5) * module.masterScale() && (float) mouseY >= (object[1] + module.height - (float) 5) * module.masterScale() && (float) mouseY <= (object[1] + module.height + (float) 5) * module.masterScale(); + GL11.glPushMatrix(); + float f4 = 4; + if (this.mouseX == -1 && bl5) { + GL11.glTranslatef(0.0f, 0.0f, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } else if (this.mouseX == -1 && n4 != 0) { + GL11.glTranslatef(module.width / f3, 0.0f, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } else if (this.mouseX == -1 && bl6) { + GL11.glTranslatef(module.width / f3, module.height / f3, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } else if (this.mouseX == -1 && n3 != 0) { + GL11.glTranslatef(0.0f, module.height / f3, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } + GL11.glPopMatrix(); + bl3 = this.mouseX == -1 && (bl5 || n4 != 0 || n3 != 0 || bl6); + } + n4 = arrf[1] - (float) CheatBreaker.getInstance().ubuntuMedium16px.getHeight() - (float) 6 < 0.0f ? 1 : 0; + float f5 = n4 != 0 ? module.height * module.masterScale() / scale : (float) (-CheatBreaker.getInstance().ubuntuMedium16px.getHeight() - 4); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showModName.getValue()) { + String name = module.getName() + (module.hiddenFromHud ? EnumChatFormatting.GRAY + " (Hidden)" : ""); + switch (module.getPosition()) { + case LEFT: + float f6 = 0.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(module.getName(), f6, f5, -1); + break; + case CENTER: + float f7 = module.width * module.masterScale() / scale / 2.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredStringWithShadow(module.getName(), f7, f5, -1); + break; + case RIGHT: + float f8 = module.width * module.masterScale() / scale - (float) CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(module.getName()); + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(module.getName(), f8, f5, -1); + } + } + GL11.glPopMatrix(); + GL11.glPopMatrix(); + return !bl3; + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ScaledResolution scaledResolution) { + if (!Mouse.isButtonDown(1) && draggingModule != null) { + for (ModulePosition position : this.positions) { + if (position.module != draggingModule || !(Boolean) CheatBreaker.getInstance().getGlobalSettings().snapModules.getValue()) + continue; + Object var5_5 = null; + for (AbstractModule abstractModule : this.modules) { + float[] positionScaledPoints = position.module.getScaledPoints(scaledResolution, true); + float centerHorizontalSnap = this.width / 2 - (positionScaledPoints[0] + position.module.width / 2) * position.module.masterScale(); + float centerVerticalSnap = this.height / 2 - (positionScaledPoints[1] + position.module.height / 2) * position.module.masterScale(); + float snappingStrength = (float) CheatBreaker.getInstance().getGlobalSettings().snappingStrength.getValue(); + if (centerVerticalSnap >= -snappingStrength && centerVerticalSnap <= snappingStrength) { + RenderUtil.drawRoundedRect(0.0, this.height / 2 - 0.25f, this.width, this.height / 2 + 0.25f, 0.0, -3596854); + } + if (centerHorizontalSnap >= -snappingStrength && centerHorizontalSnap <= snappingStrength) { + RenderUtil.drawRoundedRect(this.width / 2 - 0.25f, 0.0, this.width / 2 + 0.25f, this.height, 0.0, -3596854); + } + if (this.getSelectedModules(abstractModule) != null || abstractModule.getGuiAnchor() == null || !abstractModule.isEnabled() || abstractModule == CheatBreaker.getInstance().getModuleManager().miniMapMod || !abstractModule.notRenderHUD && !abstractModule.isRenderHud() || var5_5 != null && var5_5 != abstractModule) + continue; + float[] moduleScaledPoints = abstractModule.getScaledPoints(scaledResolution, true); + boolean highlightNeighborMods = false; + float f2 = moduleScaledPoints[0] * abstractModule.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f3 = (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f4 = (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f5 = moduleScaledPoints[0] * abstractModule.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f6 = moduleScaledPoints[1] * abstractModule.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + float f7 = (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + float f8 = (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + float f9 = moduleScaledPoints[1] * abstractModule.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + if (f2 >= -snappingStrength && f2 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(moduleScaledPoints[0] * abstractModule.masterScale() - 0.6666667f * 0.75f, 0.0, moduleScaledPoints[0] * abstractModule.masterScale(), this.height, 0.0, -3596854); + } + if (f3 >= -snappingStrength && f3 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect((moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale(), 0.0, (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() + 1.7272727f * 0.28947368f, this.height, 0.0, -3596854); + } + if (f5 >= -snappingStrength && f5 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(moduleScaledPoints[0] * abstractModule.masterScale(), 0.0, moduleScaledPoints[0] * abstractModule.masterScale() + 0.29775283f * 1.6792452f, this.height, 0.0, 0xFFC91DCA); + } + if (f4 >= -snappingStrength && f4 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect((moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale(), 0.0, (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() + 1.5238096f * 0.328125f, this.height, 0.0, -3596854); + } + if (f6 >= -snappingStrength && f6 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, moduleScaledPoints[1] * abstractModule.masterScale(), this.width, moduleScaledPoints[1] * abstractModule.masterScale() + 0.3888889f * 1.2857143f, 0.0, -3596854); + } + if (f7 >= -snappingStrength && f7 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale(), this.width, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() + 0.51724136f * 0.9666667f, 0.0, -3596854); + } + if (f9 >= -snappingStrength && f9 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, moduleScaledPoints[1] * abstractModule.masterScale(), this.width, moduleScaledPoints[1] * abstractModule.masterScale() + 0.16666667f * 3.0f, 0.0, -3596854); + } + if (f8 >= -snappingStrength && f8 <= snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() - 0.5810811f * 0.8604651f, this.width, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale(), 0.0, -3596854); + } + if (!highlightNeighborMods) continue; + GL11.glPushMatrix(); + abstractModule.scaleAndTranslate(scaledResolution); + Gui.drawRectWithOutline(0.0f, 0.0f, abstractModule.width, abstractModule.height, 0.01923077f * 26.0f, 0, 449387978); + GL11.glPopMatrix(); + } + } + } + } + + private float lIIIIlIIllIIlIIlIIIlIIllI(AbstractModule abstractModule, float f, float[] arrf, int n) { + float f2 = f; + float f3 = 2.0f; + if (f2 + arrf[0] * abstractModule.masterScale() < f3) { + f2 = -arrf[0] * abstractModule.masterScale() + f3; + } else if (f2 + arrf[0] * abstractModule.masterScale() + (float) n > (float) this.width - f3) { + f2 = (float) this.width - arrf[0] * abstractModule.masterScale() - (float) n - f3; + } + return f2; + } + + private float lIIIIIIIIIlIllIIllIlIIlIl(AbstractModule abstractModule, float f, float[] arrf, int n) { + float f2 = f; + float f3 = 2.0f; + if (f2 + arrf[1] * abstractModule.masterScale() < f3) { + f2 = -arrf[1] * abstractModule.masterScale() + f3; + } else if (f2 + arrf[1] * abstractModule.masterScale() + (float) n > (float) this.height - f3) { + f2 = (float) this.height - arrf[1] * abstractModule.masterScale() - (float) n - f3; + } + return f2; + } + + private void dragModule(ModulePosition modulePosition, int n, int n2, ScaledResolution scaledResolution) { + if (modulePosition.module.getGuiAnchor() == null || !modulePosition.module.isEnabled() || modulePosition.module == CheatBreaker.getInstance().getModuleManager().miniMapMod || !modulePosition.module.notRenderHUD && !modulePosition.module.isRenderHud()) { + return; + } + float f = (float) n - modulePosition.x; + float f2 = (float) n2 - modulePosition.y; + if (!(this.IlIlIIIlllllIIIlIlIlIllII || modulePosition.module != draggingModule || (float) n == this.mouseX2 && (float) n2 == this.mouseY2)) { + if (this.undoList.size() > 50) { + this.undoList.remove(0); + } + this.undoList.add(new ModuleActionData(this, this.positions)); + CheatBreaker.getInstance().getConfigManager().createNewProfile(); + this.IlIlIIIlllllIIIlIlIlIllII = true; + } + float[] arrf = modulePosition.module.getScaledPoints(scaledResolution, false); + if (!Mouse.isButtonDown(1) && this.IlIlIIIlllllIIIlIlIlIllII && modulePosition.module == draggingModule) { + float f3 = f; + float f4 = f2; + f = this.lIIIIlIIllIIlIIlIIIlIIllI(modulePosition.module, f, arrf, (int) (modulePosition.module.width * modulePosition.module.masterScale())); + f2 = this.lIIIIIIIIIlIllIIllIlIIlIl(modulePosition.module, f2, arrf, (int) (modulePosition.module.height * modulePosition.module.masterScale())); + float f5 = f3 - f; + float f6 = f4 - f2; + for (ModulePosition positions : this.positions) { + if (positions == modulePosition) continue; + arrf = positions.module.getScaledPoints(scaledResolution, false); + float f7 = this.lIIIIlIIllIIlIIlIIIlIIllI(positions.module, positions.module.getXTranslation() - f5, arrf, (int) (positions.module.width * positions.module.masterScale())); + float f8 = this.lIIIIIIIIIlIllIIllIlIIlIl(positions.module, positions.module.getYTranslation() - f6, arrf, (int) (positions.module.height * positions.module.masterScale())); + positions.module.setTranslations(f7, f8); + } + } + if (this.IlIlIIIlllllIIIlIlIlIllII) { + modulePosition.module.setTranslations(f, f2); + } + } + + private void setDirection(int n) { + if (allMenusClosed) { + if (this.allElements != null) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.allElements, true, n); + } + } else if (this.currentScrollableElement != null) { + if (this.allElements != null) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.allElements, true, n); + } + this.lIIIIlIIllIIlIIlIIIlIIllI(this.currentScrollableElement, false, n); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(AbstractScrollableElement abstractScrollableElement, boolean bl, int n) { + if (bl) { + abstractScrollableElement.x = abstractScrollableElement.x2; + allMenusClosed = false; + this.allElements = null; + } else { + abstractScrollableElement.x = n / 2 - 185; + this.currentScrollableElement = null; + this.allElements = abstractScrollableElement; + } + } + + public static float getFPSTransitionSpeed(float f) { + float f2 = f / (float) (Minecraft.debugFPS + 1); + return Math.max(f2, 1.0f); + } + + private ModulePosition getSelectedModules(AbstractModule module) { + for (ModulePosition position : this.positions) { + if (module != position.module) continue; + return position; + } + return null; + } + + private void setSelectedModulesPosition(ScaledResolution scaledResolution, int n, int n2) { + for (ModulePosition position : this.positions) { + if (position.module == null || position.module.getGuiAnchor() == null) continue; + position.x = (float) n - position.module.getXTranslation(); + position.y = (float) n2 - position.module.getYTranslation(); + } + } + + private void removeModuleFromPositions(AbstractModule abstractModule) { + this.positions.removeIf(cBModulePosition -> cBModulePosition.module == abstractModule); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModuleActionData.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModuleActionData.java new file mode 100644 index 0000000..8f113f9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModuleActionData.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.AbstractModule; + +import java.util.ArrayList; +import java.util.List; + +public class ModuleActionData { + protected List moduleList; + List guiAnchorList; + List xTranslationList; + List yTranslationList; + List valueList; + final HudLayoutEditorGui hudEditorGui; + + ModuleActionData(HudLayoutEditorGui hudEditorGui, List positions) { + this.hudEditorGui = hudEditorGui; + ArrayList moduleList = new ArrayList(); + ArrayList guiAnchorList = new ArrayList(); + ArrayList xTranslationList = new ArrayList(); + ArrayList yTranslationList = new ArrayList(); + ArrayList valueList = new ArrayList(); + for (ModulePosition position : positions) { + if (position.module.getGuiAnchor() == null) continue; + moduleList.add(position.module); + guiAnchorList.add(position.module.getGuiAnchor()); + xTranslationList.add(position.module.getXTranslation()); + yTranslationList.add(position.module.getYTranslation()); + valueList.add(position.module.masterScale()); + } + this.moduleList = moduleList; + this.guiAnchorList = guiAnchorList; + this.xTranslationList = xTranslationList; + this.yTranslationList = yTranslationList; + this.valueList = valueList; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModuleDataHolder.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModuleDataHolder.java new file mode 100644 index 0000000..68f53f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModuleDataHolder.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.ScreenLocation; + +public class ModuleDataHolder { + public AbstractModule module; + public float xTranslation; + public float yTranslation; + public float scale; + public float width; + public float height; + public int mouseY; + public int mouseX; + public ScreenLocation screenLocation; + public GuiAnchor anchor; + public HudLayoutEditorGui layoutEditorGui; + + public ModuleDataHolder(HudLayoutEditorGui layoutEditorGui, AbstractModule module, ScreenLocation screenLocation, int mouseX, int mouseY) { + this.layoutEditorGui = layoutEditorGui; + this.module = module; + this.xTranslation = module.getXTranslation(); + this.yTranslation = module.getYTranslation(); + this.width = module.width * module.masterScale(); + this.height = module.height * module.masterScale(); + this.mouseX = mouseX; + this.mouseY = mouseY; + this.screenLocation = screenLocation; + this.scale = (Float) module.scale.getValue(); + this.anchor = module.getGuiAnchor(); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModulePlaceGui.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModulePlaceGui.java new file mode 100644 index 0000000..66424be --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModulePlaceGui.java @@ -0,0 +1,159 @@ +package com.cheatbreaker.client.ui.module; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class ModulePlaceGui extends GuiScreen { + private final AbstractModule module; + private final HudLayoutEditorGui eventButton; + + public ModulePlaceGui(HudLayoutEditorGui cBModulesGui, AbstractModule abstractModule) { + abstractModule.setState(true); + this.module = abstractModule; + this.eventButton = cBModulesGui; + } + + @Override + public void updateScreen() { + } + + @Override + public void initGui() { + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { +// if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().useBackgroundOverlay.getValue()) { +// this.drawDefaultBackground(); +// } else { + this.renderBlur(); +// } + RenderUtil.drawRoundedRect(0.0, this.height / 3, this.width, (float) (this.height / 3) + 2.1086957f * 0.23711339f, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(0.0, this.height / 3 * 2, this.width, (float) (this.height / 3 * 2) + 1.1388888f * 0.43902442f, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(this.width / 3, 0.0, (float) (this.width / 3) + 0.42073172f * 1.1884058f, this.height, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(this.width / 3 * 2, 0.0, (float) (this.width / 3 * 2) + 0.28070176f * 1.78125f, this.height, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(this.width / 3 + this.width / 6, this.height / 3 * 2, (float) (this.width / 3 + this.width / 6) + 6.7000003f * 0.07462686f, this.height, 0.0, 0x6F000000); + float f2 = 1.0f / CheatBreaker.getScaleFactor() / this.module.masterScale(); +// float f3 = (float)(CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(this.selectedButton.getName()) + 6) * f2; +// if (this.selectedButton.width < f3) { +// this.selectedButton.width = (int)f3; +// } +// if (this.selectedButton.height < (float)18) { +// this.selectedButton.height = 18; +// } + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + float[] arrf = AnchorHelper.getPositions(mouseX, mouseY, scaledResolution); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(mouseX, mouseY, scaledResolution); + if (cBGuiAnchor != GuiAnchor.MIDDLE_MIDDLE) { + if (cBGuiAnchor == GuiAnchor.MIDDLE_BOTTOM_LEFT || cBGuiAnchor == GuiAnchor.MIDDLE_BOTTOM_RIGHT) { + Gui.drawRect(arrf[0], arrf[1], arrf[0] + (float) (scaledResolution.getScaledWidth() / 6), arrf[1] + (float) (scaledResolution.getScaledHeight() / 3), 0x2F000000); + } else { + Gui.drawRect(arrf[0], arrf[1], arrf[0] + (float) (scaledResolution.getScaledWidth() / 3), arrf[1] + (float) (scaledResolution.getScaledHeight() / 3), 0x2F000000); + } + } + int n3 = scaledResolution.getScaledWidth(); + int n4 = scaledResolution.getScaledHeight(); + float[] arrf2 = AnchorHelper.getPositions(this.module, mouseX, mouseY, scaledResolution); + if (cBGuiAnchor != this.module.getGuiAnchor()) { + this.module.setAnchor(cBGuiAnchor); + this.module.setTranslations(0.0f, 0.0f); + } + if (!Mouse.isButtonDown(1)) { + RenderUtil.drawRoundedRect(2, 0.0, 1.8636363192038112 * 1.3414634466171265, n4, 0.0, -15599126); + RenderUtil.drawRoundedRect((float) n3 - 1.1197916f * 2.2325583f, 0.0, n3 - 2, n4, 0.0, -15599126); + RenderUtil.drawRoundedRect(0.0, 2, n3, 0.4375 * 5.714285714285714, 0.0, -15599126); + RenderUtil.drawRoundedRect(0.0, (float) n4 - 0.557971f * 6.2727275f, n3, n4 - 3, 0.0, -15599126); + } + float f4 = (float) mouseX - arrf[0] - arrf2[0]; + float f5 = (float) mouseY - arrf[1] - arrf2[1]; + if (!Mouse.isButtonDown(1)) { + float[] arrf3 = this.module.getScaledPoints(scaledResolution, false); + f4 = this.lIIIIlIIllIIlIIlIIIlIIllI(this.module, f4, arrf3, (float) ((int) (this.module.width * this.module.masterScale())), false); + f5 = this.lIIIIIIIIIlIllIIllIlIIlIl(this.module, f5, arrf3, (float) ((int) (this.module.height * this.module.masterScale())), false); + } + this.module.setTranslations(f4, f5); + GL11.glPushMatrix(); + this.module.scaleAndTranslate(scaledResolution); + RenderUtil.drawRoundedRect(-2, -2, this.module.width + 2.0f, this.module.height + 2.0f, 4, 551805923); + GL11.glPushMatrix(); + GL11.glScalef(f2, f2, f2); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showModName.getValue()) { + float v = mouseY < 9 ? module.height / f2 : (float) (-CheatBreaker.getInstance().ubuntuMedium16px.getHeight() - 4); + switch (module.getPosition()) { + case LEFT: + float f6 = 0.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(module.getName(), f6, v, -1); + break; + case CENTER: + float f7 = module.width / f2 / 2.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredStringWithShadow(module.getName(), f7, v, -1); + break; + case RIGHT: + float f8 = module.width / f2 - (float) CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(module.getName()); + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(module.getName(), f8, v, -1); + } + } + GL11.glPopMatrix(); + GL11.glPopMatrix(); + } + + private float lIIIIlIIllIIlIIlIIIlIIllI(AbstractModule abstractModule, float f, float[] arrf, float f2, boolean bl) { + int n; + float f3 = f; + int n2 = n = bl ? 0 : 3; + if (f3 + arrf[0] < (float) n) { + f3 = -arrf[0] + (float) n; + } else if (f3 + arrf[0] * abstractModule.masterScale() + f2 > (float) (this.width - n)) { + f3 = (int) ((float) this.width - arrf[0] * abstractModule.masterScale() - f2 - (float) n); + } + return f3; + } + + private float lIIIIIIIIIlIllIIllIlIIlIl(AbstractModule abstractModule, float f, float[] arrf, float f2, boolean bl) { + int n; + float f3 = f; + int n2 = n = bl ? 0 : 2; + if (f3 + arrf[1] < (float) n) { + f3 = -arrf[1] + (float) n; + } else if (f3 + arrf[1] * abstractModule.masterScale() + f2 > (float) (this.height - n)) { + f3 = (int) ((float) this.height - arrf[1] * abstractModule.masterScale() - f2 - (float) n); + } + return f3; + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + if (mouseButton != 0) { + return; + } + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(mouseX, mouseY, scaledResolution); + this.module.setAnchor(cBGuiAnchor); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setState(true); + HudLayoutEditorGui editorGui = new HudLayoutEditorGui(); + this.mc.displayGuiScreen(editorGui); + editorGui.currentScrollableElement = editorGui.modulesElement; + editorGui.currentScrollableElement.bottom = false; + editorGui.currentScrollableElement.scrollAmount = this.eventButton.modulesElement.scrollAmount; + editorGui.currentScrollableElement.yOffset = 0; + } + + @Override + public void mouseReleased(int n, int n2, int n3) { + } + + @Override + public void keyTyped(char c, int n) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModulePosition.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModulePosition.java new file mode 100644 index 0000000..02cccce --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ModulePosition.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.AbstractModule; + +public class ModulePosition { + protected AbstractModule module; + protected float x; + protected float y; + + ModulePosition(AbstractModule abstractModule, float f, float f2) { + this.module = abstractModule; + this.x = f; + this.y = f2; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/Position.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/Position.java new file mode 100644 index 0000000..6c5aeff --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/Position.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.ui.module; + +public enum Position { + BOTTOM("BOTTOM"), + TOP("TOP"), + CENTER("CENTER"), + LEFT("LEFT"), + RIGHT("RIGHT"); + + private final String identifier; + + Position(String identifier) { + this.identifier = identifier; + } + + + public String getIdentifier() { + return this.identifier; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ProfileCreatorGui.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ProfileCreatorGui.java new file mode 100644 index 0000000..f3afe26 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/ProfileCreatorGui.java @@ -0,0 +1,154 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.ui.element.profile.ProfileElement; +import com.cheatbreaker.client.ui.element.profile.ProfilesListElement; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.src.Config; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +public class ProfileCreatorGui extends GuiScreen { + private final GuiScreen selectedButton; + private GuiTextField textField = null; + private final float scale; + private final int highlightColor; + private final ProfilesListElement profileList; + private String errorString = ""; + private boolean showGui = false; + private Profile profile; + + public ProfileCreatorGui(Profile profile, GuiScreen guiScreen, ProfilesListElement list, int highlightColor, float scale) { + this(guiScreen, list, highlightColor, scale); + this.profile = profile; + } + + public ProfileCreatorGui(GuiScreen guiScreen, ProfilesListElement list, int highlightColor, float scale) { + this.selectedButton = guiScreen; + this.scale = scale; + this.profileList = list; + this.highlightColor = highlightColor; + this.showGui = true; + } + + @Override + public void updateScreen() { + this.textField.updateCursorCounter(); + } + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + @Override + public void initGui() { + Keyboard.enableRepeatEvents(true); + if (!this.showGui) { + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui) this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui) this.selectedButton).profilesElement; + } else { + this.showGui = false; + this.textField = new GuiTextField(299, this.mc.fontRendererObj, this.width / 2 - 70, this.height / 2 - 6, 140, 10); + if (this.profile != null) { + this.textField.setText(this.profile.getName()); + } + this.textField.setFocused(true); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.selectedButton.drawScreen(mouseX, mouseY, partialTicks); + this.drawDefaultBackground(); + ProfileCreatorGui.drawRect(this.width / 2 - 73, this.height / 2 - 19, this.width / 2 + 73, this.height / 2 + 8, -11250604); + ProfileCreatorGui.drawRect(this.width / 2 - 72, this.height / 2 - 18, this.width / 2 + 72, this.height / 2 + 7, -3881788); + GL11.glPushMatrix(); + GL11.glScalef(this.scale, this.scale, this.scale); + int n3 = (int) ((float) this.width / this.scale); + int n4 = (int) ((float) this.height / this.scale); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("Profile Name: ", (float) (n3 / 2) - (float) 70 / this.scale, (float) (n4 / 2) - (float) 17 / this.scale, 0x6F000000); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.errorString, (float) (n3 / 2) - (float) 72 / this.scale, (float) (n4 / 2) + (float) 8 / this.scale, -1358954496); + GL11.glPopMatrix(); + this.textField.drawTextBox(); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.textField.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + public void mouseReleased(int n, int n2, int n3) { + super.mouseReleased(n, n2, n3); + } + + @Override + public void keyTyped(char c, int n) { + switch (n) { + case 1: + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui) this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui) this.selectedButton).profilesElement; + break; + case 28: + if (this.textField.getText().length() < 3) { + this.errorString = EnumChatFormatting.RED + "Name must be at least 3 characters long."; + break; + } + if (this.textField.getText().equalsIgnoreCase("default")) { + this.errorString = EnumChatFormatting.RED + "That name is already in use."; + break; + } + if (!this.textField.getText().matches("([a-zA-Z0-9-_ \\]\\[]+)")) { + this.errorString = EnumChatFormatting.RED + "Illegal characters in name."; + break; + } + if (this.profile != null && !this.profile.isNotEditable()) { + File file = new File(Minecraft.getMinecraft().mcDataDir, "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-") + File.separator + "profiles" + File.separator + this.profile.getName() + ".cfg"); + File file2 = new File(Minecraft.getMinecraft().mcDataDir, "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "-") + File.separator + "profiles" + File.separator + this.textField.getText() + ".cfg"); + if (!file.exists()) break; + try { + Files.copy(file.toPath(), file2.toPath()); + Files.delete(file.toPath()); + this.profile.setName(this.textField.getText()); + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui) this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui) this.selectedButton).profilesElement; + } catch (Exception exception) { + this.errorString = EnumChatFormatting.RED + "Could not save profile."; + exception.printStackTrace(); + } + break; + } + Profile profile = null; + for (Profile profile2 : CheatBreaker.getInstance().getConfigManager().moduleProfiles) { + if (!profile2.getName().toLowerCase().equalsIgnoreCase(this.textField.getText())) continue; + profile = profile2; + break; + } + if (profile == null) { + CheatBreaker.getInstance().configManager.updateProfile(CheatBreaker.getInstance().getConfigManager().activeProfile.getName()); + Profile profile3 = new Profile(this.textField.getText(), false); + CheatBreaker.getInstance().getConfigManager().moduleProfiles.add(profile3); + CheatBreaker.getInstance().getConfigManager().activeProfile = profile3; + this.profileList.profileList.add(new ProfileElement(this.profileList, this.highlightColor, profile3, this.scale)); + CheatBreaker.getInstance().configManager.updateProfile(CheatBreaker.getInstance().getConfigManager().activeProfile.getName()); + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui) this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui) this.selectedButton).profilesElement; + break; + } + this.errorString = EnumChatFormatting.RED + "That name is already in use."; + break; + default: + this.textField.textboxKeyTyped(c, n); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/setting/InputFieldElementPromptGui.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/setting/InputFieldElementPromptGui.java new file mode 100644 index 0000000..e7932d0 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/module/setting/InputFieldElementPromptGui.java @@ -0,0 +1,119 @@ +package com.cheatbreaker.client.ui.module.setting; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.ModuleManager; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.module.ModulePreviewElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class InputFieldElementPromptGui extends GuiScreen { + private final GuiScreen selectedButton; + + private GuiTextField textField = null; + + private final float scale; + + private boolean showGui; + + private Setting setting; + + public InputFieldElementPromptGui(Setting setting, GuiScreen guiScreen, float scale) { + this(guiScreen, scale); + this.setting = setting; + } + + public InputFieldElementPromptGui(GuiScreen guiScreen, float scale) { + this.selectedButton = guiScreen; + this.scale = scale; + this.showGui = true; + } + + @Override + public void updateScreen() { + this.textField.updateCursorCounter(); + } + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + @Override + public void initGui() { + Keyboard.enableRepeatEvents(true); + if (!this.showGui) { + this.mc.displayGuiScreen(this.selectedButton); + } else { + this.showGui = false; + this.textField = new GuiTextField(299, this.mc.fontRendererObj, this.width / 2 - 70, this.height / 2 - 6, 140, 10); + if (this.setting != null) { + this.textField.setText(this.setting.getStringValue()); + } + this.textField.setFocused(true); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.selectedButton.drawScreen(mouseX, mouseY, partialTicks); + this.drawDefaultBackground(); + + drawRect(this.width / 2 - 73, this.height / 2 - 19, this.width / 2 + 73, this.height / 2 + 8, -11250604); + drawRect(this.width / 2 - 72, this.height / 2 - 18, this.width / 2 + 72, this.height / 2 + 7, -3881788); + + GL11.glPushMatrix(); + GL11.glScalef(this.scale, this.scale, this.scale); + + int n3 = (int) ((float) this.width / this.scale); + int n4 = (int) ((float) this.height / this.scale); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName(), (float) (n3 / 2) - (float) 70 / this.scale, (float) (n4 / 2) - (float) 17 / this.scale, 0x6F000000); + + GL11.glPopMatrix(); + + this.textField.setMaxStringLength(64); + this.textField.drawTextBox(); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.textField.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + public void mouseReleased(int n, int n2, int n3) { + super.mouseReleased(n, n2, n3); + } + + @Override + public void keyTyped(char c, int n) { + ModuleManager moduleManager = CheatBreaker.getInstance().getModuleManager(); + + switch (n) { + case 1: + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).modulesElement; + CheatBreaker.getInstance().getUiManager().sendBackToModList(moduleManager.currentModule); + break; + + case 28: + this.setting.setValue(this.textField.getText()); + this.mc.displayGuiScreen(this.selectedButton); + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("info", EnumChatFormatting.GREEN + "Updated custom string value successfully.", 5000L); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).modulesElement; + CheatBreaker.getInstance().getUiManager().sendBackToModList(moduleManager.currentModule); + break; + + default: + this.textField.textboxKeyTyped(c, n); + } + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/CBAlert.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/CBAlert.java new file mode 100644 index 0000000..edb72b4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/CBAlert.java @@ -0,0 +1,101 @@ +package com.cheatbreaker.client.ui.overlay; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.AbstractFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; + +public class CBAlert { + private final AbstractFade fadeTime = new FloatFade(275L); + private boolean titleBar; + private float lastHeight; + private float height; + private final String title; + private final String[] message; + private final long openTime; + + public CBAlert(String title, String[] message, float height) { + this.title = title; + this.message = message; + this.height = height; + this.lastHeight = height; + this.openTime = System.currentTimeMillis(); + } + + public void render() { + float width = (float) ((new ScaledResolution(Minecraft.getMinecraft())).getScaledWidth() - 140); + float height = (new ScaledResolution(Minecraft.getMinecraft())).getScaledHeight() + this.lastHeight - (this.lastHeight - this.height) * this.fadeTime.getFadeAmount(); + if (this.titleBar) { + Minecraft.getMinecraft().ingameGUI.drawGradientRect(width, height, width + 140.0F, height + 55.0F, -819057106, -822083584); + for (int i = 0; i < this.message.length && i <= 3; ++i) { + CheatBreaker.getInstance().playRegular14px.drawString(this.message[i], width + 4.0F, height + 4.0F + (float) (i * 10), -1); + } + } else { + Minecraft.getMinecraft().ingameGUI.drawGradientRect(width, height, width + 140.0F, height + 55.0F, -819057106, -822083584); + CheatBreaker.getInstance().playRegular14px.drawStringWithShadow(this.title, width + 4.0F, height + 4.0F, -1); + Gui.drawRect(width + 4.0F, height + 14.5f, width + 140.0F - 5.0F, height + 15.0F, 0x2E5E5E5E); + for (int i = 0; i < this.message.length && i <= 2; ++i) { + CheatBreaker.getInstance().playRegular14px.drawString(this.message[i], width + 4.0F, height + 17.0F + (float) (i * 10), -1); + } + } + if (!(Minecraft.getMinecraft().currentScreen instanceof OverlayGui)) { + CheatBreaker.getInstance().playRegular14px.drawString("Press Shift + Tab", width + 4.0F, height + (float) CBAlert.getHeight() - 12.0F, 0x6FFFFFFF); + } + } + + public void setMaxHeight(float f) { + this.lastHeight = this.height; + this.height = f; + this.fadeTime.startAnimation(); + } + + public boolean isFading() { + return !this.fadeTime.isTimeNotAtZero() || this.fadeTime.isOver(); + } + + public boolean shouldDisplay() { + return System.currentTimeMillis() - this.openTime > 3500L; + } + + public static void displayMessage(String title, String message) { + OverlayGui.getInstance().displayMessage(title, message); + } + + public static void displayMessage(String string) { + OverlayGui.getInstance().displayMessage(string); + } + + public static int getWidth() { + return 140; + } + + public static int getHeight() { + return 55; + } + + public void showTitleBar(boolean bl) { + this.titleBar = bl; + } + + public float getCurrentHeight() { + return this.lastHeight; + } + + public float getMaxHeight() { + return this.height; + } + + public void setWidth(float f) { + } + + public void setCurrentHeight(float f) { + this.lastHeight = f; + } + + public void setHeight(float f) { + this.height = f; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/ConsoleElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/ConsoleElement.java new file mode 100644 index 0000000..f3b71a5 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/ConsoleElement.java @@ -0,0 +1,213 @@ +package com.cheatbreaker.client.ui.overlay; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.shared.WSPacketConsoleMessage; +import com.cheatbreaker.client.ui.element.DraggableElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.chat.ChatHandler; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; + +public class ConsoleElement extends DraggableElement { + + private final List sentCommands = new ArrayList<>(); + private int commandIndex = 0; + + private final InputFieldElement textInputBar; + private final FlatButtonElement sendButton; + private final ScrollableElement scrollBar; + private final FlatButtonElement closeButton; + + public ConsoleElement() { + this.textInputBar = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "", 0x2FFFFFFF, 0x6FFFFFFF); + this.textInputBar.setMaxStringLength(256); + this.sendButton = new FlatButtonElement("SEND"); + this.scrollBar = new ScrollableElement(this); + this.closeButton = new FlatButtonElement("X"); + } + + @Override + public void setElementSize(float x, float y, float width, float height) { + super.setElementSize(x, y, width, height); + this.textInputBar.setElementSize(x + 2.0f, y + height - 15.0f, width - 40.0f, 13.0f); + this.sendButton.setElementSize(x + width - 37.0f, y + height - 15.0f, 35.0f, 13.0f); + this.scrollBar.setElementSize(x + width - 6.0f, y + 12.0f + 3.0f, 4.0f, height - 32.0f); + this.closeButton.setElementSize(x + width - 12.0f, y + 2.0f, 10.0f, 10.0f); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + this.onDrag(f, f2); + Gui.drawBoxWithOutLine(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0.5f, -16777216, -15395563); + GL11.glPushMatrix(); + Gui.drawRect(this.xPosition, this.yPosition - 0.5f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 0.5f, -1357572843); + CheatBreaker.getInstance().playRegular14px.drawString("Console", this.xPosition + (float) 4, this.yPosition + (float) 3, -1); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + Gui.drawRect(this.xPosition + 2.0f, this.yPosition + (float) 12 + (float) 3, this.xPosition + this.width - 2.0f, this.yPosition + this.height - (float) 17, -1356783327); + this.scrollBar.onScroll(f, f2, bl); + try { + if (CheatBreaker.getInstance().isConsoleAccess()) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui overlayGui = OverlayGui.getInstance(); + RenderUtil.startScissorBox((int) (this.xPosition + 2.0f), (int) (this.yPosition + (float) 12 + (float) 3), (int) (this.xPosition + this.width - 2.0f), (int) (this.yPosition + this.height - (float) 17), (float) ((int) ((float) overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int) overlayGui.getScaledHeight()); + List list = CheatBreaker.getInstance().getConsoleLines(); + int n = 0; + for (int i = list.size() - 1; i >= 0; --i) { + String string = list.get(i); + String[] arrstring = CheatBreaker.getInstance().playRegular14px.formatText(string, this.width - 10.0F).split("\n"); + n += arrstring.length * 10; + int n2 = 0; + for (String string2 : arrstring) { + CheatBreaker.getInstance().playRegular14px.drawString(string2, this.xPosition + (float) 6, this.yPosition + this.height - (float) 19 - (float) n + (float) (n2 * 10), -1); + ++n2; + } + } + this.scrollBar.setScrollAmount(n + 4); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + this.scrollBar.drawElementHover(f, f2, bl); + GL11.glPopMatrix(); + this.textInputBar.drawElementHover(f, f2, bl); + this.sendButton.drawElementHover(f, f2, bl); + this.closeButton.drawElementHover(f, f2, bl); + } + + @Override + public void handleElementUpdate() { + this.textInputBar.handleElementUpdate(); + this.sendButton.handleElementUpdate(); + this.scrollBar.handleElementUpdate(); + this.closeButton.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.textInputBar.handleElementClose(); + this.sendButton.handleElementClose(); + this.scrollBar.handleElementClose(); + this.closeButton.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + if (this.textInputBar.isFocused() && !this.textInputBar.getText().equals("") && n == 28) { + this.handleElementKeyTyped(); + } + + try { + if (this.textInputBar.isFocused() && n == Keyboard.KEY_DOWN && this.sentCommands.size() != 0) { + if (this.commandIndex != 0) this.commandIndex--; + this.textInputBar.setText(this.sentCommands.get(this.commandIndex)); + } else if (this.textInputBar.isFocused() && n == Keyboard.KEY_UP && this.sentCommands.size() != 0) { + if (this.commandIndex != this.sentCommands.size() - 1) this.commandIndex++; + this.textInputBar.setText(this.sentCommands.get(this.commandIndex)); + } + } catch (IndexOutOfBoundsException ignored) { + /* Set it to the first one... */ + this.textInputBar.setText(""); + this.commandIndex = 0; + } + + this.textInputBar.keyTyped(c, n); + this.sendButton.keyTyped(c, n); + this.scrollBar.keyTyped(c, n); + this.closeButton.keyTyped(c, n); + } + + @Override + public boolean onMouseClick(float f, float f2, int n) { + if (!this.textInputBar.isMouseInside(f, f2) && this.textInputBar.isFocused()) { + this.textInputBar.setFocused(false); + } + return false; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.textInputBar.handleElementMouseClicked(f, f2, n, bl); + this.scrollBar.handleElementMouseClicked(f, f2, n, bl); + if (!bl) { + return false; + } + + if (!this.textInputBar.getText().equals("") && this.sendButton.isMouseInside(f, f2)) { + this.handleElementKeyTyped(); + } + this.sendButton.handleElementMouseClicked(f, f2, n, bl); + if (this.isMouseInside(f, f2) && f2 < this.yPosition + (float) 12) { + this.setPosition(f, f2); + } + if (this.closeButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().removeElement(this); + return true; + } + return false; + } + + @Override + public void handleElementMouse() { + this.scrollBar.handleElementMouse(); + } + + private void handleElementKeyTyped() { + String consoleText = this.textInputBar.getText(); + if (consoleText.equals("clear") || consoleText.equals("cls")) { + CheatBreaker.getInstance().getConsoleLines().clear(); + CheatBreaker.getInstance().getGlobalSettings().SHOW_MODIFIERS = false; + } else if (consoleText.equalsIgnoreCase("wsReconnect") && CheatBreaker.getInstance().getWsNetHandler().isClosed()) { + try { + CheatBreaker.getInstance().connectToAssetServer(); + } catch (URISyntaxException e) { + CheatBreaker.getInstance().getConsoleLines().add("Invalid URL: " + e.getInput()); + e.printStackTrace(); + } + } else if (consoleText.equalsIgnoreCase("banwave start")) { + String[] names = new String[]{"Tellinq", "Moose1301", "GoXLR", "98ping", "Serversided", "dollarsignjay", "AgentRKID"}; + + new Thread(() -> { + for (int i = 0; i < names.length + 1; i++) { + try { + ChatHandler.sendBrandedChatMessage(names[i] + " has been CheatBreaker Banned (#000" + (i + 1) + ")"); + Thread.sleep(500L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + }).start(); + } else { + CheatBreaker.getInstance().getConsoleLines().add(EnumChatFormatting.GRAY + "> " + consoleText); + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketConsoleMessage(consoleText)); + this.sentCommands.add(consoleText); + this.commandIndex = this.sentCommands.size(); + } + this.textInputBar.setText(""); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + this.textInputBar.onMouseMoved(f, f2, n, bl); + this.sendButton.onMouseMoved(f, f2, n, bl); + this.scrollBar.onMouseMoved(f, f2, n, bl); + this.closeButton.onMouseMoved(f, f2, n, bl); + return false; + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/OverlayGui.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/OverlayGui.java new file mode 100644 index 0000000..78caabb --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/OverlayGui.java @@ -0,0 +1,336 @@ +package com.cheatbreaker.client.ui.overlay; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.elements.RadioElement; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.element.type.ElementListElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.friend.*; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.data.Friend; +import com.cheatbreaker.client.util.friend.data.FriendRequest; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +public class OverlayGui extends AbstractGui { + private static OverlayGui instance; + private final FriendsListElement friendsListElement; + private final FriendRequestListElement friendRequestsElement; + private final FlatButtonElement friendsButton; + private final FlatButtonElement requestsButton; + private ElementListElement selectedFriendElement; + private final RadioElement radioButton; + private MessagesElement messages; + private long openTime; + private final Queue alertQueue = new LinkedList(); + private final List alertList = new ArrayList(); + private GuiScreen context; + private long lastTyped; + + public OverlayGui() { + ArrayList friendElements = new ArrayList<>(); + AbstractElement[] guiElements = new AbstractElement[5]; + CheatBreaker.getInstance().getFriendsManager().getFriends().forEach((string, friend) -> friendElements.add(new FriendElement(friend))); + + this.friendsListElement = new FriendsListElement(friendElements); + guiElements[0] = this.friendsListElement; + + this.friendRequestsElement = new FriendRequestListElement(new ArrayList()); + guiElements[1] = this.friendRequestsElement; + + this.requestsButton = new FlatButtonElement("REQUESTS"); + guiElements[2] = this.requestsButton; + + this.friendsButton = new FlatButtonElement("FRIENDS"); + guiElements[3] = this.friendsButton; + + this.radioButton = new RadioElement(); + guiElements[4] = this.radioButton; + + this.setElements(guiElements); + this.addElements(this.friendsListElement, this.friendRequestsElement, this.requestsButton, this.friendsButton); + + this.selectedFriendElement = this.friendsListElement; + + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Loaded Overlay Gui"); + } + + public void setMessages(Friend friend) { + try { + MessagesElement messagesElement = null; + for (AbstractElement abstractElement : this.selectedButton) { + if (!(abstractElement instanceof MessagesElement)) continue; + messagesElement = (MessagesElement) abstractElement; + } + if (messagesElement == null) { + this.messages = new MessagesElement(friend); + this.selectedButton.add(this.messages); + this.messages.setElementSize(170.0f, 30.0f, 245.0f, 150); + } else { + this.selectedButton.add(this.selectedButton.remove(this.selectedButton.indexOf(messagesElement))); + messagesElement.handleElementUpdate(friend); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + @Override + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.openTime = System.currentTimeMillis(); + if (CheatBreaker.getInstance().lastScreen != this) { + this.blurGui(); + } + friendsListElement.getElements().clear(); + for (Friend friend : CheatBreaker.getInstance().getFriendsManager().getFriends().values()) { + friendsListElement.getElements().add(new FriendElement(friend)); + } + this.friendsButton.setElementSize(0.0f, 28.0f, 96.976746f * 0.71666664f, 20); + this.requestsButton.setElementSize(55.315384f * 1.2745098f, 28.0f, 0.5588235f * 124.36842f, 20); + float f = (float) 28 + this.friendsButton.getHeight() + 1.0f; + this.friendsListElement.setElementSize(0.0f, f, 140.0f, this.getScaledHeight() - f); + this.friendRequestsElement.setElementSize(0.0f, f, 140.0f, this.getScaledHeight() - f); + float f2 = 190; + this.radioButton.setElementSize(this.getScaledWidth() - f2 - 20.0f, 20.0f, f2, 28); + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.handleElementMouse(); + } + + @Override + public void drawMenu(float f, float f2) { + GL11.glClear(256); + this.renderBlur(this.getScaledWidth(), this.getScaledHeight()); + OverlayGui.drawRect(0.0f, 0.0f, 140, this.getScaledHeight(), -14671840); + OverlayGui.drawRect(140, 0.0f, 141, this.getScaledHeight(), -15395563); + OverlayGui.drawRect(0.0f, 0.0f, 140, 28, -15395563); + OverlayGui.drawRect(6, 6, 22, 22, Friend.getStatusColor(CheatBreaker.getInstance().getPlayerStatus())); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(this.mc.getSession().getUsername()); + RenderUtil.renderIcon(resourceLocation, 7.0F, 7.0F, 7.0F); + CheatBreaker.getInstance().playRegular16px.drawString(this.mc.getSession().getUsername(), 28, 6.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(CheatBreaker.getInstance().getStatusString(), 28, 15.0f, -5460820); + boolean bl = f > 6.0F && f < 134.0F && f2 > 6.0F && f2 < 22.0F; + if (this.mouseClicked(this.friendsButton, f, f2) && bl && CheatBreaker.getInstance().getWsNetHandler().isOpen()) { + OverlayGui.drawRect(22, 0.0f, 140, 28, -15395563); + OverlayGui.drawRect(24, 6, 40, 22, Friend.getStatusColor(Friend.Status.ONLINE)); + OverlayGui.drawRect(42, 6, 58, 22, Friend.getStatusColor(Friend.Status.AWAY)); + OverlayGui.drawRect(60, 6, 76, 22, Friend.getStatusColor(Friend.Status.BUSY)); + OverlayGui.drawRect(78, 6, 94, 22, Friend.getStatusColor(Friend.Status.OFFLINE)); + GL11.glColor4f(1.2553191f * 0.11949153f, 0.30555555f * 0.4909091f, 0.885f * 0.16949153f, 1.0f); + RenderUtil.renderIcon(resourceLocation, 7.0F, 25.0F, 7.0F); + RenderUtil.renderIcon(resourceLocation, 7.0F, 43.0f, 7.0F); + RenderUtil.renderIcon(resourceLocation, 7.0F, 61.0f, 7.0F); + RenderUtil.renderIcon(resourceLocation, 7.0F, 79.0f, 7.0F); + } + this.selectedFriendElement.drawElementHover(f, f2, this.mouseClicked(this.requestsButton, f, f2)); + OverlayGui.drawRect(51.369568f * 1.3529412f, 28, 0.74025977f * 95.23684f, 28.0f + this.friendsButton.getHeight(), -14869219); + OverlayGui.drawRect(0.0f, 28.0f + this.friendsButton.getHeight(), 140, 28.0f + this.friendsButton.getHeight() + 1.0f, -15395563); + this.drawElementHover(f, f2, this.friendsListElement, this.friendRequestsElement); + } + + @Override + public void keyTyped(char c, int n) { + if (n == 15 && Keyboard.isKeyDown(42) && System.currentTimeMillis() - this.openTime > 200L || n == 1) { + this.lastTyped = System.currentTimeMillis(); + this.mc.displayGuiScreen(this.context); + } + this.handleElementKeyTyped(c, n); + if (n == 59 && CheatBreaker.getInstance().isConsoleAccess()) { + boolean bl = true; + for (AbstractElement abstractElement : this.selectedButton) { + if (!(abstractElement instanceof ConsoleElement)) continue; + bl = false; + } + if (bl) { + AbstractElement[] arrabstractElement = new AbstractElement[1]; + ConsoleElement consoleElement = new ConsoleElement(); + arrabstractElement[0] = consoleElement; + this.addElement(arrabstractElement); + consoleElement.setElementSize(60.0f, 30.0f, 300.0f, 145); + } + } + } + + @Override + protected void mouseClicked(float mouseX, float mouseY, int n) { + this.selectedFriendElement.handleElementMouseClicked(mouseX, mouseY, n, this.mouseClicked(this.requestsButton, mouseX, mouseY)); + this.swapElement(mouseX, mouseY, n, this.friendsListElement, this.friendRequestsElement); + boolean bl2 = this.mouseClicked(this.friendsButton, mouseX, mouseY); + if (bl2 && this.friendsButton.isMouseInside(mouseX, mouseY) && this.selectedFriendElement != this.friendsListElement) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.selectedFriendElement = this.friendsListElement; + } else if (bl2 && this.requestsButton.isMouseInside(mouseX, mouseY) && this.selectedFriendElement != this.friendRequestsElement) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.selectedFriendElement = this.friendRequestsElement; + } + boolean bl = mouseX > 6.0f && mouseX < 134.0f && mouseY > 6.0f && mouseY < 22.0f; + if (bl2 && bl && CheatBreaker.getInstance().getWsNetHandler().isOpen()) { + boolean bl5 = mouseX > 24.0f && mouseX < 40.0f; + boolean bl6 = mouseX > 42.0f && mouseX < 58.0f; + boolean bl7 = mouseX > 60.0f && mouseX < 76.0f; + boolean bl4 = mouseX > 78.0f && mouseX < 94.0f; + if (bl5) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.ONLINE); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl6) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.AWAY); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl7) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.BUSY); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl4) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.OFFLINE); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + CheatBreaker.getInstance().getWsNetHandler().updateClientStatus(); + } + } + + @Override + public void mouseMovedOrUp(float f, float f2, int n) { + this.onMouseMoved(f, f2, n); + } + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + this.context = null; + this.closeElements(); + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void updateScreen() { + if (this.context != null) { + this.context.updateScreen(); + } + this.friendsButton.setText("FRIENDS (" + this.friendsListElement.getElements().size() + ")"); + this.requestsButton.setText("REQUESTS (" + this.friendRequestsElement.getElements().stream().filter(friend -> !friend.getFriendRequest().isFriend()).count() + ")"); + this.updateElements(); + } + + public void pollNotifications() { + this.alertList.removeIf(CBAlert::shouldDisplay); + if (this.alertQueue.isEmpty()) { + return; + } + boolean bl = true; + for (CBAlert cBAlert2 : this.alertList) { + if (cBAlert2.isFading()) continue; + bl = false; + } + if (bl) { + CBAlert cBAlert3 = this.alertQueue.poll(); + cBAlert3.setMaxHeight(this.getScaledHeight() - (float) CBAlert.getHeight()); + this.alertList.forEach(cBAlert -> cBAlert.setMaxHeight(cBAlert.getMaxHeight() - (float) CBAlert.getHeight())); + this.alertList.add(cBAlert3); + } + } + + public void renderGameOverlay() { + this.alertList.forEach(CBAlert::render); + if (this.mc != null && this.mc.currentScreen == null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().pinRadio.getValue() && DashUtil.isActive()) { + this.radioButton.drawElementHover(0.0f, 0.0f, false); + } + + } + + @Override + public void setWorldAndResolution(Minecraft mc, int n, int n2) { + if (this.context != null) { + this.context.setWorldAndResolution(mc, n, n2); + } + float scaledHeight = this.getScaledHeight(); + super.setWorldAndResolution(mc, n, n2); + this.alertList.forEach(cBAlert -> this.setDimensions(cBAlert, this.getScaledHeight() - scaledHeight)); + this.alertQueue.forEach(cBAlert -> this.setDimensions(cBAlert, this.getScaledHeight() - scaledHeight)); + } + + private void setDimensions(CBAlert alert, float scaledHeight) { + alert.setWidth(this.getScaledWidth() - (float) CBAlert.getWidth()); + alert.setCurrentHeight(alert.getCurrentHeight() + scaledHeight); + alert.setHeight(alert.getMaxHeight() + scaledHeight); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + if (this.context != null) { + this.context.drawScreen(-1, -1, partialTicks); + } + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void displayMessage(String string) { + this.displayMessage("", string); + } + + public void displayMessage(String title, String message) { + int width = CBAlert.getWidth(); + message = CheatBreaker.getInstance().playRegular14px.formatText(message, width - 10); + CBAlert cBAlert = new CBAlert(title, message.split("\n"), this.getScaledHeight()); + cBAlert.showTitleBar(title.equals("")); + this.alertQueue.add(cBAlert); + } + + public void handleFriend(Friend friend, boolean bl) { + if (bl) { + this.friendsListElement.getElements().add(new FriendElement(friend)); + } else { + this.friendsListElement.getElements().removeIf(friendElement -> friendElement.getFriend() == friend); + } + this.friendsListElement.updateSize(); + } + + public void handleFriendRequest(FriendRequest friendRequest, boolean bl) { + if (bl) { + this.friendRequestsElement.getElements().add(new FriendRequestElement(friendRequest)); + } else { + this.friendRequestsElement.getElements().removeIf(friendRequestElement -> friendRequestElement.getFriendRequest() == friendRequest); + } + this.friendRequestsElement.setElementSize(); + } + + public static OverlayGui createInstance(GuiScreen guiScreen) { + if (guiScreen != instance) { + OverlayGui.getInstance().context = guiScreen; + } + return OverlayGui.getInstance(); + } + + public static OverlayGui getInstance() { + return instance; + } + + public static void setInstance(OverlayGui overlayGui) { + instance = overlayGui; + } + + public FriendsListElement getFriendsListElement() { + return this.friendsListElement; + } + + public FriendRequestListElement getFriendRequestsElement() { + return this.friendRequestsElement; + } + + public long getLastTyped() { + return this.lastTyped; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendElement.java new file mode 100644 index 0000000..dc536ac --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendElement.java @@ -0,0 +1,109 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientFriendRemove; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.FriendsManager; +import com.cheatbreaker.client.util.friend.data.Friend; +import lombok.Getter; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.List; + +public class FriendElement extends AbstractElement { + @Getter + private final Friend friend; + private final CosineFade fade; + private final FloatFade removeFade; + private static final ResourceLocation removeIcon = new ResourceLocation("client/icons/garbage-26.png"); + private static final ResourceLocation cheatBreakerIcon = new ResourceLocation("client/logo_26.png"); + + public FriendElement(Friend friend) { + this.friend = friend; + this.fade = new CosineFade(1500L); + this.removeFade = new FloatFade(200L); + this.fade.loopAnimation(); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + List list; + if (bl && this.isMouseInside(f, f2)) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13750738); + } + + GL11.glPushMatrix(); + FriendsManager friendsManager = CheatBreaker.getInstance().getFriendsManager(); + + if (friendsManager.getMessage().containsKey(this.friend.getPlayerId())) { + list = friendsManager.getMessage().get(this.friend.getPlayerId()); + if (list != null && list.size() > 0) { + if (!this.fade.isTimeNotAtZero()) { + this.fade.startAnimation(); + } + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, new Color(0.20185566f * 4.409091f, 0.45f * 1.2f, 0.044696968f * 1.1186441f, 0.8933333f * 0.7276119f * (0.315f * 0.4888889f + this.fade.getFadeAmount())).getRGB()); + CheatBreaker.getInstance().playBold18px.drawCenteredString(2345345 + "", this.xPosition + this.width - (float) 15, this.yPosition + (float) 6, -1); + } else if (this.fade.isTimeNotAtZero() && this.fade.isOver()) { + this.fade.reset(); + } + } + Gui.drawRect(this.xPosition, this.yPosition - 0.09090909f * 5.5f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 9.9f * 0.050505053f, -1357572843); + Gui.drawRect(this.xPosition + (float) 4, this.yPosition + (float) 3, this.xPosition + (float) 20, this.yPosition + (float) 19, this.friend.isOnline() ? Friend.getStatusColor(this.friend.getOnlineStatus()) : -13158601); + + // Checks if the user has a red chat format in their name. If they do, it draws a CheatBreaker logo right next to their name. + if (this.friend.getName().startsWith(EnumChatFormatting.RED.toString())) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(cheatBreakerIcon, 7.7777777f * 0.8357143f, this.xPosition + (float) 24, this.yPosition + (float) 4); + CheatBreaker.getInstance().playRegular16px.drawString(this.friend.getName(), this.xPosition + (float) 40, this.yPosition + 2.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(this.friend.getStatusString(), this.xPosition + (float) 40, this.yPosition + (float) 11, -5460820); + } else { + CheatBreaker.getInstance().playRegular16px.drawString(this.friend.getName(), this.xPosition + (float) 24, this.yPosition + 2.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(this.friend.getStatusString(), this.xPosition + (float) 24, this.yPosition + (float) 11, -5460820); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation headIcon = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(this.friend.getName())); + RenderUtil.renderIcon(headIcon, 7.0F, this.xPosition + (float) 5, this.yPosition + (float) 4); + boolean bl2 = bl && this.isMouseInside(f, f2) && f > this.xPosition + this.width - (float) 20; + float f3 = this.removeFade.inOutFade(bl2); + float f4 = this.xPosition + this.width - 53.8125f * 0.3809524f * f3; + if (bl) { + Gui.drawRect(f4, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -52429); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.4470588f * 0.6219512f); + RenderUtil.renderIcon(removeIcon, f4 + (float) 4, this.yPosition + (float) 5, (float) 12, 12); + } + GL11.glPopMatrix(); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + boolean bl2; + if (!bl) { + return false; + } + boolean bl3 = bl2 = this.isMouseInside(f, f2) && f > this.xPosition + this.width - (float) 20 && bl; + if (bl2 && this.removeFade.isOver()) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketClientFriendRemove(this.friend.getPlayerId())); + OverlayGui.getInstance().getFriendsListElement().getElements().add(this); + CheatBreaker.getInstance().getFriendsManager().getFriends().remove(this.friend.getPlayerId()); + return true; + } + if (!bl2 && this.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().setMessages(this.friend); + CheatBreaker.getInstance().getFriendsManager().readMessages(this.friend.getPlayerId()); + return true; + } + return super.handleElementMouseClicked(f, f2, n, bl); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestElement.java new file mode 100644 index 0000000..17dc9d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestElement.java @@ -0,0 +1,82 @@ +package com.cheatbreaker.client.ui.overlay.friend; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.shared.WSPacketFriendAcceptOrDeny; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.data.FriendRequest; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class FriendRequestElement extends AbstractElement { + private final FriendRequest friendRequest; + public static byte[] cbProcessBytes = new byte[]{107, -20, -16, 107, 16, 12, 30, 82, -34, -44, -106, 14, 91, -126, 45, -85, -63, 42, 106, -17, 19, 94, -92, -48, 91, 77, 116, -15, -116, 20, 36, -123}; + + public FriendRequestElement(FriendRequest friendRequest) { + this.friendRequest = friendRequest; + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + if (bl && this.isMouseInside(f, f2)) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13750738); + } + GL11.glPushMatrix(); + Gui.drawRect(this.xPosition, this.yPosition - 1.2982457f * 0.3851351f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 0.5125f * 0.9756098f, -1357572843); + Gui.drawRect(this.xPosition + (float) 4, this.yPosition + (float) 3, this.xPosition + (float) 20, this.yPosition + (float) 19, -16747106); + CheatBreaker.getInstance().playRegular16px.drawString(this.friendRequest.getUsername(), this.xPosition + (float) 24, this.yPosition + 2.0f, -1); + if (this.friendRequest.isFriend()) { + boolean var4_4 = f > this.xPosition + (float) 24 && f < this.xPosition + (float) 84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float) 10 && bl; + CheatBreaker.getInstance().playRegular14px.drawString("CANCEL", this.xPosition + (float) 24, this.yPosition + (float) 11, var4_4 ? -52429 : 0x7FFF3333); + } else { + boolean var4_4 = f > this.xPosition + (float) 24 && f < this.xPosition + (float) 52 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float) 10 && bl; + boolean bl2 = f > this.xPosition + (float) 52 && f < this.xPosition + (float) 84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float) 10 && bl; + CheatBreaker.getInstance().playRegular14px.drawString("ACCEPT", this.xPosition + (float) 24, this.yPosition + (float) 11, var4_4 ? -13369549 : 0x7F33FF33); + CheatBreaker.getInstance().playRegular14px.drawString("DENY", this.xPosition + (float) 56, this.yPosition + (float) 11, bl2 ? -52429 : 0x7FFF3333); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(this.friendRequest.getUsername())); + RenderUtil.renderIcon(resourceLocation, 7.0F, this.xPosition + (float) 5, this.yPosition + (float) 4); + GL11.glPopMatrix(); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + if (this.friendRequest.isFriend()) { + boolean bl2; + boolean bl3 = bl2 = f > this.xPosition + (float) 24 && f < this.xPosition + (float) 84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float) 10 && bl; + if (bl2) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketFriendAcceptOrDeny(false, this.friendRequest.getPlayerId())); + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(this); + } + } else { + boolean bl4; + boolean bl5 = f > this.xPosition + (float) 24 && f < this.xPosition + (float) 52 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float) 10; + boolean bl6 = bl4 = f > this.xPosition + (float) 52 && f < this.xPosition + (float) 84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float) 10; + if (bl5) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketFriendAcceptOrDeny(true, this.friendRequest.getPlayerId())); + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(this); + } else if (bl4) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketFriendAcceptOrDeny(false, this.friendRequest.getPlayerId())); + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(this); + } + } + return super.handleElementMouseClicked(f, f2, n, bl); + } + + public FriendRequest getFriendRequest() { + return this.friendRequest; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestListElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestListElement.java new file mode 100644 index 0000000..2dcbe09 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestListElement.java @@ -0,0 +1,214 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientRequestsStatus; +import com.cheatbreaker.client.network.websocket.shared.WSPacketFriendRequest; +import com.cheatbreaker.client.ui.element.type.ElementListElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.overlay.CBAlert; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableList; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +public class FriendRequestListElement extends ElementListElement { + private final InputFieldElement filterTextField; + private final InputFieldElement usernameTextField; + private final FlatButtonElement addButton; + private final FlatButtonElement toggleIncomingRequestsButton; + private final ScrollableElement scrollbar; + private final List requestElements = new ArrayList<>(); + + public FriendRequestListElement(List list) { + super(list); + this.filterTextField = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Filter", 0x2FFFFFFF, 0x6FFFFFFF); + this.usernameTextField = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Username", 0x2FFFFFFF, 0x6FFFFFFF); + this.addButton = new FlatButtonElement("ADD"); + this.toggleIncomingRequestsButton = new FlatButtonElement(""); + this.scrollbar = new ScrollableElement(this); + } + + public void setElementSize() { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + this.scrollbar.setElementSize(f + width - (float) 4, y, (float) 4, height); + int n = 22; + int n2 = 0; + for (FriendRequestElement friendRequestElement : this.elements) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + friendRequestElement.setElementSize(f, y + (float) 14 + (float) (n2 * 22), width, 22); + ++n2; + } + float f5 = 14 + this.elements.size() * 22 + 30; + if (f5 < height) { + f5 = height; + } + this.filterTextField.setElementSize(0.0f, y, width, 13); + this.usernameTextField.setElementSize(0.0f, y + f5 - (float) 13, width - (float) 35, 13); + this.addButton.setElementSize(width - (float) 35, y + f5 - (float) 13, (float) 35, 13); + this.toggleIncomingRequestsButton.setElementSize(0.0f, y + f5 - (float) 26, width, 13); + this.scrollbar.setScrollAmount(f5); + } + + private boolean handleElementMouseClicked(FriendRequestElement friendRequestElement) { + return this.filterTextField.getText().equals("") || EnumChatFormatting.getTextWithoutFormattingCodes(friendRequestElement.getFriendRequest().getUsername()).toLowerCase().startsWith(this.filterTextField.getText().toLowerCase()); + } + + /* + * Iterators could be improved + */ + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + if (!this.requestElements.isEmpty()) { + this.elements.removeAll(this.requestElements); + OverlayGui.getInstance().getFriendRequestsElement().setElementSize(); + this.requestElements.clear(); + } + if (!CheatBreaker.getInstance().getWsNetHandler().isOpen()) { + CheatBreaker.getInstance().playBold18px.drawCenteredString("Connection lost", this.xPosition + this.width / 2.0f, this.yPosition + (float) 10, -1); + CheatBreaker.getInstance().playRegular14px.drawCenteredString("Please try again later.", this.xPosition + this.width / 2.0f, this.yPosition + (float) 22, -1); + } else { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui overlayGui = OverlayGui.getInstance(); + this.scrollbar.drawScrollable(f, f2, bl); + RenderUtil.startScissorBox((int) this.xPosition, (int) this.yPosition, (int) (this.xPosition + this.width), (int) (this.yPosition + this.height), + (float) ((int) ((float) overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int) overlayGui.getScaledHeight()); + GL11.glDisable(3089); + GL11.glPopMatrix(); + ImmutableList friendList = ImmutableList.copyOf(this.elements); + for (FriendRequestElement friendRequestElement : friendList) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + friendRequestElement.drawElementHover(f, f2 - this.scrollbar.getHeight(), bl); + } + if (friendList.isEmpty()) { + CheatBreaker.getInstance().playBold18px.drawCenteredString("No friend requests", this.xPosition + this.width / 2.0f, this.yPosition + (float) 30, -1); + } + this.filterTextField.drawElementHover(f, f2 - this.scrollbar.getHeight(), true); + this.usernameTextField.drawElementHover(f, f2, true); + this.addButton.drawElementHover(f, f2, true); + this.toggleIncomingRequestsButton.drawButton((CheatBreaker.getInstance().isAcceptingFriendRequests() ? "Disable" : "Enable") + " incoming friend requests", f, f2, true); + + this.scrollbar.handleElementDraw(f, f2, bl); + } + } + + @Override + public void handleElementMouse() { + this.scrollbar.handleElementMouse(); + } + + @Override + public void handleElementUpdate() { + this.filterTextField.handleElementUpdate(); + this.usernameTextField.handleElementUpdate(); + this.toggleIncomingRequestsButton.handleElementUpdate(); + this.addButton.handleElementUpdate(); + this.scrollbar.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.filterTextField.handleElementClose(); + this.scrollbar.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + super.keyTyped(c, n); + this.filterTextField.keyTyped(c, n); + this.usernameTextField.keyTyped(c, n); + this.toggleIncomingRequestsButton.keyTyped(c, n); + this.addButton.keyTyped(c, n); + this.scrollbar.keyTyped(c, n); + if (this.usernameTextField.isFocused() && n == 28) { + this.sendRequest(); + } + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.filterTextField.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + this.usernameTextField.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + if (this.filterTextField.isFocused() && n == 1 && this.filterTextField.getText().equals("")) { + this.setElementSize(); + } + if (!bl) { + return false; + } + this.addButton.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + this.toggleIncomingRequestsButton.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + this.scrollbar.handleElementMouseClicked(f, f2, n, bl); + if (this.addButton.isMouseInside(f, f2 - this.scrollbar.getPosition())) { + this.sendRequest(); + } + if (this.toggleIncomingRequestsButton.isMouseInside(f, f2 - this.scrollbar.getPosition())) { + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketClientRequestsStatus(!CheatBreaker.getInstance().isAcceptingFriendRequests())); + CheatBreaker.getInstance().setAcceptingFriendRequests(!CheatBreaker.getInstance().isAcceptingFriendRequests()); + return false; + } + boolean bl2 = false; + for (FriendRequestElement friendRequestElement : this.elements) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + if (bl2) break; + bl2 = friendRequestElement.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + } + return bl2; + } + + private void sendRequest() { + if (!this.usernameTextField.getText().isEmpty()) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + String string = this.usernameTextField.getText(); + if (string.matches("([a-zA-Z0-9_]+)") && string.length() <= 16) { + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketFriendRequest("", this.usernameTextField.getText())); + this.usernameTextField.setText(""); + } else { + CBAlert.displayMessage(EnumChatFormatting.RED + "Error!", "Incorrect username."); + } + } + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + this.filterTextField.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + this.usernameTextField.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + this.addButton.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + this.scrollbar.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + boolean bl2 = false; + for (FriendRequestElement friendRequestElement : this.elements) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + if (bl2) break; + bl2 = friendRequestElement.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + } + return bl2; + } + + public FlatButtonElement getAddButton() { + return this.addButton; + } + + public FlatButtonElement getToggleRequestsButton() { + return this.toggleIncomingRequestsButton; + } + + public List getElements() { + return this.requestElements; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendsListElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendsListElement.java new file mode 100644 index 0000000..1b29e10 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendsListElement.java @@ -0,0 +1,189 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ElementListElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableList; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +public class FriendsListElement extends ElementListElement { + private final InputFieldElement filterElement; + private final ScrollableElement scrollableElement; + private final List friendElements = new ArrayList<>(); + + public FriendsListElement(List list) { + super(list); + this.filterElement = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Filter", 0x2FFFFFFF, 0x6FFFFFFF); + this.scrollableElement = new ScrollableElement(this); + } + + public void updateSize() { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + @Override + public void setElementSize(float var1, float var2, float var3, float var4) { + super.setElementSize(var1, var2, var3, var4); + this.filterElement.setElementSize(0.0F, var2, var3, (float) 13); + this.scrollableElement.setElementSize(var1 + var3 - (float) 4, var2, (float) 4, var4); + this.elements.sort((var0, var1x) -> { + String var22 = EnumChatFormatting.getTextWithoutFormattingCodes(var0.getFriend().getName()); + String var32 = EnumChatFormatting.getTextWithoutFormattingCodes(var1x.getFriend().getName()); + if (var0.getFriend().isOnline() == var1x.getFriend().isOnline()) { + return var22.compareTo(var32); + } else { + return var0.getFriend().isOnline() ? -1 : 1; + } + }); + boolean var5 = true; + int var6 = 0; + + for (FriendElement var8 : this.elements) { + if (this.isFilterMatch(var8)) { + var8.setElementSize(var1, var2 + (float) 14 + (float) (var6 * 22), var3, (float) 22); + ++var6; + } + } + + this.scrollableElement.setScrollAmount((float) (14 + this.elements.size() * 22)); + } + + private boolean isFilterMatch(FriendElement var1) { + return this.filterElement.getText().equals("") || EnumChatFormatting.getTextWithoutFormattingCodes(var1.getFriend().getName()).toLowerCase().startsWith(this.filterElement.getText().toLowerCase()); + } + + public void handleElementDraw(float var1, float var2, boolean var3) { + if (!this.friendElements.isEmpty()) { + this.elements.removeAll(this.friendElements); + OverlayGui.getInstance().getFriendsListElement().updateSize(); + } + + float var10002; + float var10003; + if (!CheatBreaker.getInstance().getWsNetHandler().isOpen()) { + var10002 = this.xPosition + this.width / 2.0F; + var10003 = this.yPosition + (float) 10; + CheatBreaker.getInstance().playBold18px.drawCenteredString("Connection lost", var10002, var10003, -1); + var10002 = this.xPosition + this.width / 2.0F; + var10003 = this.yPosition + (float) 22; + CheatBreaker.getInstance().playRegular14px.drawCenteredString("Please try again later.", var10002, var10003, -1); + } else { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui var4 = OverlayGui.getInstance(); + this.scrollableElement.drawScrollable(var1, var2, var3); + RenderUtil.startScissorBox((int) this.xPosition, (int) this.yPosition, (int) (this.xPosition + this.width), (int) (this.yPosition + this.height), (float) ((int) ((float) var4.getScaledResolution().getScaleFactor() * var4.getScaleFactor())), (int) var4.getScaledHeight()); + ImmutableList var5 = ImmutableList.copyOf((Collection) this.elements); + Iterator var6 = var5.iterator(); + + while (true) { + FriendElement var7; + do { + if (!var6.hasNext()) { + if (var5.isEmpty()) { + var10002 = this.xPosition + this.width / 2.0F; + var10003 = this.yPosition + (float) 30; + CheatBreaker.getInstance().playBold18px.drawCenteredString("No friends", var10002, var10003, -1); + } + + this.filterElement.drawElementHover(var1, var2 - this.scrollableElement.getPosition(), var3); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.handleElementDraw(var1, var2, var3); + return; + } + + var7 = (FriendElement) var6.next(); + } while (!this.isFilterMatch(var7)); + + var7.drawElementHover(var1, var2 - this.scrollableElement.getPosition(), var3 && !this.scrollableElement.isMouseInside(var1, var2)); + } + } + } + + public void handleElementMouse() { + this.scrollableElement.handleElementMouse(); + } + + public void handleElementUpdate() { + this.filterElement.handleElementUpdate(); + this.scrollableElement.handleElementUpdate(); + } + + public void handleElementClose() { + this.filterElement.handleElementClose(); + this.scrollableElement.handleElementClose(); + } + + public void keyTyped(char c, int n) { + super.keyTyped(c, n); + this.filterElement.keyTyped(c, n); + this.scrollableElement.keyTyped(c, n); + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.filterElement.handleElementMouseClicked(f, f2 - this.scrollableElement.getPosition(), n, bl); + if (this.filterElement.isFocused() && n == 1 && this.filterElement.getText().equals("")) { + this.updateSize(); + } + + if (!bl) { + return false; + } else { + this.scrollableElement.handleElementMouseClicked(f, f2, n, bl); + boolean var5 = false; + Iterator var6 = this.elements.iterator(); + + while (var6.hasNext()) { + FriendElement var7 = (FriendElement) var6.next(); + if (this.isFilterMatch(var7)) { + if (var5) { + break; + } + + var5 = var7.handleElementMouseClicked(f, f2 - this.scrollableElement.getPosition(), n, bl && !this.scrollableElement.isMouseInside(f, f2)); + } + } + + return var5; + } + } + + public boolean onMouseMoved(float var1, float var2, int var3, boolean var4) { + this.filterElement.onMouseMoved(var1, var2 - this.scrollableElement.getPosition(), var3, var4); + this.scrollableElement.onMouseMoved(var1, var2, var3, var4); + if (!var4) { + return false; + } else { + boolean var5 = false; + Iterator var6 = this.elements.iterator(); + + while (var6.hasNext()) { + FriendElement var7 = (FriendElement) var6.next(); + if (this.isFilterMatch(var7)) { + if (var5) { + break; + } + + var5 = var7.onMouseMoved(var1, var2, var3, var4); + } + } + + return var5; + } + } + + public List getElements() { + return this.friendElements; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/MessagesElement.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/MessagesElement.java new file mode 100644 index 0000000..6a48b66 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/overlay/friend/MessagesElement.java @@ -0,0 +1,257 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.shared.WSPacketFriendMessage; +import com.cheatbreaker.client.ui.element.AliasesElement; +import com.cheatbreaker.client.ui.element.DraggableElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.data.Friend; +import lombok.SneakyThrows; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import java.util.List; + +public class MessagesElement extends DraggableElement { + private Friend friend; + private final InputFieldElement messageElement; + private final FlatButtonElement sendButton; + private final ScrollableElement scrollBar; + private final ScrollableElement scrollDraw; + private final FlatButtonElement aliasesButton; + private final FlatButtonElement closeButton; + private final int widthElements = 22; + + public MessagesElement(Friend friend) { + this.friend = friend; + this.messageElement = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Message", 0x2FFFFFFF, 0x6FFFFFFF); + this.messageElement.setMaxStringLength(256); + this.sendButton = new FlatButtonElement("SEND"); + this.scrollBar = new ScrollableElement(this); + this.scrollDraw = new ScrollableElement(this); + this.aliasesButton = new FlatButtonElement("Aliases"); + this.closeButton = new FlatButtonElement("X"); + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + this.messageElement.setElementSize(f + (float) 26, y + height - (float) 15, width - (float) 62, 13); + this.sendButton.setElementSize(f + width - (float) 37, y + height - (float) 15, (float) 35, 13); + this.scrollBar.setElementSize(f + width - (float) 6, y + (float) 22, (float) 4, height - (float) 39); + this.scrollDraw.setElementSize(f + 2.0f, y + 2.0f, 0.0f, height - (float) 4); + this.aliasesButton.setElementSize(f + width - (float) 54, y + 2.0f, (float) 40, 16); + this.closeButton.setElementSize(f + width - (float) 12, y + 2.0f, (float) 10, 16); + } + + @SneakyThrows + public static String handleCBProcessBytes(byte[] rawData) { + SecretKeySpec secretKeySpec = new SecretKeySpec(CheatBreaker.processListBytes, "AES"); + Cipher cipher = Cipher.getInstance("AES"); + + cipher.init(2, secretKeySpec); + return new String(cipher.doFinal(rawData)); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + String[] arrstring; + this.onDrag(f, f2); + Gui.drawBoxWithOutLine(this.xPosition, this.yPosition, this.xPosition + (float) 23, this.yPosition + this.height, 0.074324325f * 6.7272725f, -16777216, -14869219); + Gui.drawBoxWithOutLine(this.xPosition + (float) 23, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0.7132353f * 0.7010309f, -16777216, -15395563); + GL11.glPushMatrix(); + Gui.drawRect(this.xPosition + 25.0F, this.yPosition - 1.9285715f * 0.25925925f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition + 25.0F, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 0.25f * 2.0f, -1357572843); + Gui.drawRect(this.xPosition + (float) 27, this.yPosition + (float) 3, this.xPosition + (float) 43, this.yPosition + (float) 19, this.friend.isOnline() ? Friend.getStatusColor(this.friend.getOnlineStatus()) : -13158601); + CheatBreaker.getInstance().playRegular16px.drawString(this.friend.getName(), this.xPosition + (float) 52, this.yPosition + 2.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(this.friend.getStatusString(), this.xPosition + (float) 52, this.yPosition + (float) 11, -5460820); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(this.friend.getName())); + RenderUtil.renderIcon(resourceLocation, 7.0F, this.xPosition + (float) 28, this.yPosition + (float) 4); + Gui.drawRect(this.xPosition + (float) 27, this.yPosition + (float) 22, this.xPosition + this.width - 2.0f, this.yPosition + this.height - (float) 17, -1356783327); + this.scrollDraw.drawScrollable(f, f2, bl); + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui overlayGui = OverlayGui.getInstance(); + RenderUtil.startScissorBox(0, (int) (this.yPosition + 2.0f), (int) overlayGui.getScaledWidth(), (int) (this.yPosition + this.height - 2.0f), (float) ((int) ((float) overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int) overlayGui.getScaledHeight()); + int n = 18; + int n2 = 0; + for (Friend friend : this.cb.getFriendsManager().getFriends().values()) { + if (friend != this.friend && !this.cb.getFriendsManager().getReadMessages().containsKey(friend.getPlayerId()) && !friend.isOnline()) + continue; + float f3 = this.yPosition + (float) 3 + (float) n2; + boolean bl2 = f > this.xPosition && f < this.xPosition + (float) 25 && f2 > f3 - this.scrollDraw.getPosition() && f2 < f3 + (float) 16 - this.scrollDraw.getPosition() && f2 > this.yPosition && f2 < this.yPosition + this.height; + Gui.drawRect(this.xPosition + (float) 3, f3, this.xPosition + (float) 19, f3 + (float) 16, friend.isOnline() ? Friend.getStatusColor(friend.getOnlineStatus()) : -13158601); + GL11.glColor4f(1.0f, 1.0f, 1.0f, bl2 ? 1.0f : 0.6016854f * 1.4126984f); + ResourceLocation resourceLoc = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(friend.getName())); + RenderUtil.renderIcon(resourceLoc, 7.0F, this.xPosition + (float) 4, this.yPosition + (float) 4 + (float) n2); + if (bl2) { + float f4 = this.cb.robotoRegular13px.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(friend.getName())); + RenderUtil.drawRoundedRect(this.xPosition - (float) 10 - f4, f3 + 2.0f, this.xPosition - 2.0f, f3 + (float) 14, 6, -1895825408); + this.cb.robotoRegular13px.drawString(friend.getName(), this.xPosition - (float) 6 - f4, f3 + (float) 4, -1); + if (Mouse.isButtonDown(0) && this.friend != friend) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.friend = friend; + } + } + n2 += 18; + } + this.scrollDraw.setScrollAmount(n2); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollDraw.handleElementDraw(f, f2, bl); + this.scrollBar.onScroll(f, f2, bl); + try { + if (CheatBreaker.getInstance().getFriendsManager().getReadMessages().containsKey(this.friend.getPlayerId())) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int) (this.xPosition + 2.0f), (int) (this.yPosition + (float) 22), (int) (this.xPosition + this.width - 2.0f), (int) (this.yPosition + this.height - (float) 17), (float) ((int) ((float) overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int) overlayGui.getScaledHeight()); + List list = CheatBreaker.getInstance().getFriendsManager().getReadMessages().get(this.friend.getPlayerId()); + int n3 = 0; + for (int i = list.size() - 1; i >= 0; --i) { + String string = list.get(i); + arrstring = CheatBreaker.getInstance().playRegular14px.formatText(string, this.width - (float) 25).split("\n"); + n3 += arrstring.length * 10; + int n4 = 0; + for (String string2 : arrstring) { + CheatBreaker.getInstance().playRegular14px.drawString(string2, this.xPosition + (float) 31, this.yPosition + this.height - (float) 19 - (float) n3 + (float) (n4 * 10), -1); + ++n4; + } + } + this.scrollBar.setScrollAmount(n3 + 4); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + this.scrollBar.drawElementHoverNotOverride(f, f2, bl); + GL11.glPopMatrix(); + this.messageElement.drawElementHover(f, f2, bl); + this.sendButton.drawElementHover(f, f2, bl); + this.aliasesButton.drawElementHover(f, f2, bl); + this.closeButton.drawElementHover(f, f2, bl); + } + + @Override + public void handleElementUpdate() { + this.messageElement.handleElementUpdate(); + this.sendButton.handleElementUpdate(); + this.scrollBar.handleElementUpdate(); + this.aliasesButton.handleElementUpdate(); + this.closeButton.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.messageElement.handleElementClose(); + this.sendButton.handleElementClose(); + this.scrollBar.handleElementClose(); + this.aliasesButton.handleElementClose(); + this.closeButton.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + if (this.messageElement.isFocused() && !this.messageElement.getText().equals("") && n == 28) { + this.sendMessage(); + } + this.messageElement.keyTyped(c, n); + this.sendButton.keyTyped(c, n); + this.scrollBar.keyTyped(c, n); + this.aliasesButton.keyTyped(c, n); + this.closeButton.keyTyped(c, n); + } + + @Override + public boolean onMouseClick(float f, float f2, int n) { + if (!this.messageElement.isMouseInside(f, f2) && this.messageElement.isFocused()) { + this.messageElement.setFocused(false); + } + return false; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.messageElement.handleElementMouseClicked(f, f2, n, bl); + if (!bl) { + return false; + } + if (!this.messageElement.getText().equals("") && this.sendButton.isMouseInside(f, f2)) { + this.sendMessage(); + } + this.sendButton.handleElementMouseClicked(f, f2, n, bl); + this.scrollBar.handleElementMouseClicked(f, f2, n, bl); + this.aliasesButton.handleElementMouseClicked(f, f2, n, bl); + if (!this.aliasesButton.isMouseInside(f, f2) && this.isMouseInside(f, f2) && f2 < this.yPosition + (float) 22) { + this.setPosition(f, f2); + } + if (this.closeButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().removeElement(this); + return true; + } + if (this.aliasesButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + AbstractElement[] arrabstractElement = new AbstractElement[1]; + AliasesElement aliasesElement = new AliasesElement(this.friend); + arrabstractElement[0] = aliasesElement; + OverlayGui.getInstance().addElement(arrabstractElement); + aliasesElement.setElementSize((float) 60, (float) 30, (float) 140, 30); + return true; + } + return false; + } + + @Override + public void handleElementMouse() { + this.scrollBar.handleElementMouse(); + this.scrollDraw.handleElementMouse(); + } + + private void sendMessage() { + String string = this.messageElement.getText(); + + CheatBreaker.getInstance().getFriendsManager().addOutgoingMessage(friend.getPlayerId(), string); + CheatBreaker.getInstance().getWsNetHandler().sendPacket(new WSPacketFriendMessage(friend.getPlayerId(), string)); + // CheatBreaker.getInstance().getAudioManager().sendSound("short_whoosh1"); + this.messageElement.setText(""); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + this.messageElement.onMouseMoved(f, f2, n, bl); + this.sendButton.onMouseMoved(f, f2, n, bl); + this.scrollBar.onMouseMoved(f, f2, n, bl); + this.aliasesButton.onMouseMoved(f, f2, n, bl); + this.closeButton.onMouseMoved(f, f2, n, bl); + return false; + } + + public void handleElementUpdate(Friend friend) { + this.friend = friend; + } + + public Friend getFriend() { + return this.friend; + } + + public InputFieldElement getMssageElement() { + return this.messageElement; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/theme/AbstractTheme.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/theme/AbstractTheme.java new file mode 100644 index 0000000..b678362 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/theme/AbstractTheme.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.ui.theme; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter @AllArgsConstructor // to be made +public abstract class AbstractTheme { + + private String name; + private String description; + private String[] authors; + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/theme/CBTheme.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/theme/CBTheme.java new file mode 100644 index 0000000..ad4035f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/theme/CBTheme.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.ui.theme; + +public class CBTheme { + public static int lightBackgroundColor = -723724; + public static int lightBackgroundColor2 = 0x9FF4F4F4; + public static int lightBackgroundColor3 = 0xFFF2F7F7; + public static int lightBackgroundColor4 = 0xFFF5F5F5; + public static int lightEnabledBackgroundColor = 0xFF2BA836; + public static int lightDisabledBackgroundColor = 0xFFA82B2B; + public static int lightInactiveBackgroundColor = 0xAFB0B0B0; + public static int lightTextColor = 0x6F000000; + public static int lightTextColor2 = 0x8F000000; + public static int lightTextColor3 = 0xBF000000; + public static int lightTextColor4 = 0xAF000000; + public static int lightTextColor5 = 0xCF000000; + public static int lightTextColor6 = 0x7F000000; + public static int lightDullTextColor = 0x2f2f2f2f; + public static int lightDullTextColor2 = 0xCf2f2f2f; + public static int lightDullTextColor3 = 0x1f2f2f2f; + public static int lightDullTextColor4 = 0x6f2f2f2f; + + public static int darkBackgroundColor = 0xFF141414; + public static int darkBackgroundColor2 = 0x94141414; + public static int darkBackgroundColor3 = 0xFF121717; + public static int darkBackgroundColor4 = 0xFF151515; + public static int darkEnabledBackgroundColor = 0xFF248c2d; + public static int darkDisabledBackgroundColor = 0xFF8c2424; + public static int darkInactiveBackgroundColor = 0xAF4d4d4d; + public static int darkTextColor = 0x8FFFFFFF; + public static int darkTextColor2 = 0xAFFFFFFF; + public static int darkTextColor3 = 0xDFFFFFFF; + public static int darkTextColor4 = 0xCFFFFFFF; + public static int darkTextColor5 = 0xEFFFFFFF; + public static int darkTextColor6 = 0x9FFFFFFF; + public static int darkDullTextColor = 0x4fdfdfdf; + public static int darkDullTextColor2 = 0xefdfdfdf; + public static int darkDullTextColor3 = 0x3fdfdfdf; + public static int darkDullTextColor4 = 0x8fdfdfdf; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/HudUtil.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/HudUtil.java new file mode 100644 index 0000000..c27aac6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/HudUtil.java @@ -0,0 +1,168 @@ +package com.cheatbreaker.client.ui.util; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomColors; +import org.lwjgl.opengl.GL11; + +public final class HudUtil { + private static final int[] colorCodes = new int[]{0, 170, 43520, 43690, 0xAA0000, 0xAA00AA, 0xFFAA00, 0xAAAAAA, 0x555555, 0x5555FF, 0x55FF55, 0x55FFFF, 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF, 0, 42, 10752, 10794, 0x2A0000, 0x2A002A, 0x2A2A00, 0x2A2A2A, 0x151515, 1381695, 1392405, 1392447, 4134165, 4134207, 4144917, 0x3F3F3F}; + + public static int getColorCode(char c, boolean bl) { + return colorCodes[bl ? "0123456789abcdef".indexOf(c) : "0123456789abcdef".indexOf(c) + 16]; + } + + public static void drawContinuousTexturedBox(int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, float f) { + HudUtil.drawContinuousTexturedBox(n, n2, n3, n4, n5, n6, n7, n8, n9, n9, n9, n9, f); + } + + public static void drawContinuousTexturedBox(ResourceLocation resourceLocation, int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, float f) { + HudUtil.drawContinuousTexturedBox(resourceLocation, n, n2, n3, n4, n5, n6, n7, n8, n9, n9, n9, n9, f); + } + + public static void drawContinuousTexturedBox(ResourceLocation resourceLocation, int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, float f) { + Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); + HudUtil.drawContinuousTexturedBox(n, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, f); + } + + public static void drawContinuousTexturedBox(int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, float f) { + int n13; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(770, 771); + int n14 = n7 - n11 - n12; + int n15 = n8 - n9 - n10; + int n16 = n5 - n11 - n12; + int n17 = n6 - n9 - n10; + int n18 = n16 / n14; + int n19 = n16 % n14; + int n20 = n17 / n15; + int n21 = n17 % n15; + HudUtil.drawTexturedModalRect(n, n2, n3, n4, n11, n9, f); + HudUtil.drawTexturedModalRect(n + n11 + n16, n2, n3 + n11 + n14, n4, n12, n9, f); + HudUtil.drawTexturedModalRect(n, n2 + n9 + n17, n3, n4 + n9 + n15, n11, n10, f); + HudUtil.drawTexturedModalRect(n + n11 + n16, n2 + n9 + n17, n3 + n11 + n14, n4 + n9 + n15, n12, n10, f); + for (n13 = 0; n13 < n18 + (n19 > 0 ? 1 : 0); ++n13) { + HudUtil.drawTexturedModalRect(n + n11 + n13 * n14, n2, n3 + n11, n4, n13 == n18 ? n19 : n14, n9, f); + HudUtil.drawTexturedModalRect(n + n11 + n13 * n14, n2 + n9 + n17, n3 + n11, n4 + n9 + n15, n13 == n18 ? n19 : n14, n10, f); + for (int i = 0; i < n20 + (n21 > 0 ? 1 : 0); ++i) { + HudUtil.drawTexturedModalRect(n + n11 + n13 * n14, n2 + n9 + i * n15, n3 + n11, n4 + n9, n13 == n18 ? n19 : n14, i == n20 ? n21 : n15, f); + } + } + for (n13 = 0; n13 < n20 + (n21 > 0 ? 1 : 0); ++n13) { + HudUtil.drawTexturedModalRect(n, n2 + n9 + n13 * n15, n3, n4 + n9, n11, n13 == n20 ? n21 : n15, f); + HudUtil.drawTexturedModalRect(n + n11 + n16, n2 + n9 + n13 * n15, n3 + n11 + n14, n4 + n9, n12, n13 == n20 ? n21 : n15, f); + } + } + + public static void drawTexturedModalRect(int n, int n2, int n3, int n4, int n5, int n6, float f) { + float f2 = 1.1355932f * 0.0034398322f; + float f3 = 0.0015345983f * 2.5454545f; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(n + 0, n2 + n6, f).tex((float) (n3 + 0) * f2, (float) (n4 + n6) * f3).endVertex(); + worldrenderer.pos(n + n5, n2 + n6, f).tex((float) (n3 + n5) * f2, (float) (n4 + n6) * f3).endVertex(); + worldrenderer.pos(n + n5, n2 + 0, f).tex((float) (n3 + n5) * f2, (float) (n4 + 0) * f3).endVertex(); + worldrenderer.pos(n + 0, n2 + 0, f).tex((float) (n3 + 0) * f2, (float) (n4 + 0) * f3).endVertex(); + tessellator.draw(); + } + + public static void renderItemOverlayIntoGUI(FontRenderer fontRenderer, ItemStack itemStack, int n, int n2) { + renderItemOverlayIntoGUI(fontRenderer, itemStack, n, n2, true, true); + } + + public static void renderItemOverlayIntoGUI(FontRenderer fontRenderer, ItemStack itemStack, int n, int n2, boolean bl, boolean bl2) { + if (itemStack != null && (bl || bl2)) { + int n3; + if (itemStack.isItemDamaged() && bl) { + n3 = (int) Math.round((double) 13 - (double) itemStack.getItemDamage() * (double) 13 / (double) itemStack.getMaxDamage()); + int n4 = (int) Math.round((double) 255 - (double) itemStack.getItemDamage() * (double) 255 / (double) itemStack.getMaxDamage()); + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); + GlStateManager.disableTexture2D(); + Tessellator tessellator = Tessellator.getInstance(); + int n5 = 255 - n4 << 16 | n4 << 8; + int n6 = (255 - n4) / 4 << 16 | 0x3F00; + HudUtil.renderQuad(tessellator, n + 2, n2 + 13, 13, 2, 0, 0, 0, 255); + HudUtil.renderQuad(tessellator, n + 2, n2 + 13, 12, 1, (255 - n4) / 4, 64, 0, 255); + int j = 255 - n4; + int k = n4; + int l = 0; + + if (Config.isCustomColors()) { + int i1 = CustomColors.getDurabilityColor(n4); + + if (i1 >= 0) { + j = i1 >> 16 & 255; + k = i1 >> 8 & 255; + l = i1 >> 0 & 255; + } + } + + HudUtil.renderQuad(tessellator, n + 2, n2 + 13, n3, 1, j, k, l, 255); + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); + GlStateManager.enableBlend(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + if (bl2) { + n3 = 0; + if (itemStack.getMaxStackSize() > 1) { + n3 = HudUtil.countInInventory(Minecraft.getMinecraft().thePlayer, itemStack.getItem(), itemStack.getItemDamage()); + } else if (itemStack.getItem().equals(Items.bow)) { + n3 = HudUtil.countInInventory(Minecraft.getMinecraft().thePlayer, Items.arrow); + } + if (n3 > 1) { + String string = "" + n3; + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); + fontRenderer.drawStringWithShadow(string, (float) (n + 19 - 2 - fontRenderer.getStringWidth(string)), (float) (n2 + 6 + 3), 0xFFFFFF); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + } + } + } + } + + public static void renderQuad(Tessellator tessellator, int n, int n2, int n3, int n4, int red, int green, int blue, int alpha) { + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(n + 0, n2 + 0, 0.0).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(n + 0, n2 + n4, 0.0).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(n + n3, n2 + n4, 0.0).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(n + n3, n2 + 0, 0.0).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + } + + public static int countInInventory(EntityPlayer entityPlayer, Item item) { + return HudUtil.countInInventory(entityPlayer, item, -1); + } + + public static int countInInventory(EntityPlayer entityPlayer, Item item, int n) { + int n2 = 0; + for (int i = 0; i < entityPlayer.inventory.mainInventory.length; ++i) { + if (entityPlayer.inventory.mainInventory[i] == null || !item.equals(entityPlayer.inventory.mainInventory[i].getItem()) || n != -1 && entityPlayer.inventory.mainInventory[i].getItemDamage() != n) + continue; + n2 += entityPlayer.inventory.mainInventory[i].stackSize; + } + return n2; + } + + public static String getColorCode(String string) { + return string.replaceAll("(?i)§[0-9a-fklmnor]", ""); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/RenderUtil.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/RenderUtil.java new file mode 100644 index 0000000..35b8c1e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/RenderUtil.java @@ -0,0 +1,273 @@ +package com.cheatbreaker.client.ui.util; + + +import com.cheatbreaker.client.util.render.RGBData; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class RenderUtil {//TODO: Finish mapping this class + protected static float zero = 0.0f; + private static final double thirty = 30.0; + + public static void drawTexturedModalRect(float f, float f2, float f3, float f4, int n, int n2) { + float f5 = 0.00390625f; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(f, f2 + (float) n2, zero).tex(f3 * f5, (f4 + (float) n2) * f5).endVertex(); + worldrenderer.pos(f + (float) n, f2 + (float) n2, zero).tex((f3 + (float) n) * f5, (f4 + (float) n2) * f5).endVertex(); + worldrenderer.pos(f + (float) n, f2, zero).tex((f3 + (float) n) * f5, f4 * f5).endVertex(); + worldrenderer.pos(f, f2, zero).tex(f3 * f5, f4 * f5).endVertex(); + tessellator.draw(); + } + + public static void startMCScaledScissorBox(int n, int n2, int n3, int n4, ScaledResolution scaledResolution) { + int scaleFactor = scaledResolution.getScaleFactor(); + int n6 = n4 - n2; + int n7 = n3 - n; + int n8 = scaledResolution.getScaledHeight() - n4; + GL11.glScissor(n * scaleFactor, n8 * scaleFactor, n7 * scaleFactor, n6 * scaleFactor); + } + + public static void renderIcon(ResourceLocation resourceLocation, float size, float x, float y) { + float f4 = size * 2.0f; + float f5 = size * 2.0f; + float f6 = 0.0f; + float f7 = 0.0f; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation); + GL11.glBegin(7); + GL11.glTexCoord2d(f6 / size, f7 / size); + GL11.glVertex2d(x, y); + GL11.glTexCoord2d(f6 / size, (f7 + size) / size); + GL11.glVertex2d(x, y + f5); + GL11.glTexCoord2d((f6 + size) / size, (f7 + size) / size); + GL11.glVertex2d(x + f4, y + f5); + GL11.glTexCoord2d((f6 + size) / size, f7 / size); + GL11.glVertex2d(x + f4, y); + GL11.glEnd(); + GL11.glDisable(3042); + } + + public static void renderEIcon(ResourceLocation resourceLocation, float f, float f2, float f3) { + float f4 = f * 2.0f; + float f5 = f * 2.0f; + float f6 = 0.0f; + float f7 = 0.0f; + GL11.glEnable(3042); + Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); + GL11.glBegin(7); + GL11.glTexCoord2d(f6 / f, f7 / f); + GL11.glVertex2d(f2, f3); + GL11.glTexCoord2d(f6 / f, (f7 + f) / f); + GL11.glVertex2d(f2, f3 + f5); + GL11.glTexCoord2d((f6 + f) / f, (f7 + f) / f); + GL11.glVertex2d(f2 + f4, f3 + f5); + GL11.glTexCoord2d((f6 + f) / f, f7 / f); + GL11.glVertex2d(f2 + f4, f3); + GL11.glEnd(); + GL11.glDisable(3042); + } + + public static void renderIcon(ResourceLocation resourceLocation, float f, float f2, float f3, float f4) { + float f5 = f3 / 2.0f; + float f6 = 0.0f; + float f7 = 0.0f; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation); + GL11.glBegin(7); + GL11.glTexCoord2d(f6 / f5, f7 / f5); + GL11.glVertex2d(f, f2); + GL11.glTexCoord2d(f6 / f5, (f7 + f5) / f5); + GL11.glVertex2d(f, f2 + f4); + GL11.glTexCoord2d((f6 + f5) / f5, (f7 + f5) / f5); + GL11.glVertex2d(f + f3, f2 + f4); + GL11.glTexCoord2d((f6 + f5) / f5, f7 / f5); + GL11.glVertex2d(f + f3, f2); + GL11.glEnd(); + GL11.glDisable(3042); + } + + public static void startScissorBox(int n, int n2, int n3, int n4, float f, int n5) { + int n6 = n4 - n2; + int n7 = n3 - n; + int n8 = n5 - n4; + GL11.glScissor((int) ((float) n * f), (int) ((float) n8 * f), (int) ((float) n7 * f), (int) ((float) n6 * f)); + } + + public static void drawRoundedRect(double d, double d2, double d3, double d4, double d5, int color) { + int n2; + float f = (float) (color >> 24 & 0xFF) / 255.0F; + float f2 = (float) (color >> 16 & 0xFF) / 255.0F; + float f3 = (float) (color >> 8 & 0xFF) / 255.0F; + float f4 = (float) (color & 0xFF) / 255.0F; + GL11.glPushAttrib(0); + GL11.glScaled(0.5D, 0.5D, 0.5D); + d *= 2.0; + d2 *= 2.0; + d3 *= 2.0; + d4 *= 2.0; + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GL11.glColor4f(f2, f3, f4, f); + GL11.glEnable(2848); + GL11.glBegin(9); + for (n2 = 0; n2 <= 90; n2 += 3) { + GL11.glVertex2d(d + d5 + Math.sin((double) n2 * Math.PI / 180.0) * (d5 * -1.0), d2 + d5 + Math.cos((double) n2 * Math.PI / 180.0) * (d5 * -1.0)); + } + for (n2 = 90; n2 <= 180; n2 += 3) { + GL11.glVertex2d(d + d5 + Math.sin((double) n2 * Math.PI / 180.0) * (d5 * -1.0), d4 - d5 + Math.cos((double) n2 * Math.PI / 180.0) * (d5 * -1.0)); + } + for (n2 = 0; n2 <= 90; n2 += 3) { + GL11.glVertex2d(d3 - d5 + Math.sin((double) n2 * Math.PI / 180.0) * d5, d4 - d5 + Math.cos((double) n2 * Math.PI / 180.0) * d5); + } + for (n2 = 90; n2 <= 180; n2 += 3) { + GL11.glVertex2d(d3 - d5 + Math.sin((double) n2 * Math.PI / 180.0) * d5, d2 + d5 + Math.cos((double) n2 * Math.PI / 180.0) * d5); + } + GL11.glEnd(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + GL11.glDisable(2848); + GL11.glScaled(2.0, 2.0, 2.0); + GL11.glPopAttrib(); + } + + public static void drawCircle(double d, double d2, double d3) { + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(6, DefaultVertexFormats.POSITION); + worldrenderer.pos(d, d2, zero).endVertex(); + double d4 = Math.PI * 2; + double d5 = d4 / 30.0; + for (double d6 = -d5; d6 < d4; d6 += d5) { + worldrenderer.pos(d + d3 * Math.cos(-d6), d2 + d3 * Math.sin(-d6), zero).endVertex(); + } + tessellator.draw(); + GL11.glEnable(3553); + GL11.glDisable(3042); + } + + public static void drawCircleWithOutLine(double d, double d2, double d3, double d4, double d5, int n, double d6) { + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glEnable(2848); + d5 = (d5 + (double) n) % (double) n; + Tessellator tessellator = Tessellator.getInstance(); + for (double d7 = (double) 360 / (double) n * d5; d7 < 360.0 / (double) n * (d5 + d6); d7 += 1.0) { + double d8 = d7 * Math.PI / 180.0; + double d9 = (d7 - 1.0) * Math.PI / 180.0; + double[] arrd = new double[]{Math.cos(d8) * d3, -Math.sin(d8) * d3, Math.cos(d9) * d3, -Math.sin(d9) * d3}; + double[] arrd2 = new double[]{Math.cos(d8) * d4, -Math.sin(d8) * d4, Math.cos(d9) * d4, -Math.sin(d9) * d4}; + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(d + arrd2[0], d2 + arrd2[1], 0.0).endVertex(); + worldrenderer.pos(d + arrd2[2], d2 + arrd2[3], 0.0).endVertex(); + worldrenderer.pos(d + arrd[2], d2 + arrd[3], 0.0).endVertex(); + worldrenderer.pos(d + arrd[0], d2 + arrd[1], 0.0).endVertex(); + tessellator.draw(); + } + GL11.glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + GL11.glDisable(3042); + GL11.glEnable(3553); + } + + public static void drawRadial(double d, double d2, double d3, double d4, double d5, double d6) { + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glEnable(2848); + Tessellator tessellator = Tessellator.getInstance(); + for (double d7 = d5; d7 < d6; d7 += 0.5) { + double d8 = d7 * Math.PI / 180.0; + double d9 = (d7 - 1.0) * Math.PI / 180.0; + double[] arrd = new double[]{Math.cos(d8) * d3, -Math.sin(d8) * d3, Math.cos(d9) * d3, -Math.sin(d9) * d3}; + double[] arrd2 = new double[]{Math.cos(d8) * d4, -Math.sin(d8) * d4, Math.cos(d9) * d4, -Math.sin(d9) * d4}; + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(d + arrd2[0], d2 + arrd2[1], 0.0).endVertex(); + worldrenderer.pos(d + arrd2[2], d2 + arrd2[3], 0.0).endVertex(); + worldrenderer.pos(d + arrd[2], d2 + arrd[3], 0.0).endVertex(); + worldrenderer.pos(d + arrd[0], d2 + arrd[1], 0.0).endVertex(); + tessellator.draw(); + } + GL11.glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + GL11.glDisable(3042); + GL11.glEnable(3553); + } + + public static void drawHorizontalLine(float f, float f2, float f3, int color) { + if (f2 < f) { + float f4 = f; + f = f2; + f2 = f4; + } + Gui.drawRect(f, f3, f2 + 1.0f, f3 + 1.0f, color); + } + + public static RGBData getRgbValues(int color) { + int red = (color >> 16 & 255) / 255; + int green = (color >> 8 & 255) / 255; + int blue = (color & 255) / 255; + + return new RGBData(red, green, blue); + } + + public static void drawVerticalLine(float f, float f2, float f3, int color) { + if (f3 < f2) { + float f4 = f2; + f2 = f3; + f3 = f4; + } + Gui.drawRect(f, f2 + 1.0f, f + 1.0f, f3, color); + } + + public static void drawRectWithOutline(float left, float top, float right, float bottom, int outlineColor, int rectColor) { + GL11.glScalef(0.5f, 0.5f, 0.5f); + Gui.drawRect((left *= 2.0f) + 1.0f, (top *= 2.0f) + 1.0f, (right *= 2.0f) - 1.0f, (bottom *= 2.0f) - 1.0f, rectColor); + RenderUtil.drawVerticalLine(left, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawVerticalLine(right - 1.0f, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, top, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, bottom - 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, bottom - 2.0f, outlineColor); + GL11.glScalef(2.0f, 2.0f, 2.0f); + } + + public static void drawGradientRectWithOutline(float left, float top, float right, float bottom, int outlineColor, int startColor, int endColor) { + GL11.glScalef(0.5f, 0.5f, 0.5f); + Minecraft.getMinecraft().ingameGUI.drawGradientRect((left *= 2.0f) + 1.0f, (top *= 2.0f) + 1.0f, (right *= 2.0f) - 1.0f, (bottom *= 2.0f) - 1.0f, startColor, endColor); + RenderUtil.drawVerticalLine(left, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawVerticalLine(right - 1.0f, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, top, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, bottom - 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, bottom - 2.0f, outlineColor); + GL11.glScalef(2.0f, 2.0f, 2.0f); + } + + public static void drawRectWithShadow(float x, float y, float x2, float y2, int color, boolean shadow) { + if (shadow) { + Gui.drawRect(x + 1.0F, y + 1.0F, x2 + 1.0F, y2 + 1.0F, new Color((color >> 16 & 255) / 4, (color >> 8 & 255) / 4, (color & 255) / 4, color >> 24 & 255).getRGB()); + } + Gui.drawRect(x, y, x2, y2, color); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CBFont.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CBFont.java new file mode 100644 index 0000000..0e12f54 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CBFont.java @@ -0,0 +1,150 @@ +package com.cheatbreaker.client.ui.util.font; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.InputStream; + +public class CBFont { + private final float imgSize = 1048; + protected CharData[] charData = new CharData[256]; + protected Font font; + protected boolean antiAlias; + protected boolean fractionalMetrics; + protected int fontHeight = -1; + protected int charOffset = 0; + protected DynamicTexture tex; + + public CBFont(ResourceLocation resourceLocation, float size) { + Font font; + try { + InputStream inputStream = Minecraft.getMinecraft() == null || Minecraft.getMinecraft().getResourceManager() == null ? Minecraft.getMinecraft().getMcDefaultResourcePack().getResourceStream(resourceLocation) : Minecraft.getMinecraft().getResourceManager().getResource(resourceLocation).getInputStream(); + font = Font.createFont(0, inputStream).deriveFont(size); + } catch (Exception exception) { + font = new Font("Arial", 0, (int) size); + } + this.font = font; + this.antiAlias = true; + this.fractionalMetrics = true; + this.tex = this.setupTexture(this.font, this.antiAlias, this.fractionalMetrics, this.charData); + } + + protected DynamicTexture setupTexture(Font font, boolean bl, boolean bl2, CharData[] arrcharData) { + BufferedImage bufferedImage = this.generateFontImage(font, bl, bl2, arrcharData); + try { + return new DynamicTexture(bufferedImage); + } catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + private BufferedImage generateFontImage(Font font, boolean bl, boolean bl2, CharData[] arrcharData) { + int n = (int) this.imgSize; + BufferedImage bufferedImage = new BufferedImage(n, n, 2); + Graphics2D graphics2D = (Graphics2D) bufferedImage.getGraphics(); + graphics2D.setFont(font); + graphics2D.setColor(new Color(255, 255, 255, 0)); + graphics2D.fillRect(0, 0, n, n); + graphics2D.setColor(Color.WHITE); + graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, bl2 ? RenderingHints.VALUE_FRACTIONALMETRICS_ON : RenderingHints.VALUE_FRACTIONALMETRICS_OFF); + graphics2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, bl ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); + graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, bl ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF); + FontMetrics fontMetrics = graphics2D.getFontMetrics(); + int n2 = 0; + int n3 = 0; + int n4 = 1; + for (int i = 0; i < arrcharData.length; ++i) { + char c = (char) i; + CharData charData = new CharData(this); + Rectangle2D rectangle2D = fontMetrics.getStringBounds(String.valueOf(c), graphics2D); + charData.width = rectangle2D.getBounds().width + 8; + charData.height = rectangle2D.getBounds().height; + if (n3 + charData.width >= n) { + n3 = 0; + n4 += n2; + n2 = 0; + } + if (charData.height > n2) { + n2 = charData.height; + } + charData.storedX = n3; + charData.storedY = n4; + if (charData.height > this.fontHeight) { + this.fontHeight = charData.height; + } + arrcharData[i] = charData; + graphics2D.drawString(String.valueOf(c), n3 + 2, n4 + fontMetrics.getAscent()); + n3 += charData.width; + } + return bufferedImage; + } + + protected void drawChar(CharData[] arrcharData, char c, float f, float f2) { + try { + this.drawQuad(f, f2, arrcharData[c].width, arrcharData[c].height, arrcharData[c].storedX, arrcharData[c].storedY, arrcharData[c].width, arrcharData[c].height); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + private void drawQuad(float f, float f2, float f3, float f4, float f5, float f6, float f7, float f8) { + float f9 = f5 / this.imgSize; + float f10 = f6 / this.imgSize; + float f11 = f7 / this.imgSize; + float f12 = f8 / this.imgSize; + GL11.glTexCoord2f(f9 + f11, f10); + GL11.glVertex2d(f + f3, f2); + GL11.glTexCoord2f(f9, f10); + GL11.glVertex2d(f, f2); + GL11.glTexCoord2f(f9, f10 + f12); + GL11.glVertex2d(f, f2 + f4); + GL11.glTexCoord2f(f9, f10 + f12); + GL11.glVertex2d(f, f2 + f4); + GL11.glTexCoord2f(f9 + f11, f10 + f12); + GL11.glVertex2d(f + f3, f2 + f4); + GL11.glTexCoord2f(f9 + f11, f10); + GL11.glVertex2d(f + f3, f2); + } + + public int getHeight() { + return (this.fontHeight - 8) / 2; + } + + public int getStringWidth(String string) { + int n = 0; + for (char c : string.toCharArray()) { + if (c >= this.charData.length || c < '\u0000') continue; + n += this.charData[c].width - 8 + this.charOffset; + } + return n / 2; + } + + public void setAntiAlias(boolean bl) { + if (this.antiAlias != bl) { + this.antiAlias = bl; + this.tex = this.setupTexture(this.font, bl, this.fractionalMetrics, this.charData); + } + } + + public void setFractionalMetrics(boolean bl) { + if (this.fractionalMetrics != bl) { + this.fractionalMetrics = bl; + this.tex = this.setupTexture(this.font, this.antiAlias, bl, this.charData); + } + } + + public Font getFont() { + return this.font; + } + + public void setFont(Font font) { + this.font = font; + this.tex = this.setupTexture(font, this.antiAlias, this.fractionalMetrics, this.charData); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CBFontRenderer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CBFontRenderer.java new file mode 100644 index 0000000..8e8c3b3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CBFontRenderer.java @@ -0,0 +1,403 @@ +package com.cheatbreaker.client.ui.util.font; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +public class CBFontRenderer extends CBFont { + private final char COLOR_CODE_START = (char) 167; + protected CharData[] boldItalicChars = new CharData[256]; + protected CharData[] italicChars = new CharData[256]; + protected CharData[] boldChars = new CharData[256]; + private final int[] colorCode = new int[32]; + private final String validColorCodes = "0123456789abcdefklmnor"; + protected DynamicTexture texBold; + protected DynamicTexture texItalic; + protected DynamicTexture texItalicBold; + + public CBFontRenderer(ResourceLocation resourceLocation, float size) { + super(resourceLocation, size); + try { + Minecraft.getMinecraft().cbLoadingScreen.addPhase(); + } catch (NullPointerException ignored) {} + this.setupMinecraftColorCodes(); + this.setupBoldItalicIDs(); + } + + public float drawCenteredStringWithShadow(String var1, double var2, double var4, int var6, int var7) { + float shadowWidth = this.drawString(var1, var2 + 1.0, var4 + 1.0, var7, false); + return Math.max(shadowWidth, this.drawString(var1, var2, var4, var6, false)); + } + + public float drawStringWithShadow(String var1, double var2, double var4, int var6) { + float shadowWidth = this.drawString(var1, var2 + 1.0, var4 + 1.0, var6, true); + return Math.max(shadowWidth, this.drawString(var1, var2, var4, var6, false)); + } + + public float drawString(String var1, float var2, float var3, int var4) { + return this.drawString(var1, var2, var3, var4, false); + } + + public float drawCenteredString(String var1, float var2, float var3, int var4) { + return this.drawString(var1, var2 - (float) (this.getStringWidth(var1) / 2), var3, var4); + } + + public float drawCenteredStringWithShadow(String var1, float var2, float var3, int var4) { + this.drawString(var1, (double) (var2 - (float) (this.getStringWidth(var1) / 2)) + 1.0, (double) var3 + 1.0, var4, true); + return this.drawString(var1, var2 - (float) (this.getStringWidth(var1) / 2), var3, var4); + } + + public float drawString(String var1, double var2, double var4, int var6, boolean var7) { + var2 -= 1.0; + if (var1 == null) { + return 0.0f; + } + if (var6 == 0x20FFFFFF) { + var6 = 0xFFFFFF; + } + if ((var6 & 0xFC000000) == 0) { + var6 |= 0xFF000000; + } + if (var7) { + var6 = (var6 & 0xFCFCFC) >> 2 | var6 & 0xFF000000; + } + CharData[] var8 = this.charData; + float var9 = (float) (var6 >> 24 & 0xFF) / 255.0f; + boolean var10 = false; + boolean var11 = false; + boolean var12 = false; + boolean var13 = false; + boolean var14 = false; + boolean var15 = true; + var2 *= 2.0; + var4 = (var4 - 3.0) * 2.0; + if (var15) { + GL11.glPushMatrix(); + GL11.glScaled(0.5, 0.5, 0.5); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glColor4f((float) (var6 >> 16 & 0xFF) / 255.0f, (float) (var6 >> 8 & 0xFF) / 255.0f, (float) (var6 & 0xFF) / 255.0f, var9); + int var16 = var1.length(); + GL11.glEnable(3553); +// System.out.println(this.tex.getGlTextureId()); + int oldTex = GL11.glGetInteger(32873); + GL11.glBindTexture(3553, this.tex.getGlTextureId()); + for (int var17 = 0; var17 < var16; ++var17) { + char var18 = var1.charAt(var17); + if (var18 == this.COLOR_CODE_START && var17 < var16) { + int var19 = 21; + try { + var19 = "0123456789abcdefklmnor".indexOf(var1.charAt(var17 + 1)); + } catch (Exception var21) { + var21.printStackTrace(); + } + if (var19 < 16) { + var11 = false; + var12 = false; + var10 = false; + var14 = false; + var13 = false; + GL11.glBindTexture(3553, this.tex.getGlTextureId()); + var8 = this.charData; + if (var19 < 0 || var19 > 15) { + var19 = 15; + } + if (var7) { + var19 += 16; + } + int var20 = this.colorCode[var19]; + GL11.glColor4f((float) (var20 >> 16 & 0xFF) / 255.0f, (float) (var20 >> 8 & 0xFF) / 255.0f, (float) (var20 & 0xFF) / 255.0f, var9); + } else if (var19 == 16) { + var10 = true; + } else if (var19 == 17) { + var11 = true; + if (var12) { + GL11.glBindTexture(3553, this.texItalicBold.getGlTextureId()); + var8 = this.boldChars; + } else { + GL11.glBindTexture(3553, this.texBold.getGlTextureId()); + var8 = this.boldItalicChars; + } + } else if (var19 == 18) { + var13 = true; + } else if (var19 == 19) { + var14 = true; + } else if (var19 == 20) { + var12 = true; + if (var11) { + GL11.glBindTexture(3553, this.texItalicBold.getGlTextureId()); + var8 = this.boldChars; + } else { + GL11.glBindTexture(3553, this.texItalic.getGlTextureId()); + var8 = this.italicChars; + } + } else if (var19 == 21) { + var11 = false; + var12 = false; + var10 = false; + var14 = false; + var13 = false; + GL11.glColor4f((float) (var6 >> 16 & 0xFF) / 255.0f, (float) (var6 >> 8 & 0xFF) / 255.0f, (float) (var6 & 0xFF) / 255.0f, var9); + GL11.glBindTexture(3553, this.tex.getGlTextureId()); + var8 = this.charData; + } + ++var17; + continue; + } + if (var18 >= var8.length || var18 < '\u0000') continue; + GL11.glBegin(4); + this.drawChar(var8, var18, (float) var2, (float) var4 + 6.0f); + GL11.glEnd(); + if (var13) { + this.drawLine(var2, var4 + (double) (var8[var18].height / 2), + var2 + (double) var8[var18].width - 8.0, var4 + + (double) (var8[var18].height / 2), 1.0f); + } + if (var14) { + this.drawLine(var2, var4 + (double) var8[var18].height - 2.0, + var2 + (double) var8[var18].width - 8.0, var4 + + (double) var8[var18].height - 2.0, 1.0f); + } + var2 += var8[var18].width - 8 + this.charOffset; + } + GL11.glDisable(3042); + GL11.glBindTexture(3553, oldTex); + GL11.glHint(3155, 4352); + GL11.glPopMatrix(); + } + return (float) var2 / 2.0f; + } + + public String setWrapWords(String string, double width) { + return this.wrapWords(string, width, false); + } + + public String wrapWords(String var1, double width, boolean var4) { + StringBuilder var5 = new StringBuilder(); + float var6 = 0.0f; + int var7 = var4 ? var1.length() - 1 : 0; + int var8 = var4 ? -1 : 1; + boolean var9 = false; + boolean var10 = false; + for (int var11 = var7; var11 >= 0 && var11 < var1.length() && var6 < (float) width; var11 += var8) { + char var12 = var1.charAt(var11); + double var13 = this.getStringWidth(String.valueOf(var12)); + if (var9) { + var9 = false; + if (var12 != 'l' && var12 != 'L') { + if (var12 == 'r' || var12 == 'R') { + var10 = false; + } + } else { + var10 = true; + } + } else if (var13 < 0.0) { + var9 = true; + } else { + var6 = (float) ((double) var6 + var13); + if (var10) { + var6 += 1.0f; + } + } + if (var6 > (float) width) break; + if (var4) { + var5.insert(0, var12); + continue; + } + var5.append(var12); + } + return var5.toString(); + } + + @Override + public int getStringWidth(String var1) { + if (var1 == null) { + return 0; + } + int var2 = 0; + CharData[] var3 = this.charData; + boolean var4 = false; + boolean var5 = false; + int var6 = var1.length(); + for (int var7 = 0; var7 < var6; ++var7) { + char var8 = var1.charAt(var7); + if (var8 == this.COLOR_CODE_START && var7 < var6) { + int var9 = "0123456789abcdefklmnor".indexOf(var8); + if (var9 < 16) { + var4 = false; + var5 = false; + } else if (var9 == 17) { + var4 = true; + var3 = var5 ? this.boldChars : this.boldItalicChars; + } else if (var9 == 20) { + var5 = true; + var3 = var4 ? this.boldChars : this.italicChars; + } else if (var9 == 21) { + var4 = false; + var5 = false; + var3 = this.charData; + } + ++var7; + continue; + } + if (var8 >= var3.length || var8 < '\u0000') continue; + var2 += var3[var8].width - 8 + this.charOffset; + } + return var2 / 2; + } + + @Override + public void setAntiAlias(boolean var1) { + super.setAntiAlias(var1); + this.setupBoldItalicIDs(); + } + + @Override + public void setFractionalMetrics(boolean var1) { + super.setFractionalMetrics(var1); + this.setupBoldItalicIDs(); + } + + private void setupBoldItalicIDs() { + this.texBold = this.setupTexture(this.font.deriveFont(1), this.antiAlias, this.fractionalMetrics, this.boldItalicChars); + this.texItalic = this.setupTexture(this.font.deriveFont(2), this.antiAlias, this.fractionalMetrics, this.italicChars); + this.texItalicBold = this.setupTexture(this.font.deriveFont(3), this.antiAlias, this.fractionalMetrics, this.boldChars); + } + + private void drawLine(double var1, double var3, double var5, double var7, float var9) { + GL11.glDisable(3553); + GL11.glLineWidth(var9); + GL11.glBegin(1); + GL11.glVertex2d(var1, var3); + GL11.glVertex2d(var5, var7); + GL11.glEnd(); + GL11.glEnable(3553); + } + + public String formatText(String var1, double var2) { + StringBuilder var4 = new StringBuilder(); + StringBuilder var5 = new StringBuilder(); + boolean var6 = false; + + if (var1 == null) return null; + + for (char var10 : var1.toCharArray()) { + String var14; + String var13; + if (var6) { + var4.append(var10); + var6 = false; + continue; + } + if (var10 == '§') { + var4.append(var10); + var6 = true; + continue; + } + var4.append(var10); + int var11 = this.getStringWidth(var4.toString()); + if (!((double) var11 >= var2)) continue; + String var12 = var4.toString(); + if (var12.contains(" ")) { + var13 = var12.substring(0, var12.lastIndexOf(" ")); + var14 = var12.substring(var12.lastIndexOf(" ")); + if (var14.startsWith(" ")) { + var14 = var14.replaceFirst(" ", ""); + } + } else { + var13 = var12.substring(0, var12.length() - 1); + var14 = var12.substring(var12.length() - 1); + } + var5.append(var13).append("\n"); + String var15 = EnumChatFormatting.formatColor(var4.toString()); + var4.setLength(0); + var4.append(var14).append(var15); + } + var5.append(var4); + return var5.length() == 0 ? var1 : var5.toString(); + } + + public List wrapWords(String text, double width) { + ArrayList finalWords = new ArrayList<>(); + if ((double) this.getStringWidth(text) > width) { + String[] words = text.split(" "); + String currentWord = ""; + int lastColorCode = 65535; + for (int i = 0; i < words.length; ++i) { + String word = words[i]; + for (int var12 = 0; var12 < word.toCharArray().length; ++var12) { + char var13 = word.toCharArray()[var12]; + if (var13 != this.COLOR_CODE_START || var12 >= word.toCharArray().length - 1) continue; + lastColorCode = word.toCharArray()[var12 + 1]; + } + StringBuilder stringBuilder = new StringBuilder(); + if ((double) this.getStringWidth(stringBuilder.append(currentWord).append(word).append(" ").toString()) < width) { + currentWord = currentWord + word + " "; + continue; + } + finalWords.add(currentWord); + currentWord = this.COLOR_CODE_START + lastColorCode + word + " "; + } + if (currentWord.length() > 0) { + if ((double) this.getStringWidth(currentWord) < width) { + finalWords.add(this.COLOR_CODE_START + lastColorCode + currentWord + " "); + currentWord = ""; + } else { + for (String s : this.formatString(currentWord, width)) { + finalWords.add(s); + } + } + } + } else { + finalWords.add(text); + } + return finalWords; + } + + public List formatString(String var1, double var2) { + ArrayList finalWords = new ArrayList(); + String currentWord = ""; + int lastColorCode = 65535; + char[] chars = var1.toCharArray(); + for (int i = 0; i < chars.length; ++i) { + char c = chars[i]; + if (c == this.COLOR_CODE_START && i < chars.length - 1) { + lastColorCode = chars[i + 1]; + } + StringBuilder stringBuilder = new StringBuilder(); + if ((double) this.getStringWidth(stringBuilder.append(currentWord).append(c).toString()) < var2) { + currentWord = currentWord + c; + continue; + } + finalWords.add(currentWord); + currentWord = this.COLOR_CODE_START + lastColorCode + String.valueOf(c); + } + if (currentWord.length() > 0) { + finalWords.add(currentWord); + } + return finalWords; + } + + private void setupMinecraftColorCodes() { + for (int var1 = 0; var1 < 32; ++var1) { + int var2 = (var1 >> 3 & 1) * 85; + int var3 = (var1 >> 2 & 1) * 170 + var2; + int var4 = (var1 >> 1 & 1) * 170 + var2; + int var5 = (var1 & 1) * 170 + var2; + if (var1 == 6) { + var3 += 85; + } + if (var1 >= 16) { + var3 /= 4; + var4 /= 4; + var5 /= 4; + } + this.colorCode[var1] = (var3 & 0xFF) << 16 | (var4 & 0xFF) << 8 | var5 & 0xFF; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CharData.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CharData.java new file mode 100644 index 0000000..7ec5cc5 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/util/font/CharData.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.ui.util.font; + +public class CharData { + public int width; + public int height; + public int storedX; + public int storedY; + final CBFont font; + + protected CharData(CBFont cBFont) { + this.font = cBFont; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/warning/CompetitiveGameWarningGui.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/warning/CompetitiveGameWarningGui.java new file mode 100644 index 0000000..9a751cc --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/warning/CompetitiveGameWarningGui.java @@ -0,0 +1,77 @@ +package com.cheatbreaker.client.ui.warning; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.menus.MainMenu; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.ResourceLocation; + +public class CompetitiveGameWarningGui extends AbstractGui { + private final GuiScreen field_146298_h; + private final GradientTextButton cancelButton; + private final GradientTextButton continueButton; + private final ColorFade warningTextFade; + private boolean ended; + + public CompetitiveGameWarningGui(GuiScreen guiScreen) { + this.field_146298_h = guiScreen; + this.warningTextFade = new ColorFade(2000L, -1, -52429); + this.cancelButton = new GradientTextButton("Cancel"); + this.continueButton = new GradientTextButton("I understand, continue"); + } + + @Override + public void initGui() { + this.blurGui(); + this.ended = true; + float f = this.getScaledWidth() / 2.0f; + float f2 = this.getScaledHeight() / 2.0f - (float) 50; + this.continueButton.setElementSize(f - (float) 75, f2 + (float) 50, (float) 150, 12); + this.cancelButton.setElementSize(f - (float) 75, f2 + (float) 64, (float) 150, 12); + this.cancelButton.buttonColor1(); + } + + @Override + public void onGuiClosed() { + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void drawMenu(float x, float y) { + if (this.ended && this.warningTextFade.isOver()) { + this.ended = false; + } else if (!this.ended && this.warningTextFade.isOver()) { + this.ended = true; + } + this.renderBlur(this.getScaledWidth(), this.getScaledHeight()); + float centeredX = this.getScaledWidth() / 2.0f; + float centeredY = this.getScaledHeight() / 2.0f - (float) 50; + CheatBreaker.getInstance().playBold18px.drawCenteredString("WARNING!", centeredX, centeredY, this.warningTextFade.getColor(this.ended).getRGB()); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Leaving competitive games may result in penalties.", centeredX, centeredY + (float) 15, -1); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("You may be suspended from competitive games if you continue leaving games!", centeredX, centeredY + 25.0F, -1); + this.cancelButton.drawElementHover(x, y, true); + this.continueButton.drawElementHover(x, y, true); + } + + @Override + protected void mouseClicked(float f, float f2, int n) { + if (this.cancelButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(this.field_146298_h); + } else if (this.continueButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld(null); + this.mc.displayGuiScreen(new MainMenu()); + } + } + + @Override + public void mouseMovedOrUp(float f, float f2, int n) { + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/warning/UnsafeServerWarningGUI.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/warning/UnsafeServerWarningGUI.java new file mode 100644 index 0000000..bfb01e4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/ui/warning/UnsafeServerWarningGUI.java @@ -0,0 +1,103 @@ +package com.cheatbreaker.client.ui.warning; + + +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.lang.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class UnsafeServerWarningGUI extends GuiScreen { + private final ServerData selectedButton; + private final GuiScreen eventButton; + private final long currentTime; + private final String reason; + private final boolean blocked; + + public UnsafeServerWarningGUI(GuiScreen guiScreen, ServerData serverData, String reason, boolean block) { + this.eventButton = guiScreen; + this.selectedButton = serverData; + this.currentTime = System.currentTimeMillis(); + this.reason = reason; + this.blocked = block; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + this.drawDefaultBackground(); + float f2 = 0.52F; + int n3 = this.currentTime == 0L ? 10 : (int) ((10999L - (System.currentTimeMillis() - this.currentTime)) / 1000L); + String leaveString = this.blocked ? "Leave" : "Get me out of here!"; + String continueString = "I understand the risk, continue anyways " + (n3 > 0 ? "(" + n3 + ")" : ""); + String title = this.blocked ? "THIS SERVER IS " + EnumChatFormatting.RED + "BLOCKED" : "WARNING!"; + float f3 = this.mc.fontRendererObj.getStringWidth(leaveString); + boolean bl = mouseX > this.width / 2 + 20 && mouseX < this.width / 2 + 140 && mouseY > this.height / 2 + 40 && mouseY < this.height / 2 + 50; + boolean bl2 = (this.blocked ? mouseX > this.width / 2 - 20 : mouseX > this.width / 2 - 130) && (this.blocked ? (float) mouseX < (float) (this.width / 2 - 20) + f3 / f2 : (float) mouseX < (float) (this.width / 2 - 130) + f3 / f2) && mouseY > this.height / 2 + 30 && mouseY < this.height / 2 + 42; + RenderUtil.drawRoundedRect(this.width / 2 - 140, this.height / 2 - 100, this.width / 2 + 140, this.height / 2 + 50, 8, 0x4FFF0000); + GL11.glPushMatrix(); + GL11.glScalef(f2, f2, f2); + if (!this.blocked) { + this.mc.fontRendererObj.drawStringWithShadow(continueString, (float) ((int) ((float) (this.width / 2 + 20) / f2)), (float) ((int) ((float) (this.height / 2 + 40) / f2)), bl ? -1 : (n3 <= 0 ? -1907998 : -5066062)); + } + GL11.glPopMatrix(); + GL11.glPushMatrix(); + f2 = 1.0f; + GL11.glScalef(f2, f2, f2); + String wrapped = WordWrap.from(this.reason).maxWidth(50).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + for (String line : lines) { +// CheatBreaker.getInstance().playRegular14px.drawCenteredString(line, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 14.0f + (index * CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f), 0xFFDDDDDD); + this.mc.fontRendererObj.drawCenteredStringWithShadow(line, (int) ((float) (this.width / 2) / f2), (int) ((float) (this.height / 2 - 70 + (index * 20)) / f2), -1); + index++; + } + if (!this.blocked) { + this.mc.fontRendererObj.drawCenteredStringWithShadow("Join at " + EnumChatFormatting.BOLD + "your own" + EnumChatFormatting.RESET + " risk!", (int) ((float) (this.width / 2) / f2), (int) ((float) (this.height / 2 - 70 + (index * 20)) / f2), -1); + } +// this.mc.fontRendererObj.drawCenteredStringWithShadow(!this.blockedwarn ? "This is a test message." : "You cannot join this server", (int)((float)(this.width / 2) / f2), (int)((float)(this.height / 2 - 70) / f2), -1); +// this.mc.fontRendererObj.drawCenteredStringWithShadow(!this.blockedwarn ? "This is a test message 2." : "", (int)((float)(this.width / 2) / f2), ((int)((float)(this.height / 2 - 50) / f2)), -1); +// this.mc.fontRendererObj.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2 - 40) / f2)), -1); +// this.mc.fontRendererObj.drawCenteredStringWithShadow(!this.blockedwarn ? "Join at " + EnumChatFormatting.BOLD + "your own" + EnumChatFormatting.RESET + " risk!" : "", (int)((float)(this.width / 2) / f2), (int)((float)(this.height / 2 - 30) / f2), -1); +// this.mc.fontRendererObj.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2 - 20) / f2)), -1); +// this.mc.fontRendererObj.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2 - 10) / f2)), -1); +// this.mc.fontRendererObj.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2) / f2)), -1); + GL11.glPopMatrix(); + this.mc.fontRendererObj.drawCenteredStringWithShadow(title, this.width / 2, this.height / 2 - 90, -1); + if (this.blocked) { + this.mc.fontRendererObj.drawCenteredStringWithShadow(leaveString, this.width / 2, this.height / 2 + 30, bl2 ? -1 : -1907998); + } else { + this.mc.fontRendererObj.drawStringWithShadow(leaveString, (float) (this.width / 2 - 130), (float) (this.height / 2 + 30), bl2 ? -1 : -1907998); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + float f = 0.5F; + String leaveString = this.blocked ? "Leave" : "Get me out of here!"; + float f2 = this.mc.fontRendererObj.getStringWidth(leaveString); + boolean bl2 = mouseX > this.width / 2 + 20 && mouseX < this.width / 2 + 140 && mouseY > this.height / 2 + 40 && mouseY < this.height / 2 + 50; + boolean bl = (this.blocked ? mouseX > this.width / 2 - 20 : mouseX > this.width / 2 - 130) && + (this.blocked ? (float) mouseX < (float) (this.width / 2 - 20) + f2 / f : (float) mouseX < (float) (this.width / 2 - 130) + f2 / f) + && mouseY > this.height / 2 + 30 && mouseY < this.height / 2 + 42; + if (bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(this.eventButton); + } + if (bl2 && !this.blocked) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + int n4 = this.currentTime == 0L ? 10 : (int) ((10999L - (System.currentTimeMillis() - this.currentTime)) / 1000L); + if (n4 <= 0) { + this.mc.displayGuiScreen(new GuiConnecting(this.eventButton, this.mc, this.selectedButton)); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/ClientCredits.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/ClientCredits.java new file mode 100644 index 0000000..5b1be08 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/ClientCredits.java @@ -0,0 +1,27 @@ +package com.cheatbreaker.client.util; + +import com.google.common.collect.Sets; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.util.Set; +import java.util.UUID; + +public class ClientCredits { + private static final Set uuids = Sets.newHashSet(UUID.fromString("88051637-26cb-49a4-8f42-04e06264de79"), UUID.fromString("2f6f44cf-19a2-442a-944b-ede88be55651")); + + public static boolean isCreditedUser(UUID uuid) { + System.out.println("bape ship#5604"); + System.out.println("5604-2.0++-2/28/2020"); + return uuids.contains(uuid); + } + + public static void sendCredits() { + ChatComponentText prefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + "Credits: "); + String listPrefix = EnumChatFormatting.RED + "- " + EnumChatFormatting.WHITE; + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(prefix); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(listPrefix + "CheatBreaker LLC for the original client.")); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(listPrefix + "Tellinq and Moose1301 for managing this version.")); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/DataUtil.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/DataUtil.java new file mode 100644 index 0000000..073e4bb --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/DataUtil.java @@ -0,0 +1,31 @@ +package com.cheatbreaker.client.util; + +import java.security.MessageDigest; + +public class DataUtil { + + public static String getHWID() { + try { + String toEncrypt = System.getenv("COMPUTERNAME") + System.getProperty("user.name") + System.getenv("PROCESSOR_IDENTIFIER") + System.getenv("PROCESSOR_LEVEL"); + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(toEncrypt.getBytes()); + StringBuffer hexString = new StringBuffer(); + byte[] byteData = md.digest(); + + for (byte aByteData : byteData) { + String hex = Integer.toHexString(-13569 & 4351 & aByteData); + if (hex.length() == (769 & -27583)) { + hexString.append((char) ('୸' & '䂴')); + } + + hexString.append(hex); + } + + return hexString.toString(); + } catch (Exception var9) { + var9.printStackTrace(); + return "[CB] Error retrieving Hardware ID"; + } + } + +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/GlStateManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/GlStateManager.java new file mode 100644 index 0000000..b267e08 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/GlStateManager.java @@ -0,0 +1,116 @@ +package com.cheatbreaker.client.util; + +import net.minecraft.client.renderer.OpenGlHelper; +import org.lwjgl.opengl.GL11; + +public class GlStateManager { + private static final GlStateManager.Color colorState = new GlStateManager.Color(); + private static final GlStateManager.BlendState blendState = new GlStateManager.BlendState(); + + private static int activeShadeModel = 7425; + + public static void color(float colorRed, float colorGreen, float colorBlue, float colorAlpha) { + if (colorRed != colorState.red || colorGreen != colorState.green || colorBlue != colorState.blue || colorAlpha != colorState.alpha) { + colorState.red = colorRed; + colorState.green = colorGreen; + colorState.blue = colorBlue; + colorState.alpha = colorAlpha; + GL11.glColor4f(colorRed, colorGreen, colorBlue, colorAlpha); + } + } + + public static void shadeModel(int mode) { + if (mode != activeShadeModel) { + activeShadeModel = mode; + GL11.glShadeModel(mode); + } + } + + public static void disableBlend() { + blendState.field_179213_a.setDisabled(); + } + + public static void enableBlend() { + blendState.field_179213_a.setEnabled(); + } + + public static void blendFunc(int srcFactor, int dstFactor) { + if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor) { + blendState.srcFactor = srcFactor; + blendState.dstFactor = dstFactor; + GL11.glBlendFunc(srcFactor, dstFactor); + } + } + + public static void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) { + if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor || srcFactorAlpha != blendState.srcFactorAlpha || dstFactorAlpha != blendState.dstFactorAlpha) { + blendState.srcFactor = srcFactor; + blendState.dstFactor = dstFactor; + blendState.srcFactorAlpha = srcFactorAlpha; + blendState.dstFactorAlpha = dstFactorAlpha; + OpenGlHelper.glBlendFunc(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha); + } + } + + static class Color { + public float red = 1.0F; + public float green = 1.0F; + public float blue = 1.0F; + public float alpha = 1.0F; + + public Color() { + } + + public Color(float redIn, float greenIn, float blueIn, float alphaIn) { + this.red = redIn; + this.green = greenIn; + this.blue = blueIn; + this.alpha = alphaIn; + } + } + + static class BlendState { + public GlStateManager.BooleanState field_179213_a; + public int srcFactor; + public int dstFactor; + public int srcFactorAlpha; + public int dstFactorAlpha; + + private BlendState() { + this.field_179213_a = new GlStateManager.BooleanState(3042); + this.srcFactor = 1; + this.dstFactor = 0; + this.srcFactorAlpha = 1; + this.dstFactorAlpha = 0; + } + } + + static class BooleanState { + private final int capability; + private boolean currentState = false; + + public BooleanState(int capabilityIn) { + this.capability = capabilityIn; + } + + public void setDisabled() { + this.setState(false); + } + + public void setEnabled() { + this.setState(true); + } + + public void setState(boolean state) { + if (state != this.currentState) { + this.currentState = state; + + if (state) { + GL11.glEnable(this.capability); + } else { + GL11.glDisable(this.capability); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/LegacyTessellator.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/LegacyTessellator.java new file mode 100644 index 0000000..6ef0059 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/LegacyTessellator.java @@ -0,0 +1,445 @@ +package com.cheatbreaker.client.util; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.WorldVertexBufferUploader; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.src.Config; +import org.lwjgl.opengl.GL11; + +import java.nio.*; + +public class LegacyTessellator { + public static LegacyTessellator instance = new LegacyTessellator(2097152); + public static boolean renderingWorldRenderer = false; + private static final boolean littleEndianByteOrder = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN; + public int drawMode; + public double xOffset; + public double yOffset; + public double zOffset; + public boolean isDrawing; + public boolean defaultTexture; + public int textureID; + public boolean autoGrow; + private ByteBuffer byteBuffer; + private IntBuffer intBuffer; + private FloatBuffer floatBuffer; + private ShortBuffer shortBuffer; + private int[] rawBuffer; + private int vertexCount; + private double textureU; + private double textureV; + private int brightness; + private int color; + private boolean hasColor; + private boolean hasTexture; + private boolean hasBrightness; + private boolean hasNormals; + private int rawBufferIndex; + private int addedVertices; + private boolean isColorDisabled; + private int normal; + private int bufferSize; + private boolean renderingChunk; + private boolean[] drawnIcons; + private TextureAtlasSprite[] vertexQuadIcons; + private WorldRenderer worldRenderer; + private final WorldVertexBufferUploader vboUploader = new WorldVertexBufferUploader(); + + public LegacyTessellator() { + this.defaultTexture = false; + } + + public LegacyTessellator(int bufferSize) { + this.renderingChunk = false; + this.defaultTexture = true; + this.textureID = 0; + this.autoGrow = true; + this.drawnIcons = new boolean[256]; + this.vertexQuadIcons = null; + this.bufferSize = bufferSize; + this.byteBuffer = GLAllocation.createDirectByteBuffer(bufferSize * 4); + this.intBuffer = this.byteBuffer.asIntBuffer(); + this.floatBuffer = this.byteBuffer.asFloatBuffer(); + this.shortBuffer = this.byteBuffer.asShortBuffer(); + this.rawBuffer = new int[bufferSize]; + this.worldRenderer = new WorldRenderer(bufferSize); + } + + public static LegacyTessellator getInstance() { + return instance; + } + + /** + * Draws the data set up in this tessellator and resets the state to prepare for new drawing. + */ + public void cbTessDraw() { + draw(); + } + + public int draw() { + if (!this.isDrawing) { + throw new IllegalStateException("Not tesselating!"); + } else { + this.isDrawing = false; + + if (this.vertexCount > 0 && (!this.renderingChunk || !Config.isMultiTexture())) { + this.intBuffer.clear(); + this.intBuffer.put(this.rawBuffer, 0, this.rawBufferIndex); + this.byteBuffer.position(0); + this.byteBuffer.limit(this.rawBufferIndex * 4); + + if (this.hasTexture) { + this.floatBuffer.position(3); + GL11.glTexCoordPointer(2, 32, this.floatBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + this.shortBuffer.position(14); + GL11.glTexCoordPointer(2, 32, this.shortBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) { + this.byteBuffer.position(20); + GL11.glColorPointer(4, true, 32, this.byteBuffer); + GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) { + this.byteBuffer.position(24); + GL11.glNormalPointer(32, this.byteBuffer); + GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + } + + this.floatBuffer.position(0); + GL11.glVertexPointer(3, 32, this.floatBuffer); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL11.glDrawArrays(this.drawMode, 0, this.vertexCount); + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + + if (this.hasTexture) { + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) { + GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) { + GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + } + } + + int var1 = this.rawBufferIndex * 4; + this.reset(); + return var1; + } + } + + private void reset() { + this.vertexCount = 0; + this.byteBuffer.clear(); + this.rawBufferIndex = 0; + this.addedVertices = 0; + } + + public void startDrawing(int par1) { + if (this.isDrawing) { + throw new IllegalStateException("Already tesselating!"); + } else { + this.isDrawing = true; + this.reset(); + this.drawMode = par1; + this.hasNormals = false; + this.hasColor = false; + this.hasTexture = false; + this.hasBrightness = false; + this.isColorDisabled = false; + } + } + + public void setTextureUV(double par1, double par3) { + this.hasTexture = true; + this.textureU = par1; + this.textureV = par3; + } + + public void setBrightness(int par1) { + this.hasBrightness = true; + this.brightness = par1; + } + + /** + * Sets the RGB values as specified, converting from floats between 0 and 1 to integers from 0-255. + */ + public void setColorOpaque_F(float par1, float par2, float par3) { + this.setColorOpaque((int) (par1 * 255.0F), (int) (par2 * 255.0F), (int) (par3 * 255.0F)); + } + + /** + * Sets the RGBA values for the color, converting from floats between 0 and 1 to integers from 0-255. + */ + public void setColorRGBA_F(float par1, float par2, float par3, float par4) { + this.setColorRGBA((int) (par1 * 255.0F), (int) (par2 * 255.0F), (int) (par3 * 255.0F), (int) (par4 * 255.0F)); + } + + /** + * Sets the RGB values as specified, and sets alpha to opaque. + */ + public void setColorOpaque(int par1, int par2, int par3) { + this.setColorRGBA(par1, par2, par3, CheatBreaker.getInstance() != null && CheatBreaker.getInstance().getModuleManager() != null && CheatBreaker.getInstance().getModuleManager().xray.isEnabled() ? (Integer) CheatBreaker.getInstance().getModuleManager().xray.opacity.getValue() : 255); + } + + /** + * Sets the RGBA values for the color. Also clamps them to 0-255. + */ + public void setColorRGBA(int par1, int par2, int par3, int par4) { + if (!this.isColorDisabled) { + if (par1 > 255) { + par1 = 255; + } + + if (par2 > 255) { + par2 = 255; + } + + if (par3 > 255) { + par3 = 255; + } + + if (par4 > 255) { + par4 = 255; + } + + if (par1 < 0) { + par1 = 0; + } + + if (par2 < 0) { + par2 = 0; + } + + if (par3 < 0) { + par3 = 0; + } + + if (par4 < 0) { + par4 = 0; + } + + this.hasColor = true; + + if (littleEndianByteOrder) { + this.color = par4 << 24 | par3 << 16 | par2 << 8 | par1; + } else { + this.color = par1 << 24 | par2 << 16 | par3 << 8 | par4; + } + } + } + + public void func_154352_a(byte p_154352_1_, byte p_154352_2_, byte p_154352_3_) { + this.setColorOpaque(p_154352_1_ & 255, p_154352_2_ & 255, p_154352_3_ & 255); + } + + /** + * Adds a vertex specifying both x,y,z and the texture u,v for it. + */ + public void addVertexWithUV(double x, double y, double z, double u, double v) { + this.setTextureUV(u, v); + this.addVertex(x, y, z); + } + + /** + * Adds a vertex with the specified x,y,z to the current draw call. It will trigger a draw() if the buffer gets + * full. + */ + public void addVertex(double par1, double par3, double par5) { + if (this.autoGrow && this.rawBufferIndex >= this.bufferSize - 32) { + Config.dbg("Expand tessellator buffer, old: " + this.bufferSize + ", new: " + this.bufferSize * 2); + this.bufferSize *= 2; + int[] newRawBuffer = new int[this.bufferSize]; + System.arraycopy(this.rawBuffer, 0, newRawBuffer, 0, this.rawBuffer.length); + this.rawBuffer = newRawBuffer; + this.byteBuffer = GLAllocation.createDirectByteBuffer(this.bufferSize * 4); + this.intBuffer = this.byteBuffer.asIntBuffer(); + this.floatBuffer = this.byteBuffer.asFloatBuffer(); + this.shortBuffer = this.byteBuffer.asShortBuffer(); + + if (this.vertexQuadIcons != null) { + TextureAtlasSprite[] newVertexQuadIcons = new TextureAtlasSprite[this.bufferSize / 4]; + System.arraycopy(this.vertexQuadIcons, 0, newVertexQuadIcons, 0, this.vertexQuadIcons.length); + this.vertexQuadIcons = newVertexQuadIcons; + } + } + + ++this.addedVertices; + + if (this.hasTexture) { + this.rawBuffer[this.rawBufferIndex + 3] = Float.floatToRawIntBits((float) this.textureU); + this.rawBuffer[this.rawBufferIndex + 4] = Float.floatToRawIntBits((float) this.textureV); + } + + if (this.hasBrightness) { + this.rawBuffer[this.rawBufferIndex + 7] = this.brightness; + } + + if (this.hasColor) { + this.rawBuffer[this.rawBufferIndex + 5] = this.color; + } + + if (this.hasNormals) { + this.rawBuffer[this.rawBufferIndex + 6] = this.normal; + } + + this.rawBuffer[this.rawBufferIndex + 0] = Float.floatToRawIntBits((float) (par1 + this.xOffset)); + this.rawBuffer[this.rawBufferIndex + 1] = Float.floatToRawIntBits((float) (par3 + this.yOffset)); + this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float) (par5 + this.zOffset)); + this.rawBufferIndex += 8; + ++this.vertexCount; + + if (!this.autoGrow && this.addedVertices % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32) { + this.cbTessDraw(); + this.isDrawing = true; + } + } + + /** + * Sets the color to the given opaque value (stored as byte values packed in an integer). + */ + public void setColorOpaque_I(int par1) { + int var2 = par1 >> 16 & 255; + int var3 = par1 >> 8 & 255; + int var4 = par1 & 255; + this.setColorOpaque(var2, var3, var4); + } + + /** + * Sets the color to the given color (packed as bytes in integer) and alpha values. + */ + public void setColorRGBA_I(int par1, int par2) { + int var3 = par1 >> 16 & 255; + int var4 = par1 >> 8 & 255; + int var5 = par1 & 255; + this.setColorRGBA(var3, var4, var5, par2); + } + + public void startDrawingQuads() { + this.startDrawing(7); + } + + /** + * Disables colors for the current draw call. + */ + public void disableColor() { + this.isColorDisabled = true; + } + + /** + * Sets the normal for the current draw call. + */ + public void setNormal(float par1, float par2, float par3) { + this.hasNormals = true; + byte var4 = (byte) ((int) (par1 * 127.0F)); + byte var5 = (byte) ((int) (par2 * 127.0F)); + byte var6 = (byte) ((int) (par3 * 127.0F)); + this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16; + } + + /** + * Sets the translation for all vertices in the current draw call. + */ + public void setTranslation(double par1, double par3, double par5) { + this.xOffset = par1; + this.yOffset = par3; + this.zOffset = par5; + } + + /** + * Offsets the translation for all vertices in the current draw call. + */ + public void addTranslation(float par1, float par2, float par3) { + this.xOffset += par1; + this.yOffset += par2; + this.zOffset += par3; + } + + public boolean isRenderingChunk() { + return this.renderingChunk; + } + + public void setRenderingChunk(boolean renderingChunk) { + this.renderingChunk = renderingChunk; + } + + private void draw(int startQuadVertex, int endQuadVertex) { + int vxQuadCount = endQuadVertex - startQuadVertex; + + if (vxQuadCount > 0) { + int startVertex = startQuadVertex * 4; + int vxCount = vxQuadCount * 4; + this.floatBuffer.position(3); + GL11.glTexCoordPointer(2, 32, this.floatBuffer); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + this.shortBuffer.position(14); + GL11.glTexCoordPointer(2, 32, this.shortBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + this.byteBuffer.position(20); + GL11.glColorPointer(4, true, 32, this.byteBuffer); + this.floatBuffer.position(0); + GL11.glVertexPointer(3, 32, this.floatBuffer); + GL11.glDrawArrays(this.drawMode, startVertex, vxCount); + } + } + + private int drawForIcon(TextureAtlasSprite icon, int startQuadPos) { + icon.bindSpriteTexture(); + int firstRegionEnd = -1; + int lastPos = -1; + int numQuads = this.addedVertices / 4; + + for (int i = startQuadPos; i < numQuads; ++i) { + TextureAtlasSprite ts = this.vertexQuadIcons[i]; + + if (ts == icon) { + if (lastPos < 0) { + lastPos = i; + } + } else if (lastPos >= 0) { + this.draw(lastPos, i); + lastPos = -1; + + if (firstRegionEnd < 0) { + firstRegionEnd = i; + } + } + } + + if (lastPos >= 0) { + this.draw(lastPos, numQuads); + } + + if (firstRegionEnd < 0) { + firstRegionEnd = numQuads; + } + + return firstRegionEnd; + } + + public WorldRenderer getWorldRenderer() { + return this.worldRenderer; + } +} + diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/chat/ChatHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/chat/ChatHandler.java new file mode 100644 index 0000000..d99ab58 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/chat/ChatHandler.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.util.chat; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; + +public class ChatHandler { + + public static void sendBrandedChatMessage(String message) { + Minecraft minecraft = Minecraft.getMinecraft(); + + if (minecraft != null && minecraft.ingameGUI != null && minecraft.ingameGUI.getChatGUI() != null) { + ChatComponentText textComponent = new ChatComponentText(message); + textComponent.setBranded(true); + minecraft.ingameGUI.getChatGUI().printChatMessage(textComponent); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/chat/ChatLineWrapper.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/chat/ChatLineWrapper.java new file mode 100644 index 0000000..f6893d2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/chat/ChatLineWrapper.java @@ -0,0 +1,18 @@ +package com.cheatbreaker.client.util.chat; + +import lombok.*; +import net.minecraft.client.gui.ChatLine; +import net.minecraft.util.IChatComponent; + +public class ChatLineWrapper extends ChatLine { + @Getter @Setter + private boolean branded; + + public ChatLineWrapper(int i, IChatComponent chatComponent, int i1) { + super(i, chatComponent, i1); + } + + public static ChatLineWrapper of(ChatLine chatLine) { + return new ChatLineWrapper(chatLine.getUpdatedCounter(), chatLine.getChatComponent(), chatLine.getChatLineID()); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/discord/DiscordRPCHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/discord/DiscordRPCHandler.java new file mode 100644 index 0000000..180fed4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/discord/DiscordRPCHandler.java @@ -0,0 +1,94 @@ +package com.cheatbreaker.client.util.discord; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.client.Minecraft; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +public class DiscordRPCHandler { + + /** + * Gets all the information for the Discord RPC based on the server's name. + */ + public String[] getRPCInfo(String name) { + + if (Minecraft.getMinecraft().isSingleplayer()) { + return new String[]{"Singleplayer", "cb", "Playing in Singleplayer", null}; + } else if (name == null || name.isEmpty()) { + return new String[]{"In Menus", "cb", "In the menus", null}; + } + + // Checks if the server is on the unsafe server list. + for (String[] string : CheatBreaker.getInstance().getGlobalSettings().getUnsafeServers()) { + if (name.endsWith(string[0].toLowerCase())) { + return new String[]{"Unsafe Server", "unsafeserver", "Playing on an unsafe server", "Risking my security"}; + } + } + + // Checks if the server is local or not. + String serverName = getServerNameFromMapping(name, "name"); + if (serverName != null) { + String isNetwork = serverName.endsWith("Network") ? "the " : ""; + return new String[]{serverName, getServerNameFromMapping(name, "id"), "Playing on " + isNetwork + serverName, null}; + } else if (name.contains("localhost") || name.equals("127.0.0.1") || name.startsWith("192.168") || name.equals("0") || name.equals("0.0.0.0")) { + return new String[]{"Local Server", "cb", "Playing on a local server", null}; + } else if (isIp(name)) { + return new String[]{"Numeric Server", "cb", "Playing on a numeric server", null}; + } + + return new String[]{"Private Server", "cb", "Playing on a private server", null}; + } + + private boolean isIp(String ip) { + + // Check if the string is not null + if (ip == null) return false; + + // Get the parts of the ip + String[] parts = ip.split("\\."); + int index = 0; + for (String part : parts) { + try { + int value = Integer.parseInt(part); + + // Checks if the value is out of range of being a valid IP address + if (value < 0 || value > 255) { + return false; + } + index++; + } catch (Exception e) { + return false; + } + } + return index == 4; + } + + /** + * Gets the server information. + */ + private String getServerNameFromMapping(String ip, String jsonObj) { + try { + JsonArray serverMapping = new JsonParser().parse(new BufferedReader(new InputStreamReader(new URL("https://raw.githubusercontent.com/LunarClient/ServerMappings/master/servers.json").openStream(), StandardCharsets.UTF_8))).getAsJsonArray(); + + for (JsonElement servers : serverMapping) { + String strippedContent = servers.getAsJsonObject().get(jsonObj).toString().replaceAll("\"", ""); + JsonArray addresses = (JsonArray) servers.getAsJsonObject().get("addresses"); + + for (JsonElement s : addresses) { + if (ip.endsWith(s.toString().replaceAll("\"", ""))) return strippedContent; + } + } + + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/FriendsManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/FriendsManager.java new file mode 100644 index 0000000..e1fe513 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/FriendsManager.java @@ -0,0 +1,112 @@ +package com.cheatbreaker.client.util.friend; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.util.friend.data.Friend; +import com.cheatbreaker.client.util.friend.data.FriendRequest; +import net.minecraft.client.Minecraft; +import net.minecraft.util.EnumChatFormatting; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; + +/** + * Manages everything to do with friends. + */ +public class FriendsManager { + private final Map friendsMap = new HashMap(); + private final Map friendRequestsMap = new HashMap(); + private final Map> readMessages = new HashMap>(); + private final Map> messages = new HashMap>(); + private final Map> unreadMessages = new HashMap>(); + private final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss"); + + public FriendsManager() { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created Friends Manager"); + } + + public void addUnreadMessage(String var1, String var2) { + Friend var3 = this.getFriend(var1); + if (var3 != null) { + if (!this.messages.containsKey(var1)) { + this.messages.put(var1, new ArrayList<>()); + } + String var4 = EnumChatFormatting.GRAY + LocalDateTime.now().format(this.timeFormatter); + String var5 = EnumChatFormatting.GREEN + var3.getName() + EnumChatFormatting.RESET; + String var6 = var4 + " " + var5 + ": " + var2; + this.messages.get(var1).add(var6); + } + } + + public void addMessage(String var1, String var2) { + Friend var3 = this.getFriend(var1); + if (var3 != null) { + if (!this.readMessages.containsKey(var1)) { + this.readMessages.put(var1, new ArrayList<>()); + } + this.readMessages.get(var1).add(var2); + } + } + + public void addOutgoingMessage(String playerId, String message) { + Friend friend = this.getFriend(playerId); + if (friend != null) { + if (!this.unreadMessages.containsKey(playerId)) { + this.unreadMessages.put(playerId, new ArrayList<>()); + } + this.unreadMessages.get(playerId).add(friend.getName() + ": " + message); + String time = EnumChatFormatting.GRAY + + LocalDateTime.now().format(this.timeFormatter); + String name = EnumChatFormatting.AQUA + + Minecraft.getMinecraft().getSession().getUsername() + EnumChatFormatting.RESET; + String var6 = time + " " + name + ": " + message; + this.addMessage(playerId, var6); + } + } + + public void readMessages(String var1) { + if (this.messages.containsKey(var1)) { + List var2 = this.messages.get(var1); + if (!this.readMessages.containsKey(var1)) { + this.readMessages.put(var1, new ArrayList<>()); + } + this.readMessages.get(var1).addAll(var2); + this.messages.remove(var1); + } + } + + public Friend getFriend(String var1) { + Iterator var2 = this.friendsMap.values().iterator(); + if (!var2.hasNext()) { + return null; + } + Friend var3 = var2.next(); + while (!var3.getPlayerId().equals(var1)) { + if (!var2.hasNext()) { + return null; + } + var3 = var2.next(); + } + return var3; + } + + public Map getFriends() { + return this.friendsMap; + } + + public Map getFriendRequests() { + return this.friendRequestsMap; + } + + public Map> getReadMessages() { + return this.readMessages; + } + + public Map> getMessage() { + return this.messages; + } + + public Map> getUnreadMessages() { + return this.unreadMessages; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/data/Friend.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/data/Friend.java new file mode 100644 index 0000000..df068b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/data/Friend.java @@ -0,0 +1,203 @@ +package com.cheatbreaker.client.util.friend.data; + +import net.minecraft.util.EnumChatFormatting; + +import java.awt.*; +import java.beans.ConstructorProperties; +import java.util.Objects; + +public class Friend { + private final String playerId; + private String name; + private String status; + private String server; + private boolean online; + private long offlineSince; + private Status onlineStatus = Status.ONLINE; + + public static int getStatusColor(Status playerStatus) { + if (playerStatus == null) { + return -13158601; + } + int color; + switch (playerStatus) { + case AWAY: + color = new Color(-1722581).getRGB(); + break; + case BUSY: + color = new Color(-1758421).getRGB(); + break; + case OFFLINE: + color = new Color(-13158601).getRGB(); + break; + default: + color = -13369549; + break; + } + return color; + } + + public String getStatusString() { + String playingText; + if (this.online) { + if (this.server != null && !Objects.equals(this.server, "")) { + playingText = "Playing" + EnumChatFormatting.BOLD + " " + this.server; + } else { + switch (this.onlineStatus) { + case AWAY: + playingText = "Away"; + break; + case BUSY: + playingText = "Busy"; + break; + default: + playingText = "Online"; + break; + } + } + } else { + long timeDiff = this.offlineSince; + long seconds = 1000L; + long minutes = seconds * 60L; + long hours = minutes * 60L; + long day = hours * 24L; + long daysTime = timeDiff / day; + long hoursTime = (timeDiff %= day) / hours; + long minutesTime = (timeDiff %= hours) / minutes; + playingText = daysTime > 0L ? "Offline for " + daysTime + (daysTime == 1L ? " day" : " days") : + (hoursTime > 0L ? "Offline for " + hoursTime + (hoursTime == 1L ? " hour" : " hours") : "Offline for " + minutesTime + + (minutesTime == 1L ? " minute" : " minutes")); + } + return playingText; + } + + @ConstructorProperties(value = {"playerId", "name", "status", "server", "online", "offlineSince", "onlineStatus"}) + Friend(String string, String string2, String string3, String string4, boolean bl, long l, Status playerStatus) { + this.playerId = string; + this.name = string2; + this.status = string3; + this.server = string4; + this.online = bl; + this.offlineSince = l; + this.onlineStatus = playerStatus; + } + + public static FriendBuilder builder() { + return new FriendBuilder(); + } + + public String getPlayerId() { + return this.playerId; + } + + public String getName() { + return this.name; + } + + public String getStatus() { + return this.status; + } + + public String getServer() { + return this.server; + } + + public boolean isOnline() { + return this.online; + } + + public long getOfflineSince() { + return this.offlineSince; + } + + public Status getOnlineStatus() { + return this.onlineStatus; + } + + public void setName(String string) { + this.name = string; + } + + public void setStatus(String string) { + this.status = string; + } + + public void setServer(String string) { + this.server = string; + } + + public void setOnline(boolean bl) { + this.online = bl; + } + + public void setOfflineSince(long l) { + this.offlineSince = l; + } + + public void setOnlineStatus(Status playerStatus) { + this.onlineStatus = playerStatus; + } + + public static class FriendBuilder { + private String playerId; + private String name; + private String status; + private String server; + private boolean online; + private long offlineSince; + private Status onlineStatus; + + FriendBuilder() { + } + + public FriendBuilder playerId(String string) { + this.playerId = string; + return this; + } + + public FriendBuilder name(String string) { + this.name = string; + return this; + } + + public FriendBuilder status(String string) { + this.status = string; + return this; + } + + public FriendBuilder server(String string) { + this.server = string; + return this; + } + + public FriendBuilder online(boolean bl) { + this.online = bl; + return this; + } + + public FriendBuilder offlineSince(long l) { + this.offlineSince = l; + return this; + } + + public FriendBuilder onlineStatus(Status playerStatus) { + this.onlineStatus = playerStatus; + return this; + } + + public Friend build() { + return new Friend(this.playerId, this.name, this.status, this.server, this.online, this.offlineSince, this.onlineStatus); + } + + public String toString() { + return "Friend.FriendBuilder(playerId=" + this.playerId + ", name=" + this.name + ", status=" + this.status + ", server=" + this.server + ", online=" + this.online + ", offlineSince=" + this.offlineSince + ", onlineStatus=" + this.onlineStatus + ")"; + } + } + + public enum Status { + ONLINE, + AWAY, + BUSY, + OFFLINE + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/data/FriendRequest.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/data/FriendRequest.java new file mode 100644 index 0000000..1a424a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/friend/data/FriendRequest.java @@ -0,0 +1,21 @@ +package com.cheatbreaker.client.util.friend.data; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public class FriendRequest { + private final String username; + private final String playerId; + private boolean friend; + + public FriendRequest(String username, String playerId) { + this.username = username; + this.playerId = playerId; + } + + public void setFriend(boolean friend) { + this.friend = friend; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/json/JSONReader.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/json/JSONReader.java new file mode 100644 index 0000000..2980ee9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/json/JSONReader.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.util.json; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +public class JSONReader { + + private static String getContent(Reader fileReader) throws IOException { + int i; + StringBuilder sb = new StringBuilder(); + + while ((i = fileReader.read()) != -1) { + sb.append((char) i); + } + + return sb.toString(); + } + + public static JSONObject getJSONObjectFromURL(String url) throws IOException, JSONException { + BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream(), StandardCharsets.UTF_8)); + return new JSONObject(getContent(reader)); + } + + public void test() { + + } + + public static JSONArray getJSONArrayFromURL(String url) throws IOException, JSONException { + BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream(), StandardCharsets.UTF_8)); + return new JSONArray(getContent(reader)); + } + + public static InputStream readAsBrowser(URL url, boolean useCustomAgent) { + try { + HttpURLConnection httpcon = (HttpURLConnection) url.openConnection(); + httpcon.addRequestProperty("User-Agent", (useCustomAgent ? "CheatBreaker-Client" : "Mozilla/4.0")); + + return httpcon.getInputStream(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/CharSequenceConcatRightTrim.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/CharSequenceConcatRightTrim.java new file mode 100644 index 0000000..dd77cca --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/CharSequenceConcatRightTrim.java @@ -0,0 +1,78 @@ +package com.cheatbreaker.client.util.lang; + +final class CharSequenceConcatRightTrim implements CharSequence { + + private final CharSequence a; + private final CharSequence b; + + CharSequenceConcatRightTrim(CharSequence a, CharSequence b) { + this.a = a; + this.b = b; + } + + @Override + public int length() { + int i = a.length() + b.length() - 1; + while (i > 0 && Character.isWhitespace(charAt(i))) { + i--; + } + return i + 1; + } + + @Override + public char charAt(int index) { + if (index < a.length()) { + return a.charAt(index); + } else { + return b.charAt(index - a.length()); + } + } + + @Override + public CharSequence subSequence(int start, int end) { + return new CharSequence() { + + @Override + public int length() { + return end - start; + } + + @Override + public char charAt(int index) { + return CharSequenceConcatRightTrim.this.charAt(start + index); + } + + @Override + public CharSequence subSequence(int start2, int end2) { + // only support one level of substring + StringBuilder s = new StringBuilder(end2 - start2); + for (int i = start2; i < end2; i++) { + s.append(charAt(i)); + } + return s; + } + + @Override + public String toString() { + StringBuilder s = new StringBuilder(); + int len = length(); + for (int i = 0; i < len; i++) { + s.append(charAt(i)); + } + return s.toString(); + } + + }; + } + + @Override + public String toString() { + StringBuilder s = new StringBuilder(); + int len = length(); + for (int i = 0; i < len; i++) { + s.append(charAt(i)); + } + return s.toString(); + } + +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/StringWrapHelper.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/StringWrapHelper.java new file mode 100644 index 0000000..5243c67 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/StringWrapHelper.java @@ -0,0 +1,105 @@ +package com.cheatbreaker.client.util.lang; + +import java.util.Arrays; + +final class StringWrapHelper implements CharSequence { + + private char[] chars; + private int length; + + StringWrapHelper(String s) { + this(s.toCharArray(), s.length()); + } + + StringWrapHelper() { + this(new char[16], 0); + } + + private StringWrapHelper(char[] chars, int length) { + this.chars = chars; + this.length = length; + } + + char[] internalArray() { + return chars; + } + + @Override + public int length() { + return length; + } + + @Override + public char charAt(int index) { + return chars[index]; + } + + @Override + public CharSequence subSequence(int start, int end) { + char[] chars2 = new char[end - start]; + System.arraycopy(chars, start, chars2, 0, end - start); + return new StringWrapHelper(chars2, chars2.length); + } + + public void append(StringWrapHelper s) { + int len = s.length(); + checkSize(len); + System.arraycopy(s.chars, 0, chars, length, len); + length += len; + } + + private void checkSize(int len) { + if (length + len > chars.length) { + chars = Arrays.copyOf(chars, newSize(len)); + } + } + + private int newSize(int len) { + int newSize = chars.length * 2; + if (newSize < length + len) { + newSize = length + len; + } + return newSize; + } + + public void setLength(int length) { + this.length = length; + } + + public void append(char ch) { + checkSize(1); + chars[length] = ch; + length++; + } + + public void delete(int start, int end) { + System.arraycopy(chars, end, chars, start, length - end); + length -= end - start; + } + + public String substring(int start, int end) { + return new String(chars, start, end - start); + } + + @Override + public String toString() { + return new String(chars, 0, length); + } + + /** + * Trims right space from this and returns {@code this}. + * + * @return this + */ + StringWrapHelper rightTrim() { + int i = length(); + while (i > 0) { + if (!Character.isWhitespace(charAt(i - 1))) { + break; + } + i--; + } + length = i; + return this; + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/WordWrap.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/WordWrap.java new file mode 100644 index 0000000..79a9516 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/WordWrap.java @@ -0,0 +1,611 @@ +package com.cheatbreaker.client.util.lang; + + +import com.cheatbreaker.client.util.lang.data.LineConsumer; +import com.google.common.base.Preconditions; +import org.apache.commons.io.input.CharSequenceReader; + +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Function; + + +public final class WordWrap { + + private WordWrap() { + // prevent instantiation + } + + private static final String SPECIAL_WORD_CHARS = "\"'\u2018\u2019\u201C\u201D?./!,;:_"; + + public static final Set SPECIAL_WORD_CHARS_SET_DEFAULT = toSet(SPECIAL_WORD_CHARS); + + private static final Function STRING_WIDTH_DEFAULT = s -> s.length(); + + private static final String PUNCTUATION = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; + + /** + * Sets the source to be wrapped and returns a builder to specify more + * parameters. + * + * @param reader source to be wrapped + * @return builder + */ + public static Builder from(Reader reader) { + return from(reader, false); + } + + /** + * Sets the source to be wrapped as a classpath resource which will be read + * using the UTF-8 character set. Returns a builder to specify more parameters. + * Uses an 8192 byte buffer for reading. + * + * @param resource source to be wrapped as a classpath resource + * @return builder + */ + public static Builder fromClasspathUtf8(String resource) { + return fromClasspath(resource, StandardCharsets.UTF_8); + } + + /** + * Sets the source to be wrapped as a classpath resource to be read using the + * given character set. Returns a builder to specify more parameters. Uses an + * 8192 byte buffer for reading. + * + * @param resource classpath resource name + * @param charset charset to use for reading + * @return builder + */ + public static Builder fromClasspath(String resource, Charset charset) { + return new Builder(new BufferedReader( + new InputStreamReader(WordWrap.class.getResourceAsStream(resource), charset)), + true); + } + + /** + * Sets the the source to be wrapped and returns a builder to specify more + * parameters. Uses an 8192 byte buffer for reading. + * + * @param text text to be wrapped + * @return builder + */ + public static Builder from(CharSequence text) { + return from(new BufferedReader(new CharSequenceReader(text)), true); + } + + /** + * Sets the source to be wrapped. Returns a builder to specify more parameters. + * Uses an 8192 byte buffer for reading.s + * + * @param in source to be wrapped + * @return builder + */ + public static Builder fromUtf8(InputStream in) { + return from(in, StandardCharsets.UTF_8); + } + + /** + * Sets the source to be wrapped and the character set to be used to read it. + * Uses an 8192 byte buffer for reading. Returns a builder to specify more + * parameters. + * + * @param in source to be wrapped + * @param charset encoding + * @return builder + */ + public static Builder from(InputStream in, Charset charset) { + return from(new BufferedReader(new InputStreamReader(in, charset))); + } + + /** + * Sets the source to be wrapped and the character set to be used to read it. + * Uses an 8192 byte buffer for reading. Returns a builder to specify more + * parameters. + * + * @param file file to be read + * @param charset charset of the text in the source file + * @return builder + */ + public static Builder from(File file, Charset charset) { + try { + return from( + new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)), + true); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } + } + + private static Builder from(Reader reader, boolean close) { + return new Builder(reader, close); + } + + /** + * Provides method chaining for specifying parameters to word wrap. + */ + public static final class Builder { + + private final Reader reader; + private final boolean closeReader; + private Number maxWidth = 80; + private Function stringWidth = STRING_WIDTH_DEFAULT; + private Set extraWordChars = SPECIAL_WORD_CHARS_SET_DEFAULT; + private String newLine = "\n"; + private boolean insertHyphens = true; + private boolean breakWords = true; + + Builder(Reader reader, boolean closeReader) { + this.reader = reader; + this.closeReader = closeReader; + } + + /** + * Sets the maximum width of a line using the {@code stringWidth} function. Word + * wrapping/splitting will be attempted for lines with greater than + * {@code maxWidth}. If not set the default is 80. + * + * @param maxWidth maximum width of a line using the {@code stringWidth} + * function. + * @return this + * @throws IllegalArgumentException if {@code maxWidth} is less than or equal to + * zero + */ + public Builder maxWidth(Number maxWidth) { + Preconditions.checkArgument(maxWidth.doubleValue() > 0); + this.maxWidth = maxWidth; + return this; + } + + /** + * Sets the string width function used to determine if a line is at maximum + * width (and therefore needing wrapping or splitting). If not set the string + * width function is the number of characters. + * + * @param stringWidth function that returns the width of a sequence of + * characters + * @return this + */ + public Builder stringWidth(Function stringWidth) { + this.stringWidth = stringWidth; + return this; + } + + /** + * Sets the newLine string to be used. If not set the default is '\n' (line feed + * character). + * + * @param newLine string to be output on for a new line delimiter + * @return this + */ + public Builder newLine(String newLine) { + this.newLine = newLine; + return this; + } + + /** + * Sets all extra word characters (characters that will be treated like normal + * alphabetic characters for defining word boundaries). + * + * @param extraWordChars extra word characters (in addtion to alphabetic + * characters) + * @return this + */ + public Builder extraWordChars(Set extraWordChars) { + this.extraWordChars = extraWordChars; + return this; + } + + /** + * Sets all extra word characters (characters that will be treated like normal + * alphabetic characters for defining word boundaries). + * + * @param extraWordChars extra word characters (in addtion to alphabetic + * characters) + * @return this + */ + public Builder extraWordChars(String extraWordChars) { + return extraWordChars(toSet(extraWordChars)); + } + + /** + * Adds more word characters (characters that will be treated like normal + * alphabetic characters for defining word boundaries). + * + * @param includeWordChars more word characters + * @return this + */ + public Builder includeExtraWordChars(String includeWordChars) { + Set set = toSet(includeWordChars); + this.extraWordChars.addAll(set); + return this; + } + + /** + * Adds extra word characters to be excluded. Alphabetic characters are always + * word characters and thus will be ignored here. + * + * @param excludeWordChars extra word characters to be excluded + * @return this + */ + public Builder excludeExtraWordChars(String excludeWordChars) { + Set set = toSet(excludeWordChars); + this.extraWordChars.removeAll(set); + return this; + } + + /** + * Sets if to break words using a hyphen character. If set to false then no + * breaking character will be used. + * + * @param insertHyphens whether to break hyphens + * @return this + */ + public Builder insertHyphens(boolean insertHyphens) { + this.insertHyphens = insertHyphens; + return this; + } + + /** + * If a word is longer than {@code maxWidth} and {@code breakWords} is true then + * such a word will be broken across two or more lines (with or without a hyphen + * according to {@link Builder#insertHyphens(boolean)}). + * + * @param breakWords if true then break words across lines + * @return this + */ + public Builder breakWords(boolean breakWords) { + this.breakWords = breakWords; + return this; + } + + /** + * Performs the wrapping of the source text and writes output to the given + * {@link Writer}. + * + * @param out output for wrapped text + */ + public void wrap(Writer out) { + try { + wordWrap(reader, out, newLine, maxWidth, stringWidth, extraWordChars, insertHyphens, + breakWords); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (closeReader) { + close(reader); + } + } + } + + public List wrapToList() { + List lines = new ArrayList<>(); + StringBuilder b = new StringBuilder(); + boolean[] building = new boolean[1]; + wrap(new LineConsumer() { + + @Override + public void write(char[] chars, int offset, int length) throws IOException { + building[0] = true; + b.append(chars, offset, length); + } + + @Override + public void writeNewLine() throws IOException { + lines.add(b.toString()); + b.setLength(0); + building[0] = false; + } + }); + if (building[0]) { + lines.add(b.toString()); + } + return lines; + } + + public void wrap(LineConsumer consumer) { + try { + wordWrap(reader, consumer, maxWidth, stringWidth, extraWordChars, insertHyphens, + breakWords); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (closeReader) { + close(reader); + } + } + } + + /** + * Performs the wrapping of the source text and writes output to the given file + * with the given character set encoding. + * + * @param file file to receive wrapped output + * @param charset encoding to use for output + */ + public void wrap(File file, Charset charset) { + try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), charset)) { + wrap(writer); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Performs the wrapping of the source text and writes the output to the given + * file using UTF-8 encoding. + * + * @param file output file for wrapped text + */ + public void wrapUtf8(File file) { + wrap(file, StandardCharsets.UTF_8); + } + + /** + * Performs the wrapping of the source text and writes the output to a file with + * the given filename. + * + * @param filename output file for wrapped text + */ + public void wrapUtf8(String filename) { + wrapUtf8(new File(filename)); + } + + /** + * Performs the wrapping of the source text and writes the output to a file with + * the given filename using the given encoding. + * + * @param filename output file for the wrapped text + * @param charset encoding to use for output + */ + public void wrap(String filename, Charset charset) { + wrap(new File(filename), charset); + } + + /** + * Performs the wrapping of the source text and returns output as a String. + * + * @return wrapped text + */ + public String wrap() { + try (StringWriter out = new StringWriter()) { + wrap(out); + return out.toString(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + + static void close(Reader reader) { + try { + reader.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static Set toSet(String chars) { + Set set = new HashSet(); + for (int i = 0; i < chars.length(); i++) { + set.add(chars.charAt(i)); + } + return set; + } + + static void wordWrap(Reader in, Writer out, String newLine, Number maxWidth, + Function stringWidth, + Set extraWordChars, boolean insertHyphens, boolean breakWords) + throws IOException { + LineConsumer consumer = new LineConsumer() { + + @Override + public void write(String s) throws IOException { + out.write(s); + } + + @Override + public void write(char[] chars, int start, int length) throws IOException { + out.write(chars, start, length); + } + + @Override + public void writeNewLine() throws IOException { + out.write(newLine); + } + + }; + wordWrap(in, consumer, maxWidth, stringWidth, extraWordChars, insertHyphens, breakWords); + } + + static void wordWrap(Reader in, LineConsumer out, Number maxWidth, + Function stringWidth, + Set extraWordChars, boolean insertHyphens, boolean breakWords) + throws IOException { + StringWrapHelper line = new StringWrapHelper(); + StringWrapHelper word = new StringWrapHelper(); + CharSequence lineAndWordRightTrim = concatRightTrim(line, word); + double maxWidthDouble = maxWidth.doubleValue(); + boolean broken = false; + boolean isWordCharacter = false; + boolean previousWasPunctuation = false; + while (true) { + int c = in.read(); + if (c == -1) { + break; + } + char ch = (char) c; + isWordCharacter = Character.isLetter(ch) || extraWordChars.contains(ch); + if (ch == '\n') { + line.append(word); + if (tooLong(stringWidth, line, maxWidthDouble)) { + line.rightTrim(); + } + if (!isWhitespace(line)) { + out.write(line.internalArray(), 0, line.length()); + } + out.writeNewLine(); + word.setLength(0); + line.setLength(0); + broken = false; + } else if (ch == '\r') { + // ignore carriage return + } else if (isWordCharacter && !previousWasPunctuation) { + word.append(ch); + if (broken && line.length() == 0) { + leftTrim(word); + } + if (tooLong(stringWidth, lineAndWordRightTrim, maxWidthDouble)) { + if (line.length() > 0) { + writeLine(out, line); + leftTrim(word); + if (tooLong(stringWidth, word, maxWidthDouble)) { + if (breakWords) { + writeBrokenWord(out, word, insertHyphens); + } else { + broken = true; + } + } else { + broken = true; + } + } else { + if (breakWords) { + writeBrokenWord(out, word, insertHyphens); + } else { + broken = true; + } + } + } + } else { + if (word.length() > 0 && !isWhitespace(word)) { + appendWordToLine(line, word); + if (broken) { + leftTrim(line); + } + } + word.append(ch); + if (tooLong(stringWidth, lineAndWordRightTrim, maxWidthDouble)) { + Preconditions.checkArgument(line.length() > 0, + "line length was zero. If this happens please" // + + " contribute unit test that provokes this failure to the project!"); + if (!isWhitespace(line)) { + writeLine(out, line); + } else { + line.setLength(0); + } + broken = true; + } + } + previousWasPunctuation = isPunctuation(ch) && !extraWordChars.contains(ch); + } + if (line.length() > 0) { + String s = line.toString() + word; + if (broken) { + s = leftTrim(s); + } + out.write(s); + } else { + if (broken) { + leftTrim(word); + } + if (!isWhitespace(word)) { + out.write(word.internalArray(), 0, word.length()); + } + } + } + + private static CharSequence concatRightTrim(CharSequence a, CharSequence b) { + return new CharSequenceConcatRightTrim(a, b); + } + + private static boolean isPunctuation(char ch) { + return PUNCTUATION.indexOf(ch) != -1; + } + + private static boolean tooLong(Function stringWidth, + CharSequence s, double maxWidthDouble) { + return stringWidth.apply(s).doubleValue() > maxWidthDouble; + } + + static CharSequence rightTrim(CharSequence s) { + int i = s.length(); + while (i > 0) { + if (Character.isWhitespace(s.charAt(i - 1))) { + i--; + } else { + break; + } + } + if (i != s.length()) { + return s.subSequence(0, i); + } else { + return s; + } + } + + static boolean isWhitespace(CharSequence s) { + for (int i = 0; i < s.length(); i++) { + if (!Character.isWhitespace(s.charAt(i))) { + return false; + } + } + return true; + } + + static void leftTrim(StringWrapHelper word) { + // trim leading spaces on the word + // because we have inserted a new line + int i; + for (i = 0; i < word.length(); i++) { + if (!Character.isWhitespace(word.charAt(i))) { + break; + } + } + if (i < word.length() && i > 0) { + word.delete(0, i); + } + } + + private static String leftTrim(String s) { + StringWrapHelper b = new StringWrapHelper(s); + leftTrim(b); + return b.toString(); + } + + private static void appendWordToLine(StringWrapHelper line, StringWrapHelper word) { + line.append(word); + word.setLength(0); + } + + private static void writeBrokenWord(LineConsumer out, StringWrapHelper word, boolean insertHyphens) throws IOException { + // to be really thorough we'd check the new stringWidth with '-' but let's not + // bother for now + String x; + if (insertHyphens && word.length() > 2 + && !isWhitespace((x = word.substring(0, word.length() - 2)))) { + out.write(x); + out.write("-"); + out.writeNewLine(); + word.delete(0, word.length() - 2); + } else { + String prefix = word.substring(0, word.length() - 1); + if (!isWhitespace(prefix)) { + out.write(prefix); + } + out.writeNewLine(); + word.delete(0, word.length() - 1); + } + } + + private static void writeLine(LineConsumer out, StringWrapHelper line) + throws IOException { + out.write(line.internalArray(), 0, line.length()); + out.writeNewLine(); + line.setLength(0); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/data/LineConsumer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/data/LineConsumer.java new file mode 100644 index 0000000..24f2668 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/lang/data/LineConsumer.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.util.lang.data; + +import java.io.IOException; + +public interface LineConsumer { + + void write(char[] chars, int offset, int length) throws IOException; + + void writeNewLine() throws IOException; + + default void write(String s) throws IOException { + char[] chars = s.toCharArray(); + write(chars, 0, chars.length); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/BranchManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/BranchManager.java new file mode 100644 index 0000000..3db7a81 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/BranchManager.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.util.manager; + +import com.cheatbreaker.client.CheatBreaker; +import lombok.Getter; +import lombok.Setter; + +@Getter +public class BranchManager { + + @Setter private Branch currentBranch; + + public BranchManager() { + CheatBreaker.getInstance().getLogger().info(CheatBreaker.getInstance().getLoggerPrefix() + "Created Branch Manager"); + } + + + public enum Branch { + DEVELOPMENT("?"), + BETA("beta"), + MASTER("master"), + UNKNOWN("unknown"); + + @Getter + private final String name; + Branch(String name) { + this.name = name; + } + + public static Branch getBranchByName(String name) + { + for (Branch value : Branch.values()) + { + if (!value.getName().equalsIgnoreCase(name)) continue; + return value; + } + return UNKNOWN; + } + + public boolean isAboveOrEqual(Branch rank) + { + return rank.ordinal() >= this.ordinal(); + } + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/CrashHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/CrashHandler.java new file mode 100644 index 0000000..eb25802 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/CrashHandler.java @@ -0,0 +1,120 @@ +package com.cheatbreaker.client.util.manager; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.optifine.http.HttpUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; + +public class CrashHandler { + public static void handleCrash(StackTraceElement[] arrstackTraceElement) { + try { + GameSettings gameSettings = Config.getGameSettings(); + String string = CheatBreaker.getInstance().getGlobalSettings().webapiCrashReportUpload; + String string2 = CrashHandler.getPOSTData(arrstackTraceElement); + byte[] arrby = string2.getBytes(StandardCharsets.US_ASCII); + HashMap hashMap = new HashMap(); + System.out.println("[Crash Handler] Sending Post"); + String string3 = HttpUtils.post(string, hashMap, arrby); + System.out.println("[Crash Handler] Sent Post"); + if (string3 != null) { + StringSelection stringSelection = new StringSelection(string3); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(stringSelection, null); + new Thread(() -> JOptionPane.showMessageDialog(null, "Your client has crashed. \n\nPlease use the following code (also copied to your clipboard) when submitting a bug report: " + string3, "Something went wrong (Closing in 5 seconds)", 2)).start(); + } + Thread.sleep(6000L); + } catch (Exception exception) { + Config.dbg(exception.getClass().getName() + ": " + exception.getMessage()); + } + } + + + /* + * Could not resolve type clashes + */ + private static String getPOSTData(StackTraceElement[] arrstackTraceElement) { + BufferedReader bufferedReader; + StringBuilder builder = new StringBuilder(); + builder.append("CheatBreaker client Version: ").append(CheatBreaker.getInstance().getGitCommitId()).append("/").append(CheatBreaker.getInstance().getGitBranch()).append("\n\n"); + builder.append("\n"); + builder.append("\n\n"); + builder.append("= [ StackTrace ] =\n"); + for (StackTraceElement stackTraceElement : arrstackTraceElement) { + builder.append("\n").append(stackTraceElement); + } + builder.append("\n\n"); + GameSettings object = Minecraft.getMinecraft().gameSettings; + if (Minecraft.getMinecraft().getSession() != null) { + builder.append("= [ User Info ] =\n"); + builder.append("Username: ").append(Minecraft.getMinecraft().getSession().getUsername()).append("\n"); + builder.append("UUID: ").append(Minecraft.getMinecraft().getSession().getPlayerID()).append("\n\n"); + } + builder.append("= [ Options.txt ] =\n"); + try { + String string; + bufferedReader = new BufferedReader(new FileReader(object.optionsFile)); + while ((string = bufferedReader.readLine()) != null) { + if (string.startsWith("stream") || string.startsWith("key_") || string.startsWith("soundCategory")) continue; + builder.append(string).append("\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + builder.append("\n= [ OptionsOF.txt ] =\n"); + try { + String string; + bufferedReader = new BufferedReader(new FileReader(object.optionsFileOF)); + while ((string = bufferedReader.readLine()) != null) { + if (string.startsWith("ofAnimated")) continue; + builder.append(string + "\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + return builder.toString(); + } + + private static String makeSummary(CrashReport crashReport) { + return "Unknown"; + } + + /* + * Could not resolve type clashes + */ + public static void extendCrashReport(CrashReportCategory crashReportCategory) { + String string = "["; + for (Object object : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + if (((Setting)object).getSettingName().equals("label")) continue; + string = string + ((Setting)object).getSettingName() + "=" + ((Setting)object).getValue() + ", "; + } + crashReportCategory.addCrashSection("Global Settings", string + "]"); + for (Object object : CheatBreaker.getInstance().getModuleManager().playerMods) { + String string2 = "["; + for (Setting setting : ((AbstractModule)object).getSettingsList()) { + if (setting.getSettingName().equals("label")) continue; + string2 = string2 + setting.getSettingName() + "=" + setting.getValue() + (((AbstractModule)object).getSettingsList().indexOf(setting) == ((AbstractModule)object).getSettingsList().size() - 1 ? "" : ", "); + } + crashReportCategory.addCrashSection(((AbstractModule)object).getName() + " options", string2 + "]"); + } + crashReportCategory.addCrashSection("OpenGlVersion", "" + Config.openGlVersion); + crashReportCategory.addCrashSection("OpenGlRenderer", "" + Config.openGlRenderer); + crashReportCategory.addCrashSection("OpenGlVendor", "" + Config.openGlVendor); + crashReportCategory.addCrashSection("CpuCount", "" + Config.getAvailableProcessors()); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/CrashReportManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/CrashReportManager.java new file mode 100644 index 0000000..e514ef9 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/CrashReportManager.java @@ -0,0 +1,119 @@ +package com.cheatbreaker.client.util.manager; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.optifine.http.HttpUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; + +public class CrashReportManager { + public static void handleCrash(StackTraceElement[] arrstackTraceElement) { + try { + String uploadUrl = CheatBreaker.getInstance().getGlobalSettings().webapiCrashReportUpload; + String postData = CrashReportManager.getPOSTData(arrstackTraceElement); + byte[] postDataBytes = postData.getBytes(StandardCharsets.US_ASCII); + + String string3 = HttpUtils.post(uploadUrl, new HashMap<>(), postDataBytes); + System.out.println("[Crash Handler] Sent Post"); + + if (string3 != null) { + StringSelection stringSelection = new StringSelection(string3); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(stringSelection, null); + new Thread(() -> JOptionPane.showMessageDialog(null, "Your client has crashed. \n\nPlease use the following code (also copied to your clipboard) when submitting a bug report: " + string3, "Something went wrong (Closing in 5 seconds)", 2)).start(); + } + Thread.sleep(6000L); + } catch (Exception exception) { + Config.dbg(exception.getClass().getName() + ": " + exception.getMessage()); + } + } + + + private static String getPOSTData(StackTraceElement[] arrstackTraceElement) { + BufferedReader bufferedReader; + StringBuilder builder = new StringBuilder(); + builder.append("CheatBreaker Client Version: ").append(CheatBreaker.getInstance().getGitCommitId()).append("/").append(CheatBreaker.getInstance().getGitBranch()).append("\n\n"); + builder.append("\n"); + builder.append("\n\n"); + builder.append("= [ StackTrace ] =\n"); + for (StackTraceElement stackTraceElement : arrstackTraceElement) { + builder.append("\n").append(stackTraceElement); + } + builder.append("\n\n"); + GameSettings object = Minecraft.getMinecraft().gameSettings; + if (Minecraft.getMinecraft().getSession() != null) { + builder.append("= [ User Info ] =\n"); + builder.append("Username: ").append(Minecraft.getMinecraft().getSession().getUsername()).append("\n"); + builder.append("UUID: ").append(Minecraft.getMinecraft().getSession().getPlayerID()).append("\n\n"); + } + builder.append("= [ Options.txt ] =\n"); + try { + String string; + bufferedReader = new BufferedReader(new FileReader(object.optionsFile)); + while ((string = bufferedReader.readLine()) != null) { + if (string.startsWith("stream") || string.startsWith("key_") || string.startsWith("soundCategory")) + continue; + builder.append(string).append("\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + builder.append("\n= [ OptionsOF.txt ] =\n"); + try { + String string; + bufferedReader = new BufferedReader(new FileReader(object.optionsFileOF)); + while ((string = bufferedReader.readLine()) != null) { + if (string.startsWith("ofAnimated")) continue; + builder.append(string + "\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + return builder.toString(); + } + + private static String makeSummary(CrashReport crashReport) { + return "Unknown"; + } + + + public static void extendCrashReport(CrashReportCategory crashReportCategory) { + StringBuilder string = new StringBuilder("["); + for (Object object : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + if (((Setting) object).getSettingName().equals("label")) continue; + string.append(((Setting) object).getSettingName()).append("=").append(((Setting) object).getValue()).append(", "); + } + + { + crashReportCategory.addCrashSection("Global Settings", string + "]"); + for (Object object : CheatBreaker.getInstance().getModuleManager().playerMods) { + String string2 = "["; + for (Setting setting : ((AbstractModule) object).getSettingsList()) { + if (setting.getSettingName().equals("label")) continue; + string2 = string2 + setting.getSettingName() + "=" + setting.getValue() + (((AbstractModule) object).getSettingsList().indexOf(setting) == ((AbstractModule) object).getSettingsList().size() - 1 ? "" : ", "); + } + crashReportCategory.addCrashSection(((AbstractModule) object).getName() + " options", string2 + "]"); + } + } + + crashReportCategory.addCrashSection("OpenGlVersion", "" + Config.openGlVersion); + crashReportCategory.addCrashSection("OpenGlRenderer", "" + Config.openGlRenderer); + crashReportCategory.addCrashSection("OpenGlVendor", "" + Config.openGlVendor); + crashReportCategory.addCrashSection("CpuCount", "" + Config.getAvailableProcessors()); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/DebugInfoHandler.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/DebugInfoHandler.java new file mode 100644 index 0000000..415f468 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/manager/DebugInfoHandler.java @@ -0,0 +1,144 @@ +package com.cheatbreaker.client.util.manager; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.optifine.http.FileUploadThread; +import net.optifine.http.IFileUploadListener; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; + +/** + * Manages everything bug reporting. + */ +public class DebugInfoHandler { + public static void ReportThatBug(String description) { + try { + String link = CheatBreaker.getInstance().getGlobalSettings().webapiDebugUpload; + String info = DebugInfoHandler.getWebAPIInfo(description); + byte[] intoToBytes = info.getBytes(StandardCharsets.US_ASCII); + IFileUploadListener webUploadType = (string, arrby, throwable) -> DebugInfoHandler.sendConfirmationMessage(); + HashMap hashMap = new HashMap(); + hashMap.put("OF-Version", Config.getVersion()); + FileUploadThread sendWebAPIPostThread = new FileUploadThread(link, hashMap, intoToBytes, webUploadType); + sendWebAPIPostThread.setPriority(10); + sendWebAPIPostThread.start(); + Thread.sleep(1000L); + } catch (InterruptedException exception) { + exception.printStackTrace(); + } + } + + private static String getWebAPIInfo(String string) { + Runtime runtime = Runtime.getRuntime(); + long maxMemory = runtime.maxMemory(); + long totalMemory = runtime.totalMemory(); + long freeMemory = runtime.freeMemory(); + long maxMemDiv = maxMemory / 1024L / 1024L; + long totalMemDiv = totalMemory / 1024L / 1024L; + long freeMemDiv = freeMemory / 1024L / 1024L; + StringBuilder builder = new StringBuilder(); + builder.append("OptiFine Version: ").append(Config.getVersion()).append("\n\n"); + builder.append("CheatBreaker client Version: ").append(CheatBreaker.getInstance().getGitCommitId()).append("/").append(CheatBreaker.getInstance().getGitBranch()).append("\n\n"); + builder.append("= [ Description ] =\n"); + builder.append(string).append("\n\n"); + builder.append("= [ User Info ] =\n"); + if (Minecraft.getMinecraft().getSession() != null) { + try { + builder.append("User: ").append(Minecraft.getMinecraft().getSession().getUsername()).append("\n"); + builder.append("UUID: ").append(Minecraft.getMinecraft().getSession().getPlayerID()).append("\n\n"); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + builder.append("= [ System Info ] =\n"); + builder.append("OpenGlVersion: ").append(Config.openGlVersion).append("\n"); + builder.append("OpenGlRenderer: ").append(Config.openGlRenderer).append("\n"); + builder.append("OpenGlVendor: ").append(Config.openGlVendor).append("\n"); + builder.append("CpuCount: ").append(Config.getAvailableProcessors()).append("\n"); + builder.append("OS: ").append(System.getProperty("os.name")).append(" (").append(System.getProperty("os.arch")).append(") version ").append(System.getProperty("os.version")).append("\n"); + builder.append("Java: ").append(System.getProperty("java.version")).append(", ").append(System.getProperty("java.vendor")).append("\n"); + builder.append("Java VM: ").append(System.getProperty("java.vm.name")).append(" (").append(System.getProperty("java.vm.info")).append("), ").append(System.getProperty("java.vm.vendor")).append("\n"); + builder.append("Memory: ").append(freeMemory).append(" bytes (").append(freeMemDiv).append(" MB) / ").append(totalMemory).append(" bytes (").append(totalMemDiv).append(" MB) up to ").append(maxMemory).append(" bytes (").append(maxMemDiv).append(" MB)").append("\n"); + builder.append("JVM Flags: ").append(getJVMFlags()).append("\n\n"); + builder.append("= [ Module Settings ] =").append("\n"); + for (AbstractModule module : CheatBreaker.getInstance().getModuleManager().playerMods) { + StringBuilder moduleSetting = new StringBuilder(); + for (Setting setting : module.getSettingsList()) { + if (setting.getSettingName().equals("label")) continue; + moduleSetting.append(setting.getSettingName()).append("=").append(setting.getValue()).append(module.getSettingsList().indexOf(setting) == module.getSettingsList().size() - 1 ? "" : ", "); + } + builder.append(module.getName()).append(": [").append(moduleSetting).append("]\n"); + } + builder.append("\n= [ Global Settings ] =").append("\n"); + StringBuilder globalSetting = new StringBuilder(); + List settingsList = CheatBreaker.getInstance().getGlobalSettings().settingsList; + for (Setting theSetting : settingsList) { + if (theSetting.getSettingName().equals("label")) continue; + globalSetting.append(theSetting.getSettingName()).append("=").append(theSetting.getValue()).append(settingsList.indexOf(theSetting) == + settingsList.size() - 1 ? "" : ", "); + } + builder.append("Global: [").append(globalSetting).append("]\n\n"); + GameSettings gameSettings = Minecraft.getMinecraft().gameSettings; + builder.append("= [ Options.txt ] =\n"); + BufferedReader readFile; + String varString; + try { + readFile = new BufferedReader(new FileReader(gameSettings.optionsFile)); + while ((varString = readFile.readLine()) != null) { + if (varString.startsWith("stream") || varString.startsWith("key_") || varString.startsWith("soundCategory")) + continue; + builder.append(varString).append("\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + builder.append("\n= [ OptionsOF.txt ] =\n"); + try { + readFile = new BufferedReader(new FileReader(gameSettings.optionsFileOF)); + while ((varString = readFile.readLine()) != null) { + if (varString.startsWith("ofAnimated")) continue; + builder.append(varString).append("\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + return builder.toString(); + } + + private static void sendConfirmationMessage() { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Uploaded debug info.")); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + Minecraft.getMinecraft().entityRenderer.stopUseShader(); + } + Minecraft.getMinecraft().displayGuiScreen(null); + } + + private static String getJVMFlags() { + RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); + List list = runtimeMXBean.getInputArguments(); + int n = 0; + StringBuilder stringBuilder = new StringBuilder(); + for (String string : list) { + if (!string.startsWith("-X")) continue; + if (n++ > 0) { + stringBuilder.append(" "); + } + stringBuilder.append(string); + } + return String.format("%d total; %s", n, stringBuilder); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/RGBData.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/RGBData.java new file mode 100644 index 0000000..8d4327d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/RGBData.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.util.render; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public class RGBData { + + private final int red; + private final int green; + private final int blue; + private int alpha = 255; + +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/hologram/Hologram.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/hologram/Hologram.java new file mode 100644 index 0000000..cb4056a --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/hologram/Hologram.java @@ -0,0 +1,86 @@ +package com.cheatbreaker.client.util.render.hologram; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@Getter @Setter @RequiredArgsConstructor +public class Hologram { + private final UUID uuid; + + private final double xPos; + private final double yPos; + private final double zPos; + + private String[] lines; + + private static final List holograms = new ArrayList<>(); + + public static void renderHologram() { + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj; + RenderManager renderManager = RenderManager.getInstance(); + for (Hologram hologram : holograms) { + if (hologram.getLines() == null || hologram.getLines().length <= 0) continue; + for (int i = hologram.getLines().length - 1; i >= 0; --i) { + String line = hologram.getLines()[hologram.getLines().length - i - 1]; + float xPos = (float) (hologram.getXPos() - (double) ((float) renderManager.getRenderPosX())); + float yPos = (float) (hologram.getYPos() + 1.0 + (double) ((float) i * (0.16049382f * 1.5576924f)) - + (double) ((float) renderManager.getRenderPosY())); + float zPos = (float) (hologram.getZPos() - (double) ((float) renderManager.getRenderPosZ())); + float scale = 1.6f; + float scaled = 0.016666668f * scale; + GL11.glPushMatrix(); + GL11.glTranslatef(xPos, yPos, zPos); + GL11.glNormal3f(0.0f, 1.0f, 0.0f); + GL11.glRotatef(-renderManager.playerViewY, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(renderManager.playerViewX, 1.0f, 0.0f, 0.0f); + GL11.glScalef(-scaled, -scaled, scaled); + GL11.glDisable(2896); + GL11.glDepthMask(false); + GL11.glDisable(2929); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int renderYPos = 0; + GL11.glDisable(3553); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + int renderXPos = fontRenderer.getStringWidth(line) / 2; + worldrenderer.pos(-renderXPos - 1, -1 + renderYPos, 0.0).color(0.0f, 1.0f, 0.0f, 0.25f).endVertex(); + worldrenderer.pos(-renderXPos - 1, 8 + renderYPos, 0.0).color(0.0f, 0.0f, 0.0f, 0.25f).endVertex(); + worldrenderer.pos(renderXPos + 1, 8 + renderYPos, 0.0).color(0.0f, 0.0f, 0.0f, 0.25f).endVertex(); + worldrenderer.pos(renderXPos + 1, -1 + renderYPos, 0.0).color(0.0f, 0.0f, 0.0f, 0.25f).endVertex(); + tessellator.draw(); + GL11.glEnable(3553); + fontRenderer.drawString(line, -fontRenderer.getStringWidth(line) / 2, renderYPos, 0x20FFFFFF); + GL11.glEnable(2929); + GL11.glDepthMask(true); + fontRenderer.drawString(line, -fontRenderer.getStringWidth(line) / 2, renderYPos, -1); + GL11.glEnable(2896); + GL11.glDisable(3042); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glPopMatrix(); + } + } + } + + public UUID getUUID() { + return this.uuid; + } + + public static List getHolograms() { + return holograms; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/math/MathUtils.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/math/MathUtils.java new file mode 100644 index 0000000..efa8228 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/math/MathUtils.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.util.render.math; + +import net.minecraft.util.MathHelper; + +public class MathUtils { + private static final double[] a = new double[65536]; + + private static final double[] b = new double[360]; + + static { + int i; + for (i = 0; i < 65536; i++) + a[i] = Math.sin(i * Math.PI * 2.0D / 65536.0D); + for (i = 0; i < 360; i++) + b[i] = Math.sin(Math.toRadians(i)); + } + + public static double getAngle(int paramInt) { + paramInt %= 360; + return b[paramInt]; + } + + public static double getRightAngle(int paramInt) { + paramInt += 90; + paramInt %= 360; + return b[paramInt]; + } + + private static float snapToStep(float value, float valueStep) { + if (valueStep > 0.0F) + value = valueStep * Math.round(value / valueStep); + return value; + } + + public static float normalizeValue(float p_148266_1_, float valueMin, float valueMax, float valueStep) { + return MathHelper.clamp_float((snapToStepClamp(p_148266_1_, valueMin, valueMax, valueStep) - valueMin) / (valueMax - valueMin), 0.0F, 1.0F); + } + + private static float snapToStepClamp(float value, float valueMin, float valueMax, float valueStep) { + value = snapToStep(value, valueStep); + return MathHelper.clamp_float(value, valueMin, valueMax); + } + + public static float denormalizeValue(float value, float valueMin, float valueMax, float valueStep) { + return snapToStepClamp(valueMin + (valueMax - valueMin) * MathHelper.clamp_float(value, 0.0F, 1.0F), valueMin, valueMax, valueStep); + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/serverlist/ServerListEntryPinned.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/serverlist/ServerListEntryPinned.java new file mode 100644 index 0000000..f2075b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/serverlist/ServerListEntryPinned.java @@ -0,0 +1,285 @@ +package com.cheatbreaker.client.util.render.serverlist; + +import com.cheatbreaker.client.ui.mainmenu.LunarNetworkLogoElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.base.Charsets; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.gui.GuiMultiplayer; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.net.UnknownHostException; +import java.util.List; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; + +public class ServerListEntryPinned implements GuiListExtended.IGuiListEntry { + private static final ResourceLocation SERVER_SELECTION_BUTTONS = new ResourceLocation("textures/gui/resource_packs.png"); + private static final ResourceLocation UNKNOWN_SERVER = new ResourceLocation("textures/misc/unknown_pack.png"); + private static final Logger logger = LogManager.getLogger(); + private static final ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(5, new ThreadFactoryBuilder().setNameFormat("Server Pinger #%d").setDaemon(true).build()); + private final GuiMultiplayer guiMultiplayer; + private final Minecraft mc; + private final ServerData server; + private long field_148298_f; + private String lastIconB64; + private DynamicTexture icon; + private final ResourceLocation serverIcon; + private final ResourceLocation starIcon = new ResourceLocation("client/icons/star-64.png"); + private final ResourceLocation cbIcon = new ResourceLocation("client/icons/cb.png"); + private LunarNetworkLogoElement lunarNetworkLogo; + + public ServerListEntryPinned(GuiMultiplayer p_i45048_1_, ServerData serverIn) { + this.guiMultiplayer = p_i45048_1_; + this.server = serverIn; + this.mc = Minecraft.getMinecraft(); + this.serverIcon = new ResourceLocation("servers/" + serverIn.serverIP + "/icon"); + this.icon = (DynamicTexture)this.mc.getTextureManager().getTexture(this.serverIcon); + if (serverIn.serverIP.toLowerCase().endsWith("warzone.rip")) { + this.lunarNetworkLogo = new LunarNetworkLogoElement(); + } + } + + private void prepareServerIcon() { + if (this.server.getBase64EncodedIconData() == null) { + this.mc.getTextureManager().getTexture(this.serverIcon); + this.icon = null; + } else { + BufferedImage bufferedImage; + block8: { + ByteBuf byteBuf = Unpooled.copiedBuffer(this.server.getBase64EncodedIconData(), Charsets.UTF_8); + ByteBuf byteBuf2 = Base64.decode(byteBuf); + try { + bufferedImage = ImageIO.read(new ByteBufInputStream(byteBuf2)); + Validate.validState(bufferedImage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]); + Validate.validState(bufferedImage.getHeight() == 64, "Must be 64 pixels high", new Object[0]); + break block8; + } catch (Exception exception) { + logger.error("Invalid icon for server " + this.server.serverName + " (" + this.server.serverIP + ")", (Throwable)exception); + this.server.setBase64EncodedIconData((String)null); + } + finally { + byteBuf.release(); + byteBuf2.release(); + } + return; + } + if (this.icon == null) { + this.icon = new DynamicTexture(bufferedImage.getWidth(), bufferedImage.getHeight()); + this.mc.getTextureManager().loadTexture(this.serverIcon, this.icon); + } + bufferedImage.getRGB(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), this.icon.getTextureData(), 0, bufferedImage.getWidth()); + this.icon.updateDynamicTexture(); + } + } + + @Override + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) { + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) { + + if (!this.server.field_78841_f) { + this.server.field_78841_f = true; + this.server.pingToServer = -2L; + this.server.serverMOTD = ""; + this.server.populationInfo = ""; + executor.submit(() -> { + try { + ServerListEntryPinned.this.guiMultiplayer.getOldServerPinger().ping(ServerListEntryPinned.this.server); + } catch (UnknownHostException var2) { + ServerListEntryPinned.this.server.pingToServer = -1L; + ServerListEntryPinned.this.server.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t resolve hostname"; + } catch (Exception var3) { + ServerListEntryPinned.this.server.pingToServer = -1L; + ServerListEntryPinned.this.server.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t connect to server."; + } + }); + } + + GL11.glColor4f(1.0f, 0.40909088f * 2.2f, 0.0f, 1.0f); + RenderUtil.renderIcon(this.starIcon, (float)5, (float)(x - 17), (float)(y + (this.server.isCheatBreakerServer() ? 4 : 12))); + GL11.glColor4f(11.5f * 0.073913045f, 0.2857143f * 2.975f, 3.0f * 0.28333333f, 1.0f); + + if (this.server.isCheatBreakerServer()) { + float f = 16; + float f2 = 8; + float f3 = 0.0f; + float f4 = 0.0f; + float f5 = x - 20; + float f6 = y + 20; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(this.cbIcon); + GL11.glBegin(7); + GL11.glTexCoord2d(f3 / (float)5, f4 / (float)5); + GL11.glVertex2d(f5, f6); + GL11.glTexCoord2d(f3 / (float)5, (f4 + (float)5) / (float)5); + GL11.glVertex2d(f5, f6 + f2); + GL11.glTexCoord2d((f3 + (float)5) / (float)5, (f4 + (float)5) / (float)5); + GL11.glVertex2d(f5 + f, f6 + f2); + GL11.glTexCoord2d((f3 + (float)5) / (float)5, f4 / (float)5); + GL11.glVertex2d(f5 + f, f6); + GL11.glEnd(); + GL11.glDisable(3042); + } + + boolean flag = this.server.version > 47; + boolean flag1 = this.server.version < 47; + boolean flag2 = flag || flag1; + this.mc.fontRendererObj.drawString(this.server.serverName, x + 32 + 3, y + 1, 16777215); + List list = this.mc.fontRendererObj.listFormattedStringToWidth(this.server.serverMOTD, listWidth - 32 - 2); + + for (int i = 0; i < Math.min(list.size(), 2); ++i) { + this.mc.fontRendererObj.drawString(list.get(i), x + 32 + 3, y + 12 + this.mc.fontRendererObj.FONT_HEIGHT * i, 8421504); + } + + String s2 = flag2 ? EnumChatFormatting.DARK_RED + this.server.gameVersion : this.server.populationInfo; + int j = this.mc.fontRendererObj.getStringWidth(s2); + this.mc.fontRendererObj.drawString(s2, x + listWidth - j - 15 - 2, y + 1, 8421504); + int k = 0; + String s = null; + int l; + String s1; + + if (flag2) { + l = 5; + s1 = flag ? "Client out of date!" : "Server out of date!"; + s = this.server.playerList; + } else if (this.server.field_78841_f && this.server.pingToServer != -2L) { + if (this.server.pingToServer < 0L) { + l = 5; + } else if (this.server.pingToServer < 150L) { + l = 0; + } else if (this.server.pingToServer < 300L) { + l = 1; + } else if (this.server.pingToServer < 600L) { + l = 2; + } else if (this.server.pingToServer < 1000L) { + l = 3; + } else { + l = 4; + } + + if (this.server.pingToServer < 0L) { + s1 = "(no connection)"; + } else { + s1 = this.server.pingToServer + "ms"; + s = this.server.playerList; + } + } else { + k = 1; + l = (int) (Minecraft.getSystemTime() / 100L + (long) (slotIndex * 2) & 7L); + + if (l > 4) { + l = 8 - l; + } + + s1 = "Pinging..."; + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.icons); + Gui.drawModalRectWithCustomSizedTexture(x + listWidth - 15, y, (float) (k * 10), (float) (176 + l * 8), 10, 8, 256.0F, 256.0F); + + if (this.server.getBase64EncodedIconData() != null && !this.server.getBase64EncodedIconData().equals(this.lastIconB64)) { + this.lastIconB64 = this.server.getBase64EncodedIconData(); + this.prepareServerIcon(); + this.guiMultiplayer.getServerList().saveServerList(); + } + + if (this.lunarNetworkLogo != null) { + this.lunarNetworkLogo.setElementSize(x, y, 32.0f, 29.5f); + this.lunarNetworkLogo.drawElementHover(0.0f, 0.0f, true); + } else { + if (this.icon != null) { + this.drawTextureAt(x, y, this.serverIcon); + } else { + this.drawTextureAt(x, y, UNKNOWN_SERVER); + } + } + + int i1 = mouseX - x; + int j1 = mouseY - y; + + if (i1 >= listWidth - 15 && i1 <= listWidth - 5 && j1 >= 0 && j1 <= 8) { + this.guiMultiplayer.setHoveringText(s1); + } else if (i1 >= listWidth - j - 15 - 2 && i1 <= listWidth - 15 - 2 && j1 >= 0 && j1 <= 8) { + this.guiMultiplayer.setHoveringText(s); + } + + if (this.mc.gameSettings.touchscreen || isSelected) { + this.mc.getTextureManager().bindTexture(SERVER_SELECTION_BUTTONS); + Gui.drawRect(x, y, x + 32, y + 32, -1601138544); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + int k1 = mouseX - x; + + if (this.func_178013_b()) { + if (k1 < 32 && k1 > 16) { + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + } + } + + protected void drawTextureAt(int p_178012_1_, int p_178012_2_, ResourceLocation p_178012_3_) { + this.mc.getTextureManager().bindTexture(p_178012_3_); + GlStateManager.enableBlend(); + Gui.drawModalRectWithCustomSizedTexture(p_178012_1_, p_178012_2_, 0.0F, 0.0F, 32, 32, 32.0F, 32.0F); + GlStateManager.disableBlend(); + } + + private boolean func_178013_b() { + return true; + } + + @Override + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + this.guiMultiplayer.selectServer(slotIndex); + if (Minecraft.getSystemTime() - this.field_148298_f < 250L) { + this.guiMultiplayer.connectToSelected(); + } + this.field_148298_f = Minecraft.getSystemTime(); + if (p_148278_5_ <= 32) { + if (p_148278_5_ < 32) { + this.guiMultiplayer.connectToSelected(); + return true; + } + } + return false; + } + + @Override + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) { + } + + public ServerData getServer() { + return this.server; + } + + static ServerData setServer(ServerListEntryPinned cBServerListEntryNormal) { + return cBServerListEntryNormal.server; + } + + static GuiMultiplayer getGuiMultiplayer(ServerListEntryPinned cBServerListEntryNormal) { + return cBServerListEntryNormal.guiMultiplayer; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/serverlist/UnsafeServerAction.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/serverlist/UnsafeServerAction.java new file mode 100644 index 0000000..4f25658 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/serverlist/UnsafeServerAction.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.util.render.serverlist; + +public enum UnsafeServerAction { + WARN, + BLOCK +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/teammates/CBTeammate.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/teammates/CBTeammate.java new file mode 100644 index 0000000..c810d06 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/teammates/CBTeammate.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.util.render.teammates; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.util.Vec3; + +import java.awt.*; +import java.beans.ConstructorProperties; + +@AllArgsConstructor +@Getter +@Setter +public class CBTeammate { + private String uuid; + private boolean leader = false; + private Vec3 position; + private long lastUpdate; + private Color color; + private long lastMs; + + @ConstructorProperties({"uuid", "leader"}) + public CBTeammate(String uuid, boolean leader) { + this.uuid = uuid; + this.leader = leader; + this.lastUpdate = System.currentTimeMillis(); + } + + public void updateTeammate(double xPos, double yPos, double zPos, long lastMs) { + this.position = new Vec3(xPos, yPos, zPos); + this.lastUpdate = System.currentTimeMillis(); + this.lastMs = lastMs; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/CBTitle.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/CBTitle.java new file mode 100644 index 0000000..1c7a247 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/CBTitle.java @@ -0,0 +1,30 @@ +package com.cheatbreaker.client.util.render.title; + +import com.cheatbreaker.client.util.render.title.data.TitleType; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter @AllArgsConstructor +public class CBTitle { + private final String message; + private final TitleType titletype; + private final float scale; + private final long displayTimeMs; + private final long fadeInTimeMs; + private final long fadeOutTimeMs; + protected final long currentTimeMillis = System.currentTimeMillis(); + + /** + * Returns if the title is fading or not. + */ + public boolean isFading() { + return System.currentTimeMillis() < this.currentTimeMillis + this.fadeInTimeMs; + } + + /** + * Returns if the title should display or not. + */ + public boolean shouldDisplay() { + return System.currentTimeMillis() > this.currentTimeMillis + this.displayTimeMs - this.fadeOutTimeMs; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/TitleManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/TitleManager.java new file mode 100644 index 0000000..f0f2dc2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/TitleManager.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.util.render.title; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.util.render.title.data.TitleType; +import com.google.common.collect.Lists; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.List; + +public class TitleManager { + private final Minecraft mc = Minecraft.getMinecraft(); + @Getter private final List titles = Lists.newArrayList(); + + public TitleManager() { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created Title Manager"); + } + + public void onGuiDrawEvent(GuiDrawEvent event) { + GL11.glEnable(3042); + for (CBTitle title : this.titles) { + this.mc.cbLoadingScreen.addPhase(); + boolean isSubTitle = title.getTitletype() == TitleType.SUBTITLE; + float height = isSubTitle ? (float) 4 : 1.5f; + float width = isSubTitle ? (float) -30 : (float) 10; + + GL11.glScalef(height *= title.getScale(), height, height); + + float f3 = 255; + if (title.isFading()) { + long titleTime = title.getFadeInTimeMs() - (System.currentTimeMillis() - title.currentTimeMillis); + f3 = 1.0f - titleTime / (float) title.getFadeInTimeMs(); + } else if (title.shouldDisplay()) { + long titleTime = title.getDisplayTimeMs() - (System.currentTimeMillis() - title.currentTimeMillis); + f3 = titleTime <= 0.0f ? 0.0f : titleTime / (float) title.getFadeOutTimeMs(); + } + + f3 = Math.min(1.0f, Math.max(0.0f, f3)); + if ((double) f3 <= 0.15) { + f3 = 0.15f; + } + + this.mc.fontRendererObj.drawCenteredStringWithShadow(title.getMessage(), + (int) ((float) (event.getScaledResolution().getScaledWidth() / 2) / height), + (int) (((float) (event.getScaledResolution().getScaledHeight() / 2 - this.mc.fontRendererObj.FONT_HEIGHT / 2) + width) / height), + new Color(1.0f, 1.0f, 1.0f, f3).getRGB()); + GL11.glScalef(1.0f / height, 1.0f / height, 1.0f / height); + } + GL11.glDisable(3042); + } + + public void onTickEvent(TickEvent ignored) { + if (!this.titles.isEmpty()) { + this.titles.removeIf(cBTitle -> cBTitle.currentTimeMillis + cBTitle.getDisplayTimeMs() < System.currentTimeMillis()); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/data/TitleType.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/data/TitleType.java new file mode 100644 index 0000000..76e390e --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/title/data/TitleType.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.util.render.title.data; + +public enum TitleType { + TITLE, + SUBTITLE +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorder.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorder.java new file mode 100644 index 0000000..897866b --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorder.java @@ -0,0 +1,190 @@ +package com.cheatbreaker.client.util.render.worldborder; + +import com.cheatbreaker.client.CheatBreaker; +import com.sun.javafx.geom.Vec2d; +import net.minecraft.entity.Entity; + +import java.awt.*; + +public class WorldBorder { + private final String id; + private final String world; + private final Color color; + private Vec2d currentMin; + private Vec2d currentMax; + private Vec2d lastMin; + private Vec2d lastMax; + private Vec2d newMin; + private Vec2d newMax; + private final boolean canShrinkExpand; + private final boolean cancelExit; + private int moveTicks; + private int durationTicks; + final WorldBorderManager manager; + + WorldBorder(WorldBorderManager manager, String id, String world, int color, double minX, double minZ, + double maxX, double maxZ, boolean canShrinkExpand, boolean cancelExit) { + this.manager = manager; + this.id = id; + this.world = world; + this.color = new Color(color, true); + this.canShrinkExpand = canShrinkExpand; + this.cancelExit = cancelExit; + this.lastMin = this.currentMin = new Vec2d(minX, minZ); + this.lastMax = this.currentMax = new Vec2d(maxX, maxZ); + } + + boolean shouldMove() { + return this.canShrinkExpand && this.durationTicks != 0 && this.moveTicks < this.durationTicks; + } + + + void tick() { + if (this.shouldMove()) { + double d = this.currentMin.x - this.newMin.x; + double d2 = this.currentMax.x - this.newMax.x; + double d3 = this.currentMin.y - this.newMin.y; + double d4 = this.currentMax.y - this.newMax.y; + double d5 = (float) this.moveTicks / (float) this.durationTicks; + double d6 = this.currentMin.x - d * d5; + double d7 = this.currentMax.x - d2 * d5; + double d8 = this.currentMin.y - d3 * d5; + double d9 = this.currentMax.y - d4 * d5; + this.lastMin = new Vec2d(d6, d8); + this.lastMax = new Vec2d(d7, d9); + ++this.moveTicks; + } else if (this.currentMax != this.lastMax || this.currentMin != this.lastMin) { + this.currentMin = this.lastMin; + this.currentMax = this.lastMax; + this.lastMax = this.newMax; + this.lastMin = this.newMin; + this.durationTicks = 0; + this.moveTicks = 0; + } + } + + boolean worldEqualsWorld() { + return CheatBreaker.getInstance().getCBNetHandler().getWorldUID().equals(this.world); + } + + double getStartingMaxX() { + return this.lastMax.x; + } + + double getStartingMaxZ() { + return this.lastMax.y; + } + + double getStartingMinX() { + return this.lastMin.x; + } + + double getStartingMinZ() { + return this.lastMin.y; + } + + double getClosestDistance(Entity entity) { + return this.getClosestDistance(entity.posX, entity.posZ); + } + + double getClosestDistance(double x, double z) { + double d3 = z - this.getStartingMinZ(); + double d4 = this.getStartingMaxZ() - z; + double d5 = x - this.getStartingMinX(); + double d6 = this.getStartingMaxX() - x; + double d7 = Math.min(d5, d6); + d7 = Math.min(d7, d3); + return Math.min(d7, d4); + } + + boolean doesCollide(double d, double d2) { + return !this.cancelExit || + !this.world.equals(CheatBreaker.getInstance().getCBNetHandler().getWorldUID()) || + d + 1.0 > this.getStartingMinX() && d < this.getStartingMaxX() && d2 + 1.0 > this.getStartingMinZ() && d2 < this.getStartingMaxZ(); + } + + + public String getId() { + return this.id; + } + + public String getWorld() { + return this.world; + } + + public Color getColor() { + return this.color; + } + + public Vec2d getCurrentMin() { + return this.currentMin; + } + + public Vec2d getCurrentMax() { + return this.currentMax; + } + + public Vec2d getStartingMin() { + return this.lastMin; + } + + public Vec2d getStartingMax() { + return this.lastMax; + } + + public Vec2d getNewMin() { + return this.newMin; + } + + public Vec2d getNewMax() { + return this.newMax; + } + + public boolean canShrinkExpand() { + return this.canShrinkExpand; + } + + public boolean doesCancelExit() { + return this.cancelExit; + } + + public int getMoveTicks() { + return this.moveTicks; + } + + public int getDurationTicks() { + return this.durationTicks; + } + + static String getId(WorldBorder worldBorder) { + return worldBorder.id; + } + + static Vec2d setNewMin(WorldBorder worldBorder, Vec2d vec2d) { + worldBorder.newMin = vec2d; + return worldBorder.newMin; + } + + static Vec2d setNewMax(WorldBorder worldBorder, Vec2d vec2d) { + worldBorder.newMax = vec2d; + return worldBorder.newMax; + } + + static int setMoveTicks(WorldBorder worldBorder, int n) { + worldBorder.moveTicks = n; + return worldBorder.moveTicks; + } + + static int setDurationTicks(WorldBorder worldBorder, int durationTicks) { + worldBorder.durationTicks = durationTicks; + return worldBorder.durationTicks; + } + + static boolean canShrinkExpand(WorldBorder worldBorder) { + return worldBorder.canShrinkExpand; + } + + static Color getColor(WorldBorder worldBorder) { + return worldBorder.color; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorderManager.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorderManager.java new file mode 100644 index 0000000..4aeccec --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorderManager.java @@ -0,0 +1,188 @@ +package com.cheatbreaker.client.util.render.worldborder; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.movement.CollisionEvent; +import com.cheatbreaker.client.event.impl.network.RenderWorldEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.sun.javafx.geom.Vec2d; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class WorldBorderManager { + private final Minecraft mc = Minecraft.getMinecraft(); + private final CheatBreaker cb = CheatBreaker.getInstance(); + private static final ResourceLocation forceFieldTexture = new ResourceLocation("textures/misc/forcefield.png"); + private final List borderList = new ArrayList<>(); + + public WorldBorderManager() { + CheatBreaker.getInstance().logger.info(CheatBreaker.getInstance().loggerPrefix + "Created Friend Manager"); + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + CheatBreaker.getInstance().getEventBus().addEvent(RenderWorldEvent.class, this::onWorldRender); + CheatBreaker.getInstance().getEventBus().addEvent(CollisionEvent.class, this::onCollision); + } + + private void onCollision(CollisionEvent event) { + for (WorldBorder worldBorder : this.borderList) { + if (worldBorder.doesCollide(event.getX(), event.getZ())) continue; + event.getBoxes().add(new AxisAlignedBB(event.getX(), event.getY(), event.getZ(), event.getX() + 1.0, event.getY() + 1.0, event.getZ() + 1.0)); + } + } + + private void onTick(TickEvent tickEvent) { + this.borderList.forEach(WorldBorder::tick); + } + + private void onWorldRender(RenderWorldEvent event) { + if (!this.borderList.isEmpty()) { + EntityPlayer entityClientPlayerMP = this.mc.thePlayer; + float f = event.getPartialTicks(); + this.borderList.stream().filter(WorldBorder::worldEqualsWorld).forEach(worldBorder -> { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + double d = this.mc.gameSettings.renderDistanceChunks * 16; + if (entityClientPlayerMP.posX >= worldBorder.getStartingMaxX() - d || + entityClientPlayerMP.posX <= worldBorder.getStartingMinX() + d || + entityClientPlayerMP.posZ >= worldBorder.getStartingMaxZ() - d || + entityClientPlayerMP.posZ <= worldBorder.getStartingMinZ() + d) { + float f2; + double d2; + double d3; + float f3; + double d4 = 1.0 - worldBorder.getClosestDistance(entityClientPlayerMP) / d; + d4 = Math.pow(d4, 4); + double d5 = entityClientPlayerMP.lastTickPosX + (entityClientPlayerMP.posX - entityClientPlayerMP.lastTickPosX) * (double) f; + double d6 = entityClientPlayerMP.lastTickPosY + (entityClientPlayerMP.posY - entityClientPlayerMP.lastTickPosY) * (double) f; + double d7 = entityClientPlayerMP.lastTickPosZ + (entityClientPlayerMP.posZ - entityClientPlayerMP.lastTickPosZ) * (double) f; + GL11.glEnable(3042); + GL11.glBlendFunc(770, 1); + this.mc.renderEngine.bindTexture(forceFieldTexture); + GL11.glDepthMask(false); + GL11.glPushMatrix(); + boolean bl = true; + float f4 = (float) (WorldBorder.getColor(worldBorder).getRed() & 0xFF) / (float) 255; + float f5 = (float) (WorldBorder.getColor(worldBorder).getGreen() & 0xFF) / (float) 255; + float f6 = (float) (WorldBorder.getColor(worldBorder).getBlue() & 0xFF) / (float) 255; + GL11.glPolygonOffset(-3, -3); + GL11.glEnable(32823); + GL11.glAlphaFunc(516, 0.097260274f * 1.028169f); + GL11.glEnable(3008); + GL11.glDisable(2884); + float f7 = (float) (Minecraft.getSystemTime() % 3000L) / (float) 3000; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + GL11.glTranslated(-d5, -d6, -d7); + double d8 = Math.max(MathHelper.floor_double(d7 - d), worldBorder.getStartingMinZ()); + double d9 = Math.min(MathHelper.ceiling_double_int(d7 + d), worldBorder.getStartingMaxZ()); + if (d5 > worldBorder.getStartingMaxX() - d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float) d2 * (0.04054054f * 12.333334f); + worldrenderer.pos(worldBorder.getStartingMaxX(), 256, d3).tex(f7 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(worldBorder.getStartingMaxX(), 256, d3 + d2).tex(f7 + f2 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(worldBorder.getStartingMaxX(), 0.0, d3 + d2).tex(f7 + f2 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(worldBorder.getStartingMaxX(), 0.0, d3).tex(f7 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + d3 += 1.0; + f3 += 0.16463414f * 3.0370371f; + } + } + if (d5 < worldBorder.getStartingMinX() + d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float) d2 * (0.3611111f * 1.3846154f); + worldrenderer.pos(worldBorder.getStartingMinX(), 256, d3).tex(f7 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(worldBorder.getStartingMinX(), 256, d3 + d2).tex(f7 + f2 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(worldBorder.getStartingMinX(), 0.0, d3 + d2).tex(f7 + f2 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(worldBorder.getStartingMinX(), 0.0, d3).tex(f7 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + d3 += 1.0; + f3 += 1.25f * 0.4f; + } + } + d8 = Math.max(MathHelper.floor_double(d5 - d), worldBorder.getStartingMinX()); + d9 = Math.min(MathHelper.ceiling_double_int(d5 + d), worldBorder.getStartingMaxX()); + if (d7 > worldBorder.getStartingMaxZ() - d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float) d2 * (0.3115942f * 1.6046512f); + worldrenderer.pos(d3, 256, worldBorder.getStartingMaxZ()).tex(f7 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(d3 + d2, 256, worldBorder.getStartingMaxZ()).tex(f7 + f2 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(d3 + d2, 0.0, worldBorder.getStartingMaxZ()).tex(f7 + f2 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(d3, 0.0, worldBorder.getStartingMaxZ()).tex(f7 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + d3 += 1.0; + f3 += 1.5882353f * 0.31481484f; + } + } + if (d7 < worldBorder.getStartingMinZ() + d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float) d2 * (1.6071428f * 0.31111112f); + worldrenderer.pos(d3, 256, worldBorder.getStartingMinZ()).tex(f7 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(d3 + d2, 256, worldBorder.getStartingMinZ()).tex(f7 + f2 + f3, f7 + 0.0f).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(d3 + d2, 0.0, worldBorder.getStartingMinZ()).tex(f7 + f2 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + worldrenderer.pos(d3, 0.0, worldBorder.getStartingMinZ()).tex(f7 + f3, f7 + (float) 128).color(f4, f5, f6, 1.0f).endVertex(); + d3 += 1.0; + f3 += 2.2820513f * 0.21910112f; + } + } + tessellator.draw(); + GL11.glTranslated(0.0, 0.0, 0.0); + GL11.glEnable(2884); + GL11.glDisable(3008); + GL11.glPolygonOffset(0.0f, 0.0f); + GL11.glDisable(32823); + GL11.glEnable(3008); + GL11.glDisable(3042); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + } + }); + } + } + + public void createBorder(String id, String world, int color, double minX, double minZ, double maxX, double maxZ, boolean canShrinkExpand, boolean cancelExit) { + this.borderList.add(new WorldBorder(this, id, world, color, minX, minZ, maxX, maxZ, canShrinkExpand, cancelExit)); + } + + public void updateBorder(String id, double minX, double minZ, double maxX, double maxZ, int durationTick) { + this.borderList.stream().filter(worldBorder -> Objects.equals(WorldBorder.getId(worldBorder), id) + && WorldBorder.canShrinkExpand(worldBorder)).findFirst().ifPresent(worldBorder -> { + WorldBorder.setNewMin(worldBorder, new Vec2d(minX, minZ)); + WorldBorder.setNewMax(worldBorder, new Vec2d(maxX, maxZ)); + WorldBorder.setMoveTicks(worldBorder, 0); + WorldBorder.setDurationTicks(worldBorder, durationTick); + }); + } + + public void removeBorder(String string) { + this.borderList.removeIf(worldBorder -> Objects.equals(WorldBorder.getId(worldBorder), string)); + } + + public void clearBorders() { + this.borderList.clear(); + } + + public List getBorders() { + return this.borderList; + } + + static CheatBreaker getCheatBreaker(WorldBorderManager worldBorderManager) { + return worldBorderManager.cb; + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/sessionserver/SessionServer.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/sessionserver/SessionServer.java new file mode 100644 index 0000000..9cbd85f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/sessionserver/SessionServer.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.util.sessionserver; + +import lombok.Getter; +import lombok.Setter; + +/** + * Used to define what a Session Server is for CheatBreaker. + */ +@Getter +public class SessionServer { + private final String name; + private final String url; + @Setter private StatusColor status = StatusColor.UNKNOWN; + + public SessionServer(String name, String url) { + this.name = name; + this.url = url; + } + + public enum StatusColor { + UP("green"), + DOWN("red"), + BUSY("yellow"), + UNKNOWN("unknown"); + + private final String color; + + public String getIdentifier() { + return this.color; + } + + StatusColor(final String color) { + this.color = color; + } + + public static StatusColor getStatusByName(String string) { + for (StatusColor status : StatusColor.values()) { + if (!status.getIdentifier().equalsIgnoreCase(string)) continue; + return status; + } + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/AliasesThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/AliasesThread.java new file mode 100644 index 0000000..9403230 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/AliasesThread.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.util.thread; + +import com.cheatbreaker.client.ui.element.AliasesElement; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.util.EnumChatFormatting; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Collections; +import java.util.Map; + +/** + * Used to get all past names of a player. + */ +public class AliasesThread extends Thread { + private final AliasesElement aliasesElement; + private final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); + + public AliasesThread(AliasesElement aliasesElement) { + this.aliasesElement = aliasesElement; + } + + @Override + public void run() { + try { + URL uRL = new URL("https://api.mojang.com/user/profiles/" + + this.aliasesElement.getFriend().getPlayerId().replaceAll("-", "") + "/names"); + URLConnection uRLConnection = uRL.openConnection(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream())); + String string = bufferedReader.readLine(); + JsonParser jsonParser = new JsonParser(); + JsonElement jsonElement = jsonParser.parse("{\"Names\": " + string + "}"); + for (Map.Entry entry : jsonElement.getAsJsonObject().entrySet()) { + if (!entry.getKey().equalsIgnoreCase("Names")) continue; + for (JsonElement jsonElement2 : entry.getValue().getAsJsonArray()) { + String string2 = jsonElement2.getAsJsonObject().get("name").getAsString(); + if (jsonElement2.getAsJsonObject().has("changedToAt")) { + long l = jsonElement2.getAsJsonObject().get("changedToAt").getAsLong(); + LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(l), ZoneId.systemDefault()); + this.aliasesElement.getAliases().add(EnumChatFormatting.GRAY + localDateTime.format(this.dateFormatter) + EnumChatFormatting.RESET + " " + string2); + continue; + } + this.aliasesElement.getAliases().add(string2); + } + } + Collections.reverse(this.aliasesElement.getAliases()); + this.aliasesElement.setElementSize(this.aliasesElement.getXPosition(), this.aliasesElement.getYPosition(), + this.aliasesElement.getWidth(), this.aliasesElement.getHeight() + + (float) (this.aliasesElement.getAliases().size() * 10) - (float) 10); + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/AssetServerReconnectThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/AssetServerReconnectThread.java new file mode 100644 index 0000000..6fda47f --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/AssetServerReconnectThread.java @@ -0,0 +1,18 @@ +package com.cheatbreaker.client.util.thread; + +import com.cheatbreaker.client.CheatBreaker; + +import java.net.URISyntaxException; + +public class AssetServerReconnectThread extends Thread { + + @Override + public void run() { + try { + Thread.sleep(25000L); + CheatBreaker.getInstance().connectToAssetServer(); + } catch (InterruptedException | URISyntaxException exception) { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/LoginThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/LoginThread.java new file mode 100644 index 0000000..c036277 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/LoginThread.java @@ -0,0 +1,78 @@ +package com.cheatbreaker.client.util.thread; + + +import com.mojang.authlib.Agent; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; + +import java.net.Proxy; + +/** + * Minecraft Login Thread. + */ +@Getter @Setter +public class LoginThread extends Thread { + + private String password; + private String username; + + private Minecraft mc; + public boolean loggedIn; + public boolean playSound = false; + + public LoginThread() { + this.mc = Minecraft.getMinecraft(); + loggedIn = false; + } + + public LoginThread(String username, String password) { + super("Alt Login Thread"); + this.mc = Minecraft.getMinecraft(); + this.username = username; + this.password = password; + loggedIn = false; + } + + public LoginThread(String alt) { + super("Alt Login Thread"); + this.mc = Minecraft.getMinecraft(); + this.username = alt.split(":")[0]; + this.password = alt.split(":")[1]; + loggedIn = false; + } + + public Session createSession(String username, String password) { + YggdrasilAuthenticationService service = new YggdrasilAuthenticationService(Proxy.NO_PROXY, ""); + YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) service.createUserAuthentication(Agent.MINECRAFT); + auth.setUsername(username); + auth.setPassword(password); + try { + auth.logIn(); + loggedIn = true; + return new Session(auth.getSelectedProfile().getName(), auth.getSelectedProfile().getId().toString(), auth.getAuthenticatedToken(), "mojang"); + } catch (com.mojang.authlib.exceptions.AuthenticationException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void run() { + if (this.password == null || this.password.equals("")) { + this.mc.setSession(new Session(this.username, "", "", "mojang")); + loggedIn = true; + return; + } + Session auth = createSession(this.username, this.password); + if (auth == null) { + loggedIn = false; + } else { + this.mc.setSession(auth); + loggedIn = true; + } + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/ServerStatusThread.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/ServerStatusThread.java new file mode 100644 index 0000000..195aeb6 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/thread/ServerStatusThread.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.util.thread; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.util.sessionserver.SessionServer; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.client.Minecraft; +import net.minecraft.util.EnumChatFormatting; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +/** + * Used to check if the Mojang status is good or not. + * This will be displayed in the pause menu and in a com.cheatbreaker.client.module.impl.normal.hud.Notification. + */ +public class ServerStatusThread extends Thread { + + @Override + public void run() { + try { + URLConnection uRLConnection = new URL(CheatBreaker.getInstance().getGlobalSettings().mojangStatusURL).openConnection(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream())); + JsonArray jsonArray = new JsonParser().parse(bufferedReader).getAsJsonArray(); + + for (int i = 0; i < jsonArray.size(); ++i) { + JsonElement jsonElement2 = jsonArray.get(i); + for (Map.Entry entry : jsonElement2.getAsJsonObject().entrySet()) { + for (SessionServer sessionServer : CheatBreaker.getInstance().sessionServers) { + SessionServer.StatusColor sessionServerStatusColor; + if (!sessionServer.getUrl().equalsIgnoreCase(entry.getKey()) || (sessionServerStatusColor = SessionServer.StatusColor.getStatusByName(entry.getValue().getAsString())) == null) + continue; + if (sessionServerStatusColor != sessionServer.getStatus() && sessionServer.getStatus() != + SessionServer.StatusColor.UNKNOWN && sessionServer.getStatus() != SessionServer.StatusColor.BUSY && + (sessionServerStatusColor == SessionServer.StatusColor.DOWN || sessionServerStatusColor == SessionServer.StatusColor.UP)) { + + EnumChatFormatting enumChatFormatting = sessionServerStatusColor == SessionServer.StatusColor.UP ? EnumChatFormatting.GREEN : EnumChatFormatting.RED; + + String string = sessionServerStatusColor == SessionServer.StatusColor.UP ? "online" : "offline"; + if (Minecraft.getMinecraft().theWorld != null) { + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("info", "Minecraft " + + EnumChatFormatting.AQUA + sessionServer.getName() + + EnumChatFormatting.RESET + " server is now " + + enumChatFormatting + string + EnumChatFormatting.RESET + ".", 7500L); + } + } + sessionServer.setStatus(sessionServerStatusColor); + } + } + } + + bufferedReader.close(); + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/ModuleVoiceChat.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/ModuleVoiceChat.java new file mode 100644 index 0000000..45b640d --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/ModuleVoiceChat.java @@ -0,0 +1,113 @@ +package com.cheatbreaker.client.util.voicechat; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.voicechat.data.VoiceUser; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +public class ModuleVoiceChat { + Minecraft mc = Minecraft.getMinecraft(); + CheatBreaker cb = CheatBreaker.getInstance(); + private final ResourceLocation microphone = new ResourceLocation("client/icons/microphone-64.png"); + private final Map users = new HashMap(); + private boolean talking; + + public ModuleVoiceChat() { + CheatBreaker.getInstance().getEventBus().addEvent(GuiDrawEvent.class, this::onGuiDraw); + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + } + + public void updateUser(UUID uUID) { + VoiceUser voiceUser = this.cb.getCBNetHandler().getVoiceUser(uUID); + if (voiceUser != null) { + this.users.put(voiceUser, System.currentTimeMillis() + 250L); + } + } + + public void onGuiDraw(GuiDrawEvent event) { + if (this.cb.getCBNetHandler().isVoiceChatEnabled() && this.cb.getCBNetHandler().getVoiceChannels() != null && (!this.users.isEmpty() || this.talking)) { + float spacing = 20; + float width = (float) event.getScaledResolution().getScaledWidth_double() - (float) 120; + float[] height = new float[]{10}; + if (this.talking) { + this.renderHead(this.mc.thePlayer.getName(), + this.mc.getSession().getPlayerID(), width, height[0], true); + height[0] = height[0] + spacing; + } + this.users.forEach((voiceUser, l) -> { + this.renderHead(voiceUser.getPlayerName(), voiceUser.getPlayerUUID().toString(), width, height[0], false); + height[0] = height[0] + spacing; + }); + } + } + + private void renderHead(String name, String uuid, float width, float height, boolean self) { + if (self) { + RenderUtil.drawGradientRectWithOutline(width, height, width + (float) 110, height + (float) 18, -11493284, -10176146, -11164318); + } else { + RenderUtil.drawGradientRectWithOutline(width, height, width + (float) 110, height + (float) 18, -1356454362, -1355664846, -1356191190); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(name); + RenderUtil.renderIcon(resourceLocation, 7.0F, width + 2.0f, height + 2.0f); + this.cb.playRegular16px.drawString(name, width + (float) 22, height + (float) 4, -1); + } + + public void onTick(TickEvent tickEvent) { + if (!this.users.isEmpty()) { + ArrayList arrayList = new ArrayList<>(); + for (Map.Entry entry : this.users.entrySet()) { + if (System.currentTimeMillis() - (Long) entry.getValue() < 0L) continue; + arrayList.add(entry.getKey()); + } + arrayList.forEach(voiceUser -> { + Long cfr_ignored_0 = (Long) this.users.remove(voiceUser); + }); + } +// if (!this.cb.getCBNetHandler().isVoiceChatEnabled() && this.cb.getCBNetHandler().getVoiceChannels() != null) { +// return; +// } + /*if (this.talking && !this.mc.inGameHasFocus) { + this.talking = false; + try { + Message.e(false); + } catch (UnsatisfiedLinkError unsatisfiedLinkError) { + + } + CheatBreaker.getInstance().getAudioManager().sendSound("voice_up"); + } + if (!this.talking && this.mc.inGameHasFocus && this.isButtonDown(this.cb.getGlobalSettings().keyBindVoicePushToTalk.getKeyCode())) { + this.talking = true; + try { + Message.e(true); + } catch (UnsatisfiedLinkError unsatisfiedLinkError) { + + } + CheatBreaker.getInstance().getAudioManager().sendSound("voice_down"); + } else if (this.talking && this.mc.inGameHasFocus && + !this.isButtonDown(this.cb.getGlobalSettings().keyBindVoicePushToTalk.getKeyCode())) { + this.talking = false; + try { + Message.e(false); + } catch (UnsatisfiedLinkError unsatisfiedLinkError) { + + } + CheatBreaker.getInstance().getAudioManager().sendSound("voice_up"); + }*/ + } + + private boolean isButtonDown(int n) { + return n != 0 && (n < 0 ? Mouse.isButtonDown(n + 100) : Keyboard.isKeyDown(n)); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/data/VoiceChannel.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/data/VoiceChannel.java new file mode 100644 index 0000000..6806646 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/data/VoiceChannel.java @@ -0,0 +1,48 @@ +package com.cheatbreaker.client.util.voicechat.data; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.EnumChatFormatting; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@AllArgsConstructor +@Getter +public class VoiceChannel { + private final UUID uuid; + private final String name; + private final List users = new ArrayList(); + private final List listeners = new ArrayList(); + + public VoiceUser createUser(UUID uuid, String name) { + VoiceUser user = new VoiceUser(uuid, EnumChatFormatting.getTextWithoutFormattingCodes(name)); + if (!this.isUser(uuid)) { + this.users.add(user); + } + return user; + } + + public boolean removeUser(UUID var1) { + return this.users.removeIf(var1x -> var1x.getPlayerUUID().equals(var1)); + } + + public void addListener(UUID uuid, String name) { + if (this.isUser(uuid)) { + this.listeners.add(uuid); + } + } + + public boolean removeListeners(UUID uuid) { + return this.listeners.removeIf(var1x -> var1x.equals(uuid)); + } + + public boolean isListener(UUID uuid) { + return this.listeners.stream().anyMatch(var1x -> var1x.equals(uuid)); + } + + public boolean isUser(UUID var1) { + return this.users.stream().anyMatch(var1x -> var1x.getPlayerUUID().equals(var1)); + } +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/data/VoiceUser.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/data/VoiceUser.java new file mode 100644 index 0000000..acfe5c2 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/data/VoiceUser.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.util.voicechat.data; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.UUID; + +@AllArgsConstructor +@Getter +public class VoiceUser { + private UUID playerUUID; + private String playerName; +} diff --git a/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/ui/VoiceMenu.java b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/ui/VoiceMenu.java new file mode 100644 index 0000000..027d227 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/cheatbreaker/client/util/voicechat/ui/VoiceMenu.java @@ -0,0 +1,234 @@ +package com.cheatbreaker.client.util.voicechat.ui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceChannelSwitch; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.voicechat.data.VoiceChannel; +import com.cheatbreaker.client.util.voicechat.data.VoiceUser; +import com.google.common.collect.Lists; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; + +public class VoiceMenu extends AbstractGui { + private static final CheatBreaker cheatbreaker = CheatBreaker.getInstance(); + private List voiceChannelButtons; + private GradientTextButton joinChannelButton; + private GradientTextButton deafenButton; + private VoiceChannel currentVoiceChannel = null; + private final ResourceLocation headphoneIcon = new ResourceLocation("client/icons/headphones.png"); + private final ResourceLocation speakerIcon = new ResourceLocation("client/icons/speaker.png"); + private final ResourceLocation speaker_muteIcon = new ResourceLocation("client/icons/speaker-mute.png"); + private final ResourceLocation mircophoneIcon = new ResourceLocation("client/icons/microphone-64.png"); + + @Override + public void initGui() { + this.blurGui(); + if (cheatbreaker.getCBNetHandler().isVoiceChatEnabled() && cheatbreaker.getCBNetHandler().getVoiceChannels() != null) { + this.currentVoiceChannel = cheatbreaker.getCBNetHandler().getCurrentVoiceChannel(); + boolean var1 = cheatbreaker.getCBNetHandler().getPlayersInVoiceChannel().contains(this.mc.thePlayer.getGameProfile().getId()); + this.joinChannelButton = new GradientTextButton("Join Channel"); + this.deafenButton = new GradientTextButton(var1 ? "Un-deafen" : "Deafen"); + this.voiceChannelButtons = new ArrayList<>(); + float var2 = 16.0f; + float var3 = this.getScaledWidth() / 8.0f; + float var4 = this.getScaledHeight() / 2.0f - 8.0f - var2 * (float) cheatbreaker.getCBNetHandler().getVoiceChannels().size() / 2.0f; + int var5 = 0; + for (VoiceChannel var7 : cheatbreaker.getCBNetHandler().getVoiceChannels()) { + GradientTextButton var8 = new GradientTextButton(var7.getName()); + this.voiceChannelButtons.add(var8); + var8.setElementSize(var3, var4 + 12.0f + var2 * (float) var5, 110.0f, 12.0f); + if (this.currentVoiceChannel == var7) { + var8.buttonColor2(); + } + ++var5; + } + } + } + + @Override + public void onGuiClosed() { + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void drawMenu(float var1, float var2) { + this.renderBlur(this.getScaledWidth(), this.getScaledHeight()); + float var3 = this.getScaledWidth() / 8.0f; + if (cheatbreaker.getCBNetHandler().isVoiceChatEnabled() && cheatbreaker.getCBNetHandler().getVoiceChannels() != null) { + float var4 = 16.0f; + float var5 = this.getScaledHeight() / 2.0f - 8.0f - var4 * (float) cheatbreaker.getCBNetHandler().getVoiceChannels().size() / 2.0f; + VoiceMenu.cheatbreaker.playBold18px.drawString("VOICE CHAT", var3, var5 - 4.0f, -1); + this.deafenButton.setElementSize(var3 + 60.0f, var5 - 4.0f, 50.0f, 12.0f); + this.deafenButton.drawElementHover(var1, var2, true); + this.voiceChannelButtons.forEach(buttons -> { + if (this.getVoiceChannel(buttons.getString()) == cheatbreaker.getCBNetHandler().getCurrentVoiceChannel()) { + buttons.drawElement(var1, var2, true); + RenderUtil.renderIcon(new ResourceLocation("client/icons/microphone-64.png"), buttons.getXPosition() + 4.0f, + buttons.getYPosition() + 2.0f, 8.0f, 8.0f); + } else if (this.currentVoiceChannel != null && this.currentVoiceChannel.getName().equals(buttons.getString())) { + buttons.drawElement(var1, var2, true); + } else { + buttons.drawElementHover(var1, var2, true); + } + }); + if (this.currentVoiceChannel != null) { + this.drawCurrentChannel(var1, var2, var3 + 130.0f, this.getScaledHeight() / 2.0f); + } + } else { + float var4 = this.getScaledHeight() / 2.0f - 8.0f; + VoiceMenu.cheatbreaker.playBold18px.drawString("VOICE CHAT IS NOT SUPPORTED", var3, var4, -1); + } + } + + @Override + protected void mouseClicked(float var1, float var2, int var3) { + if (this.voiceChannelButtons != null) { + Iterator var4 = this.voiceChannelButtons.iterator(); + while (true) { + VoiceChannel var6; + GradientTextButton button; + if (!var4.hasNext()) { + if (this.currentVoiceChannel != null) { + if (this.joinChannelButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + cheatbreaker.getCBNetHandler().sendPacket(new PacketVoiceChannelSwitch(this.currentVoiceChannel.getUuid())); + for (GradientTextButton var52 : this.voiceChannelButtons) { + var52.buttonColor3(); + } + for (GradientTextButton var52 : this.voiceChannelButtons) { + if (!var52.getString().equals(this.currentVoiceChannel.getName())) continue; + var52.buttonColor2(); + } + } + if (this.deafenButton.isMouseInside(var1, var2)) { + UUID var9 = this.mc.thePlayer.getGameProfile().getId(); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + cheatbreaker.getCBNetHandler().sendPacket(new PacketVoiceMute(var9)); + if (!cheatbreaker.getCBNetHandler().getPlayersInVoiceChannel().removeIf(var1x -> var1x.equals(var9))) { + cheatbreaker.getCBNetHandler().getPlayersInVoiceChannel().add(var9); + } + this.deafenButton.setString(cheatbreaker.getCBNetHandler().getPlayersInVoiceChannel().contains(this.mc.thePlayer.getGameProfile().getId()) ? "Un-deafen" : "Deafen"); + } + this.handleMouseClick(var1, var2, this.getScaledWidth() / 8.0f + 130.0f, this.getScaledHeight() / 2.0f); + } + return; + } + button = var4.next(); + if (!button.isMouseInside(var1, var2) || this.currentVoiceChannel == (var6 = this.getVoiceChannel(button.getString()))) + continue; + for (GradientTextButton var8 : this.voiceChannelButtons) { + if (this.currentVoiceChannel == cheatbreaker.getCBNetHandler().getCurrentVoiceChannel() || !var8.getString().equals(this.currentVoiceChannel.getName())) + continue; + var8.buttonColor3(); + } + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + this.currentVoiceChannel = var6; + if (this.currentVoiceChannel == cheatbreaker.getCBNetHandler().getCurrentVoiceChannel()) continue; + button.buttonColor1(); + } + } + } + + @Override + public void mouseMovedOrUp(float var1, float var2, int var3) { + } + + private void drawCurrentChannel(float var1, float var2, float var3, float var4) { + float var5 = 14.0f; + float var6 = (float) this.currentVoiceChannel.getUsers().size() * var5; + VoiceMenu.cheatbreaker.playBold18px.drawString(this.currentVoiceChannel.getName(), var3, (var4 -= var6 / 2.0f) - 14.0f, -1); + if (!this.isInServerSetChannel()) { + this.joinChannelButton.setElementSize(var3 + 125.0f, var4 - 14.0f, 50.0f, 12.0f); + this.joinChannelButton.drawElementHover(var1, var2, true); + } + Gui.drawRect(var3, var4, var3 + 175.0f, var4 + var6, -1626337264); + int userIndex = 0; + ArrayList listeners = Lists.newArrayList(this.currentVoiceChannel.getUsers()); + listeners.sort((var1x, var2x) -> { + if (this.currentVoiceChannel.isListener(var1x.getPlayerUUID()) && !this.currentVoiceChannel.isListener(var2x.getPlayerUUID())) { + return -1; + } + return !this.currentVoiceChannel.isListener(var1x.getPlayerUUID()) && this.currentVoiceChannel.isListener(var2x.getPlayerUUID()) ? 1 : 0; + }); + for (VoiceUser users : listeners) { + boolean listener = this.currentVoiceChannel.isListener(users.getPlayerUUID()); + boolean isUser = cheatbreaker.getCBNetHandler().getPlayersInVoiceChannel().contains(users.getPlayerUUID()); + float var13 = var4 + (float) userIndex * var5; + boolean var15 = var1 > var3 + 158.0f && var1 < var3 + 184.0f && var2 > var13 && var2 < var13 + var5; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + if (!listener) { + RenderUtil.renderIcon(this.headphoneIcon, var3 + 4.0f, var13 + 3.0f, 8.0f, 8.0f); + } else { + RenderUtil.renderIcon(this.mircophoneIcon, var3 + 4.0f, var13 + 3.0f, 8.0f, 8.0f); + } + float var14 = var3 + 10.0f; + if (!users.getPlayerUUID().equals(this.mc.thePlayer.getUniqueID())) { + if (isUser) { + GL11.glColor4f(1.0f, 0.1f, 0.1f, var15 ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.speaker_muteIcon, var3 + 162.0f, var13 + 3.0f, 8.0f, 8.0f); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, var15 ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.speakerIcon, var3 + 162.0f, var13 + 3.0f, 8.0f, 8.0f); + } + } + VoiceMenu.cheatbreaker.ubuntuMedium16px.drawString(users.getPlayerName().toUpperCase(), var14 + 6.0f, var13 + 2.0f, listener ? -1 : 0x6FFFFFFF); + ++userIndex; + } + } + + private void handleMouseClick(float var1, float var2, float var3, float var4) { + float var5 = 14.0f; + float var6 = (float) this.currentVoiceChannel.getUsers().size() * var5; + var4 -= var6 / 2.0f; + int var7 = 0; + for (VoiceUser listener : this.currentVoiceChannel.getUsers()) { + float var10 = var4 + (float) var7 * var5; + boolean var11 = var1 > var3 + 158.0f && var1 < var3 + 184.0f && var2 > var10 && var2 < var10 + var5; + if (!listener.getPlayerUUID().equals(this.mc.thePlayer.getUniqueID()) && var11) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0f)); + cheatbreaker.getCBNetHandler().sendPacket(new PacketVoiceMute(listener.getPlayerUUID())); + if (!cheatbreaker.getCBNetHandler().getPlayersInVoiceChannel().removeIf(var1x -> var1x.equals(listener.getPlayerUUID()))) { + cheatbreaker.getCBNetHandler().getPlayersInVoiceChannel().add(listener.getPlayerUUID()); + } + } + ++var7; + } + } + + @Override + public void keyTyped(char var1, int var2) throws IOException { + super.keyTyped(var1, var2); + if (var2 == 25 && blurColor.isOver()) { + if ((Boolean) VoiceMenu.cheatbreaker.getGlobalSettings().guiBlur.getValue()) { + this.mc.entityRenderer.stopUseShader(); + } + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + } + } + + private VoiceChannel getVoiceChannel(String name) { + VoiceChannel voiceChannel; + Iterator channelIterator = cheatbreaker.getCBNetHandler().getVoiceChannels().iterator(); + do { + if (channelIterator.hasNext()) continue; + return null; + } while (!(voiceChannel = channelIterator.next()).getName().equals(name)); + return voiceChannel; + } + + private boolean isInServerSetChannel() { + return this.currentVoiceChannel == cheatbreaker.getCBNetHandler().getCurrentVoiceChannel(); + } +} diff --git a/Client-1.8.9/src/main/java/com/sun/javafx/geom/Vec2d.java b/Client-1.8.9/src/main/java/com/sun/javafx/geom/Vec2d.java new file mode 100644 index 0000000..87501a4 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/sun/javafx/geom/Vec2d.java @@ -0,0 +1,95 @@ +package com.sun.javafx.geom; + +public class Vec2d { + public double x; + public double y; + + public Vec2d() { + } + + public Vec2d(double x, double y) { + this.x = x; + this.y = y; + } + + public Vec2d(Vec2d v) { + this.set(v); + } + + public Vec2d(Vec2f v) { + this.set(v); + } + + public void set(Vec2d v) { + this.x = v.x; + this.y = v.y; + } + + public void set(Vec2f v) { + this.x = v.x; + this.y = v.y; + } + + public void set(double x, double y) { + this.x = x; + this.y = y; + } + + public static double distanceSq(double x1, double y1, double x2, double y2) { + x1 -= x2; + y1 -= y2; + return x1 * x1 + y1 * y1; + } + + public static double distance(double x1, double y1, double x2, double y2) { + x1 -= x2; + y1 -= y2; + return Math.sqrt(x1 * x1 + y1 * y1); + } + + public double distanceSq(double vx, double vy) { + vx -= this.x; + vy -= this.y; + return vx * vx + vy * vy; + } + + public double distanceSq(Vec2d v) { + double vx = v.x - this.x; + double vy = v.y - this.y; + return vx * vx + vy * vy; + } + + public double distance(double vx, double vy) { + vx -= this.x; + vy -= this.y; + return Math.sqrt(vx * vx + vy * vy); + } + + public double distance(Vec2d v) { + double vx = v.x - this.x; + double vy = v.y - this.y; + return Math.sqrt(vx * vx + vy * vy); + } + + public int hashCode() { + long bits = 7L; + bits = 31L * bits + Double.doubleToLongBits(this.x); + bits = 31L * bits + Double.doubleToLongBits(this.y); + return (int)(bits ^ bits >> 32); + } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (!(obj instanceof Vec2d)) { + return false; + } else { + Vec2d v = (Vec2d)obj; + return this.x == v.x && this.y == v.y; + } + } + + public String toString() { + return "Vec2d[" + this.x + ", " + this.y + "]"; + } +} diff --git a/Client-1.8.9/src/main/java/com/sun/javafx/geom/Vec2f.java b/Client-1.8.9/src/main/java/com/sun/javafx/geom/Vec2f.java new file mode 100644 index 0000000..15c32e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/com/sun/javafx/geom/Vec2f.java @@ -0,0 +1,87 @@ +package com.sun.javafx.geom; + +public class Vec2f { + public float x; + public float y; + + public Vec2f() { + } + + public Vec2f(float x, float y) { + this.x = x; + this.y = y; + } + + public Vec2f(Vec2f v) { + this.x = v.x; + this.y = v.y; + } + + public void set(Vec2f v) { + this.x = v.x; + this.y = v.y; + } + + public void set(float x, float y) { + this.x = x; + this.y = y; + } + + public static float distanceSq(float x1, float y1, float x2, float y2) { + x1 -= x2; + y1 -= y2; + return x1 * x1 + y1 * y1; + } + + public static float distance(float x1, float y1, float x2, float y2) { + x1 -= x2; + y1 -= y2; + return (float)Math.sqrt(x1 * x1 + y1 * y1); + } + + public float distanceSq(float vx, float vy) { + vx -= this.x; + vy -= this.y; + return vx * vx + vy * vy; + } + + public float distanceSq(Vec2f v) { + float vx = v.x - this.x; + float vy = v.y - this.y; + return vx * vx + vy * vy; + } + + public float distance(float vx, float vy) { + vx -= this.x; + vy -= this.y; + return (float)Math.sqrt(vx * vx + vy * vy); + } + + public float distance(Vec2f v) { + float vx = v.x - this.x; + float vy = v.y - this.y; + return (float)Math.sqrt(vx * vx + vy * vy); + } + + public int hashCode() { + int bitss = 7; + int bits = 31 * bitss + Float.floatToIntBits(this.x); + bits = 31 * bits + Float.floatToIntBits(this.y); + return bits; + } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (!(obj instanceof Vec2f)) { + return false; + } else { + Vec2f v = (Vec2f)obj; + return this.x == v.x && this.y == v.y; + } + } + + public String toString() { + return "Vec2f[" + this.x + ", " + this.y + "]"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/MinecraftMovementInputHelper.java b/Client-1.8.9/src/main/java/net/minecraft/MinecraftMovementInputHelper.java new file mode 100644 index 0000000..c509bd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/MinecraftMovementInputHelper.java @@ -0,0 +1,135 @@ +package net.minecraft; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.hud.simple.module.SimpleModuleToggleSprint; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.MovementInputFromOptions; + +import java.text.DecimalFormat; + +public class MinecraftMovementInputHelper extends MovementInputFromOptions { + public static boolean isToggleSprintAllowed; + public static boolean lIIIIIIIIIlIllIIllIlIIlIl; + public static boolean isSprinting = true; + public static boolean superSusBoolean = false; + public static boolean aSusBoolean = false; + private static long someTiming; + private static long llIIlllIIIIlllIllIlIlllIl; + private static boolean someToggleSneakBoolean; + private static boolean IIIlllIIIllIllIlIIIIIIlII; + private static boolean isPlayerRiding; + private static boolean IIIlIIllllIIllllllIlIIIll; + private static boolean shouldBeSprinting; + public static String toggleSprintString = ""; + + public MinecraftMovementInputHelper(GameSettings gameSettings) { + super(gameSettings); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Minecraft minecraft, MovementInputFromOptions movementInputFromOptions, EntityPlayerSP entityPlayerSP) { + movementInputFromOptions.moveStrafe = 0.0f; + movementInputFromOptions.moveForward = 0.0f; + GameSettings gameSettings = minecraft.gameSettings; + if (gameSettings.keyBindForward.isKeyDown()) { + movementInputFromOptions.moveForward += 1.0f; + } + if (gameSettings.keyBindBack.isKeyDown()) { + movementInputFromOptions.moveForward -= 1.0f; + } + if (gameSettings.keyBindLeft.isKeyDown()) { + movementInputFromOptions.moveStrafe += 1.0f; + } + if (gameSettings.keyBindRight.isKeyDown()) { + movementInputFromOptions.moveStrafe -= 1.0f; + } + if (entityPlayerSP.isRiding() && !IIIlIIllllIIllllllIlIIIll) { + IIIlIIllllIIllllllIlIIIll = true; + shouldBeSprinting = isSprinting; + } else if (IIIlIIllllIIllllllIlIIIll && !entityPlayerSP.isRiding()) { + IIIlIIllllIIllllllIlIIIll = false; + if (shouldBeSprinting && !isSprinting) { + isSprinting = true; + llIIlllIIIIlllIllIlIlllIl = System.currentTimeMillis(); + IIIlllIIIllIllIlIIIIIIlII = true; + superSusBoolean = false; + } + } + movementInputFromOptions.jump = gameSettings.keyBindJump.isKeyDown(); + if ((Boolean) SimpleModuleToggleSprint.toggleSneak.getValue() && CheatBreaker.getInstance().getModuleManager().toggleSprintMod.isEnabled()) { + if (gameSettings.keyBindSneak.isKeyDown() && !someToggleSneakBoolean) { + if (entityPlayerSP.isRiding() || entityPlayerSP.capabilities.isFlying) { + movementInputFromOptions.sneak = true; + isPlayerRiding = entityPlayerSP.isRiding(); + } else { + movementInputFromOptions.sneak = !movementInputFromOptions.sneak; + } + someTiming = System.currentTimeMillis(); + someToggleSneakBoolean = true; + } + if (!gameSettings.keyBindSneak.isKeyDown() && someToggleSneakBoolean) { + if (entityPlayerSP.capabilities.isFlying || isPlayerRiding) { + movementInputFromOptions.sneak = false; + } else if (System.currentTimeMillis() - someTiming > 300L) { + movementInputFromOptions.sneak = false; + } + someToggleSneakBoolean = false; + } + } else { + movementInputFromOptions.sneak = gameSettings.keyBindSneak.isKeyDown(); + } + if (movementInputFromOptions.sneak) { + movementInputFromOptions.moveStrafe = (float)((double)movementInputFromOptions.moveStrafe * ((double)1.7f * 0.17647058328542756)); + movementInputFromOptions.moveForward = (float)((double)movementInputFromOptions.moveForward * (0.19999999999999998 * 1.5)); + } + boolean bl = (float)entityPlayerSP.getFoodStats().getFoodLevel() > (float)6 || entityPlayerSP.capabilities.isFlying; + boolean bl2 = !movementInputFromOptions.sneak && !entityPlayerSP.capabilities.isFlying && bl; + isToggleSprintAllowed = !((Boolean) SimpleModuleToggleSprint.toggleSprint.getValue()); + lIIIIIIIIIlIllIIllIlIIlIl = (Boolean) SimpleModuleToggleSprint.doubleTap.getValue(); + if ((bl2 || isToggleSprintAllowed) && gameSettings.keyBindSprint.isKeyDown() && !IIIlllIIIllIllIlIIIIIIlII && !entityPlayerSP.capabilities.isFlying && !isToggleSprintAllowed) { + isSprinting = !isSprinting; + llIIlllIIIIlllIllIlIlllIl = System.currentTimeMillis(); + IIIlllIIIllIllIlIIIIIIlII = true; + superSusBoolean = false; + } + if ((bl2 || isToggleSprintAllowed) && !gameSettings.keyBindSprint.isKeyDown() && IIIlllIIIllIllIlIIIIIIlII) { + if (System.currentTimeMillis() - llIIlllIIIIlllIllIlIlllIl > 300L) { + superSusBoolean = true; + } + IIIlllIIIllIllIlIIIIIIlII = false; + } + MinecraftMovementInputHelper.lIIIIlIIllIIlIIlIIIlIIllI(movementInputFromOptions, entityPlayerSP, gameSettings); + } + + public void setSprintState(boolean bl, boolean bl2) { + isSprinting = bl; + aSusBoolean = bl2; + } + + private static void lIIIIlIIllIIlIIlIIIlIIllI(MovementInputFromOptions movementInputFromOptions, EntityPlayerSP entityPlayerSP, GameSettings gameSettings) { +// toggleSprintString = ""; + String string = ""; + boolean flying = entityPlayerSP.capabilities.isFlying; + boolean riding = entityPlayerSP.isRiding(); + boolean sneakHeld = gameSettings.keyBindSneak.isKeyDown(); + boolean sprintHeld = gameSettings.keyBindSprint.isKeyDown(); + if (flying) { + DecimalFormat decimalFormat = new DecimalFormat("#.00"); + string = (Boolean) SimpleModuleToggleSprint.flyBoost.getValue() && sprintHeld && entityPlayerSP.capabilities.isCreativeMode ? string + ((String)CheatBreaker.getInstance().getModuleManager().toggleSprintMod.flyBoostString.getValue()).replaceAll("%BOOST%", decimalFormat.format(SimpleModuleToggleSprint.flyBoostAmount.getValue())) : string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.flyString.getValue(); + } + if (riding) { + string = string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.ridingString.getValue(); + } + if (movementInputFromOptions.sneak) { + string = flying ? CheatBreaker.getInstance().getModuleManager().toggleSprintMod.decendString.getValue().toString() : + (riding ? CheatBreaker.getInstance().getModuleManager().toggleSprintMod.dismountString.getValue().toString() : + (sneakHeld ? string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sneakHeldString.getValue() : + string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sneakToggledString.getValue())); + } else if (isSprinting && !flying && !riding) { + boolean bl5 = superSusBoolean || isToggleSprintAllowed || aSusBoolean; + string = sprintHeld ? string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sprintHeldString.getValue() : (bl5 ? string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sprintVanillaString.getValue() : string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sprintToggledString.getValue()); + } + toggleSprintString = string; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/Block.java b/Client-1.8.9/src/main/java/net/minecraft/block/Block.java new file mode 100644 index 0000000..14ed377 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/Block.java @@ -0,0 +1,1298 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ObjectIntIdentityMap; +import net.minecraft.util.RegistryNamespacedDefaultedByKey; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class Block +{ + private static final ResourceLocation AIR_ID = new ResourceLocation("air"); + public static final RegistryNamespacedDefaultedByKey blockRegistry = new RegistryNamespacedDefaultedByKey(AIR_ID); + public static final ObjectIntIdentityMap BLOCK_STATE_IDS = new ObjectIntIdentityMap(); + private CreativeTabs displayOnCreativeTab; + public static final Block.SoundType soundTypeStone = new Block.SoundType("stone", 1.0F, 1.0F); + public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F); + public static final Block.SoundType soundTypeGravel = new Block.SoundType("gravel", 1.0F, 1.0F); + public static final Block.SoundType soundTypeGrass = new Block.SoundType("grass", 1.0F, 1.0F); + public static final Block.SoundType soundTypePiston = new Block.SoundType("stone", 1.0F, 1.0F); + public static final Block.SoundType soundTypeMetal = new Block.SoundType("stone", 1.0F, 1.5F); + public static final Block.SoundType soundTypeGlass = new Block.SoundType("stone", 1.0F, 1.0F) + { + public String getBreakSound() + { + return "dig.glass"; + } + public String getPlaceSound() + { + return "step.stone"; + } + }; + public static final Block.SoundType soundTypeCloth = new Block.SoundType("cloth", 1.0F, 1.0F); + public static final Block.SoundType soundTypeSand = new Block.SoundType("sand", 1.0F, 1.0F); + public static final Block.SoundType soundTypeSnow = new Block.SoundType("snow", 1.0F, 1.0F); + public static final Block.SoundType soundTypeLadder = new Block.SoundType("ladder", 1.0F, 1.0F) + { + public String getBreakSound() + { + return "dig.wood"; + } + }; + public static final Block.SoundType soundTypeAnvil = new Block.SoundType("anvil", 0.3F, 1.0F) + { + public String getBreakSound() + { + return "dig.stone"; + } + public String getPlaceSound() + { + return "random.anvil_land"; + } + }; + public static final Block.SoundType SLIME_SOUND = new Block.SoundType("slime", 1.0F, 1.0F) + { + public String getBreakSound() + { + return "mob.slime.big"; + } + public String getPlaceSound() + { + return "mob.slime.big"; + } + public String getStepSound() + { + return "mob.slime.small"; + } + }; + protected boolean fullBlock; + protected int lightOpacity; + protected boolean translucent; + protected int lightValue; + protected boolean useNeighborBrightness; + protected float blockHardness; + protected float blockResistance; + protected boolean enableStats; + protected boolean needsRandomTick; + protected boolean isBlockContainer; + protected double minX; + protected double minY; + protected double minZ; + protected double maxX; + protected double maxY; + protected double maxZ; + public Block.SoundType stepSound; + public float blockParticleGravity; + protected final Material blockMaterial; + protected final MapColor blockMapColor; + public float slipperiness; + protected final BlockState blockState; + private IBlockState defaultBlockState; + private String unlocalizedName; + + public static int getIdFromBlock(Block blockIn) + { + return blockRegistry.getIDForObject(blockIn); + } + + public static int getStateId(IBlockState state) + { + Block block = state.getBlock(); + return getIdFromBlock(block) + (block.getMetaFromState(state) << 12); + } + + public static Block getBlockById(int id) + { + return (Block)blockRegistry.getObjectById(id); + } + + public static IBlockState getStateById(int id) + { + int i = id & 4095; + int j = id >> 12 & 15; + return getBlockById(i).getStateFromMeta(j); + } + + public static Block getBlockFromItem(Item itemIn) + { + return itemIn instanceof ItemBlock ? ((ItemBlock)itemIn).getBlock() : null; + } + + public static Block getBlockFromName(String name) + { + ResourceLocation resourcelocation = new ResourceLocation(name); + + if (blockRegistry.containsKey(resourcelocation)) + { + return (Block)blockRegistry.getObject(resourcelocation); + } + else + { + try + { + return (Block)blockRegistry.getObjectById(Integer.parseInt(name)); + } + catch (NumberFormatException var3) + { + return null; + } + } + } + + public boolean isFullBlock() + { + return this.fullBlock; + } + + public int getLightOpacity() + { + return this.lightOpacity; + } + + public boolean isTranslucent() + { + return this.translucent; + } + + public int getLightValue() + { + return this.lightValue; + } + + public boolean getUseNeighborBrightness() + { + return this.useNeighborBrightness; + } + + public Material getMaterial() + { + return this.blockMaterial; + } + + public MapColor getMapColor(IBlockState state) + { + return this.blockMapColor; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState(); + } + + public int getMetaFromState(IBlockState state) + { + if (state != null && !state.getPropertyNames().isEmpty()) + { + throw new IllegalArgumentException("Don\'t know how to convert " + state + " back into data..."); + } + else + { + return 0; + } + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state; + } + + public Block(Material blockMaterialIn, MapColor blockMapColorIn) + { + this.enableStats = true; + this.stepSound = soundTypeStone; + this.blockParticleGravity = 1.0F; + this.slipperiness = 0.6F; + this.blockMaterial = blockMaterialIn; + this.blockMapColor = blockMapColorIn; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.fullBlock = this.isOpaqueCube(); + this.lightOpacity = this.isOpaqueCube() ? 255 : 0; + this.translucent = !blockMaterialIn.blocksLight(); + this.blockState = this.createBlockState(); + this.setDefaultState(this.blockState.getBaseState()); + } + + protected Block(Material materialIn) + { + this(materialIn, materialIn.getMaterialMapColor()); + } + + protected Block setStepSound(Block.SoundType sound) + { + this.stepSound = sound; + return this; + } + + protected Block setLightOpacity(int opacity) + { + this.lightOpacity = opacity; + return this; + } + + protected Block setLightLevel(float value) + { + this.lightValue = (int)(15.0F * value); + return this; + } + + protected Block setResistance(float resistance) + { + this.blockResistance = resistance * 3.0F; + return this; + } + + public boolean isBlockNormalCube() + { + return this.blockMaterial.blocksMovement() && this.isFullCube(); + } + + public boolean isNormalCube() + { + return this.blockMaterial.isOpaque() && this.isFullCube() && !this.canProvidePower(); + } + + public boolean isVisuallyOpaque() + { + return this.blockMaterial.blocksMovement() && this.isFullCube(); + } + + public boolean isFullCube() + { + return true; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return !this.blockMaterial.blocksMovement(); + } + + public int getRenderType() + { + return 3; + } + + public boolean isReplaceable(World worldIn, BlockPos pos) + { + return false; + } + + protected Block setHardness(float hardness) + { + this.blockHardness = hardness; + + if (this.blockResistance < hardness * 5.0F) + { + this.blockResistance = hardness * 5.0F; + } + + return this; + } + + protected Block setBlockUnbreakable() + { + this.setHardness(-1.0F); + return this; + } + + public float getBlockHardness(World worldIn, BlockPos pos) + { + return this.blockHardness; + } + + protected Block setTickRandomly(boolean shouldTick) + { + this.needsRandomTick = shouldTick; + return this; + } + + public boolean getTickRandomly() + { + return this.needsRandomTick; + } + + public boolean hasTileEntity() + { + return this.isBlockContainer; + } + + protected final void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) + { + this.minX = (double)minX; + this.minY = (double)minY; + this.minZ = (double)minZ; + this.maxX = (double)maxX; + this.maxY = (double)maxY; + this.maxZ = (double)maxZ; + } + + public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos).getBlock(); + int i = worldIn.getCombinedLight(pos, block.getLightValue()); + + if (i == 0 && block instanceof BlockSlab) + { + pos = pos.down(); + block = worldIn.getBlockState(pos).getBlock(); + return worldIn.getCombinedLight(pos, block.getLightValue()); + } + else + { + return i; + } + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return side == EnumFacing.DOWN && this.minY > 0.0D ? true : (side == EnumFacing.UP && this.maxY < 1.0D ? true : (side == EnumFacing.NORTH && this.minZ > 0.0D ? true : (side == EnumFacing.SOUTH && this.maxZ < 1.0D ? true : (side == EnumFacing.WEST && this.minX > 0.0D ? true : (side == EnumFacing.EAST && this.maxX < 1.0D ? true : !worldIn.getBlockState(pos).getBlock().isOpaqueCube()))))); + } + + public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return worldIn.getBlockState(pos).getBlock().getMaterial().isSolid(); + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + return new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(worldIn, pos, state); + + if (axisalignedbb != null && mask.intersectsWith(axisalignedbb)) + { + list.add(axisalignedbb); + } + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ); + } + + public boolean isOpaqueCube() + { + return true; + } + + public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid) + { + return this.isCollidable(); + } + + public boolean isCollidable() + { + return true; + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + this.updateTick(worldIn, pos, state, random); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + } + + public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) + { + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + } + + public int tickRate(World worldIn) + { + return 10; + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + } + + public int quantityDropped(Random random) + { + return 1; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(this); + } + + public float getPlayerRelativeBlockHardness(EntityPlayer playerIn, World worldIn, BlockPos pos) + { + float f = this.getBlockHardness(worldIn, pos); + return f < 0.0F ? 0.0F : (!playerIn.canHarvestBlock(this) ? playerIn.getToolDigEfficiency(this) / f / 100.0F : playerIn.getToolDigEfficiency(this) / f / 30.0F); + } + + public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int forture) + { + this.dropBlockAsItemWithChance(worldIn, pos, state, 1.0F, forture); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + if (!worldIn.isRemote) + { + int i = this.quantityDroppedWithBonus(fortune, worldIn.rand); + + for (int j = 0; j < i; ++j) + { + if (worldIn.rand.nextFloat() <= chance) + { + Item item = this.getItemDropped(state, worldIn.rand, fortune); + + if (item != null) + { + spawnAsEntity(worldIn, pos, new ItemStack(item, 1, this.damageDropped(state))); + } + } + } + } + } + + public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack) + { + if (!worldIn.isRemote && worldIn.getGameRules().getBoolean("doTileDrops")) + { + float f = 0.5F; + double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, stack); + entityitem.setDefaultPickupDelay(); + worldIn.spawnEntityInWorld(entityitem); + } + } + + protected void dropXpOnBlockBreak(World worldIn, BlockPos pos, int amount) + { + if (!worldIn.isRemote) + { + while (amount > 0) + { + int i = EntityXPOrb.getXPSplit(amount); + amount -= i; + worldIn.spawnEntityInWorld(new EntityXPOrb(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, i)); + } + } + } + + public int damageDropped(IBlockState state) + { + return 0; + } + + public float getExplosionResistance(Entity exploder) + { + return this.blockResistance / 5.0F; + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + start = start.addVector((double)(-pos.getX()), (double)(-pos.getY()), (double)(-pos.getZ())); + end = end.addVector((double)(-pos.getX()), (double)(-pos.getY()), (double)(-pos.getZ())); + Vec3 vec3 = start.getIntermediateWithXValue(end, this.minX); + Vec3 vec31 = start.getIntermediateWithXValue(end, this.maxX); + Vec3 vec32 = start.getIntermediateWithYValue(end, this.minY); + Vec3 vec33 = start.getIntermediateWithYValue(end, this.maxY); + Vec3 vec34 = start.getIntermediateWithZValue(end, this.minZ); + Vec3 vec35 = start.getIntermediateWithZValue(end, this.maxZ); + + if (!this.isVecInsideYZBounds(vec3)) + { + vec3 = null; + } + + if (!this.isVecInsideYZBounds(vec31)) + { + vec31 = null; + } + + if (!this.isVecInsideXZBounds(vec32)) + { + vec32 = null; + } + + if (!this.isVecInsideXZBounds(vec33)) + { + vec33 = null; + } + + if (!this.isVecInsideXYBounds(vec34)) + { + vec34 = null; + } + + if (!this.isVecInsideXYBounds(vec35)) + { + vec35 = null; + } + + Vec3 vec36 = null; + + if (vec3 != null && (vec36 == null || start.squareDistanceTo(vec3) < start.squareDistanceTo(vec36))) + { + vec36 = vec3; + } + + if (vec31 != null && (vec36 == null || start.squareDistanceTo(vec31) < start.squareDistanceTo(vec36))) + { + vec36 = vec31; + } + + if (vec32 != null && (vec36 == null || start.squareDistanceTo(vec32) < start.squareDistanceTo(vec36))) + { + vec36 = vec32; + } + + if (vec33 != null && (vec36 == null || start.squareDistanceTo(vec33) < start.squareDistanceTo(vec36))) + { + vec36 = vec33; + } + + if (vec34 != null && (vec36 == null || start.squareDistanceTo(vec34) < start.squareDistanceTo(vec36))) + { + vec36 = vec34; + } + + if (vec35 != null && (vec36 == null || start.squareDistanceTo(vec35) < start.squareDistanceTo(vec36))) + { + vec36 = vec35; + } + + if (vec36 == null) + { + return null; + } + else + { + EnumFacing enumfacing = null; + + if (vec36 == vec3) + { + enumfacing = EnumFacing.WEST; + } + + if (vec36 == vec31) + { + enumfacing = EnumFacing.EAST; + } + + if (vec36 == vec32) + { + enumfacing = EnumFacing.DOWN; + } + + if (vec36 == vec33) + { + enumfacing = EnumFacing.UP; + } + + if (vec36 == vec34) + { + enumfacing = EnumFacing.NORTH; + } + + if (vec36 == vec35) + { + enumfacing = EnumFacing.SOUTH; + } + + return new MovingObjectPosition(vec36.addVector((double)pos.getX(), (double)pos.getY(), (double)pos.getZ()), enumfacing, pos); + } + } + + private boolean isVecInsideYZBounds(Vec3 point) + { + return point == null ? false : point.yCoord >= this.minY && point.yCoord <= this.maxY && point.zCoord >= this.minZ && point.zCoord <= this.maxZ; + } + + private boolean isVecInsideXZBounds(Vec3 point) + { + return point == null ? false : point.xCoord >= this.minX && point.xCoord <= this.maxX && point.zCoord >= this.minZ && point.zCoord <= this.maxZ; + } + + private boolean isVecInsideXYBounds(Vec3 point) + { + return point == null ? false : point.xCoord >= this.minX && point.xCoord <= this.maxX && point.yCoord >= this.minY && point.yCoord <= this.maxY; + } + + public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) + { + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.SOLID; + } + + public boolean canReplace(World worldIn, BlockPos pos, EnumFacing side, ItemStack stack) + { + return this.canPlaceBlockOnSide(worldIn, pos, side); + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + return this.canPlaceBlockAt(worldIn, pos); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos).getBlock().blockMaterial.isReplaceable(); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + return false; + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) + { + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getStateFromMeta(meta); + } + + public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) + { + } + + public Vec3 modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion) + { + return motion; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + } + + public final double getBlockBoundsMinX() + { + return this.minX; + } + + public final double getBlockBoundsMaxX() + { + return this.maxX; + } + + public final double getBlockBoundsMinY() + { + return this.minY; + } + + public final double getBlockBoundsMaxY() + { + return this.maxY; + } + + public final double getBlockBoundsMinZ() + { + return this.minZ; + } + + public final double getBlockBoundsMaxZ() + { + return this.maxZ; + } + + public int getBlockColor() + { + return 16777215; + } + + public int getRenderColor(IBlockState state) + { + return 16777215; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return 16777215; + } + + public final int colorMultiplier(IBlockAccess worldIn, BlockPos pos) + { + return this.colorMultiplier(worldIn, pos, 0); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return 0; + } + + public boolean canProvidePower() + { + return false; + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return 0; + } + + public void setBlockBoundsForItemRender() + { + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + player.triggerAchievement(StatList.mineBlockStatArray[getIdFromBlock(this)]); + player.addExhaustion(0.025F); + + if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) + { + ItemStack itemstack = this.createStackedBlock(state); + + if (itemstack != null) + { + spawnAsEntity(worldIn, pos, itemstack); + } + } + else + { + int i = EnchantmentHelper.getFortuneModifier(player); + this.dropBlockAsItem(worldIn, pos, state, i); + } + } + + protected boolean canSilkHarvest() + { + return this.isFullCube() && !this.isBlockContainer; + } + + protected ItemStack createStackedBlock(IBlockState state) + { + int i = 0; + Item item = Item.getItemFromBlock(this); + + if (item != null && item.getHasSubtypes()) + { + i = this.getMetaFromState(state); + } + + return new ItemStack(item, 1, i); + } + + public int quantityDroppedWithBonus(int fortune, Random random) + { + return this.quantityDropped(random); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + } + + public boolean canSpawnInBlock() + { + return !this.blockMaterial.isSolid() && !this.blockMaterial.isLiquid(); + } + + public Block setUnlocalizedName(String name) + { + this.unlocalizedName = name; + return this; + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); + } + + public String getUnlocalizedName() + { + return "tile." + this.unlocalizedName; + } + + public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + { + return false; + } + + public boolean getEnableStats() + { + return this.enableStats; + } + + protected Block disableStats() + { + this.enableStats = false; + return this; + } + + public int getMobilityFlag() + { + return this.blockMaterial.getMaterialMobility(); + } + + public float getAmbientOcclusionLightValue() + { + return this.isBlockNormalCube() ? 0.2F : 1.0F; + } + + public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) + { + entityIn.fall(fallDistance, 1.0F); + } + + public void onLanded(World worldIn, Entity entityIn) + { + entityIn.motionY = 0.0D; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(this); + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + return this.damageDropped(worldIn.getBlockState(pos)); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + } + + public CreativeTabs getCreativeTabToDisplayOn() + { + return this.displayOnCreativeTab; + } + + public Block setCreativeTab(CreativeTabs tab) + { + this.displayOnCreativeTab = tab; + return this; + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + } + + public void fillWithRain(World worldIn, BlockPos pos) + { + } + + public boolean isFlowerPot() + { + return false; + } + + public boolean requiresUpdates() + { + return true; + } + + public boolean canDropFromExplosion(Explosion explosionIn) + { + return true; + } + + public boolean isAssociatedBlock(Block other) + { + return this == other; + } + + public static boolean isEqualTo(Block blockIn, Block other) + { + return blockIn != null && other != null ? (blockIn == other ? true : blockIn.isAssociatedBlock(other)) : false; + } + + public boolean hasComparatorInputOverride() + { + return false; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return 0; + } + + public IBlockState getStateForEntityRender(IBlockState state) + { + return state; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[0]); + } + + public BlockState getBlockState() + { + return this.blockState; + } + + protected final void setDefaultState(IBlockState state) + { + this.defaultBlockState = state; + } + + public final IBlockState getDefaultState() + { + return this.defaultBlockState; + } + + public Block.EnumOffsetType getOffsetType() + { + return Block.EnumOffsetType.NONE; + } + + public String toString() + { + return "Block{" + blockRegistry.getNameForObject(this) + "}"; + } + + public static void registerBlocks() + { + registerBlock(0, AIR_ID, (new BlockAir()).setUnlocalizedName("air")); + registerBlock(1, "stone", (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stone")); + registerBlock(2, "grass", (new BlockGrass()).setHardness(0.6F).setStepSound(soundTypeGrass).setUnlocalizedName("grass")); + registerBlock(3, "dirt", (new BlockDirt()).setHardness(0.5F).setStepSound(soundTypeGravel).setUnlocalizedName("dirt")); + Block block = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stonebrick").setCreativeTab(CreativeTabs.tabBlock); + registerBlock(4, "cobblestone", block); + Block block1 = (new BlockPlanks()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("wood"); + registerBlock(5, "planks", block1); + registerBlock(6, "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling")); + registerBlock(7, "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(8, "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); + registerBlock(9, "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); + registerBlock(10, "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); + registerBlock(11, "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); + registerBlock(12, "sand", (new BlockSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("sand")); + registerBlock(13, "gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("gravel")); + registerBlock(14, "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreGold")); + registerBlock(15, "iron_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreIron")); + registerBlock(16, "coal_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreCoal")); + registerBlock(17, "log", (new BlockOldLog()).setUnlocalizedName("log")); + registerBlock(18, "leaves", (new BlockOldLeaf()).setUnlocalizedName("leaves")); + registerBlock(19, "sponge", (new BlockSponge()).setHardness(0.6F).setStepSound(soundTypeGrass).setUnlocalizedName("sponge")); + registerBlock(20, "glass", (new BlockGlass(Material.glass, false)).setHardness(0.3F).setStepSound(soundTypeGlass).setUnlocalizedName("glass")); + registerBlock(21, "lapis_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreLapis")); + registerBlock(22, "lapis_block", (new Block(Material.iron, MapColor.lapisColor)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("blockLapis").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(23, "dispenser", (new BlockDispenser()).setHardness(3.5F).setStepSound(soundTypePiston).setUnlocalizedName("dispenser")); + Block block2 = (new BlockSandStone()).setStepSound(soundTypePiston).setHardness(0.8F).setUnlocalizedName("sandStone"); + registerBlock(24, "sandstone", block2); + registerBlock(25, "noteblock", (new BlockNote()).setHardness(0.8F).setUnlocalizedName("musicBlock")); + registerBlock(26, "bed", (new BlockBed()).setStepSound(soundTypeWood).setHardness(0.2F).setUnlocalizedName("bed").disableStats()); + registerBlock(27, "golden_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(soundTypeMetal).setUnlocalizedName("goldenRail")); + registerBlock(28, "detector_rail", (new BlockRailDetector()).setHardness(0.7F).setStepSound(soundTypeMetal).setUnlocalizedName("detectorRail")); + registerBlock(29, "sticky_piston", (new BlockPistonBase(true)).setUnlocalizedName("pistonStickyBase")); + registerBlock(30, "web", (new BlockWeb()).setLightOpacity(1).setHardness(4.0F).setUnlocalizedName("web")); + registerBlock(31, "tallgrass", (new BlockTallGrass()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("tallgrass")); + registerBlock(32, "deadbush", (new BlockDeadBush()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("deadbush")); + registerBlock(33, "piston", (new BlockPistonBase(false)).setUnlocalizedName("pistonBase")); + registerBlock(34, "piston_head", (new BlockPistonExtension()).setUnlocalizedName("pistonBase")); + registerBlock(35, "wool", (new BlockColored(Material.cloth)).setHardness(0.8F).setStepSound(soundTypeCloth).setUnlocalizedName("cloth")); + registerBlock(36, "piston_extension", new BlockPistonMoving()); + registerBlock(37, "yellow_flower", (new BlockYellowFlower()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("flower1")); + registerBlock(38, "red_flower", (new BlockRedFlower()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("flower2")); + Block block3 = (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setLightLevel(0.125F).setUnlocalizedName("mushroom"); + registerBlock(39, "brown_mushroom", block3); + Block block4 = (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("mushroom"); + registerBlock(40, "red_mushroom", block4); + registerBlock(41, "gold_block", (new Block(Material.iron, MapColor.goldColor)).setHardness(3.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setUnlocalizedName("blockGold").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(42, "iron_block", (new Block(Material.iron, MapColor.ironColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setUnlocalizedName("blockIron").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(43, "double_stone_slab", (new BlockDoubleStoneSlab()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab")); + registerBlock(44, "stone_slab", (new BlockHalfStoneSlab()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab")); + Block block5 = (new Block(Material.rock, MapColor.redColor)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabBlock); + registerBlock(45, "brick_block", block5); + registerBlock(46, "tnt", (new BlockTNT()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("tnt")); + registerBlock(47, "bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(soundTypeWood).setUnlocalizedName("bookshelf")); + registerBlock(48, "mossy_cobblestone", (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stoneMoss").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(49, "obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setStepSound(soundTypePiston).setUnlocalizedName("obsidian")); + registerBlock(50, "torch", (new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(soundTypeWood).setUnlocalizedName("torch")); + registerBlock(51, "fire", (new BlockFire()).setHardness(0.0F).setLightLevel(1.0F).setStepSound(soundTypeCloth).setUnlocalizedName("fire").disableStats()); + registerBlock(52, "mob_spawner", (new BlockMobSpawner()).setHardness(5.0F).setStepSound(soundTypeMetal).setUnlocalizedName("mobSpawner").disableStats()); + registerBlock(53, "oak_stairs", (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.OAK))).setUnlocalizedName("stairsWood")); + registerBlock(54, "chest", (new BlockChest(0)).setHardness(2.5F).setStepSound(soundTypeWood).setUnlocalizedName("chest")); + registerBlock(55, "redstone_wire", (new BlockRedstoneWire()).setHardness(0.0F).setStepSound(soundTypeStone).setUnlocalizedName("redstoneDust").disableStats()); + registerBlock(56, "diamond_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreDiamond")); + registerBlock(57, "diamond_block", (new Block(Material.iron, MapColor.diamondColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setUnlocalizedName("blockDiamond").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(58, "crafting_table", (new BlockWorkbench()).setHardness(2.5F).setStepSound(soundTypeWood).setUnlocalizedName("workbench")); + registerBlock(59, "wheat", (new BlockCrops()).setUnlocalizedName("crops")); + Block block6 = (new BlockFarmland()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("farmland"); + registerBlock(60, "farmland", block6); + registerBlock(61, "furnace", (new BlockFurnace(false)).setHardness(3.5F).setStepSound(soundTypePiston).setUnlocalizedName("furnace").setCreativeTab(CreativeTabs.tabDecorations)); + registerBlock(62, "lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(soundTypePiston).setLightLevel(0.875F).setUnlocalizedName("furnace")); + registerBlock(63, "standing_sign", (new BlockStandingSign()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("sign").disableStats()); + registerBlock(64, "wooden_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setUnlocalizedName("doorOak").disableStats()); + registerBlock(65, "ladder", (new BlockLadder()).setHardness(0.4F).setStepSound(soundTypeLadder).setUnlocalizedName("ladder")); + registerBlock(66, "rail", (new BlockRail()).setHardness(0.7F).setStepSound(soundTypeMetal).setUnlocalizedName("rail")); + registerBlock(67, "stone_stairs", (new BlockStairs(block.getDefaultState())).setUnlocalizedName("stairsStone")); + registerBlock(68, "wall_sign", (new BlockWallSign()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("sign").disableStats()); + registerBlock(69, "lever", (new BlockLever()).setHardness(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("lever")); + registerBlock(70, "stone_pressure_plate", (new BlockPressurePlate(Material.rock, BlockPressurePlate.Sensitivity.MOBS)).setHardness(0.5F).setStepSound(soundTypePiston).setUnlocalizedName("pressurePlateStone")); + registerBlock(71, "iron_door", (new BlockDoor(Material.iron)).setHardness(5.0F).setStepSound(soundTypeMetal).setUnlocalizedName("doorIron").disableStats()); + registerBlock(72, "wooden_pressure_plate", (new BlockPressurePlate(Material.wood, BlockPressurePlate.Sensitivity.EVERYTHING)).setHardness(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("pressurePlateWood")); + registerBlock(73, "redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreRedstone").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(74, "lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreRedstone")); + registerBlock(75, "unlit_redstone_torch", (new BlockRedstoneTorch(false)).setHardness(0.0F).setStepSound(soundTypeWood).setUnlocalizedName("notGate")); + registerBlock(76, "redstone_torch", (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("notGate").setCreativeTab(CreativeTabs.tabRedstone)); + registerBlock(77, "stone_button", (new BlockButtonStone()).setHardness(0.5F).setStepSound(soundTypePiston).setUnlocalizedName("button")); + registerBlock(78, "snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(soundTypeSnow).setUnlocalizedName("snow").setLightOpacity(0)); + registerBlock(79, "ice", (new BlockIce()).setHardness(0.5F).setLightOpacity(3).setStepSound(soundTypeGlass).setUnlocalizedName("ice")); + registerBlock(80, "snow", (new BlockSnowBlock()).setHardness(0.2F).setStepSound(soundTypeSnow).setUnlocalizedName("snow")); + registerBlock(81, "cactus", (new BlockCactus()).setHardness(0.4F).setStepSound(soundTypeCloth).setUnlocalizedName("cactus")); + registerBlock(82, "clay", (new BlockClay()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("clay")); + registerBlock(83, "reeds", (new BlockReed()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("reeds").disableStats()); + registerBlock(84, "jukebox", (new BlockJukebox()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("jukebox")); + registerBlock(85, "fence", (new BlockFence(Material.wood, BlockPlanks.EnumType.OAK.getMapColor())).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("fence")); + Block block7 = (new BlockPumpkin()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("pumpkin"); + registerBlock(86, "pumpkin", block7); + registerBlock(87, "netherrack", (new BlockNetherrack()).setHardness(0.4F).setStepSound(soundTypePiston).setUnlocalizedName("hellrock")); + registerBlock(88, "soul_sand", (new BlockSoulSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("hellsand")); + registerBlock(89, "glowstone", (new BlockGlowstone(Material.glass)).setHardness(0.3F).setStepSound(soundTypeGlass).setLightLevel(1.0F).setUnlocalizedName("lightgem")); + registerBlock(90, "portal", (new BlockPortal()).setHardness(-1.0F).setStepSound(soundTypeGlass).setLightLevel(0.75F).setUnlocalizedName("portal")); + registerBlock(91, "lit_pumpkin", (new BlockPumpkin()).setHardness(1.0F).setStepSound(soundTypeWood).setLightLevel(1.0F).setUnlocalizedName("litpumpkin")); + registerBlock(92, "cake", (new BlockCake()).setHardness(0.5F).setStepSound(soundTypeCloth).setUnlocalizedName("cake").disableStats()); + registerBlock(93, "unpowered_repeater", (new BlockRedstoneRepeater(false)).setHardness(0.0F).setStepSound(soundTypeWood).setUnlocalizedName("diode").disableStats()); + registerBlock(94, "powered_repeater", (new BlockRedstoneRepeater(true)).setHardness(0.0F).setStepSound(soundTypeWood).setUnlocalizedName("diode").disableStats()); + registerBlock(95, "stained_glass", (new BlockStainedGlass(Material.glass)).setHardness(0.3F).setStepSound(soundTypeGlass).setUnlocalizedName("stainedGlass")); + registerBlock(96, "trapdoor", (new BlockTrapDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setUnlocalizedName("trapdoor").disableStats()); + registerBlock(97, "monster_egg", (new BlockSilverfish()).setHardness(0.75F).setUnlocalizedName("monsterStoneEgg")); + Block block8 = (new BlockStoneBrick()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stonebricksmooth"); + registerBlock(98, "stonebrick", block8); + registerBlock(99, "brown_mushroom_block", (new BlockHugeMushroom(Material.wood, MapColor.dirtColor, block3)).setHardness(0.2F).setStepSound(soundTypeWood).setUnlocalizedName("mushroom")); + registerBlock(100, "red_mushroom_block", (new BlockHugeMushroom(Material.wood, MapColor.redColor, block4)).setHardness(0.2F).setStepSound(soundTypeWood).setUnlocalizedName("mushroom")); + registerBlock(101, "iron_bars", (new BlockPane(Material.iron, true)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setUnlocalizedName("fenceIron")); + registerBlock(102, "glass_pane", (new BlockPane(Material.glass, false)).setHardness(0.3F).setStepSound(soundTypeGlass).setUnlocalizedName("thinGlass")); + Block block9 = (new BlockMelon()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("melon"); + registerBlock(103, "melon_block", block9); + registerBlock(104, "pumpkin_stem", (new BlockStem(block7)).setHardness(0.0F).setStepSound(soundTypeWood).setUnlocalizedName("pumpkinStem")); + registerBlock(105, "melon_stem", (new BlockStem(block9)).setHardness(0.0F).setStepSound(soundTypeWood).setUnlocalizedName("pumpkinStem")); + registerBlock(106, "vine", (new BlockVine()).setHardness(0.2F).setStepSound(soundTypeGrass).setUnlocalizedName("vine")); + registerBlock(107, "fence_gate", (new BlockFenceGate(BlockPlanks.EnumType.OAK)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("fenceGate")); + registerBlock(108, "brick_stairs", (new BlockStairs(block5.getDefaultState())).setUnlocalizedName("stairsBrick")); + registerBlock(109, "stone_brick_stairs", (new BlockStairs(block8.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.DEFAULT))).setUnlocalizedName("stairsStoneBrickSmooth")); + registerBlock(110, "mycelium", (new BlockMycelium()).setHardness(0.6F).setStepSound(soundTypeGrass).setUnlocalizedName("mycel")); + registerBlock(111, "waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("waterlily")); + Block block10 = (new BlockNetherBrick()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("netherBrick").setCreativeTab(CreativeTabs.tabBlock); + registerBlock(112, "nether_brick", block10); + registerBlock(113, "nether_brick_fence", (new BlockFence(Material.rock, MapColor.netherrackColor)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("netherFence")); + registerBlock(114, "nether_brick_stairs", (new BlockStairs(block10.getDefaultState())).setUnlocalizedName("stairsNetherBrick")); + registerBlock(115, "nether_wart", (new BlockNetherWart()).setUnlocalizedName("netherStalk")); + registerBlock(116, "enchanting_table", (new BlockEnchantmentTable()).setHardness(5.0F).setResistance(2000.0F).setUnlocalizedName("enchantmentTable")); + registerBlock(117, "brewing_stand", (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setUnlocalizedName("brewingStand")); + registerBlock(118, "cauldron", (new BlockCauldron()).setHardness(2.0F).setUnlocalizedName("cauldron")); + registerBlock(119, "end_portal", (new BlockEndPortal(Material.portal)).setHardness(-1.0F).setResistance(6000000.0F)); + registerBlock(120, "end_portal_frame", (new BlockEndPortalFrame()).setStepSound(soundTypeGlass).setLightLevel(0.125F).setHardness(-1.0F).setUnlocalizedName("endPortalFrame").setResistance(6000000.0F).setCreativeTab(CreativeTabs.tabDecorations)); + registerBlock(121, "end_stone", (new Block(Material.rock, MapColor.sandColor)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundTypePiston).setUnlocalizedName("whiteStone").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(122, "dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(soundTypePiston).setLightLevel(0.125F).setUnlocalizedName("dragonEgg")); + registerBlock(123, "redstone_lamp", (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(soundTypeGlass).setUnlocalizedName("redstoneLight").setCreativeTab(CreativeTabs.tabRedstone)); + registerBlock(124, "lit_redstone_lamp", (new BlockRedstoneLight(true)).setHardness(0.3F).setStepSound(soundTypeGlass).setUnlocalizedName("redstoneLight")); + registerBlock(125, "double_wooden_slab", (new BlockDoubleWoodSlab()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("woodSlab")); + registerBlock(126, "wooden_slab", (new BlockHalfWoodSlab()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("woodSlab")); + registerBlock(127, "cocoa", (new BlockCocoa()).setHardness(0.2F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("cocoa")); + registerBlock(128, "sandstone_stairs", (new BlockStairs(block2.getDefaultState().withProperty(BlockSandStone.TYPE, BlockSandStone.EnumType.SMOOTH))).setUnlocalizedName("stairsSandStone")); + registerBlock(129, "emerald_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreEmerald")); + registerBlock(130, "ender_chest", (new BlockEnderChest()).setHardness(22.5F).setResistance(1000.0F).setStepSound(soundTypePiston).setUnlocalizedName("enderChest").setLightLevel(0.5F)); + registerBlock(131, "tripwire_hook", (new BlockTripWireHook()).setUnlocalizedName("tripWireSource")); + registerBlock(132, "tripwire", (new BlockTripWire()).setUnlocalizedName("tripWire")); + registerBlock(133, "emerald_block", (new Block(Material.iron, MapColor.emeraldColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setUnlocalizedName("blockEmerald").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(134, "spruce_stairs", (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.SPRUCE))).setUnlocalizedName("stairsWoodSpruce")); + registerBlock(135, "birch_stairs", (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.BIRCH))).setUnlocalizedName("stairsWoodBirch")); + registerBlock(136, "jungle_stairs", (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.JUNGLE))).setUnlocalizedName("stairsWoodJungle")); + registerBlock(137, "command_block", (new BlockCommandBlock()).setBlockUnbreakable().setResistance(6000000.0F).setUnlocalizedName("commandBlock")); + registerBlock(138, "beacon", (new BlockBeacon()).setUnlocalizedName("beacon").setLightLevel(1.0F)); + registerBlock(139, "cobblestone_wall", (new BlockWall(block)).setUnlocalizedName("cobbleWall")); + registerBlock(140, "flower_pot", (new BlockFlowerPot()).setHardness(0.0F).setStepSound(soundTypeStone).setUnlocalizedName("flowerPot")); + registerBlock(141, "carrots", (new BlockCarrot()).setUnlocalizedName("carrots")); + registerBlock(142, "potatoes", (new BlockPotato()).setUnlocalizedName("potatoes")); + registerBlock(143, "wooden_button", (new BlockButtonWood()).setHardness(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("button")); + registerBlock(144, "skull", (new BlockSkull()).setHardness(1.0F).setStepSound(soundTypePiston).setUnlocalizedName("skull")); + registerBlock(145, "anvil", (new BlockAnvil()).setHardness(5.0F).setStepSound(soundTypeAnvil).setResistance(2000.0F).setUnlocalizedName("anvil")); + registerBlock(146, "trapped_chest", (new BlockChest(1)).setHardness(2.5F).setStepSound(soundTypeWood).setUnlocalizedName("chestTrap")); + registerBlock(147, "light_weighted_pressure_plate", (new BlockPressurePlateWeighted(Material.iron, 15, MapColor.goldColor)).setHardness(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("weightedPlate_light")); + registerBlock(148, "heavy_weighted_pressure_plate", (new BlockPressurePlateWeighted(Material.iron, 150)).setHardness(0.5F).setStepSound(soundTypeWood).setUnlocalizedName("weightedPlate_heavy")); + registerBlock(149, "unpowered_comparator", (new BlockRedstoneComparator(false)).setHardness(0.0F).setStepSound(soundTypeWood).setUnlocalizedName("comparator").disableStats()); + registerBlock(150, "powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F).setLightLevel(0.625F).setStepSound(soundTypeWood).setUnlocalizedName("comparator").disableStats()); + registerBlock(151, "daylight_detector", new BlockDaylightDetector(false)); + registerBlock(152, "redstone_block", (new BlockCompressedPowered(Material.iron, MapColor.tntColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setUnlocalizedName("blockRedstone").setCreativeTab(CreativeTabs.tabRedstone)); + registerBlock(153, "quartz_ore", (new BlockOre(MapColor.netherrackColor)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("netherquartz")); + registerBlock(154, "hopper", (new BlockHopper()).setHardness(3.0F).setResistance(8.0F).setStepSound(soundTypeMetal).setUnlocalizedName("hopper")); + Block block11 = (new BlockQuartz()).setStepSound(soundTypePiston).setHardness(0.8F).setUnlocalizedName("quartzBlock"); + registerBlock(155, "quartz_block", block11); + registerBlock(156, "quartz_stairs", (new BlockStairs(block11.getDefaultState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT))).setUnlocalizedName("stairsQuartz")); + registerBlock(157, "activator_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(soundTypeMetal).setUnlocalizedName("activatorRail")); + registerBlock(158, "dropper", (new BlockDropper()).setHardness(3.5F).setStepSound(soundTypePiston).setUnlocalizedName("dropper")); + registerBlock(159, "stained_hardened_clay", (new BlockColored(Material.rock)).setHardness(1.25F).setResistance(7.0F).setStepSound(soundTypePiston).setUnlocalizedName("clayHardenedStained")); + registerBlock(160, "stained_glass_pane", (new BlockStainedGlassPane()).setHardness(0.3F).setStepSound(soundTypeGlass).setUnlocalizedName("thinStainedGlass")); + registerBlock(161, "leaves2", (new BlockNewLeaf()).setUnlocalizedName("leaves")); + registerBlock(162, "log2", (new BlockNewLog()).setUnlocalizedName("log")); + registerBlock(163, "acacia_stairs", (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.ACACIA))).setUnlocalizedName("stairsWoodAcacia")); + registerBlock(164, "dark_oak_stairs", (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.DARK_OAK))).setUnlocalizedName("stairsWoodDarkOak")); + registerBlock(165, "slime", (new BlockSlime()).setUnlocalizedName("slime").setStepSound(SLIME_SOUND)); + registerBlock(166, "barrier", (new BlockBarrier()).setUnlocalizedName("barrier")); + registerBlock(167, "iron_trapdoor", (new BlockTrapDoor(Material.iron)).setHardness(5.0F).setStepSound(soundTypeMetal).setUnlocalizedName("ironTrapdoor").disableStats()); + registerBlock(168, "prismarine", (new BlockPrismarine()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("prismarine")); + registerBlock(169, "sea_lantern", (new BlockSeaLantern(Material.glass)).setHardness(0.3F).setStepSound(soundTypeGlass).setLightLevel(1.0F).setUnlocalizedName("seaLantern")); + registerBlock(170, "hay_block", (new BlockHay()).setHardness(0.5F).setStepSound(soundTypeGrass).setUnlocalizedName("hayBlock").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(171, "carpet", (new BlockCarpet()).setHardness(0.1F).setStepSound(soundTypeCloth).setUnlocalizedName("woolCarpet").setLightOpacity(0)); + registerBlock(172, "hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(soundTypePiston).setUnlocalizedName("clayHardened")); + registerBlock(173, "coal_block", (new Block(Material.rock, MapColor.blackColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("blockCoal").setCreativeTab(CreativeTabs.tabBlock)); + registerBlock(174, "packed_ice", (new BlockPackedIce()).setHardness(0.5F).setStepSound(soundTypeGlass).setUnlocalizedName("icePacked")); + registerBlock(175, "double_plant", new BlockDoublePlant()); + registerBlock(176, "standing_banner", (new BlockBanner.BlockBannerStanding()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("banner").disableStats()); + registerBlock(177, "wall_banner", (new BlockBanner.BlockBannerHanging()).setHardness(1.0F).setStepSound(soundTypeWood).setUnlocalizedName("banner").disableStats()); + registerBlock(178, "daylight_detector_inverted", new BlockDaylightDetector(true)); + Block block12 = (new BlockRedSandstone()).setStepSound(soundTypePiston).setHardness(0.8F).setUnlocalizedName("redSandStone"); + registerBlock(179, "red_sandstone", block12); + registerBlock(180, "red_sandstone_stairs", (new BlockStairs(block12.getDefaultState().withProperty(BlockRedSandstone.TYPE, BlockRedSandstone.EnumType.SMOOTH))).setUnlocalizedName("stairsRedSandStone")); + registerBlock(181, "double_stone_slab2", (new BlockDoubleStoneSlabNew()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab2")); + registerBlock(182, "stone_slab2", (new BlockHalfStoneSlabNew()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setUnlocalizedName("stoneSlab2")); + registerBlock(183, "spruce_fence_gate", (new BlockFenceGate(BlockPlanks.EnumType.SPRUCE)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("spruceFenceGate")); + registerBlock(184, "birch_fence_gate", (new BlockFenceGate(BlockPlanks.EnumType.BIRCH)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("birchFenceGate")); + registerBlock(185, "jungle_fence_gate", (new BlockFenceGate(BlockPlanks.EnumType.JUNGLE)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("jungleFenceGate")); + registerBlock(186, "dark_oak_fence_gate", (new BlockFenceGate(BlockPlanks.EnumType.DARK_OAK)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("darkOakFenceGate")); + registerBlock(187, "acacia_fence_gate", (new BlockFenceGate(BlockPlanks.EnumType.ACACIA)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("acaciaFenceGate")); + registerBlock(188, "spruce_fence", (new BlockFence(Material.wood, BlockPlanks.EnumType.SPRUCE.getMapColor())).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("spruceFence")); + registerBlock(189, "birch_fence", (new BlockFence(Material.wood, BlockPlanks.EnumType.BIRCH.getMapColor())).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("birchFence")); + registerBlock(190, "jungle_fence", (new BlockFence(Material.wood, BlockPlanks.EnumType.JUNGLE.getMapColor())).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("jungleFence")); + registerBlock(191, "dark_oak_fence", (new BlockFence(Material.wood, BlockPlanks.EnumType.DARK_OAK.getMapColor())).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("darkOakFence")); + registerBlock(192, "acacia_fence", (new BlockFence(Material.wood, BlockPlanks.EnumType.ACACIA.getMapColor())).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("acaciaFence")); + registerBlock(193, "spruce_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setUnlocalizedName("doorSpruce").disableStats()); + registerBlock(194, "birch_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setUnlocalizedName("doorBirch").disableStats()); + registerBlock(195, "jungle_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setUnlocalizedName("doorJungle").disableStats()); + registerBlock(196, "acacia_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setUnlocalizedName("doorAcacia").disableStats()); + registerBlock(197, "dark_oak_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setUnlocalizedName("doorDarkOak").disableStats()); + blockRegistry.validateKey(); + + for (Block block13 : blockRegistry) + { + if (block13.blockMaterial == Material.air) + { + block13.useNeighborBrightness = false; + } + else + { + boolean flag = false; + boolean flag1 = block13 instanceof BlockStairs; + boolean flag2 = block13 instanceof BlockSlab; + boolean flag3 = block13 == block6; + boolean flag4 = block13.translucent; + boolean flag5 = block13.lightOpacity == 0; + + if (flag1 || flag2 || flag3 || flag4 || flag5) + { + flag = true; + } + + block13.useNeighborBrightness = flag; + } + } + + for (Block block14 : blockRegistry) + { + for (IBlockState iblockstate : block14.getBlockState().getValidStates()) + { + int i = blockRegistry.getIDForObject(block14) << 4 | block14.getMetaFromState(iblockstate); + BLOCK_STATE_IDS.put(iblockstate, i); + } + } + } + + private static void registerBlock(int id, ResourceLocation textualID, Block block_) + { + blockRegistry.register(id, textualID, block_); + } + + private static void registerBlock(int id, String textualID, Block block_) + { + registerBlock(id, new ResourceLocation(textualID), block_); + } + + public static enum EnumOffsetType + { + NONE, + XZ, + XYZ; + } + + public static class SoundType + { + public final String soundName; + public final float volume; + public final float frequency; + + public SoundType(String name, float volume, float frequency) + { + this.soundName = name; + this.volume = volume; + this.frequency = frequency; + } + + public float getVolume() + { + return this.volume; + } + + public float getFrequency() + { + return this.frequency; + } + + public String getBreakSound() + { + return "dig." + this.soundName; + } + + public String getStepSound() + { + return "step." + this.soundName; + } + + public String getPlaceSound() + { + return this.getBreakSound(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockAir.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockAir.java new file mode 100644 index 0000000..9448e04 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockAir.java @@ -0,0 +1,67 @@ +package net.minecraft.block; + +import java.util.IdentityHashMap; +import java.util.Map; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockAir extends Block +{ + private static Map mapOriginalOpacity = new IdentityHashMap(); + + protected BlockAir() + { + super(Material.air); + } + + public int getRenderType() + { + return -1; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid) + { + return false; + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + } + + public boolean isReplaceable(World worldIn, BlockPos pos) + { + return true; + } + + public static void setLightOpacity(Block p_setLightOpacity_0_, int p_setLightOpacity_1_) + { + if (!mapOriginalOpacity.containsKey(p_setLightOpacity_0_)) + { + mapOriginalOpacity.put(p_setLightOpacity_0_, Integer.valueOf(p_setLightOpacity_0_.lightOpacity)); + } + + p_setLightOpacity_0_.lightOpacity = p_setLightOpacity_1_; + } + + public static void restoreLightOpacity(Block p_restoreLightOpacity_0_) + { + if (mapOriginalOpacity.containsKey(p_restoreLightOpacity_0_)) + { + int i = ((Integer)mapOriginalOpacity.get(p_restoreLightOpacity_0_)).intValue(); + setLightOpacity(p_restoreLightOpacity_0_, i); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockAnvil.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockAnvil.java new file mode 100644 index 0000000..783abfd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockAnvil.java @@ -0,0 +1,167 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.IInteractionObject; +import net.minecraft.world.World; + +public class BlockAnvil extends BlockFalling +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyInteger DAMAGE = PropertyInteger.create("damage", 0, 2); + + protected BlockAnvil() + { + super(Material.anvil); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(DAMAGE, Integer.valueOf(0))); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + EnumFacing enumfacing = placer.getHorizontalFacing().rotateY(); + return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(FACING, enumfacing).withProperty(DAMAGE, Integer.valueOf(meta >> 2)); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!worldIn.isRemote) + { + playerIn.displayGui(new BlockAnvil.Anvil(worldIn, pos)); + } + + return true; + } + + public int damageDropped(IBlockState state) + { + return ((Integer)state.getValue(DAMAGE)).intValue(); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING); + + if (enumfacing.getAxis() == EnumFacing.Axis.X) + { + this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); + } + else + { + this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F); + } + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + } + + protected void onStartFalling(EntityFallingBlock fallingEntity) + { + fallingEntity.setHurtEntities(true); + } + + public void onEndFalling(World worldIn, BlockPos pos) + { + worldIn.playAuxSFX(1022, pos, 0); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return true; + } + + public IBlockState getStateForEntityRender(IBlockState state) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta & 3)).withProperty(DAMAGE, Integer.valueOf((meta & 15) >> 2)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + i = i | ((Integer)state.getValue(DAMAGE)).intValue() << 2; + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, DAMAGE}); + } + + public static class Anvil implements IInteractionObject + { + private final World world; + private final BlockPos position; + + public Anvil(World worldIn, BlockPos pos) + { + this.world = worldIn; + this.position = pos; + } + + public String getName() + { + return "anvil"; + } + + public boolean hasCustomName() + { + return false; + } + + public IChatComponent getDisplayName() + { + return new ChatComponentTranslation(Blocks.anvil.getUnlocalizedName() + ".name", new Object[0]); + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerRepair(playerInventory, this.world, this.position, playerIn); + } + + public String getGuiID() + { + return "minecraft:anvil"; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBanner.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBanner.java new file mode 100644 index 0000000..48a676c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBanner.java @@ -0,0 +1,238 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockBanner extends BlockContainer +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15); + + protected BlockBanner() + { + super(Material.wood); + float f = 0.25F; + float f1 = 1.0F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal("item.banner.white.name"); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getSelectedBoundingBox(worldIn, pos); + } + + public boolean isFullCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return true; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean canSpawnInBlock() + { + return true; + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityBanner(); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.banner; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.banner; + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBanner) + { + ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)tileentity).getBaseColor()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("x"); + nbttagcompound.removeTag("y"); + nbttagcompound.removeTag("z"); + nbttagcompound.removeTag("id"); + itemstack.setTagInfo("BlockEntityTag", nbttagcompound); + spawnAsEntity(worldIn, pos, itemstack); + } + else + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return !this.hasInvalidNeighbor(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos); + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + if (te instanceof TileEntityBanner) + { + TileEntityBanner tileentitybanner = (TileEntityBanner)te; + ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)te).getBaseColor()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, tileentitybanner.getBaseColor(), tileentitybanner.getPatterns()); + itemstack.setTagInfo("BlockEntityTag", nbttagcompound); + spawnAsEntity(worldIn, pos, itemstack); + } + else + { + super.harvestBlock(worldIn, player, pos, state, (TileEntity)null); + } + } + + public static class BlockBannerHanging extends BlockBanner + { + public BlockBannerHanging() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING); + float f = 0.0F; + float f1 = 0.78125F; + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + + switch (enumfacing) + { + case NORTH: + default: + this.setBlockBounds(f2, f, 1.0F - f4, f3, f1, 1.0F); + break; + + case SOUTH: + this.setBlockBounds(f2, f, 0.0F, f3, f1, f4); + break; + + case WEST: + this.setBlockBounds(1.0F - f4, f, f2, 1.0F, f1, f3); + break; + + case EAST: + this.setBlockBounds(0.0F, f, f2, f4, f1, f3); + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (!worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock().getMaterial().isSolid()) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing = EnumFacing.getFront(meta); + + if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumFacing)state.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } + } + + public static class BlockBannerStanding extends BlockBanner + { + public BlockBannerStanding() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(ROTATION, Integer.valueOf(0))); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.getBlockState(pos.down()).getBlock().getMaterial().isSolid()) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(ROTATION, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(ROTATION)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {ROTATION}); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBarrier.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBarrier.java new file mode 100644 index 0000000..bf2b335 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBarrier.java @@ -0,0 +1,37 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockBarrier extends Block +{ + protected BlockBarrier() + { + super(Material.barrier); + this.setBlockUnbreakable(); + this.setResistance(6000001.0F); + this.disableStats(); + this.translucent = true; + } + + public int getRenderType() + { + return -1; + } + + public boolean isOpaqueCube() + { + return false; + } + + public float getAmbientOcclusionLightValue() + { + return 1.0F; + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBasePressurePlate.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBasePressurePlate.java new file mode 100644 index 0000000..dd3c9fb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBasePressurePlate.java @@ -0,0 +1,212 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockBasePressurePlate extends Block +{ + protected BlockBasePressurePlate(Material materialIn) + { + this(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockBasePressurePlate(Material p_i46401_1_, MapColor p_i46401_2_) + { + super(p_i46401_1_, p_i46401_2_); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBlockBoundsBasedOnState0(worldIn.getBlockState(pos)); + } + + protected void setBlockBoundsBasedOnState0(IBlockState state) + { + boolean flag = this.getRedstoneStrength(state) > 0; + float f = 0.0625F; + + if (flag) + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.03125F, 0.9375F); + } + else + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.0625F, 0.9375F); + } + } + + public int tickRate(World worldIn) + { + return 20; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return true; + } + + public boolean canSpawnInBlock() + { + return true; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return this.canBePlacedOn(worldIn, pos.down()); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!this.canBePlacedOn(worldIn, pos.down())) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + + private boolean canBePlacedOn(World worldIn, BlockPos pos) + { + return World.doesBlockHaveSolidTopSurface(worldIn, pos) || worldIn.getBlockState(pos).getBlock() instanceof BlockFence; + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + int i = this.getRedstoneStrength(state); + + if (i > 0) + { + this.updateState(worldIn, pos, state, i); + } + } + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (!worldIn.isRemote) + { + int i = this.getRedstoneStrength(state); + + if (i == 0) + { + this.updateState(worldIn, pos, state, i); + } + } + } + + protected void updateState(World worldIn, BlockPos pos, IBlockState state, int oldRedstoneStrength) + { + int i = this.computeRedstoneStrength(worldIn, pos); + boolean flag = oldRedstoneStrength > 0; + boolean flag1 = i > 0; + + if (oldRedstoneStrength != i) + { + state = this.setRedstoneStrength(state, i); + worldIn.setBlockState(pos, state, 2); + this.updateNeighbors(worldIn, pos); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + } + + if (!flag1 && flag) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, 0.5F); + } + else if (flag1 && !flag) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (flag1) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + } + + protected AxisAlignedBB getSensitiveAABB(BlockPos pos) + { + float f = 0.125F; + return new AxisAlignedBB((double)((float)pos.getX() + 0.125F), (double)pos.getY(), (double)((float)pos.getZ() + 0.125F), (double)((float)(pos.getX() + 1) - 0.125F), (double)pos.getY() + 0.25D, (double)((float)(pos.getZ() + 1) - 0.125F)); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (this.getRedstoneStrength(state) > 0) + { + this.updateNeighbors(worldIn, pos); + } + + super.breakBlock(worldIn, pos, state); + } + + protected void updateNeighbors(World worldIn, BlockPos pos) + { + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return this.getRedstoneStrength(state); + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return side == EnumFacing.UP ? this.getRedstoneStrength(state) : 0; + } + + public boolean canProvidePower() + { + return true; + } + + public void setBlockBoundsForItemRender() + { + float f = 0.5F; + float f1 = 0.125F; + float f2 = 0.5F; + this.setBlockBounds(0.0F, 0.375F, 0.0F, 1.0F, 0.625F, 1.0F); + } + + public int getMobilityFlag() + { + return 1; + } + + protected abstract int computeRedstoneStrength(World worldIn, BlockPos pos); + + protected abstract int getRedstoneStrength(IBlockState state); + + protected abstract IBlockState setRedstoneStrength(IBlockState state, int strength); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBeacon.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBeacon.java new file mode 100644 index 0000000..f238fe7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBeacon.java @@ -0,0 +1,141 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.HttpUtil; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; + +public class BlockBeacon extends BlockContainer +{ + public BlockBeacon() + { + super(Material.glass, MapColor.diamondColor); + this.setHardness(3.0F); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityBeacon(); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBeacon) + { + playerIn.displayGUIChest((TileEntityBeacon)tileentity); + playerIn.triggerAchievement(StatList.field_181730_N); + } + + return true; + } + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public int getRenderType() + { + return 3; + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + super.onBlockPlacedBy(worldIn, pos, state, placer, stack); + + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBeacon) + { + ((TileEntityBeacon)tileentity).setName(stack.getDisplayName()); + } + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBeacon) + { + ((TileEntityBeacon)tileentity).updateBeacon(); + worldIn.addBlockEvent(pos, this, 1, 0); + } + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public static void updateColorAsync(final World worldIn, final BlockPos glassPos) + { + HttpUtil.field_180193_a.submit(new Runnable() + { + public void run() + { + Chunk chunk = worldIn.getChunkFromBlockCoords(glassPos); + + for (int i = glassPos.getY() - 1; i >= 0; --i) + { + final BlockPos blockpos = new BlockPos(glassPos.getX(), i, glassPos.getZ()); + + if (!chunk.canSeeSky(blockpos)) + { + break; + } + + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() == Blocks.beacon) + { + ((WorldServer)worldIn).addScheduledTask(new Runnable() + { + public void run() + { + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityBeacon) + { + ((TileEntityBeacon)tileentity).updateBeacon(); + worldIn.addBlockEvent(blockpos, Blocks.beacon, 1, 0); + } + } + }); + } + } + } + }); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBed.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBed.java new file mode 100644 index 0000000..d222ca8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBed.java @@ -0,0 +1,311 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class BlockBed extends BlockDirectional +{ + public static final PropertyEnum PART = PropertyEnum.create("part", BlockBed.EnumPartType.class); + public static final PropertyBool OCCUPIED = PropertyBool.create("occupied"); + + public BlockBed() + { + super(Material.cloth); + this.setDefaultState(this.blockState.getBaseState().withProperty(PART, BlockBed.EnumPartType.FOOT).withProperty(OCCUPIED, Boolean.valueOf(false))); + this.setBedBounds(); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + if (state.getValue(PART) != BlockBed.EnumPartType.HEAD) + { + pos = pos.offset((EnumFacing)state.getValue(FACING)); + state = worldIn.getBlockState(pos); + + if (state.getBlock() != this) + { + return true; + } + } + + if (worldIn.provider.canRespawnHere() && worldIn.getBiomeGenForCoords(pos) != BiomeGenBase.hell) + { + if (((Boolean)state.getValue(OCCUPIED)).booleanValue()) + { + EntityPlayer entityplayer = this.getPlayerInBed(worldIn, pos); + + if (entityplayer != null) + { + playerIn.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0])); + return true; + } + + state = state.withProperty(OCCUPIED, Boolean.valueOf(false)); + worldIn.setBlockState(pos, state, 4); + } + + EntityPlayer.EnumStatus entityplayer$enumstatus = playerIn.trySleep(pos); + + if (entityplayer$enumstatus == EntityPlayer.EnumStatus.OK) + { + state = state.withProperty(OCCUPIED, Boolean.valueOf(true)); + worldIn.setBlockState(pos, state, 4); + return true; + } + else + { + if (entityplayer$enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) + { + playerIn.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0])); + } + else if (entityplayer$enumstatus == EntityPlayer.EnumStatus.NOT_SAFE) + { + playerIn.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0])); + } + + return true; + } + } + else + { + worldIn.setBlockToAir(pos); + BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); + + if (worldIn.getBlockState(blockpos).getBlock() == this) + { + worldIn.setBlockToAir(blockpos); + } + + worldIn.newExplosion((Entity)null, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 5.0F, true, true); + return true; + } + } + } + + private EntityPlayer getPlayerInBed(World worldIn, BlockPos pos) + { + for (EntityPlayer entityplayer : worldIn.playerEntities) + { + if (entityplayer.isPlayerSleeping() && entityplayer.playerLocation.equals(pos)) + { + return entityplayer; + } + } + + return null; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBedBounds(); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (state.getValue(PART) == BlockBed.EnumPartType.HEAD) + { + if (worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock() != this) + { + worldIn.setBlockToAir(pos); + } + } + else if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() != this) + { + worldIn.setBlockToAir(pos); + + if (!worldIn.isRemote) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return state.getValue(PART) == BlockBed.EnumPartType.HEAD ? null : Items.bed; + } + + private void setBedBounds() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); + } + + public static BlockPos getSafeExitLocation(World worldIn, BlockPos pos, int tries) + { + EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING); + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + + for (int l = 0; l <= 1; ++l) + { + int i1 = i - enumfacing.getFrontOffsetX() * l - 1; + int j1 = k - enumfacing.getFrontOffsetZ() * l - 1; + int k1 = i1 + 2; + int l1 = j1 + 2; + + for (int i2 = i1; i2 <= k1; ++i2) + { + for (int j2 = j1; j2 <= l1; ++j2) + { + BlockPos blockpos = new BlockPos(i2, j, j2); + + if (hasRoomForPlayer(worldIn, blockpos)) + { + if (tries <= 0) + { + return blockpos; + } + + --tries; + } + } + } + } + + return null; + } + + protected static boolean hasRoomForPlayer(World worldIn, BlockPos pos) + { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !worldIn.getBlockState(pos).getBlock().getMaterial().isSolid() && !worldIn.getBlockState(pos.up()).getBlock().getMaterial().isSolid(); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + if (state.getValue(PART) == BlockBed.EnumPartType.FOOT) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0); + } + } + + public int getMobilityFlag() + { + return 1; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.bed; + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + if (player.capabilities.isCreativeMode && state.getValue(PART) == BlockBed.EnumPartType.HEAD) + { + BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); + + if (worldIn.getBlockState(blockpos).getBlock() == this) + { + worldIn.setBlockToAir(blockpos); + } + } + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing = EnumFacing.getHorizontal(meta); + return (meta & 8) > 0 ? this.getDefaultState().withProperty(PART, BlockBed.EnumPartType.HEAD).withProperty(FACING, enumfacing).withProperty(OCCUPIED, Boolean.valueOf((meta & 4) > 0)) : this.getDefaultState().withProperty(PART, BlockBed.EnumPartType.FOOT).withProperty(FACING, enumfacing); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + if (state.getValue(PART) == BlockBed.EnumPartType.FOOT) + { + IBlockState iblockstate = worldIn.getBlockState(pos.offset((EnumFacing)state.getValue(FACING))); + + if (iblockstate.getBlock() == this) + { + state = state.withProperty(OCCUPIED, iblockstate.getValue(OCCUPIED)); + } + } + + return state; + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + + if (state.getValue(PART) == BlockBed.EnumPartType.HEAD) + { + i |= 8; + + if (((Boolean)state.getValue(OCCUPIED)).booleanValue()) + { + i |= 4; + } + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, PART, OCCUPIED}); + } + + public static enum EnumPartType implements IStringSerializable + { + HEAD("head"), + FOOT("foot"); + + private final String name; + + private EnumPartType(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBookshelf.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBookshelf.java new file mode 100644 index 0000000..7d9efd5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBookshelf.java @@ -0,0 +1,27 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockBookshelf extends Block +{ + public BlockBookshelf() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int quantityDropped(Random random) + { + return 3; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.book; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBreakable.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBreakable.java new file mode 100644 index 0000000..2a2da9d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBreakable.java @@ -0,0 +1,51 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; + +public class BlockBreakable extends Block +{ + private boolean ignoreSimilarity; + + protected BlockBreakable(Material materialIn, boolean ignoreSimilarityIn) + { + this(materialIn, ignoreSimilarityIn, materialIn.getMaterialMapColor()); + } + + protected BlockBreakable(Material p_i46393_1_, boolean p_i46393_2_, MapColor p_i46393_3_) + { + super(p_i46393_1_, p_i46393_3_); + this.ignoreSimilarity = p_i46393_2_; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (this == Blocks.glass || this == Blocks.stained_glass) + { + if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate) + { + return true; + } + + if (block == this) + { + return false; + } + } + + return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(worldIn, pos, side); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBrewingStand.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBrewingStand.java new file mode 100644 index 0000000..8fa32e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBrewingStand.java @@ -0,0 +1,186 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class BlockBrewingStand extends BlockContainer +{ + public static final PropertyBool[] HAS_BOTTLE = new PropertyBool[] {PropertyBool.create("has_bottle_0"), PropertyBool.create("has_bottle_1"), PropertyBool.create("has_bottle_2")}; + + public BlockBrewingStand() + { + super(Material.iron); + this.setDefaultState(this.blockState.getBaseState().withProperty(HAS_BOTTLE[0], Boolean.valueOf(false)).withProperty(HAS_BOTTLE[1], Boolean.valueOf(false)).withProperty(HAS_BOTTLE[2], Boolean.valueOf(false))); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal("item.brewingStand.name"); + } + + public boolean isOpaqueCube() + { + return false; + } + + public int getRenderType() + { + return 3; + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityBrewingStand(); + } + + public boolean isFullCube() + { + return false; + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBoundsForItemRender(); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBrewingStand) + { + playerIn.displayGUIChest((TileEntityBrewingStand)tileentity); + playerIn.triggerAchievement(StatList.field_181729_M); + } + + return true; + } + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBrewingStand) + { + ((TileEntityBrewingStand)tileentity).setName(stack.getDisplayName()); + } + } + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + double d0 = (double)((float)pos.getX() + 0.4F + rand.nextFloat() * 0.2F); + double d1 = (double)((float)pos.getY() + 0.7F + rand.nextFloat() * 0.3F); + double d2 = (double)((float)pos.getZ() + 0.4F + rand.nextFloat() * 0.2F); + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBrewingStand) + { + InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityBrewingStand)tileentity); + } + + super.breakBlock(worldIn, pos, state); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.brewing_stand; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.brewing_stand; + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return Container.calcRedstone(worldIn.getTileEntity(pos)); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState(); + + for (int i = 0; i < 3; ++i) + { + iblockstate = iblockstate.withProperty(HAS_BOTTLE[i], Boolean.valueOf((meta & 1 << i) > 0)); + } + + return iblockstate; + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + + for (int j = 0; j < 3; ++j) + { + if (((Boolean)state.getValue(HAS_BOTTLE[j])).booleanValue()) + { + i |= 1 << j; + } + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {HAS_BOTTLE[0], HAS_BOTTLE[1], HAS_BOTTLE[2]}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockBush.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBush.java new file mode 100644 index 0000000..c8021c8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockBush.java @@ -0,0 +1,89 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class BlockBush extends Block +{ + protected BlockBush() + { + this(Material.plants); + } + + protected BlockBush(Material materialIn) + { + this(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockBush(Material p_i46452_1_, MapColor p_i46452_2_) + { + super(p_i46452_1_, p_i46452_2_); + this.setTickRandomly(true); + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); + } + + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.farmland; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + this.checkAndDropBlock(worldIn, pos, state); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + this.checkAndDropBlock(worldIn, pos, state); + } + + protected void checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.canBlockStay(worldIn, pos, state)) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockState(pos, Blocks.air.getDefaultState(), 3); + } + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockButton.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockButton.java new file mode 100644 index 0000000..3960134 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockButton.java @@ -0,0 +1,352 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockButton extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + private final boolean wooden; + + protected BlockButton(boolean wooden) + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.wooden = wooden; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public int tickRate(World worldIn) + { + return this.wooden ? 30 : 20; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + return func_181088_a(worldIn, pos, side.getOpposite()); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (func_181088_a(worldIn, pos, enumfacing)) + { + return true; + } + } + + return false; + } + + protected static boolean func_181088_a(World p_181088_0_, BlockPos p_181088_1_, EnumFacing p_181088_2_) + { + BlockPos blockpos = p_181088_1_.offset(p_181088_2_); + return p_181088_2_ == EnumFacing.DOWN ? World.doesBlockHaveSolidTopSurface(p_181088_0_, blockpos) : p_181088_0_.getBlockState(blockpos).getBlock().isNormalCube(); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return func_181088_a(worldIn, pos, facing.getOpposite()) ? this.getDefaultState().withProperty(FACING, facing).withProperty(POWERED, Boolean.valueOf(false)) : this.getDefaultState().withProperty(FACING, EnumFacing.DOWN).withProperty(POWERED, Boolean.valueOf(false)); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (this.checkForDrop(worldIn, pos, state) && !func_181088_a(worldIn, pos, ((EnumFacing)state.getValue(FACING)).getOpposite())) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + + private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) + { + if (this.canPlaceBlockAt(worldIn, pos)) + { + return true; + } + else + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.updateBlockBounds(worldIn.getBlockState(pos)); + } + + private void updateBlockBounds(IBlockState state) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue(); + float f = 0.25F; + float f1 = 0.375F; + float f2 = (float)(flag ? 1 : 2) / 16.0F; + float f3 = 0.125F; + float f4 = 0.1875F; + + switch (enumfacing) + { + case EAST: + this.setBlockBounds(0.0F, 0.375F, 0.3125F, f2, 0.625F, 0.6875F); + break; + + case WEST: + this.setBlockBounds(1.0F - f2, 0.375F, 0.3125F, 1.0F, 0.625F, 0.6875F); + break; + + case SOUTH: + this.setBlockBounds(0.3125F, 0.375F, 0.0F, 0.6875F, 0.625F, f2); + break; + + case NORTH: + this.setBlockBounds(0.3125F, 0.375F, 1.0F - f2, 0.6875F, 0.625F, 1.0F); + break; + + case UP: + this.setBlockBounds(0.3125F, 0.0F, 0.375F, 0.6875F, 0.0F + f2, 0.625F); + break; + + case DOWN: + this.setBlockBounds(0.3125F, 1.0F - f2, 0.375F, 0.6875F, 1.0F, 0.625F); + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + return true; + } + else + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, 0.6F); + this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING)); + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + return true; + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING)); + } + + super.breakBlock(worldIn, pos, state); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (state.getValue(FACING) == side ? 15 : 0); + } + + public boolean canProvidePower() + { + return true; + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + if (this.wooden) + { + this.checkForArrows(worldIn, pos, state); + } + else + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); + this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING)); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, 0.5F); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + } + } + } + } + + public void setBlockBoundsForItemRender() + { + float f = 0.1875F; + float f1 = 0.125F; + float f2 = 0.125F; + this.setBlockBounds(0.5F - f, 0.5F - f1, 0.5F - f2, 0.5F + f, 0.5F + f1, 0.5F + f2); + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (!worldIn.isRemote) + { + if (this.wooden) + { + if (!((Boolean)state.getValue(POWERED)).booleanValue()) + { + this.checkForArrows(worldIn, pos, state); + } + } + } + } + + private void checkForArrows(World worldIn, BlockPos pos, IBlockState state) + { + this.updateBlockBounds(state); + List list = worldIn.getEntitiesWithinAABB(EntityArrow.class, new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ)); + boolean flag = !list.isEmpty(); + boolean flag1 = ((Boolean)state.getValue(POWERED)).booleanValue(); + + if (flag && !flag1) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true))); + this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING)); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (!flag && flag1) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); + this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING)); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, 0.5F); + } + + if (flag) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + } + + private void notifyNeighbors(World worldIn, BlockPos pos, EnumFacing facing) + { + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.offset(facing.getOpposite()), this); + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing; + + switch (meta & 7) + { + case 0: + enumfacing = EnumFacing.DOWN; + break; + + case 1: + enumfacing = EnumFacing.EAST; + break; + + case 2: + enumfacing = EnumFacing.WEST; + break; + + case 3: + enumfacing = EnumFacing.SOUTH; + break; + + case 4: + enumfacing = EnumFacing.NORTH; + break; + + case 5: + default: + enumfacing = EnumFacing.UP; + } + + return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i; + + switch ((EnumFacing)state.getValue(FACING)) + { + case EAST: + i = 1; + break; + + case WEST: + i = 2; + break; + + case SOUTH: + i = 3; + break; + + case NORTH: + i = 4; + break; + + case UP: + default: + i = 5; + break; + + case DOWN: + i = 0; + } + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, POWERED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockButtonStone.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockButtonStone.java new file mode 100644 index 0000000..36e566b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockButtonStone.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockButtonStone extends BlockButton +{ + protected BlockButtonStone() + { + super(false); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockButtonWood.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockButtonWood.java new file mode 100644 index 0000000..7ba8894 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockButtonWood.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockButtonWood extends BlockButton +{ + protected BlockButtonWood() + { + super(true); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCactus.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCactus.java new file mode 100644 index 0000000..68cde19 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCactus.java @@ -0,0 +1,136 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class BlockCactus extends Block +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + + protected BlockCactus() + { + super(Material.cactus); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + BlockPos blockpos = pos.up(); + + if (worldIn.isAirBlock(blockpos)) + { + int i; + + for (i = 1; worldIn.getBlockState(pos.down(i)).getBlock() == this; ++i) + { + ; + } + + if (i < 3) + { + int j = ((Integer)state.getValue(AGE)).intValue(); + + if (j == 15) + { + worldIn.setBlockState(blockpos, this.getDefaultState()); + IBlockState iblockstate = state.withProperty(AGE, Integer.valueOf(0)); + worldIn.setBlockState(pos, iblockstate, 4); + this.onNeighborBlockChange(worldIn, blockpos, iblockstate, this); + } + else + { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(j + 1)), 4); + } + } + } + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + float f = 0.0625F; + return new AxisAlignedBB((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)((float)(pos.getY() + 1) - f), (double)((float)(pos.getZ() + 1) - f)); + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + float f = 0.0625F; + return new AxisAlignedBB((double)((float)pos.getX() + f), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)(pos.getY() + 1), (double)((float)(pos.getZ() + 1) - f)); + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) ? this.canBlockStay(worldIn, pos) : false; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!this.canBlockStay(worldIn, pos)) + { + worldIn.destroyBlock(pos, true); + } + } + + public boolean canBlockStay(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid()) + { + return false; + } + } + + Block block = worldIn.getBlockState(pos.down()).getBlock(); + return block == Blocks.cactus || block == Blocks.sand; + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + entityIn.attackEntityFrom(DamageSource.cactus, 1.0F); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AGE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCake.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCake.java new file mode 100644 index 0000000..f79d370 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCake.java @@ -0,0 +1,161 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCake extends Block +{ + public static final PropertyInteger BITES = PropertyInteger.create("bites", 0, 6); + + protected BlockCake() + { + super(Material.cake); + this.setDefaultState(this.blockState.getBaseState().withProperty(BITES, Integer.valueOf(0))); + this.setTickRandomly(true); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + float f = 0.0625F; + float f1 = (float)(1 + ((Integer)worldIn.getBlockState(pos).getValue(BITES)).intValue() * 2) / 16.0F; + float f2 = 0.5F; + this.setBlockBounds(f1, 0.0F, f, 1.0F - f, f2, 1.0F - f); + } + + public void setBlockBoundsForItemRender() + { + float f = 0.0625F; + float f1 = 0.5F; + this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + float f = 0.0625F; + float f1 = (float)(1 + ((Integer)state.getValue(BITES)).intValue() * 2) / 16.0F; + float f2 = 0.5F; + return new AxisAlignedBB((double)((float)pos.getX() + f1), (double)pos.getY(), (double)((float)pos.getZ() + f), (double)((float)(pos.getX() + 1) - f), (double)((float)pos.getY() + f2), (double)((float)(pos.getZ() + 1) - f)); + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + return this.getCollisionBoundingBox(worldIn, pos, worldIn.getBlockState(pos)); + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + this.eatCake(worldIn, pos, state, playerIn); + return true; + } + + public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) + { + this.eatCake(worldIn, pos, worldIn.getBlockState(pos), playerIn); + } + + private void eatCake(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + if (player.canEat(false)) + { + player.triggerAchievement(StatList.field_181724_H); + player.getFoodStats().addStats(2, 0.1F); + int i = ((Integer)state.getValue(BITES)).intValue(); + + if (i < 6) + { + worldIn.setBlockState(pos, state.withProperty(BITES, Integer.valueOf(i + 1)), 3); + } + else + { + worldIn.setBlockToAir(pos); + } + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) ? this.canBlockStay(worldIn, pos) : false; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!this.canBlockStay(worldIn, pos)) + { + worldIn.setBlockToAir(pos); + } + } + + private boolean canBlockStay(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos.down()).getBlock().getMaterial().isSolid(); + } + + public int quantityDropped(Random random) + { + return 0; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.cake; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(BITES, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(BITES)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {BITES}); + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return (7 - ((Integer)worldIn.getBlockState(pos).getValue(BITES)).intValue()) * 2; + } + + public boolean hasComparatorInputOverride() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCarpet.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCarpet.java new file mode 100644 index 0000000..64a6003 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCarpet.java @@ -0,0 +1,126 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCarpet extends Block +{ + public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class); + + protected BlockCarpet() + { + super(Material.carpet); + this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE)); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBoundsFromMeta(0); + } + + public MapColor getMapColor(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMapColor(); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBoundsFromMeta(0); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBlockBoundsFromMeta(0); + } + + protected void setBlockBoundsFromMeta(int meta) + { + int i = 0; + float f = (float)(1 * (1 + i)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) && this.canBlockStay(worldIn, pos); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + this.checkForDrop(worldIn, pos, state); + } + + private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.canBlockStay(worldIn, pos)) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } + else + { + return true; + } + } + + private boolean canBlockStay(World worldIn, BlockPos pos) + { + return !worldIn.isAirBlock(pos.down()); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return side == EnumFacing.UP ? true : super.shouldSideBeRendered(worldIn, pos, side); + } + + public int damageDropped(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < 16; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {COLOR}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCarrot.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCarrot.java new file mode 100644 index 0000000..2d8ab48 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCarrot.java @@ -0,0 +1,17 @@ +package net.minecraft.block; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockCarrot extends BlockCrops +{ + protected Item getSeed() + { + return Items.carrot; + } + + protected Item getCrop() + { + return Items.carrot; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCauldron.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCauldron.java new file mode 100644 index 0000000..ccc0324 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCauldron.java @@ -0,0 +1,259 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBanner; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockCauldron extends Block +{ + public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 3); + + public BlockCauldron() + { + super(Material.iron, MapColor.stoneColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(LEVEL, Integer.valueOf(0))); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + float f = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBoundsForItemRender(); + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + int i = ((Integer)state.getValue(LEVEL)).intValue(); + float f = (float)pos.getY() + (6.0F + (float)(3 * i)) / 16.0F; + + if (!worldIn.isRemote && entityIn.isBurning() && i > 0 && entityIn.getEntityBoundingBox().minY <= (double)f) + { + entityIn.extinguish(); + this.setWaterLevel(worldIn, pos, state, i - 1); + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + ItemStack itemstack = playerIn.inventory.getCurrentItem(); + + if (itemstack == null) + { + return true; + } + else + { + int i = ((Integer)state.getValue(LEVEL)).intValue(); + Item item = itemstack.getItem(); + + if (item == Items.water_bucket) + { + if (i < 3) + { + if (!playerIn.capabilities.isCreativeMode) + { + playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, new ItemStack(Items.bucket)); + } + + playerIn.triggerAchievement(StatList.field_181725_I); + this.setWaterLevel(worldIn, pos, state, 3); + } + + return true; + } + else if (item == Items.glass_bottle) + { + if (i > 0) + { + if (!playerIn.capabilities.isCreativeMode) + { + ItemStack itemstack2 = new ItemStack(Items.potionitem, 1, 0); + + if (!playerIn.inventory.addItemStackToInventory(itemstack2)) + { + worldIn.spawnEntityInWorld(new EntityItem(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.5D, (double)pos.getZ() + 0.5D, itemstack2)); + } + else if (playerIn instanceof EntityPlayerMP) + { + ((EntityPlayerMP)playerIn).sendContainerToPlayer(playerIn.inventoryContainer); + } + + playerIn.triggerAchievement(StatList.field_181726_J); + --itemstack.stackSize; + + if (itemstack.stackSize <= 0) + { + playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, (ItemStack)null); + } + } + + this.setWaterLevel(worldIn, pos, state, i - 1); + } + + return true; + } + else + { + if (i > 0 && item instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)item; + + if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER && itemarmor.hasColor(itemstack)) + { + itemarmor.removeColor(itemstack); + this.setWaterLevel(worldIn, pos, state, i - 1); + playerIn.triggerAchievement(StatList.field_181727_K); + return true; + } + } + + if (i > 0 && item instanceof ItemBanner && TileEntityBanner.getPatterns(itemstack) > 0) + { + ItemStack itemstack1 = itemstack.copy(); + itemstack1.stackSize = 1; + TileEntityBanner.removeBannerData(itemstack1); + + if (itemstack.stackSize <= 1 && !playerIn.capabilities.isCreativeMode) + { + playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, itemstack1); + } + else + { + if (!playerIn.inventory.addItemStackToInventory(itemstack1)) + { + worldIn.spawnEntityInWorld(new EntityItem(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.5D, (double)pos.getZ() + 0.5D, itemstack1)); + } + else if (playerIn instanceof EntityPlayerMP) + { + ((EntityPlayerMP)playerIn).sendContainerToPlayer(playerIn.inventoryContainer); + } + + playerIn.triggerAchievement(StatList.field_181728_L); + + if (!playerIn.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + } + + if (!playerIn.capabilities.isCreativeMode) + { + this.setWaterLevel(worldIn, pos, state, i - 1); + } + + return true; + } + else + { + return false; + } + } + } + } + } + + public void setWaterLevel(World worldIn, BlockPos pos, IBlockState state, int level) + { + worldIn.setBlockState(pos, state.withProperty(LEVEL, Integer.valueOf(MathHelper.clamp_int(level, 0, 3))), 2); + worldIn.updateComparatorOutputLevel(pos, this); + } + + public void fillWithRain(World worldIn, BlockPos pos) + { + if (worldIn.rand.nextInt(20) == 1) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (((Integer)iblockstate.getValue(LEVEL)).intValue() < 3) + { + worldIn.setBlockState(pos, iblockstate.cycleProperty(LEVEL), 2); + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.cauldron; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.cauldron; + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return ((Integer)worldIn.getBlockState(pos).getValue(LEVEL)).intValue(); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(LEVEL, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(LEVEL)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {LEVEL}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockChest.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockChest.java new file mode 100644 index 0000000..93354b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockChest.java @@ -0,0 +1,579 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.inventory.InventoryLargeChest; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.World; + +public class BlockChest extends BlockContainer +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public final int chestType; + + protected BlockChest(int type) + { + super(Material.wood); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.chestType = type; + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public int getRenderType() + { + return 2; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + if (worldIn.getBlockState(pos.north()).getBlock() == this) + { + this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F); + } + else if (worldIn.getBlockState(pos.south()).getBlock() == this) + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F); + } + else if (worldIn.getBlockState(pos.west()).getBlock() == this) + { + this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + else if (worldIn.getBlockState(pos.east()).getBlock() == this) + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F); + } + else + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.checkForSurroundingChests(worldIn, pos, state); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos.offset(enumfacing); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() == this) + { + this.checkForSurroundingChests(worldIn, blockpos, iblockstate); + } + } + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing()); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + EnumFacing enumfacing = EnumFacing.getHorizontal(MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3).getOpposite(); + state = state.withProperty(FACING, enumfacing); + BlockPos blockpos = pos.north(); + BlockPos blockpos1 = pos.south(); + BlockPos blockpos2 = pos.west(); + BlockPos blockpos3 = pos.east(); + boolean flag = this == worldIn.getBlockState(blockpos).getBlock(); + boolean flag1 = this == worldIn.getBlockState(blockpos1).getBlock(); + boolean flag2 = this == worldIn.getBlockState(blockpos2).getBlock(); + boolean flag3 = this == worldIn.getBlockState(blockpos3).getBlock(); + + if (!flag && !flag1 && !flag2 && !flag3) + { + worldIn.setBlockState(pos, state, 3); + } + else if (enumfacing.getAxis() != EnumFacing.Axis.X || !flag && !flag1) + { + if (enumfacing.getAxis() == EnumFacing.Axis.Z && (flag2 || flag3)) + { + if (flag2) + { + worldIn.setBlockState(blockpos2, state, 3); + } + else + { + worldIn.setBlockState(blockpos3, state, 3); + } + + worldIn.setBlockState(pos, state, 3); + } + } + else + { + if (flag) + { + worldIn.setBlockState(blockpos, state, 3); + } + else + { + worldIn.setBlockState(blockpos1, state, 3); + } + + worldIn.setBlockState(pos, state, 3); + } + + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityChest) + { + ((TileEntityChest)tileentity).setCustomName(stack.getDisplayName()); + } + } + } + + public IBlockState checkForSurroundingChests(World worldIn, BlockPos pos, IBlockState state) + { + if (worldIn.isRemote) + { + return state; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos.north()); + IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); + IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); + IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + Block block = iblockstate.getBlock(); + Block block1 = iblockstate1.getBlock(); + Block block2 = iblockstate2.getBlock(); + Block block3 = iblockstate3.getBlock(); + + if (block != this && block1 != this) + { + boolean flag = block.isFullBlock(); + boolean flag1 = block1.isFullBlock(); + + if (block2 == this || block3 == this) + { + BlockPos blockpos1 = block2 == this ? pos.west() : pos.east(); + IBlockState iblockstate6 = worldIn.getBlockState(blockpos1.north()); + IBlockState iblockstate7 = worldIn.getBlockState(blockpos1.south()); + enumfacing = EnumFacing.SOUTH; + EnumFacing enumfacing2; + + if (block2 == this) + { + enumfacing2 = (EnumFacing)iblockstate2.getValue(FACING); + } + else + { + enumfacing2 = (EnumFacing)iblockstate3.getValue(FACING); + } + + if (enumfacing2 == EnumFacing.NORTH) + { + enumfacing = EnumFacing.NORTH; + } + + Block block6 = iblockstate6.getBlock(); + Block block7 = iblockstate7.getBlock(); + + if ((flag || block6.isFullBlock()) && !flag1 && !block7.isFullBlock()) + { + enumfacing = EnumFacing.SOUTH; + } + + if ((flag1 || block7.isFullBlock()) && !flag && !block6.isFullBlock()) + { + enumfacing = EnumFacing.NORTH; + } + } + } + else + { + BlockPos blockpos = block == this ? pos.north() : pos.south(); + IBlockState iblockstate4 = worldIn.getBlockState(blockpos.west()); + IBlockState iblockstate5 = worldIn.getBlockState(blockpos.east()); + enumfacing = EnumFacing.EAST; + EnumFacing enumfacing1; + + if (block == this) + { + enumfacing1 = (EnumFacing)iblockstate.getValue(FACING); + } + else + { + enumfacing1 = (EnumFacing)iblockstate1.getValue(FACING); + } + + if (enumfacing1 == EnumFacing.WEST) + { + enumfacing = EnumFacing.WEST; + } + + Block block4 = iblockstate4.getBlock(); + Block block5 = iblockstate5.getBlock(); + + if ((block2.isFullBlock() || block4.isFullBlock()) && !block3.isFullBlock() && !block5.isFullBlock()) + { + enumfacing = EnumFacing.EAST; + } + + if ((block3.isFullBlock() || block5.isFullBlock()) && !block2.isFullBlock() && !block4.isFullBlock()) + { + enumfacing = EnumFacing.WEST; + } + } + + state = state.withProperty(FACING, enumfacing); + worldIn.setBlockState(pos, state, 3); + return state; + } + } + + public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state) + { + EnumFacing enumfacing = null; + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) + { + IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1)); + + if (iblockstate.getBlock() == this) + { + return state; + } + + if (iblockstate.getBlock().isFullBlock()) + { + if (enumfacing != null) + { + enumfacing = null; + break; + } + + enumfacing = enumfacing1; + } + } + + if (enumfacing != null) + { + return state.withProperty(FACING, enumfacing.getOpposite()); + } + else + { + EnumFacing enumfacing2 = (EnumFacing)state.getValue(FACING); + + if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) + { + enumfacing2 = enumfacing2.getOpposite(); + } + + if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) + { + enumfacing2 = enumfacing2.rotateY(); + } + + if (worldIn.getBlockState(pos.offset(enumfacing2)).getBlock().isFullBlock()) + { + enumfacing2 = enumfacing2.getOpposite(); + } + + return state.withProperty(FACING, enumfacing2); + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + int i = 0; + BlockPos blockpos = pos.west(); + BlockPos blockpos1 = pos.east(); + BlockPos blockpos2 = pos.north(); + BlockPos blockpos3 = pos.south(); + + if (worldIn.getBlockState(blockpos).getBlock() == this) + { + if (this.isDoubleChest(worldIn, blockpos)) + { + return false; + } + + ++i; + } + + if (worldIn.getBlockState(blockpos1).getBlock() == this) + { + if (this.isDoubleChest(worldIn, blockpos1)) + { + return false; + } + + ++i; + } + + if (worldIn.getBlockState(blockpos2).getBlock() == this) + { + if (this.isDoubleChest(worldIn, blockpos2)) + { + return false; + } + + ++i; + } + + if (worldIn.getBlockState(blockpos3).getBlock() == this) + { + if (this.isDoubleChest(worldIn, blockpos3)) + { + return false; + } + + ++i; + } + + return i <= 1; + } + + private boolean isDoubleChest(World worldIn, BlockPos pos) + { + if (worldIn.getBlockState(pos).getBlock() != this) + { + return false; + } + else + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() == this) + { + return true; + } + } + + return false; + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityChest) + { + tileentity.updateContainingBlockInfo(); + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof IInventory) + { + InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity); + worldIn.updateComparatorOutputLevel(pos, this); + } + + super.breakBlock(worldIn, pos, state); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + ILockableContainer ilockablecontainer = this.getLockableContainer(worldIn, pos); + + if (ilockablecontainer != null) + { + playerIn.displayGUIChest(ilockablecontainer); + + if (this.chestType == 0) + { + playerIn.triggerAchievement(StatList.field_181723_aa); + } + else if (this.chestType == 1) + { + playerIn.triggerAchievement(StatList.field_181737_U); + } + } + + return true; + } + } + + public ILockableContainer getLockableContainer(World worldIn, BlockPos pos) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (!(tileentity instanceof TileEntityChest)) + { + return null; + } + else + { + ILockableContainer ilockablecontainer = (TileEntityChest)tileentity; + + if (this.isBlocked(worldIn, pos)) + { + return null; + } + else + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos.offset(enumfacing); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block == this) + { + if (this.isBlocked(worldIn, blockpos)) + { + return null; + } + + TileEntity tileentity1 = worldIn.getTileEntity(blockpos); + + if (tileentity1 instanceof TileEntityChest) + { + if (enumfacing != EnumFacing.WEST && enumfacing != EnumFacing.NORTH) + { + ilockablecontainer = new InventoryLargeChest("container.chestDouble", ilockablecontainer, (TileEntityChest)tileentity1); + } + else + { + ilockablecontainer = new InventoryLargeChest("container.chestDouble", (TileEntityChest)tileentity1, ilockablecontainer); + } + } + } + } + + return ilockablecontainer; + } + } + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityChest(); + } + + public boolean canProvidePower() + { + return this.chestType == 1; + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + if (!this.canProvidePower()) + { + return 0; + } + else + { + int i = 0; + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityChest) + { + i = ((TileEntityChest)tileentity).numPlayersUsing; + } + + return MathHelper.clamp_int(i, 0, 15); + } + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return side == EnumFacing.UP ? this.getWeakPower(worldIn, pos, state, side) : 0; + } + + private boolean isBlocked(World worldIn, BlockPos pos) + { + return this.isBelowSolidBlock(worldIn, pos) || this.isOcelotSittingOnChest(worldIn, pos); + } + + private boolean isBelowSolidBlock(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); + } + + private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos) + { + for (Entity entity : worldIn.getEntitiesWithinAABB(EntityOcelot.class, new AxisAlignedBB((double)pos.getX(), (double)(pos.getY() + 1), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 2), (double)(pos.getZ() + 1)))) + { + EntityOcelot entityocelot = (EntityOcelot)entity; + + if (entityocelot.isSitting()) + { + return true; + } + } + + return false; + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos)); + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing = EnumFacing.getFront(meta); + + if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumFacing)state.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockClay.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockClay.java new file mode 100644 index 0000000..4b2af21 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockClay.java @@ -0,0 +1,27 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockClay extends Block +{ + public BlockClay() + { + super(Material.clay); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.clay_ball; + } + + public int quantityDropped(Random random) + { + return 4; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCocoa.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCocoa.java new file mode 100644 index 0000000..0cdad7e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCocoa.java @@ -0,0 +1,201 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCocoa extends BlockDirectional implements IGrowable +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 2); + + public BlockCocoa() + { + super(Material.plants); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!this.canBlockStay(worldIn, pos, state)) + { + this.dropBlock(worldIn, pos, state); + } + else if (worldIn.rand.nextInt(5) == 0) + { + int i = ((Integer)state.getValue(AGE)).intValue(); + + if (i < 2) + { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(i + 1)), 2); + } + } + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + pos = pos.offset((EnumFacing)state.getValue(FACING)); + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock() == Blocks.log && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getCollisionBoundingBox(worldIn, pos, state); + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getSelectedBoundingBox(worldIn, pos); + } + + @SuppressWarnings("incomplete-switch") + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); + int i = ((Integer)iblockstate.getValue(AGE)).intValue(); + int j = 4 + i * 2; + int k = 5 + i * 2; + float f = (float)j / 2.0F; + + switch (enumfacing) + { + case SOUTH: + this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)k) / 16.0F, (15.0F - (float)j) / 16.0F, (8.0F + f) / 16.0F, 0.75F, 0.9375F); + break; + + case NORTH: + this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)k) / 16.0F, 0.0625F, (8.0F + f) / 16.0F, 0.75F, (1.0F + (float)j) / 16.0F); + break; + + case WEST: + this.setBlockBounds(0.0625F, (12.0F - (float)k) / 16.0F, (8.0F - f) / 16.0F, (1.0F + (float)j) / 16.0F, 0.75F, (8.0F + f) / 16.0F); + break; + + case EAST: + this.setBlockBounds((15.0F - (float)j) / 16.0F, (12.0F - (float)k) / 16.0F, (8.0F - f) / 16.0F, 0.9375F, 0.75F, (8.0F + f) / 16.0F); + } + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + EnumFacing enumfacing = EnumFacing.fromAngle((double)placer.rotationYaw); + worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + if (!facing.getAxis().isHorizontal()) + { + facing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, facing.getOpposite()).withProperty(AGE, Integer.valueOf(0)); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!this.canBlockStay(worldIn, pos, state)) + { + this.dropBlock(worldIn, pos, state); + } + } + + private void dropBlock(World worldIn, BlockPos pos, IBlockState state) + { + worldIn.setBlockState(pos, Blocks.air.getDefaultState(), 3); + this.dropBlockAsItem(worldIn, pos, state, 0); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + int i = ((Integer)state.getValue(AGE)).intValue(); + int j = 1; + + if (i >= 2) + { + j = 3; + } + + for (int k = 0; k < j; ++k) + { + spawnAsEntity(worldIn, pos, new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage())); + } + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.dye; + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + return EnumDyeColor.BROWN.getDyeDamage(); + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + return ((Integer)state.getValue(AGE)).intValue() < 2; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return true; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(((Integer)state.getValue(AGE)).intValue() + 1)), 2); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(AGE, Integer.valueOf((meta & 15) >> 2)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + i = i | ((Integer)state.getValue(AGE)).intValue() << 2; + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, AGE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockColored.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockColored.java new file mode 100644 index 0000000..acb3cf7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockColored.java @@ -0,0 +1,58 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class BlockColored extends Block +{ + public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class); + + public BlockColored(Material materialIn) + { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int damageDropped(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) + { + list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata())); + } + } + + public MapColor getMapColor(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMapColor(); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {COLOR}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCommandBlock.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCommandBlock.java new file mode 100644 index 0000000..3f4d397 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCommandBlock.java @@ -0,0 +1,143 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockCommandBlock extends BlockContainer +{ + public static final PropertyBool TRIGGERED = PropertyBool.create("triggered"); + + public BlockCommandBlock() + { + super(Material.iron, MapColor.adobeColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(TRIGGERED, Boolean.valueOf(false))); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityCommandBlock(); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + boolean flag = worldIn.isBlockPowered(pos); + boolean flag1 = ((Boolean)state.getValue(TRIGGERED)).booleanValue(); + + if (flag && !flag1) + { + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(true)), 4); + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + else if (!flag && flag1) + { + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(false)), 4); + } + } + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityCommandBlock) + { + ((TileEntityCommandBlock)tileentity).getCommandBlockLogic().trigger(worldIn); + worldIn.updateComparatorOutputLevel(pos, this); + } + } + + public int tickRate(World worldIn) + { + return 1; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)tileentity).getCommandBlockLogic().tryOpenEditCommandBlock(playerIn) : false; + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)tileentity).getCommandBlockLogic().getSuccessCount() : 0; + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityCommandBlock) + { + CommandBlockLogic commandblocklogic = ((TileEntityCommandBlock)tileentity).getCommandBlockLogic(); + + if (stack.hasDisplayName()) + { + commandblocklogic.setName(stack.getDisplayName()); + } + + if (!worldIn.isRemote) + { + commandblocklogic.setTrackOutput(worldIn.getGameRules().getBoolean("sendCommandFeedback")); + } + } + } + + public int quantityDropped(Random random) + { + return 0; + } + + public int getRenderType() + { + return 3; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(TRIGGERED, Boolean.valueOf((meta & 1) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + + if (((Boolean)state.getValue(TRIGGERED)).booleanValue()) + { + i |= 1; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {TRIGGERED}); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(TRIGGERED, Boolean.valueOf(false)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCompressedPowered.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCompressedPowered.java new file mode 100644 index 0000000..0792898 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCompressedPowered.java @@ -0,0 +1,26 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; + +public class BlockCompressedPowered extends Block +{ + public BlockCompressedPowered(Material p_i46386_1_, MapColor p_i46386_2_) + { + super(p_i46386_1_, p_i46386_2_); + } + + public boolean canProvidePower() + { + return true; + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return 15; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockContainer.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockContainer.java new file mode 100644 index 0000000..2730ace --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockContainer.java @@ -0,0 +1,51 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public abstract class BlockContainer extends Block implements ITileEntityProvider +{ + protected BlockContainer(Material materialIn) + { + this(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockContainer(Material p_i46402_1_, MapColor p_i46402_2_) + { + super(p_i46402_1_, p_i46402_2_); + this.isBlockContainer = true; + } + + protected boolean isInvalidNeighbor(World p_181086_1_, BlockPos p_181086_2_, EnumFacing p_181086_3_) + { + return p_181086_1_.getBlockState(p_181086_2_.offset(p_181086_3_)).getBlock().getMaterial() == Material.cactus; + } + + protected boolean hasInvalidNeighbor(World p_181087_1_, BlockPos p_181087_2_) + { + return this.isInvalidNeighbor(p_181087_1_, p_181087_2_, EnumFacing.NORTH) || this.isInvalidNeighbor(p_181087_1_, p_181087_2_, EnumFacing.SOUTH) || this.isInvalidNeighbor(p_181087_1_, p_181087_2_, EnumFacing.WEST) || this.isInvalidNeighbor(p_181087_1_, p_181087_2_, EnumFacing.EAST); + } + + public int getRenderType() + { + return -1; + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + super.breakBlock(worldIn, pos, state); + worldIn.removeTileEntity(pos); + } + + public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + { + super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam); + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockCrops.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCrops.java new file mode 100644 index 0000000..3daa02a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockCrops.java @@ -0,0 +1,202 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockCrops extends BlockBush implements IGrowable +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7); + + protected BlockCrops() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + float f = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs)null); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.disableStats(); + } + + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.farmland; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + super.updateTick(worldIn, pos, state, rand); + + if (worldIn.getLightFromNeighbors(pos.up()) >= 9) + { + int i = ((Integer)state.getValue(AGE)).intValue(); + + if (i < 7) + { + float f = getGrowthChance(this, worldIn, pos); + + if (rand.nextInt((int)(25.0F / f) + 1) == 0) + { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(i + 1)), 2); + } + } + } + } + + public void grow(World worldIn, BlockPos pos, IBlockState state) + { + int i = ((Integer)state.getValue(AGE)).intValue() + MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); + + if (i > 7) + { + i = 7; + } + + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(i)), 2); + } + + protected static float getGrowthChance(Block blockIn, World worldIn, BlockPos pos) + { + float f = 1.0F; + BlockPos blockpos = pos.down(); + + for (int i = -1; i <= 1; ++i) + { + for (int j = -1; j <= 1; ++j) + { + float f1 = 0.0F; + IBlockState iblockstate = worldIn.getBlockState(blockpos.add(i, 0, j)); + + if (iblockstate.getBlock() == Blocks.farmland) + { + f1 = 1.0F; + + if (((Integer)iblockstate.getValue(BlockFarmland.MOISTURE)).intValue() > 0) + { + f1 = 3.0F; + } + } + + if (i != 0 || j != 0) + { + f1 /= 4.0F; + } + + f += f1; + } + } + + BlockPos blockpos1 = pos.north(); + BlockPos blockpos2 = pos.south(); + BlockPos blockpos3 = pos.west(); + BlockPos blockpos4 = pos.east(); + boolean flag = blockIn == worldIn.getBlockState(blockpos3).getBlock() || blockIn == worldIn.getBlockState(blockpos4).getBlock(); + boolean flag1 = blockIn == worldIn.getBlockState(blockpos1).getBlock() || blockIn == worldIn.getBlockState(blockpos2).getBlock(); + + if (flag && flag1) + { + f /= 2.0F; + } + else + { + boolean flag2 = blockIn == worldIn.getBlockState(blockpos3.north()).getBlock() || blockIn == worldIn.getBlockState(blockpos4.north()).getBlock() || blockIn == worldIn.getBlockState(blockpos4.south()).getBlock() || blockIn == worldIn.getBlockState(blockpos3.south()).getBlock(); + + if (flag2) + { + f /= 2.0F; + } + } + + return f; + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); + } + + protected Item getSeed() + { + return Items.wheat_seeds; + } + + protected Item getCrop() + { + return Items.wheat; + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0); + + if (!worldIn.isRemote) + { + int i = ((Integer)state.getValue(AGE)).intValue(); + + if (i >= 7) + { + int j = 3 + fortune; + + for (int k = 0; k < j; ++k) + { + if (worldIn.rand.nextInt(15) <= i) + { + spawnAsEntity(worldIn, pos, new ItemStack(this.getSeed(), 1, 0)); + } + } + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return ((Integer)state.getValue(AGE)).intValue() == 7 ? this.getCrop() : this.getSeed(); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return this.getSeed(); + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + return ((Integer)state.getValue(AGE)).intValue() < 7; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return true; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + this.grow(worldIn, pos, state); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AGE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDaylightDetector.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDaylightDetector.java new file mode 100644 index 0000000..b954cee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDaylightDetector.java @@ -0,0 +1,162 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDaylightDetector; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDaylightDetector extends BlockContainer +{ + public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + private final boolean inverted; + + public BlockDaylightDetector(boolean inverted) + { + super(Material.wood); + this.inverted = inverted; + this.setDefaultState(this.blockState.getBaseState().withProperty(POWER, Integer.valueOf(0))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setHardness(0.2F); + this.setStepSound(soundTypeWood); + this.setUnlocalizedName("daylightDetector"); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return ((Integer)state.getValue(POWER)).intValue(); + } + + public void updatePower(World worldIn, BlockPos pos) + { + if (!worldIn.provider.getHasNoSky()) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + int i = worldIn.getLightFor(EnumSkyBlock.SKY, pos) - worldIn.getSkylightSubtracted(); + float f = worldIn.getCelestialAngleRadians(1.0F); + float f1 = f < (float)Math.PI ? 0.0F : ((float)Math.PI * 2F); + f = f + (f1 - f) * 0.2F; + i = Math.round((float)i * MathHelper.cos(f)); + i = MathHelper.clamp_int(i, 0, 15); + + if (this.inverted) + { + i = 15 - i; + } + + if (((Integer)iblockstate.getValue(POWER)).intValue() != i) + { + worldIn.setBlockState(pos, iblockstate.withProperty(POWER, Integer.valueOf(i)), 3); + } + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (playerIn.isAllowEdit()) + { + if (worldIn.isRemote) + { + return true; + } + else + { + if (this.inverted) + { + worldIn.setBlockState(pos, Blocks.daylight_detector.getDefaultState().withProperty(POWER, state.getValue(POWER)), 4); + Blocks.daylight_detector.updatePower(worldIn, pos); + } + else + { + worldIn.setBlockState(pos, Blocks.daylight_detector_inverted.getDefaultState().withProperty(POWER, state.getValue(POWER)), 4); + Blocks.daylight_detector_inverted.updatePower(worldIn, pos); + } + + return true; + } + } + else + { + return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.daylight_detector); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.daylight_detector); + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public int getRenderType() + { + return 3; + } + + public boolean canProvidePower() + { + return true; + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityDaylightDetector(); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(POWER, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(POWER)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {POWER}); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + if (!this.inverted) + { + super.getSubBlocks(itemIn, tab, list); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDeadBush.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDeadBush.java new file mode 100644 index 0000000..5ab32f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDeadBush.java @@ -0,0 +1,58 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockDeadBush extends BlockBush +{ + protected BlockDeadBush() + { + super(Material.vine); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.woodColor; + } + + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.sand || ground == Blocks.hardened_clay || ground == Blocks.stained_hardened_clay || ground == Blocks.dirt; + } + + public boolean isReplaceable(World worldIn, BlockPos pos) + { + return true; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(worldIn, pos, new ItemStack(Blocks.deadbush, 1, 0)); + } + else + { + super.harvestBlock(worldIn, player, pos, state, te); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDirectional.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDirectional.java new file mode 100644 index 0000000..2331990 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDirectional.java @@ -0,0 +1,21 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.util.EnumFacing; + +public abstract class BlockDirectional extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + protected BlockDirectional(Material materialIn) + { + super(materialIn); + } + + protected BlockDirectional(Material p_i46398_1_, MapColor p_i46398_2_) + { + super(p_i46398_1_, p_i46398_2_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDirt.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDirt.java new file mode 100644 index 0000000..6778ee1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDirt.java @@ -0,0 +1,155 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDirt extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockDirt.DirtType.class); + public static final PropertyBool SNOWY = PropertyBool.create("snowy"); + + protected BlockDirt() + { + super(Material.ground); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockDirt.DirtType.DIRT).withProperty(SNOWY, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(IBlockState state) + { + return ((BlockDirt.DirtType)state.getValue(VARIANT)).func_181066_d(); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + if (state.getValue(VARIANT) == BlockDirt.DirtType.PODZOL) + { + Block block = worldIn.getBlockState(pos.up()).getBlock(); + state = state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); + } + + return state; + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(this, 1, BlockDirt.DirtType.DIRT.getMetadata())); + list.add(new ItemStack(this, 1, BlockDirt.DirtType.COARSE_DIRT.getMetadata())); + list.add(new ItemStack(this, 1, BlockDirt.DirtType.PODZOL.getMetadata())); + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock() != this ? 0 : ((BlockDirt.DirtType)iblockstate.getValue(VARIANT)).getMetadata(); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockDirt.DirtType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockDirt.DirtType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT, SNOWY}); + } + + public int damageDropped(IBlockState state) + { + BlockDirt.DirtType blockdirt$dirttype = (BlockDirt.DirtType)state.getValue(VARIANT); + + if (blockdirt$dirttype == BlockDirt.DirtType.PODZOL) + { + blockdirt$dirttype = BlockDirt.DirtType.DIRT; + } + + return blockdirt$dirttype.getMetadata(); + } + + public static enum DirtType implements IStringSerializable + { + DIRT(0, "dirt", "default", MapColor.dirtColor), + COARSE_DIRT(1, "coarse_dirt", "coarse", MapColor.dirtColor), + PODZOL(2, "podzol", MapColor.obsidianColor); + + private static final BlockDirt.DirtType[] METADATA_LOOKUP = new BlockDirt.DirtType[values().length]; + private final int metadata; + private final String name; + private final String unlocalizedName; + private final MapColor field_181067_h; + + private DirtType(int p_i46396_3_, String p_i46396_4_, MapColor p_i46396_5_) + { + this(p_i46396_3_, p_i46396_4_, p_i46396_4_, p_i46396_5_); + } + + private DirtType(int p_i46397_3_, String p_i46397_4_, String p_i46397_5_, MapColor p_i46397_6_) + { + this.metadata = p_i46397_3_; + this.name = p_i46397_4_; + this.unlocalizedName = p_i46397_5_; + this.field_181067_h = p_i46397_6_; + } + + public int getMetadata() + { + return this.metadata; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + public MapColor func_181066_d() + { + return this.field_181067_h; + } + + public String toString() + { + return this.name; + } + + public static BlockDirt.DirtType byMetadata(int metadata) + { + if (metadata < 0 || metadata >= METADATA_LOOKUP.length) + { + metadata = 0; + } + + return METADATA_LOOKUP[metadata]; + } + + public String getName() + { + return this.name; + } + + static { + for (BlockDirt.DirtType blockdirt$dirttype : values()) + { + METADATA_LOOKUP[blockdirt$dirttype.getMetadata()] = blockdirt$dirttype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDispenser.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDispenser.java new file mode 100644 index 0000000..246693a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDispenser.java @@ -0,0 +1,269 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.dispenser.PositionImpl; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.RegistryDefaulted; +import net.minecraft.world.World; + +public class BlockDispenser extends BlockContainer +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool TRIGGERED = PropertyBool.create("triggered"); + public static final RegistryDefaulted dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem()); + protected Random rand = new Random(); + + protected BlockDispenser() + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(TRIGGERED, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public int tickRate(World worldIn) + { + return 4; + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + super.onBlockAdded(worldIn, pos, state); + this.setDefaultDirection(worldIn, pos, state); + } + + private void setDefaultDirection(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + boolean flag = worldIn.getBlockState(pos.north()).getBlock().isFullBlock(); + boolean flag1 = worldIn.getBlockState(pos.south()).getBlock().isFullBlock(); + + if (enumfacing == EnumFacing.NORTH && flag && !flag1) + { + enumfacing = EnumFacing.SOUTH; + } + else if (enumfacing == EnumFacing.SOUTH && flag1 && !flag) + { + enumfacing = EnumFacing.NORTH; + } + else + { + boolean flag2 = worldIn.getBlockState(pos.west()).getBlock().isFullBlock(); + boolean flag3 = worldIn.getBlockState(pos.east()).getBlock().isFullBlock(); + + if (enumfacing == EnumFacing.WEST && flag2 && !flag3) + { + enumfacing = EnumFacing.EAST; + } + else if (enumfacing == EnumFacing.EAST && flag3 && !flag2) + { + enumfacing = EnumFacing.WEST; + } + } + + worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing).withProperty(TRIGGERED, Boolean.valueOf(false)), 2); + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityDispenser) + { + playerIn.displayGUIChest((TileEntityDispenser)tileentity); + + if (tileentity instanceof TileEntityDropper) + { + playerIn.triggerAchievement(StatList.field_181731_O); + } + else + { + playerIn.triggerAchievement(StatList.field_181733_Q); + } + } + + return true; + } + } + + protected void dispense(World worldIn, BlockPos pos) + { + BlockSourceImpl blocksourceimpl = new BlockSourceImpl(worldIn, pos); + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)blocksourceimpl.getBlockTileEntity(); + + if (tileentitydispenser != null) + { + int i = tileentitydispenser.getDispenseSlot(); + + if (i < 0) + { + worldIn.playAuxSFX(1001, pos, 0); + } + else + { + ItemStack itemstack = tileentitydispenser.getStackInSlot(i); + IBehaviorDispenseItem ibehaviordispenseitem = this.getBehavior(itemstack); + + if (ibehaviordispenseitem != IBehaviorDispenseItem.itemDispenseBehaviorProvider) + { + ItemStack itemstack1 = ibehaviordispenseitem.dispense(blocksourceimpl, itemstack); + tileentitydispenser.setInventorySlotContents(i, itemstack1.stackSize <= 0 ? null : itemstack1); + } + } + } + } + + protected IBehaviorDispenseItem getBehavior(ItemStack stack) + { + return (IBehaviorDispenseItem)dispenseBehaviorRegistry.getObject(stack == null ? null : stack.getItem()); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(pos.up()); + boolean flag1 = ((Boolean)state.getValue(TRIGGERED)).booleanValue(); + + if (flag && !flag1) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(true)), 4); + } + else if (!flag && flag1) + { + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(false)), 4); + } + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + this.dispense(worldIn, pos); + } + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityDispenser(); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, BlockPistonBase.getFacingFromEntity(worldIn, pos, placer)).withProperty(TRIGGERED, Boolean.valueOf(false)); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + worldIn.setBlockState(pos, state.withProperty(FACING, BlockPistonBase.getFacingFromEntity(worldIn, pos, placer)), 2); + + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityDispenser) + { + ((TileEntityDispenser)tileentity).setCustomName(stack.getDisplayName()); + } + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityDispenser) + { + InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityDispenser)tileentity); + worldIn.updateComparatorOutputLevel(pos, this); + } + + super.breakBlock(worldIn, pos, state); + } + + public static IPosition getDispensePosition(IBlockSource coords) + { + EnumFacing enumfacing = getFacing(coords.getBlockMetadata()); + double d0 = coords.getX() + 0.7D * (double)enumfacing.getFrontOffsetX(); + double d1 = coords.getY() + 0.7D * (double)enumfacing.getFrontOffsetY(); + double d2 = coords.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ(); + return new PositionImpl(d0, d1, d2); + } + + public static EnumFacing getFacing(int meta) + { + return EnumFacing.getFront(meta & 7); + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return Container.calcRedstone(worldIn.getTileEntity(pos)); + } + + public int getRenderType() + { + return 3; + } + + public IBlockState getStateForEntityRender(IBlockState state) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, getFacing(meta)).withProperty(TRIGGERED, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getIndex(); + + if (((Boolean)state.getValue(TRIGGERED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, TRIGGERED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoor.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoor.java new file mode 100644 index 0000000..cfceb0f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoor.java @@ -0,0 +1,452 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDoor extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool OPEN = PropertyBool.create("open"); + public static final PropertyEnum HINGE = PropertyEnum.create("hinge", BlockDoor.EnumHingePosition.class); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyEnum HALF = PropertyEnum.create("half", BlockDoor.EnumDoorHalf.class); + + protected BlockDoor(Material materialIn) + { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, Boolean.valueOf(false)).withProperty(HINGE, BlockDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf(false)).withProperty(HALF, BlockDoor.EnumDoorHalf.LOWER)); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal((this.getUnlocalizedName() + ".name").replaceAll("tile", "item")); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return isOpen(combineMetadata(worldIn, pos)); + } + + public boolean isFullCube() + { + return false; + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getSelectedBoundingBox(worldIn, pos); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getCollisionBoundingBox(worldIn, pos, state); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBoundBasedOnMeta(combineMetadata(worldIn, pos)); + } + + private void setBoundBasedOnMeta(int combinedMeta) + { + float f = 0.1875F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); + EnumFacing enumfacing = getFacing(combinedMeta); + boolean flag = isOpen(combinedMeta); + boolean flag1 = isHingeLeft(combinedMeta); + + if (flag) + { + if (enumfacing == EnumFacing.EAST) + { + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + } + else if (enumfacing == EnumFacing.SOUTH) + { + if (!flag1) + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + } + else if (enumfacing == EnumFacing.WEST) + { + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + } + else if (enumfacing == EnumFacing.NORTH) + { + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + } + else if (enumfacing == EnumFacing.EAST) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + else if (enumfacing == EnumFacing.SOUTH) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + else if (enumfacing == EnumFacing.WEST) + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else if (enumfacing == EnumFacing.NORTH) + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (this.blockMaterial == Material.iron) + { + return true; + } + else + { + BlockPos blockpos = state.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? pos : pos.down(); + IBlockState iblockstate = pos.equals(blockpos) ? state : worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() != this) + { + return false; + } + else + { + state = iblockstate.cycleProperty(OPEN); + worldIn.setBlockState(blockpos, state, 2); + worldIn.markBlockRangeForRenderUpdate(blockpos, pos); + worldIn.playAuxSFXAtEntity(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0); + return true; + } + } + } + + public void toggleDoor(World worldIn, BlockPos pos, boolean open) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this) + { + BlockPos blockpos = iblockstate.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER ? pos : pos.down(); + IBlockState iblockstate1 = pos == blockpos ? iblockstate : worldIn.getBlockState(blockpos); + + if (iblockstate1.getBlock() == this && ((Boolean)iblockstate1.getValue(OPEN)).booleanValue() != open) + { + worldIn.setBlockState(blockpos, iblockstate1.withProperty(OPEN, Boolean.valueOf(open)), 2); + worldIn.markBlockRangeForRenderUpdate(blockpos, pos); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, open ? 1003 : 1006, pos, 0); + } + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER) + { + BlockPos blockpos = pos.down(); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() != this) + { + worldIn.setBlockToAir(pos); + } + else if (neighborBlock != this) + { + this.onNeighborBlockChange(worldIn, blockpos, iblockstate, neighborBlock); + } + } + else + { + boolean flag1 = false; + BlockPos blockpos1 = pos.up(); + IBlockState iblockstate1 = worldIn.getBlockState(blockpos1); + + if (iblockstate1.getBlock() != this) + { + worldIn.setBlockToAir(pos); + flag1 = true; + } + + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down())) + { + worldIn.setBlockToAir(pos); + flag1 = true; + + if (iblockstate1.getBlock() == this) + { + worldIn.setBlockToAir(blockpos1); + } + } + + if (flag1) + { + if (!worldIn.isRemote) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + } + } + else + { + boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(blockpos1); + + if ((flag || neighborBlock.canProvidePower()) && neighborBlock != this && flag != ((Boolean)iblockstate1.getValue(POWERED)).booleanValue()) + { + worldIn.setBlockState(blockpos1, iblockstate1.withProperty(POWERED, Boolean.valueOf(flag)), 2); + + if (flag != ((Boolean)state.getValue(OPEN)).booleanValue()) + { + worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(flag)), 2); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, flag ? 1003 : 1006, pos, 0); + } + } + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? null : this.getItem(); + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.collisionRayTrace(worldIn, pos, start, end); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return pos.getY() >= 255 ? false : World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up()); + } + + public int getMobilityFlag() + { + return 1; + } + + public static int combineMetadata(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + int i = iblockstate.getBlock().getMetaFromState(iblockstate); + boolean flag = isTop(i); + IBlockState iblockstate1 = worldIn.getBlockState(pos.down()); + int j = iblockstate1.getBlock().getMetaFromState(iblockstate1); + int k = flag ? j : i; + IBlockState iblockstate2 = worldIn.getBlockState(pos.up()); + int l = iblockstate2.getBlock().getMetaFromState(iblockstate2); + int i1 = flag ? i : l; + boolean flag1 = (i1 & 1) != 0; + boolean flag2 = (i1 & 2) != 0; + return removeHalfBit(k) | (flag ? 8 : 0) | (flag1 ? 16 : 0) | (flag2 ? 32 : 0); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return this.getItem(); + } + + private Item getItem() + { + return this == Blocks.iron_door ? Items.iron_door : (this == Blocks.spruce_door ? Items.spruce_door : (this == Blocks.birch_door ? Items.birch_door : (this == Blocks.jungle_door ? Items.jungle_door : (this == Blocks.acacia_door ? Items.acacia_door : (this == Blocks.dark_oak_door ? Items.dark_oak_door : Items.oak_door))))); + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + BlockPos blockpos = pos.down(); + + if (player.capabilities.isCreativeMode && state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER && worldIn.getBlockState(blockpos).getBlock() == this) + { + worldIn.setBlockToAir(blockpos); + } + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + if (state.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER) + { + IBlockState iblockstate = worldIn.getBlockState(pos.up()); + + if (iblockstate.getBlock() == this) + { + state = state.withProperty(HINGE, iblockstate.getValue(HINGE)).withProperty(POWERED, iblockstate.getValue(POWERED)); + } + } + else + { + IBlockState iblockstate1 = worldIn.getBlockState(pos.down()); + + if (iblockstate1.getBlock() == this) + { + state = state.withProperty(FACING, iblockstate1.getValue(FACING)).withProperty(OPEN, iblockstate1.getValue(OPEN)); + } + } + + return state; + } + + public IBlockState getStateFromMeta(int meta) + { + return (meta & 8) > 0 ? this.getDefaultState().withProperty(HALF, BlockDoor.EnumDoorHalf.UPPER).withProperty(HINGE, (meta & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf((meta & 2) > 0)) : this.getDefaultState().withProperty(HALF, BlockDoor.EnumDoorHalf.LOWER).withProperty(FACING, EnumFacing.getHorizontal(meta & 3).rotateYCCW()).withProperty(OPEN, Boolean.valueOf((meta & 4) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + + if (state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER) + { + i = i | 8; + + if (state.getValue(HINGE) == BlockDoor.EnumHingePosition.RIGHT) + { + i |= 1; + } + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 2; + } + } + else + { + i = i | ((EnumFacing)state.getValue(FACING)).rotateY().getHorizontalIndex(); + + if (((Boolean)state.getValue(OPEN)).booleanValue()) + { + i |= 4; + } + } + + return i; + } + + protected static int removeHalfBit(int meta) + { + return meta & 7; + } + + public static boolean isOpen(IBlockAccess worldIn, BlockPos pos) + { + return isOpen(combineMetadata(worldIn, pos)); + } + + public static EnumFacing getFacing(IBlockAccess worldIn, BlockPos pos) + { + return getFacing(combineMetadata(worldIn, pos)); + } + + public static EnumFacing getFacing(int combinedMeta) + { + return EnumFacing.getHorizontal(combinedMeta & 3).rotateYCCW(); + } + + protected static boolean isOpen(int combinedMeta) + { + return (combinedMeta & 4) != 0; + } + + protected static boolean isTop(int meta) + { + return (meta & 8) != 0; + } + + protected static boolean isHingeLeft(int combinedMeta) + { + return (combinedMeta & 16) != 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {HALF, FACING, OPEN, HINGE, POWERED}); + } + + public static enum EnumDoorHalf implements IStringSerializable + { + UPPER, + LOWER; + + public String toString() + { + return this.getName(); + } + + public String getName() + { + return this == UPPER ? "upper" : "lower"; + } + } + + public static enum EnumHingePosition implements IStringSerializable + { + LEFT, + RIGHT; + + public String toString() + { + return this.getName(); + } + + public String getName() + { + return this == LEFT ? "left" : "right"; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoublePlant.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoublePlant.java new file mode 100644 index 0000000..ed3c350 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoublePlant.java @@ -0,0 +1,370 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeColorHelper; + +public class BlockDoublePlant extends BlockBush implements IGrowable +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockDoublePlant.EnumPlantType.class); + public static final PropertyEnum HALF = PropertyEnum.create("half", BlockDoublePlant.EnumBlockHalf.class); + public static final PropertyEnum FACING = BlockDirectional.FACING; + + public BlockDoublePlant() + { + super(Material.vine); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockDoublePlant.EnumPlantType.SUNFLOWER).withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(FACING, EnumFacing.NORTH)); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.setUnlocalizedName("doublePlant"); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public BlockDoublePlant.EnumPlantType getVariant(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this) + { + iblockstate = this.getActualState(iblockstate, worldIn, pos); + return (BlockDoublePlant.EnumPlantType)iblockstate.getValue(VARIANT); + } + else + { + return BlockDoublePlant.EnumPlantType.FERN; + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) && worldIn.isAirBlock(pos.up()); + } + + public boolean isReplaceable(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() != this) + { + return true; + } + else + { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType)this.getActualState(iblockstate, worldIn, pos).getValue(VARIANT); + return blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.FERN || blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS; + } + } + + protected void checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.canBlockStay(worldIn, pos, state)) + { + boolean flag = state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER; + BlockPos blockpos = flag ? pos : pos.up(); + BlockPos blockpos1 = flag ? pos.down() : pos; + Block block = (Block)(flag ? this : worldIn.getBlockState(blockpos).getBlock()); + Block block1 = (Block)(flag ? worldIn.getBlockState(blockpos1).getBlock() : this); + + if (block == this) + { + worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2); + } + + if (block1 == this) + { + worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 3); + + if (!flag) + { + this.dropBlockAsItem(worldIn, blockpos1, state, 0); + } + } + } + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) + { + return worldIn.getBlockState(pos.down()).getBlock() == this; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos.up()); + return iblockstate.getBlock() == this && super.canBlockStay(worldIn, pos, iblockstate); + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) + { + return null; + } + else + { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType)state.getValue(VARIANT); + return blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.FERN ? null : (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? (rand.nextInt(8) == 0 ? Items.wheat_seeds : null) : Item.getItemFromBlock(this)); + } + } + + public int damageDropped(IBlockState state) + { + return state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.UPPER && state.getValue(VARIANT) != BlockDoublePlant.EnumPlantType.GRASS ? ((BlockDoublePlant.EnumPlantType)state.getValue(VARIANT)).getMeta() : 0; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = this.getVariant(worldIn, pos); + return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN ? 16777215 : BiomeColorHelper.getGrassColorAtPos(worldIn, pos); + } + + public void placeAt(World worldIn, BlockPos lowerPos, BlockDoublePlant.EnumPlantType variant, int flags) + { + worldIn.setBlockState(lowerPos, this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(VARIANT, variant), flags); + worldIn.setBlockState(lowerPos.up(), this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flags); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + worldIn.setBlockState(pos.up(), this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), 2); + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + if (worldIn.isRemote || player.getCurrentEquippedItem() == null || player.getCurrentEquippedItem().getItem() != Items.shears || state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.onHarvest(worldIn, pos, state, player)) + { + super.harvestBlock(worldIn, player, pos, state, te); + } + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) + { + if (worldIn.getBlockState(pos.down()).getBlock() == this) + { + if (!player.capabilities.isCreativeMode) + { + IBlockState iblockstate = worldIn.getBlockState(pos.down()); + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType)iblockstate.getValue(VARIANT); + + if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) + { + worldIn.destroyBlock(pos.down(), true); + } + else if (!worldIn.isRemote) + { + if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + this.onHarvest(worldIn, pos, iblockstate, player); + worldIn.setBlockToAir(pos.down()); + } + else + { + worldIn.destroyBlock(pos.down(), true); + } + } + else + { + worldIn.setBlockToAir(pos.down()); + } + } + else + { + worldIn.setBlockToAir(pos.down()); + } + } + } + else if (player.capabilities.isCreativeMode && worldIn.getBlockState(pos.up()).getBlock() == this) + { + worldIn.setBlockState(pos.up(), Blocks.air.getDefaultState(), 2); + } + + super.onBlockHarvested(worldIn, pos, state, player); + } + + private boolean onHarvest(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType)state.getValue(VARIANT); + + if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) + { + return false; + } + else + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).getMeta(); + spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 2, i)); + return true; + } + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : BlockDoublePlant.EnumPlantType.values()) + { + list.add(new ItemStack(itemIn, 1, blockdoubleplant$enumplanttype.getMeta())); + } + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + return this.getVariant(worldIn, pos).getMeta(); + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = this.getVariant(worldIn, pos); + return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return true; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + spawnAsEntity(worldIn, pos, new ItemStack(this, 1, this.getVariant(worldIn, pos).getMeta())); + } + + public IBlockState getStateFromMeta(int meta) + { + return (meta & 8) > 0 ? this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER) : this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(VARIANT, BlockDoublePlant.EnumPlantType.byMetadata(meta & 7)); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) + { + IBlockState iblockstate = worldIn.getBlockState(pos.down()); + + if (iblockstate.getBlock() == this) + { + state = state.withProperty(VARIANT, iblockstate.getValue(VARIANT)); + } + } + + return state; + } + + public int getMetaFromState(IBlockState state) + { + return state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER ? 8 | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex() : ((BlockDoublePlant.EnumPlantType)state.getValue(VARIANT)).getMeta(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {HALF, VARIANT, FACING}); + } + + public Block.EnumOffsetType getOffsetType() + { + return Block.EnumOffsetType.XZ; + } + + public static enum EnumBlockHalf implements IStringSerializable + { + UPPER, + LOWER; + + public String toString() + { + return this.getName(); + } + + public String getName() + { + return this == UPPER ? "upper" : "lower"; + } + } + + public static enum EnumPlantType implements IStringSerializable + { + SUNFLOWER(0, "sunflower"), + SYRINGA(1, "syringa"), + GRASS(2, "double_grass", "grass"), + FERN(3, "double_fern", "fern"), + ROSE(4, "double_rose", "rose"), + PAEONIA(5, "paeonia"); + + private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumPlantType(int meta, String name) + { + this(meta, name, name); + } + + private EnumPlantType(int meta, String name, String unlocalizedName) + { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMeta() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockDoublePlant.EnumPlantType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : values()) + { + META_LOOKUP[blockdoubleplant$enumplanttype.getMeta()] = blockdoubleplant$enumplanttype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleStoneSlab.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleStoneSlab.java new file mode 100644 index 0000000..f4d95ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleStoneSlab.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockDoubleStoneSlab extends BlockStoneSlab +{ + public boolean isDouble() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleStoneSlabNew.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleStoneSlabNew.java new file mode 100644 index 0000000..e78985b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleStoneSlabNew.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockDoubleStoneSlabNew extends BlockStoneSlabNew +{ + public boolean isDouble() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleWoodSlab.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleWoodSlab.java new file mode 100644 index 0000000..3e58398 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDoubleWoodSlab.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockDoubleWoodSlab extends BlockWoodSlab +{ + public boolean isDouble() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDragonEgg.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDragonEgg.java new file mode 100644 index 0000000..e012dc5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDragonEgg.java @@ -0,0 +1,140 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDragonEgg extends Block +{ + public BlockDragonEgg() + { + super(Material.dragonEgg, MapColor.blackColor); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + this.checkFall(worldIn, pos); + } + + private void checkFall(World worldIn, BlockPos pos) + { + if (BlockFalling.canFallInto(worldIn, pos.down()) && pos.getY() >= 0) + { + int i = 32; + + if (!BlockFalling.fallInstantly && worldIn.isAreaLoaded(pos.add(-i, -i, -i), pos.add(i, i, i))) + { + worldIn.spawnEntityInWorld(new EntityFallingBlock(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), this.getDefaultState())); + } + else + { + worldIn.setBlockToAir(pos); + BlockPos blockpos; + + for (blockpos = pos; BlockFalling.canFallInto(worldIn, blockpos) && blockpos.getY() > 0; blockpos = blockpos.down()) + { + ; + } + + if (blockpos.getY() > 0) + { + worldIn.setBlockState(blockpos, this.getDefaultState(), 2); + } + } + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + this.teleport(worldIn, pos); + return true; + } + + public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) + { + this.teleport(worldIn, pos); + } + + private void teleport(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this) + { + for (int i = 0; i < 1000; ++i) + { + BlockPos blockpos = pos.add(worldIn.rand.nextInt(16) - worldIn.rand.nextInt(16), worldIn.rand.nextInt(8) - worldIn.rand.nextInt(8), worldIn.rand.nextInt(16) - worldIn.rand.nextInt(16)); + + if (worldIn.getBlockState(blockpos).getBlock().blockMaterial == Material.air) + { + if (worldIn.isRemote) + { + for (int j = 0; j < 128; ++j) + { + double d0 = worldIn.rand.nextDouble(); + float f = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; + double d1 = (double)blockpos.getX() + (double)(pos.getX() - blockpos.getX()) * d0 + (worldIn.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + double d2 = (double)blockpos.getY() + (double)(pos.getY() - blockpos.getY()) * d0 + worldIn.rand.nextDouble() * 1.0D - 0.5D; + double d3 = (double)blockpos.getZ() + (double)(pos.getZ() - blockpos.getZ()) * d0 + (worldIn.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + worldIn.spawnParticle(EnumParticleTypes.PORTAL, d1, d2, d3, (double)f, (double)f1, (double)f2, new int[0]); + } + } + else + { + worldIn.setBlockState(blockpos, iblockstate, 2); + worldIn.setBlockToAir(pos); + } + + return; + } + } + } + } + + public int tickRate(World worldIn) + { + return 5; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return true; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDropper.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDropper.java new file mode 100644 index 0000000..197f47b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDropper.java @@ -0,0 +1,86 @@ +package net.minecraft.block; + +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockDropper extends BlockDispenser +{ + private final IBehaviorDispenseItem dropBehavior = new BehaviorDefaultDispenseItem(); + + protected IBehaviorDispenseItem getBehavior(ItemStack stack) + { + return this.dropBehavior; + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityDropper(); + } + + protected void dispense(World worldIn, BlockPos pos) + { + BlockSourceImpl blocksourceimpl = new BlockSourceImpl(worldIn, pos); + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)blocksourceimpl.getBlockTileEntity(); + + if (tileentitydispenser != null) + { + int i = tileentitydispenser.getDispenseSlot(); + + if (i < 0) + { + worldIn.playAuxSFX(1001, pos, 0); + } + else + { + ItemStack itemstack = tileentitydispenser.getStackInSlot(i); + + if (itemstack != null) + { + EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING); + BlockPos blockpos = pos.offset(enumfacing); + IInventory iinventory = TileEntityHopper.getInventoryAtPosition(worldIn, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); + ItemStack itemstack1; + + if (iinventory == null) + { + itemstack1 = this.dropBehavior.dispense(blocksourceimpl, itemstack); + + if (itemstack1 != null && itemstack1.stackSize <= 0) + { + itemstack1 = null; + } + } + else + { + itemstack1 = TileEntityHopper.putStackInInventoryAllSlots(iinventory, itemstack.copy().splitStack(1), enumfacing.getOpposite()); + + if (itemstack1 == null) + { + itemstack1 = itemstack.copy(); + + if (--itemstack1.stackSize <= 0) + { + itemstack1 = null; + } + } + else + { + itemstack1 = itemstack.copy(); + } + } + + tileentitydispenser.setInventorySlotContents(i, itemstack1); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockDynamicLiquid.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDynamicLiquid.java new file mode 100644 index 0000000..a369e9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockDynamicLiquid.java @@ -0,0 +1,293 @@ +package net.minecraft.block; + +import java.util.EnumSet; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockDynamicLiquid extends BlockLiquid +{ + int adjacentSourceBlocks; + + protected BlockDynamicLiquid(Material materialIn) + { + super(materialIn); + } + + private void placeStaticBlock(World worldIn, BlockPos pos, IBlockState currentState) + { + worldIn.setBlockState(pos, getStaticBlock(this.blockMaterial).getDefaultState().withProperty(LEVEL, currentState.getValue(LEVEL)), 2); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + int i = ((Integer)state.getValue(LEVEL)).intValue(); + int j = 1; + + if (this.blockMaterial == Material.lava && !worldIn.provider.doesWaterVaporize()) + { + j = 2; + } + + int k = this.tickRate(worldIn); + + if (i > 0) + { + int l = -100; + this.adjacentSourceBlocks = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + l = this.checkAdjacentBlock(worldIn, pos.offset(enumfacing), l); + } + + int i1 = l + j; + + if (i1 >= 8 || l < 0) + { + i1 = -1; + } + + if (this.getLevel(worldIn, pos.up()) >= 0) + { + int j1 = this.getLevel(worldIn, pos.up()); + + if (j1 >= 8) + { + i1 = j1; + } + else + { + i1 = j1 + 8; + } + } + + if (this.adjacentSourceBlocks >= 2 && this.blockMaterial == Material.water) + { + IBlockState iblockstate1 = worldIn.getBlockState(pos.down()); + + if (iblockstate1.getBlock().getMaterial().isSolid()) + { + i1 = 0; + } + else if (iblockstate1.getBlock().getMaterial() == this.blockMaterial && ((Integer)iblockstate1.getValue(LEVEL)).intValue() == 0) + { + i1 = 0; + } + } + + if (this.blockMaterial == Material.lava && i < 8 && i1 < 8 && i1 > i && rand.nextInt(4) != 0) + { + k *= 4; + } + + if (i1 == i) + { + this.placeStaticBlock(worldIn, pos, state); + } + else + { + i = i1; + + if (i1 < 0) + { + worldIn.setBlockToAir(pos); + } + else + { + state = state.withProperty(LEVEL, Integer.valueOf(i1)); + worldIn.setBlockState(pos, state, 2); + worldIn.scheduleUpdate(pos, this, k); + worldIn.notifyNeighborsOfStateChange(pos, this); + } + } + } + else + { + this.placeStaticBlock(worldIn, pos, state); + } + + IBlockState iblockstate = worldIn.getBlockState(pos.down()); + + if (this.canFlowInto(worldIn, pos.down(), iblockstate)) + { + if (this.blockMaterial == Material.lava && worldIn.getBlockState(pos.down()).getBlock().getMaterial() == Material.water) + { + worldIn.setBlockState(pos.down(), Blocks.stone.getDefaultState()); + this.triggerMixEffects(worldIn, pos.down()); + return; + } + + if (i >= 8) + { + this.tryFlowInto(worldIn, pos.down(), iblockstate, i); + } + else + { + this.tryFlowInto(worldIn, pos.down(), iblockstate, i + 8); + } + } + else if (i >= 0 && (i == 0 || this.isBlocked(worldIn, pos.down(), iblockstate))) + { + Set set = this.getPossibleFlowDirections(worldIn, pos); + int k1 = i + j; + + if (i >= 8) + { + k1 = 1; + } + + if (k1 >= 8) + { + return; + } + + for (EnumFacing enumfacing1 : set) + { + this.tryFlowInto(worldIn, pos.offset(enumfacing1), worldIn.getBlockState(pos.offset(enumfacing1)), k1); + } + } + } + + private void tryFlowInto(World worldIn, BlockPos pos, IBlockState state, int level) + { + if (this.canFlowInto(worldIn, pos, state)) + { + if (state.getBlock() != Blocks.air) + { + if (this.blockMaterial == Material.lava) + { + this.triggerMixEffects(worldIn, pos); + } + else + { + state.getBlock().dropBlockAsItem(worldIn, pos, state, 0); + } + } + + worldIn.setBlockState(pos, this.getDefaultState().withProperty(LEVEL, Integer.valueOf(level)), 3); + } + } + + private int func_176374_a(World worldIn, BlockPos pos, int distance, EnumFacing calculateFlowCost) + { + int i = 1000; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (enumfacing != calculateFlowCost) + { + BlockPos blockpos = pos.offset(enumfacing); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (!this.isBlocked(worldIn, blockpos, iblockstate) && (iblockstate.getBlock().getMaterial() != this.blockMaterial || ((Integer)iblockstate.getValue(LEVEL)).intValue() > 0)) + { + if (!this.isBlocked(worldIn, blockpos.down(), iblockstate)) + { + return distance; + } + + if (distance < 4) + { + int j = this.func_176374_a(worldIn, blockpos, distance + 1, enumfacing.getOpposite()); + + if (j < i) + { + i = j; + } + } + } + } + } + + return i; + } + + private Set getPossibleFlowDirections(World worldIn, BlockPos pos) + { + int i = 1000; + Set set = EnumSet.noneOf(EnumFacing.class); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos.offset(enumfacing); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (!this.isBlocked(worldIn, blockpos, iblockstate) && (iblockstate.getBlock().getMaterial() != this.blockMaterial || ((Integer)iblockstate.getValue(LEVEL)).intValue() > 0)) + { + int j; + + if (this.isBlocked(worldIn, blockpos.down(), worldIn.getBlockState(blockpos.down()))) + { + j = this.func_176374_a(worldIn, blockpos, 1, enumfacing.getOpposite()); + } + else + { + j = 0; + } + + if (j < i) + { + set.clear(); + } + + if (j <= i) + { + set.add(enumfacing); + i = j; + } + } + } + + return set; + } + + private boolean isBlocked(World worldIn, BlockPos pos, IBlockState state) + { + Block block = worldIn.getBlockState(pos).getBlock(); + return !(block instanceof BlockDoor) && block != Blocks.standing_sign && block != Blocks.ladder && block != Blocks.reeds ? (block.blockMaterial == Material.portal ? true : block.blockMaterial.blocksMovement()) : true; + } + + protected int checkAdjacentBlock(World worldIn, BlockPos pos, int currentMinLevel) + { + int i = this.getLevel(worldIn, pos); + + if (i < 0) + { + return currentMinLevel; + } + else + { + if (i == 0) + { + ++this.adjacentSourceBlocks; + } + + if (i >= 8) + { + i = 0; + } + + return currentMinLevel >= 0 && i >= currentMinLevel ? currentMinLevel : i; + } + } + + private boolean canFlowInto(World worldIn, BlockPos pos, IBlockState state) + { + Material material = state.getBlock().getMaterial(); + return material != this.blockMaterial && material != Material.lava && !this.isBlocked(worldIn, pos, state); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.checkForMixing(worldIn, pos, state)) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockEnchantmentTable.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEnchantmentTable.java new file mode 100644 index 0000000..07a3d1b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEnchantmentTable.java @@ -0,0 +1,116 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class BlockEnchantmentTable extends BlockContainer +{ + protected BlockEnchantmentTable() + { + super(Material.rock, MapColor.redColor); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean isFullCube() + { + return false; + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + super.randomDisplayTick(worldIn, pos, state, rand); + + for (int i = -2; i <= 2; ++i) + { + for (int j = -2; j <= 2; ++j) + { + if (i > -2 && i < 2 && j == -1) + { + j = 2; + } + + if (rand.nextInt(16) == 0) + { + for (int k = 0; k <= 1; ++k) + { + BlockPos blockpos = pos.add(i, k, j); + + if (worldIn.getBlockState(blockpos).getBlock() == Blocks.bookshelf) + { + if (!worldIn.isAirBlock(pos.add(i / 2, 0, j / 2))) + { + break; + } + + worldIn.spawnParticle(EnumParticleTypes.ENCHANTMENT_TABLE, (double)pos.getX() + 0.5D, (double)pos.getY() + 2.0D, (double)pos.getZ() + 0.5D, (double)((float)i + rand.nextFloat()) - 0.5D, (double)((float)k - rand.nextFloat() - 1.0F), (double)((float)j + rand.nextFloat()) - 0.5D, new int[0]); + } + } + } + } + } + } + + public boolean isOpaqueCube() + { + return false; + } + + public int getRenderType() + { + return 3; + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityEnchantmentTable(); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityEnchantmentTable) + { + playerIn.displayGui((TileEntityEnchantmentTable)tileentity); + } + + return true; + } + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + super.onBlockPlacedBy(worldIn, pos, state, placer, stack); + + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityEnchantmentTable) + { + ((TileEntityEnchantmentTable)tileentity).setCustomName(stack.getDisplayName()); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockEndPortal.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEndPortal.java new file mode 100644 index 0000000..8c487d7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEndPortal.java @@ -0,0 +1,90 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockEndPortal extends BlockContainer +{ + protected BlockEndPortal(Material materialIn) + { + super(materialIn); + this.setLightLevel(1.0F); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityEndPortal(); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + float f = 0.0625F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return side == EnumFacing.DOWN ? super.shouldSideBeRendered(worldIn, pos, side) : false; + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null && !worldIn.isRemote) + { + entityIn.travelToDimension(1); + } + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + double d0 = (double)((float)pos.getX() + rand.nextFloat()); + double d1 = (double)((float)pos.getY() + 0.8F); + double d2 = (double)((float)pos.getZ() + rand.nextFloat()); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return null; + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.blackColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockEndPortalFrame.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEndPortalFrame.java new file mode 100644 index 0000000..72c0575 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEndPortalFrame.java @@ -0,0 +1,97 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockEndPortalFrame extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool EYE = PropertyBool.create("eye"); + + public BlockEndPortalFrame() + { + super(Material.rock, MapColor.greenColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(EYE, Boolean.valueOf(false))); + } + + public boolean isOpaqueCube() + { + return false; + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + + if (((Boolean)worldIn.getBlockState(pos).getValue(EYE)).booleanValue()) + { + this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + this.setBlockBoundsForItemRender(); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(EYE, Boolean.valueOf(false)); + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return ((Boolean)worldIn.getBlockState(pos).getValue(EYE)).booleanValue() ? 15 : 0; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(EYE, Boolean.valueOf((meta & 4) != 0)).withProperty(FACING, EnumFacing.getHorizontal(meta & 3)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + + if (((Boolean)state.getValue(EYE)).booleanValue()) + { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, EYE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockEnderChest.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEnderChest.java new file mode 100644 index 0000000..d604f5b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEnderChest.java @@ -0,0 +1,147 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.InventoryEnderChest; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class BlockEnderChest extends BlockContainer +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + protected BlockEnderChest() + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public int getRenderType() + { + return 2; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.obsidian); + } + + public int quantityDropped(Random random) + { + return 8; + } + + protected boolean canSilkHarvest() + { + return true; + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + InventoryEnderChest inventoryenderchest = playerIn.getInventoryEnderChest(); + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (inventoryenderchest != null && tileentity instanceof TileEntityEnderChest) + { + if (worldIn.getBlockState(pos.up()).getBlock().isNormalCube()) + { + return true; + } + else if (worldIn.isRemote) + { + return true; + } + else + { + inventoryenderchest.setChestTileEntity((TileEntityEnderChest)tileentity); + playerIn.displayGUIChest(inventoryenderchest); + playerIn.triggerAchievement(StatList.field_181738_V); + return true; + } + } + else + { + return true; + } + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityEnderChest(); + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + for (int i = 0; i < 3; ++i) + { + int j = rand.nextInt(2) * 2 - 1; + int k = rand.nextInt(2) * 2 - 1; + double d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j; + double d1 = (double)((float)pos.getY() + rand.nextFloat()); + double d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)k; + double d3 = (double)(rand.nextFloat() * (float)j); + double d4 = ((double)rand.nextFloat() - 0.5D) * 0.125D; + double d5 = (double)(rand.nextFloat() * (float)k); + worldIn.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing = EnumFacing.getFront(meta); + + if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumFacing)state.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockEventData.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEventData.java new file mode 100644 index 0000000..ce2020d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockEventData.java @@ -0,0 +1,57 @@ +package net.minecraft.block; + +import net.minecraft.util.BlockPos; + +public class BlockEventData +{ + private BlockPos position; + private Block blockType; + private int eventID; + private int eventParameter; + + public BlockEventData(BlockPos pos, Block blockType, int eventId, int p_i45756_4_) + { + this.position = pos; + this.eventID = eventId; + this.eventParameter = p_i45756_4_; + this.blockType = blockType; + } + + public BlockPos getPosition() + { + return this.position; + } + + public int getEventID() + { + return this.eventID; + } + + public int getEventParameter() + { + return this.eventParameter; + } + + public Block getBlock() + { + return this.blockType; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof BlockEventData)) + { + return false; + } + else + { + BlockEventData blockeventdata = (BlockEventData)p_equals_1_; + return this.position.equals(blockeventdata.position) && this.eventID == blockeventdata.eventID && this.eventParameter == blockeventdata.eventParameter && this.blockType == blockeventdata.blockType; + } + } + + public String toString() + { + return "TE(" + this.position + ")," + this.eventID + "," + this.eventParameter + "," + this.blockType; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFalling.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFalling.java new file mode 100644 index 0000000..254a63c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFalling.java @@ -0,0 +1,97 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockFalling extends Block +{ + public static boolean fallInstantly; + + public BlockFalling() + { + super(Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public BlockFalling(Material materialIn) + { + super(materialIn); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + this.checkFallable(worldIn, pos); + } + } + + private void checkFallable(World worldIn, BlockPos pos) + { + if (canFallInto(worldIn, pos.down()) && pos.getY() >= 0) + { + int i = 32; + + if (!fallInstantly && worldIn.isAreaLoaded(pos.add(-i, -i, -i), pos.add(i, i, i))) + { + if (!worldIn.isRemote) + { + EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, worldIn.getBlockState(pos)); + this.onStartFalling(entityfallingblock); + worldIn.spawnEntityInWorld(entityfallingblock); + } + } + else + { + worldIn.setBlockToAir(pos); + BlockPos blockpos; + + for (blockpos = pos.down(); canFallInto(worldIn, blockpos) && blockpos.getY() > 0; blockpos = blockpos.down()) + { + ; + } + + if (blockpos.getY() > 0) + { + worldIn.setBlockState(blockpos.up(), this.getDefaultState()); + } + } + } + } + + protected void onStartFalling(EntityFallingBlock fallingEntity) + { + } + + public int tickRate(World worldIn) + { + return 2; + } + + public static boolean canFallInto(World worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos).getBlock(); + Material material = block.blockMaterial; + return block == Blocks.fire || material == Material.air || material == Material.water || material == Material.lava; + } + + public void onEndFalling(World worldIn, BlockPos pos) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFarmland.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFarmland.java new file mode 100644 index 0000000..169e8b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFarmland.java @@ -0,0 +1,159 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFarmland extends Block +{ + public static final PropertyInteger MOISTURE = PropertyInteger.create("moisture", 0, 7); + + protected BlockFarmland() + { + super(Material.ground); + this.setDefaultState(this.blockState.getBaseState().withProperty(MOISTURE, Integer.valueOf(0))); + this.setTickRandomly(true); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F); + this.setLightOpacity(255); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return new AxisAlignedBB((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 1), (double)(pos.getZ() + 1)); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + int i = ((Integer)state.getValue(MOISTURE)).intValue(); + + if (!this.hasWater(worldIn, pos) && !worldIn.isRainingAt(pos.up())) + { + if (i > 0) + { + worldIn.setBlockState(pos, state.withProperty(MOISTURE, Integer.valueOf(i - 1)), 2); + } + else if (!this.hasCrops(worldIn, pos)) + { + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); + } + } + else if (i < 7) + { + worldIn.setBlockState(pos, state.withProperty(MOISTURE, Integer.valueOf(7)), 2); + } + } + + public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) + { + if (entityIn instanceof EntityLivingBase) + { + if (!worldIn.isRemote && worldIn.rand.nextFloat() < fallDistance - 0.5F) + { + if (!(entityIn instanceof EntityPlayer) && !worldIn.getGameRules().getBoolean("mobGriefing")) + { + return; + } + + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); + } + + super.onFallenUpon(worldIn, pos, entityIn, fallDistance); + } + } + + private boolean hasCrops(World worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos.up()).getBlock(); + return block instanceof BlockCrops || block instanceof BlockStem; + } + + private boolean hasWater(World worldIn, BlockPos pos) + { + for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(pos.add(-4, 0, -4), pos.add(4, 1, 4))) + { + if (worldIn.getBlockState(blockpos$mutableblockpos).getBlock().getMaterial() == Material.water) + { + return true; + } + } + + return false; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + + if (worldIn.getBlockState(pos.up()).getBlock().getMaterial().isSolid()) + { + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); + } + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + switch (side) + { + case UP: + return true; + + case NORTH: + case SOUTH: + case WEST: + case EAST: + Block block = worldIn.getBlockState(pos).getBlock(); + return !block.isOpaqueCube() && block != Blocks.farmland; + + default: + return super.shouldSideBeRendered(worldIn, pos, side); + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Blocks.dirt.getItemDropped(Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT), rand, fortune); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.dirt); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(MOISTURE, Integer.valueOf(meta & 7)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(MOISTURE)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {MOISTURE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFence.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFence.java new file mode 100644 index 0000000..18e116a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFence.java @@ -0,0 +1,178 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemLead; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFence extends Block +{ + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + + public BlockFence(Material materialIn) + { + this(materialIn, materialIn.getMaterialMapColor()); + } + + public BlockFence(Material p_i46395_1_, MapColor p_i46395_2_) + { + super(p_i46395_1_, p_i46395_2_); + this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + boolean flag = this.canConnectTo(worldIn, pos.north()); + boolean flag1 = this.canConnectTo(worldIn, pos.south()); + boolean flag2 = this.canConnectTo(worldIn, pos.west()); + boolean flag3 = this.canConnectTo(worldIn, pos.east()); + float f = 0.375F; + float f1 = 0.625F; + float f2 = 0.375F; + float f3 = 0.625F; + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + if (flag || flag1) + { + this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + f2 = 0.375F; + f3 = 0.625F; + + if (flag2) + { + f = 0.0F; + } + + if (flag3) + { + f1 = 1.0F; + } + + if (flag2 || flag3 || !flag && !flag1) + { + this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + boolean flag = this.canConnectTo(worldIn, pos.north()); + boolean flag1 = this.canConnectTo(worldIn, pos.south()); + boolean flag2 = this.canConnectTo(worldIn, pos.west()); + boolean flag3 = this.canConnectTo(worldIn, pos.east()); + float f = 0.375F; + float f1 = 0.625F; + float f2 = 0.375F; + float f3 = 0.625F; + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + if (flag2) + { + f = 0.0F; + } + + if (flag3) + { + f1 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return false; + } + + public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos).getBlock(); + return block == Blocks.barrier ? false : ((!(block instanceof BlockFence) || block.blockMaterial != this.blockMaterial) && !(block instanceof BlockFenceGate) ? (block.blockMaterial.isOpaque() && block.isFullCube() ? block.blockMaterial != Material.gourd : false) : true); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return true; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + return worldIn.isRemote ? true : ItemLead.attachToFence(playerIn, worldIn, pos); + } + + public int getMetaFromState(IBlockState state) + { + return 0; + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state.withProperty(NORTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canConnectTo(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canConnectTo(worldIn, pos.west()))); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFenceGate.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFenceGate.java new file mode 100644 index 0000000..e7be4a2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFenceGate.java @@ -0,0 +1,177 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFenceGate extends BlockDirectional +{ + public static final PropertyBool OPEN = PropertyBool.create("open"); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyBool IN_WALL = PropertyBool.create("in_wall"); + + public BlockFenceGate(BlockPlanks.EnumType p_i46394_1_) + { + super(Material.wood, p_i46394_1_.getMapColor()); + this.setDefaultState(this.blockState.getBaseState().withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + EnumFacing.Axis enumfacing$axis = ((EnumFacing)state.getValue(FACING)).getAxis(); + + if (enumfacing$axis == EnumFacing.Axis.Z && (worldIn.getBlockState(pos.west()).getBlock() == Blocks.cobblestone_wall || worldIn.getBlockState(pos.east()).getBlock() == Blocks.cobblestone_wall) || enumfacing$axis == EnumFacing.Axis.X && (worldIn.getBlockState(pos.north()).getBlock() == Blocks.cobblestone_wall || worldIn.getBlockState(pos.south()).getBlock() == Blocks.cobblestone_wall)) + { + state = state.withProperty(IN_WALL, Boolean.valueOf(true)); + } + + return state; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos.down()).getBlock().getMaterial().isSolid() ? super.canPlaceBlockAt(worldIn, pos) : false; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + if (((Boolean)state.getValue(OPEN)).booleanValue()) + { + return null; + } + else + { + EnumFacing.Axis enumfacing$axis = ((EnumFacing)state.getValue(FACING)).getAxis(); + return enumfacing$axis == EnumFacing.Axis.Z ? new AxisAlignedBB((double)pos.getX(), (double)pos.getY(), (double)((float)pos.getZ() + 0.375F), (double)(pos.getX() + 1), (double)((float)pos.getY() + 1.5F), (double)((float)pos.getZ() + 0.625F)) : new AxisAlignedBB((double)((float)pos.getX() + 0.375F), (double)pos.getY(), (double)pos.getZ(), (double)((float)pos.getX() + 0.625F), (double)((float)pos.getY() + 1.5F), (double)(pos.getZ() + 1)); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + EnumFacing.Axis enumfacing$axis = ((EnumFacing)worldIn.getBlockState(pos).getValue(FACING)).getAxis(); + + if (enumfacing$axis == EnumFacing.Axis.Z) + { + this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F); + } + else + { + this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F); + } + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return ((Boolean)worldIn.getBlockState(pos).getValue(OPEN)).booleanValue(); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false)); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (((Boolean)state.getValue(OPEN)).booleanValue()) + { + state = state.withProperty(OPEN, Boolean.valueOf(false)); + worldIn.setBlockState(pos, state, 2); + } + else + { + EnumFacing enumfacing = EnumFacing.fromAngle((double)playerIn.rotationYaw); + + if (state.getValue(FACING) == enumfacing.getOpposite()) + { + state = state.withProperty(FACING, enumfacing); + } + + state = state.withProperty(OPEN, Boolean.valueOf(true)); + worldIn.setBlockState(pos, state, 2); + } + + worldIn.playAuxSFXAtEntity(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0); + return true; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + boolean flag = worldIn.isBlockPowered(pos); + + if (flag || neighborBlock.canProvidePower()) + { + if (flag && !((Boolean)state.getValue(OPEN)).booleanValue() && !((Boolean)state.getValue(POWERED)).booleanValue()) + { + worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(true)).withProperty(POWERED, Boolean.valueOf(true)), 2); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1003, pos, 0); + } + else if (!flag && ((Boolean)state.getValue(OPEN)).booleanValue() && ((Boolean)state.getValue(POWERED)).booleanValue()) + { + worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)), 2); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1006, pos, 0); + } + else if (flag != ((Boolean)state.getValue(POWERED)).booleanValue()) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(flag)), 2); + } + } + } + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return true; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(OPEN, Boolean.valueOf((meta & 4) != 0)).withProperty(POWERED, Boolean.valueOf((meta & 8) != 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 8; + } + + if (((Boolean)state.getValue(OPEN)).booleanValue()) + { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, OPEN, POWERED, IN_WALL}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFire.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFire.java new file mode 100644 index 0000000..b049aab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFire.java @@ -0,0 +1,475 @@ +package net.minecraft.block; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderEnd; + +public class BlockFire extends Block +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + public static final PropertyBool FLIP = PropertyBool.create("flip"); + public static final PropertyBool ALT = PropertyBool.create("alt"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + public static final PropertyInteger UPPER = PropertyInteger.create("upper", 0, 2); + private final Map encouragements = Maps.newIdentityHashMap(); + private final Map flammabilities = Maps.newIdentityHashMap(); + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down())) + { + boolean flag = (i + j + k & 1) == 1; + boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1; + int l = 0; + + if (this.canCatchFire(worldIn, pos.up())) + { + l = flag ? 1 : 2; + } + + return state.withProperty(NORTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canCatchFire(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canCatchFire(worldIn, pos.west()))).withProperty(UPPER, Integer.valueOf(l)).withProperty(FLIP, Boolean.valueOf(flag1)).withProperty(ALT, Boolean.valueOf(flag)); + } + else + { + return this.getDefaultState(); + } + } + + protected BlockFire() + { + super(Material.fire); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FLIP, Boolean.valueOf(false)).withProperty(ALT, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(UPPER, Integer.valueOf(0))); + this.setTickRandomly(true); + } + + public static void init() + { + Blocks.fire.setFireInfo(Blocks.planks, 5, 20); + Blocks.fire.setFireInfo(Blocks.double_wooden_slab, 5, 20); + Blocks.fire.setFireInfo(Blocks.wooden_slab, 5, 20); + Blocks.fire.setFireInfo(Blocks.oak_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.spruce_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.birch_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.jungle_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.dark_oak_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.acacia_fence_gate, 5, 20); + Blocks.fire.setFireInfo(Blocks.oak_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.spruce_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.birch_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.jungle_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.dark_oak_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.acacia_fence, 5, 20); + Blocks.fire.setFireInfo(Blocks.oak_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.birch_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.spruce_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.jungle_stairs, 5, 20); + Blocks.fire.setFireInfo(Blocks.log, 5, 5); + Blocks.fire.setFireInfo(Blocks.log2, 5, 5); + Blocks.fire.setFireInfo(Blocks.leaves, 30, 60); + Blocks.fire.setFireInfo(Blocks.leaves2, 30, 60); + Blocks.fire.setFireInfo(Blocks.bookshelf, 30, 20); + Blocks.fire.setFireInfo(Blocks.tnt, 15, 100); + Blocks.fire.setFireInfo(Blocks.tallgrass, 60, 100); + Blocks.fire.setFireInfo(Blocks.double_plant, 60, 100); + Blocks.fire.setFireInfo(Blocks.yellow_flower, 60, 100); + Blocks.fire.setFireInfo(Blocks.red_flower, 60, 100); + Blocks.fire.setFireInfo(Blocks.deadbush, 60, 100); + Blocks.fire.setFireInfo(Blocks.wool, 30, 60); + Blocks.fire.setFireInfo(Blocks.vine, 15, 100); + Blocks.fire.setFireInfo(Blocks.coal_block, 5, 5); + Blocks.fire.setFireInfo(Blocks.hay_block, 60, 20); + Blocks.fire.setFireInfo(Blocks.carpet, 60, 20); + } + + public void setFireInfo(Block blockIn, int encouragement, int flammability) + { + this.encouragements.put(blockIn, Integer.valueOf(encouragement)); + this.flammabilities.put(blockIn, Integer.valueOf(flammability)); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public int tickRate(World worldIn) + { + return 30; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (worldIn.getGameRules().getBoolean("doFireTick")) + { + if (!this.canPlaceBlockAt(worldIn, pos)) + { + worldIn.setBlockToAir(pos); + } + + Block block = worldIn.getBlockState(pos.down()).getBlock(); + boolean flag = block == Blocks.netherrack; + + if (worldIn.provider instanceof WorldProviderEnd && block == Blocks.bedrock) + { + flag = true; + } + + if (!flag && worldIn.isRaining() && this.canDie(worldIn, pos)) + { + worldIn.setBlockToAir(pos); + } + else + { + int i = ((Integer)state.getValue(AGE)).intValue(); + + if (i < 15) + { + state = state.withProperty(AGE, Integer.valueOf(i + rand.nextInt(3) / 2)); + worldIn.setBlockState(pos, state, 4); + } + + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn) + rand.nextInt(10)); + + if (!flag) + { + if (!this.canNeighborCatchFire(worldIn, pos)) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) || i > 3) + { + worldIn.setBlockToAir(pos); + } + + return; + } + + if (!this.canCatchFire(worldIn, pos.down()) && i == 15 && rand.nextInt(4) == 0) + { + worldIn.setBlockToAir(pos); + return; + } + } + + boolean flag1 = worldIn.isBlockinHighHumidity(pos); + int j = 0; + + if (flag1) + { + j = -50; + } + + this.catchOnFire(worldIn, pos.east(), 300 + j, rand, i); + this.catchOnFire(worldIn, pos.west(), 300 + j, rand, i); + this.catchOnFire(worldIn, pos.down(), 250 + j, rand, i); + this.catchOnFire(worldIn, pos.up(), 250 + j, rand, i); + this.catchOnFire(worldIn, pos.north(), 300 + j, rand, i); + this.catchOnFire(worldIn, pos.south(), 300 + j, rand, i); + + for (int k = -1; k <= 1; ++k) + { + for (int l = -1; l <= 1; ++l) + { + for (int i1 = -1; i1 <= 4; ++i1) + { + if (k != 0 || i1 != 0 || l != 0) + { + int j1 = 100; + + if (i1 > 1) + { + j1 += (i1 - 1) * 100; + } + + BlockPos blockpos = pos.add(k, i1, l); + int k1 = this.getNeighborEncouragement(worldIn, blockpos); + + if (k1 > 0) + { + int l1 = (k1 + 40 + worldIn.getDifficulty().getDifficultyId() * 7) / (i + 30); + + if (flag1) + { + l1 /= 2; + } + + if (l1 > 0 && rand.nextInt(j1) <= l1 && (!worldIn.isRaining() || !this.canDie(worldIn, blockpos))) + { + int i2 = i + rand.nextInt(5) / 4; + + if (i2 > 15) + { + i2 = 15; + } + + worldIn.setBlockState(blockpos, state.withProperty(AGE, Integer.valueOf(i2)), 3); + } + } + } + } + } + } + } + } + } + + protected boolean canDie(World worldIn, BlockPos pos) + { + return worldIn.isRainingAt(pos) || worldIn.isRainingAt(pos.west()) || worldIn.isRainingAt(pos.east()) || worldIn.isRainingAt(pos.north()) || worldIn.isRainingAt(pos.south()); + } + + public boolean requiresUpdates() + { + return false; + } + + private int getFlammability(Block blockIn) + { + Integer integer = (Integer)this.flammabilities.get(blockIn); + return integer == null ? 0 : integer.intValue(); + } + + private int getEncouragement(Block blockIn) + { + Integer integer = (Integer)this.encouragements.get(blockIn); + return integer == null ? 0 : integer.intValue(); + } + + private void catchOnFire(World worldIn, BlockPos pos, int chance, Random random, int age) + { + int i = this.getFlammability(worldIn.getBlockState(pos).getBlock()); + + if (random.nextInt(chance) < i) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (random.nextInt(age + 10) < 5 && !worldIn.isRainingAt(pos)) + { + int j = age + random.nextInt(5) / 4; + + if (j > 15) + { + j = 15; + } + + worldIn.setBlockState(pos, this.getDefaultState().withProperty(AGE, Integer.valueOf(j)), 3); + } + else + { + worldIn.setBlockToAir(pos); + } + + if (iblockstate.getBlock() == Blocks.tnt) + { + Blocks.tnt.onBlockDestroyedByPlayer(worldIn, pos, iblockstate.withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true))); + } + } + } + + private boolean canNeighborCatchFire(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (this.canCatchFire(worldIn, pos.offset(enumfacing))) + { + return true; + } + } + + return false; + } + + private int getNeighborEncouragement(World worldIn, BlockPos pos) + { + if (!worldIn.isAirBlock(pos)) + { + return 0; + } + else + { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()), i); + } + + return i; + } + } + + public boolean isCollidable() + { + return false; + } + + public boolean canCatchFire(IBlockAccess worldIn, BlockPos pos) + { + return this.getEncouragement(worldIn.getBlockState(pos).getBlock()) > 0; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) || this.canNeighborCatchFire(worldIn, pos); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !this.canNeighborCatchFire(worldIn, pos)) + { + worldIn.setBlockToAir(pos); + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (worldIn.provider.getDimensionId() > 0 || !Blocks.portal.func_176548_d(worldIn, pos)) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !this.canNeighborCatchFire(worldIn, pos)) + { + worldIn.setBlockToAir(pos); + } + else + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn) + worldIn.rand.nextInt(10)); + } + } + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (rand.nextInt(24) == 0) + { + worldIn.playSound((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), "fire.fire", 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false); + } + + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down())) + { + if (Blocks.fire.canCatchFire(worldIn, pos.west())) + { + for (int j = 0; j < 2; ++j) + { + double d3 = (double)pos.getX() + rand.nextDouble() * 0.10000000149011612D; + double d8 = (double)pos.getY() + rand.nextDouble(); + double d13 = (double)pos.getZ() + rand.nextDouble(); + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d3, d8, d13, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(worldIn, pos.east())) + { + for (int k = 0; k < 2; ++k) + { + double d4 = (double)(pos.getX() + 1) - rand.nextDouble() * 0.10000000149011612D; + double d9 = (double)pos.getY() + rand.nextDouble(); + double d14 = (double)pos.getZ() + rand.nextDouble(); + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d4, d9, d14, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(worldIn, pos.north())) + { + for (int l = 0; l < 2; ++l) + { + double d5 = (double)pos.getX() + rand.nextDouble(); + double d10 = (double)pos.getY() + rand.nextDouble(); + double d15 = (double)pos.getZ() + rand.nextDouble() * 0.10000000149011612D; + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d5, d10, d15, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(worldIn, pos.south())) + { + for (int i1 = 0; i1 < 2; ++i1) + { + double d6 = (double)pos.getX() + rand.nextDouble(); + double d11 = (double)pos.getY() + rand.nextDouble(); + double d16 = (double)(pos.getZ() + 1) - rand.nextDouble() * 0.10000000149011612D; + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d6, d11, d16, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (Blocks.fire.canCatchFire(worldIn, pos.up())) + { + for (int j1 = 0; j1 < 2; ++j1) + { + double d7 = (double)pos.getX() + rand.nextDouble(); + double d12 = (double)(pos.getY() + 1) - rand.nextDouble() * 0.10000000149011612D; + double d17 = (double)pos.getZ() + rand.nextDouble(); + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d7, d12, d17, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + else + { + for (int i = 0; i < 3; ++i) + { + double d0 = (double)pos.getX() + rand.nextDouble(); + double d1 = (double)pos.getY() + rand.nextDouble() * 0.5D + 0.5D; + double d2 = (double)pos.getZ() + rand.nextDouble(); + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.tntColor; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFlower.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFlower.java new file mode 100644 index 0000000..26e90d6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFlower.java @@ -0,0 +1,177 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import com.google.common.collect.Collections2; +import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.List; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public abstract class BlockFlower extends BlockBush +{ + protected PropertyEnum type; + + protected BlockFlower() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(this.getTypeProperty(), this.getBlockType() == BlockFlower.EnumFlowerColor.RED ? BlockFlower.EnumFlowerType.POPPY : BlockFlower.EnumFlowerType.DANDELION)); + } + + public int damageDropped(IBlockState state) + { + return ((BlockFlower.EnumFlowerType)state.getValue(this.getTypeProperty())).getMeta(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockFlower.EnumFlowerType blockflower$enumflowertype : BlockFlower.EnumFlowerType.getTypes(this.getBlockType())) + { + list.add(new ItemStack(itemIn, 1, blockflower$enumflowertype.getMeta())); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(this.getTypeProperty(), BlockFlower.EnumFlowerType.getType(this.getBlockType(), meta)); + } + + public abstract BlockFlower.EnumFlowerColor getBlockType(); + + public IProperty getTypeProperty() + { + if (this.type == null) + { + this.type = PropertyEnum.create("type", BlockFlower.EnumFlowerType.class, new Predicate() + { + public boolean apply(BlockFlower.EnumFlowerType p_apply_1_) + { + return p_apply_1_.getBlockType() == BlockFlower.this.getBlockType(); + } + }); + } + + return this.type; + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockFlower.EnumFlowerType)state.getValue(this.getTypeProperty())).getMeta(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {this.getTypeProperty()}); + } + + public Block.EnumOffsetType getOffsetType() + { + return Block.EnumOffsetType.XZ; + } + + public static enum EnumFlowerColor + { + YELLOW, + RED; + + public BlockFlower getBlock() + { + return this == YELLOW ? Blocks.yellow_flower : Blocks.red_flower; + } + } + + public static enum EnumFlowerType implements IStringSerializable + { + DANDELION(BlockFlower.EnumFlowerColor.YELLOW, 0, "dandelion"), + POPPY(BlockFlower.EnumFlowerColor.RED, 0, "poppy"), + BLUE_ORCHID(BlockFlower.EnumFlowerColor.RED, 1, "blue_orchid", "blueOrchid"), + ALLIUM(BlockFlower.EnumFlowerColor.RED, 2, "allium"), + HOUSTONIA(BlockFlower.EnumFlowerColor.RED, 3, "houstonia"), + RED_TULIP(BlockFlower.EnumFlowerColor.RED, 4, "red_tulip", "tulipRed"), + ORANGE_TULIP(BlockFlower.EnumFlowerColor.RED, 5, "orange_tulip", "tulipOrange"), + WHITE_TULIP(BlockFlower.EnumFlowerColor.RED, 6, "white_tulip", "tulipWhite"), + PINK_TULIP(BlockFlower.EnumFlowerColor.RED, 7, "pink_tulip", "tulipPink"), + OXEYE_DAISY(BlockFlower.EnumFlowerColor.RED, 8, "oxeye_daisy", "oxeyeDaisy"); + + private static final BlockFlower.EnumFlowerType[][] TYPES_FOR_BLOCK = new BlockFlower.EnumFlowerType[BlockFlower.EnumFlowerColor.values().length][]; + private final BlockFlower.EnumFlowerColor blockType; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumFlowerType(BlockFlower.EnumFlowerColor blockType, int meta, String name) + { + this(blockType, meta, name, name); + } + + private EnumFlowerType(BlockFlower.EnumFlowerColor blockType, int meta, String name, String unlocalizedName) + { + this.blockType = blockType; + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public BlockFlower.EnumFlowerColor getBlockType() + { + return this.blockType; + } + + public int getMeta() + { + return this.meta; + } + + public static BlockFlower.EnumFlowerType getType(BlockFlower.EnumFlowerColor blockType, int meta) + { + BlockFlower.EnumFlowerType[] ablockflower$enumflowertype = TYPES_FOR_BLOCK[blockType.ordinal()]; + + if (meta < 0 || meta >= ablockflower$enumflowertype.length) + { + meta = 0; + } + + return ablockflower$enumflowertype[meta]; + } + + public static BlockFlower.EnumFlowerType[] getTypes(BlockFlower.EnumFlowerColor flowerColor) + { + return TYPES_FOR_BLOCK[flowerColor.ordinal()]; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (final BlockFlower.EnumFlowerColor blockflower$enumflowercolor : BlockFlower.EnumFlowerColor.values()) + { + Collection collection = Collections2.filter(Lists.newArrayList(values()), new Predicate() + { + public boolean apply(BlockFlower.EnumFlowerType p_apply_1_) + { + return p_apply_1_.getBlockType() == blockflower$enumflowercolor; + } + }); + TYPES_FOR_BLOCK[blockflower$enumflowercolor.ordinal()] = (BlockFlower.EnumFlowerType[])collection.toArray(new BlockFlower.EnumFlowerType[collection.size()]); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFlowerPot.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFlowerPot.java new file mode 100644 index 0000000..2eb69ba --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFlowerPot.java @@ -0,0 +1,463 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFlowerPot extends BlockContainer +{ + public static final PropertyInteger LEGACY_DATA = PropertyInteger.create("legacy_data", 0, 15); + public static final PropertyEnum CONTENTS = PropertyEnum.create("contents", BlockFlowerPot.EnumFlowerType.class); + + public BlockFlowerPot() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(CONTENTS, BlockFlowerPot.EnumFlowerType.EMPTY).withProperty(LEGACY_DATA, Integer.valueOf(0))); + this.setBlockBoundsForItemRender(); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal("item.flowerPot.name"); + } + + public void setBlockBoundsForItemRender() + { + float f = 0.375F; + float f1 = f / 2.0F; + this.setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, f, 0.5F + f1); + } + + public boolean isOpaqueCube() + { + return false; + } + + public int getRenderType() + { + return 3; + } + + public boolean isFullCube() + { + return false; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityFlowerPot) + { + Item item = ((TileEntityFlowerPot)tileentity).getFlowerPotItem(); + + if (item instanceof ItemBlock) + { + return Block.getBlockFromItem(item).colorMultiplier(worldIn, pos, renderPass); + } + } + + return 16777215; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + ItemStack itemstack = playerIn.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() instanceof ItemBlock) + { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos); + + if (tileentityflowerpot == null) + { + return false; + } + else if (tileentityflowerpot.getFlowerPotItem() != null) + { + return false; + } + else + { + Block block = Block.getBlockFromItem(itemstack.getItem()); + + if (!this.canNotContain(block, itemstack.getMetadata())) + { + return false; + } + else + { + tileentityflowerpot.setFlowerPotData(itemstack.getItem(), itemstack.getMetadata()); + tileentityflowerpot.markDirty(); + worldIn.markBlockForUpdate(pos); + playerIn.triggerAchievement(StatList.field_181736_T); + + if (!playerIn.capabilities.isCreativeMode && --itemstack.stackSize <= 0) + { + playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + } + else + { + return false; + } + } + + private boolean canNotContain(Block blockIn, int meta) + { + return blockIn != Blocks.yellow_flower && blockIn != Blocks.red_flower && blockIn != Blocks.cactus && blockIn != Blocks.brown_mushroom && blockIn != Blocks.red_mushroom && blockIn != Blocks.sapling && blockIn != Blocks.deadbush ? blockIn == Blocks.tallgrass && meta == BlockTallGrass.EnumType.FERN.getMeta() : true; + } + + public Item getItem(World worldIn, BlockPos pos) + { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos); + return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ? tileentityflowerpot.getFlowerPotItem() : Items.flower_pot; + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos); + return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ? tileentityflowerpot.getFlowerPotData() : 0; + } + + public boolean isFlowerPot() + { + return true; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down())) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos); + + if (tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null) + { + spawnAsEntity(worldIn, pos, new ItemStack(tileentityflowerpot.getFlowerPotItem(), 1, tileentityflowerpot.getFlowerPotData())); + } + + super.breakBlock(worldIn, pos, state); + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + super.onBlockHarvested(worldIn, pos, state, player); + + if (player.capabilities.isCreativeMode) + { + TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos); + + if (tileentityflowerpot != null) + { + tileentityflowerpot.setFlowerPotData((Item)null, 0); + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.flower_pot; + } + + private TileEntityFlowerPot getTileEntity(World worldIn, BlockPos pos) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)tileentity : null; + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + Block block = null; + int i = 0; + + switch (meta) + { + case 1: + block = Blocks.red_flower; + i = BlockFlower.EnumFlowerType.POPPY.getMeta(); + break; + + case 2: + block = Blocks.yellow_flower; + break; + + case 3: + block = Blocks.sapling; + i = BlockPlanks.EnumType.OAK.getMetadata(); + break; + + case 4: + block = Blocks.sapling; + i = BlockPlanks.EnumType.SPRUCE.getMetadata(); + break; + + case 5: + block = Blocks.sapling; + i = BlockPlanks.EnumType.BIRCH.getMetadata(); + break; + + case 6: + block = Blocks.sapling; + i = BlockPlanks.EnumType.JUNGLE.getMetadata(); + break; + + case 7: + block = Blocks.red_mushroom; + break; + + case 8: + block = Blocks.brown_mushroom; + break; + + case 9: + block = Blocks.cactus; + break; + + case 10: + block = Blocks.deadbush; + break; + + case 11: + block = Blocks.tallgrass; + i = BlockTallGrass.EnumType.FERN.getMeta(); + break; + + case 12: + block = Blocks.sapling; + i = BlockPlanks.EnumType.ACACIA.getMetadata(); + break; + + case 13: + block = Blocks.sapling; + i = BlockPlanks.EnumType.DARK_OAK.getMetadata(); + } + + return new TileEntityFlowerPot(Item.getItemFromBlock(block), i); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {CONTENTS, LEGACY_DATA}); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(LEGACY_DATA)).intValue(); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + BlockFlowerPot.EnumFlowerType blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityFlowerPot) + { + TileEntityFlowerPot tileentityflowerpot = (TileEntityFlowerPot)tileentity; + Item item = tileentityflowerpot.getFlowerPotItem(); + + if (item instanceof ItemBlock) + { + int i = tileentityflowerpot.getFlowerPotData(); + Block block = Block.getBlockFromItem(item); + + if (block == Blocks.sapling) + { + switch (BlockPlanks.EnumType.byMetadata(i)) + { + case OAK: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.OAK_SAPLING; + break; + + case SPRUCE: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.SPRUCE_SAPLING; + break; + + case BIRCH: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.BIRCH_SAPLING; + break; + + case JUNGLE: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.JUNGLE_SAPLING; + break; + + case ACACIA: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.ACACIA_SAPLING; + break; + + case DARK_OAK: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DARK_OAK_SAPLING; + break; + + default: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + } + } + else if (block == Blocks.tallgrass) + { + switch (i) + { + case 0: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DEAD_BUSH; + break; + + case 2: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.FERN; + break; + + default: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + } + } + else if (block == Blocks.yellow_flower) + { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DANDELION; + } + else if (block == Blocks.red_flower) + { + switch (BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.RED, i)) + { + case POPPY: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.POPPY; + break; + + case BLUE_ORCHID: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.BLUE_ORCHID; + break; + + case ALLIUM: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.ALLIUM; + break; + + case HOUSTONIA: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.HOUSTONIA; + break; + + case RED_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.RED_TULIP; + break; + + case ORANGE_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.ORANGE_TULIP; + break; + + case WHITE_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.WHITE_TULIP; + break; + + case PINK_TULIP: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.PINK_TULIP; + break; + + case OXEYE_DAISY: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.OXEYE_DAISY; + break; + + default: + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.EMPTY; + } + } + else if (block == Blocks.red_mushroom) + { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.MUSHROOM_RED; + } + else if (block == Blocks.brown_mushroom) + { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.MUSHROOM_BROWN; + } + else if (block == Blocks.deadbush) + { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.DEAD_BUSH; + } + else if (block == Blocks.cactus) + { + blockflowerpot$enumflowertype = BlockFlowerPot.EnumFlowerType.CACTUS; + } + } + } + + return state.withProperty(CONTENTS, blockflowerpot$enumflowertype); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public static enum EnumFlowerType implements IStringSerializable + { + EMPTY("empty"), + POPPY("rose"), + BLUE_ORCHID("blue_orchid"), + ALLIUM("allium"), + HOUSTONIA("houstonia"), + RED_TULIP("red_tulip"), + ORANGE_TULIP("orange_tulip"), + WHITE_TULIP("white_tulip"), + PINK_TULIP("pink_tulip"), + OXEYE_DAISY("oxeye_daisy"), + DANDELION("dandelion"), + OAK_SAPLING("oak_sapling"), + SPRUCE_SAPLING("spruce_sapling"), + BIRCH_SAPLING("birch_sapling"), + JUNGLE_SAPLING("jungle_sapling"), + ACACIA_SAPLING("acacia_sapling"), + DARK_OAK_SAPLING("dark_oak_sapling"), + MUSHROOM_RED("mushroom_red"), + MUSHROOM_BROWN("mushroom_brown"), + DEAD_BUSH("dead_bush"), + FERN("fern"), + CACTUS("cactus"); + + private final String name; + + private EnumFlowerType(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockFurnace.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFurnace.java new file mode 100644 index 0000000..f9f2234 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockFurnace.java @@ -0,0 +1,247 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class BlockFurnace extends BlockContainer +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + private final boolean isBurning; + private static boolean keepInventory; + + protected BlockFurnace(boolean isBurning) + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.isBurning = isBurning; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.furnace); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.setDefaultFacing(worldIn, pos, state); + } + + private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + Block block = worldIn.getBlockState(pos.north()).getBlock(); + Block block1 = worldIn.getBlockState(pos.south()).getBlock(); + Block block2 = worldIn.getBlockState(pos.west()).getBlock(); + Block block3 = worldIn.getBlockState(pos.east()).getBlock(); + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock()) + { + enumfacing = EnumFacing.SOUTH; + } + else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock()) + { + enumfacing = EnumFacing.NORTH; + } + else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock()) + { + enumfacing = EnumFacing.EAST; + } + else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock()) + { + enumfacing = EnumFacing.WEST; + } + + worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); + } + } + + @SuppressWarnings("incomplete-switch") + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this.isBurning) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + double d0 = (double)pos.getX() + 0.5D; + double d1 = (double)pos.getY() + rand.nextDouble() * 6.0D / 16.0D; + double d2 = (double)pos.getZ() + 0.5D; + double d3 = 0.52D; + double d4 = rand.nextDouble() * 0.6D - 0.3D; + + switch (enumfacing) + { + case WEST: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + break; + + case EAST: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + break; + + case NORTH: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); + break; + + case SOUTH: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityFurnace) + { + playerIn.displayGUIChest((TileEntityFurnace)tileentity); + playerIn.triggerAchievement(StatList.field_181741_Y); + } + + return true; + } + } + + public static void setState(boolean active, World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + TileEntity tileentity = worldIn.getTileEntity(pos); + keepInventory = true; + + if (active) + { + worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + } + else + { + worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); + } + + keepInventory = false; + + if (tileentity != null) + { + tileentity.validate(); + worldIn.setTileEntity(pos, tileentity); + } + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityFurnace(); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2); + + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityFurnace) + { + ((TileEntityFurnace)tileentity).setCustomInventoryName(stack.getDisplayName()); + } + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (!keepInventory) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityFurnace) + { + InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity); + worldIn.updateComparatorOutputLevel(pos, this); + } + } + + super.breakBlock(worldIn, pos, state); + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return Container.calcRedstone(worldIn.getTileEntity(pos)); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.furnace); + } + + public int getRenderType() + { + return 3; + } + + public IBlockState getStateForEntityRender(IBlockState state) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing = EnumFacing.getFront(meta); + + if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumFacing)state.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockGlass.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGlass.java new file mode 100644 index 0000000..80e6931 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGlass.java @@ -0,0 +1,35 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.EnumWorldBlockLayer; + +public class BlockGlass extends BlockBreakable +{ + public BlockGlass(Material materialIn, boolean ignoreSimilarity) + { + super(materialIn, ignoreSimilarity); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int quantityDropped(Random random) + { + return 0; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public boolean isFullCube() + { + return false; + } + + protected boolean canSilkHarvest() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockGlowstone.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGlowstone.java new file mode 100644 index 0000000..e154bda --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGlowstone.java @@ -0,0 +1,39 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.MathHelper; + +public class BlockGlowstone extends Block +{ + public BlockGlowstone(Material materialIn) + { + super(materialIn); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int quantityDroppedWithBonus(int fortune, Random random) + { + return MathHelper.clamp_int(this.quantityDropped(random) + random.nextInt(fortune + 1), 1, 4); + } + + public int quantityDropped(Random random) + { + return 2 + random.nextInt(3); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.glowstone_dust; + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.sandColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockGrass.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGrass.java new file mode 100644 index 0000000..7c65004 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGrass.java @@ -0,0 +1,161 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeColorHelper; + +public class BlockGrass extends Block implements IGrowable +{ + public static final PropertyBool SNOWY = PropertyBool.create("snowy"); + + protected BlockGrass() + { + super(Material.grass); + this.setDefaultState(this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos.up()).getBlock(); + return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); + } + + public int getBlockColor() + { + return ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + + public int getRenderColor(IBlockState state) + { + return this.getBlockColor(); + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return BiomeColorHelper.getGrassColorAtPos(worldIn, pos); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity() > 2) + { + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); + } + else + { + if (worldIn.getLightFromNeighbors(pos.up()) >= 9) + { + for (int i = 0; i < 4; ++i) + { + BlockPos blockpos = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1); + Block block = worldIn.getBlockState(blockpos.up()).getBlock(); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) + { + worldIn.setBlockState(blockpos, Blocks.grass.getDefaultState()); + } + } + } + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Blocks.dirt.getItemDropped(Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT), rand, fortune); + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + return true; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return true; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + BlockPos blockpos = pos.up(); + + for (int i = 0; i < 128; ++i) + { + BlockPos blockpos1 = blockpos; + int j = 0; + + while (true) + { + if (j >= i / 16) + { + if (worldIn.getBlockState(blockpos1).getBlock().blockMaterial == Material.air) + { + if (rand.nextInt(8) == 0) + { + BlockFlower.EnumFlowerType blockflower$enumflowertype = worldIn.getBiomeGenForCoords(blockpos1).pickRandomFlower(rand, blockpos1); + BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock(); + IBlockState iblockstate = blockflower.getDefaultState().withProperty(blockflower.getTypeProperty(), blockflower$enumflowertype); + + if (blockflower.canBlockStay(worldIn, blockpos1, iblockstate)) + { + worldIn.setBlockState(blockpos1, iblockstate, 3); + } + } + else + { + IBlockState iblockstate1 = Blocks.tallgrass.getDefaultState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS); + + if (Blocks.tallgrass.canBlockStay(worldIn, blockpos1, iblockstate1)) + { + worldIn.setBlockState(blockpos1, iblockstate1, 3); + } + } + } + + break; + } + + blockpos1 = blockpos1.add(rand.nextInt(3) - 1, (rand.nextInt(3) - 1) * rand.nextInt(3) / 2, rand.nextInt(3) - 1); + + if (worldIn.getBlockState(blockpos1.down()).getBlock() != Blocks.grass || worldIn.getBlockState(blockpos1).getBlock().isNormalCube()) + { + break; + } + + ++j; + } + } + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + public int getMetaFromState(IBlockState state) + { + return 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {SNOWY}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockGravel.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGravel.java new file mode 100644 index 0000000..3b5ff96 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockGravel.java @@ -0,0 +1,25 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockGravel extends BlockFalling +{ + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + if (fortune > 3) + { + fortune = 3; + } + + return rand.nextInt(10 - fortune * 3) == 0 ? Items.flint : Item.getItemFromBlock(this); + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.stoneColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfStoneSlab.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfStoneSlab.java new file mode 100644 index 0000000..d4c4565 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfStoneSlab.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockHalfStoneSlab extends BlockStoneSlab +{ + public boolean isDouble() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfStoneSlabNew.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfStoneSlabNew.java new file mode 100644 index 0000000..52105ab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfStoneSlabNew.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockHalfStoneSlabNew extends BlockStoneSlabNew +{ + public boolean isDouble() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfWoodSlab.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfWoodSlab.java new file mode 100644 index 0000000..3422084 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHalfWoodSlab.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockHalfWoodSlab extends BlockWoodSlab +{ + public boolean isDouble() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockHardenedClay.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHardenedClay.java new file mode 100644 index 0000000..f56c16c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHardenedClay.java @@ -0,0 +1,20 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockHardenedClay extends Block +{ + public BlockHardenedClay() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.adobeColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockHay.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHay.java new file mode 100644 index 0000000..567832a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHay.java @@ -0,0 +1,73 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockHay extends BlockRotatedPillar +{ + public BlockHay() + { + super(Material.grass, MapColor.yellowColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.Y)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Y; + int i = meta & 12; + + if (i == 4) + { + enumfacing$axis = EnumFacing.Axis.X; + } + else if (i == 8) + { + enumfacing$axis = EnumFacing.Axis.Z; + } + + return this.getDefaultState().withProperty(AXIS, enumfacing$axis); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis)state.getValue(AXIS); + + if (enumfacing$axis == EnumFacing.Axis.X) + { + i |= 4; + } + else if (enumfacing$axis == EnumFacing.Axis.Z) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AXIS}); + } + + protected ItemStack createStackedBlock(IBlockState state) + { + return new ItemStack(Item.getItemFromBlock(this), 1, 0); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(AXIS, facing.getAxis()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockHopper.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHopper.java new file mode 100644 index 0000000..2187ba9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHopper.java @@ -0,0 +1,221 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockHopper extends BlockContainer +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() + { + public boolean apply(EnumFacing p_apply_1_) + { + return p_apply_1_ != EnumFacing.UP; + } + }); + public static final PropertyBool ENABLED = PropertyBool.create("enabled"); + + public BlockHopper() + { + super(Material.iron, MapColor.stoneColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.DOWN).withProperty(ENABLED, Boolean.valueOf(true))); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + float f = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + EnumFacing enumfacing = facing.getOpposite(); + + if (enumfacing == EnumFacing.UP) + { + enumfacing = EnumFacing.DOWN; + } + + return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(ENABLED, Boolean.valueOf(true)); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityHopper(); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + super.onBlockPlacedBy(worldIn, pos, state, placer, stack); + + if (stack.hasDisplayName()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityHopper) + { + ((TileEntityHopper)tileentity).setCustomName(stack.getDisplayName()); + } + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.updateState(worldIn, pos, state); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityHopper) + { + playerIn.displayGUIChest((TileEntityHopper)tileentity); + playerIn.triggerAchievement(StatList.field_181732_P); + } + + return true; + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + this.updateState(worldIn, pos, state); + } + + private void updateState(World worldIn, BlockPos pos, IBlockState state) + { + boolean flag = !worldIn.isBlockPowered(pos); + + if (flag != ((Boolean)state.getValue(ENABLED)).booleanValue()) + { + worldIn.setBlockState(pos, state.withProperty(ENABLED, Boolean.valueOf(flag)), 4); + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityHopper) + { + InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityHopper)tileentity); + worldIn.updateComparatorOutputLevel(pos, this); + } + + super.breakBlock(worldIn, pos, state); + } + + public int getRenderType() + { + return 3; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return true; + } + + public static EnumFacing getFacing(int meta) + { + return EnumFacing.getFront(meta & 7); + } + + public static boolean isEnabled(int meta) + { + return (meta & 8) != 8; + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + return Container.calcRedstone(worldIn.getTileEntity(pos)); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, getFacing(meta)).withProperty(ENABLED, Boolean.valueOf(isEnabled(meta))); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getIndex(); + + if (!((Boolean)state.getValue(ENABLED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, ENABLED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockHugeMushroom.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHugeMushroom.java new file mode 100644 index 0000000..dbddf9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockHugeMushroom.java @@ -0,0 +1,141 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.World; + +public class BlockHugeMushroom extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockHugeMushroom.EnumType.class); + private final Block smallBlock; + + public BlockHugeMushroom(Material p_i46392_1_, MapColor p_i46392_2_, Block p_i46392_3_) + { + super(p_i46392_1_, p_i46392_2_); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockHugeMushroom.EnumType.ALL_OUTSIDE)); + this.smallBlock = p_i46392_3_; + } + + public int quantityDropped(Random random) + { + return Math.max(0, random.nextInt(10) - 7); + } + + public MapColor getMapColor(IBlockState state) + { + switch ((BlockHugeMushroom.EnumType)state.getValue(VARIANT)) + { + case ALL_STEM: + return MapColor.clothColor; + + case ALL_INSIDE: + return MapColor.sandColor; + + case STEM: + return MapColor.sandColor; + + default: + return super.getMapColor(state); + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(this.smallBlock); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(this.smallBlock); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState(); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockHugeMushroom.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockHugeMushroom.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + NORTH_WEST(1, "north_west"), + NORTH(2, "north"), + NORTH_EAST(3, "north_east"), + WEST(4, "west"), + CENTER(5, "center"), + EAST(6, "east"), + SOUTH_WEST(7, "south_west"), + SOUTH(8, "south"), + SOUTH_EAST(9, "south_east"), + STEM(10, "stem"), + ALL_INSIDE(0, "all_inside"), + ALL_OUTSIDE(14, "all_outside"), + ALL_STEM(15, "all_stem"); + + private static final BlockHugeMushroom.EnumType[] META_LOOKUP = new BlockHugeMushroom.EnumType[16]; + private final int meta; + private final String name; + + private EnumType(int meta, String name) + { + this.meta = meta; + this.name = name; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockHugeMushroom.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + BlockHugeMushroom.EnumType blockhugemushroom$enumtype = META_LOOKUP[meta]; + return blockhugemushroom$enumtype == null ? META_LOOKUP[0] : blockhugemushroom$enumtype; + } + + public String getName() + { + return this.name; + } + + static { + for (BlockHugeMushroom.EnumType blockhugemushroom$enumtype : values()) + { + META_LOOKUP[blockhugemushroom$enumtype.getMetadata()] = blockhugemushroom$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockIce.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockIce.java new file mode 100644 index 0000000..f920cb5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockIce.java @@ -0,0 +1,91 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public class BlockIce extends BlockBreakable +{ + public BlockIce() + { + super(Material.ice, false); + this.slipperiness = 0.98F; + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + player.addExhaustion(0.025F); + + if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) + { + ItemStack itemstack = this.createStackedBlock(state); + + if (itemstack != null) + { + spawnAsEntity(worldIn, pos, itemstack); + } + } + else + { + if (worldIn.provider.doesWaterVaporize()) + { + worldIn.setBlockToAir(pos); + return; + } + + int i = EnchantmentHelper.getFortuneModifier(player); + this.dropBlockAsItem(worldIn, pos, state, i); + Material material = worldIn.getBlockState(pos.down()).getBlock().getMaterial(); + + if (material.blocksMovement() || material.isLiquid()) + { + worldIn.setBlockState(pos, Blocks.flowing_water.getDefaultState()); + } + } + } + + public int quantityDropped(Random random) + { + return 0; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (worldIn.getLightFor(EnumSkyBlock.BLOCK, pos) > 11 - this.getLightOpacity()) + { + if (worldIn.provider.doesWaterVaporize()) + { + worldIn.setBlockToAir(pos); + } + else + { + this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); + worldIn.setBlockState(pos, Blocks.water.getDefaultState()); + } + } + } + + public int getMobilityFlag() + { + return 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockJukebox.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockJukebox.java new file mode 100644 index 0000000..bbf8279 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockJukebox.java @@ -0,0 +1,190 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockJukebox extends BlockContainer +{ + public static final PropertyBool HAS_RECORD = PropertyBool.create("has_record"); + + protected BlockJukebox() + { + super(Material.wood, MapColor.dirtColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(HAS_RECORD, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (((Boolean)state.getValue(HAS_RECORD)).booleanValue()) + { + this.dropRecord(worldIn, pos, state); + state = state.withProperty(HAS_RECORD, Boolean.valueOf(false)); + worldIn.setBlockState(pos, state, 2); + return true; + } + else + { + return false; + } + } + + public void insertRecord(World worldIn, BlockPos pos, IBlockState state, ItemStack recordStack) + { + if (!worldIn.isRemote) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof BlockJukebox.TileEntityJukebox) + { + ((BlockJukebox.TileEntityJukebox)tileentity).setRecord(new ItemStack(recordStack.getItem(), 1, recordStack.getMetadata())); + worldIn.setBlockState(pos, state.withProperty(HAS_RECORD, Boolean.valueOf(true)), 2); + } + } + } + + private void dropRecord(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof BlockJukebox.TileEntityJukebox) + { + BlockJukebox.TileEntityJukebox blockjukebox$tileentityjukebox = (BlockJukebox.TileEntityJukebox)tileentity; + ItemStack itemstack = blockjukebox$tileentityjukebox.getRecord(); + + if (itemstack != null) + { + worldIn.playAuxSFX(1005, pos, 0); + worldIn.playRecord(pos, (String)null); + blockjukebox$tileentityjukebox.setRecord((ItemStack)null); + float f = 0.7F; + double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.2D + 0.6D; + double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + ItemStack itemstack1 = itemstack.copy(); + EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, itemstack1); + entityitem.setDefaultPickupDelay(); + worldIn.spawnEntityInWorld(entityitem); + } + } + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + this.dropRecord(worldIn, pos, state); + super.breakBlock(worldIn, pos, state); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + if (!worldIn.isRemote) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0); + } + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new BlockJukebox.TileEntityJukebox(); + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof BlockJukebox.TileEntityJukebox) + { + ItemStack itemstack = ((BlockJukebox.TileEntityJukebox)tileentity).getRecord(); + + if (itemstack != null) + { + return Item.getIdFromItem(itemstack.getItem()) + 1 - Item.getIdFromItem(Items.record_13); + } + } + + return 0; + } + + public int getRenderType() + { + return 3; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(HAS_RECORD, Boolean.valueOf(meta > 0)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Boolean)state.getValue(HAS_RECORD)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {HAS_RECORD}); + } + + public static class TileEntityJukebox extends TileEntity + { + private ItemStack record; + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + + if (compound.hasKey("RecordItem", 10)) + { + this.setRecord(ItemStack.loadItemStackFromNBT(compound.getCompoundTag("RecordItem"))); + } + else if (compound.getInteger("Record") > 0) + { + this.setRecord(new ItemStack(Item.getItemById(compound.getInteger("Record")), 1, 0)); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + + if (this.getRecord() != null) + { + compound.setTag("RecordItem", this.getRecord().writeToNBT(new NBTTagCompound())); + } + } + + public ItemStack getRecord() + { + return this.record; + } + + public void setRecord(ItemStack recordStack) + { + this.record = recordStack; + this.markDirty(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockLadder.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLadder.java new file mode 100644 index 0000000..27d2c35 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLadder.java @@ -0,0 +1,148 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockLadder extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + protected BlockLadder() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getCollisionBoundingBox(worldIn, pos, state); + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getSelectedBoundingBox(worldIn, pos); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this) + { + float f = 0.125F; + + switch ((EnumFacing)iblockstate.getValue(FACING)) + { + case NORTH: + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + break; + + case SOUTH: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + break; + + case WEST: + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + + case EAST: + default: + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + } + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos.west()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.east()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.north()).getBlock().isNormalCube() ? true : worldIn.getBlockState(pos.south()).getBlock().isNormalCube())); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + if (facing.getAxis().isHorizontal() && this.canBlockStay(worldIn, pos, facing)) + { + return this.getDefaultState().withProperty(FACING, facing); + } + else + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (this.canBlockStay(worldIn, pos, enumfacing)) + { + return this.getDefaultState().withProperty(FACING, enumfacing); + } + } + + return this.getDefaultState(); + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (!this.canBlockStay(worldIn, pos, enumfacing)) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + } + + protected boolean canBlockStay(World worldIn, BlockPos pos, EnumFacing facing) + { + return worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock().isNormalCube(); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing = EnumFacing.getFront(meta); + + if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumFacing)state.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockLeaves.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLeaves.java new file mode 100644 index 0000000..d93feaa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLeaves.java @@ -0,0 +1,289 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeColorHelper; + +public abstract class BlockLeaves extends BlockLeavesBase +{ + public static final PropertyBool DECAYABLE = PropertyBool.create("decayable"); + public static final PropertyBool CHECK_DECAY = PropertyBool.create("check_decay"); + int[] surroundings; + protected int iconIndex; + protected boolean isTransparent; + + public BlockLeaves() + { + super(Material.leaves, false); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setHardness(0.2F); + this.setLightOpacity(1); + this.setStepSound(soundTypeGrass); + } + + public int getBlockColor() + { + return ColorizerFoliage.getFoliageColor(0.5D, 1.0D); + } + + public int getRenderColor(IBlockState state) + { + return ColorizerFoliage.getFoliageColorBasic(); + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return BiomeColorHelper.getFoliageColorAtPos(worldIn, pos); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + int i = 1; + int j = i + 1; + int k = pos.getX(); + int l = pos.getY(); + int i1 = pos.getZ(); + + if (worldIn.isAreaLoaded(new BlockPos(k - j, l - j, i1 - j), new BlockPos(k + j, l + j, i1 + j))) + { + for (int j1 = -i; j1 <= i; ++j1) + { + for (int k1 = -i; k1 <= i; ++k1) + { + for (int l1 = -i; l1 <= i; ++l1) + { + BlockPos blockpos = pos.add(j1, k1, l1); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(CHECK_DECAY)).booleanValue()) + { + worldIn.setBlockState(blockpos, iblockstate.withProperty(CHECK_DECAY, Boolean.valueOf(true)), 4); + } + } + } + } + } + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue() && ((Boolean)state.getValue(DECAYABLE)).booleanValue()) + { + int i = 4; + int j = i + 1; + int k = pos.getX(); + int l = pos.getY(); + int i1 = pos.getZ(); + int j1 = 32; + int k1 = j1 * j1; + int l1 = j1 / 2; + + if (this.surroundings == null) + { + this.surroundings = new int[j1 * j1 * j1]; + } + + if (worldIn.isAreaLoaded(new BlockPos(k - j, l - j, i1 - j), new BlockPos(k + j, l + j, i1 + j))) + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i2 = -i; i2 <= i; ++i2) + { + for (int j2 = -i; j2 <= i; ++j2) + { + for (int k2 = -i; k2 <= i; ++k2) + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(k + i2, l + j2, i1 + k2)).getBlock(); + + if (block != Blocks.log && block != Blocks.log2) + { + if (block.getMaterial() == Material.leaves) + { + this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2; + } + else + { + this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -1; + } + } + else + { + this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = 0; + } + } + } + } + + for (int i3 = 1; i3 <= 4; ++i3) + { + for (int j3 = -i; j3 <= i; ++j3) + { + for (int k3 = -i; k3 <= i; ++k3) + { + for (int l3 = -i; l3 <= i; ++l3) + { + if (this.surroundings[(j3 + l1) * k1 + (k3 + l1) * j1 + l3 + l1] == i3 - 1) + { + if (this.surroundings[(j3 + l1 - 1) * k1 + (k3 + l1) * j1 + l3 + l1] == -2) + { + this.surroundings[(j3 + l1 - 1) * k1 + (k3 + l1) * j1 + l3 + l1] = i3; + } + + if (this.surroundings[(j3 + l1 + 1) * k1 + (k3 + l1) * j1 + l3 + l1] == -2) + { + this.surroundings[(j3 + l1 + 1) * k1 + (k3 + l1) * j1 + l3 + l1] = i3; + } + + if (this.surroundings[(j3 + l1) * k1 + (k3 + l1 - 1) * j1 + l3 + l1] == -2) + { + this.surroundings[(j3 + l1) * k1 + (k3 + l1 - 1) * j1 + l3 + l1] = i3; + } + + if (this.surroundings[(j3 + l1) * k1 + (k3 + l1 + 1) * j1 + l3 + l1] == -2) + { + this.surroundings[(j3 + l1) * k1 + (k3 + l1 + 1) * j1 + l3 + l1] = i3; + } + + if (this.surroundings[(j3 + l1) * k1 + (k3 + l1) * j1 + (l3 + l1 - 1)] == -2) + { + this.surroundings[(j3 + l1) * k1 + (k3 + l1) * j1 + (l3 + l1 - 1)] = i3; + } + + if (this.surroundings[(j3 + l1) * k1 + (k3 + l1) * j1 + l3 + l1 + 1] == -2) + { + this.surroundings[(j3 + l1) * k1 + (k3 + l1) * j1 + l3 + l1 + 1] = i3; + } + } + } + } + } + } + } + + int l2 = this.surroundings[l1 * k1 + l1 * j1 + l1]; + + if (l2 >= 0) + { + worldIn.setBlockState(pos, state.withProperty(CHECK_DECAY, Boolean.valueOf(false)), 4); + } + else + { + this.destroy(worldIn, pos); + } + } + } + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (worldIn.isRainingAt(pos.up()) && !World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && rand.nextInt(15) == 1) + { + double d0 = (double)((float)pos.getX() + rand.nextFloat()); + double d1 = (double)pos.getY() - 0.05D; + double d2 = (double)((float)pos.getZ() + rand.nextFloat()); + worldIn.spawnParticle(EnumParticleTypes.DRIP_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + private void destroy(World worldIn, BlockPos pos) + { + this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); + worldIn.setBlockToAir(pos); + } + + public int quantityDropped(Random random) + { + return random.nextInt(20) == 0 ? 1 : 0; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.sapling); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + if (!worldIn.isRemote) + { + int i = this.getSaplingDropChance(state); + + if (fortune > 0) + { + i -= 2 << fortune; + + if (i < 10) + { + i = 10; + } + } + + if (worldIn.rand.nextInt(i) == 0) + { + Item item = this.getItemDropped(state, worldIn.rand, fortune); + spawnAsEntity(worldIn, pos, new ItemStack(item, 1, this.damageDropped(state))); + } + + i = 200; + + if (fortune > 0) + { + i -= 10 << fortune; + + if (i < 40) + { + i = 40; + } + } + + this.dropApple(worldIn, pos, state, i); + } + } + + protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) + { + } + + protected int getSaplingDropChance(IBlockState state) + { + return 20; + } + + public boolean isOpaqueCube() + { + return !this.fancyGraphics; + } + + public void setGraphicsLevel(boolean fancy) + { + this.isTransparent = fancy; + this.fancyGraphics = fancy; + this.iconIndex = fancy ? 0 : 1; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return this.isTransparent ? EnumWorldBlockLayer.CUTOUT_MIPPED : EnumWorldBlockLayer.SOLID; + } + + public boolean isVisuallyOpaque() + { + return false; + } + + public abstract BlockPlanks.EnumType getWoodType(int meta); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockLeavesBase.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLeavesBase.java new file mode 100644 index 0000000..8a8426f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLeavesBase.java @@ -0,0 +1,27 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; + +public class BlockLeavesBase extends Block +{ + protected boolean fancyGraphics; + + protected BlockLeavesBase(Material materialIn, boolean fancyGraphics) + { + super(materialIn); + this.fancyGraphics = fancyGraphics; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return !this.fancyGraphics && worldIn.getBlockState(pos).getBlock() == this ? false : super.shouldSideBeRendered(worldIn, pos, side); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockLever.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLever.java new file mode 100644 index 0000000..db4e44e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLever.java @@ -0,0 +1,358 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockLever extends Block +{ + public static final PropertyEnum FACING = PropertyEnum.create("facing", BlockLever.EnumOrientation.class); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + + protected BlockLever() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, BlockLever.EnumOrientation.NORTH).withProperty(POWERED, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + return func_181090_a(worldIn, pos, side.getOpposite()); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (func_181090_a(worldIn, pos, enumfacing)) + { + return true; + } + } + + return false; + } + + protected static boolean func_181090_a(World p_181090_0_, BlockPos p_181090_1_, EnumFacing p_181090_2_) + { + return BlockButton.func_181088_a(p_181090_0_, p_181090_1_, p_181090_2_); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + IBlockState iblockstate = this.getDefaultState().withProperty(POWERED, Boolean.valueOf(false)); + + if (func_181090_a(worldIn, pos, facing.getOpposite())) + { + return iblockstate.withProperty(FACING, BlockLever.EnumOrientation.forFacings(facing, placer.getHorizontalFacing())); + } + else + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (enumfacing != facing && func_181090_a(worldIn, pos, enumfacing.getOpposite())) + { + return iblockstate.withProperty(FACING, BlockLever.EnumOrientation.forFacings(enumfacing, placer.getHorizontalFacing())); + } + } + + if (World.doesBlockHaveSolidTopSurface(worldIn, pos.down())) + { + return iblockstate.withProperty(FACING, BlockLever.EnumOrientation.forFacings(EnumFacing.UP, placer.getHorizontalFacing())); + } + else + { + return iblockstate; + } + } + } + + public static int getMetadataForFacing(EnumFacing facing) + { + switch (facing) + { + case DOWN: + return 0; + + case UP: + return 5; + + case NORTH: + return 4; + + case SOUTH: + return 3; + + case WEST: + return 2; + + case EAST: + return 1; + + default: + return -1; + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (this.func_181091_e(worldIn, pos, state) && !func_181090_a(worldIn, pos, ((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing().getOpposite())) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + + private boolean func_181091_e(World p_181091_1_, BlockPos p_181091_2_, IBlockState p_181091_3_) + { + if (this.canPlaceBlockAt(p_181091_1_, p_181091_2_)) + { + return true; + } + else + { + this.dropBlockAsItem(p_181091_1_, p_181091_2_, p_181091_3_, 0); + p_181091_1_.setBlockToAir(p_181091_2_); + return false; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + float f = 0.1875F; + + switch ((BlockLever.EnumOrientation)worldIn.getBlockState(pos).getValue(FACING)) + { + case EAST: + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + break; + + case WEST: + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + break; + + case SOUTH: + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + break; + + case NORTH: + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + break; + + case UP_Z: + case UP_X: + f = 0.25F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); + break; + + case DOWN_X: + case DOWN_Z: + f = 0.25F; + this.setBlockBounds(0.5F - f, 0.4F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + state = state.cycleProperty(POWERED); + worldIn.setBlockState(pos, state, 3); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, ((Boolean)state.getValue(POWERED)).booleanValue() ? 0.6F : 0.5F); + worldIn.notifyNeighborsOfStateChange(pos, this); + EnumFacing enumfacing = ((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing(); + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing.getOpposite()), this); + return true; + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + worldIn.notifyNeighborsOfStateChange(pos, this); + EnumFacing enumfacing = ((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing(); + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing.getOpposite()), this); + } + + super.breakBlock(worldIn, pos, state); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing() == side ? 15 : 0); + } + + public boolean canProvidePower() + { + return true; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, BlockLever.EnumOrientation.byMetadata(meta & 7)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockLever.EnumOrientation)state.getValue(FACING)).getMetadata(); + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, POWERED}); + } + + public static enum EnumOrientation implements IStringSerializable + { + DOWN_X(0, "down_x", EnumFacing.DOWN), + EAST(1, "east", EnumFacing.EAST), + WEST(2, "west", EnumFacing.WEST), + SOUTH(3, "south", EnumFacing.SOUTH), + NORTH(4, "north", EnumFacing.NORTH), + UP_Z(5, "up_z", EnumFacing.UP), + UP_X(6, "up_x", EnumFacing.UP), + DOWN_Z(7, "down_z", EnumFacing.DOWN); + + private static final BlockLever.EnumOrientation[] META_LOOKUP = new BlockLever.EnumOrientation[values().length]; + private final int meta; + private final String name; + private final EnumFacing facing; + + private EnumOrientation(int meta, String name, EnumFacing facing) + { + this.meta = meta; + this.name = name; + this.facing = facing; + } + + public int getMetadata() + { + return this.meta; + } + + public EnumFacing getFacing() + { + return this.facing; + } + + public String toString() + { + return this.name; + } + + public static BlockLever.EnumOrientation byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public static BlockLever.EnumOrientation forFacings(EnumFacing clickedSide, EnumFacing entityFacing) + { + switch (clickedSide) + { + case DOWN: + switch (entityFacing.getAxis()) + { + case X: + return DOWN_X; + + case Z: + return DOWN_Z; + + default: + throw new IllegalArgumentException("Invalid entityFacing " + entityFacing + " for facing " + clickedSide); + } + + case UP: + switch (entityFacing.getAxis()) + { + case X: + return UP_X; + + case Z: + return UP_Z; + + default: + throw new IllegalArgumentException("Invalid entityFacing " + entityFacing + " for facing " + clickedSide); + } + + case NORTH: + return NORTH; + + case SOUTH: + return SOUTH; + + case WEST: + return WEST; + + case EAST: + return EAST; + + default: + throw new IllegalArgumentException("Invalid facing: " + clickedSide); + } + } + + public String getName() + { + return this.name; + } + + static { + for (BlockLever.EnumOrientation blocklever$enumorientation : values()) + { + META_LOOKUP[blocklever$enumorientation.getMetadata()] = blocklever$enumorientation; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockLilyPad.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLilyPad.java new file mode 100644 index 0000000..38a38e5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLilyPad.java @@ -0,0 +1,75 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockLilyPad extends BlockBush +{ + protected BlockLilyPad() + { + float f = 0.5F; + float f1 = 0.015625F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + if (collidingEntity == null || !(collidingEntity instanceof EntityBoat)) + { + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ); + } + + public int getBlockColor() + { + return 7455580; + } + + public int getRenderColor(IBlockState state) + { + return 7455580; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return 2129968; + } + + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.water; + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + if (pos.getY() >= 0 && pos.getY() < 256) + { + IBlockState iblockstate = worldIn.getBlockState(pos.down()); + return iblockstate.getBlock().getMaterial() == Material.water && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0; + } + else + { + return false; + } + } + + public int getMetaFromState(IBlockState state) + { + return 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockLiquid.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLiquid.java new file mode 100644 index 0000000..7b42e8e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLiquid.java @@ -0,0 +1,380 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeColorHelper; + +public abstract class BlockLiquid extends Block +{ + public static final PropertyInteger LEVEL = PropertyInteger.create("level", 0, 15); + + protected BlockLiquid(Material materialIn) + { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(LEVEL, Integer.valueOf(0))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setTickRandomly(true); + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return this.blockMaterial != Material.lava; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return this.blockMaterial == Material.water ? BiomeColorHelper.getWaterColorAtPos(worldIn, pos) : 16777215; + } + + public static float getLiquidHeightPercent(int meta) + { + if (meta >= 8) + { + meta = 0; + } + + return (float)(meta + 1) / 9.0F; + } + + protected int getLevel(IBlockAccess worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos).getBlock().getMaterial() == this.blockMaterial ? ((Integer)worldIn.getBlockState(pos).getValue(LEVEL)).intValue() : -1; + } + + protected int getEffectiveFlowDecay(IBlockAccess worldIn, BlockPos pos) + { + int i = this.getLevel(worldIn, pos); + return i >= 8 ? 0 : i; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid) + { + return hitIfLiquid && ((Integer)state.getValue(LEVEL)).intValue() == 0; + } + + public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + Material material = worldIn.getBlockState(pos).getBlock().getMaterial(); + return material == this.blockMaterial ? false : (side == EnumFacing.UP ? true : (material == Material.ice ? false : super.isBlockSolid(worldIn, pos, side))); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return worldIn.getBlockState(pos).getBlock().getMaterial() == this.blockMaterial ? false : (side == EnumFacing.UP ? true : super.shouldSideBeRendered(worldIn, pos, side)); + } + + public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos) + { + for (int i = -1; i <= 1; ++i) + { + for (int j = -1; j <= 1; ++j) + { + IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j)); + Block block = iblockstate.getBlock(); + Material material = block.getMaterial(); + + if (material != this.blockMaterial && !block.isFullBlock()) + { + return true; + } + } + } + + return false; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public int getRenderType() + { + return 1; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public int quantityDropped(Random random) + { + return 0; + } + + protected Vec3 getFlowVector(IBlockAccess worldIn, BlockPos pos) + { + Vec3 vec3 = new Vec3(0.0D, 0.0D, 0.0D); + int i = this.getEffectiveFlowDecay(worldIn, pos); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos.offset(enumfacing); + int j = this.getEffectiveFlowDecay(worldIn, blockpos); + + if (j < 0) + { + if (!worldIn.getBlockState(blockpos).getBlock().getMaterial().blocksMovement()) + { + j = this.getEffectiveFlowDecay(worldIn, blockpos.down()); + + if (j >= 0) + { + int k = j - (i - 8); + vec3 = vec3.addVector((double)((blockpos.getX() - pos.getX()) * k), (double)((blockpos.getY() - pos.getY()) * k), (double)((blockpos.getZ() - pos.getZ()) * k)); + } + } + } + else if (j >= 0) + { + int l = j - i; + vec3 = vec3.addVector((double)((blockpos.getX() - pos.getX()) * l), (double)((blockpos.getY() - pos.getY()) * l), (double)((blockpos.getZ() - pos.getZ()) * l)); + } + } + + if (((Integer)worldIn.getBlockState(pos).getValue(LEVEL)).intValue() >= 8) + { + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos1 = pos.offset(enumfacing1); + + if (this.isBlockSolid(worldIn, blockpos1, enumfacing1) || this.isBlockSolid(worldIn, blockpos1.up(), enumfacing1)) + { + vec3 = vec3.normalize().addVector(0.0D, -6.0D, 0.0D); + break; + } + } + } + + return vec3.normalize(); + } + + public Vec3 modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion) + { + return motion.add(this.getFlowVector(worldIn, pos)); + } + + public int tickRate(World worldIn) + { + return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (worldIn.provider.getHasNoSky() ? 10 : 30) : 0); + } + + public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) + { + int i = worldIn.getCombinedLight(pos, 0); + int j = worldIn.getCombinedLight(pos.up(), 0); + int k = i & 255; + int l = j & 255; + int i1 = i >> 16 & 255; + int j1 = j >> 16 & 255; + return (k > l ? k : l) | (i1 > j1 ? i1 : j1) << 16; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return this.blockMaterial == Material.water ? EnumWorldBlockLayer.TRANSLUCENT : EnumWorldBlockLayer.SOLID; + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + double d0 = (double)pos.getX(); + double d1 = (double)pos.getY(); + double d2 = (double)pos.getZ(); + + if (this.blockMaterial == Material.water) + { + int i = ((Integer)state.getValue(LEVEL)).intValue(); + + if (i > 0 && i < 8) + { + if (rand.nextInt(64) == 0) + { + worldIn.playSound(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, "liquid.water", rand.nextFloat() * 0.25F + 0.75F, rand.nextFloat() * 1.0F + 0.5F, false); + } + } + else if (rand.nextInt(10) == 0) + { + worldIn.spawnParticle(EnumParticleTypes.SUSPENDED, d0 + (double)rand.nextFloat(), d1 + (double)rand.nextFloat(), d2 + (double)rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (this.blockMaterial == Material.lava && worldIn.getBlockState(pos.up()).getBlock().getMaterial() == Material.air && !worldIn.getBlockState(pos.up()).getBlock().isOpaqueCube()) + { + if (rand.nextInt(100) == 0) + { + double d8 = d0 + (double)rand.nextFloat(); + double d4 = d1 + this.maxY; + double d6 = d2 + (double)rand.nextFloat(); + worldIn.spawnParticle(EnumParticleTypes.LAVA, d8, d4, d6, 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.playSound(d8, d4, d6, "liquid.lavapop", 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false); + } + + if (rand.nextInt(200) == 0) + { + worldIn.playSound(d0, d1, d2, "liquid.lava", 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false); + } + } + + if (rand.nextInt(10) == 0 && World.doesBlockHaveSolidTopSurface(worldIn, pos.down())) + { + Material material = worldIn.getBlockState(pos.down(2)).getBlock().getMaterial(); + + if (!material.blocksMovement() && !material.isLiquid()) + { + double d3 = d0 + (double)rand.nextFloat(); + double d5 = d1 - 1.05D; + double d7 = d2 + (double)rand.nextFloat(); + + if (this.blockMaterial == Material.water) + { + worldIn.spawnParticle(EnumParticleTypes.DRIP_WATER, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]); + } + else + { + worldIn.spawnParticle(EnumParticleTypes.DRIP_LAVA, d3, d5, d7, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + } + + public static double getFlowDirection(IBlockAccess worldIn, BlockPos pos, Material materialIn) + { + Vec3 vec3 = getFlowingBlock(materialIn).getFlowVector(worldIn, pos); + return vec3.xCoord == 0.0D && vec3.zCoord == 0.0D ? -1000.0D : MathHelper.atan2(vec3.zCoord, vec3.xCoord) - (Math.PI / 2D); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.checkForMixing(worldIn, pos, state); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + this.checkForMixing(worldIn, pos, state); + } + + public boolean checkForMixing(World worldIn, BlockPos pos, IBlockState state) + { + if (this.blockMaterial == Material.lava) + { + boolean flag = false; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (enumfacing != EnumFacing.DOWN && worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial() == Material.water) + { + flag = true; + break; + } + } + + if (flag) + { + Integer integer = (Integer)state.getValue(LEVEL); + + if (integer.intValue() == 0) + { + worldIn.setBlockState(pos, Blocks.obsidian.getDefaultState()); + this.triggerMixEffects(worldIn, pos); + return true; + } + + if (integer.intValue() <= 4) + { + worldIn.setBlockState(pos, Blocks.cobblestone.getDefaultState()); + this.triggerMixEffects(worldIn, pos); + return true; + } + } + } + + return false; + } + + protected void triggerMixEffects(World worldIn, BlockPos pos) + { + double d0 = (double)pos.getX(); + double d1 = (double)pos.getY(); + double d2 = (double)pos.getZ(); + worldIn.playSoundEffect(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, "random.fizz", 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + + for (int i = 0; i < 8; ++i) + { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, d0 + Math.random(), d1 + 1.2D, d2 + Math.random(), 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(LEVEL, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(LEVEL)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {LEVEL}); + } + + public static BlockDynamicLiquid getFlowingBlock(Material materialIn) + { + if (materialIn == Material.water) + { + return Blocks.flowing_water; + } + else if (materialIn == Material.lava) + { + return Blocks.flowing_lava; + } + else + { + throw new IllegalArgumentException("Invalid material"); + } + } + + public static BlockStaticLiquid getStaticBlock(Material materialIn) + { + if (materialIn == Material.water) + { + return Blocks.water; + } + else if (materialIn == Material.lava) + { + return Blocks.lava; + } + else + { + throw new IllegalArgumentException("Invalid material"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockLog.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLog.java new file mode 100644 index 0000000..9ea13e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockLog.java @@ -0,0 +1,91 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.World; + +public abstract class BlockLog extends BlockRotatedPillar +{ + public static final PropertyEnum LOG_AXIS = PropertyEnum.create("axis", BlockLog.EnumAxis.class); + + public BlockLog() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + this.setHardness(2.0F); + this.setStepSound(soundTypeWood); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + int i = 4; + int j = i + 1; + + if (worldIn.isAreaLoaded(pos.add(-j, -j, -j), pos.add(j, j, j))) + { + for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i))) + { + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(BlockLeaves.CHECK_DECAY)).booleanValue()) + { + worldIn.setBlockState(blockpos, iblockstate.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4); + } + } + } + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(LOG_AXIS, BlockLog.EnumAxis.fromFacingAxis(facing.getAxis())); + } + + public static enum EnumAxis implements IStringSerializable + { + X("x"), + Y("y"), + Z("z"), + NONE("none"); + + private final String name; + + private EnumAxis(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public static BlockLog.EnumAxis fromFacingAxis(EnumFacing.Axis axis) + { + switch (axis) + { + case X: + return X; + + case Y: + return Y; + + case Z: + return Z; + + default: + return NONE; + } + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockMelon.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMelon.java new file mode 100644 index 0000000..7934f80 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMelon.java @@ -0,0 +1,33 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockMelon extends Block +{ + protected BlockMelon() + { + super(Material.gourd, MapColor.limeColor); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.melon; + } + + public int quantityDropped(Random random) + { + return 3 + random.nextInt(5); + } + + public int quantityDroppedWithBonus(int fortune, Random random) + { + return Math.min(9, this.quantityDropped(random) + random.nextInt(1 + fortune)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockMobSpawner.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMobSpawner.java new file mode 100644 index 0000000..3babd3a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMobSpawner.java @@ -0,0 +1,61 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class BlockMobSpawner extends BlockContainer +{ + protected BlockMobSpawner() + { + super(Material.rock); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityMobSpawner(); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + int i = 15 + worldIn.rand.nextInt(15) + worldIn.rand.nextInt(15); + this.dropXpOnBlockBreak(worldIn, pos, i); + } + + public boolean isOpaqueCube() + { + return false; + } + + public int getRenderType() + { + return 3; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockMushroom.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMushroom.java new file mode 100644 index 0000000..8f80e27 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMushroom.java @@ -0,0 +1,121 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BlockMushroom extends BlockBush implements IGrowable +{ + protected BlockMushroom() + { + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setTickRandomly(true); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (rand.nextInt(25) == 0) + { + int i = 5; + int j = 4; + + for (BlockPos blockpos : BlockPos.getAllInBoxMutable(pos.add(-4, -1, -4), pos.add(4, 1, 4))) + { + if (worldIn.getBlockState(blockpos).getBlock() == this) + { + --i; + + if (i <= 0) + { + return; + } + } + } + + BlockPos blockpos1 = pos.add(rand.nextInt(3) - 1, rand.nextInt(2) - rand.nextInt(2), rand.nextInt(3) - 1); + + for (int k = 0; k < 4; ++k) + { + if (worldIn.isAirBlock(blockpos1) && this.canBlockStay(worldIn, blockpos1, this.getDefaultState())) + { + pos = blockpos1; + } + + blockpos1 = pos.add(rand.nextInt(3) - 1, rand.nextInt(2) - rand.nextInt(2), rand.nextInt(3) - 1); + } + + if (worldIn.isAirBlock(blockpos1) && this.canBlockStay(worldIn, blockpos1, this.getDefaultState())) + { + worldIn.setBlockState(blockpos1, this.getDefaultState(), 2); + } + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return super.canPlaceBlockAt(worldIn, pos) && this.canBlockStay(worldIn, pos, this.getDefaultState()); + } + + protected boolean canPlaceBlockOn(Block ground) + { + return ground.isFullBlock(); + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + if (pos.getY() >= 0 && pos.getY() < 256) + { + IBlockState iblockstate = worldIn.getBlockState(pos.down()); + return iblockstate.getBlock() == Blocks.mycelium ? true : (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && this.canPlaceBlockOn(iblockstate.getBlock())); + } + else + { + return false; + } + } + + public boolean generateBigMushroom(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + worldIn.setBlockToAir(pos); + WorldGenerator worldgenerator = null; + + if (this == Blocks.brown_mushroom) + { + worldgenerator = new WorldGenBigMushroom(Blocks.brown_mushroom_block); + } + else if (this == Blocks.red_mushroom) + { + worldgenerator = new WorldGenBigMushroom(Blocks.red_mushroom_block); + } + + if (worldgenerator != null && worldgenerator.generate(worldIn, rand, pos)) + { + return true; + } + else + { + worldIn.setBlockState(pos, state, 3); + return false; + } + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + return true; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return (double)rand.nextFloat() < 0.4D; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + this.generateBigMushroom(worldIn, pos, state, rand); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockMycelium.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMycelium.java new file mode 100644 index 0000000..d47f0d0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockMycelium.java @@ -0,0 +1,88 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockMycelium extends Block +{ + public static final PropertyBool SNOWY = PropertyBool.create("snowy"); + + protected BlockMycelium() + { + super(Material.grass, MapColor.purpleColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos.up()).getBlock(); + return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity() > 2) + { + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); + } + else + { + if (worldIn.getLightFromNeighbors(pos.up()) >= 9) + { + for (int i = 0; i < 4; ++i) + { + BlockPos blockpos = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = worldIn.getBlockState(blockpos.up()).getBlock(); + + if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) + { + worldIn.setBlockState(blockpos, this.getDefaultState()); + } + } + } + } + } + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + super.randomDisplayTick(worldIn, pos, state, rand); + + if (rand.nextInt(10) == 0) + { + worldIn.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Blocks.dirt.getItemDropped(Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT), rand, fortune); + } + + public int getMetaFromState(IBlockState state) + { + return 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {SNOWY}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherBrick.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherBrick.java new file mode 100644 index 0000000..3af50c7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherBrick.java @@ -0,0 +1,20 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockNetherBrick extends Block +{ + public BlockNetherBrick() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.netherrackColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherWart.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherWart.java new file mode 100644 index 0000000..fe9725f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherWart.java @@ -0,0 +1,107 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockNetherWart extends BlockBush +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 3); + + protected BlockNetherWart() + { + super(Material.plants, MapColor.redColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + this.setTickRandomly(true); + float f = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs)null); + } + + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.soul_sand; + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + int i = ((Integer)state.getValue(AGE)).intValue(); + + if (i < 3 && rand.nextInt(10) == 0) + { + state = state.withProperty(AGE, Integer.valueOf(i + 1)); + worldIn.setBlockState(pos, state, 2); + } + + super.updateTick(worldIn, pos, state, rand); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + if (!worldIn.isRemote) + { + int i = 1; + + if (((Integer)state.getValue(AGE)).intValue() >= 3) + { + i = 2 + worldIn.rand.nextInt(3); + + if (fortune > 0) + { + i += worldIn.rand.nextInt(fortune + 1); + } + } + + for (int j = 0; j < i; ++j) + { + spawnAsEntity(worldIn, pos, new ItemStack(Items.nether_wart)); + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.nether_wart; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AGE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherrack.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherrack.java new file mode 100644 index 0000000..4806854 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNetherrack.java @@ -0,0 +1,20 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockNetherrack extends Block +{ + public BlockNetherrack() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.netherrackColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockNewLeaf.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNewLeaf.java new file mode 100644 index 0000000..39cf46e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNewLeaf.java @@ -0,0 +1,109 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockNewLeaf extends BlockLeaves +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() + { + public boolean apply(BlockPlanks.EnumType p_apply_1_) + { + return p_apply_1_.getMetadata() >= 4; + } + }); + + public BlockNewLeaf() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true))); + } + + protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) + { + if (state.getValue(VARIANT) == BlockPlanks.EnumType.DARK_OAK && worldIn.rand.nextInt(chance) == 0) + { + spawnAsEntity(worldIn, pos, new ItemStack(Items.apple, 1, 0)); + } + } + + public int damageDropped(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock().getMetaFromState(iblockstate) & 3; + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + } + + protected ItemStack createStackedBlock(IBlockState state) + { + return new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, this.getWoodType(meta)).withProperty(DECAYABLE, Boolean.valueOf((meta & 4) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4; + + if (!((Boolean)state.getValue(DECAYABLE)).booleanValue()) + { + i |= 4; + } + + if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue()) + { + i |= 8; + } + + return i; + } + + public BlockPlanks.EnumType getWoodType(int meta) + { + return BlockPlanks.EnumType.byMetadata((meta & 3) + 4); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT, CHECK_DECAY, DECAYABLE}); + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4)); + } + else + { + super.harvestBlock(worldIn, player, pos, state, te); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockNewLog.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNewLog.java new file mode 100644 index 0000000..ff8d332 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNewLog.java @@ -0,0 +1,122 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class BlockNewLog extends BlockLog +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() + { + public boolean apply(BlockPlanks.EnumType p_apply_1_) + { + return p_apply_1_.getMetadata() >= 4; + } + }); + + public BlockNewLog() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(LOG_AXIS, BlockLog.EnumAxis.Y)); + } + + public MapColor getMapColor(IBlockState state) + { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType)state.getValue(VARIANT); + + switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS)) + { + case X: + case Z: + case NONE: + default: + switch (blockplanks$enumtype) + { + case ACACIA: + default: + return MapColor.stoneColor; + + case DARK_OAK: + return BlockPlanks.EnumType.DARK_OAK.getMapColor(); + } + + case Y: + return blockplanks$enumtype.getMapColor(); + } + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.ACACIA.getMetadata() - 4)); + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)); + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata((meta & 3) + 4)); + + switch (meta & 12) + { + case 0: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y); + break; + + case 4: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X); + break; + + case 8: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z); + break; + + default: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE); + } + + return iblockstate; + } + + @SuppressWarnings("incomplete-switch") + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4; + + switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS)) + { + case X: + i |= 4; + break; + + case Z: + i |= 8; + break; + + case NONE: + i |= 12; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT, LOG_AXIS}); + } + + protected ItemStack createStackedBlock(IBlockState state) + { + return new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4); + } + + public int damageDropped(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockNote.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNote.java new file mode 100644 index 0000000..d4c9be0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockNote.java @@ -0,0 +1,111 @@ +package net.minecraft.block; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityNote; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class BlockNote extends BlockContainer +{ + private static final List INSTRUMENTS = Lists.newArrayList(new String[] {"harp", "bd", "snare", "hat", "bassattack"}); + + public BlockNote() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + boolean flag = worldIn.isBlockPowered(pos); + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityNote) + { + TileEntityNote tileentitynote = (TileEntityNote)tileentity; + + if (tileentitynote.previousRedstoneState != flag) + { + if (flag) + { + tileentitynote.triggerNote(worldIn, pos); + } + + tileentitynote.previousRedstoneState = flag; + } + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityNote) + { + TileEntityNote tileentitynote = (TileEntityNote)tileentity; + tileentitynote.changePitch(); + tileentitynote.triggerNote(worldIn, pos); + playerIn.triggerAchievement(StatList.field_181735_S); + } + + return true; + } + } + + public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) + { + if (!worldIn.isRemote) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityNote) + { + ((TileEntityNote)tileentity).triggerNote(worldIn, pos); + playerIn.triggerAchievement(StatList.field_181734_R); + } + } + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityNote(); + } + + private String getInstrument(int id) + { + if (id < 0 || id >= INSTRUMENTS.size()) + { + id = 0; + } + + return (String)INSTRUMENTS.get(id); + } + + public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + { + float f = (float)Math.pow(2.0D, (double)(eventParam - 12) / 12.0D); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "note." + this.getInstrument(eventID), 3.0F, f); + worldIn.spawnParticle(EnumParticleTypes.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)eventParam / 24.0D, 0.0D, 0.0D, new int[0]); + return true; + } + + public int getRenderType() + { + return 3; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockObsidian.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockObsidian.java new file mode 100644 index 0000000..ba930d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockObsidian.java @@ -0,0 +1,28 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; + +public class BlockObsidian extends Block +{ + public BlockObsidian() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.obsidian); + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.blackColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockOldLeaf.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockOldLeaf.java new file mode 100644 index 0000000..0e579f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockOldLeaf.java @@ -0,0 +1,147 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockOldLeaf extends BlockLeaves +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() + { + public boolean apply(BlockPlanks.EnumType p_apply_1_) + { + return p_apply_1_.getMetadata() < 4; + } + }); + + public BlockOldLeaf() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.OAK).withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true))); + } + + public int getRenderColor(IBlockState state) + { + if (state.getBlock() != this) + { + return super.getRenderColor(state); + } + else + { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType)state.getValue(VARIANT); + return blockplanks$enumtype == BlockPlanks.EnumType.SPRUCE ? ColorizerFoliage.getFoliageColorPine() : (blockplanks$enumtype == BlockPlanks.EnumType.BIRCH ? ColorizerFoliage.getFoliageColorBirch() : super.getRenderColor(state)); + } + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this) + { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType)iblockstate.getValue(VARIANT); + + if (blockplanks$enumtype == BlockPlanks.EnumType.SPRUCE) + { + return ColorizerFoliage.getFoliageColorPine(); + } + + if (blockplanks$enumtype == BlockPlanks.EnumType.BIRCH) + { + return ColorizerFoliage.getFoliageColorBirch(); + } + } + + return super.colorMultiplier(worldIn, pos, renderPass); + } + + protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) + { + if (state.getValue(VARIANT) == BlockPlanks.EnumType.OAK && worldIn.rand.nextInt(chance) == 0) + { + spawnAsEntity(worldIn, pos, new ItemStack(Items.apple, 1, 0)); + } + } + + protected int getSaplingDropChance(IBlockState state) + { + return state.getValue(VARIANT) == BlockPlanks.EnumType.JUNGLE ? 40 : super.getSaplingDropChance(state); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.OAK.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.BIRCH.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())); + } + + protected ItemStack createStackedBlock(IBlockState state) + { + return new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata()); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, this.getWoodType(meta)).withProperty(DECAYABLE, Boolean.valueOf((meta & 4) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + + if (!((Boolean)state.getValue(DECAYABLE)).booleanValue()) + { + i |= 4; + } + + if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue()) + { + i |= 8; + } + + return i; + } + + public BlockPlanks.EnumType getWoodType(int meta) + { + return BlockPlanks.EnumType.byMetadata((meta & 3) % 4); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT, CHECK_DECAY, DECAYABLE}); + } + + public int damageDropped(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata())); + } + else + { + super.harvestBlock(worldIn, player, pos, state, te); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockOldLog.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockOldLog.java new file mode 100644 index 0000000..ac88e78 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockOldLog.java @@ -0,0 +1,130 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class BlockOldLog extends BlockLog +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class, new Predicate() + { + public boolean apply(BlockPlanks.EnumType p_apply_1_) + { + return p_apply_1_.getMetadata() < 4; + } + }); + + public BlockOldLog() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.OAK).withProperty(LOG_AXIS, BlockLog.EnumAxis.Y)); + } + + public MapColor getMapColor(IBlockState state) + { + BlockPlanks.EnumType blockplanks$enumtype = (BlockPlanks.EnumType)state.getValue(VARIANT); + + switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS)) + { + case X: + case Z: + case NONE: + default: + switch (blockplanks$enumtype) + { + case OAK: + default: + return BlockPlanks.EnumType.SPRUCE.getMapColor(); + + case SPRUCE: + return BlockPlanks.EnumType.DARK_OAK.getMapColor(); + + case BIRCH: + return MapColor.quartzColor; + + case JUNGLE: + return BlockPlanks.EnumType.SPRUCE.getMapColor(); + } + + case Y: + return blockplanks$enumtype.getMapColor(); + } + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.OAK.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.BIRCH.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())); + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata((meta & 3) % 4)); + + switch (meta & 12) + { + case 0: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y); + break; + + case 4: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X); + break; + + case 8: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z); + break; + + default: + iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE); + } + + return iblockstate; + } + + @SuppressWarnings("incomplete-switch") + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + + switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS)) + { + case X: + i |= 4; + break; + + case Z: + i |= 8; + break; + + case NONE: + i |= 12; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT, LOG_AXIS}); + } + + protected ItemStack createStackedBlock(IBlockState state) + { + return new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata()); + } + + public int damageDropped(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockOre.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockOre.java new file mode 100644 index 0000000..a740abd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockOre.java @@ -0,0 +1,100 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockOre extends Block +{ + public BlockOre() + { + this(Material.rock.getMaterialMapColor()); + } + + public BlockOre(MapColor p_i46390_1_) + { + super(Material.rock, p_i46390_1_); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return this == Blocks.coal_ore ? Items.coal : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this))))); + } + + public int quantityDropped(Random random) + { + return this == Blocks.lapis_ore ? 4 + random.nextInt(5) : 1; + } + + public int quantityDroppedWithBonus(int fortune, Random random) + { + if (fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped((IBlockState)this.getBlockState().getValidStates().iterator().next(), random, fortune)) + { + int i = random.nextInt(fortune + 2) - 1; + + if (i < 0) + { + i = 0; + } + + return this.quantityDropped(random) * (i + 1); + } + else + { + return this.quantityDropped(random); + } + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + + if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this)) + { + int i = 0; + + if (this == Blocks.coal_ore) + { + i = MathHelper.getRandomIntegerInRange(worldIn.rand, 0, 2); + } + else if (this == Blocks.diamond_ore) + { + i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7); + } + else if (this == Blocks.emerald_ore) + { + i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7); + } + else if (this == Blocks.lapis_ore) + { + i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); + } + else if (this == Blocks.quartz_ore) + { + i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); + } + + this.dropXpOnBlockBreak(worldIn, pos, i); + } + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + return 0; + } + + public int damageDropped(IBlockState state) + { + return this == Blocks.lapis_ore ? EnumDyeColor.BLUE.getDyeDamage() : 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPackedIce.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPackedIce.java new file mode 100644 index 0000000..0cc288e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPackedIce.java @@ -0,0 +1,20 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockPackedIce extends Block +{ + public BlockPackedIce() + { + super(Material.packedIce); + this.slipperiness = 0.98F; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int quantityDropped(Random random) + { + return 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPane.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPane.java new file mode 100644 index 0000000..84c8523 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPane.java @@ -0,0 +1,185 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPane extends Block +{ + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + private final boolean canDrop; + + protected BlockPane(Material materialIn, boolean canDrop) + { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false))); + this.canDrop = canDrop; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state.withProperty(NORTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock()))).withProperty(SOUTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock()))).withProperty(WEST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock()))).withProperty(EAST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock()))); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return !this.canDrop ? null : super.getItemDropped(state, rand, fortune); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return worldIn.getBlockState(pos).getBlock() == this ? false : super.shouldSideBeRendered(worldIn, pos, side); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + boolean flag = this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock()); + boolean flag1 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock()); + boolean flag2 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock()); + boolean flag3 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock()); + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { + if (flag2) + { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + else if (flag3) + { + this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) + { + if (flag) + { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + else if (flag1) + { + this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + } + else + { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + float f = 0.4375F; + float f1 = 0.5625F; + float f2 = 0.4375F; + float f3 = 0.5625F; + boolean flag = this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock()); + boolean flag1 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock()); + boolean flag2 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock()); + boolean flag3 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock()); + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { + if (flag2) + { + f = 0.0F; + } + else if (flag3) + { + f1 = 1.0F; + } + } + else + { + f = 0.0F; + f1 = 1.0F; + } + + if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) + { + if (flag) + { + f2 = 0.0F; + } + else if (flag1) + { + f3 = 1.0F; + } + } + else + { + f2 = 0.0F; + f3 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + public final boolean canPaneConnectToBlock(Block blockIn) + { + return blockIn.isFullBlock() || blockIn == this || blockIn == Blocks.glass || blockIn == Blocks.stained_glass || blockIn == Blocks.stained_glass_pane || blockIn instanceof BlockPane; + } + + protected boolean canSilkHarvest() + { + return true; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + public int getMetaFromState(IBlockState state) + { + return 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonBase.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonBase.java new file mode 100644 index 0000000..7a4b84e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonBase.java @@ -0,0 +1,455 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockPistonStructureHelper; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonBase extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool EXTENDED = PropertyBool.create("extended"); + private final boolean isSticky; + + public BlockPistonBase(boolean isSticky) + { + super(Material.piston); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(EXTENDED, Boolean.valueOf(false))); + this.isSticky = isSticky; + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public boolean isOpaqueCube() + { + return false; + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + worldIn.setBlockState(pos, state.withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)), 2); + + if (!worldIn.isRemote) + { + this.checkForMove(worldIn, pos, state); + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + this.checkForMove(worldIn, pos, state); + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote && worldIn.getTileEntity(pos) == null) + { + this.checkForMove(worldIn, pos, state); + } + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)).withProperty(EXTENDED, Boolean.valueOf(false)); + } + + private void checkForMove(World worldIn, BlockPos pos, IBlockState state) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + boolean flag = this.shouldBeExtended(worldIn, pos, enumfacing); + + if (flag && !((Boolean)state.getValue(EXTENDED)).booleanValue()) + { + if ((new BlockPistonStructureHelper(worldIn, pos, enumfacing, true)).canMove()) + { + worldIn.addBlockEvent(pos, this, 0, enumfacing.getIndex()); + } + } + else if (!flag && ((Boolean)state.getValue(EXTENDED)).booleanValue()) + { + worldIn.setBlockState(pos, state.withProperty(EXTENDED, Boolean.valueOf(false)), 2); + worldIn.addBlockEvent(pos, this, 1, enumfacing.getIndex()); + } + } + + private boolean shouldBeExtended(World worldIn, BlockPos pos, EnumFacing facing) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing)) + { + return true; + } + } + + if (worldIn.isSidePowered(pos, EnumFacing.DOWN)) + { + return true; + } + else + { + BlockPos blockpos = pos.up(); + + for (EnumFacing enumfacing1 : EnumFacing.values()) + { + if (enumfacing1 != EnumFacing.DOWN && worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1)) + { + return true; + } + } + + return false; + } + } + + public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (!worldIn.isRemote) + { + boolean flag = this.shouldBeExtended(worldIn, pos, enumfacing); + + if (flag && eventID == 1) + { + worldIn.setBlockState(pos, state.withProperty(EXTENDED, Boolean.valueOf(true)), 2); + return false; + } + + if (!flag && eventID == 0) + { + return false; + } + } + + if (eventID == 0) + { + if (!this.doMove(worldIn, pos, enumfacing, true)) + { + return false; + } + + worldIn.setBlockState(pos, state.withProperty(EXTENDED, Boolean.valueOf(true)), 2); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "tile.piston.out", 0.5F, worldIn.rand.nextFloat() * 0.25F + 0.6F); + } + else if (eventID == 1) + { + TileEntity tileentity1 = worldIn.getTileEntity(pos.offset(enumfacing)); + + if (tileentity1 instanceof TileEntityPiston) + { + ((TileEntityPiston)tileentity1).clearPistonTileEntity(); + } + + worldIn.setBlockState(pos, Blocks.piston_extension.getDefaultState().withProperty(BlockPistonMoving.FACING, enumfacing).withProperty(BlockPistonMoving.TYPE, this.isSticky ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT), 3); + worldIn.setTileEntity(pos, BlockPistonMoving.newTileEntity(this.getStateFromMeta(eventParam), enumfacing, false, true)); + + if (this.isSticky) + { + BlockPos blockpos = pos.add(enumfacing.getFrontOffsetX() * 2, enumfacing.getFrontOffsetY() * 2, enumfacing.getFrontOffsetZ() * 2); + Block block = worldIn.getBlockState(blockpos).getBlock(); + boolean flag1 = false; + + if (block == Blocks.piston_extension) + { + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityPiston) + { + TileEntityPiston tileentitypiston = (TileEntityPiston)tileentity; + + if (tileentitypiston.getFacing() == enumfacing && tileentitypiston.isExtending()) + { + tileentitypiston.clearPistonTileEntity(); + flag1 = true; + } + } + } + + if (!flag1 && block.getMaterial() != Material.air && canPush(block, worldIn, blockpos, enumfacing.getOpposite(), false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston)) + { + this.doMove(worldIn, pos, enumfacing, false); + } + } + else + { + worldIn.setBlockToAir(pos.offset(enumfacing)); + } + + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "tile.piston.in", 0.5F, worldIn.rand.nextFloat() * 0.15F + 0.6F); + } + + return true; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this && ((Boolean)iblockstate.getValue(EXTENDED)).booleanValue()) + { + float f = 0.25F; + EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); + + if (enumfacing != null) + { + switch (enumfacing) + { + case DOWN: + this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + + case UP: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + break; + + case NORTH: + this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); + break; + + case SOUTH: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F); + break; + + case WEST: + this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + + case EAST: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F); + } + } + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getCollisionBoundingBox(worldIn, pos, state); + } + + public boolean isFullCube() + { + return false; + } + + public static EnumFacing getFacing(int meta) + { + int i = meta & 7; + return i > 5 ? null : EnumFacing.getFront(i); + } + + public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn) + { + if (MathHelper.abs((float)entityIn.posX - (float)clickedBlock.getX()) < 2.0F && MathHelper.abs((float)entityIn.posZ - (float)clickedBlock.getZ()) < 2.0F) + { + double d0 = entityIn.posY + (double)entityIn.getEyeHeight(); + + if (d0 - (double)clickedBlock.getY() > 2.0D) + { + return EnumFacing.UP; + } + + if ((double)clickedBlock.getY() - d0 > 0.0D) + { + return EnumFacing.DOWN; + } + } + + return entityIn.getHorizontalFacing().getOpposite(); + } + + public static boolean canPush(Block blockIn, World worldIn, BlockPos pos, EnumFacing direction, boolean allowDestroy) + { + if (blockIn == Blocks.obsidian) + { + return false; + } + else if (!worldIn.getWorldBorder().contains(pos)) + { + return false; + } + else if (pos.getY() >= 0 && (direction != EnumFacing.DOWN || pos.getY() != 0)) + { + if (pos.getY() <= worldIn.getHeight() - 1 && (direction != EnumFacing.UP || pos.getY() != worldIn.getHeight() - 1)) + { + if (blockIn != Blocks.piston && blockIn != Blocks.sticky_piston) + { + if (blockIn.getBlockHardness(worldIn, pos) == -1.0F) + { + return false; + } + + if (blockIn.getMobilityFlag() == 2) + { + return false; + } + + if (blockIn.getMobilityFlag() == 1) + { + if (!allowDestroy) + { + return false; + } + + return true; + } + } + else if (((Boolean)worldIn.getBlockState(pos).getValue(EXTENDED)).booleanValue()) + { + return false; + } + + return !(blockIn instanceof ITileEntityProvider); + } + else + { + return false; + } + } + else + { + return false; + } + } + + private boolean doMove(World worldIn, BlockPos pos, EnumFacing direction, boolean extending) + { + if (!extending) + { + worldIn.setBlockToAir(pos.offset(direction)); + } + + BlockPistonStructureHelper blockpistonstructurehelper = new BlockPistonStructureHelper(worldIn, pos, direction, extending); + List list = blockpistonstructurehelper.getBlocksToMove(); + List list1 = blockpistonstructurehelper.getBlocksToDestroy(); + + if (!blockpistonstructurehelper.canMove()) + { + return false; + } + else + { + int i = list.size() + list1.size(); + Block[] ablock = new Block[i]; + EnumFacing enumfacing = extending ? direction : direction.getOpposite(); + + for (int j = list1.size() - 1; j >= 0; --j) + { + BlockPos blockpos = (BlockPos)list1.get(j); + Block block = worldIn.getBlockState(blockpos).getBlock(); + block.dropBlockAsItem(worldIn, blockpos, worldIn.getBlockState(blockpos), 0); + worldIn.setBlockToAir(blockpos); + --i; + ablock[i] = block; + } + + for (int k = list.size() - 1; k >= 0; --k) + { + BlockPos blockpos2 = (BlockPos)list.get(k); + IBlockState iblockstate = worldIn.getBlockState(blockpos2); + Block block1 = iblockstate.getBlock(); + block1.getMetaFromState(iblockstate); + worldIn.setBlockToAir(blockpos2); + blockpos2 = blockpos2.offset(enumfacing); + worldIn.setBlockState(blockpos2, Blocks.piston_extension.getDefaultState().withProperty(FACING, direction), 4); + worldIn.setTileEntity(blockpos2, BlockPistonMoving.newTileEntity(iblockstate, direction, extending, false)); + --i; + ablock[i] = block1; + } + + BlockPos blockpos1 = pos.offset(direction); + + if (extending) + { + BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = this.isSticky ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT; + IBlockState iblockstate1 = Blocks.piston_head.getDefaultState().withProperty(BlockPistonExtension.FACING, direction).withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype); + IBlockState iblockstate2 = Blocks.piston_extension.getDefaultState().withProperty(BlockPistonMoving.FACING, direction).withProperty(BlockPistonMoving.TYPE, this.isSticky ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT); + worldIn.setBlockState(blockpos1, iblockstate2, 4); + worldIn.setTileEntity(blockpos1, BlockPistonMoving.newTileEntity(iblockstate1, direction, true, false)); + } + + for (int l = list1.size() - 1; l >= 0; --l) + { + worldIn.notifyNeighborsOfStateChange((BlockPos)list1.get(l), ablock[i++]); + } + + for (int i1 = list.size() - 1; i1 >= 0; --i1) + { + worldIn.notifyNeighborsOfStateChange((BlockPos)list.get(i1), ablock[i++]); + } + + if (extending) + { + worldIn.notifyNeighborsOfStateChange(blockpos1, Blocks.piston_head); + worldIn.notifyNeighborsOfStateChange(pos, this); + } + + return true; + } + } + + public IBlockState getStateForEntityRender(IBlockState state) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.UP); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, getFacing(meta)).withProperty(EXTENDED, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getIndex(); + + if (((Boolean)state.getValue(EXTENDED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, EXTENDED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonExtension.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonExtension.java new file mode 100644 index 0000000..fee643d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonExtension.java @@ -0,0 +1,258 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonExtension extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockPistonExtension.EnumPistonType.class); + public static final PropertyBool SHORT = PropertyBool.create("short"); + + public BlockPistonExtension() + { + super(Material.piston); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(TYPE, BlockPistonExtension.EnumPistonType.DEFAULT).withProperty(SHORT, Boolean.valueOf(false))); + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + if (player.capabilities.isCreativeMode) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (enumfacing != null) + { + BlockPos blockpos = pos.offset(enumfacing.getOpposite()); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block == Blocks.piston || block == Blocks.sticky_piston) + { + worldIn.setBlockToAir(blockpos); + } + } + } + + super.onBlockHarvested(worldIn, pos, state, player); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + super.breakBlock(worldIn, pos, state); + EnumFacing enumfacing = ((EnumFacing)state.getValue(FACING)).getOpposite(); + pos = pos.offset(enumfacing); + IBlockState iblockstate = worldIn.getBlockState(pos); + + if ((iblockstate.getBlock() == Blocks.piston || iblockstate.getBlock() == Blocks.sticky_piston) && ((Boolean)iblockstate.getValue(BlockPistonBase.EXTENDED)).booleanValue()) + { + iblockstate.getBlock().dropBlockAsItem(worldIn, pos, iblockstate, 0); + worldIn.setBlockToAir(pos); + } + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return false; + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + return false; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.applyHeadBounds(state); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.applyCoreBounds(state); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + private void applyCoreBounds(IBlockState state) + { + float f = 0.25F; + float f1 = 0.375F; + float f2 = 0.625F; + float f3 = 0.25F; + float f4 = 0.75F; + + switch ((EnumFacing)state.getValue(FACING)) + { + case DOWN: + this.setBlockBounds(0.375F, 0.25F, 0.375F, 0.625F, 1.0F, 0.625F); + break; + + case UP: + this.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.75F, 0.625F); + break; + + case NORTH: + this.setBlockBounds(0.25F, 0.375F, 0.25F, 0.75F, 0.625F, 1.0F); + break; + + case SOUTH: + this.setBlockBounds(0.25F, 0.375F, 0.0F, 0.75F, 0.625F, 0.75F); + break; + + case WEST: + this.setBlockBounds(0.375F, 0.25F, 0.25F, 0.625F, 0.75F, 1.0F); + break; + + case EAST: + this.setBlockBounds(0.0F, 0.375F, 0.25F, 0.75F, 0.625F, 0.75F); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.applyHeadBounds(worldIn.getBlockState(pos)); + } + + public void applyHeadBounds(IBlockState state) + { + float f = 0.25F; + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (enumfacing != null) + { + switch (enumfacing) + { + case DOWN: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); + break; + + case UP: + this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + + case NORTH: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); + break; + + case SOUTH: + this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); + break; + + case WEST: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); + break; + + case EAST: + this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + BlockPos blockpos = pos.offset(enumfacing.getOpposite()); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() != Blocks.piston && iblockstate.getBlock() != Blocks.sticky_piston) + { + worldIn.setBlockToAir(pos); + } + else + { + iblockstate.getBlock().onNeighborBlockChange(worldIn, blockpos, iblockstate, neighborBlock); + } + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return true; + } + + public static EnumFacing getFacing(int meta) + { + int i = meta & 7; + return i > 5 ? null : EnumFacing.getFront(i); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos).getValue(TYPE) == BlockPistonExtension.EnumPistonType.STICKY ? Item.getItemFromBlock(Blocks.sticky_piston) : Item.getItemFromBlock(Blocks.piston); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, getFacing(meta)).withProperty(TYPE, (meta & 8) > 0 ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getIndex(); + + if (state.getValue(TYPE) == BlockPistonExtension.EnumPistonType.STICKY) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, TYPE, SHORT}); + } + + public static enum EnumPistonType implements IStringSerializable + { + DEFAULT("normal"), + STICKY("sticky"); + + private final String VARIANT; + + private EnumPistonType(String name) + { + this.VARIANT = name; + } + + public String toString() + { + return this.VARIANT; + } + + public String getName() + { + return this.VARIANT; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonMoving.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonMoving.java new file mode 100644 index 0000000..fc8d341 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPistonMoving.java @@ -0,0 +1,282 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonMoving extends BlockContainer +{ + public static final PropertyDirection FACING = BlockPistonExtension.FACING; + public static final PropertyEnum TYPE = BlockPistonExtension.TYPE; + + public BlockPistonMoving() + { + super(Material.piston); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(TYPE, BlockPistonExtension.EnumPistonType.DEFAULT)); + this.setHardness(-1.0F); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return null; + } + + public static TileEntity newTileEntity(IBlockState state, EnumFacing facing, boolean extending, boolean renderHead) + { + return new TileEntityPiston(state, facing, extending, renderHead); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityPiston) + { + ((TileEntityPiston)tileentity).clearPistonTileEntity(); + } + else + { + super.breakBlock(worldIn, pos, state); + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return false; + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + return false; + } + + public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) + { + BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() instanceof BlockPistonBase && ((Boolean)iblockstate.getValue(BlockPistonBase.EXTENDED)).booleanValue()) + { + worldIn.setBlockToAir(blockpos); + } + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!worldIn.isRemote && worldIn.getTileEntity(pos) == null) + { + worldIn.setBlockToAir(pos); + return true; + } + else + { + return false; + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + if (!worldIn.isRemote) + { + TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos); + + if (tileentitypiston != null) + { + IBlockState iblockstate = tileentitypiston.getPistonState(); + iblockstate.getBlock().dropBlockAsItem(worldIn, pos, iblockstate, 0); + } + } + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + return null; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + worldIn.getTileEntity(pos); + } + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos); + + if (tileentitypiston == null) + { + return null; + } + else + { + float f = tileentitypiston.getProgress(0.0F); + + if (tileentitypiston.isExtending()) + { + f = 1.0F - f; + } + + return this.getBoundingBox(worldIn, pos, tileentitypiston.getPistonState(), f, tileentitypiston.getFacing()); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos); + + if (tileentitypiston != null) + { + IBlockState iblockstate = tileentitypiston.getPistonState(); + Block block = iblockstate.getBlock(); + + if (block == this || block.getMaterial() == Material.air) + { + return; + } + + float f = tileentitypiston.getProgress(0.0F); + + if (tileentitypiston.isExtending()) + { + f = 1.0F - f; + } + + block.setBlockBoundsBasedOnState(worldIn, pos); + + if (block == Blocks.piston || block == Blocks.sticky_piston) + { + f = 0.0F; + } + + EnumFacing enumfacing = tileentitypiston.getFacing(); + this.minX = block.getBlockBoundsMinX() - (double)((float)enumfacing.getFrontOffsetX() * f); + this.minY = block.getBlockBoundsMinY() - (double)((float)enumfacing.getFrontOffsetY() * f); + this.minZ = block.getBlockBoundsMinZ() - (double)((float)enumfacing.getFrontOffsetZ() * f); + this.maxX = block.getBlockBoundsMaxX() - (double)((float)enumfacing.getFrontOffsetX() * f); + this.maxY = block.getBlockBoundsMaxY() - (double)((float)enumfacing.getFrontOffsetY() * f); + this.maxZ = block.getBlockBoundsMaxZ() - (double)((float)enumfacing.getFrontOffsetZ() * f); + } + } + + public AxisAlignedBB getBoundingBox(World worldIn, BlockPos pos, IBlockState extendingBlock, float progress, EnumFacing direction) + { + if (extendingBlock.getBlock() != this && extendingBlock.getBlock().getMaterial() != Material.air) + { + AxisAlignedBB axisalignedbb = extendingBlock.getBlock().getCollisionBoundingBox(worldIn, pos, extendingBlock); + + if (axisalignedbb == null) + { + return null; + } + else + { + double d0 = axisalignedbb.minX; + double d1 = axisalignedbb.minY; + double d2 = axisalignedbb.minZ; + double d3 = axisalignedbb.maxX; + double d4 = axisalignedbb.maxY; + double d5 = axisalignedbb.maxZ; + + if (direction.getFrontOffsetX() < 0) + { + d0 -= (double)((float)direction.getFrontOffsetX() * progress); + } + else + { + d3 -= (double)((float)direction.getFrontOffsetX() * progress); + } + + if (direction.getFrontOffsetY() < 0) + { + d1 -= (double)((float)direction.getFrontOffsetY() * progress); + } + else + { + d4 -= (double)((float)direction.getFrontOffsetY() * progress); + } + + if (direction.getFrontOffsetZ() < 0) + { + d2 -= (double)((float)direction.getFrontOffsetZ() * progress); + } + else + { + d5 -= (double)((float)direction.getFrontOffsetZ() * progress); + } + + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + } + else + { + return null; + } + } + + private TileEntityPiston getTileEntity(IBlockAccess worldIn, BlockPos pos) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityPiston ? (TileEntityPiston)tileentity : null; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return null; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, BlockPistonExtension.getFacing(meta)).withProperty(TYPE, (meta & 8) > 0 ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getIndex(); + + if (state.getValue(TYPE) == BlockPistonExtension.EnumPistonType.STICKY) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, TYPE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPlanks.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPlanks.java new file mode 100644 index 0000000..83fd673 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPlanks.java @@ -0,0 +1,129 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public class BlockPlanks extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class); + + public BlockPlanks() + { + super(Material.wood); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPlanks.EnumType.OAK)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int damageDropped(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockplanks$enumtype.getMetadata())); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata(meta)); + } + + public MapColor getMapColor(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMapColor(); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + OAK(0, "oak", MapColor.woodColor), + SPRUCE(1, "spruce", MapColor.obsidianColor), + BIRCH(2, "birch", MapColor.sandColor), + JUNGLE(3, "jungle", MapColor.dirtColor), + ACACIA(4, "acacia", MapColor.adobeColor), + DARK_OAK(5, "dark_oak", "big_oak", MapColor.brownColor); + + private static final BlockPlanks.EnumType[] META_LOOKUP = new BlockPlanks.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + private final MapColor mapColor; + + private EnumType(int p_i46388_3_, String p_i46388_4_, MapColor p_i46388_5_) + { + this(p_i46388_3_, p_i46388_4_, p_i46388_4_, p_i46388_5_); + } + + private EnumType(int p_i46389_3_, String p_i46389_4_, String p_i46389_5_, MapColor p_i46389_6_) + { + this.meta = p_i46389_3_; + this.name = p_i46389_4_; + this.unlocalizedName = p_i46389_5_; + this.mapColor = p_i46389_6_; + } + + public int getMetadata() + { + return this.meta; + } + + public MapColor getMapColor() + { + return this.mapColor; + } + + public String toString() + { + return this.name; + } + + public static BlockPlanks.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockPlanks.EnumType blockplanks$enumtype : values()) + { + META_LOOKUP[blockplanks$enumtype.getMetadata()] = blockplanks$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPortal.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPortal.java new file mode 100644 index 0000000..135ad10 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPortal.java @@ -0,0 +1,469 @@ +package net.minecraft.block; + +import com.google.common.cache.LoadingCache; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockWorldState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockPattern; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMonsterPlacer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPortal extends BlockBreakable +{ + public static final PropertyEnum AXIS = PropertyEnum.create("axis", EnumFacing.Axis.class, new EnumFacing.Axis[] {EnumFacing.Axis.X, EnumFacing.Axis.Z}); + + public BlockPortal() + { + super(Material.portal, false); + this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.X)); + this.setTickRandomly(true); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + super.updateTick(worldIn, pos, state, rand); + + if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getBoolean("doMobSpawning") && rand.nextInt(2000) < worldIn.getDifficulty().getDifficultyId()) + { + int i = pos.getY(); + BlockPos blockpos; + + for (blockpos = pos; !World.doesBlockHaveSolidTopSurface(worldIn, blockpos) && blockpos.getY() > 0; blockpos = blockpos.down()) + { + ; + } + + if (i > 0 && !worldIn.getBlockState(blockpos.up()).getBlock().isNormalCube()) + { + Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, 57, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 1.1D, (double)blockpos.getZ() + 0.5D); + + if (entity != null) + { + entity.timeUntilPortal = entity.getPortalCooldown(); + } + } + } + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis)worldIn.getBlockState(pos).getValue(AXIS); + float f = 0.125F; + float f1 = 0.125F; + + if (enumfacing$axis == EnumFacing.Axis.X) + { + f = 0.5F; + } + + if (enumfacing$axis == EnumFacing.Axis.Z) + { + f1 = 0.5F; + } + + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); + } + + public static int getMetaForAxis(EnumFacing.Axis axis) + { + return axis == EnumFacing.Axis.X ? 1 : (axis == EnumFacing.Axis.Z ? 2 : 0); + } + + public boolean isFullCube() + { + return false; + } + + public boolean func_176548_d(World worldIn, BlockPos p_176548_2_) + { + BlockPortal.Size blockportal$size = new BlockPortal.Size(worldIn, p_176548_2_, EnumFacing.Axis.X); + + if (blockportal$size.func_150860_b() && blockportal$size.field_150864_e == 0) + { + blockportal$size.func_150859_c(); + return true; + } + else + { + BlockPortal.Size blockportal$size1 = new BlockPortal.Size(worldIn, p_176548_2_, EnumFacing.Axis.Z); + + if (blockportal$size1.func_150860_b() && blockportal$size1.field_150864_e == 0) + { + blockportal$size1.func_150859_c(); + return true; + } + else + { + return false; + } + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis)state.getValue(AXIS); + + if (enumfacing$axis == EnumFacing.Axis.X) + { + BlockPortal.Size blockportal$size = new BlockPortal.Size(worldIn, pos, EnumFacing.Axis.X); + + if (!blockportal$size.func_150860_b() || blockportal$size.field_150864_e < blockportal$size.field_150868_h * blockportal$size.field_150862_g) + { + worldIn.setBlockState(pos, Blocks.air.getDefaultState()); + } + } + else if (enumfacing$axis == EnumFacing.Axis.Z) + { + BlockPortal.Size blockportal$size1 = new BlockPortal.Size(worldIn, pos, EnumFacing.Axis.Z); + + if (!blockportal$size1.func_150860_b() || blockportal$size1.field_150864_e < blockportal$size1.field_150868_h * blockportal$size1.field_150862_g) + { + worldIn.setBlockState(pos, Blocks.air.getDefaultState()); + } + } + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + EnumFacing.Axis enumfacing$axis = null; + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (worldIn.getBlockState(pos).getBlock() == this) + { + enumfacing$axis = (EnumFacing.Axis)iblockstate.getValue(AXIS); + + if (enumfacing$axis == null) + { + return false; + } + + if (enumfacing$axis == EnumFacing.Axis.Z && side != EnumFacing.EAST && side != EnumFacing.WEST) + { + return false; + } + + if (enumfacing$axis == EnumFacing.Axis.X && side != EnumFacing.SOUTH && side != EnumFacing.NORTH) + { + return false; + } + } + + boolean flag = worldIn.getBlockState(pos.west()).getBlock() == this && worldIn.getBlockState(pos.west(2)).getBlock() != this; + boolean flag1 = worldIn.getBlockState(pos.east()).getBlock() == this && worldIn.getBlockState(pos.east(2)).getBlock() != this; + boolean flag2 = worldIn.getBlockState(pos.north()).getBlock() == this && worldIn.getBlockState(pos.north(2)).getBlock() != this; + boolean flag3 = worldIn.getBlockState(pos.south()).getBlock() == this && worldIn.getBlockState(pos.south(2)).getBlock() != this; + boolean flag4 = flag || flag1 || enumfacing$axis == EnumFacing.Axis.X; + boolean flag5 = flag2 || flag3 || enumfacing$axis == EnumFacing.Axis.Z; + return flag4 && side == EnumFacing.WEST ? true : (flag4 && side == EnumFacing.EAST ? true : (flag5 && side == EnumFacing.NORTH ? true : flag5 && side == EnumFacing.SOUTH)); + } + + public int quantityDropped(Random random) + { + return 0; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null) + { + entityIn.setPortal(pos); + } + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (rand.nextInt(100) == 0) + { + worldIn.playSound((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "portal.portal", 0.5F, rand.nextFloat() * 0.4F + 0.8F, false); + } + + for (int i = 0; i < 4; ++i) + { + double d0 = (double)((float)pos.getX() + rand.nextFloat()); + double d1 = (double)((float)pos.getY() + rand.nextFloat()); + double d2 = (double)((float)pos.getZ() + rand.nextFloat()); + double d3 = ((double)rand.nextFloat() - 0.5D) * 0.5D; + double d4 = ((double)rand.nextFloat() - 0.5D) * 0.5D; + double d5 = ((double)rand.nextFloat() - 0.5D) * 0.5D; + int j = rand.nextInt(2) * 2 - 1; + + if (worldIn.getBlockState(pos.west()).getBlock() != this && worldIn.getBlockState(pos.east()).getBlock() != this) + { + d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j; + d3 = (double)(rand.nextFloat() * 2.0F * (float)j); + } + else + { + d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)j; + d5 = (double)(rand.nextFloat() * 2.0F * (float)j); + } + + worldIn.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + } + + public Item getItem(World worldIn, BlockPos pos) + { + return null; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AXIS, (meta & 3) == 2 ? EnumFacing.Axis.Z : EnumFacing.Axis.X); + } + + public int getMetaFromState(IBlockState state) + { + return getMetaForAxis((EnumFacing.Axis)state.getValue(AXIS)); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AXIS}); + } + + public BlockPattern.PatternHelper func_181089_f(World p_181089_1_, BlockPos p_181089_2_) + { + EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.Z; + BlockPortal.Size blockportal$size = new BlockPortal.Size(p_181089_1_, p_181089_2_, EnumFacing.Axis.X); + LoadingCache loadingcache = BlockPattern.func_181627_a(p_181089_1_, true); + + if (!blockportal$size.func_150860_b()) + { + enumfacing$axis = EnumFacing.Axis.X; + blockportal$size = new BlockPortal.Size(p_181089_1_, p_181089_2_, EnumFacing.Axis.Z); + } + + if (!blockportal$size.func_150860_b()) + { + return new BlockPattern.PatternHelper(p_181089_2_, EnumFacing.NORTH, EnumFacing.UP, loadingcache, 1, 1, 1); + } + else + { + int[] aint = new int[EnumFacing.AxisDirection.values().length]; + EnumFacing enumfacing = blockportal$size.field_150866_c.rotateYCCW(); + BlockPos blockpos = blockportal$size.field_150861_f.up(blockportal$size.func_181100_a() - 1); + + for (EnumFacing.AxisDirection enumfacing$axisdirection : EnumFacing.AxisDirection.values()) + { + BlockPattern.PatternHelper blockpattern$patternhelper = new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection ? blockpos : blockpos.offset(blockportal$size.field_150866_c, blockportal$size.func_181101_b() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1); + + for (int i = 0; i < blockportal$size.func_181101_b(); ++i) + { + for (int j = 0; j < blockportal$size.func_181100_a(); ++j) + { + BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, j, 1); + + if (blockworldstate.getBlockState() != null && blockworldstate.getBlockState().getBlock().getMaterial() != Material.air) + { + ++aint[enumfacing$axisdirection.ordinal()]; + } + } + } + } + + EnumFacing.AxisDirection enumfacing$axisdirection1 = EnumFacing.AxisDirection.POSITIVE; + + for (EnumFacing.AxisDirection enumfacing$axisdirection2 : EnumFacing.AxisDirection.values()) + { + if (aint[enumfacing$axisdirection2.ordinal()] < aint[enumfacing$axisdirection1.ordinal()]) + { + enumfacing$axisdirection1 = enumfacing$axisdirection2; + } + } + + return new BlockPattern.PatternHelper(enumfacing.getAxisDirection() == enumfacing$axisdirection1 ? blockpos : blockpos.offset(blockportal$size.field_150866_c, blockportal$size.func_181101_b() - 1), EnumFacing.getFacingFromAxis(enumfacing$axisdirection1, enumfacing$axis), EnumFacing.UP, loadingcache, blockportal$size.func_181101_b(), blockportal$size.func_181100_a(), 1); + } + } + + public static class Size + { + private final World world; + private final EnumFacing.Axis axis; + private final EnumFacing field_150866_c; + private final EnumFacing field_150863_d; + private int field_150864_e = 0; + private BlockPos field_150861_f; + private int field_150862_g; + private int field_150868_h; + + public Size(World worldIn, BlockPos p_i45694_2_, EnumFacing.Axis p_i45694_3_) + { + this.world = worldIn; + this.axis = p_i45694_3_; + + if (p_i45694_3_ == EnumFacing.Axis.X) + { + this.field_150863_d = EnumFacing.EAST; + this.field_150866_c = EnumFacing.WEST; + } + else + { + this.field_150863_d = EnumFacing.NORTH; + this.field_150866_c = EnumFacing.SOUTH; + } + + for (BlockPos blockpos = p_i45694_2_; p_i45694_2_.getY() > blockpos.getY() - 21 && p_i45694_2_.getY() > 0 && this.func_150857_a(worldIn.getBlockState(p_i45694_2_.down()).getBlock()); p_i45694_2_ = p_i45694_2_.down()) + { + ; + } + + int i = this.func_180120_a(p_i45694_2_, this.field_150863_d) - 1; + + if (i >= 0) + { + this.field_150861_f = p_i45694_2_.offset(this.field_150863_d, i); + this.field_150868_h = this.func_180120_a(this.field_150861_f, this.field_150866_c); + + if (this.field_150868_h < 2 || this.field_150868_h > 21) + { + this.field_150861_f = null; + this.field_150868_h = 0; + } + } + + if (this.field_150861_f != null) + { + this.field_150862_g = this.func_150858_a(); + } + } + + protected int func_180120_a(BlockPos p_180120_1_, EnumFacing p_180120_2_) + { + int i; + + for (i = 0; i < 22; ++i) + { + BlockPos blockpos = p_180120_1_.offset(p_180120_2_, i); + + if (!this.func_150857_a(this.world.getBlockState(blockpos).getBlock()) || this.world.getBlockState(blockpos.down()).getBlock() != Blocks.obsidian) + { + break; + } + } + + Block block = this.world.getBlockState(p_180120_1_.offset(p_180120_2_, i)).getBlock(); + return block == Blocks.obsidian ? i : 0; + } + + public int func_181100_a() + { + return this.field_150862_g; + } + + public int func_181101_b() + { + return this.field_150868_h; + } + + protected int func_150858_a() + { + label24: + + for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g) + { + for (int i = 0; i < this.field_150868_h; ++i) + { + BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i).up(this.field_150862_g); + Block block = this.world.getBlockState(blockpos).getBlock(); + + if (!this.func_150857_a(block)) + { + break label24; + } + + if (block == Blocks.portal) + { + ++this.field_150864_e; + } + + if (i == 0) + { + block = this.world.getBlockState(blockpos.offset(this.field_150863_d)).getBlock(); + + if (block != Blocks.obsidian) + { + break label24; + } + } + else if (i == this.field_150868_h - 1) + { + block = this.world.getBlockState(blockpos.offset(this.field_150866_c)).getBlock(); + + if (block != Blocks.obsidian) + { + break label24; + } + } + } + } + + for (int j = 0; j < this.field_150868_h; ++j) + { + if (this.world.getBlockState(this.field_150861_f.offset(this.field_150866_c, j).up(this.field_150862_g)).getBlock() != Blocks.obsidian) + { + this.field_150862_g = 0; + break; + } + } + + if (this.field_150862_g <= 21 && this.field_150862_g >= 3) + { + return this.field_150862_g; + } + else + { + this.field_150861_f = null; + this.field_150868_h = 0; + this.field_150862_g = 0; + return 0; + } + } + + protected boolean func_150857_a(Block p_150857_1_) + { + return p_150857_1_.blockMaterial == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Blocks.portal; + } + + public boolean func_150860_b() + { + return this.field_150861_f != null && this.field_150868_h >= 2 && this.field_150868_h <= 21 && this.field_150862_g >= 3 && this.field_150862_g <= 21; + } + + public void func_150859_c() + { + for (int i = 0; i < this.field_150868_h; ++i) + { + BlockPos blockpos = this.field_150861_f.offset(this.field_150866_c, i); + + for (int j = 0; j < this.field_150862_g; ++j) + { + this.world.setBlockState(blockpos.up(j), Blocks.portal.getDefaultState().withProperty(BlockPortal.AXIS, this.axis), 2); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPotato.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPotato.java new file mode 100644 index 0000000..0d883e8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPotato.java @@ -0,0 +1,34 @@ +package net.minecraft.block; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockPotato extends BlockCrops +{ + protected Item getSeed() + { + return Items.potato; + } + + protected Item getCrop() + { + return Items.potato; + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + + if (!worldIn.isRemote) + { + if (((Integer)state.getValue(AGE)).intValue() >= 7 && worldIn.rand.nextInt(50) == 0) + { + spawnAsEntity(worldIn, pos, new ItemStack(Items.poisonous_potato)); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPressurePlate.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPressurePlate.java new file mode 100644 index 0000000..de0420c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPressurePlate.java @@ -0,0 +1,90 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockPressurePlate extends BlockBasePressurePlate +{ + public static final PropertyBool POWERED = PropertyBool.create("powered"); + private final BlockPressurePlate.Sensitivity sensitivity; + + protected BlockPressurePlate(Material materialIn, BlockPressurePlate.Sensitivity sensitivityIn) + { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWERED, Boolean.valueOf(false))); + this.sensitivity = sensitivityIn; + } + + protected int getRedstoneStrength(IBlockState state) + { + return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + protected IBlockState setRedstoneStrength(IBlockState state, int strength) + { + return state.withProperty(POWERED, Boolean.valueOf(strength > 0)); + } + + protected int computeRedstoneStrength(World worldIn, BlockPos pos) + { + AxisAlignedBB axisalignedbb = this.getSensitiveAABB(pos); + List list; + + switch (this.sensitivity) + { + case EVERYTHING: + list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb); + break; + + case MOBS: + list = worldIn.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + break; + + default: + return 0; + } + + if (!list.isEmpty()) + { + for (Entity entity : list) + { + if (!entity.doesEntityNotTriggerPressurePlate()) + { + return 15; + } + } + } + + return 0; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(POWERED, Boolean.valueOf(meta == 1)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Boolean)state.getValue(POWERED)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {POWERED}); + } + + public static enum Sensitivity + { + EVERYTHING, + MOBS; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java new file mode 100644 index 0000000..2c7e4ea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java @@ -0,0 +1,75 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockPressurePlateWeighted extends BlockBasePressurePlate +{ + public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + private final int field_150068_a; + + protected BlockPressurePlateWeighted(Material p_i46379_1_, int p_i46379_2_) + { + this(p_i46379_1_, p_i46379_2_, p_i46379_1_.getMaterialMapColor()); + } + + protected BlockPressurePlateWeighted(Material p_i46380_1_, int p_i46380_2_, MapColor p_i46380_3_) + { + super(p_i46380_1_, p_i46380_3_); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWER, Integer.valueOf(0))); + this.field_150068_a = p_i46380_2_; + } + + protected int computeRedstoneStrength(World worldIn, BlockPos pos) + { + int i = Math.min(worldIn.getEntitiesWithinAABB(Entity.class, this.getSensitiveAABB(pos)).size(), this.field_150068_a); + + if (i > 0) + { + float f = (float)Math.min(this.field_150068_a, i) / (float)this.field_150068_a; + return MathHelper.ceiling_float_int(f * 15.0F); + } + else + { + return 0; + } + } + + protected int getRedstoneStrength(IBlockState state) + { + return ((Integer)state.getValue(POWER)).intValue(); + } + + protected IBlockState setRedstoneStrength(IBlockState state, int strength) + { + return state.withProperty(POWER, Integer.valueOf(strength)); + } + + public int tickRate(World worldIn) + { + return 10; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(POWER, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(POWER)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {POWER}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPrismarine.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPrismarine.java new file mode 100644 index 0000000..c6983db --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPrismarine.java @@ -0,0 +1,122 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.StatCollector; + +public class BlockPrismarine extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockPrismarine.EnumType.class); + public static final int ROUGH_META = BlockPrismarine.EnumType.ROUGH.getMetadata(); + public static final int BRICKS_META = BlockPrismarine.EnumType.BRICKS.getMetadata(); + public static final int DARK_META = BlockPrismarine.EnumType.DARK.getMetadata(); + + public BlockPrismarine() + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockPrismarine.EnumType.ROUGH)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + "." + BlockPrismarine.EnumType.ROUGH.getUnlocalizedName() + ".name"); + } + + public MapColor getMapColor(IBlockState state) + { + return state.getValue(VARIANT) == BlockPrismarine.EnumType.ROUGH ? MapColor.cyanColor : MapColor.diamondColor; + } + + public int damageDropped(IBlockState state) + { + return ((BlockPrismarine.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockPrismarine.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockPrismarine.EnumType.byMetadata(meta)); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, ROUGH_META)); + list.add(new ItemStack(itemIn, 1, BRICKS_META)); + list.add(new ItemStack(itemIn, 1, DARK_META)); + } + + public static enum EnumType implements IStringSerializable + { + ROUGH(0, "prismarine", "rough"), + BRICKS(1, "prismarine_bricks", "bricks"), + DARK(2, "dark_prismarine", "dark"); + + private static final BlockPrismarine.EnumType[] META_LOOKUP = new BlockPrismarine.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) + { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockPrismarine.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockPrismarine.EnumType blockprismarine$enumtype : values()) + { + META_LOOKUP[blockprismarine$enumtype.getMetadata()] = blockprismarine$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockPumpkin.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPumpkin.java new file mode 100644 index 0000000..6ff3c9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockPumpkin.java @@ -0,0 +1,180 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockWorldState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockPattern; +import net.minecraft.block.state.pattern.BlockStateHelper; +import net.minecraft.block.state.pattern.FactoryBlockPattern; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class BlockPumpkin extends BlockDirectional +{ + private BlockPattern snowmanBasePattern; + private BlockPattern snowmanPattern; + private BlockPattern golemBasePattern; + private BlockPattern golemPattern; + private static final Predicate field_181085_Q = new Predicate() + { + public boolean apply(IBlockState p_apply_1_) + { + return p_apply_1_ != null && (p_apply_1_.getBlock() == Blocks.pumpkin || p_apply_1_.getBlock() == Blocks.lit_pumpkin); + } + }; + + protected BlockPumpkin() + { + super(Material.gourd, MapColor.adobeColor); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + super.onBlockAdded(worldIn, pos, state); + this.trySpawnGolem(worldIn, pos); + } + + public boolean canDispenserPlace(World worldIn, BlockPos pos) + { + return this.getSnowmanBasePattern().match(worldIn, pos) != null || this.getGolemBasePattern().match(worldIn, pos) != null; + } + + private void trySpawnGolem(World worldIn, BlockPos pos) + { + BlockPattern.PatternHelper blockpattern$patternhelper; + + if ((blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos)) != null) + { + for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i) + { + BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0); + worldIn.setBlockState(blockworldstate.getPos(), Blocks.air.getDefaultState(), 2); + } + + EntitySnowman entitysnowman = new EntitySnowman(worldIn); + BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos(); + entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entitysnowman); + + for (int j = 0; j < 120; ++j) + { + worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); + } + + for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1) + { + BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0); + worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.air); + } + } + else if ((blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos)) != null) + { + for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k) + { + for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l) + { + worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.air.getDefaultState(), 2); + } + } + + BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos(); + EntityIronGolem entityirongolem = new EntityIronGolem(worldIn); + entityirongolem.setPlayerCreated(true); + entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entityirongolem); + + for (int j1 = 0; j1 < 120; ++j1) + { + worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); + } + + for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1) + { + for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1) + { + BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0); + worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air); + } + } + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos).getBlock().blockMaterial.isReplaceable() && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } + + protected BlockPattern getSnowmanBasePattern() + { + if (this.snowmanBasePattern == null) + { + this.snowmanBasePattern = FactoryBlockPattern.start().aisle(new String[] {" ", "#", "#"}).where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.snow))).build(); + } + + return this.snowmanBasePattern; + } + + protected BlockPattern getSnowmanPattern() + { + if (this.snowmanPattern == null) + { + this.snowmanPattern = FactoryBlockPattern.start().aisle(new String[] {"^", "#", "#"}).where('^', BlockWorldState.hasState(field_181085_Q)).where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.snow))).build(); + } + + return this.snowmanPattern; + } + + protected BlockPattern getGolemBasePattern() + { + if (this.golemBasePattern == null) + { + this.golemBasePattern = FactoryBlockPattern.start().aisle(new String[] {"~ ~", "###", "~#~"}).where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.iron_block))).where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.golemBasePattern; + } + + protected BlockPattern getGolemPattern() + { + if (this.golemPattern == null) + { + this.golemPattern = FactoryBlockPattern.start().aisle(new String[] {"~^~", "###", "~#~"}).where('^', BlockWorldState.hasState(field_181085_Q)).where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.iron_block))).where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.golemPattern; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockQuartz.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockQuartz.java new file mode 100644 index 0000000..ea8777d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockQuartz.java @@ -0,0 +1,144 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.World; + +public class BlockQuartz extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockQuartz.EnumType.class); + + public BlockQuartz() + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockQuartz.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + if (meta == BlockQuartz.EnumType.LINES_Y.getMetadata()) + { + switch (facing.getAxis()) + { + case Z: + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.LINES_Z); + + case X: + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.LINES_X); + + case Y: + default: + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.LINES_Y); + } + } + else + { + return meta == BlockQuartz.EnumType.CHISELED.getMetadata() ? this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.CHISELED) : this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.DEFAULT); + } + } + + public int damageDropped(IBlockState state) + { + BlockQuartz.EnumType blockquartz$enumtype = (BlockQuartz.EnumType)state.getValue(VARIANT); + return blockquartz$enumtype != BlockQuartz.EnumType.LINES_X && blockquartz$enumtype != BlockQuartz.EnumType.LINES_Z ? blockquartz$enumtype.getMetadata() : BlockQuartz.EnumType.LINES_Y.getMetadata(); + } + + protected ItemStack createStackedBlock(IBlockState state) + { + BlockQuartz.EnumType blockquartz$enumtype = (BlockQuartz.EnumType)state.getValue(VARIANT); + return blockquartz$enumtype != BlockQuartz.EnumType.LINES_X && blockquartz$enumtype != BlockQuartz.EnumType.LINES_Z ? super.createStackedBlock(state) : new ItemStack(Item.getItemFromBlock(this), 1, BlockQuartz.EnumType.LINES_Y.getMetadata()); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockQuartz.EnumType.CHISELED.getMetadata())); + list.add(new ItemStack(itemIn, 1, BlockQuartz.EnumType.LINES_Y.getMetadata())); + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.quartzColor; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockQuartz.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockQuartz.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + DEFAULT(0, "default", "default"), + CHISELED(1, "chiseled", "chiseled"), + LINES_Y(2, "lines_y", "lines"), + LINES_X(3, "lines_x", "lines"), + LINES_Z(4, "lines_z", "lines"); + + private static final BlockQuartz.EnumType[] META_LOOKUP = new BlockQuartz.EnumType[values().length]; + private final int meta; + private final String field_176805_h; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) + { + this.meta = meta; + this.field_176805_h = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.unlocalizedName; + } + + public static BlockQuartz.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.field_176805_h; + } + + static { + for (BlockQuartz.EnumType blockquartz$enumtype : values()) + { + META_LOOKUP[blockquartz$enumtype.getMetadata()] = blockquartz$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRail.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRail.java new file mode 100644 index 0000000..7fe26a7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRail.java @@ -0,0 +1,47 @@ +package net.minecraft.block; + +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockRail extends BlockRailBase +{ + public static final PropertyEnum SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class); + + protected BlockRail() + { + super(false); + this.setDefaultState(this.blockState.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); + } + + protected void onNeighborChangedInternal(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (neighborBlock.canProvidePower() && (new BlockRailBase.Rail(worldIn, pos, state)).countAdjacentRails() == 3) + { + this.func_176564_a(worldIn, pos, state, false); + } + } + + public IProperty getShapeProperty() + { + return SHAPE; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {SHAPE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailBase.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailBase.java new file mode 100644 index 0000000..3a9f97a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailBase.java @@ -0,0 +1,665 @@ +package net.minecraft.block; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockRailBase extends Block +{ + protected final boolean isPowered; + + public static boolean isRailBlock(World worldIn, BlockPos pos) + { + return isRailBlock(worldIn.getBlockState(pos)); + } + + public static boolean isRailBlock(IBlockState state) + { + Block block = state.getBlock(); + return block == Blocks.rail || block == Blocks.golden_rail || block == Blocks.detector_rail || block == Blocks.activator_rail; + } + + protected BlockRailBase(boolean isPowered) + { + super(Material.circuits); + this.isPowered = isPowered; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setCreativeTab(CreativeTabs.tabTransport); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.collisionRayTrace(worldIn, pos, start, end); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() == this ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(this.getShapeProperty()) : null; + + if (blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.isAscending()) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + state = this.func_176564_a(worldIn, pos, state, true); + + if (this.isPowered) + { + this.onNeighborBlockChange(worldIn, pos, state, this); + } + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty()); + boolean flag = false; + + if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down())) + { + flag = true; + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !World.doesBlockHaveSolidTopSurface(worldIn, pos.east())) + { + flag = true; + } + else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !World.doesBlockHaveSolidTopSurface(worldIn, pos.west())) + { + flag = true; + } + else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !World.doesBlockHaveSolidTopSurface(worldIn, pos.north())) + { + flag = true; + } + else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !World.doesBlockHaveSolidTopSurface(worldIn, pos.south())) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + else + { + this.onNeighborChangedInternal(worldIn, pos, state, neighborBlock); + } + } + } + + protected void onNeighborChangedInternal(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + } + + protected IBlockState func_176564_a(World worldIn, BlockPos p_176564_2_, IBlockState p_176564_3_, boolean p_176564_4_) + { + return worldIn.isRemote ? p_176564_3_ : (new BlockRailBase.Rail(worldIn, p_176564_2_, p_176564_3_)).func_180364_a(worldIn.isBlockPowered(p_176564_2_), p_176564_4_).getBlockState(); + } + + public int getMobilityFlag() + { + return 0; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + super.breakBlock(worldIn, pos, state); + + if (((BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty())).isAscending()) + { + worldIn.notifyNeighborsOfStateChange(pos.up(), this); + } + + if (this.isPowered) + { + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + } + } + + public abstract IProperty getShapeProperty(); + + public static enum EnumRailDirection implements IStringSerializable + { + NORTH_SOUTH(0, "north_south"), + EAST_WEST(1, "east_west"), + ASCENDING_EAST(2, "ascending_east"), + ASCENDING_WEST(3, "ascending_west"), + ASCENDING_NORTH(4, "ascending_north"), + ASCENDING_SOUTH(5, "ascending_south"), + SOUTH_EAST(6, "south_east"), + SOUTH_WEST(7, "south_west"), + NORTH_WEST(8, "north_west"), + NORTH_EAST(9, "north_east"); + + private static final BlockRailBase.EnumRailDirection[] META_LOOKUP = new BlockRailBase.EnumRailDirection[values().length]; + private final int meta; + private final String name; + + private EnumRailDirection(int meta, String name) + { + this.meta = meta; + this.name = name; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public boolean isAscending() + { + return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH || this == ASCENDING_WEST; + } + + public static BlockRailBase.EnumRailDirection byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + static { + for (BlockRailBase.EnumRailDirection blockrailbase$enumraildirection : values()) + { + META_LOOKUP[blockrailbase$enumraildirection.getMetadata()] = blockrailbase$enumraildirection; + } + } + } + + public class Rail + { + private final World world; + private final BlockPos pos; + private final BlockRailBase block; + private IBlockState state; + private final boolean isPowered; + private final List field_150657_g = Lists.newArrayList(); + + public Rail(World worldIn, BlockPos pos, IBlockState state) + { + this.world = worldIn; + this.pos = pos; + this.state = state; + this.block = (BlockRailBase)state.getBlock(); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(BlockRailBase.this.getShapeProperty()); + this.isPowered = this.block.isPowered; + this.func_180360_a(blockrailbase$enumraildirection); + } + + private void func_180360_a(BlockRailBase.EnumRailDirection p_180360_1_) + { + this.field_150657_g.clear(); + + switch (p_180360_1_) + { + case NORTH_SOUTH: + this.field_150657_g.add(this.pos.north()); + this.field_150657_g.add(this.pos.south()); + break; + + case EAST_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.east()); + break; + + case ASCENDING_EAST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.east().up()); + break; + + case ASCENDING_WEST: + this.field_150657_g.add(this.pos.west().up()); + this.field_150657_g.add(this.pos.east()); + break; + + case ASCENDING_NORTH: + this.field_150657_g.add(this.pos.north().up()); + this.field_150657_g.add(this.pos.south()); + break; + + case ASCENDING_SOUTH: + this.field_150657_g.add(this.pos.north()); + this.field_150657_g.add(this.pos.south().up()); + break; + + case SOUTH_EAST: + this.field_150657_g.add(this.pos.east()); + this.field_150657_g.add(this.pos.south()); + break; + + case SOUTH_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.south()); + break; + + case NORTH_WEST: + this.field_150657_g.add(this.pos.west()); + this.field_150657_g.add(this.pos.north()); + break; + + case NORTH_EAST: + this.field_150657_g.add(this.pos.east()); + this.field_150657_g.add(this.pos.north()); + } + } + + private void func_150651_b() + { + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i)); + + if (blockrailbase$rail != null && blockrailbase$rail.func_150653_a(this)) + { + this.field_150657_g.set(i, blockrailbase$rail.pos); + } + else + { + this.field_150657_g.remove(i--); + } + } + } + + private boolean hasRailAt(BlockPos pos) + { + return BlockRailBase.isRailBlock(this.world, pos) || BlockRailBase.isRailBlock(this.world, pos.up()) || BlockRailBase.isRailBlock(this.world, pos.down()); + } + + private BlockRailBase.Rail findRailAt(BlockPos pos) + { + IBlockState iblockstate = this.world.getBlockState(pos); + + if (BlockRailBase.isRailBlock(iblockstate)) + { + return BlockRailBase.this.new Rail(this.world, pos, iblockstate); + } + else + { + BlockPos lvt_2_1_ = pos.up(); + iblockstate = this.world.getBlockState(lvt_2_1_); + + if (BlockRailBase.isRailBlock(iblockstate)) + { + return BlockRailBase.this.new Rail(this.world, lvt_2_1_, iblockstate); + } + else + { + lvt_2_1_ = pos.down(); + iblockstate = this.world.getBlockState(lvt_2_1_); + return BlockRailBase.isRailBlock(iblockstate) ? BlockRailBase.this.new Rail(this.world, lvt_2_1_, iblockstate) : null; + } + } + } + + private boolean func_150653_a(BlockRailBase.Rail p_150653_1_) + { + return this.func_180363_c(p_150653_1_.pos); + } + + private boolean func_180363_c(BlockPos p_180363_1_) + { + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + BlockPos blockpos = (BlockPos)this.field_150657_g.get(i); + + if (blockpos.getX() == p_180363_1_.getX() && blockpos.getZ() == p_180363_1_.getZ()) + { + return true; + } + } + + return false; + } + + protected int countAdjacentRails() + { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (this.hasRailAt(this.pos.offset(enumfacing))) + { + ++i; + } + } + + return i; + } + + private boolean func_150649_b(BlockRailBase.Rail rail) + { + return this.func_150653_a(rail) || this.field_150657_g.size() != 2; + } + + private void func_150645_c(BlockRailBase.Rail p_150645_1_) + { + this.field_150657_g.add(p_150645_1_.pos); + BlockPos blockpos = this.pos.north(); + BlockPos blockpos1 = this.pos.south(); + BlockPos blockpos2 = this.pos.west(); + BlockPos blockpos3 = this.pos.east(); + boolean flag = this.func_180363_c(blockpos); + boolean flag1 = this.func_180363_c(blockpos1); + boolean flag2 = this.func_180363_c(blockpos2); + boolean flag3 = this.func_180363_c(blockpos3); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null; + + if (flag || flag1) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + if (flag2 || flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + } + + if (!this.isPowered) + { + if (flag1 && flag3 && !flag && !flag2) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + + if (flag1 && flag2 && !flag && !flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag && flag2 && !flag1 && !flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + + if (flag && flag3 && !flag1 && !flag2) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) + { + if (BlockRailBase.isRailBlock(this.world, blockpos.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos1.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH; + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) + { + if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos2.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST; + } + } + + if (blockrailbase$enumraildirection == null) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection); + this.world.setBlockState(this.pos, this.state, 3); + } + + private boolean func_180361_d(BlockPos p_180361_1_) + { + BlockRailBase.Rail blockrailbase$rail = this.findRailAt(p_180361_1_); + + if (blockrailbase$rail == null) + { + return false; + } + else + { + blockrailbase$rail.func_150651_b(); + return blockrailbase$rail.func_150649_b(this); + } + } + + public BlockRailBase.Rail func_180364_a(boolean p_180364_1_, boolean p_180364_2_) + { + BlockPos blockpos = this.pos.north(); + BlockPos blockpos1 = this.pos.south(); + BlockPos blockpos2 = this.pos.west(); + BlockPos blockpos3 = this.pos.east(); + boolean flag = this.func_180361_d(blockpos); + boolean flag1 = this.func_180361_d(blockpos1); + boolean flag2 = this.func_180361_d(blockpos2); + boolean flag3 = this.func_180361_d(blockpos3); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null; + + if ((flag || flag1) && !flag2 && !flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + if ((flag2 || flag3) && !flag && !flag1) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + } + + if (!this.isPowered) + { + if (flag1 && flag3 && !flag && !flag2) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + + if (flag1 && flag2 && !flag && !flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag && flag2 && !flag1 && !flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + + if (flag && flag3 && !flag1 && !flag2) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + } + + if (blockrailbase$enumraildirection == null) + { + if (flag || flag1) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + if (flag2 || flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + } + + if (!this.isPowered) + { + if (p_180364_1_) + { + if (flag1 && flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + + if (flag2 && flag1) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag3 && flag) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + + if (flag && flag2) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + } + else + { + if (flag && flag2) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST; + } + + if (flag3 && flag) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST; + } + + if (flag2 && flag1) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + + if (flag1 && flag3) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST; + } + } + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) + { + if (BlockRailBase.isRailBlock(this.world, blockpos.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos1.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH; + } + } + + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) + { + if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST; + } + + if (BlockRailBase.isRailBlock(this.world, blockpos2.up())) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST; + } + } + + if (blockrailbase$enumraildirection == null) + { + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + this.func_180360_a(blockrailbase$enumraildirection); + this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection); + + if (p_180364_2_ || this.world.getBlockState(this.pos) != this.state) + { + this.world.setBlockState(this.pos, this.state, 3); + + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i)); + + if (blockrailbase$rail != null) + { + blockrailbase$rail.func_150651_b(); + + if (blockrailbase$rail.func_150649_b(this)) + { + blockrailbase$rail.func_150645_c(this); + } + } + } + } + + return this; + } + + public IBlockState getBlockState() + { + return this.state; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailDetector.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailDetector.java new file mode 100644 index 0000000..d9694f5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailDetector.java @@ -0,0 +1,191 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import java.util.Random; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRailDetector extends BlockRailBase +{ + public static final PropertyEnum SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class, new Predicate() + { + public boolean apply(BlockRailBase.EnumRailDirection p_apply_1_) + { + return p_apply_1_ != BlockRailBase.EnumRailDirection.NORTH_EAST && p_apply_1_ != BlockRailBase.EnumRailDirection.NORTH_WEST && p_apply_1_ != BlockRailBase.EnumRailDirection.SOUTH_EAST && p_apply_1_ != BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + }); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + + public BlockRailDetector() + { + super(true); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); + this.setTickRandomly(true); + } + + public int tickRate(World worldIn) + { + return 20; + } + + public boolean canProvidePower() + { + return true; + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (!worldIn.isRemote) + { + if (!((Boolean)state.getValue(POWERED)).booleanValue()) + { + this.updatePoweredState(worldIn, pos, state); + } + } + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote && ((Boolean)state.getValue(POWERED)).booleanValue()) + { + this.updatePoweredState(worldIn, pos, state); + } + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (side == EnumFacing.UP ? 15 : 0); + } + + private void updatePoweredState(World worldIn, BlockPos pos, IBlockState state) + { + boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue(); + boolean flag1 = false; + List list = this.findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[0]); + + if (!list.isEmpty()) + { + flag1 = true; + } + + if (flag1 && !flag) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + } + + if (!flag1 && flag) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 3); + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + worldIn.markBlockRangeForRenderUpdate(pos, pos); + } + + if (flag1) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + + worldIn.updateComparatorOutputLevel(pos, this); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + super.onBlockAdded(worldIn, pos, state); + this.updatePoweredState(worldIn, pos, state); + } + + public IProperty getShapeProperty() + { + return SHAPE; + } + + public boolean hasComparatorInputOverride() + { + return true; + } + + public int getComparatorInputOverride(World worldIn, BlockPos pos) + { + if (((Boolean)worldIn.getBlockState(pos).getValue(POWERED)).booleanValue()) + { + List list = this.findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, new Predicate[0]); + + if (!list.isEmpty()) + { + return ((EntityMinecartCommandBlock)list.get(0)).getCommandBlockLogic().getSuccessCount(); + } + + List list1 = this.findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[] {EntitySelectors.selectInventories}); + + if (!list1.isEmpty()) + { + return Container.calcRedstoneFromInventory((IInventory)list1.get(0)); + } + } + + return 0; + } + + protected List findMinecarts(World worldIn, BlockPos pos, Class clazz, Predicate... filter) + { + AxisAlignedBB axisalignedbb = this.getDectectionBox(pos); + return filter.length != 1 ? worldIn.getEntitiesWithinAABB(clazz, axisalignedbb) : worldIn.getEntitiesWithinAABB(clazz, axisalignedbb, filter[0]); + } + + private AxisAlignedBB getDectectionBox(BlockPos pos) + { + float f = 0.2F; + return new AxisAlignedBB((double)((float)pos.getX() + 0.2F), (double)pos.getY(), (double)((float)pos.getZ() + 0.2F), (double)((float)(pos.getX() + 1) - 0.2F), (double)((float)(pos.getY() + 1) - 0.2F), (double)((float)(pos.getZ() + 1) - 0.2F)); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(meta & 7)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).getMetadata(); + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {SHAPE, POWERED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailPowered.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailPowered.java new file mode 100644 index 0000000..9d98b9d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRailPowered.java @@ -0,0 +1,193 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockRailPowered extends BlockRailBase +{ + public static final PropertyEnum SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class, new Predicate() + { + public boolean apply(BlockRailBase.EnumRailDirection p_apply_1_) + { + return p_apply_1_ != BlockRailBase.EnumRailDirection.NORTH_EAST && p_apply_1_ != BlockRailBase.EnumRailDirection.NORTH_WEST && p_apply_1_ != BlockRailBase.EnumRailDirection.SOUTH_EAST && p_apply_1_ != BlockRailBase.EnumRailDirection.SOUTH_WEST; + } + }); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + + protected BlockRailPowered() + { + super(true); + this.setDefaultState(this.blockState.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH).withProperty(POWERED, Boolean.valueOf(false))); + } + + @SuppressWarnings("incomplete-switch") + protected boolean func_176566_a(World worldIn, BlockPos pos, IBlockState state, boolean p_176566_4_, int p_176566_5_) + { + if (p_176566_5_ >= 8) + { + return false; + } + else + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + boolean flag = true; + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(SHAPE); + + switch (blockrailbase$enumraildirection) + { + case NORTH_SOUTH: + if (p_176566_4_) + { + ++k; + } + else + { + --k; + } + + break; + + case EAST_WEST: + if (p_176566_4_) + { + --i; + } + else + { + ++i; + } + + break; + + case ASCENDING_EAST: + if (p_176566_4_) + { + --i; + } + else + { + ++i; + ++j; + flag = false; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + break; + + case ASCENDING_WEST: + if (p_176566_4_) + { + --i; + ++j; + flag = false; + } + else + { + ++i; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST; + break; + + case ASCENDING_NORTH: + if (p_176566_4_) + { + ++k; + } + else + { + --k; + ++j; + flag = false; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + break; + + case ASCENDING_SOUTH: + if (p_176566_4_) + { + ++k; + ++j; + flag = false; + } + else + { + --k; + } + + blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH; + } + + return this.func_176567_a(worldIn, new BlockPos(i, j, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection) ? true : flag && this.func_176567_a(worldIn, new BlockPos(i, j - 1, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection); + } + } + + protected boolean func_176567_a(World worldIn, BlockPos p_176567_2_, boolean p_176567_3_, int distance, BlockRailBase.EnumRailDirection p_176567_5_) + { + IBlockState iblockstate = worldIn.getBlockState(p_176567_2_); + + if (iblockstate.getBlock() != this) + { + return false; + } + else + { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(SHAPE); + return p_176567_5_ != BlockRailBase.EnumRailDirection.EAST_WEST || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_SOUTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_NORTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_SOUTH ? (p_176567_5_ != BlockRailBase.EnumRailDirection.NORTH_SOUTH || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.EAST_WEST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_EAST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_WEST ? (((Boolean)iblockstate.getValue(POWERED)).booleanValue() ? (worldIn.isBlockPowered(p_176567_2_) ? true : this.func_176566_a(worldIn, p_176567_2_, iblockstate, p_176567_3_, distance + 1)) : false) : false) : false; + } + } + + protected void onNeighborChangedInternal(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue(); + boolean flag1 = worldIn.isBlockPowered(pos) || this.func_176566_a(worldIn, pos, state, true, 0) || this.func_176566_a(worldIn, pos, state, false, 0); + + if (flag1 != flag) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(flag1)), 3); + worldIn.notifyNeighborsOfStateChange(pos.down(), this); + + if (((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).isAscending()) + { + worldIn.notifyNeighborsOfStateChange(pos.up(), this); + } + } + } + + public IProperty getShapeProperty() + { + return SHAPE; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(meta & 7)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).getMetadata(); + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {SHAPE, POWERED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedFlower.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedFlower.java new file mode 100644 index 0000000..2b3c939 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedFlower.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockRedFlower extends BlockFlower +{ + public BlockFlower.EnumFlowerColor getBlockType() + { + return BlockFlower.EnumFlowerColor.RED; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedSandstone.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedSandstone.java new file mode 100644 index 0000000..7926981 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedSandstone.java @@ -0,0 +1,108 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public class BlockRedSandstone extends Block +{ + public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockRedSandstone.EnumType.class); + + public BlockRedSandstone() + { + super(Material.rock, BlockSand.EnumType.RED_SAND.getMapColor()); + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockRedSandstone.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int damageDropped(IBlockState state) + { + return ((BlockRedSandstone.EnumType)state.getValue(TYPE)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockRedSandstone.EnumType blockredsandstone$enumtype : BlockRedSandstone.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockredsandstone$enumtype.getMetadata())); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(TYPE, BlockRedSandstone.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockRedSandstone.EnumType)state.getValue(TYPE)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {TYPE}); + } + + public static enum EnumType implements IStringSerializable + { + DEFAULT(0, "red_sandstone", "default"), + CHISELED(1, "chiseled_red_sandstone", "chiseled"), + SMOOTH(2, "smooth_red_sandstone", "smooth"); + + private static final BlockRedSandstone.EnumType[] META_LOOKUP = new BlockRedSandstone.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) + { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockRedSandstone.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockRedSandstone.EnumType blockredsandstone$enumtype : values()) + { + META_LOOKUP[blockredsandstone$enumtype.getMetadata()] = blockredsandstone$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneComparator.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneComparator.java new file mode 100644 index 0000000..7bb61f3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneComparator.java @@ -0,0 +1,317 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityComparator; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider +{ + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyEnum MODE = PropertyEnum.create("mode", BlockRedstoneComparator.Mode.class); + + public BlockRedstoneComparator(boolean powered) + { + super(powered); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE)); + this.isBlockContainer = true; + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal("item.comparator.name"); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.comparator; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.comparator; + } + + protected int getDelay(IBlockState state) + { + return 2; + } + + protected IBlockState getPoweredState(IBlockState unpoweredState) + { + Boolean obool = (Boolean)unpoweredState.getValue(POWERED); + BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode)unpoweredState.getValue(MODE); + EnumFacing enumfacing = (EnumFacing)unpoweredState.getValue(FACING); + return Blocks.powered_comparator.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, obool).withProperty(MODE, blockredstonecomparator$mode); + } + + protected IBlockState getUnpoweredState(IBlockState poweredState) + { + Boolean obool = (Boolean)poweredState.getValue(POWERED); + BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode)poweredState.getValue(MODE); + EnumFacing enumfacing = (EnumFacing)poweredState.getValue(FACING); + return Blocks.unpowered_comparator.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, obool).withProperty(MODE, blockredstonecomparator$mode); + } + + protected boolean isPowered(IBlockState state) + { + return this.isRepeaterPowered || ((Boolean)state.getValue(POWERED)).booleanValue(); + } + + protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0; + } + + private int calculateOutput(World worldIn, BlockPos pos, IBlockState state) + { + return state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? Math.max(this.calculateInputStrength(worldIn, pos, state) - this.getPowerOnSides(worldIn, pos, state), 0) : this.calculateInputStrength(worldIn, pos, state); + } + + protected boolean shouldBePowered(World worldIn, BlockPos pos, IBlockState state) + { + int i = this.calculateInputStrength(worldIn, pos, state); + + if (i >= 15) + { + return true; + } + else if (i == 0) + { + return false; + } + else + { + int j = this.getPowerOnSides(worldIn, pos, state); + return j == 0 ? true : i >= j; + } + } + + protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state) + { + int i = super.calculateInputStrength(worldIn, pos, state); + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + BlockPos blockpos = pos.offset(enumfacing); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block.hasComparatorInputOverride()) + { + i = block.getComparatorInputOverride(worldIn, blockpos); + } + else if (i < 15 && block.isNormalCube()) + { + blockpos = blockpos.offset(enumfacing); + block = worldIn.getBlockState(blockpos).getBlock(); + + if (block.hasComparatorInputOverride()) + { + i = block.getComparatorInputOverride(worldIn, blockpos); + } + else if (block.getMaterial() == Material.air) + { + EntityItemFrame entityitemframe = this.findItemFrame(worldIn, enumfacing, blockpos); + + if (entityitemframe != null) + { + i = entityitemframe.func_174866_q(); + } + } + } + + return i; + } + + private EntityItemFrame findItemFrame(World worldIn, final EnumFacing facing, BlockPos pos) + { + List list = worldIn.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 1), (double)(pos.getZ() + 1)), new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ != null && p_apply_1_.getHorizontalFacing() == facing; + } + }); + return list.size() == 1 ? (EntityItemFrame)list.get(0) : null; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!playerIn.capabilities.allowEdit) + { + return false; + } + else + { + state = state.cycleProperty(MODE); + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "random.click", 0.3F, state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? 0.55F : 0.5F); + worldIn.setBlockState(pos, state, 2); + this.onStateChange(worldIn, pos, state); + return true; + } + } + + protected void updateState(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isBlockTickPending(pos, this)) + { + int i = this.calculateOutput(worldIn, pos, state); + TileEntity tileentity = worldIn.getTileEntity(pos); + int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0; + + if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state)) + { + if (this.isFacingTowardsRepeater(worldIn, pos, state)) + { + worldIn.updateBlockTick(pos, this, 2, -1); + } + else + { + worldIn.updateBlockTick(pos, this, 2, 0); + } + } + } + } + + private void onStateChange(World worldIn, BlockPos pos, IBlockState state) + { + int i = this.calculateOutput(worldIn, pos, state); + TileEntity tileentity = worldIn.getTileEntity(pos); + int j = 0; + + if (tileentity instanceof TileEntityComparator) + { + TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity; + j = tileentitycomparator.getOutputSignal(); + tileentitycomparator.setOutputSignal(i); + } + + if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE) + { + boolean flag1 = this.shouldBePowered(worldIn, pos, state); + boolean flag = this.isPowered(state); + + if (flag && !flag1) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2); + } + else if (!flag && flag1) + { + worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2); + } + + this.notifyNeighbors(worldIn, pos, state); + } + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this.isRepeaterPowered) + { + worldIn.setBlockState(pos, this.getUnpoweredState(state).withProperty(POWERED, Boolean.valueOf(true)), 4); + } + + this.onStateChange(worldIn, pos, state); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + super.onBlockAdded(worldIn, pos, state); + worldIn.setTileEntity(pos, this.createNewTileEntity(worldIn, 0)); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + super.breakBlock(worldIn, pos, state); + worldIn.removeTileEntity(pos); + this.notifyNeighbors(worldIn, pos, state); + } + + public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + { + super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam); + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityComparator(); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)).withProperty(MODE, (meta & 4) > 0 ? BlockRedstoneComparator.Mode.SUBTRACT : BlockRedstoneComparator.Mode.COMPARE); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 8; + } + + if (state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT) + { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, MODE, POWERED}); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE); + } + + public static enum Mode implements IStringSerializable + { + COMPARE("compare"), + SUBTRACT("subtract"); + + private final String name; + + private Mode(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneDiode.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneDiode.java new file mode 100644 index 0000000..20150ec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneDiode.java @@ -0,0 +1,267 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockRedstoneDiode extends BlockDirectional +{ + protected final boolean isRepeaterPowered; + + protected BlockRedstoneDiode(boolean powered) + { + super(Material.circuits); + this.isRepeaterPowered = powered; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) ? super.canPlaceBlockAt(worldIn, pos) : false; + } + + public boolean canBlockStay(World worldIn, BlockPos pos) + { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!this.isLocked(worldIn, pos, state)) + { + boolean flag = this.shouldBePowered(worldIn, pos, state); + + if (this.isRepeaterPowered && !flag) + { + worldIn.setBlockState(pos, this.getUnpoweredState(state), 2); + } + else if (!this.isRepeaterPowered) + { + worldIn.setBlockState(pos, this.getPoweredState(state), 2); + + if (!flag) + { + worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1); + } + } + } + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return side.getAxis() != EnumFacing.Axis.Y; + } + + protected boolean isPowered(IBlockState state) + { + return this.isRepeaterPowered; + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return this.getWeakPower(worldIn, pos, state, side); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return !this.isPowered(state) ? 0 : (state.getValue(FACING) == side ? this.getActiveSignal(worldIn, pos, state) : 0); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (this.canBlockStay(worldIn, pos)) + { + this.updateState(worldIn, pos, state); + } + else + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + } + } + + protected void updateState(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.isLocked(worldIn, pos, state)) + { + boolean flag = this.shouldBePowered(worldIn, pos, state); + + if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !worldIn.isBlockTickPending(pos, this)) + { + int i = -1; + + if (this.isFacingTowardsRepeater(worldIn, pos, state)) + { + i = -3; + } + else if (this.isRepeaterPowered) + { + i = -2; + } + + worldIn.updateBlockTick(pos, this, this.getDelay(state), i); + } + } + } + + public boolean isLocked(IBlockAccess worldIn, BlockPos pos, IBlockState state) + { + return false; + } + + protected boolean shouldBePowered(World worldIn, BlockPos pos, IBlockState state) + { + return this.calculateInputStrength(worldIn, pos, state) > 0; + } + + protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + BlockPos blockpos = pos.offset(enumfacing); + int i = worldIn.getRedstonePower(blockpos, enumfacing); + + if (i >= 15) + { + return i; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(blockpos); + return Math.max(i, iblockstate.getBlock() == Blocks.redstone_wire ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : 0); + } + } + + protected int getPowerOnSides(IBlockAccess worldIn, BlockPos pos, IBlockState state) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + EnumFacing enumfacing1 = enumfacing.rotateY(); + EnumFacing enumfacing2 = enumfacing.rotateYCCW(); + return Math.max(this.getPowerOnSide(worldIn, pos.offset(enumfacing1), enumfacing1), this.getPowerOnSide(worldIn, pos.offset(enumfacing2), enumfacing2)); + } + + protected int getPowerOnSide(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + return this.canPowerSide(block) ? (block == Blocks.redstone_wire ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : worldIn.getStrongPower(pos, side)) : 0; + } + + public boolean canProvidePower() + { + return true; + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + if (this.shouldBePowered(worldIn, pos, state)) + { + worldIn.scheduleUpdate(pos, this, 1); + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.notifyNeighbors(worldIn, pos, state); + } + + protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + BlockPos blockpos = pos.offset(enumfacing.getOpposite()); + worldIn.notifyBlockOfStateChange(blockpos, this); + worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing); + } + + public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) + { + if (this.isRepeaterPowered) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + } + + super.onBlockDestroyedByPlayer(worldIn, pos, state); + } + + public boolean isOpaqueCube() + { + return false; + } + + protected boolean canPowerSide(Block blockIn) + { + return blockIn.canProvidePower(); + } + + protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state) + { + return 15; + } + + public static boolean isRedstoneRepeaterBlockID(Block blockIn) + { + return Blocks.unpowered_repeater.isAssociated(blockIn) || Blocks.unpowered_comparator.isAssociated(blockIn); + } + + public boolean isAssociated(Block other) + { + return other == this.getPoweredState(this.getDefaultState()).getBlock() || other == this.getUnpoweredState(this.getDefaultState()).getBlock(); + } + + public boolean isFacingTowardsRepeater(World worldIn, BlockPos pos, IBlockState state) + { + EnumFacing enumfacing = ((EnumFacing)state.getValue(FACING)).getOpposite(); + BlockPos blockpos = pos.offset(enumfacing); + return isRedstoneRepeaterBlockID(worldIn.getBlockState(blockpos).getBlock()) ? worldIn.getBlockState(blockpos).getValue(FACING) != enumfacing : false; + } + + protected int getTickDelay(IBlockState state) + { + return this.getDelay(state); + } + + protected abstract int getDelay(IBlockState state); + + protected abstract IBlockState getPoweredState(IBlockState unpoweredState); + + protected abstract IBlockState getUnpoweredState(IBlockState poweredState); + + public boolean isAssociatedBlock(Block other) + { + return this.isAssociated(other); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneLight.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneLight.java new file mode 100644 index 0000000..dc87820 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneLight.java @@ -0,0 +1,82 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockRedstoneLight extends Block +{ + private final boolean isOn; + + public BlockRedstoneLight(boolean isOn) + { + super(Material.redstoneLight); + this.isOn = isOn; + + if (isOn) + { + this.setLightLevel(1.0F); + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + if (this.isOn && !worldIn.isBlockPowered(pos)) + { + worldIn.setBlockState(pos, Blocks.redstone_lamp.getDefaultState(), 2); + } + else if (!this.isOn && worldIn.isBlockPowered(pos)) + { + worldIn.setBlockState(pos, Blocks.lit_redstone_lamp.getDefaultState(), 2); + } + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + if (this.isOn && !worldIn.isBlockPowered(pos)) + { + worldIn.scheduleUpdate(pos, this, 4); + } + else if (!this.isOn && worldIn.isBlockPowered(pos)) + { + worldIn.setBlockState(pos, Blocks.lit_redstone_lamp.getDefaultState(), 2); + } + } + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + if (this.isOn && !worldIn.isBlockPowered(pos)) + { + worldIn.setBlockState(pos, Blocks.redstone_lamp.getDefaultState(), 2); + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + protected ItemStack createStackedBlock(IBlockState state) + { + return new ItemStack(Blocks.redstone_lamp); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneOre.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneOre.java new file mode 100644 index 0000000..5c4270d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneOre.java @@ -0,0 +1,160 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class BlockRedstoneOre extends Block +{ + private final boolean isOn; + + public BlockRedstoneOre(boolean isOn) + { + super(Material.rock); + + if (isOn) + { + this.setTickRandomly(true); + } + + this.isOn = isOn; + } + + public int tickRate(World worldIn) + { + return 30; + } + + public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) + { + this.activate(worldIn, pos); + super.onBlockClicked(worldIn, pos, playerIn); + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) + { + this.activate(worldIn, pos); + super.onEntityCollidedWithBlock(worldIn, pos, entityIn); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + this.activate(worldIn, pos); + return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); + } + + private void activate(World worldIn, BlockPos pos) + { + this.spawnParticles(worldIn, pos); + + if (this == Blocks.redstone_ore) + { + worldIn.setBlockState(pos, Blocks.lit_redstone_ore.getDefaultState()); + } + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this == Blocks.lit_redstone_ore) + { + worldIn.setBlockState(pos, Blocks.redstone_ore.getDefaultState()); + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.redstone; + } + + public int quantityDroppedWithBonus(int fortune, Random random) + { + return this.quantityDropped(random) + random.nextInt(fortune + 1); + } + + public int quantityDropped(Random random) + { + return 4 + random.nextInt(2); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + + if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this)) + { + int i = 1 + worldIn.rand.nextInt(5); + this.dropXpOnBlockBreak(worldIn, pos, i); + } + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this.isOn) + { + this.spawnParticles(worldIn, pos); + } + } + + private void spawnParticles(World worldIn, BlockPos pos) + { + Random random = worldIn.rand; + double d0 = 0.0625D; + + for (int i = 0; i < 6; ++i) + { + double d1 = (double)((float)pos.getX() + random.nextFloat()); + double d2 = (double)((float)pos.getY() + random.nextFloat()); + double d3 = (double)((float)pos.getZ() + random.nextFloat()); + + if (i == 0 && !worldIn.getBlockState(pos.up()).getBlock().isOpaqueCube()) + { + d2 = (double)pos.getY() + d0 + 1.0D; + } + + if (i == 1 && !worldIn.getBlockState(pos.down()).getBlock().isOpaqueCube()) + { + d2 = (double)pos.getY() - d0; + } + + if (i == 2 && !worldIn.getBlockState(pos.south()).getBlock().isOpaqueCube()) + { + d3 = (double)pos.getZ() + d0 + 1.0D; + } + + if (i == 3 && !worldIn.getBlockState(pos.north()).getBlock().isOpaqueCube()) + { + d3 = (double)pos.getZ() - d0; + } + + if (i == 4 && !worldIn.getBlockState(pos.east()).getBlock().isOpaqueCube()) + { + d1 = (double)pos.getX() + d0 + 1.0D; + } + + if (i == 5 && !worldIn.getBlockState(pos.west()).getBlock().isOpaqueCube()) + { + d1 = (double)pos.getX() - d0; + } + + if (d1 < (double)pos.getX() || d1 > (double)(pos.getX() + 1) || d2 < 0.0D || d2 > (double)(pos.getY() + 1) || d3 < (double)pos.getZ() || d3 > (double)(pos.getZ() + 1)) + { + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, d1, d2, d3, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + protected ItemStack createStackedBlock(IBlockState state) + { + return new ItemStack(Blocks.redstone_ore); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java new file mode 100644 index 0000000..547f8f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java @@ -0,0 +1,140 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneRepeater extends BlockRedstoneDiode +{ + public static final PropertyBool LOCKED = PropertyBool.create("locked"); + public static final PropertyInteger DELAY = PropertyInteger.create("delay", 1, 4); + + protected BlockRedstoneRepeater(boolean powered) + { + super(powered); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(DELAY, Integer.valueOf(1)).withProperty(LOCKED, Boolean.valueOf(false))); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal("item.diode.name"); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state.withProperty(LOCKED, Boolean.valueOf(this.isLocked(worldIn, pos, state))); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!playerIn.capabilities.allowEdit) + { + return false; + } + else + { + worldIn.setBlockState(pos, state.cycleProperty(DELAY), 3); + return true; + } + } + + protected int getDelay(IBlockState state) + { + return ((Integer)state.getValue(DELAY)).intValue() * 2; + } + + protected IBlockState getPoweredState(IBlockState unpoweredState) + { + Integer integer = (Integer)unpoweredState.getValue(DELAY); + Boolean obool = (Boolean)unpoweredState.getValue(LOCKED); + EnumFacing enumfacing = (EnumFacing)unpoweredState.getValue(FACING); + return Blocks.powered_repeater.getDefaultState().withProperty(FACING, enumfacing).withProperty(DELAY, integer).withProperty(LOCKED, obool); + } + + protected IBlockState getUnpoweredState(IBlockState poweredState) + { + Integer integer = (Integer)poweredState.getValue(DELAY); + Boolean obool = (Boolean)poweredState.getValue(LOCKED); + EnumFacing enumfacing = (EnumFacing)poweredState.getValue(FACING); + return Blocks.unpowered_repeater.getDefaultState().withProperty(FACING, enumfacing).withProperty(DELAY, integer).withProperty(LOCKED, obool); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.repeater; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.repeater; + } + + public boolean isLocked(IBlockAccess worldIn, BlockPos pos, IBlockState state) + { + return this.getPowerOnSides(worldIn, pos, state) > 0; + } + + protected boolean canPowerSide(Block blockIn) + { + return isRedstoneRepeaterBlockID(blockIn); + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this.isRepeaterPowered) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + double d0 = (double)((float)pos.getX() + 0.5F) + (double)(rand.nextFloat() - 0.5F) * 0.2D; + double d1 = (double)((float)pos.getY() + 0.4F) + (double)(rand.nextFloat() - 0.5F) * 0.2D; + double d2 = (double)((float)pos.getZ() + 0.5F) + (double)(rand.nextFloat() - 0.5F) * 0.2D; + float f = -5.0F; + + if (rand.nextBoolean()) + { + f = (float)(((Integer)state.getValue(DELAY)).intValue() * 2 - 1); + } + + f = f / 16.0F; + double d3 = (double)(f * (float)enumfacing.getFrontOffsetX()); + double d4 = (double)(f * (float)enumfacing.getFrontOffsetZ()); + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + super.breakBlock(worldIn, pos, state); + this.notifyNeighbors(worldIn, pos, state); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta)).withProperty(LOCKED, Boolean.valueOf(false)).withProperty(DELAY, Integer.valueOf(1 + (meta >> 2))); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + i = i | ((Integer)state.getValue(DELAY)).intValue() - 1 << 2; + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, DELAY, LOCKED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneTorch.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneTorch.java new file mode 100644 index 0000000..5ab8b2d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneTorch.java @@ -0,0 +1,213 @@ +package net.minecraft.block; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneTorch extends BlockTorch +{ + private static Map> toggles = Maps.>newHashMap(); + private final boolean isOn; + + private boolean isBurnedOut(World worldIn, BlockPos pos, boolean turnOff) + { + if (!toggles.containsKey(worldIn)) + { + toggles.put(worldIn, Lists.newArrayList()); + } + + List list = (List)toggles.get(worldIn); + + if (turnOff) + { + list.add(new BlockRedstoneTorch.Toggle(pos, worldIn.getTotalWorldTime())); + } + + int i = 0; + + for (int j = 0; j < list.size(); ++j) + { + BlockRedstoneTorch.Toggle blockredstonetorch$toggle = (BlockRedstoneTorch.Toggle)list.get(j); + + if (blockredstonetorch$toggle.pos.equals(pos)) + { + ++i; + + if (i >= 8) + { + return true; + } + } + } + + return false; + } + + protected BlockRedstoneTorch(boolean isOn) + { + this.isOn = isOn; + this.setTickRandomly(true); + this.setCreativeTab((CreativeTabs)null); + } + + public int tickRate(World worldIn) + { + return 2; + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (this.isOn) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (this.isOn) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + } + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return this.isOn && state.getValue(FACING) != side ? 15 : 0; + } + + private boolean shouldBeOff(World worldIn, BlockPos pos, IBlockState state) + { + EnumFacing enumfacing = ((EnumFacing)state.getValue(FACING)).getOpposite(); + return worldIn.isSidePowered(pos.offset(enumfacing), enumfacing); + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + boolean flag = this.shouldBeOff(worldIn, pos, state); + List list = (List)toggles.get(worldIn); + + while (list != null && !list.isEmpty() && worldIn.getTotalWorldTime() - ((BlockRedstoneTorch.Toggle)list.get(0)).time > 60L) + { + list.remove(0); + } + + if (this.isOn) + { + if (flag) + { + worldIn.setBlockState(pos, Blocks.unlit_redstone_torch.getDefaultState().withProperty(FACING, state.getValue(FACING)), 3); + + if (this.isBurnedOut(worldIn, pos, true)) + { + worldIn.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), "random.fizz", 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + + for (int i = 0; i < 5; ++i) + { + double d0 = (double)pos.getX() + rand.nextDouble() * 0.6D + 0.2D; + double d1 = (double)pos.getY() + rand.nextDouble() * 0.6D + 0.2D; + double d2 = (double)pos.getZ() + rand.nextDouble() * 0.6D + 0.2D; + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + worldIn.scheduleUpdate(pos, worldIn.getBlockState(pos).getBlock(), 160); + } + } + } + else if (!flag && !this.isBurnedOut(worldIn, pos, false)) + { + worldIn.setBlockState(pos, Blocks.redstone_torch.getDefaultState().withProperty(FACING, state.getValue(FACING)), 3); + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!this.onNeighborChangeInternal(worldIn, pos, state)) + { + if (this.isOn == this.shouldBeOff(worldIn, pos, state)) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + } + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return side == EnumFacing.DOWN ? this.getWeakPower(worldIn, pos, state, side) : 0; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + public boolean canProvidePower() + { + return true; + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this.isOn) + { + double d0 = (double)pos.getX() + 0.5D + (rand.nextDouble() - 0.5D) * 0.2D; + double d1 = (double)pos.getY() + 0.7D + (rand.nextDouble() - 0.5D) * 0.2D; + double d2 = (double)pos.getZ() + 0.5D + (rand.nextDouble() - 0.5D) * 0.2D; + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (enumfacing.getAxis().isHorizontal()) + { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + double d3 = 0.27D; + d0 += 0.27D * (double)enumfacing1.getFrontOffsetX(); + d1 += 0.22D; + d2 += 0.27D * (double)enumfacing1.getFrontOffsetZ(); + } + + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + public boolean isAssociatedBlock(Block other) + { + return other == Blocks.unlit_redstone_torch || other == Blocks.redstone_torch; + } + + static class Toggle + { + BlockPos pos; + long time; + + public Toggle(BlockPos pos, long time) + { + this.pos = pos; + this.time = time; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneWire.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneWire.java new file mode 100644 index 0000000..fb86188 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRedstoneWire.java @@ -0,0 +1,490 @@ +package net.minecraft.block; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneWire extends Block +{ + public static final PropertyEnum NORTH = PropertyEnum.create("north", BlockRedstoneWire.EnumAttachPosition.class); + public static final PropertyEnum EAST = PropertyEnum.create("east", BlockRedstoneWire.EnumAttachPosition.class); + public static final PropertyEnum SOUTH = PropertyEnum.create("south", BlockRedstoneWire.EnumAttachPosition.class); + public static final PropertyEnum WEST = PropertyEnum.create("west", BlockRedstoneWire.EnumAttachPosition.class); + public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); + private boolean canProvidePower = true; + private final Set blocksNeedingUpdate = Sets.newHashSet(); + + public BlockRedstoneWire() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(EAST, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(SOUTH, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(WEST, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(POWER, Integer.valueOf(0))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + state = state.withProperty(WEST, this.getAttachPosition(worldIn, pos, EnumFacing.WEST)); + state = state.withProperty(EAST, this.getAttachPosition(worldIn, pos, EnumFacing.EAST)); + state = state.withProperty(NORTH, this.getAttachPosition(worldIn, pos, EnumFacing.NORTH)); + state = state.withProperty(SOUTH, this.getAttachPosition(worldIn, pos, EnumFacing.SOUTH)); + return state; + } + + private BlockRedstoneWire.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, EnumFacing direction) + { + BlockPos blockpos = pos.offset(direction); + Block block = worldIn.getBlockState(pos.offset(direction)).getBlock(); + + if (!canConnectTo(worldIn.getBlockState(blockpos), direction) && (block.isBlockNormalCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.down())))) + { + Block block1 = worldIn.getBlockState(pos.up()).getBlock(); + return !block1.isBlockNormalCube() && block.isBlockNormalCube() && canConnectUpwardsTo(worldIn.getBlockState(blockpos.up())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; + } + else + { + return BlockRedstoneWire.EnumAttachPosition.SIDE; + } + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock() != this ? super.colorMultiplier(worldIn, pos, renderPass) : this.colorMultiplier(((Integer)iblockstate.getValue(POWER)).intValue()); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) || worldIn.getBlockState(pos.down()).getBlock() == Blocks.glowstone; + } + + private IBlockState updateSurroundingRedstone(World worldIn, BlockPos pos, IBlockState state) + { + state = this.calculateCurrentChanges(worldIn, pos, pos, state); + List list = Lists.newArrayList(this.blocksNeedingUpdate); + this.blocksNeedingUpdate.clear(); + + for (BlockPos blockpos : list) + { + worldIn.notifyNeighborsOfStateChange(blockpos, this); + } + + return state; + } + + private IBlockState calculateCurrentChanges(World worldIn, BlockPos pos1, BlockPos pos2, IBlockState state) + { + IBlockState iblockstate = state; + int i = ((Integer)state.getValue(POWER)).intValue(); + int j = 0; + j = this.getMaxCurrentStrength(worldIn, pos2, j); + this.canProvidePower = false; + int k = worldIn.isBlockIndirectlyGettingPowered(pos1); + this.canProvidePower = true; + + if (k > 0 && k > j - 1) + { + j = k; + } + + int l = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos1.offset(enumfacing); + boolean flag = blockpos.getX() != pos2.getX() || blockpos.getZ() != pos2.getZ(); + + if (flag) + { + l = this.getMaxCurrentStrength(worldIn, blockpos, l); + } + + if (worldIn.getBlockState(blockpos).getBlock().isNormalCube() && !worldIn.getBlockState(pos1.up()).getBlock().isNormalCube()) + { + if (flag && pos1.getY() >= pos2.getY()) + { + l = this.getMaxCurrentStrength(worldIn, blockpos.up(), l); + } + } + else if (!worldIn.getBlockState(blockpos).getBlock().isNormalCube() && flag && pos1.getY() <= pos2.getY()) + { + l = this.getMaxCurrentStrength(worldIn, blockpos.down(), l); + } + } + + if (l > j) + { + j = l - 1; + } + else if (j > 0) + { + --j; + } + else + { + j = 0; + } + + if (k > j - 1) + { + j = k; + } + + if (i != j) + { + state = state.withProperty(POWER, Integer.valueOf(j)); + + if (worldIn.getBlockState(pos1) == iblockstate) + { + worldIn.setBlockState(pos1, state, 2); + } + + this.blocksNeedingUpdate.add(pos1); + + for (EnumFacing enumfacing1 : EnumFacing.values()) + { + this.blocksNeedingUpdate.add(pos1.offset(enumfacing1)); + } + } + + return state; + } + + private void notifyWireNeighborsOfStateChange(World worldIn, BlockPos pos) + { + if (worldIn.getBlockState(pos).getBlock() == this) + { + worldIn.notifyNeighborsOfStateChange(pos, this); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + this.updateSurroundingRedstone(worldIn, pos, state); + + for (EnumFacing enumfacing : EnumFacing.Plane.VERTICAL) + { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) + { + this.notifyWireNeighborsOfStateChange(worldIn, pos.offset(enumfacing1)); + } + + for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos.offset(enumfacing2); + + if (worldIn.getBlockState(blockpos).getBlock().isNormalCube()) + { + this.notifyWireNeighborsOfStateChange(worldIn, blockpos.up()); + } + else + { + this.notifyWireNeighborsOfStateChange(worldIn, blockpos.down()); + } + } + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + super.breakBlock(worldIn, pos, state); + + if (!worldIn.isRemote) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); + } + + this.updateSurroundingRedstone(worldIn, pos, state); + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) + { + this.notifyWireNeighborsOfStateChange(worldIn, pos.offset(enumfacing1)); + } + + for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos.offset(enumfacing2); + + if (worldIn.getBlockState(blockpos).getBlock().isNormalCube()) + { + this.notifyWireNeighborsOfStateChange(worldIn, blockpos.up()); + } + else + { + this.notifyWireNeighborsOfStateChange(worldIn, blockpos.down()); + } + } + } + } + + private int getMaxCurrentStrength(World worldIn, BlockPos pos, int strength) + { + if (worldIn.getBlockState(pos).getBlock() != this) + { + return strength; + } + else + { + int i = ((Integer)worldIn.getBlockState(pos).getValue(POWER)).intValue(); + return i > strength ? i : strength; + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + if (this.canPlaceBlockAt(worldIn, pos)) + { + this.updateSurroundingRedstone(worldIn, pos, state); + } + else + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.redstone; + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return !this.canProvidePower ? 0 : this.getWeakPower(worldIn, pos, state, side); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + if (!this.canProvidePower) + { + return 0; + } + else + { + int i = ((Integer)state.getValue(POWER)).intValue(); + + if (i == 0) + { + return 0; + } + else if (side == EnumFacing.UP) + { + return i; + } + else + { + EnumSet enumset = EnumSet.noneOf(EnumFacing.class); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (this.func_176339_d(worldIn, pos, enumfacing)) + { + enumset.add(enumfacing); + } + } + + if (side.getAxis().isHorizontal() && enumset.isEmpty()) + { + return i; + } + else if (enumset.contains(side) && !enumset.contains(side.rotateYCCW()) && !enumset.contains(side.rotateY())) + { + return i; + } + else + { + return 0; + } + } + } + } + + private boolean func_176339_d(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + BlockPos blockpos = pos.offset(side); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + boolean flag = block.isNormalCube(); + boolean flag1 = worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); + return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down()))); + } + + protected static boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) + { + return canConnectUpwardsTo(worldIn.getBlockState(pos)); + } + + protected static boolean canConnectUpwardsTo(IBlockState state) + { + return canConnectTo(state, (EnumFacing)null); + } + + protected static boolean canConnectTo(IBlockState blockState, EnumFacing side) + { + Block block = blockState.getBlock(); + + if (block == Blocks.redstone_wire) + { + return true; + } + else if (Blocks.unpowered_repeater.isAssociated(block)) + { + EnumFacing enumfacing = (EnumFacing)blockState.getValue(BlockRedstoneRepeater.FACING); + return enumfacing == side || enumfacing.getOpposite() == side; + } + else + { + return block.canProvidePower() && side != null; + } + } + + public boolean canProvidePower() + { + return this.canProvidePower; + } + + private int colorMultiplier(int powerLevel) + { + float f = (float)powerLevel / 15.0F; + float f1 = f * 0.6F + 0.4F; + + if (powerLevel == 0) + { + f1 = 0.3F; + } + + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + int i = MathHelper.clamp_int((int)(f1 * 255.0F), 0, 255); + int j = MathHelper.clamp_int((int)(f2 * 255.0F), 0, 255); + int k = MathHelper.clamp_int((int)(f3 * 255.0F), 0, 255); + return -16777216 | i << 16 | j << 8 | k; + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + int i = ((Integer)state.getValue(POWER)).intValue(); + + if (i != 0) + { + double d0 = (double)pos.getX() + 0.5D + ((double)rand.nextFloat() - 0.5D) * 0.2D; + double d1 = (double)((float)pos.getY() + 0.0625F); + double d2 = (double)pos.getZ() + 0.5D + ((double)rand.nextFloat() - 0.5D) * 0.2D; + float f = (float)i / 15.0F; + float f1 = f * 0.6F + 0.4F; + float f2 = Math.max(0.0F, f * f * 0.7F - 0.5F); + float f3 = Math.max(0.0F, f * f * 0.6F - 0.7F); + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, d0, d1, d2, (double)f1, (double)f2, (double)f3, new int[0]); + } + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.redstone; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(POWER, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(POWER)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {NORTH, EAST, SOUTH, WEST, POWER}); + } + + static enum EnumAttachPosition implements IStringSerializable + { + UP("up"), + SIDE("side"), + NONE("none"); + + private final String name; + + private EnumAttachPosition(String name) + { + this.name = name; + } + + public String toString() + { + return this.getName(); + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockReed.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockReed.java new file mode 100644 index 0000000..6c23d04 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockReed.java @@ -0,0 +1,162 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockReed extends Block +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + + protected BlockReed() + { + super(Material.plants); + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0))); + float f = 0.375F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + this.setTickRandomly(true); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (worldIn.getBlockState(pos.down()).getBlock() == Blocks.reeds || this.checkForDrop(worldIn, pos, state)) + { + if (worldIn.isAirBlock(pos.up())) + { + int i; + + for (i = 1; worldIn.getBlockState(pos.down(i)).getBlock() == this; ++i) + { + ; + } + + if (i < 3) + { + int j = ((Integer)state.getValue(AGE)).intValue(); + + if (j == 15) + { + worldIn.setBlockState(pos.up(), this.getDefaultState()); + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(0)), 4); + } + else + { + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(j + 1)), 4); + } + } + } + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos.down()).getBlock(); + + if (block == this) + { + return true; + } + else if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand) + { + return false; + } + else + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.getBlockState(pos.offset(enumfacing).down()).getBlock().getMaterial() == Material.water) + { + return true; + } + } + + return false; + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + this.checkForDrop(worldIn, pos, state); + } + + protected final boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) + { + if (this.canBlockStay(worldIn, pos)) + { + return true; + } + else + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } + } + + public boolean canBlockStay(World worldIn, BlockPos pos) + { + return this.canPlaceBlockAt(worldIn, pos); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.reeds; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.reeds; + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return worldIn.getBiomeGenForCoords(pos).getGrassColorAtPos(pos); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AGE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockRotatedPillar.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRotatedPillar.java new file mode 100644 index 0000000..d54efd5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockRotatedPillar.java @@ -0,0 +1,21 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.util.EnumFacing; + +public abstract class BlockRotatedPillar extends Block +{ + public static final PropertyEnum AXIS = PropertyEnum.create("axis", EnumFacing.Axis.class); + + protected BlockRotatedPillar(Material materialIn) + { + super(materialIn, materialIn.getMaterialMapColor()); + } + + protected BlockRotatedPillar(Material p_i46385_1_, MapColor p_i46385_2_) + { + super(p_i46385_1_, p_i46385_2_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSand.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSand.java new file mode 100644 index 0000000..c3f87fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSand.java @@ -0,0 +1,117 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public class BlockSand extends BlockFalling +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockSand.EnumType.class); + + public BlockSand() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockSand.EnumType.SAND)); + } + + public int damageDropped(IBlockState state) + { + return ((BlockSand.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockSand.EnumType blocksand$enumtype : BlockSand.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blocksand$enumtype.getMetadata())); + } + } + + public MapColor getMapColor(IBlockState state) + { + return ((BlockSand.EnumType)state.getValue(VARIANT)).getMapColor(); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockSand.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockSand.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + SAND(0, "sand", "default", MapColor.sandColor), + RED_SAND(1, "red_sand", "red", MapColor.adobeColor); + + private static final BlockSand.EnumType[] META_LOOKUP = new BlockSand.EnumType[values().length]; + private final int meta; + private final String name; + private final MapColor mapColor; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName, MapColor mapColor) + { + this.meta = meta; + this.name = name; + this.mapColor = mapColor; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public MapColor getMapColor() + { + return this.mapColor; + } + + public static BlockSand.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockSand.EnumType blocksand$enumtype : values()) + { + META_LOOKUP[blocksand$enumtype.getMetadata()] = blocksand$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSandStone.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSandStone.java new file mode 100644 index 0000000..5030815 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSandStone.java @@ -0,0 +1,114 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public class BlockSandStone extends Block +{ + public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockSandStone.EnumType.class); + + public BlockSandStone() + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockSandStone.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int damageDropped(IBlockState state) + { + return ((BlockSandStone.EnumType)state.getValue(TYPE)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockSandStone.EnumType blocksandstone$enumtype : BlockSandStone.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blocksandstone$enumtype.getMetadata())); + } + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.sandColor; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(TYPE, BlockSandStone.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockSandStone.EnumType)state.getValue(TYPE)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {TYPE}); + } + + public static enum EnumType implements IStringSerializable + { + DEFAULT(0, "sandstone", "default"), + CHISELED(1, "chiseled_sandstone", "chiseled"), + SMOOTH(2, "smooth_sandstone", "smooth"); + + private static final BlockSandStone.EnumType[] META_LOOKUP = new BlockSandStone.EnumType[values().length]; + private final int metadata; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) + { + this.metadata = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.metadata; + } + + public String toString() + { + return this.name; + } + + public static BlockSandStone.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockSandStone.EnumType blocksandstone$enumtype : values()) + { + META_LOOKUP[blocksandstone$enumtype.getMetadata()] = blocksandstone$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSapling.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSapling.java new file mode 100644 index 0000000..358f0bb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSapling.java @@ -0,0 +1,247 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BlockSapling extends BlockBush implements IGrowable +{ + public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockPlanks.EnumType.class); + public static final PropertyInteger STAGE = PropertyInteger.create("stage", 0, 1); + + protected BlockSapling() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockPlanks.EnumType.OAK).withProperty(STAGE, Integer.valueOf(0))); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + "." + BlockPlanks.EnumType.OAK.getUnlocalizedName() + ".name"); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + super.updateTick(worldIn, pos, state, rand); + + if (worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) + { + this.grow(worldIn, pos, state, rand); + } + } + } + + public void grow(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (((Integer)state.getValue(STAGE)).intValue() == 0) + { + worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4); + } + else + { + this.generateTree(worldIn, pos, state, rand); + } + } + + public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + WorldGenerator worldgenerator = (WorldGenerator)(rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true)); + int i = 0; + int j = 0; + boolean flag = false; + + switch ((BlockPlanks.EnumType)state.getValue(TYPE)) + { + case SPRUCE: + label114: + for (i = 0; i >= -1; --i) + { + for (j = 0; j >= -1; --j) + { + if (this.func_181624_a(worldIn, pos, i, j, BlockPlanks.EnumType.SPRUCE)) + { + worldgenerator = new WorldGenMegaPineTree(false, rand.nextBoolean()); + flag = true; + break label114; + } + } + } + + if (!flag) + { + j = 0; + i = 0; + worldgenerator = new WorldGenTaiga2(true); + } + + break; + + case BIRCH: + worldgenerator = new WorldGenForest(true, false); + break; + + case JUNGLE: + IBlockState iblockstate = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE); + IBlockState iblockstate1 = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + label269: + + for (i = 0; i >= -1; --i) + { + for (j = 0; j >= -1; --j) + { + if (this.func_181624_a(worldIn, pos, i, j, BlockPlanks.EnumType.JUNGLE)) + { + worldgenerator = new WorldGenMegaJungle(true, 10, 20, iblockstate, iblockstate1); + flag = true; + break label269; + } + } + } + + if (!flag) + { + j = 0; + i = 0; + worldgenerator = new WorldGenTrees(true, 4 + rand.nextInt(7), iblockstate, iblockstate1, false); + } + + break; + + case ACACIA: + worldgenerator = new WorldGenSavannaTree(true); + break; + + case DARK_OAK: + label390: + for (i = 0; i >= -1; --i) + { + for (j = 0; j >= -1; --j) + { + if (this.func_181624_a(worldIn, pos, i, j, BlockPlanks.EnumType.DARK_OAK)) + { + worldgenerator = new WorldGenCanopyTree(true); + flag = true; + break label390; + } + } + } + + if (!flag) + { + return; + } + + case OAK: + } + + IBlockState iblockstate2 = Blocks.air.getDefaultState(); + + if (flag) + { + worldIn.setBlockState(pos.add(i, 0, j), iblockstate2, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j), iblockstate2, 4); + worldIn.setBlockState(pos.add(i, 0, j + 1), iblockstate2, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j + 1), iblockstate2, 4); + } + else + { + worldIn.setBlockState(pos, iblockstate2, 4); + } + + if (!worldgenerator.generate(worldIn, rand, pos.add(i, 0, j))) + { + if (flag) + { + worldIn.setBlockState(pos.add(i, 0, j), state, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j), state, 4); + worldIn.setBlockState(pos.add(i, 0, j + 1), state, 4); + worldIn.setBlockState(pos.add(i + 1, 0, j + 1), state, 4); + } + else + { + worldIn.setBlockState(pos, state, 4); + } + } + } + + private boolean func_181624_a(World p_181624_1_, BlockPos p_181624_2_, int p_181624_3_, int p_181624_4_, BlockPlanks.EnumType p_181624_5_) + { + return this.isTypeAt(p_181624_1_, p_181624_2_.add(p_181624_3_, 0, p_181624_4_), p_181624_5_) && this.isTypeAt(p_181624_1_, p_181624_2_.add(p_181624_3_ + 1, 0, p_181624_4_), p_181624_5_) && this.isTypeAt(p_181624_1_, p_181624_2_.add(p_181624_3_, 0, p_181624_4_ + 1), p_181624_5_) && this.isTypeAt(p_181624_1_, p_181624_2_.add(p_181624_3_ + 1, 0, p_181624_4_ + 1), p_181624_5_); + } + + public boolean isTypeAt(World worldIn, BlockPos pos, BlockPlanks.EnumType type) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock() == this && iblockstate.getValue(TYPE) == type; + } + + public int damageDropped(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(TYPE)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockplanks$enumtype.getMetadata())); + } + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + return true; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return (double)worldIn.rand.nextFloat() < 0.45D; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + this.grow(worldIn, pos, state, rand); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(TYPE, BlockPlanks.EnumType.byMetadata(meta & 7)).withProperty(STAGE, Integer.valueOf((meta & 8) >> 3)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockPlanks.EnumType)state.getValue(TYPE)).getMetadata(); + i = i | ((Integer)state.getValue(STAGE)).intValue() << 3; + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {TYPE, STAGE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSeaLantern.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSeaLantern.java new file mode 100644 index 0000000..53e0060 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSeaLantern.java @@ -0,0 +1,44 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.MathHelper; + +public class BlockSeaLantern extends Block +{ + public BlockSeaLantern(Material materialIn) + { + super(materialIn); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int quantityDropped(Random random) + { + return 2 + random.nextInt(2); + } + + public int quantityDroppedWithBonus(int fortune, Random random) + { + return MathHelper.clamp_int(this.quantityDropped(random) + random.nextInt(fortune + 1), 1, 5); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.prismarine_crystals; + } + + public MapColor getMapColor(IBlockState state) + { + return MapColor.quartzColor; + } + + protected boolean canSilkHarvest() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSign.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSign.java new file mode 100644 index 0000000..7ac595e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSign.java @@ -0,0 +1,90 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSign extends BlockContainer +{ + protected BlockSign() + { + super(Material.wood); + float f = 0.25F; + float f1 = 1.0F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getSelectedBoundingBox(worldIn, pos); + } + + public boolean isFullCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return true; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean canSpawnInBlock() + { + return true; + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntitySign(); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.sign; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.sign; + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntitySign ? ((TileEntitySign)tileentity).executeCommand(playerIn) : false; + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return !this.hasInvalidNeighbor(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSilverfish.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSilverfish.java new file mode 100644 index 0000000..f88c87e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSilverfish.java @@ -0,0 +1,220 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.World; + +public class BlockSilverfish extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockSilverfish.EnumType.class); + + public BlockSilverfish() + { + super(Material.clay); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockSilverfish.EnumType.STONE)); + this.setHardness(0.0F); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public int quantityDropped(Random random) + { + return 0; + } + + public static boolean canContainSilverfish(IBlockState blockState) + { + Block block = blockState.getBlock(); + return blockState == Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE) || block == Blocks.cobblestone || block == Blocks.stonebrick; + } + + protected ItemStack createStackedBlock(IBlockState state) + { + switch ((BlockSilverfish.EnumType)state.getValue(VARIANT)) + { + case COBBLESTONE: + return new ItemStack(Blocks.cobblestone); + + case STONEBRICK: + return new ItemStack(Blocks.stonebrick); + + case MOSSY_STONEBRICK: + return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.MOSSY.getMetadata()); + + case CRACKED_STONEBRICK: + return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CRACKED.getMetadata()); + + case CHISELED_STONEBRICK: + return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CHISELED.getMetadata()); + + default: + return new ItemStack(Blocks.stone); + } + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + if (!worldIn.isRemote && worldIn.getGameRules().getBoolean("doTileDrops")) + { + EntitySilverfish entitysilverfish = new EntitySilverfish(worldIn); + entitysilverfish.setLocationAndAngles((double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entitysilverfish); + entitysilverfish.spawnExplosionParticle(); + } + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockSilverfish.EnumType blocksilverfish$enumtype : BlockSilverfish.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blocksilverfish$enumtype.getMetadata())); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockSilverfish.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockSilverfish.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + STONE(0, "stone") + { + public IBlockState getModelBlock() + { + return Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE); + } + }, + COBBLESTONE(1, "cobblestone", "cobble") + { + public IBlockState getModelBlock() + { + return Blocks.cobblestone.getDefaultState(); + } + }, + STONEBRICK(2, "stone_brick", "brick") + { + public IBlockState getModelBlock() + { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.DEFAULT); + } + }, + MOSSY_STONEBRICK(3, "mossy_brick", "mossybrick") + { + public IBlockState getModelBlock() + { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.MOSSY); + } + }, + CRACKED_STONEBRICK(4, "cracked_brick", "crackedbrick") + { + public IBlockState getModelBlock() + { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.CRACKED); + } + }, + CHISELED_STONEBRICK(5, "chiseled_brick", "chiseledbrick") + { + public IBlockState getModelBlock() + { + return Blocks.stonebrick.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.CHISELED); + } + }; + + private static final BlockSilverfish.EnumType[] META_LOOKUP = new BlockSilverfish.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name) + { + this(meta, name, name); + } + + private EnumType(int meta, String name, String unlocalizedName) + { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockSilverfish.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + public abstract IBlockState getModelBlock(); + + public static BlockSilverfish.EnumType forModelBlock(IBlockState model) + { + for (BlockSilverfish.EnumType blocksilverfish$enumtype : values()) + { + if (model == blocksilverfish$enumtype.getModelBlock()) + { + return blocksilverfish$enumtype; + } + } + + return STONE; + } + + static { + for (BlockSilverfish.EnumType blocksilverfish$enumtype : values()) + { + META_LOOKUP[blocksilverfish$enumtype.getMetadata()] = blocksilverfish$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSkull.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSkull.java new file mode 100644 index 0000000..3b8f261 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSkull.java @@ -0,0 +1,276 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockWorldState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockPattern; +import net.minecraft.block.state.pattern.BlockStateHelper; +import net.minecraft.block.state.pattern.FactoryBlockPattern; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.StatCollector; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSkull extends BlockContainer +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing"); + public static final PropertyBool NODROP = PropertyBool.create("nodrop"); + private static final Predicate IS_WITHER_SKELETON = new Predicate() + { + public boolean apply(BlockWorldState p_apply_1_) + { + return p_apply_1_.getBlockState() != null && p_apply_1_.getBlockState().getBlock() == Blocks.skull && p_apply_1_.getTileEntity() instanceof TileEntitySkull && ((TileEntitySkull)p_apply_1_.getTileEntity()).getSkullType() == 1; + } + }; + private BlockPattern witherBasePattern; + private BlockPattern witherPattern; + + protected BlockSkull() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(NODROP, Boolean.valueOf(false))); + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal("tile.skull.skeleton.name"); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + switch ((EnumFacing)worldIn.getBlockState(pos).getValue(FACING)) + { + case UP: + default: + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + break; + + case NORTH: + this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); + break; + + case SOUTH: + this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); + break; + + case WEST: + this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); + break; + + case EAST: + this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); + } + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getCollisionBoundingBox(worldIn, pos, state); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing()).withProperty(NODROP, Boolean.valueOf(false)); + } + + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntitySkull(); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.skull; + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).getSkullType() : super.getDamageValue(worldIn, pos); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + if (player.capabilities.isCreativeMode) + { + state = state.withProperty(NODROP, Boolean.valueOf(true)); + worldIn.setBlockState(pos, state, 4); + } + + super.onBlockHarvested(worldIn, pos, state, player); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + if (!((Boolean)state.getValue(NODROP)).booleanValue()) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntitySkull) + { + TileEntitySkull tileentityskull = (TileEntitySkull)tileentity; + ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(worldIn, pos)); + + if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null) + { + itemstack.setTagCompound(new NBTTagCompound()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTUtil.writeGameProfile(nbttagcompound, tileentityskull.getPlayerProfile()); + itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound); + } + + spawnAsEntity(worldIn, pos, itemstack); + } + } + + super.breakBlock(worldIn, pos, state); + } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.skull; + } + + public boolean canDispenserPlace(World worldIn, BlockPos pos, ItemStack stack) + { + return stack.getMetadata() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote ? this.getWitherBasePattern().match(worldIn, pos) != null : false; + } + + public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te) + { + if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL && !worldIn.isRemote) + { + BlockPattern blockpattern = this.getWitherPattern(); + BlockPattern.PatternHelper blockpattern$patternhelper = blockpattern.match(worldIn, pos); + + if (blockpattern$patternhelper != null) + { + for (int i = 0; i < 3; ++i) + { + BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(i, 0, 0); + worldIn.setBlockState(blockworldstate.getPos(), blockworldstate.getBlockState().withProperty(NODROP, Boolean.valueOf(true)), 2); + } + + for (int j = 0; j < blockpattern.getPalmLength(); ++j) + { + for (int k = 0; k < blockpattern.getThumbLength(); ++k) + { + BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(j, k, 0); + worldIn.setBlockState(blockworldstate1.getPos(), Blocks.air.getDefaultState(), 2); + } + } + + BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 0, 0).getPos(); + EntityWither entitywither = new EntityWither(worldIn); + BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos(); + entitywither.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.55D, (double)blockpos1.getZ() + 0.5D, blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F, 0.0F); + entitywither.renderYawOffset = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? 0.0F : 90.0F; + entitywither.func_82206_m(); + + for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class, entitywither.getEntityBoundingBox().expand(50.0D, 50.0D, 50.0D))) + { + entityplayer.triggerAchievement(AchievementList.spawnWither); + } + + worldIn.spawnEntityInWorld(entitywither); + + for (int l = 0; l < 120; ++l) + { + worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)(blockpos.getY() - 2) + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]); + } + + for (int i1 = 0; i1 < blockpattern.getPalmLength(); ++i1) + { + for (int j1 = 0; j1 < blockpattern.getThumbLength(); ++j1) + { + BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(i1, j1, 0); + worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air); + } + } + } + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta & 7)).withProperty(NODROP, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getIndex(); + + if (((Boolean)state.getValue(NODROP)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, NODROP}); + } + + protected BlockPattern getWitherBasePattern() + { + if (this.witherBasePattern == null) + { + this.witherBasePattern = FactoryBlockPattern.start().aisle(new String[] {" ", "###", "~#~"}).where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.soul_sand))).where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.witherBasePattern; + } + + protected BlockPattern getWitherPattern() + { + if (this.witherPattern == null) + { + this.witherPattern = FactoryBlockPattern.start().aisle(new String[] {"^^^", "###", "~#~"}).where('#', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.soul_sand))).where('^', IS_WITHER_SKELETON).where('~', BlockWorldState.hasState(BlockStateHelper.forBlock(Blocks.air))).build(); + } + + return this.witherPattern; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSlab.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSlab.java new file mode 100644 index 0000000..1b45eaf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSlab.java @@ -0,0 +1,169 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockSlab extends Block +{ + public static final PropertyEnum HALF = PropertyEnum.create("half", BlockSlab.EnumBlockHalf.class); + + public BlockSlab(Material materialIn) + { + super(materialIn); + + if (this.isDouble()) + { + this.fullBlock = true; + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + + this.setLightOpacity(255); + } + + protected boolean canSilkHarvest() + { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + if (this.isDouble()) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this) + { + if (iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) + { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + } + } + + public void setBlockBoundsForItemRender() + { + if (this.isDouble()) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + public boolean isOpaqueCube() + { + return this.isDouble(); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + IBlockState iblockstate = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + return this.isDouble() ? iblockstate : (facing != EnumFacing.DOWN && (facing == EnumFacing.UP || (double)hitY <= 0.5D) ? iblockstate : iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.TOP)); + } + + public int quantityDropped(Random random) + { + return this.isDouble() ? 2 : 1; + } + + public boolean isFullCube() + { + return this.isDouble(); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + if (this.isDouble()) + { + return super.shouldSideBeRendered(worldIn, pos, side); + } + else if (side != EnumFacing.UP && side != EnumFacing.DOWN && !super.shouldSideBeRendered(worldIn, pos, side)) + { + return false; + } + else + { + BlockPos blockpos = pos.offset(side.getOpposite()); + IBlockState iblockstate = worldIn.getBlockState(pos); + IBlockState iblockstate1 = worldIn.getBlockState(blockpos); + boolean flag = isSlab(iblockstate.getBlock()) && iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; + boolean flag1 = isSlab(iblockstate1.getBlock()) && iblockstate1.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; + return flag1 ? (side == EnumFacing.DOWN ? true : (side == EnumFacing.UP && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || !flag)) : (side == EnumFacing.UP ? true : (side == EnumFacing.DOWN && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || flag)); + } + } + + protected static boolean isSlab(Block blockIn) + { + return blockIn == Blocks.stone_slab || blockIn == Blocks.wooden_slab || blockIn == Blocks.stone_slab2; + } + + public abstract String getUnlocalizedName(int meta); + + public int getDamageValue(World worldIn, BlockPos pos) + { + return super.getDamageValue(worldIn, pos) & 7; + } + + public abstract boolean isDouble(); + + public abstract IProperty getVariantProperty(); + + public abstract Object getVariant(ItemStack stack); + + public static enum EnumBlockHalf implements IStringSerializable + { + TOP("top"), + BOTTOM("bottom"); + + private final String name; + + private EnumBlockHalf(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSlime.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSlime.java new file mode 100644 index 0000000..1e1005e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSlime.java @@ -0,0 +1,60 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class BlockSlime extends BlockBreakable +{ + public BlockSlime() + { + super(Material.clay, false, MapColor.grassColor); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.slipperiness = 0.8F; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) + { + if (entityIn.isSneaking()) + { + super.onFallenUpon(worldIn, pos, entityIn, fallDistance); + } + else + { + entityIn.fall(fallDistance, 0.0F); + } + } + + public void onLanded(World worldIn, Entity entityIn) + { + if (entityIn.isSneaking()) + { + super.onLanded(worldIn, entityIn); + } + else if (entityIn.motionY < 0.0D) + { + entityIn.motionY = -entityIn.motionY; + } + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) + { + if (Math.abs(entityIn.motionY) < 0.1D && !entityIn.isSneaking()) + { + double d0 = 0.4D + Math.abs(entityIn.motionY) * 0.2D; + entityIn.motionX *= d0; + entityIn.motionZ *= d0; + } + + super.onEntityCollidedWithBlock(worldIn, pos, entityIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSnow.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSnow.java new file mode 100644 index 0000000..14e18d2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSnow.java @@ -0,0 +1,152 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSnow extends Block +{ + public static final PropertyInteger LAYERS = PropertyInteger.create("layers", 1, 8); + + protected BlockSnow() + { + super(Material.snow); + this.setDefaultState(this.blockState.getBaseState().withProperty(LAYERS, Integer.valueOf(1))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBoundsForItemRender(); + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return ((Integer)worldIn.getBlockState(pos).getValue(LAYERS)).intValue() < 5; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + int i = ((Integer)state.getValue(LAYERS)).intValue() - 1; + float f = 0.125F; + return new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)((float)pos.getY() + (float)i * f), (double)pos.getZ() + this.maxZ); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public void setBlockBoundsForItemRender() + { + this.getBoundsForLayers(0); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + this.getBoundsForLayers(((Integer)iblockstate.getValue(LAYERS)).intValue()); + } + + protected void getBoundsForLayers(int p_150154_1_) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, (float)p_150154_1_ / 8.0F, 1.0F); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos.down()); + Block block = iblockstate.getBlock(); + return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + this.checkAndDropBlock(worldIn, pos, state); + } + + private boolean checkAndDropBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.canPlaceBlockAt(worldIn, pos)) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } + else + { + return true; + } + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + spawnAsEntity(worldIn, pos, new ItemStack(Items.snowball, ((Integer)state.getValue(LAYERS)).intValue() + 1, 0)); + worldIn.setBlockToAir(pos); + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.snowball; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (worldIn.getLightFor(EnumSkyBlock.BLOCK, pos) > 11) + { + this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); + worldIn.setBlockToAir(pos); + } + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return side == EnumFacing.UP ? true : super.shouldSideBeRendered(worldIn, pos, side); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(LAYERS, Integer.valueOf((meta & 7) + 1)); + } + + public boolean isReplaceable(World worldIn, BlockPos pos) + { + return ((Integer)worldIn.getBlockState(pos).getValue(LAYERS)).intValue() == 1; + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(LAYERS)).intValue() - 1; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {LAYERS}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSnowBlock.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSnowBlock.java new file mode 100644 index 0000000..eb43d20 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSnowBlock.java @@ -0,0 +1,40 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public class BlockSnowBlock extends Block +{ + protected BlockSnowBlock() + { + super(Material.craftedSnow); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.snowball; + } + + public int quantityDropped(Random random) + { + return 4; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (worldIn.getLightFor(EnumSkyBlock.BLOCK, pos) > 11) + { + this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); + worldIn.setBlockToAir(pos); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSoulSand.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSoulSand.java new file mode 100644 index 0000000..04885d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSoulSand.java @@ -0,0 +1,31 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockSoulSand extends Block +{ + public BlockSoulSand() + { + super(Material.sand, MapColor.brownColor); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + float f = 0.125F; + return new AxisAlignedBB((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)((float)(pos.getY() + 1) - f), (double)(pos.getZ() + 1)); + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + entityIn.motionX *= 0.4D; + entityIn.motionZ *= 0.4D; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSourceImpl.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSourceImpl.java new file mode 100644 index 0000000..cf75468 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSourceImpl.java @@ -0,0 +1,55 @@ +package net.minecraft.block; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockSourceImpl implements IBlockSource +{ + private final World worldObj; + private final BlockPos pos; + + public BlockSourceImpl(World worldIn, BlockPos posIn) + { + this.worldObj = worldIn; + this.pos = posIn; + } + + public World getWorld() + { + return this.worldObj; + } + + public double getX() + { + return (double)this.pos.getX() + 0.5D; + } + + public double getY() + { + return (double)this.pos.getY() + 0.5D; + } + + public double getZ() + { + return (double)this.pos.getZ() + 0.5D; + } + + public BlockPos getBlockPos() + { + return this.pos; + } + + public int getBlockMetadata() + { + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + public T getBlockTileEntity() + { + return (T)this.worldObj.getTileEntity(this.pos); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockSponge.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSponge.java new file mode 100644 index 0000000..cfee1d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockSponge.java @@ -0,0 +1,184 @@ +package net.minecraft.block; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import java.util.Queue; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Tuple; +import net.minecraft.world.World; + +public class BlockSponge extends Block +{ + public static final PropertyBool WET = PropertyBool.create("wet"); + + protected BlockSponge() + { + super(Material.sponge); + this.setDefaultState(this.blockState.getBaseState().withProperty(WET, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".dry.name"); + } + + public int damageDropped(IBlockState state) + { + return ((Boolean)state.getValue(WET)).booleanValue() ? 1 : 0; + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.tryAbsorb(worldIn, pos, state); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + this.tryAbsorb(worldIn, pos, state); + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + } + + protected void tryAbsorb(World worldIn, BlockPos pos, IBlockState state) + { + if (!((Boolean)state.getValue(WET)).booleanValue() && this.absorb(worldIn, pos)) + { + worldIn.setBlockState(pos, state.withProperty(WET, Boolean.valueOf(true)), 2); + worldIn.playAuxSFX(2001, pos, Block.getIdFromBlock(Blocks.water)); + } + } + + private boolean absorb(World worldIn, BlockPos pos) + { + Queue> queue = Lists.>newLinkedList(); + ArrayList arraylist = Lists.newArrayList(); + queue.add(new Tuple(pos, Integer.valueOf(0))); + int i = 0; + + while (!((Queue)queue).isEmpty()) + { + Tuple tuple = (Tuple)queue.poll(); + BlockPos blockpos = (BlockPos)tuple.getFirst(); + int j = ((Integer)tuple.getSecond()).intValue(); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + BlockPos blockpos1 = blockpos.offset(enumfacing); + + if (worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.water) + { + worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 2); + arraylist.add(blockpos1); + ++i; + + if (j < 6) + { + queue.add(new Tuple(blockpos1, Integer.valueOf(j + 1))); + } + } + } + + if (i > 64) + { + break; + } + } + + for (BlockPos blockpos2 : arraylist) + { + worldIn.notifyNeighborsOfStateChange(blockpos2, Blocks.air); + } + + return i > 0; + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(WET, Boolean.valueOf((meta & 1) == 1)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Boolean)state.getValue(WET)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {WET}); + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (((Boolean)state.getValue(WET)).booleanValue()) + { + EnumFacing enumfacing = EnumFacing.random(rand); + + if (enumfacing != EnumFacing.UP && !World.doesBlockHaveSolidTopSurface(worldIn, pos.offset(enumfacing))) + { + double d0 = (double)pos.getX(); + double d1 = (double)pos.getY(); + double d2 = (double)pos.getZ(); + + if (enumfacing == EnumFacing.DOWN) + { + d1 = d1 - 0.05D; + d0 += rand.nextDouble(); + d2 += rand.nextDouble(); + } + else + { + d1 = d1 + rand.nextDouble() * 0.8D; + + if (enumfacing.getAxis() == EnumFacing.Axis.X) + { + d2 += rand.nextDouble(); + + if (enumfacing == EnumFacing.EAST) + { + ++d0; + } + else + { + d0 += 0.05D; + } + } + else + { + d0 += rand.nextDouble(); + + if (enumfacing == EnumFacing.SOUTH) + { + ++d2; + } + else + { + d2 += 0.05D; + } + } + } + + worldIn.spawnParticle(EnumParticleTypes.DRIP_WATER, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStainedGlass.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStainedGlass.java new file mode 100644 index 0000000..901b6fb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStainedGlass.java @@ -0,0 +1,98 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class BlockStainedGlass extends BlockBreakable +{ + public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class); + + public BlockStainedGlass(Material materialIn) + { + super(materialIn, false); + this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int damageDropped(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) + { + list.add(new ItemStack(itemIn, 1, enumdyecolor.getMetadata())); + } + } + + public MapColor getMapColor(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMapColor(); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + public int quantityDropped(Random random) + { + return 0; + } + + protected boolean canSilkHarvest() + { + return true; + } + + public boolean isFullCube() + { + return false; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta)); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + BlockBeacon.updateColorAsync(worldIn, pos); + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + BlockBeacon.updateColorAsync(worldIn, pos); + } + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {COLOR}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStainedGlassPane.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStainedGlassPane.java new file mode 100644 index 0000000..0956802 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStainedGlassPane.java @@ -0,0 +1,82 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class BlockStainedGlassPane extends BlockPane +{ + public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class); + + public BlockStainedGlassPane() + { + super(Material.glass, false); + this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(COLOR, EnumDyeColor.WHITE)); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public int damageDropped(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < EnumDyeColor.values().length; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + public MapColor getMapColor(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMapColor(); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH, COLOR}); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + BlockBeacon.updateColorAsync(worldIn, pos); + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + BlockBeacon.updateColorAsync(worldIn, pos); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStairs.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStairs.java new file mode 100644 index 0000000..4c25ad9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStairs.java @@ -0,0 +1,791 @@ +package net.minecraft.block; + +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockStairs extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyEnum HALF = PropertyEnum.create("half", BlockStairs.EnumHalf.class); + public static final PropertyEnum SHAPE = PropertyEnum.create("shape", BlockStairs.EnumShape.class); + private static final int[][] field_150150_a = new int[][] {{4, 5}, {5, 7}, {6, 7}, {4, 6}, {0, 1}, {1, 3}, {2, 3}, {0, 2}}; + private final Block modelBlock; + private final IBlockState modelState; + private boolean hasRaytraced; + private int rayTracePass; + + protected BlockStairs(IBlockState modelState) + { + super(modelState.getBlock().blockMaterial); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(HALF, BlockStairs.EnumHalf.BOTTOM).withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT)); + this.modelBlock = modelState.getBlock(); + this.modelState = modelState; + this.setHardness(this.modelBlock.blockHardness); + this.setResistance(this.modelBlock.blockResistance / 3.0F); + this.setStepSound(this.modelBlock.stepSound); + this.setLightOpacity(255); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + if (this.hasRaytraced) + { + this.setBlockBounds(0.5F * (float)(this.rayTracePass % 2), 0.5F * (float)(this.rayTracePass / 4 % 2), 0.5F * (float)(this.rayTracePass / 2 % 2), 0.5F + 0.5F * (float)(this.rayTracePass % 2), 0.5F + 0.5F * (float)(this.rayTracePass / 4 % 2), 0.5F + 0.5F * (float)(this.rayTracePass / 2 % 2)); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public void setBaseCollisionBounds(IBlockAccess worldIn, BlockPos pos) + { + if (worldIn.getBlockState(pos).getValue(HALF) == BlockStairs.EnumHalf.TOP) + { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + + public static boolean isBlockStairs(Block blockIn) + { + return blockIn instanceof BlockStairs; + } + + public static boolean isSameStair(IBlockAccess worldIn, BlockPos pos, IBlockState state) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + return isBlockStairs(block) && iblockstate.getValue(HALF) == state.getValue(HALF) && iblockstate.getValue(FACING) == state.getValue(FACING); + } + + public int func_176307_f(IBlockAccess blockAccess, BlockPos pos) + { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf)iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + + if (enumfacing == EnumFacing.EAST) + { + IBlockState iblockstate1 = blockAccess.getBlockState(pos.east()); + Block block = iblockstate1.getBlock(); + + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) + { + EnumFacing enumfacing1 = (EnumFacing)iblockstate1.getValue(FACING); + + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + return flag ? 1 : 2; + } + + if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + return flag ? 2 : 1; + } + } + } + else if (enumfacing == EnumFacing.WEST) + { + IBlockState iblockstate2 = blockAccess.getBlockState(pos.west()); + Block block1 = iblockstate2.getBlock(); + + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) + { + EnumFacing enumfacing2 = (EnumFacing)iblockstate2.getValue(FACING); + + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + return flag ? 2 : 1; + } + + if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + return flag ? 1 : 2; + } + } + } + else if (enumfacing == EnumFacing.SOUTH) + { + IBlockState iblockstate3 = blockAccess.getBlockState(pos.south()); + Block block2 = iblockstate3.getBlock(); + + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) + { + EnumFacing enumfacing3 = (EnumFacing)iblockstate3.getValue(FACING); + + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + return flag ? 2 : 1; + } + + if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + return flag ? 1 : 2; + } + } + } + else if (enumfacing == EnumFacing.NORTH) + { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.north()); + Block block3 = iblockstate4.getBlock(); + + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) + { + EnumFacing enumfacing4 = (EnumFacing)iblockstate4.getValue(FACING); + + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + return flag ? 1 : 2; + } + + if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + return flag ? 2 : 1; + } + } + } + + return 0; + } + + public int func_176305_g(IBlockAccess blockAccess, BlockPos pos) + { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf)iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + + if (enumfacing == EnumFacing.EAST) + { + IBlockState iblockstate1 = blockAccess.getBlockState(pos.west()); + Block block = iblockstate1.getBlock(); + + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) + { + EnumFacing enumfacing1 = (EnumFacing)iblockstate1.getValue(FACING); + + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + return flag ? 1 : 2; + } + + if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + return flag ? 2 : 1; + } + } + } + else if (enumfacing == EnumFacing.WEST) + { + IBlockState iblockstate2 = blockAccess.getBlockState(pos.east()); + Block block1 = iblockstate2.getBlock(); + + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) + { + EnumFacing enumfacing2 = (EnumFacing)iblockstate2.getValue(FACING); + + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + return flag ? 2 : 1; + } + + if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + return flag ? 1 : 2; + } + } + } + else if (enumfacing == EnumFacing.SOUTH) + { + IBlockState iblockstate3 = blockAccess.getBlockState(pos.north()); + Block block2 = iblockstate3.getBlock(); + + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) + { + EnumFacing enumfacing3 = (EnumFacing)iblockstate3.getValue(FACING); + + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + return flag ? 2 : 1; + } + + if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + return flag ? 1 : 2; + } + } + } + else if (enumfacing == EnumFacing.NORTH) + { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.south()); + Block block3 = iblockstate4.getBlock(); + + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) + { + EnumFacing enumfacing4 = (EnumFacing)iblockstate4.getValue(FACING); + + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + return flag ? 1 : 2; + } + + if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + return flag ? 2 : 1; + } + } + } + + return 0; + } + + public boolean func_176306_h(IBlockAccess blockAccess, BlockPos pos) + { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf)iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + float f = 0.5F; + float f1 = 1.0F; + + if (flag) + { + f = 0.0F; + f1 = 0.5F; + } + + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.0F; + float f5 = 0.5F; + boolean flag1 = true; + + if (enumfacing == EnumFacing.EAST) + { + f2 = 0.5F; + f5 = 1.0F; + IBlockState iblockstate1 = blockAccess.getBlockState(pos.east()); + Block block = iblockstate1.getBlock(); + + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) + { + EnumFacing enumfacing1 = (EnumFacing)iblockstate1.getValue(FACING); + + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + f5 = 0.5F; + flag1 = false; + } + else if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + f4 = 0.5F; + flag1 = false; + } + } + } + else if (enumfacing == EnumFacing.WEST) + { + f3 = 0.5F; + f5 = 1.0F; + IBlockState iblockstate2 = blockAccess.getBlockState(pos.west()); + Block block1 = iblockstate2.getBlock(); + + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) + { + EnumFacing enumfacing2 = (EnumFacing)iblockstate2.getValue(FACING); + + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + f5 = 0.5F; + flag1 = false; + } + else if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + f4 = 0.5F; + flag1 = false; + } + } + } + else if (enumfacing == EnumFacing.SOUTH) + { + f4 = 0.5F; + f5 = 1.0F; + IBlockState iblockstate3 = blockAccess.getBlockState(pos.south()); + Block block2 = iblockstate3.getBlock(); + + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) + { + EnumFacing enumfacing3 = (EnumFacing)iblockstate3.getValue(FACING); + + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + f3 = 0.5F; + flag1 = false; + } + else if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + f2 = 0.5F; + flag1 = false; + } + } + } + else if (enumfacing == EnumFacing.NORTH) + { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.north()); + Block block3 = iblockstate4.getBlock(); + + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) + { + EnumFacing enumfacing4 = (EnumFacing)iblockstate4.getValue(FACING); + + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + f3 = 0.5F; + flag1 = false; + } + else if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + f2 = 0.5F; + flag1 = false; + } + } + } + + this.setBlockBounds(f2, f, f4, f3, f1, f5); + return flag1; + } + + public boolean func_176304_i(IBlockAccess blockAccess, BlockPos pos) + { + IBlockState iblockstate = blockAccess.getBlockState(pos); + EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); + BlockStairs.EnumHalf blockstairs$enumhalf = (BlockStairs.EnumHalf)iblockstate.getValue(HALF); + boolean flag = blockstairs$enumhalf == BlockStairs.EnumHalf.TOP; + float f = 0.5F; + float f1 = 1.0F; + + if (flag) + { + f = 0.0F; + f1 = 0.5F; + } + + float f2 = 0.0F; + float f3 = 0.5F; + float f4 = 0.5F; + float f5 = 1.0F; + boolean flag1 = false; + + if (enumfacing == EnumFacing.EAST) + { + IBlockState iblockstate1 = blockAccess.getBlockState(pos.west()); + Block block = iblockstate1.getBlock(); + + if (isBlockStairs(block) && blockstairs$enumhalf == iblockstate1.getValue(HALF)) + { + EnumFacing enumfacing1 = (EnumFacing)iblockstate1.getValue(FACING); + + if (enumfacing1 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + f4 = 0.0F; + f5 = 0.5F; + flag1 = true; + } + else if (enumfacing1 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + f4 = 0.5F; + f5 = 1.0F; + flag1 = true; + } + } + } + else if (enumfacing == EnumFacing.WEST) + { + IBlockState iblockstate2 = blockAccess.getBlockState(pos.east()); + Block block1 = iblockstate2.getBlock(); + + if (isBlockStairs(block1) && blockstairs$enumhalf == iblockstate2.getValue(HALF)) + { + f2 = 0.5F; + f3 = 1.0F; + EnumFacing enumfacing2 = (EnumFacing)iblockstate2.getValue(FACING); + + if (enumfacing2 == EnumFacing.NORTH && !isSameStair(blockAccess, pos.north(), iblockstate)) + { + f4 = 0.0F; + f5 = 0.5F; + flag1 = true; + } + else if (enumfacing2 == EnumFacing.SOUTH && !isSameStair(blockAccess, pos.south(), iblockstate)) + { + f4 = 0.5F; + f5 = 1.0F; + flag1 = true; + } + } + } + else if (enumfacing == EnumFacing.SOUTH) + { + IBlockState iblockstate3 = blockAccess.getBlockState(pos.north()); + Block block2 = iblockstate3.getBlock(); + + if (isBlockStairs(block2) && blockstairs$enumhalf == iblockstate3.getValue(HALF)) + { + f4 = 0.0F; + f5 = 0.5F; + EnumFacing enumfacing3 = (EnumFacing)iblockstate3.getValue(FACING); + + if (enumfacing3 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + flag1 = true; + } + else if (enumfacing3 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + f2 = 0.5F; + f3 = 1.0F; + flag1 = true; + } + } + } + else if (enumfacing == EnumFacing.NORTH) + { + IBlockState iblockstate4 = blockAccess.getBlockState(pos.south()); + Block block3 = iblockstate4.getBlock(); + + if (isBlockStairs(block3) && blockstairs$enumhalf == iblockstate4.getValue(HALF)) + { + EnumFacing enumfacing4 = (EnumFacing)iblockstate4.getValue(FACING); + + if (enumfacing4 == EnumFacing.WEST && !isSameStair(blockAccess, pos.west(), iblockstate)) + { + flag1 = true; + } + else if (enumfacing4 == EnumFacing.EAST && !isSameStair(blockAccess, pos.east(), iblockstate)) + { + f2 = 0.5F; + f3 = 1.0F; + flag1 = true; + } + } + } + + if (flag1) + { + this.setBlockBounds(f2, f, f4, f3, f1, f5); + } + + return flag1; + } + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { + this.setBaseCollisionBounds(worldIn, pos); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + boolean flag = this.func_176306_h(worldIn, pos); + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + + if (flag && this.func_176304_i(worldIn, pos)) + { + super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + this.modelBlock.randomDisplayTick(worldIn, pos, state, rand); + } + + public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) + { + this.modelBlock.onBlockClicked(worldIn, pos, playerIn); + } + + public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) + { + this.modelBlock.onBlockDestroyedByPlayer(worldIn, pos, state); + } + + public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) + { + return this.modelBlock.getMixedBrightnessForBlock(worldIn, pos); + } + + public float getExplosionResistance(Entity exploder) + { + return this.modelBlock.getExplosionResistance(exploder); + } + + public EnumWorldBlockLayer getBlockLayer() + { + return this.modelBlock.getBlockLayer(); + } + + public int tickRate(World worldIn) + { + return this.modelBlock.tickRate(worldIn); + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + return this.modelBlock.getSelectedBoundingBox(worldIn, pos); + } + + public Vec3 modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3 motion) + { + return this.modelBlock.modifyAcceleration(worldIn, pos, entityIn, motion); + } + + public boolean isCollidable() + { + return this.modelBlock.isCollidable(); + } + + public boolean canCollideCheck(IBlockState state, boolean hitIfLiquid) + { + return this.modelBlock.canCollideCheck(state, hitIfLiquid); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + return this.modelBlock.canPlaceBlockAt(worldIn, pos); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.onNeighborBlockChange(worldIn, pos, this.modelState, Blocks.air); + this.modelBlock.onBlockAdded(worldIn, pos, this.modelState); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + this.modelBlock.breakBlock(worldIn, pos, this.modelState); + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) + { + this.modelBlock.onEntityCollidedWithBlock(worldIn, pos, entityIn); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + this.modelBlock.updateTick(worldIn, pos, state, rand); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + return this.modelBlock.onBlockActivated(worldIn, pos, this.modelState, playerIn, EnumFacing.DOWN, 0.0F, 0.0F, 0.0F); + } + + public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) + { + this.modelBlock.onBlockDestroyedByExplosion(worldIn, pos, explosionIn); + } + + public MapColor getMapColor(IBlockState state) + { + return this.modelBlock.getMapColor(this.modelState); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + IBlockState iblockstate = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer); + iblockstate = iblockstate.withProperty(FACING, placer.getHorizontalFacing()).withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT); + return facing != EnumFacing.DOWN && (facing == EnumFacing.UP || (double)hitY <= 0.5D) ? iblockstate.withProperty(HALF, BlockStairs.EnumHalf.BOTTOM) : iblockstate.withProperty(HALF, BlockStairs.EnumHalf.TOP); + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + MovingObjectPosition[] amovingobjectposition = new MovingObjectPosition[8]; + IBlockState iblockstate = worldIn.getBlockState(pos); + int i = ((EnumFacing)iblockstate.getValue(FACING)).getHorizontalIndex(); + boolean flag = iblockstate.getValue(HALF) == BlockStairs.EnumHalf.TOP; + int[] aint = field_150150_a[i + (flag ? 4 : 0)]; + this.hasRaytraced = true; + + for (int j = 0; j < 8; ++j) + { + this.rayTracePass = j; + + if (Arrays.binarySearch(aint, j) < 0) + { + amovingobjectposition[j] = super.collisionRayTrace(worldIn, pos, start, end); + } + } + + for (int k : aint) + { + amovingobjectposition[k] = null; + } + + MovingObjectPosition movingobjectposition1 = null; + double d1 = 0.0D; + + for (MovingObjectPosition movingobjectposition : amovingobjectposition) + { + if (movingobjectposition != null) + { + double d0 = movingobjectposition.hitVec.squareDistanceTo(end); + + if (d0 > d1) + { + movingobjectposition1 = movingobjectposition; + d1 = d0; + } + } + } + + return movingobjectposition1; + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState().withProperty(HALF, (meta & 4) > 0 ? BlockStairs.EnumHalf.TOP : BlockStairs.EnumHalf.BOTTOM); + iblockstate = iblockstate.withProperty(FACING, EnumFacing.getFront(5 - (meta & 3))); + return iblockstate; + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + + if (state.getValue(HALF) == BlockStairs.EnumHalf.TOP) + { + i |= 4; + } + + i = i | 5 - ((EnumFacing)state.getValue(FACING)).getIndex(); + return i; + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + if (this.func_176306_h(worldIn, pos)) + { + switch (this.func_176305_g(worldIn, pos)) + { + case 0: + state = state.withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT); + break; + + case 1: + state = state.withProperty(SHAPE, BlockStairs.EnumShape.INNER_RIGHT); + break; + + case 2: + state = state.withProperty(SHAPE, BlockStairs.EnumShape.INNER_LEFT); + } + } + else + { + switch (this.func_176307_f(worldIn, pos)) + { + case 0: + state = state.withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT); + break; + + case 1: + state = state.withProperty(SHAPE, BlockStairs.EnumShape.OUTER_RIGHT); + break; + + case 2: + state = state.withProperty(SHAPE, BlockStairs.EnumShape.OUTER_LEFT); + } + } + + return state; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, HALF, SHAPE}); + } + + public static enum EnumHalf implements IStringSerializable + { + TOP("top"), + BOTTOM("bottom"); + + private final String name; + + private EnumHalf(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + } + + public static enum EnumShape implements IStringSerializable + { + STRAIGHT("straight"), + INNER_LEFT("inner_left"), + INNER_RIGHT("inner_right"), + OUTER_LEFT("outer_left"), + OUTER_RIGHT("outer_right"); + + private final String name; + + private EnumShape(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStandingSign.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStandingSign.java new file mode 100644 index 0000000..08b29fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStandingSign.java @@ -0,0 +1,44 @@ +package net.minecraft.block; + +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockStandingSign extends BlockSign +{ + public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15); + + public BlockStandingSign() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(ROTATION, Integer.valueOf(0))); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.getBlockState(pos.down()).getBlock().getMaterial().isSolid()) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(ROTATION, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(ROTATION)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {ROTATION}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStaticLiquid.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStaticLiquid.java new file mode 100644 index 0000000..c145055 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStaticLiquid.java @@ -0,0 +1,103 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockStaticLiquid extends BlockLiquid +{ + protected BlockStaticLiquid(Material materialIn) + { + super(materialIn); + this.setTickRandomly(false); + + if (materialIn == Material.lava) + { + this.setTickRandomly(true); + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!this.checkForMixing(worldIn, pos, state)) + { + this.updateLiquid(worldIn, pos, state); + } + } + + private void updateLiquid(World worldIn, BlockPos pos, IBlockState state) + { + BlockDynamicLiquid blockdynamicliquid = getFlowingBlock(this.blockMaterial); + worldIn.setBlockState(pos, blockdynamicliquid.getDefaultState().withProperty(LEVEL, state.getValue(LEVEL)), 2); + worldIn.scheduleUpdate(pos, blockdynamicliquid, this.tickRate(worldIn)); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this.blockMaterial == Material.lava) + { + if (worldIn.getGameRules().getBoolean("doFireTick")) + { + int i = rand.nextInt(3); + + if (i > 0) + { + BlockPos blockpos = pos; + + for (int j = 0; j < i; ++j) + { + blockpos = blockpos.add(rand.nextInt(3) - 1, 1, rand.nextInt(3) - 1); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block.blockMaterial == Material.air) + { + if (this.isSurroundingBlockFlammable(worldIn, blockpos)) + { + worldIn.setBlockState(blockpos, Blocks.fire.getDefaultState()); + return; + } + } + else if (block.blockMaterial.blocksMovement()) + { + return; + } + } + } + else + { + for (int k = 0; k < 3; ++k) + { + BlockPos blockpos1 = pos.add(rand.nextInt(3) - 1, 0, rand.nextInt(3) - 1); + + if (worldIn.isAirBlock(blockpos1.up()) && this.getCanBlockBurn(worldIn, blockpos1)) + { + worldIn.setBlockState(blockpos1.up(), Blocks.fire.getDefaultState()); + } + } + } + } + } + } + + protected boolean isSurroundingBlockFlammable(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (this.getCanBlockBurn(worldIn, pos.offset(enumfacing))) + { + return true; + } + } + + return false; + } + + private boolean getCanBlockBurn(World worldIn, BlockPos pos) + { + return worldIn.getBlockState(pos).getBlock().getMaterial().getCanBurn(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStem.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStem.java new file mode 100644 index 0000000..24154c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStem.java @@ -0,0 +1,212 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockStem extends BlockBush implements IGrowable +{ + public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7); + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() + { + public boolean apply(EnumFacing p_apply_1_) + { + return p_apply_1_ != EnumFacing.DOWN; + } + }); + private final Block crop; + + protected BlockStem(Block crop) + { + this.setDefaultState(this.blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)).withProperty(FACING, EnumFacing.UP)); + this.crop = crop; + this.setTickRandomly(true); + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs)null); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + state = state.withProperty(FACING, EnumFacing.UP); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() == this.crop) + { + state = state.withProperty(FACING, enumfacing); + break; + } + } + + return state; + } + + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.farmland; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + super.updateTick(worldIn, pos, state, rand); + + if (worldIn.getLightFromNeighbors(pos.up()) >= 9) + { + float f = BlockCrops.getGrowthChance(this, worldIn, pos); + + if (rand.nextInt((int)(25.0F / f) + 1) == 0) + { + int i = ((Integer)state.getValue(AGE)).intValue(); + + if (i < 7) + { + state = state.withProperty(AGE, Integer.valueOf(i + 1)); + worldIn.setBlockState(pos, state, 2); + } + else + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() == this.crop) + { + return; + } + } + + pos = pos.offset(EnumFacing.Plane.HORIZONTAL.random(rand)); + Block block = worldIn.getBlockState(pos.down()).getBlock(); + + if (worldIn.getBlockState(pos).getBlock().blockMaterial == Material.air && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass)) + { + worldIn.setBlockState(pos, this.crop.getDefaultState()); + } + } + } + } + } + + public void growStem(World worldIn, BlockPos pos, IBlockState state) + { + int i = ((Integer)state.getValue(AGE)).intValue() + MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); + worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(Math.min(7, i))), 2); + } + + public int getRenderColor(IBlockState state) + { + if (state.getBlock() != this) + { + return super.getRenderColor(state); + } + else + { + int i = ((Integer)state.getValue(AGE)).intValue(); + int j = i * 32; + int k = 255 - i * 8; + int l = i * 4; + return j << 16 | k << 8 | l; + } + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return this.getRenderColor(worldIn.getBlockState(pos)); + } + + public void setBlockBoundsForItemRender() + { + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.maxY = (double)((float)(((Integer)worldIn.getBlockState(pos).getValue(AGE)).intValue() * 2 + 2) / 16.0F); + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, (float)this.maxY, 0.5F + f); + } + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + + if (!worldIn.isRemote) + { + Item item = this.getSeedItem(); + + if (item != null) + { + int i = ((Integer)state.getValue(AGE)).intValue(); + + for (int j = 0; j < 3; ++j) + { + if (worldIn.rand.nextInt(15) <= i) + { + spawnAsEntity(worldIn, pos, new ItemStack(item)); + } + } + } + } + } + + protected Item getSeedItem() + { + return this.crop == Blocks.pumpkin ? Items.pumpkin_seeds : (this.crop == Blocks.melon_block ? Items.melon_seeds : null); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public Item getItem(World worldIn, BlockPos pos) + { + Item item = this.getSeedItem(); + return item != null ? item : null; + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + return ((Integer)state.getValue(AGE)).intValue() != 7; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return true; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + this.growStem(worldIn, pos, state); + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {AGE, FACING}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStone.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStone.java new file mode 100644 index 0000000..0634595 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStone.java @@ -0,0 +1,143 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.StatCollector; + +public class BlockStone extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockStone.EnumType.class); + + public BlockStone() + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockStone.EnumType.STONE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + "." + BlockStone.EnumType.STONE.getUnlocalizedName() + ".name"); + } + + public MapColor getMapColor(IBlockState state) + { + return ((BlockStone.EnumType)state.getValue(VARIANT)).func_181072_c(); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return state.getValue(VARIANT) == BlockStone.EnumType.STONE ? Item.getItemFromBlock(Blocks.cobblestone) : Item.getItemFromBlock(Blocks.stone); + } + + public int damageDropped(IBlockState state) + { + return ((BlockStone.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockStone.EnumType blockstone$enumtype : BlockStone.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockstone$enumtype.getMetadata())); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockStone.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockStone.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + STONE(0, MapColor.stoneColor, "stone"), + GRANITE(1, MapColor.dirtColor, "granite"), + GRANITE_SMOOTH(2, MapColor.dirtColor, "smooth_granite", "graniteSmooth"), + DIORITE(3, MapColor.quartzColor, "diorite"), + DIORITE_SMOOTH(4, MapColor.quartzColor, "smooth_diorite", "dioriteSmooth"), + ANDESITE(5, MapColor.stoneColor, "andesite"), + ANDESITE_SMOOTH(6, MapColor.stoneColor, "smooth_andesite", "andesiteSmooth"); + + private static final BlockStone.EnumType[] META_LOOKUP = new BlockStone.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + private final MapColor field_181073_l; + + private EnumType(int p_i46383_3_, MapColor p_i46383_4_, String p_i46383_5_) + { + this(p_i46383_3_, p_i46383_4_, p_i46383_5_, p_i46383_5_); + } + + private EnumType(int p_i46384_3_, MapColor p_i46384_4_, String p_i46384_5_, String p_i46384_6_) + { + this.meta = p_i46384_3_; + this.name = p_i46384_5_; + this.unlocalizedName = p_i46384_6_; + this.field_181073_l = p_i46384_4_; + } + + public int getMetadata() + { + return this.meta; + } + + public MapColor func_181072_c() + { + return this.field_181073_l; + } + + public String toString() + { + return this.name; + } + + public static BlockStone.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockStone.EnumType blockstone$enumtype : values()) + { + META_LOOKUP[blockstone$enumtype.getMetadata()] = blockstone$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneBrick.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneBrick.java new file mode 100644 index 0000000..3bde0d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneBrick.java @@ -0,0 +1,113 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IStringSerializable; + +public class BlockStoneBrick extends Block +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockStoneBrick.EnumType.class); + public static final int DEFAULT_META = BlockStoneBrick.EnumType.DEFAULT.getMetadata(); + public static final int MOSSY_META = BlockStoneBrick.EnumType.MOSSY.getMetadata(); + public static final int CRACKED_META = BlockStoneBrick.EnumType.CRACKED.getMetadata(); + public static final int CHISELED_META = BlockStoneBrick.EnumType.CHISELED.getMetadata(); + + public BlockStoneBrick() + { + super(Material.rock); + this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockStoneBrick.EnumType.DEFAULT)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public int damageDropped(IBlockState state) + { + return ((BlockStoneBrick.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockStoneBrick.EnumType blockstonebrick$enumtype : BlockStoneBrick.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockstonebrick$enumtype.getMetadata())); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockStoneBrick.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockStoneBrick.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + DEFAULT(0, "stonebrick", "default"), + MOSSY(1, "mossy_stonebrick", "mossy"), + CRACKED(2, "cracked_stonebrick", "cracked"), + CHISELED(3, "chiseled_stonebrick", "chiseled"); + + private static final BlockStoneBrick.EnumType[] META_LOOKUP = new BlockStoneBrick.EnumType[values().length]; + private final int meta; + private final String name; + private final String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) + { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockStoneBrick.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockStoneBrick.EnumType blockstonebrick$enumtype : values()) + { + META_LOOKUP[blockstonebrick$enumtype.getMetadata()] = blockstonebrick$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneSlab.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneSlab.java new file mode 100644 index 0000000..81805ce --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneSlab.java @@ -0,0 +1,205 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.World; + +public abstract class BlockStoneSlab extends BlockSlab +{ + public static final PropertyBool SEAMLESS = PropertyBool.create("seamless"); + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockStoneSlab.EnumType.class); + + public BlockStoneSlab() + { + super(Material.rock); + IBlockState iblockstate = this.blockState.getBaseState(); + + if (this.isDouble()) + { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf(false)); + } + else + { + iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + } + + this.setDefaultState(iblockstate.withProperty(VARIANT, BlockStoneSlab.EnumType.STONE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.stone_slab); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.stone_slab); + } + + public String getUnlocalizedName(int meta) + { + return super.getUnlocalizedName() + "." + BlockStoneSlab.EnumType.byMetadata(meta).getUnlocalizedName(); + } + + public IProperty getVariantProperty() + { + return VARIANT; + } + + public Object getVariant(ItemStack stack) + { + return BlockStoneSlab.EnumType.byMetadata(stack.getMetadata() & 7); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + if (itemIn != Item.getItemFromBlock(Blocks.double_stone_slab)) + { + for (BlockStoneSlab.EnumType blockstoneslab$enumtype : BlockStoneSlab.EnumType.values()) + { + if (blockstoneslab$enumtype != BlockStoneSlab.EnumType.WOOD) + { + list.add(new ItemStack(itemIn, 1, blockstoneslab$enumtype.getMetadata())); + } + } + } + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, BlockStoneSlab.EnumType.byMetadata(meta & 7)); + + if (this.isDouble()) + { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf((meta & 8) != 0)); + } + else + { + iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP); + } + + return iblockstate; + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockStoneSlab.EnumType)state.getValue(VARIANT)).getMetadata(); + + if (this.isDouble()) + { + if (((Boolean)state.getValue(SEAMLESS)).booleanValue()) + { + i |= 8; + } + } + else if (state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return this.isDouble() ? new BlockState(this, new IProperty[] {SEAMLESS, VARIANT}): new BlockState(this, new IProperty[] {HALF, VARIANT}); + } + + public int damageDropped(IBlockState state) + { + return ((BlockStoneSlab.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public MapColor getMapColor(IBlockState state) + { + return ((BlockStoneSlab.EnumType)state.getValue(VARIANT)).func_181074_c(); + } + + public static enum EnumType implements IStringSerializable + { + STONE(0, MapColor.stoneColor, "stone"), + SAND(1, MapColor.sandColor, "sandstone", "sand"), + WOOD(2, MapColor.woodColor, "wood_old", "wood"), + COBBLESTONE(3, MapColor.stoneColor, "cobblestone", "cobble"), + BRICK(4, MapColor.redColor, "brick"), + SMOOTHBRICK(5, MapColor.stoneColor, "stone_brick", "smoothStoneBrick"), + NETHERBRICK(6, MapColor.netherrackColor, "nether_brick", "netherBrick"), + QUARTZ(7, MapColor.quartzColor, "quartz"); + + private static final BlockStoneSlab.EnumType[] META_LOOKUP = new BlockStoneSlab.EnumType[values().length]; + private final int meta; + private final MapColor field_181075_k; + private final String name; + private final String unlocalizedName; + + private EnumType(int p_i46381_3_, MapColor p_i46381_4_, String p_i46381_5_) + { + this(p_i46381_3_, p_i46381_4_, p_i46381_5_, p_i46381_5_); + } + + private EnumType(int p_i46382_3_, MapColor p_i46382_4_, String p_i46382_5_, String p_i46382_6_) + { + this.meta = p_i46382_3_; + this.field_181075_k = p_i46382_4_; + this.name = p_i46382_5_; + this.unlocalizedName = p_i46382_6_; + } + + public int getMetadata() + { + return this.meta; + } + + public MapColor func_181074_c() + { + return this.field_181075_k; + } + + public String toString() + { + return this.name; + } + + public static BlockStoneSlab.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockStoneSlab.EnumType blockstoneslab$enumtype : values()) + { + META_LOOKUP[blockstoneslab$enumtype.getMetadata()] = blockstoneslab$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneSlabNew.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneSlabNew.java new file mode 100644 index 0000000..4401ff3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockStoneSlabNew.java @@ -0,0 +1,194 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public abstract class BlockStoneSlabNew extends BlockSlab +{ + public static final PropertyBool SEAMLESS = PropertyBool.create("seamless"); + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockStoneSlabNew.EnumType.class); + + public BlockStoneSlabNew() + { + super(Material.rock); + IBlockState iblockstate = this.blockState.getBaseState(); + + if (this.isDouble()) + { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf(false)); + } + else + { + iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + } + + this.setDefaultState(iblockstate.withProperty(VARIANT, BlockStoneSlabNew.EnumType.RED_SANDSTONE)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".red_sandstone.name"); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.stone_slab2); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.stone_slab2); + } + + public String getUnlocalizedName(int meta) + { + return super.getUnlocalizedName() + "." + BlockStoneSlabNew.EnumType.byMetadata(meta).getUnlocalizedName(); + } + + public IProperty getVariantProperty() + { + return VARIANT; + } + + public Object getVariant(ItemStack stack) + { + return BlockStoneSlabNew.EnumType.byMetadata(stack.getMetadata() & 7); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + if (itemIn != Item.getItemFromBlock(Blocks.double_stone_slab2)) + { + for (BlockStoneSlabNew.EnumType blockstoneslabnew$enumtype : BlockStoneSlabNew.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockstoneslabnew$enumtype.getMetadata())); + } + } + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, BlockStoneSlabNew.EnumType.byMetadata(meta & 7)); + + if (this.isDouble()) + { + iblockstate = iblockstate.withProperty(SEAMLESS, Boolean.valueOf((meta & 8) != 0)); + } + else + { + iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP); + } + + return iblockstate; + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockStoneSlabNew.EnumType)state.getValue(VARIANT)).getMetadata(); + + if (this.isDouble()) + { + if (((Boolean)state.getValue(SEAMLESS)).booleanValue()) + { + i |= 8; + } + } + else if (state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return this.isDouble() ? new BlockState(this, new IProperty[] {SEAMLESS, VARIANT}): new BlockState(this, new IProperty[] {HALF, VARIANT}); + } + + public MapColor getMapColor(IBlockState state) + { + return ((BlockStoneSlabNew.EnumType)state.getValue(VARIANT)).func_181068_c(); + } + + public int damageDropped(IBlockState state) + { + return ((BlockStoneSlabNew.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public static enum EnumType implements IStringSerializable + { + RED_SANDSTONE(0, "red_sandstone", BlockSand.EnumType.RED_SAND.getMapColor()); + + private static final BlockStoneSlabNew.EnumType[] META_LOOKUP = new BlockStoneSlabNew.EnumType[values().length]; + private final int meta; + private final String name; + private final MapColor field_181069_e; + + private EnumType(int p_i46391_3_, String p_i46391_4_, MapColor p_i46391_5_) + { + this.meta = p_i46391_3_; + this.name = p_i46391_4_; + this.field_181069_e = p_i46391_5_; + } + + public int getMetadata() + { + return this.meta; + } + + public MapColor func_181068_c() + { + return this.field_181069_e; + } + + public String toString() + { + return this.name; + } + + public static BlockStoneSlabNew.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.name; + } + + static { + for (BlockStoneSlabNew.EnumType blockstoneslabnew$enumtype : values()) + { + META_LOOKUP[blockstoneslabnew$enumtype.getMetadata()] = blockstoneslabnew$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockTNT.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTNT.java new file mode 100644 index 0000000..0aa790b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTNT.java @@ -0,0 +1,140 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class BlockTNT extends Block +{ + public static final PropertyBool EXPLODE = PropertyBool.create("explode"); + + public BlockTNT() + { + super(Material.tnt); + this.setDefaultState(this.blockState.getBaseState().withProperty(EXPLODE, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + super.onBlockAdded(worldIn, pos, state); + + if (worldIn.isBlockPowered(pos)) + { + this.onBlockDestroyedByPlayer(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true))); + worldIn.setBlockToAir(pos); + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (worldIn.isBlockPowered(pos)) + { + this.onBlockDestroyedByPlayer(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true))); + worldIn.setBlockToAir(pos); + } + } + + public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) + { + if (!worldIn.isRemote) + { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy()); + entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8; + worldIn.spawnEntityInWorld(entitytntprimed); + } + } + + public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) + { + this.explode(worldIn, pos, state, (EntityLivingBase)null); + } + + public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) + { + if (!worldIn.isRemote) + { + if (((Boolean)state.getValue(EXPLODE)).booleanValue()) + { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), igniter); + worldIn.spawnEntityInWorld(entitytntprimed); + worldIn.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); + } + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (playerIn.getCurrentEquippedItem() != null) + { + Item item = playerIn.getCurrentEquippedItem().getItem(); + + if (item == Items.flint_and_steel || item == Items.fire_charge) + { + this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn); + worldIn.setBlockToAir(pos); + + if (item == Items.flint_and_steel) + { + playerIn.getCurrentEquippedItem().damageItem(1, playerIn); + } + else if (!playerIn.capabilities.isCreativeMode) + { + --playerIn.getCurrentEquippedItem().stackSize; + } + + return true; + } + } + + return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (!worldIn.isRemote && entityIn instanceof EntityArrow) + { + EntityArrow entityarrow = (EntityArrow)entityIn; + + if (entityarrow.isBurning()) + { + this.explode(worldIn, pos, worldIn.getBlockState(pos).withProperty(EXPLODE, Boolean.TRUE), entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null); + worldIn.setBlockToAir(pos); + } + } + } + + public boolean canDropFromExplosion(Explosion explosionIn) + { + return false; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(EXPLODE, Boolean.valueOf((meta & 1) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + return ((Boolean)state.getValue(EXPLODE)).booleanValue() ? 1 : 0; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {EXPLODE}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockTallGrass.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTallGrass.java new file mode 100644 index 0000000..f29f328 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTallGrass.java @@ -0,0 +1,199 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IStringSerializable; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTallGrass extends BlockBush implements IGrowable +{ + public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockTallGrass.EnumType.class); + + protected BlockTallGrass() + { + super(Material.vine); + this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockTallGrass.EnumType.DEAD_BUSH)); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + } + + public int getBlockColor() + { + return ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { + return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); + } + + public boolean isReplaceable(World worldIn, BlockPos pos) + { + return true; + } + + public int getRenderColor(IBlockState state) + { + if (state.getBlock() != this) + { + return super.getRenderColor(state); + } + else + { + BlockTallGrass.EnumType blocktallgrass$enumtype = (BlockTallGrass.EnumType)state.getValue(TYPE); + return blocktallgrass$enumtype == BlockTallGrass.EnumType.DEAD_BUSH ? 16777215 : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return worldIn.getBiomeGenForCoords(pos).getGrassColorAtPos(pos); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return rand.nextInt(8) == 0 ? Items.wheat_seeds : null; + } + + public int quantityDroppedWithBonus(int fortune, Random random) + { + return 1 + random.nextInt(fortune * 2 + 1); + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 1, ((BlockTallGrass.EnumType)state.getValue(TYPE)).getMeta())); + } + else + { + super.harvestBlock(worldIn, player, pos, state, te); + } + } + + public int getDamageValue(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 1; i < 3; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) + { + return state.getValue(TYPE) != BlockTallGrass.EnumType.DEAD_BUSH; + } + + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + return true; + } + + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) + { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.GRASS; + + if (state.getValue(TYPE) == BlockTallGrass.EnumType.FERN) + { + blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.FERN; + } + + if (Blocks.double_plant.canPlaceBlockAt(worldIn, pos)) + { + Blocks.double_plant.placeAt(worldIn, pos, blockdoubleplant$enumplanttype, 2); + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(TYPE, BlockTallGrass.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockTallGrass.EnumType)state.getValue(TYPE)).getMeta(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {TYPE}); + } + + public Block.EnumOffsetType getOffsetType() + { + return Block.EnumOffsetType.XYZ; + } + + public static enum EnumType implements IStringSerializable + { + DEAD_BUSH(0, "dead_bush"), + GRASS(1, "tall_grass"), + FERN(2, "fern"); + + private static final BlockTallGrass.EnumType[] META_LOOKUP = new BlockTallGrass.EnumType[values().length]; + private final int meta; + private final String name; + + private EnumType(int meta, String name) + { + this.meta = meta; + this.name = name; + } + + public int getMeta() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockTallGrass.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + static { + for (BlockTallGrass.EnumType blocktallgrass$enumtype : values()) + { + META_LOOKUP[blocktallgrass$enumtype.getMeta()] = blocktallgrass$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockTorch.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTorch.java new file mode 100644 index 0000000..ee82f7d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTorch.java @@ -0,0 +1,293 @@ +package net.minecraft.block; + +import com.google.common.base.Predicate; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class BlockTorch extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate() + { + public boolean apply(EnumFacing p_apply_1_) + { + return p_apply_1_ != EnumFacing.DOWN; + } + }); + + protected BlockTorch() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + private boolean canPlaceOn(World worldIn, BlockPos pos) + { + if (World.doesBlockHaveSolidTopSurface(worldIn, pos)) + { + return true; + } + else + { + Block block = worldIn.getBlockState(pos).getBlock(); + return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block == Blocks.stained_glass; + } + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : FACING.getAllowedValues()) + { + if (this.canPlaceAt(worldIn, pos, enumfacing)) + { + return true; + } + } + + return false; + } + + private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing) + { + BlockPos blockpos = pos.offset(facing.getOpposite()); + boolean flag = facing.getAxis().isHorizontal(); + return flag && worldIn.isBlockNormalCube(blockpos, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + if (this.canPlaceAt(worldIn, pos, facing)) + { + return this.getDefaultState().withProperty(FACING, facing); + } + else + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true)) + { + return this.getDefaultState().withProperty(FACING, enumfacing); + } + } + + return this.getDefaultState(); + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + this.checkForDrop(worldIn, pos, state); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + this.onNeighborChangeInternal(worldIn, pos, state); + } + + protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.checkForDrop(worldIn, pos, state)) + { + return true; + } + else + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + EnumFacing.Axis enumfacing$axis = enumfacing.getAxis(); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + boolean flag = false; + + if (enumfacing$axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true)) + { + flag = true; + } + else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1))) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return true; + } + else + { + return false; + } + } + } + + protected boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) + { + if (state.getBlock() == this && this.canPlaceAt(worldIn, pos, (EnumFacing)state.getValue(FACING))) + { + return true; + } + else + { + if (worldIn.getBlockState(pos).getBlock() == this) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + return false; + } + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING); + float f = 0.15F; + + if (enumfacing == EnumFacing.EAST) + { + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + } + else if (enumfacing == EnumFacing.WEST) + { + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + } + else if (enumfacing == EnumFacing.SOUTH) + { + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + } + else if (enumfacing == EnumFacing.NORTH) + { + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + } + else + { + f = 0.1F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); + } + + return super.collisionRayTrace(worldIn, pos, start, end); + } + + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + double d0 = (double)pos.getX() + 0.5D; + double d1 = (double)pos.getY() + 0.7D; + double d2 = (double)pos.getZ() + 0.5D; + double d3 = 0.22D; + double d4 = 0.27D; + + if (enumfacing.getAxis().isHorizontal()) + { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D, new int[0]); + } + else + { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState(); + + switch (meta) + { + case 1: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.EAST); + break; + + case 2: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.WEST); + break; + + case 3: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.SOUTH); + break; + + case 4: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.NORTH); + break; + + case 5: + default: + iblockstate = iblockstate.withProperty(FACING, EnumFacing.UP); + } + + return iblockstate; + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + + switch ((EnumFacing)state.getValue(FACING)) + { + case EAST: + i = i | 1; + break; + + case WEST: + i = i | 2; + break; + + case SOUTH: + i = i | 3; + break; + + case NORTH: + i = i | 4; + break; + + case DOWN: + case UP: + default: + i = i | 5; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockTrapDoor.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTrapDoor.java new file mode 100644 index 0000000..713c212 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTrapDoor.java @@ -0,0 +1,287 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTrapDoor extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool OPEN = PropertyBool.create("open"); + public static final PropertyEnum HALF = PropertyEnum.create("half", BlockTrapDoor.DoorHalf.class); + + protected BlockTrapDoor(Material materialIn) + { + super(materialIn); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, Boolean.valueOf(false)).withProperty(HALF, BlockTrapDoor.DoorHalf.BOTTOM)); + float f = 0.5F; + float f1 = 1.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return !((Boolean)worldIn.getBlockState(pos).getValue(OPEN)).booleanValue(); + } + + public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getSelectedBoundingBox(worldIn, pos); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.getCollisionBoundingBox(worldIn, pos, state); + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + this.setBounds(worldIn.getBlockState(pos)); + } + + public void setBlockBoundsForItemRender() + { + float f = 0.1875F; + this.setBlockBounds(0.0F, 0.40625F, 0.0F, 1.0F, 0.59375F, 1.0F); + } + + public void setBounds(IBlockState state) + { + if (state.getBlock() == this) + { + boolean flag = state.getValue(HALF) == BlockTrapDoor.DoorHalf.TOP; + Boolean obool = (Boolean)state.getValue(OPEN); + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + float f = 0.1875F; + + if (flag) + { + this.setBlockBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1875F, 1.0F); + } + + if (obool.booleanValue()) + { + if (enumfacing == EnumFacing.NORTH) + { + this.setBlockBounds(0.0F, 0.0F, 0.8125F, 1.0F, 1.0F, 1.0F); + } + + if (enumfacing == EnumFacing.SOUTH) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.1875F); + } + + if (enumfacing == EnumFacing.WEST) + { + this.setBlockBounds(0.8125F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + if (enumfacing == EnumFacing.EAST) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.1875F, 1.0F, 1.0F); + } + } + } + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (this.blockMaterial == Material.iron) + { + return true; + } + else + { + state = state.cycleProperty(OPEN); + worldIn.setBlockState(pos, state, 2); + worldIn.playAuxSFXAtEntity(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0); + return true; + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote) + { + BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); + + if (!isValidSupportBlock(worldIn.getBlockState(blockpos).getBlock())) + { + worldIn.setBlockToAir(pos); + this.dropBlockAsItem(worldIn, pos, state, 0); + } + else + { + boolean flag = worldIn.isBlockPowered(pos); + + if (flag || neighborBlock.canProvidePower()) + { + boolean flag1 = ((Boolean)state.getValue(OPEN)).booleanValue(); + + if (flag1 != flag) + { + worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(flag)), 2); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, flag ? 1003 : 1006, pos, 0); + } + } + } + } + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + return super.collisionRayTrace(worldIn, pos, start, end); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + IBlockState iblockstate = this.getDefaultState(); + + if (facing.getAxis().isHorizontal()) + { + iblockstate = iblockstate.withProperty(FACING, facing).withProperty(OPEN, Boolean.valueOf(false)); + iblockstate = iblockstate.withProperty(HALF, hitY > 0.5F ? BlockTrapDoor.DoorHalf.TOP : BlockTrapDoor.DoorHalf.BOTTOM); + } + + return iblockstate; + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + return !side.getAxis().isVertical() && isValidSupportBlock(worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock()); + } + + protected static EnumFacing getFacing(int meta) + { + switch (meta & 3) + { + case 0: + return EnumFacing.NORTH; + + case 1: + return EnumFacing.SOUTH; + + case 2: + return EnumFacing.WEST; + + case 3: + default: + return EnumFacing.EAST; + } + } + + protected static int getMetaForFacing(EnumFacing facing) + { + switch (facing) + { + case NORTH: + return 0; + + case SOUTH: + return 1; + + case WEST: + return 2; + + case EAST: + default: + return 3; + } + } + + private static boolean isValidSupportBlock(Block blockIn) + { + return blockIn.blockMaterial.isOpaque() && blockIn.isFullCube() || blockIn == Blocks.glowstone || blockIn instanceof BlockSlab || blockIn instanceof BlockStairs; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, getFacing(meta)).withProperty(OPEN, Boolean.valueOf((meta & 4) != 0)).withProperty(HALF, (meta & 8) == 0 ? BlockTrapDoor.DoorHalf.BOTTOM : BlockTrapDoor.DoorHalf.TOP); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | getMetaForFacing((EnumFacing)state.getValue(FACING)); + + if (((Boolean)state.getValue(OPEN)).booleanValue()) + { + i |= 4; + } + + if (state.getValue(HALF) == BlockTrapDoor.DoorHalf.TOP) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, OPEN, HALF}); + } + + public static enum DoorHalf implements IStringSerializable + { + TOP("top"), + BOTTOM("bottom"); + + private final String name; + + private DoorHalf(String name) + { + this.name = name; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockTripWire.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTripWire.java new file mode 100644 index 0000000..cd32108 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTripWire.java @@ -0,0 +1,275 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTripWire extends Block +{ + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyBool SUSPENDED = PropertyBool.create("suspended"); + public static final PropertyBool ATTACHED = PropertyBool.create("attached"); + public static final PropertyBool DISARMED = PropertyBool.create("disarmed"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + + public BlockTripWire() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(DISARMED, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false))); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F); + this.setTickRandomly(true); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state.withProperty(NORTH, Boolean.valueOf(isConnectedTo(worldIn, pos, state, EnumFacing.NORTH))).withProperty(EAST, Boolean.valueOf(isConnectedTo(worldIn, pos, state, EnumFacing.EAST))).withProperty(SOUTH, Boolean.valueOf(isConnectedTo(worldIn, pos, state, EnumFacing.SOUTH))).withProperty(WEST, Boolean.valueOf(isConnectedTo(worldIn, pos, state, EnumFacing.WEST))); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.TRANSLUCENT; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.string; + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Items.string; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + boolean flag = ((Boolean)state.getValue(SUSPENDED)).booleanValue(); + boolean flag1 = !World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + + if (flag != flag1) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + boolean flag = ((Boolean)iblockstate.getValue(ATTACHED)).booleanValue(); + boolean flag1 = ((Boolean)iblockstate.getValue(SUSPENDED)).booleanValue(); + + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F); + } + else if (!flag) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F); + } + } + + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + state = state.withProperty(SUSPENDED, Boolean.valueOf(!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()))); + worldIn.setBlockState(pos, state, 3); + this.notifyHook(worldIn, pos, state); + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + this.notifyHook(worldIn, pos, state.withProperty(POWERED, Boolean.valueOf(true))); + } + + public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + { + if (!worldIn.isRemote) + { + if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + worldIn.setBlockState(pos, state.withProperty(DISARMED, Boolean.TRUE), 4); + } + } + } + + private void notifyHook(World worldIn, BlockPos pos, IBlockState state) + { + for (EnumFacing enumfacing : new EnumFacing[] {EnumFacing.SOUTH, EnumFacing.WEST}) + { + for (int i = 1; i < 42; ++i) + { + BlockPos blockpos = pos.offset(enumfacing, i); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() == Blocks.tripwire_hook) + { + if (iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing.getOpposite()) + { + Blocks.tripwire_hook.func_176260_a(worldIn, blockpos, iblockstate, false, true, i, state); + } + + break; + } + + if (iblockstate.getBlock() != Blocks.tripwire) + { + break; + } + } + } + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (!worldIn.isRemote) + { + if (!((Boolean)state.getValue(POWERED)).booleanValue()) + { + this.updateState(worldIn, pos); + } + } + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + if (((Boolean)worldIn.getBlockState(pos).getValue(POWERED)).booleanValue()) + { + this.updateState(worldIn, pos); + } + } + } + + private void updateState(World worldIn, BlockPos pos) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + boolean flag = ((Boolean)iblockstate.getValue(POWERED)).booleanValue(); + boolean flag1 = false; + List list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, new AxisAlignedBB((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ)); + + if (!list.isEmpty()) + { + for (Entity entity : list) + { + if (!entity.doesEntityNotTriggerPressurePlate()) + { + flag1 = true; + break; + } + } + } + + if (flag1 != flag) + { + iblockstate = iblockstate.withProperty(POWERED, Boolean.valueOf(flag1)); + worldIn.setBlockState(pos, iblockstate, 3); + this.notifyHook(worldIn, pos, iblockstate); + } + + if (flag1) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + } + } + + public static boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing direction) + { + BlockPos blockpos = pos.offset(direction); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (block == Blocks.tripwire_hook) + { + EnumFacing enumfacing = direction.getOpposite(); + return iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing; + } + else if (block == Blocks.tripwire) + { + boolean flag = ((Boolean)state.getValue(SUSPENDED)).booleanValue(); + boolean flag1 = ((Boolean)iblockstate.getValue(SUSPENDED)).booleanValue(); + return flag == flag1; + } + else + { + return false; + } + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(POWERED, Boolean.valueOf((meta & 1) > 0)).withProperty(SUSPENDED, Boolean.valueOf((meta & 2) > 0)).withProperty(ATTACHED, Boolean.valueOf((meta & 4) > 0)).withProperty(DISARMED, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 1; + } + + if (((Boolean)state.getValue(SUSPENDED)).booleanValue()) + { + i |= 2; + } + + if (((Boolean)state.getValue(ATTACHED)).booleanValue()) + { + i |= 4; + } + + if (((Boolean)state.getValue(DISARMED)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {POWERED, SUSPENDED, ATTACHED, DISARMED, NORTH, EAST, WEST, SOUTH}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockTripWireHook.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTripWireHook.java new file mode 100644 index 0000000..4f99a51 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockTripWireHook.java @@ -0,0 +1,341 @@ +package net.minecraft.block; + +import com.google.common.base.Objects; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTripWireHook extends Block +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool POWERED = PropertyBool.create("powered"); + public static final PropertyBool ATTACHED = PropertyBool.create("attached"); + public static final PropertyBool SUSPENDED = PropertyBool.create("suspended"); + + public BlockTripWireHook() + { + super(Material.circuits); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false))); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state.withProperty(SUSPENDED, Boolean.valueOf(!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()))); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + return side.getAxis().isHorizontal() && worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock().isNormalCube(); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().isNormalCube()) + { + return true; + } + } + + return false; + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + IBlockState iblockstate = this.getDefaultState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false)); + + if (facing.getAxis().isHorizontal()) + { + iblockstate = iblockstate.withProperty(FACING, facing); + } + + return iblockstate; + } + + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + this.func_176260_a(worldIn, pos, state, false, false, -1, (IBlockState)null); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (neighborBlock != this) + { + if (this.checkForDrop(worldIn, pos, state)) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (!worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock().isNormalCube()) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + } + } + + public void func_176260_a(World worldIn, BlockPos pos, IBlockState hookState, boolean p_176260_4_, boolean p_176260_5_, int p_176260_6_, IBlockState p_176260_7_) + { + EnumFacing enumfacing = (EnumFacing)hookState.getValue(FACING); + boolean flag = ((Boolean)hookState.getValue(ATTACHED)).booleanValue(); + boolean flag1 = ((Boolean)hookState.getValue(POWERED)).booleanValue(); + boolean flag2 = !World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); + boolean flag3 = !p_176260_4_; + boolean flag4 = false; + int i = 0; + IBlockState[] aiblockstate = new IBlockState[42]; + + for (int j = 1; j < 42; ++j) + { + BlockPos blockpos = pos.offset(enumfacing, j); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock() == Blocks.tripwire_hook) + { + if (iblockstate.getValue(FACING) == enumfacing.getOpposite()) + { + i = j; + } + + break; + } + + if (iblockstate.getBlock() != Blocks.tripwire && j != p_176260_6_) + { + aiblockstate[j] = null; + flag3 = false; + } + else + { + if (j == p_176260_6_) + { + iblockstate = Objects.firstNonNull(p_176260_7_, iblockstate); + } + + boolean flag5 = !iblockstate.getValue(BlockTripWire.DISARMED); + boolean flag6 = iblockstate.getValue(BlockTripWire.POWERED); + boolean flag7 = iblockstate.getValue(BlockTripWire.SUSPENDED); + flag3 &= flag7 == flag2; + flag4 |= flag5 && flag6; + aiblockstate[j] = iblockstate; + + if (j == p_176260_6_) + { + worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); + flag3 &= flag5; + } + } + } + + flag3 = flag3 & i > 1; + flag4 = flag4 & flag3; + IBlockState iblockstate1 = this.getDefaultState().withProperty(ATTACHED, flag3).withProperty(POWERED, flag4); + + if (i > 0) + { + BlockPos blockpos1 = pos.offset(enumfacing, i); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + worldIn.setBlockState(blockpos1, iblockstate1.withProperty(FACING, enumfacing1), 3); + this.func_176262_b(worldIn, blockpos1, enumfacing1); + this.func_180694_a(worldIn, blockpos1, flag3, flag4, flag, flag1); + } + + this.func_180694_a(worldIn, pos, flag3, flag4, flag, flag1); + + if (!p_176260_4_) + { + worldIn.setBlockState(pos, iblockstate1.withProperty(FACING, enumfacing), 3); + + if (p_176260_5_) + { + this.func_176262_b(worldIn, pos, enumfacing); + } + } + + if (flag != flag3) + { + for (int k = 1; k < i; ++k) + { + BlockPos blockpos2 = pos.offset(enumfacing, k); + IBlockState iblockstate2 = aiblockstate[k]; + + if (iblockstate2 != null && worldIn.getBlockState(blockpos2).getBlock() != Blocks.air) + { + worldIn.setBlockState(blockpos2, iblockstate2.withProperty(ATTACHED, Boolean.valueOf(flag3)), 3); + } + } + } + } + + public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) + { + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + this.func_176260_a(worldIn, pos, state, false, true, -1, (IBlockState)null); + } + + private void func_180694_a(World worldIn, BlockPos pos, boolean p_180694_3_, boolean p_180694_4_, boolean p_180694_5_, boolean p_180694_6_) + { + if (p_180694_4_ && !p_180694_6_) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, "random.click", 0.4F, 0.6F); + } + else if (!p_180694_4_ && p_180694_6_) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, "random.click", 0.4F, 0.5F); + } + else if (p_180694_3_ && !p_180694_5_) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, "random.click", 0.4F, 0.7F); + } + else if (!p_180694_3_ && p_180694_5_) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, "random.bowhit", 0.4F, 1.2F / (worldIn.rand.nextFloat() * 0.2F + 0.9F)); + } + } + + private void func_176262_b(World worldIn, BlockPos p_176262_2_, EnumFacing p_176262_3_) + { + worldIn.notifyNeighborsOfStateChange(p_176262_2_, this); + worldIn.notifyNeighborsOfStateChange(p_176262_2_.offset(p_176262_3_.getOpposite()), this); + } + + private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state) + { + if (!this.canPlaceBlockAt(worldIn, pos)) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + return false; + } + else + { + return true; + } + } + + @SuppressWarnings("incomplete-switch") + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + float f = 0.1875F; + + switch (worldIn.getBlockState(pos).getValue(FACING)) + { + case EAST: + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + break; + + case WEST: + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + break; + + case SOUTH: + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + break; + + case NORTH: + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + } + } + + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + boolean flag = ((Boolean)state.getValue(ATTACHED)).booleanValue(); + boolean flag1 = ((Boolean)state.getValue(POWERED)).booleanValue(); + + if (flag || flag1) + { + this.func_176260_a(worldIn, pos, state, true, false, -1, (IBlockState)null); + } + + if (flag1) + { + worldIn.notifyNeighborsOfStateChange(pos, this); + worldIn.notifyNeighborsOfStateChange(pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()), this); + } + + super.breakBlock(worldIn, pos, state); + } + + public int getWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; + } + + public int getStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) + { + return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (state.getValue(FACING) == side ? 15 : 0); + } + + public boolean canProvidePower() + { + return true; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(FACING, EnumFacing.getHorizontal(meta & 3)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)).withProperty(ATTACHED, Boolean.valueOf((meta & 4) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); + + if (((Boolean)state.getValue(POWERED)).booleanValue()) + { + i |= 8; + } + + if (((Boolean)state.getValue(ATTACHED)).booleanValue()) + { + i |= 4; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING, POWERED, ATTACHED, SUSPENDED}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockVine.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockVine.java new file mode 100644 index 0000000..eb3fd0c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockVine.java @@ -0,0 +1,478 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockVine extends Block +{ + public static final PropertyBool UP = PropertyBool.create("up"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + public static final PropertyBool[] ALL_FACES = new PropertyBool[] {UP, NORTH, SOUTH, WEST, EAST}; + + public BlockVine() + { + super(Material.vine); + this.setDefaultState(this.blockState.getBaseState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false))); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state.withProperty(UP, Boolean.valueOf(worldIn.getBlockState(pos.up()).getBlock().isBlockNormalCube())); + } + + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean isFullCube() + { + return false; + } + + public boolean isReplaceable(World worldIn, BlockPos pos) + { + return true; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + float f = 0.0625F; + float f1 = 1.0F; + float f2 = 1.0F; + float f3 = 1.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; + boolean flag = false; + + if (((Boolean)worldIn.getBlockState(pos).getValue(WEST)).booleanValue()) + { + f4 = Math.max(f4, 0.0625F); + f1 = 0.0F; + f2 = 0.0F; + f5 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + flag = true; + } + + if (((Boolean)worldIn.getBlockState(pos).getValue(EAST)).booleanValue()) + { + f1 = Math.min(f1, 0.9375F); + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + flag = true; + } + + if (((Boolean)worldIn.getBlockState(pos).getValue(NORTH)).booleanValue()) + { + f6 = Math.max(f6, 0.0625F); + f3 = 0.0F; + f1 = 0.0F; + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + flag = true; + } + + if (((Boolean)worldIn.getBlockState(pos).getValue(SOUTH)).booleanValue()) + { + f3 = Math.min(f3, 0.9375F); + f6 = 1.0F; + f1 = 0.0F; + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + flag = true; + } + + if (!flag && this.canPlaceOn(worldIn.getBlockState(pos.up()).getBlock())) + { + f2 = Math.min(f2, 0.9375F); + f5 = 1.0F; + f1 = 0.0F; + f4 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + } + + this.setBlockBounds(f1, f2, f3, f4, f5, f6); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { + switch (side) + { + case UP: + return this.canPlaceOn(worldIn.getBlockState(pos.up()).getBlock()); + + case NORTH: + case SOUTH: + case EAST: + case WEST: + return this.canPlaceOn(worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock()); + + default: + return false; + } + } + + private boolean canPlaceOn(Block blockIn) + { + return blockIn.isFullCube() && blockIn.blockMaterial.blocksMovement(); + } + + private boolean recheckGrownSides(World worldIn, BlockPos pos, IBlockState state) + { + IBlockState iblockstate = state; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + PropertyBool propertybool = getPropertyFor(enumfacing); + + if (((Boolean)state.getValue(propertybool)).booleanValue() && !this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing)).getBlock())) + { + IBlockState iblockstate1 = worldIn.getBlockState(pos.up()); + + if (iblockstate1.getBlock() != this || !((Boolean)iblockstate1.getValue(propertybool)).booleanValue()) + { + state = state.withProperty(propertybool, Boolean.valueOf(false)); + } + } + } + + if (getNumGrownFaces(state) == 0) + { + return false; + } + else + { + if (iblockstate != state) + { + worldIn.setBlockState(pos, state, 2); + } + + return true; + } + } + + public int getBlockColor() + { + return ColorizerFoliage.getFoliageColorBasic(); + } + + public int getRenderColor(IBlockState state) + { + return ColorizerFoliage.getFoliageColorBasic(); + } + + public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) + { + return worldIn.getBiomeGenForCoords(pos).getFoliageColorAtPos(pos); + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (!worldIn.isRemote && !this.recheckGrownSides(worldIn, pos, state)) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!worldIn.isRemote) + { + if (worldIn.rand.nextInt(4) == 0) + { + int i = 4; + int j = 5; + boolean flag = false; + label62: + + for (int k = -i; k <= i; ++k) + { + for (int l = -i; l <= i; ++l) + { + for (int i1 = -1; i1 <= 1; ++i1) + { + if (worldIn.getBlockState(pos.add(k, i1, l)).getBlock() == this) + { + --j; + + if (j <= 0) + { + flag = true; + break label62; + } + } + } + } + } + + EnumFacing enumfacing1 = EnumFacing.random(rand); + BlockPos blockpos1 = pos.up(); + + if (enumfacing1 == EnumFacing.UP && pos.getY() < 255 && worldIn.isAirBlock(blockpos1)) + { + if (!flag) + { + IBlockState iblockstate2 = state; + + for (EnumFacing enumfacing3 : EnumFacing.Plane.HORIZONTAL) + { + if (rand.nextBoolean() || !this.canPlaceOn(worldIn.getBlockState(blockpos1.offset(enumfacing3)).getBlock())) + { + iblockstate2 = iblockstate2.withProperty(getPropertyFor(enumfacing3), Boolean.valueOf(false)); + } + } + + if (((Boolean)iblockstate2.getValue(NORTH)).booleanValue() || ((Boolean)iblockstate2.getValue(EAST)).booleanValue() || ((Boolean)iblockstate2.getValue(SOUTH)).booleanValue() || ((Boolean)iblockstate2.getValue(WEST)).booleanValue()) + { + worldIn.setBlockState(blockpos1, iblockstate2, 2); + } + } + } + else if (enumfacing1.getAxis().isHorizontal() && !((Boolean)state.getValue(getPropertyFor(enumfacing1))).booleanValue()) + { + if (!flag) + { + BlockPos blockpos3 = pos.offset(enumfacing1); + Block block1 = worldIn.getBlockState(blockpos3).getBlock(); + + if (block1.blockMaterial == Material.air) + { + EnumFacing enumfacing2 = enumfacing1.rotateY(); + EnumFacing enumfacing4 = enumfacing1.rotateYCCW(); + boolean flag1 = ((Boolean)state.getValue(getPropertyFor(enumfacing2))).booleanValue(); + boolean flag2 = ((Boolean)state.getValue(getPropertyFor(enumfacing4))).booleanValue(); + BlockPos blockpos4 = blockpos3.offset(enumfacing2); + BlockPos blockpos = blockpos3.offset(enumfacing4); + + if (flag1 && this.canPlaceOn(worldIn.getBlockState(blockpos4).getBlock())) + { + worldIn.setBlockState(blockpos3, this.getDefaultState().withProperty(getPropertyFor(enumfacing2), Boolean.valueOf(true)), 2); + } + else if (flag2 && this.canPlaceOn(worldIn.getBlockState(blockpos).getBlock())) + { + worldIn.setBlockState(blockpos3, this.getDefaultState().withProperty(getPropertyFor(enumfacing4), Boolean.valueOf(true)), 2); + } + else if (flag1 && worldIn.isAirBlock(blockpos4) && this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing2)).getBlock())) + { + worldIn.setBlockState(blockpos4, this.getDefaultState().withProperty(getPropertyFor(enumfacing1.getOpposite()), Boolean.valueOf(true)), 2); + } + else if (flag2 && worldIn.isAirBlock(blockpos) && this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing4)).getBlock())) + { + worldIn.setBlockState(blockpos, this.getDefaultState().withProperty(getPropertyFor(enumfacing1.getOpposite()), Boolean.valueOf(true)), 2); + } + else if (this.canPlaceOn(worldIn.getBlockState(blockpos3.up()).getBlock())) + { + worldIn.setBlockState(blockpos3, this.getDefaultState(), 2); + } + } + else if (block1.blockMaterial.isOpaque() && block1.isFullCube()) + { + worldIn.setBlockState(pos, state.withProperty(getPropertyFor(enumfacing1), Boolean.valueOf(true)), 2); + } + } + } + else + { + if (pos.getY() > 1) + { + BlockPos blockpos2 = pos.down(); + IBlockState iblockstate = worldIn.getBlockState(blockpos2); + Block block = iblockstate.getBlock(); + + if (block.blockMaterial == Material.air) + { + IBlockState iblockstate1 = state; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (rand.nextBoolean()) + { + iblockstate1 = iblockstate1.withProperty(getPropertyFor(enumfacing), Boolean.valueOf(false)); + } + } + + if (((Boolean)iblockstate1.getValue(NORTH)).booleanValue() || ((Boolean)iblockstate1.getValue(EAST)).booleanValue() || ((Boolean)iblockstate1.getValue(SOUTH)).booleanValue() || ((Boolean)iblockstate1.getValue(WEST)).booleanValue()) + { + worldIn.setBlockState(blockpos2, iblockstate1, 2); + } + } + else if (block == this) + { + IBlockState iblockstate3 = iblockstate; + + for (EnumFacing enumfacing5 : EnumFacing.Plane.HORIZONTAL) + { + PropertyBool propertybool = getPropertyFor(enumfacing5); + + if (rand.nextBoolean() && ((Boolean)state.getValue(propertybool)).booleanValue()) + { + iblockstate3 = iblockstate3.withProperty(propertybool, Boolean.valueOf(true)); + } + } + + if (((Boolean)iblockstate3.getValue(NORTH)).booleanValue() || ((Boolean)iblockstate3.getValue(EAST)).booleanValue() || ((Boolean)iblockstate3.getValue(SOUTH)).booleanValue() || ((Boolean)iblockstate3.getValue(WEST)).booleanValue()) + { + worldIn.setBlockState(blockpos2, iblockstate3, 2); + } + } + } + } + } + } + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + { + IBlockState iblockstate = this.getDefaultState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)); + return facing.getAxis().isHorizontal() ? iblockstate.withProperty(getPropertyFor(facing.getOpposite()), Boolean.valueOf(true)) : iblockstate; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return null; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { + if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(worldIn, pos, new ItemStack(Blocks.vine, 1, 0)); + } + else + { + super.harvestBlock(worldIn, player, pos, state, te); + } + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(SOUTH, Boolean.valueOf((meta & 1) > 0)).withProperty(WEST, Boolean.valueOf((meta & 2) > 0)).withProperty(NORTH, Boolean.valueOf((meta & 4) > 0)).withProperty(EAST, Boolean.valueOf((meta & 8) > 0)); + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + + if (((Boolean)state.getValue(SOUTH)).booleanValue()) + { + i |= 1; + } + + if (((Boolean)state.getValue(WEST)).booleanValue()) + { + i |= 2; + } + + if (((Boolean)state.getValue(NORTH)).booleanValue()) + { + i |= 4; + } + + if (((Boolean)state.getValue(EAST)).booleanValue()) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {UP, NORTH, EAST, SOUTH, WEST}); + } + + public static PropertyBool getPropertyFor(EnumFacing side) + { + switch (side) + { + case UP: + return UP; + + case NORTH: + return NORTH; + + case SOUTH: + return SOUTH; + + case EAST: + return EAST; + + case WEST: + return WEST; + + default: + throw new IllegalArgumentException(side + " is an invalid choice"); + } + } + + public static int getNumGrownFaces(IBlockState state) + { + int i = 0; + + for (PropertyBool propertybool : ALL_FACES) + { + if (((Boolean)state.getValue(propertybool)).booleanValue()) + { + ++i; + } + } + + return i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockWall.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWall.java new file mode 100644 index 0000000..2de8ac4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWall.java @@ -0,0 +1,214 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockWall extends Block +{ + public static final PropertyBool UP = PropertyBool.create("up"); + public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool EAST = PropertyBool.create("east"); + public static final PropertyBool SOUTH = PropertyBool.create("south"); + public static final PropertyBool WEST = PropertyBool.create("west"); + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockWall.EnumType.class); + + public BlockWall(Block modelBlock) + { + super(modelBlock.blockMaterial); + this.setDefaultState(this.blockState.getBaseState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(VARIANT, BlockWall.EnumType.NORMAL)); + this.setHardness(modelBlock.blockHardness); + this.setResistance(modelBlock.blockResistance / 3.0F); + this.setStepSound(modelBlock.stepSound); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + "." + BlockWall.EnumType.NORMAL.getUnlocalizedName() + ".name"); + } + + public boolean isFullCube() + { + return false; + } + + public boolean isPassable(IBlockAccess worldIn, BlockPos pos) + { + return false; + } + + public boolean isOpaqueCube() + { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + boolean flag = this.canConnectTo(worldIn, pos.north()); + boolean flag1 = this.canConnectTo(worldIn, pos.south()); + boolean flag2 = this.canConnectTo(worldIn, pos.west()); + boolean flag3 = this.canConnectTo(worldIn, pos.east()); + float f = 0.25F; + float f1 = 0.75F; + float f2 = 0.25F; + float f3 = 0.75F; + float f4 = 1.0F; + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + if (flag2) + { + f = 0.0F; + } + + if (flag3) + { + f1 = 1.0F; + } + + if (flag && flag1 && !flag2 && !flag3) + { + f4 = 0.8125F; + f = 0.3125F; + f1 = 0.6875F; + } + else if (!flag && !flag1 && flag2 && flag3) + { + f4 = 0.8125F; + f2 = 0.3125F; + f3 = 0.6875F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, f4, f3); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + this.setBlockBoundsBasedOnState(worldIn, pos); + this.maxY = 1.5D; + return super.getCollisionBoundingBox(worldIn, pos, state); + } + + public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos).getBlock(); + return block == Blocks.barrier ? false : (block != this && !(block instanceof BlockFenceGate) ? (block.blockMaterial.isOpaque() && block.isFullCube() ? block.blockMaterial != Material.gourd : false) : true); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (BlockWall.EnumType blockwall$enumtype : BlockWall.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockwall$enumtype.getMetadata())); + } + } + + public int damageDropped(IBlockState state) + { + return ((BlockWall.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + return side == EnumFacing.DOWN ? super.shouldSideBeRendered(worldIn, pos, side) : true; + } + + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(VARIANT, BlockWall.EnumType.byMetadata(meta)); + } + + public int getMetaFromState(IBlockState state) + { + return ((BlockWall.EnumType)state.getValue(VARIANT)).getMetadata(); + } + + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + return state.withProperty(UP, Boolean.valueOf(!worldIn.isAirBlock(pos.up()))).withProperty(NORTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canConnectTo(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canConnectTo(worldIn, pos.west()))); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {UP, NORTH, EAST, WEST, SOUTH, VARIANT}); + } + + public static enum EnumType implements IStringSerializable + { + NORMAL(0, "cobblestone", "normal"), + MOSSY(1, "mossy_cobblestone", "mossy"); + + private static final BlockWall.EnumType[] META_LOOKUP = new BlockWall.EnumType[values().length]; + private final int meta; + private final String name; + private String unlocalizedName; + + private EnumType(int meta, String name, String unlocalizedName) + { + this.meta = meta; + this.name = name; + this.unlocalizedName = unlocalizedName; + } + + public int getMetadata() + { + return this.meta; + } + + public String toString() + { + return this.name; + } + + public static BlockWall.EnumType byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String getName() + { + return this.name; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + static { + for (BlockWall.EnumType blockwall$enumtype : values()) + { + META_LOOKUP[blockwall$enumtype.getMetadata()] = blockwall$enumtype; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockWallSign.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWallSign.java new file mode 100644 index 0000000..f6352f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWallSign.java @@ -0,0 +1,85 @@ +package net.minecraft.block; + +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockWallSign extends BlockSign +{ + public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + + public BlockWallSign() + { + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + } + + @SuppressWarnings("incomplete-switch") + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) + { + EnumFacing enumfacing = (EnumFacing)worldIn.getBlockState(pos).getValue(FACING); + float f = 0.28125F; + float f1 = 0.78125F; + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + + switch (enumfacing) + { + case NORTH: + this.setBlockBounds(f2, f, 1.0F - f4, f3, f1, 1.0F); + break; + + case SOUTH: + this.setBlockBounds(f2, f, 0.0F, f3, f1, f4); + break; + + case WEST: + this.setBlockBounds(1.0F - f4, f, f2, 1.0F, f1, f3); + break; + + case EAST: + this.setBlockBounds(0.0F, f, f2, f4, f1, f3); + } + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + + if (!worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock().getMaterial().isSolid()) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); + } + + super.onNeighborBlockChange(worldIn, pos, state, neighborBlock); + } + + public IBlockState getStateFromMeta(int meta) + { + EnumFacing enumfacing = EnumFacing.getFront(meta); + + if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + enumfacing = EnumFacing.NORTH; + } + + return this.getDefaultState().withProperty(FACING, enumfacing); + } + + public int getMetaFromState(IBlockState state) + { + return ((EnumFacing)state.getValue(FACING)).getIndex(); + } + + protected BlockState createBlockState() + { + return new BlockState(this, new IProperty[] {FACING}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockWeb.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWeb.java new file mode 100644 index 0000000..36d563b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWeb.java @@ -0,0 +1,57 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class BlockWeb extends Block +{ + public BlockWeb() + { + super(Material.web); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + entityIn.setInWeb(); + } + + public boolean isOpaqueCube() + { + return false; + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + { + return null; + } + + public boolean isFullCube() + { + return false; + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Items.string; + } + + protected boolean canSilkHarvest() + { + return true; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return EnumWorldBlockLayer.CUTOUT; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockWoodSlab.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWoodSlab.java new file mode 100644 index 0000000..2a9f56c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWoodSlab.java @@ -0,0 +1,111 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public abstract class BlockWoodSlab extends BlockSlab +{ + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockPlanks.EnumType.class); + + public BlockWoodSlab() + { + super(Material.wood); + IBlockState iblockstate = this.blockState.getBaseState(); + + if (!this.isDouble()) + { + iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); + } + + this.setDefaultState(iblockstate.withProperty(VARIANT, BlockPlanks.EnumType.OAK)); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMapColor(); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(Blocks.wooden_slab); + } + + public Item getItem(World worldIn, BlockPos pos) + { + return Item.getItemFromBlock(Blocks.wooden_slab); + } + + public String getUnlocalizedName(int meta) + { + return super.getUnlocalizedName() + "." + BlockPlanks.EnumType.byMetadata(meta).getUnlocalizedName(); + } + + public IProperty getVariantProperty() + { + return VARIANT; + } + + public Object getVariant(ItemStack stack) + { + return BlockPlanks.EnumType.byMetadata(stack.getMetadata() & 7); + } + + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + if (itemIn != Item.getItemFromBlock(Blocks.double_wooden_slab)) + { + for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) + { + list.add(new ItemStack(itemIn, 1, blockplanks$enumtype.getMetadata())); + } + } + } + + public IBlockState getStateFromMeta(int meta) + { + IBlockState iblockstate = this.getDefaultState().withProperty(VARIANT, BlockPlanks.EnumType.byMetadata(meta & 7)); + + if (!this.isDouble()) + { + iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP); + } + + return iblockstate; + } + + public int getMetaFromState(IBlockState state) + { + int i = 0; + i = i | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + + if (!this.isDouble() && state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP) + { + i |= 8; + } + + return i; + } + + protected BlockState createBlockState() + { + return this.isDouble() ? new BlockState(this, new IProperty[] {VARIANT}): new BlockState(this, new IProperty[] {HALF, VARIANT}); + } + + public int damageDropped(IBlockState state) + { + return ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockWorkbench.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWorkbench.java new file mode 100644 index 0000000..3f85bab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockWorkbench.java @@ -0,0 +1,77 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.IInteractionObject; +import net.minecraft.world.World; + +public class BlockWorkbench extends Block +{ + protected BlockWorkbench() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + playerIn.displayGui(new BlockWorkbench.InterfaceCraftingTable(worldIn, pos)); + playerIn.triggerAchievement(StatList.field_181742_Z); + return true; + } + } + + public static class InterfaceCraftingTable implements IInteractionObject + { + private final World world; + private final BlockPos position; + + public InterfaceCraftingTable(World worldIn, BlockPos pos) + { + this.world = worldIn; + this.position = pos; + } + + public String getName() + { + return null; + } + + public boolean hasCustomName() + { + return false; + } + + public IChatComponent getDisplayName() + { + return new ChatComponentTranslation(Blocks.crafting_table.getUnlocalizedName() + ".name", new Object[0]); + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerWorkbench(playerInventory, this.world, this.position); + } + + public String getGuiID() + { + return "minecraft:crafting_table"; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/BlockYellowFlower.java b/Client-1.8.9/src/main/java/net/minecraft/block/BlockYellowFlower.java new file mode 100644 index 0000000..fd5feea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/BlockYellowFlower.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +public class BlockYellowFlower extends BlockFlower +{ + public BlockFlower.EnumFlowerColor getBlockType() + { + return BlockFlower.EnumFlowerColor.YELLOW; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/IGrowable.java b/Client-1.8.9/src/main/java/net/minecraft/block/IGrowable.java new file mode 100644 index 0000000..cb21235 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/IGrowable.java @@ -0,0 +1,15 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public interface IGrowable +{ + boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient); + + boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state); + + void grow(World worldIn, Random rand, BlockPos pos, IBlockState state); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/ITileEntityProvider.java b/Client-1.8.9/src/main/java/net/minecraft/block/ITileEntityProvider.java new file mode 100644 index 0000000..02107ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/ITileEntityProvider.java @@ -0,0 +1,9 @@ +package net.minecraft.block; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public interface ITileEntityProvider +{ + TileEntity createNewTileEntity(World worldIn, int meta); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/material/MapColor.java b/Client-1.8.9/src/main/java/net/minecraft/block/material/MapColor.java new file mode 100644 index 0000000..dc3ec6e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/material/MapColor.java @@ -0,0 +1,88 @@ +package net.minecraft.block.material; + +public class MapColor +{ + public static final MapColor[] mapColorArray = new MapColor[64]; + public static final MapColor airColor = new MapColor(0, 0); + public static final MapColor grassColor = new MapColor(1, 8368696); + public static final MapColor sandColor = new MapColor(2, 16247203); + public static final MapColor clothColor = new MapColor(3, 13092807); + public static final MapColor tntColor = new MapColor(4, 16711680); + public static final MapColor iceColor = new MapColor(5, 10526975); + public static final MapColor ironColor = new MapColor(6, 10987431); + public static final MapColor foliageColor = new MapColor(7, 31744); + public static final MapColor snowColor = new MapColor(8, 16777215); + public static final MapColor clayColor = new MapColor(9, 10791096); + public static final MapColor dirtColor = new MapColor(10, 9923917); + public static final MapColor stoneColor = new MapColor(11, 7368816); + public static final MapColor waterColor = new MapColor(12, 4210943); + public static final MapColor woodColor = new MapColor(13, 9402184); + public static final MapColor quartzColor = new MapColor(14, 16776437); + public static final MapColor adobeColor = new MapColor(15, 14188339); + public static final MapColor magentaColor = new MapColor(16, 11685080); + public static final MapColor lightBlueColor = new MapColor(17, 6724056); + public static final MapColor yellowColor = new MapColor(18, 15066419); + public static final MapColor limeColor = new MapColor(19, 8375321); + public static final MapColor pinkColor = new MapColor(20, 15892389); + public static final MapColor grayColor = new MapColor(21, 5000268); + public static final MapColor silverColor = new MapColor(22, 10066329); + public static final MapColor cyanColor = new MapColor(23, 5013401); + public static final MapColor purpleColor = new MapColor(24, 8339378); + public static final MapColor blueColor = new MapColor(25, 3361970); + public static final MapColor brownColor = new MapColor(26, 6704179); + public static final MapColor greenColor = new MapColor(27, 6717235); + public static final MapColor redColor = new MapColor(28, 10040115); + public static final MapColor blackColor = new MapColor(29, 1644825); + public static final MapColor goldColor = new MapColor(30, 16445005); + public static final MapColor diamondColor = new MapColor(31, 6085589); + public static final MapColor lapisColor = new MapColor(32, 4882687); + public static final MapColor emeraldColor = new MapColor(33, 55610); + public static final MapColor obsidianColor = new MapColor(34, 8476209); + public static final MapColor netherrackColor = new MapColor(35, 7340544); + public int colorValue; + public final int colorIndex; + + private MapColor(int index, int color) + { + if (index >= 0 && index <= 63) + { + this.colorIndex = index; + this.colorValue = color; + mapColorArray[index] = this; + } + else + { + throw new IndexOutOfBoundsException("Map colour ID must be between 0 and 63 (inclusive)"); + } + } + + public int getMapColor(int p_151643_1_) + { + int i = 220; + + if (p_151643_1_ == 3) + { + i = 135; + } + + if (p_151643_1_ == 2) + { + i = 255; + } + + if (p_151643_1_ == 1) + { + i = 220; + } + + if (p_151643_1_ == 0) + { + i = 180; + } + + int j = (this.colorValue >> 16 & 255) * i / 255; + int k = (this.colorValue >> 8 & 255) * i / 255; + int l = (this.colorValue & 255) * i / 255; + return -16777216 | j << 16 | k << 8 | l; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/material/Material.java b/Client-1.8.9/src/main/java/net/minecraft/block/material/Material.java new file mode 100644 index 0000000..c985949 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/material/Material.java @@ -0,0 +1,150 @@ +package net.minecraft.block.material; + +public class Material +{ + public static final Material air = new MaterialTransparent(MapColor.airColor); + public static final Material grass = new Material(MapColor.grassColor); + public static final Material ground = new Material(MapColor.dirtColor); + public static final Material wood = (new Material(MapColor.woodColor)).setBurning(); + public static final Material rock = (new Material(MapColor.stoneColor)).setRequiresTool(); + public static final Material iron = (new Material(MapColor.ironColor)).setRequiresTool(); + public static final Material anvil = (new Material(MapColor.ironColor)).setRequiresTool().setImmovableMobility(); + public static final Material water = (new MaterialLiquid(MapColor.waterColor)).setNoPushMobility(); + public static final Material lava = (new MaterialLiquid(MapColor.tntColor)).setNoPushMobility(); + public static final Material leaves = (new Material(MapColor.foliageColor)).setBurning().setTranslucent().setNoPushMobility(); + public static final Material plants = (new MaterialLogic(MapColor.foliageColor)).setNoPushMobility(); + public static final Material vine = (new MaterialLogic(MapColor.foliageColor)).setBurning().setNoPushMobility().setReplaceable(); + public static final Material sponge = new Material(MapColor.yellowColor); + public static final Material cloth = (new Material(MapColor.clothColor)).setBurning(); + public static final Material fire = (new MaterialTransparent(MapColor.airColor)).setNoPushMobility(); + public static final Material sand = new Material(MapColor.sandColor); + public static final Material circuits = (new MaterialLogic(MapColor.airColor)).setNoPushMobility(); + public static final Material carpet = (new MaterialLogic(MapColor.clothColor)).setBurning(); + public static final Material glass = (new Material(MapColor.airColor)).setTranslucent().setAdventureModeExempt(); + public static final Material redstoneLight = (new Material(MapColor.airColor)).setAdventureModeExempt(); + public static final Material tnt = (new Material(MapColor.tntColor)).setBurning().setTranslucent(); + public static final Material coral = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material ice = (new Material(MapColor.iceColor)).setTranslucent().setAdventureModeExempt(); + public static final Material packedIce = (new Material(MapColor.iceColor)).setAdventureModeExempt(); + public static final Material snow = (new MaterialLogic(MapColor.snowColor)).setReplaceable().setTranslucent().setRequiresTool().setNoPushMobility(); + public static final Material craftedSnow = (new Material(MapColor.snowColor)).setRequiresTool(); + public static final Material cactus = (new Material(MapColor.foliageColor)).setTranslucent().setNoPushMobility(); + public static final Material clay = new Material(MapColor.clayColor); + public static final Material gourd = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material dragonEgg = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material portal = (new MaterialPortal(MapColor.airColor)).setImmovableMobility(); + public static final Material cake = (new Material(MapColor.airColor)).setNoPushMobility(); + public static final Material web = (new Material(MapColor.clothColor) + { + public boolean blocksMovement() + { + return false; + } + }).setRequiresTool().setNoPushMobility(); + public static final Material piston = (new Material(MapColor.stoneColor)).setImmovableMobility(); + public static final Material barrier = (new Material(MapColor.airColor)).setRequiresTool().setImmovableMobility(); + private boolean canBurn; + private boolean replaceable; + private boolean isTranslucent; + private final MapColor materialMapColor; + private boolean requiresNoTool = true; + private int mobilityFlag; + private boolean isAdventureModeExempt; + + public Material(MapColor color) + { + this.materialMapColor = color; + } + + public boolean isLiquid() + { + return false; + } + + public boolean isSolid() + { + return true; + } + + public boolean blocksLight() + { + return true; + } + + public boolean blocksMovement() + { + return true; + } + + private Material setTranslucent() + { + this.isTranslucent = true; + return this; + } + + protected Material setRequiresTool() + { + this.requiresNoTool = false; + return this; + } + + protected Material setBurning() + { + this.canBurn = true; + return this; + } + + public boolean getCanBurn() + { + return this.canBurn; + } + + public Material setReplaceable() + { + this.replaceable = true; + return this; + } + + public boolean isReplaceable() + { + return this.replaceable; + } + + public boolean isOpaque() + { + return this.isTranslucent ? false : this.blocksMovement(); + } + + public boolean isToolNotRequired() + { + return this.requiresNoTool; + } + + public int getMaterialMobility() + { + return this.mobilityFlag; + } + + protected Material setNoPushMobility() + { + this.mobilityFlag = 1; + return this; + } + + protected Material setImmovableMobility() + { + this.mobilityFlag = 2; + return this; + } + + protected Material setAdventureModeExempt() + { + this.isAdventureModeExempt = true; + return this; + } + + public MapColor getMaterialMapColor() + { + return this.materialMapColor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialLiquid.java b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialLiquid.java new file mode 100644 index 0000000..c84863b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialLiquid.java @@ -0,0 +1,26 @@ +package net.minecraft.block.material; + +public class MaterialLiquid extends Material +{ + public MaterialLiquid(MapColor color) + { + super(color); + this.setReplaceable(); + this.setNoPushMobility(); + } + + public boolean isLiquid() + { + return true; + } + + public boolean blocksMovement() + { + return false; + } + + public boolean isSolid() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialLogic.java b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialLogic.java new file mode 100644 index 0000000..f39d45c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialLogic.java @@ -0,0 +1,25 @@ +package net.minecraft.block.material; + +public class MaterialLogic extends Material +{ + public MaterialLogic(MapColor color) + { + super(color); + this.setAdventureModeExempt(); + } + + public boolean isSolid() + { + return false; + } + + public boolean blocksLight() + { + return false; + } + + public boolean blocksMovement() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialPortal.java b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialPortal.java new file mode 100644 index 0000000..d88193f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialPortal.java @@ -0,0 +1,24 @@ +package net.minecraft.block.material; + +public class MaterialPortal extends Material +{ + public MaterialPortal(MapColor color) + { + super(color); + } + + public boolean isSolid() + { + return false; + } + + public boolean blocksLight() + { + return false; + } + + public boolean blocksMovement() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialTransparent.java b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialTransparent.java new file mode 100644 index 0000000..68ce39e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/material/MaterialTransparent.java @@ -0,0 +1,25 @@ +package net.minecraft.block.material; + +public class MaterialTransparent extends Material +{ + public MaterialTransparent(MapColor color) + { + super(color); + this.setReplaceable(); + } + + public boolean isSolid() + { + return false; + } + + public boolean blocksLight() + { + return false; + } + + public boolean blocksMovement() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/properties/IProperty.java b/Client-1.8.9/src/main/java/net/minecraft/block/properties/IProperty.java new file mode 100644 index 0000000..7880d61 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/properties/IProperty.java @@ -0,0 +1,14 @@ +package net.minecraft.block.properties; + +import java.util.Collection; + +public interface IProperty> +{ + String getName(); + + Collection getAllowedValues(); + + Class getValueClass(); + + String getName(T value); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyBool.java b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyBool.java new file mode 100644 index 0000000..a1e1d00 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyBool.java @@ -0,0 +1,29 @@ +package net.minecraft.block.properties; + +import com.google.common.collect.ImmutableSet; +import java.util.Collection; + +public class PropertyBool extends PropertyHelper +{ + private final ImmutableSet allowedValues = ImmutableSet.of(Boolean.valueOf(true), Boolean.valueOf(false)); + + protected PropertyBool(String name) + { + super(name, Boolean.class); + } + + public Collection getAllowedValues() + { + return this.allowedValues; + } + + public static PropertyBool create(String name) + { + return new PropertyBool(name); + } + + public String getName(Boolean value) + { + return value.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyDirection.java b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyDirection.java new file mode 100644 index 0000000..38f7a18 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyDirection.java @@ -0,0 +1,31 @@ +package net.minecraft.block.properties; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Collections2; +import com.google.common.collect.Lists; +import java.util.Collection; +import net.minecraft.util.EnumFacing; + +public class PropertyDirection extends PropertyEnum +{ + protected PropertyDirection(String name, Collection values) + { + super(name, EnumFacing.class, values); + } + + public static PropertyDirection create(String name) + { + return create(name, Predicates.alwaysTrue()); + } + + public static PropertyDirection create(String name, Predicate filter) + { + return create(name, Collections2.filter(Lists.newArrayList(EnumFacing.values()), filter)); + } + + public static PropertyDirection create(String name, Collection values) + { + return new PropertyDirection(name, values); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyEnum.java b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyEnum.java new file mode 100644 index 0000000..6bb8040 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyEnum.java @@ -0,0 +1,65 @@ +package net.minecraft.block.properties; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Collections2; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.Map; +import net.minecraft.util.IStringSerializable; + +public class PropertyEnum & IStringSerializable> extends PropertyHelper +{ + private final ImmutableSet allowedValues; + private final Map nameToValue = Maps.newHashMap(); + + protected PropertyEnum(String name, Class valueClass, Collection allowedValues) + { + super(name, valueClass); + this.allowedValues = ImmutableSet.copyOf(allowedValues); + + for (T t : allowedValues) + { + String s = ((IStringSerializable)t).getName(); + + if (this.nameToValue.containsKey(s)) + { + throw new IllegalArgumentException("Multiple values have the same name \'" + s + "\'"); + } + + this.nameToValue.put(s, t); + } + } + + public Collection getAllowedValues() + { + return this.allowedValues; + } + + public String getName(T value) + { + return ((IStringSerializable)value).getName(); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz) + { + return create(name, clazz, Predicates.alwaysTrue()); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz, Predicate filter) + { + return create(name, clazz, Collections2.filter(Lists.newArrayList(clazz.getEnumConstants()), filter)); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz, T... values) + { + return create(name, clazz, Lists.newArrayList(values)); + } + + public static & IStringSerializable> PropertyEnum create(String name, Class clazz, Collection values) + { + return new PropertyEnum(name, clazz, values); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyHelper.java b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyHelper.java new file mode 100644 index 0000000..30f50fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyHelper.java @@ -0,0 +1,52 @@ +package net.minecraft.block.properties; + +import com.google.common.base.Objects; + +public abstract class PropertyHelper> implements IProperty +{ + private final Class valueClass; + private final String name; + + protected PropertyHelper(String name, Class valueClass) + { + this.valueClass = valueClass; + this.name = name; + } + + public String getName() + { + return this.name; + } + + public Class getValueClass() + { + return this.valueClass; + } + + public String toString() + { + return Objects.toStringHelper(this).add("name", this.name).add("clazz", this.valueClass).add("values", this.getAllowedValues()).toString(); + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + PropertyHelper propertyhelper = (PropertyHelper)p_equals_1_; + return this.valueClass.equals(propertyhelper.valueClass) && this.name.equals(propertyhelper.name); + } + else + { + return false; + } + } + + public int hashCode() + { + return 31 * this.valueClass.hashCode() + this.name.hashCode(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyInteger.java b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyInteger.java new file mode 100644 index 0000000..e16405b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/properties/PropertyInteger.java @@ -0,0 +1,82 @@ +package net.minecraft.block.properties; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.Set; + +public class PropertyInteger extends PropertyHelper +{ + private final ImmutableSet allowedValues; + + protected PropertyInteger(String name, int min, int max) + { + super(name, Integer.class); + + if (min < 0) + { + throw new IllegalArgumentException("Min value of " + name + " must be 0 or greater"); + } + else if (max <= min) + { + throw new IllegalArgumentException("Max value of " + name + " must be greater than min (" + min + ")"); + } + else + { + Set set = Sets.newHashSet(); + + for (int i = min; i <= max; ++i) + { + set.add(Integer.valueOf(i)); + } + + this.allowedValues = ImmutableSet.copyOf(set); + } + } + + public Collection getAllowedValues() + { + return this.allowedValues; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + if (!super.equals(p_equals_1_)) + { + return false; + } + else + { + PropertyInteger propertyinteger = (PropertyInteger)p_equals_1_; + return this.allowedValues.equals(propertyinteger.allowedValues); + } + } + else + { + return false; + } + } + + public int hashCode() + { + int i = super.hashCode(); + i = 31 * i + this.allowedValues.hashCode(); + return i; + } + + public static PropertyInteger create(String name, int min, int max) + { + return new PropertyInteger(name, min, max); + } + + public String getName(Integer value) + { + return value.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockPistonStructureHelper.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockPistonStructureHelper.java new file mode 100644 index 0000000..28b8c73 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockPistonStructureHelper.java @@ -0,0 +1,224 @@ +package net.minecraft.block.state; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BlockPistonStructureHelper +{ + private final World world; + private final BlockPos pistonPos; + private final BlockPos blockToMove; + private final EnumFacing moveDirection; + private final List toMove = Lists.newArrayList(); + private final List toDestroy = Lists.newArrayList(); + + public BlockPistonStructureHelper(World worldIn, BlockPos posIn, EnumFacing pistonFacing, boolean extending) + { + this.world = worldIn; + this.pistonPos = posIn; + + if (extending) + { + this.moveDirection = pistonFacing; + this.blockToMove = posIn.offset(pistonFacing); + } + else + { + this.moveDirection = pistonFacing.getOpposite(); + this.blockToMove = posIn.offset(pistonFacing, 2); + } + } + + public boolean canMove() + { + this.toMove.clear(); + this.toDestroy.clear(); + Block block = this.world.getBlockState(this.blockToMove).getBlock(); + + if (!BlockPistonBase.canPush(block, this.world, this.blockToMove, this.moveDirection, false)) + { + if (block.getMobilityFlag() != 1) + { + return false; + } + else + { + this.toDestroy.add(this.blockToMove); + return true; + } + } + else if (!this.func_177251_a(this.blockToMove)) + { + return false; + } + else + { + for (int i = 0; i < this.toMove.size(); ++i) + { + BlockPos blockpos = (BlockPos)this.toMove.get(i); + + if (this.world.getBlockState(blockpos).getBlock() == Blocks.slime_block && !this.func_177250_b(blockpos)) + { + return false; + } + } + + return true; + } + } + + private boolean func_177251_a(BlockPos origin) + { + Block block = this.world.getBlockState(origin).getBlock(); + + if (block.getMaterial() == Material.air) + { + return true; + } + else if (!BlockPistonBase.canPush(block, this.world, origin, this.moveDirection, false)) + { + return true; + } + else if (origin.equals(this.pistonPos)) + { + return true; + } + else if (this.toMove.contains(origin)) + { + return true; + } + else + { + int i = 1; + + if (i + this.toMove.size() > 12) + { + return false; + } + else + { + while (block == Blocks.slime_block) + { + BlockPos blockpos = origin.offset(this.moveDirection.getOpposite(), i); + block = this.world.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() == Material.air || !BlockPistonBase.canPush(block, this.world, blockpos, this.moveDirection, false) || blockpos.equals(this.pistonPos)) + { + break; + } + + ++i; + + if (i + this.toMove.size() > 12) + { + return false; + } + } + + int i1 = 0; + + for (int j = i - 1; j >= 0; --j) + { + this.toMove.add(origin.offset(this.moveDirection.getOpposite(), j)); + ++i1; + } + + int j1 = 1; + + while (true) + { + BlockPos blockpos1 = origin.offset(this.moveDirection, j1); + int k = this.toMove.indexOf(blockpos1); + + if (k > -1) + { + this.func_177255_a(i1, k); + + for (int l = 0; l <= k + i1; ++l) + { + BlockPos blockpos2 = (BlockPos)this.toMove.get(l); + + if (this.world.getBlockState(blockpos2).getBlock() == Blocks.slime_block && !this.func_177250_b(blockpos2)) + { + return false; + } + } + + return true; + } + + block = this.world.getBlockState(blockpos1).getBlock(); + + if (block.getMaterial() == Material.air) + { + return true; + } + + if (!BlockPistonBase.canPush(block, this.world, blockpos1, this.moveDirection, true) || blockpos1.equals(this.pistonPos)) + { + return false; + } + + if (block.getMobilityFlag() == 1) + { + this.toDestroy.add(blockpos1); + return true; + } + + if (this.toMove.size() >= 12) + { + return false; + } + + this.toMove.add(blockpos1); + ++i1; + ++j1; + } + } + } + } + + private void func_177255_a(int p_177255_1_, int p_177255_2_) + { + List list = Lists.newArrayList(); + List list1 = Lists.newArrayList(); + List list2 = Lists.newArrayList(); + list.addAll(this.toMove.subList(0, p_177255_2_)); + list1.addAll(this.toMove.subList(this.toMove.size() - p_177255_1_, this.toMove.size())); + list2.addAll(this.toMove.subList(p_177255_2_, this.toMove.size() - p_177255_1_)); + this.toMove.clear(); + this.toMove.addAll(list); + this.toMove.addAll(list1); + this.toMove.addAll(list2); + } + + private boolean func_177250_b(BlockPos p_177250_1_) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (enumfacing.getAxis() != this.moveDirection.getAxis() && !this.func_177251_a(p_177250_1_.offset(enumfacing))) + { + return false; + } + } + + return true; + } + + public List getBlocksToMove() + { + return this.toMove; + } + + public List getBlocksToDestroy() + { + return this.toDestroy; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockState.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockState.java new file mode 100644 index 0000000..0d4dde1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockState.java @@ -0,0 +1,203 @@ +package net.minecraft.block.state; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.base.Objects; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableTable; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Table; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.util.Cartesian; +import net.minecraft.util.MapPopulator; + +public class BlockState +{ + private static final Joiner COMMA_JOINER = Joiner.on(", "); + private static final Function GET_NAME_FUNC = new Function() + { + public String apply(IProperty p_apply_1_) + { + return p_apply_1_ == null ? "" : p_apply_1_.getName(); + } + }; + private final Block block; + private final ImmutableList properties; + private final ImmutableList validStates; + + public BlockState(Block blockIn, IProperty... properties) + { + this.block = blockIn; + Arrays.sort(properties, new Comparator() + { + public int compare(IProperty p_compare_1_, IProperty p_compare_2_) + { + return p_compare_1_.getName().compareTo(p_compare_2_.getName()); + } + }); + this.properties = ImmutableList.copyOf(properties); + Map, BlockState.StateImplementation> map = Maps., BlockState.StateImplementation>newLinkedHashMap(); + List list = Lists.newArrayList(); + + for (List list1 : Cartesian.cartesianProduct(this.getAllowedValues())) + { + Map map1 = MapPopulator.createMap(this.properties, list1); + BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(blockIn, ImmutableMap.copyOf(map1)); + map.put(map1, blockstate$stateimplementation); + list.add(blockstate$stateimplementation); + } + + for (BlockState.StateImplementation blockstate$stateimplementation1 : list) + { + blockstate$stateimplementation1.buildPropertyValueTable(map); + } + + this.validStates = ImmutableList.copyOf(list); + } + + public ImmutableList getValidStates() + { + return this.validStates; + } + + private List> getAllowedValues() + { + List> list = Lists.>newArrayList(); + + for (int i = 0; i < this.properties.size(); ++i) + { + list.add(((IProperty)this.properties.get(i)).getAllowedValues()); + } + + return list; + } + + public IBlockState getBaseState() + { + return (IBlockState)this.validStates.get(0); + } + + public Block getBlock() + { + return this.block; + } + + public Collection getProperties() + { + return this.properties; + } + + public String toString() + { + return Objects.toStringHelper(this).add("block", Block.blockRegistry.getNameForObject(this.block)).add("properties", Iterables.transform(this.properties, GET_NAME_FUNC)).toString(); + } + + static class StateImplementation extends BlockStateBase + { + private final Block block; + private final ImmutableMap properties; + private ImmutableTable propertyValueTable; + + private StateImplementation(Block blockIn, ImmutableMap propertiesIn) + { + this.block = blockIn; + this.properties = propertiesIn; + } + + public Collection getPropertyNames() + { + return Collections.unmodifiableCollection(this.properties.keySet()); + } + + public > T getValue(IProperty property) + { + if (!this.properties.containsKey(property)) + { + throw new IllegalArgumentException("Cannot get property " + property + " as it does not exist in " + this.block.getBlockState()); + } + else + { + return (T)((Comparable)property.getValueClass().cast(this.properties.get(property))); + } + } + + public , V extends T> IBlockState withProperty(IProperty property, V value) + { + if (!this.properties.containsKey(property)) + { + throw new IllegalArgumentException("Cannot set property " + property + " as it does not exist in " + this.block.getBlockState()); + } + else if (!property.getAllowedValues().contains(value)) + { + throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on block " + Block.blockRegistry.getNameForObject(this.block) + ", it is not an allowed value"); + } + else + { + return (IBlockState)(this.properties.get(property) == value ? this : (IBlockState)this.propertyValueTable.get(property, value)); + } + } + + public ImmutableMap getProperties() + { + return this.properties; + } + + public Block getBlock() + { + return this.block; + } + + public boolean equals(Object p_equals_1_) + { + return this == p_equals_1_; + } + + public int hashCode() + { + return this.properties.hashCode(); + } + + public void buildPropertyValueTable(Map, BlockState.StateImplementation> map) + { + if (this.propertyValueTable != null) + { + throw new IllegalStateException(); + } + else + { + Table table = HashBasedTable.create(); + + for (IProperty iproperty : this.properties.keySet()) + { + for (Comparable comparable : iproperty.getAllowedValues()) + { + if (comparable != this.properties.get(iproperty)) + { + table.put(iproperty, comparable, map.get(this.getPropertiesWithValue(iproperty, comparable))); + } + } + } + + this.propertyValueTable = ImmutableTable.copyOf(table); + } + } + + private Map getPropertiesWithValue(IProperty property, Comparable value) + { + Map map = Maps.newHashMap(this.properties); + map.put(property, value); + return map; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockStateBase.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockStateBase.java new file mode 100644 index 0000000..85a0747 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockStateBase.java @@ -0,0 +1,121 @@ +package net.minecraft.block.state; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableTable; +import com.google.common.collect.Iterables; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.util.ResourceLocation; + +public abstract class BlockStateBase implements IBlockState +{ + private static final Joiner COMMA_JOINER = Joiner.on(','); + private static final Function, String> MAP_ENTRY_TO_STRING = new Function, String>() + { + public String apply(Entry p_apply_1_) + { + if (p_apply_1_ == null) + { + return ""; + } + else + { + IProperty iproperty = (IProperty)p_apply_1_.getKey(); + return iproperty.getName() + "=" + iproperty.getName((Comparable)p_apply_1_.getValue()); + } + } + }; + private int blockId = -1; + private int blockStateId = -1; + private int metadata = -1; + private ResourceLocation blockLocation = null; + + public int getBlockId() + { + if (this.blockId < 0) + { + this.blockId = Block.getIdFromBlock(this.getBlock()); + } + + return this.blockId; + } + + public int getBlockStateId() + { + if (this.blockStateId < 0) + { + this.blockStateId = Block.getStateId(this); + } + + return this.blockStateId; + } + + public int getMetadata() + { + if (this.metadata < 0) + { + this.metadata = this.getBlock().getMetaFromState(this); + } + + return this.metadata; + } + + public ResourceLocation getBlockLocation() + { + if (this.blockLocation == null) + { + this.blockLocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.getBlock()); + } + + return this.blockLocation; + } + + public ImmutableTable < IProperty, Comparable, IBlockState > getPropertyValueTable() + { + return null; + } + + public > IBlockState cycleProperty(IProperty property) + { + return this.withProperty(property, cyclePropertyValue(property.getAllowedValues(), this.getValue(property))); + } + + protected static T cyclePropertyValue(Collection values, T currentValue) + { + Iterator iterator = values.iterator(); + + while (iterator.hasNext()) + { + if (iterator.next().equals(currentValue)) + { + if (iterator.hasNext()) + { + return (T)iterator.next(); + } + + return (T)values.iterator().next(); + } + } + + return (T)iterator.next(); + } + + public String toString() + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append(Block.blockRegistry.getNameForObject(this.getBlock())); + + if (!this.getProperties().isEmpty()) + { + stringbuilder.append("["); + COMMA_JOINER.appendTo(stringbuilder, Iterables.transform(this.getProperties().entrySet(), MAP_ENTRY_TO_STRING)); + stringbuilder.append("]"); + } + + return stringbuilder.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockStateBas~ b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockStateBas~ new file mode 100644 index 0000000..044029f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockStateBas~ @@ -0,0 +1,99 @@ +package net.minecraft.block.state; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableTable; +import com.google.common.collect.Iterables; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.ResourceLocation; + +public abstract class BlockStateBase implements IBlockState { + private static final Joiner field_177234_a = Joiner.on(','); + private static final Function, String> field_177233_b = new Function, String>() { + public String apply(Entry p_apply_1_) { + if(p_apply_1_ == null) { + return ""; + } else { + IProperty iproperty = (IProperty)p_apply_1_.getKey(); + return iproperty.func_177701_a() + "=" + iproperty.func_177702_a((Comparable)p_apply_1_.getValue()); + } + } + }; + private int blockId = -1; + private int blockStateId = -1; + private int metadata = -1; + private ResourceLocation blockLocation = null; + + public int getBlockId() { + if(this.blockId < 0) { + this.blockId = Block.func_149682_b(this.func_177230_c()); + } + + return this.blockId; + } + + public int getBlockStateId() { + if(this.blockStateId < 0) { + this.blockStateId = Block.func_176210_f(this); + } + + return this.blockStateId; + } + + public int getMetadata() { + if(this.metadata < 0) { + this.metadata = this.func_177230_c().func_176201_c(this); + } + + return this.metadata; + } + + public ResourceLocation getBlockLocation() { + if(this.blockLocation == null) { + this.blockLocation = (ResourceLocation)Block.field_149771_c.c(this.func_177230_c()); + } + + return this.blockLocation; + } + + public ImmutableTable, Comparable, IBlockState> getPropertyValueTable() { + return null; + } + + public > IBlockState func_177231_a(IProperty p_177231_1_) { + return this.func_177226_a(p_177231_1_, (Comparable)func_177232_a(p_177231_1_.func_177700_c(), this.func_177229_b(p_177231_1_))); + } + + protected static T func_177232_a(Collection p_177232_0_, T p_177232_1_) { + Iterator iterator = p_177232_0_.iterator(); + + while(iterator.hasNext()) { + if(iterator.next().equals(p_177232_1_)) { + if(iterator.hasNext()) { + return (T)iterator.next(); + } + + return (T)p_177232_0_.iterator().next(); + } + } + + return (T)iterator.next(); + } + + public String toString() { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append(Block.field_149771_c.c(this.func_177230_c())); + if(!this.func_177228_b().isEmpty()) { + stringbuilder.append("["); + field_177234_a.appendTo(stringbuilder, Iterables.transform(this.func_177228_b().entrySet(), field_177233_b)); + stringbuilder.append("]"); + } + + return stringbuilder.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockWorldState.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockWorldState.java new file mode 100644 index 0000000..55690b6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/BlockWorldState.java @@ -0,0 +1,60 @@ +package net.minecraft.block.state; + +import com.google.common.base.Predicate; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BlockWorldState +{ + private final World world; + private final BlockPos pos; + private final boolean field_181628_c; + private IBlockState state; + private TileEntity tileEntity; + private boolean tileEntityInitialized; + + public BlockWorldState(World worldIn, BlockPos posIn, boolean p_i46451_3_) + { + this.world = worldIn; + this.pos = posIn; + this.field_181628_c = p_i46451_3_; + } + + public IBlockState getBlockState() + { + if (this.state == null && (this.field_181628_c || this.world.isBlockLoaded(this.pos))) + { + this.state = this.world.getBlockState(this.pos); + } + + return this.state; + } + + public TileEntity getTileEntity() + { + if (this.tileEntity == null && !this.tileEntityInitialized) + { + this.tileEntity = this.world.getTileEntity(this.pos); + this.tileEntityInitialized = true; + } + + return this.tileEntity; + } + + public BlockPos getPos() + { + return this.pos; + } + + public static Predicate hasState(final Predicate predicatesIn) + { + return new Predicate() + { + public boolean apply(BlockWorldState p_apply_1_) + { + return p_apply_1_ != null && predicatesIn.apply(p_apply_1_.getBlockState()); + } + }; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/IBlockState.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/IBlockState.java new file mode 100644 index 0000000..ba4fcfa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/IBlockState.java @@ -0,0 +1,21 @@ +package net.minecraft.block.state; + +import com.google.common.collect.ImmutableMap; +import java.util.Collection; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; + +public interface IBlockState +{ + Collection getPropertyNames(); + + > T getValue(IProperty property); + + , V extends T> IBlockState withProperty(IProperty property, V value); + + > IBlockState cycleProperty(IProperty property); + + ImmutableMap getProperties(); + + Block getBlock(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockHelper.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockHelper.java new file mode 100644 index 0000000..ed5a334 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockHelper.java @@ -0,0 +1,25 @@ +package net.minecraft.block.state.pattern; + +import com.google.common.base.Predicate; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; + +public class BlockHelper implements Predicate +{ + private final Block block; + + private BlockHelper(Block blockType) + { + this.block = blockType; + } + + public static BlockHelper forBlock(Block blockType) + { + return new BlockHelper(blockType); + } + + public boolean apply(IBlockState p_apply_1_) + { + return p_apply_1_ != null && p_apply_1_.getBlock() == this.block; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockPattern.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockPattern.java new file mode 100644 index 0000000..0cd8cae --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockPattern.java @@ -0,0 +1,194 @@ +package net.minecraft.block.state.pattern; + +import com.google.common.base.Objects; +import com.google.common.base.Predicate; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.LoadingCache; +import net.minecraft.block.state.BlockWorldState; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3i; +import net.minecraft.world.World; + +public class BlockPattern +{ + private final Predicate[][][] blockMatches; + private final int fingerLength; + private final int thumbLength; + private final int palmLength; + + public BlockPattern(Predicate[][][] predicatesIn) + { + this.blockMatches = predicatesIn; + this.fingerLength = predicatesIn.length; + + if (this.fingerLength > 0) + { + this.thumbLength = predicatesIn[0].length; + + if (this.thumbLength > 0) + { + this.palmLength = predicatesIn[0][0].length; + } + else + { + this.palmLength = 0; + } + } + else + { + this.thumbLength = 0; + this.palmLength = 0; + } + } + + public int getThumbLength() + { + return this.thumbLength; + } + + public int getPalmLength() + { + return this.palmLength; + } + + private BlockPattern.PatternHelper checkPatternAt(BlockPos pos, EnumFacing finger, EnumFacing thumb, LoadingCache lcache) + { + for (int i = 0; i < this.palmLength; ++i) + { + for (int j = 0; j < this.thumbLength; ++j) + { + for (int k = 0; k < this.fingerLength; ++k) + { + if (!this.blockMatches[k][j][i].apply(lcache.getUnchecked(translateOffset(pos, finger, thumb, i, j, k)))) + { + return null; + } + } + } + } + + return new BlockPattern.PatternHelper(pos, finger, thumb, lcache, this.palmLength, this.thumbLength, this.fingerLength); + } + + public BlockPattern.PatternHelper match(World worldIn, BlockPos pos) + { + LoadingCache loadingcache = func_181627_a(worldIn, false); + int i = Math.max(Math.max(this.palmLength, this.thumbLength), this.fingerLength); + + for (BlockPos blockpos : BlockPos.getAllInBox(pos, pos.add(i - 1, i - 1, i - 1))) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + for (EnumFacing enumfacing1 : EnumFacing.values()) + { + if (enumfacing1 != enumfacing && enumfacing1 != enumfacing.getOpposite()) + { + BlockPattern.PatternHelper blockpattern$patternhelper = this.checkPatternAt(blockpos, enumfacing, enumfacing1, loadingcache); + + if (blockpattern$patternhelper != null) + { + return blockpattern$patternhelper; + } + } + } + } + } + + return null; + } + + public static LoadingCache func_181627_a(World p_181627_0_, boolean p_181627_1_) + { + return CacheBuilder.newBuilder().build(new BlockPattern.CacheLoader(p_181627_0_, p_181627_1_)); + } + + protected static BlockPos translateOffset(BlockPos pos, EnumFacing finger, EnumFacing thumb, int palmOffset, int thumbOffset, int fingerOffset) + { + if (finger != thumb && finger != thumb.getOpposite()) + { + Vec3i vec3i = new Vec3i(finger.getFrontOffsetX(), finger.getFrontOffsetY(), finger.getFrontOffsetZ()); + Vec3i vec3i1 = new Vec3i(thumb.getFrontOffsetX(), thumb.getFrontOffsetY(), thumb.getFrontOffsetZ()); + Vec3i vec3i2 = vec3i.crossProduct(vec3i1); + return pos.add(vec3i1.getX() * -thumbOffset + vec3i2.getX() * palmOffset + vec3i.getX() * fingerOffset, vec3i1.getY() * -thumbOffset + vec3i2.getY() * palmOffset + vec3i.getY() * fingerOffset, vec3i1.getZ() * -thumbOffset + vec3i2.getZ() * palmOffset + vec3i.getZ() * fingerOffset); + } + else + { + throw new IllegalArgumentException("Invalid forwards & up combination"); + } + } + + static class CacheLoader extends com.google.common.cache.CacheLoader + { + private final World world; + private final boolean field_181626_b; + + public CacheLoader(World worldIn, boolean p_i46460_2_) + { + this.world = worldIn; + this.field_181626_b = p_i46460_2_; + } + + public BlockWorldState load(BlockPos p_load_1_) throws Exception + { + return new BlockWorldState(this.world, p_load_1_, this.field_181626_b); + } + } + + public static class PatternHelper + { + private final BlockPos pos; + private final EnumFacing finger; + private final EnumFacing thumb; + private final LoadingCache lcache; + private final int field_181120_e; + private final int field_181121_f; + private final int field_181122_g; + + public PatternHelper(BlockPos posIn, EnumFacing fingerIn, EnumFacing thumbIn, LoadingCache lcacheIn, int p_i46378_5_, int p_i46378_6_, int p_i46378_7_) + { + this.pos = posIn; + this.finger = fingerIn; + this.thumb = thumbIn; + this.lcache = lcacheIn; + this.field_181120_e = p_i46378_5_; + this.field_181121_f = p_i46378_6_; + this.field_181122_g = p_i46378_7_; + } + + public BlockPos getPos() + { + return this.pos; + } + + public EnumFacing getFinger() + { + return this.finger; + } + + public EnumFacing getThumb() + { + return this.thumb; + } + + public int func_181118_d() + { + return this.field_181120_e; + } + + public int func_181119_e() + { + return this.field_181121_f; + } + + public BlockWorldState translateOffset(int palmOffset, int thumbOffset, int fingerOffset) + { + return (BlockWorldState)this.lcache.getUnchecked(BlockPattern.translateOffset(this.pos, this.getFinger(), this.getThumb(), palmOffset, thumbOffset, fingerOffset)); + } + + public String toString() + { + return Objects.toStringHelper(this).add("up", this.thumb).add("forwards", this.finger).add("frontTopLeft", this.pos).toString(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockStateHelper.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockStateHelper.java new file mode 100644 index 0000000..6b5f8b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/BlockStateHelper.java @@ -0,0 +1,61 @@ +package net.minecraft.block.state.pattern; + +import com.google.common.base.Predicate; +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; + +public class BlockStateHelper implements Predicate +{ + private final BlockState blockstate; + private final Map propertyPredicates = Maps.newHashMap(); + + private BlockStateHelper(BlockState blockStateIn) + { + this.blockstate = blockStateIn; + } + + public static BlockStateHelper forBlock(Block blockIn) + { + return new BlockStateHelper(blockIn.getBlockState()); + } + + public boolean apply(IBlockState p_apply_1_) + { + if (p_apply_1_ != null && p_apply_1_.getBlock().equals(this.blockstate.getBlock())) + { + for (Entry entry : this.propertyPredicates.entrySet()) + { + Object object = p_apply_1_.getValue((IProperty)entry.getKey()); + + if (!((Predicate)entry.getValue()).apply(object)) + { + return false; + } + } + + return true; + } + else + { + return false; + } + } + + public > BlockStateHelper where(IProperty property, Predicate is) + { + if (!this.blockstate.getProperties().contains(property)) + { + throw new IllegalArgumentException(this.blockstate + " cannot support property " + property); + } + else + { + this.propertyPredicates.put(property, is); + return this; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java new file mode 100644 index 0000000..da4fe13 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java @@ -0,0 +1,123 @@ +package net.minecraft.block.state.pattern; + +import com.google.common.base.Joiner; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.lang.reflect.Array; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.state.BlockWorldState; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; + +public class FactoryBlockPattern +{ + private static final Joiner COMMA_JOIN = Joiner.on(","); + private final List depth = Lists.newArrayList(); + private final Map> symbolMap = Maps.>newHashMap(); + private int aisleHeight; + private int rowWidth; + + private FactoryBlockPattern() + { + this.symbolMap.put(' ', Predicates.alwaysTrue()); + } + + public FactoryBlockPattern aisle(String... aisle) + { + if (!ArrayUtils.isEmpty((Object[])aisle) && !StringUtils.isEmpty(aisle[0])) + { + if (this.depth.isEmpty()) + { + this.aisleHeight = aisle.length; + this.rowWidth = aisle[0].length(); + } + + if (aisle.length != this.aisleHeight) + { + throw new IllegalArgumentException("Expected aisle with height of " + this.aisleHeight + ", but was given one with a height of " + aisle.length + ")"); + } + else + { + for (String s : aisle) + { + if (s.length() != this.rowWidth) + { + throw new IllegalArgumentException("Not all rows in the given aisle are the correct width (expected " + this.rowWidth + ", found one with " + s.length() + ")"); + } + + for (char c0 : s.toCharArray()) + { + if (!this.symbolMap.containsKey(Character.valueOf(c0))) + { + this.symbolMap.put(Character.valueOf(c0), (Predicate)null); + } + } + } + + this.depth.add(aisle); + return this; + } + } + else + { + throw new IllegalArgumentException("Empty pattern for aisle"); + } + } + + public static FactoryBlockPattern start() + { + return new FactoryBlockPattern(); + } + + public FactoryBlockPattern where(char symbol, Predicate blockMatcher) + { + this.symbolMap.put(Character.valueOf(symbol), blockMatcher); + return this; + } + + public BlockPattern build() + { + return new BlockPattern(this.makePredicateArray()); + } + + private Predicate[][][] makePredicateArray() + { + this.checkMissingPredicates(); + Predicate[][][] predicate = (Predicate[][][])((Predicate[][][])Array.newInstance(Predicate.class, new int[] {this.depth.size(), this.aisleHeight, this.rowWidth})); + + for (int i = 0; i < this.depth.size(); ++i) + { + for (int j = 0; j < this.aisleHeight; ++j) + { + for (int k = 0; k < this.rowWidth; ++k) + { + predicate[i][j][k] = (Predicate)this.symbolMap.get(Character.valueOf(((String[])this.depth.get(i))[j].charAt(k))); + } + } + } + + return predicate; + } + + private void checkMissingPredicates() + { + List list = Lists.newArrayList(); + + for (Entry> entry : this.symbolMap.entrySet()) + { + if (entry.getValue() == null) + { + list.add(entry.getKey()); + } + } + + if (!list.isEmpty()) + { + throw new IllegalStateException("Predicates for character(s) " + COMMA_JOIN.join(list) + " are missing"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/AnvilConverterException.java b/Client-1.8.9/src/main/java/net/minecraft/client/AnvilConverterException.java new file mode 100644 index 0000000..13b7666 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/AnvilConverterException.java @@ -0,0 +1,9 @@ +package net.minecraft.client; + +public class AnvilConverterException extends Exception +{ + public AnvilConverterException(String exceptionMessage) + { + super(exceptionMessage); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/ClientBrandRetriever.java b/Client-1.8.9/src/main/java/net/minecraft/client/ClientBrandRetriever.java new file mode 100644 index 0000000..ea49cae --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/ClientBrandRetriever.java @@ -0,0 +1,9 @@ +package net.minecraft.client; + +public class ClientBrandRetriever +{ + public static String getClientModName() + { + return "vanilla"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/LoadingScreenRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/LoadingScreenRenderer.java new file mode 100644 index 0000000..89003a9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/LoadingScreenRenderer.java @@ -0,0 +1,226 @@ +package net.minecraft.client; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MinecraftError; +import net.optifine.CustomLoadingScreen; +import net.optifine.CustomLoadingScreens; +import net.optifine.reflect.Reflector; + +public class LoadingScreenRenderer implements IProgressUpdate +{ + private String message = ""; + private Minecraft mc; + private String currentlyDisplayedText = ""; + private long systemTime = Minecraft.getSystemTime(); + private boolean loadingSuccess; + private ScaledResolution scaledResolution; + private Framebuffer framebuffer; + + public LoadingScreenRenderer(Minecraft mcIn) + { + this.mc = mcIn; + this.scaledResolution = new ScaledResolution(mcIn); + this.framebuffer = new Framebuffer(mcIn.displayWidth, mcIn.displayHeight, false); + this.framebuffer.setFramebufferFilter(9728); + } + + public void resetProgressAndMessage(String message) + { + this.loadingSuccess = false; + this.displayString(message); + } + + public void displaySavingString(String message) + { + this.loadingSuccess = true; + this.displayString(message); + } + + private void displayString(String message) + { + this.currentlyDisplayedText = message; + + if (!this.mc.running) + { + if (!this.loadingSuccess) + { + throw new MinecraftError(); + } + } + else + { + GlStateManager.clear(256); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + int i = this.scaledResolution.getScaleFactor(); + GlStateManager.ortho(0.0D, (double)(this.scaledResolution.getScaledWidth() * i), (double)(this.scaledResolution.getScaledHeight() * i), 0.0D, 100.0D, 300.0D); + } + else + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); + } + + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -200.0F); + } + } + + public void displayLoadingString(String message) + { + if (!this.mc.running) + { + if (!this.loadingSuccess) + { + throw new MinecraftError(); + } + } + else + { + this.systemTime = 0L; + this.message = message; + this.setLoadingProgress(-1); + this.systemTime = 0L; + } + } + + public void setLoadingProgress(int progress) + { + if (!this.mc.running) + { + if (!this.loadingSuccess) + { + throw new MinecraftError(); + } + } + else + { + long i = Minecraft.getSystemTime(); + + if (i - this.systemTime >= 100L) + { + this.systemTime = i; + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int j = scaledresolution.getScaleFactor(); + int k = scaledresolution.getScaledWidth(); + int l = scaledresolution.getScaledHeight(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + this.framebuffer.framebufferClear(); + } + else + { + GlStateManager.clear(256); + } + + this.framebuffer.bindFramebuffer(false); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -200.0F); + + if (!OpenGlHelper.isFramebufferEnabled()) + { + GlStateManager.clear(16640); + } + + boolean flag = true; + + if (Reflector.FMLClientHandler_handleLoadingScreen.exists()) + { + Object object = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); + + if (object != null) + { + flag = !Reflector.callBoolean(object, Reflector.FMLClientHandler_handleLoadingScreen, new Object[] {scaledresolution}); + } + } + + if (flag) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + CustomLoadingScreen customloadingscreen = CustomLoadingScreens.getCustomLoadingScreen(); + + if (customloadingscreen != null) + { + customloadingscreen.drawBackground(scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); + } + else + { + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + float f = 32.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double)l, 0.0D).tex(0.0D, (double)((float)l / f)).color(64, 64, 64, 255).endVertex(); + worldrenderer.pos((double)k, (double)l, 0.0D).tex((double)((float)k / f), (double)((float)l / f)).color(64, 64, 64, 255).endVertex(); + worldrenderer.pos((double)k, 0.0D, 0.0D).tex((double)((float)k / f), 0.0D).color(64, 64, 64, 255).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 255).endVertex(); + tessellator.draw(); + } + + if (progress >= 0) + { + int l1 = 100; + int i1 = 2; + int j1 = k / 2 - l1 / 2; + int k1 = l / 2 + 16; + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double)j1, (double)k1, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j1, (double)(k1 + i1), 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)(j1 + l1), (double)(k1 + i1), 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)(j1 + l1), (double)k1, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j1, (double)k1, 0.0D).color(128, 255, 128, 255).endVertex(); + worldrenderer.pos((double)j1, (double)(k1 + i1), 0.0D).color(128, 255, 128, 255).endVertex(); + worldrenderer.pos((double)(j1 + progress), (double)(k1 + i1), 0.0D).color(128, 255, 128, 255).endVertex(); + worldrenderer.pos((double)(j1 + progress), (double)k1, 0.0D).color(128, 255, 128, 255).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + } + + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + this.mc.fontRendererObj.drawStringWithShadow(this.currentlyDisplayedText, (float)((k - this.mc.fontRendererObj.getStringWidth(this.currentlyDisplayedText)) / 2), (float)(l / 2 - 4 - 16), 16777215); + this.mc.fontRendererObj.drawStringWithShadow(this.message, (float)((k - this.mc.fontRendererObj.getStringWidth(this.message)) / 2), (float)(l / 2 - 4 + 8), 16777215); + } + + this.framebuffer.unbindFramebuffer(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + this.framebuffer.framebufferRender(k * j, l * j); + } + + this.mc.updateDisplay(); + + try + { + Thread.yield(); + } + catch (Exception var16) + { + ; + } + } + } + } + + public void setDoneWorking() + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/Minecraft.java b/Client-1.8.9/src/main/java/net/minecraft/client/Minecraft.java new file mode 100644 index 0000000..153a263 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/Minecraft.java @@ -0,0 +1,2626 @@ +package net.minecraft.client; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.mouse.ClickEvent; +import com.cheatbreaker.client.event.impl.keyboard.KeyboardEvent; +import com.cheatbreaker.client.event.impl.network.ConnectEvent; +import com.cheatbreaker.client.event.impl.network.LoadWorldEvent; +import com.cheatbreaker.client.event.impl.tick.TickEvent; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleAutoText; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.mainmenu.LoadingScreen; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.google.common.collect.*; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListenableFutureTask; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.properties.Property; +import com.mojang.authlib.properties.PropertyMap; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import lombok.Getter; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.audio.MusicTicker; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.*; +import net.minecraft.client.gui.achievement.GuiAchievement; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.gui.stream.GuiStreamUnavailable; +import net.minecraft.client.main.GameConfiguration; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.*; +import net.minecraft.client.resources.data.*; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.client.stream.IStream; +import net.minecraft.client.stream.NullStream; +import net.minecraft.client.stream.TwitchStream; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.item.*; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Bootstrap; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.profiler.IPlayerUsage; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.IStatStringFormat; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Timer; +import net.minecraft.util.Util; +import net.minecraft.util.*; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldProviderEnd; +import net.minecraft.world.WorldProviderHell; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.storage.AnvilSaveConverter; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.*; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.util.glu.GLU; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.Proxy; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.Executors; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.FutureTask; + +public class Minecraft implements IThreadListener, IPlayerUsage { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); + public static final boolean isRunningOnMac = Util.getOSType() == Util.EnumOS.OSX; + public static byte[] memoryReserve = new byte[10485760]; + private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)}); + private final File fileResourcepacks; + private final PropertyMap twitchDetails; + private final PropertyMap profileProperties; + public ServerData currentServerData; + public TextureManager renderEngine; + private static Minecraft theMinecraft; + public PlayerControllerMP playerController; + private boolean fullscreen; + private boolean enableGLErrorChecking = true; + public boolean hasCrashed; + private CrashReport crashReporter; + public int displayWidth; + public int displayHeight; + private boolean connectedToRealms = false; + public Timer timer = new Timer(20.0F); + private PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getCurrentTimeMillis()); + public WorldClient theWorld; + public RenderGlobal renderGlobal; + private RenderManager renderManager; + private RenderItem renderItem; + private ItemRenderer itemRenderer; + public EntityPlayerSP thePlayer; + private Entity renderViewEntity; + public Entity pointedEntity; + public EffectRenderer effectRenderer; + private Session session; + private boolean isGamePaused; + public FontRenderer fontRendererObj; + public FontRenderer standardGalacticFontRenderer; + public GuiScreen currentScreen; + public LoadingScreenRenderer loadingScreen; + public EntityRenderer entityRenderer; + private int leftClickCounter; + private int tempDisplayWidth; + private int tempDisplayHeight; + private IntegratedServer theIntegratedServer; + public GuiAchievement guiAchievement; + public GuiIngame ingameGUI; + public boolean skipRenderWorld; + public MovingObjectPosition objectMouseOver; + public GameSettings gameSettings; + public MouseHelper mouseHelper; + public final File mcDataDir; + private final File fileAssets; + private final String launchedVersion; + private final Proxy proxy; + private ISaveFormat saveLoader; + public static int debugFPS; + private int rightClickDelayTimer; + private String serverName; + private int serverPort; + public boolean inGameHasFocus; + long systemTime = getSystemTime(); + private int joinPlayerCounter; + public final FrameTimer frameTimer = new FrameTimer(); + long startNanoTime = System.nanoTime(); + private final boolean jvm64bit; + private final boolean isDemo; + private NetworkManager myNetworkManager; + private boolean integratedServerIsRunning; + public final Profiler mcProfiler = new Profiler(); + private long debugCrashKeyPressTime = -1L; + private IReloadableResourceManager mcResourceManager; + private final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer(); + private final List defaultResourcePacks = Lists.newArrayList(); + @Getter + private final DefaultResourcePack mcDefaultResourcePack; + private ResourcePackRepository mcResourcePackRepository; + private LanguageManager mcLanguageManager; + private IStream stream; + private Framebuffer framebufferMc; + private TextureMap textureMapBlocks; + private SoundHandler mcSoundHandler; + private MusicTicker mcMusicTicker; + private ResourceLocation mojangLogo; + private final MinecraftSessionService sessionService; + private SkinManager skinManager; + private final Queue> scheduledTasks = Queues.>newArrayDeque(); + private long field_175615_aJ = 0L; + private final Thread mcThread = Thread.currentThread(); + private ModelManager modelManager; + private BlockRendererDispatcher blockRenderDispatcher; + public volatile boolean running = true; + public String debug = ""; + public boolean field_175613_B = false; + public boolean field_175614_C = false; + public boolean field_175611_D = false; + public boolean renderChunksMany = true; + long debugUpdateTime = getSystemTime(); + int fpsCounter; + long prevFrameTime = -1L; + private String debugProfilerName = "root"; + + public LoadingScreen cbLoadingScreen; // CB + + private boolean currentlyBorderless; + + public Minecraft(GameConfiguration gameConfig) { + theMinecraft = this; + this.mcDataDir = gameConfig.folderInfo.mcDataDir; + this.fileAssets = gameConfig.folderInfo.assetsDir; + this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir; + this.launchedVersion = gameConfig.gameInfo.version; + this.twitchDetails = gameConfig.userInfo.userProperties; + this.profileProperties = gameConfig.userInfo.profileProperties; + this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(gameConfig.folderInfo.assetsDir, gameConfig.folderInfo.assetIndex)).getResourceMap()); + this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy; + this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); + this.session = gameConfig.userInfo.session; + logger.info("Setting user: " + this.session.getUsername()); + logger.info("Setting UUID: " + this.session.getPlayerID()); + this.isDemo = gameConfig.gameInfo.isDemo; + this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; + this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; + this.tempDisplayWidth = gameConfig.displayInfo.width; + this.tempDisplayHeight = gameConfig.displayInfo.height; + this.fullscreen = gameConfig.displayInfo.fullscreen; + this.jvm64bit = isJvm64bit(); + this.theIntegratedServer = new IntegratedServer(this); + + if (gameConfig.serverInfo.serverName != null) { + this.serverName = gameConfig.serverInfo.serverName; + this.serverPort = gameConfig.serverInfo.serverPort; + } + + ImageIO.setUseCache(false); + Bootstrap.register(); + } + + public void run() { + this.running = true; + + try { + this.startGame(); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Initializing game"); + crashreport.makeCategory("Initialization"); + this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(crashreport)); + return; + } + + while (true) { + try { + while (this.running) { + if (!this.hasCrashed || this.crashReporter == null) { + try { + this.runGameLoop(); + } catch (OutOfMemoryError var10) { + this.freeMemory(); + this.displayGuiScreen(new GuiMemoryErrorScreen()); + System.gc(); + } + } else { + this.displayCrashReport(this.crashReporter); + } + } + } catch (MinecraftError var12) { + break; + } catch (ReportedException reportedexception) { + this.addGraphicsAndWorldToCrashReport(reportedexception.getCrashReport()); + this.freeMemory(); + logger.fatal((String) "Reported exception thrown!", (Throwable) reportedexception); + this.displayCrashReport(reportedexception.getCrashReport()); + break; + } catch (Throwable throwable1) { + CrashReport crashreport1 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1)); + this.freeMemory(); + logger.fatal("Unreported exception thrown!", throwable1); + this.displayCrashReport(crashreport1); + break; + } finally { + this.shutdownMinecraftApplet(); + } + + return; + } + } + + private void startGame() throws LWJGLException, IOException { + this.gameSettings = new GameSettings(this, this.mcDataDir); + this.defaultResourcePacks.add(this.mcDefaultResourcePack); + this.startTimerHackThread(); + + if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { + this.displayWidth = this.gameSettings.overrideWidth; + this.displayHeight = this.gameSettings.overrideHeight; + } + + logger.info("LWJGL Version: " + Sys.getVersion()); + this.setWindowIcon(); + this.setInitialDisplayMode(); + this.createDisplay(); + OpenGlHelper.initializeTextures(); + this.framebufferMc = new Framebuffer(this.displayWidth, this.displayHeight, true); + this.framebufferMc.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F); + this.registerMetadataSerializers(); + this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, new File(this.mcDataDir, "server-resource-packs"), this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); + this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); + this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); + this.mcResourceManager.registerReloadListener(this.mcLanguageManager); + this.refreshResources(); + this.renderEngine = new TextureManager(this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.renderEngine); + + + this.cbLoadingScreen = new LoadingScreen(115); // CB + this.cbLoadingScreen.drawMenu(0.0f, 0.0f); // CB + this.cbLoadingScreen.updatePhase("Skins"); // CB + this.initStream(); + this.skinManager = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.sessionService); + this.cbLoadingScreen.updatePhase("Sound Handler"); // CB + this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); + this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings); + this.mcResourceManager.registerReloadListener(this.mcSoundHandler); + this.mcMusicTicker = new MusicTicker(this); + this.cbLoadingScreen.updatePhase("Font Renderers"); // CB + this.fontRendererObj = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); + + if (this.gameSettings.language != null) { + this.fontRendererObj.setUnicodeFlag(this.isUnicode()); + this.fontRendererObj.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); + } + + this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false); + this.mcResourceManager.registerReloadListener(this.fontRendererObj); + this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); + this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); + this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); + this.cbLoadingScreen.updatePhase("Items"); // CB + AchievementList.openInventory.setStatStringFormatter(new IStatStringFormat() { + public String formatString(String str) { + try { + return String.format(str, new Object[]{GameSettings.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode())}); + } catch (Exception exception) { + return "Error: " + exception.getLocalizedMessage(); + } + } + }); + this.mouseHelper = new MouseHelper(); + this.checkGLError("Pre startup"); + GlStateManager.enableTexture2D(); + GlStateManager.shadeModel(7425); + GlStateManager.clearDepth(1.0D); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(515); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.cullFace(1029); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + this.checkGLError("Startup"); + this.cbLoadingScreen.updatePhase("Textures"); // CB + this.textureMapBlocks = new TextureMap("textures"); + this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels); + this.renderEngine.loadTickableTexture(TextureMap.locationBlocksTexture, this.textureMapBlocks); + this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + this.textureMapBlocks.setBlurMipmapDirect(false, this.gameSettings.mipmapLevels > 0); + this.modelManager = new ModelManager(this.textureMapBlocks); + this.mcResourceManager.registerReloadListener(this.modelManager); + this.renderItem = new RenderItem(this.renderEngine, this.modelManager); + this.renderManager = new RenderManager(this.renderEngine, this.renderItem); + this.itemRenderer = new ItemRenderer(this); + this.mcResourceManager.registerReloadListener(this.renderItem); + this.cbLoadingScreen.updatePhase("Entities"); // CB + this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.entityRenderer); + this.cbLoadingScreen.updatePhase("Blocks"); // CB + this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), this.gameSettings); + this.mcResourceManager.registerReloadListener(this.blockRenderDispatcher); + this.cbLoadingScreen.updatePhase("World"); // CB + this.renderGlobal = new RenderGlobal(this); + this.mcResourceManager.registerReloadListener(this.renderGlobal); + this.cbLoadingScreen.updatePhase("Achievements"); // CB + this.guiAchievement = new GuiAchievement(this); + GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight); + this.cbLoadingScreen.updatePhase("Effects"); // CB + this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); + this.checkGLError("Post startup"); + this.ingameGUI = new GuiIngame(this); + new CheatBreaker().initialize(); // CB + + if (this.serverName != null) { + this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); + } else { + this.displayGuiScreen(new GuiMainMenu()); + } + + this.cbLoadingScreen = null; + this.renderEngine.deleteTexture(this.mojangLogo); + this.mojangLogo = null; + this.loadingScreen = new LoadingScreenRenderer(this); + + if (this.gameSettings.fullScreen && !this.fullscreen) { + this.toggleFullscreen(); + } + + try { + Display.setVSyncEnabled(this.gameSettings.enableVsync); + } catch (OpenGLException var2) { + this.gameSettings.enableVsync = false; + this.gameSettings.saveOptions(); + } + + this.renderGlobal.makeEntityOutlineShader(); + } + + private void registerMetadataSerializers() { + this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); + } + + private void initStream() { + try { + this.stream = new TwitchStream(this, (Property) Iterables.getFirst(this.twitchDetails.get("twitch_access_token"), null)); + } catch (Throwable throwable) { + this.stream = new NullStream(throwable); + logger.error("Couldn\'t initialize twitch stream"); + } + } + + private void createDisplay() throws LWJGLException { + Display.setResizable(true); + Display.setTitle("Minecraft 1.8.9"); + + try { + Display.create((new PixelFormat()).withDepthBits(24)); + } catch (LWJGLException lwjglexception) { + logger.error((String) "Couldn\'t set pixel format", (Throwable) lwjglexception); + + try { + Thread.sleep(1000L); + } catch (InterruptedException var3) { + ; + } + + if (this.fullscreen) { + this.updateDisplayMode(); + } + + Display.create(); + } + } + + private void setInitialDisplayMode() throws LWJGLException { + if (this.fullscreen) { + Display.setFullscreen(true); + DisplayMode displaymode = Display.getDisplayMode(); + this.displayWidth = Math.max(1, displaymode.getWidth()); + this.displayHeight = Math.max(1, displaymode.getHeight()); + } else { + Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); + } + } + + private void setWindowIcon() { + Util.EnumOS util$enumos = Util.getOSType(); + + if (util$enumos != Util.EnumOS.OSX) { + InputStream inputstream = null; + InputStream inputstream1 = null; + + try { + inputstream = this.mcDefaultResourcePack.getInputStream(new ResourceLocation("client/icon-1.png")); + inputstream1 = this.mcDefaultResourcePack.getInputStream(new ResourceLocation("client/icon-2.png")); + + if (inputstream != null && inputstream1 != null) { + Display.setIcon(new ByteBuffer[]{this.readImageToBuffer(inputstream), this.readImageToBuffer(inputstream1)}); + } + } catch (IOException ioexception) { + logger.error((String) "Couldn\'t set icon", (Throwable) ioexception); + } finally { + IOUtils.closeQuietly(inputstream); + IOUtils.closeQuietly(inputstream1); + } + } + } + + private static boolean isJvm64bit() { + String[] astring = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; + + for (String s : astring) { + String s1 = System.getProperty(s); + + if (s1 != null && s1.contains("64")) { + return true; + } + } + + return false; + } + + public Framebuffer getFramebuffer() { + return this.framebufferMc; + } + + public String getVersion() { + return this.launchedVersion; + } + + private void startTimerHackThread() { + Thread thread = new Thread("Timer hack thread") { + public void run() { + while (Minecraft.this.running) { + try { + Thread.sleep(2147483647L); + } catch (InterruptedException var2) { + ; + } + } + } + }; + thread.setDaemon(true); + thread.start(); + } + + public void crashed(CrashReport crash) { + this.hasCrashed = true; + this.crashReporter = crash; + } + + public void displayCrashReport(CrashReport crashReportIn) { + File file1 = new File(getMinecraft().mcDataDir, "crash-reports"); + File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); + Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport()); + + if (crashReportIn.getFile() != null) { + Bootstrap.printToSYSOUT("#@!@# Game crashed! Crash report saved to: #@!@# " + crashReportIn.getFile()); + System.exit(-1); + } else if (crashReportIn.saveToFile(file2)) { + Bootstrap.printToSYSOUT("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath()); + System.exit(-1); + } else { + Bootstrap.printToSYSOUT("#@?@# Game crashed! Crash report could not be saved. #@?@#"); + System.exit(-2); + } + } + + public boolean isUnicode() { + return this.mcLanguageManager.isCurrentLocaleUnicode() || this.gameSettings.forceUnicodeFont; + } + + public void refreshResources() { + List list = Lists.newArrayList(this.defaultResourcePacks); + + for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries()) { + list.add(resourcepackrepository$entry.getResourcePack()); + } + + if (this.mcResourcePackRepository.getResourcePackInstance() != null) { + list.add(this.mcResourcePackRepository.getResourcePackInstance()); + } + + try { + this.mcResourceManager.reloadResources(list); + } catch (RuntimeException runtimeexception) { + logger.info((String) "Caught error stitching, removing all assigned resourcepacks", (Throwable) runtimeexception); + list.clear(); + list.addAll(this.defaultResourcePacks); + this.mcResourcePackRepository.setRepositories(Collections.emptyList()); + this.mcResourceManager.reloadResources(list); + this.gameSettings.resourcePacks.clear(); + this.gameSettings.incompatibleResourcePacks.clear(); + this.gameSettings.saveOptions(); + } + + this.mcLanguageManager.parseLanguageMetadata(list); + + if (this.renderGlobal != null) { + this.renderGlobal.loadRenderers(); + } + } + + private ByteBuffer readImageToBuffer(InputStream imageStream) throws IOException { + BufferedImage bufferedimage = ImageIO.read(imageStream); + int[] aint = bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), (int[]) null, 0, bufferedimage.getWidth()); + ByteBuffer bytebuffer = ByteBuffer.allocate(4 * aint.length); + + for (int i : aint) { + bytebuffer.putInt(i << 8 | i >> 24 & 255); + } + + bytebuffer.flip(); + return bytebuffer; + } + + private void updateDisplayMode() throws LWJGLException { + Set set = Sets.newHashSet(); + Collections.addAll(set, Display.getAvailableDisplayModes()); + DisplayMode displaymode = Display.getDesktopDisplayMode(); + + if (!set.contains(displaymode) && Util.getOSType() == Util.EnumOS.OSX) { + label53: + + for (DisplayMode displaymode1 : macDisplayModes) { + boolean flag = true; + + for (DisplayMode displaymode2 : set) { + if (displaymode2.getBitsPerPixel() == 32 && displaymode2.getWidth() == displaymode1.getWidth() && displaymode2.getHeight() == displaymode1.getHeight()) { + flag = false; + break; + } + } + + if (!flag) { + Iterator iterator = set.iterator(); + DisplayMode displaymode3; + + while (true) { + if (!iterator.hasNext()) { + continue label53; + } + + displaymode3 = (DisplayMode) iterator.next(); + + if (displaymode3.getBitsPerPixel() == 32 && displaymode3.getWidth() == displaymode1.getWidth() / 2 && displaymode3.getHeight() == displaymode1.getHeight() / 2) { + break; + } + } + + displaymode = displaymode3; + } + } + } + + Display.setDisplayMode(displaymode); + this.displayWidth = displaymode.getWidth(); + this.displayHeight = displaymode.getHeight(); + } + + private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException { + ScaledResolution scaledresolution = new ScaledResolution(this); + int i = scaledresolution.getScaleFactor(); + Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true); + framebuffer.bindFramebuffer(false); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(), (double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + GlStateManager.disableDepth(); + GlStateManager.enableTexture2D(); + InputStream inputstream = null; + + try { + inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng); + this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream))); + textureManagerInstance.bindTexture(this.mojangLogo); + } catch (IOException ioexception) { + logger.error((String) ("Unable to load logo: " + locationMojangPng), (Throwable) ioexception); + } finally { + IOUtils.closeQuietly(inputstream); + } + + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double) this.displayWidth, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double) this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + tessellator.draw(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + int j = 256; + int k = 256; + this.draw((scaledresolution.getScaledWidth() - j) / 2, (scaledresolution.getScaledHeight() - k) / 2, 0, 0, j, k, 255, 255, 255, 255); + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + framebuffer.unbindFramebuffer(); + framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + this.updateDisplay(); + } + + public void draw(int posX, int posY, int texU, int texV, int width, int height, int red, int green, int blue, int alpha) { + float f = 0.00390625F; + float f1 = 0.00390625F; + WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double) posX, (double) (posY + height), 0.0D).tex((double) ((float) texU * f), (double) ((float) (texV + height) * f1)).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos((double) (posX + width), (double) (posY + height), 0.0D).tex((double) ((float) (texU + width) * f), (double) ((float) (texV + height) * f1)).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos((double) (posX + width), (double) posY, 0.0D).tex((double) ((float) (texU + width) * f), (double) ((float) texV * f1)).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos((double) posX, (double) posY, 0.0D).tex((double) ((float) texU * f), (double) ((float) texV * f1)).color(red, green, blue, alpha).endVertex(); + Tessellator.getInstance().draw(); + } + + public ISaveFormat getSaveLoader() { + return this.saveLoader; + } + + public void displayGuiScreen(GuiScreen guiScreenIn) { + CheatBreaker.getInstance().lastScreen = this.currentScreen; + if (this.currentScreen != null) { + if (this.entityRenderer.isShaderActive()) { + try { + this.entityRenderer.stopUseShader(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + this.currentScreen.onGuiClosed(); + } + + if (guiScreenIn == null && this.theWorld == null) { + guiScreenIn = new GuiMainMenu(); + } else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F) { + guiScreenIn = new GuiGameOver(); + } + + if (guiScreenIn instanceof GuiMainMenu) { + this.gameSettings.showDebugInfo = false; + this.ingameGUI.getChatGUI().clearChatMessages(); + } + + if (guiScreenIn instanceof GuiMainMenu) { + guiScreenIn = MainMenuBase.MenuTypes.getMenu(CheatBreaker.getInstance().getGlobalSettings().getCurrentMenu()); + + } + + this.currentScreen = guiScreenIn; + + if (guiScreenIn != null) { + this.setIngameNotInFocus(); + ScaledResolution scaledresolution = new ScaledResolution(this); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + guiScreenIn.setWorldAndResolution(this, i, j); + this.skipRenderWorld = false; + } else { + this.mcSoundHandler.resumeSounds(); + this.setIngameFocus(); + } + } + + private void checkGLError(String message) { + if (this.enableGLErrorChecking) { + int i = GL11.glGetError(); + + if (i != 0) { + String s = GLU.gluErrorString(i); + logger.error("########## GL ERROR ##########"); + logger.error("@ " + message); + logger.error(i + ": " + s); + } + } + } + + public void shutdownMinecraftApplet() { + try { + CheatBreaker.getInstance().configManager.updateProfile(); + CheatBreaker.getInstance().getWsNetHandler().close(); + this.stream.shutdownStream(); + logger.info("Stopping!"); + + try { + this.loadWorld(null); + } catch (Throwable var5) { + ; + } + + this.mcSoundHandler.unloadSounds(); + } finally { + Display.destroy(); + + if (!this.hasCrashed) { + System.exit(0); + } + } + + System.gc(); + } + + private void runGameLoop() throws IOException { + long i = System.nanoTime(); + this.mcProfiler.startSection("root"); + + if (Display.isCreated() && Display.isCloseRequested()) { + this.shutdown(); + } + + if (this.isGamePaused && this.theWorld != null) { + float f = this.timer.renderPartialTicks; + this.timer.updateTimer(); + this.timer.renderPartialTicks = f; + } else { + this.timer.updateTimer(); + } + + this.mcProfiler.startSection("scheduledExecutables"); + + synchronized (this.scheduledTasks) { + while (!this.scheduledTasks.isEmpty()) { + Util.runTask((FutureTask) this.scheduledTasks.poll(), logger); + } + } + + this.mcProfiler.endSection(); + long l = System.nanoTime(); + this.mcProfiler.startSection("tick"); + + for (int j = 0; j < this.timer.elapsedTicks; ++j) { + this.runTick(); + } + + this.mcProfiler.endStartSection("preRenderErrors"); + long i1 = System.nanoTime() - l; + this.checkGLError("Pre render"); + this.mcProfiler.endStartSection("sound"); + this.mcSoundHandler.setListener(this.thePlayer, this.timer.renderPartialTicks); + this.mcProfiler.endSection(); + this.mcProfiler.startSection("render"); + GlStateManager.pushMatrix(); + GlStateManager.clear(16640); + this.framebufferMc.bindFramebuffer(true); + this.mcProfiler.startSection("display"); + GlStateManager.enableTexture2D(); + + if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { + this.gameSettings.thirdPersonView = 0; + } + + this.mcProfiler.endSection(); + + if (!this.skipRenderWorld) { + this.mcProfiler.endStartSection("gameRenderer"); + this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks, i); + this.mcProfiler.endSection(); + } + + this.mcProfiler.endSection(); + + /* + * 1.7.10 feature - This is now toggleable in the case someone wants to have this back. + * Feature: Toggles fullscreen (off) when the game is unfocused and is in fullscreen. + */ + if (!Display.isActive() && this.fullscreen && CheatBreaker.getInstance().getGlobalSettings().unfullscreenWhenUnfocused.getBooleanValue()) { + this.toggleFullscreen(); + } + + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart && !this.gameSettings.hideGUI) { + if (!this.mcProfiler.profilingEnabled) { + this.mcProfiler.clearProfiling(); + } + + this.mcProfiler.profilingEnabled = true; + this.displayDebugInfo(i1); + } else { + this.mcProfiler.profilingEnabled = false; + this.prevFrameTime = System.nanoTime(); + } + + this.guiAchievement.updateAchievementWindow(); + this.framebufferMc.unbindFramebuffer(); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + this.framebufferMc.framebufferRender(this.displayWidth, this.displayHeight); + GlStateManager.popMatrix(); + this.mcProfiler.startSection("root"); + this.updateDisplay(); + Thread.yield(); + this.mcProfiler.startSection("stream"); + this.mcProfiler.startSection("update"); + this.stream.func_152935_j(); + this.mcProfiler.endStartSection("submit"); + this.stream.func_152922_k(); + this.mcProfiler.endSection(); + this.mcProfiler.endSection(); + this.checkGLError("Post render"); + ++this.fpsCounter; + this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic(); + long k = System.nanoTime(); + this.frameTimer.addFrame(k - this.startNanoTime); + this.startNanoTime = k; + + while (getSystemTime() >= this.debugUpdateTime + 1000L) { + debugFPS = this.fpsCounter; + this.debug = String.format("%d fps (%d chunk update%s) T: %s%s%s%s%s", new Object[]{Integer.valueOf(debugFPS), Integer.valueOf(RenderChunk.renderChunksUpdated), RenderChunk.renderChunksUpdated != 1 ? "s" : "", (float) this.gameSettings.limitFramerate == GameSettings.Options.FRAMERATE_LIMIT.getValueMax() ? "inf" : Integer.valueOf(this.gameSettings.limitFramerate), this.gameSettings.enableVsync ? " vsync" : "", this.gameSettings.fancyGraphics ? "" : " fast", this.gameSettings.clouds == 0 ? "" : (this.gameSettings.clouds == 1 ? " fast-clouds" : " fancy-clouds"), OpenGlHelper.useVbo() ? " vbo" : ""}); + RenderChunk.renderChunksUpdated = 0; + this.debugUpdateTime += 1000L; + this.fpsCounter = 0; + this.usageSnooper.addMemoryStatsToSnooper(); + + if (!this.usageSnooper.isSnooperRunning()) { + this.usageSnooper.startSnooper(); + } + } + + if (this.isFramerateLimitBelowMax() || (Boolean) CheatBreaker.getInstance().getGlobalSettings().useCustomFPSLimiter.getValue() || (!Display.isActive() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().limitWhenUnfocused.getValue()) || (this.theWorld == null && this.currentScreen != null)) { + this.mcProfiler.startSection("fpslimit_wait"); + Display.sync(this.getLimitFramerate()); + this.mcProfiler.endSection(); + } + + this.mcProfiler.endSection(); + } + + public void updateDisplay() { + this.mcProfiler.startSection("display_update"); + Display.update(); + this.mcProfiler.endSection(); + this.checkWindowResize(); + } + + protected void checkWindowResize() { + if (!this.fullscreen && Display.wasResized()) { + int i = this.displayWidth; + int j = this.displayHeight; + this.displayWidth = Display.getWidth(); + this.displayHeight = Display.getHeight(); + + if (this.displayWidth != i || this.displayHeight != j) { + if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + + this.resize(this.displayWidth, this.displayHeight); + } + } + } + + public int getLimitFramerate() { + return (this.theWorld == null && this.currentScreen != null) ? ((this.currentScreen instanceof AbstractGui) ? (Integer) CheatBreaker.getInstance().getGlobalSettings().mainMenuFPS.getValue() : 30) : Display.isActive() || !(Boolean) CheatBreaker.getInstance().getGlobalSettings().limitWhenUnfocused.getValue() ? (Boolean) CheatBreaker.getInstance().getGlobalSettings().useCustomFPSLimiter.getValue() ? (Integer) CheatBreaker.getInstance().getGlobalSettings().customFPSLimit.getValue() : this.gameSettings.limitFramerate : (Integer) CheatBreaker.getInstance().getGlobalSettings().unfocusedFPS.getValue(); + } + + public boolean isFramerateLimitBelowMax() { + return (float) this.getLimitFramerate() < GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + } + + public void freeMemory() { + try { + memoryReserve = new byte[0]; + this.renderGlobal.deleteAllDisplayLists(); + } catch (Throwable var3) { + ; + } + + try { + System.gc(); + this.loadWorld((WorldClient) null); + } catch (Throwable var2) { + ; + } + + System.gc(); + } + + private void updateDebugProfilerName(int keyCount) { + List list = this.mcProfiler.getProfilingData(this.debugProfilerName); + + if (list != null && !list.isEmpty()) { + Profiler.Result profiler$result = (Profiler.Result) list.remove(0); + + if (keyCount == 0) { + if (profiler$result.field_76331_c.length() > 0) { + int i = this.debugProfilerName.lastIndexOf("."); + + if (i >= 0) { + this.debugProfilerName = this.debugProfilerName.substring(0, i); + } + } + } else { + --keyCount; + + if (keyCount < list.size() && !((Profiler.Result) list.get(keyCount)).field_76331_c.equals("unspecified")) { + if (this.debugProfilerName.length() > 0) { + this.debugProfilerName = this.debugProfilerName + "."; + } + + this.debugProfilerName = this.debugProfilerName + ((Profiler.Result) list.get(keyCount)).field_76331_c; + } + } + } + } + + private void displayDebugInfo(long elapsedTicksTime) { + if (this.mcProfiler.profilingEnabled) { + List list = this.mcProfiler.getProfilingData(this.debugProfilerName); + Profiler.Result profiler$result = (Profiler.Result) list.remove(0); + GlStateManager.clear(256); + GlStateManager.matrixMode(5889); + GlStateManager.enableColorMaterial(); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double) this.displayWidth, (double) this.displayHeight, 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + GL11.glLineWidth(1.0F); + GlStateManager.disableTexture2D(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = 160; + int j = this.displayWidth - i - 10; + int k = this.displayHeight - i * 2; + GlStateManager.enableBlend(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) ((float) j - (float) i * 1.1F), (double) ((float) k - (float) i * 0.6F - 16.0F), 0.0D).color(200, 0, 0, 0).endVertex(); + worldrenderer.pos((double) ((float) j - (float) i * 1.1F), (double) (k + i * 2), 0.0D).color(200, 0, 0, 0).endVertex(); + worldrenderer.pos((double) ((float) j + (float) i * 1.1F), (double) (k + i * 2), 0.0D).color(200, 0, 0, 0).endVertex(); + worldrenderer.pos((double) ((float) j + (float) i * 1.1F), (double) ((float) k - (float) i * 0.6F - 16.0F), 0.0D).color(200, 0, 0, 0).endVertex(); + tessellator.draw(); + GlStateManager.disableBlend(); + double d0 = 0.0D; + + for (int l = 0; l < list.size(); ++l) { + Profiler.Result profiler$result1 = (Profiler.Result) list.get(l); + int i1 = MathHelper.floor_double(profiler$result1.field_76332_a / 4.0D) + 1; + worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR); + int j1 = profiler$result1.getColor(); + int k1 = j1 >> 16 & 255; + int l1 = j1 >> 8 & 255; + int i2 = j1 & 255; + worldrenderer.pos((double) j, (double) k, 0.0D).color(k1, l1, i2, 255).endVertex(); + + for (int j2 = i1; j2 >= 0; --j2) { + float f = (float) ((d0 + profiler$result1.field_76332_a * (double) j2 / (double) i1) * Math.PI * 2.0D / 100.0D); + float f1 = MathHelper.sin(f) * (float) i; + float f2 = MathHelper.cos(f) * (float) i * 0.5F; + worldrenderer.pos((double) ((float) j + f1), (double) ((float) k - f2), 0.0D).color(k1, l1, i2, 255).endVertex(); + } + + tessellator.draw(); + worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR); + + for (int i3 = i1; i3 >= 0; --i3) { + float f3 = (float) ((d0 + profiler$result1.field_76332_a * (double) i3 / (double) i1) * Math.PI * 2.0D / 100.0D); + float f4 = MathHelper.sin(f3) * (float) i; + float f5 = MathHelper.cos(f3) * (float) i * 0.5F; + worldrenderer.pos((double) ((float) j + f4), (double) ((float) k - f5), 0.0D).color(k1 >> 1, l1 >> 1, i2 >> 1, 255).endVertex(); + worldrenderer.pos((double) ((float) j + f4), (double) ((float) k - f5 + 10.0F), 0.0D).color(k1 >> 1, l1 >> 1, i2 >> 1, 255).endVertex(); + } + + tessellator.draw(); + d0 += profiler$result1.field_76332_a; + } + + DecimalFormat decimalformat = new DecimalFormat("##0.00"); + GlStateManager.enableTexture2D(); + String s = ""; + + if (!profiler$result.field_76331_c.equals("unspecified")) { + s = s + "[0] "; + } + + if (profiler$result.field_76331_c.length() == 0) { + s = s + "ROOT "; + } else { + s = s + profiler$result.field_76331_c + " "; + } + + int l2 = 16777215; + this.fontRendererObj.drawStringWithShadow(s, (float) (j - i), (float) (k - i / 2 - 16), l2); + this.fontRendererObj.drawStringWithShadow(s = decimalformat.format(profiler$result.field_76330_b) + "%", (float) (j + i - this.fontRendererObj.getStringWidth(s)), (float) (k - i / 2 - 16), l2); + + for (int k2 = 0; k2 < list.size(); ++k2) { + Profiler.Result profiler$result2 = (Profiler.Result) list.get(k2); + String s1 = ""; + + if (profiler$result2.field_76331_c.equals("unspecified")) { + s1 = s1 + "[?] "; + } else { + s1 = s1 + "[" + (k2 + 1) + "] "; + } + + s1 = s1 + profiler$result2.field_76331_c; + this.fontRendererObj.drawStringWithShadow(s1, (float) (j - i), (float) (k + i / 2 + k2 * 8 + 20), profiler$result2.getColor()); + this.fontRendererObj.drawStringWithShadow(s1 = decimalformat.format(profiler$result2.field_76332_a) + "%", (float) (j + i - 50 - this.fontRendererObj.getStringWidth(s1)), (float) (k + i / 2 + k2 * 8 + 20), profiler$result2.getColor()); + this.fontRendererObj.drawStringWithShadow(s1 = decimalformat.format(profiler$result2.field_76330_b) + "%", (float) (j + i - this.fontRendererObj.getStringWidth(s1)), (float) (k + i / 2 + k2 * 8 + 20), profiler$result2.getColor()); + } + } + } + + public void shutdown() { + this.running = false; + } + + public void setIngameFocus() { + if (Display.isActive()) { + if (!this.inGameHasFocus) { + this.inGameHasFocus = true; + this.mouseHelper.grabMouseCursor(); + this.displayGuiScreen((GuiScreen) null); + this.leftClickCounter = 10000; + } + } + } + + public void setIngameNotInFocus() { + if (this.inGameHasFocus) { + KeyBinding.unPressAllKeys(); + this.inGameHasFocus = false; + this.mouseHelper.ungrabMouseCursor(); + } + } + + public void displayInGameMenu() { + if (this.currentScreen == null) { + this.displayGuiScreen(new GuiIngameMenu()); + + if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { + this.mcSoundHandler.pauseSounds(); + } + } + } + + private void sendClickBlockToController(boolean leftClick) { + this.leftClickCounter = 0; + if (!leftClick) { + this.leftClickCounter = 0; + } + + if (this.leftClickCounter <= 0 && !this.thePlayer.isUsingItem()) { + if (leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + + if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockpos, this.objectMouseOver.sideHit)) { + this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit); + this.thePlayer.swingItem(); + } + } else { + this.playerController.resetBlockRemoving(); + } + } + } + + private void clickMouse() { + this.leftClickCounter = 0; + if (this.leftClickCounter <= 0) { + this.thePlayer.swingItem(); + + if (this.objectMouseOver == null) { + logger.error("Null returned as \'hitResult\', this shouldn\'t happen!"); + + if (this.playerController.isNotCreative()) { + this.leftClickCounter = 10; + } + } else { + switch (this.objectMouseOver.typeOfHit) { + case ENTITY: + this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); + break; + + case BLOCK: + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + + if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { + this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit); + break; + } + + case MISS: + default: + if (this.playerController.isNotCreative()) { + this.leftClickCounter = 10; + } + } + } + } + } + + @SuppressWarnings("incomplete-switch") + private void rightClickMouse() { + if (!this.playerController.getIsHittingBlock()) { + this.rightClickDelayTimer = 4; + boolean flag = true; + ItemStack itemstack = this.thePlayer.inventory.getCurrentItem(); + + if (this.objectMouseOver == null) { + logger.warn("Null returned as \'hitResult\', this shouldn\'t happen!"); + } else { + switch (this.objectMouseOver.typeOfHit) { + case ENTITY: + if (this.playerController.isPlayerRightClickingOnEntity(this.thePlayer, this.objectMouseOver.entityHit, this.objectMouseOver)) { + flag = false; + } else if (this.playerController.interactWithEntitySendPacket(this.thePlayer, this.objectMouseOver.entityHit)) { + flag = false; + } + + break; + + case BLOCK: + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + + if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) { + int i = itemstack != null ? itemstack.stackSize : 0; + + if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) { + flag = false; + this.thePlayer.swingItem(); + } + + if (itemstack == null) { + return; + } + + if (itemstack.stackSize == 0) { + this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; + } else if (itemstack.stackSize != i || this.playerController.isInCreativeMode()) { + this.entityRenderer.itemRenderer.resetEquippedProgress(); + } + } + } + } + + if (flag) { + ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); + + if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) { + this.entityRenderer.itemRenderer.resetEquippedProgress2(); + } + } + } + } + + /** + * Toggles fullscreen mode. + */ + public void toggleFullscreen() { + try { + this.fullscreen = !this.fullscreen; + if (this.fullscreen) { + this.updateDisplayMode(); + this.displayWidth = Display.getDisplayMode().getWidth(); + this.displayHeight = Display.getDisplayMode().getHeight(); + if (CheatBreaker.getInstance().getGlobalSettings().borderlessFullscreen.getBooleanValue()) { + this.currentlyBorderless = true; + System.setProperty("org.lwjgl.opengl.Window.undecorated", "true"); + GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); + Rectangle rectangle = graphicsEnvironment.getDefaultScreenDevice().getDefaultConfiguration().getBounds(); + this.displayWidth = (int) rectangle.getWidth(); + this.displayHeight = (int) rectangle.getHeight(); + Display.setLocation(rectangle.x, rectangle.y); + Display.setResizable(false); + Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); + } else { + this.currentlyBorderless = false; + } + } else { + if (this.currentlyBorderless) { + System.setProperty("org.lwjgl.opengl.Window.undecorated", "false"); + Display.setResizable(true); + Display.setLocation(Display.getWidth() / 4, Display.getHeight() / 4); + } + this.currentlyBorderless = false; + Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); + this.displayWidth = this.tempDisplayWidth; + this.displayHeight = this.tempDisplayHeight; + } + if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + if (this.currentScreen != null) { + this.resize(this.displayWidth, this.displayHeight); + } else { + this.updateFramebufferSize(); + } + Display.setFullscreen(this.fullscreen); + Display.setVSyncEnabled(this.gameSettings.enableVsync); + this.updateDisplay(); + } catch (Exception exception) { + logger.error("Couldn't toggle fullscreen", (Throwable) exception); + } + + } + + private void resize(int width, int height) { + this.displayWidth = Math.max(1, width); + this.displayHeight = Math.max(1, height); + + if (this.currentScreen != null) { + ScaledResolution scaledresolution = new ScaledResolution(this); + this.currentScreen.onResize(this, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); + } + + this.loadingScreen = new LoadingScreenRenderer(this); + this.updateFramebufferSize(); + } + + private void updateFramebufferSize() { + this.framebufferMc.createBindFramebuffer(this.displayWidth, this.displayHeight); + + if (this.entityRenderer != null) { + this.entityRenderer.updateShaderGroupSize(this.displayWidth, this.displayHeight); + } + } + + public MusicTicker getMusicTicker() { + return this.mcMusicTicker; + } + + public void runTick() throws IOException { + if (this.rightClickDelayTimer > 0) { + --this.rightClickDelayTimer; + } + + this.mcProfiler.startSection("gui"); + + if (!this.isGamePaused) { + this.ingameGUI.updateTick(); + } + + this.mcProfiler.endSection(); + this.entityRenderer.getMouseOver(1.0F); + this.mcProfiler.startSection("gameMode"); + + if (!this.isGamePaused && this.theWorld != null) { + this.playerController.updateController(); + } + + this.mcProfiler.endStartSection("textures"); + + if (!this.isGamePaused) { + this.renderEngine.tick(); + } + + if (this.currentScreen == null && this.thePlayer != null) { + if (this.thePlayer.getHealth() <= 0.0F) { + this.displayGuiScreen(null); + } else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) { + this.displayGuiScreen(new GuiSleepMP()); + } + } else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) { + this.displayGuiScreen(null); + } + + if (this.currentScreen != null) { + this.leftClickCounter = 10000; + } + + // CB + CheatBreaker.getInstance().getEventBus().handleEvent(new TickEvent()); + + if (this.currentScreen != null) { + try { + this.currentScreen.handleInput(); + //CB + OverlayGui.getInstance().pollNotifications(); + } catch (Throwable throwable1) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Updating screen events"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Affected screen"); + crashreportcategory.addCrashSectionCallable("Screen name", () -> Minecraft.this.currentScreen.getClass().getCanonicalName()); + throw new ReportedException(crashreport); + } + + if (this.currentScreen != null) { + try { + this.currentScreen.updateScreen(); + } catch (Throwable throwable) { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Ticking screen"); + CrashReportCategory crashreportcategory1 = crashreport1.makeCategory("Affected screen"); + crashreportcategory1.addCrashSectionCallable("Screen name", () -> Minecraft.this.currentScreen.getClass().getCanonicalName()); + throw new ReportedException(crashreport1); + } + } + } + + if (this.currentScreen == null || this.currentScreen.allowUserInput) { + OverlayGui.getInstance().pollNotifications(); + this.mcProfiler.endStartSection("mouse"); + + while (Mouse.next()) { + int i = Mouse.getEventButton(); + KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState()); + + if (Mouse.getEventButtonState()) { + if (this.thePlayer.isSpectator() && i == 2) { + this.ingameGUI.getSpectatorGui().func_175261_b(); + } else { + KeyBinding.onTick(i - 100); + CheatBreaker.getInstance().getEventBus().handleEvent(new ClickEvent(i)); + } + } + + // mice button + ModuleAutoText autoHotKeyText = CheatBreaker.getInstance().getModuleManager().autoTextMod; + if (autoHotKeyText.isEnabled()) { + for (Setting setting : autoHotKeyText.hotkeys) { + if (setting.getSettingName() != null && Mouse.getButtonName(setting.getKeyCode()) != null && Mouse.isButtonDown(setting.getKeyCode())) { + if (setting.isHasMouseBind() && setting.getKeyCode() != 0 && i == setting.getKeyCode() && autoHotKeyText.messageCount.size() < autoHotKeyText.maxMessagesPerInterval) { + autoHotKeyText.send(setting.getStringValue()); + autoHotKeyText.messageCount.add(System.currentTimeMillis()); + } else { + autoHotKeyText.messageCount.removeIf(n -> n < System.currentTimeMillis() - 2000L); + } + } + } + } + + long i1 = getSystemTime() - this.systemTime; + + if (i1 <= 200L) { + int j = Mouse.getEventDWheel(); + + if (j != 0) { + if (this.thePlayer.isSpectator()) { + j = j < 0 ? -1 : 1; + + if (this.ingameGUI.getSpectatorGui().func_175262_a()) { + this.ingameGUI.getSpectatorGui().func_175259_b(-j); + } else { + float f = MathHelper.clamp_float(this.thePlayer.capabilities.getFlySpeed() + (float) j * 0.005F, 0.0F, 0.2F); + this.thePlayer.capabilities.setFlySpeed(f); + } + } else { + this.thePlayer.inventory.changeCurrentItem(j); + } + } + + if (this.currentScreen == null) { + if (!this.inGameHasFocus && Mouse.getEventButtonState()) { + this.setIngameFocus(); + } + } else { + this.currentScreen.handleMouseInput(); + } + } + } + + if (this.leftClickCounter > 0) { + --this.leftClickCounter; + } + + this.mcProfiler.endStartSection("keyboard"); + this.runTickKeyboard(); + + while (Keyboard.next()) { + int k = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey(); + KeyBinding.setKeyBindState(k, Keyboard.getEventKeyState()); + + if (Keyboard.getEventKeyState()) { + KeyBinding.onTick(k); + } + + if (this.debugCrashKeyPressTime > 0L) { + if (getSystemTime() - this.debugCrashKeyPressTime >= 6000L) { + throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); + } + + if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) { + this.debugCrashKeyPressTime = -1L; + } + } else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) { + this.debugCrashKeyPressTime = getSystemTime(); + } + + this.dispatchKeypresses(); + + if (Keyboard.getEventKeyState()) { + CheatBreaker.getInstance().getEventBus().handleEvent(new KeyboardEvent(Keyboard.getEventKey())); + + if (Keyboard.isKeyDown(42) && Keyboard.getEventKey() == 15) { + this.displayGuiScreen(OverlayGui.createInstance(this.currentScreen)); + } + + // For some reason the event didn't like it when I did it in the actual mod class without being disabled and enabled again, so I did it here. - Nox + if (Keyboard.getEventKey() == CheatBreaker.getInstance().getModuleManager().nameTagMod.hideNamePlatesKeybind.getIntegerValue()) { + CheatBreaker.getInstance().hideNameTags = !CheatBreaker.getInstance().hideNameTags; + } + + ModuleAutoText autoHotKeyText = CheatBreaker.getInstance().getModuleManager().autoTextMod; + if (autoHotKeyText.isEnabled()) { + for (Setting setting : autoHotKeyText.hotkeys) { + if (setting.getSettingName() != null && Keyboard.getKeyName(setting.getKeyCode()) != null && Keyboard.getEventKey() == setting.getKeyCode() && autoHotKeyText.messageCount.size() < autoHotKeyText.maxMessagesPerInterval) { + autoHotKeyText.send(setting.getStringValue()); + autoHotKeyText.messageCount.add(System.currentTimeMillis()); + } else { + autoHotKeyText.messageCount.removeIf(n -> n < System.currentTimeMillis() - 2000L); + } + } + } + + if (k == 62 && this.entityRenderer != null) { + this.entityRenderer.stopUseShader(); +// this.entityRenderer.switchUseShader(); + } + + if (this.currentScreen != null) { + this.currentScreen.handleKeyboardInput(); + } else { + if (k == 1) { + this.displayInGameMenu(); + } + + if (k == 32 && Keyboard.isKeyDown(61) && this.ingameGUI != null) { + this.ingameGUI.getChatGUI().clearChatMessages(); + } + + if (k == 31 && Keyboard.isKeyDown(61)) { + this.refreshResources(); + } + + if (k == 17 && Keyboard.isKeyDown(61)) { + ; + } + + if (k == 18 && Keyboard.isKeyDown(61)) { + ; + } + + if (k == 47 && Keyboard.isKeyDown(61)) { + ; + } + + if (k == 38 && Keyboard.isKeyDown(61)) { + ; + } + + if (k == 22 && Keyboard.isKeyDown(61)) { + ; + } + + if (k == 20 && Keyboard.isKeyDown(61)) { + this.refreshResources(); + } + + if (k == 33 && Keyboard.isKeyDown(61)) { + this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, GuiScreen.isShiftKeyDown() ? -1 : 1); + } + + if (k == 30 && Keyboard.isKeyDown(61)) { + this.renderGlobal.loadRenderers(); + } + + if (k == 35 && Keyboard.isKeyDown(61)) { + this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; + this.gameSettings.saveOptions(); + } + + if (k == 48 && Keyboard.isKeyDown(61)) { + this.renderManager.setDebugBoundingBox(!this.renderManager.isDebugBoundingBox()); + } + + if (k == 25 && Keyboard.isKeyDown(61)) { + this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; + this.gameSettings.saveOptions(); + } + + if (k == 59) { + this.gameSettings.hideGUI = !this.gameSettings.hideGUI; + } + + if (k == 61) { + this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; + this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); + this.gameSettings.showLagometer = GuiScreen.isAltKeyDown(); + } + +// if (this.gameSettings.keyBindTogglePerspective.isPressed()) +// { +// ++this.gameSettings.thirdPersonView; +// +// if (this.gameSettings.thirdPersonView > 2) +// { +// this.gameSettings.thirdPersonView = 0; +// } +// +// if (this.gameSettings.thirdPersonView == 0) +// { +// this.entityRenderer.loadEntityShader(this.getRenderViewEntity()); +// } +// else if (this.gameSettings.thirdPersonView == 1) +// { +// this.entityRenderer.loadEntityShader((Entity)null); +// } +// +// this.renderGlobal.setDisplayListEntitiesDirty(); +// } + + if (this.gameSettings.keyBindSmoothCamera.isPressed()) { + this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; + } + } + + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { + if (k == 11) { + this.updateDebugProfilerName(0); + } + + for (int j1 = 0; j1 < 9; ++j1) { + if (k == 2 + j1) { + this.updateDebugProfilerName(j1 + 1); + } + } + } + } + } + + for (int l = 0; l < 9; ++l) { + if (this.gameSettings.keyBindsHotbar[l].isPressed()) { + if (this.thePlayer.isSpectator()) { + this.ingameGUI.getSpectatorGui().func_175260_a(l); + } else { + this.thePlayer.inventory.currentItem = l; + } + } + } + + boolean flag = this.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN; + + while (this.gameSettings.keyBindInventory.isPressed()) { + if (this.playerController.isRidingHorse()) { + this.thePlayer.sendHorseInventory(); + } else { + this.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT)); + this.displayGuiScreen(new GuiInventory(this.thePlayer)); + } + } + + while (this.gameSettings.keyBindDrop.isPressed()) { + if (!this.thePlayer.isSpectator()) { + this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); + } + } + + while (this.gameSettings.keyBindChat.isPressed() && flag) { + this.displayGuiScreen(new GuiChat()); + } + + if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && flag) { + this.displayGuiScreen(new GuiChat("/")); + } + + if (this.thePlayer.isUsingItem()) { + if (!this.gameSettings.keyBindUseItem.isKeyDown()) { + this.playerController.onStoppedUsingItem(this.thePlayer); + } + } else { + while (this.gameSettings.keyBindAttack.isPressed()) { + this.clickMouse(); + } + + while (this.gameSettings.keyBindUseItem.isPressed()) { + this.rightClickMouse(); + } + + while (this.gameSettings.keyBindPickBlock.isPressed()) { + this.middleClickMouse(); + } + } + + if (this.gameSettings.keyBindUseItem.isKeyDown() && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) { + this.rightClickMouse(); + } + + this.sendClickBlockToController(this.currentScreen == null && this.gameSettings.keyBindAttack.isKeyDown() && this.inGameHasFocus); + } + + if (this.theWorld != null) { + if (this.thePlayer != null) { + ++this.joinPlayerCounter; + + if (this.joinPlayerCounter == 30) { + this.joinPlayerCounter = 0; + this.theWorld.joinEntityInSurroundings(this.thePlayer); + } + } + + this.mcProfiler.endStartSection("gameRenderer"); + + if (!this.isGamePaused) { + this.entityRenderer.updateRenderer(); + } + + this.mcProfiler.endStartSection("levelRenderer"); + + if (!this.isGamePaused) { + this.renderGlobal.updateClouds(); + } + + this.mcProfiler.endStartSection("level"); + + if (!this.isGamePaused) { + if (this.theWorld.getLastLightningBolt() > 0) { + this.theWorld.setLastLightningBolt(this.theWorld.getLastLightningBolt() - 1); + } + + this.theWorld.updateEntities(); + } + } else if (this.entityRenderer.isShaderActive()) { + this.entityRenderer.stopUseShader(); + } + + if (!this.isGamePaused) { + this.mcMusicTicker.update(); + this.mcSoundHandler.update(); + } + + if (this.theWorld != null) { + if (!this.isGamePaused) { + this.theWorld.setAllowedSpawnTypes(this.theWorld.getDifficulty() != EnumDifficulty.PEACEFUL, true); + + try { + this.theWorld.tick(); + } catch (Throwable throwable2) { + CrashReport crashreport2 = CrashReport.makeCrashReport(throwable2, "Exception in world tick"); + + if (this.theWorld == null) { + CrashReportCategory crashreportcategory2 = crashreport2.makeCategory("Affected level"); + crashreportcategory2.addCrashSection("Problem", "Level is null!"); + } else { + this.theWorld.addWorldInfoToCrashReport(crashreport2); + } + + throw new ReportedException(crashreport2); + } + } + + this.mcProfiler.endStartSection("animateTick"); + + if (!this.isGamePaused && this.theWorld != null) { + this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); + } + + this.mcProfiler.endStartSection("particles"); + + if (!this.isGamePaused) { + this.effectRenderer.updateEffects(); + } + } else if (this.myNetworkManager != null) { + this.mcProfiler.endStartSection("pendingConnection"); + this.myNetworkManager.processReceivedPackets(); + } + + this.mcProfiler.endSection(); + this.systemTime = getSystemTime(); + } + + private void runTickKeyboard() { + while (this.gameSettings.keyBindTogglePerspective.isPressed()) { + ++this.gameSettings.thirdPersonView; + + if (this.gameSettings.thirdPersonView > 2) { + this.gameSettings.thirdPersonView = 0; + } + + if (!CheatBreaker.getInstance().getModuleManager().motionBlurMod.isEnabled()) { + if (this.gameSettings.thirdPersonView == 0) { + this.entityRenderer.loadEntityShader(this.getRenderViewEntity()); + } else if (this.gameSettings.thirdPersonView == 1) { + this.entityRenderer.loadEntityShader(null); + } + } + + this.renderGlobal.setDisplayListEntitiesDirty(); + } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindOpenMenu.isPressed()) { + if (CheatBreaker.getInstance().getGlobalSettings().streamerMode.getBooleanValue() && CheatBreaker.getInstance().getGlobalSettings().disableModMenuKeybind.getBooleanValue()) { + if (CheatBreaker.getInstance().getGlobalSettings().notifyWhenModMenuKeybindPressed.getBooleanValue()) { + String instruction = CheatBreaker.getInstance().getGlobalSettings().holdDownModsGameMenuButton.getBooleanValue() ? "hold " + EnumChatFormatting.GOLD + "Mods" + EnumChatFormatting.RESET + " for " + EnumChatFormatting.AQUA + CheatBreaker.getInstance().getGlobalSettings().holdDuration.getFloatValue() + " seconds" : "click " + EnumChatFormatting.GOLD + "Mods"; + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("info", "Streamer mode is " + EnumChatFormatting.GREEN + "enabled" + EnumChatFormatting.RESET + "! Press escape and " + instruction + EnumChatFormatting.RESET + " to open the Mod Menu.", 5000L); + } + } else { + this.displayGuiScreen(new HudLayoutEditorGui()); + } + } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindDragToLook.isPressed()) { + if (this.getCurrentServerData() != null + && CheatBreaker.getInstance().getModuleManager().disallowedModManager.disallows( + this.getCurrentServerData().serverIP.toLowerCase(), + "freelook" + ) && + !this.isIntegratedServerRunning()) { + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("error", "Drag to Look is " + EnumChatFormatting.RED + "disallowed" + EnumChatFormatting.RESET + " on Hypixel.", 3000L); + } else { + CheatBreaker.getInstance().getModuleManager().dragToLook.toggle(); + } + } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindBackLook.isPressed()) { + CheatBreaker.getInstance().getModuleManager().snapLook.toggle(1); + } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindFrontLook.isPressed()) { + CheatBreaker.getInstance().getModuleManager().snapLook.toggle(2); + } + } + + public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) { + this.loadWorld(null); + System.gc(); + ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + + if (worldinfo == null && worldSettingsIn != null) { + worldinfo = new WorldInfo(worldSettingsIn, folderName); + isavehandler.saveWorldInfo(worldinfo); + } + + if (worldSettingsIn == null) { + worldSettingsIn = new WorldSettings(worldinfo); + } + + try { + this.theIntegratedServer = new IntegratedServer(this, folderName, worldName, worldSettingsIn); + this.theIntegratedServer.startServerThread(); + this.integratedServerIsRunning = true; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Starting integrated server"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Starting integrated server"); + crashreportcategory.addCrashSection("Level ID", folderName); + crashreportcategory.addCrashSection("Level Name", worldName); + throw new ReportedException(crashreport); + } + + this.loadingScreen.displaySavingString(I18n.format("menu.loadingLevel")); + + while (!this.theIntegratedServer.serverIsInRunLoop()) { + String s = this.theIntegratedServer.getUserMessage(); + + if (s != null) { + this.loadingScreen.displayLoadingString(I18n.format(s)); + } else { + this.loadingScreen.displayLoadingString(""); + } + + try { + Thread.sleep(200L); + } catch (InterruptedException var9) { + ; + } + } + + this.displayGuiScreen(null); + SocketAddress socketaddress = this.theIntegratedServer.getNetworkSystem().addLocalEndpoint(); + NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress); + networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, null)); + networkmanager.sendPacket(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN)); + networkmanager.sendPacket(new C00PacketLoginStart(this.getSession().getProfile())); + this.myNetworkManager = networkmanager; + } + + public void loadWorld(WorldClient worldClientIn) { + this.loadWorld(worldClientIn, ""); + } + + public void loadWorld(WorldClient worldClientIn, String loadingMessage) { + if (worldClientIn == null) { + NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); + + if (nethandlerplayclient != null) { + nethandlerplayclient.cleanup(); + } + + if (this.theIntegratedServer != null && this.theIntegratedServer.isAnvilFileSet()) { + this.theIntegratedServer.initiateShutdown(); + this.theIntegratedServer.setStaticInstance(); + } + + this.theIntegratedServer = null; + this.guiAchievement.clearAchievements(); + this.entityRenderer.getMapItemRenderer().clearLoadedMaps(); + } + + this.renderViewEntity = null; + this.myNetworkManager = null; + + if (this.loadingScreen != null) { + this.loadingScreen.resetProgressAndMessage(loadingMessage); + this.loadingScreen.displayLoadingString(""); + } + + if (worldClientIn == null && this.theWorld != null) { + this.mcResourcePackRepository.clearResourcePack(); + this.ingameGUI.resetPlayersOverlayFooterHeader(); + this.setServerData((ServerData) null); + this.integratedServerIsRunning = false; + } + + this.mcSoundHandler.stopSounds(); + this.theWorld = worldClientIn; + + if (worldClientIn != null) { + CheatBreaker.getInstance().getEventBus().handleEvent(new LoadWorldEvent(worldClientIn)); + CheatBreaker.getInstance().getCBNetHandler().getCustomNameTags().clear(); + if (this.renderGlobal != null) { + this.renderGlobal.setWorldAndLoadRenderers(worldClientIn); + } + + if (this.effectRenderer != null) { + this.effectRenderer.clearEffects(worldClientIn); + } + + if (this.thePlayer == null) { + this.thePlayer = this.playerController.func_178892_a(worldClientIn, new StatFileWriter()); + this.playerController.flipPlayer(this.thePlayer); + } + + this.thePlayer.preparePlayerToSpawn(); + worldClientIn.spawnEntityInWorld(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.playerController.setPlayerCapabilities(this.thePlayer); + this.renderViewEntity = this.thePlayer; + } else { + this.saveLoader.flushCache(); + this.thePlayer = null; + } + + System.gc(); + this.systemTime = 0L; + CheatBreaker.getInstance().getEventBus().handleEvent(new ConnectEvent()); + } + + public void setDimensionAndSpawnPlayer(int dimension) { + this.theWorld.setInitialSpawnLocation(); + this.theWorld.removeAllEntities(); + int i = 0; + String s = null; + + if (this.thePlayer != null) { + i = this.thePlayer.getEntityId(); + this.theWorld.removeEntity(this.thePlayer); + s = this.thePlayer.getClientBrand(); + } + + this.renderViewEntity = null; + EntityPlayerSP entityplayersp = this.thePlayer; + this.thePlayer = this.playerController.func_178892_a(this.theWorld, this.thePlayer == null ? new StatFileWriter() : this.thePlayer.getStatFileWriter()); + this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched()); + this.thePlayer.dimension = dimension; + this.renderViewEntity = this.thePlayer; + this.thePlayer.preparePlayerToSpawn(); + this.thePlayer.setClientBrand(s); + this.theWorld.spawnEntityInWorld(this.thePlayer); + this.playerController.flipPlayer(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.thePlayer.setEntityId(i); + this.playerController.setPlayerCapabilities(this.thePlayer); + this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug()); + + if (this.currentScreen instanceof GuiGameOver) { + this.displayGuiScreen(null); + } + } + + public final boolean isDemo() { + return this.isDemo; + } + + public NetHandlerPlayClient getNetHandler() { + return this.thePlayer != null ? this.thePlayer.sendQueue : null; + } + + public static boolean isGuiEnabled() { + return theMinecraft == null || !theMinecraft.gameSettings.hideGUI; + } + + public static boolean isFancyGraphicsEnabled() { + return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; + } + + public static boolean isAmbientOcclusionEnabled() { + return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; + } + + private void middleClickMouse() { + if (this.objectMouseOver != null) { + boolean flag = this.thePlayer.capabilities.isCreativeMode; + int i = 0; + boolean flag1 = false; + TileEntity tileentity = null; + Item item; + + if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + Block block = this.theWorld.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() == Material.air) { + return; + } + + item = block.getItem(this.theWorld, blockpos); + + if (item == null) { + return; + } + + if (flag && GuiScreen.isCtrlKeyDown()) { + tileentity = this.theWorld.getTileEntity(blockpos); + } + + Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block; + i = block1.getDamageValue(this.theWorld, blockpos); + flag1 = item.getHasSubtypes(); + } else { + if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) { + return; + } + + if (this.objectMouseOver.entityHit instanceof EntityPainting) { + item = Items.painting; + } else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) { + item = Items.lead; + } else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) { + EntityItemFrame entityitemframe = (EntityItemFrame) this.objectMouseOver.entityHit; + ItemStack itemstack = entityitemframe.getDisplayedItem(); + + if (itemstack == null) { + item = Items.item_frame; + } else { + item = itemstack.getItem(); + i = itemstack.getMetadata(); + flag1 = true; + } + } else if (this.objectMouseOver.entityHit instanceof EntityMinecart) { + EntityMinecart entityminecart = (EntityMinecart) this.objectMouseOver.entityHit; + + switch (entityminecart.getMinecartType()) { + case FURNACE: + item = Items.furnace_minecart; + break; + + case CHEST: + item = Items.chest_minecart; + break; + + case TNT: + item = Items.tnt_minecart; + break; + + case HOPPER: + item = Items.hopper_minecart; + break; + + case COMMAND_BLOCK: + item = Items.command_block_minecart; + break; + + default: + item = Items.minecart; + } + } else if (this.objectMouseOver.entityHit instanceof EntityBoat) { + item = Items.boat; + } else if (this.objectMouseOver.entityHit instanceof EntityArmorStand) { + item = Items.armor_stand; + } else { + item = Items.spawn_egg; + i = EntityList.getEntityID(this.objectMouseOver.entityHit); + flag1 = true; + + if (!EntityList.entityEggs.containsKey(Integer.valueOf(i))) { + return; + } + } + } + + InventoryPlayer inventoryplayer = this.thePlayer.inventory; + + if (tileentity == null) { + inventoryplayer.setCurrentItem(item, i, flag1, flag); + } else { + ItemStack itemstack1 = this.pickBlockWithNBT(item, i, tileentity); + inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1); + } + + if (flag) { + int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem; + this.playerController.sendSlotPacket(inventoryplayer.getStackInSlot(inventoryplayer.currentItem), j); + } + } + } + + private ItemStack pickBlockWithNBT(Item itemIn, int meta, TileEntity tileEntityIn) { + ItemStack itemstack = new ItemStack(itemIn, 1, meta); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileEntityIn.writeToNBT(nbttagcompound); + + if (itemIn == Items.skull && nbttagcompound.hasKey("Owner")) { + NBTTagCompound nbttagcompound2 = nbttagcompound.getCompoundTag("Owner"); + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + nbttagcompound3.setTag("SkullOwner", nbttagcompound2); + itemstack.setTagCompound(nbttagcompound3); + return itemstack; + } else { + itemstack.setTagInfo("BlockEntityTag", nbttagcompound); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + nbttaglist.appendTag(new NBTTagString("(+NBT)")); + nbttagcompound1.setTag("Lore", nbttaglist); + itemstack.setTagInfo("display", nbttagcompound1); + return itemstack; + } + } + + public CrashReport addGraphicsAndWorldToCrashReport(CrashReport theCrash) { + theCrash.getCategory().addCrashSectionCallable("Launched Version", new Callable() { + public String call() throws Exception { + return Minecraft.this.launchedVersion; + } + }); + theCrash.getCategory().addCrashSectionCallable("LWJGL", new Callable() { + public String call() { + return Sys.getVersion(); + } + }); + theCrash.getCategory().addCrashSectionCallable("OpenGL", new Callable() { + public String call() { + return GL11.glGetString(GL11.GL_RENDERER) + " GL version " + GL11.glGetString(GL11.GL_VERSION) + ", " + GL11.glGetString(GL11.GL_VENDOR); + } + }); + theCrash.getCategory().addCrashSectionCallable("GL Caps", new Callable() { + public String call() { + return OpenGlHelper.getLogText(); + } + }); + theCrash.getCategory().addCrashSectionCallable("Using VBOs", new Callable() { + public String call() { + return Minecraft.this.gameSettings.useVbo ? "Yes" : "No"; + } + }); + theCrash.getCategory().addCrashSectionCallable("Is Modded", new Callable() { + public String call() throws Exception { + String s = ClientBrandRetriever.getClientModName(); + return !s.equals("vanilla") ? "Definitely; Client brand changed to \'" + s + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and client brand is untouched."); + } + }); + theCrash.getCategory().addCrashSectionCallable("Type", new Callable() { + public String call() throws Exception { + return "Client (map_client.txt)"; + } + }); + theCrash.getCategory().addCrashSectionCallable("Resource Packs", new Callable() { + public String call() throws Exception { + StringBuilder stringbuilder = new StringBuilder(); + + for (String s : Minecraft.this.gameSettings.resourcePacks) { + if (stringbuilder.length() > 0) { + stringbuilder.append(", "); + } + + stringbuilder.append(s); + + if (Minecraft.this.gameSettings.incompatibleResourcePacks.contains(s)) { + stringbuilder.append(" (incompatible)"); + } + } + + return stringbuilder.toString(); + } + }); + theCrash.getCategory().addCrashSectionCallable("Current Language", new Callable() { + public String call() throws Exception { + return Minecraft.this.mcLanguageManager.getCurrentLanguage().toString(); + } + }); + theCrash.getCategory().addCrashSectionCallable("Profiler Position", new Callable() { + public String call() throws Exception { + return Minecraft.this.mcProfiler.profilingEnabled ? Minecraft.this.mcProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + }); + theCrash.getCategory().addCrashSectionCallable("CPU", new Callable() { + public String call() { + return OpenGlHelper.getCpu(); + } + }); + + if (this.theWorld != null) { + this.theWorld.addWorldInfoToCrashReport(theCrash); + } + + return theCrash; + } + + public static Minecraft getMinecraft() { + return theMinecraft; + } + + public ListenableFuture scheduleResourcesRefresh() { + return this.addScheduledTask(new Runnable() { + public void run() { + Minecraft.this.refreshResources(); + } + }); + } + + public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) { + playerSnooper.addClientStat("fps", Integer.valueOf(debugFPS)); + playerSnooper.addClientStat("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); + playerSnooper.addClientStat("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); + playerSnooper.addClientStat("display_type", this.fullscreen ? "fullscreen" : "windowed"); + playerSnooper.addClientStat("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L)); + playerSnooper.addClientStat("current_action", this.getCurrentAction()); + String s = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "little" : "big"; + playerSnooper.addClientStat("endianness", s); + playerSnooper.addClientStat("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size())); + int i = 0; + + for (ResourcePackRepository.Entry resourcepackrepository$entry : this.mcResourcePackRepository.getRepositoryEntries()) { + playerSnooper.addClientStat("resource_pack[" + i++ + "]", resourcepackrepository$entry.getResourcePackName()); + } + + if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) { + playerSnooper.addClientStat("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); + } + } + + private String getCurrentAction() { + return this.theIntegratedServer != null ? (this.theIntegratedServer.getPublic() ? "hosting_lan" : "singleplayer") : (this.currentServerData != null ? (this.currentServerData.isOnLAN() ? "playing_lan" : "multiplayer") : "out_of_game"); + } + + public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) { + playerSnooper.addStatToSnooper("opengl_version", GL11.glGetString(GL11.GL_VERSION)); + playerSnooper.addStatToSnooper("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); + playerSnooper.addStatToSnooper("client_brand", ClientBrandRetriever.getClientModName()); + playerSnooper.addStatToSnooper("launched_version", this.launchedVersion); + ContextCapabilities contextcapabilities = GLContext.getCapabilities(); + playerSnooper.addStatToSnooper("gl_caps[ARB_arrays_of_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_arrays_of_arrays)); + playerSnooper.addStatToSnooper("gl_caps[ARB_base_instance]", Boolean.valueOf(contextcapabilities.GL_ARB_base_instance)); + playerSnooper.addStatToSnooper("gl_caps[ARB_blend_func_extended]", Boolean.valueOf(contextcapabilities.GL_ARB_blend_func_extended)); + playerSnooper.addStatToSnooper("gl_caps[ARB_clear_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_clear_buffer_object)); + playerSnooper.addStatToSnooper("gl_caps[ARB_color_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_color_buffer_float)); + playerSnooper.addStatToSnooper("gl_caps[ARB_compatibility]", Boolean.valueOf(contextcapabilities.GL_ARB_compatibility)); + playerSnooper.addStatToSnooper("gl_caps[ARB_compressed_texture_pixel_storage]", Boolean.valueOf(contextcapabilities.GL_ARB_compressed_texture_pixel_storage)); + playerSnooper.addStatToSnooper("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader)); + playerSnooper.addStatToSnooper("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer)); + playerSnooper.addStatToSnooper("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image)); + playerSnooper.addStatToSnooper("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float)); + playerSnooper.addStatToSnooper("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader)); + playerSnooper.addStatToSnooper("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer)); + playerSnooper.addStatToSnooper("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image)); + playerSnooper.addStatToSnooper("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float)); + playerSnooper.addStatToSnooper("gl_caps[ARB_depth_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_clamp)); + playerSnooper.addStatToSnooper("gl_caps[ARB_depth_texture]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_texture)); + playerSnooper.addStatToSnooper("gl_caps[ARB_draw_buffers]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers)); + playerSnooper.addStatToSnooper("gl_caps[ARB_draw_buffers_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers_blend)); + playerSnooper.addStatToSnooper("gl_caps[ARB_draw_elements_base_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_elements_base_vertex)); + playerSnooper.addStatToSnooper("gl_caps[ARB_draw_indirect]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_indirect)); + playerSnooper.addStatToSnooper("gl_caps[ARB_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_instanced)); + playerSnooper.addStatToSnooper("gl_caps[ARB_explicit_attrib_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_attrib_location)); + playerSnooper.addStatToSnooper("gl_caps[ARB_explicit_uniform_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_uniform_location)); + playerSnooper.addStatToSnooper("gl_caps[ARB_fragment_layer_viewport]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_layer_viewport)); + playerSnooper.addStatToSnooper("gl_caps[ARB_fragment_program]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program)); + playerSnooper.addStatToSnooper("gl_caps[ARB_fragment_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_shader)); + playerSnooper.addStatToSnooper("gl_caps[ARB_fragment_program_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program_shadow)); + playerSnooper.addStatToSnooper("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_object)); + playerSnooper.addStatToSnooper("gl_caps[ARB_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_sRGB)); + playerSnooper.addStatToSnooper("gl_caps[ARB_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_ARB_geometry_shader4)); + playerSnooper.addStatToSnooper("gl_caps[ARB_gpu_shader5]", Boolean.valueOf(contextcapabilities.GL_ARB_gpu_shader5)); + playerSnooper.addStatToSnooper("gl_caps[ARB_half_float_pixel]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_pixel)); + playerSnooper.addStatToSnooper("gl_caps[ARB_half_float_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_vertex)); + playerSnooper.addStatToSnooper("gl_caps[ARB_instanced_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_instanced_arrays)); + playerSnooper.addStatToSnooper("gl_caps[ARB_map_buffer_alignment]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_alignment)); + playerSnooper.addStatToSnooper("gl_caps[ARB_map_buffer_range]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_range)); + playerSnooper.addStatToSnooper("gl_caps[ARB_multisample]", Boolean.valueOf(contextcapabilities.GL_ARB_multisample)); + playerSnooper.addStatToSnooper("gl_caps[ARB_multitexture]", Boolean.valueOf(contextcapabilities.GL_ARB_multitexture)); + playerSnooper.addStatToSnooper("gl_caps[ARB_occlusion_query2]", Boolean.valueOf(contextcapabilities.GL_ARB_occlusion_query2)); + playerSnooper.addStatToSnooper("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_pixel_buffer_object)); + playerSnooper.addStatToSnooper("gl_caps[ARB_seamless_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_seamless_cube_map)); + playerSnooper.addStatToSnooper("gl_caps[ARB_shader_objects]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_objects)); + playerSnooper.addStatToSnooper("gl_caps[ARB_shader_stencil_export]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_stencil_export)); + playerSnooper.addStatToSnooper("gl_caps[ARB_shader_texture_lod]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_texture_lod)); + playerSnooper.addStatToSnooper("gl_caps[ARB_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow)); + playerSnooper.addStatToSnooper("gl_caps[ARB_shadow_ambient]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow_ambient)); + playerSnooper.addStatToSnooper("gl_caps[ARB_stencil_texturing]", Boolean.valueOf(contextcapabilities.GL_ARB_stencil_texturing)); + playerSnooper.addStatToSnooper("gl_caps[ARB_sync]", Boolean.valueOf(contextcapabilities.GL_ARB_sync)); + playerSnooper.addStatToSnooper("gl_caps[ARB_tessellation_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_tessellation_shader)); + playerSnooper.addStatToSnooper("gl_caps[ARB_texture_border_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_border_clamp)); + playerSnooper.addStatToSnooper("gl_caps[ARB_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_buffer_object)); + playerSnooper.addStatToSnooper("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map)); + playerSnooper.addStatToSnooper("gl_caps[ARB_texture_cube_map_array]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map_array)); + playerSnooper.addStatToSnooper("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_non_power_of_two)); + playerSnooper.addStatToSnooper("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_uniform_buffer_object)); + playerSnooper.addStatToSnooper("gl_caps[ARB_vertex_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_blend)); + playerSnooper.addStatToSnooper("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_buffer_object)); + playerSnooper.addStatToSnooper("gl_caps[ARB_vertex_program]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_program)); + playerSnooper.addStatToSnooper("gl_caps[ARB_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_shader)); + playerSnooper.addStatToSnooper("gl_caps[EXT_bindable_uniform]", Boolean.valueOf(contextcapabilities.GL_EXT_bindable_uniform)); + playerSnooper.addStatToSnooper("gl_caps[EXT_blend_equation_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_equation_separate)); + playerSnooper.addStatToSnooper("gl_caps[EXT_blend_func_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_func_separate)); + playerSnooper.addStatToSnooper("gl_caps[EXT_blend_minmax]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_minmax)); + playerSnooper.addStatToSnooper("gl_caps[EXT_blend_subtract]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_subtract)); + playerSnooper.addStatToSnooper("gl_caps[EXT_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_EXT_draw_instanced)); + playerSnooper.addStatToSnooper("gl_caps[EXT_framebuffer_multisample]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_multisample)); + playerSnooper.addStatToSnooper("gl_caps[EXT_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_object)); + playerSnooper.addStatToSnooper("gl_caps[EXT_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_sRGB)); + playerSnooper.addStatToSnooper("gl_caps[EXT_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_geometry_shader4)); + playerSnooper.addStatToSnooper("gl_caps[EXT_gpu_program_parameters]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_program_parameters)); + playerSnooper.addStatToSnooper("gl_caps[EXT_gpu_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_shader4)); + playerSnooper.addStatToSnooper("gl_caps[EXT_multi_draw_arrays]", Boolean.valueOf(contextcapabilities.GL_EXT_multi_draw_arrays)); + playerSnooper.addStatToSnooper("gl_caps[EXT_packed_depth_stencil]", Boolean.valueOf(contextcapabilities.GL_EXT_packed_depth_stencil)); + playerSnooper.addStatToSnooper("gl_caps[EXT_paletted_texture]", Boolean.valueOf(contextcapabilities.GL_EXT_paletted_texture)); + playerSnooper.addStatToSnooper("gl_caps[EXT_rescale_normal]", Boolean.valueOf(contextcapabilities.GL_EXT_rescale_normal)); + playerSnooper.addStatToSnooper("gl_caps[EXT_separate_shader_objects]", Boolean.valueOf(contextcapabilities.GL_EXT_separate_shader_objects)); + playerSnooper.addStatToSnooper("gl_caps[EXT_shader_image_load_store]", Boolean.valueOf(contextcapabilities.GL_EXT_shader_image_load_store)); + playerSnooper.addStatToSnooper("gl_caps[EXT_shadow_funcs]", Boolean.valueOf(contextcapabilities.GL_EXT_shadow_funcs)); + playerSnooper.addStatToSnooper("gl_caps[EXT_shared_texture_palette]", Boolean.valueOf(contextcapabilities.GL_EXT_shared_texture_palette)); + playerSnooper.addStatToSnooper("gl_caps[EXT_stencil_clear_tag]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_clear_tag)); + playerSnooper.addStatToSnooper("gl_caps[EXT_stencil_two_side]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_two_side)); + playerSnooper.addStatToSnooper("gl_caps[EXT_stencil_wrap]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_wrap)); + playerSnooper.addStatToSnooper("gl_caps[EXT_texture_3d]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_3d)); + playerSnooper.addStatToSnooper("gl_caps[EXT_texture_array]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_array)); + playerSnooper.addStatToSnooper("gl_caps[EXT_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_buffer_object)); + playerSnooper.addStatToSnooper("gl_caps[EXT_texture_integer]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_integer)); + playerSnooper.addStatToSnooper("gl_caps[EXT_texture_lod_bias]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_lod_bias)); + playerSnooper.addStatToSnooper("gl_caps[EXT_texture_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_sRGB)); + playerSnooper.addStatToSnooper("gl_caps[EXT_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_shader)); + playerSnooper.addStatToSnooper("gl_caps[EXT_vertex_weighting]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_weighting)); + playerSnooper.addStatToSnooper("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); + GL11.glGetError(); + playerSnooper.addStatToSnooper("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); + GL11.glGetError(); + playerSnooper.addStatToSnooper("gl_caps[gl_max_vertex_attribs]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_ATTRIBS))); + GL11.glGetError(); + playerSnooper.addStatToSnooper("gl_caps[gl_max_vertex_texture_image_units]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS))); + GL11.glGetError(); + playerSnooper.addStatToSnooper("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_TEXTURE_IMAGE_UNITS))); + GL11.glGetError(); + playerSnooper.addStatToSnooper("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GL11.glGetInteger(35071))); + GL11.glGetError(); + playerSnooper.addStatToSnooper("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); + } + + public static int getGLMaximumTextureSize() { + for (int i = 16384; i > 0; i >>= 1) { + GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer) ((ByteBuffer) null)); + int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); + + if (j != 0) { + return i; + } + } + + return -1; + } + + public boolean isSnooperEnabled() { + return this.gameSettings.snooperEnabled; + } + + public void setServerData(ServerData serverDataIn) { + this.currentServerData = serverDataIn; + + } + + public ServerData getCurrentServerData() { + return this.currentServerData; + } + + public boolean isIntegratedServerRunning() { + return this.integratedServerIsRunning; + } + + public boolean isSingleplayer() { + return this.integratedServerIsRunning && this.theIntegratedServer != null; + } + + public IntegratedServer getIntegratedServer() { + return this.theIntegratedServer; + } + + public static void stopIntegratedServer() { + if (theMinecraft != null) { + IntegratedServer integratedserver = theMinecraft.getIntegratedServer(); + + if (integratedserver != null) { + integratedserver.stopServer(); + } + } + } + + public PlayerUsageSnooper getPlayerUsageSnooper() { + return this.usageSnooper; + } + + public static long getSystemTime() { + return Sys.getTime() * 1000L / Sys.getTimerResolution(); + } + + public boolean isFullScreen() { + return this.fullscreen; + } + + public Session getSession() { + return this.session; + } + + public PropertyMap getTwitchDetails() { + return this.twitchDetails; + } + + public PropertyMap getProfileProperties() { + if (this.profileProperties.isEmpty()) { + GameProfile gameprofile = this.getSessionService().fillProfileProperties(this.session.getProfile(), false); + this.profileProperties.putAll(gameprofile.getProperties()); + } + + return this.profileProperties; + } + + public Proxy getProxy() { + return this.proxy; + } + + public TextureManager getTextureManager() { + return this.renderEngine; + } + + public IResourceManager getResourceManager() { + return this.mcResourceManager; + } + + public ResourcePackRepository getResourcePackRepository() { + return this.mcResourcePackRepository; + } + + public LanguageManager getLanguageManager() { + return this.mcLanguageManager; + } + + public TextureMap getTextureMapBlocks() { + return this.textureMapBlocks; + } + + public boolean isJava64bit() { + return this.jvm64bit; + } + + public boolean isGamePaused() { + return this.isGamePaused; + } + + public SoundHandler getSoundHandler() { + return this.mcSoundHandler; + } + + public MusicTicker.MusicType getAmbientMusicType() { + return this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU; + } + + public IStream getTwitchStream() { + return this.stream; + } + + public void dispatchKeypresses() { + int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey(); + + if (i != 0 && !Keyboard.isRepeatEvent()) { + if (!(this.currentScreen instanceof GuiControls) || ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) { + if (Keyboard.getEventKeyState()) { + if (i == this.gameSettings.keyBindStreamStartStop.getKeyCode()) { + if (this.getTwitchStream().isBroadcasting()) { + this.getTwitchStream().stopBroadcasting(); + } else if (this.getTwitchStream().isReadyToBroadcast()) { + this.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() { + public void confirmClicked(boolean result, int id) { + if (result) { + Minecraft.this.getTwitchStream().func_152930_t(); + } + + Minecraft.this.displayGuiScreen((GuiScreen) null); + } + }, I18n.format("stream.confirm_start", new Object[0]), "", 0)); + } else if (this.getTwitchStream().func_152928_D() && this.getTwitchStream().func_152936_l()) { + if (this.theWorld != null) { + this.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText("Not ready to start streaming yet!")); + } + } else { + GuiStreamUnavailable.func_152321_a(this.currentScreen); + } + } else if (i == this.gameSettings.keyBindStreamPauseUnpause.getKeyCode()) { + if (this.getTwitchStream().isBroadcasting()) { + if (this.getTwitchStream().isPaused()) { + this.getTwitchStream().unpause(); + } else { + this.getTwitchStream().pause(); + } + } + } else if (i == this.gameSettings.keyBindStreamCommercials.getKeyCode()) { + if (this.getTwitchStream().isBroadcasting()) { + this.getTwitchStream().requestCommercial(); + } + } else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) { + this.stream.muteMicrophone(true); + } else if (i == this.gameSettings.keyBindFullscreen.getKeyCode()) { + this.toggleFullscreen(); + } else if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) { + ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc); + } + } else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) { + this.stream.muteMicrophone(false); + } + } + } + } + + public MinecraftSessionService getSessionService() { + return this.sessionService; + } + + public SkinManager getSkinManager() { + return this.skinManager; + } + + public Entity getRenderViewEntity() { + return this.renderViewEntity; + } + + public void setRenderViewEntity(Entity viewingEntity) { + this.renderViewEntity = viewingEntity; + this.entityRenderer.loadEntityShader(viewingEntity); + } + + public ListenableFuture addScheduledTask(Callable callableToSchedule) { + Validate.notNull(callableToSchedule); + + if (!this.isCallingFromMinecraftThread()) { + ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callableToSchedule); + + synchronized (this.scheduledTasks) { + this.scheduledTasks.add(listenablefuturetask); + return listenablefuturetask; + } + } else { + try { + return Futures.immediateFuture(callableToSchedule.call()); + } catch (Exception exception) { + return Futures.immediateFailedCheckedFuture(exception); + } + } + } + + public ListenableFuture addScheduledTask(Runnable runnableToSchedule) { + Validate.notNull(runnableToSchedule); + return this.addScheduledTask(Executors.callable(runnableToSchedule)); + } + + public boolean isCallingFromMinecraftThread() { + return Thread.currentThread() == this.mcThread; + } + + public BlockRendererDispatcher getBlockRendererDispatcher() { + return this.blockRenderDispatcher; + } + + public RenderManager getRenderManager() { + return this.renderManager; + } + + public RenderItem getRenderItem() { + return this.renderItem; + } + + public ItemRenderer getItemRenderer() { + return this.itemRenderer; + } + + public static int getDebugFPS() { + return debugFPS; + } + + public FrameTimer getFrameTimer() { + return this.frameTimer; + } + + public static Map getSessionInfo() { + Map map = Maps.newHashMap(); + map.put("X-Minecraft-Username", getMinecraft().getSession().getUsername()); + map.put("X-Minecraft-UUID", getMinecraft().getSession().getPlayerID()); + map.put("X-Minecraft-Version", "1.8.9"); + return map; + } + + public boolean isConnectedToRealms() { + return this.connectedToRealms; + } + + public void setConnectedToRealms(boolean isConnected) { + this.connectedToRealms = isConnected; + } + + public void setSession(Session session) { + this.session = session; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/GuardianSound.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/GuardianSound.java new file mode 100644 index 0000000..4ba3e68 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/GuardianSound.java @@ -0,0 +1,35 @@ +package net.minecraft.client.audio; + +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.util.ResourceLocation; + +public class GuardianSound extends MovingSound +{ + private final EntityGuardian guardian; + + public GuardianSound(EntityGuardian guardian) + { + super(new ResourceLocation("minecraft:mob.guardian.attack")); + this.guardian = guardian; + this.attenuationType = ISound.AttenuationType.NONE; + this.repeat = true; + this.repeatDelay = 0; + } + + public void update() + { + if (!this.guardian.isDead && this.guardian.hasTargetedEntity()) + { + this.xPosF = (float)this.guardian.posX; + this.yPosF = (float)this.guardian.posY; + this.zPosF = (float)this.guardian.posZ; + float f = this.guardian.func_175477_p(0.0F); + this.volume = 0.0F + 1.0F * f * f; + this.pitch = 0.7F + 0.5F * f; + } + else + { + this.donePlaying = true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/ISound.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/ISound.java new file mode 100644 index 0000000..72abffb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/ISound.java @@ -0,0 +1,42 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public interface ISound +{ + ResourceLocation getSoundLocation(); + + boolean canRepeat(); + + int getRepeatDelay(); + + float getVolume(); + + float getPitch(); + + float getXPosF(); + + float getYPosF(); + + float getZPosF(); + + ISound.AttenuationType getAttenuationType(); + + public static enum AttenuationType + { + NONE(0), + LINEAR(2); + + private final int type; + + private AttenuationType(int typeIn) + { + this.type = typeIn; + } + + public int getTypeInt() + { + return this.type; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java new file mode 100644 index 0000000..92285c0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java @@ -0,0 +1,8 @@ +package net.minecraft.client.audio; + +public interface ISoundEventAccessor +{ + int getWeight(); + + T cloneEntry(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/ITickableSound.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/ITickableSound.java new file mode 100644 index 0000000..b55e0f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/ITickableSound.java @@ -0,0 +1,8 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ITickable; + +public interface ITickableSound extends ISound, ITickable +{ + boolean isDonePlaying(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSound.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSound.java new file mode 100644 index 0000000..169b244 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSound.java @@ -0,0 +1,18 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public abstract class MovingSound extends PositionedSound implements ITickableSound +{ + protected boolean donePlaying = false; + + protected MovingSound(ResourceLocation location) + { + super(location); + } + + public boolean isDonePlaying() + { + return this.donePlaying; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java new file mode 100644 index 0000000..91ce8d4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java @@ -0,0 +1,45 @@ +package net.minecraft.client.audio; + +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class MovingSoundMinecart extends MovingSound +{ + private final EntityMinecart minecart; + private float distance = 0.0F; + + public MovingSoundMinecart(EntityMinecart minecartIn) + { + super(new ResourceLocation("minecraft:minecart.base")); + this.minecart = minecartIn; + this.repeat = true; + this.repeatDelay = 0; + } + + public void update() + { + if (this.minecart.isDead) + { + this.donePlaying = true; + } + else + { + this.xPosF = (float)this.minecart.posX; + this.yPosF = (float)this.minecart.posY; + this.zPosF = (float)this.minecart.posZ; + float f = MathHelper.sqrt_double(this.minecart.motionX * this.minecart.motionX + this.minecart.motionZ * this.minecart.motionZ); + + if ((double)f >= 0.01D) + { + this.distance = MathHelper.clamp_float(this.distance + 0.0025F, 0.0F, 1.0F); + this.volume = 0.0F + MathHelper.clamp_float(f, 0.0F, 0.5F) * 0.7F; + } + else + { + this.distance = 0.0F; + this.volume = 0.0F; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java new file mode 100644 index 0000000..5374038 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java @@ -0,0 +1,43 @@ +package net.minecraft.client.audio; + +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class MovingSoundMinecartRiding extends MovingSound +{ + private final EntityPlayer player; + private final EntityMinecart minecart; + + public MovingSoundMinecartRiding(EntityPlayer playerRiding, EntityMinecart minecart) + { + super(new ResourceLocation("minecraft:minecart.inside")); + this.player = playerRiding; + this.minecart = minecart; + this.attenuationType = ISound.AttenuationType.NONE; + this.repeat = true; + this.repeatDelay = 0; + } + + public void update() + { + if (!this.minecart.isDead && this.player.isRiding() && this.player.ridingEntity == this.minecart) + { + float f = MathHelper.sqrt_double(this.minecart.motionX * this.minecart.motionX + this.minecart.motionZ * this.minecart.motionZ); + + if ((double)f >= 0.01D) + { + this.volume = 0.0F + MathHelper.clamp_float(f, 0.0F, 1.0F) * 0.75F; + } + else + { + this.volume = 0.0F; + } + } + else + { + this.donePlaying = true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/MusicTicker.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MusicTicker.java new file mode 100644 index 0000000..58ffd12 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/MusicTicker.java @@ -0,0 +1,99 @@ +package net.minecraft.client.audio; + +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ITickable; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class MusicTicker implements ITickable +{ + private final Random rand = new Random(); + private final Minecraft mc; + private ISound currentMusic; + private int timeUntilNextMusic = 100; + + public MusicTicker(Minecraft mcIn) + { + this.mc = mcIn; + } + + public void update() + { + MusicTicker.MusicType musicticker$musictype = this.mc.getAmbientMusicType(); + + if (this.currentMusic != null) + { + if (!musicticker$musictype.getMusicLocation().equals(this.currentMusic.getSoundLocation())) + { + this.mc.getSoundHandler().stopSound(this.currentMusic); + this.timeUntilNextMusic = MathHelper.getRandomIntegerInRange(this.rand, 0, musicticker$musictype.getMinDelay() / 2); + } + + if (!this.mc.getSoundHandler().isSoundPlaying(this.currentMusic)) + { + this.currentMusic = null; + this.timeUntilNextMusic = Math.min(MathHelper.getRandomIntegerInRange(this.rand, musicticker$musictype.getMinDelay(), musicticker$musictype.getMaxDelay()), this.timeUntilNextMusic); + } + } + + if (this.currentMusic == null && this.timeUntilNextMusic-- <= 0) + { + this.func_181558_a(musicticker$musictype); + } + } + + public void func_181558_a(MusicTicker.MusicType p_181558_1_) + { + this.currentMusic = PositionedSoundRecord.create(p_181558_1_.getMusicLocation()); + this.mc.getSoundHandler().playSound(this.currentMusic); + this.timeUntilNextMusic = Integer.MAX_VALUE; + } + + public void func_181557_a() + { + if (this.currentMusic != null) + { + this.mc.getSoundHandler().stopSound(this.currentMusic); + this.currentMusic = null; + this.timeUntilNextMusic = 0; + } + } + + public static enum MusicType + { + MENU(new ResourceLocation("minecraft:music.menu"), 20, 600), + GAME(new ResourceLocation("minecraft:music.game"), 12000, 24000), + CREATIVE(new ResourceLocation("minecraft:music.game.creative"), 1200, 3600), + CREDITS(new ResourceLocation("minecraft:music.game.end.credits"), Integer.MAX_VALUE, Integer.MAX_VALUE), + NETHER(new ResourceLocation("minecraft:music.game.nether"), 1200, 3600), + END_BOSS(new ResourceLocation("minecraft:music.game.end.dragon"), 0, 0), + END(new ResourceLocation("minecraft:music.game.end"), 6000, 24000); + + private final ResourceLocation musicLocation; + private final int minDelay; + private final int maxDelay; + + private MusicType(ResourceLocation location, int minDelayIn, int maxDelayIn) + { + this.musicLocation = location; + this.minDelay = minDelayIn; + this.maxDelay = maxDelayIn; + } + + public ResourceLocation getMusicLocation() + { + return this.musicLocation; + } + + public int getMinDelay() + { + return this.minDelay; + } + + public int getMaxDelay() + { + return this.maxDelay; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/PositionedSound.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/PositionedSound.java new file mode 100644 index 0000000..d69a760 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/PositionedSound.java @@ -0,0 +1,66 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public abstract class PositionedSound implements ISound +{ + protected final ResourceLocation positionedSoundLocation; + protected float volume = 1.0F; + protected float pitch = 1.0F; + protected float xPosF; + protected float yPosF; + protected float zPosF; + protected boolean repeat = false; + protected int repeatDelay = 0; + protected ISound.AttenuationType attenuationType = ISound.AttenuationType.LINEAR; + + protected PositionedSound(ResourceLocation soundResource) + { + this.positionedSoundLocation = soundResource; + } + + public ResourceLocation getSoundLocation() + { + return this.positionedSoundLocation; + } + + public boolean canRepeat() + { + return this.repeat; + } + + public int getRepeatDelay() + { + return this.repeatDelay; + } + + public float getVolume() + { + return this.volume; + } + + public float getPitch() + { + return this.pitch; + } + + public float getXPosF() + { + return this.xPosF; + } + + public float getYPosF() + { + return this.yPosF; + } + + public float getZPosF() + { + return this.zPosF; + } + + public ISound.AttenuationType getAttenuationType() + { + return this.attenuationType; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java new file mode 100644 index 0000000..9bd4c9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java @@ -0,0 +1,39 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public class PositionedSoundRecord extends PositionedSound +{ + public static PositionedSoundRecord create(ResourceLocation soundResource, float pitch) + { + return new PositionedSoundRecord(soundResource, 0.25F, pitch, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F, 0.0F); + } + + public static PositionedSoundRecord create(ResourceLocation soundResource) + { + return new PositionedSoundRecord(soundResource, 1.0F, 1.0F, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F, 0.0F); + } + + public static PositionedSoundRecord create(ResourceLocation soundResource, float xPosition, float yPosition, float zPosition) + { + return new PositionedSoundRecord(soundResource, 4.0F, 1.0F, false, 0, ISound.AttenuationType.LINEAR, xPosition, yPosition, zPosition); + } + + public PositionedSoundRecord(ResourceLocation soundResource, float volume, float pitch, float xPosition, float yPosition, float zPosition) + { + this(soundResource, volume, pitch, false, 0, ISound.AttenuationType.LINEAR, xPosition, yPosition, zPosition); + } + + private PositionedSoundRecord(ResourceLocation soundResource, float volume, float pitch, boolean repeat, int repeatDelay, ISound.AttenuationType attenuationType, float xPosition, float yPosition, float zPosition) + { + super(soundResource); + this.volume = volume; + this.pitch = pitch; + this.xPosF = xPosition; + this.yPosF = yPosition; + this.zPosF = zPosition; + this.repeat = repeat; + this.repeatDelay = repeatDelay; + this.attenuationType = attenuationType; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundCategory.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundCategory.java new file mode 100644 index 0000000..ae0d312 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundCategory.java @@ -0,0 +1,56 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Maps; +import java.util.Map; + +public enum SoundCategory +{ + MASTER("master", 0), + MUSIC("music", 1), + RECORDS("record", 2), + WEATHER("weather", 3), + BLOCKS("block", 4), + MOBS("hostile", 5), + ANIMALS("neutral", 6), + PLAYERS("player", 7), + AMBIENT("ambient", 8); + + private static final Map NAME_CATEGORY_MAP = Maps.newHashMap(); + private static final Map ID_CATEGORY_MAP = Maps.newHashMap(); + private final String categoryName; + private final int categoryId; + + private SoundCategory(String name, int id) + { + this.categoryName = name; + this.categoryId = id; + } + + public String getCategoryName() + { + return this.categoryName; + } + + public int getCategoryId() + { + return this.categoryId; + } + + public static SoundCategory getCategory(String name) + { + return (SoundCategory)NAME_CATEGORY_MAP.get(name); + } + + static { + for (SoundCategory soundcategory : values()) + { + if (NAME_CATEGORY_MAP.containsKey(soundcategory.getCategoryName()) || ID_CATEGORY_MAP.containsKey(Integer.valueOf(soundcategory.getCategoryId()))) + { + throw new Error("Clash in Sound Category ID & Name pools! Cannot insert " + soundcategory); + } + + NAME_CATEGORY_MAP.put(soundcategory.getCategoryName(), soundcategory); + ID_CATEGORY_MAP.put(Integer.valueOf(soundcategory.getCategoryId()), soundcategory); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java new file mode 100644 index 0000000..570986b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java @@ -0,0 +1,23 @@ +package net.minecraft.client.audio; + +public class SoundEventAccessor implements ISoundEventAccessor +{ + private final SoundPoolEntry entry; + private final int weight; + + SoundEventAccessor(SoundPoolEntry entry, int weight) + { + this.entry = entry; + this.weight = weight; + } + + public int getWeight() + { + return this.weight; + } + + public SoundPoolEntry cloneEntry() + { + return new SoundPoolEntry(this.entry); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java new file mode 100644 index 0000000..8052f03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java @@ -0,0 +1,80 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.util.ResourceLocation; + +public class SoundEventAccessorComposite implements ISoundEventAccessor +{ + private final List> soundPool = Lists.>newArrayList(); + private final Random rnd = new Random(); + private final ResourceLocation soundLocation; + private final SoundCategory category; + private double eventPitch; + private double eventVolume; + + public SoundEventAccessorComposite(ResourceLocation soundLocation, double pitch, double volume, SoundCategory category) + { + this.soundLocation = soundLocation; + this.eventVolume = volume; + this.eventPitch = pitch; + this.category = category; + } + + public int getWeight() + { + int i = 0; + + for (ISoundEventAccessor isoundeventaccessor : this.soundPool) + { + i += isoundeventaccessor.getWeight(); + } + + return i; + } + + public SoundPoolEntry cloneEntry() + { + int i = this.getWeight(); + + if (!this.soundPool.isEmpty() && i != 0) + { + int j = this.rnd.nextInt(i); + + for (ISoundEventAccessor isoundeventaccessor : this.soundPool) + { + j -= isoundeventaccessor.getWeight(); + + if (j < 0) + { + SoundPoolEntry soundpoolentry = (SoundPoolEntry)isoundeventaccessor.cloneEntry(); + soundpoolentry.setPitch(soundpoolentry.getPitch() * this.eventPitch); + soundpoolentry.setVolume(soundpoolentry.getVolume() * this.eventVolume); + return soundpoolentry; + } + } + + return SoundHandler.missing_sound; + } + else + { + return SoundHandler.missing_sound; + } + } + + public void addSoundToEventPool(ISoundEventAccessor sound) + { + this.soundPool.add(sound); + } + + public ResourceLocation getSoundEventLocation() + { + return this.soundLocation; + } + + public SoundCategory getSoundCategory() + { + return this.category; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundHandler.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundHandler.java new file mode 100644 index 0000000..ab36f06 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundHandler.java @@ -0,0 +1,273 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ITickable; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.*; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +public class SoundHandler implements IResourceManagerReloadListener, ITickable +{ + private static final Logger logger = LogManager.getLogger(); + private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(SoundList.class, new SoundListSerializer()).create(); + private static final ParameterizedType TYPE = new ParameterizedType() + { + public Type[] getActualTypeArguments() + { + return new Type[] {String.class, SoundList.class}; + } + public Type getRawType() + { + return Map.class; + } + public Type getOwnerType() + { + return null; + } + }; + public static final SoundPoolEntry missing_sound = new SoundPoolEntry(new ResourceLocation("meta:missing_sound"), 0.0D, 0.0D, false); + private final SoundRegistry sndRegistry = new SoundRegistry(); + public final SoundManager sndManager; + private final IResourceManager mcResourceManager; + + public SoundHandler(IResourceManager manager, GameSettings gameSettingsIn) + { + this.mcResourceManager = manager; + this.sndManager = new SoundManager(this, gameSettingsIn); + } + + public void onResourceManagerReload(IResourceManager resourceManager) + { + this.sndManager.reloadSoundSystem(); + this.sndRegistry.clearMap(); + + for (String s : resourceManager.getResourceDomains()) + { + try + { + for (IResource iresource : resourceManager.getAllResources(new ResourceLocation(s, "sounds.json"))) + { + try + { + Map map = this.getSoundMap(iresource.getInputStream()); + + for (Entry entry : map.entrySet()) + { + this.loadSoundResource(new ResourceLocation(s, (String)entry.getKey()), (SoundList)entry.getValue()); + } + } + catch (RuntimeException runtimeexception) + { + logger.warn((String)"Invalid sounds.json", (Throwable)runtimeexception); + } + } + } + catch (IOException var11) + { + ; + } + } + } + + protected Map getSoundMap(InputStream stream) + { + Map map; + + try + { + map = (Map)GSON.fromJson((Reader)(new InputStreamReader(stream)), TYPE); + } + finally + { + IOUtils.closeQuietly(stream); + } + + return map; + } + + private void loadSoundResource(ResourceLocation location, SoundList sounds) + { + boolean flag = !this.sndRegistry.containsKey(location); + SoundEventAccessorComposite soundeventaccessorcomposite; + + if (!flag && !sounds.canReplaceExisting()) + { + soundeventaccessorcomposite = (SoundEventAccessorComposite)this.sndRegistry.getObject(location); + } + else + { + if (!flag) + { + logger.debug("Replaced sound event location {}", new Object[] {location}); + } + + soundeventaccessorcomposite = new SoundEventAccessorComposite(location, 1.0D, 1.0D, sounds.getSoundCategory()); + this.sndRegistry.registerSound(soundeventaccessorcomposite); + } + + for (final SoundList.SoundEntry soundlist$soundentry : sounds.getSoundList()) + { + String s = soundlist$soundentry.getSoundEntryName(); + ResourceLocation resourcelocation = new ResourceLocation(s); + final String s1 = s.contains(":") ? resourcelocation.getResourceDomain() : location.getResourceDomain(); + ISoundEventAccessor isoundeventaccessor; + + switch (soundlist$soundentry.getSoundEntryType()) + { + case FILE: + ResourceLocation resourcelocation1 = new ResourceLocation(s1, "sounds/" + resourcelocation.getResourcePath() + ".ogg"); + InputStream inputstream = null; + + try + { + inputstream = this.mcResourceManager.getResource(resourcelocation1).getInputStream(); + } + catch (FileNotFoundException var18) + { + logger.warn("File {} does not exist, cannot add it to event {}", new Object[] {resourcelocation1, location}); + continue; + } + catch (IOException ioexception) + { + logger.warn((String)("Could not load sound file " + resourcelocation1 + ", cannot add it to event " + location), (Throwable)ioexception); + continue; + } + finally + { + IOUtils.closeQuietly(inputstream); + } + + isoundeventaccessor = new SoundEventAccessor(new SoundPoolEntry(resourcelocation1, (double)soundlist$soundentry.getSoundEntryPitch(), (double)soundlist$soundentry.getSoundEntryVolume(), soundlist$soundentry.isStreaming()), soundlist$soundentry.getSoundEntryWeight()); + break; + + case SOUND_EVENT: + isoundeventaccessor = new ISoundEventAccessor() + { + final ResourceLocation field_148726_a = new ResourceLocation(s1, soundlist$soundentry.getSoundEntryName()); + public int getWeight() + { + SoundEventAccessorComposite soundeventaccessorcomposite1 = (SoundEventAccessorComposite)SoundHandler.this.sndRegistry.getObject(this.field_148726_a); + return soundeventaccessorcomposite1 == null ? 0 : soundeventaccessorcomposite1.getWeight(); + } + public SoundPoolEntry cloneEntry() + { + SoundEventAccessorComposite soundeventaccessorcomposite1 = (SoundEventAccessorComposite)SoundHandler.this.sndRegistry.getObject(this.field_148726_a); + return soundeventaccessorcomposite1 == null ? SoundHandler.missing_sound : soundeventaccessorcomposite1.cloneEntry(); + } + }; + + break; + default: + throw new IllegalStateException("IN YOU FACE"); + } + + soundeventaccessorcomposite.addSoundToEventPool(isoundeventaccessor); + } + } + + public SoundEventAccessorComposite getSound(ResourceLocation location) + { + return (SoundEventAccessorComposite)this.sndRegistry.getObject(location); + } + + public void playSound(ISound sound) + { + this.sndManager.playSound(sound); + } + + public void playDelayedSound(ISound sound, int delay) + { + this.sndManager.playDelayedSound(sound, delay); + } + + public void setListener(EntityPlayer player, float p_147691_2_) + { + this.sndManager.setListener(player, p_147691_2_); + } + + public void pauseSounds() + { + this.sndManager.pauseAllSounds(); + } + + public void stopSounds() + { + this.sndManager.stopAllSounds(); + } + + public void unloadSounds() + { + this.sndManager.unloadSoundSystem(); + } + + public void update() + { + this.sndManager.updateAllSounds(); + } + + public void resumeSounds() + { + this.sndManager.resumeAllSounds(); + } + + public void setSoundLevel(SoundCategory category, float volume) + { + if (category == SoundCategory.MASTER && volume <= 0.0F) + { + this.stopSounds(); + } + + this.sndManager.setSoundCategoryVolume(category, volume); + } + + public void stopSound(ISound p_147683_1_) + { + this.sndManager.stopSound(p_147683_1_); + } + + public SoundEventAccessorComposite getRandomSoundFromCategories(SoundCategory... categories) + { + List list = Lists.newArrayList(); + + for (ResourceLocation resourcelocation : this.sndRegistry.getKeys()) + { + SoundEventAccessorComposite soundeventaccessorcomposite = (SoundEventAccessorComposite)this.sndRegistry.getObject(resourcelocation); + + if (ArrayUtils.contains(categories, soundeventaccessorcomposite.getSoundCategory())) + { + list.add(soundeventaccessorcomposite); + } + } + + if (list.isEmpty()) + { + return null; + } + else + { + return (SoundEventAccessorComposite)list.get((new Random()).nextInt(list.size())); + } + } + + public boolean isSoundPlaying(ISound sound) + { + return this.sndManager.isSoundPlaying(sound); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundList.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundList.java new file mode 100644 index 0000000..0784125 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundList.java @@ -0,0 +1,132 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import java.util.List; + +public class SoundList +{ + private final List soundList = Lists.newArrayList(); + private boolean replaceExisting; + private SoundCategory category; + + public List getSoundList() + { + return this.soundList; + } + + public boolean canReplaceExisting() + { + return this.replaceExisting; + } + + public void setReplaceExisting(boolean p_148572_1_) + { + this.replaceExisting = p_148572_1_; + } + + public SoundCategory getSoundCategory() + { + return this.category; + } + + public void setSoundCategory(SoundCategory soundCat) + { + this.category = soundCat; + } + + public static class SoundEntry + { + private String name; + private float volume = 1.0F; + private float pitch = 1.0F; + private int weight = 1; + private SoundList.SoundEntry.Type type = SoundList.SoundEntry.Type.FILE; + private boolean streaming = false; + + public String getSoundEntryName() + { + return this.name; + } + + public void setSoundEntryName(String nameIn) + { + this.name = nameIn; + } + + public float getSoundEntryVolume() + { + return this.volume; + } + + public void setSoundEntryVolume(float volumeIn) + { + this.volume = volumeIn; + } + + public float getSoundEntryPitch() + { + return this.pitch; + } + + public void setSoundEntryPitch(float pitchIn) + { + this.pitch = pitchIn; + } + + public int getSoundEntryWeight() + { + return this.weight; + } + + public void setSoundEntryWeight(int weightIn) + { + this.weight = weightIn; + } + + public SoundList.SoundEntry.Type getSoundEntryType() + { + return this.type; + } + + public void setSoundEntryType(SoundList.SoundEntry.Type typeIn) + { + this.type = typeIn; + } + + public boolean isStreaming() + { + return this.streaming; + } + + public void setStreaming(boolean isStreaming) + { + this.streaming = isStreaming; + } + + public static enum Type + { + FILE("file"), + SOUND_EVENT("event"); + + private final String field_148583_c; + + private Type(String p_i45109_3_) + { + this.field_148583_c = p_i45109_3_; + } + + public static SoundList.SoundEntry.Type getType(String p_148580_0_) + { + for (SoundList.SoundEntry.Type soundlist$soundentry$type : values()) + { + if (soundlist$soundentry$type.field_148583_c.equals(p_148580_0_)) + { + return soundlist$soundentry$type; + } + } + + return null; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundListSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundListSerializer.java new file mode 100644 index 0000000..c4a06e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundListSerializer.java @@ -0,0 +1,82 @@ +package net.minecraft.client.audio; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +public class SoundListSerializer implements JsonDeserializer +{ + public SoundList deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_deserialize_1_, "entry"); + SoundList soundlist = new SoundList(); + soundlist.setReplaceExisting(JsonUtils.getBoolean(jsonobject, "replace", false)); + SoundCategory soundcategory = SoundCategory.getCategory(JsonUtils.getString(jsonobject, "category", SoundCategory.MASTER.getCategoryName())); + soundlist.setSoundCategory(soundcategory); + Validate.notNull(soundcategory, "Invalid category", new Object[0]); + + if (jsonobject.has("sounds")) + { + JsonArray jsonarray = JsonUtils.getJsonArray(jsonobject, "sounds"); + + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonElement jsonelement = jsonarray.get(i); + SoundList.SoundEntry soundlist$soundentry = new SoundList.SoundEntry(); + + if (JsonUtils.isString(jsonelement)) + { + soundlist$soundentry.setSoundEntryName(JsonUtils.getString(jsonelement, "sound")); + } + else + { + JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonelement, "sound"); + soundlist$soundentry.setSoundEntryName(JsonUtils.getString(jsonobject1, "name")); + + if (jsonobject1.has("type")) + { + SoundList.SoundEntry.Type soundlist$soundentry$type = SoundList.SoundEntry.Type.getType(JsonUtils.getString(jsonobject1, "type")); + Validate.notNull(soundlist$soundentry$type, "Invalid type", new Object[0]); + soundlist$soundentry.setSoundEntryType(soundlist$soundentry$type); + } + + if (jsonobject1.has("volume")) + { + float f = JsonUtils.getFloat(jsonobject1, "volume"); + Validate.isTrue(f > 0.0F, "Invalid volume", new Object[0]); + soundlist$soundentry.setSoundEntryVolume(f); + } + + if (jsonobject1.has("pitch")) + { + float f1 = JsonUtils.getFloat(jsonobject1, "pitch"); + Validate.isTrue(f1 > 0.0F, "Invalid pitch", new Object[0]); + soundlist$soundentry.setSoundEntryPitch(f1); + } + + if (jsonobject1.has("weight")) + { + int j = JsonUtils.getInt(jsonobject1, "weight"); + Validate.isTrue(j > 0, "Invalid weight", new Object[0]); + soundlist$soundentry.setSoundEntryWeight(j); + } + + if (jsonobject1.has("stream")) + { + soundlist$soundentry.setStreaming(JsonUtils.getBoolean(jsonobject1, "stream")); + } + } + + soundlist.getSoundList().add(soundlist$soundentry); + } + } + + return soundlist; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundManager.java new file mode 100644 index 0000000..e5cbe75 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundManager.java @@ -0,0 +1,506 @@ +package net.minecraft.client.audio; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.collect.*; +import io.netty.util.internal.ThreadLocalRandom; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; +import paulscode.sound.*; +import paulscode.sound.codecs.CodecJOrbis; +import paulscode.sound.libraries.LibraryLWJGLOpenAL; + +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.UUID; + +public class SoundManager +{ + private static final Marker LOG_MARKER = MarkerManager.getMarker("SOUNDS"); + private static final Logger logger = LogManager.getLogger(); + private final SoundHandler sndHandler; + private final GameSettings options; + private SoundManager.SoundSystemStarterThread sndSystem; + private boolean loaded; + private int playTime = 0; + private final Map playingSounds = HashBiMap.create(); + private final Map invPlayingSounds; + private Map playingSoundPoolEntries; + private final Multimap categorySounds; + private final List tickableSounds; + private final Map delayedSounds; + private final Map playingSoundsStopTime; + + public void playSound(String string, float f) { + if (this.loaded) { + ResourceLocation resourceLocation = new ResourceLocation("client/sound/" + string + ".ogg"); + String string2 = UUID.randomUUID().toString(); + this.sndSystem.newStreamingSource(false, string2, getURLForSoundResource(resourceLocation), resourceLocation.toString(), false, 0.0f, 0.0f, 0.0f, 0, SoundSystemConfig.getDefaultRolloff()); + this.sndSystem.setPitch(string2, 1.0f); + this.sndSystem.setVolume(string2, 1.0f * f); + this.sndSystem.play(string2); + } + } + + public SoundManager(SoundHandler p_i45119_1_, GameSettings p_i45119_2_) + { + this.invPlayingSounds = ((BiMap)this.playingSounds).inverse(); + this.playingSoundPoolEntries = Maps.newHashMap(); + this.categorySounds = HashMultimap.create(); + this.tickableSounds = Lists.newArrayList(); + this.delayedSounds = Maps.newHashMap(); + this.playingSoundsStopTime = Maps.newHashMap(); + this.sndHandler = p_i45119_1_; + this.options = p_i45119_2_; + + try + { + SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); + SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); + } + catch (SoundSystemException soundsystemexception) + { + logger.error(LOG_MARKER, (String)"Error linking with the LibraryJavaSound plug-in", (Throwable)soundsystemexception); + } + } + + public void reloadSoundSystem() + { + this.unloadSoundSystem(); + this.loadSoundSystem(); + } + + private synchronized void loadSoundSystem() + { + if (!this.loaded) + { + try + { + (new Thread(new Runnable() + { + public void run() + { + SoundSystemConfig.setLogger(new SoundSystemLogger() + { + public void message(String p_message_1_, int p_message_2_) + { + if (!p_message_1_.isEmpty()) + { + SoundManager.logger.info(p_message_1_); + } + } + public void importantMessage(String p_importantMessage_1_, int p_importantMessage_2_) + { + if (!p_importantMessage_1_.isEmpty()) + { + SoundManager.logger.warn(p_importantMessage_1_); + } + } + public void errorMessage(String p_errorMessage_1_, String p_errorMessage_2_, int p_errorMessage_3_) + { + if (!p_errorMessage_2_.isEmpty()) + { + SoundManager.logger.error("Error in class \'" + p_errorMessage_1_ + "\'"); + SoundManager.logger.error(p_errorMessage_2_); + } + } + }); + SoundManager.this.sndSystem = SoundManager.this.new SoundSystemStarterThread(); + SoundManager.this.loaded = true; + SoundManager.this.sndSystem.setMasterVolume(SoundManager.this.options.getSoundLevel(SoundCategory.MASTER)); + SoundManager.logger.info(SoundManager.LOG_MARKER, "Sound engine started"); + } + }, "Sound Library Loader")).start(); + } + catch (RuntimeException runtimeexception) + { + logger.error(LOG_MARKER, (String)"Error starting SoundSystem. Turning off sounds & music", (Throwable)runtimeexception); + this.options.setSoundLevel(SoundCategory.MASTER, 0.0F); + this.options.saveOptions(); + } + } + } + + private float getSoundCategoryVolume(SoundCategory category) + { + return category != null && category != SoundCategory.MASTER ? this.options.getSoundLevel(category) : 1.0F; + } + + public void setSoundCategoryVolume(SoundCategory category, float volume) + { + if (this.loaded) + { + if (category == SoundCategory.MASTER) + { + this.sndSystem.setMasterVolume(volume); + } + else + { + for (String s : this.categorySounds.get(category)) + { + ISound isound = (ISound)this.playingSounds.get(s); + float f = this.getNormalizedVolume(isound, (SoundPoolEntry)this.playingSoundPoolEntries.get(isound), category); + + if (f <= 0.0F) + { + this.stopSound(isound); + } + else + { + this.sndSystem.setVolume(s, f); + } + } + } + } + } + + public void unloadSoundSystem() + { + if (this.loaded) + { + this.stopAllSounds(); + this.sndSystem.cleanup(); + this.loaded = false; + } + } + + public void stopAllSounds() + { + if (this.loaded) + { + for (String s : this.playingSounds.keySet()) + { + this.sndSystem.stop(s); + } + + this.playingSounds.clear(); + this.delayedSounds.clear(); + this.tickableSounds.clear(); + this.categorySounds.clear(); + this.playingSoundPoolEntries.clear(); + this.playingSoundsStopTime.clear(); + } + } + + public void updateAllSounds() + { + ++this.playTime; + + for (ITickableSound itickablesound : this.tickableSounds) + { + itickablesound.update(); + + if (itickablesound.isDonePlaying()) + { + this.stopSound(itickablesound); + } + else + { + String s = (String)this.invPlayingSounds.get(itickablesound); + this.sndSystem.setVolume(s, this.getNormalizedVolume(itickablesound, (SoundPoolEntry)this.playingSoundPoolEntries.get(itickablesound), this.sndHandler.getSound(itickablesound.getSoundLocation()).getSoundCategory())); + this.sndSystem.setPitch(s, this.getNormalizedPitch(itickablesound, (SoundPoolEntry)this.playingSoundPoolEntries.get(itickablesound))); + this.sndSystem.setPosition(s, itickablesound.getXPosF(), itickablesound.getYPosF(), itickablesound.getZPosF()); + } + } + + Iterator> iterator = this.playingSounds.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + String s1 = (String)entry.getKey(); + ISound isound = (ISound)entry.getValue(); + + if (!this.sndSystem.playing(s1)) + { + int i = ((Integer)this.playingSoundsStopTime.get(s1)).intValue(); + + if (i <= this.playTime) + { + int j = isound.getRepeatDelay(); + + if (isound.canRepeat() && j > 0) + { + this.delayedSounds.put(isound, Integer.valueOf(this.playTime + j)); + } + + iterator.remove(); + logger.debug(LOG_MARKER, "Removed channel {} because it\'s not playing anymore", new Object[] {s1}); + this.sndSystem.removeSource(s1); + this.playingSoundsStopTime.remove(s1); + this.playingSoundPoolEntries.remove(isound); + + try + { + this.categorySounds.remove(this.sndHandler.getSound(isound.getSoundLocation()).getSoundCategory(), s1); + } + catch (RuntimeException var8) + { + ; + } + + if (isound instanceof ITickableSound) + { + this.tickableSounds.remove(isound); + } + } + } + } + + Iterator> iterator1 = this.delayedSounds.entrySet().iterator(); + + while (iterator1.hasNext()) + { + Entry entry1 = (Entry)iterator1.next(); + + if (this.playTime >= ((Integer)entry1.getValue()).intValue()) + { + ISound isound1 = (ISound)entry1.getKey(); + + if (isound1 instanceof ITickableSound) + { + ((ITickableSound)isound1).update(); + } + + this.playSound(isound1); + iterator1.remove(); + } + } + } + + public boolean isSoundPlaying(ISound sound) + { + if (!this.loaded) + { + return false; + } + else + { + String s = (String)this.invPlayingSounds.get(sound); + return s == null ? false : this.sndSystem.playing(s) || this.playingSoundsStopTime.containsKey(s) && ((Integer)this.playingSoundsStopTime.get(s)).intValue() <= this.playTime; + } + } + + public void stopSound(ISound sound) + { + if (this.loaded) + { + String s = (String)this.invPlayingSounds.get(sound); + + if (s != null) + { + this.sndSystem.stop(s); + } + } + } + + public void playSound(ISound p_sound) + { + if (this.loaded) + { + if (this.sndSystem.getMasterVolume() <= 0.0F) + { + logger.debug(LOG_MARKER, "Skipped playing soundEvent: {}, master volume was zero", new Object[] {p_sound.getSoundLocation()}); + } + else + { + SoundEventAccessorComposite soundeventaccessorcomposite = this.sndHandler.getSound(p_sound.getSoundLocation()); + + if (soundeventaccessorcomposite == null && !p_sound.getSoundLocation().toString().equals("none")) + { + logger.warn(LOG_MARKER, "Unable to play unknown soundEvent: {}", p_sound.getSoundLocation()); + } + else + { + SoundPoolEntry soundpoolentry = soundeventaccessorcomposite.cloneEntry(); + + if (soundpoolentry == SoundHandler.missing_sound) + { + logger.warn(LOG_MARKER, "Unable to play empty soundEvent: {}", new Object[] {soundeventaccessorcomposite.getSoundEventLocation()}); + } + else + { + float f = p_sound.getVolume(); + float f1 = 16.0F; + + if (f > 1.0F) + { + f1 *= f; + } + + SoundCategory soundcategory = soundeventaccessorcomposite.getSoundCategory(); + float f2 = this.getNormalizedVolume(p_sound, soundpoolentry, soundcategory); + double d0 = (double)this.getNormalizedPitch(p_sound, soundpoolentry); + ResourceLocation resourcelocation = soundpoolentry.getSoundPoolEntryLocation(); + + if (f2 == 0.0F) + { + logger.debug(LOG_MARKER, "Skipped playing sound {}, volume was zero.", new Object[] {resourcelocation}); + } + else + { + boolean flag = p_sound.canRepeat() && p_sound.getRepeatDelay() == 0; + String s = MathHelper.getRandomUuid(ThreadLocalRandom.current()).toString(); + + if (soundpoolentry.isStreamingSound()) + { + this.sndSystem.newStreamingSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, p_sound.getXPosF(), p_sound.getYPosF(), p_sound.getZPosF(), p_sound.getAttenuationType().getTypeInt(), f1); + } + else + { + this.sndSystem.newSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, p_sound.getXPosF(), p_sound.getYPosF(), p_sound.getZPosF(), p_sound.getAttenuationType().getTypeInt(), f1); + } + + logger.debug(LOG_MARKER, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.getSoundPoolEntryLocation(), soundeventaccessorcomposite.getSoundEventLocation(), s}); + this.sndSystem.setPitch(s, (float)d0); + this.sndSystem.setVolume(s, f2); + this.sndSystem.play(s); + this.playingSoundsStopTime.put(s, Integer.valueOf(this.playTime + 20)); + this.playingSounds.put(s, p_sound); + + CheatBreaker.getInstance().getModuleManager().hearingAssistance.setCurrentSound(p_sound.getSoundLocation().getResourcePath().replaceAll("minecraft:", "")); + CheatBreaker.getInstance().getModuleManager().hearingAssistance.setLastUpdated(System.currentTimeMillis()); + this.playingSoundPoolEntries.put(p_sound, soundpoolentry); + + + + if (soundcategory != SoundCategory.MASTER) + { + this.categorySounds.put(soundcategory, s); + } + + if (p_sound instanceof ITickableSound) + { + this.tickableSounds.add((ITickableSound)p_sound); + } + } + } + } + } + } + } + + private float getNormalizedPitch(ISound sound, SoundPoolEntry entry) + { + return (float)MathHelper.clamp_double((double)sound.getPitch() * entry.getPitch(), 0.5D, 2.0D); + } + + private float getNormalizedVolume(ISound sound, SoundPoolEntry entry, SoundCategory category) + { + return (float)MathHelper.clamp_double((double)sound.getVolume() * entry.getVolume(), 0.0D, 1.0D) * this.getSoundCategoryVolume(category); + } + + public void pauseAllSounds() + { + for (String s : this.playingSounds.keySet()) + { + logger.debug(LOG_MARKER, "Pausing channel {}", new Object[] {s}); + this.sndSystem.pause(s); + } + } + + public void resumeAllSounds() + { + for (String s : this.playingSounds.keySet()) + { + logger.debug(LOG_MARKER, "Resuming channel {}", new Object[] {s}); + this.sndSystem.play(s); + } + } + + public void playDelayedSound(ISound sound, int delay) + { + this.delayedSounds.put(sound, Integer.valueOf(this.playTime + delay)); + } + + private static URL getURLForSoundResource(final ResourceLocation p_148612_0_) + { + String s = String.format("%s:%s:%s", new Object[] {"mcsounddomain", p_148612_0_.getResourceDomain(), p_148612_0_.getResourcePath()}); + URLStreamHandler urlstreamhandler = new URLStreamHandler() + { + protected URLConnection openConnection(final URL p_openConnection_1_) + { + return new URLConnection(p_openConnection_1_) + { + public void connect() throws IOException + { + } + public InputStream getInputStream() throws IOException + { + return Minecraft.getMinecraft().getResourceManager().getResource(p_148612_0_).getInputStream(); + } + }; + } + }; + + try + { + return new URL((URL)null, s, urlstreamhandler); + } + catch (MalformedURLException var4) + { + throw new Error("TODO: Sanely handle url exception! :D"); + } + } + + public void setListener(EntityPlayer player, float p_148615_2_) + { + if (this.loaded && player != null) + { + float f = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * p_148615_2_; + float f1 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * p_148615_2_; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)p_148615_2_; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)p_148615_2_ + (double)player.getEyeHeight(); + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)p_148615_2_; + float f2 = MathHelper.cos((f1 + 90.0F) * 0.017453292F); + float f3 = MathHelper.sin((f1 + 90.0F) * 0.017453292F); + float f4 = MathHelper.cos(-f * 0.017453292F); + float f5 = MathHelper.sin(-f * 0.017453292F); + float f6 = MathHelper.cos((-f + 90.0F) * 0.017453292F); + float f7 = MathHelper.sin((-f + 90.0F) * 0.017453292F); + float f8 = f2 * f4; + float f9 = f3 * f4; + float f10 = f2 * f6; + float f11 = f3 * f6; + this.sndSystem.setListenerPosition((float)d0, (float)d1, (float)d2); + this.sndSystem.setListenerOrientation(f8, f5, f9, f10, f7, f11); + } + } + + class SoundSystemStarterThread extends SoundSystem + { + private SoundSystemStarterThread() + { + } + + public boolean playing(String p_playing_1_) + { + synchronized (SoundSystemConfig.THREAD_SYNC) + { + if (this.soundLibrary == null) + { + return false; + } + else + { + Source source = (Source)this.soundLibrary.getSources().get(p_playing_1_); + return source == null ? false : source.playing() || source.paused() || source.preLoad; + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java new file mode 100644 index 0000000..667bd0e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java @@ -0,0 +1,57 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public class SoundPoolEntry +{ + private final ResourceLocation location; + private final boolean streamingSound; + private double pitch; + private double volume; + + public SoundPoolEntry(ResourceLocation locationIn, double pitchIn, double volumeIn, boolean streamingSoundIn) + { + this.location = locationIn; + this.pitch = pitchIn; + this.volume = volumeIn; + this.streamingSound = streamingSoundIn; + } + + public SoundPoolEntry(SoundPoolEntry locationIn) + { + this.location = locationIn.location; + this.pitch = locationIn.pitch; + this.volume = locationIn.volume; + this.streamingSound = locationIn.streamingSound; + } + + public ResourceLocation getSoundPoolEntryLocation() + { + return this.location; + } + + public double getPitch() + { + return this.pitch; + } + + public void setPitch(double pitchIn) + { + this.pitch = pitchIn; + } + + public double getVolume() + { + return this.volume; + } + + public void setVolume(double volumeIn) + { + this.volume = volumeIn; + } + + public boolean isStreamingSound() + { + return this.streamingSound; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundRegistry.java b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundRegistry.java new file mode 100644 index 0000000..800781d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/audio/SoundRegistry.java @@ -0,0 +1,27 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.util.RegistrySimple; +import net.minecraft.util.ResourceLocation; + +public class SoundRegistry extends RegistrySimple +{ + private Map soundRegistry; + + protected Map createUnderlyingMap() + { + this.soundRegistry = Maps.newHashMap(); + return this.soundRegistry; + } + + public void registerSound(SoundEventAccessorComposite p_148762_1_) + { + this.putObject(p_148762_1_.getSoundEventLocation(), p_148762_1_); + } + + public void clearMap() + { + this.soundRegistry.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java new file mode 100644 index 0000000..8bcd589 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java @@ -0,0 +1,293 @@ +package net.minecraft.client.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import com.cheatbreaker.client.module.impl.normal.perspective.ModulePerspective; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.util.UUID; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; +import net.optifine.player.CapeUtils; +import net.optifine.player.PlayerConfigurations; +import net.optifine.reflect.Reflector; + +public abstract class AbstractClientPlayer extends EntityPlayer +{ + private NetworkPlayerInfo playerInfo; + private ResourceLocation locationOfCape = null; + private long reloadCapeTimeMs = 0L; + private boolean elytraOfCape = false; + private String nameClear = null; + private static final ResourceLocation TEXTURE_ELYTRA = new ResourceLocation("textures/entity/elytra.png"); + + public AbstractClientPlayer(World worldIn, GameProfile playerProfile) + { + super(worldIn, playerProfile); + this.nameClear = playerProfile.getName(); + + if (this.nameClear != null && !this.nameClear.isEmpty()) + { + this.nameClear = StringUtils.stripControlCodes(this.nameClear); + } + + Cosmetic activeCape; + Cosmetic activeWings; + + UUID playerId; + + if (!this.getUniqueID().toString().contains("-")) { + playerId = UUID.fromString(CheatBreaker.getInstance().getProfileHandler().recompileUUID(this.getUniqueID().toString())); + } else { + playerId = UUID.fromString(this.getUniqueID().toString()); + } + activeCape = CheatBreaker.getInstance().getCosmeticManager().getActiveCape(playerId); + activeWings = CheatBreaker.getInstance().getCosmeticManager().getActiveWings(playerId); + + CheatBreaker.getInstance().getWsNetHandler().handlePlayer(this); + + if (activeCape != null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showCheatBreakerCapes.getValue()) { + this.setLocationOfCape(activeCape.getLocation()); + this.setCBCape(activeCape); + } else if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showOptifineCapes.getValue()) { + CapeUtils.downloadCape(this); + } + + if (activeWings != null) { + this.setCBWings(activeWings); + } + + PlayerConfigurations.getPlayerConfiguration(this); + } + + /** + * Returns true if the player is in spectator mode. + */ + public boolean isSpectator() + { + NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(this.getGameProfile().getId()); + return networkplayerinfo != null && networkplayerinfo.getGameType() == WorldSettings.GameType.SPECTATOR; + } + + /** + * Checks if this instance of AbstractClientPlayer has any associated player data. + */ + public boolean hasPlayerInfo() + { + return this.getPlayerInfo() != null; + } + + protected NetworkPlayerInfo getPlayerInfo() + { + if (this.playerInfo == null) + { + this.playerInfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(this.getUniqueID()); + } + + return this.playerInfo; + } + + /** + * Returns true if the player has an associated skin. + */ + public boolean hasSkin() + { + NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo(); + return networkplayerinfo != null && networkplayerinfo.hasLocationSkin(); + } + + /** + * Returns true if the player instance has an associated skin. + */ + public ResourceLocation getLocationSkin() + { + ModuleNickHider nickHiderMod = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo(); + + if (nickHiderMod.isEnabled() && nickHiderMod.hideOtherSkins.getBooleanValue()) { + if (!nickHiderMod.hideSkin.getBooleanValue() && Minecraft.getMinecraft().getSession().getUsername().equals(this.getName())) { + return networkplayerinfo == null ? DefaultPlayerSkin.getDefaultSkin(this.getUniqueID()) : networkplayerinfo.getLocationSkin(); + } else { + return DefaultPlayerSkin.getDefaultSkin(this.getUniqueID()); + } + } else if (nickHiderMod.isEnabled() && nickHiderMod.hideSkin.getBooleanValue() + && Minecraft.getMinecraft().getSession().getUsername().equals(this.getName())) { + return DefaultPlayerSkin.getDefaultSkin(this.getUniqueID()); + } + + return networkplayerinfo == null ? DefaultPlayerSkin.getDefaultSkin(this.getUniqueID()) : networkplayerinfo.getLocationSkin(); + } + + public ResourceLocation getLocationCape() + { + if (!Config.isShowCapes()) + { + return null; + } + else + { + if (this.reloadCapeTimeMs != 0L && System.currentTimeMillis() > this.reloadCapeTimeMs) + { + CapeUtils.reloadCape(this); + this.reloadCapeTimeMs = 0L; + } + + if (this.locationOfCape != null) + { + return this.locationOfCape; + } + else + { + NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo(); + return networkplayerinfo == null ? null : networkplayerinfo.getLocationCape(); + } + } + } + + public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username) + { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + ITextureObject itextureobject = texturemanager.getTexture(resourceLocationIn); + + if (itextureobject == null) + { + itextureobject = new ThreadDownloadImageData((File)null, String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[] {StringUtils.stripControlCodes(username)}), DefaultPlayerSkin.getDefaultSkin(getOfflineUUID(username)), new ImageBufferDownload()); + texturemanager.loadTexture(resourceLocationIn, itextureobject); + } + + return (ThreadDownloadImageData)itextureobject; + } + + /** + * Returns true if the username has an associated skin. + * + * @param username The username of the player being checked. + */ + public static ResourceLocation getLocationSkin(String username) + { + return new ResourceLocation("skins/" + StringUtils.stripControlCodes(username)); + } + + public String getSkinType() + { + NetworkPlayerInfo networkplayerinfo = this.getPlayerInfo(); + return networkplayerinfo == null ? DefaultPlayerSkin.getSkinType(this.getUniqueID()) : networkplayerinfo.getSkinType(); + } + + public float getFovModifier() + { + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + + float f = 1.0F; + + if (this.capabilities.isFlying) + { + f *= 1.1F; + } + + + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (perspectiveMod.isEnabled()) { + if (!perspectiveMod.staticSwiftness.getBooleanValue()) { + f = (float)((double)f * ((iattributeinstance.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); + } + } else { + f = (float)((double)f * ((iattributeinstance.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); + } + + if (this.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(f) || Float.isInfinite(f)) + { + f = 1.0F; + } + + if (this.isUsingItem() && this.getItemInUse().getItem() == Items.bow) + { + int i = this.getItemInUseDuration(); + float f1 = (float)i / 20.0F; + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + else + { + f1 = f1 * f1; + } + + if (perspectiveMod.isEnabled()) { + f *= 1.0F - f1 * perspectiveMod.aimingMultiplier.getFloatValue(); + } else { + f *= 1.0F - f1 * 0.15F; + } + } + + return Reflector.ForgeHooksClient_getOffsetFOV.exists() ? Reflector.callFloat(Reflector.ForgeHooksClient_getOffsetFOV, new Object[] {this, Float.valueOf(f)}): f; + } + + public String getNameClear() + { + return this.nameClear; + } + + public ResourceLocation getLocationOfCape() + { + return this.locationOfCape; + } + + public void setLocationOfCape(ResourceLocation p_setLocationOfCape_1_) + { + this.locationOfCape = p_setLocationOfCape_1_; + } + + public boolean hasElytraCape() + { + ResourceLocation resourcelocation = this.getLocationCape(); + return resourcelocation == null ? false : (resourcelocation == this.locationOfCape ? this.elytraOfCape : true); + } + + public void setElytraOfCape(boolean p_setElytraOfCape_1_) + { + this.elytraOfCape = p_setElytraOfCape_1_; + } + + public boolean isElytraOfCape() + { + return this.elytraOfCape; + } + + public long getReloadCapeTimeMs() + { + return this.reloadCapeTimeMs; + } + + public void setReloadCapeTimeMs(long p_setReloadCapeTimeMs_1_) + { + this.reloadCapeTimeMs = p_setReloadCapeTimeMs_1_; + } + + /** + * interpolated look vector + */ + public Vec3 getLook(float partialTicks) + { + return this.getVectorForRotation(this.rotationPitch, this.rotationYaw); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java b/Client-1.8.9/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java new file mode 100644 index 0000000..748ffde --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java @@ -0,0 +1,152 @@ +package net.minecraft.client.entity; + +import com.mojang.authlib.GameProfile; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityOtherPlayerMP extends AbstractClientPlayer +{ + private boolean isItemInUse; + private int otherPlayerMPPosRotationIncrements; + private double otherPlayerMPX; + private double otherPlayerMPY; + private double otherPlayerMPZ; + private double otherPlayerMPYaw; + private double otherPlayerMPPitch; + + public EntityOtherPlayerMP(World worldIn, GameProfile gameProfileIn) + { + super(worldIn, gameProfileIn); + this.stepHeight = 0.0F; + this.noClip = true; + this.renderOffsetY = 0.25F; + this.renderDistanceWeight = 10.0D; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + return true; + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) + { + this.otherPlayerMPX = x; + this.otherPlayerMPY = y; + this.otherPlayerMPZ = z; + this.otherPlayerMPYaw = (double)yaw; + this.otherPlayerMPPitch = (double)pitch; + this.otherPlayerMPPosRotationIncrements = posRotationIncrements; + } + + public void onUpdate() + { + this.renderOffsetY = 0.0F; + super.onUpdate(); + this.prevLimbSwingAmount = this.limbSwingAmount; + double d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; + + if (f > 1.0F) + { + f = 1.0F; + } + + this.limbSwingAmount += (f - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + + if (!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) + { + ItemStack itemstack = this.inventory.mainInventory[this.inventory.currentItem]; + this.setItemInUse(this.inventory.mainInventory[this.inventory.currentItem], itemstack.getItem().getMaxItemUseDuration(itemstack)); + this.isItemInUse = true; + } + else if (this.isItemInUse && !this.isEating()) + { + this.clearItemInUse(); + this.isItemInUse = false; + } + } + + public void onLivingUpdate() + { + if (this.otherPlayerMPPosRotationIncrements > 0) + { + double d0 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; + double d1 = this.posY + (this.otherPlayerMPY - this.posY) / (double)this.otherPlayerMPPosRotationIncrements; + double d2 = this.posZ + (this.otherPlayerMPZ - this.posZ) / (double)this.otherPlayerMPPosRotationIncrements; + double d3; + + for (d3 = this.otherPlayerMPYaw - (double)this.rotationYaw; d3 < -180.0D; d3 += 360.0D) + { + ; + } + + while (d3 >= 180.0D) + { + d3 -= 360.0D; + } + + this.rotationYaw = (float)((double)this.rotationYaw + d3 / (double)this.otherPlayerMPPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.otherPlayerMPPitch - (double)this.rotationPitch) / (double)this.otherPlayerMPPosRotationIncrements); + --this.otherPlayerMPPosRotationIncrements; + this.setPosition(d0, d1, d2); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + + this.prevCameraYaw = this.cameraYaw; + this.updateArmSwingProgress(); + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float f = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; + + if (f1 > 0.1F) + { + f1 = 0.1F; + } + + if (!this.onGround || this.getHealth() <= 0.0F) + { + f1 = 0.0F; + } + + if (this.onGround || this.getHealth() <= 0.0F) + { + f = 0.0F; + } + + this.cameraYaw += (f1 - this.cameraYaw) * 0.4F; + this.cameraPitch += (f - this.cameraPitch) * 0.8F; + } + + public void setCurrentItemOrArmor(int slotIn, ItemStack stack) + { + if (slotIn == 0) + { + this.inventory.mainInventory[this.inventory.currentItem] = stack; + } + else + { + this.inventory.armorInventory[slotIn - 1] = stack; + } + } + + public void addChatMessage(IChatComponent component) + { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(component); + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return false; + } + + public BlockPos getPosition() + { + return new BlockPos(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java b/Client-1.8.9/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java new file mode 100644 index 0000000..14bf75d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java @@ -0,0 +1,902 @@ +package net.minecraft.client.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.module.command.ModuleCommand; +import com.cheatbreaker.client.module.impl.normal.hud.simple.module.SimpleModuleToggleSprint; +import com.cheatbreaker.client.util.ClientCredits; +import net.minecraft.MinecraftMovementInputHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.MovingSoundMinecartRiding; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.*; +import net.minecraft.client.gui.inventory.*; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.particle.EntityCrit2FX; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.*; +import net.minecraft.potion.Potion; +import net.minecraft.src.Config; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.*; +import net.minecraft.world.IInteractionObject; +import net.minecraft.world.World; +import org.lwjgl.opengl.Display; + +import java.util.UUID; + +public class EntityPlayerSP extends AbstractClientPlayer { + public final NetHandlerPlayClient sendQueue; + private final StatFileWriter statWriter; + private double lastReportedPosX; + private double lastReportedPosY; + private double lastReportedPosZ; + private float lastReportedYaw; + private float lastReportedPitch; + private boolean serverSneakState; + private boolean serverSprintState; + private int positionUpdateTicks; + private boolean hasValidHealth; + private String clientBrand; + public MovementInput movementInput; + protected Minecraft mc; + + /** + * Used to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to + * sprint, aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable + * sprinting. + */ + protected int sprintToggleTimer; + + /** + * Ticks left before sprinting is disabled. + */ + public int sprintingTicksLeft; + public float renderArmYaw; + public float renderArmPitch; + public float prevRenderArmYaw; + public float prevRenderArmPitch; + private int horseJumpPowerCounter; + private float horseJumpPower; + + /** + * The amount of time an entity has been in a Portal + */ + public float timeInPortal; + + /** + * The amount of time an entity has been in a Portal the previous tick + */ + public float prevTimeInPortal; + + private final MinecraftMovementInputHelper minecraftMovementInputHelper; + + public EntityPlayerSP(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandler, StatFileWriter statFile) { + super(worldIn, netHandler.getGameProfile()); + this.minecraftMovementInputHelper = new MinecraftMovementInputHelper(Minecraft.getMinecraft().gameSettings); + this.sendQueue = netHandler; + this.statWriter = statFile; + this.mc = mcIn; + this.dimension = 0; + } + + public boolean attackEntityFrom(DamageSource source, float amount) { + return false; + } + + public void heal(float healAmount) { + } + + public void mountEntity(Entity entityIn) { + super.mountEntity(entityIn); + + if (entityIn instanceof EntityMinecart) { + this.mc.getSoundHandler().playSound(new MovingSoundMinecartRiding(this, (EntityMinecart) entityIn)); + } + } + + public void onUpdate() { + if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { + super.onUpdate(); + + if (this.isRiding()) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); + } else { + this.onUpdateWalkingPlayer(); + } + } + } + + public void onUpdateWalkingPlayer() { + boolean flag = this.isSprinting(); + + if (flag != this.serverSprintState) { + if (flag) { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.START_SPRINTING)); + } else { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.STOP_SPRINTING)); + } + + this.serverSprintState = flag; + } + + boolean flag1 = this.isSneaking(); + + if (flag1 != this.serverSneakState) { + if (flag1) { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.START_SNEAKING)); + } else { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.STOP_SNEAKING)); + } + + this.serverSneakState = flag1; + } + + if (this.isCurrentViewEntity()) { + double d0 = this.posX - this.lastReportedPosX; + double d1 = this.getEntityBoundingBox().minY - this.lastReportedPosY; + double d2 = this.posZ - this.lastReportedPosZ; + double d3 = (double) (this.rotationYaw - this.lastReportedYaw); + double d4 = (double) (this.rotationPitch - this.lastReportedPitch); + boolean flag2 = d0 * d0 + d1 * d1 + d2 * d2 > 9.0E-4D || this.positionUpdateTicks >= 20; + boolean flag3 = d3 != 0.0D || d4 != 0.0D; + + if (this.ridingEntity == null) { + if (flag2 && flag3) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround)); + } else if (flag2) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.onGround)); + } else if (flag3) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + } else { + this.sendQueue.addToSendQueue(new C03PacketPlayer(this.onGround)); + } + } else { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, this.onGround)); + flag2 = false; + } + + ++this.positionUpdateTicks; + + if (flag2) { + this.lastReportedPosX = this.posX; + this.lastReportedPosY = this.getEntityBoundingBox().minY; + this.lastReportedPosZ = this.posZ; + this.positionUpdateTicks = 0; + } + + if (flag3) { + this.lastReportedYaw = this.rotationYaw; + this.lastReportedPitch = this.rotationPitch; + } + } + } + + public EntityItem dropOneItem(boolean dropAll) { + C07PacketPlayerDigging.Action c07packetplayerdigging$action = dropAll ? C07PacketPlayerDigging.Action.DROP_ALL_ITEMS : C07PacketPlayerDigging.Action.DROP_ITEM; + this.sendQueue.addToSendQueue(new C07PacketPlayerDigging(c07packetplayerdigging$action, BlockPos.ORIGIN, EnumFacing.DOWN)); + return null; + } + + protected void joinEntityItemWithWorld(EntityItem itemIn) { + } + + public void sendChatMessage(String message) { + + if (message.equals("/cb debug")) { + CheatBreaker.getInstance().getGlobalSettings().isDebug = !CheatBreaker.getInstance().getGlobalSettings().isDebug; + + Display.setTitle("Minecraft " + Config.MC_VERSION + + (CheatBreaker.getInstance().getGlobalSettings().isDebug ? " - " + + CheatBreaker.getInstance().getGitBuildVersion() + + " Build (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + + "/" + CheatBreaker.getInstance().getGitBranch() + ")" : "")); + + ChatComponentText status = new ChatComponentText(EnumChatFormatting.GRAY + "Debug: " + EnumChatFormatting.RESET + CheatBreaker.getInstance().getGlobalSettings().isDebug); + status.setBranded(true); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(status); + } else if (message.equals("/cb credits") && !ClientCredits.isCreditedUser(UUID.fromString(this.mc.getSession().getPlayerID()))) { + ClientCredits.sendCredits(); + } else if (message.startsWith("/cb emote")) { + String[] args = message.split(" "); + + if (args.length != 3) { + ChatComponentText prefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET); + ChatComponentText arguments = new ChatComponentText(EnumChatFormatting.RED + "Usage: /cb emote "); + prefix.appendSibling(arguments); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(prefix); + return; + } + + if (args[2].equals("list")) { + ChatComponentText prefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET); + StringBuilder emotes = new StringBuilder(); + + for (int id : CheatBreaker.getInstance().getCosmeticManager().getEmotes()) { + Emote emote = CheatBreaker.getInstance().getCosmeticManager().getEmoteById(id); + if (!emotes.toString().equals("")) emotes.append(", "); + + emotes.append(emote.getName()).append(" (ID: ").append(id).append(")"); + } + + prefix.appendSibling(new ChatComponentText(EnumChatFormatting.GRAY + "Emotes: " + emotes)); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(prefix); + return; + } + + int id; + try { + id = Integer.parseInt(args[2]); + } catch (NumberFormatException e) { + sendIncorrectEmoteId(args[2]); + return; + } + + Emote emote = CheatBreaker.getInstance().getCosmeticManager().getEmoteById(id); + if (emote == null) { + sendIncorrectEmoteId(id + ""); + return; + } + + ChatComponentText chatComponentText = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET); + ChatComponentText chatComponentText2 = new ChatComponentText(EnumChatFormatting.GRAY + "Doing emote: " + emote.getName()); + chatComponentText.appendSibling(chatComponentText2); + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(chatComponentText); + CheatBreaker.getInstance().getCosmeticManager().playEmote(Minecraft.getMinecraft().thePlayer, emote); + } else { + if (CheatBreaker.getInstance().getGlobalSettings().enableModuleCommands.getBooleanValue()) { + for (ModuleCommand modCommand : CheatBreaker.getInstance().getModuleCommandManager().moduleCommands) { + if (message.equals(modCommand.getCommand())) { + modCommand.handle(); + return; + } + } + } + + this.sendQueue.addToSendQueue(new C01PacketChatMessage(message)); + CheatBreaker.getInstance().getModuleManager().chatMod.dingCooldown.add(System.currentTimeMillis()); + } + } + + + private void sendIncorrectEmoteId(String id) { + ChatComponentText chatComponentText = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET); + ChatComponentText chatComponentText2 = new ChatComponentText(EnumChatFormatting.GRAY + "Invalid Emote ID: " + id); + chatComponentText.appendSibling(chatComponentText2); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(chatComponentText); + } + + public void swingItem() { + super.swingItem(); + this.sendQueue.addToSendQueue(new C0APacketAnimation()); + } + + public void respawnPlayer() { + this.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN)); + } + + protected void damageEntity(DamageSource damageSrc, float damageAmount) { + if (!this.isEntityInvulnerable(damageSrc)) { + this.setHealth(this.getHealth() - damageAmount); + } + } + + public void closeScreen() { + this.sendQueue.addToSendQueue(new C0DPacketCloseWindow(this.openContainer.windowId)); + this.closeScreenAndDropStack(); + } + + public void closeScreenAndDropStack() { + this.inventory.setItemStack( null); + super.closeScreen(); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + Minecraft.getMinecraft().entityRenderer.stopUseShader(); + } + this.mc.displayGuiScreen( null); + } + + public void setPlayerSPHealth(float health) { + if (this.hasValidHealth) { + float f = this.getHealth() - health; + + if (f <= 0.0F) { + this.setHealth(health); + + if (f < 0.0F) { + this.hurtResistantTime = this.maxHurtResistantTime / 2; + } + } else { + this.lastDamage = f; + this.setHealth(this.getHealth()); + this.hurtResistantTime = this.maxHurtResistantTime; + this.damageEntity(DamageSource.generic, f); + this.hurtTime = this.maxHurtTime = 10; + } + } else { + this.setHealth(health); + this.hasValidHealth = true; + } + } + + public void addStat(StatBase stat, int amount) { + if (stat != null) { + if (stat.isIndependent) { + super.addStat(stat, amount); + } + } + } + + public void sendPlayerAbilities() { + this.sendQueue.addToSendQueue(new C13PacketPlayerAbilities(this.capabilities)); + } + + public boolean isUser() { + return true; + } + + protected void sendHorseJump() { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.RIDING_JUMP, (int) (this.getHorseJumpPower() * 100.0F))); + } + + public void sendHorseInventory() { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.OPEN_INVENTORY)); + } + + public void setClientBrand(String brand) { + this.clientBrand = brand; + } + + public String getClientBrand() { + return this.clientBrand; + } + + public StatFileWriter getStatFileWriter() { + return this.statWriter; + } + + public void addChatComponentMessage(IChatComponent chatComponent) { + this.mc.ingameGUI.getChatGUI().printChatMessage(chatComponent); + } + + protected boolean pushOutOfBlocks(double x, double y, double z) { + if (this.noClip) { + return false; + } else { + BlockPos blockpos = new BlockPos(x, y, z); + double d0 = x - (double) blockpos.getX(); + double d1 = z - (double) blockpos.getZ(); + + if (!this.isOpenBlockSpace(blockpos)) { + int i = -1; + double d2 = 9999.0D; + + if (this.isOpenBlockSpace(blockpos.west()) && d0 < d2) { + d2 = d0; + i = 0; + } + + if (this.isOpenBlockSpace(blockpos.east()) && 1.0D - d0 < d2) { + d2 = 1.0D - d0; + i = 1; + } + + if (this.isOpenBlockSpace(blockpos.north()) && d1 < d2) { + d2 = d1; + i = 4; + } + + if (this.isOpenBlockSpace(blockpos.south()) && 1.0D - d1 < d2) { + d2 = 1.0D - d1; + i = 5; + } + + float f = 0.1F; + + if (i == 0) { + this.motionX = (double) (-f); + } + + if (i == 1) { + this.motionX = (double) f; + } + + if (i == 4) { + this.motionZ = (double) (-f); + } + + if (i == 5) { + this.motionZ = (double) f; + } + } + + return false; + } + } + + private boolean isOpenBlockSpace(BlockPos pos) { + return !this.worldObj.getBlockState(pos).getBlock().isNormalCube() && !this.worldObj.getBlockState(pos.up()).getBlock().isNormalCube(); + } + + public void setSprinting(boolean sprinting) { + super.setSprinting(sprinting); + this.sprintingTicksLeft = sprinting ? 600 : 0; + } + + public void setXPStats(float currentXP, int maxXP, int level) { + this.experience = currentXP; + this.experienceTotal = maxXP; + this.experienceLevel = level; + } + + public void addChatMessage(IChatComponent component) { + this.mc.ingameGUI.getChatGUI().printChatMessage(component); + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) { + return permLevel <= 0; + } + + public BlockPos getPosition() { + return new BlockPos(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D); + } + + public void playSound(String name, float volume, float pitch) { + this.worldObj.playSound(this.posX, this.posY, this.posZ, name, volume, pitch, false); + } + + public boolean isServerWorld() { + return true; + } + + public boolean isRidingHorse() { + return this.ridingEntity != null && this.ridingEntity instanceof EntityHorse && ((EntityHorse) this.ridingEntity).isHorseSaddled(); + } + + public float getHorseJumpPower() { + return this.horseJumpPower; + } + + public void openEditSign(TileEntitySign signTile) { + this.mc.displayGuiScreen(new GuiEditSign(signTile)); + } + + public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic) { + this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic)); + } + + public void displayGUIBook(ItemStack bookStack) { + Item item = bookStack.getItem(); + + if (item == Items.writable_book) { + this.mc.displayGuiScreen(new GuiScreenBook(this, bookStack, true)); + } + } + + public void displayGUIChest(IInventory chestInventory) { + String s = chestInventory instanceof IInteractionObject ? ((IInteractionObject) chestInventory).getGuiID() : "minecraft:container"; + + if ("minecraft:chest".equals(s)) { + this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory)); + } else if ("minecraft:hopper".equals(s)) { + this.mc.displayGuiScreen(new GuiHopper(this.inventory, chestInventory)); + } else if ("minecraft:furnace".equals(s)) { + this.mc.displayGuiScreen(new GuiFurnace(this.inventory, chestInventory)); + } else if ("minecraft:brewing_stand".equals(s)) { + this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, chestInventory)); + } else if ("minecraft:beacon".equals(s)) { + this.mc.displayGuiScreen(new GuiBeacon(this.inventory, chestInventory)); + } else if (!"minecraft:dispenser".equals(s) && !"minecraft:dropper".equals(s)) { + this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory)); + } else { + this.mc.displayGuiScreen(new GuiDispenser(this.inventory, chestInventory)); + } + } + + public void displayGUIHorse(EntityHorse horse, IInventory horseInventory) { + this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, horseInventory, horse)); + } + + public void displayGui(IInteractionObject guiOwner) { + String s = guiOwner.getGuiID(); + + if ("minecraft:crafting_table".equals(s)) { + this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj)); + } else if ("minecraft:enchanting_table".equals(s)) { + this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, guiOwner)); + } else if ("minecraft:anvil".equals(s)) { + this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj)); + } + } + + public void displayVillagerTradeGui(IMerchant villager) { + this.mc.displayGuiScreen(new GuiMerchant(this.inventory, villager, this.worldObj)); + } + + public void onCriticalHit(Entity entityHit) { + this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT); + } + + public void onEnchantmentCritical(Entity entityHit) { + this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC); + } + + public boolean isSneaking() { + boolean flag = this.movementInput != null ? this.movementInput.sneak : false; + return flag && !this.sleeping; + } + + public void updateEntityActionState() { + super.updateEntityActionState(); + + if (this.isCurrentViewEntity()) { + this.moveStrafing = this.movementInput.moveStrafe; + this.moveForward = this.movementInput.moveForward; + this.isJumping = this.movementInput.jump; + this.prevRenderArmYaw = this.renderArmYaw; + this.prevRenderArmPitch = this.renderArmPitch; + this.renderArmPitch = (float) ((double) this.renderArmPitch + (double) (this.rotationPitch - this.renderArmPitch) * 0.5D); + this.renderArmYaw = (float) ((double) this.renderArmYaw + (double) (this.rotationYaw - this.renderArmYaw) * 0.5D); + } + } + + protected boolean isCurrentViewEntity() { + return this.mc.getRenderViewEntity() == this; + } + + public void onLivingUpdate() { + if (CheatBreaker.getInstance().getModuleManager().toggleSprintMod.isEnabled()) { + this.toggleSprintVersionOnLivingUpdate(); + } else { + if (this.sprintingTicksLeft > 0) { + --this.sprintingTicksLeft; + + if (this.sprintingTicksLeft == 0) { + this.setSprinting(false); + } + } + + if (this.sprintToggleTimer > 0) { + --this.sprintToggleTimer; + } + + this.prevTimeInPortal = this.timeInPortal; + + if (this.inPortal) { + if (this.mc.currentScreen != null && !this.mc.currentScreen.doesGuiPauseGame()) { + this.mc.displayGuiScreen(null); + } + + if (this.timeInPortal == 0.0F) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("portal.trigger"), this.rand.nextFloat() * 0.4F + 0.8F)); + } + + this.timeInPortal += 0.0125F; + + if (this.timeInPortal >= 1.0F) { + this.timeInPortal = 1.0F; + } + + this.inPortal = false; + } else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { + this.timeInPortal += 0.006666667F; + + if (this.timeInPortal > 1.0F) { + this.timeInPortal = 1.0F; + } + } else { + if (this.timeInPortal > 0.0F) { + this.timeInPortal -= 0.05F; + } + + if (this.timeInPortal < 0.0F) { + this.timeInPortal = 0.0F; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + boolean flag = this.movementInput.jump; + boolean flag1 = this.movementInput.sneak; + float f = 0.8F; + boolean flag2 = this.movementInput.moveForward >= f; + this.movementInput.updatePlayerMoveState(); + + if (this.isUsingItem() && !this.isRiding()) { + this.movementInput.moveStrafe *= 0.2F; + this.movementInput.moveForward *= 0.2F; + this.sprintToggleTimer = 0; + } + + this.pushOutOfBlocks(this.posX - (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ + (double) this.width * 0.35D); + this.pushOutOfBlocks(this.posX - (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ - (double) this.width * 0.35D); + this.pushOutOfBlocks(this.posX + (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ - (double) this.width * 0.35D); + this.pushOutOfBlocks(this.posX + (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ + (double) this.width * 0.35D); + boolean flag3 = (float) this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; + + if (this.onGround && !flag1 && !flag2 && this.movementInput.moveForward >= f && !this.isSprinting() && flag3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { + if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.isKeyDown()) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); + } + } + + if (!this.isSprinting() && this.movementInput.moveForward >= f && flag3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness) && this.mc.gameSettings.keyBindSprint.isKeyDown()) { + this.setSprinting(true); + } + + if (this.isSprinting() && (this.movementInput.moveForward < f || this.isCollidedHorizontally || !flag3)) { + this.setSprinting(false); + } + + if (this.capabilities.allowFlying) { + if (this.mc.playerController.isSpectatorMode()) { + if (!this.capabilities.isFlying) { + this.capabilities.isFlying = true; + this.sendPlayerAbilities(); + } + } else if (!flag && this.movementInput.jump) { + if (this.flyToggleTimer == 0) { + this.flyToggleTimer = 7; + } else { + this.capabilities.isFlying = !this.capabilities.isFlying; + this.sendPlayerAbilities(); + this.flyToggleTimer = 0; + } + } + } + + if (this.capabilities.isFlying && this.isCurrentViewEntity()) { + if (this.movementInput.sneak) { + this.motionY -= (this.capabilities.getFlySpeed() * 3.0F); + } + + if (this.movementInput.jump) { + this.motionY += (this.capabilities.getFlySpeed() * 3.0F); + } + } + + if (this.isRidingHorse()) { + if (this.horseJumpPowerCounter < 0) { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter == 0) { + this.horseJumpPower = 0.0F; + } + } + + if (flag && !this.movementInput.jump) { + this.horseJumpPowerCounter = -10; + this.sendHorseJump(); + } else if (!flag && this.movementInput.jump) { + this.horseJumpPowerCounter = 0; + this.horseJumpPower = 0.0F; + } else if (flag) { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter < 10) { + this.horseJumpPower = (float) this.horseJumpPowerCounter * 0.1F; + } else { + this.horseJumpPower = 0.8F + 2.0F / (float) (this.horseJumpPowerCounter - 9) * 0.1F; + } + } + } else { + this.horseJumpPower = 0.0F; + } + + super.onLivingUpdate(); + + if (this.onGround && this.capabilities.isFlying && !this.mc.playerController.isSpectatorMode()) { + this.capabilities.isFlying = false; + this.sendPlayerAbilities(); + } + } + } + + public void toggleSprintVersionOnLivingUpdate() { + if (this.sprintingTicksLeft > 0) { + --this.sprintingTicksLeft; + + if (this.sprintingTicksLeft == 0) { + this.setSprinting(false); + } + } + + if (this.sprintToggleTimer > 0) { + --this.sprintToggleTimer; + } + + this.prevTimeInPortal = this.timeInPortal; + + if (this.inPortal) { + if (this.mc.currentScreen != null && !this.mc.currentScreen.doesGuiPauseGame()) { + this.mc.displayGuiScreen((GuiScreen) null); + } + + if (this.timeInPortal == 0.0F) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("portal.trigger"), this.rand.nextFloat() * 0.4F + 0.8F)); + } + + this.timeInPortal += 0.0125F; + + if (this.timeInPortal >= 1.0F) { + this.timeInPortal = 1.0F; + } + + this.inPortal = false; + } else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { + this.timeInPortal += 0.006666667F; + + if (this.timeInPortal > 1.0F) { + this.timeInPortal = 1.0F; + } + } else { + if (this.timeInPortal > 0.0F) { + this.timeInPortal -= 0.05F; + } + + if (this.timeInPortal < 0.0F) { + this.timeInPortal = 0.0F; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + boolean flag = this.movementInput.jump; + boolean flag1 = this.movementInput.sneak; + float f = 0.8F; + boolean flag2 = this.movementInput.moveForward >= f; +// this.movementInput.updatePlayerMoveState(); + MinecraftMovementInputHelper.lIIIIlIIllIIlIIlIIIlIIllI(this.mc, (MovementInputFromOptions) this.movementInput, this); + + if (this.isUsingItem() && !this.isRiding()) { + this.movementInput.moveStrafe *= 0.2F; + this.movementInput.moveForward *= 0.2F; + this.sprintToggleTimer = 0; + } + + this.pushOutOfBlocks(this.posX - (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ + (double) this.width * 0.35D); + this.pushOutOfBlocks(this.posX - (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ - (double) this.width * 0.35D); + this.pushOutOfBlocks(this.posX + (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ - (double) this.width * 0.35D); + this.pushOutOfBlocks(this.posX + (double) this.width * 0.35D, this.getEntityBoundingBox().minY + 0.5D, this.posZ + (double) this.width * 0.35D); + boolean flag3 = (float) this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; + boolean bl4 = !CheatBreaker.getInstance().getModuleManager().toggleSprintMod.isEnabled() || !((Boolean) SimpleModuleToggleSprint.toggleSprint.getValue()); + boolean bl5 = (Boolean) SimpleModuleToggleSprint.doubleTap.getValue(); + if (SimpleModuleToggleSprint.buggedSprint) { + this.setSprinting(false); + this.minecraftMovementInputHelper.setSprintState(false, false); + SimpleModuleToggleSprint.buggedSprint = false; + } + + if (bl4) { + if ((Boolean) SimpleModuleToggleSprint.doubleTap.getValue() && this.onGround && !flag1 && !flag2 && this.movementInput.moveForward >= f && !this.isSprinting() && flag3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { + if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.isKeyDown()) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); + this.minecraftMovementInputHelper.setSprintState(true, false); + } + if (!this.isSprinting() && this.movementInput.moveForward >= f && flag3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness) && this.mc.gameSettings.keyBindSprint.isKeyDown()) { + this.setSprinting(true); + this.minecraftMovementInputHelper.setSprintState(true, false); + } + } + } else { + boolean bl6 = MinecraftMovementInputHelper.isSprinting; + if (!(!flag3 || this.isUsingItem() || this.isPotionActive(Potion.blindness) || MinecraftMovementInputHelper.superSusBoolean || bl5 && this.isSprinting())) { + this.setSprinting(bl6); + } + if (bl5 && !bl6 && this.onGround && !flag2 && this.movementInput.moveForward >= f && !this.isSprinting() && flag3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { + if (this.sprintToggleTimer == 0) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); + this.minecraftMovementInputHelper.setSprintState(true, true); + this.sprintToggleTimer = 0; + } + } + } + + + if (this.isSprinting() && (this.movementInput.moveForward < f || this.isCollidedHorizontally || !flag3)) { + this.setSprinting(false); + if (MinecraftMovementInputHelper.superSusBoolean || bl4 || MinecraftMovementInputHelper.aSusBoolean || this.isRiding()) { + this.minecraftMovementInputHelper.setSprintState(false, false); + + } + } + + //CB + if ((Boolean) SimpleModuleToggleSprint.flyBoost.getValue() && this.capabilities.isFlying && this.mc.gameSettings.keyBindSprint.isKeyDown() && this.capabilities.isCreativeMode) { + this.capabilities.setFlySpeed(0.027272727f * 1.8333334f * (Float) SimpleModuleToggleSprint.flyBoostAmount.getValue()); + if (this.movementInput.sneak) { + this.motionY -= 0.6526315808296204 * 0.2298387090145425 * (double) (Float) SimpleModuleToggleSprint.flyBoostAmount.getValue(); + } + if (this.movementInput.jump) { + this.motionY += 0.01084337374315776 * 13.833333015441895 * (double) (Float) SimpleModuleToggleSprint.flyBoostAmount.getValue(); + } + } else if (this.capabilities.getFlySpeed() != 0.0129629625f * 3.857143f) { + this.capabilities.setFlySpeed(4.714286f * 0.010606061f); + } + + if (this.capabilities.allowFlying) { + if (this.mc.playerController.isSpectatorMode()) { + if (!this.capabilities.isFlying) { + this.capabilities.isFlying = true; + this.sendPlayerAbilities(); + } + } else if (!flag && this.movementInput.jump) { + if (this.flyToggleTimer == 0) { + this.flyToggleTimer = 7; + } else { + this.capabilities.isFlying = !this.capabilities.isFlying; + this.sendPlayerAbilities(); + this.flyToggleTimer = 0; + } + } + } + + if (this.capabilities.isFlying && this.isCurrentViewEntity()) { + if (this.movementInput.sneak) { + this.motionY -= (double) (this.capabilities.getFlySpeed() * 3.0F); + } + + if (this.movementInput.jump) { + this.motionY += (double) (this.capabilities.getFlySpeed() * 3.0F); + } + } + + if (this.isRidingHorse()) { + if (this.horseJumpPowerCounter < 0) { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter == 0) { + this.horseJumpPower = 0.0F; + } + } + + if (flag && !this.movementInput.jump) { + this.horseJumpPowerCounter = -10; + this.sendHorseJump(); + } else if (!flag && this.movementInput.jump) { + this.horseJumpPowerCounter = 0; + this.horseJumpPower = 0.0F; + } else if (flag) { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter < 10) { + this.horseJumpPower = (float) this.horseJumpPowerCounter * 0.1F; + } else { + this.horseJumpPower = 0.8F + 2.0F / (float) (this.horseJumpPowerCounter - 9) * 0.1F; + } + } + } else { + this.horseJumpPower = 0.0F; + } + + super.onLivingUpdate(); + + if (this.onGround && this.capabilities.isFlying && !this.mc.playerController.isSpectatorMode()) { + this.capabilities.isFlying = false; + this.sendPlayerAbilities(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/ChatLine.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ChatLine.java new file mode 100644 index 0000000..0cc3a04 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ChatLine.java @@ -0,0 +1,32 @@ +package net.minecraft.client.gui; + +import net.minecraft.util.IChatComponent; + +public class ChatLine +{ + private final int updateCounterCreated; + private final IChatComponent lineString; + private final int chatLineID; + + public ChatLine(int p_i45000_1_, IChatComponent p_i45000_2_, int p_i45000_3_) + { + this.lineString = p_i45000_2_; + this.updateCounterCreated = p_i45000_1_; + this.chatLineID = p_i45000_3_; + } + + public IChatComponent getChatComponent() + { + return this.lineString; + } + + public int getUpdatedCounter() + { + return this.updateCounterCreated; + } + + public int getChatLineID() + { + return this.chatLineID; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/FontRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/FontRenderer.java new file mode 100644 index 0000000..5402289 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/FontRenderer.java @@ -0,0 +1,996 @@ +package net.minecraft.client.gui; + +import com.ibm.icu.text.ArabicShaping; +import com.ibm.icu.text.ArabicShapingException; +import com.ibm.icu.text.Bidi; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomColors; +import net.optifine.render.GlBlendState; +import net.optifine.util.FontUtils; +import org.apache.commons.io.IOUtils; +import org.lwjgl.opengl.GL11; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; + +public class FontRenderer implements IResourceManagerReloadListener +{ + private static final ResourceLocation[] unicodePageLocations = new ResourceLocation[256]; + private final int[] charWidth = new int[256]; + public int FONT_HEIGHT = 9; + public Random fontRandom = new Random(); + private byte[] glyphWidth = new byte[65536]; + public int[] colorCode = new int[32]; + private ResourceLocation locationFontTexture; + private final TextureManager renderEngine; + private float posX; + private float posY; + private boolean unicodeFlag; + private boolean bidiFlag; + private float red; + private float blue; + private float green; + private float alpha; + private int textColor; + private boolean randomStyle; + private boolean boldStyle; + private boolean italicStyle; + private boolean underlineStyle; + private boolean strikethroughStyle; + public GameSettings gameSettings; + public ResourceLocation locationFontTextureBase; + public float offsetBold = 1.0F; + private float[] charWidthFloat = new float[256]; + private boolean blend = false; + private GlBlendState oldBlendState = new GlBlendState(); + + public FontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode) + { + this.gameSettings = gameSettingsIn; + this.locationFontTextureBase = location; + this.locationFontTexture = location; + this.renderEngine = textureManagerIn; + this.unicodeFlag = unicode; + this.locationFontTexture = FontUtils.getHdFontLocation(this.locationFontTextureBase); + this.bindTexture(this.locationFontTexture); + + for (int i = 0; i < 32; ++i) + { + Minecraft.getMinecraft().cbLoadingScreen.addPhase(); + int j = (i >> 3 & 1) * 85; + int k = (i >> 2 & 1) * 170 + j; + int l = (i >> 1 & 1) * 170 + j; + int i1 = (i >> 0 & 1) * 170 + j; + + if (i == 6) + { + k += 85; + } + + if (gameSettingsIn.anaglyph) + { + int j1 = (k * 30 + l * 59 + i1 * 11) / 100; + int k1 = (k * 30 + l * 70) / 100; + int l1 = (k * 30 + i1 * 70) / 100; + k = j1; + l = k1; + i1 = l1; + } + + if (i >= 16) + { + k /= 4; + l /= 4; + i1 /= 4; + } + + this.colorCode[i] = (k & 255) << 16 | (l & 255) << 8 | i1 & 255; + } + + this.readGlyphSizes(); + } + + public void onResourceManagerReload(IResourceManager resourceManager) + { + this.locationFontTexture = FontUtils.getHdFontLocation(this.locationFontTextureBase); + + for (int i = 0; i < unicodePageLocations.length; ++i) + { + unicodePageLocations[i] = null; + } + + this.readFontTexture(); + this.readGlyphSizes(); + } + + private void readFontTexture() + { + BufferedImage bufferedimage; + + try + { + bufferedimage = TextureUtil.readBufferedImage(this.getResourceInputStream(this.locationFontTexture)); + } + catch (IOException ioexception1) + { + throw new RuntimeException(ioexception1); + } + + Properties properties = FontUtils.readFontProperties(this.locationFontTexture); + this.blend = FontUtils.readBoolean(properties, "blend", false); + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + int k = i / 16; + int l = j / 16; + float f = (float)i / 128.0F; + float f1 = Config.limit(f, 1.0F, 2.0F); + this.offsetBold = 1.0F / f1; + float f2 = FontUtils.readFloat(properties, "offsetBold", -1.0F); + + if (f2 >= 0.0F) + { + this.offsetBold = f2; + } + + int[] aint = new int[i * j]; + bufferedimage.getRGB(0, 0, i, j, aint, 0, i); + + for (int i1 = 0; i1 < 256; ++i1) + { + int j1 = i1 % 16; + int k1 = i1 / 16; + int l1 = 0; + + for (l1 = k - 1; l1 >= 0; --l1) + { + int i2 = j1 * k + l1; + boolean flag = true; + + for (int j2 = 0; j2 < l && flag; ++j2) + { + int k2 = (k1 * l + j2) * i; + int l2 = aint[i2 + k2]; + int i3 = l2 >> 24 & 255; + + if (i3 > 16) + { + flag = false; + } + } + + if (!flag) + { + break; + } + } + + if (i1 == 65) + { + i1 = i1; + } + + if (i1 == 32) + { + if (k <= 8) + { + l1 = (int)(2.0F * f); + } + else + { + l1 = (int)(1.5F * f); + } + } + + this.charWidthFloat[i1] = (float)(l1 + 1) / f + 1.0F; + } + + FontUtils.readCustomCharWidths(properties, this.charWidthFloat); + + for (int j3 = 0; j3 < this.charWidth.length; ++j3) + { + this.charWidth[j3] = Math.round(this.charWidthFloat[j3]); + } + } + + private void readGlyphSizes() + { + InputStream inputstream = null; + + try + { + inputstream = this.getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); + inputstream.read(this.glyphWidth); + } + catch (IOException ioexception) + { + throw new RuntimeException(ioexception); + } + finally + { + IOUtils.closeQuietly(inputstream); + } + } + + private float renderChar(char ch, boolean italic) + { + if (ch != 32 && ch != 160) + { + int i = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(ch); + return i != -1 && !this.unicodeFlag ? this.renderDefaultChar(i, italic) : this.renderUnicodeChar(ch, italic); + } + else + { + return !this.unicodeFlag ? this.charWidthFloat[ch] : 4.0F; + } + } + + private float renderDefaultChar(int ch, boolean italic) + { + int i = ch % 16 * 8; + int j = ch / 16 * 8; + int k = italic ? 1 : 0; + this.bindTexture(this.locationFontTexture); + float f = this.charWidthFloat[ch]; + float f1 = 7.99F; + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f((float)i / 128.0F, (float)j / 128.0F); + GL11.glVertex3f(this.posX + (float)k, this.posY, 0.0F); + GL11.glTexCoord2f((float)i / 128.0F, ((float)j + 7.99F) / 128.0F); + GL11.glVertex3f(this.posX - (float)k, this.posY + 7.99F, 0.0F); + GL11.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, (float)j / 128.0F); + GL11.glVertex3f(this.posX + f1 - 1.0F + (float)k, this.posY, 0.0F); + GL11.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, ((float)j + 7.99F) / 128.0F); + GL11.glVertex3f(this.posX + f1 - 1.0F - (float)k, this.posY + 7.99F, 0.0F); + GL11.glEnd(); + return f; + } + + private ResourceLocation getUnicodePageLocation(int page) + { + if (unicodePageLocations[page] == null) + { + unicodePageLocations[page] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[] {Integer.valueOf(page)})); + unicodePageLocations[page] = FontUtils.getHdFontLocation(unicodePageLocations[page]); + } + + return unicodePageLocations[page]; + } + + private void loadGlyphTexture(int page) + { + this.bindTexture(this.getUnicodePageLocation(page)); + } + + private float renderUnicodeChar(char ch, boolean italic) + { + if (this.glyphWidth[ch] == 0) + { + return 0.0F; + } + else + { + int i = ch / 256; + this.loadGlyphTexture(i); + int j = this.glyphWidth[ch] >>> 4; + int k = this.glyphWidth[ch] & 15; + float f = (float)j; + float f1 = (float)(k + 1); + float f2 = (float)(ch % 16 * 16) + f; + float f3 = (float)((ch & 255) / 16 * 16); + float f4 = f1 - f - 0.02F; + float f5 = italic ? 1.0F : 0.0F; + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f(f2 / 256.0F, f3 / 256.0F); + GL11.glVertex3f(this.posX + f5, this.posY, 0.0F); + GL11.glTexCoord2f(f2 / 256.0F, (f3 + 15.98F) / 256.0F); + GL11.glVertex3f(this.posX - f5, this.posY + 7.99F, 0.0F); + GL11.glTexCoord2f((f2 + f4) / 256.0F, f3 / 256.0F); + GL11.glVertex3f(this.posX + f4 / 2.0F + f5, this.posY, 0.0F); + GL11.glTexCoord2f((f2 + f4) / 256.0F, (f3 + 15.98F) / 256.0F); + GL11.glVertex3f(this.posX + f4 / 2.0F - f5, this.posY + 7.99F, 0.0F); + GL11.glEnd(); + return (f1 - f) / 2.0F + 1.0F; + } + } + + public int drawStringWithShadow(String text, float x, float y, int color) + { + return this.drawString(text, x, y, color, true); + } + + public int drawCenteredStringWithShadow(String var1, int var2, int var3, int var4) { + int var5 = this.getStringWidth(var1); + return this.drawString(var1, var2 - var5 / 2F, var3, var4, true); + } + + public int drawCenteredStringWithShadow(String var1, float var2, float var3, int var4) { + int var5 = this.getStringWidth(var1); + return this.drawString(var1, var2 - (var5 / 2F), var3, var4, false); + } + + public int drawString(String text, int x, int y, int color) + { + return this.drawString(text, (float)x, (float)y, color, false); + } + + public int drawString(String text, float x, float y, int color, boolean dropShadow) + { + this.enableAlpha(); + + if (this.blend) + { + GlStateManager.getBlendState(this.oldBlendState); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + } + + this.resetStyles(); + int i; + + if (dropShadow) + { + i = this.renderString(text, x + 1.0F, y + 1.0F, color, true); + i = Math.max(i, this.renderString(text, x, y, color, false)); + } + else + { + i = this.renderString(text, x, y, color, false); + } + + if (this.blend) + { + GlStateManager.setBlendState(this.oldBlendState); + } + + return i; + } + + private String bidiReorder(String text) + { + try + { + Bidi bidi = new Bidi((new ArabicShaping(8)).shape(text), 127); + bidi.setReorderingMode(0); + return bidi.writeReordered(2); + } + catch (ArabicShapingException var3) + { + return text; + } + } + + private void resetStyles() + { + this.randomStyle = false; + this.boldStyle = false; + this.italicStyle = false; + this.underlineStyle = false; + this.strikethroughStyle = false; + } + + private void renderStringAtPos(String text, boolean shadow) + { + for (int i = 0; i < text.length(); ++i) + { + char c0 = text.charAt(i); + + if (c0 == 167 && i + 1 < text.length()) + { + int l = "0123456789abcdefklmnor".indexOf(text.toLowerCase(Locale.ENGLISH).charAt(i + 1)); + + if (l < 16) + { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; + this.underlineStyle = false; + this.italicStyle = false; + + if (l < 0 || l > 15) + { + l = 15; + } + + if (shadow) + { + l += 16; + } + + int i1 = this.colorCode[l]; + + if (Config.isCustomColors()) + { + i1 = CustomColors.getTextColor(l, i1); + } + + this.textColor = i1; + this.setColor((float)(i1 >> 16) / 255.0F, (float)(i1 >> 8 & 255) / 255.0F, (float)(i1 & 255) / 255.0F, this.alpha); + } + else if (l == 16) + { + this.randomStyle = true; + } + else if (l == 17) + { + this.boldStyle = true; + } + else if (l == 18) + { + this.strikethroughStyle = true; + } + else if (l == 19) + { + this.underlineStyle = true; + } + else if (l == 20) + { + this.italicStyle = true; + } + else if (l == 21) + { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; + this.underlineStyle = false; + this.italicStyle = false; + this.setColor(this.red, this.blue, this.green, this.alpha); + } + + ++i; + } + else + { + int j = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(c0); + + if (this.randomStyle && j != -1) + { + int k = this.getCharWidth(c0); + char c1; + + while (true) + { + j = this.fontRandom.nextInt("\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".length()); + c1 = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".charAt(j); + + if (k == this.getCharWidth(c1)) + { + break; + } + } + + c0 = c1; + } + + float f1 = j != -1 && !this.unicodeFlag ? this.offsetBold : 0.5F; + boolean flag = (c0 == 0 || j == -1 || this.unicodeFlag) && shadow; + + if (flag) + { + this.posX -= f1; + this.posY -= f1; + } + + float f = this.renderChar(c0, this.italicStyle); + + if (flag) + { + this.posX += f1; + this.posY += f1; + } + + if (this.boldStyle) + { + this.posX += f1; + + if (flag) + { + this.posX -= f1; + this.posY -= f1; + } + + this.renderChar(c0, this.italicStyle); + this.posX -= f1; + + if (flag) + { + this.posX += f1; + this.posY += f1; + } + + f += f1; + } + + this.doDraw(f); + } + } + } + + protected void doDraw(float p_doDraw_1_) + { + if (this.strikethroughStyle) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D).endVertex(); + worldrenderer.pos((double)(this.posX + p_doDraw_1_), (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D).endVertex(); + worldrenderer.pos((double)(this.posX + p_doDraw_1_), (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D).endVertex(); + worldrenderer.pos((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + } + + if (this.underlineStyle) + { + Tessellator tessellator1 = Tessellator.getInstance(); + WorldRenderer worldrenderer1 = tessellator1.getWorldRenderer(); + GlStateManager.disableTexture2D(); + worldrenderer1.begin(7, DefaultVertexFormats.POSITION); + int i = this.underlineStyle ? -1 : 0; + worldrenderer1.pos((double)(this.posX + (float)i), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D).endVertex(); + worldrenderer1.pos((double)(this.posX + p_doDraw_1_), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D).endVertex(); + worldrenderer1.pos((double)(this.posX + p_doDraw_1_), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D).endVertex(); + worldrenderer1.pos((double)(this.posX + (float)i), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D).endVertex(); + tessellator1.draw(); + GlStateManager.enableTexture2D(); + } + + this.posX += p_doDraw_1_; + } + + private int renderStringAligned(String text, int x, int y, int width, int color, boolean dropShadow) + { + if (this.bidiFlag) + { + int i = this.getStringWidth(this.bidiReorder(text)); + x = x + width - i; + } + + return this.renderString(text, (float)x, (float)y, color, dropShadow); + } + + private int renderString(String text, float x, float y, int color, boolean dropShadow) + { + if (text == null) + { + return 0; + } + else + { + if (this.bidiFlag) + { + text = this.bidiReorder(text); + } + + if ((color & -67108864) == 0) + { + color |= -16777216; + } + + if (dropShadow) + { + color = (color & 16579836) >> 2 | color & -16777216; + } + + this.red = (float)(color >> 16 & 255) / 255.0F; + this.blue = (float)(color >> 8 & 255) / 255.0F; + this.green = (float)(color & 255) / 255.0F; + this.alpha = (float)(color >> 24 & 255) / 255.0F; + this.setColor(this.red, this.blue, this.green, this.alpha); + this.posX = x; + this.posY = y; + this.renderStringAtPos(text, dropShadow); + return (int)this.posX; + } + } + + public int getStringWidth(String text) + { + if (text == null) + { + return 0; + } + else + { + float f = 0.0F; + boolean flag = false; + + for (int i = 0; i < text.length(); ++i) + { + char c0 = text.charAt(i); + float f1 = this.getCharWidthFloat(c0); + + if (f1 < 0.0F && i < text.length() - 1) + { + ++i; + c0 = text.charAt(i); + + if (c0 != 108 && c0 != 76) + { + if (c0 == 114 || c0 == 82) + { + flag = false; + } + } + else + { + flag = true; + } + + f1 = 0.0F; + } + + f += f1; + + if (flag && f1 > 0.0F) + { + f += this.unicodeFlag ? 1.0F : this.offsetBold; + } + } + + return Math.round(f); + } + } + + public int getCharWidth(char character) + { + return Math.round(this.getCharWidthFloat(character)); + } + + private float getCharWidthFloat(char p_getCharWidthFloat_1_) + { + if (p_getCharWidthFloat_1_ == 167) + { + return -1.0F; + } + else if (p_getCharWidthFloat_1_ != 32 && p_getCharWidthFloat_1_ != 160) + { + int i = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(p_getCharWidthFloat_1_); + + if (p_getCharWidthFloat_1_ > 0 && i != -1 && !this.unicodeFlag) + { + return this.charWidthFloat[i]; + } + else if (this.glyphWidth[p_getCharWidthFloat_1_] != 0) + { + int j = this.glyphWidth[p_getCharWidthFloat_1_] >>> 4; + int k = this.glyphWidth[p_getCharWidthFloat_1_] & 15; + + if (k > 7) + { + k = 15; + j = 0; + } + + ++k; + return (float)((k - j) / 2 + 1); + } + else + { + return 0.0F; + } + } + else + { + return this.charWidthFloat[32]; + } + } + + public String trimStringToWidth(String text, int width) + { + return this.trimStringToWidth(text, width, false); + } + + public String trimStringToWidth(String text, int width, boolean reverse) + { + StringBuilder stringbuilder = new StringBuilder(); + float f = 0.0F; + int i = reverse ? text.length() - 1 : 0; + int j = reverse ? -1 : 1; + boolean flag = false; + boolean flag1 = false; + + for (int k = i; k >= 0 && k < text.length() && f < (float)width; k += j) + { + char c0 = text.charAt(k); + float f1 = this.getCharWidthFloat(c0); + + if (flag) + { + flag = false; + + if (c0 != 108 && c0 != 76) + { + if (c0 == 114 || c0 == 82) + { + flag1 = false; + } + } + else + { + flag1 = true; + } + } + else if (f1 < 0.0F) + { + flag = true; + } + else + { + f += f1; + + if (flag1) + { + ++f; + } + } + + if (f > (float)width) + { + break; + } + + if (reverse) + { + stringbuilder.insert(0, (char)c0); + } + else + { + stringbuilder.append(c0); + } + } + + return stringbuilder.toString(); + } + + private String trimStringNewline(String text) + { + while (text != null && text.endsWith("\n")) + { + text = text.substring(0, text.length() - 1); + } + + return text; + } + + public void drawSplitString(String str, int x, int y, int wrapWidth, int textColor) + { + if (this.blend) + { + GlStateManager.getBlendState(this.oldBlendState); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + } + + this.resetStyles(); + this.textColor = textColor; + str = this.trimStringNewline(str); + this.renderSplitString(str, x, y, wrapWidth, false); + + if (this.blend) + { + GlStateManager.setBlendState(this.oldBlendState); + } + } + + private void renderSplitString(String str, int x, int y, int wrapWidth, boolean addShadow) + { + for (String s : this.listFormattedStringToWidth(str, wrapWidth)) + { + this.renderStringAligned(s, x, y, wrapWidth, this.textColor, addShadow); + y += this.FONT_HEIGHT; + } + } + + public int splitStringWidth(String str, int maxLength) + { + return this.FONT_HEIGHT * this.listFormattedStringToWidth(str, maxLength).size(); + } + + public void setUnicodeFlag(boolean unicodeFlagIn) + { + this.unicodeFlag = unicodeFlagIn; + } + + public boolean getUnicodeFlag() + { + return this.unicodeFlag; + } + + public void setBidiFlag(boolean bidiFlagIn) + { + this.bidiFlag = bidiFlagIn; + } + + public List listFormattedStringToWidth(String str, int wrapWidth) + { + return Arrays.asList(this.wrapFormattedStringToWidth(str, wrapWidth).split("\n")); + } + + String wrapFormattedStringToWidth(String str, int wrapWidth) + { + if (str.length() <= 1) + { + return str; + } + else + { + int i = this.sizeStringToWidth(str, wrapWidth); + + if (str.length() <= i) + { + return str; + } + else + { + String s = str.substring(0, i); + char c0 = str.charAt(i); + boolean flag = c0 == 32 || c0 == 10; + String s1 = getFormatFromString(s) + str.substring(i + (flag ? 1 : 0)); + return s + "\n" + this.wrapFormattedStringToWidth(s1, wrapWidth); + } + } + } + + private int sizeStringToWidth(String str, int wrapWidth) + { + int i = str.length(); + float f = 0.0F; + int j = 0; + int k = -1; + + for (boolean flag = false; j < i; ++j) + { + char c0 = str.charAt(j); + + switch (c0) + { + case '\n': + --j; + break; + + case ' ': + k = j; + + default: + f += (float)this.getCharWidth(c0); + + if (flag) + { + ++f; + } + + break; + + case '\u00a7': + if (j < i - 1) + { + ++j; + char c1 = str.charAt(j); + + if (c1 != 108 && c1 != 76) + { + if (c1 == 114 || c1 == 82 || isFormatColor(c1)) + { + flag = false; + } + } + else + { + flag = true; + } + } + } + + if (c0 == 10) + { + ++j; + k = j; + break; + } + + if (Math.round(f) > wrapWidth) + { + break; + } + } + + return j != i && k != -1 && k < j ? k : j; + } + + private static boolean isFormatColor(char colorChar) + { + return colorChar >= 48 && colorChar <= 57 || colorChar >= 97 && colorChar <= 102 || colorChar >= 65 && colorChar <= 70; + } + + private static boolean isFormatSpecial(char formatChar) + { + return formatChar >= 107 && formatChar <= 111 || formatChar >= 75 && formatChar <= 79 || formatChar == 114 || formatChar == 82; + } + + public static String getFormatFromString(String text) + { + String s = ""; + int i = -1; + int j = text.length(); + + while ((i = text.indexOf(167, i + 1)) != -1) + { + if (i < j - 1) + { + char c0 = text.charAt(i + 1); + + if (isFormatColor(c0)) + { + s = "\u00a7" + c0; + } + else if (isFormatSpecial(c0)) + { + s = s + "\u00a7" + c0; + } + } + } + + return s; + } + + public boolean getBidiFlag() + { + return this.bidiFlag; + } + + public int getColorCode(char character) + { + int i = "0123456789abcdef".indexOf(character); + + if (i >= 0 && i < this.colorCode.length) + { + int j = this.colorCode[i]; + + if (Config.isCustomColors()) + { + j = CustomColors.getTextColor(i, j); + } + + return j; + } + else + { + return 16777215; + } + } + + protected void setColor(float p_setColor_1_, float p_setColor_2_, float p_setColor_3_, float p_setColor_4_) + { + GlStateManager.color(p_setColor_1_, p_setColor_2_, p_setColor_3_, p_setColor_4_); + } + + protected void enableAlpha() + { + GlStateManager.enableAlpha(); + } + + protected void bindTexture(ResourceLocation p_bindTexture_1_) + { + this.renderEngine.bindTexture(p_bindTexture_1_); + } + + protected InputStream getResourceInputStream(ResourceLocation p_getResourceInputStream_1_) throws IOException + { + return Minecraft.getMinecraft().getResourceManager().getResource(p_getResourceInputStream_1_).getInputStream(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/Gui.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/Gui.java new file mode 100644 index 0000000..6e342c5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/Gui.java @@ -0,0 +1,261 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; + +public class Gui { + public static final ResourceLocation optionsBackground = new ResourceLocation("textures/gui/options_background.png"); + public static final ResourceLocation statIcons = new ResourceLocation("textures/gui/container/stats_icons.png"); + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + public static float zLevel; + + protected void drawHorizontalLine(int startX, int endX, int y, int color) { + if (endX < startX) { + int i = startX; + startX = endX; + endX = i; + } + + drawRect(startX, y, endX + 1, y + 1, color); + } + + protected void drawVerticalLine(int x, int startY, int endY, int color) { + if (endY < startY) { + int i = startY; + startY = endY; + endY = i; + } + + drawRect(x, startY + 1, x + 1, endY, color); + } + + public static void drawRect(int left, int top, int right, int bottom, int color) { + if (left < right) { + int i = left; + left = right; + right = i; + } + + if (top < bottom) { + int j = top; + top = bottom; + bottom = j; + } + + float f3 = (float) (color >> 24 & 255) / 255.0F; + float f = (float) (color >> 16 & 255) / 255.0F; + float f1 = (float) (color >> 8 & 255) / 255.0F; + float f2 = (float) (color & 255) / 255.0F; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.color(f, f1, f2, f3); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) left, (double) bottom, 0.0D).color(f, f1, f2, f3).endVertex(); + worldrenderer.pos((double) right, (double) bottom, 0.0D).color(f, f1, f2, f3).endVertex(); + worldrenderer.pos((double) right, (double) top, 0.0D).color(f, f1, f2, f3).endVertex(); + worldrenderer.pos((double) left, (double) top, 0.0D).color(f, f1, f2, f3).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + } + + public static void drawRect(float left, float top, float right, float bottom, int color) { + float var5; + + if (left < right) { + var5 = left; + left = right; + right = var5; + } + + if (top < bottom) { + var5 = top; + top = bottom; + bottom = var5; + } + + float var10 = (float) (color >> 24 & 255) / 255.0F; + float var6 = (float) (color >> 16 & 255) / 255.0F; + float var7 = (float) (color >> 8 & 255) / 255.0F; + float var8 = (float) (color & 255) / 255.0F; + Tessellator var9 = Tessellator.getInstance(); + WorldRenderer worldrenderer = var9.getWorldRenderer(); + GlStateManager.disableCull(); + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); +// GlStateManager.color(f, f1, f2, f3); + GlStateManager.shadeModel(7425); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) left, (double) bottom, 0.0D).color(var6, var7, var8, var10).endVertex(); + worldrenderer.pos((double) right, (double) bottom, 0.0D).color(var6, var7, var8, var10).endVertex(); + worldrenderer.pos((double) right, (double) top, 0.0D).color(var6, var7, var8, var10).endVertex(); + worldrenderer.pos((double) left, (double) top, 0.0D).color(var6, var7, var8, var10).endVertex(); + var9.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + public static void drawRectWithOutline(float f, float f2, float f3, float f4, float f5, int n, int n2) { + Gui.drawRect(f + f5, f2 + f5, f3 - f5, f4 - f5, n2); + Gui.drawRect(f, f2 + f5, f + f5, f4 - f5, n); + Gui.drawRect(f3 - f5, f2 + f5, f3, f4 - f5, n); + Gui.drawRect(f, f2, f3, f2 + f5, n); + Gui.drawRect(f, f4 - f5, f3, f4, n); + } + + public static void drawBoxWithOutLine(float f, float f2, float f3, float f4, float f5, int n, int n2) { + Gui.drawRect(f, f2, f3, f4, n2); + Gui.drawRect(f - f5, f2 - f5, f, f4 + f5, n); + Gui.drawRect(f3, f2 - f5, f3 + f5, f4 + f5, n); + Gui.drawRect(f, f2 - f5, f3, f2, n); + Gui.drawRect(f, f4, f3, f4 + f5, n); + } + + /** + * Draws an outline + * This is mainly used in CheatBreaker modules. Not from MCP. + */ + public static void drawOutline(float x1, float y1, float x2, float y2, float thickness, int color) { + drawRect(x1, y1 + thickness, x1 + thickness, y2 - thickness, color); + drawRect(x2 - thickness, y1 + thickness, x2, y2 - thickness, color); + drawRect(x1, y1, x2, y1 + thickness, color); + drawRect(x1, y2 - thickness, x2, y2, color); + } + + public void drawGradientRect(float left, float top, float right, float bottom, int startColor, int endColor) { + float f = (float) (startColor >> 24 & 255) / 255.0F; + float f1 = (float) (startColor >> 16 & 255) / 255.0F; + float f2 = (float) (startColor >> 8 & 255) / 255.0F; + float f3 = (float) (startColor & 255) / 255.0F; + float f4 = (float) (endColor >> 24 & 255) / 255.0F; + float f5 = (float) (endColor >> 16 & 255) / 255.0F; + float f6 = (float) (endColor >> 8 & 255) / 255.0F; + float f7 = (float) (endColor & 255) / 255.0F; + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.shadeModel(7425); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) right, (double) top, (double) this.zLevel).color(f1, f2, f3, f).endVertex(); + worldrenderer.pos((double) left, (double) top, (double) this.zLevel).color(f1, f2, f3, f).endVertex(); + worldrenderer.pos((double) left, (double) bottom, (double) this.zLevel).color(f5, f6, f7, f4).endVertex(); + worldrenderer.pos((double) right, (double) bottom, (double) this.zLevel).color(f5, f6, f7, f4).endVertex(); + tessellator.draw(); + GlStateManager.shadeModel(7424); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + } + + protected void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor) { + float f = (float) (startColor >> 24 & 255) / 255.0F; + float f1 = (float) (startColor >> 16 & 255) / 255.0F; + float f2 = (float) (startColor >> 8 & 255) / 255.0F; + float f3 = (float) (startColor & 255) / 255.0F; + float f4 = (float) (endColor >> 24 & 255) / 255.0F; + float f5 = (float) (endColor >> 16 & 255) / 255.0F; + float f6 = (float) (endColor >> 8 & 255) / 255.0F; + float f7 = (float) (endColor & 255) / 255.0F; + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.shadeModel(7425); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) right, (double) top, (double) this.zLevel).color(f1, f2, f3, f).endVertex(); + worldrenderer.pos((double) left, (double) top, (double) this.zLevel).color(f1, f2, f3, f).endVertex(); + worldrenderer.pos((double) left, (double) bottom, (double) this.zLevel).color(f5, f6, f7, f4).endVertex(); + worldrenderer.pos((double) right, (double) bottom, (double) this.zLevel).color(f5, f6, f7, f4).endVertex(); + tessellator.draw(); + GlStateManager.shadeModel(7424); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + } + + public void drawCenteredString(FontRenderer fontRendererIn, String text, int x, int y, int color) { + fontRendererIn.drawStringWithShadow(text, (float) (x - fontRendererIn.getStringWidth(text) / 2), (float) y, color); + } + + public void drawString(FontRenderer fontRendererIn, String text, int x, int y, int color) { + fontRendererIn.drawStringWithShadow(text, (float) x, (float) y, color); + } + + public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) { + float f = 0.00390625F; + float f1 = 0.00390625F; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (x + 0), (double) (y + height), (double) this.zLevel).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + height) * f1)).endVertex(); + worldrenderer.pos((double) (x + width), (double) (y + height), (double) this.zLevel).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + height) * f1)).endVertex(); + worldrenderer.pos((double) (x + width), (double) (y + 0), (double) this.zLevel).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + 0) * f1)).endVertex(); + worldrenderer.pos((double) (x + 0), (double) (y + 0), (double) this.zLevel).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + 0) * f1)).endVertex(); + tessellator.draw(); + } + + public void drawTexturedModalRect(float xCoord, float yCoord, int minU, int minV, int maxU, int maxV) { + float f = 0.00390625F; + float f1 = 0.00390625F; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (xCoord + 0.0F), (double) (yCoord + (float) maxV), (double) this.zLevel).tex((double) ((float) (minU + 0) * f), (double) ((float) (minV + maxV) * f1)).endVertex(); + worldrenderer.pos((double) (xCoord + (float) maxU), (double) (yCoord + (float) maxV), (double) this.zLevel).tex((double) ((float) (minU + maxU) * f), (double) ((float) (minV + maxV) * f1)).endVertex(); + worldrenderer.pos((double) (xCoord + (float) maxU), (double) (yCoord + 0.0F), (double) this.zLevel).tex((double) ((float) (minU + maxU) * f), (double) ((float) (minV + 0) * f1)).endVertex(); + worldrenderer.pos((double) (xCoord + 0.0F), (double) (yCoord + 0.0F), (double) this.zLevel).tex((double) ((float) (minU + 0) * f), (double) ((float) (minV + 0) * f1)).endVertex(); + tessellator.draw(); + } + + public void drawTexturedModalRect(int xCoord, int yCoord, TextureAtlasSprite textureSprite, int widthIn, int heightIn) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (xCoord + 0), (double) (yCoord + heightIn), (double) this.zLevel).tex((double) textureSprite.getMinU(), (double) textureSprite.getMaxV()).endVertex(); + worldrenderer.pos((double) (xCoord + widthIn), (double) (yCoord + heightIn), (double) this.zLevel).tex((double) textureSprite.getMaxU(), (double) textureSprite.getMaxV()).endVertex(); + worldrenderer.pos((double) (xCoord + widthIn), (double) (yCoord + 0), (double) this.zLevel).tex((double) textureSprite.getMaxU(), (double) textureSprite.getMinV()).endVertex(); + worldrenderer.pos((double) (xCoord + 0), (double) (yCoord + 0), (double) this.zLevel).tex((double) textureSprite.getMinU(), (double) textureSprite.getMinV()).endVertex(); + tessellator.draw(); + } + + public static void drawModalRectWithCustomSizedTexture(int x, int y, float u, float v, int width, int height, float textureWidth, float textureHeight) { + float f = 1.0F / textureWidth; + float f1 = 1.0F / textureHeight; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) x, (double) (y + height), 0.0D).tex((double) (u * f), (double) ((v + (float) height) * f1)).endVertex(); + worldrenderer.pos((double) (x + width), (double) (y + height), 0.0D).tex((double) ((u + (float) width) * f), (double) ((v + (float) height) * f1)).endVertex(); + worldrenderer.pos((double) (x + width), (double) y, 0.0D).tex((double) ((u + (float) width) * f), (double) (v * f1)).endVertex(); + worldrenderer.pos((double) x, (double) y, 0.0D).tex((double) (u * f), (double) (v * f1)).endVertex(); + tessellator.draw(); + } + + public static void drawScaledCustomSizeModalRect(int x, int y, float u, float v, int uWidth, int vHeight, int width, int height, float tileWidth, float tileHeight) { + float f = 1.0F / tileWidth; + float f1 = 1.0F / tileHeight; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) x, (double) (y + height), 0.0D).tex((double) (u * f), (double) ((v + (float) vHeight) * f1)).endVertex(); + worldrenderer.pos((double) (x + width), (double) (y + height), 0.0D).tex((double) ((u + (float) uWidth) * f), (double) ((v + (float) vHeight) * f1)).endVertex(); + worldrenderer.pos((double) (x + width), (double) y, 0.0D).tex((double) ((u + (float) uWidth) * f), (double) (v * f1)).endVertex(); + worldrenderer.pos((double) x, (double) y, 0.0D).tex((double) (u * f), (double) (v * f1)).endVertex(); + tessellator.draw(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButton.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButton.java new file mode 100644 index 0000000..868c4ba --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButton.java @@ -0,0 +1,124 @@ +package net.minecraft.client.gui; + +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; + +public class GuiButton extends Gui +{ + protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png"); + @Getter protected int width; + @Getter protected int height; + public int xPosition; + public int yPosition; + public String displayString; + public int id; + public boolean enabled; + public boolean visible; + protected boolean hovered; + + public GuiButton(int buttonId, int x, int y, String buttonText) + { + this(buttonId, x, y, 200, 20, buttonText); + } + + public GuiButton(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText) + { + this.width = 200; + this.height = 20; + this.enabled = true; + this.visible = true; + this.id = buttonId; + this.xPosition = x; + this.yPosition = y; + this.width = widthIn; + this.height = heightIn; + this.displayString = buttonText; + } + + protected int getHoverState(boolean mouseOver) + { + int i = 1; + + if (!this.enabled) + { + i = 0; + } + else if (mouseOver) + { + i = 2; + } + + return i; + } + + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + FontRenderer fontrenderer = mc.fontRendererObj; + mc.getTextureManager().bindTexture(buttonTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int i = this.getHoverState(this.hovered); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.blendFunc(770, 771); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height); + this.mouseDragged(mc, mouseX, mouseY); + int j = 14737632; + + if (!this.enabled) + { + j = 10526880; + } + else if (this.hovered) + { + j = 16777120; + } + + this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j); + } + } + + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + } + + public void mouseReleased(int mouseX, int mouseY) + { + } + + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + return this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + } + + public boolean isMouseOver() + { + return this.hovered; + } + + public void drawButtonForegroundLayer(int mouseX, int mouseY) + { + } + + public void playPressSound(SoundHandler soundHandlerIn) + { + soundHandlerIn.playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + } + + public int getButtonWidth() + { + return this.width; + } + + public void setWidth(int width) + { + this.width = width; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java new file mode 100644 index 0000000..8b5ec31 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java @@ -0,0 +1,30 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; + +public class GuiButtonLanguage extends GuiButton +{ + public GuiButtonLanguage(int buttonID, int xPos, int yPos) + { + super(buttonID, xPos, yPos, 20, 20, ""); + } + + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + mc.getTextureManager().bindTexture(GuiButton.buttonTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int i = 106; + + if (flag) + { + i += this.height; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, i, this.width, this.height); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java new file mode 100644 index 0000000..7de37ff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java @@ -0,0 +1,91 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.realms.RealmsButton; + +public class GuiButtonRealmsProxy extends GuiButton +{ + private RealmsButton realmsButton; + + public GuiButtonRealmsProxy(RealmsButton realmsButtonIn, int buttonId, int x, int y, String text) + { + super(buttonId, x, y, text); + this.realmsButton = realmsButtonIn; + } + + public GuiButtonRealmsProxy(RealmsButton realmsButtonIn, int buttonId, int x, int y, String text, int widthIn, int heightIn) + { + super(buttonId, x, y, widthIn, heightIn, text); + this.realmsButton = realmsButtonIn; + } + + public int getId() + { + return super.id; + } + + public boolean getEnabled() + { + return super.enabled; + } + + public void setEnabled(boolean isEnabled) + { + super.enabled = isEnabled; + } + + public void setText(String text) + { + super.displayString = text; + } + + public int getButtonWidth() + { + return super.getButtonWidth(); + } + + public int getPositionY() + { + return super.yPosition; + } + + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.realmsButton.clicked(mouseX, mouseY); + } + + return super.mousePressed(mc, mouseX, mouseY); + } + + public void mouseReleased(int mouseX, int mouseY) + { + this.realmsButton.released(mouseX, mouseY); + } + + public void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + this.realmsButton.renderBg(mouseX, mouseY); + } + + public RealmsButton getRealmsButton() + { + return this.realmsButton; + } + + public int getHoverState(boolean mouseOver) + { + return this.realmsButton.getYImage(mouseOver); + } + + public int func_154312_c(boolean p_154312_1_) + { + return super.getHoverState(p_154312_1_); + } + + public int getHeight() + { + return this.height; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiChat.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiChat.java new file mode 100644 index 0000000..379817d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiChat.java @@ -0,0 +1,309 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +public class GuiChat extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private String historyBuffer = ""; + private int sentHistoryCursor = -1; + private boolean playerNamesFound; + private boolean waitingOnAutocomplete; + private int autocompleteIndex; + private List foundPlayerNames = Lists.newArrayList(); + protected GuiTextField inputField; + private String defaultInputFieldText = ""; + + public GuiChat() + { + } + + public GuiChat(String defaultText) + { + this.defaultInputFieldText = defaultText; + } + + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.sentHistoryCursor = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); + this.inputField = new GuiTextField(0, this.fontRendererObj, 4, this.height - 12, this.width - 4, 12); + this.inputField.setMaxStringLength(100); + this.inputField.setEnableBackgroundDrawing(false); + this.inputField.setFocused(true); + this.inputField.setText(this.defaultInputFieldText); + this.inputField.setCanLoseFocus(false); + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } + + public void updateScreen() + { + this.inputField.updateCursorCounter(); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + this.waitingOnAutocomplete = false; + + if (keyCode == 15) + { + this.autocompletePlayerNames(); + } + else + { + this.playerNamesFound = false; + } + + if (keyCode == 1) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (keyCode != 28 && keyCode != 156) + { + if (keyCode == 200) + { + this.getSentHistory(-1); + } + else if (keyCode == 208) + { + this.getSentHistory(1); + } + else if (keyCode == 201) + { + this.mc.ingameGUI.getChatGUI().scroll(this.mc.ingameGUI.getChatGUI().getLineCount() - 1); + } + else if (keyCode == 209) + { + this.mc.ingameGUI.getChatGUI().scroll(-this.mc.ingameGUI.getChatGUI().getLineCount() + 1); + } + else + { + this.inputField.textboxKeyTyped(typedChar, keyCode); + } + } + else + { + String s = this.inputField.getText().trim(); + + if (s.length() > 0) + { + this.sendChatMessage(s); + } + + this.mc.displayGuiScreen((GuiScreen)null); + } + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + int i = Mouse.getEventDWheel(); + + if (i != 0) + { + if (i > 1) + { + i = 1; + } + + if (i < -1) + { + i = -1; + } + + if (!isShiftKeyDown()) + { + i *= 7; + } + + this.mc.ingameGUI.getChatGUI().scroll(i); + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + if (mouseButton == 0) + { + IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); + + if (this.handleComponentClick(ichatcomponent)) + { + return; + } + } + + this.inputField.mouseClicked(mouseX, mouseY, mouseButton); + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + protected void setText(String newChatText, boolean shouldOverwrite) + { + if (shouldOverwrite) + { + this.inputField.setText(newChatText); + } + else + { + this.inputField.writeText(newChatText); + } + } + + public void autocompletePlayerNames() + { + if (this.playerNamesFound) + { + this.inputField.deleteFromCursor(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false) - this.inputField.getCursorPosition()); + + if (this.autocompleteIndex >= this.foundPlayerNames.size()) + { + this.autocompleteIndex = 0; + } + } + else + { + int i = this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false); + this.foundPlayerNames.clear(); + this.autocompleteIndex = 0; + String s = this.inputField.getText().substring(i).toLowerCase(); + String s1 = this.inputField.getText().substring(0, this.inputField.getCursorPosition()); + this.sendAutocompleteRequest(s1, s); + + if (this.foundPlayerNames.isEmpty()) + { + return; + } + + this.playerNamesFound = true; + this.inputField.deleteFromCursor(i - this.inputField.getCursorPosition()); + } + + if (this.foundPlayerNames.size() > 1) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (String s2 : this.foundPlayerNames) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append(", "); + } + + stringbuilder.append(s2); + } + + this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1); + } + + this.inputField.writeText((String)this.foundPlayerNames.get(this.autocompleteIndex++)); + } + + private void sendAutocompleteRequest(String p_146405_1_, String p_146405_2_) + { + if (p_146405_1_.length() >= 1) + { + BlockPos blockpos = null; + + if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + blockpos = this.mc.objectMouseOver.getBlockPos(); + } + + this.mc.thePlayer.sendQueue.addToSendQueue(new C14PacketTabComplete(p_146405_1_, blockpos)); + this.waitingOnAutocomplete = true; + } + } + + public void getSentHistory(int msgPos) + { + int i = this.sentHistoryCursor + msgPos; + int j = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); + i = MathHelper.clamp_int(i, 0, j); + + if (i != this.sentHistoryCursor) + { + if (i == j) + { + this.sentHistoryCursor = j; + this.inputField.setText(this.historyBuffer); + } + else + { + if (this.sentHistoryCursor == j) + { + this.historyBuffer = this.inputField.getText(); + } + + this.inputField.setText((String)this.mc.ingameGUI.getChatGUI().getSentMessages().get(i)); + this.sentHistoryCursor = i; + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); + this.inputField.drawTextBox(); + IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); + + if (ichatcomponent != null && ichatcomponent.getChatStyle().getChatHoverEvent() != null) + { + this.handleComponentHover(ichatcomponent, mouseX, mouseY); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void onAutocompleteResponse(String[] p_146406_1_) + { + if (this.waitingOnAutocomplete) + { + this.playerNamesFound = false; + this.foundPlayerNames.clear(); + + for (String s : p_146406_1_) + { + if (s.length() > 0) + { + this.foundPlayerNames.add(s); + } + } + + String s1 = this.inputField.getText().substring(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false)); + String s2 = StringUtils.getCommonPrefix(p_146406_1_); + + if (s2.length() > 0 && !s1.equalsIgnoreCase(s2)) + { + this.inputField.deleteFromCursor(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false) - this.inputField.getCursorPosition()); + this.inputField.writeText(s2); + } + else if (this.foundPlayerNames.size() > 0) + { + this.playerNamesFound = true; + this.autocompletePlayerNames(); + } + } + } + + public boolean doesGuiPauseGame() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiClickableScrolledSelectionListProxy.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiClickableScrolledSelectionListProxy.java new file mode 100644 index 0000000..690cfb4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiClickableScrolledSelectionListProxy.java @@ -0,0 +1,105 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.realms.RealmsClickableScrolledSelectionList; +import net.minecraft.realms.Tezzelator; +import org.lwjgl.input.Mouse; + +public class GuiClickableScrolledSelectionListProxy extends GuiSlot +{ + private final RealmsClickableScrolledSelectionList field_178046_u; + + public GuiClickableScrolledSelectionListProxy(RealmsClickableScrolledSelectionList selectionList, int p_i45526_2_, int p_i45526_3_, int p_i45526_4_, int p_i45526_5_, int p_i45526_6_) + { + super(Minecraft.getMinecraft(), p_i45526_2_, p_i45526_3_, p_i45526_4_, p_i45526_5_, p_i45526_6_); + this.field_178046_u = selectionList; + } + + protected int getSize() + { + return this.field_178046_u.getItemCount(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + this.field_178046_u.selectItem(slotIndex, isDoubleClick, mouseX, mouseY); + } + + protected boolean isSelected(int slotIndex) + { + return this.field_178046_u.isSelectedItem(slotIndex); + } + + protected void drawBackground() + { + this.field_178046_u.renderBackground(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + this.field_178046_u.renderItem(entryID, p_180791_2_, p_180791_3_, p_180791_4_, mouseXIn, mouseYIn); + } + + public int func_178044_e() + { + return super.width; + } + + public int func_178042_f() + { + return super.mouseY; + } + + public int func_178045_g() + { + return super.mouseX; + } + + protected int getContentHeight() + { + return this.field_178046_u.getMaxPosition(); + } + + protected int getScrollBarX() + { + return this.field_178046_u.getScrollbarPosition(); + } + + public void handleMouseInput() + { + super.handleMouseInput(); + + if (this.scrollMultiplier > 0.0F && Mouse.getEventButtonState()) + { + this.field_178046_u.customMouseEvent(this.top, this.bottom, this.headerPadding, this.amountScrolled, this.slotHeight); + } + } + + public void func_178043_a(int p_178043_1_, int p_178043_2_, int p_178043_3_, Tezzelator p_178043_4_) + { + this.field_178046_u.renderSelected(p_178043_1_, p_178043_2_, p_178043_3_, p_178043_4_); + } + + protected void drawSelectionBox(int p_148120_1_, int p_148120_2_, int mouseXIn, int mouseYIn) + { + int i = this.getSize(); + + for (int j = 0; j < i; ++j) + { + int k = p_148120_2_ + j * this.slotHeight + this.headerPadding; + int l = this.slotHeight - 4; + + if (k > this.bottom || k + l < this.top) + { + this.func_178040_a(j, p_148120_1_, k); + } + + if (this.showSelectionBox && this.isSelected(j)) + { + this.func_178043_a(this.width, k, l, Tezzelator.instance); + } + + this.drawSlot(j, p_148120_1_, k, l, mouseXIn, mouseYIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java new file mode 100644 index 0000000..db581e2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java @@ -0,0 +1,160 @@ +package net.minecraft.client.gui; + +import io.netty.buffer.Unpooled; +import java.io.IOException; +import net.minecraft.client.resources.I18n; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.IChatComponent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; + +public class GuiCommandBlock extends GuiScreen +{ + private static final Logger field_146488_a = LogManager.getLogger(); + private GuiTextField commandTextField; + private GuiTextField previousOutputTextField; + private final CommandBlockLogic localCommandBlock; + private GuiButton doneBtn; + private GuiButton cancelBtn; + private GuiButton field_175390_s; + private boolean field_175389_t; + + public GuiCommandBlock(CommandBlockLogic p_i45032_1_) + { + this.localCommandBlock = p_i45032_1_; + } + + public void updateScreen() + { + this.commandTextField.updateCursorCounter(); + } + + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 4 - 150, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(this.cancelBtn = new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.field_175390_s = new GuiButton(4, this.width / 2 + 150 - 20, 150, 20, 20, "O")); + this.commandTextField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 150, 50, 300, 20); + this.commandTextField.setMaxStringLength(32767); + this.commandTextField.setFocused(true); + this.commandTextField.setText(this.localCommandBlock.getCommand()); + this.previousOutputTextField = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 150, 150, 276, 20); + this.previousOutputTextField.setMaxStringLength(32767); + this.previousOutputTextField.setEnabled(false); + this.previousOutputTextField.setText("-"); + this.field_175389_t = this.localCommandBlock.shouldTrackOutput(); + this.func_175388_a(); + this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 1) + { + this.localCommandBlock.setTrackOutput(this.field_175389_t); + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button.id == 0) + { + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + packetbuffer.writeByte(this.localCommandBlock.func_145751_f()); + this.localCommandBlock.func_145757_a(packetbuffer); + packetbuffer.writeString(this.commandTextField.getText()); + packetbuffer.writeBoolean(this.localCommandBlock.shouldTrackOutput()); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|AdvCdm", packetbuffer)); + + if (!this.localCommandBlock.shouldTrackOutput()) + { + this.localCommandBlock.setLastOutput((IChatComponent)null); + } + + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button.id == 4) + { + this.localCommandBlock.setTrackOutput(!this.localCommandBlock.shouldTrackOutput()); + this.func_175388_a(); + } + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + this.commandTextField.textboxKeyTyped(typedChar, keyCode); + this.previousOutputTextField.textboxKeyTyped(typedChar, keyCode); + this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; + + if (keyCode != 28 && keyCode != 156) + { + if (keyCode == 1) + { + this.actionPerformed(this.cancelBtn); + } + } + else + { + this.actionPerformed(this.doneBtn); + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.commandTextField.mouseClicked(mouseX, mouseY, mouseButton); + this.previousOutputTextField.mouseClicked(mouseX, mouseY, mouseButton); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("advMode.setCommand", new Object[0]), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("advMode.command", new Object[0]), this.width / 2 - 150, 37, 10526880); + this.commandTextField.drawTextBox(); + int i = 75; + int j = 0; + this.drawString(this.fontRendererObj, I18n.format("advMode.nearestPlayer", new Object[0]), this.width / 2 - 150, i + j++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, I18n.format("advMode.randomPlayer", new Object[0]), this.width / 2 - 150, i + j++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, I18n.format("advMode.allPlayers", new Object[0]), this.width / 2 - 150, i + j++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, I18n.format("advMode.allEntities", new Object[0]), this.width / 2 - 150, i + j++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, "", this.width / 2 - 150, i + j++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + + if (this.previousOutputTextField.getText().length() > 0) + { + i = i + j * this.fontRendererObj.FONT_HEIGHT + 16; + this.drawString(this.fontRendererObj, I18n.format("advMode.previousOutput", new Object[0]), this.width / 2 - 150, i, 10526880); + this.previousOutputTextField.drawTextBox(); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + private void func_175388_a() + { + if (this.localCommandBlock.shouldTrackOutput()) + { + this.field_175390_s.displayString = "O"; + + if (this.localCommandBlock.getLastOutput() != null) + { + this.previousOutputTextField.setText(this.localCommandBlock.getLastOutput().getUnformattedText()); + } + } + else + { + this.field_175390_s.displayString = "X"; + this.previousOutputTextField.setText("-"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java new file mode 100644 index 0000000..970a4ca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java @@ -0,0 +1,61 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; + +public class GuiConfirmOpenLink extends GuiYesNo +{ + private final String openLinkWarning; + private final String copyLinkButtonText; + private final String linkText; + private boolean showSecurityWarning = true; + + public GuiConfirmOpenLink(GuiYesNoCallback p_i1084_1_, String linkTextIn, int p_i1084_3_, boolean p_i1084_4_) + { + super(p_i1084_1_, I18n.format(p_i1084_4_ ? "chat.link.confirmTrusted" : "chat.link.confirm", new Object[0]), linkTextIn, p_i1084_3_); + this.confirmButtonText = I18n.format(p_i1084_4_ ? "chat.link.open" : "gui.yes", new Object[0]); + this.cancelButtonText = I18n.format(p_i1084_4_ ? "gui.cancel" : "gui.no", new Object[0]); + this.copyLinkButtonText = I18n.format("chat.copy", new Object[0]); + this.openLinkWarning = I18n.format("chat.link.warning", new Object[0]); + this.linkText = linkTextIn; + } + + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 50 - 105, this.height / 6 + 96, 100, 20, this.confirmButtonText)); + this.buttonList.add(new GuiButton(2, this.width / 2 - 50, this.height / 6 + 96, 100, 20, this.copyLinkButtonText)); + this.buttonList.add(new GuiButton(1, this.width / 2 - 50 + 105, this.height / 6 + 96, 100, 20, this.cancelButtonText)); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 2) + { + this.copyLinkToClipboard(); + } + + this.parentScreen.confirmClicked(button.id == 0, this.parentButtonClickedId); + } + + public void copyLinkToClipboard() + { + setClipboardString(this.linkText); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + + if (this.showSecurityWarning) + { + this.drawCenteredString(this.fontRendererObj, this.openLinkWarning, this.width / 2, 110, 16764108); + } + } + + public void disableSecurityWarning() + { + this.showSecurityWarning = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiControls.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiControls.java new file mode 100644 index 0000000..1647581 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiControls.java @@ -0,0 +1,145 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; + +public class GuiControls extends GuiScreen +{ + private static final GameSettings.Options[] optionsArr = new GameSettings.Options[] {GameSettings.Options.INVERT_MOUSE, GameSettings.Options.SENSITIVITY, GameSettings.Options.TOUCHSCREEN}; + private GuiScreen parentScreen; + protected String screenTitle = "Controls"; + private GameSettings options; + public KeyBinding buttonId = null; + public long time; + private GuiKeyBindingList keyBindingList; + private GuiButton buttonReset; + + public GuiControls(GuiScreen screen, GameSettings settings) + { + this.parentScreen = screen; + this.options = settings; + } + + public void initGui() + { + this.keyBindingList = new GuiKeyBindingList(this, this.mc); + this.buttonList.add(new GuiButton(200, this.width / 2 - 155, this.height - 29, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(this.buttonReset = new GuiButton(201, this.width / 2 - 155 + 160, this.height - 29, 150, 20, I18n.format("controls.resetAll", new Object[0]))); + this.screenTitle = I18n.format("controls.title", new Object[0]); + int i = 0; + + for (GameSettings.Options gamesettings$options : optionsArr) + { + if (gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), gamesettings$options)); + } + else + { + this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), gamesettings$options, this.options.getKeyBinding(gamesettings$options))); + } + + ++i; + } + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.keyBindingList.handleMouseInput(); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 200) + { + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 201) + { + for (KeyBinding keybinding : this.mc.gameSettings.keyBindings) + { + keybinding.setKeyCode(keybinding.getKeyCodeDefault()); + } + + KeyBinding.resetKeyBindingArrayAndHash(); + } + else if (button.id < 100 && button instanceof GuiOptionButton) + { + this.options.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); + button.displayString = this.options.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + if (this.buttonId != null) + { + this.options.setOptionKeyBinding(this.buttonId, -100 + mouseButton); + this.buttonId = null; + KeyBinding.resetKeyBindingArrayAndHash(); + } + else if (mouseButton != 0 || !this.keyBindingList.mouseClicked(mouseX, mouseY, mouseButton)) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + } + } + + protected void mouseReleased(int mouseX, int mouseY, int state) + { + if (state != 0 || !this.keyBindingList.mouseReleased(mouseX, mouseY, state)) + { + super.mouseReleased(mouseX, mouseY, state); + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (this.buttonId != null) + { + if (keyCode == 1) + { + this.options.setOptionKeyBinding(this.buttonId, 0); + } + else if (keyCode != 0) + { + this.options.setOptionKeyBinding(this.buttonId, keyCode); + } + else if (typedChar > 0) + { + this.options.setOptionKeyBinding(this.buttonId, typedChar + 256); + } + + this.buttonId = null; + this.time = Minecraft.getSystemTime(); + KeyBinding.resetKeyBindingArrayAndHash(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.keyBindingList.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 8, 16777215); + boolean flag = true; + + for (KeyBinding keybinding : this.options.keyBindings) + { + if (keybinding.getKeyCode() != keybinding.getKeyCodeDefault()) + { + flag = false; + break; + } + } + + this.buttonReset.enabled = !flag; + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java new file mode 100644 index 0000000..e683069 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java @@ -0,0 +1,245 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; + +public class GuiCreateFlatWorld extends GuiScreen +{ + private final GuiCreateWorld createWorldGui; + private FlatGeneratorInfo theFlatGeneratorInfo = FlatGeneratorInfo.getDefaultFlatGenerator(); + private String flatWorldTitle; + private String field_146394_i; + private String field_146391_r; + private GuiCreateFlatWorld.Details createFlatWorldListSlotGui; + private GuiButton field_146389_t; + private GuiButton field_146388_u; + private GuiButton field_146386_v; + + public GuiCreateFlatWorld(GuiCreateWorld createWorldGuiIn, String p_i1029_2_) + { + this.createWorldGui = createWorldGuiIn; + this.func_146383_a(p_i1029_2_); + } + + public String func_146384_e() + { + return this.theFlatGeneratorInfo.toString(); + } + + public void func_146383_a(String p_146383_1_) + { + this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(p_146383_1_); + } + + public void initGui() + { + this.buttonList.clear(); + this.flatWorldTitle = I18n.format("createWorld.customize.flat.title", new Object[0]); + this.field_146394_i = I18n.format("createWorld.customize.flat.tile", new Object[0]); + this.field_146391_r = I18n.format("createWorld.customize.flat.height", new Object[0]); + this.createFlatWorldListSlotGui = new GuiCreateFlatWorld.Details(); + this.buttonList.add(this.field_146389_t = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.format("createWorld.customize.flat.addLayer", new Object[0]) + " (NYI)")); + this.buttonList.add(this.field_146388_u = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.format("createWorld.customize.flat.editLayer", new Object[0]) + " (NYI)")); + this.buttonList.add(this.field_146386_v = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.format("createWorld.customize.flat.removeLayer", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.format("createWorld.customize.presets", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.field_146389_t.visible = this.field_146388_u.visible = false; + this.theFlatGeneratorInfo.func_82645_d(); + this.func_146375_g(); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.createFlatWorldListSlotGui.handleMouseInput(); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + int i = this.theFlatGeneratorInfo.getFlatLayers().size() - this.createFlatWorldListSlotGui.field_148228_k - 1; + + if (button.id == 1) + { + this.mc.displayGuiScreen(this.createWorldGui); + } + else if (button.id == 0) + { + this.createWorldGui.chunkProviderSettingsJson = this.func_146384_e(); + this.mc.displayGuiScreen(this.createWorldGui); + } + else if (button.id == 5) + { + this.mc.displayGuiScreen(new GuiFlatPresets(this)); + } + else if (button.id == 4 && this.func_146382_i()) + { + this.theFlatGeneratorInfo.getFlatLayers().remove(i); + this.createFlatWorldListSlotGui.field_148228_k = Math.min(this.createFlatWorldListSlotGui.field_148228_k, this.theFlatGeneratorInfo.getFlatLayers().size() - 1); + } + + this.theFlatGeneratorInfo.func_82645_d(); + this.func_146375_g(); + } + + public void func_146375_g() + { + boolean flag = this.func_146382_i(); + this.field_146386_v.enabled = flag; + this.field_146388_u.enabled = flag; + this.field_146388_u.enabled = false; + this.field_146389_t.enabled = false; + } + + private boolean func_146382_i() + { + return this.createFlatWorldListSlotGui.field_148228_k > -1 && this.createFlatWorldListSlotGui.field_148228_k < this.theFlatGeneratorInfo.getFlatLayers().size(); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.createFlatWorldListSlotGui.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.flatWorldTitle, this.width / 2, 8, 16777215); + int i = this.width / 2 - 92 - 16; + this.drawString(this.fontRendererObj, this.field_146394_i, i, 32, 16777215); + this.drawString(this.fontRendererObj, this.field_146391_r, i + 2 + 213 - this.fontRendererObj.getStringWidth(this.field_146391_r), 32, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + class Details extends GuiSlot + { + public int field_148228_k = -1; + + public Details() + { + super(GuiCreateFlatWorld.this.mc, GuiCreateFlatWorld.this.width, GuiCreateFlatWorld.this.height, 43, GuiCreateFlatWorld.this.height - 60, 24); + } + + private void func_148225_a(int p_148225_1_, int p_148225_2_, ItemStack p_148225_3_) + { + this.func_148226_e(p_148225_1_ + 1, p_148225_2_ + 1); + GlStateManager.enableRescaleNormal(); + + if (p_148225_3_ != null && p_148225_3_.getItem() != null) + { + RenderHelper.enableGUIStandardItemLighting(); + GuiCreateFlatWorld.this.itemRender.renderItemIntoGUI(p_148225_3_, p_148225_1_ + 2, p_148225_2_ + 2); + RenderHelper.disableStandardItemLighting(); + } + + GlStateManager.disableRescaleNormal(); + } + + private void func_148226_e(int p_148226_1_, int p_148226_2_) + { + this.func_148224_c(p_148226_1_, p_148226_2_, 0, 0); + } + + private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + int i = 18; + int j = 18; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex(); + tessellator.draw(); + } + + protected int getSize() + { + return GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + this.field_148228_k = slotIndex; + GuiCreateFlatWorld.this.func_146375_g(); + } + + protected boolean isSelected(int slotIndex) + { + return slotIndex == this.field_148228_k; + } + + protected void drawBackground() + { + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + FlatLayerInfo flatlayerinfo = (FlatLayerInfo)GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().get(GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - entryID - 1); + IBlockState iblockstate = flatlayerinfo.getLayerMaterial(); + Block block = iblockstate.getBlock(); + Item item = Item.getItemFromBlock(block); + ItemStack itemstack = block != Blocks.air && item != null ? new ItemStack(item, 1, block.getMetaFromState(iblockstate)) : null; + String s = itemstack == null ? "Air" : item.getItemStackDisplayName(itemstack); + + if (item == null) + { + if (block != Blocks.water && block != Blocks.flowing_water) + { + if (block == Blocks.lava || block == Blocks.flowing_lava) + { + item = Items.lava_bucket; + } + } + else + { + item = Items.water_bucket; + } + + if (item != null) + { + itemstack = new ItemStack(item, 1, block.getMetaFromState(iblockstate)); + s = block.getLocalizedName(); + } + } + + this.func_148225_a(p_180791_2_, p_180791_3_, itemstack); + GuiCreateFlatWorld.this.fontRendererObj.drawString(s, p_180791_2_ + 18 + 5, p_180791_3_ + 3, 16777215); + String s1; + + if (entryID == 0) + { + s1 = I18n.format("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())}); + } + else if (entryID == GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - 1) + { + s1 = I18n.format("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())}); + } + else + { + s1 = I18n.format("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())}); + } + + GuiCreateFlatWorld.this.fontRendererObj.drawString(s1, p_180791_2_ + 2 + 213 - GuiCreateFlatWorld.this.fontRendererObj.getStringWidth(s1), p_180791_3_ + 3, 16777215); + } + + protected int getScrollBarX() + { + return this.width - 70; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java new file mode 100644 index 0000000..388b85a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java @@ -0,0 +1,483 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import java.util.Random; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.StringUtils; +import org.lwjgl.input.Keyboard; + +public class GuiCreateWorld extends GuiScreen +{ + private GuiScreen parentScreen; + private GuiTextField worldNameField; + private GuiTextField worldSeedField; + private String saveDirName; + private String gameMode = "survival"; + private String savedGameMode; + private boolean generateStructuresEnabled = true; + private boolean allowCheats; + private boolean allowCheatsWasSetByUser; + private boolean bonusChestEnabled; + private boolean hardCoreMode; + private boolean alreadyGenerated; + private boolean inMoreWorldOptionsDisplay; + private GuiButton btnGameMode; + private GuiButton btnMoreOptions; + private GuiButton btnMapFeatures; + private GuiButton btnBonusItems; + private GuiButton btnMapType; + private GuiButton btnAllowCommands; + private GuiButton btnCustomizeType; + private String gameModeDesc1; + private String gameModeDesc2; + private String worldSeed; + private String worldName; + private int selectedIndex; + public String chunkProviderSettingsJson = ""; + private static final String[] disallowedFilenames = new String[] {"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; + + public GuiCreateWorld(GuiScreen p_i46320_1_) + { + this.parentScreen = p_i46320_1_; + this.worldSeed = ""; + this.worldName = I18n.format("selectWorld.newWorld", new Object[0]); + } + + public void updateScreen() + { + this.worldNameField.updateCursorCounter(); + this.worldSeedField.updateCursorCounter(); + } + + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("selectWorld.create", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.btnGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.format("selectWorld.gameMode", new Object[0]))); + this.buttonList.add(this.btnMoreOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.format("selectWorld.moreWorldOptions", new Object[0]))); + this.buttonList.add(this.btnMapFeatures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.format("selectWorld.mapFeatures", new Object[0]))); + this.btnMapFeatures.visible = false; + this.buttonList.add(this.btnBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.format("selectWorld.bonusItems", new Object[0]))); + this.btnBonusItems.visible = false; + this.buttonList.add(this.btnMapType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.format("selectWorld.mapType", new Object[0]))); + this.btnMapType.visible = false; + this.buttonList.add(this.btnAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.format("selectWorld.allowCommands", new Object[0]))); + this.btnAllowCommands.visible = false; + this.buttonList.add(this.btnCustomizeType = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.format("selectWorld.customizeType", new Object[0]))); + this.btnCustomizeType.visible = false; + this.worldNameField = new GuiTextField(9, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.worldNameField.setFocused(true); + this.worldNameField.setText(this.worldName); + this.worldSeedField = new GuiTextField(10, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.worldSeedField.setText(this.worldSeed); + this.showMoreWorldOptions(this.inMoreWorldOptionsDisplay); + this.calcSaveDirName(); + this.updateDisplayState(); + } + + private void calcSaveDirName() + { + this.saveDirName = this.worldNameField.getText().trim(); + + for (char c0 : ChatAllowedCharacters.allowedCharactersArray) + { + this.saveDirName = this.saveDirName.replace(c0, '_'); + } + + if (StringUtils.isEmpty(this.saveDirName)) + { + this.saveDirName = "World"; + } + + this.saveDirName = getUncollidingSaveDirName(this.mc.getSaveLoader(), this.saveDirName); + } + + private void updateDisplayState() + { + this.btnGameMode.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + ": " + I18n.format("selectWorld.gameMode." + this.gameMode, new Object[0]); + this.gameModeDesc1 = I18n.format("selectWorld.gameMode." + this.gameMode + ".line1", new Object[0]); + this.gameModeDesc2 = I18n.format("selectWorld.gameMode." + this.gameMode + ".line2", new Object[0]); + this.btnMapFeatures.displayString = I18n.format("selectWorld.mapFeatures", new Object[0]) + " "; + + if (this.generateStructuresEnabled) + { + this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.btnMapFeatures.displayString = this.btnMapFeatures.displayString + I18n.format("options.off", new Object[0]); + } + + this.btnBonusItems.displayString = I18n.format("selectWorld.bonusItems", new Object[0]) + " "; + + if (this.bonusChestEnabled && !this.hardCoreMode) + { + this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.btnBonusItems.displayString = this.btnBonusItems.displayString + I18n.format("options.off", new Object[0]); + } + + this.btnMapType.displayString = I18n.format("selectWorld.mapType", new Object[0]) + " " + I18n.format(WorldType.worldTypes[this.selectedIndex].getTranslateName(), new Object[0]); + this.btnAllowCommands.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " "; + + if (this.allowCheats && !this.hardCoreMode) + { + this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.btnAllowCommands.displayString = this.btnAllowCommands.displayString + I18n.format("options.off", new Object[0]); + } + } + + public static String getUncollidingSaveDirName(ISaveFormat saveLoader, String name) + { + name = name.replaceAll("[\\./\"]", "_"); + + for (String s : disallowedFilenames) + { + if (name.equalsIgnoreCase(s)) + { + name = "_" + name + "_"; + } + } + + while (saveLoader.getWorldInfo(name) != null) + { + name = name + "-"; + } + + return name; + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 0) + { + this.mc.displayGuiScreen((GuiScreen)null); + + if (this.alreadyGenerated) + { + return; + } + + this.alreadyGenerated = true; + long i = (new Random()).nextLong(); + String s = this.worldSeedField.getText(); + + if (!StringUtils.isEmpty(s)) + { + try + { + long j = Long.parseLong(s); + + if (j != 0L) + { + i = j; + } + } + catch (NumberFormatException var7) + { + i = (long)s.hashCode(); + } + } + + WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.getByName(this.gameMode); + WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.generateStructuresEnabled, this.hardCoreMode, WorldType.worldTypes[this.selectedIndex]); + worldsettings.setWorldName(this.chunkProviderSettingsJson); + + if (this.bonusChestEnabled && !this.hardCoreMode) + { + worldsettings.enableBonusChest(); + } + + if (this.allowCheats && !this.hardCoreMode) + { + worldsettings.enableCommands(); + } + + this.mc.launchIntegratedServer(this.saveDirName, this.worldNameField.getText().trim(), worldsettings); + } + else if (button.id == 3) + { + this.toggleMoreWorldOptions(); + } + else if (button.id == 2) + { + if (this.gameMode.equals("survival")) + { + if (!this.allowCheatsWasSetByUser) + { + this.allowCheats = false; + } + + this.hardCoreMode = false; + this.gameMode = "hardcore"; + this.hardCoreMode = true; + this.btnAllowCommands.enabled = false; + this.btnBonusItems.enabled = false; + this.updateDisplayState(); + } + else if (this.gameMode.equals("hardcore")) + { + if (!this.allowCheatsWasSetByUser) + { + this.allowCheats = true; + } + + this.hardCoreMode = false; + this.gameMode = "creative"; + this.updateDisplayState(); + this.hardCoreMode = false; + this.btnAllowCommands.enabled = true; + this.btnBonusItems.enabled = true; + } + else + { + if (!this.allowCheatsWasSetByUser) + { + this.allowCheats = false; + } + + this.gameMode = "survival"; + this.updateDisplayState(); + this.btnAllowCommands.enabled = true; + this.btnBonusItems.enabled = true; + this.hardCoreMode = false; + } + + this.updateDisplayState(); + } + else if (button.id == 4) + { + this.generateStructuresEnabled = !this.generateStructuresEnabled; + this.updateDisplayState(); + } + else if (button.id == 7) + { + this.bonusChestEnabled = !this.bonusChestEnabled; + this.updateDisplayState(); + } + else if (button.id == 5) + { + ++this.selectedIndex; + + if (this.selectedIndex >= WorldType.worldTypes.length) + { + this.selectedIndex = 0; + } + + while (!this.canSelectCurWorldType()) + { + ++this.selectedIndex; + + if (this.selectedIndex >= WorldType.worldTypes.length) + { + this.selectedIndex = 0; + } + } + + this.chunkProviderSettingsJson = ""; + this.updateDisplayState(); + this.showMoreWorldOptions(this.inMoreWorldOptionsDisplay); + } + else if (button.id == 6) + { + this.allowCheatsWasSetByUser = true; + this.allowCheats = !this.allowCheats; + this.updateDisplayState(); + } + else if (button.id == 8) + { + if (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT) + { + this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.chunkProviderSettingsJson)); + } + else + { + this.mc.displayGuiScreen(new GuiCustomizeWorldScreen(this, this.chunkProviderSettingsJson)); + } + } + } + } + + private boolean canSelectCurWorldType() + { + WorldType worldtype = WorldType.worldTypes[this.selectedIndex]; + return worldtype != null && worldtype.getCanBeCreated() ? (worldtype == WorldType.DEBUG_WORLD ? isShiftKeyDown() : true) : false; + } + + private void toggleMoreWorldOptions() + { + this.showMoreWorldOptions(!this.inMoreWorldOptionsDisplay); + } + + private void showMoreWorldOptions(boolean toggle) + { + this.inMoreWorldOptionsDisplay = toggle; + + if (WorldType.worldTypes[this.selectedIndex] == WorldType.DEBUG_WORLD) + { + this.btnGameMode.visible = !this.inMoreWorldOptionsDisplay; + this.btnGameMode.enabled = false; + + if (this.savedGameMode == null) + { + this.savedGameMode = this.gameMode; + } + + this.gameMode = "spectator"; + this.btnMapFeatures.visible = false; + this.btnBonusItems.visible = false; + this.btnMapType.visible = this.inMoreWorldOptionsDisplay; + this.btnAllowCommands.visible = false; + this.btnCustomizeType.visible = false; + } + else + { + this.btnGameMode.visible = !this.inMoreWorldOptionsDisplay; + this.btnGameMode.enabled = true; + + if (this.savedGameMode != null) + { + this.gameMode = this.savedGameMode; + this.savedGameMode = null; + } + + this.btnMapFeatures.visible = this.inMoreWorldOptionsDisplay && WorldType.worldTypes[this.selectedIndex] != WorldType.CUSTOMIZED; + this.btnBonusItems.visible = this.inMoreWorldOptionsDisplay; + this.btnMapType.visible = this.inMoreWorldOptionsDisplay; + this.btnAllowCommands.visible = this.inMoreWorldOptionsDisplay; + this.btnCustomizeType.visible = this.inMoreWorldOptionsDisplay && (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT || WorldType.worldTypes[this.selectedIndex] == WorldType.CUSTOMIZED); + } + + this.updateDisplayState(); + + if (this.inMoreWorldOptionsDisplay) + { + this.btnMoreOptions.displayString = I18n.format("gui.done", new Object[0]); + } + else + { + this.btnMoreOptions.displayString = I18n.format("selectWorld.moreWorldOptions", new Object[0]); + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (this.worldNameField.isFocused() && !this.inMoreWorldOptionsDisplay) + { + this.worldNameField.textboxKeyTyped(typedChar, keyCode); + this.worldName = this.worldNameField.getText(); + } + else if (this.worldSeedField.isFocused() && this.inMoreWorldOptionsDisplay) + { + this.worldSeedField.textboxKeyTyped(typedChar, keyCode); + this.worldSeed = this.worldSeedField.getText(); + } + + if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + + ((GuiButton)this.buttonList.get(0)).enabled = this.worldNameField.getText().length() > 0; + this.calcSaveDirName(); + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + + if (this.inMoreWorldOptionsDisplay) + { + this.worldSeedField.mouseClicked(mouseX, mouseY, mouseButton); + } + else + { + this.worldNameField.mouseClicked(mouseX, mouseY, mouseButton); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.create", new Object[0]), this.width / 2, 20, -1); + + if (this.inMoreWorldOptionsDisplay) + { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterSeed", new Object[0]), this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.seedInfo", new Object[0]), this.width / 2 - 100, 85, -6250336); + + if (this.btnMapFeatures.visible) + { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.mapFeatures.info", new Object[0]), this.width / 2 - 150, 122, -6250336); + } + + if (this.btnAllowCommands.visible) + { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.allowCommands.info", new Object[0]), this.width / 2 - 150, 172, -6250336); + } + + this.worldSeedField.drawTextBox(); + + if (WorldType.worldTypes[this.selectedIndex].showWorldInfoNotice()) + { + this.fontRendererObj.drawSplitString(I18n.format(WorldType.worldTypes[this.selectedIndex].getTranslatedInfo(), new Object[0]), this.btnMapType.xPosition + 2, this.btnMapType.yPosition + 22, this.btnMapType.getButtonWidth(), 10526880); + } + } + else + { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.resultFolder", new Object[0]) + " " + this.saveDirName, this.width / 2 - 100, 85, -6250336); + this.worldNameField.drawTextBox(); + this.drawString(this.fontRendererObj, this.gameModeDesc1, this.width / 2 - 100, 137, -6250336); + this.drawString(this.fontRendererObj, this.gameModeDesc2, this.width / 2 - 100, 149, -6250336); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void recreateFromExistingWorld(WorldInfo original) + { + this.worldName = I18n.format("selectWorld.newWorld.copyOf", new Object[] {original.getWorldName()}); + this.worldSeed = original.getSeed() + ""; + this.selectedIndex = original.getTerrainType().getWorldTypeID(); + this.chunkProviderSettingsJson = original.getGeneratorOptions(); + this.generateStructuresEnabled = original.isMapFeaturesEnabled(); + this.allowCheats = original.areCommandsAllowed(); + + if (original.isHardcoreModeEnabled()) + { + this.gameMode = "hardcore"; + } + else if (original.getGameType().isSurvivalOrAdventure()) + { + this.gameMode = "survival"; + } + else if (original.getGameType().isCreative()) + { + this.gameMode = "creative"; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCustomizeSkin.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCustomizeSkin.java new file mode 100644 index 0000000..5ff2eca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCustomizeSkin.java @@ -0,0 +1,96 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.optifine.gui.GuiButtonOF; +import net.optifine.gui.GuiScreenCapeOF; + +public class GuiCustomizeSkin extends GuiScreen +{ + private final GuiScreen parentScreen; + private String title; + + public GuiCustomizeSkin(GuiScreen parentScreenIn) + { + this.parentScreen = parentScreenIn; + } + + public void initGui() + { + int i = 0; + this.title = I18n.format("options.skinCustomisation.title", new Object[0]); + + for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) + { + this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, enumplayermodelparts)); + ++i; + } + + if (i % 2 == 1) + { + ++i; + } + + this.buttonList.add(new GuiButtonOF(210, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("of.options.skinCustomisation.ofCape", new Object[0]))); + i = i + 2; + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 210) + { + this.mc.displayGuiScreen(new GuiScreenCapeOF(this)); + } + + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button instanceof GuiCustomizeSkin.ButtonPart) + { + EnumPlayerModelParts enumplayermodelparts = ((GuiCustomizeSkin.ButtonPart)button).playerModelParts; + this.mc.gameSettings.switchModelPartEnabled(enumplayermodelparts); + button.displayString = this.func_175358_a(enumplayermodelparts); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + private String func_175358_a(EnumPlayerModelParts playerModelParts) + { + String s; + + if (this.mc.gameSettings.getModelParts().contains(playerModelParts)) + { + s = I18n.format("options.on", new Object[0]); + } + else + { + s = I18n.format("options.off", new Object[0]); + } + + return playerModelParts.func_179326_d().getFormattedText() + ": " + s; + } + + class ButtonPart extends GuiButton + { + private final EnumPlayerModelParts playerModelParts; + + private ButtonPart(int p_i45514_2_, int p_i45514_3_, int p_i45514_4_, int p_i45514_5_, int p_i45514_6_, EnumPlayerModelParts playerModelParts) + { + super(p_i45514_2_, p_i45514_3_, p_i45514_4_, p_i45514_5_, p_i45514_6_, GuiCustomizeSkin.this.func_175358_a(playerModelParts)); + this.playerModelParts = playerModelParts; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java new file mode 100644 index 0000000..f0754a5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiCustomizeWorldScreen.java @@ -0,0 +1,980 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Predicate; +import com.google.common.primitives.Floats; +import java.io.IOException; +import java.util.Random; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.MathHelper; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.ChunkProviderSettings; + +public class GuiCustomizeWorldScreen extends GuiScreen implements GuiSlider.FormatHelper, GuiPageButtonList.GuiResponder +{ + private GuiCreateWorld field_175343_i; + protected String field_175341_a = "Customize World Settings"; + protected String field_175333_f = "Page 1 of 3"; + protected String field_175335_g = "Basic Settings"; + protected String[] field_175342_h = new String[4]; + private GuiPageButtonList field_175349_r; + private GuiButton field_175348_s; + private GuiButton field_175347_t; + private GuiButton field_175346_u; + private GuiButton field_175345_v; + private GuiButton field_175344_w; + private GuiButton field_175352_x; + private GuiButton field_175351_y; + private GuiButton field_175350_z; + private boolean field_175338_A = false; + private int field_175339_B = 0; + private boolean field_175340_C = false; + private Predicate field_175332_D = new Predicate() + { + public boolean apply(String p_apply_1_) + { + Float f = Floats.tryParse(p_apply_1_); + return p_apply_1_.length() == 0 || f != null && Floats.isFinite(f.floatValue()) && f.floatValue() >= 0.0F; + } + }; + private ChunkProviderSettings.Factory field_175334_E = new ChunkProviderSettings.Factory(); + private ChunkProviderSettings.Factory field_175336_F; + private Random random = new Random(); + + public GuiCustomizeWorldScreen(GuiScreen p_i45521_1_, String p_i45521_2_) + { + this.field_175343_i = (GuiCreateWorld)p_i45521_1_; + this.func_175324_a(p_i45521_2_); + } + + public void initGui() + { + int i = 0; + int j = 0; + + if (this.field_175349_r != null) + { + i = this.field_175349_r.func_178059_e(); + j = this.field_175349_r.getAmountScrolled(); + } + + this.field_175341_a = I18n.format("options.customizeTitle", new Object[0]); + this.buttonList.clear(); + this.buttonList.add(this.field_175345_v = new GuiButton(302, 20, 5, 80, 20, I18n.format("createWorld.customize.custom.prev", new Object[0]))); + this.buttonList.add(this.field_175344_w = new GuiButton(303, this.width - 100, 5, 80, 20, I18n.format("createWorld.customize.custom.next", new Object[0]))); + this.buttonList.add(this.field_175346_u = new GuiButton(304, this.width / 2 - 187, this.height - 27, 90, 20, I18n.format("createWorld.customize.custom.defaults", new Object[0]))); + this.buttonList.add(this.field_175347_t = new GuiButton(301, this.width / 2 - 92, this.height - 27, 90, 20, I18n.format("createWorld.customize.custom.randomize", new Object[0]))); + this.buttonList.add(this.field_175350_z = new GuiButton(305, this.width / 2 + 3, this.height - 27, 90, 20, I18n.format("createWorld.customize.custom.presets", new Object[0]))); + this.buttonList.add(this.field_175348_s = new GuiButton(300, this.width / 2 + 98, this.height - 27, 90, 20, I18n.format("gui.done", new Object[0]))); + this.field_175346_u.enabled = this.field_175338_A; + this.field_175352_x = new GuiButton(306, this.width / 2 - 55, 160, 50, 20, I18n.format("gui.yes", new Object[0])); + this.field_175352_x.visible = false; + this.buttonList.add(this.field_175352_x); + this.field_175351_y = new GuiButton(307, this.width / 2 + 5, 160, 50, 20, I18n.format("gui.no", new Object[0])); + this.field_175351_y.visible = false; + this.buttonList.add(this.field_175351_y); + + if (this.field_175339_B != 0) + { + this.field_175352_x.visible = true; + this.field_175351_y.visible = true; + } + + this.func_175325_f(); + + if (i != 0) + { + this.field_175349_r.func_181156_c(i); + this.field_175349_r.scrollBy(j); + this.func_175328_i(); + } + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.field_175349_r.handleMouseInput(); + } + + private void func_175325_f() + { + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiSlideEntry(160, I18n.format("createWorld.customize.custom.seaLevel", new Object[0]), true, this, 1.0F, 255.0F, (float)this.field_175336_F.seaLevel), new GuiPageButtonList.GuiButtonEntry(148, I18n.format("createWorld.customize.custom.useCaves", new Object[0]), true, this.field_175336_F.useCaves), new GuiPageButtonList.GuiButtonEntry(150, I18n.format("createWorld.customize.custom.useStrongholds", new Object[0]), true, this.field_175336_F.useStrongholds), new GuiPageButtonList.GuiButtonEntry(151, I18n.format("createWorld.customize.custom.useVillages", new Object[0]), true, this.field_175336_F.useVillages), new GuiPageButtonList.GuiButtonEntry(152, I18n.format("createWorld.customize.custom.useMineShafts", new Object[0]), true, this.field_175336_F.useMineShafts), new GuiPageButtonList.GuiButtonEntry(153, I18n.format("createWorld.customize.custom.useTemples", new Object[0]), true, this.field_175336_F.useTemples), new GuiPageButtonList.GuiButtonEntry(210, I18n.format("createWorld.customize.custom.useMonuments", new Object[0]), true, this.field_175336_F.useMonuments), new GuiPageButtonList.GuiButtonEntry(154, I18n.format("createWorld.customize.custom.useRavines", new Object[0]), true, this.field_175336_F.useRavines), new GuiPageButtonList.GuiButtonEntry(149, I18n.format("createWorld.customize.custom.useDungeons", new Object[0]), true, this.field_175336_F.useDungeons), new GuiPageButtonList.GuiSlideEntry(157, I18n.format("createWorld.customize.custom.dungeonChance", new Object[0]), true, this, 1.0F, 100.0F, (float)this.field_175336_F.dungeonChance), new GuiPageButtonList.GuiButtonEntry(155, I18n.format("createWorld.customize.custom.useWaterLakes", new Object[0]), true, this.field_175336_F.useWaterLakes), new GuiPageButtonList.GuiSlideEntry(158, I18n.format("createWorld.customize.custom.waterLakeChance", new Object[0]), true, this, 1.0F, 100.0F, (float)this.field_175336_F.waterLakeChance), new GuiPageButtonList.GuiButtonEntry(156, I18n.format("createWorld.customize.custom.useLavaLakes", new Object[0]), true, this.field_175336_F.useLavaLakes), new GuiPageButtonList.GuiSlideEntry(159, I18n.format("createWorld.customize.custom.lavaLakeChance", new Object[0]), true, this, 10.0F, 100.0F, (float)this.field_175336_F.lavaLakeChance), new GuiPageButtonList.GuiButtonEntry(161, I18n.format("createWorld.customize.custom.useLavaOceans", new Object[0]), true, this.field_175336_F.useLavaOceans), new GuiPageButtonList.GuiSlideEntry(162, I18n.format("createWorld.customize.custom.fixedBiome", new Object[0]), true, this, -1.0F, 37.0F, (float)this.field_175336_F.fixedBiome), new GuiPageButtonList.GuiSlideEntry(163, I18n.format("createWorld.customize.custom.biomeSize", new Object[0]), true, this, 1.0F, 8.0F, (float)this.field_175336_F.biomeSize), new GuiPageButtonList.GuiSlideEntry(164, I18n.format("createWorld.customize.custom.riverSize", new Object[0]), true, this, 1.0F, 5.0F, (float)this.field_175336_F.riverSize)}; + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry1 = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiLabelEntry(416, I18n.format("tile.dirt.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(165, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.dirtSize), new GuiPageButtonList.GuiSlideEntry(166, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.dirtCount), new GuiPageButtonList.GuiSlideEntry(167, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dirtMinHeight), new GuiPageButtonList.GuiSlideEntry(168, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dirtMaxHeight), new GuiPageButtonList.GuiLabelEntry(417, I18n.format("tile.gravel.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(169, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.gravelSize), new GuiPageButtonList.GuiSlideEntry(170, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.gravelCount), new GuiPageButtonList.GuiSlideEntry(171, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.gravelMinHeight), new GuiPageButtonList.GuiSlideEntry(172, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.gravelMaxHeight), new GuiPageButtonList.GuiLabelEntry(418, I18n.format("tile.stone.granite.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(173, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.graniteSize), new GuiPageButtonList.GuiSlideEntry(174, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.graniteCount), new GuiPageButtonList.GuiSlideEntry(175, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.graniteMinHeight), new GuiPageButtonList.GuiSlideEntry(176, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.graniteMaxHeight), new GuiPageButtonList.GuiLabelEntry(419, I18n.format("tile.stone.diorite.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(177, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.dioriteSize), new GuiPageButtonList.GuiSlideEntry(178, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.dioriteCount), new GuiPageButtonList.GuiSlideEntry(179, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dioriteMinHeight), new GuiPageButtonList.GuiSlideEntry(180, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dioriteMaxHeight), new GuiPageButtonList.GuiLabelEntry(420, I18n.format("tile.stone.andesite.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(181, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.andesiteSize), new GuiPageButtonList.GuiSlideEntry(182, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.andesiteCount), new GuiPageButtonList.GuiSlideEntry(183, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.andesiteMinHeight), new GuiPageButtonList.GuiSlideEntry(184, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.andesiteMaxHeight), new GuiPageButtonList.GuiLabelEntry(421, I18n.format("tile.oreCoal.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(185, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.coalSize), new GuiPageButtonList.GuiSlideEntry(186, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.coalCount), new GuiPageButtonList.GuiSlideEntry(187, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.coalMinHeight), new GuiPageButtonList.GuiSlideEntry(189, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.coalMaxHeight), new GuiPageButtonList.GuiLabelEntry(422, I18n.format("tile.oreIron.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(190, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.ironSize), new GuiPageButtonList.GuiSlideEntry(191, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.ironCount), new GuiPageButtonList.GuiSlideEntry(192, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.ironMinHeight), new GuiPageButtonList.GuiSlideEntry(193, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.ironMaxHeight), new GuiPageButtonList.GuiLabelEntry(423, I18n.format("tile.oreGold.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(194, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.goldSize), new GuiPageButtonList.GuiSlideEntry(195, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.goldCount), new GuiPageButtonList.GuiSlideEntry(196, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.goldMinHeight), new GuiPageButtonList.GuiSlideEntry(197, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.goldMaxHeight), new GuiPageButtonList.GuiLabelEntry(424, I18n.format("tile.oreRedstone.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(198, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.redstoneSize), new GuiPageButtonList.GuiSlideEntry(199, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.redstoneCount), new GuiPageButtonList.GuiSlideEntry(200, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.redstoneMinHeight), new GuiPageButtonList.GuiSlideEntry(201, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.redstoneMaxHeight), new GuiPageButtonList.GuiLabelEntry(425, I18n.format("tile.oreDiamond.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(202, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.diamondSize), new GuiPageButtonList.GuiSlideEntry(203, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.diamondCount), new GuiPageButtonList.GuiSlideEntry(204, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.diamondMinHeight), new GuiPageButtonList.GuiSlideEntry(205, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.diamondMaxHeight), new GuiPageButtonList.GuiLabelEntry(426, I18n.format("tile.oreLapis.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(206, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.lapisSize), new GuiPageButtonList.GuiSlideEntry(207, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.lapisCount), new GuiPageButtonList.GuiSlideEntry(208, I18n.format("createWorld.customize.custom.center", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.lapisCenterHeight), new GuiPageButtonList.GuiSlideEntry(209, I18n.format("createWorld.customize.custom.spread", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.lapisSpread)}; + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry2 = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiSlideEntry(100, I18n.format("createWorld.customize.custom.mainNoiseScaleX", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.mainNoiseScaleX), new GuiPageButtonList.GuiSlideEntry(101, I18n.format("createWorld.customize.custom.mainNoiseScaleY", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.mainNoiseScaleY), new GuiPageButtonList.GuiSlideEntry(102, I18n.format("createWorld.customize.custom.mainNoiseScaleZ", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.mainNoiseScaleZ), new GuiPageButtonList.GuiSlideEntry(103, I18n.format("createWorld.customize.custom.depthNoiseScaleX", new Object[0]), false, this, 1.0F, 2000.0F, this.field_175336_F.depthNoiseScaleX), new GuiPageButtonList.GuiSlideEntry(104, I18n.format("createWorld.customize.custom.depthNoiseScaleZ", new Object[0]), false, this, 1.0F, 2000.0F, this.field_175336_F.depthNoiseScaleZ), new GuiPageButtonList.GuiSlideEntry(105, I18n.format("createWorld.customize.custom.depthNoiseScaleExponent", new Object[0]), false, this, 0.01F, 20.0F, this.field_175336_F.depthNoiseScaleExponent), new GuiPageButtonList.GuiSlideEntry(106, I18n.format("createWorld.customize.custom.baseSize", new Object[0]), false, this, 1.0F, 25.0F, this.field_175336_F.baseSize), new GuiPageButtonList.GuiSlideEntry(107, I18n.format("createWorld.customize.custom.coordinateScale", new Object[0]), false, this, 1.0F, 6000.0F, this.field_175336_F.coordinateScale), new GuiPageButtonList.GuiSlideEntry(108, I18n.format("createWorld.customize.custom.heightScale", new Object[0]), false, this, 1.0F, 6000.0F, this.field_175336_F.heightScale), new GuiPageButtonList.GuiSlideEntry(109, I18n.format("createWorld.customize.custom.stretchY", new Object[0]), false, this, 0.01F, 50.0F, this.field_175336_F.stretchY), new GuiPageButtonList.GuiSlideEntry(110, I18n.format("createWorld.customize.custom.upperLimitScale", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.upperLimitScale), new GuiPageButtonList.GuiSlideEntry(111, I18n.format("createWorld.customize.custom.lowerLimitScale", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.lowerLimitScale), new GuiPageButtonList.GuiSlideEntry(112, I18n.format("createWorld.customize.custom.biomeDepthWeight", new Object[0]), false, this, 1.0F, 20.0F, this.field_175336_F.biomeDepthWeight), new GuiPageButtonList.GuiSlideEntry(113, I18n.format("createWorld.customize.custom.biomeDepthOffset", new Object[0]), false, this, 0.0F, 20.0F, this.field_175336_F.biomeDepthOffset), new GuiPageButtonList.GuiSlideEntry(114, I18n.format("createWorld.customize.custom.biomeScaleWeight", new Object[0]), false, this, 1.0F, 20.0F, this.field_175336_F.biomeScaleWeight), new GuiPageButtonList.GuiSlideEntry(115, I18n.format("createWorld.customize.custom.biomeScaleOffset", new Object[0]), false, this, 0.0F, 20.0F, this.field_175336_F.biomeScaleOffset)}; + GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry3 = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiLabelEntry(400, I18n.format("createWorld.customize.custom.mainNoiseScaleX", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(132, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.mainNoiseScaleX)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(401, I18n.format("createWorld.customize.custom.mainNoiseScaleY", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(133, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.mainNoiseScaleY)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(402, I18n.format("createWorld.customize.custom.mainNoiseScaleZ", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(134, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.mainNoiseScaleZ)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(403, I18n.format("createWorld.customize.custom.depthNoiseScaleX", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(135, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.depthNoiseScaleX)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(404, I18n.format("createWorld.customize.custom.depthNoiseScaleZ", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(136, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.depthNoiseScaleZ)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(405, I18n.format("createWorld.customize.custom.depthNoiseScaleExponent", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(137, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.depthNoiseScaleExponent)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(406, I18n.format("createWorld.customize.custom.baseSize", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(138, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.baseSize)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(407, I18n.format("createWorld.customize.custom.coordinateScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(139, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.coordinateScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(408, I18n.format("createWorld.customize.custom.heightScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(140, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.heightScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(409, I18n.format("createWorld.customize.custom.stretchY", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(141, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.stretchY)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(410, I18n.format("createWorld.customize.custom.upperLimitScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(142, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.upperLimitScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(411, I18n.format("createWorld.customize.custom.lowerLimitScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(143, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.lowerLimitScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(412, I18n.format("createWorld.customize.custom.biomeDepthWeight", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(144, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeDepthWeight)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(413, I18n.format("createWorld.customize.custom.biomeDepthOffset", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(145, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeDepthOffset)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(414, I18n.format("createWorld.customize.custom.biomeScaleWeight", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(146, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeScaleWeight)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(415, I18n.format("createWorld.customize.custom.biomeScaleOffset", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(147, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeScaleOffset)}), false, this.field_175332_D)}; + this.field_175349_r = new GuiPageButtonList(this.mc, this.width, this.height, 32, this.height - 32, 25, this, new GuiPageButtonList.GuiListEntry[][] {aguipagebuttonlist$guilistentry, aguipagebuttonlist$guilistentry1, aguipagebuttonlist$guilistentry2, aguipagebuttonlist$guilistentry3}); + + for (int i = 0; i < 4; ++i) + { + this.field_175342_h[i] = I18n.format("createWorld.customize.custom.page" + i, new Object[0]); + } + + this.func_175328_i(); + } + + public String func_175323_a() + { + return this.field_175336_F.toString().replace("\n", ""); + } + + public void func_175324_a(String p_175324_1_) + { + if (p_175324_1_ != null && p_175324_1_.length() != 0) + { + this.field_175336_F = ChunkProviderSettings.Factory.jsonToFactory(p_175324_1_); + } + else + { + this.field_175336_F = new ChunkProviderSettings.Factory(); + } + } + + public void func_175319_a(int p_175319_1_, String p_175319_2_) + { + float f = 0.0F; + + try + { + f = Float.parseFloat(p_175319_2_); + } + catch (NumberFormatException var5) + { + ; + } + + float f1 = 0.0F; + + switch (p_175319_1_) + { + case 132: + f1 = this.field_175336_F.mainNoiseScaleX = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + + case 133: + f1 = this.field_175336_F.mainNoiseScaleY = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + + case 134: + f1 = this.field_175336_F.mainNoiseScaleZ = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + + case 135: + f1 = this.field_175336_F.depthNoiseScaleX = MathHelper.clamp_float(f, 1.0F, 2000.0F); + break; + + case 136: + f1 = this.field_175336_F.depthNoiseScaleZ = MathHelper.clamp_float(f, 1.0F, 2000.0F); + break; + + case 137: + f1 = this.field_175336_F.depthNoiseScaleExponent = MathHelper.clamp_float(f, 0.01F, 20.0F); + break; + + case 138: + f1 = this.field_175336_F.baseSize = MathHelper.clamp_float(f, 1.0F, 25.0F); + break; + + case 139: + f1 = this.field_175336_F.coordinateScale = MathHelper.clamp_float(f, 1.0F, 6000.0F); + break; + + case 140: + f1 = this.field_175336_F.heightScale = MathHelper.clamp_float(f, 1.0F, 6000.0F); + break; + + case 141: + f1 = this.field_175336_F.stretchY = MathHelper.clamp_float(f, 0.01F, 50.0F); + break; + + case 142: + f1 = this.field_175336_F.upperLimitScale = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + + case 143: + f1 = this.field_175336_F.lowerLimitScale = MathHelper.clamp_float(f, 1.0F, 5000.0F); + break; + + case 144: + f1 = this.field_175336_F.biomeDepthWeight = MathHelper.clamp_float(f, 1.0F, 20.0F); + break; + + case 145: + f1 = this.field_175336_F.biomeDepthOffset = MathHelper.clamp_float(f, 0.0F, 20.0F); + break; + + case 146: + f1 = this.field_175336_F.biomeScaleWeight = MathHelper.clamp_float(f, 1.0F, 20.0F); + break; + + case 147: + f1 = this.field_175336_F.biomeScaleOffset = MathHelper.clamp_float(f, 0.0F, 20.0F); + } + + if (f1 != f && f != 0.0F) + { + ((GuiTextField)this.field_175349_r.func_178061_c(p_175319_1_)).setText(this.func_175330_b(p_175319_1_, f1)); + } + + ((GuiSlider)this.field_175349_r.func_178061_c(p_175319_1_ - 132 + 100)).func_175218_a(f1, false); + + if (!this.field_175336_F.equals(this.field_175334_E)) + { + this.func_181031_a(true); + } + } + + private void func_181031_a(boolean p_181031_1_) + { + this.field_175338_A = p_181031_1_; + this.field_175346_u.enabled = p_181031_1_; + } + + public String getText(int id, String name, float value) + { + return name + ": " + this.func_175330_b(id, value); + } + + private String func_175330_b(int p_175330_1_, float p_175330_2_) + { + switch (p_175330_1_) + { + case 100: + case 101: + case 102: + case 103: + case 104: + case 107: + case 108: + case 110: + case 111: + case 132: + case 133: + case 134: + case 135: + case 136: + case 139: + case 140: + case 142: + case 143: + return String.format("%5.3f", new Object[] {Float.valueOf(p_175330_2_)}); + + case 105: + case 106: + case 109: + case 112: + case 113: + case 114: + case 115: + case 137: + case 138: + case 141: + case 144: + case 145: + case 146: + case 147: + return String.format("%2.3f", new Object[] {Float.valueOf(p_175330_2_)}); + + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + case 127: + case 128: + case 129: + case 130: + case 131: + case 148: + case 149: + case 150: + case 151: + case 152: + case 153: + case 154: + case 155: + case 156: + case 157: + case 158: + case 159: + case 160: + case 161: + default: + return String.format("%d", new Object[] {Integer.valueOf((int)p_175330_2_)}); + + case 162: + if (p_175330_2_ < 0.0F) + { + return I18n.format("gui.all", new Object[0]); + } + else if ((int)p_175330_2_ >= BiomeGenBase.hell.biomeID) + { + BiomeGenBase biomegenbase1 = BiomeGenBase.getBiomeGenArray()[(int)p_175330_2_ + 2]; + return biomegenbase1 != null ? biomegenbase1.biomeName : "?"; + } + else + { + BiomeGenBase biomegenbase = BiomeGenBase.getBiomeGenArray()[(int)p_175330_2_]; + return biomegenbase != null ? biomegenbase.biomeName : "?"; + } + } + } + + public void func_175321_a(int p_175321_1_, boolean p_175321_2_) + { + switch (p_175321_1_) + { + case 148: + this.field_175336_F.useCaves = p_175321_2_; + break; + + case 149: + this.field_175336_F.useDungeons = p_175321_2_; + break; + + case 150: + this.field_175336_F.useStrongholds = p_175321_2_; + break; + + case 151: + this.field_175336_F.useVillages = p_175321_2_; + break; + + case 152: + this.field_175336_F.useMineShafts = p_175321_2_; + break; + + case 153: + this.field_175336_F.useTemples = p_175321_2_; + break; + + case 154: + this.field_175336_F.useRavines = p_175321_2_; + break; + + case 155: + this.field_175336_F.useWaterLakes = p_175321_2_; + break; + + case 156: + this.field_175336_F.useLavaLakes = p_175321_2_; + break; + + case 161: + this.field_175336_F.useLavaOceans = p_175321_2_; + break; + + case 210: + this.field_175336_F.useMonuments = p_175321_2_; + } + + if (!this.field_175336_F.equals(this.field_175334_E)) + { + this.func_181031_a(true); + } + } + + public void onTick(int id, float value) + { + switch (id) + { + case 100: + this.field_175336_F.mainNoiseScaleX = value; + break; + + case 101: + this.field_175336_F.mainNoiseScaleY = value; + break; + + case 102: + this.field_175336_F.mainNoiseScaleZ = value; + break; + + case 103: + this.field_175336_F.depthNoiseScaleX = value; + break; + + case 104: + this.field_175336_F.depthNoiseScaleZ = value; + break; + + case 105: + this.field_175336_F.depthNoiseScaleExponent = value; + break; + + case 106: + this.field_175336_F.baseSize = value; + break; + + case 107: + this.field_175336_F.coordinateScale = value; + break; + + case 108: + this.field_175336_F.heightScale = value; + break; + + case 109: + this.field_175336_F.stretchY = value; + break; + + case 110: + this.field_175336_F.upperLimitScale = value; + break; + + case 111: + this.field_175336_F.lowerLimitScale = value; + break; + + case 112: + this.field_175336_F.biomeDepthWeight = value; + break; + + case 113: + this.field_175336_F.biomeDepthOffset = value; + break; + + case 114: + this.field_175336_F.biomeScaleWeight = value; + break; + + case 115: + this.field_175336_F.biomeScaleOffset = value; + + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + case 127: + case 128: + case 129: + case 130: + case 131: + case 132: + case 133: + case 134: + case 135: + case 136: + case 137: + case 138: + case 139: + case 140: + case 141: + case 142: + case 143: + case 144: + case 145: + case 146: + case 147: + case 148: + case 149: + case 150: + case 151: + case 152: + case 153: + case 154: + case 155: + case 156: + case 161: + case 188: + default: + break; + + case 157: + this.field_175336_F.dungeonChance = (int)value; + break; + + case 158: + this.field_175336_F.waterLakeChance = (int)value; + break; + + case 159: + this.field_175336_F.lavaLakeChance = (int)value; + break; + + case 160: + this.field_175336_F.seaLevel = (int)value; + break; + + case 162: + this.field_175336_F.fixedBiome = (int)value; + break; + + case 163: + this.field_175336_F.biomeSize = (int)value; + break; + + case 164: + this.field_175336_F.riverSize = (int)value; + break; + + case 165: + this.field_175336_F.dirtSize = (int)value; + break; + + case 166: + this.field_175336_F.dirtCount = (int)value; + break; + + case 167: + this.field_175336_F.dirtMinHeight = (int)value; + break; + + case 168: + this.field_175336_F.dirtMaxHeight = (int)value; + break; + + case 169: + this.field_175336_F.gravelSize = (int)value; + break; + + case 170: + this.field_175336_F.gravelCount = (int)value; + break; + + case 171: + this.field_175336_F.gravelMinHeight = (int)value; + break; + + case 172: + this.field_175336_F.gravelMaxHeight = (int)value; + break; + + case 173: + this.field_175336_F.graniteSize = (int)value; + break; + + case 174: + this.field_175336_F.graniteCount = (int)value; + break; + + case 175: + this.field_175336_F.graniteMinHeight = (int)value; + break; + + case 176: + this.field_175336_F.graniteMaxHeight = (int)value; + break; + + case 177: + this.field_175336_F.dioriteSize = (int)value; + break; + + case 178: + this.field_175336_F.dioriteCount = (int)value; + break; + + case 179: + this.field_175336_F.dioriteMinHeight = (int)value; + break; + + case 180: + this.field_175336_F.dioriteMaxHeight = (int)value; + break; + + case 181: + this.field_175336_F.andesiteSize = (int)value; + break; + + case 182: + this.field_175336_F.andesiteCount = (int)value; + break; + + case 183: + this.field_175336_F.andesiteMinHeight = (int)value; + break; + + case 184: + this.field_175336_F.andesiteMaxHeight = (int)value; + break; + + case 185: + this.field_175336_F.coalSize = (int)value; + break; + + case 186: + this.field_175336_F.coalCount = (int)value; + break; + + case 187: + this.field_175336_F.coalMinHeight = (int)value; + break; + + case 189: + this.field_175336_F.coalMaxHeight = (int)value; + break; + + case 190: + this.field_175336_F.ironSize = (int)value; + break; + + case 191: + this.field_175336_F.ironCount = (int)value; + break; + + case 192: + this.field_175336_F.ironMinHeight = (int)value; + break; + + case 193: + this.field_175336_F.ironMaxHeight = (int)value; + break; + + case 194: + this.field_175336_F.goldSize = (int)value; + break; + + case 195: + this.field_175336_F.goldCount = (int)value; + break; + + case 196: + this.field_175336_F.goldMinHeight = (int)value; + break; + + case 197: + this.field_175336_F.goldMaxHeight = (int)value; + break; + + case 198: + this.field_175336_F.redstoneSize = (int)value; + break; + + case 199: + this.field_175336_F.redstoneCount = (int)value; + break; + + case 200: + this.field_175336_F.redstoneMinHeight = (int)value; + break; + + case 201: + this.field_175336_F.redstoneMaxHeight = (int)value; + break; + + case 202: + this.field_175336_F.diamondSize = (int)value; + break; + + case 203: + this.field_175336_F.diamondCount = (int)value; + break; + + case 204: + this.field_175336_F.diamondMinHeight = (int)value; + break; + + case 205: + this.field_175336_F.diamondMaxHeight = (int)value; + break; + + case 206: + this.field_175336_F.lapisSize = (int)value; + break; + + case 207: + this.field_175336_F.lapisCount = (int)value; + break; + + case 208: + this.field_175336_F.lapisCenterHeight = (int)value; + break; + + case 209: + this.field_175336_F.lapisSpread = (int)value; + } + + if (id >= 100 && id < 116) + { + Gui gui = this.field_175349_r.func_178061_c(id - 100 + 132); + + if (gui != null) + { + ((GuiTextField)gui).setText(this.func_175330_b(id, value)); + } + } + + if (!this.field_175336_F.equals(this.field_175334_E)) + { + this.func_181031_a(true); + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + switch (button.id) + { + case 300: + this.field_175343_i.chunkProviderSettingsJson = this.field_175336_F.toString(); + this.mc.displayGuiScreen(this.field_175343_i); + break; + + case 301: + for (int i = 0; i < this.field_175349_r.getSize(); ++i) + { + GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = this.field_175349_r.getListEntry(i); + Gui gui = guipagebuttonlist$guientry.func_178022_a(); + + if (gui instanceof GuiButton) + { + GuiButton guibutton = (GuiButton)gui; + + if (guibutton instanceof GuiSlider) + { + float f = ((GuiSlider)guibutton).func_175217_d() * (0.75F + this.random.nextFloat() * 0.5F) + (this.random.nextFloat() * 0.1F - 0.05F); + ((GuiSlider)guibutton).func_175219_a(MathHelper.clamp_float(f, 0.0F, 1.0F)); + } + else if (guibutton instanceof GuiListButton) + { + ((GuiListButton)guibutton).func_175212_b(this.random.nextBoolean()); + } + } + + Gui gui1 = guipagebuttonlist$guientry.func_178021_b(); + + if (gui1 instanceof GuiButton) + { + GuiButton guibutton1 = (GuiButton)gui1; + + if (guibutton1 instanceof GuiSlider) + { + float f1 = ((GuiSlider)guibutton1).func_175217_d() * (0.75F + this.random.nextFloat() * 0.5F) + (this.random.nextFloat() * 0.1F - 0.05F); + ((GuiSlider)guibutton1).func_175219_a(MathHelper.clamp_float(f1, 0.0F, 1.0F)); + } + else if (guibutton1 instanceof GuiListButton) + { + ((GuiListButton)guibutton1).func_175212_b(this.random.nextBoolean()); + } + } + } + + return; + + case 302: + this.field_175349_r.func_178071_h(); + this.func_175328_i(); + break; + + case 303: + this.field_175349_r.func_178064_i(); + this.func_175328_i(); + break; + + case 304: + if (this.field_175338_A) + { + this.func_175322_b(304); + } + + break; + + case 305: + this.mc.displayGuiScreen(new GuiScreenCustomizePresets(this)); + break; + + case 306: + this.func_175331_h(); + break; + + case 307: + this.field_175339_B = 0; + this.func_175331_h(); + } + } + } + + private void func_175326_g() + { + this.field_175336_F.func_177863_a(); + this.func_175325_f(); + this.func_181031_a(false); + } + + private void func_175322_b(int p_175322_1_) + { + this.field_175339_B = p_175322_1_; + this.func_175329_a(true); + } + + private void func_175331_h() throws IOException + { + switch (this.field_175339_B) + { + case 300: + this.actionPerformed((GuiListButton)this.field_175349_r.func_178061_c(300)); + break; + + case 304: + this.func_175326_g(); + } + + this.field_175339_B = 0; + this.field_175340_C = true; + this.func_175329_a(false); + } + + private void func_175329_a(boolean p_175329_1_) + { + this.field_175352_x.visible = p_175329_1_; + this.field_175351_y.visible = p_175329_1_; + this.field_175347_t.enabled = !p_175329_1_; + this.field_175348_s.enabled = !p_175329_1_; + this.field_175345_v.enabled = !p_175329_1_; + this.field_175344_w.enabled = !p_175329_1_; + this.field_175346_u.enabled = this.field_175338_A && !p_175329_1_; + this.field_175350_z.enabled = !p_175329_1_; + this.field_175349_r.func_181155_a(!p_175329_1_); + } + + private void func_175328_i() + { + this.field_175345_v.enabled = this.field_175349_r.func_178059_e() != 0; + this.field_175344_w.enabled = this.field_175349_r.func_178059_e() != this.field_175349_r.func_178057_f() - 1; + this.field_175333_f = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.field_175349_r.func_178059_e() + 1), Integer.valueOf(this.field_175349_r.func_178057_f())}); + this.field_175335_g = this.field_175342_h[this.field_175349_r.func_178059_e()]; + this.field_175347_t.enabled = this.field_175349_r.func_178059_e() != this.field_175349_r.func_178057_f() - 1; + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + super.keyTyped(typedChar, keyCode); + + if (this.field_175339_B == 0) + { + switch (keyCode) + { + case 200: + this.func_175327_a(1.0F); + break; + + case 208: + this.func_175327_a(-1.0F); + break; + + default: + this.field_175349_r.func_178062_a(typedChar, keyCode); + } + } + } + + private void func_175327_a(float p_175327_1_) + { + Gui gui = this.field_175349_r.func_178056_g(); + + if (gui instanceof GuiTextField) + { + float f = p_175327_1_; + + if (GuiScreen.isShiftKeyDown()) + { + f = p_175327_1_ * 0.1F; + + if (GuiScreen.isCtrlKeyDown()) + { + f *= 0.1F; + } + } + else if (GuiScreen.isCtrlKeyDown()) + { + f = p_175327_1_ * 10.0F; + + if (GuiScreen.isAltKeyDown()) + { + f *= 10.0F; + } + } + + GuiTextField guitextfield = (GuiTextField)gui; + Float f1 = Floats.tryParse(guitextfield.getText()); + + if (f1 != null) + { + f1 = Float.valueOf(f1.floatValue() + f); + int i = guitextfield.getId(); + String s = this.func_175330_b(guitextfield.getId(), f1.floatValue()); + guitextfield.setText(s); + this.func_175319_a(i, s); + } + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + + if (this.field_175339_B == 0 && !this.field_175340_C) + { + this.field_175349_r.mouseClicked(mouseX, mouseY, mouseButton); + } + } + + protected void mouseReleased(int mouseX, int mouseY, int state) + { + super.mouseReleased(mouseX, mouseY, state); + + if (this.field_175340_C) + { + this.field_175340_C = false; + } + else if (this.field_175339_B == 0) + { + this.field_175349_r.mouseReleased(mouseX, mouseY, state); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_175349_r.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_175341_a, this.width / 2, 2, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_175333_f, this.width / 2, 12, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_175335_g, this.width / 2, 22, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + + if (this.field_175339_B != 0) + { + drawRect(0, 0, this.width, this.height, Integer.MIN_VALUE); + this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 99, -2039584); + this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 185, -6250336); + this.drawVerticalLine(this.width / 2 - 91, 99, 185, -2039584); + this.drawVerticalLine(this.width / 2 + 90, 99, 185, -6250336); + float f = 85.0F; + float f1 = 180.0F; + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.mc.getTextureManager().bindTexture(optionsBackground); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + float f2 = 32.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)(this.width / 2 - 90), 185.0D, 0.0D).tex(0.0D, 2.65625D).color(64, 64, 64, 64).endVertex(); + worldrenderer.pos((double)(this.width / 2 + 90), 185.0D, 0.0D).tex(5.625D, 2.65625D).color(64, 64, 64, 64).endVertex(); + worldrenderer.pos((double)(this.width / 2 + 90), 100.0D, 0.0D).tex(5.625D, 0.0D).color(64, 64, 64, 64).endVertex(); + worldrenderer.pos((double)(this.width / 2 - 90), 100.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 64).endVertex(); + tessellator.draw(); + this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.customize.custom.confirmTitle", new Object[0]), this.width / 2, 105, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.customize.custom.confirm1", new Object[0]), this.width / 2, 125, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.customize.custom.confirm2", new Object[0]), this.width / 2, 135, 16777215); + this.field_175352_x.drawButton(this.mc, mouseX, mouseY); + this.field_175351_y.drawButton(this.mc, mouseX, mouseY); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiDisconnected.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiDisconnected.java new file mode 100644 index 0000000..04f7cc9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiDisconnected.java @@ -0,0 +1,79 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import java.util.List; + +import com.cheatbreaker.client.ui.mainmenu.menus.MainMenu; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.IChatComponent; + +public class GuiDisconnected extends GuiScreen +{ + private String reason; + private IChatComponent message; + private List multilineMessage; + private final GuiScreen parentScreen; + private int field_175353_i; + + public GuiDisconnected(GuiScreen screen, String reasonLocalizationKey, IChatComponent chatComp) + { + this.parentScreen = screen; + this.reason = I18n.format(reasonLocalizationKey); + this.message = chatComp; + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + } + + public void initGui() + { + this.buttonList.clear(); + this.multilineMessage = this.fontRendererObj.listFormattedStringToWidth(this.message.getFormattedText(), this.width - 50); + this.field_175353_i = this.multilineMessage.size() * this.fontRendererObj.FONT_HEIGHT; + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 2 + this.field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT, I18n.format("gui.toMenu"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 2 + this.field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT + 25, "Reconnect")); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 0) + { + this.mc.displayGuiScreen(this.parentScreen); + } + + if (button.id == 0) { + if (this.parentScreen instanceof GuiDisconnected) { + this.mc.displayGuiScreen(new GuiMultiplayer(new MainMenu())); + } else { + this.mc.displayGuiScreen(this.parentScreen); + } + } + + if (button.id == 1) { + if (this.mc.currentServerData != null) { + this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, this.mc.currentServerData)); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.reason, this.width / 2, this.height / 2 - this.field_175353_i / 2 - this.fontRendererObj.FONT_HEIGHT * 2, 11184810); + int i = this.height / 2 - this.field_175353_i / 2; + + if (this.multilineMessage != null) + { + for (String s : this.multilineMessage) + { + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, i, 16777215); + i += this.fontRendererObj.FONT_HEIGHT; + } + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java new file mode 100644 index 0000000..32e4677 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java @@ -0,0 +1,59 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.optifine.CustomLoadingScreen; +import net.optifine.CustomLoadingScreens; + +public class GuiDownloadTerrain extends GuiScreen +{ + private NetHandlerPlayClient netHandlerPlayClient; + private int progress; + private CustomLoadingScreen customLoadingScreen = CustomLoadingScreens.getCustomLoadingScreen(); + + public GuiDownloadTerrain(NetHandlerPlayClient netHandler) + { + this.netHandlerPlayClient = netHandler; + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + } + + public void initGui() + { + this.buttonList.clear(); + } + + public void updateScreen() + { + ++this.progress; + + if (this.progress % 20 == 0) + { + this.netHandlerPlayClient.addToSendQueue(new C00PacketKeepAlive()); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + if (this.customLoadingScreen != null) + { + this.customLoadingScreen.drawBackground(this.width, this.height); + } + else + { + this.drawBackground(0); + } + + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public boolean doesGuiPauseGame() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiEnchantment.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiEnchantment.java new file mode 100644 index 0000000..d86e1bb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiEnchantment.java @@ -0,0 +1,326 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import java.util.Random; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerEnchantment; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnchantmentNameParts; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IWorldNameable; +import net.minecraft.world.World; +import org.lwjgl.util.glu.Project; + +public class GuiEnchantment extends GuiContainer +{ + private static final ResourceLocation ENCHANTMENT_TABLE_GUI_TEXTURE = new ResourceLocation("textures/gui/container/enchanting_table.png"); + private static final ResourceLocation ENCHANTMENT_TABLE_BOOK_TEXTURE = new ResourceLocation("textures/entity/enchanting_table_book.png"); + private static final ModelBook MODEL_BOOK = new ModelBook(); + private final InventoryPlayer playerInventory; + private Random random = new Random(); + private ContainerEnchantment container; + public int field_147073_u; + public float field_147071_v; + public float field_147069_w; + public float field_147082_x; + public float field_147081_y; + public float field_147080_z; + public float field_147076_A; + ItemStack field_147077_B; + private final IWorldNameable field_175380_I; + + public GuiEnchantment(InventoryPlayer inventory, World worldIn, IWorldNameable p_i45502_3_) + { + super(new ContainerEnchantment(inventory, worldIn)); + this.playerInventory = inventory; + this.container = (ContainerEnchantment)this.inventorySlots; + this.field_175380_I = p_i45502_3_; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.field_175380_I.getDisplayName().getUnformattedText(), 12, 5, 4210752); + this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } + + public void updateScreen() + { + super.updateScreen(); + this.func_147068_g(); + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + + for (int k = 0; k < 3; ++k) + { + int l = mouseX - (i + 60); + int i1 = mouseY - (j + 14 + 19 * k); + + if (l >= 0 && i1 >= 0 && l < 108 && i1 < 19 && this.container.enchantItem(this.mc.thePlayer, k)) + { + this.mc.playerController.sendEnchantPacket(this.container.windowId, k); + } + } + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(ENCHANTMENT_TABLE_GUI_TEXTURE); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + GlStateManager.pushMatrix(); + GlStateManager.matrixMode(5889); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + GlStateManager.viewport((scaledresolution.getScaledWidth() - 320) / 2 * scaledresolution.getScaleFactor(), (scaledresolution.getScaledHeight() - 240) / 2 * scaledresolution.getScaleFactor(), 320 * scaledresolution.getScaleFactor(), 240 * scaledresolution.getScaleFactor()); + GlStateManager.translate(-0.34F, 0.23F, 0.0F); + Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); + float f = 1.0F; + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + RenderHelper.enableStandardItemLighting(); + GlStateManager.translate(0.0F, 3.3F, -16.0F); + GlStateManager.scale(f, f, f); + float f1 = 5.0F; + GlStateManager.scale(f1, f1, f1); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(ENCHANTMENT_TABLE_BOOK_TEXTURE); + GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F); + float f2 = this.field_147076_A + (this.field_147080_z - this.field_147076_A) * partialTicks; + GlStateManager.translate((1.0F - f2) * 0.2F, (1.0F - f2) * 0.1F, (1.0F - f2) * 0.25F); + GlStateManager.rotate(-(1.0F - f2) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + float f3 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * partialTicks + 0.25F; + float f4 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * partialTicks + 0.75F; + f3 = (f3 - (float)MathHelper.truncateDoubleToInt((double)f3)) * 1.6F - 0.3F; + f4 = (f4 - (float)MathHelper.truncateDoubleToInt((double)f4)) * 1.6F - 0.3F; + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + if (f4 < 0.0F) + { + f4 = 0.0F; + } + + if (f3 > 1.0F) + { + f3 = 1.0F; + } + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + + GlStateManager.enableRescaleNormal(); + MODEL_BOOK.render((Entity)null, 0.0F, f3, f4, f2, 0.0F, 0.0625F); + GlStateManager.disableRescaleNormal(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.matrixMode(5889); + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + EnchantmentNameParts.getInstance().reseedRandomGenerator((long)this.container.xpSeed); + int k = this.container.getLapisAmount(); + + for (int l = 0; l < 3; ++l) + { + int i1 = i + 60; + int j1 = i1 + 20; + int k1 = 86; + String s = EnchantmentNameParts.getInstance().generateNewRandomName(); + this.zLevel = 0.0F; + this.mc.getTextureManager().bindTexture(ENCHANTMENT_TABLE_GUI_TEXTURE); + int l1 = this.container.enchantLevels[l]; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (l1 == 0) + { + this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 185, 108, 19); + } + else + { + String s1 = "" + l1; + FontRenderer fontrenderer = this.mc.standardGalacticFontRenderer; + int i2 = 6839882; + + if ((k < l + 1 || this.mc.thePlayer.experienceLevel < l1) && !this.mc.thePlayer.capabilities.isCreativeMode) + { + this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 185, 108, 19); + this.drawTexturedModalRect(i1 + 1, j + 15 + 19 * l, 16 * l, 239, 16, 16); + fontrenderer.drawSplitString(s, j1, j + 16 + 19 * l, k1, (i2 & 16711422) >> 1); + i2 = 4226832; + } + else + { + int j2 = mouseX - (i + 60); + int k2 = mouseY - (j + 14 + 19 * l); + + if (j2 >= 0 && k2 >= 0 && j2 < 108 && k2 < 19) + { + this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 204, 108, 19); + i2 = 16777088; + } + else + { + this.drawTexturedModalRect(i1, j + 14 + 19 * l, 0, 166, 108, 19); + } + + this.drawTexturedModalRect(i1 + 1, j + 15 + 19 * l, 16 * l, 223, 16, 16); + fontrenderer.drawSplitString(s, j1, j + 16 + 19 * l, k1, i2); + i2 = 8453920; + } + + fontrenderer = this.mc.fontRendererObj; + fontrenderer.drawStringWithShadow(s1, (float)(j1 + 86 - fontrenderer.getStringWidth(s1)), (float)(j + 16 + 19 * l + 7), i2); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + boolean flag = this.mc.thePlayer.capabilities.isCreativeMode; + int i = this.container.getLapisAmount(); + + for (int j = 0; j < 3; ++j) + { + int k = this.container.enchantLevels[j]; + int l = this.container.enchantmentIds[j]; + int i1 = j + 1; + + if (this.isPointInRegion(60, 14 + 19 * j, 108, 17, mouseX, mouseY) && k > 0 && l >= 0) + { + List list = Lists.newArrayList(); + + if (l >= 0 && Enchantment.getEnchantmentById(l & 255) != null) + { + String s = Enchantment.getEnchantmentById(l & 255).getTranslatedName((l & 65280) >> 8); + list.add(EnumChatFormatting.WHITE.toString() + EnumChatFormatting.ITALIC.toString() + I18n.format("container.enchant.clue", new Object[] {s})); + } + + if (!flag) + { + if (l >= 0) + { + list.add(""); + } + + if (this.mc.thePlayer.experienceLevel < k) + { + list.add(EnumChatFormatting.RED.toString() + "Level Requirement: " + this.container.enchantLevels[j]); + } + else + { + String s1 = ""; + + if (i1 == 1) + { + s1 = I18n.format("container.enchant.lapis.one", new Object[0]); + } + else + { + s1 = I18n.format("container.enchant.lapis.many", new Object[] {Integer.valueOf(i1)}); + } + + if (i >= i1) + { + list.add(EnumChatFormatting.GRAY.toString() + "" + s1); + } + else + { + list.add(EnumChatFormatting.RED.toString() + "" + s1); + } + + if (i1 == 1) + { + s1 = I18n.format("container.enchant.level.one", new Object[0]); + } + else + { + s1 = I18n.format("container.enchant.level.many", new Object[] {Integer.valueOf(i1)}); + } + + list.add(EnumChatFormatting.GRAY.toString() + "" + s1); + } + } + + this.drawHoveringText(list, mouseX, mouseY); + break; + } + } + } + + public void func_147068_g() + { + ItemStack itemstack = this.inventorySlots.getSlot(0).getStack(); + + if (!ItemStack.areItemStacksEqual(itemstack, this.field_147077_B)) + { + this.field_147077_B = itemstack; + + while (true) + { + this.field_147082_x += (float)(this.random.nextInt(4) - this.random.nextInt(4)); + + if (this.field_147071_v > this.field_147082_x + 1.0F || this.field_147071_v < this.field_147082_x - 1.0F) + { + break; + } + } + } + + ++this.field_147073_u; + this.field_147069_w = this.field_147071_v; + this.field_147076_A = this.field_147080_z; + boolean flag = false; + + for (int i = 0; i < 3; ++i) + { + if (this.container.enchantLevels[i] != 0) + { + flag = true; + } + } + + if (flag) + { + this.field_147080_z += 0.2F; + } + else + { + this.field_147080_z -= 0.2F; + } + + this.field_147080_z = MathHelper.clamp_float(this.field_147080_z, 0.0F, 1.0F); + float f1 = (this.field_147082_x - this.field_147071_v) * 0.4F; + float f = 0.2F; + f1 = MathHelper.clamp_float(f1, -f, f); + this.field_147081_y += (f1 - this.field_147081_y) * 0.9F; + this.field_147071_v += this.field_147081_y; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java new file mode 100644 index 0000000..e2054bb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java @@ -0,0 +1,39 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; + +public class GuiErrorScreen extends GuiScreen +{ + private String field_146313_a; + private String field_146312_f; + + public GuiErrorScreen(String p_i46319_1_, String p_i46319_2_) + { + this.field_146313_a = p_i46319_1_; + this.field_146312_f = p_i46319_2_; + } + + public void initGui() + { + super.initGui(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.format("gui.cancel", new Object[0]))); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224); + this.drawCenteredString(this.fontRendererObj, this.field_146313_a, this.width / 2, 90, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146312_f, this.width / 2, 110, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + } + + protected void actionPerformed(GuiButton button) throws IOException + { + this.mc.displayGuiScreen((GuiScreen)null); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java new file mode 100644 index 0000000..e623922 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java @@ -0,0 +1,253 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; +import org.lwjgl.input.Keyboard; + +public class GuiFlatPresets extends GuiScreen +{ + private static final List FLAT_WORLD_PRESETS = Lists.newArrayList(); + private final GuiCreateFlatWorld parentScreen; + private String presetsTitle; + private String presetsShare; + private String field_146436_r; + private GuiFlatPresets.ListSlot field_146435_s; + private GuiButton field_146434_t; + private GuiTextField field_146433_u; + + public GuiFlatPresets(GuiCreateFlatWorld p_i46318_1_) + { + this.parentScreen = p_i46318_1_; + } + + public void initGui() + { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.presetsTitle = I18n.format("createWorld.customize.presets.title", new Object[0]); + this.presetsShare = I18n.format("createWorld.customize.presets.share", new Object[0]); + this.field_146436_r = I18n.format("createWorld.customize.presets.list", new Object[0]); + this.field_146433_u = new GuiTextField(2, this.fontRendererObj, 50, 40, this.width - 100, 20); + this.field_146435_s = new GuiFlatPresets.ListSlot(); + this.field_146433_u.setMaxStringLength(1230); + this.field_146433_u.setText(this.parentScreen.func_146384_e()); + this.buttonList.add(this.field_146434_t = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("createWorld.customize.presets.select", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.func_146426_g(); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.field_146435_s.handleMouseInput(); + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + this.field_146433_u.mouseClicked(mouseX, mouseY, mouseButton); + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (!this.field_146433_u.textboxKeyTyped(typedChar, keyCode)) + { + super.keyTyped(typedChar, keyCode); + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 0 && this.func_146430_p()) + { + this.parentScreen.func_146383_a(this.field_146433_u.getText()); + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 1) + { + this.mc.displayGuiScreen(this.parentScreen); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_146435_s.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.presetsTitle, this.width / 2, 8, 16777215); + this.drawString(this.fontRendererObj, this.presetsShare, 50, 30, 10526880); + this.drawString(this.fontRendererObj, this.field_146436_r, 50, 70, 10526880); + this.field_146433_u.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void updateScreen() + { + this.field_146433_u.updateCursorCounter(); + super.updateScreen(); + } + + public void func_146426_g() + { + boolean flag = this.func_146430_p(); + this.field_146434_t.enabled = flag; + } + + private boolean func_146430_p() + { + return this.field_146435_s.field_148175_k > -1 && this.field_146435_s.field_148175_k < FLAT_WORLD_PRESETS.size() || this.field_146433_u.getText().length() > 1; + } + + private static void func_146425_a(String p_146425_0_, Item p_146425_1_, BiomeGenBase p_146425_2_, FlatLayerInfo... p_146425_3_) + { + func_175354_a(p_146425_0_, p_146425_1_, 0, p_146425_2_, (List)null, p_146425_3_); + } + + private static void func_146421_a(String p_146421_0_, Item p_146421_1_, BiomeGenBase p_146421_2_, List p_146421_3_, FlatLayerInfo... p_146421_4_) + { + func_175354_a(p_146421_0_, p_146421_1_, 0, p_146421_2_, p_146421_3_, p_146421_4_); + } + + private static void func_175354_a(String p_175354_0_, Item p_175354_1_, int p_175354_2_, BiomeGenBase p_175354_3_, List p_175354_4_, FlatLayerInfo... p_175354_5_) + { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + + for (int i = p_175354_5_.length - 1; i >= 0; --i) + { + flatgeneratorinfo.getFlatLayers().add(p_175354_5_[i]); + } + + flatgeneratorinfo.setBiome(p_175354_3_.biomeID); + flatgeneratorinfo.func_82645_d(); + + if (p_175354_4_ != null) + { + for (String s : p_175354_4_) + { + flatgeneratorinfo.getWorldFeatures().put(s, Maps.newHashMap()); + } + } + + FLAT_WORLD_PRESETS.add(new GuiFlatPresets.LayerItem(p_175354_1_, p_175354_2_, p_175354_0_, flatgeneratorinfo.toString())); + } + + static + { + func_146421_a("Classic Flat", Item.getItemFromBlock(Blocks.grass), BiomeGenBase.plains, Arrays.asList(new String[] {"village"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(2, Blocks.dirt), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Tunnelers\' Dream", Item.getItemFromBlock(Blocks.stone), BiomeGenBase.extremeHills, Arrays.asList(new String[] {"biome_1", "dungeon", "decoration", "stronghold", "mineshaft"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(5, Blocks.dirt), new FlatLayerInfo(230, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Water World", Items.water_bucket, BiomeGenBase.deepOcean, Arrays.asList(new String[] {"biome_1", "oceanmonument"}), new FlatLayerInfo[] {new FlatLayerInfo(90, Blocks.water), new FlatLayerInfo(5, Blocks.sand), new FlatLayerInfo(5, Blocks.dirt), new FlatLayerInfo(5, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_175354_a("Overworld", Item.getItemFromBlock(Blocks.tallgrass), BlockTallGrass.EnumType.GRASS.getMeta(), BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(59, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Snowy Kingdom", Item.getItemFromBlock(Blocks.snow_layer), BiomeGenBase.icePlains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.snow_layer), new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(59, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Bottomless Pit", Items.feather, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(2, Blocks.cobblestone)}); + func_146421_a("Desert", Item.getItemFromBlock(Blocks.sand), BiomeGenBase.desert, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"}), new FlatLayerInfo[] {new FlatLayerInfo(8, Blocks.sand), new FlatLayerInfo(52, Blocks.sandstone), new FlatLayerInfo(3, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146425_a("Redstone Ready", Items.redstone, BiomeGenBase.desert, new FlatLayerInfo[] {new FlatLayerInfo(52, Blocks.sandstone), new FlatLayerInfo(3, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + } + + static class LayerItem + { + public Item field_148234_a; + public int field_179037_b; + public String field_148232_b; + public String field_148233_c; + + public LayerItem(Item p_i45518_1_, int p_i45518_2_, String p_i45518_3_, String p_i45518_4_) + { + this.field_148234_a = p_i45518_1_; + this.field_179037_b = p_i45518_2_; + this.field_148232_b = p_i45518_3_; + this.field_148233_c = p_i45518_4_; + } + } + + class ListSlot extends GuiSlot + { + public int field_148175_k = -1; + + public ListSlot() + { + super(GuiFlatPresets.this.mc, GuiFlatPresets.this.width, GuiFlatPresets.this.height, 80, GuiFlatPresets.this.height - 37, 24); + } + + private void func_178054_a(int p_178054_1_, int p_178054_2_, Item p_178054_3_, int p_178054_4_) + { + this.func_148173_e(p_178054_1_ + 1, p_178054_2_ + 1); + GlStateManager.enableRescaleNormal(); + RenderHelper.enableGUIStandardItemLighting(); + GuiFlatPresets.this.itemRender.renderItemIntoGUI(new ItemStack(p_178054_3_, 1, p_178054_4_), p_178054_1_ + 2, p_178054_2_ + 2); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + } + + private void func_148173_e(int p_148173_1_, int p_148173_2_) + { + this.func_148171_c(p_148173_1_, p_148173_2_, 0, 0); + } + + private void func_148171_c(int p_148171_1_, int p_148171_2_, int p_148171_3_, int p_148171_4_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + int i = 18; + int j = 18; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex(); + tessellator.draw(); + } + + protected int getSize() + { + return GuiFlatPresets.FLAT_WORLD_PRESETS.size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + this.field_148175_k = slotIndex; + GuiFlatPresets.this.func_146426_g(); + GuiFlatPresets.this.field_146433_u.setText(((GuiFlatPresets.LayerItem)GuiFlatPresets.FLAT_WORLD_PRESETS.get(GuiFlatPresets.this.field_146435_s.field_148175_k)).field_148233_c); + } + + protected boolean isSelected(int slotIndex) + { + return slotIndex == this.field_148175_k; + } + + protected void drawBackground() + { + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + GuiFlatPresets.LayerItem guiflatpresets$layeritem = (GuiFlatPresets.LayerItem)GuiFlatPresets.FLAT_WORLD_PRESETS.get(entryID); + this.func_178054_a(p_180791_2_, p_180791_3_, guiflatpresets$layeritem.field_148234_a, guiflatpresets$layeritem.field_179037_b); + GuiFlatPresets.this.fontRendererObj.drawString(guiflatpresets$layeritem.field_148232_b, p_180791_2_ + 18 + 5, p_180791_3_ + 6, 16777215); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiGameOver.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiGameOver.java new file mode 100644 index 0000000..929e863 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiGameOver.java @@ -0,0 +1,125 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; + +public class GuiGameOver extends GuiScreen implements GuiYesNoCallback +{ + private int enableButtonsTimer; + private boolean field_146346_f = false; + + public void initGui() + { + this.buttonList.clear(); + + if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) + { + if (this.mc.isIntegratedServerRunning()) + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.deleteWorld", new Object[0]))); + } + else + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.leaveServer", new Object[0]))); + } + } + else + { + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 72, I18n.format("deathScreen.respawn", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.titleScreen", new Object[0]))); + + if (this.mc.getSession() == null) + { + ((GuiButton)this.buttonList.get(1)).enabled = false; + } + } + + for (GuiButton guibutton : this.buttonList) + { + guibutton.enabled = false; + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + } + + protected void actionPerformed(GuiButton button) throws IOException + { + switch (button.id) + { + case 0: + this.mc.thePlayer.respawnPlayer(); + this.mc.displayGuiScreen((GuiScreen)null); + break; + + case 1: + if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) + { + this.mc.displayGuiScreen(new GuiMainMenu()); + } + else + { + GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("deathScreen.quit.confirm", new Object[0]), "", I18n.format("deathScreen.titleScreen", new Object[0]), I18n.format("deathScreen.respawn", new Object[0]), 0); + this.mc.displayGuiScreen(guiyesno); + guiyesno.setButtonDelay(20); + } + } + } + + public void confirmClicked(boolean result, int id) + { + if (result) + { + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld((WorldClient)null); + this.mc.displayGuiScreen(new GuiMainMenu()); + } + else + { + this.mc.thePlayer.respawnPlayer(); + this.mc.displayGuiScreen((GuiScreen)null); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792); + GlStateManager.pushMatrix(); + GlStateManager.scale(2.0F, 2.0F, 2.0F); + boolean flag = this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(); + String s = flag ? I18n.format("deathScreen.title.hardcore", new Object[0]) : I18n.format("deathScreen.title", new Object[0]); + this.drawCenteredString(this.fontRendererObj, s, this.width / 2 / 2, 30, 16777215); + GlStateManager.popMatrix(); + + if (flag) + { + this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.hardcoreInfo", new Object[0]), this.width / 2, 144, 16777215); + } + + this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.score", new Object[0]) + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public boolean doesGuiPauseGame() + { + return false; + } + + public void updateScreen() + { + super.updateScreen(); + ++this.enableButtonsTimer; + + if (this.enableButtonsTimer == 20) + { + for (GuiButton guibutton : this.buttonList) + { + guibutton.enabled = true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiHopper.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiHopper.java new file mode 100644 index 0000000..049cd89 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiHopper.java @@ -0,0 +1,40 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerHopper; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +public class GuiHopper extends GuiContainer +{ + private static final ResourceLocation HOPPER_GUI_TEXTURE = new ResourceLocation("textures/gui/container/hopper.png"); + private IInventory playerInventory; + private IInventory hopperInventory; + + public GuiHopper(InventoryPlayer playerInv, IInventory hopperInv) + { + super(new ContainerHopper(playerInv, hopperInv, Minecraft.getMinecraft().thePlayer)); + this.playerInventory = playerInv; + this.hopperInventory = hopperInv; + this.allowUserInput = false; + this.ySize = 133; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.hopperInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); + this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(HOPPER_GUI_TEXTURE); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiIngame.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiIngame.java new file mode 100644 index 0000000..f3751d0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiIngame.java @@ -0,0 +1,1107 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.render.GuiDrawBypassDebugEvent; +import com.cheatbreaker.client.event.impl.render.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.render.PreviewDrawEvent; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import com.cheatbreaker.client.module.impl.normal.misc.ModulePackTweaks; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ModulePlaceGui; +import com.cheatbreaker.client.ui.module.ProfileCreatorGui; +import lombok.Setter; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.src.Config; +import net.minecraft.util.*; +import net.minecraft.world.border.WorldBorder; +import net.optifine.CustomColors; + +import java.util.Random; + +public class GuiIngame extends Gui { + private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); + private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); + private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); + private final Random rand = new Random(); + private final Minecraft mc; + private final RenderItem itemRenderer; + + /** + * ChatGUI instance that retains all previous chat data + */ + private final GuiNewChat persistantChatGUI; + private final GuiStreamIndicator streamIndicator; + private int updateCounter; + + /** + * The string specifying which record music is playing + */ + private String recordPlaying = ""; + + /** + * How many ticks the record playing message will be displayed + */ + private int recordPlayingUpFor; + private boolean recordIsPlaying; + + /** + * Previous frame vignette brightness (slowly changes by 1% each frame) + */ + public float prevVignetteBrightness = 1.0F; + + private float prevRedScreenBrightness = 1.0F; + + /** + * Remaining ticks the item highlight should be visible + */ + private int remainingHighlightTicks; + + /** + * The ItemStack that is currently being highlighted + */ + private ItemStack highlightingItemStack; + private final GuiOverlayDebug overlayDebug; + + /** + * The spectator GUI for this in-game GUI instance + */ + private final GuiSpectator spectatorGui; + public final GuiPlayerTabOverlay overlayPlayerList; + + /** + * A timer for the current title and subtitle displayed + */ + private int titlesTimer; + + /** + * The current title displayed + */ + @Setter + private String displayedTitle = ""; + + /** + * The current sub-title displayed + */ + @Setter + private String displayedSubTitle = ""; + + /** + * The time that the title take to fade in + */ + private int titleFadeIn; + + /** + * The time that the title is display + */ + private int titleDisplayTime; + + /** + * The time that the title take to fade out + */ + private int titleFadeOut; + private int playerHealth = 0; + private int lastPlayerHealth = 0; + + /** + * The last recorded system time + */ + private long lastSystemTime = 0L; + + /** + * Used with updateCounter to make the heart bar flash + */ + private long healthUpdateCounter = 0L; + public static boolean uploadingScreenshot = false; + + public GuiIngame(Minecraft mcIn) { + this.mc = mcIn; + this.itemRenderer = mcIn.getRenderItem(); + this.overlayDebug = new GuiOverlayDebug(mcIn); + this.spectatorGui = new GuiSpectator(mcIn); + this.persistantChatGUI = new GuiNewChat(mcIn); + this.streamIndicator = new GuiStreamIndicator(mcIn); + this.overlayPlayerList = new GuiPlayerTabOverlay(mcIn, this); + this.setDefaultTitlesTimes(); + } + + /** + * Set the differents times for the titles to their default values + */ + public void setDefaultTitlesTimes() { + this.titleFadeIn = 10; + this.titleDisplayTime = 70; + this.titleFadeOut = 20; + } + + public void renderGameOverlay(float partialTicks) { + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int xPos = scaledresolution.getScaledWidth(); + int yPos = scaledresolution.getScaledHeight(); + this.mc.entityRenderer.setupOverlayRendering(); + GlStateManager.enableBlend(); + + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + boolean ptIsEnabled = pt.isEnabled(); + + if (Config.isVignetteEnabled() || (pt.forceVignette.getValue().equals("Static") && ptIsEnabled)) { + this.renderVignette(this.mc.thePlayer.getBrightness(partialTicks), scaledresolution); + } else { + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + } + + if (pt.lowHealthOverlay.getBooleanValue() && pt.isEnabled()) { + this.renderRedScreen(pt.lowHealthOverlayOpacity.getFloatValue() / 100.0F, scaledresolution); + } else { + GlStateManager.enableDepth(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + } + + ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3); + + boolean showPumpOverlay = !ptIsEnabled || (boolean) pt.pumpkinOverlay.getValue(); + if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin) && showPumpOverlay) { + this.renderPumpkinOverlay(scaledresolution); + } + + if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) { + float f = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * partialTicks; + + if (f > 0.0F) { + this.renderPortal(f, scaledresolution); + } + } + + if (this.mc.playerController.isSpectator()) { + this.spectatorGui.renderTooltip(scaledresolution, partialTicks); + } else { + this.renderTooltip(scaledresolution, partialTicks); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + GlStateManager.enableBlend(); + + + if (this.showCrosshair()) { + if (CheatBreaker.getInstance().getModuleManager().crosshairMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().crosshairMod.drawCrosshair(xPos / 2, yPos / 2, true); + } else { + GlStateManager.tryBlendFuncSeparate(775, 769, 1, 0); + GlStateManager.enableAlpha(); + this.drawTexturedModalRect(xPos / 2 - 7, yPos / 2 - 7, 0, 0, 16, 16); + } + } + + GlStateManager.enableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + this.mc.mcProfiler.startSection("bossHealth"); + if (!CheatBreaker.getInstance().getModuleManager().bossBarMod.isRenderHud() && CheatBreaker.getInstance().getModuleManager().bossBarMod.isEnabled()) { + if (BossStatus.bossName != null && BossStatus.statusBarTime > 0) { + CheatBreaker.getInstance().getModuleManager().bossBarMod.render(BossStatus.bossName, BossStatus.healthScale, scaledresolution.getScaledWidth() / 2 - 91, 12); + } + this.mc.getTextureManager().bindTexture(icons); + } + this.mc.mcProfiler.endSection(); + + if (this.mc.playerController.shouldDrawHUD()) { + this.renderPlayerStats(scaledresolution); + } + + GlStateManager.disableBlend(); + + if (this.mc.thePlayer.getSleepTimer() > 0) { + this.mc.mcProfiler.startSection("sleep"); + GlStateManager.disableDepth(); + GlStateManager.disableAlpha(); + int j1 = this.mc.thePlayer.getSleepTimer(); + float f1 = (float) j1 / 100.0F; + + if (f1 > 1.0F) { + f1 = 1.0F - (float) (j1 - 100) / 10.0F; + } + + int k = (int) (220.0F * f1) << 24 | 1052704; + drawRect(0, 0, xPos, yPos, k); + GlStateManager.enableAlpha(); + GlStateManager.enableDepth(); + this.mc.mcProfiler.endSection(); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + int k1 = xPos / 2 - 91; + + if (this.mc.thePlayer.isRidingHorse()) { + this.renderHorseJumpBar(scaledresolution, k1); + } else if (this.mc.playerController.gameIsSurvivalOrAdventure()) { + this.renderExpBar(scaledresolution, k1); + } + + if (this.mc.gameSettings.heldItemTooltips && !this.mc.playerController.isSpectator()) { + this.renderSelectedItem(scaledresolution); + } else if (this.mc.thePlayer.isSpectator()) { + this.spectatorGui.renderSelectedItem(scaledresolution); + } + + if (this.mc.isDemo()) { + this.renderDemo(scaledresolution); + } + + if (this.mc.gameSettings.showDebugInfo) { + this.overlayDebug.renderDebugInfo(scaledresolution); + } + + if (uploadingScreenshot) { + this.mc.fontRendererObj.drawStringWithShadow("Uploading screenshot...", 4.0f, (float) (scaledresolution.getScaledHeight() - 24), -1); + } + if (CheatBreaker.getInstance().getModuleManager().chatMod.hiddenFromHud && this.mc.currentScreen instanceof GuiChat) { + this.mc.fontRendererObj.drawStringWithShadow("Chat is hidden", 4.0f, (float) (scaledresolution.getScaledHeight() - 24), 0xFF777777); + } + + if (this.mc.currentScreen instanceof HudLayoutEditorGui || this.mc.currentScreen instanceof ModulePlaceGui || this.mc.currentScreen instanceof ProfileCreatorGui) { + CheatBreaker.getInstance().getEventBus().handleEvent(new PreviewDrawEvent(scaledresolution)); + } + CheatBreaker.getInstance().getEventBus().handleEvent(new GuiDrawBypassDebugEvent(scaledresolution)); + if (!this.mc.gameSettings.showDebugInfo || (Boolean) CheatBreaker.getInstance().getGlobalSettings().showHudInDebug.getValue()) { + CheatBreaker.getInstance().getEventBus().handleEvent(new GuiDrawEvent(scaledresolution)); + } + + if (this.recordPlayingUpFor > 0) { + this.mc.mcProfiler.startSection("overlayMessage"); + float f2 = (float) this.recordPlayingUpFor - partialTicks; + int l1 = (int) (f2 * 255.0F / 20.0F); + + if (l1 > 255) { + l1 = 255; + } + + if (l1 > 8) { + GlStateManager.pushMatrix(); + GlStateManager.translate((float) (xPos / 2), (float) (yPos - 68), 0.0F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + int l = 16777215; + + if (this.recordIsPlaying) { + l = MathHelper.hsvToRGB(f2 / 50.0F, 0.7F, 0.6F) & 16777215; + } + + this.getFontRenderer().drawString(this.recordPlaying, -this.getFontRenderer().getStringWidth(this.recordPlaying) / 2, -4, l + (l1 << 24 & -16777216)); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + this.mc.mcProfiler.endSection(); + } + + if (this.titlesTimer > 0) { + this.mc.mcProfiler.startSection("titleAndSubtitle"); + float f3 = (float) this.titlesTimer - partialTicks; + int i2 = 255; + + if (this.titlesTimer > this.titleFadeOut + this.titleDisplayTime) { + float f4 = (float) (this.titleFadeIn + this.titleDisplayTime + this.titleFadeOut) - f3; + i2 = (int) (f4 * 255.0F / (float) this.titleFadeIn); + } + + if (this.titlesTimer <= this.titleFadeOut) { + i2 = (int) (f3 * 255.0F / (float) this.titleFadeOut); + } + + i2 = MathHelper.clamp_int(i2, 0, 255); + + if (i2 > 8) { + GlStateManager.pushMatrix(); + GlStateManager.translate((float) (xPos / 2), (float) (yPos / 2), 0.0F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); + GlStateManager.scale(4.0F, 4.0F, 4.0F); + int j2 = i2 << 24 & -16777216; + + if (CheatBreaker.getInstance().getGlobalSettings().showServerBasedHitCooldowns.getBooleanValue() && this.displayedSubTitle.contains("˙")) { + this.getFontRenderer().drawString(this.displayedTitle, (float) (-this.getFontRenderer().getStringWidth(this.displayedTitle) / 2), -10.0F, 16777215 | j2, true); + } + + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(2.0F, 2.0F, 2.0F); + + if (CheatBreaker.getInstance().getGlobalSettings().showServerBasedHitCooldowns.getBooleanValue() && this.displayedSubTitle.contains("˙")) { + this.getFontRenderer().drawString(this.displayedSubTitle, (float) (-this.getFontRenderer().getStringWidth(this.displayedSubTitle) / 2), 5.0F, 16777215 | j2, true); + } + + GlStateManager.popMatrix(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + this.mc.mcProfiler.endSection(); + } + + Scoreboard scoreboard = this.mc.theWorld.getScoreboard(); + ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(this.mc.thePlayer.getName()); + + if (scoreplayerteam != null) { + int i1 = scoreplayerteam.getChatFormat().getColorIndex(); + + if (i1 >= 0) { + scoreboard.getObjectiveInDisplaySlot(3 + i1); + } + } + + ScoreObjective scoreobjective1; + + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.disableAlpha(); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, (float) (yPos - 48), 0.0F); + + if (!CheatBreaker.getInstance().getModuleManager().chatMod.isRenderHud() || !CheatBreaker.getInstance().getModuleManager().chatMod.isEnabled()) { + this.mc.mcProfiler.startSection("chat"); + if (CheatBreaker.getInstance().getModuleManager().chatMod.isEnabled()) { + this.persistantChatGUI.drawCustomChat(this.updateCounter, CheatBreaker.getInstance().getModuleManager().chatMod.smoothChat.getBooleanValue()); + } else { + this.persistantChatGUI.drawChat(this.updateCounter); + } + this.mc.mcProfiler.endSection(); + } + + GlStateManager.popMatrix(); + scoreobjective1 = scoreboard.getObjectiveInDisplaySlot(0); + + if (this.mc.gameSettings.keyBindPlayerList.isKeyDown() && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.getPlayerInfoMap().size() > 1 || scoreobjective1 != null)) { + this.overlayPlayerList.updatePlayerList(true); + this.overlayPlayerList.renderPlayerlist(xPos, scoreboard, scoreobjective1); + } else { + this.overlayPlayerList.updatePlayerList(false); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableLighting(); + GlStateManager.enableAlpha(); + } + + protected void renderTooltip(ScaledResolution sr, float partialTicks) { + if (this.mc.getRenderViewEntity() instanceof EntityPlayer) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(widgetsTexPath); + EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity(); + int i = sr.getScaledWidth() / 2; + float f = this.zLevel; + this.zLevel = -90.0F; + this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22); + this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22); + this.zLevel = f; + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + RenderHelper.enableGUIStandardItemLighting(); + + for (int j = 0; j < 9; ++j) { + int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2; + int l = sr.getScaledHeight() - 16 - 3; + this.renderHotbarItem(j, k, l, partialTicks, entityplayer); + } + + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableBlend(); + } + } + + public void renderHorseJumpBar(ScaledResolution scaledRes, int x) { + this.mc.mcProfiler.startSection("jumpBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); + float f = this.mc.thePlayer.getHorseJumpPower(); + int i = 182; + int j = (int) (f * (float) (i + 1)); + int k = scaledRes.getScaledHeight() - 32 + 3; + this.drawTexturedModalRect(x, k, 0, 84, i, 5); + + if (j > 0) { + this.drawTexturedModalRect(x, k, 0, 89, j, 5); + } + + this.mc.mcProfiler.endSection(); + } + + public void renderExpBar(ScaledResolution scaledRes, int x) { + this.mc.mcProfiler.startSection("expBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); + int i = this.mc.thePlayer.xpBarCap(); + + if (i > 0) { + int j = 182; + int k = (int) (this.mc.thePlayer.experience * (float) (j + 1)); + int l = scaledRes.getScaledHeight() - 32 + 3; + this.drawTexturedModalRect(x, l, 0, 64, j, 5); + + if (k > 0) { + this.drawTexturedModalRect(x, l, 0, 69, k, 5); + } + } + + this.mc.mcProfiler.endSection(); + + if (this.mc.thePlayer.experienceLevel > 0) { + this.mc.mcProfiler.startSection("expLevel"); + int k1 = 8453920; + + if (Config.isCustomColors()) { + k1 = CustomColors.getExpBarTextColor(k1); + } + + String s = "" + this.mc.thePlayer.experienceLevel; + int l1 = (scaledRes.getScaledWidth() - this.getFontRenderer().getStringWidth(s)) / 2; + int i1 = scaledRes.getScaledHeight() - 31 - 4; + int j1 = 0; + this.getFontRenderer().drawString(s, l1 + 1, i1, 0); + this.getFontRenderer().drawString(s, l1 - 1, i1, 0); + this.getFontRenderer().drawString(s, l1, i1 + 1, 0); + this.getFontRenderer().drawString(s, l1, i1 - 1, 0); + this.getFontRenderer().drawString(s, l1, i1, k1); + this.mc.mcProfiler.endSection(); + } + } + + public void renderSelectedItem(ScaledResolution scaledRes) { + this.mc.mcProfiler.startSection("selectedItemName"); + + if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) { + String s = this.highlightingItemStack.getDisplayName(); + + if (this.highlightingItemStack.hasDisplayName()) { + s = EnumChatFormatting.ITALIC + s; + } + + int i = (scaledRes.getScaledWidth() - this.getFontRenderer().getStringWidth(s)) / 2; + int j = scaledRes.getScaledHeight() - 59; + + if (!this.mc.playerController.shouldDrawHUD()) { + j += 14; + } + + int k = (int) ((float) this.remainingHighlightTicks * 256.0F / 10.0F); + + if (k > 255) { + k = 255; + } + + if (k > 0) { + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + this.getFontRenderer().drawStringWithShadow(s, (float) i, (float) j, 16777215 + (k << 24)); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + } + + this.mc.mcProfiler.endSection(); + } + + public void renderDemo(ScaledResolution scaledRes) { + this.mc.mcProfiler.startSection("demo"); + String s = ""; + + if (this.mc.theWorld.getTotalWorldTime() >= 120500L) { + s = I18n.format("demo.demoExpired", new Object[0]); + } else { + s = I18n.format("demo.remainingTime", new Object[]{StringUtils.ticksToElapsedTime((int) (120500L - this.mc.theWorld.getTotalWorldTime()))}); + } + + int i = this.getFontRenderer().getStringWidth(s); + this.getFontRenderer().drawStringWithShadow(s, (float) (scaledRes.getScaledWidth() - i - 10), 5.0F, 16777215); + this.mc.mcProfiler.endSection(); + } + + protected boolean showCrosshair() { + if (this.mc.gameSettings.showDebugProfilerChart && !this.mc.thePlayer.hasReducedDebug() && !this.mc.gameSettings.reducedDebugInfo) { + return false; + } else if (this.mc.playerController.isSpectator()) { + if (this.mc.pointedEntity != null) { + return true; + } else { + if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + BlockPos blockpos = this.mc.objectMouseOver.getBlockPos(); + + return this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory; + } + + return false; + } + } else { + return true; + } + } + + private void renderPlayerStats(ScaledResolution scaledRes) { + if (this.mc.getRenderViewEntity() instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity(); + int i = MathHelper.ceiling_float_int(entityplayer.getHealth()); + boolean flag = this.healthUpdateCounter > (long) this.updateCounter && (this.healthUpdateCounter - (long) this.updateCounter) / 3L % 2L == 1L; + + if (i < this.playerHealth && entityplayer.hurtResistantTime > 0) { + this.lastSystemTime = Minecraft.getSystemTime(); + this.healthUpdateCounter = (this.updateCounter + 20); + } else if (i > this.playerHealth && entityplayer.hurtResistantTime > 0) { + this.lastSystemTime = Minecraft.getSystemTime(); + this.healthUpdateCounter = (this.updateCounter + 10); + } + + if (Minecraft.getSystemTime() - this.lastSystemTime > 1000L) { + this.playerHealth = i; + this.lastPlayerHealth = i; + this.lastSystemTime = Minecraft.getSystemTime(); + } + + this.playerHealth = i; + int j = this.lastPlayerHealth; + this.rand.setSeed(this.updateCounter * 312871L); + boolean flag1 = false; + FoodStats foodstats = entityplayer.getFoodStats(); + int k = foodstats.getFoodLevel(); + int l = foodstats.getPrevFoodLevel(); + IAttributeInstance iattributeinstance = entityplayer.getEntityAttribute(SharedMonsterAttributes.maxHealth); + int i1 = scaledRes.getScaledWidth() / 2 - 91; + int j1 = scaledRes.getScaledWidth() / 2 + 91; + int k1 = scaledRes.getScaledHeight() - 39; + float f = (float) iattributeinstance.getAttributeValue(); + float f1 = entityplayer.getAbsorptionAmount(); + int l1 = MathHelper.ceiling_float_int((f + f1) / 2.0F / 10.0F); + int i2 = Math.max(10 - (l1 - 2), 3); + int j2 = k1 - (l1 - 1) * i2 - 10; + float f2 = f1; + int k2 = entityplayer.getTotalArmorValue(); + int l2 = -1; + + if (entityplayer.isPotionActive(Potion.regeneration)) { + l2 = this.updateCounter % MathHelper.ceiling_float_int(f + 5.0F); + } + + this.mc.mcProfiler.startSection("armor"); + + for (int i3 = 0; i3 < 10; ++i3) { + if (k2 > 0) { + int j3 = i1 + i3 * 8; + + if (i3 * 2 + 1 < k2) { + this.drawTexturedModalRect(j3, j2, 34, 9, 9, 9); + } + + if (i3 * 2 + 1 == k2) { + this.drawTexturedModalRect(j3, j2, 25, 9, 9, 9); + } + + if (i3 * 2 + 1 > k2) { + this.drawTexturedModalRect(j3, j2, 16, 9, 9, 9); + } + } + } + + this.mc.mcProfiler.endStartSection("health"); + + for (int i6 = MathHelper.ceiling_float_int((f + f1) / 2.0F) - 1; i6 >= 0; --i6) { + int j6 = 16; + + if (entityplayer.isPotionActive(Potion.poison)) { + j6 += 36; + } else if (entityplayer.isPotionActive(Potion.wither)) { + j6 += 72; + } + + int k3 = 0; + + if (flag) { + k3 = 1; + } + + int l3 = MathHelper.ceiling_float_int((float) (i6 + 1) / 10.0F) - 1; + int i4 = i1 + i6 % 10 * 8; + int j4 = k1 - l3 * i2; + + if (i <= 4) { + j4 += this.rand.nextInt(2); + } + + if (i6 == l2) { + j4 -= 2; + } + + int k4 = 0; + + if (entityplayer.worldObj.getWorldInfo().isHardcoreModeEnabled()) { + k4 = 5; + } + + this.drawTexturedModalRect(i4, j4, 16 + k3 * 9, 9 * k4, 9, 9); + + if (flag && ModuleOneSevenVisuals.oldHealth.getBooleanValue()) { + if (i6 * 2 + 1 < j) { + this.drawTexturedModalRect(i4, j4, j6 + 54, 9 * k4, 9, 9); + } + + if (i6 * 2 + 1 == j) { + this.drawTexturedModalRect(i4, j4, j6 + 63, 9 * k4, 9, 9); + } + } + + if (f2 <= 0.0F) { + if (i6 * 2 + 1 < i) { + this.drawTexturedModalRect(i4, j4, j6 + 36, 9 * k4, 9, 9); + } + + if (i6 * 2 + 1 == i) { + this.drawTexturedModalRect(i4, j4, j6 + 45, 9 * k4, 9, 9); + } + } else { + if (f2 == f1 && f1 % 2.0F == 1.0F) { + this.drawTexturedModalRect(i4, j4, j6 + 153, 9 * k4, 9, 9); + } else { + this.drawTexturedModalRect(i4, j4, j6 + 144, 9 * k4, 9, 9); + } + + f2 -= 2.0F; + } + } + + Entity entity = entityplayer.ridingEntity; + + if (entity == null) { + this.mc.mcProfiler.endStartSection("food"); + + for (int k6 = 0; k6 < 10; ++k6) { + int j7 = k1; + int l7 = 16; + int k8 = 0; + + if (entityplayer.isPotionActive(Potion.hunger)) { + l7 += 36; + k8 = 13; + } + + if (entityplayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (k * 3 + 1) == 0) { + j7 = k1 + (this.rand.nextInt(3) - 1); + } + + if (flag1) { + k8 = 1; + } + + int j9 = j1 - k6 * 8 - 9; + this.drawTexturedModalRect(j9, j7, 16 + k8 * 9, 27, 9, 9); + + if (flag1) { + if (k6 * 2 + 1 < l) { + this.drawTexturedModalRect(j9, j7, l7 + 54, 27, 9, 9); + } + + if (k6 * 2 + 1 == l) { + this.drawTexturedModalRect(j9, j7, l7 + 63, 27, 9, 9); + } + } + + if (k6 * 2 + 1 < k) { + this.drawTexturedModalRect(j9, j7, l7 + 36, 27, 9, 9); + } + + if (k6 * 2 + 1 == k) { + this.drawTexturedModalRect(j9, j7, l7 + 45, 27, 9, 9); + } + } + } else if (entity instanceof EntityLivingBase) { + this.mc.mcProfiler.endStartSection("mountHealth"); + EntityLivingBase entitylivingbase = (EntityLivingBase) entity; + int i7 = (int) Math.ceil((double) entitylivingbase.getHealth()); + float f3 = entitylivingbase.getMaxHealth(); + int j8 = (int) (f3 + 0.5F) / 2; + + if (j8 > 30) { + j8 = 30; + } + + int i9 = k1; + + for (int k9 = 0; j8 > 0; k9 += 20) { + int l4 = Math.min(j8, 10); + j8 -= l4; + + for (int i5 = 0; i5 < l4; ++i5) { + int j5 = 52; + int k5 = 0; + + if (flag1) { + k5 = 1; + } + + int l5 = j1 - i5 * 8 - 9; + this.drawTexturedModalRect(l5, i9, j5 + k5 * 9, 9, 9, 9); + + if (i5 * 2 + 1 + k9 < i7) { + this.drawTexturedModalRect(l5, i9, j5 + 36, 9, 9, 9); + } + + if (i5 * 2 + 1 + k9 == i7) { + this.drawTexturedModalRect(l5, i9, j5 + 45, 9, 9, 9); + } + } + + i9 -= 10; + } + } + + this.mc.mcProfiler.endStartSection("air"); + + if (entityplayer.isInsideOfMaterial(Material.water)) { + int l6 = this.mc.thePlayer.getAir(); + int k7 = MathHelper.ceiling_double_int((double) (l6 - 2) * 10.0D / 300.0D); + int i8 = MathHelper.ceiling_double_int((double) l6 * 10.0D / 300.0D) - k7; + + for (int l8 = 0; l8 < k7 + i8; ++l8) { + if (l8 < k7) { + this.drawTexturedModalRect(j1 - l8 * 8 - 9, j2, 16, 18, 9, 9); + } else { + this.drawTexturedModalRect(j1 - l8 * 8 - 9, j2, 25, 18, 9, 9); + } + } + } + + this.mc.mcProfiler.endSection(); + } + } + + private void renderPumpkinOverlay(ScaledResolution scaledRes) { + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + + GlStateManager.disableAlpha(); + this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath); + + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(0.0D, scaledRes.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos(scaledRes.getScaledWidth(), scaledRes.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos(scaledRes.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.enableAlpha(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + private void renderRedScreen(float opacity, ScaledResolution scaledRes) { + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + opacity = this.mc.thePlayer.getHealth() / 2 <= pt.lowHealthStart.getFloatValue() ? opacity : 0.0F; + opacity = MathHelper.clamp_float(opacity, 0.0F, 1.0F); + + WorldBorder worldborder = this.mc.theWorld.getWorldBorder(); + float f = (float) worldborder.getClosestDistance(this.mc.thePlayer); + double d0 = Math.min(worldborder.getResizeSpeed() * (double) worldborder.getWarningTime() * 1000.0D, Math.abs(worldborder.getTargetSize() - worldborder.getDiameter())); + double d1 = Math.max(worldborder.getWarningDistance(), d0); + + if ((double) f < d1) { + f = 1.0F - (float) ((double) f / d1); + } else { + f = 0.0F; + } + + this.prevRedScreenBrightness = (float) ((double) this.prevRedScreenBrightness + (double) (opacity - this.prevRedScreenBrightness) * 0.01D); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.tryBlendFuncSeparate(0, 769, 1, 0); + + if (f > 0.0F) { + GlStateManager.color(0.0F, f, f, 1.0F); + } else { + GlStateManager.color(0.0F, this.prevRedScreenBrightness, this.prevRedScreenBrightness, 1.0F); + } + + this.mc.getTextureManager().bindTexture(vignetteTexPath); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(0.0D, scaledRes.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos(scaledRes.getScaledWidth(), scaledRes.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos(scaledRes.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + } + + /** + * Renders a Vignette arount the entire screen that changes with light level. + * + * @param lightLevel The current brightness + * @param scaledRes The current resolution of the game + */ + private void renderVignette(float lightLevel, ScaledResolution scaledRes) { + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + float customVig = (Float) pt.vignetteOpacity.getValue() / 100.0F; + + if (pt.forceVignette.getValue().equals("Static") && pt.isEnabled()) { + lightLevel = customVig; + } else { + lightLevel = 1.0F - lightLevel; + } + + if (!Config.isVignetteEnabled()) { + GlStateManager.enableDepth(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + } else { + lightLevel = MathHelper.clamp_float(lightLevel, 0.0F, 1.0F); + WorldBorder worldborder = this.mc.theWorld.getWorldBorder(); + float f = (float) worldborder.getClosestDistance(this.mc.thePlayer); + double d0 = Math.min(worldborder.getResizeSpeed() * (double) worldborder.getWarningTime() * 1000.0D, Math.abs(worldborder.getTargetSize() - worldborder.getDiameter())); + double d1 = Math.max(worldborder.getWarningDistance(), d0); + + if ((double) f < d1) { + f = 1.0F - (float) ((double) f / d1); + } else { + f = 0.0F; + } + + float min = 0.0F; + float max = 1.0F; + if (pt.forceVignette.getValue().equals("Amplified") && pt.isEnabled()) { + min = pt.vignetteMinOpacity.getFloatValue() / 100.0F; + max = pt.vignetteMaxOpacity.getFloatValue() / 100.0F; + if (min > max) { + pt.vignetteMaxOpacity.setValue(pt.vignetteMinOpacity.getFloatValue()); + } + lightLevel *= pt.vignetteOpacityMultiplier.getFloatValue(); + } + + if (lightLevel < min) { + lightLevel = min; + } + + if (lightLevel > max) { + lightLevel = max; + } + + this.prevVignetteBrightness = (float) ((double) this.prevVignetteBrightness + (double) (lightLevel - this.prevVignetteBrightness) * 0.01D); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.tryBlendFuncSeparate(0, 769, 1, 0); + + if (f > 0.0F) { + GlStateManager.color(0.0F, f, f, 1.0F); + } else { + GlStateManager.color(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F); + } + + this.mc.getTextureManager().bindTexture(vignetteTexPath); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(0.0D, scaledRes.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos(scaledRes.getScaledWidth(), scaledRes.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos(scaledRes.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + } + } + + private void renderPortal(float timeInPortal, ScaledResolution scaledRes) { + if (timeInPortal < 1.0F) { + timeInPortal = timeInPortal * timeInPortal; + timeInPortal = timeInPortal * timeInPortal; + timeInPortal = timeInPortal * 0.8F + 0.2F; + } + + GlStateManager.disableAlpha(); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.color(1.0F, 1.0F, 1.0F, timeInPortal); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.portal.getDefaultState()); + float f = textureatlassprite.getMinU(); + float f1 = textureatlassprite.getMinV(); + float f2 = textureatlassprite.getMaxU(); + float f3 = textureatlassprite.getMaxV(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(0.0D, (double) scaledRes.getScaledHeight(), -90.0D).tex((double) f, (double) f3).endVertex(); + worldrenderer.pos((double) scaledRes.getScaledWidth(), (double) scaledRes.getScaledHeight(), -90.0D).tex((double) f2, (double) f3).endVertex(); + worldrenderer.pos((double) scaledRes.getScaledWidth(), 0.0D, -90.0D).tex((double) f2, (double) f1).endVertex(); + worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double) f, (double) f1).endVertex(); + tessellator.draw(); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.enableAlpha(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + private void renderHotbarItem(int index, int xPos, int yPos, float partialTicks, EntityPlayer player) { + ItemStack itemstack = player.inventory.mainInventory[index]; + + if (itemstack != null) { + float f = (float) itemstack.animationsToGo - partialTicks; + + if (f > 0.0F) { + GlStateManager.pushMatrix(); + float f1 = 1.0F + f / 5.0F; + GlStateManager.translate((float) (xPos + 8), (float) (yPos + 12), 0.0F); + GlStateManager.scale(1.0F / f1, (f1 + 1.0F) / 2.0F, 1.0F); + GlStateManager.translate((float) (-(xPos + 8)), (float) (-(yPos + 12)), 0.0F); + } + + this.itemRenderer.renderItemAndEffectIntoGUI(itemstack, xPos, yPos); + + if (f > 0.0F) { + GlStateManager.popMatrix(); + } + + this.itemRenderer.renderItemOverlays(this.mc.fontRendererObj, itemstack, xPos, yPos); + } + } + + /** + * The update tick for the ingame UI + */ + public void updateTick() { + if (this.recordPlayingUpFor > 0) { + --this.recordPlayingUpFor; + } + + if (this.titlesTimer > 0) { + --this.titlesTimer; + + if (this.titlesTimer <= 0) { + this.displayedTitle = ""; + this.displayedSubTitle = ""; + } + } + + ++this.updateCounter; + this.streamIndicator.updateStreamAlpha(); + + if (this.mc.thePlayer != null) { + ItemStack itemstack = this.mc.thePlayer.inventory.getCurrentItem(); + + if (itemstack == null) { + this.remainingHighlightTicks = 0; + } else if (this.highlightingItemStack != null && itemstack.getItem() == this.highlightingItemStack.getItem() && ItemStack.areItemStackTagsEqual(itemstack, this.highlightingItemStack) && (itemstack.isItemStackDamageable() || itemstack.getMetadata() == this.highlightingItemStack.getMetadata())) { + if (this.remainingHighlightTicks > 0) { + --this.remainingHighlightTicks; + } + } else { + this.remainingHighlightTicks = 40; + } + + this.highlightingItemStack = itemstack; + } + } + + public void setRecordPlayingMessage(String recordName) { + this.setRecordPlaying(I18n.format("record.nowPlaying", new Object[]{recordName}), true); + } + + public void setRecordPlaying(String message, boolean isPlaying) { + this.recordPlaying = message; + this.recordPlayingUpFor = 60; + this.recordIsPlaying = isPlaying; + } + + public void displayTitle(String title, String subTitle, int timeFadeIn, int displayTime, int timeFadeOut) { + if (title == null && subTitle == null && timeFadeIn < 0 && displayTime < 0 && timeFadeOut < 0) { + this.displayedTitle = ""; + this.displayedSubTitle = ""; + this.titlesTimer = 0; + } else if (title != null) { + this.displayedTitle = title; + this.titlesTimer = this.titleFadeIn + this.titleDisplayTime + this.titleFadeOut; + } else if (subTitle != null) { + this.displayedSubTitle = subTitle; + } else { + if (timeFadeIn >= 0) { + this.titleFadeIn = timeFadeIn; + } + + if (displayTime >= 0) { + this.titleDisplayTime = displayTime; + } + + if (timeFadeOut >= 0) { + this.titleFadeOut = timeFadeOut; + } + + if (this.titlesTimer > 0) { + this.titlesTimer = this.titleFadeIn + this.titleDisplayTime + this.titleFadeOut; + } + } + } + + public void setRecordPlaying(IChatComponent component, boolean isPlaying) { + this.setRecordPlaying(component.getUnformattedText(), isPlaying); + } + + /** + * returns a pointer to the persistant Chat GUI, containing all previous chat messages and such + */ + public GuiNewChat getChatGUI() { + return this.persistantChatGUI; + } + + public int getUpdateCounter() { + return this.updateCounter; + } + + public FontRenderer getFontRenderer() { + return this.mc.fontRendererObj; + } + + public GuiSpectator getSpectatorGui() { + return this.spectatorGui; + } + + public GuiPlayerTabOverlay getTabList() { + return this.overlayPlayerList; + } + + /** + * Reset the GuiPlayerTabOverlay's message header and footer + */ + public void resetPlayersOverlayFooterHeader() { + this.overlayPlayerList.resetFooterHeader(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java new file mode 100644 index 0000000..b95d251 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java @@ -0,0 +1,191 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.mainmenu.menus.MainMenu; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.warning.CompetitiveGameWarningGui; +import com.cheatbreaker.client.util.sessionserver.SessionServer; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.resources.I18n; +import net.minecraft.realms.RealmsBridge; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.IOException; + +public class GuiIngameMenu extends GuiScreen { + private int selectedButton; + private int eventButton; + private GuiButton modsButton; + private final ResourceLocation logo = new ResourceLocation("client/logo_white.png"); + private final ResourceLocation outerLogo = new ResourceLocation("client/logo_255_outer.png"); + private final ResourceLocation innerLogo = new ResourceLocation("client/logo_108_inner.png"); + private final CosineFade logoRotationTime = new CosineFade(4000L); + private long currentTime; + private boolean modsButtonHeldDown = false; + private final CosineFade loginServicesFadeTime = new CosineFade(1500L); + + public void initGui() { + this.selectedButton = 0; + this.buttonList.clear(); + int n = -16; + boolean bl = true; + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + n, I18n.format("menu.returnToMenu"))); + if (!this.mc.isIntegratedServerRunning()) { + this.buttonList.get(0).displayString = I18n.format("menu.disconnect"); + } + this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + n, I18n.format("menu.returnToGame"))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + n, 98, 20, I18n.format("menu.options"))); + GuiButton guiButton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + n, 98, 20, I18n.format("menu.shareToLan")); + guiButton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); + this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + n, 98, 20, I18n.format("gui.achievements"))); + this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + n, 98, 20, I18n.format("gui.stats"))); + if (!guiButton.enabled) { + this.modsButton = new GuiButton(10, this.width / 2 + 2, this.height / 4 + 96 + n, 98, 20, "Mods"); + this.buttonList.add(this.modsButton); + this.buttonList.add(new GuiButton(16, this.width / 2 - 100, this.height / 4 + 72 + n, 200, 20, "Server List")); + } else { + this.buttonList.add(guiButton); + this.buttonList.add(new GuiButton(16, this.width / 2 - 100, this.height / 4 + 72 + n, 98, 20, "Server List")); + this.modsButton = new GuiButton(10, this.width / 2 + 2, this.height / 4 + 72 + n, 98, 20, "Mods"); + this.buttonList.add(this.modsButton); + } + } + + private void drawLogo(double d, double d2) { + try { + if (!this.logoRotationTime.isTimeNotAtZero()) { + this.logoRotationTime.startAnimation(); + this.logoRotationTime.loopAnimation(); + } + float f = 18; + double d3 = d / (double) 2 - (double) f; + double d4 = this.buttonList.size() > 2 ? (double) ((float) this.buttonList.get(1).yPosition - f - (float) 32) : (double) -100; + + GL11.glPushMatrix(); + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.4f); + GL11.glTranslatef((float) d3 + 1.0F, (float) d4 + 1.0F, 1.0f); + GL11.glTranslatef(f, f, f); + GL11.glRotatef((float) 180 * this.logoRotationTime.getFadeAmount(), 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-f, -f, -f); + RenderUtil.renderEIcon(this.outerLogo, f, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderEIcon(this.innerLogo, f, (float) d3 + 1.0F, (float) d4 + 1.0F); + + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glTranslatef((float) d3, (float) d4, 1.0f); + GL11.glTranslatef(f, f, f); + GL11.glRotatef((float) 180 * this.logoRotationTime.getFadeAmount(), 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-f, -f, -f); + RenderUtil.renderEIcon(this.outerLogo, f, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderEIcon(this.innerLogo, f, (float) d3, (float) d4); + } catch (Exception exception) { + + } + } + + protected void actionPerformed(GuiButton button) throws IOException { + this.modsButtonHeldDown = false; + switch (button.id) { + case 16: + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + break; + case 0: + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + break; + case 1: + if (CheatBreaker.getInstance().getCBNetHandler().isCompetitiveGameMode()) { + this.mc.displayGuiScreen(new CompetitiveGameWarningGui(this)); + break; + } + button.enabled = false; + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld(null); + this.mc.displayGuiScreen(new MainMenu()); + default: + break; + case 4: + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + break; + case 5: + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); + break; + case 6: + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + break; + case 7: + this.mc.displayGuiScreen(new GuiShareToLan(this)); + break; + case 10: + if (CheatBreaker.getInstance().getGlobalSettings().streamerMode.getBooleanValue() + && CheatBreaker.getInstance().getGlobalSettings().holdDownModsGameMenuButton.getBooleanValue()) { + this.modsButtonHeldDown = true; + this.currentTime = System.currentTimeMillis(); + } else { + this.mc.displayGuiScreen(new HudLayoutEditorGui()); + } + } + } + + public void updateScreen() { + super.updateScreen(); + ++this.eventButton; + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + int n3 = 600; + int n4 = 356; + double d = (double) Math.min(this.width, this.height) / ((double) n3 * (double) 9); + int n5 = (int) ((double) n3 * d); + int n6 = (int) ((double) n4 * d); + if (CheatBreaker.getInstance().getGlobalSettings().getCurrentMenuSetting().getIntegerValue() == 1) { + this.drawLogo(this.width, this.height); + } else { + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.4f); + RenderUtil.renderIcon(this.logo, this.width / 2 - n5 / 2 + 1.0F, n6 * 2 + 1.0F, n5, n6); + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.logo, this.width / 2 - n5 / 2, n6 * 2, n5, n6); + } + + + boolean bl = false; + for (SessionServer sessionServer : CheatBreaker.getInstance().sessionServers) { + if (sessionServer.getStatus() != SessionServer.StatusColor.DOWN) continue; + bl = true; + } + if (this.modsButtonHeldDown && Mouse.isButtonDown(0) && CheatBreaker.getInstance().getGlobalSettings().streamerMode.getBooleanValue() && CheatBreaker.getInstance().getGlobalSettings().holdDownModsGameMenuButton.getBooleanValue()) { + int countdown = this.currentTime == 0L ? (int) CheatBreaker.getInstance().getGlobalSettings().holdDuration.getFloatValue() : (int) ((CheatBreaker.getInstance().getGlobalSettings().holdDuration.getFloatValue() * 1000.0f + 999L - (System.currentTimeMillis() - this.currentTime)) / 1000L); + this.modsButton.displayString = "Mods (" + countdown + ")"; + if (countdown <= 0) { + this.mc.displayGuiScreen(new HudLayoutEditorGui()); + } + } else { + this.modsButton.displayString = "Mods"; + this.currentTime = -0L; + this.modsButtonHeldDown = false; + } + + + if (bl) { + if (!this.loginServicesFadeTime.isTimeNotAtZero()) { + this.loginServicesFadeTime.startAnimation(); + } + this.loginServicesFadeTime.loopAnimation(); + drawRect(this.width / 2 - 100, this.height / 4 + 128, this.width / 2 + 100, this.height / 4 + 142, 0x6F000000); + drawRect(this.width / 2 - 100, this.height / 4 + 128, this.width / 2 + 100, this.height / 4 + 142, new Color(1.0f, 0.2f * 0.75f, 10.6f * 0.014150944f, 1.4142857f * 0.45959595f * this.loginServicesFadeTime.getFadeAmount()).getRGB()); + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString("Some login services might be offline".toUpperCase(), this.width / 2, this.height / 4 + 130, -1); + } + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java new file mode 100644 index 0000000..8a9e93c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java @@ -0,0 +1,181 @@ +package net.minecraft.client.gui; + +import java.util.Arrays; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.util.EnumChatFormatting; +import org.apache.commons.lang3.ArrayUtils; + +public class GuiKeyBindingList extends GuiListExtended +{ + private final GuiControls field_148191_k; + private final Minecraft mc; + private final GuiListExtended.IGuiListEntry[] listEntries; + private int maxListLabelWidth = 0; + + public GuiKeyBindingList(GuiControls controls, Minecraft mcIn) + { + super(mcIn, controls.width, controls.height, 63, controls.height - 32, 20); + this.field_148191_k = controls; + this.mc = mcIn; + KeyBinding[] akeybinding = (KeyBinding[])ArrayUtils.clone(mcIn.gameSettings.keyBindings); + this.listEntries = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()]; + Arrays.sort((Object[])akeybinding); + int i = 0; + String s = null; + + for (KeyBinding keybinding : akeybinding) + { + String s1 = keybinding.getKeyCategory(); + + if (!s1.equals(s)) + { + s = s1; + this.listEntries[i++] = new GuiKeyBindingList.CategoryEntry(s1); + } + + int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0])); + + if (j > this.maxListLabelWidth) + { + this.maxListLabelWidth = j; + } + + this.listEntries[i++] = new GuiKeyBindingList.KeyEntry(keybinding); + } + } + + protected int getSize() + { + return this.listEntries.length; + } + + public GuiListExtended.IGuiListEntry getListEntry(int index) + { + return this.listEntries[index]; + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 15; + } + + public int getListWidth() + { + return super.getListWidth() + 32; + } + + public class CategoryEntry implements GuiListExtended.IGuiListEntry + { + private final String labelText; + private final int labelWidth; + + public CategoryEntry(String p_i45028_2_) + { + this.labelText = I18n.format(p_i45028_2_, new Object[0]); + this.labelWidth = GuiKeyBindingList.this.mc.fontRendererObj.getStringWidth(this.labelText); + } + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + { + GuiKeyBindingList.this.mc.fontRendererObj.drawString(this.labelText, GuiKeyBindingList.this.mc.currentScreen.width / 2 - this.labelWidth / 2, y + slotHeight - GuiKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT - 1, 16777215); + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + return false; + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) + { + } + } + + public class KeyEntry implements GuiListExtended.IGuiListEntry + { + private final KeyBinding keybinding; + private final String keyDesc; + private final GuiButton btnChangeKeyBinding; + private final GuiButton btnReset; + + private KeyEntry(KeyBinding p_i45029_2_) + { + this.keybinding = p_i45029_2_; + this.keyDesc = I18n.format(p_i45029_2_.getKeyDescription(), new Object[0]); + this.btnChangeKeyBinding = new GuiButton(0, 0, 0, 75, 20, I18n.format(p_i45029_2_.getKeyDescription(), new Object[0])); + this.btnReset = new GuiButton(0, 0, 0, 50, 20, I18n.format("controls.reset", new Object[0])); + } + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + { + boolean flag = GuiKeyBindingList.this.field_148191_k.buttonId == this.keybinding; + GuiKeyBindingList.this.mc.fontRendererObj.drawString(this.keyDesc, x + 90 - GuiKeyBindingList.this.maxListLabelWidth, y + slotHeight / 2 - GuiKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT / 2, 16777215); + this.btnReset.xPosition = x + 190; + this.btnReset.yPosition = y; + this.btnReset.enabled = this.keybinding.getKeyCode() != this.keybinding.getKeyCodeDefault(); + this.btnReset.drawButton(GuiKeyBindingList.this.mc, mouseX, mouseY); + this.btnChangeKeyBinding.xPosition = x + 105; + this.btnChangeKeyBinding.yPosition = y; + this.btnChangeKeyBinding.displayString = GameSettings.getKeyDisplayString(this.keybinding.getKeyCode()); + boolean flag1 = false; + + if (this.keybinding.getKeyCode() != 0) + { + for (KeyBinding keybinding : GuiKeyBindingList.this.mc.gameSettings.keyBindings) + { + if (keybinding != this.keybinding && keybinding.getKeyCode() == this.keybinding.getKeyCode()) + { + flag1 = true; + break; + } + } + } + + if (flag) + { + this.btnChangeKeyBinding.displayString = EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + this.btnChangeKeyBinding.displayString + EnumChatFormatting.WHITE + " <"; + } + else if (flag1) + { + this.btnChangeKeyBinding.displayString = EnumChatFormatting.RED + this.btnChangeKeyBinding.displayString; + } + + this.btnChangeKeyBinding.drawButton(GuiKeyBindingList.this.mc, mouseX, mouseY); + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_)) + { + GuiKeyBindingList.this.field_148191_k.buttonId = this.keybinding; + return true; + } + else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_)) + { + GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault()); + KeyBinding.resetKeyBindingArrayAndHash(); + return true; + } + else + { + return false; + } + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + this.btnChangeKeyBinding.mouseReleased(x, y); + this.btnReset.mouseReleased(x, y); + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) + { + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLabel.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLabel.java new file mode 100644 index 0000000..c304179 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLabel.java @@ -0,0 +1,95 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; + +public class GuiLabel extends Gui +{ + protected int field_146167_a = 200; + protected int field_146161_f = 20; + public int field_146162_g; + public int field_146174_h; + private List field_146173_k; + public int field_175204_i; + private boolean centered; + public boolean visible = true; + private boolean labelBgEnabled; + private int field_146168_n; + private int field_146169_o; + private int field_146166_p; + private int field_146165_q; + private FontRenderer fontRenderer; + private int field_146163_s; + + public GuiLabel(FontRenderer fontRendererObj, int p_i45540_2_, int p_i45540_3_, int p_i45540_4_, int p_i45540_5_, int p_i45540_6_, int p_i45540_7_) + { + this.fontRenderer = fontRendererObj; + this.field_175204_i = p_i45540_2_; + this.field_146162_g = p_i45540_3_; + this.field_146174_h = p_i45540_4_; + this.field_146167_a = p_i45540_5_; + this.field_146161_f = p_i45540_6_; + this.field_146173_k = Lists.newArrayList(); + this.centered = false; + this.labelBgEnabled = false; + this.field_146168_n = p_i45540_7_; + this.field_146169_o = -1; + this.field_146166_p = -1; + this.field_146165_q = -1; + this.field_146163_s = 0; + } + + public void func_175202_a(String p_175202_1_) + { + this.field_146173_k.add(I18n.format(p_175202_1_, new Object[0])); + } + + public GuiLabel setCentered() + { + this.centered = true; + return this; + } + + public void drawLabel(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + this.drawLabelBackground(mc, mouseX, mouseY); + int i = this.field_146174_h + this.field_146161_f / 2 + this.field_146163_s / 2; + int j = i - this.field_146173_k.size() * 10 / 2; + + for (int k = 0; k < this.field_146173_k.size(); ++k) + { + if (this.centered) + { + this.drawCenteredString(this.fontRenderer, (String)this.field_146173_k.get(k), this.field_146162_g + this.field_146167_a / 2, j + k * 10, this.field_146168_n); + } + else + { + this.drawString(this.fontRenderer, (String)this.field_146173_k.get(k), this.field_146162_g, j + k * 10, this.field_146168_n); + } + } + } + } + + protected void drawLabelBackground(Minecraft mcIn, int p_146160_2_, int p_146160_3_) + { + if (this.labelBgEnabled) + { + int i = this.field_146167_a + this.field_146163_s * 2; + int j = this.field_146161_f + this.field_146163_s * 2; + int k = this.field_146162_g - this.field_146163_s; + int l = this.field_146174_h - this.field_146163_s; + drawRect(k, l, k + i, l + j, this.field_146169_o); + this.drawHorizontalLine(k, k + i, l, this.field_146166_p); + this.drawHorizontalLine(k, k + i, l + j, this.field_146165_q); + this.drawVerticalLine(k, l, l + j, this.field_146166_p); + this.drawVerticalLine(k + i, l, l + j, this.field_146165_q); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLanguage.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLanguage.java new file mode 100644 index 0000000..b2a11d8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLanguage.java @@ -0,0 +1,139 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.Language; +import net.minecraft.client.resources.LanguageManager; +import net.minecraft.client.settings.GameSettings; + +public class GuiLanguage extends GuiScreen +{ + protected GuiScreen parentScreen; + private GuiLanguage.List list; + private final GameSettings game_settings_3; + private final LanguageManager languageManager; + private GuiOptionButton forceUnicodeFontBtn; + private GuiOptionButton confirmSettingsBtn; + + public GuiLanguage(GuiScreen screen, GameSettings gameSettingsObj, LanguageManager manager) + { + this.parentScreen = screen; + this.game_settings_3 = gameSettingsObj; + this.languageManager = manager; + } + + public void initGui() + { + this.buttonList.add(this.forceUnicodeFontBtn = new GuiOptionButton(100, this.width / 2 - 155, this.height - 38, GameSettings.Options.FORCE_UNICODE_FONT, this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT))); + this.buttonList.add(this.confirmSettingsBtn = new GuiOptionButton(6, this.width / 2 - 155 + 160, this.height - 38, I18n.format("gui.done", new Object[0]))); + this.list = new GuiLanguage.List(this.mc); + this.list.registerScrollButtons(7, 8); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.list.handleMouseInput(); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + switch (button.id) + { + case 5: + break; + + case 6: + this.mc.displayGuiScreen(this.parentScreen); + break; + + case 100: + if (button instanceof GuiOptionButton) + { + this.game_settings_3.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); + button.displayString = this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + this.setWorldAndResolution(this.mc, i, j); + } + + break; + + default: + this.list.actionPerformed(button); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.list.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, I18n.format("options.language", new Object[0]), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRendererObj, "(" + I18n.format("options.languageWarning", new Object[0]) + ")", this.width / 2, this.height - 56, 8421504); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + class List extends GuiSlot + { + private final java.util.List langCodeList = Lists.newArrayList(); + private final Map languageMap = Maps.newHashMap(); + + public List(Minecraft mcIn) + { + super(mcIn, GuiLanguage.this.width, GuiLanguage.this.height, 32, GuiLanguage.this.height - 65 + 4, 18); + + for (Language language : GuiLanguage.this.languageManager.getLanguages()) + { + this.languageMap.put(language.getLanguageCode(), language); + this.langCodeList.add(language.getLanguageCode()); + } + } + + protected int getSize() + { + return this.langCodeList.size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + Language language = (Language)this.languageMap.get(this.langCodeList.get(slotIndex)); + GuiLanguage.this.languageManager.setCurrentLanguage(language); + GuiLanguage.this.game_settings_3.language = language.getLanguageCode(); + this.mc.refreshResources(); + GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.languageManager.isCurrentLocaleUnicode() || GuiLanguage.this.game_settings_3.forceUnicodeFont); + GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.languageManager.isCurrentLanguageBidirectional()); + GuiLanguage.this.confirmSettingsBtn.displayString = I18n.format("gui.done", new Object[0]); + GuiLanguage.this.forceUnicodeFontBtn.displayString = GuiLanguage.this.game_settings_3.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); + GuiLanguage.this.game_settings_3.saveOptions(); + } + + protected boolean isSelected(int slotIndex) + { + return ((String)this.langCodeList.get(slotIndex)).equals(GuiLanguage.this.languageManager.getCurrentLanguage().getLanguageCode()); + } + + protected int getContentHeight() + { + return this.getSize() * 18; + } + + protected void drawBackground() + { + GuiLanguage.this.drawDefaultBackground(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + GuiLanguage.this.fontRendererObj.setBidiFlag(true); + GuiLanguage.this.drawCenteredString(GuiLanguage.this.fontRendererObj, ((Language)this.languageMap.get(this.langCodeList.get(entryID))).toString(), this.width / 2, p_180791_3_ + 1, 16777215); + GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.languageManager.getCurrentLanguage().isBidirectional()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiListButton.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiListButton.java new file mode 100644 index 0000000..15b3b5c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiListButton.java @@ -0,0 +1,47 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; + +public class GuiListButton extends GuiButton +{ + private boolean field_175216_o; + private String localizationStr; + private final GuiPageButtonList.GuiResponder guiResponder; + + public GuiListButton(GuiPageButtonList.GuiResponder responder, int p_i45539_2_, int p_i45539_3_, int p_i45539_4_, String p_i45539_5_, boolean p_i45539_6_) + { + super(p_i45539_2_, p_i45539_3_, p_i45539_4_, 150, 20, ""); + this.localizationStr = p_i45539_5_; + this.field_175216_o = p_i45539_6_; + this.displayString = this.buildDisplayString(); + this.guiResponder = responder; + } + + private String buildDisplayString() + { + return I18n.format(this.localizationStr, new Object[0]) + ": " + (this.field_175216_o ? I18n.format("gui.yes", new Object[0]) : I18n.format("gui.no", new Object[0])); + } + + public void func_175212_b(boolean p_175212_1_) + { + this.field_175216_o = p_175212_1_; + this.displayString = this.buildDisplayString(); + this.guiResponder.func_175321_a(this.id, p_175212_1_); + } + + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.field_175216_o = !this.field_175216_o; + this.displayString = this.buildDisplayString(); + this.guiResponder.func_175321_a(this.id, this.field_175216_o); + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiListExtended.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiListExtended.java new file mode 100644 index 0000000..a20f757 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiListExtended.java @@ -0,0 +1,86 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; + +public abstract class GuiListExtended extends GuiSlot +{ + public GuiListExtended(Minecraft mcIn, int widthIn, int heightIn, int topIn, int bottomIn, int slotHeightIn) + { + super(mcIn, widthIn, heightIn, topIn, bottomIn, slotHeightIn); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + } + + protected boolean isSelected(int slotIndex) + { + return false; + } + + protected void drawBackground() + { + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + this.getListEntry(entryID).drawEntry(entryID, p_180791_2_, p_180791_3_, this.getListWidth(), p_180791_4_, mouseXIn, mouseYIn, this.getSlotIndexFromScreenCoords(mouseXIn, mouseYIn) == entryID); + } + + protected void func_178040_a(int p_178040_1_, int p_178040_2_, int p_178040_3_) + { + this.getListEntry(p_178040_1_).setSelected(p_178040_1_, p_178040_2_, p_178040_3_); + } + + public boolean mouseClicked(int mouseX, int mouseY, int mouseEvent) + { + if (this.isMouseYWithinSlotBounds(mouseY)) + { + int i = this.getSlotIndexFromScreenCoords(mouseX, mouseY); + + if (i >= 0) + { + int j = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + int k = this.top + 4 - this.getAmountScrolled() + i * this.slotHeight + this.headerPadding; + int l = mouseX - j; + int i1 = mouseY - k; + + if (this.getListEntry(i).mousePressed(i, mouseX, mouseY, mouseEvent, l, i1)) + { + this.setEnabled(false); + return true; + } + } + } + + return false; + } + + public boolean mouseReleased(int p_148181_1_, int p_148181_2_, int p_148181_3_) + { + for (int i = 0; i < this.getSize(); ++i) + { + int j = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + int k = this.top + 4 - this.getAmountScrolled() + i * this.slotHeight + this.headerPadding; + int l = p_148181_1_ - j; + int i1 = p_148181_2_ - k; + this.getListEntry(i).mouseReleased(i, p_148181_1_, p_148181_2_, p_148181_3_, l, i1); + } + + this.setEnabled(true); + return false; + } + + public abstract GuiListExtended.IGuiListEntry getListEntry(int index); + + public interface IGuiListEntry + { + void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_); + + void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected); + + boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_); + + void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLockIconButton.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLockIconButton.java new file mode 100644 index 0000000..ebb652c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiLockIconButton.java @@ -0,0 +1,94 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; + +public class GuiLockIconButton extends GuiButton +{ + private boolean field_175231_o = false; + + public GuiLockIconButton(int p_i45538_1_, int p_i45538_2_, int p_i45538_3_) + { + super(p_i45538_1_, p_i45538_2_, p_i45538_3_, 20, 20, ""); + } + + public boolean func_175230_c() + { + return this.field_175231_o; + } + + public void func_175229_b(boolean p_175229_1_) + { + this.field_175231_o = p_175229_1_; + } + + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + mc.getTextureManager().bindTexture(GuiButton.buttonTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + GuiLockIconButton.Icon guilockiconbutton$icon; + + if (this.field_175231_o) + { + if (!this.enabled) + { + guilockiconbutton$icon = GuiLockIconButton.Icon.LOCKED_DISABLED; + } + else if (flag) + { + guilockiconbutton$icon = GuiLockIconButton.Icon.LOCKED_HOVER; + } + else + { + guilockiconbutton$icon = GuiLockIconButton.Icon.LOCKED; + } + } + else if (!this.enabled) + { + guilockiconbutton$icon = GuiLockIconButton.Icon.UNLOCKED_DISABLED; + } + else if (flag) + { + guilockiconbutton$icon = GuiLockIconButton.Icon.UNLOCKED_HOVER; + } + else + { + guilockiconbutton$icon = GuiLockIconButton.Icon.UNLOCKED; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, guilockiconbutton$icon.func_178910_a(), guilockiconbutton$icon.func_178912_b(), this.width, this.height); + } + } + + static enum Icon + { + LOCKED(0, 146), + LOCKED_HOVER(0, 166), + LOCKED_DISABLED(0, 186), + UNLOCKED(20, 146), + UNLOCKED_HOVER(20, 166), + UNLOCKED_DISABLED(20, 186); + + private final int field_178914_g; + private final int field_178920_h; + + private Icon(int p_i45537_3_, int p_i45537_4_) + { + this.field_178914_g = p_i45537_3_; + this.field_178920_h = p_i45537_4_; + } + + public int func_178910_a() + { + return this.field_178914_g; + } + + public int func_178912_b() + { + return this.field_178920_h; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMainMenu.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMainMenu.java new file mode 100644 index 0000000..b5790b3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMainMenu.java @@ -0,0 +1,603 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ImageButtonElement; +import com.cheatbreaker.client.ui.mainmenu.buttons.MainMenuAccountButton; +import com.cheatbreaker.client.ui.mainmenu.buttons.MainMenuButton; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.realms.RealmsBridge; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import net.optifine.CustomPanorama; +import net.optifine.CustomPanoramaProperties; +import net.optifine.reflect.Reflector; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +import java.io.*; +import java.net.URI; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { + private static final AtomicInteger field_175373_f = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private static final Random RANDOM = new Random(); + + /** + * Counts the number of screen updates. + */ + private float updateCounter; + + /** + * The splash message. + */ + private String splashText; + private GuiButton buttonResetDemo; + + /** + * Timer used to rotate the panorama, increases every tick. + */ + private int panoramaTimer; + + /** + * Texture allocated for the current viewport of the main menu's panorama background. + */ + private DynamicTexture viewportTexture; + private boolean field_175375_v = true; + + /** + * The Object object utilized as a thread lock when performing non thread-safe operations + */ + private final Object threadLock = new Object(); + + /** + * OpenGL graphics card warning. + */ + private String openGLWarning1; + + /** + * OpenGL graphics card warning. + */ + private String openGLWarning2; + + /** + * Link to the Mojang Support about minimum requirements + */ + private String openGLWarningLink; + private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); + private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); + + /** + * An array of all the paths to the panorama pictures. + */ + private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; + public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; + private int field_92024_r; + private int field_92023_s; + private int field_92022_t; + private int field_92021_u; + private int field_92020_v; + private int field_92019_w; + private ResourceLocation backgroundTexture; + + private final List mainButtons = new ArrayList(); + private MainMenuAccountButton accountButton; + private boolean lIIIlllIlIlllIIIIIIIIIlII = false; + + public GuiMainMenu() { + this.openGLWarning2 = field_96138_a; + this.splashText = "missingno"; + BufferedReader bufferedreader = null; + + try { + List list = Lists.newArrayList(); + bufferedreader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); + String s; + + while ((s = bufferedreader.readLine()) != null) { + s = s.trim(); + + if (!s.isEmpty()) { + list.add(s); + } + } + + if (!list.isEmpty()) { + while (true) { + this.splashText = (String) list.get(RANDOM.nextInt(list.size())); + + if (this.splashText.hashCode() != 125780783) { + break; + } + } + } + } catch (IOException var12) { + ; + } finally { + if (bufferedreader != null) { + try { + bufferedreader.close(); + } catch (IOException var11) { + ; + } + } + } + + this.updateCounter = RANDOM.nextFloat(); + this.openGLWarning1 = ""; + + if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.areShadersSupported()) { + this.openGLWarning1 = I18n.format("title.oldgl1", new Object[0]); + this.openGLWarning2 = I18n.format("title.oldgl2", new Object[0]); + this.openGLWarningLink = "https://help.mojang.com/customer/portal/articles/325948?ref=game"; + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + ++this.panoramaTimer; + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return false; + } + + /** + * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code) + */ + protected void keyTyped(char typedChar, int keyCode) throws IOException { + } + + /** + * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the + * window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + String string; + Object object3; + Object object2; + this.viewportTexture = new DynamicTexture(256, 256); + this.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + this.buttonList.add(new MainMenuButton(0, 45, 0, 50, 25, "OPTIONS", false)); + this.buttonList.add(new MainMenuButton(5, 95, 0, 50, 25, "LANGUAGE", false)); + this.buttonList.add(new MainMenuButton(66, 145, 0, 65, 25, "COSMETICS", false)); + this.buttonList.add(new MainMenuButton(67, 195, 0, 65, 25, "EMOTES", false)); + this.buttonList.add(new ImageButtonElement(4, new ResourceLocation("client/icons/exit-64.png"), this.width - 65, 0, 65, 25, "EXIT", false)); + File file = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + ArrayList> accountList = new ArrayList<>(); + if (file.exists()) { + try { + FileReader fileReader = new FileReader(file); + object2 = new JsonParser(); + object3 = ((JsonParser) object2).parse(fileReader); + string = ""; + for (Map.Entry entry : ((JsonElement) object3).getAsJsonObject().entrySet()) { + if (entry.getKey().equalsIgnoreCase("clientToken")) { + string = entry.getValue().getAsString(); + } + if (!entry.getKey().equalsIgnoreCase("authenticationDatabase")) continue; + for (Map.Entry entry2 : entry.getValue().getAsJsonObject().entrySet()) { + HashMap hashMap = new HashMap(); + hashMap.put("clientToken", string); + for (Map.Entry entry3 : entry2.getValue().getAsJsonObject().entrySet()) { + if (entry3.getKey().equalsIgnoreCase("profiles")) { + for (Map.Entry entry4 : entry3.getValue().getAsJsonObject().entrySet()) { + hashMap.put("uuid", entry4.getKey()); + for (Map.Entry entry5 : entry4.getValue().getAsJsonObject().entrySet()) { + hashMap.put("displayName", entry5.getValue().getAsString()); + } + } + continue; + } + if (!entry3.getKey().equalsIgnoreCase("username") && + !entry3.getKey().equalsIgnoreCase("displayName") && !entry3.getKey().equalsIgnoreCase("uuid") && !entry3.getKey().equalsIgnoreCase("accessToken")) + continue; + hashMap.put(entry3.getKey(), entry3.getValue().getAsString()); + } + accountList.add(hashMap); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + this.accountButton = null; + this.mainButtons.clear(); + int n = 0; + for (Map accountMap : accountList) { + String accountName = accountMap.get("displayName"); + MainMenuAccountButton mainMenuAccountButton = new MainMenuAccountButton(50, accountMap, this.width - 200, n * 25, 130, 25); + this.mainButtons.add(mainMenuAccountButton); + if (this.mc.getSession() != null && accountName.equalsIgnoreCase(this.mc.getSession().getUsername())) { + this.accountButton = mainMenuAccountButton; + if (n != 0) { + MainMenuAccountButton entry = (MainMenuAccountButton) this.mainButtons.get(0); + entry.yPosition = n * 25; + this.accountButton.yPosition = 0; + } + } + ++n; + } + if (this.accountButton == null && !this.mainButtons.isEmpty()) { + this.accountButton = (MainMenuAccountButton) this.mainButtons.get(0); + } + object2 = this.threadLock; + object3 = this.threadLock; + synchronized (object3) { + this.field_92023_s = this.fontRendererObj.getStringWidth(this.openGLWarning1); + this.field_92024_r = this.fontRendererObj.getStringWidth(this.openGLWarning2); + int n2 = Math.max(this.field_92023_s, this.field_92024_r); + this.field_92022_t = (this.width - n2) / 2; + this.field_92021_u = this.buttonList.get(0).yPosition - 24; + this.field_92020_v = this.field_92022_t + n2; + this.field_92019_w = this.field_92021_u + 24; + } + } + + /** + * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. + */ + protected void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_) { + this.buttonList.add(new MainMenuButton(1, this.width / 2 - 65, p_73969_1_ + 24, 130, 24, I18n.format("menu.singleplayer"))); + this.buttonList.add(new MainMenuButton(2, this.width / 2 - 65, p_73969_1_ + 52, 130, 24, I18n.format("menu.multiplayer"))); + } + + /** + * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) + */ + protected void actionPerformed(GuiButton button) throws IOException { + if (button.id == 0) { + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } + + if (button.id == 5) { + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } + + if (button.id == 1) { + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } + + if (button.id == 2) { + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } + + if (button.id == 4) { + this.mc.shutdown(); + } + + if (button.id == 6 && Reflector.GuiModList_Constructor.exists()) { + this.mc.displayGuiScreen((GuiScreen) Reflector.newInstance(Reflector.GuiModList_Constructor, new Object[]{this})); + } + + if (button.id == 11) { + this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); + } + + if (button.id == 12) { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); + + if (worldinfo != null) { + GuiYesNo guiyesno = GuiSelectWorld.makeDeleteWorldYesNo(this, worldinfo.getWorldName(), 12); + this.mc.displayGuiScreen(guiyesno); + } + } + } + + private void f() { + RealmsBridge realmsbridge = new RealmsBridge(); + realmsbridge.switchToRealms(this); + } + + public void confirmClicked(boolean result, int id) { + if (result && id == 12) { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.flushCache(); + isaveformat.deleteWorldDirectory("Demo_World"); + this.mc.displayGuiScreen(this); + } else if (id == 13) { + if (result) { + try { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object) null, new Object[0]); + oclass.getMethod("browse", new Class[]{URI.class}).invoke(object, new Object[]{new URI(this.openGLWarningLink)}); + } catch (Throwable throwable) { + logger.error("Couldn\'t open link", throwable); + } + } + + this.mc.displayGuiScreen(this); + } + } + + /** + * Draws the main menu panorama + */ + private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.matrixMode(5889); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.disableCull(); + GlStateManager.depthMask(false); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + int i = 8; + int j = 64; + CustomPanoramaProperties custompanoramaproperties = CustomPanorama.getCustomPanoramaProperties(); + + if (custompanoramaproperties != null) { + j = custompanoramaproperties.getBlur1(); + } + + for (int k = 0; k < j; ++k) { + GlStateManager.pushMatrix(); + float f = ((float) (k % i) / (float) i - 0.5F) / 64.0F; + float f1 = ((float) (k / i) / (float) i - 0.5F) / 64.0F; + float f2 = 0.0F; + GlStateManager.translate(f, f1, f2); + GlStateManager.rotate(MathHelper.sin(((float) this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-((float) this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F); + + for (int l = 0; l < 6; ++l) { + GlStateManager.pushMatrix(); + + if (l == 1) { + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + } + + if (l == 2) { + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + } + + if (l == 3) { + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + } + + if (l == 4) { + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (l == 5) { + GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); + } + + ResourceLocation[] aresourcelocation = titlePanoramaPaths; + + if (custompanoramaproperties != null) { + aresourcelocation = custompanoramaproperties.getPanoramaLocations(); + } + + this.mc.getTextureManager().bindTexture(aresourcelocation[l]); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + int i1 = 255 / (k + 1); + float f3 = 0.0F; + worldrenderer.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).color(255, 255, 255, i1).endVertex(); + worldrenderer.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).color(255, 255, 255, i1).endVertex(); + worldrenderer.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).color(255, 255, 255, i1).endVertex(); + worldrenderer.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).color(255, 255, 255, i1).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + } + + GlStateManager.popMatrix(); + GlStateManager.colorMask(true, true, true, false); + } + + worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.matrixMode(5889); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + GlStateManager.enableCull(); + GlStateManager.enableDepth(); + } + + /** + * Rotate and blurs the skybox view in the main menu + */ + private void rotateAndBlurSkybox(float p_73968_1_) { + this.mc.getTextureManager().bindTexture(this.backgroundTexture); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.colorMask(true, true, true, false); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + GlStateManager.disableAlpha(); + int i = 3; + int j = 3; + CustomPanoramaProperties custompanoramaproperties = CustomPanorama.getCustomPanoramaProperties(); + + if (custompanoramaproperties != null) { + j = custompanoramaproperties.getBlur2(); + } + + for (int k = 0; k < j; ++k) { + float f = 1.0F / (float) (k + 1); + int l = this.width; + int i1 = this.height; + float f1 = (float) (k - i / 2) / 256.0F; + worldrenderer.pos((double) l, (double) i1, (double) this.zLevel).tex((double) (0.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + worldrenderer.pos((double) l, 0.0D, (double) this.zLevel).tex((double) (1.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + worldrenderer.pos(0.0D, 0.0D, (double) this.zLevel).tex((double) (1.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + worldrenderer.pos(0.0D, (double) i1, (double) this.zLevel).tex((double) (0.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex(); + } + + tessellator.draw(); + GlStateManager.enableAlpha(); + GlStateManager.colorMask(true, true, true, true); + } + + /** + * Renders the skybox in the main menu + */ + private void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_) { + this.mc.getFramebuffer().unbindFramebuffer(); + GlStateManager.viewport(0, 0, 256, 256); + this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + int i = 3; + CustomPanoramaProperties custompanoramaproperties = CustomPanorama.getCustomPanoramaProperties(); + + if (custompanoramaproperties != null) { + i = custompanoramaproperties.getBlur3(); + } + + for (int j = 0; j < i; ++j) { + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + } + + this.mc.getFramebuffer().bindFramebuffer(true); + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + float f2 = this.width > this.height ? 120.0F / (float) this.width : 120.0F / (float) this.height; + float f = (float) this.height * f2 / 256.0F; + float f1 = (float) this.width * f2 / 256.0F; + int k = this.width; + int l = this.height; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double) l, (double) this.zLevel).tex((double) (0.5F - f), (double) (0.5F + f1)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos((double) k, (double) l, (double) this.zLevel).tex((double) (0.5F - f), (double) (0.5F - f1)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos((double) k, 0.0D, (double) this.zLevel).tex((double) (0.5F + f), (double) (0.5F - f1)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos(0.0D, 0.0D, (double) this.zLevel).tex((double) (0.5F + f), (double) (0.5F + f1)).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + tessellator.draw(); + } + + /** + * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GlStateManager.disableAlpha(); + this.renderSkybox(mouseX, mouseY, partialTicks); + GlStateManager.enableAlpha(); + int n3 = 274; + int n4 = this.width / 2 - n3 / 2; + int n5 = 30; + drawGradientRect(0.0f, 0.0f, (float) this.width, (float) this.height, 0x5FFFFFFF, 0x2FFFFFFF); + drawRect(0.0f, 0.0f, this.width, 25, -819846622); + String string = "CheatBreaker " + CheatBreaker.getInstance().getGitBuildVersion() + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")"; + this.drawString(this.fontRendererObj, string, 2, this.height - 10, -1); + String string2 = "Copyright Mojang AB. Do not distribute!"; + this.drawString(this.fontRendererObj, string2, this.width - this.fontRendererObj.getStringWidth(string2) - 2, this.height - 10, -1); + if (this.openGLWarning1 != null && this.openGLWarning1.length() > 0) { + drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 0x55200000); + this.drawString(this.fontRendererObj, this.openGLWarning1, this.field_92022_t, this.field_92021_u, -1); + this.drawString(this.fontRendererObj, this.openGLWarning2, (this.width - this.field_92024_r) / 2, this.buttonList.get(0).yPosition - 12, -1); + } + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + float f2 = 30; + float f3 = 15; + float f4 = 0.0f; + float f5 = 0.0f; + float f6 = 10; + float f7 = 5; + GL11.glEnable(3042); + this.mc.renderEngine.bindTexture(new ResourceLocation("client/icons/cb.png")); + GL11.glBegin(7); + GL11.glTexCoord2d(f4 / (float) 5, f5 / (float) 5); + GL11.glVertex2d(f6, f7); + GL11.glTexCoord2d(f4 / (float) 5, (f5 + (float) 5) / (float) 5); + GL11.glVertex2d(f6, f7 + f3); + GL11.glTexCoord2d((f4 + (float) 5) / (float) 5, (f5 + (float) 5) / (float) 5); + GL11.glVertex2d(f6 + f2, f7 + f3); + GL11.glTexCoord2d((f4 + (float) 5) / (float) 5, f5 / (float) 5); + GL11.glVertex2d(f6 + f2, f7); + GL11.glEnd(); + GL11.glDisable(3042); + GL11.glPopMatrix(); + } + + protected void lIIIIIIIIIlIllIIllIlIIlIl(int n, int n2) { + int n3; + for (n3 = 0; n3 < this.buttonList.size(); ++n3) { + this.buttonList.get(n3).drawButton(this.mc, n, n2); + } + for (n3 = 0; n3 < this.labelList.size(); ++n3) { + this.labelList.get(n3).drawLabel(this.mc, n, n2); + } + if (this.accountButton != null) { + this.lIIIlllIlIlllIIIIIIIIIlII = !this.lIIIlllIlIlllIIIIIIIIIlII ? n > this.accountButton.xPosition && n < this.accountButton.xPosition + this.accountButton.getWidth() && n2 > this.accountButton.yPosition && n2 < this.accountButton.yPosition + this.accountButton.getHeight() : n > this.accountButton.xPosition && n < this.accountButton.xPosition + this.accountButton.getWidth() && n2 > this.accountButton.yPosition && n2 < this.accountButton.yPosition + 25 * this.mainButtons.size(); + this.accountButton.drawButton(this.mc, n, n2); + if (this.lIIIlllIlIlllIIIIIIIIIlII) { + int n4 = this.mainButtons.size(); + int n5 = this.accountButton.getHeight(); + for (int i = 0; i < n4; ++i) { + MainMenuAccountButton mainMenuAccountButton = (MainMenuAccountButton) this.mainButtons.get(i); + if (mainMenuAccountButton != this.accountButton) { + mainMenuAccountButton.drawButton(this.mc, n, n2); + } + n5 += mainMenuAccountButton.getHeight(); + } + } + } + } + + /** + * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + + synchronized (this.threadLock) { + if (this.openGLWarning1.length() > 0 && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w) { + GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.openGLWarningLink, 13, true); + guiconfirmopenlink.disableSecurityWarning(); + this.mc.displayGuiScreen(guiconfirmopenlink); + } + } + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java new file mode 100644 index 0000000..9f88068 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java @@ -0,0 +1,45 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; + +public class GuiMemoryErrorScreen extends GuiScreen +{ + public void initGui() + { + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.format("gui.toTitle", new Object[0]))); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.format("menu.quit", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 0) + { + this.mc.displayGuiScreen(new GuiMainMenu()); + } + else if (button.id == 1) + { + this.mc.shutdown(); + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, "Out of memory!", this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.drawString(this.fontRendererObj, "Minecraft has run out of memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 0, 10526880); + this.drawString(this.fontRendererObj, "This could be caused by a bug in the game or by the", this.width / 2 - 140, this.height / 4 - 60 + 60 + 18, 10526880); + this.drawString(this.fontRendererObj, "Java Virtual Machine not being allocated enough", this.width / 2 - 140, this.height / 4 - 60 + 60 + 27, 10526880); + this.drawString(this.fontRendererObj, "memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 36, 10526880); + this.drawString(this.fontRendererObj, "To prevent level corruption, the current game has quit.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 54, 10526880); + this.drawString(this.fontRendererObj, "We\'ve tried to free up enough memory to let you go back to", this.width / 2 - 140, this.height / 4 - 60 + 60 + 63, 10526880); + this.drawString(this.fontRendererObj, "the main menu and back to playing, but this may not have worked.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 72, 10526880); + this.drawString(this.fontRendererObj, "Please restart the game if you see this message again.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 81, 10526880); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMerchant.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMerchant.java new file mode 100644 index 0000000..394f079 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMerchant.java @@ -0,0 +1,241 @@ +package net.minecraft.client.gui; + +import io.netty.buffer.Unpooled; +import java.io.IOException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GuiMerchant extends GuiContainer +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation MERCHANT_GUI_TEXTURE = new ResourceLocation("textures/gui/container/villager.png"); + private IMerchant merchant; + private GuiMerchant.MerchantButton nextButton; + private GuiMerchant.MerchantButton previousButton; + private int selectedMerchantRecipe; + private IChatComponent chatComponent; + + public GuiMerchant(InventoryPlayer p_i45500_1_, IMerchant p_i45500_2_, World worldIn) + { + super(new ContainerMerchant(p_i45500_1_, p_i45500_2_, worldIn)); + this.merchant = p_i45500_2_; + this.chatComponent = p_i45500_2_.getDisplayName(); + } + + public void initGui() + { + super.initGui(); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.buttonList.add(this.nextButton = new GuiMerchant.MerchantButton(1, i + 120 + 27, j + 24 - 1, true)); + this.buttonList.add(this.previousButton = new GuiMerchant.MerchantButton(2, i + 36 - 19, j + 24 - 1, false)); + this.nextButton.enabled = false; + this.previousButton.enabled = false; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + String s = this.chatComponent.getUnformattedText(); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + public void updateScreen() + { + super.updateScreen(); + MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer); + + if (merchantrecipelist != null) + { + this.nextButton.enabled = this.selectedMerchantRecipe < merchantrecipelist.size() - 1; + this.previousButton.enabled = this.selectedMerchantRecipe > 0; + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + boolean flag = false; + + if (button == this.nextButton) + { + ++this.selectedMerchantRecipe; + MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer); + + if (merchantrecipelist != null && this.selectedMerchantRecipe >= merchantrecipelist.size()) + { + this.selectedMerchantRecipe = merchantrecipelist.size() - 1; + } + + flag = true; + } + else if (button == this.previousButton) + { + --this.selectedMerchantRecipe; + + if (this.selectedMerchantRecipe < 0) + { + this.selectedMerchantRecipe = 0; + } + + flag = true; + } + + if (flag) + { + ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.selectedMerchantRecipe); + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + packetbuffer.writeInt(this.selectedMerchantRecipe); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|TrSel", packetbuffer)); + } + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(MERCHANT_GUI_TEXTURE); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer); + + if (merchantrecipelist != null && !merchantrecipelist.isEmpty()) + { + int k = this.selectedMerchantRecipe; + + if (k < 0 || k >= merchantrecipelist.size()) + { + return; + } + + MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k); + + if (merchantrecipe.isRecipeDisabled()) + { + this.mc.getTextureManager().bindTexture(MERCHANT_GUI_TEXTURE); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableLighting(); + this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21); + this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer); + + if (merchantrecipelist != null && !merchantrecipelist.isEmpty()) + { + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + int k = this.selectedMerchantRecipe; + MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k); + ItemStack itemstack = merchantrecipe.getItemToBuy(); + ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy(); + ItemStack itemstack2 = merchantrecipe.getItemToSell(); + GlStateManager.pushMatrix(); + RenderHelper.enableGUIStandardItemLighting(); + GlStateManager.disableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableColorMaterial(); + GlStateManager.enableLighting(); + this.itemRender.zLevel = 100.0F; + this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24); + this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24); + + if (itemstack1 != null) + { + this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24); + this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24); + } + + this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24); + this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24); + this.itemRender.zLevel = 0.0F; + GlStateManager.disableLighting(); + + if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && itemstack != null) + { + this.renderToolTip(itemstack, mouseX, mouseY); + } + else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && itemstack1 != null) + { + this.renderToolTip(itemstack1, mouseX, mouseY); + } + else if (itemstack2 != null && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && itemstack2 != null) + { + this.renderToolTip(itemstack2, mouseX, mouseY); + } + else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY))) + { + this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY); + } + + GlStateManager.popMatrix(); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + RenderHelper.enableStandardItemLighting(); + } + } + + public IMerchant getMerchant() + { + return this.merchant; + } + + static class MerchantButton extends GuiButton + { + private final boolean field_146157_o; + + public MerchantButton(int buttonID, int x, int y, boolean p_i1095_4_) + { + super(buttonID, x, y, 12, 19, ""); + this.field_146157_o = p_i1095_4_; + } + + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + mc.getTextureManager().bindTexture(GuiMerchant.MERCHANT_GUI_TEXTURE); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int i = 0; + int j = 176; + + if (!this.enabled) + { + j += this.width * 2; + } + else if (flag) + { + j += this.width; + } + + if (!this.field_146157_o) + { + i += this.height; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, j, i, this.width, this.height); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java new file mode 100644 index 0000000..52f925d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java @@ -0,0 +1,382 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.menus.MainMenu; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import com.cheatbreaker.client.ui.warning.UnsafeServerWarningGUI; +import com.cheatbreaker.client.util.render.serverlist.ServerListEntryPinned; +import com.cheatbreaker.client.util.render.serverlist.UnsafeServerAction; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.LanServerDetector; +import net.minecraft.client.network.OldServerPinger; +import net.minecraft.client.resources.I18n; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; + +import java.io.IOException; +import java.util.List; + +public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { + private static final Logger logger = LogManager.getLogger(); + private final OldServerPinger oldServerPinger = new OldServerPinger(); + private GuiScreen parentScreen; + private ServerSelectionList serverListSelector; + private ServerList savedServerList; + private GuiButton btnEditServer; + private GuiButton btnSelectServer; + private GuiButton btnDeleteServer; + private boolean deletingServer; + private boolean addingServer; + private boolean editingServer; + private boolean directConnect; + private String hoveringText; + private ServerData selectedServer; + private LanServerDetector.LanServerList lanServerList; + private LanServerDetector.ThreadLanServerFind lanServerDetector; + private boolean initialized; + + public GuiMultiplayer(GuiScreen parentScreen) { + this.parentScreen = parentScreen; + } + + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + + if (!this.initialized) { + this.initialized = true; + this.savedServerList = new ServerList(this.mc); + this.savedServerList.loadServerList(); + this.lanServerList = new LanServerDetector.LanServerList(); + + try { + this.lanServerDetector = new LanServerDetector.ThreadLanServerFind(this.lanServerList); + this.lanServerDetector.start(); + } catch (Exception exception) { + logger.warn("Unable to start LAN server detection: " + exception.getMessage()); + } + + this.serverListSelector = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36); + this.serverListSelector.func_148195_a(this.savedServerList); + } else { + this.serverListSelector.setDimensions(this.width, this.height, 32, this.height - 64); + } + + this.createButtons(); + } + + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + this.serverListSelector.handleMouseInput(); + } + + public void createButtons() { + this.buttonList.add(this.btnEditServer = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.format("selectServer.edit", new Object[0]))); + this.buttonList.add(this.btnDeleteServer = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.format("selectServer.delete", new Object[0]))); + this.buttonList.add(this.btnSelectServer = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.format("selectServer.select", new Object[0]))); + this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.format("selectServer.direct", new Object[0]))); + this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.format("selectServer.add", new Object[0]))); + this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.format("selectServer.refresh", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.format("gui.cancel", new Object[0]))); + this.selectServer(this.serverListSelector.func_148193_k()); + } + + public void updateScreen() { + super.updateScreen(); + + if (this.lanServerList.getWasUpdated()) { + List list = this.lanServerList.getLanServers(); + this.lanServerList.setWasNotUpdated(); + this.serverListSelector.func_148194_a(list); + } + + this.oldServerPinger.pingPendingNetworks(); + } + + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + + if (this.lanServerDetector != null) { + this.lanServerDetector.interrupt(); + this.lanServerDetector = null; + } + + this.oldServerPinger.clearPendingNetworks(); + } + + protected void actionPerformed(GuiButton button) throws IOException { + if (button.enabled) { + GuiListExtended.IGuiListEntry guilistextended$iguilistentry = this.serverListSelector.func_148193_k() < 0 ? null : this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k()); + + if (button.id == 2 && guilistextended$iguilistentry instanceof ServerListEntryNormal) { + String s4 = ((ServerListEntryNormal) guilistextended$iguilistentry).getServerData().serverName; + + if (s4 != null) { + this.deletingServer = true; + String s = I18n.format("selectServer.deleteQuestion", new Object[0]); + String s1 = "\'" + s4 + "\' " + I18n.format("selectServer.deleteWarning", new Object[0]); + String s2 = I18n.format("selectServer.deleteButton", new Object[0]); + String s3 = I18n.format("gui.cancel", new Object[0]); + GuiYesNo guiyesno = new GuiYesNo(this, s, s1, s2, s3, this.serverListSelector.func_148193_k()); + this.mc.displayGuiScreen(guiyesno); + } + } else if (button.id == 1) { + this.connectToSelected(); + } else if (button.id == 4) { + this.directConnect = true; + this.mc.displayGuiScreen(new GuiScreenServerList(this, this.selectedServer = new ServerData(I18n.format("selectServer.defaultName", new Object[0]), "", false))); + } else if (button.id == 3) { + this.addingServer = true; + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.selectedServer = new ServerData(I18n.format("selectServer.defaultName", new Object[0]), "", false))); + } else if (button.id == 7 && guilistextended$iguilistentry instanceof ServerListEntryNormal) { + this.editingServer = true; + ServerData serverdata = ((ServerListEntryNormal) guilistextended$iguilistentry).getServerData(); + this.selectedServer = new ServerData(serverdata.serverName, serverdata.serverIP, false); + this.selectedServer.copyFrom(serverdata); + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.selectedServer)); + } else if (button.id == 0) { + if (this.mc.isSingleplayer() || (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null)) { + this.mc.displayGuiScreen(this.parentScreen); + } else { + this.mc.displayGuiScreen(new MainMenu()); + } + } else if (button.id == 8) { + this.refreshServerList(); + } + } + } + + private void refreshServerList() { + this.mc.displayGuiScreen(new GuiMultiplayer(this.parentScreen)); + } + + public void confirmClicked(boolean result, int id) { + GuiListExtended.IGuiListEntry guilistextended$iguilistentry = this.serverListSelector.func_148193_k() < 0 ? null : this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k()); + + if (this.deletingServer) { + this.deletingServer = false; + + if (result && guilistextended$iguilistentry instanceof ServerListEntryNormal) { + this.savedServerList.removeServerData(this.serverListSelector.func_148193_k()); + this.savedServerList.saveServerList(); + this.serverListSelector.setSelectedSlotIndex(-1); + this.serverListSelector.func_148195_a(this.savedServerList); + } + + this.mc.displayGuiScreen(this); + } else if (this.directConnect) { + this.directConnect = false; + + if (result) { + this.connectToServer(this.selectedServer); + } else { + this.mc.displayGuiScreen(this); + } + } else if (this.addingServer) { + this.addingServer = false; + + if (result) { + this.savedServerList.addServerData(this.selectedServer); + this.savedServerList.saveServerList(); + this.serverListSelector.setSelectedSlotIndex(-1); + this.serverListSelector.func_148195_a(this.savedServerList); + } + + this.mc.displayGuiScreen(this); + } else if (this.editingServer) { + this.editingServer = false; + + if (result && (guilistextended$iguilistentry instanceof ServerListEntryNormal || guilistextended$iguilistentry instanceof ServerListEntryPinned)) { + ServerData serverdata = ((ServerListEntryNormal) guilistextended$iguilistentry).getServerData(); + serverdata.serverName = this.selectedServer.serverName; + serverdata.serverIP = this.selectedServer.serverIP; + serverdata.copyFrom(this.selectedServer); + this.savedServerList.saveServerList(); + this.serverListSelector.func_148195_a(this.savedServerList); + } + + this.mc.displayGuiScreen(this); + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException { + int i = this.serverListSelector.func_148193_k(); + GuiListExtended.IGuiListEntry guilistextended$iguilistentry = i < 0 ? null : this.serverListSelector.getListEntry(i); + + if (keyCode == 63) { + this.refreshServerList(); + } else { + if (i >= 0) { + if (keyCode == 200) { + if (isShiftKeyDown()) { + if (i > 0 && guilistextended$iguilistentry instanceof ServerListEntryNormal) { + this.savedServerList.swapServers(i, i - 1); + this.selectServer(this.serverListSelector.func_148193_k() - 1); + this.serverListSelector.scrollBy(-this.serverListSelector.getSlotHeight()); + this.serverListSelector.func_148195_a(this.savedServerList); + } + } else if (i > 0) { + this.selectServer(this.serverListSelector.func_148193_k() - 1); + this.serverListSelector.scrollBy(-this.serverListSelector.getSlotHeight()); + + if (this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k()) instanceof ServerListEntryLanScan) { + if (this.serverListSelector.func_148193_k() > 0) { + this.selectServer(this.serverListSelector.getSize() - 1); + this.serverListSelector.scrollBy(-this.serverListSelector.getSlotHeight()); + } else { + this.selectServer(-1); + } + } + } else { + this.selectServer(-1); + } + } else if (keyCode == 208) { + if (isShiftKeyDown()) { + if (i < this.savedServerList.countServers() - 1) { + this.savedServerList.swapServers(i, i + 1); + this.selectServer(i + 1); + this.serverListSelector.scrollBy(this.serverListSelector.getSlotHeight()); + this.serverListSelector.func_148195_a(this.savedServerList); + } + } else if (i < this.serverListSelector.getSize()) { + this.selectServer(this.serverListSelector.func_148193_k() + 1); + this.serverListSelector.scrollBy(this.serverListSelector.getSlotHeight()); + + if (this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k()) instanceof ServerListEntryLanScan) { + if (this.serverListSelector.func_148193_k() < this.serverListSelector.getSize() - 1) { + this.selectServer(this.serverListSelector.getSize() + 1); + this.serverListSelector.scrollBy(this.serverListSelector.getSlotHeight()); + } else { + this.selectServer(-1); + } + } + } else { + this.selectServer(-1); + } + } else if (keyCode != 28 && keyCode != 156) { + super.keyTyped(typedChar, keyCode); + } else { + this.actionPerformed((GuiButton) this.buttonList.get(2)); + } + } else { + super.keyTyped(typedChar, keyCode); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.hoveringText = null; + this.drawDefaultBackground(); + this.serverListSelector.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.title"), this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + + if (this.hoveringText != null) { + this.drawHoveringText(Lists.newArrayList(Splitter.on("\n").split(this.hoveringText)), mouseX, mouseY); + } + } + + public void connectToSelected() { + GuiListExtended.IGuiListEntry guilistextended$iguilistentry = this.serverListSelector.func_148193_k() < 0 ? null : this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k()); + + if (guilistextended$iguilistentry instanceof ServerListEntryNormal) { + this.connectToServer(((ServerListEntryNormal) guilistextended$iguilistentry).getServerData()); + } else if (guilistextended$iguilistentry instanceof ServerListEntryPinned) { + this.connectToServer(((ServerListEntryPinned)guilistextended$iguilistentry).getServer()); + } else if (guilistextended$iguilistentry instanceof ServerListEntryLanDetected) { + LanServerDetector.LanServer lanserverdetector$lanserver = ((ServerListEntryLanDetected) guilistextended$iguilistentry).getLanServer(); + this.connectToServer(new ServerData(lanserverdetector$lanserver.getServerMotd(), lanserverdetector$lanserver.getServerIpPort(), true)); + } + } + + private void connectToServer(ServerData server) { + if (this.mc.currentServerData != null && this.mc.theWorld != null) { + Minecraft.getMinecraft().ingameGUI.setDisplayedTitle(""); + Minecraft.getMinecraft().ingameGUI.setDisplayedSubTitle(""); + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld(null); + } + for (String[] string : CheatBreaker.getInstance().getGlobalSettings().getUnsafeServers()) { + if (!server.serverIP.toLowerCase().startsWith(string[0].toLowerCase()) && !server.serverIP.toLowerCase().matches("([a-zA-Z0-9]+)" + string[0].toLowerCase() + "([a-zA-Z0-9]+)")) continue; + this.mc.displayGuiScreen(new UnsafeServerWarningGUI(this, server, string[1], string[2].equals(String.valueOf(UnsafeServerAction.BLOCK)))); + return; + } + this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, server)); + } + + public void selectServer(int index) { + this.serverListSelector.setSelectedSlotIndex(index); + GuiListExtended.IGuiListEntry guilistextended$iguilistentry = index < 0 ? null : this.serverListSelector.getListEntry(index); + this.btnSelectServer.enabled = false; + this.btnEditServer.enabled = false; + this.btnDeleteServer.enabled = false; + + if (guilistextended$iguilistentry != null && !(guilistextended$iguilistentry instanceof ServerListEntryLanScan)) { + this.btnSelectServer.enabled = true; + + if (guilistextended$iguilistentry instanceof ServerListEntryNormal) { + this.btnEditServer.enabled = true; + this.btnDeleteServer.enabled = true; + } + } + } + + public OldServerPinger getOldServerPinger() { + return this.oldServerPinger; + } + + public void setHoveringText(String p_146793_1_) { + this.hoveringText = p_146793_1_; + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.serverListSelector.mouseClicked(mouseX, mouseY, mouseButton); + } + + protected void mouseReleased(int mouseX, int mouseY, int state) { + super.mouseReleased(mouseX, mouseY, state); + this.serverListSelector.mouseReleased(mouseX, mouseY, state); + } + + public ServerList getServerList() { + return this.savedServerList; + } + + public boolean func_175392_a(ServerListEntryNormal p_175392_1_, int p_175392_2_) { + return p_175392_2_ > 0; + } + + public boolean func_175394_b(ServerListEntryNormal p_175394_1_, int p_175394_2_) { + return p_175394_2_ < this.savedServerList.countServers() - 1; + } + + public void func_175391_a(ServerListEntryNormal p_175391_1_, int p_175391_2_, boolean p_175391_3_) { + int i = p_175391_3_ ? 0 : p_175391_2_ - 1; + this.savedServerList.swapServers(p_175391_2_, i); + + if (this.serverListSelector.func_148193_k() == p_175391_2_) { + this.selectServer(i); + } + + this.serverListSelector.func_148195_a(this.savedServerList); + } + + public void func_175393_b(ServerListEntryNormal p_175393_1_, int p_175393_2_, boolean p_175393_3_) { + int i = p_175393_3_ ? this.savedServerList.countServers() - 1 : p_175393_2_ + 1; + this.savedServerList.swapServers(p_175393_2_, i); + + if (this.serverListSelector.func_148193_k() == p_175393_2_) { + this.selectServer(i); + } + + this.serverListSelector.func_148195_a(this.savedServerList); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiNewChat.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiNewChat.java new file mode 100644 index 0000000..b89bac6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiNewChat.java @@ -0,0 +1,642 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.chat.ChatReceivedEvent; +import com.cheatbreaker.client.module.impl.normal.hud.chat.ModuleChat; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.chat.ChatLineWrapper; +import com.google.common.collect.Lists; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +public class GuiNewChat extends Gui +{ + private static final Logger logger = LogManager.getLogger(); + private final ResourceLocation iconLocation = new ResourceLocation("client/logo_white.png"); + private final Minecraft mc; + private final List sentMessages = Lists.newArrayList(); + private final List chatLines = Lists.newArrayList(); + public final List drawnChatLines = Lists.newArrayList(); + public final List brandedLines = new ArrayList<>(); + public int scrollPos; + private boolean isScrolled; + + private boolean smoothChat = false; + public int newLines; + public float percentComplete; + public long prevMillis = System.currentTimeMillis(); + public float animationPercent; + public int lineBeingDrawn; + + public GuiNewChat(Minecraft mcIn) + { + this.mc = mcIn; + } + + public void drawChat(int updateCounter) + { + if (this.mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN) + { + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + int scaledWidth = scaledResolution.getScaledWidth(); + int scaledHeight = scaledResolution.getScaledHeight(); + GuiScreen currentScreen = this.mc.currentScreen; + if ((currentScreen instanceof HudLayoutEditorGui && ((HudLayoutEditorGui)currentScreen).helpButton.isMouseInside(Mouse.getX() * scaledWidth / this.mc.displayWidth, scaledHeight - Mouse.getY() * scaledHeight / this.mc.displayHeight - 1)) || (CheatBreaker.getInstance().getModuleManager().chatMod.hiddenFromHud && !(currentScreen instanceof GuiChat))) { + return; + } + + int i = this.getLineCount(); + boolean flag = false; + int j = 0; + int k = this.drawnChatLines.size(); + float f = this.mc.gameSettings.chatOpacity * 0.9F + 0.1F; + + if (k > 0) + { + if (this.getChatOpen()) + { + flag = true; + } + + float f1 = this.getChatScale(); + int l = MathHelper.ceiling_float_int((float)this.getChatWidth() / f1); + GlStateManager.pushMatrix(); + GlStateManager.translate(2.0F, 20.0F, 0.0F); + GlStateManager.scale(f1, f1, 1.0F); + + for (int i1 = 0; i1 + this.scrollPos < this.drawnChatLines.size() && i1 < i; ++i1) + { + ChatLine chatline = (ChatLine)this.drawnChatLines.get(i1 + this.scrollPos); + + if (chatline != null) + { + int j1 = updateCounter - chatline.getUpdatedCounter(); + + if (j1 < 200 || flag) + { + double d0 = (double)j1 / 200.0D; + d0 = 1.0D - d0; + d0 = d0 * 10.0D; + d0 = MathHelper.clamp_double(d0, 0.0D, 1.0D); + d0 = d0 * d0; + int l1 = (int)(255.0D * d0); + + if (flag) + { + l1 = 255; + } + + l1 = (int)((float)l1 * f); + ++j; + + if (l1 > 3) + { + int i2 = 0; + int j2 = -i1 * 9; + drawRect(i2, j2 - 9, i2 + l + 4, j2, l1 / 2 << 24); + String s = chatline.getChatComponent().getFormattedText(); + GlStateManager.enableBlend(); + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + s = s.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } + + this.mc.fontRendererObj.drawStringWithShadow(s, (float)i2, (float)(j2 - 8), 16777215 + (l1 << 24)); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + } + } + } + } + + if (flag) + { + int k2 = this.mc.fontRendererObj.FONT_HEIGHT; + GlStateManager.translate(-3.0F, 0.0F, 0.0F); + int l2 = k * k2 + k; + int i3 = j * k2 + j; + int j3 = this.scrollPos * i3 / k; + int k1 = i3 * i3 / l2; + + if (l2 != i3) + { + int k3 = j3 > 0 ? 170 : 96; + int l3 = this.isScrolled ? 13382451 : 3355562; + drawRect(0, -j3, 2, -j3 - k1, l3 + (k3 << 24)); + drawRect(2, -j3, 1, -j3 - k1, 13421772 + (k3 << 24)); + } + } + + GlStateManager.popMatrix(); + } + } + } + + public void drawCustomChat(int updateCounter, boolean smoothChat) { + this.smoothChat = smoothChat; + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + + if (this.mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc); + int scaledWidth = scaledResolution.getScaledWidth(); + int scaledHeight = scaledResolution.getScaledHeight(); + GuiScreen currentScreen = this.mc.currentScreen; + boolean showInHudEditor = !CheatBreaker.getInstance().getModuleManager().chatMod.isRenderHud() || !(currentScreen instanceof HudLayoutEditorGui); + boolean showWhenHidden = CheatBreaker.getInstance().getModuleManager().chatMod.hiddenFromHud && !(currentScreen instanceof GuiChat) && showInHudEditor; + + if ((currentScreen instanceof HudLayoutEditorGui && ((HudLayoutEditorGui)currentScreen).helpButton.isMouseInside(Mouse.getX() * scaledWidth / this.mc.displayWidth, scaledHeight - Mouse.getY() * scaledHeight / this.mc.displayHeight - 1)) || showWhenHidden) { + return; + } + + int var2 = this.getLineCount(); + boolean var3 = false; + int var4 = 0; + int var5 = this.drawnChatLines.size(); + float var6 = this.mc.gameSettings.chatOpacity * chatMod.masterOpacity.getFloatValue() / 100.0F * 0.9F + 0.1F; + + long current = System.currentTimeMillis(); + long diff = current - this.prevMillis; + this.prevMillis = current; + this.updatePercentage(diff); + float t = this.percentComplete; + this.animationPercent = clamp(1.0f - (t -= 1.0f) * t * t * t, 0.0f, 1.0f); + + if (var5 > 0) { + if (this.getChatOpen()) { + var3 = true; + } + + float var7 = this.getChatScale(); + int var8 = MathHelper.ceiling_float_int((float)this.getChatWidth() / var7); + GL11.glPushMatrix(); + float y = chatMod.isRenderHud() ? chatMod.height : 20.0F - chatMod.chatHeightFix.getFloatValue(); + if (this.smoothChat && !this.isScrolled) { + y += (9.0f - 9.0f * this.animationPercent) * this.getChatScale(); + } + GL11.glTranslatef(chatMod.isRenderHud() ? 0.0F : 2.0F, y, 0.0F); + GL11.glScalef(var7, var7, 1.0F); + int var9; + int var11; + int var14; + + for (var9 = 0; var9 + this.scrollPos < this.drawnChatLines.size() && var9 < var2; ++var9) { + ChatLine var10 = this.drawnChatLines.get(this.getLineBeingDrawn(var9 + this.scrollPos)); + + if (var10 != null) { + var11 = updateCounter - var10.getUpdatedCounter(); + if (var11 < 200 || var3) { + double var12 = (double)var11 / 200.0D; + var12 = 1.0D - var12; + var12 *= 10.0D; + + if (var12 < 0.0D) { + var12 = 0.0D; + } + + if (var12 > 1.0D) { + var12 = 1.0D; + } + + var12 *= var12; + var14 = (int)(255.0D * var12); + + if (var3) { + var14 = 255; + } + + var14 = (int)((float)var14 * var6); + ++var4; + + if (var14 > 3) { + byte var15 = 0; + int var16 = -var9 * 9; + String var17 = var10.getChatComponent().getFormattedText(); + if (this.mc.currentScreen instanceof GuiChat && chatMod.background.getValue().equals("While Typing") || chatMod.background.getValue().equals("ON")) { + int bga = (int) ((chatMod.backgroundColor.getColorValue() >> 24 & 255) * ((float)var14 / 255.0F)); + int bgr = chatMod.backgroundColor.getColorValue() >> 16 & 255; + int bgg = chatMod.backgroundColor.getColorValue() >> 8 & 255; + int bgb = chatMod.backgroundColor.getColorValue() & 255; + int width = chatMod.backgroundWidthType.getValue().equals("Full") ? var8 + 4 : this.mc.fontRendererObj.getStringWidth(var17); + drawRect(var15, var16 - 9, var15 + width, var16, modifyBackgroundOpacity(new Color(bgr, bgg, bgb, bga).getRGB())); + } + + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + var17 = var17.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + var17 = var17.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + boolean strip = chatMod.stripFormattingColors.getBooleanValue(); + boolean nickHiderName = CheatBreaker.getInstance().getModuleManager().nickHiderMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().nickHiderMod.hideRealName.getBooleanValue(); + String nickHiderNameString = CheatBreaker.getInstance().getModuleManager().nickHiderMod.customNameString.getStringValue(); + + if (var17.contains(Minecraft.getMinecraft().getSession().getUsername()) || var17.contains(nickHiderNameString)) { + if (!chatMod.highlightColor.getStringValue().equalsIgnoreCase("None")) { + var17 = var17.replaceAll((nickHiderName ? nickHiderNameString : Minecraft.getMinecraft().getSession().getUsername()), chatMod.getHighlightColor() + (nickHiderName ? nickHiderNameString : Minecraft.getMinecraft().getSession().getUsername()) + EnumChatFormatting.RESET); + } + } + + for (int n7 = 0; n7 + this.scrollPos < this.drawnChatLines.size() && n7 < this.getLineCount(); ++n7) { + if (!var3 && !(10.0 - (double)(updateCounter - var10.getUpdatedCounter()) / 20.0 > 1.0)) continue; + if (var10 instanceof ChatLineWrapper) { + ChatLineWrapper chatLineWrapper = (ChatLineWrapper)var10; + if (chatLineWrapper.isBranded()) { + this.brandedLines.add(var10); + } + } + } + + GlStateManager.enableBlend(); + this.mc.fontRendererObj.drawString(strip ? chatMod.stripColor(var17) : var17, var15 + (this.brandedLines.contains(var10) ? 16F : 0), var16 - 8, modifyTextOpacity(strip ? chatMod.textColor.getColorValue() : 16777215 + (var14 << 24)), chatMod.textShadow.getBooleanValue()); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + } + } + } + } + + if (var3) { + var9 = this.mc.fontRendererObj.FONT_HEIGHT; + GL11.glTranslatef(-3.0F, 0.0F, 0.0F); + int var18 = var5 * var9 + var5; + var11 = var4 * var9 + var4; + int var19 = this.scrollPos * var11 / var5; + int var13 = var11 * var11 / var18; + + if (var18 != var11) { + var14 = var19 > 0 ? 170 : 96; + int var20 = this.isScrolled ? 13382451 : 3355562; + drawRect(0, -var19, 2, -var19 - var13, var20 + (var14 << 24)); + drawRect(2, -var19, 1, -var19 - var13, 13421772 + (var14 << 24)); + } + } + + int n6 = 0; + for (int n7 = 0; n7 + this.scrollPos < this.drawnChatLines.size() && n7 < this.getLineCount(); ++n7) { + ChatLine chatLine = this.drawnChatLines.get(n7 + this.scrollPos); + if (!var3 && !(10.0 - (double)(updateCounter - chatLine.getUpdatedCounter()) / 20.0 > 1.0)) continue; + n6 -= Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; + if (!(chatLine instanceof ChatLineWrapper)) continue; + ChatLineWrapper chatLineWrapper = (ChatLineWrapper)chatLine; + if (!chatLineWrapper.isBranded()) continue; + + if (chatMod.textShadow.getBooleanValue()) { + GL11.glColor4f(0.0F, 0.0F, 0.0F, 1.0F); + RenderUtil.renderIcon(this.iconLocation, (getChatOpen() ? 4.105F : 1.5F), (float)n6 + 1.5f, 14.0f, 6.9f); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderUtil.renderIcon(this.iconLocation, (getChatOpen() ? 4.105F : 1.3F), (float)n6 + 0.9f, 14.0f, 6.9f); + } + + GL11.glPopMatrix(); + } + } + } + + private int modifyTextOpacity(int original) { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + if (this.smoothChat && this.lineBeingDrawn <= this.newLines) { + int opacity = original >> 24 & 0xFF; + opacity = (int)((float)opacity * this.animationPercent * chatMod.textOpacity.getFloatValue() / 100.0F); + return original & 0xFFFFFF | opacity << 24; + } + int a = (int)((original >> 24 & 255) * chatMod.textOpacity.getFloatValue() / 100.0F); + return new Color(original >> 16 & 255, original >> 8 & 255, original & 255, a).getRGB(); + } + + private int modifyBackgroundOpacity(int original) { + if (this.smoothChat && this.lineBeingDrawn <= this.newLines) { + int opacity = original >> 24 & 0xFF; + opacity = (int)((float)opacity * this.animationPercent); + return original & 0xFFFFFF | opacity << 24; + } + return original; + } + + private int getLineBeingDrawn(int line) { + this.lineBeingDrawn = line; + return line; + } + + private void updatePercentage(long diff) { + if (this.percentComplete < 1.0f) { + this.percentComplete += 0.001f * CheatBreaker.getInstance().getModuleManager().chatMod.smoothChatSpeed.getFloatValue() / 2.0f * (float)diff; + } + this.percentComplete = clamp(this.percentComplete, 0.0f, 1.0f); + } + + public static float clamp(float number, float min, float max) { + return number < min ? min : Math.min(number, max); + } + + public void clearChatMessages() + { + this.drawnChatLines.clear(); + this.chatLines.clear(); + this.sentMessages.clear(); + } + + public void printChatMessage(IChatComponent chatComponent) + { + this.printChatMessageWithOptionalDeletion(chatComponent, 0); + } + + public void dontPrintChatMessageWithOptionalDeletion(IChatComponent p_146234_1_) { + this.percentComplete = 0.0f; + + this.setChatLine(p_146234_1_, 0, this.mc.ingameGUI.getUpdateCounter(), false); + } + + public void printChatMessageWithOptionalDeletion(IChatComponent chatComponent, int chatLineId) + { + if (this.hideReceivedChatMessage(chatComponent.getUnformattedText())) { + return; + } + + CheatBreaker.getInstance().getEventBus().handleEvent(new ChatReceivedEvent(chatComponent.getUnformattedText())); + this.percentComplete = 0.0f; + this.setChatLine(chatComponent, chatLineId, this.mc.ingameGUI.getUpdateCounter(), false); + logger.info("[CHAT] " + chatComponent.getUnformattedText()); + } + + private void setChatLine(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly) + { + if (chatLineId != 0) + { + this.deleteChatLine(chatLineId); + } + + int i = MathHelper.floor_float((float)this.getChatWidth() / this.getChatScale()); + List list = GuiUtilRenderComponents.splitText(chatComponent, i, this.mc.fontRendererObj, false, false); + boolean flag = this.getChatOpen(); + + for (IChatComponent ichatcomponent : list) + { + if (flag && this.scrollPos > 0) + { + this.isScrolled = true; + this.scroll(1); + } + + ChatLine chatLine = new ChatLine(updateCounter, chatComponent, chatLineId); + ChatLineWrapper of = ChatLineWrapper.of(chatLine); + + if (chatComponent instanceof ChatComponentText) { + if (((ChatComponentText)chatComponent).isBranded()) { + of.setBranded(true); + this.drawnChatLines.add(0, of); + } + + if (!((ChatComponentText)chatComponent).isBranded()) { + this.drawnChatLines.add(0, new ChatLine(updateCounter, ichatcomponent, chatLineId)); + } + } + } + + while (this.drawnChatLines.size() > 100) { + this.drawnChatLines.remove(this.drawnChatLines.size() - 1); + } + + if (!displayOnly) + { + + ChatLine chatLine = new ChatLine(updateCounter, chatComponent, chatLineId); + ChatLineWrapper of = ChatLineWrapper.of(chatLine); + + if (chatComponent instanceof ChatComponentText) { + if (((ChatComponentText)chatComponent).isBranded()) { + of.setBranded(true); + this.chatLines.add(0, of); + } + } else { + this.drawnChatLines.add(0, new ChatLine(updateCounter, chatComponent, chatLineId)); + } + + while (this.chatLines.size() > 100) + { + this.chatLines.remove(this.chatLines.size() - 1); + } + } + setNewLines(list); + } + + private boolean hideReceivedChatMessage(String string2) { + if (CheatBreaker.getInstance().getModuleManager().hypixelMod.isEnabled() && Minecraft.getMinecraft().getCurrentServerData() != null && Minecraft.getMinecraft().getCurrentServerData().serverIP.toLowerCase().contains("hypixel")) { + if (CheatBreaker.getInstance().getModuleManager().hypixelMod.autoTip.getBooleanValue() && (string2.startsWith("You can't tip the same person") || string2.equals("Still processing your most recent request!") || string2.startsWith("You've already tipped that person") || string2.equals("You cannot tip yourself!") || string2.startsWith("You can only use the /tip command") || string2.equals("You are not allowed to use commands as a spectator!") || string2.equals("Slow down! You can only use /tip every few seconds.") || string2.startsWith("You've already tipped someone in the past hour in "))) { + return true; + } + if (CheatBreaker.getInstance().getModuleManager().hypixelMod.antiGL.getBooleanValue() && Arrays.stream(string2.split(" ")).anyMatch(string -> string.equalsIgnoreCase("gl"))) { + return true; + } + return CheatBreaker.getInstance().getModuleManager().hypixelMod.antiGG.getBooleanValue() && Arrays.stream(string2.split(" ")).anyMatch(string -> string.equalsIgnoreCase("gg")); + } + return false; + } + + public void refreshChat() + { + this.drawnChatLines.clear(); + this.resetScroll(); + + for (int i = this.chatLines.size() - 1; i >= 0; --i) + { + ChatLine chatline = this.chatLines.get(i); + this.setChatLine(chatline.getChatComponent(), chatline.getChatLineID(), chatline.getUpdatedCounter(), true); + } + } + + private List setNewLines(List original) { + this.newLines = original.size() - 1; + return original; + } + + public List getSentMessages() + { + return this.sentMessages; + } + + public void addToSentMessages(String message) + { + if (this.sentMessages.isEmpty() || !((String)this.sentMessages.get(this.sentMessages.size() - 1)).equals(message)) + { + this.sentMessages.add(message); + } + } + + public void resetScroll() + { + this.scrollPos = 0; + this.isScrolled = false; + } + + public void scroll(int amount) + { + this.scrollPos += amount; + int i = this.drawnChatLines.size(); + + if (this.scrollPos > i - this.getLineCount()) + { + this.scrollPos = i - this.getLineCount(); + } + + if (this.scrollPos <= 0) + { + this.scrollPos = 0; + this.isScrolled = false; + } + } + + public IChatComponent getChatComponent(int mouseX, int mouseY) + { + if (!this.getChatOpen()) + { + return null; + } + else + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int i = scaledresolution.getScaleFactor(); + float f = this.getChatScale(); + int j = mouseX / i - 2; + int k = mouseY / i - 28; + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + if (chatMod.isRenderHud() && chatMod.isEnabled()) { + float[] scaledPoints = chatMod.getScaledPoints(scaledresolution, true); + j = (int)(mouseX / i / chatMod.masterScale() - scaledPoints[0]); + k = (int)(mouseY / i / chatMod.masterScale() - this.mc.displayHeight / i / chatMod.masterScale() + chatMod.height + scaledPoints[1]); + } else if (!chatMod.isRenderHud() && chatMod.isEnabled()) { + k = (int)(k - chatMod.chatHeightFix.getFloatValue()); + } + j = MathHelper.floor_float((float)j / f); + k = MathHelper.floor_float((float)k / f); + + if (j >= 0 && k >= 0) + { + int l = Math.min(this.getLineCount(), this.drawnChatLines.size()); + + if (j <= MathHelper.floor_float((float)this.getChatWidth() / this.getChatScale()) && k < this.mc.fontRendererObj.FONT_HEIGHT * l + l) + { + int i1 = k / this.mc.fontRendererObj.FONT_HEIGHT + this.scrollPos; + + if (i1 >= 0 && i1 < this.drawnChatLines.size()) + { + ChatLine chatline = (ChatLine)this.drawnChatLines.get(i1); + int j1 = 0; + + for (IChatComponent ichatcomponent : chatline.getChatComponent()) + { + if (ichatcomponent instanceof ChatComponentText) + { + j1 += this.mc.fontRendererObj.getStringWidth(GuiUtilRenderComponents.func_178909_a(((ChatComponentText)ichatcomponent).getChatComponentText_TextValue(), false)); + + if (j1 > j) + { + return ichatcomponent; + } + } + } + } + + return null; + } + else + { + return null; + } + } + else + { + return null; + } + } + } + + public boolean getChatOpen() + { + return this.mc.currentScreen instanceof GuiChat; + } + + public void deleteChatLine(int id) + { + Iterator iterator = this.drawnChatLines.iterator(); + + while (iterator.hasNext()) + { + ChatLine chatline = (ChatLine)iterator.next(); + + if (chatline.getChatLineID() == id) + { + iterator.remove(); + } + } + + iterator = this.chatLines.iterator(); + + while (iterator.hasNext()) + { + ChatLine chatline1 = (ChatLine)iterator.next(); + + if (chatline1.getChatLineID() == id) + { + iterator.remove(); + break; + } + } + } + + public int getChatWidth() + { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + return !chatMod.isRenderHud() || !chatMod.isEnabled() ? calculateChatboxWidth(this.mc.gameSettings.chatWidth) : chatMod.backgroundWidth.getIntegerValue(); + } + + public int getChatHeight() + { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + return !chatMod.isRenderHud() || !chatMod.isEnabled() ? calculateChatboxHeight(this.getChatOpen() ? this.mc.gameSettings.chatHeightFocused : this.mc.gameSettings.chatHeightUnfocused) : this.getChatOpen() ? chatMod.focusedBackgroundHeight.getIntegerValue() : chatMod.unfocusedBackgroundHeight.getIntegerValue(); + } + + public float getChatScale() + { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + return !chatMod.isRenderHud() || !chatMod.isEnabled() ? this.mc.gameSettings.chatScale : chatMod.textSize.getFloatValue() / 100.0F; + } + + public static int calculateChatboxWidth(float scale) + { + int i = 320; + int j = 40; + return MathHelper.floor_float(scale * (float)(i - j) + (float)j); + } + + public static int calculateChatboxHeight(float scale) + { + int i = 180; + int j = 20; + return MathHelper.floor_float(scale * (float)(i - j) + (float)j); + } + + public int getLineCount() + { + return this.getChatHeight() / 9; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionButton.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionButton.java new file mode 100644 index 0000000..9f03da5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionButton.java @@ -0,0 +1,30 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionButton extends GuiButton +{ + private final GameSettings.Options enumOptions; + + public GuiOptionButton(int p_i45011_1_, int p_i45011_2_, int p_i45011_3_, String p_i45011_4_) + { + this(p_i45011_1_, p_i45011_2_, p_i45011_3_, (GameSettings.Options)null, p_i45011_4_); + } + + public GuiOptionButton(int p_i45012_1_, int p_i45012_2_, int p_i45012_3_, int p_i45012_4_, int p_i45012_5_, String p_i45012_6_) + { + super(p_i45012_1_, p_i45012_2_, p_i45012_3_, p_i45012_4_, p_i45012_5_, p_i45012_6_); + this.enumOptions = null; + } + + public GuiOptionButton(int p_i45013_1_, int p_i45013_2_, int p_i45013_3_, GameSettings.Options p_i45013_4_, String p_i45013_5_) + { + super(p_i45013_1_, p_i45013_2_, p_i45013_3_, 150, 20, p_i45013_5_); + this.enumOptions = p_i45013_4_; + } + + public GameSettings.Options returnEnumOptions() + { + return this.enumOptions; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java new file mode 100644 index 0000000..dc2fba5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java @@ -0,0 +1,80 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.MathHelper; + +public class GuiOptionSlider extends GuiButton +{ + private float sliderValue; + public boolean dragging; + private GameSettings.Options options; + private final float field_146132_r; + private final float field_146131_s; + + public GuiOptionSlider(int p_i45016_1_, int p_i45016_2_, int p_i45016_3_, GameSettings.Options p_i45016_4_) + { + this(p_i45016_1_, p_i45016_2_, p_i45016_3_, p_i45016_4_, 0.0F, 1.0F); + } + + public GuiOptionSlider(int p_i45017_1_, int p_i45017_2_, int p_i45017_3_, GameSettings.Options p_i45017_4_, float p_i45017_5_, float p_i45017_6_) + { + super(p_i45017_1_, p_i45017_2_, p_i45017_3_, 150, 20, ""); + this.sliderValue = 1.0F; + this.options = p_i45017_4_; + this.field_146132_r = p_i45017_5_; + this.field_146131_s = p_i45017_6_; + Minecraft minecraft = Minecraft.getMinecraft(); + this.sliderValue = p_i45017_4_.normalizeValue(minecraft.gameSettings.getOptionFloatValue(p_i45017_4_)); + this.displayString = minecraft.gameSettings.getKeyBinding(p_i45017_4_); + } + + protected int getHoverState(boolean mouseOver) + { + return 0; + } + + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + if (this.dragging) + { + this.sliderValue = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + this.sliderValue = MathHelper.clamp_float(this.sliderValue, 0.0F, 1.0F); + float f = this.options.denormalizeValue(this.sliderValue); + mc.gameSettings.setOptionFloatValue(this.options, f); + this.sliderValue = this.options.normalizeValue(f); + this.displayString = mc.gameSettings.getKeyBinding(this.options); + } + + mc.getTextureManager().bindTexture(buttonTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.sliderValue = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + this.sliderValue = MathHelper.clamp_float(this.sliderValue, 0.0F, 1.0F); + mc.gameSettings.setOptionFloatValue(this.options, this.options.denormalizeValue(this.sliderValue)); + this.displayString = mc.gameSettings.getKeyBinding(this.options); + this.dragging = true; + return true; + } + else + { + return false; + } + } + + public void mouseReleased(int mouseX, int mouseY) + { + this.dragging = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptions.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptions.java new file mode 100644 index 0000000..9b2abc4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptions.java @@ -0,0 +1,230 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.audio.SoundEventAccessorComposite; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.gui.stream.GuiStreamOptions; +import net.minecraft.client.gui.stream.GuiStreamUnavailable; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.stream.IStream; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.EnumDifficulty; +import java.io.IOException; + +public class GuiOptions extends GuiScreen implements GuiYesNoCallback +{ + private static final GameSettings.Options[] field_146440_f = new GameSettings.Options[] {GameSettings.Options.FOV}; + private final GuiScreen field_146441_g; + private final GameSettings game_settings_1; + private GuiButton field_175357_i; + private GuiLockIconButton field_175356_r; + protected String field_146442_a = "Options"; + + public GuiOptions(GuiScreen p_i1046_1_, GameSettings p_i1046_2_) + { + this.field_146441_g = p_i1046_1_; + this.game_settings_1 = p_i1046_2_; + } + + public void initGui() + { + int i = 0; + this.field_146442_a = I18n.format("options.title", new Object[0]); + + for (GameSettings.Options gamesettings$options : field_146440_f) + { + if (gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), gamesettings$options)); + } + else + { + GuiOptionButton guioptionbutton = new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), gamesettings$options, this.game_settings_1.getKeyBinding(gamesettings$options)); + this.buttonList.add(guioptionbutton); + } + + ++i; + } + + if (this.mc.theWorld != null) + { + EnumDifficulty enumdifficulty = this.mc.theWorld.getDifficulty(); + this.field_175357_i = new GuiButton(108, this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), 150, 20, this.func_175355_a(enumdifficulty)); + this.buttonList.add(this.field_175357_i); + + if (this.mc.isSingleplayer() && !this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) + { + this.field_175357_i.setWidth(this.field_175357_i.getButtonWidth() - 20); + this.field_175356_r = new GuiLockIconButton(109, this.field_175357_i.xPosition + this.field_175357_i.getButtonWidth(), this.field_175357_i.yPosition); + this.buttonList.add(this.field_175356_r); + this.field_175356_r.func_175229_b(this.mc.theWorld.getWorldInfo().isDifficultyLocked()); + this.field_175356_r.enabled = !this.field_175356_r.func_175230_c(); + this.field_175357_i.enabled = !this.field_175356_r.func_175230_c(); + } + else + { + this.field_175357_i.enabled = false; + } + } + else + { + GuiOptionButton guioptionbutton1 = new GuiOptionButton(GameSettings.Options.REALMS_NOTIFICATIONS.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), GameSettings.Options.REALMS_NOTIFICATIONS, this.game_settings_1.getKeyBinding(GameSettings.Options.REALMS_NOTIFICATIONS)); + this.buttonList.add(guioptionbutton1); + } + + this.buttonList.add(new GuiButton(110, this.width / 2 - 155, this.height / 6 + 48 - 6, 150, 20, I18n.format("options.skinCustomisation", new Object[0]))); + this.buttonList.add(new GuiButton(8675309, this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20, "Super Secret Settings...") + { + public void playPressSound(SoundHandler soundHandlerIn) + { + SoundEventAccessorComposite soundeventaccessorcomposite = soundHandlerIn.getRandomSoundFromCategories(new SoundCategory[] {SoundCategory.ANIMALS, SoundCategory.BLOCKS, SoundCategory.MOBS, SoundCategory.PLAYERS, SoundCategory.WEATHER}); + + if (soundeventaccessorcomposite != null) + { + soundHandlerIn.playSound(PositionedSoundRecord.create(soundeventaccessorcomposite.getSoundEventLocation(), 0.5F)); + } + } + }); + this.buttonList.add(new GuiButton(106, this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20, I18n.format("options.sounds", new Object[0]))); + this.buttonList.add(new GuiButton(107, this.width / 2 + 5, this.height / 6 + 72 - 6, 150, 20, I18n.format("options.stream", new Object[0]))); + this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height / 6 + 96 - 6, 150, 20, I18n.format("options.video", new Object[0]))); + this.buttonList.add(new GuiButton(100, this.width / 2 + 5, this.height / 6 + 96 - 6, 150, 20, I18n.format("options.controls", new Object[0]))); + this.buttonList.add(new GuiButton(102, this.width / 2 - 155, this.height / 6 + 120 - 6, 150, 20, I18n.format("options.language", new Object[0]))); + this.buttonList.add(new GuiButton(103, this.width / 2 + 5, this.height / 6 + 120 - 6, 150, 20, I18n.format("options.chat.title", new Object[0]))); + this.buttonList.add(new GuiButton(105, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20, I18n.format("options.resourcepack", new Object[0]))); + this.buttonList.add(new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20, I18n.format("options.snooper.view", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); + } + + public String func_175355_a(EnumDifficulty p_175355_1_) + { + IChatComponent ichatcomponent = new ChatComponentText(""); + ichatcomponent.appendSibling(new ChatComponentTranslation("options.difficulty", new Object[0])); + ichatcomponent.appendText(": "); + ichatcomponent.appendSibling(new ChatComponentTranslation(p_175355_1_.getDifficultyResourceKey(), new Object[0])); + return ichatcomponent.getFormattedText(); + } + + public void confirmClicked(boolean result, int id) + { + this.mc.displayGuiScreen(this); + + if (id == 109 && result && this.mc.theWorld != null) + { + this.mc.theWorld.getWorldInfo().setDifficultyLocked(true); + this.field_175356_r.func_175229_b(true); + this.field_175356_r.enabled = false; + this.field_175357_i.enabled = false; + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id < 100 && button instanceof GuiOptionButton) + { + GameSettings.Options gamesettings$options = ((GuiOptionButton)button).returnEnumOptions(); + this.game_settings_1.setOptionValue(gamesettings$options, 1); + button.displayString = this.game_settings_1.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + } + + if (button.id == 108) + { + this.mc.theWorld.getWorldInfo().setDifficulty(EnumDifficulty.getDifficultyEnum(this.mc.theWorld.getDifficulty().getDifficultyId() + 1)); + this.field_175357_i.displayString = this.func_175355_a(this.mc.theWorld.getDifficulty()); + } + + if (button.id == 109) + { + this.mc.displayGuiScreen(new GuiYesNo(this, (new ChatComponentTranslation("difficulty.lock.title", new Object[0])).getFormattedText(), (new ChatComponentTranslation("difficulty.lock.question", new Object[] {new ChatComponentTranslation(this.mc.theWorld.getWorldInfo().getDifficulty().getDifficultyResourceKey(), new Object[0])})).getFormattedText(), 109)); + } + + if (button.id == 110) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiCustomizeSkin(this)); + } + + if (button.id == 8675309) + { + this.mc.entityRenderer.activateNextShader(); + } + + if (button.id == 101) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiVideoSettings(this, this.game_settings_1)); + } + + if (button.id == 100) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiControls(this, this.game_settings_1)); + } + + if (button.id == 102) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiLanguage(this, this.game_settings_1, this.mc.getLanguageManager())); + } + + if (button.id == 103) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new ScreenChatOptions(this, this.game_settings_1)); + } + + if (button.id == 104) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiSnooper(this, this.game_settings_1)); + } + + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146441_g); + } + + if (button.id == 105) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiResourcePacks(this)); + } + + if (button.id == 106) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiScreenOptionsSounds(this, this.game_settings_1)); + } + + if (button.id == 107) + { + this.mc.gameSettings.saveOptions(); + IStream istream = this.mc.getTwitchStream(); + + if (istream.func_152936_l() && istream.func_152928_D()) + { + this.mc.displayGuiScreen(new GuiStreamOptions(this, this.game_settings_1)); + } + else + { + GuiStreamUnavailable.func_152321_a(this); + } + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146442_a, this.width / 2, 15, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java new file mode 100644 index 0000000..06e2322 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java @@ -0,0 +1,132 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionsRowList extends GuiListExtended +{ + private final List field_148184_k = Lists.newArrayList(); + + public GuiOptionsRowList(Minecraft mcIn, int p_i45015_2_, int p_i45015_3_, int p_i45015_4_, int p_i45015_5_, int p_i45015_6_, GameSettings.Options... p_i45015_7_) + { + super(mcIn, p_i45015_2_, p_i45015_3_, p_i45015_4_, p_i45015_5_, p_i45015_6_); + this.field_148163_i = false; + + for (int i = 0; i < p_i45015_7_.length; i += 2) + { + GameSettings.Options gamesettings$options = p_i45015_7_[i]; + GameSettings.Options gamesettings$options1 = i < p_i45015_7_.length - 1 ? p_i45015_7_[i + 1] : null; + GuiButton guibutton = this.func_148182_a(mcIn, p_i45015_2_ / 2 - 155, 0, gamesettings$options); + GuiButton guibutton1 = this.func_148182_a(mcIn, p_i45015_2_ / 2 - 155 + 160, 0, gamesettings$options1); + this.field_148184_k.add(new GuiOptionsRowList.Row(guibutton, guibutton1)); + } + } + + private GuiButton func_148182_a(Minecraft mcIn, int p_148182_2_, int p_148182_3_, GameSettings.Options p_148182_4_) + { + if (p_148182_4_ == null) + { + return null; + } + else + { + int i = p_148182_4_.returnEnumOrdinal(); + return (GuiButton)(p_148182_4_.getEnumFloat() ? new GuiOptionSlider(i, p_148182_2_, p_148182_3_, p_148182_4_) : new GuiOptionButton(i, p_148182_2_, p_148182_3_, p_148182_4_, mcIn.gameSettings.getKeyBinding(p_148182_4_))); + } + } + + public GuiOptionsRowList.Row getListEntry(int index) + { + return (GuiOptionsRowList.Row)this.field_148184_k.get(index); + } + + protected int getSize() + { + return this.field_148184_k.size(); + } + + public int getListWidth() + { + return 400; + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 32; + } + + public static class Row implements GuiListExtended.IGuiListEntry + { + private final Minecraft field_148325_a = Minecraft.getMinecraft(); + private final GuiButton field_148323_b; + private final GuiButton field_148324_c; + + public Row(GuiButton p_i45014_1_, GuiButton p_i45014_2_) + { + this.field_148323_b = p_i45014_1_; + this.field_148324_c = p_i45014_2_; + } + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + { + if (this.field_148323_b != null) + { + this.field_148323_b.yPosition = y; + this.field_148323_b.drawButton(this.field_148325_a, mouseX, mouseY); + } + + if (this.field_148324_c != null) + { + this.field_148324_c.yPosition = y; + this.field_148324_c.drawButton(this.field_148325_a, mouseX, mouseY); + } + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + if (this.field_148323_b.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) + { + if (this.field_148323_b instanceof GuiOptionButton) + { + this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton)this.field_148323_b).returnEnumOptions(), 1); + this.field_148323_b.displayString = this.field_148325_a.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.field_148323_b.id)); + } + + return true; + } + else if (this.field_148324_c != null && this.field_148324_c.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) + { + if (this.field_148324_c instanceof GuiOptionButton) + { + this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton)this.field_148324_c).returnEnumOptions(), 1); + this.field_148324_c.displayString = this.field_148325_a.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.field_148324_c.id)); + } + + return true; + } + else + { + return false; + } + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + if (this.field_148323_b != null) + { + this.field_148323_b.mouseReleased(x, y); + } + + if (this.field_148324_c != null) + { + this.field_148324_c.mouseReleased(x, y); + } + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) + { + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java new file mode 100644 index 0000000..3b67167 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java @@ -0,0 +1,350 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.List; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.WorldType; +import net.minecraft.world.chunk.Chunk; +import net.optifine.SmartAnimations; +import net.optifine.TextureAnimations; +import net.optifine.reflect.Reflector; +import net.optifine.util.MemoryMonitor; +import net.optifine.util.NativeMemory; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; + +public class GuiOverlayDebug extends Gui +{ + private final Minecraft mc; + private final FontRenderer fontRenderer; + private String debugOF = null; + private List debugInfoLeft = null; + private List debugInfoRight = null; + private long updateInfoLeftTimeMs = 0L; + private long updateInfoRightTimeMs = 0L; + + public GuiOverlayDebug(Minecraft mc) + { + this.mc = mc; + this.fontRenderer = mc.fontRendererObj; + } + + public void renderDebugInfo(ScaledResolution scaledResolutionIn) + { + this.mc.mcProfiler.startSection("debug"); + GlStateManager.pushMatrix(); + this.renderDebugInfoLeft(); + this.renderDebugInfoRight(scaledResolutionIn); + GlStateManager.popMatrix(); + + if (this.mc.gameSettings.showLagometer) + { + this.renderLagometer(); + } + + this.mc.mcProfiler.endSection(); + } + + private boolean isReducedDebug() + { + return this.mc.thePlayer.hasReducedDebug() || this.mc.gameSettings.reducedDebugInfo; + } + + protected void renderDebugInfoLeft() + { + List list = this.debugInfoLeft; + + if (list == null || System.currentTimeMillis() > this.updateInfoLeftTimeMs) + { + list = this.call(); + this.debugInfoLeft = list; + this.updateInfoLeftTimeMs = System.currentTimeMillis() + 100L; + } + + for (int i = 0; i < list.size(); ++i) + { + String s = (String)list.get(i); + + if (!Strings.isNullOrEmpty(s)) + { + int j = this.fontRenderer.FONT_HEIGHT; + int k = this.fontRenderer.getStringWidth(s); + int l = 2; + int i1 = 2 + j * i; + drawRect(1, i1 - 1, 2 + k + 1, i1 + j - 1, -1873784752); + this.fontRenderer.drawString(s, 2, i1, 14737632); + } + } + } + + protected void renderDebugInfoRight(ScaledResolution scaledRes) + { + List list = this.debugInfoRight; + + if (list == null || System.currentTimeMillis() > this.updateInfoRightTimeMs) + { + list = this.getDebugInfoRight(); + this.debugInfoRight = list; + this.updateInfoRightTimeMs = System.currentTimeMillis() + 100L; + } + + for (int i = 0; i < list.size(); ++i) + { + String s = (String)list.get(i); + + if (!Strings.isNullOrEmpty(s)) + { + int j = this.fontRenderer.FONT_HEIGHT; + int k = this.fontRenderer.getStringWidth(s); + int l = scaledRes.getScaledWidth() - 2 - k; + int i1 = 2 + j * i; + drawRect(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752); + this.fontRenderer.drawString(s, l, i1, 14737632); + } + } + } + + @SuppressWarnings("incomplete-switch") + protected List call() + { + BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ); + + if (this.mc.debug != this.debugOF) + { + StringBuffer stringbuffer = new StringBuffer(this.mc.debug); + int i = Config.getFpsMin(); + int j = this.mc.debug.indexOf(" fps "); + + if (j >= 0) + { + stringbuffer.insert(j, "/" + i); + } + + if (Config.isSmoothFps()) + { + stringbuffer.append(" sf"); + } + + if (Config.isFastRender()) + { + stringbuffer.append(" fr"); + } + + if (Config.isAnisotropicFiltering()) + { + stringbuffer.append(" af"); + } + + if (Config.isAntialiasing()) + { + stringbuffer.append(" aa"); + } + + if (Config.isRenderRegions()) + { + stringbuffer.append(" reg"); + } + + if (Config.isShaders()) + { + stringbuffer.append(" sh"); + } + + this.mc.debug = stringbuffer.toString(); + this.debugOF = this.mc.debug; + } + + StringBuilder stringbuilder = new StringBuilder(); + TextureMap texturemap = Config.getTextureMap(); + stringbuilder.append(", A: "); + + if (SmartAnimations.isActive()) + { + stringbuilder.append(texturemap.getCountAnimationsActive() + TextureAnimations.getCountAnimationsActive()); + stringbuilder.append("/"); + } + + stringbuilder.append(texturemap.getCountAnimations() + TextureAnimations.getCountAnimations()); + String s1 = stringbuilder.toString(); + + if (this.isReducedDebug()) + { + return Lists.newArrayList(new String[] {"Minecraft 1.8.9 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")", this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), this.mc.renderGlobal.getDebugInfoEntities(), "P: " + this.mc.effectRenderer.getStatistics() + ". T: " + this.mc.theWorld.getDebugLoadedEntities() + s1, this.mc.theWorld.getProviderName(), "", String.format("Chunk-relative: %d %d %d", new Object[]{Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15)})}); + } + else + { + Entity entity = this.mc.getRenderViewEntity(); + EnumFacing enumfacing = entity.getHorizontalFacing(); + String s = "Invalid"; + + switch (enumfacing) + { + case NORTH: + s = "Towards negative Z"; + break; + + case SOUTH: + s = "Towards positive Z"; + break; + + case WEST: + s = "Towards negative X"; + break; + + case EAST: + s = "Towards positive X"; + } + + List list = Lists.newArrayList(new String[] {"Minecraft 1.8.9 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")", this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), this.mc.renderGlobal.getDebugInfoEntities(), "P: " + this.mc.effectRenderer.getStatistics() + ". T: " + this.mc.theWorld.getDebugLoadedEntities() + s1, this.mc.theWorld.getProviderName(), "", String.format("XYZ: %.3f / %.5f / %.3f", new Object[]{Double.valueOf(this.mc.getRenderViewEntity().posX), Double.valueOf(this.mc.getRenderViewEntity().getEntityBoundingBox().minY), Double.valueOf(this.mc.getRenderViewEntity().posZ)}), String.format("Block: %d %d %d", new Object[]{Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}), String.format("Chunk: %d %d %d in %d %d %d", new Object[]{Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15), Integer.valueOf(blockpos.getX() >> 4), Integer.valueOf(blockpos.getY() >> 4), Integer.valueOf(blockpos.getZ() >> 4)}), String.format("Facing: %s (%s) (%.1f / %.1f)", new Object[]{enumfacing, s, Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationYaw)), Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationPitch))})}); + + if (this.mc.theWorld != null && this.mc.theWorld.isBlockLoaded(blockpos)) + { + Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(blockpos); + list.add("Biome: " + chunk.getBiome(blockpos, this.mc.theWorld.getWorldChunkManager()).biomeName); + list.add("Light: " + chunk.getLightSubtracted(blockpos, 0) + " (" + chunk.getLightFor(EnumSkyBlock.SKY, blockpos) + " sky, " + chunk.getLightFor(EnumSkyBlock.BLOCK, blockpos) + " block)"); + DifficultyInstance difficultyinstance = this.mc.theWorld.getDifficultyForLocation(blockpos); + + if (this.mc.isIntegratedServerRunning() && this.mc.getIntegratedServer() != null) + { + EntityPlayerMP entityplayermp = this.mc.getIntegratedServer().getConfigurationManager().getPlayerByUUID(this.mc.thePlayer.getUniqueID()); + + if (entityplayermp != null) + { + DifficultyInstance difficultyinstance1 = this.mc.getIntegratedServer().getDifficultyAsync(entityplayermp.worldObj, new BlockPos(entityplayermp)); + + if (difficultyinstance1 != null) + { + difficultyinstance = difficultyinstance1; + } + } + } + + list.add(String.format("Local Difficulty: %.2f (Day %d)", new Object[] {Float.valueOf(difficultyinstance.getAdditionalDifficulty()), Long.valueOf(this.mc.theWorld.getWorldTime() / 24000L)})); + } + + if (this.mc.entityRenderer != null && this.mc.entityRenderer.isShaderActive()) + { + list.add("Shader: " + this.mc.entityRenderer.getShaderGroup().getShaderGroupName()); + } + + if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.mc.objectMouseOver.getBlockPos() != null) + { + BlockPos blockpos1 = this.mc.objectMouseOver.getBlockPos(); + list.add(String.format("Looking at: %d %d %d", new Object[] {Integer.valueOf(blockpos1.getX()), Integer.valueOf(blockpos1.getY()), Integer.valueOf(blockpos1.getZ())})); + } + + return list; + } + } + + protected List getDebugInfoRight() + { + long i = Runtime.getRuntime().maxMemory(); + long j = Runtime.getRuntime().totalMemory(); + long k = Runtime.getRuntime().freeMemory(); + long l = j - k; + List list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.getCpu()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)}); + long i1 = NativeMemory.getBufferAllocated(); + long j1 = NativeMemory.getBufferMaximum(); + String s = "Native: " + bytesToMb(i1) + "/" + bytesToMb(j1) + "MB"; + list.add(4, s); + list.set(5, "GC: " + MemoryMonitor.getAllocationRateMb() + "MB/s"); + + if (Reflector.FMLCommonHandler_getBrandings.exists()) + { + Object object = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + list.add(""); + list.addAll((Collection)Reflector.call(object, Reflector.FMLCommonHandler_getBrandings, new Object[] {Boolean.valueOf(false)})); + } + + if (this.isReducedDebug()) + { + return list; + } + else + { + if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.mc.objectMouseOver.getBlockPos() != null) + { + BlockPos blockpos = this.mc.objectMouseOver.getBlockPos(); + IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos); + + if (this.mc.theWorld.getWorldType() != WorldType.DEBUG_WORLD) + { + iblockstate = iblockstate.getBlock().getActualState(iblockstate, this.mc.theWorld, blockpos); + } + + list.add(""); + list.add(String.valueOf(Block.blockRegistry.getNameForObject(iblockstate.getBlock()))); + + for (Entry entry : iblockstate.getProperties().entrySet()) + { + String s1 = ((Comparable)entry.getValue()).toString(); + + if (entry.getValue() == Boolean.TRUE) + { + s1 = EnumChatFormatting.GREEN + s1; + } + else if (entry.getValue() == Boolean.FALSE) + { + s1 = EnumChatFormatting.RED + s1; + } + + list.add(((IProperty)entry.getKey()).getName() + ": " + s1); + } + } + + return list; + } + } + + private void renderLagometer() + { + } + + private int getFrameColor(int p_181552_1_, int p_181552_2_, int p_181552_3_, int p_181552_4_) + { + return p_181552_1_ < p_181552_3_ ? this.blendColors(-16711936, -256, (float)p_181552_1_ / (float)p_181552_3_) : this.blendColors(-256, -65536, (float)(p_181552_1_ - p_181552_3_) / (float)(p_181552_4_ - p_181552_3_)); + } + + private int blendColors(int p_181553_1_, int p_181553_2_, float p_181553_3_) + { + int i = p_181553_1_ >> 24 & 255; + int j = p_181553_1_ >> 16 & 255; + int k = p_181553_1_ >> 8 & 255; + int l = p_181553_1_ & 255; + int i1 = p_181553_2_ >> 24 & 255; + int j1 = p_181553_2_ >> 16 & 255; + int k1 = p_181553_2_ >> 8 & 255; + int l1 = p_181553_2_ & 255; + int i2 = MathHelper.clamp_int((int)((float)i + (float)(i1 - i) * p_181553_3_), 0, 255); + int j2 = MathHelper.clamp_int((int)((float)j + (float)(j1 - j) * p_181553_3_), 0, 255); + int k2 = MathHelper.clamp_int((int)((float)k + (float)(k1 - k) * p_181553_3_), 0, 255); + int l2 = MathHelper.clamp_int((int)((float)l + (float)(l1 - l) * p_181553_3_), 0, 255); + return i2 << 24 | j2 << 16 | k2 << 8 | l2; + } + + private static long bytesToMb(long bytes) + { + return bytes / 1024L / 1024L; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOverlayDeb~ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOverlayDeb~ new file mode 100644 index 0000000..17e01a4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiOverlayDeb~ @@ -0,0 +1,286 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.List; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.WorldType; +import net.minecraft.world.chunk.Chunk; +import net.optifine.SmartAnimations; +import net.optifine.TextureAnimations; +import net.optifine.reflect.Reflector; +import net.optifine.util.MemoryMonitor; +import net.optifine.util.NativeMemory; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; + +public class GuiOverlayDebug extends Gui { + private final Minecraft field_175242_a; + private final FontRenderer field_175241_f; + private String debugOF = null; + private List debugInfoLeft = null; + private List debugInfoRight = null; + private long updateInfoLeftTimeMs = 0L; + private long updateInfoRightTimeMs = 0L; + + public GuiOverlayDebug(Minecraft p_i45543_1_) { + this.field_175242_a = p_i45543_1_; + this.field_175241_f = p_i45543_1_.field_71466_p; + } + + public void func_175237_a(ScaledResolution p_175237_1_) { + this.field_175242_a.field_71424_I.func_76320_a("debug"); + GlStateManager.func_179094_E(); + this.func_180798_a(); + this.func_175239_b(p_175237_1_); + GlStateManager.func_179121_F(); + if(this.field_175242_a.field_71474_y.field_181657_aC) { + this.func_181554_e(); + } + + this.field_175242_a.field_71424_I.func_76319_b(); + } + + private boolean func_175236_d() { + return this.field_175242_a.field_71439_g.cq() || this.field_175242_a.field_71474_y.field_178879_v; + } + + protected void func_180798_a() { + List list = this.debugInfoLeft; + if(list == null || System.currentTimeMillis() > this.updateInfoLeftTimeMs) { + list = this.call(); + this.debugInfoLeft = list; + this.updateInfoLeftTimeMs = System.currentTimeMillis() + 100L; + } + + for(int i = 0; i < list.size(); ++i) { + String s = (String)list.get(i); + if(!Strings.isNullOrEmpty(s)) { + int j = this.field_175241_f.field_78288_b; + int k = this.field_175241_f.func_78256_a(s); + int l = 2; + int i1 = 2 + j * i; + func_73734_a(1, i1 - 1, 2 + k + 1, i1 + j - 1, -1873784752); + this.field_175241_f.func_78276_b(s, 2, i1, 14737632); + } + } + + } + + protected void func_175239_b(ScaledResolution p_175239_1_) { + List list = this.debugInfoRight; + if(list == null || System.currentTimeMillis() > this.updateInfoRightTimeMs) { + list = this.func_175238_c(); + this.debugInfoRight = list; + this.updateInfoRightTimeMs = System.currentTimeMillis() + 100L; + } + + for(int i = 0; i < list.size(); ++i) { + String s = (String)list.get(i); + if(!Strings.isNullOrEmpty(s)) { + int j = this.field_175241_f.field_78288_b; + int k = this.field_175241_f.func_78256_a(s); + int l = p_175239_1_.func_78326_a() - 2 - k; + int i1 = 2 + j * i; + func_73734_a(l - 1, i1 - 1, l + k + 1, i1 + j - 1, -1873784752); + this.field_175241_f.func_78276_b(s, l, i1, 14737632); + } + } + + } + + protected List call() { + BlockPos blockpos = new BlockPos(this.field_175242_a.func_175606_aa().field_70165_t, this.field_175242_a.func_175606_aa().func_174813_aQ().field_72338_b, this.field_175242_a.func_175606_aa().field_70161_v); + if(this.field_175242_a.field_71426_K != this.debugOF) { + StringBuffer stringbuffer = new StringBuffer(this.field_175242_a.field_71426_K); + int i = Config.getFpsMin(); + int j = this.field_175242_a.field_71426_K.indexOf(" fps "); + if(j >= 0) { + stringbuffer.insert(j, "/" + i); + } + + if(Config.isSmoothFps()) { + stringbuffer.append(" sf"); + } + + if(Config.isFastRender()) { + stringbuffer.append(" fr"); + } + + if(Config.isAnisotropicFiltering()) { + stringbuffer.append(" af"); + } + + if(Config.isAntialiasing()) { + stringbuffer.append(" aa"); + } + + if(Config.isRenderRegions()) { + stringbuffer.append(" reg"); + } + + if(Config.isShaders()) { + stringbuffer.append(" sh"); + } + + this.field_175242_a.field_71426_K = stringbuffer.toString(); + this.debugOF = this.field_175242_a.field_71426_K; + } + + StringBuilder stringbuilder = new StringBuilder(); + TextureMap texturemap = Config.getTextureMap(); + stringbuilder.append(", A: "); + if(SmartAnimations.isActive()) { + stringbuilder.append(texturemap.getCountAnimationsActive() + TextureAnimations.getCountAnimationsActive()); + stringbuilder.append("/"); + } + + stringbuilder.append(texturemap.getCountAnimations() + TextureAnimations.getCountAnimations()); + String s1 = stringbuilder.toString(); + if(this.func_175236_d()) { + return Lists.newArrayList(new String[]{"Minecraft 1.8.9 (" + this.field_175242_a.func_175600_c() + "/" + ClientBrandRetriever.getClientModName() + ")", this.field_175242_a.field_71426_K, this.field_175242_a.field_71438_f.func_72735_c(), this.field_175242_a.field_71438_f.func_72723_d(), "P: " + this.field_175242_a.field_71452_i.func_78869_b() + ". T: " + this.field_175242_a.field_71441_e.func_72981_t() + s1, this.field_175242_a.field_71441_e.func_72827_u(), "", String.format("Chunk-relative: %d %d %d", new Object[]{Integer.valueOf(blockpos.n() & 15), Integer.valueOf(blockpos.o() & 15), Integer.valueOf(blockpos.p() & 15)})}); + } else { + Entity entity = this.field_175242_a.func_175606_aa(); + EnumFacing enumfacing = entity.func_174811_aO(); + String s = "Invalid"; + switch(enumfacing) { + case NORTH: + s = "Towards negative Z"; + break; + case SOUTH: + s = "Towards positive Z"; + break; + case WEST: + s = "Towards negative X"; + break; + case EAST: + s = "Towards positive X"; + } + + List list = Lists.newArrayList(new String[]{"Minecraft 1.8.9 (" + this.field_175242_a.func_175600_c() + "/" + ClientBrandRetriever.getClientModName() + ")", this.field_175242_a.field_71426_K, this.field_175242_a.field_71438_f.func_72735_c(), this.field_175242_a.field_71438_f.func_72723_d(), "P: " + this.field_175242_a.field_71452_i.func_78869_b() + ". T: " + this.field_175242_a.field_71441_e.func_72981_t() + s1, this.field_175242_a.field_71441_e.func_72827_u(), "", String.format("XYZ: %.3f / %.5f / %.3f", new Object[]{Double.valueOf(this.field_175242_a.func_175606_aa().field_70165_t), Double.valueOf(this.field_175242_a.func_175606_aa().func_174813_aQ().field_72338_b), Double.valueOf(this.field_175242_a.func_175606_aa().field_70161_v)}), String.format("Block: %d %d %d", new Object[]{Integer.valueOf(blockpos.n()), Integer.valueOf(blockpos.o()), Integer.valueOf(blockpos.p())}), String.format("Chunk: %d %d %d in %d %d %d", new Object[]{Integer.valueOf(blockpos.n() & 15), Integer.valueOf(blockpos.o() & 15), Integer.valueOf(blockpos.p() & 15), Integer.valueOf(blockpos.n() >> 4), Integer.valueOf(blockpos.o() >> 4), Integer.valueOf(blockpos.p() >> 4)}), String.format("Facing: %s (%s) (%.1f / %.1f)", new Object[]{enumfacing, s, Float.valueOf(MathHelper.func_76142_g(entity.field_70177_z)), Float.valueOf(MathHelper.func_76142_g(entity.field_70125_A))})}); + if(this.field_175242_a.field_71441_e != null && this.field_175242_a.field_71441_e.func_175667_e(blockpos)) { + Chunk chunk = this.field_175242_a.field_71441_e.func_175726_f(blockpos); + list.add("Biome: " + chunk.func_177411_a(blockpos, this.field_175242_a.field_71441_e.func_72959_q()).field_76791_y); + list.add("Light: " + chunk.func_177443_a(blockpos, 0) + " (" + chunk.func_177413_a(EnumSkyBlock.SKY, blockpos) + " sky, " + chunk.func_177413_a(EnumSkyBlock.BLOCK, blockpos) + " block)"); + DifficultyInstance difficultyinstance = this.field_175242_a.field_71441_e.func_175649_E(blockpos); + if(this.field_175242_a.func_71387_A() && this.field_175242_a.func_71401_C() != null) { + EntityPlayerMP entityplayermp = this.field_175242_a.func_71401_C().func_71203_ab().func_177451_a(this.field_175242_a.field_71439_g.aK()); + if(entityplayermp != null) { + DifficultyInstance difficultyinstance1 = this.field_175242_a.func_71401_C().getDifficultyAsync(entityplayermp.o, new BlockPos(entityplayermp)); + if(difficultyinstance1 != null) { + difficultyinstance = difficultyinstance1; + } + } + } + + list.add(String.format("Local Difficulty: %.2f (Day %d)", new Object[]{Float.valueOf(difficultyinstance.func_180168_b()), Long.valueOf(this.field_175242_a.field_71441_e.func_72820_D() / 24000L)})); + } + + if(this.field_175242_a.field_71460_t != null && this.field_175242_a.field_71460_t.func_147702_a()) { + list.add("Shader: " + this.field_175242_a.field_71460_t.func_147706_e().func_148022_b()); + } + + if(this.field_175242_a.field_71476_x != null && this.field_175242_a.field_71476_x.field_72313_a == MovingObjectType.BLOCK && this.field_175242_a.field_71476_x.func_178782_a() != null) { + BlockPos blockpos1 = this.field_175242_a.field_71476_x.func_178782_a(); + list.add(String.format("Looking at: %d %d %d", new Object[]{Integer.valueOf(blockpos1.n()), Integer.valueOf(blockpos1.o()), Integer.valueOf(blockpos1.p())})); + } + + return list; + } + } + + protected List func_175238_c() { + long i = Runtime.getRuntime().maxMemory(); + long j = Runtime.getRuntime().totalMemory(); + long k = Runtime.getRuntime().freeMemory(); + long l = j - k; + List list = Lists.newArrayList(new String[]{String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S()?64:32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(7936)}), GL11.glGetString(7937), GL11.glGetString(7938)}); + long i1 = NativeMemory.getBufferAllocated(); + long j1 = NativeMemory.getBufferMaximum(); + String s = "Native: " + func_175240_a(i1) + "/" + func_175240_a(j1) + "MB"; + list.add(4, s); + list.set(5, "GC: " + MemoryMonitor.getAllocationRateMb() + "MB/s"); + if(Reflector.FMLCommonHandler_getBrandings.exists()) { + Object object = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + list.add(""); + list.addAll((Collection)Reflector.call(object, Reflector.FMLCommonHandler_getBrandings, new Object[]{Boolean.valueOf(false)})); + } + + if(this.func_175236_d()) { + return list; + } else { + if(this.field_175242_a.field_71476_x != null && this.field_175242_a.field_71476_x.field_72313_a == MovingObjectType.BLOCK && this.field_175242_a.field_71476_x.func_178782_a() != null) { + BlockPos blockpos = this.field_175242_a.field_71476_x.func_178782_a(); + IBlockState iblockstate = this.field_175242_a.field_71441_e.func_180495_p(blockpos); + if(this.field_175242_a.field_71441_e.func_175624_G() != WorldType.field_180272_g) { + iblockstate = iblockstate.func_177230_c().func_176221_a(iblockstate, this.field_175242_a.field_71441_e, blockpos); + } + + list.add(""); + list.add(String.valueOf(Block.field_149771_c.c(iblockstate.func_177230_c()))); + + for(Entry entry : iblockstate.func_177228_b().entrySet()) { + String s1 = ((Comparable)entry.getValue()).toString(); + if(entry.getValue() == Boolean.TRUE) { + s1 = EnumChatFormatting.GREEN + s1; + } else if(entry.getValue() == Boolean.FALSE) { + s1 = EnumChatFormatting.RED + s1; + } + + list.add(((IProperty)entry.getKey()).func_177701_a() + ": " + s1); + } + } + + return list; + } + } + + private void func_181554_e() { + } + + private int func_181552_c(int p_181552_1_, int p_181552_2_, int p_181552_3_, int p_181552_4_) { + return p_181552_1_ < p_181552_3_?this.func_181553_a(-16711936, -256, (float)p_181552_1_ / (float)p_181552_3_):this.func_181553_a(-256, -65536, (float)(p_181552_1_ - p_181552_3_) / (float)(p_181552_4_ - p_181552_3_)); + } + + private int func_181553_a(int p_181553_1_, int p_181553_2_, float p_181553_3_) { + int i = p_181553_1_ >> 24 & 255; + int j = p_181553_1_ >> 16 & 255; + int k = p_181553_1_ >> 8 & 255; + int l = p_181553_1_ & 255; + int i1 = p_181553_2_ >> 24 & 255; + int j1 = p_181553_2_ >> 16 & 255; + int k1 = p_181553_2_ >> 8 & 255; + int l1 = p_181553_2_ & 255; + int i2 = MathHelper.func_76125_a((int)((float)i + (float)(i1 - i) * p_181553_3_), 0, 255); + int j2 = MathHelper.func_76125_a((int)((float)j + (float)(j1 - j) * p_181553_3_), 0, 255); + int k2 = MathHelper.func_76125_a((int)((float)k + (float)(k1 - k) * p_181553_3_), 0, 255); + int l2 = MathHelper.func_76125_a((int)((float)l + (float)(l1 - l) * p_181553_3_), 0, 255); + return i2 << 24 | j2 << 16 | k2 << 8 | l2; + } + + private static long func_175240_a(long p_175240_0_) { + return p_175240_0_ / 1024L / 1024L; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiPageButtonList.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiPageButtonList.java new file mode 100644 index 0000000..1f2e5c1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiPageButtonList.java @@ -0,0 +1,622 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Objects; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.util.IntHashMap; + +public class GuiPageButtonList extends GuiListExtended +{ + private final List field_178074_u = Lists.newArrayList(); + private final IntHashMap field_178073_v = new IntHashMap(); + private final List field_178072_w = Lists.newArrayList(); + private final GuiPageButtonList.GuiListEntry[][] field_178078_x; + private int field_178077_y; + private GuiPageButtonList.GuiResponder field_178076_z; + private Gui field_178075_A; + + public GuiPageButtonList(Minecraft mcIn, int widthIn, int heightIn, int topIn, int bottomIn, int slotHeightIn, GuiPageButtonList.GuiResponder p_i45536_7_, GuiPageButtonList.GuiListEntry[]... p_i45536_8_) + { + super(mcIn, widthIn, heightIn, topIn, bottomIn, slotHeightIn); + this.field_178076_z = p_i45536_7_; + this.field_178078_x = p_i45536_8_; + this.field_148163_i = false; + this.func_178069_s(); + this.func_178055_t(); + } + + private void func_178069_s() + { + for (GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry : this.field_178078_x) + { + for (int i = 0; i < aguipagebuttonlist$guilistentry.length; i += 2) + { + GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry = aguipagebuttonlist$guilistentry[i]; + GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry1 = i < aguipagebuttonlist$guilistentry.length - 1 ? aguipagebuttonlist$guilistentry[i + 1] : null; + Gui gui = this.func_178058_a(guipagebuttonlist$guilistentry, 0, guipagebuttonlist$guilistentry1 == null); + Gui gui1 = this.func_178058_a(guipagebuttonlist$guilistentry1, 160, guipagebuttonlist$guilistentry == null); + GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = new GuiPageButtonList.GuiEntry(gui, gui1); + this.field_178074_u.add(guipagebuttonlist$guientry); + + if (guipagebuttonlist$guilistentry != null && gui != null) + { + this.field_178073_v.addKey(guipagebuttonlist$guilistentry.func_178935_b(), gui); + + if (gui instanceof GuiTextField) + { + this.field_178072_w.add((GuiTextField)gui); + } + } + + if (guipagebuttonlist$guilistentry1 != null && gui1 != null) + { + this.field_178073_v.addKey(guipagebuttonlist$guilistentry1.func_178935_b(), gui1); + + if (gui1 instanceof GuiTextField) + { + this.field_178072_w.add((GuiTextField)gui1); + } + } + } + } + } + + private void func_178055_t() + { + this.field_178074_u.clear(); + + for (int i = 0; i < this.field_178078_x[this.field_178077_y].length; i += 2) + { + GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry = this.field_178078_x[this.field_178077_y][i]; + GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry1 = i < this.field_178078_x[this.field_178077_y].length - 1 ? this.field_178078_x[this.field_178077_y][i + 1] : null; + Gui gui = (Gui)this.field_178073_v.lookup(guipagebuttonlist$guilistentry.func_178935_b()); + Gui gui1 = guipagebuttonlist$guilistentry1 != null ? (Gui)this.field_178073_v.lookup(guipagebuttonlist$guilistentry1.func_178935_b()) : null; + GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = new GuiPageButtonList.GuiEntry(gui, gui1); + this.field_178074_u.add(guipagebuttonlist$guientry); + } + } + + public void func_181156_c(int p_181156_1_) + { + if (p_181156_1_ != this.field_178077_y) + { + int i = this.field_178077_y; + this.field_178077_y = p_181156_1_; + this.func_178055_t(); + this.func_178060_e(i, p_181156_1_); + this.amountScrolled = 0.0F; + } + } + + public int func_178059_e() + { + return this.field_178077_y; + } + + public int func_178057_f() + { + return this.field_178078_x.length; + } + + public Gui func_178056_g() + { + return this.field_178075_A; + } + + public void func_178071_h() + { + if (this.field_178077_y > 0) + { + this.func_181156_c(this.field_178077_y - 1); + } + } + + public void func_178064_i() + { + if (this.field_178077_y < this.field_178078_x.length - 1) + { + this.func_181156_c(this.field_178077_y + 1); + } + } + + public Gui func_178061_c(int p_178061_1_) + { + return (Gui)this.field_178073_v.lookup(p_178061_1_); + } + + private void func_178060_e(int p_178060_1_, int p_178060_2_) + { + for (GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry : this.field_178078_x[p_178060_1_]) + { + if (guipagebuttonlist$guilistentry != null) + { + this.func_178066_a((Gui)this.field_178073_v.lookup(guipagebuttonlist$guilistentry.func_178935_b()), false); + } + } + + for (GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry1 : this.field_178078_x[p_178060_2_]) + { + if (guipagebuttonlist$guilistentry1 != null) + { + this.func_178066_a((Gui)this.field_178073_v.lookup(guipagebuttonlist$guilistentry1.func_178935_b()), true); + } + } + } + + private void func_178066_a(Gui p_178066_1_, boolean p_178066_2_) + { + if (p_178066_1_ instanceof GuiButton) + { + ((GuiButton)p_178066_1_).visible = p_178066_2_; + } + else if (p_178066_1_ instanceof GuiTextField) + { + ((GuiTextField)p_178066_1_).setVisible(p_178066_2_); + } + else if (p_178066_1_ instanceof GuiLabel) + { + ((GuiLabel)p_178066_1_).visible = p_178066_2_; + } + } + + private Gui func_178058_a(GuiPageButtonList.GuiListEntry p_178058_1_, int p_178058_2_, boolean p_178058_3_) + { + return (Gui)(p_178058_1_ instanceof GuiPageButtonList.GuiSlideEntry ? this.func_178067_a(this.width / 2 - 155 + p_178058_2_, 0, (GuiPageButtonList.GuiSlideEntry)p_178058_1_) : (p_178058_1_ instanceof GuiPageButtonList.GuiButtonEntry ? this.func_178065_a(this.width / 2 - 155 + p_178058_2_, 0, (GuiPageButtonList.GuiButtonEntry)p_178058_1_) : (p_178058_1_ instanceof GuiPageButtonList.EditBoxEntry ? this.func_178068_a(this.width / 2 - 155 + p_178058_2_, 0, (GuiPageButtonList.EditBoxEntry)p_178058_1_) : (p_178058_1_ instanceof GuiPageButtonList.GuiLabelEntry ? this.func_178063_a(this.width / 2 - 155 + p_178058_2_, 0, (GuiPageButtonList.GuiLabelEntry)p_178058_1_, p_178058_3_) : null)))); + } + + public void func_181155_a(boolean p_181155_1_) + { + for (GuiPageButtonList.GuiEntry guipagebuttonlist$guientry : this.field_178074_u) + { + if (guipagebuttonlist$guientry.field_178029_b instanceof GuiButton) + { + ((GuiButton)guipagebuttonlist$guientry.field_178029_b).enabled = p_181155_1_; + } + + if (guipagebuttonlist$guientry.field_178030_c instanceof GuiButton) + { + ((GuiButton)guipagebuttonlist$guientry.field_178030_c).enabled = p_181155_1_; + } + } + } + + public boolean mouseClicked(int mouseX, int mouseY, int mouseEvent) + { + boolean flag = super.mouseClicked(mouseX, mouseY, mouseEvent); + int i = this.getSlotIndexFromScreenCoords(mouseX, mouseY); + + if (i >= 0) + { + GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = this.getListEntry(i); + + if (this.field_178075_A != guipagebuttonlist$guientry.field_178028_d && this.field_178075_A != null && this.field_178075_A instanceof GuiTextField) + { + ((GuiTextField)this.field_178075_A).setFocused(false); + } + + this.field_178075_A = guipagebuttonlist$guientry.field_178028_d; + } + + return flag; + } + + private GuiSlider func_178067_a(int p_178067_1_, int p_178067_2_, GuiPageButtonList.GuiSlideEntry p_178067_3_) + { + GuiSlider guislider = new GuiSlider(this.field_178076_z, p_178067_3_.func_178935_b(), p_178067_1_, p_178067_2_, p_178067_3_.func_178936_c(), p_178067_3_.func_178943_e(), p_178067_3_.func_178944_f(), p_178067_3_.func_178942_g(), p_178067_3_.func_178945_a()); + guislider.visible = p_178067_3_.func_178934_d(); + return guislider; + } + + private GuiListButton func_178065_a(int p_178065_1_, int p_178065_2_, GuiPageButtonList.GuiButtonEntry p_178065_3_) + { + GuiListButton guilistbutton = new GuiListButton(this.field_178076_z, p_178065_3_.func_178935_b(), p_178065_1_, p_178065_2_, p_178065_3_.func_178936_c(), p_178065_3_.func_178940_a()); + guilistbutton.visible = p_178065_3_.func_178934_d(); + return guilistbutton; + } + + private GuiTextField func_178068_a(int p_178068_1_, int p_178068_2_, GuiPageButtonList.EditBoxEntry p_178068_3_) + { + GuiTextField guitextfield = new GuiTextField(p_178068_3_.func_178935_b(), this.mc.fontRendererObj, p_178068_1_, p_178068_2_, 150, 20); + guitextfield.setText(p_178068_3_.func_178936_c()); + guitextfield.func_175207_a(this.field_178076_z); + guitextfield.setVisible(p_178068_3_.func_178934_d()); + guitextfield.setValidator(p_178068_3_.func_178950_a()); + return guitextfield; + } + + private GuiLabel func_178063_a(int p_178063_1_, int p_178063_2_, GuiPageButtonList.GuiLabelEntry p_178063_3_, boolean p_178063_4_) + { + GuiLabel guilabel; + + if (p_178063_4_) + { + guilabel = new GuiLabel(this.mc.fontRendererObj, p_178063_3_.func_178935_b(), p_178063_1_, p_178063_2_, this.width - p_178063_1_ * 2, 20, -1); + } + else + { + guilabel = new GuiLabel(this.mc.fontRendererObj, p_178063_3_.func_178935_b(), p_178063_1_, p_178063_2_, 150, 20, -1); + } + + guilabel.visible = p_178063_3_.func_178934_d(); + guilabel.func_175202_a(p_178063_3_.func_178936_c()); + guilabel.setCentered(); + return guilabel; + } + + public void func_178062_a(char p_178062_1_, int p_178062_2_) + { + if (this.field_178075_A instanceof GuiTextField) + { + GuiTextField guitextfield = (GuiTextField)this.field_178075_A; + + if (!GuiScreen.isKeyComboCtrlV(p_178062_2_)) + { + if (p_178062_2_ == 15) + { + guitextfield.setFocused(false); + int k = this.field_178072_w.indexOf(this.field_178075_A); + + if (GuiScreen.isShiftKeyDown()) + { + if (k == 0) + { + k = this.field_178072_w.size() - 1; + } + else + { + --k; + } + } + else if (k == this.field_178072_w.size() - 1) + { + k = 0; + } + else + { + ++k; + } + + this.field_178075_A = (Gui)this.field_178072_w.get(k); + guitextfield = (GuiTextField)this.field_178075_A; + guitextfield.setFocused(true); + int l = guitextfield.yPosition + this.slotHeight; + int i1 = guitextfield.yPosition; + + if (l > this.bottom) + { + this.amountScrolled += (float)(l - this.bottom); + } + else if (i1 < this.top) + { + this.amountScrolled = (float)i1; + } + } + else + { + guitextfield.textboxKeyTyped(p_178062_1_, p_178062_2_); + } + } + else + { + String s = GuiScreen.getClipboardString(); + String[] astring = s.split(";"); + int i = this.field_178072_w.indexOf(this.field_178075_A); + int j = i; + + for (String s1 : astring) + { + ((GuiTextField)this.field_178072_w.get(j)).setText(s1); + + if (j == this.field_178072_w.size() - 1) + { + j = 0; + } + else + { + ++j; + } + + if (j == i) + { + break; + } + } + } + } + } + + public GuiPageButtonList.GuiEntry getListEntry(int index) + { + return (GuiPageButtonList.GuiEntry)this.field_178074_u.get(index); + } + + public int getSize() + { + return this.field_178074_u.size(); + } + + public int getListWidth() + { + return 400; + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 32; + } + + public static class EditBoxEntry extends GuiPageButtonList.GuiListEntry + { + private final Predicate field_178951_a; + + public EditBoxEntry(int p_i45534_1_, String p_i45534_2_, boolean p_i45534_3_, Predicate p_i45534_4_) + { + super(p_i45534_1_, p_i45534_2_, p_i45534_3_); + this.field_178951_a = (Predicate)Objects.firstNonNull(p_i45534_4_, Predicates.alwaysTrue()); + } + + public Predicate func_178950_a() + { + return this.field_178951_a; + } + } + + public static class GuiButtonEntry extends GuiPageButtonList.GuiListEntry + { + private final boolean field_178941_a; + + public GuiButtonEntry(int p_i45535_1_, String p_i45535_2_, boolean p_i45535_3_, boolean p_i45535_4_) + { + super(p_i45535_1_, p_i45535_2_, p_i45535_3_); + this.field_178941_a = p_i45535_4_; + } + + public boolean func_178940_a() + { + return this.field_178941_a; + } + } + + public static class GuiEntry implements GuiListExtended.IGuiListEntry + { + private final Minecraft field_178031_a = Minecraft.getMinecraft(); + private final Gui field_178029_b; + private final Gui field_178030_c; + private Gui field_178028_d; + + public GuiEntry(Gui p_i45533_1_, Gui p_i45533_2_) + { + this.field_178029_b = p_i45533_1_; + this.field_178030_c = p_i45533_2_; + } + + public Gui func_178022_a() + { + return this.field_178029_b; + } + + public Gui func_178021_b() + { + return this.field_178030_c; + } + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + { + this.func_178017_a(this.field_178029_b, y, mouseX, mouseY, false); + this.func_178017_a(this.field_178030_c, y, mouseX, mouseY, false); + } + + private void func_178017_a(Gui p_178017_1_, int p_178017_2_, int p_178017_3_, int p_178017_4_, boolean p_178017_5_) + { + if (p_178017_1_ != null) + { + if (p_178017_1_ instanceof GuiButton) + { + this.func_178024_a((GuiButton)p_178017_1_, p_178017_2_, p_178017_3_, p_178017_4_, p_178017_5_); + } + else if (p_178017_1_ instanceof GuiTextField) + { + this.func_178027_a((GuiTextField)p_178017_1_, p_178017_2_, p_178017_5_); + } + else if (p_178017_1_ instanceof GuiLabel) + { + this.func_178025_a((GuiLabel)p_178017_1_, p_178017_2_, p_178017_3_, p_178017_4_, p_178017_5_); + } + } + } + + private void func_178024_a(GuiButton p_178024_1_, int p_178024_2_, int p_178024_3_, int p_178024_4_, boolean p_178024_5_) + { + p_178024_1_.yPosition = p_178024_2_; + + if (!p_178024_5_) + { + p_178024_1_.drawButton(this.field_178031_a, p_178024_3_, p_178024_4_); + } + } + + private void func_178027_a(GuiTextField p_178027_1_, int p_178027_2_, boolean p_178027_3_) + { + p_178027_1_.yPosition = p_178027_2_; + + if (!p_178027_3_) + { + p_178027_1_.drawTextBox(); + } + } + + private void func_178025_a(GuiLabel p_178025_1_, int p_178025_2_, int p_178025_3_, int p_178025_4_, boolean p_178025_5_) + { + p_178025_1_.field_146174_h = p_178025_2_; + + if (!p_178025_5_) + { + p_178025_1_.drawLabel(this.field_178031_a, p_178025_3_, p_178025_4_); + } + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) + { + this.func_178017_a(this.field_178029_b, p_178011_3_, 0, 0, true); + this.func_178017_a(this.field_178030_c, p_178011_3_, 0, 0, true); + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + boolean flag = this.func_178026_a(this.field_178029_b, p_148278_2_, p_148278_3_, p_148278_4_); + boolean flag1 = this.func_178026_a(this.field_178030_c, p_148278_2_, p_148278_3_, p_148278_4_); + return flag || flag1; + } + + private boolean func_178026_a(Gui p_178026_1_, int p_178026_2_, int p_178026_3_, int p_178026_4_) + { + if (p_178026_1_ == null) + { + return false; + } + else if (p_178026_1_ instanceof GuiButton) + { + return this.func_178023_a((GuiButton)p_178026_1_, p_178026_2_, p_178026_3_, p_178026_4_); + } + else + { + if (p_178026_1_ instanceof GuiTextField) + { + this.func_178018_a((GuiTextField)p_178026_1_, p_178026_2_, p_178026_3_, p_178026_4_); + } + + return false; + } + } + + private boolean func_178023_a(GuiButton p_178023_1_, int p_178023_2_, int p_178023_3_, int p_178023_4_) + { + boolean flag = p_178023_1_.mousePressed(this.field_178031_a, p_178023_2_, p_178023_3_); + + if (flag) + { + this.field_178028_d = p_178023_1_; + } + + return flag; + } + + private void func_178018_a(GuiTextField p_178018_1_, int p_178018_2_, int p_178018_3_, int p_178018_4_) + { + p_178018_1_.mouseClicked(p_178018_2_, p_178018_3_, p_178018_4_); + + if (p_178018_1_.isFocused()) + { + this.field_178028_d = p_178018_1_; + } + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + this.func_178016_b(this.field_178029_b, x, y, mouseEvent); + this.func_178016_b(this.field_178030_c, x, y, mouseEvent); + } + + private void func_178016_b(Gui p_178016_1_, int p_178016_2_, int p_178016_3_, int p_178016_4_) + { + if (p_178016_1_ != null) + { + if (p_178016_1_ instanceof GuiButton) + { + this.func_178019_b((GuiButton)p_178016_1_, p_178016_2_, p_178016_3_, p_178016_4_); + } + } + } + + private void func_178019_b(GuiButton p_178019_1_, int p_178019_2_, int p_178019_3_, int p_178019_4_) + { + p_178019_1_.mouseReleased(p_178019_2_, p_178019_3_); + } + } + + public static class GuiLabelEntry extends GuiPageButtonList.GuiListEntry + { + public GuiLabelEntry(int p_i45532_1_, String p_i45532_2_, boolean p_i45532_3_) + { + super(p_i45532_1_, p_i45532_2_, p_i45532_3_); + } + } + + public static class GuiListEntry + { + private final int field_178939_a; + private final String field_178937_b; + private final boolean field_178938_c; + + public GuiListEntry(int p_i45531_1_, String p_i45531_2_, boolean p_i45531_3_) + { + this.field_178939_a = p_i45531_1_; + this.field_178937_b = p_i45531_2_; + this.field_178938_c = p_i45531_3_; + } + + public int func_178935_b() + { + return this.field_178939_a; + } + + public String func_178936_c() + { + return this.field_178937_b; + } + + public boolean func_178934_d() + { + return this.field_178938_c; + } + } + + public interface GuiResponder + { + void func_175321_a(int p_175321_1_, boolean p_175321_2_); + + void onTick(int id, float value); + + void func_175319_a(int p_175319_1_, String p_175319_2_); + } + + public static class GuiSlideEntry extends GuiPageButtonList.GuiListEntry + { + private final GuiSlider.FormatHelper field_178949_a; + private final float field_178947_b; + private final float field_178948_c; + private final float field_178946_d; + + public GuiSlideEntry(int p_i45530_1_, String p_i45530_2_, boolean p_i45530_3_, GuiSlider.FormatHelper p_i45530_4_, float p_i45530_5_, float p_i45530_6_, float p_i45530_7_) + { + super(p_i45530_1_, p_i45530_2_, p_i45530_3_); + this.field_178949_a = p_i45530_4_; + this.field_178947_b = p_i45530_5_; + this.field_178948_c = p_i45530_6_; + this.field_178946_d = p_i45530_7_; + } + + public GuiSlider.FormatHelper func_178945_a() + { + return this.field_178949_a; + } + + public float func_178943_e() + { + return this.field_178947_b; + } + + public float func_178944_f() + { + return this.field_178948_c; + } + + public float func_178942_g() + { + return this.field_178946_d; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiPlayerTabOverlay.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiPlayerTabOverlay.java new file mode 100644 index 0000000..ff231e1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiPlayerTabOverlay.java @@ -0,0 +1,325 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import com.google.common.collect.ComparisonChain; +import com.google.common.collect.Ordering; +import com.mojang.authlib.GameProfile; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.WorldSettings; + +import java.util.Comparator; +import java.util.List; + +public class GuiPlayerTabOverlay extends Gui { + public static final Ordering field_175252_a = Ordering.from(new GuiPlayerTabOverlay.PlayerComparator()); + private final Minecraft mc; + private final GuiIngame guiIngame; + public IChatComponent footer; + public IChatComponent header; + private long lastTimeOpened; + private boolean isBeingRendered; + + public GuiPlayerTabOverlay(Minecraft mcIn, GuiIngame guiIngameIn) { + this.mc = mcIn; + this.guiIngame = guiIngameIn; + } + + public String getPlayerName(NetworkPlayerInfo networkPlayerInfoIn) { + return networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName()); + } + + public void updatePlayerList(boolean willBeRendered) { + if (willBeRendered && !this.isBeingRendered) { + this.lastTimeOpened = Minecraft.getSystemTime(); + } + + this.isBeingRendered = willBeRendered; + } + + public void renderPlayerlist(int width, Scoreboard scoreboardIn, ScoreObjective scoreObjectiveIn) { + NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue; + List list = field_175252_a.sortedCopy(nethandlerplayclient.getPlayerInfoMap()); + int i = 0; + int j = 0; + + for (NetworkPlayerInfo networkplayerinfo : list) { + int k = this.mc.fontRendererObj.getStringWidth(this.getPlayerName(networkplayerinfo)); + i = Math.max(i, k); + + if (scoreObjectiveIn != null && scoreObjectiveIn.getRenderType() != IScoreObjectiveCriteria.EnumRenderType.HEARTS) { + k = this.mc.fontRendererObj.getStringWidth(" " + scoreboardIn.getValueFromObjective(networkplayerinfo.getGameProfile().getName(), scoreObjectiveIn).getScorePoints()); + j = Math.max(j, k); + } + } + + list = list.subList(0, Math.min(list.size(), 80)); + int l3 = list.size(); + int i4 = l3; + int j4; + + for (j4 = 1; i4 > 20; i4 = (l3 + j4 - 1) / j4) { + ++j4; + } + + boolean flag = this.mc.isIntegratedServerRunning() || this.mc.getNetHandler().getNetworkManager().getIsencrypted(); + int l; + + if (scoreObjectiveIn != null) { + if (scoreObjectiveIn.getRenderType() == IScoreObjectiveCriteria.EnumRenderType.HEARTS) { + l = 90; + } else { + l = j; + } + } else { + l = 0; + } + + int i1 = Math.min(j4 * ((flag ? 9 : 0) + i + l + 13), width - 50) / j4; + int j1 = width / 2 - (i1 * j4 + (j4 - 1) * 5) / 2; + int k1 = 10; + int l1 = i1 * j4 + (j4 - 1) * 5; + List list1 = null; + List list2 = null; + + if (this.header != null) { + list1 = this.mc.fontRendererObj.listFormattedStringToWidth(this.header.getFormattedText(), width - 50); + + for (String s : list1) { + l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s)); + } + } + + if (this.footer != null) { + list2 = this.mc.fontRendererObj.listFormattedStringToWidth(this.footer.getFormattedText(), width - 50); + + for (String s2 : list2) { + l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s2)); + } + } + + if (list1 != null) { + drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list1.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE); + + for (String s3 : list1) { + int i2 = this.mc.fontRendererObj.getStringWidth(s3); + this.mc.fontRendererObj.drawStringWithShadow(s3, (float) (width / 2 - i2 / 2), (float) k1, -1); + k1 += this.mc.fontRendererObj.FONT_HEIGHT; + } + + ++k1; + } + + drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + i4 * 9, Integer.MIN_VALUE); + + for (int k4 = 0; k4 < l3; ++k4) { + int l4 = k4 / i4; + int i5 = k4 % i4; + int j2 = j1 + l4 * i1 + l4 * 5; + int k2 = k1 + i5 * 9; + drawRect(j2, k2, j2 + i1, k2 + 8, 553648127); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + + if (k4 < list.size()) { + NetworkPlayerInfo networkplayerinfo1 = list.get(k4); + String s1 = this.getPlayerName(networkplayerinfo1); + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + s1 = s1.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + s1 = s1.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + GameProfile gameprofile = networkplayerinfo1.getGameProfile(); + + if (flag) { + EntityPlayer entityplayer = this.mc.theWorld.getPlayerEntityByUUID(gameprofile.getId()); + boolean flag1 = entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.CAPE) && (gameprofile.getName().equals("Dinnerbone") || gameprofile.getName().equals("Grumm")); + this.mc.getTextureManager().bindTexture(networkplayerinfo1.getLocationSkin()); + int l2 = 8 + (flag1 ? 8 : 0); + int i3 = 8 * (flag1 ? -1 : 1); + Gui.drawScaledCustomSizeModalRect(j2, k2, 8.0F, (float) l2, 8, i3, 8, 8, 64.0F, 64.0F); + + if (entityplayer != null && entityplayer.isWearing(EnumPlayerModelParts.HAT)) { + int j3 = 8 + (flag1 ? 8 : 0); + int k3 = 8 * (flag1 ? -1 : 1); + Gui.drawScaledCustomSizeModalRect(j2, k2, 40.0F, (float) j3, 8, k3, 8, 8, 64.0F, 64.0F); + } + + j2 += 9; + } + + if (networkplayerinfo1.getGameType() == WorldSettings.GameType.SPECTATOR) { + s1 = EnumChatFormatting.ITALIC + s1; + this.mc.fontRendererObj.drawStringWithShadow(s1, (float) j2, (float) k2, -1862270977); + } else { + this.mc.fontRendererObj.drawStringWithShadow(s1, (float) j2, (float) k2, -1); + } + + if (scoreObjectiveIn != null && networkplayerinfo1.getGameType() != WorldSettings.GameType.SPECTATOR) { + int k5 = j2 + i + 1; + int l5 = k5 + l; + + if (l5 - k5 > 5) { + this.drawScoreboardValues(scoreObjectiveIn, k2, gameprofile.getName(), k5, l5, networkplayerinfo1); + } + } + + this.drawPing(i1, j2 - (flag ? 9 : 0), k2, networkplayerinfo1); + } + } + + if (list2 != null) { + k1 = k1 + i4 * 9 + 1; + drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1, k1 + list2.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE); + + for (String s4 : list2) { + int j5 = this.mc.fontRendererObj.getStringWidth(s4); + this.mc.fontRendererObj.drawStringWithShadow(s4, (float) (width / 2 - j5 / 2), (float) k1, -1); + k1 += this.mc.fontRendererObj.FONT_HEIGHT; + } + } + } + + public void drawPing(int p_175245_1_, int p_175245_2_, int p_175245_3_, NetworkPlayerInfo networkPlayerInfoIn) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + int i = 0; + int j = 0; + + if (networkPlayerInfoIn.getResponseTime() < 0) { + j = 5; + } else if (networkPlayerInfoIn.getResponseTime() < 150) { + j = 0; + } else if (networkPlayerInfoIn.getResponseTime() < 300) { + j = 1; + } else if (networkPlayerInfoIn.getResponseTime() < 600) { + j = 2; + } else if (networkPlayerInfoIn.getResponseTime() < 1000) { + j = 3; + } else { + j = 4; + } + + this.zLevel += 100.0F; + this.drawTexturedModalRect(p_175245_2_ + p_175245_1_ - 11, p_175245_3_, 0 + i * 10, 176 + j * 8, 10, 8); + this.zLevel -= 100.0F; + } + + public void drawScoreboardValues(ScoreObjective p_175247_1_, int p_175247_2_, String p_175247_3_, int p_175247_4_, int p_175247_5_, NetworkPlayerInfo p_175247_6_) { + int i = p_175247_1_.getScoreboard().getValueFromObjective(p_175247_3_, p_175247_1_).getScorePoints(); + + if (p_175247_1_.getRenderType() == IScoreObjectiveCriteria.EnumRenderType.HEARTS) { + this.mc.getTextureManager().bindTexture(icons); + + if (this.lastTimeOpened == p_175247_6_.func_178855_p()) { + if (i < p_175247_6_.func_178835_l()) { + p_175247_6_.func_178846_a(Minecraft.getSystemTime()); + p_175247_6_.func_178844_b((long) (this.guiIngame.getUpdateCounter() + 20)); + } else if (i > p_175247_6_.func_178835_l()) { + p_175247_6_.func_178846_a(Minecraft.getSystemTime()); + p_175247_6_.func_178844_b((long) (this.guiIngame.getUpdateCounter() + 10)); + } + } + + if (Minecraft.getSystemTime() - p_175247_6_.func_178847_n() > 1000L || this.lastTimeOpened != p_175247_6_.func_178855_p()) { + p_175247_6_.func_178836_b(i); + p_175247_6_.func_178857_c(i); + p_175247_6_.func_178846_a(Minecraft.getSystemTime()); + } + + p_175247_6_.func_178843_c(this.lastTimeOpened); + p_175247_6_.func_178836_b(i); + int j = MathHelper.ceiling_float_int((float) Math.max(i, p_175247_6_.func_178860_m()) / 2.0F); + int k = Math.max(MathHelper.ceiling_float_int((float) (i / 2)), Math.max(MathHelper.ceiling_float_int((float) (p_175247_6_.func_178860_m() / 2)), 10)); + boolean flag = p_175247_6_.func_178858_o() > (long) this.guiIngame.getUpdateCounter() && (p_175247_6_.func_178858_o() - (long) this.guiIngame.getUpdateCounter()) / 3L % 2L == 1L; + + if (j > 0) { + float f = Math.min((float) (p_175247_5_ - p_175247_4_ - 4) / (float) k, 9.0F); + + if (f > 3.0F) { + for (int l = j; l < k; ++l) { + this.drawTexturedModalRect((float) p_175247_4_ + (float) l * f, (float) p_175247_2_, flag ? 25 : 16, 0, 9, 9); + } + + for (int j1 = 0; j1 < j; ++j1) { + this.drawTexturedModalRect((float) p_175247_4_ + (float) j1 * f, (float) p_175247_2_, flag ? 25 : 16, 0, 9, 9); + + if (flag) { + if (j1 * 2 + 1 < p_175247_6_.func_178860_m()) { + this.drawTexturedModalRect((float) p_175247_4_ + (float) j1 * f, (float) p_175247_2_, 70, 0, 9, 9); + } + + if (j1 * 2 + 1 == p_175247_6_.func_178860_m()) { + this.drawTexturedModalRect((float) p_175247_4_ + (float) j1 * f, (float) p_175247_2_, 79, 0, 9, 9); + } + } + + if (j1 * 2 + 1 < i) { + this.drawTexturedModalRect((float) p_175247_4_ + (float) j1 * f, (float) p_175247_2_, j1 >= 10 ? 160 : 52, 0, 9, 9); + } + + if (j1 * 2 + 1 == i) { + this.drawTexturedModalRect((float) p_175247_4_ + (float) j1 * f, (float) p_175247_2_, j1 >= 10 ? 169 : 61, 0, 9, 9); + } + } + } else { + float f1 = MathHelper.clamp_float((float) i / 20.0F, 0.0F, 1.0F); + int i1 = (int) ((1.0F - f1) * 255.0F) << 16 | (int) (f1 * 255.0F) << 8; + String s = "" + (float) i / 2.0F; + + if (p_175247_5_ - this.mc.fontRendererObj.getStringWidth(s + "hp") >= p_175247_4_) { + s = s + "hp"; + } + + this.mc.fontRendererObj.drawStringWithShadow(s, (float) ((p_175247_5_ + p_175247_4_) / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2), (float) p_175247_2_, i1); + } + } + } else { + String s1 = EnumChatFormatting.YELLOW + "" + i; + this.mc.fontRendererObj.drawStringWithShadow(s1, (float) (p_175247_5_ - this.mc.fontRendererObj.getStringWidth(s1)), (float) p_175247_2_, 16777215); + } + } + + public void setFooter(IChatComponent footerIn) { + this.footer = footerIn; + } + + public void setHeader(IChatComponent headerIn) { + this.header = headerIn; + } + + public void resetFooterHeader() { + this.header = null; + this.footer = null; + } + + static class PlayerComparator implements Comparator { + private PlayerComparator() { + } + + public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_) { + ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam(); + ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam(); + return ComparisonChain.start().compareTrueFirst(p_compare_1_.getGameType() != WorldSettings.GameType.SPECTATOR, p_compare_2_.getGameType() != WorldSettings.GameType.SPECTATOR).compare(scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "", scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : "").compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java new file mode 100644 index 0000000..3bc7397 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java @@ -0,0 +1,87 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.lwjgl.input.Keyboard; + +public class GuiRenameWorld extends GuiScreen +{ + private GuiScreen parentScreen; + private GuiTextField field_146583_f; + private final String saveName; + + public GuiRenameWorld(GuiScreen parentScreenIn, String saveNameIn) + { + this.parentScreen = parentScreenIn; + this.saveName = saveNameIn; + } + + public void updateScreen() + { + this.field_146583_f.updateCursorCounter(); + } + + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.renameButton", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0]))); + ISaveFormat isaveformat = this.mc.getSaveLoader(); + WorldInfo worldinfo = isaveformat.getWorldInfo(this.saveName); + String s = worldinfo.getWorldName(); + this.field_146583_f = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146583_f.setFocused(true); + this.field_146583_f.setText(s); + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 0) + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.renameWorld(this.saveName, this.field_146583_f.getText().trim()); + this.mc.displayGuiScreen(this.parentScreen); + } + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + this.field_146583_f.textboxKeyTyped(typedChar, keyCode); + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146583_f.getText().trim().length() > 0; + + if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146583_f.mouseClicked(mouseX, mouseY, mouseButton); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.renameTitle", new Object[0]), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), this.width / 2 - 100, 47, 10526880); + this.field_146583_f.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiRepair.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiRepair.java new file mode 100644 index 0000000..96f2201 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiRepair.java @@ -0,0 +1,191 @@ +package net.minecraft.client.gui; + +import io.netty.buffer.Unpooled; +import java.io.IOException; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.input.Keyboard; + +public class GuiRepair extends GuiContainer implements ICrafting +{ + private static final ResourceLocation anvilResource = new ResourceLocation("textures/gui/container/anvil.png"); + private ContainerRepair anvil; + private GuiTextField nameField; + private InventoryPlayer playerInventory; + + public GuiRepair(InventoryPlayer inventoryIn, World worldIn) + { + super(new ContainerRepair(inventoryIn, worldIn, Minecraft.getMinecraft().thePlayer)); + this.playerInventory = inventoryIn; + this.anvil = (ContainerRepair)this.inventorySlots; + } + + public void initGui() + { + super.initGui(); + Keyboard.enableRepeatEvents(true); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.nameField = new GuiTextField(0, this.fontRendererObj, i + 62, j + 24, 103, 12); + this.nameField.setTextColor(-1); + this.nameField.setDisabledTextColour(-1); + this.nameField.setEnableBackgroundDrawing(false); + this.nameField.setMaxStringLength(30); + this.inventorySlots.removeCraftingFromCrafters(this); + this.inventorySlots.onCraftGuiOpened(this); + } + + public void onGuiClosed() + { + super.onGuiClosed(); + Keyboard.enableRepeatEvents(false); + this.inventorySlots.removeCraftingFromCrafters(this); + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); + this.fontRendererObj.drawString(I18n.format("container.repair", new Object[0]), 60, 6, 4210752); + + if (this.anvil.maximumCost > 0) + { + int i = 8453920; + boolean flag = true; + String s = I18n.format("container.repair.cost", new Object[] {Integer.valueOf(this.anvil.maximumCost)}); + + if (this.anvil.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) + { + s = I18n.format("container.repair.expensive", new Object[0]); + i = 16736352; + } + else if (!this.anvil.getSlot(2).getHasStack()) + { + flag = false; + } + else if (!this.anvil.getSlot(2).canTakeStack(this.playerInventory.player)) + { + i = 16736352; + } + + if (flag) + { + int j = -16777216 | (i & 16579836) >> 2 | i & -16777216; + int k = this.xSize - 8 - this.fontRendererObj.getStringWidth(s); + int l = 67; + + if (this.fontRendererObj.getUnicodeFlag()) + { + drawRect(k - 3, l - 2, this.xSize - 7, l + 10, -16777216); + drawRect(k - 2, l - 1, this.xSize - 8, l + 9, -12895429); + } + else + { + this.fontRendererObj.drawString(s, k, l + 1, j); + this.fontRendererObj.drawString(s, k + 1, l, j); + this.fontRendererObj.drawString(s, k + 1, l + 1, j); + } + + this.fontRendererObj.drawString(s, k, l, i); + } + } + + GlStateManager.enableLighting(); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (this.nameField.textboxKeyTyped(typedChar, keyCode)) + { + this.renameItem(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + + private void renameItem() + { + String s = this.nameField.getText(); + Slot slot = this.anvil.getSlot(0); + + if (slot != null && slot.getHasStack() && !slot.getStack().hasDisplayName() && s.equals(slot.getStack().getDisplayName())) + { + s = ""; + } + + this.anvil.updateItemName(s); + this.mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", (new PacketBuffer(Unpooled.buffer())).writeString(s))); + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.nameField.mouseClicked(mouseX, mouseY, mouseButton); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); + this.nameField.drawTextBox(); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(anvilResource); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + this.drawTexturedModalRect(i + 59, j + 20, 0, this.ySize + (this.anvil.getSlot(0).getHasStack() ? 0 : 16), 110, 16); + + if ((this.anvil.getSlot(0).getHasStack() || this.anvil.getSlot(1).getHasStack()) && !this.anvil.getSlot(2).getHasStack()) + { + this.drawTexturedModalRect(i + 99, j + 45, this.xSize, 0, 28, 21); + } + } + + public void updateCraftingInventory(Container containerToSend, List itemsList) + { + this.sendSlotContents(containerToSend, 0, containerToSend.getSlot(0).getStack()); + } + + public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack) + { + if (slotInd == 0) + { + this.nameField.setText(stack == null ? "" : stack.getDisplayName()); + this.nameField.setEnabled(stack != null); + + if (stack != null) + { + this.renameItem(); + } + } + } + + public void sendProgressBarUpdate(Container containerIn, int varToUpdate, int newValue) + { + } + + public void sendAllWindowProperties(Container p_175173_1_, IInventory p_175173_2_) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java new file mode 100644 index 0000000..f7b0826 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java @@ -0,0 +1,19 @@ +package net.minecraft.client.gui; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackListEntry; + +public class GuiResourcePackAvailable extends GuiResourcePackList +{ + public GuiResourcePackAvailable(Minecraft mcIn, int p_i45054_2_, int p_i45054_3_, List p_i45054_4_) + { + super(mcIn, p_i45054_2_, p_i45054_3_, p_i45054_4_); + } + + protected String getListHeader() + { + return I18n.format("resourcePack.available.title", new Object[0]); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java new file mode 100644 index 0000000..b871bb7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java @@ -0,0 +1,55 @@ +package net.minecraft.client.gui; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.ResourcePackListEntry; +import net.minecraft.util.EnumChatFormatting; + +public abstract class GuiResourcePackList extends GuiListExtended +{ + protected final Minecraft mc; + protected final List field_148204_l; + + public GuiResourcePackList(Minecraft mcIn, int p_i45055_2_, int p_i45055_3_, List p_i45055_4_) + { + super(mcIn, p_i45055_2_, p_i45055_3_, 32, p_i45055_3_ - 55 + 4, 36); + this.mc = mcIn; + this.field_148204_l = p_i45055_4_; + this.field_148163_i = false; + this.setHasListHeader(true, (int)((float)mcIn.fontRendererObj.FONT_HEIGHT * 1.5F)); + } + + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + String s = EnumChatFormatting.UNDERLINE + "" + EnumChatFormatting.BOLD + this.getListHeader(); + this.mc.fontRendererObj.drawString(s, p_148129_1_ + this.width / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, Math.min(this.top + 3, p_148129_2_), 16777215); + } + + protected abstract String getListHeader(); + + public List getList() + { + return this.field_148204_l; + } + + protected int getSize() + { + return this.getList().size(); + } + + public ResourcePackListEntry getListEntry(int index) + { + return (ResourcePackListEntry)this.getList().get(index); + } + + public int getListWidth() + { + return this.width; + } + + protected int getScrollBarX() + { + return this.right - 6; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java new file mode 100644 index 0000000..7f0b67c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java @@ -0,0 +1,19 @@ +package net.minecraft.client.gui; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackListEntry; + +public class GuiResourcePackSelected extends GuiResourcePackList +{ + public GuiResourcePackSelected(Minecraft mcIn, int p_i45056_2_, int p_i45056_3_, List p_i45056_4_) + { + super(mcIn, p_i45056_2_, p_i45056_3_, p_i45056_4_); + } + + protected String getListHeader() + { + return I18n.format("resourcePack.selected.title", new Object[0]); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreen.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreen.java new file mode 100644 index 0000000..9704336 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreen.java @@ -0,0 +1,799 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.google.common.base.Splitter; +import com.google.common.base.Throwables; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.stream.GuiTwitchUserMode; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderUniform; +import net.minecraft.entity.EntityList; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.src.Config; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ScreenShotHelper; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import tv.twitch.chat.ChatUserInfo; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.datatransfer.ClipboardOwner; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.*; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +public abstract class GuiScreen extends Gui implements GuiYesNoCallback +{ + private static final Logger LOGGER = LogManager.getLogger(); + private static final Set PROTOCOLS = Sets.newHashSet(new String[] {"http", "https"}); + private static final Splitter NEWLINE_SPLITTER = Splitter.on('\n'); + public Minecraft mc; + protected RenderItem itemRender; + public int width; + public int height; + protected List buttonList = Lists.newArrayList(); + protected List labelList = Lists.newArrayList(); + public boolean allowUserInput; + protected FontRenderer fontRendererObj; + private GuiButton selectedButton; + private int eventButton; + private long lastMouseEvent; + private int touchValue; + private URI clickedLinkURI; + protected static ColorFade blurColor = new ColorFade(0, -553648128); + protected static ColorFade blurColorOffSet = new ColorFade(0, 1243487774); + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + for (int i = 0; i < this.buttonList.size(); ++i) + { + ((GuiButton)this.buttonList.get(i)).drawButton(this.mc, mouseX, mouseY); + } + + for (int j = 0; j < this.labelList.size(); ++j) + { + ((GuiLabel)this.labelList.get(j)).drawLabel(this.mc, mouseX, mouseY); + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (keyCode == 1) + { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + this.mc.entityRenderer.stopUseShader(); + } + this.mc.displayGuiScreen((GuiScreen)null); + + if (this.mc.currentScreen == null) + { + this.mc.setIngameFocus(); + } + } + } + + public static String getClipboardString() + { + try + { + Transferable transferable = Toolkit.getDefaultToolkit().getSystemClipboard().getContents((Object)null); + + if (transferable != null && transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) + { + return (String)transferable.getTransferData(DataFlavor.stringFlavor); + } + } + catch (Exception var1) + { + ; + } + + return ""; + } + + public static void setClipboardString(String copyText) + { + if (!StringUtils.isEmpty(copyText)) + { + try + { + StringSelection stringselection = new StringSelection(copyText); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringselection, (ClipboardOwner)null); + } + catch (Exception var2) + { + ; + } + } + } + + protected void renderToolTip(ItemStack stack, int x, int y) + { + List list = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + + for (int i = 0; i < list.size(); ++i) + { + if (i == 0) + { + list.set(i, stack.getRarity().rarityColor + (String)list.get(i)); + } + else + { + list.set(i, EnumChatFormatting.GRAY + (String)list.get(i)); + } + } + + this.drawHoveringText(list, x, y); + } + + protected void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY) + { + this.drawHoveringText(Arrays.asList(new String[] {tabName}), mouseX, mouseY); + } + + protected void drawHoveringText(List textLines, int x, int y) + { + if (!textLines.isEmpty()) + { + GlStateManager.disableRescaleNormal(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + int i = 0; + + for (String s : textLines) + { + int j = this.fontRendererObj.getStringWidth(s); + + if (j > i) + { + i = j; + } + } + + int l1 = x + 12; + int i2 = y - 12; + int k = 8; + + if (textLines.size() > 1) + { + k += 2 + (textLines.size() - 1) * 10; + } + + if (l1 + i > this.width) + { + l1 -= 28 + i; + } + + if (i2 + k + 6 > this.height) + { + i2 = this.height - k - 6; + } + + this.zLevel = 300.0F; + this.itemRender.zLevel = 300.0F; + int l = -267386864; + this.drawGradientRect(l1 - 3, i2 - 4, l1 + i + 3, i2 - 3, l, l); + this.drawGradientRect(l1 - 3, i2 + k + 3, l1 + i + 3, i2 + k + 4, l, l); + this.drawGradientRect(l1 - 3, i2 - 3, l1 + i + 3, i2 + k + 3, l, l); + this.drawGradientRect(l1 - 4, i2 - 3, l1 - 3, i2 + k + 3, l, l); + this.drawGradientRect(l1 + i + 3, i2 - 3, l1 + i + 4, i2 + k + 3, l, l); + int i1 = 1347420415; + int j1 = (i1 & 16711422) >> 1 | i1 & -16777216; + this.drawGradientRect(l1 - 3, i2 - 3 + 1, l1 - 3 + 1, i2 + k + 3 - 1, i1, j1); + this.drawGradientRect(l1 + i + 2, i2 - 3 + 1, l1 + i + 3, i2 + k + 3 - 1, i1, j1); + this.drawGradientRect(l1 - 3, i2 - 3, l1 + i + 3, i2 - 3 + 1, i1, i1); + this.drawGradientRect(l1 - 3, i2 + k + 2, l1 + i + 3, i2 + k + 3, j1, j1); + + for (int k1 = 0; k1 < textLines.size(); ++k1) + { + String s1 = (String)textLines.get(k1); + this.fontRendererObj.drawStringWithShadow(s1, (float)l1, (float)i2, -1); + + if (k1 == 0) + { + i2 += 2; + } + + i2 += 10; + } + + this.zLevel = 0.0F; + this.itemRender.zLevel = 0.0F; + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + RenderHelper.enableStandardItemLighting(); + GlStateManager.enableRescaleNormal(); + } + } + + protected void handleComponentHover(IChatComponent component, int x, int y) + { + if (component != null && component.getChatStyle().getChatHoverEvent() != null) + { + HoverEvent hoverevent = component.getChatStyle().getChatHoverEvent(); + + if (hoverevent.getAction() == HoverEvent.Action.SHOW_ITEM) + { + ItemStack itemstack = null; + + try + { + NBTBase nbtbase = JsonToNBT.getTagFromJson(hoverevent.getValue().getUnformattedText()); + + if (nbtbase instanceof NBTTagCompound) + { + itemstack = ItemStack.loadItemStackFromNBT((NBTTagCompound)nbtbase); + } + } + catch (NBTException var11) + { + ; + } + + if (itemstack != null) + { + this.renderToolTip(itemstack, x, y); + } + else + { + this.drawCreativeTabHoveringText(EnumChatFormatting.RED + "Invalid Item!", x, y); + } + } + else if (hoverevent.getAction() == HoverEvent.Action.SHOW_ENTITY) + { + if (this.mc.gameSettings.advancedItemTooltips) + { + try + { + NBTBase nbtbase1 = JsonToNBT.getTagFromJson(hoverevent.getValue().getUnformattedText()); + + if (nbtbase1 instanceof NBTTagCompound) + { + List list1 = Lists.newArrayList(); + NBTTagCompound nbttagcompound = (NBTTagCompound)nbtbase1; + list1.add(nbttagcompound.getString("name")); + + if (nbttagcompound.hasKey("type", 8)) + { + String s = nbttagcompound.getString("type"); + list1.add("Type: " + s + " (" + EntityList.getIDFromString(s) + ")"); + } + + list1.add(nbttagcompound.getString("id")); + this.drawHoveringText(list1, x, y); + } + else + { + this.drawCreativeTabHoveringText(EnumChatFormatting.RED + "Invalid Entity!", x, y); + } + } + catch (NBTException var10) + { + this.drawCreativeTabHoveringText(EnumChatFormatting.RED + "Invalid Entity!", x, y); + } + } + } + else if (hoverevent.getAction() == HoverEvent.Action.SHOW_TEXT) + { + this.drawHoveringText(NEWLINE_SPLITTER.splitToList(hoverevent.getValue().getFormattedText()), x, y); + } + else if (hoverevent.getAction() == HoverEvent.Action.SHOW_ACHIEVEMENT) + { + StatBase statbase = StatList.getOneShotStat(hoverevent.getValue().getUnformattedText()); + + if (statbase != null) + { + IChatComponent ichatcomponent = statbase.getStatName(); + IChatComponent ichatcomponent1 = new ChatComponentTranslation("stats.tooltip.type." + (statbase.isAchievement() ? "achievement" : "statistic"), new Object[0]); + ichatcomponent1.getChatStyle().setItalic(Boolean.valueOf(true)); + String s1 = statbase instanceof Achievement ? ((Achievement)statbase).getDescription() : null; + List list = Lists.newArrayList(new String[] {ichatcomponent.getFormattedText(), ichatcomponent1.getFormattedText()}); + + if (s1 != null) + { + list.addAll(this.fontRendererObj.listFormattedStringToWidth(s1, 150)); + } + + this.drawHoveringText(list, x, y); + } + else + { + this.drawCreativeTabHoveringText(EnumChatFormatting.RED + "Invalid statistic/achievement!", x, y); + } + } + + GlStateManager.disableLighting(); + } + } + + protected void setText(String newChatText, boolean shouldOverwrite) + { + } + + protected boolean handleComponentClick(IChatComponent component) + { + if (component == null) + { + return false; + } + else + { + ClickEvent clickevent = component.getChatStyle().getChatClickEvent(); + + if (isShiftKeyDown()) + { + if (component.getChatStyle().getInsertion() != null) + { + this.setText(component.getChatStyle().getInsertion(), false); + } + } + else if (clickevent != null) + { + if (clickevent.getAction() == ClickEvent.Action.OPEN_URL) + { + if (!this.mc.gameSettings.chatLinks) + { + return false; + } + + try + { + URI uri = new URI(clickevent.getValue()); + String s = uri.getScheme(); + + if (s == null) + { + throw new URISyntaxException(clickevent.getValue(), "Missing protocol"); + } + + if (!PROTOCOLS.contains(s.toLowerCase())) + { + throw new URISyntaxException(clickevent.getValue(), "Unsupported protocol: " + s.toLowerCase()); + } + + if (this.mc.gameSettings.chatLinksPrompt) + { + this.clickedLinkURI = uri; + this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, clickevent.getValue(), 31102009, false)); + } + else + { + this.openWebLink(uri); + } + } + catch (URISyntaxException urisyntaxexception) + { + LOGGER.error((String)("Can\'t open url for " + clickevent), (Throwable)urisyntaxexception); + } + } + else if (clickevent.getAction() == ClickEvent.Action.OPEN_FILE) + { + URI uri1 = (new File(clickevent.getValue())).toURI(); + this.openWebLink(uri1); + } + else if (clickevent.getAction() == ClickEvent.Action.SUGGEST_COMMAND) + { + this.setText(clickevent.getValue(), true); + } + else if (clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) + { + this.sendChatMessage(clickevent.getValue(), false); + } else if (clickevent.getAction() == ClickEvent.Action.UPLOAD_SCREENSHOT) { + this.sendUpdateServer(clickevent.getValue()); + } else if (clickevent.getAction() == ClickEvent.Action.COPY_SCREENSHOT) { + ScreenShotHelper.IllIlIIIllllIIllIIlllIIlI(clickevent.getValue()); + } + else if (clickevent.getAction() == ClickEvent.Action.TWITCH_USER_INFO) + { + ChatUserInfo chatuserinfo = this.mc.getTwitchStream().func_152926_a(clickevent.getValue()); + + if (chatuserinfo != null) + { + this.mc.displayGuiScreen(new GuiTwitchUserMode(this.mc.getTwitchStream(), chatuserinfo)); + } + else + { + LOGGER.error("Tried to handle twitch user but couldn\'t find them!"); + } + } + else + { + LOGGER.error("Don\'t know how to handle " + clickevent); + } + + return true; + } + + return false; + } + } + + private void sendUpdateServer(String var1) { + File var2 = new File(this.mc.mcDataDir + File.separator + "screenshots" + File.separator + var1); + if (var2.exists()) { + GuiIngame.uploadingScreenshot = true; + new Thread(() -> { + try { + String var10; + BufferedImage var2x = ImageIO.read(var2); + ByteArrayOutputStream var3 = new ByteArrayOutputStream(); + ImageIO.write(var2x, "png", var3); + URL var4 = new URL("https://api.imgur.com/3/image"); + String var5 = URLEncoder.encode("image", "UTF-8") + "=" + URLEncoder.encode(Base64.encodeBase64String(var3.toByteArray()), "UTF-8"); + var5 = var5 + "&" + URLEncoder.encode("key", "UTF-8") + "=" + URLEncoder.encode("7fd132c453b5486", "UTF-8"); + URLConnection var6 = var4.openConnection(); + var6.setDoOutput(true); + var6.setDoInput(true); + var6.setRequestProperty("Authorization", "Client-ID 7fd132c453b5486"); + var6.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + OutputStreamWriter var7 = new OutputStreamWriter(var6.getOutputStream()); + var7.write(var5); + var7.flush(); + BufferedReader var8 = new BufferedReader(new InputStreamReader(var6.getInputStream())); + StringBuilder var9 = new StringBuilder(); + while ((var10 = var8.readLine()) != null) { + var9.append(var10).append(System.lineSeparator()); + } + var8.close(); + GuiIngame.uploadingScreenshot = false; + Gson var11 = new GsonBuilder().create(); + JsonObject var12 = var11.fromJson(var9.toString(), JsonObject.class); + String var13 = "https://i.imgur.com/" + var12.get("data").getAsJsonObject().get("id").getAsString() + ".png"; + this.clickedLinkURI = new URI(var13); + GuiConfirmOpenLink var14 = new GuiConfirmOpenLink(this, var13, 0, false); + var14.disableSecurityWarning(); + this.mc.displayGuiScreen(var14); +// CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Info", "&aSuccessfully &fuploaded screenshot!", 3000L); + } catch (Exception var15) { + GuiIngame.uploadingScreenshot = false; +// CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Error", "&fScreenshot upload &cfailed!", 3000L); + var15.printStackTrace(); + } + }).start(); + } + } + + public void sendChatMessage(String msg) + { + this.sendChatMessage(msg, true); + } + + public void sendChatMessage(String msg, boolean addToChat) + { + if (addToChat) + { + this.mc.ingameGUI.getChatGUI().addToSentMessages(msg); + } + + this.mc.thePlayer.sendChatMessage(msg); + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + if (mouseButton == 0) + { + for (int i = 0; i < this.buttonList.size(); ++i) + { + GuiButton guibutton = (GuiButton)this.buttonList.get(i); + + if (guibutton.mousePressed(this.mc, mouseX, mouseY)) + { + this.selectedButton = guibutton; + guibutton.playPressSound(this.mc.getSoundHandler()); + this.actionPerformed(guibutton); + } + } + } + } + + protected void mouseReleased(int mouseX, int mouseY, int state) + { + if (this.selectedButton != null && state == 0) + { + this.selectedButton.mouseReleased(mouseX, mouseY); + this.selectedButton = null; + } + } + + protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) + { + } + + protected void actionPerformed(GuiButton button) throws IOException + { + } + + public void setWorldAndResolution(Minecraft mc, int width, int height) + { + this.mc = mc; + this.itemRender = mc.getRenderItem(); + this.fontRendererObj = mc.fontRendererObj; + this.width = width; + this.height = height; + this.buttonList.clear(); + this.initGui(); + this.blurGui(); + } + + public void setGuiSize(int w, int h) + { + this.width = w; + this.height = h; + } + + public void initGui() + { + } + + public void blurGui() { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue() && this.mc.theWorld != null && this.mc.thePlayer != null) { + this.mc.entityRenderer.loadGuiBlurShader(); + } + if (CheatBreaker.getInstance().lastScreen == null) { + blurColor.startAnimation(); + blurColorOffSet.startAnimation(); + } + } + + public void handleInput() throws IOException + { + if (Mouse.isCreated()) + { + while (Mouse.next()) + { + this.handleMouseInput(); + } + } + + if (Keyboard.isCreated()) + { + while (Keyboard.next()) + { + this.handleKeyboardInput(); + } + } + } + + public void handleMouseInput() throws IOException + { + int i = Mouse.getEventX() * this.width / this.mc.displayWidth; + int j = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; + int k = Mouse.getEventButton(); + + if (Mouse.getEventButtonState()) + { + if (this.mc.gameSettings.touchscreen && this.touchValue++ > 0) + { + return; + } + + this.eventButton = k; + this.lastMouseEvent = Minecraft.getSystemTime(); + this.mouseClicked(i, j, this.eventButton); + } + else if (k != -1) + { + if (this.mc.gameSettings.touchscreen && --this.touchValue > 0) + { + return; + } + + this.eventButton = -1; + this.mouseReleased(i, j, k); + } + else if (this.eventButton != -1 && this.lastMouseEvent > 0L) + { + long l = Minecraft.getSystemTime() - this.lastMouseEvent; + this.mouseClickMove(i, j, this.eventButton, l); + } + } + + public void handleKeyboardInput() throws IOException + { + if (Keyboard.getEventKeyState()) + { + this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey()); + } + + this.mc.dispatchKeypresses(); + } + + public void updateScreen() + { + } + + public void onGuiClosed() + { + } + + public void renderBlur() { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + try { + if (this.mc.entityRenderer.isShaderActive()) { + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + for (Shader shader : shaderGroup.getListShaders()) { + ShaderUniform shaderUniform = shader.getShaderManager().getShaderUniform("Progress"); + if (shaderUniform == null) continue; + shaderUniform.set(blurColor.getFadeAmount()); + } + } + GL11.glEnable(2929); + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + } + } + + public void drawDefaultBackground() + { + if (this.mc.theWorld != null) { + this.renderBlur(); + if (CheatBreaker.getInstance().getGlobalSettings().containerBackground.getStringValue().equals("CheatBreaker")) { + this.mc.ingameGUI.drawGradientRect(0.0f, 0.0f, (float)this.width, (float)this.height, blurColor.getColor(true).getRGB(), blurColorOffSet.getColor(true).getRGB()); + } else if (CheatBreaker.getInstance().getGlobalSettings().containerBackground.getStringValue().equals("Vanilla")) { + this.drawWorldBackground(0); + } + if (this.mc.isFullScreen() && CheatBreaker.getInstance().getGlobalSettings().isDebug) { + String debug = Config.MC_VERSION + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")"; + CheatBreaker.getInstance().playRegular18px.drawStringWithShadow(debug, 5.0, this.height - 14.0f, -1879048193); + } + } else { + this.drawWorldBackground(0); + } + } + + public void renderBlur(float f, float f2) { + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive()) { + for (Shader shader : shaderGroup.getListShaders()) { + ShaderUniform shaderUniform = shader.getShaderManager().getShaderUniform("Progress"); + if (shaderUniform == null) continue; + shaderUniform.set(0.75555557f * 0.6617647f); + } + } + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + this.mc.ingameGUI.drawGradientRect(0.0f, 0.0f, f, f2, blurColor.getColor(true).getRGB(), blurColorOffSet.getColor(true).getRGB()); + } + + public void drawWorldBackground(int tint) + { + if (this.mc.theWorld != null) + { + this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); + } + else + { + this.drawBackground(tint); + } + } + + public void drawBackground(int tint) + { + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.mc.getTextureManager().bindTexture(optionsBackground); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + float f = 32.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double)this.height, 0.0D).tex(0.0D, (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex(); + worldrenderer.pos((double)this.width, (double)this.height, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex(); + worldrenderer.pos((double)this.width, 0.0D, 0.0D).tex((double)((float)this.width / 32.0F), (double)tint).color(64, 64, 64, 255).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)tint).color(64, 64, 64, 255).endVertex(); + tessellator.draw(); + } + + public boolean doesGuiPauseGame() + { + return true; + } + + public void confirmClicked(boolean result, int id) + { + if (id == 31102009) + { + if (result) + { + this.openWebLink(this.clickedLinkURI); + } + + this.clickedLinkURI = null; + this.mc.displayGuiScreen(this); + } + } + + private void openWebLink(URI url) + { + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {url}); + } + catch (Throwable throwable) + { + LOGGER.error("Couldn\'t open link", throwable); + } + } + + public static boolean isCtrlKeyDown() + { + return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(219) || Keyboard.isKeyDown(220) : Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157); + } + + public static boolean isShiftKeyDown() + { + return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54); + } + + public static boolean isAltKeyDown() + { + return Keyboard.isKeyDown(56) || Keyboard.isKeyDown(184); + } + + public static boolean isKeyComboCtrlX(int keyID) + { + return keyID == 45 && isCtrlKeyDown() && !isShiftKeyDown() && !isAltKeyDown(); + } + + public static boolean isKeyComboCtrlV(int keyID) + { + return keyID == 47 && isCtrlKeyDown() && !isShiftKeyDown() && !isAltKeyDown(); + } + + public static boolean isKeyComboCtrlC(int keyID) + { + return keyID == 46 && isCtrlKeyDown() && !isShiftKeyDown() && !isAltKeyDown(); + } + + public static boolean isKeyComboCtrlA(int keyID) + { + return keyID == 30 && isCtrlKeyDown() && !isShiftKeyDown() && !isAltKeyDown(); + } + + public void onResize(Minecraft mcIn, int w, int h) + { + this.setWorldAndResolution(mcIn, w, h); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java new file mode 100644 index 0000000..238c379 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java @@ -0,0 +1,141 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Predicate; +import java.io.IOException; +import java.net.IDN; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.resources.I18n; +import org.lwjgl.input.Keyboard; + +public class GuiScreenAddServer extends GuiScreen +{ + private final GuiScreen parentScreen; + private final ServerData serverData; + private GuiTextField serverIPField; + private GuiTextField serverNameField; + private GuiButton serverResourcePacks; + private Predicate field_181032_r = new Predicate() + { + public boolean apply(String p_apply_1_) + { + if (p_apply_1_.length() == 0) + { + return true; + } + else + { + String[] astring = p_apply_1_.split(":"); + + if (astring.length == 0) + { + return true; + } + else + { + try + { + String s = IDN.toASCII(astring[0]); + return true; + } + catch (IllegalArgumentException var4) + { + return false; + } + } + } + } + }; + + public GuiScreenAddServer(GuiScreen p_i1033_1_, ServerData p_i1033_2_) + { + this.parentScreen = p_i1033_1_; + this.serverData = p_i1033_2_; + } + + public void updateScreen() + { + this.serverNameField.updateCursorCounter(); + this.serverIPField.updateCursorCounter(); + } + + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 18, I18n.format("addServer.add", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 18, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.serverResourcePacks = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 72, I18n.format("addServer.resourcePack", new Object[0]) + ": " + this.serverData.getResourceMode().getMotd().getFormattedText())); + this.serverNameField = new GuiTextField(0, this.fontRendererObj, this.width / 2 - 100, 66, 200, 20); + this.serverNameField.setFocused(true); + this.serverNameField.setText(this.serverData.serverName); + this.serverIPField = new GuiTextField(1, this.fontRendererObj, this.width / 2 - 100, 106, 200, 20); + this.serverIPField.setMaxStringLength(128); + this.serverIPField.setText(this.serverData.serverIP); + this.serverIPField.setValidator(this.field_181032_r); + ((GuiButton)this.buttonList.get(0)).enabled = this.serverIPField.getText().length() > 0 && this.serverIPField.getText().split(":").length > 0 && this.serverNameField.getText().length() > 0; + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 2) + { + this.serverData.setResourceMode(ServerData.ServerResourceMode.values()[(this.serverData.getResourceMode().ordinal() + 1) % ServerData.ServerResourceMode.values().length]); + this.serverResourcePacks.displayString = I18n.format("addServer.resourcePack", new Object[0]) + ": " + this.serverData.getResourceMode().getMotd().getFormattedText(); + } + else if (button.id == 1) + { + this.parentScreen.confirmClicked(false, 0); + } + else if (button.id == 0) + { + this.serverData.serverName = this.serverNameField.getText(); + this.serverData.serverIP = this.serverIPField.getText(); + this.parentScreen.confirmClicked(true, 0); + } + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + this.serverNameField.textboxKeyTyped(typedChar, keyCode); + this.serverIPField.textboxKeyTyped(typedChar, keyCode); + + if (keyCode == 15) + { + this.serverNameField.setFocused(!this.serverNameField.isFocused()); + this.serverIPField.setFocused(!this.serverIPField.isFocused()); + } + + if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + + ((GuiButton)this.buttonList.get(0)).enabled = this.serverIPField.getText().length() > 0 && this.serverIPField.getText().split(":").length > 0 && this.serverNameField.getText().length() > 0; + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.serverIPField.mouseClicked(mouseX, mouseY, mouseButton); + this.serverNameField.mouseClicked(mouseX, mouseY, mouseButton); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("addServer.title", new Object[0]), this.width / 2, 17, 16777215); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterName", new Object[0]), this.width / 2 - 100, 53, 10526880); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterIp", new Object[0]), this.width / 2 - 100, 94, 10526880); + this.serverNameField.drawTextBox(); + this.serverIPField.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenBook.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenBook.java new file mode 100644 index 0000000..a64aca5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenBook.java @@ -0,0 +1,616 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import com.google.gson.JsonParseException; +import io.netty.buffer.Unpooled; +import java.io.IOException; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.init.Items; +import net.minecraft.item.ItemEditableBook; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; + +public class GuiScreenBook extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png"); + private final EntityPlayer editingPlayer; + private final ItemStack bookObj; + private final boolean bookIsUnsigned; + private boolean bookIsModified; + private boolean bookGettingSigned; + private int updateCount; + private int bookImageWidth = 192; + private int bookImageHeight = 192; + private int bookTotalPages = 1; + private int currPage; + private NBTTagList bookPages; + private String bookTitle = ""; + private List field_175386_A; + private int field_175387_B = -1; + private GuiScreenBook.NextPageButton buttonNextPage; + private GuiScreenBook.NextPageButton buttonPreviousPage; + private GuiButton buttonDone; + private GuiButton buttonSign; + private GuiButton buttonFinalize; + private GuiButton buttonCancel; + + public GuiScreenBook(EntityPlayer player, ItemStack book, boolean isUnsigned) + { + this.editingPlayer = player; + this.bookObj = book; + this.bookIsUnsigned = isUnsigned; + + if (book.hasTagCompound()) + { + NBTTagCompound nbttagcompound = book.getTagCompound(); + this.bookPages = nbttagcompound.getTagList("pages", 8); + + if (this.bookPages != null) + { + this.bookPages = (NBTTagList)this.bookPages.copy(); + this.bookTotalPages = this.bookPages.tagCount(); + + if (this.bookTotalPages < 1) + { + this.bookTotalPages = 1; + } + } + } + + if (this.bookPages == null && isUnsigned) + { + this.bookPages = new NBTTagList(); + this.bookPages.appendTag(new NBTTagString("")); + this.bookTotalPages = 1; + } + } + + public void updateScreen() + { + super.updateScreen(); + ++this.updateCount; + } + + public void initGui() + { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + + if (this.bookIsUnsigned) + { + this.buttonList.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.format("book.signButton", new Object[0]))); + this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.format("book.finalizeButton", new Object[0]))); + this.buttonList.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.format("gui.cancel", new Object[0]))); + } + else + { + this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.format("gui.done", new Object[0]))); + } + + int i = (this.width - this.bookImageWidth) / 2; + int j = 2; + this.buttonList.add(this.buttonNextPage = new GuiScreenBook.NextPageButton(1, i + 120, j + 154, true)); + this.buttonList.add(this.buttonPreviousPage = new GuiScreenBook.NextPageButton(2, i + 38, j + 154, false)); + this.updateButtons(); + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + private void updateButtons() + { + this.buttonNextPage.visible = !this.bookGettingSigned && (this.currPage < this.bookTotalPages - 1 || this.bookIsUnsigned); + this.buttonPreviousPage.visible = !this.bookGettingSigned && this.currPage > 0; + this.buttonDone.visible = !this.bookIsUnsigned || !this.bookGettingSigned; + + if (this.bookIsUnsigned) + { + this.buttonSign.visible = !this.bookGettingSigned; + this.buttonCancel.visible = this.bookGettingSigned; + this.buttonFinalize.visible = this.bookGettingSigned; + this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0; + } + } + + private void sendBookToServer(boolean publish) throws IOException + { + if (this.bookIsUnsigned && this.bookIsModified) + { + if (this.bookPages != null) + { + while (this.bookPages.tagCount() > 1) + { + String s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1); + + if (s.length() != 0) + { + break; + } + + this.bookPages.removeTag(this.bookPages.tagCount() - 1); + } + + if (this.bookObj.hasTagCompound()) + { + NBTTagCompound nbttagcompound = this.bookObj.getTagCompound(); + nbttagcompound.setTag("pages", this.bookPages); + } + else + { + this.bookObj.setTagInfo("pages", this.bookPages); + } + + String s2 = "MC|BEdit"; + + if (publish) + { + s2 = "MC|BSign"; + this.bookObj.setTagInfo("author", new NBTTagString(this.editingPlayer.getName())); + this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim())); + + for (int i = 0; i < this.bookPages.tagCount(); ++i) + { + String s1 = this.bookPages.getStringTagAt(i); + IChatComponent ichatcomponent = new ChatComponentText(s1); + s1 = IChatComponent.Serializer.componentToJson(ichatcomponent); + this.bookPages.set(i, new NBTTagString(s1)); + } + + this.bookObj.setItem(Items.written_book); + } + + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + packetbuffer.writeItemStackToBuffer(this.bookObj); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s2, packetbuffer)); + } + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 0) + { + this.mc.displayGuiScreen((GuiScreen)null); + this.sendBookToServer(false); + } + else if (button.id == 3 && this.bookIsUnsigned) + { + this.bookGettingSigned = true; + } + else if (button.id == 1) + { + if (this.currPage < this.bookTotalPages - 1) + { + ++this.currPage; + } + else if (this.bookIsUnsigned) + { + this.addNewPage(); + + if (this.currPage < this.bookTotalPages - 1) + { + ++this.currPage; + } + } + } + else if (button.id == 2) + { + if (this.currPage > 0) + { + --this.currPage; + } + } + else if (button.id == 5 && this.bookGettingSigned) + { + this.sendBookToServer(true); + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button.id == 4 && this.bookGettingSigned) + { + this.bookGettingSigned = false; + } + + this.updateButtons(); + } + } + + private void addNewPage() + { + if (this.bookPages != null && this.bookPages.tagCount() < 50) + { + this.bookPages.appendTag(new NBTTagString("")); + ++this.bookTotalPages; + this.bookIsModified = true; + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + super.keyTyped(typedChar, keyCode); + + if (this.bookIsUnsigned) + { + if (this.bookGettingSigned) + { + this.keyTypedInTitle(typedChar, keyCode); + } + else + { + this.keyTypedInBook(typedChar, keyCode); + } + } + } + + private void keyTypedInBook(char typedChar, int keyCode) + { + if (GuiScreen.isKeyComboCtrlV(keyCode)) + { + this.pageInsertIntoCurrent(GuiScreen.getClipboardString()); + } + else + { + switch (keyCode) + { + case 14: + String s = this.pageGetCurrent(); + + if (s.length() > 0) + { + this.pageSetCurrent(s.substring(0, s.length() - 1)); + } + + return; + + case 28: + case 156: + this.pageInsertIntoCurrent("\n"); + return; + + default: + if (ChatAllowedCharacters.isAllowedCharacter(typedChar)) + { + this.pageInsertIntoCurrent(Character.toString(typedChar)); + } + } + } + } + + private void keyTypedInTitle(char p_146460_1_, int p_146460_2_) throws IOException + { + switch (p_146460_2_) + { + case 14: + if (!this.bookTitle.isEmpty()) + { + this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1); + this.updateButtons(); + } + + return; + + case 28: + case 156: + if (!this.bookTitle.isEmpty()) + { + this.sendBookToServer(true); + this.mc.displayGuiScreen((GuiScreen)null); + } + + return; + + default: + if (this.bookTitle.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) + { + this.bookTitle = this.bookTitle + Character.toString(p_146460_1_); + this.updateButtons(); + this.bookIsModified = true; + } + } + } + + private String pageGetCurrent() + { + return this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount() ? this.bookPages.getStringTagAt(this.currPage) : ""; + } + + private void pageSetCurrent(String p_146457_1_) + { + if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) + { + this.bookPages.set(this.currPage, new NBTTagString(p_146457_1_)); + this.bookIsModified = true; + } + } + + private void pageInsertIntoCurrent(String p_146459_1_) + { + String s = this.pageGetCurrent(); + String s1 = s + p_146459_1_; + int i = this.fontRendererObj.splitStringWidth(s1 + "" + EnumChatFormatting.BLACK + "_", 118); + + if (i <= 128 && s1.length() < 256) + { + this.pageSetCurrent(s1); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(bookGuiTextures); + int i = (this.width - this.bookImageWidth) / 2; + int j = 2; + this.drawTexturedModalRect(i, j, 0, 0, this.bookImageWidth, this.bookImageHeight); + + if (this.bookGettingSigned) + { + String s = this.bookTitle; + + if (this.bookIsUnsigned) + { + if (this.updateCount / 6 % 2 == 0) + { + s = s + "" + EnumChatFormatting.BLACK + "_"; + } + else + { + s = s + "" + EnumChatFormatting.GRAY + "_"; + } + } + + String s1 = I18n.format("book.editTitle", new Object[0]); + int k = this.fontRendererObj.getStringWidth(s1); + this.fontRendererObj.drawString(s1, i + 36 + (116 - k) / 2, j + 16 + 16, 0); + int l = this.fontRendererObj.getStringWidth(s); + this.fontRendererObj.drawString(s, i + 36 + (116 - l) / 2, j + 48, 0); + String s2 = I18n.format("book.byAuthor", new Object[] {this.editingPlayer.getName()}); + int i1 = this.fontRendererObj.getStringWidth(s2); + this.fontRendererObj.drawString(EnumChatFormatting.DARK_GRAY + s2, i + 36 + (116 - i1) / 2, j + 48 + 10, 0); + String s3 = I18n.format("book.finalizeWarning", new Object[0]); + this.fontRendererObj.drawSplitString(s3, i + 36, j + 80, 116, 0); + } + else + { + String s4 = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)}); + String s5 = ""; + + if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) + { + s5 = this.bookPages.getStringTagAt(this.currPage); + } + + if (this.bookIsUnsigned) + { + if (this.fontRendererObj.getBidiFlag()) + { + s5 = s5 + "_"; + } + else if (this.updateCount / 6 % 2 == 0) + { + s5 = s5 + "" + EnumChatFormatting.BLACK + "_"; + } + else + { + s5 = s5 + "" + EnumChatFormatting.GRAY + "_"; + } + } + else if (this.field_175387_B != this.currPage) + { + if (ItemEditableBook.validBookTagContents(this.bookObj.getTagCompound())) + { + try + { + IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s5); + this.field_175386_A = ichatcomponent != null ? GuiUtilRenderComponents.splitText(ichatcomponent, 116, this.fontRendererObj, true, true) : null; + } + catch (JsonParseException var13) + { + this.field_175386_A = null; + } + } + else + { + ChatComponentText chatcomponenttext = new ChatComponentText(EnumChatFormatting.DARK_RED.toString() + "* Invalid book tag *"); + this.field_175386_A = Lists.newArrayList(chatcomponenttext); + } + + this.field_175387_B = this.currPage; + } + + int j1 = this.fontRendererObj.getStringWidth(s4); + this.fontRendererObj.drawString(s4, i - j1 + this.bookImageWidth - 44, j + 16, 0); + + if (this.field_175386_A == null) + { + this.fontRendererObj.drawSplitString(s5, i + 36, j + 16 + 16, 116, 0); + } + else + { + int k1 = Math.min(128 / this.fontRendererObj.FONT_HEIGHT, this.field_175386_A.size()); + + for (int l1 = 0; l1 < k1; ++l1) + { + IChatComponent ichatcomponent2 = (IChatComponent)this.field_175386_A.get(l1); + this.fontRendererObj.drawString(ichatcomponent2.getUnformattedText(), i + 36, j + 16 + 16 + l1 * this.fontRendererObj.FONT_HEIGHT, 0); + } + + IChatComponent ichatcomponent1 = this.func_175385_b(mouseX, mouseY); + + if (ichatcomponent1 != null) + { + this.handleComponentHover(ichatcomponent1, mouseX, mouseY); + } + } + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + if (mouseButton == 0) + { + IChatComponent ichatcomponent = this.func_175385_b(mouseX, mouseY); + + if (this.handleComponentClick(ichatcomponent)) + { + return; + } + } + + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + protected boolean handleComponentClick(IChatComponent component) + { + ClickEvent clickevent = component == null ? null : component.getChatStyle().getChatClickEvent(); + + if (clickevent == null) + { + return false; + } + else if (clickevent.getAction() == ClickEvent.Action.CHANGE_PAGE) + { + String s = clickevent.getValue(); + + try + { + int i = Integer.parseInt(s) - 1; + + if (i >= 0 && i < this.bookTotalPages && i != this.currPage) + { + this.currPage = i; + this.updateButtons(); + return true; + } + } + catch (Throwable var5) + { + ; + } + + return false; + } + else + { + boolean flag = super.handleComponentClick(component); + + if (flag && clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + + return flag; + } + } + + public IChatComponent func_175385_b(int p_175385_1_, int p_175385_2_) + { + if (this.field_175386_A == null) + { + return null; + } + else + { + int i = p_175385_1_ - (this.width - this.bookImageWidth) / 2 - 36; + int j = p_175385_2_ - 2 - 16 - 16; + + if (i >= 0 && j >= 0) + { + int k = Math.min(128 / this.fontRendererObj.FONT_HEIGHT, this.field_175386_A.size()); + + if (i <= 116 && j < this.mc.fontRendererObj.FONT_HEIGHT * k + k) + { + int l = j / this.mc.fontRendererObj.FONT_HEIGHT; + + if (l >= 0 && l < this.field_175386_A.size()) + { + IChatComponent ichatcomponent = (IChatComponent)this.field_175386_A.get(l); + int i1 = 0; + + for (IChatComponent ichatcomponent1 : ichatcomponent) + { + if (ichatcomponent1 instanceof ChatComponentText) + { + i1 += this.mc.fontRendererObj.getStringWidth(((ChatComponentText)ichatcomponent1).getChatComponentText_TextValue()); + + if (i1 > i) + { + return ichatcomponent1; + } + } + } + } + + return null; + } + else + { + return null; + } + } + else + { + return null; + } + } + } + + static class NextPageButton extends GuiButton + { + private final boolean field_146151_o; + + public NextPageButton(int p_i46316_1_, int p_i46316_2_, int p_i46316_3_, boolean p_i46316_4_) + { + super(p_i46316_1_, p_i46316_2_, p_i46316_3_, 23, 13, ""); + this.field_146151_o = p_i46316_4_; + } + + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(GuiScreenBook.bookGuiTextures); + int i = 0; + int j = 192; + + if (flag) + { + i += 23; + } + + if (!this.field_146151_o) + { + j += 13; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, i, j, 23, 13); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java new file mode 100644 index 0000000..93133bc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenCustomizePresets.java @@ -0,0 +1,210 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.gen.ChunkProviderSettings; +import org.lwjgl.input.Keyboard; + +public class GuiScreenCustomizePresets extends GuiScreen +{ + private static final List field_175310_f = Lists.newArrayList(); + private GuiScreenCustomizePresets.ListPreset field_175311_g; + private GuiButton field_175316_h; + private GuiTextField field_175317_i; + private GuiCustomizeWorldScreen field_175314_r; + protected String field_175315_a = "Customize World Presets"; + private String field_175313_s; + private String field_175312_t; + + public GuiScreenCustomizePresets(GuiCustomizeWorldScreen p_i45524_1_) + { + this.field_175314_r = p_i45524_1_; + } + + public void initGui() + { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.field_175315_a = I18n.format("createWorld.customize.custom.presets.title", new Object[0]); + this.field_175313_s = I18n.format("createWorld.customize.presets.share", new Object[0]); + this.field_175312_t = I18n.format("createWorld.customize.presets.list", new Object[0]); + this.field_175317_i = new GuiTextField(2, this.fontRendererObj, 50, 40, this.width - 100, 20); + this.field_175311_g = new GuiScreenCustomizePresets.ListPreset(); + this.field_175317_i.setMaxStringLength(2000); + this.field_175317_i.setText(this.field_175314_r.func_175323_a()); + this.buttonList.add(this.field_175316_h = new GuiButton(0, this.width / 2 - 102, this.height - 27, 100, 20, I18n.format("createWorld.customize.presets.select", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 3, this.height - 27, 100, 20, I18n.format("gui.cancel", new Object[0]))); + this.func_175304_a(); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.field_175311_g.handleMouseInput(); + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + this.field_175317_i.mouseClicked(mouseX, mouseY, mouseButton); + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (!this.field_175317_i.textboxKeyTyped(typedChar, keyCode)) + { + super.keyTyped(typedChar, keyCode); + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + switch (button.id) + { + case 0: + this.field_175314_r.func_175324_a(this.field_175317_i.getText()); + this.mc.displayGuiScreen(this.field_175314_r); + break; + + case 1: + this.mc.displayGuiScreen(this.field_175314_r); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_175311_g.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_175315_a, this.width / 2, 8, 16777215); + this.drawString(this.fontRendererObj, this.field_175313_s, 50, 30, 10526880); + this.drawString(this.fontRendererObj, this.field_175312_t, 50, 70, 10526880); + this.field_175317_i.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void updateScreen() + { + this.field_175317_i.updateCursorCounter(); + super.updateScreen(); + } + + public void func_175304_a() + { + this.field_175316_h.enabled = this.func_175305_g(); + } + + private boolean func_175305_g() + { + return this.field_175311_g.field_178053_u > -1 && this.field_175311_g.field_178053_u < field_175310_f.size() || this.field_175317_i.getText().length() > 1; + } + + static + { + ChunkProviderSettings.Factory chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory("{ \"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":5000.0, \"mainNoiseScaleY\":1000.0, \"mainNoiseScaleZ\":5000.0, \"baseSize\":8.5, \"stretchY\":8.0, \"biomeDepthWeight\":2.0, \"biomeDepthOffset\":0.5, \"biomeScaleWeight\":2.0, \"biomeScaleOffset\":0.375, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":255 }"); + ResourceLocation resourcelocation = new ResourceLocation("textures/gui/presets/water.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info(I18n.format("createWorld.customize.custom.preset.waterWorld", new Object[0]), resourcelocation, chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory("{\"coordinateScale\":3000.0, \"heightScale\":6000.0, \"upperLimitScale\":250.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":80.0, \"mainNoiseScaleY\":160.0, \"mainNoiseScaleZ\":80.0, \"baseSize\":8.5, \"stretchY\":10.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":63 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/isles.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info(I18n.format("createWorld.customize.custom.preset.isleLand", new Object[0]), resourcelocation, chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory("{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":5000.0, \"mainNoiseScaleY\":1000.0, \"mainNoiseScaleZ\":5000.0, \"baseSize\":8.5, \"stretchY\":5.0, \"biomeDepthWeight\":2.0, \"biomeDepthOffset\":1.0, \"biomeScaleWeight\":4.0, \"biomeScaleOffset\":1.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":63 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/delight.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info(I18n.format("createWorld.customize.custom.preset.caveDelight", new Object[0]), resourcelocation, chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory("{\"coordinateScale\":738.41864, \"heightScale\":157.69133, \"upperLimitScale\":801.4267, \"lowerLimitScale\":1254.1643, \"depthNoiseScaleX\":374.93652, \"depthNoiseScaleZ\":288.65228, \"depthNoiseScaleExponent\":1.2092624, \"mainNoiseScaleX\":1355.9908, \"mainNoiseScaleY\":745.5343, \"mainNoiseScaleZ\":1183.464, \"baseSize\":1.8758626, \"stretchY\":1.7137525, \"biomeDepthWeight\":1.7553768, \"biomeDepthOffset\":3.4701107, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":2.535211, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":63 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/madness.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info(I18n.format("createWorld.customize.custom.preset.mountains", new Object[0]), resourcelocation, chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory("{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":1000.0, \"mainNoiseScaleY\":3000.0, \"mainNoiseScaleZ\":1000.0, \"baseSize\":8.5, \"stretchY\":10.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":20 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/drought.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info(I18n.format("createWorld.customize.custom.preset.drought", new Object[0]), resourcelocation, chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory("{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":2.0, \"lowerLimitScale\":64.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":80.0, \"mainNoiseScaleY\":160.0, \"mainNoiseScaleZ\":80.0, \"baseSize\":8.5, \"stretchY\":12.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":false, \"seaLevel\":6 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/chaos.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info(I18n.format("createWorld.customize.custom.preset.caveChaos", new Object[0]), resourcelocation, chunkprovidersettings$factory)); + chunkprovidersettings$factory = ChunkProviderSettings.Factory.jsonToFactory("{\"coordinateScale\":684.412, \"heightScale\":684.412, \"upperLimitScale\":512.0, \"lowerLimitScale\":512.0, \"depthNoiseScaleX\":200.0, \"depthNoiseScaleZ\":200.0, \"depthNoiseScaleExponent\":0.5, \"mainNoiseScaleX\":80.0, \"mainNoiseScaleY\":160.0, \"mainNoiseScaleZ\":80.0, \"baseSize\":8.5, \"stretchY\":12.0, \"biomeDepthWeight\":1.0, \"biomeDepthOffset\":0.0, \"biomeScaleWeight\":1.0, \"biomeScaleOffset\":0.0, \"useCaves\":true, \"useDungeons\":true, \"dungeonChance\":8, \"useStrongholds\":true, \"useVillages\":true, \"useMineShafts\":true, \"useTemples\":true, \"useRavines\":true, \"useWaterLakes\":true, \"waterLakeChance\":4, \"useLavaLakes\":true, \"lavaLakeChance\":80, \"useLavaOceans\":true, \"seaLevel\":40 }"); + resourcelocation = new ResourceLocation("textures/gui/presets/luck.png"); + field_175310_f.add(new GuiScreenCustomizePresets.Info(I18n.format("createWorld.customize.custom.preset.goodLuck", new Object[0]), resourcelocation, chunkprovidersettings$factory)); + } + + static class Info + { + public String field_178955_a; + public ResourceLocation field_178953_b; + public ChunkProviderSettings.Factory field_178954_c; + + public Info(String p_i45523_1_, ResourceLocation p_i45523_2_, ChunkProviderSettings.Factory p_i45523_3_) + { + this.field_178955_a = p_i45523_1_; + this.field_178953_b = p_i45523_2_; + this.field_178954_c = p_i45523_3_; + } + } + + class ListPreset extends GuiSlot + { + public int field_178053_u = -1; + + public ListPreset() + { + super(GuiScreenCustomizePresets.this.mc, GuiScreenCustomizePresets.this.width, GuiScreenCustomizePresets.this.height, 80, GuiScreenCustomizePresets.this.height - 32, 38); + } + + protected int getSize() + { + return GuiScreenCustomizePresets.field_175310_f.size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + this.field_178053_u = slotIndex; + GuiScreenCustomizePresets.this.func_175304_a(); + GuiScreenCustomizePresets.this.field_175317_i.setText(((GuiScreenCustomizePresets.Info)GuiScreenCustomizePresets.field_175310_f.get(GuiScreenCustomizePresets.this.field_175311_g.field_178053_u)).field_178954_c.toString()); + } + + protected boolean isSelected(int slotIndex) + { + return slotIndex == this.field_178053_u; + } + + protected void drawBackground() + { + } + + private void func_178051_a(int p_178051_1_, int p_178051_2_, ResourceLocation p_178051_3_) + { + int i = p_178051_1_ + 5; + GuiScreenCustomizePresets.this.drawHorizontalLine(i - 1, i + 32, p_178051_2_ - 1, -2039584); + GuiScreenCustomizePresets.this.drawHorizontalLine(i - 1, i + 32, p_178051_2_ + 32, -6250336); + GuiScreenCustomizePresets.this.drawVerticalLine(i - 1, p_178051_2_ - 1, p_178051_2_ + 32, -2039584); + GuiScreenCustomizePresets.this.drawVerticalLine(i + 32, p_178051_2_ - 1, p_178051_2_ + 32, -6250336); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(p_178051_3_); + int j = 32; + int k = 32; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double)(i + 0), (double)(p_178051_2_ + 32), 0.0D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos((double)(i + 32), (double)(p_178051_2_ + 32), 0.0D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos((double)(i + 32), (double)(p_178051_2_ + 0), 0.0D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos((double)(i + 0), (double)(p_178051_2_ + 0), 0.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + GuiScreenCustomizePresets.Info guiscreencustomizepresets$info = (GuiScreenCustomizePresets.Info)GuiScreenCustomizePresets.field_175310_f.get(entryID); + this.func_178051_a(p_180791_2_, p_180791_3_, guiscreencustomizepresets$info.field_178953_b); + GuiScreenCustomizePresets.this.fontRendererObj.drawString(guiscreencustomizepresets$info.field_178955_a, p_180791_2_ + 32 + 10, p_180791_3_ + 14, 16777215); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenDemo.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenDemo.java new file mode 100644 index 0000000..c7d73cb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenDemo.java @@ -0,0 +1,81 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import java.net.URI; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GuiScreenDemo extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146348_f = new ResourceLocation("textures/gui/demo_background.png"); + + public void initGui() + { + this.buttonList.clear(); + int i = -16; + this.buttonList.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + i, 114, 20, I18n.format("demo.help.buy", new Object[0]))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + i, 114, 20, I18n.format("demo.help.later", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + switch (button.id) + { + case 1: + button.enabled = false; + + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://www.minecraft.net/store?source=demo")}); + } + catch (Throwable throwable) + { + logger.error("Couldn\'t open link", throwable); + } + + break; + + case 2: + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + } + + public void updateScreen() + { + super.updateScreen(); + } + + public void drawDefaultBackground() + { + super.drawDefaultBackground(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_146348_f); + int i = (this.width - 248) / 2; + int j = (this.height - 166) / 2; + this.drawTexturedModalRect(i, j, 0, 0, 248, 166); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int i = (this.width - 248) / 2 + 10; + int j = (this.height - 166) / 2 + 8; + this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), i, j, 2039583); + j = j + 12; + GameSettings gamesettings = this.mc.gameSettings; + this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}), i, j, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), i, j + 12, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}), i, j + 24, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}), i, j + 36, 5197647); + this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), i, j + 68, 218, 2039583); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java new file mode 100644 index 0000000..18570d4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java @@ -0,0 +1,153 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class GuiScreenOptionsSounds extends GuiScreen +{ + private final GuiScreen field_146505_f; + private final GameSettings game_settings_4; + protected String field_146507_a = "Options"; + private String field_146508_h; + + public GuiScreenOptionsSounds(GuiScreen p_i45025_1_, GameSettings p_i45025_2_) + { + this.field_146505_f = p_i45025_1_; + this.game_settings_4 = p_i45025_2_; + } + + public void initGui() + { + int i = 0; + this.field_146507_a = I18n.format("options.sounds.title", new Object[0]); + this.field_146508_h = I18n.format("options.off", new Object[0]); + this.buttonList.add(new GuiScreenOptionsSounds.Button(SoundCategory.MASTER.getCategoryId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), SoundCategory.MASTER, true)); + i = i + 2; + + for (SoundCategory soundcategory : SoundCategory.values()) + { + if (soundcategory != SoundCategory.MASTER) + { + this.buttonList.add(new GuiScreenOptionsSounds.Button(soundcategory.getCategoryId(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), soundcategory, false)); + ++i; + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146505_f); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146507_a, this.width / 2, 15, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + protected String getSoundVolume(SoundCategory p_146504_1_) + { + float f = this.game_settings_4.getSoundLevel(p_146504_1_); + return f == 0.0F ? this.field_146508_h : (int)(f * 100.0F) + "%"; + } + + class Button extends GuiButton + { + private final SoundCategory field_146153_r; + private final String field_146152_s; + public float field_146156_o = 1.0F; + public boolean field_146155_p; + + public Button(int p_i45024_2_, int p_i45024_3_, int p_i45024_4_, SoundCategory p_i45024_5_, boolean p_i45024_6_) + { + super(p_i45024_2_, p_i45024_3_, p_i45024_4_, p_i45024_6_ ? 310 : 150, 20, ""); + this.field_146153_r = p_i45024_5_; + this.field_146152_s = I18n.format("soundCategory." + p_i45024_5_.getCategoryName(), new Object[0]); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.getSoundVolume(p_i45024_5_); + this.field_146156_o = GuiScreenOptionsSounds.this.game_settings_4.getSoundLevel(p_i45024_5_); + } + + protected int getHoverState(boolean mouseOver) + { + return 0; + } + + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + if (this.field_146155_p) + { + this.field_146156_o = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + this.field_146156_o = MathHelper.clamp_float(this.field_146156_o, 0.0F, 1.0F); + mc.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o); + mc.gameSettings.saveOptions(); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.getSoundVolume(this.field_146153_r); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.field_146156_o = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + this.field_146156_o = MathHelper.clamp_float(this.field_146156_o, 0.0F, 1.0F); + mc.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o); + mc.gameSettings.saveOptions(); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.getSoundVolume(this.field_146153_r); + this.field_146155_p = true; + return true; + } + else + { + return false; + } + } + + public void playPressSound(SoundHandler soundHandlerIn) + { + } + + public void mouseReleased(int mouseX, int mouseY) + { + if (this.field_146155_p) + { + if (this.field_146153_r == SoundCategory.MASTER) + { + float f = 1.0F; + } + else + { + GuiScreenOptionsSounds.this.game_settings_4.getSoundLevel(this.field_146153_r); + } + + GuiScreenOptionsSounds.this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + } + + this.field_146155_p = false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java new file mode 100644 index 0000000..f6acedc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java @@ -0,0 +1,196 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.realms.RealmsButton; +import net.minecraft.realms.RealmsScreen; + +public class GuiScreenRealmsProxy extends GuiScreen +{ + private RealmsScreen field_154330_a; + + public GuiScreenRealmsProxy(RealmsScreen p_i1087_1_) + { + this.field_154330_a = p_i1087_1_; + super.buttonList = Collections.synchronizedList(Lists.newArrayList()); + } + + public RealmsScreen func_154321_a() + { + return this.field_154330_a; + } + + public void initGui() + { + this.field_154330_a.init(); + super.initGui(); + } + + public void func_154325_a(String p_154325_1_, int p_154325_2_, int p_154325_3_, int p_154325_4_) + { + super.drawCenteredString(this.fontRendererObj, p_154325_1_, p_154325_2_, p_154325_3_, p_154325_4_); + } + + public void func_154322_b(String p_154322_1_, int p_154322_2_, int p_154322_3_, int p_154322_4_, boolean p_154322_5_) + { + if (p_154322_5_) + { + super.drawString(this.fontRendererObj, p_154322_1_, p_154322_2_, p_154322_3_, p_154322_4_); + } + else + { + this.fontRendererObj.drawString(p_154322_1_, p_154322_2_, p_154322_3_, p_154322_4_); + } + } + + public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) + { + this.field_154330_a.blit(x, y, textureX, textureY, width, height); + super.drawTexturedModalRect(x, y, textureX, textureY, width, height); + } + + public void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor) + { + super.drawGradientRect(left, top, right, bottom, startColor, endColor); + } + + public void drawDefaultBackground() + { + super.drawDefaultBackground(); + } + + public boolean doesGuiPauseGame() + { + return super.doesGuiPauseGame(); + } + + public void drawWorldBackground(int tint) + { + super.drawWorldBackground(tint); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.field_154330_a.render(mouseX, mouseY, partialTicks); + } + + public void renderToolTip(ItemStack stack, int x, int y) + { + super.renderToolTip(stack, x, y); + } + + public void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY) + { + super.drawCreativeTabHoveringText(tabName, mouseX, mouseY); + } + + public void drawHoveringText(List textLines, int x, int y) + { + super.drawHoveringText(textLines, x, y); + } + + public void updateScreen() + { + this.field_154330_a.tick(); + super.updateScreen(); + } + + public int func_154329_h() + { + return this.fontRendererObj.FONT_HEIGHT; + } + + public int func_154326_c(String p_154326_1_) + { + return this.fontRendererObj.getStringWidth(p_154326_1_); + } + + public void func_154319_c(String p_154319_1_, int p_154319_2_, int p_154319_3_, int p_154319_4_) + { + this.fontRendererObj.drawStringWithShadow(p_154319_1_, (float)p_154319_2_, (float)p_154319_3_, p_154319_4_); + } + + public List func_154323_a(String p_154323_1_, int p_154323_2_) + { + return this.fontRendererObj.listFormattedStringToWidth(p_154323_1_, p_154323_2_); + } + + public final void actionPerformed(GuiButton button) throws IOException + { + this.field_154330_a.buttonClicked(((GuiButtonRealmsProxy)button).getRealmsButton()); + } + + public void func_154324_i() + { + super.buttonList.clear(); + } + + public void func_154327_a(RealmsButton p_154327_1_) + { + super.buttonList.add(p_154327_1_.getProxy()); + } + + public List func_154320_j() + { + List list = Lists.newArrayListWithExpectedSize(super.buttonList.size()); + + for (GuiButton guibutton : super.buttonList) + { + list.add(((GuiButtonRealmsProxy)guibutton).getRealmsButton()); + } + + return list; + } + + public void func_154328_b(RealmsButton p_154328_1_) + { + super.buttonList.remove(p_154328_1_.getProxy()); + } + + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + this.field_154330_a.mouseClicked(mouseX, mouseY, mouseButton); + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + public void handleMouseInput() throws IOException + { + this.field_154330_a.mouseEvent(); + super.handleMouseInput(); + } + + public void handleKeyboardInput() throws IOException + { + this.field_154330_a.keyboardEvent(); + super.handleKeyboardInput(); + } + + public void mouseReleased(int mouseX, int mouseY, int state) + { + this.field_154330_a.mouseReleased(mouseX, mouseY, state); + } + + public void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) + { + this.field_154330_a.mouseDragged(mouseX, mouseY, clickedMouseButton, timeSinceLastClick); + } + + public void keyTyped(char typedChar, int keyCode) throws IOException + { + this.field_154330_a.keyPressed(typedChar, keyCode); + } + + public void confirmClicked(boolean result, int id) + { + this.field_154330_a.confirmResult(result, id); + } + + public void onGuiClosed() + { + this.field_154330_a.removed(); + super.onGuiClosed(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java new file mode 100644 index 0000000..bd567ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java @@ -0,0 +1,217 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.Collections; +import java.util.List; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackListEntry; +import net.minecraft.client.resources.ResourcePackListEntryDefault; +import net.minecraft.client.resources.ResourcePackListEntryFound; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.Sys; + +public class GuiScreenResourcePacks extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private final GuiScreen parentScreen; + private List availableResourcePacks; + private List selectedResourcePacks; + private GuiResourcePackAvailable availableResourcePacksList; + private GuiResourcePackSelected selectedResourcePacksList; + private boolean changed = false; + + public GuiScreenResourcePacks(GuiScreen parentScreenIn) + { + this.parentScreen = parentScreenIn; + } + + public void initGui() + { + this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0]))); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0]))); + + if (!this.changed) + { + this.availableResourcePacks = Lists.newArrayList(); + this.selectedResourcePacks = Lists.newArrayList(); + ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository(); + resourcepackrepository.updateRepositoryEntriesAll(); + List list = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll()); + list.removeAll(resourcepackrepository.getRepositoryEntries()); + + for (ResourcePackRepository.Entry resourcepackrepository$entry : list) + { + this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry)); + } + + for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists.reverse(resourcepackrepository.getRepositoryEntries())) + { + this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1)); + } + + this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this)); + } + + this.availableResourcePacksList = new GuiResourcePackAvailable(this.mc, 200, this.height, this.availableResourcePacks); + this.availableResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200); + this.availableResourcePacksList.registerScrollButtons(7, 8); + this.selectedResourcePacksList = new GuiResourcePackSelected(this.mc, 200, this.height, this.selectedResourcePacks); + this.selectedResourcePacksList.setSlotXBoundsFromLeft(this.width / 2 + 4); + this.selectedResourcePacksList.registerScrollButtons(7, 8); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.selectedResourcePacksList.handleMouseInput(); + this.availableResourcePacksList.handleMouseInput(); + } + + public boolean hasResourcePackEntry(ResourcePackListEntry p_146961_1_) + { + return this.selectedResourcePacks.contains(p_146961_1_); + } + + public List getListContaining(ResourcePackListEntry p_146962_1_) + { + return this.hasResourcePackEntry(p_146962_1_) ? this.selectedResourcePacks : this.availableResourcePacks; + } + + public List getAvailableResourcePacks() + { + return this.availableResourcePacks; + } + + public List getSelectedResourcePacks() + { + return this.selectedResourcePacks; + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 2) + { + File file1 = this.mc.getResourcePackRepository().getDirResourcepacks(); + String s = file1.getAbsolutePath(); + + if (Util.getOSType() == Util.EnumOS.OSX) + { + try + { + logger.info(s); + Runtime.getRuntime().exec(new String[] {"/usr/bin/open", s}); + return; + } + catch (IOException ioexception1) + { + logger.error((String)"Couldn\'t open file", (Throwable)ioexception1); + } + } + else if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + String s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {s}); + + try + { + Runtime.getRuntime().exec(s1); + return; + } + catch (IOException ioexception) + { + logger.error((String)"Couldn\'t open file", (Throwable)ioexception); + } + } + + boolean flag = false; + + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {file1.toURI()}); + } + catch (Throwable throwable) + { + logger.error("Couldn\'t open link", throwable); + flag = true; + } + + if (flag) + { + logger.info("Opening via system class!"); + Sys.openURL("file://" + s); + } + } + else if (button.id == 1) + { + if (this.changed) + { + List list = Lists.newArrayList(); + + for (ResourcePackListEntry resourcepacklistentry : this.selectedResourcePacks) + { + if (resourcepacklistentry instanceof ResourcePackListEntryFound) + { + list.add(((ResourcePackListEntryFound)resourcepacklistentry).func_148318_i()); + } + } + + Collections.reverse(list); + this.mc.getResourcePackRepository().setRepositories(list); + this.mc.gameSettings.resourcePacks.clear(); + this.mc.gameSettings.incompatibleResourcePacks.clear(); + + for (ResourcePackRepository.Entry resourcepackrepository$entry : list) + { + this.mc.gameSettings.resourcePacks.add(resourcepackrepository$entry.getResourcePackName()); + + if (resourcepackrepository$entry.func_183027_f() != 1) + { + this.mc.gameSettings.incompatibleResourcePacks.add(resourcepackrepository$entry.getResourcePackName()); + } + } + + this.mc.gameSettings.saveOptions(); + this.mc.refreshResources(); + } + + this.mc.displayGuiScreen(this.parentScreen); + } + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.availableResourcePacksList.mouseClicked(mouseX, mouseY, mouseButton); + this.selectedResourcePacksList.mouseClicked(mouseX, mouseY, mouseButton); + } + + protected void mouseReleased(int mouseX, int mouseY, int state) + { + super.mouseReleased(mouseX, mouseY, state); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawBackground(0); + this.availableResourcePacksList.drawScreen(mouseX, mouseY, partialTicks); + this.selectedResourcePacksList.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.title", new Object[0]), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.folderInfo", new Object[0]), this.width / 2 - 77, this.height - 26, 8421504); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void markChanged() + { + this.changed = true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java new file mode 100644 index 0000000..cd7dd52 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java @@ -0,0 +1,87 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.resources.I18n; +import org.lwjgl.input.Keyboard; + +public class GuiScreenServerList extends GuiScreen +{ + private final GuiScreen field_146303_a; + private final ServerData field_146301_f; + private GuiTextField field_146302_g; + + public GuiScreenServerList(GuiScreen p_i1031_1_, ServerData p_i1031_2_) + { + this.field_146303_a = p_i1031_1_; + this.field_146301_f = p_i1031_2_; + } + + public void updateScreen() + { + this.field_146302_g.updateCursorCounter(); + } + + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectServer.select", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0]))); + this.field_146302_g = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 116, 200, 20); + this.field_146302_g.setMaxStringLength(128); + this.field_146302_g.setFocused(true); + this.field_146302_g.setText(this.mc.gameSettings.lastServer); + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146302_g.getText().length() > 0 && this.field_146302_g.getText().split(":").length > 0; + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + this.mc.gameSettings.lastServer = this.field_146302_g.getText(); + this.mc.gameSettings.saveOptions(); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 1) + { + this.field_146303_a.confirmClicked(false, 0); + } + else if (button.id == 0) + { + this.field_146301_f.serverIP = this.field_146302_g.getText(); + this.field_146303_a.confirmClicked(true, 0); + } + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (this.field_146302_g.textboxKeyTyped(typedChar, keyCode)) + { + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146302_g.getText().length() > 0 && this.field_146302_g.getText().split(":").length > 0; + } + else if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146302_g.mouseClicked(mouseX, mouseY, mouseButton); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectServer.direct", new Object[0]), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterIp", new Object[0]), this.width / 2 - 100, 100, 10526880); + this.field_146302_g.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java new file mode 100644 index 0000000..abadd58 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java @@ -0,0 +1,71 @@ +package net.minecraft.client.gui; + +import net.minecraft.util.IProgressUpdate; +import net.optifine.CustomLoadingScreen; +import net.optifine.CustomLoadingScreens; + +public class GuiScreenWorking extends GuiScreen implements IProgressUpdate +{ + private String field_146591_a = ""; + private String field_146589_f = ""; + private int progress; + private boolean doneWorking; + private CustomLoadingScreen customLoadingScreen = CustomLoadingScreens.getCustomLoadingScreen(); + + public void displaySavingString(String message) + { + this.resetProgressAndMessage(message); + } + + public void resetProgressAndMessage(String message) + { + this.field_146591_a = message; + this.displayLoadingString("Working..."); + } + + public void displayLoadingString(String message) + { + this.field_146589_f = message; + this.setLoadingProgress(0); + } + + public void setLoadingProgress(int progress) + { + this.progress = progress; + } + + public void setDoneWorking() + { + this.doneWorking = true; + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + if (this.doneWorking) + { + if (!this.mc.isConnectedToRealms()) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + } + else + { + if (this.customLoadingScreen != null && this.mc.theWorld == null) + { + this.customLoadingScreen.drawBackground(this.width, this.height); + } + else + { + this.drawDefaultBackground(); + } + + if (this.progress > 0) + { + this.drawCenteredString(this.fontRendererObj, this.field_146591_a, this.width / 2, 70, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146589_f + " " + this.progress + "%", this.width / 2, 90, 16777215); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java new file mode 100644 index 0000000..18df4f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java @@ -0,0 +1,315 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GuiSelectWorld extends GuiScreen implements GuiYesNoCallback +{ + private static final Logger logger = LogManager.getLogger(); + private final DateFormat field_146633_h = new SimpleDateFormat(); + protected GuiScreen parentScreen; + protected String screenTitle = "Select world"; + private boolean field_146634_i; + private int selectedIndex; + private java.util.List field_146639_s; + private GuiSelectWorld.List availableWorlds; + private String field_146637_u; + private String field_146636_v; + private String[] field_146635_w = new String[4]; + private boolean confirmingDelete; + private GuiButton deleteButton; + private GuiButton selectButton; + private GuiButton renameButton; + private GuiButton recreateButton; + + public GuiSelectWorld(GuiScreen parentScreenIn) + { + this.parentScreen = parentScreenIn; + } + + public void initGui() + { + this.screenTitle = I18n.format("selectWorld.title", new Object[0]); + + try + { + this.loadLevelList(); + } + catch (AnvilConverterException anvilconverterexception) + { + logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception); + this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage())); + return; + } + + this.field_146637_u = I18n.format("selectWorld.world", new Object[0]); + this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]); + this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]); + this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]); + this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]); + this.field_146635_w[WorldSettings.GameType.SPECTATOR.getID()] = I18n.format("gameMode.spectator", new Object[0]); + this.availableWorlds = new GuiSelectWorld.List(this.mc); + this.availableWorlds.registerScrollButtons(4, 5); + this.addWorldSelectionButtons(); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.availableWorlds.handleMouseInput(); + } + + private void loadLevelList() throws AnvilConverterException + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + this.field_146639_s = isaveformat.getSaveList(); + Collections.sort(this.field_146639_s); + this.selectedIndex = -1; + } + + protected String func_146621_a(int p_146621_1_) + { + return ((SaveFormatComparator)this.field_146639_s.get(p_146621_1_)).getFileName(); + } + + protected String func_146614_d(int p_146614_1_) + { + String s = ((SaveFormatComparator)this.field_146639_s.get(p_146614_1_)).getDisplayName(); + + if (StringUtils.isEmpty(s)) + { + s = I18n.format("selectWorld.world", new Object[0]) + " " + (p_146614_1_ + 1); + } + + return s; + } + + public void addWorldSelectionButtons() + { + this.buttonList.add(this.selectButton = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.format("selectWorld.select", new Object[0]))); + this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.format("selectWorld.create", new Object[0]))); + this.buttonList.add(this.renameButton = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.format("selectWorld.rename", new Object[0]))); + this.buttonList.add(this.deleteButton = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.format("selectWorld.delete", new Object[0]))); + this.buttonList.add(this.recreateButton = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.format("selectWorld.recreate", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.format("gui.cancel", new Object[0]))); + this.selectButton.enabled = false; + this.deleteButton.enabled = false; + this.renameButton.enabled = false; + this.recreateButton.enabled = false; + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 2) + { + String s = this.func_146614_d(this.selectedIndex); + + if (s != null) + { + this.confirmingDelete = true; + GuiYesNo guiyesno = makeDeleteWorldYesNo(this, s, this.selectedIndex); + this.mc.displayGuiScreen(guiyesno); + } + } + else if (button.id == 1) + { + this.func_146615_e(this.selectedIndex); + } + else if (button.id == 3) + { + this.mc.displayGuiScreen(new GuiCreateWorld(this)); + } + else if (button.id == 6) + { + this.mc.displayGuiScreen(new GuiRenameWorld(this, this.func_146621_a(this.selectedIndex))); + } + else if (button.id == 0) + { + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 7) + { + GuiCreateWorld guicreateworld = new GuiCreateWorld(this); + ISaveHandler isavehandler = this.mc.getSaveLoader().getSaveLoader(this.func_146621_a(this.selectedIndex), false); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + isavehandler.flush(); + guicreateworld.recreateFromExistingWorld(worldinfo); + this.mc.displayGuiScreen(guicreateworld); + } + else + { + this.availableWorlds.actionPerformed(button); + } + } + } + + public void func_146615_e(int p_146615_1_) + { + this.mc.displayGuiScreen((GuiScreen)null); + + if (!this.field_146634_i) + { + this.field_146634_i = true; + String s = this.func_146621_a(p_146615_1_); + + if (s == null) + { + s = "World" + p_146615_1_; + } + + String s1 = this.func_146614_d(p_146615_1_); + + if (s1 == null) + { + s1 = "World" + p_146615_1_; + } + + if (this.mc.getSaveLoader().canLoadWorld(s)) + { + this.mc.launchIntegratedServer(s, s1, (WorldSettings)null); + } + } + } + + public void confirmClicked(boolean result, int id) + { + if (this.confirmingDelete) + { + this.confirmingDelete = false; + + if (result) + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.flushCache(); + isaveformat.deleteWorldDirectory(this.func_146621_a(id)); + + try + { + this.loadLevelList(); + } + catch (AnvilConverterException anvilconverterexception) + { + logger.error((String)"Couldn\'t load level list", (Throwable)anvilconverterexception); + } + } + + this.mc.displayGuiScreen(this); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.availableWorlds.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public static GuiYesNo makeDeleteWorldYesNo(GuiYesNoCallback selectWorld, String name, int id) + { + String s = I18n.format("selectWorld.deleteQuestion", new Object[0]); + String s1 = "\'" + name + "\' " + I18n.format("selectWorld.deleteWarning", new Object[0]); + String s2 = I18n.format("selectWorld.deleteButton", new Object[0]); + String s3 = I18n.format("gui.cancel", new Object[0]); + GuiYesNo guiyesno = new GuiYesNo(selectWorld, s, s1, s2, s3, id); + return guiyesno; + } + + class List extends GuiSlot + { + public List(Minecraft mcIn) + { + super(mcIn, GuiSelectWorld.this.width, GuiSelectWorld.this.height, 32, GuiSelectWorld.this.height - 64, 36); + } + + protected int getSize() + { + return GuiSelectWorld.this.field_146639_s.size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + GuiSelectWorld.this.selectedIndex = slotIndex; + boolean flag = GuiSelectWorld.this.selectedIndex >= 0 && GuiSelectWorld.this.selectedIndex < this.getSize(); + GuiSelectWorld.this.selectButton.enabled = flag; + GuiSelectWorld.this.deleteButton.enabled = flag; + GuiSelectWorld.this.renameButton.enabled = flag; + GuiSelectWorld.this.recreateButton.enabled = flag; + + if (isDoubleClick && flag) + { + GuiSelectWorld.this.func_146615_e(slotIndex); + } + } + + protected boolean isSelected(int slotIndex) + { + return slotIndex == GuiSelectWorld.this.selectedIndex; + } + + protected int getContentHeight() + { + return GuiSelectWorld.this.field_146639_s.size() * 36; + } + + protected void drawBackground() + { + GuiSelectWorld.this.drawDefaultBackground(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + SaveFormatComparator saveformatcomparator = (SaveFormatComparator)GuiSelectWorld.this.field_146639_s.get(entryID); + String s = saveformatcomparator.getDisplayName(); + + if (StringUtils.isEmpty(s)) + { + s = GuiSelectWorld.this.field_146637_u + " " + (entryID + 1); + } + + String s1 = saveformatcomparator.getFileName(); + s1 = s1 + " (" + GuiSelectWorld.this.field_146633_h.format(new Date(saveformatcomparator.getLastTimePlayed())); + s1 = s1 + ")"; + String s2 = ""; + + if (saveformatcomparator.requiresConversion()) + { + s2 = GuiSelectWorld.this.field_146636_v + " " + s2; + } + else + { + s2 = GuiSelectWorld.this.field_146635_w[saveformatcomparator.getEnumGameType().getID()]; + + if (saveformatcomparator.isHardcoreModeEnabled()) + { + s2 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + EnumChatFormatting.RESET; + } + + if (saveformatcomparator.getCheatsEnabled()) + { + s2 = s2 + ", " + I18n.format("selectWorld.cheats", new Object[0]); + } + } + + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s, p_180791_2_ + 2, p_180791_3_ + 1, 16777215); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s1, p_180791_2_ + 2, p_180791_3_ + 12, 8421504); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s2, p_180791_2_ + 2, p_180791_3_ + 12 + 10, 8421504); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiShareToLan.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiShareToLan.java new file mode 100644 index 0000000..efc35c0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiShareToLan.java @@ -0,0 +1,106 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.WorldSettings; + +public class GuiShareToLan extends GuiScreen +{ + private final GuiScreen field_146598_a; + private GuiButton field_146596_f; + private GuiButton field_146597_g; + private String field_146599_h = "survival"; + private boolean field_146600_i; + + public GuiShareToLan(GuiScreen p_i1055_1_) + { + this.field_146598_a = p_i1055_1_; + } + + public void initGui() + { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("lanServer.start", new Object[0]))); + this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.field_146597_g = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.format("selectWorld.gameMode", new Object[0]))); + this.buttonList.add(this.field_146596_f = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.format("selectWorld.allowCommands", new Object[0]))); + this.func_146595_g(); + } + + private void func_146595_g() + { + this.field_146597_g.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + " " + I18n.format("selectWorld.gameMode." + this.field_146599_h, new Object[0]); + this.field_146596_f.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " "; + + if (this.field_146600_i) + { + this.field_146596_f.displayString = this.field_146596_f.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.field_146596_f.displayString = this.field_146596_f.displayString + I18n.format("options.off", new Object[0]); + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 102) + { + this.mc.displayGuiScreen(this.field_146598_a); + } + else if (button.id == 104) + { + if (this.field_146599_h.equals("spectator")) + { + this.field_146599_h = "creative"; + } + else if (this.field_146599_h.equals("creative")) + { + this.field_146599_h = "adventure"; + } + else if (this.field_146599_h.equals("adventure")) + { + this.field_146599_h = "survival"; + } + else + { + this.field_146599_h = "spectator"; + } + + this.func_146595_g(); + } + else if (button.id == 103) + { + this.field_146600_i = !this.field_146600_i; + this.func_146595_g(); + } + else if (button.id == 101) + { + this.mc.displayGuiScreen((GuiScreen)null); + String s = this.mc.getIntegratedServer().shareToLAN(WorldSettings.GameType.getByName(this.field_146599_h), this.field_146600_i); + IChatComponent ichatcomponent; + + if (s != null) + { + ichatcomponent = new ChatComponentTranslation("commands.publish.started", new Object[] {s}); + } + else + { + ichatcomponent = new ChatComponentText("commands.publish.failed"); + } + + this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.title", new Object[0]), this.width / 2, 50, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.otherPlayers", new Object[0]), this.width / 2, 82, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSimpleScrolledSelectionListProxy.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSimpleScrolledSelectionListProxy.java new file mode 100644 index 0000000..adda680 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSimpleScrolledSelectionListProxy.java @@ -0,0 +1,148 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.realms.RealmsSimpleScrolledSelectionList; +import net.minecraft.util.MathHelper; + +public class GuiSimpleScrolledSelectionListProxy extends GuiSlot +{ + private final RealmsSimpleScrolledSelectionList field_178050_u; + + public GuiSimpleScrolledSelectionListProxy(RealmsSimpleScrolledSelectionList p_i45525_1_, int widthIn, int heightIn, int topIn, int bottomIn, int slotHeightIn) + { + super(Minecraft.getMinecraft(), widthIn, heightIn, topIn, bottomIn, slotHeightIn); + this.field_178050_u = p_i45525_1_; + } + + protected int getSize() + { + return this.field_178050_u.getItemCount(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + this.field_178050_u.selectItem(slotIndex, isDoubleClick, mouseX, mouseY); + } + + protected boolean isSelected(int slotIndex) + { + return this.field_178050_u.isSelectedItem(slotIndex); + } + + protected void drawBackground() + { + this.field_178050_u.renderBackground(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + this.field_178050_u.renderItem(entryID, p_180791_2_, p_180791_3_, p_180791_4_, mouseXIn, mouseYIn); + } + + public int getWidth() + { + return super.width; + } + + public int getMouseY() + { + return super.mouseY; + } + + public int getMouseX() + { + return super.mouseX; + } + + protected int getContentHeight() + { + return this.field_178050_u.getMaxPosition(); + } + + protected int getScrollBarX() + { + return this.field_178050_u.getScrollbarPosition(); + } + + public void handleMouseInput() + { + super.handleMouseInput(); + } + + public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) + { + if (this.field_178041_q) + { + this.mouseX = mouseXIn; + this.mouseY = mouseYIn; + this.drawBackground(); + int i = this.getScrollBarX(); + int j = i + 6; + this.bindAmountScrolled(); + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + int l = this.top + 4 - (int)this.amountScrolled; + + if (this.hasListHeader) + { + this.drawListHeader(k, l, tessellator); + } + + this.drawSelectionBox(k, l, mouseXIn, mouseYIn); + GlStateManager.disableDepth(); + int i1 = 4; + this.overlayBackground(0, this.top, 255, 255); + this.overlayBackground(this.bottom, this.height, 255, 255); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1); + GlStateManager.disableAlpha(); + GlStateManager.shadeModel(7425); + GlStateManager.disableTexture2D(); + int j1 = this.func_148135_f(); + + if (j1 > 0) + { + int k1 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); + k1 = MathHelper.clamp_int(k1, 32, this.bottom - this.top - 8); + int l1 = (int)this.amountScrolled * (this.bottom - this.top - k1) / j1 + this.top; + + if (l1 < this.top) + { + l1 = this.top; + } + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)i, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)j, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)j, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)i, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + tessellator.draw(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)i, (double)(l1 + k1), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j, (double)(l1 + k1), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j, (double)l1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + tessellator.draw(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)i, (double)(l1 + k1 - 1), 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos((double)(j - 1), (double)(l1 + k1 - 1), 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos((double)(j - 1), (double)l1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex(); + tessellator.draw(); + } + + this.func_148142_b(mouseXIn, mouseYIn); + GlStateManager.enableTexture2D(); + GlStateManager.shadeModel(7424); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSleepMP.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSleepMP.java new file mode 100644 index 0000000..5f83450 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSleepMP.java @@ -0,0 +1,57 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.play.client.C0BPacketEntityAction; + +public class GuiSleepMP extends GuiChat +{ + public void initGui() + { + super.initGui(); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.format("multiplayer.stopSleeping", new Object[0]))); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (keyCode == 1) + { + this.wakeFromSleep(); + } + else if (keyCode != 28 && keyCode != 156) + { + super.keyTyped(typedChar, keyCode); + } + else + { + String s = this.inputField.getText().trim(); + + if (!s.isEmpty()) + { + this.mc.thePlayer.sendChatMessage(s); + } + + this.inputField.setText(""); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 1) + { + this.wakeFromSleep(); + } + else + { + super.actionPerformed(button); + } + } + + private void wakeFromSleep() + { + NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue; + nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SLEEPING)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlider.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlider.java new file mode 100644 index 0000000..51faa60 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlider.java @@ -0,0 +1,131 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; + +public class GuiSlider extends GuiButton +{ + private float sliderPosition = 1.0F; + public boolean isMouseDown; + private String name; + private final float min; + private final float max; + private final GuiPageButtonList.GuiResponder responder; + private GuiSlider.FormatHelper formatHelper; + + public GuiSlider(GuiPageButtonList.GuiResponder guiResponder, int idIn, int x, int y, String name, float min, float max, float defaultValue, GuiSlider.FormatHelper formatter) + { + super(idIn, x, y, 150, 20, ""); + this.name = name; + this.min = min; + this.max = max; + this.sliderPosition = (defaultValue - min) / (max - min); + this.formatHelper = formatter; + this.responder = guiResponder; + this.displayString = this.getDisplayString(); + } + + public float func_175220_c() + { + return this.min + (this.max - this.min) * this.sliderPosition; + } + + public void func_175218_a(float p_175218_1_, boolean p_175218_2_) + { + this.sliderPosition = (p_175218_1_ - this.min) / (this.max - this.min); + this.displayString = this.getDisplayString(); + + if (p_175218_2_) + { + this.responder.onTick(this.id, this.func_175220_c()); + } + } + + public float func_175217_d() + { + return this.sliderPosition; + } + + private String getDisplayString() + { + return this.formatHelper == null ? I18n.format(this.name, new Object[0]) + ": " + this.func_175220_c() : this.formatHelper.getText(this.id, I18n.format(this.name, new Object[0]), this.func_175220_c()); + } + + protected int getHoverState(boolean mouseOver) + { + return 0; + } + + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + if (this.isMouseDown) + { + this.sliderPosition = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + + if (this.sliderPosition < 0.0F) + { + this.sliderPosition = 0.0F; + } + + if (this.sliderPosition > 1.0F) + { + this.sliderPosition = 1.0F; + } + + this.displayString = this.getDisplayString(); + this.responder.onTick(this.id, this.func_175220_c()); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderPosition * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderPosition * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + + public void func_175219_a(float p_175219_1_) + { + this.sliderPosition = p_175219_1_; + this.displayString = this.getDisplayString(); + this.responder.onTick(this.id, this.func_175220_c()); + } + + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.sliderPosition = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + + if (this.sliderPosition < 0.0F) + { + this.sliderPosition = 0.0F; + } + + if (this.sliderPosition > 1.0F) + { + this.sliderPosition = 1.0F; + } + + this.displayString = this.getDisplayString(); + this.responder.onTick(this.id, this.func_175220_c()); + this.isMouseDown = true; + return true; + } + else + { + return false; + } + } + + public void mouseReleased(int mouseX, int mouseY) + { + this.isMouseDown = false; + } + + public interface FormatHelper + { + String getText(int id, String name, float value); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlot.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlot.java new file mode 100644 index 0000000..19f2c9c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlot.java @@ -0,0 +1,470 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.MathHelper; +import org.lwjgl.input.Mouse; + +public abstract class GuiSlot +{ + protected final Minecraft mc; + protected int width; + protected int height; + protected int top; + protected int bottom; + protected int right; + protected int left; + protected final int slotHeight; + private int scrollUpButtonID; + private int scrollDownButtonID; + protected int mouseX; + protected int mouseY; + protected boolean field_148163_i = true; + protected int initialClickY = -2; + protected float scrollMultiplier; + protected float amountScrolled; + protected int selectedElement = -1; + protected long lastClicked; + protected boolean field_178041_q = true; + protected boolean showSelectionBox = true; + protected boolean hasListHeader; + protected int headerPadding; + private boolean enabled = true; + + public GuiSlot(Minecraft mcIn, int width, int height, int topIn, int bottomIn, int slotHeightIn) + { + this.mc = mcIn; + this.width = width; + this.height = height; + this.top = topIn; + this.bottom = bottomIn; + this.slotHeight = slotHeightIn; + this.left = 0; + this.right = width; + } + + public void setDimensions(int widthIn, int heightIn, int topIn, int bottomIn) + { + this.width = widthIn; + this.height = heightIn; + this.top = topIn; + this.bottom = bottomIn; + this.left = 0; + this.right = widthIn; + } + + public void setShowSelectionBox(boolean showSelectionBoxIn) + { + this.showSelectionBox = showSelectionBoxIn; + } + + protected void setHasListHeader(boolean hasListHeaderIn, int headerPaddingIn) + { + this.hasListHeader = hasListHeaderIn; + this.headerPadding = headerPaddingIn; + + if (!hasListHeaderIn) + { + this.headerPadding = 0; + } + } + + protected abstract int getSize(); + + protected abstract void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY); + + protected abstract boolean isSelected(int slotIndex); + + protected int getContentHeight() + { + return this.getSize() * this.slotHeight + this.headerPadding; + } + + protected abstract void drawBackground(); + + protected void func_178040_a(int p_178040_1_, int p_178040_2_, int p_178040_3_) + { + } + + protected abstract void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn); + + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + } + + protected void func_148132_a(int p_148132_1_, int p_148132_2_) + { + } + + protected void func_148142_b(int p_148142_1_, int p_148142_2_) + { + } + + public int getSlotIndexFromScreenCoords(int p_148124_1_, int p_148124_2_) + { + int i = this.left + this.width / 2 - this.getListWidth() / 2; + int j = this.left + this.width / 2 + this.getListWidth() / 2; + int k = p_148124_2_ - this.top - this.headerPadding + (int)this.amountScrolled - 4; + int l = k / this.slotHeight; + return p_148124_1_ < this.getScrollBarX() && p_148124_1_ >= i && p_148124_1_ <= j && l >= 0 && k >= 0 && l < this.getSize() ? l : -1; + } + + public void registerScrollButtons(int scrollUpButtonIDIn, int scrollDownButtonIDIn) + { + this.scrollUpButtonID = scrollUpButtonIDIn; + this.scrollDownButtonID = scrollDownButtonIDIn; + } + + protected void bindAmountScrolled() + { + this.amountScrolled = MathHelper.clamp_float(this.amountScrolled, 0.0F, (float)this.func_148135_f()); + } + + public int func_148135_f() + { + return Math.max(0, this.getContentHeight() - (this.bottom - this.top - 4)); + } + + public int getAmountScrolled() + { + return (int)this.amountScrolled; + } + + public boolean isMouseYWithinSlotBounds(int p_148141_1_) + { + return p_148141_1_ >= this.top && p_148141_1_ <= this.bottom && this.mouseX >= this.left && this.mouseX <= this.right; + } + + public void scrollBy(int amount) + { + this.amountScrolled += (float)amount; + this.bindAmountScrolled(); + this.initialClickY = -2; + } + + public void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == this.scrollUpButtonID) + { + this.amountScrolled -= (float)(this.slotHeight * 2 / 3); + this.initialClickY = -2; + this.bindAmountScrolled(); + } + else if (button.id == this.scrollDownButtonID) + { + this.amountScrolled += (float)(this.slotHeight * 2 / 3); + this.initialClickY = -2; + this.bindAmountScrolled(); + } + } + } + + public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_) + { + if (this.field_178041_q) + { + this.mouseX = mouseXIn; + this.mouseY = mouseYIn; + this.drawBackground(); + int i = this.getScrollBarX(); + int j = i + 6; + this.bindAmountScrolled(); + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.drawContainerBackground(tessellator); + int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + int l = this.top + 4 - (int)this.amountScrolled; + + if (this.hasListHeader) + { + this.drawListHeader(k, l, tessellator); + } + + this.drawSelectionBox(k, l, mouseXIn, mouseYIn); + GlStateManager.disableDepth(); + int i1 = 4; + this.overlayBackground(0, this.top, 255, 255); + this.overlayBackground(this.bottom, this.height, 255, 255); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1); + GlStateManager.disableAlpha(); + GlStateManager.shadeModel(7425); + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)this.left, (double)(this.top + i1), 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 0).endVertex(); + worldrenderer.pos((double)this.right, (double)(this.top + i1), 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 0).endVertex(); + worldrenderer.pos((double)this.right, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)this.left, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + tessellator.draw(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)this.left, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)this.right, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)this.right, (double)(this.bottom - i1), 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 0).endVertex(); + worldrenderer.pos((double)this.left, (double)(this.bottom - i1), 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 0).endVertex(); + tessellator.draw(); + int j1 = this.func_148135_f(); + + if (j1 > 0) + { + int k1 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); + k1 = MathHelper.clamp_int(k1, 32, this.bottom - this.top - 8); + int l1 = (int)this.amountScrolled * (this.bottom - this.top - k1) / j1 + this.top; + + if (l1 < this.top) + { + l1 = this.top; + } + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)i, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)j, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)j, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)i, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + tessellator.draw(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)i, (double)(l1 + k1), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j, (double)(l1 + k1), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j, (double)l1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + tessellator.draw(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)i, (double)(l1 + k1 - 1), 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos((double)(j - 1), (double)(l1 + k1 - 1), 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos((double)(j - 1), (double)l1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex(); + worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex(); + tessellator.draw(); + } + + this.func_148142_b(mouseXIn, mouseYIn); + GlStateManager.enableTexture2D(); + GlStateManager.shadeModel(7424); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + } + } + + public void handleMouseInput() + { + if (this.isMouseYWithinSlotBounds(this.mouseY)) + { + if (Mouse.getEventButton() == 0 && Mouse.getEventButtonState() && this.mouseY >= this.top && this.mouseY <= this.bottom) + { + int i = (this.width - this.getListWidth()) / 2; + int j = (this.width + this.getListWidth()) / 2; + int k = this.mouseY - this.top - this.headerPadding + (int)this.amountScrolled - 4; + int l = k / this.slotHeight; + + if (l < this.getSize() && this.mouseX >= i && this.mouseX <= j && l >= 0 && k >= 0) + { + this.elementClicked(l, false, this.mouseX, this.mouseY); + this.selectedElement = l; + } + else if (this.mouseX >= i && this.mouseX <= j && k < 0) + { + this.func_148132_a(this.mouseX - i, this.mouseY - this.top + (int)this.amountScrolled - 4); + } + } + + if (Mouse.isButtonDown(0) && this.getEnabled()) + { + if (this.initialClickY != -1) + { + if (this.initialClickY >= 0) + { + this.amountScrolled -= (float)(this.mouseY - this.initialClickY) * this.scrollMultiplier; + this.initialClickY = this.mouseY; + } + } + else + { + boolean flag1 = true; + + if (this.mouseY >= this.top && this.mouseY <= this.bottom) + { + int j2 = (this.width - this.getListWidth()) / 2; + int k2 = (this.width + this.getListWidth()) / 2; + int l2 = this.mouseY - this.top - this.headerPadding + (int)this.amountScrolled - 4; + int i1 = l2 / this.slotHeight; + + if (i1 < this.getSize() && this.mouseX >= j2 && this.mouseX <= k2 && i1 >= 0 && l2 >= 0) + { + boolean flag = i1 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L; + this.elementClicked(i1, flag, this.mouseX, this.mouseY); + this.selectedElement = i1; + this.lastClicked = Minecraft.getSystemTime(); + } + else if (this.mouseX >= j2 && this.mouseX <= k2 && l2 < 0) + { + this.func_148132_a(this.mouseX - j2, this.mouseY - this.top + (int)this.amountScrolled - 4); + flag1 = false; + } + + int i3 = this.getScrollBarX(); + int j1 = i3 + 6; + + if (this.mouseX >= i3 && this.mouseX <= j1) + { + this.scrollMultiplier = -1.0F; + int k1 = this.func_148135_f(); + + if (k1 < 1) + { + k1 = 1; + } + + int l1 = (int)((float)((this.bottom - this.top) * (this.bottom - this.top)) / (float)this.getContentHeight()); + l1 = MathHelper.clamp_int(l1, 32, this.bottom - this.top - 8); + this.scrollMultiplier /= (float)(this.bottom - this.top - l1) / (float)k1; + } + else + { + this.scrollMultiplier = 1.0F; + } + + if (flag1) + { + this.initialClickY = this.mouseY; + } + else + { + this.initialClickY = -2; + } + } + else + { + this.initialClickY = -2; + } + } + } + else + { + this.initialClickY = -1; + } + + int i2 = Mouse.getEventDWheel(); + + if (i2 != 0) + { + if (i2 > 0) + { + i2 = -1; + } + else if (i2 < 0) + { + i2 = 1; + } + + this.amountScrolled += (float)(i2 * this.slotHeight / 2); + } + } + } + + public void setEnabled(boolean enabledIn) + { + this.enabled = enabledIn; + } + + public boolean getEnabled() + { + return this.enabled; + } + + public int getListWidth() + { + return 220; + } + + protected void drawSelectionBox(int p_148120_1_, int p_148120_2_, int mouseXIn, int mouseYIn) + { + int i = this.getSize(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + for (int j = 0; j < i; ++j) + { + int k = p_148120_2_ + j * this.slotHeight + this.headerPadding; + int l = this.slotHeight - 4; + + if (k > this.bottom || k + l < this.top) + { + this.func_178040_a(j, p_148120_1_, k); + } + + if (this.showSelectionBox && this.isSelected(j)) + { + int i1 = this.left + (this.width / 2 - this.getListWidth() / 2); + int j1 = this.left + this.width / 2 + this.getListWidth() / 2; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)i1, (double)(k + l + 2), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j1, (double)(k + l + 2), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)j1, (double)(k - 2), 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)i1, (double)(k - 2), 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex(); + worldrenderer.pos((double)(i1 + 1), (double)(k + l + 1), 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)(j1 - 1), (double)(k + l + 1), 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)(j1 - 1), (double)(k - 1), 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)(i1 + 1), (double)(k - 1), 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + } + + if (!(this instanceof GuiResourcePackList) || k >= this.top - this.slotHeight && k <= this.bottom) + { + this.drawSlot(j, p_148120_1_, k, l, mouseXIn, mouseYIn); + } + } + } + + protected int getScrollBarX() + { + return this.width / 2 + 124; + } + + protected void overlayBackground(int startY, int endY, int startAlpha, int endAlpha) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + float f = 32.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)this.left, (double)endY, 0.0D).tex(0.0D, (double)((float)endY / 32.0F)).color(64, 64, 64, endAlpha).endVertex(); + worldrenderer.pos((double)(this.left + this.width), (double)endY, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)endY / 32.0F)).color(64, 64, 64, endAlpha).endVertex(); + worldrenderer.pos((double)(this.left + this.width), (double)startY, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)startY / 32.0F)).color(64, 64, 64, startAlpha).endVertex(); + worldrenderer.pos((double)this.left, (double)startY, 0.0D).tex(0.0D, (double)((float)startY / 32.0F)).color(64, 64, 64, startAlpha).endVertex(); + tessellator.draw(); + } + + public void setSlotXBoundsFromLeft(int leftIn) + { + this.left = leftIn; + this.right = leftIn + this.width; + } + + public int getSlotHeight() + { + return this.slotHeight; + } + + protected void drawContainerBackground(Tessellator p_drawContainerBackground_1_) + { + WorldRenderer worldrenderer = p_drawContainerBackground_1_.getWorldRenderer(); + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + float f = 32.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos((double)this.left, (double)this.bottom, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); + worldrenderer.pos((double)this.right, (double)this.bottom, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); + worldrenderer.pos((double)this.right, (double)this.top, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); + worldrenderer.pos((double)this.left, (double)this.top, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); + p_drawContainerBackground_1_.draw(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java new file mode 100644 index 0000000..0cd0659 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java @@ -0,0 +1,70 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.realms.RealmsScrolledSelectionList; + +public class GuiSlotRealmsProxy extends GuiSlot +{ + private final RealmsScrolledSelectionList selectionList; + + public GuiSlotRealmsProxy(RealmsScrolledSelectionList selectionListIn, int widthIn, int heightIn, int topIn, int bottomIn, int slotHeightIn) + { + super(Minecraft.getMinecraft(), widthIn, heightIn, topIn, bottomIn, slotHeightIn); + this.selectionList = selectionListIn; + } + + protected int getSize() + { + return this.selectionList.getItemCount(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + this.selectionList.selectItem(slotIndex, isDoubleClick, mouseX, mouseY); + } + + protected boolean isSelected(int slotIndex) + { + return this.selectionList.isSelectedItem(slotIndex); + } + + protected void drawBackground() + { + this.selectionList.renderBackground(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + this.selectionList.renderItem(entryID, p_180791_2_, p_180791_3_, p_180791_4_, mouseXIn, mouseYIn); + } + + public int getWidth() + { + return super.width; + } + + public int getMouseY() + { + return super.mouseY; + } + + public int getMouseX() + { + return super.mouseX; + } + + protected int getContentHeight() + { + return this.selectionList.getMaxPosition(); + } + + protected int getScrollBarX() + { + return this.selectionList.getScrollbarPosition(); + } + + public void handleMouseInput() + { + super.handleMouseInput(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSnooper.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSnooper.java new file mode 100644 index 0000000..a103ef9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSnooper.java @@ -0,0 +1,140 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.TreeMap; +import java.util.Map.Entry; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiSnooper extends GuiScreen +{ + private final GuiScreen field_146608_a; + private final GameSettings game_settings_2; + private final java.util.List field_146604_g = Lists.newArrayList(); + private final java.util.List field_146609_h = Lists.newArrayList(); + private String field_146610_i; + private String[] field_146607_r; + private GuiSnooper.List field_146606_s; + private GuiButton field_146605_t; + + public GuiSnooper(GuiScreen p_i1061_1_, GameSettings p_i1061_2_) + { + this.field_146608_a = p_i1061_1_; + this.game_settings_2 = p_i1061_2_; + } + + public void initGui() + { + this.field_146610_i = I18n.format("options.snooper.title", new Object[0]); + String s = I18n.format("options.snooper.desc", new Object[0]); + java.util.List list = Lists.newArrayList(); + + for (String s1 : this.fontRendererObj.listFormattedStringToWidth(s, this.width - 30)) + { + list.add(s1); + } + + this.field_146607_r = (String[])list.toArray(new String[list.size()]); + this.field_146604_g.clear(); + this.field_146609_h.clear(); + this.buttonList.add(this.field_146605_t = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.format("gui.done", new Object[0]))); + boolean flag = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; + + for (Entry entry : (new TreeMap(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet()) + { + this.field_146604_g.add((flag ? "C " : "") + (String)entry.getKey()); + this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry.getValue(), this.width - 220)); + } + + if (flag) + { + for (Entry entry1 : (new TreeMap(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet()) + { + this.field_146604_g.add("S " + (String)entry1.getKey()); + this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry1.getValue(), this.width - 220)); + } + } + + this.field_146606_s = new GuiSnooper.List(); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.field_146606_s.handleMouseInput(); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 2) + { + this.game_settings_2.saveOptions(); + this.game_settings_2.saveOptions(); + this.mc.displayGuiScreen(this.field_146608_a); + } + + if (button.id == 1) + { + this.game_settings_2.setOptionValue(GameSettings.Options.SNOOPER_ENABLED, 1); + this.field_146605_t.displayString = this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_146606_s.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_146610_i, this.width / 2, 8, 16777215); + int i = 22; + + for (String s : this.field_146607_r) + { + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, i, 8421504); + i += this.fontRendererObj.FONT_HEIGHT; + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + class List extends GuiSlot + { + public List() + { + super(GuiSnooper.this.mc, GuiSnooper.this.width, GuiSnooper.this.height, 80, GuiSnooper.this.height - 40, GuiSnooper.this.fontRendererObj.FONT_HEIGHT + 1); + } + + protected int getSize() + { + return GuiSnooper.this.field_146604_g.size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + } + + protected boolean isSelected(int slotIndex) + { + return false; + } + + protected void drawBackground() + { + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + GuiSnooper.this.fontRendererObj.drawString((String)GuiSnooper.this.field_146604_g.get(entryID), 10, p_180791_3_, 16777215); + GuiSnooper.this.fontRendererObj.drawString((String)GuiSnooper.this.field_146609_h.get(entryID), 230, p_180791_3_, 16777215); + } + + protected int getScrollBarX() + { + return this.width - 10; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSpectator.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSpectator.java new file mode 100644 index 0000000..fed7e99 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiSpectator.java @@ -0,0 +1,186 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.spectator.ISpectatorMenuObject; +import net.minecraft.client.gui.spectator.ISpectatorMenuRecipient; +import net.minecraft.client.gui.spectator.SpectatorMenu; +import net.minecraft.client.gui.spectator.categories.SpectatorDetails; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class GuiSpectator extends Gui implements ISpectatorMenuRecipient +{ + private static final ResourceLocation field_175267_f = new ResourceLocation("textures/gui/widgets.png"); + public static final ResourceLocation field_175269_a = new ResourceLocation("textures/gui/spectator_widgets.png"); + private final Minecraft field_175268_g; + private long field_175270_h; + private SpectatorMenu field_175271_i; + + public GuiSpectator(Minecraft mcIn) + { + this.field_175268_g = mcIn; + } + + public void func_175260_a(int p_175260_1_) + { + this.field_175270_h = Minecraft.getSystemTime(); + + if (this.field_175271_i != null) + { + this.field_175271_i.func_178644_b(p_175260_1_); + } + else + { + this.field_175271_i = new SpectatorMenu(this); + } + } + + private float func_175265_c() + { + long i = this.field_175270_h - Minecraft.getSystemTime() + 5000L; + return MathHelper.clamp_float((float)i / 2000.0F, 0.0F, 1.0F); + } + + public void renderTooltip(ScaledResolution p_175264_1_, float p_175264_2_) + { + if (this.field_175271_i != null) + { + float f = this.func_175265_c(); + + if (f <= 0.0F) + { + this.field_175271_i.func_178641_d(); + } + else + { + int i = p_175264_1_.getScaledWidth() / 2; + float f1 = this.zLevel; + this.zLevel = -90.0F; + float f2 = (float)p_175264_1_.getScaledHeight() - 22.0F * f; + SpectatorDetails spectatordetails = this.field_175271_i.func_178646_f(); + this.func_175258_a(p_175264_1_, f, i, f2, spectatordetails); + this.zLevel = f1; + } + } + } + + protected void func_175258_a(ScaledResolution p_175258_1_, float p_175258_2_, int p_175258_3_, float p_175258_4_, SpectatorDetails p_175258_5_) + { + GlStateManager.enableRescaleNormal(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.color(1.0F, 1.0F, 1.0F, p_175258_2_); + this.field_175268_g.getTextureManager().bindTexture(field_175267_f); + this.drawTexturedModalRect((float)(p_175258_3_ - 91), p_175258_4_, 0, 0, 182, 22); + + if (p_175258_5_.func_178681_b() >= 0) + { + this.drawTexturedModalRect((float)(p_175258_3_ - 91 - 1 + p_175258_5_.func_178681_b() * 20), p_175258_4_ - 1.0F, 0, 22, 24, 22); + } + + RenderHelper.enableGUIStandardItemLighting(); + + for (int i = 0; i < 9; ++i) + { + this.func_175266_a(i, p_175258_1_.getScaledWidth() / 2 - 90 + i * 20 + 2, p_175258_4_ + 3.0F, p_175258_2_, p_175258_5_.func_178680_a(i)); + } + + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableBlend(); + } + + private void func_175266_a(int p_175266_1_, int p_175266_2_, float p_175266_3_, float p_175266_4_, ISpectatorMenuObject p_175266_5_) + { + this.field_175268_g.getTextureManager().bindTexture(field_175269_a); + + if (p_175266_5_ != SpectatorMenu.field_178657_a) + { + int i = (int)(p_175266_4_ * 255.0F); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)p_175266_2_, p_175266_3_, 0.0F); + float f = p_175266_5_.func_178662_A_() ? 1.0F : 0.25F; + GlStateManager.color(f, f, f, p_175266_4_); + p_175266_5_.func_178663_a(f, i); + GlStateManager.popMatrix(); + String s = String.valueOf((Object)GameSettings.getKeyDisplayString(this.field_175268_g.gameSettings.keyBindsHotbar[p_175266_1_].getKeyCode())); + + if (i > 3 && p_175266_5_.func_178662_A_()) + { + this.field_175268_g.fontRendererObj.drawStringWithShadow(s, (float)(p_175266_2_ + 19 - 2 - this.field_175268_g.fontRendererObj.getStringWidth(s)), p_175266_3_ + 6.0F + 3.0F, 16777215 + (i << 24)); + } + } + } + + public void renderSelectedItem(ScaledResolution p_175263_1_) + { + int i = (int)(this.func_175265_c() * 255.0F); + + if (i > 3 && this.field_175271_i != null) + { + ISpectatorMenuObject ispectatormenuobject = this.field_175271_i.func_178645_b(); + String s = ispectatormenuobject != SpectatorMenu.field_178657_a ? ispectatormenuobject.getSpectatorName().getFormattedText() : this.field_175271_i.func_178650_c().func_178670_b().getFormattedText(); + + if (s != null) + { + int j = (p_175263_1_.getScaledWidth() - this.field_175268_g.fontRendererObj.getStringWidth(s)) / 2; + int k = p_175263_1_.getScaledHeight() - 35; + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + this.field_175268_g.fontRendererObj.drawStringWithShadow(s, (float)j, (float)k, 16777215 + (i << 24)); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + } + } + + public void func_175257_a(SpectatorMenu p_175257_1_) + { + this.field_175271_i = null; + this.field_175270_h = 0L; + } + + public boolean func_175262_a() + { + return this.field_175271_i != null; + } + + public void func_175259_b(int p_175259_1_) + { + int i; + + for (i = this.field_175271_i.func_178648_e() + p_175259_1_; i >= 0 && i <= 8 && (this.field_175271_i.func_178643_a(i) == SpectatorMenu.field_178657_a || !this.field_175271_i.func_178643_a(i).func_178662_A_()); i += p_175259_1_) + { + ; + } + + if (i >= 0 && i <= 8) + { + this.field_175271_i.func_178644_b(i); + this.field_175270_h = Minecraft.getSystemTime(); + } + } + + public void func_175261_b() + { + this.field_175270_h = Minecraft.getSystemTime(); + + if (this.func_175262_a()) + { + int i = this.field_175271_i.func_178648_e(); + + if (i != -1) + { + this.field_175271_i.func_178644_b(i); + } + } + else + { + this.field_175271_i = new SpectatorMenu(this); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiStreamIndicator.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiStreamIndicator.java new file mode 100644 index 0000000..2c26811 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiStreamIndicator.java @@ -0,0 +1,109 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; + +public class GuiStreamIndicator +{ + private static final ResourceLocation locationStreamIndicator = new ResourceLocation("textures/gui/stream_indicator.png"); + private final Minecraft mc; + private float streamAlpha = 1.0F; + private int streamAlphaDelta = 1; + + public GuiStreamIndicator(Minecraft mcIn) + { + this.mc = mcIn; + } + + public void render(int p_152437_1_, int p_152437_2_) + { + if (this.mc.getTwitchStream().isBroadcasting()) + { + GlStateManager.enableBlend(); + int i = this.mc.getTwitchStream().func_152920_A(); + + if (i > 0) + { + String s = "" + i; + int j = this.mc.fontRendererObj.getStringWidth(s); + int k = 20; + int l = p_152437_1_ - j - 1; + int i1 = p_152437_2_ + 20 - 1; + int j1 = p_152437_2_ + 20 + this.mc.fontRendererObj.FONT_HEIGHT - 1; + GlStateManager.disableTexture2D(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.color(0.0F, 0.0F, 0.0F, (0.65F + 0.35000002F * this.streamAlpha) / 2.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos((double)l, (double)j1, 0.0D).endVertex(); + worldrenderer.pos((double)p_152437_1_, (double)j1, 0.0D).endVertex(); + worldrenderer.pos((double)p_152437_1_, (double)i1, 0.0D).endVertex(); + worldrenderer.pos((double)l, (double)i1, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + this.mc.fontRendererObj.drawString(s, p_152437_1_ - j, p_152437_2_ + 20, 16777215); + } + + this.render(p_152437_1_, p_152437_2_, this.func_152440_b(), 0); + this.render(p_152437_1_, p_152437_2_, this.func_152438_c(), 17); + } + } + + private void render(int p_152436_1_, int p_152436_2_, int p_152436_3_, int p_152436_4_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.65F + 0.35000002F * this.streamAlpha); + this.mc.getTextureManager().bindTexture(locationStreamIndicator); + float f = 150.0F; + float f1 = 0.0F; + float f2 = (float)p_152436_3_ * 0.015625F; + float f3 = 1.0F; + float f4 = (float)(p_152436_3_ + 16) * 0.015625F; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double)(p_152436_1_ - 16 - p_152436_4_), (double)(p_152436_2_ + 16), (double)f).tex((double)f1, (double)f4).endVertex(); + worldrenderer.pos((double)(p_152436_1_ - p_152436_4_), (double)(p_152436_2_ + 16), (double)f).tex((double)f3, (double)f4).endVertex(); + worldrenderer.pos((double)(p_152436_1_ - p_152436_4_), (double)(p_152436_2_ + 0), (double)f).tex((double)f3, (double)f2).endVertex(); + worldrenderer.pos((double)(p_152436_1_ - 16 - p_152436_4_), (double)(p_152436_2_ + 0), (double)f).tex((double)f1, (double)f2).endVertex(); + tessellator.draw(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + private int func_152440_b() + { + return this.mc.getTwitchStream().isPaused() ? 16 : 0; + } + + private int func_152438_c() + { + return this.mc.getTwitchStream().func_152929_G() ? 48 : 32; + } + + public void updateStreamAlpha() + { + if (this.mc.getTwitchStream().isBroadcasting()) + { + this.streamAlpha += 0.025F * (float)this.streamAlphaDelta; + + if (this.streamAlpha < 0.0F) + { + this.streamAlphaDelta *= -1; + this.streamAlpha = 0.0F; + } + else if (this.streamAlpha > 1.0F) + { + this.streamAlphaDelta *= -1; + this.streamAlpha = 1.0F; + } + } + else + { + this.streamAlpha = 1.0F; + this.streamAlphaDelta = 1; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiTextField.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiTextField.java new file mode 100644 index 0000000..c8f20e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiTextField.java @@ -0,0 +1,692 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.MathHelper; + +public class GuiTextField extends Gui +{ + private final int id; + private final FontRenderer fontRendererInstance; + public int xPosition; + public int yPosition; + private final int width; + private final int height; + private String text = ""; + private int maxStringLength = 32; + private int cursorCounter; + private boolean enableBackgroundDrawing = true; + private boolean canLoseFocus = true; + private boolean isFocused; + private boolean isEnabled = true; + private int lineScrollOffset; + private int cursorPosition; + private int selectionEnd; + private int enabledColor = 14737632; + private int disabledColor = 7368816; + private boolean visible = true; + private GuiPageButtonList.GuiResponder field_175210_x; + private Predicate validator = Predicates.alwaysTrue(); + + public GuiTextField(int componentId, FontRenderer fontrendererObj, int x, int y, int par5Width, int par6Height) + { + this.id = componentId; + this.fontRendererInstance = fontrendererObj; + this.xPosition = x; + this.yPosition = y; + this.width = par5Width; + this.height = par6Height; + } + + public void func_175207_a(GuiPageButtonList.GuiResponder p_175207_1_) + { + this.field_175210_x = p_175207_1_; + } + + public void updateCursorCounter() + { + ++this.cursorCounter; + } + + public void setText(String p_146180_1_) + { + if (this.validator.apply(p_146180_1_)) + { + if (p_146180_1_.length() > this.maxStringLength) + { + this.text = p_146180_1_.substring(0, this.maxStringLength); + } + else + { + this.text = p_146180_1_; + } + + this.setCursorPositionEnd(); + } + } + + public String getText() + { + return this.text; + } + + public String getSelectedText() + { + int i = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int j = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; + return this.text.substring(i, j); + } + + public void setValidator(Predicate theValidator) + { + this.validator = theValidator; + } + + public void writeText(String p_146191_1_) + { + String s = ""; + String s1 = ChatAllowedCharacters.filterAllowedCharacters(p_146191_1_); + int i = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int j = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; + int k = this.maxStringLength - this.text.length() - (i - j); + int l = 0; + + if (this.text.length() > 0) + { + s = s + this.text.substring(0, i); + } + + if (k < s1.length()) + { + s = s + s1.substring(0, k); + l = k; + } + else + { + s = s + s1; + l = s1.length(); + } + + if (this.text.length() > 0 && j < this.text.length()) + { + s = s + this.text.substring(j); + } + + if (this.validator.apply(s)) + { + this.text = s; + this.moveCursorBy(i - this.selectionEnd + l); + + if (this.field_175210_x != null) + { + this.field_175210_x.func_175319_a(this.id, this.text); + } + } + } + + public void deleteWords(int p_146177_1_) + { + if (this.text.length() != 0) + { + if (this.selectionEnd != this.cursorPosition) + { + this.writeText(""); + } + else + { + this.deleteFromCursor(this.getNthWordFromCursor(p_146177_1_) - this.cursorPosition); + } + } + } + + public void deleteFromCursor(int p_146175_1_) + { + if (this.text.length() != 0) + { + if (this.selectionEnd != this.cursorPosition) + { + this.writeText(""); + } + else + { + boolean flag = p_146175_1_ < 0; + int i = flag ? this.cursorPosition + p_146175_1_ : this.cursorPosition; + int j = flag ? this.cursorPosition : this.cursorPosition + p_146175_1_; + String s = ""; + + if (i >= 0) + { + s = this.text.substring(0, i); + } + + if (j < this.text.length()) + { + s = s + this.text.substring(j); + } + + if (this.validator.apply(s)) + { + this.text = s; + + if (flag) + { + this.moveCursorBy(p_146175_1_); + } + + if (this.field_175210_x != null) + { + this.field_175210_x.func_175319_a(this.id, this.text); + } + } + } + } + } + + public int getId() + { + return this.id; + } + + public int getNthWordFromCursor(int p_146187_1_) + { + return this.getNthWordFromPos(p_146187_1_, this.getCursorPosition()); + } + + public int getNthWordFromPos(int p_146183_1_, int p_146183_2_) + { + return this.func_146197_a(p_146183_1_, p_146183_2_, true); + } + + public int func_146197_a(int p_146197_1_, int p_146197_2_, boolean p_146197_3_) + { + int i = p_146197_2_; + boolean flag = p_146197_1_ < 0; + int j = Math.abs(p_146197_1_); + + for (int k = 0; k < j; ++k) + { + if (!flag) + { + int l = this.text.length(); + i = this.text.indexOf(32, i); + + if (i == -1) + { + i = l; + } + else + { + while (p_146197_3_ && i < l && this.text.charAt(i) == 32) + { + ++i; + } + } + } + else + { + while (p_146197_3_ && i > 0 && this.text.charAt(i - 1) == 32) + { + --i; + } + + while (i > 0 && this.text.charAt(i - 1) != 32) + { + --i; + } + } + } + + return i; + } + + public void moveCursorBy(int p_146182_1_) + { + this.setCursorPosition(this.selectionEnd + p_146182_1_); + } + + public void setCursorPosition(int p_146190_1_) + { + this.cursorPosition = p_146190_1_; + int i = this.text.length(); + this.cursorPosition = MathHelper.clamp_int(this.cursorPosition, 0, i); + this.setSelectionPos(this.cursorPosition); + } + + public void setCursorPositionZero() + { + this.setCursorPosition(0); + } + + public void setCursorPositionEnd() + { + this.setCursorPosition(this.text.length()); + } + + public boolean textboxKeyTyped(char p_146201_1_, int p_146201_2_) + { + if (!this.isFocused) + { + return false; + } + else if (GuiScreen.isKeyComboCtrlA(p_146201_2_)) + { + this.setCursorPositionEnd(); + this.setSelectionPos(0); + return true; + } + else if (GuiScreen.isKeyComboCtrlC(p_146201_2_)) + { + GuiScreen.setClipboardString(this.getSelectedText()); + return true; + } + else if (GuiScreen.isKeyComboCtrlV(p_146201_2_)) + { + if (this.isEnabled) + { + this.writeText(GuiScreen.getClipboardString()); + } + + return true; + } + else if (GuiScreen.isKeyComboCtrlX(p_146201_2_)) + { + GuiScreen.setClipboardString(this.getSelectedText()); + + if (this.isEnabled) + { + this.writeText(""); + } + + return true; + } + else + { + switch (p_146201_2_) + { + case 14: + if (GuiScreen.isCtrlKeyDown()) + { + if (this.isEnabled) + { + this.deleteWords(-1); + } + } + else if (this.isEnabled) + { + this.deleteFromCursor(-1); + } + + return true; + + case 199: + if (GuiScreen.isShiftKeyDown()) + { + this.setSelectionPos(0); + } + else + { + this.setCursorPositionZero(); + } + + return true; + + case 203: + if (GuiScreen.isShiftKeyDown()) + { + if (GuiScreen.isCtrlKeyDown()) + { + this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); + } + else + { + this.setSelectionPos(this.getSelectionEnd() - 1); + } + } + else if (GuiScreen.isCtrlKeyDown()) + { + this.setCursorPosition(this.getNthWordFromCursor(-1)); + } + else + { + this.moveCursorBy(-1); + } + + return true; + + case 205: + if (GuiScreen.isShiftKeyDown()) + { + if (GuiScreen.isCtrlKeyDown()) + { + this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); + } + else + { + this.setSelectionPos(this.getSelectionEnd() + 1); + } + } + else if (GuiScreen.isCtrlKeyDown()) + { + this.setCursorPosition(this.getNthWordFromCursor(1)); + } + else + { + this.moveCursorBy(1); + } + + return true; + + case 207: + if (GuiScreen.isShiftKeyDown()) + { + this.setSelectionPos(this.text.length()); + } + else + { + this.setCursorPositionEnd(); + } + + return true; + + case 211: + if (GuiScreen.isCtrlKeyDown()) + { + if (this.isEnabled) + { + this.deleteWords(1); + } + } + else if (this.isEnabled) + { + this.deleteFromCursor(1); + } + + return true; + + default: + if (ChatAllowedCharacters.isAllowedCharacter(p_146201_1_)) + { + if (this.isEnabled) + { + this.writeText(Character.toString(p_146201_1_)); + } + + return true; + } + else + { + return false; + } + } + } + } + + public void mouseClicked(int p_146192_1_, int p_146192_2_, int p_146192_3_) + { + boolean flag = p_146192_1_ >= this.xPosition && p_146192_1_ < this.xPosition + this.width && p_146192_2_ >= this.yPosition && p_146192_2_ < this.yPosition + this.height; + + if (this.canLoseFocus) + { + this.setFocused(flag); + } + + if (this.isFocused && flag && p_146192_3_ == 0) + { + int i = p_146192_1_ - this.xPosition; + + if (this.enableBackgroundDrawing) + { + i -= 4; + } + + String s = this.fontRendererInstance.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + this.setCursorPosition(this.fontRendererInstance.trimStringToWidth(s, i).length() + this.lineScrollOffset); + } + } + + public void drawTextBox() + { + if (this.getVisible()) + { + if (this.getEnableBackgroundDrawing()) + { + drawRect(this.xPosition - 1, this.yPosition - 1, this.xPosition + this.width + 1, this.yPosition + this.height + 1, -6250336); + drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -16777216); + } + + int i = this.isEnabled ? this.enabledColor : this.disabledColor; + int j = this.cursorPosition - this.lineScrollOffset; + int k = this.selectionEnd - this.lineScrollOffset; + String s = this.fontRendererInstance.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + boolean flag = j >= 0 && j <= s.length(); + boolean flag1 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && flag; + int l = this.enableBackgroundDrawing ? this.xPosition + 4 : this.xPosition; + int i1 = this.enableBackgroundDrawing ? this.yPosition + (this.height - 8) / 2 : this.yPosition; + int j1 = l; + + if (k > s.length()) + { + k = s.length(); + } + + if (s.length() > 0) + { + String s1 = flag ? s.substring(0, j) : s; + j1 = this.fontRendererInstance.drawStringWithShadow(s1, (float)l, (float)i1, i); + } + + boolean flag2 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); + int k1 = j1; + + if (!flag) + { + k1 = j > 0 ? l + this.width : l; + } + else if (flag2) + { + k1 = j1 - 1; + --j1; + } + + if (s.length() > 0 && flag && j < s.length()) + { + j1 = this.fontRendererInstance.drawStringWithShadow(s.substring(j), (float)j1, (float)i1, i); + } + + if (flag1) + { + if (flag2) + { + Gui.drawRect(k1, i1 - 1, k1 + 1, i1 + 1 + this.fontRendererInstance.FONT_HEIGHT, -3092272); + } + else + { + this.fontRendererInstance.drawStringWithShadow("_", (float)k1, (float)i1, i); + } + } + + if (k != j) + { + int l1 = l + this.fontRendererInstance.getStringWidth(s.substring(0, k)); + this.drawCursorVertical(k1, i1 - 1, l1 - 1, i1 + 1 + this.fontRendererInstance.FONT_HEIGHT); + } + } + } + + private void drawCursorVertical(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) + { + if (p_146188_1_ < p_146188_3_) + { + int i = p_146188_1_; + p_146188_1_ = p_146188_3_; + p_146188_3_ = i; + } + + if (p_146188_2_ < p_146188_4_) + { + int j = p_146188_2_; + p_146188_2_ = p_146188_4_; + p_146188_4_ = j; + } + + if (p_146188_3_ > this.xPosition + this.width) + { + p_146188_3_ = this.xPosition + this.width; + } + + if (p_146188_1_ > this.xPosition + this.width) + { + p_146188_1_ = this.xPosition + this.width; + } + + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.color(0.0F, 0.0F, 255.0F, 255.0F); + GlStateManager.disableTexture2D(); + GlStateManager.enableColorLogic(); + GlStateManager.colorLogicOp(5387); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos((double)p_146188_1_, (double)p_146188_4_, 0.0D).endVertex(); + worldrenderer.pos((double)p_146188_3_, (double)p_146188_4_, 0.0D).endVertex(); + worldrenderer.pos((double)p_146188_3_, (double)p_146188_2_, 0.0D).endVertex(); + worldrenderer.pos((double)p_146188_1_, (double)p_146188_2_, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.disableColorLogic(); + GlStateManager.enableTexture2D(); + } + + public void setMaxStringLength(int p_146203_1_) + { + this.maxStringLength = p_146203_1_; + + if (this.text.length() > p_146203_1_) + { + this.text = this.text.substring(0, p_146203_1_); + } + } + + public int getMaxStringLength() + { + return this.maxStringLength; + } + + public int getCursorPosition() + { + return this.cursorPosition; + } + + public boolean getEnableBackgroundDrawing() + { + return this.enableBackgroundDrawing; + } + + public void setEnableBackgroundDrawing(boolean p_146185_1_) + { + this.enableBackgroundDrawing = p_146185_1_; + } + + public void setTextColor(int p_146193_1_) + { + this.enabledColor = p_146193_1_; + } + + public void setDisabledTextColour(int p_146204_1_) + { + this.disabledColor = p_146204_1_; + } + + public void setFocused(boolean p_146195_1_) + { + if (p_146195_1_ && !this.isFocused) + { + this.cursorCounter = 0; + } + + this.isFocused = p_146195_1_; + } + + public boolean isFocused() + { + return this.isFocused; + } + + public void setEnabled(boolean p_146184_1_) + { + this.isEnabled = p_146184_1_; + } + + public int getSelectionEnd() + { + return this.selectionEnd; + } + + public int getWidth() + { + return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width; + } + + public void setSelectionPos(int p_146199_1_) + { + int i = this.text.length(); + + if (p_146199_1_ > i) + { + p_146199_1_ = i; + } + + if (p_146199_1_ < 0) + { + p_146199_1_ = 0; + } + + this.selectionEnd = p_146199_1_; + + if (this.fontRendererInstance != null) + { + if (this.lineScrollOffset > i) + { + this.lineScrollOffset = i; + } + + int j = this.getWidth(); + String s = this.fontRendererInstance.trimStringToWidth(this.text.substring(this.lineScrollOffset), j); + int k = s.length() + this.lineScrollOffset; + + if (p_146199_1_ == this.lineScrollOffset) + { + this.lineScrollOffset -= this.fontRendererInstance.trimStringToWidth(this.text, j, true).length(); + } + + if (p_146199_1_ > k) + { + this.lineScrollOffset += p_146199_1_ - k; + } + else if (p_146199_1_ <= this.lineScrollOffset) + { + this.lineScrollOffset -= this.lineScrollOffset - p_146199_1_; + } + + this.lineScrollOffset = MathHelper.clamp_int(this.lineScrollOffset, 0, i); + } + } + + public void setCanLoseFocus(boolean p_146205_1_) + { + this.canLoseFocus = p_146205_1_; + } + + public boolean getVisible() + { + return this.visible; + } + + public void setVisible(boolean p_146189_1_) + { + this.visible = p_146189_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiUtilRenderComponents.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiUtilRenderComponents.java new file mode 100644 index 0000000..237a675 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiUtilRenderComponents.java @@ -0,0 +1,105 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class GuiUtilRenderComponents +{ + public static String func_178909_a(String p_178909_0_, boolean p_178909_1_) + { + return !p_178909_1_ && !Minecraft.getMinecraft().gameSettings.chatColours ? EnumChatFormatting.getTextWithoutFormattingCodes(p_178909_0_) : p_178909_0_; + } + + public static List splitText(IChatComponent p_178908_0_, int p_178908_1_, FontRenderer p_178908_2_, boolean p_178908_3_, boolean p_178908_4_) + { + int i = 0; + IChatComponent ichatcomponent = new ChatComponentText(""); + List list = Lists.newArrayList(); + List list1 = Lists.newArrayList(p_178908_0_); + + for (int j = 0; j < ((List)list1).size(); ++j) + { + IChatComponent ichatcomponent1 = (IChatComponent)list1.get(j); + String s = ichatcomponent1.getUnformattedTextForChat(); + boolean flag = false; + + if (s.contains("\n")) + { + int k = s.indexOf(10); + String s1 = s.substring(k + 1); + s = s.substring(0, k + 1); + ChatComponentText chatcomponenttext = new ChatComponentText(s1); + chatcomponenttext.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + list1.add(j + 1, chatcomponenttext); + flag = true; + } + + String s4 = func_178909_a(ichatcomponent1.getChatStyle().getFormattingCode() + s, p_178908_4_); + String s5 = s4.endsWith("\n") ? s4.substring(0, s4.length() - 1) : s4; + int i1 = p_178908_2_.getStringWidth(s5); + ChatComponentText chatcomponenttext1 = new ChatComponentText(s5); + chatcomponenttext1.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + + if (i + i1 > p_178908_1_) + { + String s2 = p_178908_2_.trimStringToWidth(s4, p_178908_1_ - i, false); + String s3 = s2.length() < s4.length() ? s4.substring(s2.length()) : null; + + if (s3 != null && s3.length() > 0) + { + int l = s2.lastIndexOf(" "); + + if (l >= 0 && p_178908_2_.getStringWidth(s4.substring(0, l)) > 0) + { + s2 = s4.substring(0, l); + + if (p_178908_3_) + { + ++l; + } + + s3 = s4.substring(l); + } + else if (i > 0 && !s4.contains(" ")) + { + s2 = ""; + s3 = s4; + } + + ChatComponentText chatcomponenttext2 = new ChatComponentText(s3); + chatcomponenttext2.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + list1.add(j + 1, chatcomponenttext2); + } + + i1 = p_178908_2_.getStringWidth(s2); + chatcomponenttext1 = new ChatComponentText(s2); + chatcomponenttext1.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + flag = true; + } + + if (i + i1 <= p_178908_1_) + { + i += i1; + ichatcomponent.appendSibling(chatcomponenttext1); + } + else + { + flag = true; + } + + if (flag) + { + list.add(ichatcomponent); + i = 0; + ichatcomponent = new ChatComponentText(""); + } + } + + list.add(ichatcomponent); + return list; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiVideoSettings.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiVideoSettings.java new file mode 100644 index 0000000..b6aed17 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiVideoSettings.java @@ -0,0 +1,235 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.optifine.Lang; +import net.optifine.gui.GuiAnimationSettingsOF; +import net.optifine.gui.GuiDetailSettingsOF; +import net.optifine.gui.GuiOptionButtonOF; +import net.optifine.gui.GuiOptionSliderOF; +import net.optifine.gui.GuiOtherSettingsOF; +import net.optifine.gui.GuiPerformanceSettingsOF; +import net.optifine.gui.GuiQualitySettingsOF; +import net.optifine.gui.GuiScreenOF; +import net.optifine.gui.TooltipManager; +import net.optifine.gui.TooltipProviderOptions; +import net.optifine.shaders.gui.GuiShaders; + +public class GuiVideoSettings extends GuiScreenOF +{ + private GuiScreen parentGuiScreen; + protected String screenTitle = "Video Settings"; + private GameSettings guiGameSettings; + private static GameSettings.Options[] videoOptions = new GameSettings.Options[] {GameSettings.Options.GRAPHICS, GameSettings.Options.RENDER_DISTANCE, GameSettings.Options.AMBIENT_OCCLUSION, GameSettings.Options.FRAMERATE_LIMIT, GameSettings.Options.AO_LEVEL, GameSettings.Options.VIEW_BOBBING, GameSettings.Options.GUI_SCALE, GameSettings.Options.USE_VBO, GameSettings.Options.GAMMA, GameSettings.Options.BLOCK_ALTERNATIVES, GameSettings.Options.DYNAMIC_LIGHTS, GameSettings.Options.DYNAMIC_FOV}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiVideoSettings(GuiScreen parentScreenIn, GameSettings gameSettingsIn) + { + this.parentGuiScreen = parentScreenIn; + this.guiGameSettings = gameSettingsIn; + } + + public void initGui() + { + this.screenTitle = I18n.format("options.videoTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < videoOptions.length; ++i) + { + GameSettings.Options gamesettings$options = videoOptions[i]; + + if (gamesettings$options != null) + { + int j = this.width / 2 - 155 + i % 2 * 160; + int k = this.height / 6 + 21 * (i / 2) - 12; + + if (gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); + } + else + { + this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.guiGameSettings.getKeyBinding(gamesettings$options))); + } + } + } + + int l = this.height / 6 + 21 * (videoOptions.length / 2) - 12; + int i1 = 0; + i1 = this.width / 2 - 155 + 0; + this.buttonList.add(new GuiOptionButton(231, i1, l, Lang.get("of.options.shaders"))); + i1 = this.width / 2 - 155 + 160; + this.buttonList.add(new GuiOptionButton(202, i1, l, Lang.get("of.options.quality"))); + l = l + 21; + i1 = this.width / 2 - 155 + 0; + this.buttonList.add(new GuiOptionButton(201, i1, l, Lang.get("of.options.details"))); + i1 = this.width / 2 - 155 + 160; + this.buttonList.add(new GuiOptionButton(212, i1, l, Lang.get("of.options.performance"))); + l = l + 21; + i1 = this.width / 2 - 155 + 0; + this.buttonList.add(new GuiOptionButton(211, i1, l, Lang.get("of.options.animations"))); + i1 = this.width / 2 - 155 + 160; + this.buttonList.add(new GuiOptionButton(222, i1, l, Lang.get("of.options.other"))); + l = l + 21; + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + this.actionPerformed(button, 1); + } + + protected void actionPerformedRightClick(GuiButton p_actionPerformedRightClick_1_) + { + if (p_actionPerformedRightClick_1_.id == GameSettings.Options.GUI_SCALE.ordinal()) + { + this.actionPerformed(p_actionPerformedRightClick_1_, -1); + } + } + + private void actionPerformed(GuiButton p_actionPerformed_1_, int p_actionPerformed_2_) + { + if (p_actionPerformed_1_.enabled) + { + int i = this.guiGameSettings.guiScale; + + if (p_actionPerformed_1_.id < 200 && p_actionPerformed_1_ instanceof GuiOptionButton) + { + this.guiGameSettings.setOptionValue(((GuiOptionButton)p_actionPerformed_1_).returnEnumOptions(), p_actionPerformed_2_); + p_actionPerformed_1_.displayString = this.guiGameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(p_actionPerformed_1_.id)); + } + + if (p_actionPerformed_1_.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentGuiScreen); + } + + if (this.guiGameSettings.guiScale != i) + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int j = scaledresolution.getScaledWidth(); + int k = scaledresolution.getScaledHeight(); + this.setWorldAndResolution(this.mc, j, k); + } + + if (p_actionPerformed_1_.id == 201) + { + this.mc.gameSettings.saveOptions(); + GuiDetailSettingsOF guidetailsettingsof = new GuiDetailSettingsOF(this, this.guiGameSettings); + this.mc.displayGuiScreen(guidetailsettingsof); + } + + if (p_actionPerformed_1_.id == 202) + { + this.mc.gameSettings.saveOptions(); + GuiQualitySettingsOF guiqualitysettingsof = new GuiQualitySettingsOF(this, this.guiGameSettings); + this.mc.displayGuiScreen(guiqualitysettingsof); + } + + if (p_actionPerformed_1_.id == 211) + { + this.mc.gameSettings.saveOptions(); + GuiAnimationSettingsOF guianimationsettingsof = new GuiAnimationSettingsOF(this, this.guiGameSettings); + this.mc.displayGuiScreen(guianimationsettingsof); + } + + if (p_actionPerformed_1_.id == 212) + { + this.mc.gameSettings.saveOptions(); + GuiPerformanceSettingsOF guiperformancesettingsof = new GuiPerformanceSettingsOF(this, this.guiGameSettings); + this.mc.displayGuiScreen(guiperformancesettingsof); + } + + if (p_actionPerformed_1_.id == 222) + { + this.mc.gameSettings.saveOptions(); + GuiOtherSettingsOF guiothersettingsof = new GuiOtherSettingsOF(this, this.guiGameSettings); + this.mc.displayGuiScreen(guiothersettingsof); + } + + if (p_actionPerformed_1_.id == 231) + { + if (Config.isAntialiasing() || Config.isAntialiasingConfigured()) + { + Config.showGuiMessage(Lang.get("of.message.shaders.aa1"), Lang.get("of.message.shaders.aa2")); + return; + } + + if (Config.isAnisotropicFiltering()) + { + Config.showGuiMessage(Lang.get("of.message.shaders.af1"), Lang.get("of.message.shaders.af2")); + return; + } + + if (Config.isFastRender()) + { + Config.showGuiMessage(Lang.get("of.message.shaders.fr1"), Lang.get("of.message.shaders.fr2")); + return; + } + + if (Config.getGameSettings().anaglyph) + { + Config.showGuiMessage(Lang.get("of.message.shaders.an1"), Lang.get("of.message.shaders.an2")); + return; + } + + this.mc.gameSettings.saveOptions(); + GuiShaders guishaders = new GuiShaders(this, this.guiGameSettings); + this.mc.displayGuiScreen(guishaders); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 15, 16777215); + String s = Config.getVersion(); + String s1 = "HD_U"; + + if (s1.equals("HD")) + { + s = "OptiFine HD M6_pre2"; + } + + if (s1.equals("HD_U")) + { + s = "OptiFine HD M6_pre2 Ultra"; + } + + if (s1.equals("L")) + { + s = "OptiFine M6_pre2 Light"; + } + + this.drawString(this.fontRendererObj, s, 2, this.height - 10, 8421504); + String s2 = "Minecraft 1.8.9"; + int i = this.fontRendererObj.getStringWidth(s2); + this.drawString(this.fontRendererObj, s2, this.width - i - 2, this.height - 10, 8421504); + super.drawScreen(mouseX, mouseY, partialTicks); + this.tooltipManager.drawTooltips(mouseX, mouseY, this.buttonList); + } + + public static int getButtonWidth(GuiButton p_getButtonWidth_0_) + { + return p_getButtonWidth_0_.width; + } + + public static int getButtonHeight(GuiButton p_getButtonHeight_0_) + { + return p_getButtonHeight_0_.height; + } + + public static void drawGradientRect(GuiScreen p_drawGradientRect_0_, int p_drawGradientRect_1_, int p_drawGradientRect_2_, int p_drawGradientRect_3_, int p_drawGradientRect_4_, int p_drawGradientRect_5_, int p_drawGradientRect_6_) + { + p_drawGradientRect_0_.drawGradientRect(p_drawGradientRect_1_, p_drawGradientRect_2_, p_drawGradientRect_3_, p_drawGradientRect_4_, p_drawGradientRect_5_, p_drawGradientRect_6_); + } + + public static String getGuiChatText(GuiChat p_getGuiChatText_0_) + { + return p_getGuiChatText_0_.inputField.getText(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiWinGame.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiWinGame.java new file mode 100644 index 0000000..aa38c82 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiWinGame.java @@ -0,0 +1,228 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.List; +import java.util.Random; +import net.minecraft.client.audio.MusicTicker; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GuiWinGame extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation MINECRAFT_LOGO = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation VIGNETTE_TEXTURE = new ResourceLocation("textures/misc/vignette.png"); + private int field_146581_h; + private List field_146582_i; + private int field_146579_r; + private float field_146578_s = 0.5F; + + public void updateScreen() + { + MusicTicker musicticker = this.mc.getMusicTicker(); + SoundHandler soundhandler = this.mc.getSoundHandler(); + + if (this.field_146581_h == 0) + { + musicticker.func_181557_a(); + musicticker.func_181558_a(MusicTicker.MusicType.CREDITS); + soundhandler.resumeSounds(); + } + + soundhandler.update(); + ++this.field_146581_h; + float f = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + + if ((float)this.field_146581_h > f) + { + this.sendRespawnPacket(); + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (keyCode == 1) + { + this.sendRespawnPacket(); + } + } + + private void sendRespawnPacket() + { + this.mc.thePlayer.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN)); + this.mc.displayGuiScreen((GuiScreen)null); + } + + public boolean doesGuiPauseGame() + { + return true; + } + + public void initGui() + { + if (this.field_146582_i == null) + { + this.field_146582_i = Lists.newArrayList(); + + try + { + String s = ""; + String s1 = "" + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + EnumChatFormatting.GREEN + EnumChatFormatting.AQUA; + int i = 274; + InputStream inputstream = this.mc.getResourceManager().getResource(new ResourceLocation("texts/end.txt")).getInputStream(); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream, Charsets.UTF_8)); + Random random = new Random(8124371L); + + while ((s = bufferedreader.readLine()) != null) + { + String s2; + String s3; + + for (s = s.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); s.contains(s1); s = s2 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, random.nextInt(4) + 3) + s3) + { + int j = s.indexOf(s1); + s2 = s.substring(0, j); + s3 = s.substring(j + s1.length()); + } + + this.field_146582_i.addAll(this.mc.fontRendererObj.listFormattedStringToWidth(s, i)); + this.field_146582_i.add(""); + } + + inputstream.close(); + + for (int k = 0; k < 8; ++k) + { + this.field_146582_i.add(""); + } + + inputstream = this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(); + bufferedreader = new BufferedReader(new InputStreamReader(inputstream, Charsets.UTF_8)); + + while ((s = bufferedreader.readLine()) != null) + { + s = s.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); + s = s.replaceAll("\t", " "); + this.field_146582_i.addAll(this.mc.fontRendererObj.listFormattedStringToWidth(s, i)); + this.field_146582_i.add(""); + } + + inputstream.close(); + this.field_146579_r = this.field_146582_i.size() * 12; + } + catch (Exception exception) + { + logger.error((String)"Couldn\'t load credits", (Throwable)exception); + } + } + } + + private void drawWinGameScreen(int p_146575_1_, int p_146575_2_, float p_146575_3_) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + int i = this.width; + float f = 0.0F - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float f1 = (float)this.height - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float f2 = 0.015625F; + float f3 = ((float)this.field_146581_h + p_146575_3_ - 0.0F) * 0.02F; + float f4 = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + float f5 = (f4 - 20.0F - ((float)this.field_146581_h + p_146575_3_)) * 0.005F; + + if (f5 < f3) + { + f3 = f5; + } + + if (f3 > 1.0F) + { + f3 = 1.0F; + } + + f3 = f3 * f3; + f3 = f3 * 96.0F / 255.0F; + worldrenderer.pos(0.0D, (double)this.height, (double)this.zLevel).tex(0.0D, (double)(f * f2)).color(f3, f3, f3, 1.0F).endVertex(); + worldrenderer.pos((double)i, (double)this.height, (double)this.zLevel).tex((double)((float)i * f2), (double)(f * f2)).color(f3, f3, f3, 1.0F).endVertex(); + worldrenderer.pos((double)i, 0.0D, (double)this.zLevel).tex((double)((float)i * f2), (double)(f1 * f2)).color(f3, f3, f3, 1.0F).endVertex(); + worldrenderer.pos(0.0D, 0.0D, (double)this.zLevel).tex(0.0D, (double)(f1 * f2)).color(f3, f3, f3, 1.0F).endVertex(); + tessellator.draw(); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawWinGameScreen(mouseX, mouseY, partialTicks); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = 274; + int j = this.width / 2 - i / 2; + int k = this.height + 50; + float f = -((float)this.field_146581_h + partialTicks) * this.field_146578_s; + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, f, 0.0F); + this.mc.getTextureManager().bindTexture(MINECRAFT_LOGO); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(j, k, 0, 0, 155, 44); + this.drawTexturedModalRect(j + 155, k, 0, 45, 155, 44); + int l = k + 200; + + for (int i1 = 0; i1 < this.field_146582_i.size(); ++i1) + { + if (i1 == this.field_146582_i.size() - 1) + { + float f1 = (float)l + f - (float)(this.height / 2 - 6); + + if (f1 < 0.0F) + { + GlStateManager.translate(0.0F, -f1, 0.0F); + } + } + + if ((float)l + f + 12.0F + 8.0F > 0.0F && (float)l + f < (float)this.height) + { + String s = (String)this.field_146582_i.get(i1); + + if (s.startsWith("[C]")) + { + this.fontRendererObj.drawStringWithShadow(s.substring(3), (float)(j + (i - this.fontRendererObj.getStringWidth(s.substring(3))) / 2), (float)l, 16777215); + } + else + { + this.fontRendererObj.fontRandom.setSeed((long)i1 * 4238972211L + (long)(this.field_146581_h / 4)); + this.fontRendererObj.drawString(s, j, l, 16777215); + } + } + + l += 12; + } + + GlStateManager.popMatrix(); + this.mc.getTextureManager().bindTexture(VIGNETTE_TEXTURE); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(0, 769); + int j1 = this.width; + int k1 = this.height; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double)k1, (double)this.zLevel).tex(0.0D, 1.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos((double)j1, (double)k1, (double)this.zLevel).tex(1.0D, 1.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos((double)j1, 0.0D, (double)this.zLevel).tex(1.0D, 0.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + worldrenderer.pos(0.0D, 0.0D, (double)this.zLevel).tex(0.0D, 0.0D).color(1.0F, 1.0F, 1.0F, 1.0F).endVertex(); + tessellator.draw(); + GlStateManager.disableBlend(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiYesNo.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiYesNo.java new file mode 100644 index 0000000..1d7ccac --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiYesNo.java @@ -0,0 +1,89 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.minecraft.client.resources.I18n; + +public class GuiYesNo extends GuiScreen +{ + protected GuiYesNoCallback parentScreen; + protected String messageLine1; + private String messageLine2; + private final List field_175298_s = Lists.newArrayList(); + protected String confirmButtonText; + protected String cancelButtonText; + protected int parentButtonClickedId; + private int ticksUntilEnable; + + public GuiYesNo(GuiYesNoCallback p_i1082_1_, String p_i1082_2_, String p_i1082_3_, int p_i1082_4_) + { + this.parentScreen = p_i1082_1_; + this.messageLine1 = p_i1082_2_; + this.messageLine2 = p_i1082_3_; + this.parentButtonClickedId = p_i1082_4_; + this.confirmButtonText = I18n.format("gui.yes", new Object[0]); + this.cancelButtonText = I18n.format("gui.no", new Object[0]); + } + + public GuiYesNo(GuiYesNoCallback p_i1083_1_, String p_i1083_2_, String p_i1083_3_, String p_i1083_4_, String p_i1083_5_, int p_i1083_6_) + { + this.parentScreen = p_i1083_1_; + this.messageLine1 = p_i1083_2_; + this.messageLine2 = p_i1083_3_; + this.confirmButtonText = p_i1083_4_; + this.cancelButtonText = p_i1083_5_; + this.parentButtonClickedId = p_i1083_6_; + } + + public void initGui() + { + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 155, this.height / 6 + 96, this.confirmButtonText)); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.cancelButtonText)); + this.field_175298_s.clear(); + this.field_175298_s.addAll(this.fontRendererObj.listFormattedStringToWidth(this.messageLine2, this.width - 50)); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + this.parentScreen.confirmClicked(button.id == 0, this.parentButtonClickedId); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.messageLine1, this.width / 2, 70, 16777215); + int i = 90; + + for (String s : this.field_175298_s) + { + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, i, 16777215); + i += this.fontRendererObj.FONT_HEIGHT; + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void setButtonDelay(int p_146350_1_) + { + this.ticksUntilEnable = p_146350_1_; + + for (GuiButton guibutton : this.buttonList) + { + guibutton.enabled = false; + } + } + + public void updateScreen() + { + super.updateScreen(); + + if (--this.ticksUntilEnable == 0) + { + for (GuiButton guibutton : this.buttonList) + { + guibutton.enabled = true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java new file mode 100644 index 0000000..edb2f3f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java @@ -0,0 +1,6 @@ +package net.minecraft.client.gui; + +public interface GuiYesNoCallback +{ + void confirmClicked(boolean result, int id); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/IProgressMeter.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/IProgressMeter.java new file mode 100644 index 0000000..632fceb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/IProgressMeter.java @@ -0,0 +1,8 @@ +package net.minecraft.client.gui; + +public interface IProgressMeter +{ + String[] lanSearchStates = new String[] {"oooooo", "Oooooo", "oOoooo", "ooOooo", "oooOoo", "ooooOo", "oooooO"}; + + void doneLoading(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/MapItemRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/MapItemRenderer.java new file mode 100644 index 0000000..1b23f56 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/MapItemRenderer.java @@ -0,0 +1,153 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec4b; +import net.minecraft.world.storage.MapData; + +public class MapItemRenderer +{ + private static final ResourceLocation mapIcons = new ResourceLocation("textures/map/map_icons.png"); + private final TextureManager textureManager; + private final Map loadedMaps = Maps.newHashMap(); + + public MapItemRenderer(TextureManager textureManagerIn) + { + this.textureManager = textureManagerIn; + } + + public void updateMapTexture(MapData mapdataIn) + { + this.getMapRendererInstance(mapdataIn).updateMapTexture(); + } + + public void renderMap(MapData mapdataIn, boolean p_148250_2_) + { + this.getMapRendererInstance(mapdataIn).render(p_148250_2_); + } + + private MapItemRenderer.Instance getMapRendererInstance(MapData mapdataIn) + { + MapItemRenderer.Instance mapitemrenderer$instance = (MapItemRenderer.Instance)this.loadedMaps.get(mapdataIn.mapName); + + if (mapitemrenderer$instance == null) + { + mapitemrenderer$instance = new MapItemRenderer.Instance(mapdataIn); + this.loadedMaps.put(mapdataIn.mapName, mapitemrenderer$instance); + } + + return mapitemrenderer$instance; + } + + public void clearLoadedMaps() + { + for (MapItemRenderer.Instance mapitemrenderer$instance : this.loadedMaps.values()) + { + this.textureManager.deleteTexture(mapitemrenderer$instance.location); + } + + this.loadedMaps.clear(); + } + + class Instance + { + private final MapData mapData; + private final DynamicTexture mapTexture; + private final ResourceLocation location; + private final int[] mapTextureData; + + private Instance(MapData mapdataIn) + { + this.mapData = mapdataIn; + this.mapTexture = new DynamicTexture(128, 128); + this.mapTextureData = this.mapTexture.getTextureData(); + this.location = MapItemRenderer.this.textureManager.getDynamicTextureLocation("map/" + mapdataIn.mapName, this.mapTexture); + + for (int i = 0; i < this.mapTextureData.length; ++i) + { + this.mapTextureData[i] = 0; + } + } + + private void updateMapTexture() + { + for (int i = 0; i < 16384; ++i) + { + int j = this.mapData.colors[i] & 255; + + if (j / 4 == 0) + { + this.mapTextureData[i] = (i + i / 128 & 1) * 8 + 16 << 24; + } + else + { + this.mapTextureData[i] = MapColor.mapColorArray[j / 4].getMapColor(j & 3); + } + } + + this.mapTexture.updateDynamicTexture(); + } + + private void render(boolean noOverlayRendering) + { + int i = 0; + int j = 0; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + float f = 0.0F; + MapItemRenderer.this.textureManager.bindTexture(this.location); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1); + GlStateManager.disableAlpha(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double)((float)(i + 0) + f), (double)((float)(j + 128) - f), -0.009999999776482582D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos((double)((float)(i + 128) - f), (double)((float)(j + 128) - f), -0.009999999776482582D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos((double)((float)(i + 128) - f), (double)((float)(j + 0) + f), -0.009999999776482582D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos((double)((float)(i + 0) + f), (double)((float)(j + 0) + f), -0.009999999776482582D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + MapItemRenderer.this.textureManager.bindTexture(MapItemRenderer.mapIcons); + int k = 0; + + for (Vec4b vec4b : this.mapData.mapDecorations.values()) + { + if (!noOverlayRendering || vec4b.func_176110_a() == 1) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)i + (float)vec4b.func_176112_b() / 2.0F + 64.0F, (float)j + (float)vec4b.func_176113_c() / 2.0F + 64.0F, -0.02F); + GlStateManager.rotate((float)(vec4b.func_176111_d() * 360) / 16.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.scale(4.0F, 4.0F, 3.0F); + GlStateManager.translate(-0.125F, 0.125F, 0.0F); + byte b0 = vec4b.func_176110_a(); + float f1 = (float)(b0 % 4 + 0) / 4.0F; + float f2 = (float)(b0 / 4 + 0) / 4.0F; + float f3 = (float)(b0 % 4 + 1) / 4.0F; + float f4 = (float)(b0 / 4 + 1) / 4.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + float f5 = -0.001F; + worldrenderer.pos(-1.0D, 1.0D, (double)((float)k * -0.001F)).tex((double)f1, (double)f2).endVertex(); + worldrenderer.pos(1.0D, 1.0D, (double)((float)k * -0.001F)).tex((double)f3, (double)f2).endVertex(); + worldrenderer.pos(1.0D, -1.0D, (double)((float)k * -0.001F)).tex((double)f3, (double)f4).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, (double)((float)k * -0.001F)).tex((double)f1, (double)f4).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + ++k; + } + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 0.0F, -0.04F); + GlStateManager.scale(1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/ScaledResolution.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ScaledResolution.java new file mode 100644 index 0000000..8174140 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ScaledResolution.java @@ -0,0 +1,58 @@ +package net.minecraft.client.gui; + +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.util.MathHelper; + +public class ScaledResolution { + private final double scaledWidthD; + private final double scaledHeightD; + private int scaledWidth; + private int scaledHeight; + private int scaleFactor; + + public ScaledResolution(Minecraft p_i46445_1_) { + this.scaledWidth = p_i46445_1_.displayWidth; + this.scaledHeight = p_i46445_1_.displayHeight; + this.scaleFactor = 1; + boolean flag = p_i46445_1_.isUnicode(); + int i = p_i46445_1_.gameSettings.guiScale; + + if (i == 0) { + i = 1000; + } + + while (this.scaleFactor < i && this.scaledWidth / (this.scaleFactor + 1) >= 320 && this.scaledHeight / (this.scaleFactor + 1) >= 240) { + ++this.scaleFactor; + } + + if (flag && this.scaleFactor % 2 != 0 && this.scaleFactor != 1) { + --this.scaleFactor; + } + + this.scaledWidthD = (double) this.scaledWidth / (double) this.scaleFactor; + this.scaledHeightD = (double) this.scaledHeight / (double) this.scaleFactor; + this.scaledWidth = MathHelper.ceiling_double_int(this.scaledWidthD); + this.scaledHeight = MathHelper.ceiling_double_int(this.scaledHeightD); + } + + public int getScaledWidth() { + return this.scaledWidth; + } + + public int getScaledHeight() { + return this.scaledHeight; + } + + public double getScaledWidth_double() { + return this.scaledWidthD; + } + + public double getScaledHeight_double() { + return this.scaledHeightD; + } + + public int getScaleFactor() { + return this.scaleFactor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java new file mode 100644 index 0000000..3e9bcb5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java @@ -0,0 +1,66 @@ +package net.minecraft.client.gui; + +import java.io.IOException; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class ScreenChatOptions extends GuiScreen +{ + private static final GameSettings.Options[] field_146399_a = new GameSettings.Options[] {GameSettings.Options.CHAT_VISIBILITY, GameSettings.Options.CHAT_COLOR, GameSettings.Options.CHAT_LINKS, GameSettings.Options.CHAT_OPACITY, GameSettings.Options.CHAT_LINKS_PROMPT, GameSettings.Options.CHAT_SCALE, GameSettings.Options.CHAT_HEIGHT_FOCUSED, GameSettings.Options.CHAT_HEIGHT_UNFOCUSED, GameSettings.Options.CHAT_WIDTH, GameSettings.Options.REDUCED_DEBUG_INFO}; + private final GuiScreen parentScreen; + private final GameSettings game_settings; + private String field_146401_i; + + public ScreenChatOptions(GuiScreen parentScreenIn, GameSettings gameSettingsIn) + { + this.parentScreen = parentScreenIn; + this.game_settings = gameSettingsIn; + } + + public void initGui() + { + int i = 0; + this.field_146401_i = I18n.format("options.chat.title", new Object[0]); + + for (GameSettings.Options gamesettings$options : field_146399_a) + { + if (gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options)); + } + else + { + this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options, this.game_settings.getKeyBinding(gamesettings$options))); + } + + ++i; + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 120, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id < 100 && button instanceof GuiOptionButton) + { + this.game_settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); + button.displayString = this.game_settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + } + + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentScreen); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146401_i, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryLanDetected.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryLanDetected.java new file mode 100644 index 0000000..d936d4a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryLanDetected.java @@ -0,0 +1,61 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.LanServerDetector; +import net.minecraft.client.resources.I18n; + +public class ServerListEntryLanDetected implements GuiListExtended.IGuiListEntry +{ + private final GuiMultiplayer field_148292_c; + protected final Minecraft mc; + protected final LanServerDetector.LanServer field_148291_b; + private long field_148290_d = 0L; + + protected ServerListEntryLanDetected(GuiMultiplayer p_i45046_1_, LanServerDetector.LanServer p_i45046_2_) + { + this.field_148292_c = p_i45046_1_; + this.field_148291_b = p_i45046_2_; + this.mc = Minecraft.getMinecraft(); + } + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + { + this.mc.fontRendererObj.drawString(I18n.format("lanServer.title", new Object[0]), x + 32 + 3, y + 1, 16777215); + this.mc.fontRendererObj.drawString(this.field_148291_b.getServerMotd(), x + 32 + 3, y + 12, 8421504); + + if (this.mc.gameSettings.hideServerAddress) + { + this.mc.fontRendererObj.drawString(I18n.format("selectServer.hiddenAddress", new Object[0]), x + 32 + 3, y + 12 + 11, 3158064); + } + else + { + this.mc.fontRendererObj.drawString(this.field_148291_b.getServerIpPort(), x + 32 + 3, y + 12 + 11, 3158064); + } + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + this.field_148292_c.selectServer(slotIndex); + + if (Minecraft.getSystemTime() - this.field_148290_d < 250L) + { + this.field_148292_c.connectToSelected(); + } + + this.field_148290_d = Minecraft.getSystemTime(); + return false; + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) + { + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + } + + public LanServerDetector.LanServer getLanServer() + { + return this.field_148291_b; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryLanScan.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryLanScan.java new file mode 100644 index 0000000..30a7c4a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryLanScan.java @@ -0,0 +1,47 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; + +public class ServerListEntryLanScan implements GuiListExtended.IGuiListEntry +{ + private final Minecraft mc = Minecraft.getMinecraft(); + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + { + int i = y + slotHeight / 2 - this.mc.fontRendererObj.FONT_HEIGHT / 2; + this.mc.fontRendererObj.drawString(I18n.format("lanServer.scanning", new Object[0]), this.mc.currentScreen.width / 2 - this.mc.fontRendererObj.getStringWidth(I18n.format("lanServer.scanning", new Object[0])) / 2, i, 16777215); + String s; + + switch ((int)(Minecraft.getSystemTime() / 300L % 4L)) + { + case 0: + default: + s = "O o o"; + break; + + case 1: + case 3: + s = "o O o"; + break; + + case 2: + s = "o o O"; + } + + this.mc.fontRendererObj.drawString(s, this.mc.currentScreen.width / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, i + this.mc.fontRendererObj.FONT_HEIGHT, 8421504); + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) + { + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + return false; + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java new file mode 100644 index 0000000..2da2dd6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java @@ -0,0 +1,305 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.ui.mainmenu.LunarClientLogoElement; +import com.cheatbreaker.client.ui.mainmenu.LunarNetworkLogoElement; +import com.google.common.base.Charsets; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +import java.awt.image.BufferedImage; +import java.net.UnknownHostException; +import java.util.List; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; + +public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry { + private static final Logger logger = LogManager.getLogger(); + private static final ThreadPoolExecutor field_148302_b = new ScheduledThreadPoolExecutor(5, (new ThreadFactoryBuilder()).setNameFormat("Server Pinger #%d").setDaemon(true).build()); + private static final ResourceLocation UNKNOWN_SERVER = new ResourceLocation("textures/misc/unknown_server.png"); + private static final ResourceLocation SERVER_SELECTION_BUTTONS = new ResourceLocation("textures/gui/server_selection.png"); + private final GuiMultiplayer owner; + private final Minecraft mc; + private final ServerData server; + private final ResourceLocation serverIcon; + private String field_148299_g; + private DynamicTexture field_148305_h; + private long field_148298_f; + private LunarNetworkLogoElement lunarNetworkLogo; + private final LunarClientLogoElement lunarClientLogo = new LunarClientLogoElement(); + + protected ServerListEntryNormal(GuiMultiplayer p_i45048_1_, ServerData serverIn) { + this.owner = p_i45048_1_; + this.server = serverIn; + this.mc = Minecraft.getMinecraft(); + this.serverIcon = new ResourceLocation("servers/" + serverIn.serverIP + "/icon"); + this.field_148305_h = (DynamicTexture) this.mc.getTextureManager().getTexture(this.serverIcon); + if (serverIn.serverIP.toLowerCase().endsWith("lunar.gg")) { + this.lunarNetworkLogo = new LunarNetworkLogoElement(); + } + } + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) { + if (!this.server.field_78841_f) { + this.server.field_78841_f = true; + this.server.pingToServer = -2L; + this.server.serverMOTD = ""; + this.server.populationInfo = ""; + field_148302_b.submit(new Runnable() { + public void run() { + try { + ServerListEntryNormal.this.owner.getOldServerPinger().ping(ServerListEntryNormal.this.server); + } catch (UnknownHostException var2) { + ServerListEntryNormal.this.server.pingToServer = -1L; + ServerListEntryNormal.this.server.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t resolve hostname"; + } catch (Exception var3) { + ServerListEntryNormal.this.server.pingToServer = -1L; + ServerListEntryNormal.this.server.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t connect to server."; + } + } + }); + } + + GL11.glColor4f(0.2351064f * 3.6153846f, 1.8619047f * 0.45652175f, 0.22500001f * 3.7777777f, 1.0f); + if (this.server.isCheatBreakerServer()) { + float f = 16; + float f2 = 8; + float f3 = 0.0f; + float f4 = 0.0f; + float f5 = x - 20; + float f6 = y + 14; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("client/icons/cb.png")); + GL11.glBegin(7); + GL11.glTexCoord2d(f3 / (float) 5, f4 / (float) 5); + GL11.glVertex2d(f5, f6); + GL11.glTexCoord2d(f3 / (float) 5, (f4 + (float) 5) / (float) 5); + GL11.glVertex2d(f5, f6 + f2); + GL11.glTexCoord2d((f3 + (float) 5) / (float) 5, (f4 + (float) 5) / (float) 5); + GL11.glVertex2d(f5 + f, f6 + f2); + GL11.glTexCoord2d((f3 + (float) 5) / (float) 5, f4 / (float) 5); + GL11.glVertex2d(f5 + f, f6); + GL11.glEnd(); + GL11.glDisable(3042); + } + if (this.server.lunarServer) { + this.lunarClientLogo.setElementSize(x - 19.5f, y + 10, 15.0f, 13.71f); + this.lunarClientLogo.drawElementHover(0.0f, 0.0f, true); + } + + boolean flag = this.server.version > 47; + boolean flag1 = this.server.version < 47; + boolean flag2 = flag || flag1; + this.mc.fontRendererObj.drawString(this.server.serverName, x + 32 + 3, y + 1, 16777215); + List list = this.mc.fontRendererObj.listFormattedStringToWidth(this.server.serverMOTD, listWidth - 32 - 2); + + for (int i = 0; i < Math.min(list.size(), 2); ++i) { + this.mc.fontRendererObj.drawString((String) list.get(i), x + 32 + 3, y + 12 + this.mc.fontRendererObj.FONT_HEIGHT * i, 8421504); + } + + String s2 = flag2 ? EnumChatFormatting.DARK_RED + this.server.gameVersion : this.server.populationInfo; + int j = this.mc.fontRendererObj.getStringWidth(s2); + this.mc.fontRendererObj.drawString(s2, x + listWidth - j - 15 - 2, y + 1, 8421504); + int k = 0; + String s = null; + int l; + String s1; + + if (flag2) { + l = 5; + s1 = flag ? "Client out of date!" : "Server out of date!"; + s = this.server.playerList; + } else if (this.server.field_78841_f && this.server.pingToServer != -2L) { + if (this.server.pingToServer < 0L) { + l = 5; + } else if (this.server.pingToServer < 150L) { + l = 0; + } else if (this.server.pingToServer < 300L) { + l = 1; + } else if (this.server.pingToServer < 600L) { + l = 2; + } else if (this.server.pingToServer < 1000L) { + l = 3; + } else { + l = 4; + } + + if (this.server.pingToServer < 0L) { + s1 = "(no connection)"; + } else { + s1 = this.server.pingToServer + "ms"; + s = this.server.playerList; + } + } else { + k = 1; + l = (int) (Minecraft.getSystemTime() / 100L + (long) (slotIndex * 2) & 7L); + + if (l > 4) { + l = 8 - l; + } + + s1 = "Pinging..."; + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.icons); + Gui.drawModalRectWithCustomSizedTexture(x + listWidth - 15, y, (float) (k * 10), (float) (176 + l * 8), 10, 8, 256.0F, 256.0F); + + if (this.server.getBase64EncodedIconData() != null && !this.server.getBase64EncodedIconData().equals(this.field_148299_g)) { + this.field_148299_g = this.server.getBase64EncodedIconData(); + this.prepareServerIcon(); + this.owner.getServerList().saveServerList(); + } + + if (this.lunarNetworkLogo != null) { + this.lunarNetworkLogo.setElementSize(x, y, 32.0f, 29.5f); + this.lunarNetworkLogo.drawElementHover(0.0f, 0.0f, true); + } else { + if (this.field_148305_h != null) { + this.drawTextureAt(x, y, this.serverIcon); + } else { + this.drawTextureAt(x, y, UNKNOWN_SERVER); + } + } + + int i1 = mouseX - x; + int j1 = mouseY - y; + + if (i1 >= listWidth - 15 && i1 <= listWidth - 5 && j1 >= 0 && j1 <= 8) { + this.owner.setHoveringText(s1); + } else if (i1 >= listWidth - j - 15 - 2 && i1 <= listWidth - 15 - 2 && j1 >= 0 && j1 <= 8) { + this.owner.setHoveringText(s); + } + + if (this.mc.gameSettings.touchscreen || isSelected) { + this.mc.getTextureManager().bindTexture(SERVER_SELECTION_BUTTONS); + Gui.drawRect(x, y, x + 32, y + 32, -1601138544); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + int k1 = mouseX - x; + int l1 = mouseY - y; + + if (this.func_178013_b()) { + if (k1 < 32 && k1 > 16) { + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.owner.func_175392_a(this, slotIndex)) { + if (k1 < 16 && l1 < 16) { + Gui.drawModalRectWithCustomSizedTexture(x, y, 96.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(x, y, 96.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.owner.func_175394_b(this, slotIndex)) { + if (k1 < 16 && l1 > 16) { + Gui.drawModalRectWithCustomSizedTexture(x, y, 64.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(x, y, 64.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + } + } + + protected void drawTextureAt(int p_178012_1_, int p_178012_2_, ResourceLocation p_178012_3_) { + this.mc.getTextureManager().bindTexture(p_178012_3_); + GlStateManager.enableBlend(); + Gui.drawModalRectWithCustomSizedTexture(p_178012_1_, p_178012_2_, 0.0F, 0.0F, 32, 32, 32.0F, 32.0F); + GlStateManager.disableBlend(); + } + + private boolean func_178013_b() { + return true; + } + + private void prepareServerIcon() { + if (this.server.getBase64EncodedIconData() == null) { + this.mc.getTextureManager().deleteTexture(this.serverIcon); + this.field_148305_h = null; + } else { + ByteBuf bytebuf = Unpooled.copiedBuffer((CharSequence) this.server.getBase64EncodedIconData(), Charsets.UTF_8); + ByteBuf bytebuf1 = Base64.decode(bytebuf); + BufferedImage bufferedimage; + label101: + { + try { + bufferedimage = TextureUtil.readBufferedImage(new ByteBufInputStream(bytebuf1)); + Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]); + Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high", new Object[0]); + break label101; + } catch (Throwable throwable) { + logger.error("Invalid icon for server " + this.server.serverName + " (" + this.server.serverIP + ")", throwable); + this.server.setBase64EncodedIconData((String) null); + } finally { + bytebuf.release(); + bytebuf1.release(); + } + + return; + } + + if (this.field_148305_h == null) { + this.field_148305_h = new DynamicTexture(bufferedimage.getWidth(), bufferedimage.getHeight()); + this.mc.getTextureManager().loadTexture(this.serverIcon, this.field_148305_h); + } + + bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), this.field_148305_h.getTextureData(), 0, bufferedimage.getWidth()); + this.field_148305_h.updateDynamicTexture(); + } + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + if (p_148278_5_ <= 32) { + if (p_148278_5_ < 32 && p_148278_5_ > 16 && this.func_178013_b()) { + this.owner.selectServer(slotIndex); + this.owner.connectToSelected(); + return true; + } + + if (p_148278_5_ < 16 && p_148278_6_ < 16 && this.owner.func_175392_a(this, slotIndex)) { + this.owner.func_175391_a(this, slotIndex, GuiScreen.isShiftKeyDown()); + return true; + } + + if (p_148278_5_ < 16 && p_148278_6_ > 16 && this.owner.func_175394_b(this, slotIndex)) { + this.owner.func_175393_b(this, slotIndex, GuiScreen.isShiftKeyDown()); + return true; + } + } + + this.owner.selectServer(slotIndex); + + if (Minecraft.getSystemTime() - this.field_148298_f < 250L) { + this.owner.connectToSelected(); + } + + this.field_148298_f = Minecraft.getSystemTime(); + return false; + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) { + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) { + } + + public ServerData getServerData() { + return this.server; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerSelectionList.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerSelectionList.java new file mode 100644 index 0000000..eed60bf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/ServerSelectionList.java @@ -0,0 +1,85 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.util.render.serverlist.ServerListEntryPinned; +import com.google.common.collect.Lists; + +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.network.LanServerDetector; + +public class ServerSelectionList extends GuiListExtended { + private final GuiMultiplayer owner; + private final List serverListInternet = Lists.newArrayList(); + private final List serverListLan = Lists.newArrayList(); + private final GuiListExtended.IGuiListEntry lanScanEntry = new ServerListEntryLanScan(); + private int selectedSlotIndex = -1; + + public ServerSelectionList(GuiMultiplayer ownerIn, Minecraft mcIn, int widthIn, int heightIn, int topIn, int bottomIn, int slotHeightIn) { + super(mcIn, widthIn, heightIn, topIn, bottomIn, slotHeightIn); + this.owner = ownerIn; + } + + public GuiListExtended.IGuiListEntry getListEntry(int index) { + if (index < this.serverListInternet.size()) { + return (GuiListExtended.IGuiListEntry) this.serverListInternet.get(index); + } else { + index = index - this.serverListInternet.size(); + + if (index == 0) { + return this.lanScanEntry; + } else { + --index; + return this.serverListLan.get(index); + } + } + } + + protected int getSize() { + return this.serverListInternet.size() + 1 + this.serverListLan.size(); + } + + public void setSelectedSlotIndex(int selectedSlotIndexIn) { + this.selectedSlotIndex = selectedSlotIndexIn; + } + + protected boolean isSelected(int slotIndex) { + return slotIndex == this.selectedSlotIndex; + } + + public int func_148193_k() { + return this.selectedSlotIndex; + } + + public void func_148195_a(ServerList p_148195_1_) { + this.serverListInternet.clear(); + + for (int i = 0; i < p_148195_1_.countServers(); ++i) { + ServerData serverData = p_148195_1_.getServerData(i); + if (serverData.dontSave) { + this.serverListInternet.add(new ServerListEntryPinned(this.owner, serverData)); + } else if (!CheatBreaker.getInstance().getGlobalSettings().getPinnedServers().stream().anyMatch((var1x) -> var1x[1].equalsIgnoreCase(serverData.serverIP))) { + this.serverListInternet.add(new ServerListEntryNormal(this.owner, serverData)); + } + } + } + + public void func_148194_a(List p_148194_1_) { + this.serverListLan.clear(); + + for (LanServerDetector.LanServer lanserverdetector$lanserver : p_148194_1_) { + this.serverListLan.add(new ServerListEntryLanDetected(this.owner, lanserverdetector$lanserver)); + } + } + + protected int getScrollBarX() { + return super.getScrollBarX() + 30; + } + + public int getListWidth() { + return super.getListWidth() + 85; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java new file mode 100644 index 0000000..6754592 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java @@ -0,0 +1,146 @@ +package net.minecraft.client.gui.achievement; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.stats.Achievement; +import net.minecraft.util.ResourceLocation; + +public class GuiAchievement extends Gui +{ + private static final ResourceLocation achievementBg = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + private Minecraft mc; + private int width; + private int height; + private String achievementTitle; + private String achievementDescription; + private Achievement theAchievement; + private long notificationTime; + private RenderItem renderItem; + private boolean permanentNotification; + + public GuiAchievement(Minecraft mc) + { + this.mc = mc; + this.renderItem = mc.getRenderItem(); + } + + public void displayAchievement(Achievement ach) + { + this.achievementTitle = I18n.format("achievement.get", new Object[0]); + this.achievementDescription = ach.getStatName().getUnformattedText(); + this.notificationTime = Minecraft.getSystemTime(); + this.theAchievement = ach; + this.permanentNotification = false; + } + + public void displayUnformattedAchievement(Achievement achievementIn) + { + this.achievementTitle = achievementIn.getStatName().getUnformattedText(); + this.achievementDescription = achievementIn.getDescription(); + this.notificationTime = Minecraft.getSystemTime() + 2500L; + this.theAchievement = achievementIn; + this.permanentNotification = true; + } + + private void updateAchievementWindowScale() + { + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + this.width = this.mc.displayWidth; + this.height = this.mc.displayHeight; + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + this.width = scaledresolution.getScaledWidth(); + this.height = scaledresolution.getScaledHeight(); + GlStateManager.clear(256); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double)this.width, (double)this.height, 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + } + + public void updateAchievementWindow() + { + if (this.theAchievement != null && this.notificationTime != 0L && Minecraft.getMinecraft().thePlayer != null && CheatBreaker.getInstance().getGlobalSettings().achievements.getBooleanValue()) + { + double d0 = (double)(Minecraft.getSystemTime() - this.notificationTime) / 3000.0D; + + if (!this.permanentNotification) + { + if (d0 < 0.0D || d0 > 1.0D) + { + this.notificationTime = 0L; + return; + } + } + else if (d0 > 0.5D) + { + d0 = 0.5D; + } + + this.updateAchievementWindowScale(); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + double d1 = d0 * 2.0D; + + if (d1 > 1.0D) + { + d1 = 2.0D - d1; + } + + d1 = d1 * 4.0D; + d1 = 1.0D - d1; + + if (d1 < 0.0D) + { + d1 = 0.0D; + } + + d1 = d1 * d1; + d1 = d1 * d1; + int i = this.width - 160; + int j = 0 - (int)(d1 * 36.0D); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + this.mc.getTextureManager().bindTexture(achievementBg); + GlStateManager.disableLighting(); + this.drawTexturedModalRect(i, j, 96, 202, 160, 32); + + if (this.permanentNotification) + { + this.mc.fontRendererObj.drawSplitString(this.achievementDescription, i + 30, j + 7, 120, -1); + } + else + { + this.mc.fontRendererObj.drawString(this.achievementTitle, i + 30, j + 7, -256); + this.mc.fontRendererObj.drawString(this.achievementDescription, i + 30, j + 18, -1); + } + + RenderHelper.enableGUIStandardItemLighting(); + GlStateManager.disableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableColorMaterial(); + GlStateManager.enableLighting(); + this.renderItem.renderItemAndEffectIntoGUI(this.theAchievement.theItemStack, i + 8, j + 8); + GlStateManager.disableLighting(); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + } + } + + public void clearAchievements() + { + this.theAchievement = null; + this.notificationTime = 0L; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java new file mode 100644 index 0000000..5ddb458 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java @@ -0,0 +1,548 @@ +package net.minecraft.client.gui.achievement; + +import java.io.IOException; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.IProgressMeter; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; + +public class GuiAchievements extends GuiScreen implements IProgressMeter +{ + private static final int field_146572_y = AchievementList.minDisplayColumn * 24 - 112; + private static final int field_146571_z = AchievementList.minDisplayRow * 24 - 112; + private static final int field_146559_A = AchievementList.maxDisplayColumn * 24 - 77; + private static final int field_146560_B = AchievementList.maxDisplayRow * 24 - 77; + private static final ResourceLocation ACHIEVEMENT_BACKGROUND = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + protected GuiScreen parentScreen; + protected int field_146555_f = 256; + protected int field_146557_g = 202; + protected int field_146563_h; + protected int field_146564_i; + protected float field_146570_r = 1.0F; + protected double field_146569_s; + protected double field_146568_t; + protected double field_146567_u; + protected double field_146566_v; + protected double field_146565_w; + protected double field_146573_x; + private int field_146554_D; + private StatFileWriter statFileWriter; + private boolean loadingAchievements = true; + + public GuiAchievements(GuiScreen parentScreenIn, StatFileWriter statFileWriterIn) + { + this.parentScreen = parentScreenIn; + this.statFileWriter = statFileWriterIn; + int i = 141; + int j = 141; + this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - i / 2 - 12); + this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - j / 2); + } + + public void initGui() + { + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (!this.loadingAchievements) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.parentScreen); + } + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (keyCode == this.mc.gameSettings.keyBindInventory.getKeyCode()) + { + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + if (this.loadingAchievements) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingStats", new Object[0]), this.width / 2, this.height / 2, 16777215); + this.drawCenteredString(this.fontRendererObj, lanSearchStates[(int)(Minecraft.getSystemTime() / 150L % (long)lanSearchStates.length)], this.width / 2, this.height / 2 + this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + } + else + { + if (Mouse.isButtonDown(0)) + { + int i = (this.width - this.field_146555_f) / 2; + int j = (this.height - this.field_146557_g) / 2; + int k = i + 8; + int l = j + 17; + + if ((this.field_146554_D == 0 || this.field_146554_D == 1) && mouseX >= k && mouseX < k + 224 && mouseY >= l && mouseY < l + 155) + { + if (this.field_146554_D == 0) + { + this.field_146554_D = 1; + } + else + { + this.field_146567_u -= (double)((float)(mouseX - this.field_146563_h) * this.field_146570_r); + this.field_146566_v -= (double)((float)(mouseY - this.field_146564_i) * this.field_146570_r); + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + this.field_146563_h = mouseX; + this.field_146564_i = mouseY; + } + } + else + { + this.field_146554_D = 0; + } + + int i1 = Mouse.getDWheel(); + float f3 = this.field_146570_r; + + if (i1 < 0) + { + this.field_146570_r += 0.25F; + } + else if (i1 > 0) + { + this.field_146570_r -= 0.25F; + } + + this.field_146570_r = MathHelper.clamp_float(this.field_146570_r, 1.0F, 2.0F); + + if (this.field_146570_r != f3) + { + float f5 = f3 - this.field_146570_r; + float f4 = f3 * (float)this.field_146555_f; + float f = f3 * (float)this.field_146557_g; + float f1 = this.field_146570_r * (float)this.field_146555_f; + float f2 = this.field_146570_r * (float)this.field_146557_g; + this.field_146567_u -= (double)((f1 - f4) * 0.5F); + this.field_146566_v -= (double)((f2 - f) * 0.5F); + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + if (this.field_146565_w < (double)field_146572_y) + { + this.field_146565_w = (double)field_146572_y; + } + + if (this.field_146573_x < (double)field_146571_z) + { + this.field_146573_x = (double)field_146571_z; + } + + if (this.field_146565_w >= (double)field_146559_A) + { + this.field_146565_w = (double)(field_146559_A - 1); + } + + if (this.field_146573_x >= (double)field_146560_B) + { + this.field_146573_x = (double)(field_146560_B - 1); + } + + this.drawDefaultBackground(); + this.drawAchievementScreen(mouseX, mouseY, partialTicks); + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + this.drawTitle(); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + } + } + + public void doneLoading() + { + if (this.loadingAchievements) + { + this.loadingAchievements = false; + } + } + + public void updateScreen() + { + if (!this.loadingAchievements) + { + this.field_146569_s = this.field_146567_u; + this.field_146568_t = this.field_146566_v; + double d0 = this.field_146565_w - this.field_146567_u; + double d1 = this.field_146573_x - this.field_146566_v; + + if (d0 * d0 + d1 * d1 < 4.0D) + { + this.field_146567_u += d0; + this.field_146566_v += d1; + } + else + { + this.field_146567_u += d0 * 0.85D; + this.field_146566_v += d1 * 0.85D; + } + } + } + + protected void drawTitle() + { + int i = (this.width - this.field_146555_f) / 2; + int j = (this.height - this.field_146557_g) / 2; + this.fontRendererObj.drawString(I18n.format("gui.achievements", new Object[0]), i + 15, j + 5, 4210752); + } + + protected void drawAchievementScreen(int p_146552_1_, int p_146552_2_, float p_146552_3_) + { + int i = MathHelper.floor_double(this.field_146569_s + (this.field_146567_u - this.field_146569_s) * (double)p_146552_3_); + int j = MathHelper.floor_double(this.field_146568_t + (this.field_146566_v - this.field_146568_t) * (double)p_146552_3_); + + if (i < field_146572_y) + { + i = field_146572_y; + } + + if (j < field_146571_z) + { + j = field_146571_z; + } + + if (i >= field_146559_A) + { + i = field_146559_A - 1; + } + + if (j >= field_146560_B) + { + j = field_146560_B - 1; + } + + int k = (this.width - this.field_146555_f) / 2; + int l = (this.height - this.field_146557_g) / 2; + int i1 = k + 16; + int j1 = l + 17; + this.zLevel = 0.0F; + GlStateManager.depthFunc(518); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)i1, (float)j1, -200.0F); + GlStateManager.scale(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 0.0F); + GlStateManager.enableTexture2D(); + GlStateManager.disableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableColorMaterial(); + int k1 = i + 288 >> 4; + int l1 = j + 288 >> 4; + int i2 = (i + 288) % 16; + int j2 = (j + 288) % 16; + int k2 = 4; + int l2 = 8; + int i3 = 10; + int j3 = 22; + int k3 = 37; + Random random = new Random(); + float f = 16.0F / this.field_146570_r; + float f1 = 16.0F / this.field_146570_r; + + for (int l3 = 0; (float)l3 * f - (float)j2 < 155.0F; ++l3) + { + float f2 = 0.6F - (float)(l1 + l3) / 25.0F * 0.3F; + GlStateManager.color(f2, f2, f2, 1.0F); + + for (int i4 = 0; (float)i4 * f1 - (float)i2 < 224.0F; ++i4) + { + random.setSeed((long)(this.mc.getSession().getPlayerID().hashCode() + k1 + i4 + (l1 + l3) * 16)); + int j4 = random.nextInt(1 + l1 + l3) + (l1 + l3) / 2; + TextureAtlasSprite textureatlassprite = this.func_175371_a(Blocks.sand); + + if (j4 <= 37 && l1 + l3 != 35) + { + if (j4 == 22) + { + if (random.nextInt(2) == 0) + { + textureatlassprite = this.func_175371_a(Blocks.diamond_ore); + } + else + { + textureatlassprite = this.func_175371_a(Blocks.redstone_ore); + } + } + else if (j4 == 10) + { + textureatlassprite = this.func_175371_a(Blocks.iron_ore); + } + else if (j4 == 8) + { + textureatlassprite = this.func_175371_a(Blocks.coal_ore); + } + else if (j4 > 4) + { + textureatlassprite = this.func_175371_a(Blocks.stone); + } + else if (j4 > 0) + { + textureatlassprite = this.func_175371_a(Blocks.dirt); + } + } + else + { + Block block = Blocks.bedrock; + textureatlassprite = this.func_175371_a(block); + } + + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + this.drawTexturedModalRect(i4 * 16 - i2, l3 * 16 - j2, textureatlassprite, 16, 16); + } + } + + GlStateManager.enableDepth(); + GlStateManager.depthFunc(515); + this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BACKGROUND); + + for (int j5 = 0; j5 < AchievementList.achievementList.size(); ++j5) + { + Achievement achievement1 = (Achievement)AchievementList.achievementList.get(j5); + + if (achievement1.parentAchievement != null) + { + int k5 = achievement1.displayColumn * 24 - i + 11; + int l5 = achievement1.displayRow * 24 - j + 11; + int j6 = achievement1.parentAchievement.displayColumn * 24 - i + 11; + int k6 = achievement1.parentAchievement.displayRow * 24 - j + 11; + boolean flag = this.statFileWriter.hasAchievementUnlocked(achievement1); + boolean flag1 = this.statFileWriter.canUnlockAchievement(achievement1); + int k4 = this.statFileWriter.func_150874_c(achievement1); + + if (k4 <= 4) + { + int l4 = -16777216; + + if (flag) + { + l4 = -6250336; + } + else if (flag1) + { + l4 = -16711936; + } + + this.drawHorizontalLine(k5, j6, l5, l4); + this.drawVerticalLine(j6, l5, k6, l4); + + if (k5 > j6) + { + this.drawTexturedModalRect(k5 - 11 - 7, l5 - 5, 114, 234, 7, 11); + } + else if (k5 < j6) + { + this.drawTexturedModalRect(k5 + 11, l5 - 5, 107, 234, 7, 11); + } + else if (l5 > k6) + { + this.drawTexturedModalRect(k5 - 5, l5 - 11 - 7, 96, 234, 11, 7); + } + else if (l5 < k6) + { + this.drawTexturedModalRect(k5 - 5, l5 + 11, 96, 241, 11, 7); + } + } + } + } + + Achievement achievement = null; + float f3 = (float)(p_146552_1_ - i1) * this.field_146570_r; + float f4 = (float)(p_146552_2_ - j1) * this.field_146570_r; + RenderHelper.enableGUIStandardItemLighting(); + GlStateManager.disableLighting(); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableColorMaterial(); + + for (int i6 = 0; i6 < AchievementList.achievementList.size(); ++i6) + { + Achievement achievement2 = (Achievement)AchievementList.achievementList.get(i6); + int l6 = achievement2.displayColumn * 24 - i; + int j7 = achievement2.displayRow * 24 - j; + + if (l6 >= -24 && j7 >= -24 && (float)l6 <= 224.0F * this.field_146570_r && (float)j7 <= 155.0F * this.field_146570_r) + { + int l7 = this.statFileWriter.func_150874_c(achievement2); + + if (this.statFileWriter.hasAchievementUnlocked(achievement2)) + { + float f5 = 0.75F; + GlStateManager.color(f5, f5, f5, 1.0F); + } + else if (this.statFileWriter.canUnlockAchievement(achievement2)) + { + float f6 = 1.0F; + GlStateManager.color(f6, f6, f6, 1.0F); + } + else if (l7 < 3) + { + float f7 = 0.3F; + GlStateManager.color(f7, f7, f7, 1.0F); + } + else if (l7 == 3) + { + float f8 = 0.2F; + GlStateManager.color(f8, f8, f8, 1.0F); + } + else + { + if (l7 != 4) + { + continue; + } + + float f9 = 0.1F; + GlStateManager.color(f9, f9, f9, 1.0F); + } + + this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BACKGROUND); + + if (achievement2.getSpecial()) + { + this.drawTexturedModalRect(l6 - 2, j7 - 2, 26, 202, 26, 26); + } + else + { + this.drawTexturedModalRect(l6 - 2, j7 - 2, 0, 202, 26, 26); + } + + if (!this.statFileWriter.canUnlockAchievement(achievement2)) + { + float f10 = 0.1F; + GlStateManager.color(f10, f10, f10, 1.0F); + this.itemRender.isNotRenderingEffectsInGUI(false); + } + + GlStateManager.enableLighting(); + GlStateManager.enableCull(); + this.itemRender.renderItemAndEffectIntoGUI(achievement2.theItemStack, l6 + 3, j7 + 3); + GlStateManager.blendFunc(770, 771); + GlStateManager.disableLighting(); + + if (!this.statFileWriter.canUnlockAchievement(achievement2)) + { + this.itemRender.isNotRenderingEffectsInGUI(true); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (f3 >= (float)l6 && f3 <= (float)(l6 + 22) && f4 >= (float)j7 && f4 <= (float)(j7 + 22)) + { + achievement = achievement2; + } + } + } + + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BACKGROUND); + this.drawTexturedModalRect(k, l, 0, 0, this.field_146555_f, this.field_146557_g); + this.zLevel = 0.0F; + GlStateManager.depthFunc(515); + GlStateManager.disableDepth(); + GlStateManager.enableTexture2D(); + super.drawScreen(p_146552_1_, p_146552_2_, p_146552_3_); + + if (achievement != null) + { + String s = achievement.getStatName().getUnformattedText(); + String s1 = achievement.getDescription(); + int i7 = p_146552_1_ + 12; + int k7 = p_146552_2_ - 4; + int i8 = this.statFileWriter.func_150874_c(achievement); + + if (this.statFileWriter.canUnlockAchievement(achievement)) + { + int j8 = Math.max(this.fontRendererObj.getStringWidth(s), 120); + int i9 = this.fontRendererObj.splitStringWidth(s1, j8); + + if (this.statFileWriter.hasAchievementUnlocked(achievement)) + { + i9 += 12; + } + + this.drawGradientRect(i7 - 3, k7 - 3, i7 + j8 + 3, k7 + i9 + 3 + 12, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s1, i7, k7 + 12, j8, -6250336); + + if (this.statFileWriter.hasAchievementUnlocked(achievement)) + { + this.fontRendererObj.drawStringWithShadow(I18n.format("achievement.taken", new Object[0]), (float)i7, (float)(k7 + i9 + 4), -7302913); + } + } + else if (i8 == 3) + { + s = I18n.format("achievement.unknown", new Object[0]); + int k8 = Math.max(this.fontRendererObj.getStringWidth(s), 120); + String s2 = (new ChatComponentTranslation("achievement.requires", new Object[] {achievement.parentAchievement.getStatName()})).getUnformattedText(); + int i5 = this.fontRendererObj.splitStringWidth(s2, k8); + this.drawGradientRect(i7 - 3, k7 - 3, i7 + k8 + 3, k7 + i5 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s2, i7, k7 + 12, k8, -9416624); + } + else if (i8 < 3) + { + int l8 = Math.max(this.fontRendererObj.getStringWidth(s), 120); + String s3 = (new ChatComponentTranslation("achievement.requires", new Object[] {achievement.parentAchievement.getStatName()})).getUnformattedText(); + int j9 = this.fontRendererObj.splitStringWidth(s3, l8); + this.drawGradientRect(i7 - 3, k7 - 3, i7 + l8 + 3, k7 + j9 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s3, i7, k7 + 12, l8, -9416624); + } + else + { + s = null; + } + + if (s != null) + { + this.fontRendererObj.drawStringWithShadow(s, (float)i7, (float)k7, this.statFileWriter.canUnlockAchievement(achievement) ? (achievement.getSpecial() ? -128 : -1) : (achievement.getSpecial() ? -8355776 : -8355712)); + } + } + + GlStateManager.enableDepth(); + GlStateManager.enableLighting(); + RenderHelper.disableStandardItemLighting(); + } + + private TextureAtlasSprite func_175371_a(Block p_175371_1_) + { + return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(p_175371_1_.getDefaultState()); + } + + public boolean doesGuiPauseGame() + { + return !this.loadingAchievements; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java new file mode 100644 index 0000000..bea16ad --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java @@ -0,0 +1,800 @@ +package net.minecraft.client.gui.achievement; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.gui.IProgressMeter; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityList; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatCrafting; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.stats.StatList; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; + +public class GuiStats extends GuiScreen implements IProgressMeter +{ + protected GuiScreen parentScreen; + protected String screenTitle = "Select world"; + private GuiStats.StatsGeneral generalStats; + private GuiStats.StatsItem itemStats; + private GuiStats.StatsBlock blockStats; + private GuiStats.StatsMobsList mobStats; + private StatFileWriter field_146546_t; + private GuiSlot displaySlot; + private boolean doesGuiPauseGame = true; + + public GuiStats(GuiScreen p_i1071_1_, StatFileWriter p_i1071_2_) + { + this.parentScreen = p_i1071_1_; + this.field_146546_t = p_i1071_2_; + } + + public void initGui() + { + this.screenTitle = I18n.format("gui.stats", new Object[0]); + this.doesGuiPauseGame = true; + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + + if (this.displaySlot != null) + { + this.displaySlot.handleMouseInput(); + } + } + + public void func_175366_f() + { + this.generalStats = new GuiStats.StatsGeneral(this.mc); + this.generalStats.registerScrollButtons(1, 1); + this.itemStats = new GuiStats.StatsItem(this.mc); + this.itemStats.registerScrollButtons(1, 1); + this.blockStats = new GuiStats.StatsBlock(this.mc); + this.blockStats.registerScrollButtons(1, 1); + this.mobStats = new GuiStats.StatsMobsList(this.mc); + this.mobStats.registerScrollButtons(1, 1); + } + + public void createButtons() + { + this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 160, this.height - 52, 80, 20, I18n.format("stat.generalButton", new Object[0]))); + GuiButton guibutton; + this.buttonList.add(guibutton = new GuiButton(2, this.width / 2 - 80, this.height - 52, 80, 20, I18n.format("stat.blocksButton", new Object[0]))); + GuiButton guibutton1; + this.buttonList.add(guibutton1 = new GuiButton(3, this.width / 2, this.height - 52, 80, 20, I18n.format("stat.itemsButton", new Object[0]))); + GuiButton guibutton2; + this.buttonList.add(guibutton2 = new GuiButton(4, this.width / 2 + 80, this.height - 52, 80, 20, I18n.format("stat.mobsButton", new Object[0]))); + + if (this.blockStats.getSize() == 0) + { + guibutton.enabled = false; + } + + if (this.itemStats.getSize() == 0) + { + guibutton1.enabled = false; + } + + if (this.mobStats.getSize() == 0) + { + guibutton2.enabled = false; + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 0) + { + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 1) + { + this.displaySlot = this.generalStats; + } + else if (button.id == 3) + { + this.displaySlot = this.itemStats; + } + else if (button.id == 2) + { + this.displaySlot = this.blockStats; + } + else if (button.id == 4) + { + this.displaySlot = this.mobStats; + } + else + { + this.displaySlot.actionPerformed(button); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + if (this.doesGuiPauseGame) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingStats", new Object[0]), this.width / 2, this.height / 2, 16777215); + this.drawCenteredString(this.fontRendererObj, lanSearchStates[(int)(Minecraft.getSystemTime() / 150L % (long)lanSearchStates.length)], this.width / 2, this.height / 2 + this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + } + else + { + this.displaySlot.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + } + + public void doneLoading() + { + if (this.doesGuiPauseGame) + { + this.func_175366_f(); + this.createButtons(); + this.displaySlot = this.generalStats; + this.doesGuiPauseGame = false; + } + } + + public boolean doesGuiPauseGame() + { + return !this.doesGuiPauseGame; + } + + private void drawStatsScreen(int p_146521_1_, int p_146521_2_, Item p_146521_3_) + { + this.drawButtonBackground(p_146521_1_ + 1, p_146521_2_ + 1); + GlStateManager.enableRescaleNormal(); + RenderHelper.enableGUIStandardItemLighting(); + this.itemRender.renderItemIntoGUI(new ItemStack(p_146521_3_, 1, 0), p_146521_1_ + 2, p_146521_2_ + 2); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + } + + private void drawButtonBackground(int p_146531_1_, int p_146531_2_) + { + this.drawSprite(p_146531_1_, p_146531_2_, 0, 0); + } + + private void drawSprite(int p_146527_1_, int p_146527_2_, int p_146527_3_, int p_146527_4_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + int i = 18; + int j = 18; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex(); + worldrenderer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex(); + tessellator.draw(); + } + + abstract class Stats extends GuiSlot + { + protected int field_148218_l = -1; + protected List statsHolder; + protected Comparator statSorter; + protected int field_148217_o = -1; + protected int field_148215_p; + + protected Stats(Minecraft mcIn) + { + super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, 20); + this.setShowSelectionBox(false); + this.setHasListHeader(true, 20); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + } + + protected boolean isSelected(int slotIndex) + { + return false; + } + + protected void drawBackground() + { + GuiStats.this.drawDefaultBackground(); + } + + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + if (!Mouse.isButtonDown(0)) + { + this.field_148218_l = -1; + } + + if (this.field_148218_l == 0) + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 0, 0); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148218_l == 1) + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 0, 0); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148218_l == 2) + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 0, 0); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148217_o != -1) + { + int i = 79; + int j = 18; + + if (this.field_148217_o == 1) + { + i = 129; + } + else if (this.field_148217_o == 2) + { + i = 179; + } + + if (this.field_148215_p == 1) + { + j = 36; + } + + GuiStats.this.drawSprite(p_148129_1_ + i, p_148129_2_ + 1, j, 0); + } + } + + protected void func_148132_a(int p_148132_1_, int p_148132_2_) + { + this.field_148218_l = -1; + + if (p_148132_1_ >= 79 && p_148132_1_ < 115) + { + this.field_148218_l = 0; + } + else if (p_148132_1_ >= 129 && p_148132_1_ < 165) + { + this.field_148218_l = 1; + } + else if (p_148132_1_ >= 179 && p_148132_1_ < 215) + { + this.field_148218_l = 2; + } + + if (this.field_148218_l >= 0) + { + this.func_148212_h(this.field_148218_l); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + } + } + + protected final int getSize() + { + return this.statsHolder.size(); + } + + protected final StatCrafting func_148211_c(int p_148211_1_) + { + return (StatCrafting)this.statsHolder.get(p_148211_1_); + } + + protected abstract String func_148210_b(int p_148210_1_); + + protected void func_148209_a(StatBase p_148209_1_, int p_148209_2_, int p_148209_3_, boolean p_148209_4_) + { + if (p_148209_1_ != null) + { + String s = p_148209_1_.format(GuiStats.this.field_146546_t.readStat(p_148209_1_)); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_148209_2_ - GuiStats.this.fontRendererObj.getStringWidth(s), p_148209_3_ + 5, p_148209_4_ ? 16777215 : 9474192); + } + else + { + String s1 = "-"; + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s1, p_148209_2_ - GuiStats.this.fontRendererObj.getStringWidth(s1), p_148209_3_ + 5, p_148209_4_ ? 16777215 : 9474192); + } + } + + protected void func_148142_b(int p_148142_1_, int p_148142_2_) + { + if (p_148142_2_ >= this.top && p_148142_2_ <= this.bottom) + { + int i = this.getSlotIndexFromScreenCoords(p_148142_1_, p_148142_2_); + int j = this.width / 2 - 92 - 16; + + if (i >= 0) + { + if (p_148142_1_ < j + 40 || p_148142_1_ > j + 40 + 20) + { + return; + } + + StatCrafting statcrafting = this.func_148211_c(i); + this.func_148213_a(statcrafting, p_148142_1_, p_148142_2_); + } + else + { + String s = ""; + + if (p_148142_1_ >= j + 115 - 18 && p_148142_1_ <= j + 115) + { + s = this.func_148210_b(0); + } + else if (p_148142_1_ >= j + 165 - 18 && p_148142_1_ <= j + 165) + { + s = this.func_148210_b(1); + } + else + { + if (p_148142_1_ < j + 215 - 18 || p_148142_1_ > j + 215) + { + return; + } + + s = this.func_148210_b(2); + } + + s = ("" + I18n.format(s, new Object[0])).trim(); + + if (s.length() > 0) + { + int k = p_148142_1_ + 12; + int l = p_148142_2_ - 12; + int i1 = GuiStats.this.fontRendererObj.getStringWidth(s); + GuiStats.this.drawGradientRect(k - 3, l - 3, k + i1 + 3, l + 8 + 3, -1073741824, -1073741824); + GuiStats.this.fontRendererObj.drawStringWithShadow(s, (float)k, (float)l, -1); + } + } + } + } + + protected void func_148213_a(StatCrafting p_148213_1_, int p_148213_2_, int p_148213_3_) + { + if (p_148213_1_ != null) + { + Item item = p_148213_1_.func_150959_a(); + ItemStack itemstack = new ItemStack(item); + String s = itemstack.getUnlocalizedName(); + String s1 = ("" + I18n.format(s + ".name", new Object[0])).trim(); + + if (s1.length() > 0) + { + int i = p_148213_2_ + 12; + int j = p_148213_3_ - 12; + int k = GuiStats.this.fontRendererObj.getStringWidth(s1); + GuiStats.this.drawGradientRect(i - 3, j - 3, i + k + 3, j + 8 + 3, -1073741824, -1073741824); + GuiStats.this.fontRendererObj.drawStringWithShadow(s1, (float)i, (float)j, -1); + } + } + } + + protected void func_148212_h(int p_148212_1_) + { + if (p_148212_1_ != this.field_148217_o) + { + this.field_148217_o = p_148212_1_; + this.field_148215_p = -1; + } + else if (this.field_148215_p == -1) + { + this.field_148215_p = 1; + } + else + { + this.field_148217_o = -1; + this.field_148215_p = 0; + } + + Collections.sort(this.statsHolder, this.statSorter); + } + } + + class StatsBlock extends GuiStats.Stats + { + public StatsBlock(Minecraft mcIn) + { + super(mcIn); + this.statsHolder = Lists.newArrayList(); + + for (StatCrafting statcrafting : StatList.objectMineStats) + { + boolean flag = false; + int i = Item.getIdFromItem(statcrafting.func_150959_a()); + + if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) + { + flag = true; + } + else if (StatList.objectUseStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[i]) > 0) + { + flag = true; + } + else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[i]) > 0) + { + flag = true; + } + + if (flag) + { + this.statsHolder.add(statcrafting); + } + } + + this.statSorter = new Comparator() + { + public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) + { + int j = Item.getIdFromItem(p_compare_1_.func_150959_a()); + int k = Item.getIdFromItem(p_compare_2_.func_150959_a()); + StatBase statbase = null; + StatBase statbase1 = null; + + if (StatsBlock.this.field_148217_o == 2) + { + statbase = StatList.mineBlockStatArray[j]; + statbase1 = StatList.mineBlockStatArray[k]; + } + else if (StatsBlock.this.field_148217_o == 0) + { + statbase = StatList.objectCraftStats[j]; + statbase1 = StatList.objectCraftStats[k]; + } + else if (StatsBlock.this.field_148217_o == 1) + { + statbase = StatList.objectUseStats[j]; + statbase1 = StatList.objectUseStats[k]; + } + + if (statbase != null || statbase1 != null) + { + if (statbase == null) + { + return 1; + } + + if (statbase1 == null) + { + return -1; + } + + int l = GuiStats.this.field_146546_t.readStat(statbase); + int i1 = GuiStats.this.field_146546_t.readStat(statbase1); + + if (l != i1) + { + return (l - i1) * StatsBlock.this.field_148215_p; + } + } + + return j - k; + } + }; + } + + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + super.drawListHeader(p_148129_1_, p_148129_2_, p_148129_3_); + + if (this.field_148218_l == 0) + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18 + 1, p_148129_2_ + 1 + 1, 18, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 18, 18); + } + + if (this.field_148218_l == 1) + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18 + 1, p_148129_2_ + 1 + 1, 36, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 36, 18); + } + + if (this.field_148218_l == 2) + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18 + 1, p_148129_2_ + 1 + 1, 54, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 54, 18); + } + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + StatCrafting statcrafting = this.func_148211_c(entryID); + Item item = statcrafting.func_150959_a(); + GuiStats.this.drawStatsScreen(p_180791_2_ + 40, p_180791_3_, item); + int i = Item.getIdFromItem(item); + this.func_148209_a(StatList.objectCraftStats[i], p_180791_2_ + 115, p_180791_3_, entryID % 2 == 0); + this.func_148209_a(StatList.objectUseStats[i], p_180791_2_ + 165, p_180791_3_, entryID % 2 == 0); + this.func_148209_a(statcrafting, p_180791_2_ + 215, p_180791_3_, entryID % 2 == 0); + } + + protected String func_148210_b(int p_148210_1_) + { + return p_148210_1_ == 0 ? "stat.crafted" : (p_148210_1_ == 1 ? "stat.used" : "stat.mined"); + } + } + + class StatsGeneral extends GuiSlot + { + public StatsGeneral(Minecraft mcIn) + { + super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, 10); + this.setShowSelectionBox(false); + } + + protected int getSize() + { + return StatList.generalStats.size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + } + + protected boolean isSelected(int slotIndex) + { + return false; + } + + protected int getContentHeight() + { + return this.getSize() * 10; + } + + protected void drawBackground() + { + GuiStats.this.drawDefaultBackground(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + StatBase statbase = (StatBase)StatList.generalStats.get(entryID); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, statbase.getStatName().getUnformattedText(), p_180791_2_ + 2, p_180791_3_ + 1, entryID % 2 == 0 ? 16777215 : 9474192); + String s = statbase.format(GuiStats.this.field_146546_t.readStat(statbase)); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_180791_2_ + 2 + 213 - GuiStats.this.fontRendererObj.getStringWidth(s), p_180791_3_ + 1, entryID % 2 == 0 ? 16777215 : 9474192); + } + } + + class StatsItem extends GuiStats.Stats + { + public StatsItem(Minecraft mcIn) + { + super(mcIn); + this.statsHolder = Lists.newArrayList(); + + for (StatCrafting statcrafting : StatList.itemStats) + { + boolean flag = false; + int i = Item.getIdFromItem(statcrafting.func_150959_a()); + + if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) + { + flag = true; + } + else if (StatList.objectBreakStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectBreakStats[i]) > 0) + { + flag = true; + } + else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[i]) > 0) + { + flag = true; + } + + if (flag) + { + this.statsHolder.add(statcrafting); + } + } + + this.statSorter = new Comparator() + { + public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) + { + int j = Item.getIdFromItem(p_compare_1_.func_150959_a()); + int k = Item.getIdFromItem(p_compare_2_.func_150959_a()); + StatBase statbase = null; + StatBase statbase1 = null; + + if (StatsItem.this.field_148217_o == 0) + { + statbase = StatList.objectBreakStats[j]; + statbase1 = StatList.objectBreakStats[k]; + } + else if (StatsItem.this.field_148217_o == 1) + { + statbase = StatList.objectCraftStats[j]; + statbase1 = StatList.objectCraftStats[k]; + } + else if (StatsItem.this.field_148217_o == 2) + { + statbase = StatList.objectUseStats[j]; + statbase1 = StatList.objectUseStats[k]; + } + + if (statbase != null || statbase1 != null) + { + if (statbase == null) + { + return 1; + } + + if (statbase1 == null) + { + return -1; + } + + int l = GuiStats.this.field_146546_t.readStat(statbase); + int i1 = GuiStats.this.field_146546_t.readStat(statbase1); + + if (l != i1) + { + return (l - i1) * StatsItem.this.field_148215_p; + } + } + + return j - k; + } + }; + } + + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + super.drawListHeader(p_148129_1_, p_148129_2_, p_148129_3_); + + if (this.field_148218_l == 0) + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18 + 1, p_148129_2_ + 1 + 1, 72, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 72, 18); + } + + if (this.field_148218_l == 1) + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18 + 1, p_148129_2_ + 1 + 1, 18, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 18, 18); + } + + if (this.field_148218_l == 2) + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18 + 1, p_148129_2_ + 1 + 1, 36, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 36, 18); + } + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + StatCrafting statcrafting = this.func_148211_c(entryID); + Item item = statcrafting.func_150959_a(); + GuiStats.this.drawStatsScreen(p_180791_2_ + 40, p_180791_3_, item); + int i = Item.getIdFromItem(item); + this.func_148209_a(StatList.objectBreakStats[i], p_180791_2_ + 115, p_180791_3_, entryID % 2 == 0); + this.func_148209_a(StatList.objectCraftStats[i], p_180791_2_ + 165, p_180791_3_, entryID % 2 == 0); + this.func_148209_a(statcrafting, p_180791_2_ + 215, p_180791_3_, entryID % 2 == 0); + } + + protected String func_148210_b(int p_148210_1_) + { + return p_148210_1_ == 1 ? "stat.crafted" : (p_148210_1_ == 2 ? "stat.used" : "stat.depleted"); + } + } + + class StatsMobsList extends GuiSlot + { + private final List field_148222_l = Lists.newArrayList(); + + public StatsMobsList(Minecraft mcIn) + { + super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4); + this.setShowSelectionBox(false); + + for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values()) + { + if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0) + { + this.field_148222_l.add(entitylist$entityegginfo); + } + } + } + + protected int getSize() + { + return this.field_148222_l.size(); + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + } + + protected boolean isSelected(int slotIndex) + { + return false; + } + + protected int getContentHeight() + { + return this.getSize() * GuiStats.this.fontRendererObj.FONT_HEIGHT * 4; + } + + protected void drawBackground() + { + GuiStats.this.drawDefaultBackground(); + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID); + String s = I18n.format("entity." + EntityList.getStringFromID(entitylist$entityegginfo.spawnedID) + ".name", new Object[0]); + int i = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d); + int j = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e); + String s1 = I18n.format("stat.entityKills", new Object[] {Integer.valueOf(i), s}); + String s2 = I18n.format("stat.entityKilledBy", new Object[] {s, Integer.valueOf(j)}); + + if (i == 0) + { + s1 = I18n.format("stat.entityKills.none", new Object[] {s}); + } + + if (j == 0) + { + s2 = I18n.format("stat.entityKilledBy.none", new Object[] {s}); + } + + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_180791_2_ + 2 - 10, p_180791_3_ + 1, 16777215); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s1, p_180791_2_ + 2, p_180791_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT, i == 0 ? 6316128 : 9474192); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s2, p_180791_2_ + 2, p_180791_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT * 2, j == 0 ? 6316128 : 9474192); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java new file mode 100644 index 0000000..9927fb5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java @@ -0,0 +1,35 @@ +package net.minecraft.client.gui.inventory; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +public class CreativeCrafting implements ICrafting +{ + private final Minecraft mc; + + public CreativeCrafting(Minecraft mc) + { + this.mc = mc; + } + + public void updateCraftingInventory(Container containerToSend, List itemsList) + { + } + + public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack) + { + this.mc.playerController.sendSlotPacket(stack, slotInd); + } + + public void sendProgressBarUpdate(Container containerIn, int varToUpdate, int newValue) + { + } + + public void sendAllWindowProperties(Container p_175173_1_, IInventory p_175173_2_) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java new file mode 100644 index 0000000..4eb982a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java @@ -0,0 +1,305 @@ +package net.minecraft.client.gui.inventory; + +import io.netty.buffer.Unpooled; +import java.io.IOException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.potion.Potion; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GuiBeacon extends GuiContainer +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation beaconGuiTextures = new ResourceLocation("textures/gui/container/beacon.png"); + private IInventory tileBeacon; + private GuiBeacon.ConfirmButton beaconConfirmButton; + private boolean buttonsNotDrawn; + + public GuiBeacon(InventoryPlayer playerInventory, IInventory tileBeaconIn) + { + super(new ContainerBeacon(playerInventory, tileBeaconIn)); + this.tileBeacon = tileBeaconIn; + this.xSize = 230; + this.ySize = 219; + } + + public void initGui() + { + super.initGui(); + this.buttonList.add(this.beaconConfirmButton = new GuiBeacon.ConfirmButton(-1, this.guiLeft + 164, this.guiTop + 107)); + this.buttonList.add(new GuiBeacon.CancelButton(-2, this.guiLeft + 190, this.guiTop + 107)); + this.buttonsNotDrawn = true; + this.beaconConfirmButton.enabled = false; + } + + public void updateScreen() + { + super.updateScreen(); + int i = this.tileBeacon.getField(0); + int j = this.tileBeacon.getField(1); + int k = this.tileBeacon.getField(2); + + if (this.buttonsNotDrawn && i >= 0) + { + this.buttonsNotDrawn = false; + + for (int l = 0; l <= 2; ++l) + { + int i1 = TileEntityBeacon.effectsList[l].length; + int j1 = i1 * 22 + (i1 - 1) * 2; + + for (int k1 = 0; k1 < i1; ++k1) + { + int l1 = TileEntityBeacon.effectsList[l][k1].id; + GuiBeacon.PowerButton guibeacon$powerbutton = new GuiBeacon.PowerButton(l << 8 | l1, this.guiLeft + 76 + k1 * 24 - j1 / 2, this.guiTop + 22 + l * 25, l1, l); + this.buttonList.add(guibeacon$powerbutton); + + if (l >= i) + { + guibeacon$powerbutton.enabled = false; + } + else if (l1 == j) + { + guibeacon$powerbutton.func_146140_b(true); + } + } + } + + int i2 = 3; + int j2 = TileEntityBeacon.effectsList[i2].length + 1; + int k2 = j2 * 22 + (j2 - 1) * 2; + + for (int l2 = 0; l2 < j2 - 1; ++l2) + { + int i3 = TileEntityBeacon.effectsList[i2][l2].id; + GuiBeacon.PowerButton guibeacon$powerbutton2 = new GuiBeacon.PowerButton(i2 << 8 | i3, this.guiLeft + 167 + l2 * 24 - k2 / 2, this.guiTop + 47, i3, i2); + this.buttonList.add(guibeacon$powerbutton2); + + if (i2 >= i) + { + guibeacon$powerbutton2.enabled = false; + } + else if (i3 == k) + { + guibeacon$powerbutton2.func_146140_b(true); + } + } + + if (j > 0) + { + GuiBeacon.PowerButton guibeacon$powerbutton1 = new GuiBeacon.PowerButton(i2 << 8 | j, this.guiLeft + 167 + (j2 - 1) * 24 - k2 / 2, this.guiTop + 47, j, i2); + this.buttonList.add(guibeacon$powerbutton1); + + if (i2 >= i) + { + guibeacon$powerbutton1.enabled = false; + } + else if (j == k) + { + guibeacon$powerbutton1.func_146140_b(true); + } + } + } + + this.beaconConfirmButton.enabled = this.tileBeacon.getStackInSlot(0) != null && j > 0; + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == -2) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button.id == -1) + { + String s = "MC|Beacon"; + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + packetbuffer.writeInt(this.tileBeacon.getField(1)); + packetbuffer.writeInt(this.tileBeacon.getField(2)); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, packetbuffer)); + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button instanceof GuiBeacon.PowerButton) + { + if (((GuiBeacon.PowerButton)button).func_146141_c()) + { + return; + } + + int j = button.id; + int k = j & 255; + int i = j >> 8; + + if (i < 3) + { + this.tileBeacon.setField(1, k); + } + else + { + this.tileBeacon.setField(2, k); + } + + this.buttonList.clear(); + this.initGui(); + this.updateScreen(); + } + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + RenderHelper.disableStandardItemLighting(); + this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.primary", new Object[0]), 62, 10, 14737632); + this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.secondary", new Object[0]), 169, 10, 14737632); + + for (GuiButton guibutton : this.buttonList) + { + if (guibutton.isMouseOver()) + { + guibutton.drawButtonForegroundLayer(mouseX - this.guiLeft, mouseY - this.guiTop); + break; + } + } + + RenderHelper.enableGUIStandardItemLighting(); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(beaconGuiTextures); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + this.itemRender.zLevel = 100.0F; + this.itemRender.renderItemAndEffectIntoGUI(new ItemStack(Items.emerald), i + 42, j + 109); + this.itemRender.renderItemAndEffectIntoGUI(new ItemStack(Items.diamond), i + 42 + 22, j + 109); + this.itemRender.renderItemAndEffectIntoGUI(new ItemStack(Items.gold_ingot), i + 42 + 44, j + 109); + this.itemRender.renderItemAndEffectIntoGUI(new ItemStack(Items.iron_ingot), i + 42 + 66, j + 109); + this.itemRender.zLevel = 0.0F; + } + + static class Button extends GuiButton + { + private final ResourceLocation field_146145_o; + private final int field_146144_p; + private final int field_146143_q; + private boolean field_146142_r; + + protected Button(int p_i1077_1_, int p_i1077_2_, int p_i1077_3_, ResourceLocation p_i1077_4_, int p_i1077_5_, int p_i1077_6_) + { + super(p_i1077_1_, p_i1077_2_, p_i1077_3_, 22, 22, ""); + this.field_146145_o = p_i1077_4_; + this.field_146144_p = p_i1077_5_; + this.field_146143_q = p_i1077_6_; + } + + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + mc.getTextureManager().bindTexture(GuiBeacon.beaconGuiTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int i = 219; + int j = 0; + + if (!this.enabled) + { + j += this.width * 2; + } + else if (this.field_146142_r) + { + j += this.width * 1; + } + else if (this.hovered) + { + j += this.width * 3; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, j, i, this.width, this.height); + + if (!GuiBeacon.beaconGuiTextures.equals(this.field_146145_o)) + { + mc.getTextureManager().bindTexture(this.field_146145_o); + } + + this.drawTexturedModalRect(this.xPosition + 2, this.yPosition + 2, this.field_146144_p, this.field_146143_q, 18, 18); + } + } + + public boolean func_146141_c() + { + return this.field_146142_r; + } + + public void func_146140_b(boolean p_146140_1_) + { + this.field_146142_r = p_146140_1_; + } + } + + class CancelButton extends GuiBeacon.Button + { + public CancelButton(int p_i1074_2_, int p_i1074_3_, int p_i1074_4_) + { + super(p_i1074_2_, p_i1074_3_, p_i1074_4_, GuiBeacon.beaconGuiTextures, 112, 220); + } + + public void drawButtonForegroundLayer(int mouseX, int mouseY) + { + GuiBeacon.this.drawCreativeTabHoveringText(I18n.format("gui.cancel", new Object[0]), mouseX, mouseY); + } + } + + class ConfirmButton extends GuiBeacon.Button + { + public ConfirmButton(int p_i1075_2_, int p_i1075_3_, int p_i1075_4_) + { + super(p_i1075_2_, p_i1075_3_, p_i1075_4_, GuiBeacon.beaconGuiTextures, 90, 220); + } + + public void drawButtonForegroundLayer(int mouseX, int mouseY) + { + GuiBeacon.this.drawCreativeTabHoveringText(I18n.format("gui.done", new Object[0]), mouseX, mouseY); + } + } + + class PowerButton extends GuiBeacon.Button + { + private final int field_146149_p; + private final int field_146148_q; + + public PowerButton(int p_i1076_2_, int p_i1076_3_, int p_i1076_4_, int p_i1076_5_, int p_i1076_6_) + { + super(p_i1076_2_, p_i1076_3_, p_i1076_4_, GuiContainer.inventoryBackground, 0 + Potion.potionTypes[p_i1076_5_].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[p_i1076_5_].getStatusIconIndex() / 8 * 18); + this.field_146149_p = p_i1076_5_; + this.field_146148_q = p_i1076_6_; + } + + public void drawButtonForegroundLayer(int mouseX, int mouseY) + { + String s = I18n.format(Potion.potionTypes[this.field_146149_p].getName(), new Object[0]); + + if (this.field_146148_q >= 3 && this.field_146149_p != Potion.regeneration.id) + { + s = s + " II"; + } + + GuiBeacon.this.drawCreativeTabHoveringText(s, mouseX, mouseY); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java new file mode 100644 index 0000000..2b974a0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java @@ -0,0 +1,85 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerBrewingStand; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +public class GuiBrewingStand extends GuiContainer +{ + private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation("textures/gui/container/brewing_stand.png"); + private final InventoryPlayer playerInventory; + private IInventory tileBrewingStand; + + public GuiBrewingStand(InventoryPlayer playerInv, IInventory p_i45506_2_) + { + super(new ContainerBrewingStand(playerInv, p_i45506_2_)); + this.playerInventory = playerInv; + this.tileBrewingStand = p_i45506_2_; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + String s = this.tileBrewingStand.getDisplayName().getUnformattedText(); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + int k = this.tileBrewingStand.getField(0); + + if (k > 0) + { + int l = (int)(28.0F * (1.0F - (float)k / 400.0F)); + + if (l > 0) + { + this.drawTexturedModalRect(i + 97, j + 16, 176, 0, 9, l); + } + + int i1 = k / 2 % 7; + + switch (i1) + { + case 0: + l = 29; + break; + + case 1: + l = 24; + break; + + case 2: + l = 20; + break; + + case 3: + l = 16; + break; + + case 4: + l = 11; + break; + + case 5: + l = 6; + break; + + case 6: + l = 0; + } + + if (l > 0) + { + this.drawTexturedModalRect(i + 65, j + 14 + 29 - l, 185, 29 - l, 12, l); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java new file mode 100644 index 0000000..251085f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java @@ -0,0 +1,43 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +public class GuiChest extends GuiContainer +{ + private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png"); + private IInventory upperChestInventory; + private IInventory lowerChestInventory; + private int inventoryRows; + + public GuiChest(IInventory upperInv, IInventory lowerInv) + { + super(new ContainerChest(upperInv, lowerInv, Minecraft.getMinecraft().thePlayer)); + this.upperChestInventory = upperInv; + this.lowerChestInventory = lowerInv; + this.allowUserInput = false; + int i = 222; + int j = i - 108; + this.inventoryRows = lowerInv.getSizeInventory() / 9; + this.ySize = j + this.inventoryRows * 18; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.lowerChestInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); + this.fontRendererObj.drawString(this.upperChestInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17); + this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java new file mode 100644 index 0000000..f09f778 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java @@ -0,0 +1,693 @@ +package net.minecraft.client.gui.inventory; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.mouse.ClickEvent; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; + +public abstract class GuiContainer extends GuiScreen +{ + protected static final ResourceLocation inventoryBackground = new ResourceLocation("textures/gui/container/inventory.png"); + protected int xSize = 176; + protected int ySize = 166; + public Container inventorySlots; + protected int guiLeft; + protected int guiTop; + private Slot theSlot; + private Slot clickedSlot; + private boolean isRightMouseClick; + private ItemStack draggedStack; + private int touchUpX; + private int touchUpY; + private Slot returningStackDestSlot; + private long returningStackTime; + private ItemStack returningStack; + private Slot currentDragTargetSlot; + private long dragItemDropDelay; + protected final Set dragSplittingSlots = Sets.newHashSet(); + protected boolean dragSplitting; + private int dragSplittingLimit; + private int dragSplittingButton; + private boolean ignoreMouseUp; + private int dragSplittingRemnant; + private long lastClickTime; + private Slot lastClickSlot; + private int lastClickButton; + private boolean doubleClick; + private ItemStack shiftClickedSlot; + + public GuiContainer(Container inventorySlotsIn) + { + this.inventorySlots = inventorySlotsIn; + this.ignoreMouseUp = true; + } + + public void initGui() + { + super.initGui(); + this.mc.thePlayer.openContainer = this.inventorySlots; + this.guiLeft = (this.width - this.xSize) / 2; + this.guiTop = (this.height - this.ySize) / 2; + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int i = this.guiLeft; + int j = this.guiTop; + this.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY); + GlStateManager.disableRescaleNormal(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + super.drawScreen(mouseX, mouseY, partialTicks); + RenderHelper.enableGUIStandardItemLighting(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)i, (float)j, 0.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableRescaleNormal(); + this.theSlot = null; + int k = 240; + int l = 240; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + for (int i1 = 0; i1 < this.inventorySlots.inventorySlots.size(); ++i1) + { + Slot slot = (Slot)this.inventorySlots.inventorySlots.get(i1); + this.drawSlot(slot); + + if (this.isMouseOverSlot(slot, mouseX, mouseY) && slot.canBeHovered()) + { + this.theSlot = slot; + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + int j1 = slot.xDisplayPosition; + int k1 = slot.yDisplayPosition; + GlStateManager.colorMask(true, true, true, false); + this.drawGradientRect(j1, k1, j1 + 16, k1 + 16, -2130706433, -2130706433); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + } + } + + RenderHelper.disableStandardItemLighting(); + this.drawGuiContainerForegroundLayer(mouseX, mouseY); + RenderHelper.enableGUIStandardItemLighting(); + InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory; + ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack; + + if (itemstack != null) + { + int j2 = 8; + int k2 = this.draggedStack == null ? 8 : 16; + String s = null; + + if (this.draggedStack != null && this.isRightMouseClick) + { + itemstack = itemstack.copy(); + itemstack.stackSize = MathHelper.ceiling_float_int((float)itemstack.stackSize / 2.0F); + } + else if (this.dragSplitting && this.dragSplittingSlots.size() > 1) + { + itemstack = itemstack.copy(); + itemstack.stackSize = this.dragSplittingRemnant; + + if (itemstack.stackSize == 0) + { + s = "" + EnumChatFormatting.YELLOW + "0"; + } + } + + this.drawItemStack(itemstack, mouseX - i - j2, mouseY - j - k2, s); + } + + if (this.returningStack != null) + { + float f = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F; + + if (f >= 1.0F) + { + f = 1.0F; + this.returningStack = null; + } + + int l2 = this.returningStackDestSlot.xDisplayPosition - this.touchUpX; + int i3 = this.returningStackDestSlot.yDisplayPosition - this.touchUpY; + int l1 = this.touchUpX + (int)((float)l2 * f); + int i2 = this.touchUpY + (int)((float)i3 * f); + this.drawItemStack(this.returningStack, l1, i2, (String)null); + } + + GlStateManager.popMatrix(); + + if (!CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled() + || (Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.tooltips.getValue()) { + if (inventoryplayer.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) + { + ItemStack itemstack1 = this.theSlot.getStack(); + this.renderToolTip(itemstack1, mouseX, mouseY); + } + } + + + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + RenderHelper.enableStandardItemLighting(); + } + + private void drawItemStack(ItemStack stack, int x, int y, String altText) + { + GlStateManager.translate(0.0F, 0.0F, 32.0F); + this.zLevel = 200.0F; + this.itemRender.zLevel = 200.0F; + this.itemRender.renderItemAndEffectIntoGUI(stack, x, y); + this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, stack, x, y - (this.draggedStack == null ? 0 : 8), altText); + this.zLevel = 0.0F; + this.itemRender.zLevel = 0.0F; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + } + + protected abstract void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY); + + private void drawSlot(Slot slotIn) + { + int i = slotIn.xDisplayPosition; + int j = slotIn.yDisplayPosition; + ItemStack itemstack = slotIn.getStack(); + boolean flag = false; + boolean flag1 = slotIn == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; + ItemStack itemstack1 = this.mc.thePlayer.inventory.getItemStack(); + String s = null; + + if (slotIn == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && itemstack != null) + { + itemstack = itemstack.copy(); + itemstack.stackSize /= 2; + } + else if (this.dragSplitting && this.dragSplittingSlots.contains(slotIn) && itemstack1 != null) + { + if (this.dragSplittingSlots.size() == 1) + { + return; + } + + if (Container.canAddItemToSlot(slotIn, itemstack1, true) && this.inventorySlots.canDragIntoSlot(slotIn)) + { + itemstack = itemstack1.copy(); + flag = true; + Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack, slotIn.getStack() == null ? 0 : slotIn.getStack().stackSize); + + if (itemstack.stackSize > itemstack.getMaxStackSize()) + { + s = EnumChatFormatting.YELLOW + "" + itemstack.getMaxStackSize(); + itemstack.stackSize = itemstack.getMaxStackSize(); + } + + if (itemstack.stackSize > slotIn.getItemStackLimit(itemstack)) + { + s = EnumChatFormatting.YELLOW + "" + slotIn.getItemStackLimit(itemstack); + itemstack.stackSize = slotIn.getItemStackLimit(itemstack); + } + } + else + { + this.dragSplittingSlots.remove(slotIn); + this.updateDragSplitting(); + } + } + + this.zLevel = 100.0F; + this.itemRender.zLevel = 100.0F; + + if (itemstack == null) + { + String s1 = slotIn.getSlotTexture(); + + if (s1 != null) + { + TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite(s1); + GlStateManager.disableLighting(); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + this.drawTexturedModalRect(i, j, textureatlassprite, 16, 16); + GlStateManager.enableLighting(); + flag1 = true; + } + } + + if (!flag1) + { + if (flag) + { + drawRect(i, j, i + 16, j + 16, -2130706433); + } + + GlStateManager.enableDepth(); + this.itemRender.renderItemAndEffectIntoGUI(itemstack, i, j); + this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, itemstack, i, j, s); + } + + this.itemRender.zLevel = 0.0F; + this.zLevel = 0.0F; + } + + private void updateDragSplitting() + { + ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); + + if (itemstack != null && this.dragSplitting) + { + this.dragSplittingRemnant = itemstack.stackSize; + + for (Slot slot : this.dragSplittingSlots) + { + ItemStack itemstack1 = itemstack.copy(); + int i = slot.getStack() == null ? 0 : slot.getStack().stackSize; + Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack1, i); + + if (itemstack1.stackSize > itemstack1.getMaxStackSize()) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + + if (itemstack1.stackSize > slot.getItemStackLimit(itemstack1)) + { + itemstack1.stackSize = slot.getItemStackLimit(itemstack1); + } + + this.dragSplittingRemnant -= itemstack1.stackSize - i; + } + } + } + + private Slot getSlotAtPosition(int x, int y) + { + for (int i = 0; i < this.inventorySlots.inventorySlots.size(); ++i) + { + Slot slot = (Slot)this.inventorySlots.inventorySlots.get(i); + + if (this.isMouseOverSlot(slot, x, y)) + { + return slot; + } + } + + return null; + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + this.checkHotbarKeys(mouseButton - 100); + super.mouseClicked(mouseX, mouseY, mouseButton); + boolean flag = mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100; + Slot slot = this.getSlotAtPosition(mouseX, mouseY); + long i = Minecraft.getSystemTime(); + this.doubleClick = this.lastClickSlot == slot && i - this.lastClickTime < 250L && this.lastClickButton == mouseButton; + this.ignoreMouseUp = false; + + if (mouseButton == 0 || mouseButton == 1 || flag) + { + int j = this.guiLeft; + int k = this.guiTop; + boolean flag1 = mouseX < j || mouseY < k || mouseX >= j + this.xSize || mouseY >= k + this.ySize; + int l = -1; + + if (slot != null) + { + l = slot.slotNumber; + } + + if (flag1) + { + l = -999; + } + + if (this.mc.gameSettings.touchscreen && flag1 && this.mc.thePlayer.inventory.getItemStack() == null) + { + this.mc.displayGuiScreen((GuiScreen)null); + return; + } + + if (l != -1) + { + if (this.mc.gameSettings.touchscreen) + { + if (slot != null && slot.getHasStack()) + { + this.clickedSlot = slot; + this.draggedStack = null; + this.isRightMouseClick = mouseButton == 1; + } + else + { + this.clickedSlot = null; + } + } + else if (!this.dragSplitting) + { + if (this.mc.thePlayer.inventory.getItemStack() == null) + { + if (mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100) + { + this.handleMouseClick(slot, l, mouseButton, 3); + } + else + { + boolean flag2 = l != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); + int i1 = 0; + + if (flag2) + { + this.shiftClickedSlot = slot != null && slot.getHasStack() ? slot.getStack() : null; + i1 = 1; + } + else if (l == -999) + { + i1 = 4; + } + + this.handleMouseClick(slot, l, mouseButton, i1); + } + + this.ignoreMouseUp = true; + } + else + { + this.dragSplitting = true; + this.dragSplittingButton = mouseButton; + this.dragSplittingSlots.clear(); + + if (mouseButton == 0) + { + this.dragSplittingLimit = 0; + } + else if (mouseButton == 1) + { + this.dragSplittingLimit = 1; + } + else if (mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100) + { + this.dragSplittingLimit = 2; + } + } + } + } + } + + this.lastClickSlot = slot; + this.lastClickTime = i; + this.lastClickButton = mouseButton; + } + + protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) + { + Slot slot = this.getSlotAtPosition(mouseX, mouseY); + ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); + + if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) + { + if (clickedMouseButton == 0 || clickedMouseButton == 1) + { + if (this.draggedStack == null) + { + if (slot != this.clickedSlot && this.clickedSlot.getStack() != null) + { + this.draggedStack = this.clickedSlot.getStack().copy(); + } + } + else if (this.draggedStack.stackSize > 1 && slot != null && Container.canAddItemToSlot(slot, this.draggedStack, false)) + { + long i = Minecraft.getSystemTime(); + + if (this.currentDragTargetSlot == slot) + { + if (i - this.dragItemDropDelay > 500L) + { + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); + this.handleMouseClick(slot, slot.slotNumber, 1, 0); + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); + this.dragItemDropDelay = i + 750L; + --this.draggedStack.stackSize; + } + } + else + { + this.currentDragTargetSlot = slot; + this.dragItemDropDelay = i; + } + } + } + } + else if (this.dragSplitting && slot != null && itemstack != null && itemstack.stackSize > this.dragSplittingSlots.size() && Container.canAddItemToSlot(slot, itemstack, true) && slot.isItemValid(itemstack) && this.inventorySlots.canDragIntoSlot(slot)) + { + this.dragSplittingSlots.add(slot); + this.updateDragSplitting(); + } + } + + protected void mouseReleased(int mouseX, int mouseY, int state) + { + CheatBreaker.getInstance().getEventBus().handleEvent(new ClickEvent(state)); + Slot slot = this.getSlotAtPosition(mouseX, mouseY); + int i = this.guiLeft; + int j = this.guiTop; + boolean flag = mouseX < i || mouseY < j || mouseX >= i + this.xSize || mouseY >= j + this.ySize; + int k = -1; + + if (slot != null) + { + k = slot.slotNumber; + } + + if (flag) + { + k = -999; + } + + if (this.doubleClick && slot != null && state == 0 && this.inventorySlots.canMergeSlot((ItemStack)null, slot)) + { + if (isShiftKeyDown()) + { + if (slot != null && slot.inventory != null && this.shiftClickedSlot != null) + { + for (Slot slot2 : this.inventorySlots.inventorySlots) + { + if (slot2 != null && slot2.canTakeStack(this.mc.thePlayer) && slot2.getHasStack() && slot2.inventory == slot.inventory && Container.canAddItemToSlot(slot2, this.shiftClickedSlot, true)) + { + this.handleMouseClick(slot2, slot2.slotNumber, state, 1); + } + } + } + } + else + { + this.handleMouseClick(slot, k, state, 6); + } + + this.doubleClick = false; + this.lastClickTime = 0L; + } + else + { + if (this.dragSplitting && this.dragSplittingButton != state) + { + this.dragSplitting = false; + this.dragSplittingSlots.clear(); + this.ignoreMouseUp = true; + return; + } + + if (this.ignoreMouseUp) + { + this.ignoreMouseUp = false; + return; + } + + if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) + { + if (state == 0 || state == 1) + { + if (this.draggedStack == null && slot != this.clickedSlot) + { + this.draggedStack = this.clickedSlot.getStack(); + } + + boolean flag2 = Container.canAddItemToSlot(slot, this.draggedStack, false); + + if (k != -1 && this.draggedStack != null && flag2) + { + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, state, 0); + this.handleMouseClick(slot, k, 0, 0); + + if (this.mc.thePlayer.inventory.getItemStack() != null) + { + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, state, 0); + this.touchUpX = mouseX - i; + this.touchUpY = mouseY - j; + this.returningStackDestSlot = this.clickedSlot; + this.returningStack = this.draggedStack; + this.returningStackTime = Minecraft.getSystemTime(); + } + else + { + this.returningStack = null; + } + } + else if (this.draggedStack != null) + { + this.touchUpX = mouseX - i; + this.touchUpY = mouseY - j; + this.returningStackDestSlot = this.clickedSlot; + this.returningStack = this.draggedStack; + this.returningStackTime = Minecraft.getSystemTime(); + } + + this.draggedStack = null; + this.clickedSlot = null; + } + } + else if (this.dragSplitting && !this.dragSplittingSlots.isEmpty()) + { + this.handleMouseClick((Slot)null, -999, Container.func_94534_d(0, this.dragSplittingLimit), 5); + + for (Slot slot1 : this.dragSplittingSlots) + { + this.handleMouseClick(slot1, slot1.slotNumber, Container.func_94534_d(1, this.dragSplittingLimit), 5); + } + + this.handleMouseClick((Slot)null, -999, Container.func_94534_d(2, this.dragSplittingLimit), 5); + } + else if (this.mc.thePlayer.inventory.getItemStack() != null) + { + if (state == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100) + { + this.handleMouseClick(slot, k, state, 3); + } + else + { + boolean flag1 = k != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); + + if (flag1) + { + this.shiftClickedSlot = slot != null && slot.getHasStack() ? slot.getStack() : null; + } + + this.handleMouseClick(slot, k, state, flag1 ? 1 : 0); + } + } + } + + if (this.mc.thePlayer.inventory.getItemStack() == null) + { + this.lastClickTime = 0L; + } + + this.dragSplitting = false; + } + + private boolean isMouseOverSlot(Slot slotIn, int mouseX, int mouseY) + { + return this.isPointInRegion(slotIn.xDisplayPosition, slotIn.yDisplayPosition, 16, 16, mouseX, mouseY); + } + + protected boolean isPointInRegion(int left, int top, int right, int bottom, int pointX, int pointY) + { + int i = this.guiLeft; + int j = this.guiTop; + pointX = pointX - i; + pointY = pointY - j; + return pointX >= left - 1 && pointX < left + right + 1 && pointY >= top - 1 && pointY < top + bottom + 1; + } + + protected void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) + { + if (slotIn != null) + { + slotId = slotIn.slotNumber; + } + + this.mc.playerController.windowClick(this.inventorySlots.windowId, slotId, clickedButton, clickType, this.mc.thePlayer); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (keyCode == 1 || keyCode == this.mc.gameSettings.keyBindInventory.getKeyCode()) + { + this.mc.thePlayer.closeScreen(); + } + + this.checkHotbarKeys(keyCode); + + if (this.theSlot != null && this.theSlot.getHasStack()) + { + if (keyCode == this.mc.gameSettings.keyBindPickBlock.getKeyCode()) + { + this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, 0, 3); + } + else if (keyCode == this.mc.gameSettings.keyBindDrop.getKeyCode()) + { + this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, isCtrlKeyDown() ? 1 : 0, 4); + } + } + } + + protected boolean checkHotbarKeys(int keyCode) + { + if (this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) + { + for (int i = 0; i < 9; ++i) + { + if (keyCode == this.mc.gameSettings.keyBindsHotbar[i].getKeyCode()) + { + this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, i, 2); + return true; + } + } + } + + return false; + } + + public void onGuiClosed() + { + if (this.mc.thePlayer != null) + { + this.inventorySlots.onContainerClosed(this.mc.thePlayer); + } + } + + public boolean doesGuiPauseGame() + { + return false; + } + + public void updateScreen() + { + super.updateScreen(); + + if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) + { + this.mc.thePlayer.closeScreen(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java new file mode 100644 index 0000000..fde354b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java @@ -0,0 +1,953 @@ +package net.minecraft.client.gui.inventory; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +public class GuiContainerCreative extends InventoryEffectRenderer +{ + private static final ResourceLocation creativeInventoryTabs = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + private static InventoryBasic field_147060_v = new InventoryBasic("tmp", true, 45); + private static int selectedTabIndex = CreativeTabs.tabBlock.getTabIndex(); + private float currentScroll; + private boolean isScrolling; + private boolean wasClicking; + private GuiTextField searchField; + private List field_147063_B; + private Slot field_147064_C; + private boolean field_147057_D; + private CreativeCrafting field_147059_E; + + public GuiContainerCreative(EntityPlayer p_i1088_1_) + { + super(new GuiContainerCreative.ContainerCreative(p_i1088_1_)); + p_i1088_1_.openContainer = this.inventorySlots; + this.allowUserInput = true; + this.ySize = 136; + this.xSize = 195; + } + + public void updateScreen() + { + if (!this.mc.playerController.isInCreativeMode()) + { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } + + this.updateActivePotionEffects(); + } + + protected void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) + { + this.field_147057_D = true; + boolean flag = clickType == 1; + clickType = slotId == -999 && clickType == 0 ? 4 : clickType; + + if (slotIn == null && selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && clickType != 5) + { + InventoryPlayer inventoryplayer1 = this.mc.thePlayer.inventory; + + if (inventoryplayer1.getItemStack() != null) + { + if (clickedButton == 0) + { + this.mc.thePlayer.dropPlayerItemWithRandomChoice(inventoryplayer1.getItemStack(), true); + this.mc.playerController.sendPacketDropItem(inventoryplayer1.getItemStack()); + inventoryplayer1.setItemStack((ItemStack)null); + } + + if (clickedButton == 1) + { + ItemStack itemstack5 = inventoryplayer1.getItemStack().splitStack(1); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(itemstack5, true); + this.mc.playerController.sendPacketDropItem(itemstack5); + + if (inventoryplayer1.getItemStack().stackSize == 0) + { + inventoryplayer1.setItemStack((ItemStack)null); + } + } + } + } + else if (slotIn == this.field_147064_C && flag) + { + for (int j = 0; j < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++j) + { + this.mc.playerController.sendSlotPacket((ItemStack)null, j); + } + } + else if (selectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) + { + if (slotIn == this.field_147064_C) + { + this.mc.thePlayer.inventory.setItemStack((ItemStack)null); + } + else if (clickType == 4 && slotIn != null && slotIn.getHasStack()) + { + ItemStack itemstack = slotIn.decrStackSize(clickedButton == 0 ? 1 : slotIn.getStack().getMaxStackSize()); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(itemstack, true); + this.mc.playerController.sendPacketDropItem(itemstack); + } + else if (clickType == 4 && this.mc.thePlayer.inventory.getItemStack() != null) + { + this.mc.thePlayer.dropPlayerItemWithRandomChoice(this.mc.thePlayer.inventory.getItemStack(), true); + this.mc.playerController.sendPacketDropItem(this.mc.thePlayer.inventory.getItemStack()); + this.mc.thePlayer.inventory.setItemStack((ItemStack)null); + } + else + { + this.mc.thePlayer.inventoryContainer.slotClick(slotIn == null ? slotId : ((GuiContainerCreative.CreativeSlot)slotIn).slot.slotNumber, clickedButton, clickType, this.mc.thePlayer); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } + } + else if (clickType != 5 && slotIn.inventory == field_147060_v) + { + InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory; + ItemStack itemstack1 = inventoryplayer.getItemStack(); + ItemStack itemstack2 = slotIn.getStack(); + + if (clickType == 2) + { + if (itemstack2 != null && clickedButton >= 0 && clickedButton < 9) + { + ItemStack itemstack7 = itemstack2.copy(); + itemstack7.stackSize = itemstack7.getMaxStackSize(); + this.mc.thePlayer.inventory.setInventorySlotContents(clickedButton, itemstack7); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } + + return; + } + + if (clickType == 3) + { + if (inventoryplayer.getItemStack() == null && slotIn.getHasStack()) + { + ItemStack itemstack6 = slotIn.getStack().copy(); + itemstack6.stackSize = itemstack6.getMaxStackSize(); + inventoryplayer.setItemStack(itemstack6); + } + + return; + } + + if (clickType == 4) + { + if (itemstack2 != null) + { + ItemStack itemstack3 = itemstack2.copy(); + itemstack3.stackSize = clickedButton == 0 ? 1 : itemstack3.getMaxStackSize(); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(itemstack3, true); + this.mc.playerController.sendPacketDropItem(itemstack3); + } + + return; + } + + if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2)) + { + if (clickedButton == 0) + { + if (flag) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + else if (itemstack1.stackSize < itemstack1.getMaxStackSize()) + { + ++itemstack1.stackSize; + } + } + else if (itemstack1.stackSize <= 1) + { + inventoryplayer.setItemStack((ItemStack)null); + } + else + { + --itemstack1.stackSize; + } + } + else if (itemstack2 != null && itemstack1 == null) + { + inventoryplayer.setItemStack(ItemStack.copyItemStack(itemstack2)); + itemstack1 = inventoryplayer.getItemStack(); + + if (flag) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + } + else + { + inventoryplayer.setItemStack((ItemStack)null); + } + } + else + { + this.inventorySlots.slotClick(slotIn == null ? slotId : slotIn.slotNumber, clickedButton, clickType, this.mc.thePlayer); + + if (Container.getDragEvent(clickedButton) == 2) + { + for (int i = 0; i < 9; ++i) + { + this.mc.playerController.sendSlotPacket(this.inventorySlots.getSlot(45 + i).getStack(), 36 + i); + } + } + else if (slotIn != null) + { + ItemStack itemstack4 = this.inventorySlots.getSlot(slotIn.slotNumber).getStack(); + this.mc.playerController.sendSlotPacket(itemstack4, slotIn.slotNumber - this.inventorySlots.inventorySlots.size() + 9 + 36); + } + } + } + + protected void updateActivePotionEffects() + { + int i = this.guiLeft; + super.updateActivePotionEffects(); + + if (this.searchField != null && this.guiLeft != i) + { + this.searchField.xPosition = this.guiLeft + 82; + } + } + + public void initGui() + { + if (this.mc.playerController.isInCreativeMode()) + { + super.initGui(); + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.searchField = new GuiTextField(0, this.fontRendererObj, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRendererObj.FONT_HEIGHT); + this.searchField.setMaxStringLength(15); + this.searchField.setEnableBackgroundDrawing(false); + this.searchField.setVisible(false); + this.searchField.setTextColor(16777215); + int i = selectedTabIndex; + selectedTabIndex = -1; + this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]); + this.field_147059_E = new CreativeCrafting(this.mc); + this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_147059_E); + } + else + { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } + } + + public void onGuiClosed() + { + super.onGuiClosed(); + + if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) + { + this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_147059_E); + } + + Keyboard.enableRepeatEvents(false); + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) + { + if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) + { + this.setCurrentCreativeTab(CreativeTabs.tabAllSearch); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + else + { + if (this.field_147057_D) + { + this.field_147057_D = false; + this.searchField.setText(""); + } + + if (!this.checkHotbarKeys(keyCode)) + { + if (this.searchField.textboxKeyTyped(typedChar, keyCode)) + { + this.updateCreativeSearch(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + } + } + + private void updateCreativeSearch() + { + GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; + guicontainercreative$containercreative.itemList.clear(); + + for (Item item : Item.itemRegistry) + { + if (item != null && item.getCreativeTab() != null) + { + item.getSubItems(item, (CreativeTabs)null, guicontainercreative$containercreative.itemList); + } + } + + for (Enchantment enchantment : Enchantment.enchantmentsBookList) + { + if (enchantment != null && enchantment.type != null) + { + Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList); + } + } + + Iterator iterator = guicontainercreative$containercreative.itemList.iterator(); + String s1 = this.searchField.getText().toLowerCase(); + + while (iterator.hasNext()) + { + ItemStack itemstack = (ItemStack)iterator.next(); + boolean flag = false; + + for (String s : itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips)) + { + if (EnumChatFormatting.getTextWithoutFormattingCodes(s).toLowerCase().contains(s1)) + { + flag = true; + break; + } + } + + if (!flag) + { + iterator.remove(); + } + } + + this.currentScroll = 0.0F; + guicontainercreative$containercreative.scrollTo(0.0F); + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; + + if (creativetabs.drawInForegroundOfTab()) + { + GlStateManager.disableBlend(); + this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752); + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + if (mouseButton == 0) + { + int i = mouseX - this.guiLeft; + int j = mouseY - this.guiTop; + + for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) + { + if (this.func_147049_a(creativetabs, i, j)) + { + return; + } + } + } + + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + protected void mouseReleased(int mouseX, int mouseY, int state) + { + if (state == 0) + { + int i = mouseX - this.guiLeft; + int j = mouseY - this.guiTop; + + for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) + { + if (this.func_147049_a(creativetabs, i, j)) + { + this.setCurrentCreativeTab(creativetabs); + return; + } + } + } + + super.mouseReleased(mouseX, mouseY, state); + } + + private boolean needsScrollBars() + { + return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.inventorySlots).func_148328_e(); + } + + private void setCurrentCreativeTab(CreativeTabs p_147050_1_) + { + int i = selectedTabIndex; + selectedTabIndex = p_147050_1_.getTabIndex(); + GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; + this.dragSplittingSlots.clear(); + guicontainercreative$containercreative.itemList.clear(); + p_147050_1_.displayAllReleventItems(guicontainercreative$containercreative.itemList); + + if (p_147050_1_ == CreativeTabs.tabInventory) + { + Container container = this.mc.thePlayer.inventoryContainer; + + if (this.field_147063_B == null) + { + this.field_147063_B = guicontainercreative$containercreative.inventorySlots; + } + + guicontainercreative$containercreative.inventorySlots = Lists.newArrayList(); + + for (int j = 0; j < container.inventorySlots.size(); ++j) + { + Slot slot = new GuiContainerCreative.CreativeSlot((Slot)container.inventorySlots.get(j), j); + guicontainercreative$containercreative.inventorySlots.add(slot); + + if (j >= 5 && j < 9) + { + int j1 = j - 5; + int k1 = j1 / 2; + int l1 = j1 % 2; + slot.xDisplayPosition = 9 + k1 * 54; + slot.yDisplayPosition = 6 + l1 * 27; + } + else if (j >= 0 && j < 5) + { + slot.yDisplayPosition = -2000; + slot.xDisplayPosition = -2000; + } + else if (j < container.inventorySlots.size()) + { + int k = j - 9; + int l = k % 9; + int i1 = k / 9; + slot.xDisplayPosition = 9 + l * 18; + + if (j >= 36) + { + slot.yDisplayPosition = 112; + } + else + { + slot.yDisplayPosition = 54 + i1 * 18; + } + } + } + + this.field_147064_C = new Slot(field_147060_v, 0, 173, 112); + guicontainercreative$containercreative.inventorySlots.add(this.field_147064_C); + } + else if (i == CreativeTabs.tabInventory.getTabIndex()) + { + guicontainercreative$containercreative.inventorySlots = this.field_147063_B; + this.field_147063_B = null; + } + + if (this.searchField != null) + { + if (p_147050_1_ == CreativeTabs.tabAllSearch) + { + this.searchField.setVisible(true); + this.searchField.setCanLoseFocus(false); + this.searchField.setFocused(true); + this.searchField.setText(""); + this.updateCreativeSearch(); + } + else + { + this.searchField.setVisible(false); + this.searchField.setCanLoseFocus(true); + this.searchField.setFocused(false); + } + } + + this.currentScroll = 0.0F; + guicontainercreative$containercreative.scrollTo(0.0F); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + int i = Mouse.getEventDWheel(); + + if (i != 0 && this.needsScrollBars()) + { + int j = ((GuiContainerCreative.ContainerCreative)this.inventorySlots).itemList.size() / 9 - 5; + + if (i > 0) + { + i = 1; + } + + if (i < 0) + { + i = -1; + } + + this.currentScroll = (float)((double)this.currentScroll - (double)i / (double)j); + this.currentScroll = MathHelper.clamp_float(this.currentScroll, 0.0F, 1.0F); + ((GuiContainerCreative.ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + boolean flag = Mouse.isButtonDown(0); + int i = this.guiLeft; + int j = this.guiTop; + int k = i + 175; + int l = j + 18; + int i1 = k + 14; + int j1 = l + 112; + + if (!this.wasClicking && flag && mouseX >= k && mouseY >= l && mouseX < i1 && mouseY < j1) + { + this.isScrolling = this.needsScrollBars(); + } + + if (!flag) + { + this.isScrolling = false; + } + + this.wasClicking = flag; + + if (this.isScrolling) + { + this.currentScroll = ((float)(mouseY - l) - 7.5F) / ((float)(j1 - l) - 15.0F); + this.currentScroll = MathHelper.clamp_float(this.currentScroll, 0.0F, 1.0F); + ((GuiContainerCreative.ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + + for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) + { + if (this.renderCreativeInventoryHoveringText(creativetabs, mouseX, mouseY)) + { + break; + } + } + + if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, mouseX, mouseY)) + { + this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), mouseX, mouseY); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableLighting(); + } + + protected void renderToolTip(ItemStack stack, int x, int y) + { + if (selectedTabIndex == CreativeTabs.tabAllSearch.getTabIndex()) + { + List list = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + CreativeTabs creativetabs = stack.getItem().getCreativeTab(); + + if (creativetabs == null && stack.getItem() == Items.enchanted_book) + { + Map map = EnchantmentHelper.getEnchantments(stack); + + if (map.size() == 1) + { + Enchantment enchantment = Enchantment.getEnchantmentById(((Integer)map.keySet().iterator().next()).intValue()); + + for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray) + { + if (creativetabs1.hasRelevantEnchantmentType(enchantment.type)) + { + creativetabs = creativetabs1; + break; + } + } + } + } + + if (creativetabs != null) + { + list.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0])); + } + + for (int i = 0; i < list.size(); ++i) + { + if (i == 0) + { + list.set(i, stack.getRarity().rarityColor + (String)list.get(i)); + } + else + { + list.set(i, EnumChatFormatting.GRAY + (String)list.get(i)); + } + } + + this.drawHoveringText(list, x, y); + } + else + { + super.renderToolTip(stack, x, y); + } + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.enableGUIStandardItemLighting(); + CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; + + for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray) + { + this.mc.getTextureManager().bindTexture(creativeInventoryTabs); + + if (creativetabs1.getTabIndex() != selectedTabIndex) + { + this.func_147051_a(creativetabs1); + } + } + + this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName())); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); + this.searchField.drawTextBox(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + int i = this.guiLeft + 175; + int j = this.guiTop + 18; + int k = j + 112; + this.mc.getTextureManager().bindTexture(creativeInventoryTabs); + + if (creativetabs.shouldHidePlayerInventory()) + { + this.drawTexturedModalRect(i, j + (int)((float)(k - j - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); + } + + this.func_147051_a(creativetabs); + + if (creativetabs == CreativeTabs.tabInventory) + { + GuiInventory.drawEntityOnScreen(this.guiLeft + 43, this.guiTop + 45, 20, (float)(this.guiLeft + 43 - mouseX), (float)(this.guiTop + 45 - 30 - mouseY), this.mc.thePlayer); + } + } + + protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) + { + int i = p_147049_1_.getTabColumn(); + int j = 28 * i; + int k = 0; + + if (i == 5) + { + j = this.xSize - 28 + 2; + } + else if (i > 0) + { + j += i; + } + + if (p_147049_1_.isTabInFirstRow()) + { + k = k - 32; + } + else + { + k = k + this.ySize; + } + + return p_147049_2_ >= j && p_147049_2_ <= j + 28 && p_147049_3_ >= k && p_147049_3_ <= k + 32; + } + + protected boolean renderCreativeInventoryHoveringText(CreativeTabs p_147052_1_, int p_147052_2_, int p_147052_3_) + { + int i = p_147052_1_.getTabColumn(); + int j = 28 * i; + int k = 0; + + if (i == 5) + { + j = this.xSize - 28 + 2; + } + else if (i > 0) + { + j += i; + } + + if (p_147052_1_.isTabInFirstRow()) + { + k = k - 32; + } + else + { + k = k + this.ySize; + } + + if (this.isPointInRegion(j + 3, k + 3, 23, 27, p_147052_2_, p_147052_3_)) + { + this.drawCreativeTabHoveringText(I18n.format(p_147052_1_.getTranslatedTabLabel(), new Object[0]), p_147052_2_, p_147052_3_); + return true; + } + else + { + return false; + } + } + + protected void func_147051_a(CreativeTabs p_147051_1_) + { + boolean flag = p_147051_1_.getTabIndex() == selectedTabIndex; + boolean flag1 = p_147051_1_.isTabInFirstRow(); + int i = p_147051_1_.getTabColumn(); + int j = i * 28; + int k = 0; + int l = this.guiLeft + 28 * i; + int i1 = this.guiTop; + int j1 = 32; + + if (flag) + { + k += 32; + } + + if (i == 5) + { + l = this.guiLeft + this.xSize - 28; + } + else if (i > 0) + { + l += i; + } + + if (flag1) + { + i1 = i1 - 28; + } + else + { + k += 64; + i1 = i1 + (this.ySize - 4); + } + + GlStateManager.disableLighting(); + this.drawTexturedModalRect(l, i1, j, k, 28, j1); + this.zLevel = 100.0F; + this.itemRender.zLevel = 100.0F; + l = l + 6; + i1 = i1 + 8 + (flag1 ? 1 : -1); + GlStateManager.enableLighting(); + GlStateManager.enableRescaleNormal(); + ItemStack itemstack = p_147051_1_.getIconItemStack(); + this.itemRender.renderItemAndEffectIntoGUI(itemstack, l, i1); + this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, l, i1); + GlStateManager.disableLighting(); + this.itemRender.zLevel = 0.0F; + this.zLevel = 0.0F; + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 0) + { + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); + } + + if (button.id == 1) + { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + } + } + + public int getSelectedTabIndex() + { + return selectedTabIndex; + } + + static class ContainerCreative extends Container + { + public List itemList = Lists.newArrayList(); + + public ContainerCreative(EntityPlayer p_i1086_1_) + { + InventoryPlayer inventoryplayer = p_i1086_1_.inventory; + + for (int i = 0; i < 5; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(GuiContainerCreative.field_147060_v, i * 9 + j, 9 + j * 18, 18 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(inventoryplayer, k, 9 + k * 18, 112)); + } + + this.scrollTo(0.0F); + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return true; + } + + public void scrollTo(float p_148329_1_) + { + int i = (this.itemList.size() + 9 - 1) / 9 - 5; + int j = (int)((double)(p_148329_1_ * (float)i) + 0.5D); + + if (j < 0) + { + j = 0; + } + + for (int k = 0; k < 5; ++k) + { + for (int l = 0; l < 9; ++l) + { + int i1 = l + (k + j) * 9; + + if (i1 >= 0 && i1 < this.itemList.size()) + { + GuiContainerCreative.field_147060_v.setInventorySlotContents(l + k * 9, (ItemStack)this.itemList.get(i1)); + } + else + { + GuiContainerCreative.field_147060_v.setInventorySlotContents(l + k * 9, (ItemStack)null); + } + } + } + } + + public boolean func_148328_e() + { + return this.itemList.size() > 45; + } + + protected void retrySlotClick(int slotId, int clickedButton, boolean mode, EntityPlayer playerIn) + { + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + if (index >= this.inventorySlots.size() - 9 && index < this.inventorySlots.size()) + { + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + slot.putStack((ItemStack)null); + } + } + + return null; + } + + public boolean canMergeSlot(ItemStack stack, Slot slotIn) + { + return slotIn.yDisplayPosition > 90; + } + + public boolean canDragIntoSlot(Slot p_94531_1_) + { + return p_94531_1_.inventory instanceof InventoryPlayer || p_94531_1_.yDisplayPosition > 90 && p_94531_1_.xDisplayPosition <= 162; + } + } + + class CreativeSlot extends Slot + { + private final Slot slot; + + public CreativeSlot(Slot p_i46313_2_, int p_i46313_3_) + { + super(p_i46313_2_.inventory, p_i46313_3_, 0, 0); + this.slot = p_i46313_2_; + } + + public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + { + this.slot.onPickupFromSlot(playerIn, stack); + } + + public boolean isItemValid(ItemStack stack) + { + return this.slot.isItemValid(stack); + } + + public ItemStack getStack() + { + return this.slot.getStack(); + } + + public boolean getHasStack() + { + return this.slot.getHasStack(); + } + + public void putStack(ItemStack stack) + { + this.slot.putStack(stack); + } + + public void onSlotChanged() + { + this.slot.onSlotChanged(); + } + + public int getSlotStackLimit() + { + return this.slot.getSlotStackLimit(); + } + + public int getItemStackLimit(ItemStack stack) + { + return this.slot.getItemStackLimit(stack); + } + + public String getSlotTexture() + { + return this.slot.getSlotTexture(); + } + + public ItemStack decrStackSize(int amount) + { + return this.slot.decrStackSize(amount); + } + + public boolean isHere(IInventory inv, int slotIn) + { + return this.slot.isHere(inv, slotIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java new file mode 100644 index 0000000..a50f533 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java @@ -0,0 +1,39 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class GuiCrafting extends GuiContainer +{ + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); + + public GuiCrafting(InventoryPlayer playerInv, World worldIn) + { + this(playerInv, worldIn, BlockPos.ORIGIN); + } + + public GuiCrafting(InventoryPlayer playerInv, World worldIn, BlockPos blockPosition) + { + super(new ContainerWorkbench(playerInv, worldIn, blockPosition)); + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(craftingTableGuiTextures); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java new file mode 100644 index 0000000..52a7202 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java @@ -0,0 +1,37 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerDispenser; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +public class GuiDispenser extends GuiContainer +{ + private static final ResourceLocation dispenserGuiTextures = new ResourceLocation("textures/gui/container/dispenser.png"); + private final InventoryPlayer playerInventory; + public IInventory dispenserInventory; + + public GuiDispenser(InventoryPlayer playerInv, IInventory dispenserInv) + { + super(new ContainerDispenser(playerInv, dispenserInv)); + this.playerInventory = playerInv; + this.dispenserInventory = dispenserInv; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + String s = this.dispenserInventory.getDisplayName().getUnformattedText(); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(dispenserGuiTextures); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java new file mode 100644 index 0000000..f51f910 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java @@ -0,0 +1,152 @@ +package net.minecraft.client.gui.inventory; + +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.ChatComponentText; +import org.lwjgl.input.Keyboard; + +public class GuiEditSign extends GuiScreen +{ + private TileEntitySign tileSign; + private int updateCounter; + private int editLine; + private GuiButton doneBtn; + + public GuiEditSign(TileEntitySign teSign) + { + this.tileSign = teSign; + } + + public void initGui() + { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, I18n.format("gui.done", new Object[0]))); + this.tileSign.setEditable(false); + } + + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + NetHandlerPlayClient nethandlerplayclient = this.mc.getNetHandler(); + + if (nethandlerplayclient != null) + { + nethandlerplayclient.addToSendQueue(new C12PacketUpdateSign(this.tileSign.getPos(), this.tileSign.signText)); + } + + this.tileSign.setEditable(true); + } + + public void updateScreen() + { + ++this.updateCounter; + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 0) + { + this.tileSign.markDirty(); + this.mc.displayGuiScreen((GuiScreen)null); + } + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + if (keyCode == 200) + { + this.editLine = this.editLine - 1 & 3; + } + + if (keyCode == 208 || keyCode == 28 || keyCode == 156) + { + this.editLine = this.editLine + 1 & 3; + } + + String s = this.tileSign.signText[this.editLine].getUnformattedText(); + + if (keyCode == 14 && s.length() > 0) + { + s = s.substring(0, s.length() - 1); + } + + if (ChatAllowedCharacters.isAllowedCharacter(typedChar) && this.fontRendererObj.getStringWidth(s + typedChar) <= 90) + { + s = s + typedChar; + } + + this.tileSign.signText[this.editLine] = new ChatComponentText(s); + + if (keyCode == 1) + { + this.actionPerformed(this.doneBtn); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("sign.edit", new Object[0]), this.width / 2, 40, 16777215); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)(this.width / 2), 0.0F, 50.0F); + float f = 93.75F; + GlStateManager.scale(-f, -f, -f); + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + Block block = this.tileSign.getBlockType(); + + if (block == Blocks.standing_sign) + { + float f1 = (float)(this.tileSign.getBlockMetadata() * 360) / 16.0F; + GlStateManager.rotate(f1, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, -1.0625F, 0.0F); + } + else + { + int i = this.tileSign.getBlockMetadata(); + float f2 = 0.0F; + + if (i == 2) + { + f2 = 180.0F; + } + + if (i == 4) + { + f2 = 90.0F; + } + + if (i == 5) + { + f2 = -90.0F; + } + + GlStateManager.rotate(f2, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, -1.0625F, 0.0F); + } + + if (this.updateCounter / 6 % 2 == 0) + { + this.tileSign.lineBeingEdited = this.editLine; + } + + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.tileSign, -0.5D, -0.75D, -0.5D, 0.0F); + this.tileSign.lineBeingEdited = -1; + GlStateManager.popMatrix(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java new file mode 100644 index 0000000..095c78b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java @@ -0,0 +1,66 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerFurnace; +import net.minecraft.inventory.IInventory; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.ResourceLocation; + +public class GuiFurnace extends GuiContainer +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png"); + private final InventoryPlayer playerInventory; + private IInventory tileFurnace; + + public GuiFurnace(InventoryPlayer playerInv, IInventory furnaceInv) + { + super(new ContainerFurnace(playerInv, furnaceInv)); + this.playerInventory = playerInv; + this.tileFurnace = furnaceInv; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + String s = this.tileFurnace.getDisplayName().getUnformattedText(); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + + if (TileEntityFurnace.isBurning(this.tileFurnace)) + { + int k = this.getBurnLeftScaled(13); + this.drawTexturedModalRect(i + 56, j + 36 + 12 - k, 176, 12 - k, 14, k + 1); + } + + int l = this.getCookProgressScaled(24); + this.drawTexturedModalRect(i + 79, j + 34, 176, 14, l + 1, 16); + } + + private int getCookProgressScaled(int pixels) + { + int i = this.tileFurnace.getField(2); + int j = this.tileFurnace.getField(3); + return j != 0 && i != 0 ? i * pixels / j : 0; + } + + private int getBurnLeftScaled(int pixels) + { + int i = this.tileFurnace.getField(1); + + if (i == 0) + { + i = 200; + } + + return this.tileFurnace.getField(0) * pixels / i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java new file mode 100644 index 0000000..88c9f2d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java @@ -0,0 +1,135 @@ +package net.minecraft.client.gui.inventory; + +import java.io.IOException; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; + +public class GuiInventory extends InventoryEffectRenderer +{ + private float oldMouseX; + private float oldMouseY; + + public GuiInventory(EntityPlayer p_i1094_1_) + { + super(p_i1094_1_.inventoryContainer); + this.allowUserInput = true; + } + + public void updateScreen() + { + if (this.mc.playerController.isInCreativeMode()) + { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } + + this.updateActivePotionEffects(); + } + + public void initGui() + { + this.buttonList.clear(); + + if (this.mc.playerController.isInCreativeMode()) + { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } + else + { + super.initGui(); + } + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 86, 16, 4210752); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + this.oldMouseX = (float)mouseX; + this.oldMouseY = (float)mouseY; + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + this.mc.getTextureManager().bindTexture(inventoryBackground); + + int i = this.guiLeft; + int j = this.guiTop; + + if (!(Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.transparentInventory.getValue() + || !CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + } + + drawEntityOnScreen(i + 51, j + 75, 30, (float)(i + 51) - this.oldMouseX, (float)(j + 75 - 50) - this.oldMouseY, this.mc.thePlayer); + } + + public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent) + { + GlStateManager.enableColorMaterial(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)posX, (float)posY, 50.0F); + GlStateManager.scale((float)(-scale), (float)scale, (float)scale); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + float f = ent.renderYawOffset; + float f1 = ent.rotationYaw; + float f2 = ent.rotationPitch; + float f3 = ent.prevRotationYawHead; + float f4 = ent.rotationYawHead; + GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); + ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F; + ent.rotationYaw = (float)Math.atan((double)(mouseX / 40.0F)) * 40.0F; + ent.rotationPitch = -((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F; + ent.rotationYawHead = ent.rotationYaw; + ent.prevRotationYawHead = ent.rotationYaw; + GlStateManager.translate(0.0F, 0.0F, 0.0F); + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + rendermanager.setPlayerViewY(180.0F); + rendermanager.setRenderShadow(false); + rendermanager.renderEntityWithPosYaw(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); + rendermanager.setRenderShadow(true); + ent.renderYawOffset = f; + ent.rotationYaw = f1; + ent.rotationPitch = f2; + ent.prevRotationYawHead = f3; + ent.rotationYawHead = f4; + GlStateManager.popMatrix(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 0) + { + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); + } + + if (button.id == 1) + { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java new file mode 100644 index 0000000..2612b59 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java @@ -0,0 +1,61 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +public class GuiScreenHorseInventory extends GuiContainer +{ + private static final ResourceLocation horseGuiTextures = new ResourceLocation("textures/gui/container/horse.png"); + private IInventory playerInventory; + private IInventory horseInventory; + private EntityHorse horseEntity; + private float mousePosx; + private float mousePosY; + + public GuiScreenHorseInventory(IInventory playerInv, IInventory horseInv, EntityHorse horse) + { + super(new ContainerHorseInventory(playerInv, horseInv, horse, Minecraft.getMinecraft().thePlayer)); + this.playerInventory = playerInv; + this.horseInventory = horseInv; + this.horseEntity = horse; + this.allowUserInput = false; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.horseInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); + this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(horseGuiTextures); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + + if (this.horseEntity.isChested()) + { + this.drawTexturedModalRect(i + 79, j + 17, 0, this.ySize, 90, 54); + } + + if (this.horseEntity.canWearArmor()) + { + this.drawTexturedModalRect(i + 7, j + 35, 0, this.ySize + 54, 18, 18); + } + + GuiInventory.drawEntityOnScreen(i + 51, j + 60, 17, (float)(i + 51) - this.mousePosx, (float)(j + 75 - 50) - this.mousePosY, this.horseEntity); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.mousePosx = (float)mouseX; + this.mousePosY = (float)mouseY; + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/BaseSpectatorGroup.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/BaseSpectatorGroup.java new file mode 100644 index 0000000..52aeada --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/BaseSpectatorGroup.java @@ -0,0 +1,29 @@ +package net.minecraft.client.gui.spectator; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.gui.spectator.categories.TeleportToPlayer; +import net.minecraft.client.gui.spectator.categories.TeleportToTeam; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; + +public class BaseSpectatorGroup implements ISpectatorMenuView +{ + private final List field_178671_a = Lists.newArrayList(); + + public BaseSpectatorGroup() + { + this.field_178671_a.add(new TeleportToPlayer()); + this.field_178671_a.add(new TeleportToTeam()); + } + + public List func_178669_a() + { + return this.field_178671_a; + } + + public IChatComponent func_178670_b() + { + return new ChatComponentText("Press a key to select a command, and again to use it."); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuObject.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuObject.java new file mode 100644 index 0000000..e115aaf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuObject.java @@ -0,0 +1,14 @@ +package net.minecraft.client.gui.spectator; + +import net.minecraft.util.IChatComponent; + +public interface ISpectatorMenuObject +{ + void func_178661_a(SpectatorMenu menu); + + IChatComponent getSpectatorName(); + + void func_178663_a(float p_178663_1_, int alpha); + + boolean func_178662_A_(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuRecipient.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuRecipient.java new file mode 100644 index 0000000..c38fe09 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuRecipient.java @@ -0,0 +1,6 @@ +package net.minecraft.client.gui.spectator; + +public interface ISpectatorMenuRecipient +{ + void func_175257_a(SpectatorMenu p_175257_1_); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuView.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuView.java new file mode 100644 index 0000000..ca65d0e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/ISpectatorMenuView.java @@ -0,0 +1,11 @@ +package net.minecraft.client.gui.spectator; + +import java.util.List; +import net.minecraft.util.IChatComponent; + +public interface ISpectatorMenuView +{ + List func_178669_a(); + + IChatComponent func_178670_b(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/PlayerMenuObject.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/PlayerMenuObject.java new file mode 100644 index 0000000..08f75a2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/PlayerMenuObject.java @@ -0,0 +1,47 @@ +package net.minecraft.client.gui.spectator; + +import com.mojang.authlib.GameProfile; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.network.play.client.C18PacketSpectate; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; + +public class PlayerMenuObject implements ISpectatorMenuObject +{ + private final GameProfile profile; + private final ResourceLocation resourceLocation; + + public PlayerMenuObject(GameProfile profileIn) + { + this.profile = profileIn; + this.resourceLocation = AbstractClientPlayer.getLocationSkin(profileIn.getName()); + AbstractClientPlayer.getDownloadImageSkin(this.resourceLocation, profileIn.getName()); + } + + public void func_178661_a(SpectatorMenu menu) + { + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C18PacketSpectate(this.profile.getId())); + } + + public IChatComponent getSpectatorName() + { + return new ChatComponentText(this.profile.getName()); + } + + public void func_178663_a(float p_178663_1_, int alpha) + { + Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation); + GlStateManager.color(1.0F, 1.0F, 1.0F, (float)alpha / 255.0F); + Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F); + Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F); + } + + public boolean func_178662_A_() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/SpectatorMenu.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/SpectatorMenu.java new file mode 100644 index 0000000..6fa5c43 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/SpectatorMenu.java @@ -0,0 +1,183 @@ +package net.minecraft.client.gui.spectator; + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiSpectator; +import net.minecraft.client.gui.spectator.categories.SpectatorDetails; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; + +public class SpectatorMenu +{ + private static final ISpectatorMenuObject field_178655_b = new SpectatorMenu.EndSpectatorObject(); + private static final ISpectatorMenuObject field_178656_c = new SpectatorMenu.MoveMenuObject(-1, true); + private static final ISpectatorMenuObject field_178653_d = new SpectatorMenu.MoveMenuObject(1, true); + private static final ISpectatorMenuObject field_178654_e = new SpectatorMenu.MoveMenuObject(1, false); + public static final ISpectatorMenuObject field_178657_a = new ISpectatorMenuObject() + { + public void func_178661_a(SpectatorMenu menu) + { + } + public IChatComponent getSpectatorName() + { + return new ChatComponentText(""); + } + public void func_178663_a(float p_178663_1_, int alpha) + { + } + public boolean func_178662_A_() + { + return false; + } + }; + private final ISpectatorMenuRecipient field_178651_f; + private final List field_178652_g = Lists.newArrayList(); + private ISpectatorMenuView field_178659_h = new BaseSpectatorGroup(); + private int field_178660_i = -1; + private int field_178658_j; + + public SpectatorMenu(ISpectatorMenuRecipient p_i45497_1_) + { + this.field_178651_f = p_i45497_1_; + } + + public ISpectatorMenuObject func_178643_a(int p_178643_1_) + { + int i = p_178643_1_ + this.field_178658_j * 6; + return this.field_178658_j > 0 && p_178643_1_ == 0 ? field_178656_c : (p_178643_1_ == 7 ? (i < this.field_178659_h.func_178669_a().size() ? field_178653_d : field_178654_e) : (p_178643_1_ == 8 ? field_178655_b : (i >= 0 && i < this.field_178659_h.func_178669_a().size() ? (ISpectatorMenuObject)Objects.firstNonNull(this.field_178659_h.func_178669_a().get(i), field_178657_a) : field_178657_a))); + } + + public List func_178642_a() + { + List list = Lists.newArrayList(); + + for (int i = 0; i <= 8; ++i) + { + list.add(this.func_178643_a(i)); + } + + return list; + } + + public ISpectatorMenuObject func_178645_b() + { + return this.func_178643_a(this.field_178660_i); + } + + public ISpectatorMenuView func_178650_c() + { + return this.field_178659_h; + } + + public void func_178644_b(int p_178644_1_) + { + ISpectatorMenuObject ispectatormenuobject = this.func_178643_a(p_178644_1_); + + if (ispectatormenuobject != field_178657_a) + { + if (this.field_178660_i == p_178644_1_ && ispectatormenuobject.func_178662_A_()) + { + ispectatormenuobject.func_178661_a(this); + } + else + { + this.field_178660_i = p_178644_1_; + } + } + } + + public void func_178641_d() + { + this.field_178651_f.func_175257_a(this); + } + + public int func_178648_e() + { + return this.field_178660_i; + } + + public void func_178647_a(ISpectatorMenuView p_178647_1_) + { + this.field_178652_g.add(this.func_178646_f()); + this.field_178659_h = p_178647_1_; + this.field_178660_i = -1; + this.field_178658_j = 0; + } + + public SpectatorDetails func_178646_f() + { + return new SpectatorDetails(this.field_178659_h, this.func_178642_a(), this.field_178660_i); + } + + static class EndSpectatorObject implements ISpectatorMenuObject + { + private EndSpectatorObject() + { + } + + public void func_178661_a(SpectatorMenu menu) + { + menu.func_178641_d(); + } + + public IChatComponent getSpectatorName() + { + return new ChatComponentText("Close menu"); + } + + public void func_178663_a(float p_178663_1_, int alpha) + { + Minecraft.getMinecraft().getTextureManager().bindTexture(GuiSpectator.field_175269_a); + Gui.drawModalRectWithCustomSizedTexture(0, 0, 128.0F, 0.0F, 16, 16, 256.0F, 256.0F); + } + + public boolean func_178662_A_() + { + return true; + } + } + + static class MoveMenuObject implements ISpectatorMenuObject + { + private final int field_178666_a; + private final boolean field_178665_b; + + public MoveMenuObject(int p_i45495_1_, boolean p_i45495_2_) + { + this.field_178666_a = p_i45495_1_; + this.field_178665_b = p_i45495_2_; + } + + public void func_178661_a(SpectatorMenu menu) + { + menu.field_178658_j = this.field_178666_a; + } + + public IChatComponent getSpectatorName() + { + return this.field_178666_a < 0 ? new ChatComponentText("Previous Page") : new ChatComponentText("Next Page"); + } + + public void func_178663_a(float p_178663_1_, int alpha) + { + Minecraft.getMinecraft().getTextureManager().bindTexture(GuiSpectator.field_175269_a); + + if (this.field_178666_a < 0) + { + Gui.drawModalRectWithCustomSizedTexture(0, 0, 144.0F, 0.0F, 16, 16, 256.0F, 256.0F); + } + else + { + Gui.drawModalRectWithCustomSizedTexture(0, 0, 160.0F, 0.0F, 16, 16, 256.0F, 256.0F); + } + } + + public boolean func_178662_A_() + { + return this.field_178665_b; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/SpectatorDetails.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/SpectatorDetails.java new file mode 100644 index 0000000..b29ce29 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/SpectatorDetails.java @@ -0,0 +1,31 @@ +package net.minecraft.client.gui.spectator.categories; + +import com.google.common.base.Objects; +import java.util.List; +import net.minecraft.client.gui.spectator.ISpectatorMenuObject; +import net.minecraft.client.gui.spectator.ISpectatorMenuView; +import net.minecraft.client.gui.spectator.SpectatorMenu; + +public class SpectatorDetails +{ + private final ISpectatorMenuView field_178684_a; + private final List field_178682_b; + private final int field_178683_c; + + public SpectatorDetails(ISpectatorMenuView p_i45494_1_, List p_i45494_2_, int p_i45494_3_) + { + this.field_178684_a = p_i45494_1_; + this.field_178682_b = p_i45494_2_; + this.field_178683_c = p_i45494_3_; + } + + public ISpectatorMenuObject func_178680_a(int p_178680_1_) + { + return p_178680_1_ >= 0 && p_178680_1_ < this.field_178682_b.size() ? (ISpectatorMenuObject)Objects.firstNonNull(this.field_178682_b.get(p_178680_1_), SpectatorMenu.field_178657_a) : SpectatorMenu.field_178657_a; + } + + public int func_178681_b() + { + return this.field_178683_c; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.java new file mode 100644 index 0000000..f92c7c1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToPlayer.java @@ -0,0 +1,80 @@ +package net.minecraft.client.gui.spectator.categories; + +import com.google.common.collect.ComparisonChain; +import com.google.common.collect.Lists; +import com.google.common.collect.Ordering; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiSpectator; +import net.minecraft.client.gui.spectator.ISpectatorMenuObject; +import net.minecraft.client.gui.spectator.ISpectatorMenuView; +import net.minecraft.client.gui.spectator.PlayerMenuObject; +import net.minecraft.client.gui.spectator.SpectatorMenu; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.WorldSettings; + +public class TeleportToPlayer implements ISpectatorMenuView, ISpectatorMenuObject +{ + private static final Ordering field_178674_a = Ordering.from(new Comparator() + { + public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_) + { + return ComparisonChain.start().compare(p_compare_1_.getGameProfile().getId(), p_compare_2_.getGameProfile().getId()).result(); + } + }); + private final List field_178673_b; + + public TeleportToPlayer() + { + this(field_178674_a.sortedCopy(Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap())); + } + + public TeleportToPlayer(Collection p_i45493_1_) + { + this.field_178673_b = Lists.newArrayList(); + + for (NetworkPlayerInfo networkplayerinfo : field_178674_a.sortedCopy(p_i45493_1_)) + { + if (networkplayerinfo.getGameType() != WorldSettings.GameType.SPECTATOR) + { + this.field_178673_b.add(new PlayerMenuObject(networkplayerinfo.getGameProfile())); + } + } + } + + public List func_178669_a() + { + return this.field_178673_b; + } + + public IChatComponent func_178670_b() + { + return new ChatComponentText("Select a player to teleport to"); + } + + public void func_178661_a(SpectatorMenu menu) + { + menu.func_178647_a(this); + } + + public IChatComponent getSpectatorName() + { + return new ChatComponentText("Teleport to player"); + } + + public void func_178663_a(float p_178663_1_, int alpha) + { + Minecraft.getMinecraft().getTextureManager().bindTexture(GuiSpectator.field_175269_a); + Gui.drawModalRectWithCustomSizedTexture(0, 0, 0.0F, 0.0F, 16, 16, 256.0F, 256.0F); + } + + public boolean func_178662_A_() + { + return !this.field_178673_b.isEmpty(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToTeam.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToTeam.java new file mode 100644 index 0000000..c3623d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/spectator/categories/TeleportToTeam.java @@ -0,0 +1,149 @@ +package net.minecraft.client.gui.spectator.categories; + +import com.google.common.collect.Lists; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiSpectator; +import net.minecraft.client.gui.spectator.ISpectatorMenuObject; +import net.minecraft.client.gui.spectator.ISpectatorMenuView; +import net.minecraft.client.gui.spectator.SpectatorMenu; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +import java.util.List; +import java.util.Random; + +public class TeleportToTeam implements ISpectatorMenuView, ISpectatorMenuObject +{ + private final List field_178672_a = Lists.newArrayList(); + + public TeleportToTeam() + { + Minecraft minecraft = Minecraft.getMinecraft(); + + for (ScorePlayerTeam scoreplayerteam : minecraft.theWorld.getScoreboard().getTeams()) + { + this.field_178672_a.add(new TeleportToTeam.TeamSelectionObject(scoreplayerteam)); + } + } + + public List func_178669_a() + { + return this.field_178672_a; + } + + public IChatComponent func_178670_b() + { + return new ChatComponentText("Select a team to teleport to"); + } + + public void func_178661_a(SpectatorMenu menu) + { + menu.func_178647_a(this); + } + + public IChatComponent getSpectatorName() + { + return new ChatComponentText("Teleport to team member"); + } + + public void func_178663_a(float p_178663_1_, int alpha) + { + Minecraft.getMinecraft().getTextureManager().bindTexture(GuiSpectator.field_175269_a); + Gui.drawModalRectWithCustomSizedTexture(0, 0, 16.0F, 0.0F, 16, 16, 256.0F, 256.0F); + } + + public boolean func_178662_A_() + { + for (ISpectatorMenuObject ispectatormenuobject : this.field_178672_a) + { + if (ispectatormenuobject.func_178662_A_()) + { + return true; + } + } + + return false; + } + + class TeamSelectionObject implements ISpectatorMenuObject + { + private final ScorePlayerTeam field_178676_b; + private final ResourceLocation field_178677_c; + private final List field_178675_d; + + public TeamSelectionObject(ScorePlayerTeam p_i45492_2_) + { + this.field_178676_b = p_i45492_2_; + this.field_178675_d = Lists.newArrayList(); + + for (String s : p_i45492_2_.getMembershipCollection()) + { + NetworkPlayerInfo networkplayerinfo = Minecraft.getMinecraft().getNetHandler().getPlayerInfo(s); + + if (networkplayerinfo != null) + { + this.field_178675_d.add(networkplayerinfo); + } + } + + if (!this.field_178675_d.isEmpty()) + { + String s1 = ((NetworkPlayerInfo)this.field_178675_d.get((new Random()).nextInt(this.field_178675_d.size()))).getGameProfile().getName(); + this.field_178677_c = AbstractClientPlayer.getLocationSkin(s1); + AbstractClientPlayer.getDownloadImageSkin(this.field_178677_c, s1); + } + else + { + this.field_178677_c = DefaultPlayerSkin.getDefaultSkinLegacy(); + } + } + + public void func_178661_a(SpectatorMenu menu) + { + menu.func_178647_a(new TeleportToPlayer(this.field_178675_d)); + } + + public IChatComponent getSpectatorName() + { + return new ChatComponentText(this.field_178676_b.getTeamName()); + } + + public void func_178663_a(float p_178663_1_, int alpha) + { + int i = -1; + String s = FontRenderer.getFormatFromString(this.field_178676_b.getColorPrefix()); + + if (s.length() >= 2) + { + i = Minecraft.getMinecraft().fontRendererObj.getColorCode(s.charAt(1)); + } + + if (i >= 0) + { + float f = (float)(i >> 16 & 255) / 255.0F; + float f1 = (float)(i >> 8 & 255) / 255.0F; + float f2 = (float)(i & 255) / 255.0F; + Gui.drawRect(1, 1, 15, 15, MathHelper.func_180183_b(f * p_178663_1_, f1 * p_178663_1_, f2 * p_178663_1_) | alpha << 24); + } + + Minecraft.getMinecraft().getTextureManager().bindTexture(this.field_178677_c); + GlStateManager.color(p_178663_1_, p_178663_1_, p_178663_1_, (float)alpha / 255.0F); + Gui.drawScaledCustomSizeModalRect(2, 2, 8.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F); + Gui.drawScaledCustomSizeModalRect(2, 2, 40.0F, 8.0F, 8, 8, 12, 12, 64.0F, 64.0F); + } + + public boolean func_178662_A_() + { + return !this.field_178675_d.isEmpty(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiIngestServers.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiIngestServers.java new file mode 100644 index 0000000..3e48b27 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiIngestServers.java @@ -0,0 +1,162 @@ +package net.minecraft.client.gui.stream; + +import java.io.IOException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.IngestServerTester; +import net.minecraft.util.EnumChatFormatting; +import tv.twitch.broadcast.IngestServer; + +public class GuiIngestServers extends GuiScreen +{ + private final GuiScreen field_152309_a; + private String field_152310_f; + private GuiIngestServers.ServerList field_152311_g; + + public GuiIngestServers(GuiScreen p_i46312_1_) + { + this.field_152309_a = p_i46312_1_; + } + + public void initGui() + { + this.field_152310_f = I18n.format("options.stream.ingest.title", new Object[0]); + this.field_152311_g = new GuiIngestServers.ServerList(this.mc); + + if (!this.mc.getTwitchStream().func_152908_z()) + { + this.mc.getTwitchStream().func_152909_x(); + } + + this.buttonList.add(new GuiButton(1, this.width / 2 - 155, this.height - 24 - 6, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 5, this.height - 24 - 6, 150, 20, I18n.format("options.stream.ingest.reset", new Object[0]))); + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.field_152311_g.handleMouseInput(); + } + + public void onGuiClosed() + { + if (this.mc.getTwitchStream().func_152908_z()) + { + this.mc.getTwitchStream().func_152932_y().func_153039_l(); + } + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.field_152309_a); + } + else + { + this.mc.gameSettings.streamPreferredServer = ""; + this.mc.gameSettings.saveOptions(); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_152311_g.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_152310_f, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + class ServerList extends GuiSlot + { + public ServerList(Minecraft mcIn) + { + super(mcIn, GuiIngestServers.this.width, GuiIngestServers.this.height, 32, GuiIngestServers.this.height - 35, (int)((double)mcIn.fontRendererObj.FONT_HEIGHT * 3.5D)); + this.setShowSelectionBox(false); + } + + protected int getSize() + { + return this.mc.getTwitchStream().func_152925_v().length; + } + + protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) + { + this.mc.gameSettings.streamPreferredServer = this.mc.getTwitchStream().func_152925_v()[slotIndex].serverUrl; + this.mc.gameSettings.saveOptions(); + } + + protected boolean isSelected(int slotIndex) + { + return this.mc.getTwitchStream().func_152925_v()[slotIndex].serverUrl.equals(this.mc.gameSettings.streamPreferredServer); + } + + protected void drawBackground() + { + } + + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + IngestServer ingestserver = this.mc.getTwitchStream().func_152925_v()[entryID]; + String s = ingestserver.serverUrl.replaceAll("\\{stream_key\\}", ""); + String s1 = (int)ingestserver.bitrateKbps + " kbps"; + String s2 = null; + IngestServerTester ingestservertester = this.mc.getTwitchStream().func_152932_y(); + + if (ingestservertester != null) + { + if (ingestserver == ingestservertester.func_153040_c()) + { + s = EnumChatFormatting.GREEN + s; + s1 = (int)(ingestservertester.func_153030_h() * 100.0F) + "%"; + } + else if (entryID < ingestservertester.func_153028_p()) + { + if (ingestserver.bitrateKbps == 0.0F) + { + s1 = EnumChatFormatting.RED + "Down!"; + } + } + else + { + s1 = EnumChatFormatting.OBFUSCATED + "1234" + EnumChatFormatting.RESET + " kbps"; + } + } + else if (ingestserver.bitrateKbps == 0.0F) + { + s1 = EnumChatFormatting.RED + "Down!"; + } + + p_180791_2_ = p_180791_2_ - 15; + + if (this.isSelected(entryID)) + { + s2 = EnumChatFormatting.BLUE + "(Preferred)"; + } + else if (ingestserver.defaultServer) + { + s2 = EnumChatFormatting.GREEN + "(Default)"; + } + + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, ingestserver.serverName, p_180791_2_ + 2, p_180791_3_ + 5, 16777215); + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s, p_180791_2_ + 2, p_180791_3_ + GuiIngestServers.this.fontRendererObj.FONT_HEIGHT + 5 + 3, 3158064); + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s1, this.getScrollBarX() - 5 - GuiIngestServers.this.fontRendererObj.getStringWidth(s1), p_180791_3_ + 5, 8421504); + + if (s2 != null) + { + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s2, this.getScrollBarX() - 5 - GuiIngestServers.this.fontRendererObj.getStringWidth(s2), p_180791_3_ + 5 + 3 + GuiIngestServers.this.fontRendererObj.FONT_HEIGHT, 8421504); + } + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 15; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiStreamOptions.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiStreamOptions.java new file mode 100644 index 0000000..e65aaec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiStreamOptions.java @@ -0,0 +1,134 @@ +package net.minecraft.client.gui.stream; + +import java.io.IOException; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiOptionSlider; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.EnumChatFormatting; + +public class GuiStreamOptions extends GuiScreen +{ + private static final GameSettings.Options[] field_152312_a = new GameSettings.Options[] {GameSettings.Options.STREAM_BYTES_PER_PIXEL, GameSettings.Options.STREAM_FPS, GameSettings.Options.STREAM_KBPS, GameSettings.Options.STREAM_SEND_METADATA, GameSettings.Options.STREAM_VOLUME_MIC, GameSettings.Options.STREAM_VOLUME_SYSTEM, GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR, GameSettings.Options.STREAM_COMPRESSION}; + private static final GameSettings.Options[] field_152316_f = new GameSettings.Options[] {GameSettings.Options.STREAM_CHAT_ENABLED, GameSettings.Options.STREAM_CHAT_USER_FILTER}; + private final GuiScreen parentScreen; + private final GameSettings field_152318_h; + private String field_152319_i; + private String field_152313_r; + private int field_152314_s; + private boolean field_152315_t = false; + + public GuiStreamOptions(GuiScreen parentScreenIn, GameSettings p_i1073_2_) + { + this.parentScreen = parentScreenIn; + this.field_152318_h = p_i1073_2_; + } + + public void initGui() + { + int i = 0; + this.field_152319_i = I18n.format("options.stream.title", new Object[0]); + this.field_152313_r = I18n.format("options.stream.chat.title", new Object[0]); + + for (GameSettings.Options gamesettings$options : field_152312_a) + { + if (gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options)); + } + else + { + this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options, this.field_152318_h.getKeyBinding(gamesettings$options))); + } + + ++i; + } + + if (i % 2 == 1) + { + ++i; + } + + this.field_152314_s = this.height / 6 + 24 * (i >> 1) + 6; + i = i + 2; + + for (GameSettings.Options gamesettings$options1 : field_152316_f) + { + if (gamesettings$options1.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(gamesettings$options1.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options1)); + } + else + { + this.buttonList.add(new GuiOptionButton(gamesettings$options1.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options1, this.field_152318_h.getKeyBinding(gamesettings$options1))); + } + + ++i; + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 155, this.height / 6 + 168, 150, 20, I18n.format("gui.done", new Object[0]))); + GuiButton guibutton = new GuiButton(201, this.width / 2 + 5, this.height / 6 + 168, 150, 20, I18n.format("options.stream.ingestSelection", new Object[0])); + guibutton.enabled = this.mc.getTwitchStream().isReadyToBroadcast() && this.mc.getTwitchStream().func_152925_v().length > 0 || this.mc.getTwitchStream().func_152908_z(); + this.buttonList.add(guibutton); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id < 100 && button instanceof GuiOptionButton) + { + GameSettings.Options gamesettings$options = ((GuiOptionButton)button).returnEnumOptions(); + this.field_152318_h.setOptionValue(gamesettings$options, 1); + button.displayString = this.field_152318_h.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + + if (this.mc.getTwitchStream().isBroadcasting() && gamesettings$options != GameSettings.Options.STREAM_CHAT_ENABLED && gamesettings$options != GameSettings.Options.STREAM_CHAT_USER_FILTER) + { + this.field_152315_t = true; + } + } + else if (button instanceof GuiOptionSlider) + { + if (button.id == GameSettings.Options.STREAM_VOLUME_MIC.returnEnumOrdinal()) + { + this.mc.getTwitchStream().updateStreamVolume(); + } + else if (button.id == GameSettings.Options.STREAM_VOLUME_SYSTEM.returnEnumOrdinal()) + { + this.mc.getTwitchStream().updateStreamVolume(); + } + else if (this.mc.getTwitchStream().isBroadcasting()) + { + this.field_152315_t = true; + } + } + + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 201) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiIngestServers(this)); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_152319_i, this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_152313_r, this.width / 2, this.field_152314_s, 16777215); + + if (this.field_152315_t) + { + this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.RED + I18n.format("options.stream.changes", new Object[0]), this.width / 2, 20 + this.fontRendererObj.FONT_HEIGHT, 16777215); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiStreamUnavailable.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiStreamUnavailable.java new file mode 100644 index 0000000..f8e2067 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiStreamUnavailable.java @@ -0,0 +1,257 @@ +package net.minecraft.client.gui.stream; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.IStream; +import net.minecraft.client.stream.NullStream; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Session; +import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import tv.twitch.ErrorCode; + +public class GuiStreamUnavailable extends GuiScreen +{ + private static final Logger field_152322_a = LogManager.getLogger(); + private final IChatComponent field_152324_f; + private final GuiScreen parentScreen; + private final GuiStreamUnavailable.Reason field_152326_h; + private final List field_152327_i; + private final List field_152323_r; + + public GuiStreamUnavailable(GuiScreen p_i1070_1_, GuiStreamUnavailable.Reason p_i1070_2_) + { + this(p_i1070_1_, p_i1070_2_, (List)null); + } + + public GuiStreamUnavailable(GuiScreen parentScreenIn, GuiStreamUnavailable.Reason p_i46311_2_, List p_i46311_3_) + { + this.field_152324_f = new ChatComponentTranslation("stream.unavailable.title", new Object[0]); + this.field_152323_r = Lists.newArrayList(); + this.parentScreen = parentScreenIn; + this.field_152326_h = p_i46311_2_; + this.field_152327_i = p_i46311_3_; + } + + public void initGui() + { + if (this.field_152323_r.isEmpty()) + { + this.field_152323_r.addAll(this.fontRendererObj.listFormattedStringToWidth(this.field_152326_h.func_152561_a().getFormattedText(), (int)((float)this.width * 0.75F))); + + if (this.field_152327_i != null) + { + this.field_152323_r.add(""); + + for (ChatComponentTranslation chatcomponenttranslation : this.field_152327_i) + { + this.field_152323_r.add(chatcomponenttranslation.getUnformattedTextForChat()); + } + } + } + + if (this.field_152326_h.func_152559_b() != null) + { + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 50, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 155 + 160, this.height - 50, 150, 20, I18n.format(this.field_152326_h.func_152559_b().getFormattedText(), new Object[0]))); + } + else + { + this.buttonList.add(new GuiButton(0, this.width / 2 - 75, this.height - 50, 150, 20, I18n.format("gui.cancel", new Object[0]))); + } + } + + public void onGuiClosed() + { + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int i = Math.max((int)((double)this.height * 0.85D / 2.0D - (double)((float)(this.field_152323_r.size() * this.fontRendererObj.FONT_HEIGHT) / 2.0F)), 50); + this.drawCenteredString(this.fontRendererObj, this.field_152324_f.getFormattedText(), this.width / 2, i - this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + + for (String s : this.field_152323_r) + { + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, i, 10526880); + i += this.fontRendererObj.FONT_HEIGHT; + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @SuppressWarnings("incomplete-switch") + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 1) + { + switch (this.field_152326_h) + { + case ACCOUNT_NOT_BOUND: + case FAILED_TWITCH_AUTH: + this.func_152320_a("https://account.mojang.com/me/settings"); + break; + + case ACCOUNT_NOT_MIGRATED: + this.func_152320_a("https://account.mojang.com/migrate"); + break; + + case UNSUPPORTED_OS_MAC: + this.func_152320_a("http://www.apple.com/osx/"); + break; + + case UNKNOWN: + case LIBRARY_FAILURE: + case INITIALIZATION_FAILURE: + this.func_152320_a("http://bugs.mojang.com/browse/MC"); + } + } + + this.mc.displayGuiScreen(this.parentScreen); + } + } + + private void func_152320_a(String p_152320_1_) + { + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI(p_152320_1_)}); + } + catch (Throwable throwable) + { + field_152322_a.error("Couldn\'t open link", throwable); + } + } + + public static void func_152321_a(GuiScreen p_152321_0_) + { + Minecraft minecraft = Minecraft.getMinecraft(); + IStream istream = minecraft.getTwitchStream(); + + if (!OpenGlHelper.framebufferSupported) + { + List list = Lists.newArrayList(); + list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.version", new Object[] {GL11.glGetString(GL11.GL_VERSION)})); + list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.blend", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_blend_func_separate)})); + list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.arb", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_ARB_framebuffer_object)})); + list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.ext", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_framebuffer_object)})); + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.NO_FBO, list)); + } + else if (istream instanceof NullStream) + { + if (((NullStream)istream).func_152937_a().getMessage().contains("Can\'t load AMD 64-bit .dll on a IA 32-bit platform")) + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_ARCH_MISMATCH)); + } + else + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_FAILURE)); + } + } + else if (!istream.func_152928_D() && istream.func_152912_E() == ErrorCode.TTV_EC_OS_TOO_OLD) + { + switch (Util.getOSType()) + { + case WINDOWS: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_WINDOWS)); + break; + + case OSX: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_MAC)); + break; + + default: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_OTHER)); + } + } + else if (!minecraft.getTwitchDetails().containsKey("twitch_access_token")) + { + if (minecraft.getSession().getSessionType() == Session.Type.LEGACY) + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_MIGRATED)); + } + else + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_BOUND)); + } + } + else if (!istream.func_152913_F()) + { + switch (istream.func_152918_H()) + { + case INVALID_TOKEN: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH)); + break; + + case ERROR: + default: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH_ERROR)); + } + } + else if (istream.func_152912_E() != null) + { + List list1 = Arrays.asList(new ChatComponentTranslation[] {new ChatComponentTranslation("stream.unavailable.initialization_failure.extra", new Object[]{ErrorCode.getString(istream.func_152912_E())})}); + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.INITIALIZATION_FAILURE, list1)); + } + else + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNKNOWN)); + } + } + + public static enum Reason + { + NO_FBO(new ChatComponentTranslation("stream.unavailable.no_fbo", new Object[0])), + LIBRARY_ARCH_MISMATCH(new ChatComponentTranslation("stream.unavailable.library_arch_mismatch", new Object[0])), + LIBRARY_FAILURE(new ChatComponentTranslation("stream.unavailable.library_failure", new Object[0]), new ChatComponentTranslation("stream.unavailable.report_to_mojang", new Object[0])), + UNSUPPORTED_OS_WINDOWS(new ChatComponentTranslation("stream.unavailable.not_supported.windows", new Object[0])), + UNSUPPORTED_OS_MAC(new ChatComponentTranslation("stream.unavailable.not_supported.mac", new Object[0]), new ChatComponentTranslation("stream.unavailable.not_supported.mac.okay", new Object[0])), + UNSUPPORTED_OS_OTHER(new ChatComponentTranslation("stream.unavailable.not_supported.other", new Object[0])), + ACCOUNT_NOT_MIGRATED(new ChatComponentTranslation("stream.unavailable.account_not_migrated", new Object[0]), new ChatComponentTranslation("stream.unavailable.account_not_migrated.okay", new Object[0])), + ACCOUNT_NOT_BOUND(new ChatComponentTranslation("stream.unavailable.account_not_bound", new Object[0]), new ChatComponentTranslation("stream.unavailable.account_not_bound.okay", new Object[0])), + FAILED_TWITCH_AUTH(new ChatComponentTranslation("stream.unavailable.failed_auth", new Object[0]), new ChatComponentTranslation("stream.unavailable.failed_auth.okay", new Object[0])), + FAILED_TWITCH_AUTH_ERROR(new ChatComponentTranslation("stream.unavailable.failed_auth_error", new Object[0])), + INITIALIZATION_FAILURE(new ChatComponentTranslation("stream.unavailable.initialization_failure", new Object[0]), new ChatComponentTranslation("stream.unavailable.report_to_mojang", new Object[0])), + UNKNOWN(new ChatComponentTranslation("stream.unavailable.unknown", new Object[0]), new ChatComponentTranslation("stream.unavailable.report_to_mojang", new Object[0])); + + private final IChatComponent field_152574_m; + private final IChatComponent field_152575_n; + + private Reason(IChatComponent p_i1066_3_) + { + this(p_i1066_3_, (IChatComponent)null); + } + + private Reason(IChatComponent p_i1067_3_, IChatComponent p_i1067_4_) + { + this.field_152574_m = p_i1067_3_; + this.field_152575_n = p_i1067_4_; + } + + public IChatComponent func_152561_a() + { + return this.field_152574_m; + } + + public IChatComponent func_152559_b() + { + return this.field_152575_n; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiTwitchUserMode.java b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiTwitchUserMode.java new file mode 100644 index 0000000..94da3bb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/gui/stream/GuiTwitchUserMode.java @@ -0,0 +1,233 @@ +package net.minecraft.client.gui.stream; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import java.util.Set; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.IStream; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import tv.twitch.chat.ChatUserInfo; +import tv.twitch.chat.ChatUserMode; +import tv.twitch.chat.ChatUserSubscription; + +public class GuiTwitchUserMode extends GuiScreen +{ + private static final EnumChatFormatting field_152331_a = EnumChatFormatting.DARK_GREEN; + private static final EnumChatFormatting field_152335_f = EnumChatFormatting.RED; + private static final EnumChatFormatting field_152336_g = EnumChatFormatting.DARK_PURPLE; + private final ChatUserInfo field_152337_h; + private final IChatComponent field_152338_i; + private final List field_152332_r = Lists.newArrayList(); + private final IStream stream; + private int field_152334_t; + + public GuiTwitchUserMode(IStream streamIn, ChatUserInfo p_i1064_2_) + { + this.stream = streamIn; + this.field_152337_h = p_i1064_2_; + this.field_152338_i = new ChatComponentText(p_i1064_2_.displayName); + this.field_152332_r.addAll(func_152328_a(p_i1064_2_.modes, p_i1064_2_.subscriptions, streamIn)); + } + + public static List func_152328_a(Set p_152328_0_, Set p_152328_1_, IStream p_152328_2_) + { + String s = p_152328_2_ == null ? null : p_152328_2_.func_152921_C(); + boolean flag = p_152328_2_ != null && p_152328_2_.func_152927_B(); + List list = Lists.newArrayList(); + + for (ChatUserMode chatusermode : p_152328_0_) + { + IChatComponent ichatcomponent = func_152329_a(chatusermode, s, flag); + + if (ichatcomponent != null) + { + IChatComponent ichatcomponent1 = new ChatComponentText("- "); + ichatcomponent1.appendSibling(ichatcomponent); + list.add(ichatcomponent1); + } + } + + for (ChatUserSubscription chatusersubscription : p_152328_1_) + { + IChatComponent ichatcomponent2 = func_152330_a(chatusersubscription, s, flag); + + if (ichatcomponent2 != null) + { + IChatComponent ichatcomponent3 = new ChatComponentText("- "); + ichatcomponent3.appendSibling(ichatcomponent2); + list.add(ichatcomponent3); + } + } + + return list; + } + + public static IChatComponent func_152330_a(ChatUserSubscription p_152330_0_, String p_152330_1_, boolean p_152330_2_) + { + IChatComponent ichatcomponent = null; + + if (p_152330_0_ == ChatUserSubscription.TTV_CHAT_USERSUB_SUBSCRIBER) + { + if (p_152330_1_ == null) + { + ichatcomponent = new ChatComponentTranslation("stream.user.subscription.subscriber", new Object[0]); + } + else if (p_152330_2_) + { + ichatcomponent = new ChatComponentTranslation("stream.user.subscription.subscriber.self", new Object[0]); + } + else + { + ichatcomponent = new ChatComponentTranslation("stream.user.subscription.subscriber.other", new Object[] {p_152330_1_}); + } + + ichatcomponent.getChatStyle().setColor(field_152331_a); + } + else if (p_152330_0_ == ChatUserSubscription.TTV_CHAT_USERSUB_TURBO) + { + ichatcomponent = new ChatComponentTranslation("stream.user.subscription.turbo", new Object[0]); + ichatcomponent.getChatStyle().setColor(field_152336_g); + } + + return ichatcomponent; + } + + public static IChatComponent func_152329_a(ChatUserMode p_152329_0_, String p_152329_1_, boolean p_152329_2_) + { + IChatComponent ichatcomponent = null; + + if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_ADMINSTRATOR) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.administrator", new Object[0]); + ichatcomponent.getChatStyle().setColor(field_152336_g); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_BANNED) + { + if (p_152329_1_ == null) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.banned", new Object[0]); + } + else if (p_152329_2_) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.banned.self", new Object[0]); + } + else + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.banned.other", new Object[] {p_152329_1_}); + } + + ichatcomponent.getChatStyle().setColor(field_152335_f); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_BROADCASTER) + { + if (p_152329_1_ == null) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.broadcaster", new Object[0]); + } + else if (p_152329_2_) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.broadcaster.self", new Object[0]); + } + else + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.broadcaster.other", new Object[0]); + } + + ichatcomponent.getChatStyle().setColor(field_152331_a); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_MODERATOR) + { + if (p_152329_1_ == null) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.moderator", new Object[0]); + } + else if (p_152329_2_) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.moderator.self", new Object[0]); + } + else + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.moderator.other", new Object[] {p_152329_1_}); + } + + ichatcomponent.getChatStyle().setColor(field_152331_a); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_STAFF) + { + ichatcomponent = new ChatComponentTranslation("stream.user.mode.staff", new Object[0]); + ichatcomponent.getChatStyle().setColor(field_152336_g); + } + + return ichatcomponent; + } + + public void initGui() + { + int i = this.width / 3; + int j = i - 130; + this.buttonList.add(new GuiButton(1, i * 0 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.timeout", new Object[0]))); + this.buttonList.add(new GuiButton(0, i * 1 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.ban", new Object[0]))); + this.buttonList.add(new GuiButton(2, i * 2 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.mod", new Object[0]))); + this.buttonList.add(new GuiButton(5, i * 0 + j / 2, this.height - 45, 130, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(new GuiButton(3, i * 1 + j / 2, this.height - 45, 130, 20, I18n.format("stream.userinfo.unban", new Object[0]))); + this.buttonList.add(new GuiButton(4, i * 2 + j / 2, this.height - 45, 130, 20, I18n.format("stream.userinfo.unmod", new Object[0]))); + int k = 0; + + for (IChatComponent ichatcomponent : this.field_152332_r) + { + k = Math.max(k, this.fontRendererObj.getStringWidth(ichatcomponent.getFormattedText())); + } + + this.field_152334_t = this.width / 2 - k / 2; + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.enabled) + { + if (button.id == 0) + { + this.stream.func_152917_b("/ban " + this.field_152337_h.displayName); + } + else if (button.id == 3) + { + this.stream.func_152917_b("/unban " + this.field_152337_h.displayName); + } + else if (button.id == 2) + { + this.stream.func_152917_b("/mod " + this.field_152337_h.displayName); + } + else if (button.id == 4) + { + this.stream.func_152917_b("/unmod " + this.field_152337_h.displayName); + } + else if (button.id == 1) + { + this.stream.func_152917_b("/timeout " + this.field_152337_h.displayName); + } + + this.mc.displayGuiScreen((GuiScreen)null); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_152338_i.getUnformattedText(), this.width / 2, 70, 16777215); + int i = 80; + + for (IChatComponent ichatcomponent : this.field_152332_r) + { + this.drawString(this.fontRendererObj, ichatcomponent.getFormattedText(), this.field_152334_t, i, 16777215); + i += this.fontRendererObj.FONT_HEIGHT; + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/main/GameConfiguration.java b/Client-1.8.9/src/main/java/net/minecraft/client/main/GameConfiguration.java new file mode 100644 index 0000000..36f7251 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/main/GameConfiguration.java @@ -0,0 +1,96 @@ +package net.minecraft.client.main; + +import com.mojang.authlib.properties.PropertyMap; +import java.io.File; +import java.net.Proxy; +import net.minecraft.util.Session; + +public class GameConfiguration +{ + public final GameConfiguration.UserInformation userInfo; + public final GameConfiguration.DisplayInformation displayInfo; + public final GameConfiguration.FolderInformation folderInfo; + public final GameConfiguration.GameInformation gameInfo; + public final GameConfiguration.ServerInformation serverInfo; + + public GameConfiguration(GameConfiguration.UserInformation userInfoIn, GameConfiguration.DisplayInformation displayInfoIn, GameConfiguration.FolderInformation folderInfoIn, GameConfiguration.GameInformation gameInfoIn, GameConfiguration.ServerInformation serverInfoIn) + { + this.userInfo = userInfoIn; + this.displayInfo = displayInfoIn; + this.folderInfo = folderInfoIn; + this.gameInfo = gameInfoIn; + this.serverInfo = serverInfoIn; + } + + public static class DisplayInformation + { + public final int width; + public final int height; + public final boolean fullscreen; + public final boolean checkGlErrors; + + public DisplayInformation(int widthIn, int heightIn, boolean fullscreenIn, boolean checkGlErrorsIn) + { + this.width = widthIn; + this.height = heightIn; + this.fullscreen = fullscreenIn; + this.checkGlErrors = checkGlErrorsIn; + } + } + + public static class FolderInformation + { + public final File mcDataDir; + public final File resourcePacksDir; + public final File assetsDir; + public final String assetIndex; + + public FolderInformation(File mcDataDirIn, File resourcePacksDirIn, File assetsDirIn, String assetIndexIn) + { + this.mcDataDir = mcDataDirIn; + this.resourcePacksDir = resourcePacksDirIn; + this.assetsDir = assetsDirIn; + this.assetIndex = assetIndexIn; + } + } + + public static class GameInformation + { + public final boolean isDemo; + public final String version; + + public GameInformation(boolean isDemoIn, String versionIn) + { + this.isDemo = isDemoIn; + this.version = versionIn; + } + } + + public static class ServerInformation + { + public final String serverName; + public final int serverPort; + + public ServerInformation(String serverNameIn, int serverPortIn) + { + this.serverName = serverNameIn; + this.serverPort = serverPortIn; + } + } + + public static class UserInformation + { + public final Session session; + public final PropertyMap userProperties; + public final PropertyMap profileProperties; + public final Proxy proxy; + + public UserInformation(Session sessionIn, PropertyMap userPropertiesIn, PropertyMap profilePropertiesIn, Proxy proxyIn) + { + this.session = sessionIn; + this.userProperties = userPropertiesIn; + this.profileProperties = profilePropertiesIn; + this.proxy = proxyIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/main/Main.java b/Client-1.8.9/src/main/java/net/minecraft/client/main/Main.java new file mode 100644 index 0000000..c48ac32 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/main/Main.java @@ -0,0 +1,120 @@ +package net.minecraft.client.main; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.mojang.authlib.properties.PropertyMap; +import com.mojang.authlib.properties.PropertyMap.Serializer; +import java.io.File; +import java.net.Authenticator; +import java.net.InetSocketAddress; +import java.net.PasswordAuthentication; +import java.net.Proxy; +import java.net.Proxy.Type; +import java.util.List; +import joptsimple.OptionParser; +import joptsimple.OptionSet; +import joptsimple.OptionSpec; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; + +public class Main +{ + public static void main(String[] p_main_0_) + { + System.setProperty("java.net.preferIPv4Stack", "true"); + OptionParser optionparser = new OptionParser(); + optionparser.allowsUnrecognizedOptions(); + optionparser.accepts("demo"); + optionparser.accepts("fullscreen"); + optionparser.accepts("checkGlErrors"); + OptionSpec optionspec = optionparser.accepts("server").withRequiredArg(); + OptionSpec optionspec1 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(25565), new Integer[0]); + OptionSpec optionspec2 = optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File("."), new File[0]); + OptionSpec optionspec3 = optionparser.accepts("assetsDir").withRequiredArg().ofType(File.class); + OptionSpec optionspec4 = optionparser.accepts("resourcePackDir").withRequiredArg().ofType(File.class); + OptionSpec optionspec5 = optionparser.accepts("proxyHost").withRequiredArg(); + OptionSpec optionspec6 = optionparser.accepts("proxyPort").withRequiredArg().defaultsTo("8080", new String[0]).ofType(Integer.class); + OptionSpec optionspec7 = optionparser.accepts("proxyUser").withRequiredArg(); + OptionSpec optionspec8 = optionparser.accepts("proxyPass").withRequiredArg(); + OptionSpec optionspec9 = optionparser.accepts("username").withRequiredArg().defaultsTo("Player" + Minecraft.getSystemTime() % 1000L, new String[0]); + OptionSpec optionspec10 = optionparser.accepts("uuid").withRequiredArg(); + OptionSpec optionspec11 = optionparser.accepts("accessToken").withOptionalArg(); + OptionSpec optionspec12 = optionparser.accepts("version").withRequiredArg().required(); + OptionSpec optionspec13 = optionparser.accepts("width").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(854), new Integer[0]); + OptionSpec optionspec14 = optionparser.accepts("height").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(480), new Integer[0]); + OptionSpec optionspec15 = optionparser.accepts("userProperties").withRequiredArg().defaultsTo("{}", new String[0]); + OptionSpec optionspec16 = optionparser.accepts("profileProperties").withRequiredArg().defaultsTo("{}", new String[0]); + OptionSpec optionspec17 = optionparser.accepts("assetIndex").withRequiredArg(); + OptionSpec optionspec18 = optionparser.accepts("userType").withRequiredArg().defaultsTo("legacy", new String[0]); + OptionSpec optionspec19 = optionparser.nonOptions(); + OptionSet optionset = optionparser.parse(p_main_0_); + List list = optionset.valuesOf(optionspec19); + + if (!list.isEmpty()) + { + System.out.println("Completely ignored arguments: " + list); + } + + String s = (String)optionset.valueOf(optionspec5); + Proxy proxy = Proxy.NO_PROXY; + + if (s != null) + { + try + { + proxy = new Proxy(Type.SOCKS, new InetSocketAddress(s, ((Integer)optionset.valueOf(optionspec6)).intValue())); + } + catch (Exception var46) + { + ; + } + } + + final String s1 = (String)optionset.valueOf(optionspec7); + final String s2 = (String)optionset.valueOf(optionspec8); + + if (!proxy.equals(Proxy.NO_PROXY) && isNullOrEmpty(s1) && isNullOrEmpty(s2)) + { + Authenticator.setDefault(new Authenticator() + { + protected PasswordAuthentication getPasswordAuthentication() + { + return new PasswordAuthentication(s1, s2.toCharArray()); + } + }); + } + + int i = ((Integer)optionset.valueOf(optionspec13)).intValue(); + int j = ((Integer)optionset.valueOf(optionspec14)).intValue(); + boolean flag = optionset.has("fullscreen"); + boolean flag1 = optionset.has("checkGlErrors"); + boolean flag2 = optionset.has("demo"); + String s3 = (String)optionset.valueOf(optionspec12); + Gson gson = (new GsonBuilder()).registerTypeAdapter(PropertyMap.class, new Serializer()).create(); + PropertyMap propertymap = (PropertyMap)gson.fromJson((String)optionset.valueOf(optionspec15), PropertyMap.class); + PropertyMap propertymap1 = (PropertyMap)gson.fromJson((String)optionset.valueOf(optionspec16), PropertyMap.class); + File file1 = (File)optionset.valueOf(optionspec2); + File file2 = optionset.has(optionspec3) ? (File)optionset.valueOf(optionspec3) : new File(file1, "assets/"); + File file3 = optionset.has(optionspec4) ? (File)optionset.valueOf(optionspec4) : new File(file1, "resourcepacks/"); + String s4 = optionset.has(optionspec10) ? (String)optionspec10.value(optionset) : (String)optionspec9.value(optionset); + String s5 = optionset.has(optionspec17) ? (String)optionspec17.value(optionset) : null; + String s6 = (String)optionset.valueOf(optionspec); + Integer integer = (Integer)optionset.valueOf(optionspec1); + Session session = new Session((String)optionspec9.value(optionset), s4, (String)optionspec11.value(optionset), (String)optionspec18.value(optionset)); + GameConfiguration gameconfiguration = new GameConfiguration(new GameConfiguration.UserInformation(session, propertymap, propertymap1, proxy), new GameConfiguration.DisplayInformation(i, j, flag, flag1), new GameConfiguration.FolderInformation(file1, file3, file2, s5), new GameConfiguration.GameInformation(flag2, s3), new GameConfiguration.ServerInformation(s6, integer.intValue())); + Runtime.getRuntime().addShutdownHook(new Thread("Client Shutdown Thread") + { + public void run() + { + Minecraft.stopIntegratedServer(); + } + }); + Thread.currentThread().setName("Client thread"); + (new Minecraft(gameconfiguration)).run(); + } + + private static boolean isNullOrEmpty(String str) + { + return str != null && !str.isEmpty(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelArmorStand.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelArmorStand.java new file mode 100644 index 0000000..a6b16c6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelArmorStand.java @@ -0,0 +1,125 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; + +public class ModelArmorStand extends ModelArmorStandArmor +{ + public ModelRenderer standRightSide; + public ModelRenderer standLeftSide; + public ModelRenderer standWaist; + public ModelRenderer standBase; + + public ModelArmorStand() + { + this(0.0F); + } + + public ModelArmorStand(float p_i46306_1_) + { + super(p_i46306_1_, 64, 64); + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-1.0F, -7.0F, -1.0F, 2, 7, 2, p_i46306_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F); + this.bipedBody = new ModelRenderer(this, 0, 26); + this.bipedBody.addBox(-6.0F, 0.0F, -1.5F, 12, 3, 3, p_i46306_1_); + this.bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 24, 0); + this.bipedRightArm.addBox(-2.0F, -2.0F, -1.0F, 2, 12, 2, p_i46306_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 32, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(0.0F, -2.0F, -1.0F, 2, 12, 2, p_i46306_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 8, 0); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 11, 2, p_i46306_1_); + this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 40, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 11, 2, p_i46306_1_); + this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F); + this.standRightSide = new ModelRenderer(this, 16, 0); + this.standRightSide.addBox(-3.0F, 3.0F, -1.0F, 2, 7, 2, p_i46306_1_); + this.standRightSide.setRotationPoint(0.0F, 0.0F, 0.0F); + this.standRightSide.showModel = true; + this.standLeftSide = new ModelRenderer(this, 48, 16); + this.standLeftSide.addBox(1.0F, 3.0F, -1.0F, 2, 7, 2, p_i46306_1_); + this.standLeftSide.setRotationPoint(0.0F, 0.0F, 0.0F); + this.standWaist = new ModelRenderer(this, 0, 48); + this.standWaist.addBox(-4.0F, 10.0F, -1.0F, 8, 2, 2, p_i46306_1_); + this.standWaist.setRotationPoint(0.0F, 0.0F, 0.0F); + this.standBase = new ModelRenderer(this, 0, 32); + this.standBase.addBox(-6.0F, 11.0F, -6.0F, 12, 1, 12, p_i46306_1_); + this.standBase.setRotationPoint(0.0F, 12.0F, 0.0F); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + + if (entityIn instanceof EntityArmorStand) + { + EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn; + this.bipedLeftArm.showModel = entityarmorstand.getShowArms(); + this.bipedRightArm.showModel = entityarmorstand.getShowArms(); + this.standBase.showModel = !entityarmorstand.hasNoBasePlate(); + this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F); + this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F); + this.standRightSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); + this.standRightSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); + this.standRightSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); + this.standLeftSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); + this.standLeftSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); + this.standLeftSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); + this.standWaist.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); + this.standWaist.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); + this.standWaist.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); + float f = (entityarmorstand.getLeftLegRotation().getX() + entityarmorstand.getRightLegRotation().getX()) / 2.0F; + float f1 = (entityarmorstand.getLeftLegRotation().getY() + entityarmorstand.getRightLegRotation().getY()) / 2.0F; + float f2 = (entityarmorstand.getLeftLegRotation().getZ() + entityarmorstand.getRightLegRotation().getZ()) / 2.0F; + this.standBase.rotateAngleX = 0.0F; + this.standBase.rotateAngleY = 0.017453292F * -entityIn.rotationYaw; + this.standBase.rotateAngleZ = 0.0F; + } + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); + GlStateManager.pushMatrix(); + + if (this.isChild) + { + float f = 2.0F; + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.standRightSide.render(scale); + this.standLeftSide.render(scale); + this.standWaist.render(scale); + this.standBase.render(scale); + } + else + { + if (entityIn.isSneaking()) + { + GlStateManager.translate(0.0F, 0.2F, 0.0F); + } + + this.standRightSide.render(scale); + this.standLeftSide.render(scale); + this.standWaist.render(scale); + this.standBase.render(scale); + } + + GlStateManager.popMatrix(); + } + + public void postRenderArm(float scale) + { + boolean flag = this.bipedRightArm.showModel; + this.bipedRightArm.showModel = true; + super.postRenderArm(scale); + this.bipedRightArm.showModel = flag; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelArmorStandArmor.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelArmorStandArmor.java new file mode 100644 index 0000000..3a361fb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelArmorStandArmor.java @@ -0,0 +1,52 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; + +public class ModelArmorStandArmor extends ModelBiped +{ + public ModelArmorStandArmor() + { + this(0.0F); + } + + public ModelArmorStandArmor(float modelSize) + { + this(modelSize, 64, 32); + } + + protected ModelArmorStandArmor(float modelSize, int textureWidthIn, int textureHeightIn) + { + super(modelSize, 0.0F, textureWidthIn, textureHeightIn); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + if (entityIn instanceof EntityArmorStand) + { + EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn; + this.bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX(); + this.bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY(); + this.bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ(); + this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F); + this.bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); + this.bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); + this.bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); + this.bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX(); + this.bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY(); + this.bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ(); + this.bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX(); + this.bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY(); + this.bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ(); + this.bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX(); + this.bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY(); + this.bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ(); + this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F); + this.bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX(); + this.bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY(); + this.bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ(); + this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F); + copyModelAngles(this.bipedHead, this.bipedHeadwear); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBanner.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBanner.java new file mode 100644 index 0000000..57f34b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBanner.java @@ -0,0 +1,28 @@ +package net.minecraft.client.model; + +public class ModelBanner extends ModelBase +{ + public ModelRenderer bannerSlate; + public ModelRenderer bannerStand; + public ModelRenderer bannerTop; + + public ModelBanner() + { + this.textureWidth = 64; + this.textureHeight = 64; + this.bannerSlate = new ModelRenderer(this, 0, 0); + this.bannerSlate.addBox(-10.0F, 0.0F, -2.0F, 20, 40, 1, 0.0F); + this.bannerStand = new ModelRenderer(this, 44, 0); + this.bannerStand.addBox(-1.0F, -30.0F, -1.0F, 2, 42, 2, 0.0F); + this.bannerTop = new ModelRenderer(this, 0, 42); + this.bannerTop.addBox(-10.0F, -32.0F, -1.0F, 20, 2, 2, 0.0F); + } + + public void renderBanner() + { + this.bannerSlate.rotationPointY = -32.0F; + this.bannerSlate.render(0.0625F); + this.bannerStand.render(0.0625F); + this.bannerTop.render(0.0625F); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBase.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBase.java new file mode 100644 index 0000000..183d6a4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBase.java @@ -0,0 +1,60 @@ +package net.minecraft.client.model; + +import com.google.common.collect.*; +import java.util.*; +import net.minecraft.entity.*; + +public abstract class ModelBase +{ + public float swingProgress; + public boolean isRiding; + public boolean isChild = true; + public List boxList = Lists.newArrayList(); + private final Map modelTextureMap = Maps.newHashMap(); + public int textureWidth = 64; + public int textureHeight = 32; + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + } + + public ModelRenderer getRandomModelBox(Random rand) + { + return this.boxList.get(rand.nextInt(this.boxList.size())); + } + + protected void setTextureOffset(String partName, int x, int y) + { + this.modelTextureMap.put(partName, new TextureOffset(x, y)); + } + + public TextureOffset getTextureOffset(String partName) + { + return this.modelTextureMap.get(partName); + } + + public static void copyModelAngles(ModelRenderer source, ModelRenderer dest) + { + dest.rotateAngleX = source.rotateAngleX; + dest.rotateAngleY = source.rotateAngleY; + dest.rotateAngleZ = source.rotateAngleZ; + dest.rotationPointX = source.rotationPointX; + dest.rotationPointY = source.rotationPointY; + dest.rotationPointZ = source.rotationPointZ; + } + + public void setModelAttributes(ModelBase model) + { + this.swingProgress = model.swingProgress; + this.isRiding = model.isRiding; + this.isChild = model.isChild; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBat.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBat.java new file mode 100644 index 0000000..ef3060f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBat.java @@ -0,0 +1,93 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.util.MathHelper; + +public class ModelBat extends ModelBase +{ + private ModelRenderer batHead; + private ModelRenderer batBody; + private ModelRenderer batRightWing; + private ModelRenderer batLeftWing; + private ModelRenderer batOuterRightWing; + private ModelRenderer batOuterLeftWing; + + public ModelBat() + { + this.textureWidth = 64; + this.textureHeight = 64; + this.batHead = new ModelRenderer(this, 0, 0); + this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6); + ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0); + modelrenderer.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(modelrenderer); + ModelRenderer modelrenderer1 = new ModelRenderer(this, 24, 0); + modelrenderer1.mirror = true; + modelrenderer1.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(modelrenderer1); + this.batBody = new ModelRenderer(this, 0, 16); + this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6); + this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1); + this.batRightWing = new ModelRenderer(this, 42, 0); + this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterRightWing = new ModelRenderer(this, 24, 16); + this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F); + this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1); + this.batLeftWing = new ModelRenderer(this, 42, 0); + this.batLeftWing.mirror = true; + this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterLeftWing = new ModelRenderer(this, 24, 16); + this.batOuterLeftWing.mirror = true; + this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F); + this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1); + this.batBody.addChild(this.batRightWing); + this.batBody.addChild(this.batLeftWing); + this.batRightWing.addChild(this.batOuterRightWing); + this.batLeftWing.addChild(this.batOuterLeftWing); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.batHead.render(scale); + this.batBody.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + if (((EntityBat)entityIn).getIsBatHanging()) + { + float f = (180F / (float)Math.PI); + this.batHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.batHead.rotateAngleY = (float)Math.PI - netHeadYaw / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = (float)Math.PI; + this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); + this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); + this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); + this.batBody.rotateAngleX = (float)Math.PI; + this.batRightWing.rotateAngleX = -0.15707964F; + this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); + this.batOuterRightWing.rotateAngleY = -1.7278761F; + this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; + } + else + { + float f1 = (180F / (float)Math.PI); + this.batHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.batHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = 0.0F; + this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(ageInTicks * 0.1F) * 0.15F; + this.batBody.rotateAngleY = 0.0F; + this.batRightWing.rotateAngleY = MathHelper.cos(ageInTicks * 1.3F) * (float)Math.PI * 0.25F; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; + this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBiped.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBiped.java new file mode 100644 index 0000000..ea27a37 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBiped.java @@ -0,0 +1,246 @@ +package net.minecraft.client.model; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.CosmeticManager; +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.cosmetic.data.AnimationStage; +import com.cheatbreaker.client.event.impl.render.PlayerAnimationEvent; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelBiped extends ModelBase { + public ModelRenderer bipedHead; + public ModelRenderer bipedHeadwear; + public ModelRenderer bipedBody; + public ModelRenderer bipedRightArm; + public ModelRenderer bipedLeftArm; + public ModelRenderer bipedRightLeg; + public ModelRenderer bipedLeftLeg; + + public int heldItemLeft; + public int heldItemRight; + public boolean isSneak; + public boolean aimedBow; + + public ModelBiped() { + this(0.0F); + } + + public ModelBiped(float modelSize) { + this(modelSize, 0.0F, 64, 32); + } + + public ModelBiped(float modelSize, float p_i1149_2_, int textureWidthIn, int textureHeightIn) { + this.textureWidth = textureWidthIn; + this.textureHeight = textureHeightIn; + + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, modelSize); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + + this.bipedHeadwear = new ModelRenderer(this, 32, 0); + this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, modelSize + 0.5F); + this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + + this.bipedBody = new ModelRenderer(this, 16, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, modelSize); + this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, modelSize); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F); + + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, modelSize); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F); + + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, modelSize); + this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F); + + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, modelSize); + this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + if (entityIn instanceof AbstractClientPlayer && this instanceof ModelPlayer) { + CheatBreaker.getInstance().getEventBus().handleEvent(new PlayerAnimationEvent(AnimationStage.START, (AbstractClientPlayer) entityIn, (ModelPlayer) this, scale)); + } + GlStateManager.pushMatrix(); + + if (this.isChild) { + float f = 2.0F; + GlStateManager.scale(1.5F / f, 1.5F / f, 1.5F / f); + GlStateManager.translate(0.0F, 16.0F * scale, 0.0F); + this.bipedHead.render(scale); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.bipedBody.render(scale); + this.bipedRightArm.render(scale); + this.bipedLeftArm.render(scale); + this.bipedRightLeg.render(scale); + this.bipedLeftLeg.render(scale); + this.bipedHeadwear.render(scale); + } else { + if (entityIn.isSneaking()) { + GlStateManager.translate(0.0F, 0.2F, 0.0F); + } + + this.bipedHead.render(scale); + this.bipedBody.render(scale); + this.bipedRightArm.render(scale); + this.bipedLeftArm.render(scale); + this.bipedRightLeg.render(scale); + this.bipedLeftLeg.render(scale); + this.bipedHeadwear.render(scale); + } + + GlStateManager.popMatrix(); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { + this.bipedHead.rotateAngleY = netHeadYaw / (180F / (float) Math.PI); + this.bipedHead.rotateAngleX = headPitch / (180F / (float) Math.PI); + this.bipedRightArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 2.0F * limbSwingAmount * 0.5F; + this.bipedLeftArm.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount; + this.bipedLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount; + this.bipedRightLeg.rotateAngleY = 0.0F; + this.bipedLeftLeg.rotateAngleY = 0.0F; + + if (this.isRiding) { + this.bipedRightArm.rotateAngleX += -((float) Math.PI / 5F); + this.bipedLeftArm.rotateAngleX += -((float) Math.PI / 5F); + this.bipedRightLeg.rotateAngleX = -((float) Math.PI * 2F / 5F); + this.bipedLeftLeg.rotateAngleX = -((float) Math.PI * 2F / 5F); + this.bipedRightLeg.rotateAngleY = ((float) Math.PI / 10F); + this.bipedLeftLeg.rotateAngleY = -((float) Math.PI / 10F); + } + + if (this.heldItemLeft != 0) { + this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F) * (float) this.heldItemLeft; + } + + this.bipedRightArm.rotateAngleY = 0.0F; + this.bipedRightArm.rotateAngleZ = 0.0F; + + switch (this.heldItemRight) { + case 0: + case 2: + default: + break; + + case 1: + this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F) * (float) this.heldItemRight; + break; + + case 3: + this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F) * (float) this.heldItemRight; + this.bipedRightArm.rotateAngleY = ModuleOneSevenVisuals.oldSwordBlock3.getBooleanValue() ? 0.0f : -0.5235988F; + } + + this.bipedLeftArm.rotateAngleY = 0.0F; + + if (this.swingProgress > -9990.0F) { + float f = this.swingProgress; + this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f) * (float) Math.PI * 2.0F) * 0.2F; + this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; + f = 1.0F - this.swingProgress; + f = f * f; + f = f * f; + f = 1.0F - f; + float f1 = MathHelper.sin(f * (float) Math.PI); + float f2 = MathHelper.sin(this.swingProgress * (float) Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; + this.bipedRightArm.rotateAngleX = (float) ((double) this.bipedRightArm.rotateAngleX - ((double) f1 * 1.2D + (double) f2)); + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; + this.bipedRightArm.rotateAngleZ += MathHelper.sin(this.swingProgress * (float) Math.PI) * -0.4F; + } + + CosmeticManager cosmeticManager = CheatBreaker.getInstance().getCosmeticManager(); + Emote currentEmote = cosmeticManager.getCurrentEmote(); + if (this.isSneak || (currentEmote != null && currentEmote.getName().equalsIgnoreCase("Naruto Run"))) { + this.bipedBody.rotateAngleX = 0.5F; + this.bipedRightArm.rotateAngleX += 0.4F; + this.bipedLeftArm.rotateAngleX += 0.4F; + this.bipedRightLeg.rotationPointZ = 4.0F; + this.bipedLeftLeg.rotationPointZ = 4.0F; + this.bipedRightLeg.rotationPointY = 9.0F; + this.bipedLeftLeg.rotationPointY = 9.0F; + this.bipedHead.rotationPointY = 1.0F; + } else { + this.bipedBody.rotateAngleX = 0.0F; + this.bipedRightLeg.rotationPointZ = 0.1F; + this.bipedLeftLeg.rotationPointZ = 0.1F; + this.bipedRightLeg.rotationPointY = 12.0F; + this.bipedLeftLeg.rotationPointY = 12.0F; + this.bipedHead.rotationPointY = 0.0F; + } + + this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + + if (this.aimedBow) { + float f3 = 0.0F; + float f4 = 0.0F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - f3 * 0.6F) + this.bipedHead.rotateAngleY; + this.bipedLeftArm.rotateAngleY = 0.1F - f3 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; + this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX -= f3 * 1.2F - f4 * 0.4F; + this.bipedLeftArm.rotateAngleX -= f3 * 1.2F - f4 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + } + + copyModelAngles(this.bipedHead, this.bipedHeadwear); + } + + public void setModelAttributes(ModelBase model) { + super.setModelAttributes(model); + + if (model instanceof ModelBiped) { + ModelBiped modelbiped = (ModelBiped) model; + this.heldItemLeft = modelbiped.heldItemLeft; + this.heldItemRight = modelbiped.heldItemRight; + this.isSneak = modelbiped.isSneak; + this.aimedBow = modelbiped.aimedBow; + } + } + + public void setInvisible(boolean invisible) { + this.bipedHead.showModel = invisible; + this.bipedHeadwear.showModel = invisible; + this.bipedBody.showModel = invisible; + this.bipedRightArm.showModel = invisible; + this.bipedLeftArm.showModel = invisible; + this.bipedRightLeg.showModel = invisible; + this.bipedLeftLeg.showModel = invisible; + } + + public void postRenderArm(float scale) { + this.bipedRightArm.postRender(scale); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBlaze.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBlaze.java new file mode 100644 index 0000000..bb4f26f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBlaze.java @@ -0,0 +1,69 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelBlaze extends ModelBase +{ + private ModelRenderer[] blazeSticks = new ModelRenderer[12]; + private ModelRenderer blazeHead; + + public ModelBlaze() + { + for (int i = 0; i < this.blazeSticks.length; ++i) + { + this.blazeSticks[i] = new ModelRenderer(this, 0, 16); + this.blazeSticks[i].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2); + } + + this.blazeHead = new ModelRenderer(this, 0, 0); + this.blazeHead.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.blazeHead.render(scale); + + for (int i = 0; i < this.blazeSticks.length; ++i) + { + this.blazeSticks[i].render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + float f = ageInTicks * (float)Math.PI * -0.1F; + + for (int i = 0; i < 4; ++i) + { + this.blazeSticks[i].rotationPointY = -2.0F + MathHelper.cos(((float)(i * 2) + ageInTicks) * 0.25F); + this.blazeSticks[i].rotationPointX = MathHelper.cos(f) * 9.0F; + this.blazeSticks[i].rotationPointZ = MathHelper.sin(f) * 9.0F; + ++f; + } + + f = ((float)Math.PI / 4F) + ageInTicks * (float)Math.PI * 0.03F; + + for (int j = 4; j < 8; ++j) + { + this.blazeSticks[j].rotationPointY = 2.0F + MathHelper.cos(((float)(j * 2) + ageInTicks) * 0.25F); + this.blazeSticks[j].rotationPointX = MathHelper.cos(f) * 7.0F; + this.blazeSticks[j].rotationPointZ = MathHelper.sin(f) * 7.0F; + ++f; + } + + f = 0.47123894F + ageInTicks * (float)Math.PI * -0.05F; + + for (int k = 8; k < 12; ++k) + { + this.blazeSticks[k].rotationPointY = 11.0F + MathHelper.cos(((float)k * 1.5F + ageInTicks) * 0.5F); + this.blazeSticks[k].rotationPointX = MathHelper.cos(f) * 5.0F; + this.blazeSticks[k].rotationPointZ = MathHelper.sin(f) * 5.0F; + ++f; + } + + this.blazeHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.blazeHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBoat.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBoat.java new file mode 100644 index 0000000..15a38c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBoat.java @@ -0,0 +1,43 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelBoat extends ModelBase +{ + public ModelRenderer[] boatSides = new ModelRenderer[5]; + + public ModelBoat() + { + this.boatSides[0] = new ModelRenderer(this, 0, 8); + this.boatSides[1] = new ModelRenderer(this, 0, 0); + this.boatSides[2] = new ModelRenderer(this, 0, 0); + this.boatSides[3] = new ModelRenderer(this, 0, 0); + this.boatSides[4] = new ModelRenderer(this, 0, 0); + int i = 24; + int j = 6; + int k = 20; + int l = 4; + this.boatSides[0].addBox((float)(-i / 2), (float)(-k / 2 + 2), -3.0F, i, k - 4, 4, 0.0F); + this.boatSides[0].setRotationPoint(0.0F, (float)l, 0.0F); + this.boatSides[1].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.boatSides[1].setRotationPoint((float)(-i / 2 + 1), (float)l, 0.0F); + this.boatSides[2].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.boatSides[2].setRotationPoint((float)(i / 2 - 1), (float)l, 0.0F); + this.boatSides[3].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.boatSides[3].setRotationPoint(0.0F, (float)l, (float)(-k / 2 + 1)); + this.boatSides[4].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.boatSides[4].setRotationPoint(0.0F, (float)l, (float)(k / 2 - 1)); + this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F); + this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F); + this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F); + this.boatSides[3].rotateAngleY = (float)Math.PI; + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + for (int i = 0; i < 5; ++i) + { + this.boatSides[i].render(scale); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBook.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBook.java new file mode 100644 index 0000000..25dc1ea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBook.java @@ -0,0 +1,49 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelBook extends ModelBase +{ + public ModelRenderer coverRight = (new ModelRenderer(this)).setTextureOffset(0, 0).addBox(-6.0F, -5.0F, 0.0F, 6, 10, 0); + public ModelRenderer coverLeft = (new ModelRenderer(this)).setTextureOffset(16, 0).addBox(0.0F, -5.0F, 0.0F, 6, 10, 0); + public ModelRenderer pagesRight = (new ModelRenderer(this)).setTextureOffset(0, 10).addBox(0.0F, -4.0F, -0.99F, 5, 8, 1); + public ModelRenderer pagesLeft = (new ModelRenderer(this)).setTextureOffset(12, 10).addBox(0.0F, -4.0F, -0.01F, 5, 8, 1); + public ModelRenderer flippingPageRight = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); + public ModelRenderer flippingPageLeft = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); + public ModelRenderer bookSpine = (new ModelRenderer(this)).setTextureOffset(12, 0).addBox(-1.0F, -5.0F, 0.0F, 2, 10, 0); + + public ModelBook() + { + this.coverRight.setRotationPoint(0.0F, 0.0F, -1.0F); + this.coverLeft.setRotationPoint(0.0F, 0.0F, 1.0F); + this.bookSpine.rotateAngleY = ((float)Math.PI / 2F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.coverRight.render(scale); + this.coverLeft.render(scale); + this.bookSpine.render(scale); + this.pagesRight.render(scale); + this.pagesLeft.render(scale); + this.flippingPageRight.render(scale); + this.flippingPageLeft.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + float f = (MathHelper.sin(limbSwing * 0.02F) * 0.1F + 1.25F) * netHeadYaw; + this.coverRight.rotateAngleY = (float)Math.PI + f; + this.coverLeft.rotateAngleY = -f; + this.pagesRight.rotateAngleY = f; + this.pagesLeft.rotateAngleY = -f; + this.flippingPageRight.rotateAngleY = f - f * 2.0F * limbSwingAmount; + this.flippingPageLeft.rotateAngleY = f - f * 2.0F * ageInTicks; + this.pagesRight.rotationPointX = MathHelper.sin(f); + this.pagesLeft.rotationPointX = MathHelper.sin(f); + this.flippingPageRight.rotationPointX = MathHelper.sin(f); + this.flippingPageLeft.rotationPointX = MathHelper.sin(f); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBox.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBox.java new file mode 100644 index 0000000..1800b3a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelBox.java @@ -0,0 +1,163 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.WorldRenderer; + +public class ModelBox +{ + private PositionTextureVertex[] vertexPositions; + private TexturedQuad[] quadList; + public final float posX1; + public final float posY1; + public final float posZ1; + public final float posX2; + public final float posY2; + public final float posZ2; + public String boxName; + + public ModelBox(ModelRenderer renderer, int p_i46359_2_, int p_i46359_3_, float p_i46359_4_, float p_i46359_5_, float p_i46359_6_, int p_i46359_7_, int p_i46359_8_, int p_i46359_9_, float p_i46359_10_) + { + this(renderer, p_i46359_2_, p_i46359_3_, p_i46359_4_, p_i46359_5_, p_i46359_6_, p_i46359_7_, p_i46359_8_, p_i46359_9_, p_i46359_10_, renderer.mirror); + } + + public ModelBox(ModelRenderer p_i0_1_, int[][] p_i0_2_, float p_i0_3_, float p_i0_4_, float p_i0_5_, float p_i0_6_, float p_i0_7_, float p_i0_8_, float p_i0_9_, boolean p_i0_10_) + { + this.posX1 = p_i0_3_; + this.posY1 = p_i0_4_; + this.posZ1 = p_i0_5_; + this.posX2 = p_i0_3_ + p_i0_6_; + this.posY2 = p_i0_4_ + p_i0_7_; + this.posZ2 = p_i0_5_ + p_i0_8_; + this.vertexPositions = new PositionTextureVertex[8]; + this.quadList = new TexturedQuad[6]; + float f = p_i0_3_ + p_i0_6_; + float f1 = p_i0_4_ + p_i0_7_; + float f2 = p_i0_5_ + p_i0_8_; + p_i0_3_ = p_i0_3_ - p_i0_9_; + p_i0_4_ = p_i0_4_ - p_i0_9_; + p_i0_5_ = p_i0_5_ - p_i0_9_; + f = f + p_i0_9_; + f1 = f1 + p_i0_9_; + f2 = f2 + p_i0_9_; + + if (p_i0_10_) + { + float f3 = f; + f = p_i0_3_; + p_i0_3_ = f3; + } + + PositionTextureVertex positiontexturevertex7 = new PositionTextureVertex(p_i0_3_, p_i0_4_, p_i0_5_, 0.0F, 0.0F); + PositionTextureVertex positiontexturevertex = new PositionTextureVertex(f, p_i0_4_, p_i0_5_, 0.0F, 8.0F); + PositionTextureVertex positiontexturevertex1 = new PositionTextureVertex(f, f1, p_i0_5_, 8.0F, 8.0F); + PositionTextureVertex positiontexturevertex2 = new PositionTextureVertex(p_i0_3_, f1, p_i0_5_, 8.0F, 0.0F); + PositionTextureVertex positiontexturevertex3 = new PositionTextureVertex(p_i0_3_, p_i0_4_, f2, 0.0F, 0.0F); + PositionTextureVertex positiontexturevertex4 = new PositionTextureVertex(f, p_i0_4_, f2, 0.0F, 8.0F); + PositionTextureVertex positiontexturevertex5 = new PositionTextureVertex(f, f1, f2, 8.0F, 8.0F); + PositionTextureVertex positiontexturevertex6 = new PositionTextureVertex(p_i0_3_, f1, f2, 8.0F, 0.0F); + this.vertexPositions[0] = positiontexturevertex7; + this.vertexPositions[1] = positiontexturevertex; + this.vertexPositions[2] = positiontexturevertex1; + this.vertexPositions[3] = positiontexturevertex2; + this.vertexPositions[4] = positiontexturevertex3; + this.vertexPositions[5] = positiontexturevertex4; + this.vertexPositions[6] = positiontexturevertex5; + this.vertexPositions[7] = positiontexturevertex6; + this.quadList[0] = this.makeTexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex, positiontexturevertex1, positiontexturevertex5}, p_i0_2_[4], false, p_i0_1_.textureWidth, p_i0_1_.textureHeight); + this.quadList[1] = this.makeTexturedQuad(new PositionTextureVertex[] {positiontexturevertex7, positiontexturevertex3, positiontexturevertex6, positiontexturevertex2}, p_i0_2_[5], false, p_i0_1_.textureWidth, p_i0_1_.textureHeight); + this.quadList[2] = this.makeTexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex3, positiontexturevertex7, positiontexturevertex}, p_i0_2_[1], true, p_i0_1_.textureWidth, p_i0_1_.textureHeight); + this.quadList[3] = this.makeTexturedQuad(new PositionTextureVertex[] {positiontexturevertex1, positiontexturevertex2, positiontexturevertex6, positiontexturevertex5}, p_i0_2_[0], true, p_i0_1_.textureWidth, p_i0_1_.textureHeight); + this.quadList[4] = this.makeTexturedQuad(new PositionTextureVertex[] {positiontexturevertex, positiontexturevertex7, positiontexturevertex2, positiontexturevertex1}, p_i0_2_[2], false, p_i0_1_.textureWidth, p_i0_1_.textureHeight); + this.quadList[5] = this.makeTexturedQuad(new PositionTextureVertex[] {positiontexturevertex3, positiontexturevertex4, positiontexturevertex5, positiontexturevertex6}, p_i0_2_[3], false, p_i0_1_.textureWidth, p_i0_1_.textureHeight); + + if (p_i0_10_) + { + for (TexturedQuad texturedquad : this.quadList) + { + texturedquad.flipFace(); + } + } + } + + private TexturedQuad makeTexturedQuad(PositionTextureVertex[] p_makeTexturedQuad_1_, int[] p_makeTexturedQuad_2_, boolean p_makeTexturedQuad_3_, float p_makeTexturedQuad_4_, float p_makeTexturedQuad_5_) + { + return p_makeTexturedQuad_2_ == null ? null : (p_makeTexturedQuad_3_ ? new TexturedQuad(p_makeTexturedQuad_1_, p_makeTexturedQuad_2_[2], p_makeTexturedQuad_2_[3], p_makeTexturedQuad_2_[0], p_makeTexturedQuad_2_[1], p_makeTexturedQuad_4_, p_makeTexturedQuad_5_) : new TexturedQuad(p_makeTexturedQuad_1_, p_makeTexturedQuad_2_[0], p_makeTexturedQuad_2_[1], p_makeTexturedQuad_2_[2], p_makeTexturedQuad_2_[3], p_makeTexturedQuad_4_, p_makeTexturedQuad_5_)); + } + + public ModelBox(ModelRenderer renderer, int textureX, int textureY, float p_i46301_4_, float p_i46301_5_, float p_i46301_6_, int p_i46301_7_, int p_i46301_8_, int p_i46301_9_, float p_i46301_10_, boolean p_i46301_11_) + { + this.posX1 = p_i46301_4_; + this.posY1 = p_i46301_5_; + this.posZ1 = p_i46301_6_; + this.posX2 = p_i46301_4_ + (float)p_i46301_7_; + this.posY2 = p_i46301_5_ + (float)p_i46301_8_; + this.posZ2 = p_i46301_6_ + (float)p_i46301_9_; + this.vertexPositions = new PositionTextureVertex[8]; + this.quadList = new TexturedQuad[6]; + float f = p_i46301_4_ + (float)p_i46301_7_; + float f1 = p_i46301_5_ + (float)p_i46301_8_; + float f2 = p_i46301_6_ + (float)p_i46301_9_; + p_i46301_4_ = p_i46301_4_ - p_i46301_10_; + p_i46301_5_ = p_i46301_5_ - p_i46301_10_; + p_i46301_6_ = p_i46301_6_ - p_i46301_10_; + f = f + p_i46301_10_; + f1 = f1 + p_i46301_10_; + f2 = f2 + p_i46301_10_; + + if (p_i46301_11_) + { + float f3 = f; + f = p_i46301_4_; + p_i46301_4_ = f3; + } + + PositionTextureVertex positiontexturevertex7 = new PositionTextureVertex(p_i46301_4_, p_i46301_5_, p_i46301_6_, 0.0F, 0.0F); + PositionTextureVertex positiontexturevertex = new PositionTextureVertex(f, p_i46301_5_, p_i46301_6_, 0.0F, 8.0F); + PositionTextureVertex positiontexturevertex1 = new PositionTextureVertex(f, f1, p_i46301_6_, 8.0F, 8.0F); + PositionTextureVertex positiontexturevertex2 = new PositionTextureVertex(p_i46301_4_, f1, p_i46301_6_, 8.0F, 0.0F); + PositionTextureVertex positiontexturevertex3 = new PositionTextureVertex(p_i46301_4_, p_i46301_5_, f2, 0.0F, 0.0F); + PositionTextureVertex positiontexturevertex4 = new PositionTextureVertex(f, p_i46301_5_, f2, 0.0F, 8.0F); + PositionTextureVertex positiontexturevertex5 = new PositionTextureVertex(f, f1, f2, 8.0F, 8.0F); + PositionTextureVertex positiontexturevertex6 = new PositionTextureVertex(p_i46301_4_, f1, f2, 8.0F, 0.0F); + this.vertexPositions[0] = positiontexturevertex7; + this.vertexPositions[1] = positiontexturevertex; + this.vertexPositions[2] = positiontexturevertex1; + this.vertexPositions[3] = positiontexturevertex2; + this.vertexPositions[4] = positiontexturevertex3; + this.vertexPositions[5] = positiontexturevertex4; + this.vertexPositions[6] = positiontexturevertex5; + this.vertexPositions[7] = positiontexturevertex6; + this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex, positiontexturevertex1, positiontexturevertex5}, textureX + p_i46301_9_ + p_i46301_7_, textureY + p_i46301_9_, textureX + p_i46301_9_ + p_i46301_7_ + p_i46301_9_, textureY + p_i46301_9_ + p_i46301_8_, renderer.textureWidth, renderer.textureHeight); + this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex7, positiontexturevertex3, positiontexturevertex6, positiontexturevertex2}, textureX, textureY + p_i46301_9_, textureX + p_i46301_9_, textureY + p_i46301_9_ + p_i46301_8_, renderer.textureWidth, renderer.textureHeight); + this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex3, positiontexturevertex7, positiontexturevertex}, textureX + p_i46301_9_, textureY, textureX + p_i46301_9_ + p_i46301_7_, textureY + p_i46301_9_, renderer.textureWidth, renderer.textureHeight); + this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex1, positiontexturevertex2, positiontexturevertex6, positiontexturevertex5}, textureX + p_i46301_9_ + p_i46301_7_, textureY + p_i46301_9_, textureX + p_i46301_9_ + p_i46301_7_ + p_i46301_7_, textureY, renderer.textureWidth, renderer.textureHeight); + this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex, positiontexturevertex7, positiontexturevertex2, positiontexturevertex1}, textureX + p_i46301_9_, textureY + p_i46301_9_, textureX + p_i46301_9_ + p_i46301_7_, textureY + p_i46301_9_ + p_i46301_8_, renderer.textureWidth, renderer.textureHeight); + this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex3, positiontexturevertex4, positiontexturevertex5, positiontexturevertex6}, textureX + p_i46301_9_ + p_i46301_7_ + p_i46301_9_, textureY + p_i46301_9_, textureX + p_i46301_9_ + p_i46301_7_ + p_i46301_9_ + p_i46301_7_, textureY + p_i46301_9_ + p_i46301_8_, renderer.textureWidth, renderer.textureHeight); + + if (p_i46301_11_) + { + for (int i = 0; i < this.quadList.length; ++i) + { + this.quadList[i].flipFace(); + } + } + } + + public void render(WorldRenderer renderer, float scale) + { + for (int i = 0; i < this.quadList.length; ++i) + { + TexturedQuad texturedquad = this.quadList[i]; + + if (texturedquad != null) + { + texturedquad.draw(renderer, scale); + } + } + } + + public ModelBox setBoxName(String name) + { + this.boxName = name; + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelChest.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelChest.java new file mode 100644 index 0000000..ad57b1c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelChest.java @@ -0,0 +1,34 @@ +package net.minecraft.client.model; + +public class ModelChest extends ModelBase +{ + public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + public ModelRenderer chestBelow; + public ModelRenderer chestKnob; + + public ModelChest() + { + this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F); + this.chestLid.rotationPointX = 1.0F; + this.chestLid.rotationPointY = 7.0F; + this.chestLid.rotationPointZ = 15.0F; + this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); + this.chestKnob.rotationPointX = 8.0F; + this.chestKnob.rotationPointY = 7.0F; + this.chestKnob.rotationPointZ = 15.0F; + this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(64, 64); + this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F); + this.chestBelow.rotationPointX = 1.0F; + this.chestBelow.rotationPointY = 6.0F; + this.chestBelow.rotationPointZ = 1.0F; + } + + public void renderAll() + { + this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX; + this.chestLid.render(0.0625F); + this.chestKnob.render(0.0625F); + this.chestBelow.render(0.0625F); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelChicken.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelChicken.java new file mode 100644 index 0000000..3cc7055 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelChicken.java @@ -0,0 +1,97 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelChicken extends ModelBase +{ + public ModelRenderer head; + public ModelRenderer body; + public ModelRenderer rightLeg; + public ModelRenderer leftLeg; + public ModelRenderer rightWing; + public ModelRenderer leftWing; + public ModelRenderer bill; + public ModelRenderer chin; + + public ModelChicken() + { + int i = 16; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F); + this.head.setRotationPoint(0.0F, (float)(-1 + i), -4.0F); + this.bill = new ModelRenderer(this, 14, 0); + this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F); + this.bill.setRotationPoint(0.0F, (float)(-1 + i), -4.0F); + this.chin = new ModelRenderer(this, 14, 4); + this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F); + this.chin.setRotationPoint(0.0F, (float)(-1 + i), -4.0F); + this.body = new ModelRenderer(this, 0, 9); + this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F); + this.body.setRotationPoint(0.0F, (float)i, 0.0F); + this.rightLeg = new ModelRenderer(this, 26, 0); + this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.rightLeg.setRotationPoint(-2.0F, (float)(3 + i), 1.0F); + this.leftLeg = new ModelRenderer(this, 26, 0); + this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.leftLeg.setRotationPoint(1.0F, (float)(3 + i), 1.0F); + this.rightWing = new ModelRenderer(this, 24, 13); + this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6); + this.rightWing.setRotationPoint(-4.0F, (float)(-3 + i), 0.0F); + this.leftWing = new ModelRenderer(this, 24, 13); + this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6); + this.leftWing.setRotationPoint(4.0F, (float)(-3 + i), 0.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + if (this.isChild) + { + float f = 2.0F; + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale); + this.head.render(scale); + this.bill.render(scale); + this.chin.render(scale); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.body.render(scale); + this.rightLeg.render(scale); + this.leftLeg.render(scale); + this.rightWing.render(scale); + this.leftWing.render(scale); + GlStateManager.popMatrix(); + } + else + { + this.head.render(scale); + this.bill.render(scale); + this.chin.render(scale); + this.body.render(scale); + this.rightLeg.render(scale); + this.leftLeg.render(scale); + this.rightWing.render(scale); + this.leftWing.render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + this.head.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.head.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.bill.rotateAngleX = this.head.rotateAngleX; + this.bill.rotateAngleY = this.head.rotateAngleY; + this.chin.rotateAngleX = this.head.rotateAngleX; + this.chin.rotateAngleY = this.head.rotateAngleY; + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.rightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount; + this.leftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount; + this.rightWing.rotateAngleZ = ageInTicks; + this.leftWing.rotateAngleZ = -ageInTicks; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelCow.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelCow.java new file mode 100644 index 0000000..343fec6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelCow.java @@ -0,0 +1,27 @@ +package net.minecraft.client.model; + +public class ModelCow extends ModelQuadruped +{ + public ModelCow() + { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-4.0F, -4.0F, -6.0F, 8, 8, 6, 0.0F); + this.head.setRotationPoint(0.0F, 4.0F, -8.0F); + this.head.setTextureOffset(22, 0).addBox(-5.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); + this.head.setTextureOffset(22, 0).addBox(4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); + this.body = new ModelRenderer(this, 18, 4); + this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, 0.0F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + this.body.setTextureOffset(52, 0).addBox(-2.0F, 2.0F, -8.0F, 4, 6, 1); + --this.leg1.rotationPointX; + ++this.leg2.rotationPointX; + this.leg1.rotationPointZ += 0.0F; + this.leg2.rotationPointZ += 0.0F; + --this.leg3.rotationPointX; + ++this.leg4.rotationPointX; + --this.leg3.rotationPointZ; + --this.leg4.rotationPointZ; + this.childZOffset += 2.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelCreeper.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelCreeper.java new file mode 100644 index 0000000..028e15b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelCreeper.java @@ -0,0 +1,67 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelCreeper extends ModelBase +{ + public ModelRenderer head; + public ModelRenderer creeperArmor; + public ModelRenderer body; + public ModelRenderer leg1; + public ModelRenderer leg2; + public ModelRenderer leg3; + public ModelRenderer leg4; + + public ModelCreeper() + { + this(0.0F); + } + + public ModelCreeper(float p_i46366_1_) + { + int i = 6; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46366_1_); + this.head.setRotationPoint(0.0F, (float)i, 0.0F); + this.creeperArmor = new ModelRenderer(this, 32, 0); + this.creeperArmor.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46366_1_ + 0.5F); + this.creeperArmor.setRotationPoint(0.0F, (float)i, 0.0F); + this.body = new ModelRenderer(this, 16, 16); + this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46366_1_); + this.body.setRotationPoint(0.0F, (float)i, 0.0F); + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg1.setRotationPoint(-2.0F, (float)(12 + i), 4.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg2.setRotationPoint(2.0F, (float)(12 + i), 4.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg3.setRotationPoint(-2.0F, (float)(12 + i), -4.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg4.setRotationPoint(2.0F, (float)(12 + i), -4.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.head.render(scale); + this.body.render(scale); + this.leg1.render(scale); + this.leg2.render(scale); + this.leg3.render(scale); + this.leg4.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + this.head.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.head.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.leg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount; + this.leg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount; + this.leg3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount; + this.leg4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelDragon.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelDragon.java new file mode 100644 index 0000000..3bdf68d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelDragon.java @@ -0,0 +1,227 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragon; + +public class ModelDragon extends ModelBase +{ + private ModelRenderer head; + private ModelRenderer spine; + private ModelRenderer jaw; + private ModelRenderer body; + private ModelRenderer rearLeg; + private ModelRenderer frontLeg; + private ModelRenderer rearLegTip; + private ModelRenderer frontLegTip; + private ModelRenderer rearFoot; + private ModelRenderer frontFoot; + private ModelRenderer wing; + private ModelRenderer wingTip; + private float partialTicks; + + public ModelDragon(float p_i46360_1_) + { + this.textureWidth = 256; + this.textureHeight = 256; + this.setTextureOffset("body.body", 0, 0); + this.setTextureOffset("wing.skin", -56, 88); + this.setTextureOffset("wingtip.skin", -56, 144); + this.setTextureOffset("rearleg.main", 0, 0); + this.setTextureOffset("rearfoot.main", 112, 0); + this.setTextureOffset("rearlegtip.main", 196, 0); + this.setTextureOffset("head.upperhead", 112, 30); + this.setTextureOffset("wing.bone", 112, 88); + this.setTextureOffset("head.upperlip", 176, 44); + this.setTextureOffset("jaw.jaw", 176, 65); + this.setTextureOffset("frontleg.main", 112, 104); + this.setTextureOffset("wingtip.bone", 112, 136); + this.setTextureOffset("frontfoot.main", 144, 104); + this.setTextureOffset("neck.box", 192, 104); + this.setTextureOffset("frontlegtip.main", 226, 138); + this.setTextureOffset("body.scale", 220, 53); + this.setTextureOffset("head.scale", 0, 0); + this.setTextureOffset("neck.scale", 48, 0); + this.setTextureOffset("head.nostril", 112, 0); + float f = -16.0F; + this.head = new ModelRenderer(this, "head"); + this.head.addBox("upperlip", -6.0F, -1.0F, -8.0F + f, 12, 5, 16); + this.head.addBox("upperhead", -8.0F, -8.0F, 6.0F + f, 16, 16, 16); + this.head.mirror = true; + this.head.addBox("scale", -5.0F, -12.0F, 12.0F + f, 2, 4, 6); + this.head.addBox("nostril", -5.0F, -3.0F, -6.0F + f, 2, 2, 4); + this.head.mirror = false; + this.head.addBox("scale", 3.0F, -12.0F, 12.0F + f, 2, 4, 6); + this.head.addBox("nostril", 3.0F, -3.0F, -6.0F + f, 2, 2, 4); + this.jaw = new ModelRenderer(this, "jaw"); + this.jaw.setRotationPoint(0.0F, 4.0F, 8.0F + f); + this.jaw.addBox("jaw", -6.0F, 0.0F, -16.0F, 12, 4, 16); + this.head.addChild(this.jaw); + this.spine = new ModelRenderer(this, "neck"); + this.spine.addBox("box", -5.0F, -5.0F, -5.0F, 10, 10, 10); + this.spine.addBox("scale", -1.0F, -9.0F, -3.0F, 2, 4, 6); + this.body = new ModelRenderer(this, "body"); + this.body.setRotationPoint(0.0F, 4.0F, 8.0F); + this.body.addBox("body", -12.0F, 0.0F, -16.0F, 24, 24, 64); + this.body.addBox("scale", -1.0F, -6.0F, -10.0F, 2, 6, 12); + this.body.addBox("scale", -1.0F, -6.0F, 10.0F, 2, 6, 12); + this.body.addBox("scale", -1.0F, -6.0F, 30.0F, 2, 6, 12); + this.wing = new ModelRenderer(this, "wing"); + this.wing.setRotationPoint(-12.0F, 5.0F, 2.0F); + this.wing.addBox("bone", -56.0F, -4.0F, -4.0F, 56, 8, 8); + this.wing.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); + this.wingTip = new ModelRenderer(this, "wingtip"); + this.wingTip.setRotationPoint(-56.0F, 0.0F, 0.0F); + this.wingTip.addBox("bone", -56.0F, -2.0F, -2.0F, 56, 4, 4); + this.wingTip.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); + this.wing.addChild(this.wingTip); + this.frontLeg = new ModelRenderer(this, "frontleg"); + this.frontLeg.setRotationPoint(-12.0F, 20.0F, 2.0F); + this.frontLeg.addBox("main", -4.0F, -4.0F, -4.0F, 8, 24, 8); + this.frontLegTip = new ModelRenderer(this, "frontlegtip"); + this.frontLegTip.setRotationPoint(0.0F, 20.0F, -1.0F); + this.frontLegTip.addBox("main", -3.0F, -1.0F, -3.0F, 6, 24, 6); + this.frontLeg.addChild(this.frontLegTip); + this.frontFoot = new ModelRenderer(this, "frontfoot"); + this.frontFoot.setRotationPoint(0.0F, 23.0F, 0.0F); + this.frontFoot.addBox("main", -4.0F, 0.0F, -12.0F, 8, 4, 16); + this.frontLegTip.addChild(this.frontFoot); + this.rearLeg = new ModelRenderer(this, "rearleg"); + this.rearLeg.setRotationPoint(-16.0F, 16.0F, 42.0F); + this.rearLeg.addBox("main", -8.0F, -4.0F, -8.0F, 16, 32, 16); + this.rearLegTip = new ModelRenderer(this, "rearlegtip"); + this.rearLegTip.setRotationPoint(0.0F, 32.0F, -4.0F); + this.rearLegTip.addBox("main", -6.0F, -2.0F, 0.0F, 12, 32, 12); + this.rearLeg.addChild(this.rearLegTip); + this.rearFoot = new ModelRenderer(this, "rearfoot"); + this.rearFoot.setRotationPoint(0.0F, 31.0F, 4.0F); + this.rearFoot.addBox("main", -9.0F, 0.0F, -20.0F, 18, 6, 24); + this.rearLegTip.addChild(this.rearFoot); + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + this.partialTicks = partialTickTime; + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + GlStateManager.pushMatrix(); + EntityDragon entitydragon = (EntityDragon)entityIn; + float f = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * this.partialTicks; + this.jaw.rotateAngleX = (float)(Math.sin((double)(f * (float)Math.PI * 2.0F)) + 1.0D) * 0.2F; + float f1 = (float)(Math.sin((double)(f * (float)Math.PI * 2.0F - 1.0F)) + 1.0D); + f1 = (f1 * f1 * 1.0F + f1 * 2.0F) * 0.05F; + GlStateManager.translate(0.0F, f1 - 2.0F, -3.0F); + GlStateManager.rotate(f1 * 2.0F, 1.0F, 0.0F, 0.0F); + float f2 = -30.0F; + float f4 = 0.0F; + float f5 = 1.5F; + double[] adouble = entitydragon.getMovementOffsets(6, this.partialTicks); + float f6 = this.updateRotations(entitydragon.getMovementOffsets(5, this.partialTicks)[0] - entitydragon.getMovementOffsets(10, this.partialTicks)[0]); + float f7 = this.updateRotations(entitydragon.getMovementOffsets(5, this.partialTicks)[0] + (double)(f6 / 2.0F)); + f2 = f2 + 2.0F; + float f8 = f * (float)Math.PI * 2.0F; + f2 = 20.0F; + float f3 = -12.0F; + + for (int i = 0; i < 5; ++i) + { + double[] adouble1 = entitydragon.getMovementOffsets(5 - i, this.partialTicks); + float f9 = (float)Math.cos((double)((float)i * 0.45F + f8)) * 0.15F; + this.spine.rotateAngleY = this.updateRotations(adouble1[0] - adouble[0]) * (float)Math.PI / 180.0F * f5; + this.spine.rotateAngleX = f9 + (float)(adouble1[1] - adouble[1]) * (float)Math.PI / 180.0F * f5 * 5.0F; + this.spine.rotateAngleZ = -this.updateRotations(adouble1[0] - (double)f7) * (float)Math.PI / 180.0F * f5; + this.spine.rotationPointY = f2; + this.spine.rotationPointZ = f3; + this.spine.rotationPointX = f4; + f2 = (float)((double)f2 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); + f3 = (float)((double)f3 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + f4 = (float)((double)f4 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + this.spine.render(scale); + } + + this.head.rotationPointY = f2; + this.head.rotationPointZ = f3; + this.head.rotationPointX = f4; + double[] adouble2 = entitydragon.getMovementOffsets(0, this.partialTicks); + this.head.rotateAngleY = this.updateRotations(adouble2[0] - adouble[0]) * (float)Math.PI / 180.0F * 1.0F; + this.head.rotateAngleZ = -this.updateRotations(adouble2[0] - (double)f7) * (float)Math.PI / 180.0F * 1.0F; + this.head.render(scale); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-f6 * f5 * 1.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.translate(0.0F, -1.0F, 0.0F); + this.body.rotateAngleZ = 0.0F; + this.body.render(scale); + + for (int j = 0; j < 2; ++j) + { + GlStateManager.enableCull(); + float f11 = f * (float)Math.PI * 2.0F; + this.wing.rotateAngleX = 0.125F - (float)Math.cos((double)f11) * 0.2F; + this.wing.rotateAngleY = 0.25F; + this.wing.rotateAngleZ = (float)(Math.sin((double)f11) + 0.125D) * 0.8F; + this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(f11 + 2.0F)) + 0.5D)) * 0.75F; + this.rearLeg.rotateAngleX = 1.0F + f1 * 0.1F; + this.rearLegTip.rotateAngleX = 0.5F + f1 * 0.1F; + this.rearFoot.rotateAngleX = 0.75F + f1 * 0.1F; + this.frontLeg.rotateAngleX = 1.3F + f1 * 0.1F; + this.frontLegTip.rotateAngleX = -0.5F - f1 * 0.1F; + this.frontFoot.rotateAngleX = 0.75F + f1 * 0.1F; + this.wing.render(scale); + this.frontLeg.render(scale); + this.rearLeg.render(scale); + GlStateManager.scale(-1.0F, 1.0F, 1.0F); + + if (j == 0) + { + GlStateManager.cullFace(1028); + } + } + + GlStateManager.popMatrix(); + GlStateManager.cullFace(1029); + GlStateManager.disableCull(); + float f10 = -((float)Math.sin((double)(f * (float)Math.PI * 2.0F))) * 0.0F; + f8 = f * (float)Math.PI * 2.0F; + f2 = 10.0F; + f3 = 60.0F; + f4 = 0.0F; + adouble = entitydragon.getMovementOffsets(11, this.partialTicks); + + for (int k = 0; k < 12; ++k) + { + adouble2 = entitydragon.getMovementOffsets(12 + k, this.partialTicks); + f10 = (float)((double)f10 + Math.sin((double)((float)k * 0.45F + f8)) * 0.05000000074505806D); + this.spine.rotateAngleY = (this.updateRotations(adouble2[0] - adouble[0]) * f5 + 180.0F) * (float)Math.PI / 180.0F; + this.spine.rotateAngleX = f10 + (float)(adouble2[1] - adouble[1]) * (float)Math.PI / 180.0F * f5 * 5.0F; + this.spine.rotateAngleZ = this.updateRotations(adouble2[0] - (double)f7) * (float)Math.PI / 180.0F * f5; + this.spine.rotationPointY = f2; + this.spine.rotationPointZ = f3; + this.spine.rotationPointX = f4; + f2 = (float)((double)f2 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); + f3 = (float)((double)f3 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + f4 = (float)((double)f4 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + this.spine.render(scale); + } + + GlStateManager.popMatrix(); + } + + private float updateRotations(double p_78214_1_) + { + while (p_78214_1_ >= 180.0D) + { + p_78214_1_ -= 360.0D; + } + + while (p_78214_1_ < -180.0D) + { + p_78214_1_ += 360.0D; + } + + return (float)p_78214_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java new file mode 100644 index 0000000..8359d36 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java @@ -0,0 +1,51 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; + +public class ModelEnderCrystal extends ModelBase +{ + private ModelRenderer cube; + private ModelRenderer glass = new ModelRenderer(this, "glass"); + private ModelRenderer base; + + public ModelEnderCrystal(float p_i1170_1_, boolean p_i1170_2_) + { + this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + this.cube = new ModelRenderer(this, "cube"); + this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + + if (p_i1170_2_) + { + this.base = new ModelRenderer(this, "base"); + this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12); + } + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + GlStateManager.pushMatrix(); + GlStateManager.scale(2.0F, 2.0F, 2.0F); + GlStateManager.translate(0.0F, -0.5F, 0.0F); + + if (this.base != null) + { + this.base.render(scale); + } + + GlStateManager.rotate(p_78088_3_, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, 0.8F + p_78088_4_, 0.0F); + GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F); + this.glass.render(scale); + float f = 0.875F; + GlStateManager.scale(f, f, f); + GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F); + GlStateManager.rotate(p_78088_3_, 0.0F, 1.0F, 0.0F); + this.glass.render(scale); + GlStateManager.scale(f, f, f); + GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F); + GlStateManager.rotate(p_78088_3_, 0.0F, 1.0F, 0.0F); + this.cube.render(scale); + GlStateManager.popMatrix(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderMite.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderMite.java new file mode 100644 index 0000000..bee5bb6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderMite.java @@ -0,0 +1,49 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelEnderMite extends ModelBase +{ + private static final int[][] field_178716_a = new int[][] {{4, 3, 2}, {6, 4, 5}, {3, 3, 1}, {1, 2, 1}}; + private static final int[][] field_178714_b = new int[][] {{0, 0}, {0, 5}, {0, 14}, {0, 18}}; + private static final int field_178715_c = field_178716_a.length; + private final ModelRenderer[] field_178713_d; + + public ModelEnderMite() + { + this.field_178713_d = new ModelRenderer[field_178715_c]; + float f = -3.5F; + + for (int i = 0; i < this.field_178713_d.length; ++i) + { + this.field_178713_d[i] = new ModelRenderer(this, field_178714_b[i][0], field_178714_b[i][1]); + this.field_178713_d[i].addBox((float)field_178716_a[i][0] * -0.5F, 0.0F, (float)field_178716_a[i][2] * -0.5F, field_178716_a[i][0], field_178716_a[i][1], field_178716_a[i][2]); + this.field_178713_d[i].setRotationPoint(0.0F, (float)(24 - field_178716_a[i][1]), f); + + if (i < this.field_178713_d.length - 1) + { + f += (float)(field_178716_a[i][2] + field_178716_a[i + 1][2]) * 0.5F; + } + } + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + for (int i = 0; i < this.field_178713_d.length; ++i) + { + this.field_178713_d[i].render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + for (int i = 0; i < this.field_178713_d.length; ++i) + { + this.field_178713_d[i].rotateAngleY = MathHelper.cos(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.01F * (float)(1 + Math.abs(i - 2)); + this.field_178713_d[i].rotationPointX = MathHelper.sin(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.1F * (float)Math.abs(i - 2); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderman.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderman.java new file mode 100644 index 0000000..45091a7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelEnderman.java @@ -0,0 +1,121 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelEnderman extends ModelBiped +{ + public boolean isCarrying; + public boolean isAttacking; + + public ModelEnderman(float p_i46305_1_) + { + super(0.0F, -14.0F, 64, 32); + float f = -14.0F; + this.bipedHeadwear = new ModelRenderer(this, 0, 16); + this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46305_1_ - 0.5F); + this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + f, 0.0F); + this.bipedBody = new ModelRenderer(this, 32, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46305_1_); + this.bipedBody.setRotationPoint(0.0F, 0.0F + f, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 56, 0); + this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, p_i46305_1_); + this.bipedRightArm.setRotationPoint(-3.0F, 2.0F + f, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 56, 0); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, p_i46305_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + f, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 56, 0); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, p_i46305_1_); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + f, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 56, 0); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, p_i46305_1_); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + f, 0.0F); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.bipedHead.showModel = true; + float f = -14.0F; + this.bipedBody.rotateAngleX = 0.0F; + this.bipedBody.rotationPointY = f; + this.bipedBody.rotationPointZ = -0.0F; + this.bipedRightLeg.rotateAngleX -= 0.0F; + this.bipedLeftLeg.rotateAngleX -= 0.0F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX * 0.5D); + this.bipedLeftArm.rotateAngleX = (float)((double)this.bipedLeftArm.rotateAngleX * 0.5D); + this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D); + this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D); + float f1 = 0.4F; + + if (this.bipedRightArm.rotateAngleX > f1) + { + this.bipedRightArm.rotateAngleX = f1; + } + + if (this.bipedLeftArm.rotateAngleX > f1) + { + this.bipedLeftArm.rotateAngleX = f1; + } + + if (this.bipedRightArm.rotateAngleX < -f1) + { + this.bipedRightArm.rotateAngleX = -f1; + } + + if (this.bipedLeftArm.rotateAngleX < -f1) + { + this.bipedLeftArm.rotateAngleX = -f1; + } + + if (this.bipedRightLeg.rotateAngleX > f1) + { + this.bipedRightLeg.rotateAngleX = f1; + } + + if (this.bipedLeftLeg.rotateAngleX > f1) + { + this.bipedLeftLeg.rotateAngleX = f1; + } + + if (this.bipedRightLeg.rotateAngleX < -f1) + { + this.bipedRightLeg.rotateAngleX = -f1; + } + + if (this.bipedLeftLeg.rotateAngleX < -f1) + { + this.bipedLeftLeg.rotateAngleX = -f1; + } + + if (this.isCarrying) + { + this.bipedRightArm.rotateAngleX = -0.5F; + this.bipedLeftArm.rotateAngleX = -0.5F; + this.bipedRightArm.rotateAngleZ = 0.05F; + this.bipedLeftArm.rotateAngleZ = -0.05F; + } + + this.bipedRightArm.rotationPointZ = 0.0F; + this.bipedLeftArm.rotationPointZ = 0.0F; + this.bipedRightLeg.rotationPointZ = 0.0F; + this.bipedLeftLeg.rotationPointZ = 0.0F; + this.bipedRightLeg.rotationPointY = 9.0F + f; + this.bipedLeftLeg.rotationPointY = 9.0F + f; + this.bipedHead.rotationPointZ = -0.0F; + this.bipedHead.rotationPointY = f + 1.0F; + this.bipedHeadwear.rotationPointX = this.bipedHead.rotationPointX; + this.bipedHeadwear.rotationPointY = this.bipedHead.rotationPointY; + this.bipedHeadwear.rotationPointZ = this.bipedHead.rotationPointZ; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ; + + if (this.isAttacking) + { + float f2 = 1.0F; + this.bipedHead.rotationPointY -= f2 * 5.0F; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelGhast.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelGhast.java new file mode 100644 index 0000000..8d16a10 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelGhast.java @@ -0,0 +1,56 @@ +package net.minecraft.client.model; + +import java.util.Random; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelGhast extends ModelBase +{ + ModelRenderer body; + ModelRenderer[] tentacles = new ModelRenderer[9]; + + public ModelGhast() + { + int i = -16; + this.body = new ModelRenderer(this, 0, 0); + this.body.addBox(-8.0F, -8.0F, -8.0F, 16, 16, 16); + this.body.rotationPointY += (float)(24 + i); + Random random = new Random(1660L); + + for (int j = 0; j < this.tentacles.length; ++j) + { + this.tentacles[j] = new ModelRenderer(this, 0, 0); + float f = (((float)(j % 3) - (float)(j / 3 % 2) * 0.5F + 0.25F) / 2.0F * 2.0F - 1.0F) * 5.0F; + float f1 = ((float)(j / 3) / 2.0F * 2.0F - 1.0F) * 5.0F; + int k = random.nextInt(7) + 8; + this.tentacles[j].addBox(-1.0F, 0.0F, -1.0F, 2, k, 2); + this.tentacles[j].rotationPointX = f; + this.tentacles[j].rotationPointZ = f1; + this.tentacles[j].rotationPointY = (float)(31 + i); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + for (int i = 0; i < this.tentacles.length; ++i) + { + this.tentacles[i].rotateAngleX = 0.2F * MathHelper.sin(ageInTicks * 0.3F + (float)i) + 0.4F; + } + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 0.6F, 0.0F); + this.body.render(scale); + + for (ModelRenderer modelrenderer : this.tentacles) + { + modelrenderer.render(scale); + } + + GlStateManager.popMatrix(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelGuardian.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelGuardian.java new file mode 100644 index 0000000..3362653 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelGuardian.java @@ -0,0 +1,128 @@ +package net.minecraft.client.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class ModelGuardian extends ModelBase +{ + private ModelRenderer guardianBody; + private ModelRenderer guardianEye; + private ModelRenderer[] guardianSpines; + private ModelRenderer[] guardianTail; + + public ModelGuardian() + { + this.textureWidth = 64; + this.textureHeight = 64; + this.guardianSpines = new ModelRenderer[12]; + this.guardianBody = new ModelRenderer(this); + this.guardianBody.setTextureOffset(0, 0).addBox(-6.0F, 10.0F, -8.0F, 12, 12, 16); + this.guardianBody.setTextureOffset(0, 28).addBox(-8.0F, 10.0F, -6.0F, 2, 12, 12); + this.guardianBody.setTextureOffset(0, 28).addBox(6.0F, 10.0F, -6.0F, 2, 12, 12, true); + this.guardianBody.setTextureOffset(16, 40).addBox(-6.0F, 8.0F, -6.0F, 12, 2, 12); + this.guardianBody.setTextureOffset(16, 40).addBox(-6.0F, 22.0F, -6.0F, 12, 2, 12); + + for (int i = 0; i < this.guardianSpines.length; ++i) + { + this.guardianSpines[i] = new ModelRenderer(this, 0, 0); + this.guardianSpines[i].addBox(-1.0F, -4.5F, -1.0F, 2, 9, 2); + this.guardianBody.addChild(this.guardianSpines[i]); + } + + this.guardianEye = new ModelRenderer(this, 8, 0); + this.guardianEye.addBox(-1.0F, 15.0F, 0.0F, 2, 2, 1); + this.guardianBody.addChild(this.guardianEye); + this.guardianTail = new ModelRenderer[3]; + this.guardianTail[0] = new ModelRenderer(this, 40, 0); + this.guardianTail[0].addBox(-2.0F, 14.0F, 7.0F, 4, 4, 8); + this.guardianTail[1] = new ModelRenderer(this, 0, 54); + this.guardianTail[1].addBox(0.0F, 14.0F, 0.0F, 3, 3, 7); + this.guardianTail[2] = new ModelRenderer(this); + this.guardianTail[2].setTextureOffset(41, 32).addBox(0.0F, 14.0F, 0.0F, 2, 2, 6); + this.guardianTail[2].setTextureOffset(25, 19).addBox(1.0F, 10.5F, 3.0F, 1, 9, 9); + this.guardianBody.addChild(this.guardianTail[0]); + this.guardianTail[0].addChild(this.guardianTail[1]); + this.guardianTail[1].addChild(this.guardianTail[2]); + } + + public int func_178706_a() + { + return 54; + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.guardianBody.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + EntityGuardian entityguardian = (EntityGuardian)entityIn; + float f = ageInTicks - (float)entityguardian.ticksExisted; + this.guardianBody.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.guardianBody.rotateAngleX = headPitch / (180F / (float)Math.PI); + float[] afloat = new float[] {1.75F, 0.25F, 0.0F, 0.0F, 0.5F, 0.5F, 0.5F, 0.5F, 1.25F, 0.75F, 0.0F, 0.0F}; + float[] afloat1 = new float[] {0.0F, 0.0F, 0.0F, 0.0F, 0.25F, 1.75F, 1.25F, 0.75F, 0.0F, 0.0F, 0.0F, 0.0F}; + float[] afloat2 = new float[] {0.0F, 0.0F, 0.25F, 1.75F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.75F, 1.25F}; + float[] afloat3 = new float[] {0.0F, 0.0F, 8.0F, -8.0F, -8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F, 8.0F, -8.0F}; + float[] afloat4 = new float[] { -8.0F, -8.0F, -8.0F, -8.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 8.0F, 8.0F}; + float[] afloat5 = new float[] {8.0F, -8.0F, 0.0F, 0.0F, -8.0F, -8.0F, 8.0F, 8.0F, 8.0F, -8.0F, 0.0F, 0.0F}; + float f1 = (1.0F - entityguardian.func_175469_o(f)) * 0.55F; + + for (int i = 0; i < 12; ++i) + { + this.guardianSpines[i].rotateAngleX = (float)Math.PI * afloat[i]; + this.guardianSpines[i].rotateAngleY = (float)Math.PI * afloat1[i]; + this.guardianSpines[i].rotateAngleZ = (float)Math.PI * afloat2[i]; + this.guardianSpines[i].rotationPointX = afloat3[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1); + this.guardianSpines[i].rotationPointY = 16.0F + afloat4[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1); + this.guardianSpines[i].rotationPointZ = afloat5[i] * (1.0F + MathHelper.cos(ageInTicks * 1.5F + (float)i) * 0.01F - f1); + } + + this.guardianEye.rotationPointZ = -8.25F; + Entity entity = Minecraft.getMinecraft().getRenderViewEntity(); + + if (entityguardian.hasTargetedEntity()) + { + entity = entityguardian.getTargetedEntity(); + } + + if (entity != null) + { + Vec3 vec3 = entity.getPositionEyes(0.0F); + Vec3 vec31 = entityIn.getPositionEyes(0.0F); + double d0 = vec3.yCoord - vec31.yCoord; + + if (d0 > 0.0D) + { + this.guardianEye.rotationPointY = 0.0F; + } + else + { + this.guardianEye.rotationPointY = 1.0F; + } + + Vec3 vec32 = entityIn.getLook(0.0F); + vec32 = new Vec3(vec32.xCoord, 0.0D, vec32.zCoord); + Vec3 vec33 = (new Vec3(vec31.xCoord - vec3.xCoord, 0.0D, vec31.zCoord - vec3.zCoord)).normalize().rotateYaw(((float)Math.PI / 2F)); + double d1 = vec32.dotProduct(vec33); + this.guardianEye.rotationPointX = MathHelper.sqrt_float((float)Math.abs(d1)) * 2.0F * (float)Math.signum(d1); + } + + this.guardianEye.showModel = true; + float f2 = entityguardian.func_175471_a(f); + this.guardianTail[0].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.05F; + this.guardianTail[1].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.1F; + this.guardianTail[1].rotationPointX = -1.5F; + this.guardianTail[1].rotationPointY = 0.5F; + this.guardianTail[1].rotationPointZ = 14.0F; + this.guardianTail[2].rotateAngleY = MathHelper.sin(f2) * (float)Math.PI * 0.15F; + this.guardianTail[2].rotationPointX = 0.5F; + this.guardianTail[2].rotationPointY = 0.5F; + this.guardianTail[2].rotationPointZ = 6.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelHorse.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelHorse.java new file mode 100644 index 0000000..725598f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelHorse.java @@ -0,0 +1,546 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.util.MathHelper; + +public class ModelHorse extends ModelBase +{ + private ModelRenderer head; + private ModelRenderer field_178711_b; + private ModelRenderer field_178712_c; + private ModelRenderer horseLeftEar; + private ModelRenderer horseRightEar; + private ModelRenderer muleLeftEar; + private ModelRenderer muleRightEar; + private ModelRenderer neck; + private ModelRenderer horseFaceRopes; + private ModelRenderer mane; + private ModelRenderer body; + private ModelRenderer tailBase; + private ModelRenderer tailMiddle; + private ModelRenderer tailTip; + private ModelRenderer backLeftLeg; + private ModelRenderer backLeftShin; + private ModelRenderer backLeftHoof; + private ModelRenderer backRightLeg; + private ModelRenderer backRightShin; + private ModelRenderer backRightHoof; + private ModelRenderer frontLeftLeg; + private ModelRenderer frontLeftShin; + private ModelRenderer frontLeftHoof; + private ModelRenderer frontRightLeg; + private ModelRenderer frontRightShin; + private ModelRenderer frontRightHoof; + private ModelRenderer muleLeftChest; + private ModelRenderer muleRightChest; + private ModelRenderer horseSaddleBottom; + private ModelRenderer horseSaddleFront; + private ModelRenderer horseSaddleBack; + private ModelRenderer horseLeftSaddleRope; + private ModelRenderer horseLeftSaddleMetal; + private ModelRenderer horseRightSaddleRope; + private ModelRenderer horseRightSaddleMetal; + private ModelRenderer horseLeftFaceMetal; + private ModelRenderer horseRightFaceMetal; + private ModelRenderer horseLeftRein; + private ModelRenderer horseRightRein; + + public ModelHorse() + { + this.textureWidth = 128; + this.textureHeight = 128; + this.body = new ModelRenderer(this, 0, 34); + this.body.addBox(-5.0F, -8.0F, -19.0F, 10, 10, 24); + this.body.setRotationPoint(0.0F, 11.0F, 9.0F); + this.tailBase = new ModelRenderer(this, 44, 0); + this.tailBase.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 3); + this.tailBase.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailBase, -1.134464F, 0.0F, 0.0F); + this.tailMiddle = new ModelRenderer(this, 38, 7); + this.tailMiddle.addBox(-1.5F, -2.0F, 3.0F, 3, 4, 7); + this.tailMiddle.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailMiddle, -1.134464F, 0.0F, 0.0F); + this.tailTip = new ModelRenderer(this, 24, 3); + this.tailTip.addBox(-1.5F, -4.5F, 9.0F, 3, 4, 7); + this.tailTip.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailTip, -1.40215F, 0.0F, 0.0F); + this.backLeftLeg = new ModelRenderer(this, 78, 29); + this.backLeftLeg.addBox(-2.5F, -2.0F, -2.5F, 4, 9, 5); + this.backLeftLeg.setRotationPoint(4.0F, 9.0F, 11.0F); + this.backLeftShin = new ModelRenderer(this, 78, 43); + this.backLeftShin.addBox(-2.0F, 0.0F, -1.5F, 3, 5, 3); + this.backLeftShin.setRotationPoint(4.0F, 16.0F, 11.0F); + this.backLeftHoof = new ModelRenderer(this, 78, 51); + this.backLeftHoof.addBox(-2.5F, 5.1F, -2.0F, 4, 3, 4); + this.backLeftHoof.setRotationPoint(4.0F, 16.0F, 11.0F); + this.backRightLeg = new ModelRenderer(this, 96, 29); + this.backRightLeg.addBox(-1.5F, -2.0F, -2.5F, 4, 9, 5); + this.backRightLeg.setRotationPoint(-4.0F, 9.0F, 11.0F); + this.backRightShin = new ModelRenderer(this, 96, 43); + this.backRightShin.addBox(-1.0F, 0.0F, -1.5F, 3, 5, 3); + this.backRightShin.setRotationPoint(-4.0F, 16.0F, 11.0F); + this.backRightHoof = new ModelRenderer(this, 96, 51); + this.backRightHoof.addBox(-1.5F, 5.1F, -2.0F, 4, 3, 4); + this.backRightHoof.setRotationPoint(-4.0F, 16.0F, 11.0F); + this.frontLeftLeg = new ModelRenderer(this, 44, 29); + this.frontLeftLeg.addBox(-1.9F, -1.0F, -2.1F, 3, 8, 4); + this.frontLeftLeg.setRotationPoint(4.0F, 9.0F, -8.0F); + this.frontLeftShin = new ModelRenderer(this, 44, 41); + this.frontLeftShin.addBox(-1.9F, 0.0F, -1.6F, 3, 5, 3); + this.frontLeftShin.setRotationPoint(4.0F, 16.0F, -8.0F); + this.frontLeftHoof = new ModelRenderer(this, 44, 51); + this.frontLeftHoof.addBox(-2.4F, 5.1F, -2.1F, 4, 3, 4); + this.frontLeftHoof.setRotationPoint(4.0F, 16.0F, -8.0F); + this.frontRightLeg = new ModelRenderer(this, 60, 29); + this.frontRightLeg.addBox(-1.1F, -1.0F, -2.1F, 3, 8, 4); + this.frontRightLeg.setRotationPoint(-4.0F, 9.0F, -8.0F); + this.frontRightShin = new ModelRenderer(this, 60, 41); + this.frontRightShin.addBox(-1.1F, 0.0F, -1.6F, 3, 5, 3); + this.frontRightShin.setRotationPoint(-4.0F, 16.0F, -8.0F); + this.frontRightHoof = new ModelRenderer(this, 60, 51); + this.frontRightHoof.addBox(-1.6F, 5.1F, -2.1F, 4, 3, 4); + this.frontRightHoof.setRotationPoint(-4.0F, 16.0F, -8.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-2.5F, -10.0F, -1.5F, 5, 5, 7); + this.head.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.head, 0.5235988F, 0.0F, 0.0F); + this.field_178711_b = new ModelRenderer(this, 24, 18); + this.field_178711_b.addBox(-2.0F, -10.0F, -7.0F, 4, 3, 6); + this.field_178711_b.setRotationPoint(0.0F, 3.95F, -10.0F); + this.setBoxRotation(this.field_178711_b, 0.5235988F, 0.0F, 0.0F); + this.field_178712_c = new ModelRenderer(this, 24, 27); + this.field_178712_c.addBox(-2.0F, -7.0F, -6.5F, 4, 2, 5); + this.field_178712_c.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.field_178712_c, 0.5235988F, 0.0F, 0.0F); + this.head.addChild(this.field_178711_b); + this.head.addChild(this.field_178712_c); + this.horseLeftEar = new ModelRenderer(this, 0, 0); + this.horseLeftEar.addBox(0.45F, -12.0F, 4.0F, 2, 3, 1); + this.horseLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseLeftEar, 0.5235988F, 0.0F, 0.0F); + this.horseRightEar = new ModelRenderer(this, 0, 0); + this.horseRightEar.addBox(-2.45F, -12.0F, 4.0F, 2, 3, 1); + this.horseRightEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseRightEar, 0.5235988F, 0.0F, 0.0F); + this.muleLeftEar = new ModelRenderer(this, 0, 12); + this.muleLeftEar.addBox(-2.0F, -16.0F, 4.0F, 2, 7, 1); + this.muleLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.muleLeftEar, 0.5235988F, 0.0F, 0.2617994F); + this.muleRightEar = new ModelRenderer(this, 0, 12); + this.muleRightEar.addBox(0.0F, -16.0F, 4.0F, 2, 7, 1); + this.muleRightEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.muleRightEar, 0.5235988F, 0.0F, -0.2617994F); + this.neck = new ModelRenderer(this, 0, 12); + this.neck.addBox(-2.05F, -9.8F, -2.0F, 4, 14, 8); + this.neck.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.neck, 0.5235988F, 0.0F, 0.0F); + this.muleLeftChest = new ModelRenderer(this, 0, 34); + this.muleLeftChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.muleLeftChest.setRotationPoint(-7.5F, 3.0F, 10.0F); + this.setBoxRotation(this.muleLeftChest, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.muleRightChest = new ModelRenderer(this, 0, 47); + this.muleRightChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.muleRightChest.setRotationPoint(4.5F, 3.0F, 10.0F); + this.setBoxRotation(this.muleRightChest, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.horseSaddleBottom = new ModelRenderer(this, 80, 0); + this.horseSaddleBottom.addBox(-5.0F, 0.0F, -3.0F, 10, 1, 8); + this.horseSaddleBottom.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseSaddleFront = new ModelRenderer(this, 106, 9); + this.horseSaddleFront.addBox(-1.5F, -1.0F, -3.0F, 3, 1, 2); + this.horseSaddleFront.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseSaddleBack = new ModelRenderer(this, 80, 9); + this.horseSaddleBack.addBox(-4.0F, -1.0F, 3.0F, 8, 1, 2); + this.horseSaddleBack.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseLeftSaddleMetal = new ModelRenderer(this, 74, 0); + this.horseLeftSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); + this.horseLeftSaddleMetal.setRotationPoint(5.0F, 3.0F, 2.0F); + this.horseLeftSaddleRope = new ModelRenderer(this, 70, 0); + this.horseLeftSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); + this.horseLeftSaddleRope.setRotationPoint(5.0F, 3.0F, 2.0F); + this.horseRightSaddleMetal = new ModelRenderer(this, 74, 4); + this.horseRightSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); + this.horseRightSaddleMetal.setRotationPoint(-5.0F, 3.0F, 2.0F); + this.horseRightSaddleRope = new ModelRenderer(this, 80, 0); + this.horseRightSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); + this.horseRightSaddleRope.setRotationPoint(-5.0F, 3.0F, 2.0F); + this.horseLeftFaceMetal = new ModelRenderer(this, 74, 13); + this.horseLeftFaceMetal.addBox(1.5F, -8.0F, -4.0F, 1, 2, 2); + this.horseLeftFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseLeftFaceMetal, 0.5235988F, 0.0F, 0.0F); + this.horseRightFaceMetal = new ModelRenderer(this, 74, 13); + this.horseRightFaceMetal.addBox(-2.5F, -8.0F, -4.0F, 1, 2, 2); + this.horseRightFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseRightFaceMetal, 0.5235988F, 0.0F, 0.0F); + this.horseLeftRein = new ModelRenderer(this, 44, 10); + this.horseLeftRein.addBox(2.6F, -6.0F, -6.0F, 0, 3, 16); + this.horseLeftRein.setRotationPoint(0.0F, 4.0F, -10.0F); + this.horseRightRein = new ModelRenderer(this, 44, 5); + this.horseRightRein.addBox(-2.6F, -6.0F, -6.0F, 0, 3, 16); + this.horseRightRein.setRotationPoint(0.0F, 4.0F, -10.0F); + this.mane = new ModelRenderer(this, 58, 0); + this.mane.addBox(-1.0F, -11.5F, 5.0F, 2, 16, 4); + this.mane.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.mane, 0.5235988F, 0.0F, 0.0F); + this.horseFaceRopes = new ModelRenderer(this, 80, 12); + this.horseFaceRopes.addBox(-2.5F, -10.1F, -7.0F, 5, 5, 12, 0.2F); + this.horseFaceRopes.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseFaceRopes, 0.5235988F, 0.0F, 0.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + EntityHorse entityhorse = (EntityHorse)entityIn; + int i = entityhorse.getHorseType(); + float f = entityhorse.getGrassEatingAmount(0.0F); + boolean flag = entityhorse.isAdultHorse(); + boolean flag1 = flag && entityhorse.isHorseSaddled(); + boolean flag2 = flag && entityhorse.isChested(); + boolean flag3 = i == 1 || i == 2; + float f1 = entityhorse.getHorseSize(); + boolean flag4 = entityhorse.riddenByEntity != null; + + if (flag1) + { + this.horseFaceRopes.render(scale); + this.horseSaddleBottom.render(scale); + this.horseSaddleFront.render(scale); + this.horseSaddleBack.render(scale); + this.horseLeftSaddleRope.render(scale); + this.horseLeftSaddleMetal.render(scale); + this.horseRightSaddleRope.render(scale); + this.horseRightSaddleMetal.render(scale); + this.horseLeftFaceMetal.render(scale); + this.horseRightFaceMetal.render(scale); + + if (flag4) + { + this.horseLeftRein.render(scale); + this.horseRightRein.render(scale); + } + } + + if (!flag) + { + GlStateManager.pushMatrix(); + GlStateManager.scale(f1, 0.5F + f1 * 0.5F, f1); + GlStateManager.translate(0.0F, 0.95F * (1.0F - f1), 0.0F); + } + + this.backLeftLeg.render(scale); + this.backLeftShin.render(scale); + this.backLeftHoof.render(scale); + this.backRightLeg.render(scale); + this.backRightShin.render(scale); + this.backRightHoof.render(scale); + this.frontLeftLeg.render(scale); + this.frontLeftShin.render(scale); + this.frontLeftHoof.render(scale); + this.frontRightLeg.render(scale); + this.frontRightShin.render(scale); + this.frontRightHoof.render(scale); + + if (!flag) + { + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(f1, f1, f1); + GlStateManager.translate(0.0F, 1.35F * (1.0F - f1), 0.0F); + } + + this.body.render(scale); + this.tailBase.render(scale); + this.tailMiddle.render(scale); + this.tailTip.render(scale); + this.neck.render(scale); + this.mane.render(scale); + + if (!flag) + { + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + float f2 = 0.5F + f1 * f1 * 0.5F; + GlStateManager.scale(f2, f2, f2); + + if (f <= 0.0F) + { + GlStateManager.translate(0.0F, 1.35F * (1.0F - f1), 0.0F); + } + else + { + GlStateManager.translate(0.0F, 0.9F * (1.0F - f1) * f + 1.35F * (1.0F - f1) * (1.0F - f), 0.15F * (1.0F - f1) * f); + } + } + + if (flag3) + { + this.muleLeftEar.render(scale); + this.muleRightEar.render(scale); + } + else + { + this.horseLeftEar.render(scale); + this.horseRightEar.render(scale); + } + + this.head.render(scale); + + if (!flag) + { + GlStateManager.popMatrix(); + } + + if (flag2) + { + this.muleLeftChest.render(scale); + this.muleRightChest.render(scale); + } + } + + private void setBoxRotation(ModelRenderer p_110682_1_, float p_110682_2_, float p_110682_3_, float p_110682_4_) + { + p_110682_1_.rotateAngleX = p_110682_2_; + p_110682_1_.rotateAngleY = p_110682_3_; + p_110682_1_.rotateAngleZ = p_110682_4_; + } + + private float updateHorseRotation(float p_110683_1_, float p_110683_2_, float p_110683_3_) + { + float f; + + for (f = p_110683_2_ - p_110683_1_; f < -180.0F; f += 360.0F) + { + ; + } + + while (f >= 180.0F) + { + f -= 360.0F; + } + + return p_110683_1_ + p_110683_3_ * f; + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime); + float f = this.updateHorseRotation(entitylivingbaseIn.prevRenderYawOffset, entitylivingbaseIn.renderYawOffset, partialTickTime); + float f1 = this.updateHorseRotation(entitylivingbaseIn.prevRotationYawHead, entitylivingbaseIn.rotationYawHead, partialTickTime); + float f2 = entitylivingbaseIn.prevRotationPitch + (entitylivingbaseIn.rotationPitch - entitylivingbaseIn.prevRotationPitch) * partialTickTime; + float f3 = f1 - f; + float f4 = f2 / (180F / (float)Math.PI); + + if (f3 > 20.0F) + { + f3 = 20.0F; + } + + if (f3 < -20.0F) + { + f3 = -20.0F; + } + + if (p_78086_3_ > 0.2F) + { + f4 += MathHelper.cos(p_78086_2_ * 0.4F) * 0.15F * p_78086_3_; + } + + EntityHorse entityhorse = (EntityHorse)entitylivingbaseIn; + float f5 = entityhorse.getGrassEatingAmount(partialTickTime); + float f6 = entityhorse.getRearingAmount(partialTickTime); + float f7 = 1.0F - f6; + float f8 = entityhorse.getMouthOpennessAngle(partialTickTime); + boolean flag = entityhorse.field_110278_bp != 0; + boolean flag1 = entityhorse.isHorseSaddled(); + boolean flag2 = entityhorse.riddenByEntity != null; + float f9 = (float)entitylivingbaseIn.ticksExisted + partialTickTime; + float f10 = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI); + float f11 = f10 * 0.8F * p_78086_3_; + this.head.rotationPointY = 4.0F; + this.head.rotationPointZ = -10.0F; + this.tailBase.rotationPointY = 3.0F; + this.tailMiddle.rotationPointZ = 14.0F; + this.muleRightChest.rotationPointY = 3.0F; + this.muleRightChest.rotationPointZ = 10.0F; + this.body.rotateAngleX = 0.0F; + this.head.rotateAngleX = 0.5235988F + f4; + this.head.rotateAngleY = f3 / (180F / (float)Math.PI); + this.head.rotateAngleX = f6 * (0.2617994F + f4) + f5 * 2.18166F + (1.0F - Math.max(f6, f5)) * this.head.rotateAngleX; + this.head.rotateAngleY = f6 * f3 / (180F / (float)Math.PI) + (1.0F - Math.max(f6, f5)) * this.head.rotateAngleY; + this.head.rotationPointY = f6 * -6.0F + f5 * 11.0F + (1.0F - Math.max(f6, f5)) * this.head.rotationPointY; + this.head.rotationPointZ = f6 * -1.0F + f5 * -10.0F + (1.0F - Math.max(f6, f5)) * this.head.rotationPointZ; + this.tailBase.rotationPointY = f6 * 9.0F + f7 * this.tailBase.rotationPointY; + this.tailMiddle.rotationPointZ = f6 * 18.0F + f7 * this.tailMiddle.rotationPointZ; + this.muleRightChest.rotationPointY = f6 * 5.5F + f7 * this.muleRightChest.rotationPointY; + this.muleRightChest.rotationPointZ = f6 * 15.0F + f7 * this.muleRightChest.rotationPointZ; + this.body.rotateAngleX = f6 * -45.0F / (180F / (float)Math.PI) + f7 * this.body.rotateAngleX; + this.horseLeftEar.rotationPointY = this.head.rotationPointY; + this.horseRightEar.rotationPointY = this.head.rotationPointY; + this.muleLeftEar.rotationPointY = this.head.rotationPointY; + this.muleRightEar.rotationPointY = this.head.rotationPointY; + this.neck.rotationPointY = this.head.rotationPointY; + this.field_178711_b.rotationPointY = 0.02F; + this.field_178712_c.rotationPointY = 0.0F; + this.mane.rotationPointY = this.head.rotationPointY; + this.horseLeftEar.rotationPointZ = this.head.rotationPointZ; + this.horseRightEar.rotationPointZ = this.head.rotationPointZ; + this.muleLeftEar.rotationPointZ = this.head.rotationPointZ; + this.muleRightEar.rotationPointZ = this.head.rotationPointZ; + this.neck.rotationPointZ = this.head.rotationPointZ; + this.field_178711_b.rotationPointZ = 0.02F - f8 * 1.0F; + this.field_178712_c.rotationPointZ = 0.0F + f8 * 1.0F; + this.mane.rotationPointZ = this.head.rotationPointZ; + this.horseLeftEar.rotateAngleX = this.head.rotateAngleX; + this.horseRightEar.rotateAngleX = this.head.rotateAngleX; + this.muleLeftEar.rotateAngleX = this.head.rotateAngleX; + this.muleRightEar.rotateAngleX = this.head.rotateAngleX; + this.neck.rotateAngleX = this.head.rotateAngleX; + this.field_178711_b.rotateAngleX = 0.0F - 0.09424778F * f8; + this.field_178712_c.rotateAngleX = 0.0F + 0.15707964F * f8; + this.mane.rotateAngleX = this.head.rotateAngleX; + this.horseLeftEar.rotateAngleY = this.head.rotateAngleY; + this.horseRightEar.rotateAngleY = this.head.rotateAngleY; + this.muleLeftEar.rotateAngleY = this.head.rotateAngleY; + this.muleRightEar.rotateAngleY = this.head.rotateAngleY; + this.neck.rotateAngleY = this.head.rotateAngleY; + this.field_178711_b.rotateAngleY = 0.0F; + this.field_178712_c.rotateAngleY = 0.0F; + this.mane.rotateAngleY = this.head.rotateAngleY; + this.muleLeftChest.rotateAngleX = f11 / 5.0F; + this.muleRightChest.rotateAngleX = -f11 / 5.0F; + float f12 = ((float)Math.PI / 2F); + float f13 = ((float)Math.PI * 3F / 2F); + float f14 = -1.0471976F; + float f15 = 0.2617994F * f6; + float f16 = MathHelper.cos(f9 * 0.6F + (float)Math.PI); + this.frontLeftLeg.rotationPointY = -2.0F * f6 + 9.0F * f7; + this.frontLeftLeg.rotationPointZ = -2.0F * f6 + -8.0F * f7; + this.frontRightLeg.rotationPointY = this.frontLeftLeg.rotationPointY; + this.frontRightLeg.rotationPointZ = this.frontLeftLeg.rotationPointZ; + this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f15 + f7 * -f10 * 0.5F * p_78086_3_) * 7.0F; + this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f15 + f7 * -f10 * 0.5F * p_78086_3_) * 7.0F; + this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f15 + f7 * f10 * 0.5F * p_78086_3_) * 7.0F; + this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f15 + f7 * f10 * 0.5F * p_78086_3_) * 7.0F; + float f17 = (-1.0471976F + f16) * f6 + f11 * f7; + float f18 = (-1.0471976F + -f16) * f6 + -f11 * f7; + this.frontLeftShin.rotationPointY = this.frontLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f17) * 7.0F; + this.frontLeftShin.rotationPointZ = this.frontLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f17) * 7.0F; + this.frontRightShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f18) * 7.0F; + this.frontRightShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f18) * 7.0F; + this.backLeftLeg.rotateAngleX = f15 + -f10 * 0.5F * p_78086_3_ * f7; + this.backLeftShin.rotateAngleX = -0.08726646F * f6 + (-f10 * 0.5F * p_78086_3_ - Math.max(0.0F, f10 * 0.5F * p_78086_3_)) * f7; + this.backLeftHoof.rotateAngleX = this.backLeftShin.rotateAngleX; + this.backRightLeg.rotateAngleX = f15 + f10 * 0.5F * p_78086_3_ * f7; + this.backRightShin.rotateAngleX = -0.08726646F * f6 + (f10 * 0.5F * p_78086_3_ - Math.max(0.0F, -f10 * 0.5F * p_78086_3_)) * f7; + this.backRightHoof.rotateAngleX = this.backRightShin.rotateAngleX; + this.frontLeftLeg.rotateAngleX = f17; + this.frontLeftShin.rotateAngleX = (this.frontLeftLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + f16 * 0.2F)) * f6 + (f11 + Math.max(0.0F, f10 * 0.5F * p_78086_3_)) * f7; + this.frontLeftHoof.rotateAngleX = this.frontLeftShin.rotateAngleX; + this.frontRightLeg.rotateAngleX = f18; + this.frontRightShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - f16 * 0.2F)) * f6 + (-f11 + Math.max(0.0F, -f10 * 0.5F * p_78086_3_)) * f7; + this.frontRightHoof.rotateAngleX = this.frontRightShin.rotateAngleX; + this.backLeftHoof.rotationPointY = this.backLeftShin.rotationPointY; + this.backLeftHoof.rotationPointZ = this.backLeftShin.rotationPointZ; + this.backRightHoof.rotationPointY = this.backRightShin.rotationPointY; + this.backRightHoof.rotationPointZ = this.backRightShin.rotationPointZ; + this.frontLeftHoof.rotationPointY = this.frontLeftShin.rotationPointY; + this.frontLeftHoof.rotationPointZ = this.frontLeftShin.rotationPointZ; + this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY; + this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ; + + if (flag1) + { + this.horseSaddleBottom.rotationPointY = f6 * 0.5F + f7 * 2.0F; + this.horseSaddleBottom.rotationPointZ = f6 * 11.0F + f7 * 2.0F; + this.horseSaddleFront.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseSaddleBack.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseLeftSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseRightSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseLeftSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseRightSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.muleLeftChest.rotationPointY = this.muleRightChest.rotationPointY; + this.horseSaddleFront.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseSaddleBack.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseLeftSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseRightSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseLeftSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseRightSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.muleLeftChest.rotationPointZ = this.muleRightChest.rotationPointZ; + this.horseSaddleBottom.rotateAngleX = this.body.rotateAngleX; + this.horseSaddleFront.rotateAngleX = this.body.rotateAngleX; + this.horseSaddleBack.rotateAngleX = this.body.rotateAngleX; + this.horseLeftRein.rotationPointY = this.head.rotationPointY; + this.horseRightRein.rotationPointY = this.head.rotationPointY; + this.horseFaceRopes.rotationPointY = this.head.rotationPointY; + this.horseLeftFaceMetal.rotationPointY = this.head.rotationPointY; + this.horseRightFaceMetal.rotationPointY = this.head.rotationPointY; + this.horseLeftRein.rotationPointZ = this.head.rotationPointZ; + this.horseRightRein.rotationPointZ = this.head.rotationPointZ; + this.horseFaceRopes.rotationPointZ = this.head.rotationPointZ; + this.horseLeftFaceMetal.rotationPointZ = this.head.rotationPointZ; + this.horseRightFaceMetal.rotationPointZ = this.head.rotationPointZ; + this.horseLeftRein.rotateAngleX = f4; + this.horseRightRein.rotateAngleX = f4; + this.horseFaceRopes.rotateAngleX = this.head.rotateAngleX; + this.horseLeftFaceMetal.rotateAngleX = this.head.rotateAngleX; + this.horseRightFaceMetal.rotateAngleX = this.head.rotateAngleX; + this.horseFaceRopes.rotateAngleY = this.head.rotateAngleY; + this.horseLeftFaceMetal.rotateAngleY = this.head.rotateAngleY; + this.horseLeftRein.rotateAngleY = this.head.rotateAngleY; + this.horseRightFaceMetal.rotateAngleY = this.head.rotateAngleY; + this.horseRightRein.rotateAngleY = this.head.rotateAngleY; + + if (flag2) + { + this.horseLeftSaddleRope.rotateAngleX = -1.0471976F; + this.horseLeftSaddleMetal.rotateAngleX = -1.0471976F; + this.horseRightSaddleRope.rotateAngleX = -1.0471976F; + this.horseRightSaddleMetal.rotateAngleX = -1.0471976F; + this.horseLeftSaddleRope.rotateAngleZ = 0.0F; + this.horseLeftSaddleMetal.rotateAngleZ = 0.0F; + this.horseRightSaddleRope.rotateAngleZ = 0.0F; + this.horseRightSaddleMetal.rotateAngleZ = 0.0F; + } + else + { + this.horseLeftSaddleRope.rotateAngleX = f11 / 3.0F; + this.horseLeftSaddleMetal.rotateAngleX = f11 / 3.0F; + this.horseRightSaddleRope.rotateAngleX = f11 / 3.0F; + this.horseRightSaddleMetal.rotateAngleX = f11 / 3.0F; + this.horseLeftSaddleRope.rotateAngleZ = f11 / 5.0F; + this.horseLeftSaddleMetal.rotateAngleZ = f11 / 5.0F; + this.horseRightSaddleRope.rotateAngleZ = -f11 / 5.0F; + this.horseRightSaddleMetal.rotateAngleZ = -f11 / 5.0F; + } + } + + f12 = -1.3089F + p_78086_3_ * 1.5F; + + if (f12 > 0.0F) + { + f12 = 0.0F; + } + + if (flag) + { + this.tailBase.rotateAngleY = MathHelper.cos(f9 * 0.7F); + f12 = 0.0F; + } + else + { + this.tailBase.rotateAngleY = 0.0F; + } + + this.tailMiddle.rotateAngleY = this.tailBase.rotateAngleY; + this.tailTip.rotateAngleY = this.tailBase.rotateAngleY; + this.tailMiddle.rotationPointY = this.tailBase.rotationPointY; + this.tailTip.rotationPointY = this.tailBase.rotationPointY; + this.tailMiddle.rotationPointZ = this.tailBase.rotationPointZ; + this.tailTip.rotationPointZ = this.tailBase.rotationPointZ; + this.tailBase.rotateAngleX = f12; + this.tailMiddle.rotateAngleX = f12; + this.tailTip.rotateAngleX = -0.2618F + f12; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelHumanoidHead.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelHumanoidHead.java new file mode 100644 index 0000000..a7a7da4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelHumanoidHead.java @@ -0,0 +1,28 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelHumanoidHead extends ModelSkeletonHead +{ + private final ModelRenderer head = new ModelRenderer(this, 32, 0); + + public ModelHumanoidHead() + { + super(0, 0, 64, 64); + this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.25F); + this.head.setRotationPoint(0.0F, 0.0F, 0.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); + this.head.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.head.rotateAngleY = this.skeletonHead.rotateAngleY; + this.head.rotateAngleX = this.skeletonHead.rotateAngleX; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelIronGolem.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelIronGolem.java new file mode 100644 index 0000000..a5c6903 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelIronGolem.java @@ -0,0 +1,105 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; + +public class ModelIronGolem extends ModelBase +{ + public ModelRenderer ironGolemHead; + public ModelRenderer ironGolemBody; + public ModelRenderer ironGolemRightArm; + public ModelRenderer ironGolemLeftArm; + public ModelRenderer ironGolemLeftLeg; + public ModelRenderer ironGolemRightLeg; + + public ModelIronGolem() + { + this(0.0F); + } + + public ModelIronGolem(float p_i1161_1_) + { + this(p_i1161_1_, -7.0F); + } + + public ModelIronGolem(float p_i46362_1_, float p_i46362_2_) + { + int i = 128; + int j = 128; + this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(i, j); + this.ironGolemHead.setRotationPoint(0.0F, 0.0F + p_i46362_2_, -2.0F); + this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, p_i46362_1_); + this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, p_i46362_1_); + this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(i, j); + this.ironGolemBody.setRotationPoint(0.0F, 0.0F + p_i46362_2_, 0.0F); + this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, p_i46362_1_); + this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, p_i46362_1_ + 0.5F); + this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(i, j); + this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F); + this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_); + this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(i, j); + this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F); + this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_); + this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(i, j); + this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + p_i46362_2_, 0.0F); + this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_); + this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(i, j); + this.ironGolemRightLeg.mirror = true; + this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + p_i46362_2_, 0.0F); + this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.ironGolemHead.render(scale); + this.ironGolemBody.render(scale); + this.ironGolemLeftLeg.render(scale); + this.ironGolemRightLeg.render(scale); + this.ironGolemRightArm.render(scale); + this.ironGolemLeftArm.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + this.ironGolemHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.ironGolemHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(limbSwing, 13.0F) * limbSwingAmount; + this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(limbSwing, 13.0F) * limbSwingAmount; + this.ironGolemLeftLeg.rotateAngleY = 0.0F; + this.ironGolemRightLeg.rotateAngleY = 0.0F; + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + EntityIronGolem entityirongolem = (EntityIronGolem)entitylivingbaseIn; + int i = entityirongolem.getAttackTimer(); + + if (i > 0) + { + this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - partialTickTime, 10.0F); + this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - partialTickTime, 10.0F); + } + else + { + int j = entityirongolem.getHoldRoseTick(); + + if (j > 0) + { + this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)j, 70.0F); + this.ironGolemLeftArm.rotateAngleX = 0.0F; + } + else + { + this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_; + this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_; + } + } + } + + private float func_78172_a(float p_78172_1_, float p_78172_2_) + { + return (Math.abs(p_78172_1_ % p_78172_2_ - p_78172_2_ * 0.5F) - p_78172_2_ * 0.25F) / (p_78172_2_ * 0.25F); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelLargeChest.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelLargeChest.java new file mode 100644 index 0000000..fc534de --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelLargeChest.java @@ -0,0 +1,23 @@ +package net.minecraft.client.model; + +public class ModelLargeChest extends ModelChest +{ + public ModelLargeChest() + { + this.chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); + this.chestLid.addBox(0.0F, -5.0F, -14.0F, 30, 5, 14, 0.0F); + this.chestLid.rotationPointX = 1.0F; + this.chestLid.rotationPointY = 7.0F; + this.chestLid.rotationPointZ = 15.0F; + this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); + this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); + this.chestKnob.rotationPointX = 16.0F; + this.chestKnob.rotationPointY = 7.0F; + this.chestKnob.rotationPointZ = 15.0F; + this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(128, 64); + this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 30, 10, 14, 0.0F); + this.chestBelow.rotationPointX = 1.0F; + this.chestBelow.rotationPointY = 6.0F; + this.chestBelow.rotationPointZ = 1.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelLeashKnot.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelLeashKnot.java new file mode 100644 index 0000000..b0a1541 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelLeashKnot.java @@ -0,0 +1,35 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelLeashKnot extends ModelBase +{ + public ModelRenderer field_110723_a; + + public ModelLeashKnot() + { + this(0, 0, 32, 32); + } + + public ModelLeashKnot(int p_i46365_1_, int p_i46365_2_, int p_i46365_3_, int p_i46365_4_) + { + this.textureWidth = p_i46365_3_; + this.textureHeight = p_i46365_4_; + this.field_110723_a = new ModelRenderer(this, p_i46365_1_, p_i46365_2_); + this.field_110723_a.addBox(-3.0F, -6.0F, -3.0F, 6, 8, 6, 0.0F); + this.field_110723_a.setRotationPoint(0.0F, 0.0F, 0.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.field_110723_a.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.field_110723_a.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.field_110723_a.rotateAngleX = headPitch / (180F / (float)Math.PI); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelMagmaCube.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelMagmaCube.java new file mode 100644 index 0000000..05c67e2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelMagmaCube.java @@ -0,0 +1,64 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityMagmaCube; + +public class ModelMagmaCube extends ModelBase +{ + ModelRenderer[] segments = new ModelRenderer[8]; + ModelRenderer core; + + public ModelMagmaCube() + { + for (int i = 0; i < this.segments.length; ++i) + { + int j = 0; + int k = i; + + if (i == 2) + { + j = 24; + k = 10; + } + else if (i == 3) + { + j = 24; + k = 19; + } + + this.segments[i] = new ModelRenderer(this, j, k); + this.segments[i].addBox(-4.0F, (float)(16 + i), -4.0F, 8, 1, 8); + } + + this.core = new ModelRenderer(this, 0, 16); + this.core.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4); + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + EntityMagmaCube entitymagmacube = (EntityMagmaCube)entitylivingbaseIn; + float f = entitymagmacube.prevSquishFactor + (entitymagmacube.squishFactor - entitymagmacube.prevSquishFactor) * partialTickTime; + + if (f < 0.0F) + { + f = 0.0F; + } + + for (int i = 0; i < this.segments.length; ++i) + { + this.segments[i].rotationPointY = (float)(-(4 - i)) * f * 1.7F; + } + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.core.render(scale); + + for (int i = 0; i < this.segments.length; ++i) + { + this.segments[i].render(scale); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelMinecart.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelMinecart.java new file mode 100644 index 0000000..4265548 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelMinecart.java @@ -0,0 +1,49 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelMinecart extends ModelBase +{ + public ModelRenderer[] sideModels = new ModelRenderer[7]; + + public ModelMinecart() + { + this.sideModels[0] = new ModelRenderer(this, 0, 10); + this.sideModels[1] = new ModelRenderer(this, 0, 0); + this.sideModels[2] = new ModelRenderer(this, 0, 0); + this.sideModels[3] = new ModelRenderer(this, 0, 0); + this.sideModels[4] = new ModelRenderer(this, 0, 0); + this.sideModels[5] = new ModelRenderer(this, 44, 10); + int i = 20; + int j = 8; + int k = 16; + int l = 4; + this.sideModels[0].addBox((float)(-i / 2), (float)(-k / 2), -1.0F, i, k, 2, 0.0F); + this.sideModels[0].setRotationPoint(0.0F, (float)l, 0.0F); + this.sideModels[5].addBox((float)(-i / 2 + 1), (float)(-k / 2 + 1), -1.0F, i - 2, k - 2, 1, 0.0F); + this.sideModels[5].setRotationPoint(0.0F, (float)l, 0.0F); + this.sideModels[1].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.sideModels[1].setRotationPoint((float)(-i / 2 + 1), (float)l, 0.0F); + this.sideModels[2].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.sideModels[2].setRotationPoint((float)(i / 2 - 1), (float)l, 0.0F); + this.sideModels[3].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.sideModels[3].setRotationPoint(0.0F, (float)l, (float)(-k / 2 + 1)); + this.sideModels[4].addBox((float)(-i / 2 + 2), (float)(-j - 1), -1.0F, i - 4, j, 2, 0.0F); + this.sideModels[4].setRotationPoint(0.0F, (float)l, (float)(k / 2 - 1)); + this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F); + this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F); + this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F); + this.sideModels[3].rotateAngleY = (float)Math.PI; + this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.sideModels[5].rotationPointY = 4.0F - p_78088_4_; + + for (int i = 0; i < 6; ++i) + { + this.sideModels[i].render(scale); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelOcelot.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelOcelot.java new file mode 100644 index 0000000..20d423d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelOcelot.java @@ -0,0 +1,192 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.util.MathHelper; + +public class ModelOcelot extends ModelBase +{ + ModelRenderer ocelotBackLeftLeg; + ModelRenderer ocelotBackRightLeg; + ModelRenderer ocelotFrontLeftLeg; + ModelRenderer ocelotFrontRightLeg; + ModelRenderer ocelotTail; + ModelRenderer ocelotTail2; + ModelRenderer ocelotHead; + ModelRenderer ocelotBody; + int field_78163_i = 1; + + public ModelOcelot() + { + this.setTextureOffset("head.main", 0, 0); + this.setTextureOffset("head.nose", 0, 24); + this.setTextureOffset("head.ear1", 0, 10); + this.setTextureOffset("head.ear2", 6, 10); + this.ocelotHead = new ModelRenderer(this, "head"); + this.ocelotHead.addBox("main", -2.5F, -2.0F, -3.0F, 5, 4, 5); + this.ocelotHead.addBox("nose", -1.5F, 0.0F, -4.0F, 3, 2, 2); + this.ocelotHead.addBox("ear1", -2.0F, -3.0F, 0.0F, 1, 1, 2); + this.ocelotHead.addBox("ear2", 1.0F, -3.0F, 0.0F, 1, 1, 2); + this.ocelotHead.setRotationPoint(0.0F, 15.0F, -9.0F); + this.ocelotBody = new ModelRenderer(this, 20, 0); + this.ocelotBody.addBox(-2.0F, 3.0F, -8.0F, 4, 16, 6, 0.0F); + this.ocelotBody.setRotationPoint(0.0F, 12.0F, -10.0F); + this.ocelotTail = new ModelRenderer(this, 0, 15); + this.ocelotTail.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); + this.ocelotTail.rotateAngleX = 0.9F; + this.ocelotTail.setRotationPoint(0.0F, 15.0F, 8.0F); + this.ocelotTail2 = new ModelRenderer(this, 4, 15); + this.ocelotTail2.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); + this.ocelotTail2.setRotationPoint(0.0F, 20.0F, 14.0F); + this.ocelotBackLeftLeg = new ModelRenderer(this, 8, 13); + this.ocelotBackLeftLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); + this.ocelotBackLeftLeg.setRotationPoint(1.1F, 18.0F, 5.0F); + this.ocelotBackRightLeg = new ModelRenderer(this, 8, 13); + this.ocelotBackRightLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); + this.ocelotBackRightLeg.setRotationPoint(-1.1F, 18.0F, 5.0F); + this.ocelotFrontLeftLeg = new ModelRenderer(this, 40, 0); + this.ocelotFrontLeftLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); + this.ocelotFrontLeftLeg.setRotationPoint(1.2F, 13.8F, -5.0F); + this.ocelotFrontRightLeg = new ModelRenderer(this, 40, 0); + this.ocelotFrontRightLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); + this.ocelotFrontRightLeg.setRotationPoint(-1.2F, 13.8F, -5.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + if (this.isChild) + { + float f = 2.0F; + GlStateManager.pushMatrix(); + GlStateManager.scale(1.5F / f, 1.5F / f, 1.5F / f); + GlStateManager.translate(0.0F, 10.0F * scale, 4.0F * scale); + this.ocelotHead.render(scale); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.ocelotBody.render(scale); + this.ocelotBackLeftLeg.render(scale); + this.ocelotBackRightLeg.render(scale); + this.ocelotFrontLeftLeg.render(scale); + this.ocelotFrontRightLeg.render(scale); + this.ocelotTail.render(scale); + this.ocelotTail2.render(scale); + GlStateManager.popMatrix(); + } + else + { + this.ocelotHead.render(scale); + this.ocelotBody.render(scale); + this.ocelotTail.render(scale); + this.ocelotTail2.render(scale); + this.ocelotBackLeftLeg.render(scale); + this.ocelotBackRightLeg.render(scale); + this.ocelotFrontLeftLeg.render(scale); + this.ocelotFrontRightLeg.render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + this.ocelotHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.ocelotHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + + if (this.field_78163_i != 3) + { + this.ocelotBody.rotateAngleX = ((float)Math.PI / 2F); + + if (this.field_78163_i == 2) + { + this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.0F * limbSwingAmount; + this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + 0.3F) * 1.0F * limbSwingAmount; + this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * limbSwingAmount; + this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.0F * limbSwingAmount; + this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 10F) * MathHelper.cos(limbSwing) * limbSwingAmount; + } + else + { + this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.0F * limbSwingAmount; + this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.0F * limbSwingAmount; + this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.0F * limbSwingAmount; + this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.0F * limbSwingAmount; + + if (this.field_78163_i == 1) + { + this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 4F) * MathHelper.cos(limbSwing) * limbSwingAmount; + } + else + { + this.ocelotTail2.rotateAngleX = 1.7278761F + 0.47123894F * MathHelper.cos(limbSwing) * limbSwingAmount; + } + } + } + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + EntityOcelot entityocelot = (EntityOcelot)entitylivingbaseIn; + this.ocelotBody.rotationPointY = 12.0F; + this.ocelotBody.rotationPointZ = -10.0F; + this.ocelotHead.rotationPointY = 15.0F; + this.ocelotHead.rotationPointZ = -9.0F; + this.ocelotTail.rotationPointY = 15.0F; + this.ocelotTail.rotationPointZ = 8.0F; + this.ocelotTail2.rotationPointY = 20.0F; + this.ocelotTail2.rotationPointZ = 14.0F; + this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 13.8F; + this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -5.0F; + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 18.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 5.0F; + this.ocelotTail.rotateAngleX = 0.9F; + + if (entityocelot.isSneaking()) + { + ++this.ocelotBody.rotationPointY; + this.ocelotHead.rotationPointY += 2.0F; + ++this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointY += -4.0F; + this.ocelotTail2.rotationPointZ += 2.0F; + this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); + this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 0; + } + else if (entityocelot.isSprinting()) + { + this.ocelotTail2.rotationPointY = this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointZ += 2.0F; + this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); + this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 2; + } + else if (entityocelot.isSitting()) + { + this.ocelotBody.rotateAngleX = ((float)Math.PI / 4F); + this.ocelotBody.rotationPointY += -4.0F; + this.ocelotBody.rotationPointZ += 5.0F; + this.ocelotHead.rotationPointY += -3.3F; + ++this.ocelotHead.rotationPointZ; + this.ocelotTail.rotationPointY += 8.0F; + this.ocelotTail.rotationPointZ += -2.0F; + this.ocelotTail2.rotationPointY += 2.0F; + this.ocelotTail2.rotationPointZ += -0.8F; + this.ocelotTail.rotateAngleX = 1.7278761F; + this.ocelotTail2.rotateAngleX = 2.670354F; + this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = -0.15707964F; + this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 15.8F; + this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -7.0F; + this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = -((float)Math.PI / 2F); + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 21.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 1.0F; + this.field_78163_i = 3; + } + else + { + this.field_78163_i = 1; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelPig.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelPig.java new file mode 100644 index 0000000..fc2b7f9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelPig.java @@ -0,0 +1,16 @@ +package net.minecraft.client.model; + +public class ModelPig extends ModelQuadruped +{ + public ModelPig() + { + this(0.0F); + } + + public ModelPig(float p_i1151_1_) + { + super(6, p_i1151_1_); + this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, p_i1151_1_); + this.childYOffset = 4.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelPlayer.java new file mode 100644 index 0000000..b74ddcb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelPlayer.java @@ -0,0 +1,204 @@ +package net.minecraft.client.model; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.cosmetic.CosmeticManager; +import com.cheatbreaker.client.cosmetic.data.AnimationStage; +import com.cheatbreaker.client.cosmetic.type.model.CosmeticModelWings; +import com.cheatbreaker.client.event.impl.render.PlayerAnimationEvent; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +public class ModelPlayer extends ModelBiped { + public ModelRenderer bipedLeftArmwear; + public ModelRenderer bipedRightArmwear; + public ModelRenderer bipedLeftLegwear; + public ModelRenderer bipedRightLegwear; + public ModelRenderer bipedBodyWear; + public ModelRenderer bipedCape; + private ModelRenderer bipedDeadmau5Head; + private CosmeticModelWings dragonWingsBiped; + + private boolean smallArms; + + public ModelPlayer(float p_i46304_1_, boolean p_i46304_2_) { + super(p_i46304_1_, 0.0F, 64, 64); + this.smallArms = p_i46304_2_; + this.bipedDeadmau5Head = new ModelRenderer(this, 24, 0); + this.bipedDeadmau5Head.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, p_i46304_1_); + this.bipedCape = new ModelRenderer(this, 0, 0); + this.bipedCape.setTextureSize(64, 32); + this.bipedCape.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, p_i46304_1_); + + if (p_i46304_2_) { + this.bipedLeftArm = new ModelRenderer(this, 32, 48); + this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.5F, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.5F, 0.0F); + this.bipedLeftArmwear = new ModelRenderer(this, 48, 48); + this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_ + 0.25F); + this.bipedLeftArmwear.setRotationPoint(5.0F, 2.5F, 0.0F); + this.bipedRightArmwear = new ModelRenderer(this, 40, 32); + this.bipedRightArmwear.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, p_i46304_1_ + 0.25F); + this.bipedRightArmwear.setRotationPoint(-5.0F, 2.5F, 10.0F); + } else { + this.bipedLeftArm = new ModelRenderer(this, 32, 48); + this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedLeftArmwear = new ModelRenderer(this, 48, 48); + this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F); + this.bipedLeftArmwear.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedRightArmwear = new ModelRenderer(this, 40, 32); + this.bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F); + this.bipedRightArmwear.setRotationPoint(-5.0F, 2.0F, 10.0F); + } + + this.bipedLeftLeg = new ModelRenderer(this, 16, 48); + this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_); + this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F); + this.bipedLeftLegwear = new ModelRenderer(this, 0, 48); + this.bipedLeftLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F); + this.bipedLeftLegwear.setRotationPoint(1.9F, 12.0F, 0.0F); + this.bipedRightLegwear = new ModelRenderer(this, 0, 32); + this.bipedRightLegwear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i46304_1_ + 0.25F); + this.bipedRightLegwear.setRotationPoint(-1.9F, 12.0F, 0.0F); + this.bipedBodyWear = new ModelRenderer(this, 16, 32); + this.bipedBodyWear.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46304_1_ + 0.25F); + this.bipedBodyWear.setRotationPoint(0.0F, 0.0F, 0.0F); + this.dragonWingsBiped = new CosmeticModelWings(0.0f); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) { + super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); + GlStateManager.pushMatrix(); + + if (this.isChild) { + float f = 2.0F; + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.bipedLeftLegwear.render(scale); + this.bipedRightLegwear.render(scale); + this.bipedLeftArmwear.render(scale); + this.bipedRightArmwear.render(scale); + this.bipedBodyWear.render(scale); + } else { + if (entityIn.isSneaking()) { + GlStateManager.translate(0.0F, 0.2F, 0.0F); + } + + this.bipedLeftLegwear.render(scale); + this.bipedRightLegwear.render(scale); + this.bipedLeftArmwear.render(scale); + this.bipedRightArmwear.render(scale); + this.bipedBodyWear.render(scale); + } + + EntityPlayer entityPlayer; + if (!this.aimedBow && entityIn instanceof EntityPlayer && (entityPlayer = (EntityPlayer) entityIn).hasWings()) { + if (entityPlayer.getWings().getType() == Cosmetic.CosmeticType.WINGS && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showCheatBreakerWings.getValue()) { + this.dragonWingsBiped.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityPlayer.getWings().getScale(), entityPlayer.getWings().getLocation()); + } + } + + if (entityIn instanceof AbstractClientPlayer) { + CheatBreaker.getInstance().getEventBus().handleEvent(new PlayerAnimationEvent(AnimationStage.END, (AbstractClientPlayer) entityIn, this, scale)); + this.bipedRightLeg.rotateAngleZ = 0; + this.bipedLeftLeg.rotateAngleZ = 0; + this.bipedLeftLeg.offsetX = 0; + this.bipedRightLeg.offsetX = 0; + this.bipedBody.rotateAngleZ = 0; + + // Fixes the cape issue. + if (!CheatBreaker.getInstance().getCosmeticManager().getActiveEmotes().containsKey(entityIn.getUniqueID())) { + this.bipedCape.rotateAngleZ = 0; + this.bipedCape.rotateAngleX = 0; + this.bipedCape.offsetX = 0; + } + + this.bipedRightArmwear.rotateAngleX = 0; + this.bipedRightArmwear.rotateAngleY = 0; + this.bipedRightArmwear.rotateAngleZ = 0; + this.bipedRightArmwear.offsetX = 0; + + this.bipedLeftArmwear.rotateAngleX = 0; + this.bipedLeftArmwear.rotateAngleY = 0; + this.bipedLeftArmwear.rotateAngleZ = 0; + this.bipedLeftArmwear.offsetX = 0; + + this.bipedRightLegwear.rotateAngleX = 0; + this.bipedRightLegwear.rotateAngleY = 0; + this.bipedRightLegwear.rotateAngleZ = 0; + this.bipedRightLegwear.offsetX = 0; + + this.bipedLeftLegwear.rotateAngleX = 0; + this.bipedLeftLegwear.rotateAngleY = 0; + this.bipedLeftLegwear.rotateAngleZ = 0; + this.bipedLeftLegwear.offsetX = 0; + } + + GlStateManager.popMatrix(); + } + + public void renderDeadmau5Head(float p_178727_1_) { + copyModelAngles(this.bipedHead, this.bipedDeadmau5Head); + this.bipedDeadmau5Head.rotationPointX = 0.0F; + this.bipedDeadmau5Head.rotationPointY = 0.0F; + this.bipedDeadmau5Head.render(p_178727_1_); + } + + public void renderCape(float p_178728_1_) { + this.bipedCape.render(p_178728_1_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entityIn); + copyModelAngles(this.bipedLeftLeg, this.bipedLeftLegwear); + copyModelAngles(this.bipedRightLeg, this.bipedRightLegwear); + copyModelAngles(this.bipedLeftArm, this.bipedLeftArmwear); + copyModelAngles(this.bipedRightArm, this.bipedRightArmwear); + copyModelAngles(this.bipedBody, this.bipedBodyWear); + } + + public void renderRightArm() { + this.bipedRightArm.render(0.0625F); + this.bipedRightArmwear.render(0.0625F); + } + + public void renderLeftArm() { + this.bipedLeftArm.render(0.0625F); + this.bipedLeftArmwear.render(0.0625F); + } + + public void setInvisible(boolean invisible) { + super.setInvisible(invisible); + this.bipedLeftArmwear.showModel = invisible; + this.bipedRightArmwear.showModel = invisible; + this.bipedLeftLegwear.showModel = invisible; + this.bipedRightLegwear.showModel = invisible; + this.bipedBodyWear.showModel = invisible; + this.bipedCape.showModel = invisible; + this.bipedDeadmau5Head.showModel = invisible; + } + + public void postRenderArm(float scale) { + if (this.smallArms) { + ++this.bipedRightArm.rotationPointX; + this.bipedRightArm.postRender(scale); + --this.bipedRightArm.rotationPointX; + } else { + this.bipedRightArm.postRender(scale); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelQuadruped.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelQuadruped.java new file mode 100644 index 0000000..da549d6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelQuadruped.java @@ -0,0 +1,82 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelQuadruped extends ModelBase +{ + public ModelRenderer head = new ModelRenderer(this, 0, 0); + public ModelRenderer body; + public ModelRenderer leg1; + public ModelRenderer leg2; + public ModelRenderer leg3; + public ModelRenderer leg4; + protected float childYOffset = 8.0F; + protected float childZOffset = 4.0F; + + public ModelQuadruped(int p_i1154_1_, float p_i1154_2_) + { + this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, p_i1154_2_); + this.head.setRotationPoint(0.0F, (float)(18 - p_i1154_1_), -6.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, p_i1154_2_); + this.body.setRotationPoint(0.0F, (float)(17 - p_i1154_1_), 2.0F); + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg1.setRotationPoint(-3.0F, (float)(24 - p_i1154_1_), 7.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg2.setRotationPoint(3.0F, (float)(24 - p_i1154_1_), 7.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg3.setRotationPoint(-3.0F, (float)(24 - p_i1154_1_), -5.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg4.setRotationPoint(3.0F, (float)(24 - p_i1154_1_), -5.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + if (this.isChild) + { + float f = 2.0F; + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, this.childYOffset * scale, this.childZOffset * scale); + this.head.render(scale); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.body.render(scale); + this.leg1.render(scale); + this.leg2.render(scale); + this.leg3.render(scale); + this.leg4.render(scale); + GlStateManager.popMatrix(); + } + else + { + this.head.render(scale); + this.body.render(scale); + this.leg1.render(scale); + this.leg2.render(scale); + this.leg3.render(scale); + this.leg4.render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + float f = (180F / (float)Math.PI); + this.head.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.head.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.leg1.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount; + this.leg2.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount; + this.leg3.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount; + this.leg4.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelRabbit.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelRabbit.java new file mode 100644 index 0000000..eea1a19 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelRabbit.java @@ -0,0 +1,162 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.util.MathHelper; + +public class ModelRabbit extends ModelBase +{ + ModelRenderer rabbitLeftFoot; + ModelRenderer rabbitRightFoot; + ModelRenderer rabbitLeftThigh; + ModelRenderer rabbitRightThigh; + ModelRenderer rabbitBody; + ModelRenderer rabbitLeftArm; + ModelRenderer rabbitRightArm; + ModelRenderer rabbitHead; + ModelRenderer rabbitRightEar; + ModelRenderer rabbitLeftEar; + ModelRenderer rabbitTail; + ModelRenderer rabbitNose; + private float field_178701_m = 0.0F; + private float field_178699_n = 0.0F; + + public ModelRabbit() + { + this.setTextureOffset("head.main", 0, 0); + this.setTextureOffset("head.nose", 0, 24); + this.setTextureOffset("head.ear1", 0, 10); + this.setTextureOffset("head.ear2", 6, 10); + this.rabbitLeftFoot = new ModelRenderer(this, 26, 24); + this.rabbitLeftFoot.addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7); + this.rabbitLeftFoot.setRotationPoint(3.0F, 17.5F, 3.7F); + this.rabbitLeftFoot.mirror = true; + this.setRotationOffset(this.rabbitLeftFoot, 0.0F, 0.0F, 0.0F); + this.rabbitRightFoot = new ModelRenderer(this, 8, 24); + this.rabbitRightFoot.addBox(-1.0F, 5.5F, -3.7F, 2, 1, 7); + this.rabbitRightFoot.setRotationPoint(-3.0F, 17.5F, 3.7F); + this.rabbitRightFoot.mirror = true; + this.setRotationOffset(this.rabbitRightFoot, 0.0F, 0.0F, 0.0F); + this.rabbitLeftThigh = new ModelRenderer(this, 30, 15); + this.rabbitLeftThigh.addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5); + this.rabbitLeftThigh.setRotationPoint(3.0F, 17.5F, 3.7F); + this.rabbitLeftThigh.mirror = true; + this.setRotationOffset(this.rabbitLeftThigh, -0.34906584F, 0.0F, 0.0F); + this.rabbitRightThigh = new ModelRenderer(this, 16, 15); + this.rabbitRightThigh.addBox(-1.0F, 0.0F, 0.0F, 2, 4, 5); + this.rabbitRightThigh.setRotationPoint(-3.0F, 17.5F, 3.7F); + this.rabbitRightThigh.mirror = true; + this.setRotationOffset(this.rabbitRightThigh, -0.34906584F, 0.0F, 0.0F); + this.rabbitBody = new ModelRenderer(this, 0, 0); + this.rabbitBody.addBox(-3.0F, -2.0F, -10.0F, 6, 5, 10); + this.rabbitBody.setRotationPoint(0.0F, 19.0F, 8.0F); + this.rabbitBody.mirror = true; + this.setRotationOffset(this.rabbitBody, -0.34906584F, 0.0F, 0.0F); + this.rabbitLeftArm = new ModelRenderer(this, 8, 15); + this.rabbitLeftArm.addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2); + this.rabbitLeftArm.setRotationPoint(3.0F, 17.0F, -1.0F); + this.rabbitLeftArm.mirror = true; + this.setRotationOffset(this.rabbitLeftArm, -0.17453292F, 0.0F, 0.0F); + this.rabbitRightArm = new ModelRenderer(this, 0, 15); + this.rabbitRightArm.addBox(-1.0F, 0.0F, -1.0F, 2, 7, 2); + this.rabbitRightArm.setRotationPoint(-3.0F, 17.0F, -1.0F); + this.rabbitRightArm.mirror = true; + this.setRotationOffset(this.rabbitRightArm, -0.17453292F, 0.0F, 0.0F); + this.rabbitHead = new ModelRenderer(this, 32, 0); + this.rabbitHead.addBox(-2.5F, -4.0F, -5.0F, 5, 4, 5); + this.rabbitHead.setRotationPoint(0.0F, 16.0F, -1.0F); + this.rabbitHead.mirror = true; + this.setRotationOffset(this.rabbitHead, 0.0F, 0.0F, 0.0F); + this.rabbitRightEar = new ModelRenderer(this, 52, 0); + this.rabbitRightEar.addBox(-2.5F, -9.0F, -1.0F, 2, 5, 1); + this.rabbitRightEar.setRotationPoint(0.0F, 16.0F, -1.0F); + this.rabbitRightEar.mirror = true; + this.setRotationOffset(this.rabbitRightEar, 0.0F, -0.2617994F, 0.0F); + this.rabbitLeftEar = new ModelRenderer(this, 58, 0); + this.rabbitLeftEar.addBox(0.5F, -9.0F, -1.0F, 2, 5, 1); + this.rabbitLeftEar.setRotationPoint(0.0F, 16.0F, -1.0F); + this.rabbitLeftEar.mirror = true; + this.setRotationOffset(this.rabbitLeftEar, 0.0F, 0.2617994F, 0.0F); + this.rabbitTail = new ModelRenderer(this, 52, 6); + this.rabbitTail.addBox(-1.5F, -1.5F, 0.0F, 3, 3, 2); + this.rabbitTail.setRotationPoint(0.0F, 20.0F, 7.0F); + this.rabbitTail.mirror = true; + this.setRotationOffset(this.rabbitTail, -0.3490659F, 0.0F, 0.0F); + this.rabbitNose = new ModelRenderer(this, 32, 9); + this.rabbitNose.addBox(-0.5F, -2.5F, -5.5F, 1, 1, 1); + this.rabbitNose.setRotationPoint(0.0F, 16.0F, -1.0F); + this.rabbitNose.mirror = true; + this.setRotationOffset(this.rabbitNose, 0.0F, 0.0F, 0.0F); + } + + private void setRotationOffset(ModelRenderer p_178691_1_, float p_178691_2_, float p_178691_3_, float p_178691_4_) + { + p_178691_1_.rotateAngleX = p_178691_2_; + p_178691_1_.rotateAngleY = p_178691_3_; + p_178691_1_.rotateAngleZ = p_178691_4_; + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + if (this.isChild) + { + float f = 2.0F; + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale); + this.rabbitHead.render(scale); + this.rabbitLeftEar.render(scale); + this.rabbitRightEar.render(scale); + this.rabbitNose.render(scale); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.rabbitLeftFoot.render(scale); + this.rabbitRightFoot.render(scale); + this.rabbitLeftThigh.render(scale); + this.rabbitRightThigh.render(scale); + this.rabbitBody.render(scale); + this.rabbitLeftArm.render(scale); + this.rabbitRightArm.render(scale); + this.rabbitTail.render(scale); + GlStateManager.popMatrix(); + } + else + { + this.rabbitLeftFoot.render(scale); + this.rabbitRightFoot.render(scale); + this.rabbitLeftThigh.render(scale); + this.rabbitRightThigh.render(scale); + this.rabbitBody.render(scale); + this.rabbitLeftArm.render(scale); + this.rabbitRightArm.render(scale); + this.rabbitHead.render(scale); + this.rabbitRightEar.render(scale); + this.rabbitLeftEar.render(scale); + this.rabbitTail.render(scale); + this.rabbitNose.render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + float f = ageInTicks - (float)entityIn.ticksExisted; + EntityRabbit entityrabbit = (EntityRabbit)entityIn; + this.rabbitNose.rotateAngleX = this.rabbitHead.rotateAngleX = this.rabbitRightEar.rotateAngleX = this.rabbitLeftEar.rotateAngleX = headPitch * 0.017453292F; + this.rabbitNose.rotateAngleY = this.rabbitHead.rotateAngleY = netHeadYaw * 0.017453292F; + this.rabbitRightEar.rotateAngleY = this.rabbitNose.rotateAngleY - 0.2617994F; + this.rabbitLeftEar.rotateAngleY = this.rabbitNose.rotateAngleY + 0.2617994F; + this.field_178701_m = MathHelper.sin(entityrabbit.func_175521_o(f) * (float)Math.PI); + this.rabbitLeftThigh.rotateAngleX = this.rabbitRightThigh.rotateAngleX = (this.field_178701_m * 50.0F - 21.0F) * 0.017453292F; + this.rabbitLeftFoot.rotateAngleX = this.rabbitRightFoot.rotateAngleX = this.field_178701_m * 50.0F * 0.017453292F; + this.rabbitLeftArm.rotateAngleX = this.rabbitRightArm.rotateAngleX = (this.field_178701_m * -40.0F - 11.0F) * 0.017453292F; + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelRenderer.java new file mode 100644 index 0000000..9aa14e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelRenderer.java @@ -0,0 +1,527 @@ +package net.minecraft.client.model; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.entity.model.anim.ModelUpdater; +import net.optifine.model.ModelSprite; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +public class ModelRenderer +{ + public float textureWidth; + public float textureHeight; + private int textureOffsetX; + private int textureOffsetY; + public float rotationPointX; + public float rotationPointY; + public float rotationPointZ; + public float rotateAngleX; + public float rotateAngleY; + public float rotateAngleZ; + private boolean compiled; + private int displayList; + public boolean mirror; + public boolean showModel; + public boolean isHidden; + public List cubeList; + public List childModels; + public final String boxName; + private ModelBase baseModel; + public float offsetX; + public float offsetY; + public float offsetZ; + public List spriteList; + public boolean mirrorV; + public float scaleX; + public float scaleY; + public float scaleZ; + private int countResetDisplayList; + private ResourceLocation textureLocation; + private String id; + private ModelUpdater modelUpdater; + private RenderGlobal renderGlobal; + + public ModelRenderer(ModelBase model, String boxNameIn) + { + this.spriteList = new ArrayList(); + this.mirrorV = false; + this.scaleX = 1.0F; + this.scaleY = 1.0F; + this.scaleZ = 1.0F; + this.textureLocation = null; + this.id = null; + this.renderGlobal = Config.getRenderGlobal(); + this.textureWidth = 64.0F; + this.textureHeight = 32.0F; + this.showModel = true; + this.cubeList = Lists.newArrayList(); + this.baseModel = model; + model.boxList.add(this); + this.boxName = boxNameIn; + this.setTextureSize(model.textureWidth, model.textureHeight); + } + + public ModelRenderer(ModelBase model) + { + this(model, null); + } + + public ModelRenderer(ModelBase model, int texOffX, int texOffY) + { + this(model); + this.setTextureOffset(texOffX, texOffY); + } + + public void addChild(ModelRenderer renderer) + { + if (this.childModels == null) + { + this.childModels = Lists.newArrayList(); + } + + this.childModels.add(renderer); + } + + public ModelRenderer setTextureOffset(int x, int y) + { + this.textureOffsetX = x; + this.textureOffsetY = y; + return this; + } + + public ModelRenderer addBox(String partName, float offX, float offY, float offZ, int width, int height, int depth) + { + partName = this.boxName + "." + partName; + TextureOffset textureoffset = this.baseModel.getTextureOffset(partName); + this.setTextureOffset(textureoffset.textureOffsetX, textureoffset.textureOffsetY); + this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F)).setBoxName(partName)); + return this; + } + + public ModelRenderer addBox(float offX, float offY, float offZ, int width, int height, int depth) + { + this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, offX, offY, offZ, width, height, depth, 0.0F)); + return this; + } + + public ModelRenderer addBox(float p_178769_1_, float p_178769_2_, float p_178769_3_, int p_178769_4_, int p_178769_5_, int p_178769_6_, boolean p_178769_7_) + { + this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, p_178769_1_, p_178769_2_, p_178769_3_, p_178769_4_, p_178769_5_, p_178769_6_, 0.0F, p_178769_7_)); + return this; + } + + public void addBox(float p_78790_1_, float p_78790_2_, float p_78790_3_, int width, int height, int depth, float scaleFactor) + { + this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, p_78790_1_, p_78790_2_, p_78790_3_, width, height, depth, scaleFactor)); + } + + public void setRotationPoint(float rotationPointXIn, float rotationPointYIn, float rotationPointZIn) + { + this.rotationPointX = rotationPointXIn; + this.rotationPointY = rotationPointYIn; + this.rotationPointZ = rotationPointZIn; + } + + public void render(float p_78785_1_) + { + if (!this.isHidden && this.showModel) + { + this.checkResetDisplayList(); + + if (!this.compiled) + { + this.compileDisplayList(p_78785_1_); + } + + int i = 0; + + if (this.textureLocation != null && !this.renderGlobal.renderOverlayDamaged) + { + if (this.renderGlobal.renderOverlayEyes) + { + return; + } + + i = GlStateManager.getBoundTexture(); + Config.getTextureManager().bindTexture(this.textureLocation); + } + + if (this.modelUpdater != null) + { + this.modelUpdater.update(); + } + + boolean flag = this.scaleX != 1.0F || this.scaleY != 1.0F || this.scaleZ != 1.0F; + GlStateManager.translate(this.offsetX, this.offsetY, this.offsetZ); + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) + { + if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) + { + if (flag) + { + GlStateManager.scale(this.scaleX, this.scaleY, this.scaleZ); + } + + GlStateManager.callList(this.displayList); + + if (this.childModels != null) + { + for (ModelRenderer childModel : this.childModels) { + childModel.render(p_78785_1_); + } + } + + if (flag) + { + GlStateManager.scale(1.0F / this.scaleX, 1.0F / this.scaleY, 1.0F / this.scaleZ); + } + } + else + { + GlStateManager.translate(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); + + if (flag) + { + GlStateManager.scale(this.scaleX, this.scaleY, this.scaleZ); + } + + GlStateManager.callList(this.displayList); + + if (this.childModels != null) + { + for (int k = 0; k < this.childModels.size(); ++k) + { + ((ModelRenderer)this.childModels.get(k)).render(p_78785_1_); + } + } + + if (flag) + { + GlStateManager.scale(1.0F / this.scaleX, 1.0F / this.scaleY, 1.0F / this.scaleZ); + } + + GlStateManager.translate(-this.rotationPointX * p_78785_1_, -this.rotationPointY * p_78785_1_, -this.rotationPointZ * p_78785_1_); + } + } + else + { + GlStateManager.pushMatrix(); + GlStateManager.translate(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); + + if (this.rotateAngleZ != 0.0F) + { + GlStateManager.rotate(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) + { + GlStateManager.rotate(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GlStateManager.rotate(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (flag) + { + GlStateManager.scale(this.scaleX, this.scaleY, this.scaleZ); + } + + GlStateManager.callList(this.displayList); + + if (this.childModels != null) + { + for (int j = 0; j < this.childModels.size(); ++j) + { + ((ModelRenderer)this.childModels.get(j)).render(p_78785_1_); + } + } + + GlStateManager.popMatrix(); + } + + GlStateManager.translate(-this.offsetX, -this.offsetY, -this.offsetZ); + + if (i != 0) + { + GlStateManager.bindTexture(i); + } + } + } + + public void renderWithRotation(float p_78791_1_) + { + if (!this.isHidden && this.showModel) + { + this.checkResetDisplayList(); + + if (!this.compiled) + { + this.compileDisplayList(p_78791_1_); + } + + int i = 0; + + if (this.textureLocation != null && !this.renderGlobal.renderOverlayDamaged) + { + if (this.renderGlobal.renderOverlayEyes) + { + return; + } + + i = GlStateManager.getBoundTexture(); + Config.getTextureManager().bindTexture(this.textureLocation); + } + + if (this.modelUpdater != null) + { + this.modelUpdater.update(); + } + + boolean flag = this.scaleX != 1.0F || this.scaleY != 1.0F || this.scaleZ != 1.0F; + GlStateManager.pushMatrix(); + GlStateManager.translate(this.rotationPointX * p_78791_1_, this.rotationPointY * p_78791_1_, this.rotationPointZ * p_78791_1_); + + if (this.rotateAngleY != 0.0F) + { + GlStateManager.rotate(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GlStateManager.rotate(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (this.rotateAngleZ != 0.0F) + { + GlStateManager.rotate(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (flag) + { + GlStateManager.scale(this.scaleX, this.scaleY, this.scaleZ); + } + + GlStateManager.callList(this.displayList); + + if (this.childModels != null) + { + for (int j = 0; j < this.childModels.size(); ++j) + { + ((ModelRenderer)this.childModels.get(j)).render(p_78791_1_); + } + } + + GlStateManager.popMatrix(); + + if (i != 0) + { + GlStateManager.bindTexture(i); + } + } + } + + public void postRender(float scale) + { + if (!this.isHidden && this.showModel) + { + this.checkResetDisplayList(); + + if (!this.compiled) + { + this.compileDisplayList(scale); + } + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) + { + if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) + { + GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); + } + } + else + { + GlStateManager.translate(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); + + if (this.rotateAngleZ != 0.0F) + { + GlStateManager.rotate(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) + { + GlStateManager.rotate(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GlStateManager.rotate(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + } + } + } + + private void compileDisplayList(float scale) + { + if (this.displayList == 0) + { + this.displayList = GLAllocation.generateDisplayLists(1); + } + + GL11.glNewList(this.displayList, GL11.GL_COMPILE); + WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); + + for (int i = 0; i < this.cubeList.size(); ++i) + { + ((ModelBox)this.cubeList.get(i)).render(worldrenderer, scale); + } + + for (int j = 0; j < this.spriteList.size(); ++j) + { + ModelSprite modelsprite = (ModelSprite)this.spriteList.get(j); + modelsprite.render(Tessellator.getInstance(), scale); + } + + GL11.glEndList(); + this.compiled = true; + } + + public ModelRenderer setTextureSize(int textureWidthIn, int textureHeightIn) + { + this.textureWidth = (float)textureWidthIn; + this.textureHeight = (float)textureHeightIn; + return this; + } + + public void addSprite(float p_addSprite_1_, float p_addSprite_2_, float p_addSprite_3_, int p_addSprite_4_, int p_addSprite_5_, int p_addSprite_6_, float p_addSprite_7_) + { + this.spriteList.add(new ModelSprite(this, this.textureOffsetX, this.textureOffsetY, p_addSprite_1_, p_addSprite_2_, p_addSprite_3_, p_addSprite_4_, p_addSprite_5_, p_addSprite_6_, p_addSprite_7_)); + } + + public boolean getCompiled() + { + return this.compiled; + } + + public int getDisplayList() + { + return this.displayList; + } + + private void checkResetDisplayList() + { + if (this.countResetDisplayList != Shaders.countResetDisplayLists) + { + this.compiled = false; + this.countResetDisplayList = Shaders.countResetDisplayLists; + } + } + + public ResourceLocation getTextureLocation() + { + return this.textureLocation; + } + + public void setTextureLocation(ResourceLocation p_setTextureLocation_1_) + { + this.textureLocation = p_setTextureLocation_1_; + } + + public String getId() + { + return this.id; + } + + public void setId(String p_setId_1_) + { + this.id = p_setId_1_; + } + + public void addBox(int[][] p_addBox_1_, float p_addBox_2_, float p_addBox_3_, float p_addBox_4_, float p_addBox_5_, float p_addBox_6_, float p_addBox_7_, float p_addBox_8_) + { + this.cubeList.add(new ModelBox(this, p_addBox_1_, p_addBox_2_, p_addBox_3_, p_addBox_4_, p_addBox_5_, p_addBox_6_, p_addBox_7_, p_addBox_8_, this.mirror)); + } + + public ModelRenderer getChild(String p_getChild_1_) + { + if (p_getChild_1_ == null) + { + return null; + } + else + { + if (this.childModels != null) + { + for (int i = 0; i < this.childModels.size(); ++i) + { + ModelRenderer modelrenderer = (ModelRenderer)this.childModels.get(i); + + if (p_getChild_1_.equals(modelrenderer.getId())) + { + return modelrenderer; + } + } + } + + return null; + } + } + + public ModelRenderer getChildDeep(String p_getChildDeep_1_) + { + if (p_getChildDeep_1_ == null) + { + return null; + } + else + { + ModelRenderer modelrenderer = this.getChild(p_getChildDeep_1_); + + if (modelrenderer != null) + { + return modelrenderer; + } + else + { + if (this.childModels != null) + { + for (int i = 0; i < this.childModels.size(); ++i) + { + ModelRenderer modelrenderer1 = (ModelRenderer)this.childModels.get(i); + ModelRenderer modelrenderer2 = modelrenderer1.getChildDeep(p_getChildDeep_1_); + + if (modelrenderer2 != null) + { + return modelrenderer2; + } + } + } + + return null; + } + } + } + + public void setModelUpdater(ModelUpdater p_setModelUpdater_1_) + { + this.modelUpdater = p_setModelUpdater_1_; + } + + public String toString() + { + StringBuffer stringbuffer = new StringBuffer(); + stringbuffer.append("id: " + this.id + ", boxes: " + (this.cubeList != null ? Integer.valueOf(this.cubeList.size()) : null) + ", submodels: " + (this.childModels != null ? Integer.valueOf(this.childModels.size()) : null)); + return stringbuffer.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSheep1.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSheep1.java new file mode 100644 index 0000000..ee245b6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSheep1.java @@ -0,0 +1,47 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; + +public class ModelSheep1 extends ModelQuadruped +{ + private float headRotationAngleX; + + public ModelSheep1() + { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F); + this.head.setRotationPoint(0.0F, 6.0F, -8.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 1.75F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + float f = 0.5F; + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg1.setRotationPoint(-3.0F, 12.0F, 7.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg2.setRotationPoint(3.0F, 12.0F, 7.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg3.setRotationPoint(-3.0F, 12.0F, -5.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F); + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime); + this.head.rotationPointY = 6.0F + ((EntitySheep)entitylivingbaseIn).getHeadRotationPointY(partialTickTime) * 9.0F; + this.headRotationAngleX = ((EntitySheep)entitylivingbaseIn).getHeadRotationAngleX(partialTickTime); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.head.rotateAngleX = this.headRotationAngleX; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSheep2.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSheep2.java new file mode 100644 index 0000000..32be1fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSheep2.java @@ -0,0 +1,34 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; + +public class ModelSheep2 extends ModelQuadruped +{ + private float headRotationAngleX; + + public ModelSheep2() + { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F); + this.head.setRotationPoint(0.0F, 6.0F, -8.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime); + this.head.rotationPointY = 6.0F + ((EntitySheep)entitylivingbaseIn).getHeadRotationPointY(partialTickTime) * 9.0F; + this.headRotationAngleX = ((EntitySheep)entitylivingbaseIn).getHeadRotationAngleX(partialTickTime); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.head.rotateAngleX = this.headRotationAngleX; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSign.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSign.java new file mode 100644 index 0000000..44a7604 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSign.java @@ -0,0 +1,20 @@ +package net.minecraft.client.model; + +public class ModelSign extends ModelBase +{ + public ModelRenderer signBoard = new ModelRenderer(this, 0, 0); + public ModelRenderer signStick; + + public ModelSign() + { + this.signBoard.addBox(-12.0F, -14.0F, -1.0F, 24, 12, 2, 0.0F); + this.signStick = new ModelRenderer(this, 0, 14); + this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F); + } + + public void renderSign() + { + this.signBoard.render(0.0625F); + this.signStick.render(0.0625F); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSilverfish.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSilverfish.java new file mode 100644 index 0000000..cf1740d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSilverfish.java @@ -0,0 +1,72 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelSilverfish extends ModelBase +{ + private ModelRenderer[] silverfishBodyParts = new ModelRenderer[7]; + private ModelRenderer[] silverfishWings; + private float[] field_78170_c = new float[7]; + private static final int[][] silverfishBoxLength = new int[][] {{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; + private static final int[][] silverfishTexturePositions = new int[][] {{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; + + public ModelSilverfish() + { + float f = -3.5F; + + for (int i = 0; i < this.silverfishBodyParts.length; ++i) + { + this.silverfishBodyParts[i] = new ModelRenderer(this, silverfishTexturePositions[i][0], silverfishTexturePositions[i][1]); + this.silverfishBodyParts[i].addBox((float)silverfishBoxLength[i][0] * -0.5F, 0.0F, (float)silverfishBoxLength[i][2] * -0.5F, silverfishBoxLength[i][0], silverfishBoxLength[i][1], silverfishBoxLength[i][2]); + this.silverfishBodyParts[i].setRotationPoint(0.0F, (float)(24 - silverfishBoxLength[i][1]), f); + this.field_78170_c[i] = f; + + if (i < this.silverfishBodyParts.length - 1) + { + f += (float)(silverfishBoxLength[i][2] + silverfishBoxLength[i + 1][2]) * 0.5F; + } + } + + this.silverfishWings = new ModelRenderer[3]; + this.silverfishWings[0] = new ModelRenderer(this, 20, 0); + this.silverfishWings[0].addBox(-5.0F, 0.0F, (float)silverfishBoxLength[2][2] * -0.5F, 10, 8, silverfishBoxLength[2][2]); + this.silverfishWings[0].setRotationPoint(0.0F, 16.0F, this.field_78170_c[2]); + this.silverfishWings[1] = new ModelRenderer(this, 20, 11); + this.silverfishWings[1].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 4, silverfishBoxLength[4][2]); + this.silverfishWings[1].setRotationPoint(0.0F, 20.0F, this.field_78170_c[4]); + this.silverfishWings[2] = new ModelRenderer(this, 20, 18); + this.silverfishWings[2].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 5, silverfishBoxLength[1][2]); + this.silverfishWings[2].setRotationPoint(0.0F, 19.0F, this.field_78170_c[1]); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + for (int i = 0; i < this.silverfishBodyParts.length; ++i) + { + this.silverfishBodyParts[i].render(scale); + } + + for (int j = 0; j < this.silverfishWings.length; ++j) + { + this.silverfishWings[j].render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + for (int i = 0; i < this.silverfishBodyParts.length; ++i) + { + this.silverfishBodyParts[i].rotateAngleY = MathHelper.cos(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(i - 2)); + this.silverfishBodyParts[i].rotationPointX = MathHelper.sin(ageInTicks * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(i - 2); + } + + this.silverfishWings[0].rotateAngleY = this.silverfishBodyParts[2].rotateAngleY; + this.silverfishWings[1].rotateAngleY = this.silverfishBodyParts[4].rotateAngleY; + this.silverfishWings[1].rotationPointX = this.silverfishBodyParts[4].rotationPointX; + this.silverfishWings[2].rotateAngleY = this.silverfishBodyParts[1].rotateAngleY; + this.silverfishWings[2].rotationPointX = this.silverfishBodyParts[1].rotationPointX; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSkeleton.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSkeleton.java new file mode 100644 index 0000000..db3c697 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSkeleton.java @@ -0,0 +1,47 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntitySkeleton; + +public class ModelSkeleton extends ModelZombie +{ + public ModelSkeleton() + { + this(0.0F, false); + } + + public ModelSkeleton(float p_i46303_1_, boolean p_i46303_2_) + { + super(p_i46303_1_, 0.0F, 64, 32); + + if (!p_i46303_2_) + { + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i46303_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i46303_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i46303_1_); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i46303_1_); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F); + } + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + this.aimedBow = ((EntitySkeleton)entitylivingbaseIn).getSkeletonType() == 1; + super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java new file mode 100644 index 0000000..c4a6e85 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java @@ -0,0 +1,35 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelSkeletonHead extends ModelBase +{ + public ModelRenderer skeletonHead; + + public ModelSkeletonHead() + { + this(0, 35, 64, 64); + } + + public ModelSkeletonHead(int p_i1155_1_, int p_i1155_2_, int p_i1155_3_, int p_i1155_4_) + { + this.textureWidth = p_i1155_3_; + this.textureHeight = p_i1155_4_; + this.skeletonHead = new ModelRenderer(this, p_i1155_1_, p_i1155_2_); + this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); + this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.skeletonHead.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.skeletonHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.skeletonHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSlime.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSlime.java new file mode 100644 index 0000000..3826fec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSlime.java @@ -0,0 +1,42 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelSlime extends ModelBase +{ + ModelRenderer slimeBodies; + ModelRenderer slimeRightEye; + ModelRenderer slimeLeftEye; + ModelRenderer slimeMouth; + + public ModelSlime(int p_i1157_1_) + { + this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_); + this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); + + if (p_i1157_1_ > 0) + { + this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_); + this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6); + this.slimeRightEye = new ModelRenderer(this, 32, 0); + this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeLeftEye = new ModelRenderer(this, 32, 4); + this.slimeLeftEye.addBox(1.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeMouth = new ModelRenderer(this, 32, 8); + this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1); + } + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.slimeBodies.render(scale); + + if (this.slimeRightEye != null) + { + this.slimeRightEye.render(scale); + this.slimeLeftEye.render(scale); + this.slimeMouth.render(scale); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSnowMan.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSnowMan.java new file mode 100644 index 0000000..9016a57 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSnowMan.java @@ -0,0 +1,62 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelSnowMan extends ModelBase +{ + public ModelRenderer body; + public ModelRenderer bottomBody; + public ModelRenderer head; + public ModelRenderer rightHand; + public ModelRenderer leftHand; + + public ModelSnowMan() + { + float f = 4.0F; + float f1 = 0.0F; + this.head = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, f1 - 0.5F); + this.head.setRotationPoint(0.0F, 0.0F + f, 0.0F); + this.rightHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); + this.rightHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, f1 - 0.5F); + this.rightHand.setRotationPoint(0.0F, 0.0F + f + 9.0F - 7.0F, 0.0F); + this.leftHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); + this.leftHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, f1 - 0.5F); + this.leftHand.setRotationPoint(0.0F, 0.0F + f + 9.0F - 7.0F, 0.0F); + this.body = (new ModelRenderer(this, 0, 16)).setTextureSize(64, 64); + this.body.addBox(-5.0F, -10.0F, -5.0F, 10, 10, 10, f1 - 0.5F); + this.body.setRotationPoint(0.0F, 0.0F + f + 9.0F, 0.0F); + this.bottomBody = (new ModelRenderer(this, 0, 36)).setTextureSize(64, 64); + this.bottomBody.addBox(-6.0F, -12.0F, -6.0F, 12, 12, 12, f1 - 0.5F); + this.bottomBody.setRotationPoint(0.0F, 0.0F + f + 20.0F, 0.0F); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.head.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.head.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.body.rotateAngleY = netHeadYaw / (180F / (float)Math.PI) * 0.25F; + float f = MathHelper.sin(this.body.rotateAngleY); + float f1 = MathHelper.cos(this.body.rotateAngleY); + this.rightHand.rotateAngleZ = 1.0F; + this.leftHand.rotateAngleZ = -1.0F; + this.rightHand.rotateAngleY = 0.0F + this.body.rotateAngleY; + this.leftHand.rotateAngleY = (float)Math.PI + this.body.rotateAngleY; + this.rightHand.rotationPointX = f1 * 5.0F; + this.rightHand.rotationPointZ = -f * 5.0F; + this.leftHand.rotationPointX = -f1 * 5.0F; + this.leftHand.rotationPointZ = f * 5.0F; + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.body.render(scale); + this.bottomBody.render(scale); + this.head.render(scale); + this.rightHand.render(scale); + this.leftHand.render(scale); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSpider.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSpider.java new file mode 100644 index 0000000..d020bf8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSpider.java @@ -0,0 +1,123 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelSpider extends ModelBase +{ + public ModelRenderer spiderHead; + public ModelRenderer spiderNeck; + public ModelRenderer spiderBody; + public ModelRenderer spiderLeg1; + public ModelRenderer spiderLeg2; + public ModelRenderer spiderLeg3; + public ModelRenderer spiderLeg4; + public ModelRenderer spiderLeg5; + public ModelRenderer spiderLeg6; + public ModelRenderer spiderLeg7; + public ModelRenderer spiderLeg8; + + public ModelSpider() + { + float f = 0.0F; + int i = 15; + this.spiderHead = new ModelRenderer(this, 32, 4); + this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, f); + this.spiderHead.setRotationPoint(0.0F, (float)i, -3.0F); + this.spiderNeck = new ModelRenderer(this, 0, 0); + this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, f); + this.spiderNeck.setRotationPoint(0.0F, (float)i, 0.0F); + this.spiderBody = new ModelRenderer(this, 0, 12); + this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, f); + this.spiderBody.setRotationPoint(0.0F, (float)i, 9.0F); + this.spiderLeg1 = new ModelRenderer(this, 18, 0); + this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg1.setRotationPoint(-4.0F, (float)i, 2.0F); + this.spiderLeg2 = new ModelRenderer(this, 18, 0); + this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg2.setRotationPoint(4.0F, (float)i, 2.0F); + this.spiderLeg3 = new ModelRenderer(this, 18, 0); + this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg3.setRotationPoint(-4.0F, (float)i, 1.0F); + this.spiderLeg4 = new ModelRenderer(this, 18, 0); + this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg4.setRotationPoint(4.0F, (float)i, 1.0F); + this.spiderLeg5 = new ModelRenderer(this, 18, 0); + this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg5.setRotationPoint(-4.0F, (float)i, 0.0F); + this.spiderLeg6 = new ModelRenderer(this, 18, 0); + this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg6.setRotationPoint(4.0F, (float)i, 0.0F); + this.spiderLeg7 = new ModelRenderer(this, 18, 0); + this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg7.setRotationPoint(-4.0F, (float)i, -1.0F); + this.spiderLeg8 = new ModelRenderer(this, 18, 0); + this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg8.setRotationPoint(4.0F, (float)i, -1.0F); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.spiderHead.render(scale); + this.spiderNeck.render(scale); + this.spiderBody.render(scale); + this.spiderLeg1.render(scale); + this.spiderLeg2.render(scale); + this.spiderLeg3.render(scale); + this.spiderLeg4.render(scale); + this.spiderLeg5.render(scale); + this.spiderLeg6.render(scale); + this.spiderLeg7.render(scale); + this.spiderLeg8.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + this.spiderHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.spiderHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + float f = ((float)Math.PI / 4F); + this.spiderLeg1.rotateAngleZ = -f; + this.spiderLeg2.rotateAngleZ = f; + this.spiderLeg3.rotateAngleZ = -f * 0.74F; + this.spiderLeg4.rotateAngleZ = f * 0.74F; + this.spiderLeg5.rotateAngleZ = -f * 0.74F; + this.spiderLeg6.rotateAngleZ = f * 0.74F; + this.spiderLeg7.rotateAngleZ = -f; + this.spiderLeg8.rotateAngleZ = f; + float f1 = -0.0F; + float f2 = 0.3926991F; + this.spiderLeg1.rotateAngleY = f2 * 2.0F + f1; + this.spiderLeg2.rotateAngleY = -f2 * 2.0F - f1; + this.spiderLeg3.rotateAngleY = f2 * 1.0F + f1; + this.spiderLeg4.rotateAngleY = -f2 * 1.0F - f1; + this.spiderLeg5.rotateAngleY = -f2 * 1.0F + f1; + this.spiderLeg6.rotateAngleY = f2 * 1.0F - f1; + this.spiderLeg7.rotateAngleY = -f2 * 2.0F + f1; + this.spiderLeg8.rotateAngleY = f2 * 2.0F - f1; + float f3 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + 0.0F) * 0.4F) * limbSwingAmount; + float f4 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * limbSwingAmount; + float f5 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * limbSwingAmount; + float f6 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount; + float f7 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + 0.0F) * 0.4F) * limbSwingAmount; + float f8 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + (float)Math.PI) * 0.4F) * limbSwingAmount; + float f9 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * limbSwingAmount; + float f10 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount; + this.spiderLeg1.rotateAngleY += f3; + this.spiderLeg2.rotateAngleY += -f3; + this.spiderLeg3.rotateAngleY += f4; + this.spiderLeg4.rotateAngleY += -f4; + this.spiderLeg5.rotateAngleY += f5; + this.spiderLeg6.rotateAngleY += -f5; + this.spiderLeg7.rotateAngleY += f6; + this.spiderLeg8.rotateAngleY += -f6; + this.spiderLeg1.rotateAngleZ += f7; + this.spiderLeg2.rotateAngleZ += -f7; + this.spiderLeg3.rotateAngleZ += f8; + this.spiderLeg4.rotateAngleZ += -f8; + this.spiderLeg5.rotateAngleZ += f9; + this.spiderLeg6.rotateAngleZ += -f9; + this.spiderLeg7.rotateAngleZ += f10; + this.spiderLeg8.rotateAngleZ += -f10; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSquid.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSquid.java new file mode 100644 index 0000000..f6e6b1c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelSquid.java @@ -0,0 +1,50 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelSquid extends ModelBase +{ + ModelRenderer squidBody; + ModelRenderer[] squidTentacles = new ModelRenderer[8]; + + public ModelSquid() + { + int i = -16; + this.squidBody = new ModelRenderer(this, 0, 0); + this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12); + this.squidBody.rotationPointY += (float)(24 + i); + + for (int j = 0; j < this.squidTentacles.length; ++j) + { + this.squidTentacles[j] = new ModelRenderer(this, 48, 0); + double d0 = (double)j * Math.PI * 2.0D / (double)this.squidTentacles.length; + float f = (float)Math.cos(d0) * 5.0F; + float f1 = (float)Math.sin(d0) * 5.0F; + this.squidTentacles[j].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2); + this.squidTentacles[j].rotationPointX = f; + this.squidTentacles[j].rotationPointZ = f1; + this.squidTentacles[j].rotationPointY = (float)(31 + i); + d0 = (double)j * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D); + this.squidTentacles[j].rotateAngleY = (float)d0; + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + for (ModelRenderer modelrenderer : this.squidTentacles) + { + modelrenderer.rotateAngleX = ageInTicks; + } + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.squidBody.render(scale); + + for (int i = 0; i < this.squidTentacles.length; ++i) + { + this.squidTentacles[i].render(scale); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelVillager.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelVillager.java new file mode 100644 index 0000000..ec0e5b4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelVillager.java @@ -0,0 +1,69 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelVillager extends ModelBase +{ + public ModelRenderer villagerHead; + public ModelRenderer villagerBody; + public ModelRenderer villagerArms; + public ModelRenderer rightVillagerLeg; + public ModelRenderer leftVillagerLeg; + public ModelRenderer villagerNose; + + public ModelVillager(float p_i1163_1_) + { + this(p_i1163_1_, 0.0F, 64, 64); + } + + public ModelVillager(float p_i1164_1_, float p_i1164_2_, int p_i1164_3_, int p_i1164_4_) + { + this.villagerHead = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerHead.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F); + this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1164_1_); + this.villagerNose = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerNose.setRotationPoint(0.0F, p_i1164_2_ - 2.0F, 0.0F); + this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, p_i1164_1_); + this.villagerHead.addChild(this.villagerNose); + this.villagerBody = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerBody.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F); + this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, p_i1164_1_); + this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, p_i1164_1_ + 0.5F); + this.villagerArms = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerArms.setRotationPoint(0.0F, 0.0F + p_i1164_2_ + 2.0F, 0.0F); + this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, p_i1164_1_); + this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, p_i1164_1_); + this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, p_i1164_1_); + this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + p_i1164_2_, 0.0F); + this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1164_1_); + this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.leftVillagerLeg.mirror = true; + this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + p_i1164_2_, 0.0F); + this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1164_1_); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + this.villagerHead.render(scale); + this.villagerBody.render(scale); + this.rightVillagerLeg.render(scale); + this.leftVillagerLeg.render(scale); + this.villagerArms.render(scale); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + this.villagerHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.villagerHead.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.villagerArms.rotationPointY = 3.0F; + this.villagerArms.rotationPointZ = -1.0F; + this.villagerArms.rotateAngleX = -0.75F; + this.rightVillagerLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount * 0.5F; + this.leftVillagerLeg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F + (float)Math.PI) * 1.4F * limbSwingAmount * 0.5F; + this.rightVillagerLeg.rotateAngleY = 0.0F; + this.leftVillagerLeg.rotateAngleY = 0.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWitch.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWitch.java new file mode 100644 index 0000000..0374314 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWitch.java @@ -0,0 +1,58 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelWitch extends ModelVillager +{ + public boolean field_82900_g; + private ModelRenderer field_82901_h = (new ModelRenderer(this)).setTextureSize(64, 128); + private ModelRenderer witchHat; + + public ModelWitch(float p_i46361_1_) + { + super(p_i46361_1_, 0.0F, 64, 128); + this.field_82901_h.setRotationPoint(0.0F, -2.0F, 0.0F); + this.field_82901_h.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F); + this.villagerNose.addChild(this.field_82901_h); + this.witchHat = (new ModelRenderer(this)).setTextureSize(64, 128); + this.witchHat.setRotationPoint(-5.0F, -10.03125F, -5.0F); + this.witchHat.setTextureOffset(0, 64).addBox(0.0F, 0.0F, 0.0F, 10, 2, 10); + this.villagerHead.addChild(this.witchHat); + ModelRenderer modelrenderer = (new ModelRenderer(this)).setTextureSize(64, 128); + modelrenderer.setRotationPoint(1.75F, -4.0F, 2.0F); + modelrenderer.setTextureOffset(0, 76).addBox(0.0F, 0.0F, 0.0F, 7, 4, 7); + modelrenderer.rotateAngleX = -0.05235988F; + modelrenderer.rotateAngleZ = 0.02617994F; + this.witchHat.addChild(modelrenderer); + ModelRenderer modelrenderer1 = (new ModelRenderer(this)).setTextureSize(64, 128); + modelrenderer1.setRotationPoint(1.75F, -4.0F, 2.0F); + modelrenderer1.setTextureOffset(0, 87).addBox(0.0F, 0.0F, 0.0F, 4, 4, 4); + modelrenderer1.rotateAngleX = -0.10471976F; + modelrenderer1.rotateAngleZ = 0.05235988F; + modelrenderer.addChild(modelrenderer1); + ModelRenderer modelrenderer2 = (new ModelRenderer(this)).setTextureSize(64, 128); + modelrenderer2.setRotationPoint(1.75F, -2.0F, 2.0F); + modelrenderer2.setTextureOffset(0, 95).addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.25F); + modelrenderer2.rotateAngleX = -0.20943952F; + modelrenderer2.rotateAngleZ = 0.10471976F; + modelrenderer1.addChild(modelrenderer2); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.villagerNose.offsetX = this.villagerNose.offsetY = this.villagerNose.offsetZ = 0.0F; + float f = 0.01F * (float)(entityIn.getEntityId() % 10); + this.villagerNose.rotateAngleX = MathHelper.sin((float)entityIn.ticksExisted * f) * 4.5F * (float)Math.PI / 180.0F; + this.villagerNose.rotateAngleY = 0.0F; + this.villagerNose.rotateAngleZ = MathHelper.cos((float)entityIn.ticksExisted * f) * 2.5F * (float)Math.PI / 180.0F; + + if (this.field_82900_g) + { + this.villagerNose.rotateAngleX = -0.9F; + this.villagerNose.offsetZ = -0.09375F; + this.villagerNose.offsetY = 0.1875F; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWither.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWither.java new file mode 100644 index 0000000..7d5e6fe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWither.java @@ -0,0 +1,76 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.util.MathHelper; + +public class ModelWither extends ModelBase +{ + private ModelRenderer[] field_82905_a; + private ModelRenderer[] field_82904_b; + + public ModelWither(float p_i46302_1_) + { + this.textureWidth = 64; + this.textureHeight = 64; + this.field_82905_a = new ModelRenderer[3]; + this.field_82905_a[0] = new ModelRenderer(this, 0, 16); + this.field_82905_a[0].addBox(-10.0F, 3.9F, -0.5F, 20, 3, 3, p_i46302_1_); + this.field_82905_a[1] = (new ModelRenderer(this)).setTextureSize(this.textureWidth, this.textureHeight); + this.field_82905_a[1].setRotationPoint(-2.0F, 6.9F, -0.5F); + this.field_82905_a[1].setTextureOffset(0, 22).addBox(0.0F, 0.0F, 0.0F, 3, 10, 3, p_i46302_1_); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 1.5F, 0.5F, 11, 2, 2, p_i46302_1_); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 4.0F, 0.5F, 11, 2, 2, p_i46302_1_); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 6.5F, 0.5F, 11, 2, 2, p_i46302_1_); + this.field_82905_a[2] = new ModelRenderer(this, 12, 22); + this.field_82905_a[2].addBox(0.0F, 0.0F, 0.0F, 3, 6, 3, p_i46302_1_); + this.field_82904_b = new ModelRenderer[3]; + this.field_82904_b[0] = new ModelRenderer(this, 0, 0); + this.field_82904_b[0].addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8, p_i46302_1_); + this.field_82904_b[1] = new ModelRenderer(this, 32, 0); + this.field_82904_b[1].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6, p_i46302_1_); + this.field_82904_b[1].rotationPointX = -8.0F; + this.field_82904_b[1].rotationPointY = 4.0F; + this.field_82904_b[2] = new ModelRenderer(this, 32, 0); + this.field_82904_b[2].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6, p_i46302_1_); + this.field_82904_b[2].rotationPointX = 10.0F; + this.field_82904_b[2].rotationPointY = 4.0F; + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + for (ModelRenderer modelrenderer : this.field_82904_b) + { + modelrenderer.render(scale); + } + + for (ModelRenderer modelrenderer1 : this.field_82905_a) + { + modelrenderer1.render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + float f = MathHelper.cos(ageInTicks * 0.1F); + this.field_82905_a[1].rotateAngleX = (0.065F + 0.05F * f) * (float)Math.PI; + this.field_82905_a[2].setRotationPoint(-2.0F, 6.9F + MathHelper.cos(this.field_82905_a[1].rotateAngleX) * 10.0F, -0.5F + MathHelper.sin(this.field_82905_a[1].rotateAngleX) * 10.0F); + this.field_82905_a[2].rotateAngleX = (0.265F + 0.1F * f) * (float)Math.PI; + this.field_82904_b[0].rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.field_82904_b[0].rotateAngleX = headPitch / (180F / (float)Math.PI); + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + EntityWither entitywither = (EntityWither)entitylivingbaseIn; + + for (int i = 1; i < 3; ++i) + { + this.field_82904_b[i].rotateAngleY = (entitywither.func_82207_a(i - 1) - entitylivingbaseIn.renderYawOffset) / (180F / (float)Math.PI); + this.field_82904_b[i].rotateAngleX = entitywither.func_82210_r(i - 1) / (180F / (float)Math.PI); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWolf.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWolf.java new file mode 100644 index 0000000..362d2fe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelWolf.java @@ -0,0 +1,150 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.MathHelper; + +public class ModelWolf extends ModelBase +{ + public ModelRenderer wolfHeadMain; + public ModelRenderer wolfBody; + public ModelRenderer wolfLeg1; + public ModelRenderer wolfLeg2; + public ModelRenderer wolfLeg3; + public ModelRenderer wolfLeg4; + ModelRenderer wolfTail; + ModelRenderer wolfMane; + + public ModelWolf() + { + float f = 0.0F; + float f1 = 13.5F; + this.wolfHeadMain = new ModelRenderer(this, 0, 0); + this.wolfHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, f); + this.wolfHeadMain.setRotationPoint(-1.0F, f1, -7.0F); + this.wolfBody = new ModelRenderer(this, 18, 14); + this.wolfBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, f); + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfMane = new ModelRenderer(this, 21, 0); + this.wolfMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, f); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F); + this.wolfLeg1 = new ModelRenderer(this, 0, 18); + this.wolfLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2 = new ModelRenderer(this, 0, 18); + this.wolfLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3 = new ModelRenderer(this, 0, 18); + this.wolfLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4 = new ModelRenderer(this, 0, 18); + this.wolfLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfTail = new ModelRenderer(this, 9, 18); + this.wolfTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, f); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, f); + this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, f); + } + + public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) + { + super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale); + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entityIn); + + if (this.isChild) + { + float f = 2.0F; + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 5.0F * scale, 2.0F * scale); + this.wolfHeadMain.renderWithRotation(scale); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.wolfBody.render(scale); + this.wolfLeg1.render(scale); + this.wolfLeg2.render(scale); + this.wolfLeg3.render(scale); + this.wolfLeg4.render(scale); + this.wolfTail.renderWithRotation(scale); + this.wolfMane.render(scale); + GlStateManager.popMatrix(); + } + else + { + this.wolfHeadMain.renderWithRotation(scale); + this.wolfBody.render(scale); + this.wolfLeg1.render(scale); + this.wolfLeg2.render(scale); + this.wolfLeg3.render(scale); + this.wolfLeg4.render(scale); + this.wolfTail.renderWithRotation(scale); + this.wolfMane.render(scale); + } + } + + public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime) + { + EntityWolf entitywolf = (EntityWolf)entitylivingbaseIn; + + if (entitywolf.isAngry()) + { + this.wolfTail.rotateAngleY = 0.0F; + } + else + { + this.wolfTail.rotateAngleY = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + } + + if (entitywolf.isSitting()) + { + this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F); + this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F); + this.wolfMane.rotateAngleY = 0.0F; + this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F); + this.wolfBody.rotateAngleX = ((float)Math.PI / 4F); + this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F); + this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F); + this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F); + this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F); + this.wolfLeg3.rotateAngleX = 5.811947F; + this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F); + this.wolfLeg4.rotateAngleX = 5.811947F; + this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F); + } + else + { + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfBody.rotateAngleX = ((float)Math.PI / 2F); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F); + this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX; + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfLeg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + this.wolfLeg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + } + + this.wolfHeadMain.rotateAngleZ = entitywolf.getInterestedAngle(partialTickTime) + entitywolf.getShakeAngle(partialTickTime, 0.0F); + this.wolfMane.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.08F); + this.wolfBody.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.16F); + this.wolfTail.rotateAngleZ = entitywolf.getShakeAngle(partialTickTime, -0.2F); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + this.wolfHeadMain.rotateAngleX = headPitch / (180F / (float)Math.PI); + this.wolfHeadMain.rotateAngleY = netHeadYaw / (180F / (float)Math.PI); + this.wolfTail.rotateAngleX = ageInTicks; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelZombie.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelZombie.java new file mode 100644 index 0000000..7604b7d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelZombie.java @@ -0,0 +1,41 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelZombie extends ModelBiped +{ + public ModelZombie() + { + this(0.0F, false); + } + + protected ModelZombie(float modelSize, float p_i1167_2_, int textureWidthIn, int textureHeightIn) + { + super(modelSize, p_i1167_2_, textureWidthIn, textureHeightIn); + } + + public ModelZombie(float modelSize, boolean p_i1168_2_) + { + super(modelSize, 0.0F, 64, p_i1168_2_ ? 32 : 64); + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + float f = MathHelper.sin(this.swingProgress * (float)Math.PI); + float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= f * 1.2F - f1 * 0.4F; + this.bipedLeftArm.rotateAngleX -= f * 1.2F - f1 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelZombieVillager.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelZombieVillager.java new file mode 100644 index 0000000..68c4d46 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/ModelZombieVillager.java @@ -0,0 +1,50 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelZombieVillager extends ModelBiped +{ + public ModelZombieVillager() + { + this(0.0F, 0.0F, false); + } + + public ModelZombieVillager(float p_i1165_1_, float p_i1165_2_, boolean p_i1165_3_) + { + super(p_i1165_1_, 0.0F, 64, p_i1165_3_ ? 32 : 64); + + if (p_i1165_3_) + { + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 8, 8, p_i1165_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F); + } + else + { + this.bipedHead = new ModelRenderer(this); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F); + this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1165_1_); + this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, p_i1165_1_); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + float f = MathHelper.sin(this.swingProgress * (float)Math.PI); + float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= f * 1.2F - f1 * 0.4F; + this.bipedLeftArm.rotateAngleX -= f * 1.2F - f1 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/PositionTextureVertex.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/PositionTextureVertex.java new file mode 100644 index 0000000..1747564 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/PositionTextureVertex.java @@ -0,0 +1,34 @@ +package net.minecraft.client.model; + +import net.minecraft.util.Vec3; + +public class PositionTextureVertex +{ + public Vec3 vector3D; + public float texturePositionX; + public float texturePositionY; + + public PositionTextureVertex(float p_i1158_1_, float p_i1158_2_, float p_i1158_3_, float p_i1158_4_, float p_i1158_5_) + { + this(new Vec3((double)p_i1158_1_, (double)p_i1158_2_, (double)p_i1158_3_), p_i1158_4_, p_i1158_5_); + } + + public PositionTextureVertex setTexturePosition(float p_78240_1_, float p_78240_2_) + { + return new PositionTextureVertex(this, p_78240_1_, p_78240_2_); + } + + public PositionTextureVertex(PositionTextureVertex textureVertex, float texturePositionXIn, float texturePositionYIn) + { + this.vector3D = textureVertex.vector3D; + this.texturePositionX = texturePositionXIn; + this.texturePositionY = texturePositionYIn; + } + + public PositionTextureVertex(Vec3 vector3DIn, float texturePositionXIn, float texturePositionYIn) + { + this.vector3D = vector3DIn; + this.texturePositionX = texturePositionXIn; + this.texturePositionY = texturePositionYIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/TextureOffset.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/TextureOffset.java new file mode 100644 index 0000000..42284de --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/TextureOffset.java @@ -0,0 +1,13 @@ +package net.minecraft.client.model; + +public class TextureOffset +{ + public final int textureOffsetX; + public final int textureOffsetY; + + public TextureOffset(int textureOffsetXIn, int textureOffsetYIn) + { + this.textureOffsetX = textureOffsetXIn; + this.textureOffsetY = textureOffsetYIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/model/TexturedQuad.java b/Client-1.8.9/src/main/java/net/minecraft/client/model/TexturedQuad.java new file mode 100644 index 0000000..c1132a4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/model/TexturedQuad.java @@ -0,0 +1,78 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.src.Config; +import net.minecraft.util.Vec3; +import net.optifine.shaders.SVertexFormat; + +public class TexturedQuad +{ + public PositionTextureVertex[] vertexPositions; + public int nVertices; + private boolean invertNormal; + + public TexturedQuad(PositionTextureVertex[] vertices) + { + this.vertexPositions = vertices; + this.nVertices = vertices.length; + } + + public TexturedQuad(PositionTextureVertex[] vertices, int texcoordU1, int texcoordV1, int texcoordU2, int texcoordV2, float textureWidth, float textureHeight) + { + this(vertices); + float f = 0.0F / textureWidth; + float f1 = 0.0F / textureHeight; + vertices[0] = vertices[0].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV1 / textureHeight + f1); + vertices[1] = vertices[1].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV1 / textureHeight + f1); + vertices[2] = vertices[2].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV2 / textureHeight - f1); + vertices[3] = vertices[3].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV2 / textureHeight - f1); + } + + public void flipFace() + { + PositionTextureVertex[] apositiontexturevertex = new PositionTextureVertex[this.vertexPositions.length]; + + for (int i = 0; i < this.vertexPositions.length; ++i) + { + apositiontexturevertex[i] = this.vertexPositions[this.vertexPositions.length - i - 1]; + } + + this.vertexPositions = apositiontexturevertex; + } + + public void draw(WorldRenderer renderer, float scale) + { + Vec3 vec3 = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[0].vector3D); + Vec3 vec31 = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[2].vector3D); + Vec3 vec32 = vec31.crossProduct(vec3).normalize(); + float f = (float)vec32.xCoord; + float f1 = (float)vec32.yCoord; + float f2 = (float)vec32.zCoord; + + if (this.invertNormal) + { + f = -f; + f1 = -f1; + f2 = -f2; + } + + if (Config.isShaders()) + { + renderer.begin(7, SVertexFormat.defVertexFormatTextured); + } + else + { + renderer.begin(7, DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL); + } + + for (int i = 0; i < 4; ++i) + { + PositionTextureVertex positiontexturevertex = this.vertexPositions[i]; + renderer.pos(positiontexturevertex.vector3D.xCoord * (double)scale, positiontexturevertex.vector3D.yCoord * (double)scale, positiontexturevertex.vector3D.zCoord * (double)scale).tex((double)positiontexturevertex.texturePositionX, (double)positiontexturevertex.texturePositionY).normal(f, f1, f2).endVertex(); + } + + Tessellator.getInstance().draw(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java new file mode 100644 index 0000000..3e08fcd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java @@ -0,0 +1,133 @@ +package net.minecraft.client.multiplayer; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.LongHashMap; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ChunkProviderClient implements IChunkProvider +{ + private static final Logger logger = LogManager.getLogger(); + private Chunk blankChunk; + private LongHashMap chunkMapping = new LongHashMap(); + private List chunkListing = Lists.newArrayList(); + private World worldObj; + + public ChunkProviderClient(World worldIn) + { + this.blankChunk = new EmptyChunk(worldIn, 0, 0); + this.worldObj = worldIn; + } + + public boolean chunkExists(int x, int z) + { + return true; + } + + public void unloadChunk(int x, int z) + { + Chunk chunk = this.provideChunk(x, z); + + if (!chunk.isEmpty()) + { + chunk.onChunkUnload(); + } + + this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(x, z)); + this.chunkListing.remove(chunk); + } + + public Chunk loadChunk(int chunkX, int chunkZ) + { + Chunk chunk = new Chunk(this.worldObj, chunkX, chunkZ); + this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ), chunk); + this.chunkListing.add(chunk); + chunk.setChunkLoaded(true); + return chunk; + } + + public Chunk provideChunk(int x, int z) + { + Chunk chunk = (Chunk)this.chunkMapping.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(x, z)); + return chunk == null ? this.blankChunk : chunk; + } + + public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback) + { + return true; + } + + public void saveExtraData() + { + } + + public boolean unloadQueuedChunks() + { + long i = System.currentTimeMillis(); + + for (Chunk chunk : this.chunkListing) + { + chunk.func_150804_b(System.currentTimeMillis() - i > 5L); + } + + if (System.currentTimeMillis() - i > 100L) + { + logger.info("Warning: Clientside chunk ticking took {} ms", new Object[] {Long.valueOf(System.currentTimeMillis() - i)}); + } + + return false; + } + + public boolean canSave() + { + return false; + } + + public void populate(IChunkProvider chunkProvider, int x, int z) + { + } + + public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z) + { + return false; + } + + public String makeString() + { + return "MultiplayerChunkCache: " + this.chunkMapping.getNumHashElements() + ", " + this.chunkListing.size(); + } + + public List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) + { + return null; + } + + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + { + return null; + } + + public int getLoadedChunkCount() + { + return this.chunkListing.size(); + } + + public void recreateStructures(Chunk chunkIn, int x, int z) + { + } + + public Chunk provideChunk(BlockPos blockPosIn) + { + return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java new file mode 100644 index 0000000..7a0a4ea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java @@ -0,0 +1,160 @@ +package net.minecraft.client.multiplayer; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.concurrent.atomic.AtomicInteger; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.network.ConnectEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GuiConnecting extends GuiScreen +{ + private static final AtomicInteger CONNECTION_ID = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private NetworkManager networkManager; + private boolean cancel; + private final GuiScreen previousGuiScreen; + + public GuiConnecting(GuiScreen p_i1181_1_, Minecraft mcIn, ServerData p_i1181_3_) + { + this.mc = mcIn; + this.previousGuiScreen = p_i1181_1_; + ServerAddress serveraddress = ServerAddress.fromString(p_i1181_3_.serverIP); + mcIn.loadWorld((WorldClient)null); + mcIn.setServerData(p_i1181_3_); + this.connect(serveraddress.getIP(), serveraddress.getPort()); + } + + public GuiConnecting(GuiScreen p_i1182_1_, Minecraft mcIn, String hostName, int port) + { + this.mc = mcIn; + this.previousGuiScreen = p_i1182_1_; + mcIn.loadWorld((WorldClient)null); + this.connect(hostName, port); + } + + private void connect(final String ip, final int port) + { + logger.info("Connecting to " + ip + ", " + port); + (new Thread("Server Connector #" + CONNECTION_ID.incrementAndGet()) + { + public void run() + { + InetAddress inetaddress = null; + + try + { + if (GuiConnecting.this.cancel) + { + return; + } + CheatBreaker.getInstance().getEventBus().handleEvent(new ConnectEvent()); + inetaddress = InetAddress.getByName(ip); + GuiConnecting.this.networkManager = NetworkManager.createNetworkManagerAndConnect(inetaddress, port, GuiConnecting.this.mc.gameSettings.isUsingNativeTransport()); + GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen)); + GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN)); + GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile())); + } + catch (UnknownHostException unknownhostexception) + { + if (GuiConnecting.this.cancel) + { + return; + } + + GuiConnecting.logger.error((String)"Couldn\'t connect to server", (Throwable)unknownhostexception); + GuiConnecting.this.mc.displayGuiScreen(new GuiDisconnected(GuiConnecting.this.previousGuiScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Unknown host"}))); + } + catch (Exception exception) + { + if (GuiConnecting.this.cancel) + { + return; + } + + GuiConnecting.logger.error((String)"Couldn\'t connect to server", (Throwable)exception); + String s = exception.toString(); + + if (inetaddress != null) + { + String s1 = inetaddress.toString() + ":" + port; + s = s.replaceAll(s1, ""); + } + + GuiConnecting.this.mc.displayGuiScreen(new GuiDisconnected(GuiConnecting.this.previousGuiScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {s}))); + } + } + }).start(); + } + + public void updateScreen() + { + if (this.networkManager != null) + { + if (this.networkManager.isChannelOpen()) + { + this.networkManager.processReceivedPackets(); + } + else + { + this.networkManager.checkDisconnected(); + } + } + } + + protected void keyTyped(char typedChar, int keyCode) throws IOException + { + } + + public void initGui() + { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + if (button.id == 0) + { + this.cancel = true; + + if (this.networkManager != null) + { + this.networkManager.closeChannel(new ChatComponentText("Aborted")); + } + + this.mc.displayGuiScreen(this.previousGuiScreen); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + + if (this.networkManager == null) + { + this.drawCenteredString(this.fontRendererObj, I18n.format("connect.connecting", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215); + } + else + { + this.drawCenteredString(this.fontRendererObj, I18n.format("connect.authorizing", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java new file mode 100644 index 0000000..8f24365 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java @@ -0,0 +1,547 @@ +package net.minecraft.client.multiplayer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.hud.simple.combat.SimpleModuleFlickTracker; +import com.cheatbreaker.client.module.impl.normal.hud.simple.combat.SimpleModuleReachDisplay; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.play.client.*; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; + +public class PlayerControllerMP +{ + private final Minecraft mc; + private final NetHandlerPlayClient netClientHandler; + private BlockPos currentBlock = new BlockPos(-1, -1, -1); + private ItemStack currentItemHittingBlock; + private float curBlockDamageMP; + private float stepSoundTickCounter; + private int blockHitDelay; + private boolean isHittingBlock; + private WorldSettings.GameType currentGameType = WorldSettings.GameType.SURVIVAL; + private int currentPlayerItem; + + public PlayerControllerMP(Minecraft mcIn, NetHandlerPlayClient netHandler) + { + this.mc = mcIn; + this.netClientHandler = netHandler; + } + + public static void clickBlockCreative(Minecraft mcIn, PlayerControllerMP playerController, BlockPos pos, EnumFacing facing) + { + if (!mcIn.theWorld.extinguishFire(mcIn.thePlayer, pos, facing)) + { + playerController.onPlayerDestroyBlock(pos, facing); + } + } + + public void setPlayerCapabilities(EntityPlayer player) + { + this.currentGameType.configurePlayerCapabilities(player.capabilities); + } + + public boolean isSpectator() + { + return this.currentGameType == WorldSettings.GameType.SPECTATOR; + } + + public void setGameType(WorldSettings.GameType type) + { + this.currentGameType = type; + this.currentGameType.configurePlayerCapabilities(this.mc.thePlayer.capabilities); + } + + public void flipPlayer(EntityPlayer playerIn) + { + playerIn.rotationYaw = -180.0F; + } + + public boolean shouldDrawHUD() + { + return this.currentGameType.isSurvivalOrAdventure(); + } + + public boolean onPlayerDestroyBlock(BlockPos pos, EnumFacing side) + { + if (this.currentGameType.isAdventure()) + { + if (this.currentGameType == WorldSettings.GameType.SPECTATOR) + { + return false; + } + + if (!this.mc.thePlayer.isAllowEdit()) + { + Block block = this.mc.theWorld.getBlockState(pos).getBlock(); + ItemStack itemstack = this.mc.thePlayer.getCurrentEquippedItem(); + + if (itemstack == null) + { + return false; + } + + if (!itemstack.canDestroy(block)) + { + return false; + } + } + } + + if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) + { + return false; + } + else + { + World world = this.mc.theWorld; + IBlockState iblockstate = world.getBlockState(pos); + Block block1 = iblockstate.getBlock(); + + if (block1.getMaterial() == Material.air) + { + return false; + } + else + { + world.playAuxSFX(2001, pos, Block.getStateId(iblockstate)); + boolean flag = world.setBlockToAir(pos); + + if (flag) + { + block1.onBlockDestroyedByPlayer(world, pos, iblockstate); + } + + this.currentBlock = new BlockPos(this.currentBlock.getX(), -1, this.currentBlock.getZ()); + + if (!this.currentGameType.isCreative()) + { + ItemStack itemstack1 = this.mc.thePlayer.getCurrentEquippedItem(); + + if (itemstack1 != null) + { + itemstack1.onBlockDestroyed(world, block1, pos, this.mc.thePlayer); + + if (itemstack1.stackSize == 0) + { + this.mc.thePlayer.destroyCurrentEquippedItem(); + } + } + } + + return flag; + } + } + } + + public boolean clickBlock(BlockPos loc, EnumFacing face) + { + if (this.currentGameType.isAdventure()) + { + if (this.currentGameType == WorldSettings.GameType.SPECTATOR) + { + return false; + } + + if (!this.mc.thePlayer.isAllowEdit()) + { + Block block = this.mc.theWorld.getBlockState(loc).getBlock(); + ItemStack itemstack = this.mc.thePlayer.getCurrentEquippedItem(); + + if (itemstack == null) + { + return false; + } + + if (!itemstack.canDestroy(block)) + { + return false; + } + } + } + + if (!this.mc.theWorld.getWorldBorder().contains(loc)) + { + return false; + } + else + { + if (this.currentGameType.isCreative()) + { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, loc, face)); + clickBlockCreative(this.mc, this, loc, face); + this.blockHitDelay = 5; + } + else if (!this.isHittingBlock || !this.isHittingPosition(loc)) + { + if (this.isHittingBlock) + { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK, this.currentBlock, face)); + } + + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, loc, face)); + Block block1 = this.mc.theWorld.getBlockState(loc).getBlock(); + boolean flag = block1.getMaterial() != Material.air; + + if (flag && this.curBlockDamageMP == 0.0F) + { + block1.onBlockClicked(this.mc.theWorld, loc, this.mc.thePlayer); + } + + if (flag && block1.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, loc) >= 1.0F) + { + this.onPlayerDestroyBlock(loc, face); + } + else + { + this.isHittingBlock = true; + this.currentBlock = loc; + this.currentItemHittingBlock = this.mc.thePlayer.getHeldItem(); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.mc.theWorld.sendBlockBreakProgress(this.mc.thePlayer.getEntityId(), this.currentBlock, (int)(this.curBlockDamageMP * 10.0F) - 1); + } + } + + return true; + } + } + + public void resetBlockRemoving() + { + if (this.isHittingBlock) + { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK, this.currentBlock, EnumFacing.DOWN)); + this.isHittingBlock = false; + this.curBlockDamageMP = 0.0F; + this.mc.theWorld.sendBlockBreakProgress(this.mc.thePlayer.getEntityId(), this.currentBlock, -1); + } + } + + public boolean onPlayerDamageBlock(BlockPos posBlock, EnumFacing directionFacing) + { + this.syncCurrentPlayItem(); + + if (this.blockHitDelay > 0) + { + --this.blockHitDelay; + return true; + } + else if (this.currentGameType.isCreative() && this.mc.theWorld.getWorldBorder().contains(posBlock)) + { + this.blockHitDelay = 5; + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, posBlock, directionFacing)); + clickBlockCreative(this.mc, this, posBlock, directionFacing); + return true; + } + else if (this.isHittingPosition(posBlock)) + { + Block block = this.mc.theWorld.getBlockState(posBlock).getBlock(); + + if (block.getMaterial() == Material.air) + { + this.isHittingBlock = false; + return false; + } + else + { + this.curBlockDamageMP += block.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, posBlock); + + if (this.stepSoundTickCounter % 4.0F == 0.0F) + { + this.mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation(block.stepSound.getStepSound()), (block.stepSound.getVolume() + 1.0F) / 8.0F, block.stepSound.getFrequency() * 0.5F, (float)posBlock.getX() + 0.5F, (float)posBlock.getY() + 0.5F, (float)posBlock.getZ() + 0.5F)); + } + + ++this.stepSoundTickCounter; + + if (this.curBlockDamageMP >= 1.0F) + { + this.isHittingBlock = false; + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, posBlock, directionFacing)); + this.onPlayerDestroyBlock(posBlock, directionFacing); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.blockHitDelay = 5; + } + + this.mc.theWorld.sendBlockBreakProgress(this.mc.thePlayer.getEntityId(), this.currentBlock, (int)(this.curBlockDamageMP * 10.0F) - 1); + return true; + } + } + else + { + return this.clickBlock(posBlock, directionFacing); + } + } + + public float getBlockReachDistance() + { + return this.currentGameType.isCreative() ? 5.0F : 4.5F; + } + + public void updateController() + { + this.syncCurrentPlayItem(); + + if (this.netClientHandler.getNetworkManager().isChannelOpen()) + { + this.netClientHandler.getNetworkManager().processReceivedPackets(); + } + else + { + this.netClientHandler.getNetworkManager().checkDisconnected(); + } + } + + private boolean isHittingPosition(BlockPos pos) + { + ItemStack itemstack = this.mc.thePlayer.getHeldItem(); + boolean flag = this.currentItemHittingBlock == null && itemstack == null; + + if (this.currentItemHittingBlock != null && itemstack != null) + { + flag = itemstack.getItem() == this.currentItemHittingBlock.getItem() && ItemStack.areItemStackTagsEqual(itemstack, this.currentItemHittingBlock) && (itemstack.isItemStackDamageable() || itemstack.getMetadata() == this.currentItemHittingBlock.getMetadata()); + } + + return pos.equals(this.currentBlock) && flag; + } + + private void syncCurrentPlayItem() + { + int i = this.mc.thePlayer.inventory.currentItem; + + if (i != this.currentPlayerItem) + { + this.currentPlayerItem = i; + this.netClientHandler.addToSendQueue(new C09PacketHeldItemChange(this.currentPlayerItem)); + } + } + + public boolean onPlayerRightClick(EntityPlayerSP player, WorldClient worldIn, ItemStack heldStack, BlockPos hitPos, EnumFacing side, Vec3 hitVec) + { + this.syncCurrentPlayItem(); + float f = (float)(hitVec.xCoord - (double)hitPos.getX()); + float f1 = (float)(hitVec.yCoord - (double)hitPos.getY()); + float f2 = (float)(hitVec.zCoord - (double)hitPos.getZ()); + boolean flag = false; + + if (!this.mc.theWorld.getWorldBorder().contains(hitPos)) + { + return false; + } + else + { + if (this.currentGameType != WorldSettings.GameType.SPECTATOR) + { + IBlockState iblockstate = worldIn.getBlockState(hitPos); + + if ((!player.isSneaking() || player.getHeldItem() == null) && iblockstate.getBlock().onBlockActivated(worldIn, hitPos, iblockstate, player, side, f, f1, f2)) + { + flag = true; + } + + if (!flag && heldStack != null && heldStack.getItem() instanceof ItemBlock) + { + ItemBlock itemblock = (ItemBlock)heldStack.getItem(); + + if (!itemblock.canPlaceBlockOnSide(worldIn, hitPos, side, player, heldStack)) + { + return false; + } + } + } + + this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(hitPos, side.getIndex(), player.inventory.getCurrentItem(), f, f1, f2)); + + if (!flag && this.currentGameType != WorldSettings.GameType.SPECTATOR) + { + if (heldStack == null) + { + return false; + } + else if (this.currentGameType.isCreative()) + { + int i = heldStack.getMetadata(); + int j = heldStack.stackSize; + boolean flag1 = heldStack.onItemUse(player, worldIn, hitPos, side, f, f1, f2); + heldStack.setItemDamage(i); + heldStack.stackSize = j; + return flag1; + } + else + { + return heldStack.onItemUse(player, worldIn, hitPos, side, f, f1, f2); + } + } + else + { + return true; + } + } + } + + public boolean sendUseItem(EntityPlayer playerIn, World worldIn, ItemStack itemStackIn) + { + if (this.currentGameType == WorldSettings.GameType.SPECTATOR) + { + return false; + } + else + { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(playerIn.inventory.getCurrentItem())); + int i = itemStackIn.stackSize; + ItemStack itemstack = itemStackIn.useItemRightClick(worldIn, playerIn); + + if (itemstack != itemStackIn || itemstack != null && itemstack.stackSize != i) + { + playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack; + + if (itemstack.stackSize == 0) + { + playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null; + } + + return true; + } + else + { + return false; + } + } + } + + public EntityPlayerSP func_178892_a(World worldIn, StatFileWriter statWriter) + { + return new EntityPlayerSP(this.mc, worldIn, this.netClientHandler, statWriter); + } + + public void attackEntity(EntityPlayer playerIn, Entity targetEntity) + { + if (playerIn == this.mc.thePlayer) { + Vec3 distance = this.mc.getRenderViewEntity().getPositionEyes(1.0F); + SimpleModuleReachDisplay.lastRange = this.mc.objectMouseOver.hitVec.distanceTo(distance); + SimpleModuleReachDisplay.lastAttackTime = System.currentTimeMillis(); + + SimpleModuleFlickTracker flickTrackerModule = CheatBreaker.getInstance().getModuleManager().flickTrackerMod; + + flickTrackerModule.setLastHit(System.currentTimeMillis()); + flickTrackerModule.setLastHitYaw(playerIn.cameraYaw); + flickTrackerModule.setLastHitPitch(playerIn.cameraPitch); + + flickTrackerModule.setDistance(flickTrackerModule.calculate()); + } + + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK)); + + if (this.currentGameType != WorldSettings.GameType.SPECTATOR) + { + playerIn.attackTargetEntityWithCurrentItem(targetEntity); + } + } + + public boolean interactWithEntitySendPacket(EntityPlayer playerIn, Entity targetEntity) + { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.INTERACT)); + return this.currentGameType != WorldSettings.GameType.SPECTATOR && playerIn.interactWith(targetEntity); + } + + public boolean isPlayerRightClickingOnEntity(EntityPlayer player, Entity entityIn, MovingObjectPosition movingObject) + { + this.syncCurrentPlayItem(); + Vec3 vec3 = new Vec3(movingObject.hitVec.xCoord - entityIn.posX, movingObject.hitVec.yCoord - entityIn.posY, movingObject.hitVec.zCoord - entityIn.posZ); + this.netClientHandler.addToSendQueue(new C02PacketUseEntity(entityIn, vec3)); + return this.currentGameType != WorldSettings.GameType.SPECTATOR && entityIn.interactAt(player, vec3); + } + + public ItemStack windowClick(int windowId, int slotId, int mouseButtonClicked, int mode, EntityPlayer playerIn) + { + short short1 = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack itemstack = playerIn.openContainer.slotClick(slotId, mouseButtonClicked, mode, playerIn); + this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(windowId, slotId, mouseButtonClicked, mode, itemstack, short1)); + return itemstack; + } + + public void sendEnchantPacket(int windowID, int button) + { + this.netClientHandler.addToSendQueue(new C11PacketEnchantItem(windowID, button)); + } + + public void sendSlotPacket(ItemStack itemStackIn, int slotId) + { + if (this.currentGameType.isCreative()) + { + this.netClientHandler.addToSendQueue(new C10PacketCreativeInventoryAction(slotId, itemStackIn)); + } + } + + public void sendPacketDropItem(ItemStack itemStackIn) + { + if (this.currentGameType.isCreative() && itemStackIn != null) + { + this.netClientHandler.addToSendQueue(new C10PacketCreativeInventoryAction(-1, itemStackIn)); + } + } + + public void onStoppedUsingItem(EntityPlayer playerIn) + { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)); + playerIn.stopUsingItem(); + } + + public boolean gameIsSurvivalOrAdventure() + { + return this.currentGameType.isSurvivalOrAdventure(); + } + + public boolean isNotCreative() + { + return !this.currentGameType.isCreative(); + } + + public boolean isInCreativeMode() + { + return this.currentGameType.isCreative(); + } + + public boolean extendedReach() + { + return this.currentGameType.isCreative(); + } + + public boolean isRidingHorse() + { + return this.mc.thePlayer.isRiding() && this.mc.thePlayer.ridingEntity instanceof EntityHorse; + } + + public boolean isSpectatorMode() + { + return this.currentGameType == WorldSettings.GameType.SPECTATOR; + } + + public WorldSettings.GameType getCurrentGameType() + { + return this.currentGameType; + } + + public boolean getIsHittingBlock() + { + return this.isHittingBlock; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java new file mode 100644 index 0000000..aa42220 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java @@ -0,0 +1,112 @@ +package net.minecraft.client.multiplayer; + +import java.net.IDN; +import java.util.Hashtable; +import javax.naming.directory.Attributes; +import javax.naming.directory.DirContext; +import javax.naming.directory.InitialDirContext; + +public class ServerAddress +{ + private final String ipAddress; + private final int serverPort; + + private ServerAddress(String address, int port) + { + this.ipAddress = address; + this.serverPort = port; + } + + public String getIP() + { + return IDN.toASCII(this.ipAddress); + } + + public int getPort() + { + return this.serverPort; + } + + public static ServerAddress fromString(String p_78860_0_) + { + if (p_78860_0_ == null) + { + return null; + } + else + { + String[] astring = p_78860_0_.split(":"); + + if (p_78860_0_.startsWith("[")) + { + int i = p_78860_0_.indexOf("]"); + + if (i > 0) + { + String s = p_78860_0_.substring(1, i); + String s1 = p_78860_0_.substring(i + 1).trim(); + + if (s1.startsWith(":") && s1.length() > 0) + { + s1 = s1.substring(1); + astring = new String[] {s, s1}; + } + else + { + astring = new String[] {s}; + } + } + } + + if (astring.length > 2) + { + astring = new String[] {p_78860_0_}; + } + + String s2 = astring[0]; + int j = astring.length > 1 ? parseIntWithDefault(astring[1], 25565) : 25565; + + if (j == 25565) + { + String[] astring1 = getServerAddress(s2); + s2 = astring1[0]; + j = parseIntWithDefault(astring1[1], 25565); + } + + return new ServerAddress(s2, j); + } + } + + private static String[] getServerAddress(String p_78863_0_) + { + try + { + String s = "com.sun.jndi.dns.DnsContextFactory"; + Class.forName("com.sun.jndi.dns.DnsContextFactory"); + Hashtable hashtable = new Hashtable(); + hashtable.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory"); + hashtable.put("java.naming.provider.url", "dns:"); + hashtable.put("com.sun.jndi.dns.timeout.retries", "1"); + DirContext dircontext = new InitialDirContext(hashtable); + Attributes attributes = dircontext.getAttributes("_minecraft._tcp." + p_78863_0_, new String[] {"SRV"}); + String[] astring = attributes.get("srv").get().toString().split(" ", 4); + return new String[] {astring[3], astring[2]}; + } + catch (Throwable var6) + { + return new String[] {p_78863_0_, Integer.toString(25565)}; + } + } + + private static int parseIntWithDefault(String p_78862_0_, int p_78862_1_) + { + try + { + return Integer.parseInt(p_78862_0_.trim()); + } + catch (Exception var3) + { + return p_78862_1_; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerData.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerData.java new file mode 100644 index 0000000..909089e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerData.java @@ -0,0 +1,133 @@ +package net.minecraft.client.multiplayer; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class ServerData { + public String serverName; + public String serverIP; + + /** + * the string indicating number of players on and capacity of the server that is shown on the server browser (i.e. + * "5/20" meaning 5 slots used out of 20 slots total) + */ + public String populationInfo; + /** + * CheatBreaker Fields + */ + public String domain; + public int port; + public String serverMOTD; + public long pingToServer; + public int version = 47; + public String gameVersion = "1.8.9"; + public boolean field_78841_f; + public String playerList; + private ServerData.ServerResourceMode resourceMode = ServerData.ServerResourceMode.PROMPT; + private String serverIcon; + private boolean lanServer; + + public boolean dontSave = false; + public boolean pinged = false; + public boolean lunarServer = false; + + public ServerData(boolean dontSave, String name, String ip, boolean isLan) { + this.serverName = name; + this.serverIP = ip; + this.lanServer = isLan; + this.dontSave = dontSave; + } + + public ServerData(String name, String ip, boolean isLan) { + this.serverName = name; + this.serverIP = ip; + this.lanServer = isLan; + } + + public boolean isCheatBreakerServer() { + return version == -1332; + } + + public NBTTagCompound getNBTCompound() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("name", this.serverName); + nbttagcompound.setString("ip", this.serverIP); + + if (this.serverIcon != null) { + nbttagcompound.setString("icon", this.serverIcon); + } + + if (this.resourceMode == ServerData.ServerResourceMode.ENABLED) { + nbttagcompound.setBoolean("acceptTextures", true); + } else if (this.resourceMode == ServerData.ServerResourceMode.DISABLED) { + nbttagcompound.setBoolean("acceptTextures", false); + } + + return nbttagcompound; + } + + public ServerData.ServerResourceMode getResourceMode() { + return this.resourceMode; + } + + public void setResourceMode(ServerData.ServerResourceMode mode) { + this.resourceMode = mode; + } + + public static ServerData getServerDataFromNBTCompound(NBTTagCompound nbtCompound) { + ServerData serverdata = new ServerData(nbtCompound.getString("name"), nbtCompound.getString("ip"), false); + + if (nbtCompound.hasKey("icon", 8)) { + serverdata.setBase64EncodedIconData(nbtCompound.getString("icon")); + } + + if (nbtCompound.hasKey("acceptTextures", 1)) { + if (nbtCompound.getBoolean("acceptTextures")) { + serverdata.setResourceMode(ServerData.ServerResourceMode.ENABLED); + } else { + serverdata.setResourceMode(ServerData.ServerResourceMode.DISABLED); + } + } else { + serverdata.setResourceMode(ServerData.ServerResourceMode.PROMPT); + } + + return serverdata; + } + + public String getBase64EncodedIconData() { + return this.serverIcon; + } + + public void setBase64EncodedIconData(String icon) { + this.serverIcon = icon; + } + + public boolean isOnLAN() { + return this.lanServer; + } + + public void copyFrom(ServerData serverDataIn) { + this.serverIP = serverDataIn.serverIP; + this.serverName = serverDataIn.serverName; + this.setResourceMode(serverDataIn.getResourceMode()); + this.serverIcon = serverDataIn.serverIcon; + this.lanServer = serverDataIn.lanServer; + } + + public static enum ServerResourceMode { + ENABLED("enabled"), + DISABLED("disabled"), + PROMPT("prompt"); + + private final IChatComponent motd; + + private ServerResourceMode(String name) { + this.motd = new ChatComponentTranslation("addServer.resourcePack." + name, new Object[0]); + } + + public IChatComponent getMotd() { + return this.motd; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerList.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerList.java new file mode 100644 index 0000000..d2a7c21 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ServerList.java @@ -0,0 +1,113 @@ +package net.minecraft.client.multiplayer; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.collect.Lists; + +import java.io.File; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ServerList { + private static final Logger logger = LogManager.getLogger(); + private final Minecraft mc; + private final List servers = Lists.newArrayList(); + + public ServerList(Minecraft mcIn) { + this.mc = mcIn; + this.loadServerList(); + } + + public void loadServerList() { + try { + this.servers.clear(); + NBTTagCompound nbttagcompound = CompressedStreamTools.read(new File(this.mc.mcDataDir, "servers.dat")); + + if (nbttagcompound == null) { + return; + } + + NBTTagList nbttaglist = nbttagcompound.getTagList("servers", 10); + + for (String[] server : CheatBreaker.getInstance().getGlobalSettings().getPinnedServers()) { + this.servers.add(new ServerData(true, server[0], server[1], false)); + } + + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + this.servers.add(ServerData.getServerDataFromNBTCompound(nbttaglist.getCompoundTagAt(i))); + } + } catch (Exception exception) { + logger.error((String) "Couldn\'t load server list", (Throwable) exception); + } + } + + public void saveServerList() { + try { + NBTTagList nbttaglist = new NBTTagList(); + + for (ServerData serverdata : this.servers) { + if (serverdata.dontSave) continue; + nbttaglist.appendTag(serverdata.getNBTCompound()); + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("servers", nbttaglist); + CompressedStreamTools.safeWrite(nbttagcompound, new File(this.mc.mcDataDir, "servers.dat")); + } catch (Exception exception) { + logger.error((String) "Couldn\'t save server list", (Throwable) exception); + } + } + + public ServerData getServerData(int index) { + return (ServerData) this.servers.get(index); + } + + public void removeServerData(int index) { + this.servers.remove(index); + } + + public void addServerData(ServerData server) { + this.servers.add(server); + } + + public int countServers() { + return this.servers.size(); + } + + public void swapServers(int p_78857_1_, int p_78857_2_) { + ServerData serverdata = this.getServerData(p_78857_1_); + ServerData serverdata2 = this.getServerData(p_78857_2_); + + if (!serverdata.dontSave && !serverdata2.dontSave) { + this.servers.set(p_78857_1_, serverdata2); + this.servers.set(p_78857_2_, serverdata); + this.saveServerList(); + } + + } + + public void func_147413_a(int index, ServerData server) { + this.servers.set(index - CheatBreaker.getInstance().getGlobalSettings().getPinnedServers().size(), server); + } + + public static void func_147414_b(ServerData p_147414_0_) { + ServerList serverlist = new ServerList(Minecraft.getMinecraft()); + serverlist.loadServerList(); + + for (int i = 0; i < serverlist.countServers(); ++i) { + ServerData serverdata = serverlist.getServerData(i); + + if (serverdata.serverName.equals(p_147414_0_.serverName) && serverdata.serverIP.equals(p_147414_0_.serverIP)) { + serverlist.func_147413_a(i, p_147414_0_); + break; + } + } + + serverlist.saveServerList(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java new file mode 100644 index 0000000..d7db9c4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java @@ -0,0 +1,117 @@ +package net.minecraft.client.multiplayer; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ThreadLanServerPing extends Thread +{ + private static final AtomicInteger field_148658_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private final String motd; + private final DatagramSocket socket; + private boolean isStopping = true; + private final String address; + + public ThreadLanServerPing(String p_i1321_1_, String p_i1321_2_) throws IOException + { + super("LanServerPinger #" + field_148658_a.incrementAndGet()); + this.motd = p_i1321_1_; + this.address = p_i1321_2_; + this.setDaemon(true); + this.socket = new DatagramSocket(); + } + + public void run() + { + String s = getPingResponse(this.motd, this.address); + byte[] abyte = s.getBytes(); + + while (!this.isInterrupted() && this.isStopping) + { + try + { + InetAddress inetaddress = InetAddress.getByName("224.0.2.60"); + DatagramPacket datagrampacket = new DatagramPacket(abyte, abyte.length, inetaddress, 4445); + this.socket.send(datagrampacket); + } + catch (IOException ioexception) + { + logger.warn("LanServerPinger: " + ioexception.getMessage()); + break; + } + + try + { + sleep(1500L); + } + catch (InterruptedException var5) + { + ; + } + } + } + + public void interrupt() + { + super.interrupt(); + this.isStopping = false; + } + + public static String getPingResponse(String p_77525_0_, String p_77525_1_) + { + return "[MOTD]" + p_77525_0_ + "[/MOTD][AD]" + p_77525_1_ + "[/AD]"; + } + + public static String getMotdFromPingResponse(String p_77524_0_) + { + int i = p_77524_0_.indexOf("[MOTD]"); + + if (i < 0) + { + return "missing no"; + } + else + { + int j = p_77524_0_.indexOf("[/MOTD]", i + "[MOTD]".length()); + return j < i ? "missing no" : p_77524_0_.substring(i + "[MOTD]".length(), j); + } + } + + public static String getAdFromPingResponse(String p_77523_0_) + { + int i = p_77523_0_.indexOf("[/MOTD]"); + + if (i < 0) + { + return null; + } + else + { + int j = p_77523_0_.indexOf("[/MOTD]", i + "[/MOTD]".length()); + + if (j >= 0) + { + return null; + } + else + { + int k = p_77523_0_.indexOf("[AD]", i + "[/MOTD]".length()); + + if (k < 0) + { + return null; + } + else + { + int l = p_77523_0_.indexOf("[/AD]", k + "[AD]".length()); + return l < k ? null : p_77523_0_.substring(k + "[AD]".length(), l); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/WorldClient.java b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/WorldClient.java new file mode 100644 index 0000000..3c75ac0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/multiplayer/WorldClient.java @@ -0,0 +1,479 @@ +package net.minecraft.client.multiplayer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.network.DisconnectEvent; +import com.google.common.collect.Sets; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.MovingSoundMinecart; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.particle.EntityFirework.StarterFX; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.BlockPos.MutableBlockPos; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldSettings.GameType; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.storage.SaveDataMemoryStorage; +import net.minecraft.world.storage.SaveHandlerMP; +import net.minecraft.world.storage.WorldInfo; +import net.optifine.CustomGuis; +import net.optifine.DynamicLights; +import net.optifine.override.PlayerControllerOF; +import net.optifine.reflect.Reflector; + +public class WorldClient extends World +{ + private NetHandlerPlayClient sendQueue; + private ChunkProviderClient clientChunkProvider; + private final Set entityList = Sets.newHashSet(); + private final Set entitySpawnQueue = Sets.newHashSet(); + private final Minecraft mc = Minecraft.getMinecraft(); + private final Set previousActiveChunkSet = Sets.newHashSet(); + private boolean playerUpdate = false; + + public WorldClient(NetHandlerPlayClient netHandler, WorldSettings settings, int dimension, EnumDifficulty difficulty, Profiler profilerIn) + { + super(new SaveHandlerMP(), new WorldInfo(settings, "MpServer"), WorldProvider.getProviderForDimension(dimension), profilerIn, true); + this.sendQueue = netHandler; + this.getWorldInfo().setDifficulty(difficulty); + this.provider.registerWorld(this); + this.setSpawnPoint(new BlockPos(8, 64, 8)); + this.chunkProvider = this.createChunkProvider(); + this.mapStorage = new SaveDataMemoryStorage(); + this.calculateInitialSkylight(); + this.calculateInitialWeather(); + Reflector.postForgeBusEvent(Reflector.WorldEvent_Load_Constructor, new Object[] {this}); + + if (this.mc.playerController != null && this.mc.playerController.getClass() == PlayerControllerMP.class) + { + this.mc.playerController = new PlayerControllerOF(this.mc, netHandler); + CustomGuis.setPlayerControllerOF((PlayerControllerOF)this.mc.playerController); + } + } + + public void tick() + { + super.tick(); + this.setTotalWorldTime(this.getTotalWorldTime() + 1L); + + if (this.getGameRules().getBoolean("doDaylightCycle")) + { + this.setWorldTime(this.getWorldTime() + 1L); + } + + this.theProfiler.startSection("reEntryProcessing"); + + for (int i = 0; i < 10 && !this.entitySpawnQueue.isEmpty(); ++i) + { + Entity entity = (Entity)this.entitySpawnQueue.iterator().next(); + this.entitySpawnQueue.remove(entity); + + if (!this.loadedEntityList.contains(entity)) + { + this.spawnEntityInWorld(entity); + } + } + + this.theProfiler.endStartSection("chunkCache"); + this.clientChunkProvider.unloadQueuedChunks(); + this.theProfiler.endStartSection("blocks"); + this.updateBlocks(); + this.theProfiler.endSection(); + } + + public void invalidateBlockReceiveRegion(int x1, int y1, int z1, int x2, int y2, int z2) + { + } + + protected IChunkProvider createChunkProvider() + { + this.clientChunkProvider = new ChunkProviderClient(this); + return this.clientChunkProvider; + } + + protected void updateBlocks() + { + super.updateBlocks(); + this.previousActiveChunkSet.retainAll(this.activeChunkSet); + + if (this.previousActiveChunkSet.size() == this.activeChunkSet.size()) + { + this.previousActiveChunkSet.clear(); + } + + int i = 0; + + for (ChunkCoordIntPair chunkcoordintpair : this.activeChunkSet) + { + if (!this.previousActiveChunkSet.contains(chunkcoordintpair)) + { + int j = chunkcoordintpair.chunkXPos * 16; + int k = chunkcoordintpair.chunkZPos * 16; + this.theProfiler.startSection("getChunk"); + Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); + this.playMoodSoundAndCheckLight(j, k, chunk); + this.theProfiler.endSection(); + this.previousActiveChunkSet.add(chunkcoordintpair); + ++i; + + if (i >= 10) + { + return; + } + } + } + } + + public void doPreChunk(int chuncX, int chuncZ, boolean loadChunk) + { + if (loadChunk) + { + this.clientChunkProvider.loadChunk(chuncX, chuncZ); + } + else + { + this.clientChunkProvider.unloadChunk(chuncX, chuncZ); + } + + if (!loadChunk) + { + this.markBlockRangeForRenderUpdate(chuncX * 16, 0, chuncZ * 16, chuncX * 16 + 15, 256, chuncZ * 16 + 15); + } + } + + public boolean spawnEntityInWorld(Entity entityIn) + { + boolean flag = super.spawnEntityInWorld(entityIn); + this.entityList.add(entityIn); + + if (!flag) + { + this.entitySpawnQueue.add(entityIn); + } + else if (entityIn instanceof EntityMinecart) + { + this.mc.getSoundHandler().playSound(new MovingSoundMinecart((EntityMinecart)entityIn)); + } + + return flag; + } + + public void removeEntity(Entity entityIn) + { + super.removeEntity(entityIn); + this.entityList.remove(entityIn); + } + + protected void onEntityAdded(Entity entityIn) + { + super.onEntityAdded(entityIn); + + if (this.entitySpawnQueue.contains(entityIn)) + { + this.entitySpawnQueue.remove(entityIn); + } + } + + protected void onEntityRemoved(Entity entityIn) + { + super.onEntityRemoved(entityIn); + boolean flag = false; + + if (this.entityList.contains(entityIn)) + { + if (entityIn.isEntityAlive()) + { + this.entitySpawnQueue.add(entityIn); + flag = true; + } + else + { + this.entityList.remove(entityIn); + } + } + } + + public void addEntityToWorld(int entityID, Entity entityToSpawn) + { + Entity entity = this.getEntityByID(entityID); + + if (entity != null) + { + this.removeEntity(entity); + } + + this.entityList.add(entityToSpawn); + entityToSpawn.setEntityId(entityID); + + if (!this.spawnEntityInWorld(entityToSpawn)) + { + this.entitySpawnQueue.add(entityToSpawn); + } + + this.entitiesById.addKey(entityID, entityToSpawn); + } + + public Entity getEntityByID(int id) + { + return (Entity)(id == this.mc.thePlayer.getEntityId() ? this.mc.thePlayer : super.getEntityByID(id)); + } + + public Entity removeEntityFromWorld(int entityID) + { + Entity entity = (Entity)this.entitiesById.removeObject(entityID); + + if (entity != null) + { + this.entityList.remove(entity); + this.removeEntity(entity); + } + + return entity; + } + + public boolean invalidateRegionAndSetBlock(BlockPos pos, IBlockState state) + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + this.invalidateBlockReceiveRegion(i, j, k, i, j, k); + return super.setBlockState(pos, state, 3); + } + + /** + * If on MP, sends a quitting packet. + */ + public void sendQuittingDisconnectingPacket() + { + CheatBreaker.getInstance().getEventBus().handleEvent(new DisconnectEvent()); + this.sendQueue.getNetworkManager().closeChannel(new ChatComponentText("Quitting")); + } + + protected void updateWeather() + { + } + + protected int getRenderDistanceChunks() + { + return this.mc.gameSettings.renderDistanceChunks; + } + + public void doVoidFogParticles(int posX, int posY, int posZ) + { + int i = 16; + Random random = new Random(); + ItemStack itemstack = this.mc.thePlayer.getHeldItem(); + boolean flag = this.mc.playerController.getCurrentGameType() == GameType.CREATIVE && itemstack != null && Block.getBlockFromItem(itemstack.getItem()) == Blocks.barrier; + MutableBlockPos mutableblockpos = new MutableBlockPos(); + + for (int j = 0; j < 1000; ++j) + { + int k = posX + this.rand.nextInt(i) - this.rand.nextInt(i); + int l = posY + this.rand.nextInt(i) - this.rand.nextInt(i); + int i1 = posZ + this.rand.nextInt(i) - this.rand.nextInt(i); + mutableblockpos.set(k, l, i1); + IBlockState iblockstate = this.getBlockState(mutableblockpos); + iblockstate.getBlock().randomDisplayTick(this, mutableblockpos, iblockstate, random); + + if (flag && iblockstate.getBlock() == Blocks.barrier) + { + this.spawnParticle(EnumParticleTypes.BARRIER, (double)((float)k + 0.5F), (double)((float)l + 0.5F), (double)((float)i1 + 0.5F), 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + public void removeAllEntities() + { + this.loadedEntityList.removeAll(this.unloadedEntityList); + + for (int i = 0; i < this.unloadedEntityList.size(); ++i) + { + Entity entity = (Entity)this.unloadedEntityList.get(i); + int j = entity.chunkCoordX; + int k = entity.chunkCoordZ; + + if (entity.addedToChunk && this.isChunkLoaded(j, k, true)) + { + this.getChunkFromChunkCoords(j, k).removeEntity(entity); + } + } + + for (int l = 0; l < this.unloadedEntityList.size(); ++l) + { + this.onEntityRemoved((Entity)this.unloadedEntityList.get(l)); + } + + this.unloadedEntityList.clear(); + + for (int i1 = 0; i1 < this.loadedEntityList.size(); ++i1) + { + Entity entity1 = (Entity)this.loadedEntityList.get(i1); + + if (entity1.ridingEntity != null) + { + if (!entity1.ridingEntity.isDead && entity1.ridingEntity.riddenByEntity == entity1) + { + continue; + } + + entity1.ridingEntity.riddenByEntity = null; + entity1.ridingEntity = null; + } + + if (entity1.isDead) + { + int j1 = entity1.chunkCoordX; + int k1 = entity1.chunkCoordZ; + + if (entity1.addedToChunk && this.isChunkLoaded(j1, k1, true)) + { + this.getChunkFromChunkCoords(j1, k1).removeEntity(entity1); + } + + this.loadedEntityList.remove(i1--); + this.onEntityRemoved(entity1); + } + } + } + + public CrashReportCategory addWorldInfoToCrashReport(CrashReport report) + { + CrashReportCategory crashreportcategory = super.addWorldInfoToCrashReport(report); + crashreportcategory.addCrashSectionCallable("Forced entities", new Callable() + { + public String call() + { + return WorldClient.this.entityList.size() + " total; " + WorldClient.this.entityList.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Retry entities", new Callable() + { + public String call() + { + return WorldClient.this.entitySpawnQueue.size() + " total; " + WorldClient.this.entitySpawnQueue.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Server brand", new Callable() + { + public String call() throws Exception + { + return WorldClient.this.mc.thePlayer.getClientBrand(); + } + }); + crashreportcategory.addCrashSectionCallable("Server type", new Callable() + { + public String call() throws Exception + { + return WorldClient.this.mc.getIntegratedServer() == null ? "Non-integrated multiplayer server" : "Integrated singleplayer server"; + } + }); + return crashreportcategory; + } + + public void playSoundAtPos(BlockPos pos, String soundName, float volume, float pitch, boolean distanceDelay) + { + this.playSound((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, soundName, volume, pitch, distanceDelay); + } + + public void playSound(double x, double y, double z, String soundName, float volume, float pitch, boolean distanceDelay) + { + double d0 = this.mc.getRenderViewEntity().getDistanceSq(x, y, z); + PositionedSoundRecord positionedsoundrecord = new PositionedSoundRecord(new ResourceLocation(soundName), volume, pitch, (float)x, (float)y, (float)z); + + if (distanceDelay && d0 > 100.0D) + { + double d1 = Math.sqrt(d0) / 40.0D; + this.mc.getSoundHandler().playDelayedSound(positionedsoundrecord, (int)(d1 * 20.0D)); + } + else + { + this.mc.getSoundHandler().playSound(positionedsoundrecord); + } + } + + public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund) + { + this.mc.effectRenderer.addEffect(new StarterFX(this, x, y, z, motionX, motionY, motionZ, this.mc.effectRenderer, compund)); + } + + public void setWorldScoreboard(Scoreboard scoreboardIn) + { + this.worldScoreboard = scoreboardIn; + } + + public void setWorldTime(long time) + { + if (time < 0L) + { + time = -time; + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "false"); + } + else + { + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "true"); + } + + super.setWorldTime(time); + } + + public int getCombinedLight(BlockPos pos, int lightValue) + { + int i = super.getCombinedLight(pos, lightValue); + + if (Config.isDynamicLights()) + { + i = DynamicLights.getCombinedLight(pos, i); + } + + return i; + } + + public boolean setBlockState(BlockPos pos, IBlockState newState, int flags) + { + this.playerUpdate = this.isPlayerActing(); + boolean flag = super.setBlockState(pos, newState, flags); + this.playerUpdate = false; + return flag; + } + + private boolean isPlayerActing() + { + if (this.mc.playerController instanceof PlayerControllerOF) + { + PlayerControllerOF playercontrollerof = (PlayerControllerOF)this.mc.playerController; + return playercontrollerof.isActing(); + } + else + { + return false; + } + } + + public boolean isPlayerUpdate() + { + return this.playerUpdate; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/network/LanServerDetector.java b/Client-1.8.9/src/main/java/net/minecraft/client/network/LanServerDetector.java new file mode 100644 index 0000000..198edac --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/network/LanServerDetector.java @@ -0,0 +1,156 @@ +package net.minecraft.client.network; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.InetAddress; +import java.net.MulticastSocket; +import java.net.SocketTimeoutException; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ThreadLanServerPing; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class LanServerDetector +{ + private static final AtomicInteger field_148551_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + + public static class LanServer + { + private String lanServerMotd; + private String lanServerIpPort; + private long timeLastSeen; + + public LanServer(String motd, String address) + { + this.lanServerMotd = motd; + this.lanServerIpPort = address; + this.timeLastSeen = Minecraft.getSystemTime(); + } + + public String getServerMotd() + { + return this.lanServerMotd; + } + + public String getServerIpPort() + { + return this.lanServerIpPort; + } + + public void updateLastSeen() + { + this.timeLastSeen = Minecraft.getSystemTime(); + } + } + + public static class LanServerList + { + private List listOfLanServers = Lists.newArrayList(); + boolean wasUpdated; + + public synchronized boolean getWasUpdated() + { + return this.wasUpdated; + } + + public synchronized void setWasNotUpdated() + { + this.wasUpdated = false; + } + + public synchronized List getLanServers() + { + return Collections.unmodifiableList(this.listOfLanServers); + } + + public synchronized void func_77551_a(String p_77551_1_, InetAddress p_77551_2_) + { + String s = ThreadLanServerPing.getMotdFromPingResponse(p_77551_1_); + String s1 = ThreadLanServerPing.getAdFromPingResponse(p_77551_1_); + + if (s1 != null) + { + s1 = p_77551_2_.getHostAddress() + ":" + s1; + boolean flag = false; + + for (LanServerDetector.LanServer lanserverdetector$lanserver : this.listOfLanServers) + { + if (lanserverdetector$lanserver.getServerIpPort().equals(s1)) + { + lanserverdetector$lanserver.updateLastSeen(); + flag = true; + break; + } + } + + if (!flag) + { + this.listOfLanServers.add(new LanServerDetector.LanServer(s, s1)); + this.wasUpdated = true; + } + } + } + } + + public static class ThreadLanServerFind extends Thread + { + private final LanServerDetector.LanServerList localServerList; + private final InetAddress broadcastAddress; + private final MulticastSocket socket; + + public ThreadLanServerFind(LanServerDetector.LanServerList p_i1320_1_) throws IOException + { + super("LanServerDetector #" + LanServerDetector.field_148551_a.incrementAndGet()); + this.localServerList = p_i1320_1_; + this.setDaemon(true); + this.socket = new MulticastSocket(4445); + this.broadcastAddress = InetAddress.getByName("224.0.2.60"); + this.socket.setSoTimeout(5000); + this.socket.joinGroup(this.broadcastAddress); + } + + public void run() + { + byte[] abyte = new byte[1024]; + + while (!this.isInterrupted()) + { + DatagramPacket datagrampacket = new DatagramPacket(abyte, abyte.length); + + try + { + this.socket.receive(datagrampacket); + } + catch (SocketTimeoutException var5) + { + continue; + } + catch (IOException ioexception) + { + LanServerDetector.logger.error((String)"Couldn\'t ping server", (Throwable)ioexception); + break; + } + + String s = new String(datagrampacket.getData(), datagrampacket.getOffset(), datagrampacket.getLength()); + LanServerDetector.logger.debug(datagrampacket.getAddress() + ": " + s); + this.localServerList.func_77551_a(s, datagrampacket.getAddress()); + } + + try + { + this.socket.leaveGroup(this.broadcastAddress); + } + catch (IOException var4) + { + ; + } + + this.socket.close(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java new file mode 100644 index 0000000..c00a971 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java @@ -0,0 +1,30 @@ +package net.minecraft.client.network; + +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.NetHandlerLoginServer; +import net.minecraft.util.IChatComponent; + +public class NetHandlerHandshakeMemory implements INetHandlerHandshakeServer +{ + private final MinecraftServer mcServer; + private final NetworkManager networkManager; + + public NetHandlerHandshakeMemory(MinecraftServer mcServerIn, NetworkManager networkManagerIn) + { + this.mcServer = mcServerIn; + this.networkManager = networkManagerIn; + } + + public void processHandshake(C00Handshake packetIn) + { + this.networkManager.setConnectionState(packetIn.getRequestedState()); + this.networkManager.setNetHandler(new NetHandlerLoginServer(this.mcServer, this.networkManager)); + } + + public void onDisconnect(IChatComponent reason) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerLoginClient.java b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerLoginClient.java new file mode 100644 index 0000000..b81646a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerLoginClient.java @@ -0,0 +1,124 @@ +package net.minecraft.client.network; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; +import com.mojang.authlib.exceptions.InvalidCredentialsException; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.math.BigInteger; +import java.security.PublicKey; +import javax.crypto.SecretKey; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.login.server.S03PacketEnableCompression; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.CryptManager; +import net.minecraft.util.IChatComponent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetHandlerLoginClient implements INetHandlerLoginClient +{ + private static final Logger logger = LogManager.getLogger(); + private final Minecraft mc; + private final GuiScreen previousGuiScreen; + private final NetworkManager networkManager; + private GameProfile gameProfile; + + public NetHandlerLoginClient(NetworkManager networkManagerIn, Minecraft mcIn, GuiScreen p_i45059_3_) + { + this.networkManager = networkManagerIn; + this.mc = mcIn; + this.previousGuiScreen = p_i45059_3_; + } + + public void handleEncryptionRequest(S01PacketEncryptionRequest packetIn) + { + final SecretKey secretkey = CryptManager.createNewSharedKey(); + String s = packetIn.getServerId(); + PublicKey publickey = packetIn.getPublicKey(); + String s1 = (new BigInteger(CryptManager.getServerIdHash(s, publickey, secretkey))).toString(16); + + if (this.mc.getCurrentServerData() != null && this.mc.getCurrentServerData().isOnLAN()) + { + try + { + this.getSessionService().joinServer(this.mc.getSession().getProfile(), this.mc.getSession().getToken(), s1); + } + catch (AuthenticationException var10) + { + logger.warn("Couldn\'t connect to auth servers but will continue to join LAN"); + } + } + else + { + try + { + this.getSessionService().joinServer(this.mc.getSession().getProfile(), this.mc.getSession().getToken(), s1); + } + catch (AuthenticationUnavailableException var7) + { + this.networkManager.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new Object[] {new ChatComponentTranslation("disconnect.loginFailedInfo.serversUnavailable", new Object[0])})); + return; + } + catch (InvalidCredentialsException var8) + { + this.networkManager.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new Object[] {new ChatComponentTranslation("disconnect.loginFailedInfo.invalidSession", new Object[0])})); + return; + } + catch (AuthenticationException authenticationexception) + { + this.networkManager.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new Object[] {authenticationexception.getMessage()})); + return; + } + } + + this.networkManager.sendPacket(new C01PacketEncryptionResponse(secretkey, publickey, packetIn.getVerifyToken()), new GenericFutureListener < Future > () + { + public void operationComplete(Future p_operationComplete_1_) throws Exception + { + NetHandlerLoginClient.this.networkManager.enableEncryption(secretkey); + } + }, new GenericFutureListener[0]); + } + + private MinecraftSessionService getSessionService() + { + return this.mc.getSessionService(); + } + + public void handleLoginSuccess(S02PacketLoginSuccess packetIn) + { + this.gameProfile = packetIn.getProfile(); + this.networkManager.setConnectionState(EnumConnectionState.PLAY); + this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile)); + } + + public void onDisconnect(IChatComponent reason) + { + this.mc.displayGuiScreen(new GuiDisconnected(this.previousGuiScreen, "connect.failed", reason)); + } + + public void handleDisconnect(S00PacketDisconnect packetIn) + { + this.networkManager.closeChannel(packetIn.func_149603_c()); + } + + public void handleEnableCompression(S03PacketEnableCompression packetIn) + { + if (!this.networkManager.isLocalChannel()) + { + this.networkManager.setCompressionTreshold(packetIn.getCompressionTreshold()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java new file mode 100644 index 0000000..5382daa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java @@ -0,0 +1,1470 @@ +package net.minecraft.client.network; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.network.DisconnectEvent; +import com.cheatbreaker.client.event.impl.network.PluginMessageEvent; +import com.cheatbreaker.client.module.impl.normal.hud.chat.ModuleChat; +import com.cheatbreaker.client.module.impl.normal.hud.simple.combat.SimpleModuleComboCounter; +import com.cheatbreaker.client.module.impl.normal.hud.simple.combat.SimpleModuleSprintResetCounter; +import com.google.common.collect.Maps; +import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.Futures; +import com.mojang.authlib.GameProfile; +import io.netty.buffer.Unpooled; +import net.minecraft.block.Block; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.GuardianSound; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.*; +import net.minecraft.client.gui.inventory.GuiContainerCreative; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityPickupFX; +import net.minecraft.client.player.inventory.ContainerLocalMenu; +import net.minecraft.client.player.inventory.LocalBlockIntercommunication; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.stream.MetadataAchievement; +import net.minecraft.client.stream.MetadataCombat; +import net.minecraft.client.stream.MetadataPlayerDeath; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.attributes.*; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.*; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.*; +import net.minecraft.init.Items; +import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.PacketThreadUtil; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.network.play.client.*; +import net.minecraft.network.play.server.*; +import net.minecraft.potion.PotionEffect; +import net.minecraft.realms.DisconnectedRealmsScreen; +import net.minecraft.scoreboard.*; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.tileentity.*; +import net.minecraft.util.*; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.Explosion; +import net.minecraft.world.WorldProviderSurface; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.MapData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.Map.Entry; + +public class NetHandlerPlayClient implements INetHandlerPlayClient { + private static final Logger logger = LogManager.getLogger(); + private final NetworkManager netManager; + private final GameProfile profile; + private final GuiScreen guiScreenServer; + private Minecraft gameController; + private WorldClient clientWorldController; + private boolean doneLoadingTerrain; + private final Map playerInfoMap = Maps.newHashMap(); + public int currentServerMaxPlayers = 20; + private boolean field_147308_k = false; + private final Random avRandomizer = new Random(); + + public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager p_i46300_3_, GameProfile p_i46300_4_) { + this.gameController = mcIn; + this.guiScreenServer = p_i46300_2_; + this.netManager = p_i46300_3_; + this.profile = p_i46300_4_; + } + + public void cleanup() { + this.clientWorldController = null; + } + + public void handleJoinGame(S01PacketJoinGame packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.playerController = new PlayerControllerMP(this.gameController, this); + this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler); + this.gameController.gameSettings.difficulty = packetIn.getDifficulty(); + this.gameController.loadWorld(this.clientWorldController); + this.gameController.thePlayer.dimension = packetIn.getDimension(); + this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); + this.gameController.thePlayer.setEntityId(packetIn.getEntityId()); + this.currentServerMaxPlayers = packetIn.getMaxPlayers(); + this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo()); + this.gameController.playerController.setGameType(packetIn.getGameType()); + this.gameController.gameSettings.sendSettingsToServer(); + this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName()))); + } + + public void handleSpawnObject(S0EPacketSpawnObject packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + double d0 = (double) packetIn.getX() / 32.0D; + double d1 = (double) packetIn.getY() / 32.0D; + double d2 = (double) packetIn.getZ() / 32.0D; + Entity entity = null; + + if (packetIn.getType() == 10) { + entity = EntityMinecart.getMinecart(this.clientWorldController, d0, d1, d2, EntityMinecart.EnumMinecartType.byNetworkID(packetIn.func_149009_m())); + } else if (packetIn.getType() == 90) { + Entity entity1 = this.clientWorldController.getEntityByID(packetIn.func_149009_m()); + + if (entity1 instanceof EntityPlayer) { + entity = new EntityFishHook(this.clientWorldController, d0, d1, d2, (EntityPlayer) entity1); + } + + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 60) { + entity = new EntityArrow(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 61) { + entity = new EntitySnowball(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 71) { + entity = new EntityItemFrame(this.clientWorldController, new BlockPos(MathHelper.floor_double(d0), MathHelper.floor_double(d1), MathHelper.floor_double(d2)), EnumFacing.getHorizontal(packetIn.func_149009_m())); + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 77) { + entity = new EntityLeashKnot(this.clientWorldController, new BlockPos(MathHelper.floor_double(d0), MathHelper.floor_double(d1), MathHelper.floor_double(d2))); + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 65) { + entity = new EntityEnderPearl(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 72) { + entity = new EntityEnderEye(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 76) { + entity = new EntityFireworkRocket(this.clientWorldController, d0, d1, d2, (ItemStack) null); + } else if (packetIn.getType() == 63) { + entity = new EntityLargeFireball(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D); + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 64) { + entity = new EntitySmallFireball(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D); + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 66) { + entity = new EntityWitherSkull(this.clientWorldController, d0, d1, d2, (double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D); + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 62) { + entity = new EntityEgg(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 73) { + entity = new EntityPotion(this.clientWorldController, d0, d1, d2, packetIn.func_149009_m()); + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 75) { + entity = new EntityExpBottle(this.clientWorldController, d0, d1, d2); + packetIn.func_149002_g(0); + } else if (packetIn.getType() == 1) { + entity = new EntityBoat(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 50) { + entity = new EntityTNTPrimed(this.clientWorldController, d0, d1, d2, (EntityLivingBase) null); + } else if (packetIn.getType() == 78) { + entity = new EntityArmorStand(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 51) { + entity = new EntityEnderCrystal(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 2) { + entity = new EntityItem(this.clientWorldController, d0, d1, d2); + } else if (packetIn.getType() == 70) { + entity = new EntityFallingBlock(this.clientWorldController, d0, d1, d2, Block.getStateById(packetIn.func_149009_m() & 65535)); + packetIn.func_149002_g(0); + } + + if (entity != null) { + entity.serverPosX = packetIn.getX(); + entity.serverPosY = packetIn.getY(); + entity.serverPosZ = packetIn.getZ(); + entity.rotationPitch = (float) (packetIn.getPitch() * 360) / 256.0F; + entity.rotationYaw = (float) (packetIn.getYaw() * 360) / 256.0F; + Entity[] aentity = entity.getParts(); + + if (aentity != null) { + int i = packetIn.getEntityID() - entity.getEntityId(); + + for (int j = 0; j < aentity.length; ++j) { + aentity[j].setEntityId(aentity[j].getEntityId() + i); + } + } + + entity.setEntityId(packetIn.getEntityID()); + this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entity); + + if (packetIn.func_149009_m() > 0) { + if (packetIn.getType() == 60) { + Entity entity2 = this.clientWorldController.getEntityByID(packetIn.func_149009_m()); + + if (entity2 instanceof EntityLivingBase && entity instanceof EntityArrow) { + ((EntityArrow) entity).shootingEntity = entity2; + } + } + + entity.setVelocity((double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D, (double) packetIn.getSpeedZ() / 8000.0D); + } + } + } + + public void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = new EntityXPOrb(this.clientWorldController, (double) packetIn.getX() / 32.0D, (double) packetIn.getY() / 32.0D, (double) packetIn.getZ() / 32.0D, packetIn.getXPValue()); + entity.serverPosX = packetIn.getX(); + entity.serverPosY = packetIn.getY(); + entity.serverPosZ = packetIn.getZ(); + entity.rotationYaw = 0.0F; + entity.rotationPitch = 0.0F; + entity.setEntityId(packetIn.getEntityID()); + this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entity); + } + + public void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + double d0 = (double) packetIn.func_149051_d() / 32.0D; + double d1 = (double) packetIn.func_149050_e() / 32.0D; + double d2 = (double) packetIn.func_149049_f() / 32.0D; + Entity entity = null; + + if (packetIn.func_149053_g() == 1) { + entity = new EntityLightningBolt(this.clientWorldController, d0, d1, d2); + } + + if (entity != null) { + entity.serverPosX = packetIn.func_149051_d(); + entity.serverPosY = packetIn.func_149050_e(); + entity.serverPosZ = packetIn.func_149049_f(); + entity.rotationYaw = 0.0F; + entity.rotationPitch = 0.0F; + entity.setEntityId(packetIn.func_149052_c()); + this.clientWorldController.addWeatherEffect(entity); + } + } + + public void handleSpawnPainting(S10PacketSpawnPainting packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPainting entitypainting = new EntityPainting(this.clientWorldController, packetIn.getPosition(), packetIn.getFacing(), packetIn.getTitle()); + this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitypainting); + } + + public void handleEntityVelocity(S12PacketEntityVelocity packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID()); + + if (entity != null) { + entity.setVelocity((double) packetIn.getMotionX() / 8000.0D, (double) packetIn.getMotionY() / 8000.0D, (double) packetIn.getMotionZ() / 8000.0D); + } + } + + public void handleEntityMetadata(S1CPacketEntityMetadata packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); + + if (entity != null && packetIn.func_149376_c() != null) { + entity.getDataWatcher().updateWatchedObjectsFromList(packetIn.func_149376_c()); + } + } + + public void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + double d0 = (double) packetIn.getX() / 32.0D; + double d1 = (double) packetIn.getY() / 32.0D; + double d2 = (double) packetIn.getZ() / 32.0D; + float f = (float) (packetIn.getYaw() * 360) / 256.0F; + float f1 = (float) (packetIn.getPitch() * 360) / 256.0F; + EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld, this.getPlayerInfo(packetIn.getPlayer()).getGameProfile()); + entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double) (entityotherplayermp.serverPosX = packetIn.getX()); + entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double) (entityotherplayermp.serverPosY = packetIn.getY()); + entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double) (entityotherplayermp.serverPosZ = packetIn.getZ()); + int i = packetIn.getCurrentItemID(); + + if (i == 0) { + entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null; + } else { + entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0); + } + + entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1); + this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp); + List list = packetIn.func_148944_c(); + + if (list != null) { + entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list); + } + } + + public void handleEntityTeleport(S18PacketEntityTeleport packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); + + if (entity != null) { + entity.serverPosX = packetIn.getX(); + entity.serverPosY = packetIn.getY(); + entity.serverPosZ = packetIn.getZ(); + double d0 = (double) entity.serverPosX / 32.0D; + double d1 = (double) entity.serverPosY / 32.0D; + double d2 = (double) entity.serverPosZ / 32.0D; + float f = (float) (packetIn.getYaw() * 360) / 256.0F; + float f1 = (float) (packetIn.getPitch() * 360) / 256.0F; + + if (Math.abs(entity.posX - d0) < 0.03125D && Math.abs(entity.posY - d1) < 0.015625D && Math.abs(entity.posZ - d2) < 0.03125D) { + entity.setPositionAndRotation2(entity.posX, entity.posY, entity.posZ, f, f1, 3, true); + } else { + entity.setPositionAndRotation2(d0, d1, d2, f, f1, 3, true); + } + + entity.onGround = packetIn.getOnGround(); + } + } + + public void handleHeldItemChange(S09PacketHeldItemChange packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + if (packetIn.getHeldItemHotbarIndex() >= 0 && packetIn.getHeldItemHotbarIndex() < InventoryPlayer.getHotbarSize()) { + this.gameController.thePlayer.inventory.currentItem = packetIn.getHeldItemHotbarIndex(); + } + } + + public void handleEntityMovement(S14PacketEntity packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = packetIn.getEntity(this.clientWorldController); + + if (entity != null) { + entity.serverPosX += packetIn.func_149062_c(); + entity.serverPosY += packetIn.func_149061_d(); + entity.serverPosZ += packetIn.func_149064_e(); + double d0 = (double) entity.serverPosX / 32.0D; + double d1 = (double) entity.serverPosY / 32.0D; + double d2 = (double) entity.serverPosZ / 32.0D; + float f = packetIn.func_149060_h() ? (float) (packetIn.func_149066_f() * 360) / 256.0F : entity.rotationYaw; + float f1 = packetIn.func_149060_h() ? (float) (packetIn.func_149063_g() * 360) / 256.0F : entity.rotationPitch; + entity.setPositionAndRotation2(d0, d1, d2, f, f1, 3, false); + entity.onGround = packetIn.getOnGround(); + } + } + + public void handleEntityHeadLook(S19PacketEntityHeadLook packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = packetIn.getEntity(this.clientWorldController); + + if (entity != null) { + float f = (float) (packetIn.getYaw() * 360) / 256.0F; + entity.setRotationYawHead(f); + } + } + + public void handleDestroyEntities(S13PacketDestroyEntities packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + for (int i = 0; i < packetIn.getEntityIDs().length; ++i) { + this.clientWorldController.removeEntityFromWorld(packetIn.getEntityIDs()[i]); + } + } + + public void handlePlayerPosLook(S08PacketPlayerPosLook packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPlayer entityplayer = this.gameController.thePlayer; + double d0 = packetIn.getX(); + double d1 = packetIn.getY(); + double d2 = packetIn.getZ(); + float f = packetIn.getYaw(); + float f1 = packetIn.getPitch(); + + if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X)) { + d0 += entityplayer.posX; + } else { + entityplayer.motionX = 0.0D; + } + + if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y)) { + d1 += entityplayer.posY; + } else { + entityplayer.motionY = 0.0D; + } + + if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Z)) { + d2 += entityplayer.posZ; + } else { + entityplayer.motionZ = 0.0D; + } + + if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X_ROT)) { + f1 += entityplayer.rotationPitch; + } + + if (packetIn.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT)) { + f += entityplayer.rotationYaw; + } + + entityplayer.setPositionAndRotation(d0, d1, d2, f, f1); + this.netManager.sendPacket(new C03PacketPlayer.C06PacketPlayerPosLook(entityplayer.posX, entityplayer.getEntityBoundingBox().minY, entityplayer.posZ, entityplayer.rotationYaw, entityplayer.rotationPitch, false)); + + if (!this.doneLoadingTerrain) { + this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX; + this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY; + this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ; + this.doneLoadingTerrain = true; + this.gameController.displayGuiScreen((GuiScreen) null); + } + } + + public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + for (S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata : packetIn.getChangedBlocks()) { + this.clientWorldController.invalidateRegionAndSetBlock(s22packetmultiblockchange$blockupdatedata.getPos(), s22packetmultiblockchange$blockupdatedata.getBlockState()); + } + } + + public void handleChunkData(S21PacketChunkData packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + if (packetIn.func_149274_i()) { + if (packetIn.getExtractedSize() == 0) { + this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), false); + return; + } + + this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), true); + } + + this.clientWorldController.invalidateBlockReceiveRegion(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15); + Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(packetIn.getChunkX(), packetIn.getChunkZ()); + chunk.fillChunk(packetIn.getExtractedDataBytes(), packetIn.getExtractedSize(), packetIn.func_149274_i()); + this.clientWorldController.markBlockRangeForRenderUpdate(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 256, (packetIn.getChunkZ() << 4) + 15); + + if (!packetIn.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface)) { + chunk.resetRelightChecks(); + } + } + + public void handleBlockChange(S23PacketBlockChange packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.clientWorldController.invalidateRegionAndSetBlock(packetIn.getBlockPosition(), packetIn.getBlockState()); + } + + public void handleDisconnect(S40PacketDisconnect packetIn) { + this.netManager.closeChannel(packetIn.getReason()); + } + + public void onDisconnect(IChatComponent reason) { + this.gameController.loadWorld((WorldClient) null); + + // CB + CheatBreaker.getInstance().getEventBus().handleEvent(new DisconnectEvent()); + + if (this.guiScreenServer != null) { + if (this.guiScreenServer instanceof GuiScreenRealmsProxy) { + this.gameController.displayGuiScreen((new DisconnectedRealmsScreen(((GuiScreenRealmsProxy) this.guiScreenServer).func_154321_a(), "disconnect.lost", reason)).getProxy()); + } else { + this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason)); + } + } else { + this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason)); + } + } + + public void addToSendQueue(Packet p_147297_1_) { + if (p_147297_1_ instanceof C02PacketUseEntity) { + Entity entity = ((C02PacketUseEntity) p_147297_1_).getEntityFromWorld(this.gameController.theWorld); + if (entity != null && ((C02PacketUseEntity) p_147297_1_).getAction() == C02PacketUseEntity.Action.ATTACK) { + SimpleModuleComboCounter.lastAttacked = entity.getEntityId(); + SimpleModuleComboCounter.lastAttackTime = System.currentTimeMillis(); + SimpleModuleSprintResetCounter.lastAttacked = entity.getEntityId(); + SimpleModuleSprintResetCounter.lastAttackTime = System.currentTimeMillis(); + } + } + + this.netManager.sendPacket(p_147297_1_); + } + + public void handleCollectItem(S0DPacketCollectItem packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getCollectedItemEntityID()); + EntityLivingBase entitylivingbase = (EntityLivingBase) this.clientWorldController.getEntityByID(packetIn.getEntityID()); + + if (entitylivingbase == null) { + entitylivingbase = this.gameController.thePlayer; + } + + if (entity != null) { + if (entity instanceof EntityXPOrb) { + this.clientWorldController.playSoundAtEntity(entity, "random.orb", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } else { + this.clientWorldController.playSoundAtEntity(entity, "random.pop", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } + + this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.clientWorldController, entity, entitylivingbase, 0.5F)); + this.clientWorldController.removeEntityFromWorld(packetIn.getCollectedItemEntityID()); + } + } + + public void handleChat(S02PacketChat packetIn) { + ModuleChat chatModule = CheatBreaker.getInstance().getModuleManager().chatMod; + + if (packetIn.getChatComponent().getUnformattedText().contains(Minecraft.getMinecraft().getSession().getUsername())){ + if (chatModule.isEnabled() && + chatModule.highlightOwnName.getBooleanValue() && + chatModule.playDing.getBooleanValue() && + !CheatBreaker.getInstance().getGlobalSettings().muteCBSounds.getBooleanValue() && chatModule.dingCooldown.size() < 1) { + CheatBreaker.getInstance().getAudioManager().playSound("message"); + CheatBreaker.getInstance().getModuleManager().chatMod.dingCooldown.add(System.currentTimeMillis()); + } + } + + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + if (packetIn.getType() == 2) { + this.gameController.ingameGUI.setRecordPlaying(packetIn.getChatComponent(), false); + } else { + this.gameController.ingameGUI.getChatGUI().printChatMessage(packetIn.getChatComponent()); + } + } + + public void handleAnimation(S0BPacketAnimation packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID()); + + if (entity != null) { + if (packetIn.getAnimationType() == 0) { + EntityLivingBase entitylivingbase = (EntityLivingBase) entity; + entitylivingbase.swingItem(); + } else if (packetIn.getAnimationType() == 1) { + entity.performHurtAnimation(); + } else if (packetIn.getAnimationType() == 2) { + EntityPlayer entityplayer = (EntityPlayer) entity; + entityplayer.wakeUpPlayer(false, false, false); + } else if (packetIn.getAnimationType() == 4) { + this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT); + } else if (packetIn.getAnimationType() == 5) { + this.gameController.effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT_MAGIC); + } + } + } + + public void handleUseBed(S0APacketUseBed packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + packetIn.getPlayer(this.clientWorldController).trySleep(packetIn.getBedPosition()); + } + + public void handleSpawnMob(S0FPacketSpawnMob packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + double d0 = (double) packetIn.getX() / 32.0D; + double d1 = (double) packetIn.getY() / 32.0D; + double d2 = (double) packetIn.getZ() / 32.0D; + float f = (float) (packetIn.getYaw() * 360) / 256.0F; + float f1 = (float) (packetIn.getPitch() * 360) / 256.0F; + EntityLivingBase entitylivingbase = (EntityLivingBase) EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld); + entitylivingbase.serverPosX = packetIn.getX(); + entitylivingbase.serverPosY = packetIn.getY(); + entitylivingbase.serverPosZ = packetIn.getZ(); + entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float) (packetIn.getHeadPitch() * 360) / 256.0F; + Entity[] aentity = entitylivingbase.getParts(); + + if (aentity != null) { + int i = packetIn.getEntityID() - entitylivingbase.getEntityId(); + + for (int j = 0; j < aentity.length; ++j) { + aentity[j].setEntityId(aentity[j].getEntityId() + i); + } + } + + entitylivingbase.setEntityId(packetIn.getEntityID()); + entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1); + entitylivingbase.motionX = (double) ((float) packetIn.getVelocityX() / 8000.0F); + entitylivingbase.motionY = (double) ((float) packetIn.getVelocityY() / 8000.0F); + entitylivingbase.motionZ = (double) ((float) packetIn.getVelocityZ() / 8000.0F); + this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitylivingbase); + List list = packetIn.func_149027_c(); + + if (list != null) { + entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list); + } + } + + public void handleTimeUpdate(S03PacketTimeUpdate packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.theWorld.setTotalWorldTime(packetIn.getTotalWorldTime()); + if (CheatBreaker.getInstance().getModuleManager().environmentChangerMod.timeType.getValue().equals("Server") || !CheatBreaker.getInstance().getModuleManager().environmentChangerMod.isEnabled()) { + this.gameController.theWorld.setWorldTime(packetIn.getTotalWorldTime()); + } + } + + public void handleSpawnPosition(S05PacketSpawnPosition packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.thePlayer.setSpawnPoint(packetIn.getSpawnPos(), true); + this.gameController.theWorld.getWorldInfo().setSpawn(packetIn.getSpawnPos()); + } + + public void handleEntityAttach(S1BPacketEntityAttach packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); + Entity entity1 = this.clientWorldController.getEntityByID(packetIn.getVehicleEntityId()); + + if (packetIn.getLeash() == 0) { + boolean flag = false; + + if (packetIn.getEntityId() == this.gameController.thePlayer.getEntityId()) { + entity = this.gameController.thePlayer; + + if (entity1 instanceof EntityBoat) { + ((EntityBoat) entity1).setIsBoatEmpty(false); + } + + flag = entity.ridingEntity == null && entity1 != null; + } else if (entity1 instanceof EntityBoat) { + ((EntityBoat) entity1).setIsBoatEmpty(true); + } + + if (entity == null) { + return; + } + + entity.mountEntity(entity1); + + if (flag) { + GameSettings gamesettings = this.gameController.gameSettings; + this.gameController.ingameGUI.setRecordPlaying(I18n.format("mount.onboard", new Object[]{GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode())}), false); + } + } else if (packetIn.getLeash() == 1 && entity instanceof EntityLiving) { + if (entity1 != null) { + ((EntityLiving) entity).setLeashedToEntity(entity1, false); + } else { + ((EntityLiving) entity).clearLeashed(false, false); + } + } + } + + public void handleEntityStatus(S19PacketEntityStatus packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = packetIn.getEntity(this.clientWorldController); + + if (entity != null) { + if (packetIn.getOpCode() == 21) { + this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity)); + } else { + entity.handleStatusUpdate(packetIn.getOpCode()); + if (packetIn.getOpCode() != 2) { + return; + } + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + if (SimpleModuleComboCounter.lastAttacked == entity.getEntityId()) { + SimpleModuleComboCounter.lastAttacked = -1; + if (SimpleModuleComboCounter.lastCombo != entity.getEntityId()) { + SimpleModuleComboCounter.hits.clear(); + } + + SimpleModuleComboCounter.hits.add(System.currentTimeMillis()); + SimpleModuleComboCounter.lastComboTime = System.currentTimeMillis(); + SimpleModuleComboCounter.lastCombo = entity.getEntityId(); + } else if (entity.getEntityId() == player.getEntityId()) { + SimpleModuleComboCounter.hits.clear(); + } + if (SimpleModuleSprintResetCounter.lastAttacked == entity.getEntityId()) { + SimpleModuleSprintResetCounter.lastAttacked = -1; + if (SimpleModuleSprintResetCounter.lastCombo != entity.getEntityId()) { + SimpleModuleSprintResetCounter.temphits.clear(); + } + + if (mc.gameSettings.keyBindForward.isKeyDown() && player.isSprinting()) { + SimpleModuleSprintResetCounter.temphits.add(System.currentTimeMillis()); + } + SimpleModuleSprintResetCounter.lastComboTime = System.currentTimeMillis(); + SimpleModuleSprintResetCounter.lastCombo = entity.getEntityId(); + } + } + } + } + + public void handleUpdateHealth(S06PacketUpdateHealth packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.thePlayer.setPlayerSPHealth(packetIn.getHealth()); + this.gameController.thePlayer.getFoodStats().setFoodLevel(packetIn.getFoodLevel()); + this.gameController.thePlayer.getFoodStats().setFoodSaturationLevel(packetIn.getSaturationLevel()); + } + + public void handleSetExperience(S1FPacketSetExperience packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.thePlayer.setXPStats(packetIn.func_149397_c(), packetIn.getTotalExperience(), packetIn.getLevel()); + } + + public void handleRespawn(S07PacketRespawn packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + if (packetIn.getDimensionID() != this.gameController.thePlayer.dimension) { + this.doneLoadingTerrain = false; + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, this.gameController.theWorld.getWorldInfo().isHardcoreModeEnabled(), packetIn.getWorldType()), packetIn.getDimensionID(), packetIn.getDifficulty(), this.gameController.mcProfiler); + this.clientWorldController.setWorldScoreboard(scoreboard); + this.gameController.loadWorld(this.clientWorldController); + this.gameController.thePlayer.dimension = packetIn.getDimensionID(); + this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); + } + + this.gameController.setDimensionAndSpawnPlayer(packetIn.getDimensionID()); + this.gameController.playerController.setGameType(packetIn.getGameType()); + } + + public void handleExplosion(S27PacketExplosion packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Explosion explosion = new Explosion(this.gameController.theWorld, (Entity) null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); + explosion.doExplosionB(true); + this.gameController.thePlayer.motionX += (double) packetIn.func_149149_c(); + this.gameController.thePlayer.motionY += (double) packetIn.func_149144_d(); + this.gameController.thePlayer.motionZ += (double) packetIn.func_149147_e(); + } + + public void handleOpenWindow(S2DPacketOpenWindow packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPlayerSP entityplayersp = this.gameController.thePlayer; + + if ("minecraft:container".equals(packetIn.getGuiId())) { + entityplayersp.displayGUIChest(new InventoryBasic(packetIn.getWindowTitle(), packetIn.getSlotCount())); + entityplayersp.openContainer.windowId = packetIn.getWindowId(); + } else if ("minecraft:villager".equals(packetIn.getGuiId())) { + entityplayersp.displayVillagerTradeGui(new NpcMerchant(entityplayersp, packetIn.getWindowTitle())); + entityplayersp.openContainer.windowId = packetIn.getWindowId(); + } else if ("EntityHorse".equals(packetIn.getGuiId())) { + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); + + if (entity instanceof EntityHorse) { + entityplayersp.displayGUIHorse((EntityHorse) entity, new AnimalChest(packetIn.getWindowTitle(), packetIn.getSlotCount())); + entityplayersp.openContainer.windowId = packetIn.getWindowId(); + } + } else if (!packetIn.hasSlots()) { + entityplayersp.displayGui(new LocalBlockIntercommunication(packetIn.getGuiId(), packetIn.getWindowTitle())); + entityplayersp.openContainer.windowId = packetIn.getWindowId(); + } else { + ContainerLocalMenu containerlocalmenu = new ContainerLocalMenu(packetIn.getGuiId(), packetIn.getWindowTitle(), packetIn.getSlotCount()); + entityplayersp.displayGUIChest(containerlocalmenu); + entityplayersp.openContainer.windowId = packetIn.getWindowId(); + } + } + + public void handleSetSlot(S2FPacketSetSlot packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPlayer entityplayer = this.gameController.thePlayer; + + if (packetIn.func_149175_c() == -1) { + entityplayer.inventory.setItemStack(packetIn.func_149174_e()); + } else { + boolean flag = false; + + if (this.gameController.currentScreen instanceof GuiContainerCreative) { + GuiContainerCreative guicontainercreative = (GuiContainerCreative) this.gameController.currentScreen; + flag = guicontainercreative.getSelectedTabIndex() != CreativeTabs.tabInventory.getTabIndex(); + } + + if (packetIn.func_149175_c() == 0 && packetIn.func_149173_d() >= 36 && packetIn.func_149173_d() < 45) { + ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack(); + + if (packetIn.func_149174_e() != null && (itemstack == null || itemstack.stackSize < packetIn.func_149174_e().stackSize)) { + packetIn.func_149174_e().animationsToGo = 5; + } + + entityplayer.inventoryContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e()); + } else if (packetIn.func_149175_c() == entityplayer.openContainer.windowId && (packetIn.func_149175_c() != 0 || !flag)) { + entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e()); + } + } + } + + public void handleConfirmTransaction(S32PacketConfirmTransaction packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Container container = null; + EntityPlayer entityplayer = this.gameController.thePlayer; + + if (packetIn.getWindowId() == 0) { + container = entityplayer.inventoryContainer; + } else if (packetIn.getWindowId() == entityplayer.openContainer.windowId) { + container = entityplayer.openContainer; + } + + if (container != null && !packetIn.func_148888_e()) { + this.addToSendQueue(new C0FPacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true)); + } + } + + public void handleWindowItems(S30PacketWindowItems packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPlayer entityplayer = this.gameController.thePlayer; + + if (packetIn.func_148911_c() == 0) { + entityplayer.inventoryContainer.putStacksInSlots(packetIn.getItemStacks()); + } else if (packetIn.func_148911_c() == entityplayer.openContainer.windowId) { + entityplayer.openContainer.putStacksInSlots(packetIn.getItemStacks()); + } + } + + public void handleSignEditorOpen(S36PacketSignEditorOpen packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + TileEntity tileentity = this.clientWorldController.getTileEntity(packetIn.getSignPosition()); + + if (!(tileentity instanceof TileEntitySign)) { + tileentity = new TileEntitySign(); + tileentity.setWorldObj(this.clientWorldController); + tileentity.setPos(packetIn.getSignPosition()); + } + + this.gameController.thePlayer.openEditSign((TileEntitySign) tileentity); + } + + public void handleUpdateSign(S33PacketUpdateSign packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + boolean flag = false; + + if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) { + TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos()); + + if (tileentity instanceof TileEntitySign) { + TileEntitySign tileentitysign = (TileEntitySign) tileentity; + + if (tileentitysign.getIsEditable()) { + System.arraycopy(packetIn.getLines(), 0, tileentitysign.signText, 0, 4); + tileentitysign.markDirty(); + } + + flag = true; + } + } + + if (!flag && this.gameController.thePlayer != null) { + this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + packetIn.getPos().getX() + ", " + packetIn.getPos().getY() + ", " + packetIn.getPos().getZ())); + } + } + + public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) { + TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos()); + int i = packetIn.getTileEntityType(); + + if (i == 1 && tileentity instanceof TileEntityMobSpawner || i == 2 && tileentity instanceof TileEntityCommandBlock || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner) { + tileentity.readFromNBT(packetIn.getNbtCompound()); + } + } + } + + public void handleWindowProperty(S31PacketWindowProperty packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPlayer entityplayer = this.gameController.thePlayer; + + if (entityplayer.openContainer != null && entityplayer.openContainer.windowId == packetIn.getWindowId()) { + entityplayer.openContainer.updateProgressBar(packetIn.getVarIndex(), packetIn.getVarValue()); + } + } + + public void handleEntityEquipment(S04PacketEntityEquipment packetIn) { + + if (packetIn == null) return; + + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID()); + + if (entity != null) { + entity.setCurrentItemOrArmor(packetIn.getEquipmentSlot(), packetIn.getItemStack()); + } + } + + public void handleCloseWindow(S2EPacketCloseWindow packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.thePlayer.closeScreenAndDropStack(); + } + + public void handleBlockAction(S24PacketBlockAction packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.theWorld.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2()); + } + + public void handleBlockBreakAnim(S25PacketBlockBreakAnim packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.theWorld.sendBlockBreakProgress(packetIn.getBreakerId(), packetIn.getPosition(), packetIn.getProgress()); + } + + public void handleMapChunkBulk(S26PacketMapChunkBulk packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + for (int i = 0; i < packetIn.getChunkCount(); ++i) { + int j = packetIn.getChunkX(i); + int k = packetIn.getChunkZ(i); + this.clientWorldController.doPreChunk(j, k, true); + this.clientWorldController.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15); + Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(j, k); + chunk.fillChunk(packetIn.getChunkBytes(i), packetIn.getChunkSize(i), true); + this.clientWorldController.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15); + + if (!(this.clientWorldController.provider instanceof WorldProviderSurface)) { + chunk.resetRelightChecks(); + } + } + } + + public void handleChangeGameState(S2BPacketChangeGameState packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPlayer entityplayer = this.gameController.thePlayer; + int i = packetIn.getGameState(); + float f = packetIn.func_149137_d(); + int j = MathHelper.floor_float(f + 0.5F); + + if (i >= 0 && i < S2BPacketChangeGameState.MESSAGE_NAMES.length && S2BPacketChangeGameState.MESSAGE_NAMES[i] != null) { + entityplayer.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.MESSAGE_NAMES[i], new Object[0])); + } + + if (i == 1) { + this.clientWorldController.getWorldInfo().setRaining(true); + this.clientWorldController.setRainStrength(0.0F); + } else if (i == 2) { + this.clientWorldController.getWorldInfo().setRaining(false); + this.clientWorldController.setRainStrength(1.0F); + } else if (i == 3) { + this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j)); + } else if (i == 4) { + this.gameController.displayGuiScreen(new GuiWinGame()); + } else if (i == 5) { + GameSettings gamesettings = this.gameController.gameSettings; + + if (f == 0.0F) { + this.gameController.displayGuiScreen(new GuiScreenDemo()); + } else if (f == 101.0F) { + this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.movement", new Object[]{GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())})); + } else if (f == 102.0F) { + this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.jump", new Object[]{GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())})); + } else if (f == 103.0F) { + this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.inventory", new Object[]{GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())})); + } + } else if (i == 6) { + this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY + (double) entityplayer.getEyeHeight(), entityplayer.posZ, "random.successful_hit", 0.18F, 0.45F, false); + } else if (i == 7) { + this.clientWorldController.setRainStrength(f); + } else if (i == 8) { + this.clientWorldController.setThunderStrength(f); + } else if (i == 10) { + this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY, entityplayer.posZ, "mob.guardian.curse", 1.0F, 1.0F, false); + } + } + + public void handleMaps(S34PacketMaps packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + MapData mapdata = ItemMap.loadMapData(packetIn.getMapId(), this.gameController.theWorld); + packetIn.setMapdataTo(mapdata); + this.gameController.entityRenderer.getMapItemRenderer().updateMapTexture(mapdata); + } + + public void handleEffect(S28PacketEffect packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + if (packetIn.isSoundServerwide()) { + this.gameController.theWorld.playBroadcastSound(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData()); + } else { + this.gameController.theWorld.playAuxSFX(packetIn.getSoundType(), packetIn.getSoundPos(), packetIn.getSoundData()); + } + } + + public void handleStatistics(S37PacketStatistics packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + boolean flag = false; + + for (Entry entry : packetIn.func_148974_c().entrySet()) { + StatBase statbase = (StatBase) entry.getKey(); + int i = ((Integer) entry.getValue()).intValue(); + + if (statbase.isAchievement() && i > 0) { + if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().readStat(statbase) == 0) { + Achievement achievement = (Achievement) statbase; + this.gameController.guiAchievement.displayAchievement(achievement); + this.gameController.getTwitchStream().func_152911_a(new MetadataAchievement(achievement), 0L); + + if (statbase == AchievementList.openInventory) { + this.gameController.gameSettings.showInventoryAchievementHint = false; + this.gameController.gameSettings.saveOptions(); + } + } + + flag = true; + } + + this.gameController.thePlayer.getStatFileWriter().unlockAchievement(this.gameController.thePlayer, statbase, i); + } + + if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint) { + this.gameController.guiAchievement.displayUnformattedAchievement(AchievementList.openInventory); + } + + this.field_147308_k = true; + + if (this.gameController.currentScreen instanceof IProgressMeter) { + ((IProgressMeter) this.gameController.currentScreen).doneLoading(); + } + } + + public void handleEntityEffect(S1DPacketEntityEffect packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); + + if (entity instanceof EntityLivingBase) { + PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f()); + potioneffect.setPotionDurationMax(packetIn.func_149429_c()); + ((EntityLivingBase) entity).addPotionEffect(potioneffect); + } + } + + public void handleCombatEvent(S42PacketCombatEvent packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.field_179775_c); + EntityLivingBase entitylivingbase = entity instanceof EntityLivingBase ? (EntityLivingBase) entity : null; + + if (packetIn.eventType == S42PacketCombatEvent.Event.END_COMBAT) { + long i = (long) (1000 * packetIn.field_179772_d / 20); + MetadataCombat metadatacombat = new MetadataCombat(this.gameController.thePlayer, entitylivingbase); + this.gameController.getTwitchStream().func_176026_a(metadatacombat, 0L - i, 0L); + } else if (packetIn.eventType == S42PacketCombatEvent.Event.ENTITY_DIED) { + Entity entity1 = this.clientWorldController.getEntityByID(packetIn.field_179774_b); + + if (entity1 instanceof EntityPlayer) { + MetadataPlayerDeath metadataplayerdeath = new MetadataPlayerDeath((EntityPlayer) entity1, entitylivingbase); + metadataplayerdeath.func_152807_a(packetIn.deathMessage); + this.gameController.getTwitchStream().func_152911_a(metadataplayerdeath, 0L); + } + } + } + + public void handleServerDifficulty(S41PacketServerDifficulty packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.theWorld.getWorldInfo().setDifficulty(packetIn.getDifficulty()); + this.gameController.theWorld.getWorldInfo().setDifficultyLocked(packetIn.isDifficultyLocked()); + } + + public void handleCamera(S43PacketCamera packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = packetIn.getEntity(this.clientWorldController); + + if (entity != null) { + this.gameController.setRenderViewEntity(entity); + } + } + + public void handleWorldBorder(S44PacketWorldBorder packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + packetIn.func_179788_a(this.clientWorldController.getWorldBorder()); + } + + @SuppressWarnings("incomplete-switch") + public void handleTitle(S45PacketTitle packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + S45PacketTitle.Type s45packettitle$type = packetIn.getType(); + String s = null; + String s1 = null; + String s2 = packetIn.getMessage() != null ? packetIn.getMessage().getFormattedText() : ""; + + switch (s45packettitle$type) { + case TITLE: + s = s2; + break; + + case SUBTITLE: + s1 = s2; + break; + + case RESET: + this.gameController.ingameGUI.displayTitle("", "", -1, -1, -1); + this.gameController.ingameGUI.setDefaultTitlesTimes(); + return; + } + + this.gameController.ingameGUI.displayTitle(s, s1, packetIn.getFadeInTime(), packetIn.getDisplayTime(), packetIn.getFadeOutTime()); + } + + public void handleSetCompressionLevel(S46PacketSetCompressionLevel packetIn) { + if (!this.netManager.isLocalChannel()) { + this.netManager.setCompressionTreshold(packetIn.getThreshold()); + } + } + + public void handlePlayerListHeaderFooter(S47PacketPlayerListHeaderFooter packetIn) { + this.gameController.ingameGUI.getTabList().setHeader(packetIn.getHeader().getFormattedText().length() == 0 ? null : packetIn.getHeader()); + this.gameController.ingameGUI.getTabList().setFooter(packetIn.getFooter().getFormattedText().length() == 0 ? null : packetIn.getFooter()); + } + + public void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); + + if (entity instanceof EntityLivingBase) { + ((EntityLivingBase) entity).removePotionEffectClient(packetIn.getEffectId()); + } + } + + @SuppressWarnings("incomplete-switch") + public void handlePlayerListItem(S38PacketPlayerListItem packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : packetIn.getEntries()) { + if (packetIn.getAction() == S38PacketPlayerListItem.Action.REMOVE_PLAYER) { + this.playerInfoMap.remove(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + } else { + NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo) this.playerInfoMap.get(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + + if (packetIn.getAction() == S38PacketPlayerListItem.Action.ADD_PLAYER) { + networkplayerinfo = new NetworkPlayerInfo(s38packetplayerlistitem$addplayerdata); + this.playerInfoMap.put(networkplayerinfo.getGameProfile().getId(), networkplayerinfo); + } + + if (networkplayerinfo != null) { + switch (packetIn.getAction()) { + case ADD_PLAYER: + networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode()); + networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing()); + break; + + case UPDATE_GAME_MODE: + networkplayerinfo.setGameType(s38packetplayerlistitem$addplayerdata.getGameMode()); + break; + + case UPDATE_LATENCY: + networkplayerinfo.setResponseTime(s38packetplayerlistitem$addplayerdata.getPing()); + break; + + case UPDATE_DISPLAY_NAME: + networkplayerinfo.setDisplayName(s38packetplayerlistitem$addplayerdata.getDisplayName()); + } + } + } + } + } + + public void handleKeepAlive(S00PacketKeepAlive packetIn) { + this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c())); + } + + public void handlePlayerAbilities(S39PacketPlayerAbilities packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + EntityPlayer entityplayer = this.gameController.thePlayer; + entityplayer.capabilities.isFlying = packetIn.isFlying(); + entityplayer.capabilities.isCreativeMode = packetIn.isCreativeMode(); + entityplayer.capabilities.disableDamage = packetIn.isInvulnerable(); + entityplayer.capabilities.allowFlying = packetIn.isAllowFlying(); + entityplayer.capabilities.setFlySpeed(packetIn.getFlySpeed()); + entityplayer.capabilities.setPlayerWalkSpeed(packetIn.getWalkSpeed()); + } + + public void handleTabComplete(S3APacketTabComplete packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + String[] astring = packetIn.func_149630_c(); + + if (this.gameController.currentScreen instanceof GuiChat) { + GuiChat guichat = (GuiChat) this.gameController.currentScreen; + guichat.onAutocompleteResponse(astring); + } + } + + public void handleSoundEffect(S29PacketSoundEffect packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + this.gameController.theWorld.playSound(packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getSoundName(), packetIn.getVolume(), packetIn.getPitch(), false); + } + + public void handleResourcePack(S48PacketResourcePackSend packetIn) { + final String s = packetIn.getURL(); + final String s1 = packetIn.getHash(); + + if (s.startsWith("level://")) { + String s2 = s.substring("level://".length()); + File file1 = new File(this.gameController.mcDataDir, "saves"); + File file2 = new File(file1, s2); + + if (file2.isFile()) { + this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.ACCEPTED)); + Futures.addCallback(this.gameController.getResourcePackRepository().setResourcePackInstance(file2), new FutureCallback() { + public void onSuccess(Object p_onSuccess_1_) { + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED)); + } + + public void onFailure(Throwable p_onFailure_1_) { + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD)); + } + }); + } else { + this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD)); + } + } else { + if (this.gameController.getCurrentServerData() != null && this.gameController.getCurrentServerData().getResourceMode() == ServerData.ServerResourceMode.ENABLED) { + this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.ACCEPTED)); + Futures.addCallback(this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), new FutureCallback() { + public void onSuccess(Object p_onSuccess_1_) { + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED)); + } + + public void onFailure(Throwable p_onFailure_1_) { + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD)); + } + }); + } else if (this.gameController.getCurrentServerData() != null && this.gameController.getCurrentServerData().getResourceMode() != ServerData.ServerResourceMode.PROMPT) { + this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.DECLINED)); + } else { + this.gameController.addScheduledTask(new Runnable() { + public void run() { + NetHandlerPlayClient.this.gameController.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() { + public void confirmClicked(boolean result, int id) { + NetHandlerPlayClient.this.gameController = Minecraft.getMinecraft(); + + if (result) { + if (NetHandlerPlayClient.this.gameController.getCurrentServerData() != null) { + NetHandlerPlayClient.this.gameController.getCurrentServerData().setResourceMode(ServerData.ServerResourceMode.ENABLED); + } + + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.ACCEPTED)); + Futures.addCallback(NetHandlerPlayClient.this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), new FutureCallback() { + public void onSuccess(Object p_onSuccess_1_) { + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.SUCCESSFULLY_LOADED)); + } + + public void onFailure(Throwable p_onFailure_1_) { + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD)); + } + }); + } else { + if (NetHandlerPlayClient.this.gameController.getCurrentServerData() != null) { + NetHandlerPlayClient.this.gameController.getCurrentServerData().setResourceMode(ServerData.ServerResourceMode.DISABLED); + } + + NetHandlerPlayClient.this.netManager.sendPacket(new C19PacketResourcePackStatus(s1, C19PacketResourcePackStatus.Action.DECLINED)); + } + + ServerList.func_147414_b(NetHandlerPlayClient.this.gameController.getCurrentServerData()); + NetHandlerPlayClient.this.gameController.displayGuiScreen((GuiScreen) null); + } + }, I18n.format("multiplayer.texturePrompt.line1", new Object[0]), I18n.format("multiplayer.texturePrompt.line2", new Object[0]), 0)); + } + }); + } + } + } + + public void handleEntityNBT(S49PacketUpdateEntityNBT packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = packetIn.getEntity(this.clientWorldController); + + if (entity != null) { + entity.clientUpdateEntityNBT(packetIn.getTagCompound()); + } + } + + public void handleCustomPayload(S3FPacketCustomPayload packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + CheatBreaker.getInstance().getEventBus().handleEvent(new PluginMessageEvent(packetIn.getChannelName(), packetIn.getBufferData().array())); + + if ("MC|TrList".equals(packetIn.getChannelName())) { + PacketBuffer packetbuffer = packetIn.getBufferData(); + + try { + int i = packetbuffer.readInt(); + GuiScreen guiscreen = this.gameController.currentScreen; + + if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId) { + IMerchant imerchant = ((GuiMerchant) guiscreen).getMerchant(); + MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer); + imerchant.setRecipes(merchantrecipelist); + } + } catch (IOException ioexception) { + logger.error((String) "Couldn\'t load trade info", (Throwable) ioexception); + } finally { + packetbuffer.release(); + } + } else if ("MC|Brand".equals(packetIn.getChannelName())) { + this.gameController.thePlayer.setClientBrand(packetIn.getBufferData().readStringFromBuffer(32767)); + } else if ("MC|BOpen".equals(packetIn.getChannelName())) { + ItemStack itemstack = this.gameController.thePlayer.getCurrentEquippedItem(); + + if (itemstack != null && itemstack.getItem() == Items.written_book) { + this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false)); + } + } + } + + public void handleScoreboardObjective(S3BPacketScoreboardObjective packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + + if (packetIn.func_149338_e() == 0) { + ScoreObjective scoreobjective = scoreboard.addScoreObjective(packetIn.func_149339_c(), IScoreObjectiveCriteria.DUMMY); + scoreobjective.setDisplayName(packetIn.func_149337_d()); + scoreobjective.setRenderType(packetIn.func_179817_d()); + } else { + ScoreObjective scoreobjective1 = scoreboard.getObjective(packetIn.func_149339_c()); + + if (packetIn.func_149338_e() == 1) { + scoreboard.removeObjective(scoreobjective1); + } else if (packetIn.func_149338_e() == 2) { + scoreobjective1.setDisplayName(packetIn.func_149337_d()); + scoreobjective1.setRenderType(packetIn.func_179817_d()); + } + } + } + + public void handleUpdateScore(S3CPacketUpdateScore packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.getObjectiveName()); + + if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.CHANGE) { + Score score = scoreboard.getValueFromObjective(packetIn.getPlayerName(), scoreobjective); + score.setScorePoints(packetIn.getScoreValue()); + } else if (packetIn.getScoreAction() == S3CPacketUpdateScore.Action.REMOVE) { + if (StringUtils.isNullOrEmpty(packetIn.getObjectiveName())) { + scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), (ScoreObjective) null); + } else if (scoreobjective != null) { + scoreboard.removeObjectiveFromEntity(packetIn.getPlayerName(), scoreobjective); + } + } + } + + public void handleDisplayScoreboard(S3DPacketDisplayScoreboard packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + + if (packetIn.func_149370_d().length() == 0) { + scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), (ScoreObjective) null); + } else { + ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.func_149370_d()); + scoreboard.setObjectiveInDisplaySlot(packetIn.func_149371_c(), scoreobjective); + } + } + + public void handleTeams(S3EPacketTeams packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + ScorePlayerTeam scoreplayerteam; + + if (packetIn.getAction() == 0) { + scoreplayerteam = scoreboard.createTeam(packetIn.getName()); + } else { + scoreplayerteam = scoreboard.getTeam(packetIn.getName()); + } + + if ((packetIn.getAction() == 0 || packetIn.getAction() == 2) && scoreplayerteam != null) { + scoreplayerteam.setTeamName(packetIn.getDisplayName()); + scoreplayerteam.setNamePrefix(packetIn.getPrefix()); + scoreplayerteam.setNameSuffix(packetIn.getSuffix()); + scoreplayerteam.setChatFormat(EnumChatFormatting.func_175744_a(packetIn.getColor())); + scoreplayerteam.func_98298_a(packetIn.getFriendlyFlags()); + Team.EnumVisible team$enumvisible = Team.EnumVisible.func_178824_a(packetIn.getNameTagVisibility()); + + if (team$enumvisible != null) { + scoreplayerteam.setNameTagVisibility(team$enumvisible); + } + } + + if (packetIn.getAction() == 0 || packetIn.getAction() == 3) { + for (String s : packetIn.getPlayers()) { + scoreboard.addPlayerToTeam(s, packetIn.getName()); + } + } + + if (packetIn.getAction() == 4) { + for (String s1 : packetIn.getPlayers()) { + scoreboard.removePlayerFromTeam(s1, scoreplayerteam); + } + } + + if (packetIn.getAction() == 1) { + scoreboard.removeTeam(scoreplayerteam); + } + } + + public void handleParticles(S2APacketParticles packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + + if (packetIn.getParticleCount() == 0) { + double d0 = (double) (packetIn.getParticleSpeed() * packetIn.getXOffset()); + double d2 = (double) (packetIn.getParticleSpeed() * packetIn.getYOffset()); + double d4 = (double) (packetIn.getParticleSpeed() * packetIn.getZOffset()); + + try { + this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArgs()); + } catch (Throwable var17) { + logger.warn("Could not spawn particle effect " + packetIn.getParticleType()); + } + } else { + for (int i = 0; i < packetIn.getParticleCount(); ++i) { + double d1 = this.avRandomizer.nextGaussian() * (double) packetIn.getXOffset(); + double d3 = this.avRandomizer.nextGaussian() * (double) packetIn.getYOffset(); + double d5 = this.avRandomizer.nextGaussian() * (double) packetIn.getZOffset(); + double d6 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed(); + double d7 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed(); + double d8 = this.avRandomizer.nextGaussian() * (double) packetIn.getParticleSpeed(); + + try { + this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs()); + } catch (Throwable var16) { + logger.warn("Could not spawn particle effect " + packetIn.getParticleType()); + return; + } + } + } + } + + public void handleEntityProperties(S20PacketEntityProperties packetIn) { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId()); + + if (entity != null) { + if (!(entity instanceof EntityLivingBase)) { + throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")"); + } else { + BaseAttributeMap baseattributemap = ((EntityLivingBase) entity).getAttributeMap(); + + for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : packetIn.func_149441_d()) { + IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(s20packetentityproperties$snapshot.func_151409_a()); + + if (iattributeinstance == null) { + iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute((IAttribute) null, s20packetentityproperties$snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); + } + + iattributeinstance.setBaseValue(s20packetentityproperties$snapshot.func_151410_b()); + iattributeinstance.removeAllModifiers(); + + for (AttributeModifier attributemodifier : s20packetentityproperties$snapshot.func_151408_c()) { + iattributeinstance.applyModifier(attributemodifier); + } + } + } + } + } + + public NetworkManager getNetworkManager() { + return this.netManager; + } + + public Collection getPlayerInfoMap() { + return this.playerInfoMap.values(); + } + + public NetworkPlayerInfo getPlayerInfo(UUID p_175102_1_) { + return (NetworkPlayerInfo) this.playerInfoMap.get(p_175102_1_); + } + + public NetworkPlayerInfo getPlayerInfo(String p_175104_1_) { + for (NetworkPlayerInfo networkplayerinfo : this.playerInfoMap.values()) { + if (networkplayerinfo.getGameProfile().getName().equals(p_175104_1_)) { + return networkplayerinfo; + } + } + + return null; + } + + public GameProfile getGameProfile() { + return this.profile; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/network/NetworkPlayerInfo.java b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetworkPlayerInfo.java new file mode 100644 index 0000000..f7e61f5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/network/NetworkPlayerInfo.java @@ -0,0 +1,197 @@ +package net.minecraft.client.network; + +import com.google.common.base.Objects; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.client.resources.SkinManager; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.WorldSettings; + +public class NetworkPlayerInfo +{ + private final GameProfile gameProfile; + private WorldSettings.GameType gameType; + private int responseTime; + private boolean playerTexturesLoaded = false; + private ResourceLocation locationSkin; + private ResourceLocation locationCape; + private String skinType; + private IChatComponent displayName; + private int field_178873_i = 0; + private int field_178870_j = 0; + private long field_178871_k = 0L; + private long field_178868_l = 0L; + private long field_178869_m = 0L; + + public NetworkPlayerInfo(GameProfile p_i46294_1_) + { + this.gameProfile = p_i46294_1_; + } + + public NetworkPlayerInfo(S38PacketPlayerListItem.AddPlayerData p_i46295_1_) + { + this.gameProfile = p_i46295_1_.getProfile(); + this.gameType = p_i46295_1_.getGameMode(); + this.responseTime = p_i46295_1_.getPing(); + this.displayName = p_i46295_1_.getDisplayName(); + } + + public GameProfile getGameProfile() + { + return this.gameProfile; + } + + public WorldSettings.GameType getGameType() + { + return this.gameType; + } + + public int getResponseTime() + { + return this.responseTime; + } + + protected void setGameType(WorldSettings.GameType p_178839_1_) + { + this.gameType = p_178839_1_; + } + + protected void setResponseTime(int p_178838_1_) + { + this.responseTime = p_178838_1_; + } + + public boolean hasLocationSkin() + { + return this.locationSkin != null; + } + + public String getSkinType() + { + return this.skinType == null ? DefaultPlayerSkin.getSkinType(this.gameProfile.getId()) : this.skinType; + } + + public ResourceLocation getLocationSkin() + { + if (this.locationSkin == null) + { + this.loadPlayerTextures(); + } + + return (ResourceLocation)Objects.firstNonNull(this.locationSkin, DefaultPlayerSkin.getDefaultSkin(this.gameProfile.getId())); + } + + public ResourceLocation getLocationCape() + { + if (this.locationCape == null) + { + this.loadPlayerTextures(); + } + + return this.locationCape; + } + + public ScorePlayerTeam getPlayerTeam() + { + return Minecraft.getMinecraft().theWorld.getScoreboard().getPlayersTeam(this.getGameProfile().getName()); + } + + protected void loadPlayerTextures() + { + synchronized (this) + { + if (!this.playerTexturesLoaded) + { + this.playerTexturesLoaded = true; + Minecraft.getMinecraft().getSkinManager().loadProfileTextures(this.gameProfile, new SkinManager.SkinAvailableCallback() + { + public void skinAvailable(Type p_180521_1_, ResourceLocation location, MinecraftProfileTexture profileTexture) + { + switch (p_180521_1_) + { + case SKIN: + NetworkPlayerInfo.this.locationSkin = location; + NetworkPlayerInfo.this.skinType = profileTexture.getMetadata("model"); + + if (NetworkPlayerInfo.this.skinType == null) + { + NetworkPlayerInfo.this.skinType = "default"; + } + + break; + + case CAPE: + NetworkPlayerInfo.this.locationCape = location; + } + } + }, true); + } + } + } + + public void setDisplayName(IChatComponent displayNameIn) + { + this.displayName = displayNameIn; + } + + public IChatComponent getDisplayName() + { + return this.displayName; + } + + public int func_178835_l() + { + return this.field_178873_i; + } + + public void func_178836_b(int p_178836_1_) + { + this.field_178873_i = p_178836_1_; + } + + public int func_178860_m() + { + return this.field_178870_j; + } + + public void func_178857_c(int p_178857_1_) + { + this.field_178870_j = p_178857_1_; + } + + public long func_178847_n() + { + return this.field_178871_k; + } + + public void func_178846_a(long p_178846_1_) + { + this.field_178871_k = p_178846_1_; + } + + public long func_178858_o() + { + return this.field_178868_l; + } + + public void func_178844_b(long p_178844_1_) + { + this.field_178868_l = p_178844_1_; + } + + public long func_178855_p() + { + return this.field_178869_m; + } + + public void func_178843_c(long p_178843_1_) + { + this.field_178869_m = p_178843_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/network/OldServerPinger.java b/Client-1.8.9/src/main/java/net/minecraft/client/network/OldServerPinger.java new file mode 100644 index 0000000..0c247de --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/network/OldServerPinger.java @@ -0,0 +1,315 @@ +package net.minecraft.client.network; + +import com.google.common.base.Charsets; +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; +import io.netty.bootstrap.Bootstrap; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.Channel; +import io.netty.channel.ChannelException; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.socket.nio.NioSocketChannel; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerAddress; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class OldServerPinger +{ + private static final Splitter PING_RESPONSE_SPLITTER = Splitter.on('\u0000').limit(6); + private static final Logger logger = LogManager.getLogger(); + private final List pingDestinations = Collections.synchronizedList(Lists.newArrayList()); + + public void ping(final ServerData server) throws UnknownHostException + { + ServerAddress serveraddress = ServerAddress.fromString(server.serverIP); + final NetworkManager networkmanager = NetworkManager.createNetworkManagerAndConnect(InetAddress.getByName(serveraddress.getIP()), serveraddress.getPort(), false); + this.pingDestinations.add(networkmanager); + server.serverMOTD = "Pinging..."; + server.pingToServer = -1L; + server.playerList = null; + networkmanager.setNetHandler(new INetHandlerStatusClient() + { + private boolean field_147403_d = false; + private boolean field_183009_e = false; + private long field_175092_e = 0L; + public void handleServerInfo(S00PacketServerInfo packetIn) + { + if (this.field_183009_e) + { + networkmanager.closeChannel(new ChatComponentText("Received unrequested status")); + } + else + { + this.field_183009_e = true; + ServerStatusResponse serverstatusresponse = packetIn.getResponse(); + + if (serverstatusresponse.getServerDescription() != null) + { + server.serverMOTD = serverstatusresponse.getServerDescription().getFormattedText(); + } + else + { + server.serverMOTD = ""; + } + + if (serverstatusresponse.getProtocolVersionInfo() != null) + { + server.gameVersion = serverstatusresponse.getProtocolVersionInfo().getName(); + server.version = serverstatusresponse.getProtocolVersionInfo().getProtocol(); + } + else + { + server.gameVersion = "Old"; + server.version = 0; + } + + if (serverstatusresponse.getPlayerCountData() != null) + { + server.populationInfo = EnumChatFormatting.GRAY + "" + serverstatusresponse.getPlayerCountData().getOnlinePlayerCount() + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + serverstatusresponse.getPlayerCountData().getMaxPlayers(); + + if (ArrayUtils.isNotEmpty(serverstatusresponse.getPlayerCountData().getPlayers())) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (GameProfile gameprofile : serverstatusresponse.getPlayerCountData().getPlayers()) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append("\n"); + } + + stringbuilder.append(gameprofile.getName()); + } + + if (serverstatusresponse.getPlayerCountData().getPlayers().length < serverstatusresponse.getPlayerCountData().getOnlinePlayerCount()) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append("\n"); + } + + stringbuilder.append("... and ").append(serverstatusresponse.getPlayerCountData().getOnlinePlayerCount() - serverstatusresponse.getPlayerCountData().getPlayers().length).append(" more ..."); + } + + server.playerList = stringbuilder.toString(); + } + } + else + { + server.populationInfo = EnumChatFormatting.DARK_GRAY + "???"; + } + + if (serverstatusresponse.getFavicon() != null) + { + String s = serverstatusresponse.getFavicon(); + + if (s.startsWith("data:image/png;base64,")) + { + server.setBase64EncodedIconData(s.substring("data:image/png;base64,".length())); + } + else + { + OldServerPinger.logger.error("Invalid server icon (unknown format)"); + } + } + else + { + server.setBase64EncodedIconData((String)null); + } + + this.field_175092_e = Minecraft.getSystemTime(); + networkmanager.sendPacket(new C01PacketPing(this.field_175092_e)); + this.field_147403_d = true; + } + } + public void handlePong(S01PacketPong packetIn) + { + long i = this.field_175092_e; + long j = Minecraft.getSystemTime(); + server.pingToServer = j - i; + networkmanager.closeChannel(new ChatComponentText("Finished")); + } + public void onDisconnect(IChatComponent reason) + { + if (!this.field_147403_d) + { + OldServerPinger.logger.error("Can\'t ping " + server.serverIP + ": " + reason.getUnformattedText()); + server.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t connect to server."; + server.populationInfo = ""; + OldServerPinger.this.tryCompatibilityPing(server); + } + } + }); + + try + { + networkmanager.sendPacket(new C00Handshake(47, serveraddress.getIP(), serveraddress.getPort(), EnumConnectionState.STATUS)); + networkmanager.sendPacket(new C00PacketServerQuery()); + } + catch (Throwable throwable) + { + logger.error((Object)throwable); + } + } + + private void tryCompatibilityPing(final ServerData server) + { + final ServerAddress serveraddress = ServerAddress.fromString(server.serverIP); + ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)NetworkManager.CLIENT_NIO_EVENTLOOP.getValue())).handler(new ChannelInitializer() + { + protected void initChannel(Channel p_initChannel_1_) throws Exception + { + try + { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(true)); + } + catch (ChannelException var3) + { + ; + } + + p_initChannel_1_.pipeline().addLast(new ChannelHandler[] {new SimpleChannelInboundHandler() + { + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception + { + super.channelActive(p_channelActive_1_); + ByteBuf bytebuf = Unpooled.buffer(); + + try + { + bytebuf.writeByte(254); + bytebuf.writeByte(1); + bytebuf.writeByte(250); + char[] achar = "MC|PingHost".toCharArray(); + bytebuf.writeShort(achar.length); + + for (char c0 : achar) + { + bytebuf.writeChar(c0); + } + + bytebuf.writeShort(7 + 2 * serveraddress.getIP().length()); + bytebuf.writeByte(127); + achar = serveraddress.getIP().toCharArray(); + bytebuf.writeShort(achar.length); + + for (char c1 : achar) + { + bytebuf.writeChar(c1); + } + + bytebuf.writeInt(serveraddress.getPort()); + p_channelActive_1_.channel().writeAndFlush(bytebuf).addListener(ChannelFutureListener.CLOSE_ON_FAILURE); + } + finally + { + bytebuf.release(); + } + } + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, ByteBuf p_channelRead0_2_) throws Exception + { + short short1 = p_channelRead0_2_.readUnsignedByte(); + + if (short1 == 255) + { + String s = new String(p_channelRead0_2_.readBytes(p_channelRead0_2_.readShort() * 2).array(), Charsets.UTF_16BE); + String[] astring = (String[])Iterables.toArray(OldServerPinger.PING_RESPONSE_SPLITTER.split(s), String.class); + + if ("\u00a71".equals(astring[0])) + { + int i = MathHelper.parseIntWithDefault(astring[1], 0); + String s1 = astring[2]; + String s2 = astring[3]; + int j = MathHelper.parseIntWithDefault(astring[4], -1); + int k = MathHelper.parseIntWithDefault(astring[5], -1); + server.version = -1; + server.gameVersion = s1; + server.serverMOTD = s2; + server.populationInfo = EnumChatFormatting.GRAY + "" + j + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + k; + } + } + + p_channelRead0_1_.close(); + } + public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) throws Exception + { + p_exceptionCaught_1_.close(); + } + } + }); + } + })).channel(NioSocketChannel.class)).connect(serveraddress.getIP(), serveraddress.getPort()); + } + + public void pingPendingNetworks() + { + synchronized (this.pingDestinations) + { + Iterator iterator = this.pingDestinations.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + networkmanager.processReceivedPackets(); + } + else + { + iterator.remove(); + networkmanager.checkDisconnected(); + } + } + } + } + + public void clearPendingNetworks() + { + synchronized (this.pingDestinations) + { + Iterator iterator = this.pingDestinations.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + iterator.remove(); + networkmanager.closeChannel(new ChatComponentText("Cancelled")); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/Barrier.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/Barrier.java new file mode 100644 index 0000000..2290052 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/Barrier.java @@ -0,0 +1,53 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.world.World; + +public class Barrier extends EntityFX +{ + protected Barrier(World worldIn, double p_i46286_2_, double p_i46286_4_, double p_i46286_6_, Item p_i46286_8_) + { + super(worldIn, p_i46286_2_, p_i46286_4_, p_i46286_6_, 0.0D, 0.0D, 0.0D); + this.setParticleIcon(Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(p_i46286_8_)); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.motionX = this.motionY = this.motionZ = 0.0D; + this.particleGravity = 0.0F; + this.particleMaxAge = 80; + } + + public int getFXLayer() + { + return 1; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = this.particleIcon.getMinU(); + float f1 = this.particleIcon.getMaxU(); + float f2 = this.particleIcon.getMinV(); + float f3 = this.particleIcon.getMaxV(); + float f4 = 0.5F; + float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); + float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); + float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); + int i = this.getBrightnessForRender(partialTicks); + int j = i >> 16 & 65535; + int k = i & 65535; + worldRendererIn.pos((double)(f5 - rotationX * 0.5F - rotationXY * 0.5F), (double)(f6 - rotationZ * 0.5F), (double)(f7 - rotationYZ * 0.5F - rotationXZ * 0.5F)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 - rotationX * 0.5F + rotationXY * 0.5F), (double)(f6 + rotationZ * 0.5F), (double)(f7 - rotationYZ * 0.5F + rotationXZ * 0.5F)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * 0.5F + rotationXY * 0.5F), (double)(f6 + rotationZ * 0.5F), (double)(f7 + rotationYZ * 0.5F + rotationXZ * 0.5F)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * 0.5F - rotationXY * 0.5F), (double)(f6 - rotationZ * 0.5F), (double)(f7 + rotationYZ * 0.5F - rotationXZ * 0.5F)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new Barrier(worldIn, xCoordIn, yCoordIn, zCoordIn, Item.getItemFromBlock(Blocks.barrier)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EffectRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EffectRenderer.java new file mode 100644 index 0000000..609b805 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EffectRenderer.java @@ -0,0 +1,553 @@ +package net.minecraft.client.particle; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleParticles; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.optifine.reflect.Reflector; + +public class EffectRenderer +{ + private static final ResourceLocation particleTextures = new ResourceLocation("textures/particle/particles.png"); + + /** Reference to the World object. */ + protected World worldObj; + private List[][] fxLayers = new List[4][]; + private List particleEmitters = Lists.newArrayList(); + private TextureManager renderer; + + /** RNG. */ + private Random rand = new Random(); + private Map particleTypes = Maps.newHashMap(); + + public EffectRenderer(World worldIn, TextureManager rendererIn) + { + this.worldObj = worldIn; + this.renderer = rendererIn; + + for (int i = 0; i < 4; ++i) + { + this.fxLayers[i] = new List[2]; + + for (int j = 0; j < 2; ++j) + { + Minecraft.getMinecraft().cbLoadingScreen.addPhase(); + this.fxLayers[i][j] = Lists.newArrayList(); + } + } + + this.registerVanillaParticles(); + } + + private void registerVanillaParticles() + { + this.registerParticle(EnumParticleTypes.EXPLOSION_NORMAL.getParticleID(), new EntityExplodeFX.Factory()); + this.registerParticle(EnumParticleTypes.WATER_BUBBLE.getParticleID(), new EntityBubbleFX.Factory()); + this.registerParticle(EnumParticleTypes.WATER_SPLASH.getParticleID(), new EntitySplashFX.Factory()); + this.registerParticle(EnumParticleTypes.WATER_WAKE.getParticleID(), new EntityFishWakeFX.Factory()); + this.registerParticle(EnumParticleTypes.WATER_DROP.getParticleID(), new EntityRainFX.Factory()); + this.registerParticle(EnumParticleTypes.SUSPENDED.getParticleID(), new EntitySuspendFX.Factory()); + this.registerParticle(EnumParticleTypes.SUSPENDED_DEPTH.getParticleID(), new EntityAuraFX.Factory()); + this.registerParticle(EnumParticleTypes.CRIT.getParticleID(), new EntityCrit2FX.Factory()); + this.registerParticle(EnumParticleTypes.CRIT_MAGIC.getParticleID(), new EntityCrit2FX.MagicFactory()); + this.registerParticle(EnumParticleTypes.SMOKE_NORMAL.getParticleID(), new EntitySmokeFX.Factory()); + this.registerParticle(EnumParticleTypes.SMOKE_LARGE.getParticleID(), new EntityCritFX.Factory()); + this.registerParticle(EnumParticleTypes.SPELL.getParticleID(), new EntitySpellParticleFX.Factory()); + this.registerParticle(EnumParticleTypes.SPELL_INSTANT.getParticleID(), new EntitySpellParticleFX.InstantFactory()); + this.registerParticle(EnumParticleTypes.SPELL_MOB.getParticleID(), new EntitySpellParticleFX.MobFactory()); + this.registerParticle(EnumParticleTypes.SPELL_MOB_AMBIENT.getParticleID(), new EntitySpellParticleFX.AmbientMobFactory()); + this.registerParticle(EnumParticleTypes.SPELL_WITCH.getParticleID(), new EntitySpellParticleFX.WitchFactory()); + this.registerParticle(EnumParticleTypes.DRIP_WATER.getParticleID(), new EntityDropParticleFX.WaterFactory()); + this.registerParticle(EnumParticleTypes.DRIP_LAVA.getParticleID(), new EntityDropParticleFX.LavaFactory()); + this.registerParticle(EnumParticleTypes.VILLAGER_ANGRY.getParticleID(), new EntityHeartFX.AngryVillagerFactory()); + this.registerParticle(EnumParticleTypes.VILLAGER_HAPPY.getParticleID(), new EntityAuraFX.HappyVillagerFactory()); + this.registerParticle(EnumParticleTypes.TOWN_AURA.getParticleID(), new EntityAuraFX.Factory()); + this.registerParticle(EnumParticleTypes.NOTE.getParticleID(), new EntityNoteFX.Factory()); + this.registerParticle(EnumParticleTypes.PORTAL.getParticleID(), new EntityPortalFX.Factory()); + this.registerParticle(EnumParticleTypes.ENCHANTMENT_TABLE.getParticleID(), new EntityEnchantmentTableParticleFX.EnchantmentTable()); + this.registerParticle(EnumParticleTypes.FLAME.getParticleID(), new EntityFlameFX.Factory()); + this.registerParticle(EnumParticleTypes.LAVA.getParticleID(), new EntityLavaFX.Factory()); + this.registerParticle(EnumParticleTypes.FOOTSTEP.getParticleID(), new EntityFootStepFX.Factory()); + this.registerParticle(EnumParticleTypes.CLOUD.getParticleID(), new EntityCloudFX.Factory()); + this.registerParticle(EnumParticleTypes.REDSTONE.getParticleID(), new EntityReddustFX.Factory()); + this.registerParticle(EnumParticleTypes.SNOWBALL.getParticleID(), new EntityBreakingFX.SnowballFactory()); + this.registerParticle(EnumParticleTypes.SNOW_SHOVEL.getParticleID(), new EntitySnowShovelFX.Factory()); + this.registerParticle(EnumParticleTypes.SLIME.getParticleID(), new EntityBreakingFX.SlimeFactory()); + this.registerParticle(EnumParticleTypes.HEART.getParticleID(), new EntityHeartFX.Factory()); + this.registerParticle(EnumParticleTypes.BARRIER.getParticleID(), new Barrier.Factory()); + this.registerParticle(EnumParticleTypes.ITEM_CRACK.getParticleID(), new EntityBreakingFX.Factory()); + this.registerParticle(EnumParticleTypes.BLOCK_CRACK.getParticleID(), new EntityDiggingFX.Factory()); + this.registerParticle(EnumParticleTypes.BLOCK_DUST.getParticleID(), new EntityBlockDustFX.Factory()); + this.registerParticle(EnumParticleTypes.EXPLOSION_HUGE.getParticleID(), new EntityHugeExplodeFX.Factory()); + this.registerParticle(EnumParticleTypes.EXPLOSION_LARGE.getParticleID(), new EntityLargeExplodeFX.Factory()); + this.registerParticle(EnumParticleTypes.FIREWORKS_SPARK.getParticleID(), new EntityFirework.Factory()); + this.registerParticle(EnumParticleTypes.MOB_APPEARANCE.getParticleID(), new MobAppearance.Factory()); + } + + public void registerParticle(int id, IParticleFactory particleFactory) + { + this.particleTypes.put(Integer.valueOf(id), particleFactory); + } + + public void emitParticleAtEntity(Entity entityIn, EnumParticleTypes particleTypes) + { + this.particleEmitters.add(new EntityParticleEmitter(this.worldObj, entityIn, particleTypes)); + } + + public void emitParticleAtEntity(Entity entityIn, EnumParticleTypes particleTypes, float multiplier) + { + this.particleEmitters.add(new EntityParticleEmitter(this.worldObj, entityIn, particleTypes, multiplier)); + } + + /** + * Spawns the relevant particle according to the particle id. + * + * @param particleId The id of the particle + */ + public EntityFX spawnEffectParticle(int particleId, double p_178927_2_, double p_178927_4_, double p_178927_6_, double p_178927_8_, double p_178927_10_, double p_178927_12_, int... p_178927_14_) + { + IParticleFactory iparticlefactory = (IParticleFactory)this.particleTypes.get(Integer.valueOf(particleId)); + + if (iparticlefactory != null) + { + EntityFX entityfx = iparticlefactory.getEntityFX(particleId, this.worldObj, p_178927_2_, p_178927_4_, p_178927_6_, p_178927_8_, p_178927_10_, p_178927_12_, p_178927_14_); + + if (entityfx != null) + { + this.addEffect(entityfx); + return entityfx; + } + } + + return null; + } + + public void addEffect(EntityFX effect) + { + if (effect != null) + { + if (!(effect instanceof EntityFirework.SparkFX) || Config.isFireworkParticles()) + { + int i = effect.getFXLayer(); + int j = effect.getAlpha() != 1.0F ? 0 : 1; + + if (this.fxLayers[i][j].size() >= 4000) + { + this.fxLayers[i][j].remove(0); + } + + this.fxLayers[i][j].add(effect); + } + } + } + + public void updateEffects() + { + for (int i = 0; i < 4; ++i) + { + this.updateEffectLayer(i); + } + + List list = Lists.newArrayList(); + + for (EntityParticleEmitter entityparticleemitter : this.particleEmitters) + { + entityparticleemitter.onUpdate(); + + if (entityparticleemitter.isDead) + { + list.add(entityparticleemitter); + } + } + + this.particleEmitters.removeAll(list); + } + + private void updateEffectLayer(int p_178922_1_) + { + for (int i = 0; i < 2; ++i) + { + this.updateEffectAlphaLayer(this.fxLayers[p_178922_1_][i]); + } + } + + private void updateEffectAlphaLayer(List entitiesFX) + { + List list = Lists.newArrayList(); + long i = System.currentTimeMillis(); + int j = entitiesFX.size(); + + for (int k = 0; k < entitiesFX.size(); ++k) + { + EntityFX entityfx = entitiesFX.get(k); + this.tickParticle(entityfx); + + if (entityfx.isDead) + { + list.add(entityfx); + } + + --j; + + if (System.currentTimeMillis() > i + 20L) + { + break; + } + } + + if (j > 0) + { + int l = j; + + for (Iterator iterator = entitiesFX.iterator(); iterator.hasNext() && l > 0; --l) + { + EntityFX entityfx1 = (EntityFX)iterator.next(); + entityfx1.setDead(); + iterator.remove(); + } + } + + entitiesFX.removeAll(list); + } + + private void tickParticle(final EntityFX p_178923_1_) + { + try + { + p_178923_1_.onUpdate(); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking Particle"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being ticked"); + final int i = p_178923_1_.getFXLayer(); + crashreportcategory.addCrashSectionCallable("Particle", new Callable() + { + public String call() throws Exception + { + return p_178923_1_.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Particle Type", new Callable() + { + public String call() throws Exception + { + return i == 0 ? "MISC_TEXTURE" : (i == 1 ? "TERRAIN_TEXTURE" : (i == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + i)); + } + }); + throw new ReportedException(crashreport); + } + } + + /** + * Renders all current particles. Args player, partialTickTime + */ + public void renderParticles(Entity entityIn, float partialTicks) + { + float f = ActiveRenderInfo.getRotationX(); + float f1 = ActiveRenderInfo.getRotationZ(); + float f2 = ActiveRenderInfo.getRotationYZ(); + float f3 = ActiveRenderInfo.getRotationXY(); + float f4 = ActiveRenderInfo.getRotationXZ(); + EntityFX.interpPosX = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks; + EntityFX.interpPosY = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks; + EntityFX.interpPosZ = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks; + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.alphaFunc(516, 0.003921569F); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 2; ++j) + { + final int i_f = i; + + if (!this.fxLayers[i][j].isEmpty()) + { + switch (j) + { + case 0: + GlStateManager.depthMask(false); + break; + + case 1: + GlStateManager.depthMask(true); + } + + switch (i) + { + case 0: + default: + this.renderer.bindTexture(particleTextures); + break; + + case 1: + this.renderer.bindTexture(TextureMap.locationBlocksTexture); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + + for (int k = 0; k < this.fxLayers[i][j].size(); ++k) + { + final EntityFX entityfx = (EntityFX)this.fxLayers[i][j].get(k); + + try + { + entityfx.renderParticle(worldrenderer, entityIn, partialTicks, f, f4, f1, f2, f3); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Particle"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being rendered"); + crashreportcategory.addCrashSectionCallable("Particle", new Callable() + { + public String call() throws Exception + { + return entityfx.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Particle Type", new Callable() + { + public String call() throws Exception + { + return i_f == 0 ? "MISC_TEXTURE" : (i_f == 1 ? "TERRAIN_TEXTURE" : (i_f == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + i_f)); + } + }); + throw new ReportedException(crashreport); + } + } + + tessellator.draw(); + } + } + } + + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + GlStateManager.alphaFunc(516, 0.1F); + } + + public void renderLitParticles(Entity entityIn, float p_78872_2_) + { + float f = 0.017453292F; + float f1 = MathHelper.cos(entityIn.rotationYaw * 0.017453292F); + float f2 = MathHelper.sin(entityIn.rotationYaw * 0.017453292F); + float f3 = -f2 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F); + float f4 = f1 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F); + float f5 = MathHelper.cos(entityIn.rotationPitch * 0.017453292F); + + for (int i = 0; i < 2; ++i) + { + List list = this.fxLayers[3][i]; + + if (!list.isEmpty()) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + for (int j = 0; j < list.size(); ++j) + { + EntityFX entityfx = (EntityFX)list.get(j); + entityfx.renderParticle(worldrenderer, entityIn, p_78872_2_, f1, f5, f2, f3, f4); + } + } + } + } + + public void clearEffects(World worldIn) + { + this.worldObj = worldIn; + + for (int i = 0; i < 4; ++i) + { + for (int j = 0; j < 2; ++j) + { + this.fxLayers[i][j].clear(); + } + } + + this.particleEmitters.clear(); + } + + public void addBlockDestroyEffects(BlockPos pos, IBlockState state) + { + ModuleParticles mod = CheatBreaker.getInstance().getModuleManager().particlesMod; + if (mod.isEnabled() && !mod.blockBreakingParticles.getBooleanValue()) { + return; + } + + boolean flag; + + if (Reflector.ForgeBlock_addDestroyEffects.exists() && Reflector.ForgeBlock_isAir.exists()) + { + Block block = state.getBlock(); + flag = !Reflector.callBoolean(block, Reflector.ForgeBlock_isAir, new Object[] {this.worldObj, pos}) && !Reflector.callBoolean(block, Reflector.ForgeBlock_addDestroyEffects, new Object[] {this.worldObj, pos, this}); + } + else + { + flag = state.getBlock().getMaterial() != Material.air; + } + + if (flag) + { + state = state.getBlock().getActualState(state, this.worldObj, pos); + int l = 4; + + for (int i = 0; i < l; ++i) + { + for (int j = 0; j < l; ++j) + { + for (int k = 0; k < l; ++k) + { + double d0 = (double)pos.getX() + ((double)i + 0.5D) / (double)l; + double d1 = (double)pos.getY() + ((double)j + 0.5D) / (double)l; + double d2 = (double)pos.getZ() + ((double)k + 0.5D) / (double)l; + this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, d0 - (double)pos.getX() - 0.5D, d1 - (double)pos.getY() - 0.5D, d2 - (double)pos.getZ() - 0.5D, state)).setBlockPos(pos)); + } + } + } + } + } + + /** + * Adds block hit particles for the specified block + * + * @param pos The block's coordinates + * @param side The side the block was hit from + */ + public void addBlockHitEffects(BlockPos pos, EnumFacing side) + { + ModuleParticles mod = CheatBreaker.getInstance().getModuleManager().particlesMod; + if (mod.isEnabled() && !mod.blockBreakingParticles.getBooleanValue()) { + return; + } + IBlockState iblockstate = this.worldObj.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (block.getRenderType() != -1) + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + float f = 0.1F; + double d0 = (double)i + this.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinX(); + double d1 = (double)j + this.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinY(); + double d2 = (double)k + this.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinZ(); + + if (side == EnumFacing.DOWN) + { + d1 = (double)j + block.getBlockBoundsMinY() - (double)f; + } + + if (side == EnumFacing.UP) + { + d1 = (double)j + block.getBlockBoundsMaxY() + (double)f; + } + + if (side == EnumFacing.NORTH) + { + d2 = (double)k + block.getBlockBoundsMinZ() - (double)f; + } + + if (side == EnumFacing.SOUTH) + { + d2 = (double)k + block.getBlockBoundsMaxZ() + (double)f; + } + + if (side == EnumFacing.WEST) + { + d0 = (double)i + block.getBlockBoundsMinX() - (double)f; + } + + if (side == EnumFacing.EAST) + { + d0 = (double)i + block.getBlockBoundsMaxX() + (double)f; + } + + this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).setBlockPos(pos).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); + } + } + + public void moveToAlphaLayer(EntityFX effect) + { + this.moveToLayer(effect, 1, 0); + } + + public void moveToNoAlphaLayer(EntityFX effect) + { + this.moveToLayer(effect, 0, 1); + } + + private void moveToLayer(EntityFX effect, int p_178924_2_, int p_178924_3_) + { + for (int i = 0; i < 4; ++i) + { + if (this.fxLayers[i][p_178924_2_].contains(effect)) + { + this.fxLayers[i][p_178924_2_].remove(effect); + this.fxLayers[i][p_178924_3_].add(effect); + } + } + } + + public String getStatistics() + { + int i = 0; + + for (int j = 0; j < 4; ++j) + { + for (int k = 0; k < 2; ++k) + { + i += this.fxLayers[j][k].size(); + } + } + + return "" + i; + } + + public void addBlockHitEffects(BlockPos p_addBlockHitEffects_1_, MovingObjectPosition p_addBlockHitEffects_2_) + { + IBlockState iblockstate = this.worldObj.getBlockState(p_addBlockHitEffects_1_); + + if (iblockstate != null) + { + boolean flag = Reflector.callBoolean(iblockstate.getBlock(), Reflector.ForgeBlock_addHitEffects, new Object[] {this.worldObj, p_addBlockHitEffects_2_, this}); + + if (iblockstate != null && !flag) + { + this.addBlockHitEffects(p_addBlockHitEffects_1_, p_addBlockHitEffects_2_.sideHit); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EffectRendere~ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EffectRendere~ new file mode 100644 index 0000000..e506f90 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EffectRendere~ @@ -0,0 +1,420 @@ +package net.minecraft.client.particle; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntityParticleEmitter; +import net.minecraft.client.particle.EntitySuspendFX; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.EntityAuraFX.HappyVillagerFactory; +import net.minecraft.client.particle.EntityBreakingFX.SlimeFactory; +import net.minecraft.client.particle.EntityBreakingFX.SnowballFactory; +import net.minecraft.client.particle.EntityCrit2FX.MagicFactory; +import net.minecraft.client.particle.EntityDropParticleFX.LavaFactory; +import net.minecraft.client.particle.EntityDropParticleFX.WaterFactory; +import net.minecraft.client.particle.EntityEnchantmentTableParticleFX.EnchantmentTable; +import net.minecraft.client.particle.EntityExplodeFX.Factory; +import net.minecraft.client.particle.EntityFirework.SparkFX; +import net.minecraft.client.particle.EntityHeartFX.AngryVillagerFactory; +import net.minecraft.client.particle.EntitySpellParticleFX.AmbientMobFactory; +import net.minecraft.client.particle.EntitySpellParticleFX.InstantFactory; +import net.minecraft.client.particle.EntitySpellParticleFX.MobFactory; +import net.minecraft.client.particle.EntitySpellParticleFX.WitchFactory; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.optifine.reflect.Reflector; + +public class EffectRenderer { + private static final ResourceLocation field_110737_b = new ResourceLocation("textures/particle/particles.png"); + protected World field_78878_a; + private List[][] field_78876_b = new List[4][]; + private List field_178933_d = Lists.newArrayList(); + private TextureManager field_78877_c; + private Random field_78875_d = new Random(); + private Map field_178932_g = Maps.newHashMap(); + + public EffectRenderer(World p_i1220_1_, TextureManager p_i1220_2_) { + this.field_78878_a = p_i1220_1_; + this.field_78877_c = p_i1220_2_; + + for(int i = 0; i < 4; ++i) { + this.field_78876_b[i] = new List[2]; + + for(int j = 0; j < 2; ++j) { + this.field_78876_b[i][j] = Lists.newArrayList(); + } + } + + this.func_178930_c(); + } + + private void func_178930_c() { + this.func_178929_a(EnumParticleTypes.EXPLOSION_NORMAL.func_179348_c(), new Factory()); + this.func_178929_a(EnumParticleTypes.WATER_BUBBLE.func_179348_c(), new net.minecraft.client.particle.EntityBubbleFX.Factory()); + this.func_178929_a(EnumParticleTypes.WATER_SPLASH.func_179348_c(), new net.minecraft.client.particle.EntitySplashFX.Factory()); + this.func_178929_a(EnumParticleTypes.WATER_WAKE.func_179348_c(), new net.minecraft.client.particle.EntityFishWakeFX.Factory()); + this.func_178929_a(EnumParticleTypes.WATER_DROP.func_179348_c(), new net.minecraft.client.particle.EntityRainFX.Factory()); + this.func_178929_a(EnumParticleTypes.SUSPENDED.func_179348_c(), new net.minecraft.client.particle.EntitySuspendFX.Factory()); + this.func_178929_a(EnumParticleTypes.SUSPENDED_DEPTH.func_179348_c(), new net.minecraft.client.particle.EntityAuraFX.Factory()); + this.func_178929_a(EnumParticleTypes.CRIT.func_179348_c(), new net.minecraft.client.particle.EntityCrit2FX.Factory()); + this.func_178929_a(EnumParticleTypes.CRIT_MAGIC.func_179348_c(), new MagicFactory()); + this.func_178929_a(EnumParticleTypes.SMOKE_NORMAL.func_179348_c(), new net.minecraft.client.particle.EntitySmokeFX.Factory()); + this.func_178929_a(EnumParticleTypes.SMOKE_LARGE.func_179348_c(), new net.minecraft.client.particle.EntityCritFX.Factory()); + this.func_178929_a(EnumParticleTypes.SPELL.func_179348_c(), new net.minecraft.client.particle.EntitySpellParticleFX.Factory()); + this.func_178929_a(EnumParticleTypes.SPELL_INSTANT.func_179348_c(), new InstantFactory()); + this.func_178929_a(EnumParticleTypes.SPELL_MOB.func_179348_c(), new MobFactory()); + this.func_178929_a(EnumParticleTypes.SPELL_MOB_AMBIENT.func_179348_c(), new AmbientMobFactory()); + this.func_178929_a(EnumParticleTypes.SPELL_WITCH.func_179348_c(), new WitchFactory()); + this.func_178929_a(EnumParticleTypes.DRIP_WATER.func_179348_c(), new WaterFactory()); + this.func_178929_a(EnumParticleTypes.DRIP_LAVA.func_179348_c(), new LavaFactory()); + this.func_178929_a(EnumParticleTypes.VILLAGER_ANGRY.func_179348_c(), new AngryVillagerFactory()); + this.func_178929_a(EnumParticleTypes.VILLAGER_HAPPY.func_179348_c(), new HappyVillagerFactory()); + this.func_178929_a(EnumParticleTypes.TOWN_AURA.func_179348_c(), new net.minecraft.client.particle.EntityAuraFX.Factory()); + this.func_178929_a(EnumParticleTypes.NOTE.func_179348_c(), new net.minecraft.client.particle.EntityNoteFX.Factory()); + this.func_178929_a(EnumParticleTypes.PORTAL.func_179348_c(), new net.minecraft.client.particle.EntityPortalFX.Factory()); + this.func_178929_a(EnumParticleTypes.ENCHANTMENT_TABLE.func_179348_c(), new EnchantmentTable()); + this.func_178929_a(EnumParticleTypes.FLAME.func_179348_c(), new net.minecraft.client.particle.EntityFlameFX.Factory()); + this.func_178929_a(EnumParticleTypes.LAVA.func_179348_c(), new net.minecraft.client.particle.EntityLavaFX.Factory()); + this.func_178929_a(EnumParticleTypes.FOOTSTEP.func_179348_c(), new net.minecraft.client.particle.EntityFootStepFX.Factory()); + this.func_178929_a(EnumParticleTypes.CLOUD.func_179348_c(), new net.minecraft.client.particle.EntityCloudFX.Factory()); + this.func_178929_a(EnumParticleTypes.REDSTONE.func_179348_c(), new net.minecraft.client.particle.EntityReddustFX.Factory()); + this.func_178929_a(EnumParticleTypes.SNOWBALL.func_179348_c(), new SnowballFactory()); + this.func_178929_a(EnumParticleTypes.SNOW_SHOVEL.func_179348_c(), new net.minecraft.client.particle.EntitySnowShovelFX.Factory()); + this.func_178929_a(EnumParticleTypes.SLIME.func_179348_c(), new SlimeFactory()); + this.func_178929_a(EnumParticleTypes.HEART.func_179348_c(), new net.minecraft.client.particle.EntityHeartFX.Factory()); + this.func_178929_a(EnumParticleTypes.BARRIER.func_179348_c(), new net.minecraft.client.particle.Barrier.Factory()); + this.func_178929_a(EnumParticleTypes.ITEM_CRACK.func_179348_c(), new net.minecraft.client.particle.EntityBreakingFX.Factory()); + this.func_178929_a(EnumParticleTypes.BLOCK_CRACK.func_179348_c(), new net.minecraft.client.particle.EntityDiggingFX.Factory()); + this.func_178929_a(EnumParticleTypes.BLOCK_DUST.func_179348_c(), new net.minecraft.client.particle.EntityBlockDustFX.Factory()); + this.func_178929_a(EnumParticleTypes.EXPLOSION_HUGE.func_179348_c(), new net.minecraft.client.particle.EntityHugeExplodeFX.Factory()); + this.func_178929_a(EnumParticleTypes.EXPLOSION_LARGE.func_179348_c(), new net.minecraft.client.particle.EntityLargeExplodeFX.Factory()); + this.func_178929_a(EnumParticleTypes.FIREWORKS_SPARK.func_179348_c(), new net.minecraft.client.particle.EntityFirework.Factory()); + this.func_178929_a(EnumParticleTypes.MOB_APPEARANCE.func_179348_c(), new net.minecraft.client.particle.MobAppearance.Factory()); + } + + public void func_178929_a(int p_178929_1_, IParticleFactory p_178929_2_) { + this.field_178932_g.put(Integer.valueOf(p_178929_1_), p_178929_2_); + } + + public void func_178926_a(Entity p_178926_1_, EnumParticleTypes p_178926_2_) { + this.field_178933_d.add(new EntityParticleEmitter(this.field_78878_a, p_178926_1_, p_178926_2_)); + } + + public EntityFX func_178927_a(int p_178927_1_, double p_178927_2_, double p_178927_4_, double p_178927_6_, double p_178927_8_, double p_178927_10_, double p_178927_12_, int... p_178927_14_) { + IParticleFactory iparticlefactory = (IParticleFactory)this.field_178932_g.get(Integer.valueOf(p_178927_1_)); + if(iparticlefactory != null) { + EntityFX entityfx = iparticlefactory.func_178902_a(p_178927_1_, this.field_78878_a, p_178927_2_, p_178927_4_, p_178927_6_, p_178927_8_, p_178927_10_, p_178927_12_, p_178927_14_); + if(entityfx != null) { + this.func_78873_a(entityfx); + return entityfx; + } + } + + return null; + } + + public void func_78873_a(EntityFX p_78873_1_) { + if(p_78873_1_ != null) { + if(!(p_78873_1_ instanceof SparkFX) || Config.isFireworkParticles()) { + int i = p_78873_1_.func_70537_b(); + int j = p_78873_1_.func_174838_j() != 1.0F?0:1; + if(this.field_78876_b[i][j].size() >= 4000) { + this.field_78876_b[i][j].remove(0); + } + + this.field_78876_b[i][j].add(p_78873_1_); + } + } + } + + public void func_78868_a() { + for(int i = 0; i < 4; ++i) { + this.func_178922_a(i); + } + + List list = Lists.newArrayList(); + + for(EntityParticleEmitter entityparticleemitter : this.field_178933_d) { + entityparticleemitter.func_70071_h_(); + if(entityparticleemitter.I) { + list.add(entityparticleemitter); + } + } + + this.field_178933_d.removeAll(list); + } + + private void func_178922_a(int p_178922_1_) { + for(int i = 0; i < 2; ++i) { + this.func_178925_a(this.field_78876_b[p_178922_1_][i]); + } + + } + + private void func_178925_a(List param1) { + // $FF: Couldn't be decompiled + } + + private void func_178923_d(final EntityFX p_178923_1_) { + try { + p_178923_1_.func_70071_h_(); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.func_85055_a(throwable, "Ticking Particle"); + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being ticked"); + final int i = p_178923_1_.func_70537_b(); + crashreportcategory.func_71500_a("Particle", new Callable() { + public String call() throws Exception { + return p_178923_1_.toString(); + } + }); + crashreportcategory.func_71500_a("Particle Type", new Callable() { + public String call() throws Exception { + return i == 0?"MISC_TEXTURE":(i == 1?"TERRAIN_TEXTURE":(i == 3?"ENTITY_PARTICLE_TEXTURE":"Unknown - " + i)); + } + }); + throw new ReportedException(crashreport); + } + } + + public void func_78874_a(Entity p_78874_1_, float p_78874_2_) { + float f = ActiveRenderInfo.func_178808_b(); + float f1 = ActiveRenderInfo.func_178803_d(); + float f2 = ActiveRenderInfo.func_178805_e(); + float f3 = ActiveRenderInfo.func_178807_f(); + float f4 = ActiveRenderInfo.func_178809_c(); + EntityFX.field_70556_an = p_78874_1_.field_70142_S + (p_78874_1_.field_70165_t - p_78874_1_.field_70142_S) * (double)p_78874_2_; + EntityFX.field_70554_ao = p_78874_1_.field_70137_T + (p_78874_1_.field_70163_u - p_78874_1_.field_70137_T) * (double)p_78874_2_; + EntityFX.field_70555_ap = p_78874_1_.field_70136_U + (p_78874_1_.field_70161_v - p_78874_1_.field_70136_U) * (double)p_78874_2_; + GlStateManager.func_179147_l(); + GlStateManager.func_179112_b(770, 771); + GlStateManager.func_179092_a(516, 0.003921569F); + Block block = ActiveRenderInfo.func_180786_a(this.field_78878_a, p_78874_1_, p_78874_2_); + boolean flag = block.func_149688_o() == Material.field_151586_h; + + for(final int i = 0; i < 3; ++i) { + for(int j = 0; j < 2; ++j) { + if(!this.field_78876_b[i][j].isEmpty()) { + switch(j) { + case 0: + GlStateManager.func_179132_a(false); + break; + case 1: + GlStateManager.func_179132_a(true); + } + + switch(i) { + case 0: + default: + this.field_78877_c.func_110577_a(field_110737_b); + break; + case 1: + this.field_78877_c.func_110577_a(TextureMap.field_110575_b); + } + + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181704_d); + + for(int k = 0; k < this.field_78876_b[i][j].size(); ++k) { + final EntityFX entityfx = (EntityFX)this.field_78876_b[i][j].get(k); + + try { + if(flag || !(entityfx instanceof EntitySuspendFX)) { + entityfx.func_180434_a(worldrenderer, p_78874_1_, p_78874_2_, f, f4, f1, f2, f3); + } + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Particle"); + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being rendered"); + crashreportcategory.func_71500_a("Particle", new Callable() { + public String call() throws Exception { + return entityfx.toString(); + } + }); + crashreportcategory.func_71500_a("Particle Type", new Callable() { + public String call() throws Exception { + return i == 0?"MISC_TEXTURE":(i == 1?"TERRAIN_TEXTURE":(i == 3?"ENTITY_PARTICLE_TEXTURE":"Unknown - " + i)); + } + }); + throw new ReportedException(crashreport); + } + } + + tessellator.func_78381_a(); + } + } + } + + GlStateManager.func_179132_a(true); + GlStateManager.func_179084_k(); + GlStateManager.func_179092_a(516, 0.1F); + } + + public void func_78872_b(Entity p_78872_1_, float p_78872_2_) { + float f = 0.017453292F; + float f1 = MathHelper.func_76134_b(p_78872_1_.field_70177_z * 0.017453292F); + float f2 = MathHelper.func_76126_a(p_78872_1_.field_70177_z * 0.017453292F); + float f3 = -f2 * MathHelper.func_76126_a(p_78872_1_.field_70125_A * 0.017453292F); + float f4 = f1 * MathHelper.func_76126_a(p_78872_1_.field_70125_A * 0.017453292F); + float f5 = MathHelper.func_76134_b(p_78872_1_.field_70125_A * 0.017453292F); + + for(int i = 0; i < 2; ++i) { + List list = this.field_78876_b[3][i]; + if(!list.isEmpty()) { + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + + for(int j = 0; j < list.size(); ++j) { + EntityFX entityfx = (EntityFX)list.get(j); + entityfx.func_180434_a(worldrenderer, p_78872_1_, p_78872_2_, f1, f5, f2, f3, f4); + } + } + } + + } + + public void func_78870_a(World p_78870_1_) { + this.field_78878_a = p_78870_1_; + + for(int i = 0; i < 4; ++i) { + for(int j = 0; j < 2; ++j) { + this.field_78876_b[i][j].clear(); + } + } + + this.field_178933_d.clear(); + } + + public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_) { + boolean flag; + if(Reflector.ForgeBlock_addDestroyEffects.exists() && Reflector.ForgeBlock_isAir.exists()) { + Block block = p_180533_2_.func_177230_c(); + flag = !Reflector.callBoolean(block, Reflector.ForgeBlock_isAir, new Object[]{this.field_78878_a, p_180533_1_}) && !Reflector.callBoolean(block, Reflector.ForgeBlock_addDestroyEffects, new Object[]{this.field_78878_a, p_180533_1_, this}); + } else { + flag = p_180533_2_.func_177230_c().func_149688_o() != Material.field_151579_a; + } + + if(flag) { + p_180533_2_ = p_180533_2_.func_177230_c().func_176221_a(p_180533_2_, this.field_78878_a, p_180533_1_); + int l = 4; + + for(int i = 0; i < l; ++i) { + for(int j = 0; j < l; ++j) { + for(int k = 0; k < l; ++k) { + double d0 = (double)p_180533_1_.n() + ((double)i + 0.5D) / (double)l; + double d1 = (double)p_180533_1_.o() + ((double)j + 0.5D) / (double)l; + double d2 = (double)p_180533_1_.p() + ((double)k + 0.5D) / (double)l; + this.func_78873_a((new EntityDiggingFX(this.field_78878_a, d0, d1, d2, d0 - (double)p_180533_1_.n() - 0.5D, d1 - (double)p_180533_1_.o() - 0.5D, d2 - (double)p_180533_1_.p() - 0.5D, p_180533_2_)).func_174846_a(p_180533_1_)); + } + } + } + } + + } + + public void func_180532_a(BlockPos p_180532_1_, EnumFacing p_180532_2_) { + IBlockState iblockstate = this.field_78878_a.func_180495_p(p_180532_1_); + Block block = iblockstate.func_177230_c(); + if(block.func_149645_b() != -1) { + int i = p_180532_1_.n(); + int j = p_180532_1_.o(); + int k = p_180532_1_.p(); + float f = 0.1F; + double d0 = (double)i + this.field_78875_d.nextDouble() * (block.func_149753_y() - block.func_149704_x() - (double)(f * 2.0F)) + (double)f + block.func_149704_x(); + double d1 = (double)j + this.field_78875_d.nextDouble() * (block.func_149669_A() - block.func_149665_z() - (double)(f * 2.0F)) + (double)f + block.func_149665_z(); + double d2 = (double)k + this.field_78875_d.nextDouble() * (block.func_149693_C() - block.func_149706_B() - (double)(f * 2.0F)) + (double)f + block.func_149706_B(); + if(p_180532_2_ == EnumFacing.DOWN) { + d1 = (double)j + block.func_149665_z() - (double)f; + } + + if(p_180532_2_ == EnumFacing.UP) { + d1 = (double)j + block.func_149669_A() + (double)f; + } + + if(p_180532_2_ == EnumFacing.NORTH) { + d2 = (double)k + block.func_149706_B() - (double)f; + } + + if(p_180532_2_ == EnumFacing.SOUTH) { + d2 = (double)k + block.func_149693_C() + (double)f; + } + + if(p_180532_2_ == EnumFacing.WEST) { + d0 = (double)i + block.func_149704_x() - (double)f; + } + + if(p_180532_2_ == EnumFacing.EAST) { + d0 = (double)i + block.func_149753_y() + (double)f; + } + + this.func_78873_a((new EntityDiggingFX(this.field_78878_a, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).func_174846_a(p_180532_1_).a(0.2F).func_70541_f(0.6F)); + } + + } + + public void func_178928_b(EntityFX p_178928_1_) { + this.func_178924_a(p_178928_1_, 1, 0); + } + + public void func_178931_c(EntityFX p_178931_1_) { + this.func_178924_a(p_178931_1_, 0, 1); + } + + private void func_178924_a(EntityFX p_178924_1_, int p_178924_2_, int p_178924_3_) { + for(int i = 0; i < 4; ++i) { + if(this.field_78876_b[i][p_178924_2_].contains(p_178924_1_)) { + this.field_78876_b[i][p_178924_2_].remove(p_178924_1_); + this.field_78876_b[i][p_178924_3_].add(p_178924_1_); + } + } + + } + + public String func_78869_b() { + int i = 0; + + for(int j = 0; j < 4; ++j) { + for(int k = 0; k < 2; ++k) { + i += this.field_78876_b[j][k].size(); + } + } + + return "" + i; + } + + public void addBlockHitEffects(BlockPos p_addBlockHitEffects_1_, MovingObjectPosition p_addBlockHitEffects_2_) { + IBlockState iblockstate = this.field_78878_a.func_180495_p(p_addBlockHitEffects_1_); + if(iblockstate != null) { + boolean flag = Reflector.callBoolean(iblockstate.func_177230_c(), Reflector.ForgeBlock_addHitEffects, new Object[]{this.field_78878_a, p_addBlockHitEffects_2_, this}); + if(iblockstate != null && !flag) { + this.func_180532_a(p_addBlockHitEffects_1_, p_addBlockHitEffects_2_.field_178784_b); + } + + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityAuraFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityAuraFX.java new file mode 100644 index 0000000..39094ad --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityAuraFX.java @@ -0,0 +1,58 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityAuraFX extends EntityFX +{ + protected EntityAuraFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double speedIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, speedIn); + float f = this.rand.nextFloat() * 0.1F + 0.2F; + this.particleRed = f; + this.particleGreen = f; + this.particleBlue = f; + this.setParticleTextureIndex(0); + this.setSize(0.02F, 0.02F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.5F; + this.motionX *= 0.019999999552965164D; + this.motionY *= 0.019999999552965164D; + this.motionZ *= 0.019999999552965164D; + this.particleMaxAge = (int)(20.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = true; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.99D; + this.motionY *= 0.99D; + this.motionZ *= 0.99D; + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityAuraFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } + + public static class HappyVillagerFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX entityfx = new EntityAuraFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + entityfx.setParticleTextureIndex(82); + entityfx.setRBGColorF(1.0F, 1.0F, 1.0F); + return entityfx; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java new file mode 100644 index 0000000..f1810b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java @@ -0,0 +1,25 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.world.World; + +public class EntityBlockDustFX extends EntityDiggingFX +{ + protected EntityBlockDustFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, IBlockState state) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, state); + this.motionX = xSpeedIn; + this.motionY = ySpeedIn; + this.motionZ = zSpeedIn; + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + IBlockState iblockstate = Block.getStateById(p_178902_15_[0]); + return iblockstate.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).func_174845_l(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java new file mode 100644 index 0000000..adff992 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java @@ -0,0 +1,95 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.world.World; + +public class EntityBreakingFX extends EntityFX +{ + protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, Item p_i1195_8_) + { + this(worldIn, posXIn, posYIn, posZIn, p_i1195_8_, 0); + } + + protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, Item p_i1197_14_, int p_i1197_15_) + { + this(worldIn, posXIn, posYIn, posZIn, p_i1197_14_, p_i1197_15_); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += xSpeedIn; + this.motionY += ySpeedIn; + this.motionZ += zSpeedIn; + } + + protected EntityBreakingFX(World worldIn, double posXIn, double posYIn, double posZIn, Item p_i1196_8_, int p_i1196_9_) + { + super(worldIn, posXIn, posYIn, posZIn, 0.0D, 0.0D, 0.0D); + this.setParticleIcon(Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(p_i1196_8_, p_i1196_9_)); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleGravity = Blocks.snow.blockParticleGravity; + this.particleScale /= 2.0F; + } + + public int getFXLayer() + { + return 1; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float f1 = f + 0.015609375F; + float f2 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float f3 = f2 + 0.015609375F; + float f4 = 0.1F * this.particleScale; + + if (this.particleIcon != null) + { + f = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + f1 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + f2 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + f3 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + } + + float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); + float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); + float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); + int i = this.getBrightnessForRender(partialTicks); + int j = i >> 16 & 65535; + int k = i & 65535; + worldRendererIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + int i = p_178902_15_.length > 1 ? p_178902_15_[1] : 0; + return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, Item.getItemById(p_178902_15_[0]), i); + } + } + + public static class SlimeFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.slime_ball); + } + } + + public static class SnowballFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.snowball); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java new file mode 100644 index 0000000..53a625a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java @@ -0,0 +1,53 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.material.Material; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityBubbleFX extends EntityFX +{ + protected EntityBubbleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(32); + this.setSize(0.02F, 0.02F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; + this.motionX = xSpeedIn * 0.20000000298023224D + (Math.random() * 2.0D - 1.0D) * 0.019999999552965164D; + this.motionY = ySpeedIn * 0.20000000298023224D + (Math.random() * 2.0D - 1.0D) * 0.019999999552965164D; + this.motionZ = zSpeedIn * 0.20000000298023224D + (Math.random() * 2.0D - 1.0D) * 0.019999999552965164D; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY += 0.002D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8500000238418579D; + this.motionY *= 0.8500000238418579D; + this.motionZ *= 0.8500000238418579D; + + if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() != Material.water) + { + this.setDead(); + } + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityBubbleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCloudFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCloudFX.java new file mode 100644 index 0000000..b5eac4c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCloudFX.java @@ -0,0 +1,79 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityCloudFX extends EntityFX +{ + float field_70569_a; + + protected EntityCloudFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1221_8_, double p_i1221_10_, double p_i1221_12_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + float f = 2.5F; + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1221_8_; + this.motionY += p_i1221_10_; + this.motionZ += p_i1221_12_; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= f; + this.field_70569_a = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.3D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * f); + this.noClip = false; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + this.particleScale = this.field_70569_a * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 2.0D); + + if (entityplayer != null && this.posY > entityplayer.getEntityBoundingBox().minY) + { + this.posY += (entityplayer.getEntityBoundingBox().minY - this.posY) * 0.2D; + this.motionY += (entityplayer.motionY - this.motionY) * 0.2D; + this.setPosition(this.posX, this.posY, this.posZ); + } + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityCloudFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java new file mode 100644 index 0000000..f4640f4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java @@ -0,0 +1,89 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityCrit2FX extends EntityFX +{ + float field_174839_a; + + protected EntityCrit2FX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46284_8_, double p_i46284_10_, double p_i46284_12_) + { + this(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i46284_8_, p_i46284_10_, p_i46284_12_, 1.0F); + } + + protected EntityCrit2FX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46285_8_, double p_i46285_10_, double p_i46285_12_, float p_i46285_14_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i46285_8_ * 0.4D; + this.motionY += p_i46285_10_ * 0.4D; + this.motionZ += p_i46285_12_ * 0.4D; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D); + this.particleScale *= 0.75F; + this.particleScale *= p_i46285_14_; + this.field_174839_a = this.particleScale; + this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i46285_14_); + this.noClip = false; + this.setParticleTextureIndex(65); + this.onUpdate(); + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + this.particleScale = this.field_174839_a * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.particleGreen = (float)((double)this.particleGreen * 0.96D); + this.particleBlue = (float)((double)this.particleBlue * 0.9D); + this.motionX *= 0.699999988079071D; + this.motionY *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY -= 0.019999999552965164D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityCrit2FX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } + + public static class MagicFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX entityfx = new EntityCrit2FX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + entityfx.setRBGColorF(entityfx.getRedColorF() * 0.3F, entityfx.getGreenColorF() * 0.8F, entityfx.getBlueColorF()); + entityfx.nextTextureIndexX(); + return entityfx; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCritFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCritFX.java new file mode 100644 index 0000000..2e8d062 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityCritFX.java @@ -0,0 +1,19 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityCritFX extends EntitySmokeFX +{ + protected EntityCritFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1201_8_, double p_i1201_10_, double p_i1201_12_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i1201_8_, p_i1201_10_, p_i1201_12_, 2.5F); + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityCritFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java new file mode 100644 index 0000000..eaf0f7d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java @@ -0,0 +1,117 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityDiggingFX extends EntityFX +{ + private IBlockState sourceState; + private BlockPos sourcePos; + + protected EntityDiggingFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, IBlockState state) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.sourceState = state; + this.setParticleIcon(Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(state)); + this.particleGravity = state.getBlock().blockParticleGravity; + this.particleRed = this.particleGreen = this.particleBlue = 0.6F; + this.particleScale /= 2.0F; + } + + public EntityDiggingFX setBlockPos(BlockPos pos) + { + this.sourcePos = pos; + + if (this.sourceState.getBlock() == Blocks.grass) + { + return this; + } + else + { + int i = this.sourceState.getBlock().colorMultiplier(this.worldObj, pos); + this.particleRed *= (float)(i >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(i >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(i & 255) / 255.0F; + return this; + } + } + + public EntityDiggingFX func_174845_l() + { + this.sourcePos = new BlockPos(this.posX, this.posY, this.posZ); + Block block = this.sourceState.getBlock(); + + if (block == Blocks.grass) + { + return this; + } + else + { + int i = block.getRenderColor(this.sourceState); + this.particleRed *= (float)(i >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(i >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(i & 255) / 255.0F; + return this; + } + } + + public int getFXLayer() + { + return 1; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float f1 = f + 0.015609375F; + float f2 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float f3 = f2 + 0.015609375F; + float f4 = 0.1F * this.particleScale; + + if (this.particleIcon != null) + { + f = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + f1 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + f2 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + f3 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + } + + float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); + float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); + float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); + int i = this.getBrightnessForRender(partialTicks); + int j = i >> 16 & 65535; + int k = i & 65535; + worldRendererIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex(); + } + + public int getBrightnessForRender(float partialTicks) + { + int i = super.getBrightnessForRender(partialTicks); + int j = 0; + + if (this.worldObj.isBlockLoaded(this.sourcePos)) + { + j = this.worldObj.getCombinedLight(this.sourcePos, 0); + } + + return i == 0 ? j : i; + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return (new EntityDiggingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, Block.getStateById(p_178902_15_[0]))).func_174845_l(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java new file mode 100644 index 0000000..2f3dc3e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java @@ -0,0 +1,149 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityDropParticleFX extends EntityFX +{ + private Material materialType; + private int bobTimer; + + protected EntityDropParticleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, Material p_i1203_8_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX = this.motionY = this.motionZ = 0.0D; + + if (p_i1203_8_ == Material.water) + { + this.particleRed = 0.0F; + this.particleGreen = 0.0F; + this.particleBlue = 1.0F; + } + else + { + this.particleRed = 1.0F; + this.particleGreen = 0.0F; + this.particleBlue = 0.0F; + } + + this.setParticleTextureIndex(113); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; + this.materialType = p_i1203_8_; + this.bobTimer = 40; + this.particleMaxAge = (int)(64.0D / (Math.random() * 0.8D + 0.2D)); + this.motionX = this.motionY = this.motionZ = 0.0D; + } + + public int getBrightnessForRender(float partialTicks) + { + return this.materialType == Material.water ? super.getBrightnessForRender(partialTicks) : 257; + } + + public float getBrightness(float partialTicks) + { + return this.materialType == Material.water ? super.getBrightness(partialTicks) : 1.0F; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.materialType == Material.water) + { + this.particleRed = 0.2F; + this.particleGreen = 0.3F; + this.particleBlue = 1.0F; + } + else + { + this.particleRed = 1.0F; + this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); + this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); + } + + this.motionY -= (double)this.particleGravity; + + if (this.bobTimer-- > 0) + { + this.motionX *= 0.02D; + this.motionY *= 0.02D; + this.motionZ *= 0.02D; + this.setParticleTextureIndex(113); + } + else + { + this.setParticleTextureIndex(112); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + + if (this.onGround) + { + if (this.materialType == Material.water) + { + this.setDead(); + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + } + else + { + this.setParticleTextureIndex(114); + } + + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + BlockPos blockpos = new BlockPos(this); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Material material = iblockstate.getBlock().getMaterial(); + + if (material.isLiquid() || material.isSolid()) + { + double d0 = 0.0D; + + if (iblockstate.getBlock() instanceof BlockLiquid) + { + d0 = (double)BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue()); + } + + double d1 = (double)(MathHelper.floor_double(this.posY) + 1) - d0; + + if (this.posY < d1) + { + this.setDead(); + } + } + } + + public static class LavaFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityDropParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Material.lava); + } + } + + public static class WaterFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityDropParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, Material.water); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java new file mode 100644 index 0000000..9447f34 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java @@ -0,0 +1,88 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityEnchantmentTableParticleFX extends EntityFX +{ + private float field_70565_a; + private double coordX; + private double coordY; + private double coordZ; + + protected EntityEnchantmentTableParticleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.motionX = xSpeedIn; + this.motionY = ySpeedIn; + this.motionZ = zSpeedIn; + this.coordX = xCoordIn; + this.coordY = yCoordIn; + this.coordZ = zCoordIn; + this.posX = this.prevPosX = xCoordIn + xSpeedIn; + this.posY = this.prevPosY = yCoordIn + ySpeedIn; + this.posZ = this.prevPosZ = zCoordIn + zSpeedIn; + float f = this.rand.nextFloat() * 0.6F + 0.4F; + this.field_70565_a = this.particleScale = this.rand.nextFloat() * 0.5F + 0.2F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * f; + this.particleGreen *= 0.9F; + this.particleRed *= 0.9F; + this.particleMaxAge = (int)(Math.random() * 10.0D) + 30; + this.noClip = true; + this.setParticleTextureIndex((int)(Math.random() * 26.0D + 1.0D + 224.0D)); + } + + public int getBrightnessForRender(float partialTicks) + { + int i = super.getBrightnessForRender(partialTicks); + float f = (float)this.particleAge / (float)this.particleMaxAge; + f = f * f; + f = f * f; + int j = i & 255; + int k = i >> 16 & 255; + k = k + (int)(f * 15.0F * 16.0F); + + if (k > 240) + { + k = 240; + } + + return j | k << 16; + } + + public float getBrightness(float partialTicks) + { + float f = super.getBrightness(partialTicks); + float f1 = (float)this.particleAge / (float)this.particleMaxAge; + f1 = f1 * f1; + f1 = f1 * f1; + return f * (1.0F - f1) + f1; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + float f = (float)this.particleAge / (float)this.particleMaxAge; + f = 1.0F - f; + float f1 = 1.0F - f; + f1 = f1 * f1; + f1 = f1 * f1; + this.posX = this.coordX + this.motionX * (double)f; + this.posY = this.coordY + this.motionY * (double)f - (double)(f1 * 1.2F); + this.posZ = this.coordZ + this.motionZ * (double)f; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + } + + public static class EnchantmentTable implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityEnchantmentTableParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java new file mode 100644 index 0000000..b4c4352 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java @@ -0,0 +1,50 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityExplodeFX extends EntityFX +{ + protected EntityExplodeFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.motionX = xSpeedIn + (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D; + this.motionY = ySpeedIn + (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D; + this.motionZ = zSpeedIn + (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D; + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; + this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; + this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8999999761581421D; + this.motionY *= 0.8999999761581421D; + this.motionZ *= 0.8999999761581421D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityExplodeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFX.java new file mode 100644 index 0000000..b259754 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFX.java @@ -0,0 +1,231 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFX extends Entity +{ + protected int particleTextureIndexX; + protected int particleTextureIndexY; + protected float particleTextureJitterX; + protected float particleTextureJitterY; + protected int particleAge; + protected int particleMaxAge; + protected float particleScale; + protected float particleGravity; + protected float particleRed; + protected float particleGreen; + protected float particleBlue; + protected float particleAlpha; + protected TextureAtlasSprite particleIcon; + public static double interpPosX; + public static double interpPosY; + public static double interpPosZ; + + protected EntityFX(World worldIn, double posXIn, double posYIn, double posZIn) + { + super(worldIn); + this.particleAlpha = 1.0F; + this.setSize(0.2F, 0.2F); + this.setPosition(posXIn, posYIn, posZIn); + this.lastTickPosX = this.prevPosX = posXIn; + this.lastTickPosY = this.prevPosY = posYIn; + this.lastTickPosZ = this.prevPosZ = posZIn; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleTextureJitterX = this.rand.nextFloat() * 3.0F; + this.particleTextureJitterY = this.rand.nextFloat() * 3.0F; + this.particleScale = (this.rand.nextFloat() * 0.5F + 0.5F) * 2.0F; + this.particleMaxAge = (int)(4.0F / (this.rand.nextFloat() * 0.9F + 0.1F)); + this.particleAge = 0; + } + + public EntityFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + this(worldIn, xCoordIn, yCoordIn, zCoordIn); + this.motionX = xSpeedIn + (Math.random() * 2.0D - 1.0D) * 0.4000000059604645D; + this.motionY = ySpeedIn + (Math.random() * 2.0D - 1.0D) * 0.4000000059604645D; + this.motionZ = zSpeedIn + (Math.random() * 2.0D - 1.0D) * 0.4000000059604645D; + float f = (float)(Math.random() + Math.random() + 1.0D) * 0.15F; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.motionX = this.motionX / (double)f1 * (double)f * 0.4000000059604645D; + this.motionY = this.motionY / (double)f1 * (double)f * 0.4000000059604645D + 0.10000000149011612D; + this.motionZ = this.motionZ / (double)f1 * (double)f * 0.4000000059604645D; + } + + public EntityFX multiplyVelocity(float multiplier) + { + this.motionX *= (double)multiplier; + this.motionY = (this.motionY - 0.10000000149011612D) * (double)multiplier + 0.10000000149011612D; + this.motionZ *= (double)multiplier; + return this; + } + + public EntityFX multipleParticleScaleBy(float scale) + { + this.setSize(0.2F * scale, 0.2F * scale); + this.particleScale *= scale; + return this; + } + + public void setRBGColorF(float particleRedIn, float particleGreenIn, float particleBlueIn) + { + this.particleRed = particleRedIn; + this.particleGreen = particleGreenIn; + this.particleBlue = particleBlueIn; + } + + public void setAlphaF(float alpha) + { + if (this.particleAlpha == 1.0F && alpha < 1.0F) + { + Minecraft.getMinecraft().effectRenderer.moveToAlphaLayer(this); + } + else if (this.particleAlpha < 1.0F && alpha == 1.0F) + { + Minecraft.getMinecraft().effectRenderer.moveToNoAlphaLayer(this); + } + + this.particleAlpha = alpha; + } + + public float getRedColorF() + { + return this.particleRed; + } + + public float getGreenColorF() + { + return this.particleGreen; + } + + public float getBlueColorF() + { + return this.particleBlue; + } + + public float getAlpha() + { + return this.particleAlpha; + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.motionY -= 0.04D * (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = (float)this.particleTextureIndexX / 16.0F; + float f1 = f + 0.0624375F; + float f2 = (float)this.particleTextureIndexY / 16.0F; + float f3 = f2 + 0.0624375F; + float f4 = 0.1F * this.particleScale; + + if (this.particleIcon != null) + { + f = this.particleIcon.getMinU(); + f1 = this.particleIcon.getMaxU(); + f2 = this.particleIcon.getMinV(); + f3 = this.particleIcon.getMaxV(); + } + + float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); + float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); + float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); + int i = this.getBrightnessForRender(partialTicks); + int j = i >> 16 & 65535; + int k = i & 65535; + worldRendererIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + } + + public int getFXLayer() + { + return 0; + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + } + + public void setParticleIcon(TextureAtlasSprite icon) + { + int i = this.getFXLayer(); + + if (i == 1) + { + this.particleIcon = icon; + } + else + { + throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); + } + } + + public void setParticleTextureIndex(int particleTextureIndex) + { + if (this.getFXLayer() != 0) + { + throw new RuntimeException("Invalid call to Particle.setMiscTex"); + } + else + { + this.particleTextureIndexX = particleTextureIndex % 16; + this.particleTextureIndexY = particleTextureIndex / 16; + } + } + + public void nextTextureIndexX() + { + ++this.particleTextureIndexX; + } + + public boolean canAttackWithItem() + { + return false; + } + + public String toString() + { + return this.getClass().getSimpleName() + ", Pos (" + this.posX + "," + this.posY + "," + this.posZ + "), RGBA (" + this.particleRed + "," + this.particleGreen + "," + this.particleBlue + "," + this.particleAlpha + "), Age " + this.particleAge; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFirework.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFirework.java new file mode 100644 index 0000000..56cfbc7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFirework.java @@ -0,0 +1,432 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemDye; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFirework +{ + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFirework.SparkFX entityfirework$sparkfx = new EntityFirework.SparkFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, Minecraft.getMinecraft().effectRenderer); + entityfirework$sparkfx.setAlphaF(0.99F); + return entityfirework$sparkfx; + } + } + + public static class OverlayFX extends EntityFX + { + protected OverlayFX(World p_i46466_1_, double p_i46466_2_, double p_i46466_4_, double p_i46466_6_) + { + super(p_i46466_1_, p_i46466_2_, p_i46466_4_, p_i46466_6_); + this.particleMaxAge = 4; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = 0.25F; + float f1 = 0.5F; + float f2 = 0.125F; + float f3 = 0.375F; + float f4 = 7.1F * MathHelper.sin(((float)this.particleAge + partialTicks - 1.0F) * 0.25F * (float)Math.PI); + this.particleAlpha = 0.6F - ((float)this.particleAge + partialTicks - 1.0F) * 0.25F * 0.5F; + float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); + float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); + float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); + int i = this.getBrightnessForRender(partialTicks); + int j = i >> 16 & 65535; + int k = i & 65535; + worldRendererIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex(0.5D, 0.375D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex(0.5D, 0.125D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex(0.25D, 0.125D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex(0.25D, 0.375D).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); + } + } + + public static class SparkFX extends EntityFX + { + private int baseTextureIndex = 160; + private boolean trail; + private boolean twinkle; + private final EffectRenderer field_92047_az; + private float fadeColourRed; + private float fadeColourGreen; + private float fadeColourBlue; + private boolean hasFadeColour; + + public SparkFX(World p_i46465_1_, double p_i46465_2_, double p_i46465_4_, double p_i46465_6_, double p_i46465_8_, double p_i46465_10_, double p_i46465_12_, EffectRenderer p_i46465_14_) + { + super(p_i46465_1_, p_i46465_2_, p_i46465_4_, p_i46465_6_); + this.motionX = p_i46465_8_; + this.motionY = p_i46465_10_; + this.motionZ = p_i46465_12_; + this.field_92047_az = p_i46465_14_; + this.particleScale *= 0.75F; + this.particleMaxAge = 48 + this.rand.nextInt(12); + this.noClip = false; + } + + public void setTrail(boolean trailIn) + { + this.trail = trailIn; + } + + public void setTwinkle(boolean twinkleIn) + { + this.twinkle = twinkleIn; + } + + public void setColour(int colour) + { + float f = (float)((colour & 16711680) >> 16) / 255.0F; + float f1 = (float)((colour & 65280) >> 8) / 255.0F; + float f2 = (float)((colour & 255) >> 0) / 255.0F; + float f3 = 1.0F; + this.setRBGColorF(f * f3, f1 * f3, f2 * f3); + } + + public void setFadeColour(int faceColour) + { + this.fadeColourRed = (float)((faceColour & 16711680) >> 16) / 255.0F; + this.fadeColourGreen = (float)((faceColour & 65280) >> 8) / 255.0F; + this.fadeColourBlue = (float)((faceColour & 255) >> 0) / 255.0F; + this.hasFadeColour = true; + } + + public AxisAlignedBB getCollisionBoundingBox() + { + return null; + } + + public boolean canBePushed() + { + return false; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + if (!this.twinkle || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) + { + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + if (this.particleAge > this.particleMaxAge / 2) + { + this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge); + + if (this.hasFadeColour) + { + this.particleRed += (this.fadeColourRed - this.particleRed) * 0.2F; + this.particleGreen += (this.fadeColourGreen - this.particleGreen) * 0.2F; + this.particleBlue += (this.fadeColourBlue - this.particleBlue) * 0.2F; + } + } + + this.setParticleTextureIndex(this.baseTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY -= 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9100000262260437D; + this.motionY *= 0.9100000262260437D; + this.motionZ *= 0.9100000262260437D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + if (this.trail && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) + { + EntityFirework.SparkFX entityfirework$sparkfx = new EntityFirework.SparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az); + entityfirework$sparkfx.setAlphaF(0.99F); + entityfirework$sparkfx.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue); + entityfirework$sparkfx.particleAge = entityfirework$sparkfx.particleMaxAge / 2; + + if (this.hasFadeColour) + { + entityfirework$sparkfx.hasFadeColour = true; + entityfirework$sparkfx.fadeColourRed = this.fadeColourRed; + entityfirework$sparkfx.fadeColourGreen = this.fadeColourGreen; + entityfirework$sparkfx.fadeColourBlue = this.fadeColourBlue; + } + + entityfirework$sparkfx.twinkle = this.twinkle; + this.field_92047_az.addEffect(entityfirework$sparkfx); + } + } + + public int getBrightnessForRender(float partialTicks) + { + return 15728880; + } + + public float getBrightness(float partialTicks) + { + return 1.0F; + } + } + + public static class StarterFX extends EntityFX + { + private int fireworkAge; + private final EffectRenderer theEffectRenderer; + private NBTTagList fireworkExplosions; + boolean twinkle; + + public StarterFX(World p_i46464_1_, double p_i46464_2_, double p_i46464_4_, double p_i46464_6_, double p_i46464_8_, double p_i46464_10_, double p_i46464_12_, EffectRenderer p_i46464_14_, NBTTagCompound p_i46464_15_) + { + super(p_i46464_1_, p_i46464_2_, p_i46464_4_, p_i46464_6_, 0.0D, 0.0D, 0.0D); + this.motionX = p_i46464_8_; + this.motionY = p_i46464_10_; + this.motionZ = p_i46464_12_; + this.theEffectRenderer = p_i46464_14_; + this.particleMaxAge = 8; + + if (p_i46464_15_ != null) + { + this.fireworkExplosions = p_i46464_15_.getTagList("Explosions", 10); + + if (this.fireworkExplosions.tagCount() == 0) + { + this.fireworkExplosions = null; + } + else + { + this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1; + + for (int i = 0; i < this.fireworkExplosions.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = this.fireworkExplosions.getCompoundTagAt(i); + + if (nbttagcompound.getBoolean("Flicker")) + { + this.twinkle = true; + this.particleMaxAge += 15; + break; + } + } + } + } + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + } + + public void onUpdate() + { + if (this.fireworkAge == 0 && this.fireworkExplosions != null) + { + boolean flag = this.func_92037_i(); + boolean flag1 = false; + + if (this.fireworkExplosions.tagCount() >= 3) + { + flag1 = true; + } + else + { + for (int i = 0; i < this.fireworkExplosions.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = this.fireworkExplosions.getCompoundTagAt(i); + + if (nbttagcompound.getByte("Type") == 1) + { + flag1 = true; + break; + } + } + } + + String s1 = "fireworks." + (flag1 ? "largeBlast" : "blast") + (flag ? "_far" : ""); + this.worldObj.playSound(this.posX, this.posY, this.posZ, s1, 20.0F, 0.95F + this.rand.nextFloat() * 0.1F, true); + } + + if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) + { + int k = this.fireworkAge / 2; + NBTTagCompound nbttagcompound1 = this.fireworkExplosions.getCompoundTagAt(k); + int l = nbttagcompound1.getByte("Type"); + boolean flag4 = nbttagcompound1.getBoolean("Trail"); + boolean flag2 = nbttagcompound1.getBoolean("Flicker"); + int[] aint = nbttagcompound1.getIntArray("Colors"); + int[] aint1 = nbttagcompound1.getIntArray("FadeColors"); + + if (aint.length == 0) + { + aint = new int[] {ItemDye.dyeColors[0]}; + } + + if (l == 1) + { + this.createBall(0.5D, 4, aint, aint1, flag4, flag2); + } + else if (l == 2) + { + this.createShaped(0.5D, new double[][] {{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, aint, aint1, flag4, flag2, false); + } + else if (l == 3) + { + this.createShaped(0.5D, new double[][] {{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, aint, aint1, flag4, flag2, true); + } + else if (l == 4) + { + this.createBurst(aint, aint1, flag4, flag2); + } + else + { + this.createBall(0.25D, 2, aint, aint1, flag4, flag2); + } + + int j = aint[0]; + float f = (float)((j & 16711680) >> 16) / 255.0F; + float f1 = (float)((j & 65280) >> 8) / 255.0F; + float f2 = (float)((j & 255) >> 0) / 255.0F; + EntityFirework.OverlayFX entityfirework$overlayfx = new EntityFirework.OverlayFX(this.worldObj, this.posX, this.posY, this.posZ); + entityfirework$overlayfx.setRBGColorF(f, f1, f2); + this.theEffectRenderer.addEffect(entityfirework$overlayfx); + } + + ++this.fireworkAge; + + if (this.fireworkAge > this.particleMaxAge) + { + if (this.twinkle) + { + boolean flag3 = this.func_92037_i(); + String s = "fireworks." + (flag3 ? "twinkle_far" : "twinkle"); + this.worldObj.playSound(this.posX, this.posY, this.posZ, s, 20.0F, 0.9F + this.rand.nextFloat() * 0.15F, true); + } + + this.setDead(); + } + } + + private boolean func_92037_i() + { + Minecraft minecraft = Minecraft.getMinecraft(); + return minecraft == null || minecraft.getRenderViewEntity() == null || minecraft.getRenderViewEntity().getDistanceSq(this.posX, this.posY, this.posZ) >= 256.0D; + } + + private void createParticle(double p_92034_1_, double p_92034_3_, double p_92034_5_, double p_92034_7_, double p_92034_9_, double p_92034_11_, int[] p_92034_13_, int[] p_92034_14_, boolean p_92034_15_, boolean p_92034_16_) + { + EntityFirework.SparkFX entityfirework$sparkfx = new EntityFirework.SparkFX(this.worldObj, p_92034_1_, p_92034_3_, p_92034_5_, p_92034_7_, p_92034_9_, p_92034_11_, this.theEffectRenderer); + entityfirework$sparkfx.setAlphaF(0.99F); + entityfirework$sparkfx.setTrail(p_92034_15_); + entityfirework$sparkfx.setTwinkle(p_92034_16_); + int i = this.rand.nextInt(p_92034_13_.length); + entityfirework$sparkfx.setColour(p_92034_13_[i]); + + if (p_92034_14_ != null && p_92034_14_.length > 0) + { + entityfirework$sparkfx.setFadeColour(p_92034_14_[this.rand.nextInt(p_92034_14_.length)]); + } + + this.theEffectRenderer.addEffect(entityfirework$sparkfx); + } + + private void createBall(double speed, int size, int[] colours, int[] fadeColours, boolean trail, boolean twinkleIn) + { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + + for (int i = -size; i <= size; ++i) + { + for (int j = -size; j <= size; ++j) + { + for (int k = -size; k <= size; ++k) + { + double d3 = (double)j + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double d4 = (double)i + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double d5 = (double)k + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double d6 = (double)MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5) / speed + this.rand.nextGaussian() * 0.05D; + this.createParticle(d0, d1, d2, d3 / d6, d4 / d6, d5 / d6, colours, fadeColours, trail, twinkleIn); + + if (i != -size && i != size && j != -size && j != size) + { + k += size * 2 - 1; + } + } + } + } + } + + private void createShaped(double speed, double[][] shape, int[] colours, int[] fadeColours, boolean trail, boolean twinkleIn, boolean p_92038_8_) + { + double d0 = shape[0][0]; + double d1 = shape[0][1]; + this.createParticle(this.posX, this.posY, this.posZ, d0 * speed, d1 * speed, 0.0D, colours, fadeColours, trail, twinkleIn); + float f = this.rand.nextFloat() * (float)Math.PI; + double d2 = p_92038_8_ ? 0.034D : 0.34D; + + for (int i = 0; i < 3; ++i) + { + double d3 = (double)f + (double)((float)i * (float)Math.PI) * d2; + double d4 = d0; + double d5 = d1; + + for (int j = 1; j < shape.length; ++j) + { + double d6 = shape[j][0]; + double d7 = shape[j][1]; + + for (double d8 = 0.25D; d8 <= 1.0D; d8 += 0.25D) + { + double d9 = (d4 + (d6 - d4) * d8) * speed; + double d10 = (d5 + (d7 - d5) * d8) * speed; + double d11 = d9 * Math.sin(d3); + d9 = d9 * Math.cos(d3); + + for (double d12 = -1.0D; d12 <= 1.0D; d12 += 2.0D) + { + this.createParticle(this.posX, this.posY, this.posZ, d9 * d12, d10, d11 * d12, colours, fadeColours, trail, twinkleIn); + } + } + + d4 = d6; + d5 = d7; + } + } + } + + private void createBurst(int[] colours, int[] fadeColours, boolean trail, boolean twinkleIn) + { + double d0 = this.rand.nextGaussian() * 0.05D; + double d1 = this.rand.nextGaussian() * 0.05D; + + for (int i = 0; i < 70; ++i) + { + double d2 = this.motionX * 0.5D + this.rand.nextGaussian() * 0.15D + d0; + double d3 = this.motionZ * 0.5D + this.rand.nextGaussian() * 0.15D + d1; + double d4 = this.motionY * 0.5D + this.rand.nextDouble() * 0.5D; + this.createParticle(this.posX, this.posY, this.posZ, d2, d4, d3, colours, fadeColours, trail, twinkleIn); + } + } + + public int getFXLayer() + { + return 0; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java new file mode 100644 index 0000000..40c151a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java @@ -0,0 +1,53 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityFishWakeFX extends EntityFX +{ + protected EntityFishWakeFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i45073_8_, double p_i45073_10_, double p_i45073_12_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.30000001192092896D; + this.motionY = Math.random() * 0.20000000298023224D + 0.10000000149011612D; + this.motionZ *= 0.30000001192092896D; + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(19); + this.setSize(0.01F, 0.01F); + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleGravity = 0.0F; + this.motionX = p_i45073_8_; + this.motionY = p_i45073_10_; + this.motionZ = p_i45073_12_; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + int i = 60 - this.particleMaxAge; + float f = (float)i * 0.001F; + this.setSize(f, f); + this.setParticleTextureIndex(19 + i % 4); + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityFishWakeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFlameFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFlameFX.java new file mode 100644 index 0000000..9abc648 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFlameFX.java @@ -0,0 +1,90 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFlameFX extends EntityFX +{ + private float flameScale; + + protected EntityFlameFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.motionX = this.motionX * 0.009999999776482582D + xSpeedIn; + this.motionY = this.motionY * 0.009999999776482582D + ySpeedIn; + this.motionZ = this.motionZ * 0.009999999776482582D + zSpeedIn; + this.posX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + this.posY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + this.posZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + this.flameScale = this.particleScale; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)) + 4; + this.noClip = true; + this.setParticleTextureIndex(48); + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge; + this.particleScale = this.flameScale * (1.0F - f * f * 0.5F); + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public int getBrightnessForRender(float partialTicks) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + int i = super.getBrightnessForRender(partialTicks); + int j = i & 255; + int k = i >> 16 & 255; + j = j + (int)(f * 15.0F * 16.0F); + + if (j > 240) + { + j = 240; + } + + return j | k << 16; + } + + public float getBrightness(float partialTicks) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + float f1 = super.getBrightness(partialTicks); + return f1 * f + (1.0F - f); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityFlameFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java new file mode 100644 index 0000000..ebc5bc1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java @@ -0,0 +1,82 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class EntityFootStepFX extends EntityFX +{ + private static final ResourceLocation FOOTPRINT_TEXTURE = new ResourceLocation("textures/particle/footprint.png"); + private int footstepAge; + private int footstepMaxAge; + private TextureManager currentFootSteps; + + protected EntityFootStepFX(TextureManager currentFootStepsIn, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.currentFootSteps = currentFootStepsIn; + this.motionX = this.motionY = this.motionZ = 0.0D; + this.footstepMaxAge = 200; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.footstepAge + partialTicks) / (float)this.footstepMaxAge; + f = f * f; + float f1 = 2.0F - f * 2.0F; + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + f1 = f1 * 0.2F; + GlStateManager.disableLighting(); + float f2 = 0.125F; + float f3 = (float)(this.posX - interpPosX); + float f4 = (float)(this.posY - interpPosY); + float f5 = (float)(this.posZ - interpPosZ); + float f6 = this.worldObj.getLightBrightness(new BlockPos(this)); + this.currentFootSteps.bindTexture(FOOTPRINT_TEXTURE); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + worldRendererIn.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(0.0D, 1.0D).color(f6, f6, f6, f1).endVertex(); + worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(1.0D, 1.0D).color(f6, f6, f6, f1).endVertex(); + worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(1.0D, 0.0D).color(f6, f6, f6, f1).endVertex(); + worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(0.0D, 0.0D).color(f6, f6, f6, f1).endVertex(); + Tessellator.getInstance().draw(); + GlStateManager.disableBlend(); + GlStateManager.enableLighting(); + } + + public void onUpdate() + { + ++this.footstepAge; + + if (this.footstepAge == this.footstepMaxAge) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityFootStepFX(Minecraft.getMinecraft().getTextureManager(), worldIn, xCoordIn, yCoordIn, zCoordIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityHeartFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityHeartFX.java new file mode 100644 index 0000000..eba8b8e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityHeartFX.java @@ -0,0 +1,88 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityHeartFX extends EntityFX +{ + float particleScaleOverTime; + + protected EntityHeartFX(World worldIn, double p_i1211_2_, double p_i1211_4_, double p_i1211_6_, double p_i1211_8_, double p_i1211_10_, double p_i1211_12_) + { + this(worldIn, p_i1211_2_, p_i1211_4_, p_i1211_6_, p_i1211_8_, p_i1211_10_, p_i1211_12_, 2.0F); + } + + protected EntityHeartFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46354_8_, double p_i46354_10_, double p_i46354_12_, float scale) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.009999999776482582D; + this.motionY *= 0.009999999776482582D; + this.motionZ *= 0.009999999776482582D; + this.motionY += 0.1D; + this.particleScale *= 0.75F; + this.particleScale *= scale; + this.particleScaleOverTime = this.particleScale; + this.particleMaxAge = 16; + this.noClip = false; + this.setParticleTextureIndex(80); + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + this.particleScale = this.particleScaleOverTime * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.8600000143051147D; + this.motionY *= 0.8600000143051147D; + this.motionZ *= 0.8600000143051147D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class AngryVillagerFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX entityfx = new EntityHeartFX(worldIn, xCoordIn, yCoordIn + 0.5D, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + entityfx.setParticleTextureIndex(81); + entityfx.setRBGColorF(1.0F, 1.0F, 1.0F); + return entityfx; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityHeartFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java new file mode 100644 index 0000000..95a0f37 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java @@ -0,0 +1,52 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class EntityHugeExplodeFX extends EntityFX +{ + private int timeSinceStart; + private int maximumTime = 8; + + protected EntityHugeExplodeFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1214_8_, double p_i1214_10_, double p_i1214_12_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + } + + public void onUpdate() + { + for (int i = 0; i < 6; ++i) + { + double d0 = this.posX + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + double d1 = this.posY + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + double d2 = this.posZ + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, d0, d1, d2, (double)((float)this.timeSinceStart / (float)this.maximumTime), 0.0D, 0.0D, new int[0]); + } + + ++this.timeSinceStart; + + if (this.timeSinceStart == this.maximumTime) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 1; + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityHugeExplodeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java new file mode 100644 index 0000000..f09d00c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java @@ -0,0 +1,91 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class EntityLargeExplodeFX extends EntityFX +{ + private static final ResourceLocation EXPLOSION_TEXTURE = new ResourceLocation("textures/entity/explosion.png"); + private static final VertexFormat field_181549_az = (new VertexFormat()).addElement(DefaultVertexFormats.POSITION_3F).addElement(DefaultVertexFormats.TEX_2F).addElement(DefaultVertexFormats.COLOR_4UB).addElement(DefaultVertexFormats.TEX_2S).addElement(DefaultVertexFormats.NORMAL_3B).addElement(DefaultVertexFormats.PADDING_1B); + private int field_70581_a; + private int field_70584_aq; + private TextureManager theRenderEngine; + private float field_70582_as; + + protected EntityLargeExplodeFX(TextureManager renderEngine, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1213_9_, double p_i1213_11_, double p_i1213_13_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.theRenderEngine = renderEngine; + this.field_70584_aq = 6 + this.rand.nextInt(4); + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.6F + 0.4F; + this.field_70582_as = 1.0F - (float)p_i1213_9_ * 0.5F; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + int i = (int)(((float)this.field_70581_a + partialTicks) * 15.0F / (float)this.field_70584_aq); + + if (i <= 15) + { + this.theRenderEngine.bindTexture(EXPLOSION_TEXTURE); + float f = (float)(i % 4) / 4.0F; + float f1 = f + 0.24975F; + float f2 = (float)(i / 4) / 4.0F; + float f3 = f2 + 0.24975F; + float f4 = 2.0F * this.field_70582_as; + float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); + float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); + float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableLighting(); + RenderHelper.disableStandardItemLighting(); + worldRendererIn.begin(7, field_181549_az); + worldRendererIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldRendererIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + Tessellator.getInstance().draw(); + GlStateManager.enableLighting(); + } + } + + public int getBrightnessForRender(float partialTicks) + { + return 61680; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.field_70581_a; + + if (this.field_70581_a == this.field_70584_aq) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityLargeExplodeFX(Minecraft.getMinecraft().getTextureManager(), worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityLavaFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityLavaFX.java new file mode 100644 index 0000000..c74beb9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityLavaFX.java @@ -0,0 +1,88 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityLavaFX extends EntityFX +{ + private float lavaParticleScale; + + protected EntityLavaFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + this.motionY = (double)(this.rand.nextFloat() * 0.4F + 0.05F); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleScale *= this.rand.nextFloat() * 2.0F + 0.2F; + this.lavaParticleScale = this.particleScale; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + this.setParticleTextureIndex(49); + } + + public int getBrightnessForRender(float partialTicks) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + int i = super.getBrightnessForRender(partialTicks); + int j = 240; + int k = i >> 16 & 255; + return j | k << 16; + } + + public float getBrightness(float partialTicks) + { + return 1.0F; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge; + this.particleScale = this.lavaParticleScale * (1.0F - f * f); + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + float f = (float)this.particleAge / (float)this.particleMaxAge; + + if (this.rand.nextFloat() > f) + { + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, new int[0]); + } + + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9990000128746033D; + this.motionY *= 0.9990000128746033D; + this.motionZ *= 0.9990000128746033D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityLavaFX(worldIn, xCoordIn, yCoordIn, zCoordIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityNoteFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityNoteFX.java new file mode 100644 index 0000000..3a0e56e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityNoteFX.java @@ -0,0 +1,80 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityNoteFX extends EntityFX +{ + float noteParticleScale; + + protected EntityNoteFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46353_8_, double p_i46353_10_, double p_i46353_12_) + { + this(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i46353_8_, p_i46353_10_, p_i46353_12_, 2.0F); + } + + protected EntityNoteFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1217_8_, double p_i1217_10_, double p_i1217_12_, float p_i1217_14_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.009999999776482582D; + this.motionY *= 0.009999999776482582D; + this.motionZ *= 0.009999999776482582D; + this.motionY += 0.2D; + this.particleRed = MathHelper.sin(((float)p_i1217_8_ + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleGreen = MathHelper.sin(((float)p_i1217_8_ + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleBlue = MathHelper.sin(((float)p_i1217_8_ + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleScale *= 0.75F; + this.particleScale *= p_i1217_14_; + this.noteParticleScale = this.particleScale; + this.particleMaxAge = 6; + this.noClip = false; + this.setParticleTextureIndex(64); + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + this.particleScale = this.noteParticleScale * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.6600000262260437D; + this.motionY *= 0.6600000262260437D; + this.motionZ *= 0.6600000262260437D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityNoteFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityParticleEmitter.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityParticleEmitter.java new file mode 100644 index 0000000..38e6f5d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityParticleEmitter.java @@ -0,0 +1,64 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class EntityParticleEmitter extends EntityFX { + private Entity attachedEntity; + private int age; + private int lifetime; + private EnumParticleTypes particleTypes; + private final float multiplier; + + public EntityParticleEmitter(World worldIn, Entity p_i46279_2_, EnumParticleTypes particleTypesIn) { + super(worldIn, p_i46279_2_.posX, p_i46279_2_.getEntityBoundingBox().minY + (double) (p_i46279_2_.height / 2.0F), p_i46279_2_.posZ, p_i46279_2_.motionX, p_i46279_2_.motionY, p_i46279_2_.motionZ); + this.attachedEntity = p_i46279_2_; + this.lifetime = 3; + this.particleTypes = particleTypesIn; + this.multiplier = 1.0F; + this.onUpdate(); + } + + public EntityParticleEmitter(World worldIn, Entity p_i46279_2_, EnumParticleTypes particleTypesIn, float multiplier) { + super(worldIn, p_i46279_2_.posX, p_i46279_2_.getEntityBoundingBox().minY + (double) (p_i46279_2_.height / 2.0F), p_i46279_2_.posZ, p_i46279_2_.motionX, p_i46279_2_.motionY, p_i46279_2_.motionZ); + this.attachedEntity = p_i46279_2_; + this.lifetime = 3; + this.particleTypes = particleTypesIn; + this.multiplier = multiplier; + this.onUpdate(); + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) { + } + + public void onUpdate() + { + for (int i = 0; i < 16 * this.multiplier; ++i) + { + double d0 = (this.rand.nextFloat() * 2.0F - 1.0F); + double d1 = (this.rand.nextFloat() * 2.0F - 1.0F); + double d2 = (this.rand.nextFloat() * 2.0F - 1.0F); + + if (d0 * d0 + d1 * d1 + d2 * d2 <= 1.0D) + { + double d3 = this.attachedEntity.posX + d0 * (double)this.attachedEntity.width / 4.0D; + double d4 = this.attachedEntity.getEntityBoundingBox().minY + (double)(this.attachedEntity.height / 2.0F) + d1 * (double)this.attachedEntity.height / 4.0D; + double d5 = this.attachedEntity.posZ + d2 * (double)this.attachedEntity.width / 4.0D; + + this.worldObj.spawnParticle(this.particleTypes, false, d3, d4, d5, d0, d1 + 0.2D, d2, new int[0]); + } + } + + ++this.age; + + if (this.age >= this.lifetime) { + this.setDead(); + } + } + + public int getFXLayer() { + return 3; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityPickupFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityPickupFX.java new file mode 100644 index 0000000..e0ce4b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityPickupFX.java @@ -0,0 +1,84 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.src.Config; +import net.minecraft.world.World; +import net.optifine.shaders.Program; +import net.optifine.shaders.Shaders; + +public class EntityPickupFX extends EntityFX +{ + private Entity field_174840_a; + private Entity field_174843_ax; + private int age; + private int maxAge; + private float field_174841_aA; + private RenderManager field_174842_aB = Minecraft.getMinecraft().getRenderManager(); + + public EntityPickupFX(World worldIn, Entity p_i1233_2_, Entity p_i1233_3_, float p_i1233_4_) + { + super(worldIn, p_i1233_2_.posX, p_i1233_2_.posY, p_i1233_2_.posZ, p_i1233_2_.motionX, p_i1233_2_.motionY, p_i1233_2_.motionZ); + this.field_174840_a = p_i1233_2_; + this.field_174843_ax = p_i1233_3_; + this.maxAge = 3; + this.field_174841_aA = p_i1233_4_; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + Program program = null; + + if (Config.isShaders()) + { + program = Shaders.activeProgram; + Shaders.nextEntity(this.field_174840_a); + } + + float f = ((float)this.age + partialTicks) / (float)this.maxAge; + f = f * f; + double d0 = this.field_174840_a.posX; + double d1 = this.field_174840_a.posY; + double d2 = this.field_174840_a.posZ; + double d3 = this.field_174843_ax.lastTickPosX + (this.field_174843_ax.posX - this.field_174843_ax.lastTickPosX) * (double)partialTicks; + double d4 = this.field_174843_ax.lastTickPosY + (this.field_174843_ax.posY - this.field_174843_ax.lastTickPosY) * (double)partialTicks + (double)this.field_174841_aA; + double d5 = this.field_174843_ax.lastTickPosZ + (this.field_174843_ax.posZ - this.field_174843_ax.lastTickPosZ) * (double)partialTicks; + double d6 = d0 + (d3 - d0) * (double)f; + double d7 = d1 + (d4 - d1) * (double)f; + double d8 = d2 + (d5 - d2) * (double)f; + int i = this.getBrightnessForRender(partialTicks); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + d6 = d6 - interpPosX; + d7 = d7 - interpPosY; + d8 = d8 - interpPosZ; + this.field_174842_aB.renderEntityWithPosYaw(this.field_174840_a, (double)((float)d6), (double)((float)d7), (double)((float)d8), this.field_174840_a.rotationYaw, partialTicks); + + if (Config.isShaders()) + { + Shaders.setEntityId((Entity)null); + Shaders.useProgram(program); + } + } + + public void onUpdate() + { + ++this.age; + + if (this.age == this.maxAge) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityPortalFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityPortalFX.java new file mode 100644 index 0000000..d0c7b96 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityPortalFX.java @@ -0,0 +1,94 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public class EntityPortalFX extends EntityFX +{ + private float portalParticleScale; + private double portalPosX; + private double portalPosY; + private double portalPosZ; + + protected EntityPortalFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.motionX = xSpeedIn; + this.motionY = ySpeedIn; + this.motionZ = zSpeedIn; + this.portalPosX = this.posX = xCoordIn; + this.portalPosY = this.posY = yCoordIn; + this.portalPosZ = this.posZ = zCoordIn; + float f = this.rand.nextFloat() * 0.6F + 0.4F; + this.portalParticleScale = this.particleScale = this.rand.nextFloat() * 0.2F + 0.5F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * f; + this.particleGreen *= 0.3F; + this.particleRed *= 0.9F; + this.particleMaxAge = (int)(Math.random() * 10.0D) + 40; + this.noClip = true; + this.setParticleTextureIndex((int)(Math.random() * 8.0D)); + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge; + f = 1.0F - f; + f = f * f; + f = 1.0F - f; + this.particleScale = this.portalParticleScale * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public int getBrightnessForRender(float partialTicks) + { + int i = super.getBrightnessForRender(partialTicks); + float f = (float)this.particleAge / (float)this.particleMaxAge; + f = f * f; + f = f * f; + int j = i & 255; + int k = i >> 16 & 255; + k = k + (int)(f * 15.0F * 16.0F); + + if (k > 240) + { + k = 240; + } + + return j | k << 16; + } + + public float getBrightness(float partialTicks) + { + float f = super.getBrightness(partialTicks); + float f1 = (float)this.particleAge / (float)this.particleMaxAge; + f1 = f1 * f1 * f1 * f1; + return f * (1.0F - f1) + f1; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + float f = (float)this.particleAge / (float)this.particleMaxAge; + f = -f + f * f * 2.0F; + f = 1.0F - f; + this.posX = this.portalPosX + this.motionX * (double)f; + this.posY = this.portalPosY + this.motionY * (double)f + (double)(1.0F - f); + this.posZ = this.portalPosZ + this.motionZ * (double)f; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityPortalFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityRainFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityRainFX.java new file mode 100644 index 0000000..f3acabf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityRainFX.java @@ -0,0 +1,90 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityRainFX extends EntityFX +{ + protected EntityRainFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.30000001192092896D; + this.motionY = Math.random() * 0.20000000298023224D + 0.10000000149011612D; + this.motionZ *= 0.30000001192092896D; + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(19 + this.rand.nextInt(4)); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + + if (this.onGround) + { + if (Math.random() < 0.5D) + { + this.setDead(); + } + + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + BlockPos blockpos = new BlockPos(this); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + block.setBlockBoundsBasedOnState(this.worldObj, blockpos); + Material material = iblockstate.getBlock().getMaterial(); + + if (material.isLiquid() || material.isSolid()) + { + double d0 = 0.0D; + + if (iblockstate.getBlock() instanceof BlockLiquid) + { + d0 = (double)(1.0F - BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue())); + } + else + { + d0 = block.getBlockBoundsMaxY(); + } + + double d1 = (double)MathHelper.floor_double(this.posY) + d0; + + if (this.posY < d1) + { + this.setDead(); + } + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityRainFX(worldIn, xCoordIn, yCoordIn, zCoordIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityReddustFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityReddustFX.java new file mode 100644 index 0000000..2cf6152 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntityReddustFX.java @@ -0,0 +1,87 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityReddustFX extends EntityFX +{ + float reddustParticleScale; + + protected EntityReddustFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, float p_i46349_8_, float p_i46349_9_, float p_i46349_10_) + { + this(worldIn, xCoordIn, yCoordIn, zCoordIn, 1.0F, p_i46349_8_, p_i46349_9_, p_i46349_10_); + } + + protected EntityReddustFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, float p_i46350_8_, float p_i46350_9_, float p_i46350_10_, float p_i46350_11_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + + if (p_i46350_9_ == 0.0F) + { + p_i46350_9_ = 1.0F; + } + + float f = (float)Math.random() * 0.4F + 0.6F; + this.particleRed = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i46350_9_ * f; + this.particleGreen = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i46350_10_ * f; + this.particleBlue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i46350_11_ * f; + this.particleScale *= 0.75F; + this.particleScale *= p_i46350_8_; + this.reddustParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i46350_8_); + this.noClip = false; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + this.particleScale = this.reddustParticleScale * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntityReddustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, (float)xSpeedIn, (float)ySpeedIn, (float)zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java new file mode 100644 index 0000000..d3fb8b0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java @@ -0,0 +1,82 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySmokeFX extends EntityFX +{ + float smokeParticleScale; + + private EntitySmokeFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46347_8_, double p_i46347_10_, double p_i46347_12_) + { + this(worldIn, xCoordIn, yCoordIn, zCoordIn, p_i46347_8_, p_i46347_10_, p_i46347_12_, 1.0F); + } + + protected EntitySmokeFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i46348_8_, double p_i46348_10_, double p_i46348_12_, float p_i46348_14_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i46348_8_; + this.motionY += p_i46348_10_; + this.motionZ += p_i46348_12_; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= p_i46348_14_; + this.smokeParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i46348_14_); + this.noClip = false; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + this.particleScale = this.smokeParticleScale * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntitySmokeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java new file mode 100644 index 0000000..63f189f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java @@ -0,0 +1,75 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySnowShovelFX extends EntityFX +{ + float snowDigParticleScale; + + protected EntitySnowShovelFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + this(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, 1.0F); + } + + protected EntitySnowShovelFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, float p_i1228_14_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += xSpeedIn; + this.motionY += ySpeedIn; + this.motionZ += zSpeedIn; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= p_i1228_14_; + this.snowDigParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1228_14_); + this.noClip = false; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + this.particleScale = this.snowDigParticleScale * f; + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.9900000095367432D; + this.motionZ *= 0.9900000095367432D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntitySnowShovelFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java new file mode 100644 index 0000000..e21fabc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java @@ -0,0 +1,124 @@ +package net.minecraft.client.particle; + +import java.util.Random; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySpellParticleFX extends EntityFX +{ + private static final Random RANDOM = new Random(); + private int baseSpellTextureIndex = 128; + + protected EntitySpellParticleFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i1229_8_, double p_i1229_10_, double p_i1229_12_) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.5D - RANDOM.nextDouble(), p_i1229_10_, 0.5D - RANDOM.nextDouble()); + this.motionY *= 0.20000000298023224D; + + if (p_i1229_8_ == 0.0D && p_i1229_12_ == 0.0D) + { + this.motionX *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + } + + this.particleScale *= 0.75F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + float f = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public void setBaseSpellTextureIndex(int baseSpellTextureIndexIn) + { + this.baseSpellTextureIndex = baseSpellTextureIndexIn; + } + + public static class AmbientMobFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + entityfx.setAlphaF(0.15F); + entityfx.setRBGColorF((float)xSpeedIn, (float)ySpeedIn, (float)zSpeedIn); + return entityfx; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } + + public static class InstantFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + ((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144); + return entityfx; + } + } + + public static class MobFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + entityfx.setRBGColorF((float)xSpeedIn, (float)ySpeedIn, (float)zSpeedIn); + return entityfx; + } + } + + public static class WitchFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX entityfx = new EntitySpellParticleFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + ((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144); + float f = worldIn.rand.nextFloat() * 0.5F + 0.35F; + entityfx.setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f); + return entityfx; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySplashFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySplashFX.java new file mode 100644 index 0000000..17c9b3b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySplashFX.java @@ -0,0 +1,28 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntitySplashFX extends EntityRainFX +{ + protected EntitySplashFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn); + this.particleGravity = 0.04F; + this.nextTextureIndexX(); + + if (ySpeedIn == 0.0D && (xSpeedIn != 0.0D || zSpeedIn != 0.0D)) + { + this.motionX = xSpeedIn; + this.motionY = ySpeedIn + 0.1D; + this.motionZ = zSpeedIn; + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntitySplashFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java new file mode 100644 index 0000000..63a833b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java @@ -0,0 +1,49 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.material.Material; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntitySuspendFX extends EntityFX +{ + protected EntitySuspendFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) + { + super(worldIn, xCoordIn, yCoordIn - 0.125D, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + this.particleRed = 0.4F; + this.particleGreen = 0.4F; + this.particleBlue = 0.7F; + this.setParticleTextureIndex(0); + this.setSize(0.01F, 0.01F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; + this.motionX = xSpeedIn * 0.0D; + this.motionY = ySpeedIn * 0.0D; + this.motionZ = zSpeedIn * 0.0D; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() != Material.water) + { + this.setDead(); + } + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new EntitySuspendFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/IParticleFactory.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/IParticleFactory.java new file mode 100644 index 0000000..6f850b1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/IParticleFactory.java @@ -0,0 +1,8 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public interface IParticleFactory +{ + EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/particle/MobAppearance.java b/Client-1.8.9/src/main/java/net/minecraft/client/particle/MobAppearance.java new file mode 100644 index 0000000..a40b40e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/particle/MobAppearance.java @@ -0,0 +1,81 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class MobAppearance extends EntityFX +{ + private EntityLivingBase entity; + + protected MobAppearance(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn) + { + super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.motionX = this.motionY = this.motionZ = 0.0D; + this.particleGravity = 0.0F; + this.particleMaxAge = 30; + } + + public int getFXLayer() + { + return 3; + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.entity == null) + { + EntityGuardian entityguardian = new EntityGuardian(this.worldObj); + entityguardian.setElder(); + this.entity = entityguardian; + } + } + + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + if (this.entity != null) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + rendermanager.setRenderPosition(EntityFX.interpPosX, EntityFX.interpPosY, EntityFX.interpPosZ); + float f = 0.42553192F; + float f1 = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge; + GlStateManager.depthMask(true); + GlStateManager.enableBlend(); + GlStateManager.enableDepth(); + GlStateManager.blendFunc(770, 771); + float f2 = 240.0F; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f2, f2); + GlStateManager.pushMatrix(); + float f3 = 0.05F + 0.5F * MathHelper.sin(f1 * (float)Math.PI); + GlStateManager.color(1.0F, 1.0F, 1.0F, f3); + GlStateManager.translate(0.0F, 1.8F, 0.0F); + GlStateManager.rotate(180.0F - entityIn.rotationYaw, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(60.0F - 150.0F * f1 - entityIn.rotationPitch, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0.0F, -0.4F, -1.5F); + GlStateManager.scale(f, f, f); + this.entity.rotationYaw = this.entity.prevRotationYaw = 0.0F; + this.entity.rotationYawHead = this.entity.prevRotationYawHead = 0.0F; + rendermanager.renderEntityWithPosYaw(this.entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks); + GlStateManager.popMatrix(); + GlStateManager.enableDepth(); + } + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new MobAppearance(worldIn, xCoordIn, yCoordIn, zCoordIn); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/player/inventory/ContainerLocalMenu.java b/Client-1.8.9/src/main/java/net/minecraft/client/player/inventory/ContainerLocalMenu.java new file mode 100644 index 0000000..aa3dd2b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/player/inventory/ContainerLocalMenu.java @@ -0,0 +1,62 @@ +package net.minecraft.client.player.inventory; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.LockCode; + +public class ContainerLocalMenu extends InventoryBasic implements ILockableContainer +{ + private String guiID; + private Map field_174895_b = Maps.newHashMap(); + + public ContainerLocalMenu(String id, IChatComponent title, int slotCount) + { + super(title, slotCount); + this.guiID = id; + } + + public int getField(int id) + { + return this.field_174895_b.containsKey(Integer.valueOf(id)) ? ((Integer)this.field_174895_b.get(Integer.valueOf(id))).intValue() : 0; + } + + public void setField(int id, int value) + { + this.field_174895_b.put(Integer.valueOf(id), Integer.valueOf(value)); + } + + public int getFieldCount() + { + return this.field_174895_b.size(); + } + + public boolean isLocked() + { + return false; + } + + public void setLockCode(LockCode code) + { + } + + public LockCode getLockCode() + { + return LockCode.EMPTY_CODE; + } + + public String getGuiID() + { + return this.guiID; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + throw new UnsupportedOperationException(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/player/inventory/LocalBlockIntercommunication.java b/Client-1.8.9/src/main/java/net/minecraft/client/player/inventory/LocalBlockIntercommunication.java new file mode 100644 index 0000000..d055e55 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/player/inventory/LocalBlockIntercommunication.java @@ -0,0 +1,44 @@ +package net.minecraft.client.player.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.IInteractionObject; + +public class LocalBlockIntercommunication implements IInteractionObject +{ + private String guiID; + private IChatComponent displayName; + + public LocalBlockIntercommunication(String guiIdIn, IChatComponent displayNameIn) + { + this.guiID = guiIdIn; + this.displayName = displayNameIn; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + throw new UnsupportedOperationException(); + } + + public String getName() + { + return this.displayName.getUnformattedText(); + } + + public boolean hasCustomName() + { + return true; + } + + public String getGuiID() + { + return this.guiID; + } + + public IChatComponent getDisplayName() + { + return this.displayName; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java new file mode 100644 index 0000000..cddccdd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java @@ -0,0 +1,116 @@ +package net.minecraft.client.renderer; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +public class ActiveRenderInfo +{ + private static final IntBuffer VIEWPORT = GLAllocation.createDirectIntBuffer(16); + private static final FloatBuffer MODELVIEW = GLAllocation.createDirectFloatBuffer(16); + private static final FloatBuffer PROJECTION = GLAllocation.createDirectFloatBuffer(16); + private static final FloatBuffer OBJECTCOORDS = GLAllocation.createDirectFloatBuffer(3); + private static Vec3 position = new Vec3(0.0D, 0.0D, 0.0D); + private static float rotationX; + private static float rotationXZ; + private static float rotationZ; + private static float rotationYZ; + private static float rotationXY; + + public static void updateRenderInfo(EntityPlayer entityplayerIn, boolean p_74583_1_) + { + GlStateManager.getFloat(2982, MODELVIEW); + GlStateManager.getFloat(2983, PROJECTION); + GL11.glGetInteger(GL11.GL_VIEWPORT, VIEWPORT); + float f = (float)((VIEWPORT.get(0) + VIEWPORT.get(2)) / 2); + float f1 = (float)((VIEWPORT.get(1) + VIEWPORT.get(3)) / 2); + GLU.gluUnProject(f, f1, 0.0F, MODELVIEW, PROJECTION, VIEWPORT, OBJECTCOORDS); + position = new Vec3((double)OBJECTCOORDS.get(0), (double)OBJECTCOORDS.get(1), (double)OBJECTCOORDS.get(2)); + int i = p_74583_1_ ? 1 : 0; + float f2 = entityplayerIn.rotationPitch; + float f3 = entityplayerIn.rotationYaw; + rotationX = MathHelper.cos(f3 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationZ = MathHelper.sin(f3 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationYZ = -rotationZ * MathHelper.sin(f2 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationXY = rotationX * MathHelper.sin(f2 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationXZ = MathHelper.cos(f2 * (float)Math.PI / 180.0F); + } + + public static Vec3 projectViewFromEntity(Entity p_178806_0_, double p_178806_1_) + { + double d0 = p_178806_0_.prevPosX + (p_178806_0_.posX - p_178806_0_.prevPosX) * p_178806_1_; + double d1 = p_178806_0_.prevPosY + (p_178806_0_.posY - p_178806_0_.prevPosY) * p_178806_1_; + double d2 = p_178806_0_.prevPosZ + (p_178806_0_.posZ - p_178806_0_.prevPosZ) * p_178806_1_; + double d3 = d0 + position.xCoord; + double d4 = d1 + position.yCoord; + double d5 = d2 + position.zCoord; + return new Vec3(d3, d4, d5); + } + + public static Block getBlockAtEntityViewpoint(World worldIn, Entity p_180786_1_, float p_180786_2_) + { + Vec3 vec3 = projectViewFromEntity(p_180786_1_, (double)p_180786_2_); + BlockPos blockpos = new BlockPos(vec3); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (block.getMaterial().isLiquid()) + { + float f = 0.0F; + + if (iblockstate.getBlock() instanceof BlockLiquid) + { + f = BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue()) - 0.11111111F; + } + + float f1 = (float)(blockpos.getY() + 1) - f; + + if (vec3.yCoord >= (double)f1) + { + block = worldIn.getBlockState(blockpos.up()).getBlock(); + } + } + + return block; + } + + public static Vec3 getPosition() + { + return position; + } + + public static float getRotationX() + { + return rotationX; + } + + public static float getRotationXZ() + { + return rotationXZ; + } + + public static float getRotationZ() + { + return rotationZ; + } + + public static float getRotationYZ() + { + return rotationYZ; + } + + public static float getRotationXY() + { + return rotationXY; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockFluidRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockFluidRenderer.java new file mode 100644 index 0000000..6a89377 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockFluidRenderer.java @@ -0,0 +1,330 @@ +package net.minecraft.client.renderer; + +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.FaceBakery; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.optifine.CustomColors; +import net.optifine.render.RenderEnv; +import net.optifine.shaders.SVertexBuilder; + +public class BlockFluidRenderer +{ + private TextureAtlasSprite[] atlasSpritesLava = new TextureAtlasSprite[2]; + private TextureAtlasSprite[] atlasSpritesWater = new TextureAtlasSprite[2]; + + public BlockFluidRenderer() + { + this.initAtlasSprites(); + } + + protected void initAtlasSprites() + { + TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks(); + this.atlasSpritesLava[0] = texturemap.getAtlasSprite("minecraft:blocks/lava_still"); + this.atlasSpritesLava[1] = texturemap.getAtlasSprite("minecraft:blocks/lava_flow"); + this.atlasSpritesWater[0] = texturemap.getAtlasSprite("minecraft:blocks/water_still"); + this.atlasSpritesWater[1] = texturemap.getAtlasSprite("minecraft:blocks/water_flow"); + } + + public boolean renderFluid(IBlockAccess blockAccess, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn) + { + boolean flag2; + + try + { + if (Config.isShaders()) + { + SVertexBuilder.pushEntity(blockStateIn, blockPosIn, blockAccess, worldRendererIn); + } + + BlockLiquid blockliquid = (BlockLiquid)blockStateIn.getBlock(); + blockliquid.setBlockBoundsBasedOnState(blockAccess, blockPosIn); + TextureAtlasSprite[] atextureatlassprite = blockliquid.getMaterial() == Material.lava ? this.atlasSpritesLava : this.atlasSpritesWater; + RenderEnv renderenv = worldRendererIn.getRenderEnv(blockStateIn, blockPosIn); + int i = CustomColors.getFluidColor(blockAccess, blockStateIn, blockPosIn, renderenv); + float f = (float)(i >> 16 & 255) / 255.0F; + float f1 = (float)(i >> 8 & 255) / 255.0F; + float f2 = (float)(i & 255) / 255.0F; + boolean flag = blockliquid.shouldSideBeRendered(blockAccess, blockPosIn.up(), EnumFacing.UP); + boolean flag1 = blockliquid.shouldSideBeRendered(blockAccess, blockPosIn.down(), EnumFacing.DOWN); + boolean[] aboolean = renderenv.getBorderFlags(); + aboolean[0] = blockliquid.shouldSideBeRendered(blockAccess, blockPosIn.north(), EnumFacing.NORTH); + aboolean[1] = blockliquid.shouldSideBeRendered(blockAccess, blockPosIn.south(), EnumFacing.SOUTH); + aboolean[2] = blockliquid.shouldSideBeRendered(blockAccess, blockPosIn.west(), EnumFacing.WEST); + aboolean[3] = blockliquid.shouldSideBeRendered(blockAccess, blockPosIn.east(), EnumFacing.EAST); + + if (flag || flag1 || aboolean[0] || aboolean[1] || aboolean[2] || aboolean[3]) + { + flag2 = false; + float f3 = 0.5F; + float f4 = 1.0F; + float f5 = 0.8F; + float f6 = 0.6F; + Material material = blockliquid.getMaterial(); + float f7 = this.getFluidHeight(blockAccess, blockPosIn, material); + float f8 = this.getFluidHeight(blockAccess, blockPosIn.south(), material); + float f9 = this.getFluidHeight(blockAccess, blockPosIn.east().south(), material); + float f10 = this.getFluidHeight(blockAccess, blockPosIn.east(), material); + double d0 = (double)blockPosIn.getX(); + double d1 = (double)blockPosIn.getY(); + double d2 = (double)blockPosIn.getZ(); + float f11 = 0.001F; + + if (flag) + { + flag2 = true; + TextureAtlasSprite textureatlassprite = atextureatlassprite[0]; + float f12 = (float)BlockLiquid.getFlowDirection(blockAccess, blockPosIn, material); + + if (f12 > -999.0F) + { + textureatlassprite = atextureatlassprite[1]; + } + + worldRendererIn.setSprite(textureatlassprite); + f7 -= f11; + f8 -= f11; + f9 -= f11; + f10 -= f11; + float f13; + float f14; + float f15; + float f16; + float f17; + float f18; + float f19; + float f20; + + if (f12 < -999.0F) + { + f13 = textureatlassprite.getInterpolatedU(0.0D); + f17 = textureatlassprite.getInterpolatedV(0.0D); + f14 = f13; + f18 = textureatlassprite.getInterpolatedV(16.0D); + f15 = textureatlassprite.getInterpolatedU(16.0D); + f19 = f18; + f16 = f15; + f20 = f17; + } + else + { + float f21 = MathHelper.sin(f12) * 0.25F; + float f22 = MathHelper.cos(f12) * 0.25F; + float f23 = 8.0F; + f13 = textureatlassprite.getInterpolatedU((double)(8.0F + (-f22 - f21) * 16.0F)); + f17 = textureatlassprite.getInterpolatedV((double)(8.0F + (-f22 + f21) * 16.0F)); + f14 = textureatlassprite.getInterpolatedU((double)(8.0F + (-f22 + f21) * 16.0F)); + f18 = textureatlassprite.getInterpolatedV((double)(8.0F + (f22 + f21) * 16.0F)); + f15 = textureatlassprite.getInterpolatedU((double)(8.0F + (f22 + f21) * 16.0F)); + f19 = textureatlassprite.getInterpolatedV((double)(8.0F + (f22 - f21) * 16.0F)); + f16 = textureatlassprite.getInterpolatedU((double)(8.0F + (f22 - f21) * 16.0F)); + f20 = textureatlassprite.getInterpolatedV((double)(8.0F + (-f22 - f21) * 16.0F)); + } + + int k2 = blockliquid.getMixedBrightnessForBlock(blockAccess, blockPosIn); + int l2 = k2 >> 16 & 65535; + int i3 = k2 & 65535; + float f24 = f4 * f; + float f25 = f4 * f1; + float f26 = f4 * f2; + worldRendererIn.pos(d0 + 0.0D, d1 + (double)f7, d2 + 0.0D).color(f24, f25, f26, 1.0F).tex((double)f13, (double)f17).lightmap(l2, i3).endVertex(); + worldRendererIn.pos(d0 + 0.0D, d1 + (double)f8, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f14, (double)f18).lightmap(l2, i3).endVertex(); + worldRendererIn.pos(d0 + 1.0D, d1 + (double)f9, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f15, (double)f19).lightmap(l2, i3).endVertex(); + worldRendererIn.pos(d0 + 1.0D, d1 + (double)f10, d2 + 0.0D).color(f24, f25, f26, 1.0F).tex((double)f16, (double)f20).lightmap(l2, i3).endVertex(); + + if (blockliquid.shouldRenderSides(blockAccess, blockPosIn.up())) + { + worldRendererIn.pos(d0 + 0.0D, d1 + (double)f7, d2 + 0.0D).color(f24, f25, f26, 1.0F).tex((double)f13, (double)f17).lightmap(l2, i3).endVertex(); + worldRendererIn.pos(d0 + 1.0D, d1 + (double)f10, d2 + 0.0D).color(f24, f25, f26, 1.0F).tex((double)f16, (double)f20).lightmap(l2, i3).endVertex(); + worldRendererIn.pos(d0 + 1.0D, d1 + (double)f9, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f15, (double)f19).lightmap(l2, i3).endVertex(); + worldRendererIn.pos(d0 + 0.0D, d1 + (double)f8, d2 + 1.0D).color(f24, f25, f26, 1.0F).tex((double)f14, (double)f18).lightmap(l2, i3).endVertex(); + } + } + + if (flag1) + { + worldRendererIn.setSprite(atextureatlassprite[0]); + float f35 = atextureatlassprite[0].getMinU(); + float f36 = atextureatlassprite[0].getMaxU(); + float f37 = atextureatlassprite[0].getMinV(); + float f38 = atextureatlassprite[0].getMaxV(); + int l1 = blockliquid.getMixedBrightnessForBlock(blockAccess, blockPosIn.down()); + int i2 = l1 >> 16 & 65535; + int j2 = l1 & 65535; + float f41 = FaceBakery.getFaceBrightness(EnumFacing.DOWN); + worldRendererIn.pos(d0, d1, d2 + 1.0D).color(f * f41, f1 * f41, f2 * f41, 1.0F).tex((double)f35, (double)f38).lightmap(i2, j2).endVertex(); + worldRendererIn.pos(d0, d1, d2).color(f * f41, f1 * f41, f2 * f41, 1.0F).tex((double)f35, (double)f37).lightmap(i2, j2).endVertex(); + worldRendererIn.pos(d0 + 1.0D, d1, d2).color(f * f41, f1 * f41, f2 * f41, 1.0F).tex((double)f36, (double)f37).lightmap(i2, j2).endVertex(); + worldRendererIn.pos(d0 + 1.0D, d1, d2 + 1.0D).color(f * f41, f1 * f41, f2 * f41, 1.0F).tex((double)f36, (double)f38).lightmap(i2, j2).endVertex(); + flag2 = true; + } + + for (int i1 = 0; i1 < 4; ++i1) + { + int j1 = 0; + int k1 = 0; + + if (i1 == 0) + { + --k1; + } + + if (i1 == 1) + { + ++k1; + } + + if (i1 == 2) + { + --j1; + } + + if (i1 == 3) + { + ++j1; + } + + BlockPos blockpos = blockPosIn.add(j1, 0, k1); + TextureAtlasSprite textureatlassprite1 = atextureatlassprite[1]; + worldRendererIn.setSprite(textureatlassprite1); + + if (aboolean[i1]) + { + float f39; + float f40; + double d3; + double d4; + double d5; + double d6; + + if (i1 == 0) + { + f39 = f7; + f40 = f10; + d3 = d0; + d5 = d0 + 1.0D; + d4 = d2 + (double)f11; + d6 = d2 + (double)f11; + } + else if (i1 == 1) + { + f39 = f9; + f40 = f8; + d3 = d0 + 1.0D; + d5 = d0; + d4 = d2 + 1.0D - (double)f11; + d6 = d2 + 1.0D - (double)f11; + } + else if (i1 == 2) + { + f39 = f8; + f40 = f7; + d3 = d0 + (double)f11; + d5 = d0 + (double)f11; + d4 = d2 + 1.0D; + d6 = d2; + } + else + { + f39 = f10; + f40 = f9; + d3 = d0 + 1.0D - (double)f11; + d5 = d0 + 1.0D - (double)f11; + d4 = d2; + d6 = d2 + 1.0D; + } + + flag2 = true; + float f42 = textureatlassprite1.getInterpolatedU(0.0D); + float f27 = textureatlassprite1.getInterpolatedU(8.0D); + float f28 = textureatlassprite1.getInterpolatedV((double)((1.0F - f39) * 16.0F * 0.5F)); + float f29 = textureatlassprite1.getInterpolatedV((double)((1.0F - f40) * 16.0F * 0.5F)); + float f30 = textureatlassprite1.getInterpolatedV(8.0D); + int j = blockliquid.getMixedBrightnessForBlock(blockAccess, blockpos); + int k = j >> 16 & 65535; + int l = j & 65535; + float f31 = i1 < 2 ? FaceBakery.getFaceBrightness(EnumFacing.NORTH) : FaceBakery.getFaceBrightness(EnumFacing.WEST); + float f32 = f4 * f31 * f; + float f33 = f4 * f31 * f1; + float f34 = f4 * f31 * f2; + worldRendererIn.pos(d3, d1 + (double)f39, d4).color(f32, f33, f34, 1.0F).tex((double)f42, (double)f28).lightmap(k, l).endVertex(); + worldRendererIn.pos(d5, d1 + (double)f40, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f29).lightmap(k, l).endVertex(); + worldRendererIn.pos(d5, d1 + 0.0D, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f30).lightmap(k, l).endVertex(); + worldRendererIn.pos(d3, d1 + 0.0D, d4).color(f32, f33, f34, 1.0F).tex((double)f42, (double)f30).lightmap(k, l).endVertex(); + worldRendererIn.pos(d3, d1 + 0.0D, d4).color(f32, f33, f34, 1.0F).tex((double)f42, (double)f30).lightmap(k, l).endVertex(); + worldRendererIn.pos(d5, d1 + 0.0D, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f30).lightmap(k, l).endVertex(); + worldRendererIn.pos(d5, d1 + (double)f40, d6).color(f32, f33, f34, 1.0F).tex((double)f27, (double)f29).lightmap(k, l).endVertex(); + worldRendererIn.pos(d3, d1 + (double)f39, d4).color(f32, f33, f34, 1.0F).tex((double)f42, (double)f28).lightmap(k, l).endVertex(); + } + } + + worldRendererIn.setSprite((TextureAtlasSprite)null); + boolean flag3 = flag2; + return flag3; + } + + flag2 = false; + } + finally + { + if (Config.isShaders()) + { + SVertexBuilder.popEntity(worldRendererIn); + } + } + + return flag2; + } + + private float getFluidHeight(IBlockAccess blockAccess, BlockPos blockPosIn, Material blockMaterial) + { + int i = 0; + float f = 0.0F; + + for (int j = 0; j < 4; ++j) + { + BlockPos blockpos = blockPosIn.add(-(j & 1), 0, -(j >> 1 & 1)); + + if (blockAccess.getBlockState(blockpos.up()).getBlock().getMaterial() == blockMaterial) + { + return 1.0F; + } + + IBlockState iblockstate = blockAccess.getBlockState(blockpos); + Material material = iblockstate.getBlock().getMaterial(); + + if (material != blockMaterial) + { + if (!material.isSolid()) + { + ++f; + ++i; + } + } + else + { + int k = ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue(); + + if (k >= 8 || k == 0) + { + f += BlockLiquid.getLiquidHeightPercent(k) * 10.0F; + i += 10; + } + + f += BlockLiquid.getLiquidHeightPercent(k); + ++i; + } + } + + return 1.0F - f / (float)i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockModelRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockModelRenderer.java new file mode 100644 index 0000000..423e3f6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockModelRenderer.java @@ -0,0 +1,895 @@ +package net.minecraft.client.renderer; + +import java.util.BitSet; +import java.util.List; +import java.util.Objects; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.block.*; +import net.minecraft.block.Block.EnumOffsetType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Vec3i; +import net.minecraft.world.IBlockAccess; +import net.optifine.BetterSnow; +import net.optifine.CustomColors; +import net.optifine.model.BlockModelCustomizer; +import net.optifine.model.ListQuadsOverlay; +import net.optifine.reflect.Reflector; +import net.optifine.render.RenderEnv; +import net.optifine.shaders.SVertexBuilder; +import net.optifine.shaders.Shaders; + +public class BlockModelRenderer +{ + private static float aoLightValueOpaque = 0.2F; + private static boolean separateAoLightValue = false; + private static final EnumWorldBlockLayer[] OVERLAY_LAYERS = new EnumWorldBlockLayer[] {EnumWorldBlockLayer.CUTOUT, EnumWorldBlockLayer.CUTOUT_MIPPED, EnumWorldBlockLayer.TRANSLUCENT}; + + public BlockModelRenderer() + { + if (Reflector.ForgeModContainer_forgeLightPipelineEnabled.exists()) + { + Reflector.setFieldValue(Reflector.ForgeModContainer_forgeLightPipelineEnabled, Boolean.valueOf(false)); + } + } + + public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn) + { + Block block = blockStateIn.getBlock(); + block.setBlockBoundsBasedOnState(blockAccessIn, blockPosIn); + return this.renderModel(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, true); + } + + public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) + { + boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion(); + + String string = (String) CheatBreaker.getInstance().getModuleManager().packTweaksMod.clearGlass.getValue(); + if (!Objects.equals(string, "NO") && (blockStateIn.getBlock() instanceof BlockGlass ? string.equals("REGULAR") || string.equals("ALL") : blockStateIn.getBlock() instanceof BlockStainedGlass && string.equals("ALL"))) { + return false; + } + + boolean foiliageEnabled = CheatBreaker.getInstance().getGlobalSettings().hideFoliage.getBooleanValue(); + + //if more things need to be added here then I'll add them but this looks pretty good + if (foiliageEnabled) { + if ( + blockStateIn.getBlock() instanceof BlockTallGrass + || blockStateIn.getBlock() instanceof BlockDeadBush + || blockStateIn.getBlock() instanceof BlockBush + ) + { + return false; + } + } + + try + { + if (Config.isShaders()) + { + SVertexBuilder.pushEntity(blockStateIn, blockPosIn, blockAccessIn, worldRendererIn); + } + + RenderEnv renderenv = worldRendererIn.getRenderEnv(blockStateIn, blockPosIn); + modelIn = BlockModelCustomizer.getRenderModel(modelIn, blockStateIn, renderenv); + boolean flag1 = flag ? this.renderModelSmooth(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides) : this.renderModelFlat(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides); + + if (flag1) + { + this.renderOverlayModels(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides, 0L, renderenv, flag); + } + + if (Config.isShaders()) + { + SVertexBuilder.popEntity(worldRendererIn); + } + + return flag1; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated"); + CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn); + crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag)); + throw new ReportedException(crashreport); + } + } + + public boolean renderModelAmbientOcclusion(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) + { + IBlockState iblockstate = blockAccessIn.getBlockState(blockPosIn); + return this.renderModelSmooth(blockAccessIn, modelIn, iblockstate, blockPosIn, worldRendererIn, checkSides); + } + + private boolean renderModelSmooth(IBlockAccess p_renderModelSmooth_1_, IBakedModel p_renderModelSmooth_2_, IBlockState p_renderModelSmooth_3_, BlockPos p_renderModelSmooth_4_, WorldRenderer p_renderModelSmooth_5_, boolean p_renderModelSmooth_6_) + { + boolean flag = false; + Block block = p_renderModelSmooth_3_.getBlock(); + RenderEnv renderenv = p_renderModelSmooth_5_.getRenderEnv(p_renderModelSmooth_3_, p_renderModelSmooth_4_); + EnumWorldBlockLayer enumworldblocklayer = p_renderModelSmooth_5_.getBlockLayer(); + + for (EnumFacing enumfacing : EnumFacing.VALUES) + { + List list = p_renderModelSmooth_2_.getFaceQuads(enumfacing); + + if (!list.isEmpty()) + { + BlockPos blockpos = p_renderModelSmooth_4_.offset(enumfacing); + + if (!p_renderModelSmooth_6_ || block.shouldSideBeRendered(p_renderModelSmooth_1_, blockpos, enumfacing)) + { + list = BlockModelCustomizer.getRenderQuads(list, p_renderModelSmooth_1_, p_renderModelSmooth_3_, p_renderModelSmooth_4_, enumfacing, enumworldblocklayer, 0L, renderenv); + this.renderQuadsSmooth(p_renderModelSmooth_1_, p_renderModelSmooth_3_, p_renderModelSmooth_4_, p_renderModelSmooth_5_, list, renderenv); + flag = true; + } + } + } + + List list1 = p_renderModelSmooth_2_.getGeneralQuads(); + + if (list1.size() > 0) + { + list1 = BlockModelCustomizer.getRenderQuads(list1, p_renderModelSmooth_1_, p_renderModelSmooth_3_, p_renderModelSmooth_4_, (EnumFacing)null, enumworldblocklayer, 0L, renderenv); + this.renderQuadsSmooth(p_renderModelSmooth_1_, p_renderModelSmooth_3_, p_renderModelSmooth_4_, p_renderModelSmooth_5_, list1, renderenv); + flag = true; + } + + return flag; + } + + public boolean renderModelStandard(IBlockAccess blockAccessIn, IBakedModel modelIn, Block blockIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides) + { + IBlockState iblockstate = blockAccessIn.getBlockState(blockPosIn); + return this.renderModelFlat(blockAccessIn, modelIn, iblockstate, blockPosIn, worldRendererIn, checkSides); + } + + public boolean renderModelFlat(IBlockAccess p_renderModelFlat_1_, IBakedModel p_renderModelFlat_2_, IBlockState p_renderModelFlat_3_, BlockPos p_renderModelFlat_4_, WorldRenderer p_renderModelFlat_5_, boolean p_renderModelFlat_6_) + { + boolean flag = false; + Block block = p_renderModelFlat_3_.getBlock(); + RenderEnv renderenv = p_renderModelFlat_5_.getRenderEnv(p_renderModelFlat_3_, p_renderModelFlat_4_); + EnumWorldBlockLayer enumworldblocklayer = p_renderModelFlat_5_.getBlockLayer(); + + for (EnumFacing enumfacing : EnumFacing.VALUES) + { + List list = p_renderModelFlat_2_.getFaceQuads(enumfacing); + + if (!list.isEmpty()) + { + BlockPos blockpos = p_renderModelFlat_4_.offset(enumfacing); + + if (!p_renderModelFlat_6_ || block.shouldSideBeRendered(p_renderModelFlat_1_, blockpos, enumfacing)) + { + int i = block.getMixedBrightnessForBlock(p_renderModelFlat_1_, blockpos); + list = BlockModelCustomizer.getRenderQuads(list, p_renderModelFlat_1_, p_renderModelFlat_3_, p_renderModelFlat_4_, enumfacing, enumworldblocklayer, 0L, renderenv); + this.renderQuadsFlat(p_renderModelFlat_1_, p_renderModelFlat_3_, p_renderModelFlat_4_, enumfacing, i, false, p_renderModelFlat_5_, list, renderenv); + flag = true; + } + } + } + + List list1 = p_renderModelFlat_2_.getGeneralQuads(); + + if (list1.size() > 0) + { + list1 = BlockModelCustomizer.getRenderQuads(list1, p_renderModelFlat_1_, p_renderModelFlat_3_, p_renderModelFlat_4_, (EnumFacing)null, enumworldblocklayer, 0L, renderenv); + this.renderQuadsFlat(p_renderModelFlat_1_, p_renderModelFlat_3_, p_renderModelFlat_4_, (EnumFacing)null, -1, true, p_renderModelFlat_5_, list1, renderenv); + flag = true; + } + + return flag; + } + + private void renderQuadsSmooth(IBlockAccess p_renderQuadsSmooth_1_, IBlockState p_renderQuadsSmooth_2_, BlockPos p_renderQuadsSmooth_3_, WorldRenderer p_renderQuadsSmooth_4_, List p_renderQuadsSmooth_5_, RenderEnv p_renderQuadsSmooth_6_) + { + Block block = p_renderQuadsSmooth_2_.getBlock(); + float[] afloat = p_renderQuadsSmooth_6_.getQuadBounds(); + BitSet bitset = p_renderQuadsSmooth_6_.getBoundsFlags(); + BlockModelRenderer.AmbientOcclusionFace blockmodelrenderer$ambientocclusionface = p_renderQuadsSmooth_6_.getAoFace(); + double d0 = (double)p_renderQuadsSmooth_3_.getX(); + double d1 = (double)p_renderQuadsSmooth_3_.getY(); + double d2 = (double)p_renderQuadsSmooth_3_.getZ(); + EnumOffsetType enumoffsettype = block.getOffsetType(); + + if (enumoffsettype != EnumOffsetType.NONE) + { + long i = MathHelper.getPositionRandom(p_renderQuadsSmooth_3_); + d0 += ((double)((float)(i >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; + d2 += ((double)((float)(i >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; + + if (enumoffsettype == EnumOffsetType.XYZ) + { + d1 += ((double)((float)(i >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; + } + } + + for (BakedQuad bakedquad : p_renderQuadsSmooth_5_) + { + this.fillQuadBounds(block, bakedquad.getVertexData(), bakedquad.getFace(), afloat, bitset); + blockmodelrenderer$ambientocclusionface.updateVertexBrightness(p_renderQuadsSmooth_1_, block, p_renderQuadsSmooth_3_, bakedquad.getFace(), afloat, bitset); + + if (bakedquad.getSprite().isEmissive) + { + blockmodelrenderer$ambientocclusionface.setMaxBlockLight(); + } + + if (p_renderQuadsSmooth_4_.isMultiTexture()) + { + p_renderQuadsSmooth_4_.addVertexData(bakedquad.getVertexDataSingle()); + } + else + { + p_renderQuadsSmooth_4_.addVertexData(bakedquad.getVertexData()); + } + + p_renderQuadsSmooth_4_.putSprite(bakedquad.getSprite()); + p_renderQuadsSmooth_4_.putBrightness4(blockmodelrenderer$ambientocclusionface.vertexBrightness[0], blockmodelrenderer$ambientocclusionface.vertexBrightness[1], blockmodelrenderer$ambientocclusionface.vertexBrightness[2], blockmodelrenderer$ambientocclusionface.vertexBrightness[3]); + int j = CustomColors.getColorMultiplier(bakedquad, p_renderQuadsSmooth_2_, p_renderQuadsSmooth_1_, p_renderQuadsSmooth_3_, p_renderQuadsSmooth_6_); + + if (!bakedquad.hasTintIndex() && j == -1) + { + if (separateAoLightValue) + { + p_renderQuadsSmooth_4_.putColorMultiplierRgba(1.0F, 1.0F, 1.0F, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], 4); + p_renderQuadsSmooth_4_.putColorMultiplierRgba(1.0F, 1.0F, 1.0F, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], 3); + p_renderQuadsSmooth_4_.putColorMultiplierRgba(1.0F, 1.0F, 1.0F, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], 2); + p_renderQuadsSmooth_4_.putColorMultiplierRgba(1.0F, 1.0F, 1.0F, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], 1); + } + else + { + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], 4); + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], 3); + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], 2); + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], 1); + } + } + else + { + int k; + + if (j != -1) + { + k = j; + } + else + { + k = block.colorMultiplier(p_renderQuadsSmooth_1_, p_renderQuadsSmooth_3_, bakedquad.getTintIndex()); + } + + if (EntityRenderer.anaglyphEnable) + { + k = TextureUtil.anaglyphColor(k); + } + + float f = (float)(k >> 16 & 255) / 255.0F; + float f1 = (float)(k >> 8 & 255) / 255.0F; + float f2 = (float)(k & 255) / 255.0F; + + if (separateAoLightValue) + { + p_renderQuadsSmooth_4_.putColorMultiplierRgba(f, f1, f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0], 4); + p_renderQuadsSmooth_4_.putColorMultiplierRgba(f, f1, f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1], 3); + p_renderQuadsSmooth_4_.putColorMultiplierRgba(f, f1, f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2], 2); + p_renderQuadsSmooth_4_.putColorMultiplierRgba(f, f1, f2, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3], 1); + } + else + { + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0] * f, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[0] * f2, 4); + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1] * f, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[1] * f2, 3); + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2] * f, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[2] * f2, 2); + p_renderQuadsSmooth_4_.putColorMultiplier(blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3] * f, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3] * f1, blockmodelrenderer$ambientocclusionface.vertexColorMultiplier[3] * f2, 1); + } + } + + p_renderQuadsSmooth_4_.putPosition(d0, d1, d2); + } + } + + private void fillQuadBounds(Block blockIn, int[] vertexData, EnumFacing facingIn, float[] quadBounds, BitSet boundsFlags) + { + float f = 32.0F; + float f1 = 32.0F; + float f2 = 32.0F; + float f3 = -32.0F; + float f4 = -32.0F; + float f5 = -32.0F; + int i = vertexData.length / 4; + + for (int j = 0; j < 4; ++j) + { + float f6 = Float.intBitsToFloat(vertexData[j * i]); + float f7 = Float.intBitsToFloat(vertexData[j * i + 1]); + float f8 = Float.intBitsToFloat(vertexData[j * i + 2]); + f = Math.min(f, f6); + f1 = Math.min(f1, f7); + f2 = Math.min(f2, f8); + f3 = Math.max(f3, f6); + f4 = Math.max(f4, f7); + f5 = Math.max(f5, f8); + } + + if (quadBounds != null) + { + quadBounds[EnumFacing.WEST.getIndex()] = f; + quadBounds[EnumFacing.EAST.getIndex()] = f3; + quadBounds[EnumFacing.DOWN.getIndex()] = f1; + quadBounds[EnumFacing.UP.getIndex()] = f4; + quadBounds[EnumFacing.NORTH.getIndex()] = f2; + quadBounds[EnumFacing.SOUTH.getIndex()] = f5; + int k = EnumFacing.VALUES.length; + quadBounds[EnumFacing.WEST.getIndex() + k] = 1.0F - f; + quadBounds[EnumFacing.EAST.getIndex() + k] = 1.0F - f3; + quadBounds[EnumFacing.DOWN.getIndex() + k] = 1.0F - f1; + quadBounds[EnumFacing.UP.getIndex() + k] = 1.0F - f4; + quadBounds[EnumFacing.NORTH.getIndex() + k] = 1.0F - f2; + quadBounds[EnumFacing.SOUTH.getIndex() + k] = 1.0F - f5; + } + + float f9 = 1.0E-4F; + float f10 = 0.9999F; + + switch (facingIn) + { + case DOWN: + boundsFlags.set(1, f >= 1.0E-4F || f2 >= 1.0E-4F || f3 <= 0.9999F || f5 <= 0.9999F); + boundsFlags.set(0, (f1 < 1.0E-4F || blockIn.isFullCube()) && f1 == f4); + break; + + case UP: + boundsFlags.set(1, f >= 1.0E-4F || f2 >= 1.0E-4F || f3 <= 0.9999F || f5 <= 0.9999F); + boundsFlags.set(0, (f4 > 0.9999F || blockIn.isFullCube()) && f1 == f4); + break; + + case NORTH: + boundsFlags.set(1, f >= 1.0E-4F || f1 >= 1.0E-4F || f3 <= 0.9999F || f4 <= 0.9999F); + boundsFlags.set(0, (f2 < 1.0E-4F || blockIn.isFullCube()) && f2 == f5); + break; + + case SOUTH: + boundsFlags.set(1, f >= 1.0E-4F || f1 >= 1.0E-4F || f3 <= 0.9999F || f4 <= 0.9999F); + boundsFlags.set(0, (f5 > 0.9999F || blockIn.isFullCube()) && f2 == f5); + break; + + case WEST: + boundsFlags.set(1, f1 >= 1.0E-4F || f2 >= 1.0E-4F || f4 <= 0.9999F || f5 <= 0.9999F); + boundsFlags.set(0, (f < 1.0E-4F || blockIn.isFullCube()) && f == f3); + break; + + case EAST: + boundsFlags.set(1, f1 >= 1.0E-4F || f2 >= 1.0E-4F || f4 <= 0.9999F || f5 <= 0.9999F); + boundsFlags.set(0, (f3 > 0.9999F || blockIn.isFullCube()) && f == f3); + } + } + + private void renderQuadsFlat(IBlockAccess p_renderQuadsFlat_1_, IBlockState p_renderQuadsFlat_2_, BlockPos p_renderQuadsFlat_3_, EnumFacing p_renderQuadsFlat_4_, int p_renderQuadsFlat_5_, boolean p_renderQuadsFlat_6_, WorldRenderer p_renderQuadsFlat_7_, List p_renderQuadsFlat_8_, RenderEnv p_renderQuadsFlat_9_) + { + Block block = p_renderQuadsFlat_2_.getBlock(); + BitSet bitset = p_renderQuadsFlat_9_.getBoundsFlags(); + double d0 = (double)p_renderQuadsFlat_3_.getX(); + double d1 = (double)p_renderQuadsFlat_3_.getY(); + double d2 = (double)p_renderQuadsFlat_3_.getZ(); + Block.EnumOffsetType enumoffsettype = block.getOffsetType(); + + if (enumoffsettype != Block.EnumOffsetType.NONE) + { + int i = p_renderQuadsFlat_3_.getX(); + int j = p_renderQuadsFlat_3_.getZ(); + long k = (long)(i * 3129871) ^ (long)j * 116129781L; + k = k * k * 42317861L + k * 11L; + d0 += ((double)((float)(k >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; + d2 += ((double)((float)(k >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; + + if (enumoffsettype == EnumOffsetType.XYZ) + { + d1 += ((double)((float)(k >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; + } + } + + for (BakedQuad bakedquad : p_renderQuadsFlat_8_) + { + if (p_renderQuadsFlat_6_) + { + this.fillQuadBounds(block, bakedquad.getVertexData(), bakedquad.getFace(), (float[])null, bitset); + p_renderQuadsFlat_5_ = bitset.get(0) ? block.getMixedBrightnessForBlock(p_renderQuadsFlat_1_, p_renderQuadsFlat_3_.offset(bakedquad.getFace())) : block.getMixedBrightnessForBlock(p_renderQuadsFlat_1_, p_renderQuadsFlat_3_); + } + + if (bakedquad.getSprite().isEmissive) + { + p_renderQuadsFlat_5_ |= 240; + } + + if (p_renderQuadsFlat_7_.isMultiTexture()) + { + p_renderQuadsFlat_7_.addVertexData(bakedquad.getVertexDataSingle()); + } + else + { + p_renderQuadsFlat_7_.addVertexData(bakedquad.getVertexData()); + } + + p_renderQuadsFlat_7_.putSprite(bakedquad.getSprite()); + p_renderQuadsFlat_7_.putBrightness4(p_renderQuadsFlat_5_, p_renderQuadsFlat_5_, p_renderQuadsFlat_5_, p_renderQuadsFlat_5_); + int i1 = CustomColors.getColorMultiplier(bakedquad, p_renderQuadsFlat_2_, p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, p_renderQuadsFlat_9_); + + if (bakedquad.hasTintIndex() || i1 != -1) + { + int l; + + if (i1 != -1) + { + l = i1; + } + else + { + l = block.colorMultiplier(p_renderQuadsFlat_1_, p_renderQuadsFlat_3_, bakedquad.getTintIndex()); + } + + if (EntityRenderer.anaglyphEnable) + { + l = TextureUtil.anaglyphColor(l); + } + + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + p_renderQuadsFlat_7_.putColorMultiplier(f, f1, f2, 4); + p_renderQuadsFlat_7_.putColorMultiplier(f, f1, f2, 3); + p_renderQuadsFlat_7_.putColorMultiplier(f, f1, f2, 2); + p_renderQuadsFlat_7_.putColorMultiplier(f, f1, f2, 1); + } + + p_renderQuadsFlat_7_.putPosition(d0, d1, d2); + } + } + + public void renderModelBrightnessColor(IBakedModel bakedModel, float p_178262_2_, float red, float green, float blue) + { + for (EnumFacing enumfacing : EnumFacing.VALUES) + { + this.renderModelBrightnessColorQuads(p_178262_2_, red, green, blue, bakedModel.getFaceQuads(enumfacing)); + } + + this.renderModelBrightnessColorQuads(p_178262_2_, red, green, blue, bakedModel.getGeneralQuads()); + } + + public void renderModelBrightness(IBakedModel model, IBlockState p_178266_2_, float brightness, boolean p_178266_4_) + { + Block block = p_178266_2_.getBlock(); + block.setBlockBoundsForItemRender(); + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + int i = block.getRenderColor(block.getStateForEntityRender(p_178266_2_)); + + if (EntityRenderer.anaglyphEnable) + { + i = TextureUtil.anaglyphColor(i); + } + + float f = (float)(i >> 16 & 255) / 255.0F; + float f1 = (float)(i >> 8 & 255) / 255.0F; + float f2 = (float)(i & 255) / 255.0F; + + if (!p_178266_4_) + { + GlStateManager.color(brightness, brightness, brightness, 1.0F); + } + + this.renderModelBrightnessColor(model, brightness, f, f1, f2); + } + + private void renderModelBrightnessColorQuads(float brightness, float red, float green, float blue, List listQuads) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + for (BakedQuad bakedquad : listQuads) + { + worldrenderer.begin(7, DefaultVertexFormats.ITEM); + worldrenderer.addVertexData(bakedquad.getVertexData()); + worldrenderer.putSprite(bakedquad.getSprite()); + + if (bakedquad.hasTintIndex()) + { + worldrenderer.putColorRGB_F4(red * brightness, green * brightness, blue * brightness); + } + else + { + worldrenderer.putColorRGB_F4(brightness, brightness, brightness); + } + + Vec3i vec3i = bakedquad.getFace().getDirectionVec(); + worldrenderer.putNormal((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ()); + tessellator.draw(); + } + } + + public static float fixAoLightValue(float p_fixAoLightValue_0_) + { + return p_fixAoLightValue_0_ == 0.2F ? aoLightValueOpaque : p_fixAoLightValue_0_; + } + + public static void updateAoLightValue() + { + aoLightValueOpaque = 1.0F - Config.getAmbientOcclusionLevel() * 0.8F; + separateAoLightValue = Config.isShaders() && Shaders.isSeparateAo(); + } + + private void renderOverlayModels(IBlockAccess p_renderOverlayModels_1_, IBakedModel p_renderOverlayModels_2_, IBlockState p_renderOverlayModels_3_, BlockPos p_renderOverlayModels_4_, WorldRenderer p_renderOverlayModels_5_, boolean p_renderOverlayModels_6_, long p_renderOverlayModels_7_, RenderEnv p_renderOverlayModels_9_, boolean p_renderOverlayModels_10_) + { + if (p_renderOverlayModels_9_.isOverlaysRendered()) + { + for (int i = 0; i < OVERLAY_LAYERS.length; ++i) + { + EnumWorldBlockLayer enumworldblocklayer = OVERLAY_LAYERS[i]; + ListQuadsOverlay listquadsoverlay = p_renderOverlayModels_9_.getListQuadsOverlay(enumworldblocklayer); + + if (listquadsoverlay.size() > 0) + { + RegionRenderCacheBuilder regionrendercachebuilder = p_renderOverlayModels_9_.getRegionRenderCacheBuilder(); + + if (regionrendercachebuilder != null) + { + WorldRenderer worldrenderer = regionrendercachebuilder.getWorldRendererByLayer(enumworldblocklayer); + + if (!worldrenderer.isDrawing()) + { + worldrenderer.begin(7, DefaultVertexFormats.BLOCK); + worldrenderer.setTranslation(p_renderOverlayModels_5_.getXOffset(), p_renderOverlayModels_5_.getYOffset(), p_renderOverlayModels_5_.getZOffset()); + } + + for (int j = 0; j < listquadsoverlay.size(); ++j) + { + BakedQuad bakedquad = listquadsoverlay.getQuad(j); + List list = listquadsoverlay.getListQuadsSingle(bakedquad); + IBlockState iblockstate = listquadsoverlay.getBlockState(j); + + if (bakedquad.getQuadEmissive() != null) + { + listquadsoverlay.addQuad(bakedquad.getQuadEmissive(), iblockstate); + } + + p_renderOverlayModels_9_.reset(iblockstate, p_renderOverlayModels_4_); + + if (p_renderOverlayModels_10_) + { + this.renderQuadsSmooth(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_, worldrenderer, list, p_renderOverlayModels_9_); + } + else + { + int k = iblockstate.getBlock().getMixedBrightnessForBlock(p_renderOverlayModels_1_, p_renderOverlayModels_4_.offset(bakedquad.getFace())); + this.renderQuadsFlat(p_renderOverlayModels_1_, iblockstate, p_renderOverlayModels_4_, bakedquad.getFace(), k, false, worldrenderer, list, p_renderOverlayModels_9_); + } + } + } + + listquadsoverlay.clear(); + } + } + } + + if (Config.isBetterSnow() && !p_renderOverlayModels_9_.isBreakingAnimation() && BetterSnow.shouldRender(p_renderOverlayModels_1_, p_renderOverlayModels_3_, p_renderOverlayModels_4_)) + { + IBakedModel ibakedmodel = BetterSnow.getModelSnowLayer(); + IBlockState iblockstate1 = BetterSnow.getStateSnowLayer(); + this.renderModel(p_renderOverlayModels_1_, ibakedmodel, iblockstate1, p_renderOverlayModels_4_, p_renderOverlayModels_5_, p_renderOverlayModels_6_); + } + } + + public static class AmbientOcclusionFace + { + private final float[] vertexColorMultiplier; + private final int[] vertexBrightness; + + public AmbientOcclusionFace() + { + this((BlockModelRenderer)null); + } + + public AmbientOcclusionFace(BlockModelRenderer p_i46235_1_) + { + this.vertexColorMultiplier = new float[4]; + this.vertexBrightness = new int[4]; + } + + public void setMaxBlockLight() + { + int i = 240; + this.vertexBrightness[0] |= i; + this.vertexBrightness[1] |= i; + this.vertexBrightness[2] |= i; + this.vertexBrightness[3] |= i; + this.vertexColorMultiplier[0] = 1.0F; + this.vertexColorMultiplier[1] = 1.0F; + this.vertexColorMultiplier[2] = 1.0F; + this.vertexColorMultiplier[3] = 1.0F; + } + + public void updateVertexBrightness(IBlockAccess blockAccessIn, Block blockIn, BlockPos blockPosIn, EnumFacing facingIn, float[] quadBounds, BitSet boundsFlags) + { + BlockPos blockpos = boundsFlags.get(0) ? blockPosIn.offset(facingIn) : blockPosIn; + BlockModelRenderer.EnumNeighborInfo blockmodelrenderer$enumneighborinfo = BlockModelRenderer.EnumNeighborInfo.getNeighbourInfo(facingIn); + BlockPos blockpos1 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[0]); + BlockPos blockpos2 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[1]); + BlockPos blockpos3 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[2]); + BlockPos blockpos4 = blockpos.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[3]); + int i = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos1); + int j = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos2); + int k = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos3); + int l = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos4); + float f = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos1).getBlock().getAmbientOcclusionLightValue()); + float f1 = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos2).getBlock().getAmbientOcclusionLightValue()); + float f2 = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos3).getBlock().getAmbientOcclusionLightValue()); + float f3 = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos4).getBlock().getAmbientOcclusionLightValue()); + boolean flag = blockAccessIn.getBlockState(blockpos1.offset(facingIn)).getBlock().isTranslucent(); + boolean flag1 = blockAccessIn.getBlockState(blockpos2.offset(facingIn)).getBlock().isTranslucent(); + boolean flag2 = blockAccessIn.getBlockState(blockpos3.offset(facingIn)).getBlock().isTranslucent(); + boolean flag3 = blockAccessIn.getBlockState(blockpos4.offset(facingIn)).getBlock().isTranslucent(); + float f4; + int i1; + + if (!flag2 && !flag) + { + f4 = f; + i1 = i; + } + else + { + BlockPos blockpos5 = blockpos1.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[2]); + f4 = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos5).getBlock().getAmbientOcclusionLightValue()); + i1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos5); + } + + int j1; + float f26; + + if (!flag3 && !flag) + { + f26 = f; + j1 = i; + } + else + { + BlockPos blockpos6 = blockpos1.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[3]); + f26 = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos6).getBlock().getAmbientOcclusionLightValue()); + j1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos6); + } + + int k1; + float f27; + + if (!flag2 && !flag1) + { + f27 = f1; + k1 = j; + } + else + { + BlockPos blockpos7 = blockpos2.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[2]); + f27 = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos7).getBlock().getAmbientOcclusionLightValue()); + k1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos7); + } + + int l1; + float f28; + + if (!flag3 && !flag1) + { + f28 = f1; + l1 = j; + } + else + { + BlockPos blockpos8 = blockpos2.offset(blockmodelrenderer$enumneighborinfo.field_178276_g[3]); + f28 = BlockModelRenderer.fixAoLightValue(blockAccessIn.getBlockState(blockpos8).getBlock().getAmbientOcclusionLightValue()); + l1 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockpos8); + } + + int i3 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn); + + if (boundsFlags.get(0) || !blockAccessIn.getBlockState(blockPosIn.offset(facingIn)).getBlock().isOpaqueCube()) + { + i3 = blockIn.getMixedBrightnessForBlock(blockAccessIn, blockPosIn.offset(facingIn)); + } + + float f5 = boundsFlags.get(0) ? blockAccessIn.getBlockState(blockpos).getBlock().getAmbientOcclusionLightValue() : blockAccessIn.getBlockState(blockPosIn).getBlock().getAmbientOcclusionLightValue(); + f5 = BlockModelRenderer.fixAoLightValue(f5); + BlockModelRenderer.VertexTranslations blockmodelrenderer$vertextranslations = BlockModelRenderer.VertexTranslations.getVertexTranslations(facingIn); + + if (boundsFlags.get(1) && blockmodelrenderer$enumneighborinfo.field_178289_i) + { + float f29 = (f3 + f + f26 + f5) * 0.25F; + float f30 = (f2 + f + f4 + f5) * 0.25F; + float f31 = (f2 + f1 + f27 + f5) * 0.25F; + float f32 = (f3 + f1 + f28 + f5) * 0.25F; + float f10 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[1].field_178229_m]; + float f11 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[3].field_178229_m]; + float f12 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[5].field_178229_m]; + float f13 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178286_j[7].field_178229_m]; + float f14 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[1].field_178229_m]; + float f15 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[3].field_178229_m]; + float f16 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[5].field_178229_m]; + float f17 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178287_k[7].field_178229_m]; + float f18 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[1].field_178229_m]; + float f19 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[3].field_178229_m]; + float f20 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[5].field_178229_m]; + float f21 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178284_l[7].field_178229_m]; + float f22 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[0].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[1].field_178229_m]; + float f23 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[2].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[3].field_178229_m]; + float f24 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[4].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[5].field_178229_m]; + float f25 = quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[6].field_178229_m] * quadBounds[blockmodelrenderer$enumneighborinfo.field_178285_m[7].field_178229_m]; + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178191_g] = f29 * f10 + f30 * f11 + f31 * f12 + f32 * f13; + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178200_h] = f29 * f14 + f30 * f15 + f31 * f16 + f32 * f17; + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178201_i] = f29 * f18 + f30 * f19 + f31 * f20 + f32 * f21; + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178198_j] = f29 * f22 + f30 * f23 + f31 * f24 + f32 * f25; + int i2 = this.getAoBrightness(l, i, j1, i3); + int j2 = this.getAoBrightness(k, i, i1, i3); + int k2 = this.getAoBrightness(k, j, k1, i3); + int l2 = this.getAoBrightness(l, j, l1, i3); + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178191_g] = this.getVertexBrightness(i2, j2, k2, l2, f10, f11, f12, f13); + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178200_h] = this.getVertexBrightness(i2, j2, k2, l2, f14, f15, f16, f17); + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178201_i] = this.getVertexBrightness(i2, j2, k2, l2, f18, f19, f20, f21); + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178198_j] = this.getVertexBrightness(i2, j2, k2, l2, f22, f23, f24, f25); + } + else + { + float f6 = (f3 + f + f26 + f5) * 0.25F; + float f7 = (f2 + f + f4 + f5) * 0.25F; + float f8 = (f2 + f1 + f27 + f5) * 0.25F; + float f9 = (f3 + f1 + f28 + f5) * 0.25F; + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178191_g] = this.getAoBrightness(l, i, j1, i3); + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178200_h] = this.getAoBrightness(k, i, i1, i3); + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178201_i] = this.getAoBrightness(k, j, k1, i3); + this.vertexBrightness[blockmodelrenderer$vertextranslations.field_178198_j] = this.getAoBrightness(l, j, l1, i3); + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178191_g] = f6; + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178200_h] = f7; + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178201_i] = f8; + this.vertexColorMultiplier[blockmodelrenderer$vertextranslations.field_178198_j] = f9; + } + } + + private int getAoBrightness(int br1, int br2, int br3, int br4) + { + if (br1 == 0) + { + br1 = br4; + } + + if (br2 == 0) + { + br2 = br4; + } + + if (br3 == 0) + { + br3 = br4; + } + + return br1 + br2 + br3 + br4 >> 2 & 16711935; + } + + private int getVertexBrightness(int p_178203_1_, int p_178203_2_, int p_178203_3_, int p_178203_4_, float p_178203_5_, float p_178203_6_, float p_178203_7_, float p_178203_8_) + { + int i = (int)((float)(p_178203_1_ >> 16 & 255) * p_178203_5_ + (float)(p_178203_2_ >> 16 & 255) * p_178203_6_ + (float)(p_178203_3_ >> 16 & 255) * p_178203_7_ + (float)(p_178203_4_ >> 16 & 255) * p_178203_8_) & 255; + int j = (int)((float)(p_178203_1_ & 255) * p_178203_5_ + (float)(p_178203_2_ & 255) * p_178203_6_ + (float)(p_178203_3_ & 255) * p_178203_7_ + (float)(p_178203_4_ & 255) * p_178203_8_) & 255; + return i << 16 | j; + } + } + + public static enum EnumNeighborInfo + { + DOWN(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.5F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), + UP(new EnumFacing[]{EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH}, 1.0F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), + NORTH(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.WEST}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST}), + SOUTH(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST}), + WEST(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH}), + EAST(new EnumFacing[]{EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH}); + + protected final EnumFacing[] field_178276_g; + protected final float field_178288_h; + protected final boolean field_178289_i; + protected final BlockModelRenderer.Orientation[] field_178286_j; + protected final BlockModelRenderer.Orientation[] field_178287_k; + protected final BlockModelRenderer.Orientation[] field_178284_l; + protected final BlockModelRenderer.Orientation[] field_178285_m; + private static final BlockModelRenderer.EnumNeighborInfo[] VALUES = new BlockModelRenderer.EnumNeighborInfo[6]; + + private EnumNeighborInfo(EnumFacing[] p_i46236_3_, float p_i46236_4_, boolean p_i46236_5_, BlockModelRenderer.Orientation[] p_i46236_6_, BlockModelRenderer.Orientation[] p_i46236_7_, BlockModelRenderer.Orientation[] p_i46236_8_, BlockModelRenderer.Orientation[] p_i46236_9_) + { + this.field_178276_g = p_i46236_3_; + this.field_178288_h = p_i46236_4_; + this.field_178289_i = p_i46236_5_; + this.field_178286_j = p_i46236_6_; + this.field_178287_k = p_i46236_7_; + this.field_178284_l = p_i46236_8_; + this.field_178285_m = p_i46236_9_; + } + + public static BlockModelRenderer.EnumNeighborInfo getNeighbourInfo(EnumFacing p_178273_0_) + { + return VALUES[p_178273_0_.getIndex()]; + } + + static { + VALUES[EnumFacing.DOWN.getIndex()] = DOWN; + VALUES[EnumFacing.UP.getIndex()] = UP; + VALUES[EnumFacing.NORTH.getIndex()] = NORTH; + VALUES[EnumFacing.SOUTH.getIndex()] = SOUTH; + VALUES[EnumFacing.WEST.getIndex()] = WEST; + VALUES[EnumFacing.EAST.getIndex()] = EAST; + } + } + + public static enum Orientation + { + DOWN(EnumFacing.DOWN, false), + UP(EnumFacing.UP, false), + NORTH(EnumFacing.NORTH, false), + SOUTH(EnumFacing.SOUTH, false), + WEST(EnumFacing.WEST, false), + EAST(EnumFacing.EAST, false), + FLIP_DOWN(EnumFacing.DOWN, true), + FLIP_UP(EnumFacing.UP, true), + FLIP_NORTH(EnumFacing.NORTH, true), + FLIP_SOUTH(EnumFacing.SOUTH, true), + FLIP_WEST(EnumFacing.WEST, true), + FLIP_EAST(EnumFacing.EAST, true); + + protected final int field_178229_m; + + private Orientation(EnumFacing p_i46233_3_, boolean p_i46233_4_) + { + this.field_178229_m = p_i46233_3_.getIndex() + (p_i46233_4_ ? EnumFacing.values().length : 0); + } + } + + static enum VertexTranslations + { + DOWN(0, 1, 2, 3), + UP(2, 3, 0, 1), + NORTH(3, 0, 1, 2), + SOUTH(0, 1, 2, 3), + WEST(3, 0, 1, 2), + EAST(1, 2, 3, 0); + + private final int field_178191_g; + private final int field_178200_h; + private final int field_178201_i; + private final int field_178198_j; + private static final BlockModelRenderer.VertexTranslations[] VALUES = new BlockModelRenderer.VertexTranslations[6]; + + private VertexTranslations(int p_i46234_3_, int p_i46234_4_, int p_i46234_5_, int p_i46234_6_) + { + this.field_178191_g = p_i46234_3_; + this.field_178200_h = p_i46234_4_; + this.field_178201_i = p_i46234_5_; + this.field_178198_j = p_i46234_6_; + } + + public static BlockModelRenderer.VertexTranslations getVertexTranslations(EnumFacing p_178184_0_) + { + return VALUES[p_178184_0_.getIndex()]; + } + + static { + VALUES[EnumFacing.DOWN.getIndex()] = DOWN; + VALUES[EnumFacing.UP.getIndex()] = UP; + VALUES[EnumFacing.NORTH.getIndex()] = NORTH; + VALUES[EnumFacing.SOUTH.getIndex()] = SOUTH; + VALUES[EnumFacing.WEST.getIndex()] = WEST; + VALUES[EnumFacing.EAST.getIndex()] = EAST; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockModelShapes.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockModelShapes.java new file mode 100644 index 0000000..8ae6b01 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockModelShapes.java @@ -0,0 +1,314 @@ +package net.minecraft.client.renderer; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.BlockCactus; +import net.minecraft.block.BlockColored; +import net.minecraft.block.BlockCommandBlock; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockDropper; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockFlowerPot; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockJukebox; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockNewLeaf; +import net.minecraft.block.BlockNewLog; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockPrismarine; +import net.minecraft.block.BlockQuartz; +import net.minecraft.block.BlockRedSandstone; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.BlockReed; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.BlockStem; +import net.minecraft.block.BlockStone; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.block.BlockStoneSlabNew; +import net.minecraft.block.BlockTNT; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.BlockTripWire; +import net.minecraft.block.BlockWall; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.BlockStateMapper; +import net.minecraft.client.renderer.block.statemap.IStateMapper; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.client.renderer.block.statemap.StateMapperBase; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; + +public class BlockModelShapes +{ + private final Map bakedModelStore = Maps.newIdentityHashMap(); + private final BlockStateMapper blockStateMapper = new BlockStateMapper(); + private final ModelManager modelManager; + + public BlockModelShapes(ModelManager manager) + { + this.modelManager = manager; + this.registerAllBlocks(); + } + + public BlockStateMapper getBlockStateMapper() + { + return this.blockStateMapper; + } + + public TextureAtlasSprite getTexture(IBlockState state) + { + Block block = state.getBlock(); + IBakedModel ibakedmodel = this.getModelForState(state); + + if (ibakedmodel == null || ibakedmodel == this.modelManager.getMissingModel()) + { + if (block == Blocks.wall_sign || block == Blocks.standing_sign || block == Blocks.chest || block == Blocks.trapped_chest || block == Blocks.standing_banner || block == Blocks.wall_banner) + { + return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/planks_oak"); + } + + if (block == Blocks.ender_chest) + { + return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/obsidian"); + } + + if (block == Blocks.flowing_lava || block == Blocks.lava) + { + return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/lava_still"); + } + + if (block == Blocks.flowing_water || block == Blocks.water) + { + return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/water_still"); + } + + if (block == Blocks.skull) + { + return this.modelManager.getTextureMap().getAtlasSprite("minecraft:blocks/soul_sand"); + } + + if (block == Blocks.barrier) + { + return this.modelManager.getTextureMap().getAtlasSprite("minecraft:items/barrier"); + } + } + + if (ibakedmodel == null) + { + ibakedmodel = this.modelManager.getMissingModel(); + } + + return ibakedmodel.getParticleTexture(); + } + + public IBakedModel getModelForState(IBlockState state) + { + IBakedModel ibakedmodel = (IBakedModel)this.bakedModelStore.get(state); + + if (ibakedmodel == null) + { + ibakedmodel = this.modelManager.getMissingModel(); + } + + return ibakedmodel; + } + + public ModelManager getModelManager() + { + return this.modelManager; + } + + public void reloadModels() + { + this.bakedModelStore.clear(); + + for (Entry entry : this.blockStateMapper.putAllStateModelLocations().entrySet()) + { + this.bakedModelStore.put(entry.getKey(), this.modelManager.getModel((ModelResourceLocation)entry.getValue())); + } + } + + public void registerBlockWithStateMapper(Block assoc, IStateMapper stateMapper) + { + this.blockStateMapper.registerBlockStateMapper(assoc, stateMapper); + } + + public void registerBuiltInBlocks(Block... builtIns) + { + this.blockStateMapper.registerBuiltInBlocks(builtIns); + } + + private void registerAllBlocks() + { + this.registerBuiltInBlocks(new Block[] {Blocks.air, Blocks.flowing_water, Blocks.water, Blocks.flowing_lava, Blocks.lava, Blocks.piston_extension, Blocks.chest, Blocks.ender_chest, Blocks.trapped_chest, Blocks.standing_sign, Blocks.skull, Blocks.end_portal, Blocks.barrier, Blocks.wall_sign, Blocks.wall_banner, Blocks.standing_banner}); + this.registerBlockWithStateMapper(Blocks.stone, (new StateMap.Builder()).withName(BlockStone.VARIANT).build()); + this.registerBlockWithStateMapper(Blocks.prismarine, (new StateMap.Builder()).withName(BlockPrismarine.VARIANT).build()); + this.registerBlockWithStateMapper(Blocks.leaves, (new StateMap.Builder()).withName(BlockOldLeaf.VARIANT).withSuffix("_leaves").ignore(new IProperty[] {BlockLeaves.CHECK_DECAY, BlockLeaves.DECAYABLE}).build()); + this.registerBlockWithStateMapper(Blocks.leaves2, (new StateMap.Builder()).withName(BlockNewLeaf.VARIANT).withSuffix("_leaves").ignore(new IProperty[] {BlockLeaves.CHECK_DECAY, BlockLeaves.DECAYABLE}).build()); + this.registerBlockWithStateMapper(Blocks.cactus, (new StateMap.Builder()).ignore(new IProperty[] {BlockCactus.AGE}).build()); + this.registerBlockWithStateMapper(Blocks.reeds, (new StateMap.Builder()).ignore(new IProperty[] {BlockReed.AGE}).build()); + this.registerBlockWithStateMapper(Blocks.jukebox, (new StateMap.Builder()).ignore(new IProperty[] {BlockJukebox.HAS_RECORD}).build()); + this.registerBlockWithStateMapper(Blocks.command_block, (new StateMap.Builder()).ignore(new IProperty[] {BlockCommandBlock.TRIGGERED}).build()); + this.registerBlockWithStateMapper(Blocks.cobblestone_wall, (new StateMap.Builder()).withName(BlockWall.VARIANT).withSuffix("_wall").build()); + this.registerBlockWithStateMapper(Blocks.double_plant, (new StateMap.Builder()).withName(BlockDoublePlant.VARIANT).ignore(new IProperty[] {BlockDoublePlant.FACING}).build()); + this.registerBlockWithStateMapper(Blocks.oak_fence_gate, (new StateMap.Builder()).ignore(new IProperty[] {BlockFenceGate.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.spruce_fence_gate, (new StateMap.Builder()).ignore(new IProperty[] {BlockFenceGate.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.birch_fence_gate, (new StateMap.Builder()).ignore(new IProperty[] {BlockFenceGate.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.jungle_fence_gate, (new StateMap.Builder()).ignore(new IProperty[] {BlockFenceGate.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.dark_oak_fence_gate, (new StateMap.Builder()).ignore(new IProperty[] {BlockFenceGate.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.acacia_fence_gate, (new StateMap.Builder()).ignore(new IProperty[] {BlockFenceGate.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.tripwire, (new StateMap.Builder()).ignore(new IProperty[] {BlockTripWire.DISARMED, BlockTripWire.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.double_wooden_slab, (new StateMap.Builder()).withName(BlockPlanks.VARIANT).withSuffix("_double_slab").build()); + this.registerBlockWithStateMapper(Blocks.wooden_slab, (new StateMap.Builder()).withName(BlockPlanks.VARIANT).withSuffix("_slab").build()); + this.registerBlockWithStateMapper(Blocks.tnt, (new StateMap.Builder()).ignore(new IProperty[] {BlockTNT.EXPLODE}).build()); + this.registerBlockWithStateMapper(Blocks.fire, (new StateMap.Builder()).ignore(new IProperty[] {BlockFire.AGE}).build()); + this.registerBlockWithStateMapper(Blocks.redstone_wire, (new StateMap.Builder()).ignore(new IProperty[] {BlockRedstoneWire.POWER}).build()); + this.registerBlockWithStateMapper(Blocks.oak_door, (new StateMap.Builder()).ignore(new IProperty[] {BlockDoor.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.spruce_door, (new StateMap.Builder()).ignore(new IProperty[] {BlockDoor.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.birch_door, (new StateMap.Builder()).ignore(new IProperty[] {BlockDoor.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.jungle_door, (new StateMap.Builder()).ignore(new IProperty[] {BlockDoor.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.acacia_door, (new StateMap.Builder()).ignore(new IProperty[] {BlockDoor.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.dark_oak_door, (new StateMap.Builder()).ignore(new IProperty[] {BlockDoor.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.iron_door, (new StateMap.Builder()).ignore(new IProperty[] {BlockDoor.POWERED}).build()); + this.registerBlockWithStateMapper(Blocks.wool, (new StateMap.Builder()).withName(BlockColored.COLOR).withSuffix("_wool").build()); + this.registerBlockWithStateMapper(Blocks.carpet, (new StateMap.Builder()).withName(BlockColored.COLOR).withSuffix("_carpet").build()); + this.registerBlockWithStateMapper(Blocks.stained_hardened_clay, (new StateMap.Builder()).withName(BlockColored.COLOR).withSuffix("_stained_hardened_clay").build()); + this.registerBlockWithStateMapper(Blocks.stained_glass_pane, (new StateMap.Builder()).withName(BlockColored.COLOR).withSuffix("_stained_glass_pane").build()); + this.registerBlockWithStateMapper(Blocks.stained_glass, (new StateMap.Builder()).withName(BlockColored.COLOR).withSuffix("_stained_glass").build()); + this.registerBlockWithStateMapper(Blocks.sandstone, (new StateMap.Builder()).withName(BlockSandStone.TYPE).build()); + this.registerBlockWithStateMapper(Blocks.red_sandstone, (new StateMap.Builder()).withName(BlockRedSandstone.TYPE).build()); + this.registerBlockWithStateMapper(Blocks.tallgrass, (new StateMap.Builder()).withName(BlockTallGrass.TYPE).build()); + this.registerBlockWithStateMapper(Blocks.bed, (new StateMap.Builder()).ignore(new IProperty[] {BlockBed.OCCUPIED}).build()); + this.registerBlockWithStateMapper(Blocks.yellow_flower, (new StateMap.Builder()).withName(Blocks.yellow_flower.getTypeProperty()).build()); + this.registerBlockWithStateMapper(Blocks.red_flower, (new StateMap.Builder()).withName(Blocks.red_flower.getTypeProperty()).build()); + this.registerBlockWithStateMapper(Blocks.stone_slab, (new StateMap.Builder()).withName(BlockStoneSlab.VARIANT).withSuffix("_slab").build()); + this.registerBlockWithStateMapper(Blocks.stone_slab2, (new StateMap.Builder()).withName(BlockStoneSlabNew.VARIANT).withSuffix("_slab").build()); + this.registerBlockWithStateMapper(Blocks.monster_egg, (new StateMap.Builder()).withName(BlockSilverfish.VARIANT).withSuffix("_monster_egg").build()); + this.registerBlockWithStateMapper(Blocks.stonebrick, (new StateMap.Builder()).withName(BlockStoneBrick.VARIANT).build()); + this.registerBlockWithStateMapper(Blocks.dispenser, (new StateMap.Builder()).ignore(new IProperty[] {BlockDispenser.TRIGGERED}).build()); + this.registerBlockWithStateMapper(Blocks.dropper, (new StateMap.Builder()).ignore(new IProperty[] {BlockDropper.TRIGGERED}).build()); + this.registerBlockWithStateMapper(Blocks.log, (new StateMap.Builder()).withName(BlockOldLog.VARIANT).withSuffix("_log").build()); + this.registerBlockWithStateMapper(Blocks.log2, (new StateMap.Builder()).withName(BlockNewLog.VARIANT).withSuffix("_log").build()); + this.registerBlockWithStateMapper(Blocks.planks, (new StateMap.Builder()).withName(BlockPlanks.VARIANT).withSuffix("_planks").build()); + this.registerBlockWithStateMapper(Blocks.sapling, (new StateMap.Builder()).withName(BlockSapling.TYPE).withSuffix("_sapling").build()); + this.registerBlockWithStateMapper(Blocks.sand, (new StateMap.Builder()).withName(BlockSand.VARIANT).build()); + this.registerBlockWithStateMapper(Blocks.hopper, (new StateMap.Builder()).ignore(new IProperty[] {BlockHopper.ENABLED}).build()); + this.registerBlockWithStateMapper(Blocks.flower_pot, (new StateMap.Builder()).ignore(new IProperty[] {BlockFlowerPot.LEGACY_DATA}).build()); + this.registerBlockWithStateMapper(Blocks.quartz_block, new StateMapperBase() + { + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + BlockQuartz.EnumType blockquartz$enumtype = (BlockQuartz.EnumType)state.getValue(BlockQuartz.VARIANT); + + switch (blockquartz$enumtype) + { + case DEFAULT: + default: + return new ModelResourceLocation("quartz_block", "normal"); + + case CHISELED: + return new ModelResourceLocation("chiseled_quartz_block", "normal"); + + case LINES_Y: + return new ModelResourceLocation("quartz_column", "axis=y"); + + case LINES_X: + return new ModelResourceLocation("quartz_column", "axis=x"); + + case LINES_Z: + return new ModelResourceLocation("quartz_column", "axis=z"); + } + } + }); + this.registerBlockWithStateMapper(Blocks.deadbush, new StateMapperBase() + { + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + return new ModelResourceLocation("dead_bush", "normal"); + } + }); + this.registerBlockWithStateMapper(Blocks.pumpkin_stem, new StateMapperBase() + { + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + Map map = Maps.newLinkedHashMap(state.getProperties()); + + if (state.getValue(BlockStem.FACING) != EnumFacing.UP) + { + map.remove(BlockStem.AGE); + } + + return new ModelResourceLocation((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock()), this.getPropertyString(map)); + } + }); + this.registerBlockWithStateMapper(Blocks.melon_stem, new StateMapperBase() + { + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + Map map = Maps.newLinkedHashMap(state.getProperties()); + + if (state.getValue(BlockStem.FACING) != EnumFacing.UP) + { + map.remove(BlockStem.AGE); + } + + return new ModelResourceLocation((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock()), this.getPropertyString(map)); + } + }); + this.registerBlockWithStateMapper(Blocks.dirt, new StateMapperBase() + { + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + Map map = Maps.newLinkedHashMap(state.getProperties()); + String s = BlockDirt.VARIANT.getName((BlockDirt.DirtType)map.remove(BlockDirt.VARIANT)); + + if (BlockDirt.DirtType.PODZOL != state.getValue(BlockDirt.VARIANT)) + { + map.remove(BlockDirt.SNOWY); + } + + return new ModelResourceLocation(s, this.getPropertyString(map)); + } + }); + this.registerBlockWithStateMapper(Blocks.double_stone_slab, new StateMapperBase() + { + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + Map map = Maps.newLinkedHashMap(state.getProperties()); + String s = BlockStoneSlab.VARIANT.getName((BlockStoneSlab.EnumType)map.remove(BlockStoneSlab.VARIANT)); + map.remove(BlockStoneSlab.SEAMLESS); + String s1 = ((Boolean)state.getValue(BlockStoneSlab.SEAMLESS)).booleanValue() ? "all" : "normal"; + return new ModelResourceLocation(s + "_double_slab", s1); + } + }); + this.registerBlockWithStateMapper(Blocks.double_stone_slab2, new StateMapperBase() + { + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + Map map = Maps.newLinkedHashMap(state.getProperties()); + String s = BlockStoneSlabNew.VARIANT.getName((BlockStoneSlabNew.EnumType)map.remove(BlockStoneSlabNew.VARIANT)); + map.remove(BlockStoneSlab.SEAMLESS); + String s1 = ((Boolean)state.getValue(BlockStoneSlabNew.SEAMLESS)).booleanValue() ? "all" : "normal"; + return new ModelResourceLocation(s + "_double_slab", s1); + } + }); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockRendererDispatcher.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockRendererDispatcher.java new file mode 100644 index 0000000..dd3dae2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/BlockRendererDispatcher.java @@ -0,0 +1,174 @@ +package net.minecraft.client.renderer; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.SimpleBakedModel; +import net.minecraft.client.resources.model.WeightedBakedModel; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.WorldType; + +public class BlockRendererDispatcher implements IResourceManagerReloadListener +{ + private BlockModelShapes blockModelShapes; + private final GameSettings gameSettings; + private final BlockModelRenderer blockModelRenderer = new BlockModelRenderer(); + private final ChestRenderer chestRenderer = new ChestRenderer(); + private final BlockFluidRenderer fluidRenderer = new BlockFluidRenderer(); + + public BlockRendererDispatcher(BlockModelShapes blockModelShapesIn, GameSettings gameSettingsIn) + { + this.blockModelShapes = blockModelShapesIn; + this.gameSettings = gameSettingsIn; + } + + public BlockModelShapes getBlockModelShapes() + { + return this.blockModelShapes; + } + + public void renderBlockDamage(IBlockState state, BlockPos pos, TextureAtlasSprite texture, IBlockAccess blockAccess) + { + Block block = state.getBlock(); + int i = block.getRenderType(); + + if (i == 3) + { + state = block.getActualState(state, blockAccess, pos); + IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state); + IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, texture)).makeBakedModel(); + this.blockModelRenderer.renderModel(blockAccess, ibakedmodel1, state, pos, Tessellator.getInstance().getWorldRenderer()); + } + } + + public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, WorldRenderer worldRendererIn) + { + try + { + int i = state.getBlock().getRenderType(); + + if (i == -1) + { + return false; + } + else + { + switch (i) + { + case 1: + return this.fluidRenderer.renderFluid(blockAccess, state, pos, worldRendererIn); + + case 2: + return false; + + case 3: + IBakedModel ibakedmodel = this.getModelFromBlockState(state, blockAccess, pos); + return this.blockModelRenderer.renderModel(blockAccess, ibakedmodel, state, pos, worldRendererIn); + + default: + return false; + } + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block in world"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tesselated"); + CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state)); + throw new ReportedException(crashreport); + } + } + + public BlockModelRenderer getBlockModelRenderer() + { + return this.blockModelRenderer; + } + + private IBakedModel getBakedModel(IBlockState state, BlockPos pos) + { + IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state); + + if (pos != null && this.gameSettings.allowBlockAlternatives && ibakedmodel instanceof WeightedBakedModel) + { + ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(pos)); + } + + return ibakedmodel; + } + + public IBakedModel getModelFromBlockState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + { + Block block = state.getBlock(); + + if (worldIn.getWorldType() != WorldType.DEBUG_WORLD) + { + try + { + state = block.getActualState(state, worldIn, pos); + } + catch (Exception var6) + { + ; + } + } + + IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state); + + if (pos != null && this.gameSettings.allowBlockAlternatives && ibakedmodel instanceof WeightedBakedModel) + { + ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(pos)); + } + + return ibakedmodel; + } + + public void renderBlockBrightness(IBlockState state, float brightness) + { + int i = state.getBlock().getRenderType(); + + if (i != -1) + { + switch (i) + { + case 1: + default: + break; + + case 2: + this.chestRenderer.renderChestBrightness(state.getBlock(), brightness); + break; + + case 3: + IBakedModel ibakedmodel = this.getBakedModel(state, (BlockPos)null); + this.blockModelRenderer.renderModelBrightness(ibakedmodel, state, brightness, true); + } + } + } + + public boolean isRenderTypeChest(Block p_175021_1_, int p_175021_2_) + { + if (p_175021_1_ == null) + { + return false; + } + else + { + int i = p_175021_1_.getRenderType(); + return i == 3 ? false : i == 2; + } + } + + public void onResourceManagerReload(IResourceManager resourceManager) + { + this.fluidRenderer.initAtlasSprites(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ChestRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ChestRenderer.java new file mode 100644 index 0000000..79d00cb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ChestRenderer.java @@ -0,0 +1,15 @@ +package net.minecraft.client.renderer; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer; +import net.minecraft.item.ItemStack; + +public class ChestRenderer +{ + public void renderChestBrightness(Block p_178175_1_, float color) + { + GlStateManager.color(color, color, color, 1.0F); + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + TileEntityItemStackRenderer.instance.renderByItem(new ItemStack(p_178175_1_)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ChunkRenderContainer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ChunkRenderContainer.java new file mode 100644 index 0000000..e33ffaa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ChunkRenderContainer.java @@ -0,0 +1,71 @@ +package net.minecraft.client.renderer; + +import com.google.common.collect.Lists; +import java.util.BitSet; +import java.util.List; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.optifine.SmartAnimations; + +public abstract class ChunkRenderContainer +{ + private double viewEntityX; + private double viewEntityY; + private double viewEntityZ; + protected List renderChunks = Lists.newArrayListWithCapacity(17424); + protected boolean initialized; + private BitSet animatedSpritesRendered; + private final BitSet animatedSpritesCached = new BitSet(); + + public void initialize(double viewEntityXIn, double viewEntityYIn, double viewEntityZIn) + { + this.initialized = true; + this.renderChunks.clear(); + this.viewEntityX = viewEntityXIn; + this.viewEntityY = viewEntityYIn; + this.viewEntityZ = viewEntityZIn; + + if (SmartAnimations.isActive()) + { + if (this.animatedSpritesRendered != null) + { + SmartAnimations.spritesRendered(this.animatedSpritesRendered); + } + else + { + this.animatedSpritesRendered = this.animatedSpritesCached; + } + + this.animatedSpritesRendered.clear(); + } + else if (this.animatedSpritesRendered != null) + { + SmartAnimations.spritesRendered(this.animatedSpritesRendered); + this.animatedSpritesRendered = null; + } + } + + public void preRenderChunk(RenderChunk renderChunkIn) + { + BlockPos blockpos = renderChunkIn.getPosition(); + GlStateManager.translate((float)((double)blockpos.getX() - this.viewEntityX), (float)((double)blockpos.getY() - this.viewEntityY), (float)((double)blockpos.getZ() - this.viewEntityZ)); + } + + public void addRenderChunk(RenderChunk renderChunkIn, EnumWorldBlockLayer layer) + { + this.renderChunks.add(renderChunkIn); + + if (this.animatedSpritesRendered != null) + { + BitSet bitset = renderChunkIn.compiledChunk.getAnimatedSprites(layer); + + if (bitset != null) + { + this.animatedSpritesRendered.or(bitset); + } + } + } + + public abstract void renderChunkLayer(EnumWorldBlockLayer layer); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java new file mode 100644 index 0000000..d8b9c97 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java @@ -0,0 +1,47 @@ +package net.minecraft.client.renderer; + +import net.minecraft.util.BlockPos; + +public class DestroyBlockProgress +{ + private final int miningPlayerEntId; + private final BlockPos position; + private int partialBlockProgress; + private int createdAtCloudUpdateTick; + + public DestroyBlockProgress(int miningPlayerEntIdIn, BlockPos positionIn) + { + this.miningPlayerEntId = miningPlayerEntIdIn; + this.position = positionIn; + } + + public BlockPos getPosition() + { + return this.position; + } + + public void setPartialBlockDamage(int damage) + { + if (damage > 10) + { + damage = 10; + } + + this.partialBlockProgress = damage; + } + + public int getPartialBlockDamage() + { + return this.partialBlockProgress; + } + + public void setCloudUpdateTick(int createdAtCloudUpdateTickIn) + { + this.createdAtCloudUpdateTick = createdAtCloudUpdateTickIn; + } + + public int getCreationCloudUpdateTick() + { + return this.createdAtCloudUpdateTick; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRendere# b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRendere# new file mode 100644 index 0000000..d45a248 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRendere# @@ -0,0 +1,17 @@ +*************** +*** 326,332 **** + flag = true; + } + +- d0 = d0; + } + + if(this.field_78531_r.field_71476_x != null) { +--- 326,332 ---- + flag = true; + } + ++ // d0 = d0; + } + + if(this.field_78531_r.field_71476_x != null) { diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRenderer.java new file mode 100644 index 0000000..12583d1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -0,0 +1,2584 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.animation.util.SneakHandler; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleDragToLook; +import com.cheatbreaker.client.module.impl.normal.perspective.ModulePerspective; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnvironmentChanger; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.gson.JsonSyntaxException; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.*; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.ClickEvent.Action; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.src.Config; +import net.minecraft.util.*; +import net.minecraft.util.BlockPos.MutableBlockPos; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldSettings.GameType; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.CustomColors; +import net.optifine.GlErrors; +import net.optifine.Lagometer; +import net.optifine.RandomEntities; +import net.optifine.gui.GuiChatOF; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.reflect.ReflectorResolver; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersRender; +import net.optifine.util.MemoryMonitor; +import net.optifine.util.TextureUtils; +import net.optifine.util.TimedEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +import java.io.IOException; +import java.nio.FloatBuffer; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; + +public class EntityRenderer implements IResourceManagerReloadListener { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); + private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); + public static boolean anaglyphEnable; + public static int anaglyphField; + private Minecraft mc; + private final IResourceManager resourceManager; + private Random random = new Random(); + private float farPlaneDistance; + public ItemRenderer itemRenderer; + private final MapItemRenderer theMapItemRenderer; + private int rendererUpdateCount; + private Entity pointedEntity; + private MouseFilter mouseFilterXAxis = new MouseFilter(); + private MouseFilter mouseFilterYAxis = new MouseFilter(); + private float thirdPersonDistance = 4.0F; + private float thirdPersonDistanceTemp = 4.0F; + private float smoothCamYaw; + private float smoothCamPitch; + private float smoothCamFilterX; + private float smoothCamFilterY; + private float smoothCamPartialTicks; + private float fovModifierHand; + private float fovModifierHandPrev; + private float bossColorModifier; + private float bossColorModifierPrev; + private boolean cloudFog; + private boolean renderHand = true; + private boolean drawBlockOutline = true; + private long prevFrameTime = Minecraft.getSystemTime(); + private long renderEndNanoTime; + private final DynamicTexture lightmapTexture; + private final int[] lightmapColors; + private final ResourceLocation locationLightMap; + private boolean lightmapUpdateNeeded; + private float torchFlickerX; + private float torchFlickerDX; + private int rainSoundCounter; + private float[] rainXCoords = new float[1024]; + private float[] rainYCoords = new float[1024]; + private FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); + public float fogColorRed; + public float fogColorGreen; + public float fogColorBlue; + private float fogColor2; + private float fogColor1; + private int debugViewDirection = 0; + private boolean debugView = false; + private double cameraZoom = 1.0D; + private double cameraYaw; + private double cameraPitch; + private ShaderGroup theShaderGroup; + private static final ResourceLocation[] shaderResourceLocations = new ResourceLocation[]{new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json"), new ResourceLocation("shaders/post/creeper.json"), new ResourceLocation("shaders/post/spider.json")}; + private static final ResourceLocation guiBlurResourceLocation = new ResourceLocation("shaders/post/animblur.json"); + private static final ResourceLocation oldMotionBlurResourceLocation = new ResourceLocation("shaders/post/motionblur.json"); + private static final ResourceLocation lunarMotionBlurResourceLocation = new ResourceLocation("shaders/post/lunar_motionblur.json"); + public static final int shaderCount = shaderResourceLocations.length; + private int shaderIndex; + private boolean useShader; + public int frameCount; + private boolean initialized = false; + private World updatedWorld = null; + private boolean showDebugInfo = false; + public boolean fogStandard = false; + private float clipDistance = 128.0F; + private long lastServerTime = 0L; + private int lastServerTicks = 0; + private int serverWaitTime = 0; + private int serverWaitTimeCurrent = 0; + private float avgServerTimeDiff = 0.0F; + private float avgServerTickDiff = 0.0F; + private ShaderGroup[] fxaaShaders = new ShaderGroup[10]; + private boolean loadVisibleChunks = false; + + public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) { + this.shaderIndex = shaderCount; + this.useShader = false; + this.frameCount = 0; + this.mc = mcIn; + this.resourceManager = resourceManagerIn; + this.itemRenderer = mcIn.getItemRenderer(); + this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager()); + this.lightmapTexture = new DynamicTexture(16, 16); + this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); + this.lightmapColors = this.lightmapTexture.getTextureData(); + this.theShaderGroup = null; + + for (int i = 0; i < 32; ++i) { + for (int j = 0; j < 32; ++j) { + float f = (float) (j - 16); + float f1 = (float) (i - 16); + float f2 = MathHelper.sqrt_float(f * f + f1 * f1); + this.rainXCoords[i << 5 | j] = -f1 / f2; + this.rainYCoords[i << 5 | j] = f / f2; + } + } + } + + public boolean isShaderActive() { + return OpenGlHelper.shadersSupported && this.theShaderGroup != null; + } + + public void stopUseShader() { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + + this.theShaderGroup = null; + this.shaderIndex = shaderCount; + } + + public void switchUseShader() { + this.useShader = !this.useShader; + } + + public void loadEntityShader(Entity entityIn) { + if (OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + + this.theShaderGroup = null; + + if (entityIn instanceof EntityCreeper) { + this.loadShader(new ResourceLocation("shaders/post/creeper.json")); + } else if (entityIn instanceof EntitySpider) { + this.loadShader(new ResourceLocation("shaders/post/spider.json")); + } else if (entityIn instanceof EntityEnderman) { + this.loadShader(new ResourceLocation("shaders/post/invert.json")); + } else if (Reflector.ForgeHooksClient_loadEntityShader.exists()) { + Reflector.call(Reflector.ForgeHooksClient_loadEntityShader, new Object[]{entityIn, this}); + } + } + } + + public void activateNextShader() { + if (OpenGlHelper.shadersSupported && this.mc.getRenderViewEntity() instanceof EntityPlayer) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + + this.shaderIndex = (this.shaderIndex + 1) % (shaderResourceLocations.length + 1); + + if (this.shaderIndex != shaderCount) { + this.loadShader(shaderResourceLocations[this.shaderIndex]); + } else { + this.theShaderGroup = null; + } + } + } + + private void loadShader(ResourceLocation resourceLocationIn) { + if (OpenGlHelper.isFramebufferEnabled()) { + try { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), resourceLocationIn); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + this.useShader = true; + } catch (IOException | JsonSyntaxException ioexception) { + logger.warn((String) ("Failed to load shader: " + resourceLocationIn), (Throwable) ioexception); + this.shaderIndex = shaderCount; + this.useShader = false; + } + } + } + + public void loadGuiBlurShader() { + if (OpenGlHelper.isFramebufferEnabled() && OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + try { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), guiBlurResourceLocation); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + this.useShader = true; + } catch (Exception ignored) { + } + } + } + + public void loadMotionBlurShader() { + if (OpenGlHelper.isFramebufferEnabled() && OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + ResourceLocation motionBlurLocation = (Boolean) CheatBreaker.getInstance().getModuleManager().motionBlurMod.oldBlur.getValue() ? oldMotionBlurResourceLocation : lunarMotionBlurResourceLocation; + try { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), motionBlurLocation); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + this.useShader = true; + } catch (Exception ignored) { + } + } + } + + public void onResourceManagerReload(IResourceManager resourceManager) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + + this.theShaderGroup = null; + + if (this.shaderIndex != shaderCount) { + this.loadShader(shaderResourceLocations[this.shaderIndex]); + } else { + this.loadEntityShader(this.mc.getRenderViewEntity()); + } + } + + public void updateRenderer() { + if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { + ShaderLinkHelper.setNewStaticShaderLinkHelper(); + } + + this.updateFovModifierHand(); + this.updateTorchFlicker(); + this.fogColor2 = this.fogColor1; + this.thirdPersonDistanceTemp = this.thirdPersonDistance; + + if (this.mc.gameSettings.smoothCamera) { + float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + float f1 = f * f * f * 8.0F; + this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); + this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); + this.smoothCamPartialTicks = 0.0F; + this.smoothCamYaw = 0.0F; + this.smoothCamPitch = 0.0F; + } else { + this.smoothCamFilterX = 0.0F; + this.smoothCamFilterY = 0.0F; + this.mouseFilterXAxis.reset(); + this.mouseFilterYAxis.reset(); + } + + if (this.mc.getRenderViewEntity() == null) { + this.mc.setRenderViewEntity(this.mc.thePlayer); + } + + Entity entity = this.mc.getRenderViewEntity(); + double d2 = entity.posX; + double d0 = entity.posY + (double) entity.getEyeHeight(); + double d1 = entity.posZ; + float f2 = this.mc.theWorld.getLightBrightness(new BlockPos(d2, d0, d1)); + float f3 = (float) this.mc.gameSettings.renderDistanceChunks / 16.0F; + f3 = MathHelper.clamp_float(f3, 0.0F, 1.0F); + float f4 = f2 * (1.0F - f3) + f3; + this.fogColor1 += (f4 - this.fogColor1) * 0.1F; + ++this.rendererUpdateCount; + this.itemRenderer.updateEquippedItem(); + this.addRainParticles(); + this.bossColorModifierPrev = this.bossColorModifier; + + if (BossStatus.hasColorModifier) { + this.bossColorModifier += 0.05F; + + if (this.bossColorModifier > 1.0F) { + this.bossColorModifier = 1.0F; + } + + BossStatus.hasColorModifier = false; + } else if (this.bossColorModifier > 0.0F) { + this.bossColorModifier -= 0.0125F; + } + } + + public ShaderGroup getShaderGroup() { + return this.theShaderGroup; + } + + public void updateShaderGroupSize(int width, int height) { + if (OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + this.theShaderGroup.createBindFramebuffers(width, height); + } + + this.mc.renderGlobal.createBindEntityOutlineFbs(width, height); + } + } + + public void getMouseOver(float partialTicks) { + Entity entity = this.mc.getRenderViewEntity(); + + if (entity != null && this.mc.theWorld != null) { + this.mc.mcProfiler.startSection("pick"); + this.mc.pointedEntity = null; + double d0 = (double) this.mc.playerController.getBlockReachDistance(); + this.mc.objectMouseOver = entity.rayTrace(d0, partialTicks); + double d1 = d0; + Vec3 vec3 = entity.getPositionEyes(partialTicks); + boolean flag = false; + int i = 3; + + if (this.mc.playerController.extendedReach()) { + d0 = 6.0D; + d1 = 6.0D; + } else if (d0 > 3.0D) { + flag = true; + } + + if (this.mc.objectMouseOver != null) { + d1 = this.mc.objectMouseOver.hitVec.distanceTo(vec3); + } + + Vec3 vec31 = entity.getLook(partialTicks); + Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0); + this.pointedEntity = null; + Vec3 vec33 = null; + float f = 1.0F; + List list = this.mc.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand((double) f, (double) f, (double) f), Predicates.and(EntitySelectors.NOT_SPECTATING, new Predicate() { + public boolean apply(Entity p_apply_1_) { + return p_apply_1_.canBeCollidedWith(); + } + })); + double d2 = d1; + + for (int j = 0; j < list.size(); ++j) { + Entity entity1 = (Entity) list.get(j); + float f1 = entity1.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double) f1, (double) f1, (double) f1); + MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32); + + if (axisalignedbb.isVecInside(vec3)) { + if (d2 >= 0.0D) { + this.pointedEntity = entity1; + vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec; + d2 = 0.0D; + } + } else if (movingobjectposition != null) { + double d3 = vec3.distanceTo(movingobjectposition.hitVec); + + if (d3 < d2 || d2 == 0.0D) { + boolean flag1 = false; + + if (Reflector.ForgeEntity_canRiderInteract.exists()) { + flag1 = Reflector.callBoolean(entity1, Reflector.ForgeEntity_canRiderInteract, new Object[0]); + } + + if (!flag1 && entity1 == entity.ridingEntity) { + if (d2 == 0.0D) { + this.pointedEntity = entity1; + vec33 = movingobjectposition.hitVec; + } + } else { + this.pointedEntity = entity1; + vec33 = movingobjectposition.hitVec; + d2 = d3; + } + } + } + } + + if (this.pointedEntity != null && flag && vec3.distanceTo(vec33) > 3.0D) { + this.pointedEntity = null; + this.mc.objectMouseOver = new MovingObjectPosition(MovingObjectType.MISS, vec33, (EnumFacing) null, new BlockPos(vec33)); + } + + if (this.pointedEntity != null && (d2 < d1 || this.mc.objectMouseOver == null)) { + this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity, vec33); + + if (this.pointedEntity instanceof EntityLivingBase || this.pointedEntity instanceof EntityItemFrame) { + this.mc.pointedEntity = this.pointedEntity; + } + } + + this.mc.mcProfiler.endSection(); + } + } + + private void updateFovModifierHand() { + + float f = 1.0F; + + if (this.mc.getRenderViewEntity() instanceof AbstractClientPlayer) { + AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer) this.mc.getRenderViewEntity(); + f = abstractclientplayer.getFovModifier(); + } + + this.fovModifierHandPrev = this.fovModifierHand; + this.fovModifierHand += (f - this.fovModifierHand) * 0.5F; + + if (this.fovModifierHand > 1.5F) { + this.fovModifierHand = 1.5F; + } + + if (this.fovModifierHand < 0.1F) { + this.fovModifierHand = 0.1F; + } + } + + private float getFOVModifier(float partialTicks, boolean useFOVSetting) { + + if (this.debugView) { + return 90.0F; + } else { + Entity entity = this.mc.getRenderViewEntity(); + float f = 70.0F; + + if (useFOVSetting) { + f = this.mc.gameSettings.fovSetting; + + if (Config.isDynamicFov()) { + f *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * partialTicks; + } + } + + boolean flag = false; + + if (this.mc.currentScreen == null) { + flag = GameSettings.isKeyDown(this.mc.gameSettings.ofKeyBindZoom); + } + + if (flag) { + if (!Config.zoomMode) { + Config.zoomMode = true; + Config.zoomSmoothCamera = this.mc.gameSettings.smoothCamera; + this.mc.gameSettings.smoothCamera = true; + this.mc.renderGlobal.displayListEntitiesDirty = true; + } + + if (Config.zoomMode) { + f /= 4.0F; + } + } else if (Config.zoomMode) { + Config.zoomMode = false; + this.mc.gameSettings.smoothCamera = Config.zoomSmoothCamera; + this.mouseFilterXAxis = new MouseFilter(); + this.mouseFilterYAxis = new MouseFilter(); + this.mc.renderGlobal.displayListEntitiesDirty = true; + } + + if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0.0F) { + float f1 = (float) ((EntityLivingBase) entity).deathTime + partialTicks; + f /= (1.0F - 500.0F / (f1 + 500.0F)) * 2.0F + 1.0F; + } + + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); + + if (block.getMaterial() == Material.water) { + f = f * 60.0F / 70.0F; + } + + return Reflector.ForgeHooksClient_getFOVModifier.exists() ? Reflector.callFloat(Reflector.ForgeHooksClient_getFOVModifier, new Object[]{this, entity, block, Float.valueOf(partialTicks), Float.valueOf(f)}) : f; + } + } + + private void hurtCameraEffect(float partialTicks) { + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + boolean disableHurtCam = perspectiveMod.isEnabled() && !perspectiveMod.damageAffectsCamera.getBooleanValue(); + float hurtCameraIntensity = perspectiveMod.hurtCameraIntensity.getFloatValue(); + + if (disableHurtCam) + return; + + if (this.mc.getRenderViewEntity() instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) this.mc.getRenderViewEntity(); + float f = (float) entitylivingbase.hurtTime - partialTicks; + + if (entitylivingbase.getHealth() <= 0.0F) { + float f1 = (float) entitylivingbase.deathTime + partialTicks; + GlStateManager.rotate(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F); + } + + if (f < 0.0F) { + return; + } + + f = f / (float) entitylivingbase.maxHurtTime; + f = MathHelper.sin(f * f * f * f * (float) Math.PI); + float f2 = entitylivingbase.attackedAtYaw; + GlStateManager.rotate(-f2, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-f * (perspectiveMod.isEnabled() ? hurtCameraIntensity : 14.0F), 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(f2, 0.0F, 1.0F, 0.0F); + } + } + + private void setupViewBobbing(float partialTicks) { + if (this.mc.getRenderViewEntity() instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) this.mc.getRenderViewEntity(); + float f = entityplayer.distanceWalkedModified - entityplayer.prevDistanceWalkedModified; + float f1 = -(entityplayer.distanceWalkedModified + f * partialTicks); + float f2 = entityplayer.prevCameraYaw + (entityplayer.cameraYaw - entityplayer.prevCameraYaw) * partialTicks; + float f3 = entityplayer.prevCameraPitch + (entityplayer.cameraPitch - entityplayer.prevCameraPitch) * partialTicks; + GlStateManager.translate(MathHelper.sin(f1 * (float) Math.PI) * f2 * 0.5F, -Math.abs(MathHelper.cos(f1 * (float) Math.PI) * f2), 0.0F); + GlStateManager.rotate(MathHelper.sin(f1 * (float) Math.PI) * f2 * 3.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(Math.abs(MathHelper.cos(f1 * (float) Math.PI - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(f3, 1.0F, 0.0F, 0.0F); + } + } + + private void freelookOrientCamera(float partialTicks) { + ModuleDragToLook var2 = CheatBreaker.getInstance().getModuleManager().dragToLook; + Entity entity = this.mc.getRenderViewEntity(); + float f = this.mc.getRenderViewEntity() != this.mc.thePlayer ? entity.getEyeHeight() : SneakHandler.getInstance().getEyeHeight(partialTicks); + double d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double) partialTicks; + double d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double) partialTicks + (double) f; + double d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double) partialTicks; + + if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPlayerSleeping()) { + f = (float) ((double) f + 1.0D); + GlStateManager.translate(0.0F, 0.3F, 0.0F); + + if (!this.mc.gameSettings.debugCamEnable) { + BlockPos blockpos = new BlockPos(entity); + IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (Reflector.ForgeHooksClient_orientBedCamera.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_orientBedCamera, new Object[]{this.mc.theWorld, blockpos, iblockstate, entity}); + } else if (block == Blocks.bed) { + int j = ((EnumFacing) iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); + GlStateManager.rotate((float) (j * 90), 0.0F, 1.0F, 0.0F); + } + + GlStateManager.rotate(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F); + GlStateManager.rotate(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F); + } + } else if (this.mc.gameSettings.thirdPersonView > 0) { + double d3 = (double) (this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * partialTicks); + + if (this.mc.gameSettings.debugCamEnable) { + GlStateManager.translate(0.0F, 0.0F, (float) (-d3)); + } else { + float f1 = var2.rotationYaw; + float f2 = var2.rotationPitch; + + if (this.mc.gameSettings.thirdPersonView == 2) { + f2 += 180.0F; + } + + double d4 = (double) (-MathHelper.sin(f1 / 180.0F * (float) Math.PI) * MathHelper.cos(f2 / 180.0F * (float) Math.PI)) * d3; + double d5 = (double) (MathHelper.cos(f1 / 180.0F * (float) Math.PI) * MathHelper.cos(f2 / 180.0F * (float) Math.PI)) * d3; + double d6 = (double) (-MathHelper.sin(f2 / 180.0F * (float) Math.PI)) * d3; + + for (int i = 0; i < 8; ++i) { + float f3 = (float) ((i & 1) * 2 - 1); + float f4 = (float) ((i >> 1 & 1) * 2 - 1); + float f5 = (float) ((i >> 2 & 1) * 2 - 1); + f3 = f3 * 0.1F; + f4 = f4 * 0.1F; + f5 = f5 * 0.1F; + MovingObjectPosition movingobjectposition = this.mc.theWorld.rayTraceBlocks(new Vec3(d0 + (double) f3, d1 + (double) f4, d2 + (double) f5), new Vec3(d0 - d4 + (double) f3 + (double) f5, d1 - d6 + (double) f4, d2 - d5 + (double) f5)); + + if (movingobjectposition != null) { + double d7 = movingobjectposition.hitVec.distanceTo(new Vec3(d0, d1, d2)); + + if (d7 < d3) { + d3 = d7; + } + } + } + + if (this.mc.gameSettings.thirdPersonView == 2) { + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + } + + GlStateManager.rotate(var2.rotationPitch - f2, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(var2.rotationYaw - f1, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, 0.0F, (float) (-d3)); + GlStateManager.rotate(f1 - var2.rotationYaw, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f2 - var2.rotationPitch, 1.0F, 0.0F, 0.0F); + } + } else { + GlStateManager.translate(0.0F, 0.0F, -0.1F); + } + + if (Reflector.EntityViewRenderEvent_CameraSetup_Constructor.exists()) { + if (!this.mc.gameSettings.debugCamEnable) { + float f6 = var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * partialTicks + 180.0F; + float f7 = var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * partialTicks; + float f8 = 0.0F; + + if (entity instanceof EntityAnimal) { + EntityAnimal entityanimal1 = (EntityAnimal) entity; + f6 = entityanimal1.prevRotationYawHead + (entityanimal1.rotationYawHead - entityanimal1.prevRotationYawHead) * partialTicks + 180.0F; + } + + Block block1 = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); + Object object = Reflector.newInstance(Reflector.EntityViewRenderEvent_CameraSetup_Constructor, new Object[]{this, entity, block1, Float.valueOf(partialTicks), Float.valueOf(f6), Float.valueOf(f7), Float.valueOf(f8)}); + Reflector.postForgeBusEvent(object); + GlStateManager.rotate(f8, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(f7, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(f6, 0.0F, 1.0F, 0.0F); + } + } else if (!this.mc.gameSettings.debugCamEnable) { + GlStateManager.rotate(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * partialTicks, 1.0F, 0.0F, 0.0F); + + if (entity instanceof EntityAnimal) { + EntityAnimal entityanimal = (EntityAnimal) entity; + GlStateManager.rotate(entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); + } else { + GlStateManager.rotate(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); + } + } + + GlStateManager.translate(0.0F, -f, 0.0F); + d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double) partialTicks; + d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double) partialTicks + (double) f; + d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double) partialTicks; + this.cloudFog = this.mc.renderGlobal.hasCloudFog(d0, d1, d2, partialTicks); + } + + private void orientCamera(float partialTicks) { + Entity entity = this.mc.getRenderViewEntity(); + float f = this.mc.getRenderViewEntity() != this.mc.thePlayer ? entity.getEyeHeight() : SneakHandler.getInstance().getEyeHeight(partialTicks); + double d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double) partialTicks; + double d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double) partialTicks + (double) f; + double d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double) partialTicks; + + if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPlayerSleeping()) { + f = (float) ((double) f + 1.0D); + GlStateManager.translate(0.0F, 0.3F, 0.0F); + + if (!this.mc.gameSettings.debugCamEnable) { + BlockPos blockpos = new BlockPos(entity); + IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (Reflector.ForgeHooksClient_orientBedCamera.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_orientBedCamera, new Object[]{this.mc.theWorld, blockpos, iblockstate, entity}); + } else if (block == Blocks.bed) { + int j = ((EnumFacing) iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); + GlStateManager.rotate((float) (j * 90), 0.0F, 1.0F, 0.0F); + } + + GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F); + GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F); + } + } else if (this.mc.gameSettings.thirdPersonView > 0) { + double d3 = (double) (this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * partialTicks); + + if (this.mc.gameSettings.debugCamEnable) { + GlStateManager.translate(0.0F, 0.0F, (float) (-d3)); + } else { + float f1 = entity.rotationYaw; + float f2 = entity.rotationPitch; + + if (this.mc.gameSettings.thirdPersonView == 2) { + f2 += 180.0F; + } + + double d4 = (double) (-MathHelper.sin(f1 / 180.0F * (float) Math.PI) * MathHelper.cos(f2 / 180.0F * (float) Math.PI)) * d3; + double d5 = (double) (MathHelper.cos(f1 / 180.0F * (float) Math.PI) * MathHelper.cos(f2 / 180.0F * (float) Math.PI)) * d3; + double d6 = (double) (-MathHelper.sin(f2 / 180.0F * (float) Math.PI)) * d3; + + for (int i = 0; i < 8; ++i) { + float f3 = (float) ((i & 1) * 2 - 1); + float f4 = (float) ((i >> 1 & 1) * 2 - 1); + float f5 = (float) ((i >> 2 & 1) * 2 - 1); + f3 = f3 * 0.1F; + f4 = f4 * 0.1F; + f5 = f5 * 0.1F; + MovingObjectPosition movingobjectposition = this.mc.theWorld.rayTraceBlocks(new Vec3(d0 + (double) f3, d1 + (double) f4, d2 + (double) f5), new Vec3(d0 - d4 + (double) f3 + (double) f5, d1 - d6 + (double) f4, d2 - d5 + (double) f5)); + + if (movingobjectposition != null) { + double d7 = movingobjectposition.hitVec.distanceTo(new Vec3(d0, d1, d2)); + + if (d7 < d3) { + d3 = d7; + } + } + } + + if (this.mc.gameSettings.thirdPersonView == 2) { + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + } + + GlStateManager.rotate(entity.rotationPitch - f2, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(entity.rotationYaw - f1, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, 0.0F, (float) (-d3)); + GlStateManager.rotate(f1 - entity.rotationYaw, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f2 - entity.rotationPitch, 1.0F, 0.0F, 0.0F); + } + } else { + GlStateManager.translate(0.0F, 0.0F, -0.1F); + } + + if (Reflector.EntityViewRenderEvent_CameraSetup_Constructor.exists()) { + if (!this.mc.gameSettings.debugCamEnable) { + float f6 = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F; + float f7 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks; + float f8 = 0.0F; + + if (entity instanceof EntityAnimal) { + EntityAnimal entityanimal1 = (EntityAnimal) entity; + f6 = entityanimal1.prevRotationYawHead + (entityanimal1.rotationYawHead - entityanimal1.prevRotationYawHead) * partialTicks + 180.0F; + } + + Block block1 = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); + Object object = Reflector.newInstance(Reflector.EntityViewRenderEvent_CameraSetup_Constructor, new Object[]{this, entity, block1, Float.valueOf(partialTicks), Float.valueOf(f6), Float.valueOf(f7), Float.valueOf(f8)}); + Reflector.postForgeBusEvent(object); + f8 = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_CameraSetup_roll, f8); + f7 = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_CameraSetup_pitch, f7); + f6 = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_CameraSetup_yaw, f6); + GlStateManager.rotate(f8, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(f7, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(f6, 0.0F, 1.0F, 0.0F); + } + } else if (!this.mc.gameSettings.debugCamEnable) { + GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 1.0F, 0.0F, 0.0F); + + if (entity instanceof EntityAnimal) { + EntityAnimal entityanimal = (EntityAnimal) entity; + GlStateManager.rotate(entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); + } else { + GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, 1.0F, 0.0F); + } + } + + GlStateManager.translate(0.0F, -f, 0.0F); + d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double) partialTicks; + d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double) partialTicks + (double) f; + d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double) partialTicks; + this.cloudFog = this.mc.renderGlobal.hasCloudFog(d0, d1, d2, partialTicks); + } + + public void setupCameraTransform(float partialTicks, int pass) { + this.farPlaneDistance = (float) (this.mc.gameSettings.renderDistanceChunks * 16); + + if (Config.isFogFancy()) { + this.farPlaneDistance *= 0.95F; + } + + if (Config.isFogFast()) { + this.farPlaneDistance *= 0.83F; + } + + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + float f = 0.07F; + + if (this.mc.gameSettings.anaglyph) { + GlStateManager.translate((float) (-(pass * 2 - 1)) * f, 0.0F, 0.0F); + } + + this.clipDistance = this.farPlaneDistance * 2.0F; + + if (this.clipDistance < 173.0F) { + this.clipDistance = 173.0F; + } + + if (this.cameraZoom != 1.0D) { + GlStateManager.translate((float) this.cameraYaw, (float) (-this.cameraPitch), 0.0F); + GlStateManager.scale(this.cameraZoom, this.cameraZoom, 1.0D); + } + + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.clipDistance); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + + if (this.mc.gameSettings.anaglyph) { + GlStateManager.translate((float) (pass * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + this.hurtCameraEffect(partialTicks); + + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + if (this.mc.gameSettings.viewBobbing) { + if (perspectiveMod.isEnabled()) { + perspectiveMod.setupViewBobbing(partialTicks, perspectiveMod.bobScreen); + } else { + this.setupViewBobbing(partialTicks); + } + } + + float f1 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * partialTicks; + + if (f1 > 0.0F) { + int i = 20; + + if (this.mc.thePlayer.isPotionActive(Potion.confusion)) { + i = 7; + } + + float f2 = 5.0F / (f1 * f1 + 5.0F) - f1 * 0.04F; + f2 = f2 * f2; + GlStateManager.rotate(((float) this.rendererUpdateCount + partialTicks) * (float) i, 0.0F, 1.0F, 1.0F); + GlStateManager.scale(1.0F / f2, 1.0F, 1.0F); + GlStateManager.rotate(-((float) this.rendererUpdateCount + partialTicks) * (float) i, 0.0F, 1.0F, 1.0F); + } + + if (CheatBreaker.getInstance().getModuleManager().dragToLook.enabled) { + this.freelookOrientCamera(partialTicks); + } else { + this.orientCamera(partialTicks); + } + + if (this.debugView) { + switch (this.debugViewDirection) { + case 0: + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + break; + + case 1: + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + break; + + case 2: + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + break; + + case 3: + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + break; + + case 4: + GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); + } + } + } + + private void renderHand(float partialTicks, int xOffset) { + this.renderHand(partialTicks, xOffset, true, true, false); + } + + public void renderHand(float p_renderHand_1_, int p_renderHand_2_, boolean p_renderHand_3_, boolean p_renderHand_4_, boolean p_renderHand_5_) { + if (!this.debugView) { + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + float f = 0.07F; + + if (this.mc.gameSettings.anaglyph) { + GlStateManager.translate((float) (-(p_renderHand_2_ * 2 - 1)) * f, 0.0F, 0.0F); + } + + if (Config.isShaders()) { + Shaders.applyHandDepth(); + } + + Project.gluPerspective(this.getFOVModifier(p_renderHand_1_, false), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + + if (this.mc.gameSettings.anaglyph) { + GlStateManager.translate((float) (p_renderHand_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + boolean flag = false; + + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + if (p_renderHand_3_) { + GlStateManager.pushMatrix(); + this.hurtCameraEffect(p_renderHand_1_); + + if (this.mc.gameSettings.viewBobbing) { + if (perspectiveMod.isEnabled()) { + perspectiveMod.setupViewBobbing(p_renderHand_1_, perspectiveMod.bobScreen); + } else { + this.setupViewBobbing(p_renderHand_1_); + } + } + + flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase) this.mc.getRenderViewEntity()).isPlayerSleeping(); + boolean flag1 = !ReflectorForge.renderFirstPersonHand(this.mc.renderGlobal, p_renderHand_1_, p_renderHand_2_); + + if (flag1 && this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator()) { + this.enableLightmap(); + + if (Config.isShaders()) { + ShadersRender.renderItemFP(this.itemRenderer, p_renderHand_1_, p_renderHand_5_); + } else { + this.itemRenderer.renderItemInFirstPerson(p_renderHand_1_); + } + + this.disableLightmap(); + } + + GlStateManager.popMatrix(); + } + + if (!p_renderHand_4_) { + return; + } + + this.disableLightmap(); + + if (this.mc.gameSettings.thirdPersonView == 0 && !flag) { + this.itemRenderer.renderOverlays(p_renderHand_1_); + this.hurtCameraEffect(p_renderHand_1_); + } + + if (this.mc.gameSettings.viewBobbing) { + if (perspectiveMod.isEnabled()) { + perspectiveMod.setupViewBobbing(p_renderHand_1_, perspectiveMod.bobScreen); + } else { + this.setupViewBobbing(p_renderHand_1_); + } + } + } + } + + public void disableLightmap() { + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + + if (Config.isShaders()) { + Shaders.disableLightmap(); + } + } + + public void enableLightmap() { + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + float f = 0.00390625F; + GlStateManager.scale(f, f, f); + GlStateManager.translate(8.0F, 8.0F, 8.0F); + GlStateManager.matrixMode(5888); + this.mc.getTextureManager().bindTexture(this.locationLightMap); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + + if (Config.isShaders()) { + Shaders.enableLightmap(); + } + } + + private void updateTorchFlicker() { + this.torchFlickerDX = (float) ((double) this.torchFlickerDX + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.torchFlickerDX = (float) ((double) this.torchFlickerDX * 0.9D); + this.torchFlickerX += (this.torchFlickerDX - this.torchFlickerX) * 1.0F; + this.lightmapUpdateNeeded = true; + } + + private void updateLightmap(float partialTicks) { + if (this.lightmapUpdateNeeded) { + this.mc.mcProfiler.startSection("lightTex"); + World world = this.mc.theWorld; + + if (world != null) { + if (Config.isCustomColors() && CustomColors.updateLightmap(world, this.torchFlickerX, this.lightmapColors, this.mc.thePlayer.isPotionActive(Potion.nightVision), partialTicks)) { + this.lightmapTexture.updateDynamicTexture(); + this.lightmapUpdateNeeded = false; + this.mc.mcProfiler.endSection(); + return; + } + + float f = world.getSunBrightness(1.0F); + float f1 = f * 0.95F + 0.05F; + + for (int i = 0; i < 256; ++i) { + float f2 = world.provider.getLightBrightnessTable()[i / 16] * f1; + float f3 = world.provider.getLightBrightnessTable()[i % 16] * (this.torchFlickerX * 0.1F + 1.5F); + + if (world.getLastLightningBolt() > 0) { + f2 = world.provider.getLightBrightnessTable()[i / 16]; + } + + float f4 = f2 * (f * 0.65F + 0.35F); + float f5 = f2 * (f * 0.65F + 0.35F); + float f6 = f3 * ((f3 * 0.6F + 0.4F) * 0.6F + 0.4F); + float f7 = f3 * (f3 * f3 * 0.6F + 0.4F); + float f8 = f4 + f3; + float f9 = f5 + f6; + float f10 = f2 + f7; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + + if (this.bossColorModifier > 0.0F) { + float f11 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * partialTicks; + f8 = f8 * (1.0F - f11) + f8 * 0.7F * f11; + f9 = f9 * (1.0F - f11) + f9 * 0.6F * f11; + f10 = f10 * (1.0F - f11) + f10 * 0.6F * f11; + } + + if (world.provider.getDimensionId() == 1) { + f8 = 0.22F + f3 * 0.75F; + f9 = 0.28F + f6 * 0.75F; + f10 = 0.25F + f7 * 0.75F; + } + + if (this.mc.thePlayer.isPotionActive(Potion.nightVision)) { + float f15 = this.getNightVisionBrightness(this.mc.thePlayer, partialTicks); + float f12 = 1.0F / f8; + + if (f12 > 1.0F / f9) { + f12 = 1.0F / f9; + } + + if (f12 > 1.0F / f10) { + f12 = 1.0F / f10; + } + + f8 = f8 * (1.0F - f15) + f8 * f12 * f15; + f9 = f9 * (1.0F - f15) + f9 * f12 * f15; + f10 = f10 * (1.0F - f15) + f10 * f12 * f15; + } + + if (f8 > 1.0F) { + f8 = 1.0F; + } + + if (f9 > 1.0F) { + f9 = 1.0F; + } + + if (f10 > 1.0F) { + f10 = 1.0F; + } + + float f16 = this.mc.gameSettings.gammaSetting; + float f17 = 1.0F - f8; + float f13 = 1.0F - f9; + float f14 = 1.0F - f10; + f17 = 1.0F - f17 * f17 * f17 * f17; + f13 = 1.0F - f13 * f13 * f13 * f13; + f14 = 1.0F - f14 * f14 * f14 * f14; + f8 = f8 * (1.0F - f16) + f17 * f16; + f9 = f9 * (1.0F - f16) + f13 * f16; + f10 = f10 * (1.0F - f16) + f14 * f16; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + + if (f8 > 1.0F) { + f8 = 1.0F; + } + + if (f9 > 1.0F) { + f9 = 1.0F; + } + + if (f10 > 1.0F) { + f10 = 1.0F; + } + + if (f8 < 0.0F) { + f8 = 0.0F; + } + + if (f9 < 0.0F) { + f9 = 0.0F; + } + + if (f10 < 0.0F) { + f10 = 0.0F; + } + + int j = 255; + int k = (int) (f8 * 255.0F); + int l = (int) (f9 * 255.0F); + int i1 = (int) (f10 * 255.0F); + this.lightmapColors[i] = j << 24 | k << 16 | l << 8 | i1; + } + + this.lightmapTexture.updateDynamicTexture(); + this.lightmapUpdateNeeded = false; + this.mc.mcProfiler.endSection(); + } + } + } + + public float getNightVisionBrightness(EntityLivingBase entitylivingbaseIn, float partialTicks) { + int i = entitylivingbaseIn.getActivePotionEffect(Potion.nightVision).getDuration(); + return i > 200 ? 1.0F : 0.7F + MathHelper.sin(((float) i - partialTicks) * (float) Math.PI * 0.2F) * 0.3F; + } + + public void updateCameraAndRender(float partialTicks, long nanoTime) { + Config.renderPartialTicks = partialTicks; + this.frameInit(); + boolean flag = Display.isActive(); + + if (!flag && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) { + if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) { + this.mc.displayInGameMenu(); + } + } else { + this.prevFrameTime = Minecraft.getSystemTime(); + } + + this.mc.mcProfiler.startSection("mouse"); + + if (flag && Minecraft.isRunningOnMac && this.mc.inGameHasFocus && !Mouse.isInsideWindow()) { + Mouse.setGrabbed(false); + Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); + Mouse.setGrabbed(true); + } + + if (this.mc.inGameHasFocus && flag) { + this.mc.mouseHelper.mouseXYChange(); + float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + float f1 = f * f * f * 8.0F; + float f2 = (float) this.mc.mouseHelper.deltaX * f1; + float f3 = (float) this.mc.mouseHelper.deltaY * f1; + int i = 1; + + if (this.mc.gameSettings.invertMouse) { + i = -1; + } + + ModuleDragToLook var9 = CheatBreaker.getInstance().getModuleManager().dragToLook; + if (!var9.enabled) { + if (this.mc.gameSettings.smoothCamera) { + this.smoothCamYaw += f2; + this.smoothCamPitch += f3; + float f4 = partialTicks - this.smoothCamPartialTicks; + this.smoothCamPartialTicks = partialTicks; + f2 = this.smoothCamFilterX * f4; + f3 = this.smoothCamFilterY * f4; + this.mc.thePlayer.setAngles(f2, f3 * (float) i); + } else { + this.smoothCamYaw = 0.0F; + this.smoothCamPitch = 0.0F; + this.mc.thePlayer.setAngles(f2, f3 * (float) i); + } + } else { + if (this.mc.gameSettings.smoothCamera) { + this.smoothCamYaw += f2; + this.smoothCamPitch += f3; + float var18 = partialTicks - this.smoothCamPartialTicks; + this.smoothCamPartialTicks = partialTicks; + f2 = this.smoothCamFilterX * var18; + f3 = this.smoothCamFilterY * var18; + var9.setAngles(f2, f3 * (float) i); + } else { + this.smoothCamYaw = 0.0F; + this.smoothCamPitch = 0.0F; + var9.setAngles(f2, f3 * (float) i); + } + } +// if (this.mc.gameSettings.smoothCamera) +// { +// this.smoothCamYaw += f2; +// this.smoothCamPitch += f3; +// float f4 = partialTicks - this.smoothCamPartialTicks; +// this.smoothCamPartialTicks = partialTicks; +// f2 = this.smoothCamFilterX * f4; +// f3 = this.smoothCamFilterY * f4; +// this.mc.thePlayer.setAngles(f2, f3 * (float)i); +// } else { +// this.smoothCamYaw = 0.0F; +// this.smoothCamPitch = 0.0F; +// this.mc.thePlayer.setAngles(f2, f3 * (float)i); +// } + } + + this.mc.mcProfiler.endSection(); + + if (!this.mc.skipRenderWorld) { + anaglyphEnable = this.mc.gameSettings.anaglyph; + final ScaledResolution scaledresolution = new ScaledResolution(this.mc); + int i1 = scaledresolution.getScaledWidth(); + int j1 = scaledresolution.getScaledHeight(); + final int k1 = Mouse.getX() * i1 / this.mc.displayWidth; + final int l1 = j1 - Mouse.getY() * j1 / this.mc.displayHeight - 1; + int i2 = this.mc.gameSettings.limitFramerate; + + if (this.mc.theWorld != null) { + this.mc.mcProfiler.startSection("level"); + int j = Math.min(Minecraft.getDebugFPS(), i2); + j = Math.max(j, 60); + long k = System.nanoTime() - nanoTime; + long l = Math.max((long) (1000000000 / j / 4) - k, 0L); + this.renderWorld(partialTicks, System.nanoTime() + l); + + if (OpenGlHelper.shadersSupported) { + this.mc.renderGlobal.renderEntityOutlineFramebuffer(); + + if (this.theShaderGroup != null && this.useShader) { + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + this.theShaderGroup.loadShaderGroup(partialTicks); + GlStateManager.popMatrix(); + } + + this.mc.getFramebuffer().bindFramebuffer(true); + } + + this.renderEndNanoTime = System.nanoTime(); + this.mc.mcProfiler.endStartSection("gui"); + + if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) { + GlStateManager.alphaFunc(516, 0.1F); + this.mc.ingameGUI.renderGameOverlay(partialTicks); + + if (this.mc.gameSettings.ofShowFps && !this.mc.gameSettings.showDebugInfo) { + Config.drawFps(); + } + + if (this.mc.gameSettings.showDebugInfo) { + Lagometer.showLagometer(scaledresolution); + } + } + + this.mc.mcProfiler.endSection(); + } else { + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + this.setupOverlayRendering(); + this.renderEndNanoTime = System.nanoTime(); + TileEntityRendererDispatcher.instance.renderEngine = this.mc.getTextureManager(); + TileEntityRendererDispatcher.instance.fontRenderer = this.mc.fontRendererObj; + } + + if (this.mc.currentScreen != null) { + GlStateManager.clear(256); + + try { + if (Reflector.ForgeHooksClient_drawScreen.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_drawScreen, new Object[]{this.mc.currentScreen, Integer.valueOf(k1), Integer.valueOf(l1), Float.valueOf(partialTicks)}); + } else { + this.mc.currentScreen.drawScreen(k1, l1, partialTicks); + } + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering screen"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Screen render details"); + crashreportcategory.addCrashSectionCallable("Screen name", new Callable() { + public String call() throws Exception { + return EntityRenderer.this.mc.currentScreen.getClass().getCanonicalName(); + } + }); + crashreportcategory.addCrashSectionCallable("Mouse location", new Callable() { + public String call() throws Exception { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[]{Integer.valueOf(k1), Integer.valueOf(l1), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); + } + }); + crashreportcategory.addCrashSectionCallable("Screen size", new Callable() { + public String call() throws Exception { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[]{Integer.valueOf(scaledresolution.getScaledWidth()), Integer.valueOf(scaledresolution.getScaledHeight()), Integer.valueOf(EntityRenderer.this.mc.displayWidth), Integer.valueOf(EntityRenderer.this.mc.displayHeight), Integer.valueOf(scaledresolution.getScaleFactor())}); + } + }); + throw new ReportedException(crashreport); + } + } + } + + this.frameFinish(); + this.waitForServerThread(); + MemoryMonitor.update(); + Lagometer.updateLagometer(); + + if (this.mc.gameSettings.ofProfiler) { + this.mc.gameSettings.showDebugProfilerChart = true; + } + } + + private boolean isDrawBlockOutline() { + if (!this.drawBlockOutline) { + return false; + } else { + Entity entity = this.mc.getRenderViewEntity(); + boolean flag = entity instanceof EntityPlayer && !this.mc.gameSettings.hideGUI; + + if (flag && !((EntityPlayer) entity).capabilities.allowEdit) { + ItemStack itemstack = ((EntityPlayer) entity).getCurrentEquippedItem(); + + if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectType.BLOCK) { + BlockPos blockpos = this.mc.objectMouseOver.getBlockPos(); + IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (this.mc.playerController.getCurrentGameType() == GameType.SPECTATOR) { + flag = ReflectorForge.blockHasTileEntity(iblockstate) && this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory; + } else { + flag = itemstack != null && (itemstack.canDestroy(block) || itemstack.canPlaceOn(block)); + } + } + } + + return flag; + } + } + + private void renderWorldDirections(float partialTicks) { + if (this.mc.gameSettings.showDebugInfo && !this.mc.gameSettings.hideGUI && !this.mc.thePlayer.hasReducedDebug() && !this.mc.gameSettings.reducedDebugInfo) { + Entity entity = this.mc.getRenderViewEntity(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glLineWidth(1.0F); + GlStateManager.disableTexture2D(); + GlStateManager.depthMask(false); + GlStateManager.pushMatrix(); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + if (CheatBreaker.getInstance().getModuleManager().dragToLook.enabled) { + this.freelookOrientCamera(partialTicks); + } else { + this.orientCamera(partialTicks); + } + GlStateManager.translate(0.0F, entity.getEyeHeight(), 0.0F); + RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.005D, 1.0E-4D, 1.0E-4D), 255, 0, 0, 255); + RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0E-4D, 1.0E-4D, 0.005D), 0, 0, 255, 255); + RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0E-4D, 0.0033D, 1.0E-4D), 0, 255, 0, 255); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + } + } + + public void renderWorld(float partialTicks, long finishTimeNano) { + this.updateLightmap(partialTicks); + + if (this.mc.getRenderViewEntity() == null) { + this.mc.setRenderViewEntity(this.mc.thePlayer); + } + + this.getMouseOver(partialTicks); + + if (Config.isShaders()) { + Shaders.beginRender(this.mc, partialTicks, finishTimeNano); + } + + GlStateManager.enableDepth(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + this.mc.mcProfiler.startSection("center"); + + if (this.mc.gameSettings.anaglyph) { + anaglyphField = 0; + GlStateManager.colorMask(false, true, true, false); + this.renderWorldPass(0, partialTicks, finishTimeNano); + anaglyphField = 1; + GlStateManager.colorMask(true, false, false, false); + this.renderWorldPass(1, partialTicks, finishTimeNano); + GlStateManager.colorMask(true, true, true, false); + } else { + this.renderWorldPass(2, partialTicks, finishTimeNano); + } + + this.mc.mcProfiler.endSection(); + } + + private void renderWorldPass(int pass, float partialTicks, long finishTimeNano) { + boolean flag = Config.isShaders(); + + if (flag) { + Shaders.beginRenderPass(pass, partialTicks, finishTimeNano); + } + + RenderGlobal renderglobal = this.mc.renderGlobal; + EffectRenderer effectrenderer = this.mc.effectRenderer; + boolean flag1 = this.isDrawBlockOutline(); + GlStateManager.enableCull(); + this.mc.mcProfiler.endStartSection("clear"); + + if (flag) { + Shaders.setViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + } else { + GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + } + + this.updateFogColor(partialTicks); + GlStateManager.clear(16640); + + if (flag) { + Shaders.clearRenderBuffer(); + } + + this.mc.mcProfiler.endStartSection("camera"); + this.setupCameraTransform(partialTicks, pass); + + if (flag) { + Shaders.setCamera(partialTicks); + } + + ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2); + this.mc.mcProfiler.endStartSection("frustum"); + ClippingHelper clippinghelper = ClippingHelperImpl.getInstance(); + this.mc.mcProfiler.endStartSection("culling"); + clippinghelper.disabled = Config.isShaders() && !Shaders.isFrustumCulling(); + ICamera icamera = new Frustum(clippinghelper); + Entity entity = this.mc.getRenderViewEntity(); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks; + + if (flag) { + ShadersRender.setFrustrumPosition(icamera, d0, d1, d2); + } else { + icamera.setPosition(d0, d1, d2); + } + + if ((Config.isSkyEnabled() || Config.isSunMoonEnabled() || Config.isStarsEnabled()) && !Shaders.isShadowPass) { + this.setupFog(-1, partialTicks); + this.mc.mcProfiler.endStartSection("sky"); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.clipDistance); + GlStateManager.matrixMode(5888); + + if (flag) { + Shaders.beginSky(); + } + + renderglobal.renderSky(partialTicks, pass); + + if (flag) { + Shaders.endSky(); + } + + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.clipDistance); + GlStateManager.matrixMode(5888); + } else { + GlStateManager.disableBlend(); + } + + this.setupFog(0, partialTicks); + GlStateManager.shadeModel(7425); + + if (entity.posY + (double) entity.getEyeHeight() < 128.0D + (double) (this.mc.gameSettings.ofCloudsHeight * 128.0F)) { + this.renderCloudsCheck(renderglobal, partialTicks, pass); + } + + this.mc.mcProfiler.endStartSection("prepareterrain"); + this.setupFog(0, partialTicks); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("terrain_setup"); + this.checkLoadVisibleChunks(entity, partialTicks, icamera, this.mc.thePlayer.isSpectator()); + + if (flag) { + ShadersRender.setupTerrain(renderglobal, entity, (double) partialTicks, icamera, this.frameCount++, this.mc.thePlayer.isSpectator()); + } else { + renderglobal.setupTerrain(entity, (double) partialTicks, icamera, this.frameCount++, this.mc.thePlayer.isSpectator()); + } + + if (pass == 0 || pass == 2) { + this.mc.mcProfiler.endStartSection("updatechunks"); + Lagometer.timerChunkUpload.start(); + this.mc.renderGlobal.updateChunks(finishTimeNano); + Lagometer.timerChunkUpload.end(); + } + + this.mc.mcProfiler.endStartSection("terrain"); + Lagometer.timerTerrain.start(); + + if (this.mc.gameSettings.ofSmoothFps && pass > 0) { + this.mc.mcProfiler.endStartSection("finish"); + GL11.glFinish(); + this.mc.mcProfiler.endStartSection("terrain"); + } + + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.disableAlpha(); + + if (flag) { + ShadersRender.beginTerrainSolid(); + } + + renderglobal.renderBlockLayer(EnumWorldBlockLayer.SOLID, (double) partialTicks, pass, entity); + GlStateManager.enableAlpha(); + + if (flag) { + ShadersRender.beginTerrainCutoutMipped(); + } + + this.mc.getTextureManager().getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, this.mc.gameSettings.mipmapLevels > 0); + renderglobal.renderBlockLayer(EnumWorldBlockLayer.CUTOUT_MIPPED, (double) partialTicks, pass, entity); + this.mc.getTextureManager().getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap(); + this.mc.getTextureManager().getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false); + + if (flag) { + ShadersRender.beginTerrainCutout(); + } + + renderglobal.renderBlockLayer(EnumWorldBlockLayer.CUTOUT, (double) partialTicks, pass, entity); + this.mc.getTextureManager().getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap(); + + if (flag) { + ShadersRender.endTerrain(); + } + + Lagometer.timerTerrain.end(); + GlStateManager.shadeModel(7424); + GlStateManager.alphaFunc(516, 0.1F); + + if (!this.debugView) { + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + + if (Reflector.ForgeHooksClient_setRenderPass.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(0)}); + } + + renderglobal.renderEntities(entity, icamera, partialTicks); + + if (Reflector.ForgeHooksClient_setRenderPass.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(-1)}); + } + + RenderHelper.disableStandardItemLighting(); + this.disableLightmap(); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + + if (this.mc.objectMouseOver != null && entity.isInsideOfMaterial(Material.water) && flag1) { + EntityPlayer entityplayer = (EntityPlayer) entity; + GlStateManager.disableAlpha(); + this.mc.mcProfiler.endStartSection("outline"); + if (CheatBreaker.getInstance().getModuleManager().blockOverlayMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().blockOverlayMod.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks, this.mc.theWorld); + } else { + renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks); + } +// renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks); + GlStateManager.enableAlpha(); + } + } + + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + + if (flag1 && this.mc.objectMouseOver != null && !entity.isInsideOfMaterial(Material.water)) { + EntityPlayer entityplayer1 = (EntityPlayer) entity; + GlStateManager.disableAlpha(); + this.mc.mcProfiler.endStartSection("outline"); + + if ((!Reflector.ForgeHooksClient_onDrawBlockHighlight.exists() || !Reflector.callBoolean(Reflector.ForgeHooksClient_onDrawBlockHighlight, new Object[]{renderglobal, entityplayer1, this.mc.objectMouseOver, Integer.valueOf(0), entityplayer1.getHeldItem(), Float.valueOf(partialTicks)})) && !this.mc.gameSettings.hideGUI) { + if (CheatBreaker.getInstance().getModuleManager().blockOverlayMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().blockOverlayMod.drawSelectionBox(entityplayer1, this.mc.objectMouseOver, 0, partialTicks, this.mc.theWorld); + } else { + renderglobal.drawSelectionBox(entityplayer1, this.mc.objectMouseOver, 0, partialTicks); + } + } + GlStateManager.enableAlpha(); + } + + if (!renderglobal.damagedBlocks.isEmpty()) { + this.mc.mcProfiler.endStartSection("destroyProgress"); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); + this.mc.getTextureManager().getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false); + renderglobal.drawBlockDamageTexture(Tessellator.getInstance(), Tessellator.getInstance().getWorldRenderer(), entity, partialTicks); + this.mc.getTextureManager().getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap(); + GlStateManager.disableBlend(); + } + + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.disableBlend(); + + if (!this.debugView) { + this.enableLightmap(); + this.mc.mcProfiler.endStartSection("litParticles"); + + if (flag) { + Shaders.beginLitParticles(); + } + + effectrenderer.renderLitParticles(entity, partialTicks); + RenderHelper.disableStandardItemLighting(); + this.setupFog(0, partialTicks); + this.mc.mcProfiler.endStartSection("particles"); + + if (flag) { + Shaders.beginParticles(); + } + + effectrenderer.renderParticles(entity, partialTicks); + + if (flag) { + Shaders.endParticles(); + } + + this.disableLightmap(); + } + + GlStateManager.depthMask(false); + + if (Config.isShaders()) { + GlStateManager.depthMask(Shaders.isRainDepth()); + } + + GlStateManager.enableCull(); + this.mc.mcProfiler.endStartSection("weather"); + + if (flag) { + Shaders.beginWeather(); + } + + this.renderRainSnow(partialTicks); + + if (flag) { + Shaders.endWeather(); + } + + GlStateManager.depthMask(true); + renderglobal.renderWorldBorder(entity, partialTicks); + + if (flag) { + ShadersRender.renderHand0(this, partialTicks, pass); + Shaders.preWater(); + } + + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.alphaFunc(516, 0.1F); + this.setupFog(0, partialTicks); + GlStateManager.enableBlend(); + GlStateManager.depthMask(false); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + GlStateManager.shadeModel(7425); + this.mc.mcProfiler.endStartSection("translucent"); + + if (flag) { + Shaders.beginWater(); + } + + renderglobal.renderBlockLayer(EnumWorldBlockLayer.TRANSLUCENT, (double) partialTicks, pass, entity); + + if (flag) { + Shaders.endWater(); + } + + if (Reflector.ForgeHooksClient_setRenderPass.exists() && !this.debugView) { + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(1)}); + this.mc.renderGlobal.renderEntities(entity, icamera, partialTicks); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(-1)}); + RenderHelper.disableStandardItemLighting(); + } + + GlStateManager.shadeModel(7424); + GlStateManager.depthMask(true); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GlStateManager.disableFog(); + + if (entity.posY + (double) entity.getEyeHeight() >= 128.0D + (double) (this.mc.gameSettings.ofCloudsHeight * 128.0F)) { + this.mc.mcProfiler.endStartSection("aboveClouds"); + this.renderCloudsCheck(renderglobal, partialTicks, pass); + } + + if (Reflector.ForgeHooksClient_dispatchRenderLast.exists()) { + this.mc.mcProfiler.endStartSection("forge_render_last"); + Reflector.callVoid(Reflector.ForgeHooksClient_dispatchRenderLast, new Object[]{renderglobal, Float.valueOf(partialTicks)}); + } + + this.mc.mcProfiler.endStartSection("hand"); + + if (this.renderHand && !Shaders.isShadowPass) { + if (flag) { + ShadersRender.renderHand1(this, partialTicks, pass); + Shaders.renderCompositeFinal(); + } + + GlStateManager.clear(256); + + if (flag) { + ShadersRender.renderFPOverlay(this, partialTicks, pass); + } else { + this.renderHand(partialTicks, pass); + } + + this.renderWorldDirections(partialTicks); + } + + if (flag) { + Shaders.endRender(); + } + } + + private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) { + if (this.mc.gameSettings.renderDistanceChunks >= 4 && !Config.isCloudsOff() && Shaders.shouldRenderClouds(this.mc.gameSettings)) { + this.mc.mcProfiler.endStartSection("clouds"); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.clipDistance * 4.0F); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + this.setupFog(0, partialTicks); + renderGlobalIn.renderClouds(partialTicks, pass); + GlStateManager.disableFog(); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.clipDistance); + GlStateManager.matrixMode(5888); + } + } + + private void addRainParticles() { + ModuleEnvironmentChanger envChanger = CheatBreaker.getInstance().getModuleManager().environmentChangerMod; + if (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue() && envChanger.isSnowOrNone()) { + return; + } + + float f = this.mc.theWorld.getRainStrength(1.0F); + + if (!Config.isRainFancy()) { + f /= 2.0F; + } + + if (f != 0.0F && Config.isRainSplash()) { + this.random.setSeed((long) this.rendererUpdateCount * 312987231L); + Entity entity = this.mc.getRenderViewEntity(); + World world = this.mc.theWorld; + BlockPos blockpos = new BlockPos(entity); + int i = 10; + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + int j = 0; + int k = (int) (100.0F * f * f); + + if (this.mc.gameSettings.particleSetting == 1) { + k >>= 1; + } else if (this.mc.gameSettings.particleSetting == 2) { + k = 0; + } + + for (int l = 0; l < k; ++l) { + BlockPos blockpos1 = world.getPrecipitationHeight(blockpos.add(this.random.nextInt(i) - this.random.nextInt(i), 0, this.random.nextInt(i) - this.random.nextInt(i))); + BiomeGenBase biomegenbase = world.getBiomeGenForCoords(blockpos1); + BlockPos blockpos2 = blockpos1.down(); + Block block = world.getBlockState(blockpos2).getBlock(); + + if (blockpos1.getY() <= blockpos.getY() + i && blockpos1.getY() >= blockpos.getY() - i && biomegenbase.canRain() && biomegenbase.getFloatTemperature(blockpos1) >= 0.15F) { + double d3 = this.random.nextDouble(); + double d4 = this.random.nextDouble(); + + if (block.getMaterial() == Material.lava) { + this.mc.theWorld.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double) blockpos1.getX() + d3, (double) ((float) blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double) blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } else if (block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(world, blockpos2); + ++j; + + if (this.random.nextInt(j) == 0) { + d0 = (double) blockpos2.getX() + d3; + d1 = (double) ((float) blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY() - 1.0D; + d2 = (double) blockpos2.getZ() + d4; + } + + this.mc.theWorld.spawnParticle(EnumParticleTypes.WATER_DROP, (double) blockpos2.getX() + d3, (double) ((float) blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(), (double) blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + if (j > 0 && this.random.nextInt(3) < this.rainSoundCounter++) { + this.rainSoundCounter = 0; + + if (d1 > (double) (blockpos.getY() + 1) && world.getPrecipitationHeight(blockpos).getY() > MathHelper.floor_float((float) blockpos.getY())) { + this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.1F, 0.5F, false); + } else { + this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.2F, 1.0F, false); + } + } + } + } + + protected void renderRainSnow(float partialTicks) { + ModuleEnvironmentChanger envChanger = CheatBreaker.getInstance().getModuleManager().environmentChangerMod; + boolean allowThroughBlocks = envChanger.allowThroughBlocks.getBooleanValue(); + + if (Reflector.ForgeWorldProvider_getWeatherRenderer.exists()) { + WorldProvider worldprovider = this.mc.theWorld.provider; + Object object = Reflector.call(worldprovider, Reflector.ForgeWorldProvider_getWeatherRenderer, new Object[0]); + + if (object != null) { + Reflector.callVoid(object, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(partialTicks), this.mc.theWorld, this.mc}); + return; + } + } + + float f5 = this.mc.theWorld.getRainStrength(partialTicks); + + if (f5 > 0.0F || envChanger.isEnabled()) { + + if (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue() && !envChanger.weatherType.getStringValue().equalsIgnoreCase("None")) { + f5 = 1.0F; + } + + if (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue() && envChanger.weatherType.getStringValue().equals("Clear")) { + return; + } + + if (Config.isRainOff()) { + return; + } + + this.enableLightmap(); + Entity entity = this.mc.getRenderViewEntity(); + World world = this.mc.theWorld; + int i = MathHelper.floor_double(entity.posX); + int j = MathHelper.floor_double(entity.posY); + int k = MathHelper.floor_double(entity.posZ); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.disableCull(); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.alphaFunc(516, 0.1F); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks; + int l = MathHelper.floor_double(d1); + int i1 = 5; + + if (Config.isRainFancy()) { + i1 = 10; + } + + int j1 = -1; + float f = (float) this.rendererUpdateCount + partialTicks; + worldrenderer.setTranslation(-d0, -d1, -d2); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + MutableBlockPos mutableblockpos = new MutableBlockPos(); + + for (int k1 = k - i1; k1 <= k + i1; ++k1) { + for (int l1 = i - i1; l1 <= i + i1; ++l1) { + int i2 = (k1 - k + 16) * 32 + l1 - i + 16; + double d3 = (double) this.rainXCoords[i2] * 0.5D; + double d4 = (double) this.rainYCoords[i2] * 0.5D; + mutableblockpos.set(l1, 0, k1); + BiomeGenBase biomegenbase = world.getBiomeGenForCoords(mutableblockpos); + + if (biomegenbase.canRain() || biomegenbase.getEnableSnow()) { + int j2 = world.getPrecipitationHeight(mutableblockpos).getY(); + int k2 = j - i1; + int l2 = j + i1; + + if (k2 < j2) { + // passing through blocks logic + k2 = (envChanger.isEnabled() && allowThroughBlocks ? 0 : j2); + } + + if (l2 < j2) { + l2 = j2; + } + + int i3 = j2; + + if (j2 < l) { + i3 = l; + } + + if (k2 != l2 || (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue())) { + this.random.setSeed((l1 * l1 * 3121 + l1 * 45238971 ^ k1 * k1 * 418711 + k1 * 13761)); + mutableblockpos.set(l1, k2, k1); + float f1 = biomegenbase.getFloatTemperature(mutableblockpos); + + // Else if refused to work, so we got around it! + boolean shouldRain; + + if (envChanger.customWeather.getBooleanValue() && envChanger.isEnabled() && !envChanger.weatherType.getStringValue().equals("Clear")) + shouldRain = envChanger.weatherType.getStringValue().equals("Rain"); + else shouldRain = world.getWorldChunkManager().getTemperatureAtHeight(f1, j2) >= 0.15F; + + if (shouldRain) { + if (j1 != 0) { + if (j1 >= 0) { + tessellator.draw(); + } + + j1 = 0; + this.mc.getTextureManager().bindTexture(locationRainPng); + worldrenderer.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + } + + double d5 = ((double) (this.rendererUpdateCount + l1 * l1 * 3121 + l1 * 45238971 + k1 * k1 * 418711 + k1 * 13761 & 31) + (double) partialTicks) / 32.0D * (3.0D + this.random.nextDouble()); + double d6 = (double) ((float) l1 + 0.5F) - entity.posX; + double d7 = (double) ((float) k1 + 0.5F) - entity.posZ; + float f2 = MathHelper.sqrt_double(d6 * d6 + d7 * d7) / (float) i1; + float f3 = ((1.0F - f2 * f2) * 0.5F + 0.5F) * f5; + mutableblockpos.set(l1, i3, k1); + int j3 = world.getCombinedLight(mutableblockpos, 0); + int k3 = j3 >> 16 & 65535; + int l3 = j3 & 65535; + worldrenderer.pos((double) l1 - d3 + 0.5D, k2, (double) k1 - d4 + 0.5D).tex(0.0D, (double) k2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f3).lightmap(k3, l3).endVertex(); + worldrenderer.pos((double) l1 + d3 + 0.5D, k2, (double) k1 + d4 + 0.5D).tex(1.0D, (double) k2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f3).lightmap(k3, l3).endVertex(); + worldrenderer.pos((double) l1 + d3 + 0.5D, l2, (double) k1 + d4 + 0.5D).tex(1.0D, (double) l2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f3).lightmap(k3, l3).endVertex(); + worldrenderer.pos((double) l1 - d3 + 0.5D, l2, (double) k1 - d4 + 0.5D).tex(0.0D, (double) l2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f3).lightmap(k3, l3).endVertex(); + } else if (world.getWorldChunkManager().getTemperatureAtHeight(f1, j2) < 0.15F || (envChanger.weatherType.getStringValue().equals("Snow") && envChanger.customWeather.getBooleanValue() && envChanger.isEnabled())) { + if (j1 != 1) { + if (j1 >= 0) { + tessellator.draw(); + } + + j1 = 1; + this.mc.getTextureManager().bindTexture(locationSnowPng); + worldrenderer.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + } + + double d8 = (((float) (this.rendererUpdateCount & 511) + partialTicks) / 512.0F); + double d9 = this.random.nextDouble() + (double) f * 0.01D * (double) ((float) this.random.nextGaussian()); + double d10 = this.random.nextDouble() + (double) (f * (float) this.random.nextGaussian()) * 0.001D; + double d11 = (double) ((float) l1 + 0.5F) - entity.posX; + double d12 = (double) ((float) k1 + 0.5F) - entity.posZ; + float f6 = MathHelper.sqrt_double(d11 * d11 + d12 * d12) / (float) i1; + float f4 = ((1.0F - f6 * f6) * 0.3F + 0.5F) * f5; + mutableblockpos.set(l1, i3, k1); + int i4 = (world.getCombinedLight(mutableblockpos, 0) * 3 + 15728880) / 4; + int j4 = i4 >> 16 & 65535; + int k4 = i4 & 65535; + worldrenderer.pos((double) l1 - d3 + 0.5D, k2, (double) k1 - d4 + 0.5D).tex(0.0D + d9, (double) k2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f4).lightmap(j4, k4).endVertex(); + worldrenderer.pos((double) l1 + d3 + 0.5D, k2, (double) k1 + d4 + 0.5D).tex(1.0D + d9, (double) k2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f4).lightmap(j4, k4).endVertex(); + worldrenderer.pos((double) l1 + d3 + 0.5D, l2, (double) k1 + d4 + 0.5D).tex(1.0D + d9, (double) l2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f4).lightmap(j4, k4).endVertex(); + worldrenderer.pos((double) l1 - d3 + 0.5D, l2, (double) k1 - d4 + 0.5D).tex(0.0D + d9, (double) l2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f4).lightmap(j4, k4).endVertex(); + } + } + } + } + } + + if (j1 >= 0) { + tessellator.draw(); + } + + worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GlStateManager.alphaFunc(516, 0.1F); + this.disableLightmap(); + } + } + + public void setupOverlayRendering() { + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + GlStateManager.clear(256); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + } + + private void updateFogColor(float partialTicks) { + World world = this.mc.theWorld; + Entity entity = this.mc.getRenderViewEntity(); + float f = 0.25F + 0.75F * (float) this.mc.gameSettings.renderDistanceChunks / 32.0F; + f = 1.0F - (float) Math.pow((double) f, 0.25D); + Vec3 vec3 = world.getSkyColor(this.mc.getRenderViewEntity(), partialTicks); + vec3 = CustomColors.getWorldSkyColor(vec3, world, this.mc.getRenderViewEntity(), partialTicks); + float f1 = (float) vec3.xCoord; + float f2 = (float) vec3.yCoord; + float f3 = (float) vec3.zCoord; + Vec3 vec31 = world.getFogColor(partialTicks); + vec31 = CustomColors.getWorldFogColor(vec31, world, this.mc.getRenderViewEntity(), partialTicks); + this.fogColorRed = (float) vec31.xCoord; + this.fogColorGreen = (float) vec31.yCoord; + this.fogColorBlue = (float) vec31.zCoord; + + if (this.mc.gameSettings.renderDistanceChunks >= 4) { + double d0 = -1.0D; + Vec3 vec32 = MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) > 0.0F ? new Vec3(d0, 0.0D, 0.0D) : new Vec3(1.0D, 0.0D, 0.0D); + float f5 = (float) entity.getLook(partialTicks).dotProduct(vec32); + + if (f5 < 0.0F) { + f5 = 0.0F; + } + + if (f5 > 0.0F) { + float[] afloat = world.provider.calcSunriseSunsetColors(world.getCelestialAngle(partialTicks), partialTicks); + + if (afloat != null) { + f5 = f5 * afloat[3]; + this.fogColorRed = this.fogColorRed * (1.0F - f5) + afloat[0] * f5; + this.fogColorGreen = this.fogColorGreen * (1.0F - f5) + afloat[1] * f5; + this.fogColorBlue = this.fogColorBlue * (1.0F - f5) + afloat[2] * f5; + } + } + } + + this.fogColorRed += (f1 - this.fogColorRed) * f; + this.fogColorGreen += (f2 - this.fogColorGreen) * f; + this.fogColorBlue += (f3 - this.fogColorBlue) * f; + float f8 = world.getRainStrength(partialTicks); + + if (f8 > 0.0F) { + float f4 = 1.0F - f8 * 0.5F; + float f10 = 1.0F - f8 * 0.4F; + this.fogColorRed *= f4; + this.fogColorGreen *= f4; + this.fogColorBlue *= f10; + } + + float f9 = world.getThunderStrength(partialTicks); + + if (f9 > 0.0F) { + float f11 = 1.0F - f9 * 0.5F; + this.fogColorRed *= f11; + this.fogColorGreen *= f11; + this.fogColorBlue *= f11; + } + + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); + + if (this.cloudFog) { + Vec3 vec33 = world.getCloudColour(partialTicks); + this.fogColorRed = (float) vec33.xCoord; + this.fogColorGreen = (float) vec33.yCoord; + this.fogColorBlue = (float) vec33.zCoord; + } else if (block.getMaterial() == Material.water) { + float f12 = (float) EnchantmentHelper.getRespiration(entity) * 0.2F; + f12 = Config.limit(f12, 0.0F, 0.6F); + + if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.waterBreathing)) { + f12 = f12 * 0.3F + 0.6F; + } + + this.fogColorRed = 0.02F + f12; + this.fogColorGreen = 0.02F + f12; + this.fogColorBlue = 0.2F + f12; + Vec3 vec35 = CustomColors.getUnderwaterColor(this.mc.theWorld, this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().posY + 1.0D, this.mc.getRenderViewEntity().posZ); + + if (vec35 != null) { + this.fogColorRed = (float) vec35.xCoord; + this.fogColorGreen = (float) vec35.yCoord; + this.fogColorBlue = (float) vec35.zCoord; + } + } else if (block.getMaterial() == Material.lava) { + this.fogColorRed = 0.6F; + this.fogColorGreen = 0.1F; + this.fogColorBlue = 0.0F; + Vec3 vec34 = CustomColors.getUnderlavaColor(this.mc.theWorld, this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().posY + 1.0D, this.mc.getRenderViewEntity().posZ); + + if (vec34 != null) { + this.fogColorRed = (float) vec34.xCoord; + this.fogColorGreen = (float) vec34.yCoord; + this.fogColorBlue = (float) vec34.zCoord; + } + } + + float f13 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * partialTicks; + this.fogColorRed *= f13; + this.fogColorGreen *= f13; + this.fogColorBlue *= f13; + double d1 = (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks) * world.provider.getVoidFogYFactor(); + + if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.blindness)) { + int i = ((EntityLivingBase) entity).getActivePotionEffect(Potion.blindness).getDuration(); + + if (i < 20) { + d1 *= (double) (1.0F - (float) i / 20.0F); + } else { + d1 = 0.0D; + } + } + + if (d1 < 1.0D) { + if (d1 < 0.0D) { + d1 = 0.0D; + } + + d1 = d1 * d1; + this.fogColorRed = (float) ((double) this.fogColorRed * d1); + this.fogColorGreen = (float) ((double) this.fogColorGreen * d1); + this.fogColorBlue = (float) ((double) this.fogColorBlue * d1); + } + + if (this.bossColorModifier > 0.0F) { + float f14 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * partialTicks; + this.fogColorRed = this.fogColorRed * (1.0F - f14) + this.fogColorRed * 0.7F * f14; + this.fogColorGreen = this.fogColorGreen * (1.0F - f14) + this.fogColorGreen * 0.6F * f14; + this.fogColorBlue = this.fogColorBlue * (1.0F - f14) + this.fogColorBlue * 0.6F * f14; + } + + if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.nightVision)) { + float f15 = this.getNightVisionBrightness((EntityLivingBase) entity, partialTicks); + float f6 = 1.0F / this.fogColorRed; + + if (f6 > 1.0F / this.fogColorGreen) { + f6 = 1.0F / this.fogColorGreen; + } + + if (f6 > 1.0F / this.fogColorBlue) { + f6 = 1.0F / this.fogColorBlue; + } + + if (Float.isInfinite(f6)) { + f6 = Math.nextAfter(f6, 0.0D); + } + + this.fogColorRed = this.fogColorRed * (1.0F - f15) + this.fogColorRed * f6 * f15; + this.fogColorGreen = this.fogColorGreen * (1.0F - f15) + this.fogColorGreen * f6 * f15; + this.fogColorBlue = this.fogColorBlue * (1.0F - f15) + this.fogColorBlue * f6 * f15; + } + + if (this.mc.gameSettings.anaglyph) { + float f16 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; + float f17 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; + float f7 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; + this.fogColorRed = f16; + this.fogColorGreen = f17; + this.fogColorBlue = f7; + } + + if (Reflector.EntityViewRenderEvent_FogColors_Constructor.exists()) { + Object object = Reflector.newInstance(Reflector.EntityViewRenderEvent_FogColors_Constructor, new Object[]{this, entity, block, Float.valueOf(partialTicks), Float.valueOf(this.fogColorRed), Float.valueOf(this.fogColorGreen), Float.valueOf(this.fogColorBlue)}); + Reflector.postForgeBusEvent(object); + this.fogColorRed = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_FogColors_red, this.fogColorRed); + this.fogColorGreen = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_FogColors_green, this.fogColorGreen); + this.fogColorBlue = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_FogColors_blue, this.fogColorBlue); + } + + Shaders.setClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); + } + + private void setupFog(int startCoords, float partialTicks) { + this.fogStandard = false; + Entity entity = this.mc.getRenderViewEntity(); + boolean flag = false; + + if (entity instanceof EntityPlayer) { + flag = ((EntityPlayer) entity).capabilities.isCreativeMode; + } + + GL11.glFog(GL11.GL_FOG_COLOR, (FloatBuffer) this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); + GL11.glNormal3f(0.0F, -1.0F, 0.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); + float f = -1.0F; + + if (Reflector.ForgeHooksClient_getFogDensity.exists()) { + f = Reflector.callFloat(Reflector.ForgeHooksClient_getFogDensity, new Object[]{this, entity, block, Float.valueOf(partialTicks), Float.valueOf(0.1F)}); + } + + if (f >= 0.0F) { + GlStateManager.setFogDensity(f); + } else if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.blindness)) { + float f4 = 5.0F; + int i = ((EntityLivingBase) entity).getActivePotionEffect(Potion.blindness).getDuration(); + + if (i < 20) { + f4 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float) i / 20.0F); + } + + GlStateManager.setFog(9729); + + if (startCoords == -1) { + GlStateManager.setFogStart(0.0F); + GlStateManager.setFogEnd(f4 * 0.8F); + } else { + GlStateManager.setFogStart(f4 * 0.25F); + GlStateManager.setFogEnd(f4); + } + + if (GLContext.getCapabilities().GL_NV_fog_distance && Config.isFogFancy()) { + GL11.glFogi(34138, 34139); + } + } else if (this.cloudFog) { + GlStateManager.setFog(2048); + GlStateManager.setFogDensity(0.1F); + } else if (block.getMaterial() == Material.water) { + GlStateManager.setFog(2048); + float f1 = Config.isClearWater() ? 0.02F : 0.1F; + + if (entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.waterBreathing)) { + GlStateManager.setFogDensity(0.01F); + } else { + float f2 = 0.1F - (float) EnchantmentHelper.getRespiration(entity) * 0.03F; + GlStateManager.setFogDensity(Config.limit(f2, 0.0F, f1)); + } + } else if (block.getMaterial() == Material.lava) { + GlStateManager.setFog(2048); + GlStateManager.setFogDensity(2.0F); + } else { + float f3 = this.farPlaneDistance; + this.fogStandard = true; + GlStateManager.setFog(9729); + + if (startCoords == -1) { + GlStateManager.setFogStart(0.0F); + GlStateManager.setFogEnd(f3); + } else { + GlStateManager.setFogStart(f3 * Config.getFogStart()); + GlStateManager.setFogEnd(f3); + } + + if (GLContext.getCapabilities().GL_NV_fog_distance) { + if (Config.isFogFancy()) { + GL11.glFogi(34138, 34139); + } + + if (Config.isFogFast()) { + GL11.glFogi(34138, 34140); + } + } + + if (this.mc.theWorld.provider.doesXZShowFog((int) entity.posX, (int) entity.posZ)) { + GlStateManager.setFogStart(f3 * 0.05F); + GlStateManager.setFogEnd(f3); + } + + if (Reflector.ForgeHooksClient_onFogRender.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_onFogRender, new Object[]{this, entity, block, Float.valueOf(partialTicks), Integer.valueOf(startCoords), Float.valueOf(f3)}); + } + } + + GlStateManager.enableColorMaterial(); + GlStateManager.enableFog(); + GlStateManager.colorMaterial(1028, 4608); + } + + private FloatBuffer setFogColorBuffer(float red, float green, float blue, float alpha) { + if (Config.isShaders()) { + Shaders.setFogColor(red, green, blue); + } + + this.fogColorBuffer.clear(); + this.fogColorBuffer.put(red).put(green).put(blue).put(alpha); + this.fogColorBuffer.flip(); + return this.fogColorBuffer; + } + + public MapItemRenderer getMapItemRenderer() { + return this.theMapItemRenderer; + } + + private void waitForServerThread() { + this.serverWaitTimeCurrent = 0; + + if (Config.isSmoothWorld() && Config.isSingleProcessor()) { + if (this.mc.isIntegratedServerRunning()) { + IntegratedServer integratedserver = this.mc.getIntegratedServer(); + + if (integratedserver != null) { + boolean flag = this.mc.isGamePaused(); + + if (!flag && !(this.mc.currentScreen instanceof GuiDownloadTerrain)) { + if (this.serverWaitTime > 0) { + Lagometer.timerServer.start(); + Config.sleep((long) this.serverWaitTime); + Lagometer.timerServer.end(); + this.serverWaitTimeCurrent = this.serverWaitTime; + } + + long i = System.nanoTime() / 1000000L; + + if (this.lastServerTime != 0L && this.lastServerTicks != 0) { + long j = i - this.lastServerTime; + + if (j < 0L) { + this.lastServerTime = i; + j = 0L; + } + + if (j >= 50L) { + this.lastServerTime = i; + int k = integratedserver.getTickCounter(); + int l = k - this.lastServerTicks; + + if (l < 0) { + this.lastServerTicks = k; + l = 0; + } + + if (l < 1 && this.serverWaitTime < 100) { + this.serverWaitTime += 2; + } + + if (l > 1 && this.serverWaitTime > 0) { + --this.serverWaitTime; + } + + this.lastServerTicks = k; + } + } else { + this.lastServerTime = i; + this.lastServerTicks = integratedserver.getTickCounter(); + this.avgServerTickDiff = 1.0F; + this.avgServerTimeDiff = 50.0F; + } + } else { + if (this.mc.currentScreen instanceof GuiDownloadTerrain) { + Config.sleep(20L); + } + + this.lastServerTime = 0L; + this.lastServerTicks = 0; + } + } + } + } else { + this.lastServerTime = 0L; + this.lastServerTicks = 0; + } + } + + private void frameInit() { + GlErrors.frameStart(); + + if (!this.initialized) { + ReflectorResolver.resolve(); + TextureUtils.registerResourceListener(); + + if (Config.getBitsOs() == 64 && Config.getBitsJre() == 32) { + Config.setNotify64BitJava(true); + } + + this.initialized = true; + } + + Config.checkDisplayMode(); + World world = this.mc.theWorld; + + if (world != null) { + if (Config.getNewRelease() != null) { + String s = "HD_U".replace("HD_U", "HD Ultra").replace("L", "Light"); + String s1 = s + " " + Config.getNewRelease(); + ChatComponentText chatcomponenttext = new ChatComponentText(I18n.format("of.message.newVersion", new Object[]{"\u00a7n" + s1 + "\u00a7r"})); + chatcomponenttext.setChatStyle((new ChatStyle()).setChatClickEvent(new ClickEvent(Action.OPEN_URL, "https://optifine.net/downloads"))); + this.mc.ingameGUI.getChatGUI().printChatMessage(chatcomponenttext); + Config.setNewRelease((String) null); + } + + if (Config.isNotify64BitJava()) { + Config.setNotify64BitJava(false); + ChatComponentText chatcomponenttext1 = new ChatComponentText(I18n.format("of.message.java64Bit", new Object[0])); + this.mc.ingameGUI.getChatGUI().printChatMessage(chatcomponenttext1); + } + } + + if (this.mc.currentScreen instanceof GuiMainMenu) { + this.updateMainMenu((GuiMainMenu) this.mc.currentScreen); + } + + if (this.updatedWorld != world) { + RandomEntities.worldChanged(this.updatedWorld, world); + Config.updateThreadPriorities(); + this.lastServerTime = 0L; + this.lastServerTicks = 0; + this.updatedWorld = world; + } + + if (!this.setFxaaShader(Shaders.configAntialiasingLevel)) { + Shaders.configAntialiasingLevel = 0; + } + + if (this.mc.currentScreen != null && this.mc.currentScreen.getClass() == GuiChat.class) { + this.mc.displayGuiScreen(new GuiChatOF((GuiChat) this.mc.currentScreen)); + } + } + + private void frameFinish() { + if (this.mc.theWorld != null && Config.isShowGlErrors() && TimedEvent.isActive("CheckGlErrorFrameFinish", 10000L)) { + int i = GlStateManager.glGetError(); + + if (i != 0 && GlErrors.isEnabled(i)) { + String s = Config.getGlErrorString(i); + ChatComponentText chatcomponenttext = new ChatComponentText(I18n.format("of.message.openglError", new Object[]{Integer.valueOf(i), s})); + this.mc.ingameGUI.getChatGUI().printChatMessage(chatcomponenttext); + } + } + } + + private void updateMainMenu(GuiMainMenu p_updateMainMenu_1_) { + try { + String s = null; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + int i = calendar.get(5); + int j = calendar.get(2) + 1; + + if (i == 8 && j == 4) { + s = "Happy birthday, OptiFine!"; + } + + if (i == 14 && j == 8) { + s = "Happy birthday, sp614x!"; + } + + if (s == null) { + return; + } + + Reflector.setFieldValue(p_updateMainMenu_1_, Reflector.GuiMainMenu_splashText, s); + } catch (Throwable var6) { + ; + } + } + + public boolean setFxaaShader(int p_setFxaaShader_1_) { + if (!OpenGlHelper.isFramebufferEnabled()) { + return false; + } else if (this.theShaderGroup != null && this.theShaderGroup != this.fxaaShaders[2] && this.theShaderGroup != this.fxaaShaders[4]) { + return true; + } else if (p_setFxaaShader_1_ != 2 && p_setFxaaShader_1_ != 4) { + if (this.theShaderGroup == null) { + return true; + } else { + this.theShaderGroup.deleteShaderGroup(); + this.theShaderGroup = null; + return true; + } + } else if (this.theShaderGroup != null && this.theShaderGroup == this.fxaaShaders[p_setFxaaShader_1_]) { + return true; + } else if (this.mc.theWorld == null) { + return true; + } else { + this.loadShader(new ResourceLocation("shaders/post/fxaa_of_" + p_setFxaaShader_1_ + "x.json")); + this.fxaaShaders[p_setFxaaShader_1_] = this.theShaderGroup; + return this.useShader; + } + } + + private void checkLoadVisibleChunks(Entity p_checkLoadVisibleChunks_1_, float p_checkLoadVisibleChunks_2_, ICamera p_checkLoadVisibleChunks_3_, boolean p_checkLoadVisibleChunks_4_) { + int i = 201435902; + + if (this.loadVisibleChunks) { + this.loadVisibleChunks = false; + this.loadAllVisibleChunks(p_checkLoadVisibleChunks_1_, (double) p_checkLoadVisibleChunks_2_, p_checkLoadVisibleChunks_3_, p_checkLoadVisibleChunks_4_); + this.mc.ingameGUI.getChatGUI().deleteChatLine(i); + } + + if (Keyboard.isKeyDown(61) && Keyboard.isKeyDown(38)) { + if (this.mc.currentScreen != null) { + return; + } + + this.loadVisibleChunks = true; + ChatComponentText chatcomponenttext = new ChatComponentText(I18n.format("of.message.loadingVisibleChunks", new Object[0])); + this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(chatcomponenttext, i); + } + } + + private void loadAllVisibleChunks(Entity p_loadAllVisibleChunks_1_, double p_loadAllVisibleChunks_2_, ICamera p_loadAllVisibleChunks_4_, boolean p_loadAllVisibleChunks_5_) { + int i = this.mc.gameSettings.ofChunkUpdates; + boolean flag = this.mc.gameSettings.ofLazyChunkLoading; + + try { + this.mc.gameSettings.ofChunkUpdates = 1000; + this.mc.gameSettings.ofLazyChunkLoading = false; + RenderGlobal renderglobal = Config.getRenderGlobal(); + int j = renderglobal.getCountLoadedChunks(); + long k = System.currentTimeMillis(); + Config.dbg("Loading visible chunks"); + long l = System.currentTimeMillis() + 5000L; + int i1 = 0; + boolean flag1 = false; + + while (true) { + flag1 = false; + + for (int j1 = 0; j1 < 100; ++j1) { + renderglobal.displayListEntitiesDirty = true; + renderglobal.setupTerrain(p_loadAllVisibleChunks_1_, p_loadAllVisibleChunks_2_, p_loadAllVisibleChunks_4_, this.frameCount++, p_loadAllVisibleChunks_5_); + + if (!renderglobal.hasNoChunkUpdates()) { + flag1 = true; + } + + i1 = i1 + renderglobal.getCountChunksToUpdate(); + + while (!renderglobal.hasNoChunkUpdates()) { + renderglobal.updateChunks(System.nanoTime() + 1000000000L); + } + + i1 = i1 - renderglobal.getCountChunksToUpdate(); + + if (!flag1) { + break; + } + } + + if (renderglobal.getCountLoadedChunks() != j) { + flag1 = true; + j = renderglobal.getCountLoadedChunks(); + } + + if (System.currentTimeMillis() > l) { + Config.log("Chunks loaded: " + i1); + l = System.currentTimeMillis() + 5000L; + } + + if (!flag1) { + break; + } + } + + Config.log("Chunks loaded: " + i1); + Config.log("Finished loading visible chunks"); + RenderChunk.renderChunksUpdated = 0; + } finally { + this.mc.gameSettings.ofChunkUpdates = i; + this.mc.gameSettings.ofLazyChunkLoading = flag; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRendere~ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRendere~ new file mode 100644 index 0000000..1622bbe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EntityRendere~ @@ -0,0 +1,2251 @@ +package net.minecraft.client.renderer; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.gson.JsonSyntaxException; +import java.io.IOException; +import java.nio.FloatBuffer; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiDownloadTerrain; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.MapItemRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.ClickEvent.Action; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.src.Config; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MouseFilter; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.util.BlockPos.MutableBlockPos; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldSettings.GameType; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.CustomColors; +import net.optifine.GlErrors; +import net.optifine.Lagometer; +import net.optifine.RandomEntities; +import net.optifine.gui.GuiChatOF; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.reflect.ReflectorResolver; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersRender; +import net.optifine.util.MemoryMonitor; +import net.optifine.util.TextureUtils; +import net.optifine.util.TimedEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +public class EntityRenderer implements IResourceManagerReloadListener { + private static final Logger field_147710_q = LogManager.getLogger(); + private static final ResourceLocation field_110924_q = new ResourceLocation("textures/environment/rain.png"); + private static final ResourceLocation field_110923_r = new ResourceLocation("textures/environment/snow.png"); + public static boolean field_78517_a; + public static int field_78515_b; + private Minecraft field_78531_r; + private final IResourceManager field_147711_ac; + private Random field_78537_ab = new Random(); + private float field_78530_s; + public ItemRenderer field_78516_c; + private final MapItemRenderer field_147709_v; + private int field_78529_t; + private Entity field_78528_u; + private MouseFilter field_78527_v = new MouseFilter(); + private MouseFilter field_78526_w = new MouseFilter(); + private float field_78490_B = 4.0F; + private float field_78491_C = 4.0F; + private float field_78496_H; + private float field_78497_I; + private float field_78498_J; + private float field_78499_K; + private float field_78492_L; + private float field_78507_R; + private float field_78506_S; + private float field_82831_U; + private float field_82832_V; + private boolean field_78500_U; + private boolean field_175074_C = true; + private boolean field_175073_D = true; + private long field_78508_Y = Minecraft.func_71386_F(); + private long field_78510_Z; + private final DynamicTexture field_78513_d; + private final int[] field_78504_Q; + private final ResourceLocation field_110922_T; + private boolean field_78536_aa; + private float field_78514_e; + private float field_175075_L; + private int field_78534_ac; + private float[] field_175076_N = new float[1024]; + private float[] field_175077_O = new float[1024]; + private FloatBuffer field_78521_m = GLAllocation.func_74529_h(16); + public float field_175080_Q; + public float field_175082_R; + public float field_175081_S; + private float field_78535_ad; + private float field_78539_ae; + private int field_175079_V = 0; + private boolean field_175078_W = false; + private double field_78503_V = 1.0D; + private double field_78502_W; + private double field_78509_X; + private ShaderGroup field_147707_d; + private static final ResourceLocation[] field_147712_ad = new ResourceLocation[]{new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json"), new ResourceLocation("shaders/post/creeper.json"), new ResourceLocation("shaders/post/spider.json")}; + public static final int field_147708_e = field_147712_ad.length; + private int field_147713_ae; + private boolean field_175083_ad; + public int field_175084_ae; + private boolean initialized = false; + private World updatedWorld = null; + private boolean showDebugInfo = false; + public boolean fogStandard = false; + private float clipDistance = 128.0F; + private long lastServerTime = 0L; + private int lastServerTicks = 0; + private int serverWaitTime = 0; + private int serverWaitTimeCurrent = 0; + private float avgServerTimeDiff = 0.0F; + private float avgServerTickDiff = 0.0F; + private ShaderGroup[] fxaaShaders = new ShaderGroup[10]; + private boolean loadVisibleChunks = false; + + public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_) { + this.field_147713_ae = field_147708_e; + this.field_175083_ad = false; + this.field_175084_ae = 0; + this.field_78531_r = p_i45076_1_; + this.field_147711_ac = p_i45076_2_; + this.field_78516_c = p_i45076_1_.func_175597_ag(); + this.field_147709_v = new MapItemRenderer(p_i45076_1_.func_110434_K()); + this.field_78513_d = new DynamicTexture(16, 16); + this.field_110922_T = p_i45076_1_.func_110434_K().func_110578_a("lightMap", this.field_78513_d); + this.field_78504_Q = this.field_78513_d.func_110565_c(); + this.field_147707_d = null; + + for(int i = 0; i < 32; ++i) { + for(int j = 0; j < 32; ++j) { + float f = (float)(j - 16); + float f1 = (float)(i - 16); + float f2 = MathHelper.func_76129_c(f * f + f1 * f1); + this.field_175076_N[i << 5 | j] = -f1 / f2; + this.field_175077_O[i << 5 | j] = f / f2; + } + } + + } + + public boolean func_147702_a() { + return OpenGlHelper.field_148824_g && this.field_147707_d != null; + } + + public void func_181022_b() { + if(this.field_147707_d != null) { + this.field_147707_d.func_148021_a(); + } + + this.field_147707_d = null; + this.field_147713_ae = field_147708_e; + } + + public void func_175071_c() { + this.field_175083_ad = !this.field_175083_ad; + } + + public void func_175066_a(Entity p_175066_1_) { + if(OpenGlHelper.field_148824_g) { + if(this.field_147707_d != null) { + this.field_147707_d.func_148021_a(); + } + + this.field_147707_d = null; + if(p_175066_1_ instanceof EntityCreeper) { + this.func_175069_a(new ResourceLocation("shaders/post/creeper.json")); + } else if(p_175066_1_ instanceof EntitySpider) { + this.func_175069_a(new ResourceLocation("shaders/post/spider.json")); + } else if(p_175066_1_ instanceof EntityEnderman) { + this.func_175069_a(new ResourceLocation("shaders/post/invert.json")); + } else if(Reflector.ForgeHooksClient_loadEntityShader.exists()) { + Reflector.call(Reflector.ForgeHooksClient_loadEntityShader, new Object[]{p_175066_1_, this}); + } + } + + } + + public void func_147705_c() { + if(OpenGlHelper.field_148824_g && this.field_78531_r.func_175606_aa() instanceof EntityPlayer) { + if(this.field_147707_d != null) { + this.field_147707_d.func_148021_a(); + } + + this.field_147713_ae = (this.field_147713_ae + 1) % (field_147712_ad.length + 1); + if(this.field_147713_ae != field_147708_e) { + this.func_175069_a(field_147712_ad[this.field_147713_ae]); + } else { + this.field_147707_d = null; + } + } + + } + + private void func_175069_a(ResourceLocation p_175069_1_) { + if(OpenGlHelper.func_148822_b()) { + try { + this.field_147707_d = new ShaderGroup(this.field_78531_r.func_110434_K(), this.field_147711_ac, this.field_78531_r.func_147110_a(), p_175069_1_); + this.field_147707_d.func_148026_a(this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d); + this.field_175083_ad = true; + } catch (IOException ioexception) { + field_147710_q.warn((String)("Failed to load shader: " + p_175069_1_), (Throwable)ioexception); + this.field_147713_ae = field_147708_e; + this.field_175083_ad = false; + } catch (JsonSyntaxException jsonsyntaxexception) { + field_147710_q.warn((String)("Failed to load shader: " + p_175069_1_), (Throwable)jsonsyntaxexception); + this.field_147713_ae = field_147708_e; + this.field_175083_ad = false; + } + + } + } + + public void func_110549_a(IResourceManager p_110549_1_) { + if(this.field_147707_d != null) { + this.field_147707_d.func_148021_a(); + } + + this.field_147707_d = null; + if(this.field_147713_ae != field_147708_e) { + this.func_175069_a(field_147712_ad[this.field_147713_ae]); + } else { + this.func_175066_a(this.field_78531_r.func_175606_aa()); + } + + } + + public void func_78464_a() { + if(OpenGlHelper.field_148824_g && ShaderLinkHelper.func_148074_b() == null) { + ShaderLinkHelper.func_148076_a(); + } + + this.func_78477_e(); + this.func_78470_f(); + this.field_78535_ad = this.field_78539_ae; + this.field_78491_C = this.field_78490_B; + if(this.field_78531_r.field_71474_y.field_74326_T) { + float f = this.field_78531_r.field_71474_y.field_74341_c * 0.6F + 0.2F; + float f1 = f * f * f * 8.0F; + this.field_78498_J = this.field_78527_v.func_76333_a(this.field_78496_H, 0.05F * f1); + this.field_78499_K = this.field_78526_w.func_76333_a(this.field_78497_I, 0.05F * f1); + this.field_78492_L = 0.0F; + this.field_78496_H = 0.0F; + this.field_78497_I = 0.0F; + } else { + this.field_78498_J = 0.0F; + this.field_78499_K = 0.0F; + this.field_78527_v.func_180179_a(); + this.field_78526_w.func_180179_a(); + } + + if(this.field_78531_r.func_175606_aa() == null) { + this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g); + } + + Entity entity = this.field_78531_r.func_175606_aa(); + double d2 = entity.field_70165_t; + double d0 = entity.field_70163_u + (double)entity.func_70047_e(); + double d1 = entity.field_70161_v; + float f2 = this.field_78531_r.field_71441_e.func_175724_o(new BlockPos(d2, d0, d1)); + float f3 = (float)this.field_78531_r.field_71474_y.field_151451_c / 16.0F; + f3 = MathHelper.func_76131_a(f3, 0.0F, 1.0F); + float f4 = f2 * (1.0F - f3) + f3; + this.field_78539_ae += (f4 - this.field_78539_ae) * 0.1F; + ++this.field_78529_t; + this.field_78516_c.func_78441_a(); + this.func_78484_h(); + this.field_82832_V = this.field_82831_U; + if(BossStatus.field_82825_d) { + this.field_82831_U += 0.05F; + if(this.field_82831_U > 1.0F) { + this.field_82831_U = 1.0F; + } + + BossStatus.field_82825_d = false; + } else if(this.field_82831_U > 0.0F) { + this.field_82831_U -= 0.0125F; + } + + } + + public ShaderGroup func_147706_e() { + return this.field_147707_d; + } + + public void func_147704_a(int p_147704_1_, int p_147704_2_) { + if(OpenGlHelper.field_148824_g) { + if(this.field_147707_d != null) { + this.field_147707_d.func_148026_a(p_147704_1_, p_147704_2_); + } + + this.field_78531_r.field_71438_f.func_72720_a(p_147704_1_, p_147704_2_); + } + + } + + public void func_78473_a(float p_78473_1_) { + Entity entity = this.field_78531_r.func_175606_aa(); + if(entity != null && this.field_78531_r.field_71441_e != null) { + this.field_78531_r.field_71424_I.func_76320_a("pick"); + this.field_78531_r.field_147125_j = null; + double d0 = (double)this.field_78531_r.field_71442_b.func_78757_d(); + this.field_78531_r.field_71476_x = entity.func_174822_a(d0, p_78473_1_); + double d1 = d0; + Vec3 vec3 = entity.func_174824_e(p_78473_1_); + boolean flag = false; + int i = 3; + if(this.field_78531_r.field_71442_b.func_78749_i()) { + d0 = 6.0D; + d1 = 6.0D; + } else if(d0 > 3.0D) { + flag = true; + } + + if(this.field_78531_r.field_71476_x != null) { + d1 = this.field_78531_r.field_71476_x.field_72307_f.func_72438_d(vec3); + } + + Vec3 vec31 = entity.func_70676_i(p_78473_1_); + Vec3 vec32 = vec3.func_72441_c(vec31.field_72450_a * d0, vec31.field_72448_b * d0, vec31.field_72449_c * d0); + this.field_78528_u = null; + Vec3 vec33 = null; + float f = 1.0F; + List list = this.field_78531_r.field_71441_e.func_175674_a(entity, entity.func_174813_aQ().func_72321_a(vec31.field_72450_a * d0, vec31.field_72448_b * d0, vec31.field_72449_c * d0).func_72314_b((double)f, (double)f, (double)f), Predicates.and(EntitySelectors.field_180132_d, new Predicate() { + public boolean apply(Entity p_apply_1_) { + return p_apply_1_.func_70067_L(); + } + })); + double d2 = d1; + + for(int j = 0; j < list.size(); ++j) { + Entity entity1 = (Entity)list.get(j); + float f1 = entity1.func_70111_Y(); + AxisAlignedBB axisalignedbb = entity1.func_174813_aQ().func_72314_b((double)f1, (double)f1, (double)f1); + MovingObjectPosition movingobjectposition = axisalignedbb.func_72327_a(vec3, vec32); + if(axisalignedbb.func_72318_a(vec3)) { + if(d2 >= 0.0D) { + this.field_78528_u = entity1; + vec33 = movingobjectposition == null?vec3:movingobjectposition.field_72307_f; + d2 = 0.0D; + } + } else if(movingobjectposition != null) { + double d3 = vec3.func_72438_d(movingobjectposition.field_72307_f); + if(d3 < d2 || d2 == 0.0D) { + boolean flag1 = false; + if(Reflector.ForgeEntity_canRiderInteract.exists()) { + flag1 = Reflector.callBoolean(entity1, Reflector.ForgeEntity_canRiderInteract, new Object[0]); + } + + if(!flag1 && entity1 == entity.field_70154_o) { + if(d2 == 0.0D) { + this.field_78528_u = entity1; + vec33 = movingobjectposition.field_72307_f; + } + } else { + this.field_78528_u = entity1; + vec33 = movingobjectposition.field_72307_f; + d2 = d3; + } + } + } + } + + if(this.field_78528_u != null && flag && vec3.func_72438_d(vec33) > 3.0D) { + this.field_78528_u = null; + this.field_78531_r.field_71476_x = new MovingObjectPosition(MovingObjectType.MISS, vec33, (EnumFacing)null, new BlockPos(vec33)); + } + + if(this.field_78528_u != null && (d2 < d1 || this.field_78531_r.field_71476_x == null)) { + this.field_78531_r.field_71476_x = new MovingObjectPosition(this.field_78528_u, vec33); + if(this.field_78528_u instanceof EntityLivingBase || this.field_78528_u instanceof EntityItemFrame) { + this.field_78531_r.field_147125_j = this.field_78528_u; + } + } + + this.field_78531_r.field_71424_I.func_76319_b(); + } + + } + + private void func_78477_e() { + float f = 1.0F; + if(this.field_78531_r.func_175606_aa() instanceof AbstractClientPlayer) { + AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer)this.field_78531_r.func_175606_aa(); + f = abstractclientplayer.func_175156_o(); + } + + this.field_78506_S = this.field_78507_R; + this.field_78507_R += (f - this.field_78507_R) * 0.5F; + if(this.field_78507_R > 1.5F) { + this.field_78507_R = 1.5F; + } + + if(this.field_78507_R < 0.1F) { + this.field_78507_R = 0.1F; + } + + } + + private float func_78481_a(float p_78481_1_, boolean p_78481_2_) { + if(this.field_175078_W) { + return 90.0F; + } else { + Entity entity = this.field_78531_r.func_175606_aa(); + float f = 70.0F; + if(p_78481_2_) { + f = this.field_78531_r.field_71474_y.field_74334_X; + if(Config.isDynamicFov()) { + f *= this.field_78506_S + (this.field_78507_R - this.field_78506_S) * p_78481_1_; + } + } + + boolean flag = false; + if(this.field_78531_r.field_71462_r == null) { + GameSettings gamesettings = this.field_78531_r.field_71474_y; + flag = GameSettings.func_100015_a(this.field_78531_r.field_71474_y.ofKeyBindZoom); + } + + if(flag) { + if(!Config.zoomMode) { + Config.zoomMode = true; + Config.zoomSmoothCamera = this.field_78531_r.field_71474_y.field_74326_T; + this.field_78531_r.field_71474_y.field_74326_T = true; + this.field_78531_r.field_71438_f.field_147595_R = true; + } + + if(Config.zoomMode) { + f /= 4.0F; + } + } else if(Config.zoomMode) { + Config.zoomMode = false; + this.field_78531_r.field_71474_y.field_74326_T = Config.zoomSmoothCamera; + this.field_78527_v = new MouseFilter(); + this.field_78526_w = new MouseFilter(); + this.field_78531_r.field_71438_f.field_147595_R = true; + } + + if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_110143_aJ() <= 0.0F) { + float f1 = (float)((EntityLivingBase)entity).field_70725_aQ + p_78481_1_; + f /= (1.0F - 500.0F / (f1 + 500.0F)) * 2.0F + 1.0F; + } + + Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78481_1_); + if(block.func_149688_o() == Material.field_151586_h) { + f = f * 60.0F / 70.0F; + } + + return Reflector.ForgeHooksClient_getFOVModifier.exists()?Reflector.callFloat(Reflector.ForgeHooksClient_getFOVModifier, new Object[]{this, entity, block, Float.valueOf(p_78481_1_), Float.valueOf(f)}):f; + } + } + + private void func_78482_e(float p_78482_1_) { + if(this.field_78531_r.func_175606_aa() instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase)this.field_78531_r.func_175606_aa(); + float f = (float)entitylivingbase.field_70737_aN - p_78482_1_; + if(entitylivingbase.func_110143_aJ() <= 0.0F) { + float f1 = (float)entitylivingbase.field_70725_aQ + p_78482_1_; + GlStateManager.func_179114_b(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F); + } + + if(f < 0.0F) { + return; + } + + f = f / (float)entitylivingbase.field_70738_aO; + f = MathHelper.func_76126_a(f * f * f * f * 3.1415927F); + float f2 = entitylivingbase.field_70739_aP; + GlStateManager.func_179114_b(-f2, 0.0F, 1.0F, 0.0F); + GlStateManager.func_179114_b(-f * 14.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.func_179114_b(f2, 0.0F, 1.0F, 0.0F); + } + + } + + private void func_78475_f(float p_78475_1_) { + if(this.field_78531_r.func_175606_aa() instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.func_175606_aa(); + float f = entityplayer.M - entityplayer.L; + float f1 = -(entityplayer.M + f * p_78475_1_); + float f2 = entityplayer.field_71107_bF + (entityplayer.field_71109_bG - entityplayer.field_71107_bF) * p_78475_1_; + float f3 = entityplayer.aE + (entityplayer.aF - entityplayer.aE) * p_78475_1_; + GlStateManager.func_179109_b(MathHelper.func_76126_a(f1 * 3.1415927F) * f2 * 0.5F, -Math.abs(MathHelper.func_76134_b(f1 * 3.1415927F) * f2), 0.0F); + GlStateManager.func_179114_b(MathHelper.func_76126_a(f1 * 3.1415927F) * f2 * 3.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.func_179114_b(Math.abs(MathHelper.func_76134_b(f1 * 3.1415927F - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.func_179114_b(f3, 1.0F, 0.0F, 0.0F); + } + + } + + private void func_78467_g(float p_78467_1_) { + Entity entity = this.field_78531_r.func_175606_aa(); + float f = entity.func_70047_e(); + double d0 = entity.field_70169_q + (entity.field_70165_t - entity.field_70169_q) * (double)p_78467_1_; + double d1 = entity.field_70167_r + (entity.field_70163_u - entity.field_70167_r) * (double)p_78467_1_ + (double)f; + double d2 = entity.field_70166_s + (entity.field_70161_v - entity.field_70166_s) * (double)p_78467_1_; + if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70608_bn()) { + f = (float)((double)f + 1.0D); + GlStateManager.func_179109_b(0.0F, 0.3F, 0.0F); + if(!this.field_78531_r.field_71474_y.field_74325_U) { + BlockPos blockpos = new BlockPos(entity); + IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); + if(Reflector.ForgeHooksClient_orientBedCamera.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_orientBedCamera, new Object[]{this.field_78531_r.field_71441_e, blockpos, iblockstate, entity}); + } else if(block == Blocks.field_150324_C) { + int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.O)).func_176736_b(); + GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F); + } + + GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); + GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F); + } + } else if(this.field_78531_r.field_71474_y.field_74320_O > 0) { + double d3 = (double)(this.field_78491_C + (this.field_78490_B - this.field_78491_C) * p_78467_1_); + if(this.field_78531_r.field_71474_y.field_74325_U) { + GlStateManager.func_179109_b(0.0F, 0.0F, (float)(-d3)); + } else { + float f1 = entity.field_70177_z; + float f2 = entity.field_70125_A; + if(this.field_78531_r.field_71474_y.field_74320_O == 2) { + f2 += 180.0F; + } + + double d4 = (double)(-MathHelper.func_76126_a(f1 / 180.0F * 3.1415927F) * MathHelper.func_76134_b(f2 / 180.0F * 3.1415927F)) * d3; + double d5 = (double)(MathHelper.func_76134_b(f1 / 180.0F * 3.1415927F) * MathHelper.func_76134_b(f2 / 180.0F * 3.1415927F)) * d3; + double d6 = (double)(-MathHelper.func_76126_a(f2 / 180.0F * 3.1415927F)) * d3; + + for(int i = 0; i < 8; ++i) { + float f3 = (float)((i & 1) * 2 - 1); + float f4 = (float)((i >> 1 & 1) * 2 - 1); + float f5 = (float)((i >> 2 & 1) * 2 - 1); + f3 = f3 * 0.1F; + f4 = f4 * 0.1F; + f5 = f5 * 0.1F; + MovingObjectPosition movingobjectposition = this.field_78531_r.field_71441_e.func_72933_a(new Vec3(d0 + (double)f3, d1 + (double)f4, d2 + (double)f5), new Vec3(d0 - d4 + (double)f3 + (double)f5, d1 - d6 + (double)f4, d2 - d5 + (double)f5)); + if(movingobjectposition != null) { + double d7 = movingobjectposition.field_72307_f.func_72438_d(new Vec3(d0, d1, d2)); + if(d7 < d3) { + d3 = d7; + } + } + } + + if(this.field_78531_r.field_71474_y.field_74320_O == 2) { + GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F); + } + + GlStateManager.func_179114_b(entity.field_70125_A - f2, 1.0F, 0.0F, 0.0F); + GlStateManager.func_179114_b(entity.field_70177_z - f1, 0.0F, 1.0F, 0.0F); + GlStateManager.func_179109_b(0.0F, 0.0F, (float)(-d3)); + GlStateManager.func_179114_b(f1 - entity.field_70177_z, 0.0F, 1.0F, 0.0F); + GlStateManager.func_179114_b(f2 - entity.field_70125_A, 1.0F, 0.0F, 0.0F); + } + } else { + GlStateManager.func_179109_b(0.0F, 0.0F, -0.1F); + } + + if(Reflector.EntityViewRenderEvent_CameraSetup_Constructor.exists()) { + if(!this.field_78531_r.field_71474_y.field_74325_U) { + float f6 = entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F; + float f7 = entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_; + float f8 = 0.0F; + if(entity instanceof EntityAnimal) { + EntityAnimal entityanimal1 = (EntityAnimal)entity; + f6 = entityanimal1.aL + (entityanimal1.aK - entityanimal1.aL) * p_78467_1_ + 180.0F; + } + + Block block1 = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78467_1_); + Object object = Reflector.newInstance(Reflector.EntityViewRenderEvent_CameraSetup_Constructor, new Object[]{this, entity, block1, Float.valueOf(p_78467_1_), Float.valueOf(f6), Float.valueOf(f7), Float.valueOf(f8)}); + Reflector.postForgeBusEvent(object); + f8 = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_CameraSetup_roll, f8); + f7 = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_CameraSetup_pitch, f7); + f6 = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_CameraSetup_yaw, f6); + GlStateManager.func_179114_b(f8, 0.0F, 0.0F, 1.0F); + GlStateManager.func_179114_b(f7, 1.0F, 0.0F, 0.0F); + GlStateManager.func_179114_b(f6, 0.0F, 1.0F, 0.0F); + } + } else if(!this.field_78531_r.field_71474_y.field_74325_U) { + GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, 1.0F, 0.0F, 0.0F); + if(entity instanceof EntityAnimal) { + EntityAnimal entityanimal = (EntityAnimal)entity; + GlStateManager.func_179114_b(entityanimal.aL + (entityanimal.aK - entityanimal.aL) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); + } else { + GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); + } + } + + GlStateManager.func_179109_b(0.0F, -f, 0.0F); + d0 = entity.field_70169_q + (entity.field_70165_t - entity.field_70169_q) * (double)p_78467_1_; + d1 = entity.field_70167_r + (entity.field_70163_u - entity.field_70167_r) * (double)p_78467_1_ + (double)f; + d2 = entity.field_70166_s + (entity.field_70161_v - entity.field_70166_s) * (double)p_78467_1_; + this.field_78500_U = this.field_78531_r.field_71438_f.func_72721_a(d0, d1, d2, p_78467_1_); + } + + public void func_78479_a(float p_78479_1_, int p_78479_2_) { + this.field_78530_s = (float)(this.field_78531_r.field_71474_y.field_151451_c * 16); + if(Config.isFogFancy()) { + this.field_78530_s *= 0.95F; + } + + if(Config.isFogFast()) { + this.field_78530_s *= 0.83F; + } + + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + float f = 0.07F; + if(this.field_78531_r.field_71474_y.field_74337_g) { + GlStateManager.func_179109_b((float)(-(p_78479_2_ * 2 - 1)) * f, 0.0F, 0.0F); + } + + this.clipDistance = this.field_78530_s * 2.0F; + if(this.clipDistance < 173.0F) { + this.clipDistance = 173.0F; + } + + if(this.field_78503_V != 1.0D) { + GlStateManager.func_179109_b((float)this.field_78502_W, (float)(-this.field_78509_X), 0.0F); + GlStateManager.func_179139_a(this.field_78503_V, this.field_78503_V, 1.0D); + } + + Project.gluPerspective(this.func_78481_a(p_78479_1_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.clipDistance); + GlStateManager.func_179128_n(5888); + GlStateManager.func_179096_D(); + if(this.field_78531_r.field_71474_y.field_74337_g) { + GlStateManager.func_179109_b((float)(p_78479_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + this.func_78482_e(p_78479_1_); + if(this.field_78531_r.field_71474_y.field_74336_f) { + this.func_78475_f(p_78479_1_); + } + + float f1 = this.field_78531_r.field_71439_g.field_71080_cy + (this.field_78531_r.field_71439_g.field_71086_bY - this.field_78531_r.field_71439_g.field_71080_cy) * p_78479_1_; + if(f1 > 0.0F) { + int i = 20; + if(this.field_78531_r.field_71439_g.a(Potion.field_76431_k)) { + i = 7; + } + + float f2 = 5.0F / (f1 * f1 + 5.0F) - f1 * 0.04F; + f2 = f2 * f2; + GlStateManager.func_179114_b(((float)this.field_78529_t + p_78479_1_) * (float)i, 0.0F, 1.0F, 1.0F); + GlStateManager.func_179152_a(1.0F / f2, 1.0F, 1.0F); + GlStateManager.func_179114_b(-((float)this.field_78529_t + p_78479_1_) * (float)i, 0.0F, 1.0F, 1.0F); + } + + this.func_78467_g(p_78479_1_); + if(this.field_175078_W) { + switch(this.field_175079_V) { + case 0: + GlStateManager.func_179114_b(90.0F, 0.0F, 1.0F, 0.0F); + break; + case 1: + GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F); + break; + case 2: + GlStateManager.func_179114_b(-90.0F, 0.0F, 1.0F, 0.0F); + break; + case 3: + GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F); + break; + case 4: + GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F); + } + } + + } + + private void func_78476_b(float p_78476_1_, int p_78476_2_) { + this.renderHand(p_78476_1_, p_78476_2_, true, true, false); + } + + public void renderHand(float p_renderHand_1_, int p_renderHand_2_, boolean p_renderHand_3_, boolean p_renderHand_4_, boolean p_renderHand_5_) { + if(!this.field_175078_W) { + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + float f = 0.07F; + if(this.field_78531_r.field_71474_y.field_74337_g) { + GlStateManager.func_179109_b((float)(-(p_renderHand_2_ * 2 - 1)) * f, 0.0F, 0.0F); + } + + if(Config.isShaders()) { + Shaders.applyHandDepth(); + } + + Project.gluPerspective(this.func_78481_a(p_renderHand_1_, false), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * 2.0F); + GlStateManager.func_179128_n(5888); + GlStateManager.func_179096_D(); + if(this.field_78531_r.field_71474_y.field_74337_g) { + GlStateManager.func_179109_b((float)(p_renderHand_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + boolean flag = false; + if(p_renderHand_3_) { + GlStateManager.func_179094_E(); + this.func_78482_e(p_renderHand_1_); + if(this.field_78531_r.field_71474_y.field_74336_f) { + this.func_78475_f(p_renderHand_1_); + } + + flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn(); + boolean flag1 = !ReflectorForge.renderFirstPersonHand(this.field_78531_r.field_71438_f, p_renderHand_1_, p_renderHand_2_); + if(flag1 && this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71442_b.func_78747_a()) { + this.func_180436_i(); + if(Config.isShaders()) { + ShadersRender.renderItemFP(this.field_78516_c, p_renderHand_1_, p_renderHand_5_); + } else { + this.field_78516_c.func_78440_a(p_renderHand_1_); + } + + this.func_175072_h(); + } + + GlStateManager.func_179121_F(); + } + + if(!p_renderHand_4_) { + return; + } + + this.func_175072_h(); + if(this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag) { + this.field_78516_c.func_78447_b(p_renderHand_1_); + this.func_78482_e(p_renderHand_1_); + } + + if(this.field_78531_r.field_71474_y.field_74336_f) { + this.func_78475_f(p_renderHand_1_); + } + } + + } + + public void func_175072_h() { + GlStateManager.func_179138_g(OpenGlHelper.field_77476_b); + GlStateManager.func_179090_x(); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + if(Config.isShaders()) { + Shaders.disableLightmap(); + } + + } + + public void func_180436_i() { + GlStateManager.func_179138_g(OpenGlHelper.field_77476_b); + GlStateManager.func_179128_n(5890); + GlStateManager.func_179096_D(); + float f = 0.00390625F; + GlStateManager.func_179152_a(f, f, f); + GlStateManager.func_179109_b(8.0F, 8.0F, 8.0F); + GlStateManager.func_179128_n(5888); + this.field_78531_r.func_110434_K().func_110577_a(this.field_110922_T); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glTexParameteri(3553, 10242, '\u812f'); + GL11.glTexParameteri(3553, 10243, '\u812f'); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179098_w(); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + if(Config.isShaders()) { + Shaders.enableLightmap(); + } + + } + + private void func_78470_f() { + this.field_175075_L = (float)((double)this.field_175075_L + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.field_175075_L = (float)((double)this.field_175075_L * 0.9D); + this.field_78514_e += (this.field_175075_L - this.field_78514_e) * 1.0F; + this.field_78536_aa = true; + } + + private void func_78472_g(float p_78472_1_) { + if(this.field_78536_aa) { + this.field_78531_r.field_71424_I.func_76320_a("lightTex"); + World world = this.field_78531_r.field_71441_e; + if(world != null) { + if(Config.isCustomColors() && CustomColors.updateLightmap(world, this.field_78514_e, this.field_78504_Q, this.field_78531_r.field_71439_g.a(Potion.field_76439_r), p_78472_1_)) { + this.field_78513_d.func_110564_a(); + this.field_78536_aa = false; + this.field_78531_r.field_71424_I.func_76319_b(); + return; + } + + float f = world.func_72971_b(1.0F); + float f1 = f * 0.95F + 0.05F; + + for(int i = 0; i < 256; ++i) { + float f2 = world.field_73011_w.func_177497_p()[i / 16] * f1; + float f3 = world.field_73011_w.func_177497_p()[i % 16] * (this.field_78514_e * 0.1F + 1.5F); + if(world.func_175658_ac() > 0) { + f2 = world.field_73011_w.func_177497_p()[i / 16]; + } + + float f4 = f2 * (f * 0.65F + 0.35F); + float f5 = f2 * (f * 0.65F + 0.35F); + float f6 = f3 * ((f3 * 0.6F + 0.4F) * 0.6F + 0.4F); + float f7 = f3 * (f3 * f3 * 0.6F + 0.4F); + float f8 = f4 + f3; + float f9 = f5 + f6; + float f10 = f2 + f7; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + if(this.field_82831_U > 0.0F) { + float f11 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * p_78472_1_; + f8 = f8 * (1.0F - f11) + f8 * 0.7F * f11; + f9 = f9 * (1.0F - f11) + f9 * 0.6F * f11; + f10 = f10 * (1.0F - f11) + f10 * 0.6F * f11; + } + + if(world.field_73011_w.func_177502_q() == 1) { + f8 = 0.22F + f3 * 0.75F; + f9 = 0.28F + f6 * 0.75F; + f10 = 0.25F + f7 * 0.75F; + } + + if(this.field_78531_r.field_71439_g.a(Potion.field_76439_r)) { + float f15 = this.func_180438_a(this.field_78531_r.field_71439_g, p_78472_1_); + float f12 = 1.0F / f8; + if(f12 > 1.0F / f9) { + f12 = 1.0F / f9; + } + + if(f12 > 1.0F / f10) { + f12 = 1.0F / f10; + } + + f8 = f8 * (1.0F - f15) + f8 * f12 * f15; + f9 = f9 * (1.0F - f15) + f9 * f12 * f15; + f10 = f10 * (1.0F - f15) + f10 * f12 * f15; + } + + if(f8 > 1.0F) { + f8 = 1.0F; + } + + if(f9 > 1.0F) { + f9 = 1.0F; + } + + if(f10 > 1.0F) { + f10 = 1.0F; + } + + float f16 = this.field_78531_r.field_71474_y.field_74333_Y; + float f17 = 1.0F - f8; + float f13 = 1.0F - f9; + float f14 = 1.0F - f10; + f17 = 1.0F - f17 * f17 * f17 * f17; + f13 = 1.0F - f13 * f13 * f13 * f13; + f14 = 1.0F - f14 * f14 * f14 * f14; + f8 = f8 * (1.0F - f16) + f17 * f16; + f9 = f9 * (1.0F - f16) + f13 * f16; + f10 = f10 * (1.0F - f16) + f14 * f16; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + if(f8 > 1.0F) { + f8 = 1.0F; + } + + if(f9 > 1.0F) { + f9 = 1.0F; + } + + if(f10 > 1.0F) { + f10 = 1.0F; + } + + if(f8 < 0.0F) { + f8 = 0.0F; + } + + if(f9 < 0.0F) { + f9 = 0.0F; + } + + if(f10 < 0.0F) { + f10 = 0.0F; + } + + int j = 255; + int k = (int)(f8 * 255.0F); + int l = (int)(f9 * 255.0F); + int i1 = (int)(f10 * 255.0F); + this.field_78504_Q[i] = j << 24 | k << 16 | l << 8 | i1; + } + + this.field_78513_d.func_110564_a(); + this.field_78536_aa = false; + this.field_78531_r.field_71424_I.func_76319_b(); + } + } + + } + + public float func_180438_a(EntityLivingBase p_180438_1_, float p_180438_2_) { + int i = p_180438_1_.func_70660_b(Potion.field_76439_r).func_76459_b(); + return i > 200?1.0F:0.7F + MathHelper.func_76126_a(((float)i - p_180438_2_) * 3.1415927F * 0.2F) * 0.3F; + } + + public void func_181560_a(float p_181560_1_, long p_181560_2_) { + Config.renderPartialTicks = p_181560_1_; + this.frameInit(); + boolean flag = Display.isActive(); + if(!flag && this.field_78531_r.field_71474_y.field_82881_y && (!this.field_78531_r.field_71474_y.field_85185_A || !Mouse.isButtonDown(1))) { + if(Minecraft.func_71386_F() - this.field_78508_Y > 500L) { + this.field_78531_r.func_71385_j(); + } + } else { + this.field_78508_Y = Minecraft.func_71386_F(); + } + + this.field_78531_r.field_71424_I.func_76320_a("mouse"); + if(flag && Minecraft.field_142025_a && this.field_78531_r.field_71415_G && !Mouse.isInsideWindow()) { + Mouse.setGrabbed(false); + Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); + Mouse.setGrabbed(true); + } + + if(this.field_78531_r.field_71415_G && flag) { + this.field_78531_r.field_71417_B.func_74374_c(); + float f = this.field_78531_r.field_71474_y.field_74341_c * 0.6F + 0.2F; + float f1 = f * f * f * 8.0F; + float f2 = (float)this.field_78531_r.field_71417_B.field_74377_a * f1; + float f3 = (float)this.field_78531_r.field_71417_B.field_74375_b * f1; + int i = 1; + if(this.field_78531_r.field_71474_y.field_74338_d) { + i = -1; + } + + if(this.field_78531_r.field_71474_y.field_74326_T) { + this.field_78496_H += f2; + this.field_78497_I += f3; + float f4 = p_181560_1_ - this.field_78492_L; + this.field_78492_L = p_181560_1_; + f2 = this.field_78498_J * f4; + f3 = this.field_78499_K * f4; + this.field_78531_r.field_71439_g.c(f2, f3 * (float)i); + } else { + this.field_78496_H = 0.0F; + this.field_78497_I = 0.0F; + this.field_78531_r.field_71439_g.c(f2, f3 * (float)i); + } + } + + this.field_78531_r.field_71424_I.func_76319_b(); + if(!this.field_78531_r.field_71454_w) { + field_78517_a = this.field_78531_r.field_71474_y.field_74337_g; + final ScaledResolution scaledresolution = new ScaledResolution(this.field_78531_r); + int i1 = scaledresolution.func_78326_a(); + int j1 = scaledresolution.func_78328_b(); + final int k1 = Mouse.getX() * i1 / this.field_78531_r.field_71443_c; + final int l1 = j1 - Mouse.getY() * j1 / this.field_78531_r.field_71440_d - 1; + int i2 = this.field_78531_r.field_71474_y.field_74350_i; + if(this.field_78531_r.field_71441_e != null) { + this.field_78531_r.field_71424_I.func_76320_a("level"); + int j = Math.min(Minecraft.func_175610_ah(), i2); + j = Math.max(j, 60); + long k = System.nanoTime() - p_181560_2_; + long l = Math.max((long)(1000000000 / j / 4) - k, 0L); + this.func_78471_a(p_181560_1_, System.nanoTime() + l); + if(OpenGlHelper.field_148824_g) { + this.field_78531_r.field_71438_f.func_174975_c(); + if(this.field_147707_d != null && this.field_175083_ad) { + GlStateManager.func_179128_n(5890); + GlStateManager.func_179094_E(); + GlStateManager.func_179096_D(); + this.field_147707_d.func_148018_a(p_181560_1_); + GlStateManager.func_179121_F(); + } + + this.field_78531_r.func_147110_a().func_147610_a(true); + } + + this.field_78510_Z = System.nanoTime(); + this.field_78531_r.field_71424_I.func_76318_c("gui"); + if(!this.field_78531_r.field_71474_y.field_74319_N || this.field_78531_r.field_71462_r != null) { + GlStateManager.func_179092_a(516, 0.1F); + this.field_78531_r.field_71456_v.func_175180_a(p_181560_1_); + if(this.field_78531_r.field_71474_y.ofShowFps && !this.field_78531_r.field_71474_y.field_74330_P) { + Config.drawFps(); + } + + if(this.field_78531_r.field_71474_y.field_74330_P) { + Lagometer.showLagometer(scaledresolution); + } + } + + this.field_78531_r.field_71424_I.func_76319_b(); + } else { + GlStateManager.func_179083_b(0, 0, this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d); + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + GlStateManager.func_179128_n(5888); + GlStateManager.func_179096_D(); + this.func_78478_c(); + this.field_78510_Z = System.nanoTime(); + TileEntityRendererDispatcher.field_147556_a.field_147553_e = this.field_78531_r.func_110434_K(); + TileEntityRendererDispatcher.field_147556_a.field_147557_n = this.field_78531_r.field_71466_p; + } + + if(this.field_78531_r.field_71462_r != null) { + GlStateManager.func_179086_m(256); + + try { + if(Reflector.ForgeHooksClient_drawScreen.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_drawScreen, new Object[]{this.field_78531_r.field_71462_r, Integer.valueOf(k1), Integer.valueOf(l1), Float.valueOf(p_181560_1_)}); + } else { + this.field_78531_r.field_71462_r.func_73863_a(k1, l1, p_181560_1_); + } + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering screen"); + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Screen render details"); + crashreportcategory.func_71500_a("Screen name", new Callable() { + public String call() throws Exception { + return EntityRenderer.this.field_78531_r.field_71462_r.getClass().getCanonicalName(); + } + }); + crashreportcategory.func_71500_a("Mouse location", new Callable() { + public String call() throws Exception { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[]{Integer.valueOf(k1), Integer.valueOf(l1), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); + } + }); + crashreportcategory.func_71500_a("Screen size", new Callable() { + public String call() throws Exception { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[]{Integer.valueOf(scaledresolution.func_78326_a()), Integer.valueOf(scaledresolution.func_78328_b()), Integer.valueOf(EntityRenderer.this.field_78531_r.field_71443_c), Integer.valueOf(EntityRenderer.this.field_78531_r.field_71440_d), Integer.valueOf(scaledresolution.func_78325_e())}); + } + }); + throw new ReportedException(crashreport); + } + } + } + + this.frameFinish(); + this.waitForServerThread(); + MemoryMonitor.update(); + Lagometer.updateLagometer(); + if(this.field_78531_r.field_71474_y.ofProfiler) { + this.field_78531_r.field_71474_y.field_74329_Q = true; + } + + } + + public void func_152430_c(float p_152430_1_) { + this.func_78478_c(); + this.field_78531_r.field_71456_v.func_180478_c(new ScaledResolution(this.field_78531_r)); + } + + private boolean func_175070_n() { + if(!this.field_175073_D) { + return false; + } else { + Entity entity = this.field_78531_r.func_175606_aa(); + boolean flag = entity instanceof EntityPlayer && !this.field_78531_r.field_71474_y.field_74319_N; + if(flag && !((EntityPlayer)entity).field_71075_bZ.field_75099_e) { + ItemStack itemstack = ((EntityPlayer)entity).func_71045_bC(); + if(this.field_78531_r.field_71476_x != null && this.field_78531_r.field_71476_x.field_72313_a == MovingObjectType.BLOCK) { + BlockPos blockpos = this.field_78531_r.field_71476_x.func_178782_a(); + IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); + if(this.field_78531_r.field_71442_b.func_178889_l() == GameType.SPECTATOR) { + flag = ReflectorForge.blockHasTileEntity(iblockstate) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; + } else { + flag = itemstack != null && (itemstack.func_179544_c(block) || itemstack.func_179547_d(block)); + } + } + } + + return flag; + } + } + + private void func_175067_i(float p_175067_1_) { + if(this.field_78531_r.field_71474_y.field_74330_P && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71439_g.cq() && !this.field_78531_r.field_71474_y.field_178879_v) { + Entity entity = this.field_78531_r.func_175606_aa(); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + GL11.glLineWidth(1.0F); + GlStateManager.func_179090_x(); + GlStateManager.func_179132_a(false); + GlStateManager.func_179094_E(); + GlStateManager.func_179128_n(5888); + GlStateManager.func_179096_D(); + this.func_78467_g(p_175067_1_); + GlStateManager.func_179109_b(0.0F, entity.func_70047_e(), 0.0F); + RenderGlobal.func_181563_a(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.005D, 1.0E-4D, 1.0E-4D), 255, 0, 0, 255); + RenderGlobal.func_181563_a(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0E-4D, 1.0E-4D, 0.005D), 0, 0, 255, 255); + RenderGlobal.func_181563_a(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0E-4D, 0.0033D, 1.0E-4D), 0, 255, 0, 255); + GlStateManager.func_179121_F(); + GlStateManager.func_179132_a(true); + GlStateManager.func_179098_w(); + GlStateManager.func_179084_k(); + } + + } + + public void func_78471_a(float p_78471_1_, long p_78471_2_) { + this.func_78472_g(p_78471_1_); + if(this.field_78531_r.func_175606_aa() == null) { + this.field_78531_r.func_175607_a(this.field_78531_r.field_71439_g); + } + + this.func_78473_a(p_78471_1_); + if(Config.isShaders()) { + Shaders.beginRender(this.field_78531_r, p_78471_1_, p_78471_2_); + } + + GlStateManager.func_179126_j(); + GlStateManager.func_179141_d(); + GlStateManager.func_179092_a(516, 0.1F); + this.field_78531_r.field_71424_I.func_76320_a("center"); + if(this.field_78531_r.field_71474_y.field_74337_g) { + field_78515_b = 0; + GlStateManager.func_179135_a(false, true, true, false); + this.func_175068_a(0, p_78471_1_, p_78471_2_); + field_78515_b = 1; + GlStateManager.func_179135_a(true, false, false, false); + this.func_175068_a(1, p_78471_1_, p_78471_2_); + GlStateManager.func_179135_a(true, true, true, false); + } else { + this.func_175068_a(2, p_78471_1_, p_78471_2_); + } + + this.field_78531_r.field_71424_I.func_76319_b(); + } + + private void func_175068_a(int p_175068_1_, float p_175068_2_, long p_175068_3_) { + boolean flag = Config.isShaders(); + if(flag) { + Shaders.beginRenderPass(p_175068_1_, p_175068_2_, p_175068_3_); + } + + RenderGlobal renderglobal = this.field_78531_r.field_71438_f; + EffectRenderer effectrenderer = this.field_78531_r.field_71452_i; + boolean flag1 = this.func_175070_n(); + GlStateManager.func_179089_o(); + this.field_78531_r.field_71424_I.func_76318_c("clear"); + if(flag) { + Shaders.setViewport(0, 0, this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d); + } else { + GlStateManager.func_179083_b(0, 0, this.field_78531_r.field_71443_c, this.field_78531_r.field_71440_d); + } + + this.func_78466_h(p_175068_2_); + GlStateManager.func_179086_m(16640); + if(flag) { + Shaders.clearRenderBuffer(); + } + + this.field_78531_r.field_71424_I.func_76318_c("camera"); + this.func_78479_a(p_175068_2_, p_175068_1_); + if(flag) { + Shaders.setCamera(p_175068_2_); + } + + ActiveRenderInfo.func_74583_a(this.field_78531_r.field_71439_g, this.field_78531_r.field_71474_y.field_74320_O == 2); + this.field_78531_r.field_71424_I.func_76318_c("frustum"); + ClippingHelper clippinghelper = ClippingHelperImpl.func_78558_a(); + this.field_78531_r.field_71424_I.func_76318_c("culling"); + clippinghelper.disabled = Config.isShaders() && !Shaders.isFrustumCulling(); + ICamera icamera = new Frustum(clippinghelper); + Entity entity = this.field_78531_r.func_175606_aa(); + double d0 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_175068_2_; + double d1 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_175068_2_; + double d2 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_175068_2_; + if(flag) { + ShadersRender.setFrustrumPosition(icamera, d0, d1, d2); + } else { + icamera.func_78547_a(d0, d1, d2); + } + + if((Config.isSkyEnabled() || Config.isSunMoonEnabled() || Config.isStarsEnabled()) && !Shaders.isShadowPass) { + this.func_78468_a(-1, p_175068_2_); + this.field_78531_r.field_71424_I.func_76318_c("sky"); + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + Project.gluPerspective(this.func_78481_a(p_175068_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.clipDistance); + GlStateManager.func_179128_n(5888); + if(flag) { + Shaders.beginSky(); + } + + renderglobal.func_174976_a(p_175068_2_, p_175068_1_); + if(flag) { + Shaders.endSky(); + } + + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + Project.gluPerspective(this.func_78481_a(p_175068_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.clipDistance); + GlStateManager.func_179128_n(5888); + } else { + GlStateManager.func_179084_k(); + } + + this.func_78468_a(0, p_175068_2_); + GlStateManager.func_179103_j(7425); + if(entity.field_70163_u + (double)entity.func_70047_e() < 128.0D + (double)(this.field_78531_r.field_71474_y.ofCloudsHeight * 128.0F)) { + this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_); + } + + this.field_78531_r.field_71424_I.func_76318_c("prepareterrain"); + this.func_78468_a(0, p_175068_2_); + this.field_78531_r.func_110434_K().func_110577_a(TextureMap.field_110575_b); + RenderHelper.func_74518_a(); + this.field_78531_r.field_71424_I.func_76318_c("terrain_setup"); + this.checkLoadVisibleChunks(entity, p_175068_2_, icamera, this.field_78531_r.field_71439_g.v()); + if(flag) { + ShadersRender.setupTerrain(renderglobal, entity, (double)p_175068_2_, icamera, this.field_175084_ae++, this.field_78531_r.field_71439_g.v()); + } else { + renderglobal.func_174970_a(entity, (double)p_175068_2_, icamera, this.field_175084_ae++, this.field_78531_r.field_71439_g.v()); + } + + if(p_175068_1_ == 0 || p_175068_1_ == 2) { + this.field_78531_r.field_71424_I.func_76318_c("updatechunks"); + Lagometer.timerChunkUpload.start(); + this.field_78531_r.field_71438_f.func_174967_a(p_175068_3_); + Lagometer.timerChunkUpload.end(); + } + + this.field_78531_r.field_71424_I.func_76318_c("terrain"); + Lagometer.timerTerrain.start(); + if(this.field_78531_r.field_71474_y.ofSmoothFps && p_175068_1_ > 0) { + this.field_78531_r.field_71424_I.func_76318_c("finish"); + GL11.glFinish(); + this.field_78531_r.field_71424_I.func_76318_c("terrain"); + } + + GlStateManager.func_179128_n(5888); + GlStateManager.func_179094_E(); + GlStateManager.func_179118_c(); + if(flag) { + ShadersRender.beginTerrainSolid(); + } + + renderglobal.func_174977_a(EnumWorldBlockLayer.SOLID, (double)p_175068_2_, p_175068_1_, entity); + GlStateManager.func_179141_d(); + if(flag) { + ShadersRender.beginTerrainCutoutMipped(); + } + + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, this.field_78531_r.field_71474_y.field_151442_I > 0); + renderglobal.func_174977_a(EnumWorldBlockLayer.CUTOUT_MIPPED, (double)p_175068_2_, p_175068_1_, entity); + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a(); + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false); + if(flag) { + ShadersRender.beginTerrainCutout(); + } + + renderglobal.func_174977_a(EnumWorldBlockLayer.CUTOUT, (double)p_175068_2_, p_175068_1_, entity); + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a(); + if(flag) { + ShadersRender.endTerrain(); + } + + Lagometer.timerTerrain.end(); + GlStateManager.func_179103_j(7424); + GlStateManager.func_179092_a(516, 0.1F); + if(!this.field_175078_W) { + GlStateManager.func_179128_n(5888); + GlStateManager.func_179121_F(); + GlStateManager.func_179094_E(); + RenderHelper.func_74519_b(); + this.field_78531_r.field_71424_I.func_76318_c("entities"); + if(Reflector.ForgeHooksClient_setRenderPass.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(0)}); + } + + renderglobal.func_180446_a(entity, icamera, p_175068_2_); + if(Reflector.ForgeHooksClient_setRenderPass.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(-1)}); + } + + RenderHelper.func_74518_a(); + this.func_175072_h(); + GlStateManager.func_179128_n(5888); + GlStateManager.func_179121_F(); + GlStateManager.func_179094_E(); + if(this.field_78531_r.field_71476_x != null && entity.func_70055_a(Material.field_151586_h) && flag1) { + EntityPlayer entityplayer = (EntityPlayer)entity; + GlStateManager.func_179118_c(); + this.field_78531_r.field_71424_I.func_76318_c("outline"); + renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_); + GlStateManager.func_179141_d(); + } + } + + GlStateManager.func_179128_n(5888); + GlStateManager.func_179121_F(); + if(flag1 && this.field_78531_r.field_71476_x != null && !entity.func_70055_a(Material.field_151586_h)) { + EntityPlayer entityplayer1 = (EntityPlayer)entity; + GlStateManager.func_179118_c(); + this.field_78531_r.field_71424_I.func_76318_c("outline"); + if((!Reflector.ForgeHooksClient_onDrawBlockHighlight.exists() || !Reflector.callBoolean(Reflector.ForgeHooksClient_onDrawBlockHighlight, new Object[]{renderglobal, entityplayer1, this.field_78531_r.field_71476_x, Integer.valueOf(0), entityplayer1.func_70694_bm(), Float.valueOf(p_175068_2_)})) && !this.field_78531_r.field_71474_y.field_74319_N) { + renderglobal.func_72731_b(entityplayer1, this.field_78531_r.field_71476_x, 0, p_175068_2_); + } + + GlStateManager.func_179141_d(); + } + + if(!renderglobal.field_72738_E.isEmpty()) { + this.field_78531_r.field_71424_I.func_76318_c("destroyProgress"); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 1, 1, 0); + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false); + renderglobal.func_174981_a(Tessellator.func_178181_a(), Tessellator.func_178181_a().func_178180_c(), entity, p_175068_2_); + this.field_78531_r.func_110434_K().func_110581_b(TextureMap.field_110575_b).func_174935_a(); + GlStateManager.func_179084_k(); + } + + GlStateManager.func_179120_a(770, 771, 1, 0); + GlStateManager.func_179084_k(); + if(!this.field_175078_W) { + this.func_180436_i(); + this.field_78531_r.field_71424_I.func_76318_c("litParticles"); + if(flag) { + Shaders.beginLitParticles(); + } + + effectrenderer.func_78872_b(entity, p_175068_2_); + RenderHelper.func_74518_a(); + this.func_78468_a(0, p_175068_2_); + this.field_78531_r.field_71424_I.func_76318_c("particles"); + if(flag) { + Shaders.beginParticles(); + } + + effectrenderer.func_78874_a(entity, p_175068_2_); + if(flag) { + Shaders.endParticles(); + } + + this.func_175072_h(); + } + + GlStateManager.func_179132_a(false); + if(Config.isShaders()) { + GlStateManager.func_179132_a(Shaders.isRainDepth()); + } + + GlStateManager.func_179089_o(); + this.field_78531_r.field_71424_I.func_76318_c("weather"); + if(flag) { + Shaders.beginWeather(); + } + + this.func_78474_d(p_175068_2_); + if(flag) { + Shaders.endWeather(); + } + + GlStateManager.func_179132_a(true); + renderglobal.func_180449_a(entity, p_175068_2_); + if(flag) { + ShadersRender.renderHand0(this, p_175068_2_, p_175068_1_); + Shaders.preWater(); + } + + GlStateManager.func_179084_k(); + GlStateManager.func_179089_o(); + GlStateManager.func_179120_a(770, 771, 1, 0); + GlStateManager.func_179092_a(516, 0.1F); + this.func_78468_a(0, p_175068_2_); + GlStateManager.func_179147_l(); + GlStateManager.func_179132_a(false); + this.field_78531_r.func_110434_K().func_110577_a(TextureMap.field_110575_b); + GlStateManager.func_179103_j(7425); + this.field_78531_r.field_71424_I.func_76318_c("translucent"); + if(flag) { + Shaders.beginWater(); + } + + renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity); + if(flag) { + Shaders.endWater(); + } + + if(Reflector.ForgeHooksClient_setRenderPass.exists() && !this.field_175078_W) { + RenderHelper.func_74519_b(); + this.field_78531_r.field_71424_I.func_76318_c("entities"); + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(1)}); + this.field_78531_r.field_71438_f.func_180446_a(entity, icamera, p_175068_2_); + GlStateManager.func_179120_a(770, 771, 1, 0); + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[]{Integer.valueOf(-1)}); + RenderHelper.func_74518_a(); + } + + GlStateManager.func_179103_j(7424); + GlStateManager.func_179132_a(true); + GlStateManager.func_179089_o(); + GlStateManager.func_179084_k(); + GlStateManager.func_179106_n(); + if(entity.field_70163_u + (double)entity.func_70047_e() >= 128.0D + (double)(this.field_78531_r.field_71474_y.ofCloudsHeight * 128.0F)) { + this.field_78531_r.field_71424_I.func_76318_c("aboveClouds"); + this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_); + } + + if(Reflector.ForgeHooksClient_dispatchRenderLast.exists()) { + this.field_78531_r.field_71424_I.func_76318_c("forge_render_last"); + Reflector.callVoid(Reflector.ForgeHooksClient_dispatchRenderLast, new Object[]{renderglobal, Float.valueOf(p_175068_2_)}); + } + + this.field_78531_r.field_71424_I.func_76318_c("hand"); + if(this.field_175074_C && !Shaders.isShadowPass) { + if(flag) { + ShadersRender.renderHand1(this, p_175068_2_, p_175068_1_); + Shaders.renderCompositeFinal(); + } + + GlStateManager.func_179086_m(256); + if(flag) { + ShadersRender.renderFPOverlay(this, p_175068_2_, p_175068_1_); + } else { + this.func_78476_b(p_175068_2_, p_175068_1_); + } + + this.func_175067_i(p_175068_2_); + } + + if(flag) { + Shaders.endRender(); + } + + } + + private void func_180437_a(RenderGlobal p_180437_1_, float p_180437_2_, int p_180437_3_) { + if(this.field_78531_r.field_71474_y.field_151451_c >= 4 && !Config.isCloudsOff() && Shaders.shouldRenderClouds(this.field_78531_r.field_71474_y)) { + this.field_78531_r.field_71424_I.func_76318_c("clouds"); + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + Project.gluPerspective(this.func_78481_a(p_180437_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.clipDistance * 4.0F); + GlStateManager.func_179128_n(5888); + GlStateManager.func_179094_E(); + this.func_78468_a(0, p_180437_2_); + p_180437_1_.func_180447_b(p_180437_2_, p_180437_3_); + GlStateManager.func_179106_n(); + GlStateManager.func_179121_F(); + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + Project.gluPerspective(this.func_78481_a(p_180437_2_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.clipDistance); + GlStateManager.func_179128_n(5888); + } + + } + + private void func_78484_h() { + float f = this.field_78531_r.field_71441_e.func_72867_j(1.0F); + if(!Config.isRainFancy()) { + f /= 2.0F; + } + + if(f != 0.0F && Config.isRainSplash()) { + this.field_78537_ab.setSeed((long)this.field_78529_t * 312987231L); + Entity entity = this.field_78531_r.func_175606_aa(); + World world = this.field_78531_r.field_71441_e; + BlockPos blockpos = new BlockPos(entity); + int i = 10; + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + int j = 0; + int k = (int)(100.0F * f * f); + if(this.field_78531_r.field_71474_y.field_74362_aa == 1) { + k >>= 1; + } else if(this.field_78531_r.field_71474_y.field_74362_aa == 2) { + k = 0; + } + + for(int l = 0; l < k; ++l) { + BlockPos blockpos1 = world.func_175725_q(blockpos.func_177982_a(this.field_78537_ab.nextInt(i) - this.field_78537_ab.nextInt(i), 0, this.field_78537_ab.nextInt(i) - this.field_78537_ab.nextInt(i))); + BiomeGenBase biomegenbase = world.func_180494_b(blockpos1); + BlockPos blockpos2 = blockpos1.func_177977_b(); + Block block = world.func_180495_p(blockpos2).func_177230_c(); + if(blockpos1.o() <= blockpos.o() + i && blockpos1.o() >= blockpos.o() - i && biomegenbase.func_76738_d() && biomegenbase.func_180626_a(blockpos1) >= 0.15F) { + double d3 = this.field_78537_ab.nextDouble(); + double d4 = this.field_78537_ab.nextDouble(); + if(block.func_149688_o() == Material.field_151587_i) { + this.field_78531_r.field_71441_e.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, (double)blockpos1.n() + d3, (double)((float)blockpos1.o() + 0.1F) - block.func_149665_z(), (double)blockpos1.p() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } else if(block.func_149688_o() != Material.field_151579_a) { + block.func_180654_a(world, blockpos2); + ++j; + if(this.field_78537_ab.nextInt(j) == 0) { + d0 = (double)blockpos2.n() + d3; + d1 = (double)((float)blockpos2.o() + 0.1F) + block.func_149669_A() - 1.0D; + d2 = (double)blockpos2.p() + d4; + } + + this.field_78531_r.field_71441_e.func_175688_a(EnumParticleTypes.WATER_DROP, (double)blockpos2.n() + d3, (double)((float)blockpos2.o() + 0.1F) + block.func_149669_A(), (double)blockpos2.p() + d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + + if(j > 0 && this.field_78537_ab.nextInt(3) < this.field_78534_ac++) { + this.field_78534_ac = 0; + if(d1 > (double)(blockpos.o() + 1) && world.func_175725_q(blockpos).o() > MathHelper.func_76141_d((float)blockpos.o())) { + this.field_78531_r.field_71441_e.func_72980_b(d0, d1, d2, "ambient.weather.rain", 0.1F, 0.5F, false); + } else { + this.field_78531_r.field_71441_e.func_72980_b(d0, d1, d2, "ambient.weather.rain", 0.2F, 1.0F, false); + } + } + } + + } + + protected void func_78474_d(float p_78474_1_) { + if(Reflector.ForgeWorldProvider_getWeatherRenderer.exists()) { + WorldProvider worldprovider = this.field_78531_r.field_71441_e.field_73011_w; + Object object = Reflector.call(worldprovider, Reflector.ForgeWorldProvider_getWeatherRenderer, new Object[0]); + if(object != null) { + Reflector.callVoid(object, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(p_78474_1_), this.field_78531_r.field_71441_e, this.field_78531_r}); + return; + } + } + + float f5 = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); + if(f5 > 0.0F) { + if(Config.isRainOff()) { + return; + } + + this.func_180436_i(); + Entity entity = this.field_78531_r.func_175606_aa(); + World world = this.field_78531_r.field_71441_e; + int i = MathHelper.func_76128_c(entity.field_70165_t); + int j = MathHelper.func_76128_c(entity.field_70163_u); + int k = MathHelper.func_76128_c(entity.field_70161_v); + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + GlStateManager.func_179129_p(); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + GlStateManager.func_179092_a(516, 0.1F); + double d0 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_78474_1_; + double d1 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_78474_1_; + double d2 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_78474_1_; + int l = MathHelper.func_76128_c(d1); + int i1 = 5; + if(Config.isRainFancy()) { + i1 = 10; + } + + int j1 = -1; + float f = (float)this.field_78529_t + p_78474_1_; + worldrenderer.func_178969_c(-d0, -d1, -d2); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + MutableBlockPos mutableblockpos = new MutableBlockPos(); + + for(int k1 = k - i1; k1 <= k + i1; ++k1) { + for(int l1 = i - i1; l1 <= i + i1; ++l1) { + int i2 = (k1 - k + 16) * 32 + l1 - i + 16; + double d3 = (double)this.field_175076_N[i2] * 0.5D; + double d4 = (double)this.field_175077_O[i2] * 0.5D; + mutableblockpos.func_181079_c(l1, 0, k1); + BiomeGenBase biomegenbase = world.func_180494_b(mutableblockpos); + if(biomegenbase.func_76738_d() || biomegenbase.func_76746_c()) { + int j2 = world.func_175725_q(mutableblockpos).o(); + int k2 = j - i1; + int l2 = j + i1; + if(k2 < j2) { + k2 = j2; + } + + if(l2 < j2) { + l2 = j2; + } + + int i3 = j2; + if(j2 < l) { + i3 = l; + } + + if(k2 != l2) { + this.field_78537_ab.setSeed((long)(l1 * l1 * 3121 + l1 * 45238971 ^ k1 * k1 * 418711 + k1 * 13761)); + mutableblockpos.func_181079_c(l1, k2, k1); + float f1 = biomegenbase.func_180626_a(mutableblockpos); + if(world.func_72959_q().func_76939_a(f1, j2) >= 0.15F) { + if(j1 != 0) { + if(j1 >= 0) { + tessellator.func_78381_a(); + } + + j1 = 0; + this.field_78531_r.func_110434_K().func_110577_a(field_110924_q); + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181704_d); + } + + double d5 = ((double)(this.field_78529_t + l1 * l1 * 3121 + l1 * 45238971 + k1 * k1 * 418711 + k1 * 13761 & 31) + (double)p_78474_1_) / 32.0D * (3.0D + this.field_78537_ab.nextDouble()); + double d6 = (double)((float)l1 + 0.5F) - entity.field_70165_t; + double d7 = (double)((float)k1 + 0.5F) - entity.field_70161_v; + float f2 = MathHelper.func_76133_a(d6 * d6 + d7 * d7) / (float)i1; + float f3 = ((1.0F - f2 * f2) * 0.5F + 0.5F) * f5; + mutableblockpos.func_181079_c(l1, i3, k1); + int j3 = world.func_175626_b(mutableblockpos, 0); + int k3 = j3 >> 16 & '\uffff'; + int l3 = j3 & '\uffff'; + worldrenderer.func_181662_b((double)l1 - d3 + 0.5D, (double)k2, (double)k1 - d4 + 0.5D).func_181673_a(0.0D, (double)k2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f3).func_181671_a(k3, l3).func_181675_d(); + worldrenderer.func_181662_b((double)l1 + d3 + 0.5D, (double)k2, (double)k1 + d4 + 0.5D).func_181673_a(1.0D, (double)k2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f3).func_181671_a(k3, l3).func_181675_d(); + worldrenderer.func_181662_b((double)l1 + d3 + 0.5D, (double)l2, (double)k1 + d4 + 0.5D).func_181673_a(1.0D, (double)l2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f3).func_181671_a(k3, l3).func_181675_d(); + worldrenderer.func_181662_b((double)l1 - d3 + 0.5D, (double)l2, (double)k1 - d4 + 0.5D).func_181673_a(0.0D, (double)l2 * 0.25D + d5).func_181666_a(1.0F, 1.0F, 1.0F, f3).func_181671_a(k3, l3).func_181675_d(); + } else { + if(j1 != 1) { + if(j1 >= 0) { + tessellator.func_78381_a(); + } + + j1 = 1; + this.field_78531_r.func_110434_K().func_110577_a(field_110923_r); + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181704_d); + } + + double d8 = (double)(((float)(this.field_78529_t & 511) + p_78474_1_) / 512.0F); + double d9 = this.field_78537_ab.nextDouble() + (double)f * 0.01D * (double)((float)this.field_78537_ab.nextGaussian()); + double d10 = this.field_78537_ab.nextDouble() + (double)(f * (float)this.field_78537_ab.nextGaussian()) * 0.001D; + double d11 = (double)((float)l1 + 0.5F) - entity.field_70165_t; + double d12 = (double)((float)k1 + 0.5F) - entity.field_70161_v; + float f6 = MathHelper.func_76133_a(d11 * d11 + d12 * d12) / (float)i1; + float f4 = ((1.0F - f6 * f6) * 0.3F + 0.5F) * f5; + mutableblockpos.func_181079_c(l1, i3, k1); + int i4 = (world.func_175626_b(mutableblockpos, 0) * 3 + 15728880) / 4; + int j4 = i4 >> 16 & '\uffff'; + int k4 = i4 & '\uffff'; + worldrenderer.func_181662_b((double)l1 - d3 + 0.5D, (double)k2, (double)k1 - d4 + 0.5D).func_181673_a(0.0D + d9, (double)k2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_181671_a(j4, k4).func_181675_d(); + worldrenderer.func_181662_b((double)l1 + d3 + 0.5D, (double)k2, (double)k1 + d4 + 0.5D).func_181673_a(1.0D + d9, (double)k2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_181671_a(j4, k4).func_181675_d(); + worldrenderer.func_181662_b((double)l1 + d3 + 0.5D, (double)l2, (double)k1 + d4 + 0.5D).func_181673_a(1.0D + d9, (double)l2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_181671_a(j4, k4).func_181675_d(); + worldrenderer.func_181662_b((double)l1 - d3 + 0.5D, (double)l2, (double)k1 - d4 + 0.5D).func_181673_a(0.0D + d9, (double)l2 * 0.25D + d8 + d10).func_181666_a(1.0F, 1.0F, 1.0F, f4).func_181671_a(j4, k4).func_181675_d(); + } + } + } + } + } + + if(j1 >= 0) { + tessellator.func_78381_a(); + } + + worldrenderer.func_178969_c(0.0D, 0.0D, 0.0D); + GlStateManager.func_179089_o(); + GlStateManager.func_179084_k(); + GlStateManager.func_179092_a(516, 0.1F); + this.func_175072_h(); + } + + } + + public void func_78478_c() { + ScaledResolution scaledresolution = new ScaledResolution(this.field_78531_r); + GlStateManager.func_179086_m(256); + GlStateManager.func_179128_n(5889); + GlStateManager.func_179096_D(); + GlStateManager.func_179130_a(0.0D, scaledresolution.func_78327_c(), scaledresolution.func_78324_d(), 0.0D, 1000.0D, 3000.0D); + GlStateManager.func_179128_n(5888); + GlStateManager.func_179096_D(); + GlStateManager.func_179109_b(0.0F, 0.0F, -2000.0F); + } + + private void func_78466_h(float p_78466_1_) { + World world = this.field_78531_r.field_71441_e; + Entity entity = this.field_78531_r.func_175606_aa(); + float f = 0.25F + 0.75F * (float)this.field_78531_r.field_71474_y.field_151451_c / 32.0F; + f = 1.0F - (float)Math.pow((double)f, 0.25D); + Vec3 vec3 = world.func_72833_a(this.field_78531_r.func_175606_aa(), p_78466_1_); + vec3 = CustomColors.getWorldSkyColor(vec3, world, this.field_78531_r.func_175606_aa(), p_78466_1_); + float f1 = (float)vec3.field_72450_a; + float f2 = (float)vec3.field_72448_b; + float f3 = (float)vec3.field_72449_c; + Vec3 vec31 = world.func_72948_g(p_78466_1_); + vec31 = CustomColors.getWorldFogColor(vec31, world, this.field_78531_r.func_175606_aa(), p_78466_1_); + this.field_175080_Q = (float)vec31.field_72450_a; + this.field_175082_R = (float)vec31.field_72448_b; + this.field_175081_S = (float)vec31.field_72449_c; + if(this.field_78531_r.field_71474_y.field_151451_c >= 4) { + double d0 = -1.0D; + Vec3 vec32 = MathHelper.func_76126_a(world.func_72929_e(p_78466_1_)) > 0.0F?new Vec3(d0, 0.0D, 0.0D):new Vec3(1.0D, 0.0D, 0.0D); + float f5 = (float)entity.func_70676_i(p_78466_1_).func_72430_b(vec32); + if(f5 < 0.0F) { + f5 = 0.0F; + } + + if(f5 > 0.0F) { + float[] afloat = world.field_73011_w.func_76560_a(world.func_72826_c(p_78466_1_), p_78466_1_); + if(afloat != null) { + f5 = f5 * afloat[3]; + this.field_175080_Q = this.field_175080_Q * (1.0F - f5) + afloat[0] * f5; + this.field_175082_R = this.field_175082_R * (1.0F - f5) + afloat[1] * f5; + this.field_175081_S = this.field_175081_S * (1.0F - f5) + afloat[2] * f5; + } + } + } + + this.field_175080_Q += (f1 - this.field_175080_Q) * f; + this.field_175082_R += (f2 - this.field_175082_R) * f; + this.field_175081_S += (f3 - this.field_175081_S) * f; + float f8 = world.func_72867_j(p_78466_1_); + if(f8 > 0.0F) { + float f4 = 1.0F - f8 * 0.5F; + float f10 = 1.0F - f8 * 0.4F; + this.field_175080_Q *= f4; + this.field_175082_R *= f4; + this.field_175081_S *= f10; + } + + float f9 = world.func_72819_i(p_78466_1_); + if(f9 > 0.0F) { + float f11 = 1.0F - f9 * 0.5F; + this.field_175080_Q *= f11; + this.field_175082_R *= f11; + this.field_175081_S *= f11; + } + + Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78466_1_); + if(this.field_78500_U) { + Vec3 vec33 = world.func_72824_f(p_78466_1_); + this.field_175080_Q = (float)vec33.field_72450_a; + this.field_175082_R = (float)vec33.field_72448_b; + this.field_175081_S = (float)vec33.field_72449_c; + } else if(block.func_149688_o() == Material.field_151586_h) { + float f12 = (float)EnchantmentHelper.func_180319_a(entity) * 0.2F; + f12 = Config.limit(f12, 0.0F, 0.6F); + if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76427_o)) { + f12 = f12 * 0.3F + 0.6F; + } + + this.field_175080_Q = 0.02F + f12; + this.field_175082_R = 0.02F + f12; + this.field_175081_S = 0.2F + f12; + Vec3 vec35 = CustomColors.getUnderwaterColor(this.field_78531_r.field_71441_e, this.field_78531_r.func_175606_aa().field_70165_t, this.field_78531_r.func_175606_aa().field_70163_u + 1.0D, this.field_78531_r.func_175606_aa().field_70161_v); + if(vec35 != null) { + this.field_175080_Q = (float)vec35.field_72450_a; + this.field_175082_R = (float)vec35.field_72448_b; + this.field_175081_S = (float)vec35.field_72449_c; + } + } else if(block.func_149688_o() == Material.field_151587_i) { + this.field_175080_Q = 0.6F; + this.field_175082_R = 0.1F; + this.field_175081_S = 0.0F; + Vec3 vec34 = CustomColors.getUnderlavaColor(this.field_78531_r.field_71441_e, this.field_78531_r.func_175606_aa().field_70165_t, this.field_78531_r.func_175606_aa().field_70163_u + 1.0D, this.field_78531_r.func_175606_aa().field_70161_v); + if(vec34 != null) { + this.field_175080_Q = (float)vec34.field_72450_a; + this.field_175082_R = (float)vec34.field_72448_b; + this.field_175081_S = (float)vec34.field_72449_c; + } + } + + float f13 = this.field_78535_ad + (this.field_78539_ae - this.field_78535_ad) * p_78466_1_; + this.field_175080_Q *= f13; + this.field_175082_R *= f13; + this.field_175081_S *= f13; + double d1 = (entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_78466_1_) * world.field_73011_w.func_76565_k(); + if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q)) { + int i = ((EntityLivingBase)entity).func_70660_b(Potion.field_76440_q).func_76459_b(); + if(i < 20) { + d1 *= (double)(1.0F - (float)i / 20.0F); + } else { + d1 = 0.0D; + } + } + + if(d1 < 1.0D) { + if(d1 < 0.0D) { + d1 = 0.0D; + } + + d1 = d1 * d1; + this.field_175080_Q = (float)((double)this.field_175080_Q * d1); + this.field_175082_R = (float)((double)this.field_175082_R * d1); + this.field_175081_S = (float)((double)this.field_175081_S * d1); + } + + if(this.field_82831_U > 0.0F) { + float f14 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * p_78466_1_; + this.field_175080_Q = this.field_175080_Q * (1.0F - f14) + this.field_175080_Q * 0.7F * f14; + this.field_175082_R = this.field_175082_R * (1.0F - f14) + this.field_175082_R * 0.6F * f14; + this.field_175081_S = this.field_175081_S * (1.0F - f14) + this.field_175081_S * 0.6F * f14; + } + + if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76439_r)) { + float f15 = this.func_180438_a((EntityLivingBase)entity, p_78466_1_); + float f6 = 1.0F / this.field_175080_Q; + if(f6 > 1.0F / this.field_175082_R) { + f6 = 1.0F / this.field_175082_R; + } + + if(f6 > 1.0F / this.field_175081_S) { + f6 = 1.0F / this.field_175081_S; + } + + if(Float.isInfinite(f6)) { + f6 = Math.nextAfter(f6, 0.0D); + } + + this.field_175080_Q = this.field_175080_Q * (1.0F - f15) + this.field_175080_Q * f6 * f15; + this.field_175082_R = this.field_175082_R * (1.0F - f15) + this.field_175082_R * f6 * f15; + this.field_175081_S = this.field_175081_S * (1.0F - f15) + this.field_175081_S * f6 * f15; + } + + if(this.field_78531_r.field_71474_y.field_74337_g) { + float f16 = (this.field_175080_Q * 30.0F + this.field_175082_R * 59.0F + this.field_175081_S * 11.0F) / 100.0F; + float f17 = (this.field_175080_Q * 30.0F + this.field_175082_R * 70.0F) / 100.0F; + float f7 = (this.field_175080_Q * 30.0F + this.field_175081_S * 70.0F) / 100.0F; + this.field_175080_Q = f16; + this.field_175082_R = f17; + this.field_175081_S = f7; + } + + if(Reflector.EntityViewRenderEvent_FogColors_Constructor.exists()) { + Object object = Reflector.newInstance(Reflector.EntityViewRenderEvent_FogColors_Constructor, new Object[]{this, entity, block, Float.valueOf(p_78466_1_), Float.valueOf(this.field_175080_Q), Float.valueOf(this.field_175082_R), Float.valueOf(this.field_175081_S)}); + Reflector.postForgeBusEvent(object); + this.field_175080_Q = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_FogColors_red, this.field_175080_Q); + this.field_175082_R = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_FogColors_green, this.field_175082_R); + this.field_175081_S = Reflector.getFieldValueFloat(object, Reflector.EntityViewRenderEvent_FogColors_blue, this.field_175081_S); + } + + Shaders.setClearColor(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F); + } + + private void func_78468_a(int p_78468_1_, float p_78468_2_) { + this.fogStandard = false; + Entity entity = this.field_78531_r.func_175606_aa(); + boolean flag = false; + if(entity instanceof EntityPlayer) { + flag = ((EntityPlayer)entity).field_71075_bZ.field_75098_d; + } + + GL11.glFog(2918, (FloatBuffer)this.func_78469_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 1.0F)); + GL11.glNormal3f(0.0F, -1.0F, 0.0F); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_); + float f = -1.0F; + if(Reflector.ForgeHooksClient_getFogDensity.exists()) { + f = Reflector.callFloat(Reflector.ForgeHooksClient_getFogDensity, new Object[]{this, entity, block, Float.valueOf(p_78468_2_), Float.valueOf(0.1F)}); + } + + if(f >= 0.0F) { + GlStateManager.func_179095_a(f); + } else if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q)) { + float f4 = 5.0F; + int i = ((EntityLivingBase)entity).func_70660_b(Potion.field_76440_q).func_76459_b(); + if(i < 20) { + f4 = 5.0F + (this.field_78530_s - 5.0F) * (1.0F - (float)i / 20.0F); + } + + GlStateManager.func_179093_d(9729); + if(p_78468_1_ == -1) { + GlStateManager.func_179102_b(0.0F); + GlStateManager.func_179153_c(f4 * 0.8F); + } else { + GlStateManager.func_179102_b(f4 * 0.25F); + GlStateManager.func_179153_c(f4); + } + + if(GLContext.getCapabilities().GL_NV_fog_distance && Config.isFogFancy()) { + GL11.glFogi('\u855a', '\u855b'); + } + } else if(this.field_78500_U) { + GlStateManager.func_179093_d(2048); + GlStateManager.func_179095_a(0.1F); + } else if(block.func_149688_o() == Material.field_151586_h) { + GlStateManager.func_179093_d(2048); + float f1 = Config.isClearWater()?0.02F:0.1F; + if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76427_o)) { + GlStateManager.func_179095_a(0.01F); + } else { + float f2 = 0.1F - (float)EnchantmentHelper.func_180319_a(entity) * 0.03F; + GlStateManager.func_179095_a(Config.limit(f2, 0.0F, f1)); + } + } else if(block.func_149688_o() == Material.field_151587_i) { + GlStateManager.func_179093_d(2048); + GlStateManager.func_179095_a(2.0F); + } else { + float f3 = this.field_78530_s; + this.fogStandard = true; + GlStateManager.func_179093_d(9729); + if(p_78468_1_ == -1) { + GlStateManager.func_179102_b(0.0F); + GlStateManager.func_179153_c(f3); + } else { + GlStateManager.func_179102_b(f3 * Config.getFogStart()); + GlStateManager.func_179153_c(f3); + } + + if(GLContext.getCapabilities().GL_NV_fog_distance) { + if(Config.isFogFancy()) { + GL11.glFogi('\u855a', '\u855b'); + } + + if(Config.isFogFast()) { + GL11.glFogi('\u855a', '\u855c'); + } + } + + if(this.field_78531_r.field_71441_e.field_73011_w.func_76568_b((int)entity.field_70165_t, (int)entity.field_70161_v)) { + GlStateManager.func_179102_b(f3 * 0.05F); + GlStateManager.func_179153_c(f3); + } + + if(Reflector.ForgeHooksClient_onFogRender.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_onFogRender, new Object[]{this, entity, block, Float.valueOf(p_78468_2_), Integer.valueOf(p_78468_1_), Float.valueOf(f3)}); + } + } + + GlStateManager.func_179142_g(); + GlStateManager.func_179127_m(); + GlStateManager.func_179104_a(1028, 4608); + } + + private FloatBuffer func_78469_a(float p_78469_1_, float p_78469_2_, float p_78469_3_, float p_78469_4_) { + if(Config.isShaders()) { + Shaders.setFogColor(p_78469_1_, p_78469_2_, p_78469_3_); + } + + this.field_78521_m.clear(); + this.field_78521_m.put(p_78469_1_).put(p_78469_2_).put(p_78469_3_).put(p_78469_4_); + this.field_78521_m.flip(); + return this.field_78521_m; + } + + public MapItemRenderer func_147701_i() { + return this.field_147709_v; + } + + private void waitForServerThread() { + this.serverWaitTimeCurrent = 0; + if(Config.isSmoothWorld() && Config.isSingleProcessor()) { + if(this.field_78531_r.func_71387_A()) { + IntegratedServer integratedserver = this.field_78531_r.func_71401_C(); + if(integratedserver != null) { + boolean flag = this.field_78531_r.func_147113_T(); + if(!flag && !(this.field_78531_r.field_71462_r instanceof GuiDownloadTerrain)) { + if(this.serverWaitTime > 0) { + Lagometer.timerServer.start(); + Config.sleep((long)this.serverWaitTime); + Lagometer.timerServer.end(); + this.serverWaitTimeCurrent = this.serverWaitTime; + } + + long i = System.nanoTime() / 1000000L; + if(this.lastServerTime != 0L && this.lastServerTicks != 0) { + long j = i - this.lastServerTime; + if(j < 0L) { + this.lastServerTime = i; + j = 0L; + } + + if(j >= 50L) { + this.lastServerTime = i; + int k = integratedserver.func_71259_af(); + int l = k - this.lastServerTicks; + if(l < 0) { + this.lastServerTicks = k; + l = 0; + } + + if(l < 1 && this.serverWaitTime < 100) { + this.serverWaitTime += 2; + } + + if(l > 1 && this.serverWaitTime > 0) { + --this.serverWaitTime; + } + + this.lastServerTicks = k; + } + } else { + this.lastServerTime = i; + this.lastServerTicks = integratedserver.func_71259_af(); + this.avgServerTickDiff = 1.0F; + this.avgServerTimeDiff = 50.0F; + } + } else { + if(this.field_78531_r.field_71462_r instanceof GuiDownloadTerrain) { + Config.sleep(20L); + } + + this.lastServerTime = 0L; + this.lastServerTicks = 0; + } + } + } + } else { + this.lastServerTime = 0L; + this.lastServerTicks = 0; + } + } + + private void frameInit() { + GlErrors.frameStart(); + if(!this.initialized) { + ReflectorResolver.resolve(); + TextureUtils.registerResourceListener(); + if(Config.getBitsOs() == 64 && Config.getBitsJre() == 32) { + Config.setNotify64BitJava(true); + } + + this.initialized = true; + } + + Config.checkDisplayMode(); + World world = this.field_78531_r.field_71441_e; + if(world != null) { + if(Config.getNewRelease() != null) { + String s = "HD_U".replace("HD_U", "HD Ultra").replace("L", "Light"); + String s1 = s + " " + Config.getNewRelease(); + ChatComponentText chatcomponenttext = new ChatComponentText(I18n.func_135052_a("of.message.newVersion", new Object[]{"\u00a7n" + s1 + "\u00a7r"})); + chatcomponenttext.a((new ChatStyle()).func_150241_a(new ClickEvent(Action.OPEN_URL, "https://optifine.net/downloads"))); + this.field_78531_r.field_71456_v.func_146158_b().func_146227_a(chatcomponenttext); + Config.setNewRelease((String)null); + } + + if(Config.isNotify64BitJava()) { + Config.setNotify64BitJava(false); + ChatComponentText chatcomponenttext1 = new ChatComponentText(I18n.func_135052_a("of.message.java64Bit", new Object[0])); + this.field_78531_r.field_71456_v.func_146158_b().func_146227_a(chatcomponenttext1); + } + } + + if(this.field_78531_r.field_71462_r instanceof GuiMainMenu) { + this.updateMainMenu((GuiMainMenu)this.field_78531_r.field_71462_r); + } + + if(this.updatedWorld != world) { + RandomEntities.worldChanged(this.updatedWorld, world); + Config.updateThreadPriorities(); + this.lastServerTime = 0L; + this.lastServerTicks = 0; + this.updatedWorld = world; + } + + if(!this.setFxaaShader(Shaders.configAntialiasingLevel)) { + Shaders.configAntialiasingLevel = 0; + } + + if(this.field_78531_r.field_71462_r != null && this.field_78531_r.field_71462_r.getClass() == GuiChat.class) { + this.field_78531_r.func_147108_a(new GuiChatOF((GuiChat)this.field_78531_r.field_71462_r)); + } + + } + + private void frameFinish() { + if(this.field_78531_r.field_71441_e != null && Config.isShowGlErrors() && TimedEvent.isActive("CheckGlErrorFrameFinish", 10000L)) { + int i = GlStateManager.glGetError(); + if(i != 0 && GlErrors.isEnabled(i)) { + String s = Config.getGlErrorString(i); + ChatComponentText chatcomponenttext = new ChatComponentText(I18n.func_135052_a("of.message.openglError", new Object[]{Integer.valueOf(i), s})); + this.field_78531_r.field_71456_v.func_146158_b().func_146227_a(chatcomponenttext); + } + } + + } + + private void updateMainMenu(GuiMainMenu p_updateMainMenu_1_) { + try { + String s = null; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + int i = calendar.get(5); + int j = calendar.get(2) + 1; + if(i == 8 && j == 4) { + s = "Happy birthday, OptiFine!"; + } + + if(i == 14 && j == 8) { + s = "Happy birthday, sp614x!"; + } + + if(s == null) { + return; + } + + Reflector.setFieldValue(p_updateMainMenu_1_, Reflector.GuiMainMenu_splashText, s); + } catch (Throwable var6) { + ; + } + + } + + public boolean setFxaaShader(int p_setFxaaShader_1_) { + if(!OpenGlHelper.func_148822_b()) { + return false; + } else if(this.field_147707_d != null && this.field_147707_d != this.fxaaShaders[2] && this.field_147707_d != this.fxaaShaders[4]) { + return true; + } else if(p_setFxaaShader_1_ != 2 && p_setFxaaShader_1_ != 4) { + if(this.field_147707_d == null) { + return true; + } else { + this.field_147707_d.func_148021_a(); + this.field_147707_d = null; + return true; + } + } else if(this.field_147707_d != null && this.field_147707_d == this.fxaaShaders[p_setFxaaShader_1_]) { + return true; + } else if(this.field_78531_r.field_71441_e == null) { + return true; + } else { + this.func_175069_a(new ResourceLocation("shaders/post/fxaa_of_" + p_setFxaaShader_1_ + "x.json")); + this.fxaaShaders[p_setFxaaShader_1_] = this.field_147707_d; + return this.field_175083_ad; + } + } + + private void checkLoadVisibleChunks(Entity p_checkLoadVisibleChunks_1_, float p_checkLoadVisibleChunks_2_, ICamera p_checkLoadVisibleChunks_3_, boolean p_checkLoadVisibleChunks_4_) { + int i = 201435902; + if(this.loadVisibleChunks) { + this.loadVisibleChunks = false; + this.loadAllVisibleChunks(p_checkLoadVisibleChunks_1_, (double)p_checkLoadVisibleChunks_2_, p_checkLoadVisibleChunks_3_, p_checkLoadVisibleChunks_4_); + this.field_78531_r.field_71456_v.func_146158_b().func_146242_c(i); + } + + if(Keyboard.isKeyDown(61) && Keyboard.isKeyDown(38)) { + if(this.field_78531_r.field_71462_r != null) { + return; + } + + this.loadVisibleChunks = true; + ChatComponentText chatcomponenttext = new ChatComponentText(I18n.func_135052_a("of.message.loadingVisibleChunks", new Object[0])); + this.field_78531_r.field_71456_v.func_146158_b().func_146234_a(chatcomponenttext, i); + } + + } + + private void loadAllVisibleChunks(Entity p_loadAllVisibleChunks_1_, double p_loadAllVisibleChunks_2_, ICamera p_loadAllVisibleChunks_4_, boolean p_loadAllVisibleChunks_5_) { + int i = this.field_78531_r.field_71474_y.ofChunkUpdates; + boolean flag = this.field_78531_r.field_71474_y.ofLazyChunkLoading; + + try { + this.field_78531_r.field_71474_y.ofChunkUpdates = 1000; + this.field_78531_r.field_71474_y.ofLazyChunkLoading = false; + RenderGlobal renderglobal = Config.getRenderGlobal(); + int j = renderglobal.getCountLoadedChunks(); + long k = System.currentTimeMillis(); + Config.dbg("Loading visible chunks"); + long l = System.currentTimeMillis() + 5000L; + int i1 = 0; + boolean flag1 = false; + + while(true) { + flag1 = false; + + for(int j1 = 0; j1 < 100; ++j1) { + renderglobal.field_147595_R = true; + renderglobal.func_174970_a(p_loadAllVisibleChunks_1_, p_loadAllVisibleChunks_2_, p_loadAllVisibleChunks_4_, this.field_175084_ae++, p_loadAllVisibleChunks_5_); + if(!renderglobal.hasNoChunkUpdates()) { + flag1 = true; + } + + i1 = i1 + renderglobal.getCountChunksToUpdate(); + + while(!renderglobal.hasNoChunkUpdates()) { + renderglobal.func_174967_a(System.nanoTime() + 1000000000L); + } + + i1 = i1 - renderglobal.getCountChunksToUpdate(); + if(!flag1) { + break; + } + } + + if(renderglobal.getCountLoadedChunks() != j) { + flag1 = true; + j = renderglobal.getCountLoadedChunks(); + } + + if(System.currentTimeMillis() > l) { + Config.log("Chunks loaded: " + i1); + l = System.currentTimeMillis() + 5000L; + } + + if(!flag1) { + break; + } + } + + Config.log("Chunks loaded: " + i1); + Config.log("Finished loading visible chunks"); + RenderChunk.field_178592_a = 0; + } finally { + this.field_78531_r.field_71474_y.ofChunkUpdates = i; + this.field_78531_r.field_71474_y.ofLazyChunkLoading = flag; + } + + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EnumFaceDirection.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EnumFaceDirection.java new file mode 100644 index 0000000..58c19a0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/EnumFaceDirection.java @@ -0,0 +1,62 @@ +package net.minecraft.client.renderer; + +import net.minecraft.util.EnumFacing; + +public enum EnumFaceDirection +{ + DOWN(new EnumFaceDirection.VertexInformation[]{new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX)}), + UP(new EnumFaceDirection.VertexInformation[]{new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.NORTH_INDEX)}), + NORTH(new EnumFaceDirection.VertexInformation[]{new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.NORTH_INDEX)}), + SOUTH(new EnumFaceDirection.VertexInformation[]{new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX)}), + WEST(new EnumFaceDirection.VertexInformation[]{new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.WEST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX)}), + EAST(new EnumFaceDirection.VertexInformation[]{new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.SOUTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.DOWN_INDEX, EnumFaceDirection.Constants.NORTH_INDEX), new EnumFaceDirection.VertexInformation(EnumFaceDirection.Constants.EAST_INDEX, EnumFaceDirection.Constants.UP_INDEX, EnumFaceDirection.Constants.NORTH_INDEX)}); + + private static final EnumFaceDirection[] facings = new EnumFaceDirection[6]; + private final EnumFaceDirection.VertexInformation[] vertexInfos; + + public static EnumFaceDirection getFacing(EnumFacing facing) + { + return facings[facing.getIndex()]; + } + + private EnumFaceDirection(EnumFaceDirection.VertexInformation[] vertexInfosIn) + { + this.vertexInfos = vertexInfosIn; + } + + public EnumFaceDirection.VertexInformation getVertexInformation(int index) + { + return this.vertexInfos[index]; + } + + static { + facings[EnumFaceDirection.Constants.DOWN_INDEX] = DOWN; + facings[EnumFaceDirection.Constants.UP_INDEX] = UP; + facings[EnumFaceDirection.Constants.NORTH_INDEX] = NORTH; + facings[EnumFaceDirection.Constants.SOUTH_INDEX] = SOUTH; + facings[EnumFaceDirection.Constants.WEST_INDEX] = WEST; + facings[EnumFaceDirection.Constants.EAST_INDEX] = EAST; + } + + public static final class Constants { + public static final int SOUTH_INDEX = EnumFacing.SOUTH.getIndex(); + public static final int UP_INDEX = EnumFacing.UP.getIndex(); + public static final int EAST_INDEX = EnumFacing.EAST.getIndex(); + public static final int NORTH_INDEX = EnumFacing.NORTH.getIndex(); + public static final int DOWN_INDEX = EnumFacing.DOWN.getIndex(); + public static final int WEST_INDEX = EnumFacing.WEST.getIndex(); + } + + public static class VertexInformation { + public final int xIndex; + public final int yIndex; + public final int zIndex; + + private VertexInformation(int xIndexIn, int yIndexIn, int zIndexIn) + { + this.xIndex = xIndexIn; + this.yIndex = yIndexIn; + this.zIndex = zIndexIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/GLAllocation.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/GLAllocation.java new file mode 100644 index 0000000..2c8af0e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/GLAllocation.java @@ -0,0 +1,59 @@ +package net.minecraft.client.renderer; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +public class GLAllocation +{ + + public static synchronized int generateDisplayLists(int range) + { + int i = GL11.glGenLists(range); + + if (i == 0) + { + int j = GL11.glGetError(); + String s = "No error code reported"; + + if (j != 0) + { + s = GLU.gluErrorString(j); + } + + throw new IllegalStateException("glGenLists returned an ID of 0 for a count of " + range + ", GL error (" + j + "): " + s); + } + else + { + return i; + } + } + + public static synchronized void deleteDisplayLists(int list, int range) + { + GL11.glDeleteLists(list, range); + } + + public static synchronized void deleteDisplayLists(int list) + { + GL11.glDeleteLists(list, 1); + } + + public static synchronized ByteBuffer createDirectByteBuffer(int capacity) + { + return ByteBuffer.allocateDirect(capacity).order(ByteOrder.nativeOrder()); + } + + public static IntBuffer createDirectIntBuffer(int capacity) + { + return createDirectByteBuffer(capacity << 2).asIntBuffer(); + } + + public static FloatBuffer createDirectFloatBuffer(int capacity) + { + return createDirectByteBuffer(capacity << 2).asFloatBuffer(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/GlStateManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/GlStateManager.java new file mode 100644 index 0000000..d42712c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/GlStateManager.java @@ -0,0 +1,1271 @@ +package net.minecraft.client.renderer; + +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import net.minecraft.src.Config; +import net.optifine.SmartAnimations; +import net.optifine.render.GlAlphaState; +import net.optifine.render.GlBlendState; +import net.optifine.shaders.Shaders; +import net.optifine.util.LockCounter; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL14; + +public class GlStateManager +{ + private static GlStateManager.AlphaState alphaState = new GlStateManager.AlphaState(); + private static GlStateManager.BooleanState lightingState = new GlStateManager.BooleanState(2896); + private static GlStateManager.BooleanState[] lightState = new GlStateManager.BooleanState[8]; + private static GlStateManager.ColorMaterialState colorMaterialState = new GlStateManager.ColorMaterialState(); + private static GlStateManager.BlendState blendState = new GlStateManager.BlendState(); + private static GlStateManager.DepthState depthState = new GlStateManager.DepthState(); + private static GlStateManager.FogState fogState = new GlStateManager.FogState(); + private static GlStateManager.CullState cullState = new GlStateManager.CullState(); + private static GlStateManager.PolygonOffsetState polygonOffsetState = new GlStateManager.PolygonOffsetState(); + private static GlStateManager.ColorLogicState colorLogicState = new GlStateManager.ColorLogicState(); + private static GlStateManager.TexGenState texGenState = new GlStateManager.TexGenState(); + private static GlStateManager.ClearState clearState = new GlStateManager.ClearState(); + private static GlStateManager.StencilState stencilState = new GlStateManager.StencilState(); + private static GlStateManager.BooleanState normalizeState = new GlStateManager.BooleanState(2977); + private static int activeTextureUnit = 0; + private static GlStateManager.TextureState[] textureState = new GlStateManager.TextureState[32]; + private static int activeShadeModel = 7425; + private static GlStateManager.BooleanState rescaleNormalState = new GlStateManager.BooleanState(32826); + private static GlStateManager.ColorMask colorMaskState = new GlStateManager.ColorMask(); + private static GlStateManager.Color colorState = new GlStateManager.Color(); + public static boolean clearEnabled = true; + private static LockCounter alphaLock = new LockCounter(); + private static GlAlphaState alphaLockState = new GlAlphaState(); + private static LockCounter blendLock = new LockCounter(); + private static GlBlendState blendLockState = new GlBlendState(); + private static boolean creatingDisplayList = false; + + public static void pushAttrib() + { + GL11.glPushAttrib(8256); + } + + public static void popAttrib() + { + GL11.glPopAttrib(); + } + + public static void disableAlpha() + { + if (alphaLock.isLocked()) + { + alphaLockState.setDisabled(); + } + else + { + alphaState.alphaTest.setDisabled(); + } + } + + public static void enableAlpha() + { + if (alphaLock.isLocked()) + { + alphaLockState.setEnabled(); + } + else + { + alphaState.alphaTest.setEnabled(); + } + } + + public static void alphaFunc(int func, float ref) + { + if (alphaLock.isLocked()) + { + alphaLockState.setFuncRef(func, ref); + } + else + { + if (func != alphaState.func || ref != alphaState.ref) + { + alphaState.func = func; + alphaState.ref = ref; + GL11.glAlphaFunc(func, ref); + } + } + } + + public static void enableLighting() + { + lightingState.setEnabled(); + } + + public static void disableLighting() + { + lightingState.setDisabled(); + } + + public static void enableLight(int light) + { + lightState[light].setEnabled(); + } + + public static void disableLight(int light) + { + lightState[light].setDisabled(); + } + + public static void enableColorMaterial() + { + colorMaterialState.colorMaterial.setEnabled(); + } + + public static void disableColorMaterial() + { + colorMaterialState.colorMaterial.setDisabled(); + } + + public static void colorMaterial(int face, int mode) + { + if (face != colorMaterialState.face || mode != colorMaterialState.mode) + { + colorMaterialState.face = face; + colorMaterialState.mode = mode; + GL11.glColorMaterial(face, mode); + } + } + + public static void disableDepth() + { + depthState.depthTest.setDisabled(); + } + + public static void enableDepth() + { + depthState.depthTest.setEnabled(); + } + + public static void depthFunc(int depthFunc) + { + if (depthFunc != depthState.depthFunc) + { + depthState.depthFunc = depthFunc; + GL11.glDepthFunc(depthFunc); + } + } + + public static void depthMask(boolean flagIn) + { + if (flagIn != depthState.maskEnabled) + { + depthState.maskEnabled = flagIn; + GL11.glDepthMask(flagIn); + } + } + + public static void disableBlend() + { + if (blendLock.isLocked()) + { + blendLockState.setDisabled(); + } + else + { + blendState.blend.setDisabled(); + } + } + + public static void enableBlend() + { + if (blendLock.isLocked()) + { + blendLockState.setEnabled(); + } + else + { + blendState.blend.setEnabled(); + } + } + + public static void blendFunc(int srcFactor, int dstFactor) + { + if (blendLock.isLocked()) + { + blendLockState.setFactors(srcFactor, dstFactor); + } + else + { + if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor || srcFactor != blendState.srcFactorAlpha || dstFactor != blendState.dstFactorAlpha) + { + blendState.srcFactor = srcFactor; + blendState.dstFactor = dstFactor; + blendState.srcFactorAlpha = srcFactor; + blendState.dstFactorAlpha = dstFactor; + + if (Config.isShaders()) + { + Shaders.uniform_blendFunc.setValue(srcFactor, dstFactor, srcFactor, dstFactor); + } + + GL11.glBlendFunc(srcFactor, dstFactor); + } + } + } + + public static void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) + { + if (blendLock.isLocked()) + { + blendLockState.setFactors(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha); + } + else + { + if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor || srcFactorAlpha != blendState.srcFactorAlpha || dstFactorAlpha != blendState.dstFactorAlpha) + { + blendState.srcFactor = srcFactor; + blendState.dstFactor = dstFactor; + blendState.srcFactorAlpha = srcFactorAlpha; + blendState.dstFactorAlpha = dstFactorAlpha; + + if (Config.isShaders()) + { + Shaders.uniform_blendFunc.setValue(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha); + } + + OpenGlHelper.glBlendFunc(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha); + } + } + } + + public static void enableFog() + { + fogState.fog.setEnabled(); + } + + public static void disableFog() + { + fogState.fog.setDisabled(); + } + + public static void setFog(int param) + { + if (param != fogState.mode) + { + fogState.mode = param; + GL11.glFogi(GL11.GL_FOG_MODE, param); + + if (Config.isShaders()) + { + Shaders.setFogMode(param); + } + } + } + + public static void setFogDensity(float param) + { + if (param < 0.0F) + { + param = 0.0F; + } + + if (param != fogState.density) + { + fogState.density = param; + GL11.glFogf(GL11.GL_FOG_DENSITY, param); + + if (Config.isShaders()) + { + Shaders.setFogDensity(param); + } + } + } + + public static void setFogStart(float param) + { + if (param != fogState.start) + { + fogState.start = param; + GL11.glFogf(GL11.GL_FOG_START, param); + } + } + + public static void setFogEnd(float param) + { + if (param != fogState.end) + { + fogState.end = param; + GL11.glFogf(GL11.GL_FOG_END, param); + } + } + + public static void glFog(int p_glFog_0_, FloatBuffer p_glFog_1_) + { + GL11.glFog(p_glFog_0_, p_glFog_1_); + } + + public static void glFogi(int p_glFogi_0_, int p_glFogi_1_) + { + GL11.glFogi(p_glFogi_0_, p_glFogi_1_); + } + + public static void enableCull() + { + cullState.cullFace.setEnabled(); + } + + public static void disableCull() + { + cullState.cullFace.setDisabled(); + } + + public static void cullFace(int mode) + { + if (mode != cullState.mode) + { + cullState.mode = mode; + GL11.glCullFace(mode); + } + } + + public static void enablePolygonOffset() + { + polygonOffsetState.polygonOffsetFill.setEnabled(); + } + + public static void disablePolygonOffset() + { + polygonOffsetState.polygonOffsetFill.setDisabled(); + } + + public static void doPolygonOffset(float factor, float units) + { + if (factor != polygonOffsetState.factor || units != polygonOffsetState.units) + { + polygonOffsetState.factor = factor; + polygonOffsetState.units = units; + GL11.glPolygonOffset(factor, units); + } + } + + public static void enableColorLogic() + { + colorLogicState.colorLogicOp.setEnabled(); + } + + public static void disableColorLogic() + { + colorLogicState.colorLogicOp.setDisabled(); + } + + public static void colorLogicOp(int opcode) + { + if (opcode != colorLogicState.opcode) + { + colorLogicState.opcode = opcode; + GL11.glLogicOp(opcode); + } + } + + public static void enableTexGenCoord(GlStateManager.TexGen p_179087_0_) + { + texGenCoord(p_179087_0_).textureGen.setEnabled(); + } + + public static void disableTexGenCoord(GlStateManager.TexGen p_179100_0_) + { + texGenCoord(p_179100_0_).textureGen.setDisabled(); + } + + public static void texGen(GlStateManager.TexGen texGen, int param) + { + GlStateManager.TexGenCoord glstatemanager$texgencoord = texGenCoord(texGen); + + if (param != glstatemanager$texgencoord.param) + { + glstatemanager$texgencoord.param = param; + GL11.glTexGeni(glstatemanager$texgencoord.coord, GL11.GL_TEXTURE_GEN_MODE, param); + } + } + + public static void texGen(GlStateManager.TexGen p_179105_0_, int pname, FloatBuffer params) + { + GL11.glTexGen(texGenCoord(p_179105_0_).coord, pname, params); + } + + private static GlStateManager.TexGenCoord texGenCoord(GlStateManager.TexGen p_179125_0_) + { + switch (p_179125_0_) + { + case S: + return texGenState.s; + + case T: + return texGenState.t; + + case R: + return texGenState.r; + + case Q: + return texGenState.q; + + default: + return texGenState.s; + } + } + + public static void setActiveTexture(int texture) + { + if (activeTextureUnit != texture - OpenGlHelper.defaultTexUnit) + { + activeTextureUnit = texture - OpenGlHelper.defaultTexUnit; + OpenGlHelper.setActiveTexture(texture); + } + } + + public static void enableTexture2D() + { + textureState[activeTextureUnit].texture2DState.setEnabled(); + } + + public static void disableTexture2D() + { + textureState[activeTextureUnit].texture2DState.setDisabled(); + } + + public static int generateTexture() + { + return GL11.glGenTextures(); + } + + public static void deleteTexture(int texture) + { + if (texture != 0) + { + GL11.glDeleteTextures(texture); + + for (GlStateManager.TextureState glstatemanager$texturestate : textureState) + { + if (glstatemanager$texturestate.textureName == texture) + { + glstatemanager$texturestate.textureName = 0; + } + } + } + } + + public static void bindTexture(int texture) + { + if (texture != textureState[activeTextureUnit].textureName) + { + textureState[activeTextureUnit].textureName = texture; + GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); + + if (SmartAnimations.isActive()) + { + SmartAnimations.textureRendered(texture); + } + } + } + + public static void enableNormalize() + { + normalizeState.setEnabled(); + } + + public static void disableNormalize() + { + normalizeState.setDisabled(); + } + + public static void shadeModel(int mode) + { + if (mode != activeShadeModel) + { + activeShadeModel = mode; + GL11.glShadeModel(mode); + } + } + + public static void enableRescaleNormal() + { + rescaleNormalState.setEnabled(); + } + + public static void disableRescaleNormal() + { + rescaleNormalState.setDisabled(); + } + + public static void viewport(int x, int y, int width, int height) + { + GL11.glViewport(x, y, width, height); + } + + public static void colorMask(boolean red, boolean green, boolean blue, boolean alpha) + { + if (red != colorMaskState.red || green != colorMaskState.green || blue != colorMaskState.blue || alpha != colorMaskState.alpha) + { + colorMaskState.red = red; + colorMaskState.green = green; + colorMaskState.blue = blue; + colorMaskState.alpha = alpha; + GL11.glColorMask(red, green, blue, alpha); + } + } + + public static void clearDepth(double depth) + { + if (depth != clearState.depth) + { + clearState.depth = depth; + GL11.glClearDepth(depth); + } + } + + public static void clearColor(float red, float green, float blue, float alpha) + { + if (red != clearState.color.red || green != clearState.color.green || blue != clearState.color.blue || alpha != clearState.color.alpha) + { + clearState.color.red = red; + clearState.color.green = green; + clearState.color.blue = blue; + clearState.color.alpha = alpha; + GL11.glClearColor(red, green, blue, alpha); + } + } + + public static void clear(int mask) + { + if (clearEnabled) + { + GL11.glClear(mask); + } + } + + public static void matrixMode(int mode) + { + GL11.glMatrixMode(mode); + } + + public static void loadIdentity() + { + GL11.glLoadIdentity(); + } + + public static void pushMatrix() + { + GL11.glPushMatrix(); + } + + public static void popMatrix() + { + GL11.glPopMatrix(); + } + + public static void getFloat(int pname, FloatBuffer params) + { + GL11.glGetFloat(pname, params); + } + + public static void ortho(double left, double right, double bottom, double top, double zNear, double zFar) + { + GL11.glOrtho(left, right, bottom, top, zNear, zFar); + } + + public static void rotate(float angle, float x, float y, float z) + { + GL11.glRotatef(angle, x, y, z); + } + + public static void scale(float x, float y, float z) + { + GL11.glScalef(x, y, z); + } + + public static void scale(double x, double y, double z) + { + GL11.glScaled(x, y, z); + } + + public static void translate(float x, float y, float z) + { + GL11.glTranslatef(x, y, z); + } + + public static void translate(double x, double y, double z) + { + GL11.glTranslated(x, y, z); + } + + public static void multMatrix(FloatBuffer matrix) + { + GL11.glMultMatrix(matrix); + } + + public static void color(float colorRed, float colorGreen, float colorBlue, float colorAlpha) + { + if (colorRed != colorState.red || colorGreen != colorState.green || colorBlue != colorState.blue || colorAlpha != colorState.alpha) + { + colorState.red = colorRed; + colorState.green = colorGreen; + colorState.blue = colorBlue; + colorState.alpha = colorAlpha; + GL11.glColor4f(colorRed, colorGreen, colorBlue, colorAlpha); + } + } + + public static void color(float colorRed, float colorGreen, float colorBlue) + { + color(colorRed, colorGreen, colorBlue, 1.0F); + } + + public static void resetColor() + { + colorState.red = colorState.green = colorState.blue = colorState.alpha = -1.0F; + } + + public static void glNormalPointer(int p_glNormalPointer_0_, int p_glNormalPointer_1_, ByteBuffer p_glNormalPointer_2_) + { + GL11.glNormalPointer(p_glNormalPointer_0_, p_glNormalPointer_1_, p_glNormalPointer_2_); + } + + public static void glTexCoordPointer(int p_glTexCoordPointer_0_, int p_glTexCoordPointer_1_, int p_glTexCoordPointer_2_, int p_glTexCoordPointer_3_) + { + GL11.glTexCoordPointer(p_glTexCoordPointer_0_, p_glTexCoordPointer_1_, p_glTexCoordPointer_2_, (long)p_glTexCoordPointer_3_); + } + + public static void glTexCoordPointer(int p_glTexCoordPointer_0_, int p_glTexCoordPointer_1_, int p_glTexCoordPointer_2_, ByteBuffer p_glTexCoordPointer_3_) + { + GL11.glTexCoordPointer(p_glTexCoordPointer_0_, p_glTexCoordPointer_1_, p_glTexCoordPointer_2_, p_glTexCoordPointer_3_); + } + + public static void glVertexPointer(int p_glVertexPointer_0_, int p_glVertexPointer_1_, int p_glVertexPointer_2_, int p_glVertexPointer_3_) + { + GL11.glVertexPointer(p_glVertexPointer_0_, p_glVertexPointer_1_, p_glVertexPointer_2_, (long)p_glVertexPointer_3_); + } + + public static void glVertexPointer(int p_glVertexPointer_0_, int p_glVertexPointer_1_, int p_glVertexPointer_2_, ByteBuffer p_glVertexPointer_3_) + { + GL11.glVertexPointer(p_glVertexPointer_0_, p_glVertexPointer_1_, p_glVertexPointer_2_, p_glVertexPointer_3_); + } + + public static void glColorPointer(int p_glColorPointer_0_, int p_glColorPointer_1_, int p_glColorPointer_2_, int p_glColorPointer_3_) + { + GL11.glColorPointer(p_glColorPointer_0_, p_glColorPointer_1_, p_glColorPointer_2_, (long)p_glColorPointer_3_); + } + + public static void glColorPointer(int p_glColorPointer_0_, int p_glColorPointer_1_, int p_glColorPointer_2_, ByteBuffer p_glColorPointer_3_) + { + GL11.glColorPointer(p_glColorPointer_0_, p_glColorPointer_1_, p_glColorPointer_2_, p_glColorPointer_3_); + } + + public static void glDisableClientState(int p_glDisableClientState_0_) + { + GL11.glDisableClientState(p_glDisableClientState_0_); + } + + public static void glEnableClientState(int p_glEnableClientState_0_) + { + GL11.glEnableClientState(p_glEnableClientState_0_); + } + + public static void glBegin(int p_glBegin_0_) + { + GL11.glBegin(p_glBegin_0_); + } + + public static void glEnd() + { + GL11.glEnd(); + } + + public static void glDrawArrays(int p_glDrawArrays_0_, int p_glDrawArrays_1_, int p_glDrawArrays_2_) + { + GL11.glDrawArrays(p_glDrawArrays_0_, p_glDrawArrays_1_, p_glDrawArrays_2_); + + if (Config.isShaders() && !creatingDisplayList) + { + int i = Shaders.activeProgram.getCountInstances(); + + if (i > 1) + { + for (int j = 1; j < i; ++j) + { + Shaders.uniform_instanceId.setValue(j); + GL11.glDrawArrays(p_glDrawArrays_0_, p_glDrawArrays_1_, p_glDrawArrays_2_); + } + + Shaders.uniform_instanceId.setValue(0); + } + } + } + + public static void callList(int list) + { + GL11.glCallList(list); + + if (Config.isShaders() && !creatingDisplayList) + { + int i = Shaders.activeProgram.getCountInstances(); + + if (i > 1) + { + for (int j = 1; j < i; ++j) + { + Shaders.uniform_instanceId.setValue(j); + GL11.glCallList(list); + } + + Shaders.uniform_instanceId.setValue(0); + } + } + } + + public static void callLists(IntBuffer p_callLists_0_) + { + GL11.glCallLists(p_callLists_0_); + + if (Config.isShaders() && !creatingDisplayList) + { + int i = Shaders.activeProgram.getCountInstances(); + + if (i > 1) + { + for (int j = 1; j < i; ++j) + { + Shaders.uniform_instanceId.setValue(j); + GL11.glCallLists(p_callLists_0_); + } + + Shaders.uniform_instanceId.setValue(0); + } + } + } + + public static void glDeleteLists(int p_glDeleteLists_0_, int p_glDeleteLists_1_) + { + GL11.glDeleteLists(p_glDeleteLists_0_, p_glDeleteLists_1_); + } + + public static void glNewList(int p_glNewList_0_, int p_glNewList_1_) + { + GL11.glNewList(p_glNewList_0_, p_glNewList_1_); + creatingDisplayList = true; + } + + public static void glEndList() + { + GL11.glEndList(); + creatingDisplayList = false; + } + + public static int glGetError() + { + return GL11.glGetError(); + } + + public static void glTexImage2D(int p_glTexImage2D_0_, int p_glTexImage2D_1_, int p_glTexImage2D_2_, int p_glTexImage2D_3_, int p_glTexImage2D_4_, int p_glTexImage2D_5_, int p_glTexImage2D_6_, int p_glTexImage2D_7_, IntBuffer p_glTexImage2D_8_) + { + GL11.glTexImage2D(p_glTexImage2D_0_, p_glTexImage2D_1_, p_glTexImage2D_2_, p_glTexImage2D_3_, p_glTexImage2D_4_, p_glTexImage2D_5_, p_glTexImage2D_6_, p_glTexImage2D_7_, p_glTexImage2D_8_); + } + + public static void glTexSubImage2D(int p_glTexSubImage2D_0_, int p_glTexSubImage2D_1_, int p_glTexSubImage2D_2_, int p_glTexSubImage2D_3_, int p_glTexSubImage2D_4_, int p_glTexSubImage2D_5_, int p_glTexSubImage2D_6_, int p_glTexSubImage2D_7_, IntBuffer p_glTexSubImage2D_8_) + { + GL11.glTexSubImage2D(p_glTexSubImage2D_0_, p_glTexSubImage2D_1_, p_glTexSubImage2D_2_, p_glTexSubImage2D_3_, p_glTexSubImage2D_4_, p_glTexSubImage2D_5_, p_glTexSubImage2D_6_, p_glTexSubImage2D_7_, p_glTexSubImage2D_8_); + } + + public static void glCopyTexSubImage2D(int p_glCopyTexSubImage2D_0_, int p_glCopyTexSubImage2D_1_, int p_glCopyTexSubImage2D_2_, int p_glCopyTexSubImage2D_3_, int p_glCopyTexSubImage2D_4_, int p_glCopyTexSubImage2D_5_, int p_glCopyTexSubImage2D_6_, int p_glCopyTexSubImage2D_7_) + { + GL11.glCopyTexSubImage2D(p_glCopyTexSubImage2D_0_, p_glCopyTexSubImage2D_1_, p_glCopyTexSubImage2D_2_, p_glCopyTexSubImage2D_3_, p_glCopyTexSubImage2D_4_, p_glCopyTexSubImage2D_5_, p_glCopyTexSubImage2D_6_, p_glCopyTexSubImage2D_7_); + } + + public static void glGetTexImage(int p_glGetTexImage_0_, int p_glGetTexImage_1_, int p_glGetTexImage_2_, int p_glGetTexImage_3_, IntBuffer p_glGetTexImage_4_) + { + GL11.glGetTexImage(p_glGetTexImage_0_, p_glGetTexImage_1_, p_glGetTexImage_2_, p_glGetTexImage_3_, p_glGetTexImage_4_); + } + + public static void glTexParameterf(int p_glTexParameterf_0_, int p_glTexParameterf_1_, float p_glTexParameterf_2_) + { + GL11.glTexParameterf(p_glTexParameterf_0_, p_glTexParameterf_1_, p_glTexParameterf_2_); + } + + public static void glTexParameteri(int p_glTexParameteri_0_, int p_glTexParameteri_1_, int p_glTexParameteri_2_) + { + GL11.glTexParameteri(p_glTexParameteri_0_, p_glTexParameteri_1_, p_glTexParameteri_2_); + } + + public static int glGetTexLevelParameteri(int p_glGetTexLevelParameteri_0_, int p_glGetTexLevelParameteri_1_, int p_glGetTexLevelParameteri_2_) + { + return GL11.glGetTexLevelParameteri(p_glGetTexLevelParameteri_0_, p_glGetTexLevelParameteri_1_, p_glGetTexLevelParameteri_2_); + } + + public static int getActiveTextureUnit() + { + return OpenGlHelper.defaultTexUnit + activeTextureUnit; + } + + public static void bindCurrentTexture() + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureState[activeTextureUnit].textureName); + } + + public static int getBoundTexture() + { + return textureState[activeTextureUnit].textureName; + } + + public static void checkBoundTexture() + { + if (Config.isMinecraftThread()) + { + int i = GL11.glGetInteger(GL13.GL_ACTIVE_TEXTURE); + int j = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D); + int k = getActiveTextureUnit(); + int l = getBoundTexture(); + + if (l > 0) + { + if (i != k || j != l) + { + Config.dbg("checkTexture: act: " + k + ", glAct: " + i + ", tex: " + l + ", glTex: " + j); + } + } + } + } + + public static void deleteTextures(IntBuffer p_deleteTextures_0_) + { + p_deleteTextures_0_.rewind(); + + while (p_deleteTextures_0_.position() < p_deleteTextures_0_.limit()) + { + int i = p_deleteTextures_0_.get(); + deleteTexture(i); + } + + p_deleteTextures_0_.rewind(); + } + + public static boolean isFogEnabled() + { + return fogState.fog.currentState; + } + + public static void setFogEnabled(boolean p_setFogEnabled_0_) + { + fogState.fog.setState(p_setFogEnabled_0_); + } + + public static void lockAlpha(GlAlphaState p_lockAlpha_0_) + { + if (!alphaLock.isLocked()) + { + getAlphaState(alphaLockState); + setAlphaState(p_lockAlpha_0_); + alphaLock.lock(); + } + } + + public static void unlockAlpha() + { + if (alphaLock.unlock()) + { + setAlphaState(alphaLockState); + } + } + + public static void getAlphaState(GlAlphaState p_getAlphaState_0_) + { + if (alphaLock.isLocked()) + { + p_getAlphaState_0_.setState(alphaLockState); + } + else + { + p_getAlphaState_0_.setState(alphaState.alphaTest.currentState, alphaState.func, alphaState.ref); + } + } + + public static void setAlphaState(GlAlphaState p_setAlphaState_0_) + { + if (alphaLock.isLocked()) + { + alphaLockState.setState(p_setAlphaState_0_); + } + else + { + alphaState.alphaTest.setState(p_setAlphaState_0_.isEnabled()); + alphaFunc(p_setAlphaState_0_.getFunc(), p_setAlphaState_0_.getRef()); + } + } + + public static void lockBlend(GlBlendState p_lockBlend_0_) + { + if (!blendLock.isLocked()) + { + getBlendState(blendLockState); + setBlendState(p_lockBlend_0_); + blendLock.lock(); + } + } + + public static void unlockBlend() + { + if (blendLock.unlock()) + { + setBlendState(blendLockState); + } + } + + public static void getBlendState(GlBlendState p_getBlendState_0_) + { + if (blendLock.isLocked()) + { + p_getBlendState_0_.setState(blendLockState); + } + else + { + p_getBlendState_0_.setState(blendState.blend.currentState, blendState.srcFactor, blendState.dstFactor, blendState.srcFactorAlpha, blendState.dstFactorAlpha); + } + } + + public static void setBlendState(GlBlendState p_setBlendState_0_) + { + if (blendLock.isLocked()) + { + blendLockState.setState(p_setBlendState_0_); + } + else + { + blendState.blend.setState(p_setBlendState_0_.isEnabled()); + + if (!p_setBlendState_0_.isSeparate()) + { + blendFunc(p_setBlendState_0_.getSrcFactor(), p_setBlendState_0_.getDstFactor()); + } + else + { + tryBlendFuncSeparate(p_setBlendState_0_.getSrcFactor(), p_setBlendState_0_.getDstFactor(), p_setBlendState_0_.getSrcFactorAlpha(), p_setBlendState_0_.getDstFactorAlpha()); + } + } + } + + public static void glMultiDrawArrays(int p_glMultiDrawArrays_0_, IntBuffer p_glMultiDrawArrays_1_, IntBuffer p_glMultiDrawArrays_2_) + { + GL14.glMultiDrawArrays(p_glMultiDrawArrays_0_, p_glMultiDrawArrays_1_, p_glMultiDrawArrays_2_); + + if (Config.isShaders() && !creatingDisplayList) + { + int i = Shaders.activeProgram.getCountInstances(); + + if (i > 1) + { + for (int j = 1; j < i; ++j) + { + Shaders.uniform_instanceId.setValue(j); + GL14.glMultiDrawArrays(p_glMultiDrawArrays_0_, p_glMultiDrawArrays_1_, p_glMultiDrawArrays_2_); + } + + Shaders.uniform_instanceId.setValue(0); + } + } + } + + static + { + for (int i = 0; i < 8; ++i) + { + lightState[i] = new GlStateManager.BooleanState(16384 + i); + } + + for (int j = 0; j < textureState.length; ++j) + { + textureState[j] = new GlStateManager.TextureState(); + } + } + + static class AlphaState + { + public GlStateManager.BooleanState alphaTest; + public int func; + public float ref; + + private AlphaState() + { + this.alphaTest = new GlStateManager.BooleanState(3008); + this.func = 519; + this.ref = -1.0F; + } + } + + static class BlendState + { + public GlStateManager.BooleanState blend; + public int srcFactor; + public int dstFactor; + public int srcFactorAlpha; + public int dstFactorAlpha; + + private BlendState() + { + this.blend = new GlStateManager.BooleanState(3042); + this.srcFactor = 1; + this.dstFactor = 0; + this.srcFactorAlpha = 1; + this.dstFactorAlpha = 0; + } + } + + static class BooleanState + { + private final int capability; + private boolean currentState = false; + + public BooleanState(int capabilityIn) + { + this.capability = capabilityIn; + } + + public void setDisabled() + { + this.setState(false); + } + + public void setEnabled() + { + this.setState(true); + } + + public void setState(boolean state) + { + if (state != this.currentState) + { + this.currentState = state; + + if (state) + { + GL11.glEnable(this.capability); + } + else + { + GL11.glDisable(this.capability); + } + } + } + } + + static class ClearState + { + public double depth; + public GlStateManager.Color color; + public int field_179204_c; + + private ClearState() + { + this.depth = 1.0D; + this.color = new GlStateManager.Color(0.0F, 0.0F, 0.0F, 0.0F); + this.field_179204_c = 0; + } + } + + static class Color + { + public float red = 1.0F; + public float green = 1.0F; + public float blue = 1.0F; + public float alpha = 1.0F; + + public Color() + { + } + + public Color(float redIn, float greenIn, float blueIn, float alphaIn) + { + this.red = redIn; + this.green = greenIn; + this.blue = blueIn; + this.alpha = alphaIn; + } + } + + static class ColorLogicState + { + public GlStateManager.BooleanState colorLogicOp; + public int opcode; + + private ColorLogicState() + { + this.colorLogicOp = new GlStateManager.BooleanState(3058); + this.opcode = 5379; + } + } + + static class ColorMask + { + public boolean red; + public boolean green; + public boolean blue; + public boolean alpha; + + private ColorMask() + { + this.red = true; + this.green = true; + this.blue = true; + this.alpha = true; + } + } + + static class ColorMaterialState + { + public GlStateManager.BooleanState colorMaterial; + public int face; + public int mode; + + private ColorMaterialState() + { + this.colorMaterial = new GlStateManager.BooleanState(2903); + this.face = 1032; + this.mode = 5634; + } + } + + static class CullState + { + public GlStateManager.BooleanState cullFace; + public int mode; + + private CullState() + { + this.cullFace = new GlStateManager.BooleanState(2884); + this.mode = 1029; + } + } + + static class DepthState + { + public GlStateManager.BooleanState depthTest; + public boolean maskEnabled; + public int depthFunc; + + private DepthState() + { + this.depthTest = new GlStateManager.BooleanState(2929); + this.maskEnabled = true; + this.depthFunc = 513; + } + } + + static class FogState + { + public GlStateManager.BooleanState fog; + public int mode; + public float density; + public float start; + public float end; + + private FogState() + { + this.fog = new GlStateManager.BooleanState(2912); + this.mode = 2048; + this.density = 1.0F; + this.start = 0.0F; + this.end = 1.0F; + } + } + + static class PolygonOffsetState + { + public GlStateManager.BooleanState polygonOffsetFill; + public GlStateManager.BooleanState polygonOffsetLine; + public float factor; + public float units; + + private PolygonOffsetState() + { + this.polygonOffsetFill = new GlStateManager.BooleanState(32823); + this.polygonOffsetLine = new GlStateManager.BooleanState(10754); + this.factor = 0.0F; + this.units = 0.0F; + } + } + + static class StencilFunc + { + public int field_179081_a; + public int field_179079_b; + public int field_179080_c; + + private StencilFunc() + { + this.field_179081_a = 519; + this.field_179079_b = 0; + this.field_179080_c = -1; + } + } + + static class StencilState + { + public GlStateManager.StencilFunc field_179078_a; + public int field_179076_b; + public int field_179077_c; + public int field_179074_d; + public int field_179075_e; + + private StencilState() + { + this.field_179078_a = new GlStateManager.StencilFunc(); + this.field_179076_b = -1; + this.field_179077_c = 7680; + this.field_179074_d = 7680; + this.field_179075_e = 7680; + } + } + + public static enum TexGen + { + S, + T, + R, + Q; + } + + static class TexGenCoord + { + public GlStateManager.BooleanState textureGen; + public int coord; + public int param = -1; + + public TexGenCoord(int p_i46254_1_, int p_i46254_2_) + { + this.coord = p_i46254_1_; + this.textureGen = new GlStateManager.BooleanState(p_i46254_2_); + } + } + + static class TexGenState + { + public GlStateManager.TexGenCoord s; + public GlStateManager.TexGenCoord t; + public GlStateManager.TexGenCoord r; + public GlStateManager.TexGenCoord q; + + private TexGenState() + { + this.s = new GlStateManager.TexGenCoord(8192, 3168); + this.t = new GlStateManager.TexGenCoord(8193, 3169); + this.r = new GlStateManager.TexGenCoord(8194, 3170); + this.q = new GlStateManager.TexGenCoord(8195, 3171); + } + } + + static class TextureState + { + public GlStateManager.BooleanState texture2DState; + public int textureName; + + private TextureState() + { + this.texture2DState = new GlStateManager.BooleanState(3553); + this.textureName = 0; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/IImageBuffer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/IImageBuffer.java new file mode 100644 index 0000000..4f62307 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/IImageBuffer.java @@ -0,0 +1,10 @@ +package net.minecraft.client.renderer; + +import java.awt.image.BufferedImage; + +public interface IImageBuffer +{ + BufferedImage parseUserSkin(BufferedImage image); + + void skinAvailable(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java new file mode 100644 index 0000000..62cc480 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java @@ -0,0 +1,115 @@ +package net.minecraft.client.renderer; + +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferInt; +import java.awt.image.ImageObserver; + +public class ImageBufferDownload implements IImageBuffer +{ + private int[] imageData; + private int imageWidth; + private int imageHeight; + + public BufferedImage parseUserSkin(BufferedImage image) + { + if (image == null) + { + return null; + } + else + { + this.imageWidth = 64; + this.imageHeight = 64; + int i = image.getWidth(); + int j = image.getHeight(); + int k; + + for (k = 1; this.imageWidth < i || this.imageHeight < j; k *= 2) + { + this.imageWidth *= 2; + this.imageHeight *= 2; + } + + BufferedImage bufferedimage = new BufferedImage(this.imageWidth, this.imageHeight, 2); + Graphics graphics = bufferedimage.getGraphics(); + graphics.drawImage(image, 0, 0, (ImageObserver)null); + + if (image.getHeight() == 32 * k) + { + graphics.drawImage(bufferedimage, 24 * k, 48 * k, 20 * k, 52 * k, 4 * k, 16 * k, 8 * k, 20 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 28 * k, 48 * k, 24 * k, 52 * k, 8 * k, 16 * k, 12 * k, 20 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 20 * k, 52 * k, 16 * k, 64 * k, 8 * k, 20 * k, 12 * k, 32 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 24 * k, 52 * k, 20 * k, 64 * k, 4 * k, 20 * k, 8 * k, 32 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 28 * k, 52 * k, 24 * k, 64 * k, 0 * k, 20 * k, 4 * k, 32 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 32 * k, 52 * k, 28 * k, 64 * k, 12 * k, 20 * k, 16 * k, 32 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 40 * k, 48 * k, 36 * k, 52 * k, 44 * k, 16 * k, 48 * k, 20 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 44 * k, 48 * k, 40 * k, 52 * k, 48 * k, 16 * k, 52 * k, 20 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 36 * k, 52 * k, 32 * k, 64 * k, 48 * k, 20 * k, 52 * k, 32 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 40 * k, 52 * k, 36 * k, 64 * k, 44 * k, 20 * k, 48 * k, 32 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 44 * k, 52 * k, 40 * k, 64 * k, 40 * k, 20 * k, 44 * k, 32 * k, (ImageObserver)null); + graphics.drawImage(bufferedimage, 48 * k, 52 * k, 44 * k, 64 * k, 52 * k, 20 * k, 56 * k, 32 * k, (ImageObserver)null); + } + + graphics.dispose(); + this.imageData = ((DataBufferInt)bufferedimage.getRaster().getDataBuffer()).getData(); + this.setAreaOpaque(0 * k, 0 * k, 32 * k, 16 * k); + this.setAreaTransparent(32 * k, 0 * k, 64 * k, 32 * k); + this.setAreaOpaque(0 * k, 16 * k, 64 * k, 32 * k); + this.setAreaTransparent(0 * k, 32 * k, 16 * k, 48 * k); + this.setAreaTransparent(16 * k, 32 * k, 40 * k, 48 * k); + this.setAreaTransparent(40 * k, 32 * k, 56 * k, 48 * k); + this.setAreaTransparent(0 * k, 48 * k, 16 * k, 64 * k); + this.setAreaOpaque(16 * k, 48 * k, 48 * k, 64 * k); + this.setAreaTransparent(48 * k, 48 * k, 64 * k, 64 * k); + return bufferedimage; + } + } + + public void skinAvailable() + { + } + + private void setAreaTransparent(int p_78434_1_, int p_78434_2_, int p_78434_3_, int p_78434_4_) + { + if (!this.hasTransparency(p_78434_1_, p_78434_2_, p_78434_3_, p_78434_4_)) + { + for (int i = p_78434_1_; i < p_78434_3_; ++i) + { + for (int j = p_78434_2_; j < p_78434_4_; ++j) + { + this.imageData[i + j * this.imageWidth] &= 16777215; + } + } + } + } + + private void setAreaOpaque(int p_78433_1_, int p_78433_2_, int p_78433_3_, int p_78433_4_) + { + for (int i = p_78433_1_; i < p_78433_3_; ++i) + { + for (int j = p_78433_2_; j < p_78433_4_; ++j) + { + this.imageData[i + j * this.imageWidth] |= -16777216; + } + } + } + + private boolean hasTransparency(int p_78435_1_, int p_78435_2_, int p_78435_3_, int p_78435_4_) + { + for (int i = p_78435_1_; i < p_78435_3_; ++i) + { + for (int j = p_78435_2_; j < p_78435_4_; ++j) + { + int k = this.imageData[i + j * this.imageWidth]; + + if ((k >> 24 & 255) < 128) + { + return true; + } + } + } + + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java new file mode 100644 index 0000000..3b509b1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java @@ -0,0 +1,110 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.inventory.Container; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +import java.util.Collection; + +public abstract class InventoryEffectRenderer extends GuiContainer +{ + private boolean hasActivePotionEffects; + + public InventoryEffectRenderer(Container inventorySlotsIn) + { + super(inventorySlotsIn); + } + + public void initGui() + { + super.initGui(); + this.updateActivePotionEffects(); + } + + protected void updateActivePotionEffects() + { + if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) + { + boolean bl2 = CheatBreaker.getInstance().getModuleManager().potionEffectsMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().potionEffectsMod.potionInfoInInventory.getBooleanValue(); + boolean bl = !CheatBreaker.getInstance().getModuleManager().potionEffectsMod.isEnabled() && CheatBreaker.getInstance().getGlobalSettings().showPotionInfo.getBooleanValue(); + if (!this.mc.thePlayer.getActivePotionEffects().isEmpty() && (bl2 || bl)) { + if (CheatBreaker.getInstance().getGlobalSettings().shiftPotionInfo.getBooleanValue()) { + this.guiLeft = 160 + (this.width - this.xSize - 200) / 2; + } + this.hasActivePotionEffects = true; + } + } + else + { + this.guiLeft = (this.width - this.xSize) / 2; + this.hasActivePotionEffects = false; + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + + if (this.hasActivePotionEffects) + { + this.drawActivePotionEffects(); + } + } + + private void drawActivePotionEffects() + { + int i = this.guiLeft - 124; + int j = this.guiTop; + int k = 166; + Collection collection = this.mc.thePlayer.getActivePotionEffects(); + + if (!collection.isEmpty()) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableLighting(); + int l = 33; + + if (collection.size() > 5) + { + l = 132 / (collection.size() - 1); + } + + for (PotionEffect potioneffect : this.mc.thePlayer.getActivePotionEffects()) + { + Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(inventoryBackground); + this.drawTexturedModalRect(i, j, 0, 166, 140, 32); + + if (potion.hasStatusIcon()) + { + int i1 = potion.getStatusIconIndex(); + this.drawTexturedModalRect(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18); + } + + String s1 = I18n.format(potion.getName(), new Object[0]); + + if (potioneffect.getAmplifier() == 1) + { + s1 = s1 + " " + I18n.format("enchantment.level.2", new Object[0]); + } + else if (potioneffect.getAmplifier() == 2) + { + s1 = s1 + " " + I18n.format("enchantment.level.3", new Object[0]); + } + else if (potioneffect.getAmplifier() == 3) + { + s1 = s1 + " " + I18n.format("enchantment.level.4", new Object[0]); + } + + this.fontRendererObj.drawStringWithShadow(s1, (float)(i + 10 + 18), (float)(j + 6), 16777215); + String s = Potion.getDurationString(potioneffect); + this.fontRendererObj.drawStringWithShadow(s, (float)(i + 10 + 18), (float)(j + 6 + 10), 8355711); + j += l; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemMeshDefinition.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemMeshDefinition.java new file mode 100644 index 0000000..1a31b0a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemMeshDefinition.java @@ -0,0 +1,9 @@ +package net.minecraft.client.renderer; + +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.item.ItemStack; + +public interface ItemMeshDefinition +{ + ModelResourceLocation getModelLocation(ItemStack stack); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemModelMesher.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemModelMesher.java new file mode 100644 index 0000000..ac281ff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemModelMesher.java @@ -0,0 +1,113 @@ +package net.minecraft.client.renderer; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.ISmartItemModel; +import net.optifine.CustomItems; +import net.optifine.reflect.Reflector; + +public class ItemModelMesher +{ + private final Map simpleShapes = Maps.newHashMap(); + private final Map simpleShapesCache = Maps.newHashMap(); + private final Map shapers = Maps.newHashMap(); + private final ModelManager modelManager; + + public ItemModelMesher(ModelManager modelManager) + { + this.modelManager = modelManager; + } + + public TextureAtlasSprite getParticleIcon(Item item) + { + return this.getParticleIcon(item, 0); + } + + public TextureAtlasSprite getParticleIcon(Item item, int meta) + { + return this.getItemModel(new ItemStack(item, 1, meta)).getParticleTexture(); + } + + public IBakedModel getItemModel(ItemStack stack) + { + Item item = stack.getItem(); + IBakedModel ibakedmodel = this.getItemModel(item, this.getMetadata(stack)); + + if (ibakedmodel == null) + { + ItemMeshDefinition itemmeshdefinition = (ItemMeshDefinition)this.shapers.get(item); + + if (itemmeshdefinition != null) + { + ibakedmodel = this.modelManager.getModel(itemmeshdefinition.getModelLocation(stack)); + } + } + + if (Reflector.ForgeHooksClient.exists() && ibakedmodel instanceof ISmartItemModel) + { + ibakedmodel = ((ISmartItemModel)ibakedmodel).handleItemState(stack); + } + + if (ibakedmodel == null) + { + ibakedmodel = this.modelManager.getMissingModel(); + } + + if (Config.isCustomItems()) + { + ibakedmodel = CustomItems.getCustomItemModel(stack, ibakedmodel, (ResourceLocation)null, true); + } + + return ibakedmodel; + } + + protected int getMetadata(ItemStack stack) + { + return stack.isItemStackDamageable() ? 0 : stack.getMetadata(); + } + + protected IBakedModel getItemModel(Item item, int meta) + { + return (IBakedModel)this.simpleShapesCache.get(Integer.valueOf(this.getIndex(item, meta))); + } + + private int getIndex(Item item, int meta) + { + return Item.getIdFromItem(item) << 16 | meta; + } + + public void register(Item item, int meta, ModelResourceLocation location) + { + this.simpleShapes.put(Integer.valueOf(this.getIndex(item, meta)), location); + this.simpleShapesCache.put(Integer.valueOf(this.getIndex(item, meta)), this.modelManager.getModel(location)); + } + + public void register(Item item, ItemMeshDefinition definition) + { + this.shapers.put(item, definition); + } + + public ModelManager getModelManager() + { + return this.modelManager; + } + + public void rebuildCache() + { + this.simpleShapesCache.clear(); + + for (Entry entry : this.simpleShapes.entrySet()) + { + this.simpleShapesCache.put(entry.getKey(), this.modelManager.getModel((ModelResourceLocation)entry.getValue())); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemRenderer.java new file mode 100644 index 0000000..28a2885 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ItemRenderer.java @@ -0,0 +1,641 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.animation.util.AnimationHandler; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import com.cheatbreaker.client.module.impl.normal.misc.ModulePackTweaks; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleDragToLook; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import net.optifine.DynamicLights; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +public class ItemRenderer +{ + private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); + private static final ResourceLocation RES_UNDERWATER_OVERLAY = new ResourceLocation("textures/misc/underwater.png"); + private final Minecraft mc; + private ItemStack itemToRender; + private float equippedProgress; + private float prevEquippedProgress; + private final RenderManager renderManager; + private final RenderItem itemRenderer; + private int equippedItemSlot = -1; + + public ItemRenderer(Minecraft mcIn) + { + this.mc = mcIn; + this.renderManager = mcIn.getRenderManager(); + this.itemRenderer = mcIn.getRenderItem(); + } + + public void renderItem(EntityLivingBase entityIn, ItemStack heldStack, TransformType transform) + { + if (heldStack != null) + { + Item item = heldStack.getItem(); + Block block = Block.getBlockFromItem(item); + GlStateManager.pushMatrix(); + + if (this.itemRenderer.shouldRenderItemIn3D(heldStack)) + { + GlStateManager.scale(2.0F, 2.0F, 2.0F); + + if (this.isBlockTranslucent(block) && (!Config.isShaders() || !Shaders.renderItemKeepDepthMask)) + { + GlStateManager.depthMask(false); + } + } + + this.itemRenderer.renderItemModelForEntity(heldStack, entityIn, transform); + + if (this.isBlockTranslucent(block)) + { + GlStateManager.depthMask(true); + } + + GlStateManager.popMatrix(); + } + } + + private boolean isBlockTranslucent(Block blockIn) + { + return blockIn != null && blockIn.getBlockLayer() == EnumWorldBlockLayer.TRANSLUCENT; + } + + private void rotateArroundXAndY(float angle, float angleY) + { + GlStateManager.pushMatrix(); + GlStateManager.rotate(angle, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(angleY, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GlStateManager.popMatrix(); + } + + private void setLightMapFromPlayer(AbstractClientPlayer clientPlayer) + { + int i = this.mc.theWorld.getCombinedLight(new BlockPos(clientPlayer.posX, clientPlayer.posY + (double)clientPlayer.getEyeHeight(), clientPlayer.posZ), 0); + + if (Config.isDynamicLights()) + { + i = DynamicLights.getCombinedLight(this.mc.getRenderViewEntity(), i); + } + + float f = (float)(i & 65535); + float f1 = (float)(i >> 16); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f, f1); + } + + private void rotateWithPlayerRotations(EntityPlayerSP entityplayerspIn, float partialTicks) + { + float f = entityplayerspIn.prevRenderArmPitch + (entityplayerspIn.renderArmPitch - entityplayerspIn.prevRenderArmPitch) * partialTicks; + float f1 = entityplayerspIn.prevRenderArmYaw + (entityplayerspIn.renderArmYaw - entityplayerspIn.prevRenderArmYaw) * partialTicks; + GlStateManager.rotate((entityplayerspIn.rotationPitch - f) * 0.1F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate((entityplayerspIn.rotationYaw - f1) * 0.1F, 0.0F, 1.0F, 0.0F); + } + + private float getMapAngleFromPitch(float pitch) + { + float f = 1.0F - pitch / 45.0F + 0.1F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + f = -MathHelper.cos(f * (float)Math.PI) * 0.5F + 0.5F; + return f; + } + + private void renderRightArm(RenderPlayer renderPlayerIn) + { + GlStateManager.pushMatrix(); + GlStateManager.rotate(54.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(64.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-62.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.translate(0.25F, -0.85F, 0.75F); + renderPlayerIn.renderRightArm(this.mc.thePlayer); + GlStateManager.popMatrix(); + } + + private void renderLeftArm(RenderPlayer renderPlayerIn) + { + GlStateManager.pushMatrix(); + GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(41.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.translate(-0.3F, -1.1F, 0.45F); + renderPlayerIn.renderLeftArm(this.mc.thePlayer); + GlStateManager.popMatrix(); + } + + private void renderPlayerArms(AbstractClientPlayer clientPlayer) + { + this.mc.getTextureManager().bindTexture(clientPlayer.getLocationSkin()); + Render render = this.renderManager.getEntityRenderObject(this.mc.thePlayer); + RenderPlayer renderplayer = (RenderPlayer)render; + + if (!clientPlayer.isInvisible()) + { + GlStateManager.disableCull(); + this.renderRightArm(renderplayer); + this.renderLeftArm(renderplayer); + GlStateManager.enableCull(); + } + } + + private void renderItemMap(AbstractClientPlayer clientPlayer, float pitch, float equipmentProgress, float swingProgress) + { + float f = -0.4F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); + float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI * 2.0F); + float f2 = -0.2F * MathHelper.sin(swingProgress * (float)Math.PI); + GlStateManager.translate(f, f1, f2); + float f3 = this.getMapAngleFromPitch(pitch); + GlStateManager.translate(0.0F, 0.04F, -0.72F); + GlStateManager.translate(0.0F, equipmentProgress * -1.2F, 0.0F); + GlStateManager.translate(0.0F, f3 * -0.5F, 0.0F); + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f3 * -85.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(0.0F, 1.0F, 0.0F, 0.0F); + this.renderPlayerArms(clientPlayer); + float f4 = MathHelper.sin(swingProgress * swingProgress * (float)Math.PI); + float f5 = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); + GlStateManager.rotate(f4 * -20.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f5 * -20.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(f5 * -80.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(0.38F, 0.38F, 0.38F); + GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(0.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(-1.0F, -1.0F, 0.0F); + GlStateManager.scale(0.015625F, 0.015625F, 0.015625F); + this.mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-7.0D, 135.0D, 0.0D).tex(0.0D, 1.0D).endVertex(); + worldrenderer.pos(135.0D, 135.0D, 0.0D).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos(135.0D, -7.0D, 0.0D).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos(-7.0D, -7.0D, 0.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + MapData mapdata = Items.filled_map.getMapData(this.itemToRender, this.mc.theWorld); + + if (mapdata != null) + { + this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, false); + } + } + + private void renderPlayerArm(AbstractClientPlayer clientPlayer, float equipProgress, float swingProgress) + { + float f = -0.3F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); + float f1 = 0.4F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI * 2.0F); + float f2 = -0.4F * MathHelper.sin(swingProgress * (float)Math.PI); + GlStateManager.translate(f, f1, f2); + GlStateManager.translate(0.64000005F, -0.6F, -0.71999997F); + GlStateManager.translate(0.0F, equipProgress * -0.6F, 0.0F); + GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F); + float f3 = MathHelper.sin(swingProgress * swingProgress * (float)Math.PI); + float f4 = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); + GlStateManager.rotate(f4 * 70.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f3 * -20.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(clientPlayer.getLocationSkin()); + GlStateManager.translate(-1.0F, 3.6F, 3.5F); + GlStateManager.rotate(120.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(200.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.scale(1.0F, 1.0F, 1.0F); + GlStateManager.translate(5.6F, 0.0F, 0.0F); + Render render = this.renderManager.getEntityRenderObject(this.mc.thePlayer); + GlStateManager.disableCull(); + RenderPlayer renderplayer = (RenderPlayer)render; + renderplayer.renderRightArm(this.mc.thePlayer); + GlStateManager.enableCull(); + } + + private void doItemUsedTransformations(float swingProgress) + { + float f = -0.4F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); + float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI * 2.0F); + float f2 = -0.2F * MathHelper.sin(swingProgress * (float)Math.PI); + GlStateManager.translate(f, f1, f2); + } + + private void performDrinking(AbstractClientPlayer clientPlayer, float partialTicks) + { + float f = (float)clientPlayer.getItemInUseCount() - partialTicks + 1.0F; + float f1 = f / (float)this.itemToRender.getMaxItemUseDuration(); + float f2 = MathHelper.abs(MathHelper.cos(f / 4.0F * (float)Math.PI) * 0.1F); + + if (f1 >= 0.8F) + { + f2 = 0.0F; + } + + GlStateManager.translate(0.0F, f2, 0.0F); + float f3 = 1.0F - (float)Math.pow((double)f1, 27.0D); + GlStateManager.translate(f3 * 0.6F, f3 * -0.5F, f3 * 0.0F); + GlStateManager.rotate(f3 * 90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f3 * 10.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(f3 * 30.0F, 0.0F, 0.0F, 1.0F); + } + + private void transformFirstPersonItem(float equipProgress, float swingProgress) + { + GlStateManager.translate(0.56F, -0.52F, -0.71999997F); + GlStateManager.translate(0.0F, equipProgress * -0.6F, 0.0F); + GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F); + float f = MathHelper.sin(swingProgress * swingProgress * (float)Math.PI); + float f1 = MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); + GlStateManager.rotate(f * -20.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f1 * -20.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(f1 * -80.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(0.4F, 0.4F, 0.4F); + } + + private void doBowTransformations(float partialTicks, AbstractClientPlayer clientPlayer) + { + GlStateManager.rotate(-18.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(-12.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-8.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(-0.9F, 0.2F, 0.0F); + float f = (float)this.itemToRender.getMaxItemUseDuration() - ((float)clientPlayer.getItemInUseCount() - partialTicks + 1.0F); + float f1 = f / 20.0F; + f1 = (f1 * f1 + f1 * 2.0F) / 3.0F; + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + if (f1 > 0.1F) + { + float f2 = MathHelper.sin((f - 0.1F) * 1.3F); + float f3 = f1 - 0.1F; + float f4 = f2 * f3; + GlStateManager.translate(f4 * 0.0F, f4 * 0.01F, f4 * 0.0F); + } + + GlStateManager.translate(f1 * 0.0F, f1 * 0.0F, f1 * 0.1F); + GlStateManager.scale(1.0F, 1.0F, 1.0F + f1 * 0.2F); + } + + private void doBlockTransformations() + { + GlStateManager.translate(-0.5F, 0.2F, 0.0F); + GlStateManager.rotate(30.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-80.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(60.0F, 0.0F, 1.0F, 0.0F); + } + + /** + * Renders the active item in the player's hand when in first person mode. Args: partialTickTime + * + * @param partialTicks The amount of time passed during the current tick, ranging from 0 to 1. + */ + public void renderItemInFirstPerson(float partialTicks) + { + ModuleDragToLook dragToLook = CheatBreaker.getInstance().getModuleManager().dragToLook; + float f5 = dragToLook.enabled ? this.mc.thePlayer.rotationYaw - dragToLook.rotationYaw : 0.0f; + + if (this.itemToRender != null) { + ItemRenderer $this = this; + float equipProgress = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * partialTicks; + + if (AnimationHandler.INSTANCE.renderItemInFirstPerson($this, this.itemToRender, equipProgress, partialTicks)) { + return; + } + } + + if (!Config.isShaders() || !Shaders.isSkipRenderHand()) + { + float f = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * partialTicks); + AbstractClientPlayer abstractclientplayer = this.mc.thePlayer; + float f1 = abstractclientplayer.getSwingProgress(partialTicks); + float f2 = abstractclientplayer.prevRotationPitch + (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks; + float f3 = abstractclientplayer.prevRotationYaw + (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks + f5 * (float)10; + this.rotateArroundXAndY(f2, f3); + this.setLightMapFromPlayer(abstractclientplayer); + this.rotateWithPlayerRotations((EntityPlayerSP)abstractclientplayer, partialTicks); + GlStateManager.enableRescaleNormal(); + GlStateManager.pushMatrix(); + + if (this.itemToRender != null) + { + if (this.itemToRender.getItem() instanceof ItemMap) + { + this.renderItemMap(abstractclientplayer, f2, f, f1); + } + else if (abstractclientplayer.getItemInUseCount() > 0) + { + EnumAction enumaction = this.itemToRender.getItemUseAction(); + + switch (enumaction) + { + case NONE: + this.transformFirstPersonItem(f, 0.0F); + break; + + case EAT: + case DRINK: + this.performDrinking(abstractclientplayer, partialTicks); + this.transformFirstPersonItem(f, 0.0F); + break; + + case BLOCK: + this.transformFirstPersonItem(f, 0.0F); + this.doBlockTransformations(); + break; + + case BOW: + this.transformFirstPersonItem(f, 0.0F); + this.doBowTransformations(partialTicks, abstractclientplayer); + } + } + else + { + this.doItemUsedTransformations(f1); + this.transformFirstPersonItem(f, f1); + } + + this.renderItem(abstractclientplayer, this.itemToRender, TransformType.FIRST_PERSON); + } + else if (!abstractclientplayer.isInvisible()) + { + this.renderPlayerArm(abstractclientplayer, f, f1); + } + + GlStateManager.popMatrix(); + GlStateManager.disableRescaleNormal(); + RenderHelper.disableStandardItemLighting(); + } + } + + public void renderOverlays(float partialTicks) + { + GlStateManager.disableAlpha(); + + if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) + { + IBlockState iblockstate = this.mc.theWorld.getBlockState(new BlockPos(this.mc.thePlayer)); + BlockPos blockpos = new BlockPos(this.mc.thePlayer); + EntityPlayer entityplayer = this.mc.thePlayer; + + for (int i = 0; i < 8; ++i) + { + double d0 = entityplayer.posX + (double)(((float)((i >> 0) % 2) - 0.5F) * entityplayer.width * 0.8F); + double d1 = entityplayer.posY + (double)(((float)((i >> 1) % 2) - 0.5F) * 0.1F); + double d2 = entityplayer.posZ + (double)(((float)((i >> 2) % 2) - 0.5F) * entityplayer.width * 0.8F); + BlockPos blockpos1 = new BlockPos(d0, d1 + (double)entityplayer.getEyeHeight(), d2); + IBlockState iblockstate1 = this.mc.theWorld.getBlockState(blockpos1); + + if (iblockstate1.getBlock().isVisuallyOpaque()) + { + iblockstate = iblockstate1; + blockpos = blockpos1; + } + } + + if (iblockstate.getBlock().getRenderType() != -1) + { + Object object = Reflector.getFieldValue(Reflector.RenderBlockOverlayEvent_OverlayType_BLOCK); + + if (!Reflector.callBoolean(Reflector.ForgeEventFactory_renderBlockOverlay, new Object[] {this.mc.thePlayer, Float.valueOf(partialTicks), object, iblockstate, blockpos})) + { + this.renderBlockInHand(partialTicks, this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(iblockstate)); + } + } + } + + if (!this.mc.thePlayer.isSpectator()) + { + if (this.mc.thePlayer.isInsideOfMaterial(Material.water) && !Reflector.callBoolean(Reflector.ForgeEventFactory_renderWaterOverlay, new Object[] {this.mc.thePlayer, Float.valueOf(partialTicks)})) + { + this.renderWaterOverlayTexture(partialTicks); + } + + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + boolean ptIsEnabled = pt.isEnabled(); + boolean showFireOverlay = ptIsEnabled ? (Boolean) pt.firstPersonFire.getValue() : true; + + if (this.mc.thePlayer.isBurning() && showFireOverlay && !Reflector.callBoolean(Reflector.ForgeEventFactory_renderFireOverlay, this.mc.thePlayer, partialTicks)) + { + this.renderFireInFirstPerson(partialTicks); + } + } + + GlStateManager.enableAlpha(); + } + + private void renderBlockInHand(float partialTicks, TextureAtlasSprite atlas) + { + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + float f = 0.1F; + GlStateManager.color(0.1F, 0.1F, 0.1F, 0.5F); + GlStateManager.pushMatrix(); + float f6 = atlas.getMinU(); + float f7 = atlas.getMaxU(); + float f8 = atlas.getMinV(); + float f9 = atlas.getMaxV(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-1.0D, -1.0D, -0.5D).tex(f7, f9).endVertex(); + worldrenderer.pos(1.0D, -1.0D, -0.5D).tex(f6, f9).endVertex(); + worldrenderer.pos(1.0D, 1.0D, -0.5D).tex(f6, f8).endVertex(); + worldrenderer.pos(-1.0D, 1.0D, -0.5D).tex(f7, f8).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + private void renderWaterOverlayTexture(float partialTicks) + { + if (!Config.isShaders() || Shaders.isUnderwaterOverlay()) + { + this.mc.getTextureManager().bindTexture(RES_UNDERWATER_OVERLAY); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + float f = this.mc.thePlayer.getBrightness(partialTicks); + GlStateManager.color(f, f, f, 0.5F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); + float f7 = -this.mc.thePlayer.rotationYaw / 64.0F; + float f8 = this.mc.thePlayer.rotationPitch / 64.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-1.0D, -1.0D, -0.5D).tex((double)(4.0F + f7), (double)(4.0F + f8)).endVertex(); + worldrenderer.pos(1.0D, -1.0D, -0.5D).tex((double)(0.0F + f7), (double)(4.0F + f8)).endVertex(); + worldrenderer.pos(1.0D, 1.0D, -0.5D).tex((double)(0.0F + f7), (double)(0.0F + f8)).endVertex(); + worldrenderer.pos(-1.0D, 1.0D, -0.5D).tex((double)(4.0F + f7), (double)(0.0F + f8)).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + } + } + + private void renderFireInFirstPerson(float partialTicks) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + if (CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GlStateManager.color(1.0F, 1.0F, 1.0F, CheatBreaker.getInstance().getModuleManager().packTweaksMod.firstPersonFireOpacity.getFloatValue() / 100.0F); + } else { + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F); + } + + GlStateManager.depthFunc(519); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + + float f = 1.0F; + for (int i = 0; i < 2; ++i) + { + GlStateManager.pushMatrix(); + TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite("minecraft:blocks/fire_layer_1"); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + + float f1 = textureatlassprite.getMinU(); + float f2 = textureatlassprite.getMaxU(); + float f3 = textureatlassprite.getMinV(); + float f4 = textureatlassprite.getMaxV(); + float f5 = (0.0F - f) / 2.0F; + float f6 = f5 + f; + float f7 = 0.0F - f / 2.0F; + float f8 = f7 + f; + float f9 = -0.5F; + + if (CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GlStateManager.translate((float)(-(i * 2 - 1)) * 0.24F, -1.3F + + CheatBreaker.getInstance().getModuleManager().packTweaksMod.firstPersonFireHeight.getFloatValue(), 0.0F); + } else { + GlStateManager.translate((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F); + } + + GlStateManager.rotate((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F); + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.setSprite(textureatlassprite); + worldrenderer.pos(f5, f7, f9).tex(f2, f4).endVertex(); + worldrenderer.pos(f6, f7, f9).tex(f1, f4).endVertex(); + worldrenderer.pos(f6, f8, f9).tex(f1, f3).endVertex(); + worldrenderer.pos(f5, f8, f9).tex(f2, f3).endVertex(); + tessellator.draw(); + + GlStateManager.popMatrix(); + } + + if (CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GlStateManager.color(1.0F, 1.0F, 1.0F, CheatBreaker.getInstance().getModuleManager().packTweaksMod.firstPersonFireOpacity.getFloatValue() / 100.0F); + } else { + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F); + } + + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + GlStateManager.depthFunc(515); + } + + public void updateEquippedItem() + { + this.prevEquippedProgress = this.equippedProgress; + EntityPlayer entityplayer = this.mc.thePlayer; + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + boolean flag = false; + + if (this.itemToRender != null && itemstack != null) + { + if (!this.itemToRender.getIsItemStackEqual(itemstack)) + { + if (Reflector.ForgeItem_shouldCauseReequipAnimation.exists()) + { + boolean flag1 = Reflector.callBoolean(this.itemToRender.getItem(), Reflector.ForgeItem_shouldCauseReequipAnimation, new Object[] {this.itemToRender, itemstack, Boolean.valueOf(this.equippedItemSlot != entityplayer.inventory.currentItem)}); + + if (!flag1) + { + this.itemToRender = itemstack; + this.equippedItemSlot = entityplayer.inventory.currentItem; + return; + } + } + + flag = true; + } + } + else if (this.itemToRender == null && itemstack == null) + { + flag = false; + } + else + { + flag = true; + } + + float f2 = 0.4F; + float f = flag ? 0.0F : 1.0F; + /* + * handleItemSwitch(int original) - 1.7 Item Switch emulation + */ + float f1 = MathHelper.clamp_float(handleItemSwitch(f - this.equippedProgress), -f2, f2); + this.equippedProgress += f1; + + if (this.equippedProgress < 0.1F) + { + this.itemToRender = itemstack; + this.equippedItemSlot = entityplayer.inventory.currentItem; + + if (Config.isShaders()) + { + Shaders.setItemToRenderMain(itemstack); + } + } + } + + /** + * 1.7 Item Switch emulation + */ + private float handleItemSwitch(float original) { + EntityPlayerSP entityplayer = Minecraft.getMinecraft().thePlayer; + ItemStack itemstack = entityplayer.inventory.getCurrentItem(); + if (ModuleOneSevenVisuals.itemSwitch.getBooleanValue() && this.equippedItemSlot == entityplayer.inventory.currentItem && ItemStack.areItemsEqual((ItemStack)this.itemToRender, (ItemStack)itemstack)) { + return 1.0f - this.prevEquippedProgress; + } + return original; + } + + public void resetEquippedProgress() + { + this.equippedProgress = 0.0F; + } + + public void resetEquippedProgress2() + { + this.equippedProgress = 0.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/OpenGlHelper.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/OpenGlHelper.java new file mode 100644 index 0000000..fb7ced2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/OpenGlHelper.java @@ -0,0 +1,987 @@ +package net.minecraft.client.renderer; + +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import org.lwjgl.opengl.ARBCopyBuffer; +import org.lwjgl.opengl.ARBFramebufferObject; +import org.lwjgl.opengl.ARBMultitexture; +import org.lwjgl.opengl.ARBShaderObjects; +import org.lwjgl.opengl.ARBVertexBufferObject; +import org.lwjgl.opengl.ARBVertexShader; +import org.lwjgl.opengl.ContextCapabilities; +import org.lwjgl.opengl.EXTBlendFuncSeparate; +import org.lwjgl.opengl.EXTFramebufferObject; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL14; +import org.lwjgl.opengl.GL15; +import org.lwjgl.opengl.GL20; +import org.lwjgl.opengl.GL30; +import org.lwjgl.opengl.GL31; +import org.lwjgl.opengl.GLContext; +import oshi.SystemInfo; +import oshi.hardware.Processor; + +public class OpenGlHelper +{ + public static boolean nvidia; + public static boolean ati; + public static int GL_FRAMEBUFFER; + public static int GL_RENDERBUFFER; + public static int GL_COLOR_ATTACHMENT0; + public static int GL_DEPTH_ATTACHMENT; + public static int GL_FRAMEBUFFER_COMPLETE; + public static int GL_FB_INCOMPLETE_ATTACHMENT; + public static int GL_FB_INCOMPLETE_MISS_ATTACH; + public static int GL_FB_INCOMPLETE_DRAW_BUFFER; + public static int GL_FB_INCOMPLETE_READ_BUFFER; + private static int framebufferType; + public static boolean framebufferSupported; + private static boolean shadersAvailable; + private static boolean arbShaders; + public static int GL_LINK_STATUS; + public static int GL_COMPILE_STATUS; + public static int GL_VERTEX_SHADER; + public static int GL_FRAGMENT_SHADER; + private static boolean arbMultitexture; + public static int defaultTexUnit; + public static int lightmapTexUnit; + public static int GL_TEXTURE2; + private static boolean arbTextureEnvCombine; + public static int GL_COMBINE; + public static int GL_INTERPOLATE; + public static int GL_PRIMARY_COLOR; + public static int GL_CONSTANT; + public static int GL_PREVIOUS; + public static int GL_COMBINE_RGB; + public static int GL_SOURCE0_RGB; + public static int GL_SOURCE1_RGB; + public static int GL_SOURCE2_RGB; + public static int GL_OPERAND0_RGB; + public static int GL_OPERAND1_RGB; + public static int GL_OPERAND2_RGB; + public static int GL_COMBINE_ALPHA; + public static int GL_SOURCE0_ALPHA; + public static int GL_SOURCE1_ALPHA; + public static int GL_SOURCE2_ALPHA; + public static int GL_OPERAND0_ALPHA; + public static int GL_OPERAND1_ALPHA; + public static int GL_OPERAND2_ALPHA; + private static boolean openGL14; + public static boolean extBlendFuncSeparate; + public static boolean openGL21; + public static boolean shadersSupported; + private static String logText = ""; + private static String cpu; + public static boolean vboSupported; + public static boolean vboSupportedAti; + private static boolean arbVbo; + public static int GL_ARRAY_BUFFER; + public static int GL_STATIC_DRAW; + public static float lastBrightnessX = 0.0F; + public static float lastBrightnessY = 0.0F; + public static boolean openGL31; + public static boolean vboRegions; + public static int GL_COPY_READ_BUFFER; + public static int GL_COPY_WRITE_BUFFER; + public static final int GL_QUADS = 7; + public static final int GL_TRIANGLES = 4; + + public static void initializeTextures() + { + Config.initDisplay(); + ContextCapabilities contextcapabilities = GLContext.getCapabilities(); + arbMultitexture = contextcapabilities.GL_ARB_multitexture && !contextcapabilities.OpenGL13; + arbTextureEnvCombine = contextcapabilities.GL_ARB_texture_env_combine && !contextcapabilities.OpenGL13; + openGL31 = contextcapabilities.OpenGL31; + + if (openGL31) + { + GL_COPY_READ_BUFFER = 36662; + GL_COPY_WRITE_BUFFER = 36663; + } + else + { + GL_COPY_READ_BUFFER = 36662; + GL_COPY_WRITE_BUFFER = 36663; + } + + boolean flag = openGL31 || contextcapabilities.GL_ARB_copy_buffer; + boolean flag1 = contextcapabilities.OpenGL14; + vboRegions = flag && flag1; + + if (!vboRegions) + { + List list = new ArrayList(); + + if (!flag) + { + list.add("OpenGL 1.3, ARB_copy_buffer"); + } + + if (!flag1) + { + list.add("OpenGL 1.4"); + } + + String s = "VboRegions not supported, missing: " + Config.listToString(list); + Config.dbg(s); + logText = logText + s + "\n"; + } + + if (arbMultitexture) + { + logText = logText + "Using ARB_multitexture.\n"; + defaultTexUnit = 33984; + lightmapTexUnit = 33985; + GL_TEXTURE2 = 33986; + } + else + { + logText = logText + "Using GL 1.3 multitexturing.\n"; + defaultTexUnit = 33984; + lightmapTexUnit = 33985; + GL_TEXTURE2 = 33986; + } + + if (arbTextureEnvCombine) + { + logText = logText + "Using ARB_texture_env_combine.\n"; + GL_COMBINE = 34160; + GL_INTERPOLATE = 34165; + GL_PRIMARY_COLOR = 34167; + GL_CONSTANT = 34166; + GL_PREVIOUS = 34168; + GL_COMBINE_RGB = 34161; + GL_SOURCE0_RGB = 34176; + GL_SOURCE1_RGB = 34177; + GL_SOURCE2_RGB = 34178; + GL_OPERAND0_RGB = 34192; + GL_OPERAND1_RGB = 34193; + GL_OPERAND2_RGB = 34194; + GL_COMBINE_ALPHA = 34162; + GL_SOURCE0_ALPHA = 34184; + GL_SOURCE1_ALPHA = 34185; + GL_SOURCE2_ALPHA = 34186; + GL_OPERAND0_ALPHA = 34200; + GL_OPERAND1_ALPHA = 34201; + GL_OPERAND2_ALPHA = 34202; + } + else + { + logText = logText + "Using GL 1.3 texture combiners.\n"; + GL_COMBINE = 34160; + GL_INTERPOLATE = 34165; + GL_PRIMARY_COLOR = 34167; + GL_CONSTANT = 34166; + GL_PREVIOUS = 34168; + GL_COMBINE_RGB = 34161; + GL_SOURCE0_RGB = 34176; + GL_SOURCE1_RGB = 34177; + GL_SOURCE2_RGB = 34178; + GL_OPERAND0_RGB = 34192; + GL_OPERAND1_RGB = 34193; + GL_OPERAND2_RGB = 34194; + GL_COMBINE_ALPHA = 34162; + GL_SOURCE0_ALPHA = 34184; + GL_SOURCE1_ALPHA = 34185; + GL_SOURCE2_ALPHA = 34186; + GL_OPERAND0_ALPHA = 34200; + GL_OPERAND1_ALPHA = 34201; + GL_OPERAND2_ALPHA = 34202; + } + + extBlendFuncSeparate = contextcapabilities.GL_EXT_blend_func_separate && !contextcapabilities.OpenGL14; + openGL14 = contextcapabilities.OpenGL14 || contextcapabilities.GL_EXT_blend_func_separate; + framebufferSupported = openGL14 && (contextcapabilities.GL_ARB_framebuffer_object || contextcapabilities.GL_EXT_framebuffer_object || contextcapabilities.OpenGL30); + + if (framebufferSupported) + { + logText = logText + "Using framebuffer objects because "; + + if (contextcapabilities.OpenGL30) + { + logText = logText + "OpenGL 3.0 is supported and separate blending is supported.\n"; + framebufferType = 0; + GL_FRAMEBUFFER = 36160; + GL_RENDERBUFFER = 36161; + GL_COLOR_ATTACHMENT0 = 36064; + GL_DEPTH_ATTACHMENT = 36096; + GL_FRAMEBUFFER_COMPLETE = 36053; + GL_FB_INCOMPLETE_ATTACHMENT = 36054; + GL_FB_INCOMPLETE_MISS_ATTACH = 36055; + GL_FB_INCOMPLETE_DRAW_BUFFER = 36059; + GL_FB_INCOMPLETE_READ_BUFFER = 36060; + } + else if (contextcapabilities.GL_ARB_framebuffer_object) + { + logText = logText + "ARB_framebuffer_object is supported and separate blending is supported.\n"; + framebufferType = 1; + GL_FRAMEBUFFER = 36160; + GL_RENDERBUFFER = 36161; + GL_COLOR_ATTACHMENT0 = 36064; + GL_DEPTH_ATTACHMENT = 36096; + GL_FRAMEBUFFER_COMPLETE = 36053; + GL_FB_INCOMPLETE_MISS_ATTACH = 36055; + GL_FB_INCOMPLETE_ATTACHMENT = 36054; + GL_FB_INCOMPLETE_DRAW_BUFFER = 36059; + GL_FB_INCOMPLETE_READ_BUFFER = 36060; + } + else if (contextcapabilities.GL_EXT_framebuffer_object) + { + logText = logText + "EXT_framebuffer_object is supported.\n"; + framebufferType = 2; + GL_FRAMEBUFFER = 36160; + GL_RENDERBUFFER = 36161; + GL_COLOR_ATTACHMENT0 = 36064; + GL_DEPTH_ATTACHMENT = 36096; + GL_FRAMEBUFFER_COMPLETE = 36053; + GL_FB_INCOMPLETE_MISS_ATTACH = 36055; + GL_FB_INCOMPLETE_ATTACHMENT = 36054; + GL_FB_INCOMPLETE_DRAW_BUFFER = 36059; + GL_FB_INCOMPLETE_READ_BUFFER = 36060; + } + } + else + { + logText = logText + "Not using framebuffer objects because "; + logText = logText + "OpenGL 1.4 is " + (contextcapabilities.OpenGL14 ? "" : "not ") + "supported, "; + logText = logText + "EXT_blend_func_separate is " + (contextcapabilities.GL_EXT_blend_func_separate ? "" : "not ") + "supported, "; + logText = logText + "OpenGL 3.0 is " + (contextcapabilities.OpenGL30 ? "" : "not ") + "supported, "; + logText = logText + "ARB_framebuffer_object is " + (contextcapabilities.GL_ARB_framebuffer_object ? "" : "not ") + "supported, and "; + logText = logText + "EXT_framebuffer_object is " + (contextcapabilities.GL_EXT_framebuffer_object ? "" : "not ") + "supported.\n"; + } + + openGL21 = contextcapabilities.OpenGL21; + shadersAvailable = openGL21 || contextcapabilities.GL_ARB_vertex_shader && contextcapabilities.GL_ARB_fragment_shader && contextcapabilities.GL_ARB_shader_objects; + logText = logText + "Shaders are " + (shadersAvailable ? "" : "not ") + "available because "; + + if (shadersAvailable) + { + if (contextcapabilities.OpenGL21) + { + logText = logText + "OpenGL 2.1 is supported.\n"; + arbShaders = false; + GL_LINK_STATUS = 35714; + GL_COMPILE_STATUS = 35713; + GL_VERTEX_SHADER = 35633; + GL_FRAGMENT_SHADER = 35632; + } + else + { + logText = logText + "ARB_shader_objects, ARB_vertex_shader, and ARB_fragment_shader are supported.\n"; + arbShaders = true; + GL_LINK_STATUS = 35714; + GL_COMPILE_STATUS = 35713; + GL_VERTEX_SHADER = 35633; + GL_FRAGMENT_SHADER = 35632; + } + } + else + { + logText = logText + "OpenGL 2.1 is " + (contextcapabilities.OpenGL21 ? "" : "not ") + "supported, "; + logText = logText + "ARB_shader_objects is " + (contextcapabilities.GL_ARB_shader_objects ? "" : "not ") + "supported, "; + logText = logText + "ARB_vertex_shader is " + (contextcapabilities.GL_ARB_vertex_shader ? "" : "not ") + "supported, and "; + logText = logText + "ARB_fragment_shader is " + (contextcapabilities.GL_ARB_fragment_shader ? "" : "not ") + "supported.\n"; + } + + shadersSupported = framebufferSupported && shadersAvailable; + String s1 = GL11.glGetString(GL11.GL_VENDOR).toLowerCase(); + nvidia = s1.contains("nvidia"); + arbVbo = !contextcapabilities.OpenGL15 && contextcapabilities.GL_ARB_vertex_buffer_object; + vboSupported = contextcapabilities.OpenGL15 || arbVbo; + logText = logText + "VBOs are " + (vboSupported ? "" : "not ") + "available because "; + + if (vboSupported) + { + if (arbVbo) + { + logText = logText + "ARB_vertex_buffer_object is supported.\n"; + GL_STATIC_DRAW = 35044; + GL_ARRAY_BUFFER = 34962; + } + else + { + logText = logText + "OpenGL 1.5 is supported.\n"; + GL_STATIC_DRAW = 35044; + GL_ARRAY_BUFFER = 34962; + } + } + + ati = s1.contains("ati"); + + if (ati) + { + if (vboSupported) + { + vboSupportedAti = true; + } + else + { + GameSettings.Options.RENDER_DISTANCE.setValueMax(16.0F); + } + } + + try + { + Processor[] aprocessor = (new SystemInfo()).getHardware().getProcessors(); + cpu = String.format("%dx %s", new Object[] {Integer.valueOf(aprocessor.length), aprocessor[0]}).replaceAll("\\s+", " "); + } + catch (Throwable var5) + { + ; + } + } + + public static boolean areShadersSupported() + { + return shadersSupported; + } + + public static String getLogText() + { + return logText; + } + + public static int glGetProgrami(int program, int pname) + { + return arbShaders ? ARBShaderObjects.glGetObjectParameteriARB(program, pname) : GL20.glGetProgrami(program, pname); + } + + public static void glAttachShader(int program, int shaderIn) + { + if (arbShaders) + { + ARBShaderObjects.glAttachObjectARB(program, shaderIn); + } + else + { + GL20.glAttachShader(program, shaderIn); + } + } + + public static void glDeleteShader(int p_153180_0_) + { + if (arbShaders) + { + ARBShaderObjects.glDeleteObjectARB(p_153180_0_); + } + else + { + GL20.glDeleteShader(p_153180_0_); + } + } + + public static int glCreateShader(int type) + { + return arbShaders ? ARBShaderObjects.glCreateShaderObjectARB(type) : GL20.glCreateShader(type); + } + + public static void glShaderSource(int shaderIn, ByteBuffer string) + { + if (arbShaders) + { + ARBShaderObjects.glShaderSourceARB(shaderIn, string); + } + else + { + GL20.glShaderSource(shaderIn, string); + } + } + + public static void glCompileShader(int shaderIn) + { + if (arbShaders) + { + ARBShaderObjects.glCompileShaderARB(shaderIn); + } + else + { + GL20.glCompileShader(shaderIn); + } + } + + public static int glGetShaderi(int shaderIn, int pname) + { + return arbShaders ? ARBShaderObjects.glGetObjectParameteriARB(shaderIn, pname) : GL20.glGetShaderi(shaderIn, pname); + } + + public static String glGetShaderInfoLog(int shaderIn, int maxLength) + { + return arbShaders ? ARBShaderObjects.glGetInfoLogARB(shaderIn, maxLength) : GL20.glGetShaderInfoLog(shaderIn, maxLength); + } + + public static String glGetProgramInfoLog(int program, int maxLength) + { + return arbShaders ? ARBShaderObjects.glGetInfoLogARB(program, maxLength) : GL20.glGetProgramInfoLog(program, maxLength); + } + + public static void glUseProgram(int program) + { + if (arbShaders) + { + ARBShaderObjects.glUseProgramObjectARB(program); + } + else + { + GL20.glUseProgram(program); + } + } + + public static int glCreateProgram() + { + return arbShaders ? ARBShaderObjects.glCreateProgramObjectARB() : GL20.glCreateProgram(); + } + + public static void glDeleteProgram(int program) + { + if (arbShaders) + { + ARBShaderObjects.glDeleteObjectARB(program); + } + else + { + GL20.glDeleteProgram(program); + } + } + + public static void glLinkProgram(int program) + { + if (arbShaders) + { + ARBShaderObjects.glLinkProgramARB(program); + } + else + { + GL20.glLinkProgram(program); + } + } + + public static int glGetUniformLocation(int programObj, CharSequence name) + { + return arbShaders ? ARBShaderObjects.glGetUniformLocationARB(programObj, name) : GL20.glGetUniformLocation(programObj, name); + } + + public static void glUniform1(int location, IntBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform1ARB(location, values); + } + else + { + GL20.glUniform1(location, values); + } + } + + public static void glUniform1i(int location, int v0) + { + if (arbShaders) + { + ARBShaderObjects.glUniform1iARB(location, v0); + } + else + { + GL20.glUniform1i(location, v0); + } + } + + public static void glUniform1(int location, FloatBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform1ARB(location, values); + } + else + { + GL20.glUniform1(location, values); + } + } + + public static void glUniform2(int location, IntBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform2ARB(location, values); + } + else + { + GL20.glUniform2(location, values); + } + } + + public static void glUniform2(int location, FloatBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform2ARB(location, values); + } + else + { + GL20.glUniform2(location, values); + } + } + + public static void glUniform3(int location, IntBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform3ARB(location, values); + } + else + { + GL20.glUniform3(location, values); + } + } + + public static void glUniform3(int location, FloatBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform3ARB(location, values); + } + else + { + GL20.glUniform3(location, values); + } + } + + public static void glUniform4(int location, IntBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform4ARB(location, values); + } + else + { + GL20.glUniform4(location, values); + } + } + + public static void glUniform4(int location, FloatBuffer values) + { + if (arbShaders) + { + ARBShaderObjects.glUniform4ARB(location, values); + } + else + { + GL20.glUniform4(location, values); + } + } + + public static void glUniformMatrix2(int location, boolean transpose, FloatBuffer matrices) + { + if (arbShaders) + { + ARBShaderObjects.glUniformMatrix2ARB(location, transpose, matrices); + } + else + { + GL20.glUniformMatrix2(location, transpose, matrices); + } + } + + public static void glUniformMatrix3(int location, boolean transpose, FloatBuffer matrices) + { + if (arbShaders) + { + ARBShaderObjects.glUniformMatrix3ARB(location, transpose, matrices); + } + else + { + GL20.glUniformMatrix3(location, transpose, matrices); + } + } + + public static void glUniformMatrix4(int location, boolean transpose, FloatBuffer matrices) + { + if (arbShaders) + { + ARBShaderObjects.glUniformMatrix4ARB(location, transpose, matrices); + } + else + { + GL20.glUniformMatrix4(location, transpose, matrices); + } + } + + public static int glGetAttribLocation(int p_153164_0_, CharSequence p_153164_1_) + { + return arbShaders ? ARBVertexShader.glGetAttribLocationARB(p_153164_0_, p_153164_1_) : GL20.glGetAttribLocation(p_153164_0_, p_153164_1_); + } + + public static int glGenBuffers() + { + return arbVbo ? ARBVertexBufferObject.glGenBuffersARB() : GL15.glGenBuffers(); + } + + public static void glBindBuffer(int target, int buffer) + { + if (arbVbo) + { + ARBVertexBufferObject.glBindBufferARB(target, buffer); + } + else + { + GL15.glBindBuffer(target, buffer); + } + } + + public static void glBufferData(int target, ByteBuffer data, int usage) + { + if (arbVbo) + { + ARBVertexBufferObject.glBufferDataARB(target, data, usage); + } + else + { + GL15.glBufferData(target, data, usage); + } + } + + public static void glDeleteBuffers(int buffer) + { + if (arbVbo) + { + ARBVertexBufferObject.glDeleteBuffersARB(buffer); + } + else + { + GL15.glDeleteBuffers(buffer); + } + } + + public static boolean useVbo() + { + return Config.isMultiTexture() ? false : (Config.isRenderRegions() && !vboRegions ? false : vboSupported && Minecraft.getMinecraft().gameSettings.useVbo); + } + + public static void glBindFramebuffer(int target, int framebufferIn) + { + if (framebufferSupported) + { + switch (framebufferType) + { + case 0: + GL30.glBindFramebuffer(target, framebufferIn); + break; + + case 1: + ARBFramebufferObject.glBindFramebuffer(target, framebufferIn); + break; + + case 2: + EXTFramebufferObject.glBindFramebufferEXT(target, framebufferIn); + } + } + } + + public static void glBindRenderbuffer(int target, int renderbuffer) + { + if (framebufferSupported) + { + switch (framebufferType) + { + case 0: + GL30.glBindRenderbuffer(target, renderbuffer); + break; + + case 1: + ARBFramebufferObject.glBindRenderbuffer(target, renderbuffer); + break; + + case 2: + EXTFramebufferObject.glBindRenderbufferEXT(target, renderbuffer); + } + } + } + + public static void glDeleteRenderbuffers(int renderbuffer) + { + if (framebufferSupported) + { + switch (framebufferType) + { + case 0: + GL30.glDeleteRenderbuffers(renderbuffer); + break; + + case 1: + ARBFramebufferObject.glDeleteRenderbuffers(renderbuffer); + break; + + case 2: + EXTFramebufferObject.glDeleteRenderbuffersEXT(renderbuffer); + } + } + } + + public static void glDeleteFramebuffers(int framebufferIn) + { + if (framebufferSupported) + { + switch (framebufferType) + { + case 0: + GL30.glDeleteFramebuffers(framebufferIn); + break; + + case 1: + ARBFramebufferObject.glDeleteFramebuffers(framebufferIn); + break; + + case 2: + EXTFramebufferObject.glDeleteFramebuffersEXT(framebufferIn); + } + } + } + + public static int glGenFramebuffers() + { + if (!framebufferSupported) + { + return -1; + } + else + { + switch (framebufferType) + { + case 0: + return GL30.glGenFramebuffers(); + + case 1: + return ARBFramebufferObject.glGenFramebuffers(); + + case 2: + return EXTFramebufferObject.glGenFramebuffersEXT(); + + default: + return -1; + } + } + } + + public static int glGenRenderbuffers() + { + if (!framebufferSupported) + { + return -1; + } + else + { + switch (framebufferType) + { + case 0: + return GL30.glGenRenderbuffers(); + + case 1: + return ARBFramebufferObject.glGenRenderbuffers(); + + case 2: + return EXTFramebufferObject.glGenRenderbuffersEXT(); + + default: + return -1; + } + } + } + + public static void glRenderbufferStorage(int target, int internalFormat, int width, int height) + { + if (framebufferSupported) + { + switch (framebufferType) + { + case 0: + GL30.glRenderbufferStorage(target, internalFormat, width, height); + break; + + case 1: + ARBFramebufferObject.glRenderbufferStorage(target, internalFormat, width, height); + break; + + case 2: + EXTFramebufferObject.glRenderbufferStorageEXT(target, internalFormat, width, height); + } + } + } + + public static void glFramebufferRenderbuffer(int target, int attachment, int renderBufferTarget, int renderBuffer) + { + if (framebufferSupported) + { + switch (framebufferType) + { + case 0: + GL30.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer); + break; + + case 1: + ARBFramebufferObject.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer); + break; + + case 2: + EXTFramebufferObject.glFramebufferRenderbufferEXT(target, attachment, renderBufferTarget, renderBuffer); + } + } + } + + public static int glCheckFramebufferStatus(int target) + { + if (!framebufferSupported) + { + return -1; + } + else + { + switch (framebufferType) + { + case 0: + return GL30.glCheckFramebufferStatus(target); + + case 1: + return ARBFramebufferObject.glCheckFramebufferStatus(target); + + case 2: + return EXTFramebufferObject.glCheckFramebufferStatusEXT(target); + + default: + return -1; + } + } + } + + public static void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level) + { + if (framebufferSupported) + { + switch (framebufferType) + { + case 0: + GL30.glFramebufferTexture2D(target, attachment, textarget, texture, level); + break; + + case 1: + ARBFramebufferObject.glFramebufferTexture2D(target, attachment, textarget, texture, level); + break; + + case 2: + EXTFramebufferObject.glFramebufferTexture2DEXT(target, attachment, textarget, texture, level); + } + } + } + + public static void setActiveTexture(int texture) + { + if (arbMultitexture) + { + ARBMultitexture.glActiveTextureARB(texture); + } + else + { + GL13.glActiveTexture(texture); + } + } + + public static void setClientActiveTexture(int texture) + { + if (arbMultitexture) + { + ARBMultitexture.glClientActiveTextureARB(texture); + } + else + { + GL13.glClientActiveTexture(texture); + } + } + + public static void setLightmapTextureCoords(int target, float p_77475_1_, float p_77475_2_) + { + if (arbMultitexture) + { + ARBMultitexture.glMultiTexCoord2fARB(target, p_77475_1_, p_77475_2_); + } + else + { + GL13.glMultiTexCoord2f(target, p_77475_1_, p_77475_2_); + } + + if (target == lightmapTexUnit) + { + lastBrightnessX = p_77475_1_; + lastBrightnessY = p_77475_2_; + } + } + + public static void glBlendFunc(int sFactorRGB, int dFactorRGB, int sfactorAlpha, int dfactorAlpha) + { + if (openGL14) + { + if (extBlendFuncSeparate) + { + EXTBlendFuncSeparate.glBlendFuncSeparateEXT(sFactorRGB, dFactorRGB, sfactorAlpha, dfactorAlpha); + } + else + { + GL14.glBlendFuncSeparate(sFactorRGB, dFactorRGB, sfactorAlpha, dfactorAlpha); + } + } + else + { + GL11.glBlendFunc(sFactorRGB, dFactorRGB); + } + } + + public static boolean isFramebufferEnabled() + { + return Config.isFastRender() ? false : (Config.isAntialiasing() ? false : framebufferSupported && Minecraft.getMinecraft().gameSettings.fboEnable); + } + + public static void glBufferData(int p_glBufferData_0_, long p_glBufferData_1_, int p_glBufferData_3_) + { + if (arbVbo) + { + ARBVertexBufferObject.glBufferDataARB(p_glBufferData_0_, p_glBufferData_1_, p_glBufferData_3_); + } + else + { + GL15.glBufferData(p_glBufferData_0_, p_glBufferData_1_, p_glBufferData_3_); + } + } + + public static void glBufferSubData(int p_glBufferSubData_0_, long p_glBufferSubData_1_, ByteBuffer p_glBufferSubData_3_) + { + if (arbVbo) + { + ARBVertexBufferObject.glBufferSubDataARB(p_glBufferSubData_0_, p_glBufferSubData_1_, p_glBufferSubData_3_); + } + else + { + GL15.glBufferSubData(p_glBufferSubData_0_, p_glBufferSubData_1_, p_glBufferSubData_3_); + } + } + + public static void glCopyBufferSubData(int p_glCopyBufferSubData_0_, int p_glCopyBufferSubData_1_, long p_glCopyBufferSubData_2_, long p_glCopyBufferSubData_4_, long p_glCopyBufferSubData_6_) + { + if (openGL31) + { + GL31.glCopyBufferSubData(p_glCopyBufferSubData_0_, p_glCopyBufferSubData_1_, p_glCopyBufferSubData_2_, p_glCopyBufferSubData_4_, p_glCopyBufferSubData_6_); + } + else + { + ARBCopyBuffer.glCopyBufferSubData(p_glCopyBufferSubData_0_, p_glCopyBufferSubData_1_, p_glCopyBufferSubData_2_, p_glCopyBufferSubData_4_, p_glCopyBufferSubData_6_); + } + } + + public static String getCpu() + { + return cpu == null ? "" : cpu; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RegionRenderCache.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RegionRenderCache.java new file mode 100644 index 0000000..cb45f2c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RegionRenderCache.java @@ -0,0 +1,151 @@ +package net.minecraft.client.renderer; + +import java.util.ArrayDeque; +import java.util.Arrays; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3i; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.optifine.DynamicLights; + +public class RegionRenderCache extends ChunkCache +{ + private static final IBlockState DEFAULT_STATE = Blocks.air.getDefaultState(); + private final BlockPos position; + private int[] combinedLights; + private IBlockState[] blockStates; + private static ArrayDeque cacheLights = new ArrayDeque(); + private static ArrayDeque cacheStates = new ArrayDeque(); + private static int maxCacheSize = Config.limit(Runtime.getRuntime().availableProcessors(), 1, 32); + + public RegionRenderCache(World worldIn, BlockPos posFromIn, BlockPos posToIn, int subIn) + { + super(worldIn, posFromIn, posToIn, subIn); + this.position = posFromIn.subtract(new Vec3i(subIn, subIn, subIn)); + int i = 8000; + this.combinedLights = allocateLights(8000); + Arrays.fill((int[])((int[])this.combinedLights), (int) - 1); + this.blockStates = allocateStates(8000); + } + + public TileEntity getTileEntity(BlockPos pos) + { + int i = (pos.getX() >> 4) - this.chunkX; + int j = (pos.getZ() >> 4) - this.chunkZ; + return this.chunkArray[i][j].getTileEntity(pos, Chunk.EnumCreateEntityType.QUEUED); + } + + public int getCombinedLight(BlockPos pos, int lightValue) + { + int i = this.getPositionIndex(pos); + int j = this.combinedLights[i]; + + if (j == -1) + { + j = super.getCombinedLight(pos, lightValue); + + if (Config.isDynamicLights() && !this.getBlockState(pos).getBlock().isOpaqueCube()) + { + j = DynamicLights.getCombinedLight(pos, j); + } + + this.combinedLights[i] = j; + } + + return j; + } + + public IBlockState getBlockState(BlockPos pos) + { + int i = this.getPositionIndex(pos); + IBlockState iblockstate = this.blockStates[i]; + + if (iblockstate == null) + { + iblockstate = this.getBlockStateRaw(pos); + this.blockStates[i] = iblockstate; + } + + return iblockstate; + } + + private IBlockState getBlockStateRaw(BlockPos pos) + { + return super.getBlockState(pos); + } + + private int getPositionIndex(BlockPos p_175630_1_) + { + int i = p_175630_1_.getX() - this.position.getX(); + int j = p_175630_1_.getY() - this.position.getY(); + int k = p_175630_1_.getZ() - this.position.getZ(); + return i * 400 + k * 20 + j; + } + + public void freeBuffers() + { + freeLights(this.combinedLights); + freeStates(this.blockStates); + } + + private static int[] allocateLights(int p_allocateLights_0_) + { + synchronized (cacheLights) + { + int[] aint = (int[])cacheLights.pollLast(); + + if (aint == null || aint.length < p_allocateLights_0_) + { + aint = new int[p_allocateLights_0_]; + } + + return aint; + } + } + + public static void freeLights(int[] p_freeLights_0_) + { + synchronized (cacheLights) + { + if (cacheLights.size() < maxCacheSize) + { + cacheLights.add(p_freeLights_0_); + } + } + } + + private static IBlockState[] allocateStates(int p_allocateStates_0_) + { + synchronized (cacheStates) + { + IBlockState[] aiblockstate = (IBlockState[])cacheStates.pollLast(); + + if (aiblockstate != null && aiblockstate.length >= p_allocateStates_0_) + { + Arrays.fill(aiblockstate, (Object)null); + } + else + { + aiblockstate = new IBlockState[p_allocateStates_0_]; + } + + return aiblockstate; + } + } + + public static void freeStates(IBlockState[] p_freeStates_0_) + { + synchronized (cacheStates) + { + if (cacheStates.size() < maxCacheSize) + { + cacheStates.add(p_freeStates_0_); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RegionRenderCacheBuilder.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RegionRenderCacheBuilder.java new file mode 100644 index 0000000..9946440 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RegionRenderCacheBuilder.java @@ -0,0 +1,26 @@ +package net.minecraft.client.renderer; + +import net.minecraft.util.EnumWorldBlockLayer; + +public class RegionRenderCacheBuilder +{ + private final WorldRenderer[] worldRenderers = new WorldRenderer[EnumWorldBlockLayer.values().length]; + + public RegionRenderCacheBuilder() + { + this.worldRenderers[EnumWorldBlockLayer.SOLID.ordinal()] = new WorldRenderer(2097152); + this.worldRenderers[EnumWorldBlockLayer.CUTOUT.ordinal()] = new WorldRenderer(131072); + this.worldRenderers[EnumWorldBlockLayer.CUTOUT_MIPPED.ordinal()] = new WorldRenderer(131072); + this.worldRenderers[EnumWorldBlockLayer.TRANSLUCENT.ordinal()] = new WorldRenderer(262144); + } + + public WorldRenderer getWorldRendererByLayer(EnumWorldBlockLayer layer) + { + return this.worldRenderers[layer.ordinal()]; + } + + public WorldRenderer getWorldRendererByLayerId(int id) + { + return this.worldRenderers[id]; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderGlobal.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderGlobal.java new file mode 100644 index 0000000..f2e014a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderGlobal.java @@ -0,0 +1,2876 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.gson.JsonSyntaxException; + +import java.io.IOException; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Deque; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletableFuture; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockEnderChest; +import net.minecraft.block.BlockSign; +import net.minecraft.block.BlockSkull; +import net.minecraft.block.Block.EnumOffsetType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntitySpellParticleFX; +import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; +import net.minecraft.client.renderer.chunk.CompiledChunk; +import net.minecraft.client.renderer.chunk.IRenderChunkFactory; +import net.minecraft.client.renderer.chunk.ListChunkFactory; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.client.renderer.chunk.VboChunkFactory; +import net.minecraft.client.renderer.chunk.VisGraph; +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySignRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexBuffer; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumType; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemRecord; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ClassInheritanceMultiMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Matrix4f; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.util.Vector3d; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.IWorldAccess; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.optifine.CustomColors; +import net.optifine.CustomSky; +import net.optifine.DynamicLights; +import net.optifine.Lagometer; +import net.optifine.RandomEntities; +import net.optifine.SmartAnimations; +import net.optifine.model.BlockModelUtils; +import net.optifine.reflect.Reflector; +import net.optifine.render.ChunkVisibility; +import net.optifine.render.CloudRenderer; +import net.optifine.render.RenderEnv; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersRender; +import net.optifine.shaders.ShadowUtils; +import net.optifine.shaders.gui.GuiShaderOptions; +import net.optifine.util.ChunkUtils; +import net.optifine.util.RenderChunkUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.vector.Vector3f; +import org.lwjgl.util.vector.Vector4f; + +public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListener { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationMoonPhasesPng = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation locationSunPng = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation locationCloudsPng = new ResourceLocation("textures/environment/clouds.png"); + private static final ResourceLocation locationEndSkyPng = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation locationForcefieldPng = new ResourceLocation("textures/misc/forcefield.png"); + public final Minecraft mc; + private final TextureManager renderEngine; + private final RenderManager renderManager; + private WorldClient theWorld; + private Set chunksToUpdate = Sets.newLinkedHashSet(); + private List renderInfos = Lists.newArrayListWithCapacity(69696); + private final Set setTileEntities = Sets.newHashSet(); + private ViewFrustum viewFrustum; + private int starGLCallList = -1; + private int glSkyList = -1; + private int glSkyList2 = -1; + private VertexFormat vertexBufferFormat; + private VertexBuffer starVBO; + private VertexBuffer skyVBO; + private VertexBuffer sky2VBO; + private int cloudTickCounter; + public final Map damagedBlocks = Maps.newHashMap(); + private final Map mapSoundPositions = Maps.newHashMap(); + private final TextureAtlasSprite[] destroyBlockIcons = new TextureAtlasSprite[10]; + private Framebuffer entityOutlineFramebuffer; + private ShaderGroup entityOutlineShader; + private double frustumUpdatePosX = Double.MIN_VALUE; + private double frustumUpdatePosY = Double.MIN_VALUE; + private double frustumUpdatePosZ = Double.MIN_VALUE; + private int frustumUpdatePosChunkX = Integer.MIN_VALUE; + private int frustumUpdatePosChunkY = Integer.MIN_VALUE; + private int frustumUpdatePosChunkZ = Integer.MIN_VALUE; + private double lastViewEntityX = Double.MIN_VALUE; + private double lastViewEntityY = Double.MIN_VALUE; + private double lastViewEntityZ = Double.MIN_VALUE; + private double lastViewEntityPitch = Double.MIN_VALUE; + private double lastViewEntityYaw = Double.MIN_VALUE; + private final ChunkRenderDispatcher renderDispatcher = new ChunkRenderDispatcher(); + private ChunkRenderContainer renderContainer; + private int renderDistanceChunks = -1; + private int renderEntitiesStartupCounter = 2; + private int countEntitiesTotal; + private int countEntitiesRendered; + private int countEntitiesHidden; + private boolean debugFixTerrainFrustum = false; + private ClippingHelper debugFixedClippingHelper; + private final Vector4f[] debugTerrainMatrix = new Vector4f[8]; + private final Vector3d debugTerrainFrustumPosition = new Vector3d(); + private boolean vboEnabled = false; + IRenderChunkFactory renderChunkFactory; + private double prevRenderSortX; + private double prevRenderSortY; + private double prevRenderSortZ; + public boolean displayListEntitiesDirty = true; + private CloudRenderer cloudRenderer; + public Entity renderedEntity; + public Set chunksToResortTransparency = new LinkedHashSet(); + public Set chunksToUpdateForced = new LinkedHashSet(); + private Deque visibilityDeque = new ArrayDeque(); + private List renderInfosEntities = new ArrayList(1024); + private List renderInfosTileEntities = new ArrayList(1024); + private List renderInfosNormal = new ArrayList(1024); + private List renderInfosEntitiesNormal = new ArrayList(1024); + private List renderInfosTileEntitiesNormal = new ArrayList(1024); + private List renderInfosShadow = new ArrayList(1024); + private List renderInfosEntitiesShadow = new ArrayList(1024); + private List renderInfosTileEntitiesShadow = new ArrayList(1024); + private int renderDistance = 0; + private int renderDistanceSq = 0; + private static final Set SET_ALL_FACINGS = Collections.unmodifiableSet(new HashSet(Arrays.asList(EnumFacing.VALUES))); + private int countTileEntitiesRendered; + private IChunkProvider worldChunkProvider = null; + private LongHashMap worldChunkProviderMap = null; + private int countLoadedChunksPrev = 0; + private RenderEnv renderEnv = new RenderEnv(Blocks.air.getDefaultState(), new BlockPos(0, 0, 0)); + public boolean renderOverlayDamaged = false; + public boolean renderOverlayEyes = false; + private boolean firstWorldLoad = false; + private static int renderEntitiesCounter = 0; + + public RenderGlobal(Minecraft mcIn) { + this.cloudRenderer = new CloudRenderer(mcIn); + this.mc = mcIn; + this.renderManager = mcIn.getRenderManager(); + this.renderEngine = mcIn.getTextureManager(); + this.renderEngine.bindTexture(locationForcefieldPng); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GlStateManager.bindTexture(0); + this.updateDestroyBlockIcons(); + this.vboEnabled = OpenGlHelper.useVbo(); + + if (this.vboEnabled) { + this.renderContainer = new VboRenderList(); + this.renderChunkFactory = new VboChunkFactory(); + } else { + this.renderContainer = new RenderList(); + this.renderChunkFactory = new ListChunkFactory(); + } + + this.vertexBufferFormat = new VertexFormat(); + this.vertexBufferFormat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.POSITION, 3)); + this.generateStars(); + this.generateSky(); + this.generateSky2(); + } + + public void onResourceManagerReload(IResourceManager resourceManager) { + this.updateDestroyBlockIcons(); + } + + private void updateDestroyBlockIcons() { + TextureMap texturemap = this.mc.getTextureMapBlocks(); + + for (int i = 0; i < this.destroyBlockIcons.length; ++i) { + this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i); + } + } + + public void makeEntityOutlineShader() { + if (OpenGlHelper.shadersSupported) { + if (ShaderLinkHelper.getStaticShaderLinkHelper() == null) { + ShaderLinkHelper.setNewStaticShaderLinkHelper(); + } + + ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json"); + + try { + this.entityOutlineShader = new ShaderGroup(this.mc.getTextureManager(), this.mc.getResourceManager(), this.mc.getFramebuffer(), resourcelocation); + this.entityOutlineShader.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + this.entityOutlineFramebuffer = this.entityOutlineShader.getFramebufferRaw("final"); + } catch (IOException ioexception) { + logger.warn((String) ("Failed to load shader: " + resourcelocation), (Throwable) ioexception); + this.entityOutlineShader = null; + this.entityOutlineFramebuffer = null; + } catch (JsonSyntaxException jsonsyntaxexception) { + logger.warn((String) ("Failed to load shader: " + resourcelocation), (Throwable) jsonsyntaxexception); + this.entityOutlineShader = null; + this.entityOutlineFramebuffer = null; + } + } else { + this.entityOutlineShader = null; + this.entityOutlineFramebuffer = null; + } + } + + public void renderEntityOutlineFramebuffer() { + if (this.isRenderEntityOutlines()) { + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1); + this.entityOutlineFramebuffer.framebufferRenderExt(this.mc.displayWidth, this.mc.displayHeight, false); + GlStateManager.disableBlend(); + } + } + + protected boolean isRenderEntityOutlines() { + return !Config.isFastRender() && !Config.isShaders() && !Config.isAntialiasing() ? this.entityOutlineFramebuffer != null && this.entityOutlineShader != null && this.mc.thePlayer != null && this.mc.thePlayer.isSpectator() && this.mc.gameSettings.keyBindSpectatorOutlines.isKeyDown() : false; + } + + private void generateSky2() { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + if (this.sky2VBO != null) { + this.sky2VBO.deleteGlBuffers(); + } + + if (this.glSkyList2 >= 0) { + GLAllocation.deleteDisplayLists(this.glSkyList2); + this.glSkyList2 = -1; + } + + if (this.vboEnabled) { + this.sky2VBO = new VertexBuffer(this.vertexBufferFormat); + this.renderSky(worldrenderer, -16.0F, true); + worldrenderer.finishDrawing(); + worldrenderer.reset(); + this.sky2VBO.bufferData(worldrenderer.getByteBuffer()); + } else { + this.glSkyList2 = GLAllocation.generateDisplayLists(1); + GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE); + this.renderSky(worldrenderer, -16.0F, true); + tessellator.draw(); + GL11.glEndList(); + } + } + + private void generateSky() { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + if (this.skyVBO != null) { + this.skyVBO.deleteGlBuffers(); + } + + if (this.glSkyList >= 0) { + GLAllocation.deleteDisplayLists(this.glSkyList); + this.glSkyList = -1; + } + + if (this.vboEnabled) { + this.skyVBO = new VertexBuffer(this.vertexBufferFormat); + this.renderSky(worldrenderer, 16.0F, false); + worldrenderer.finishDrawing(); + worldrenderer.reset(); + this.skyVBO.bufferData(worldrenderer.getByteBuffer()); + } else { + this.glSkyList = GLAllocation.generateDisplayLists(1); + GL11.glNewList(this.glSkyList, GL11.GL_COMPILE); + this.renderSky(worldrenderer, 16.0F, false); + tessellator.draw(); + GL11.glEndList(); + } + } + + private void renderSky(WorldRenderer worldRendererIn, float posY, boolean reverseX) { + int i = 64; + int j = 6; + worldRendererIn.begin(7, DefaultVertexFormats.POSITION); + int k = (this.renderDistance / 64 + 1) * 64 + 64; + + for (int l = -k; l <= k; l += 64) { + for (int i1 = -k; i1 <= k; i1 += 64) { + float f = (float) l; + float f1 = (float) (l + 64); + + if (reverseX) { + f1 = (float) l; + f = (float) (l + 64); + } + + worldRendererIn.pos((double) f, (double) posY, (double) i1).endVertex(); + worldRendererIn.pos((double) f1, (double) posY, (double) i1).endVertex(); + worldRendererIn.pos((double) f1, (double) posY, (double) (i1 + 64)).endVertex(); + worldRendererIn.pos((double) f, (double) posY, (double) (i1 + 64)).endVertex(); + } + } + } + + private void generateStars() { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + if (this.starVBO != null) { + this.starVBO.deleteGlBuffers(); + } + + if (this.starGLCallList >= 0) { + GLAllocation.deleteDisplayLists(this.starGLCallList); + this.starGLCallList = -1; + } + + if (this.vboEnabled) { + this.starVBO = new VertexBuffer(this.vertexBufferFormat); + this.renderStars(worldrenderer); + worldrenderer.finishDrawing(); + worldrenderer.reset(); + this.starVBO.bufferData(worldrenderer.getByteBuffer()); + } else { + this.starGLCallList = GLAllocation.generateDisplayLists(1); + GlStateManager.pushMatrix(); + GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE); + this.renderStars(worldrenderer); + tessellator.draw(); + GL11.glEndList(); + GlStateManager.popMatrix(); + } + } + + private void renderStars(WorldRenderer worldRendererIn) { + Random random = new Random(10842L); + worldRendererIn.begin(7, DefaultVertexFormats.POSITION); + + for (int i = 0; i < 1500; ++i) { + double d0 = (double) (random.nextFloat() * 2.0F - 1.0F); + double d1 = (double) (random.nextFloat() * 2.0F - 1.0F); + double d2 = (double) (random.nextFloat() * 2.0F - 1.0F); + double d3 = (double) (0.15F + random.nextFloat() * 0.1F); + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d4 < 1.0D && d4 > 0.01D) { + d4 = 1.0D / Math.sqrt(d4); + d0 = d0 * d4; + d1 = d1 * d4; + d2 = d2 * d4; + double d5 = d0 * 100.0D; + double d6 = d1 * 100.0D; + double d7 = d2 * 100.0D; + double d8 = Math.atan2(d0, d2); + double d9 = Math.sin(d8); + double d10 = Math.cos(d8); + double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1); + double d12 = Math.sin(d11); + double d13 = Math.cos(d11); + double d14 = random.nextDouble() * Math.PI * 2.0D; + double d15 = Math.sin(d14); + double d16 = Math.cos(d14); + + for (int j = 0; j < 4; ++j) { + double d17 = 0.0D; + double d18 = (double) ((j & 2) - 1) * d3; + double d19 = (double) ((j + 1 & 2) - 1) * d3; + double d20 = 0.0D; + double d21 = d18 * d16 - d19 * d15; + double d22 = d19 * d16 + d18 * d15; + double d23 = d21 * d12 + 0.0D * d13; + double d24 = 0.0D * d12 - d21 * d13; + double d25 = d24 * d9 - d22 * d10; + double d26 = d22 * d9 + d24 * d10; + worldRendererIn.pos(d5 + d25, d6 + d23, d7 + d26).endVertex(); + } + } + } + } + + public void setWorldAndLoadRenderers(WorldClient worldClientIn) { + if (this.theWorld != null) { + this.theWorld.removeWorldAccess(this); + } + + this.frustumUpdatePosX = Double.MIN_VALUE; + this.frustumUpdatePosY = Double.MIN_VALUE; + this.frustumUpdatePosZ = Double.MIN_VALUE; + this.frustumUpdatePosChunkX = Integer.MIN_VALUE; + this.frustumUpdatePosChunkY = Integer.MIN_VALUE; + this.frustumUpdatePosChunkZ = Integer.MIN_VALUE; + this.renderManager.set(worldClientIn); + this.theWorld = worldClientIn; + + if (Config.isDynamicLights()) { + DynamicLights.clear(); + } + + ChunkVisibility.reset(); + this.worldChunkProvider = null; + this.worldChunkProviderMap = null; + this.renderEnv.reset((IBlockState) null, (BlockPos) null); + Shaders.checkWorldChanged(this.theWorld); + + if (worldClientIn != null) { + worldClientIn.addWorldAccess(this); + this.loadRenderers(); + } else { + this.chunksToUpdate.clear(); + this.clearRenderInfos(); + + if (this.viewFrustum != null) { + this.viewFrustum.deleteGlResources(); + } + + this.viewFrustum = null; + } + } + + public void loadRenderers() { + + if (this.theWorld != null) { + this.displayListEntitiesDirty = true; + Blocks.leaves.setGraphicsLevel(Config.isTreesFancy()); + Blocks.leaves2.setGraphicsLevel(Config.isTreesFancy()); + BlockModelRenderer.updateAoLightValue(); + + if (Config.isDynamicLights()) { + DynamicLights.clear(); + } + + SmartAnimations.update(); + this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks; + this.renderDistance = this.renderDistanceChunks * 16; + this.renderDistanceSq = this.renderDistance * this.renderDistance; + boolean flag = this.vboEnabled; + this.vboEnabled = OpenGlHelper.useVbo(); + + if (flag && !this.vboEnabled) { + this.renderContainer = new RenderList(); + this.renderChunkFactory = new ListChunkFactory(); + } else if (!flag && this.vboEnabled) { + this.renderContainer = new VboRenderList(); + this.renderChunkFactory = new VboChunkFactory(); + } + + this.generateStars(); + this.generateSky(); + this.generateSky2(); + + if (this.viewFrustum != null) { + this.viewFrustum.deleteGlResources(); + } + + this.stopChunkUpdates(); + + synchronized (this.setTileEntities) { + this.setTileEntities.clear(); + } + + this.viewFrustum = new ViewFrustum(this.theWorld, this.mc.gameSettings.renderDistanceChunks, this, this.renderChunkFactory); + + if (this.theWorld != null) { + Entity entity = this.mc.getRenderViewEntity(); + + if (entity != null) { + this.viewFrustum.updateChunkPositions(entity.posX, entity.posZ); + } + } + + this.renderEntitiesStartupCounter = 2; + } + + if (this.mc.thePlayer == null) { + this.firstWorldLoad = true; + } + + } + + protected void stopChunkUpdates() { + this.chunksToUpdate.clear(); + this.renderDispatcher.stopChunkUpdates(); + } + + public void createBindEntityOutlineFbs(int width, int height) { + if (OpenGlHelper.shadersSupported && this.entityOutlineShader != null) { + this.entityOutlineShader.createBindFramebuffers(width, height); + } + } + + public void renderEntities(Entity renderViewEntity, ICamera camera, float partialTicks) { + int i = 0; + + if (Reflector.MinecraftForgeClient_getRenderPass.exists()) { + i = Reflector.callInt(Reflector.MinecraftForgeClient_getRenderPass, new Object[0]); + } + + if (this.renderEntitiesStartupCounter > 0) { + if (i > 0) { + return; + } + + --this.renderEntitiesStartupCounter; + } else { + double d0 = renderViewEntity.prevPosX + (renderViewEntity.posX - renderViewEntity.prevPosX) * (double) partialTicks; + double d1 = renderViewEntity.prevPosY + (renderViewEntity.posY - renderViewEntity.prevPosY) * (double) partialTicks; + double d2 = renderViewEntity.prevPosZ + (renderViewEntity.posZ - renderViewEntity.prevPosZ) * (double) partialTicks; + this.theWorld.theProfiler.startSection("prepare"); + TileEntityRendererDispatcher.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRendererObj, this.mc.getRenderViewEntity(), partialTicks); + this.renderManager.cacheActiveRenderInfo(this.theWorld, this.mc.fontRendererObj, this.mc.getRenderViewEntity(), this.mc.pointedEntity, this.mc.gameSettings, partialTicks); + ++renderEntitiesCounter; + + if (i == 0) { + this.countEntitiesTotal = 0; + this.countEntitiesRendered = 0; + this.countEntitiesHidden = 0; + this.countTileEntitiesRendered = 0; + } + + Entity entity = this.mc.getRenderViewEntity(); + double d3 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks; + double d4 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks; + double d5 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks; + TileEntityRendererDispatcher.staticPlayerX = d3; + TileEntityRendererDispatcher.staticPlayerY = d4; + TileEntityRendererDispatcher.staticPlayerZ = d5; + this.renderManager.setRenderPosition(d3, d4, d5); + this.mc.entityRenderer.enableLightmap(); + this.theWorld.theProfiler.endStartSection("global"); + List list = this.theWorld.getLoadedEntityList(); + + if (i == 0) { + this.countEntitiesTotal = list.size(); + } + + if (Config.isFogOff() && this.mc.entityRenderer.fogStandard) { + GlStateManager.disableFog(); + } + + boolean flag = Reflector.ForgeEntity_shouldRenderInPass.exists(); + boolean flag1 = Reflector.ForgeTileEntity_shouldRenderInPass.exists(); + + for (int j = 0; j < this.theWorld.weatherEffects.size(); ++j) { + Entity entity1 = (Entity) this.theWorld.weatherEffects.get(j); + + if (!flag || Reflector.callBoolean(entity1, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) { + ++this.countEntitiesRendered; + + if (entity1.isInRangeToRender3d(d0, d1, d2)) { + this.renderManager.renderEntitySimple(entity1, partialTicks); + } + } + } + + if (this.isRenderEntityOutlines()) { + GlStateManager.depthFunc(519); + GlStateManager.disableFog(); + this.entityOutlineFramebuffer.framebufferClear(); + this.entityOutlineFramebuffer.bindFramebuffer(false); + this.theWorld.theProfiler.endStartSection("entityOutlines"); + RenderHelper.disableStandardItemLighting(); + this.renderManager.setRenderOutlines(true); + + for (int k = 0; k < list.size(); ++k) { + Entity entity3 = (Entity) list.get(k); + boolean flag2 = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase) this.mc.getRenderViewEntity()).isPlayerSleeping(); + boolean flag3 = entity3.isInRangeToRender3d(d0, d1, d2) && (entity3.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(entity3.getEntityBoundingBox()) || entity3.riddenByEntity == this.mc.thePlayer) && entity3 instanceof EntityPlayer; + + if ((entity3 != this.mc.getRenderViewEntity() || this.mc.gameSettings.thirdPersonView != 0 || flag2) && flag3) { + this.renderManager.renderEntitySimple(entity3, partialTicks); + } + } + + this.renderManager.setRenderOutlines(false); + RenderHelper.enableStandardItemLighting(); + GlStateManager.depthMask(false); + this.entityOutlineShader.loadShaderGroup(partialTicks); + GlStateManager.enableLighting(); + GlStateManager.depthMask(true); + this.mc.getFramebuffer().bindFramebuffer(false); + GlStateManager.enableFog(); + GlStateManager.enableBlend(); + GlStateManager.enableColorMaterial(); + GlStateManager.depthFunc(515); + GlStateManager.enableDepth(); + GlStateManager.enableAlpha(); + } + + this.theWorld.theProfiler.endStartSection("entities"); + boolean flag6 = Config.isShaders(); + + if (flag6) { + Shaders.beginEntities(); + } + + RenderItemFrame.updateItemRenderDistance(); + boolean flag7 = this.mc.gameSettings.fancyGraphics; + this.mc.gameSettings.fancyGraphics = Config.isDroppedItemsFancy(); + boolean flag8 = Shaders.isShadowPass && !this.mc.thePlayer.isSpectator(); + label926: + + for (Object e : this.renderInfosEntities) { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = (ContainerLocalRenderInformation) e; + Chunk chunk = renderglobal$containerlocalrenderinformation.renderChunk.getChunk(); + ClassInheritanceMultiMap classinheritancemultimap = chunk.getEntityLists()[renderglobal$containerlocalrenderinformation.renderChunk.getPosition().getY() / 16]; + + if (!classinheritancemultimap.isEmpty()) { + Iterator iterator = classinheritancemultimap.iterator(); + + while (true) { + Entity entity2; + boolean flag4; + + while (true) { + if (!iterator.hasNext()) { + continue label926; + } + + entity2 = (Entity) iterator.next(); + + if (!flag || Reflector.callBoolean(entity2, Reflector.ForgeEntity_shouldRenderInPass, Integer.valueOf(i))) { + flag4 = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.riddenByEntity == this.mc.thePlayer; + + if (!flag4) { + break; + } + + boolean flag5 = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase) this.mc.getRenderViewEntity()).isPlayerSleeping(); + + if ((entity2 != this.mc.getRenderViewEntity() || flag8 || this.mc.gameSettings.thirdPersonView != 0 || flag5) && (entity2.posY < 0.0D || entity2.posY >= 256.0D || this.theWorld.isBlockLoaded(new BlockPos(entity2)))) { + ++this.countEntitiesRendered; + this.renderedEntity = entity2; + + if (flag6) { + Shaders.nextEntity(entity2); + } + + this.renderManager.renderEntitySimple(entity2, partialTicks); + + this.renderedEntity = null; + break; + } + } + } + + if (!flag4 && entity2 instanceof EntityWitherSkull && (!flag || Reflector.callBoolean(entity2, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)}))) { + this.renderedEntity = entity2; + + if (flag6) { + Shaders.nextEntity(entity2); + } + + this.mc.getRenderManager().renderWitherSkull(entity2, partialTicks); + this.renderedEntity = null; + } + } + } + } + + this.mc.gameSettings.fancyGraphics = flag7; + + if (flag6) { + Shaders.endEntities(); + Shaders.beginBlockEntities(); + } + + this.theWorld.theProfiler.endStartSection("blockentities"); + RenderHelper.enableStandardItemLighting(); + + if (Reflector.ForgeTileEntity_hasFastRenderer.exists()) { + TileEntityRendererDispatcher.instance.preDrawBatch(); + } + + TileEntitySignRenderer.updateTextRenderDistance(); + label1408: + + for (Object renderglobal$containerlocalrenderinformation10 : this.renderInfosTileEntities) { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = (RenderGlobal.ContainerLocalRenderInformation) renderglobal$containerlocalrenderinformation10; + List list1 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk().getTileEntities(); + + if (!list1.isEmpty()) { + Iterator iterator1 = list1.iterator(); + + while (true) { + TileEntity tileentity1; + + while (true) { + if (!iterator1.hasNext()) { + continue label1408; + } + + tileentity1 = (TileEntity) iterator1.next(); + + if (!flag1) { + break; + } + + if (Reflector.callBoolean(tileentity1, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) { + AxisAlignedBB axisalignedbb1 = (AxisAlignedBB) Reflector.call(tileentity1, Reflector.ForgeTileEntity_getRenderBoundingBox, new Object[0]); + + if (axisalignedbb1 == null || camera.isBoundingBoxInFrustum(axisalignedbb1)) { + break; + } + } + } + + if (flag6) { + Shaders.nextBlockEntity(tileentity1); + } + + TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, -1); + ++this.countTileEntitiesRendered; + } + } + } + + synchronized (this.setTileEntities) { + for (TileEntity tileentity : this.setTileEntities) { + if (!flag1 || Reflector.callBoolean(tileentity, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) { + if (flag6) { + Shaders.nextBlockEntity(tileentity); + } + + TileEntityRendererDispatcher.instance.renderTileEntity(tileentity, partialTicks, -1); + } + } + } + + if (Reflector.ForgeTileEntity_hasFastRenderer.exists()) { + TileEntityRendererDispatcher.instance.drawBatch(i); + } + + this.renderOverlayDamaged = true; + this.preRenderDamagedBlocks(); + + for (DestroyBlockProgress destroyblockprogress : this.damagedBlocks.values()) { + BlockPos blockpos = destroyblockprogress.getPosition(); + TileEntity tileentity2 = this.theWorld.getTileEntity(blockpos); + + if (tileentity2 instanceof TileEntityChest) { + TileEntityChest tileentitychest = (TileEntityChest) tileentity2; + + if (tileentitychest.adjacentChestXNeg != null) { + blockpos = blockpos.offset(EnumFacing.WEST); + tileentity2 = this.theWorld.getTileEntity(blockpos); + } else if (tileentitychest.adjacentChestZNeg != null) { + blockpos = blockpos.offset(EnumFacing.NORTH); + tileentity2 = this.theWorld.getTileEntity(blockpos); + } + } + + Block block = this.theWorld.getBlockState(blockpos).getBlock(); + boolean flag9; + + if (flag1) { + flag9 = false; + + if (tileentity2 != null && Reflector.callBoolean(tileentity2, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)}) && Reflector.callBoolean(tileentity2, Reflector.ForgeTileEntity_canRenderBreaking, new Object[0])) { + AxisAlignedBB axisalignedbb = (AxisAlignedBB) Reflector.call(tileentity2, Reflector.ForgeTileEntity_getRenderBoundingBox, new Object[0]); + + if (axisalignedbb != null) { + flag9 = camera.isBoundingBoxInFrustum(axisalignedbb); + } + } + } else { + flag9 = tileentity2 != null && (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull); + } + + if (flag9) { + if (flag6) { + Shaders.nextBlockEntity(tileentity2); + } + + TileEntityRendererDispatcher.instance.renderTileEntity(tileentity2, partialTicks, destroyblockprogress.getPartialBlockDamage()); + } + } + + this.postRenderDamagedBlocks(); + this.renderOverlayDamaged = false; + + if (flag6) { + Shaders.endBlockEntities(); + } + + --renderEntitiesCounter; + this.mc.entityRenderer.disableLightmap(); + this.mc.mcProfiler.endSection(); + } + } + + public String getDebugInfoRenders() { + int i = this.viewFrustum.renderChunks.length; + int j = 0; + + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) { + CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk; + + if (compiledchunk != CompiledChunk.DUMMY && !compiledchunk.isEmpty()) { + ++j; + } + } + + return String.format("C: %d/%d %sD: %d, %s", new Object[]{Integer.valueOf(j), Integer.valueOf(i), this.mc.renderChunksMany ? "(s) " : "", Integer.valueOf(this.renderDistanceChunks), this.renderDispatcher.getDebugInfo()}); + } + + public String getDebugInfoEntities() { + return "E: " + this.countEntitiesRendered + "/" + this.countEntitiesTotal + ", B: " + this.countEntitiesHidden + ", I: " + (this.countEntitiesTotal - this.countEntitiesHidden - this.countEntitiesRendered) + ", " + Config.getVersionDebug(); + } + + public void setupTerrain(Entity viewEntity, double partialTicks, ICamera camera, int frameCount, boolean playerSpectator) { + if (this.mc.gameSettings.renderDistanceChunks != this.renderDistanceChunks) { + this.loadRenderers(); + } + + this.theWorld.theProfiler.startSection("camera"); + double d0 = viewEntity.posX - this.frustumUpdatePosX; + double d1 = viewEntity.posY - this.frustumUpdatePosY; + double d2 = viewEntity.posZ - this.frustumUpdatePosZ; + + if (this.frustumUpdatePosChunkX != viewEntity.chunkCoordX || this.frustumUpdatePosChunkY != viewEntity.chunkCoordY || this.frustumUpdatePosChunkZ != viewEntity.chunkCoordZ || d0 * d0 + d1 * d1 + d2 * d2 > 16.0D) { + this.frustumUpdatePosX = viewEntity.posX; + this.frustumUpdatePosY = viewEntity.posY; + this.frustumUpdatePosZ = viewEntity.posZ; + this.frustumUpdatePosChunkX = viewEntity.chunkCoordX; + this.frustumUpdatePosChunkY = viewEntity.chunkCoordY; + this.frustumUpdatePosChunkZ = viewEntity.chunkCoordZ; + this.viewFrustum.updateChunkPositions(viewEntity.posX, viewEntity.posZ); + } + + if (Config.isDynamicLights()) { + DynamicLights.update(this); + } + + this.theWorld.theProfiler.endStartSection("renderlistcamera"); + double d3 = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * partialTicks; + double d4 = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * partialTicks; + double d5 = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks; + this.renderContainer.initialize(d3, d4, d5); + this.theWorld.theProfiler.endStartSection("cull"); + + if (this.debugFixedClippingHelper != null) { + Frustum frustum = new Frustum(this.debugFixedClippingHelper); + frustum.setPosition(this.debugTerrainFrustumPosition.x, this.debugTerrainFrustumPosition.y, this.debugTerrainFrustumPosition.z); + camera = frustum; + } + + this.mc.mcProfiler.endStartSection("culling"); + BlockPos blockpos = new BlockPos(d3, d4 + (double) viewEntity.getEyeHeight(), d5); + RenderChunk renderchunk = this.viewFrustum.getRenderChunk(blockpos); + new BlockPos(MathHelper.floor_double(d3 / 16.0D) * 16, MathHelper.floor_double(d4 / 16.0D) * 16, MathHelper.floor_double(d5 / 16.0D) * 16); + this.displayListEntitiesDirty = this.displayListEntitiesDirty || !this.chunksToUpdate.isEmpty() || viewEntity.posX != this.lastViewEntityX || viewEntity.posY != this.lastViewEntityY || viewEntity.posZ != this.lastViewEntityZ || (double) viewEntity.rotationPitch != this.lastViewEntityPitch || (double) viewEntity.rotationYaw != this.lastViewEntityYaw; + this.lastViewEntityX = viewEntity.posX; + this.lastViewEntityY = viewEntity.posY; + this.lastViewEntityZ = viewEntity.posZ; + this.lastViewEntityPitch = (double) viewEntity.rotationPitch; + this.lastViewEntityYaw = (double) viewEntity.rotationYaw; + boolean flag = this.debugFixedClippingHelper != null; + this.mc.mcProfiler.endStartSection("update"); + Lagometer.timerVisibility.start(); + int i = this.getCountLoadedChunks(); + + if (i != this.countLoadedChunksPrev) { + this.countLoadedChunksPrev = i; + this.displayListEntitiesDirty = true; + } + + int j = 256; + + if (!ChunkVisibility.isFinished()) { + this.displayListEntitiesDirty = true; + } + + if (!flag && this.displayListEntitiesDirty && Config.isIntegratedServerRunning()) { + j = ChunkVisibility.getMaxChunkY(this.theWorld, viewEntity, this.renderDistanceChunks); + } + + RenderChunk renderchunk1 = this.viewFrustum.getRenderChunk(new BlockPos(viewEntity.posX, viewEntity.posY, viewEntity.posZ)); + + if (Shaders.isShadowPass) { + this.renderInfos = this.renderInfosShadow; + this.renderInfosEntities = this.renderInfosEntitiesShadow; + this.renderInfosTileEntities = this.renderInfosTileEntitiesShadow; + + if (!flag && this.displayListEntitiesDirty) { + this.clearRenderInfos(); + + if (renderchunk1 != null && renderchunk1.getPosition().getY() > j) { + this.renderInfosEntities.add(renderchunk1.getRenderInfo()); + } + + Iterator iterator = ShadowUtils.makeShadowChunkIterator(this.theWorld, partialTicks, viewEntity, this.renderDistanceChunks, this.viewFrustum); + + while (iterator.hasNext()) { + RenderChunk renderchunk2 = (RenderChunk) iterator.next(); + + if (renderchunk2 != null && renderchunk2.getPosition().getY() <= j) { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = renderchunk2.getRenderInfo(); + + if (!renderchunk2.compiledChunk.isEmpty() || renderchunk2.isNeedsUpdate()) { + this.renderInfos.add(renderglobal$containerlocalrenderinformation); + } + + if (ChunkUtils.hasEntities(renderchunk2.getChunk())) { + this.renderInfosEntities.add(renderglobal$containerlocalrenderinformation); + } + + if (renderchunk2.getCompiledChunk().getTileEntities().size() > 0) { + this.renderInfosTileEntities.add(renderglobal$containerlocalrenderinformation); + } + } + } + } + } else { + this.renderInfos = this.renderInfosNormal; + this.renderInfosEntities = this.renderInfosEntitiesNormal; + this.renderInfosTileEntities = this.renderInfosTileEntitiesNormal; + } + + if (!flag && this.displayListEntitiesDirty && !Shaders.isShadowPass) { + this.displayListEntitiesDirty = false; + this.clearRenderInfos(); + this.visibilityDeque.clear(); + Deque deque = this.visibilityDeque; + boolean flag1 = this.mc.renderChunksMany; + + if (renderchunk != null && renderchunk.getPosition().getY() <= j) { + boolean flag2 = false; + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation4 = new RenderGlobal.ContainerLocalRenderInformation(renderchunk, (EnumFacing) null, 0); + Set set1 = SET_ALL_FACINGS; + + if (set1.size() == 1) { + Vector3f vector3f = this.getViewVector(viewEntity, partialTicks); + EnumFacing enumfacing2 = EnumFacing.getFacingFromVector(vector3f.x, vector3f.y, vector3f.z).getOpposite(); + set1.remove(enumfacing2); + } + + if (set1.isEmpty()) { + flag2 = true; + } + + if (flag2 && !playerSpectator) { + this.renderInfos.add(renderglobal$containerlocalrenderinformation4); + } else { + if (playerSpectator && this.theWorld.getBlockState(blockpos).getBlock().isOpaqueCube()) { + flag1 = false; + } + + renderchunk.setFrameIndex(frameCount); + deque.add(renderglobal$containerlocalrenderinformation4); + } + } else { + int j1 = blockpos.getY() > 0 ? Math.min(j, 248) : 8; + + if (renderchunk1 != null) { + this.renderInfosEntities.add(renderchunk1.getRenderInfo()); + } + + for (int k = -this.renderDistanceChunks; k <= this.renderDistanceChunks; ++k) { + for (int l = -this.renderDistanceChunks; l <= this.renderDistanceChunks; ++l) { + RenderChunk renderchunk3 = this.viewFrustum.getRenderChunk(new BlockPos((k << 4) + 8, j1, (l << 4) + 8)); + + if (renderchunk3 != null && renderchunk3.isBoundingBoxInFrustum((ICamera) camera, frameCount)) { + renderchunk3.setFrameIndex(frameCount); + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = renderchunk3.getRenderInfo(); + renderglobal$containerlocalrenderinformation1.initialize((EnumFacing) null, 0); + deque.add(renderglobal$containerlocalrenderinformation1); + } + } + } + } + + this.mc.mcProfiler.startSection("iteration"); + boolean flag3 = Config.isFogOn(); + + while (!deque.isEmpty()) { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation5 = (RenderGlobal.ContainerLocalRenderInformation) deque.poll(); + RenderChunk renderchunk6 = renderglobal$containerlocalrenderinformation5.renderChunk; + EnumFacing enumfacing1 = renderglobal$containerlocalrenderinformation5.facing; + CompiledChunk compiledchunk = renderchunk6.compiledChunk; + + if (!compiledchunk.isEmpty() || renderchunk6.isNeedsUpdate()) { + this.renderInfos.add(renderglobal$containerlocalrenderinformation5); + } + + if (ChunkUtils.hasEntities(renderchunk6.getChunk())) { + this.renderInfosEntities.add(renderglobal$containerlocalrenderinformation5); + } + + if (compiledchunk.getTileEntities().size() > 0) { + this.renderInfosTileEntities.add(renderglobal$containerlocalrenderinformation5); + } + + for (EnumFacing enumfacing : flag1 ? ChunkVisibility.getFacingsNotOpposite(renderglobal$containerlocalrenderinformation5.setFacing) : EnumFacing.VALUES) { + if (!flag1 || enumfacing1 == null || compiledchunk.isVisible(enumfacing1.getOpposite(), enumfacing)) { + RenderChunk renderchunk4 = this.getRenderChunkOffset(blockpos, renderchunk6, enumfacing, flag3, j); + + if (renderchunk4 != null && renderchunk4.setFrameIndex(frameCount) && renderchunk4.isBoundingBoxInFrustum((ICamera) camera, frameCount)) { + int i1 = renderglobal$containerlocalrenderinformation5.setFacing | 1 << enumfacing.ordinal(); + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 = renderchunk4.getRenderInfo(); + renderglobal$containerlocalrenderinformation2.initialize(enumfacing, i1); + deque.add(renderglobal$containerlocalrenderinformation2); + } + } + } + } + + this.mc.mcProfiler.endSection(); + } + + this.mc.mcProfiler.endStartSection("captureFrustum"); + + if (this.debugFixTerrainFrustum) { + this.fixTerrainFrustum(d3, d4, d5); + this.debugFixTerrainFrustum = false; + } + + Lagometer.timerVisibility.end(); + + if (Shaders.isShadowPass) { + Shaders.mcProfilerEndSection(); + } else { + this.mc.mcProfiler.endStartSection("rebuildNear"); + this.renderDispatcher.clearChunkUpdates(); + Set set = this.chunksToUpdate; + this.chunksToUpdate = Sets.newLinkedHashSet(); + Lagometer.timerChunkUpdate.start(); + + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation3 : this.renderInfos) { + RenderChunk renderchunk5 = renderglobal$containerlocalrenderinformation3.renderChunk; + + if (renderchunk5.isNeedsUpdate() || set.contains(renderchunk5)) { + this.displayListEntitiesDirty = true; + BlockPos blockpos1 = renderchunk5.getPosition(); + boolean flag4 = blockpos.distanceSq((double) (blockpos1.getX() + 8), (double) (blockpos1.getY() + 8), (double) (blockpos1.getZ() + 8)) < 768.0D; + + if (!flag4) { + this.chunksToUpdate.add(renderchunk5); + } else if (!renderchunk5.isPlayerUpdate()) { + this.chunksToUpdateForced.add(renderchunk5); + } else { + this.mc.mcProfiler.startSection("build near"); + this.renderDispatcher.updateChunkNow(renderchunk5); + renderchunk5.setNeedsUpdate(false); + this.mc.mcProfiler.endSection(); + } + } + } + + Lagometer.timerChunkUpdate.end(); + this.chunksToUpdate.addAll(set); + this.mc.mcProfiler.endSection(); + } + } + + private boolean isPositionInRenderChunk(BlockPos pos, RenderChunk renderChunkIn) { + BlockPos blockpos = renderChunkIn.getPosition(); + return MathHelper.abs_int(pos.getX() - blockpos.getX()) > 16 ? false : (MathHelper.abs_int(pos.getY() - blockpos.getY()) > 16 ? false : MathHelper.abs_int(pos.getZ() - blockpos.getZ()) <= 16); + } + + private Set getVisibleFacings(BlockPos pos) { + VisGraph visgraph = new VisGraph(); + BlockPos blockpos = new BlockPos(pos.getX() >> 4 << 4, pos.getY() >> 4 << 4, pos.getZ() >> 4 << 4); + Chunk chunk = this.theWorld.getChunkFromBlockCoords(blockpos); + + for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(blockpos, blockpos.add(15, 15, 15))) { + if (chunk.getBlock(blockpos$mutableblockpos).isOpaqueCube()) { + visgraph.func_178606_a(blockpos$mutableblockpos); + } + } + return visgraph.func_178609_b(pos); + } + + private RenderChunk getRenderChunkOffset(BlockPos p_getRenderChunkOffset_1_, RenderChunk p_getRenderChunkOffset_2_, EnumFacing p_getRenderChunkOffset_3_, boolean p_getRenderChunkOffset_4_, int p_getRenderChunkOffset_5_) { + RenderChunk renderchunk = p_getRenderChunkOffset_2_.getRenderChunkNeighbour(p_getRenderChunkOffset_3_); + + if (renderchunk == null) { + return null; + } else if (renderchunk.getPosition().getY() > p_getRenderChunkOffset_5_) { + return null; + } else { + if (p_getRenderChunkOffset_4_) { + BlockPos blockpos = renderchunk.getPosition(); + int i = p_getRenderChunkOffset_1_.getX() - blockpos.getX(); + int j = p_getRenderChunkOffset_1_.getZ() - blockpos.getZ(); + int k = i * i + j * j; + + if (k > this.renderDistanceSq) { + return null; + } + } + + return renderchunk; + } + } + + private void fixTerrainFrustum(double x, double y, double z) { + this.debugFixedClippingHelper = new ClippingHelperImpl(); + ((ClippingHelperImpl) this.debugFixedClippingHelper).init(); + Matrix4f matrix4f = new Matrix4f(this.debugFixedClippingHelper.modelviewMatrix); + matrix4f.transpose(); + Matrix4f matrix4f1 = new Matrix4f(this.debugFixedClippingHelper.projectionMatrix); + matrix4f1.transpose(); + Matrix4f matrix4f2 = new Matrix4f(); + Matrix4f.mul(matrix4f1, matrix4f, matrix4f2); + matrix4f2.invert(); + this.debugTerrainFrustumPosition.x = x; + this.debugTerrainFrustumPosition.y = y; + this.debugTerrainFrustumPosition.z = z; + this.debugTerrainMatrix[0] = new Vector4f(-1.0F, -1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[1] = new Vector4f(1.0F, -1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[2] = new Vector4f(1.0F, 1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[3] = new Vector4f(-1.0F, 1.0F, -1.0F, 1.0F); + this.debugTerrainMatrix[4] = new Vector4f(-1.0F, -1.0F, 1.0F, 1.0F); + this.debugTerrainMatrix[5] = new Vector4f(1.0F, -1.0F, 1.0F, 1.0F); + this.debugTerrainMatrix[6] = new Vector4f(1.0F, 1.0F, 1.0F, 1.0F); + this.debugTerrainMatrix[7] = new Vector4f(-1.0F, 1.0F, 1.0F, 1.0F); + + for (int i = 0; i < 8; ++i) { + Matrix4f.transform(matrix4f2, this.debugTerrainMatrix[i], this.debugTerrainMatrix[i]); + this.debugTerrainMatrix[i].x /= this.debugTerrainMatrix[i].w; + this.debugTerrainMatrix[i].y /= this.debugTerrainMatrix[i].w; + this.debugTerrainMatrix[i].z /= this.debugTerrainMatrix[i].w; + this.debugTerrainMatrix[i].w = 1.0F; + } + } + + protected Vector3f getViewVector(Entity entityIn, double partialTicks) { + float f = (float) ((double) entityIn.prevRotationPitch + (double) (entityIn.rotationPitch - entityIn.prevRotationPitch) * partialTicks); + float f1 = (float) ((double) entityIn.prevRotationYaw + (double) (entityIn.rotationYaw - entityIn.prevRotationYaw) * partialTicks); + + if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 2) { + f += 180.0F; + } + + float f2 = MathHelper.cos(-f1 * 0.017453292F - (float) Math.PI); + float f3 = MathHelper.sin(-f1 * 0.017453292F - (float) Math.PI); + float f4 = -MathHelper.cos(-f * 0.017453292F); + float f5 = MathHelper.sin(-f * 0.017453292F); + return new Vector3f(f3 * f4, f5, f2 * f4); + } + + public int renderBlockLayer(EnumWorldBlockLayer blockLayerIn, double partialTicks, int pass, Entity entityIn) { + RenderHelper.disableStandardItemLighting(); + + if (blockLayerIn == EnumWorldBlockLayer.TRANSLUCENT && !Shaders.isShadowPass) { + this.mc.mcProfiler.startSection("translucent_sort"); + double d0 = entityIn.posX - this.prevRenderSortX; + double d1 = entityIn.posY - this.prevRenderSortY; + double d2 = entityIn.posZ - this.prevRenderSortZ; + + if (d0 * d0 + d1 * d1 + d2 * d2 > 1.0D) { + this.prevRenderSortX = entityIn.posX; + this.prevRenderSortY = entityIn.posY; + this.prevRenderSortZ = entityIn.posZ; + int k = 0; + this.chunksToResortTransparency.clear(); + + for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfos) { + if (renderglobal$containerlocalrenderinformation.renderChunk.compiledChunk.isLayerStarted(blockLayerIn) && k++ < 15) { + this.chunksToResortTransparency.add(renderglobal$containerlocalrenderinformation.renderChunk); + } + } + } + + this.mc.mcProfiler.endSection(); + } + + this.mc.mcProfiler.startSection("filterempty"); + int l = 0; + boolean flag = blockLayerIn == EnumWorldBlockLayer.TRANSLUCENT; + int i1 = flag ? this.renderInfos.size() - 1 : 0; + int i = flag ? -1 : this.renderInfos.size(); + int j1 = flag ? -1 : 1; + + for (int j = i1; j != i; j += j1) { + RenderChunk renderchunk = ((RenderGlobal.ContainerLocalRenderInformation) this.renderInfos.get(j)).renderChunk; + + if (!renderchunk.getCompiledChunk().isLayerEmpty(blockLayerIn)) { + ++l; + this.renderContainer.addRenderChunk(renderchunk, blockLayerIn); + } + } + + if (l == 0) { + this.mc.mcProfiler.endSection(); + return l; + } else { + if (Config.isFogOff() && this.mc.entityRenderer.fogStandard) { + GlStateManager.disableFog(); + } + + this.mc.mcProfiler.endStartSection("render_" + blockLayerIn); + this.renderBlockLayer(blockLayerIn); + this.mc.mcProfiler.endSection(); + return l; + } + } + + @SuppressWarnings("incomplete-switch") + private void renderBlockLayer(EnumWorldBlockLayer blockLayerIn) { + this.mc.entityRenderer.enableLightmap(); + + if (OpenGlHelper.useVbo()) { + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + } + + if (Config.isShaders()) { + ShadersRender.preRenderChunkLayer(blockLayerIn); + } + + this.renderContainer.renderChunkLayer(blockLayerIn); + + if (Config.isShaders()) { + ShadersRender.postRenderChunkLayer(blockLayerIn); + } + + if (OpenGlHelper.useVbo()) { + for (VertexFormatElement vertexformatelement : DefaultVertexFormats.BLOCK.getElements()) { + EnumUsage enumusage = vertexformatelement.getUsage(); + int i = vertexformatelement.getIndex(); + + switch (enumusage) { + case POSITION: + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + break; + + case UV: + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + i); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + break; + + case COLOR: + GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + GlStateManager.resetColor(); + } + } + } + + this.mc.entityRenderer.disableLightmap(); + } + + private void cleanupDamagedBlocks(Iterator iteratorIn) { + while (iteratorIn.hasNext()) { + DestroyBlockProgress destroyblockprogress = iteratorIn.next(); + int i = destroyblockprogress.getCreationCloudUpdateTick(); + + if (this.cloudTickCounter - i > 400) { + iteratorIn.remove(); + } + } + } + + public void updateClouds() { + if (Config.isShaders()) { + if (Keyboard.isKeyDown(61) && Keyboard.isKeyDown(24)) { + GuiShaderOptions guishaderoptions = new GuiShaderOptions((GuiScreen) null, Config.getGameSettings()); + Config.getMinecraft().displayGuiScreen(guishaderoptions); + } + + if (Keyboard.isKeyDown(61) && Keyboard.isKeyDown(19)) { + Shaders.uninit(); + Shaders.loadShaderPack(); + } + } + + ++this.cloudTickCounter; + + if (this.cloudTickCounter % 20 == 0) { + this.cleanupDamagedBlocks(this.damagedBlocks.values().iterator()); + } + } + + private void renderSkyEnd() { + if (Config.isSkyEnabled()) { + GlStateManager.disableFog(); + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + GlStateManager.depthMask(false); + this.renderEngine.bindTexture(locationEndSkyPng); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + for (int i = 0; i < 6; ++i) { + GlStateManager.pushMatrix(); + + if (i == 1) { + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (i == 2) { + GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); + } + + if (i == 3) { + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + } + + if (i == 4) { + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + } + + if (i == 5) { + GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); + } + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + int j = 40; + int k = 40; + int l = 40; + + if (Config.isCustomColors()) { + Vec3 vec3 = new Vec3((double) j / 255.0D, (double) k / 255.0D, (double) l / 255.0D); + vec3 = CustomColors.getWorldSkyColor(vec3, this.theWorld, this.mc.getRenderViewEntity(), 0.0F); + j = (int) (vec3.xCoord * 255.0D); + k = (int) (vec3.yCoord * 255.0D); + l = (int) (vec3.zCoord * 255.0D); + } + + worldrenderer.pos(-100.0D, -100.0D, -100.0D).tex(0.0D, 0.0D).color(j, k, l, 255).endVertex(); + worldrenderer.pos(-100.0D, -100.0D, 100.0D).tex(0.0D, 16.0D).color(j, k, l, 255).endVertex(); + worldrenderer.pos(100.0D, -100.0D, 100.0D).tex(16.0D, 16.0D).color(j, k, l, 255).endVertex(); + worldrenderer.pos(100.0D, -100.0D, -100.0D).tex(16.0D, 0.0D).color(j, k, l, 255).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + } + + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + } + } + + public void renderSky(float partialTicks, int pass) { + if (Reflector.ForgeWorldProvider_getSkyRenderer.exists()) { + WorldProvider worldprovider = this.mc.theWorld.provider; + Object object = Reflector.call(worldprovider, Reflector.ForgeWorldProvider_getSkyRenderer, new Object[0]); + + if (object != null) { + Reflector.callVoid(object, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(partialTicks), this.theWorld, this.mc}); + return; + } + } + + if (this.mc.theWorld.provider.getDimensionId() == 1) { + this.renderSkyEnd(); + } else if (this.mc.theWorld.provider.isSurfaceWorld()) { + GlStateManager.disableTexture2D(); + boolean flag = Config.isShaders(); + + if (flag) { + Shaders.disableTexture2D(); + } + + Vec3 vec3 = this.theWorld.getSkyColor(this.mc.getRenderViewEntity(), partialTicks); + vec3 = CustomColors.getSkyColor(vec3, this.mc.theWorld, this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().posY + 1.0D, this.mc.getRenderViewEntity().posZ); + + if (flag) { + Shaders.setSkyColor(vec3); + } + + float f = (float) vec3.xCoord; + float f1 = (float) vec3.yCoord; + float f2 = (float) vec3.zCoord; + + if (pass != 2) { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + GlStateManager.color(f, f1, f2); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.depthMask(false); + GlStateManager.enableFog(); + + if (flag) { + Shaders.enableFog(); + } + + GlStateManager.color(f, f1, f2); + + if (flag) { + Shaders.preSkyList(); + } + + if (Config.isSkyEnabled()) { + if (this.vboEnabled) { + this.skyVBO.bindBuffer(); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL11.glVertexPointer(3, GL11.GL_FLOAT, 12, 0L); + this.skyVBO.drawArrays(7); + this.skyVBO.unbindBuffer(); + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + } else { + GlStateManager.callList(this.glSkyList); + } + } + + GlStateManager.disableFog(); + + if (flag) { + Shaders.disableFog(); + } + + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + float[] afloat = this.theWorld.provider.calcSunriseSunsetColors(this.theWorld.getCelestialAngle(partialTicks), partialTicks); + + if (afloat != null && Config.isSunMoonEnabled()) { + GlStateManager.disableTexture2D(); + + if (flag) { + Shaders.disableTexture2D(); + } + + GlStateManager.shadeModel(7425); + GlStateManager.pushMatrix(); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(MathHelper.sin(this.theWorld.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + float f6 = afloat[0]; + float f7 = afloat[1]; + float f8 = afloat[2]; + + if (pass != 2) { + float f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; + float f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; + float f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; + f6 = f9; + f7 = f10; + f8 = f11; + } + + worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(0.0D, 100.0D, 0.0D).color(f6, f7, f8, afloat[3]).endVertex(); + int j = 16; + + for (int l = 0; l <= 16; ++l) { + float f18 = (float) l * (float) Math.PI * 2.0F / 16.0F; + float f12 = MathHelper.sin(f18); + float f13 = MathHelper.cos(f18); + worldrenderer.pos((double) (f12 * 120.0F), (double) (f13 * 120.0F), (double) (-f13 * 40.0F * afloat[3])).color(afloat[0], afloat[1], afloat[2], 0.0F).endVertex(); + } + + tessellator.draw(); + GlStateManager.popMatrix(); + GlStateManager.shadeModel(7424); + } + + GlStateManager.enableTexture2D(); + + if (flag) { + Shaders.enableTexture2D(); + } + + GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); + GlStateManager.pushMatrix(); + float f15 = 1.0F - this.theWorld.getRainStrength(partialTicks); + GlStateManager.color(1.0F, 1.0F, 1.0F, f15); + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + CustomSky.renderSky(this.theWorld, this.renderEngine, partialTicks); + + if (flag) { + Shaders.preCelestialRotate(); + } + + GlStateManager.rotate(this.theWorld.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); + + if (flag) { + Shaders.postCelestialRotate(); + } + + float f16 = 30.0F; + + if (Config.isSunTexture()) { + this.renderEngine.bindTexture(locationSunPng); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (-f16), 100.0D, (double) (-f16)).tex(0.0D, 0.0D).endVertex(); + worldrenderer.pos((double) f16, 100.0D, (double) (-f16)).tex(1.0D, 0.0D).endVertex(); + worldrenderer.pos((double) f16, 100.0D, (double) f16).tex(1.0D, 1.0D).endVertex(); + worldrenderer.pos((double) (-f16), 100.0D, (double) f16).tex(0.0D, 1.0D).endVertex(); + tessellator.draw(); + } + + f16 = 20.0F; + + if (Config.isMoonTexture()) { + this.renderEngine.bindTexture(locationMoonPhasesPng); + int i = this.theWorld.getMoonPhase(); + int k = i % 4; + int i1 = i / 4 % 2; + float f19 = (float) (k + 0) / 4.0F; + float f21 = (float) (i1 + 0) / 2.0F; + float f23 = (float) (k + 1) / 4.0F; + float f14 = (float) (i1 + 1) / 2.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos((double) (-f16), -100.0D, (double) f16).tex((double) f23, (double) f14).endVertex(); + worldrenderer.pos((double) f16, -100.0D, (double) f16).tex((double) f19, (double) f14).endVertex(); + worldrenderer.pos((double) f16, -100.0D, (double) (-f16)).tex((double) f19, (double) f21).endVertex(); + worldrenderer.pos((double) (-f16), -100.0D, (double) (-f16)).tex((double) f23, (double) f21).endVertex(); + tessellator.draw(); + } + + GlStateManager.disableTexture2D(); + + if (flag) { + Shaders.disableTexture2D(); + } + + float f17 = this.theWorld.getStarBrightness(partialTicks) * f15; + + if (f17 > 0.0F && Config.isStarsEnabled() && !CustomSky.hasSkyLayers(this.theWorld)) { + GlStateManager.color(f17, f17, f17, f17); + + if (this.vboEnabled) { + this.starVBO.bindBuffer(); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL11.glVertexPointer(3, GL11.GL_FLOAT, 12, 0L); + this.starVBO.drawArrays(7); + this.starVBO.unbindBuffer(); + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + } else { + GlStateManager.callList(this.starGLCallList); + } + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableFog(); + + if (flag) { + Shaders.enableFog(); + } + + GlStateManager.popMatrix(); + GlStateManager.disableTexture2D(); + + if (flag) { + Shaders.disableTexture2D(); + } + + GlStateManager.color(0.0F, 0.0F, 0.0F); + double d0 = this.mc.thePlayer.getPositionEyes(partialTicks).yCoord - this.theWorld.getHorizon(); + + if (d0 < 0.0D) { + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 12.0F, 0.0F); + + if (this.vboEnabled) { + this.sky2VBO.bindBuffer(); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL11.glVertexPointer(3, GL11.GL_FLOAT, 12, 0L); + this.sky2VBO.drawArrays(7); + this.sky2VBO.unbindBuffer(); + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + } else { + GlStateManager.callList(this.glSkyList2); + } + + GlStateManager.popMatrix(); + float f20 = 1.0F; + float f22 = -((float) (d0 + 65.0D)); + float f24 = -1.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(-1.0D, (double) f22, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, (double) f22, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, (double) f22, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, (double) f22, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, (double) f22, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, (double) f22, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, (double) f22, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, (double) f22, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex(); + tessellator.draw(); + } + + if (this.theWorld.provider.isSkyColored()) { + GlStateManager.color(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F); + } else { + GlStateManager.color(f, f1, f2); + } + + if (this.mc.gameSettings.renderDistanceChunks <= 4) { + GlStateManager.color(this.mc.entityRenderer.fogColorRed, this.mc.entityRenderer.fogColorGreen, this.mc.entityRenderer.fogColorBlue); + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, -((float) (d0 - 16.0D)), 0.0F); + + if (Config.isSkyEnabled()) { + if (this.vboEnabled) { + this.sky2VBO.bindBuffer(); + GlStateManager.glEnableClientState(32884); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + this.sky2VBO.drawArrays(7); + this.sky2VBO.unbindBuffer(); + GlStateManager.glDisableClientState(32884); + } else { + GlStateManager.callList(this.glSkyList2); + } + } + + GlStateManager.popMatrix(); + GlStateManager.enableTexture2D(); + + if (flag) { + Shaders.enableTexture2D(); + } + + GlStateManager.depthMask(true); + } + } + + public void renderClouds(float partialTicks, int pass) { + if (!Config.isCloudsOff()) { + if (Reflector.ForgeWorldProvider_getCloudRenderer.exists()) { + WorldProvider worldprovider = this.mc.theWorld.provider; + Object object = Reflector.call(worldprovider, Reflector.ForgeWorldProvider_getCloudRenderer, new Object[0]); + + if (object != null) { + Reflector.callVoid(object, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(partialTicks), this.theWorld, this.mc}); + return; + } + } + + if (this.mc.theWorld.provider.isSurfaceWorld()) { + if (Config.isShaders()) { + Shaders.beginClouds(); + } + + if (Config.isCloudsFancy()) { + this.renderCloudsFancy(partialTicks, pass); + } else { + float f9 = partialTicks; + partialTicks = 0.0F; + GlStateManager.disableCull(); + float f10 = (float) (this.mc.getRenderViewEntity().lastTickPosY + (this.mc.getRenderViewEntity().posY - this.mc.getRenderViewEntity().lastTickPosY) * (double) partialTicks); + int i = 32; + int j = 8; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.renderEngine.bindTexture(locationCloudsPng); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + Vec3 vec3 = this.theWorld.getCloudColour(partialTicks); + float f = (float) vec3.xCoord; + float f1 = (float) vec3.yCoord; + float f2 = (float) vec3.zCoord; + this.cloudRenderer.prepareToRender(false, this.cloudTickCounter, f9, vec3); + + if (this.cloudRenderer.shouldUpdateGlList()) { + this.cloudRenderer.startUpdateGlList(); + + if (pass != 2) { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + float f11 = 4.8828125E-4F; + double d2 = (double) ((float) this.cloudTickCounter + partialTicks); + double d0 = this.mc.getRenderViewEntity().prevPosX + (this.mc.getRenderViewEntity().posX - this.mc.getRenderViewEntity().prevPosX) * (double) partialTicks + d2 * 0.029999999329447746D; + double d1 = this.mc.getRenderViewEntity().prevPosZ + (this.mc.getRenderViewEntity().posZ - this.mc.getRenderViewEntity().prevPosZ) * (double) partialTicks; + int k = MathHelper.floor_double(d0 / 2048.0D); + int l = MathHelper.floor_double(d1 / 2048.0D); + d0 = d0 - (double) (k * 2048); + d1 = d1 - (double) (l * 2048); + float f6 = this.theWorld.provider.getCloudHeight() - f10 + 0.33F; + f6 = f6 + this.mc.gameSettings.ofCloudsHeight * 128.0F; + float f7 = (float) (d0 * 4.8828125E-4D); + float f8 = (float) (d1 * 4.8828125E-4D); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + + for (int i1 = -256; i1 < 256; i1 += 32) { + for (int j1 = -256; j1 < 256; j1 += 32) { + worldrenderer.pos((double) (i1 + 0), (double) f6, (double) (j1 + 32)).tex((double) ((float) (i1 + 0) * 4.8828125E-4F + f7), (double) ((float) (j1 + 32) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex(); + worldrenderer.pos((double) (i1 + 32), (double) f6, (double) (j1 + 32)).tex((double) ((float) (i1 + 32) * 4.8828125E-4F + f7), (double) ((float) (j1 + 32) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex(); + worldrenderer.pos((double) (i1 + 32), (double) f6, (double) (j1 + 0)).tex((double) ((float) (i1 + 32) * 4.8828125E-4F + f7), (double) ((float) (j1 + 0) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex(); + worldrenderer.pos((double) (i1 + 0), (double) f6, (double) (j1 + 0)).tex((double) ((float) (i1 + 0) * 4.8828125E-4F + f7), (double) ((float) (j1 + 0) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex(); + } + } + + tessellator.draw(); + this.cloudRenderer.endUpdateGlList(); + } + + this.cloudRenderer.renderGlList(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + } + + if (Config.isShaders()) { + Shaders.endClouds(); + } + } + } + } + + public boolean hasCloudFog(double x, double y, double z, float partialTicks) { + return false; + } + + private void renderCloudsFancy(float partialTicks, int pass) { + partialTicks = 0.0F; + GlStateManager.disableCull(); + float f = (float) (this.mc.getRenderViewEntity().lastTickPosY + (this.mc.getRenderViewEntity().posY - this.mc.getRenderViewEntity().lastTickPosY) * (double) partialTicks); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + float f1 = 12.0F; + float f2 = 4.0F; + double d0 = (double) ((float) this.cloudTickCounter + partialTicks); + double d1 = (this.mc.getRenderViewEntity().prevPosX + (this.mc.getRenderViewEntity().posX - this.mc.getRenderViewEntity().prevPosX) * (double) partialTicks + d0 * 0.029999999329447746D) / 12.0D; + double d2 = (this.mc.getRenderViewEntity().prevPosZ + (this.mc.getRenderViewEntity().posZ - this.mc.getRenderViewEntity().prevPosZ) * (double) partialTicks) / 12.0D + 0.33000001311302185D; + float f3 = this.theWorld.provider.getCloudHeight() - f + 0.33F; + f3 = f3 + this.mc.gameSettings.ofCloudsHeight * 128.0F; + int i = MathHelper.floor_double(d1 / 2048.0D); + int j = MathHelper.floor_double(d2 / 2048.0D); + d1 = d1 - (double) (i * 2048); + d2 = d2 - (double) (j * 2048); + this.renderEngine.bindTexture(locationCloudsPng); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + Vec3 vec3 = this.theWorld.getCloudColour(partialTicks); + float f4 = (float) vec3.xCoord; + float f5 = (float) vec3.yCoord; + float f6 = (float) vec3.zCoord; + this.cloudRenderer.prepareToRender(true, this.cloudTickCounter, partialTicks, vec3); + + if (pass != 2) { + float f7 = (f4 * 30.0F + f5 * 59.0F + f6 * 11.0F) / 100.0F; + float f8 = (f4 * 30.0F + f5 * 70.0F) / 100.0F; + float f9 = (f4 * 30.0F + f6 * 70.0F) / 100.0F; + f4 = f7; + f5 = f8; + f6 = f9; + } + + float f26 = f4 * 0.9F; + float f27 = f5 * 0.9F; + float f28 = f6 * 0.9F; + float f10 = f4 * 0.7F; + float f11 = f5 * 0.7F; + float f12 = f6 * 0.7F; + float f13 = f4 * 0.8F; + float f14 = f5 * 0.8F; + float f15 = f6 * 0.8F; + float f16 = 0.00390625F; + float f17 = (float) MathHelper.floor_double(d1) * 0.00390625F; + float f18 = (float) MathHelper.floor_double(d2) * 0.00390625F; + float f19 = (float) (d1 - (double) MathHelper.floor_double(d1)); + float f20 = (float) (d2 - (double) MathHelper.floor_double(d2)); + int k = 8; + int l = 4; + float f21 = 9.765625E-4F; + GlStateManager.scale(12.0F, 1.0F, 12.0F); + + for (int i1 = 0; i1 < 2; ++i1) { + if (i1 == 0) { + GlStateManager.colorMask(false, false, false, false); + } else { + switch (pass) { + case 0: + GlStateManager.colorMask(false, true, true, true); + break; + + case 1: + GlStateManager.colorMask(true, false, false, true); + break; + + case 2: + GlStateManager.colorMask(true, true, true, true); + } + } + + this.cloudRenderer.renderGlList(); + } + + if (this.cloudRenderer.shouldUpdateGlList()) { + this.cloudRenderer.startUpdateGlList(); + + for (int l1 = -3; l1 <= 4; ++l1) { + for (int j1 = -3; j1 <= 4; ++j1) { + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); + float f22 = (float) (l1 * 8); + float f23 = (float) (j1 * 8); + float f24 = f22 - f19; + float f25 = f23 - f20; + + if (f3 > -5.0F) { + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + 8.0F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F), (double) (f25 + 8.0F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F), (double) (f25 + 0.0F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + 0.0F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); + } + + if (f3 <= 5.0F) { + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 8.0F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 8.0F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 0.0F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 0.0F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); + } + + if (l1 > -1) { + for (int k1 = 0; k1 < 8; ++k1) { + worldrenderer.pos((double) (f24 + (float) k1 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + 8.0F)).tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + (float) k1 + 0.0F), (double) (f3 + 4.0F), (double) (f25 + 8.0F)).tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + (float) k1 + 0.0F), (double) (f3 + 4.0F), (double) (f25 + 0.0F)).tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + (float) k1 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + 0.0F)).tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex(); + } + } + + if (l1 <= 1) { + for (int i2 = 0; i2 < 8; ++i2) { + worldrenderer.pos((double) (f24 + (float) i2 + 1.0F - 9.765625E-4F), (double) (f3 + 0.0F), (double) (f25 + 8.0F)).tex((double) ((f22 + (float) i2 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + (float) i2 + 1.0F - 9.765625E-4F), (double) (f3 + 4.0F), (double) (f25 + 8.0F)).tex((double) ((f22 + (float) i2 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + (float) i2 + 1.0F - 9.765625E-4F), (double) (f3 + 4.0F), (double) (f25 + 0.0F)).tex((double) ((f22 + (float) i2 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double) (f24 + (float) i2 + 1.0F - 9.765625E-4F), (double) (f3 + 0.0F), (double) (f25 + 0.0F)).tex((double) ((f22 + (float) i2 + 0.5F) * 0.00390625F + f17), (double) ((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex(); + } + } + + if (j1 > -1) { + for (int j2 = 0; j2 < 8; ++j2) { + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F), (double) (f25 + (float) j2 + 0.0F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + (float) j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F), (double) (f25 + (float) j2 + 0.0F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + (float) j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F), (double) (f25 + (float) j2 + 0.0F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + (float) j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + (float) j2 + 0.0F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + (float) j2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex(); + } + } + + if (j1 <= 1) { + for (int k2 = 0; k2 < 8; ++k2) { + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F), (double) (f25 + (float) k2 + 1.0F - 9.765625E-4F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + (float) k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F), (double) (f25 + (float) k2 + 1.0F - 9.765625E-4F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + (float) k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F), (double) (f25 + (float) k2 + 1.0F - 9.765625E-4F)).tex((double) ((f22 + 8.0F) * 0.00390625F + f17), (double) ((f23 + (float) k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + (float) k2 + 1.0F - 9.765625E-4F)).tex((double) ((f22 + 0.0F) * 0.00390625F + f17), (double) ((f23 + (float) k2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex(); + } + } + + tessellator.draw(); + } + } + + this.cloudRenderer.endUpdateGlList(); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + } + + public void updateChunks(long finishTimeNano) { + finishTimeNano = (long) ((double) finishTimeNano + 1.0E8D); + this.displayListEntitiesDirty |= this.renderDispatcher.runChunkUploads(finishTimeNano); + + if (this.chunksToUpdateForced.size() > 0) { + Iterator iterator = this.chunksToUpdateForced.iterator(); + + while (iterator.hasNext()) { + RenderChunk renderchunk = (RenderChunk) iterator.next(); + + if (!this.renderDispatcher.updateChunkLater(renderchunk)) { + break; + } + + renderchunk.setNeedsUpdate(false); + iterator.remove(); + this.chunksToUpdate.remove(renderchunk); + this.chunksToResortTransparency.remove(renderchunk); + } + } + + if (this.chunksToResortTransparency.size() > 0) { + Iterator iterator2 = this.chunksToResortTransparency.iterator(); + + if (iterator2.hasNext()) { + RenderChunk renderchunk2 = (RenderChunk) iterator2.next(); + + if (this.renderDispatcher.updateTransparencyLater(renderchunk2)) { + iterator2.remove(); + } + } + } + + double d1 = 0.0D; + int i = Config.getUpdatesPerFrame(); + + if (!this.chunksToUpdate.isEmpty()) { + Iterator iterator1 = this.chunksToUpdate.iterator(); + + while (iterator1.hasNext()) { + RenderChunk renderchunk1 = (RenderChunk) iterator1.next(); + boolean flag = renderchunk1.isChunkRegionEmpty(); + boolean flag1; + + if (flag) { + flag1 = this.renderDispatcher.updateChunkNow(renderchunk1); + } else { + flag1 = this.renderDispatcher.updateChunkLater(renderchunk1); + } + + if (!flag1) { + break; + } + + renderchunk1.setNeedsUpdate(false); + iterator1.remove(); + + if (!flag) { + double d0 = 2.0D * RenderChunkUtils.getRelativeBufferSize(renderchunk1); + d1 += d0; + + if (d1 > (double) i) { + break; + } + } + } + } + } + + public void renderWorldBorder(Entity entityIn, float partialTicks) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + WorldBorder worldborder = this.theWorld.getWorldBorder(); + double d0 = (double) (this.mc.gameSettings.renderDistanceChunks * 16); + + if (entityIn.posX >= worldborder.maxX() - d0 || entityIn.posX <= worldborder.minX() + d0 || entityIn.posZ >= worldborder.maxZ() - d0 || entityIn.posZ <= worldborder.minZ() + d0) { + if (Config.isShaders()) { + Shaders.pushProgram(); + Shaders.useProgram(Shaders.ProgramTexturedLit); + } + + double d1 = 1.0D - worldborder.getClosestDistance(entityIn) / d0; + d1 = Math.pow(d1, 4.0D); + double d2 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double) partialTicks; + double d3 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double) partialTicks; + double d4 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double) partialTicks; + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); + this.renderEngine.bindTexture(locationForcefieldPng); + GlStateManager.depthMask(false); + GlStateManager.pushMatrix(); + int i = worldborder.getStatus().getID(); + float f = (float) (i >> 16 & 255) / 255.0F; + float f1 = (float) (i >> 8 & 255) / 255.0F; + float f2 = (float) (i & 255) / 255.0F; + GlStateManager.color(f, f1, f2, (float) d1); + GlStateManager.doPolygonOffset(-3.0F, -3.0F); + GlStateManager.enablePolygonOffset(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableAlpha(); + GlStateManager.disableCull(); + float f3 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 128.0F; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.setTranslation(-d2, -d3, -d4); + double d5 = Math.max((double) MathHelper.floor_double(d4 - d0), worldborder.minZ()); + double d6 = Math.min((double) MathHelper.ceiling_double_int(d4 + d0), worldborder.maxZ()); + + if (d2 > worldborder.maxX() - d0) { + float f7 = 0.0F; + + for (double d7 = d5; d7 < d6; f7 += 0.5F) { + double d8 = Math.min(1.0D, d6 - d7); + float f8 = (float) d8 * 0.5F; + worldrenderer.pos(worldborder.maxX(), 256.0D, d7).tex((double) (f3 + f7), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(worldborder.maxX(), 256.0D, d7 + d8).tex((double) (f3 + f8 + f7), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(worldborder.maxX(), 0.0D, d7 + d8).tex((double) (f3 + f8 + f7), (double) (f3 + 128.0F)).endVertex(); + worldrenderer.pos(worldborder.maxX(), 0.0D, d7).tex((double) (f3 + f7), (double) (f3 + 128.0F)).endVertex(); + ++d7; + } + } + + if (d2 < worldborder.minX() + d0) { + float f9 = 0.0F; + + for (double d9 = d5; d9 < d6; f9 += 0.5F) { + double d12 = Math.min(1.0D, d6 - d9); + float f12 = (float) d12 * 0.5F; + worldrenderer.pos(worldborder.minX(), 256.0D, d9).tex((double) (f3 + f9), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(worldborder.minX(), 256.0D, d9 + d12).tex((double) (f3 + f12 + f9), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(worldborder.minX(), 0.0D, d9 + d12).tex((double) (f3 + f12 + f9), (double) (f3 + 128.0F)).endVertex(); + worldrenderer.pos(worldborder.minX(), 0.0D, d9).tex((double) (f3 + f9), (double) (f3 + 128.0F)).endVertex(); + ++d9; + } + } + + d5 = Math.max((double) MathHelper.floor_double(d2 - d0), worldborder.minX()); + d6 = Math.min((double) MathHelper.ceiling_double_int(d2 + d0), worldborder.maxX()); + + if (d4 > worldborder.maxZ() - d0) { + float f10 = 0.0F; + + for (double d10 = d5; d10 < d6; f10 += 0.5F) { + double d13 = Math.min(1.0D, d6 - d10); + float f13 = (float) d13 * 0.5F; + worldrenderer.pos(d10, 256.0D, worldborder.maxZ()).tex((double) (f3 + f10), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(d10 + d13, 256.0D, worldborder.maxZ()).tex((double) (f3 + f13 + f10), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(d10 + d13, 0.0D, worldborder.maxZ()).tex((double) (f3 + f13 + f10), (double) (f3 + 128.0F)).endVertex(); + worldrenderer.pos(d10, 0.0D, worldborder.maxZ()).tex((double) (f3 + f10), (double) (f3 + 128.0F)).endVertex(); + ++d10; + } + } + + if (d4 < worldborder.minZ() + d0) { + float f11 = 0.0F; + + for (double d11 = d5; d11 < d6; f11 += 0.5F) { + double d14 = Math.min(1.0D, d6 - d11); + float f14 = (float) d14 * 0.5F; + worldrenderer.pos(d11, 256.0D, worldborder.minZ()).tex((double) (f3 + f11), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(d11 + d14, 256.0D, worldborder.minZ()).tex((double) (f3 + f14 + f11), (double) (f3 + 0.0F)).endVertex(); + worldrenderer.pos(d11 + d14, 0.0D, worldborder.minZ()).tex((double) (f3 + f14 + f11), (double) (f3 + 128.0F)).endVertex(); + worldrenderer.pos(d11, 0.0D, worldborder.minZ()).tex((double) (f3 + f11), (double) (f3 + 128.0F)).endVertex(); + ++d11; + } + } + + tessellator.draw(); + worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); + GlStateManager.enableCull(); + GlStateManager.disableAlpha(); + GlStateManager.doPolygonOffset(0.0F, 0.0F); + GlStateManager.disablePolygonOffset(); + GlStateManager.enableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + + if (Config.isShaders()) { + Shaders.popProgram(); + } + } + } + + private void preRenderDamagedBlocks() { + GlStateManager.tryBlendFuncSeparate(774, 768, 1, 0); + GlStateManager.enableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F); + GlStateManager.doPolygonOffset(-1.0F, -10.0F); + GlStateManager.enablePolygonOffset(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableAlpha(); + GlStateManager.pushMatrix(); + + if (Config.isShaders()) { + ShadersRender.beginBlockDamage(); + } + } + + private void postRenderDamagedBlocks() { + GlStateManager.disableAlpha(); + GlStateManager.doPolygonOffset(0.0F, 0.0F); + GlStateManager.disablePolygonOffset(); + GlStateManager.enableAlpha(); + GlStateManager.depthMask(true); + GlStateManager.popMatrix(); + + if (Config.isShaders()) { + ShadersRender.endBlockDamage(); + } + } + + public void drawBlockDamageTexture(Tessellator tessellatorIn, WorldRenderer worldRendererIn, Entity entityIn, float partialTicks) { + double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double) partialTicks; + double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double) partialTicks; + double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double) partialTicks; + + if (!this.damagedBlocks.isEmpty()) { + this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + this.preRenderDamagedBlocks(); + worldRendererIn.begin(7, DefaultVertexFormats.BLOCK); + worldRendererIn.setTranslation(-d0, -d1, -d2); + worldRendererIn.noColor(); + Iterator iterator = this.damagedBlocks.values().iterator(); + + while (iterator.hasNext()) { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress) iterator.next(); + BlockPos blockpos = destroyblockprogress.getPosition(); + double d3 = (double) blockpos.getX() - d0; + double d4 = (double) blockpos.getY() - d1; + double d5 = (double) blockpos.getZ() - d2; + Block block = this.theWorld.getBlockState(blockpos).getBlock(); + boolean flag; + + if (Reflector.ForgeTileEntity_canRenderBreaking.exists()) { + boolean flag1 = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull; + + if (!flag1) { + TileEntity tileentity = this.theWorld.getTileEntity(blockpos); + + if (tileentity != null) { + flag1 = Reflector.callBoolean(tileentity, Reflector.ForgeTileEntity_canRenderBreaking, new Object[0]); + } + } + + flag = !flag1; + } else { + flag = !(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull); + } + + if (flag) { + if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) { + iterator.remove(); + } else { + IBlockState iblockstate = this.theWorld.getBlockState(blockpos); + + if (iblockstate.getBlock().getMaterial() != Material.air) { + int i = destroyblockprogress.getPartialBlockDamage(); + TextureAtlasSprite textureatlassprite = this.destroyBlockIcons[i]; + BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher(); + blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, this.theWorld); + } + } + } + } + + tessellatorIn.draw(); + worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D); + this.postRenderDamagedBlocks(); + } + } + + public void drawSelectionBox(EntityPlayer player, MovingObjectPosition movingObjectPositionIn, int execute, float partialTicks) { + if (execute == 0 && movingObjectPositionIn.typeOfHit == MovingObjectType.BLOCK) { + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.color(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth(2.0F); + GlStateManager.disableTexture2D(); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GlStateManager.depthMask(false); + float f = 0.002F; + BlockPos blockpos = movingObjectPositionIn.getBlockPos(); + Block block = this.theWorld.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() != Material.air && this.theWorld.getWorldBorder().contains(blockpos)) { + block.setBlockBoundsBasedOnState(this.theWorld, blockpos); + double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks; + double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks; + double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks; + AxisAlignedBB axisalignedbb = block.getSelectedBoundingBox(this.theWorld, blockpos); + EnumOffsetType enumoffsettype = block.getOffsetType(); + + if (enumoffsettype != EnumOffsetType.NONE) { + axisalignedbb = BlockModelUtils.getOffsetBoundingBox(axisalignedbb, enumoffsettype, blockpos); + } + + drawSelectionBoundingBox(axisalignedbb.expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D).offset(-d0, -d1, -d2)); + } + + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + + GlStateManager.disableBlend(); + } + } + + public static void drawSelectionBoundingBox(AxisAlignedBB boundingBox) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(3, DefaultVertexFormats.POSITION); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); + tessellator.draw(); + worldrenderer.begin(3, DefaultVertexFormats.POSITION); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); + tessellator.draw(); + worldrenderer.begin(1, DefaultVertexFormats.POSITION); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).endVertex(); + tessellator.draw(); + } + + public static void drawOutlinedBoundingBox(AxisAlignedBB boundingBox, int red, int green, int blue, int alpha) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + worldrenderer.begin(1, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + } + + private void markBlocksForUpdate(int x1, int y1, int z1, int x2, int y2, int z2) { + this.viewFrustum.markBlocksForUpdate(x1, y1, z1, x2, y2, z2); + } + + public void markBlockForUpdate(BlockPos pos) { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + this.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); + } + + public void notifyLightSet(BlockPos pos) { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + this.markBlocksForUpdate(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); + } + + public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) { + this.markBlocksForUpdate(x1 - 1, y1 - 1, z1 - 1, x2 + 1, y2 + 1, z2 + 1); + } + + public void playRecord(String recordName, BlockPos blockPosIn) { + ISound isound = (ISound) this.mapSoundPositions.get(blockPosIn); + + if (isound != null) { + this.mc.getSoundHandler().stopSound(isound); + this.mapSoundPositions.remove(blockPosIn); + } + + if (recordName != null) { + ItemRecord itemrecord = ItemRecord.getRecord(recordName); + + if (itemrecord != null) { + this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); + } + + PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.create(new ResourceLocation(recordName), (float) blockPosIn.getX(), (float) blockPosIn.getY(), (float) blockPosIn.getZ()); + this.mapSoundPositions.put(blockPosIn, positionedsoundrecord); + this.mc.getSoundHandler().playSound(positionedsoundrecord); + } + } + + public void playSound(String soundName, double x, double y, double z, float volume, float pitch) { + } + + public void playSoundToNearExcept(EntityPlayer except, String soundName, double x, double y, double z, float volume, float pitch) { + } + + public void spawnParticle(int particleID, boolean ignoreRange, final double xCoord, final double yCoord, final double zCoord, double xOffset, double yOffset, double zOffset, int... parameters) { + try { + this.spawnEntityFX(particleID, ignoreRange, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while adding particle"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being added"); + crashreportcategory.addCrashSection("ID", Integer.valueOf(particleID)); + + if (parameters != null) { + crashreportcategory.addCrashSection("Parameters", parameters); + } + + crashreportcategory.addCrashSectionCallable("Position", new Callable() { + public String call() throws Exception { + return CrashReportCategory.getCoordinateInfo(xCoord, yCoord, zCoord); + } + }); + throw new ReportedException(crashreport); + } + } + + private void spawnParticle(EnumParticleTypes particleIn, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... parameters) { + this.spawnParticle(particleIn.getParticleID(), particleIn.getShouldIgnoreRange(), xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); + } + + private EntityFX spawnEntityFX(int particleID, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... parameters) { + if (this.mc != null && this.mc.getRenderViewEntity() != null && this.mc.effectRenderer != null) { + int i = this.mc.gameSettings.particleSetting; + + if (i == 1 && this.theWorld.rand.nextInt(3) == 0) { + i = 2; + } + + double d0 = this.mc.getRenderViewEntity().posX - xCoord; + double d1 = this.mc.getRenderViewEntity().posY - yCoord; + double d2 = this.mc.getRenderViewEntity().posZ - zCoord; + + if (particleID == EnumParticleTypes.EXPLOSION_HUGE.getParticleID() && !Config.isAnimatedExplosion()) { + return null; + } else if (particleID == EnumParticleTypes.EXPLOSION_LARGE.getParticleID() && !Config.isAnimatedExplosion()) { + return null; + } else if (particleID == EnumParticleTypes.EXPLOSION_NORMAL.getParticleID() && !Config.isAnimatedExplosion()) { + return null; + } else if (particleID == EnumParticleTypes.SUSPENDED.getParticleID() && !Config.isWaterParticles()) { + return null; + } else if (particleID == EnumParticleTypes.SUSPENDED_DEPTH.getParticleID() && !Config.isVoidParticles()) { + return null; + } else if (particleID == EnumParticleTypes.SMOKE_NORMAL.getParticleID() && !Config.isAnimatedSmoke()) { + return null; + } else if (particleID == EnumParticleTypes.SMOKE_LARGE.getParticleID() && !Config.isAnimatedSmoke()) { + return null; + } else if (particleID == EnumParticleTypes.SPELL_MOB.getParticleID() && !Config.isPotionParticles()) { + return null; + } else if (particleID == EnumParticleTypes.SPELL_MOB_AMBIENT.getParticleID() && !Config.isPotionParticles()) { + return null; + } else if (particleID == EnumParticleTypes.SPELL.getParticleID() && !Config.isPotionParticles()) { + return null; + } else if (particleID == EnumParticleTypes.SPELL_INSTANT.getParticleID() && !Config.isPotionParticles()) { + return null; + } else if (particleID == EnumParticleTypes.SPELL_WITCH.getParticleID() && !Config.isPotionParticles()) { + return null; + } else if (particleID == EnumParticleTypes.PORTAL.getParticleID() && !Config.isPortalParticles()) { + return null; + } else if (particleID == EnumParticleTypes.FLAME.getParticleID() && !Config.isAnimatedFlame()) { + return null; + } else if (particleID == EnumParticleTypes.REDSTONE.getParticleID() && !Config.isAnimatedRedstone()) { + return null; + } else if (particleID == EnumParticleTypes.DRIP_WATER.getParticleID() && !Config.isDrippingWaterLava()) { + return null; + } else if (particleID == EnumParticleTypes.DRIP_LAVA.getParticleID() && !Config.isDrippingWaterLava()) { + return null; + } else if (particleID == EnumParticleTypes.FIREWORKS_SPARK.getParticleID() && !Config.isFireworkParticles()) { + return null; + } else { + if (!ignoreRange) { + double d3 = 256.0D; + + if (particleID == EnumParticleTypes.CRIT.getParticleID()) { + d3 = 38416.0D; + } + + if (d0 * d0 + d1 * d1 + d2 * d2 > d3) { + return null; + } + + if (i > 1) { + return null; + } + } + + EntityFX entityfx = this.mc.effectRenderer.spawnEffectParticle(particleID, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, parameters); + + if (particleID == EnumParticleTypes.WATER_BUBBLE.getParticleID()) { + CustomColors.updateWaterFX(entityfx, this.theWorld, xCoord, yCoord, zCoord, this.renderEnv); + } + + if (particleID == EnumParticleTypes.WATER_SPLASH.getParticleID()) { + CustomColors.updateWaterFX(entityfx, this.theWorld, xCoord, yCoord, zCoord, this.renderEnv); + } + + if (particleID == EnumParticleTypes.WATER_DROP.getParticleID()) { + CustomColors.updateWaterFX(entityfx, this.theWorld, xCoord, yCoord, zCoord, this.renderEnv); + } + + if (particleID == EnumParticleTypes.TOWN_AURA.getParticleID()) { + CustomColors.updateMyceliumFX(entityfx); + } + + if (particleID == EnumParticleTypes.PORTAL.getParticleID()) { + CustomColors.updatePortalFX(entityfx); + } + + if (particleID == EnumParticleTypes.REDSTONE.getParticleID()) { + CustomColors.updateReddustFX(entityfx, this.theWorld, xCoord, yCoord, zCoord); + } + + return entityfx; + } + } else { + return null; + } + } + + public void onEntityAdded(Entity entityIn) { + RandomEntities.entityLoaded(entityIn, this.theWorld); + + if (Config.isDynamicLights()) { + DynamicLights.entityAdded(entityIn, this); + } + } + + public void onEntityRemoved(Entity entityIn) { + RandomEntities.entityUnloaded(entityIn, this.theWorld); + + if (Config.isDynamicLights()) { + DynamicLights.entityRemoved(entityIn, this); + } + } + + public void deleteAllDisplayLists() { + } + + public void broadcastSound(int soundID, BlockPos pos, int data) { + switch (soundID) { + case 1013: + case 1018: + if (this.mc.getRenderViewEntity() != null) { + double d0 = (double) pos.getX() - this.mc.getRenderViewEntity().posX; + double d1 = (double) pos.getY() - this.mc.getRenderViewEntity().posY; + double d2 = (double) pos.getZ() - this.mc.getRenderViewEntity().posZ; + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + double d4 = this.mc.getRenderViewEntity().posX; + double d5 = this.mc.getRenderViewEntity().posY; + double d6 = this.mc.getRenderViewEntity().posZ; + + if (d3 > 0.0D) { + d4 += d0 / d3 * 2.0D; + d5 += d1 / d3 * 2.0D; + d6 += d2 / d3 * 2.0D; + } + + if (soundID == 1013) { + this.theWorld.playSound(d4, d5, d6, "mob.wither.spawn", 1.0F, 1.0F, false); + } else { + this.theWorld.playSound(d4, d5, d6, "mob.enderdragon.end", 5.0F, 1.0F, false); + } + } + + default: + } + } + + public void playAuxSFX(EntityPlayer player, int sfxType, BlockPos blockPosIn, int data) { + Random random = this.theWorld.rand; + + switch (sfxType) { + case 1000: + this.theWorld.playSoundAtPos(blockPosIn, "random.click", 1.0F, 1.0F, false); + break; + + case 1001: + this.theWorld.playSoundAtPos(blockPosIn, "random.click", 1.0F, 1.2F, false); + break; + + case 1002: + this.theWorld.playSoundAtPos(blockPosIn, "random.bow", 1.0F, 1.2F, false); + break; + + case 1003: + this.theWorld.playSoundAtPos(blockPosIn, "random.door_open", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 1004: + this.theWorld.playSoundAtPos(blockPosIn, "random.fizz", 0.5F, 2.6F + (random.nextFloat() - random.nextFloat()) * 0.8F, false); + break; + + case 1005: + if (Item.getItemById(data) instanceof ItemRecord) { + this.theWorld.playRecord(blockPosIn, "records." + ((ItemRecord) Item.getItemById(data)).recordName); + } else { + this.theWorld.playRecord(blockPosIn, (String) null); + } + + break; + + case 1006: + this.theWorld.playSoundAtPos(blockPosIn, "random.door_close", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 1007: + this.theWorld.playSoundAtPos(blockPosIn, "mob.ghast.charge", 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1008: + this.theWorld.playSoundAtPos(blockPosIn, "mob.ghast.fireball", 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1009: + this.theWorld.playSoundAtPos(blockPosIn, "mob.ghast.fireball", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1010: + this.theWorld.playSoundAtPos(blockPosIn, "mob.zombie.wood", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1011: + this.theWorld.playSoundAtPos(blockPosIn, "mob.zombie.metal", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1012: + this.theWorld.playSoundAtPos(blockPosIn, "mob.zombie.woodbreak", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1014: + this.theWorld.playSoundAtPos(blockPosIn, "mob.wither.shoot", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1015: + this.theWorld.playSoundAtPos(blockPosIn, "mob.bat.takeoff", 0.05F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1016: + this.theWorld.playSoundAtPos(blockPosIn, "mob.zombie.infect", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1017: + this.theWorld.playSoundAtPos(blockPosIn, "mob.zombie.unfect", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1020: + this.theWorld.playSoundAtPos(blockPosIn, "random.anvil_break", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 1021: + this.theWorld.playSoundAtPos(blockPosIn, "random.anvil_use", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 1022: + this.theWorld.playSoundAtPos(blockPosIn, "random.anvil_land", 0.3F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 2000: + int i = data % 3 - 1; + int j = data / 3 % 3 - 1; + double d0 = (double) blockPosIn.getX() + (double) i * 0.6D + 0.5D; + double d1 = (double) blockPosIn.getY() + 0.5D; + double d2 = (double) blockPosIn.getZ() + (double) j * 0.6D + 0.5D; + + for (int i1 = 0; i1 < 10; ++i1) { + double d15 = random.nextDouble() * 0.2D + 0.01D; + double d16 = d0 + (double) i * 0.01D + (random.nextDouble() - 0.5D) * (double) j * 0.5D; + double d17 = d1 + (random.nextDouble() - 0.5D) * 0.5D; + double d18 = d2 + (double) j * 0.01D + (random.nextDouble() - 0.5D) * (double) i * 0.5D; + double d19 = (double) i * d15 + random.nextGaussian() * 0.01D; + double d20 = -0.03D + random.nextGaussian() * 0.01D; + double d21 = (double) j * d15 + random.nextGaussian() * 0.01D; + this.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d16, d17, d18, d19, d20, d21, new int[0]); + } + + return; + + case 2001: + Block block = Block.getBlockById(data & 4095); + + if (block.getMaterial() != Material.air) { + this.mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation(block.stepSound.getBreakSound()), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getFrequency() * 0.8F, (float) blockPosIn.getX() + 0.5F, (float) blockPosIn.getY() + 0.5F, (float) blockPosIn.getZ() + 0.5F)); + } + + this.mc.effectRenderer.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255)); + break; + + case 2002: + double d3 = (double) blockPosIn.getX(); + double d4 = (double) blockPosIn.getY(); + double d5 = (double) blockPosIn.getZ(); + + for (int k = 0; k < 8; ++k) { + this.spawnParticle(EnumParticleTypes.ITEM_CRACK, d3, d4, d5, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, new int[]{Item.getIdFromItem(Items.potionitem), data}); + } + + int j1 = Items.potionitem.getColorFromDamage(data); + float f = (float) (j1 >> 16 & 255) / 255.0F; + float f1 = (float) (j1 >> 8 & 255) / 255.0F; + float f2 = (float) (j1 >> 0 & 255) / 255.0F; + EnumParticleTypes enumparticletypes = EnumParticleTypes.SPELL; + + if (Items.potionitem.isEffectInstant(data)) { + enumparticletypes = EnumParticleTypes.SPELL_INSTANT; + } + + for (int k1 = 0; k1 < 100; ++k1) { + double d7 = random.nextDouble() * 4.0D; + double d9 = random.nextDouble() * Math.PI * 2.0D; + double d11 = Math.cos(d9) * d7; + double d23 = 0.01D + random.nextDouble() * 0.5D; + double d24 = Math.sin(d9) * d7; + EntityFX entityfx = this.spawnEntityFX(enumparticletypes.getParticleID(), enumparticletypes.getShouldIgnoreRange(), d3 + d11 * 0.1D, d4 + 0.3D, d5 + d24 * 0.1D, d11, d23, d24, new int[0]); + + if (entityfx != null) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() || (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.splashParticles.getValue()) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled()) { + entityfx.setAlphaF((float) CheatBreaker.getInstance().getModuleManager().particlesMod.normalEffectSplashOpacity.getValue() / 100.0F); + System.out.println("Setting alpha from mod value"); + } + float f3 = 0.75F + random.nextFloat() * 0.25F; + entityfx.setRBGColorF(f * f3, f1 * f3, f2 * f3); + entityfx.multiplyVelocity((float) d7); + } + } + } + + this.theWorld.playSoundAtPos(blockPosIn, "game.potion.smash", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 2003: + double d6 = (double) blockPosIn.getX() + 0.5D; + double d8 = blockPosIn.getY(); + double d10 = (double) blockPosIn.getZ() + 0.5D; + + + for (int l1 = 0; l1 < 8; ++l1) { + this.spawnParticle(EnumParticleTypes.ITEM_CRACK, d6, d8, d10, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, new int[]{Item.getIdFromItem(Items.ender_eye)}); + } + + for (double d22 = 0.0D; d22 < (Math.PI * 2D); d22 += 0.15707963267948966D) { + this.spawnParticle(EnumParticleTypes.PORTAL, d6 + Math.cos(d22) * 5.0D, d8 - 0.4D, d10 + Math.sin(d22) * 5.0D, Math.cos(d22) * -5.0D, 0.0D, Math.sin(d22) * -5.0D, new int[0]); + this.spawnParticle(EnumParticleTypes.PORTAL, d6 + Math.cos(d22) * 5.0D, d8 - 0.4D, d10 + Math.sin(d22) * 5.0D, Math.cos(d22) * -7.0D, 0.0D, Math.sin(d22) * -7.0D, new int[0]); + } + + return; + + case 2004: + for (int l = 0; l < 20; ++l) { + double d12 = (double) blockPosIn.getX() + 0.5D + ((double) this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + double d13 = (double) blockPosIn.getY() + 0.5D + ((double) this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + double d14 = (double) blockPosIn.getZ() + 0.5D + ((double) this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + this.theWorld.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d12, d13, d14, 0.0D, 0.0D, 0.0D, new int[0]); + this.theWorld.spawnParticle(EnumParticleTypes.FLAME, d12, d13, d14, 0.0D, 0.0D, 0.0D, new int[0]); + } + + return; + + case 2005: + ItemDye.spawnBonemealParticles(this.theWorld, blockPosIn, data); + } + } + + public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) { + if (progress >= 0 && progress < 10) { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress) this.damagedBlocks.get(Integer.valueOf(breakerId)); + + if (destroyblockprogress == null || destroyblockprogress.getPosition().getX() != pos.getX() || destroyblockprogress.getPosition().getY() != pos.getY() || destroyblockprogress.getPosition().getZ() != pos.getZ()) { + destroyblockprogress = new DestroyBlockProgress(breakerId, pos); + this.damagedBlocks.put(Integer.valueOf(breakerId), destroyblockprogress); + } + + destroyblockprogress.setPartialBlockDamage(progress); + destroyblockprogress.setCloudUpdateTick(this.cloudTickCounter); + } else { + this.damagedBlocks.remove(Integer.valueOf(breakerId)); + } + } + + public void setDisplayListEntitiesDirty() { + this.displayListEntitiesDirty = true; + } + + public boolean hasNoChunkUpdates() { + return this.chunksToUpdate.isEmpty() && this.renderDispatcher.hasChunkUpdates(); + } + + public void resetClouds() { + this.cloudRenderer.reset(); + } + + public int getCountRenderers() { + return this.viewFrustum.renderChunks.length; + } + + public int getCountActiveRenderers() { + return this.renderInfos.size(); + } + + public int getCountEntitiesRendered() { + return this.countEntitiesRendered; + } + + public int getCountTileEntitiesRendered() { + return this.countTileEntitiesRendered; + } + + public int getCountLoadedChunks() { + if (this.theWorld == null) { + return 0; + } else { + IChunkProvider ichunkprovider = this.theWorld.getChunkProvider(); + + if (ichunkprovider == null) { + return 0; + } else { + if (ichunkprovider != this.worldChunkProvider) { + this.worldChunkProvider = ichunkprovider; + this.worldChunkProviderMap = (LongHashMap) Reflector.getFieldValue(ichunkprovider, Reflector.ChunkProviderClient_chunkMapping); + } + + return this.worldChunkProviderMap == null ? 0 : this.worldChunkProviderMap.getNumHashElements(); + } + } + } + + public int getCountChunksToUpdate() { + return this.chunksToUpdate.size(); + } + + public RenderChunk getRenderChunk(BlockPos p_getRenderChunk_1_) { + return this.viewFrustum.getRenderChunk(p_getRenderChunk_1_); + } + + public WorldClient getWorld() { + return this.theWorld; + } + + private void clearRenderInfos() { + if (renderEntitiesCounter > 0) { + this.renderInfos = new ArrayList(this.renderInfos.size() + 16); + this.renderInfosEntities = new ArrayList(this.renderInfosEntities.size() + 16); + this.renderInfosTileEntities = new ArrayList(this.renderInfosTileEntities.size() + 16); + } else { + this.renderInfos.clear(); + this.renderInfosEntities.clear(); + this.renderInfosTileEntities.clear(); + } + } + + public void onPlayerPositionSet() { + if (this.firstWorldLoad) { + this.loadRenderers(); + this.firstWorldLoad = false; + } + } + + public void pauseChunkUpdates() { + if (this.renderDispatcher != null) { + this.renderDispatcher.pauseChunkUpdates(); + } + } + + public void resumeChunkUpdates() { + if (this.renderDispatcher != null) { + this.renderDispatcher.resumeChunkUpdates(); + } + } + + public void updateTileEntities(Collection tileEntitiesToRemove, Collection tileEntitiesToAdd) { + synchronized (this.setTileEntities) { + this.setTileEntities.removeAll(tileEntitiesToRemove); + this.setTileEntities.addAll(tileEntitiesToAdd); + } + } + + public static class ContainerLocalRenderInformation { + final RenderChunk renderChunk; + EnumFacing facing; + int setFacing; + + public ContainerLocalRenderInformation(RenderChunk p_i2_1_, EnumFacing p_i2_2_, int p_i2_3_) { + this.renderChunk = p_i2_1_; + this.facing = p_i2_2_; + this.setFacing = p_i2_3_; + } + + public void setFacingBit(byte p_setFacingBit_1_, EnumFacing p_setFacingBit_2_) { + this.setFacing = this.setFacing | p_setFacingBit_1_ | 1 << p_setFacingBit_2_.ordinal(); + } + + public boolean isFacingBit(EnumFacing p_isFacingBit_1_) { + return (this.setFacing & 1 << p_isFacingBit_1_.ordinal()) > 0; + } + + private void initialize(EnumFacing p_initialize_1_, int p_initialize_2_) { + this.facing = p_initialize_1_; + this.setFacing = p_initialize_2_; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderGlobal.~ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderGlobal.~ new file mode 100644 index 0000000..81f0ab7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderGlobal.~ @@ -0,0 +1,2732 @@ +package net.minecraft.client.renderer; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.gson.JsonSyntaxException; +import java.io.IOException; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Deque; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockEnderChest; +import net.minecraft.block.BlockSign; +import net.minecraft.block.BlockSkull; +import net.minecraft.block.Block.EnumOffsetType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.BlockModelRenderer; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.ChunkRenderContainer; +import net.minecraft.client.renderer.DestroyBlockProgress; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.RenderList; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.VboRenderList; +import net.minecraft.client.renderer.ViewFrustum; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; +import net.minecraft.client.renderer.chunk.CompiledChunk; +import net.minecraft.client.renderer.chunk.IRenderChunkFactory; +import net.minecraft.client.renderer.chunk.ListChunkFactory; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.client.renderer.chunk.VboChunkFactory; +import net.minecraft.client.renderer.chunk.VisGraph; +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySignRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexBuffer; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumType; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemRecord; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ClassInheritanceMultiMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Matrix4f; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.util.Vector3d; +import net.minecraft.util.BlockPos.MutableBlockPos; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.IWorldAccess; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.optifine.CustomColors; +import net.optifine.CustomSky; +import net.optifine.DynamicLights; +import net.optifine.Lagometer; +import net.optifine.RandomEntities; +import net.optifine.SmartAnimations; +import net.optifine.model.BlockModelUtils; +import net.optifine.reflect.Reflector; +import net.optifine.render.ChunkVisibility; +import net.optifine.render.CloudRenderer; +import net.optifine.render.RenderEnv; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersRender; +import net.optifine.shaders.ShadowUtils; +import net.optifine.shaders.gui.GuiShaderOptions; +import net.optifine.util.ChunkUtils; +import net.optifine.util.RenderChunkUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.vector.Vector3f; +import org.lwjgl.util.vector.Vector4f; + +public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListener { + private static final Logger field_147599_m = LogManager.getLogger(); + private static final ResourceLocation field_110927_h = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation field_110928_i = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation field_110925_j = new ResourceLocation("textures/environment/clouds.png"); + private static final ResourceLocation field_110926_k = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation field_175006_g = new ResourceLocation("textures/misc/forcefield.png"); + public final Minecraft field_72777_q; + private final TextureManager field_72770_i; + private final RenderManager field_175010_j; + private WorldClient field_72769_h; + private Set field_175009_l = Sets.newLinkedHashSet(); + private List field_72755_R = Lists.newArrayListWithCapacity(69696); + private final Set field_181024_n = Sets.newHashSet(); + private ViewFrustum field_175008_n; + private int field_72772_v = -1; + private int field_72771_w = -1; + private int field_72781_x = -1; + private VertexFormat field_175014_r; + private VertexBuffer field_175013_s; + private VertexBuffer field_175012_t; + private VertexBuffer field_175011_u; + private int field_72773_u; + public final Map field_72738_E = Maps.newHashMap(); + private final Map field_147593_P = Maps.newHashMap(); + private final TextureAtlasSprite[] field_94141_F = new TextureAtlasSprite[10]; + private Framebuffer field_175015_z; + private ShaderGroup field_174991_A; + private double field_174992_B = Double.MIN_VALUE; + private double field_174993_C = Double.MIN_VALUE; + private double field_174987_D = Double.MIN_VALUE; + private int field_174988_E = Integer.MIN_VALUE; + private int field_174989_F = Integer.MIN_VALUE; + private int field_174990_G = Integer.MIN_VALUE; + private double field_174997_H = Double.MIN_VALUE; + private double field_174998_I = Double.MIN_VALUE; + private double field_174999_J = Double.MIN_VALUE; + private double field_175000_K = Double.MIN_VALUE; + private double field_174994_L = Double.MIN_VALUE; + private final ChunkRenderDispatcher field_174995_M = new ChunkRenderDispatcher(); + private ChunkRenderContainer field_174996_N; + private int field_72739_F = -1; + private int field_72740_G = 2; + private int field_72748_H; + private int field_72749_I; + private int field_72750_J; + private boolean field_175002_T = false; + private ClippingHelper field_175001_U; + private final Vector4f[] field_175004_V = new Vector4f[8]; + private final Vector3d field_175003_W = new Vector3d(); + private boolean field_175005_X = false; + IRenderChunkFactory field_175007_a; + private double field_147596_f; + private double field_147597_g; + private double field_147602_h; + public boolean field_147595_R = true; + private CloudRenderer cloudRenderer; + public Entity renderedEntity; + public Set chunksToResortTransparency = new LinkedHashSet(); + public Set chunksToUpdateForced = new LinkedHashSet(); + private Deque visibilityDeque = new ArrayDeque(); + private List renderInfosEntities = new ArrayList(1024); + private List renderInfosTileEntities = new ArrayList(1024); + private List renderInfosNormal = new ArrayList(1024); + private List renderInfosEntitiesNormal = new ArrayList(1024); + private List renderInfosTileEntitiesNormal = new ArrayList(1024); + private List renderInfosShadow = new ArrayList(1024); + private List renderInfosEntitiesShadow = new ArrayList(1024); + private List renderInfosTileEntitiesShadow = new ArrayList(1024); + private int renderDistance = 0; + private int renderDistanceSq = 0; + private static final Set SET_ALL_FACINGS = Collections.unmodifiableSet(new HashSet(Arrays.asList(EnumFacing.field_82609_l))); + private int countTileEntitiesRendered; + private IChunkProvider worldChunkProvider = null; + private LongHashMap worldChunkProviderMap = null; + private int countLoadedChunksPrev = 0; + private RenderEnv renderEnv = new RenderEnv(Blocks.field_150350_a.func_176223_P(), new BlockPos(0, 0, 0)); + public boolean renderOverlayDamaged = false; + public boolean renderOverlayEyes = false; + private boolean firstWorldLoad = false; + private static int renderEntitiesCounter = 0; + + public RenderGlobal(Minecraft p_i1249_1_) { + this.cloudRenderer = new CloudRenderer(p_i1249_1_); + this.field_72777_q = p_i1249_1_; + this.field_175010_j = p_i1249_1_.func_175598_ae(); + this.field_72770_i = p_i1249_1_.func_110434_K(); + this.field_72770_i.func_110577_a(field_175006_g); + GL11.glTexParameteri(3553, 10242, 10497); + GL11.glTexParameteri(3553, 10243, 10497); + GlStateManager.func_179144_i(0); + this.func_174971_n(); + this.field_175005_X = OpenGlHelper.func_176075_f(); + if(this.field_175005_X) { + this.field_174996_N = new VboRenderList(); + this.field_175007_a = new VboChunkFactory(); + } else { + this.field_174996_N = new RenderList(); + this.field_175007_a = new ListChunkFactory(); + } + + this.field_175014_r = new VertexFormat(); + this.field_175014_r.func_181721_a(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.POSITION, 3)); + this.func_174963_q(); + this.func_174980_p(); + this.func_174964_o(); + } + + public void func_110549_a(IResourceManager p_110549_1_) { + this.func_174971_n(); + } + + private void func_174971_n() { + TextureMap texturemap = this.field_72777_q.func_147117_R(); + + for(int i = 0; i < this.field_94141_F.length; ++i) { + this.field_94141_F[i] = texturemap.func_110572_b("minecraft:blocks/destroy_stage_" + i); + } + + } + + public void func_174966_b() { + if(OpenGlHelper.field_148824_g) { + if(ShaderLinkHelper.func_148074_b() == null) { + ShaderLinkHelper.func_148076_a(); + } + + ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json"); + + try { + this.field_174991_A = new ShaderGroup(this.field_72777_q.func_110434_K(), this.field_72777_q.func_110442_L(), this.field_72777_q.func_147110_a(), resourcelocation); + this.field_174991_A.func_148026_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d); + this.field_175015_z = this.field_174991_A.func_177066_a("final"); + } catch (IOException ioexception) { + field_147599_m.warn((String)("Failed to load shader: " + resourcelocation), (Throwable)ioexception); + this.field_174991_A = null; + this.field_175015_z = null; + } catch (JsonSyntaxException jsonsyntaxexception) { + field_147599_m.warn((String)("Failed to load shader: " + resourcelocation), (Throwable)jsonsyntaxexception); + this.field_174991_A = null; + this.field_175015_z = null; + } + } else { + this.field_174991_A = null; + this.field_175015_z = null; + } + + } + + public void func_174975_c() { + if(this.func_174985_d()) { + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 0, 1); + this.field_175015_z.func_178038_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d, false); + GlStateManager.func_179084_k(); + } + + } + + protected boolean func_174985_d() { + return !Config.isFastRender() && !Config.isShaders() && !Config.isAntialiasing()?this.field_175015_z != null && this.field_174991_A != null && this.field_72777_q.field_71439_g != null && this.field_72777_q.field_71439_g.v() && this.field_72777_q.field_71474_y.field_178883_an.func_151470_d():false; + } + + private void func_174964_o() { + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + if(this.field_175011_u != null) { + this.field_175011_u.func_177362_c(); + } + + if(this.field_72781_x >= 0) { + GLAllocation.func_74523_b(this.field_72781_x); + this.field_72781_x = -1; + } + + if(this.field_175005_X) { + this.field_175011_u = new VertexBuffer(this.field_175014_r); + this.func_174968_a(worldrenderer, -16.0F, true); + worldrenderer.func_178977_d(); + worldrenderer.func_178965_a(); + this.field_175011_u.func_181722_a(worldrenderer.func_178966_f()); + } else { + this.field_72781_x = GLAllocation.func_74526_a(1); + GL11.glNewList(this.field_72781_x, 4864); + this.func_174968_a(worldrenderer, -16.0F, true); + tessellator.func_78381_a(); + GL11.glEndList(); + } + + } + + private void func_174980_p() { + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + if(this.field_175012_t != null) { + this.field_175012_t.func_177362_c(); + } + + if(this.field_72771_w >= 0) { + GLAllocation.func_74523_b(this.field_72771_w); + this.field_72771_w = -1; + } + + if(this.field_175005_X) { + this.field_175012_t = new VertexBuffer(this.field_175014_r); + this.func_174968_a(worldrenderer, 16.0F, false); + worldrenderer.func_178977_d(); + worldrenderer.func_178965_a(); + this.field_175012_t.func_181722_a(worldrenderer.func_178966_f()); + } else { + this.field_72771_w = GLAllocation.func_74526_a(1); + GL11.glNewList(this.field_72771_w, 4864); + this.func_174968_a(worldrenderer, 16.0F, false); + tessellator.func_78381_a(); + GL11.glEndList(); + } + + } + + private void func_174968_a(WorldRenderer p_174968_1_, float p_174968_2_, boolean p_174968_3_) { + int i = 64; + int j = 6; + p_174968_1_.func_181668_a(7, DefaultVertexFormats.field_181705_e); + int k = (this.renderDistance / 64 + 1) * 64 + 64; + + for(int l = -k; l <= k; l += 64) { + for(int i1 = -k; i1 <= k; i1 += 64) { + float f = (float)l; + float f1 = (float)(l + 64); + if(p_174968_3_) { + f1 = (float)l; + f = (float)(l + 64); + } + + p_174968_1_.func_181662_b((double)f, (double)p_174968_2_, (double)i1).func_181675_d(); + p_174968_1_.func_181662_b((double)f1, (double)p_174968_2_, (double)i1).func_181675_d(); + p_174968_1_.func_181662_b((double)f1, (double)p_174968_2_, (double)(i1 + 64)).func_181675_d(); + p_174968_1_.func_181662_b((double)f, (double)p_174968_2_, (double)(i1 + 64)).func_181675_d(); + } + } + + } + + private void func_174963_q() { + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + if(this.field_175013_s != null) { + this.field_175013_s.func_177362_c(); + } + + if(this.field_72772_v >= 0) { + GLAllocation.func_74523_b(this.field_72772_v); + this.field_72772_v = -1; + } + + if(this.field_175005_X) { + this.field_175013_s = new VertexBuffer(this.field_175014_r); + this.func_180444_a(worldrenderer); + worldrenderer.func_178977_d(); + worldrenderer.func_178965_a(); + this.field_175013_s.func_181722_a(worldrenderer.func_178966_f()); + } else { + this.field_72772_v = GLAllocation.func_74526_a(1); + GlStateManager.func_179094_E(); + GL11.glNewList(this.field_72772_v, 4864); + this.func_180444_a(worldrenderer); + tessellator.func_78381_a(); + GL11.glEndList(); + GlStateManager.func_179121_F(); + } + + } + + private void func_180444_a(WorldRenderer p_180444_1_) { + Random random = new Random(10842L); + p_180444_1_.func_181668_a(7, DefaultVertexFormats.field_181705_e); + + for(int i = 0; i < 1500; ++i) { + double d0 = (double)(random.nextFloat() * 2.0F - 1.0F); + double d1 = (double)(random.nextFloat() * 2.0F - 1.0F); + double d2 = (double)(random.nextFloat() * 2.0F - 1.0F); + double d3 = (double)(0.15F + random.nextFloat() * 0.1F); + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + if(d4 < 1.0D && d4 > 0.01D) { + d4 = 1.0D / Math.sqrt(d4); + d0 = d0 * d4; + d1 = d1 * d4; + d2 = d2 * d4; + double d5 = d0 * 100.0D; + double d6 = d1 * 100.0D; + double d7 = d2 * 100.0D; + double d8 = Math.atan2(d0, d2); + double d9 = Math.sin(d8); + double d10 = Math.cos(d8); + double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1); + double d12 = Math.sin(d11); + double d13 = Math.cos(d11); + double d14 = random.nextDouble() * 3.141592653589793D * 2.0D; + double d15 = Math.sin(d14); + double d16 = Math.cos(d14); + + for(int j = 0; j < 4; ++j) { + double d17 = 0.0D; + double d18 = (double)((j & 2) - 1) * d3; + double d19 = (double)((j + 1 & 2) - 1) * d3; + double d20 = 0.0D; + double d21 = d18 * d16 - d19 * d15; + double d22 = d19 * d16 + d18 * d15; + double d23 = d21 * d12 + 0.0D * d13; + double d24 = 0.0D * d12 - d21 * d13; + double d25 = d24 * d9 - d22 * d10; + double d26 = d22 * d9 + d24 * d10; + p_180444_1_.func_181662_b(d5 + d25, d6 + d23, d7 + d26).func_181675_d(); + } + } + } + + } + + public void func_72732_a(WorldClient p_72732_1_) { + if(this.field_72769_h != null) { + this.field_72769_h.func_72848_b(this); + } + + this.field_174992_B = Double.MIN_VALUE; + this.field_174993_C = Double.MIN_VALUE; + this.field_174987_D = Double.MIN_VALUE; + this.field_174988_E = Integer.MIN_VALUE; + this.field_174989_F = Integer.MIN_VALUE; + this.field_174990_G = Integer.MIN_VALUE; + this.field_175010_j.func_78717_a(p_72732_1_); + this.field_72769_h = p_72732_1_; + if(Config.isDynamicLights()) { + DynamicLights.clear(); + } + + ChunkVisibility.reset(); + this.worldChunkProvider = null; + this.worldChunkProviderMap = null; + this.renderEnv.reset((IBlockState)null, (BlockPos)null); + Shaders.checkWorldChanged(this.field_72769_h); + if(p_72732_1_ != null) { + p_72732_1_.func_72954_a(this); + this.func_72712_a(); + } else { + this.field_175009_l.clear(); + this.clearRenderInfos(); + if(this.field_175008_n != null) { + this.field_175008_n.func_178160_a(); + } + + this.field_175008_n = null; + } + + } + + public void func_72712_a() { + if(this.field_72769_h != null) { + this.field_147595_R = true; + Blocks.field_150362_t.func_150122_b(Config.isTreesFancy()); + Blocks.field_150361_u.func_150122_b(Config.isTreesFancy()); + BlockModelRenderer.updateAoLightValue(); + if(Config.isDynamicLights()) { + DynamicLights.clear(); + } + + SmartAnimations.update(); + this.field_72739_F = this.field_72777_q.field_71474_y.field_151451_c; + this.renderDistance = this.field_72739_F * 16; + this.renderDistanceSq = this.renderDistance * this.renderDistance; + boolean flag = this.field_175005_X; + this.field_175005_X = OpenGlHelper.func_176075_f(); + if(flag && !this.field_175005_X) { + this.field_174996_N = new RenderList(); + this.field_175007_a = new ListChunkFactory(); + } else if(!flag && this.field_175005_X) { + this.field_174996_N = new VboRenderList(); + this.field_175007_a = new VboChunkFactory(); + } + + this.func_174963_q(); + this.func_174980_p(); + this.func_174964_o(); + if(this.field_175008_n != null) { + this.field_175008_n.func_178160_a(); + } + + this.func_174986_e(); + synchronized(this.field_181024_n) { + this.field_181024_n.clear(); + } + + this.field_175008_n = new ViewFrustum(this.field_72769_h, this.field_72777_q.field_71474_y.field_151451_c, this, this.field_175007_a); + if(this.field_72769_h != null) { + Entity entity = this.field_72777_q.func_175606_aa(); + if(entity != null) { + this.field_175008_n.func_178163_a(entity.field_70165_t, entity.field_70161_v); + } + } + + this.field_72740_G = 2; + } + + if(this.field_72777_q.field_71439_g == null) { + this.firstWorldLoad = true; + } + + } + + protected void func_174986_e() { + this.field_175009_l.clear(); + this.field_174995_M.func_178514_b(); + } + + public void func_72720_a(int p_72720_1_, int p_72720_2_) { + if(OpenGlHelper.field_148824_g && this.field_174991_A != null) { + this.field_174991_A.func_148026_a(p_72720_1_, p_72720_2_); + } + + } + + public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_) { + int i = 0; + if(Reflector.MinecraftForgeClient_getRenderPass.exists()) { + i = Reflector.callInt(Reflector.MinecraftForgeClient_getRenderPass, new Object[0]); + } + + if(this.field_72740_G > 0) { + if(i > 0) { + return; + } + + --this.field_72740_G; + } else { + double d0 = p_180446_1_.field_70169_q + (p_180446_1_.field_70165_t - p_180446_1_.field_70169_q) * (double)p_180446_3_; + double d1 = p_180446_1_.field_70167_r + (p_180446_1_.field_70163_u - p_180446_1_.field_70167_r) * (double)p_180446_3_; + double d2 = p_180446_1_.field_70166_s + (p_180446_1_.field_70161_v - p_180446_1_.field_70166_s) * (double)p_180446_3_; + this.field_72769_h.field_72984_F.func_76320_a("prepare"); + TileEntityRendererDispatcher.field_147556_a.func_178470_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), p_180446_3_); + this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_); + ++renderEntitiesCounter; + if(i == 0) { + this.field_72748_H = 0; + this.field_72749_I = 0; + this.field_72750_J = 0; + this.countTileEntitiesRendered = 0; + } + + Entity entity = this.field_72777_q.func_175606_aa(); + double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_; + double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_; + double d5 = entity.field_70136_U + (entity.field_70161_v - entity.field_70136_U) * (double)p_180446_3_; + TileEntityRendererDispatcher.field_147554_b = d3; + TileEntityRendererDispatcher.field_147555_c = d4; + TileEntityRendererDispatcher.field_147552_d = d5; + this.field_175010_j.func_178628_a(d3, d4, d5); + this.field_72777_q.field_71460_t.func_180436_i(); + this.field_72769_h.field_72984_F.func_76318_c("global"); + List list = this.field_72769_h.func_72910_y(); + if(i == 0) { + this.field_72748_H = list.size(); + } + + if(Config.isFogOff() && this.field_72777_q.field_71460_t.fogStandard) { + GlStateManager.func_179106_n(); + } + + boolean flag = Reflector.ForgeEntity_shouldRenderInPass.exists(); + boolean flag1 = Reflector.ForgeTileEntity_shouldRenderInPass.exists(); + + for(int j = 0; j < this.field_72769_h.field_73007_j.size(); ++j) { + Entity entity1 = (Entity)this.field_72769_h.field_73007_j.get(j); + if(!flag || Reflector.callBoolean(entity1, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) { + ++this.field_72749_I; + if(entity1.func_145770_h(d0, d1, d2)) { + this.field_175010_j.func_147937_a(entity1, p_180446_3_); + } + } + } + + if(this.func_174985_d()) { + GlStateManager.func_179143_c(519); + GlStateManager.func_179106_n(); + this.field_175015_z.func_147614_f(); + this.field_175015_z.func_147610_a(false); + this.field_72769_h.field_72984_F.func_76318_c("entityOutlines"); + RenderHelper.func_74518_a(); + this.field_175010_j.func_178632_c(true); + + for(int k = 0; k < list.size(); ++k) { + Entity entity3 = (Entity)list.get(k); + boolean flag2 = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn(); + boolean flag3 = entity3.func_145770_h(d0, d1, d2) && (entity3.field_70158_ak || p_180446_2_.func_78546_a(entity3.func_174813_aQ()) || entity3.field_70153_n == this.field_72777_q.field_71439_g) && entity3 instanceof EntityPlayer; + if((entity3 != this.field_72777_q.func_175606_aa() || this.field_72777_q.field_71474_y.field_74320_O != 0 || flag2) && flag3) { + this.field_175010_j.func_147937_a(entity3, p_180446_3_); + } + } + + this.field_175010_j.func_178632_c(false); + RenderHelper.func_74519_b(); + GlStateManager.func_179132_a(false); + this.field_174991_A.func_148018_a(p_180446_3_); + GlStateManager.func_179145_e(); + GlStateManager.func_179132_a(true); + this.field_72777_q.func_147110_a().func_147610_a(false); + GlStateManager.func_179127_m(); + GlStateManager.func_179147_l(); + GlStateManager.func_179142_g(); + GlStateManager.func_179143_c(515); + GlStateManager.func_179126_j(); + GlStateManager.func_179141_d(); + } + + this.field_72769_h.field_72984_F.func_76318_c("entities"); + boolean flag6 = Config.isShaders(); + if(flag6) { + Shaders.beginEntities(); + } + + RenderItemFrame.updateItemRenderDistance(); + boolean flag7 = this.field_72777_q.field_71474_y.field_74347_j; + this.field_72777_q.field_71474_y.field_74347_j = Config.isDroppedItemsFancy(); + boolean flag8 = Shaders.isShadowPass && !this.field_72777_q.field_71439_g.v(); + + label926: + for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.renderInfosEntities) { + Chunk chunk = renderglobal$containerlocalrenderinformation.field_178036_a.getChunk(); + ClassInheritanceMultiMap classinheritancemultimap = chunk.func_177429_s()[renderglobal$containerlocalrenderinformation.field_178036_a.func_178568_j().o() / 16]; + if(!classinheritancemultimap.isEmpty()) { + Iterator iterator = classinheritancemultimap.iterator(); + + while(true) { + Entity entity2; + boolean flag4; + while(true) { + if(!iterator.hasNext()) { + continue label926; + } + + entity2 = (Entity)iterator.next(); + if(!flag || Reflector.callBoolean(entity2, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) { + flag4 = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.field_70153_n == this.field_72777_q.field_71439_g; + if(!flag4) { + break; + } + + boolean flag5 = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase?((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn():false; + if((entity2 != this.field_72777_q.func_175606_aa() || flag8 || this.field_72777_q.field_71474_y.field_74320_O != 0 || flag5) && (entity2.field_70163_u < 0.0D || entity2.field_70163_u >= 256.0D || this.field_72769_h.func_175667_e(new BlockPos(entity2)))) { + ++this.field_72749_I; + this.renderedEntity = entity2; + if(flag6) { + Shaders.nextEntity(entity2); + } + + this.field_175010_j.func_147937_a(entity2, p_180446_3_); + this.renderedEntity = null; + break; + } + } + } + + if(!flag4 && entity2 instanceof EntityWitherSkull && (!flag || Reflector.callBoolean(entity2, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)}))) { + this.renderedEntity = entity2; + if(flag6) { + Shaders.nextEntity(entity2); + } + + this.field_72777_q.func_175598_ae().func_178630_b(entity2, p_180446_3_); + this.renderedEntity = null; + } + } + } + } + + this.field_72777_q.field_71474_y.field_74347_j = flag7; + if(flag6) { + Shaders.endEntities(); + Shaders.beginBlockEntities(); + } + + this.field_72769_h.field_72984_F.func_76318_c("blockentities"); + RenderHelper.func_74519_b(); + if(Reflector.ForgeTileEntity_hasFastRenderer.exists()) { + TileEntityRendererDispatcher.field_147556_a.preDrawBatch(); + } + + TileEntitySignRenderer.updateTextRenderDistance(); + + label1408: + for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.renderInfosTileEntities) { + List list1 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b(); + if(!list1.isEmpty()) { + Iterator iterator1 = list1.iterator(); + + while(true) { + TileEntity tileentity1; + while(true) { + if(!iterator1.hasNext()) { + continue label1408; + } + + tileentity1 = (TileEntity)iterator1.next(); + if(!flag1) { + break; + } + + if(Reflector.callBoolean(tileentity1, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) { + AxisAlignedBB axisalignedbb1 = (AxisAlignedBB)Reflector.call(tileentity1, Reflector.ForgeTileEntity_getRenderBoundingBox, new Object[0]); + if(axisalignedbb1 == null || p_180446_2_.func_78546_a(axisalignedbb1)) { + break; + } + } + } + + if(flag6) { + Shaders.nextBlockEntity(tileentity1); + } + + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, -1); + ++this.countTileEntitiesRendered; + } + } + } + + synchronized(this.field_181024_n) { + for(TileEntity tileentity : this.field_181024_n) { + if(!flag1 || Reflector.callBoolean(tileentity, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)})) { + if(flag6) { + Shaders.nextBlockEntity(tileentity); + } + + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1); + } + } + } + + if(Reflector.ForgeTileEntity_hasFastRenderer.exists()) { + TileEntityRendererDispatcher.field_147556_a.drawBatch(i); + } + + this.renderOverlayDamaged = true; + this.func_180443_s(); + + for(DestroyBlockProgress destroyblockprogress : this.field_72738_E.values()) { + BlockPos blockpos = destroyblockprogress.func_180246_b(); + TileEntity tileentity2 = this.field_72769_h.func_175625_s(blockpos); + if(tileentity2 instanceof TileEntityChest) { + TileEntityChest tileentitychest = (TileEntityChest)tileentity2; + if(tileentitychest.field_145991_k != null) { + blockpos = blockpos.func_177972_a(EnumFacing.WEST); + tileentity2 = this.field_72769_h.func_175625_s(blockpos); + } else if(tileentitychest.field_145992_i != null) { + blockpos = blockpos.func_177972_a(EnumFacing.NORTH); + tileentity2 = this.field_72769_h.func_175625_s(blockpos); + } + } + + Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); + boolean flag9; + if(flag1) { + flag9 = false; + if(tileentity2 != null && Reflector.callBoolean(tileentity2, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[]{Integer.valueOf(i)}) && Reflector.callBoolean(tileentity2, Reflector.ForgeTileEntity_canRenderBreaking, new Object[0])) { + AxisAlignedBB axisalignedbb = (AxisAlignedBB)Reflector.call(tileentity2, Reflector.ForgeTileEntity_getRenderBoundingBox, new Object[0]); + if(axisalignedbb != null) { + flag9 = p_180446_2_.func_78546_a(axisalignedbb); + } + } + } else { + flag9 = tileentity2 != null && (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull); + } + + if(flag9) { + if(flag6) { + Shaders.nextBlockEntity(tileentity2); + } + + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, destroyblockprogress.func_73106_e()); + } + } + + this.func_174969_t(); + this.renderOverlayDamaged = false; + if(flag6) { + Shaders.endBlockEntities(); + } + + --renderEntitiesCounter; + this.field_72777_q.field_71460_t.func_175072_h(); + this.field_72777_q.field_71424_I.func_76319_b(); + } + + } + + public String func_72735_c() { + int i = this.field_175008_n.field_178164_f.length; + int j = 0; + + for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) { + CompiledChunk compiledchunk = renderglobal$containerlocalrenderinformation.field_178036_a.field_178590_b; + if(compiledchunk != CompiledChunk.field_178502_a && !compiledchunk.func_178489_a()) { + ++j; + } + } + + return String.format("C: %d/%d %sD: %d, %s", new Object[]{Integer.valueOf(j), Integer.valueOf(i), this.field_72777_q.field_175612_E?"(s) ":"", Integer.valueOf(this.field_72739_F), this.field_174995_M.func_178504_a()}); + } + + public String func_72723_d() { + return "E: " + this.field_72749_I + "/" + this.field_72748_H + ", B: " + this.field_72750_J + ", I: " + (this.field_72748_H - this.field_72750_J - this.field_72749_I) + ", " + Config.getVersionDebug(); + } + + public void func_174970_a(Entity p_174970_1_, double p_174970_2_, ICamera p_174970_4_, int p_174970_5_, boolean p_174970_6_) { + if(this.field_72777_q.field_71474_y.field_151451_c != this.field_72739_F) { + this.func_72712_a(); + } + + this.field_72769_h.field_72984_F.func_76320_a("camera"); + double d0 = p_174970_1_.field_70165_t - this.field_174992_B; + double d1 = p_174970_1_.field_70163_u - this.field_174993_C; + double d2 = p_174970_1_.field_70161_v - this.field_174987_D; + if(this.field_174988_E != p_174970_1_.field_70176_ah || this.field_174989_F != p_174970_1_.field_70162_ai || this.field_174990_G != p_174970_1_.field_70164_aj || d0 * d0 + d1 * d1 + d2 * d2 > 16.0D) { + this.field_174992_B = p_174970_1_.field_70165_t; + this.field_174993_C = p_174970_1_.field_70163_u; + this.field_174987_D = p_174970_1_.field_70161_v; + this.field_174988_E = p_174970_1_.field_70176_ah; + this.field_174989_F = p_174970_1_.field_70162_ai; + this.field_174990_G = p_174970_1_.field_70164_aj; + this.field_175008_n.func_178163_a(p_174970_1_.field_70165_t, p_174970_1_.field_70161_v); + } + + if(Config.isDynamicLights()) { + DynamicLights.update(this); + } + + this.field_72769_h.field_72984_F.func_76318_c("renderlistcamera"); + double d3 = p_174970_1_.field_70142_S + (p_174970_1_.field_70165_t - p_174970_1_.field_70142_S) * p_174970_2_; + double d4 = p_174970_1_.field_70137_T + (p_174970_1_.field_70163_u - p_174970_1_.field_70137_T) * p_174970_2_; + double d5 = p_174970_1_.field_70136_U + (p_174970_1_.field_70161_v - p_174970_1_.field_70136_U) * p_174970_2_; + this.field_174996_N.func_178004_a(d3, d4, d5); + this.field_72769_h.field_72984_F.func_76318_c("cull"); + if(this.field_175001_U != null) { + Frustum frustum = new Frustum(this.field_175001_U); + frustum.func_78547_a(this.field_175003_W.field_181059_a, this.field_175003_W.field_181060_b, this.field_175003_W.field_181061_c); + p_174970_4_ = frustum; + } + + this.field_72777_q.field_71424_I.func_76318_c("culling"); + BlockPos blockpos = new BlockPos(d3, d4 + (double)p_174970_1_.func_70047_e(), d5); + RenderChunk renderchunk = this.field_175008_n.func_178161_a(blockpos); + new BlockPos(MathHelper.func_76128_c(d3 / 16.0D) * 16, MathHelper.func_76128_c(d4 / 16.0D) * 16, MathHelper.func_76128_c(d5 / 16.0D) * 16); + this.field_147595_R = this.field_147595_R || !this.field_175009_l.isEmpty() || p_174970_1_.field_70165_t != this.field_174997_H || p_174970_1_.field_70163_u != this.field_174998_I || p_174970_1_.field_70161_v != this.field_174999_J || (double)p_174970_1_.field_70125_A != this.field_175000_K || (double)p_174970_1_.field_70177_z != this.field_174994_L; + this.field_174997_H = p_174970_1_.field_70165_t; + this.field_174998_I = p_174970_1_.field_70163_u; + this.field_174999_J = p_174970_1_.field_70161_v; + this.field_175000_K = (double)p_174970_1_.field_70125_A; + this.field_174994_L = (double)p_174970_1_.field_70177_z; + boolean flag = this.field_175001_U != null; + this.field_72777_q.field_71424_I.func_76318_c("update"); + Lagometer.timerVisibility.start(); + int i = this.getCountLoadedChunks(); + if(i != this.countLoadedChunksPrev) { + this.countLoadedChunksPrev = i; + this.field_147595_R = true; + } + + int j = 256; + if(!ChunkVisibility.isFinished()) { + this.field_147595_R = true; + } + + if(!flag && this.field_147595_R && Config.isIntegratedServerRunning()) { + j = ChunkVisibility.getMaxChunkY(this.field_72769_h, p_174970_1_, this.field_72739_F); + } + + RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos(p_174970_1_.field_70165_t, p_174970_1_.field_70163_u, p_174970_1_.field_70161_v)); + if(Shaders.isShadowPass) { + this.field_72755_R = this.renderInfosShadow; + this.renderInfosEntities = this.renderInfosEntitiesShadow; + this.renderInfosTileEntities = this.renderInfosTileEntitiesShadow; + if(!flag && this.field_147595_R) { + this.clearRenderInfos(); + if(renderchunk1 != null && renderchunk1.func_178568_j().o() > j) { + this.renderInfosEntities.add(renderchunk1.getRenderInfo()); + } + + Iterator iterator = ShadowUtils.makeShadowChunkIterator(this.field_72769_h, p_174970_2_, p_174970_1_, this.field_72739_F, this.field_175008_n); + + while(iterator.hasNext()) { + RenderChunk renderchunk2 = (RenderChunk)iterator.next(); + if(renderchunk2 != null && renderchunk2.func_178568_j().o() <= j) { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation = renderchunk2.getRenderInfo(); + if(!renderchunk2.field_178590_b.func_178489_a() || renderchunk2.func_178569_m()) { + this.field_72755_R.add(renderglobal$containerlocalrenderinformation); + } + + if(ChunkUtils.hasEntities(renderchunk2.getChunk())) { + this.renderInfosEntities.add(renderglobal$containerlocalrenderinformation); + } + + if(renderchunk2.func_178571_g().func_178485_b().size() > 0) { + this.renderInfosTileEntities.add(renderglobal$containerlocalrenderinformation); + } + } + } + } + } else { + this.field_72755_R = this.renderInfosNormal; + this.renderInfosEntities = this.renderInfosEntitiesNormal; + this.renderInfosTileEntities = this.renderInfosTileEntitiesNormal; + } + + if(!flag && this.field_147595_R && !Shaders.isShadowPass) { + this.field_147595_R = false; + this.clearRenderInfos(); + this.visibilityDeque.clear(); + Deque deque = this.visibilityDeque; + boolean flag1 = this.field_72777_q.field_175612_E; + if(renderchunk != null && renderchunk.func_178568_j().o() <= j) { + boolean flag2 = false; + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation4 = new RenderGlobal.ContainerLocalRenderInformation(renderchunk, (EnumFacing)null, 0); + Set set1 = SET_ALL_FACINGS; + if(set1.size() == 1) { + Vector3f vector3f = this.func_174962_a(p_174970_1_, p_174970_2_); + EnumFacing enumfacing2 = EnumFacing.func_176737_a(vector3f.x, vector3f.y, vector3f.z).func_176734_d(); + set1.remove(enumfacing2); + } + + if(set1.isEmpty()) { + flag2 = true; + } + + if(flag2 && !p_174970_6_) { + this.field_72755_R.add(renderglobal$containerlocalrenderinformation4); + } else { + if(p_174970_6_ && this.field_72769_h.func_180495_p(blockpos).func_177230_c().func_149662_c()) { + flag1 = false; + } + + renderchunk.func_178577_a(p_174970_5_); + deque.add(renderglobal$containerlocalrenderinformation4); + } + } else { + int j1 = blockpos.o() > 0?Math.min(j, 248):8; + if(renderchunk1 != null) { + this.renderInfosEntities.add(renderchunk1.getRenderInfo()); + } + + for(int k = -this.field_72739_F; k <= this.field_72739_F; ++k) { + for(int l = -this.field_72739_F; l <= this.field_72739_F; ++l) { + RenderChunk renderchunk3 = this.field_175008_n.func_178161_a(new BlockPos((k << 4) + 8, j1, (l << 4) + 8)); + if(renderchunk3 != null && renderchunk3.isBoundingBoxInFrustum((ICamera)p_174970_4_, p_174970_5_)) { + renderchunk3.func_178577_a(p_174970_5_); + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 = renderchunk3.getRenderInfo(); + renderglobal$containerlocalrenderinformation1.initialize((EnumFacing)null, 0); + deque.add(renderglobal$containerlocalrenderinformation1); + } + } + } + } + + this.field_72777_q.field_71424_I.func_76320_a("iteration"); + boolean flag3 = Config.isFogOn(); + + while(!deque.isEmpty()) { + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation5 = (RenderGlobal.ContainerLocalRenderInformation)deque.poll(); + RenderChunk renderchunk6 = renderglobal$containerlocalrenderinformation5.field_178036_a; + EnumFacing enumfacing1 = renderglobal$containerlocalrenderinformation5.field_178034_b; + CompiledChunk compiledchunk = renderchunk6.field_178590_b; + if(!compiledchunk.func_178489_a() || renderchunk6.func_178569_m()) { + this.field_72755_R.add(renderglobal$containerlocalrenderinformation5); + } + + if(ChunkUtils.hasEntities(renderchunk6.getChunk())) { + this.renderInfosEntities.add(renderglobal$containerlocalrenderinformation5); + } + + if(compiledchunk.func_178485_b().size() > 0) { + this.renderInfosTileEntities.add(renderglobal$containerlocalrenderinformation5); + } + + for(EnumFacing enumfacing : flag1?ChunkVisibility.getFacingsNotOpposite(renderglobal$containerlocalrenderinformation5.field_178035_c):EnumFacing.field_82609_l) { + if(!flag1 || enumfacing1 == null || compiledchunk.func_178495_a(enumfacing1.func_176734_d(), enumfacing)) { + RenderChunk renderchunk4 = this.getRenderChunkOffset(blockpos, renderchunk6, enumfacing, flag3, j); + if(renderchunk4 != null && renderchunk4.func_178577_a(p_174970_5_) && renderchunk4.isBoundingBoxInFrustum((ICamera)p_174970_4_, p_174970_5_)) { + int i1 = renderglobal$containerlocalrenderinformation5.field_178035_c | 1 << enumfacing.ordinal(); + RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation2 = renderchunk4.getRenderInfo(); + renderglobal$containerlocalrenderinformation2.initialize(enumfacing, i1); + deque.add(renderglobal$containerlocalrenderinformation2); + } + } + } + } + + this.field_72777_q.field_71424_I.func_76319_b(); + } + + this.field_72777_q.field_71424_I.func_76318_c("captureFrustum"); + if(this.field_175002_T) { + this.func_174984_a(d3, d4, d5); + this.field_175002_T = false; + } + + Lagometer.timerVisibility.end(); + if(Shaders.isShadowPass) { + Shaders.mcProfilerEndSection(); + } else { + this.field_72777_q.field_71424_I.func_76318_c("rebuildNear"); + this.field_174995_M.func_178513_e(); + Set set = this.field_175009_l; + this.field_175009_l = Sets.newLinkedHashSet(); + Lagometer.timerChunkUpdate.start(); + + for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation3 : this.field_72755_R) { + RenderChunk renderchunk5 = renderglobal$containerlocalrenderinformation3.field_178036_a; + if(renderchunk5.func_178569_m() || set.contains(renderchunk5)) { + this.field_147595_R = true; + BlockPos blockpos1 = renderchunk5.func_178568_j(); + boolean flag4 = blockpos.c((double)(blockpos1.n() + 8), (double)(blockpos1.o() + 8), (double)(blockpos1.p() + 8)) < 768.0D; + if(!flag4) { + this.field_175009_l.add(renderchunk5); + } else if(!renderchunk5.isPlayerUpdate()) { + this.chunksToUpdateForced.add(renderchunk5); + } else { + this.field_72777_q.field_71424_I.func_76320_a("build near"); + this.field_174995_M.func_178505_b(renderchunk5); + renderchunk5.func_178575_a(false); + this.field_72777_q.field_71424_I.func_76319_b(); + } + } + } + + Lagometer.timerChunkUpdate.end(); + this.field_175009_l.addAll(set); + this.field_72777_q.field_71424_I.func_76319_b(); + } + } + + private boolean func_174983_a(BlockPos p_174983_1_, RenderChunk p_174983_2_) { + BlockPos blockpos = p_174983_2_.func_178568_j(); + return MathHelper.func_76130_a(p_174983_1_.n() - blockpos.n()) > 16?false:(MathHelper.func_76130_a(p_174983_1_.o() - blockpos.o()) > 16?false:MathHelper.func_76130_a(p_174983_1_.p() - blockpos.p()) <= 16); + } + + private Set func_174978_c(BlockPos p_174978_1_) { + VisGraph visgraph = new VisGraph(); + BlockPos blockpos = new BlockPos(p_174978_1_.n() >> 4 << 4, p_174978_1_.o() >> 4 << 4, p_174978_1_.p() >> 4 << 4); + Chunk chunk = this.field_72769_h.func_175726_f(blockpos); + + for(MutableBlockPos mutableblockpos : BlockPos.func_177975_b(blockpos, blockpos.func_177982_a(15, 15, 15))) { + if(chunk.func_177428_a(mutableblockpos).func_149662_c()) { + visgraph.func_178606_a(mutableblockpos); + } + } + + return visgraph.func_178609_b(p_174978_1_); + } + + private RenderChunk getRenderChunkOffset(BlockPos p_getRenderChunkOffset_1_, RenderChunk p_getRenderChunkOffset_2_, EnumFacing p_getRenderChunkOffset_3_, boolean p_getRenderChunkOffset_4_, int p_getRenderChunkOffset_5_) { + RenderChunk renderchunk = p_getRenderChunkOffset_2_.getRenderChunkNeighbour(p_getRenderChunkOffset_3_); + if(renderchunk == null) { + return null; + } else if(renderchunk.func_178568_j().o() > p_getRenderChunkOffset_5_) { + return null; + } else { + if(p_getRenderChunkOffset_4_) { + BlockPos blockpos = renderchunk.func_178568_j(); + int i = p_getRenderChunkOffset_1_.n() - blockpos.n(); + int j = p_getRenderChunkOffset_1_.p() - blockpos.p(); + int k = i * i + j * j; + if(k > this.renderDistanceSq) { + return null; + } + } + + return renderchunk; + } + } + + private void func_174984_a(double p_174984_1_, double p_174984_3_, double p_174984_5_) { + this.field_175001_U = new ClippingHelperImpl(); + ((ClippingHelperImpl)this.field_175001_U).func_78560_b(); + Matrix4f matrix4f = new Matrix4f(this.field_175001_U.field_178626_c); + matrix4f.transpose(); + Matrix4f matrix4f1 = new Matrix4f(this.field_175001_U.field_178625_b); + matrix4f1.transpose(); + Matrix4f matrix4f2 = new Matrix4f(); + Matrix4f.mul(matrix4f1, matrix4f, matrix4f2); + matrix4f2.invert(); + this.field_175003_W.field_181059_a = p_174984_1_; + this.field_175003_W.field_181060_b = p_174984_3_; + this.field_175003_W.field_181061_c = p_174984_5_; + this.field_175004_V[0] = new Vector4f(-1.0F, -1.0F, -1.0F, 1.0F); + this.field_175004_V[1] = new Vector4f(1.0F, -1.0F, -1.0F, 1.0F); + this.field_175004_V[2] = new Vector4f(1.0F, 1.0F, -1.0F, 1.0F); + this.field_175004_V[3] = new Vector4f(-1.0F, 1.0F, -1.0F, 1.0F); + this.field_175004_V[4] = new Vector4f(-1.0F, -1.0F, 1.0F, 1.0F); + this.field_175004_V[5] = new Vector4f(1.0F, -1.0F, 1.0F, 1.0F); + this.field_175004_V[6] = new Vector4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_175004_V[7] = new Vector4f(-1.0F, 1.0F, 1.0F, 1.0F); + + for(int i = 0; i < 8; ++i) { + Matrix4f.transform(matrix4f2, this.field_175004_V[i], this.field_175004_V[i]); + this.field_175004_V[i].x /= this.field_175004_V[i].w; + this.field_175004_V[i].y /= this.field_175004_V[i].w; + this.field_175004_V[i].z /= this.field_175004_V[i].w; + this.field_175004_V[i].w = 1.0F; + } + + } + + protected Vector3f func_174962_a(Entity p_174962_1_, double p_174962_2_) { + float f = (float)((double)p_174962_1_.field_70127_C + (double)(p_174962_1_.field_70125_A - p_174962_1_.field_70127_C) * p_174962_2_); + float f1 = (float)((double)p_174962_1_.field_70126_B + (double)(p_174962_1_.field_70177_z - p_174962_1_.field_70126_B) * p_174962_2_); + if(Minecraft.func_71410_x().field_71474_y.field_74320_O == 2) { + f += 180.0F; + } + + float f2 = MathHelper.func_76134_b(-f1 * 0.017453292F - 3.1415927F); + float f3 = MathHelper.func_76126_a(-f1 * 0.017453292F - 3.1415927F); + float f4 = -MathHelper.func_76134_b(-f * 0.017453292F); + float f5 = MathHelper.func_76126_a(-f * 0.017453292F); + return new Vector3f(f3 * f4, f5, f2 * f4); + } + + public int func_174977_a(EnumWorldBlockLayer p_174977_1_, double p_174977_2_, int p_174977_4_, Entity p_174977_5_) { + RenderHelper.func_74518_a(); + if(p_174977_1_ == EnumWorldBlockLayer.TRANSLUCENT && !Shaders.isShadowPass) { + this.field_72777_q.field_71424_I.func_76320_a("translucent_sort"); + double d0 = p_174977_5_.field_70165_t - this.field_147596_f; + double d1 = p_174977_5_.field_70163_u - this.field_147597_g; + double d2 = p_174977_5_.field_70161_v - this.field_147602_h; + if(d0 * d0 + d1 * d1 + d2 * d2 > 1.0D) { + this.field_147596_f = p_174977_5_.field_70165_t; + this.field_147597_g = p_174977_5_.field_70163_u; + this.field_147602_h = p_174977_5_.field_70161_v; + int k = 0; + this.chunksToResortTransparency.clear(); + + for(RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation : this.field_72755_R) { + if(renderglobal$containerlocalrenderinformation.field_178036_a.field_178590_b.func_178492_d(p_174977_1_) && k++ < 15) { + this.chunksToResortTransparency.add(renderglobal$containerlocalrenderinformation.field_178036_a); + } + } + } + + this.field_72777_q.field_71424_I.func_76319_b(); + } + + this.field_72777_q.field_71424_I.func_76320_a("filterempty"); + int l = 0; + boolean flag = p_174977_1_ == EnumWorldBlockLayer.TRANSLUCENT; + int i1 = flag?this.field_72755_R.size() - 1:0; + int i = flag?-1:this.field_72755_R.size(); + int j1 = flag?-1:1; + + for(int j = i1; j != i; j += j1) { + RenderChunk renderchunk = ((RenderGlobal.ContainerLocalRenderInformation)this.field_72755_R.get(j)).field_178036_a; + if(!renderchunk.func_178571_g().func_178491_b(p_174977_1_)) { + ++l; + this.field_174996_N.func_178002_a(renderchunk, p_174977_1_); + } + } + + if(l == 0) { + this.field_72777_q.field_71424_I.func_76319_b(); + return l; + } else { + if(Config.isFogOff() && this.field_72777_q.field_71460_t.fogStandard) { + GlStateManager.func_179106_n(); + } + + this.field_72777_q.field_71424_I.func_76318_c("render_" + p_174977_1_); + this.func_174982_a(p_174977_1_); + this.field_72777_q.field_71424_I.func_76319_b(); + return l; + } + } + + private void func_174982_a(EnumWorldBlockLayer p_174982_1_) { + this.field_72777_q.field_71460_t.func_180436_i(); + if(OpenGlHelper.func_176075_f()) { + GL11.glEnableClientState('\u8074'); + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); + GL11.glEnableClientState('\u8078'); + OpenGlHelper.func_77472_b(OpenGlHelper.field_77476_b); + GL11.glEnableClientState('\u8078'); + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); + GL11.glEnableClientState('\u8076'); + } + + if(Config.isShaders()) { + ShadersRender.preRenderChunkLayer(p_174982_1_); + } + + this.field_174996_N.func_178001_a(p_174982_1_); + if(Config.isShaders()) { + ShadersRender.postRenderChunkLayer(p_174982_1_); + } + + if(OpenGlHelper.func_176075_f()) { + for(VertexFormatElement vertexformatelement : DefaultVertexFormats.field_176600_a.func_177343_g()) { + EnumUsage enumusage = vertexformatelement.func_177375_c(); + int i = vertexformatelement.func_177369_e(); + switch(enumusage) { + case POSITION: + GL11.glDisableClientState('\u8074'); + break; + case UV: + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + i); + GL11.glDisableClientState('\u8078'); + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); + break; + case COLOR: + GL11.glDisableClientState('\u8076'); + GlStateManager.func_179117_G(); + } + } + } + + this.field_72777_q.field_71460_t.func_175072_h(); + } + + private void func_174965_a(Iterator p_174965_1_) { + while(p_174965_1_.hasNext()) { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)p_174965_1_.next(); + int i = destroyblockprogress.func_82743_f(); + if(this.field_72773_u - i > 400) { + p_174965_1_.remove(); + } + } + + } + + public void func_72734_e() { + if(Config.isShaders()) { + if(Keyboard.isKeyDown(61) && Keyboard.isKeyDown(24)) { + GuiShaderOptions guishaderoptions = new GuiShaderOptions((GuiScreen)null, Config.getGameSettings()); + Config.getMinecraft().func_147108_a(guishaderoptions); + } + + if(Keyboard.isKeyDown(61) && Keyboard.isKeyDown(19)) { + Shaders.uninit(); + Shaders.loadShaderPack(); + } + } + + ++this.field_72773_u; + if(this.field_72773_u % 20 == 0) { + this.func_174965_a(this.field_72738_E.values().iterator()); + } + + } + + private void func_180448_r() { + if(Config.isSkyEnabled()) { + GlStateManager.func_179106_n(); + GlStateManager.func_179118_c(); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + RenderHelper.func_74518_a(); + GlStateManager.func_179132_a(false); + this.field_72770_i.func_110577_a(field_110926_k); + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + + for(int i = 0; i < 6; ++i) { + GlStateManager.func_179094_E(); + if(i == 1) { + GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F); + } + + if(i == 2) { + GlStateManager.func_179114_b(-90.0F, 1.0F, 0.0F, 0.0F); + } + + if(i == 3) { + GlStateManager.func_179114_b(180.0F, 1.0F, 0.0F, 0.0F); + } + + if(i == 4) { + GlStateManager.func_179114_b(90.0F, 0.0F, 0.0F, 1.0F); + } + + if(i == 5) { + GlStateManager.func_179114_b(-90.0F, 0.0F, 0.0F, 1.0F); + } + + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i); + int j = 40; + int k = 40; + int l = 40; + if(Config.isCustomColors()) { + Vec3 vec3 = new Vec3((double)j / 255.0D, (double)k / 255.0D, (double)l / 255.0D); + vec3 = CustomColors.getWorldSkyColor(vec3, this.field_72769_h, this.field_72777_q.func_175606_aa(), 0.0F); + j = (int)(vec3.field_72450_a * 255.0D); + k = (int)(vec3.field_72448_b * 255.0D); + l = (int)(vec3.field_72449_c * 255.0D); + } + + worldrenderer.func_181662_b(-100.0D, -100.0D, -100.0D).func_181673_a(0.0D, 0.0D).func_181669_b(j, k, l, 255).func_181675_d(); + worldrenderer.func_181662_b(-100.0D, -100.0D, 100.0D).func_181673_a(0.0D, 16.0D).func_181669_b(j, k, l, 255).func_181675_d(); + worldrenderer.func_181662_b(100.0D, -100.0D, 100.0D).func_181673_a(16.0D, 16.0D).func_181669_b(j, k, l, 255).func_181675_d(); + worldrenderer.func_181662_b(100.0D, -100.0D, -100.0D).func_181673_a(16.0D, 0.0D).func_181669_b(j, k, l, 255).func_181675_d(); + tessellator.func_78381_a(); + GlStateManager.func_179121_F(); + } + + GlStateManager.func_179132_a(true); + GlStateManager.func_179098_w(); + GlStateManager.func_179141_d(); + GlStateManager.func_179084_k(); + } + } + + public void func_174976_a(float p_174976_1_, int p_174976_2_) { + if(Reflector.ForgeWorldProvider_getSkyRenderer.exists()) { + WorldProvider worldprovider = this.field_72777_q.field_71441_e.field_73011_w; + Object object = Reflector.call(worldprovider, Reflector.ForgeWorldProvider_getSkyRenderer, new Object[0]); + if(object != null) { + Reflector.callVoid(object, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(p_174976_1_), this.field_72769_h, this.field_72777_q}); + return; + } + } + + if(this.field_72777_q.field_71441_e.field_73011_w.func_177502_q() == 1) { + this.func_180448_r(); + } else if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { + GlStateManager.func_179090_x(); + boolean flag = Config.isShaders(); + if(flag) { + Shaders.disableTexture2D(); + } + + Vec3 vec3 = this.field_72769_h.func_72833_a(this.field_72777_q.func_175606_aa(), p_174976_1_); + vec3 = CustomColors.getSkyColor(vec3, this.field_72777_q.field_71441_e, this.field_72777_q.func_175606_aa().field_70165_t, this.field_72777_q.func_175606_aa().field_70163_u + 1.0D, this.field_72777_q.func_175606_aa().field_70161_v); + if(flag) { + Shaders.setSkyColor(vec3); + } + + float f = (float)vec3.field_72450_a; + float f1 = (float)vec3.field_72448_b; + float f2 = (float)vec3.field_72449_c; + if(p_174976_2_ != 2) { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + GlStateManager.func_179124_c(f, f1, f2); + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + GlStateManager.func_179132_a(false); + GlStateManager.func_179127_m(); + if(flag) { + Shaders.enableFog(); + } + + GlStateManager.func_179124_c(f, f1, f2); + if(flag) { + Shaders.preSkyList(); + } + + if(Config.isSkyEnabled()) { + if(this.field_175005_X) { + this.field_175012_t.func_177359_a(); + GL11.glEnableClientState('\u8074'); + GL11.glVertexPointer(3, 5126, 12, 0L); + this.field_175012_t.func_177358_a(7); + this.field_175012_t.func_177361_b(); + GL11.glDisableClientState('\u8074'); + } else { + GlStateManager.func_179148_o(this.field_72771_w); + } + } + + GlStateManager.func_179106_n(); + if(flag) { + Shaders.disableFog(); + } + + GlStateManager.func_179118_c(); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + RenderHelper.func_74518_a(); + float[] afloat = this.field_72769_h.field_73011_w.func_76560_a(this.field_72769_h.func_72826_c(p_174976_1_), p_174976_1_); + if(afloat != null && Config.isSunMoonEnabled()) { + GlStateManager.func_179090_x(); + if(flag) { + Shaders.disableTexture2D(); + } + + GlStateManager.func_179103_j(7425); + GlStateManager.func_179094_E(); + GlStateManager.func_179114_b(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.func_179114_b(MathHelper.func_76126_a(this.field_72769_h.func_72929_e(p_174976_1_)) < 0.0F?180.0F:0.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.func_179114_b(90.0F, 0.0F, 0.0F, 1.0F); + float f6 = afloat[0]; + float f7 = afloat[1]; + float f8 = afloat[2]; + if(p_174976_2_ != 2) { + float f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; + float f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; + float f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; + f6 = f9; + f7 = f10; + f8 = f11; + } + + worldrenderer.func_181668_a(6, DefaultVertexFormats.field_181706_f); + worldrenderer.func_181662_b(0.0D, 100.0D, 0.0D).func_181666_a(f6, f7, f8, afloat[3]).func_181675_d(); + int j = 16; + + for(int l = 0; l <= 16; ++l) { + float f18 = (float)l * 3.1415927F * 2.0F / 16.0F; + float f12 = MathHelper.func_76126_a(f18); + float f13 = MathHelper.func_76134_b(f18); + worldrenderer.func_181662_b((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])).func_181666_a(afloat[0], afloat[1], afloat[2], 0.0F).func_181675_d(); + } + + tessellator.func_78381_a(); + GlStateManager.func_179121_F(); + GlStateManager.func_179103_j(7424); + } + + GlStateManager.func_179098_w(); + if(flag) { + Shaders.enableTexture2D(); + } + + GlStateManager.func_179120_a(770, 1, 1, 0); + GlStateManager.func_179094_E(); + float f15 = 1.0F - this.field_72769_h.func_72867_j(p_174976_1_); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, f15); + GlStateManager.func_179114_b(-90.0F, 0.0F, 1.0F, 0.0F); + CustomSky.renderSky(this.field_72769_h, this.field_72770_i, p_174976_1_); + if(flag) { + Shaders.preCelestialRotate(); + } + + GlStateManager.func_179114_b(this.field_72769_h.func_72826_c(p_174976_1_) * 360.0F, 1.0F, 0.0F, 0.0F); + if(flag) { + Shaders.postCelestialRotate(); + } + + float f16 = 30.0F; + if(Config.isSunTexture()) { + this.field_72770_i.func_110577_a(field_110928_i); + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181707_g); + worldrenderer.func_181662_b((double)(-f16), 100.0D, (double)(-f16)).func_181673_a(0.0D, 0.0D).func_181675_d(); + worldrenderer.func_181662_b((double)f16, 100.0D, (double)(-f16)).func_181673_a(1.0D, 0.0D).func_181675_d(); + worldrenderer.func_181662_b((double)f16, 100.0D, (double)f16).func_181673_a(1.0D, 1.0D).func_181675_d(); + worldrenderer.func_181662_b((double)(-f16), 100.0D, (double)f16).func_181673_a(0.0D, 1.0D).func_181675_d(); + tessellator.func_78381_a(); + } + + f16 = 20.0F; + if(Config.isMoonTexture()) { + this.field_72770_i.func_110577_a(field_110927_h); + int i = this.field_72769_h.func_72853_d(); + int k = i % 4; + int i1 = i / 4 % 2; + float f19 = (float)(k + 0) / 4.0F; + float f21 = (float)(i1 + 0) / 2.0F; + float f23 = (float)(k + 1) / 4.0F; + float f14 = (float)(i1 + 1) / 2.0F; + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181707_g); + worldrenderer.func_181662_b((double)(-f16), -100.0D, (double)f16).func_181673_a((double)f23, (double)f14).func_181675_d(); + worldrenderer.func_181662_b((double)f16, -100.0D, (double)f16).func_181673_a((double)f19, (double)f14).func_181675_d(); + worldrenderer.func_181662_b((double)f16, -100.0D, (double)(-f16)).func_181673_a((double)f19, (double)f21).func_181675_d(); + worldrenderer.func_181662_b((double)(-f16), -100.0D, (double)(-f16)).func_181673_a((double)f23, (double)f21).func_181675_d(); + tessellator.func_78381_a(); + } + + GlStateManager.func_179090_x(); + if(flag) { + Shaders.disableTexture2D(); + } + + float f17 = this.field_72769_h.func_72880_h(p_174976_1_) * f15; + if(f17 > 0.0F && Config.isStarsEnabled() && !CustomSky.hasSkyLayers(this.field_72769_h)) { + GlStateManager.func_179131_c(f17, f17, f17, f17); + if(this.field_175005_X) { + this.field_175013_s.func_177359_a(); + GL11.glEnableClientState('\u8074'); + GL11.glVertexPointer(3, 5126, 12, 0L); + this.field_175013_s.func_177358_a(7); + this.field_175013_s.func_177361_b(); + GL11.glDisableClientState('\u8074'); + } else { + GlStateManager.func_179148_o(this.field_72772_v); + } + } + + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179084_k(); + GlStateManager.func_179141_d(); + GlStateManager.func_179127_m(); + if(flag) { + Shaders.enableFog(); + } + + GlStateManager.func_179121_F(); + GlStateManager.func_179090_x(); + if(flag) { + Shaders.disableTexture2D(); + } + + GlStateManager.func_179124_c(0.0F, 0.0F, 0.0F); + double d0 = this.field_72777_q.field_71439_g.e(p_174976_1_).field_72448_b - this.field_72769_h.func_72919_O(); + if(d0 < 0.0D) { + GlStateManager.func_179094_E(); + GlStateManager.func_179109_b(0.0F, 12.0F, 0.0F); + if(this.field_175005_X) { + this.field_175011_u.func_177359_a(); + GL11.glEnableClientState('\u8074'); + GL11.glVertexPointer(3, 5126, 12, 0L); + this.field_175011_u.func_177358_a(7); + this.field_175011_u.func_177361_b(); + GL11.glDisableClientState('\u8074'); + } else { + GlStateManager.func_179148_o(this.field_72781_x); + } + + GlStateManager.func_179121_F(); + float f20 = 1.0F; + float f22 = -((float)(d0 + 65.0D)); + float f24 = -1.0F; + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181706_f); + worldrenderer.func_181662_b(-1.0D, (double)f22, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, (double)f22, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, (double)f22, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, (double)f22, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, (double)f22, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, (double)f22, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, (double)f22, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, (double)f22, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(-1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, -1.0D, 1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + worldrenderer.func_181662_b(1.0D, -1.0D, -1.0D).func_181669_b(0, 0, 0, 255).func_181675_d(); + tessellator.func_78381_a(); + } + + if(this.field_72769_h.field_73011_w.func_76561_g()) { + GlStateManager.func_179124_c(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F); + } else { + GlStateManager.func_179124_c(f, f1, f2); + } + + if(this.field_72777_q.field_71474_y.field_151451_c <= 4) { + GlStateManager.func_179124_c(this.field_72777_q.field_71460_t.field_175080_Q, this.field_72777_q.field_71460_t.field_175082_R, this.field_72777_q.field_71460_t.field_175081_S); + } + + GlStateManager.func_179094_E(); + GlStateManager.func_179109_b(0.0F, -((float)(d0 - 16.0D)), 0.0F); + if(Config.isSkyEnabled()) { + if(this.field_175005_X) { + this.field_175011_u.func_177359_a(); + GlStateManager.glEnableClientState('\u8074'); + GlStateManager.glVertexPointer(3, 5126, 12, 0); + this.field_175011_u.func_177358_a(7); + this.field_175011_u.func_177361_b(); + GlStateManager.glDisableClientState('\u8074'); + } else { + GlStateManager.func_179148_o(this.field_72781_x); + } + } + + GlStateManager.func_179121_F(); + GlStateManager.func_179098_w(); + if(flag) { + Shaders.enableTexture2D(); + } + + GlStateManager.func_179132_a(true); + } + + } + + public void func_180447_b(float p_180447_1_, int p_180447_2_) { + if(!Config.isCloudsOff()) { + if(Reflector.ForgeWorldProvider_getCloudRenderer.exists()) { + WorldProvider worldprovider = this.field_72777_q.field_71441_e.field_73011_w; + Object object = Reflector.call(worldprovider, Reflector.ForgeWorldProvider_getCloudRenderer, new Object[0]); + if(object != null) { + Reflector.callVoid(object, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(p_180447_1_), this.field_72769_h, this.field_72777_q}); + return; + } + } + + if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { + if(Config.isShaders()) { + Shaders.beginClouds(); + } + + if(Config.isCloudsFancy()) { + this.func_180445_c(p_180447_1_, p_180447_2_); + } else { + float f9 = p_180447_1_; + p_180447_1_ = 0.0F; + GlStateManager.func_179129_p(); + float f10 = (float)(this.field_72777_q.func_175606_aa().field_70137_T + (this.field_72777_q.func_175606_aa().field_70163_u - this.field_72777_q.func_175606_aa().field_70137_T) * (double)p_180447_1_); + int i = 32; + int j = 8; + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + this.field_72770_i.func_110577_a(field_110925_j); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + Vec3 vec3 = this.field_72769_h.func_72824_f(p_180447_1_); + float f = (float)vec3.field_72450_a; + float f1 = (float)vec3.field_72448_b; + float f2 = (float)vec3.field_72449_c; + this.cloudRenderer.prepareToRender(false, this.field_72773_u, f9, vec3); + if(this.cloudRenderer.shouldUpdateGlList()) { + this.cloudRenderer.startUpdateGlList(); + if(p_180447_2_ != 2) { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + float f11 = 4.8828125E-4F; + double d2 = (double)((float)this.field_72773_u + p_180447_1_); + double d0 = this.field_72777_q.func_175606_aa().field_70169_q + (this.field_72777_q.func_175606_aa().field_70165_t - this.field_72777_q.func_175606_aa().field_70169_q) * (double)p_180447_1_ + d2 * 0.029999999329447746D; + double d1 = this.field_72777_q.func_175606_aa().field_70166_s + (this.field_72777_q.func_175606_aa().field_70161_v - this.field_72777_q.func_175606_aa().field_70166_s) * (double)p_180447_1_; + int k = MathHelper.func_76128_c(d0 / 2048.0D); + int l = MathHelper.func_76128_c(d1 / 2048.0D); + d0 = d0 - (double)(k * 2048); + d1 = d1 - (double)(l * 2048); + float f6 = this.field_72769_h.field_73011_w.func_76571_f() - f10 + 0.33F; + f6 = f6 + this.field_72777_q.field_71474_y.ofCloudsHeight * 128.0F; + float f7 = (float)(d0 * 4.8828125E-4D); + float f8 = (float)(d1 * 4.8828125E-4D); + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i); + + for(int i1 = -256; i1 < 256; i1 += 32) { + for(int j1 = -256; j1 < 256; j1 += 32) { + worldrenderer.func_181662_b((double)(i1 + 0), (double)f6, (double)(j1 + 32)).func_181673_a((double)((float)(i1 + 0) * 4.8828125E-4F + f7), (double)((float)(j1 + 32) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d(); + worldrenderer.func_181662_b((double)(i1 + 32), (double)f6, (double)(j1 + 32)).func_181673_a((double)((float)(i1 + 32) * 4.8828125E-4F + f7), (double)((float)(j1 + 32) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d(); + worldrenderer.func_181662_b((double)(i1 + 32), (double)f6, (double)(j1 + 0)).func_181673_a((double)((float)(i1 + 32) * 4.8828125E-4F + f7), (double)((float)(j1 + 0) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d(); + worldrenderer.func_181662_b((double)(i1 + 0), (double)f6, (double)(j1 + 0)).func_181673_a((double)((float)(i1 + 0) * 4.8828125E-4F + f7), (double)((float)(j1 + 0) * 4.8828125E-4F + f8)).func_181666_a(f, f1, f2, 0.8F).func_181675_d(); + } + } + + tessellator.func_78381_a(); + this.cloudRenderer.endUpdateGlList(); + } + + this.cloudRenderer.renderGlList(); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179084_k(); + GlStateManager.func_179089_o(); + } + + if(Config.isShaders()) { + Shaders.endClouds(); + } + } + + } + } + + public boolean func_72721_a(double p_72721_1_, double p_72721_3_, double p_72721_5_, float p_72721_7_) { + return false; + } + + private void func_180445_c(float p_180445_1_, int p_180445_2_) { + p_180445_1_ = 0.0F; + GlStateManager.func_179129_p(); + float f = (float)(this.field_72777_q.func_175606_aa().field_70137_T + (this.field_72777_q.func_175606_aa().field_70163_u - this.field_72777_q.func_175606_aa().field_70137_T) * (double)p_180445_1_); + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + float f1 = 12.0F; + float f2 = 4.0F; + double d0 = (double)((float)this.field_72773_u + p_180445_1_); + double d1 = (this.field_72777_q.func_175606_aa().field_70169_q + (this.field_72777_q.func_175606_aa().field_70165_t - this.field_72777_q.func_175606_aa().field_70169_q) * (double)p_180445_1_ + d0 * 0.029999999329447746D) / 12.0D; + double d2 = (this.field_72777_q.func_175606_aa().field_70166_s + (this.field_72777_q.func_175606_aa().field_70161_v - this.field_72777_q.func_175606_aa().field_70166_s) * (double)p_180445_1_) / 12.0D + 0.33000001311302185D; + float f3 = this.field_72769_h.field_73011_w.func_76571_f() - f + 0.33F; + f3 = f3 + this.field_72777_q.field_71474_y.ofCloudsHeight * 128.0F; + int i = MathHelper.func_76128_c(d1 / 2048.0D); + int j = MathHelper.func_76128_c(d2 / 2048.0D); + d1 = d1 - (double)(i * 2048); + d2 = d2 - (double)(j * 2048); + this.field_72770_i.func_110577_a(field_110925_j); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + Vec3 vec3 = this.field_72769_h.func_72824_f(p_180445_1_); + float f4 = (float)vec3.field_72450_a; + float f5 = (float)vec3.field_72448_b; + float f6 = (float)vec3.field_72449_c; + this.cloudRenderer.prepareToRender(true, this.field_72773_u, p_180445_1_, vec3); + if(p_180445_2_ != 2) { + float f7 = (f4 * 30.0F + f5 * 59.0F + f6 * 11.0F) / 100.0F; + float f8 = (f4 * 30.0F + f5 * 70.0F) / 100.0F; + float f9 = (f4 * 30.0F + f6 * 70.0F) / 100.0F; + f4 = f7; + f5 = f8; + f6 = f9; + } + + float f26 = f4 * 0.9F; + float f27 = f5 * 0.9F; + float f28 = f6 * 0.9F; + float f10 = f4 * 0.7F; + float f11 = f5 * 0.7F; + float f12 = f6 * 0.7F; + float f13 = f4 * 0.8F; + float f14 = f5 * 0.8F; + float f15 = f6 * 0.8F; + float f16 = 0.00390625F; + float f17 = (float)MathHelper.func_76128_c(d1) * 0.00390625F; + float f18 = (float)MathHelper.func_76128_c(d2) * 0.00390625F; + float f19 = (float)(d1 - (double)MathHelper.func_76128_c(d1)); + float f20 = (float)(d2 - (double)MathHelper.func_76128_c(d2)); + int k = 8; + int l = 4; + float f21 = 9.765625E-4F; + GlStateManager.func_179152_a(12.0F, 1.0F, 12.0F); + + for(int i1 = 0; i1 < 2; ++i1) { + if(i1 == 0) { + GlStateManager.func_179135_a(false, false, false, false); + } else { + switch(p_180445_2_) { + case 0: + GlStateManager.func_179135_a(false, true, true, true); + break; + case 1: + GlStateManager.func_179135_a(true, false, false, true); + break; + case 2: + GlStateManager.func_179135_a(true, true, true, true); + } + } + + this.cloudRenderer.renderGlList(); + } + + if(this.cloudRenderer.shouldUpdateGlList()) { + this.cloudRenderer.startUpdateGlList(); + + for(int l1 = -3; l1 <= 4; ++l1) { + for(int j1 = -3; j1 <= 4; ++j1) { + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181712_l); + float f22 = (float)(l1 * 8); + float f23 = (float)(j1 * 8); + float f24 = f22 - f19; + float f25 = f23 - f20; + if(f3 > -5.0F) { + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f10, f11, f12, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f10, f11, f12, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f10, f11, f12, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f10, f11, f12, 0.8F).func_181663_c(0.0F, -1.0F, 0.0F).func_181675_d(); + } + + if(f3 <= 5.0F) { + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f4, f5, f6, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f4, f5, f6, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f4, f5, f6, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f4, f5, f6, 0.8F).func_181663_c(0.0F, 1.0F, 0.0F).func_181675_d(); + } + + if(l1 > -1) { + for(int k1 = 0; k1 < 8; ++k1) { + worldrenderer.func_181662_b((double)(f24 + (float)k1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + (float)k1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + (float)k1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + (float)k1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(-1.0F, 0.0F, 0.0F).func_181675_d(); + } + } + + if(l1 <= 1) { + for(int i2 = 0; i2 < 8; ++i2) { + worldrenderer.func_181662_b((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).func_181673_a((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + (float)i2 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).func_181673_a((double)((f22 + (float)i2 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).func_181666_a(f26, f27, f28, 0.8F).func_181663_c(1.0F, 0.0F, 0.0F).func_181675_d(); + } + } + + if(j1 > -1) { + for(int j2 = 0; j2 < 8; ++j2) { + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)j2 + 0.0F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)j2 + 0.0F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)j2 + 0.0F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)j2 + 0.0F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)j2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, -1.0F).func_181675_d(); + } + } + + if(j1 <= 1) { + for(int k2 = 0; k2 < 8; ++k2) { + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).func_181673_a((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d(); + worldrenderer.func_181662_b((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)k2 + 1.0F - 9.765625E-4F)).func_181673_a((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)k2 + 0.5F) * 0.00390625F + f18)).func_181666_a(f13, f14, f15, 0.8F).func_181663_c(0.0F, 0.0F, 1.0F).func_181675_d(); + } + } + + tessellator.func_78381_a(); + } + } + + this.cloudRenderer.endUpdateGlList(); + } + + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179084_k(); + GlStateManager.func_179089_o(); + } + + public void func_174967_a(long p_174967_1_) { + p_174967_1_ = (long)((double)p_174967_1_ + 1.0E8D); + this.field_147595_R |= this.field_174995_M.func_178516_a(p_174967_1_); + if(this.chunksToUpdateForced.size() > 0) { + Iterator iterator = this.chunksToUpdateForced.iterator(); + + while(iterator.hasNext()) { + RenderChunk renderchunk = (RenderChunk)iterator.next(); + if(!this.field_174995_M.func_178507_a(renderchunk)) { + break; + } + + renderchunk.func_178575_a(false); + iterator.remove(); + this.field_175009_l.remove(renderchunk); + this.chunksToResortTransparency.remove(renderchunk); + } + } + + if(this.chunksToResortTransparency.size() > 0) { + Iterator iterator2 = this.chunksToResortTransparency.iterator(); + if(iterator2.hasNext()) { + RenderChunk renderchunk2 = (RenderChunk)iterator2.next(); + if(this.field_174995_M.func_178509_c(renderchunk2)) { + iterator2.remove(); + } + } + } + + double d1 = 0.0D; + int i = Config.getUpdatesPerFrame(); + if(!this.field_175009_l.isEmpty()) { + Iterator iterator1 = this.field_175009_l.iterator(); + + while(iterator1.hasNext()) { + RenderChunk renderchunk1 = (RenderChunk)iterator1.next(); + boolean flag = renderchunk1.isChunkRegionEmpty(); + boolean flag1; + if(flag) { + flag1 = this.field_174995_M.func_178505_b(renderchunk1); + } else { + flag1 = this.field_174995_M.func_178507_a(renderchunk1); + } + + if(!flag1) { + break; + } + + renderchunk1.func_178575_a(false); + iterator1.remove(); + if(!flag) { + double d0 = 2.0D * RenderChunkUtils.getRelativeBufferSize(renderchunk1); + d1 += d0; + if(d1 > (double)i) { + break; + } + } + } + } + + } + + public void func_180449_a(Entity p_180449_1_, float p_180449_2_) { + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + WorldBorder worldborder = this.field_72769_h.func_175723_af(); + double d0 = (double)(this.field_72777_q.field_71474_y.field_151451_c * 16); + if(p_180449_1_.field_70165_t >= worldborder.func_177728_d() - d0 || p_180449_1_.field_70165_t <= worldborder.func_177726_b() + d0 || p_180449_1_.field_70161_v >= worldborder.func_177733_e() - d0 || p_180449_1_.field_70161_v <= worldborder.func_177736_c() + d0) { + if(Config.isShaders()) { + Shaders.pushProgram(); + Shaders.useProgram(Shaders.ProgramTexturedLit); + } + + double d1 = 1.0D - worldborder.func_177745_a(p_180449_1_) / d0; + d1 = Math.pow(d1, 4.0D); + double d2 = p_180449_1_.field_70142_S + (p_180449_1_.field_70165_t - p_180449_1_.field_70142_S) * (double)p_180449_2_; + double d3 = p_180449_1_.field_70137_T + (p_180449_1_.field_70163_u - p_180449_1_.field_70137_T) * (double)p_180449_2_; + double d4 = p_180449_1_.field_70136_U + (p_180449_1_.field_70161_v - p_180449_1_.field_70136_U) * (double)p_180449_2_; + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 1, 1, 0); + this.field_72770_i.func_110577_a(field_175006_g); + GlStateManager.func_179132_a(false); + GlStateManager.func_179094_E(); + int i = worldborder.func_177734_a().func_177766_a(); + float f = (float)(i >> 16 & 255) / 255.0F; + float f1 = (float)(i >> 8 & 255) / 255.0F; + float f2 = (float)(i & 255) / 255.0F; + GlStateManager.func_179131_c(f, f1, f2, (float)d1); + GlStateManager.func_179136_a(-3.0F, -3.0F); + GlStateManager.func_179088_q(); + GlStateManager.func_179092_a(516, 0.1F); + GlStateManager.func_179141_d(); + GlStateManager.func_179129_p(); + float f3 = (float)(Minecraft.func_71386_F() % 3000L) / 3000.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 128.0F; + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181707_g); + worldrenderer.func_178969_c(-d2, -d3, -d4); + double d5 = Math.max((double)MathHelper.func_76128_c(d4 - d0), worldborder.func_177736_c()); + double d6 = Math.min((double)MathHelper.func_76143_f(d4 + d0), worldborder.func_177733_e()); + if(d2 > worldborder.func_177728_d() - d0) { + float f7 = 0.0F; + + for(double d7 = d5; d7 < d6; f7 += 0.5F) { + double d8 = Math.min(1.0D, d6 - d7); + float f8 = (float)d8 * 0.5F; + worldrenderer.func_181662_b(worldborder.func_177728_d(), 256.0D, d7).func_181673_a((double)(f3 + f7), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(worldborder.func_177728_d(), 256.0D, d7 + d8).func_181673_a((double)(f3 + f8 + f7), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(worldborder.func_177728_d(), 0.0D, d7 + d8).func_181673_a((double)(f3 + f8 + f7), (double)(f3 + 128.0F)).func_181675_d(); + worldrenderer.func_181662_b(worldborder.func_177728_d(), 0.0D, d7).func_181673_a((double)(f3 + f7), (double)(f3 + 128.0F)).func_181675_d(); + ++d7; + } + } + + if(d2 < worldborder.func_177726_b() + d0) { + float f9 = 0.0F; + + for(double d9 = d5; d9 < d6; f9 += 0.5F) { + double d12 = Math.min(1.0D, d6 - d9); + float f12 = (float)d12 * 0.5F; + worldrenderer.func_181662_b(worldborder.func_177726_b(), 256.0D, d9).func_181673_a((double)(f3 + f9), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(worldborder.func_177726_b(), 256.0D, d9 + d12).func_181673_a((double)(f3 + f12 + f9), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(worldborder.func_177726_b(), 0.0D, d9 + d12).func_181673_a((double)(f3 + f12 + f9), (double)(f3 + 128.0F)).func_181675_d(); + worldrenderer.func_181662_b(worldborder.func_177726_b(), 0.0D, d9).func_181673_a((double)(f3 + f9), (double)(f3 + 128.0F)).func_181675_d(); + ++d9; + } + } + + d5 = Math.max((double)MathHelper.func_76128_c(d2 - d0), worldborder.func_177726_b()); + d6 = Math.min((double)MathHelper.func_76143_f(d2 + d0), worldborder.func_177728_d()); + if(d4 > worldborder.func_177733_e() - d0) { + float f10 = 0.0F; + + for(double d10 = d5; d10 < d6; f10 += 0.5F) { + double d13 = Math.min(1.0D, d6 - d10); + float f13 = (float)d13 * 0.5F; + worldrenderer.func_181662_b(d10, 256.0D, worldborder.func_177733_e()).func_181673_a((double)(f3 + f10), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(d10 + d13, 256.0D, worldborder.func_177733_e()).func_181673_a((double)(f3 + f13 + f10), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(d10 + d13, 0.0D, worldborder.func_177733_e()).func_181673_a((double)(f3 + f13 + f10), (double)(f3 + 128.0F)).func_181675_d(); + worldrenderer.func_181662_b(d10, 0.0D, worldborder.func_177733_e()).func_181673_a((double)(f3 + f10), (double)(f3 + 128.0F)).func_181675_d(); + ++d10; + } + } + + if(d4 < worldborder.func_177736_c() + d0) { + float f11 = 0.0F; + + for(double d11 = d5; d11 < d6; f11 += 0.5F) { + double d14 = Math.min(1.0D, d6 - d11); + float f14 = (float)d14 * 0.5F; + worldrenderer.func_181662_b(d11, 256.0D, worldborder.func_177736_c()).func_181673_a((double)(f3 + f11), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(d11 + d14, 256.0D, worldborder.func_177736_c()).func_181673_a((double)(f3 + f14 + f11), (double)(f3 + 0.0F)).func_181675_d(); + worldrenderer.func_181662_b(d11 + d14, 0.0D, worldborder.func_177736_c()).func_181673_a((double)(f3 + f14 + f11), (double)(f3 + 128.0F)).func_181675_d(); + worldrenderer.func_181662_b(d11, 0.0D, worldborder.func_177736_c()).func_181673_a((double)(f3 + f11), (double)(f3 + 128.0F)).func_181675_d(); + ++d11; + } + } + + tessellator.func_78381_a(); + worldrenderer.func_178969_c(0.0D, 0.0D, 0.0D); + GlStateManager.func_179089_o(); + GlStateManager.func_179118_c(); + GlStateManager.func_179136_a(0.0F, 0.0F); + GlStateManager.func_179113_r(); + GlStateManager.func_179141_d(); + GlStateManager.func_179120_a(770, 771, 1, 0); + GlStateManager.func_179084_k(); + GlStateManager.func_179121_F(); + GlStateManager.func_179132_a(true); + if(Config.isShaders()) { + Shaders.popProgram(); + } + } + + } + + private void func_180443_s() { + GlStateManager.func_179120_a(774, 768, 1, 0); + GlStateManager.func_179147_l(); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.5F); + GlStateManager.func_179136_a(-1.0F, -10.0F); + GlStateManager.func_179088_q(); + GlStateManager.func_179092_a(516, 0.1F); + GlStateManager.func_179141_d(); + GlStateManager.func_179094_E(); + if(Config.isShaders()) { + ShadersRender.beginBlockDamage(); + } + + } + + private void func_174969_t() { + GlStateManager.func_179118_c(); + GlStateManager.func_179136_a(0.0F, 0.0F); + GlStateManager.func_179113_r(); + GlStateManager.func_179141_d(); + GlStateManager.func_179132_a(true); + GlStateManager.func_179121_F(); + if(Config.isShaders()) { + ShadersRender.endBlockDamage(); + } + + } + + public void func_174981_a(Tessellator p_174981_1_, WorldRenderer p_174981_2_, Entity p_174981_3_, float p_174981_4_) { + double d0 = p_174981_3_.field_70142_S + (p_174981_3_.field_70165_t - p_174981_3_.field_70142_S) * (double)p_174981_4_; + double d1 = p_174981_3_.field_70137_T + (p_174981_3_.field_70163_u - p_174981_3_.field_70137_T) * (double)p_174981_4_; + double d2 = p_174981_3_.field_70136_U + (p_174981_3_.field_70161_v - p_174981_3_.field_70136_U) * (double)p_174981_4_; + if(!this.field_72738_E.isEmpty()) { + this.field_72770_i.func_110577_a(TextureMap.field_110575_b); + this.func_180443_s(); + p_174981_2_.func_181668_a(7, DefaultVertexFormats.field_176600_a); + p_174981_2_.func_178969_c(-d0, -d1, -d2); + p_174981_2_.func_78914_f(); + Iterator iterator = this.field_72738_E.values().iterator(); + + while(iterator.hasNext()) { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next(); + BlockPos blockpos = destroyblockprogress.func_180246_b(); + double d3 = (double)blockpos.n() - d0; + double d4 = (double)blockpos.o() - d1; + double d5 = (double)blockpos.p() - d2; + Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); + boolean flag; + if(Reflector.ForgeTileEntity_canRenderBreaking.exists()) { + boolean flag1 = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull; + if(!flag1) { + TileEntity tileentity = this.field_72769_h.func_175625_s(blockpos); + if(tileentity != null) { + flag1 = Reflector.callBoolean(tileentity, Reflector.ForgeTileEntity_canRenderBreaking, new Object[0]); + } + } + + flag = !flag1; + } else { + flag = !(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull); + } + + if(flag) { + if(d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) { + iterator.remove(); + } else { + IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos); + if(iblockstate.func_177230_c().func_149688_o() != Material.field_151579_a) { + int i = destroyblockprogress.func_73106_e(); + TextureAtlasSprite textureatlassprite = this.field_94141_F[i]; + BlockRendererDispatcher blockrendererdispatcher = this.field_72777_q.func_175602_ab(); + blockrendererdispatcher.func_175020_a(iblockstate, blockpos, textureatlassprite, this.field_72769_h); + } + } + } + } + + p_174981_1_.func_78381_a(); + p_174981_2_.func_178969_c(0.0D, 0.0D, 0.0D); + this.func_174969_t(); + } + + } + + public void func_72731_b(EntityPlayer p_72731_1_, MovingObjectPosition p_72731_2_, int p_72731_3_, float p_72731_4_) { + if(p_72731_3_ == 0 && p_72731_2_.field_72313_a == MovingObjectType.BLOCK) { + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + GlStateManager.func_179131_c(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth(2.0F); + GlStateManager.func_179090_x(); + if(Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GlStateManager.func_179132_a(false); + float f = 0.002F; + BlockPos blockpos = p_72731_2_.func_178782_a(); + Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); + if(block.func_149688_o() != Material.field_151579_a && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) { + block.func_180654_a(this.field_72769_h, blockpos); + double d0 = p_72731_1_.P + (p_72731_1_.s - p_72731_1_.P) * (double)p_72731_4_; + double d1 = p_72731_1_.Q + (p_72731_1_.t - p_72731_1_.Q) * (double)p_72731_4_; + double d2 = p_72731_1_.R + (p_72731_1_.u - p_72731_1_.R) * (double)p_72731_4_; + AxisAlignedBB axisalignedbb = block.func_180646_a(this.field_72769_h, blockpos); + EnumOffsetType enumoffsettype = block.func_176218_Q(); + if(enumoffsettype != EnumOffsetType.NONE) { + axisalignedbb = BlockModelUtils.getOffsetBoundingBox(axisalignedbb, enumoffsettype, blockpos); + } + + func_181561_a(axisalignedbb.func_72314_b(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D).func_72317_d(-d0, -d1, -d2)); + } + + GlStateManager.func_179132_a(true); + GlStateManager.func_179098_w(); + if(Config.isShaders()) { + Shaders.enableTexture2D(); + } + + GlStateManager.func_179084_k(); + } + + } + + public static void func_181561_a(AxisAlignedBB p_181561_0_) { + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + worldrenderer.func_181668_a(3, DefaultVertexFormats.field_181705_e); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72338_b, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72338_b, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72338_b, p_181561_0_.field_72334_f).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72338_b, p_181561_0_.field_72334_f).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72338_b, p_181561_0_.field_72339_c).func_181675_d(); + tessellator.func_78381_a(); + worldrenderer.func_181668_a(3, DefaultVertexFormats.field_181705_e); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72337_e, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72337_e, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72337_e, p_181561_0_.field_72334_f).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72337_e, p_181561_0_.field_72334_f).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72337_e, p_181561_0_.field_72339_c).func_181675_d(); + tessellator.func_78381_a(); + worldrenderer.func_181668_a(1, DefaultVertexFormats.field_181705_e); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72338_b, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72337_e, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72338_b, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72337_e, p_181561_0_.field_72339_c).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72338_b, p_181561_0_.field_72334_f).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72336_d, p_181561_0_.field_72337_e, p_181561_0_.field_72334_f).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72338_b, p_181561_0_.field_72334_f).func_181675_d(); + worldrenderer.func_181662_b(p_181561_0_.field_72340_a, p_181561_0_.field_72337_e, p_181561_0_.field_72334_f).func_181675_d(); + tessellator.func_78381_a(); + } + + public static void func_181563_a(AxisAlignedBB p_181563_0_, int p_181563_1_, int p_181563_2_, int p_181563_3_, int p_181563_4_) { + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + worldrenderer.func_181668_a(3, DefaultVertexFormats.field_181706_f); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72338_b, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72338_b, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72338_b, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72338_b, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72338_b, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + tessellator.func_78381_a(); + worldrenderer.func_181668_a(3, DefaultVertexFormats.field_181706_f); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72337_e, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72337_e, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72337_e, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72337_e, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72337_e, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + tessellator.func_78381_a(); + worldrenderer.func_181668_a(1, DefaultVertexFormats.field_181706_f); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72338_b, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72337_e, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72338_b, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72337_e, p_181563_0_.field_72339_c).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72338_b, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72336_d, p_181563_0_.field_72337_e, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72338_b, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + worldrenderer.func_181662_b(p_181563_0_.field_72340_a, p_181563_0_.field_72337_e, p_181563_0_.field_72334_f).func_181669_b(p_181563_1_, p_181563_2_, p_181563_3_, p_181563_4_).func_181675_d(); + tessellator.func_78381_a(); + } + + private void func_72725_b(int p_72725_1_, int p_72725_2_, int p_72725_3_, int p_72725_4_, int p_72725_5_, int p_72725_6_) { + this.field_175008_n.func_178162_a(p_72725_1_, p_72725_2_, p_72725_3_, p_72725_4_, p_72725_5_, p_72725_6_); + } + + public void func_174960_a(BlockPos p_174960_1_) { + int i = p_174960_1_.n(); + int j = p_174960_1_.o(); + int k = p_174960_1_.p(); + this.func_72725_b(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); + } + + public void func_174959_b(BlockPos p_174959_1_) { + int i = p_174959_1_.n(); + int j = p_174959_1_.o(); + int k = p_174959_1_.p(); + this.func_72725_b(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1); + } + + public void func_147585_a(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) { + this.func_72725_b(p_147585_1_ - 1, p_147585_2_ - 1, p_147585_3_ - 1, p_147585_4_ + 1, p_147585_5_ + 1, p_147585_6_ + 1); + } + + public void func_174961_a(String p_174961_1_, BlockPos p_174961_2_) { + ISound isound = (ISound)this.field_147593_P.get(p_174961_2_); + if(isound != null) { + this.field_72777_q.func_147118_V().func_147683_b(isound); + this.field_147593_P.remove(p_174961_2_); + } + + if(p_174961_1_ != null) { + ItemRecord itemrecord = ItemRecord.func_150926_b(p_174961_1_); + if(itemrecord != null) { + this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i()); + } + + PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_174961_1_), (float)p_174961_2_.n(), (float)p_174961_2_.o(), (float)p_174961_2_.p()); + this.field_147593_P.put(p_174961_2_, positionedsoundrecord); + this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord); + } + + } + + public void func_72704_a(String p_72704_1_, double p_72704_2_, double p_72704_4_, double p_72704_6_, float p_72704_8_, float p_72704_9_) { + } + + public void func_85102_a(EntityPlayer p_85102_1_, String p_85102_2_, double p_85102_3_, double p_85102_5_, double p_85102_7_, float p_85102_9_, float p_85102_10_) { + } + + public void func_180442_a(int p_180442_1_, boolean p_180442_2_, final double p_180442_3_, final double p_180442_5_, final double p_180442_7_, double p_180442_9_, double p_180442_11_, double p_180442_13_, int... p_180442_15_) { + try { + this.func_174974_b(p_180442_1_, p_180442_2_, p_180442_3_, p_180442_5_, p_180442_7_, p_180442_9_, p_180442_11_, p_180442_13_, p_180442_15_); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while adding particle"); + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being added"); + crashreportcategory.func_71507_a("ID", Integer.valueOf(p_180442_1_)); + if(p_180442_15_ != null) { + crashreportcategory.func_71507_a("Parameters", p_180442_15_); + } + + crashreportcategory.func_71500_a("Position", new Callable() { + public String call() throws Exception { + return CrashReportCategory.func_85074_a(p_180442_3_, p_180442_5_, p_180442_7_); + } + }); + throw new ReportedException(crashreport); + } + } + + private void func_174972_a(EnumParticleTypes p_174972_1_, double p_174972_2_, double p_174972_4_, double p_174972_6_, double p_174972_8_, double p_174972_10_, double p_174972_12_, int... p_174972_14_) { + this.func_180442_a(p_174972_1_.func_179348_c(), p_174972_1_.func_179344_e(), p_174972_2_, p_174972_4_, p_174972_6_, p_174972_8_, p_174972_10_, p_174972_12_, p_174972_14_); + } + + private EntityFX func_174974_b(int p_174974_1_, boolean p_174974_2_, double p_174974_3_, double p_174974_5_, double p_174974_7_, double p_174974_9_, double p_174974_11_, double p_174974_13_, int... p_174974_15_) { + if(this.field_72777_q != null && this.field_72777_q.func_175606_aa() != null && this.field_72777_q.field_71452_i != null) { + int i = this.field_72777_q.field_71474_y.field_74362_aa; + if(i == 1 && this.field_72769_h.field_73012_v.nextInt(3) == 0) { + i = 2; + } + + double d0 = this.field_72777_q.func_175606_aa().field_70165_t - p_174974_3_; + double d1 = this.field_72777_q.func_175606_aa().field_70163_u - p_174974_5_; + double d2 = this.field_72777_q.func_175606_aa().field_70161_v - p_174974_7_; + if(p_174974_1_ == EnumParticleTypes.EXPLOSION_HUGE.func_179348_c() && !Config.isAnimatedExplosion()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.EXPLOSION_LARGE.func_179348_c() && !Config.isAnimatedExplosion()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.EXPLOSION_NORMAL.func_179348_c() && !Config.isAnimatedExplosion()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SUSPENDED.func_179348_c() && !Config.isWaterParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SUSPENDED_DEPTH.func_179348_c() && !Config.isVoidParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SMOKE_NORMAL.func_179348_c() && !Config.isAnimatedSmoke()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SMOKE_LARGE.func_179348_c() && !Config.isAnimatedSmoke()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SPELL_MOB.func_179348_c() && !Config.isPotionParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SPELL_MOB_AMBIENT.func_179348_c() && !Config.isPotionParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SPELL.func_179348_c() && !Config.isPotionParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SPELL_INSTANT.func_179348_c() && !Config.isPotionParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.SPELL_WITCH.func_179348_c() && !Config.isPotionParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.PORTAL.func_179348_c() && !Config.isPortalParticles()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.FLAME.func_179348_c() && !Config.isAnimatedFlame()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.REDSTONE.func_179348_c() && !Config.isAnimatedRedstone()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.DRIP_WATER.func_179348_c() && !Config.isDrippingWaterLava()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.DRIP_LAVA.func_179348_c() && !Config.isDrippingWaterLava()) { + return null; + } else if(p_174974_1_ == EnumParticleTypes.FIREWORKS_SPARK.func_179348_c() && !Config.isFireworkParticles()) { + return null; + } else { + if(!p_174974_2_) { + double d3 = 256.0D; + if(p_174974_1_ == EnumParticleTypes.CRIT.func_179348_c()) { + d3 = 38416.0D; + } + + if(d0 * d0 + d1 * d1 + d2 * d2 > d3) { + return null; + } + + if(i > 1) { + return null; + } + } + + EntityFX entityfx = this.field_72777_q.field_71452_i.func_178927_a(p_174974_1_, p_174974_3_, p_174974_5_, p_174974_7_, p_174974_9_, p_174974_11_, p_174974_13_, p_174974_15_); + if(p_174974_1_ == EnumParticleTypes.WATER_BUBBLE.func_179348_c()) { + CustomColors.updateWaterFX(entityfx, this.field_72769_h, p_174974_3_, p_174974_5_, p_174974_7_, this.renderEnv); + } + + if(p_174974_1_ == EnumParticleTypes.WATER_SPLASH.func_179348_c()) { + CustomColors.updateWaterFX(entityfx, this.field_72769_h, p_174974_3_, p_174974_5_, p_174974_7_, this.renderEnv); + } + + if(p_174974_1_ == EnumParticleTypes.WATER_DROP.func_179348_c()) { + CustomColors.updateWaterFX(entityfx, this.field_72769_h, p_174974_3_, p_174974_5_, p_174974_7_, this.renderEnv); + } + + if(p_174974_1_ == EnumParticleTypes.TOWN_AURA.func_179348_c()) { + CustomColors.updateMyceliumFX(entityfx); + } + + if(p_174974_1_ == EnumParticleTypes.PORTAL.func_179348_c()) { + CustomColors.updatePortalFX(entityfx); + } + + if(p_174974_1_ == EnumParticleTypes.REDSTONE.func_179348_c()) { + CustomColors.updateReddustFX(entityfx, this.field_72769_h, p_174974_3_, p_174974_5_, p_174974_7_); + } + + return entityfx; + } + } else { + return null; + } + } + + public void func_72703_a(Entity p_72703_1_) { + RandomEntities.entityLoaded(p_72703_1_, this.field_72769_h); + if(Config.isDynamicLights()) { + DynamicLights.entityAdded(p_72703_1_, this); + } + + } + + public void func_72709_b(Entity p_72709_1_) { + RandomEntities.entityUnloaded(p_72709_1_, this.field_72769_h); + if(Config.isDynamicLights()) { + DynamicLights.entityRemoved(p_72709_1_, this); + } + + } + + public void func_72728_f() { + } + + public void func_180440_a(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) { + switch(p_180440_1_) { + case 1013: + case 1018: + if(this.field_72777_q.func_175606_aa() != null) { + double d0 = (double)p_180440_2_.n() - this.field_72777_q.func_175606_aa().field_70165_t; + double d1 = (double)p_180440_2_.o() - this.field_72777_q.func_175606_aa().field_70163_u; + double d2 = (double)p_180440_2_.p() - this.field_72777_q.func_175606_aa().field_70161_v; + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + double d4 = this.field_72777_q.func_175606_aa().field_70165_t; + double d5 = this.field_72777_q.func_175606_aa().field_70163_u; + double d6 = this.field_72777_q.func_175606_aa().field_70161_v; + if(d3 > 0.0D) { + d4 += d0 / d3 * 2.0D; + d5 += d1 / d3 * 2.0D; + d6 += d2 / d3 * 2.0D; + } + + if(p_180440_1_ == 1013) { + this.field_72769_h.func_72980_b(d4, d5, d6, "mob.wither.spawn", 1.0F, 1.0F, false); + } else { + this.field_72769_h.func_72980_b(d4, d5, d6, "mob.enderdragon.end", 5.0F, 1.0F, false); + } + } + default: + } + } + + public void func_180439_a(EntityPlayer p_180439_1_, int p_180439_2_, BlockPos p_180439_3_, int p_180439_4_) { + Random random = this.field_72769_h.field_73012_v; + switch(p_180439_2_) { + case 1000: + this.field_72769_h.func_175731_a(p_180439_3_, "random.click", 1.0F, 1.0F, false); + break; + case 1001: + this.field_72769_h.func_175731_a(p_180439_3_, "random.click", 1.0F, 1.2F, false); + break; + case 1002: + this.field_72769_h.func_175731_a(p_180439_3_, "random.bow", 1.0F, 1.2F, false); + break; + case 1003: + this.field_72769_h.func_175731_a(p_180439_3_, "random.door_open", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 1004: + this.field_72769_h.func_175731_a(p_180439_3_, "random.fizz", 0.5F, 2.6F + (random.nextFloat() - random.nextFloat()) * 0.8F, false); + break; + case 1005: + if(Item.func_150899_d(p_180439_4_) instanceof ItemRecord) { + this.field_72769_h.func_175717_a(p_180439_3_, "records." + ((ItemRecord)Item.func_150899_d(p_180439_4_)).field_150929_a); + } else { + this.field_72769_h.func_175717_a(p_180439_3_, (String)null); + } + break; + case 1006: + this.field_72769_h.func_175731_a(p_180439_3_, "random.door_close", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 1007: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.ghast.charge", 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1008: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.ghast.fireball", 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1009: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.ghast.fireball", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1010: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.zombie.wood", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1011: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.zombie.metal", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1012: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.zombie.woodbreak", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1014: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.wither.shoot", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1015: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.bat.takeoff", 0.05F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1016: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.zombie.infect", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1017: + this.field_72769_h.func_175731_a(p_180439_3_, "mob.zombie.unfect", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1020: + this.field_72769_h.func_175731_a(p_180439_3_, "random.anvil_break", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 1021: + this.field_72769_h.func_175731_a(p_180439_3_, "random.anvil_use", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 1022: + this.field_72769_h.func_175731_a(p_180439_3_, "random.anvil_land", 0.3F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 2000: + int i = p_180439_4_ % 3 - 1; + int j = p_180439_4_ / 3 % 3 - 1; + double d0 = (double)p_180439_3_.n() + (double)i * 0.6D + 0.5D; + double d1 = (double)p_180439_3_.o() + 0.5D; + double d2 = (double)p_180439_3_.p() + (double)j * 0.6D + 0.5D; + + for(int i1 = 0; i1 < 10; ++i1) { + double d15 = random.nextDouble() * 0.2D + 0.01D; + double d16 = d0 + (double)i * 0.01D + (random.nextDouble() - 0.5D) * (double)j * 0.5D; + double d17 = d1 + (random.nextDouble() - 0.5D) * 0.5D; + double d18 = d2 + (double)j * 0.01D + (random.nextDouble() - 0.5D) * (double)i * 0.5D; + double d19 = (double)i * d15 + random.nextGaussian() * 0.01D; + double d20 = -0.03D + random.nextGaussian() * 0.01D; + double d21 = (double)j * d15 + random.nextGaussian() * 0.01D; + this.func_174972_a(EnumParticleTypes.SMOKE_NORMAL, d16, d17, d18, d19, d20, d21, new int[0]); + } + + return; + case 2001: + Block block = Block.func_149729_e(p_180439_4_ & 4095); + if(block.func_149688_o() != Material.field_151579_a) { + this.field_72777_q.func_147118_V().func_147682_a(new PositionedSoundRecord(new ResourceLocation(block.field_149762_H.func_150495_a()), (block.field_149762_H.func_150497_c() + 1.0F) / 2.0F, block.field_149762_H.func_150494_d() * 0.8F, (float)p_180439_3_.n() + 0.5F, (float)p_180439_3_.o() + 0.5F, (float)p_180439_3_.p() + 0.5F)); + } + + this.field_72777_q.field_71452_i.func_180533_a(p_180439_3_, block.func_176203_a(p_180439_4_ >> 12 & 255)); + break; + case 2002: + double d3 = (double)p_180439_3_.n(); + double d4 = (double)p_180439_3_.o(); + double d5 = (double)p_180439_3_.p(); + + for(int k = 0; k < 8; ++k) { + this.func_174972_a(EnumParticleTypes.ITEM_CRACK, d3, d4, d5, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, new int[]{Item.func_150891_b(Items.field_151068_bn), p_180439_4_}); + } + + int j1 = Items.field_151068_bn.func_77620_a(p_180439_4_); + float f = (float)(j1 >> 16 & 255) / 255.0F; + float f1 = (float)(j1 >> 8 & 255) / 255.0F; + float f2 = (float)(j1 >> 0 & 255) / 255.0F; + EnumParticleTypes enumparticletypes = EnumParticleTypes.SPELL; + if(Items.field_151068_bn.func_77833_h(p_180439_4_)) { + enumparticletypes = EnumParticleTypes.SPELL_INSTANT; + } + + for(int k1 = 0; k1 < 100; ++k1) { + double d7 = random.nextDouble() * 4.0D; + double d9 = random.nextDouble() * 3.141592653589793D * 2.0D; + double d11 = Math.cos(d9) * d7; + double d23 = 0.01D + random.nextDouble() * 0.5D; + double d24 = Math.sin(d9) * d7; + EntityFX entityfx = this.func_174974_b(enumparticletypes.func_179348_c(), enumparticletypes.func_179344_e(), d3 + d11 * 0.1D, d4 + 0.3D, d5 + d24 * 0.1D, d11, d23, d24, new int[0]); + if(entityfx != null) { + float f3 = 0.75F + random.nextFloat() * 0.25F; + entityfx.func_70538_b(f * f3, f1 * f3, f2 * f3); + entityfx.func_70543_e((float)d7); + } + } + + this.field_72769_h.func_175731_a(p_180439_3_, "game.potion.smash", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 2003: + double d6 = (double)p_180439_3_.n() + 0.5D; + double d8 = (double)p_180439_3_.o(); + double d10 = (double)p_180439_3_.p() + 0.5D; + + for(int l1 = 0; l1 < 8; ++l1) { + this.func_174972_a(EnumParticleTypes.ITEM_CRACK, d6, d8, d10, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D, new int[]{Item.func_150891_b(Items.field_151061_bv)}); + } + + for(double d22 = 0.0D; d22 < 6.283185307179586D; d22 += 0.15707963267948966D) { + this.func_174972_a(EnumParticleTypes.PORTAL, d6 + Math.cos(d22) * 5.0D, d8 - 0.4D, d10 + Math.sin(d22) * 5.0D, Math.cos(d22) * -5.0D, 0.0D, Math.sin(d22) * -5.0D, new int[0]); + this.func_174972_a(EnumParticleTypes.PORTAL, d6 + Math.cos(d22) * 5.0D, d8 - 0.4D, d10 + Math.sin(d22) * 5.0D, Math.cos(d22) * -7.0D, 0.0D, Math.sin(d22) * -7.0D, new int[0]); + } + + return; + case 2004: + for(int l = 0; l < 20; ++l) { + double d12 = (double)p_180439_3_.n() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D; + double d13 = (double)p_180439_3_.o() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D; + double d14 = (double)p_180439_3_.p() + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D; + this.field_72769_h.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d12, d13, d14, 0.0D, 0.0D, 0.0D, new int[0]); + this.field_72769_h.func_175688_a(EnumParticleTypes.FLAME, d12, d13, d14, 0.0D, 0.0D, 0.0D, new int[0]); + } + + return; + case 2005: + ItemDye.func_180617_a(this.field_72769_h, p_180439_3_, p_180439_4_); + } + + } + + public void func_180441_b(int p_180441_1_, BlockPos p_180441_2_, int p_180441_3_) { + if(p_180441_3_ >= 0 && p_180441_3_ < 10) { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)this.field_72738_E.get(Integer.valueOf(p_180441_1_)); + if(destroyblockprogress == null || destroyblockprogress.func_180246_b().n() != p_180441_2_.n() || destroyblockprogress.func_180246_b().o() != p_180441_2_.o() || destroyblockprogress.func_180246_b().p() != p_180441_2_.p()) { + destroyblockprogress = new DestroyBlockProgress(p_180441_1_, p_180441_2_); + this.field_72738_E.put(Integer.valueOf(p_180441_1_), destroyblockprogress); + } + + destroyblockprogress.func_73107_a(p_180441_3_); + destroyblockprogress.func_82744_b(this.field_72773_u); + } else { + this.field_72738_E.remove(Integer.valueOf(p_180441_1_)); + } + + } + + public void func_174979_m() { + this.field_147595_R = true; + } + + public boolean hasNoChunkUpdates() { + return this.field_175009_l.isEmpty() && this.field_174995_M.hasChunkUpdates(); + } + + public void resetClouds() { + this.cloudRenderer.reset(); + } + + public int getCountRenderers() { + return this.field_175008_n.field_178164_f.length; + } + + public int getCountActiveRenderers() { + return this.field_72755_R.size(); + } + + public int getCountEntitiesRendered() { + return this.field_72749_I; + } + + public int getCountTileEntitiesRendered() { + return this.countTileEntitiesRendered; + } + + public int getCountLoadedChunks() { + if(this.field_72769_h == null) { + return 0; + } else { + IChunkProvider ichunkprovider = this.field_72769_h.func_72863_F(); + if(ichunkprovider == null) { + return 0; + } else { + if(ichunkprovider != this.worldChunkProvider) { + this.worldChunkProvider = ichunkprovider; + this.worldChunkProviderMap = (LongHashMap)Reflector.getFieldValue(ichunkprovider, Reflector.ChunkProviderClient_chunkMapping); + } + + return this.worldChunkProviderMap == null?0:this.worldChunkProviderMap.func_76162_a(); + } + } + } + + public int getCountChunksToUpdate() { + return this.field_175009_l.size(); + } + + public RenderChunk getRenderChunk(BlockPos p_getRenderChunk_1_) { + return this.field_175008_n.func_178161_a(p_getRenderChunk_1_); + } + + public WorldClient getWorld() { + return this.field_72769_h; + } + + private void clearRenderInfos() { + if(renderEntitiesCounter > 0) { + this.field_72755_R = new ArrayList(this.field_72755_R.size() + 16); + this.renderInfosEntities = new ArrayList(this.renderInfosEntities.size() + 16); + this.renderInfosTileEntities = new ArrayList(this.renderInfosTileEntities.size() + 16); + } else { + this.field_72755_R.clear(); + this.renderInfosEntities.clear(); + this.renderInfosTileEntities.clear(); + } + + } + + public void onPlayerPositionSet() { + if(this.firstWorldLoad) { + this.func_72712_a(); + this.firstWorldLoad = false; + } + + } + + public void pauseChunkUpdates() { + if(this.field_174995_M != null) { + this.field_174995_M.pauseChunkUpdates(); + } + + } + + public void resumeChunkUpdates() { + if(this.field_174995_M != null) { + this.field_174995_M.resumeChunkUpdates(); + } + + } + + public void func_181023_a(Collection p_181023_1_, Collection p_181023_2_) { + synchronized(this.field_181024_n) { + this.field_181024_n.removeAll(p_181023_1_); + this.field_181024_n.addAll(p_181023_2_); + } + } + + public static class ContainerLocalRenderInformation { + final RenderChunk field_178036_a; + EnumFacing field_178034_b; + int field_178035_c; + + public ContainerLocalRenderInformation(RenderChunk p_i2_1_, EnumFacing p_i2_2_, int p_i2_3_) { + this.field_178036_a = p_i2_1_; + this.field_178034_b = p_i2_2_; + this.field_178035_c = p_i2_3_; + } + + public void setFacingBit(byte p_setFacingBit_1_, EnumFacing p_setFacingBit_2_) { + this.field_178035_c = this.field_178035_c | p_setFacingBit_1_ | 1 << p_setFacingBit_2_.ordinal(); + } + + public boolean isFacingBit(EnumFacing p_isFacingBit_1_) { + return (this.field_178035_c & 1 << p_isFacingBit_1_.ordinal()) > 0; + } + + private void initialize(EnumFacing p_initialize_1_, int p_initialize_2_) { + this.field_178034_b = p_initialize_1_; + this.field_178035_c = p_initialize_2_; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderHelper.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderHelper.java new file mode 100644 index 0000000..f418e17 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderHelper.java @@ -0,0 +1,64 @@ +package net.minecraft.client.renderer; + +import java.nio.FloatBuffer; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +public class RenderHelper +{ + private static FloatBuffer colorBuffer = GLAllocation.createDirectFloatBuffer(16); + private static final Vec3 LIGHT0_POS = (new Vec3(0.20000000298023224D, 1.0D, -0.699999988079071D)).normalize(); + private static final Vec3 LIGHT1_POS = (new Vec3(-0.20000000298023224D, 1.0D, 0.699999988079071D)).normalize(); + + public static void disableStandardItemLighting() + { + GlStateManager.disableLighting(); + GlStateManager.disableLight(0); + GlStateManager.disableLight(1); + GlStateManager.disableColorMaterial(); + } + + public static void enableStandardItemLighting() + { + GlStateManager.enableLighting(); + GlStateManager.enableLight(0); + GlStateManager.enableLight(1); + GlStateManager.enableColorMaterial(); + GlStateManager.colorMaterial(1032, 5634); + float f = 0.4F; + float f1 = 0.6F; + float f2 = 0.0F; + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, (FloatBuffer)setColorBuffer(LIGHT0_POS.xCoord, LIGHT0_POS.yCoord, LIGHT0_POS.zCoord, 0.0D)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, (FloatBuffer)setColorBuffer(f1, f1, f1, 1.0F)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, (FloatBuffer)setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, (FloatBuffer)setColorBuffer(f2, f2, f2, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, (FloatBuffer)setColorBuffer(LIGHT1_POS.xCoord, LIGHT1_POS.yCoord, LIGHT1_POS.zCoord, 0.0D)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, (FloatBuffer)setColorBuffer(f1, f1, f1, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, (FloatBuffer)setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_SPECULAR, (FloatBuffer)setColorBuffer(f2, f2, f2, 1.0F)); + GlStateManager.shadeModel(7424); + GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, (FloatBuffer)setColorBuffer(f, f, f, 1.0F)); + } + + private static FloatBuffer setColorBuffer(double p_74517_0_, double p_74517_2_, double p_74517_4_, double p_74517_6_) + { + return setColorBuffer((float)p_74517_0_, (float)p_74517_2_, (float)p_74517_4_, (float)p_74517_6_); + } + + private static FloatBuffer setColorBuffer(float p_74521_0_, float p_74521_1_, float p_74521_2_, float p_74521_3_) + { + colorBuffer.clear(); + colorBuffer.put(p_74521_0_).put(p_74521_1_).put(p_74521_2_).put(p_74521_3_); + colorBuffer.flip(); + return colorBuffer; + } + + public static void enableGUIStandardItemLighting() + { + GlStateManager.pushMatrix(); + GlStateManager.rotate(-30.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(165.0F, 1.0F, 0.0F, 0.0F); + enableStandardItemLighting(); + GlStateManager.popMatrix(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderList.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderList.java new file mode 100644 index 0000000..f0a9074 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/RenderList.java @@ -0,0 +1,101 @@ +package net.minecraft.client.renderer; + +import java.nio.IntBuffer; +import net.minecraft.client.renderer.chunk.ListedRenderChunk; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.src.Config; +import net.minecraft.util.EnumWorldBlockLayer; +import org.lwjgl.opengl.GL11; + +public class RenderList extends ChunkRenderContainer +{ + private double viewEntityX; + private double viewEntityY; + private double viewEntityZ; + IntBuffer bufferLists = GLAllocation.createDirectIntBuffer(16); + + public void renderChunkLayer(EnumWorldBlockLayer layer) + { + if (this.initialized) + { + if (!Config.isRenderRegions()) + { + for (RenderChunk renderchunk1 : this.renderChunks) + { + ListedRenderChunk listedrenderchunk1 = (ListedRenderChunk)renderchunk1; + GlStateManager.pushMatrix(); + this.preRenderChunk(renderchunk1); + GL11.glCallList(listedrenderchunk1.getDisplayList(layer, listedrenderchunk1.getCompiledChunk())); + GlStateManager.popMatrix(); + } + } + else + { + int i = Integer.MIN_VALUE; + int j = Integer.MIN_VALUE; + + for (RenderChunk renderchunk : this.renderChunks) + { + ListedRenderChunk listedrenderchunk = (ListedRenderChunk)renderchunk; + + if (i != renderchunk.regionX || j != renderchunk.regionZ) + { + if (this.bufferLists.position() > 0) + { + this.drawRegion(i, j, this.bufferLists); + } + + i = renderchunk.regionX; + j = renderchunk.regionZ; + } + + if (this.bufferLists.position() >= this.bufferLists.capacity()) + { + IntBuffer intbuffer = GLAllocation.createDirectIntBuffer(this.bufferLists.capacity() * 2); + this.bufferLists.flip(); + intbuffer.put(this.bufferLists); + this.bufferLists = intbuffer; + } + + this.bufferLists.put(listedrenderchunk.getDisplayList(layer, listedrenderchunk.getCompiledChunk())); + } + + if (this.bufferLists.position() > 0) + { + this.drawRegion(i, j, this.bufferLists); + } + } + + if (Config.isMultiTexture()) + { + GlStateManager.bindCurrentTexture(); + } + + GlStateManager.resetColor(); + this.renderChunks.clear(); + } + } + + public void initialize(double viewEntityXIn, double viewEntityYIn, double viewEntityZIn) + { + this.viewEntityX = viewEntityXIn; + this.viewEntityY = viewEntityYIn; + this.viewEntityZ = viewEntityZIn; + super.initialize(viewEntityXIn, viewEntityYIn, viewEntityZIn); + } + + private void drawRegion(int p_drawRegion_1_, int p_drawRegion_2_, IntBuffer p_drawRegion_3_) + { + GlStateManager.pushMatrix(); + this.preRenderRegion(p_drawRegion_1_, 0, p_drawRegion_2_); + p_drawRegion_3_.flip(); + GlStateManager.callLists(p_drawRegion_3_); + p_drawRegion_3_.clear(); + GlStateManager.popMatrix(); + } + + public void preRenderRegion(int p_preRenderRegion_1_, int p_preRenderRegion_2_, int p_preRenderRegion_3_) + { + GlStateManager.translate((float)((double)p_preRenderRegion_1_ - this.viewEntityX), (float)((double)p_preRenderRegion_2_ - this.viewEntityY), (float)((double)p_preRenderRegion_3_ - this.viewEntityZ)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/StitcherException.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/StitcherException.java new file mode 100644 index 0000000..e3c4caa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/StitcherException.java @@ -0,0 +1,14 @@ +package net.minecraft.client.renderer; + +import net.minecraft.client.renderer.texture.Stitcher; + +public class StitcherException extends RuntimeException +{ + private final Stitcher.Holder holder; + + public StitcherException(Stitcher.Holder p_i2344_1_, String p_i2344_2_) + { + super(p_i2344_2_); + this.holder = p_i2344_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/Tessellator.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/Tessellator.java new file mode 100644 index 0000000..28e1d8a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/Tessellator.java @@ -0,0 +1,36 @@ +package net.minecraft.client.renderer; + +import net.optifine.SmartAnimations; + +public class Tessellator +{ + private WorldRenderer worldRenderer; + private WorldVertexBufferUploader vboUploader = new WorldVertexBufferUploader(); + private static final Tessellator instance = new Tessellator(2097152); + + public static Tessellator getInstance() + { + return instance; + } + + public Tessellator(int bufferSize) + { + this.worldRenderer = new WorldRenderer(bufferSize); + } + + public void draw() + { + if (this.worldRenderer.animatedSprites != null) + { + SmartAnimations.spritesRendered(this.worldRenderer.animatedSprites); + } + + this.worldRenderer.finishDrawing(); + this.vboUploader.draw(this.worldRenderer); + } + + public WorldRenderer getWorldRenderer() + { + return this.worldRenderer; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java new file mode 100644 index 0000000..167d7d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java @@ -0,0 +1,272 @@ +package net.minecraft.client.renderer; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.Proxy; +import java.net.URL; +import java.net.Proxy.Type; +import java.util.concurrent.atomic.AtomicInteger; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.http.HttpPipeline; +import net.optifine.http.HttpRequest; +import net.optifine.http.HttpResponse; +import net.optifine.player.CapeImageBuffer; +import net.optifine.shaders.ShadersTex; +import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ThreadDownloadImageData extends SimpleTexture +{ + private static final Logger logger = LogManager.getLogger(); + private static final AtomicInteger threadDownloadCounter = new AtomicInteger(0); + private final File cacheFile; + private final String imageUrl; + private final IImageBuffer imageBuffer; + private BufferedImage bufferedImage; + private Thread imageThread; + private boolean textureUploaded; + public Boolean imageFound = null; + public boolean pipeline = false; + + public static Runtime runtime = Runtime.getRuntime(); + + public ThreadDownloadImageData(File cacheFileIn, String imageUrlIn, ResourceLocation textureResourceLocation, IImageBuffer imageBufferIn) + { + super(textureResourceLocation); + this.cacheFile = cacheFileIn; + this.imageUrl = imageUrlIn; + this.imageBuffer = imageBufferIn; + } + + private void checkTextureUploaded() + { + if (!this.textureUploaded && this.bufferedImage != null) + { + this.textureUploaded = true; + + if (this.textureLocation != null) + { + this.deleteGlTexture(); + } + + if (Config.isShaders()) + { + ShadersTex.loadSimpleTexture(super.getGlTextureId(), this.bufferedImage, false, false, Config.getResourceManager(), this.textureLocation, this.getMultiTexID()); + } + else + { + TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage); + } + } + } + + public int getGlTextureId() + { + this.checkTextureUploaded(); + return super.getGlTextureId(); + } + + public void setBufferedImage(BufferedImage bufferedImageIn) + { + this.bufferedImage = bufferedImageIn; + + if (this.imageBuffer != null) + { + this.imageBuffer.skinAvailable(); + } + + this.imageFound = Boolean.valueOf(this.bufferedImage != null); + } + + public void loadTexture(IResourceManager resourceManager) throws IOException + { + if (this.bufferedImage == null && this.textureLocation != null) + { + super.loadTexture(resourceManager); + } + + if (this.imageThread == null) + { + if (this.cacheFile != null && this.cacheFile.isFile()) + { + logger.debug("Loading http texture from local cache ({})", new Object[] {this.cacheFile}); + + try + { + this.bufferedImage = ImageIO.read(this.cacheFile); + + if (this.imageBuffer != null) + { + this.setBufferedImage(this.imageBuffer.parseUserSkin(this.bufferedImage)); + } + + this.loadingFinished(); + } + catch (IOException ioexception) + { + logger.error((String)("Couldn\'t load skin " + this.cacheFile), (Throwable)ioexception); + this.loadTextureFromServer(); + } + } + else + { + this.loadTextureFromServer(); + } + } + } + + protected void loadTextureFromServer() + { + this.imageThread = new Thread("Texture Downloader #" + threadDownloadCounter.incrementAndGet()) + { + public void run() + { + HttpURLConnection httpurlconnection = null; + ThreadDownloadImageData.logger.debug("Downloading http texture from {} to {}", new Object[] {ThreadDownloadImageData.this.imageUrl, ThreadDownloadImageData.this.cacheFile}); + + if (ThreadDownloadImageData.this.shouldPipeline()) + { + ThreadDownloadImageData.this.loadPipelined(); + } + else + { + try + { + httpurlconnection = (HttpURLConnection)(new URL(ThreadDownloadImageData.this.imageUrl)).openConnection(Minecraft.getMinecraft().getProxy()); + httpurlconnection.setDoInput(true); + httpurlconnection.setDoOutput(false); + httpurlconnection.connect(); + + if (httpurlconnection.getResponseCode() / 100 != 2) + { + if (httpurlconnection.getErrorStream() != null) + { + Config.readAll(httpurlconnection.getErrorStream()); + } + + return; + } + + BufferedImage bufferedimage; + + if (ThreadDownloadImageData.this.cacheFile != null) + { + FileUtils.copyInputStreamToFile(httpurlconnection.getInputStream(), ThreadDownloadImageData.this.cacheFile); + bufferedimage = ImageIO.read(ThreadDownloadImageData.this.cacheFile); + } + else + { + bufferedimage = TextureUtil.readBufferedImage(httpurlconnection.getInputStream()); + } + + if (ThreadDownloadImageData.this.imageBuffer != null) + { + bufferedimage = ThreadDownloadImageData.this.imageBuffer.parseUserSkin(bufferedimage); + } + + ThreadDownloadImageData.this.setBufferedImage(bufferedimage); + } + catch (Exception exception) + { + ThreadDownloadImageData.logger.error("Couldn\'t download http texture: " + exception.getClass().getName() + ": " + exception.getMessage()); + return; + } + finally + { + if (httpurlconnection != null) + { + httpurlconnection.disconnect(); + } + + ThreadDownloadImageData.this.loadingFinished(); + } + } + } + }; + this.imageThread.setDaemon(true); + this.imageThread.start(); + } + + private boolean shouldPipeline() + { + if (!this.pipeline) + { + return false; + } + else + { + Proxy proxy = Minecraft.getMinecraft().getProxy(); + return proxy.type() != Type.DIRECT && proxy.type() != Type.SOCKS ? false : this.imageUrl.startsWith("http://"); + } + } + + private void loadPipelined() + { + try + { + HttpRequest httprequest = HttpPipeline.makeRequest(this.imageUrl, Minecraft.getMinecraft().getProxy()); + HttpResponse httpresponse = HttpPipeline.executeRequest(httprequest); + + if (httpresponse.getStatus() / 100 != 2) + { + return; + } + + byte[] abyte = httpresponse.getBody(); + ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(abyte); + BufferedImage bufferedimage; + + if (this.cacheFile != null) + { + FileUtils.copyInputStreamToFile(bytearrayinputstream, this.cacheFile); + bufferedimage = ImageIO.read(this.cacheFile); + } + else + { + bufferedimage = TextureUtil.readBufferedImage(bytearrayinputstream); + } + + if (this.imageBuffer != null) + { + bufferedimage = this.imageBuffer.parseUserSkin(bufferedimage); + } + + this.setBufferedImage(bufferedimage); + } + catch (Exception exception) + { + logger.error("Couldn\'t download http texture: " + exception.getClass().getName() + ": " + exception.getMessage()); + return; + } + finally + { + this.loadingFinished(); + } + } + + private void loadingFinished() + { + this.imageFound = Boolean.valueOf(this.bufferedImage != null); + + if (this.imageBuffer instanceof CapeImageBuffer) + { + CapeImageBuffer capeimagebuffer = (CapeImageBuffer)this.imageBuffer; + capeimagebuffer.cleanup(); + } + } + + public IImageBuffer getImageBuffer() + { + return this.imageBuffer; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/VboRenderList.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/VboRenderList.java new file mode 100644 index 0000000..c61329c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/VboRenderList.java @@ -0,0 +1,110 @@ +package net.minecraft.client.renderer; + +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.client.renderer.vertex.VertexBuffer; +import net.minecraft.src.Config; +import net.minecraft.util.EnumWorldBlockLayer; +import net.optifine.render.VboRegion; +import net.optifine.shaders.ShadersRender; +import org.lwjgl.opengl.GL11; + +public class VboRenderList extends ChunkRenderContainer +{ + private double viewEntityX; + private double viewEntityY; + private double viewEntityZ; + + public void renderChunkLayer(EnumWorldBlockLayer layer) + { + if (this.initialized) + { + if (!Config.isRenderRegions()) + { + for (RenderChunk renderchunk1 : this.renderChunks) + { + VertexBuffer vertexbuffer1 = renderchunk1.getVertexBufferByLayer(layer.ordinal()); + GlStateManager.pushMatrix(); + this.preRenderChunk(renderchunk1); + renderchunk1.multModelviewMatrix(); + vertexbuffer1.bindBuffer(); + this.setupArrayPointers(); + vertexbuffer1.drawArrays(7); + GlStateManager.popMatrix(); + } + } + else + { + int i = Integer.MIN_VALUE; + int j = Integer.MIN_VALUE; + VboRegion vboregion = null; + + for (RenderChunk renderchunk : this.renderChunks) + { + VertexBuffer vertexbuffer = renderchunk.getVertexBufferByLayer(layer.ordinal()); + VboRegion vboregion1 = vertexbuffer.getVboRegion(); + + if (vboregion1 != vboregion || i != renderchunk.regionX || j != renderchunk.regionZ) + { + if (vboregion != null) + { + this.drawRegion(i, j, vboregion); + } + + i = renderchunk.regionX; + j = renderchunk.regionZ; + vboregion = vboregion1; + } + + vertexbuffer.drawArrays(7); + } + + if (vboregion != null) + { + this.drawRegion(i, j, vboregion); + } + } + + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0); + GlStateManager.resetColor(); + this.renderChunks.clear(); + } + } + + public void setupArrayPointers() + { + if (Config.isShaders()) + { + ShadersRender.setupArrayPointersVbo(); + } + else + { + GL11.glVertexPointer(3, GL11.GL_FLOAT, 28, 0L); + GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 28, 12L); + GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 28, 16L); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glTexCoordPointer(2, GL11.GL_SHORT, 28, 24L); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + } + + public void initialize(double viewEntityXIn, double viewEntityYIn, double viewEntityZIn) + { + this.viewEntityX = viewEntityXIn; + this.viewEntityY = viewEntityYIn; + this.viewEntityZ = viewEntityZIn; + super.initialize(viewEntityXIn, viewEntityYIn, viewEntityZIn); + } + + private void drawRegion(int p_drawRegion_1_, int p_drawRegion_2_, VboRegion p_drawRegion_3_) + { + GlStateManager.pushMatrix(); + this.preRenderRegion(p_drawRegion_1_, 0, p_drawRegion_2_); + p_drawRegion_3_.finishDraw(this); + GlStateManager.popMatrix(); + } + + public void preRenderRegion(int p_preRenderRegion_1_, int p_preRenderRegion_2_, int p_preRenderRegion_3_) + { + GlStateManager.translate((float)((double)p_preRenderRegion_1_ - this.viewEntityX), (float)((double)p_preRenderRegion_2_ - this.viewEntityY), (float)((double)p_preRenderRegion_3_ - this.viewEntityZ)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/VertexBufferUploader.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/VertexBufferUploader.java new file mode 100644 index 0000000..173c35d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/VertexBufferUploader.java @@ -0,0 +1,26 @@ +package net.minecraft.client.renderer; + +import net.minecraft.client.renderer.vertex.VertexBuffer; +import net.minecraft.src.Config; + +public class VertexBufferUploader extends WorldVertexBufferUploader +{ + private VertexBuffer vertexBuffer = null; + + public void draw(WorldRenderer p_181679_1_) + { + if (p_181679_1_.getDrawMode() == 7 && Config.isQuadsToTriangles()) + { + p_181679_1_.quadsToTriangles(); + this.vertexBuffer.setDrawMode(p_181679_1_.getDrawMode()); + } + + this.vertexBuffer.bufferData(p_181679_1_.getByteBuffer()); + p_181679_1_.reset(); + } + + public void setVertexBuffer(VertexBuffer vertexBufferIn) + { + this.vertexBuffer = vertexBufferIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ViewFrustum.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ViewFrustum.java new file mode 100644 index 0000000..5550579 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/ViewFrustum.java @@ -0,0 +1,265 @@ +package net.minecraft.client.renderer; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.renderer.chunk.IRenderChunkFactory; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.optifine.render.VboRegion; + +public class ViewFrustum +{ + protected final RenderGlobal renderGlobal; + protected final World world; + protected int countChunksY; + protected int countChunksX; + protected int countChunksZ; + public RenderChunk[] renderChunks; + private Map mapVboRegions = new HashMap(); + + public ViewFrustum(World worldIn, int renderDistanceChunks, RenderGlobal p_i46246_3_, IRenderChunkFactory renderChunkFactory) + { + this.renderGlobal = p_i46246_3_; + this.world = worldIn; + this.setCountChunksXYZ(renderDistanceChunks); + this.createRenderChunks(renderChunkFactory); + } + + protected void createRenderChunks(IRenderChunkFactory renderChunkFactory) + { + int i = this.countChunksX * this.countChunksY * this.countChunksZ; + this.renderChunks = new RenderChunk[i]; + int j = 0; + + for (int k = 0; k < this.countChunksX; ++k) + { + for (int l = 0; l < this.countChunksY; ++l) + { + for (int i1 = 0; i1 < this.countChunksZ; ++i1) + { + int j1 = (i1 * this.countChunksY + l) * this.countChunksX + k; + BlockPos blockpos = new BlockPos(k * 16, l * 16, i1 * 16); + this.renderChunks[j1] = renderChunkFactory.makeRenderChunk(this.world, this.renderGlobal, blockpos, j++); + + if (Config.isVbo() && Config.isRenderRegions()) + { + this.updateVboRegion(this.renderChunks[j1]); + } + } + } + } + + for (int k1 = 0; k1 < this.renderChunks.length; ++k1) + { + RenderChunk renderchunk1 = this.renderChunks[k1]; + + for (int l1 = 0; l1 < EnumFacing.VALUES.length; ++l1) + { + EnumFacing enumfacing = EnumFacing.VALUES[l1]; + BlockPos blockpos1 = renderchunk1.getBlockPosOffset16(enumfacing); + RenderChunk renderchunk = this.getRenderChunk(blockpos1); + renderchunk1.setRenderChunkNeighbour(enumfacing, renderchunk); + } + } + } + + public void deleteGlResources() + { + for (RenderChunk renderchunk : this.renderChunks) + { + renderchunk.deleteGlResources(); + } + + this.deleteVboRegions(); + } + + protected void setCountChunksXYZ(int renderDistanceChunks) + { + int i = renderDistanceChunks * 2 + 1; + this.countChunksX = i; + this.countChunksY = 16; + this.countChunksZ = i; + } + + public void updateChunkPositions(double viewEntityX, double viewEntityZ) + { + int i = MathHelper.floor_double(viewEntityX) - 8; + int j = MathHelper.floor_double(viewEntityZ) - 8; + int k = this.countChunksX * 16; + + for (int l = 0; l < this.countChunksX; ++l) + { + int i1 = this.func_178157_a(i, k, l); + + for (int j1 = 0; j1 < this.countChunksZ; ++j1) + { + int k1 = this.func_178157_a(j, k, j1); + + for (int l1 = 0; l1 < this.countChunksY; ++l1) + { + int i2 = l1 * 16; + RenderChunk renderchunk = this.renderChunks[(j1 * this.countChunksY + l1) * this.countChunksX + l]; + BlockPos blockpos = renderchunk.getPosition(); + + if (blockpos.getX() != i1 || blockpos.getY() != i2 || blockpos.getZ() != k1) + { + BlockPos blockpos1 = new BlockPos(i1, i2, k1); + + if (!blockpos1.equals(renderchunk.getPosition())) + { + renderchunk.setPosition(blockpos1); + } + } + } + } + } + } + + private int func_178157_a(int p_178157_1_, int p_178157_2_, int p_178157_3_) + { + int i = p_178157_3_ * 16; + int j = i - p_178157_1_ + p_178157_2_ / 2; + + if (j < 0) + { + j -= p_178157_2_ - 1; + } + + return i - j / p_178157_2_ * p_178157_2_; + } + + public void markBlocksForUpdate(int fromX, int fromY, int fromZ, int toX, int toY, int toZ) + { + int i = MathHelper.bucketInt(fromX, 16); + int j = MathHelper.bucketInt(fromY, 16); + int k = MathHelper.bucketInt(fromZ, 16); + int l = MathHelper.bucketInt(toX, 16); + int i1 = MathHelper.bucketInt(toY, 16); + int j1 = MathHelper.bucketInt(toZ, 16); + + for (int k1 = i; k1 <= l; ++k1) + { + int l1 = k1 % this.countChunksX; + + if (l1 < 0) + { + l1 += this.countChunksX; + } + + for (int i2 = j; i2 <= i1; ++i2) + { + int j2 = i2 % this.countChunksY; + + if (j2 < 0) + { + j2 += this.countChunksY; + } + + for (int k2 = k; k2 <= j1; ++k2) + { + int l2 = k2 % this.countChunksZ; + + if (l2 < 0) + { + l2 += this.countChunksZ; + } + + int i3 = (l2 * this.countChunksY + j2) * this.countChunksX + l1; + RenderChunk renderchunk = this.renderChunks[i3]; + renderchunk.setNeedsUpdate(true); + } + } + } + } + + public RenderChunk getRenderChunk(BlockPos pos) + { + int i = pos.getX() >> 4; + int j = pos.getY() >> 4; + int k = pos.getZ() >> 4; + + if (j >= 0 && j < this.countChunksY) + { + i = i % this.countChunksX; + + if (i < 0) + { + i += this.countChunksX; + } + + k = k % this.countChunksZ; + + if (k < 0) + { + k += this.countChunksZ; + } + + int l = (k * this.countChunksY + j) * this.countChunksX + i; + return this.renderChunks[l]; + } + else + { + return null; + } + } + + private void updateVboRegion(RenderChunk p_updateVboRegion_1_) + { + BlockPos blockpos = p_updateVboRegion_1_.getPosition(); + int i = blockpos.getX() >> 8 << 8; + int j = blockpos.getZ() >> 8 << 8; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); + EnumWorldBlockLayer[] aenumworldblocklayer = RenderChunk.ENUM_WORLD_BLOCK_LAYERS; + VboRegion[] avboregion = (VboRegion[])this.mapVboRegions.get(chunkcoordintpair); + + if (avboregion == null) + { + avboregion = new VboRegion[aenumworldblocklayer.length]; + + for (int k = 0; k < aenumworldblocklayer.length; ++k) + { + avboregion[k] = new VboRegion(aenumworldblocklayer[k]); + } + + this.mapVboRegions.put(chunkcoordintpair, avboregion); + } + + for (int l = 0; l < aenumworldblocklayer.length; ++l) + { + VboRegion vboregion = avboregion[l]; + + if (vboregion != null) + { + p_updateVboRegion_1_.getVertexBufferByLayer(l).setVboRegion(vboregion); + } + } + } + + public void deleteVboRegions() + { + for (ChunkCoordIntPair chunkcoordintpair : this.mapVboRegions.keySet()) + { + VboRegion[] avboregion = (VboRegion[])this.mapVboRegions.get(chunkcoordintpair); + + for (int i = 0; i < avboregion.length; ++i) + { + VboRegion vboregion = avboregion[i]; + + if (vboregion != null) + { + vboregion.deleteGlBuffers(); + } + + avboregion[i] = null; + } + } + + this.mapVboRegions.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldRenderer.java new file mode 100644 index 0000000..1945b44 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldRenderer.java @@ -0,0 +1,1070 @@ +package net.minecraft.client.renderer; + +import com.google.common.primitives.Floats; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; +import net.optifine.SmartAnimations; +import net.optifine.render.RenderEnv; +import net.optifine.shaders.SVertexBuilder; +import net.optifine.util.TextureUtils; +import org.apache.logging.log4j.LogManager; +import org.lwjgl.opengl.GL11; + +import java.nio.*; +import java.util.Arrays; +import java.util.BitSet; +import java.util.Comparator; + +public class WorldRenderer +{ + private ByteBuffer byteBuffer; + public IntBuffer rawIntBuffer; + private ShortBuffer rawShortBuffer; + public FloatBuffer rawFloatBuffer; + public int vertexCount; + private VertexFormatElement vertexFormatElement; + private int vertexFormatIndex; + private boolean noColor; + public int drawMode; + private double xOffset; + private double yOffset; + private double zOffset; + private VertexFormat vertexFormat; + public boolean isDrawing; + private EnumWorldBlockLayer blockLayer = null; + private boolean[] drawnIcons = new boolean[256]; + private TextureAtlasSprite[] quadSprites = null; + private TextureAtlasSprite[] quadSpritesPrev = null; + private TextureAtlasSprite quadSprite = null; + public SVertexBuilder sVertexBuilder; + public RenderEnv renderEnv = null; + public BitSet animatedSprites = null; + public BitSet animatedSpritesCached = new BitSet(); + private boolean modeTriangles = false; + private ByteBuffer byteBufferTriangles; + + public WorldRenderer(int bufferSizeIn) + { + this.byteBuffer = GLAllocation.createDirectByteBuffer(bufferSizeIn * 4); + this.rawIntBuffer = this.byteBuffer.asIntBuffer(); + this.rawShortBuffer = this.byteBuffer.asShortBuffer(); + this.rawFloatBuffer = this.byteBuffer.asFloatBuffer(); + SVertexBuilder.initVertexBuilder(this); + } + + private void growBuffer(int p_181670_1_) + { + if (p_181670_1_ > this.rawIntBuffer.remaining()) + { + int i = this.byteBuffer.capacity(); + int j = i % 2097152; + int k = j + (((this.rawIntBuffer.position() + p_181670_1_) * 4 - j) / 2097152 + 1) * 2097152; + LogManager.getLogger().warn("Needed to grow BufferBuilder buffer: Old size " + i + " bytes, new size " + k + " bytes."); + int l = this.rawIntBuffer.position(); + ByteBuffer bytebuffer = GLAllocation.createDirectByteBuffer(k); + this.byteBuffer.position(0); + bytebuffer.put(this.byteBuffer); + bytebuffer.rewind(); + this.byteBuffer = bytebuffer; + this.rawFloatBuffer = this.byteBuffer.asFloatBuffer(); + this.rawIntBuffer = this.byteBuffer.asIntBuffer(); + this.rawIntBuffer.position(l); + this.rawShortBuffer = this.byteBuffer.asShortBuffer(); + this.rawShortBuffer.position(l << 1); + + if (this.quadSprites != null) + { + TextureAtlasSprite[] atextureatlassprite = this.quadSprites; + int i1 = this.getBufferQuadSize(); + this.quadSprites = new TextureAtlasSprite[i1]; + System.arraycopy(atextureatlassprite, 0, this.quadSprites, 0, Math.min(atextureatlassprite.length, this.quadSprites.length)); + this.quadSpritesPrev = null; + } + } + } + + public void sortVertexData(float p_181674_1_, float p_181674_2_, float p_181674_3_) + { + int i = this.vertexCount / 4; + final float[] afloat = new float[i]; + + for (int j = 0; j < i; ++j) + { + afloat[j] = getDistanceSq(this.rawFloatBuffer, (float)((double)p_181674_1_ + this.xOffset), (float)((double)p_181674_2_ + this.yOffset), (float)((double)p_181674_3_ + this.zOffset), this.vertexFormat.getIntegerSize(), j * this.vertexFormat.getNextOffset()); + } + + Integer[] ainteger = new Integer[i]; + + for (int k = 0; k < ainteger.length; ++k) + { + ainteger[k] = Integer.valueOf(k); + } + + Arrays.sort(ainteger, new Comparator() + { + public int compare(Integer p_compare_1_, Integer p_compare_2_) + { + return Floats.compare(afloat[p_compare_2_.intValue()], afloat[p_compare_1_.intValue()]); + } + }); + BitSet bitset = new BitSet(); + int l = this.vertexFormat.getNextOffset(); + int[] aint = new int[l]; + + for (int l1 = 0; (l1 = bitset.nextClearBit(l1)) < ainteger.length; ++l1) + { + int i1 = ainteger[l1].intValue(); + + if (i1 != l1) + { + this.rawIntBuffer.limit(i1 * l + l); + this.rawIntBuffer.position(i1 * l); + this.rawIntBuffer.get(aint); + int j1 = i1; + + for (int k1 = ainteger[i1].intValue(); j1 != l1; k1 = ainteger[k1].intValue()) + { + this.rawIntBuffer.limit(k1 * l + l); + this.rawIntBuffer.position(k1 * l); + IntBuffer intbuffer = this.rawIntBuffer.slice(); + this.rawIntBuffer.limit(j1 * l + l); + this.rawIntBuffer.position(j1 * l); + this.rawIntBuffer.put(intbuffer); + bitset.set(j1); + j1 = k1; + } + + this.rawIntBuffer.limit(l1 * l + l); + this.rawIntBuffer.position(l1 * l); + this.rawIntBuffer.put(aint); + } + + bitset.set(l1); + } + + this.rawIntBuffer.limit(this.rawIntBuffer.capacity()); + this.rawIntBuffer.position(this.getBufferSize()); + + if (this.quadSprites != null) + { + TextureAtlasSprite[] atextureatlassprite = new TextureAtlasSprite[this.vertexCount / 4]; + int i2 = this.vertexFormat.getNextOffset() / 4 * 4; + + for (int j2 = 0; j2 < ainteger.length; ++j2) + { + int k2 = ainteger[j2].intValue(); + atextureatlassprite[j2] = this.quadSprites[k2]; + } + + System.arraycopy(atextureatlassprite, 0, this.quadSprites, 0, atextureatlassprite.length); + } + } + + public WorldRenderer.State getVertexState() + { + this.rawIntBuffer.rewind(); + int i = this.getBufferSize(); + this.rawIntBuffer.limit(i); + int[] aint = new int[i]; + this.rawIntBuffer.get(aint); + this.rawIntBuffer.limit(this.rawIntBuffer.capacity()); + this.rawIntBuffer.position(i); + TextureAtlasSprite[] atextureatlassprite = null; + + if (this.quadSprites != null) + { + int j = this.vertexCount / 4; + atextureatlassprite = new TextureAtlasSprite[j]; + System.arraycopy(this.quadSprites, 0, atextureatlassprite, 0, j); + } + + return new WorldRenderer.State(aint, new VertexFormat(this.vertexFormat), atextureatlassprite); + } + + public int getBufferSize() + { + return this.vertexCount * this.vertexFormat.getIntegerSize(); + } + + private static float getDistanceSq(FloatBuffer p_181665_0_, float p_181665_1_, float p_181665_2_, float p_181665_3_, int p_181665_4_, int p_181665_5_) + { + float f = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 0 + 0); + float f1 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 0 + 1); + float f2 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 0 + 2); + float f3 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 1 + 0); + float f4 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 1 + 1); + float f5 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 1 + 2); + float f6 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 2 + 0); + float f7 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 2 + 1); + float f8 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 2 + 2); + float f9 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 3 + 0); + float f10 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 3 + 1); + float f11 = p_181665_0_.get(p_181665_5_ + p_181665_4_ * 3 + 2); + float f12 = (f + f3 + f6 + f9) * 0.25F - p_181665_1_; + float f13 = (f1 + f4 + f7 + f10) * 0.25F - p_181665_2_; + float f14 = (f2 + f5 + f8 + f11) * 0.25F - p_181665_3_; + return f12 * f12 + f13 * f13 + f14 * f14; + } + + public void setVertexState(WorldRenderer.State state) + { + this.rawIntBuffer.clear(); + this.growBuffer(state.getRawBuffer().length); + this.rawIntBuffer.put(state.getRawBuffer()); + this.vertexCount = state.getVertexCount(); + this.vertexFormat = new VertexFormat(state.getVertexFormat()); + + if (state.stateQuadSprites != null) + { + if (this.quadSprites == null) + { + this.quadSprites = this.quadSpritesPrev; + } + + if (this.quadSprites == null || this.quadSprites.length < this.getBufferQuadSize()) + { + this.quadSprites = new TextureAtlasSprite[this.getBufferQuadSize()]; + } + + TextureAtlasSprite[] atextureatlassprite = state.stateQuadSprites; + System.arraycopy(atextureatlassprite, 0, this.quadSprites, 0, atextureatlassprite.length); + } + else + { + if (this.quadSprites != null) + { + this.quadSpritesPrev = this.quadSprites; + } + + this.quadSprites = null; + } + } + + public void reset() + { + this.vertexCount = 0; + this.vertexFormatElement = null; + this.vertexFormatIndex = 0; + this.quadSprite = null; + + if (SmartAnimations.isActive()) + { + if (this.animatedSprites == null) + { + this.animatedSprites = this.animatedSpritesCached; + } + + this.animatedSprites.clear(); + } + else if (this.animatedSprites != null) + { + this.animatedSprites = null; + } + + this.modeTriangles = false; + } + + public void begin(int glMode, VertexFormat format) + { + if (this.isDrawing) + { + throw new IllegalStateException("Already building!"); + } + else + { + this.isDrawing = true; + this.reset(); + this.drawMode = glMode; + this.vertexFormat = format; + this.vertexFormatElement = format.getElement(this.vertexFormatIndex); + this.noColor = false; + this.byteBuffer.limit(this.byteBuffer.capacity()); + + if (Config.isShaders()) + { + SVertexBuilder.endSetVertexFormat(this); + } + + if (Config.isMultiTexture()) + { + if (this.blockLayer != null) + { + if (this.quadSprites == null) + { + this.quadSprites = this.quadSpritesPrev; + } + + if (this.quadSprites == null || this.quadSprites.length < this.getBufferQuadSize()) + { + this.quadSprites = new TextureAtlasSprite[this.getBufferQuadSize()]; + } + } + } + else + { + if (this.quadSprites != null) + { + this.quadSpritesPrev = this.quadSprites; + } + + this.quadSprites = null; + } + } + } + + public WorldRenderer tex(double u, double v) + { + if (this.quadSprite != null && this.quadSprites != null) + { + u = (double)this.quadSprite.toSingleU((float)u); + v = (double)this.quadSprite.toSingleV((float)v); + this.quadSprites[this.vertexCount / 4] = this.quadSprite; + } + + int i = this.vertexCount * this.vertexFormat.getNextOffset() + this.vertexFormat.getOffset(this.vertexFormatIndex); + + switch (this.vertexFormatElement.getType()) + { + case FLOAT: + this.byteBuffer.putFloat(i, (float)u); + this.byteBuffer.putFloat(i + 4, (float)v); + break; + + case UINT: + case INT: + this.byteBuffer.putInt(i, (int)u); + this.byteBuffer.putInt(i + 4, (int)v); + break; + + case USHORT: + case SHORT: + this.byteBuffer.putShort(i, (short)((int)v)); + this.byteBuffer.putShort(i + 2, (short)((int)u)); + break; + + case UBYTE: + case BYTE: + this.byteBuffer.put(i, (byte)((int)v)); + this.byteBuffer.put(i + 1, (byte)((int)u)); + } + + this.nextVertexFormatIndex(); + return this; + } + + public WorldRenderer lightmap(int p_181671_1_, int p_181671_2_) + { + int i = this.vertexCount * this.vertexFormat.getNextOffset() + this.vertexFormat.getOffset(this.vertexFormatIndex); + + switch (this.vertexFormatElement.getType()) + { + case FLOAT: + this.byteBuffer.putFloat(i, (float)p_181671_1_); + this.byteBuffer.putFloat(i + 4, (float)p_181671_2_); + break; + + case UINT: + case INT: + this.byteBuffer.putInt(i, p_181671_1_); + this.byteBuffer.putInt(i + 4, p_181671_2_); + break; + + case USHORT: + case SHORT: + this.byteBuffer.putShort(i, (short)p_181671_2_); + this.byteBuffer.putShort(i + 2, (short)p_181671_1_); + break; + + case UBYTE: + case BYTE: + this.byteBuffer.put(i, (byte)p_181671_2_); + this.byteBuffer.put(i + 1, (byte)p_181671_1_); + } + + this.nextVertexFormatIndex(); + return this; + } + + public void putBrightness4(int p_178962_1_, int p_178962_2_, int p_178962_3_, int p_178962_4_) + { + int i = (this.vertexCount - 4) * this.vertexFormat.getIntegerSize() + this.vertexFormat.getUvOffsetById(1) / 4; + int j = this.vertexFormat.getNextOffset() >> 2; + this.rawIntBuffer.put(i, p_178962_1_); + this.rawIntBuffer.put(i + j, p_178962_2_); + this.rawIntBuffer.put(i + j * 2, p_178962_3_); + this.rawIntBuffer.put(i + j * 3, p_178962_4_); + } + + public void putPosition(double x, double y, double z) + { + int i = this.vertexFormat.getIntegerSize(); + int j = (this.vertexCount - 4) * i; + + for (int k = 0; k < 4; ++k) + { + int l = j + k * i; + int i1 = l + 1; + int j1 = i1 + 1; + this.rawIntBuffer.put(l, Float.floatToRawIntBits((float)(x + this.xOffset) + Float.intBitsToFloat(this.rawIntBuffer.get(l)))); + this.rawIntBuffer.put(i1, Float.floatToRawIntBits((float)(y + this.yOffset) + Float.intBitsToFloat(this.rawIntBuffer.get(i1)))); + this.rawIntBuffer.put(j1, Float.floatToRawIntBits((float)(z + this.zOffset) + Float.intBitsToFloat(this.rawIntBuffer.get(j1)))); + } + } + + public int getColorIndex(int p_78909_1_) + { + return ((this.vertexCount - p_78909_1_) * this.vertexFormat.getNextOffset() + this.vertexFormat.getColorOffset()) / 4; + } + + public void putColorMultiplier(float red, float green, float blue, int p_178978_4_) + { + int i = this.getColorIndex(p_178978_4_); + int j = -1; + + if (!this.noColor) + { + j = this.rawIntBuffer.get(i); + + if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) + { + int k = (int)((float)(j & 255) * red); + int l = (int)((float)(j >> 8 & 255) * green); + int i1 = (int)((float)(j >> 16 & 255) * blue); + j = j & -16777216; + j = j | i1 << 16 | l << 8 | k; + } + else + { + int j1 = (int)((float)(j >> 24 & 255) * red); + int k1 = (int)((float)(j >> 16 & 255) * green); + int l1 = (int)((float)(j >> 8 & 255) * blue); + j = j & 255; + j = j | j1 << 24 | k1 << 16 | l1 << 8; + } + } + + this.rawIntBuffer.put(i, j); + } + + private void putColor(int argb, int p_178988_2_) + { + int i = this.getColorIndex(p_178988_2_); + int j = argb >> 16 & 255; + int k = argb >> 8 & 255; + int l = argb & 255; + int i1 = argb >> 24 & 255; + this.putColorRGBA(i, j, k, l, i1); + } + + public void putColorRGB_F(float red, float green, float blue, int p_178994_4_) + { + int i = this.getColorIndex(p_178994_4_); + int j = MathHelper.clamp_int((int)(red * 255.0F), 0, 255); + int k = MathHelper.clamp_int((int)(green * 255.0F), 0, 255); + int l = MathHelper.clamp_int((int)(blue * 255.0F), 0, 255); + this.putColorRGBA(i, j, k, l, 255); + } + + public void putColorRGBA(int index, int red, int p_178972_3_, int p_178972_4_, int p_178972_5_) + { + if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) + { + this.rawIntBuffer.put(index, p_178972_5_ << 24 | p_178972_4_ << 16 | p_178972_3_ << 8 | red); + } + else + { + this.rawIntBuffer.put(index, red << 24 | p_178972_3_ << 16 | p_178972_4_ << 8 | p_178972_5_); + } + } + + public void noColor() + { + this.noColor = true; + } + + public WorldRenderer color(float red, float green, float blue, float alpha) + { + return this.color((int)(red * 255.0F), (int)(green * 255.0F), (int)(blue * 255.0F), (int)(alpha * 255.0F)); + } + + public WorldRenderer color(int red, int green, int blue, int alpha) + { + if (this.noColor) + { + return this; + } + else + { + int i = this.vertexCount * this.vertexFormat.getNextOffset() + this.vertexFormat.getOffset(this.vertexFormatIndex); + + switch (this.vertexFormatElement.getType()) + { + case FLOAT: + this.byteBuffer.putFloat(i, (float)red / 255.0F); + this.byteBuffer.putFloat(i + 4, (float)green / 255.0F); + this.byteBuffer.putFloat(i + 8, (float)blue / 255.0F); + this.byteBuffer.putFloat(i + 12, (float)alpha / 255.0F); + break; + + case UINT: + case INT: + this.byteBuffer.putFloat(i, (float)red); + this.byteBuffer.putFloat(i + 4, (float)green); + this.byteBuffer.putFloat(i + 8, (float)blue); + this.byteBuffer.putFloat(i + 12, (float)alpha); + break; + + case USHORT: + case SHORT: + this.byteBuffer.putShort(i, (short)red); + this.byteBuffer.putShort(i + 2, (short)green); + this.byteBuffer.putShort(i + 4, (short)blue); + this.byteBuffer.putShort(i + 6, (short)alpha); + break; + + case UBYTE: + case BYTE: + if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) + { + this.byteBuffer.put(i, (byte)red); + this.byteBuffer.put(i + 1, (byte)green); + this.byteBuffer.put(i + 2, (byte)blue); + this.byteBuffer.put(i + 3, (byte)alpha); + } + else + { + this.byteBuffer.put(i, (byte)alpha); + this.byteBuffer.put(i + 1, (byte)blue); + this.byteBuffer.put(i + 2, (byte)green); + this.byteBuffer.put(i + 3, (byte)red); + } + } + + this.nextVertexFormatIndex(); + return this; + } + } + + public void addVertexData(int[] vertexData) + { + if (Config.isShaders()) + { + SVertexBuilder.beginAddVertexData(this, vertexData); + } + + this.growBuffer(vertexData.length); + this.rawIntBuffer.position(this.getBufferSize()); + this.rawIntBuffer.put(vertexData); + this.vertexCount += vertexData.length / this.vertexFormat.getIntegerSize(); + + if (Config.isShaders()) + { + SVertexBuilder.endAddVertexData(this); + } + } + + public void endVertex() + { + ++this.vertexCount; + this.growBuffer(this.vertexFormat.getIntegerSize()); + this.vertexFormatIndex = 0; + this.vertexFormatElement = this.vertexFormat.getElement(this.vertexFormatIndex); + + if (Config.isShaders()) + { + SVertexBuilder.endAddVertex(this); + } + } + + public WorldRenderer pos(double x, double y, double z) + { + if (Config.isShaders()) + { + SVertexBuilder.beginAddVertex(this); + } + + int i = this.vertexCount * this.vertexFormat.getNextOffset() + this.vertexFormat.getOffset(this.vertexFormatIndex); + + switch (this.vertexFormatElement.getType()) + { + case FLOAT: + this.byteBuffer.putFloat(i, (float)(x + this.xOffset)); + this.byteBuffer.putFloat(i + 4, (float)(y + this.yOffset)); + this.byteBuffer.putFloat(i + 8, (float)(z + this.zOffset)); + break; + + case UINT: + case INT: + this.byteBuffer.putInt(i, Float.floatToRawIntBits((float)(x + this.xOffset))); + this.byteBuffer.putInt(i + 4, Float.floatToRawIntBits((float)(y + this.yOffset))); + this.byteBuffer.putInt(i + 8, Float.floatToRawIntBits((float)(z + this.zOffset))); + break; + + case USHORT: + case SHORT: + this.byteBuffer.putShort(i, (short)((int)(x + this.xOffset))); + this.byteBuffer.putShort(i + 2, (short)((int)(y + this.yOffset))); + this.byteBuffer.putShort(i + 4, (short)((int)(z + this.zOffset))); + break; + + case UBYTE: + case BYTE: + this.byteBuffer.put(i, (byte)((int)(x + this.xOffset))); + this.byteBuffer.put(i + 1, (byte)((int)(y + this.yOffset))); + this.byteBuffer.put(i + 2, (byte)((int)(z + this.zOffset))); + } + + this.nextVertexFormatIndex(); + return this; + } + + public void putNormal(float x, float y, float z) + { + int i = (byte)((int)(x * 127.0F)) & 255; + int j = (byte)((int)(y * 127.0F)) & 255; + int k = (byte)((int)(z * 127.0F)) & 255; + int l = i | j << 8 | k << 16; + int i1 = this.vertexFormat.getNextOffset() >> 2; + int j1 = (this.vertexCount - 4) * i1 + this.vertexFormat.getNormalOffset() / 4; + this.rawIntBuffer.put(j1, l); + this.rawIntBuffer.put(j1 + i1, l); + this.rawIntBuffer.put(j1 + i1 * 2, l); + this.rawIntBuffer.put(j1 + i1 * 3, l); + } + + private void nextVertexFormatIndex() + { + ++this.vertexFormatIndex; + this.vertexFormatIndex %= this.vertexFormat.getElementCount(); + this.vertexFormatElement = this.vertexFormat.getElement(this.vertexFormatIndex); + + if (this.vertexFormatElement.getUsage() == EnumUsage.PADDING) + { + this.nextVertexFormatIndex(); + } + } + + public WorldRenderer normal(float p_181663_1_, float p_181663_2_, float p_181663_3_) + { + int i = this.vertexCount * this.vertexFormat.getNextOffset() + this.vertexFormat.getOffset(this.vertexFormatIndex); + + switch (this.vertexFormatElement.getType()) + { + case FLOAT: + this.byteBuffer.putFloat(i, p_181663_1_); + this.byteBuffer.putFloat(i + 4, p_181663_2_); + this.byteBuffer.putFloat(i + 8, p_181663_3_); + break; + + case UINT: + case INT: + this.byteBuffer.putInt(i, (int)p_181663_1_); + this.byteBuffer.putInt(i + 4, (int)p_181663_2_); + this.byteBuffer.putInt(i + 8, (int)p_181663_3_); + break; + + case USHORT: + case SHORT: + this.byteBuffer.putShort(i, (short)((int)(p_181663_1_ * 32767.0F) & 65535)); + this.byteBuffer.putShort(i + 2, (short)((int)(p_181663_2_ * 32767.0F) & 65535)); + this.byteBuffer.putShort(i + 4, (short)((int)(p_181663_3_ * 32767.0F) & 65535)); + break; + + case UBYTE: + case BYTE: + this.byteBuffer.put(i, (byte)((int)(p_181663_1_ * 127.0F) & 255)); + this.byteBuffer.put(i + 1, (byte)((int)(p_181663_2_ * 127.0F) & 255)); + this.byteBuffer.put(i + 2, (byte)((int)(p_181663_3_ * 127.0F) & 255)); + } + + this.nextVertexFormatIndex(); + return this; + } + + public void setTranslation(double x, double y, double z) + { + this.xOffset = x; + this.yOffset = y; + this.zOffset = z; + } + + public void finishDrawing() + { + if (!this.isDrawing) + { + throw new IllegalStateException("Not building!"); + } + else + { + this.isDrawing = false; + this.byteBuffer.position(0); + this.byteBuffer.limit(this.getBufferSize() * 4); + } + } + + public ByteBuffer getByteBuffer() + { + return this.modeTriangles ? this.byteBufferTriangles : this.byteBuffer; + } + + public VertexFormat getVertexFormat() + { + return this.vertexFormat; + } + + public int getVertexCount() + { + return this.modeTriangles ? this.vertexCount / 4 * 6 : this.vertexCount; + } + + public int getDrawMode() + { + return this.modeTriangles ? 4 : this.drawMode; + } + + public void putColor4(int argb) + { + for (int i = 0; i < 4; ++i) + { + this.putColor(argb, i + 1); + } + } + + public void putColorRGB_F4(float red, float green, float blue) + { + for (int i = 0; i < 4; ++i) + { + this.putColorRGB_F(red, green, blue, i + 1); + } + } + + public void putSprite(TextureAtlasSprite p_putSprite_1_) + { + if (this.animatedSprites != null && p_putSprite_1_ != null && p_putSprite_1_.getAnimationIndex() >= 0) + { + this.animatedSprites.set(p_putSprite_1_.getAnimationIndex()); + } + + if (this.quadSprites != null) + { + int i = this.vertexCount / 4; + this.quadSprites[i - 1] = p_putSprite_1_; + } + } + + public void setSprite(TextureAtlasSprite p_setSprite_1_) + { + if (this.animatedSprites != null && p_setSprite_1_ != null && p_setSprite_1_.getAnimationIndex() >= 0) + { + this.animatedSprites.set(p_setSprite_1_.getAnimationIndex()); + } + + if (this.quadSprites != null) + { + this.quadSprite = p_setSprite_1_; + } + } + + public boolean isMultiTexture() + { + return this.quadSprites != null; + } + + public void drawMultiTexture() + { + if (this.quadSprites != null) + { + int i = Config.getMinecraft().getTextureMapBlocks().getCountRegisteredSprites(); + + if (this.drawnIcons.length <= i) + { + this.drawnIcons = new boolean[i + 1]; + } + + Arrays.fill(this.drawnIcons, false); + int j = 0; + int k = -1; + int l = this.vertexCount / 4; + + for (int i1 = 0; i1 < l; ++i1) + { + TextureAtlasSprite textureatlassprite = this.quadSprites[i1]; + + if (textureatlassprite != null) + { + int j1 = textureatlassprite.getIndexInMap(); + + if (!this.drawnIcons[j1]) + { + if (textureatlassprite == TextureUtils.iconGrassSideOverlay) + { + if (k < 0) + { + k = i1; + } + } + else + { + i1 = this.drawForIcon(textureatlassprite, i1) - 1; + ++j; + + if (this.blockLayer != EnumWorldBlockLayer.TRANSLUCENT) + { + this.drawnIcons[j1] = true; + } + } + } + } + } + + if (k >= 0) + { + this.drawForIcon(TextureUtils.iconGrassSideOverlay, k); + ++j; + } + + if (j > 0) + { + ; + } + } + } + + private int drawForIcon(TextureAtlasSprite p_drawForIcon_1_, int p_drawForIcon_2_) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_drawForIcon_1_.glSpriteTextureId); + int i = -1; + int j = -1; + int k = this.vertexCount / 4; + + for (int l = p_drawForIcon_2_; l < k; ++l) + { + TextureAtlasSprite textureatlassprite = this.quadSprites[l]; + + if (textureatlassprite == p_drawForIcon_1_) + { + if (j < 0) + { + j = l; + } + } + else if (j >= 0) + { + this.draw(j, l); + + if (this.blockLayer == EnumWorldBlockLayer.TRANSLUCENT) + { + return l; + } + + j = -1; + + if (i < 0) + { + i = l; + } + } + } + + if (j >= 0) + { + this.draw(j, k); + } + + if (i < 0) + { + i = k; + } + + return i; + } + + private void draw(int p_draw_1_, int p_draw_2_) + { + int i = p_draw_2_ - p_draw_1_; + + if (i > 0) + { + int j = p_draw_1_ * 4; + int k = i * 4; + GL11.glDrawArrays(this.drawMode, j, k); + } + } + + public void setBlockLayer(EnumWorldBlockLayer p_setBlockLayer_1_) + { + this.blockLayer = p_setBlockLayer_1_; + + if (p_setBlockLayer_1_ == null) + { + if (this.quadSprites != null) + { + this.quadSpritesPrev = this.quadSprites; + } + + this.quadSprites = null; + this.quadSprite = null; + } + } + + private int getBufferQuadSize() + { + int i = this.rawIntBuffer.capacity() * 4 / (this.vertexFormat.getIntegerSize() * 4); + return i; + } + + public RenderEnv getRenderEnv(IBlockState p_getRenderEnv_1_, BlockPos p_getRenderEnv_2_) + { + if (this.renderEnv == null) + { + this.renderEnv = new RenderEnv(p_getRenderEnv_1_, p_getRenderEnv_2_); + return this.renderEnv; + } + else + { + this.renderEnv.reset(p_getRenderEnv_1_, p_getRenderEnv_2_); + return this.renderEnv; + } + } + + public boolean isDrawing() + { + return this.isDrawing; + } + + public double getXOffset() + { + return this.xOffset; + } + + public double getYOffset() + { + return this.yOffset; + } + + public double getZOffset() + { + return this.zOffset; + } + + public EnumWorldBlockLayer getBlockLayer() + { + return this.blockLayer; + } + + public void putColorMultiplierRgba(float p_putColorMultiplierRgba_1_, float p_putColorMultiplierRgba_2_, float p_putColorMultiplierRgba_3_, float p_putColorMultiplierRgba_4_, int p_putColorMultiplierRgba_5_) + { + int i = this.getColorIndex(p_putColorMultiplierRgba_5_); + int j = -1; + + if (!this.noColor) + { + j = this.rawIntBuffer.get(i); + + if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) + { + int k = (int)((float)(j & 255) * p_putColorMultiplierRgba_1_); + int l = (int)((float)(j >> 8 & 255) * p_putColorMultiplierRgba_2_); + int i1 = (int)((float)(j >> 16 & 255) * p_putColorMultiplierRgba_3_); + int j1 = (int)((float)(j >> 24 & 255) * p_putColorMultiplierRgba_4_); + j = j1 << 24 | i1 << 16 | l << 8 | k; + } + else + { + int k1 = (int)((float)(j >> 24 & 255) * p_putColorMultiplierRgba_1_); + int l1 = (int)((float)(j >> 16 & 255) * p_putColorMultiplierRgba_2_); + int i2 = (int)((float)(j >> 8 & 255) * p_putColorMultiplierRgba_3_); + int j2 = (int)((float)(j & 255) * p_putColorMultiplierRgba_4_); + j = k1 << 24 | l1 << 16 | i2 << 8 | j2; + } + } + + this.rawIntBuffer.put(i, j); + } + + public void quadsToTriangles() + { + if (this.drawMode == 7) + { + if (this.byteBufferTriangles == null) + { + this.byteBufferTriangles = GLAllocation.createDirectByteBuffer(this.byteBuffer.capacity() * 2); + } + + if (this.byteBufferTriangles.capacity() < this.byteBuffer.capacity() * 2) + { + this.byteBufferTriangles = GLAllocation.createDirectByteBuffer(this.byteBuffer.capacity() * 2); + } + + int i = this.vertexFormat.getNextOffset(); + int j = this.byteBuffer.limit(); + this.byteBuffer.rewind(); + this.byteBufferTriangles.clear(); + + for (int k = 0; k < this.vertexCount; k += 4) + { + this.byteBuffer.limit((k + 3) * i); + this.byteBuffer.position(k * i); + this.byteBufferTriangles.put(this.byteBuffer); + this.byteBuffer.limit((k + 1) * i); + this.byteBuffer.position(k * i); + this.byteBufferTriangles.put(this.byteBuffer); + this.byteBuffer.limit((k + 2 + 2) * i); + this.byteBuffer.position((k + 2) * i); + this.byteBufferTriangles.put(this.byteBuffer); + } + + this.byteBuffer.limit(j); + this.byteBuffer.rewind(); + this.byteBufferTriangles.flip(); + this.modeTriangles = true; + } + } + + public boolean isColorDisabled() + { + return this.noColor; + } + + public class State + { + private final int[] stateRawBuffer; + private final VertexFormat stateVertexFormat; + private TextureAtlasSprite[] stateQuadSprites; + + public State(int[] p_i1_2_, VertexFormat p_i1_3_, TextureAtlasSprite[] p_i1_4_) + { + this.stateRawBuffer = p_i1_2_; + this.stateVertexFormat = p_i1_3_; + this.stateQuadSprites = p_i1_4_; + } + + public State(int[] buffer, VertexFormat format) + { + this.stateRawBuffer = buffer; + this.stateVertexFormat = format; + } + + public int[] getRawBuffer() + { + return this.stateRawBuffer; + } + + public int getVertexCount() + { + return this.stateRawBuffer.length / this.stateVertexFormat.getIntegerSize(); + } + + public VertexFormat getVertexFormat() + { + return this.stateVertexFormat; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldVertexBufferUploader.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldVertexBufferUploader.java new file mode 100644 index 0000000..c19f718 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldVertexBufferUploader.java @@ -0,0 +1,127 @@ +package net.minecraft.client.renderer; + +import java.nio.ByteBuffer; +import java.util.List; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.SVertexBuilder; +import org.lwjgl.opengl.GL11; + +public class WorldVertexBufferUploader +{ + @SuppressWarnings("incomplete-switch") + public void draw(WorldRenderer p_181679_1_) + { + if (p_181679_1_.getVertexCount() > 0) + { + if (p_181679_1_.getDrawMode() == 7 && Config.isQuadsToTriangles()) + { + p_181679_1_.quadsToTriangles(); + } + + VertexFormat vertexformat = p_181679_1_.getVertexFormat(); + int i = vertexformat.getNextOffset(); + ByteBuffer bytebuffer = p_181679_1_.getByteBuffer(); + List list = vertexformat.getElements(); + boolean flag = Reflector.ForgeVertexFormatElementEnumUseage_preDraw.exists(); + boolean flag1 = Reflector.ForgeVertexFormatElementEnumUseage_postDraw.exists(); + + for (int j = 0; j < list.size(); ++j) + { + VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j); + EnumUsage enumusage = vertexformatelement.getUsage(); + + if (flag) + { + Reflector.callVoid(enumusage, Reflector.ForgeVertexFormatElementEnumUseage_preDraw, new Object[] {vertexformat, Integer.valueOf(j), Integer.valueOf(i), bytebuffer}); + } + else + { + int k = vertexformatelement.getType().getGlConstant(); + int l = vertexformatelement.getIndex(); + bytebuffer.position(vertexformat.getOffset(j)); + + switch (enumusage) + { + case POSITION: + GL11.glVertexPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + break; + + case UV: + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + l); + GL11.glTexCoordPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + break; + + case COLOR: + GL11.glColorPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); + GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + break; + + case NORMAL: + GL11.glNormalPointer(k, i, bytebuffer); + GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + } + } + } + + if (p_181679_1_.isMultiTexture()) + { + p_181679_1_.drawMultiTexture(); + } + else if (Config.isShaders()) + { + SVertexBuilder.drawArrays(p_181679_1_.getDrawMode(), 0, p_181679_1_.getVertexCount(), p_181679_1_); + } + else + { + GL11.glDrawArrays(p_181679_1_.getDrawMode(), 0, p_181679_1_.getVertexCount()); + } + + int j1 = 0; + + for (int k1 = list.size(); j1 < k1; ++j1) + { + VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(j1); + EnumUsage enumusage1 = vertexformatelement1.getUsage(); + + if (flag1) + { + Reflector.callVoid(enumusage1, Reflector.ForgeVertexFormatElementEnumUseage_postDraw, new Object[] {vertexformat, Integer.valueOf(j1), Integer.valueOf(i), bytebuffer}); + } + else + { + int i1 = vertexformatelement1.getIndex(); + + switch (enumusage1) + { + case POSITION: + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + break; + + case UV: + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + i1); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + break; + + case COLOR: + GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + GlStateManager.resetColor(); + break; + + case NORMAL: + GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + } + } + } + } + + p_181679_1_.reset(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldVertexBu~ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldVertexBu~ new file mode 100644 index 0000000..6c92c33 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/WorldVertexBu~ @@ -0,0 +1,100 @@ +package net.minecraft.client.renderer; + +import java.nio.ByteBuffer; +import java.util.List; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.SVertexBuilder; +import org.lwjgl.opengl.GL11; + +public class WorldVertexBufferUploader { + public void func_181679_a(WorldRenderer p_181679_1_) { + if(p_181679_1_.func_178989_h() > 0) { + if(p_181679_1_.func_178979_i() == 7 && Config.isQuadsToTriangles()) { + p_181679_1_.quadsToTriangles(); + } + + VertexFormat vertexformat = p_181679_1_.func_178973_g(); + int i = vertexformat.func_177338_f(); + ByteBuffer bytebuffer = p_181679_1_.func_178966_f(); + List list = vertexformat.func_177343_g(); + boolean flag = Reflector.ForgeVertexFormatElementEnumUseage_preDraw.exists(); + boolean flag1 = Reflector.ForgeVertexFormatElementEnumUseage_postDraw.exists(); + + for(int j = 0; j < list.size(); ++j) { + VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j); + EnumUsage enumusage = vertexformatelement.func_177375_c(); + if(flag) { + Reflector.callVoid(enumusage, Reflector.ForgeVertexFormatElementEnumUseage_preDraw, new Object[]{vertexformat, Integer.valueOf(j), Integer.valueOf(i), bytebuffer}); + } else { + int k = vertexformatelement.func_177367_b().func_177397_c(); + int l = vertexformatelement.func_177369_e(); + bytebuffer.position(vertexformat.func_181720_d(j)); + switch(enumusage) { + case POSITION: + GL11.glVertexPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); + GL11.glEnableClientState('\u8074'); + break; + case UV: + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l); + GL11.glTexCoordPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); + GL11.glEnableClientState('\u8078'); + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); + break; + case COLOR: + GL11.glColorPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); + GL11.glEnableClientState('\u8076'); + break; + case NORMAL: + GL11.glNormalPointer(k, i, bytebuffer); + GL11.glEnableClientState('\u8075'); + } + } + } + + if(p_181679_1_.isMultiTexture()) { + p_181679_1_.drawMultiTexture(); + } else if(Config.isShaders()) { + SVertexBuilder.drawArrays(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h(), p_181679_1_); + } else { + GL11.glDrawArrays(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h()); + } + + int j1 = 0; + + for(int k1 = list.size(); j1 < k1; ++j1) { + VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(j1); + EnumUsage enumusage1 = vertexformatelement1.func_177375_c(); + if(flag1) { + Reflector.callVoid(enumusage1, Reflector.ForgeVertexFormatElementEnumUseage_postDraw, new Object[]{vertexformat, Integer.valueOf(j1), Integer.valueOf(i), bytebuffer}); + } else { + int i1 = vertexformatelement1.func_177369_e(); + switch(enumusage1) { + case POSITION: + GL11.glDisableClientState('\u8074'); + break; + case UV: + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + i1); + GL11.glDisableClientState('\u8078'); + OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); + break; + case COLOR: + GL11.glDisableClientState('\u8076'); + GlStateManager.func_179117_G(); + break; + case NORMAL: + GL11.glDisableClientState('\u8075'); + } + } + } + } + + p_181679_1_.func_178965_a(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BakedQuad.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BakedQuad.java new file mode 100644 index 0000000..b0f1e1e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BakedQuad.java @@ -0,0 +1,245 @@ +package net.minecraft.client.renderer.block.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.src.Config; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.client.model.pipeline.IVertexConsumer; +import net.minecraftforge.client.model.pipeline.IVertexProducer; +import net.optifine.model.QuadBounds; +import net.optifine.reflect.Reflector; + +public class BakedQuad implements IVertexProducer +{ + protected int[] vertexData; + protected final int tintIndex; + protected EnumFacing face; + protected TextureAtlasSprite sprite; + private int[] vertexDataSingle = null; + private QuadBounds quadBounds; + private boolean quadEmissiveChecked; + private BakedQuad quadEmissive; + + public BakedQuad(int[] p_i3_1_, int p_i3_2_, EnumFacing p_i3_3_, TextureAtlasSprite p_i3_4_) + { + this.vertexData = p_i3_1_; + this.tintIndex = p_i3_2_; + this.face = p_i3_3_; + this.sprite = p_i3_4_; + this.fixVertexData(); + } + + public BakedQuad(int[] vertexDataIn, int tintIndexIn, EnumFacing faceIn) + { + this.vertexData = vertexDataIn; + this.tintIndex = tintIndexIn; + this.face = faceIn; + this.fixVertexData(); + } + + public TextureAtlasSprite getSprite() + { + if (this.sprite == null) + { + this.sprite = getSpriteByUv(this.getVertexData()); + } + + return this.sprite; + } + + public int[] getVertexData() + { + this.fixVertexData(); + return this.vertexData; + } + + public boolean hasTintIndex() + { + return this.tintIndex != -1; + } + + public int getTintIndex() + { + return this.tintIndex; + } + + public EnumFacing getFace() + { + if (this.face == null) + { + this.face = FaceBakery.getFacingFromVertexData(this.getVertexData()); + } + + return this.face; + } + + public int[] getVertexDataSingle() + { + if (this.vertexDataSingle == null) + { + this.vertexDataSingle = makeVertexDataSingle(this.getVertexData(), this.getSprite()); + } + + return this.vertexDataSingle; + } + + private static int[] makeVertexDataSingle(int[] p_makeVertexDataSingle_0_, TextureAtlasSprite p_makeVertexDataSingle_1_) + { + int[] aint = (int[])p_makeVertexDataSingle_0_.clone(); + int i = aint.length / 4; + + for (int j = 0; j < 4; ++j) + { + int k = j * i; + float f = Float.intBitsToFloat(aint[k + 4]); + float f1 = Float.intBitsToFloat(aint[k + 4 + 1]); + float f2 = p_makeVertexDataSingle_1_.toSingleU(f); + float f3 = p_makeVertexDataSingle_1_.toSingleV(f1); + aint[k + 4] = Float.floatToRawIntBits(f2); + aint[k + 4 + 1] = Float.floatToRawIntBits(f3); + } + + return aint; + } + + public void pipe(IVertexConsumer p_pipe_1_) + { + Reflector.callVoid(Reflector.LightUtil_putBakedQuad, new Object[] {p_pipe_1_, this}); + } + + private static TextureAtlasSprite getSpriteByUv(int[] p_getSpriteByUv_0_) + { + float f = 1.0F; + float f1 = 1.0F; + float f2 = 0.0F; + float f3 = 0.0F; + int i = p_getSpriteByUv_0_.length / 4; + + for (int j = 0; j < 4; ++j) + { + int k = j * i; + float f4 = Float.intBitsToFloat(p_getSpriteByUv_0_[k + 4]); + float f5 = Float.intBitsToFloat(p_getSpriteByUv_0_[k + 4 + 1]); + f = Math.min(f, f4); + f1 = Math.min(f1, f5); + f2 = Math.max(f2, f4); + f3 = Math.max(f3, f5); + } + + float f6 = (f + f2) / 2.0F; + float f7 = (f1 + f3) / 2.0F; + TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getTextureMapBlocks().getIconByUV((double)f6, (double)f7); + return textureatlassprite; + } + + protected void fixVertexData() + { + if (Config.isShaders()) + { + if (this.vertexData.length == 28) + { + this.vertexData = expandVertexData(this.vertexData); + } + } + else if (this.vertexData.length == 56) + { + this.vertexData = compactVertexData(this.vertexData); + } + } + + private static int[] expandVertexData(int[] p_expandVertexData_0_) + { + int i = p_expandVertexData_0_.length / 4; + int j = i * 2; + int[] aint = new int[j * 4]; + + for (int k = 0; k < 4; ++k) + { + System.arraycopy(p_expandVertexData_0_, k * i, aint, k * j, i); + } + + return aint; + } + + private static int[] compactVertexData(int[] p_compactVertexData_0_) + { + int i = p_compactVertexData_0_.length / 4; + int j = i / 2; + int[] aint = new int[j * 4]; + + for (int k = 0; k < 4; ++k) + { + System.arraycopy(p_compactVertexData_0_, k * i, aint, k * j, j); + } + + return aint; + } + + public QuadBounds getQuadBounds() + { + if (this.quadBounds == null) + { + this.quadBounds = new QuadBounds(this.getVertexData()); + } + + return this.quadBounds; + } + + public float getMidX() + { + QuadBounds quadbounds = this.getQuadBounds(); + return (quadbounds.getMaxX() + quadbounds.getMinX()) / 2.0F; + } + + public double getMidY() + { + QuadBounds quadbounds = this.getQuadBounds(); + return (double)((quadbounds.getMaxY() + quadbounds.getMinY()) / 2.0F); + } + + public double getMidZ() + { + QuadBounds quadbounds = this.getQuadBounds(); + return (double)((quadbounds.getMaxZ() + quadbounds.getMinZ()) / 2.0F); + } + + public boolean isFaceQuad() + { + QuadBounds quadbounds = this.getQuadBounds(); + return quadbounds.isFaceQuad(this.face); + } + + public boolean isFullQuad() + { + QuadBounds quadbounds = this.getQuadBounds(); + return quadbounds.isFullQuad(this.face); + } + + public boolean isFullFaceQuad() + { + return this.isFullQuad() && this.isFaceQuad(); + } + + public BakedQuad getQuadEmissive() + { + if (this.quadEmissiveChecked) + { + return this.quadEmissive; + } + else + { + if (this.quadEmissive == null && this.sprite != null && this.sprite.spriteEmissive != null) + { + this.quadEmissive = new BreakingFour(this, this.sprite.spriteEmissive); + } + + this.quadEmissiveChecked = true; + return this.quadEmissive; + } + } + + public String toString() + { + return "vertex: " + this.vertexData.length / 7 + ", tint: " + this.tintIndex + ", facing: " + this.face + ", sprite: " + this.sprite; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockFaceUV.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockFaceUV.java new file mode 100644 index 0000000..be192e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockFaceUV.java @@ -0,0 +1,119 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; + +public class BlockFaceUV +{ + public float[] uvs; + public final int rotation; + + public BlockFaceUV(float[] uvsIn, int rotationIn) + { + this.uvs = uvsIn; + this.rotation = rotationIn; + } + + public float func_178348_a(int p_178348_1_) + { + if (this.uvs == null) + { + throw new NullPointerException("uvs"); + } + else + { + int i = this.func_178347_d(p_178348_1_); + return i != 0 && i != 1 ? this.uvs[2] : this.uvs[0]; + } + } + + public float func_178346_b(int p_178346_1_) + { + if (this.uvs == null) + { + throw new NullPointerException("uvs"); + } + else + { + int i = this.func_178347_d(p_178346_1_); + return i != 0 && i != 3 ? this.uvs[3] : this.uvs[1]; + } + } + + private int func_178347_d(int p_178347_1_) + { + return (p_178347_1_ + this.rotation / 90) % 4; + } + + public int func_178345_c(int p_178345_1_) + { + return (p_178345_1_ + (4 - this.rotation / 90)) % 4; + } + + public void setUvs(float[] uvsIn) + { + if (this.uvs == null) + { + this.uvs = uvsIn; + } + } + + static class Deserializer implements JsonDeserializer + { + public BlockFaceUV deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + float[] afloat = this.parseUV(jsonobject); + int i = this.parseRotation(jsonobject); + return new BlockFaceUV(afloat, i); + } + + protected int parseRotation(JsonObject p_178291_1_) + { + int i = JsonUtils.getInt(p_178291_1_, "rotation", 0); + + if (i >= 0 && i % 90 == 0 && i / 90 <= 3) + { + return i; + } + else + { + throw new JsonParseException("Invalid rotation " + i + " found, only 0/90/180/270 allowed"); + } + } + + private float[] parseUV(JsonObject p_178292_1_) + { + if (!p_178292_1_.has("uv")) + { + return null; + } + else + { + JsonArray jsonarray = JsonUtils.getJsonArray(p_178292_1_, "uv"); + + if (jsonarray.size() != 4) + { + throw new JsonParseException("Expected 4 uv values, found: " + jsonarray.size()); + } + else + { + float[] afloat = new float[4]; + + for (int i = 0; i < afloat.length; ++i) + { + afloat[i] = JsonUtils.getFloat(jsonarray.get(i), "uv[" + i + "]"); + } + + return afloat; + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPart.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPart.java new file mode 100644 index 0000000..23c2eb3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPart.java @@ -0,0 +1,229 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.common.collect.Maps; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.MathHelper; +import org.lwjgl.util.vector.Vector3f; + +public class BlockPart +{ + public final Vector3f positionFrom; + public final Vector3f positionTo; + public final Map mapFaces; + public final BlockPartRotation partRotation; + public final boolean shade; + + public BlockPart(Vector3f positionFromIn, Vector3f positionToIn, Map mapFacesIn, BlockPartRotation partRotationIn, boolean shadeIn) + { + this.positionFrom = positionFromIn; + this.positionTo = positionToIn; + this.mapFaces = mapFacesIn; + this.partRotation = partRotationIn; + this.shade = shadeIn; + this.setDefaultUvs(); + } + + private void setDefaultUvs() + { + for (Entry entry : this.mapFaces.entrySet()) + { + float[] afloat = this.getFaceUvs((EnumFacing)entry.getKey()); + ((BlockPartFace)entry.getValue()).blockFaceUV.setUvs(afloat); + } + } + + private float[] getFaceUvs(EnumFacing p_178236_1_) + { + float[] afloat; + + switch (p_178236_1_) + { + case DOWN: + case UP: + afloat = new float[] {this.positionFrom.x, this.positionFrom.z, this.positionTo.x, this.positionTo.z}; + break; + case NORTH: + case SOUTH: + afloat = new float[] {this.positionFrom.x, 16.0F - this.positionTo.y, this.positionTo.x, 16.0F - this.positionFrom.y}; + break; + case WEST: + case EAST: + afloat = new float[] {this.positionFrom.z, 16.0F - this.positionTo.y, this.positionTo.z, 16.0F - this.positionFrom.y}; + break; + default: + throw new NullPointerException(); + } + + return afloat; + } + + static class Deserializer implements JsonDeserializer + { + public BlockPart deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + Vector3f vector3f = this.parsePositionFrom(jsonobject); + Vector3f vector3f1 = this.parsePositionTo(jsonobject); + BlockPartRotation blockpartrotation = this.parseRotation(jsonobject); + Map map = this.parseFacesCheck(p_deserialize_3_, jsonobject); + + if (jsonobject.has("shade") && !JsonUtils.isBoolean(jsonobject, "shade")) + { + throw new JsonParseException("Expected shade to be a Boolean"); + } + else + { + boolean flag = JsonUtils.getBoolean(jsonobject, "shade", true); + return new BlockPart(vector3f, vector3f1, map, blockpartrotation, flag); + } + } + + private BlockPartRotation parseRotation(JsonObject p_178256_1_) + { + BlockPartRotation blockpartrotation = null; + + if (p_178256_1_.has("rotation")) + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_178256_1_, "rotation"); + Vector3f vector3f = this.parsePosition(jsonobject, "origin"); + vector3f.scale(0.0625F); + EnumFacing.Axis enumfacing$axis = this.parseAxis(jsonobject); + float f = this.parseAngle(jsonobject); + boolean flag = JsonUtils.getBoolean(jsonobject, "rescale", false); + blockpartrotation = new BlockPartRotation(vector3f, enumfacing$axis, f, flag); + } + + return blockpartrotation; + } + + private float parseAngle(JsonObject p_178255_1_) + { + float f = JsonUtils.getFloat(p_178255_1_, "angle"); + + if (f != 0.0F && MathHelper.abs(f) != 22.5F && MathHelper.abs(f) != 45.0F) + { + throw new JsonParseException("Invalid rotation " + f + " found, only -45/-22.5/0/22.5/45 allowed"); + } + else + { + return f; + } + } + + private EnumFacing.Axis parseAxis(JsonObject p_178252_1_) + { + String s = JsonUtils.getString(p_178252_1_, "axis"); + EnumFacing.Axis enumfacing$axis = EnumFacing.Axis.byName(s.toLowerCase()); + + if (enumfacing$axis == null) + { + throw new JsonParseException("Invalid rotation axis: " + s); + } + else + { + return enumfacing$axis; + } + } + + private Map parseFacesCheck(JsonDeserializationContext p_178250_1_, JsonObject p_178250_2_) + { + Map map = this.parseFaces(p_178250_1_, p_178250_2_); + + if (map.isEmpty()) + { + throw new JsonParseException("Expected between 1 and 6 unique faces, got 0"); + } + else + { + return map; + } + } + + private Map parseFaces(JsonDeserializationContext p_178253_1_, JsonObject p_178253_2_) + { + Map map = Maps.newEnumMap(EnumFacing.class); + JsonObject jsonobject = JsonUtils.getJsonObject(p_178253_2_, "faces"); + + for (Entry entry : jsonobject.entrySet()) + { + EnumFacing enumfacing = this.parseEnumFacing((String)entry.getKey()); + map.put(enumfacing, (BlockPartFace)p_178253_1_.deserialize((JsonElement)entry.getValue(), BlockPartFace.class)); + } + + return map; + } + + private EnumFacing parseEnumFacing(String name) + { + EnumFacing enumfacing = EnumFacing.byName(name); + + if (enumfacing == null) + { + throw new JsonParseException("Unknown facing: " + name); + } + else + { + return enumfacing; + } + } + + private Vector3f parsePositionTo(JsonObject p_178247_1_) + { + Vector3f vector3f = this.parsePosition(p_178247_1_, "to"); + + if (vector3f.x >= -16.0F && vector3f.y >= -16.0F && vector3f.z >= -16.0F && vector3f.x <= 32.0F && vector3f.y <= 32.0F && vector3f.z <= 32.0F) + { + return vector3f; + } + else + { + throw new JsonParseException("\'to\' specifier exceeds the allowed boundaries: " + vector3f); + } + } + + private Vector3f parsePositionFrom(JsonObject p_178249_1_) + { + Vector3f vector3f = this.parsePosition(p_178249_1_, "from"); + + if (vector3f.x >= -16.0F && vector3f.y >= -16.0F && vector3f.z >= -16.0F && vector3f.x <= 32.0F && vector3f.y <= 32.0F && vector3f.z <= 32.0F) + { + return vector3f; + } + else + { + throw new JsonParseException("\'from\' specifier exceeds the allowed boundaries: " + vector3f); + } + } + + private Vector3f parsePosition(JsonObject p_178251_1_, String p_178251_2_) + { + JsonArray jsonarray = JsonUtils.getJsonArray(p_178251_1_, p_178251_2_); + + if (jsonarray.size() != 3) + { + throw new JsonParseException("Expected 3 " + p_178251_2_ + " values, found: " + jsonarray.size()); + } + else + { + float[] afloat = new float[3]; + + for (int i = 0; i < afloat.length; ++i) + { + afloat[i] = JsonUtils.getFloat(jsonarray.get(i), p_178251_2_ + "[" + i + "]"); + } + + return new Vector3f(afloat[0], afloat[1], afloat[2]); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPartFace.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPartFace.java new file mode 100644 index 0000000..c2ea72a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPartFace.java @@ -0,0 +1,56 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.JsonUtils; + +public class BlockPartFace +{ + public static final EnumFacing FACING_DEFAULT = null; + public final EnumFacing cullFace; + public final int tintIndex; + public final String texture; + public final BlockFaceUV blockFaceUV; + + public BlockPartFace(EnumFacing cullFaceIn, int tintIndexIn, String textureIn, BlockFaceUV blockFaceUVIn) + { + this.cullFace = cullFaceIn; + this.tintIndex = tintIndexIn; + this.texture = textureIn; + this.blockFaceUV = blockFaceUVIn; + } + + static class Deserializer implements JsonDeserializer + { + public BlockPartFace deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + EnumFacing enumfacing = this.parseCullFace(jsonobject); + int i = this.parseTintIndex(jsonobject); + String s = this.parseTexture(jsonobject); + BlockFaceUV blockfaceuv = (BlockFaceUV)p_deserialize_3_.deserialize(jsonobject, BlockFaceUV.class); + return new BlockPartFace(enumfacing, i, s, blockfaceuv); + } + + protected int parseTintIndex(JsonObject p_178337_1_) + { + return JsonUtils.getInt(p_178337_1_, "tintindex", -1); + } + + private String parseTexture(JsonObject p_178340_1_) + { + return JsonUtils.getString(p_178340_1_, "texture"); + } + + private EnumFacing parseCullFace(JsonObject p_178339_1_) + { + String s = JsonUtils.getString(p_178339_1_, "cullface", ""); + return EnumFacing.byName(s); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPartRotation.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPartRotation.java new file mode 100644 index 0000000..37281c0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BlockPartRotation.java @@ -0,0 +1,20 @@ +package net.minecraft.client.renderer.block.model; + +import net.minecraft.util.EnumFacing; +import org.lwjgl.util.vector.Vector3f; + +public class BlockPartRotation +{ + public final Vector3f origin; + public final EnumFacing.Axis axis; + public final float angle; + public final boolean rescale; + + public BlockPartRotation(Vector3f originIn, EnumFacing.Axis axisIn, float angleIn, boolean rescaleIn) + { + this.origin = originIn; + this.axis = axisIn; + this.angle = angleIn; + this.rescale = rescaleIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BreakingFour.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BreakingFour.java new file mode 100644 index 0000000..02a5582 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/BreakingFour.java @@ -0,0 +1,71 @@ +package net.minecraft.client.renderer.block.model; + +import java.util.Arrays; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; + +public class BreakingFour extends BakedQuad +{ + private final TextureAtlasSprite texture; + + public BreakingFour(BakedQuad quad, TextureAtlasSprite textureIn) + { + super(Arrays.copyOf(quad.getVertexData(), quad.getVertexData().length), quad.tintIndex, FaceBakery.getFacingFromVertexData(quad.getVertexData())); + this.texture = textureIn; + this.remapQuad(); + this.fixVertexData(); + } + + private void remapQuad() + { + for (int i = 0; i < 4; ++i) + { + this.remapVert(i); + } + } + + private void remapVert(int vertex) + { + int i = this.vertexData.length / 4; + int j = i * vertex; + float f = Float.intBitsToFloat(this.vertexData[j]); + float f1 = Float.intBitsToFloat(this.vertexData[j + 1]); + float f2 = Float.intBitsToFloat(this.vertexData[j + 2]); + float f3 = 0.0F; + float f4 = 0.0F; + + switch (this.face) + { + case DOWN: + f3 = f * 16.0F; + f4 = (1.0F - f2) * 16.0F; + break; + + case UP: + f3 = f * 16.0F; + f4 = f2 * 16.0F; + break; + + case NORTH: + f3 = (1.0F - f) * 16.0F; + f4 = (1.0F - f1) * 16.0F; + break; + + case SOUTH: + f3 = f * 16.0F; + f4 = (1.0F - f1) * 16.0F; + break; + + case WEST: + f3 = f2 * 16.0F; + f4 = (1.0F - f1) * 16.0F; + break; + + case EAST: + f3 = (1.0F - f2) * 16.0F; + f4 = (1.0F - f1) * 16.0F; + } + + this.vertexData[j + 4] = Float.floatToRawIntBits(this.texture.getInterpolatedU((double)f3)); + this.vertexData[j + 4 + 1] = Float.floatToRawIntBits(this.texture.getInterpolatedV((double)f4)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/FaceBakery.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/FaceBakery.java new file mode 100644 index 0000000..8a200a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/FaceBakery.java @@ -0,0 +1,435 @@ +package net.minecraft.client.renderer.block.model; + +import net.minecraftforge.client.model.ITransformation; +import net.optifine.model.BlockModelUtils; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; +import org.lwjgl.util.vector.Matrix4f; +import org.lwjgl.util.vector.Vector3f; +import org.lwjgl.util.vector.Vector4f; + +import net.minecraft.client.renderer.EnumFaceDirection; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.model.ModelRotation; +import net.minecraft.src.Config; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3i; + +public class FaceBakery +{ + private static final float SCALE_ROTATION_22_5 = 1.0F / (float)Math.cos(0.39269909262657166D) - 1.0F; + private static final float SCALE_ROTATION_GENERAL = 1.0F / (float)Math.cos((Math.PI / 4D)) - 1.0F; + + public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) + { + return this.makeBakedQuad(posFrom, posTo, face, sprite, facing, (ITransformation)modelRotationIn, partRotation, uvLocked, shade); + } + + public BakedQuad makeBakedQuad(Vector3f p_makeBakedQuad_1_, Vector3f p_makeBakedQuad_2_, BlockPartFace p_makeBakedQuad_3_, TextureAtlasSprite p_makeBakedQuad_4_, EnumFacing p_makeBakedQuad_5_, ITransformation p_makeBakedQuad_6_, BlockPartRotation p_makeBakedQuad_7_, boolean p_makeBakedQuad_8_, boolean p_makeBakedQuad_9_) + { + int[] aint = this.makeQuadVertexData(p_makeBakedQuad_3_, p_makeBakedQuad_4_, p_makeBakedQuad_5_, this.getPositionsDiv16(p_makeBakedQuad_1_, p_makeBakedQuad_2_), p_makeBakedQuad_6_, p_makeBakedQuad_7_, p_makeBakedQuad_8_, p_makeBakedQuad_9_); + EnumFacing enumfacing = getFacingFromVertexData(aint); + + if (p_makeBakedQuad_8_) + { + this.lockUv(aint, enumfacing, p_makeBakedQuad_3_.blockFaceUV, p_makeBakedQuad_4_); + } + + if (p_makeBakedQuad_7_ == null) + { + this.applyFacing(aint, enumfacing); + } + + if (Reflector.ForgeHooksClient_fillNormal.exists()) + { + Reflector.call(Reflector.ForgeHooksClient_fillNormal, new Object[] {aint, enumfacing}); + } + + return new BakedQuad(aint, p_makeBakedQuad_3_.tintIndex, enumfacing); + } + + private int[] makeQuadVertexData(BlockPartFace p_makeQuadVertexData_1_, TextureAtlasSprite p_makeQuadVertexData_2_, EnumFacing p_makeQuadVertexData_3_, float[] p_makeQuadVertexData_4_, ITransformation p_makeQuadVertexData_5_, BlockPartRotation p_makeQuadVertexData_6_, boolean p_makeQuadVertexData_7_, boolean p_makeQuadVertexData_8_) + { + int i = 28; + + if (Config.isShaders()) + { + i = 56; + } + + int[] aint = new int[i]; + + for (int j = 0; j < 4; ++j) + { + this.fillVertexData(aint, j, p_makeQuadVertexData_3_, p_makeQuadVertexData_1_, p_makeQuadVertexData_4_, p_makeQuadVertexData_2_, p_makeQuadVertexData_5_, p_makeQuadVertexData_6_, p_makeQuadVertexData_7_, p_makeQuadVertexData_8_); + } + + return aint; + } + + private int getFaceShadeColor(EnumFacing facing) + { + float f = getFaceBrightness(facing); + int i = MathHelper.clamp_int((int)(f * 255.0F), 0, 255); + return -16777216 | i << 16 | i << 8 | i; + } + + public static float getFaceBrightness(EnumFacing p_178412_0_) + { + switch (p_178412_0_) + { + case DOWN: + if (Config.isShaders()) + { + return Shaders.blockLightLevel05; + } + + return 0.5F; + + case UP: + return 1.0F; + + case NORTH: + case SOUTH: + if (Config.isShaders()) + { + return Shaders.blockLightLevel08; + } + + return 0.8F; + + case WEST: + case EAST: + if (Config.isShaders()) + { + return Shaders.blockLightLevel06; + } + + return 0.6F; + + default: + return 1.0F; + } + } + + private float[] getPositionsDiv16(Vector3f pos1, Vector3f pos2) + { + float[] afloat = new float[EnumFacing.values().length]; + afloat[EnumFaceDirection.Constants.WEST_INDEX] = pos1.x / 16.0F; + afloat[EnumFaceDirection.Constants.DOWN_INDEX] = pos1.y / 16.0F; + afloat[EnumFaceDirection.Constants.NORTH_INDEX] = pos1.z / 16.0F; + afloat[EnumFaceDirection.Constants.EAST_INDEX] = pos2.x / 16.0F; + afloat[EnumFaceDirection.Constants.UP_INDEX] = pos2.y / 16.0F; + afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = pos2.z / 16.0F; + return afloat; + } + + private void fillVertexData(int[] p_fillVertexData_1_, int p_fillVertexData_2_, EnumFacing p_fillVertexData_3_, BlockPartFace p_fillVertexData_4_, float[] p_fillVertexData_5_, TextureAtlasSprite p_fillVertexData_6_, ITransformation p_fillVertexData_7_, BlockPartRotation p_fillVertexData_8_, boolean p_fillVertexData_9_, boolean p_fillVertexData_10_) + { + EnumFacing enumfacing = p_fillVertexData_7_.rotate(p_fillVertexData_3_); + int i = p_fillVertexData_10_ ? this.getFaceShadeColor(enumfacing) : -1; + EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(p_fillVertexData_3_).getVertexInformation(p_fillVertexData_2_); + Vector3f vector3f = new Vector3f(p_fillVertexData_5_[enumfacedirection$vertexinformation.xIndex], p_fillVertexData_5_[enumfacedirection$vertexinformation.yIndex], p_fillVertexData_5_[enumfacedirection$vertexinformation.zIndex]); + this.rotatePart(vector3f, p_fillVertexData_8_); + int j = this.rotateVertex(vector3f, p_fillVertexData_3_, p_fillVertexData_2_, p_fillVertexData_7_, p_fillVertexData_9_); + BlockModelUtils.snapVertexPosition(vector3f); + this.storeVertexData(p_fillVertexData_1_, j, p_fillVertexData_2_, vector3f, i, p_fillVertexData_6_, p_fillVertexData_4_.blockFaceUV); + } + + private void storeVertexData(int[] faceData, int storeIndex, int vertexIndex, Vector3f position, int shadeColor, TextureAtlasSprite sprite, BlockFaceUV faceUV) + { + int i = faceData.length / 4; + int j = storeIndex * i; + faceData[j] = Float.floatToRawIntBits(position.x); + faceData[j + 1] = Float.floatToRawIntBits(position.y); + faceData[j + 2] = Float.floatToRawIntBits(position.z); + faceData[j + 3] = shadeColor; + faceData[j + 4] = Float.floatToRawIntBits(sprite.getInterpolatedU((double)faceUV.func_178348_a(vertexIndex) * 0.999D + (double)faceUV.func_178348_a((vertexIndex + 2) % 4) * 0.001D)); + faceData[j + 4 + 1] = Float.floatToRawIntBits(sprite.getInterpolatedV((double)faceUV.func_178346_b(vertexIndex) * 0.999D + (double)faceUV.func_178346_b((vertexIndex + 2) % 4) * 0.001D)); + } + + private void rotatePart(Vector3f p_178407_1_, BlockPartRotation partRotation) + { + if (partRotation != null) + { + Matrix4f matrix4f = this.getMatrixIdentity(); + Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F); + + switch (partRotation.axis) + { + case X: + Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f); + vector3f.set(0.0F, 1.0F, 1.0F); + break; + + case Y: + Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f, matrix4f); + vector3f.set(1.0F, 0.0F, 1.0F); + break; + + case Z: + Matrix4f.rotate(partRotation.angle * 0.017453292F, new Vector3f(0.0F, 0.0F, 1.0F), matrix4f, matrix4f); + vector3f.set(1.0F, 1.0F, 0.0F); + } + + if (partRotation.rescale) + { + if (Math.abs(partRotation.angle) == 22.5F) + { + vector3f.scale(SCALE_ROTATION_22_5); + } + else + { + vector3f.scale(SCALE_ROTATION_GENERAL); + } + + Vector3f.add(vector3f, new Vector3f(1.0F, 1.0F, 1.0F), vector3f); + } + else + { + vector3f.set(1.0F, 1.0F, 1.0F); + } + + this.rotateScale(p_178407_1_, new Vector3f(partRotation.origin), matrix4f, vector3f); + } + } + + public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, ModelRotation modelRotationIn, boolean uvLocked) + { + return this.rotateVertex(position, facing, vertexIndex, modelRotationIn, uvLocked); + } + + public int rotateVertex(Vector3f p_rotateVertex_1_, EnumFacing p_rotateVertex_2_, int p_rotateVertex_3_, ITransformation p_rotateVertex_4_, boolean p_rotateVertex_5_) + { + if (p_rotateVertex_4_ == ModelRotation.X0_Y0) + { + return p_rotateVertex_3_; + } + else + { + if (Reflector.ForgeHooksClient_transform.exists()) + { + Reflector.call(Reflector.ForgeHooksClient_transform, new Object[] {p_rotateVertex_1_, p_rotateVertex_4_.getMatrix()}); + } + else + { + this.rotateScale(p_rotateVertex_1_, new Vector3f(0.5F, 0.5F, 0.5F), ((ModelRotation) p_rotateVertex_4_).getMatrix4d(), new Vector3f(1.0F, 1.0F, 1.0F)); + } + + return p_rotateVertex_4_.rotate(p_rotateVertex_2_, p_rotateVertex_3_); + } + } + + private void rotateScale(Vector3f position, Vector3f rotationOrigin, Matrix4f rotationMatrix, Vector3f scale) + { + Vector4f vector4f = new Vector4f(position.x - rotationOrigin.x, position.y - rotationOrigin.y, position.z - rotationOrigin.z, 1.0F); + Matrix4f.transform(rotationMatrix, vector4f, vector4f); + vector4f.x *= scale.x; + vector4f.y *= scale.y; + vector4f.z *= scale.z; + position.set(vector4f.x + rotationOrigin.x, vector4f.y + rotationOrigin.y, vector4f.z + rotationOrigin.z); + } + + private Matrix4f getMatrixIdentity() + { + Matrix4f matrix4f = new Matrix4f(); + matrix4f.setIdentity(); + return matrix4f; + } + + public static EnumFacing getFacingFromVertexData(int[] faceData) + { + int i = faceData.length / 4; + int j = i * 2; + int k = i * 3; + Vector3f vector3f = new Vector3f(Float.intBitsToFloat(faceData[0]), Float.intBitsToFloat(faceData[1]), Float.intBitsToFloat(faceData[2])); + Vector3f vector3f1 = new Vector3f(Float.intBitsToFloat(faceData[i]), Float.intBitsToFloat(faceData[i + 1]), Float.intBitsToFloat(faceData[i + 2])); + Vector3f vector3f2 = new Vector3f(Float.intBitsToFloat(faceData[j]), Float.intBitsToFloat(faceData[j + 1]), Float.intBitsToFloat(faceData[j + 2])); + Vector3f vector3f3 = new Vector3f(); + Vector3f vector3f4 = new Vector3f(); + Vector3f vector3f5 = new Vector3f(); + Vector3f.sub(vector3f, vector3f1, vector3f3); + Vector3f.sub(vector3f2, vector3f1, vector3f4); + Vector3f.cross(vector3f4, vector3f3, vector3f5); + float f = (float)Math.sqrt((double)(vector3f5.x * vector3f5.x + vector3f5.y * vector3f5.y + vector3f5.z * vector3f5.z)); + vector3f5.x /= f; + vector3f5.y /= f; + vector3f5.z /= f; + EnumFacing enumfacing = null; + float f1 = 0.0F; + + for (EnumFacing enumfacing1 : EnumFacing.values()) + { + Vec3i vec3i = enumfacing1.getDirectionVec(); + Vector3f vector3f6 = new Vector3f((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ()); + float f2 = Vector3f.dot(vector3f5, vector3f6); + + if (f2 >= 0.0F && f2 > f1) + { + f1 = f2; + enumfacing = enumfacing1; + } + } + + if (enumfacing == null) + { + return EnumFacing.UP; + } + else + { + return enumfacing; + } + } + + public void lockUv(int[] p_178409_1_, EnumFacing facing, BlockFaceUV p_178409_3_, TextureAtlasSprite p_178409_4_) + { + for (int i = 0; i < 4; ++i) + { + this.lockVertexUv(i, p_178409_1_, facing, p_178409_3_, p_178409_4_); + } + } + + private void applyFacing(int[] p_178408_1_, EnumFacing p_178408_2_) + { + int[] aint = new int[p_178408_1_.length]; + System.arraycopy(p_178408_1_, 0, aint, 0, p_178408_1_.length); + float[] afloat = new float[EnumFacing.values().length]; + afloat[EnumFaceDirection.Constants.WEST_INDEX] = 999.0F; + afloat[EnumFaceDirection.Constants.DOWN_INDEX] = 999.0F; + afloat[EnumFaceDirection.Constants.NORTH_INDEX] = 999.0F; + afloat[EnumFaceDirection.Constants.EAST_INDEX] = -999.0F; + afloat[EnumFaceDirection.Constants.UP_INDEX] = -999.0F; + afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = -999.0F; + int i = p_178408_1_.length / 4; + + for (int j = 0; j < 4; ++j) + { + int k = i * j; + float f = Float.intBitsToFloat(aint[k]); + float f1 = Float.intBitsToFloat(aint[k + 1]); + float f2 = Float.intBitsToFloat(aint[k + 2]); + + if (f < afloat[EnumFaceDirection.Constants.WEST_INDEX]) + { + afloat[EnumFaceDirection.Constants.WEST_INDEX] = f; + } + + if (f1 < afloat[EnumFaceDirection.Constants.DOWN_INDEX]) + { + afloat[EnumFaceDirection.Constants.DOWN_INDEX] = f1; + } + + if (f2 < afloat[EnumFaceDirection.Constants.NORTH_INDEX]) + { + afloat[EnumFaceDirection.Constants.NORTH_INDEX] = f2; + } + + if (f > afloat[EnumFaceDirection.Constants.EAST_INDEX]) + { + afloat[EnumFaceDirection.Constants.EAST_INDEX] = f; + } + + if (f1 > afloat[EnumFaceDirection.Constants.UP_INDEX]) + { + afloat[EnumFaceDirection.Constants.UP_INDEX] = f1; + } + + if (f2 > afloat[EnumFaceDirection.Constants.SOUTH_INDEX]) + { + afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = f2; + } + } + + EnumFaceDirection enumfacedirection = EnumFaceDirection.getFacing(p_178408_2_); + + for (int j1 = 0; j1 < 4; ++j1) + { + int k1 = i * j1; + EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = enumfacedirection.getVertexInformation(j1); + float f8 = afloat[enumfacedirection$vertexinformation.xIndex]; + float f3 = afloat[enumfacedirection$vertexinformation.yIndex]; + float f4 = afloat[enumfacedirection$vertexinformation.zIndex]; + p_178408_1_[k1] = Float.floatToRawIntBits(f8); + p_178408_1_[k1 + 1] = Float.floatToRawIntBits(f3); + p_178408_1_[k1 + 2] = Float.floatToRawIntBits(f4); + + for (int l = 0; l < 4; ++l) + { + int i1 = i * l; + float f5 = Float.intBitsToFloat(aint[i1]); + float f6 = Float.intBitsToFloat(aint[i1 + 1]); + float f7 = Float.intBitsToFloat(aint[i1 + 2]); + + if (MathHelper.epsilonEquals(f8, f5) && MathHelper.epsilonEquals(f3, f6) && MathHelper.epsilonEquals(f4, f7)) + { + p_178408_1_[k1 + 4] = aint[i1 + 4]; + p_178408_1_[k1 + 4 + 1] = aint[i1 + 4 + 1]; + } + } + } + } + + private void lockVertexUv(int p_178401_1_, int[] p_178401_2_, EnumFacing facing, BlockFaceUV p_178401_4_, TextureAtlasSprite p_178401_5_) + { + int i = p_178401_2_.length / 4; + int j = i * p_178401_1_; + float f = Float.intBitsToFloat(p_178401_2_[j]); + float f1 = Float.intBitsToFloat(p_178401_2_[j + 1]); + float f2 = Float.intBitsToFloat(p_178401_2_[j + 2]); + + if (f < -0.1F || f >= 1.1F) + { + f -= (float)MathHelper.floor_float(f); + } + + if (f1 < -0.1F || f1 >= 1.1F) + { + f1 -= (float)MathHelper.floor_float(f1); + } + + if (f2 < -0.1F || f2 >= 1.1F) + { + f2 -= (float)MathHelper.floor_float(f2); + } + + float f3 = 0.0F; + float f4 = 0.0F; + + switch (facing) + { + case DOWN: + f3 = f * 16.0F; + f4 = (1.0F - f2) * 16.0F; + break; + + case UP: + f3 = f * 16.0F; + f4 = f2 * 16.0F; + break; + + case NORTH: + f3 = (1.0F - f) * 16.0F; + f4 = (1.0F - f1) * 16.0F; + break; + + case SOUTH: + f3 = f * 16.0F; + f4 = (1.0F - f1) * 16.0F; + break; + + case WEST: + f3 = f2 * 16.0F; + f4 = (1.0F - f1) * 16.0F; + break; + + case EAST: + f3 = (1.0F - f2) * 16.0F; + f4 = (1.0F - f1) * 16.0F; + } + + int k = p_178401_4_.func_178345_c(p_178401_1_) * i; + p_178401_2_[k + 4] = Float.floatToRawIntBits(p_178401_5_.getInterpolatedU((double)f3)); + p_178401_2_[k + 4 + 1] = Float.floatToRawIntBits(p_178401_5_.getInterpolatedV((double)f4)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java new file mode 100644 index 0000000..4b3b266 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java @@ -0,0 +1,131 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import net.minecraft.client.renderer.GlStateManager; + +public class ItemCameraTransforms +{ + public static final ItemCameraTransforms DEFAULT = new ItemCameraTransforms(); + public static float field_181690_b = 0.0F; + public static float field_181691_c = 0.0F; + public static float field_181692_d = 0.0F; + public static float field_181693_e = 0.0F; + public static float field_181694_f = 0.0F; + public static float field_181695_g = 0.0F; + public static float field_181696_h = 0.0F; + public static float field_181697_i = 0.0F; + public static float field_181698_j = 0.0F; + public final ItemTransformVec3f thirdPerson; + public final ItemTransformVec3f firstPerson; + public final ItemTransformVec3f head; + public final ItemTransformVec3f gui; + public final ItemTransformVec3f ground; + public final ItemTransformVec3f fixed; + + private ItemCameraTransforms() + { + this(ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT); + } + + public ItemCameraTransforms(ItemCameraTransforms transforms) + { + this.thirdPerson = transforms.thirdPerson; + this.firstPerson = transforms.firstPerson; + this.head = transforms.head; + this.gui = transforms.gui; + this.ground = transforms.ground; + this.fixed = transforms.fixed; + } + + public ItemCameraTransforms(ItemTransformVec3f thirdPersonIn, ItemTransformVec3f firstPersonIn, ItemTransformVec3f headIn, ItemTransformVec3f guiIn, ItemTransformVec3f groundIn, ItemTransformVec3f fixedIn) + { + this.thirdPerson = thirdPersonIn; + this.firstPerson = firstPersonIn; + this.head = headIn; + this.gui = guiIn; + this.ground = groundIn; + this.fixed = fixedIn; + } + + public void applyTransform(ItemCameraTransforms.TransformType type) + { + ItemTransformVec3f itemtransformvec3f = this.getTransform(type); + + if (itemtransformvec3f != ItemTransformVec3f.DEFAULT) + { + GlStateManager.translate(itemtransformvec3f.translation.x + field_181690_b, itemtransformvec3f.translation.y + field_181691_c, itemtransformvec3f.translation.z + field_181692_d); + GlStateManager.rotate(itemtransformvec3f.rotation.y + field_181694_f, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(itemtransformvec3f.rotation.x + field_181693_e, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(itemtransformvec3f.rotation.z + field_181695_g, 0.0F, 0.0F, 1.0F); + GlStateManager.scale(itemtransformvec3f.scale.x + field_181696_h, itemtransformvec3f.scale.y + field_181697_i, itemtransformvec3f.scale.z + field_181698_j); + } + } + + public ItemTransformVec3f getTransform(ItemCameraTransforms.TransformType type) + { + switch (type) + { + case THIRD_PERSON: + return this.thirdPerson; + + case FIRST_PERSON: + return this.firstPerson; + + case HEAD: + return this.head; + + case GUI: + return this.gui; + + case GROUND: + return this.ground; + + case FIXED: + return this.fixed; + + default: + return ItemTransformVec3f.DEFAULT; + } + } + + public boolean func_181687_c(ItemCameraTransforms.TransformType type) + { + return !this.getTransform(type).equals(ItemTransformVec3f.DEFAULT); + } + + static class Deserializer implements JsonDeserializer + { + public ItemCameraTransforms deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + ItemTransformVec3f itemtransformvec3f = this.func_181683_a(p_deserialize_3_, jsonobject, "thirdperson"); + ItemTransformVec3f itemtransformvec3f1 = this.func_181683_a(p_deserialize_3_, jsonobject, "firstperson"); + ItemTransformVec3f itemtransformvec3f2 = this.func_181683_a(p_deserialize_3_, jsonobject, "head"); + ItemTransformVec3f itemtransformvec3f3 = this.func_181683_a(p_deserialize_3_, jsonobject, "gui"); + ItemTransformVec3f itemtransformvec3f4 = this.func_181683_a(p_deserialize_3_, jsonobject, "ground"); + ItemTransformVec3f itemtransformvec3f5 = this.func_181683_a(p_deserialize_3_, jsonobject, "fixed"); + return new ItemCameraTransforms(itemtransformvec3f, itemtransformvec3f1, itemtransformvec3f2, itemtransformvec3f3, itemtransformvec3f4, itemtransformvec3f5); + } + + private ItemTransformVec3f func_181683_a(JsonDeserializationContext p_181683_1_, JsonObject p_181683_2_, String p_181683_3_) + { + return p_181683_2_.has(p_181683_3_) ? (ItemTransformVec3f)p_181683_1_.deserialize(p_181683_2_.get(p_181683_3_), ItemTransformVec3f.class) : ItemTransformVec3f.DEFAULT; + } + } + + public static enum TransformType + { + NONE, + THIRD_PERSON, + FIRST_PERSON, + HEAD, + GUI, + GROUND, + FIXED; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemModelGenerator.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemModelGenerator.java new file mode 100644 index 0000000..bc20f6e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemModelGenerator.java @@ -0,0 +1,327 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.util.vector.Vector3f; + +public class ItemModelGenerator +{ + public static final List LAYERS = Lists.newArrayList(new String[] {"layer0", "layer1", "layer2", "layer3", "layer4"}); + + public ModelBlock makeItemModel(TextureMap textureMapIn, ModelBlock blockModel) + { + Map map = Maps.newHashMap(); + List list = Lists.newArrayList(); + + for (int i = 0; i < LAYERS.size(); ++i) + { + String s = (String)LAYERS.get(i); + + if (!blockModel.isTexturePresent(s)) + { + break; + } + + String s1 = blockModel.resolveTextureName(s); + map.put(s, s1); + TextureAtlasSprite textureatlassprite = textureMapIn.getAtlasSprite((new ResourceLocation(s1)).toString()); + list.addAll(this.func_178394_a(i, s, textureatlassprite)); + } + + if (list.isEmpty()) + { + return null; + } + else + { + map.put("particle", blockModel.isTexturePresent("particle") ? blockModel.resolveTextureName("particle") : (String)map.get("layer0")); + return new ModelBlock(list, map, false, false, blockModel.getAllTransforms()); + } + } + + private List func_178394_a(int p_178394_1_, String p_178394_2_, TextureAtlasSprite p_178394_3_) + { + Map map = Maps.newHashMap(); + map.put(EnumFacing.SOUTH, new BlockPartFace((EnumFacing)null, p_178394_1_, p_178394_2_, new BlockFaceUV(new float[] {0.0F, 0.0F, 16.0F, 16.0F}, 0))); + map.put(EnumFacing.NORTH, new BlockPartFace((EnumFacing)null, p_178394_1_, p_178394_2_, new BlockFaceUV(new float[] {16.0F, 0.0F, 0.0F, 16.0F}, 0))); + List list = Lists.newArrayList(); + list.add(new BlockPart(new Vector3f(0.0F, 0.0F, 7.5F), new Vector3f(16.0F, 16.0F, 8.5F), map, (BlockPartRotation)null, true)); + list.addAll(this.func_178397_a(p_178394_3_, p_178394_2_, p_178394_1_)); + return list; + } + + private List func_178397_a(TextureAtlasSprite p_178397_1_, String p_178397_2_, int p_178397_3_) + { + float f = (float)p_178397_1_.getIconWidth(); + float f1 = (float)p_178397_1_.getIconHeight(); + List list = Lists.newArrayList(); + + for (ItemModelGenerator.Span itemmodelgenerator$span : this.func_178393_a(p_178397_1_)) + { + float f2 = 0.0F; + float f3 = 0.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; + float f7 = 0.0F; + float f8 = 0.0F; + float f9 = 0.0F; + float f10 = 0.0F; + float f11 = 0.0F; + float f12 = (float)itemmodelgenerator$span.func_178385_b(); + float f13 = (float)itemmodelgenerator$span.func_178384_c(); + float f14 = (float)itemmodelgenerator$span.func_178381_d(); + ItemModelGenerator.SpanFacing itemmodelgenerator$spanfacing = itemmodelgenerator$span.func_178383_a(); + + switch (itemmodelgenerator$spanfacing) + { + case UP: + f6 = f12; + f2 = f12; + f4 = f7 = f13 + 1.0F; + f8 = f14; + f3 = f14; + f9 = f14; + f5 = f14; + f10 = 16.0F / f; + f11 = 16.0F / (f1 - 1.0F); + break; + + case DOWN: + f9 = f14; + f8 = f14; + f6 = f12; + f2 = f12; + f4 = f7 = f13 + 1.0F; + f3 = f14 + 1.0F; + f5 = f14 + 1.0F; + f10 = 16.0F / f; + f11 = 16.0F / (f1 - 1.0F); + break; + + case LEFT: + f6 = f14; + f2 = f14; + f7 = f14; + f4 = f14; + f9 = f12; + f3 = f12; + f5 = f8 = f13 + 1.0F; + f10 = 16.0F / (f - 1.0F); + f11 = 16.0F / f1; + break; + + case RIGHT: + f7 = f14; + f6 = f14; + f2 = f14 + 1.0F; + f4 = f14 + 1.0F; + f9 = f12; + f3 = f12; + f5 = f8 = f13 + 1.0F; + f10 = 16.0F / (f - 1.0F); + f11 = 16.0F / f1; + } + + float f15 = 16.0F / f; + float f16 = 16.0F / f1; + f2 = f2 * f15; + f4 = f4 * f15; + f3 = f3 * f16; + f5 = f5 * f16; + f3 = 16.0F - f3; + f5 = 16.0F - f5; + f6 = f6 * f10; + f7 = f7 * f10; + f8 = f8 * f11; + f9 = f9 * f11; + Map map = Maps.newHashMap(); + map.put(itemmodelgenerator$spanfacing.getFacing(), new BlockPartFace((EnumFacing)null, p_178397_3_, p_178397_2_, new BlockFaceUV(new float[] {f6, f8, f7, f9}, 0))); + + switch (itemmodelgenerator$spanfacing) + { + case UP: + list.add(new BlockPart(new Vector3f(f2, f3, 7.5F), new Vector3f(f4, f3, 8.5F), map, (BlockPartRotation)null, true)); + break; + + case DOWN: + list.add(new BlockPart(new Vector3f(f2, f5, 7.5F), new Vector3f(f4, f5, 8.5F), map, (BlockPartRotation)null, true)); + break; + + case LEFT: + list.add(new BlockPart(new Vector3f(f2, f3, 7.5F), new Vector3f(f2, f5, 8.5F), map, (BlockPartRotation)null, true)); + break; + + case RIGHT: + list.add(new BlockPart(new Vector3f(f4, f3, 7.5F), new Vector3f(f4, f5, 8.5F), map, (BlockPartRotation)null, true)); + } + } + + return list; + } + + private List func_178393_a(TextureAtlasSprite p_178393_1_) + { + int i = p_178393_1_.getIconWidth(); + int j = p_178393_1_.getIconHeight(); + List list = Lists.newArrayList(); + + for (int k = 0; k < p_178393_1_.getFrameCount(); ++k) + { + int[] aint = p_178393_1_.getFrameTextureData(k)[0]; + + for (int l = 0; l < j; ++l) + { + for (int i1 = 0; i1 < i; ++i1) + { + boolean flag = !this.func_178391_a(aint, i1, l, i, j); + this.func_178396_a(ItemModelGenerator.SpanFacing.UP, list, aint, i1, l, i, j, flag); + this.func_178396_a(ItemModelGenerator.SpanFacing.DOWN, list, aint, i1, l, i, j, flag); + this.func_178396_a(ItemModelGenerator.SpanFacing.LEFT, list, aint, i1, l, i, j, flag); + this.func_178396_a(ItemModelGenerator.SpanFacing.RIGHT, list, aint, i1, l, i, j, flag); + } + } + } + + return list; + } + + private void func_178396_a(ItemModelGenerator.SpanFacing p_178396_1_, List p_178396_2_, int[] p_178396_3_, int p_178396_4_, int p_178396_5_, int p_178396_6_, int p_178396_7_, boolean p_178396_8_) + { + boolean flag = this.func_178391_a(p_178396_3_, p_178396_4_ + p_178396_1_.func_178372_b(), p_178396_5_ + p_178396_1_.func_178371_c(), p_178396_6_, p_178396_7_) && p_178396_8_; + + if (flag) + { + this.func_178395_a(p_178396_2_, p_178396_1_, p_178396_4_, p_178396_5_); + } + } + + private void func_178395_a(List p_178395_1_, ItemModelGenerator.SpanFacing p_178395_2_, int p_178395_3_, int p_178395_4_) + { + ItemModelGenerator.Span itemmodelgenerator$span = null; + + for (ItemModelGenerator.Span itemmodelgenerator$span1 : p_178395_1_) + { + if (itemmodelgenerator$span1.func_178383_a() == p_178395_2_) + { + int i = p_178395_2_.func_178369_d() ? p_178395_4_ : p_178395_3_; + + if (itemmodelgenerator$span1.func_178381_d() == i) + { + itemmodelgenerator$span = itemmodelgenerator$span1; + break; + } + } + } + + int j = p_178395_2_.func_178369_d() ? p_178395_4_ : p_178395_3_; + int k = p_178395_2_.func_178369_d() ? p_178395_3_ : p_178395_4_; + + if (itemmodelgenerator$span == null) + { + p_178395_1_.add(new ItemModelGenerator.Span(p_178395_2_, k, j)); + } + else + { + itemmodelgenerator$span.func_178382_a(k); + } + } + + private boolean func_178391_a(int[] p_178391_1_, int p_178391_2_, int p_178391_3_, int p_178391_4_, int p_178391_5_) + { + return p_178391_2_ >= 0 && p_178391_3_ >= 0 && p_178391_2_ < p_178391_4_ && p_178391_3_ < p_178391_5_ ? (p_178391_1_[p_178391_3_ * p_178391_4_ + p_178391_2_] >> 24 & 255) == 0 : true; + } + + static class Span + { + private final ItemModelGenerator.SpanFacing spanFacing; + private int field_178387_b; + private int field_178388_c; + private final int field_178386_d; + + public Span(ItemModelGenerator.SpanFacing spanFacingIn, int p_i46216_2_, int p_i46216_3_) + { + this.spanFacing = spanFacingIn; + this.field_178387_b = p_i46216_2_; + this.field_178388_c = p_i46216_2_; + this.field_178386_d = p_i46216_3_; + } + + public void func_178382_a(int p_178382_1_) + { + if (p_178382_1_ < this.field_178387_b) + { + this.field_178387_b = p_178382_1_; + } + else if (p_178382_1_ > this.field_178388_c) + { + this.field_178388_c = p_178382_1_; + } + } + + public ItemModelGenerator.SpanFacing func_178383_a() + { + return this.spanFacing; + } + + public int func_178385_b() + { + return this.field_178387_b; + } + + public int func_178384_c() + { + return this.field_178388_c; + } + + public int func_178381_d() + { + return this.field_178386_d; + } + } + + static enum SpanFacing + { + UP(EnumFacing.UP, 0, -1), + DOWN(EnumFacing.DOWN, 0, 1), + LEFT(EnumFacing.EAST, -1, 0), + RIGHT(EnumFacing.WEST, 1, 0); + + private final EnumFacing facing; + private final int field_178373_f; + private final int field_178374_g; + + private SpanFacing(EnumFacing facing, int p_i46215_4_, int p_i46215_5_) + { + this.facing = facing; + this.field_178373_f = p_i46215_4_; + this.field_178374_g = p_i46215_5_; + } + + public EnumFacing getFacing() + { + return this.facing; + } + + public int func_178372_b() + { + return this.field_178373_f; + } + + public int func_178371_c() + { + return this.field_178374_g; + } + + private boolean func_178369_d() + { + return this == DOWN || this == UP; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java new file mode 100644 index 0000000..007ff2d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java @@ -0,0 +1,103 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.MathHelper; +import org.lwjgl.util.vector.Vector3f; + +public class ItemTransformVec3f +{ + public static final ItemTransformVec3f DEFAULT = new ItemTransformVec3f(new Vector3f(), new Vector3f(), new Vector3f(1.0F, 1.0F, 1.0F)); + public final Vector3f rotation; + public final Vector3f translation; + public final Vector3f scale; + + public ItemTransformVec3f(Vector3f rotation, Vector3f translation, Vector3f scale) + { + this.rotation = new Vector3f(rotation); + this.translation = new Vector3f(translation); + this.scale = new Vector3f(scale); + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (this.getClass() != p_equals_1_.getClass()) + { + return false; + } + else + { + ItemTransformVec3f itemtransformvec3f = (ItemTransformVec3f)p_equals_1_; + return !this.rotation.equals(itemtransformvec3f.rotation) ? false : (!this.scale.equals(itemtransformvec3f.scale) ? false : this.translation.equals(itemtransformvec3f.translation)); + } + } + + public int hashCode() + { + int i = this.rotation.hashCode(); + i = 31 * i + this.translation.hashCode(); + i = 31 * i + this.scale.hashCode(); + return i; + } + + static class Deserializer implements JsonDeserializer + { + private static final Vector3f ROTATION_DEFAULT = new Vector3f(0.0F, 0.0F, 0.0F); + private static final Vector3f TRANSLATION_DEFAULT = new Vector3f(0.0F, 0.0F, 0.0F); + private static final Vector3f SCALE_DEFAULT = new Vector3f(1.0F, 1.0F, 1.0F); + + public ItemTransformVec3f deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + Vector3f vector3f = this.parseVector3f(jsonobject, "rotation", ROTATION_DEFAULT); + Vector3f vector3f1 = this.parseVector3f(jsonobject, "translation", TRANSLATION_DEFAULT); + vector3f1.scale(0.0625F); + vector3f1.x = MathHelper.clamp_float(vector3f1.x, -1.5F, 1.5F); + vector3f1.y = MathHelper.clamp_float(vector3f1.y, -1.5F, 1.5F); + vector3f1.z = MathHelper.clamp_float(vector3f1.z, -1.5F, 1.5F); + Vector3f vector3f2 = this.parseVector3f(jsonobject, "scale", SCALE_DEFAULT); + vector3f2.x = MathHelper.clamp_float(vector3f2.x, -4.0F, 4.0F); + vector3f2.y = MathHelper.clamp_float(vector3f2.y, -4.0F, 4.0F); + vector3f2.z = MathHelper.clamp_float(vector3f2.z, -4.0F, 4.0F); + return new ItemTransformVec3f(vector3f, vector3f1, vector3f2); + } + + private Vector3f parseVector3f(JsonObject jsonObject, String key, Vector3f defaultValue) + { + if (!jsonObject.has(key)) + { + return defaultValue; + } + else + { + JsonArray jsonarray = JsonUtils.getJsonArray(jsonObject, key); + + if (jsonarray.size() != 3) + { + throw new JsonParseException("Expected 3 " + key + " values, found: " + jsonarray.size()); + } + else + { + float[] afloat = new float[3]; + + for (int i = 0; i < afloat.length; ++i) + { + afloat[i] = JsonUtils.getFloat(jsonarray.get(i), key + "[" + i + "]"); + } + + return new Vector3f(afloat[0], afloat[1], afloat[2]); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ModelBlock.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ModelBlock.java new file mode 100644 index 0000000..1e9f70d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ModelBlock.java @@ -0,0 +1,295 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.io.Reader; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ModelBlock +{ + private static final Logger LOGGER = LogManager.getLogger(); + static final Gson SERIALIZER = (new GsonBuilder()).registerTypeAdapter(ModelBlock.class, new ModelBlock.Deserializer()).registerTypeAdapter(BlockPart.class, new BlockPart.Deserializer()).registerTypeAdapter(BlockPartFace.class, new BlockPartFace.Deserializer()).registerTypeAdapter(BlockFaceUV.class, new BlockFaceUV.Deserializer()).registerTypeAdapter(ItemTransformVec3f.class, new ItemTransformVec3f.Deserializer()).registerTypeAdapter(ItemCameraTransforms.class, new ItemCameraTransforms.Deserializer()).create(); + private final List elements; + private final boolean gui3d; + private final boolean ambientOcclusion; + private ItemCameraTransforms cameraTransforms; + public String name; + protected final Map textures; + protected ModelBlock parent; + protected ResourceLocation parentLocation; + + public static ModelBlock deserialize(Reader readerIn) + { + return (ModelBlock)SERIALIZER.fromJson(readerIn, ModelBlock.class); + } + + public static ModelBlock deserialize(String jsonString) + { + return deserialize(new StringReader(jsonString)); + } + + protected ModelBlock(List elementsIn, Map texturesIn, boolean ambientOcclusionIn, boolean gui3dIn, ItemCameraTransforms cameraTransformsIn) + { + this((ResourceLocation)null, elementsIn, texturesIn, ambientOcclusionIn, gui3dIn, cameraTransformsIn); + } + + protected ModelBlock(ResourceLocation parentLocationIn, Map texturesIn, boolean ambientOcclusionIn, boolean gui3dIn, ItemCameraTransforms cameraTransformsIn) + { + this(parentLocationIn, Collections.emptyList(), texturesIn, ambientOcclusionIn, gui3dIn, cameraTransformsIn); + } + + private ModelBlock(ResourceLocation parentLocationIn, List elementsIn, Map texturesIn, boolean ambientOcclusionIn, boolean gui3dIn, ItemCameraTransforms cameraTransformsIn) + { + this.name = ""; + this.elements = elementsIn; + this.ambientOcclusion = ambientOcclusionIn; + this.gui3d = gui3dIn; + this.textures = texturesIn; + this.parentLocation = parentLocationIn; + this.cameraTransforms = cameraTransformsIn; + } + + public List getElements() + { + return this.hasParent() ? this.parent.getElements() : this.elements; + } + + private boolean hasParent() + { + return this.parent != null; + } + + public boolean isAmbientOcclusion() + { + return this.hasParent() ? this.parent.isAmbientOcclusion() : this.ambientOcclusion; + } + + public boolean isGui3d() + { + return this.gui3d; + } + + public boolean isResolved() + { + return this.parentLocation == null || this.parent != null && this.parent.isResolved(); + } + + public void getParentFromMap(Map p_178299_1_) + { + if (this.parentLocation != null) + { + this.parent = (ModelBlock)p_178299_1_.get(this.parentLocation); + } + } + + public boolean isTexturePresent(String textureName) + { + return !"missingno".equals(this.resolveTextureName(textureName)); + } + + public String resolveTextureName(String textureName) + { + if (!this.startsWithHash(textureName)) + { + textureName = '#' + textureName; + } + + return this.resolveTextureName(textureName, new ModelBlock.Bookkeep(this)); + } + + private String resolveTextureName(String textureName, ModelBlock.Bookkeep p_178302_2_) + { + if (this.startsWithHash(textureName)) + { + if (this == p_178302_2_.modelExt) + { + LOGGER.warn("Unable to resolve texture due to upward reference: " + textureName + " in " + this.name); + return "missingno"; + } + else + { + String s = (String)this.textures.get(textureName.substring(1)); + + if (s == null && this.hasParent()) + { + s = this.parent.resolveTextureName(textureName, p_178302_2_); + } + + p_178302_2_.modelExt = this; + + if (s != null && this.startsWithHash(s)) + { + s = p_178302_2_.model.resolveTextureName(s, p_178302_2_); + } + + return s != null && !this.startsWithHash(s) ? s : "missingno"; + } + } + else + { + return textureName; + } + } + + private boolean startsWithHash(String hash) + { + return hash.charAt(0) == 35; + } + + public ResourceLocation getParentLocation() + { + return this.parentLocation; + } + + public ModelBlock getRootModel() + { + return this.hasParent() ? this.parent.getRootModel() : this; + } + + public ItemCameraTransforms getAllTransforms() + { + ItemTransformVec3f itemtransformvec3f = this.getTransform(ItemCameraTransforms.TransformType.THIRD_PERSON); + ItemTransformVec3f itemtransformvec3f1 = this.getTransform(ItemCameraTransforms.TransformType.FIRST_PERSON); + ItemTransformVec3f itemtransformvec3f2 = this.getTransform(ItemCameraTransforms.TransformType.HEAD); + ItemTransformVec3f itemtransformvec3f3 = this.getTransform(ItemCameraTransforms.TransformType.GUI); + ItemTransformVec3f itemtransformvec3f4 = this.getTransform(ItemCameraTransforms.TransformType.GROUND); + ItemTransformVec3f itemtransformvec3f5 = this.getTransform(ItemCameraTransforms.TransformType.FIXED); + return new ItemCameraTransforms(itemtransformvec3f, itemtransformvec3f1, itemtransformvec3f2, itemtransformvec3f3, itemtransformvec3f4, itemtransformvec3f5); + } + + private ItemTransformVec3f getTransform(ItemCameraTransforms.TransformType type) + { + return this.parent != null && !this.cameraTransforms.func_181687_c(type) ? this.parent.getTransform(type) : this.cameraTransforms.getTransform(type); + } + + public static void checkModelHierarchy(Map p_178312_0_) + { + for (ModelBlock modelblock : p_178312_0_.values()) + { + try + { + ModelBlock modelblock1 = modelblock.parent; + + for (ModelBlock modelblock2 = modelblock1.parent; modelblock1 != modelblock2; modelblock2 = modelblock2.parent.parent) + { + modelblock1 = modelblock1.parent; + } + + throw new ModelBlock.LoopException(); + } + catch (NullPointerException var5) + { + ; + } + } + } + + static final class Bookkeep + { + public final ModelBlock model; + public ModelBlock modelExt; + + private Bookkeep(ModelBlock p_i46223_1_) + { + this.model = p_i46223_1_; + } + } + + public static class Deserializer implements JsonDeserializer + { + public ModelBlock deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + List list = this.getModelElements(p_deserialize_3_, jsonobject); + String s = this.getParent(jsonobject); + boolean flag = StringUtils.isEmpty(s); + boolean flag1 = list.isEmpty(); + + if (flag1 && flag) + { + throw new JsonParseException("BlockModel requires either elements or parent, found neither"); + } + else if (!flag && !flag1) + { + throw new JsonParseException("BlockModel requires either elements or parent, found both"); + } + else + { + Map map = this.getTextures(jsonobject); + boolean flag2 = this.getAmbientOcclusionEnabled(jsonobject); + ItemCameraTransforms itemcameratransforms = ItemCameraTransforms.DEFAULT; + + if (jsonobject.has("display")) + { + JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonobject, "display"); + itemcameratransforms = (ItemCameraTransforms)p_deserialize_3_.deserialize(jsonobject1, ItemCameraTransforms.class); + } + + return flag1 ? new ModelBlock(new ResourceLocation(s), map, flag2, true, itemcameratransforms) : new ModelBlock(list, map, flag2, true, itemcameratransforms); + } + } + + private Map getTextures(JsonObject p_178329_1_) + { + Map map = Maps.newHashMap(); + + if (p_178329_1_.has("textures")) + { + JsonObject jsonobject = p_178329_1_.getAsJsonObject("textures"); + + for (Entry entry : jsonobject.entrySet()) + { + map.put(entry.getKey(), ((JsonElement)entry.getValue()).getAsString()); + } + } + + return map; + } + + private String getParent(JsonObject p_178326_1_) + { + return JsonUtils.getString(p_178326_1_, "parent", ""); + } + + protected boolean getAmbientOcclusionEnabled(JsonObject p_178328_1_) + { + return JsonUtils.getBoolean(p_178328_1_, "ambientocclusion", true); + } + + protected List getModelElements(JsonDeserializationContext p_178325_1_, JsonObject p_178325_2_) + { + List list = Lists.newArrayList(); + + if (p_178325_2_.has("elements")) + { + for (JsonElement jsonelement : JsonUtils.getJsonArray(p_178325_2_, "elements")) + { + list.add((BlockPart)p_178325_1_.deserialize(jsonelement, BlockPart.class)); + } + } + + return list; + } + } + + public static class LoopException extends RuntimeException + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java new file mode 100644 index 0000000..a16802a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java @@ -0,0 +1,284 @@ +package net.minecraft.client.renderer.block.model; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.io.Reader; +import java.lang.reflect.Type; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.client.resources.model.ModelRotation; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; + +public class ModelBlockDefinition +{ + static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ModelBlockDefinition.class, new ModelBlockDefinition.Deserializer()).registerTypeAdapter(ModelBlockDefinition.Variant.class, new ModelBlockDefinition.Variant.Deserializer()).create(); + private final Map mapVariants = Maps.newHashMap(); + + public static ModelBlockDefinition parseFromReader(Reader p_178331_0_) + { + return (ModelBlockDefinition)GSON.fromJson(p_178331_0_, ModelBlockDefinition.class); + } + + public ModelBlockDefinition(Collection p_i46221_1_) + { + for (ModelBlockDefinition.Variants modelblockdefinition$variants : p_i46221_1_) + { + this.mapVariants.put(modelblockdefinition$variants.name, modelblockdefinition$variants); + } + } + + public ModelBlockDefinition(List p_i46222_1_) + { + for (ModelBlockDefinition modelblockdefinition : p_i46222_1_) + { + this.mapVariants.putAll(modelblockdefinition.mapVariants); + } + } + + public ModelBlockDefinition.Variants getVariants(String p_178330_1_) + { + ModelBlockDefinition.Variants modelblockdefinition$variants = (ModelBlockDefinition.Variants)this.mapVariants.get(p_178330_1_); + + if (modelblockdefinition$variants == null) + { + throw new ModelBlockDefinition.MissingVariantException(); + } + else + { + return modelblockdefinition$variants; + } + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ instanceof ModelBlockDefinition) + { + ModelBlockDefinition modelblockdefinition = (ModelBlockDefinition)p_equals_1_; + return this.mapVariants.equals(modelblockdefinition.mapVariants); + } + else + { + return false; + } + } + + public int hashCode() + { + return this.mapVariants.hashCode(); + } + + public static class Deserializer implements JsonDeserializer + { + public ModelBlockDefinition deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + List list = this.parseVariantsList(p_deserialize_3_, jsonobject); + return new ModelBlockDefinition(list); + } + + protected List parseVariantsList(JsonDeserializationContext p_178334_1_, JsonObject p_178334_2_) + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_178334_2_, "variants"); + List list = Lists.newArrayList(); + + for (Entry entry : jsonobject.entrySet()) + { + list.add(this.parseVariants(p_178334_1_, entry)); + } + + return list; + } + + protected ModelBlockDefinition.Variants parseVariants(JsonDeserializationContext p_178335_1_, Entry p_178335_2_) + { + String s = (String)p_178335_2_.getKey(); + List list = Lists.newArrayList(); + JsonElement jsonelement = (JsonElement)p_178335_2_.getValue(); + + if (jsonelement.isJsonArray()) + { + for (JsonElement jsonelement1 : jsonelement.getAsJsonArray()) + { + list.add((ModelBlockDefinition.Variant)p_178335_1_.deserialize(jsonelement1, ModelBlockDefinition.Variant.class)); + } + } + else + { + list.add((ModelBlockDefinition.Variant)p_178335_1_.deserialize(jsonelement, ModelBlockDefinition.Variant.class)); + } + + return new ModelBlockDefinition.Variants(s, list); + } + } + + public class MissingVariantException extends RuntimeException + { + } + + public static class Variant + { + private final ResourceLocation modelLocation; + private final ModelRotation modelRotation; + private final boolean uvLock; + private final int weight; + + public Variant(ResourceLocation modelLocationIn, ModelRotation modelRotationIn, boolean uvLockIn, int weightIn) + { + this.modelLocation = modelLocationIn; + this.modelRotation = modelRotationIn; + this.uvLock = uvLockIn; + this.weight = weightIn; + } + + public ResourceLocation getModelLocation() + { + return this.modelLocation; + } + + public ModelRotation getRotation() + { + return this.modelRotation; + } + + public boolean isUvLocked() + { + return this.uvLock; + } + + public int getWeight() + { + return this.weight; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ModelBlockDefinition.Variant)) + { + return false; + } + else + { + ModelBlockDefinition.Variant modelblockdefinition$variant = (ModelBlockDefinition.Variant)p_equals_1_; + return this.modelLocation.equals(modelblockdefinition$variant.modelLocation) && this.modelRotation == modelblockdefinition$variant.modelRotation && this.uvLock == modelblockdefinition$variant.uvLock; + } + } + + public int hashCode() + { + int i = this.modelLocation.hashCode(); + i = 31 * i + (this.modelRotation != null ? this.modelRotation.hashCode() : 0); + i = 31 * i + (this.uvLock ? 1 : 0); + return i; + } + + public static class Deserializer implements JsonDeserializer + { + public ModelBlockDefinition.Variant deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + String s = this.parseModel(jsonobject); + ModelRotation modelrotation = this.parseRotation(jsonobject); + boolean flag = this.parseUvLock(jsonobject); + int i = this.parseWeight(jsonobject); + return new ModelBlockDefinition.Variant(this.makeModelLocation(s), modelrotation, flag, i); + } + + private ResourceLocation makeModelLocation(String p_178426_1_) + { + ResourceLocation resourcelocation = new ResourceLocation(p_178426_1_); + resourcelocation = new ResourceLocation(resourcelocation.getResourceDomain(), "block/" + resourcelocation.getResourcePath()); + return resourcelocation; + } + + private boolean parseUvLock(JsonObject p_178429_1_) + { + return JsonUtils.getBoolean(p_178429_1_, "uvlock", false); + } + + protected ModelRotation parseRotation(JsonObject p_178428_1_) + { + int i = JsonUtils.getInt(p_178428_1_, "x", 0); + int j = JsonUtils.getInt(p_178428_1_, "y", 0); + ModelRotation modelrotation = ModelRotation.getModelRotation(i, j); + + if (modelrotation == null) + { + throw new JsonParseException("Invalid BlockModelRotation x: " + i + ", y: " + j); + } + else + { + return modelrotation; + } + } + + protected String parseModel(JsonObject p_178424_1_) + { + return JsonUtils.getString(p_178424_1_, "model"); + } + + protected int parseWeight(JsonObject p_178427_1_) + { + return JsonUtils.getInt(p_178427_1_, "weight", 1); + } + } + } + + public static class Variants + { + private final String name; + private final List listVariants; + + public Variants(String nameIn, List listVariantsIn) + { + this.name = nameIn; + this.listVariants = listVariantsIn; + } + + public List getVariants() + { + return this.listVariants; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ModelBlockDefinition.Variants)) + { + return false; + } + else + { + ModelBlockDefinition.Variants modelblockdefinition$variants = (ModelBlockDefinition.Variants)p_equals_1_; + return !this.name.equals(modelblockdefinition$variants.name) ? false : this.listVariants.equals(modelblockdefinition$variants.listVariants); + } + } + + public int hashCode() + { + int i = this.name.hashCode(); + i = 31 * i + this.listVariants.hashCode(); + return i; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/BlockStateMapper.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/BlockStateMapper.java new file mode 100644 index 0000000..8e33dd3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/BlockStateMapper.java @@ -0,0 +1,42 @@ +package net.minecraft.client.renderer.block.statemap; + +import com.google.common.base.Objects; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.model.ModelResourceLocation; + +public class BlockStateMapper +{ + private Map blockStateMap = Maps.newIdentityHashMap(); + private Set setBuiltInBlocks = Sets.newIdentityHashSet(); + + public void registerBlockStateMapper(Block p_178447_1_, IStateMapper p_178447_2_) + { + this.blockStateMap.put(p_178447_1_, p_178447_2_); + } + + public void registerBuiltInBlocks(Block... p_178448_1_) + { + Collections.addAll(this.setBuiltInBlocks, p_178448_1_); + } + + public Map putAllStateModelLocations() + { + Map map = Maps.newIdentityHashMap(); + + for (Block block : Block.blockRegistry) + { + if (!this.setBuiltInBlocks.contains(block)) + { + map.putAll(((IStateMapper)Objects.firstNonNull(this.blockStateMap.get(block), new DefaultStateMapper())).putStateModelLocations(block)); + } + } + + return map; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/DefaultStateMapper.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/DefaultStateMapper.java new file mode 100644 index 0000000..e7baf50 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/DefaultStateMapper.java @@ -0,0 +1,14 @@ +package net.minecraft.client.renderer.block.statemap; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.util.ResourceLocation; + +public class DefaultStateMapper extends StateMapperBase +{ + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + return new ModelResourceLocation((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock()), this.getPropertyString(state.getProperties())); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/IStateMapper.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/IStateMapper.java new file mode 100644 index 0000000..e0a179e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/IStateMapper.java @@ -0,0 +1,11 @@ +package net.minecraft.client.renderer.block.statemap; + +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.model.ModelResourceLocation; + +public interface IStateMapper +{ + Map putStateModelLocations(Block blockIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/StateMap.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/StateMap.java new file mode 100644 index 0000000..fdf397e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/StateMap.java @@ -0,0 +1,83 @@ +package net.minecraft.client.renderer.block.statemap; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.util.ResourceLocation; + +public class StateMap extends StateMapperBase +{ + private final IProperty name; + private final String suffix; + private final List < IProperty> ignored; + + private StateMap(IProperty name, String suffix, List < IProperty> ignored) + { + this.name = name; + this.suffix = suffix; + this.ignored = ignored; + } + + protected ModelResourceLocation getModelResourceLocation(IBlockState state) + { + Map map = Maps.newLinkedHashMap(state.getProperties()); + String s; + + if (this.name == null) + { + s = ((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock())).toString(); + } + else + { + s = ((IProperty)this.name).getName((Comparable)map.remove(this.name)); + } + + if (this.suffix != null) + { + s = s + this.suffix; + } + + for (IProperty iproperty : this.ignored) + { + map.remove(iproperty); + } + + return new ModelResourceLocation(s, this.getPropertyString(map)); + } + + public static class Builder + { + private IProperty name; + private String suffix; + private final List < IProperty> ignored = Lists. < IProperty> newArrayList(); + + public StateMap.Builder withName(IProperty builderPropertyIn) + { + this.name = builderPropertyIn; + return this; + } + + public StateMap.Builder withSuffix(String builderSuffixIn) + { + this.suffix = builderSuffixIn; + return this; + } + + public StateMap.Builder ignore(IProperty... p_178442_1_) + { + Collections.addAll(this.ignored, p_178442_1_); + return this; + } + + public StateMap build() + { + return new StateMap(this.name, this.suffix, this.ignored); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/StateMapperBase.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/StateMapperBase.java new file mode 100644 index 0000000..a42bb2c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/block/statemap/StateMapperBase.java @@ -0,0 +1,52 @@ +package net.minecraft.client.renderer.block.statemap; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.model.ModelResourceLocation; + +public abstract class StateMapperBase implements IStateMapper +{ + protected Map mapStateModelLocations = Maps.newLinkedHashMap(); + + public String getPropertyString(Map p_178131_1_) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (Entry entry : p_178131_1_.entrySet()) + { + if (stringbuilder.length() != 0) + { + stringbuilder.append(","); + } + + IProperty iproperty = (IProperty)entry.getKey(); + Comparable comparable = (Comparable)entry.getValue(); + stringbuilder.append(iproperty.getName()); + stringbuilder.append("="); + stringbuilder.append(iproperty.getName(comparable)); + } + + if (stringbuilder.length() == 0) + { + stringbuilder.append("normal"); + } + + return stringbuilder.toString(); + } + + public Map putStateModelLocations(Block blockIn) + { + for (IBlockState iblockstate : blockIn.getBlockState().getValidStates()) + { + this.mapStateModelLocations.put(iblockstate, this.getModelResourceLocation(iblockstate)); + } + + return this.mapStateModelLocations; + } + + protected abstract ModelResourceLocation getModelResourceLocation(IBlockState state); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.java new file mode 100644 index 0000000..0c4c80e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkCompileTaskGenerator.java @@ -0,0 +1,141 @@ +package net.minecraft.client.renderer.chunk; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.concurrent.locks.ReentrantLock; +import net.minecraft.client.renderer.RegionRenderCacheBuilder; + +public class ChunkCompileTaskGenerator +{ + private final RenderChunk renderChunk; + private final ReentrantLock lock = new ReentrantLock(); + private final List listFinishRunnables = Lists.newArrayList(); + private final ChunkCompileTaskGenerator.Type type; + private RegionRenderCacheBuilder regionRenderCacheBuilder; + private CompiledChunk compiledChunk; + private ChunkCompileTaskGenerator.Status status = ChunkCompileTaskGenerator.Status.PENDING; + private boolean finished; + + public ChunkCompileTaskGenerator(RenderChunk renderChunkIn, ChunkCompileTaskGenerator.Type typeIn) + { + this.renderChunk = renderChunkIn; + this.type = typeIn; + } + + public ChunkCompileTaskGenerator.Status getStatus() + { + return this.status; + } + + public RenderChunk getRenderChunk() + { + return this.renderChunk; + } + + public CompiledChunk getCompiledChunk() + { + return this.compiledChunk; + } + + public void setCompiledChunk(CompiledChunk compiledChunkIn) + { + this.compiledChunk = compiledChunkIn; + } + + public RegionRenderCacheBuilder getRegionRenderCacheBuilder() + { + return this.regionRenderCacheBuilder; + } + + public void setRegionRenderCacheBuilder(RegionRenderCacheBuilder regionRenderCacheBuilderIn) + { + this.regionRenderCacheBuilder = regionRenderCacheBuilderIn; + } + + public void setStatus(ChunkCompileTaskGenerator.Status statusIn) + { + this.lock.lock(); + + try + { + this.status = statusIn; + } + finally + { + this.lock.unlock(); + } + } + + public void finish() + { + this.lock.lock(); + + try + { + if (this.type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK && this.status != ChunkCompileTaskGenerator.Status.DONE) + { + this.renderChunk.setNeedsUpdate(true); + } + + this.finished = true; + this.status = ChunkCompileTaskGenerator.Status.DONE; + + for (Runnable runnable : this.listFinishRunnables) + { + runnable.run(); + } + } + finally + { + this.lock.unlock(); + } + } + + public void addFinishRunnable(Runnable p_178539_1_) + { + this.lock.lock(); + + try + { + this.listFinishRunnables.add(p_178539_1_); + + if (this.finished) + { + p_178539_1_.run(); + } + } + finally + { + this.lock.unlock(); + } + } + + public ReentrantLock getLock() + { + return this.lock; + } + + public ChunkCompileTaskGenerator.Type getType() + { + return this.type; + } + + public boolean isFinished() + { + return this.finished; + } + + public static enum Status + { + PENDING, + COMPILING, + UPLOADING, + DONE; + } + + public static enum Type + { + REBUILD_CHUNK, + RESORT_TRANSPARENCY; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java new file mode 100644 index 0000000..fe7064a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderDispatcher.java @@ -0,0 +1,356 @@ +package net.minecraft.client.renderer.chunk; + +import com.google.common.collect.Lists; +import com.google.common.collect.Queues; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListenableFutureTask; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import java.util.ArrayList; +import java.util.List; +import java.util.Queue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RegionRenderCacheBuilder; +import net.minecraft.client.renderer.VertexBufferUploader; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.WorldVertexBufferUploader; +import net.minecraft.client.renderer.vertex.VertexBuffer; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public class ChunkRenderDispatcher +{ + private static final Logger logger = LogManager.getLogger(); + private static final ThreadFactory threadFactory = (new ThreadFactoryBuilder()).setNameFormat("Chunk Batcher %d").setDaemon(true).build(); + private final List listThreadedWorkers; + private final BlockingQueue queueChunkUpdates; + private final BlockingQueue queueFreeRenderBuilders; + private final WorldVertexBufferUploader worldVertexUploader; + private final VertexBufferUploader vertexUploader; + private final Queue < ListenableFutureTask> queueChunkUploads; + private final ChunkRenderWorker renderWorker; + private final int countRenderBuilders; + private List listPausedBuilders; + + public ChunkRenderDispatcher() + { + this(-1); + } + + public ChunkRenderDispatcher(int p_i4_1_) + { + this.listThreadedWorkers = Lists.newArrayList(); + this.queueChunkUpdates = Queues.newArrayBlockingQueue(100); + this.worldVertexUploader = new WorldVertexBufferUploader(); + this.vertexUploader = new VertexBufferUploader(); + this.queueChunkUploads = Queues. < ListenableFutureTask> newArrayDeque(); + this.listPausedBuilders = new ArrayList(); + int i = Math.max(1, (int)((double)Runtime.getRuntime().maxMemory() * 0.3D) / 10485760); + int j = Math.max(1, MathHelper.clamp_int(Runtime.getRuntime().availableProcessors() - 2, 1, i / 5)); + + if (p_i4_1_ < 0) + { + this.countRenderBuilders = MathHelper.clamp_int(j * 8, 1, i); + } + else + { + this.countRenderBuilders = p_i4_1_; + } + + for (int k = 0; k < j; ++k) + { + ChunkRenderWorker chunkrenderworker = new ChunkRenderWorker(this); + Thread thread = threadFactory.newThread(chunkrenderworker); + thread.start(); + this.listThreadedWorkers.add(chunkrenderworker); + } + + this.queueFreeRenderBuilders = Queues.newArrayBlockingQueue(this.countRenderBuilders); + + for (int l = 0; l < this.countRenderBuilders; ++l) + { + this.queueFreeRenderBuilders.add(new RegionRenderCacheBuilder()); + } + + this.renderWorker = new ChunkRenderWorker(this, new RegionRenderCacheBuilder()); + } + + public String getDebugInfo() + { + return String.format("pC: %03d, pU: %1d, aB: %1d", new Object[] {Integer.valueOf(this.queueChunkUpdates.size()), Integer.valueOf(this.queueChunkUploads.size()), Integer.valueOf(this.queueFreeRenderBuilders.size())}); + } + + public boolean runChunkUploads(long p_178516_1_) + { + boolean flag = false; + + while (true) + { + boolean flag1 = false; + ListenableFutureTask listenablefuturetask = null; + + synchronized (this.queueChunkUploads) + { + listenablefuturetask = (ListenableFutureTask)this.queueChunkUploads.poll(); + } + + if (listenablefuturetask != null) + { + listenablefuturetask.run(); + flag1 = true; + flag = true; + } + + if (p_178516_1_ == 0L || !flag1) + { + break; + } + + long i = p_178516_1_ - System.nanoTime(); + + if (i < 0L) + { + break; + } + } + + return flag; + } + + public boolean updateChunkLater(RenderChunk chunkRenderer) + { + chunkRenderer.getLockCompileTask().lock(); + boolean flag; + + try + { + final ChunkCompileTaskGenerator chunkcompiletaskgenerator = chunkRenderer.makeCompileTaskChunk(); + chunkcompiletaskgenerator.addFinishRunnable(new Runnable() + { + public void run() + { + ChunkRenderDispatcher.this.queueChunkUpdates.remove(chunkcompiletaskgenerator); + } + }); + boolean flag1 = this.queueChunkUpdates.offer(chunkcompiletaskgenerator); + + if (!flag1) + { + chunkcompiletaskgenerator.finish(); + } + + flag = flag1; + } + finally + { + chunkRenderer.getLockCompileTask().unlock(); + } + + return flag; + } + + public boolean updateChunkNow(RenderChunk chunkRenderer) + { + chunkRenderer.getLockCompileTask().lock(); + boolean flag; + + try + { + ChunkCompileTaskGenerator chunkcompiletaskgenerator = chunkRenderer.makeCompileTaskChunk(); + + try + { + this.renderWorker.processTask(chunkcompiletaskgenerator); + } + catch (InterruptedException var8) + { + ; + } + + flag = true; + } + finally + { + chunkRenderer.getLockCompileTask().unlock(); + } + + return flag; + } + + public void stopChunkUpdates() + { + this.clearChunkUpdates(); + + while (this.runChunkUploads(0L)) + { + ; + } + + List list = Lists.newArrayList(); + + while (((List)list).size() != this.countRenderBuilders) + { + try + { + list.add(this.allocateRenderBuilder()); + } + catch (InterruptedException var3) + { + ; + } + } + + this.queueFreeRenderBuilders.addAll(list); + } + + public void freeRenderBuilder(RegionRenderCacheBuilder p_178512_1_) + { + this.queueFreeRenderBuilders.add(p_178512_1_); + } + + public RegionRenderCacheBuilder allocateRenderBuilder() throws InterruptedException + { + return (RegionRenderCacheBuilder)this.queueFreeRenderBuilders.take(); + } + + public ChunkCompileTaskGenerator getNextChunkUpdate() throws InterruptedException + { + return (ChunkCompileTaskGenerator)this.queueChunkUpdates.take(); + } + + public boolean updateTransparencyLater(RenderChunk chunkRenderer) + { + chunkRenderer.getLockCompileTask().lock(); + boolean flag1; + + try + { + final ChunkCompileTaskGenerator chunkcompiletaskgenerator = chunkRenderer.makeCompileTaskTransparency(); + + if (chunkcompiletaskgenerator != null) + { + chunkcompiletaskgenerator.addFinishRunnable(new Runnable() + { + public void run() + { + ChunkRenderDispatcher.this.queueChunkUpdates.remove(chunkcompiletaskgenerator); + } + }); + boolean flag2 = this.queueChunkUpdates.offer(chunkcompiletaskgenerator); + return flag2; + } + + boolean flag = true; + flag1 = flag; + } + finally + { + chunkRenderer.getLockCompileTask().unlock(); + } + + return flag1; + } + + public ListenableFuture uploadChunk(final EnumWorldBlockLayer player, final WorldRenderer p_178503_2_, final RenderChunk chunkRenderer, final CompiledChunk compiledChunkIn) + { + if (Minecraft.getMinecraft().isCallingFromMinecraftThread()) + { + if (OpenGlHelper.useVbo()) + { + this.uploadVertexBuffer(p_178503_2_, chunkRenderer.getVertexBufferByLayer(player.ordinal())); + } + else + { + this.uploadDisplayList(p_178503_2_, ((ListedRenderChunk)chunkRenderer).getDisplayList(player, compiledChunkIn), chunkRenderer); + } + + p_178503_2_.setTranslation(0.0D, 0.0D, 0.0D); + return Futures.immediateFuture((Object)null); + } + else + { + ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(new Runnable() + { + public void run() + { + ChunkRenderDispatcher.this.uploadChunk(player, p_178503_2_, chunkRenderer, compiledChunkIn); + } + }, (Object)null); + + synchronized (this.queueChunkUploads) + { + this.queueChunkUploads.add(listenablefuturetask); + return listenablefuturetask; + } + } + } + + private void uploadDisplayList(WorldRenderer p_178510_1_, int p_178510_2_, RenderChunk chunkRenderer) + { + GL11.glNewList(p_178510_2_, GL11.GL_COMPILE); + GlStateManager.pushMatrix(); + chunkRenderer.multModelviewMatrix(); + this.worldVertexUploader.draw(p_178510_1_); + GlStateManager.popMatrix(); + GL11.glEndList(); + } + + private void uploadVertexBuffer(WorldRenderer p_178506_1_, VertexBuffer vertexBufferIn) + { + this.vertexUploader.setVertexBuffer(vertexBufferIn); + this.vertexUploader.draw(p_178506_1_); + } + + public void clearChunkUpdates() + { + while (!this.queueChunkUpdates.isEmpty()) + { + ChunkCompileTaskGenerator chunkcompiletaskgenerator = (ChunkCompileTaskGenerator)this.queueChunkUpdates.poll(); + + if (chunkcompiletaskgenerator != null) + { + chunkcompiletaskgenerator.finish(); + } + } + } + + public boolean hasChunkUpdates() + { + return this.queueChunkUpdates.isEmpty() && this.queueChunkUploads.isEmpty(); + } + + public void pauseChunkUpdates() + { + while (this.listPausedBuilders.size() != this.countRenderBuilders) + { + try + { + this.runChunkUploads(Long.MAX_VALUE); + RegionRenderCacheBuilder regionrendercachebuilder = (RegionRenderCacheBuilder)this.queueFreeRenderBuilders.poll(100L, TimeUnit.MILLISECONDS); + + if (regionrendercachebuilder != null) + { + this.listPausedBuilders.add(regionrendercachebuilder); + } + } + catch (InterruptedException var2) + { + ; + } + } + } + + public void resumeChunkUpdates() + { + this.queueFreeRenderBuilders.addAll(this.listPausedBuilders); + this.listPausedBuilders.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java new file mode 100644 index 0000000..ed0b108 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ChunkRenderWorker.java @@ -0,0 +1,206 @@ +package net.minecraft.client.renderer.chunk; + +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CancellationException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RegionRenderCacheBuilder; +import net.minecraft.crash.CrashReport; +import net.minecraft.entity.Entity; +import net.minecraft.util.EnumWorldBlockLayer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ChunkRenderWorker implements Runnable +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final ChunkRenderDispatcher chunkRenderDispatcher; + private final RegionRenderCacheBuilder regionRenderCacheBuilder; + + public ChunkRenderWorker(ChunkRenderDispatcher p_i46201_1_) + { + this(p_i46201_1_, (RegionRenderCacheBuilder)null); + } + + public ChunkRenderWorker(ChunkRenderDispatcher chunkRenderDispatcherIn, RegionRenderCacheBuilder regionRenderCacheBuilderIn) + { + this.chunkRenderDispatcher = chunkRenderDispatcherIn; + this.regionRenderCacheBuilder = regionRenderCacheBuilderIn; + } + + public void run() + { + while (true) + { + try + { + this.processTask(this.chunkRenderDispatcher.getNextChunkUpdate()); + } + catch (InterruptedException var3) + { + LOGGER.debug("Stopping due to interrupt"); + return; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Batching chunks"); + Minecraft.getMinecraft().crashed(Minecraft.getMinecraft().addGraphicsAndWorldToCrashReport(crashreport)); + return; + } + } + } + + protected void processTask(final ChunkCompileTaskGenerator generator) throws InterruptedException + { + generator.getLock().lock(); + + try + { + if (generator.getStatus() != ChunkCompileTaskGenerator.Status.PENDING) + { + if (!generator.isFinished()) + { + LOGGER.warn("Chunk render task was " + generator.getStatus() + " when I expected it to be pending; ignoring task"); + } + + return; + } + + generator.setStatus(ChunkCompileTaskGenerator.Status.COMPILING); + } + finally + { + generator.getLock().unlock(); + } + + Entity lvt_2_1_ = Minecraft.getMinecraft().getRenderViewEntity(); + + if (lvt_2_1_ == null) + { + generator.finish(); + } + else + { + generator.setRegionRenderCacheBuilder(this.getRegionRenderCacheBuilder()); + float f = (float)lvt_2_1_.posX; + float f1 = (float)lvt_2_1_.posY + lvt_2_1_.getEyeHeight(); + float f2 = (float)lvt_2_1_.posZ; + ChunkCompileTaskGenerator.Type chunkcompiletaskgenerator$type = generator.getType(); + + if (chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) + { + generator.getRenderChunk().rebuildChunk(f, f1, f2, generator); + } + else if (chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.RESORT_TRANSPARENCY) + { + generator.getRenderChunk().resortTransparency(f, f1, f2, generator); + } + + generator.getLock().lock(); + + try + { + if (generator.getStatus() != ChunkCompileTaskGenerator.Status.COMPILING) + { + if (!generator.isFinished()) + { + LOGGER.warn("Chunk render task was " + generator.getStatus() + " when I expected it to be compiling; aborting task"); + } + + this.freeRenderBuilder(generator); + return; + } + + generator.setStatus(ChunkCompileTaskGenerator.Status.UPLOADING); + } + finally + { + generator.getLock().unlock(); + } + + final CompiledChunk lvt_7_1_ = generator.getCompiledChunk(); + ArrayList lvt_8_1_ = Lists.newArrayList(); + + if (chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.REBUILD_CHUNK) + { + for (EnumWorldBlockLayer enumworldblocklayer : EnumWorldBlockLayer.values()) + { + if (lvt_7_1_.isLayerStarted(enumworldblocklayer)) + { + lvt_8_1_.add(this.chunkRenderDispatcher.uploadChunk(enumworldblocklayer, generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer), generator.getRenderChunk(), lvt_7_1_)); + } + } + } + else if (chunkcompiletaskgenerator$type == ChunkCompileTaskGenerator.Type.RESORT_TRANSPARENCY) + { + lvt_8_1_.add(this.chunkRenderDispatcher.uploadChunk(EnumWorldBlockLayer.TRANSLUCENT, generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(EnumWorldBlockLayer.TRANSLUCENT), generator.getRenderChunk(), lvt_7_1_)); + } + + final ListenableFuture> listenablefuture = Futures.allAsList(lvt_8_1_); + generator.addFinishRunnable(new Runnable() + { + public void run() + { + listenablefuture.cancel(false); + } + }); + Futures.addCallback(listenablefuture, new FutureCallback>() + { + public void onSuccess(List p_onSuccess_1_) + { + ChunkRenderWorker.this.freeRenderBuilder(generator); + generator.getLock().lock(); + label21: + { + try + { + if (generator.getStatus() == ChunkCompileTaskGenerator.Status.UPLOADING) + { + generator.setStatus(ChunkCompileTaskGenerator.Status.DONE); + break label21; + } + + if (!generator.isFinished()) + { + ChunkRenderWorker.LOGGER.warn("Chunk render task was " + generator.getStatus() + " when I expected it to be uploading; aborting task"); + } + } + finally + { + generator.getLock().unlock(); + } + + return; + } + generator.getRenderChunk().setCompiledChunk(lvt_7_1_); + } + public void onFailure(Throwable p_onFailure_1_) + { + ChunkRenderWorker.this.freeRenderBuilder(generator); + + if (!(p_onFailure_1_ instanceof CancellationException) && !(p_onFailure_1_ instanceof InterruptedException)) + { + Minecraft.getMinecraft().crashed(CrashReport.makeCrashReport(p_onFailure_1_, "Rendering chunk")); + } + } + }); + } + } + + private RegionRenderCacheBuilder getRegionRenderCacheBuilder() throws InterruptedException + { + return this.regionRenderCacheBuilder != null ? this.regionRenderCacheBuilder : this.chunkRenderDispatcher.allocateRenderBuilder(); + } + + private void freeRenderBuilder(ChunkCompileTaskGenerator taskGenerator) + { + if (this.regionRenderCacheBuilder == null) + { + this.chunkRenderDispatcher.freeRenderBuilder(taskGenerator.getRegionRenderCacheBuilder()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/CompiledChunk.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/CompiledChunk.java new file mode 100644 index 0000000..a8cf996 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/CompiledChunk.java @@ -0,0 +1,105 @@ +package net.minecraft.client.renderer.chunk; + +import com.google.common.collect.Lists; +import java.util.BitSet; +import java.util.List; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; + +public class CompiledChunk +{ + public static final CompiledChunk DUMMY = new CompiledChunk() + { + protected void setLayerUsed(EnumWorldBlockLayer layer) + { + throw new UnsupportedOperationException(); + } + public void setLayerStarted(EnumWorldBlockLayer layer) + { + throw new UnsupportedOperationException(); + } + public boolean isVisible(EnumFacing facing, EnumFacing facing2) + { + return false; + } + public void setAnimatedSprites(EnumWorldBlockLayer p_setAnimatedSprites_1_, BitSet p_setAnimatedSprites_2_) + { + throw new UnsupportedOperationException(); + } + }; + private final boolean[] layersUsed = new boolean[RenderChunk.ENUM_WORLD_BLOCK_LAYERS.length]; + private final boolean[] layersStarted = new boolean[RenderChunk.ENUM_WORLD_BLOCK_LAYERS.length]; + private boolean empty = true; + private final List tileEntities = Lists.newArrayList(); + private SetVisibility setVisibility = new SetVisibility(); + private WorldRenderer.State state; + private BitSet[] animatedSprites = new BitSet[RenderChunk.ENUM_WORLD_BLOCK_LAYERS.length]; + + public boolean isEmpty() + { + return this.empty; + } + + protected void setLayerUsed(EnumWorldBlockLayer layer) + { + this.empty = false; + this.layersUsed[layer.ordinal()] = true; + } + + public boolean isLayerEmpty(EnumWorldBlockLayer layer) + { + return !this.layersUsed[layer.ordinal()]; + } + + public void setLayerStarted(EnumWorldBlockLayer layer) + { + this.layersStarted[layer.ordinal()] = true; + } + + public boolean isLayerStarted(EnumWorldBlockLayer layer) + { + return this.layersStarted[layer.ordinal()]; + } + + public List getTileEntities() + { + return this.tileEntities; + } + + public void addTileEntity(TileEntity tileEntityIn) + { + this.tileEntities.add(tileEntityIn); + } + + public boolean isVisible(EnumFacing facing, EnumFacing facing2) + { + return this.setVisibility.isVisible(facing, facing2); + } + + public void setVisibility(SetVisibility visibility) + { + this.setVisibility = visibility; + } + + public WorldRenderer.State getState() + { + return this.state; + } + + public void setState(WorldRenderer.State stateIn) + { + this.state = stateIn; + } + + public BitSet getAnimatedSprites(EnumWorldBlockLayer p_getAnimatedSprites_1_) + { + return this.animatedSprites[p_getAnimatedSprites_1_.ordinal()]; + } + + public void setAnimatedSprites(EnumWorldBlockLayer p_setAnimatedSprites_1_, BitSet p_setAnimatedSprites_2_) + { + this.animatedSprites[p_setAnimatedSprites_1_.ordinal()] = p_setAnimatedSprites_2_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/IRenderChunkFactory.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/IRenderChunkFactory.java new file mode 100644 index 0000000..787effc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/IRenderChunkFactory.java @@ -0,0 +1,10 @@ +package net.minecraft.client.renderer.chunk; + +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public interface IRenderChunkFactory +{ + RenderChunk makeRenderChunk(World worldIn, RenderGlobal globalRenderer, BlockPos pos, int index); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ListChunkFactory.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ListChunkFactory.java new file mode 100644 index 0000000..393dc0e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ListChunkFactory.java @@ -0,0 +1,13 @@ +package net.minecraft.client.renderer.chunk; + +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class ListChunkFactory implements IRenderChunkFactory +{ + public RenderChunk makeRenderChunk(World worldIn, RenderGlobal globalRenderer, BlockPos pos, int index) + { + return new ListedRenderChunk(worldIn, globalRenderer, pos, index); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ListedRenderChunk.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ListedRenderChunk.java new file mode 100644 index 0000000..32c1898 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/ListedRenderChunk.java @@ -0,0 +1,28 @@ +package net.minecraft.client.renderer.chunk; + +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.World; + +public class ListedRenderChunk extends RenderChunk +{ + private final int baseDisplayList = GLAllocation.generateDisplayLists(EnumWorldBlockLayer.values().length); + + public ListedRenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos pos, int indexIn) + { + super(worldIn, renderGlobalIn, pos, indexIn); + } + + public int getDisplayList(EnumWorldBlockLayer layer, CompiledChunk p_178600_2_) + { + return !p_178600_2_.isLayerEmpty(layer) ? this.baseDisplayList + layer.ordinal() : -1; + } + + public void deleteGlResources() + { + super.deleteGlResources(); + GLAllocation.deleteDisplayLists(this.baseDisplayList, EnumWorldBlockLayer.values().length); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/RenderChunk.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/RenderChunk.java new file mode 100644 index 0000000..cbea056 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/RenderChunk.java @@ -0,0 +1,779 @@ +package net.minecraft.client.renderer.chunk; + +import com.google.common.collect.Sets; +import java.nio.FloatBuffer; +import java.util.BitSet; +import java.util.EnumMap; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.ReentrantLock; +import net.minecraft.block.Block; +import net.minecraft.block.BlockCactus; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RegionRenderCache; +import net.minecraft.client.renderer.RegionRenderCacheBuilder; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.ViewFrustum; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.chunk.ChunkCompileTaskGenerator.Status; +import net.minecraft.client.renderer.chunk.ChunkCompileTaskGenerator.Type; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.renderer.vertex.VertexBuffer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.optifine.BlockPosM; +import net.optifine.CustomBlockLayers; +import net.optifine.override.ChunkCacheOF; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.render.AabbFrame; +import net.optifine.render.RenderEnv; +import net.optifine.shaders.SVertexBuilder; + +public class RenderChunk +{ + private final World world; + private final RenderGlobal renderGlobal; + public static int renderChunksUpdated; + private BlockPos position; + public CompiledChunk compiledChunk = CompiledChunk.DUMMY; + private final ReentrantLock lockCompileTask = new ReentrantLock(); + private final ReentrantLock lockCompiledChunk = new ReentrantLock(); + private ChunkCompileTaskGenerator compileTask = null; + private final Set setTileEntities = Sets.newHashSet(); + private final int index; + private final FloatBuffer modelviewMatrix = GLAllocation.createDirectFloatBuffer(16); + private final VertexBuffer[] vertexBuffers = new VertexBuffer[EnumWorldBlockLayer.values().length]; + public AxisAlignedBB boundingBox; + private int frameIndex = -1; + private boolean needsUpdate = true; + private EnumMap mapEnumFacing = null; + private BlockPos[] positionOffsets16 = new BlockPos[EnumFacing.VALUES.length]; + public static final EnumWorldBlockLayer[] ENUM_WORLD_BLOCK_LAYERS = EnumWorldBlockLayer.values(); + private final EnumWorldBlockLayer[] blockLayersSingle = new EnumWorldBlockLayer[1]; + private final boolean isMipmaps = Config.isMipmaps(); + private final boolean fixBlockLayer = !Reflector.BetterFoliageClient.exists(); + private boolean playerUpdate = false; + public int regionX; + public int regionZ; + private final RenderChunk[] renderChunksOfset16 = new RenderChunk[6]; + private boolean renderChunksOffset16Updated = false; + private Chunk chunk; + private RenderChunk[] renderChunkNeighbours = new RenderChunk[EnumFacing.VALUES.length]; + private RenderChunk[] renderChunkNeighboursValid = new RenderChunk[EnumFacing.VALUES.length]; + private boolean renderChunkNeighboursUpated = false; + private RenderGlobal.ContainerLocalRenderInformation renderInfo = new RenderGlobal.ContainerLocalRenderInformation(this, (EnumFacing)null, 0); + public AabbFrame boundingBoxParent; + + public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos blockPosIn, int indexIn) + { + this.world = worldIn; + this.renderGlobal = renderGlobalIn; + this.index = indexIn; + + if (!blockPosIn.equals(this.getPosition())) + { + this.setPosition(blockPosIn); + } + + if (OpenGlHelper.useVbo()) + { + for (int i = 0; i < EnumWorldBlockLayer.values().length; ++i) + { + this.vertexBuffers[i] = new VertexBuffer(DefaultVertexFormats.BLOCK); + } + } + } + + public boolean setFrameIndex(int frameIndexIn) + { + if (this.frameIndex == frameIndexIn) + { + return false; + } + else + { + this.frameIndex = frameIndexIn; + return true; + } + } + + public VertexBuffer getVertexBufferByLayer(int layer) + { + return this.vertexBuffers[layer]; + } + + public void setPosition(BlockPos pos) + { + this.stopCompileTask(); + this.position = pos; + int i = 8; + this.regionX = pos.getX() >> i << i; + this.regionZ = pos.getZ() >> i << i; + this.boundingBox = new AxisAlignedBB(pos, pos.add(16, 16, 16)); + this.initModelviewMatrix(); + + for (int j = 0; j < this.positionOffsets16.length; ++j) + { + this.positionOffsets16[j] = null; + } + + this.renderChunksOffset16Updated = false; + this.renderChunkNeighboursUpated = false; + + for (int k = 0; k < this.renderChunkNeighbours.length; ++k) + { + RenderChunk renderchunk = this.renderChunkNeighbours[k]; + + if (renderchunk != null) + { + renderchunk.renderChunkNeighboursUpated = false; + } + } + + this.chunk = null; + this.boundingBoxParent = null; + } + + public void resortTransparency(float x, float y, float z, ChunkCompileTaskGenerator generator) + { + CompiledChunk compiledchunk = generator.getCompiledChunk(); + + if (compiledchunk.getState() != null && !compiledchunk.isLayerEmpty(EnumWorldBlockLayer.TRANSLUCENT)) + { + WorldRenderer worldrenderer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(EnumWorldBlockLayer.TRANSLUCENT); + this.preRenderBlocks(worldrenderer, this.position); + worldrenderer.setVertexState(compiledchunk.getState()); + this.postRenderBlocks(EnumWorldBlockLayer.TRANSLUCENT, x, y, z, worldrenderer, compiledchunk); + } + } + + public void rebuildChunk(float x, float y, float z, ChunkCompileTaskGenerator generator) + { + CompiledChunk compiledchunk = new CompiledChunk(); + int i = 1; + BlockPos blockpos = new BlockPos(this.position); + BlockPos blockpos1 = blockpos.add(15, 15, 15); + generator.getLock().lock(); + + try + { + if (generator.getStatus() != Status.COMPILING) + { + return; + } + + generator.setCompiledChunk(compiledchunk); + } + finally + { + generator.getLock().unlock(); + } + + VisGraph lvt_10_1_ = new VisGraph(); + HashSet lvt_11_1_ = Sets.newHashSet(); + + if (!this.isChunkRegionEmpty(blockpos)) + { + ++renderChunksUpdated; + ChunkCacheOF chunkcacheof = this.makeChunkCacheOF(blockpos); + chunkcacheof.renderStart(); + boolean[] aboolean = new boolean[ENUM_WORLD_BLOCK_LAYERS.length]; + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + boolean flag = Reflector.ForgeBlock_canRenderInLayer.exists(); + boolean flag1 = Reflector.ForgeHooksClient_setRenderLayer.exists(); + + for (Object e : BlockPosM.getAllInBoxMutable(blockpos, blockpos1)) + { + BlockPosM blockposm = (BlockPosM) e; + IBlockState iblockstate = chunkcacheof.getBlockState(blockposm); + Block block = iblockstate.getBlock(); + + if (block.isOpaqueCube()) + { + lvt_10_1_.func_178606_a(blockposm); + } + + if (ReflectorForge.blockHasTileEntity(iblockstate)) + { + TileEntity tileentity = chunkcacheof.getTileEntity(new BlockPos(blockposm)); + TileEntitySpecialRenderer tileentityspecialrenderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(tileentity); + + if (tileentity != null && tileentityspecialrenderer != null) + { + compiledchunk.addTileEntity(tileentity); + + if (tileentityspecialrenderer.forceTileEntityRender()) + { + lvt_11_1_.add(tileentity); + } + } + } + + EnumWorldBlockLayer[] aenumworldblocklayer; + + if (flag) + { + aenumworldblocklayer = ENUM_WORLD_BLOCK_LAYERS; + } + else + { + aenumworldblocklayer = this.blockLayersSingle; + aenumworldblocklayer[0] = block.getBlockLayer(); + } + + for (int j = 0; j < aenumworldblocklayer.length; ++j) + { + EnumWorldBlockLayer enumworldblocklayer = aenumworldblocklayer[j]; + + if (flag) + { + boolean flag2 = Reflector.callBoolean(block, Reflector.ForgeBlock_canRenderInLayer, new Object[] {enumworldblocklayer}); + + if (!flag2) + { + continue; + } + } + + if (flag1) + { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderLayer, new Object[] {enumworldblocklayer}); + } + + enumworldblocklayer = this.fixBlockLayer(iblockstate, enumworldblocklayer); + int k = enumworldblocklayer.ordinal(); + + if (block.getRenderType() != -1) + { + WorldRenderer worldrenderer = generator.getRegionRenderCacheBuilder().getWorldRendererByLayerId(k); + worldrenderer.setBlockLayer(enumworldblocklayer); + RenderEnv renderenv = worldrenderer.getRenderEnv(iblockstate, blockposm); + renderenv.setRegionRenderCacheBuilder(generator.getRegionRenderCacheBuilder()); + + if (!compiledchunk.isLayerStarted(enumworldblocklayer)) + { + compiledchunk.setLayerStarted(enumworldblocklayer); + this.preRenderBlocks(worldrenderer, blockpos); + } + + aboolean[k] |= blockrendererdispatcher.renderBlock(iblockstate, blockposm, chunkcacheof, worldrenderer); + + if (renderenv.isOverlaysRendered()) + { + this.postRenderOverlays(generator.getRegionRenderCacheBuilder(), compiledchunk, aboolean); + renderenv.setOverlaysRendered(false); + } + } + } + + if (flag1) + { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderLayer, new Object[] {null}); + } + } + + for (EnumWorldBlockLayer enumworldblocklayer1 : ENUM_WORLD_BLOCK_LAYERS) + { + if (aboolean[enumworldblocklayer1.ordinal()]) + { + compiledchunk.setLayerUsed(enumworldblocklayer1); + } + + if (compiledchunk.isLayerStarted(enumworldblocklayer1)) + { + if (Config.isShaders()) + { + SVertexBuilder.calcNormalChunkLayer(generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer1)); + } + + WorldRenderer worldrenderer1 = generator.getRegionRenderCacheBuilder().getWorldRendererByLayer(enumworldblocklayer1); + this.postRenderBlocks(enumworldblocklayer1, x, y, z, worldrenderer1, compiledchunk); + + if (worldrenderer1.animatedSprites != null) + { + compiledchunk.setAnimatedSprites(enumworldblocklayer1, (BitSet)worldrenderer1.animatedSprites.clone()); + } + } + else + { + compiledchunk.setAnimatedSprites(enumworldblocklayer1, (BitSet)null); + } + } + + chunkcacheof.renderFinish(); + } + + compiledchunk.setVisibility(lvt_10_1_.computeVisibility()); + this.lockCompileTask.lock(); + + try + { + Set set = Sets.newHashSet(lvt_11_1_); + Set set1 = Sets.newHashSet(this.setTileEntities); + set.removeAll(this.setTileEntities); + set1.removeAll(lvt_11_1_); + this.setTileEntities.clear(); + this.setTileEntities.addAll(lvt_11_1_); + this.renderGlobal.updateTileEntities(set1, set); + } + finally + { + this.lockCompileTask.unlock(); + } + } + + protected void finishCompileTask() + { + this.lockCompileTask.lock(); + + try + { + if (this.compileTask != null && this.compileTask.getStatus() != Status.DONE) + { + this.compileTask.finish(); + this.compileTask = null; + } + } + finally + { + this.lockCompileTask.unlock(); + } + } + + public ReentrantLock getLockCompileTask() + { + return this.lockCompileTask; + } + + public ChunkCompileTaskGenerator makeCompileTaskChunk() + { + this.lockCompileTask.lock(); + ChunkCompileTaskGenerator chunkcompiletaskgenerator; + + try + { + this.finishCompileTask(); + this.compileTask = new ChunkCompileTaskGenerator(this, Type.REBUILD_CHUNK); + chunkcompiletaskgenerator = this.compileTask; + } + finally + { + this.lockCompileTask.unlock(); + } + + return chunkcompiletaskgenerator; + } + + public ChunkCompileTaskGenerator makeCompileTaskTransparency() + { + this.lockCompileTask.lock(); + ChunkCompileTaskGenerator chunkcompiletaskgenerator1; + + try + { + if (this.compileTask != null && this.compileTask.getStatus() == Status.PENDING) + { + ChunkCompileTaskGenerator chunkcompiletaskgenerator2 = null; + return chunkcompiletaskgenerator2; + } + + if (this.compileTask != null && this.compileTask.getStatus() != Status.DONE) + { + this.compileTask.finish(); + this.compileTask = null; + } + + this.compileTask = new ChunkCompileTaskGenerator(this, Type.RESORT_TRANSPARENCY); + this.compileTask.setCompiledChunk(this.compiledChunk); + ChunkCompileTaskGenerator chunkcompiletaskgenerator = this.compileTask; + chunkcompiletaskgenerator1 = chunkcompiletaskgenerator; + } + finally + { + this.lockCompileTask.unlock(); + } + + return chunkcompiletaskgenerator1; + } + + private void preRenderBlocks(WorldRenderer worldRendererIn, BlockPos pos) + { + worldRendererIn.begin(7, DefaultVertexFormats.BLOCK); + + if (Config.isRenderRegions()) + { + int i = 8; + int j = pos.getX() >> i << i; + int k = pos.getY() >> i << i; + int l = pos.getZ() >> i << i; + j = this.regionX; + l = this.regionZ; + worldRendererIn.setTranslation((double)(-j), (double)(-k), (double)(-l)); + } + else + { + worldRendererIn.setTranslation((double)(-pos.getX()), (double)(-pos.getY()), (double)(-pos.getZ())); + } + } + + private void postRenderBlocks(EnumWorldBlockLayer layer, float x, float y, float z, WorldRenderer worldRendererIn, CompiledChunk compiledChunkIn) + { + if (layer == EnumWorldBlockLayer.TRANSLUCENT && !compiledChunkIn.isLayerEmpty(layer)) + { + worldRendererIn.sortVertexData(x, y, z); + compiledChunkIn.setState(worldRendererIn.getVertexState()); + } + + worldRendererIn.finishDrawing(); + } + + private void initModelviewMatrix() + { + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + float f = 1.000001F; + GlStateManager.translate(-8.0F, -8.0F, -8.0F); + GlStateManager.scale(f, f, f); + GlStateManager.translate(8.0F, 8.0F, 8.0F); + GlStateManager.getFloat(2982, this.modelviewMatrix); + GlStateManager.popMatrix(); + } + + public void multModelviewMatrix() + { + GlStateManager.multMatrix(this.modelviewMatrix); + } + + public CompiledChunk getCompiledChunk() + { + return this.compiledChunk; + } + + public void setCompiledChunk(CompiledChunk compiledChunkIn) + { + this.lockCompiledChunk.lock(); + + try + { + this.compiledChunk = compiledChunkIn; + } + finally + { + this.lockCompiledChunk.unlock(); + } + } + + public void stopCompileTask() + { + this.finishCompileTask(); + this.compiledChunk = CompiledChunk.DUMMY; + } + + public void deleteGlResources() + { + this.stopCompileTask(); + + for (int i = 0; i < EnumWorldBlockLayer.values().length; ++i) + { + if (this.vertexBuffers[i] != null) + { + this.vertexBuffers[i].deleteGlBuffers(); + } + } + } + + public BlockPos getPosition() + { + return this.position; + } + + public void setNeedsUpdate(boolean needsUpdateIn) + { + this.needsUpdate = needsUpdateIn; + + if (needsUpdateIn) + { + if (this.isWorldPlayerUpdate()) + { + this.playerUpdate = true; + } + } + else + { + this.playerUpdate = false; + } + } + + public boolean isNeedsUpdate() + { + return this.needsUpdate; + } + + public BlockPos getBlockPosOffset16(EnumFacing p_181701_1_) + { + return this.getPositionOffset16(p_181701_1_); + } + + public BlockPos getPositionOffset16(EnumFacing p_getPositionOffset16_1_) + { + int i = p_getPositionOffset16_1_.getIndex(); + BlockPos blockpos = this.positionOffsets16[i]; + + if (blockpos == null) + { + blockpos = this.getPosition().offset(p_getPositionOffset16_1_, 16); + this.positionOffsets16[i] = blockpos; + } + + return blockpos; + } + + private boolean isWorldPlayerUpdate() + { + if (this.world instanceof WorldClient) + { + WorldClient worldclient = (WorldClient)this.world; + return worldclient.isPlayerUpdate(); + } + else + { + return false; + } + } + + public boolean isPlayerUpdate() + { + return this.playerUpdate; + } + + protected RegionRenderCache createRegionRenderCache(World p_createRegionRenderCache_1_, BlockPos p_createRegionRenderCache_2_, BlockPos p_createRegionRenderCache_3_, int p_createRegionRenderCache_4_) + { + return new RegionRenderCache(p_createRegionRenderCache_1_, p_createRegionRenderCache_2_, p_createRegionRenderCache_3_, p_createRegionRenderCache_4_); + } + + private EnumWorldBlockLayer fixBlockLayer(IBlockState p_fixBlockLayer_1_, EnumWorldBlockLayer p_fixBlockLayer_2_) + { + if (CustomBlockLayers.isActive()) + { + EnumWorldBlockLayer enumworldblocklayer = CustomBlockLayers.getRenderLayer(p_fixBlockLayer_1_); + + if (enumworldblocklayer != null) + { + return enumworldblocklayer; + } + } + + if (!this.fixBlockLayer) + { + return p_fixBlockLayer_2_; + } + else + { + if (this.isMipmaps) + { + if (p_fixBlockLayer_2_ == EnumWorldBlockLayer.CUTOUT) + { + Block block = p_fixBlockLayer_1_.getBlock(); + + if (block instanceof BlockRedstoneWire) + { + return p_fixBlockLayer_2_; + } + + if (block instanceof BlockCactus) + { + return p_fixBlockLayer_2_; + } + + return EnumWorldBlockLayer.CUTOUT_MIPPED; + } + } + else if (p_fixBlockLayer_2_ == EnumWorldBlockLayer.CUTOUT_MIPPED) + { + return EnumWorldBlockLayer.CUTOUT; + } + + return p_fixBlockLayer_2_; + } + } + + private void postRenderOverlays(RegionRenderCacheBuilder p_postRenderOverlays_1_, CompiledChunk p_postRenderOverlays_2_, boolean[] p_postRenderOverlays_3_) + { + this.postRenderOverlay(EnumWorldBlockLayer.CUTOUT, p_postRenderOverlays_1_, p_postRenderOverlays_2_, p_postRenderOverlays_3_); + this.postRenderOverlay(EnumWorldBlockLayer.CUTOUT_MIPPED, p_postRenderOverlays_1_, p_postRenderOverlays_2_, p_postRenderOverlays_3_); + this.postRenderOverlay(EnumWorldBlockLayer.TRANSLUCENT, p_postRenderOverlays_1_, p_postRenderOverlays_2_, p_postRenderOverlays_3_); + } + + private void postRenderOverlay(EnumWorldBlockLayer p_postRenderOverlay_1_, RegionRenderCacheBuilder p_postRenderOverlay_2_, CompiledChunk p_postRenderOverlay_3_, boolean[] p_postRenderOverlay_4_) + { + WorldRenderer worldrenderer = p_postRenderOverlay_2_.getWorldRendererByLayer(p_postRenderOverlay_1_); + + if (worldrenderer.isDrawing()) + { + p_postRenderOverlay_3_.setLayerStarted(p_postRenderOverlay_1_); + p_postRenderOverlay_4_[p_postRenderOverlay_1_.ordinal()] = true; + } + } + + private ChunkCacheOF makeChunkCacheOF(BlockPos p_makeChunkCacheOF_1_) + { + BlockPos blockpos = p_makeChunkCacheOF_1_.add(-1, -1, -1); + BlockPos blockpos1 = p_makeChunkCacheOF_1_.add(16, 16, 16); + ChunkCache chunkcache = this.createRegionRenderCache(this.world, blockpos, blockpos1, 1); + + if (Reflector.MinecraftForgeClient_onRebuildChunk.exists()) + { + Reflector.call(Reflector.MinecraftForgeClient_onRebuildChunk, new Object[] {this.world, p_makeChunkCacheOF_1_, chunkcache}); + } + + ChunkCacheOF chunkcacheof = new ChunkCacheOF(chunkcache, blockpos, blockpos1, 1); + return chunkcacheof; + } + + public RenderChunk getRenderChunkOffset16(ViewFrustum p_getRenderChunkOffset16_1_, EnumFacing p_getRenderChunkOffset16_2_) + { + if (!this.renderChunksOffset16Updated) + { + for (int i = 0; i < EnumFacing.VALUES.length; ++i) + { + EnumFacing enumfacing = EnumFacing.VALUES[i]; + BlockPos blockpos = this.getBlockPosOffset16(enumfacing); + this.renderChunksOfset16[i] = p_getRenderChunkOffset16_1_.getRenderChunk(blockpos); + } + + this.renderChunksOffset16Updated = true; + } + + return this.renderChunksOfset16[p_getRenderChunkOffset16_2_.ordinal()]; + } + + public Chunk getChunk() + { + return this.getChunk(this.position); + } + + private Chunk getChunk(BlockPos p_getChunk_1_) + { + Chunk chunk = this.chunk; + + if (chunk != null && chunk.isLoaded()) + { + return chunk; + } + else + { + chunk = this.world.getChunkFromBlockCoords(p_getChunk_1_); + this.chunk = chunk; + return chunk; + } + } + + public boolean isChunkRegionEmpty() + { + return this.isChunkRegionEmpty(this.position); + } + + private boolean isChunkRegionEmpty(BlockPos p_isChunkRegionEmpty_1_) + { + int i = p_isChunkRegionEmpty_1_.getY(); + int j = i + 15; + return this.getChunk(p_isChunkRegionEmpty_1_).getAreLevelsEmpty(i, j); + } + + public void setRenderChunkNeighbour(EnumFacing p_setRenderChunkNeighbour_1_, RenderChunk p_setRenderChunkNeighbour_2_) + { + this.renderChunkNeighbours[p_setRenderChunkNeighbour_1_.ordinal()] = p_setRenderChunkNeighbour_2_; + this.renderChunkNeighboursValid[p_setRenderChunkNeighbour_1_.ordinal()] = p_setRenderChunkNeighbour_2_; + } + + public RenderChunk getRenderChunkNeighbour(EnumFacing p_getRenderChunkNeighbour_1_) + { + if (!this.renderChunkNeighboursUpated) + { + this.updateRenderChunkNeighboursValid(); + } + + return this.renderChunkNeighboursValid[p_getRenderChunkNeighbour_1_.ordinal()]; + } + + public RenderGlobal.ContainerLocalRenderInformation getRenderInfo() + { + return this.renderInfo; + } + + private void updateRenderChunkNeighboursValid() + { + int i = this.getPosition().getX(); + int j = this.getPosition().getZ(); + int k = EnumFacing.NORTH.ordinal(); + int l = EnumFacing.SOUTH.ordinal(); + int i1 = EnumFacing.WEST.ordinal(); + int j1 = EnumFacing.EAST.ordinal(); + this.renderChunkNeighboursValid[k] = this.renderChunkNeighbours[k].getPosition().getZ() == j - 16 ? this.renderChunkNeighbours[k] : null; + this.renderChunkNeighboursValid[l] = this.renderChunkNeighbours[l].getPosition().getZ() == j + 16 ? this.renderChunkNeighbours[l] : null; + this.renderChunkNeighboursValid[i1] = this.renderChunkNeighbours[i1].getPosition().getX() == i - 16 ? this.renderChunkNeighbours[i1] : null; + this.renderChunkNeighboursValid[j1] = this.renderChunkNeighbours[j1].getPosition().getX() == i + 16 ? this.renderChunkNeighbours[j1] : null; + this.renderChunkNeighboursUpated = true; + } + + public boolean isBoundingBoxInFrustum(ICamera p_isBoundingBoxInFrustum_1_, int p_isBoundingBoxInFrustum_2_) + { + return this.getBoundingBoxParent().isBoundingBoxInFrustumFully(p_isBoundingBoxInFrustum_1_, p_isBoundingBoxInFrustum_2_) ? true : p_isBoundingBoxInFrustum_1_.isBoundingBoxInFrustum(this.boundingBox); + } + + public AabbFrame getBoundingBoxParent() + { + if (this.boundingBoxParent == null) + { + BlockPos blockpos = this.getPosition(); + int i = blockpos.getX(); + int j = blockpos.getY(); + int k = blockpos.getZ(); + int l = 5; + int i1 = i >> l << l; + int j1 = j >> l << l; + int k1 = k >> l << l; + + if (i1 != i || j1 != j || k1 != k) + { + AabbFrame aabbframe = this.renderGlobal.getRenderChunk(new BlockPos(i1, j1, k1)).getBoundingBoxParent(); + + if (aabbframe != null && aabbframe.minX == (double)i1 && aabbframe.minY == (double)j1 && aabbframe.minZ == (double)k1) + { + this.boundingBoxParent = aabbframe; + } + } + + if (this.boundingBoxParent == null) + { + int l1 = 1 << l; + this.boundingBoxParent = new AabbFrame((double)i1, (double)j1, (double)k1, (double)(i1 + l1), (double)(j1 + l1), (double)(k1 + l1)); + } + } + + return this.boundingBoxParent; + } + + public String toString() + { + return "pos: " + this.getPosition() + ", frameIndex: " + this.frameIndex; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/SetVisibility.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/SetVisibility.java new file mode 100644 index 0000000..522bb38 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/SetVisibility.java @@ -0,0 +1,106 @@ +package net.minecraft.client.renderer.chunk; + +import java.util.Set; +import net.minecraft.util.EnumFacing; + +public class SetVisibility +{ + private static final int COUNT_FACES = EnumFacing.values().length; + private long bits; + + public void setManyVisible(Set p_178620_1_) + { + for (EnumFacing enumfacing : p_178620_1_) + { + for (EnumFacing enumfacing1 : p_178620_1_) + { + this.setVisible(enumfacing, enumfacing1, true); + } + } + } + + public void setVisible(EnumFacing facing, EnumFacing facing2, boolean p_178619_3_) + { + this.setBit(facing.ordinal() + facing2.ordinal() * COUNT_FACES, p_178619_3_); + this.setBit(facing2.ordinal() + facing.ordinal() * COUNT_FACES, p_178619_3_); + } + + public void setAllVisible(boolean visible) + { + if (visible) + { + this.bits = -1L; + } + else + { + this.bits = 0L; + } + } + + public boolean isVisible(EnumFacing facing, EnumFacing facing2) + { + return this.getBit(facing.ordinal() + facing2.ordinal() * COUNT_FACES); + } + + public String toString() + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append(' '); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + stringbuilder.append(' ').append(enumfacing.toString().toUpperCase().charAt(0)); + } + + stringbuilder.append('\n'); + + for (EnumFacing enumfacing2 : EnumFacing.values()) + { + stringbuilder.append(enumfacing2.toString().toUpperCase().charAt(0)); + + for (EnumFacing enumfacing1 : EnumFacing.values()) + { + if (enumfacing2 == enumfacing1) + { + stringbuilder.append(" "); + } + else + { + boolean flag = this.isVisible(enumfacing2, enumfacing1); + stringbuilder.append(' ').append((char)(flag ? 'Y' : 'n')); + } + } + + stringbuilder.append('\n'); + } + + return stringbuilder.toString(); + } + + private boolean getBit(int p_getBit_1_) + { + return (this.bits & (long)(1 << p_getBit_1_)) != 0L; + } + + private void setBit(int p_setBit_1_, boolean p_setBit_2_) + { + if (p_setBit_2_) + { + this.setBit(p_setBit_1_); + } + else + { + this.clearBit(p_setBit_1_); + } + } + + private void setBit(int p_setBit_1_) + { + this.bits |= (long)(1 << p_setBit_1_); + } + + private void clearBit(int p_clearBit_1_) + { + this.bits &= (long)(~(1 << p_clearBit_1_)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/VboChunkFactory.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/VboChunkFactory.java new file mode 100644 index 0000000..748f3d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/VboChunkFactory.java @@ -0,0 +1,13 @@ +package net.minecraft.client.renderer.chunk; + +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class VboChunkFactory implements IRenderChunkFactory +{ + public RenderChunk makeRenderChunk(World worldIn, RenderGlobal globalRenderer, BlockPos pos, int index) + { + return new RenderChunk(worldIn, globalRenderer, pos, index); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/VisGraph.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/VisGraph.java new file mode 100644 index 0000000..27889b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/chunk/VisGraph.java @@ -0,0 +1,208 @@ +package net.minecraft.client.renderer.chunk; + +import java.util.ArrayDeque; +import java.util.BitSet; +import java.util.EnumSet; +import java.util.Queue; +import java.util.Set; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IntegerCache; + +public class VisGraph +{ + private static final int field_178616_a = (int)Math.pow(16.0D, 0.0D); + private static final int field_178614_b = (int)Math.pow(16.0D, 1.0D); + private static final int field_178615_c = (int)Math.pow(16.0D, 2.0D); + private final BitSet field_178612_d = new BitSet(4096); + private static final int[] field_178613_e = new int[1352]; + private int field_178611_f = 4096; + + public void func_178606_a(BlockPos pos) + { + this.field_178612_d.set(getIndex(pos), true); + --this.field_178611_f; + } + + private static int getIndex(BlockPos pos) + { + return getIndex(pos.getX() & 15, pos.getY() & 15, pos.getZ() & 15); + } + + private static int getIndex(int x, int y, int z) + { + return x << 0 | y << 8 | z << 4; + } + + public SetVisibility computeVisibility() + { + SetVisibility setvisibility = new SetVisibility(); + + if (4096 - this.field_178611_f < 256) + { + setvisibility.setAllVisible(true); + } + else if (this.field_178611_f == 0) + { + setvisibility.setAllVisible(false); + } + else + { + for (int i : field_178613_e) + { + if (!this.field_178612_d.get(i)) + { + setvisibility.setManyVisible(this.func_178604_a(i)); + } + } + } + + return setvisibility; + } + + public Set func_178609_b(BlockPos pos) + { + return this.func_178604_a(getIndex(pos)); + } + + private Set func_178604_a(int p_178604_1_) + { + Set set = EnumSet.noneOf(EnumFacing.class); + Queue queue = new ArrayDeque(384); + queue.add(IntegerCache.getInteger(p_178604_1_)); + this.field_178612_d.set(p_178604_1_, true); + + while (!((Queue)queue).isEmpty()) + { + int i = ((Integer)queue.poll()).intValue(); + this.func_178610_a(i, set); + + for (EnumFacing enumfacing : EnumFacing.VALUES) + { + int j = this.func_178603_a(i, enumfacing); + + if (j >= 0 && !this.field_178612_d.get(j)) + { + this.field_178612_d.set(j, true); + queue.add(IntegerCache.getInteger(j)); + } + } + } + + return set; + } + + private void func_178610_a(int p_178610_1_, Set p_178610_2_) + { + int i = p_178610_1_ >> 0 & 15; + + if (i == 0) + { + p_178610_2_.add(EnumFacing.WEST); + } + else if (i == 15) + { + p_178610_2_.add(EnumFacing.EAST); + } + + int j = p_178610_1_ >> 8 & 15; + + if (j == 0) + { + p_178610_2_.add(EnumFacing.DOWN); + } + else if (j == 15) + { + p_178610_2_.add(EnumFacing.UP); + } + + int k = p_178610_1_ >> 4 & 15; + + if (k == 0) + { + p_178610_2_.add(EnumFacing.NORTH); + } + else if (k == 15) + { + p_178610_2_.add(EnumFacing.SOUTH); + } + } + + private int func_178603_a(int p_178603_1_, EnumFacing p_178603_2_) + { + switch (p_178603_2_) + { + case DOWN: + if ((p_178603_1_ >> 8 & 15) == 0) + { + return -1; + } + + return p_178603_1_ - field_178615_c; + + case UP: + if ((p_178603_1_ >> 8 & 15) == 15) + { + return -1; + } + + return p_178603_1_ + field_178615_c; + + case NORTH: + if ((p_178603_1_ >> 4 & 15) == 0) + { + return -1; + } + + return p_178603_1_ - field_178614_b; + + case SOUTH: + if ((p_178603_1_ >> 4 & 15) == 15) + { + return -1; + } + + return p_178603_1_ + field_178614_b; + + case WEST: + if ((p_178603_1_ >> 0 & 15) == 0) + { + return -1; + } + + return p_178603_1_ - field_178616_a; + + case EAST: + if ((p_178603_1_ >> 0 & 15) == 15) + { + return -1; + } + + return p_178603_1_ + field_178616_a; + + default: + return -1; + } + } + + static + { + int i = 0; + int j = 15; + int k = 0; + + for (int l = 0; l < 16; ++l) + { + for (int i1 = 0; i1 < 16; ++i1) + { + for (int j1 = 0; j1 < 16; ++j1) + { + if (l == 0 || l == 15 || i1 == 0 || i1 == 15 || j1 == 0 || j1 == 15) + { + field_178613_e[k++] = getIndex(l, i1, j1); + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java new file mode 100644 index 0000000..d092f31 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java @@ -0,0 +1,88 @@ +package net.minecraft.client.renderer.culling; + +public class ClippingHelper +{ + public float[][] frustum = new float[6][4]; + public float[] projectionMatrix = new float[16]; + public float[] modelviewMatrix = new float[16]; + public float[] clippingMatrix = new float[16]; + public boolean disabled = false; + + private float dot(float[] p_dot_1_, float p_dot_2_, float p_dot_3_, float p_dot_4_) + { + return p_dot_1_[0] * p_dot_2_ + p_dot_1_[1] * p_dot_3_ + p_dot_1_[2] * p_dot_4_ + p_dot_1_[3]; + } + + public boolean isBoxInFrustum(double p_78553_1_, double p_78553_3_, double p_78553_5_, double p_78553_7_, double p_78553_9_, double p_78553_11_) + { + if (this.disabled) + { + return true; + } + else + { + float f = (float)p_78553_1_; + float f1 = (float)p_78553_3_; + float f2 = (float)p_78553_5_; + float f3 = (float)p_78553_7_; + float f4 = (float)p_78553_9_; + float f5 = (float)p_78553_11_; + + for (int i = 0; i < 6; ++i) + { + float[] afloat = this.frustum[i]; + float f6 = afloat[0]; + float f7 = afloat[1]; + float f8 = afloat[2]; + float f9 = afloat[3]; + + if (f6 * f + f7 * f1 + f8 * f2 + f9 <= 0.0F && f6 * f3 + f7 * f1 + f8 * f2 + f9 <= 0.0F && f6 * f + f7 * f4 + f8 * f2 + f9 <= 0.0F && f6 * f3 + f7 * f4 + f8 * f2 + f9 <= 0.0F && f6 * f + f7 * f1 + f8 * f5 + f9 <= 0.0F && f6 * f3 + f7 * f1 + f8 * f5 + f9 <= 0.0F && f6 * f + f7 * f4 + f8 * f5 + f9 <= 0.0F && f6 * f3 + f7 * f4 + f8 * f5 + f9 <= 0.0F) + { + return false; + } + } + + return true; + } + } + + public boolean isBoxInFrustumFully(double p_isBoxInFrustumFully_1_, double p_isBoxInFrustumFully_3_, double p_isBoxInFrustumFully_5_, double p_isBoxInFrustumFully_7_, double p_isBoxInFrustumFully_9_, double p_isBoxInFrustumFully_11_) + { + if (this.disabled) + { + return true; + } + else + { + float f = (float)p_isBoxInFrustumFully_1_; + float f1 = (float)p_isBoxInFrustumFully_3_; + float f2 = (float)p_isBoxInFrustumFully_5_; + float f3 = (float)p_isBoxInFrustumFully_7_; + float f4 = (float)p_isBoxInFrustumFully_9_; + float f5 = (float)p_isBoxInFrustumFully_11_; + + for (int i = 0; i < 6; ++i) + { + float[] afloat = this.frustum[i]; + float f6 = afloat[0]; + float f7 = afloat[1]; + float f8 = afloat[2]; + float f9 = afloat[3]; + + if (i < 4) + { + if (f6 * f + f7 * f1 + f8 * f2 + f9 <= 0.0F || f6 * f3 + f7 * f1 + f8 * f2 + f9 <= 0.0F || f6 * f + f7 * f4 + f8 * f2 + f9 <= 0.0F || f6 * f3 + f7 * f4 + f8 * f2 + f9 <= 0.0F || f6 * f + f7 * f1 + f8 * f5 + f9 <= 0.0F || f6 * f3 + f7 * f1 + f8 * f5 + f9 <= 0.0F || f6 * f + f7 * f4 + f8 * f5 + f9 <= 0.0F || f6 * f3 + f7 * f4 + f8 * f5 + f9 <= 0.0F) + { + return false; + } + } + else if (f6 * f + f7 * f1 + f8 * f2 + f9 <= 0.0F && f6 * f3 + f7 * f1 + f8 * f2 + f9 <= 0.0F && f6 * f + f7 * f4 + f8 * f2 + f9 <= 0.0F && f6 * f3 + f7 * f4 + f8 * f2 + f9 <= 0.0F && f6 * f + f7 * f1 + f8 * f5 + f9 <= 0.0F && f6 * f3 + f7 * f1 + f8 * f5 + f9 <= 0.0F && f6 * f + f7 * f4 + f8 * f5 + f9 <= 0.0F && f6 * f3 + f7 * f4 + f8 * f5 + f9 <= 0.0F) + { + return false; + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java new file mode 100644 index 0000000..2ccb7d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java @@ -0,0 +1,96 @@ +package net.minecraft.client.renderer.culling; + +import java.nio.FloatBuffer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; + +public class ClippingHelperImpl extends ClippingHelper +{ + private static ClippingHelperImpl instance = new ClippingHelperImpl(); + private FloatBuffer projectionMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); + private FloatBuffer modelviewMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); + private FloatBuffer field_78564_h = GLAllocation.createDirectFloatBuffer(16); + + public static ClippingHelper getInstance() + { + instance.init(); + return instance; + } + + private void normalize(float[] p_180547_1_) + { + float f = MathHelper.sqrt_float(p_180547_1_[0] * p_180547_1_[0] + p_180547_1_[1] * p_180547_1_[1] + p_180547_1_[2] * p_180547_1_[2]); + p_180547_1_[0] /= f; + p_180547_1_[1] /= f; + p_180547_1_[2] /= f; + p_180547_1_[3] /= f; + } + + public void init() + { + this.projectionMatrixBuffer.clear(); + this.modelviewMatrixBuffer.clear(); + this.field_78564_h.clear(); + GlStateManager.getFloat(2983, this.projectionMatrixBuffer); + GlStateManager.getFloat(2982, this.modelviewMatrixBuffer); + float[] afloat = this.projectionMatrix; + float[] afloat1 = this.modelviewMatrix; + this.projectionMatrixBuffer.flip().limit(16); + this.projectionMatrixBuffer.get(afloat); + this.modelviewMatrixBuffer.flip().limit(16); + this.modelviewMatrixBuffer.get(afloat1); + this.clippingMatrix[0] = afloat1[0] * afloat[0] + afloat1[1] * afloat[4] + afloat1[2] * afloat[8] + afloat1[3] * afloat[12]; + this.clippingMatrix[1] = afloat1[0] * afloat[1] + afloat1[1] * afloat[5] + afloat1[2] * afloat[9] + afloat1[3] * afloat[13]; + this.clippingMatrix[2] = afloat1[0] * afloat[2] + afloat1[1] * afloat[6] + afloat1[2] * afloat[10] + afloat1[3] * afloat[14]; + this.clippingMatrix[3] = afloat1[0] * afloat[3] + afloat1[1] * afloat[7] + afloat1[2] * afloat[11] + afloat1[3] * afloat[15]; + this.clippingMatrix[4] = afloat1[4] * afloat[0] + afloat1[5] * afloat[4] + afloat1[6] * afloat[8] + afloat1[7] * afloat[12]; + this.clippingMatrix[5] = afloat1[4] * afloat[1] + afloat1[5] * afloat[5] + afloat1[6] * afloat[9] + afloat1[7] * afloat[13]; + this.clippingMatrix[6] = afloat1[4] * afloat[2] + afloat1[5] * afloat[6] + afloat1[6] * afloat[10] + afloat1[7] * afloat[14]; + this.clippingMatrix[7] = afloat1[4] * afloat[3] + afloat1[5] * afloat[7] + afloat1[6] * afloat[11] + afloat1[7] * afloat[15]; + this.clippingMatrix[8] = afloat1[8] * afloat[0] + afloat1[9] * afloat[4] + afloat1[10] * afloat[8] + afloat1[11] * afloat[12]; + this.clippingMatrix[9] = afloat1[8] * afloat[1] + afloat1[9] * afloat[5] + afloat1[10] * afloat[9] + afloat1[11] * afloat[13]; + this.clippingMatrix[10] = afloat1[8] * afloat[2] + afloat1[9] * afloat[6] + afloat1[10] * afloat[10] + afloat1[11] * afloat[14]; + this.clippingMatrix[11] = afloat1[8] * afloat[3] + afloat1[9] * afloat[7] + afloat1[10] * afloat[11] + afloat1[11] * afloat[15]; + this.clippingMatrix[12] = afloat1[12] * afloat[0] + afloat1[13] * afloat[4] + afloat1[14] * afloat[8] + afloat1[15] * afloat[12]; + this.clippingMatrix[13] = afloat1[12] * afloat[1] + afloat1[13] * afloat[5] + afloat1[14] * afloat[9] + afloat1[15] * afloat[13]; + this.clippingMatrix[14] = afloat1[12] * afloat[2] + afloat1[13] * afloat[6] + afloat1[14] * afloat[10] + afloat1[15] * afloat[14]; + this.clippingMatrix[15] = afloat1[12] * afloat[3] + afloat1[13] * afloat[7] + afloat1[14] * afloat[11] + afloat1[15] * afloat[15]; + float[] afloat2 = this.frustum[0]; + afloat2[0] = this.clippingMatrix[3] - this.clippingMatrix[0]; + afloat2[1] = this.clippingMatrix[7] - this.clippingMatrix[4]; + afloat2[2] = this.clippingMatrix[11] - this.clippingMatrix[8]; + afloat2[3] = this.clippingMatrix[15] - this.clippingMatrix[12]; + this.normalize(afloat2); + float[] afloat3 = this.frustum[1]; + afloat3[0] = this.clippingMatrix[3] + this.clippingMatrix[0]; + afloat3[1] = this.clippingMatrix[7] + this.clippingMatrix[4]; + afloat3[2] = this.clippingMatrix[11] + this.clippingMatrix[8]; + afloat3[3] = this.clippingMatrix[15] + this.clippingMatrix[12]; + this.normalize(afloat3); + float[] afloat4 = this.frustum[2]; + afloat4[0] = this.clippingMatrix[3] + this.clippingMatrix[1]; + afloat4[1] = this.clippingMatrix[7] + this.clippingMatrix[5]; + afloat4[2] = this.clippingMatrix[11] + this.clippingMatrix[9]; + afloat4[3] = this.clippingMatrix[15] + this.clippingMatrix[13]; + this.normalize(afloat4); + float[] afloat5 = this.frustum[3]; + afloat5[0] = this.clippingMatrix[3] - this.clippingMatrix[1]; + afloat5[1] = this.clippingMatrix[7] - this.clippingMatrix[5]; + afloat5[2] = this.clippingMatrix[11] - this.clippingMatrix[9]; + afloat5[3] = this.clippingMatrix[15] - this.clippingMatrix[13]; + this.normalize(afloat5); + float[] afloat6 = this.frustum[4]; + afloat6[0] = this.clippingMatrix[3] - this.clippingMatrix[2]; + afloat6[1] = this.clippingMatrix[7] - this.clippingMatrix[6]; + afloat6[2] = this.clippingMatrix[11] - this.clippingMatrix[10]; + afloat6[3] = this.clippingMatrix[15] - this.clippingMatrix[14]; + this.normalize(afloat6); + float[] afloat7 = this.frustum[5]; + afloat7[0] = this.clippingMatrix[3] + this.clippingMatrix[2]; + afloat7[1] = this.clippingMatrix[7] + this.clippingMatrix[6]; + afloat7[2] = this.clippingMatrix[11] + this.clippingMatrix[10]; + afloat7[3] = this.clippingMatrix[15] + this.clippingMatrix[14]; + this.normalize(afloat7); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/Frustum.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/Frustum.java new file mode 100644 index 0000000..d0c621f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/Frustum.java @@ -0,0 +1,43 @@ +package net.minecraft.client.renderer.culling; + +import net.minecraft.util.AxisAlignedBB; + +public class Frustum implements ICamera +{ + private ClippingHelper clippingHelper; + private double xPosition; + private double yPosition; + private double zPosition; + + public Frustum() + { + this(ClippingHelperImpl.getInstance()); + } + + public Frustum(ClippingHelper p_i46196_1_) + { + this.clippingHelper = p_i46196_1_; + } + + public void setPosition(double p_78547_1_, double p_78547_3_, double p_78547_5_) + { + this.xPosition = p_78547_1_; + this.yPosition = p_78547_3_; + this.zPosition = p_78547_5_; + } + + public boolean isBoxInFrustum(double p_78548_1_, double p_78548_3_, double p_78548_5_, double p_78548_7_, double p_78548_9_, double p_78548_11_) + { + return this.clippingHelper.isBoxInFrustum(p_78548_1_ - this.xPosition, p_78548_3_ - this.yPosition, p_78548_5_ - this.zPosition, p_78548_7_ - this.xPosition, p_78548_9_ - this.yPosition, p_78548_11_ - this.zPosition); + } + + public boolean isBoundingBoxInFrustum(AxisAlignedBB p_78546_1_) + { + return this.isBoxInFrustum(p_78546_1_.minX, p_78546_1_.minY, p_78546_1_.minZ, p_78546_1_.maxX, p_78546_1_.maxY, p_78546_1_.maxZ); + } + + public boolean isBoxInFrustumFully(double p_isBoxInFrustumFully_1_, double p_isBoxInFrustumFully_3_, double p_isBoxInFrustumFully_5_, double p_isBoxInFrustumFully_7_, double p_isBoxInFrustumFully_9_, double p_isBoxInFrustumFully_11_) + { + return this.clippingHelper.isBoxInFrustumFully(p_isBoxInFrustumFully_1_ - this.xPosition, p_isBoxInFrustumFully_3_ - this.yPosition, p_isBoxInFrustumFully_5_ - this.zPosition, p_isBoxInFrustumFully_7_ - this.xPosition, p_isBoxInFrustumFully_9_ - this.yPosition, p_isBoxInFrustumFully_11_ - this.zPosition); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ICamera.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ICamera.java new file mode 100644 index 0000000..19ac5a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/culling/ICamera.java @@ -0,0 +1,10 @@ +package net.minecraft.client.renderer.culling; + +import net.minecraft.util.AxisAlignedBB; + +public interface ICamera +{ + boolean isBoundingBoxInFrustum(AxisAlignedBB p_78546_1_); + + void setPosition(double p_78547_1_, double p_78547_3_, double p_78547_5_); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java new file mode 100644 index 0000000..8c2a44b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java @@ -0,0 +1,51 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelArmorStand; +import net.minecraft.client.model.ModelArmorStandArmor; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; +import net.minecraft.client.renderer.entity.layers.LayerCustomHead; +import net.minecraft.client.renderer.entity.layers.LayerHeldItem; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.util.ResourceLocation; + +public class ArmorStandRenderer extends RendererLivingEntity +{ + public static final ResourceLocation TEXTURE_ARMOR_STAND = new ResourceLocation("textures/entity/armorstand/wood.png"); + + public ArmorStandRenderer(RenderManager p_i46195_1_) + { + super(p_i46195_1_, new ModelArmorStand(), 0.0F); + LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) + { + protected void initArmor() + { + this.modelLeggings = new ModelArmorStandArmor(0.5F); + this.modelArmor = new ModelArmorStandArmor(1.0F); + } + }; + this.addLayer(layerbipedarmor); + this.addLayer(new LayerHeldItem(this)); + this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead)); + } + + protected ResourceLocation getEntityTexture(EntityArmorStand entity) + { + return TEXTURE_ARMOR_STAND; + } + + public ModelArmorStand getMainModel() + { + return (ModelArmorStand)super.getMainModel(); + } + + protected void rotateCorpse(EntityArmorStand bat, float p_77043_2_, float p_77043_3_, float partialTicks) + { + GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + } + + protected boolean canRenderName(EntityArmorStand entity) + { + return entity.getAlwaysRenderNameTag(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/Render.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/Render.java new file mode 100644 index 0000000..cf59c7c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/Render.java @@ -0,0 +1,496 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import com.cheatbreaker.client.module.impl.normal.misc.ModulePackTweaks; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleNameTag; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.src.Config; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.optifine.entity.model.IEntityRenderer; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.List; +import java.util.regex.Pattern; + +public abstract class Render implements IEntityRenderer +{ + private static final ResourceLocation shadowTextures = new ResourceLocation("textures/misc/shadow.png"); + protected final RenderManager renderManager; + public float shadowSize; + protected float shadowOpaque = 1.0F; + private Class entityClass = null; + private ResourceLocation locationTextureCustom = null; + + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + + protected Render(RenderManager renderManager) + { + this.renderManager = renderManager; + } + + public boolean shouldRender(T livingEntity, ICamera camera, double camX, double camY, double camZ) + { + AxisAlignedBB axisalignedbb = livingEntity.getEntityBoundingBox(); + + if (axisalignedbb.hasNaN() || axisalignedbb.getAverageEdgeLength() == 0.0D) + { + axisalignedbb = new AxisAlignedBB(livingEntity.posX - 2.0D, livingEntity.posY - 2.0D, livingEntity.posZ - 2.0D, livingEntity.posX + 2.0D, livingEntity.posY + 2.0D, livingEntity.posZ + 2.0D); + } + + return livingEntity.isInRangeToRender3d(camX, camY, camZ) && (livingEntity.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(axisalignedbb)); + } + + public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) + { + this.renderName(entity, x, y, z); + } + + protected void renderName(T entity, double x, double y, double z) + { + if (this.canRenderName(entity)) + { + this.renderLivingLabel(entity, entity.getDisplayName().getFormattedText(), x, y, z, 64); + } + } + + protected boolean canRenderName(T entity) + { + return entity.getAlwaysRenderNameTagForRender() && entity.hasCustomName(); + } + + protected void renderOffsetLivingLabel(T entityIn, double x, double y, double z, String str, float p_177069_9_, double p_177069_10_) + { + this.renderLivingLabel(entityIn, str, x, y, z, 64); + } + + protected abstract ResourceLocation getEntityTexture(T entity); + + protected boolean bindEntityTexture(T entity) + { + ResourceLocation resourcelocation = this.getEntityTexture(entity); + + if (this.locationTextureCustom != null) + { + resourcelocation = this.locationTextureCustom; + } + + if (resourcelocation == null) + { + return false; + } + else + { + this.bindTexture(resourcelocation); + return true; + } + } + + public void bindTexture(ResourceLocation location) + { + this.renderManager.renderEngine.bindTexture(location); + } + + private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks) + { + GlStateManager.disableLighting(); + TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks(); + TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0"); + TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1"); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + float f = entity.width * 1.4F; + GlStateManager.scale(f, f, f); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + float f1 = 0.5F; + float f2 = 0.0F; + float f3 = entity.height / f; + float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY); + GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + float f5 = 0.0F; + int i = 0; + boolean flag = Config.isMultiTexture(); + + if (flag) + { + worldrenderer.setBlockLayer(EnumWorldBlockLayer.SOLID); + } + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + + while (f3 > 0.0F) + { + TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1; + worldrenderer.setSprite(textureatlassprite2); + this.bindTexture(TextureMap.locationBlocksTexture); + float f6 = textureatlassprite2.getMinU(); + float f7 = textureatlassprite2.getMinV(); + float f8 = textureatlassprite2.getMaxU(); + float f9 = textureatlassprite2.getMaxV(); + + if (i / 2 % 2 == 0) + { + float f10 = f8; + f8 = f6; + f6 = f10; + } + + worldrenderer.pos((double)(f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f8, (double)f9).endVertex(); + worldrenderer.pos((double)(-f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f6, (double)f9).endVertex(); + worldrenderer.pos((double)(-f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f6, (double)f7).endVertex(); + worldrenderer.pos((double)(f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f8, (double)f7).endVertex(); + f3 -= 0.45F; + f4 -= 0.45F; + f1 *= 0.9F; + f5 += 0.03F; + ++i; + } + + tessellator.draw(); + + if (flag) + { + worldrenderer.setBlockLayer(null); + GlStateManager.bindCurrentTexture(); + } + + GlStateManager.popMatrix(); + GlStateManager.enableLighting(); + } + + private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks) + { + if (!Config.isShaders() || !Shaders.shouldSkipDefaultShadow) + { + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + this.renderManager.renderEngine.bindTexture(shadowTextures); + World world = this.getWorldFromRenderManager(); + GlStateManager.depthMask(false); + float f = this.shadowSize; + + if (entityIn instanceof EntityLiving) + { + EntityLiving entityliving = (EntityLiving)entityIn; + f *= entityliving.getRenderSizeModifier(); + + if (entityliving.isChild()) + { + f *= 0.5F; + } + } + + double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks; + double d0 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks; + double d1 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks; + int i = MathHelper.floor_double(d5 - (double)f); + int j = MathHelper.floor_double(d5 + (double)f); + int k = MathHelper.floor_double(d0 - (double)f); + int l = MathHelper.floor_double(d0); + int i1 = MathHelper.floor_double(d1 - (double)f); + int j1 = MathHelper.floor_double(d1 + (double)f); + double d2 = x - d5; + double d3 = y - d0; + double d4 = z - d1; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + + for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(i, k, i1), new BlockPos(j, l, j1))) + { + Block block = world.getBlockState(blockpos.down()).getBlock(); + + if (block.getRenderType() != -1 && world.getLightFromNeighbors(blockpos) > 3) + { + this.renderShadowBlock(block, x, y, z, blockpos, shadowAlpha, f, d2, d3, d4); + } + } + + tessellator.draw(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + } + } + + private World getWorldFromRenderManager() + { + return this.renderManager.worldObj; + } + + private void renderShadowBlock(Block blockIn, double p_180549_2_, double p_180549_4_, double p_180549_6_, BlockPos pos, float p_180549_9_, float p_180549_10_, double p_180549_11_, double p_180549_13_, double p_180549_15_) + { + if (blockIn.isFullCube()) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + double d0 = ((double)p_180549_9_ - (p_180549_4_ - ((double)pos.getY() + p_180549_13_)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(pos); + + if (d0 >= 0.0D) + { + if (d0 > 1.0D) + { + d0 = 1.0D; + } + + double d1 = (double)pos.getX() + blockIn.getBlockBoundsMinX() + p_180549_11_; + double d2 = (double)pos.getX() + blockIn.getBlockBoundsMaxX() + p_180549_11_; + double d3 = (double)pos.getY() + blockIn.getBlockBoundsMinY() + p_180549_13_ + 0.015625D; + double d4 = (double)pos.getZ() + blockIn.getBlockBoundsMinZ() + p_180549_15_; + double d5 = (double)pos.getZ() + blockIn.getBlockBoundsMaxZ() + p_180549_15_; + float f = (float)((p_180549_2_ - d1) / 2.0D / (double)p_180549_10_ + 0.5D); + float f1 = (float)((p_180549_2_ - d2) / 2.0D / (double)p_180549_10_ + 0.5D); + float f2 = (float)((p_180549_6_ - d4) / 2.0D / (double)p_180549_10_ + 0.5D); + float f3 = (float)((p_180549_6_ - d5) / 2.0D / (double)p_180549_10_ + 0.5D); + worldrenderer.pos(d1, d3, d4).tex((double)f, (double)f2).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex(); + worldrenderer.pos(d1, d3, d5).tex((double)f, (double)f3).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex(); + worldrenderer.pos(d2, d3, d5).tex((double)f1, (double)f3).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex(); + worldrenderer.pos(d2, d3, d4).tex((double)f1, (double)f2).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex(); + } + } + } + + public static void renderOffsetAABB(AxisAlignedBB boundingBox, double x, double y, double z) + { + GlStateManager.disableTexture2D(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + worldrenderer.setTranslation(x, y, z); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_NORMAL); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.maxZ).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.maxY, boundingBox.minZ).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.minX, boundingBox.minY, boundingBox.minZ).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.minZ).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ).normal(1.0F, 0.0F, 0.0F).endVertex(); + tessellator.draw(); + worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); + GlStateManager.enableTexture2D(); + } + + public void doRenderShadowAndFire(Entity entityIn, double x, double y, double z, float yaw, float partialTicks) + { + if (this.renderManager.options != null) + { + if (this.renderManager.options.entityShadows && this.shadowSize > 0.0F && !entityIn.isInvisible() && this.renderManager.isRenderShadow()) + { + double d0 = this.renderManager.getDistanceToCamera(entityIn.posX, entityIn.posY, entityIn.posZ); + float f = (float)((1.0D - d0 / 256.0D) * (double)this.shadowOpaque); + + if (f > 0.0F) + { + this.renderShadow(entityIn, x, y, z, f, partialTicks); + } + } + + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + boolean ptIsEnabled = pt.isEnabled(); + boolean renderOverlay = ptIsEnabled ? (Boolean) pt.fireOnEntities.getValue() : true; + if (entityIn.canRenderOnFire() && renderOverlay && (!(entityIn instanceof EntityPlayer) || !((EntityPlayer)entityIn).isSpectator())) + { + this.renderEntityOnFire(entityIn, x, y, z, partialTicks); + } + } + } + + public FontRenderer getFontRendererFromRenderManager() + { + return this.renderManager.getFontRenderer(); + } + + protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance) + { + ModuleNameTag mod = CheatBreaker.getInstance().getModuleManager().nameTagMod; + ProfileHandler profileHandler = CheatBreaker.getInstance().getProfileHandler(); + boolean modEnabled = mod.isEnabled(); + boolean showIcon = modEnabled && (Boolean) mod.showCheatBreakerLogo.getValue() && profileHandler.validate(entityIn.getUniqueID().toString(), false) && profileHandler.validate(str, true); + int color = profileHandler.getProfile(entityIn.getUniqueID().toString()) == null ? 0 : profileHandler.getProfile(entityIn.getUniqueID().toString()).getColor(); + int color2 = profileHandler.getProfile(entityIn.getUniqueID().toString()) == null ? 0 : profileHandler.getProfile(entityIn.getUniqueID().toString()).getColor2(); + + float colorR = (float)(color >> 16 & 255) / 255.0F; + float colorG = (float)(color >> 8 & 255) / 255.0F; + float colorB = (float)(color & 255) / 255.0F; + + float color2R = (float)(color2 >> 16 & 255) / 255.0F; + float color2G = (float)(color2 >> 8 & 255) / 255.0F; + float color2B = (float)(color2 & 255) / 255.0F; + + if ((!modEnabled || !mod.showOwnNametag.getBooleanValue()) && entityIn.equals(Minecraft.getMinecraft().thePlayer)) + return; + + double d0 = entityIn.getDistanceSqToEntity(this.renderManager.livingPlayer); + + if (d0 <= (double)(maxDistance * maxDistance)) { + FontRenderer fontrenderer = this.getFontRendererFromRenderManager(); + float f = 1.6F; + float f1 = 0.016666668F * f; + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x + 0.0F, (float)y + entityIn.height + 0.5F, (float)z); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-f1, -f1, f1); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + + boolean customTextColor = (Boolean) mod.customTextColor.getValue() && modEnabled; + String string = customTextColor ? stripColor(str) : str; + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + string = string.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + string = string.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + int i = 0; + + if (str.equals("deadmau5")) + { + i = -10; + } + + int j = fontrenderer.getStringWidth(str) / 2; + + int toAdd = (showIcon ? str.contains(" ") ? 8 : 7 : 0); + j = j + toAdd; + + GlStateManager.disableTexture2D(); + if (!modEnabled || (Boolean) mod.background.getValue()) { + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + if (modEnabled) { + float alpha = (mod.backgroundColor.getColorValue() >> 24 & 255) / 255.0F; + float red = (mod.backgroundColor.getColorValue() >> 16 & 255) / 255.0F; + float green = (mod.backgroundColor.getColorValue() >> 8 & 255) / 255.0F; + float blue = (mod.backgroundColor.getColorValue() & 255) / 255.0F; + + worldrenderer.pos((-j - 1), (-1 + i), 0.0D).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos((-j - 1), (8 + i), 0.0D).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos((j + 1), (8 + i), 0.0D).color(red, green, blue, alpha).endVertex(); + worldrenderer.pos((j + 1), (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + } else { + worldrenderer.pos((-j - 1), (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((-j - 1), (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((j + 1), (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((j + 1), (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + } + tessellator.draw(); + } + GlStateManager.enableTexture2D(); + fontrenderer.drawString(string, -(fontrenderer.getStringWidth(string) / 2 - toAdd), i, customTextColor ? new Color(mod.textColor.getColorValue() >> 16 & 255, mod.textColor.getColorValue() >> 8 & 255, mod.textColor.getColorValue() & 255, 32).getRGB() : 553648127, modEnabled && (Boolean) mod.textShadow.getValue()); + + GlStateManager.enableDepth(); + GlStateManager.depthMask(true); + + if (showIcon) { + if (mod.textShadow.getBooleanValue()) { + GL11.glColor4f(colorR / 4.0F, colorG / 4.0F, colorB / 4.0F, 1.0f); // Change for WS. DIVIDED BY 4.0F IS REQUIRED + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_1.png"), (float)(-(j * 2) + 12) / 2.0f - 5.0f, 1.0F, 13.0f, 7.0f); + GL11.glColor4f(color2R / 4.0F, color2G / 4.0F, color2B / 4.0F, 1.0f); // Change for WS. DIVIDED BY 4.0F IS REQUIRED + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_2.png"), (float)(-(j * 2) + 12) / 2.0f - 5.0f, 1.0F, 13.0f, 7.0f); + } + GL11.glColor4f(colorR, colorG, colorB, 1.0f); // Change for WS + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_1.png"), (float)(-(j * 2) + 12) / 2.0f - 6.0f, 0.0F, 13.0f, 7.0f); + GL11.glColor4f(color2R, color2G, color2B, 1.0f); // Change for WS + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_2.png"), (float)(-(j * 2) + 12) / 2.0f - 6.0f, 0.0F, 13.0f, 7.0f); + } + + fontrenderer.drawString(string, -(fontrenderer.getStringWidth(string) / 2 - toAdd), i, customTextColor ? mod.textColor.getColorValue() : -1, modEnabled && (Boolean) mod.textShadow.getValue()); + + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + } + + private String stripColor(String input) { + return input == null ? null : this.STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } + + public RenderManager getRenderManager() + { + return this.renderManager; + } + + public boolean isMultipass() + { + return false; + } + + public void renderMultipass(T p_renderMultipass_1_, double p_renderMultipass_2_, double p_renderMultipass_4_, double p_renderMultipass_6_, float p_renderMultipass_8_, float p_renderMultipass_9_) + { + } + + public Class getEntityClass() + { + return this.entityClass; + } + + public void setEntityClass(Class p_setEntityClass_1_) + { + this.entityClass = p_setEntityClass_1_; + } + + public ResourceLocation getLocationTextureCustom() + { + return this.locationTextureCustom; + } + + public void setLocationTextureCustom(ResourceLocation p_setLocationTextureCustom_1_) + { + this.locationTextureCustom = p_setLocationTextureCustom_1_; + } + + public static void setModelBipedMain(RenderBiped p_setModelBipedMain_0_, ModelBiped p_setModelBipedMain_1_) + { + p_setModelBipedMain_0_.modelBipedMain = p_setModelBipedMain_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java new file mode 100644 index 0000000..10737c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java @@ -0,0 +1,97 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderArrow extends Render +{ + private static final ResourceLocation arrowTextures = new ResourceLocation("textures/entity/arrow.png"); + + public RenderArrow(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + public void doRender(EntityArrow entity, double x, double y, double z, float entityYaw, float partialTicks) + { + if (this.cancelRendering(entity)) return; + this.bindEntityTexture(entity); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = 0; + float f = 0.0F; + float f1 = 0.5F; + float f2 = (float)(0 + i * 10) / 32.0F; + float f3 = (float)(5 + i * 10) / 32.0F; + float f4 = 0.0F; + float f5 = 0.15625F; + float f6 = (float)(5 + i * 10) / 32.0F; + float f7 = (float)(10 + i * 10) / 32.0F; + float f8 = 0.05625F; + GlStateManager.enableRescaleNormal(); + float f9 = (float)entity.arrowShake - partialTicks; + + if (f9 > 0.0F) + { + float f10 = -MathHelper.sin(f9 * 3.0F) * f9; + GlStateManager.rotate(f10, 0.0F, 0.0F, 1.0F); + } + + GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(f8, f8, f8); + GlStateManager.translate(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(f8, 0.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f6).endVertex(); + worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f6).endVertex(); + worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f7).endVertex(); + worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f7).endVertex(); + tessellator.draw(); + GL11.glNormal3f(-f8, 0.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f6).endVertex(); + worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f6).endVertex(); + worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f7).endVertex(); + worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f7).endVertex(); + tessellator.draw(); + + for (int j = 0; j < 4; ++j) + { + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, f8); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-8.0D, -2.0D, 0.0D).tex((double)f, (double)f2).endVertex(); + worldrenderer.pos(8.0D, -2.0D, 0.0D).tex((double)f1, (double)f2).endVertex(); + worldrenderer.pos(8.0D, 2.0D, 0.0D).tex((double)f1, (double)f3).endVertex(); + worldrenderer.pos(-8.0D, 2.0D, 0.0D).tex((double)f, (double)f3).endVertex(); + tessellator.draw(); + } + + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityArrow entity) + { + return arrowTextures; + } + + public boolean cancelRendering(EntityArrow entity) { + boolean grounded = entity.isInGround(); + boolean moving = entity.motionX != 0.0 || entity.motionY != 0.0 || entity.motionZ != 0.0; + return (CheatBreaker.getInstance().getGlobalSettings().hideMovingArrows.getBooleanValue() && moving && !grounded) || (CheatBreaker.getInstance().getGlobalSettings().hideGroundedArrows.getBooleanValue() && grounded); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java new file mode 100644 index 0000000..51eddec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java @@ -0,0 +1,41 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBat; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderBat extends RenderLiving +{ + private static final ResourceLocation batTextures = new ResourceLocation("textures/entity/bat.png"); + + public RenderBat(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelBat(), 0.25F); + } + + protected ResourceLocation getEntityTexture(EntityBat entity) + { + return batTextures; + } + + protected void preRenderCallback(EntityBat entitylivingbaseIn, float partialTickTime) + { + GlStateManager.scale(0.35F, 0.35F, 0.35F); + } + + protected void rotateCorpse(EntityBat bat, float p_77043_2_, float p_77043_3_, float partialTicks) + { + if (!bat.getIsBatHanging()) + { + GlStateManager.translate(0.0F, MathHelper.cos(p_77043_2_ * 0.3F) * 0.1F, 0.0F); + } + else + { + GlStateManager.translate(0.0F, -0.1F, 0.0F); + } + + super.rotateCorpse(bat, p_77043_2_, p_77043_3_, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBiped.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBiped.java new file mode 100644 index 0000000..b55edc6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBiped.java @@ -0,0 +1,39 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerCustomHead; +import net.minecraft.client.renderer.entity.layers.LayerHeldItem; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +public class RenderBiped extends RenderLiving +{ + private static final ResourceLocation DEFAULT_RES_LOC = new ResourceLocation("textures/entity/steve.png"); + protected ModelBiped modelBipedMain; + protected float field_77070_b; + + public RenderBiped(RenderManager renderManagerIn, ModelBiped modelBipedIn, float shadowSize) + { + this(renderManagerIn, modelBipedIn, shadowSize, 1.0F); + this.addLayer(new LayerHeldItem(this)); + } + + public RenderBiped(RenderManager renderManagerIn, ModelBiped modelBipedIn, float shadowSize, float p_i46169_4_) + { + super(renderManagerIn, modelBipedIn, shadowSize); + this.modelBipedMain = modelBipedIn; + this.field_77070_b = p_i46169_4_; + this.addLayer(new LayerCustomHead(modelBipedIn.bipedHead)); + } + + protected ResourceLocation getEntityTexture(T entity) + { + return DEFAULT_RES_LOC; + } + + public void transformHeldFull3DItemLayer() + { + GlStateManager.translate(0.0F, 0.1875F, 0.0F); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBlaze.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBlaze.java new file mode 100644 index 0000000..c85cba0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBlaze.java @@ -0,0 +1,20 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBlaze; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.util.ResourceLocation; + +public class RenderBlaze extends RenderLiving +{ + private static final ResourceLocation blazeTextures = new ResourceLocation("textures/entity/blaze.png"); + + public RenderBlaze(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelBlaze(), 0.5F); + } + + protected ResourceLocation getEntityTexture(EntityBlaze entity) + { + return blazeTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBoat.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBoat.java new file mode 100644 index 0000000..1488b82 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderBoat.java @@ -0,0 +1,53 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBoat; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderBoat extends Render +{ + private static final ResourceLocation boatTextures = new ResourceLocation("textures/entity/boat.png"); + protected ModelBase modelBoat = new ModelBoat(); + + public RenderBoat(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.shadowSize = 0.5F; + } + + public void doRender(EntityBoat entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y + 0.25F, (float)z); + GlStateManager.rotate(180.0F - entityYaw, 0.0F, 1.0F, 0.0F); + float f = (float)entity.getTimeSinceHit() - partialTicks; + float f1 = entity.getDamageTaken() - partialTicks; + + if (f1 < 0.0F) + { + f1 = 0.0F; + } + + if (f > 0.0F) + { + GlStateManager.rotate(MathHelper.sin(f) * f * f1 / 10.0F * (float)entity.getForwardDirection(), 1.0F, 0.0F, 0.0F); + } + + float f2 = 0.75F; + GlStateManager.scale(f2, f2, f2); + GlStateManager.scale(1.0F / f2, 1.0F / f2, 1.0F / f2); + this.bindEntityTexture(entity); + GlStateManager.scale(-1.0F, -1.0F, 1.0F); + this.modelBoat.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityBoat entity) + { + return boatTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCaveSpider.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCaveSpider.java new file mode 100644 index 0000000..36f5ea4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCaveSpider.java @@ -0,0 +1,26 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.monster.EntityCaveSpider; +import net.minecraft.util.ResourceLocation; + +public class RenderCaveSpider extends RenderSpider +{ + private static final ResourceLocation caveSpiderTextures = new ResourceLocation("textures/entity/spider/cave_spider.png"); + + public RenderCaveSpider(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.shadowSize *= 0.7F; + } + + protected void preRenderCallback(EntityCaveSpider entitylivingbaseIn, float partialTickTime) + { + GlStateManager.scale(0.7F, 0.7F, 0.7F); + } + + protected ResourceLocation getEntityTexture(EntityCaveSpider entity) + { + return caveSpiderTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderChicken.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderChicken.java new file mode 100644 index 0000000..f9c1dec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderChicken.java @@ -0,0 +1,28 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderChicken extends RenderLiving +{ + private static final ResourceLocation chickenTextures = new ResourceLocation("textures/entity/chicken.png"); + + public RenderChicken(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + } + + protected ResourceLocation getEntityTexture(EntityChicken entity) + { + return chickenTextures; + } + + protected float handleRotationFloat(EntityChicken livingBase, float partialTicks) + { + float f = livingBase.field_70888_h + (livingBase.wingRotation - livingBase.field_70888_h) * partialTicks; + float f1 = livingBase.field_70884_g + (livingBase.destPos - livingBase.field_70884_g) * partialTicks; + return (MathHelper.sin(f) + 1.0F) * f1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCow.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCow.java new file mode 100644 index 0000000..44af9fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCow.java @@ -0,0 +1,20 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.util.ResourceLocation; + +public class RenderCow extends RenderLiving +{ + private static final ResourceLocation cowTextures = new ResourceLocation("textures/entity/cow/cow.png"); + + public RenderCow(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + } + + protected ResourceLocation getEntityTexture(EntityCow entity) + { + return cowTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCreeper.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCreeper.java new file mode 100644 index 0000000..9cc9a9c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderCreeper.java @@ -0,0 +1,52 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelCreeper; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderCreeper extends RenderLiving +{ + private static final ResourceLocation creeperTextures = new ResourceLocation("textures/entity/creeper/creeper.png"); + + public RenderCreeper(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelCreeper(), 0.5F); + this.addLayer(new LayerCreeperCharge(this)); + } + + protected void preRenderCallback(EntityCreeper entitylivingbaseIn, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + f = f * f; + f = f * f; + float f2 = (1.0F + f * 0.4F) * f1; + float f3 = (1.0F + f * 0.1F) / f1; + GlStateManager.scale(f2, f3, f2); + } + + protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) + { + float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); + + if ((int)(f * 10.0F) % 2 == 0) + { + return 0; + } + else + { + int i = (int)(f * 0.2F * 255.0F); + i = MathHelper.clamp_int(i, 0, 255); + return i << 24 | 16777215; + } + } + + protected ResourceLocation getEntityTexture(EntityCreeper entity) + { + return creeperTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java new file mode 100644 index 0000000..2b5a95d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java @@ -0,0 +1,140 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelDragon; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.layers.LayerEnderDragonDeath; +import net.minecraft.client.renderer.entity.layers.LayerEnderDragonEyes; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderDragon extends RenderLiving +{ + private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"); + private static final ResourceLocation enderDragonExplodingTextures = new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png"); + private static final ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); + protected ModelDragon modelDragon; + + public RenderDragon(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelDragon(0.0F), 0.5F); + this.modelDragon = (ModelDragon)this.mainModel; + this.addLayer(new LayerEnderDragonEyes(this)); + this.addLayer(new LayerEnderDragonDeath()); + } + + protected void rotateCorpse(EntityDragon bat, float p_77043_2_, float p_77043_3_, float partialTicks) + { + float f = (float)bat.getMovementOffsets(7, partialTicks)[0]; + float f1 = (float)(bat.getMovementOffsets(5, partialTicks)[1] - bat.getMovementOffsets(10, partialTicks)[1]); + GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f1 * 10.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0.0F, 0.0F, 1.0F); + + if (bat.deathTime > 0) + { + float f2 = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F; + f2 = MathHelper.sqrt_float(f2); + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + GlStateManager.rotate(f2 * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F); + } + } + + protected void renderModel(EntityDragon entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float scaleFactor) + { + if (entitylivingbaseIn.deathTicks > 0) + { + float f = (float)entitylivingbaseIn.deathTicks / 200.0F; + GlStateManager.depthFunc(515); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, f); + this.bindTexture(enderDragonExplodingTextures); + this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, scaleFactor); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.depthFunc(514); + } + + this.bindEntityTexture(entitylivingbaseIn); + this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, scaleFactor); + + if (entitylivingbaseIn.hurtTime > 0) + { + GlStateManager.depthFunc(514); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F); + this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, scaleFactor); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + GlStateManager.depthFunc(515); + } + } + + public void doRender(EntityDragon entity, double x, double y, double z, float entityYaw, float partialTicks) + { + BossStatus.setBossStatus(entity, false); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + + if (entity.healingEnderCrystal != null) + { + this.drawRechargeRay(entity, x, y, z, partialTicks); + } + } + + protected void drawRechargeRay(EntityDragon dragon, double p_180574_2_, double p_180574_4_, double p_180574_6_, float p_180574_8_) + { + float f = (float)dragon.healingEnderCrystal.innerRotation + p_180574_8_; + float f1 = MathHelper.sin(f * 0.2F) / 2.0F + 0.5F; + f1 = (f1 * f1 + f1) * 0.2F; + float f2 = (float)(dragon.healingEnderCrystal.posX - dragon.posX - (dragon.prevPosX - dragon.posX) * (double)(1.0F - p_180574_8_)); + float f3 = (float)((double)f1 + dragon.healingEnderCrystal.posY - 1.0D - dragon.posY - (dragon.prevPosY - dragon.posY) * (double)(1.0F - p_180574_8_)); + float f4 = (float)(dragon.healingEnderCrystal.posZ - dragon.posZ - (dragon.prevPosZ - dragon.posZ) * (double)(1.0F - p_180574_8_)); + float f5 = MathHelper.sqrt_float(f2 * f2 + f4 * f4); + float f6 = MathHelper.sqrt_float(f2 * f2 + f3 * f3 + f4 * f4); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)p_180574_2_, (float)p_180574_4_ + 2.0F, (float)p_180574_6_); + GlStateManager.rotate((float)(-Math.atan2((double)f4, (double)f2)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate((float)(-Math.atan2((double)f5, (double)f3)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableCull(); + this.bindTexture(enderDragonCrystalBeamTextures); + GlStateManager.shadeModel(7425); + float f7 = 0.0F - ((float)dragon.ticksExisted + p_180574_8_) * 0.01F; + float f8 = MathHelper.sqrt_float(f2 * f2 + f3 * f3 + f4 * f4) / 32.0F - ((float)dragon.ticksExisted + p_180574_8_) * 0.01F; + worldrenderer.begin(5, DefaultVertexFormats.POSITION_TEX_COLOR); + int i = 8; + + for (int j = 0; j <= 8; ++j) + { + float f9 = MathHelper.sin((float)(j % 8) * (float)Math.PI * 2.0F / 8.0F) * 0.75F; + float f10 = MathHelper.cos((float)(j % 8) * (float)Math.PI * 2.0F / 8.0F) * 0.75F; + float f11 = (float)(j % 8) * 1.0F / 8.0F; + worldrenderer.pos((double)(f9 * 0.2F), (double)(f10 * 0.2F), 0.0D).tex((double)f11, (double)f8).color(0, 0, 0, 255).endVertex(); + worldrenderer.pos((double)f9, (double)f10, (double)f6).tex((double)f11, (double)f7).color(255, 255, 255, 255).endVertex(); + } + + tessellator.draw(); + GlStateManager.enableCull(); + GlStateManager.shadeModel(7424); + RenderHelper.enableStandardItemLighting(); + GlStateManager.popMatrix(); + } + + protected ResourceLocation getEntityTexture(EntityDragon entity) + { + return enderDragonTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java new file mode 100644 index 0000000..0c62b72 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java @@ -0,0 +1,44 @@ +package net.minecraft.client.renderer.entity; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.model.ModelEnderman; +import net.minecraft.client.renderer.entity.layers.LayerEndermanEyes; +import net.minecraft.client.renderer.entity.layers.LayerHeldBlock; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.util.ResourceLocation; + +public class RenderEnderman extends RenderLiving +{ + private static final ResourceLocation endermanTextures = new ResourceLocation("textures/entity/enderman/enderman.png"); + private ModelEnderman endermanModel; + private Random rnd = new Random(); + + public RenderEnderman(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelEnderman(0.0F), 0.5F); + this.endermanModel = (ModelEnderman)super.mainModel; + this.addLayer(new LayerEndermanEyes(this)); + this.addLayer(new LayerHeldBlock(this)); + } + + public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks) + { + this.endermanModel.isCarrying = entity.getHeldBlockState().getBlock().getMaterial() != Material.air; + this.endermanModel.isAttacking = entity.isScreaming(); + + if (entity.isScreaming()) + { + double d0 = 0.02D; + x += this.rnd.nextGaussian() * d0; + z += this.rnd.nextGaussian() * d0; + } + + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityEnderman entity) + { + return endermanTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEndermite.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEndermite.java new file mode 100644 index 0000000..6e45a56 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEndermite.java @@ -0,0 +1,25 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelEnderMite; +import net.minecraft.entity.monster.EntityEndermite; +import net.minecraft.util.ResourceLocation; + +public class RenderEndermite extends RenderLiving +{ + private static final ResourceLocation ENDERMITE_TEXTURES = new ResourceLocation("textures/entity/endermite.png"); + + public RenderEndermite(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelEnderMite(), 0.3F); + } + + protected float getDeathMaxRotation(EntityEndermite entityLivingBaseIn) + { + return 180.0F; + } + + protected ResourceLocation getEntityTexture(EntityEndermite entity) + { + return ENDERMITE_TEXTURES; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEntity.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEntity.java new file mode 100644 index 0000000..a185a0b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEntity.java @@ -0,0 +1,26 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderEntity extends Render +{ + public RenderEntity(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + renderOffsetAABB(entity.getEntityBoundingBox(), x - entity.lastTickPosX, y - entity.lastTickPosY, z - entity.lastTickPosZ); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(Entity entity) + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEntityItem.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEntityItem.java new file mode 100644 index 0000000..53bc0ce --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderEntityItem.java @@ -0,0 +1,157 @@ +package net.minecraft.client.renderer.entity; + +import java.util.Random; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderEntityItem extends Render +{ + private final RenderItem itemRenderer; + private Random field_177079_e = new Random(); + + public RenderEntityItem(RenderManager renderManagerIn, RenderItem p_i46167_2_) + { + super(renderManagerIn); + this.itemRenderer = p_i46167_2_; + this.shadowSize = 0.15F; + this.shadowOpaque = 0.75F; + } + + private int func_177077_a(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_) + { + ItemStack itemstack = itemIn.getEntityItem(); + Item item = itemstack.getItem(); + + if (item == null) + { + return 0; + } + else + { + boolean flag = p_177077_9_.isGui3d(); + int i = this.func_177078_a(itemstack); + float f = 0.25F; + float f1 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F; + float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y; + GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); + + if (flag || this.renderManager.options != null) + { + float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI); + GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F); + } + + if (!flag) + { + float f6 = -0.0F * (float)(i - 1) * 0.5F; + float f4 = -0.0F * (float)(i - 1) * 0.5F; + float f5 = -0.046875F * (float)(i - 1) * 0.5F; + GlStateManager.translate(f6, f4, f5); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + return i; + } + } + + private int func_177078_a(ItemStack stack) + { + int i = 1; + + if (stack.stackSize > 48) + { + i = 5; + } + else if (stack.stackSize > 32) + { + i = 4; + } + else if (stack.stackSize > 16) + { + i = 3; + } + else if (stack.stackSize > 1) + { + i = 2; + } + + return i; + } + + public void doRender(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks) + { + ItemStack itemstack = entity.getEntityItem(); + this.field_177079_e.setSeed(187L); + boolean flag = false; + + if (this.bindEntityTexture(entity)) + { + this.renderManager.renderEngine.getTexture(this.getEntityTexture(entity)).setBlurMipmap(false, false); + flag = true; + } + + GlStateManager.enableRescaleNormal(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); + IBakedModel ibakedmodel = this.itemRenderer.getItemModelMesher().getItemModel(itemstack); + int i = this.func_177077_a(entity, x, y, z, partialTicks, ibakedmodel); + + for (int j = 0; j < i; ++j) + { + if (ibakedmodel.isGui3d()) + { + GlStateManager.pushMatrix(); + + if (j > 0) + { + float f = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f1 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + GlStateManager.translate(f, f1, f2); + } + + GlStateManager.scale(0.5F, 0.5F, 0.5F); + ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GROUND); + this.itemRenderer.renderItem(itemstack, ibakedmodel); + GlStateManager.popMatrix(); + } + else + { + GlStateManager.pushMatrix(); + ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GROUND); + this.itemRenderer.renderItem(itemstack, ibakedmodel); + GlStateManager.popMatrix(); + float f3 = ibakedmodel.getItemCameraTransforms().ground.scale.x; + float f4 = ibakedmodel.getItemCameraTransforms().ground.scale.y; + float f5 = ibakedmodel.getItemCameraTransforms().ground.scale.z; + GlStateManager.translate(0.0F * f3, 0.0F * f4, 0.046875F * f5); + } + } + + GlStateManager.popMatrix(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableBlend(); + this.bindEntityTexture(entity); + + if (flag) + { + this.renderManager.renderEngine.getTexture(this.getEntityTexture(entity)).restoreLastBlurMipmap(); + } + + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityItem entity) + { + return TextureMap.locationBlocksTexture; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFallingBlock.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFallingBlock.java new file mode 100644 index 0000000..c063125 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFallingBlock.java @@ -0,0 +1,67 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class RenderFallingBlock extends Render +{ + public RenderFallingBlock(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.shadowSize = 0.5F; + } + + public void doRender(EntityFallingBlock entity, double x, double y, double z, float entityYaw, float partialTicks) + { + if (entity.getBlock() != null) + { + this.bindTexture(TextureMap.locationBlocksTexture); + IBlockState iblockstate = entity.getBlock(); + Block block = iblockstate.getBlock(); + BlockPos blockpos = new BlockPos(entity); + World world = entity.getWorldObj(); + + if (iblockstate != world.getBlockState(blockpos) && block.getRenderType() != -1) + { + if (block.getRenderType() == 3) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + GlStateManager.disableLighting(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.BLOCK); + int i = blockpos.getX(); + int j = blockpos.getY(); + int k = blockpos.getZ(); + worldrenderer.setTranslation((double)((float)(-i) - 0.5F), (double)(-j), (double)((float)(-k) - 0.5F)); + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + IBakedModel ibakedmodel = blockrendererdispatcher.getModelFromBlockState(iblockstate, world, (BlockPos)null); + blockrendererdispatcher.getBlockModelRenderer().renderModel(world, ibakedmodel, iblockstate, blockpos, worldrenderer, false); + worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); + tessellator.draw(); + GlStateManager.enableLighting(); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + } + } + } + + protected ResourceLocation getEntityTexture(EntityFallingBlock entity) + { + return TextureMap.locationBlocksTexture; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java new file mode 100644 index 0000000..0988604 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFireball.java @@ -0,0 +1,58 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.init.Items; +import net.minecraft.util.ResourceLocation; + +public class RenderFireball extends Render +{ + private float scale; + + public RenderFireball(RenderManager renderManagerIn, float scaleIn) + { + super(renderManagerIn); + this.scale = scaleIn; + } + + public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + this.bindEntityTexture(entity); + GlStateManager.translate((float)x, (float)y, (float)z); + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(this.scale, this.scale, this.scale); + TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + float f = textureatlassprite.getMinU(); + float f1 = textureatlassprite.getMaxU(); + float f2 = textureatlassprite.getMinV(); + float f3 = textureatlassprite.getMaxV(); + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL); + worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex(); + tessellator.draw(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityFireball entity) + { + return TextureMap.locationBlocksTexture; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFish.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFish.java new file mode 100644 index 0000000..1c3bc96 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderFish.java @@ -0,0 +1,110 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.module.impl.normal.animation.util.FishingLineHandler; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; + +public class RenderFish extends Render +{ + private static final ResourceLocation FISH_PARTICLES = new ResourceLocation("textures/particle/particles.png"); + + public RenderFish(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + public void doRender(EntityFishHook entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + this.bindEntityTexture(entity); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = 1; + int j = 2; + float f = 0.0625F; + float f1 = 0.125F; + float f2 = 0.125F; + float f3 = 0.1875F; + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.5F; + GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL); + worldrenderer.pos(-0.5D, -0.5D, 0.0D).tex(0.0625D, 0.1875D).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(0.5D, -0.5D, 0.0D).tex(0.125D, 0.1875D).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(0.5D, 0.5D, 0.0D).tex(0.125D, 0.125D).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos(-0.5D, 0.5D, 0.0D).tex(0.0625D, 0.125D).normal(0.0F, 1.0F, 0.0F).endVertex(); + tessellator.draw(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + + if (entity.angler != null) + { + float f7 = entity.angler.getSwingProgress(partialTicks); + float f8 = MathHelper.sin(MathHelper.sqrt_float(f7) * (float)Math.PI); + + // 1.7 Fishing rod position. + Vec3 vec3 = !ModuleOneSevenVisuals.oldRod.getBooleanValue() ? new Vec3(-0.36D, 0.03D, 0.35D) : FishingLineHandler.INSTANCE.getOffset(); + vec3 = vec3.rotatePitch(-(entity.angler.prevRotationPitch + (entity.angler.rotationPitch - entity.angler.prevRotationPitch) * partialTicks) * (float)Math.PI / 180.0F); + vec3 = vec3.rotateYaw(-(entity.angler.prevRotationYaw + (entity.angler.rotationYaw - entity.angler.prevRotationYaw) * partialTicks) * (float)Math.PI / 180.0F); + vec3 = vec3.rotateYaw(f8 * 0.5F); + vec3 = vec3.rotatePitch(-f8 * 0.7F); + double d0 = entity.angler.prevPosX + (entity.angler.posX - entity.angler.prevPosX) * (double)partialTicks + vec3.xCoord; + double d1 = entity.angler.prevPosY + (entity.angler.posY - entity.angler.prevPosY) * (double)partialTicks + vec3.yCoord; + double d2 = entity.angler.prevPosZ + (entity.angler.posZ - entity.angler.prevPosZ) * (double)partialTicks + vec3.zCoord; + double d3 = entity.angler.getEyeHeight(); + + if (this.renderManager.options != null && this.renderManager.options.thirdPersonView > 0 || entity.angler != Minecraft.getMinecraft().thePlayer) + { + float f9 = (entity.angler.prevRenderYawOffset + (entity.angler.renderYawOffset - entity.angler.prevRenderYawOffset) * partialTicks) * (float)Math.PI / 180.0F; + double d4 = (double)MathHelper.sin(f9); + double d6 = (double)MathHelper.cos(f9); + double d8 = 0.35D; + double d10 = 0.8D; + d0 = entity.angler.prevPosX + (entity.angler.posX - entity.angler.prevPosX) * (double)partialTicks - d6 * 0.35D - d4 * 0.8D; + d1 = entity.angler.prevPosY + d3 + (entity.angler.posY - entity.angler.prevPosY) * (double)partialTicks - 0.45D; + d2 = entity.angler.prevPosZ + (entity.angler.posZ - entity.angler.prevPosZ) * (double)partialTicks - d4 * 0.35D + d6 * 0.8D; + d3 = entity.angler.isSneaking() ? -0.1875D : 0.0D; + } + + double d13 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double)partialTicks; + double d5 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double)partialTicks + 0.25D; + double d7 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double)partialTicks; + double d9 = (double)((float)(d0 - d13)); + double d11 = (double)((float)(d1 - d5)) + d3; + double d12 = (double)((float)(d2 - d7)); + GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); + worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR); + int k = 16; + + for (int l = 0; l <= 16; ++l) + { + float f10 = (float)l / 16.0F; + worldrenderer.pos(x + d9 * (double)f10, y + d11 * (double)(f10 * f10 + f10) * 0.5D + 0.25D, z + d12 * (double)f10).color(0, 0, 0, 255).endVertex(); + } + + tessellator.draw(); + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + } + + protected ResourceLocation getEntityTexture(EntityFishHook entity) + { + return FISH_PARTICLES; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGhast.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGhast.java new file mode 100644 index 0000000..ced8cc1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGhast.java @@ -0,0 +1,31 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelGhast; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.util.ResourceLocation; + +public class RenderGhast extends RenderLiving +{ + private static final ResourceLocation ghastTextures = new ResourceLocation("textures/entity/ghast/ghast.png"); + private static final ResourceLocation ghastShootingTextures = new ResourceLocation("textures/entity/ghast/ghast_shooting.png"); + + public RenderGhast(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelGhast(), 0.5F); + } + + protected ResourceLocation getEntityTexture(EntityGhast entity) + { + return entity.isAttacking() ? ghastShootingTextures : ghastTextures; + } + + protected void preRenderCallback(EntityGhast entitylivingbaseIn, float partialTickTime) + { + float f = 1.0F; + float f1 = (8.0F + f) / 2.0F; + float f2 = (8.0F + 1.0F / f) / 2.0F; + GlStateManager.scale(f2, f1, f2); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGiantZombie.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGiantZombie.java new file mode 100644 index 0000000..c998932 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGiantZombie.java @@ -0,0 +1,45 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelZombie; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; +import net.minecraft.client.renderer.entity.layers.LayerHeldItem; +import net.minecraft.entity.monster.EntityGiantZombie; +import net.minecraft.util.ResourceLocation; + +public class RenderGiantZombie extends RenderLiving +{ + private static final ResourceLocation zombieTextures = new ResourceLocation("textures/entity/zombie/zombie.png"); + private float scale; + + public RenderGiantZombie(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn, float scaleIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn * scaleIn); + this.scale = scaleIn; + this.addLayer(new LayerHeldItem(this)); + this.addLayer(new LayerBipedArmor(this) + { + protected void initArmor() + { + this.modelLeggings = new ModelZombie(0.5F, true); + this.modelArmor = new ModelZombie(1.0F, true); + } + }); + } + + public void transformHeldFull3DItemLayer() + { + GlStateManager.translate(0.0F, 0.1875F, 0.0F); + } + + protected void preRenderCallback(EntityGiantZombie entitylivingbaseIn, float partialTickTime) + { + GlStateManager.scale(this.scale, this.scale, this.scale); + } + + protected ResourceLocation getEntityTexture(EntityGiantZombie entity) + { + return zombieTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGuardian.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGuardian.java new file mode 100644 index 0000000..a0a793d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderGuardian.java @@ -0,0 +1,171 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelGuardian; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +public class RenderGuardian extends RenderLiving +{ + private static final ResourceLocation GUARDIAN_TEXTURE = new ResourceLocation("textures/entity/guardian.png"); + private static final ResourceLocation GUARDIAN_ELDER_TEXTURE = new ResourceLocation("textures/entity/guardian_elder.png"); + private static final ResourceLocation GUARDIAN_BEAM_TEXTURE = new ResourceLocation("textures/entity/guardian_beam.png"); + int field_177115_a; + + public RenderGuardian(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelGuardian(), 0.5F); + this.field_177115_a = ((ModelGuardian)this.mainModel).func_178706_a(); + } + + public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ) + { + if (super.shouldRender(livingEntity, camera, camX, camY, camZ)) + { + return true; + } + else + { + if (livingEntity.hasTargetedEntity()) + { + EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity(); + + if (entitylivingbase != null) + { + Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F); + Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F); + + if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord))) + { + return true; + } + } + } + + return false; + } + } + + private Vec3 func_177110_a(EntityLivingBase entityLivingBaseIn, double p_177110_2_, float p_177110_4_) + { + double d0 = entityLivingBaseIn.lastTickPosX + (entityLivingBaseIn.posX - entityLivingBaseIn.lastTickPosX) * (double)p_177110_4_; + double d1 = p_177110_2_ + entityLivingBaseIn.lastTickPosY + (entityLivingBaseIn.posY - entityLivingBaseIn.lastTickPosY) * (double)p_177110_4_; + double d2 = entityLivingBaseIn.lastTickPosZ + (entityLivingBaseIn.posZ - entityLivingBaseIn.lastTickPosZ) * (double)p_177110_4_; + return new Vec3(d0, d1, d2); + } + + public void doRender(EntityGuardian entity, double x, double y, double z, float entityYaw, float partialTicks) + { + if (this.field_177115_a != ((ModelGuardian)this.mainModel).func_178706_a()) + { + this.mainModel = new ModelGuardian(); + this.field_177115_a = ((ModelGuardian)this.mainModel).func_178706_a(); + } + + super.doRender(entity, x, y, z, entityYaw, partialTicks); + EntityLivingBase entitylivingbase = entity.getTargetedEntity(); + + if (entitylivingbase != null) + { + float f = entity.func_175477_p(partialTicks); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.bindTexture(GUARDIAN_BEAM_TEXTURE); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GlStateManager.disableLighting(); + GlStateManager.disableCull(); + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + float f1 = 240.0F; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f1, f1); + GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); + float f2 = (float)entity.worldObj.getTotalWorldTime() + partialTicks; + float f3 = f2 * 0.5F % 1.0F; + float f4 = entity.getEyeHeight(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y + f4, (float)z); + Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, partialTicks); + Vec3 vec31 = this.func_177110_a(entity, (double)f4, partialTicks); + Vec3 vec32 = vec3.subtract(vec31); + double d0 = vec32.lengthVector() + 1.0D; + vec32 = vec32.normalize(); + float f5 = (float)Math.acos(vec32.yCoord); + float f6 = (float)Math.atan2(vec32.zCoord, vec32.xCoord); + GlStateManager.rotate((((float)Math.PI / 2F) + -f6) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f5 * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + int i = 1; + double d1 = (double)f2 * 0.05D * (1.0D - (double)(i & 1) * 2.5D); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + float f7 = f * f; + int j = 64 + (int)(f7 * 240.0F); + int k = 32 + (int)(f7 * 192.0F); + int l = 128 - (int)(f7 * 64.0F); + double d2 = (double)i * 0.2D; + double d3 = d2 * 1.41D; + double d4 = 0.0D + Math.cos(d1 + 2.356194490192345D) * d3; + double d5 = 0.0D + Math.sin(d1 + 2.356194490192345D) * d3; + double d6 = 0.0D + Math.cos(d1 + (Math.PI / 4D)) * d3; + double d7 = 0.0D + Math.sin(d1 + (Math.PI / 4D)) * d3; + double d8 = 0.0D + Math.cos(d1 + 3.9269908169872414D) * d3; + double d9 = 0.0D + Math.sin(d1 + 3.9269908169872414D) * d3; + double d10 = 0.0D + Math.cos(d1 + 5.497787143782138D) * d3; + double d11 = 0.0D + Math.sin(d1 + 5.497787143782138D) * d3; + double d12 = 0.0D + Math.cos(d1 + Math.PI) * d2; + double d13 = 0.0D + Math.sin(d1 + Math.PI) * d2; + double d14 = 0.0D + Math.cos(d1 + 0.0D) * d2; + double d15 = 0.0D + Math.sin(d1 + 0.0D) * d2; + double d16 = 0.0D + Math.cos(d1 + (Math.PI / 2D)) * d2; + double d17 = 0.0D + Math.sin(d1 + (Math.PI / 2D)) * d2; + double d18 = 0.0D + Math.cos(d1 + (Math.PI * 3D / 2D)) * d2; + double d19 = 0.0D + Math.sin(d1 + (Math.PI * 3D / 2D)) * d2; + double d20 = 0.0D; + double d21 = 0.4999D; + double d22 = (double)(-1.0F + f3); + double d23 = d0 * (0.5D / d2) + d22; + worldrenderer.pos(d12, d0, d13).tex(0.4999D, d23).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d12, 0.0D, d13).tex(0.4999D, d22).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d14, 0.0D, d15).tex(0.0D, d22).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d14, d0, d15).tex(0.0D, d23).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d16, d0, d17).tex(0.4999D, d23).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d16, 0.0D, d17).tex(0.4999D, d22).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d18, 0.0D, d19).tex(0.0D, d22).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d18, d0, d19).tex(0.0D, d23).color(j, k, l, 255).endVertex(); + double d24 = 0.0D; + + if (entity.ticksExisted % 2 == 0) + { + d24 = 0.5D; + } + + worldrenderer.pos(d4, d0, d5).tex(0.5D, d24 + 0.5D).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d6, d0, d7).tex(1.0D, d24 + 0.5D).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d10, d0, d11).tex(1.0D, d24).color(j, k, l, 255).endVertex(); + worldrenderer.pos(d8, d0, d9).tex(0.5D, d24).color(j, k, l, 255).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + } + } + + protected void preRenderCallback(EntityGuardian entitylivingbaseIn, float partialTickTime) + { + if (entitylivingbaseIn.isElder()) + { + GlStateManager.scale(2.35F, 2.35F, 2.35F); + } + } + + protected ResourceLocation getEntityTexture(EntityGuardian entity) + { + return entity.isElder() ? GUARDIAN_ELDER_TEXTURE : GUARDIAN_TEXTURE; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderHorse.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderHorse.java new file mode 100644 index 0000000..0f17cf7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderHorse.java @@ -0,0 +1,95 @@ +package net.minecraft.client.renderer.entity; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelHorse; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.LayeredTexture; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.util.ResourceLocation; + +public class RenderHorse extends RenderLiving +{ + private static final Map field_110852_a = Maps.newHashMap(); + private static final ResourceLocation whiteHorseTextures = new ResourceLocation("textures/entity/horse/horse_white.png"); + private static final ResourceLocation muleTextures = new ResourceLocation("textures/entity/horse/mule.png"); + private static final ResourceLocation donkeyTextures = new ResourceLocation("textures/entity/horse/donkey.png"); + private static final ResourceLocation zombieHorseTextures = new ResourceLocation("textures/entity/horse/horse_zombie.png"); + private static final ResourceLocation skeletonHorseTextures = new ResourceLocation("textures/entity/horse/horse_skeleton.png"); + + public RenderHorse(RenderManager rendermanagerIn, ModelHorse model, float shadowSizeIn) + { + super(rendermanagerIn, model, shadowSizeIn); + } + + protected void preRenderCallback(EntityHorse entitylivingbaseIn, float partialTickTime) + { + float f = 1.0F; + int i = entitylivingbaseIn.getHorseType(); + + if (i == 1) + { + f *= 0.87F; + } + else if (i == 2) + { + f *= 0.92F; + } + + GlStateManager.scale(f, f, f); + super.preRenderCallback(entitylivingbaseIn, partialTickTime); + } + + protected ResourceLocation getEntityTexture(EntityHorse entity) + { + if (!entity.func_110239_cn()) + { + switch (entity.getHorseType()) + { + case 0: + default: + return whiteHorseTextures; + + case 1: + return donkeyTextures; + + case 2: + return muleTextures; + + case 3: + return zombieHorseTextures; + + case 4: + return skeletonHorseTextures; + } + } + else + { + return this.func_110848_b(entity); + } + } + + private ResourceLocation func_110848_b(EntityHorse horse) + { + String s = horse.getHorseTexture(); + + if (!horse.func_175507_cI()) + { + return null; + } + else + { + ResourceLocation resourcelocation = (ResourceLocation)field_110852_a.get(s); + + if (resourcelocation == null) + { + resourcelocation = new ResourceLocation(s); + Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(horse.getVariantTexturePaths())); + field_110852_a.put(s, resourcelocation); + } + + return resourcelocation; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderIronGolem.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderIronGolem.java new file mode 100644 index 0000000..07f00b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderIronGolem.java @@ -0,0 +1,36 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelIronGolem; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerIronGolemFlower; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.util.ResourceLocation; + +public class RenderIronGolem extends RenderLiving +{ + private static final ResourceLocation ironGolemTextures = new ResourceLocation("textures/entity/iron_golem.png"); + + public RenderIronGolem(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelIronGolem(), 0.5F); + this.addLayer(new LayerIronGolemFlower(this)); + } + + protected ResourceLocation getEntityTexture(EntityIronGolem entity) + { + return ironGolemTextures; + } + + protected void rotateCorpse(EntityIronGolem bat, float p_77043_2_, float p_77043_3_, float partialTicks) + { + super.rotateCorpse(bat, p_77043_2_, p_77043_3_, partialTicks); + + if ((double)bat.limbSwingAmount >= 0.01D) + { + float f = 13.0F; + float f1 = bat.limbSwing - bat.limbSwingAmount * (1.0F - partialTicks) + 6.0F; + float f2 = (Math.abs(f1 % f - f * 0.5F) - f * 0.25F) / (f * 0.25F); + GlStateManager.rotate(6.5F * f2, 0.0F, 0.0F, 1.0F); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java new file mode 100644 index 0000000..5288a11 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java @@ -0,0 +1,1201 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.animation.util.AnimationHandler; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnchantmentGlint; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt.DirtType; +import net.minecraft.block.BlockDoublePlant.EnumPlantType; +import net.minecraft.block.BlockFlower.EnumFlowerType; +import net.minecraft.block.BlockWall.EnumType; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; +import net.minecraft.client.renderer.block.model.ItemTransformVec3f; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.tileentity.TileEntityItemStackRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.*; +import net.minecraft.item.ItemFishFood.FishType; +import net.minecraft.src.Config; +import net.minecraft.util.*; +import net.optifine.CustomColors; +import net.optifine.CustomItems; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersRender; + +import java.util.List; +import java.util.concurrent.Callable; + +public class RenderItem implements IResourceManagerReloadListener +{ + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + private boolean notRenderingEffectsInGUI = true; + public float zLevel; + private ItemModelMesher itemModelMesher; + private TextureManager textureManager; + private ModelResourceLocation modelLocation = null; + private boolean renderItemGui = false; + public ModelManager modelManager; + private boolean renderModelHasEmissive = false; + private boolean renderModelEmissive = false; + + private EntityLivingBase lastEntityToRenderFor = null; + + public RenderItem(TextureManager textureManager, ModelManager modelManager) + { + this.textureManager = textureManager; + this.modelManager = modelManager; + + if (Reflector.ItemModelMesherForge_Constructor.exists()) + { + this.itemModelMesher = (ItemModelMesher)Reflector.newInstance(Reflector.ItemModelMesherForge_Constructor, new Object[] {modelManager}); + } + else + { + this.itemModelMesher = new ItemModelMesher(modelManager); + } + + this.registerItems(); + } + + public void isNotRenderingEffectsInGUI(boolean isNot) + { + this.notRenderingEffectsInGUI = isNot; + } + + public ItemModelMesher getItemModelMesher() + { + return this.itemModelMesher; + } + + protected void registerItem(Item itm, int subType, String identifier) + { + this.itemModelMesher.register(itm, subType, new ModelResourceLocation(identifier, "inventory")); + } + + protected void registerBlock(Block blk, int subType, String identifier) + { + this.registerItem(Item.getItemFromBlock(blk), subType, identifier); + } + + private void registerBlock(Block blk, String identifier) + { + this.registerBlock(blk, 0, identifier); + } + + private void registerItem(Item itm, String identifier) + { + this.registerItem(itm, 0, identifier); + } + + private void renderModel(IBakedModel model, ItemStack stack) + { + this.renderModel(model, -1, stack); + } + + public void renderModel(IBakedModel model, int color) + { + this.renderModel(model, color, (ItemStack)null); + } + + private void renderModel(IBakedModel model, int color, ItemStack stack) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + boolean flag = Minecraft.getMinecraft().getTextureMapBlocks().isTextureBound(); + boolean flag1 = Config.isMultiTexture() && flag; + + if (flag1) + { + worldrenderer.setBlockLayer(EnumWorldBlockLayer.SOLID); + } + + worldrenderer.begin(7, DefaultVertexFormats.ITEM); + + for (EnumFacing enumfacing : EnumFacing.VALUES) + { + this.renderQuads(worldrenderer, model.getFaceQuads(enumfacing), color, stack); + } + + this.renderQuads(worldrenderer, model.getGeneralQuads(), color, stack); + tessellator.draw(); + + if (flag1) + { + worldrenderer.setBlockLayer(null); + GlStateManager.bindCurrentTexture(); + } + } + + public void renderItem(ItemStack stack, IBakedModel model) + { + if (stack != null) + { + GlStateManager.pushMatrix(); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + + if (model.isBuiltInRenderer()) + { + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(-0.5F, -0.5F, -0.5F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableRescaleNormal(); + TileEntityItemStackRenderer.instance.renderByItem(stack); + } + else + { + GlStateManager.translate(-0.5F, -0.5F, -0.5F); + + if (Config.isCustomItems()) + { + model = CustomItems.getCustomItemModel(stack, model, this.modelLocation, false); + } + + this.renderModelHasEmissive = false; + this.renderModel(model, stack); + + if (this.renderModelHasEmissive) + { + float f = OpenGlHelper.lastBrightnessX; + float f1 = OpenGlHelper.lastBrightnessY; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, f1); + this.renderModelEmissive = true; + this.renderModel(model, stack); + this.renderModelEmissive = false; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f, f1); + } + + if (stack.hasEffect() && (!Config.isCustomItems() || !CustomItems.renderCustomEffect(this, stack, model))) + { + this.renderEffect(model); + } + } + + GlStateManager.popMatrix(); + } + } + + private void renderEffect(IBakedModel model) + { + ModuleEnchantmentGlint gm = CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod; + + if (!Config.isCustomItems() || CustomItems.isUseGlint()) + { + if (!Config.isShaders() || !Shaders.isShadowPass) + { + GlStateManager.depthMask(false); + GlStateManager.depthFunc(514); + GlStateManager.disableLighting(); + GlStateManager.blendFunc(768, 1); + this.textureManager.bindTexture(RES_ITEM_GLINT); + + if (Config.isShaders() && !this.renderItemGui) + { + ShadersRender.renderEnchantedGlintBegin(); + } + + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(8.0F, 8.0F, 8.0F); + float f = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F; + GlStateManager.translate(f, 0.0F, 0.0F); + GlStateManager.rotate(-50.0F, 0.0F, 0.0F, 1.0F); + + if (gm.isEnabled()) this.renderModel(model, gm.glintColor.getColorValue()); + + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(8.0F, 8.0F, 8.0F); + float f1 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F / 8.0F; + GlStateManager.translate(-f1, 0.0F, 0.0F); + GlStateManager.rotate(10.0F, 0.0F, 0.0F, 1.0F); + + if (gm.isEnabled()) this.renderModel(model, gm.glintColor.getColorValue()); + + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + GlStateManager.blendFunc(770, 771); + GlStateManager.enableLighting(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + this.textureManager.bindTexture(TextureMap.locationBlocksTexture); + + if (Config.isShaders() && !this.renderItemGui) + { + ShadersRender.renderEnchantedGlintEnd(); + } + } + } + } + + private void putQuadNormal(WorldRenderer renderer, BakedQuad quad) + { + Vec3i vec3i = quad.getFace().getDirectionVec(); + renderer.putNormal((float)vec3i.getX(), (float)vec3i.getY(), (float)vec3i.getZ()); + } + + private void renderQuad(WorldRenderer renderer, BakedQuad quad, int color) + { + if (this.renderModelEmissive) + { + if (quad.getQuadEmissive() == null) + { + return; + } + + quad = quad.getQuadEmissive(); + } + else if (quad.getQuadEmissive() != null) + { + this.renderModelHasEmissive = true; + } + + if (renderer.isMultiTexture()) + { + renderer.addVertexData(quad.getVertexDataSingle()); + } + else + { + renderer.addVertexData(quad.getVertexData()); + } + + renderer.putSprite(quad.getSprite()); + + if (Reflector.IColoredBakedQuad.exists() && Reflector.IColoredBakedQuad.isInstance(quad)) + { + forgeHooksClient_putQuadColor(renderer, quad, color); + } + else + { + renderer.putColor4(color); + } + + this.putQuadNormal(renderer, quad); + } + + private void renderQuads(WorldRenderer renderer, List quads, int color, ItemStack stack) + { + boolean flag = color == -1 && stack != null; + int i = 0; + + for (int j = quads.size(); i < j; ++i) + { + BakedQuad bakedquad = quads.get(i); + int k = color; + + if (flag && bakedquad.hasTintIndex()) + { + k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex()); + + if (Config.isCustomColors()) + { + k = CustomColors.getColorFromItemStack(stack, bakedquad.getTintIndex(), k); + } + + if (EntityRenderer.anaglyphEnable) + { + k = TextureUtil.anaglyphColor(k); + } + + k = k | -16777216; + } + + this.renderQuad(renderer, bakedquad, k); + } + } + + public boolean shouldRenderItemIn3D(ItemStack stack) + { + IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack); + return ibakedmodel != null && ibakedmodel.isGui3d(); + } + + private void preTransform(ItemStack stack) + { + IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack); + Item item = stack.getItem(); + + if (item != null) + { + boolean flag = ibakedmodel.isGui3d(); + + if (!flag) + { + GlStateManager.scale(2.0F, 2.0F, 2.0F); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + } + + public void renderItem(ItemStack stack, TransformType cameraTransformType) + { + if (stack != null) + { + IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack); + this.renderItemModelTransform(stack, ibakedmodel, cameraTransformType); + } + } + + public void renderItemModelForEntity(ItemStack stack, EntityLivingBase entityToRenderFor, TransformType cameraTransformType) + { + this.lastEntityToRenderFor = entityToRenderFor; + if (stack != null && entityToRenderFor != null) + { + IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack); + + if (entityToRenderFor instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)entityToRenderFor; + Item item = stack.getItem(); + ModelResourceLocation modelresourcelocation = null; + + if (item == Items.fishing_rod && entityplayer.fishEntity != null) + { + modelresourcelocation = new ModelResourceLocation("fishing_rod_cast", "inventory"); + } + else if (item == Items.bow && entityplayer.getItemInUse() != null) + { + int i = stack.getMaxItemUseDuration() - entityplayer.getItemInUseCount(); + + if (i >= 18) + { + modelresourcelocation = new ModelResourceLocation("bow_pulling_2", "inventory"); + } + else if (i > 13) + { + modelresourcelocation = new ModelResourceLocation("bow_pulling_1", "inventory"); + } + else if (i > 0) + { + modelresourcelocation = new ModelResourceLocation("bow_pulling_0", "inventory"); + } + } + else if (Reflector.ForgeItem_getModel.exists()) + { + modelresourcelocation = (ModelResourceLocation)Reflector.call(item, Reflector.ForgeItem_getModel, new Object[] {stack, entityplayer, Integer.valueOf(entityplayer.getItemInUseCount())}); + } + + if (modelresourcelocation != null) + { + ibakedmodel = this.itemModelMesher.getModelManager().getModel(modelresourcelocation); + this.modelLocation = modelresourcelocation; + } + } + + this.renderItemModelTransform(stack, ibakedmodel, cameraTransformType); + this.modelLocation = null; + } + } + + protected void renderItemModelTransform(ItemStack stack, IBakedModel model, TransformType cameraTransformType) + { + this.textureManager.bindTexture(TextureMap.locationBlocksTexture); + this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false); + this.preTransform(stack); + GlStateManager.enableRescaleNormal(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); + + if (Reflector.ForgeHooksClient_handleCameraTransforms.exists()) + { + model = (IBakedModel)Reflector.call(Reflector.ForgeHooksClient_handleCameraTransforms, new Object[] {model, cameraTransformType}); + } + else + { + ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms(); + itemcameratransforms.applyTransform(cameraTransformType); + + if (this.isThereOneNegativeScale(itemcameratransforms.getTransform(cameraTransformType))) + { + GlStateManager.cullFace(1028); + } + } + + EntityPlayer p; + ItemStack heldStack; + if (cameraTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON && this.lastEntityToRenderFor instanceof EntityPlayer && (heldStack = (p = (EntityPlayer)((Object)this.lastEntityToRenderFor)).getHeldItem()) != null && p.getItemInUseCount() > 0 && heldStack.getItemUseAction() == EnumAction.BLOCK) { + AnimationHandler.INSTANCE.doSwordBlock3rdPersonTransform(); + } + this.renderItem(stack, model); + GlStateManager.cullFace(1029); + GlStateManager.popMatrix(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableBlend(); + this.textureManager.bindTexture(TextureMap.locationBlocksTexture); + this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap(); + } + + private boolean isThereOneNegativeScale(ItemTransformVec3f itemTranformVec) + { + return itemTranformVec.scale.x < 0.0F ^ itemTranformVec.scale.y < 0.0F ^ itemTranformVec.scale.z < 0.0F; + } + + public void renderItemIntoGUI(ItemStack stack, int x, int y) + { + this.renderItemGui = true; + IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack); + GlStateManager.pushMatrix(); + this.textureManager.bindTexture(TextureMap.locationBlocksTexture); + this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.setupGuiTransform(x, y, ibakedmodel.isGui3d()); + + if (Reflector.ForgeHooksClient_handleCameraTransforms.exists()) + { + ibakedmodel = (IBakedModel)Reflector.call(Reflector.ForgeHooksClient_handleCameraTransforms, new Object[] {ibakedmodel, TransformType.GUI}); + } + else + { + ibakedmodel.getItemCameraTransforms().applyTransform(TransformType.GUI); + } + + this.renderItem(stack, ibakedmodel); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); + GlStateManager.disableLighting(); + GlStateManager.popMatrix(); + this.textureManager.bindTexture(TextureMap.locationBlocksTexture); + this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap(); + this.renderItemGui = false; + } + + private void setupGuiTransform(int xPosition, int yPosition, boolean isGui3d) + { + GlStateManager.translate((float)xPosition, (float)yPosition, 100.0F + this.zLevel); + GlStateManager.translate(8.0F, 8.0F, 0.0F); + GlStateManager.scale(1.0F, 1.0F, -1.0F); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + + if (isGui3d) + { + GlStateManager.scale(40.0F, 40.0F, 40.0F); + GlStateManager.rotate(210.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.enableLighting(); + } + else + { + GlStateManager.scale(64.0F, 64.0F, 64.0F); + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.disableLighting(); + } + } + + public void renderItemAndEffectIntoGUI(final ItemStack stack, int xPosition, int yPosition) + { + if (stack != null && stack.getItem() != null) + { + this.zLevel += 50.0F; + + try + { + this.renderItemIntoGUI(stack, xPosition, yPosition); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering item"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being rendered"); + crashreportcategory.addCrashSectionCallable("Item Type", () -> String.valueOf(stack.getItem())); + crashreportcategory.addCrashSectionCallable("Item Aux", () -> String.valueOf(stack.getMetadata())); + crashreportcategory.addCrashSectionCallable("Item NBT", () -> String.valueOf(stack.getTagCompound())); + crashreportcategory.addCrashSectionCallable("Item Foil", () -> String.valueOf(stack.hasEffect())); + throw new ReportedException(crashreport); + } + + this.zLevel -= 50.0F; + } + } + + public void renderItemOverlays(FontRenderer fr, ItemStack stack, int xPosition, int yPosition) + { + this.renderItemOverlayIntoGUI(fr, stack, xPosition, yPosition, (String)null); + } + + public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text) + { + if (stack != null) + { + if (stack.stackSize != 1 || text != null) + { + String s = text == null ? String.valueOf(stack.stackSize) : text; + + if (text == null && stack.stackSize < 1) + { + s = EnumChatFormatting.RED + String.valueOf(stack.stackSize); + } + + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + GlStateManager.disableBlend(); + fr.drawStringWithShadow(s, (float)(xPosition + 19 - 2 - fr.getStringWidth(s)), (float)(yPosition + 6 + 3), 16777215); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + GlStateManager.enableBlend(); + } + + if (ReflectorForge.isItemDamaged(stack)) + { + int j1 = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage()); + int i = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage()); + + if (Reflector.ForgeItem_getDurabilityForDisplay.exists()) + { + double d0 = Reflector.callDouble(stack.getItem(), Reflector.ForgeItem_getDurabilityForDisplay, new Object[] {stack}); + j1 = (int)Math.round(13.0D - d0 * 13.0D); + i = (int)Math.round(255.0D - d0 * 255.0D); + } + + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + GlStateManager.disableTexture2D(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.draw(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); + this.draw(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - i) / 4, 64, 0, 255); + int j = 255 - i; + int k = i; + int l = 0; + + if (Config.isCustomColors()) + { + int i1 = CustomColors.getDurabilityColor(i); + + if (i1 >= 0) + { + j = i1 >> 16 & 255; + k = i1 >> 8 & 255; + l = i1 >> 0 & 255; + } + } + + this.draw(worldrenderer, xPosition + 2, yPosition + 13, j1, 1, j, k, l, 255); + GlStateManager.enableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + } + } + } + + private void draw(WorldRenderer renderer, int x, int y, int width, int height, int red, int green, int blue, int alpha) + { + renderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + renderer.pos((double)(x + 0), (double)(y + 0), 0.0D).color(red, green, blue, alpha).endVertex(); + renderer.pos((double)(x + 0), (double)(y + height), 0.0D).color(red, green, blue, alpha).endVertex(); + renderer.pos((double)(x + width), (double)(y + height), 0.0D).color(red, green, blue, alpha).endVertex(); + renderer.pos((double)(x + width), (double)(y + 0), 0.0D).color(red, green, blue, alpha).endVertex(); + Tessellator.getInstance().draw(); + } + + private void registerItems() + { + this.registerBlock(Blocks.anvil, "anvil_intact"); + this.registerBlock(Blocks.anvil, 1, "anvil_slightly_damaged"); + this.registerBlock(Blocks.anvil, 2, "anvil_very_damaged"); + this.registerBlock(Blocks.carpet, EnumDyeColor.BLACK.getMetadata(), "black_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.BLUE.getMetadata(), "blue_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.BROWN.getMetadata(), "brown_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.CYAN.getMetadata(), "cyan_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.GRAY.getMetadata(), "gray_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.GREEN.getMetadata(), "green_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.LIGHT_BLUE.getMetadata(), "light_blue_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.LIME.getMetadata(), "lime_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.MAGENTA.getMetadata(), "magenta_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.ORANGE.getMetadata(), "orange_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.PINK.getMetadata(), "pink_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.PURPLE.getMetadata(), "purple_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.RED.getMetadata(), "red_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.SILVER.getMetadata(), "silver_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.WHITE.getMetadata(), "white_carpet"); + this.registerBlock(Blocks.carpet, EnumDyeColor.YELLOW.getMetadata(), "yellow_carpet"); + this.registerBlock(Blocks.cobblestone_wall, EnumType.MOSSY.getMetadata(), "mossy_cobblestone_wall"); + this.registerBlock(Blocks.cobblestone_wall, EnumType.NORMAL.getMetadata(), "cobblestone_wall"); + this.registerBlock(Blocks.dirt, DirtType.COARSE_DIRT.getMetadata(), "coarse_dirt"); + this.registerBlock(Blocks.dirt, DirtType.DIRT.getMetadata(), "dirt"); + this.registerBlock(Blocks.dirt, DirtType.PODZOL.getMetadata(), "podzol"); + this.registerBlock(Blocks.double_plant, EnumPlantType.FERN.getMeta(), "double_fern"); + this.registerBlock(Blocks.double_plant, EnumPlantType.GRASS.getMeta(), "double_grass"); + this.registerBlock(Blocks.double_plant, EnumPlantType.PAEONIA.getMeta(), "paeonia"); + this.registerBlock(Blocks.double_plant, EnumPlantType.ROSE.getMeta(), "double_rose"); + this.registerBlock(Blocks.double_plant, EnumPlantType.SUNFLOWER.getMeta(), "sunflower"); + this.registerBlock(Blocks.double_plant, EnumPlantType.SYRINGA.getMeta(), "syringa"); + this.registerBlock(Blocks.leaves, net.minecraft.block.BlockPlanks.EnumType.BIRCH.getMetadata(), "birch_leaves"); + this.registerBlock(Blocks.leaves, net.minecraft.block.BlockPlanks.EnumType.JUNGLE.getMetadata(), "jungle_leaves"); + this.registerBlock(Blocks.leaves, net.minecraft.block.BlockPlanks.EnumType.OAK.getMetadata(), "oak_leaves"); + this.registerBlock(Blocks.leaves, net.minecraft.block.BlockPlanks.EnumType.SPRUCE.getMetadata(), "spruce_leaves"); + this.registerBlock(Blocks.leaves2, net.minecraft.block.BlockPlanks.EnumType.ACACIA.getMetadata() - 4, "acacia_leaves"); + this.registerBlock(Blocks.leaves2, net.minecraft.block.BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4, "dark_oak_leaves"); + this.registerBlock(Blocks.log, net.minecraft.block.BlockPlanks.EnumType.BIRCH.getMetadata(), "birch_log"); + this.registerBlock(Blocks.log, net.minecraft.block.BlockPlanks.EnumType.JUNGLE.getMetadata(), "jungle_log"); + this.registerBlock(Blocks.log, net.minecraft.block.BlockPlanks.EnumType.OAK.getMetadata(), "oak_log"); + this.registerBlock(Blocks.log, net.minecraft.block.BlockPlanks.EnumType.SPRUCE.getMetadata(), "spruce_log"); + this.registerBlock(Blocks.log2, net.minecraft.block.BlockPlanks.EnumType.ACACIA.getMetadata() - 4, "acacia_log"); + this.registerBlock(Blocks.log2, net.minecraft.block.BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4, "dark_oak_log"); + this.registerBlock(Blocks.monster_egg, net.minecraft.block.BlockSilverfish.EnumType.CHISELED_STONEBRICK.getMetadata(), "chiseled_brick_monster_egg"); + this.registerBlock(Blocks.monster_egg, net.minecraft.block.BlockSilverfish.EnumType.COBBLESTONE.getMetadata(), "cobblestone_monster_egg"); + this.registerBlock(Blocks.monster_egg, net.minecraft.block.BlockSilverfish.EnumType.CRACKED_STONEBRICK.getMetadata(), "cracked_brick_monster_egg"); + this.registerBlock(Blocks.monster_egg, net.minecraft.block.BlockSilverfish.EnumType.MOSSY_STONEBRICK.getMetadata(), "mossy_brick_monster_egg"); + this.registerBlock(Blocks.monster_egg, net.minecraft.block.BlockSilverfish.EnumType.STONE.getMetadata(), "stone_monster_egg"); + this.registerBlock(Blocks.monster_egg, net.minecraft.block.BlockSilverfish.EnumType.STONEBRICK.getMetadata(), "stone_brick_monster_egg"); + this.registerBlock(Blocks.planks, net.minecraft.block.BlockPlanks.EnumType.ACACIA.getMetadata(), "acacia_planks"); + this.registerBlock(Blocks.planks, net.minecraft.block.BlockPlanks.EnumType.BIRCH.getMetadata(), "birch_planks"); + this.registerBlock(Blocks.planks, net.minecraft.block.BlockPlanks.EnumType.DARK_OAK.getMetadata(), "dark_oak_planks"); + this.registerBlock(Blocks.planks, net.minecraft.block.BlockPlanks.EnumType.JUNGLE.getMetadata(), "jungle_planks"); + this.registerBlock(Blocks.planks, net.minecraft.block.BlockPlanks.EnumType.OAK.getMetadata(), "oak_planks"); + this.registerBlock(Blocks.planks, net.minecraft.block.BlockPlanks.EnumType.SPRUCE.getMetadata(), "spruce_planks"); + this.registerBlock(Blocks.prismarine, net.minecraft.block.BlockPrismarine.EnumType.BRICKS.getMetadata(), "prismarine_bricks"); + this.registerBlock(Blocks.prismarine, net.minecraft.block.BlockPrismarine.EnumType.DARK.getMetadata(), "dark_prismarine"); + this.registerBlock(Blocks.prismarine, net.minecraft.block.BlockPrismarine.EnumType.ROUGH.getMetadata(), "prismarine"); + this.registerBlock(Blocks.quartz_block, net.minecraft.block.BlockQuartz.EnumType.CHISELED.getMetadata(), "chiseled_quartz_block"); + this.registerBlock(Blocks.quartz_block, net.minecraft.block.BlockQuartz.EnumType.DEFAULT.getMetadata(), "quartz_block"); + this.registerBlock(Blocks.quartz_block, net.minecraft.block.BlockQuartz.EnumType.LINES_Y.getMetadata(), "quartz_column"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.ALLIUM.getMeta(), "allium"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.BLUE_ORCHID.getMeta(), "blue_orchid"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.HOUSTONIA.getMeta(), "houstonia"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.ORANGE_TULIP.getMeta(), "orange_tulip"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.OXEYE_DAISY.getMeta(), "oxeye_daisy"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.PINK_TULIP.getMeta(), "pink_tulip"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.POPPY.getMeta(), "poppy"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.RED_TULIP.getMeta(), "red_tulip"); + this.registerBlock(Blocks.red_flower, EnumFlowerType.WHITE_TULIP.getMeta(), "white_tulip"); + this.registerBlock(Blocks.sand, net.minecraft.block.BlockSand.EnumType.RED_SAND.getMetadata(), "red_sand"); + this.registerBlock(Blocks.sand, net.minecraft.block.BlockSand.EnumType.SAND.getMetadata(), "sand"); + this.registerBlock(Blocks.sandstone, net.minecraft.block.BlockSandStone.EnumType.CHISELED.getMetadata(), "chiseled_sandstone"); + this.registerBlock(Blocks.sandstone, net.minecraft.block.BlockSandStone.EnumType.DEFAULT.getMetadata(), "sandstone"); + this.registerBlock(Blocks.sandstone, net.minecraft.block.BlockSandStone.EnumType.SMOOTH.getMetadata(), "smooth_sandstone"); + this.registerBlock(Blocks.red_sandstone, net.minecraft.block.BlockRedSandstone.EnumType.CHISELED.getMetadata(), "chiseled_red_sandstone"); + this.registerBlock(Blocks.red_sandstone, net.minecraft.block.BlockRedSandstone.EnumType.DEFAULT.getMetadata(), "red_sandstone"); + this.registerBlock(Blocks.red_sandstone, net.minecraft.block.BlockRedSandstone.EnumType.SMOOTH.getMetadata(), "smooth_red_sandstone"); + this.registerBlock(Blocks.sapling, net.minecraft.block.BlockPlanks.EnumType.ACACIA.getMetadata(), "acacia_sapling"); + this.registerBlock(Blocks.sapling, net.minecraft.block.BlockPlanks.EnumType.BIRCH.getMetadata(), "birch_sapling"); + this.registerBlock(Blocks.sapling, net.minecraft.block.BlockPlanks.EnumType.DARK_OAK.getMetadata(), "dark_oak_sapling"); + this.registerBlock(Blocks.sapling, net.minecraft.block.BlockPlanks.EnumType.JUNGLE.getMetadata(), "jungle_sapling"); + this.registerBlock(Blocks.sapling, net.minecraft.block.BlockPlanks.EnumType.OAK.getMetadata(), "oak_sapling"); + this.registerBlock(Blocks.sapling, net.minecraft.block.BlockPlanks.EnumType.SPRUCE.getMetadata(), "spruce_sapling"); + this.registerBlock(Blocks.sponge, 0, "sponge"); + this.registerBlock(Blocks.sponge, 1, "sponge_wet"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.BLACK.getMetadata(), "black_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.BLUE.getMetadata(), "blue_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.BROWN.getMetadata(), "brown_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.CYAN.getMetadata(), "cyan_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.GRAY.getMetadata(), "gray_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.GREEN.getMetadata(), "green_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.LIGHT_BLUE.getMetadata(), "light_blue_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.LIME.getMetadata(), "lime_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.MAGENTA.getMetadata(), "magenta_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.ORANGE.getMetadata(), "orange_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.PINK.getMetadata(), "pink_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.PURPLE.getMetadata(), "purple_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.RED.getMetadata(), "red_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.SILVER.getMetadata(), "silver_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.WHITE.getMetadata(), "white_stained_glass"); + this.registerBlock(Blocks.stained_glass, EnumDyeColor.YELLOW.getMetadata(), "yellow_stained_glass"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.BLACK.getMetadata(), "black_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.BLUE.getMetadata(), "blue_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.BROWN.getMetadata(), "brown_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.CYAN.getMetadata(), "cyan_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.GRAY.getMetadata(), "gray_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.GREEN.getMetadata(), "green_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.LIGHT_BLUE.getMetadata(), "light_blue_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.LIME.getMetadata(), "lime_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.MAGENTA.getMetadata(), "magenta_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.ORANGE.getMetadata(), "orange_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.PINK.getMetadata(), "pink_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.PURPLE.getMetadata(), "purple_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.RED.getMetadata(), "red_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.SILVER.getMetadata(), "silver_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.WHITE.getMetadata(), "white_stained_glass_pane"); + this.registerBlock(Blocks.stained_glass_pane, EnumDyeColor.YELLOW.getMetadata(), "yellow_stained_glass_pane"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.BLACK.getMetadata(), "black_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.BLUE.getMetadata(), "blue_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.BROWN.getMetadata(), "brown_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.CYAN.getMetadata(), "cyan_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.GRAY.getMetadata(), "gray_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.GREEN.getMetadata(), "green_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.LIGHT_BLUE.getMetadata(), "light_blue_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.LIME.getMetadata(), "lime_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.MAGENTA.getMetadata(), "magenta_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.ORANGE.getMetadata(), "orange_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.PINK.getMetadata(), "pink_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.PURPLE.getMetadata(), "purple_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.RED.getMetadata(), "red_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.SILVER.getMetadata(), "silver_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.WHITE.getMetadata(), "white_stained_hardened_clay"); + this.registerBlock(Blocks.stained_hardened_clay, EnumDyeColor.YELLOW.getMetadata(), "yellow_stained_hardened_clay"); + this.registerBlock(Blocks.stone, net.minecraft.block.BlockStone.EnumType.ANDESITE.getMetadata(), "andesite"); + this.registerBlock(Blocks.stone, net.minecraft.block.BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata(), "andesite_smooth"); + this.registerBlock(Blocks.stone, net.minecraft.block.BlockStone.EnumType.DIORITE.getMetadata(), "diorite"); + this.registerBlock(Blocks.stone, net.minecraft.block.BlockStone.EnumType.DIORITE_SMOOTH.getMetadata(), "diorite_smooth"); + this.registerBlock(Blocks.stone, net.minecraft.block.BlockStone.EnumType.GRANITE.getMetadata(), "granite"); + this.registerBlock(Blocks.stone, net.minecraft.block.BlockStone.EnumType.GRANITE_SMOOTH.getMetadata(), "granite_smooth"); + this.registerBlock(Blocks.stone, net.minecraft.block.BlockStone.EnumType.STONE.getMetadata(), "stone"); + this.registerBlock(Blocks.stonebrick, net.minecraft.block.BlockStoneBrick.EnumType.CRACKED.getMetadata(), "cracked_stonebrick"); + this.registerBlock(Blocks.stonebrick, net.minecraft.block.BlockStoneBrick.EnumType.DEFAULT.getMetadata(), "stonebrick"); + this.registerBlock(Blocks.stonebrick, net.minecraft.block.BlockStoneBrick.EnumType.CHISELED.getMetadata(), "chiseled_stonebrick"); + this.registerBlock(Blocks.stonebrick, net.minecraft.block.BlockStoneBrick.EnumType.MOSSY.getMetadata(), "mossy_stonebrick"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.BRICK.getMetadata(), "brick_slab"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.COBBLESTONE.getMetadata(), "cobblestone_slab"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.WOOD.getMetadata(), "old_wood_slab"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.NETHERBRICK.getMetadata(), "nether_brick_slab"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.QUARTZ.getMetadata(), "quartz_slab"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.SAND.getMetadata(), "sandstone_slab"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata(), "stone_brick_slab"); + this.registerBlock(Blocks.stone_slab, net.minecraft.block.BlockStoneSlab.EnumType.STONE.getMetadata(), "stone_slab"); + this.registerBlock(Blocks.stone_slab2, net.minecraft.block.BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata(), "red_sandstone_slab"); + this.registerBlock(Blocks.tallgrass, net.minecraft.block.BlockTallGrass.EnumType.DEAD_BUSH.getMeta(), "dead_bush"); + this.registerBlock(Blocks.tallgrass, net.minecraft.block.BlockTallGrass.EnumType.FERN.getMeta(), "fern"); + this.registerBlock(Blocks.tallgrass, net.minecraft.block.BlockTallGrass.EnumType.GRASS.getMeta(), "tall_grass"); + this.registerBlock(Blocks.wooden_slab, net.minecraft.block.BlockPlanks.EnumType.ACACIA.getMetadata(), "acacia_slab"); + this.registerBlock(Blocks.wooden_slab, net.minecraft.block.BlockPlanks.EnumType.BIRCH.getMetadata(), "birch_slab"); + this.registerBlock(Blocks.wooden_slab, net.minecraft.block.BlockPlanks.EnumType.DARK_OAK.getMetadata(), "dark_oak_slab"); + this.registerBlock(Blocks.wooden_slab, net.minecraft.block.BlockPlanks.EnumType.JUNGLE.getMetadata(), "jungle_slab"); + this.registerBlock(Blocks.wooden_slab, net.minecraft.block.BlockPlanks.EnumType.OAK.getMetadata(), "oak_slab"); + this.registerBlock(Blocks.wooden_slab, net.minecraft.block.BlockPlanks.EnumType.SPRUCE.getMetadata(), "spruce_slab"); + this.registerBlock(Blocks.wool, EnumDyeColor.BLACK.getMetadata(), "black_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.BLUE.getMetadata(), "blue_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.BROWN.getMetadata(), "brown_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.CYAN.getMetadata(), "cyan_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.GRAY.getMetadata(), "gray_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.GREEN.getMetadata(), "green_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.LIGHT_BLUE.getMetadata(), "light_blue_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.LIME.getMetadata(), "lime_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.MAGENTA.getMetadata(), "magenta_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.ORANGE.getMetadata(), "orange_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.PINK.getMetadata(), "pink_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.PURPLE.getMetadata(), "purple_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.RED.getMetadata(), "red_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.SILVER.getMetadata(), "silver_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.WHITE.getMetadata(), "white_wool"); + this.registerBlock(Blocks.wool, EnumDyeColor.YELLOW.getMetadata(), "yellow_wool"); + this.registerBlock(Blocks.acacia_stairs, "acacia_stairs"); + this.registerBlock(Blocks.activator_rail, "activator_rail"); + this.registerBlock(Blocks.beacon, "beacon"); + this.registerBlock(Blocks.bedrock, "bedrock"); + this.registerBlock(Blocks.birch_stairs, "birch_stairs"); + this.registerBlock(Blocks.bookshelf, "bookshelf"); + this.registerBlock(Blocks.brick_block, "brick_block"); + this.registerBlock(Blocks.brick_block, "brick_block"); + this.registerBlock(Blocks.brick_stairs, "brick_stairs"); + this.registerBlock(Blocks.brown_mushroom, "brown_mushroom"); + this.registerBlock(Blocks.cactus, "cactus"); + this.registerBlock(Blocks.clay, "clay"); + this.registerBlock(Blocks.coal_block, "coal_block"); + this.registerBlock(Blocks.coal_ore, "coal_ore"); + this.registerBlock(Blocks.cobblestone, "cobblestone"); + this.registerBlock(Blocks.crafting_table, "crafting_table"); + this.registerBlock(Blocks.dark_oak_stairs, "dark_oak_stairs"); + this.registerBlock(Blocks.daylight_detector, "daylight_detector"); + this.registerBlock(Blocks.deadbush, "dead_bush"); + this.registerBlock(Blocks.detector_rail, "detector_rail"); + this.registerBlock(Blocks.diamond_block, "diamond_block"); + this.registerBlock(Blocks.diamond_ore, "diamond_ore"); + this.registerBlock(Blocks.dispenser, "dispenser"); + this.registerBlock(Blocks.dropper, "dropper"); + this.registerBlock(Blocks.emerald_block, "emerald_block"); + this.registerBlock(Blocks.emerald_ore, "emerald_ore"); + this.registerBlock(Blocks.enchanting_table, "enchanting_table"); + this.registerBlock(Blocks.end_portal_frame, "end_portal_frame"); + this.registerBlock(Blocks.end_stone, "end_stone"); + this.registerBlock(Blocks.oak_fence, "oak_fence"); + this.registerBlock(Blocks.spruce_fence, "spruce_fence"); + this.registerBlock(Blocks.birch_fence, "birch_fence"); + this.registerBlock(Blocks.jungle_fence, "jungle_fence"); + this.registerBlock(Blocks.dark_oak_fence, "dark_oak_fence"); + this.registerBlock(Blocks.acacia_fence, "acacia_fence"); + this.registerBlock(Blocks.oak_fence_gate, "oak_fence_gate"); + this.registerBlock(Blocks.spruce_fence_gate, "spruce_fence_gate"); + this.registerBlock(Blocks.birch_fence_gate, "birch_fence_gate"); + this.registerBlock(Blocks.jungle_fence_gate, "jungle_fence_gate"); + this.registerBlock(Blocks.dark_oak_fence_gate, "dark_oak_fence_gate"); + this.registerBlock(Blocks.acacia_fence_gate, "acacia_fence_gate"); + this.registerBlock(Blocks.furnace, "furnace"); + this.registerBlock(Blocks.glass, "glass"); + this.registerBlock(Blocks.glass_pane, "glass_pane"); + this.registerBlock(Blocks.glowstone, "glowstone"); + this.registerBlock(Blocks.golden_rail, "golden_rail"); + this.registerBlock(Blocks.gold_block, "gold_block"); + this.registerBlock(Blocks.gold_ore, "gold_ore"); + this.registerBlock(Blocks.grass, "grass"); + this.registerBlock(Blocks.gravel, "gravel"); + this.registerBlock(Blocks.hardened_clay, "hardened_clay"); + this.registerBlock(Blocks.hay_block, "hay_block"); + this.registerBlock(Blocks.heavy_weighted_pressure_plate, "heavy_weighted_pressure_plate"); + this.registerBlock(Blocks.hopper, "hopper"); + this.registerBlock(Blocks.ice, "ice"); + this.registerBlock(Blocks.iron_bars, "iron_bars"); + this.registerBlock(Blocks.iron_block, "iron_block"); + this.registerBlock(Blocks.iron_ore, "iron_ore"); + this.registerBlock(Blocks.iron_trapdoor, "iron_trapdoor"); + this.registerBlock(Blocks.jukebox, "jukebox"); + this.registerBlock(Blocks.jungle_stairs, "jungle_stairs"); + this.registerBlock(Blocks.ladder, "ladder"); + this.registerBlock(Blocks.lapis_block, "lapis_block"); + this.registerBlock(Blocks.lapis_ore, "lapis_ore"); + this.registerBlock(Blocks.lever, "lever"); + this.registerBlock(Blocks.light_weighted_pressure_plate, "light_weighted_pressure_plate"); + this.registerBlock(Blocks.lit_pumpkin, "lit_pumpkin"); + this.registerBlock(Blocks.melon_block, "melon_block"); + this.registerBlock(Blocks.mossy_cobblestone, "mossy_cobblestone"); + this.registerBlock(Blocks.mycelium, "mycelium"); + this.registerBlock(Blocks.netherrack, "netherrack"); + this.registerBlock(Blocks.nether_brick, "nether_brick"); + this.registerBlock(Blocks.nether_brick_fence, "nether_brick_fence"); + this.registerBlock(Blocks.nether_brick_stairs, "nether_brick_stairs"); + this.registerBlock(Blocks.noteblock, "noteblock"); + this.registerBlock(Blocks.oak_stairs, "oak_stairs"); + this.registerBlock(Blocks.obsidian, "obsidian"); + this.registerBlock(Blocks.packed_ice, "packed_ice"); + this.registerBlock(Blocks.piston, "piston"); + this.registerBlock(Blocks.pumpkin, "pumpkin"); + this.registerBlock(Blocks.quartz_ore, "quartz_ore"); + this.registerBlock(Blocks.quartz_stairs, "quartz_stairs"); + this.registerBlock(Blocks.rail, "rail"); + this.registerBlock(Blocks.redstone_block, "redstone_block"); + this.registerBlock(Blocks.redstone_lamp, "redstone_lamp"); + this.registerBlock(Blocks.redstone_ore, "redstone_ore"); + this.registerBlock(Blocks.redstone_torch, "redstone_torch"); + this.registerBlock(Blocks.red_mushroom, "red_mushroom"); + this.registerBlock(Blocks.sandstone_stairs, "sandstone_stairs"); + this.registerBlock(Blocks.red_sandstone_stairs, "red_sandstone_stairs"); + this.registerBlock(Blocks.sea_lantern, "sea_lantern"); + this.registerBlock(Blocks.slime_block, "slime"); + this.registerBlock(Blocks.snow, "snow"); + this.registerBlock(Blocks.snow_layer, "snow_layer"); + this.registerBlock(Blocks.soul_sand, "soul_sand"); + this.registerBlock(Blocks.spruce_stairs, "spruce_stairs"); + this.registerBlock(Blocks.sticky_piston, "sticky_piston"); + this.registerBlock(Blocks.stone_brick_stairs, "stone_brick_stairs"); + this.registerBlock(Blocks.stone_button, "stone_button"); + this.registerBlock(Blocks.stone_pressure_plate, "stone_pressure_plate"); + this.registerBlock(Blocks.stone_stairs, "stone_stairs"); + this.registerBlock(Blocks.tnt, "tnt"); + this.registerBlock(Blocks.torch, "torch"); + this.registerBlock(Blocks.trapdoor, "trapdoor"); + this.registerBlock(Blocks.tripwire_hook, "tripwire_hook"); + this.registerBlock(Blocks.vine, "vine"); + this.registerBlock(Blocks.waterlily, "waterlily"); + this.registerBlock(Blocks.web, "web"); + this.registerBlock(Blocks.wooden_button, "wooden_button"); + this.registerBlock(Blocks.wooden_pressure_plate, "wooden_pressure_plate"); + this.registerBlock(Blocks.yellow_flower, EnumFlowerType.DANDELION.getMeta(), "dandelion"); + this.registerBlock(Blocks.chest, "chest"); + this.registerBlock(Blocks.trapped_chest, "trapped_chest"); + this.registerBlock(Blocks.ender_chest, "ender_chest"); + this.registerItem(Items.iron_shovel, "iron_shovel"); + this.registerItem(Items.iron_pickaxe, "iron_pickaxe"); + this.registerItem(Items.iron_axe, "iron_axe"); + this.registerItem(Items.flint_and_steel, "flint_and_steel"); + this.registerItem(Items.apple, "apple"); + this.registerItem(Items.bow, 0, "bow"); + this.registerItem(Items.bow, 1, "bow_pulling_0"); + this.registerItem(Items.bow, 2, "bow_pulling_1"); + this.registerItem(Items.bow, 3, "bow_pulling_2"); + this.registerItem(Items.arrow, "arrow"); + this.registerItem(Items.coal, 0, "coal"); + this.registerItem(Items.coal, 1, "charcoal"); + this.registerItem(Items.diamond, "diamond"); + this.registerItem(Items.iron_ingot, "iron_ingot"); + this.registerItem(Items.gold_ingot, "gold_ingot"); + this.registerItem(Items.iron_sword, "iron_sword"); + this.registerItem(Items.wooden_sword, "wooden_sword"); + this.registerItem(Items.wooden_shovel, "wooden_shovel"); + this.registerItem(Items.wooden_pickaxe, "wooden_pickaxe"); + this.registerItem(Items.wooden_axe, "wooden_axe"); + this.registerItem(Items.stone_sword, "stone_sword"); + this.registerItem(Items.stone_shovel, "stone_shovel"); + this.registerItem(Items.stone_pickaxe, "stone_pickaxe"); + this.registerItem(Items.stone_axe, "stone_axe"); + this.registerItem(Items.diamond_sword, "diamond_sword"); + this.registerItem(Items.diamond_shovel, "diamond_shovel"); + this.registerItem(Items.diamond_pickaxe, "diamond_pickaxe"); + this.registerItem(Items.diamond_axe, "diamond_axe"); + this.registerItem(Items.stick, "stick"); + this.registerItem(Items.bowl, "bowl"); + this.registerItem(Items.mushroom_stew, "mushroom_stew"); + this.registerItem(Items.golden_sword, "golden_sword"); + this.registerItem(Items.golden_shovel, "golden_shovel"); + this.registerItem(Items.golden_pickaxe, "golden_pickaxe"); + this.registerItem(Items.golden_axe, "golden_axe"); + this.registerItem(Items.string, "string"); + this.registerItem(Items.feather, "feather"); + this.registerItem(Items.gunpowder, "gunpowder"); + this.registerItem(Items.wooden_hoe, "wooden_hoe"); + this.registerItem(Items.stone_hoe, "stone_hoe"); + this.registerItem(Items.iron_hoe, "iron_hoe"); + this.registerItem(Items.diamond_hoe, "diamond_hoe"); + this.registerItem(Items.golden_hoe, "golden_hoe"); + this.registerItem(Items.wheat_seeds, "wheat_seeds"); + this.registerItem(Items.wheat, "wheat"); + this.registerItem(Items.bread, "bread"); + this.registerItem(Items.leather_helmet, "leather_helmet"); + this.registerItem(Items.leather_chestplate, "leather_chestplate"); + this.registerItem(Items.leather_leggings, "leather_leggings"); + this.registerItem(Items.leather_boots, "leather_boots"); + this.registerItem(Items.chainmail_helmet, "chainmail_helmet"); + this.registerItem(Items.chainmail_chestplate, "chainmail_chestplate"); + this.registerItem(Items.chainmail_leggings, "chainmail_leggings"); + this.registerItem(Items.chainmail_boots, "chainmail_boots"); + this.registerItem(Items.iron_helmet, "iron_helmet"); + this.registerItem(Items.iron_chestplate, "iron_chestplate"); + this.registerItem(Items.iron_leggings, "iron_leggings"); + this.registerItem(Items.iron_boots, "iron_boots"); + this.registerItem(Items.diamond_helmet, "diamond_helmet"); + this.registerItem(Items.diamond_chestplate, "diamond_chestplate"); + this.registerItem(Items.diamond_leggings, "diamond_leggings"); + this.registerItem(Items.diamond_boots, "diamond_boots"); + this.registerItem(Items.golden_helmet, "golden_helmet"); + this.registerItem(Items.golden_chestplate, "golden_chestplate"); + this.registerItem(Items.golden_leggings, "golden_leggings"); + this.registerItem(Items.golden_boots, "golden_boots"); + this.registerItem(Items.flint, "flint"); + this.registerItem(Items.porkchop, "porkchop"); + this.registerItem(Items.cooked_porkchop, "cooked_porkchop"); + this.registerItem(Items.painting, "painting"); + this.registerItem(Items.golden_apple, "golden_apple"); + this.registerItem(Items.golden_apple, 1, "golden_apple"); + this.registerItem(Items.sign, "sign"); + this.registerItem(Items.oak_door, "oak_door"); + this.registerItem(Items.spruce_door, "spruce_door"); + this.registerItem(Items.birch_door, "birch_door"); + this.registerItem(Items.jungle_door, "jungle_door"); + this.registerItem(Items.acacia_door, "acacia_door"); + this.registerItem(Items.dark_oak_door, "dark_oak_door"); + this.registerItem(Items.bucket, "bucket"); + this.registerItem(Items.water_bucket, "water_bucket"); + this.registerItem(Items.lava_bucket, "lava_bucket"); + this.registerItem(Items.minecart, "minecart"); + this.registerItem(Items.saddle, "saddle"); + this.registerItem(Items.iron_door, "iron_door"); + this.registerItem(Items.redstone, "redstone"); + this.registerItem(Items.snowball, "snowball"); + this.registerItem(Items.boat, "boat"); + this.registerItem(Items.leather, "leather"); + this.registerItem(Items.milk_bucket, "milk_bucket"); + this.registerItem(Items.brick, "brick"); + this.registerItem(Items.clay_ball, "clay_ball"); + this.registerItem(Items.reeds, "reeds"); + this.registerItem(Items.paper, "paper"); + this.registerItem(Items.book, "book"); + this.registerItem(Items.slime_ball, "slime_ball"); + this.registerItem(Items.chest_minecart, "chest_minecart"); + this.registerItem(Items.furnace_minecart, "furnace_minecart"); + this.registerItem(Items.egg, "egg"); + this.registerItem(Items.compass, "compass"); + this.registerItem(Items.fishing_rod, "fishing_rod"); + this.registerItem(Items.fishing_rod, 1, "fishing_rod_cast"); + this.registerItem(Items.clock, "clock"); + this.registerItem(Items.glowstone_dust, "glowstone_dust"); + this.registerItem(Items.fish, FishType.COD.getMetadata(), "cod"); + this.registerItem(Items.fish, FishType.SALMON.getMetadata(), "salmon"); + this.registerItem(Items.fish, FishType.CLOWNFISH.getMetadata(), "clownfish"); + this.registerItem(Items.fish, FishType.PUFFERFISH.getMetadata(), "pufferfish"); + this.registerItem(Items.cooked_fish, FishType.COD.getMetadata(), "cooked_cod"); + this.registerItem(Items.cooked_fish, FishType.SALMON.getMetadata(), "cooked_salmon"); + this.registerItem(Items.dye, EnumDyeColor.BLACK.getDyeDamage(), "dye_black"); + this.registerItem(Items.dye, EnumDyeColor.RED.getDyeDamage(), "dye_red"); + this.registerItem(Items.dye, EnumDyeColor.GREEN.getDyeDamage(), "dye_green"); + this.registerItem(Items.dye, EnumDyeColor.BROWN.getDyeDamage(), "dye_brown"); + this.registerItem(Items.dye, EnumDyeColor.BLUE.getDyeDamage(), "dye_blue"); + this.registerItem(Items.dye, EnumDyeColor.PURPLE.getDyeDamage(), "dye_purple"); + this.registerItem(Items.dye, EnumDyeColor.CYAN.getDyeDamage(), "dye_cyan"); + this.registerItem(Items.dye, EnumDyeColor.SILVER.getDyeDamage(), "dye_silver"); + this.registerItem(Items.dye, EnumDyeColor.GRAY.getDyeDamage(), "dye_gray"); + this.registerItem(Items.dye, EnumDyeColor.PINK.getDyeDamage(), "dye_pink"); + this.registerItem(Items.dye, EnumDyeColor.LIME.getDyeDamage(), "dye_lime"); + this.registerItem(Items.dye, EnumDyeColor.YELLOW.getDyeDamage(), "dye_yellow"); + this.registerItem(Items.dye, EnumDyeColor.LIGHT_BLUE.getDyeDamage(), "dye_light_blue"); + this.registerItem(Items.dye, EnumDyeColor.MAGENTA.getDyeDamage(), "dye_magenta"); + this.registerItem(Items.dye, EnumDyeColor.ORANGE.getDyeDamage(), "dye_orange"); + this.registerItem(Items.dye, EnumDyeColor.WHITE.getDyeDamage(), "dye_white"); + this.registerItem(Items.bone, "bone"); + this.registerItem(Items.sugar, "sugar"); + this.registerItem(Items.cake, "cake"); + this.registerItem(Items.bed, "bed"); + this.registerItem(Items.repeater, "repeater"); + this.registerItem(Items.cookie, "cookie"); + this.registerItem(Items.shears, "shears"); + this.registerItem(Items.melon, "melon"); + this.registerItem(Items.pumpkin_seeds, "pumpkin_seeds"); + this.registerItem(Items.melon_seeds, "melon_seeds"); + this.registerItem(Items.beef, "beef"); + this.registerItem(Items.cooked_beef, "cooked_beef"); + this.registerItem(Items.chicken, "chicken"); + this.registerItem(Items.cooked_chicken, "cooked_chicken"); + this.registerItem(Items.rabbit, "rabbit"); + this.registerItem(Items.cooked_rabbit, "cooked_rabbit"); + this.registerItem(Items.mutton, "mutton"); + this.registerItem(Items.cooked_mutton, "cooked_mutton"); + this.registerItem(Items.rabbit_foot, "rabbit_foot"); + this.registerItem(Items.rabbit_hide, "rabbit_hide"); + this.registerItem(Items.rabbit_stew, "rabbit_stew"); + this.registerItem(Items.rotten_flesh, "rotten_flesh"); + this.registerItem(Items.ender_pearl, "ender_pearl"); + this.registerItem(Items.blaze_rod, "blaze_rod"); + this.registerItem(Items.ghast_tear, "ghast_tear"); + this.registerItem(Items.gold_nugget, "gold_nugget"); + this.registerItem(Items.nether_wart, "nether_wart"); + this.itemModelMesher.register(Items.potionitem, new ItemMeshDefinition() + { + public ModelResourceLocation getModelLocation(ItemStack stack) + { + return ItemPotion.isSplash(stack.getMetadata()) ? new ModelResourceLocation("bottle_splash", "inventory") : new ModelResourceLocation("bottle_drinkable", "inventory"); + } + }); + this.registerItem(Items.glass_bottle, "glass_bottle"); + this.registerItem(Items.spider_eye, "spider_eye"); + this.registerItem(Items.fermented_spider_eye, "fermented_spider_eye"); + this.registerItem(Items.blaze_powder, "blaze_powder"); + this.registerItem(Items.magma_cream, "magma_cream"); + this.registerItem(Items.brewing_stand, "brewing_stand"); + this.registerItem(Items.cauldron, "cauldron"); + this.registerItem(Items.ender_eye, "ender_eye"); + this.registerItem(Items.speckled_melon, "speckled_melon"); + this.itemModelMesher.register(Items.spawn_egg, new ItemMeshDefinition() + { + public ModelResourceLocation getModelLocation(ItemStack stack) + { + return new ModelResourceLocation("spawn_egg", "inventory"); + } + }); + this.registerItem(Items.experience_bottle, "experience_bottle"); + this.registerItem(Items.fire_charge, "fire_charge"); + this.registerItem(Items.writable_book, "writable_book"); + this.registerItem(Items.emerald, "emerald"); + this.registerItem(Items.item_frame, "item_frame"); + this.registerItem(Items.flower_pot, "flower_pot"); + this.registerItem(Items.carrot, "carrot"); + this.registerItem(Items.potato, "potato"); + this.registerItem(Items.baked_potato, "baked_potato"); + this.registerItem(Items.poisonous_potato, "poisonous_potato"); + this.registerItem(Items.map, "map"); + this.registerItem(Items.golden_carrot, "golden_carrot"); + this.registerItem(Items.skull, 0, "skull_skeleton"); + this.registerItem(Items.skull, 1, "skull_wither"); + this.registerItem(Items.skull, 2, "skull_zombie"); + this.registerItem(Items.skull, 3, "skull_char"); + this.registerItem(Items.skull, 4, "skull_creeper"); + this.registerItem(Items.carrot_on_a_stick, "carrot_on_a_stick"); + this.registerItem(Items.nether_star, "nether_star"); + this.registerItem(Items.pumpkin_pie, "pumpkin_pie"); + this.registerItem(Items.firework_charge, "firework_charge"); + this.registerItem(Items.comparator, "comparator"); + this.registerItem(Items.netherbrick, "netherbrick"); + this.registerItem(Items.quartz, "quartz"); + this.registerItem(Items.tnt_minecart, "tnt_minecart"); + this.registerItem(Items.hopper_minecart, "hopper_minecart"); + this.registerItem(Items.armor_stand, "armor_stand"); + this.registerItem(Items.iron_horse_armor, "iron_horse_armor"); + this.registerItem(Items.golden_horse_armor, "golden_horse_armor"); + this.registerItem(Items.diamond_horse_armor, "diamond_horse_armor"); + this.registerItem(Items.lead, "lead"); + this.registerItem(Items.name_tag, "name_tag"); + this.itemModelMesher.register(Items.banner, new ItemMeshDefinition() + { + public ModelResourceLocation getModelLocation(ItemStack stack) + { + return new ModelResourceLocation("banner", "inventory"); + } + }); + this.registerItem(Items.record_13, "record_13"); + this.registerItem(Items.record_cat, "record_cat"); + this.registerItem(Items.record_blocks, "record_blocks"); + this.registerItem(Items.record_chirp, "record_chirp"); + this.registerItem(Items.record_far, "record_far"); + this.registerItem(Items.record_mall, "record_mall"); + this.registerItem(Items.record_mellohi, "record_mellohi"); + this.registerItem(Items.record_stal, "record_stal"); + this.registerItem(Items.record_strad, "record_strad"); + this.registerItem(Items.record_ward, "record_ward"); + this.registerItem(Items.record_11, "record_11"); + this.registerItem(Items.record_wait, "record_wait"); + this.registerItem(Items.prismarine_shard, "prismarine_shard"); + this.registerItem(Items.prismarine_crystals, "prismarine_crystals"); + this.itemModelMesher.register(Items.enchanted_book, new ItemMeshDefinition() + { + public ModelResourceLocation getModelLocation(ItemStack stack) + { + return new ModelResourceLocation("enchanted_book", "inventory"); + } + }); + this.itemModelMesher.register(Items.filled_map, new ItemMeshDefinition() + { + public ModelResourceLocation getModelLocation(ItemStack stack) + { + return new ModelResourceLocation("filled_map", "inventory"); + } + }); + this.registerBlock(Blocks.command_block, "command_block"); + this.registerItem(Items.fireworks, "fireworks"); + this.registerItem(Items.command_block_minecart, "command_block_minecart"); + this.registerBlock(Blocks.barrier, "barrier"); + this.registerBlock(Blocks.mob_spawner, "mob_spawner"); + this.registerItem(Items.written_book, "written_book"); + this.registerBlock(Blocks.brown_mushroom_block, net.minecraft.block.BlockHugeMushroom.EnumType.ALL_INSIDE.getMetadata(), "brown_mushroom_block"); + this.registerBlock(Blocks.red_mushroom_block, net.minecraft.block.BlockHugeMushroom.EnumType.ALL_INSIDE.getMetadata(), "red_mushroom_block"); + this.registerBlock(Blocks.dragon_egg, "dragon_egg"); + + if (Reflector.ModelLoader_onRegisterItems.exists()) + { + Reflector.call(Reflector.ModelLoader_onRegisterItems, new Object[] {this.itemModelMesher}); + } + } + + public void onResourceManagerReload(IResourceManager resourceManager) + { + this.itemModelMesher.rebuildCache(); + } + + public static void forgeHooksClient_putQuadColor(WorldRenderer p_forgeHooksClient_putQuadColor_0_, BakedQuad p_forgeHooksClient_putQuadColor_1_, int p_forgeHooksClient_putQuadColor_2_) + { + float f = (float)(p_forgeHooksClient_putQuadColor_2_ & 255); + float f1 = (float)(p_forgeHooksClient_putQuadColor_2_ >>> 8 & 255); + float f2 = (float)(p_forgeHooksClient_putQuadColor_2_ >>> 16 & 255); + float f3 = (float)(p_forgeHooksClient_putQuadColor_2_ >>> 24 & 255); + int[] aint = p_forgeHooksClient_putQuadColor_1_.getVertexData(); + int i = aint.length / 4; + + for (int j = 0; j < 4; ++j) + { + int k = aint[3 + i * j]; + float f4 = (float)(k & 255); + float f5 = (float)(k >>> 8 & 255); + float f6 = (float)(k >>> 16 & 255); + float f7 = (float)(k >>> 24 & 255); + int l = Math.min(255, (int)(f * f4 / 255.0F)); + int i1 = Math.min(255, (int)(f1 * f5 / 255.0F)); + int j1 = Math.min(255, (int)(f2 * f6 / 255.0F)); + int k1 = Math.min(255, (int)(f3 * f7 / 255.0F)); + p_forgeHooksClient_putQuadColor_0_.putColorRGBA(p_forgeHooksClient_putQuadColor_0_.getColorIndex(4 - j), l, i1, j1, k1); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLeashKnot.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLeashKnot.java new file mode 100644 index 0000000..0091979 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLeashKnot.java @@ -0,0 +1,37 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelLeashKnot; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.util.ResourceLocation; + +public class RenderLeashKnot extends Render +{ + private static final ResourceLocation leashKnotTextures = new ResourceLocation("textures/entity/lead_knot.png"); + private ModelLeashKnot leashKnotModel = new ModelLeashKnot(); + + public RenderLeashKnot(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + public void doRender(EntityLeashKnot entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.disableCull(); + GlStateManager.translate((float)x, (float)y, (float)z); + float f = 0.0625F; + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(-1.0F, -1.0F, 1.0F); + GlStateManager.enableAlpha(); + this.bindEntityTexture(entity); + this.leashKnotModel.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityLeashKnot entity) + { + return leashKnotTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java new file mode 100644 index 0000000..e616eb2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLightningBolt.java @@ -0,0 +1,143 @@ +package net.minecraft.client.renderer.entity; + +import java.util.Random; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.util.ResourceLocation; + +public class RenderLightningBolt extends Render +{ + public RenderLightningBolt(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + public void doRender(EntityLightningBolt entity, double x, double y, double z, float entityYaw, float partialTicks) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 1); + double[] adouble = new double[8]; + double[] adouble1 = new double[8]; + double d0 = 0.0D; + double d1 = 0.0D; + Random random = new Random(entity.boltVertex); + + for (int i = 7; i >= 0; --i) + { + adouble[i] = d0; + adouble1[i] = d1; + d0 += (double)(random.nextInt(11) - 5); + d1 += (double)(random.nextInt(11) - 5); + } + + for (int k1 = 0; k1 < 4; ++k1) + { + Random random1 = new Random(entity.boltVertex); + + for (int j = 0; j < 3; ++j) + { + int k = 7; + int l = 0; + + if (j > 0) + { + k = 7 - j; + } + + if (j > 0) + { + l = k - 2; + } + + double d2 = adouble[k] - d0; + double d3 = adouble1[k] - d1; + + for (int i1 = k; i1 >= l; --i1) + { + double d4 = d2; + double d5 = d3; + + if (j == 0) + { + d2 += (double)(random1.nextInt(11) - 5); + d3 += (double)(random1.nextInt(11) - 5); + } + else + { + d2 += (double)(random1.nextInt(31) - 15); + d3 += (double)(random1.nextInt(31) - 15); + } + + worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR); + float f = 0.5F; + float f1 = 0.45F; + float f2 = 0.45F; + float f3 = 0.5F; + double d6 = 0.1D + (double)k1 * 0.2D; + + if (j == 0) + { + d6 *= (double)i1 * 0.1D + 1.0D; + } + + double d7 = 0.1D + (double)k1 * 0.2D; + + if (j == 0) + { + d7 *= (double)(i1 - 1) * 0.1D + 1.0D; + } + + for (int j1 = 0; j1 < 5; ++j1) + { + double d8 = x + 0.5D - d6; + double d9 = z + 0.5D - d6; + + if (j1 == 1 || j1 == 2) + { + d8 += d6 * 2.0D; + } + + if (j1 == 2 || j1 == 3) + { + d9 += d6 * 2.0D; + } + + double d10 = x + 0.5D - d7; + double d11 = z + 0.5D - d7; + + if (j1 == 1 || j1 == 2) + { + d10 += d7 * 2.0D; + } + + if (j1 == 2 || j1 == 3) + { + d11 += d7 * 2.0D; + } + + worldrenderer.pos(d10 + d2, y + (double)(i1 * 16), d11 + d3).color(0.45F, 0.45F, 0.5F, 0.3F).endVertex(); + worldrenderer.pos(d8 + d4, y + (double)((i1 + 1) * 16), d9 + d5).color(0.45F, 0.45F, 0.5F, 0.3F).endVertex(); + } + + tessellator.draw(); + } + } + } + + GlStateManager.disableBlend(); + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + } + + protected ResourceLocation getEntityTexture(EntityLightningBolt entity) + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLiving.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLiving.java new file mode 100644 index 0000000..c022948 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderLiving.java @@ -0,0 +1,179 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.EntityLiving; +import net.minecraft.src.Config; +import net.optifine.shaders.Shaders; + +public abstract class RenderLiving extends RendererLivingEntity +{ + public RenderLiving(RenderManager rendermanagerIn, ModelBase modelbaseIn, float shadowsizeIn) + { + super(rendermanagerIn, modelbaseIn, shadowsizeIn); + } + + protected boolean canRenderName(T entity) + { + return super.canRenderName(entity) && (entity.getAlwaysRenderNameTagForRender() || entity.hasCustomName() && entity == this.renderManager.pointedEntity); + } + + public boolean shouldRender(T livingEntity, ICamera camera, double camX, double camY, double camZ) + { + if (super.shouldRender(livingEntity, camera, camX, camY, camZ)) + { + return true; + } + else if (livingEntity.getLeashed() && livingEntity.getLeashedToEntity() != null) + { + Entity entity = livingEntity.getLeashedToEntity(); + return camera.isBoundingBoxInFrustum(entity.getEntityBoundingBox()); + } + else + { + return false; + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render) and this method has signature public void doRender(T entity, double d, double d1, + * double d2, float f, float f1). But JAD is pre 1.5 so doe + * + * @param entityYaw The yaw rotation of the passed entity + */ + public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) + { + super.doRender(entity, x, y, z, entityYaw, partialTicks); + this.renderLeash(entity, x, y, z, entityYaw, partialTicks); + } + + public void setLightmap(T entityLivingIn, float partialTicks) + { + int i = entityLivingIn.getBrightnessForRender(partialTicks); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + } + + /** + * Gets the value between start and end according to pct + */ + private double interpolateValue(double start, double end, double pct) + { + return start + (end - start) * pct; + } + + protected void renderLeash(T entityLivingIn, double x, double y, double z, float entityYaw, float partialTicks) + { + if (!Config.isShaders() || !Shaders.isShadowPass) + { + Entity entity = entityLivingIn.getLeashedToEntity(); + + if (entity != null) + { + y = y - (1.6D - (double)entityLivingIn.height) * 0.5D; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + double d0 = this.interpolateValue((double)entity.prevRotationYaw, (double)entity.rotationYaw, (double)(partialTicks * 0.5F)) * 0.01745329238474369D; + double d1 = this.interpolateValue((double)entity.prevRotationPitch, (double)entity.rotationPitch, (double)(partialTicks * 0.5F)) * 0.01745329238474369D; + double d2 = Math.cos(d0); + double d3 = Math.sin(d0); + double d4 = Math.sin(d1); + + if (entity instanceof EntityHanging) + { + d2 = 0.0D; + d3 = 0.0D; + d4 = -1.0D; + } + + double d5 = Math.cos(d1); + double d6 = this.interpolateValue(entity.prevPosX, entity.posX, (double)partialTicks) - d2 * 0.7D - d3 * 0.5D * d5; + double d7 = this.interpolateValue(entity.prevPosY + (double)entity.getEyeHeight() * 0.7D, entity.posY + (double)entity.getEyeHeight() * 0.7D, (double)partialTicks) - d4 * 0.5D - 0.25D; + double d8 = this.interpolateValue(entity.prevPosZ, entity.posZ, (double)partialTicks) - d3 * 0.7D + d2 * 0.5D * d5; + double d9 = this.interpolateValue((double)entityLivingIn.prevRenderYawOffset, (double)entityLivingIn.renderYawOffset, (double)partialTicks) * 0.01745329238474369D + (Math.PI / 2D); + d2 = Math.cos(d9) * (double)entityLivingIn.width * 0.4D; + d3 = Math.sin(d9) * (double)entityLivingIn.width * 0.4D; + double d10 = this.interpolateValue(entityLivingIn.prevPosX, entityLivingIn.posX, (double)partialTicks) + d2; + double d11 = this.interpolateValue(entityLivingIn.prevPosY, entityLivingIn.posY, (double)partialTicks); + double d12 = this.interpolateValue(entityLivingIn.prevPosZ, entityLivingIn.posZ, (double)partialTicks) + d3; + x = x + d2; + z = z + d3; + double d13 = (double)((float)(d6 - d10)); + double d14 = (double)((float)(d7 - d11)); + double d15 = (double)((float)(d8 - d12)); + GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); + GlStateManager.disableCull(); + + if (Config.isShaders()) + { + Shaders.beginLeash(); + } + + int i = 24; + double d16 = 0.025D; + worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR); + + for (int j = 0; j <= 24; ++j) + { + float f = 0.5F; + float f1 = 0.4F; + float f2 = 0.3F; + + if (j % 2 == 0) + { + f *= 0.7F; + f1 *= 0.7F; + f2 *= 0.7F; + } + + float f3 = (float)j / 24.0F; + worldrenderer.pos(x + d13 * (double)f3 + 0.0D, y + d14 * (double)(f3 * f3 + f3) * 0.5D + (double)((24.0F - (float)j) / 18.0F + 0.125F), z + d15 * (double)f3).color(f, f1, f2, 1.0F).endVertex(); + worldrenderer.pos(x + d13 * (double)f3 + 0.025D, y + d14 * (double)(f3 * f3 + f3) * 0.5D + (double)((24.0F - (float)j) / 18.0F + 0.125F) + 0.025D, z + d15 * (double)f3).color(f, f1, f2, 1.0F).endVertex(); + } + + tessellator.draw(); + worldrenderer.begin(5, DefaultVertexFormats.POSITION_COLOR); + + for (int k = 0; k <= 24; ++k) + { + float f4 = 0.5F; + float f5 = 0.4F; + float f6 = 0.3F; + + if (k % 2 == 0) + { + f4 *= 0.7F; + f5 *= 0.7F; + f6 *= 0.7F; + } + + float f7 = (float)k / 24.0F; + worldrenderer.pos(x + d13 * (double)f7 + 0.0D, y + d14 * (double)(f7 * f7 + f7) * 0.5D + (double)((24.0F - (float)k) / 18.0F + 0.125F) + 0.025D, z + d15 * (double)f7).color(f4, f5, f6, 1.0F).endVertex(); + worldrenderer.pos(x + d13 * (double)f7 + 0.025D, y + d14 * (double)(f7 * f7 + f7) * 0.5D + (double)((24.0F - (float)k) / 18.0F + 0.125F), z + d15 * (double)f7 + 0.025D).color(f4, f5, f6, 1.0F).endVertex(); + } + + tessellator.draw(); + + if (Config.isShaders()) + { + Shaders.endLeash(); + } + + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + GlStateManager.enableCull(); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMagmaCube.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMagmaCube.java new file mode 100644 index 0000000..4e411c2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMagmaCube.java @@ -0,0 +1,30 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelMagmaCube; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.util.ResourceLocation; + +public class RenderMagmaCube extends RenderLiving +{ + private static final ResourceLocation magmaCubeTextures = new ResourceLocation("textures/entity/slime/magmacube.png"); + + public RenderMagmaCube(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelMagmaCube(), 0.25F); + } + + protected ResourceLocation getEntityTexture(EntityMagmaCube entity) + { + return magmaCubeTextures; + } + + protected void preRenderCallback(EntityMagmaCube entitylivingbaseIn, float partialTickTime) + { + int i = entitylivingbaseIn.getSlimeSize(); + float f = (entitylivingbaseIn.prevSquishFactor + (entitylivingbaseIn.squishFactor - entitylivingbaseIn.prevSquishFactor) * partialTickTime) / ((float)i * 0.5F + 1.0F); + float f1 = 1.0F / (f + 1.0F); + float f2 = (float)i; + GlStateManager.scale(f1 * f2, 1.0F / f1 * f2, f1 * f2); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderManager.java new file mode 100644 index 0000000..d55dcd6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderManager.java @@ -0,0 +1,418 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleDragToLook; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleHitboxes; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.render.RGBData; +import com.google.common.collect.Maps; +import lombok.Getter; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.*; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.tileentity.RenderEnderCrystal; +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.client.renderer.tileentity.RenderWitherSkull; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.*; +import net.minecraft.entity.monster.*; +import net.minecraft.entity.passive.*; +import net.minecraft.entity.projectile.*; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.optifine.entity.model.CustomEntityModels; +import net.optifine.player.PlayerItemsLayer; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +import java.util.Collections; +import java.util.Map; + +public class RenderManager { + private Map entityRenderMap = Maps.newHashMap(); + private final Map skinMap = Maps.newHashMap(); + private final RenderPlayer playerRenderer; + private FontRenderer textRenderer; + @Getter + private double renderPosX; + @Getter + private double renderPosY; // Added getters for Hologram.java + @Getter + private double renderPosZ; + public TextureManager renderEngine; + public World worldObj; + public Entity livingPlayer; + public Entity pointedEntity; + public float playerViewY; + public float playerViewX; + public GameSettings options; + public double viewerPosX; + public double viewerPosY; + public double viewerPosZ; + private boolean renderOutlines = false; + private boolean renderShadow = true; + private boolean debugBoundingBox = false; + public Render renderRender = null; + @Getter + public static RenderManager instance; + + public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn) { + instance = this; + this.renderEngine = renderEngineIn; + this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this)); + this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this)); + this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F)); + this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F)); + this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F)); + this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F)); + this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F)); + this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F)); + this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F)); + this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F)); + this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this)); + this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this)); + this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this)); + this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this)); + this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this)); + this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this)); + this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this)); + this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this)); + this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this)); + this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this)); + this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F)); + this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this)); + this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F)); + this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this)); + this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F)); + this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this)); + this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this)); + this.entityRenderMap.put(EntityBat.class, new RenderBat(this)); + this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this)); + this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this)); + this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this)); + this.entityRenderMap.put(EntityWither.class, new RenderWither(this)); + this.entityRenderMap.put(Entity.class, new RenderEntity(this)); + this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this)); + this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn)); + this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this)); + this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this)); + this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn)); + this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn)); + this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn)); + this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn)); + this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn)); + this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn)); + this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn)); + this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F)); + this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F)); + this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this)); + this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn)); + this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this)); + this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this)); + this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this)); + this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this)); + this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this)); + this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this)); + this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this)); + this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this)); + this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this)); + this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F)); + this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this)); + this.playerRenderer = new RenderPlayer(this); + this.skinMap.put("default", this.playerRenderer); + this.skinMap.put("slim", new RenderPlayer(this, true)); + PlayerItemsLayer.register(this.skinMap); + + if (Reflector.RenderingRegistry_loadEntityRenderers.exists()) { + Reflector.call(Reflector.RenderingRegistry_loadEntityRenderers, this, this.entityRenderMap); + } + } + + public void setRenderPosition(double renderPosXIn, double renderPosYIn, double renderPosZIn) { + this.renderPosX = renderPosXIn; + this.renderPosY = renderPosYIn; + this.renderPosZ = renderPosZIn; + } + + public Render getEntityClassRenderObject(Class entityClass) { + Render render = (Render) this.entityRenderMap.get(entityClass); + + if (render == null && entityClass != Entity.class) { + render = this.getEntityClassRenderObject((Class) entityClass.getSuperclass()); + this.entityRenderMap.put(entityClass, render); + } + + return (Render) render; + } + + public Render getEntityRenderObject(Entity entityIn) { + if (entityIn instanceof AbstractClientPlayer) { + String s = ((AbstractClientPlayer) entityIn).getSkinType(); + RenderPlayer renderplayer = this.skinMap.get(s); + return (Render) (renderplayer != null ? renderplayer : this.playerRenderer); + } else { + return this.getEntityClassRenderObject(entityIn.getClass()); + } + } + + public void cacheActiveRenderInfo(World worldIn, FontRenderer textRendererIn, Entity livingPlayerIn, Entity pointedEntityIn, GameSettings optionsIn, float partialTicks) { + this.worldObj = worldIn; + this.options = optionsIn; + this.livingPlayer = livingPlayerIn; + this.pointedEntity = pointedEntityIn; + this.textRenderer = textRendererIn; + + if (livingPlayerIn instanceof EntityLivingBase && ((EntityLivingBase) livingPlayerIn).isPlayerSleeping()) { + IBlockState iblockstate = worldIn.getBlockState(new BlockPos(livingPlayerIn)); + Block block = iblockstate.getBlock(); + + if (Reflector.callBoolean(block, Reflector.ForgeBlock_isBed, iblockstate, worldIn, new BlockPos(livingPlayerIn), livingPlayerIn)) { + EnumFacing enumfacing = (EnumFacing) Reflector.call(block, Reflector.ForgeBlock_getBedDirection, new Object[]{iblockstate, worldIn, new BlockPos(livingPlayerIn)}); + int i = enumfacing.getHorizontalIndex(); + this.playerViewY = (float) (i * 90 + 180); + this.playerViewX = 0.0F; + } else if (block == Blocks.bed) { + int j = iblockstate.getValue(BlockBed.FACING).getHorizontalIndex(); + this.playerViewY = (float) (j * 90 + 180); + this.playerViewX = 0.0F; + } + } else { + ModuleDragToLook var11 = CheatBreaker.getInstance().getModuleManager().dragToLook; + if (var11.enabled) { + this.playerViewY = var11.prevRotationYaw + (var11.rotationYaw - var11.prevRotationYaw) * partialTicks; + this.playerViewX = var11.prevRotationPitch + (var11.rotationPitch - var11.prevRotationPitch) * partialTicks; + } else { + this.playerViewY = livingPlayerIn.prevRotationYaw + (livingPlayerIn.rotationYaw - livingPlayerIn.prevRotationYaw) * partialTicks; + this.playerViewX = livingPlayerIn.prevRotationPitch + (livingPlayerIn.rotationPitch - livingPlayerIn.prevRotationPitch) * partialTicks; + } + } + + if (optionsIn.thirdPersonView == 2) { + this.playerViewY += 180.0F; + this.playerViewX = -this.playerViewX; // Fix - Tellinq + } + + this.viewerPosX = livingPlayerIn.lastTickPosX + (livingPlayerIn.posX - livingPlayerIn.lastTickPosX) * (double) partialTicks; + this.viewerPosY = livingPlayerIn.lastTickPosY + (livingPlayerIn.posY - livingPlayerIn.lastTickPosY) * (double) partialTicks; + this.viewerPosZ = livingPlayerIn.lastTickPosZ + (livingPlayerIn.posZ - livingPlayerIn.lastTickPosZ) * (double) partialTicks; + } + + public void setPlayerViewY(float playerViewYIn) { + this.playerViewY = playerViewYIn; + } + + public boolean isRenderShadow() { + return this.renderShadow; + } + + public void setRenderShadow(boolean renderShadowIn) { + this.renderShadow = renderShadowIn; + } + + public void setDebugBoundingBox(boolean debugBoundingBoxIn) { + this.debugBoundingBox = debugBoundingBoxIn; + } + + public boolean isDebugBoundingBox() { + return this.debugBoundingBox; + } + + public boolean renderEntitySimple(Entity entityIn, float partialTicks) { + return this.renderEntityStatic(entityIn, partialTicks, false); + } + + public boolean shouldRender(Entity entityIn, ICamera camera, double camX, double camY, double camZ) { + Render render = this.getEntityRenderObject(entityIn); + return render != null && render.shouldRender(entityIn, camera, camX, camY, camZ); + } + + public boolean renderEntityStatic(Entity entity, float partialTicks, boolean hideDebugBox) { + if (entity.ticksExisted == 0) { + entity.lastTickPosX = entity.posX; + entity.lastTickPosY = entity.posY; + entity.lastTickPosZ = entity.posZ; + } + + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTicks; + float f = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks; + int i = entity.getBrightnessForRender(partialTicks); + + if (entity.isBurning()) { + i = 15728880; + } + + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + return this.doRenderEntity(entity, d0 - this.renderPosX, d1 - this.renderPosY, d2 - this.renderPosZ, f, partialTicks, hideDebugBox); + } + + public void renderWitherSkull(Entity entityIn, float partialTicks) { + double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double) partialTicks; + double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double) partialTicks; + double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double) partialTicks; + Render render = this.getEntityRenderObject(entityIn); + + if (render != null && this.renderEngine != null) { + int i = entityIn.getBrightnessForRender(partialTicks); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + render.renderName(entityIn, d0 - this.renderPosX, d1 - this.renderPosY, d2 - this.renderPosZ); + } + } + + public boolean renderEntityWithPosYaw(Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks) { + return this.doRenderEntity(entityIn, x, y, z, entityYaw, partialTicks, false); + } + + public boolean doRenderEntity(Entity entity, double x, double y, double z, float entityYaw, float partialTicks, boolean hideDebugBox) { + Render render = null; + + try { + render = this.getEntityRenderObject(entity); + + if (render != null && this.renderEngine != null) { + try { + if (render instanceof RendererLivingEntity) { + ((RendererLivingEntity) render).setRenderOutlines(this.renderOutlines); + } + + if (CustomEntityModels.isActive()) { + this.renderRender = render; + } + + render.doRender(entity, x, y, z, entityYaw, partialTicks); + } catch (Throwable throwable2) { + throw new ReportedException(CrashReport.makeCrashReport(throwable2, "Rendering entity in world")); + } + + try { + if (!this.renderOutlines) { + render.doRenderShadowAndFire(entity, x, y, z, entityYaw, partialTicks); + } + } catch (Throwable throwable1) { + throw new ReportedException(CrashReport.makeCrashReport(throwable1, "Post-rendering entity in world")); + } + + if (CheatBreaker.getInstance().getModuleManager().hitboxesMod.isEnabled() || (this.debugBoundingBox && !entity.isInvisible() && !hideDebugBox)) { + try { + this.renderDebugBoundingBox(entity, x, y, z, entityYaw, partialTicks); + } catch (Throwable throwable) { + throw new ReportedException(CrashReport.makeCrashReport(throwable, "Rendering entity hitbox in world")); + } + } + } else return this.renderEngine == null; + + return true; + } catch (Throwable throwable3) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable3, "Rendering entity in world"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being rendered"); + entity.addEntityCrashInfo(crashreportcategory); + CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Renderer details"); + crashreportcategory1.addCrashSection("Assigned renderer", render); + crashreportcategory1.addCrashSection("Location", CrashReportCategory.getCoordinateInfo(x, y, z)); + crashreportcategory1.addCrashSection("Rotation", Float.valueOf(entityYaw)); + crashreportcategory1.addCrashSection("Delta", Float.valueOf(partialTicks)); + throw new ReportedException(crashreport); + } + } + + private void renderDebugBoundingBox(Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks) { + ModuleHitboxes moduleHitboxes = CheatBreaker.getInstance().getModuleManager().hitboxesMod; + boolean showOwn = moduleHitboxes.showOwnHitbox.getBooleanValue(); + boolean isThePlayer = entityIn == Minecraft.getMinecraft().thePlayer; + int color = moduleHitboxes.isEnabled() ? isThePlayer ? moduleHitboxes.ownHitboxColor.getColorValue() : moduleHitboxes.color.getColorValue() : 16777215; + if (!showOwn && isThePlayer) + return; + + if (!Shaders.isShadowPass) { + GlStateManager.depthMask(false); + GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); + GlStateManager.disableCull(); + GlStateManager.disableBlend(); + float f = entityIn.width / 2.0F; + AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox(); + AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX - entityIn.posX + x, axisalignedbb.minY - entityIn.posY + y, axisalignedbb.minZ - entityIn.posZ + z, axisalignedbb.maxX - entityIn.posX + x, axisalignedbb.maxY - entityIn.posY + y, axisalignedbb.maxZ - entityIn.posZ + z); + RenderGlobal.drawOutlinedBoundingBox(axisalignedbb1, 255, 255, 255, 255); + + if (entityIn instanceof EntityLivingBase) { + float f1 = 0.01F; + AxisAlignedBB boundingBox = new AxisAlignedBB(x - (double) f, y + (double) entityIn.getEyeHeight() - 0.009999999776482582D, z - (double) f, x + (double) f, y + (double) entityIn.getEyeHeight() + 0.009999999776482582D, z + (double) f); + + RGBData rgbData = RenderUtil.getRgbValues(color); + RenderGlobal.drawOutlinedBoundingBox(boundingBox, rgbData.getRed(), rgbData.getGreen(), rgbData.getBlue(), rgbData.getAlpha()); + } + + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + Vec3 vec3 = entityIn.getLook(partialTicks); + worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(x, y + (double) entityIn.getEyeHeight(), z).color(0, 0, 255, 255).endVertex(); + worldrenderer.pos(x + vec3.xCoord * 2.0D, y + (double) entityIn.getEyeHeight() + vec3.yCoord * 2.0D, z + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + } + } + + public void set(World worldIn) { + this.worldObj = worldIn; + } + + public double getDistanceToCamera(double x, double y, double z) { + double d0 = x - this.viewerPosX; + double d1 = y - this.viewerPosY; + double d2 = z - this.viewerPosZ; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public FontRenderer getFontRenderer() { + return this.textRenderer; + } + + public void setRenderOutlines(boolean renderOutlinesIn) { + this.renderOutlines = renderOutlinesIn; + } + + public Map getEntityRenderMap() { + return this.entityRenderMap; + } + + public void setEntityRenderMap(Map p_setEntityRenderMap_1_) { + this.entityRenderMap = p_setEntityRenderMap_1_; + } + + public Map getSkinMap() { + return Collections.unmodifiableMap(this.skinMap); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderManager~ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderManager~ new file mode 100644 index 0000000..d723ec0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderManager~ @@ -0,0 +1,502 @@ +package net.minecraft.client.renderer.entity; + +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.ModelChicken; +import net.minecraft.client.model.ModelCow; +import net.minecraft.client.model.ModelHorse; +import net.minecraft.client.model.ModelOcelot; +import net.minecraft.client.model.ModelPig; +import net.minecraft.client.model.ModelRabbit; +import net.minecraft.client.model.ModelSheep2; +import net.minecraft.client.model.ModelSlime; +import net.minecraft.client.model.ModelSquid; +import net.minecraft.client.model.ModelWolf; +import net.minecraft.client.model.ModelZombie; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.ArmorStandRenderer; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderArrow; +import net.minecraft.client.renderer.entity.RenderBat; +import net.minecraft.client.renderer.entity.RenderBlaze; +import net.minecraft.client.renderer.entity.RenderBoat; +import net.minecraft.client.renderer.entity.RenderCaveSpider; +import net.minecraft.client.renderer.entity.RenderChicken; +import net.minecraft.client.renderer.entity.RenderCow; +import net.minecraft.client.renderer.entity.RenderCreeper; +import net.minecraft.client.renderer.entity.RenderDragon; +import net.minecraft.client.renderer.entity.RenderEnderman; +import net.minecraft.client.renderer.entity.RenderEndermite; +import net.minecraft.client.renderer.entity.RenderEntity; +import net.minecraft.client.renderer.entity.RenderEntityItem; +import net.minecraft.client.renderer.entity.RenderFallingBlock; +import net.minecraft.client.renderer.entity.RenderFireball; +import net.minecraft.client.renderer.entity.RenderFish; +import net.minecraft.client.renderer.entity.RenderGhast; +import net.minecraft.client.renderer.entity.RenderGiantZombie; +import net.minecraft.client.renderer.entity.RenderGuardian; +import net.minecraft.client.renderer.entity.RenderHorse; +import net.minecraft.client.renderer.entity.RenderIronGolem; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderLeashKnot; +import net.minecraft.client.renderer.entity.RenderLightningBolt; +import net.minecraft.client.renderer.entity.RenderMagmaCube; +import net.minecraft.client.renderer.entity.RenderMinecart; +import net.minecraft.client.renderer.entity.RenderMinecartMobSpawner; +import net.minecraft.client.renderer.entity.RenderMooshroom; +import net.minecraft.client.renderer.entity.RenderOcelot; +import net.minecraft.client.renderer.entity.RenderPainting; +import net.minecraft.client.renderer.entity.RenderPig; +import net.minecraft.client.renderer.entity.RenderPigZombie; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.entity.RenderPotion; +import net.minecraft.client.renderer.entity.RenderRabbit; +import net.minecraft.client.renderer.entity.RenderSheep; +import net.minecraft.client.renderer.entity.RenderSilverfish; +import net.minecraft.client.renderer.entity.RenderSkeleton; +import net.minecraft.client.renderer.entity.RenderSlime; +import net.minecraft.client.renderer.entity.RenderSnowMan; +import net.minecraft.client.renderer.entity.RenderSnowball; +import net.minecraft.client.renderer.entity.RenderSpider; +import net.minecraft.client.renderer.entity.RenderSquid; +import net.minecraft.client.renderer.entity.RenderTNTPrimed; +import net.minecraft.client.renderer.entity.RenderTntMinecart; +import net.minecraft.client.renderer.entity.RenderVillager; +import net.minecraft.client.renderer.entity.RenderWitch; +import net.minecraft.client.renderer.entity.RenderWither; +import net.minecraft.client.renderer.entity.RenderWolf; +import net.minecraft.client.renderer.entity.RenderXPOrb; +import net.minecraft.client.renderer.entity.RenderZombie; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.tileentity.RenderEnderCrystal; +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.client.renderer.tileentity.RenderWitherSkull; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityMinecartTNT; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCaveSpider; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntityEndermite; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityGiantZombie; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.optifine.entity.model.CustomEntityModels; +import net.optifine.player.PlayerItemsLayer; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; + +public class RenderManager { + private Map, Render> field_78729_o = Maps., Render>newHashMap(); + private Map field_178636_l = Maps.newHashMap(); + private RenderPlayer field_178637_m; + private FontRenderer field_78736_p; + private double field_78725_b; + private double field_78726_c; + private double field_78723_d; + public TextureManager field_78724_e; + public World field_78722_g; + public Entity field_78734_h; + public Entity field_147941_i; + public float field_78735_i; + public float field_78732_j; + public GameSettings field_78733_k; + public double field_78730_l; + public double field_78731_m; + public double field_78728_n; + private boolean field_178639_r = false; + private boolean field_178638_s = true; + private boolean field_85095_o = false; + public Render renderRender = null; + + public RenderManager(TextureManager p_i46180_1_, RenderItem p_i46180_2_) { + this.field_78724_e = p_i46180_1_; + this.field_78729_o.put(EntityCaveSpider.class, new RenderCaveSpider(this)); + this.field_78729_o.put(EntitySpider.class, new RenderSpider(this)); + this.field_78729_o.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F)); + this.field_78729_o.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F)); + this.field_78729_o.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F)); + this.field_78729_o.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F)); + this.field_78729_o.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F)); + this.field_78729_o.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F)); + this.field_78729_o.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F)); + this.field_78729_o.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F)); + this.field_78729_o.put(EntitySilverfish.class, new RenderSilverfish(this)); + this.field_78729_o.put(EntityEndermite.class, new RenderEndermite(this)); + this.field_78729_o.put(EntityCreeper.class, new RenderCreeper(this)); + this.field_78729_o.put(EntityEnderman.class, new RenderEnderman(this)); + this.field_78729_o.put(EntitySnowman.class, new RenderSnowMan(this)); + this.field_78729_o.put(EntitySkeleton.class, new RenderSkeleton(this)); + this.field_78729_o.put(EntityWitch.class, new RenderWitch(this)); + this.field_78729_o.put(EntityBlaze.class, new RenderBlaze(this)); + this.field_78729_o.put(EntityPigZombie.class, new RenderPigZombie(this)); + this.field_78729_o.put(EntityZombie.class, new RenderZombie(this)); + this.field_78729_o.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F)); + this.field_78729_o.put(EntityMagmaCube.class, new RenderMagmaCube(this)); + this.field_78729_o.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F)); + this.field_78729_o.put(EntityGhast.class, new RenderGhast(this)); + this.field_78729_o.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F)); + this.field_78729_o.put(EntityVillager.class, new RenderVillager(this)); + this.field_78729_o.put(EntityIronGolem.class, new RenderIronGolem(this)); + this.field_78729_o.put(EntityBat.class, new RenderBat(this)); + this.field_78729_o.put(EntityGuardian.class, new RenderGuardian(this)); + this.field_78729_o.put(EntityDragon.class, new RenderDragon(this)); + this.field_78729_o.put(EntityEnderCrystal.class, new RenderEnderCrystal(this)); + this.field_78729_o.put(EntityWither.class, new RenderWither(this)); + this.field_78729_o.put(Entity.class, new RenderEntity(this)); + this.field_78729_o.put(EntityPainting.class, new RenderPainting(this)); + this.field_78729_o.put(EntityItemFrame.class, new RenderItemFrame(this, p_i46180_2_)); + this.field_78729_o.put(EntityLeashKnot.class, new RenderLeashKnot(this)); + this.field_78729_o.put(EntityArrow.class, new RenderArrow(this)); + this.field_78729_o.put(EntitySnowball.class, new RenderSnowball(this, Items.field_151126_ay, p_i46180_2_)); + this.field_78729_o.put(EntityEnderPearl.class, new RenderSnowball(this, Items.field_151079_bi, p_i46180_2_)); + this.field_78729_o.put(EntityEnderEye.class, new RenderSnowball(this, Items.field_151061_bv, p_i46180_2_)); + this.field_78729_o.put(EntityEgg.class, new RenderSnowball(this, Items.field_151110_aK, p_i46180_2_)); + this.field_78729_o.put(EntityPotion.class, new RenderPotion(this, p_i46180_2_)); + this.field_78729_o.put(EntityExpBottle.class, new RenderSnowball(this, Items.field_151062_by, p_i46180_2_)); + this.field_78729_o.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.field_151152_bP, p_i46180_2_)); + this.field_78729_o.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F)); + this.field_78729_o.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F)); + this.field_78729_o.put(EntityWitherSkull.class, new RenderWitherSkull(this)); + this.field_78729_o.put(EntityItem.class, new RenderEntityItem(this, p_i46180_2_)); + this.field_78729_o.put(EntityXPOrb.class, new RenderXPOrb(this)); + this.field_78729_o.put(EntityTNTPrimed.class, new RenderTNTPrimed(this)); + this.field_78729_o.put(EntityFallingBlock.class, new RenderFallingBlock(this)); + this.field_78729_o.put(EntityArmorStand.class, new ArmorStandRenderer(this)); + this.field_78729_o.put(EntityMinecartTNT.class, new RenderTntMinecart(this)); + this.field_78729_o.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this)); + this.field_78729_o.put(EntityMinecart.class, new RenderMinecart(this)); + this.field_78729_o.put(EntityBoat.class, new RenderBoat(this)); + this.field_78729_o.put(EntityFishHook.class, new RenderFish(this)); + this.field_78729_o.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F)); + this.field_78729_o.put(EntityLightningBolt.class, new RenderLightningBolt(this)); + this.field_178637_m = new RenderPlayer(this); + this.field_178636_l.put("default", this.field_178637_m); + this.field_178636_l.put("slim", new RenderPlayer(this, true)); + PlayerItemsLayer.register(this.field_178636_l); + if(Reflector.RenderingRegistry_loadEntityRenderers.exists()) { + Reflector.call(Reflector.RenderingRegistry_loadEntityRenderers, new Object[]{this, this.field_78729_o}); + } + + } + + public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) { + this.field_78725_b = p_178628_1_; + this.field_78726_c = p_178628_3_; + this.field_78723_d = p_178628_5_; + } + + public Render func_78715_a(Class p_78715_1_) { + Render render = (Render)this.field_78729_o.get(p_78715_1_); + if(render == null && p_78715_1_ != Entity.class) { + render = this.func_78715_a(p_78715_1_.getSuperclass()); + this.field_78729_o.put(p_78715_1_, render); + } + + return render; + } + + public Render func_78713_a(Entity p_78713_1_) { + if(p_78713_1_ instanceof AbstractClientPlayer) { + String s = ((AbstractClientPlayer)p_78713_1_).func_175154_l(); + RenderPlayer renderplayer = (RenderPlayer)this.field_178636_l.get(s); + return renderplayer != null?renderplayer:this.field_178637_m; + } else { + return this.func_78715_a(p_78713_1_.getClass()); + } + } + + public void func_180597_a(World p_180597_1_, FontRenderer p_180597_2_, Entity p_180597_3_, Entity p_180597_4_, GameSettings p_180597_5_, float p_180597_6_) { + this.field_78722_g = p_180597_1_; + this.field_78733_k = p_180597_5_; + this.field_78734_h = p_180597_3_; + this.field_147941_i = p_180597_4_; + this.field_78736_p = p_180597_2_; + if(p_180597_3_ instanceof EntityLivingBase && ((EntityLivingBase)p_180597_3_).func_70608_bn()) { + IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_)); + Block block = iblockstate.func_177230_c(); + if(Reflector.callBoolean(block, Reflector.ForgeBlock_isBed, new Object[]{iblockstate, p_180597_1_, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_})) { + EnumFacing enumfacing = (EnumFacing)Reflector.call(block, Reflector.ForgeBlock_getBedDirection, new Object[]{iblockstate, p_180597_1_, new BlockPos(p_180597_3_)}); + int i = enumfacing.func_176736_b(); + this.field_78735_i = (float)(i * 90 + 180); + this.field_78732_j = 0.0F; + } else if(block == Blocks.field_150324_C) { + int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.O)).func_176736_b(); + this.field_78735_i = (float)(j * 90 + 180); + this.field_78732_j = 0.0F; + } + } else { + this.field_78735_i = p_180597_3_.field_70126_B + (p_180597_3_.field_70177_z - p_180597_3_.field_70126_B) * p_180597_6_; + this.field_78732_j = p_180597_3_.field_70127_C + (p_180597_3_.field_70125_A - p_180597_3_.field_70127_C) * p_180597_6_; + } + + if(p_180597_5_.field_74320_O == 2) { + this.field_78735_i += 180.0F; + } + + this.field_78730_l = p_180597_3_.field_70142_S + (p_180597_3_.field_70165_t - p_180597_3_.field_70142_S) * (double)p_180597_6_; + this.field_78731_m = p_180597_3_.field_70137_T + (p_180597_3_.field_70163_u - p_180597_3_.field_70137_T) * (double)p_180597_6_; + this.field_78728_n = p_180597_3_.field_70136_U + (p_180597_3_.field_70161_v - p_180597_3_.field_70136_U) * (double)p_180597_6_; + } + + public void func_178631_a(float p_178631_1_) { + this.field_78735_i = p_178631_1_; + } + + public boolean func_178627_a() { + return this.field_178638_s; + } + + public void func_178633_a(boolean p_178633_1_) { + this.field_178638_s = p_178633_1_; + } + + public void func_178629_b(boolean p_178629_1_) { + this.field_85095_o = p_178629_1_; + } + + public boolean func_178634_b() { + return this.field_85095_o; + } + + public boolean func_147937_a(Entity p_147937_1_, float p_147937_2_) { + return this.func_147936_a(p_147937_1_, p_147937_2_, false); + } + + public boolean func_178635_a(Entity p_178635_1_, ICamera p_178635_2_, double p_178635_3_, double p_178635_5_, double p_178635_7_) { + Render render = this.func_78713_a(p_178635_1_); + return render != null && render.func_177071_a(p_178635_1_, p_178635_2_, p_178635_3_, p_178635_5_, p_178635_7_); + } + + public boolean func_147936_a(Entity p_147936_1_, float p_147936_2_, boolean p_147936_3_) { + if(p_147936_1_.field_70173_aa == 0) { + p_147936_1_.field_70142_S = p_147936_1_.field_70165_t; + p_147936_1_.field_70137_T = p_147936_1_.field_70163_u; + p_147936_1_.field_70136_U = p_147936_1_.field_70161_v; + } + + double d0 = p_147936_1_.field_70142_S + (p_147936_1_.field_70165_t - p_147936_1_.field_70142_S) * (double)p_147936_2_; + double d1 = p_147936_1_.field_70137_T + (p_147936_1_.field_70163_u - p_147936_1_.field_70137_T) * (double)p_147936_2_; + double d2 = p_147936_1_.field_70136_U + (p_147936_1_.field_70161_v - p_147936_1_.field_70136_U) * (double)p_147936_2_; + float f = p_147936_1_.field_70126_B + (p_147936_1_.field_70177_z - p_147936_1_.field_70126_B) * p_147936_2_; + int i = p_147936_1_.func_70070_b(p_147936_2_); + if(p_147936_1_.func_70027_ad()) { + i = 15728880; + } + + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + return this.func_147939_a(p_147936_1_, d0 - this.field_78725_b, d1 - this.field_78726_c, d2 - this.field_78723_d, f, p_147936_2_, p_147936_3_); + } + + public void func_178630_b(Entity p_178630_1_, float p_178630_2_) { + double d0 = p_178630_1_.field_70142_S + (p_178630_1_.field_70165_t - p_178630_1_.field_70142_S) * (double)p_178630_2_; + double d1 = p_178630_1_.field_70137_T + (p_178630_1_.field_70163_u - p_178630_1_.field_70137_T) * (double)p_178630_2_; + double d2 = p_178630_1_.field_70136_U + (p_178630_1_.field_70161_v - p_178630_1_.field_70136_U) * (double)p_178630_2_; + Render render = this.func_78713_a(p_178630_1_); + if(render != null && this.field_78724_e != null) { + int i = p_178630_1_.func_70070_b(p_178630_2_); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + render.func_177067_a(p_178630_1_, d0 - this.field_78725_b, d1 - this.field_78726_c, d2 - this.field_78723_d); + } + + } + + public boolean func_147940_a(Entity p_147940_1_, double p_147940_2_, double p_147940_4_, double p_147940_6_, float p_147940_8_, float p_147940_9_) { + return this.func_147939_a(p_147940_1_, p_147940_2_, p_147940_4_, p_147940_6_, p_147940_8_, p_147940_9_, false); + } + + public boolean func_147939_a(Entity p_147939_1_, double p_147939_2_, double p_147939_4_, double p_147939_6_, float p_147939_8_, float p_147939_9_, boolean p_147939_10_) { + Render render = null; + + try { + render = this.func_78713_a(p_147939_1_); + if(render != null && this.field_78724_e != null) { + try { + if(render instanceof RendererLivingEntity) { + ((RendererLivingEntity)render).func_177086_a(this.field_178639_r); + } + + if(CustomEntityModels.isActive()) { + this.renderRender = render; + } + + render.func_76986_a(p_147939_1_, p_147939_2_, p_147939_4_, p_147939_6_, p_147939_8_, p_147939_9_); + } catch (Throwable throwable2) { + throw new ReportedException(CrashReport.func_85055_a(throwable2, "Rendering entity in world")); + } + + try { + if(!this.field_178639_r) { + render.func_76979_b(p_147939_1_, p_147939_2_, p_147939_4_, p_147939_6_, p_147939_8_, p_147939_9_); + } + } catch (Throwable throwable1) { + throw new ReportedException(CrashReport.func_85055_a(throwable1, "Post-rendering entity in world")); + } + + if(this.field_85095_o && !p_147939_1_.func_82150_aj() && !p_147939_10_) { + try { + this.func_85094_b(p_147939_1_, p_147939_2_, p_147939_4_, p_147939_6_, p_147939_8_, p_147939_9_); + } catch (Throwable throwable) { + throw new ReportedException(CrashReport.func_85055_a(throwable, "Rendering entity hitbox in world")); + } + } + } else if(this.field_78724_e != null) { + return false; + } + + return true; + } catch (Throwable throwable3) { + CrashReport crashreport = CrashReport.func_85055_a(throwable3, "Rendering entity in world"); + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Entity being rendered"); + p_147939_1_.func_85029_a(crashreportcategory); + CrashReportCategory crashreportcategory1 = crashreport.func_85058_a("Renderer details"); + crashreportcategory1.func_71507_a("Assigned renderer", render); + crashreportcategory1.func_71507_a("Location", CrashReportCategory.func_85074_a(p_147939_2_, p_147939_4_, p_147939_6_)); + crashreportcategory1.func_71507_a("Rotation", Float.valueOf(p_147939_8_)); + crashreportcategory1.func_71507_a("Delta", Float.valueOf(p_147939_9_)); + throw new ReportedException(crashreport); + } + } + + private void func_85094_b(Entity p_85094_1_, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_) { + if(!Shaders.isShadowPass) { + GlStateManager.func_179132_a(false); + GlStateManager.func_179090_x(); + GlStateManager.func_179140_f(); + GlStateManager.func_179129_p(); + GlStateManager.func_179084_k(); + float f = p_85094_1_.field_70130_N / 2.0F; + AxisAlignedBB axisalignedbb = p_85094_1_.func_174813_aQ(); + AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.field_72340_a - p_85094_1_.field_70165_t + p_85094_2_, axisalignedbb.field_72338_b - p_85094_1_.field_70163_u + p_85094_4_, axisalignedbb.field_72339_c - p_85094_1_.field_70161_v + p_85094_6_, axisalignedbb.field_72336_d - p_85094_1_.field_70165_t + p_85094_2_, axisalignedbb.field_72337_e - p_85094_1_.field_70163_u + p_85094_4_, axisalignedbb.field_72334_f - p_85094_1_.field_70161_v + p_85094_6_); + RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255); + if(p_85094_1_ instanceof EntityLivingBase) { + float f1 = 0.01F; + RenderGlobal.func_181563_a(new AxisAlignedBB(p_85094_2_ - (double)f, p_85094_4_ + (double)p_85094_1_.func_70047_e() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)p_85094_1_.func_70047_e() + 0.009999999776482582D, p_85094_6_ + (double)f), 255, 0, 0, 255); + } + + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + Vec3 vec3 = p_85094_1_.func_70676_i(p_85094_9_); + worldrenderer.func_181668_a(3, DefaultVertexFormats.field_181706_f); + worldrenderer.func_181662_b(p_85094_2_, p_85094_4_ + (double)p_85094_1_.func_70047_e(), p_85094_6_).func_181669_b(0, 0, 255, 255).func_181675_d(); + worldrenderer.func_181662_b(p_85094_2_ + vec3.field_72450_a * 2.0D, p_85094_4_ + (double)p_85094_1_.func_70047_e() + vec3.field_72448_b * 2.0D, p_85094_6_ + vec3.field_72449_c * 2.0D).func_181669_b(0, 0, 255, 255).func_181675_d(); + tessellator.func_78381_a(); + GlStateManager.func_179098_w(); + GlStateManager.func_179145_e(); + GlStateManager.func_179089_o(); + GlStateManager.func_179084_k(); + GlStateManager.func_179132_a(true); + } + } + + public void func_78717_a(World p_78717_1_) { + this.field_78722_g = p_78717_1_; + } + + public double func_78714_a(double p_78714_1_, double p_78714_3_, double p_78714_5_) { + double d0 = p_78714_1_ - this.field_78730_l; + double d1 = p_78714_3_ - this.field_78731_m; + double d2 = p_78714_5_ - this.field_78728_n; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public FontRenderer func_78716_a() { + return this.field_78736_p; + } + + public void func_178632_c(boolean p_178632_1_) { + this.field_178639_r = p_178632_1_; + } + + public Map getEntityRenderMap() { + return this.field_78729_o; + } + + public void setEntityRenderMap(Map p_setEntityRenderMap_1_) { + this.field_78729_o = p_setEntityRenderMap_1_; + } + + public Map getSkinMap() { + return Collections.unmodifiableMap(this.field_178636_l); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java new file mode 100644 index 0000000..adc2562 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java @@ -0,0 +1,119 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelMinecart; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; + +public class RenderMinecart extends Render +{ + private static final ResourceLocation minecartTextures = new ResourceLocation("textures/entity/minecart.png"); + protected ModelBase modelMinecart = new ModelMinecart(); + + public RenderMinecart(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.shadowSize = 0.5F; + } + + public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + this.bindEntityTexture(entity); + long i = (long)entity.getEntityId() * 493286711L; + i = i * i * 4392167121L + i * 98761L; + float f = (((float)(i >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float f1 = (((float)(i >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float f2 = (((float)(i >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + GlStateManager.translate(f, f1, f2); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks; + double d3 = 0.30000001192092896D; + Vec3 vec3 = entity.func_70489_a(d0, d1, d2); + float f3 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks; + + if (vec3 != null) + { + Vec3 vec31 = entity.func_70495_a(d0, d1, d2, d3); + Vec3 vec32 = entity.func_70495_a(d0, d1, d2, -d3); + + if (vec31 == null) + { + vec31 = vec3; + } + + if (vec32 == null) + { + vec32 = vec3; + } + + x += vec3.xCoord - d0; + y += (vec31.yCoord + vec32.yCoord) / 2.0D - d1; + z += vec3.zCoord - d2; + Vec3 vec33 = vec32.addVector(-vec31.xCoord, -vec31.yCoord, -vec31.zCoord); + + if (vec33.lengthVector() != 0.0D) + { + vec33 = vec33.normalize(); + entityYaw = (float)(Math.atan2(vec33.zCoord, vec33.xCoord) * 180.0D / Math.PI); + f3 = (float)(Math.atan(vec33.yCoord) * 73.0D); + } + } + + GlStateManager.translate((float)x, (float)y + 0.375F, (float)z); + GlStateManager.rotate(180.0F - entityYaw, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-f3, 0.0F, 0.0F, 1.0F); + float f5 = (float)entity.getRollingAmplitude() - partialTicks; + float f6 = entity.getDamage() - partialTicks; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f5 > 0.0F) + { + GlStateManager.rotate(MathHelper.sin(f5) * f5 * f6 / 10.0F * (float)entity.getRollingDirection(), 1.0F, 0.0F, 0.0F); + } + + int j = entity.getDisplayTileOffset(); + IBlockState iblockstate = entity.getDisplayTile(); + + if (iblockstate.getBlock().getRenderType() != -1) + { + GlStateManager.pushMatrix(); + this.bindTexture(TextureMap.locationBlocksTexture); + float f4 = 0.75F; + GlStateManager.scale(f4, f4, f4); + GlStateManager.translate(-0.5F, (float)(j - 8) / 16.0F, 0.5F); + this.func_180560_a(entity, partialTicks, iblockstate); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.bindEntityTexture(entity); + } + + GlStateManager.scale(-1.0F, -1.0F, 1.0F); + this.modelMinecart.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(T entity) + { + return minecartTextures; + } + + protected void func_180560_a(T minecart, float partialTicks, IBlockState state) + { + GlStateManager.pushMatrix(); + Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(state, minecart.getBrightness(partialTicks)); + GlStateManager.popMatrix(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.java new file mode 100644 index 0000000..7d2257e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.java @@ -0,0 +1,24 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.init.Blocks; + +public class RenderMinecartMobSpawner extends RenderMinecart +{ + public RenderMinecartMobSpawner(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + protected void func_180560_a(EntityMinecartMobSpawner minecart, float partialTicks, IBlockState state) + { + super.func_180560_a(minecart, partialTicks, state); + + if (state.getBlock() == Blocks.mob_spawner) + { + TileEntityMobSpawnerRenderer.renderMob(minecart.func_98039_d(), minecart.posX, minecart.posY, minecart.posZ, partialTicks); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMooshroom.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMooshroom.java new file mode 100644 index 0000000..8eafd03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderMooshroom.java @@ -0,0 +1,22 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.layers.LayerMooshroomMushroom; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.util.ResourceLocation; + +public class RenderMooshroom extends RenderLiving +{ + private static final ResourceLocation mooshroomTextures = new ResourceLocation("textures/entity/cow/mooshroom.png"); + + public RenderMooshroom(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + this.addLayer(new LayerMooshroomMushroom(this)); + } + + protected ResourceLocation getEntityTexture(EntityMooshroom entity) + { + return mooshroomTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderOcelot.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderOcelot.java new file mode 100644 index 0000000..e5944ea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderOcelot.java @@ -0,0 +1,48 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.util.ResourceLocation; + +public class RenderOcelot extends RenderLiving +{ + private static final ResourceLocation blackOcelotTextures = new ResourceLocation("textures/entity/cat/black.png"); + private static final ResourceLocation ocelotTextures = new ResourceLocation("textures/entity/cat/ocelot.png"); + private static final ResourceLocation redOcelotTextures = new ResourceLocation("textures/entity/cat/red.png"); + private static final ResourceLocation siameseOcelotTextures = new ResourceLocation("textures/entity/cat/siamese.png"); + + public RenderOcelot(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + } + + protected ResourceLocation getEntityTexture(EntityOcelot entity) + { + switch (entity.getTameSkin()) + { + case 0: + default: + return ocelotTextures; + + case 1: + return blackOcelotTextures; + + case 2: + return redOcelotTextures; + + case 3: + return siameseOcelotTextures; + } + } + + protected void preRenderCallback(EntityOcelot entitylivingbaseIn, float partialTickTime) + { + super.preRenderCallback(entitylivingbaseIn, partialTickTime); + + if (entitylivingbaseIn.isTamed()) + { + GlStateManager.scale(0.8F, 0.8F, 0.8F); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPainting.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPainting.java new file mode 100644 index 0000000..150ac32 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPainting.java @@ -0,0 +1,140 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderPainting extends Render +{ + private static final ResourceLocation KRISTOFFER_PAINTING_TEXTURE = new ResourceLocation("textures/painting/paintings_kristoffer_zetterstrand.png"); + + public RenderPainting(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + public void doRender(EntityPainting entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + GlStateManager.rotate(180.0F - entityYaw, 0.0F, 1.0F, 0.0F); + GlStateManager.enableRescaleNormal(); + this.bindEntityTexture(entity); + EntityPainting.EnumArt entitypainting$enumart = entity.art; + float f = 0.0625F; + GlStateManager.scale(f, f, f); + this.renderPainting(entity, entitypainting$enumart.sizeX, entitypainting$enumart.sizeY, entitypainting$enumart.offsetX, entitypainting$enumart.offsetY); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityPainting entity) + { + return KRISTOFFER_PAINTING_TEXTURE; + } + + private void renderPainting(EntityPainting painting, int width, int height, int textureU, int textureV) + { + float f = (float)(-width) / 2.0F; + float f1 = (float)(-height) / 2.0F; + float f2 = 0.5F; + float f3 = 0.75F; + float f4 = 0.8125F; + float f5 = 0.0F; + float f6 = 0.0625F; + float f7 = 0.75F; + float f8 = 0.8125F; + float f9 = 0.001953125F; + float f10 = 0.001953125F; + float f11 = 0.7519531F; + float f12 = 0.7519531F; + float f13 = 0.0F; + float f14 = 0.0625F; + + for (int i = 0; i < width / 16; ++i) + { + for (int j = 0; j < height / 16; ++j) + { + float f15 = f + (float)((i + 1) * 16); + float f16 = f + (float)(i * 16); + float f17 = f1 + (float)((j + 1) * 16); + float f18 = f1 + (float)(j * 16); + this.setLightmap(painting, (f15 + f16) / 2.0F, (f17 + f18) / 2.0F); + float f19 = (float)(textureU + width - i * 16) / 256.0F; + float f20 = (float)(textureU + width - (i + 1) * 16) / 256.0F; + float f21 = (float)(textureV + height - j * 16) / 256.0F; + float f22 = (float)(textureV + height - (j + 1) * 16) / 256.0F; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL); + worldrenderer.pos((double)f15, (double)f18, (double)(-f2)).tex((double)f20, (double)f21).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f18, (double)(-f2)).tex((double)f19, (double)f21).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f17, (double)(-f2)).tex((double)f19, (double)f22).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f17, (double)(-f2)).tex((double)f20, (double)f22).normal(0.0F, 0.0F, -1.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f17, (double)f2).tex((double)f3, (double)f5).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f17, (double)f2).tex((double)f4, (double)f5).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f18, (double)f2).tex((double)f4, (double)f6).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f18, (double)f2).tex((double)f3, (double)f6).normal(0.0F, 0.0F, 1.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f17, (double)(-f2)).tex((double)f7, (double)f9).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f17, (double)(-f2)).tex((double)f8, (double)f9).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f17, (double)f2).tex((double)f8, (double)f10).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f17, (double)f2).tex((double)f7, (double)f10).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f18, (double)f2).tex((double)f7, (double)f9).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f18, (double)f2).tex((double)f8, (double)f9).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f18, (double)(-f2)).tex((double)f8, (double)f10).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f18, (double)(-f2)).tex((double)f7, (double)f10).normal(0.0F, -1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f17, (double)f2).tex((double)f12, (double)f13).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f18, (double)f2).tex((double)f12, (double)f14).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f18, (double)(-f2)).tex((double)f11, (double)f14).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f15, (double)f17, (double)(-f2)).tex((double)f11, (double)f13).normal(-1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f17, (double)(-f2)).tex((double)f12, (double)f13).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f18, (double)(-f2)).tex((double)f12, (double)f14).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f18, (double)f2).tex((double)f11, (double)f14).normal(1.0F, 0.0F, 0.0F).endVertex(); + worldrenderer.pos((double)f16, (double)f17, (double)f2).tex((double)f11, (double)f13).normal(1.0F, 0.0F, 0.0F).endVertex(); + tessellator.draw(); + } + } + } + + private void setLightmap(EntityPainting painting, float p_77008_2_, float p_77008_3_) + { + int i = MathHelper.floor_double(painting.posX); + int j = MathHelper.floor_double(painting.posY + (double)(p_77008_3_ / 16.0F)); + int k = MathHelper.floor_double(painting.posZ); + EnumFacing enumfacing = painting.facingDirection; + + if (enumfacing == EnumFacing.NORTH) + { + i = MathHelper.floor_double(painting.posX + (double)(p_77008_2_ / 16.0F)); + } + + if (enumfacing == EnumFacing.WEST) + { + k = MathHelper.floor_double(painting.posZ - (double)(p_77008_2_ / 16.0F)); + } + + if (enumfacing == EnumFacing.SOUTH) + { + i = MathHelper.floor_double(painting.posX - (double)(p_77008_2_ / 16.0F)); + } + + if (enumfacing == EnumFacing.EAST) + { + k = MathHelper.floor_double(painting.posZ + (double)(p_77008_2_ / 16.0F)); + } + + int l = this.renderManager.worldObj.getCombinedLight(new BlockPos(i, j, k), 0); + int i1 = l % 65536; + int j1 = l / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)i1, (float)j1); + GlStateManager.color(1.0F, 1.0F, 1.0F); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPig.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPig.java new file mode 100644 index 0000000..5bdb5e1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPig.java @@ -0,0 +1,22 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.layers.LayerSaddle; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.util.ResourceLocation; + +public class RenderPig extends RenderLiving +{ + private static final ResourceLocation pigTextures = new ResourceLocation("textures/entity/pig/pig.png"); + + public RenderPig(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + this.addLayer(new LayerSaddle(this)); + } + + protected ResourceLocation getEntityTexture(EntityPig entity) + { + return pigTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPigZombie.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPigZombie.java new file mode 100644 index 0000000..7f467e2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPigZombie.java @@ -0,0 +1,31 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelZombie; +import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; +import net.minecraft.client.renderer.entity.layers.LayerHeldItem; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.util.ResourceLocation; + +public class RenderPigZombie extends RenderBiped +{ + private static final ResourceLocation ZOMBIE_PIGMAN_TEXTURE = new ResourceLocation("textures/entity/zombie_pigman.png"); + + public RenderPigZombie(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelZombie(), 0.5F, 1.0F); + this.addLayer(new LayerHeldItem(this)); + this.addLayer(new LayerBipedArmor(this) + { + protected void initArmor() + { + this.modelLeggings = new ModelZombie(0.5F, true); + this.modelArmor = new ModelZombie(1.0F, true); + } + }); + } + + protected ResourceLocation getEntityTexture(EntityPigZombie entity) + { + return ZOMBIE_PIGMAN_TEXTURE; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPlayer.java new file mode 100644 index 0000000..d7be96d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPlayer.java @@ -0,0 +1,211 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleNameTag; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.model.ModelPlayer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerArrow; +import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; +import net.minecraft.client.renderer.entity.layers.LayerCape; +import net.minecraft.client.renderer.entity.layers.LayerCustomHead; +import net.minecraft.client.renderer.entity.layers.LayerDeadmau5Head; +import net.minecraft.client.renderer.entity.layers.LayerHeldItem; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemStack; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.ResourceLocation; + +import javax.naming.Name; +import java.util.List; +import java.util.UUID; + +public class RenderPlayer extends RendererLivingEntity +{ + private boolean smallArms; + + public RenderPlayer(RenderManager renderManager) + { + this(renderManager, false); + } + + public RenderPlayer(RenderManager renderManager, boolean useSmallArms) + { + super(renderManager, new ModelPlayer(0.0F, useSmallArms), 0.5F); + this.smallArms = useSmallArms; + this.addLayer(new LayerBipedArmor(this)); + this.addLayer(new LayerHeldItem(this)); + this.addLayer(new LayerArrow(this)); + this.addLayer(new LayerDeadmau5Head(this)); + this.addLayer(new LayerCape(this)); + this.addLayer(new LayerCustomHead(this.getMainModel().bipedHead)); + } + + public ModelPlayer getMainModel() + { + return (ModelPlayer)super.getMainModel(); + } + + public void doRender(AbstractClientPlayer entity, double x, double y, double z, float entityYaw, float partialTicks) + { + if (!entity.isUser() || this.renderManager.livingPlayer == entity) + { + double d0 = y; + + if (entity.isSneaking() && !(entity instanceof EntityPlayerSP)) + { + d0 = y - 0.125D; + } + + this.setModelVisibilities(entity); + super.doRender(entity, x, d0, z, entityYaw, partialTicks); + } + } + + private void setModelVisibilities(AbstractClientPlayer clientPlayer) + { + ModelPlayer modelplayer = this.getMainModel(); + + if (clientPlayer.isSpectator()) + { + modelplayer.setInvisible(false); + modelplayer.bipedHead.showModel = true; + modelplayer.bipedHeadwear.showModel = true; + } + else + { + ItemStack itemstack = clientPlayer.inventory.getCurrentItem(); + modelplayer.setInvisible(true); + modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT); + modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET); + modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG); + modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG); + modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE); + modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE); + modelplayer.heldItemLeft = 0; + modelplayer.aimedBow = false; + modelplayer.isSneak = clientPlayer.isSneaking(); + + if (itemstack == null) + { + modelplayer.heldItemRight = 0; + } + else + { + modelplayer.heldItemRight = 1; + + if (clientPlayer.getItemInUseCount() > 0) + { + EnumAction enumaction = itemstack.getItemUseAction(); + + if (enumaction == EnumAction.BLOCK) + { + modelplayer.heldItemRight = 3; + } + else if (enumaction == EnumAction.BOW) + { + modelplayer.aimedBow = true; + } + } + } + } + } + + protected ResourceLocation getEntityTexture(AbstractClientPlayer entity) + { + return entity.getLocationSkin(); + } + + public void transformHeldFull3DItemLayer() + { + GlStateManager.translate(0.0F, 0.1875F, 0.0F); + } + + protected void preRenderCallback(AbstractClientPlayer entitylivingbaseIn, float partialTickTime) + { + float f = 0.9375F; + GlStateManager.scale(f, f, f); + } + + protected void renderOffsetLivingLabel(AbstractClientPlayer entityIn, double x, double y, double z, String str, float p_177069_9_, double p_177069_10_) + { + if (p_177069_10_ < 100.0D) + { + Scoreboard scoreboard = entityIn.getWorldScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjectiveInDisplaySlot(2); + + if (scoreobjective != null) + { + Score score = scoreboard.getValueFromObjective(entityIn.getName(), scoreobjective); + this.renderLivingLabel(entityIn, score.getScorePoints() + " " + scoreobjective.getDisplayName(), x, y, z, 64); + y += ((float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * p_177069_9_); + } + } + + super.renderOffsetLivingLabel(entityIn, x, y, z, str, p_177069_9_, p_177069_10_); + + if (CheatBreaker.getInstance().getCBNetHandler().getCustomNameTags().containsKey(entityIn.getUniqueID())) { + for (String string2 : CheatBreaker.getInstance().getCBNetHandler().getCustomNameTags().get(entityIn.getUniqueID())) { + if (!string2.contains(entityIn.getNameClear())) { + y += ((float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * p_177069_9_); + this.renderLivingLabel(entityIn, string2, x, y, z, 64); + } + } + } + } + + public void renderRightArm(AbstractClientPlayer clientPlayer) + { + float f = 1.0F; + GlStateManager.color(f, f, f); + ModelPlayer modelplayer = this.getMainModel(); + this.setModelVisibilities(clientPlayer); + modelplayer.swingProgress = 0.0F; + modelplayer.isSneak = false; + modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); + modelplayer.renderRightArm(); + } + + public void renderLeftArm(AbstractClientPlayer clientPlayer) + { + float f = 1.0F; + GlStateManager.color(f, f, f); + ModelPlayer modelplayer = this.getMainModel(); + this.setModelVisibilities(clientPlayer); + modelplayer.isSneak = false; + modelplayer.swingProgress = 0.0F; + modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer); + modelplayer.renderLeftArm(); + } + + protected void renderLivingAt(AbstractClientPlayer entityLivingBaseIn, double x, double y, double z) + { + if (entityLivingBaseIn.isEntityAlive() && entityLivingBaseIn.isPlayerSleeping()) + { + super.renderLivingAt(entityLivingBaseIn, x + (double)entityLivingBaseIn.renderOffsetX, y + (double)entityLivingBaseIn.renderOffsetY, z + (double)entityLivingBaseIn.renderOffsetZ); + } + else + { + super.renderLivingAt(entityLivingBaseIn, x, y, z); + } + } + + protected void rotateCorpse(AbstractClientPlayer bat, float p_77043_2_, float p_77043_3_, float partialTicks) + { + if (bat.isEntityAlive() && bat.isPlayerSleeping()) + { + GlStateManager.rotate(bat.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(270.0F, 0.0F, 1.0F, 0.0F); + } + else + { + super.rotateCorpse(bat, p_77043_2_, p_77043_3_, partialTicks); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPotion.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPotion.java new file mode 100644 index 0000000..cbf94d8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderPotion.java @@ -0,0 +1,18 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RenderPotion extends RenderSnowball +{ + public RenderPotion(RenderManager renderManagerIn, RenderItem itemRendererIn) + { + super(renderManagerIn, Items.potionitem, itemRendererIn); + } + + public ItemStack func_177082_d(EntityPotion entityIn) + { + return new ItemStack(this.field_177084_a, 1, entityIn.getPotionDamage()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderRabbit.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderRabbit.java new file mode 100644 index 0000000..d3e15da --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderRabbit.java @@ -0,0 +1,60 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +public class RenderRabbit extends RenderLiving +{ + private static final ResourceLocation BROWN = new ResourceLocation("textures/entity/rabbit/brown.png"); + private static final ResourceLocation WHITE = new ResourceLocation("textures/entity/rabbit/white.png"); + private static final ResourceLocation BLACK = new ResourceLocation("textures/entity/rabbit/black.png"); + private static final ResourceLocation GOLD = new ResourceLocation("textures/entity/rabbit/gold.png"); + private static final ResourceLocation SALT = new ResourceLocation("textures/entity/rabbit/salt.png"); + private static final ResourceLocation WHITE_SPLOTCHED = new ResourceLocation("textures/entity/rabbit/white_splotched.png"); + private static final ResourceLocation TOAST = new ResourceLocation("textures/entity/rabbit/toast.png"); + private static final ResourceLocation CAERBANNOG = new ResourceLocation("textures/entity/rabbit/caerbannog.png"); + + public RenderRabbit(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + } + + protected ResourceLocation getEntityTexture(EntityRabbit entity) + { + String s = EnumChatFormatting.getTextWithoutFormattingCodes(entity.getName()); + + if (s != null && s.equals("Toast")) + { + return TOAST; + } + else + { + switch (entity.getRabbitType()) + { + case 0: + default: + return BROWN; + + case 1: + return WHITE; + + case 2: + return BLACK; + + case 3: + return WHITE_SPLOTCHED; + + case 4: + return GOLD; + + case 5: + return SALT; + + case 99: + return CAERBANNOG; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSheep.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSheep.java new file mode 100644 index 0000000..b7a2501 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSheep.java @@ -0,0 +1,22 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.layers.LayerSheepWool; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.util.ResourceLocation; + +public class RenderSheep extends RenderLiving +{ + private static final ResourceLocation shearedSheepTextures = new ResourceLocation("textures/entity/sheep/sheep.png"); + + public RenderSheep(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + this.addLayer(new LayerSheepWool(this)); + } + + protected ResourceLocation getEntityTexture(EntitySheep entity) + { + return shearedSheepTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSilverfish.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSilverfish.java new file mode 100644 index 0000000..17e7cf5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSilverfish.java @@ -0,0 +1,25 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelSilverfish; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.util.ResourceLocation; + +public class RenderSilverfish extends RenderLiving +{ + private static final ResourceLocation silverfishTextures = new ResourceLocation("textures/entity/silverfish.png"); + + public RenderSilverfish(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelSilverfish(), 0.3F); + } + + protected float getDeathMaxRotation(EntitySilverfish entityLivingBaseIn) + { + return 180.0F; + } + + protected ResourceLocation getEntityTexture(EntitySilverfish entity) + { + return silverfishTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSkeleton.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSkeleton.java new file mode 100644 index 0000000..9c495e9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSkeleton.java @@ -0,0 +1,46 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelSkeleton; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; +import net.minecraft.client.renderer.entity.layers.LayerHeldItem; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.util.ResourceLocation; + +public class RenderSkeleton extends RenderBiped +{ + private static final ResourceLocation skeletonTextures = new ResourceLocation("textures/entity/skeleton/skeleton.png"); + private static final ResourceLocation witherSkeletonTextures = new ResourceLocation("textures/entity/skeleton/wither_skeleton.png"); + + public RenderSkeleton(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelSkeleton(), 0.5F); + this.addLayer(new LayerHeldItem(this)); + this.addLayer(new LayerBipedArmor(this) + { + protected void initArmor() + { + this.modelLeggings = new ModelSkeleton(0.5F, true); + this.modelArmor = new ModelSkeleton(1.0F, true); + } + }); + } + + protected void preRenderCallback(EntitySkeleton entitylivingbaseIn, float partialTickTime) + { + if (entitylivingbaseIn.getSkeletonType() == 1) + { + GlStateManager.scale(1.2F, 1.2F, 1.2F); + } + } + + public void transformHeldFull3DItemLayer() + { + GlStateManager.translate(0.09375F, 0.1875F, 0.0F); + } + + protected ResourceLocation getEntityTexture(EntitySkeleton entity) + { + return entity.getSkeletonType() == 1 ? witherSkeletonTextures : skeletonTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSlime.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSlime.java new file mode 100644 index 0000000..b298255 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSlime.java @@ -0,0 +1,37 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerSlimeGel; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.util.ResourceLocation; + +public class RenderSlime extends RenderLiving +{ + private static final ResourceLocation slimeTextures = new ResourceLocation("textures/entity/slime/slime.png"); + + public RenderSlime(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + this.addLayer(new LayerSlimeGel(this)); + } + + public void doRender(EntitySlime entity, double x, double y, double z, float entityYaw, float partialTicks) + { + this.shadowSize = 0.25F * (float)entity.getSlimeSize(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected void preRenderCallback(EntitySlime entitylivingbaseIn, float partialTickTime) + { + float f = (float)entitylivingbaseIn.getSlimeSize(); + float f1 = (entitylivingbaseIn.prevSquishFactor + (entitylivingbaseIn.squishFactor - entitylivingbaseIn.prevSquishFactor) * partialTickTime) / (f * 0.5F + 1.0F); + float f2 = 1.0F / (f1 + 1.0F); + GlStateManager.scale(f2 * f, 1.0F / f2 * f, f2 * f); + } + + protected ResourceLocation getEntityTexture(EntitySlime entity) + { + return slimeTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSnowMan.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSnowMan.java new file mode 100644 index 0000000..9cc4369 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSnowMan.java @@ -0,0 +1,27 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelSnowMan; +import net.minecraft.client.renderer.entity.layers.LayerSnowmanHead; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.util.ResourceLocation; + +public class RenderSnowMan extends RenderLiving +{ + private static final ResourceLocation snowManTextures = new ResourceLocation("textures/entity/snowman.png"); + + public RenderSnowMan(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelSnowMan(), 0.5F); + this.addLayer(new LayerSnowmanHead(this)); + } + + protected ResourceLocation getEntityTexture(EntitySnowman entity) + { + return snowManTextures; + } + + public ModelSnowMan getMainModel() + { + return (ModelSnowMan)super.getMainModel(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java new file mode 100644 index 0000000..ef99e1d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java @@ -0,0 +1,48 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class RenderSnowball extends Render +{ + protected final Item field_177084_a; + private final RenderItem field_177083_e; + + public RenderSnowball(RenderManager renderManagerIn, Item p_i46137_2_, RenderItem p_i46137_3_) + { + super(renderManagerIn); + this.field_177084_a = p_i46137_2_; + this.field_177083_e = p_i46137_3_; + } + + public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(180, 0.0F, 1.0F, 0.0F); + this.bindTexture(TextureMap.locationBlocksTexture); + this.field_177083_e.renderItem(this.func_177082_d(entity), ItemCameraTransforms.TransformType.GROUND); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + public ItemStack func_177082_d(T entityIn) + { + return new ItemStack(this.field_177084_a, 1, 0); + } + + protected ResourceLocation getEntityTexture(Entity entity) + { + return TextureMap.locationBlocksTexture; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java new file mode 100644 index 0000000..7cb787e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java @@ -0,0 +1,27 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelSpider; +import net.minecraft.client.renderer.entity.layers.LayerSpiderEyes; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.util.ResourceLocation; + +public class RenderSpider extends RenderLiving +{ + private static final ResourceLocation spiderTextures = new ResourceLocation("textures/entity/spider/spider.png"); + + public RenderSpider(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelSpider(), 1.0F); + this.addLayer(new LayerSpiderEyes(this)); + } + + protected float getDeathMaxRotation(T entityLivingBaseIn) + { + return 180.0F; + } + + protected ResourceLocation getEntityTexture(T entity) + { + return spiderTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java new file mode 100644 index 0000000..d1037aa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java @@ -0,0 +1,37 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.util.ResourceLocation; + +public class RenderSquid extends RenderLiving +{ + private static final ResourceLocation squidTextures = new ResourceLocation("textures/entity/squid.png"); + + public RenderSquid(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + } + + protected ResourceLocation getEntityTexture(EntitySquid entity) + { + return squidTextures; + } + + protected void rotateCorpse(EntitySquid bat, float p_77043_2_, float p_77043_3_, float partialTicks) + { + float f = bat.prevSquidPitch + (bat.squidPitch - bat.prevSquidPitch) * partialTicks; + float f1 = bat.prevSquidYaw + (bat.squidYaw - bat.prevSquidYaw) * partialTicks; + GlStateManager.translate(0.0F, 0.5F, 0.0F); + GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(f1, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, -1.2F, 0.0F); + } + + protected float handleRotationFloat(EntitySquid livingBase, float partialTicks) + { + return livingBase.lastTentacleAngle + (livingBase.tentacleAngle - livingBase.lastTentacleAngle) * partialTicks; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderTNTPrimed.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderTNTPrimed.java new file mode 100644 index 0000000..8ad8ffb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderTNTPrimed.java @@ -0,0 +1,80 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.text.DecimalFormat; + +public class RenderTNTPrimed extends Render +{ + public RenderTNTPrimed(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.shadowSize = 0.5F; + } + + public void doRender(EntityTNTPrimed entity, double x, double y, double z, float entityYaw, float partialTicks) + { + if (CheatBreaker.getInstance().getModuleManager().tntTimerMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().tntTimerMod.drawTimer(this, entity, x,y,z, partialTicks); + } + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y + 0.5F, (float)z); + + if ((float)entity.fuse - partialTicks + 1.0F < 10.0F) + { + float f = 1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 10.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + f = f * f; + f = f * f; + float f1 = 1.0F + f * 0.3F; + GlStateManager.scale(f1, f1, f1); + } + + float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F; + this.bindEntityTexture(entity); + GlStateManager.translate(-0.5F, -0.5F, 0.5F); + blockrendererdispatcher.renderBlockBrightness(Blocks.tnt.getDefaultState(), entity.getBrightness(partialTicks)); + GlStateManager.translate(0.0F, 0.0F, 1.0F); + + if (entity.fuse / 5 % 2 == 0) + { + GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 772); + GlStateManager.color(1.0F, 1.0F, 1.0F, f2); + GlStateManager.doPolygonOffset(-3.0F, -3.0F); + GlStateManager.enablePolygonOffset(); + blockrendererdispatcher.renderBlockBrightness(Blocks.tnt.getDefaultState(), 1.0F); + GlStateManager.doPolygonOffset(0.0F, 0.0F); + GlStateManager.disablePolygonOffset(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + } + + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityTNTPrimed entity) + { + return TextureMap.locationBlocksTexture; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderTntMinecart.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderTntMinecart.java new file mode 100644 index 0000000..36ef75e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderTntMinecart.java @@ -0,0 +1,51 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.item.EntityMinecartTNT; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; + +public class RenderTntMinecart extends RenderMinecart +{ + public RenderTntMinecart(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + protected void func_180560_a(EntityMinecartTNT minecart, float partialTicks, IBlockState state) + { + int i = minecart.getFuseTicks(); + + if (i > -1 && (float)i - partialTicks + 1.0F < 10.0F) + { + float f = 1.0F - ((float)i - partialTicks + 1.0F) / 10.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + f = f * f; + f = f * f; + float f1 = 1.0F + f * 0.3F; + GlStateManager.scale(f1, f1, f1); + } + + super.func_180560_a(minecart, partialTicks, state); + + if (i > -1 && i / 5 % 2 == 0) + { + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 772); + GlStateManager.color(1.0F, 1.0F, 1.0F, (1.0F - ((float)i - partialTicks + 1.0F) / 100.0F) * 0.8F); + GlStateManager.pushMatrix(); + blockrendererdispatcher.renderBlockBrightness(Blocks.tnt.getDefaultState(), 1.0F); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java new file mode 100644 index 0000000..e031f73 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java @@ -0,0 +1,69 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelVillager; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerCustomHead; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.ResourceLocation; + +public class RenderVillager extends RenderLiving +{ + private static final ResourceLocation villagerTextures = new ResourceLocation("textures/entity/villager/villager.png"); + private static final ResourceLocation farmerVillagerTextures = new ResourceLocation("textures/entity/villager/farmer.png"); + private static final ResourceLocation librarianVillagerTextures = new ResourceLocation("textures/entity/villager/librarian.png"); + private static final ResourceLocation priestVillagerTextures = new ResourceLocation("textures/entity/villager/priest.png"); + private static final ResourceLocation smithVillagerTextures = new ResourceLocation("textures/entity/villager/smith.png"); + private static final ResourceLocation butcherVillagerTextures = new ResourceLocation("textures/entity/villager/butcher.png"); + + public RenderVillager(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelVillager(0.0F), 0.5F); + this.addLayer(new LayerCustomHead(this.getMainModel().villagerHead)); + } + + public ModelVillager getMainModel() + { + return (ModelVillager)super.getMainModel(); + } + + protected ResourceLocation getEntityTexture(EntityVillager entity) + { + switch (entity.getProfession()) + { + case 0: + return farmerVillagerTextures; + + case 1: + return librarianVillagerTextures; + + case 2: + return priestVillagerTextures; + + case 3: + return smithVillagerTextures; + + case 4: + return butcherVillagerTextures; + + default: + return villagerTextures; + } + } + + protected void preRenderCallback(EntityVillager entitylivingbaseIn, float partialTickTime) + { + float f = 0.9375F; + + if (entitylivingbaseIn.getGrowingAge() < 0) + { + f = (float)((double)f * 0.5D); + this.shadowSize = 0.25F; + } + else + { + this.shadowSize = 0.5F; + } + + GlStateManager.scale(f, f, f); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWitch.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWitch.java new file mode 100644 index 0000000..c09b676 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWitch.java @@ -0,0 +1,40 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelWitch; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerHeldItemWitch; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.util.ResourceLocation; + +public class RenderWitch extends RenderLiving +{ + private static final ResourceLocation witchTextures = new ResourceLocation("textures/entity/witch.png"); + + public RenderWitch(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelWitch(0.0F), 0.5F); + this.addLayer(new LayerHeldItemWitch(this)); + } + + public void doRender(EntityWitch entity, double x, double y, double z, float entityYaw, float partialTicks) + { + ((ModelWitch)this.mainModel).field_82900_g = entity.getHeldItem() != null; + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityWitch entity) + { + return witchTextures; + } + + public void transformHeldFull3DItemLayer() + { + GlStateManager.translate(0.0F, 0.1875F, 0.0F); + } + + protected void preRenderCallback(EntityWitch entitylivingbaseIn, float partialTickTime) + { + float f = 0.9375F; + GlStateManager.scale(f, f, f); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWither.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWither.java new file mode 100644 index 0000000..83e0596 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWither.java @@ -0,0 +1,45 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelWither; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerWitherAura; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.util.ResourceLocation; + +public class RenderWither extends RenderLiving +{ + private static final ResourceLocation invulnerableWitherTextures = new ResourceLocation("textures/entity/wither/wither_invulnerable.png"); + private static final ResourceLocation witherTextures = new ResourceLocation("textures/entity/wither/wither.png"); + + public RenderWither(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelWither(0.0F), 1.0F); + this.addLayer(new LayerWitherAura(this)); + } + + public void doRender(EntityWither entity, double x, double y, double z, float entityYaw, float partialTicks) + { + BossStatus.setBossStatus(entity, true); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityWither entity) + { + int i = entity.getInvulTime(); + return i > 0 && (i > 80 || i / 5 % 2 != 1) ? invulnerableWitherTextures : witherTextures; + } + + protected void preRenderCallback(EntityWither entitylivingbaseIn, float partialTickTime) + { + float f = 2.0F; + int i = entitylivingbaseIn.getInvulTime(); + + if (i > 0) + { + f -= ((float)i - partialTickTime) / 220.0F * 0.5F; + } + + GlStateManager.scale(f, f, f); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWolf.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWolf.java new file mode 100644 index 0000000..f148fac --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderWolf.java @@ -0,0 +1,41 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerWolfCollar; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.ResourceLocation; + +public class RenderWolf extends RenderLiving +{ + private static final ResourceLocation wolfTextures = new ResourceLocation("textures/entity/wolf/wolf.png"); + private static final ResourceLocation tamedWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_tame.png"); + private static final ResourceLocation anrgyWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_angry.png"); + + public RenderWolf(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn, modelBaseIn, shadowSizeIn); + this.addLayer(new LayerWolfCollar(this)); + } + + protected float handleRotationFloat(EntityWolf livingBase, float partialTicks) + { + return livingBase.getTailRotation(); + } + + public void doRender(EntityWolf entity, double x, double y, double z, float entityYaw, float partialTicks) + { + if (entity.isWolfWet()) + { + float f = entity.getBrightness(partialTicks) * entity.getShadingWhileWet(partialTicks); + GlStateManager.color(f, f, f); + } + + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityWolf entity) + { + return entity.isTamed() ? tamedWolfTextures : (entity.isAngry() ? anrgyWolfTextures : wolfTextures); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderXPOrb.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderXPOrb.java new file mode 100644 index 0000000..a21a486 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderXPOrb.java @@ -0,0 +1,92 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomColors; + +public class RenderXPOrb extends Render +{ + private static final ResourceLocation experienceOrbTextures = new ResourceLocation("textures/entity/experience_orb.png"); + + public RenderXPOrb(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.shadowSize = 0.15F; + this.shadowOpaque = 0.75F; + } + + public void doRender(EntityXPOrb entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + this.bindEntityTexture(entity); + int i = entity.getTextureByXP(); + float f = (float)(i % 4 * 16 + 0) / 64.0F; + float f1 = (float)(i % 4 * 16 + 16) / 64.0F; + float f2 = (float)(i / 4 * 16 + 0) / 64.0F; + float f3 = (float)(i / 4 * 16 + 16) / 64.0F; + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + int j = entity.getBrightnessForRender(partialTicks); + int k = j % 65536; + int l = j / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k / 1.0F, (float)l / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + float f7 = 255.0F; + float f8 = ((float)entity.xpColor + partialTicks) / 2.0F; + + if (Config.isCustomColors()) + { + f8 = CustomColors.getXpOrbTimer(f8); + } + + l = (int)((MathHelper.sin(f8 + 0.0F) + 1.0F) * 0.5F * 255.0F); + int i1 = 255; + int j1 = (int)((MathHelper.sin(f8 + 4.1887903F) + 1.0F) * 0.1F * 255.0F); + GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + float f9 = 0.3F; + GlStateManager.scale(0.3F, 0.3F, 0.3F); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); + int k1 = l; + int l1 = 255; + int i2 = j1; + + if (Config.isCustomColors()) + { + int j2 = CustomColors.getXpOrbColor(f8); + + if (j2 >= 0) + { + k1 = j2 >> 16 & 255; + l1 = j2 >> 8 & 255; + i2 = j2 >> 0 & 255; + } + } + + worldrenderer.pos((double)(0.0F - f5), (double)(0.0F - f6), 0.0D).tex((double)f, (double)f3).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)(f4 - f5), (double)(0.0F - f6), 0.0D).tex((double)f1, (double)f3).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)(f4 - f5), (double)(1.0F - f6), 0.0D).tex((double)f1, (double)f2).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldrenderer.pos((double)(0.0F - f5), (double)(1.0F - f6), 0.0D).tex((double)f, (double)f2).color(k1, l1, i2, 128).normal(0.0F, 1.0F, 0.0F).endVertex(); + tessellator.draw(); + GlStateManager.disableBlend(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityXPOrb entity) + { + return experienceOrbTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderZombie.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderZombie.java new file mode 100644 index 0000000..eb31fda --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RenderZombie.java @@ -0,0 +1,90 @@ +package net.minecraft.client.renderer.entity; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelZombie; +import net.minecraft.client.model.ModelZombieVillager; +import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; +import net.minecraft.client.renderer.entity.layers.LayerCustomHead; +import net.minecraft.client.renderer.entity.layers.LayerHeldItem; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.client.renderer.entity.layers.LayerVillagerArmor; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.util.ResourceLocation; + +public class RenderZombie extends RenderBiped +{ + private static final ResourceLocation zombieTextures = new ResourceLocation("textures/entity/zombie/zombie.png"); + private static final ResourceLocation zombieVillagerTextures = new ResourceLocation("textures/entity/zombie/zombie_villager.png"); + private final ModelBiped field_82434_o; + private final ModelZombieVillager zombieVillagerModel; + private final List> field_177121_n; + private final List> field_177122_o; + + public RenderZombie(RenderManager renderManagerIn) + { + super(renderManagerIn, new ModelZombie(), 0.5F, 1.0F); + LayerRenderer layerrenderer = (LayerRenderer)this.layerRenderers.get(0); + this.field_82434_o = this.modelBipedMain; + this.zombieVillagerModel = new ModelZombieVillager(); + this.addLayer(new LayerHeldItem(this)); + LayerBipedArmor layerbipedarmor = new LayerBipedArmor(this) + { + protected void initArmor() + { + this.modelLeggings = new ModelZombie(0.5F, true); + this.modelArmor = new ModelZombie(1.0F, true); + } + }; + this.addLayer(layerbipedarmor); + this.field_177122_o = Lists.newArrayList(this.layerRenderers); + + if (layerrenderer instanceof LayerCustomHead) + { + this.removeLayer(layerrenderer); + this.addLayer(new LayerCustomHead(this.zombieVillagerModel.bipedHead)); + } + + this.removeLayer(layerbipedarmor); + this.addLayer(new LayerVillagerArmor(this)); + this.field_177121_n = Lists.newArrayList(this.layerRenderers); + } + + public void doRender(EntityZombie entity, double x, double y, double z, float entityYaw, float partialTicks) + { + this.func_82427_a(entity); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityZombie entity) + { + return entity.isVillager() ? zombieVillagerTextures : zombieTextures; + } + + private void func_82427_a(EntityZombie zombie) + { + if (zombie.isVillager()) + { + this.mainModel = this.zombieVillagerModel; + this.layerRenderers = this.field_177121_n; + } + else + { + this.mainModel = this.field_82434_o; + this.layerRenderers = this.field_177122_o; + } + + this.modelBipedMain = (ModelBiped)this.mainModel; + } + + protected void rotateCorpse(EntityZombie bat, float p_77043_2_, float p_77043_3_, float partialTicks) + { + if (bat.isConverting()) + { + p_77043_3_ += (float)(Math.cos((double)bat.ticksExisted * 3.25D) * Math.PI * 0.25D); + } + + super.rotateCorpse(bat, p_77043_2_, p_77043_3_, partialTicks); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivin# b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivin# new file mode 100644 index 0000000..a789b0f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivin# @@ -0,0 +1,17 @@ +*************** +*** 43,49 **** + } + + protected > boolean func_177094_a(U p_177094_1_) { +- return this.field_177097_h.add(p_177094_1_); + } + + protected > boolean func_177089_b(U p_177089_1_) { +--- 43,49 ---- + } + + protected > boolean func_177094_a(U p_177094_1_) { ++ return this.field_177097_h.add((LayerRenderer)p_177094_1_); + } + + protected > boolean func_177089_b(U p_177089_1_) { diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java new file mode 100644 index 0000000..34888b0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivingEntity.java @@ -0,0 +1,684 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.animation.ModuleOneSevenVisuals; +import com.cheatbreaker.client.module.impl.normal.hypixel.ModuleNickHider; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleHitColor; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleNameTag; +import com.google.common.collect.Lists; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelSpider; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Team; +import net.minecraft.src.Config; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.optifine.EmissiveTextures; +import net.optifine.entity.model.CustomEntityModels; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +import java.nio.FloatBuffer; +import java.util.List; + +public abstract class RendererLivingEntity extends Render { + private static final Logger logger = LogManager.getLogger(); + private static final DynamicTexture textureBrightness = new DynamicTexture(16, 16); + public ModelBase mainModel; + protected FloatBuffer brightnessBuffer = GLAllocation.createDirectFloatBuffer(4); + protected List> layerRenderers = Lists.>newArrayList(); + protected boolean renderOutlines = false; + public static float NAME_TAG_RANGE = 64.0F; + public static float NAME_TAG_RANGE_SNEAK = 32.0F; + public EntityLivingBase renderEntity; + public float renderLimbSwing; + public float renderLimbSwingAmount; + public float renderAgeInTicks; + public float renderHeadYaw; + public float renderHeadPitch; + public float renderScaleFactor; + public float renderPartialTicks; + private boolean renderModelPushMatrix; + private boolean renderLayersPushMatrix; + public static final boolean animateModelLiving = Boolean.getBoolean("animate.model.living"); + + public RendererLivingEntity(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) { + super(renderManagerIn); + this.mainModel = modelBaseIn; + this.shadowSize = shadowSizeIn; + this.renderModelPushMatrix = this.mainModel instanceof ModelSpider; + } + + public > boolean addLayer(U layer) { + return this.layerRenderers.add((LayerRenderer) layer); + } + + protected > boolean removeLayer(U layer) { + return this.layerRenderers.remove(layer); + } + + public ModelBase getMainModel() { + return this.mainModel; + } + + /** + * Returns a rotation angle that is inbetween two other rotation angles. par1 and par2 are the angles between which + * to interpolate, par3 is probably a float between 0.0 and 1.0 that tells us where "between" the two angles we are. + * Example: par1 = 30, par2 = 50, par3 = 0.5, then return = 40 + */ + protected float interpolateRotation(float par1, float par2, float par3) { + float f; + + for (f = par2 - par1; f < -180.0F; f += 360.0F) { + ; + } + + while (f >= 180.0F) { + f -= 360.0F; + } + + return par1 + par3 * f; + } + + public void transformHeldFull3DItemLayer() { + } + + /** + * Renders the desired {@code T} type Entity. + */ + public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) { + if (!Reflector.RenderLivingEvent_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Pre_Constructor, new Object[]{entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)})) { + if (animateModelLiving) { + entity.limbSwingAmount = 1.0F; + } + + GlStateManager.pushMatrix(); + GlStateManager.disableCull(); + this.mainModel.swingProgress = this.getSwingProgress(entity, partialTicks); + this.mainModel.isRiding = entity.isRiding(); + + if (Reflector.ForgeEntity_shouldRiderSit.exists()) { + this.mainModel.isRiding = entity.isRiding() && entity.ridingEntity != null && Reflector.callBoolean(entity.ridingEntity, Reflector.ForgeEntity_shouldRiderSit, new Object[0]); + } + + this.mainModel.isChild = entity.isChild(); + + try { + float f = this.interpolateRotation(entity.prevRenderYawOffset, entity.renderYawOffset, partialTicks); + float f1 = this.interpolateRotation(entity.prevRotationYawHead, entity.rotationYawHead, partialTicks); + float f2 = f1 - f; + + if (this.mainModel.isRiding && entity.ridingEntity instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase) entity.ridingEntity; + f = this.interpolateRotation(entitylivingbase.prevRenderYawOffset, entitylivingbase.renderYawOffset, partialTicks); + f2 = f1 - f; + float f3 = MathHelper.wrapAngleTo180_float(f2); + + if (f3 < -85.0F) { + f3 = -85.0F; + } + + if (f3 >= 85.0F) { + f3 = 85.0F; + } + + f = f1 - f3; + + if (f3 * f3 > 2500.0F) { + f += f3 * 0.2F; + } + + f2 = f1 - f; + } + + float f7 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks; + this.renderLivingAt(entity, x, y, z); + float f8 = this.handleRotationFloat(entity, partialTicks); + this.rotateCorpse(entity, f8, f, partialTicks); + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(-1.0F, -1.0F, 1.0F); + this.preRenderCallback(entity, partialTicks); + float f4 = 0.0625F; + GlStateManager.translate(0.0F, -1.5078125F, 0.0F); + float f5 = entity.prevLimbSwingAmount + (entity.limbSwingAmount - entity.prevLimbSwingAmount) * partialTicks; + float f6 = entity.limbSwing - entity.limbSwingAmount * (1.0F - partialTicks); + + if (entity.isChild()) { + f6 *= 3.0F; + } + + if (f5 > 1.0F) { + f5 = 1.0F; + } + + GlStateManager.enableAlpha(); + this.mainModel.setLivingAnimations(entity, f6, f5, partialTicks); + this.mainModel.setRotationAngles(f6, f5, f8, f2, f7, 0.0625F, entity); + + if (CustomEntityModels.isActive()) { + this.renderEntity = entity; + this.renderLimbSwing = f6; + this.renderLimbSwingAmount = f5; + this.renderAgeInTicks = f8; + this.renderHeadYaw = f2; + this.renderHeadPitch = f7; + this.renderScaleFactor = f4; + this.renderPartialTicks = partialTicks; + } + + if (this.renderOutlines) { + boolean flag1 = this.setScoreTeamColor(entity); + this.renderModel(entity, f6, f5, f8, f2, f7, 0.0625F); + + if (flag1) { + this.unsetScoreTeamColor(); + } + } else { + boolean flag = this.setDoRenderBrightness(entity, partialTicks); + + if (EmissiveTextures.isActive()) { + EmissiveTextures.beginRender(); + } + + if (this.renderModelPushMatrix) { + GlStateManager.pushMatrix(); + } + + this.renderModel(entity, f6, f5, f8, f2, f7, 0.0625F); + + if (this.renderModelPushMatrix) { + GlStateManager.popMatrix(); + } + + if (EmissiveTextures.isActive()) { + if (EmissiveTextures.hasEmissive()) { + this.renderModelPushMatrix = true; + EmissiveTextures.beginRenderEmissive(); + GlStateManager.pushMatrix(); + this.renderModel(entity, f6, f5, f8, f2, f7, f4); + GlStateManager.popMatrix(); + EmissiveTextures.endRenderEmissive(); + } + + EmissiveTextures.endRender(); + } + + if (flag) { + this.unsetBrightness(); + } + + GlStateManager.depthMask(true); + + if (!(entity instanceof EntityPlayer) || !((EntityPlayer) entity).isSpectator()) { + this.renderLayers(entity, f6, f5, partialTicks, f8, f2, f7, 0.0625F); + } + } + + if (CustomEntityModels.isActive()) { + this.renderEntity = null; + } + + GlStateManager.disableRescaleNormal(); + } catch (Exception exception) { + logger.error((String) "Couldn\'t render entity", (Throwable) exception); + } + + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.enableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.enableCull(); + GlStateManager.popMatrix(); + + if (!this.renderOutlines) { + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + if (Reflector.RenderLivingEvent_Post_Constructor.exists()) { + Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Post_Constructor, new Object[]{entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}); + } + } + } + + protected boolean setScoreTeamColor(T entityLivingBaseIn) { + int i = 16777215; + + if (entityLivingBaseIn instanceof EntityPlayer) { + ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam) entityLivingBaseIn.getTeam(); + + if (scoreplayerteam != null) { + String s = FontRenderer.getFormatFromString(scoreplayerteam.getColorPrefix()); + + if (s.length() >= 2) { + i = this.getFontRendererFromRenderManager().getColorCode(s.charAt(1)); + } + } + } + + float f1 = (float) (i >> 16 & 255) / 255.0F; + float f2 = (float) (i >> 8 & 255) / 255.0F; + float f = (float) (i & 255) / 255.0F; + GlStateManager.disableLighting(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.color(f1, f2, f, 1.0F); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + return true; + } + + protected void unsetScoreTeamColor() { + GlStateManager.enableLighting(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.enableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.enableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + /** + * Renders the model in RenderLiving + */ + protected void renderModel(T entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float scaleFactor) { + boolean flag = !entitylivingbaseIn.isInvisible(); + boolean flag1 = !flag && !entitylivingbaseIn.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer); + + if (flag || flag1) { + if (!this.bindEntityTexture(entitylivingbaseIn)) { + return; + } + + if (flag1) { + GlStateManager.pushMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 0.15F); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.alphaFunc(516, 0.003921569F); + } + + this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, scaleFactor); + + if (flag1) { + GlStateManager.disableBlend(); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + } + } + } + + protected boolean setDoRenderBrightness(T entityLivingBaseIn, float partialTicks) { + return this.setBrightness(entityLivingBaseIn, partialTicks, true); + } + + protected boolean setBrightness(T entitylivingbaseIn, float partialTicks, boolean combineTextures) { + float f = entitylivingbaseIn.getBrightness(partialTicks); + int i = this.getColorMultiplier(entitylivingbaseIn, f, partialTicks); + boolean flag = (i >> 24 & 255) > 0; + boolean flag1 = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; + + if (!flag && !flag1) { + return false; + } else if (!flag && !combineTextures) { + return false; + } else { + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.enableTexture2D(); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.defaultTexUnit); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PRIMARY_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_REPLACE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.defaultTexUnit); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA); + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.enableTexture2D(); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, OpenGlHelper.GL_INTERPOLATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.GL_CONSTANT); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE2_RGB, OpenGlHelper.GL_CONSTANT); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND2_RGB, GL11.GL_SRC_ALPHA); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_REPLACE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.GL_PREVIOUS); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA); + this.brightnessBuffer.position(0); + + float brightness = ModuleOneSevenVisuals.redArmor.getBooleanValue() ? 0.73f : 1.0F; + if (flag1) { + ModuleHitColor hc = CheatBreaker.getInstance().getModuleManager().hitColorMod; + if (hc.isEnabled()) { + f = hc.affectedBrightness.getBooleanValue() ? f : 1.0F; + float hitA = (float)(hc.hitColor.getColorValue() >> 24 & 255) / 255.0F; + if (!hc.fade.getValue().equals("None")) { + float percent = 1.0F - (float)entitylivingbaseIn.hurtTime / 10.0F; + if (hc.fade.getValue().equals("Linear In/Out")) { + percent = percent < 0.5F ? percent / 0.5F : (1.0F - percent) / 0.5F; + } else if (hc.fade.getValue().equals("Linear Out")) { + percent = (1.0F - percent); + } + + hitA = hitA * percent; + } + + this.brightnessBuffer.put((float) (hc.hitColor.getColorValue() >> 16 & 255) / 255.0F * brightness * f); + this.brightnessBuffer.put((float) (hc.hitColor.getColorValue() >> 8 & 255) / 255.0F * brightness * f); + this.brightnessBuffer.put((float) (hc.hitColor.getColorValue() & 255) / 255.0F * brightness * f); + this.brightnessBuffer.put(hitA); + } else { + this.brightnessBuffer.put(brightness); + this.brightnessBuffer.put(0.0F); + this.brightnessBuffer.put(0.0F); + this.brightnessBuffer.put(0.3F); + } + + if (Config.isShaders()) { + Shaders.setEntityColor(1.0F, 0.0F, 0.0F, 0.3F); + } + } else { + float f1 = (float) (i >> 24 & 255) / 255.0F; + float f2 = (float) (i >> 16 & 255) / 255.0F; + float f3 = (float) (i >> 8 & 255) / 255.0F; + float f4 = (float) (i & 255) / 255.0F; + this.brightnessBuffer.put(f2); + this.brightnessBuffer.put(f3); + this.brightnessBuffer.put(f4); + this.brightnessBuffer.put(1.0F - f1); + + if (Config.isShaders()) { + Shaders.setEntityColor(f2, f3, f4, 1.0F - f1); + } + } + + this.brightnessBuffer.flip(); + GL11.glTexEnv(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_COLOR, this.brightnessBuffer); + GlStateManager.setActiveTexture(OpenGlHelper.GL_TEXTURE2); + GlStateManager.enableTexture2D(); + GlStateManager.bindTexture(textureBrightness.getGlTextureId()); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.GL_PREVIOUS); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.lightmapTexUnit); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_REPLACE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.GL_PREVIOUS); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + return true; + } + } + + protected void unsetBrightness() { + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.enableTexture2D(); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.defaultTexUnit); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PRIMARY_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.defaultTexUnit); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_ALPHA, OpenGlHelper.GL_PRIMARY_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_ALPHA, GL11.GL_SRC_ALPHA); + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, GL11.GL_TEXTURE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, GL11.GL_TEXTURE); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.setActiveTexture(OpenGlHelper.GL_TEXTURE2); + GlStateManager.disableTexture2D(); + GlStateManager.bindTexture(0); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, GL11.GL_TEXTURE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_MODULATE); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA); + GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, GL11.GL_TEXTURE); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + + if (Config.isShaders()) { + Shaders.setEntityColor(0.0F, 0.0F, 0.0F, 0.0F); + } + } + + /** + * Sets a simple glTranslate on a LivingEntity. + */ + protected void renderLivingAt(T entityLivingBaseIn, double x, double y, double z) { + GlStateManager.translate((float) x, (float) y, (float) z); + } + + protected void rotateCorpse(T bat, float p_77043_2_, float p_77043_3_, float partialTicks) { + GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + + if (bat.deathTime > 0) { + float f = ((float) bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F; + f = MathHelper.sqrt_float(f); + + if (f > 1.0F) { + f = 1.0F; + } + + GlStateManager.rotate(f * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F); + } else { + String s = EnumChatFormatting.getTextWithoutFormattingCodes(bat.getName()); + + if (s != null && (s.equals("Dinnerbone") || s.equals("Grumm")) && (!(bat instanceof EntityPlayer) || ((EntityPlayer) bat).isWearing(EnumPlayerModelParts.CAPE))) { + GlStateManager.translate(0.0F, bat.height + 0.1F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + } + } + } + + /** + * Returns where in the swing animation the living entity is (from 0 to 1). Args : entity, partialTickTime + */ + protected float getSwingProgress(T livingBase, float partialTickTime) { + return livingBase.getSwingProgress(partialTickTime); + } + + /** + * Defines what float the third param in setRotationAngles of ModelBase is + */ + protected float handleRotationFloat(T livingBase, float partialTicks) { + return (float) livingBase.ticksExisted + partialTicks; + } + + protected void renderLayers(T entitylivingbaseIn, float p_177093_2_, float p_177093_3_, float partialTicks, float p_177093_5_, float p_177093_6_, float p_177093_7_, float p_177093_8_) { + for (LayerRenderer layerrenderer : this.layerRenderers) { + boolean flag = this.setBrightness(entitylivingbaseIn, partialTicks, layerrenderer.shouldCombineTextures()); + + if (EmissiveTextures.isActive()) { + EmissiveTextures.beginRender(); + } + + if (this.renderLayersPushMatrix) { + GlStateManager.pushMatrix(); + } + + layerrenderer.doRenderLayer(entitylivingbaseIn, p_177093_2_, p_177093_3_, partialTicks, p_177093_5_, p_177093_6_, p_177093_7_, p_177093_8_); + + if (this.renderLayersPushMatrix) { + GlStateManager.popMatrix(); + } + + if (EmissiveTextures.isActive()) { + if (EmissiveTextures.hasEmissive()) { + this.renderLayersPushMatrix = true; + EmissiveTextures.beginRenderEmissive(); + GlStateManager.pushMatrix(); + layerrenderer.doRenderLayer(entitylivingbaseIn, p_177093_2_, p_177093_3_, partialTicks, p_177093_5_, p_177093_6_, p_177093_7_, p_177093_8_); + GlStateManager.popMatrix(); + EmissiveTextures.endRenderEmissive(); + } + + EmissiveTextures.endRender(); + } + + if (flag) { + this.unsetBrightness(); + } + } + } + + protected float getDeathMaxRotation(T entityLivingBaseIn) { + return 90.0F; + } + + /** + * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime + */ + protected int getColorMultiplier(T entitylivingbaseIn, float lightBrightness, float partialTickTime) { + return 0; + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(T entitylivingbaseIn, float partialTickTime) { + } + + public void renderName(T entity, double x, double y, double z) { + ModuleNameTag nametagMod = CheatBreaker.getInstance().getModuleManager().nameTagMod; + + if (!Reflector.RenderLivingEvent_Specials_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Pre_Constructor, entity, this, x, y, z)) { + if (this.canRenderName(entity) || (entity.equals(Minecraft.getMinecraft().thePlayer) && nametagMod.isEnabled() && nametagMod.showOwnNametag.getBooleanValue())) { + + double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer); + float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; + + + if (d0 < (double) (f * f) && !CheatBreaker.getInstance().hideNameTags) { + String entityName = entity.getDisplayName().getFormattedText(); + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + entityName = entityName.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + entityName = entityName.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + GlStateManager.alphaFunc(516, 0.1F); + + if (entity.isSneaking()) { + FontRenderer fontrenderer = this.getFontRendererFromRenderManager(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float) x, (float) y + entity.height + 0.5F - (entity.isChild() ? entity.height / 2.0F : 0.0F), (float) z); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-0.02666667F, -0.02666667F, 0.02666667F); + GlStateManager.translate(0.0F, 9.374999F, 0.0F); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + int i = fontrenderer.getStringWidth(entityName) / 2; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) (-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double) (-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double) (i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double) (i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.depthMask(true); + fontrenderer.drawString(entityName, -fontrenderer.getStringWidth(entityName) / 2, 0, 553648127, nametagMod.isEnabled() && nametagMod.textShadow.getBooleanValue()); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } else { + this.renderOffsetLivingLabel(entity, x, y - (entity.isChild() ? (double) (entity.height / 2.0F) : 0.0D), z, entityName, 0.02666667F, d0); + } + } + } + + if (Reflector.RenderLivingEvent_Specials_Post_Constructor.exists()) { + Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Post_Constructor, entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)); + } + } + } + + protected boolean canRenderName(T entity) { + EntityPlayerSP entityplayersp = Minecraft.getMinecraft().thePlayer; + + if (entity instanceof EntityPlayer) { + Team team = entity.getTeam(); + Team team1 = entityplayersp.getTeam(); + + if (team != null) { + Team.EnumVisible team$enumvisible = team.getNameTagVisibility(); + + switch (team$enumvisible) { + case NEVER: + return false; + + case HIDE_FOR_OTHER_TEAMS: + return team1 == null || team.isSameTeam(team1); + + case HIDE_FOR_OWN_TEAM: + return team1 == null || !team.isSameTeam(team1); + + default: + return true; + } + } + } + + return Minecraft.isGuiEnabled() && entity != this.renderManager.livingPlayer && !entity.isInvisibleToPlayer(entityplayersp) && entity.riddenByEntity == null; + } + + public void setRenderOutlines(boolean renderOutlinesIn) { + this.renderOutlines = renderOutlinesIn; + } + + public List> getLayerRenderers() { + return this.layerRenderers; + } + + static { + int[] aint = textureBrightness.getTextureData(); + + for (int i = 0; i < 256; ++i) { + aint[i] = -1; + } + + textureBrightness.updateDynamicTexture(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivin~ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivin~ new file mode 100644 index 0000000..c65cffd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/RendererLivin~ @@ -0,0 +1,596 @@ +package net.minecraft.client.renderer.entity; + +import com.google.common.collect.Lists; +import java.nio.FloatBuffer; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelSpider; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Team; +import net.minecraft.scoreboard.Team.EnumVisible; +import net.minecraft.src.Config; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.optifine.EmissiveTextures; +import net.optifine.entity.model.CustomEntityModels; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public abstract class RendererLivingEntity extends Render { + private static final Logger field_147923_a = LogManager.getLogger(); + private static final DynamicTexture field_177096_e = new DynamicTexture(16, 16); + public ModelBase field_77045_g; + protected FloatBuffer field_177095_g = GLAllocation.func_74529_h(4); + protected List> field_177097_h = Lists.>newArrayList(); + protected boolean field_177098_i = false; + public static float NAME_TAG_RANGE = 64.0F; + public static float NAME_TAG_RANGE_SNEAK = 32.0F; + public EntityLivingBase renderEntity; + public float renderLimbSwing; + public float renderLimbSwingAmount; + public float renderAgeInTicks; + public float renderHeadYaw; + public float renderHeadPitch; + public float renderScaleFactor; + public float renderPartialTicks; + private boolean renderModelPushMatrix; + private boolean renderLayersPushMatrix; + public static final boolean animateModelLiving = Boolean.getBoolean("animate.model.living"); + + public RendererLivingEntity(RenderManager p_i46156_1_, ModelBase p_i46156_2_, float p_i46156_3_) { + super(p_i46156_1_); + this.field_77045_g = p_i46156_2_; + this.field_76989_e = p_i46156_3_; + this.renderModelPushMatrix = this.field_77045_g instanceof ModelSpider; + } + + public > boolean func_177094_a(U p_177094_1_) { + return this.field_177097_h.add(p_177094_1_); + } + + protected > boolean func_177089_b(U p_177089_1_) { + return this.field_177097_h.remove(p_177089_1_); + } + + public ModelBase func_177087_b() { + return this.field_77045_g; + } + + protected float func_77034_a(float p_77034_1_, float p_77034_2_, float p_77034_3_) { + float f; + for(f = p_77034_2_ - p_77034_1_; f < -180.0F; f += 360.0F) { + ; + } + + while(f >= 180.0F) { + f -= 360.0F; + } + + return p_77034_1_ + p_77034_3_ * f; + } + + public void func_82422_c() { + } + + public void func_76986_a(T p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { + if(!Reflector.RenderLivingEvent_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Pre_Constructor, new Object[]{p_76986_1_, this, Double.valueOf(p_76986_2_), Double.valueOf(p_76986_4_), Double.valueOf(p_76986_6_)})) { + if(animateModelLiving) { + p_76986_1_.field_70721_aZ = 1.0F; + } + + GlStateManager.func_179094_E(); + GlStateManager.func_179129_p(); + this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_); + this.field_77045_g.field_78093_q = p_76986_1_.au(); + if(Reflector.ForgeEntity_shouldRiderSit.exists()) { + this.field_77045_g.field_78093_q = p_76986_1_.au() && p_76986_1_.m != null && Reflector.callBoolean(p_76986_1_.m, Reflector.ForgeEntity_shouldRiderSit, new Object[0]); + } + + this.field_77045_g.field_78091_s = p_76986_1_.func_70631_g_(); + + try { + float f = this.func_77034_a(p_76986_1_.field_70760_ar, p_76986_1_.field_70761_aq, p_76986_9_); + float f1 = this.func_77034_a(p_76986_1_.field_70758_at, p_76986_1_.field_70759_as, p_76986_9_); + float f2 = f1 - f; + if(this.field_77045_g.field_78093_q && p_76986_1_.m instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase)p_76986_1_.m; + f = this.func_77034_a(entitylivingbase.field_70760_ar, entitylivingbase.field_70761_aq, p_76986_9_); + f2 = f1 - f; + float f3 = MathHelper.func_76142_g(f2); + if(f3 < -85.0F) { + f3 = -85.0F; + } + + if(f3 >= 85.0F) { + f3 = 85.0F; + } + + f = f1 - f3; + if(f3 * f3 > 2500.0F) { + f += f3 * 0.2F; + } + + f2 = f1 - f; + } + + float f7 = p_76986_1_.B + (p_76986_1_.z - p_76986_1_.B) * p_76986_9_; + this.func_77039_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); + float f8 = this.func_77044_a(p_76986_1_, p_76986_9_); + this.func_77043_a(p_76986_1_, f8, f, p_76986_9_); + GlStateManager.func_179091_B(); + GlStateManager.func_179152_a(-1.0F, -1.0F, 1.0F); + this.func_77041_b(p_76986_1_, p_76986_9_); + float f4 = 0.0625F; + GlStateManager.func_179109_b(0.0F, -1.5078125F, 0.0F); + float f5 = p_76986_1_.field_70722_aY + (p_76986_1_.field_70721_aZ - p_76986_1_.field_70722_aY) * p_76986_9_; + float f6 = p_76986_1_.field_70754_ba - p_76986_1_.field_70721_aZ * (1.0F - p_76986_9_); + if(p_76986_1_.func_70631_g_()) { + f6 *= 3.0F; + } + + if(f5 > 1.0F) { + f5 = 1.0F; + } + + GlStateManager.func_179141_d(); + this.field_77045_g.func_78086_a(p_76986_1_, f6, f5, p_76986_9_); + this.field_77045_g.func_78087_a(f6, f5, f8, f2, f7, 0.0625F, p_76986_1_); + if(CustomEntityModels.isActive()) { + this.renderEntity = p_76986_1_; + this.renderLimbSwing = f6; + this.renderLimbSwingAmount = f5; + this.renderAgeInTicks = f8; + this.renderHeadYaw = f2; + this.renderHeadPitch = f7; + this.renderScaleFactor = f4; + this.renderPartialTicks = p_76986_9_; + } + + if(this.field_177098_i) { + boolean flag1 = this.func_177088_c(p_76986_1_); + this.func_77036_a(p_76986_1_, f6, f5, f8, f2, f7, 0.0625F); + if(flag1) { + this.func_180565_e(); + } + } else { + boolean flag = this.func_177090_c(p_76986_1_, p_76986_9_); + if(EmissiveTextures.isActive()) { + EmissiveTextures.beginRender(); + } + + if(this.renderModelPushMatrix) { + GlStateManager.func_179094_E(); + } + + this.func_77036_a(p_76986_1_, f6, f5, f8, f2, f7, 0.0625F); + if(this.renderModelPushMatrix) { + GlStateManager.func_179121_F(); + } + + if(EmissiveTextures.isActive()) { + if(EmissiveTextures.hasEmissive()) { + this.renderModelPushMatrix = true; + EmissiveTextures.beginRenderEmissive(); + GlStateManager.func_179094_E(); + this.func_77036_a(p_76986_1_, f6, f5, f8, f2, f7, f4); + GlStateManager.func_179121_F(); + EmissiveTextures.endRenderEmissive(); + } + + EmissiveTextures.endRender(); + } + + if(flag) { + this.func_177091_f(); + } + + GlStateManager.func_179132_a(true); + if(!(p_76986_1_ instanceof EntityPlayer) || !((EntityPlayer)p_76986_1_).func_175149_v()) { + this.func_177093_a(p_76986_1_, f6, f5, p_76986_9_, f8, f2, f7, 0.0625F); + } + } + + if(CustomEntityModels.isActive()) { + this.renderEntity = null; + } + + GlStateManager.func_179101_C(); + } catch (Exception exception) { + field_147923_a.error((String)"Couldn\'t render entity", (Throwable)exception); + } + + GlStateManager.func_179138_g(OpenGlHelper.field_77476_b); + GlStateManager.func_179098_w(); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + GlStateManager.func_179089_o(); + GlStateManager.func_179121_F(); + if(!this.field_177098_i) { + super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } + + if(Reflector.RenderLivingEvent_Post_Constructor.exists()) { + Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Post_Constructor, new Object[]{p_76986_1_, this, Double.valueOf(p_76986_2_), Double.valueOf(p_76986_4_), Double.valueOf(p_76986_6_)}); + } + + } + } + + protected boolean func_177088_c(T p_177088_1_) { + int i = 16777215; + if(p_177088_1_ instanceof EntityPlayer) { + ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)p_177088_1_.func_96124_cp(); + if(scoreplayerteam != null) { + String s = FontRenderer.func_78282_e(scoreplayerteam.func_96668_e()); + if(s.length() >= 2) { + i = this.func_76983_a().func_175064_b(s.charAt(1)); + } + } + } + + float f1 = (float)(i >> 16 & 255) / 255.0F; + float f2 = (float)(i >> 8 & 255) / 255.0F; + float f = (float)(i & 255) / 255.0F; + GlStateManager.func_179140_f(); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + GlStateManager.func_179131_c(f1, f2, f, 1.0F); + GlStateManager.func_179090_x(); + GlStateManager.func_179138_g(OpenGlHelper.field_77476_b); + GlStateManager.func_179090_x(); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + return true; + } + + protected void func_180565_e() { + GlStateManager.func_179145_e(); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + GlStateManager.func_179098_w(); + GlStateManager.func_179138_g(OpenGlHelper.field_77476_b); + GlStateManager.func_179098_w(); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + } + + protected void func_77036_a(T p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) { + boolean flag = !p_77036_1_.ax(); + boolean flag1 = !flag && !p_77036_1_.f(Minecraft.func_71410_x().field_71439_g); + if(flag || flag1) { + if(!this.func_180548_c(p_77036_1_)) { + return; + } + + if(flag1) { + GlStateManager.func_179094_E(); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 0.15F); + GlStateManager.func_179132_a(false); + GlStateManager.func_179147_l(); + GlStateManager.func_179112_b(770, 771); + GlStateManager.func_179092_a(516, 0.003921569F); + } + + this.field_77045_g.func_78088_a(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + if(flag1) { + GlStateManager.func_179084_k(); + GlStateManager.func_179092_a(516, 0.1F); + GlStateManager.func_179121_F(); + GlStateManager.func_179132_a(true); + } + } + + } + + protected boolean func_177090_c(T p_177090_1_, float p_177090_2_) { + return this.func_177092_a(p_177090_1_, p_177090_2_, true); + } + + protected boolean func_177092_a(T p_177092_1_, float p_177092_2_, boolean p_177092_3_) { + float f = p_177092_1_.c(p_177092_2_); + int i = this.func_77030_a(p_177092_1_, f, p_177092_2_); + boolean flag = (i >> 24 & 255) > 0; + boolean flag1 = p_177092_1_.field_70737_aN > 0 || p_177092_1_.field_70725_aQ > 0; + if(!flag && !flag1) { + return false; + } else if(!flag && !p_177092_3_) { + return false; + } else { + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + GlStateManager.func_179098_w(); + GL11.glTexEnvi(8960, 8704, OpenGlHelper.field_176095_s); + GL11.glTexEnvi(8960, OpenGlHelper.field_176099_x, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176098_y, OpenGlHelper.field_77478_a); + GL11.glTexEnvi(8960, OpenGlHelper.field_176097_z, OpenGlHelper.field_176093_u); + GL11.glTexEnvi(8960, OpenGlHelper.field_176081_B, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176082_C, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176077_E, 7681); + GL11.glTexEnvi(8960, OpenGlHelper.field_176078_F, OpenGlHelper.field_77478_a); + GL11.glTexEnvi(8960, OpenGlHelper.field_176085_I, 770); + GlStateManager.func_179138_g(OpenGlHelper.field_77476_b); + GlStateManager.func_179098_w(); + GL11.glTexEnvi(8960, 8704, OpenGlHelper.field_176095_s); + GL11.glTexEnvi(8960, OpenGlHelper.field_176099_x, OpenGlHelper.field_176094_t); + GL11.glTexEnvi(8960, OpenGlHelper.field_176098_y, OpenGlHelper.field_176092_v); + GL11.glTexEnvi(8960, OpenGlHelper.field_176097_z, OpenGlHelper.field_176091_w); + GL11.glTexEnvi(8960, OpenGlHelper.field_176080_A, OpenGlHelper.field_176092_v); + GL11.glTexEnvi(8960, OpenGlHelper.field_176081_B, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176082_C, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176076_D, 770); + GL11.glTexEnvi(8960, OpenGlHelper.field_176077_E, 7681); + GL11.glTexEnvi(8960, OpenGlHelper.field_176078_F, OpenGlHelper.field_176091_w); + GL11.glTexEnvi(8960, OpenGlHelper.field_176085_I, 770); + this.field_177095_g.position(0); + if(flag1) { + this.field_177095_g.put(1.0F); + this.field_177095_g.put(0.0F); + this.field_177095_g.put(0.0F); + this.field_177095_g.put(0.3F); + if(Config.isShaders()) { + Shaders.setEntityColor(1.0F, 0.0F, 0.0F, 0.3F); + } + } else { + float f1 = (float)(i >> 24 & 255) / 255.0F; + float f2 = (float)(i >> 16 & 255) / 255.0F; + float f3 = (float)(i >> 8 & 255) / 255.0F; + float f4 = (float)(i & 255) / 255.0F; + this.field_177095_g.put(f2); + this.field_177095_g.put(f3); + this.field_177095_g.put(f4); + this.field_177095_g.put(1.0F - f1); + if(Config.isShaders()) { + Shaders.setEntityColor(f2, f3, f4, 1.0F - f1); + } + } + + this.field_177095_g.flip(); + GL11.glTexEnv(8960, 8705, (FloatBuffer)this.field_177095_g); + GlStateManager.func_179138_g(OpenGlHelper.field_176096_r); + GlStateManager.func_179098_w(); + GlStateManager.func_179144_i(field_177096_e.b()); + GL11.glTexEnvi(8960, 8704, OpenGlHelper.field_176095_s); + GL11.glTexEnvi(8960, OpenGlHelper.field_176099_x, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176098_y, OpenGlHelper.field_176091_w); + GL11.glTexEnvi(8960, OpenGlHelper.field_176097_z, OpenGlHelper.field_77476_b); + GL11.glTexEnvi(8960, OpenGlHelper.field_176081_B, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176082_C, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176077_E, 7681); + GL11.glTexEnvi(8960, OpenGlHelper.field_176078_F, OpenGlHelper.field_176091_w); + GL11.glTexEnvi(8960, OpenGlHelper.field_176085_I, 770); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + return true; + } + } + + protected void func_177091_f() { + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + GlStateManager.func_179098_w(); + GL11.glTexEnvi(8960, 8704, OpenGlHelper.field_176095_s); + GL11.glTexEnvi(8960, OpenGlHelper.field_176099_x, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176098_y, OpenGlHelper.field_77478_a); + GL11.glTexEnvi(8960, OpenGlHelper.field_176097_z, OpenGlHelper.field_176093_u); + GL11.glTexEnvi(8960, OpenGlHelper.field_176081_B, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176082_C, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176077_E, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176078_F, OpenGlHelper.field_77478_a); + GL11.glTexEnvi(8960, OpenGlHelper.field_176079_G, OpenGlHelper.field_176093_u); + GL11.glTexEnvi(8960, OpenGlHelper.field_176085_I, 770); + GL11.glTexEnvi(8960, OpenGlHelper.field_176086_J, 770); + GlStateManager.func_179138_g(OpenGlHelper.field_77476_b); + GL11.glTexEnvi(8960, 8704, OpenGlHelper.field_176095_s); + GL11.glTexEnvi(8960, OpenGlHelper.field_176099_x, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176081_B, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176082_C, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176098_y, 5890); + GL11.glTexEnvi(8960, OpenGlHelper.field_176097_z, OpenGlHelper.field_176091_w); + GL11.glTexEnvi(8960, OpenGlHelper.field_176077_E, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176085_I, 770); + GL11.glTexEnvi(8960, OpenGlHelper.field_176078_F, 5890); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179138_g(OpenGlHelper.field_176096_r); + GlStateManager.func_179090_x(); + GlStateManager.func_179144_i(0); + GL11.glTexEnvi(8960, 8704, OpenGlHelper.field_176095_s); + GL11.glTexEnvi(8960, OpenGlHelper.field_176099_x, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176081_B, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176082_C, 768); + GL11.glTexEnvi(8960, OpenGlHelper.field_176098_y, 5890); + GL11.glTexEnvi(8960, OpenGlHelper.field_176097_z, OpenGlHelper.field_176091_w); + GL11.glTexEnvi(8960, OpenGlHelper.field_176077_E, 8448); + GL11.glTexEnvi(8960, OpenGlHelper.field_176085_I, 770); + GL11.glTexEnvi(8960, OpenGlHelper.field_176078_F, 5890); + GlStateManager.func_179138_g(OpenGlHelper.field_77478_a); + if(Config.isShaders()) { + Shaders.setEntityColor(0.0F, 0.0F, 0.0F, 0.0F); + } + + } + + protected void func_77039_a(T p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) { + GlStateManager.func_179109_b((float)p_77039_2_, (float)p_77039_4_, (float)p_77039_6_); + } + + protected void func_77043_a(T p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) { + GlStateManager.func_179114_b(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + if(p_77043_1_.field_70725_aQ > 0) { + float f = ((float)p_77043_1_.field_70725_aQ + p_77043_4_ - 1.0F) / 20.0F * 1.6F; + f = MathHelper.func_76129_c(f); + if(f > 1.0F) { + f = 1.0F; + } + + GlStateManager.func_179114_b(f * this.func_77037_a(p_77043_1_), 0.0F, 0.0F, 1.0F); + } else { + String s = EnumChatFormatting.func_110646_a(p_77043_1_.e_()); + if(s != null && (s.equals("Dinnerbone") || s.equals("Grumm")) && (!(p_77043_1_ instanceof EntityPlayer) || ((EntityPlayer)p_77043_1_).func_175148_a(EnumPlayerModelParts.CAPE))) { + GlStateManager.func_179109_b(0.0F, p_77043_1_.K + 0.1F, 0.0F); + GlStateManager.func_179114_b(180.0F, 0.0F, 0.0F, 1.0F); + } + } + + } + + protected float func_77040_d(T p_77040_1_, float p_77040_2_) { + return p_77040_1_.func_70678_g(p_77040_2_); + } + + protected float func_77044_a(T p_77044_1_, float p_77044_2_) { + return (float)p_77044_1_.W + p_77044_2_; + } + + protected void func_177093_a(T p_177093_1_, float p_177093_2_, float p_177093_3_, float p_177093_4_, float p_177093_5_, float p_177093_6_, float p_177093_7_, float p_177093_8_) { + for(LayerRenderer layerrenderer : this.field_177097_h) { + boolean flag = this.func_177092_a(p_177093_1_, p_177093_4_, layerrenderer.func_177142_b()); + if(EmissiveTextures.isActive()) { + EmissiveTextures.beginRender(); + } + + if(this.renderLayersPushMatrix) { + GlStateManager.func_179094_E(); + } + + layerrenderer.func_177141_a(p_177093_1_, p_177093_2_, p_177093_3_, p_177093_4_, p_177093_5_, p_177093_6_, p_177093_7_, p_177093_8_); + if(this.renderLayersPushMatrix) { + GlStateManager.func_179121_F(); + } + + if(EmissiveTextures.isActive()) { + if(EmissiveTextures.hasEmissive()) { + this.renderLayersPushMatrix = true; + EmissiveTextures.beginRenderEmissive(); + GlStateManager.func_179094_E(); + layerrenderer.func_177141_a(p_177093_1_, p_177093_2_, p_177093_3_, p_177093_4_, p_177093_5_, p_177093_6_, p_177093_7_, p_177093_8_); + GlStateManager.func_179121_F(); + EmissiveTextures.endRenderEmissive(); + } + + EmissiveTextures.endRender(); + } + + if(flag) { + this.func_177091_f(); + } + } + + } + + protected float func_77037_a(T p_77037_1_) { + return 90.0F; + } + + protected int func_77030_a(T p_77030_1_, float p_77030_2_, float p_77030_3_) { + return 0; + } + + protected void func_77041_b(T p_77041_1_, float p_77041_2_) { + } + + public void func_177067_a(T p_177067_1_, double p_177067_2_, double p_177067_4_, double p_177067_6_) { + if(!Reflector.RenderLivingEvent_Specials_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Pre_Constructor, new Object[]{p_177067_1_, this, Double.valueOf(p_177067_2_), Double.valueOf(p_177067_4_), Double.valueOf(p_177067_6_)})) { + if(this.func_177070_b(p_177067_1_)) { + double d0 = p_177067_1_.h(this.field_76990_c.field_78734_h); + float f = p_177067_1_.av()?NAME_TAG_RANGE_SNEAK:NAME_TAG_RANGE; + if(d0 < (double)(f * f)) { + String s = p_177067_1_.f_().func_150254_d(); + float f1 = 0.02666667F; + GlStateManager.func_179092_a(516, 0.1F); + if(p_177067_1_.av()) { + FontRenderer fontrenderer = this.func_76983_a(); + GlStateManager.func_179094_E(); + GlStateManager.func_179109_b((float)p_177067_2_, (float)p_177067_4_ + p_177067_1_.K + 0.5F - (p_177067_1_.func_70631_g_()?p_177067_1_.K / 2.0F:0.0F), (float)p_177067_6_); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.func_179114_b(-this.field_76990_c.field_78735_i, 0.0F, 1.0F, 0.0F); + GlStateManager.func_179114_b(this.field_76990_c.field_78732_j, 1.0F, 0.0F, 0.0F); + GlStateManager.func_179152_a(-0.02666667F, -0.02666667F, 0.02666667F); + GlStateManager.func_179109_b(0.0F, 9.374999F, 0.0F); + GlStateManager.func_179140_f(); + GlStateManager.func_179132_a(false); + GlStateManager.func_179147_l(); + GlStateManager.func_179090_x(); + GlStateManager.func_179120_a(770, 771, 1, 0); + int i = fontrenderer.func_78256_a(s) / 2; + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181706_f); + worldrenderer.func_181662_b((double)(-i - 1), -1.0D, 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d(); + worldrenderer.func_181662_b((double)(-i - 1), 8.0D, 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d(); + worldrenderer.func_181662_b((double)(i + 1), 8.0D, 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d(); + worldrenderer.func_181662_b((double)(i + 1), -1.0D, 0.0D).func_181666_a(0.0F, 0.0F, 0.0F, 0.25F).func_181675_d(); + tessellator.func_78381_a(); + GlStateManager.func_179098_w(); + GlStateManager.func_179132_a(true); + fontrenderer.func_78276_b(s, -fontrenderer.func_78256_a(s) / 2, 0, 553648127); + GlStateManager.func_179145_e(); + GlStateManager.func_179084_k(); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179121_F(); + } else { + this.func_177069_a(p_177067_1_, p_177067_2_, p_177067_4_ - (p_177067_1_.func_70631_g_()?(double)(p_177067_1_.K / 2.0F):0.0D), p_177067_6_, s, 0.02666667F, d0); + } + } + } + + if(Reflector.RenderLivingEvent_Specials_Post_Constructor.exists()) { + Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Post_Constructor, new Object[]{p_177067_1_, this, Double.valueOf(p_177067_2_), Double.valueOf(p_177067_4_), Double.valueOf(p_177067_6_)}); + } + + } + } + + protected boolean func_177070_b(T p_177070_1_) { + EntityPlayerSP entityplayersp = Minecraft.func_71410_x().field_71439_g; + if(p_177070_1_ instanceof EntityPlayer && p_177070_1_ != entityplayersp) { + Team team = p_177070_1_.func_96124_cp(); + Team team1 = entityplayersp.bO(); + if(team != null) { + EnumVisible enumvisible = team.func_178770_i(); + switch(enumvisible) { + case ALWAYS: + return true; + case NEVER: + return false; + case HIDE_FOR_OTHER_TEAMS: + return team1 == null || team.func_142054_a(team1); + case HIDE_FOR_OWN_TEAM: + return team1 == null || !team.func_142054_a(team1); + default: + return true; + } + } + } + + return Minecraft.func_71382_s() && p_177070_1_ != this.field_76990_c.field_78734_h && !p_177070_1_.f(entityplayersp) && p_177070_1_.l == null; + } + + public void func_177086_a(boolean p_177086_1_) { + this.field_177098_i = p_177086_1_; + } + + public List> getLayerRenderers() { + return this.field_177097_h; + } + + static { + int[] aint = field_177096_e.func_110565_c(); + + for(int i = 0; i < 256; ++i) { + aint[i] = -1; + } + + field_177096_e.func_110564_a(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java new file mode 100644 index 0000000..efda8a9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java @@ -0,0 +1,266 @@ +package net.minecraft.client.renderer.entity.layers; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnchantmentGlint; +import com.google.common.collect.Maps; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomItems; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersRender; + +import java.util.Map; + +public abstract class LayerArmorBase implements LayerRenderer +{ + protected static final ResourceLocation ENCHANTED_ITEM_GLINT_RES = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + protected T modelLeggings; + protected T modelArmor; + private final RendererLivingEntity renderer; + private float alpha = 1.0F; + private float colorR = 1.0F; + private float colorG = 1.0F; + private float colorB = 1.0F; + private boolean skipRenderGlint; + private static final Map ARMOR_TEXTURE_RES_MAP = Maps.newHashMap(); + + public LayerArmorBase(RendererLivingEntity rendererIn) + { + this.renderer = rendererIn; + this.initArmor(); + } + + public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 4); + this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 3); + this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 2); + this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 1); + } + + public boolean shouldCombineTextures() + { + return CheatBreaker.getInstance().getModuleManager().hitColorMod.affectArmor.getBooleanValue() && CheatBreaker.getInstance().getModuleManager().hitColorMod.isEnabled(); + } + + private void renderLayer(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot) + { + ItemStack itemstack = this.getCurrentArmor(entitylivingbaseIn, armorSlot); + + if (itemstack != null && itemstack.getItem() instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); + T t = this.getArmorModel(armorSlot); + t.setModelAttributes(this.renderer.getMainModel()); + t.setLivingAnimations(entitylivingbaseIn, p_177182_2_, p_177182_3_, partialTicks); + + if (Reflector.ForgeHooksClient.exists()) + { + t = this.getArmorModelHook(entitylivingbaseIn, itemstack, armorSlot, t); + } + + this.setModelPartVisible(t, armorSlot); + boolean flag = this.isSlotForLeggings(armorSlot); + + if (!Config.isCustomItems() || !CustomItems.bindCustomArmorTexture(itemstack, flag ? 2 : 1, (String)null)) + { + if (Reflector.ForgeHooksClient_getArmorTexture.exists()) + { + this.renderer.bindTexture(this.getArmorResource(entitylivingbaseIn, itemstack, flag ? 2 : 1, (String)null)); + } + else + { + this.renderer.bindTexture(this.getArmorResource(itemarmor, flag)); + } + } + + if (Reflector.ForgeHooksClient_getArmorTexture.exists()) + { + if (ReflectorForge.armorHasOverlay(itemarmor, itemstack)) + { + int j = itemarmor.getColor(itemstack); + float f3 = (float)(j >> 16 & 255) / 255.0F; + float f4 = (float)(j >> 8 & 255) / 255.0F; + float f5 = (float)(j & 255) / 255.0F; + GlStateManager.color(this.colorR * f3, this.colorG * f4, this.colorB * f5, this.alpha); + t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); + + if (!Config.isCustomItems() || !CustomItems.bindCustomArmorTexture(itemstack, flag ? 2 : 1, "overlay")) + { + this.renderer.bindTexture(this.getArmorResource(entitylivingbaseIn, itemstack, flag ? 2 : 1, "overlay")); + } + } + + GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha); + t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); + + if (!this.skipRenderGlint && itemstack.hasEffect() && (!Config.isCustomItems() || !CustomItems.renderCustomArmorEffect(entitylivingbaseIn, itemstack, t, p_177182_2_, p_177182_3_, partialTicks, p_177182_5_, p_177182_6_, p_177182_7_, scale))) + { + this.renderGlint(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, partialTicks, p_177182_5_, p_177182_6_, p_177182_7_, scale); + } + + return; + } + + switch (itemarmor.getArmorMaterial()) + { + case LEATHER: + int i = itemarmor.getColor(itemstack); + float f = (float)(i >> 16 & 255) / 255.0F; + float f1 = (float)(i >> 8 & 255) / 255.0F; + float f2 = (float)(i & 255) / 255.0F; + GlStateManager.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha); + t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); + + if (!Config.isCustomItems() || !CustomItems.bindCustomArmorTexture(itemstack, flag ? 2 : 1, "overlay")) + { + this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, "overlay")); + } + + case CHAIN: + case IRON: + case GOLD: + case DIAMOND: + GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha); + t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); + } + + if (!this.skipRenderGlint && itemstack.isItemEnchanted() && (!Config.isCustomItems() || !CustomItems.renderCustomArmorEffect(entitylivingbaseIn, itemstack, t, p_177182_2_, p_177182_3_, partialTicks, p_177182_5_, p_177182_6_, p_177182_7_, scale))) + { + this.renderGlint(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, partialTicks, p_177182_5_, p_177182_6_, p_177182_7_, scale); + } + } + } + + public ItemStack getCurrentArmor(EntityLivingBase entitylivingbaseIn, int armorSlot) + { + return entitylivingbaseIn.getCurrentArmor(armorSlot - 1); + } + + public T getArmorModel(int armorSlot) + { + return (T)(this.isSlotForLeggings(armorSlot) ? this.modelLeggings : this.modelArmor); + } + + private boolean isSlotForLeggings(int armorSlot) + { + return armorSlot == 2; + } + + private void renderGlint(EntityLivingBase entitylivingbaseIn, T modelbaseIn, float p_177183_3_, float p_177183_4_, float partialTicks, float p_177183_6_, float p_177183_7_, float p_177183_8_, float scale) + { + ModuleEnchantmentGlint gm = CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod; + if ((!Config.isShaders() || !Shaders.isShadowPass) && gm.isEnabled() && gm.armorGlint.getBooleanValue()) + { + int glintColor = gm.armorGlintColor.getColorValue(); + float glintA = (float)(glintColor >> 24 & 255) / 255.0F; + float glintR = (float)(glintColor >> 16 & 255) / 255.0F; + float glintG = (float)(glintColor >> 8 & 255) / 255.0F; + float glintB = (float)(glintColor & 255) / 255.0F; + + float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; + this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES); + + if (Config.isShaders()) + { + ShadersRender.renderEnchantedGlintBegin(); + } + + GlStateManager.enableBlend(); + GlStateManager.depthFunc(514); + GlStateManager.depthMask(false); + GlStateManager.color(glintR, glintG, glintB, glintA); + + for (int i = 0; i < 2; ++i) + { + GlStateManager.disableLighting(); + GlStateManager.blendFunc(768, 1); + GlStateManager.color(glintR, glintG, glintB, glintA); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + float f3 = 0.33333334F; + GlStateManager.scale(f3, f3, f3); + GlStateManager.rotate(30.0F - (float)i * 60.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.translate(0.0F, f * (0.001F + (float)i * 0.003F) * 20.0F, 0.0F); + GlStateManager.matrixMode(5888); + modelbaseIn.render(entitylivingbaseIn, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, scale); + } + + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.enableLighting(); + GlStateManager.depthMask(true); + GlStateManager.depthFunc(515); + GlStateManager.disableBlend(); + + if (Config.isShaders()) + { + ShadersRender.renderEnchantedGlintEnd(); + } + } + } + + private ResourceLocation getArmorResource(ItemArmor p_177181_1_, boolean p_177181_2_) + { + return this.getArmorResource(p_177181_1_, p_177181_2_, (String)null); + } + + private ResourceLocation getArmorResource(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) + { + String s = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {p_177178_1_.getArmorMaterial().getName(), Integer.valueOf(p_177178_2_ ? 2 : 1), p_177178_3_ == null ? "" : String.format("_%s", new Object[]{p_177178_3_})}); + ResourceLocation resourcelocation = (ResourceLocation)ARMOR_TEXTURE_RES_MAP.get(s); + + if (resourcelocation == null) + { + resourcelocation = new ResourceLocation(s); + ARMOR_TEXTURE_RES_MAP.put(s, resourcelocation); + } + + return resourcelocation; + } + + protected abstract void initArmor(); + + protected abstract void setModelPartVisible(T model, int armorSlot); + + protected T getArmorModelHook(EntityLivingBase p_getArmorModelHook_1_, ItemStack p_getArmorModelHook_2_, int p_getArmorModelHook_3_, T p_getArmorModelHook_4_) + { + return (T)p_getArmorModelHook_4_; + } + + public ResourceLocation getArmorResource(Entity p_getArmorResource_1_, ItemStack p_getArmorResource_2_, int p_getArmorResource_3_, String p_getArmorResource_4_) + { + ItemArmor itemarmor = (ItemArmor)p_getArmorResource_2_.getItem(); + String s = itemarmor.getArmorMaterial().getName(); + String s1 = "minecraft"; + int i = s.indexOf(58); + + if (i != -1) + { + s1 = s.substring(0, i); + s = s.substring(i + 1); + } + + String s2 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", new Object[] {s1, s, Integer.valueOf(this.isSlotForLeggings(p_getArmorResource_3_) ? 2 : 1), p_getArmorResource_4_ == null ? "" : String.format("_%s", new Object[]{p_getArmorResource_4_})}); + s2 = Reflector.callString(Reflector.ForgeHooksClient_getArmorTexture, new Object[] {p_getArmorResource_1_, p_getArmorResource_2_, s2, Integer.valueOf(p_getArmorResource_3_), p_getArmorResource_4_}); + ResourceLocation resourcelocation = (ResourceLocation)ARMOR_TEXTURE_RES_MAP.get(s2); + + if (resourcelocation == null) + { + resourcelocation = new ResourceLocation(s2); + ARMOR_TEXTURE_RES_MAP.put(s2, resourcelocation); + } + + return resourcelocation; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArrow.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArrow.java new file mode 100644 index 0000000..ac19772 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerArrow.java @@ -0,0 +1,73 @@ +package net.minecraft.client.renderer.entity.layers; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.model.ModelBox; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.util.MathHelper; + +import java.util.Random; + +public class LayerArrow implements LayerRenderer +{ + private final RendererLivingEntity field_177168_a; + + public LayerArrow(RendererLivingEntity p_i46124_1_) + { + this.field_177168_a = p_i46124_1_; + } + + public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (CheatBreaker.getInstance().getGlobalSettings().hideStuckArrows.getBooleanValue()) return; + int i = entitylivingbaseIn.getArrowCountInEntity(); + + if (i > 0) + { + Entity entity = new EntityArrow(entitylivingbaseIn.worldObj, entitylivingbaseIn.posX, entitylivingbaseIn.posY, entitylivingbaseIn.posZ); + Random random = new Random((long)entitylivingbaseIn.getEntityId()); + RenderHelper.disableStandardItemLighting(); + + for (int j = 0; j < i; ++j) + { + GlStateManager.pushMatrix(); + ModelRenderer modelrenderer = this.field_177168_a.getMainModel().getRandomModelBox(random); + ModelBox modelbox = (ModelBox)modelrenderer.cubeList.get(random.nextInt(modelrenderer.cubeList.size())); + modelrenderer.postRender(0.0625F); + float f = random.nextFloat(); + float f1 = random.nextFloat(); + float f2 = random.nextFloat(); + float f3 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f) / 16.0F; + float f4 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f1) / 16.0F; + float f5 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f2) / 16.0F; + GlStateManager.translate(f3, f4, f5); + f = f * 2.0F - 1.0F; + f1 = f1 * 2.0F - 1.0F; + f2 = f2 * 2.0F - 1.0F; + f = f * -1.0F; + f1 = f1 * -1.0F; + f2 = f2 * -1.0F; + float f6 = MathHelper.sqrt_float(f * f + f2 * f2); + entity.prevRotationYaw = entity.rotationYaw = (float)(Math.atan2((double)f, (double)f2) * 180.0D / Math.PI); + entity.prevRotationPitch = entity.rotationPitch = (float)(Math.atan2((double)f1, (double)f6) * 180.0D / Math.PI); + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + this.field_177168_a.getRenderManager().renderEntityWithPosYaw(entity, d0, d1, d2, 0.0F, partialTicks); + GlStateManager.popMatrix(); + } + + RenderHelper.enableStandardItemLighting(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java new file mode 100644 index 0000000..359dcbd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java @@ -0,0 +1,52 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.entity.RendererLivingEntity; + +public class LayerBipedArmor extends LayerArmorBase +{ + public LayerBipedArmor(RendererLivingEntity rendererIn) + { + super(rendererIn); + } + + protected void initArmor() + { + this.modelLeggings = new ModelBiped(0.5F); + this.modelArmor = new ModelBiped(1.0F); + } + + protected void setModelPartVisible(ModelBiped model, int armorSlot) + { + this.setModelVisible(model); + + switch (armorSlot) + { + case 1: + model.bipedRightLeg.showModel = true; + model.bipedLeftLeg.showModel = true; + break; + + case 2: + model.bipedBody.showModel = true; + model.bipedRightLeg.showModel = true; + model.bipedLeftLeg.showModel = true; + break; + + case 3: + model.bipedBody.showModel = true; + model.bipedRightArm.showModel = true; + model.bipedLeftArm.showModel = true; + break; + + case 4: + model.bipedHead.showModel = true; + model.bipedHeadwear.showModel = true; + } + } + + protected void setModelVisible(ModelBiped model) + { + model.setInvisible(false); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java new file mode 100644 index 0000000..74c4575 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCape.java @@ -0,0 +1,74 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.util.MathHelper; + +public class LayerCape implements LayerRenderer +{ + private final RenderPlayer playerRenderer; + + public LayerCape(RenderPlayer playerRendererIn) + { + this.playerRenderer = playerRendererIn; + } + + public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.hasPlayerInfo() && !entitylivingbaseIn.isInvisible() && entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE) && entitylivingbaseIn.getLocationCape() != null) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.playerRenderer.bindTexture(entitylivingbaseIn.getLocationCape()); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 0.0F, 0.125F); + double d0 = entitylivingbaseIn.prevChasingPosX + (entitylivingbaseIn.chasingPosX - entitylivingbaseIn.prevChasingPosX) * (double)partialTicks - (entitylivingbaseIn.prevPosX + (entitylivingbaseIn.posX - entitylivingbaseIn.prevPosX) * (double)partialTicks); + double d1 = entitylivingbaseIn.prevChasingPosY + (entitylivingbaseIn.chasingPosY - entitylivingbaseIn.prevChasingPosY) * (double)partialTicks - (entitylivingbaseIn.prevPosY + (entitylivingbaseIn.posY - entitylivingbaseIn.prevPosY) * (double)partialTicks); + double d2 = entitylivingbaseIn.prevChasingPosZ + (entitylivingbaseIn.chasingPosZ - entitylivingbaseIn.prevChasingPosZ) * (double)partialTicks - (entitylivingbaseIn.prevPosZ + (entitylivingbaseIn.posZ - entitylivingbaseIn.prevPosZ) * (double)partialTicks); + float f = entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks; + double d3 = (double)MathHelper.sin(f * (float)Math.PI / 180.0F); + double d4 = (double)(-MathHelper.cos(f * (float)Math.PI / 180.0F)); + float f1 = (float)d1 * 10.0F; + f1 = MathHelper.clamp_float(f1, -6.0F, 32.0F); + float f2 = (float)(d0 * d3 + d2 * d4) * 100.0F; + float f3 = (float)(d0 * d4 - d2 * d3) * 100.0F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 165.0F) + { + f2 = 165.0F; + } + + if (f1 < -5.0F) + { + f1 = -5.0F; + } + + float f4 = entitylivingbaseIn.prevCameraYaw + (entitylivingbaseIn.cameraYaw - entitylivingbaseIn.prevCameraYaw) * partialTicks; + f1 = f1 + MathHelper.sin((entitylivingbaseIn.prevDistanceWalkedModified + (entitylivingbaseIn.distanceWalkedModified - entitylivingbaseIn.prevDistanceWalkedModified) * partialTicks) * 6.0F) * 32.0F * f4; + + if (entitylivingbaseIn.isSneaking()) + { + f1 += 25.0F; + GlStateManager.translate(0.0F, 0.142F, -0.0178F); + } + + GlStateManager.rotate(6.0F + f2 / 2.0F + f1, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(f3 / 2.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(-f3 / 2.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + this.playerRenderer.getMainModel().renderCape(0.0625F); + GlStateManager.popMatrix(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.java new file mode 100644 index 0000000..5bc54cb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCreeperCharge.java @@ -0,0 +1,52 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.model.ModelCreeper; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderCreeper; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.util.ResourceLocation; + +public class LayerCreeperCharge implements LayerRenderer +{ + private static final ResourceLocation LIGHTNING_TEXTURE = new ResourceLocation("textures/entity/creeper/creeper_armor.png"); + private final RenderCreeper creeperRenderer; + private final ModelCreeper creeperModel = new ModelCreeper(2.0F); + + public LayerCreeperCharge(RenderCreeper creeperRendererIn) + { + this.creeperRenderer = creeperRendererIn; + } + + public void doRenderLayer(EntityCreeper entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.getPowered()) + { + boolean flag = entitylivingbaseIn.isInvisible(); + GlStateManager.depthMask(!flag); + this.creeperRenderer.bindTexture(LIGHTNING_TEXTURE); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; + GlStateManager.translate(f * 0.01F, f * 0.01F, 0.0F); + GlStateManager.matrixMode(5888); + GlStateManager.enableBlend(); + float f1 = 0.5F; + GlStateManager.color(f1, f1, f1, 1.0F); + GlStateManager.disableLighting(); + GlStateManager.blendFunc(1, 1); + this.creeperModel.setModelAttributes(this.creeperRenderer.getMainModel()); + this.creeperModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.depthMask(flag); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCustomHead.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCustomHead.java new file mode 100644 index 0000000..b79fb89 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerCustomHead.java @@ -0,0 +1,117 @@ +package net.minecraft.client.renderer.entity.layers; + +import com.mojang.authlib.GameProfile; +import java.util.UUID; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.StringUtils; + +public class LayerCustomHead implements LayerRenderer +{ + private final ModelRenderer field_177209_a; + + public LayerCustomHead(ModelRenderer p_i46120_1_) + { + this.field_177209_a = p_i46120_1_; + } + + public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + ItemStack itemstack = entitylivingbaseIn.getCurrentArmor(3); + + if (itemstack != null && itemstack.getItem() != null) + { + Item item = itemstack.getItem(); + Minecraft minecraft = Minecraft.getMinecraft(); + GlStateManager.pushMatrix(); + + if (entitylivingbaseIn.isSneaking()) + { + GlStateManager.translate(0.0F, 0.2F, 0.0F); + } + + boolean flag = entitylivingbaseIn instanceof EntityVillager || entitylivingbaseIn instanceof EntityZombie && ((EntityZombie)entitylivingbaseIn).isVillager(); + + if (!flag && entitylivingbaseIn.isChild()) + { + float f = 2.0F; + float f1 = 1.4F; + GlStateManager.scale(f1 / f, f1 / f, f1 / f); + GlStateManager.translate(0.0F, 16.0F * scale, 0.0F); + } + + this.field_177209_a.postRender(0.0625F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (item instanceof ItemBlock) + { + float f2 = 0.625F; + GlStateManager.translate(0.0F, -0.25F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.scale(f2, -f2, -f2); + + if (flag) + { + GlStateManager.translate(0.0F, 0.1875F, 0.0F); + } + + minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.HEAD); + } + else if (item == Items.skull) + { + float f3 = 1.1875F; + GlStateManager.scale(f3, -f3, -f3); + + if (flag) + { + GlStateManager.translate(0.0F, 0.0625F, 0.0F); + } + + GameProfile gameprofile = null; + + if (itemstack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8)) + { + String s = nbttagcompound.getString("SkullOwner"); + + if (!StringUtils.isNullOrEmpty(s)) + { + gameprofile = TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, s)); + nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); + } + } + } + + TileEntitySkullRenderer.instance.renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, itemstack.getMetadata(), gameprofile, -1); + } + + GlStateManager.popMatrix(); + } + } + + public boolean shouldCombineTextures() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerDeadmau5Head.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerDeadmau5Head.java new file mode 100644 index 0000000..aa2ca6e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerDeadmau5Head.java @@ -0,0 +1,45 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderPlayer; + +public class LayerDeadmau5Head implements LayerRenderer +{ + private final RenderPlayer playerRenderer; + + public LayerDeadmau5Head(RenderPlayer playerRendererIn) + { + this.playerRenderer = playerRendererIn; + } + + public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.getName().equals("deadmau5") && entitylivingbaseIn.hasSkin() && !entitylivingbaseIn.isInvisible()) + { + this.playerRenderer.bindTexture(entitylivingbaseIn.getLocationSkin()); + + for (int i = 0; i < 2; ++i) + { + float f = entitylivingbaseIn.prevRotationYaw + (entitylivingbaseIn.rotationYaw - entitylivingbaseIn.prevRotationYaw) * partialTicks - (entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks); + float f1 = entitylivingbaseIn.prevRotationPitch + (entitylivingbaseIn.rotationPitch - entitylivingbaseIn.prevRotationPitch) * partialTicks; + GlStateManager.pushMatrix(); + GlStateManager.rotate(f, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(f1, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0.375F * (float)(i * 2 - 1), 0.0F, 0.0F); + GlStateManager.translate(0.0F, -0.375F, 0.0F); + GlStateManager.rotate(-f1, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F); + float f2 = 1.3333334F; + GlStateManager.scale(f2, f2, f2); + this.playerRenderer.getMainModel().renderDeadmau5Head(0.0625F); + GlStateManager.popMatrix(); + } + } + } + + public boolean shouldCombineTextures() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonDeath.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonDeath.java new file mode 100644 index 0000000..5586883 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonDeath.java @@ -0,0 +1,74 @@ +package net.minecraft.client.renderer.entity.layers; + +import java.util.Random; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.boss.EntityDragon; + +public class LayerEnderDragonDeath implements LayerRenderer +{ + public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.deathTicks > 0) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + RenderHelper.disableStandardItemLighting(); + float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F; + float f1 = 0.0F; + + if (f > 0.8F) + { + f1 = (f - 0.8F) / 0.2F; + } + + Random random = new Random(432L); + GlStateManager.disableTexture2D(); + GlStateManager.shadeModel(7425); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 1); + GlStateManager.disableAlpha(); + GlStateManager.enableCull(); + GlStateManager.depthMask(false); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, -1.0F, -2.0F); + + for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i) + { + GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F); + float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F; + float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F; + worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex(); + worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); + worldrenderer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); + worldrenderer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex(); + worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex(); + tessellator.draw(); + } + + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + GlStateManager.disableCull(); + GlStateManager.disableBlend(); + GlStateManager.shadeModel(7424); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + GlStateManager.enableAlpha(); + RenderHelper.enableStandardItemLighting(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonEyes.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonEyes.java new file mode 100644 index 0000000..81bc290 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEnderDragonEyes.java @@ -0,0 +1,60 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderDragon; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.shaders.Shaders; + +public class LayerEnderDragonEyes implements LayerRenderer +{ + private static final ResourceLocation TEXTURE = new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png"); + private final RenderDragon dragonRenderer; + + public LayerEnderDragonEyes(RenderDragon dragonRendererIn) + { + this.dragonRenderer = dragonRendererIn; + } + + public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + this.dragonRenderer.bindTexture(TEXTURE); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.blendFunc(1, 1); + GlStateManager.disableLighting(); + GlStateManager.depthFunc(514); + int i = 61680; + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.enableLighting(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (Config.isShaders()) + { + Shaders.beginSpiderEyes(); + } + + Config.getRenderGlobal().renderOverlayEyes = true; + this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + Config.getRenderGlobal().renderOverlayEyes = false; + + if (Config.isShaders()) + { + Shaders.endSpiderEyes(); + } + + this.dragonRenderer.setLightmap(entitylivingbaseIn, partialTicks); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.depthFunc(515); + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEndermanEyes.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEndermanEyes.java new file mode 100644 index 0000000..8a484b4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerEndermanEyes.java @@ -0,0 +1,60 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderEnderman; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.shaders.Shaders; + +public class LayerEndermanEyes implements LayerRenderer +{ + private static final ResourceLocation RES_ENDERMAN_EYES = new ResourceLocation("textures/entity/enderman/enderman_eyes.png"); + private final RenderEnderman endermanRenderer; + + public LayerEndermanEyes(RenderEnderman endermanRendererIn) + { + this.endermanRenderer = endermanRendererIn; + } + + public void doRenderLayer(EntityEnderman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.blendFunc(1, 1); + GlStateManager.disableLighting(); + GlStateManager.depthMask(!entitylivingbaseIn.isInvisible()); + int i = 61680; + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.enableLighting(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (Config.isShaders()) + { + Shaders.beginSpiderEyes(); + } + + Config.getRenderGlobal().renderOverlayEyes = true; + this.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + Config.getRenderGlobal().renderOverlayEyes = false; + + if (Config.isShaders()) + { + Shaders.endSpiderEyes(); + } + + this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks); + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldBlock.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldBlock.java new file mode 100644 index 0000000..c117b9d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldBlock.java @@ -0,0 +1,53 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderEnderman; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.monster.EntityEnderman; + +public class LayerHeldBlock implements LayerRenderer +{ + private final RenderEnderman endermanRenderer; + + public LayerHeldBlock(RenderEnderman endermanRendererIn) + { + this.endermanRenderer = endermanRendererIn; + } + + public void doRenderLayer(EntityEnderman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState(); + + if (iblockstate.getBlock().getMaterial() != Material.air) + { + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + GlStateManager.enableRescaleNormal(); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.0F, 0.6875F, -0.75F); + GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.25F, 0.1875F, 0.25F); + float f = 0.5F; + GlStateManager.scale(-f, -f, f); + int i = entitylivingbaseIn.getBrightnessForRender(partialTicks); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture); + blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F); + GlStateManager.popMatrix(); + GlStateManager.disableRescaleNormal(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java new file mode 100644 index 0000000..e01fad6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItem.java @@ -0,0 +1,75 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class LayerHeldItem implements LayerRenderer +{ + private final RendererLivingEntity livingEntityRenderer; + + public LayerHeldItem(RendererLivingEntity livingEntityRendererIn) + { + this.livingEntityRenderer = livingEntityRendererIn; + } + + public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + ItemStack itemstack = entitylivingbaseIn.getHeldItem(); + + if (itemstack != null) + { + GlStateManager.pushMatrix(); + + if (this.livingEntityRenderer.getMainModel().isChild) + { + float f = 0.5F; + GlStateManager.translate(0.0F, 0.625F, 0.0F); + GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F); + GlStateManager.scale(f, f, f); + } + + ((ModelBiped)this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F); + GlStateManager.translate(-0.0625F, 0.4375F, 0.0625F); + + if (entitylivingbaseIn instanceof EntityPlayer && ((EntityPlayer)entitylivingbaseIn).fishEntity != null) + { + itemstack = new ItemStack(Items.fishing_rod, 0); + } + + Item item = itemstack.getItem(); + Minecraft minecraft = Minecraft.getMinecraft(); + + if (item instanceof ItemBlock && Block.getBlockFromItem(item).getRenderType() == 2) + { + GlStateManager.translate(0.0F, 0.1875F, -0.3125F); + GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F); + float f1 = 0.375F; + GlStateManager.scale(-f1, -f1, f1); + } + + if (entitylivingbaseIn.isSneaking()) + { + GlStateManager.translate(0.0F, 0.203125F, 0.0F); + } + + minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON); + GlStateManager.popMatrix(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java new file mode 100644 index 0000000..6ec8606 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java @@ -0,0 +1,99 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelWitch; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.RenderWitch; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class LayerHeldItemWitch implements LayerRenderer +{ + private final RenderWitch witchRenderer; + + public LayerHeldItemWitch(RenderWitch witchRendererIn) + { + this.witchRenderer = witchRendererIn; + } + + public void doRenderLayer(EntityWitch entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + ItemStack itemstack = entitylivingbaseIn.getHeldItem(); + + if (itemstack != null) + { + GlStateManager.color(1.0F, 1.0F, 1.0F); + GlStateManager.pushMatrix(); + + if (this.witchRenderer.getMainModel().isChild) + { + GlStateManager.translate(0.0F, 0.625F, 0.0F); + GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F); + float f = 0.5F; + GlStateManager.scale(f, f, f); + } + + ((ModelWitch)this.witchRenderer.getMainModel()).villagerNose.postRender(0.0625F); + GlStateManager.translate(-0.0625F, 0.53125F, 0.21875F); + Item item = itemstack.getItem(); + Minecraft minecraft = Minecraft.getMinecraft(); + + if (item instanceof ItemBlock && minecraft.getBlockRendererDispatcher().isRenderTypeChest(Block.getBlockFromItem(item), itemstack.getMetadata())) + { + GlStateManager.translate(0.0F, 0.0625F, -0.25F); + GlStateManager.rotate(30.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-5.0F, 0.0F, 1.0F, 0.0F); + float f4 = 0.375F; + GlStateManager.scale(f4, -f4, f4); + } + else if (item == Items.bow) + { + GlStateManager.translate(0.0F, 0.125F, -0.125F); + GlStateManager.rotate(-45.0F, 0.0F, 1.0F, 0.0F); + float f1 = 0.625F; + GlStateManager.scale(f1, -f1, f1); + GlStateManager.rotate(-100.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-20.0F, 0.0F, 1.0F, 0.0F); + } + else if (item.isFull3D()) + { + if (item.shouldRotateAroundWhenRendering()) + { + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.translate(0.0F, -0.0625F, 0.0F); + } + + this.witchRenderer.transformHeldFull3DItemLayer(); + GlStateManager.translate(0.0625F, -0.125F, 0.0F); + float f2 = 0.625F; + GlStateManager.scale(f2, -f2, f2); + GlStateManager.rotate(0.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(0.0F, 0.0F, 1.0F, 0.0F); + } + else + { + GlStateManager.translate(0.1875F, 0.1875F, 0.0F); + float f3 = 0.875F; + GlStateManager.scale(f3, f3, f3); + GlStateManager.rotate(-20.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.rotate(-60.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-30.0F, 0.0F, 0.0F, 1.0F); + } + + GlStateManager.rotate(-15.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(40.0F, 0.0F, 0.0F, 1.0F); + minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON); + GlStateManager.popMatrix(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java new file mode 100644 index 0000000..34034f0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerIronGolemFlower.java @@ -0,0 +1,50 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelIronGolem; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderIronGolem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.init.Blocks; + +public class LayerIronGolemFlower implements LayerRenderer +{ + private final RenderIronGolem ironGolemRenderer; + + public LayerIronGolemFlower(RenderIronGolem ironGolemRendererIn) + { + this.ironGolemRenderer = ironGolemRendererIn; + } + + public void doRenderLayer(EntityIronGolem entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.getHoldRoseTick() != 0) + { + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + GlStateManager.enableRescaleNormal(); + GlStateManager.pushMatrix(); + GlStateManager.rotate(5.0F + 180.0F * ((ModelIronGolem)this.ironGolemRenderer.getMainModel()).ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(-0.9375F, -0.625F, -0.9375F); + float f = 0.5F; + GlStateManager.scale(f, -f, f); + int i = entitylivingbaseIn.getBrightnessForRender(partialTicks); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.ironGolemRenderer.bindTexture(TextureMap.locationBlocksTexture); + blockrendererdispatcher.renderBlockBrightness(Blocks.red_flower.getDefaultState(), 1.0F); + GlStateManager.popMatrix(); + GlStateManager.disableRescaleNormal(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerMooshroomMushroom.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerMooshroomMushroom.java new file mode 100644 index 0000000..7810e3f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerMooshroomMushroom.java @@ -0,0 +1,118 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelQuadruped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderMooshroom; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class LayerMooshroomMushroom implements LayerRenderer +{ + private final RenderMooshroom mooshroomRenderer; + private ModelRenderer modelRendererMushroom; + private static final ResourceLocation LOCATION_MUSHROOM_RED = new ResourceLocation("textures/entity/cow/mushroom_red.png"); + private static boolean hasTextureMushroom = false; + + public static void update() + { + hasTextureMushroom = Config.hasResource(LOCATION_MUSHROOM_RED); + } + + public LayerMooshroomMushroom(RenderMooshroom mooshroomRendererIn) + { + this.mooshroomRenderer = mooshroomRendererIn; + this.modelRendererMushroom = new ModelRenderer(this.mooshroomRenderer.mainModel); + this.modelRendererMushroom.setTextureSize(16, 16); + this.modelRendererMushroom.rotationPointX = -6.0F; + this.modelRendererMushroom.rotationPointZ = -8.0F; + this.modelRendererMushroom.rotateAngleY = MathHelper.PI / 4.0F; + int[][] aint = new int[][] {null, null, {16, 16, 0, 0}, {16, 16, 0, 0}, null, null}; + this.modelRendererMushroom.addBox(aint, 0.0F, 0.0F, 10.0F, 20.0F, 16.0F, 0.0F, 0.0F); + int[][] aint1 = new int[][] {null, null, null, null, {16, 16, 0, 0}, {16, 16, 0, 0}}; + this.modelRendererMushroom.addBox(aint1, 10.0F, 0.0F, 0.0F, 0.0F, 16.0F, 20.0F, 0.0F); + } + + public void doRenderLayer(EntityMooshroom entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (!entitylivingbaseIn.isChild() && !entitylivingbaseIn.isInvisible()) + { + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + + if (hasTextureMushroom) + { + this.mooshroomRenderer.bindTexture(LOCATION_MUSHROOM_RED); + } + else + { + this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture); + } + + GlStateManager.enableCull(); + GlStateManager.cullFace(1028); + GlStateManager.pushMatrix(); + GlStateManager.scale(1.0F, -1.0F, 1.0F); + GlStateManager.translate(0.2F, 0.35F, 0.5F); + GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.pushMatrix(); + GlStateManager.translate(-0.5F, -0.5F, 0.5F); + + if (hasTextureMushroom) + { + this.modelRendererMushroom.render(0.0625F); + } + else + { + blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F); + } + + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.translate(0.1F, 0.0F, -0.6F); + GlStateManager.rotate(42.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(-0.5F, -0.5F, 0.5F); + + if (hasTextureMushroom) + { + this.modelRendererMushroom.render(0.0625F); + } + else + { + blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F); + } + + GlStateManager.popMatrix(); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + ((ModelQuadruped)this.mooshroomRenderer.getMainModel()).head.postRender(0.0625F); + GlStateManager.scale(1.0F, -1.0F, 1.0F); + GlStateManager.translate(0.0F, 0.7F, -0.2F); + GlStateManager.rotate(12.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(-0.5F, -0.5F, 0.5F); + + if (hasTextureMushroom) + { + this.modelRendererMushroom.render(0.0625F); + } + else + { + blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F); + } + + GlStateManager.popMatrix(); + GlStateManager.cullFace(1029); + GlStateManager.disableCull(); + } + } + + public boolean shouldCombineTextures() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerRenderer.java new file mode 100644 index 0000000..bad5116 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerRenderer.java @@ -0,0 +1,10 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.entity.EntityLivingBase; + +public interface LayerRenderer +{ + void doRenderLayer(E entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale); + + boolean shouldCombineTextures(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSaddle.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSaddle.java new file mode 100644 index 0000000..b913eda --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSaddle.java @@ -0,0 +1,33 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.model.ModelPig; +import net.minecraft.client.renderer.entity.RenderPig; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.util.ResourceLocation; + +public class LayerSaddle implements LayerRenderer +{ + private static final ResourceLocation TEXTURE = new ResourceLocation("textures/entity/pig/pig_saddle.png"); + private final RenderPig pigRenderer; + private final ModelPig pigModel = new ModelPig(0.5F); + + public LayerSaddle(RenderPig pigRendererIn) + { + this.pigRenderer = pigRendererIn; + } + + public void doRenderLayer(EntityPig entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.getSaddled()) + { + this.pigRenderer.bindTexture(TEXTURE); + this.pigModel.setModelAttributes(this.pigRenderer.getMainModel()); + this.pigModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSheepWool.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSheepWool.java new file mode 100644 index 0000000..c4a3327 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSheepWool.java @@ -0,0 +1,70 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.model.ModelSheep1; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderSheep; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomColors; + +public class LayerSheepWool implements LayerRenderer +{ + private static final ResourceLocation TEXTURE = new ResourceLocation("textures/entity/sheep/sheep_fur.png"); + private final RenderSheep sheepRenderer; + public ModelSheep1 sheepModel = new ModelSheep1(); + + public LayerSheepWool(RenderSheep sheepRendererIn) + { + this.sheepRenderer = sheepRendererIn; + } + + public void doRenderLayer(EntitySheep entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (!entitylivingbaseIn.getSheared() && !entitylivingbaseIn.isInvisible()) + { + this.sheepRenderer.bindTexture(TEXTURE); + + if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag())) + { + int i1 = 25; + int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId(); + int j = EnumDyeColor.values().length; + int k = i % j; + int l = (i + 1) % j; + float f = ((float)(entitylivingbaseIn.ticksExisted % 25) + partialTicks) / 25.0F; + float[] afloat1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(k)); + float[] afloat2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(l)); + + if (Config.isCustomColors()) + { + afloat1 = CustomColors.getSheepColors(EnumDyeColor.byMetadata(k), afloat1); + afloat2 = CustomColors.getSheepColors(EnumDyeColor.byMetadata(l), afloat2); + } + + GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f); + } + else + { + float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getFleeceColor()); + + if (Config.isCustomColors()) + { + afloat = CustomColors.getSheepColors(entitylivingbaseIn.getFleeceColor(), afloat); + } + + GlStateManager.color(afloat[0], afloat[1], afloat[2]); + } + + this.sheepModel.setModelAttributes(this.sheepRenderer.getMainModel()); + this.sheepModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks); + this.sheepModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + } + } + + public boolean shouldCombineTextures() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.java new file mode 100644 index 0000000..c9c8ebc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSlimeGel.java @@ -0,0 +1,38 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelSlime; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderSlime; +import net.minecraft.entity.monster.EntitySlime; + +public class LayerSlimeGel implements LayerRenderer +{ + private final RenderSlime slimeRenderer; + private final ModelBase slimeModel = new ModelSlime(0); + + public LayerSlimeGel(RenderSlime slimeRendererIn) + { + this.slimeRenderer = slimeRendererIn; + } + + public void doRenderLayer(EntitySlime entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (!entitylivingbaseIn.isInvisible()) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableNormalize(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + this.slimeModel.setModelAttributes(this.slimeRenderer.getMainModel()); + this.slimeModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + GlStateManager.disableBlend(); + GlStateManager.disableNormalize(); + } + } + + public boolean shouldCombineTextures() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSnowmanHead.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSnowmanHead.java new file mode 100644 index 0000000..7a81150 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSnowmanHead.java @@ -0,0 +1,39 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.RenderSnowMan; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class LayerSnowmanHead implements LayerRenderer +{ + private final RenderSnowMan snowManRenderer; + + public LayerSnowmanHead(RenderSnowMan snowManRendererIn) + { + this.snowManRenderer = snowManRendererIn; + } + + public void doRenderLayer(EntitySnowman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (!entitylivingbaseIn.isInvisible()) + { + GlStateManager.pushMatrix(); + this.snowManRenderer.getMainModel().head.postRender(0.0625F); + float f = 0.625F; + GlStateManager.translate(0.0F, -0.34375F, 0.0F); + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.scale(f, -f, -f); + Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.pumpkin, 1), ItemCameraTransforms.TransformType.HEAD); + GlStateManager.popMatrix(); + } + } + + public boolean shouldCombineTextures() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSpiderEyes.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSpiderEyes.java new file mode 100644 index 0000000..956a1a3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerSpiderEyes.java @@ -0,0 +1,70 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderSpider; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.shaders.Shaders; + +public class LayerSpiderEyes implements LayerRenderer +{ + private static final ResourceLocation SPIDER_EYES = new ResourceLocation("textures/entity/spider_eyes.png"); + private final RenderSpider spiderRenderer; + + public LayerSpiderEyes(RenderSpider spiderRendererIn) + { + this.spiderRenderer = spiderRendererIn; + } + + public void doRenderLayer(EntitySpider entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + this.spiderRenderer.bindTexture(SPIDER_EYES); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.blendFunc(1, 1); + + if (entitylivingbaseIn.isInvisible()) + { + GlStateManager.depthMask(false); + } + else + { + GlStateManager.depthMask(true); + } + + int i = 61680; + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (Config.isShaders()) + { + Shaders.beginSpiderEyes(); + } + + Config.getRenderGlobal().renderOverlayEyes = true; + this.spiderRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + Config.getRenderGlobal().renderOverlayEyes = false; + + if (Config.isShaders()) + { + Shaders.endSpiderEyes(); + } + + i = entitylivingbaseIn.getBrightnessForRender(partialTicks); + j = i % 65536; + k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + this.spiderRenderer.setLightmap(entitylivingbaseIn, partialTicks); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerVillagerArmor.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerVillagerArmor.java new file mode 100644 index 0000000..f67f662 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerVillagerArmor.java @@ -0,0 +1,18 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.model.ModelZombieVillager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; + +public class LayerVillagerArmor extends LayerBipedArmor +{ + public LayerVillagerArmor(RendererLivingEntity rendererIn) + { + super(rendererIn); + } + + protected void initArmor() + { + this.modelLeggings = new ModelZombieVillager(0.5F, 0.0F, true); + this.modelArmor = new ModelZombieVillager(1.0F, 0.0F, true); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWitherAura.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWitherAura.java new file mode 100644 index 0000000..7a61f3f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWitherAura.java @@ -0,0 +1,54 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.model.ModelWither; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderWither; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class LayerWitherAura implements LayerRenderer +{ + private static final ResourceLocation WITHER_ARMOR = new ResourceLocation("textures/entity/wither/wither_armor.png"); + private final RenderWither witherRenderer; + private final ModelWither witherModel = new ModelWither(0.5F); + + public LayerWitherAura(RenderWither witherRendererIn) + { + this.witherRenderer = witherRendererIn; + } + + public void doRenderLayer(EntityWither entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.isArmored()) + { + GlStateManager.depthMask(!entitylivingbaseIn.isInvisible()); + this.witherRenderer.bindTexture(WITHER_ARMOR); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + float f = (float)entitylivingbaseIn.ticksExisted + partialTicks; + float f1 = MathHelper.cos(f * 0.02F) * 3.0F; + float f2 = f * 0.01F; + GlStateManager.translate(f1, f2, 0.0F); + GlStateManager.matrixMode(5888); + GlStateManager.enableBlend(); + float f3 = 0.5F; + GlStateManager.color(f3, f3, f3, 1.0F); + GlStateManager.disableLighting(); + GlStateManager.blendFunc(1, 1); + this.witherModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks); + this.witherModel.setModelAttributes(this.witherRenderer.getMainModel()); + this.witherModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + } + } + + public boolean shouldCombineTextures() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWolfCollar.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWolfCollar.java new file mode 100644 index 0000000..68eac94 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/entity/layers/LayerWolfCollar.java @@ -0,0 +1,44 @@ +package net.minecraft.client.renderer.entity.layers; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderWolf; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomColors; + +public class LayerWolfCollar implements LayerRenderer +{ + private static final ResourceLocation WOLF_COLLAR = new ResourceLocation("textures/entity/wolf/wolf_collar.png"); + private final RenderWolf wolfRenderer; + + public LayerWolfCollar(RenderWolf wolfRendererIn) + { + this.wolfRenderer = wolfRendererIn; + } + + public void doRenderLayer(EntityWolf entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) + { + if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible()) + { + this.wolfRenderer.bindTexture(WOLF_COLLAR); + EnumDyeColor enumdyecolor = EnumDyeColor.byMetadata(entitylivingbaseIn.getCollarColor().getMetadata()); + float[] afloat = EntitySheep.getDyeRgb(enumdyecolor); + + if (Config.isCustomColors()) + { + afloat = CustomColors.getWolfCollarColors(enumdyecolor, afloat); + } + + GlStateManager.color(afloat[0], afloat[1], afloat[2]); + this.wolfRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale); + } + } + + public boolean shouldCombineTextures() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/AbstractTexture.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/AbstractTexture.java new file mode 100644 index 0000000..dff6e71 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/AbstractTexture.java @@ -0,0 +1,77 @@ +package net.minecraft.client.renderer.texture; + +import net.minecraft.client.renderer.GlStateManager; +import net.optifine.shaders.MultiTexID; +import net.optifine.shaders.ShadersTex; +import org.lwjgl.opengl.GL11; + +public abstract class AbstractTexture implements ITextureObject +{ + protected int glTextureId = -1; + protected boolean blur; + protected boolean mipmap; + protected boolean blurLast; + protected boolean mipmapLast; + public MultiTexID multiTex; + + public void setBlurMipmapDirect(boolean p_174937_1_, boolean p_174937_2_) + { + this.blur = p_174937_1_; + this.mipmap = p_174937_2_; + int i = -1; + int j = -1; + + if (p_174937_1_) + { + i = p_174937_2_ ? 9987 : 9729; + j = 9729; + } + else + { + i = p_174937_2_ ? 9986 : 9728; + j = 9728; + } + + GlStateManager.bindTexture(this.getGlTextureId()); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j); + } + + public void setBlurMipmap(boolean p_174936_1_, boolean p_174936_2_) + { + this.blurLast = this.blur; + this.mipmapLast = this.mipmap; + this.setBlurMipmapDirect(p_174936_1_, p_174936_2_); + } + + public void restoreLastBlurMipmap() + { + this.setBlurMipmapDirect(this.blurLast, this.mipmapLast); + } + + public int getGlTextureId() + { + if (this.glTextureId == -1) + { + this.glTextureId = TextureUtil.glGenTextures(); + } + + return this.glTextureId; + } + + public void deleteGlTexture() + { + ShadersTex.deleteTextures(this, this.glTextureId); + + if (this.glTextureId != -1) + { + TextureUtil.deleteTexture(this.glTextureId); + this.glTextureId = -1; + } + } + + public MultiTexID getMultiTexID() + { + return ShadersTex.getMultiTexID(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/DynamicTexture.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/DynamicTexture.java new file mode 100644 index 0000000..855d02f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/DynamicTexture.java @@ -0,0 +1,41 @@ +package net.minecraft.client.renderer.texture; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import net.minecraft.client.resources.IResourceManager; + +public class DynamicTexture extends AbstractTexture +{ + private final int[] dynamicTextureData; + private final int width; + private final int height; + + public DynamicTexture(BufferedImage bufferedImage) + { + this(bufferedImage.getWidth(), bufferedImage.getHeight()); + bufferedImage.getRGB(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), this.dynamicTextureData, 0, bufferedImage.getWidth()); + this.updateDynamicTexture(); + } + + public DynamicTexture(int textureWidth, int textureHeight) + { + this.width = textureWidth; + this.height = textureHeight; + this.dynamicTextureData = new int[textureWidth * textureHeight]; + TextureUtil.allocateTexture(this.getGlTextureId(), textureWidth, textureHeight); + } + + public void loadTexture(IResourceManager resourceManager) throws IOException + { + } + + public void updateDynamicTexture() + { + TextureUtil.uploadTexture(this.getGlTextureId(), this.dynamicTextureData, this.width, this.height); + } + + public int[] getTextureData() + { + return this.dynamicTextureData; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/IIconCreator.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/IIconCreator.java new file mode 100644 index 0000000..54da0f8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/IIconCreator.java @@ -0,0 +1,6 @@ +package net.minecraft.client.renderer.texture; + +public interface IIconCreator +{ + void registerSprites(TextureMap iconRegistry); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITextureObject.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITextureObject.java new file mode 100644 index 0000000..b2c4906 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITextureObject.java @@ -0,0 +1,18 @@ +package net.minecraft.client.renderer.texture; + +import java.io.IOException; +import net.minecraft.client.resources.IResourceManager; +import net.optifine.shaders.MultiTexID; + +public interface ITextureObject +{ + void setBlurMipmap(boolean p_174936_1_, boolean p_174936_2_); + + void restoreLastBlurMipmap(); + + void loadTexture(IResourceManager resourceManager) throws IOException; + + int getGlTextureId(); + + MultiTexID getMultiTexID(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITickable.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITickable.java new file mode 100644 index 0000000..cd2ddc8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITickable.java @@ -0,0 +1,6 @@ +package net.minecraft.client.renderer.texture; + +public interface ITickable +{ + void tick(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITickableTextureObject.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITickableTextureObject.java new file mode 100644 index 0000000..6332ecb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/ITickableTextureObject.java @@ -0,0 +1,5 @@ +package net.minecraft.client.renderer.texture; + +public interface ITickableTextureObject extends ITextureObject, ITickable +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java new file mode 100644 index 0000000..e8d8287 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/LayeredColorMaskTexture.java @@ -0,0 +1,100 @@ +package net.minecraft.client.renderer.texture; + +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.optifine.shaders.ShadersTex; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class LayeredColorMaskTexture extends AbstractTexture +{ + private static final Logger LOG = LogManager.getLogger(); + private final ResourceLocation textureLocation; + private final List field_174949_h; + private final List field_174950_i; + + public LayeredColorMaskTexture(ResourceLocation textureLocationIn, List p_i46101_2_, List p_i46101_3_) + { + this.textureLocation = textureLocationIn; + this.field_174949_h = p_i46101_2_; + this.field_174950_i = p_i46101_3_; + } + + public void loadTexture(IResourceManager resourceManager) throws IOException + { + this.deleteGlTexture(); + BufferedImage bufferedimage; + + try + { + BufferedImage bufferedimage1 = TextureUtil.readBufferedImage(resourceManager.getResource(this.textureLocation).getInputStream()); + int i = bufferedimage1.getType(); + + if (i == 0) + { + i = 6; + } + + bufferedimage = new BufferedImage(bufferedimage1.getWidth(), bufferedimage1.getHeight(), i); + Graphics graphics = bufferedimage.getGraphics(); + graphics.drawImage(bufferedimage1, 0, 0, (ImageObserver)null); + + for (int j = 0; j < 17 && j < this.field_174949_h.size() && j < this.field_174950_i.size(); ++j) + { + String s = (String)this.field_174949_h.get(j); + MapColor mapcolor = ((EnumDyeColor)this.field_174950_i.get(j)).getMapColor(); + + if (s != null) + { + InputStream inputstream = resourceManager.getResource(new ResourceLocation(s)).getInputStream(); + BufferedImage bufferedimage2 = TextureUtil.readBufferedImage(inputstream); + + if (bufferedimage2.getWidth() == bufferedimage.getWidth() && bufferedimage2.getHeight() == bufferedimage.getHeight() && bufferedimage2.getType() == 6) + { + for (int k = 0; k < bufferedimage2.getHeight(); ++k) + { + for (int l = 0; l < bufferedimage2.getWidth(); ++l) + { + int i1 = bufferedimage2.getRGB(l, k); + + if ((i1 & -16777216) != 0) + { + int j1 = (i1 & 16711680) << 8 & -16777216; + int k1 = bufferedimage1.getRGB(l, k); + int l1 = MathHelper.func_180188_d(k1, mapcolor.colorValue) & 16777215; + bufferedimage2.setRGB(l, k, j1 | l1); + } + } + } + + bufferedimage.getGraphics().drawImage(bufferedimage2, 0, 0, (ImageObserver)null); + } + } + } + } + catch (IOException ioexception) + { + LOG.error((String)"Couldn\'t load layered image", (Throwable)ioexception); + return; + } + + if (Config.isShaders()) + { + ShadersTex.loadSimpleTexture(this.getGlTextureId(), bufferedimage, false, false, resourceManager, this.textureLocation, this.getMultiTexID()); + } + else + { + TextureUtil.uploadTextureImage(this.getGlTextureId(), bufferedimage); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/LayeredTexture.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/LayeredTexture.java new file mode 100644 index 0000000..4fa0f10 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/LayeredTexture.java @@ -0,0 +1,70 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.shaders.ShadersTex; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class LayeredTexture extends AbstractTexture +{ + private static final Logger logger = LogManager.getLogger(); + public final List layeredTextureNames; + private ResourceLocation textureLocation; + + public LayeredTexture(String... textureNames) + { + this.layeredTextureNames = Lists.newArrayList(textureNames); + + if (textureNames.length > 0 && textureNames[0] != null) + { + this.textureLocation = new ResourceLocation(textureNames[0]); + } + } + + public void loadTexture(IResourceManager resourceManager) throws IOException + { + this.deleteGlTexture(); + BufferedImage bufferedimage = null; + + try + { + for (String s : this.layeredTextureNames) + { + if (s != null) + { + InputStream inputstream = resourceManager.getResource(new ResourceLocation(s)).getInputStream(); + BufferedImage bufferedimage1 = TextureUtil.readBufferedImage(inputstream); + + if (bufferedimage == null) + { + bufferedimage = new BufferedImage(bufferedimage1.getWidth(), bufferedimage1.getHeight(), 2); + } + + bufferedimage.getGraphics().drawImage(bufferedimage1, 0, 0, (ImageObserver)null); + } + } + } + catch (IOException ioexception) + { + logger.error((String)"Couldn\'t load layered image", (Throwable)ioexception); + return; + } + + if (Config.isShaders()) + { + ShadersTex.loadSimpleTexture(this.getGlTextureId(), bufferedimage, false, false, resourceManager, this.textureLocation, this.getMultiTexID()); + } + else + { + TextureUtil.uploadTextureImage(this.getGlTextureId(), bufferedimage); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/SimpleTexture.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/SimpleTexture.java new file mode 100644 index 0000000..7a45788 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/SimpleTexture.java @@ -0,0 +1,81 @@ +package net.minecraft.client.renderer.texture; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.EmissiveTextures; +import net.optifine.shaders.ShadersTex; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SimpleTexture extends AbstractTexture +{ + private static final Logger logger = LogManager.getLogger(); + protected final ResourceLocation textureLocation; + public ResourceLocation locationEmissive; + public boolean isEmissive; + + public SimpleTexture(ResourceLocation textureResourceLocation) + { + this.textureLocation = textureResourceLocation; + } + + public void loadTexture(IResourceManager resourceManager) throws IOException + { + this.deleteGlTexture(); + InputStream inputstream = null; + + try + { + IResource iresource = resourceManager.getResource(this.textureLocation); + inputstream = iresource.getInputStream(); + BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream); + boolean flag = false; + boolean flag1 = false; + + if (iresource.hasMetadata()) + { + try + { + TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture"); + + if (texturemetadatasection != null) + { + flag = texturemetadatasection.getTextureBlur(); + flag1 = texturemetadatasection.getTextureClamp(); + } + } + catch (RuntimeException runtimeexception) + { + logger.warn((String)("Failed reading metadata of: " + this.textureLocation), (Throwable)runtimeexception); + } + } + + if (Config.isShaders()) + { + ShadersTex.loadSimpleTexture(this.getGlTextureId(), bufferedimage, flag, flag1, resourceManager, this.textureLocation, this.getMultiTexID()); + } + else + { + TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1); + } + + if (EmissiveTextures.isActive()) + { + EmissiveTextures.loadTexture(this.textureLocation, this); + } + } + finally + { + if (inputstream != null) + { + inputstream.close(); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java new file mode 100644 index 0000000..27061c3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/Stitcher.java @@ -0,0 +1,412 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import net.minecraft.client.renderer.StitcherException; +import net.minecraft.util.MathHelper; + +public class Stitcher +{ + private final int mipmapLevelStitcher; + private final Set setStitchHolders = Sets.newHashSetWithExpectedSize(256); + private final List stitchSlots = Lists.newArrayListWithCapacity(256); + private int currentWidth; + private int currentHeight; + private final int maxWidth; + private final int maxHeight; + private final boolean forcePowerOf2; + private final int maxTileDimension; + + public Stitcher(int maxTextureWidth, int maxTextureHeight, boolean p_i45095_3_, int p_i45095_4_, int mipmapLevel) + { + this.mipmapLevelStitcher = mipmapLevel; + this.maxWidth = maxTextureWidth; + this.maxHeight = maxTextureHeight; + this.forcePowerOf2 = p_i45095_3_; + this.maxTileDimension = p_i45095_4_; + } + + public int getCurrentWidth() + { + return this.currentWidth; + } + + public int getCurrentHeight() + { + return this.currentHeight; + } + + public void addSprite(TextureAtlasSprite p_110934_1_) + { + Stitcher.Holder stitcher$holder = new Stitcher.Holder(p_110934_1_, this.mipmapLevelStitcher); + + if (this.maxTileDimension > 0) + { + stitcher$holder.setNewDimension(this.maxTileDimension); + } + + this.setStitchHolders.add(stitcher$holder); + } + + public void doStitch() + { + Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])((Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()])); + Arrays.sort((Object[])astitcher$holder); + + for (Stitcher.Holder stitcher$holder : astitcher$holder) + { + if (!this.allocateSlot(stitcher$holder)) + { + String s = String.format("Unable to fit: %s, size: %dx%d, atlas: %dx%d, atlasMax: %dx%d - Maybe try a lower resolution resourcepack?", new Object[] {stitcher$holder.getAtlasSprite().getIconName(), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconWidth()), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconHeight()), Integer.valueOf(this.currentWidth), Integer.valueOf(this.currentHeight), Integer.valueOf(this.maxWidth), Integer.valueOf(this.maxHeight)}); + throw new StitcherException(stitcher$holder, s); + } + } + + if (this.forcePowerOf2) + { + this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); + this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); + } + } + + public List getStichSlots() + { + List list = Lists.newArrayList(); + + for (Stitcher.Slot stitcher$slot : this.stitchSlots) + { + stitcher$slot.getAllStitchSlots(list); + } + + List list1 = Lists.newArrayList(); + + for (Stitcher.Slot stitcher$slot1 : list) + { + Stitcher.Holder stitcher$holder = stitcher$slot1.getStitchHolder(); + TextureAtlasSprite textureatlassprite = stitcher$holder.getAtlasSprite(); + textureatlassprite.initSprite(this.currentWidth, this.currentHeight, stitcher$slot1.getOriginX(), stitcher$slot1.getOriginY(), stitcher$holder.isRotated()); + list1.add(textureatlassprite); + } + + return list1; + } + + private static int getMipmapDimension(int p_147969_0_, int p_147969_1_) + { + return (p_147969_0_ >> p_147969_1_) + ((p_147969_0_ & (1 << p_147969_1_) - 1) == 0 ? 0 : 1) << p_147969_1_; + } + + private boolean allocateSlot(Stitcher.Holder p_94310_1_) + { + for (int i = 0; i < this.stitchSlots.size(); ++i) + { + if (((Stitcher.Slot)this.stitchSlots.get(i)).addSlot(p_94310_1_)) + { + return true; + } + + p_94310_1_.rotate(); + + if (((Stitcher.Slot)this.stitchSlots.get(i)).addSlot(p_94310_1_)) + { + return true; + } + + p_94310_1_.rotate(); + } + + return this.expandAndAllocateSlot(p_94310_1_); + } + + private boolean expandAndAllocateSlot(Stitcher.Holder p_94311_1_) + { + int i = Math.min(p_94311_1_.getWidth(), p_94311_1_.getHeight()); + boolean flag = this.currentWidth == 0 && this.currentHeight == 0; + boolean flag1; + + if (this.forcePowerOf2) + { + int j = MathHelper.roundUpToPowerOfTwo(this.currentWidth); + int k = MathHelper.roundUpToPowerOfTwo(this.currentHeight); + int l = MathHelper.roundUpToPowerOfTwo(this.currentWidth + i); + int i1 = MathHelper.roundUpToPowerOfTwo(this.currentHeight + i); + boolean flag2 = l <= this.maxWidth; + boolean flag3 = i1 <= this.maxHeight; + + if (!flag2 && !flag3) + { + return false; + } + + boolean flag4 = j != l; + boolean flag5 = k != i1; + + if (flag4 ^ flag5) + { + flag1 = !flag4; + } + else + { + flag1 = flag2 && j <= k; + } + } + else + { + boolean flag6 = this.currentWidth + i <= this.maxWidth; + boolean flag7 = this.currentHeight + i <= this.maxHeight; + + if (!flag6 && !flag7) + { + return false; + } + + flag1 = flag6 && (flag || this.currentWidth <= this.currentHeight); + } + + int j1 = Math.max(p_94311_1_.getWidth(), p_94311_1_.getHeight()); + + if (MathHelper.roundUpToPowerOfTwo((!flag1 ? this.currentHeight : this.currentWidth) + j1) > (!flag1 ? this.maxHeight : this.maxWidth)) + { + return false; + } + else + { + Stitcher.Slot stitcher$slot; + + if (flag1) + { + if (p_94311_1_.getWidth() > p_94311_1_.getHeight()) + { + p_94311_1_.rotate(); + } + + if (this.currentHeight == 0) + { + this.currentHeight = p_94311_1_.getHeight(); + } + + stitcher$slot = new Stitcher.Slot(this.currentWidth, 0, p_94311_1_.getWidth(), this.currentHeight); + this.currentWidth += p_94311_1_.getWidth(); + } + else + { + stitcher$slot = new Stitcher.Slot(0, this.currentHeight, this.currentWidth, p_94311_1_.getHeight()); + this.currentHeight += p_94311_1_.getHeight(); + } + + stitcher$slot.addSlot(p_94311_1_); + this.stitchSlots.add(stitcher$slot); + return true; + } + } + + public static class Holder implements Comparable + { + private final TextureAtlasSprite theTexture; + private final int width; + private final int height; + private final int mipmapLevelHolder; + private boolean rotated; + private float scaleFactor = 1.0F; + + public Holder(TextureAtlasSprite p_i45094_1_, int p_i45094_2_) + { + this.theTexture = p_i45094_1_; + this.width = p_i45094_1_.getIconWidth(); + this.height = p_i45094_1_.getIconHeight(); + this.mipmapLevelHolder = p_i45094_2_; + this.rotated = Stitcher.getMipmapDimension(this.height, p_i45094_2_) > Stitcher.getMipmapDimension(this.width, p_i45094_2_); + } + + public TextureAtlasSprite getAtlasSprite() + { + return this.theTexture; + } + + public int getWidth() + { + return this.rotated ? Stitcher.getMipmapDimension((int)((float)this.height * this.scaleFactor), this.mipmapLevelHolder) : Stitcher.getMipmapDimension((int)((float)this.width * this.scaleFactor), this.mipmapLevelHolder); + } + + public int getHeight() + { + return this.rotated ? Stitcher.getMipmapDimension((int)((float)this.width * this.scaleFactor), this.mipmapLevelHolder) : Stitcher.getMipmapDimension((int)((float)this.height * this.scaleFactor), this.mipmapLevelHolder); + } + + public void rotate() + { + this.rotated = !this.rotated; + } + + public boolean isRotated() + { + return this.rotated; + } + + public void setNewDimension(int p_94196_1_) + { + if (this.width > p_94196_1_ && this.height > p_94196_1_) + { + this.scaleFactor = (float)p_94196_1_ / (float)Math.min(this.width, this.height); + } + } + + public String toString() + { + return "Holder{width=" + this.width + ", height=" + this.height + '}'; + } + + public int compareTo(Stitcher.Holder p_compareTo_1_) + { + int i; + + if (this.getHeight() == p_compareTo_1_.getHeight()) + { + if (this.getWidth() == p_compareTo_1_.getWidth()) + { + if (this.theTexture.getIconName() == null) + { + return p_compareTo_1_.theTexture.getIconName() == null ? 0 : -1; + } + + return this.theTexture.getIconName().compareTo(p_compareTo_1_.theTexture.getIconName()); + } + + i = this.getWidth() < p_compareTo_1_.getWidth() ? 1 : -1; + } + else + { + i = this.getHeight() < p_compareTo_1_.getHeight() ? 1 : -1; + } + + return i; + } + } + + public static class Slot + { + private final int originX; + private final int originY; + private final int width; + private final int height; + private List subSlots; + private Stitcher.Holder holder; + + public Slot(int p_i1277_1_, int p_i1277_2_, int widthIn, int heightIn) + { + this.originX = p_i1277_1_; + this.originY = p_i1277_2_; + this.width = widthIn; + this.height = heightIn; + } + + public Stitcher.Holder getStitchHolder() + { + return this.holder; + } + + public int getOriginX() + { + return this.originX; + } + + public int getOriginY() + { + return this.originY; + } + + public boolean addSlot(Stitcher.Holder holderIn) + { + if (this.holder != null) + { + return false; + } + else + { + int i = holderIn.getWidth(); + int j = holderIn.getHeight(); + + if (i <= this.width && j <= this.height) + { + if (i == this.width && j == this.height) + { + this.holder = holderIn; + return true; + } + else + { + if (this.subSlots == null) + { + this.subSlots = Lists.newArrayListWithCapacity(1); + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY, i, j)); + int k = this.width - i; + int l = this.height - j; + + if (l > 0 && k > 0) + { + int i1 = Math.max(this.height, k); + int j1 = Math.max(this.width, l); + + if (i1 >= j1) + { + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + j, i, l)); + this.subSlots.add(new Stitcher.Slot(this.originX + i, this.originY, k, this.height)); + } + else + { + this.subSlots.add(new Stitcher.Slot(this.originX + i, this.originY, k, j)); + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + j, this.width, l)); + } + } + else if (k == 0) + { + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + j, i, l)); + } + else if (l == 0) + { + this.subSlots.add(new Stitcher.Slot(this.originX + i, this.originY, k, j)); + } + } + + for (Stitcher.Slot stitcher$slot : this.subSlots) + { + if (stitcher$slot.addSlot(holderIn)) + { + return true; + } + } + + return false; + } + } + else + { + return false; + } + } + } + + public void getAllStitchSlots(List p_94184_1_) + { + if (this.holder != null) + { + p_94184_1_.add(this); + } + else if (this.subSlots != null) + { + for (Stitcher.Slot stitcher$slot : this.subSlots) + { + stitcher$slot.getAllStitchSlots(p_94184_1_); + } + } + } + + public String toString() + { + return "Slot{originX=" + this.originX + ", originY=" + this.originY + ", width=" + this.width + ", height=" + this.height + ", texture=" + this.holder + ", subSlots=" + this.subSlots + '}'; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java new file mode 100644 index 0000000..5d3ef91 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java @@ -0,0 +1,761 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationFrame; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.optifine.SmartAnimations; +import net.optifine.shaders.Shaders; +import net.optifine.util.CounterInt; +import net.optifine.util.TextureUtils; + +public class TextureAtlasSprite +{ + private final String iconName; + protected List framesTextureData = Lists.newArrayList(); + protected int[][] interpolatedFrameData; + private AnimationMetadataSection animationMetadata; + protected boolean rotated; + protected int originX; + protected int originY; + protected int width; + protected int height; + private float minU; + private float maxU; + private float minV; + private float maxV; + protected int frameCounter; + protected int tickCounter; + private static String locationNameClock = "builtin/clock"; + private static String locationNameCompass = "builtin/compass"; + private int indexInMap = -1; + public float baseU; + public float baseV; + public int sheetWidth; + public int sheetHeight; + public int glSpriteTextureId = -1; + public TextureAtlasSprite spriteSingle = null; + public boolean isSpriteSingle = false; + public int mipmapLevels = 0; + public TextureAtlasSprite spriteNormal = null; + public TextureAtlasSprite spriteSpecular = null; + public boolean isShadersSprite = false; + public boolean isEmissive = false; + public TextureAtlasSprite spriteEmissive = null; + private int animationIndex = -1; + private boolean animationActive = false; + + private TextureAtlasSprite(String p_i7_1_, boolean p_i7_2_) + { + this.iconName = p_i7_1_; + this.isSpriteSingle = p_i7_2_; + } + + public TextureAtlasSprite(String spriteName) + { + this.iconName = spriteName; + + if (Config.isMultiTexture()) + { + this.spriteSingle = new TextureAtlasSprite(this.getIconName() + ".spriteSingle", true); + } + } + + protected static TextureAtlasSprite makeAtlasSprite(ResourceLocation spriteResourceLocation) + { + String s = spriteResourceLocation.toString(); + return (TextureAtlasSprite)(locationNameClock.equals(s) ? new TextureClock(s) : (locationNameCompass.equals(s) ? new TextureCompass(s) : new TextureAtlasSprite(s))); + } + + public static void setLocationNameClock(String clockName) + { + locationNameClock = clockName; + } + + public static void setLocationNameCompass(String compassName) + { + locationNameCompass = compassName; + } + + public void initSprite(int inX, int inY, int originInX, int originInY, boolean rotatedIn) + { + this.originX = originInX; + this.originY = originInY; + this.rotated = rotatedIn; + float f = (float)(0.009999999776482582D / (double)inX); + float f1 = (float)(0.009999999776482582D / (double)inY); + this.minU = (float)originInX / (float)((double)inX) + f; + this.maxU = (float)(originInX + this.width) / (float)((double)inX) - f; + this.minV = (float)originInY / (float)inY + f1; + this.maxV = (float)(originInY + this.height) / (float)inY - f1; + this.baseU = Math.min(this.minU, this.maxU); + this.baseV = Math.min(this.minV, this.maxV); + + if (this.spriteSingle != null) + { + this.spriteSingle.initSprite(this.width, this.height, 0, 0, false); + } + + if (this.spriteNormal != null) + { + this.spriteNormal.copyFrom(this); + } + + if (this.spriteSpecular != null) + { + this.spriteSpecular.copyFrom(this); + } + } + + public void copyFrom(TextureAtlasSprite atlasSpirit) + { + this.originX = atlasSpirit.originX; + this.originY = atlasSpirit.originY; + this.width = atlasSpirit.width; + this.height = atlasSpirit.height; + this.rotated = atlasSpirit.rotated; + this.minU = atlasSpirit.minU; + this.maxU = atlasSpirit.maxU; + this.minV = atlasSpirit.minV; + this.maxV = atlasSpirit.maxV; + + if (atlasSpirit != Config.getTextureMap().getMissingSprite()) + { + this.indexInMap = atlasSpirit.indexInMap; + } + + this.baseU = atlasSpirit.baseU; + this.baseV = atlasSpirit.baseV; + this.sheetWidth = atlasSpirit.sheetWidth; + this.sheetHeight = atlasSpirit.sheetHeight; + this.glSpriteTextureId = atlasSpirit.glSpriteTextureId; + this.mipmapLevels = atlasSpirit.mipmapLevels; + + if (this.spriteSingle != null) + { + this.spriteSingle.initSprite(this.width, this.height, 0, 0, false); + } + + this.animationIndex = atlasSpirit.animationIndex; + } + + public int getOriginX() + { + return this.originX; + } + + public int getOriginY() + { + return this.originY; + } + + public int getIconWidth() + { + return this.width; + } + + public int getIconHeight() + { + return this.height; + } + + public float getMinU() + { + return this.minU; + } + + public float getMaxU() + { + return this.maxU; + } + + public float getInterpolatedU(double u) + { + float f = this.maxU - this.minU; + return this.minU + f * (float)u / 16.0F; + } + + public float getMinV() + { + return this.minV; + } + + public float getMaxV() + { + return this.maxV; + } + + public float getInterpolatedV(double v) + { + float f = this.maxV - this.minV; + return this.minV + f * ((float)v / 16.0F); + } + + public String getIconName() + { + return this.iconName; + } + + public void updateAnimation() + { + if (this.animationMetadata != null) + { + this.animationActive = SmartAnimations.isActive() ? SmartAnimations.isSpriteRendered(this.animationIndex) : true; + ++this.tickCounter; + + if (this.tickCounter >= this.animationMetadata.getFrameTimeSingle(this.frameCounter)) + { + int i = this.animationMetadata.getFrameIndex(this.frameCounter); + int j = this.animationMetadata.getFrameCount() == 0 ? this.framesTextureData.size() : this.animationMetadata.getFrameCount(); + this.frameCounter = (this.frameCounter + 1) % j; + this.tickCounter = 0; + int k = this.animationMetadata.getFrameIndex(this.frameCounter); + boolean flag = false; + boolean flag1 = this.isSpriteSingle; + + if (!this.animationActive) + { + return; + } + + if (i != k && k >= 0 && k < this.framesTextureData.size()) + { + TextureUtil.uploadTextureMipmap((int[][])((int[][])this.framesTextureData.get(k)), this.width, this.height, this.originX, this.originY, flag, flag1); + } + } + else if (this.animationMetadata.isInterpolate()) + { + if (!this.animationActive) + { + return; + } + + this.updateAnimationInterpolated(); + } + } + } + + private void updateAnimationInterpolated() + { + double d0 = 1.0D - (double)this.tickCounter / (double)this.animationMetadata.getFrameTimeSingle(this.frameCounter); + int i = this.animationMetadata.getFrameIndex(this.frameCounter); + int j = this.animationMetadata.getFrameCount() == 0 ? this.framesTextureData.size() : this.animationMetadata.getFrameCount(); + int k = this.animationMetadata.getFrameIndex((this.frameCounter + 1) % j); + + if (i != k && k >= 0 && k < this.framesTextureData.size()) + { + int[][] aint = (int[][])((int[][])this.framesTextureData.get(i)); + int[][] aint1 = (int[][])((int[][])this.framesTextureData.get(k)); + + if (this.interpolatedFrameData == null || this.interpolatedFrameData.length != aint.length) + { + this.interpolatedFrameData = new int[aint.length][]; + } + + for (int l = 0; l < aint.length; ++l) + { + if (this.interpolatedFrameData[l] == null) + { + this.interpolatedFrameData[l] = new int[aint[l].length]; + } + + if (l < aint1.length && aint1[l].length == aint[l].length) + { + for (int i1 = 0; i1 < aint[l].length; ++i1) + { + int j1 = aint[l][i1]; + int k1 = aint1[l][i1]; + int l1 = (int)((double)((j1 & 16711680) >> 16) * d0 + (double)((k1 & 16711680) >> 16) * (1.0D - d0)); + int i2 = (int)((double)((j1 & 65280) >> 8) * d0 + (double)((k1 & 65280) >> 8) * (1.0D - d0)); + int j2 = (int)((double)(j1 & 255) * d0 + (double)(k1 & 255) * (1.0D - d0)); + this.interpolatedFrameData[l][i1] = j1 & -16777216 | l1 << 16 | i2 << 8 | j2; + } + } + } + + TextureUtil.uploadTextureMipmap(this.interpolatedFrameData, this.width, this.height, this.originX, this.originY, false, false); + } + } + + public int[][] getFrameTextureData(int index) + { + return (int[][])((int[][])this.framesTextureData.get(index)); + } + + public int getFrameCount() + { + return this.framesTextureData.size(); + } + + public void setIconWidth(int newWidth) + { + this.width = newWidth; + + if (this.spriteSingle != null) + { + this.spriteSingle.setIconWidth(this.width); + } + } + + public void setIconHeight(int newHeight) + { + this.height = newHeight; + + if (this.spriteSingle != null) + { + this.spriteSingle.setIconHeight(this.height); + } + } + + public void loadSprite(BufferedImage[] images, AnimationMetadataSection meta) throws IOException + { + this.resetSprite(); + int i = images[0].getWidth(); + int j = images[0].getHeight(); + this.width = i; + this.height = j; + + if (this.spriteSingle != null) + { + this.spriteSingle.width = this.width; + this.spriteSingle.height = this.height; + } + + int[][] aint = new int[images.length][]; + + for (int k = 0; k < images.length; ++k) + { + BufferedImage bufferedimage = images[k]; + + if (bufferedimage != null) + { + if (this.width >> k != bufferedimage.getWidth()) + { + bufferedimage = TextureUtils.scaleImage(bufferedimage, this.width >> k); + } + + if (k > 0 && (bufferedimage.getWidth() != i >> k || bufferedimage.getHeight() != j >> k)) + { + throw new RuntimeException(String.format("Unable to load miplevel: %d, image is size: %dx%d, expected %dx%d", new Object[] {Integer.valueOf(k), Integer.valueOf(bufferedimage.getWidth()), Integer.valueOf(bufferedimage.getHeight()), Integer.valueOf(i >> k), Integer.valueOf(j >> k)})); + } + + aint[k] = new int[bufferedimage.getWidth() * bufferedimage.getHeight()]; + bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), aint[k], 0, bufferedimage.getWidth()); + } + } + + if (meta == null) + { + if (j != i) + { + throw new RuntimeException("broken aspect ratio and not an animation"); + } + + this.framesTextureData.add(aint); + } + else + { + int j1 = j / i; + int l1 = i; + int l = i; + this.height = this.width; + + if (meta.getFrameCount() > 0) + { + Iterator iterator = meta.getFrameIndexSet().iterator(); + + while (iterator.hasNext()) + { + int i1 = ((Integer)iterator.next()).intValue(); + + if (i1 >= j1) + { + throw new RuntimeException("invalid frameindex " + i1); + } + + this.allocateFrameTextureData(i1); + this.framesTextureData.set(i1, getFrameTextureData(aint, l1, l, i1)); + } + + this.animationMetadata = meta; + } + else + { + List list = Lists.newArrayList(); + + for (int j2 = 0; j2 < j1; ++j2) + { + this.framesTextureData.add(getFrameTextureData(aint, l1, l, j2)); + list.add(new AnimationFrame(j2, -1)); + } + + this.animationMetadata = new AnimationMetadataSection(list, this.width, this.height, meta.getFrameTime(), meta.isInterpolate()); + } + } + + if (!this.isShadersSprite) + { + if (Config.isShaders()) + { + this.loadShadersSprites(); + } + + for (int k1 = 0; k1 < this.framesTextureData.size(); ++k1) + { + int[][] aint1 = (int[][])((int[][])this.framesTextureData.get(k1)); + + if (aint1 != null && !this.iconName.startsWith("minecraft:blocks/leaves_")) + { + for (int i2 = 0; i2 < aint1.length; ++i2) + { + int[] aint2 = aint1[i2]; + this.fixTransparentColor(aint2); + } + } + } + + if (this.spriteSingle != null) + { + this.spriteSingle.loadSprite(images, meta); + } + } + } + + public void generateMipmaps(int level) + { + List list = Lists.newArrayList(); + + for (int i = 0; i < this.framesTextureData.size(); ++i) + { + final int[][] aint = (int[][])((int[][])this.framesTextureData.get(i)); + + if (aint != null) + { + try + { + list.add(TextureUtil.generateMipmapData(level, this.width, aint)); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Generating mipmaps for frame"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Frame being iterated"); + crashreportcategory.addCrashSection("Frame index", Integer.valueOf(i)); + crashreportcategory.addCrashSectionCallable("Frame sizes", new Callable() + { + public String call() throws Exception + { + StringBuilder stringbuilder = new StringBuilder(); + + for (int[] aint1 : aint) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append(", "); + } + + stringbuilder.append(aint1 == null ? "null" : Integer.valueOf(aint1.length)); + } + + return stringbuilder.toString(); + } + }); + throw new ReportedException(crashreport); + } + } + } + + this.setFramesTextureData(list); + + if (this.spriteSingle != null) + { + this.spriteSingle.generateMipmaps(level); + } + } + + private void allocateFrameTextureData(int index) + { + if (this.framesTextureData.size() <= index) + { + for (int i = this.framesTextureData.size(); i <= index; ++i) + { + this.framesTextureData.add((int[][])((int[][])null)); + } + } + + if (this.spriteSingle != null) + { + this.spriteSingle.allocateFrameTextureData(index); + } + } + + private static int[][] getFrameTextureData(int[][] data, int rows, int columns, int p_147962_3_) + { + int[][] aint = new int[data.length][]; + + for (int i = 0; i < data.length; ++i) + { + int[] aint1 = data[i]; + + if (aint1 != null) + { + aint[i] = new int[(rows >> i) * (columns >> i)]; + System.arraycopy(aint1, p_147962_3_ * aint[i].length, aint[i], 0, aint[i].length); + } + } + + return aint; + } + + public void clearFramesTextureData() + { + this.framesTextureData.clear(); + + if (this.spriteSingle != null) + { + this.spriteSingle.clearFramesTextureData(); + } + } + + public boolean hasAnimationMetadata() + { + return this.animationMetadata != null; + } + + public void setFramesTextureData(List newFramesTextureData) + { + this.framesTextureData = newFramesTextureData; + + if (this.spriteSingle != null) + { + this.spriteSingle.setFramesTextureData(newFramesTextureData); + } + } + + private void resetSprite() + { + this.animationMetadata = null; + this.setFramesTextureData(Lists.newArrayList()); + this.frameCounter = 0; + this.tickCounter = 0; + + if (this.spriteSingle != null) + { + this.spriteSingle.resetSprite(); + } + } + + public String toString() + { + return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; + } + + public boolean hasCustomLoader(IResourceManager p_hasCustomLoader_1_, ResourceLocation p_hasCustomLoader_2_) + { + return false; + } + + public boolean load(IResourceManager p_load_1_, ResourceLocation p_load_2_) + { + return true; + } + + public int getIndexInMap() + { + return this.indexInMap; + } + + public void setIndexInMap(int p_setIndexInMap_1_) + { + this.indexInMap = p_setIndexInMap_1_; + } + + public void updateIndexInMap(CounterInt p_updateIndexInMap_1_) + { + if (this.indexInMap < 0) + { + this.indexInMap = p_updateIndexInMap_1_.nextValue(); + } + } + + public int getAnimationIndex() + { + return this.animationIndex; + } + + public void setAnimationIndex(int p_setAnimationIndex_1_) + { + this.animationIndex = p_setAnimationIndex_1_; + + if (this.spriteNormal != null) + { + this.spriteNormal.setAnimationIndex(p_setAnimationIndex_1_); + } + + if (this.spriteSpecular != null) + { + this.spriteSpecular.setAnimationIndex(p_setAnimationIndex_1_); + } + } + + public boolean isAnimationActive() + { + return this.animationActive; + } + + private void fixTransparentColor(int[] p_fixTransparentColor_1_) + { + if (p_fixTransparentColor_1_ != null) + { + long i = 0L; + long j = 0L; + long k = 0L; + long l = 0L; + + for (int i1 = 0; i1 < p_fixTransparentColor_1_.length; ++i1) + { + int j1 = p_fixTransparentColor_1_[i1]; + int k1 = j1 >> 24 & 255; + + if (k1 >= 16) + { + int l1 = j1 >> 16 & 255; + int i2 = j1 >> 8 & 255; + int j2 = j1 & 255; + i += (long)l1; + j += (long)i2; + k += (long)j2; + ++l; + } + } + + if (l > 0L) + { + int l2 = (int)(i / l); + int i3 = (int)(j / l); + int j3 = (int)(k / l); + int k3 = l2 << 16 | i3 << 8 | j3; + + for (int l3 = 0; l3 < p_fixTransparentColor_1_.length; ++l3) + { + int i4 = p_fixTransparentColor_1_[l3]; + int k2 = i4 >> 24 & 255; + + if (k2 <= 16) + { + p_fixTransparentColor_1_[l3] = k3; + } + } + } + } + } + + public double getSpriteU16(float p_getSpriteU16_1_) + { + float f = this.maxU - this.minU; + return (double)((p_getSpriteU16_1_ - this.minU) / f * 16.0F); + } + + public double getSpriteV16(float p_getSpriteV16_1_) + { + float f = this.maxV - this.minV; + return (double)((p_getSpriteV16_1_ - this.minV) / f * 16.0F); + } + + public void bindSpriteTexture() + { + if (this.glSpriteTextureId < 0) + { + this.glSpriteTextureId = TextureUtil.glGenTextures(); + TextureUtil.allocateTextureImpl(this.glSpriteTextureId, this.mipmapLevels, this.width, this.height); + TextureUtils.applyAnisotropicLevel(); + } + + TextureUtils.bindTexture(this.glSpriteTextureId); + } + + public void deleteSpriteTexture() + { + if (this.glSpriteTextureId >= 0) + { + TextureUtil.deleteTexture(this.glSpriteTextureId); + this.glSpriteTextureId = -1; + } + } + + public float toSingleU(float p_toSingleU_1_) + { + p_toSingleU_1_ = p_toSingleU_1_ - this.baseU; + float f = (float)this.sheetWidth / (float)this.width; + p_toSingleU_1_ = p_toSingleU_1_ * f; + return p_toSingleU_1_; + } + + public float toSingleV(float p_toSingleV_1_) + { + p_toSingleV_1_ = p_toSingleV_1_ - this.baseV; + float f = (float)this.sheetHeight / (float)this.height; + p_toSingleV_1_ = p_toSingleV_1_ * f; + return p_toSingleV_1_; + } + + public List getFramesTextureData() + { + List list = new ArrayList(); + list.addAll(this.framesTextureData); + return list; + } + + public AnimationMetadataSection getAnimationMetadata() + { + return this.animationMetadata; + } + + public void setAnimationMetadata(AnimationMetadataSection p_setAnimationMetadata_1_) + { + this.animationMetadata = p_setAnimationMetadata_1_; + } + + private void loadShadersSprites() + { + if (Shaders.configNormalMap) + { + String s = this.iconName + "_n"; + ResourceLocation resourcelocation = new ResourceLocation(s); + resourcelocation = Config.getTextureMap().completeResourceLocation(resourcelocation); + + if (Config.hasResource(resourcelocation)) + { + this.spriteNormal = new TextureAtlasSprite(s); + this.spriteNormal.isShadersSprite = true; + this.spriteNormal.copyFrom(this); + this.spriteNormal.generateMipmaps(this.mipmapLevels); + } + } + + if (Shaders.configSpecularMap) + { + String s1 = this.iconName + "_s"; + ResourceLocation resourcelocation1 = new ResourceLocation(s1); + resourcelocation1 = Config.getTextureMap().completeResourceLocation(resourcelocation1); + + if (Config.hasResource(resourcelocation1)) + { + this.spriteSpecular = new TextureAtlasSprite(s1); + this.spriteSpecular.isShadersSprite = true; + this.spriteSpecular.copyFrom(this); + this.spriteSpecular.generateMipmaps(this.mipmapLevels); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java new file mode 100644 index 0000000..143135e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java @@ -0,0 +1,63 @@ +package net.minecraft.client.renderer.texture; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.MathHelper; + +public class TextureClock extends TextureAtlasSprite +{ + private double currentAngle; + private double angleDelta; + + public TextureClock(String iconName) + { + super(iconName); + } + + public void updateAnimation() + { + if (!this.framesTextureData.isEmpty()) + { + Minecraft minecraft = Minecraft.getMinecraft(); + double d0 = 0.0D; + + if (minecraft.theWorld != null && minecraft.thePlayer != null) + { + d0 = (double)minecraft.theWorld.getCelestialAngle(1.0F); + + if (!minecraft.theWorld.provider.isSurfaceWorld()) + { + d0 = Math.random(); + } + } + + double d1; + + for (d1 = d0 - this.currentAngle; d1 < -0.5D; ++d1) + { + ; + } + + while (d1 >= 0.5D) + { + --d1; + } + + d1 = MathHelper.clamp_double(d1, -1.0D, 1.0D); + this.angleDelta += d1 * 0.1D; + this.angleDelta *= 0.8D; + this.currentAngle += this.angleDelta; + int i; + + for (i = (int)((this.currentAngle + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size()) + { + ; + } + + if (i != this.frameCounter) + { + this.frameCounter = i; + TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java new file mode 100644 index 0000000..1f82bad --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java @@ -0,0 +1,92 @@ +package net.minecraft.client.renderer.texture; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class TextureCompass extends TextureAtlasSprite +{ + public double currentAngle; + public double angleDelta; + public static String locationSprite; + + public TextureCompass(String iconName) + { + super(iconName); + locationSprite = iconName; + } + + public void updateAnimation() + { + Minecraft minecraft = Minecraft.getMinecraft(); + + if (minecraft.theWorld != null && minecraft.thePlayer != null) + { + this.updateCompass(minecraft.theWorld, minecraft.thePlayer.posX, minecraft.thePlayer.posZ, (double)minecraft.thePlayer.rotationYaw, false, false); + } + else + { + this.updateCompass((World)null, 0.0D, 0.0D, 0.0D, true, false); + } + } + + public void updateCompass(World worldIn, double p_94241_2_, double p_94241_4_, double p_94241_6_, boolean p_94241_8_, boolean p_94241_9_) + { + if (!this.framesTextureData.isEmpty()) + { + double d0 = 0.0D; + + if (worldIn != null && !p_94241_8_) + { + BlockPos blockpos = worldIn.getSpawnPoint(); + double d1 = (double)blockpos.getX() - p_94241_2_; + double d2 = (double)blockpos.getZ() - p_94241_4_; + p_94241_6_ = p_94241_6_ % 360.0D; + d0 = -((p_94241_6_ - 90.0D) * Math.PI / 180.0D - Math.atan2(d2, d1)); + + if (!worldIn.provider.isSurfaceWorld()) + { + d0 = Math.random() * Math.PI * 2.0D; + } + } + + if (p_94241_9_) + { + this.currentAngle = d0; + } + else + { + double d3; + + for (d3 = d0 - this.currentAngle; d3 < -Math.PI; d3 += (Math.PI * 2D)) + { + ; + } + + while (d3 >= Math.PI) + { + d3 -= (Math.PI * 2D); + } + + d3 = MathHelper.clamp_double(d3, -1.0D, 1.0D); + this.angleDelta += d3 * 0.1D; + this.angleDelta *= 0.8D; + this.currentAngle += this.angleDelta; + } + + int i; + + for (i = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size()) + { + ; + } + + if (i != this.frameCounter) + { + this.frameCounter = i; + TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java new file mode 100644 index 0000000..2fb542f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java @@ -0,0 +1,225 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomGuis; +import net.optifine.EmissiveTextures; +import net.optifine.RandomEntities; +import net.optifine.shaders.ShadersTex; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class TextureManager implements ITickable, IResourceManagerReloadListener +{ + private static final Logger logger = LogManager.getLogger(); + private final Map mapTextureObjects = Maps.newHashMap(); + private final List listTickables = Lists.newArrayList(); + private final Map mapTextureCounters = Maps.newHashMap(); + private IResourceManager theResourceManager; + private ITextureObject boundTexture; + private ResourceLocation boundTextureLocation; + + public TextureManager(IResourceManager resourceManager) + { + this.theResourceManager = resourceManager; + } + + public void bindTexture(ResourceLocation resource) + { + if (Config.isRandomEntities()) + { + resource = RandomEntities.getTextureLocation(resource); + } + + if (Config.isCustomGuis()) + { + resource = CustomGuis.getTextureLocation(resource); + } + + ITextureObject itextureobject = (ITextureObject)this.mapTextureObjects.get(resource); + + if (EmissiveTextures.isActive()) + { + itextureobject = EmissiveTextures.getEmissiveTexture(itextureobject, this.mapTextureObjects); + } + + if (itextureobject == null) + { + itextureobject = new SimpleTexture(resource); + this.loadTexture(resource, itextureobject); + } + + if (Config.isShaders()) + { + ShadersTex.bindTexture(itextureobject); + } + else + { + TextureUtil.bindTexture(itextureobject.getGlTextureId()); + } + + this.boundTexture = itextureobject; + this.boundTextureLocation = resource; + } + + public boolean loadTickableTexture(ResourceLocation textureLocation, ITickableTextureObject textureObj) + { + if (this.loadTexture(textureLocation, textureObj)) + { + this.listTickables.add(textureObj); + return true; + } + else + { + return false; + } + } + + public boolean loadTexture(ResourceLocation textureLocation, ITextureObject textureObj) + { + try + { + textureObj.loadTexture(this.theResourceManager); + } + catch (IOException ioexception) + { + logger.warn(("Failed to load texture: " + textureLocation), ioexception); + textureObj = TextureUtil.missingTexture; + this.mapTextureObjects.put(textureLocation, textureObj); + return false; + } + catch (Throwable throwable) + { + final ITextureObject textureObjf = textureObj; + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Registering texture"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Resource location being registered"); + crashreportcategory.addCrashSection("Resource location", textureLocation); + crashreportcategory.addCrashSectionCallable("Texture object class", () -> textureObjf.getClass().getName()); + throw new ReportedException(crashreport); + } + + this.mapTextureObjects.put(textureLocation, (ITextureObject)textureObj); + return true; + } + + public ITextureObject getTexture(ResourceLocation textureLocation) + { + return (ITextureObject)this.mapTextureObjects.get(textureLocation); + } + + public ResourceLocation getDynamicTextureLocation(String name, DynamicTexture texture) + { + if (name.equals("logo")) + { + texture = Config.getMojangLogoTexture(texture); + } + + Integer integer = (Integer)this.mapTextureCounters.get(name); + + if (integer == null) + { + integer = Integer.valueOf(1); + } + else + { + integer = Integer.valueOf(integer.intValue() + 1); + } + + this.mapTextureCounters.put(name, integer); + ResourceLocation resourcelocation = new ResourceLocation(String.format("dynamic/%s_%d", new Object[] {name, integer})); + this.loadTexture(resourcelocation, texture); + return resourcelocation; + } + + public void tick() + { + for (ITickable itickable : this.listTickables) + { + itickable.tick(); + } + } + + public void deleteTexture(ResourceLocation textureLocation) + { + ITextureObject itextureobject = this.getTexture(textureLocation); + + if (itextureobject != null) + { + this.mapTextureObjects.remove(textureLocation); + TextureUtil.deleteTexture(itextureobject.getGlTextureId()); + } + } + + public void onResourceManagerReload(IResourceManager resourceManager) + { + Config.dbg("*** Reloading textures ***"); + Config.log("Resource packs: " + Config.getResourcePackNames()); + Iterator iterator = this.mapTextureObjects.keySet().iterator(); + + while (iterator.hasNext()) + { + ResourceLocation resourcelocation = (ResourceLocation)iterator.next(); + String s = resourcelocation.getResourcePath(); + + if (s.startsWith("mcpatcher/") || s.startsWith("optifine/") || EmissiveTextures.isEmissive(resourcelocation)) + { + ITextureObject itextureobject = (ITextureObject)this.mapTextureObjects.get(resourcelocation); + + if (itextureobject instanceof AbstractTexture) + { + AbstractTexture abstracttexture = (AbstractTexture)itextureobject; + abstracttexture.deleteGlTexture(); + } + + iterator.remove(); + } + } + + EmissiveTextures.update(); + + for (Object e : new HashSet(this.mapTextureObjects.entrySet())) + { + Entry entry = (Entry) e; + this.loadTexture((ResourceLocation)entry.getKey(), (ITextureObject)entry.getValue()); + } + } + + public void reloadBannerTextures() + { + for (Object e : new HashSet(this.mapTextureObjects.entrySet())) + { + Entry entry = (Entry) e; + ResourceLocation resourcelocation = (ResourceLocation)entry.getKey(); + ITextureObject itextureobject = (ITextureObject)entry.getValue(); + + if (itextureobject instanceof LayeredColorMaskTexture) + { + this.loadTexture(resourcelocation, itextureobject); + } + } + } + + public ITextureObject getBoundTexture() + { + return this.boundTexture; + } + + public ResourceLocation getBoundTextureLocation() + { + return this.boundTextureLocation; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureManage~ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureManage~ new file mode 100644 index 0000000..807d847 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureManage~ @@ -0,0 +1,194 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.ITickable; +import net.minecraft.client.renderer.texture.ITickableTextureObject; +import net.minecraft.client.renderer.texture.LayeredColorMaskTexture; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomGuis; +import net.optifine.EmissiveTextures; +import net.optifine.RandomEntities; +import net.optifine.shaders.ShadersTex; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class TextureManager implements ITickable, IResourceManagerReloadListener { + private static final Logger field_147646_a = LogManager.getLogger(); + private final Map field_110585_a = Maps.newHashMap(); + private final List field_110583_b = Lists.newArrayList(); + private final Map field_110584_c = Maps.newHashMap(); + private IResourceManager field_110582_d; + private ITextureObject boundTexture; + private ResourceLocation boundTextureLocation; + + public TextureManager(IResourceManager p_i1284_1_) { + this.field_110582_d = p_i1284_1_; + } + + public void func_110577_a(ResourceLocation p_110577_1_) { + if(Config.isRandomEntities()) { + p_110577_1_ = RandomEntities.getTextureLocation(p_110577_1_); + } + + if(Config.isCustomGuis()) { + p_110577_1_ = CustomGuis.getTextureLocation(p_110577_1_); + } + + ITextureObject itextureobject = (ITextureObject)this.field_110585_a.get(p_110577_1_); + if(EmissiveTextures.isActive()) { + itextureobject = EmissiveTextures.getEmissiveTexture(itextureobject, this.field_110585_a); + } + + if(itextureobject == null) { + itextureobject = new SimpleTexture(p_110577_1_); + this.func_110579_a(p_110577_1_, itextureobject); + } + + if(Config.isShaders()) { + ShadersTex.bindTexture(itextureobject); + } else { + TextureUtil.func_94277_a(itextureobject.func_110552_b()); + } + + this.boundTexture = itextureobject; + this.boundTextureLocation = p_110577_1_; + } + + public boolean func_110580_a(ResourceLocation p_110580_1_, ITickableTextureObject p_110580_2_) { + if(this.func_110579_a(p_110580_1_, p_110580_2_)) { + this.field_110583_b.add(p_110580_2_); + return true; + } else { + return false; + } + } + + public boolean func_110579_a(ResourceLocation p_110579_1_, final ITextureObject p_110579_2_) { + boolean flag = true; + + try { + ((ITextureObject)p_110579_2_).func_110551_a(this.field_110582_d); + } catch (IOException ioexception) { + field_147646_a.warn((String)("Failed to load texture: " + p_110579_1_), (Throwable)ioexception); + p_110579_2_ = TextureUtil.field_111001_a; + this.field_110585_a.put(p_110579_1_, (ITextureObject)p_110579_2_); + flag = false; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.func_85055_a(throwable, "Registering texture"); + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Resource location being registered"); + crashreportcategory.func_71507_a("Resource location", p_110579_1_); + crashreportcategory.func_71500_a("Texture object class", new Callable() { + public String call() throws Exception { + return p_110579_2_.getClass().getName(); + } + }); + throw new ReportedException(crashreport); + } + + this.field_110585_a.put(p_110579_1_, (ITextureObject)p_110579_2_); + return flag; + } + + public ITextureObject func_110581_b(ResourceLocation p_110581_1_) { + return (ITextureObject)this.field_110585_a.get(p_110581_1_); + } + + public ResourceLocation func_110578_a(String p_110578_1_, DynamicTexture p_110578_2_) { + if(p_110578_1_.equals("logo")) { + p_110578_2_ = Config.getMojangLogoTexture(p_110578_2_); + } + + Integer integer = (Integer)this.field_110584_c.get(p_110578_1_); + if(integer == null) { + integer = Integer.valueOf(1); + } else { + integer = Integer.valueOf(integer.intValue() + 1); + } + + this.field_110584_c.put(p_110578_1_, integer); + ResourceLocation resourcelocation = new ResourceLocation(String.format("dynamic/%s_%d", new Object[]{p_110578_1_, integer})); + this.func_110579_a(resourcelocation, p_110578_2_); + return resourcelocation; + } + + public void func_110550_d() { + for(ITickable itickable : this.field_110583_b) { + itickable.func_110550_d(); + } + + } + + public void func_147645_c(ResourceLocation p_147645_1_) { + ITextureObject itextureobject = this.func_110581_b(p_147645_1_); + if(itextureobject != null) { + this.field_110585_a.remove(p_147645_1_); + TextureUtil.func_147942_a(itextureobject.func_110552_b()); + } + + } + + public void func_110549_a(IResourceManager p_110549_1_) { + Config.dbg("*** Reloading textures ***"); + Config.log("Resource packs: " + Config.getResourcePackNames()); + Iterator iterator = this.field_110585_a.keySet().iterator(); + + while(iterator.hasNext()) { + ResourceLocation resourcelocation = (ResourceLocation)iterator.next(); + String s = resourcelocation.func_110623_a(); + if(s.startsWith("mcpatcher/") || s.startsWith("optifine/") || EmissiveTextures.isEmissive(resourcelocation)) { + ITextureObject itextureobject = (ITextureObject)this.field_110585_a.get(resourcelocation); + if(itextureobject instanceof AbstractTexture) { + AbstractTexture abstracttexture = (AbstractTexture)itextureobject; + abstracttexture.func_147631_c(); + } + + iterator.remove(); + } + } + + EmissiveTextures.update(); + + for(Entry entry : new HashSet(this.field_110585_a.entrySet())) { + this.func_110579_a((ResourceLocation)entry.getKey(), (ITextureObject)entry.getValue()); + } + + } + + public void reloadBannerTextures() { + for(Entry entry : new HashSet(this.field_110585_a.entrySet())) { + ResourceLocation resourcelocation = (ResourceLocation)entry.getKey(); + ITextureObject itextureobject = (ITextureObject)entry.getValue(); + if(itextureobject instanceof LayeredColorMaskTexture) { + this.func_110579_a(resourcelocation, itextureobject); + } + } + + } + + public ITextureObject getBoundTexture() { + return this.boundTexture; + } + + public ResourceLocation getBoundTextureLocation() { + return this.boundTextureLocation; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java new file mode 100644 index 0000000..8f65c9c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java @@ -0,0 +1,989 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.awt.Dimension; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.StitcherException; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.optifine.BetterGrass; +import net.optifine.ConnectedTextures; +import net.optifine.CustomItems; +import net.optifine.EmissiveTextures; +import net.optifine.SmartAnimations; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.shaders.ShadersTex; +import net.optifine.util.CounterInt; +import net.optifine.util.TextureUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class TextureMap extends AbstractTexture implements ITickableTextureObject +{ + private static final boolean ENABLE_SKIP = Boolean.parseBoolean(System.getProperty("fml.skipFirstTextureLoad", "true")); + private static final Logger logger = LogManager.getLogger(); + public static final ResourceLocation LOCATION_MISSING_TEXTURE = new ResourceLocation("missingno"); + public static final ResourceLocation locationBlocksTexture = new ResourceLocation("textures/atlas/blocks.png"); + private final List listAnimatedSprites; + private final Map mapRegisteredSprites; + private final Map mapUploadedSprites; + private final String basePath; + private final IIconCreator iconCreator; + private int mipmapLevels; + private final TextureAtlasSprite missingImage; + private boolean skipFirst; + private TextureAtlasSprite[] iconGrid; + private int iconGridSize; + private int iconGridCountX; + private int iconGridCountY; + private double iconGridSizeU; + private double iconGridSizeV; + private CounterInt counterIndexInMap; + public int atlasWidth; + public int atlasHeight; + private int countAnimationsActive; + private int frameCountAnimations; + + public TextureMap(String p_i46099_1_) + { + this(p_i46099_1_, (IIconCreator)null); + } + + public TextureMap(String p_i5_1_, boolean p_i5_2_) + { + this(p_i5_1_, (IIconCreator)null, p_i5_2_); + } + + public TextureMap(String p_i46100_1_, IIconCreator iconCreatorIn) + { + this(p_i46100_1_, iconCreatorIn, false); + } + + public TextureMap(String p_i6_1_, IIconCreator p_i6_2_, boolean p_i6_3_) + { + this.skipFirst = false; + this.iconGrid = null; + this.iconGridSize = -1; + this.iconGridCountX = -1; + this.iconGridCountY = -1; + this.iconGridSizeU = -1.0D; + this.iconGridSizeV = -1.0D; + this.counterIndexInMap = new CounterInt(0); + this.atlasWidth = 0; + this.atlasHeight = 0; + this.listAnimatedSprites = Lists.newArrayList(); + this.mapRegisteredSprites = Maps.newHashMap(); + this.mapUploadedSprites = Maps.newHashMap(); + this.missingImage = new TextureAtlasSprite("missingno"); + this.basePath = p_i6_1_; + this.iconCreator = p_i6_2_; + this.skipFirst = p_i6_3_ && ENABLE_SKIP; + } + + private void initMissingImage() + { + int i = this.getMinSpriteSize(); + int[] aint = this.getMissingImageData(i); + this.missingImage.setIconWidth(i); + this.missingImage.setIconHeight(i); + int[][] aint1 = new int[this.mipmapLevels + 1][]; + aint1[0] = aint; + this.missingImage.setFramesTextureData(Lists.newArrayList(new int[][][] {aint1})); + this.missingImage.setIndexInMap(this.counterIndexInMap.nextValue()); + } + + public void loadTexture(IResourceManager resourceManager) throws IOException + { + if (this.iconCreator != null) + { + this.loadSprites(resourceManager, this.iconCreator); + } + } + + public void loadSprites(IResourceManager resourceManager, IIconCreator p_174943_2_) + { + this.mapRegisteredSprites.clear(); + this.counterIndexInMap.reset(); + p_174943_2_.registerSprites(this); + + if (this.mipmapLevels >= 4) + { + this.mipmapLevels = this.detectMaxMipmapLevel(this.mapRegisteredSprites, resourceManager); + Config.log("Mipmap levels: " + this.mipmapLevels); + } + + this.initMissingImage(); + this.deleteGlTexture(); + this.loadTextureAtlas(resourceManager); + } + + public void loadTextureAtlas(IResourceManager resourceManager) + { + Config.dbg("Multitexture: " + Config.isMultiTexture()); + + if (Config.isMultiTexture()) + { + for (TextureAtlasSprite textureatlassprite : this.mapUploadedSprites.values()) + { + textureatlassprite.deleteSpriteTexture(); + } + } + + ConnectedTextures.updateIcons(this); + CustomItems.updateIcons(this); + BetterGrass.updateIcons(this); + int i2 = TextureUtils.getGLMaximumTextureSize(); + Stitcher stitcher = new Stitcher(i2, i2, true, 0, this.mipmapLevels); + this.mapUploadedSprites.clear(); + this.listAnimatedSprites.clear(); + int i = Integer.MAX_VALUE; + Reflector.callVoid(Reflector.ForgeHooksClient_onTextureStitchedPre, new Object[] {this}); + int j = this.getMinSpriteSize(); + this.iconGridSize = j; + int k = 1 << this.mipmapLevels; + int l = 0; + int i1 = 0; + Iterator iterator = this.mapRegisteredSprites.entrySet().iterator(); + + while (true) + { + if (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (!this.skipFirst) + { + TextureAtlasSprite textureatlassprite3 = (TextureAtlasSprite)entry.getValue(); + ResourceLocation resourcelocation1 = new ResourceLocation(textureatlassprite3.getIconName()); + ResourceLocation resourcelocation2 = this.completeResourceLocation(resourcelocation1, 0); + textureatlassprite3.updateIndexInMap(this.counterIndexInMap); + + if (textureatlassprite3.hasCustomLoader(resourceManager, resourcelocation1)) + { + if (!textureatlassprite3.load(resourceManager, resourcelocation1)) + { + i = Math.min(i, Math.min(textureatlassprite3.getIconWidth(), textureatlassprite3.getIconHeight())); + stitcher.addSprite(textureatlassprite3); + Config.detail("Custom loader (skipped): " + textureatlassprite3); + ++i1; + } + + Config.detail("Custom loader: " + textureatlassprite3); + ++l; + continue; + } + + try + { + IResource iresource = resourceManager.getResource(resourcelocation2); + BufferedImage[] abufferedimage = new BufferedImage[1 + this.mipmapLevels]; + abufferedimage[0] = TextureUtil.readBufferedImage(iresource.getInputStream()); + int k3 = abufferedimage[0].getWidth(); + int l3 = abufferedimage[0].getHeight(); + + if (k3 < 1 || l3 < 1) + { + Config.warn("Invalid sprite size: " + textureatlassprite3); + continue; + } + + if (k3 < j || this.mipmapLevels > 0) + { + int i4 = this.mipmapLevels > 0 ? TextureUtils.scaleToGrid(k3, j) : TextureUtils.scaleToMin(k3, j); + + if (i4 != k3) + { + if (!TextureUtils.isPowerOfTwo(k3)) + { + Config.log("Scaled non power of 2: " + textureatlassprite3.getIconName() + ", " + k3 + " -> " + i4); + } + else + { + Config.log("Scaled too small texture: " + textureatlassprite3.getIconName() + ", " + k3 + " -> " + i4); + } + + int j1 = l3 * i4 / k3; + abufferedimage[0] = TextureUtils.scaleImage(abufferedimage[0], i4); + } + } + + TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture"); + + if (texturemetadatasection != null) + { + List list1 = texturemetadatasection.getListMipmaps(); + + if (!list1.isEmpty()) + { + int k1 = abufferedimage[0].getWidth(); + int l1 = abufferedimage[0].getHeight(); + + if (MathHelper.roundUpToPowerOfTwo(k1) != k1 || MathHelper.roundUpToPowerOfTwo(l1) != l1) + { + throw new RuntimeException("Unable to load extra miplevels, source-texture is not power of two"); + } + } + + Iterator iterator1 = list1.iterator(); + + while (iterator1.hasNext()) + { + int j4 = ((Integer)iterator1.next()).intValue(); + + if (j4 > 0 && j4 < abufferedimage.length - 1 && abufferedimage[j4] == null) + { + ResourceLocation resourcelocation = this.completeResourceLocation(resourcelocation1, j4); + + try + { + abufferedimage[j4] = TextureUtil.readBufferedImage(resourceManager.getResource(resourcelocation).getInputStream()); + } + catch (IOException ioexception) + { + logger.error("Unable to load miplevel {} from: {}", new Object[] {Integer.valueOf(j4), resourcelocation, ioexception}); + } + } + } + } + + AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)iresource.getMetadata("animation"); + textureatlassprite3.loadSprite(abufferedimage, animationmetadatasection); + } + catch (RuntimeException runtimeexception) + { + logger.error((String)("Unable to parse metadata from " + resourcelocation2), (Throwable)runtimeexception); + ReflectorForge.FMLClientHandler_trackBrokenTexture(resourcelocation2, runtimeexception.getMessage()); + continue; + } + catch (IOException ioexception1) + { + logger.error("Using missing texture, unable to load " + resourcelocation2 + ", " + ioexception1.getClass().getName()); + ReflectorForge.FMLClientHandler_trackMissingTexture(resourcelocation2); + continue; + } + + i = Math.min(i, Math.min(textureatlassprite3.getIconWidth(), textureatlassprite3.getIconHeight())); + int j3 = Math.min(Integer.lowestOneBit(textureatlassprite3.getIconWidth()), Integer.lowestOneBit(textureatlassprite3.getIconHeight())); + + if (j3 < k) + { + logger.warn("Texture {} with size {}x{} limits mip level from {} to {}", new Object[] {resourcelocation2, Integer.valueOf(textureatlassprite3.getIconWidth()), Integer.valueOf(textureatlassprite3.getIconHeight()), Integer.valueOf(MathHelper.calculateLogBaseTwo(k)), Integer.valueOf(MathHelper.calculateLogBaseTwo(j3))}); + k = j3; + } + + stitcher.addSprite(textureatlassprite3); + continue; + } + } + + if (l > 0) + { + Config.dbg("Custom loader sprites: " + l); + } + + if (i1 > 0) + { + Config.dbg("Custom loader sprites (skipped): " + i1); + } + + int j2 = Math.min(i, k); + int k2 = MathHelper.calculateLogBaseTwo(j2); + + if (k2 < 0) + { + k2 = 0; + } + + if (k2 < this.mipmapLevels) + { + logger.warn("{}: dropping miplevel from {} to {}, because of minimum power of two: {}", new Object[] {this.basePath, Integer.valueOf(this.mipmapLevels), Integer.valueOf(k2), Integer.valueOf(j2)}); + this.mipmapLevels = k2; + } + + for (final TextureAtlasSprite textureatlassprite1 : this.mapRegisteredSprites.values()) + { + if (this.skipFirst) + { + break; + } + + try + { + textureatlassprite1.generateMipmaps(this.mipmapLevels); + } + catch (Throwable throwable1) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Applying mipmap"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Sprite being mipmapped"); + crashreportcategory.addCrashSectionCallable("Sprite name", new Callable() + { + public String call() throws Exception + { + return textureatlassprite1.getIconName(); + } + }); + crashreportcategory.addCrashSectionCallable("Sprite size", new Callable() + { + public String call() throws Exception + { + return textureatlassprite1.getIconWidth() + " x " + textureatlassprite1.getIconHeight(); + } + }); + crashreportcategory.addCrashSectionCallable("Sprite frames", new Callable() + { + public String call() throws Exception + { + return textureatlassprite1.getFrameCount() + " frames"; + } + }); + crashreportcategory.addCrashSection("Mipmap levels", Integer.valueOf(this.mipmapLevels)); + throw new ReportedException(crashreport); + } + } + + this.missingImage.generateMipmaps(this.mipmapLevels); + stitcher.addSprite(this.missingImage); + this.skipFirst = false; + + try + { + stitcher.doStitch(); + } + catch (StitcherException stitcherexception) + { + throw stitcherexception; + } + + logger.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.getCurrentWidth()), Integer.valueOf(stitcher.getCurrentHeight()), this.basePath}); + + if (Config.isShaders()) + { + ShadersTex.allocateTextureMap(this.getGlTextureId(), this.mipmapLevels, stitcher.getCurrentWidth(), stitcher.getCurrentHeight(), stitcher, this); + } + else + { + TextureUtil.allocateTextureImpl(this.getGlTextureId(), this.mipmapLevels, stitcher.getCurrentWidth(), stitcher.getCurrentHeight()); + } + + Map map = Maps.newHashMap(this.mapRegisteredSprites); + + for (TextureAtlasSprite textureatlassprite2 : stitcher.getStichSlots()) + { + String s = textureatlassprite2.getIconName(); + map.remove(s); + this.mapUploadedSprites.put(s, textureatlassprite2); + + try + { + if (Config.isShaders()) + { + ShadersTex.uploadTexSubForLoadAtlas(this, textureatlassprite2.getIconName(), textureatlassprite2.getFrameTextureData(0), textureatlassprite2.getIconWidth(), textureatlassprite2.getIconHeight(), textureatlassprite2.getOriginX(), textureatlassprite2.getOriginY(), false, false); + } + else + { + TextureUtil.uploadTextureMipmap(textureatlassprite2.getFrameTextureData(0), textureatlassprite2.getIconWidth(), textureatlassprite2.getIconHeight(), textureatlassprite2.getOriginX(), textureatlassprite2.getOriginY(), false, false); + } + } + catch (Throwable throwable) + { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Stitching texture atlas"); + CrashReportCategory crashreportcategory1 = crashreport1.makeCategory("Texture being stitched together"); + crashreportcategory1.addCrashSection("Atlas path", this.basePath); + crashreportcategory1.addCrashSection("Sprite", textureatlassprite2); + throw new ReportedException(crashreport1); + } + + if (textureatlassprite2.hasAnimationMetadata()) + { + textureatlassprite2.setAnimationIndex(this.listAnimatedSprites.size()); + this.listAnimatedSprites.add(textureatlassprite2); + } + } + + for (TextureAtlasSprite textureatlassprite4 : map.values()) + { + textureatlassprite4.copyFrom(this.missingImage); + } + + Config.log("Animated sprites: " + this.listAnimatedSprites.size()); + + if (Config.isMultiTexture()) + { + int l2 = stitcher.getCurrentWidth(); + int i3 = stitcher.getCurrentHeight(); + + for (TextureAtlasSprite textureatlassprite5 : stitcher.getStichSlots()) + { + textureatlassprite5.sheetWidth = l2; + textureatlassprite5.sheetHeight = i3; + textureatlassprite5.mipmapLevels = this.mipmapLevels; + TextureAtlasSprite textureatlassprite6 = textureatlassprite5.spriteSingle; + + if (textureatlassprite6 != null) + { + if (textureatlassprite6.getIconWidth() <= 0) + { + textureatlassprite6.setIconWidth(textureatlassprite5.getIconWidth()); + textureatlassprite6.setIconHeight(textureatlassprite5.getIconHeight()); + textureatlassprite6.initSprite(textureatlassprite5.getIconWidth(), textureatlassprite5.getIconHeight(), 0, 0, false); + textureatlassprite6.clearFramesTextureData(); + List list = textureatlassprite5.getFramesTextureData(); + textureatlassprite6.setFramesTextureData(list); + textureatlassprite6.setAnimationMetadata(textureatlassprite5.getAnimationMetadata()); + } + + textureatlassprite6.sheetWidth = l2; + textureatlassprite6.sheetHeight = i3; + textureatlassprite6.mipmapLevels = this.mipmapLevels; + textureatlassprite6.setAnimationIndex(textureatlassprite5.getAnimationIndex()); + textureatlassprite5.bindSpriteTexture(); + boolean flag1 = false; + boolean flag = true; + + try + { + TextureUtil.uploadTextureMipmap(textureatlassprite6.getFrameTextureData(0), textureatlassprite6.getIconWidth(), textureatlassprite6.getIconHeight(), textureatlassprite6.getOriginX(), textureatlassprite6.getOriginY(), flag1, flag); + } + catch (Exception exception) + { + Config.dbg("Error uploading sprite single: " + textureatlassprite6 + ", parent: " + textureatlassprite5); + exception.printStackTrace(); + } + } + } + + Config.getMinecraft().getTextureManager().bindTexture(locationBlocksTexture); + } + + Reflector.callVoid(Reflector.ForgeHooksClient_onTextureStitchedPost, new Object[] {this}); + this.updateIconGrid(stitcher.getCurrentWidth(), stitcher.getCurrentHeight()); + + if (Config.equals(System.getProperty("saveTextureMap"), "true")) + { + Config.dbg("Exporting texture map: " + this.basePath); + TextureUtils.saveGlTexture("debug/" + this.basePath.replaceAll("/", "_"), this.getGlTextureId(), this.mipmapLevels, stitcher.getCurrentWidth(), stitcher.getCurrentHeight()); + } + + return; + } + } + + public ResourceLocation completeResourceLocation(ResourceLocation p_completeResourceLocation_1_) + { + return this.completeResourceLocation(p_completeResourceLocation_1_, 0); + } + + public ResourceLocation completeResourceLocation(ResourceLocation location, int p_147634_2_) + { + return this.isAbsoluteLocation(location) ? new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + ".png") : (p_147634_2_ == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", new Object[] {this.basePath, location.getResourcePath(), ".png"})): new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", new Object[] {this.basePath, location.getResourcePath(), Integer.valueOf(p_147634_2_), ".png"}))); + } + + public TextureAtlasSprite getAtlasSprite(String iconName) + { + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.mapUploadedSprites.get(iconName); + + if (textureatlassprite == null) + { + textureatlassprite = this.missingImage; + } + + return textureatlassprite; + } + + public void updateAnimations() + { + boolean flag = false; + boolean flag1 = false; + TextureUtil.bindTexture(this.getGlTextureId()); + int i = 0; + + for (TextureAtlasSprite textureatlassprite : this.listAnimatedSprites) + { + if (this.isTerrainAnimationActive(textureatlassprite)) + { + textureatlassprite.updateAnimation(); + + if (textureatlassprite.isAnimationActive()) + { + ++i; + } + + if (textureatlassprite.spriteNormal != null) + { + flag = true; + } + + if (textureatlassprite.spriteSpecular != null) + { + flag1 = true; + } + } + } + + if (Config.isMultiTexture()) + { + for (TextureAtlasSprite textureatlassprite2 : this.listAnimatedSprites) + { + if (this.isTerrainAnimationActive(textureatlassprite2)) + { + TextureAtlasSprite textureatlassprite1 = textureatlassprite2.spriteSingle; + + if (textureatlassprite1 != null) + { + if (textureatlassprite2 == TextureUtils.iconClock || textureatlassprite2 == TextureUtils.iconCompass) + { + textureatlassprite1.frameCounter = textureatlassprite2.frameCounter; + } + + textureatlassprite2.bindSpriteTexture(); + textureatlassprite1.updateAnimation(); + + if (textureatlassprite1.isAnimationActive()) + { + ++i; + } + } + } + } + + TextureUtil.bindTexture(this.getGlTextureId()); + } + + if (Config.isShaders()) + { + if (flag) + { + TextureUtil.bindTexture(this.getMultiTexID().norm); + + for (TextureAtlasSprite textureatlassprite3 : this.listAnimatedSprites) + { + if (textureatlassprite3.spriteNormal != null && this.isTerrainAnimationActive(textureatlassprite3)) + { + if (textureatlassprite3 == TextureUtils.iconClock || textureatlassprite3 == TextureUtils.iconCompass) + { + textureatlassprite3.spriteNormal.frameCounter = textureatlassprite3.frameCounter; + } + + textureatlassprite3.spriteNormal.updateAnimation(); + + if (textureatlassprite3.spriteNormal.isAnimationActive()) + { + ++i; + } + } + } + } + + if (flag1) + { + TextureUtil.bindTexture(this.getMultiTexID().spec); + + for (TextureAtlasSprite textureatlassprite4 : this.listAnimatedSprites) + { + if (textureatlassprite4.spriteSpecular != null && this.isTerrainAnimationActive(textureatlassprite4)) + { + if (textureatlassprite4 == TextureUtils.iconClock || textureatlassprite4 == TextureUtils.iconCompass) + { + textureatlassprite4.spriteNormal.frameCounter = textureatlassprite4.frameCounter; + } + + textureatlassprite4.spriteSpecular.updateAnimation(); + + if (textureatlassprite4.spriteSpecular.isAnimationActive()) + { + ++i; + } + } + } + } + + if (flag || flag1) + { + TextureUtil.bindTexture(this.getGlTextureId()); + } + } + + int j = Config.getMinecraft().entityRenderer.frameCount; + + if (j != this.frameCountAnimations) + { + this.countAnimationsActive = i; + this.frameCountAnimations = j; + } + + if (SmartAnimations.isActive()) + { + SmartAnimations.resetSpritesRendered(); + } + } + + public TextureAtlasSprite registerSprite(ResourceLocation location) + { + if (location == null) + { + throw new IllegalArgumentException("Location cannot be null!"); + } + else + { + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.mapRegisteredSprites.get(location.toString()); + + if (textureatlassprite == null) + { + textureatlassprite = TextureAtlasSprite.makeAtlasSprite(location); + this.mapRegisteredSprites.put(location.toString(), textureatlassprite); + textureatlassprite.updateIndexInMap(this.counterIndexInMap); + + if (Config.isEmissiveTextures()) + { + this.checkEmissive(location, textureatlassprite); + } + } + + return textureatlassprite; + } + } + + public void tick() + { + this.updateAnimations(); + } + + public void setMipmapLevels(int mipmapLevelsIn) + { + this.mipmapLevels = mipmapLevelsIn; + } + + public TextureAtlasSprite getMissingSprite() + { + return this.missingImage; + } + + public TextureAtlasSprite getTextureExtry(String p_getTextureExtry_1_) + { + return (TextureAtlasSprite)this.mapRegisteredSprites.get(p_getTextureExtry_1_); + } + + public boolean setTextureEntry(String p_setTextureEntry_1_, TextureAtlasSprite p_setTextureEntry_2_) + { + if (!this.mapRegisteredSprites.containsKey(p_setTextureEntry_1_)) + { + this.mapRegisteredSprites.put(p_setTextureEntry_1_, p_setTextureEntry_2_); + p_setTextureEntry_2_.updateIndexInMap(this.counterIndexInMap); + return true; + } + else + { + return false; + } + } + + public boolean setTextureEntry(TextureAtlasSprite p_setTextureEntry_1_) + { + return this.setTextureEntry(p_setTextureEntry_1_.getIconName(), p_setTextureEntry_1_); + } + + public String getBasePath() + { + return this.basePath; + } + + public int getMipmapLevels() + { + return this.mipmapLevels; + } + + private boolean isAbsoluteLocation(ResourceLocation p_isAbsoluteLocation_1_) + { + String s = p_isAbsoluteLocation_1_.getResourcePath(); + return this.isAbsoluteLocationPath(s); + } + + private boolean isAbsoluteLocationPath(String p_isAbsoluteLocationPath_1_) + { + String s = p_isAbsoluteLocationPath_1_.toLowerCase(); + return s.startsWith("mcpatcher/") || s.startsWith("optifine/"); + } + + public TextureAtlasSprite getSpriteSafe(String p_getSpriteSafe_1_) + { + ResourceLocation resourcelocation = new ResourceLocation(p_getSpriteSafe_1_); + return (TextureAtlasSprite)this.mapRegisteredSprites.get(resourcelocation.toString()); + } + + public TextureAtlasSprite getRegisteredSprite(ResourceLocation p_getRegisteredSprite_1_) + { + return (TextureAtlasSprite)this.mapRegisteredSprites.get(p_getRegisteredSprite_1_.toString()); + } + + private boolean isTerrainAnimationActive(TextureAtlasSprite p_isTerrainAnimationActive_1_) + { + return p_isTerrainAnimationActive_1_ != TextureUtils.iconWaterStill && p_isTerrainAnimationActive_1_ != TextureUtils.iconWaterFlow ? (p_isTerrainAnimationActive_1_ != TextureUtils.iconLavaStill && p_isTerrainAnimationActive_1_ != TextureUtils.iconLavaFlow ? (p_isTerrainAnimationActive_1_ != TextureUtils.iconFireLayer0 && p_isTerrainAnimationActive_1_ != TextureUtils.iconFireLayer1 ? (p_isTerrainAnimationActive_1_ == TextureUtils.iconPortal ? Config.isAnimatedPortal() : (p_isTerrainAnimationActive_1_ != TextureUtils.iconClock && p_isTerrainAnimationActive_1_ != TextureUtils.iconCompass ? Config.isAnimatedTerrain() : true)) : Config.isAnimatedFire()) : Config.isAnimatedLava()) : Config.isAnimatedWater(); + } + + public int getCountRegisteredSprites() + { + return this.counterIndexInMap.getValue(); + } + + private int detectMaxMipmapLevel(Map p_detectMaxMipmapLevel_1_, IResourceManager p_detectMaxMipmapLevel_2_) + { + int i = this.detectMinimumSpriteSize(p_detectMaxMipmapLevel_1_, p_detectMaxMipmapLevel_2_, 20); + + if (i < 16) + { + i = 16; + } + + i = MathHelper.roundUpToPowerOfTwo(i); + + if (i > 16) + { + Config.log("Sprite size: " + i); + } + + int j = MathHelper.calculateLogBaseTwo(i); + + if (j < 4) + { + j = 4; + } + + return j; + } + + private int detectMinimumSpriteSize(Map p_detectMinimumSpriteSize_1_, IResourceManager p_detectMinimumSpriteSize_2_, int p_detectMinimumSpriteSize_3_) + { + Map map = new HashMap(); + + for (Object entry0 : p_detectMinimumSpriteSize_1_.entrySet()) + { + Entry entry = (Entry) entry0; + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue(); + ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.getIconName()); + ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation); + + if (!textureatlassprite.hasCustomLoader(p_detectMinimumSpriteSize_2_, resourcelocation)) + { + try + { + IResource iresource = p_detectMinimumSpriteSize_2_.getResource(resourcelocation1); + + if (iresource != null) + { + InputStream inputstream = iresource.getInputStream(); + + if (inputstream != null) + { + Dimension dimension = TextureUtils.getImageSize(inputstream, "png"); + inputstream.close(); + + if (dimension != null) + { + int i = dimension.width; + int j = MathHelper.roundUpToPowerOfTwo(i); + + if (!map.containsKey(Integer.valueOf(j))) + { + map.put(Integer.valueOf(j), Integer.valueOf(1)); + } + else + { + int k = ((Integer)map.get(Integer.valueOf(j))).intValue(); + map.put(Integer.valueOf(j), Integer.valueOf(k + 1)); + } + } + } + } + } + catch (Exception var17) + { + ; + } + } + } + + int l = 0; + Set set = map.keySet(); + Set set1 = new TreeSet(set); + int l1; + + for (Iterator iterator = set1.iterator(); iterator.hasNext(); l += l1) + { + int j1 = ((Integer)iterator.next()).intValue(); + l1 = ((Integer)map.get(Integer.valueOf(j1))).intValue(); + } + + int i1 = 16; + int k1 = 0; + l1 = l * p_detectMinimumSpriteSize_3_ / 100; + Iterator iterator1 = set1.iterator(); + + while (iterator1.hasNext()) + { + int i2 = ((Integer)iterator1.next()).intValue(); + int j2 = ((Integer)map.get(Integer.valueOf(i2))).intValue(); + k1 += j2; + + if (i2 > i1) + { + i1 = i2; + } + + if (k1 > l1) + { + return i1; + } + } + + return i1; + } + + private int getMinSpriteSize() + { + int i = 1 << this.mipmapLevels; + + if (i < 8) + { + i = 8; + } + + return i; + } + + private int[] getMissingImageData(int p_getMissingImageData_1_) + { + BufferedImage bufferedimage = new BufferedImage(16, 16, 2); + bufferedimage.setRGB(0, 0, 16, 16, TextureUtil.missingTextureData, 0, 16); + BufferedImage bufferedimage1 = TextureUtils.scaleImage(bufferedimage, p_getMissingImageData_1_); + int[] aint = new int[p_getMissingImageData_1_ * p_getMissingImageData_1_]; + bufferedimage1.getRGB(0, 0, p_getMissingImageData_1_, p_getMissingImageData_1_, aint, 0, p_getMissingImageData_1_); + return aint; + } + + public boolean isTextureBound() + { + int i = GlStateManager.getBoundTexture(); + int j = this.getGlTextureId(); + return i == j; + } + + private void updateIconGrid(int p_updateIconGrid_1_, int p_updateIconGrid_2_) + { + this.iconGridCountX = -1; + this.iconGridCountY = -1; + this.iconGrid = null; + + if (this.iconGridSize > 0) + { + this.iconGridCountX = p_updateIconGrid_1_ / this.iconGridSize; + this.iconGridCountY = p_updateIconGrid_2_ / this.iconGridSize; + this.iconGrid = new TextureAtlasSprite[this.iconGridCountX * this.iconGridCountY]; + this.iconGridSizeU = 1.0D / (double)this.iconGridCountX; + this.iconGridSizeV = 1.0D / (double)this.iconGridCountY; + + for (TextureAtlasSprite textureatlassprite : this.mapUploadedSprites.values()) + { + double d0 = 0.5D / (double)p_updateIconGrid_1_; + double d1 = 0.5D / (double)p_updateIconGrid_2_; + double d2 = (double)Math.min(textureatlassprite.getMinU(), textureatlassprite.getMaxU()) + d0; + double d3 = (double)Math.min(textureatlassprite.getMinV(), textureatlassprite.getMaxV()) + d1; + double d4 = (double)Math.max(textureatlassprite.getMinU(), textureatlassprite.getMaxU()) - d0; + double d5 = (double)Math.max(textureatlassprite.getMinV(), textureatlassprite.getMaxV()) - d1; + int i = (int)(d2 / this.iconGridSizeU); + int j = (int)(d3 / this.iconGridSizeV); + int k = (int)(d4 / this.iconGridSizeU); + int l = (int)(d5 / this.iconGridSizeV); + + for (int i1 = i; i1 <= k; ++i1) + { + if (i1 >= 0 && i1 < this.iconGridCountX) + { + for (int j1 = j; j1 <= l; ++j1) + { + if (j1 >= 0 && j1 < this.iconGridCountX) + { + int k1 = j1 * this.iconGridCountX + i1; + this.iconGrid[k1] = textureatlassprite; + } + else + { + Config.warn("Invalid grid V: " + j1 + ", icon: " + textureatlassprite.getIconName()); + } + } + } + else + { + Config.warn("Invalid grid U: " + i1 + ", icon: " + textureatlassprite.getIconName()); + } + } + } + } + } + + public TextureAtlasSprite getIconByUV(double p_getIconByUV_1_, double p_getIconByUV_3_) + { + if (this.iconGrid == null) + { + return null; + } + else + { + int i = (int)(p_getIconByUV_1_ / this.iconGridSizeU); + int j = (int)(p_getIconByUV_3_ / this.iconGridSizeV); + int k = j * this.iconGridCountX + i; + return k >= 0 && k <= this.iconGrid.length ? this.iconGrid[k] : null; + } + } + + private void checkEmissive(ResourceLocation p_checkEmissive_1_, TextureAtlasSprite p_checkEmissive_2_) + { + String s = EmissiveTextures.getSuffixEmissive(); + + if (s != null) + { + if (!p_checkEmissive_1_.getResourcePath().endsWith(s)) + { + ResourceLocation resourcelocation = new ResourceLocation(p_checkEmissive_1_.getResourceDomain(), p_checkEmissive_1_.getResourcePath() + s); + ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation); + + if (Config.hasResource(resourcelocation1)) + { + TextureAtlasSprite textureatlassprite = this.registerSprite(resourcelocation); + textureatlassprite.isEmissive = true; + p_checkEmissive_2_.spriteEmissive = textureatlassprite; + } + } + } + } + + public int getCountAnimations() + { + return this.listAnimatedSprites.size(); + } + + public int getCountAnimationsActive() + { + return this.countAnimationsActive; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java new file mode 100644 index 0000000..88b2cdc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java @@ -0,0 +1,363 @@ +package net.minecraft.client.renderer.texture; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.nio.IntBuffer; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.Mipmaps; +import net.optifine.reflect.Reflector; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; +import org.lwjgl.opengl.GL12; + +public class TextureUtil +{ + private static final Logger logger = LogManager.getLogger(); + private static final IntBuffer dataBuffer = GLAllocation.createDirectIntBuffer(4194304); + public static final DynamicTexture missingTexture = new DynamicTexture(16, 16); + public static final int[] missingTextureData = missingTexture.getTextureData(); + private static final int[] mipmapBuffer; + private static int[] dataArray = new int[4194304]; + + public static int glGenTextures() + { + return GlStateManager.generateTexture(); + } + + public static void deleteTexture(int textureId) + { + GlStateManager.deleteTexture(textureId); + } + + public static int uploadTextureImage(int p_110987_0_, BufferedImage p_110987_1_) + { + return uploadTextureImageAllocate(p_110987_0_, p_110987_1_, false, false); + } + + public static void uploadTexture(int textureId, int[] p_110988_1_, int p_110988_2_, int p_110988_3_) + { + bindTexture(textureId); + uploadTextureSub(0, p_110988_1_, p_110988_2_, p_110988_3_, 0, 0, false, false, false); + } + + public static int[][] generateMipmapData(int p_147949_0_, int p_147949_1_, int[][] p_147949_2_) + { + int[][] aint = new int[p_147949_0_ + 1][]; + aint[0] = p_147949_2_[0]; + + if (p_147949_0_ > 0) + { + boolean flag = false; + + for (int i = 0; i < p_147949_2_[0].length; ++i) + { + if (p_147949_2_[0][i] >> 24 == 0) + { + flag = true; + break; + } + } + + for (int l1 = 1; l1 <= p_147949_0_; ++l1) + { + if (p_147949_2_[l1] != null) + { + aint[l1] = p_147949_2_[l1]; + } + else + { + int[] aint1 = aint[l1 - 1]; + int[] aint2 = new int[aint1.length >> 2]; + int j = p_147949_1_ >> l1; + int k = aint2.length / j; + int l = j << 1; + + for (int i1 = 0; i1 < j; ++i1) + { + for (int j1 = 0; j1 < k; ++j1) + { + int k1 = 2 * (i1 + j1 * l); + aint2[i1 + j1 * j] = blendColors(aint1[k1 + 0], aint1[k1 + 1], aint1[k1 + 0 + l], aint1[k1 + 1 + l], flag); + } + } + + aint[l1] = aint2; + } + } + } + + return aint; + } + + private static int blendColors(int p_147943_0_, int p_147943_1_, int p_147943_2_, int p_147943_3_, boolean p_147943_4_) + { + return Mipmaps.alphaBlend(p_147943_0_, p_147943_1_, p_147943_2_, p_147943_3_); + } + + private static int blendColorComponent(int p_147944_0_, int p_147944_1_, int p_147944_2_, int p_147944_3_, int p_147944_4_) + { + float f = (float)Math.pow((double)((float)(p_147944_0_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f1 = (float)Math.pow((double)((float)(p_147944_1_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f2 = (float)Math.pow((double)((float)(p_147944_2_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f3 = (float)Math.pow((double)((float)(p_147944_3_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f4 = (float)Math.pow((double)(f + f1 + f2 + f3) * 0.25D, 0.45454545454545453D); + return (int)((double)f4 * 255.0D); + } + + public static void uploadTextureMipmap(int[][] p_147955_0_, int p_147955_1_, int p_147955_2_, int p_147955_3_, int p_147955_4_, boolean p_147955_5_, boolean p_147955_6_) + { + for (int i = 0; i < p_147955_0_.length; ++i) + { + int[] aint = p_147955_0_[i]; + uploadTextureSub(i, aint, p_147955_1_ >> i, p_147955_2_ >> i, p_147955_3_ >> i, p_147955_4_ >> i, p_147955_5_, p_147955_6_, p_147955_0_.length > 1); + } + } + + private static void uploadTextureSub(int p_147947_0_, int[] p_147947_1_, int p_147947_2_, int p_147947_3_, int p_147947_4_, int p_147947_5_, boolean p_147947_6_, boolean p_147947_7_, boolean p_147947_8_) + { + int i = 4194304 / p_147947_2_; + setTextureBlurMipmap(p_147947_6_, p_147947_8_); + setTextureClamped(p_147947_7_); + int j; + + for (int k = 0; k < p_147947_2_ * p_147947_3_; k += p_147947_2_ * j) + { + int l = k / p_147947_2_; + j = Math.min(i, p_147947_3_ - l); + int i1 = p_147947_2_ * j; + copyToBufferPos(p_147947_1_, k, i1); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, p_147947_0_, p_147947_4_, p_147947_5_ + l, p_147947_2_, j, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)dataBuffer); + } + } + + public static int uploadTextureImageAllocate(int p_110989_0_, BufferedImage p_110989_1_, boolean p_110989_2_, boolean p_110989_3_) + { + allocateTexture(p_110989_0_, p_110989_1_.getWidth(), p_110989_1_.getHeight()); + return uploadTextureImageSub(p_110989_0_, p_110989_1_, 0, 0, p_110989_2_, p_110989_3_); + } + + public static void allocateTexture(int p_110991_0_, int p_110991_1_, int p_110991_2_) + { + allocateTextureImpl(p_110991_0_, 0, p_110991_1_, p_110991_2_); + } + + public static void allocateTextureImpl(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_) + { + Object object = TextureUtil.class; + + if (Reflector.SplashScreen.exists()) + { + object = Reflector.SplashScreen.getTargetClass(); + } + + synchronized (object) + { + deleteTexture(p_180600_0_); + bindTexture(p_180600_0_); + } + + if (p_180600_1_ >= 0) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_180600_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, (float)p_180600_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0F); + } + + for (int i = 0; i <= p_180600_1_; ++i) + { + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, i, GL11.GL_RGBA, p_180600_2_ >> i, p_180600_3_ >> i, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)((IntBuffer)null)); + } + } + + public static int uploadTextureImageSub(int textureId, BufferedImage p_110995_1_, int p_110995_2_, int p_110995_3_, boolean p_110995_4_, boolean p_110995_5_) + { + bindTexture(textureId); + uploadTextureImageSubImpl(p_110995_1_, p_110995_2_, p_110995_3_, p_110995_4_, p_110995_5_); + return textureId; + } + + private static void uploadTextureImageSubImpl(BufferedImage p_110993_0_, int p_110993_1_, int p_110993_2_, boolean p_110993_3_, boolean p_110993_4_) + { + int i = p_110993_0_.getWidth(); + int j = p_110993_0_.getHeight(); + int k = 4194304 / i; + int[] aint = dataArray; + setTextureBlurred(p_110993_3_); + setTextureClamped(p_110993_4_); + + for (int l = 0; l < i * j; l += i * k) + { + int i1 = l / i; + int j1 = Math.min(k, j - i1); + int k1 = i * j1; + p_110993_0_.getRGB(0, i1, i, j1, aint, 0, i); + copyToBuffer(aint, k1); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, p_110993_1_, p_110993_2_ + i1, i, j1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)dataBuffer); + } + } + + public static void setTextureClamped(boolean p_110997_0_) + { + if (p_110997_0_) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + } + else + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + } + } + + private static void setTextureBlurred(boolean p_147951_0_) + { + setTextureBlurMipmap(p_147951_0_, false); + } + + public static void setTextureBlurMipmap(boolean p_147954_0_, boolean p_147954_1_) + { + if (p_147954_0_) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147954_1_ ? GL11.GL_LINEAR_MIPMAP_LINEAR : GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + } + else + { + int i = Config.getMipmapType(); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147954_1_ ? i : GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + } + } + + private static void copyToBuffer(int[] p_110990_0_, int p_110990_1_) + { + copyToBufferPos(p_110990_0_, 0, p_110990_1_); + } + + private static void copyToBufferPos(int[] p_110994_0_, int p_110994_1_, int p_110994_2_) + { + int[] aint = p_110994_0_; + + if (Minecraft.getMinecraft().gameSettings.anaglyph) + { + aint = updateAnaglyph(p_110994_0_); + } + + dataBuffer.clear(); + dataBuffer.put(aint, p_110994_1_, p_110994_2_); + dataBuffer.position(0).limit(p_110994_2_); + } + + static void bindTexture(int p_94277_0_) + { + GlStateManager.bindTexture(p_94277_0_); + } + + public static int[] readImageData(IResourceManager resourceManager, ResourceLocation imageLocation) throws IOException + { + BufferedImage bufferedimage = readBufferedImage(resourceManager.getResource(imageLocation).getInputStream()); + + if (bufferedimage == null) + { + return null; + } + else + { + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + int[] aint = new int[i * j]; + bufferedimage.getRGB(0, 0, i, j, aint, 0, i); + return aint; + } + } + + public static BufferedImage readBufferedImage(InputStream imageStream) throws IOException + { + if (imageStream == null) + { + return null; + } + else + { + BufferedImage bufferedimage; + + try + { + bufferedimage = ImageIO.read(imageStream); + } + finally + { + IOUtils.closeQuietly(imageStream); + } + + return bufferedimage; + } + } + + public static int[] updateAnaglyph(int[] p_110985_0_) + { + int[] aint = new int[p_110985_0_.length]; + + for (int i = 0; i < p_110985_0_.length; ++i) + { + aint[i] = anaglyphColor(p_110985_0_[i]); + } + + return aint; + } + + public static int anaglyphColor(int p_177054_0_) + { + int i = p_177054_0_ >> 24 & 255; + int j = p_177054_0_ >> 16 & 255; + int k = p_177054_0_ >> 8 & 255; + int l = p_177054_0_ & 255; + int i1 = (j * 30 + k * 59 + l * 11) / 100; + int j1 = (j * 30 + k * 70) / 100; + int k1 = (j * 30 + l * 70) / 100; + return i << 24 | i1 << 16 | j1 << 8 | k1; + } + + public static void processPixelValues(int[] p_147953_0_, int p_147953_1_, int p_147953_2_) + { + int[] aint = new int[p_147953_1_]; + int i = p_147953_2_ / 2; + + for (int j = 0; j < i; ++j) + { + System.arraycopy(p_147953_0_, j * p_147953_1_, aint, 0, p_147953_1_); + System.arraycopy(p_147953_0_, (p_147953_2_ - 1 - j) * p_147953_1_, p_147953_0_, j * p_147953_1_, p_147953_1_); + System.arraycopy(aint, 0, p_147953_0_, (p_147953_2_ - 1 - j) * p_147953_1_, p_147953_1_); + } + } + + static + { + int i = -16777216; + int j = -524040; + int[] aint = new int[] { -524040, -524040, -524040, -524040, -524040, -524040, -524040, -524040}; + int[] aint1 = new int[] { -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216}; + int k = aint.length; + + for (int l = 0; l < 16; ++l) + { + System.arraycopy(l < k ? aint : aint1, 0, missingTextureData, 16 * l, k); + System.arraycopy(l < k ? aint1 : aint, 0, missingTextureData, 16 * l + k, k); + } + + missingTexture.updateDynamicTexture(); + mipmapBuffer = new int[4]; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java new file mode 100644 index 0000000..f531a02 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java @@ -0,0 +1,40 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelEnderCrystal; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class RenderEnderCrystal extends Render +{ + private static final ResourceLocation enderCrystalTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal.png"); + private ModelBase modelEnderCrystal = new ModelEnderCrystal(0.0F, true); + + public RenderEnderCrystal(RenderManager renderManagerIn) + { + super(renderManagerIn); + this.shadowSize = 0.5F; + } + + public void doRender(EntityEnderCrystal entity, double x, double y, double z, float entityYaw, float partialTicks) + { + float f = (float)entity.innerRotation + partialTicks; + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x, (float)y, (float)z); + this.bindTexture(enderCrystalTextures); + float f1 = MathHelper.sin(f * 0.2F) / 2.0F + 0.5F; + f1 = f1 * f1 + f1; + this.modelEnderCrystal.render(entity, 0.0F, f * 3.0F, f1 * 0.2F, 0.0F, 0.0F, 0.0625F); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityEnderCrystal entity) + { + return enderCrystalTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java new file mode 100644 index 0000000..3a49155 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderItemFrame.java @@ -0,0 +1,284 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureCompass; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemSkull; +import net.minecraft.item.ItemStack; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +public class RenderItemFrame extends Render +{ + private static final ResourceLocation mapBackgroundTextures = new ResourceLocation("textures/map/map_background.png"); + private final Minecraft mc = Minecraft.getMinecraft(); + private final ModelResourceLocation itemFrameModel = new ModelResourceLocation("item_frame", "normal"); + private final ModelResourceLocation mapModel = new ModelResourceLocation("item_frame", "map"); + private RenderItem itemRenderer; + private static double itemRenderDistanceSq = 4096.0D; + + public RenderItemFrame(RenderManager renderManagerIn, RenderItem itemRendererIn) + { + super(renderManagerIn); + this.itemRenderer = itemRendererIn; + } + + /** + * Renders the desired {@code T} type Entity. + */ + public void doRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + BlockPos blockpos = entity.getHangingPosition(); + double d0 = (double)blockpos.getX() - entity.posX + x; + double d1 = (double)blockpos.getY() - entity.posY + y; + double d2 = (double)blockpos.getZ() - entity.posZ + z; + GlStateManager.translate(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D); + GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F); + this.renderManager.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher(); + ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager(); + IBakedModel ibakedmodel; + + if (entity.getDisplayedItem() != null && entity.getDisplayedItem().getItem() == Items.filled_map) + { + ibakedmodel = modelmanager.getModel(this.mapModel); + } + else + { + ibakedmodel = modelmanager.getModel(this.itemFrameModel); + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(-0.5F, -0.5F, -0.5F); + blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + GlStateManager.translate(0.0F, 0.0F, 0.4375F); + this.renderItem(entity); + GlStateManager.popMatrix(); + this.renderName(entity, x + (double)((float)entity.facingDirection.getFrontOffsetX() * 0.3F), y - 0.25D, z + (double)((float)entity.facingDirection.getFrontOffsetZ() * 0.3F)); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityItemFrame entity) + { + return null; + } + + private void renderItem(EntityItemFrame itemFrame) + { + ItemStack itemstack = itemFrame.getDisplayedItem(); + + if (itemstack != null) + { + if (!this.isRenderItem(itemFrame)) + { + return; + } + + if (!Config.zoomMode) + { + Entity entity = this.mc.thePlayer; + double d0 = itemFrame.getDistanceSq(entity.posX, entity.posY, entity.posZ); + + if (d0 > 4096.0D) + { + return; + } + } + + EntityItem entityitem = new EntityItem(itemFrame.worldObj, 0.0D, 0.0D, 0.0D, itemstack); + Item item = entityitem.getEntityItem().getItem(); + entityitem.getEntityItem().stackSize = 1; + entityitem.hoverStart = 0.0F; + GlStateManager.pushMatrix(); + GlStateManager.disableLighting(); + int i = itemFrame.getRotation(); + + if (item instanceof ItemMap) + { + i = i % 4 * 2; + } + + GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F); + + if (!Reflector.postForgeBusEvent(Reflector.RenderItemInFrameEvent_Constructor, new Object[] {itemFrame, this})) + { + if (item instanceof ItemMap) + { + this.renderManager.renderEngine.bindTexture(mapBackgroundTextures); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + float f = 0.0078125F; + GlStateManager.scale(f, f, f); + GlStateManager.translate(-64.0F, -64.0F, 0.0F); + MapData mapdata = Items.filled_map.getMapData(entityitem.getEntityItem(), itemFrame.worldObj); + GlStateManager.translate(0.0F, 0.0F, -1.0F); + + if (mapdata != null) + { + this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, true); + } + } + else + { + TextureAtlasSprite textureatlassprite = null; + + if (item == Items.compass) + { + textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite(TextureCompass.locationSprite); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + + if (textureatlassprite instanceof TextureCompass) + { + TextureCompass texturecompass = (TextureCompass)textureatlassprite; + double d1 = texturecompass.currentAngle; + double d2 = texturecompass.angleDelta; + texturecompass.currentAngle = 0.0D; + texturecompass.angleDelta = 0.0D; + texturecompass.updateCompass(itemFrame.worldObj, itemFrame.posX, itemFrame.posZ, (double)MathHelper.wrapAngleTo180_float((float)(180 + itemFrame.facingDirection.getHorizontalIndex() * 90)), false, true); + texturecompass.currentAngle = d1; + texturecompass.angleDelta = d2; + } + else + { + textureatlassprite = null; + } + } + + GlStateManager.scale(0.5F, 0.5F, 0.5F); + + if (!this.itemRenderer.shouldRenderItemIn3D(entityitem.getEntityItem()) || item instanceof ItemSkull) + { + GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); + } + + GlStateManager.pushAttrib(); + RenderHelper.enableStandardItemLighting(); + this.itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED); + RenderHelper.disableStandardItemLighting(); + GlStateManager.popAttrib(); + + if (textureatlassprite != null && textureatlassprite.getFrameCount() > 0) + { + textureatlassprite.updateAnimation(); + } + } + } + GlStateManager.enableLighting(); + GlStateManager.popMatrix(); + } + } + + protected void renderName(EntityItemFrame entity, double x, double y, double z) + { + if (Minecraft.isGuiEnabled() && entity.getDisplayedItem() != null && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity) + { + float f = 1.6F; + float f1 = 0.016666668F * f; + double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer); + float f2 = entity.isSneaking() ? 32.0F : 64.0F; + + if (d0 < (double)(f2 * f2)) + { + String s = entity.getDisplayedItem().getDisplayName(); + + if (entity.isSneaking()) + { + FontRenderer fontrenderer = this.getFontRendererFromRenderManager(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x + 0.0F, (float)y + entity.height + 0.5F, (float)z); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-f1, -f1, f1); + GlStateManager.disableLighting(); + GlStateManager.translate(0.0F, 0.25F / f1, 0.0F); + GlStateManager.depthMask(false); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = fontrenderer.getStringWidth(s) / 2; + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double)(-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double)(-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double)(i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos((double)(i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.depthMask(true); + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + else + { + this.renderLivingLabel(entity, s, x, y, z, 64); + } + } + } + } + + private boolean isRenderItem(EntityItemFrame p_isRenderItem_1_) + { + if (Shaders.isShadowPass) + { + return false; + } + else + { + if (!Config.zoomMode) + { + Entity entity = this.mc.getRenderViewEntity(); + double d0 = p_isRenderItem_1_.getDistanceSq(entity.posX, entity.posY, entity.posZ); + + if (d0 > itemRenderDistanceSq) + { + return false; + } + } + + return true; + } + } + + public static void updateItemRenderDistance() + { + Minecraft minecraft = Config.getMinecraft(); + double d0 = (double)Config.limit(minecraft.gameSettings.gammaSetting, 1.0F, 120.0F); + double d1 = Math.max(6.0D * (double)minecraft.displayHeight / d0, 16.0D); + itemRenderDistanceSq = d1 * d1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderWitherSkull.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderWitherSkull.java new file mode 100644 index 0000000..3d75d90 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/RenderWitherSkull.java @@ -0,0 +1,59 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.util.ResourceLocation; + +public class RenderWitherSkull extends Render +{ + private static final ResourceLocation invulnerableWitherTextures = new ResourceLocation("textures/entity/wither/wither_invulnerable.png"); + private static final ResourceLocation witherTextures = new ResourceLocation("textures/entity/wither/wither.png"); + private final ModelSkeletonHead skeletonHeadModel = new ModelSkeletonHead(); + + public RenderWitherSkull(RenderManager renderManagerIn) + { + super(renderManagerIn); + } + + private float func_82400_a(float p_82400_1_, float p_82400_2_, float p_82400_3_) + { + float f; + + for (f = p_82400_2_ - p_82400_1_; f < -180.0F; f += 360.0F) + { + ; + } + + while (f >= 180.0F) + { + f -= 360.0F; + } + + return p_82400_1_ + p_82400_3_ * f; + } + + public void doRender(EntityWitherSkull entity, double x, double y, double z, float entityYaw, float partialTicks) + { + GlStateManager.pushMatrix(); + GlStateManager.disableCull(); + float f = this.func_82400_a(entity.prevRotationYaw, entity.rotationYaw, partialTicks); + float f1 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks; + GlStateManager.translate((float)x, (float)y, (float)z); + float f2 = 0.0625F; + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(-1.0F, -1.0F, 1.0F); + GlStateManager.enableAlpha(); + this.bindEntityTexture(entity); + this.skeletonHeadModel.render(entity, 0.0F, 0.0F, 0.0F, f, f1, f2); + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + protected ResourceLocation getEntityTexture(EntityWitherSkull entity) + { + return entity.isInvulnerable() ? invulnerableWitherTextures : witherTextures; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.java new file mode 100644 index 0000000..2c321e0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBannerRenderer.java @@ -0,0 +1,151 @@ +package net.minecraft.client.renderer.tileentity; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBanner; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.LayeredColorMaskTexture; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class TileEntityBannerRenderer extends TileEntitySpecialRenderer +{ + private static final Map DESIGNS = Maps.newHashMap(); + private static final ResourceLocation BANNERTEXTURES = new ResourceLocation("textures/entity/banner_base.png"); + private ModelBanner bannerModel = new ModelBanner(); + + public void renderTileEntityAt(TileEntityBanner te, double x, double y, double z, float partialTicks, int destroyStage) + { + boolean flag = te.getWorld() != null; + boolean flag1 = !flag || te.getBlockType() == Blocks.standing_banner; + int i = flag ? te.getBlockMetadata() : 0; + long j = flag ? te.getWorld().getTotalWorldTime() : 0L; + GlStateManager.pushMatrix(); + float f = 0.6666667F; + + if (flag1) + { + GlStateManager.translate((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); + float f1 = (float)(i * 360) / 16.0F; + GlStateManager.rotate(-f1, 0.0F, 1.0F, 0.0F); + this.bannerModel.bannerStand.showModel = true; + } + else + { + float f2 = 0.0F; + + if (i == 2) + { + f2 = 180.0F; + } + + if (i == 4) + { + f2 = 90.0F; + } + + if (i == 5) + { + f2 = -90.0F; + } + + GlStateManager.translate((float)x + 0.5F, (float)y - 0.25F * f, (float)z + 0.5F); + GlStateManager.rotate(-f2, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, -0.3125F, -0.4375F); + this.bannerModel.bannerStand.showModel = false; + } + + BlockPos blockpos = te.getPos(); + float f3 = (float)(blockpos.getX() * 7 + blockpos.getY() * 9 + blockpos.getZ() * 13) + (float)j + partialTicks; + this.bannerModel.bannerSlate.rotateAngleX = (-0.0125F + 0.01F * MathHelper.cos(f3 * (float)Math.PI * 0.02F)) * (float)Math.PI; + GlStateManager.enableRescaleNormal(); + ResourceLocation resourcelocation = this.func_178463_a(te); + + if (resourcelocation != null) + { + this.bindTexture(resourcelocation); + GlStateManager.pushMatrix(); + GlStateManager.scale(f, -f, -f); + this.bannerModel.renderBanner(); + GlStateManager.popMatrix(); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + + private ResourceLocation func_178463_a(TileEntityBanner bannerObj) + { + String s = bannerObj.getPatternResourceLocation(); + + if (s.isEmpty()) + { + return null; + } + else + { + TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s); + + if (tileentitybannerrenderer$timedbannertexture == null) + { + if (DESIGNS.size() >= 256) + { + long i = System.currentTimeMillis(); + Iterator iterator = DESIGNS.keySet().iterator(); + + while (iterator.hasNext()) + { + String s1 = (String)iterator.next(); + TileEntityBannerRenderer.TimedBannerTexture tileentitybannerrenderer$timedbannertexture1 = (TileEntityBannerRenderer.TimedBannerTexture)DESIGNS.get(s1); + + if (i - tileentitybannerrenderer$timedbannertexture1.systemTime > 60000L) + { + Minecraft.getMinecraft().getTextureManager().deleteTexture(tileentitybannerrenderer$timedbannertexture1.bannerTexture); + iterator.remove(); + } + } + + if (DESIGNS.size() >= 256) + { + return null; + } + } + + List list1 = bannerObj.getPatternList(); + List list = bannerObj.getColorList(); + List list2 = Lists.newArrayList(); + + for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : list1) + { + list2.add("textures/entity/banner/" + tileentitybanner$enumbannerpattern.getPatternName() + ".png"); + } + + tileentitybannerrenderer$timedbannertexture = new TileEntityBannerRenderer.TimedBannerTexture(); + tileentitybannerrenderer$timedbannertexture.bannerTexture = new ResourceLocation(s); + Minecraft.getMinecraft().getTextureManager().loadTexture(tileentitybannerrenderer$timedbannertexture.bannerTexture, new LayeredColorMaskTexture(BANNERTEXTURES, list2, list)); + DESIGNS.put(s, tileentitybannerrenderer$timedbannertexture); + } + + tileentitybannerrenderer$timedbannertexture.systemTime = System.currentTimeMillis(); + return tileentitybannerrenderer$timedbannertexture.bannerTexture; + } + } + + static class TimedBannerTexture + { + public long systemTime; + public ResourceLocation bannerTexture; + + private TimedBannerTexture() + { + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.java new file mode 100644 index 0000000..185cd93 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.java @@ -0,0 +1,147 @@ +package net.minecraft.client.renderer.tileentity; + +import java.util.List; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +public class TileEntityBeaconRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation beaconBeam = new ResourceLocation("textures/entity/beacon_beam.png"); + + public void renderTileEntityAt(TileEntityBeacon te, double x, double y, double z, float partialTicks, int destroyStage) + { + float f = te.shouldBeamRender(); + + if ((double)f > 0.0D) + { + if (Config.isShaders()) + { + Shaders.beginBeacon(); + } + + GlStateManager.alphaFunc(516, 0.1F); + + if (f > 0.0F) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.disableFog(); + List list = te.getBeamSegments(); + int i = 0; + + for (int j = 0; j < list.size(); ++j) + { + TileEntityBeacon.BeamSegment tileentitybeacon$beamsegment = (TileEntityBeacon.BeamSegment)list.get(j); + int k = i + tileentitybeacon$beamsegment.getHeight(); + this.bindTexture(beaconBeam); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GlStateManager.disableLighting(); + GlStateManager.disableCull(); + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); + double d0 = (double)te.getWorld().getTotalWorldTime() + (double)partialTicks; + double d1 = MathHelper.func_181162_h(-d0 * 0.2D - (double)MathHelper.floor_double(-d0 * 0.1D)); + float f1 = tileentitybeacon$beamsegment.getColors()[0]; + float f2 = tileentitybeacon$beamsegment.getColors()[1]; + float f3 = tileentitybeacon$beamsegment.getColors()[2]; + double d2 = d0 * 0.025D * -1.5D; + double d3 = 0.2D; + double d4 = 0.5D + Math.cos(d2 + 2.356194490192345D) * 0.2D; + double d5 = 0.5D + Math.sin(d2 + 2.356194490192345D) * 0.2D; + double d6 = 0.5D + Math.cos(d2 + (Math.PI / 4D)) * 0.2D; + double d7 = 0.5D + Math.sin(d2 + (Math.PI / 4D)) * 0.2D; + double d8 = 0.5D + Math.cos(d2 + 3.9269908169872414D) * 0.2D; + double d9 = 0.5D + Math.sin(d2 + 3.9269908169872414D) * 0.2D; + double d10 = 0.5D + Math.cos(d2 + 5.497787143782138D) * 0.2D; + double d11 = 0.5D + Math.sin(d2 + 5.497787143782138D) * 0.2D; + double d12 = 0.0D; + double d13 = 1.0D; + double d14 = -1.0D + d1; + double d15 = (double)((float)tileentitybeacon$beamsegment.getHeight() * f) * 2.5D + d14; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(x + d4, y + (double)k, z + d5).tex(1.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d4, y + (double)i, z + d5).tex(1.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d6, y + (double)i, z + d7).tex(0.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d6, y + (double)k, z + d7).tex(0.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d10, y + (double)k, z + d11).tex(1.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d10, y + (double)i, z + d11).tex(1.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d8, y + (double)i, z + d9).tex(0.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d8, y + (double)k, z + d9).tex(0.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d6, y + (double)k, z + d7).tex(1.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d6, y + (double)i, z + d7).tex(1.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d10, y + (double)i, z + d11).tex(0.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d10, y + (double)k, z + d11).tex(0.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d8, y + (double)k, z + d9).tex(1.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d8, y + (double)i, z + d9).tex(1.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d4, y + (double)i, z + d5).tex(0.0D, d14).color(f1, f2, f3, 1.0F).endVertex(); + worldrenderer.pos(x + d4, y + (double)k, z + d5).tex(0.0D, d15).color(f1, f2, f3, 1.0F).endVertex(); + tessellator.draw(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.depthMask(false); + d2 = 0.2D; + d3 = 0.2D; + d4 = 0.8D; + d5 = 0.2D; + d6 = 0.2D; + d7 = 0.8D; + d8 = 0.8D; + d9 = 0.8D; + d10 = 0.0D; + d11 = 1.0D; + d12 = -1.0D + d1; + d13 = (double)((float)tileentitybeacon$beamsegment.getHeight() * f) + d12; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(x + 0.2D, y + (double)k, z + 0.2D).tex(1.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.2D, y + (double)i, z + 0.2D).tex(1.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)i, z + 0.2D).tex(0.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)k, z + 0.2D).tex(0.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)k, z + 0.8D).tex(1.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)i, z + 0.8D).tex(1.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.2D, y + (double)i, z + 0.8D).tex(0.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.2D, y + (double)k, z + 0.8D).tex(0.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)k, z + 0.2D).tex(1.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)i, z + 0.2D).tex(1.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)i, z + 0.8D).tex(0.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.8D, y + (double)k, z + 0.8D).tex(0.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.2D, y + (double)k, z + 0.8D).tex(1.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.2D, y + (double)i, z + 0.8D).tex(1.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.2D, y + (double)i, z + 0.2D).tex(0.0D, d12).color(f1, f2, f3, 0.125F).endVertex(); + worldrenderer.pos(x + 0.2D, y + (double)k, z + 0.2D).tex(0.0D, d13).color(f1, f2, f3, 0.125F).endVertex(); + tessellator.draw(); + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + GlStateManager.depthMask(true); + i = k; + } + + GlStateManager.enableFog(); + } + + if (Config.isShaders()) + { + Shaders.endBeacon(); + } + } + } + + /** + * If true the {@link TileEntitySpecialRenderer} will always be rendered while the player is in the render bounding + * box {@link TileEntity#getRenderBoundingBox()} and his squared distance with the {@link TileEntity} is smaller + * than {@link TileEntity#getMaxRenderDistanceSquared()}. + */ + public boolean forceTileEntityRender() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java new file mode 100644 index 0000000..c0eaba6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java @@ -0,0 +1,199 @@ +package net.minecraft.client.renderer.tileentity; + +import java.util.Calendar; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.model.ModelLargeChest; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.ResourceLocation; + +public class TileEntityChestRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation textureTrappedDouble = new ResourceLocation("textures/entity/chest/trapped_double.png"); + private static final ResourceLocation textureChristmasDouble = new ResourceLocation("textures/entity/chest/christmas_double.png"); + private static final ResourceLocation textureNormalDouble = new ResourceLocation("textures/entity/chest/normal_double.png"); + private static final ResourceLocation textureTrapped = new ResourceLocation("textures/entity/chest/trapped.png"); + private static final ResourceLocation textureChristmas = new ResourceLocation("textures/entity/chest/christmas.png"); + private static final ResourceLocation textureNormal = new ResourceLocation("textures/entity/chest/normal.png"); + private ModelChest simpleChest = new ModelChest(); + private ModelChest largeChest = new ModelLargeChest(); + private boolean isChristmas; + + public TileEntityChestRenderer() + { + Calendar calendar = Calendar.getInstance(); + + if (calendar.get(2) + 1 == 12 && calendar.get(5) >= 24 && calendar.get(5) <= 26) + { + this.isChristmas = true; + } + } + + public void renderTileEntityAt(TileEntityChest te, double x, double y, double z, float partialTicks, int destroyStage) + { + GlStateManager.enableDepth(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + int i; + + if (!te.hasWorldObj()) + { + i = 0; + } + else + { + Block block = te.getBlockType(); + i = te.getBlockMetadata(); + + if (block instanceof BlockChest && i == 0) + { + ((BlockChest)block).checkForSurroundingChests(te.getWorld(), te.getPos(), te.getWorld().getBlockState(te.getPos())); + i = te.getBlockMetadata(); + } + + te.checkForAdjacentChests(); + } + + if (te.adjacentChestZNeg == null && te.adjacentChestXNeg == null) + { + ModelChest modelchest; + + if (te.adjacentChestXPos == null && te.adjacentChestZPos == null) + { + modelchest = this.simpleChest; + + if (destroyStage >= 0) + { + this.bindTexture(DESTROY_STAGES[destroyStage]); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(4.0F, 4.0F, 1.0F); + GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); + GlStateManager.matrixMode(5888); + } + else if (this.isChristmas) + { + this.bindTexture(textureChristmas); + } + else if (te.getChestType() == 1) + { + this.bindTexture(textureTrapped); + } + else + { + this.bindTexture(textureNormal); + } + } + else + { + modelchest = this.largeChest; + + if (destroyStage >= 0) + { + this.bindTexture(DESTROY_STAGES[destroyStage]); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(8.0F, 4.0F, 1.0F); + GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); + GlStateManager.matrixMode(5888); + } + else if (this.isChristmas) + { + this.bindTexture(textureChristmasDouble); + } + else if (te.getChestType() == 1) + { + this.bindTexture(textureTrappedDouble); + } + else + { + this.bindTexture(textureNormalDouble); + } + } + + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + + if (destroyStage < 0) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + GlStateManager.translate((float)x, (float)y + 1.0F, (float)z + 1.0F); + GlStateManager.scale(1.0F, -1.0F, -1.0F); + GlStateManager.translate(0.5F, 0.5F, 0.5F); + int j = 0; + + if (i == 2) + { + j = 180; + } + + if (i == 3) + { + j = 0; + } + + if (i == 4) + { + j = 90; + } + + if (i == 5) + { + j = -90; + } + + if (i == 2 && te.adjacentChestXPos != null) + { + GlStateManager.translate(1.0F, 0.0F, 0.0F); + } + + if (i == 5 && te.adjacentChestZPos != null) + { + GlStateManager.translate(0.0F, 0.0F, -1.0F); + } + + GlStateManager.rotate((float)j, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(-0.5F, -0.5F, -0.5F); + float f = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks; + + if (te.adjacentChestZNeg != null) + { + float f1 = te.adjacentChestZNeg.prevLidAngle + (te.adjacentChestZNeg.lidAngle - te.adjacentChestZNeg.prevLidAngle) * partialTicks; + + if (f1 > f) + { + f = f1; + } + } + + if (te.adjacentChestXNeg != null) + { + float f2 = te.adjacentChestXNeg.prevLidAngle + (te.adjacentChestXNeg.lidAngle - te.adjacentChestXNeg.prevLidAngle) * partialTicks; + + if (f2 > f) + { + f = f2; + } + } + + f = 1.0F - f; + f = 1.0F - f * f * f; + modelchest.chestLid.rotateAngleX = -(f * (float)Math.PI / 2.0F); + modelchest.renderAll(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (destroyStage >= 0) + { + GlStateManager.matrixMode(5890); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnchantmentTableRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnchantmentTableRenderer.java new file mode 100644 index 0000000..91c43de --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnchantmentTableRenderer.java @@ -0,0 +1,67 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class TileEntityEnchantmentTableRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation TEXTURE_BOOK = new ResourceLocation("textures/entity/enchanting_table_book.png"); + private ModelBook field_147541_c = new ModelBook(); + + public void renderTileEntityAt(TileEntityEnchantmentTable te, double x, double y, double z, float partialTicks, int destroyStage) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x + 0.5F, (float)y + 0.75F, (float)z + 0.5F); + float f = (float)te.tickCount + partialTicks; + GlStateManager.translate(0.0F, 0.1F + MathHelper.sin(f * 0.1F) * 0.01F, 0.0F); + float f1; + + for (f1 = te.bookRotation - te.bookRotationPrev; f1 >= (float)Math.PI; f1 -= ((float)Math.PI * 2F)) + { + ; + } + + while (f1 < -(float)Math.PI) + { + f1 += ((float)Math.PI * 2F); + } + + float f2 = te.bookRotationPrev + f1 * partialTicks; + GlStateManager.rotate(-f2 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(80.0F, 0.0F, 0.0F, 1.0F); + this.bindTexture(TEXTURE_BOOK); + float f3 = te.pageFlipPrev + (te.pageFlip - te.pageFlipPrev) * partialTicks + 0.25F; + float f4 = te.pageFlipPrev + (te.pageFlip - te.pageFlipPrev) * partialTicks + 0.75F; + f3 = (f3 - (float)MathHelper.truncateDoubleToInt((double)f3)) * 1.6F - 0.3F; + f4 = (f4 - (float)MathHelper.truncateDoubleToInt((double)f4)) * 1.6F - 0.3F; + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + if (f4 < 0.0F) + { + f4 = 0.0F; + } + + if (f3 > 1.0F) + { + f3 = 1.0F; + } + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + + float f5 = te.bookSpreadPrev + (te.bookSpread - te.bookSpreadPrev) * partialTicks; + GlStateManager.enableCull(); + this.field_147541_c.render((Entity)null, f, f3, f4, f5, 0.0F, 0.0625F); + GlStateManager.popMatrix(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEndPortalRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEndPortalRenderer.java new file mode 100644 index 0000000..aab4201 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEndPortalRenderer.java @@ -0,0 +1,132 @@ +package net.minecraft.client.renderer.tileentity; + +import java.nio.FloatBuffer; +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.ResourceLocation; +import net.optifine.shaders.ShadersRender; + +public class TileEntityEndPortalRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation END_SKY_TEXTURE = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation END_PORTAL_TEXTURE = new ResourceLocation("textures/entity/end_portal.png"); + private static final Random field_147527_e = new Random(31100L); + FloatBuffer field_147528_b = GLAllocation.createDirectFloatBuffer(16); + + public void renderTileEntityAt(TileEntityEndPortal te, double x, double y, double z, float partialTicks, int destroyStage) + { + if (!Config.isShaders() || !ShadersRender.renderEndPortal(te, x, y, z, partialTicks, destroyStage, 0.75F)) + { + float f = (float)this.rendererDispatcher.entityX; + float f1 = (float)this.rendererDispatcher.entityY; + float f2 = (float)this.rendererDispatcher.entityZ; + GlStateManager.disableLighting(); + field_147527_e.setSeed(31100L); + float f3 = 0.75F; + + for (int i = 0; i < 16; ++i) + { + GlStateManager.pushMatrix(); + float f4 = (float)(16 - i); + float f5 = 0.0625F; + float f6 = 1.0F / (f4 + 1.0F); + + if (i == 0) + { + this.bindTexture(END_SKY_TEXTURE); + f6 = 0.1F; + f4 = 65.0F; + f5 = 0.125F; + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + } + + if (i >= 1) + { + this.bindTexture(END_PORTAL_TEXTURE); + } + + if (i == 1) + { + GlStateManager.enableBlend(); + GlStateManager.blendFunc(1, 1); + f5 = 0.5F; + } + + float f7 = (float)(-(y + (double)f3)); + float f8 = f7 + (float)ActiveRenderInfo.getPosition().yCoord; + float f9 = f7 + f4 + (float)ActiveRenderInfo.getPosition().yCoord; + float f10 = f8 / f9; + f10 = (float)(y + (double)f3) + f10; + GlStateManager.translate(f, f10, f2); + GlStateManager.texGen(GlStateManager.TexGen.S, 9217); + GlStateManager.texGen(GlStateManager.TexGen.T, 9217); + GlStateManager.texGen(GlStateManager.TexGen.R, 9217); + GlStateManager.texGen(GlStateManager.TexGen.Q, 9216); + GlStateManager.texGen(GlStateManager.TexGen.S, 9473, this.func_147525_a(1.0F, 0.0F, 0.0F, 0.0F)); + GlStateManager.texGen(GlStateManager.TexGen.T, 9473, this.func_147525_a(0.0F, 0.0F, 1.0F, 0.0F)); + GlStateManager.texGen(GlStateManager.TexGen.R, 9473, this.func_147525_a(0.0F, 0.0F, 0.0F, 1.0F)); + GlStateManager.texGen(GlStateManager.TexGen.Q, 9474, this.func_147525_a(0.0F, 1.0F, 0.0F, 0.0F)); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.S); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.T); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.R); + GlStateManager.enableTexGenCoord(GlStateManager.TexGen.Q); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, (float)(Minecraft.getSystemTime() % 700000L) / 700000.0F, 0.0F); + GlStateManager.scale(f5, f5, f5); + GlStateManager.translate(0.5F, 0.5F, 0.0F); + GlStateManager.rotate((float)(i * i * 4321 + i * 9) * 2.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.translate(-0.5F, -0.5F, 0.0F); + GlStateManager.translate(-f, -f2, -f1); + f8 = f7 + (float)ActiveRenderInfo.getPosition().yCoord; + GlStateManager.translate((float)ActiveRenderInfo.getPosition().xCoord * f4 / f8, (float)ActiveRenderInfo.getPosition().zCoord * f4 / f8, -f1); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + float f11 = (field_147527_e.nextFloat() * 0.5F + 0.1F) * f6; + float f12 = (field_147527_e.nextFloat() * 0.5F + 0.4F) * f6; + float f13 = (field_147527_e.nextFloat() * 0.5F + 0.5F) * f6; + + if (i == 0) + { + f11 = f12 = f13 = 1.0F * f6; + } + + worldrenderer.pos(x, y + (double)f3, z).color(f11, f12, f13, 1.0F).endVertex(); + worldrenderer.pos(x, y + (double)f3, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex(); + worldrenderer.pos(x + 1.0D, y + (double)f3, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex(); + worldrenderer.pos(x + 1.0D, y + (double)f3, z).color(f11, f12, f13, 1.0F).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + this.bindTexture(END_SKY_TEXTURE); + } + + GlStateManager.disableBlend(); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.S); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.T); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.R); + GlStateManager.disableTexGenCoord(GlStateManager.TexGen.Q); + GlStateManager.enableLighting(); + } + } + + private FloatBuffer func_147525_a(float p_147525_1_, float p_147525_2_, float p_147525_3_, float p_147525_4_) + { + this.field_147528_b.clear(); + this.field_147528_b.put(p_147525_1_).put(p_147525_2_).put(p_147525_3_).put(p_147525_4_); + this.field_147528_b.flip(); + return this.field_147528_b; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java new file mode 100644 index 0000000..b74f675 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java @@ -0,0 +1,82 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.util.ResourceLocation; + +public class TileEntityEnderChestRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation ENDER_CHEST_TEXTURE = new ResourceLocation("textures/entity/chest/ender.png"); + private ModelChest field_147521_c = new ModelChest(); + + public void renderTileEntityAt(TileEntityEnderChest te, double x, double y, double z, float partialTicks, int destroyStage) + { + int i = 0; + + if (te.hasWorldObj()) + { + i = te.getBlockMetadata(); + } + + if (destroyStage >= 0) + { + this.bindTexture(DESTROY_STAGES[destroyStage]); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(4.0F, 4.0F, 1.0F); + GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); + GlStateManager.matrixMode(5888); + } + else + { + this.bindTexture(ENDER_CHEST_TEXTURE); + } + + GlStateManager.pushMatrix(); + GlStateManager.enableRescaleNormal(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.translate((float)x, (float)y + 1.0F, (float)z + 1.0F); + GlStateManager.scale(1.0F, -1.0F, -1.0F); + GlStateManager.translate(0.5F, 0.5F, 0.5F); + int j = 0; + + if (i == 2) + { + j = 180; + } + + if (i == 3) + { + j = 0; + } + + if (i == 4) + { + j = 90; + } + + if (i == 5) + { + j = -90; + } + + GlStateManager.rotate((float)j, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(-0.5F, -0.5F, -0.5F); + float f = te.prevLidAngle + (te.lidAngle - te.prevLidAngle) * partialTicks; + f = 1.0F - f; + f = 1.0F - f * f * f; + this.field_147521_c.chestLid.rotateAngleX = -(f * (float)Math.PI / 2.0F); + this.field_147521_c.renderAll(); + GlStateManager.disableRescaleNormal(); + GlStateManager.popMatrix(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + if (destroyStage >= 0) + { + GlStateManager.matrixMode(5890); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java new file mode 100644 index 0000000..a771e44 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java @@ -0,0 +1,84 @@ +package net.minecraft.client.renderer.tileentity; + +import com.mojang.authlib.GameProfile; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.EnumFacing; + +public class TileEntityItemStackRenderer +{ + public static TileEntityItemStackRenderer instance = new TileEntityItemStackRenderer(); + private TileEntityChest field_147717_b = new TileEntityChest(0); + private TileEntityChest field_147718_c = new TileEntityChest(1); + private TileEntityEnderChest enderChest = new TileEntityEnderChest(); + private TileEntityBanner banner = new TileEntityBanner(); + private TileEntitySkull skull = new TileEntitySkull(); + + public void renderByItem(ItemStack itemStackIn) + { + if (itemStackIn.getItem() == Items.banner) + { + this.banner.setItemValues(itemStackIn); + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F); + } + else if (itemStackIn.getItem() == Items.skull) + { + GameProfile gameprofile = null; + + if (itemStackIn.hasTagCompound()) + { + NBTTagCompound nbttagcompound = itemStackIn.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) + { + gameprofile = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner")); + gameprofile = TileEntitySkull.updateGameprofile(gameprofile); + nbttagcompound.removeTag("SkullOwner"); + nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); + } + } + + if (TileEntitySkullRenderer.instance != null) + { + GlStateManager.pushMatrix(); + GlStateManager.translate(-0.5F, 0.0F, -0.5F); + GlStateManager.scale(2.0F, 2.0F, 2.0F); + GlStateManager.disableCull(); + TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, EnumFacing.UP, 0.0F, itemStackIn.getMetadata(), gameprofile, -1); + GlStateManager.enableCull(); + GlStateManager.popMatrix(); + } + } + else + { + Block block = Block.getBlockFromItem(itemStackIn.getItem()); + + if (block == Blocks.ender_chest) + { + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.enderChest, 0.0D, 0.0D, 0.0D, 0.0F); + } + else if (block == Blocks.trapped_chest) + { + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F); + } + else + { + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java new file mode 100644 index 0000000..5b31f1b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java @@ -0,0 +1,35 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntityMobSpawner; + +public class TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer +{ + public void renderTileEntityAt(TileEntityMobSpawner te, double x, double y, double z, float partialTicks, int destroyStage) + { + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x + 0.5F, (float)y, (float)z + 0.5F); + renderMob(te.getSpawnerBaseLogic(), x, y, z, partialTicks); + GlStateManager.popMatrix(); + } + + public static void renderMob(MobSpawnerBaseLogic mobSpawnerLogic, double posX, double posY, double posZ, float partialTicks) + { + Entity entity = mobSpawnerLogic.func_180612_a(mobSpawnerLogic.getSpawnerWorld()); + + if (entity != null) + { + float f = 0.4375F; + GlStateManager.translate(0.0F, 0.4F, 0.0F); + GlStateManager.rotate((float)(mobSpawnerLogic.getPrevMobRotation() + (mobSpawnerLogic.getMobRotation() - mobSpawnerLogic.getPrevMobRotation()) * (double)partialTicks) * 10.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-30.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0.0F, -0.4F, 0.0F); + GlStateManager.scale(f, f, f); + entity.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F); + Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java new file mode 100644 index 0000000..9a397af --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityPistonRenderer.java @@ -0,0 +1,79 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.BlockRendererDispatcher; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class TileEntityPistonRenderer extends TileEntitySpecialRenderer +{ + private final BlockRendererDispatcher blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher(); + + public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage) + { + BlockPos blockpos = te.getPos(); + IBlockState iblockstate = te.getPistonState(); + Block block = iblockstate.getBlock(); + + if (block.getMaterial() != Material.air && te.getProgress(partialTicks) < 1.0F) + { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + this.bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + GlStateManager.blendFunc(770, 771); + GlStateManager.enableBlend(); + GlStateManager.disableCull(); + + if (Minecraft.isAmbientOcclusionEnabled()) + { + GlStateManager.shadeModel(7425); + } + else + { + GlStateManager.shadeModel(7424); + } + + worldrenderer.begin(7, DefaultVertexFormats.BLOCK); + worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX() + te.getOffsetX(partialTicks)), (double)((float)y - (float)blockpos.getY() + te.getOffsetY(partialTicks)), (double)((float)z - (float)blockpos.getZ() + te.getOffsetZ(partialTicks))); + World world = this.getWorld(); + + if (block == Blocks.piston_head && te.getProgress(partialTicks) < 0.5F) + { + iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true)); + this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true); + } + else if (te.shouldPistonHeadBeRendered() && !te.isExtending()) + { + BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.sticky_piston ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT; + IBlockState iblockstate1 = Blocks.piston_head.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING)); + iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F)); + this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate1, world, blockpos), iblockstate1, blockpos, worldrenderer, true); + worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX()), (double)((float)y - (float)blockpos.getY()), (double)((float)z - (float)blockpos.getZ())); + iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true)); + this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true); + } + else + { + this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, false); + } + + worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); + tessellator.draw(); + RenderHelper.enableStandardItemLighting(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRen# b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRen# new file mode 100644 index 0000000..cbe9c9d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRen# @@ -0,0 +1,33 @@ +*************** +*** 72,86 **** + public TileEntitySpecialRenderer func_147546_a(Class p_147546_1_) { + TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_); + if(tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) { +- tileentityspecialrenderer = this.func_147546_a(p_147546_1_.getSuperclass()); + this.field_147559_m.put(p_147546_1_, tileentityspecialrenderer); + } + +- return tileentityspecialrenderer; + } + + public TileEntitySpecialRenderer func_147547_b(TileEntity p_147547_1_) { +- return p_147547_1_ == null?null:this.func_147546_a(p_147547_1_.getClass()); + } + + public void func_178470_a(World p_178470_1_, TextureManager p_178470_2_, FontRenderer p_178470_3_, Entity p_178470_4_, float p_178470_5_) { +--- 72,86 ---- + public TileEntitySpecialRenderer func_147546_a(Class p_147546_1_) { + TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_); + if(tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) { ++ tileentityspecialrenderer = this.func_147546_a((Class)p_147546_1_.getSuperclass()); + this.field_147559_m.put(p_147546_1_, tileentityspecialrenderer); + } + ++ return (TileEntitySpecialRenderer)tileentityspecialrenderer; + } + + public TileEntitySpecialRenderer func_147547_b(TileEntity p_147547_1_) { ++ return (TileEntitySpecialRenderer)(p_147547_1_ == null?null:this.func_147546_a(p_147547_1_.getClass())); + } + + public void func_178470_a(World p_178470_1_, TextureManager p_178470_2_, FontRenderer p_178470_3_, Entity p_178470_4_, float p_178470_5_) { diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java new file mode 100644 index 0000000..2db5eae --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java @@ -0,0 +1,235 @@ +package net.minecraft.client.renderer.tileentity; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ReportedException; +import net.minecraft.world.World; +import net.optifine.EmissiveTextures; +import net.optifine.reflect.Reflector; + +public class TileEntityRendererDispatcher +{ + public Map mapSpecialRenderers = Maps.newHashMap(); + public static TileEntityRendererDispatcher instance = new TileEntityRendererDispatcher(); + public FontRenderer fontRenderer; + public static double staticPlayerX; + public static double staticPlayerY; + public static double staticPlayerZ; + public TextureManager renderEngine; + public World worldObj; + public Entity entity; + public float entityYaw; + public float entityPitch; + public double entityX; + public double entityY; + public double entityZ; + public TileEntity tileEntityRendered; + private Tessellator batchBuffer = new Tessellator(2097152); + private boolean drawingBatch = false; + + private TileEntityRendererDispatcher() + { + this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer()); + this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer()); + this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer()); + this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer()); + this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer()); + this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer()); + this.mapSpecialRenderers.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer()); + this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer()); + this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer()); + this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer()); + + for (TileEntitySpecialRenderer tileentityspecialrenderer : this.mapSpecialRenderers.values()) + { + tileentityspecialrenderer.setRendererDispatcher(this); + } + } + + public TileEntitySpecialRenderer getSpecialRendererByClass(Class teClass) + { + TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)this.mapSpecialRenderers.get(teClass); + + if (tileentityspecialrenderer == null && teClass != TileEntity.class) + { + tileentityspecialrenderer = this.getSpecialRendererByClass((Class) teClass.getSuperclass()); + this.mapSpecialRenderers.put(teClass, tileentityspecialrenderer); + } + + return (TileEntitySpecialRenderer) tileentityspecialrenderer; + } + + public TileEntitySpecialRenderer getSpecialRenderer(TileEntity tileEntityIn) + { + return tileEntityIn != null && !tileEntityIn.isInvalid() ? this.getSpecialRendererByClass(tileEntityIn.getClass()) : null; + } + + public void cacheActiveRenderInfo(World worldIn, TextureManager textureManagerIn, FontRenderer fontrendererIn, Entity entityIn, float partialTicks) + { + if (this.worldObj != worldIn) + { + this.setWorld(worldIn); + } + + this.renderEngine = textureManagerIn; + this.entity = entityIn; + this.fontRenderer = fontrendererIn; + this.entityYaw = entityIn.prevRotationYaw + (entityIn.rotationYaw - entityIn.prevRotationYaw) * partialTicks; + this.entityPitch = entityIn.prevRotationPitch + (entityIn.rotationPitch - entityIn.prevRotationPitch) * partialTicks; + this.entityX = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks; + this.entityY = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks; + this.entityZ = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks; + } + + public void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage) + { + if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared()) + { + boolean flag = true; + + if (Reflector.ForgeTileEntity_hasFastRenderer.exists()) + { + flag = !this.drawingBatch || !Reflector.callBoolean(tileentityIn, Reflector.ForgeTileEntity_hasFastRenderer, new Object[0]); + } + + if (flag) + { + RenderHelper.enableStandardItemLighting(); + int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + } + + BlockPos blockpos = tileentityIn.getPos(); + + if (!this.worldObj.isBlockLoaded(blockpos, false)) + { + return; + } + + if (EmissiveTextures.isActive()) + { + EmissiveTextures.beginRender(); + } + + this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage); + + if (EmissiveTextures.isActive()) + { + if (EmissiveTextures.hasEmissive()) + { + EmissiveTextures.beginRenderEmissive(); + this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage); + EmissiveTextures.endRenderEmissive(); + } + + EmissiveTextures.endRender(); + } + } + } + + public void renderTileEntityAt(TileEntity tileEntityIn, double x, double y, double z, float partialTicks) + { + this.renderTileEntityAt(tileEntityIn, x, y, z, partialTicks, -1); + } + + public void renderTileEntityAt(TileEntity tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage) + { + TileEntitySpecialRenderer tileentityspecialrenderer = this.getSpecialRenderer(tileEntityIn); + + if (tileentityspecialrenderer != null) + { + try + { + this.tileEntityRendered = tileEntityIn; + + if (this.drawingBatch && Reflector.callBoolean(tileEntityIn, Reflector.ForgeTileEntity_hasFastRenderer, new Object[0])) + { + tileentityspecialrenderer.renderTileEntityFast(tileEntityIn, x, y, z, partialTicks, destroyStage, this.batchBuffer.getWorldRenderer()); + } + else + { + tileentityspecialrenderer.renderTileEntityAt(tileEntityIn, x, y, z, partialTicks, destroyStage); + } + + this.tileEntityRendered = null; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Block Entity"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block Entity Details"); + tileEntityIn.addInfoToCrashReport(crashreportcategory); + throw new ReportedException(crashreport); + } + } + } + + public void setWorld(World worldIn) + { + this.worldObj = worldIn; + } + + public FontRenderer getFontRenderer() + { + return this.fontRenderer; + } + + public void preDrawBatch() + { + this.batchBuffer.getWorldRenderer().begin(7, DefaultVertexFormats.BLOCK); + this.drawingBatch = true; + } + + public void drawBatch(int p_drawBatch_1_) + { + this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + GlStateManager.blendFunc(770, 771); + GlStateManager.enableBlend(); + GlStateManager.disableCull(); + + if (Minecraft.isAmbientOcclusionEnabled()) + { + GlStateManager.shadeModel(7425); + } + else + { + GlStateManager.shadeModel(7424); + } + + if (p_drawBatch_1_ > 0) + { + this.batchBuffer.getWorldRenderer().sortVertexData((float)staticPlayerX, (float)staticPlayerY, (float)staticPlayerZ); + } + + this.batchBuffer.draw(); + RenderHelper.enableStandardItemLighting(); + this.drawingBatch = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRen~ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRen~ new file mode 100644 index 0000000..a1fffd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRen~ @@ -0,0 +1,209 @@ +package net.minecraft.client.renderer.tileentity; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityBeaconRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityEndPortalRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityEnderChestRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityMobSpawnerRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityPistonRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySignRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ReportedException; +import net.minecraft.world.World; +import net.optifine.EmissiveTextures; +import net.optifine.reflect.Reflector; + +public class TileEntityRendererDispatcher { + public Map, TileEntitySpecialRenderer> field_147559_m = Maps., TileEntitySpecialRenderer>newHashMap(); + public static TileEntityRendererDispatcher field_147556_a = new TileEntityRendererDispatcher(); + public FontRenderer field_147557_n; + public static double field_147554_b; + public static double field_147555_c; + public static double field_147552_d; + public TextureManager field_147553_e; + public World field_147550_f; + public Entity field_147551_g; + public float field_147562_h; + public float field_147563_i; + public double field_147560_j; + public double field_147561_k; + public double field_147558_l; + public TileEntity tileEntityRendered; + private Tessellator batchBuffer = new Tessellator(2097152); + private boolean drawingBatch = false; + + private TileEntityRendererDispatcher() { + this.field_147559_m.put(TileEntitySign.class, new TileEntitySignRenderer()); + this.field_147559_m.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer()); + this.field_147559_m.put(TileEntityPiston.class, new TileEntityPistonRenderer()); + this.field_147559_m.put(TileEntityChest.class, new TileEntityChestRenderer()); + this.field_147559_m.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer()); + this.field_147559_m.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer()); + this.field_147559_m.put(TileEntityEndPortal.class, new TileEntityEndPortalRenderer()); + this.field_147559_m.put(TileEntityBeacon.class, new TileEntityBeaconRenderer()); + this.field_147559_m.put(TileEntitySkull.class, new TileEntitySkullRenderer()); + this.field_147559_m.put(TileEntityBanner.class, new TileEntityBannerRenderer()); + + for(TileEntitySpecialRenderer tileentityspecialrenderer : this.field_147559_m.values()) { + tileentityspecialrenderer.func_147497_a(this); + } + + } + + public TileEntitySpecialRenderer func_147546_a(Class p_147546_1_) { + TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)this.field_147559_m.get(p_147546_1_); + if(tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) { + tileentityspecialrenderer = this.func_147546_a(p_147546_1_.getSuperclass()); + this.field_147559_m.put(p_147546_1_, tileentityspecialrenderer); + } + + return tileentityspecialrenderer; + } + + public TileEntitySpecialRenderer func_147547_b(TileEntity p_147547_1_) { + return p_147547_1_ != null && !p_147547_1_.func_145837_r()?this.func_147546_a(p_147547_1_.getClass()):null; + } + + public void func_178470_a(World p_178470_1_, TextureManager p_178470_2_, FontRenderer p_178470_3_, Entity p_178470_4_, float p_178470_5_) { + if(this.field_147550_f != p_178470_1_) { + this.func_147543_a(p_178470_1_); + } + + this.field_147553_e = p_178470_2_; + this.field_147551_g = p_178470_4_; + this.field_147557_n = p_178470_3_; + this.field_147562_h = p_178470_4_.field_70126_B + (p_178470_4_.field_70177_z - p_178470_4_.field_70126_B) * p_178470_5_; + this.field_147563_i = p_178470_4_.field_70127_C + (p_178470_4_.field_70125_A - p_178470_4_.field_70127_C) * p_178470_5_; + this.field_147560_j = p_178470_4_.field_70142_S + (p_178470_4_.field_70165_t - p_178470_4_.field_70142_S) * (double)p_178470_5_; + this.field_147561_k = p_178470_4_.field_70137_T + (p_178470_4_.field_70163_u - p_178470_4_.field_70137_T) * (double)p_178470_5_; + this.field_147558_l = p_178470_4_.field_70136_U + (p_178470_4_.field_70161_v - p_178470_4_.field_70136_U) * (double)p_178470_5_; + } + + public void func_180546_a(TileEntity p_180546_1_, float p_180546_2_, int p_180546_3_) { + if(p_180546_1_.func_145835_a(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_180546_1_.func_145833_n()) { + boolean flag = true; + if(Reflector.ForgeTileEntity_hasFastRenderer.exists()) { + flag = !this.drawingBatch || !Reflector.callBoolean(p_180546_1_, Reflector.ForgeTileEntity_hasFastRenderer, new Object[0]); + } + + if(flag) { + RenderHelper.func_74519_b(); + int i = this.field_147550_f.func_175626_b(p_180546_1_.func_174877_v(), 0); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + } + + BlockPos blockpos = p_180546_1_.func_174877_v(); + if(!this.field_147550_f.func_175668_a(blockpos, false)) { + return; + } + + if(EmissiveTextures.isActive()) { + EmissiveTextures.beginRender(); + } + + this.func_178469_a(p_180546_1_, (double)blockpos.n() - field_147554_b, (double)blockpos.o() - field_147555_c, (double)blockpos.p() - field_147552_d, p_180546_2_, p_180546_3_); + if(EmissiveTextures.isActive()) { + if(EmissiveTextures.hasEmissive()) { + EmissiveTextures.beginRenderEmissive(); + this.func_178469_a(p_180546_1_, (double)blockpos.n() - field_147554_b, (double)blockpos.o() - field_147555_c, (double)blockpos.p() - field_147552_d, p_180546_2_, p_180546_3_); + EmissiveTextures.endRenderEmissive(); + } + + EmissiveTextures.endRender(); + } + } + + } + + public void func_147549_a(TileEntity p_147549_1_, double p_147549_2_, double p_147549_4_, double p_147549_6_, float p_147549_8_) { + this.func_178469_a(p_147549_1_, p_147549_2_, p_147549_4_, p_147549_6_, p_147549_8_, -1); + } + + public void func_178469_a(TileEntity p_178469_1_, double p_178469_2_, double p_178469_4_, double p_178469_6_, float p_178469_8_, int p_178469_9_) { + TileEntitySpecialRenderer tileentityspecialrenderer = this.func_147547_b(p_178469_1_); + if(tileentityspecialrenderer != null) { + try { + this.tileEntityRendered = p_178469_1_; + if(this.drawingBatch && Reflector.callBoolean(p_178469_1_, Reflector.ForgeTileEntity_hasFastRenderer, new Object[0])) { + tileentityspecialrenderer.renderTileEntityFast(p_178469_1_, p_178469_2_, p_178469_4_, p_178469_6_, p_178469_8_, p_178469_9_, this.batchBuffer.func_178180_c()); + } else { + tileentityspecialrenderer.func_180535_a(p_178469_1_, p_178469_2_, p_178469_4_, p_178469_6_, p_178469_8_, p_178469_9_); + } + + this.tileEntityRendered = null; + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.func_85055_a(throwable, "Rendering Block Entity"); + CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block Entity Details"); + p_178469_1_.func_145828_a(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + } + + public void func_147543_a(World p_147543_1_) { + this.field_147550_f = p_147543_1_; + } + + public FontRenderer func_147548_a() { + return this.field_147557_n; + } + + public void preDrawBatch() { + this.batchBuffer.func_178180_c().func_181668_a(7, DefaultVertexFormats.field_176600_a); + this.drawingBatch = true; + } + + public void drawBatch(int p_drawBatch_1_) { + this.field_147553_e.func_110577_a(TextureMap.field_110575_b); + RenderHelper.func_74518_a(); + GlStateManager.func_179112_b(770, 771); + GlStateManager.func_179147_l(); + GlStateManager.func_179129_p(); + if(Minecraft.func_71379_u()) { + GlStateManager.func_179103_j(7425); + } else { + GlStateManager.func_179103_j(7424); + } + + if(p_drawBatch_1_ > 0) { + this.batchBuffer.func_178180_c().func_181674_a((float)field_147554_b, (float)field_147555_c, (float)field_147552_d); + } + + this.batchBuffer.func_78381_a(); + RenderHelper.func_74519_b(); + this.drawingBatch = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java new file mode 100644 index 0000000..c42b076 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java @@ -0,0 +1,173 @@ +package net.minecraft.client.renderer.tileentity; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiUtilRenderComponents; +import net.minecraft.client.gui.inventory.GuiEditSign; +import net.minecraft.client.model.ModelSign; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; +import net.optifine.CustomColors; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.GL11; + +public class TileEntitySignRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation SIGN_TEXTURE = new ResourceLocation("textures/entity/sign.png"); + + /** The ModelSign instance for use in this renderer */ + private final ModelSign model = new ModelSign(); + private static double textRenderDistanceSq = 4096.0D; + + public void renderTileEntityAt(TileEntitySign te, double x, double y, double z, float partialTicks, int destroyStage) + { + Block block = te.getBlockType(); + GlStateManager.pushMatrix(); + float f = 0.6666667F; + + if (block == Blocks.standing_sign) + { + GlStateManager.translate((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); + float f1 = (float)(te.getBlockMetadata() * 360) / 16.0F; + GlStateManager.rotate(-f1, 0.0F, 1.0F, 0.0F); + this.model.signStick.showModel = true; + } + else + { + int k = te.getBlockMetadata(); + float f2 = 0.0F; + + if (k == 2) + { + f2 = 180.0F; + } + + if (k == 4) + { + f2 = 90.0F; + } + + if (k == 5) + { + f2 = -90.0F; + } + + GlStateManager.translate((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F); + GlStateManager.rotate(-f2, 0.0F, 1.0F, 0.0F); + GlStateManager.translate(0.0F, -0.3125F, -0.4375F); + this.model.signStick.showModel = false; + } + + if (destroyStage >= 0) + { + this.bindTexture(DESTROY_STAGES[destroyStage]); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(4.0F, 2.0F, 1.0F); + GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); + GlStateManager.matrixMode(5888); + } + else + { + this.bindTexture(SIGN_TEXTURE); + } + + GlStateManager.enableRescaleNormal(); + GlStateManager.pushMatrix(); + GlStateManager.scale(f, -f, -f); + this.model.renderSign(); + GlStateManager.popMatrix(); + + if (isRenderText(te)) + { + FontRenderer fontrenderer = this.getFontRenderer(); + float f3 = 0.015625F * f; + GlStateManager.translate(0.0F, 0.5F * f, 0.07F * f); + GlStateManager.scale(f3, -f3, f3); + GL11.glNormal3f(0.0F, 0.0F, -1.0F * f3); + GlStateManager.depthMask(false); + int i = 0; + + if (Config.isCustomColors()) + { + i = CustomColors.getSignTextColor(i); + } + + if (destroyStage < 0) + { + for (int j = 0; j < te.signText.length; ++j) + { + if (te.signText[j] != null) + { + IChatComponent ichatcomponent = te.signText[j]; + List list = GuiUtilRenderComponents.splitText(ichatcomponent, 90, fontrenderer, false, true); + String s = list != null && list.size() > 0 ? ((IChatComponent)list.get(0)).getFormattedText() : ""; + + if (j == te.lineBeingEdited) + { + s = "> " + s + " <"; + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, j * 10 - te.signText.length * 5, i); + } + else + { + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, j * 10 - te.signText.length * 5, i); + } + } + } + } + } + + GlStateManager.depthMask(true); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + + if (destroyStage >= 0) + { + GlStateManager.matrixMode(5890); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + } + } + + private static boolean isRenderText(TileEntitySign p_isRenderText_0_) + { + if (Shaders.isShadowPass) + { + return false; + } + else if (Config.getMinecraft().currentScreen instanceof GuiEditSign) + { + return true; + } + else + { + if (!Config.zoomMode && p_isRenderText_0_.lineBeingEdited < 0) + { + Entity entity = Config.getMinecraft().getRenderViewEntity(); + double d0 = p_isRenderText_0_.getDistanceSq(entity.posX, entity.posY, entity.posZ); + + if (d0 > textRenderDistanceSq) + { + return false; + } + } + + return true; + } + } + + public static void updateTextRenderDistance() + { + Minecraft minecraft = Config.getMinecraft(); + double d0 = (double)Config.limit(minecraft.gameSettings.gammaSetting, 1.0F, 120.0F); + double d1 = Math.max(1.5D * (double)minecraft.displayHeight / d0, 16.0D); + textRenderDistanceSq = d1 * d1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java new file mode 100644 index 0000000..e654b8f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java @@ -0,0 +1,150 @@ +package net.minecraft.client.renderer.tileentity; + +import com.cheatbreaker.client.CheatBreaker; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelHumanoidHead; +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; + +import java.util.Map; +import java.util.UUID; + +public class TileEntitySkullRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation SKELETON_TEXTURES = new ResourceLocation("textures/entity/skeleton/skeleton.png"); + private static final ResourceLocation WITHER_SKELETON_TEXTURES = new ResourceLocation("textures/entity/skeleton/wither_skeleton.png"); + private static final ResourceLocation ZOMBIE_TEXTURES = new ResourceLocation("textures/entity/zombie/zombie.png"); + private static final ResourceLocation CREEPER_TEXTURES = new ResourceLocation("textures/entity/creeper/creeper.png"); + public static TileEntitySkullRenderer instance; + private final ModelSkeletonHead skeletonHead = new ModelSkeletonHead(0, 0, 64, 32); + private final ModelSkeletonHead humanoidHead = new ModelHumanoidHead(); + + public void renderTileEntityAt(TileEntitySkull te, double x, double y, double z, float partialTicks, int destroyStage) + { + if (CheatBreaker.getInstance().getGlobalSettings().hidePlacedSkulls.getBooleanValue()) return; + EnumFacing enumfacing = EnumFacing.getFront(te.getBlockMetadata() & 7); + this.renderSkull((float)x, (float)y, (float)z, enumfacing, (float)(te.getSkullRotation() * 360) / 16.0F, te.getSkullType(), te.getPlayerProfile(), destroyStage); + } + + public void setRendererDispatcher(TileEntityRendererDispatcher rendererDispatcherIn) + { + super.setRendererDispatcher(rendererDispatcherIn); + instance = this; + } + + public void renderSkull(float p_180543_1_, float p_180543_2_, float p_180543_3_, EnumFacing p_180543_4_, float p_180543_5_, int p_180543_6_, GameProfile p_180543_7_, int p_180543_8_) + { + ModelBase modelbase = this.skeletonHead; + + if (p_180543_8_ >= 0) + { + this.bindTexture(DESTROY_STAGES[p_180543_8_]); + GlStateManager.matrixMode(5890); + GlStateManager.pushMatrix(); + GlStateManager.scale(4.0F, 2.0F, 1.0F); + GlStateManager.translate(0.0625F, 0.0625F, 0.0625F); + GlStateManager.matrixMode(5888); + } + else + { + switch (p_180543_6_) + { + case 0: + default: + this.bindTexture(SKELETON_TEXTURES); + break; + + case 1: + this.bindTexture(WITHER_SKELETON_TEXTURES); + break; + + case 2: + this.bindTexture(ZOMBIE_TEXTURES); + modelbase = this.humanoidHead; + break; + + case 3: + modelbase = this.humanoidHead; + ResourceLocation resourcelocation = DefaultPlayerSkin.getDefaultSkinLegacy(); + + if (p_180543_7_ != null) + { + Minecraft minecraft = Minecraft.getMinecraft(); + Map map = minecraft.getSkinManager().loadSkinFromCache(p_180543_7_); + + if (map.containsKey(Type.SKIN)) + { + resourcelocation = minecraft.getSkinManager().loadSkin((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN); + } + else + { + UUID uuid = EntityPlayer.getUUID(p_180543_7_); + resourcelocation = DefaultPlayerSkin.getDefaultSkin(uuid); + } + } + + this.bindTexture(resourcelocation); + break; + + case 4: + this.bindTexture(CREEPER_TEXTURES); + } + } + + GlStateManager.pushMatrix(); + GlStateManager.disableCull(); + + if (p_180543_4_ != EnumFacing.UP) + { + switch (p_180543_4_) + { + case NORTH: + GlStateManager.translate(p_180543_1_ + 0.5F, p_180543_2_ + 0.25F, p_180543_3_ + 0.74F); + break; + + case SOUTH: + GlStateManager.translate(p_180543_1_ + 0.5F, p_180543_2_ + 0.25F, p_180543_3_ + 0.26F); + p_180543_5_ = 180.0F; + break; + + case WEST: + GlStateManager.translate(p_180543_1_ + 0.74F, p_180543_2_ + 0.25F, p_180543_3_ + 0.5F); + p_180543_5_ = 270.0F; + break; + + case EAST: + default: + GlStateManager.translate(p_180543_1_ + 0.26F, p_180543_2_ + 0.25F, p_180543_3_ + 0.5F); + p_180543_5_ = 90.0F; + } + } + else + { + GlStateManager.translate(p_180543_1_ + 0.5F, p_180543_2_, p_180543_3_ + 0.5F); + } + + float f = 0.0625F; + GlStateManager.enableRescaleNormal(); + GlStateManager.scale(-1.0F, -1.0F, 1.0F); + GlStateManager.enableAlpha(); + modelbase.render((Entity)null, 0.0F, 0.0F, 0.0F, p_180543_5_, 0.0F, f); + GlStateManager.popMatrix(); + + if (p_180543_8_ >= 0) + { + GlStateManager.matrixMode(5890); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java new file mode 100644 index 0000000..e315576 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java @@ -0,0 +1,73 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.optifine.entity.model.IEntityRenderer; + +public abstract class TileEntitySpecialRenderer implements IEntityRenderer +{ + protected static final ResourceLocation[] DESTROY_STAGES = new ResourceLocation[] {new ResourceLocation("textures/blocks/destroy_stage_0.png"), new ResourceLocation("textures/blocks/destroy_stage_1.png"), new ResourceLocation("textures/blocks/destroy_stage_2.png"), new ResourceLocation("textures/blocks/destroy_stage_3.png"), new ResourceLocation("textures/blocks/destroy_stage_4.png"), new ResourceLocation("textures/blocks/destroy_stage_5.png"), new ResourceLocation("textures/blocks/destroy_stage_6.png"), new ResourceLocation("textures/blocks/destroy_stage_7.png"), new ResourceLocation("textures/blocks/destroy_stage_8.png"), new ResourceLocation("textures/blocks/destroy_stage_9.png")}; + protected TileEntityRendererDispatcher rendererDispatcher; + private Class tileEntityClass = null; + private ResourceLocation locationTextureCustom = null; + + public abstract void renderTileEntityAt(T te, double x, double y, double z, float partialTicks, int destroyStage); + + protected void bindTexture(ResourceLocation location) + { + TextureManager texturemanager = this.rendererDispatcher.renderEngine; + + if (texturemanager != null) + { + texturemanager.bindTexture(location); + } + } + + protected World getWorld() + { + return this.rendererDispatcher.worldObj; + } + + public void setRendererDispatcher(TileEntityRendererDispatcher rendererDispatcherIn) + { + this.rendererDispatcher = rendererDispatcherIn; + } + + public FontRenderer getFontRenderer() + { + return this.rendererDispatcher.getFontRenderer(); + } + + public boolean forceTileEntityRender() + { + return false; + } + + public void renderTileEntityFast(T p_renderTileEntityFast_1_, double p_renderTileEntityFast_2_, double p_renderTileEntityFast_4_, double p_renderTileEntityFast_6_, float p_renderTileEntityFast_8_, int p_renderTileEntityFast_9_, WorldRenderer p_renderTileEntityFast_10_) + { + } + + public Class getEntityClass() + { + return this.tileEntityClass; + } + + public void setEntityClass(Class p_setEntityClass_1_) + { + this.tileEntityClass = p_setEntityClass_1_; + } + + public ResourceLocation getLocationTextureCustom() + { + return this.locationTextureCustom; + } + + public void setLocationTextureCustom(ResourceLocation p_setLocationTextureCustom_1_) + { + this.locationTextureCustom = p_setLocationTextureCustom_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/DefaultVertexFormats.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/DefaultVertexFormats.java new file mode 100644 index 0000000..fa33b7e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/DefaultVertexFormats.java @@ -0,0 +1,128 @@ +package net.minecraft.client.renderer.vertex; + +import java.lang.reflect.Field; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumType; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; +import net.minecraft.src.Config; +import net.optifine.reflect.ReflectorClass; +import net.optifine.reflect.ReflectorField; +import net.optifine.shaders.SVertexFormat; + +public class DefaultVertexFormats +{ + public static VertexFormat BLOCK = new VertexFormat(); + public static VertexFormat ITEM = new VertexFormat(); + private static final VertexFormat BLOCK_VANILLA = BLOCK; + private static final VertexFormat ITEM_VANILLA = ITEM; + public static ReflectorClass Attributes = new ReflectorClass("net.minecraftforge.client.model.Attributes"); + public static ReflectorField Attributes_DEFAULT_BAKED_FORMAT = new ReflectorField(Attributes, "DEFAULT_BAKED_FORMAT"); + private static final VertexFormat FORGE_BAKED = SVertexFormat.duplicate((VertexFormat)getFieldValue(Attributes_DEFAULT_BAKED_FORMAT)); + public static final VertexFormat OLDMODEL_POSITION_TEX_NORMAL = new VertexFormat(); + public static final VertexFormat PARTICLE_POSITION_TEX_COLOR_LMAP = new VertexFormat(); + public static final VertexFormat POSITION = new VertexFormat(); + public static final VertexFormat POSITION_COLOR = new VertexFormat(); + public static final VertexFormat POSITION_TEX = new VertexFormat(); + public static final VertexFormat POSITION_NORMAL = new VertexFormat(); + public static final VertexFormat POSITION_TEX_COLOR = new VertexFormat(); + public static final VertexFormat POSITION_TEX_NORMAL = new VertexFormat(); + public static final VertexFormat POSITION_TEX_LMAP_COLOR = new VertexFormat(); + public static final VertexFormat POSITION_TEX_COLOR_NORMAL = new VertexFormat(); + public static final VertexFormatElement POSITION_3F = new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.POSITION, 3); + public static final VertexFormatElement COLOR_4UB = new VertexFormatElement(0, EnumType.UBYTE, EnumUsage.COLOR, 4); + public static final VertexFormatElement TEX_2F = new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.UV, 2); + public static final VertexFormatElement TEX_2S = new VertexFormatElement(1, EnumType.SHORT, EnumUsage.UV, 2); + public static final VertexFormatElement NORMAL_3B = new VertexFormatElement(0, EnumType.BYTE, EnumUsage.NORMAL, 3); + public static final VertexFormatElement PADDING_1B = new VertexFormatElement(0, EnumType.BYTE, EnumUsage.PADDING, 1); + + public static void updateVertexFormats() + { + if (Config.isShaders()) + { + BLOCK = SVertexFormat.makeDefVertexFormatBlock(); + ITEM = SVertexFormat.makeDefVertexFormatItem(); + + if (Attributes_DEFAULT_BAKED_FORMAT.exists()) + { + SVertexFormat.setDefBakedFormat((VertexFormat)Attributes_DEFAULT_BAKED_FORMAT.getValue()); + } + } + else + { + BLOCK = BLOCK_VANILLA; + ITEM = ITEM_VANILLA; + + if (Attributes_DEFAULT_BAKED_FORMAT.exists()) + { + SVertexFormat.copy(FORGE_BAKED, (VertexFormat)Attributes_DEFAULT_BAKED_FORMAT.getValue()); + } + } + } + + public static Object getFieldValue(ReflectorField p_getFieldValue_0_) + { + try + { + Field field = p_getFieldValue_0_.getTargetField(); + + if (field == null) + { + return null; + } + else + { + Object object = field.get((Object)null); + return object; + } + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + return null; + } + } + + static + { + BLOCK.addElement(POSITION_3F); + BLOCK.addElement(COLOR_4UB); + BLOCK.addElement(TEX_2F); + BLOCK.addElement(TEX_2S); + ITEM.addElement(POSITION_3F); + ITEM.addElement(COLOR_4UB); + ITEM.addElement(TEX_2F); + ITEM.addElement(NORMAL_3B); + ITEM.addElement(PADDING_1B); + OLDMODEL_POSITION_TEX_NORMAL.addElement(POSITION_3F); + OLDMODEL_POSITION_TEX_NORMAL.addElement(TEX_2F); + OLDMODEL_POSITION_TEX_NORMAL.addElement(NORMAL_3B); + OLDMODEL_POSITION_TEX_NORMAL.addElement(PADDING_1B); + PARTICLE_POSITION_TEX_COLOR_LMAP.addElement(POSITION_3F); + PARTICLE_POSITION_TEX_COLOR_LMAP.addElement(TEX_2F); + PARTICLE_POSITION_TEX_COLOR_LMAP.addElement(COLOR_4UB); + PARTICLE_POSITION_TEX_COLOR_LMAP.addElement(TEX_2S); + POSITION.addElement(POSITION_3F); + POSITION_COLOR.addElement(POSITION_3F); + POSITION_COLOR.addElement(COLOR_4UB); + POSITION_TEX.addElement(POSITION_3F); + POSITION_TEX.addElement(TEX_2F); + POSITION_NORMAL.addElement(POSITION_3F); + POSITION_NORMAL.addElement(NORMAL_3B); + POSITION_NORMAL.addElement(PADDING_1B); + POSITION_TEX_COLOR.addElement(POSITION_3F); + POSITION_TEX_COLOR.addElement(TEX_2F); + POSITION_TEX_COLOR.addElement(COLOR_4UB); + POSITION_TEX_NORMAL.addElement(POSITION_3F); + POSITION_TEX_NORMAL.addElement(TEX_2F); + POSITION_TEX_NORMAL.addElement(NORMAL_3B); + POSITION_TEX_NORMAL.addElement(PADDING_1B); + POSITION_TEX_LMAP_COLOR.addElement(POSITION_3F); + POSITION_TEX_LMAP_COLOR.addElement(TEX_2F); + POSITION_TEX_LMAP_COLOR.addElement(TEX_2S); + POSITION_TEX_LMAP_COLOR.addElement(COLOR_4UB); + POSITION_TEX_COLOR_NORMAL.addElement(POSITION_3F); + POSITION_TEX_COLOR_NORMAL.addElement(TEX_2F); + POSITION_TEX_COLOR_NORMAL.addElement(COLOR_4UB); + POSITION_TEX_COLOR_NORMAL.addElement(NORMAL_3B); + POSITION_TEX_COLOR_NORMAL.addElement(PADDING_1B); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexBuffer.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexBuffer.java new file mode 100644 index 0000000..d31f146 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexBuffer.java @@ -0,0 +1,104 @@ +package net.minecraft.client.renderer.vertex; + +import java.nio.ByteBuffer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.optifine.render.VboRange; +import net.optifine.render.VboRegion; +import org.lwjgl.opengl.GL11; + +public class VertexBuffer +{ + private int glBufferId; + private final VertexFormat vertexFormat; + private int count; + private VboRegion vboRegion; + private VboRange vboRange; + private int drawMode; + + public VertexBuffer(VertexFormat vertexFormatIn) + { + this.vertexFormat = vertexFormatIn; + this.glBufferId = OpenGlHelper.glGenBuffers(); + } + + public void bindBuffer() + { + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, this.glBufferId); + } + + public void bufferData(ByteBuffer p_181722_1_) + { + if (this.vboRegion != null) + { + this.vboRegion.bufferData(p_181722_1_, this.vboRange); + } + else + { + this.bindBuffer(); + OpenGlHelper.glBufferData(OpenGlHelper.GL_ARRAY_BUFFER, p_181722_1_, 35044); + this.unbindBuffer(); + this.count = p_181722_1_.limit() / this.vertexFormat.getNextOffset(); + } + } + + public void drawArrays(int mode) + { + if (this.drawMode > 0) + { + mode = this.drawMode; + } + + if (this.vboRegion != null) + { + this.vboRegion.drawArrays(mode, this.vboRange); + } + else + { + GL11.glDrawArrays(mode, 0, this.count); + } + } + + public void unbindBuffer() + { + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0); + } + + public void deleteGlBuffers() + { + if (this.glBufferId >= 0) + { + OpenGlHelper.glDeleteBuffers(this.glBufferId); + this.glBufferId = -1; + } + } + + public void setVboRegion(VboRegion p_setVboRegion_1_) + { + if (p_setVboRegion_1_ != null) + { + this.deleteGlBuffers(); + this.vboRegion = p_setVboRegion_1_; + this.vboRange = new VboRange(); + } + } + + public VboRegion getVboRegion() + { + return this.vboRegion; + } + + public VboRange getVboRange() + { + return this.vboRange; + } + + public int getDrawMode() + { + return this.drawMode; + } + + public void setDrawMode(int p_setDrawMode_1_) + { + this.drawMode = p_setDrawMode_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexFormat.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexFormat.java new file mode 100644 index 0000000..e82dc9c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexFormat.java @@ -0,0 +1,200 @@ +package net.minecraft.client.renderer.vertex; + +import com.google.common.collect.Lists; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class VertexFormat +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final List elements; + private final List offsets; + private int nextOffset; + private int colorElementOffset; + private List uvOffsetsById; + private int normalElementOffset; + + public VertexFormat(VertexFormat vertexFormatIn) + { + this(); + + for (int i = 0; i < vertexFormatIn.getElementCount(); ++i) + { + this.addElement(vertexFormatIn.getElement(i)); + } + + this.nextOffset = vertexFormatIn.getNextOffset(); + } + + public VertexFormat() + { + this.elements = Lists.newArrayList(); + this.offsets = Lists.newArrayList(); + this.nextOffset = 0; + this.colorElementOffset = -1; + this.uvOffsetsById = Lists.newArrayList(); + this.normalElementOffset = -1; + } + + public void clear() + { + this.elements.clear(); + this.offsets.clear(); + this.colorElementOffset = -1; + this.uvOffsetsById.clear(); + this.normalElementOffset = -1; + this.nextOffset = 0; + } + + @SuppressWarnings("incomplete-switch") + public VertexFormat addElement(VertexFormatElement element) + { + if (element.isPositionElement() && this.hasPosition()) + { + LOGGER.warn("VertexFormat error: Trying to add a position VertexFormatElement when one already exists, ignoring."); + return this; + } + else + { + this.elements.add(element); + this.offsets.add(Integer.valueOf(this.nextOffset)); + + switch (element.getUsage()) + { + case NORMAL: + this.normalElementOffset = this.nextOffset; + break; + + case COLOR: + this.colorElementOffset = this.nextOffset; + break; + + case UV: + this.uvOffsetsById.add(element.getIndex(), Integer.valueOf(this.nextOffset)); + } + + this.nextOffset += element.getSize(); + return this; + } + } + + public boolean hasNormal() + { + return this.normalElementOffset >= 0; + } + + public int getNormalOffset() + { + return this.normalElementOffset; + } + + public boolean hasColor() + { + return this.colorElementOffset >= 0; + } + + public int getColorOffset() + { + return this.colorElementOffset; + } + + public boolean hasUvOffset(int id) + { + return this.uvOffsetsById.size() - 1 >= id; + } + + public int getUvOffsetById(int id) + { + return ((Integer)this.uvOffsetsById.get(id)).intValue(); + } + + public String toString() + { + String s = "format: " + this.elements.size() + " elements: "; + + for (int i = 0; i < this.elements.size(); ++i) + { + s = s + ((VertexFormatElement)this.elements.get(i)).toString(); + + if (i != this.elements.size() - 1) + { + s = s + " "; + } + } + + return s; + } + + private boolean hasPosition() + { + int i = 0; + + for (int j = this.elements.size(); i < j; ++i) + { + VertexFormatElement vertexformatelement = (VertexFormatElement)this.elements.get(i); + + if (vertexformatelement.isPositionElement()) + { + return true; + } + } + + return false; + } + + public int getIntegerSize() + { + return this.getNextOffset() / 4; + } + + public int getNextOffset() + { + return this.nextOffset; + } + + public List getElements() + { + return this.elements; + } + + public int getElementCount() + { + return this.elements.size(); + } + + public VertexFormatElement getElement(int index) + { + return (VertexFormatElement)this.elements.get(index); + } + + public int getOffset(int p_181720_1_) + { + return ((Integer)this.offsets.get(p_181720_1_)).intValue(); + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + VertexFormat vertexformat = (VertexFormat)p_equals_1_; + return this.nextOffset != vertexformat.nextOffset ? false : (!this.elements.equals(vertexformat.elements) ? false : this.offsets.equals(vertexformat.offsets)); + } + else + { + return false; + } + } + + public int hashCode() + { + int i = this.elements.hashCode(); + i = 31 * i + this.offsets.hashCode(); + i = 31 * i + this.nextOffset; + return i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexFormatElement.java b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexFormatElement.java new file mode 100644 index 0000000..4986be7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/renderer/vertex/VertexFormatElement.java @@ -0,0 +1,156 @@ +package net.minecraft.client.renderer.vertex; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class VertexFormatElement +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final VertexFormatElement.EnumType type; + private final VertexFormatElement.EnumUsage usage; + private int index; + private int elementCount; + + public VertexFormatElement(int indexIn, VertexFormatElement.EnumType typeIn, VertexFormatElement.EnumUsage usageIn, int count) + { + if (!this.func_177372_a(indexIn, usageIn)) + { + LOGGER.warn("Multiple vertex elements of the same type other than UVs are not supported. Forcing type to UV."); + this.usage = VertexFormatElement.EnumUsage.UV; + } + else + { + this.usage = usageIn; + } + + this.type = typeIn; + this.index = indexIn; + this.elementCount = count; + } + + private final boolean func_177372_a(int p_177372_1_, VertexFormatElement.EnumUsage p_177372_2_) + { + return p_177372_1_ == 0 || p_177372_2_ == VertexFormatElement.EnumUsage.UV; + } + + public final VertexFormatElement.EnumType getType() + { + return this.type; + } + + public final VertexFormatElement.EnumUsage getUsage() + { + return this.usage; + } + + public final int getElementCount() + { + return this.elementCount; + } + + public final int getIndex() + { + return this.index; + } + + public String toString() + { + return this.elementCount + "," + this.usage.getDisplayName() + "," + this.type.getDisplayName(); + } + + public final int getSize() + { + return this.type.getSize() * this.elementCount; + } + + public final boolean isPositionElement() + { + return this.usage == VertexFormatElement.EnumUsage.POSITION; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + VertexFormatElement vertexformatelement = (VertexFormatElement)p_equals_1_; + return this.elementCount != vertexformatelement.elementCount ? false : (this.index != vertexformatelement.index ? false : (this.type != vertexformatelement.type ? false : this.usage == vertexformatelement.usage)); + } + else + { + return false; + } + } + + public int hashCode() + { + int i = this.type.hashCode(); + i = 31 * i + this.usage.hashCode(); + i = 31 * i + this.index; + i = 31 * i + this.elementCount; + return i; + } + + public static enum EnumType + { + FLOAT(4, "Float", 5126), + UBYTE(1, "Unsigned Byte", 5121), + BYTE(1, "Byte", 5120), + USHORT(2, "Unsigned Short", 5123), + SHORT(2, "Short", 5122), + UINT(4, "Unsigned Int", 5125), + INT(4, "Int", 5124); + + private final int size; + private final String displayName; + private final int glConstant; + + private EnumType(int sizeIn, String displayNameIn, int glConstantIn) + { + this.size = sizeIn; + this.displayName = displayNameIn; + this.glConstant = glConstantIn; + } + + public int getSize() + { + return this.size; + } + + public String getDisplayName() + { + return this.displayName; + } + + public int getGlConstant() + { + return this.glConstant; + } + } + + public static enum EnumUsage + { + POSITION("Position"), + NORMAL("Normal"), + COLOR("Vertex Color"), + UV("UV"), + MATRIX("Bone Matrix"), + BLEND_WEIGHT("Blend Weight"), + PADDING("Padding"); + + private final String displayName; + + private EnumUsage(String displayNameIn) + { + this.displayName = displayNameIn; + } + + public String getDisplayName() + { + return this.displayName; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java new file mode 100644 index 0000000..b7ce326 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java @@ -0,0 +1,113 @@ +package net.minecraft.client.resources; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.util.manager.BranchManager; +import com.google.common.base.Charsets; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.concurrent.ForkJoinPool; + +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.imageio.ImageIO; + +public abstract class AbstractResourcePack implements IResourcePack { + private static final Logger resourceLog = LogManager.getLogger(); + public final File resourcePackFile; + public static final int SIZE_CAP = 64; + + public AbstractResourcePack(File resourcePackFileIn) { + this.resourcePackFile = resourcePackFileIn; + } + + private static String locationToName(ResourceLocation location) { + return String.format("%s/%s/%s", new Object[]{"assets", location.getResourceDomain(), location.getResourcePath()}); + } + + protected static String getRelativeName(File p_110595_0_, File p_110595_1_) { + return p_110595_0_.toURI().relativize(p_110595_1_.toURI()).getPath(); + } + + public InputStream getInputStream(ResourceLocation location) throws IOException { + return this.getInputStreamByName(locationToName(location)); + } + + public boolean resourceExists(ResourceLocation location) { + return this.hasResourceName(locationToName(location)); + } + + protected abstract InputStream getInputStreamByName(String name) throws IOException; + + protected abstract boolean hasResourceName(String name); + + protected void logNameNotLowercase(String name) { + resourceLog.warn("ResourcePack: ignored non-lowercase namespace: {} in {}", new Object[]{name, this.resourcePackFile}); + } + + public T getPackMetadata(IMetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { + return readMetadata(metadataSerializer, this.getInputStreamByName("pack.mcmeta"), metadataSectionName); + } + + static T readMetadata(IMetadataSerializer p_110596_0_, InputStream p_110596_1_, String p_110596_2_) { + JsonObject jsonobject = null; + BufferedReader bufferedreader = null; + + try { + bufferedreader = new BufferedReader(new InputStreamReader(p_110596_1_, Charsets.UTF_8)); + jsonobject = (new JsonParser()).parse((Reader) bufferedreader).getAsJsonObject(); + } catch (RuntimeException runtimeexception) { + throw new JsonParseException(runtimeexception); + } finally { + IOUtils.closeQuietly((Reader) bufferedreader); + } + + return (T) p_110596_0_.parseMetadataSection(p_110596_2_, jsonobject); + } + + public BufferedImage getPackImage() throws IOException { + try { + return scalePackImage(TextureUtil.readBufferedImage(this.getInputStreamByName("pack.png"))); + } catch (IOException e) { + return Config.getDefaultResourcePack().getPackImage(); + } + } + + public BufferedImage scalePackImage(BufferedImage image) { + if (image == null) { + return null; + } + if (image.getWidth() > SIZE_CAP || image.getHeight() > SIZE_CAP) { + resourceLog.info("[Icon Scaler] Scaling resource pack icon from " + image.getWidth() + " to " + SIZE_CAP); + BufferedImage smallImage = new BufferedImage(SIZE_CAP, SIZE_CAP, BufferedImage.TYPE_INT_ARGB); + Graphics graphics = smallImage.getGraphics(); + graphics.drawImage(image, 0, 0, SIZE_CAP, SIZE_CAP, null); + graphics.dispose(); + return smallImage; + } else { + resourceLog.info("[Icon Scaler] Retaining pack icon scale at " + image.getWidth()); + return image; + } + + } + + public String getPackName() { + return this.resourcePackFile.getName(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/DefaultPlayerSkin.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/DefaultPlayerSkin.java new file mode 100644 index 0000000..8564d2b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/DefaultPlayerSkin.java @@ -0,0 +1,30 @@ +package net.minecraft.client.resources; + +import java.util.UUID; +import net.minecraft.util.ResourceLocation; + +public class DefaultPlayerSkin +{ + private static final ResourceLocation TEXTURE_STEVE = new ResourceLocation("textures/entity/steve.png"); + private static final ResourceLocation TEXTURE_ALEX = new ResourceLocation("textures/entity/alex.png"); + + public static ResourceLocation getDefaultSkinLegacy() + { + return TEXTURE_STEVE; + } + + public static ResourceLocation getDefaultSkin(UUID playerUUID) + { + return isSlimSkin(playerUUID) ? TEXTURE_ALEX : TEXTURE_STEVE; + } + + public static String getSkinType(UUID playerUUID) + { + return isSlimSkin(playerUUID) ? "slim" : "default"; + } + + private static boolean isSlimSkin(UUID playerUUID) + { + return (playerUUID.hashCode() & 1) == 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java new file mode 100644 index 0000000..5981f6d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java @@ -0,0 +1,100 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.ImmutableSet; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.Set; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; +import net.optifine.reflect.ReflectorForge; + +public class DefaultResourcePack implements IResourcePack +{ + public static final Set defaultResourceDomains = ImmutableSet.of("minecraft", "realms"); + private final Map mapAssets; + + public DefaultResourcePack(Map mapAssetsIn) + { + this.mapAssets = mapAssetsIn; + } + + public InputStream getInputStream(ResourceLocation location) throws IOException + { + InputStream inputstream = this.getResourceStream(location); + + if (inputstream != null) + { + return inputstream; + } + else + { + InputStream inputstream1 = this.getInputStreamAssets(location); + + if (inputstream1 != null) + { + return inputstream1; + } + else + { + throw new FileNotFoundException(location.getResourcePath()); + } + } + } + + public InputStream getInputStreamAssets(ResourceLocation location) throws IOException, FileNotFoundException + { + File file1 = (File)this.mapAssets.get(location.toString()); + return file1 != null && file1.isFile() ? new FileInputStream(file1) : null; + } + + public InputStream getResourceStream(ResourceLocation location) + { + String s = "/assets/" + location.getResourceDomain() + "/" + location.getResourcePath(); + InputStream inputstream = ReflectorForge.getOptiFineResourceStream(s); + return inputstream != null ? inputstream : DefaultResourcePack.class.getResourceAsStream(s); + } + + public boolean resourceExists(ResourceLocation location) + { + return this.getResourceStream(location) != null || this.mapAssets.containsKey(location.toString()); + } + + public Set getResourceDomains() + { + return defaultResourceDomains; + } + + public T getPackMetadata(IMetadataSerializer metadataSerializer, String metadataSectionName) throws IOException + { + try + { + InputStream inputstream = new FileInputStream((File)this.mapAssets.get("pack.mcmeta")); + return AbstractResourcePack.readMetadata(metadataSerializer, inputstream, metadataSectionName); + } + catch (RuntimeException var4) + { + return (T)((IMetadataSection)null); + } + catch (FileNotFoundException var5) + { + return (T)((IMetadataSection)null); + } + } + + public BufferedImage getPackImage() throws IOException + { + return TextureUtil.readBufferedImage(DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.png")).getResourcePath())); + } + + public String getPackName() + { + return "Default"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java new file mode 100644 index 0000000..3cb2c7c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java @@ -0,0 +1,137 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Lists; +import java.io.ByteArrayOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.util.List; +import java.util.Set; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class FallbackResourceManager implements IResourceManager +{ + private static final Logger logger = LogManager.getLogger(); + protected final List resourcePacks = Lists.newArrayList(); + private final IMetadataSerializer frmMetadataSerializer; + + public FallbackResourceManager(IMetadataSerializer frmMetadataSerializerIn) + { + this.frmMetadataSerializer = frmMetadataSerializerIn; + } + + public void addResourcePack(IResourcePack resourcePack) + { + this.resourcePacks.add(resourcePack); + } + + public Set getResourceDomains() + { + return null; + } + + public IResource getResource(ResourceLocation location) throws IOException + { + IResourcePack iresourcepack = null; + ResourceLocation resourcelocation = getLocationMcmeta(location); + + for (int i = this.resourcePacks.size() - 1; i >= 0; --i) + { + IResourcePack iresourcepack1 = (IResourcePack)this.resourcePacks.get(i); + + if (iresourcepack == null && iresourcepack1.resourceExists(resourcelocation)) + { + iresourcepack = iresourcepack1; + } + + if (iresourcepack1.resourceExists(location)) + { + InputStream inputstream = null; + + if (iresourcepack != null) + { + inputstream = this.getInputStream(resourcelocation, iresourcepack); + } + + return new SimpleResource(iresourcepack1.getPackName(), location, this.getInputStream(location, iresourcepack1), inputstream, this.frmMetadataSerializer); + } + } + + throw new FileNotFoundException(location.toString()); + } + + protected InputStream getInputStream(ResourceLocation location, IResourcePack resourcePack) throws IOException + { + InputStream inputstream = resourcePack.getInputStream(location); + return (InputStream)(logger.isDebugEnabled() ? new FallbackResourceManager.InputStreamLeakedResourceLogger(inputstream, location, resourcePack.getPackName()) : inputstream); + } + + public List getAllResources(ResourceLocation location) throws IOException + { + List list = Lists.newArrayList(); + ResourceLocation resourcelocation = getLocationMcmeta(location); + + for (IResourcePack iresourcepack : this.resourcePacks) + { + if (iresourcepack.resourceExists(location)) + { + InputStream inputstream = iresourcepack.resourceExists(resourcelocation) ? this.getInputStream(resourcelocation, iresourcepack) : null; + list.add(new SimpleResource(iresourcepack.getPackName(), location, this.getInputStream(location, iresourcepack), inputstream, this.frmMetadataSerializer)); + } + } + + if (list.isEmpty()) + { + throw new FileNotFoundException(location.toString()); + } + else + { + return list; + } + } + + static ResourceLocation getLocationMcmeta(ResourceLocation location) + { + return new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + ".mcmeta"); + } + + static class InputStreamLeakedResourceLogger extends InputStream + { + private final InputStream inputStream; + private final String message; + private boolean isClosed = false; + + public InputStreamLeakedResourceLogger(InputStream p_i46093_1_, ResourceLocation location, String resourcePack) + { + this.inputStream = p_i46093_1_; + ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); + (new Exception()).printStackTrace(new PrintStream(bytearrayoutputstream)); + this.message = "Leaked resource: \'" + location + "\' loaded from pack: \'" + resourcePack + "\'\n" + bytearrayoutputstream.toString(); + } + + public void close() throws IOException + { + this.inputStream.close(); + this.isClosed = true; + } + + protected void finalize() throws Throwable + { + if (!this.isClosed) + { + FallbackResourceManager.logger.warn(this.message); + } + + super.finalize(); + } + + public int read() throws IOException + { + return this.inputStream.read(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/FileResourcePack.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FileResourcePack.java new file mode 100644 index 0000000..4c27a4f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FileResourcePack.java @@ -0,0 +1,122 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.Closeable; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +public class FileResourcePack extends AbstractResourcePack implements Closeable +{ + public static final Splitter entryNameSplitter = Splitter.on('/').omitEmptyStrings().limit(3); + private ZipFile resourcePackZipFile; + + public FileResourcePack(File resourcePackFileIn) + { + super(resourcePackFileIn); + } + + private ZipFile getResourcePackZipFile() throws IOException + { + if (this.resourcePackZipFile == null) + { + this.resourcePackZipFile = new ZipFile(this.resourcePackFile); + } + + return this.resourcePackZipFile; + } + + protected InputStream getInputStreamByName(String name) throws IOException + { + ZipFile zipfile = this.getResourcePackZipFile(); + ZipEntry zipentry = zipfile.getEntry(name); + + if (zipentry == null) + { + throw new ResourcePackFileNotFoundException(this.resourcePackFile, name); + } + else + { + return zipfile.getInputStream(zipentry); + } + } + + public boolean hasResourceName(String name) + { + try + { + return this.getResourcePackZipFile().getEntry(name) != null; + } + catch (IOException var3) + { + return false; + } + } + + public Set getResourceDomains() + { + ZipFile zipfile; + + try + { + zipfile = this.getResourcePackZipFile(); + } + catch (IOException var8) + { + return Collections.emptySet(); + } + + Enumeration enumeration = zipfile.entries(); + Set set = Sets.newHashSet(); + + while (enumeration.hasMoreElements()) + { + ZipEntry zipentry = (ZipEntry)enumeration.nextElement(); + String s = zipentry.getName(); + + if (s.startsWith("assets/")) + { + List list = Lists.newArrayList(entryNameSplitter.split(s)); + + if (list.size() > 1) + { + String s1 = (String)list.get(1); + + if (!s1.equals(s1.toLowerCase())) + { + this.logNameNotLowercase(s1); + } + else + { + set.add(s1); + } + } + } + } + + return set; + } + + protected void finalize() throws Throwable + { + this.close(); + super.finalize(); + } + + public void close() throws IOException + { + if (this.resourcePackZipFile != null) + { + this.resourcePackZipFile.close(); + this.resourcePackZipFile = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/FolderResourcePack.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FolderResourcePack.java new file mode 100644 index 0000000..178a890 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FolderResourcePack.java @@ -0,0 +1,54 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Sets; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Set; +import org.apache.commons.io.filefilter.DirectoryFileFilter; + +public class FolderResourcePack extends AbstractResourcePack +{ + public FolderResourcePack(File resourcePackFileIn) + { + super(resourcePackFileIn); + } + + protected InputStream getInputStreamByName(String name) throws IOException + { + return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile, name))); + } + + protected boolean hasResourceName(String name) + { + return (new File(this.resourcePackFile, name)).isFile(); + } + + public Set getResourceDomains() + { + Set set = Sets.newHashSet(); + File file1 = new File(this.resourcePackFile, "assets/"); + + if (file1.isDirectory()) + { + for (File file2 : file1.listFiles((FileFilter)DirectoryFileFilter.DIRECTORY)) + { + String s = getRelativeName(file1, file2); + + if (!s.equals(s.toLowerCase())) + { + this.logNameNotLowercase(s); + } + else + { + set.add(s.substring(0, s.length() - 1)); + } + } + } + + return set; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java new file mode 100644 index 0000000..cdcbdf2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java @@ -0,0 +1,23 @@ +package net.minecraft.client.resources; + +import java.io.IOException; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ColorizerFoliage; + +public class FoliageColorReloadListener implements IResourceManagerReloadListener +{ + private static final ResourceLocation LOC_FOLIAGE_PNG = new ResourceLocation("textures/colormap/foliage.png"); + + public void onResourceManagerReload(IResourceManager resourceManager) + { + try + { + ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(resourceManager, LOC_FOLIAGE_PNG)); + } + catch (IOException var3) + { + ; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java new file mode 100644 index 0000000..9418147 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java @@ -0,0 +1,23 @@ +package net.minecraft.client.resources; + +import java.io.IOException; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ColorizerGrass; + +public class GrassColorReloadListener implements IResourceManagerReloadListener +{ + private static final ResourceLocation LOC_GRASS_PNG = new ResourceLocation("textures/colormap/grass.png"); + + public void onResourceManagerReload(IResourceManager resourceManager) + { + try + { + ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(resourceManager, LOC_GRASS_PNG)); + } + catch (IOException var3) + { + ; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/I18n.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/I18n.java new file mode 100644 index 0000000..4f4bd82 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/I18n.java @@ -0,0 +1,23 @@ +package net.minecraft.client.resources; + +import java.util.Map; + +public class I18n +{ + private static Locale i18nLocale; + + static void setLocale(Locale i18nLocaleIn) + { + i18nLocale = i18nLocaleIn; + } + + public static String format(String translateKey, Object... parameters) + { + return i18nLocale.formatMessage(translateKey, parameters); + } + + public static Map getLocaleProperties() + { + return i18nLocale.properties; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java new file mode 100644 index 0000000..76beb6d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java @@ -0,0 +1,10 @@ +package net.minecraft.client.resources; + +import java.util.List; + +public interface IReloadableResourceManager extends IResourceManager +{ + void reloadResources(List resourcesPacksList); + + void registerReloadListener(IResourceManagerReloadListener reloadListener); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResource.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResource.java new file mode 100644 index 0000000..e2be4d4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResource.java @@ -0,0 +1,18 @@ +package net.minecraft.client.resources; + +import java.io.InputStream; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.util.ResourceLocation; + +public interface IResource +{ + ResourceLocation getResourceLocation(); + + InputStream getInputStream(); + + boolean hasMetadata(); + + T getMetadata(String p_110526_1_); + + String getResourcePackName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourceManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourceManager.java new file mode 100644 index 0000000..addbb8a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourceManager.java @@ -0,0 +1,15 @@ +package net.minecraft.client.resources; + +import java.io.IOException; +import java.util.List; +import java.util.Set; +import net.minecraft.util.ResourceLocation; + +public interface IResourceManager +{ + Set getResourceDomains(); + + IResource getResource(ResourceLocation location) throws IOException; + + List getAllResources(ResourceLocation location) throws IOException; +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java new file mode 100644 index 0000000..424e67b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java @@ -0,0 +1,6 @@ +package net.minecraft.client.resources; + +public interface IResourceManagerReloadListener +{ + void onResourceManagerReload(IResourceManager resourceManager); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourcePack.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourcePack.java new file mode 100644 index 0000000..0363482 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/IResourcePack.java @@ -0,0 +1,24 @@ +package net.minecraft.client.resources; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.Set; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +public interface IResourcePack +{ + InputStream getInputStream(ResourceLocation location) throws IOException; + + boolean resourceExists(ResourceLocation location); + + Set getResourceDomains(); + + T getPackMetadata(IMetadataSerializer metadataSerializer, String metadataSectionName) throws IOException; + + BufferedImage getPackImage() throws IOException; + + String getPackName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/Language.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/Language.java new file mode 100644 index 0000000..8163062 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/Language.java @@ -0,0 +1,47 @@ +package net.minecraft.client.resources; + +public class Language implements Comparable +{ + private final String languageCode; + private final String region; + private final String name; + private final boolean bidirectional; + + public Language(String languageCodeIn, String regionIn, String nameIn, boolean bidirectionalIn) + { + this.languageCode = languageCodeIn; + this.region = regionIn; + this.name = nameIn; + this.bidirectional = bidirectionalIn; + } + + public String getLanguageCode() + { + return this.languageCode; + } + + public boolean isBidirectional() + { + return this.bidirectional; + } + + public String toString() + { + return String.format("%s (%s)", new Object[] {this.name, this.region}); + } + + public boolean equals(Object p_equals_1_) + { + return this == p_equals_1_ ? true : (!(p_equals_1_ instanceof Language) ? false : this.languageCode.equals(((Language)p_equals_1_).languageCode)); + } + + public int hashCode() + { + return this.languageCode.hashCode(); + } + + public int compareTo(Language p_compareTo_1_) + { + return this.languageCode.compareTo(p_compareTo_1_.languageCode); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/LanguageManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/LanguageManager.java new file mode 100644 index 0000000..4603cea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/LanguageManager.java @@ -0,0 +1,100 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.LanguageMetadataSection; +import net.minecraft.util.StringTranslate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class LanguageManager implements IResourceManagerReloadListener +{ + private static final Logger logger = LogManager.getLogger(); + private final IMetadataSerializer theMetadataSerializer; + private String currentLanguage; + protected static final Locale currentLocale = new Locale(); + private Map languageMap = Maps.newHashMap(); + + public LanguageManager(IMetadataSerializer theMetadataSerializerIn, String currentLanguageIn) + { + this.theMetadataSerializer = theMetadataSerializerIn; + this.currentLanguage = currentLanguageIn; + I18n.setLocale(currentLocale); + } + + public void parseLanguageMetadata(List resourcesPacks) + { + this.languageMap.clear(); + + for (IResourcePack iresourcepack : resourcesPacks) + { + try + { + LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection)iresourcepack.getPackMetadata(this.theMetadataSerializer, "language"); + + if (languagemetadatasection != null) + { + for (Language language : languagemetadatasection.getLanguages()) + { + if (!this.languageMap.containsKey(language.getLanguageCode())) + { + this.languageMap.put(language.getLanguageCode(), language); + } + } + } + } + catch (RuntimeException runtimeexception) + { + logger.warn((String)("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName()), (Throwable)runtimeexception); + } + catch (IOException ioexception) + { + logger.warn((String)("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName()), (Throwable)ioexception); + } + } + } + + public void onResourceManagerReload(IResourceManager resourceManager) + { + List list = Lists.newArrayList(new String[] {"en_US"}); + + if (!"en_US".equals(this.currentLanguage)) + { + list.add(this.currentLanguage); + } + + currentLocale.loadLocaleDataFiles(resourceManager, list); + StringTranslate.replaceWith(currentLocale.properties); + } + + public boolean isCurrentLocaleUnicode() + { + return currentLocale.isUnicode(); + } + + public boolean isCurrentLanguageBidirectional() + { + return this.getCurrentLanguage() != null && this.getCurrentLanguage().isBidirectional(); + } + + public void setCurrentLanguage(Language currentLanguageIn) + { + this.currentLanguage = currentLanguageIn.getLanguageCode(); + } + + public Language getCurrentLanguage() + { + return this.languageMap.containsKey(this.currentLanguage) ? (Language)this.languageMap.get(this.currentLanguage) : (Language)this.languageMap.get("en_US"); + } + + public SortedSet getLanguages() + { + return Sets.newTreeSet(this.languageMap.values()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/Locale.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/Locale.java new file mode 100644 index 0000000..01cbbfb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/Locale.java @@ -0,0 +1,130 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.io.InputStream; +import java.util.IllegalFormatException; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +public class Locale +{ + private static final Splitter splitter = Splitter.on('=').limit(2); + private static final Pattern pattern = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + Map properties = Maps.newHashMap(); + private boolean unicode; + + public synchronized void loadLocaleDataFiles(IResourceManager resourceManager, List languageList) + { + this.properties.clear(); + + for (String s : languageList) + { + String s1 = String.format("lang/%s.lang", new Object[] {s}); + + for (String s2 : resourceManager.getResourceDomains()) + { + try + { + this.loadLocaleData(resourceManager.getAllResources(new ResourceLocation(s2, s1))); + } + catch (IOException var9) + { + ; + } + } + } + + this.checkUnicode(); + } + + public boolean isUnicode() + { + return this.unicode; + } + + private void checkUnicode() + { + this.unicode = false; + int i = 0; + int j = 0; + + for (String s : this.properties.values()) + { + int k = s.length(); + j += k; + + for (int l = 0; l < k; ++l) + { + if (s.charAt(l) >= 256) + { + ++i; + } + } + } + + float f = (float)i / (float)j; + this.unicode = (double)f > 0.1D; + } + + private void loadLocaleData(List resourcesList) throws IOException + { + for (IResource iresource : resourcesList) + { + InputStream inputstream = iresource.getInputStream(); + + try + { + this.loadLocaleData(inputstream); + } + finally + { + IOUtils.closeQuietly(inputstream); + } + } + } + + private void loadLocaleData(InputStream inputStreamIn) throws IOException + { + for (String s : IOUtils.readLines(inputStreamIn, Charsets.UTF_8)) + { + if (!s.isEmpty() && s.charAt(0) != 35) + { + String[] astring = (String[])Iterables.toArray(splitter.split(s), String.class); + + if (astring != null && astring.length == 2) + { + String s1 = astring[0]; + String s2 = pattern.matcher(astring[1]).replaceAll("%$1s"); + this.properties.put(s1, s2); + } + } + } + } + + private String translateKeyPrivate(String translateKey) + { + String s = (String)this.properties.get(translateKey); + return s == null ? translateKey : s; + } + + public String formatMessage(String translateKey, Object[] parameters) + { + String s = this.translateKeyPrivate(translateKey); + + try + { + return String.format(s, parameters); + } + catch (IllegalFormatException var5) + { + return "Format error: " + s; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourceIndex.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourceIndex.java new file mode 100644 index 0000000..f00eaa7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourceIndex.java @@ -0,0 +1,73 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Charsets; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.Reader; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.JsonUtils; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ResourceIndex +{ + private static final Logger logger = LogManager.getLogger(); + private final Map resourceMap = Maps.newHashMap(); + + public ResourceIndex(File p_i1047_1_, String p_i1047_2_) + { + if (p_i1047_2_ != null) + { + File file1 = new File(p_i1047_1_, "objects"); + File file2 = new File(p_i1047_1_, "indexes/" + p_i1047_2_ + ".json"); + BufferedReader bufferedreader = null; + + try + { + bufferedreader = Files.newReader(file2, Charsets.UTF_8); + JsonObject jsonobject = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject(); + JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonobject, "objects", (JsonObject)null); + + if (jsonobject1 != null) + { + for (Entry entry : jsonobject1.entrySet()) + { + JsonObject jsonobject2 = (JsonObject)entry.getValue(); + String s = (String)entry.getKey(); + String[] astring = s.split("/", 2); + String s1 = astring.length == 1 ? astring[0] : astring[0] + ":" + astring[1]; + String s2 = JsonUtils.getString(jsonobject2, "hash"); + File file3 = new File(file1, s2.substring(0, 2) + "/" + s2); + this.resourceMap.put(s1, file3); + } + } + } + catch (JsonParseException var20) + { + logger.error("Unable to parse resource index file: " + file2); + } + catch (FileNotFoundException var21) + { + logger.error("Can\'t find the resource index file: " + file2); + } + finally + { + IOUtils.closeQuietly((Reader)bufferedreader); + } + } + } + + public Map getResourceMap() + { + return this.resourceMap; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java new file mode 100644 index 0000000..9f4c214 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java @@ -0,0 +1,12 @@ +package net.minecraft.client.resources; + +import java.io.File; +import java.io.FileNotFoundException; + +public class ResourcePackFileNotFoundException extends FileNotFoundException +{ + public ResourcePackFileNotFoundException(File resourcePack, String p_i1294_2_) + { + super(String.format("\'%s\' in ResourcePack \'%s\'", new Object[] {p_i1294_2_, resourcePack})); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java new file mode 100644 index 0000000..d6b12c7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java @@ -0,0 +1,245 @@ +package net.minecraft.client.resources; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.gui.GuiScreenResourcePacks; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; + +public abstract class ResourcePackListEntry implements GuiListExtended.IGuiListEntry +{ + private static final ResourceLocation RESOURCE_PACKS_TEXTURE = new ResourceLocation("textures/gui/resource_packs.png"); + private static final IChatComponent field_183020_d = new ChatComponentTranslation("resourcePack.incompatible", new Object[0]); + private static final IChatComponent field_183021_e = new ChatComponentTranslation("resourcePack.incompatible.old", new Object[0]); + private static final IChatComponent field_183022_f = new ChatComponentTranslation("resourcePack.incompatible.new", new Object[0]); + protected final Minecraft mc; + protected final GuiScreenResourcePacks resourcePacksGUI; + + public ResourcePackListEntry(GuiScreenResourcePacks resourcePacksGUIIn) + { + this.resourcePacksGUI = resourcePacksGUIIn; + this.mc = Minecraft.getMinecraft(); + } + + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + { + int i = this.func_183019_a(); + + if (i != 1) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + Gui.drawRect(x - 1, y - 1, x + listWidth - 9, y + slotHeight + 1, -8978432); + } + + this.func_148313_c(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0F, 0.0F, 32, 32, 32.0F, 32.0F); + String s = this.func_148312_b(); + String s1 = this.func_148311_a(); + + if ((this.mc.gameSettings.touchscreen || isSelected) && this.func_148310_d()) + { + this.mc.getTextureManager().bindTexture(RESOURCE_PACKS_TEXTURE); + Gui.drawRect(x, y, x + 32, y + 32, -1601138544); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + int j = mouseX - x; + int k = mouseY - y; + + if (i < 1) + { + s = field_183020_d.getFormattedText(); + s1 = field_183021_e.getFormattedText(); + } + else if (i > 1) + { + s = field_183020_d.getFormattedText(); + s1 = field_183022_f.getFormattedText(); + } + + if (this.func_148309_e()) + { + if (j < 32) + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 0.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + else + { + if (this.func_148308_f()) + { + if (j < 16) + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 32.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 32.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.func_148314_g()) + { + if (j < 32 && j > 16 && k < 16) + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 96.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 96.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.func_148307_h()) + { + if (j < 32 && j > 16 && k > 16) + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 64.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.drawModalRectWithCustomSizedTexture(x, y, 64.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + } + } + + int i1 = this.mc.fontRendererObj.getStringWidth(s); + + if (i1 > 157) + { + s = this.mc.fontRendererObj.trimStringToWidth(s, 157 - this.mc.fontRendererObj.getStringWidth("...")) + "..."; + } + + this.mc.fontRendererObj.drawStringWithShadow(s, (float)(x + 32 + 2), (float)(y + 1), 16777215); + List list = this.mc.fontRendererObj.listFormattedStringToWidth(s1, 157); + + for (int l = 0; l < 2 && l < list.size(); ++l) + { + this.mc.fontRendererObj.drawStringWithShadow((String)list.get(l), (float)(x + 32 + 2), (float)(y + 12 + 10 * l), 8421504); + } + } + + protected abstract int func_183019_a(); + + protected abstract String func_148311_a(); + + protected abstract String func_148312_b(); + + protected abstract void func_148313_c(); + + protected boolean func_148310_d() + { + return true; + } + + protected boolean func_148309_e() + { + return !this.resourcePacksGUI.hasResourcePackEntry(this); + } + + protected boolean func_148308_f() + { + return this.resourcePacksGUI.hasResourcePackEntry(this); + } + + protected boolean func_148314_g() + { + List list = this.resourcePacksGUI.getListContaining(this); + int i = list.indexOf(this); + return i > 0 && ((ResourcePackListEntry)list.get(i - 1)).func_148310_d(); + } + + protected boolean func_148307_h() + { + List list = this.resourcePacksGUI.getListContaining(this); + int i = list.indexOf(this); + return i >= 0 && i < list.size() - 1 && ((ResourcePackListEntry)list.get(i + 1)).func_148310_d(); + } + + public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + if (this.func_148310_d() && p_148278_5_ <= 32) + { + if (this.func_148309_e()) + { + this.resourcePacksGUI.markChanged(); + int j = this.func_183019_a(); + + if (j != 1) + { + String s1 = I18n.format("resourcePack.incompatible.confirm.title", new Object[0]); + String s = I18n.format("resourcePack.incompatible.confirm." + (j > 1 ? "new" : "old"), new Object[0]); + this.mc.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() + { + public void confirmClicked(boolean result, int id) + { + List list2 = ResourcePackListEntry.this.resourcePacksGUI.getListContaining(ResourcePackListEntry.this); + ResourcePackListEntry.this.mc.displayGuiScreen(ResourcePackListEntry.this.resourcePacksGUI); + + if (result) + { + list2.remove(ResourcePackListEntry.this); + ResourcePackListEntry.this.resourcePacksGUI.getSelectedResourcePacks().add(0, ResourcePackListEntry.this); + } + } + }, s1, s, 0)); + } + else + { + this.resourcePacksGUI.getListContaining(this).remove(this); + this.resourcePacksGUI.getSelectedResourcePacks().add(0, this); + } + + return true; + } + + if (p_148278_5_ < 16 && this.func_148308_f()) + { + this.resourcePacksGUI.getListContaining(this).remove(this); + this.resourcePacksGUI.getAvailableResourcePacks().add(0, this); + this.resourcePacksGUI.markChanged(); + return true; + } + + if (p_148278_5_ > 16 && p_148278_6_ < 16 && this.func_148314_g()) + { + List list1 = this.resourcePacksGUI.getListContaining(this); + int k = list1.indexOf(this); + list1.remove(this); + list1.add(k - 1, this); + this.resourcePacksGUI.markChanged(); + return true; + } + + if (p_148278_5_ > 16 && p_148278_6_ > 16 && this.func_148307_h()) + { + List list = this.resourcePacksGUI.getListContaining(this); + int i = list.indexOf(this); + list.remove(this); + list.add(i + 1, this); + this.resourcePacksGUI.markChanged(); + return true; + } + } + + return false; + } + + public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) + { + } + + public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java new file mode 100644 index 0000000..7c16b55 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java @@ -0,0 +1,100 @@ +package net.minecraft.client.resources; + +import com.google.gson.JsonParseException; +import java.io.IOException; +import net.minecraft.client.gui.GuiScreenResourcePacks; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ResourcePackListEntryDefault extends ResourcePackListEntry +{ + private static final Logger logger = LogManager.getLogger(); + private final IResourcePack field_148320_d; + private final ResourceLocation resourcePackIcon; + + public ResourcePackListEntryDefault(GuiScreenResourcePacks resourcePacksGUIIn) + { + super(resourcePacksGUIIn); + this.field_148320_d = this.mc.getResourcePackRepository().rprDefaultResourcePack; + DynamicTexture dynamictexture; + + try + { + dynamictexture = new DynamicTexture(this.field_148320_d.getPackImage()); + } + catch (IOException var4) + { + dynamictexture = TextureUtil.missingTexture; + } + + this.resourcePackIcon = this.mc.getTextureManager().getDynamicTextureLocation("texturepackicon", dynamictexture); + } + + protected int func_183019_a() + { + return 1; + } + + protected String func_148311_a() + { + try + { + PackMetadataSection packmetadatasection = (PackMetadataSection)this.field_148320_d.getPackMetadata(this.mc.getResourcePackRepository().rprMetadataSerializer, "pack"); + + if (packmetadatasection != null) + { + return packmetadatasection.getPackDescription().getFormattedText(); + } + } + catch (JsonParseException jsonparseexception) + { + logger.error((String)"Couldn\'t load metadata info", (Throwable)jsonparseexception); + } + catch (IOException ioexception) + { + logger.error((String)"Couldn\'t load metadata info", (Throwable)ioexception); + } + + return EnumChatFormatting.RED + "Missing " + "pack.mcmeta" + " :("; + } + + protected boolean func_148309_e() + { + return false; + } + + protected boolean func_148308_f() + { + return false; + } + + protected boolean func_148314_g() + { + return false; + } + + protected boolean func_148307_h() + { + return false; + } + + protected String func_148312_b() + { + return "Default"; + } + + protected void func_148313_c() + { + this.mc.getTextureManager().bindTexture(this.resourcePackIcon); + } + + protected boolean func_148310_d() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java new file mode 100644 index 0000000..26bc799 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java @@ -0,0 +1,39 @@ +package net.minecraft.client.resources; + +import net.minecraft.client.gui.GuiScreenResourcePacks; + +public class ResourcePackListEntryFound extends ResourcePackListEntry +{ + private final ResourcePackRepository.Entry field_148319_c; + + public ResourcePackListEntryFound(GuiScreenResourcePacks resourcePacksGUIIn, ResourcePackRepository.Entry p_i45053_2_) + { + super(resourcePacksGUIIn); + this.field_148319_c = p_i45053_2_; + } + + protected void func_148313_c() + { + this.field_148319_c.bindTexturePackIcon(this.mc.getTextureManager()); + } + + protected int func_183019_a() + { + return this.field_148319_c.func_183027_f(); + } + + protected String func_148311_a() + { + return this.field_148319_c.getTexturePackDescription(); + } + + protected String func_148312_b() + { + return this.field_148319_c.getResourcePackName(); + } + + public ResourcePackRepository.Entry func_148318_i() + { + return this.field_148319_c; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java new file mode 100644 index 0000000..61dc28b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java @@ -0,0 +1,393 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.hash.Hashing; +import com.google.common.io.Files; +import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.SettableFuture; +import java.awt.image.BufferedImage; +import java.io.Closeable; +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.locks.ReentrantLock; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreenWorking; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.HttpUtil; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.comparator.LastModifiedFileComparator; +import org.apache.commons.io.filefilter.IOFileFilter; +import org.apache.commons.io.filefilter.TrueFileFilter; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ResourcePackRepository +{ + private static final Logger logger = LogManager.getLogger(); + private static final FileFilter resourcePackFilter = new FileFilter() + { + public boolean accept(File p_accept_1_) + { + boolean flag = p_accept_1_.isFile() && p_accept_1_.getName().endsWith(".zip"); + boolean flag1 = p_accept_1_.isDirectory() && (new File(p_accept_1_, "pack.mcmeta")).isFile(); + return flag || flag1; + } + }; + private final File dirResourcepacks; + public final IResourcePack rprDefaultResourcePack; + private final File dirServerResourcepacks; + public final IMetadataSerializer rprMetadataSerializer; + private IResourcePack resourcePackInstance; + private final ReentrantLock lock = new ReentrantLock(); + private ListenableFuture downloadingPacks; + private List repositoryEntriesAll = Lists.newArrayList(); + public List repositoryEntries = Lists.newArrayList(); + + public ResourcePackRepository(File dirResourcepacksIn, File dirServerResourcepacksIn, IResourcePack rprDefaultResourcePackIn, IMetadataSerializer rprMetadataSerializerIn, GameSettings settings) + { + this.dirResourcepacks = dirResourcepacksIn; + this.dirServerResourcepacks = dirServerResourcepacksIn; + this.rprDefaultResourcePack = rprDefaultResourcePackIn; + this.rprMetadataSerializer = rprMetadataSerializerIn; + this.fixDirResourcepacks(); + this.updateRepositoryEntriesAll(); + Iterator iterator = settings.resourcePacks.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + for (ResourcePackRepository.Entry resourcepackrepository$entry : this.repositoryEntriesAll) + { + if (resourcepackrepository$entry.getResourcePackName().equals(s)) + { + if (resourcepackrepository$entry.func_183027_f() == 1 || settings.incompatibleResourcePacks.contains(resourcepackrepository$entry.getResourcePackName())) + { + this.repositoryEntries.add(resourcepackrepository$entry); + break; + } + + iterator.remove(); + logger.warn("Removed selected resource pack {} because it\'s no longer compatible", new Object[] {resourcepackrepository$entry.getResourcePackName()}); + } + } + } + } + + private void fixDirResourcepacks() + { + if (this.dirResourcepacks.exists()) + { + if (!this.dirResourcepacks.isDirectory() && (!this.dirResourcepacks.delete() || !this.dirResourcepacks.mkdirs())) + { + logger.warn("Unable to recreate resourcepack folder, it exists but is not a directory: " + this.dirResourcepacks); + } + } + else if (!this.dirResourcepacks.mkdirs()) + { + logger.warn("Unable to create resourcepack folder: " + this.dirResourcepacks); + } + } + + private List getResourcePackFiles() + { + return this.dirResourcepacks.isDirectory() ? Arrays.asList(this.dirResourcepacks.listFiles(resourcePackFilter)) : Collections.emptyList(); + } + + public void updateRepositoryEntriesAll() + { + List list = Lists.newArrayList(); + + for (File file1 : this.getResourcePackFiles()) + { + ResourcePackRepository.Entry resourcepackrepository$entry = new ResourcePackRepository.Entry(file1); + + if (!this.repositoryEntriesAll.contains(resourcepackrepository$entry)) + { + try + { + resourcepackrepository$entry.updateResourcePack(); + list.add(resourcepackrepository$entry); + } + catch (Exception var61) + { + list.remove(resourcepackrepository$entry); + } + } + else + { + int i = this.repositoryEntriesAll.indexOf(resourcepackrepository$entry); + + if (i > -1 && i < this.repositoryEntriesAll.size()) + { + list.add(this.repositoryEntriesAll.get(i)); + } + } + } + + this.repositoryEntriesAll.removeAll(list); + + for (ResourcePackRepository.Entry resourcepackrepository$entry1 : this.repositoryEntriesAll) + { + resourcepackrepository$entry1.closeResourcePack(); + } + + this.repositoryEntriesAll = list; + } + + public List getRepositoryEntriesAll() + { + return ImmutableList.copyOf(this.repositoryEntriesAll); + } + + public List getRepositoryEntries() + { + return ImmutableList.copyOf(this.repositoryEntries); + } + + public void setRepositories(List repositories) + { + this.repositoryEntries.clear(); + this.repositoryEntries.addAll(repositories); + } + + public File getDirResourcepacks() + { + return this.dirResourcepacks; + } + + public ListenableFuture downloadResourcePack(String url, String hash) + { + String s; + + if (hash.matches("^[a-f0-9]{40}$")) + { + s = hash; + } + else + { + s = "legacy"; + } + + final File file1 = new File(this.dirServerResourcepacks, s); + this.lock.lock(); + + try + { + this.clearResourcePack(); + + if (file1.exists() && hash.length() == 40) + { + try + { + String s1 = Hashing.sha1().hashBytes(Files.toByteArray(file1)).toString(); + + if (s1.equals(hash)) + { + ListenableFuture listenablefuture2 = this.setResourcePackInstance(file1); + ListenableFuture listenablefuture3 = listenablefuture2; + return listenablefuture3; + } + + logger.warn("File " + file1 + " had wrong hash (expected " + hash + ", found " + s1 + "). Deleting it."); + FileUtils.deleteQuietly(file1); + } + catch (IOException ioexception) + { + logger.warn((String)("File " + file1 + " couldn\'t be hashed. Deleting it."), (Throwable)ioexception); + FileUtils.deleteQuietly(file1); + } + } + + this.deleteOldServerResourcesPacks(); + final GuiScreenWorking guiscreenworking = new GuiScreenWorking(); + Map map = Minecraft.getSessionInfo(); + final Minecraft minecraft = Minecraft.getMinecraft(); + Futures.getUnchecked(minecraft.addScheduledTask(new Runnable() + { + public void run() + { + minecraft.displayGuiScreen(guiscreenworking); + } + })); + final SettableFuture settablefuture = SettableFuture.create(); + this.downloadingPacks = HttpUtil.downloadResourcePack(file1, url, map, 52428800, guiscreenworking, minecraft.getProxy()); + Futures.addCallback(this.downloadingPacks, new FutureCallback() + { + public void onSuccess(Object p_onSuccess_1_) + { + ResourcePackRepository.this.setResourcePackInstance(file1); + settablefuture.set((Object)null); + } + public void onFailure(Throwable p_onFailure_1_) + { + settablefuture.setException(p_onFailure_1_); + } + }); + ListenableFuture listenablefuture = this.downloadingPacks; + ListenableFuture listenablefuture11 = listenablefuture; + return listenablefuture11; + } + finally + { + this.lock.unlock(); + } + } + + private void deleteOldServerResourcesPacks() + { + List list = Lists.newArrayList(FileUtils.listFiles(this.dirServerResourcepacks, TrueFileFilter.TRUE, (IOFileFilter)null)); + Collections.sort(list, LastModifiedFileComparator.LASTMODIFIED_REVERSE); + int i = 0; + + for (File file1 : list) + { + if (i++ >= 10) + { + logger.info("Deleting old server resource pack " + file1.getName()); + FileUtils.deleteQuietly(file1); + } + } + } + + public ListenableFuture setResourcePackInstance(File resourceFile) + { + this.resourcePackInstance = new FileResourcePack(resourceFile); + return Minecraft.getMinecraft().scheduleResourcesRefresh(); + } + + public IResourcePack getResourcePackInstance() + { + return this.resourcePackInstance; + } + + public void clearResourcePack() + { + this.lock.lock(); + + try + { + if (this.downloadingPacks != null) + { + this.downloadingPacks.cancel(true); + } + + this.downloadingPacks = null; + + if (this.resourcePackInstance != null) + { + this.resourcePackInstance = null; + Minecraft.getMinecraft().scheduleResourcesRefresh(); + } + } + finally + { + this.lock.unlock(); + } + } + + public class Entry + { + private final File resourcePackFile; + private IResourcePack reResourcePack; + private PackMetadataSection rePackMetadataSection; + private BufferedImage texturePackIcon; + private ResourceLocation locationTexturePackIcon; + + private Entry(File resourcePackFileIn) + { + this.resourcePackFile = resourcePackFileIn; + } + + public void updateResourcePack() throws IOException + { + this.reResourcePack = (IResourcePack)(this.resourcePackFile.isDirectory() ? new FolderResourcePack(this.resourcePackFile) : new FileResourcePack(this.resourcePackFile)); + this.rePackMetadataSection = (PackMetadataSection)this.reResourcePack.getPackMetadata(ResourcePackRepository.this.rprMetadataSerializer, "pack"); + + try + { + this.texturePackIcon = this.reResourcePack.getPackImage(); + } + catch (IOException var2) + { + ; + } + + if (this.texturePackIcon == null) + { + this.texturePackIcon = ResourcePackRepository.this.rprDefaultResourcePack.getPackImage(); + } + + this.closeResourcePack(); + } + + public void bindTexturePackIcon(TextureManager textureManagerIn) + { + if (this.locationTexturePackIcon == null) + { + this.locationTexturePackIcon = textureManagerIn.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.texturePackIcon)); + } + + textureManagerIn.bindTexture(this.locationTexturePackIcon); + } + + public void closeResourcePack() + { + if (this.reResourcePack instanceof Closeable) + { + IOUtils.closeQuietly((Closeable)this.reResourcePack); + } + } + + public IResourcePack getResourcePack() + { + return this.reResourcePack; + } + + public String getResourcePackName() + { + return this.reResourcePack.getPackName(); + } + + public String getTexturePackDescription() + { + return this.rePackMetadataSection == null ? EnumChatFormatting.RED + "Invalid pack.mcmeta (or missing \'pack\' section)" : this.rePackMetadataSection.getPackDescription().getFormattedText(); + } + + public int func_183027_f() + { + return this.rePackMetadataSection.getPackFormat(); + } + + public boolean equals(Object p_equals_1_) + { + return this == p_equals_1_ ? true : (p_equals_1_ instanceof ResourcePackRepository.Entry ? this.toString().equals(p_equals_1_.toString()) : false); + } + + public int hashCode() + { + return this.toString().hashCode(); + } + + public String toString() + { + return String.format("%s:%s:%d", new Object[] {this.resourcePackFile.getName(), this.resourcePackFile.isDirectory() ? "folder" : "zip", Long.valueOf(this.resourcePackFile.lastModified())}); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java new file mode 100644 index 0000000..8217a2c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java @@ -0,0 +1,161 @@ +package net.minecraft.client.resources; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class SimpleReloadableResourceManager implements IReloadableResourceManager +{ + private static final Logger logger = LogManager.getLogger(); + private static final Joiner joinerResourcePacks = Joiner.on(", "); + private final Map domainResourceManagers = Maps.newHashMap(); + private final List reloadListeners = Lists.newArrayList(); + private final Set setResourceDomains = Sets.newLinkedHashSet(); + private final IMetadataSerializer rmMetadataSerializer; + + public SimpleReloadableResourceManager(IMetadataSerializer rmMetadataSerializerIn) + { + this.rmMetadataSerializer = rmMetadataSerializerIn; + } + + public void reloadResourcePack(IResourcePack resourcePack) + { + for (String s : resourcePack.getResourceDomains()) + { + this.setResourceDomains.add(s); + FallbackResourceManager fallbackresourcemanager = (FallbackResourceManager)this.domainResourceManagers.get(s); + + if (fallbackresourcemanager == null) + { + fallbackresourcemanager = new FallbackResourceManager(this.rmMetadataSerializer); + this.domainResourceManagers.put(s, fallbackresourcemanager); + } + + fallbackresourcemanager.addResourcePack(resourcePack); + } + } + + public Set getResourceDomains() + { + return this.setResourceDomains; + } + + public IResource getResource(ResourceLocation location) throws IOException + { + IResourceManager iresourcemanager = this.domainResourceManagers.get(location.getResourceDomain()); + + if (iresourcemanager != null) + { + return iresourcemanager.getResource(location); + } + else + { + throw new FileNotFoundException(location.toString()); + } + } + + public List getAllResources(ResourceLocation location) throws IOException + { + IResourceManager iresourcemanager = this.domainResourceManagers.get(location.getResourceDomain()); + + if (iresourcemanager != null) + { + return iresourcemanager.getAllResources(location); + } + else + { + throw new FileNotFoundException(location.toString()); + } + } + + private void clearResources() + { + this.domainResourceManagers.clear(); + this.setResourceDomains.clear(); + } + + public void reloadResources(List resourcesPacksList) + { + this.clearResources(); + logger.info("Reloading ResourceManager: " + joinerResourcePacks.join(Iterables.transform(resourcesPacksList, new Function() + { + public String apply(IResourcePack p_apply_1_) + { + return p_apply_1_.getPackName(); + } + }))); + + for (IResourcePack iresourcepack : resourcesPacksList) + { + this.reloadResourcePack(iresourcepack); + } + + updatepack(); + this.notifyReloadListeners(); + } + + public void registerReloadListener(IResourceManagerReloadListener reloadListener) + { + this.reloadListeners.add(reloadListener); + reloadListener.onResourceManagerReload(this); + } + + private void notifyReloadListeners() + { + for (IResourceManagerReloadListener iresourcemanagerreloadlistener : this.reloadListeners) + { + iresourcemanagerreloadlistener.onResourceManagerReload(this); + } + } + + + /** + * Last two classes are for the Pack Display Mod. + */ + public static void updatepack() { + if (CheatBreaker.getInstance() == null) { + return; + } + DynamicTexture texture = null; + try { + texture = new DynamicTexture(getResourcePack().getPackImage()); + } catch (IOException e) { + e.printStackTrace(); + } + CheatBreaker.packIconTexture = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("texturepackicon", texture); + } + + public static IResourcePack getResourcePack() { + IResourcePack[] rps = Config.getResourcePacks(); + + if (rps.length <= 0) { + return Config.getDefaultResourcePack(); + } else { + IResourcePack[] names = new IResourcePack[rps.length]; + + for (int nameStr = 0; nameStr < rps.length; ++nameStr) { + names[nameStr] = rps[nameStr]; + } + + String var3 = Config.arrayToString(names); + return names[names.length -1]; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/SimpleResource.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/SimpleResource.java new file mode 100644 index 0000000..a16b8f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/SimpleResource.java @@ -0,0 +1,139 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Maps; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.Map; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; + +public class SimpleResource implements IResource +{ + private final Map mapMetadataSections = Maps.newHashMap(); + private final String resourcePackName; + private final ResourceLocation srResourceLocation; + private final InputStream resourceInputStream; + private final InputStream mcmetaInputStream; + private final IMetadataSerializer srMetadataSerializer; + private boolean mcmetaJsonChecked; + private JsonObject mcmetaJson; + + public SimpleResource(String resourcePackNameIn, ResourceLocation srResourceLocationIn, InputStream resourceInputStreamIn, InputStream mcmetaInputStreamIn, IMetadataSerializer srMetadataSerializerIn) + { + this.resourcePackName = resourcePackNameIn; + this.srResourceLocation = srResourceLocationIn; + this.resourceInputStream = resourceInputStreamIn; + this.mcmetaInputStream = mcmetaInputStreamIn; + this.srMetadataSerializer = srMetadataSerializerIn; + } + + public ResourceLocation getResourceLocation() + { + return this.srResourceLocation; + } + + public InputStream getInputStream() + { + return this.resourceInputStream; + } + + public boolean hasMetadata() + { + return this.mcmetaInputStream != null; + } + + public T getMetadata(String p_110526_1_) + { + if (!this.hasMetadata()) + { + return (T)null; + } + else + { + if (this.mcmetaJson == null && !this.mcmetaJsonChecked) + { + this.mcmetaJsonChecked = true; + BufferedReader bufferedreader = null; + + try + { + bufferedreader = new BufferedReader(new InputStreamReader(this.mcmetaInputStream)); + this.mcmetaJson = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject(); + } + finally + { + IOUtils.closeQuietly((Reader)bufferedreader); + } + } + + T t = (T)this.mapMetadataSections.get(p_110526_1_); + + if (t == null) + { + t = this.srMetadataSerializer.parseMetadataSection(p_110526_1_, this.mcmetaJson); + } + + return t; + } + } + + public String getResourcePackName() + { + return this.resourcePackName; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof SimpleResource)) + { + return false; + } + else + { + SimpleResource simpleresource = (SimpleResource)p_equals_1_; + + if (this.srResourceLocation != null) + { + if (!this.srResourceLocation.equals(simpleresource.srResourceLocation)) + { + return false; + } + } + else if (simpleresource.srResourceLocation != null) + { + return false; + } + + if (this.resourcePackName != null) + { + if (!this.resourcePackName.equals(simpleresource.resourcePackName)) + { + return false; + } + } + else if (simpleresource.resourcePackName != null) + { + return false; + } + + return true; + } + } + + public int hashCode() + { + int i = this.resourcePackName != null ? this.resourcePackName.hashCode() : 0; + i = 31 * i + (this.srResourceLocation != null ? this.srResourceLocation.hashCode() : 0); + return i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/SkinManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/SkinManager.java new file mode 100644 index 0000000..6f4b809 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/SkinManager.java @@ -0,0 +1,153 @@ +package net.minecraft.client.resources; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.InsecureTextureException; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.IImageBuffer; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +public class SkinManager +{ + private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue()); + private final TextureManager textureManager; + private final File skinCacheDir; + private final MinecraftSessionService sessionService; + private final LoadingCache> skinCacheLoader; + + public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService) + { + this.textureManager = textureManagerInstance; + this.skinCacheDir = skinCacheDirectory; + this.sessionService = sessionService; + this.skinCacheLoader = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).>build(new CacheLoader>() + { + public Map load(GameProfile p_load_1_) throws Exception + { + return Minecraft.getMinecraft().getSessionService().getTextures(p_load_1_, false); + } + }); + } + + public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type p_152792_2_) + { + return this.loadSkin(profileTexture, p_152792_2_, (SkinManager.SkinAvailableCallback)null); + } + + public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type p_152789_2_, final SkinManager.SkinAvailableCallback skinAvailableCallback) + { + final ResourceLocation resourcelocation = new ResourceLocation("skins/" + profileTexture.getHash()); + ITextureObject itextureobject = this.textureManager.getTexture(resourcelocation); + + if (itextureobject != null) + { + if (skinAvailableCallback != null) + { + skinAvailableCallback.skinAvailable(p_152789_2_, resourcelocation, profileTexture); + } + } + else + { + File file1 = new File(this.skinCacheDir, profileTexture.getHash().length() > 2 ? profileTexture.getHash().substring(0, 2) : "xx"); + File file2 = new File(file1, profileTexture.getHash()); + final IImageBuffer iimagebuffer = p_152789_2_ == Type.SKIN ? new ImageBufferDownload() : null; + ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(file2, profileTexture.getUrl(), DefaultPlayerSkin.getDefaultSkinLegacy(), new IImageBuffer() + { + public BufferedImage parseUserSkin(BufferedImage image) + { + if (iimagebuffer != null) + { + image = iimagebuffer.parseUserSkin(image); + } + + return image; + } + public void skinAvailable() + { + if (iimagebuffer != null) + { + iimagebuffer.skinAvailable(); + } + + if (skinAvailableCallback != null) + { + skinAvailableCallback.skinAvailable(p_152789_2_, resourcelocation, profileTexture); + } + } + }); + this.textureManager.loadTexture(resourcelocation, threaddownloadimagedata); + } + + return resourcelocation; + } + + public void loadProfileTextures(final GameProfile profile, final SkinManager.SkinAvailableCallback skinAvailableCallback, final boolean requireSecure) + { + THREAD_POOL.submit(new Runnable() + { + public void run() + { + final Map map = Maps.newHashMap(); + + try + { + map.putAll(SkinManager.this.sessionService.getTextures(profile, requireSecure)); + } + catch (InsecureTextureException var3) + { + ; + } + + if (map.isEmpty() && profile.getId().equals(Minecraft.getMinecraft().getSession().getProfile().getId())) + { + profile.getProperties().clear(); + profile.getProperties().putAll(Minecraft.getMinecraft().getProfileProperties()); + map.putAll(SkinManager.this.sessionService.getTextures(profile, false)); + } + + Minecraft.getMinecraft().addScheduledTask(new Runnable() + { + public void run() + { + if (map.containsKey(Type.SKIN)) + { + SkinManager.this.loadSkin((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN, skinAvailableCallback); + } + + if (map.containsKey(Type.CAPE)) + { + SkinManager.this.loadSkin((MinecraftProfileTexture)map.get(Type.CAPE), Type.CAPE, skinAvailableCallback); + } + } + }); + } + }); + } + + public Map loadSkinFromCache(GameProfile profile) + { + return (Map)this.skinCacheLoader.getUnchecked(profile); + } + + public interface SkinAvailableCallback + { + void skinAvailable(Type p_180521_1_, ResourceLocation location, MinecraftProfileTexture profileTexture); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java new file mode 100644 index 0000000..1844494 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java @@ -0,0 +1,33 @@ +package net.minecraft.client.resources.data; + +public class AnimationFrame +{ + private final int frameIndex; + private final int frameTime; + + public AnimationFrame(int p_i1307_1_) + { + this(p_i1307_1_, -1); + } + + public AnimationFrame(int p_i1308_1_, int p_i1308_2_) + { + this.frameIndex = p_i1308_1_; + this.frameTime = p_i1308_2_; + } + + public boolean hasNoTime() + { + return this.frameTime == -1; + } + + public int getFrameTime() + { + return this.frameTime; + } + + public int getFrameIndex() + { + return this.frameIndex; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java new file mode 100644 index 0000000..99ed76f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java @@ -0,0 +1,81 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Set; + +public class AnimationMetadataSection implements IMetadataSection +{ + private final List animationFrames; + private final int frameWidth; + private final int frameHeight; + private final int frameTime; + private final boolean interpolate; + + public AnimationMetadataSection(List p_i46088_1_, int p_i46088_2_, int p_i46088_3_, int p_i46088_4_, boolean p_i46088_5_) + { + this.animationFrames = p_i46088_1_; + this.frameWidth = p_i46088_2_; + this.frameHeight = p_i46088_3_; + this.frameTime = p_i46088_4_; + this.interpolate = p_i46088_5_; + } + + public int getFrameHeight() + { + return this.frameHeight; + } + + public int getFrameWidth() + { + return this.frameWidth; + } + + public int getFrameCount() + { + return this.animationFrames.size(); + } + + public int getFrameTime() + { + return this.frameTime; + } + + public boolean isInterpolate() + { + return this.interpolate; + } + + private AnimationFrame getAnimationFrame(int p_130072_1_) + { + return (AnimationFrame)this.animationFrames.get(p_130072_1_); + } + + public int getFrameTimeSingle(int p_110472_1_) + { + AnimationFrame animationframe = this.getAnimationFrame(p_110472_1_); + return animationframe.hasNoTime() ? this.frameTime : animationframe.getFrameTime(); + } + + public boolean frameHasTime(int p_110470_1_) + { + return !((AnimationFrame)this.animationFrames.get(p_110470_1_)).hasNoTime(); + } + + public int getFrameIndex(int p_110468_1_) + { + return ((AnimationFrame)this.animationFrames.get(p_110468_1_)).getFrameIndex(); + } + + public Set getFrameIndexSet() + { + Set set = Sets.newHashSet(); + + for (AnimationFrame animationframe : this.animationFrames) + { + set.add(Integer.valueOf(animationframe.getFrameIndex())); + } + + return set; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java new file mode 100644 index 0000000..5865ef6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java @@ -0,0 +1,140 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import java.util.List; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +public class AnimationMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer +{ + public AnimationMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + List list = Lists.newArrayList(); + JsonObject jsonobject = JsonUtils.getJsonObject(p_deserialize_1_, "metadata section"); + int i = JsonUtils.getInt(jsonobject, "frametime", 1); + + if (i != 1) + { + Validate.inclusiveBetween(1L, 2147483647L, (long)i, "Invalid default frame time"); + } + + if (jsonobject.has("frames")) + { + try + { + JsonArray jsonarray = JsonUtils.getJsonArray(jsonobject, "frames"); + + for (int j = 0; j < jsonarray.size(); ++j) + { + JsonElement jsonelement = jsonarray.get(j); + AnimationFrame animationframe = this.parseAnimationFrame(j, jsonelement); + + if (animationframe != null) + { + list.add(animationframe); + } + } + } + catch (ClassCastException classcastexception) + { + throw new JsonParseException("Invalid animation->frames: expected array, was " + jsonobject.get("frames"), classcastexception); + } + } + + int k = JsonUtils.getInt(jsonobject, "width", -1); + int l = JsonUtils.getInt(jsonobject, "height", -1); + + if (k != -1) + { + Validate.inclusiveBetween(1L, 2147483647L, (long)k, "Invalid width"); + } + + if (l != -1) + { + Validate.inclusiveBetween(1L, 2147483647L, (long)l, "Invalid height"); + } + + boolean flag = JsonUtils.getBoolean(jsonobject, "interpolate", false); + return new AnimationMetadataSection(list, k, l, i, flag); + } + + private AnimationFrame parseAnimationFrame(int p_110492_1_, JsonElement p_110492_2_) + { + if (p_110492_2_.isJsonPrimitive()) + { + return new AnimationFrame(JsonUtils.getInt(p_110492_2_, "frames[" + p_110492_1_ + "]")); + } + else if (p_110492_2_.isJsonObject()) + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_110492_2_, "frames[" + p_110492_1_ + "]"); + int i = JsonUtils.getInt(jsonobject, "time", -1); + + if (jsonobject.has("time")) + { + Validate.inclusiveBetween(1L, 2147483647L, (long)i, "Invalid frame time"); + } + + int j = JsonUtils.getInt(jsonobject, "index"); + Validate.inclusiveBetween(0L, 2147483647L, (long)j, "Invalid frame index"); + return new AnimationFrame(j, i); + } + else + { + return null; + } + } + + public JsonElement serialize(AnimationMetadataSection p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("frametime", (Number)Integer.valueOf(p_serialize_1_.getFrameTime())); + + if (p_serialize_1_.getFrameWidth() != -1) + { + jsonobject.addProperty("width", (Number)Integer.valueOf(p_serialize_1_.getFrameWidth())); + } + + if (p_serialize_1_.getFrameHeight() != -1) + { + jsonobject.addProperty("height", (Number)Integer.valueOf(p_serialize_1_.getFrameHeight())); + } + + if (p_serialize_1_.getFrameCount() > 0) + { + JsonArray jsonarray = new JsonArray(); + + for (int i = 0; i < p_serialize_1_.getFrameCount(); ++i) + { + if (p_serialize_1_.frameHasTime(i)) + { + JsonObject jsonobject1 = new JsonObject(); + jsonobject1.addProperty("index", (Number)Integer.valueOf(p_serialize_1_.getFrameIndex(i))); + jsonobject1.addProperty("time", (Number)Integer.valueOf(p_serialize_1_.getFrameTimeSingle(i))); + jsonarray.add(jsonobject1); + } + else + { + jsonarray.add(new JsonPrimitive(Integer.valueOf(p_serialize_1_.getFrameIndex(i)))); + } + } + + jsonobject.add("frames", jsonarray); + } + + return jsonobject; + } + + public String getSectionName() + { + return "animation"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java new file mode 100644 index 0000000..142fb40 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java @@ -0,0 +1,5 @@ +package net.minecraft.client.resources.data; + +public abstract class BaseMetadataSectionSerializer implements IMetadataSectionSerializer +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java new file mode 100644 index 0000000..84f9534 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java @@ -0,0 +1,15 @@ +package net.minecraft.client.resources.data; + +public class FontMetadataSection implements IMetadataSection +{ + private final float[] charWidths; + private final float[] charLefts; + private final float[] charSpacings; + + public FontMetadataSection(float[] p_i1310_1_, float[] p_i1310_2_, float[] p_i1310_3_) + { + this.charWidths = p_i1310_1_; + this.charLefts = p_i1310_2_; + this.charSpacings = p_i1310_3_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java new file mode 100644 index 0000000..3c90a84 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java @@ -0,0 +1,79 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +public class FontMetadataSectionSerializer extends BaseMetadataSectionSerializer +{ + public FontMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + float[] afloat = new float[256]; + float[] afloat1 = new float[256]; + float[] afloat2 = new float[256]; + float f = 1.0F; + float f1 = 0.0F; + float f2 = 0.0F; + + if (jsonobject.has("characters")) + { + if (!jsonobject.get("characters").isJsonObject()) + { + throw new JsonParseException("Invalid font->characters: expected object, was " + jsonobject.get("characters")); + } + + JsonObject jsonobject1 = jsonobject.getAsJsonObject("characters"); + + if (jsonobject1.has("default")) + { + if (!jsonobject1.get("default").isJsonObject()) + { + throw new JsonParseException("Invalid font->characters->default: expected object, was " + jsonobject1.get("default")); + } + + JsonObject jsonobject2 = jsonobject1.getAsJsonObject("default"); + f = JsonUtils.getFloat(jsonobject2, "width", f); + Validate.inclusiveBetween(0.0D, 3.4028234663852886E38D, (double)f, "Invalid default width"); + f1 = JsonUtils.getFloat(jsonobject2, "spacing", f1); + Validate.inclusiveBetween(0.0D, 3.4028234663852886E38D, (double)f1, "Invalid default spacing"); + f2 = JsonUtils.getFloat(jsonobject2, "left", f1); + Validate.inclusiveBetween(0.0D, 3.4028234663852886E38D, (double)f2, "Invalid default left"); + } + + for (int i = 0; i < 256; ++i) + { + JsonElement jsonelement = jsonobject1.get(Integer.toString(i)); + float f3 = f; + float f4 = f1; + float f5 = f2; + + if (jsonelement != null) + { + JsonObject jsonobject3 = JsonUtils.getJsonObject(jsonelement, "characters[" + i + "]"); + f3 = JsonUtils.getFloat(jsonobject3, "width", f); + Validate.inclusiveBetween(0.0D, 3.4028234663852886E38D, (double)f3, "Invalid width"); + f4 = JsonUtils.getFloat(jsonobject3, "spacing", f1); + Validate.inclusiveBetween(0.0D, 3.4028234663852886E38D, (double)f4, "Invalid spacing"); + f5 = JsonUtils.getFloat(jsonobject3, "left", f2); + Validate.inclusiveBetween(0.0D, 3.4028234663852886E38D, (double)f5, "Invalid left"); + } + + afloat[i] = f3; + afloat1[i] = f4; + afloat2[i] = f5; + } + } + + return new FontMetadataSection(afloat, afloat2, afloat1); + } + + public String getSectionName() + { + return "font"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java new file mode 100644 index 0000000..a2df0d1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java @@ -0,0 +1,5 @@ +package net.minecraft.client.resources.data; + +public interface IMetadataSection +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java new file mode 100644 index 0000000..aa0b4e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java @@ -0,0 +1,8 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializer; + +public interface IMetadataSectionSerializer extends JsonDeserializer +{ + String getSectionName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java new file mode 100644 index 0000000..1065f1f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java @@ -0,0 +1,83 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumTypeAdapterFactory; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IRegistry; +import net.minecraft.util.RegistrySimple; + +public class IMetadataSerializer +{ + private final IRegistry < String, IMetadataSerializer.Registration > metadataSectionSerializerRegistry = new RegistrySimple(); + private final GsonBuilder gsonBuilder = new GsonBuilder(); + private Gson gson; + + public IMetadataSerializer() + { + this.gsonBuilder.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()); + this.gsonBuilder.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()); + this.gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); + } + + public void registerMetadataSectionType(IMetadataSectionSerializer metadataSectionSerializer, Class clazz) + { + this.metadataSectionSerializerRegistry.putObject(metadataSectionSerializer.getSectionName(), new IMetadataSerializer.Registration(metadataSectionSerializer, clazz)); + this.gsonBuilder.registerTypeAdapter(clazz, metadataSectionSerializer); + this.gson = null; + } + + public T parseMetadataSection(String sectionName, JsonObject json) + { + if (sectionName == null) + { + throw new IllegalArgumentException("Metadata section name cannot be null"); + } + else if (!json.has(sectionName)) + { + return (T)null; + } + else if (!json.get(sectionName).isJsonObject()) + { + throw new IllegalArgumentException("Invalid metadata for \'" + sectionName + "\' - expected object, found " + json.get(sectionName)); + } + else + { + IMetadataSerializer.Registration registration = (IMetadataSerializer.Registration)this.metadataSectionSerializerRegistry.getObject(sectionName); + + if (registration == null) + { + throw new IllegalArgumentException("Don\'t know how to handle metadata section \'" + sectionName + "\'"); + } + else + { + return (T)((IMetadataSection)this.getGson().fromJson((JsonElement)json.getAsJsonObject(sectionName), registration.clazz)); + } + } + } + + private Gson getGson() + { + if (this.gson == null) + { + this.gson = this.gsonBuilder.create(); + } + + return this.gson; + } + + class Registration + { + final IMetadataSectionSerializer section; + final Class clazz; + + private Registration(IMetadataSectionSerializer metadataSectionSerializer, Class clazzToRegister) + { + this.section = metadataSectionSerializer; + this.clazz = clazzToRegister; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java new file mode 100644 index 0000000..7b365b1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java @@ -0,0 +1,19 @@ +package net.minecraft.client.resources.data; + +import java.util.Collection; +import net.minecraft.client.resources.Language; + +public class LanguageMetadataSection implements IMetadataSection +{ + private final Collection languages; + + public LanguageMetadataSection(Collection p_i1311_1_) + { + this.languages = p_i1311_1_; + } + + public Collection getLanguages() + { + return this.languages; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java new file mode 100644 index 0000000..c09b24d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java @@ -0,0 +1,52 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Sets; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.client.resources.Language; +import net.minecraft.util.JsonUtils; + +public class LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer +{ + public LanguageMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + Set set = Sets.newHashSet(); + + for (Entry entry : jsonobject.entrySet()) + { + String s = (String)entry.getKey(); + JsonObject jsonobject1 = JsonUtils.getJsonObject((JsonElement)entry.getValue(), "language"); + String s1 = JsonUtils.getString(jsonobject1, "region"); + String s2 = JsonUtils.getString(jsonobject1, "name"); + boolean flag = JsonUtils.getBoolean(jsonobject1, "bidirectional", false); + + if (s1.isEmpty()) + { + throw new JsonParseException("Invalid language->\'" + s + "\'->region: empty value"); + } + + if (s2.isEmpty()) + { + throw new JsonParseException("Invalid language->\'" + s + "\'->name: empty value"); + } + + if (!set.add(new Language(s, s1, s2, flag))) + { + throw new JsonParseException("Duplicate language->\'" + s + "\' defined"); + } + } + + return new LanguageMetadataSection(set); + } + + public String getSectionName() + { + return "language"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java new file mode 100644 index 0000000..0698874 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java @@ -0,0 +1,25 @@ +package net.minecraft.client.resources.data; + +import net.minecraft.util.IChatComponent; + +public class PackMetadataSection implements IMetadataSection +{ + private final IChatComponent packDescription; + private final int packFormat; + + public PackMetadataSection(IChatComponent p_i1034_1_, int p_i1034_2_) + { + this.packDescription = p_i1034_1_; + this.packFormat = p_i1034_2_; + } + + public IChatComponent getPackDescription() + { + return this.packDescription; + } + + public int getPackFormat() + { + return this.packFormat; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java new file mode 100644 index 0000000..e3e9fcd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java @@ -0,0 +1,43 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; + +public class PackMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer +{ + public PackMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + IChatComponent ichatcomponent = (IChatComponent)p_deserialize_3_.deserialize(jsonobject.get("description"), IChatComponent.class); + + if (ichatcomponent == null) + { + throw new JsonParseException("Invalid/missing description!"); + } + else + { + int i = JsonUtils.getInt(jsonobject, "pack_format"); + return new PackMetadataSection(ichatcomponent, i); + } + } + + public JsonElement serialize(PackMetadataSection p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("pack_format", (Number)Integer.valueOf(p_serialize_1_.getPackFormat())); + jsonobject.add("description", p_serialize_3_.serialize(p_serialize_1_.getPackDescription())); + return jsonobject; + } + + public String getSectionName() + { + return "pack"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java new file mode 100644 index 0000000..bec31d6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java @@ -0,0 +1,33 @@ +package net.minecraft.client.resources.data; + +import java.util.Collections; +import java.util.List; + +public class TextureMetadataSection implements IMetadataSection +{ + private final boolean textureBlur; + private final boolean textureClamp; + private final List listMipmaps; + + public TextureMetadataSection(boolean p_i45102_1_, boolean p_i45102_2_, List p_i45102_3_) + { + this.textureBlur = p_i45102_1_; + this.textureClamp = p_i45102_2_; + this.listMipmaps = p_i45102_3_; + } + + public boolean getTextureBlur() + { + return this.textureBlur; + } + + public boolean getTextureClamp() + { + return this.textureClamp; + } + + public List getListMipmaps() + { + return Collections.unmodifiableList(this.listMipmaps); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java new file mode 100644 index 0000000..5efe6df --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java @@ -0,0 +1,62 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import java.util.List; +import net.minecraft.util.JsonUtils; + +public class TextureMetadataSectionSerializer extends BaseMetadataSectionSerializer +{ + public TextureMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + boolean flag = JsonUtils.getBoolean(jsonobject, "blur", false); + boolean flag1 = JsonUtils.getBoolean(jsonobject, "clamp", false); + List list = Lists.newArrayList(); + + if (jsonobject.has("mipmaps")) + { + try + { + JsonArray jsonarray = jsonobject.getAsJsonArray("mipmaps"); + + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonElement jsonelement = jsonarray.get(i); + + if (jsonelement.isJsonPrimitive()) + { + try + { + list.add(Integer.valueOf(jsonelement.getAsInt())); + } + catch (NumberFormatException numberformatexception) + { + throw new JsonParseException("Invalid texture->mipmap->" + i + ": expected number, was " + jsonelement, numberformatexception); + } + } + else if (jsonelement.isJsonObject()) + { + throw new JsonParseException("Invalid texture->mipmap->" + i + ": expected number, was " + jsonelement); + } + } + } + catch (ClassCastException classcastexception) + { + throw new JsonParseException("Invalid texture->mipmaps: expected array, was " + jsonobject.get("mipmaps"), classcastexception); + } + } + + return new TextureMetadataSection(flag, flag1, list); + } + + public String getSectionName() + { + return "texture"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/BuiltInModel.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/BuiltInModel.java new file mode 100644 index 0000000..b585487 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/BuiltInModel.java @@ -0,0 +1,52 @@ +package net.minecraft.client.resources.model; + +import java.util.List; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.EnumFacing; + +public class BuiltInModel implements IBakedModel +{ + private ItemCameraTransforms cameraTransforms; + + public BuiltInModel(ItemCameraTransforms p_i46086_1_) + { + this.cameraTransforms = p_i46086_1_; + } + + public List getFaceQuads(EnumFacing facing) + { + return null; + } + + public List getGeneralQuads() + { + return null; + } + + public boolean isAmbientOcclusion() + { + return false; + } + + public boolean isGui3d() + { + return true; + } + + public boolean isBuiltInRenderer() + { + return true; + } + + public TextureAtlasSprite getParticleTexture() + { + return null; + } + + public ItemCameraTransforms getItemCameraTransforms() + { + return this.cameraTransforms; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/IBakedModel.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/IBakedModel.java new file mode 100644 index 0000000..c0be6ff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/IBakedModel.java @@ -0,0 +1,24 @@ +package net.minecraft.client.resources.model; + +import java.util.List; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.EnumFacing; + +public interface IBakedModel +{ + List getFaceQuads(EnumFacing facing); + + List getGeneralQuads(); + + boolean isAmbientOcclusion(); + + boolean isGui3d(); + + boolean isBuiltInRenderer(); + + TextureAtlasSprite getParticleTexture(); + + ItemCameraTransforms getItemCameraTransforms(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelBakery.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelBakery.java new file mode 100644 index 0000000..12d813a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelBakery.java @@ -0,0 +1,901 @@ +package net.minecraft.client.resources.model; + +import com.google.common.base.Charsets; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Queues; +import com.google.common.collect.Sets; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringReader; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Deque; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.client.renderer.BlockModelShapes; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.BlockPart; +import net.minecraft.client.renderer.block.model.BlockPartFace; +import net.minecraft.client.renderer.block.model.FaceBakery; +import net.minecraft.client.renderer.block.model.ItemModelGenerator; +import net.minecraft.client.renderer.block.model.ModelBlock; +import net.minecraft.client.renderer.block.model.ModelBlockDefinition; +import net.minecraft.client.renderer.texture.IIconCreator; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IRegistry; +import net.minecraft.util.RegistrySimple; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.ITransformation; +import net.minecraftforge.client.model.TRSRTransformation; +import net.minecraftforge.fml.common.registry.RegistryDelegate; +import net.optifine.CustomItems; +import net.optifine.reflect.Reflector; +import net.optifine.util.StrUtils; +import net.optifine.util.TextureUtils; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ModelBakery +{ + private static final Set LOCATIONS_BUILTIN_TEXTURES = Sets.newHashSet(new ResourceLocation[] {new ResourceLocation("blocks/water_flow"), new ResourceLocation("blocks/water_still"), new ResourceLocation("blocks/lava_flow"), new ResourceLocation("blocks/lava_still"), new ResourceLocation("blocks/destroy_stage_0"), new ResourceLocation("blocks/destroy_stage_1"), new ResourceLocation("blocks/destroy_stage_2"), new ResourceLocation("blocks/destroy_stage_3"), new ResourceLocation("blocks/destroy_stage_4"), new ResourceLocation("blocks/destroy_stage_5"), new ResourceLocation("blocks/destroy_stage_6"), new ResourceLocation("blocks/destroy_stage_7"), new ResourceLocation("blocks/destroy_stage_8"), new ResourceLocation("blocks/destroy_stage_9"), new ResourceLocation("items/empty_armor_slot_helmet"), new ResourceLocation("items/empty_armor_slot_chestplate"), new ResourceLocation("items/empty_armor_slot_leggings"), new ResourceLocation("items/empty_armor_slot_boots")}); + private static final Logger LOGGER = LogManager.getLogger(); + protected static final ModelResourceLocation MODEL_MISSING = new ModelResourceLocation("builtin/missing", "missing"); + private static final Map BUILT_IN_MODELS = Maps.newHashMap(); + private static final Joiner JOINER = Joiner.on(" -> "); + private final IResourceManager resourceManager; + private final Map sprites = Maps.newHashMap(); + private final Map models = Maps.newLinkedHashMap(); + private final Map variants = Maps.newLinkedHashMap(); + private final TextureMap textureMap; + private final BlockModelShapes blockModelShapes; + private final FaceBakery faceBakery = new FaceBakery(); + private final ItemModelGenerator itemModelGenerator = new ItemModelGenerator(); + private RegistrySimple bakedRegistry = new RegistrySimple(); + private static final ModelBlock MODEL_GENERATED = ModelBlock.deserialize("{\"elements\":[{ \"from\": [0, 0, 0], \"to\": [16, 16, 16], \"faces\": { \"down\": {\"uv\": [0, 0, 16, 16], \"texture\":\"\"} }}]}"); + private static final ModelBlock MODEL_COMPASS = ModelBlock.deserialize("{\"elements\":[{ \"from\": [0, 0, 0], \"to\": [16, 16, 16], \"faces\": { \"down\": {\"uv\": [0, 0, 16, 16], \"texture\":\"\"} }}]}"); + private static final ModelBlock MODEL_CLOCK = ModelBlock.deserialize("{\"elements\":[{ \"from\": [0, 0, 0], \"to\": [16, 16, 16], \"faces\": { \"down\": {\"uv\": [0, 0, 16, 16], \"texture\":\"\"} }}]}"); + private static final ModelBlock MODEL_ENTITY = ModelBlock.deserialize("{\"elements\":[{ \"from\": [0, 0, 0], \"to\": [16, 16, 16], \"faces\": { \"down\": {\"uv\": [0, 0, 16, 16], \"texture\":\"\"} }}]}"); + private Map itemLocations = Maps.newLinkedHashMap(); + private final Map blockDefinitions = Maps.newHashMap(); + private Map> variantNames = Maps.>newIdentityHashMap(); + private static Map, Set> customVariantNames = Maps., Set>newHashMap(); + + public ModelBakery(IResourceManager p_i46085_1_, TextureMap p_i46085_2_, BlockModelShapes p_i46085_3_) + { + this.resourceManager = p_i46085_1_; + this.textureMap = p_i46085_2_; + this.blockModelShapes = p_i46085_3_; + } + + public IRegistry setupModelRegistry() + { + this.loadVariantItemModels(); + this.loadModelsCheck(); + this.loadSprites(); + this.bakeItemModels(); + this.bakeBlockModels(); + return this.bakedRegistry; + } + + private void loadVariantItemModels() + { + this.loadVariants(this.blockModelShapes.getBlockStateMapper().putAllStateModelLocations().values()); + this.variants.put(MODEL_MISSING, new ModelBlockDefinition.Variants(MODEL_MISSING.getVariant(), Lists.newArrayList(new ModelBlockDefinition.Variant[] {new ModelBlockDefinition.Variant(new ResourceLocation(MODEL_MISSING.getResourcePath()), ModelRotation.X0_Y0, false, 1)}))); + ResourceLocation resourcelocation = new ResourceLocation("item_frame"); + ModelBlockDefinition modelblockdefinition = this.getModelBlockDefinition(resourcelocation); + this.registerVariant(modelblockdefinition, new ModelResourceLocation(resourcelocation, "normal")); + this.registerVariant(modelblockdefinition, new ModelResourceLocation(resourcelocation, "map")); + this.loadVariantModels(); + this.loadItemModels(); + } + + private void loadVariants(Collection p_177591_1_) + { + for (ModelResourceLocation modelresourcelocation : p_177591_1_) + { + try + { + ModelBlockDefinition modelblockdefinition = this.getModelBlockDefinition(modelresourcelocation); + + try + { + this.registerVariant(modelblockdefinition, modelresourcelocation); + } + catch (Exception exception) + { + LOGGER.warn((String)("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation), (Throwable)exception); + } + } + catch (Exception exception1) + { + LOGGER.warn((String)("Unable to load definition " + modelresourcelocation), (Throwable)exception1); + } + } + } + + private void registerVariant(ModelBlockDefinition p_177569_1_, ModelResourceLocation p_177569_2_) + { + this.variants.put(p_177569_2_, p_177569_1_.getVariants(p_177569_2_.getVariant())); + } + + private ModelBlockDefinition getModelBlockDefinition(ResourceLocation p_177586_1_) + { + ResourceLocation resourcelocation = this.getBlockStateLocation(p_177586_1_); + ModelBlockDefinition modelblockdefinition = (ModelBlockDefinition)this.blockDefinitions.get(resourcelocation); + + if (modelblockdefinition == null) + { + List list = Lists.newArrayList(); + + try + { + for (IResource iresource : this.resourceManager.getAllResources(resourcelocation)) + { + InputStream inputstream = null; + + try + { + inputstream = iresource.getInputStream(); + ModelBlockDefinition modelblockdefinition1 = ModelBlockDefinition.parseFromReader(new InputStreamReader(inputstream, Charsets.UTF_8)); + list.add(modelblockdefinition1); + } + catch (Exception exception) + { + throw new RuntimeException("Encountered an exception when loading model definition of \'" + p_177586_1_ + "\' from: \'" + iresource.getResourceLocation() + "\' in resourcepack: \'" + iresource.getResourcePackName() + "\'", exception); + } + finally + { + IOUtils.closeQuietly(inputstream); + } + } + } + catch (IOException ioexception) + { + throw new RuntimeException("Encountered an exception when loading model definition of model " + resourcelocation.toString(), ioexception); + } + + modelblockdefinition = new ModelBlockDefinition(list); + this.blockDefinitions.put(resourcelocation, modelblockdefinition); + } + + return modelblockdefinition; + } + + private ResourceLocation getBlockStateLocation(ResourceLocation p_177584_1_) + { + return new ResourceLocation(p_177584_1_.getResourceDomain(), "blockstates/" + p_177584_1_.getResourcePath() + ".json"); + } + + private void loadVariantModels() + { + for (ModelResourceLocation modelresourcelocation : this.variants.keySet()) + { + for (ModelBlockDefinition.Variant modelblockdefinition$variant : ((ModelBlockDefinition.Variants)this.variants.get(modelresourcelocation)).getVariants()) + { + ResourceLocation resourcelocation = modelblockdefinition$variant.getModelLocation(); + + if (this.models.get(resourcelocation) == null) + { + try + { + ModelBlock modelblock = this.loadModel(resourcelocation); + this.models.put(resourcelocation, modelblock); + } + catch (Exception exception) + { + LOGGER.warn((String)("Unable to load block model: \'" + resourcelocation + "\' for variant: \'" + modelresourcelocation + "\'"), (Throwable)exception); + } + } + } + } + } + + private ModelBlock loadModel(ResourceLocation p_177594_1_) throws IOException + { + String s = p_177594_1_.getResourcePath(); + + if ("builtin/generated".equals(s)) + { + return MODEL_GENERATED; + } + else if ("builtin/compass".equals(s)) + { + return MODEL_COMPASS; + } + else if ("builtin/clock".equals(s)) + { + return MODEL_CLOCK; + } + else if ("builtin/entity".equals(s)) + { + return MODEL_ENTITY; + } + else + { + Reader reader; + + if (s.startsWith("builtin/")) + { + String s1 = s.substring("builtin/".length()); + String s2 = (String)BUILT_IN_MODELS.get(s1); + + if (s2 == null) + { + throw new FileNotFoundException(p_177594_1_.toString()); + } + + reader = new StringReader(s2); + } + else + { + p_177594_1_ = this.getModelLocation(p_177594_1_); + IResource iresource = this.resourceManager.getResource(p_177594_1_); + reader = new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8); + } + + ModelBlock modelblock; + + try + { + ModelBlock modelblock1 = ModelBlock.deserialize(reader); + modelblock1.name = p_177594_1_.toString(); + modelblock = modelblock1; + String s3 = TextureUtils.getBasePath(p_177594_1_.getResourcePath()); + fixModelLocations(modelblock1, s3); + } + finally + { + reader.close(); + } + + return modelblock; + } + } + + private ResourceLocation getModelLocation(ResourceLocation p_177580_1_) + { + ResourceLocation resourcelocation = p_177580_1_; + String s = p_177580_1_.getResourcePath(); + + if (!s.startsWith("mcpatcher") && !s.startsWith("optifine")) + { + return new ResourceLocation(p_177580_1_.getResourceDomain(), "models/" + p_177580_1_.getResourcePath() + ".json"); + } + else + { + if (!s.endsWith(".json")) + { + resourcelocation = new ResourceLocation(p_177580_1_.getResourceDomain(), s + ".json"); + } + + return resourcelocation; + } + } + + private void loadItemModels() + { + this.registerVariantNames(); + + for (Item item : Item.itemRegistry) + { + for (String s : this.getVariantNames(item)) + { + ResourceLocation resourcelocation = this.getItemLocation(s); + this.itemLocations.put(s, resourcelocation); + + if (this.models.get(resourcelocation) == null) + { + try + { + ModelBlock modelblock = this.loadModel(resourcelocation); + this.models.put(resourcelocation, modelblock); + } + catch (Exception exception) + { + LOGGER.warn((String)("Unable to load item model: \'" + resourcelocation + "\' for item: \'" + Item.itemRegistry.getNameForObject(item) + "\'"), (Throwable)exception); + } + } + } + } + } + + public void loadItemModel(String p_loadItemModel_1_, ResourceLocation p_loadItemModel_2_, ResourceLocation p_loadItemModel_3_) + { + this.itemLocations.put(p_loadItemModel_1_, p_loadItemModel_2_); + + if (this.models.get(p_loadItemModel_2_) == null) + { + try + { + ModelBlock modelblock = this.loadModel(p_loadItemModel_2_); + this.models.put(p_loadItemModel_2_, modelblock); + } + catch (Exception exception) + { + LOGGER.warn("Unable to load item model: \'{}\' for item: \'{}\'", new Object[] {p_loadItemModel_2_, p_loadItemModel_3_}); + LOGGER.warn(exception.getClass().getName() + ": " + exception.getMessage()); + } + } + } + + private void registerVariantNames() + { + this.variantNames.clear(); + this.variantNames.put(Item.getItemFromBlock(Blocks.stone), Lists.newArrayList(new String[] {"stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.dirt), Lists.newArrayList(new String[] {"dirt", "coarse_dirt", "podzol"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.planks), Lists.newArrayList(new String[] {"oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.sapling), Lists.newArrayList(new String[] {"oak_sapling", "spruce_sapling", "birch_sapling", "jungle_sapling", "acacia_sapling", "dark_oak_sapling"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.sand), Lists.newArrayList(new String[] {"sand", "red_sand"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.log), Lists.newArrayList(new String[] {"oak_log", "spruce_log", "birch_log", "jungle_log"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.leaves), Lists.newArrayList(new String[] {"oak_leaves", "spruce_leaves", "birch_leaves", "jungle_leaves"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.sponge), Lists.newArrayList(new String[] {"sponge", "sponge_wet"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.sandstone), Lists.newArrayList(new String[] {"sandstone", "chiseled_sandstone", "smooth_sandstone"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.red_sandstone), Lists.newArrayList(new String[] {"red_sandstone", "chiseled_red_sandstone", "smooth_red_sandstone"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.tallgrass), Lists.newArrayList(new String[] {"dead_bush", "tall_grass", "fern"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.deadbush), Lists.newArrayList(new String[] {"dead_bush"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.wool), Lists.newArrayList(new String[] {"black_wool", "red_wool", "green_wool", "brown_wool", "blue_wool", "purple_wool", "cyan_wool", "silver_wool", "gray_wool", "pink_wool", "lime_wool", "yellow_wool", "light_blue_wool", "magenta_wool", "orange_wool", "white_wool"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.yellow_flower), Lists.newArrayList(new String[] {"dandelion"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.red_flower), Lists.newArrayList(new String[] {"poppy", "blue_orchid", "allium", "houstonia", "red_tulip", "orange_tulip", "white_tulip", "pink_tulip", "oxeye_daisy"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.stone_slab), Lists.newArrayList(new String[] {"stone_slab", "sandstone_slab", "cobblestone_slab", "brick_slab", "stone_brick_slab", "nether_brick_slab", "quartz_slab"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.stone_slab2), Lists.newArrayList(new String[] {"red_sandstone_slab"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.stained_glass), Lists.newArrayList(new String[] {"black_stained_glass", "red_stained_glass", "green_stained_glass", "brown_stained_glass", "blue_stained_glass", "purple_stained_glass", "cyan_stained_glass", "silver_stained_glass", "gray_stained_glass", "pink_stained_glass", "lime_stained_glass", "yellow_stained_glass", "light_blue_stained_glass", "magenta_stained_glass", "orange_stained_glass", "white_stained_glass"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.monster_egg), Lists.newArrayList(new String[] {"stone_monster_egg", "cobblestone_monster_egg", "stone_brick_monster_egg", "mossy_brick_monster_egg", "cracked_brick_monster_egg", "chiseled_brick_monster_egg"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.stonebrick), Lists.newArrayList(new String[] {"stonebrick", "mossy_stonebrick", "cracked_stonebrick", "chiseled_stonebrick"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.wooden_slab), Lists.newArrayList(new String[] {"oak_slab", "spruce_slab", "birch_slab", "jungle_slab", "acacia_slab", "dark_oak_slab"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.cobblestone_wall), Lists.newArrayList(new String[] {"cobblestone_wall", "mossy_cobblestone_wall"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.anvil), Lists.newArrayList(new String[] {"anvil_intact", "anvil_slightly_damaged", "anvil_very_damaged"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.quartz_block), Lists.newArrayList(new String[] {"quartz_block", "chiseled_quartz_block", "quartz_column"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.stained_hardened_clay), Lists.newArrayList(new String[] {"black_stained_hardened_clay", "red_stained_hardened_clay", "green_stained_hardened_clay", "brown_stained_hardened_clay", "blue_stained_hardened_clay", "purple_stained_hardened_clay", "cyan_stained_hardened_clay", "silver_stained_hardened_clay", "gray_stained_hardened_clay", "pink_stained_hardened_clay", "lime_stained_hardened_clay", "yellow_stained_hardened_clay", "light_blue_stained_hardened_clay", "magenta_stained_hardened_clay", "orange_stained_hardened_clay", "white_stained_hardened_clay"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.stained_glass_pane), Lists.newArrayList(new String[] {"black_stained_glass_pane", "red_stained_glass_pane", "green_stained_glass_pane", "brown_stained_glass_pane", "blue_stained_glass_pane", "purple_stained_glass_pane", "cyan_stained_glass_pane", "silver_stained_glass_pane", "gray_stained_glass_pane", "pink_stained_glass_pane", "lime_stained_glass_pane", "yellow_stained_glass_pane", "light_blue_stained_glass_pane", "magenta_stained_glass_pane", "orange_stained_glass_pane", "white_stained_glass_pane"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.leaves2), Lists.newArrayList(new String[] {"acacia_leaves", "dark_oak_leaves"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.log2), Lists.newArrayList(new String[] {"acacia_log", "dark_oak_log"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.prismarine), Lists.newArrayList(new String[] {"prismarine", "prismarine_bricks", "dark_prismarine"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.carpet), Lists.newArrayList(new String[] {"black_carpet", "red_carpet", "green_carpet", "brown_carpet", "blue_carpet", "purple_carpet", "cyan_carpet", "silver_carpet", "gray_carpet", "pink_carpet", "lime_carpet", "yellow_carpet", "light_blue_carpet", "magenta_carpet", "orange_carpet", "white_carpet"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.double_plant), Lists.newArrayList(new String[] {"sunflower", "syringa", "double_grass", "double_fern", "double_rose", "paeonia"})); + this.variantNames.put(Items.bow, Lists.newArrayList(new String[] {"bow", "bow_pulling_0", "bow_pulling_1", "bow_pulling_2"})); + this.variantNames.put(Items.coal, Lists.newArrayList(new String[] {"coal", "charcoal"})); + this.variantNames.put(Items.fishing_rod, Lists.newArrayList(new String[] {"fishing_rod", "fishing_rod_cast"})); + this.variantNames.put(Items.fish, Lists.newArrayList(new String[] {"cod", "salmon", "clownfish", "pufferfish"})); + this.variantNames.put(Items.cooked_fish, Lists.newArrayList(new String[] {"cooked_cod", "cooked_salmon"})); + this.variantNames.put(Items.dye, Lists.newArrayList(new String[] {"dye_black", "dye_red", "dye_green", "dye_brown", "dye_blue", "dye_purple", "dye_cyan", "dye_silver", "dye_gray", "dye_pink", "dye_lime", "dye_yellow", "dye_light_blue", "dye_magenta", "dye_orange", "dye_white"})); + this.variantNames.put(Items.potionitem, Lists.newArrayList(new String[] {"bottle_drinkable", "bottle_splash"})); + this.variantNames.put(Items.skull, Lists.newArrayList(new String[] {"skull_skeleton", "skull_wither", "skull_zombie", "skull_char", "skull_creeper"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence_gate), Lists.newArrayList(new String[] {"oak_fence_gate"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence), Lists.newArrayList(new String[] {"oak_fence"})); + this.variantNames.put(Items.oak_door, Lists.newArrayList(new String[] {"oak_door"})); + + for (Entry, Set> entry : customVariantNames.entrySet()) + { + this.variantNames.put((Item) ((RegistryDelegate)entry.getKey()).get(), Lists.newArrayList(((Set)entry.getValue()).iterator())); + } + + CustomItems.update(); + CustomItems.loadModels(this); + } + + private List getVariantNames(Item p_177596_1_) + { + List list = (List)this.variantNames.get(p_177596_1_); + + if (list == null) + { + list = Collections.singletonList(((ResourceLocation)Item.itemRegistry.getNameForObject(p_177596_1_)).toString()); + } + + return list; + } + + private ResourceLocation getItemLocation(String p_177583_1_) + { + ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_); + + if (Reflector.ForgeHooksClient.exists()) + { + resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", "")); + } + + return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath()); + } + + private void bakeBlockModels() + { + for (ModelResourceLocation modelresourcelocation : this.variants.keySet()) + { + WeightedBakedModel.Builder weightedbakedmodel$builder = new WeightedBakedModel.Builder(); + int i = 0; + + for (ModelBlockDefinition.Variant modelblockdefinition$variant : ((ModelBlockDefinition.Variants)this.variants.get(modelresourcelocation)).getVariants()) + { + ModelBlock modelblock = (ModelBlock)this.models.get(modelblockdefinition$variant.getModelLocation()); + + if (modelblock != null && modelblock.isResolved()) + { + ++i; + weightedbakedmodel$builder.add(this.bakeModel(modelblock, modelblockdefinition$variant.getRotation(), modelblockdefinition$variant.isUvLocked()), modelblockdefinition$variant.getWeight()); + } + else + { + LOGGER.warn("Missing model for: " + modelresourcelocation); + } + } + + if (i == 0) + { + LOGGER.warn("No weighted models for: " + modelresourcelocation); + } + else if (i == 1) + { + this.bakedRegistry.putObject(modelresourcelocation, weightedbakedmodel$builder.first()); + } + else + { + this.bakedRegistry.putObject(modelresourcelocation, weightedbakedmodel$builder.build()); + } + } + + for (Entry entry : this.itemLocations.entrySet()) + { + ResourceLocation resourcelocation = (ResourceLocation)entry.getValue(); + ModelResourceLocation modelresourcelocation1 = new ModelResourceLocation((String)entry.getKey(), "inventory"); + + if (Reflector.ModelLoader_getInventoryVariant.exists()) + { + modelresourcelocation1 = (ModelResourceLocation)Reflector.call(Reflector.ModelLoader_getInventoryVariant, new Object[] {entry.getKey()}); + } + + ModelBlock modelblock1 = (ModelBlock)this.models.get(resourcelocation); + + if (modelblock1 != null && modelblock1.isResolved()) + { + if (this.isCustomRenderer(modelblock1)) + { + this.bakedRegistry.putObject(modelresourcelocation1, new BuiltInModel(modelblock1.getAllTransforms())); + } + else + { + this.bakedRegistry.putObject(modelresourcelocation1, this.bakeModel(modelblock1, ModelRotation.X0_Y0, false)); + } + } + else + { + LOGGER.warn("Missing model for: " + resourcelocation); + } + } + } + + private Set getVariantsTextureLocations() + { + Set set = Sets.newHashSet(); + List list = Lists.newArrayList(this.variants.keySet()); + Collections.sort(list, new Comparator() + { + public int compare(ModelResourceLocation p_compare_1_, ModelResourceLocation p_compare_2_) + { + return p_compare_1_.toString().compareTo(p_compare_2_.toString()); + } + }); + + for (ModelResourceLocation modelresourcelocation : list) + { + ModelBlockDefinition.Variants modelblockdefinition$variants = (ModelBlockDefinition.Variants)this.variants.get(modelresourcelocation); + + for (ModelBlockDefinition.Variant modelblockdefinition$variant : modelblockdefinition$variants.getVariants()) + { + ModelBlock modelblock = (ModelBlock)this.models.get(modelblockdefinition$variant.getModelLocation()); + + if (modelblock == null) + { + LOGGER.warn("Missing model for: " + modelresourcelocation); + } + else + { + set.addAll(this.getTextureLocations(modelblock)); + } + } + } + + set.addAll(LOCATIONS_BUILTIN_TEXTURES); + return set; + } + + public IBakedModel bakeModel(ModelBlock modelBlockIn, ModelRotation modelRotationIn, boolean uvLocked) + { + return this.bakeModel(modelBlockIn, (ITransformation)modelRotationIn, uvLocked); + } + + protected IBakedModel bakeModel(ModelBlock p_bakeModel_1_, ITransformation p_bakeModel_2_, boolean p_bakeModel_3_) + { + TextureAtlasSprite textureatlassprite = this.sprites.get(new ResourceLocation(p_bakeModel_1_.resolveTextureName("particle"))); + SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(p_bakeModel_1_)).setTexture(textureatlassprite); + + for (BlockPart blockpart : p_bakeModel_1_.getElements()) + { + for (EnumFacing enumfacing : blockpart.mapFaces.keySet()) + { + BlockPartFace blockpartface = blockpart.mapFaces.get(enumfacing); + TextureAtlasSprite textureatlassprite1 = this.sprites.get(new ResourceLocation(p_bakeModel_1_.resolveTextureName(blockpartface.texture))); + boolean flag = true; + + if (Reflector.ForgeHooksClient.exists()) + { + flag = TRSRTransformation.isInteger(p_bakeModel_2_.getMatrix()); + } + + if (blockpartface.cullFace != null && flag) + { + simplebakedmodel$builder.addFaceQuad(p_bakeModel_2_.rotate(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_bakeModel_2_, p_bakeModel_3_)); + } + else + { + simplebakedmodel$builder.addGeneralQuad(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_bakeModel_2_, p_bakeModel_3_)); + } + } + } + + return simplebakedmodel$builder.makeBakedModel(); + } + + private BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_) + { + return Reflector.ForgeHooksClient.exists() ? this.makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_6_) : this.faceBakery.makeBakedQuad(p_177589_1_.positionFrom, p_177589_1_.positionTo, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.partRotation, p_177589_6_, p_177589_1_.shade); + } + + protected BakedQuad makeBakedQuad(BlockPart p_makeBakedQuad_1_, BlockPartFace p_makeBakedQuad_2_, TextureAtlasSprite p_makeBakedQuad_3_, EnumFacing p_makeBakedQuad_4_, ITransformation p_makeBakedQuad_5_, boolean p_makeBakedQuad_6_) + { + return this.faceBakery.makeBakedQuad(p_makeBakedQuad_1_.positionFrom, p_makeBakedQuad_1_.positionTo, p_makeBakedQuad_2_, p_makeBakedQuad_3_, p_makeBakedQuad_4_, p_makeBakedQuad_5_, p_makeBakedQuad_1_.partRotation, p_makeBakedQuad_6_, p_makeBakedQuad_1_.shade); + } + + private void loadModelsCheck() + { + this.loadModels(); + + for (ModelBlock modelblock : this.models.values()) + { + modelblock.getParentFromMap(this.models); + } + + ModelBlock.checkModelHierarchy(this.models); + } + + private void loadModels() + { + Deque deque = Queues.newArrayDeque(); + Set set = Sets.newHashSet(); + + for (ResourceLocation resourcelocation : this.models.keySet()) + { + set.add(resourcelocation); + ResourceLocation resourcelocation1 = ((ModelBlock)this.models.get(resourcelocation)).getParentLocation(); + + if (resourcelocation1 != null) + { + deque.add(resourcelocation1); + } + } + + while (!((Deque)deque).isEmpty()) + { + ResourceLocation resourcelocation2 = (ResourceLocation)deque.pop(); + + try + { + if (this.models.get(resourcelocation2) != null) + { + continue; + } + + ModelBlock modelblock = this.loadModel(resourcelocation2); + this.models.put(resourcelocation2, modelblock); + ResourceLocation resourcelocation3 = modelblock.getParentLocation(); + + if (resourcelocation3 != null && !set.contains(resourcelocation3)) + { + deque.add(resourcelocation3); + } + } + catch (Exception var6) + { + LOGGER.warn("In parent chain: " + JOINER.join(this.getParentPath(resourcelocation2)) + "; unable to load model: \'" + resourcelocation2 + "\'"); + } + + set.add(resourcelocation2); + } + } + + private List getParentPath(ResourceLocation p_177573_1_) + { + List list = Lists.newArrayList(new ResourceLocation[] {p_177573_1_}); + ResourceLocation resourcelocation = p_177573_1_; + + while ((resourcelocation = this.getParentLocation(resourcelocation)) != null) + { + list.add(0, resourcelocation); + } + + return list; + } + + private ResourceLocation getParentLocation(ResourceLocation p_177576_1_) + { + for (Entry entry : this.models.entrySet()) + { + ModelBlock modelblock = (ModelBlock)entry.getValue(); + + if (modelblock != null && p_177576_1_.equals(modelblock.getParentLocation())) + { + return (ResourceLocation)entry.getKey(); + } + } + + return null; + } + + private Set getTextureLocations(ModelBlock p_177585_1_) + { + Set set = Sets.newHashSet(); + + for (BlockPart blockpart : p_177585_1_.getElements()) + { + for (BlockPartFace blockpartface : blockpart.mapFaces.values()) + { + ResourceLocation resourcelocation = new ResourceLocation(p_177585_1_.resolveTextureName(blockpartface.texture)); + set.add(resourcelocation); + } + } + + set.add(new ResourceLocation(p_177585_1_.resolveTextureName("particle"))); + return set; + } + + private void loadSprites() + { + final Set set = this.getVariantsTextureLocations(); + set.addAll(this.getItemsTextureLocations()); + set.remove(TextureMap.LOCATION_MISSING_TEXTURE); + IIconCreator iiconcreator = new IIconCreator() + { + public void registerSprites(TextureMap iconRegistry) + { + for (ResourceLocation resourcelocation : set) + { + TextureAtlasSprite textureatlassprite = iconRegistry.registerSprite(resourcelocation); + ModelBakery.this.sprites.put(resourcelocation, textureatlassprite); + } + } + }; + this.textureMap.loadSprites(this.resourceManager, iiconcreator); + this.sprites.put(new ResourceLocation("missingno"), this.textureMap.getMissingSprite()); + } + + private Set getItemsTextureLocations() + { + Set set = Sets.newHashSet(); + + for (ResourceLocation resourcelocation : this.itemLocations.values()) + { + ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation); + + if (modelblock != null) + { + set.add(new ResourceLocation(modelblock.resolveTextureName("particle"))); + + if (this.hasItemModel(modelblock)) + { + for (String s : ItemModelGenerator.LAYERS) + { + ResourceLocation resourcelocation2 = new ResourceLocation(modelblock.resolveTextureName(s)); + + if (modelblock.getRootModel() == MODEL_COMPASS && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2)) + { + TextureAtlasSprite.setLocationNameCompass(resourcelocation2.toString()); + } + else if (modelblock.getRootModel() == MODEL_CLOCK && !TextureMap.LOCATION_MISSING_TEXTURE.equals(resourcelocation2)) + { + TextureAtlasSprite.setLocationNameClock(resourcelocation2.toString()); + } + + set.add(resourcelocation2); + } + } + else if (!this.isCustomRenderer(modelblock)) + { + for (BlockPart blockpart : modelblock.getElements()) + { + for (BlockPartFace blockpartface : blockpart.mapFaces.values()) + { + ResourceLocation resourcelocation1 = new ResourceLocation(modelblock.resolveTextureName(blockpartface.texture)); + set.add(resourcelocation1); + } + } + } + } + } + + return set; + } + + private boolean hasItemModel(ModelBlock p_177581_1_) + { + if (p_177581_1_ == null) + { + return false; + } + else + { + ModelBlock modelblock = p_177581_1_.getRootModel(); + return modelblock == MODEL_GENERATED || modelblock == MODEL_COMPASS || modelblock == MODEL_CLOCK; + } + } + + private boolean isCustomRenderer(ModelBlock p_177587_1_) + { + if (p_177587_1_ == null) + { + return false; + } + else + { + ModelBlock modelblock = p_177587_1_.getRootModel(); + return modelblock == MODEL_ENTITY; + } + } + + private void bakeItemModels() + { + for (ResourceLocation resourcelocation : this.itemLocations.values()) + { + ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation); + + if (this.hasItemModel(modelblock)) + { + ModelBlock modelblock1 = this.makeItemModel(modelblock); + + if (modelblock1 != null) + { + modelblock1.name = resourcelocation.toString(); + } + + this.models.put(resourcelocation, modelblock1); + } + else if (this.isCustomRenderer(modelblock)) + { + this.models.put(resourcelocation, modelblock); + } + } + + for (TextureAtlasSprite textureatlassprite : this.sprites.values()) + { + if (!textureatlassprite.hasAnimationMetadata()) + { + textureatlassprite.clearFramesTextureData(); + } + } + } + + private ModelBlock makeItemModel(ModelBlock p_177582_1_) + { + return this.itemModelGenerator.makeItemModel(this.textureMap, p_177582_1_); + } + + public ModelBlock getModelBlock(ResourceLocation p_getModelBlock_1_) + { + ModelBlock modelblock = (ModelBlock)this.models.get(p_getModelBlock_1_); + return modelblock; + } + + public static void fixModelLocations(ModelBlock p_fixModelLocations_0_, String p_fixModelLocations_1_) + { + ResourceLocation resourcelocation = fixModelLocation(p_fixModelLocations_0_.getParentLocation(), p_fixModelLocations_1_); + + if (resourcelocation != p_fixModelLocations_0_.getParentLocation()) + { + Reflector.setFieldValue(p_fixModelLocations_0_, Reflector.ModelBlock_parentLocation, resourcelocation); + } + + Map map = (Map)Reflector.getFieldValue(p_fixModelLocations_0_, Reflector.ModelBlock_textures); + + if (map != null) + { + for (Entry entry : map.entrySet()) + { + String s = (String)entry.getValue(); + String s1 = fixResourcePath(s, p_fixModelLocations_1_); + + if (s1 != s) + { + entry.setValue(s1); + } + } + } + } + + public static ResourceLocation fixModelLocation(ResourceLocation p_fixModelLocation_0_, String p_fixModelLocation_1_) + { + if (p_fixModelLocation_0_ != null && p_fixModelLocation_1_ != null) + { + if (!p_fixModelLocation_0_.getResourceDomain().equals("minecraft")) + { + return p_fixModelLocation_0_; + } + else + { + String s = p_fixModelLocation_0_.getResourcePath(); + String s1 = fixResourcePath(s, p_fixModelLocation_1_); + + if (s1 != s) + { + p_fixModelLocation_0_ = new ResourceLocation(p_fixModelLocation_0_.getResourceDomain(), s1); + } + + return p_fixModelLocation_0_; + } + } + else + { + return p_fixModelLocation_0_; + } + } + + private static String fixResourcePath(String p_fixResourcePath_0_, String p_fixResourcePath_1_) + { + p_fixResourcePath_0_ = TextureUtils.fixResourcePath(p_fixResourcePath_0_, p_fixResourcePath_1_); + p_fixResourcePath_0_ = StrUtils.removeSuffix(p_fixResourcePath_0_, ".json"); + p_fixResourcePath_0_ = StrUtils.removeSuffix(p_fixResourcePath_0_, ".png"); + return p_fixResourcePath_0_; + } + + @Deprecated + public static void addVariantName(Item p_addVariantName_0_, String... p_addVariantName_1_) + { + RegistryDelegate registrydelegate = (RegistryDelegate)Reflector.getFieldValue(p_addVariantName_0_, Reflector.ForgeItem_delegate); + + if (customVariantNames.containsKey(registrydelegate)) + { + ((Set)customVariantNames.get(registrydelegate)).addAll(Lists.newArrayList(p_addVariantName_1_)); + } + else + { + customVariantNames.put(registrydelegate, Sets.newHashSet(p_addVariantName_1_)); + } + } + + public static void registerItemVariants(Item p_registerItemVariants_0_, T... p_registerItemVariants_1_) + { + RegistryDelegate registrydelegate = (RegistryDelegate)Reflector.getFieldValue(p_registerItemVariants_0_, Reflector.ForgeItem_delegate); + + if (!customVariantNames.containsKey(registrydelegate)) + { + customVariantNames.put(registrydelegate, Sets.newHashSet()); + } + + for (ResourceLocation resourcelocation : p_registerItemVariants_1_) + { + ((Set)customVariantNames.get(registrydelegate)).add(resourcelocation.toString()); + } + } + + static + { + BUILT_IN_MODELS.put("missing", "{ \"textures\": { \"particle\": \"missingno\", \"missingno\": \"missingno\"}, \"elements\": [ { \"from\": [ 0, 0, 0 ], \"to\": [ 16, 16, 16 ], \"faces\": { \"down\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"down\", \"texture\": \"#missingno\" }, \"up\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"up\", \"texture\": \"#missingno\" }, \"north\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"north\", \"texture\": \"#missingno\" }, \"south\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"south\", \"texture\": \"#missingno\" }, \"west\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"west\", \"texture\": \"#missingno\" }, \"east\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"east\", \"texture\": \"#missingno\" } }}]}"); + MODEL_GENERATED.name = "generation marker"; + MODEL_COMPASS.name = "compass generation marker"; + MODEL_CLOCK.name = "class generation marker"; + MODEL_ENTITY.name = "block entity marker"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelManager.java new file mode 100644 index 0000000..8460bdb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelManager.java @@ -0,0 +1,57 @@ +package net.minecraft.client.resources.model; + +import net.minecraft.client.renderer.BlockModelShapes; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.util.IRegistry; + +public class ModelManager implements IResourceManagerReloadListener +{ + private IRegistry modelRegistry; + private final TextureMap texMap; + private final BlockModelShapes modelProvider; + private IBakedModel defaultModel; + + public ModelManager(TextureMap textures) + { + this.texMap = textures; + this.modelProvider = new BlockModelShapes(this); + } + + public void onResourceManagerReload(IResourceManager resourceManager) + { + ModelBakery modelbakery = new ModelBakery(resourceManager, this.texMap, this.modelProvider); + this.modelRegistry = modelbakery.setupModelRegistry(); + this.defaultModel = (IBakedModel)this.modelRegistry.getObject(ModelBakery.MODEL_MISSING); + this.modelProvider.reloadModels(); + } + + public IBakedModel getModel(ModelResourceLocation modelLocation) + { + if (modelLocation == null) + { + return this.defaultModel; + } + else + { + IBakedModel ibakedmodel = (IBakedModel)this.modelRegistry.getObject(modelLocation); + return ibakedmodel == null ? this.defaultModel : ibakedmodel; + } + } + + public IBakedModel getMissingModel() + { + return this.defaultModel; + } + + public TextureMap getTextureMap() + { + return this.texMap; + } + + public BlockModelShapes getBlockModelShapes() + { + return this.modelProvider; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelResourceLocation.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelResourceLocation.java new file mode 100644 index 0000000..8596777 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelResourceLocation.java @@ -0,0 +1,82 @@ +package net.minecraft.client.resources.model; + +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.StringUtils; + +public class ModelResourceLocation extends ResourceLocation +{ + private final String variant; + + protected ModelResourceLocation(int p_i46078_1_, String... p_i46078_2_) + { + super(0, new String[] {p_i46078_2_[0], p_i46078_2_[1]}); + this.variant = StringUtils.isEmpty(p_i46078_2_[2]) ? "normal" : p_i46078_2_[2].toLowerCase(); + } + + public ModelResourceLocation(String p_i46079_1_) + { + this(0, parsePathString(p_i46079_1_)); + } + + public ModelResourceLocation(ResourceLocation p_i46080_1_, String p_i46080_2_) + { + this(p_i46080_1_.toString(), p_i46080_2_); + } + + public ModelResourceLocation(String p_i46081_1_, String p_i46081_2_) + { + this(0, parsePathString(p_i46081_1_ + '#' + (p_i46081_2_ == null ? "normal" : p_i46081_2_))); + } + + protected static String[] parsePathString(String p_177517_0_) + { + String[] astring = new String[] {null, p_177517_0_, null}; + int i = p_177517_0_.indexOf(35); + String s = p_177517_0_; + + if (i >= 0) + { + astring[2] = p_177517_0_.substring(i + 1, p_177517_0_.length()); + + if (i > 1) + { + s = p_177517_0_.substring(0, i); + } + } + + System.arraycopy(ResourceLocation.splitObjectName(s), 0, astring, 0, 2); + return astring; + } + + public String getVariant() + { + return this.variant; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ instanceof ModelResourceLocation && super.equals(p_equals_1_)) + { + ModelResourceLocation modelresourcelocation = (ModelResourceLocation)p_equals_1_; + return this.variant.equals(modelresourcelocation.variant); + } + else + { + return false; + } + } + + public int hashCode() + { + return 31 * super.hashCode() + this.variant.hashCode(); + } + + public String toString() + { + return super.toString() + '#' + this.variant; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelRotation.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelRotation.java new file mode 100644 index 0000000..4feae9d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/ModelRotation.java @@ -0,0 +1,141 @@ +package net.minecraft.client.resources.model; + +import com.google.common.base.Optional; +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraftforge.client.model.IModelPart; +import net.minecraftforge.client.model.IModelState; +import net.minecraftforge.client.model.ITransformation; +import net.minecraftforge.client.model.TRSRTransformation; +import net.optifine.reflect.Reflector; +import org.lwjgl.util.vector.Matrix4f; +import org.lwjgl.util.vector.Vector3f; + +public enum ModelRotation implements IModelState, ITransformation +{ + X0_Y0(0, 0), + X0_Y90(0, 90), + X0_Y180(0, 180), + X0_Y270(0, 270), + X90_Y0(90, 0), + X90_Y90(90, 90), + X90_Y180(90, 180), + X90_Y270(90, 270), + X180_Y0(180, 0), + X180_Y90(180, 90), + X180_Y180(180, 180), + X180_Y270(180, 270), + X270_Y0(270, 0), + X270_Y90(270, 90), + X270_Y180(270, 180), + X270_Y270(270, 270); + + private static final Map mapRotations = Maps.newHashMap(); + private final int combinedXY; + private final Matrix4f matrix4d; + private final int quartersX; + private final int quartersY; + + private static int combineXY(int p_177521_0_, int p_177521_1_) + { + return p_177521_0_ * 360 + p_177521_1_; + } + + private ModelRotation(int p_i46087_3_, int p_i46087_4_) + { + this.combinedXY = combineXY(p_i46087_3_, p_i46087_4_); + this.matrix4d = new Matrix4f(); + Matrix4f matrix4f = new Matrix4f(); + matrix4f.setIdentity(); + Matrix4f.rotate((float)(-p_i46087_3_) * 0.017453292F, new Vector3f(1.0F, 0.0F, 0.0F), matrix4f, matrix4f); + this.quartersX = MathHelper.abs_int(p_i46087_3_ / 90); + Matrix4f matrix4f1 = new Matrix4f(); + matrix4f1.setIdentity(); + Matrix4f.rotate((float)(-p_i46087_4_) * 0.017453292F, new Vector3f(0.0F, 1.0F, 0.0F), matrix4f1, matrix4f1); + this.quartersY = MathHelper.abs_int(p_i46087_4_ / 90); + Matrix4f.mul(matrix4f1, matrix4f, this.matrix4d); + } + + public Matrix4f getMatrix4d() + { + return this.matrix4d; + } + + public EnumFacing rotateFace(EnumFacing p_177523_1_) + { + EnumFacing enumfacing = p_177523_1_; + + for (int i = 0; i < this.quartersX; ++i) + { + enumfacing = enumfacing.rotateAround(EnumFacing.Axis.X); + } + + if (enumfacing.getAxis() != EnumFacing.Axis.Y) + { + for (int j = 0; j < this.quartersY; ++j) + { + enumfacing = enumfacing.rotateAround(EnumFacing.Axis.Y); + } + } + + return enumfacing; + } + + public int rotateVertex(EnumFacing facing, int vertexIndex) + { + int i = vertexIndex; + + if (facing.getAxis() == EnumFacing.Axis.X) + { + i = (vertexIndex + this.quartersX) % 4; + } + + EnumFacing enumfacing = facing; + + for (int j = 0; j < this.quartersX; ++j) + { + enumfacing = enumfacing.rotateAround(EnumFacing.Axis.X); + } + + if (enumfacing.getAxis() == EnumFacing.Axis.Y) + { + i = (i + this.quartersY) % 4; + } + + return i; + } + + public static ModelRotation getModelRotation(int p_177524_0_, int p_177524_1_) + { + return (ModelRotation)mapRotations.get(Integer.valueOf(combineXY(MathHelper.normalizeAngle(p_177524_0_, 360), MathHelper.normalizeAngle(p_177524_1_, 360)))); + } + + public Optional apply(Optional p_apply_1_) + { + return (Optional)Reflector.call(Reflector.ForgeHooksClient_applyTransform, new Object[] {this.getMatrix(), p_apply_1_}); + } + + public javax.vecmath.Matrix4f getMatrix() + { + return Reflector.ForgeHooksClient_getMatrix.exists() ? (javax.vecmath.Matrix4f)Reflector.call(Reflector.ForgeHooksClient_getMatrix, new Object[] {this}): new javax.vecmath.Matrix4f(); + } + + public EnumFacing rotate(EnumFacing p_rotate_1_) + { + return this.rotateFace(p_rotate_1_); + } + + public int rotate(EnumFacing p_rotate_1_, int p_rotate_2_) + { + return this.rotateVertex(p_rotate_1_, p_rotate_2_); + } + + static { + for (ModelRotation modelrotation : values()) + { + mapRotations.put(Integer.valueOf(modelrotation.combinedXY), modelrotation); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/SimpleBakedModel.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/SimpleBakedModel.java new file mode 100644 index 0000000..b692d09 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/SimpleBakedModel.java @@ -0,0 +1,154 @@ +package net.minecraft.client.resources.model; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.BreakingFour; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.block.model.ModelBlock; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.EnumFacing; + +public class SimpleBakedModel implements IBakedModel +{ + protected final List generalQuads; + protected final List> faceQuads; + protected final boolean ambientOcclusion; + protected final boolean gui3d; + protected final TextureAtlasSprite texture; + protected final ItemCameraTransforms cameraTransforms; + + public SimpleBakedModel(List generalQuadsIn, List> faceQuadsIn, boolean ambientOcclusionIn, boolean gui3dIn, TextureAtlasSprite textureIn, ItemCameraTransforms cameraTransformsIn) + { + this.generalQuads = generalQuadsIn; + this.faceQuads = faceQuadsIn; + this.ambientOcclusion = ambientOcclusionIn; + this.gui3d = gui3dIn; + this.texture = textureIn; + this.cameraTransforms = cameraTransformsIn; + } + + public List getFaceQuads(EnumFacing facing) + { + return (List)this.faceQuads.get(facing.ordinal()); + } + + public List getGeneralQuads() + { + return this.generalQuads; + } + + public boolean isAmbientOcclusion() + { + return this.ambientOcclusion; + } + + public boolean isGui3d() + { + return this.gui3d; + } + + public boolean isBuiltInRenderer() + { + return false; + } + + public TextureAtlasSprite getParticleTexture() + { + return this.texture; + } + + public ItemCameraTransforms getItemCameraTransforms() + { + return this.cameraTransforms; + } + + public static class Builder + { + private final List builderGeneralQuads; + private final List> builderFaceQuads; + private final boolean builderAmbientOcclusion; + private TextureAtlasSprite builderTexture; + private boolean builderGui3d; + private ItemCameraTransforms builderCameraTransforms; + + public Builder(ModelBlock model) + { + this(model.isAmbientOcclusion(), model.isGui3d(), model.getAllTransforms()); + } + + public Builder(IBakedModel bakedModel, TextureAtlasSprite texture) + { + this(bakedModel.isAmbientOcclusion(), bakedModel.isGui3d(), bakedModel.getItemCameraTransforms()); + this.builderTexture = bakedModel.getParticleTexture(); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + this.addFaceBreakingFours(bakedModel, texture, enumfacing); + } + + this.addGeneralBreakingFours(bakedModel, texture); + } + + private void addFaceBreakingFours(IBakedModel bakedModel, TextureAtlasSprite texture, EnumFacing facing) + { + for (BakedQuad bakedquad : bakedModel.getFaceQuads(facing)) + { + this.addFaceQuad(facing, new BreakingFour(bakedquad, texture)); + } + } + + private void addGeneralBreakingFours(IBakedModel p_177647_1_, TextureAtlasSprite texture) + { + for (BakedQuad bakedquad : p_177647_1_.getGeneralQuads()) + { + this.addGeneralQuad(new BreakingFour(bakedquad, texture)); + } + } + + private Builder(boolean ambientOcclusion, boolean gui3d, ItemCameraTransforms cameraTransforms) + { + this.builderGeneralQuads = Lists.newArrayList(); + this.builderFaceQuads = Lists.>newArrayListWithCapacity(6); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + this.builderFaceQuads.add(Lists.newArrayList()); + } + + this.builderAmbientOcclusion = ambientOcclusion; + this.builderGui3d = gui3d; + this.builderCameraTransforms = cameraTransforms; + } + + public SimpleBakedModel.Builder addFaceQuad(EnumFacing facing, BakedQuad quad) + { + ((List)this.builderFaceQuads.get(facing.ordinal())).add(quad); + return this; + } + + public SimpleBakedModel.Builder addGeneralQuad(BakedQuad quad) + { + this.builderGeneralQuads.add(quad); + return this; + } + + public SimpleBakedModel.Builder setTexture(TextureAtlasSprite texture) + { + this.builderTexture = texture; + return this; + } + + public IBakedModel makeBakedModel() + { + if (this.builderTexture == null) + { + throw new RuntimeException("Missing particle!"); + } + else + { + return new SimpleBakedModel(this.builderGeneralQuads, this.builderFaceQuads, this.builderAmbientOcclusion, this.builderGui3d, this.builderTexture, this.builderCameraTransforms); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/WeightedBakedModel.java b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/WeightedBakedModel.java new file mode 100644 index 0000000..ae751e4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/resources/model/WeightedBakedModel.java @@ -0,0 +1,120 @@ +package net.minecraft.client.resources.model; + +import com.google.common.collect.ComparisonChain; +import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.List; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandom; + +public class WeightedBakedModel implements IBakedModel +{ + private final int totalWeight; + private final List models; + private final IBakedModel baseModel; + + public WeightedBakedModel(List p_i46073_1_) + { + this.models = p_i46073_1_; + this.totalWeight = WeightedRandom.getTotalWeight(p_i46073_1_); + this.baseModel = ((WeightedBakedModel.MyWeighedRandomItem)p_i46073_1_.get(0)).model; + } + + public List getFaceQuads(EnumFacing facing) + { + return this.baseModel.getFaceQuads(facing); + } + + public List getGeneralQuads() + { + return this.baseModel.getGeneralQuads(); + } + + public boolean isAmbientOcclusion() + { + return this.baseModel.isAmbientOcclusion(); + } + + public boolean isGui3d() + { + return this.baseModel.isGui3d(); + } + + public boolean isBuiltInRenderer() + { + return this.baseModel.isBuiltInRenderer(); + } + + public TextureAtlasSprite getParticleTexture() + { + return this.baseModel.getParticleTexture(); + } + + public ItemCameraTransforms getItemCameraTransforms() + { + return this.baseModel.getItemCameraTransforms(); + } + + public IBakedModel getAlternativeModel(long p_177564_1_) + { + return ((WeightedBakedModel.MyWeighedRandomItem)WeightedRandom.getRandomItem(this.models, Math.abs((int)p_177564_1_ >> 16) % this.totalWeight)).model; + } + + public static class Builder + { + private List listItems = Lists.newArrayList(); + + public WeightedBakedModel.Builder add(IBakedModel p_177677_1_, int p_177677_2_) + { + this.listItems.add(new WeightedBakedModel.MyWeighedRandomItem(p_177677_1_, p_177677_2_)); + return this; + } + + public WeightedBakedModel build() + { + Collections.sort(this.listItems); + return new WeightedBakedModel(this.listItems); + } + + public IBakedModel first() + { + return ((WeightedBakedModel.MyWeighedRandomItem)this.listItems.get(0)).model; + } + } + + static class MyWeighedRandomItem extends WeightedRandom.Item implements Comparable + { + protected final IBakedModel model; + + public MyWeighedRandomItem(IBakedModel p_i46072_1_, int p_i46072_2_) + { + super(p_i46072_2_); + this.model = p_i46072_1_; + } + + public int compareTo(WeightedBakedModel.MyWeighedRandomItem p_compareTo_1_) + { + return ComparisonChain.start().compare(p_compareTo_1_.itemWeight, this.itemWeight).compare(this.getCountQuads(), p_compareTo_1_.getCountQuads()).result(); + } + + protected int getCountQuads() + { + int i = this.model.getGeneralQuads().size(); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + i += this.model.getFaceQuads(enumfacing).size(); + } + + return i; + } + + public String toString() + { + return "MyWeighedRandomItem{weight=" + this.itemWeight + ", model=" + this.model + '}'; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/settings/GameSettings.java b/Client-1.8.9/src/main/java/net/minecraft/client/settings/GameSettings.java new file mode 100644 index 0000000..5b450db --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/settings/GameSettings.java @@ -0,0 +1,2834 @@ +package net.minecraft.client.settings; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.gson.Gson; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.TwitchStream; +import net.minecraft.entity.player.EntityPlayer.EnumChatVisibility; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.optifine.*; +import net.optifine.reflect.Reflector; +import net.optifine.shaders.Shaders; +import net.optifine.util.KeyUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; + +import java.io.*; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class GameSettings { + private static final Logger logger = LogManager.getLogger(); + private static final Gson gson = new Gson(); + + private static final ParameterizedType typeListString = new ParameterizedType() { + public Type[] getActualTypeArguments() { + return new Type[]{String.class}; + } + + public Type getRawType() { + return List.class; + } + + public Type getOwnerType() { + return null; + } + }; + + private static final String[] GUISCALES = new String[]{"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; + private static final String[] PARTICLES = new String[]{"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; + private static final String[] AMBIENT_OCCLUSIONS = new String[]{"options.ao.off", "options.ao.min", "options.ao.max"}; + private static final String[] STREAM_COMPRESSIONS = new String[]{"options.stream.compression.low", "options.stream.compression.medium", "options.stream.compression.high"}; + private static final String[] STREAM_CHAT_MODES = new String[]{"options.stream.chat.enabled.streaming", "options.stream.chat.enabled.always", "options.stream.chat.enabled.never"}; + private static final String[] STREAM_CHAT_FILTER_MODES = new String[]{"options.stream.chat.userFilter.all", "options.stream.chat.userFilter.subs", "options.stream.chat.userFilter.mods"}; + private static final String[] STREAM_MIC_MODES = new String[]{"options.stream.mic_toggle.mute", "options.stream.mic_toggle.talk"}; + private static final String[] CLOUDS_TYPES = new String[]{"options.off", "options.graphics.fast", "options.graphics.fancy"}; + public float mouseSensitivity = 0.5F; + public boolean invertMouse; + public int renderDistanceChunks = -1; + public boolean viewBobbing = true; + public boolean anaglyph; + public boolean fboEnable = true; + public int limitFramerate = 120; + public int clouds = 2; + public boolean fancyGraphics = true; + public int ambientOcclusion = 2; + public List resourcePacks = Lists.newArrayList(); + public List incompatibleResourcePacks = Lists.newArrayList(); + public EnumChatVisibility chatVisibility = EnumChatVisibility.FULL; + public boolean chatColours = true; + public boolean chatLinks = true; + public boolean chatLinksPrompt = true; + public float chatOpacity = 1.0F; + public boolean snooperEnabled = true; + public boolean fullScreen; + public boolean enableVsync = true; + public boolean useVbo = false; + public boolean allowBlockAlternatives = true; + public boolean reducedDebugInfo = false; + public boolean hideServerAddress; + public boolean advancedItemTooltips; + public boolean pauseOnLostFocus = true; + private final Set setModelParts = Sets.newHashSet(EnumPlayerModelParts.values()); + public boolean touchscreen; + public int overrideWidth; + public int overrideHeight; + public boolean heldItemTooltips = true; + public float chatScale = 1.0F; + public float chatWidth = 1.0F; + public float chatHeightUnfocused = 0.44366196F; + public float chatHeightFocused = 1.0F; + public boolean showInventoryAchievementHint = true; + public int mipmapLevels = 4; + private Map mapSoundLevels = Maps.newEnumMap(SoundCategory.class); + public float streamBytesPerPixel = 0.5F; + public float streamMicVolume = 1.0F; + public float streamGameVolume = 1.0F; + public float streamKbps = 0.5412844F; + public float streamFps = 0.31690142F; + public int streamCompression = 1; + public boolean streamSendMetadata = true; + public String streamPreferredServer = ""; + public int streamChatEnabled = 0; + public int streamChatUserFilter = 0; + public int streamMicToggleBehavior = 0; + public boolean useNativeTransport = true; + public boolean entityShadows = true; + public boolean realmsNotifications = true; + public KeyBinding keyBindForward = new KeyBinding("key.forward", 17, "key.categories.movement"); + public KeyBinding keyBindLeft = new KeyBinding("key.left", 30, "key.categories.movement"); + public KeyBinding keyBindBack = new KeyBinding("key.back", 31, "key.categories.movement"); + public KeyBinding keyBindRight = new KeyBinding("key.right", 32, "key.categories.movement"); + public KeyBinding keyBindJump = new KeyBinding("key.jump", 57, "key.categories.movement"); + public KeyBinding keyBindSneak = new KeyBinding("key.sneak", 42, "key.categories.movement"); + public KeyBinding keyBindSprint = new KeyBinding("key.sprint", 29, "key.categories.movement"); + public KeyBinding keyBindInventory = new KeyBinding("key.inventory", 18, "key.categories.inventory"); + public KeyBinding keyBindUseItem = new KeyBinding("key.use", -99, "key.categories.gameplay"); + public KeyBinding keyBindDrop = new KeyBinding("key.drop", 16, "key.categories.gameplay"); + public KeyBinding keyBindAttack = new KeyBinding("key.attack", -100, "key.categories.gameplay"); + public KeyBinding keyBindPickBlock = new KeyBinding("key.pickItem", -98, "key.categories.gameplay"); + public KeyBinding keyBindChat = new KeyBinding("key.chat", 20, "key.categories.multiplayer"); + public KeyBinding keyBindPlayerList = new KeyBinding("key.playerlist", 15, "key.categories.multiplayer"); + public KeyBinding keyBindCommand = new KeyBinding("key.command", 53, "key.categories.multiplayer"); + public KeyBinding keyBindScreenshot = new KeyBinding("key.screenshot", 60, "key.categories.misc"); + public KeyBinding keyBindTogglePerspective = new KeyBinding("key.togglePerspective", 63, "key.categories.misc"); + public KeyBinding keyBindSmoothCamera = new KeyBinding("key.smoothCamera", 0, "key.categories.misc"); + public KeyBinding keyBindFullscreen = new KeyBinding("key.fullscreen", 87, "key.categories.misc"); + public KeyBinding keyBindSpectatorOutlines = new KeyBinding("key.spectatorOutlines", 0, "key.categories.misc"); + public KeyBinding keyBindStreamStartStop = new KeyBinding("key.streamStartStop", 64, "key.categories.stream"); + public KeyBinding keyBindStreamPauseUnpause = new KeyBinding("key.streamPauseUnpause", 65, "key.categories.stream"); + public KeyBinding keyBindStreamCommercials = new KeyBinding("key.streamCommercial", 0, "key.categories.stream"); + public KeyBinding keyBindStreamToggleMic = new KeyBinding("key.streamToggleMic", 0, "key.categories.stream"); + public KeyBinding[] keyBindsHotbar = new KeyBinding[]{new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"), new KeyBinding("key.hotbar.3", 4, "key.categories.inventory"), new KeyBinding("key.hotbar.4", 5, "key.categories.inventory"), new KeyBinding("key.hotbar.5", 6, "key.categories.inventory"), new KeyBinding("key.hotbar.6", 7, "key.categories.inventory"), new KeyBinding("key.hotbar.7", 8, "key.categories.inventory"), new KeyBinding("key.hotbar.8", 9, "key.categories.inventory"), new KeyBinding("key.hotbar.9", 10, "key.categories.inventory")}; + public KeyBinding[] keyBindings; + protected Minecraft mc; + public File optionsFile; + public EnumDifficulty difficulty; + public boolean hideGUI; + public int thirdPersonView; + public boolean showDebugInfo; + public boolean showDebugProfilerChart; + public boolean showLagometer; + public String lastServer; + public boolean smoothCamera; + public boolean debugCamEnable; + public float fovSetting; + public float gammaSetting; + public float oldGammaSetting; + public float saturation; + public int guiScale; + public int particleSetting; + public String language; + public boolean forceUnicodeFont; + public int ofFogType = 1; + public float ofFogStart = 0.8F; + public int ofMipmapType = 0; + public boolean ofOcclusionFancy = false; + public boolean ofSmoothFps = false; + public boolean ofSmoothWorld = Config.isSingleProcessor(); + public boolean ofLazyChunkLoading = Config.isSingleProcessor(); + public boolean ofRenderRegions = false; + public boolean ofSmartAnimations = false; + public float ofAoLevel = 1.0F; + public int ofAaLevel = 0; + public int ofAfLevel = 1; + public int ofClouds = 0; + public float ofCloudsHeight = 0.0F; + public int ofTrees = 0; + public int ofRain = 0; + public int ofDroppedItems = 0; + public int ofBetterGrass = 3; + public int ofAutoSaveTicks = 4000; + public boolean ofLagometer = false; + public boolean ofProfiler = false; + public boolean ofShowFps = false; + public boolean ofWeather = true; + public boolean ofSky = true; + public boolean ofStars = true; + public boolean ofSunMoon = true; + public int ofVignette = 0; + public int ofChunkUpdates = 1; + public boolean ofChunkUpdatesDynamic = false; + public int ofTime = 0; + public boolean ofClearWater = false; + public boolean ofBetterSnow = false; + public String ofFullscreenMode = "Default"; + public boolean ofSwampColors = true; + public boolean ofRandomEntities = true; + public boolean ofSmoothBiomes = true; + public boolean ofCustomFonts = true; + public boolean ofCustomColors = true; + public boolean ofCustomSky = true; + public boolean ofShowCapes = true; + public int ofConnectedTextures = 2; + public boolean ofCustomItems = true; + public boolean ofNaturalTextures = false; + public boolean ofEmissiveTextures = true; + public boolean ofFastMath = false; + public boolean ofFastRender = false; + public int ofTranslucentBlocks = 0; + public boolean ofDynamicFov = true; + public boolean ofAlternateBlocks = true; + public int ofDynamicLights = 3; + public boolean ofCustomEntityModels = true; + public boolean ofCustomGuis = true; + public boolean ofShowGlErrors = true; + public int ofScreenshotSize = 1; + public int ofAnimatedWater = 0; + public int ofAnimatedLava = 0; + public boolean ofAnimatedFire = true; + public boolean ofAnimatedPortal = true; + public boolean ofAnimatedRedstone = true; + public boolean ofAnimatedExplosion = true; + public boolean ofAnimatedFlame = true; + public boolean ofAnimatedSmoke = true; + public boolean ofVoidParticles = true; + public boolean ofWaterParticles = true; + public boolean ofRainSplash = true; + public boolean ofPortalParticles = true; + public boolean ofPotionParticles = true; + public boolean ofFireworkParticles = true; + public boolean ofDrippingWaterLava = true; + public boolean ofAnimatedTerrain = true; + public boolean ofAnimatedTextures = true; + public static final int DEFAULT = 0; + public static final int FAST = 1; + public static final int FANCY = 2; + public static final int OFF = 3; + public static final int SMART = 4; + public static final int ANIM_ON = 0; + public static final int ANIM_GENERATED = 1; + public static final int ANIM_OFF = 2; + public static final String DEFAULT_STR = "Default"; + private static final int[] OF_TREES_VALUES = new int[]{0, 1, 4, 2}; + private static final int[] OF_DYNAMIC_LIGHTS = new int[]{3, 1, 2}; + private static final String[] KEYS_DYNAMIC_LIGHTS = new String[]{"options.off", "options.graphics.fast", "options.graphics.fancy"}; + public KeyBinding ofKeyBindZoom; + public File optionsFileOF; + + public float getGamma() { + return this.gammaSetting; + } + + public GameSettings(Minecraft mcIn, File optionsFileIn) { + this.keyBindings = ArrayUtils.addAll(new KeyBinding[]{this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindSprint, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindStreamStartStop, this.keyBindStreamPauseUnpause, this.keyBindStreamCommercials, this.keyBindStreamToggleMic, this.keyBindFullscreen, this.keyBindSpectatorOutlines}, this.keyBindsHotbar); + this.difficulty = EnumDifficulty.NORMAL; + this.lastServer = ""; + this.fovSetting = 70.0F; + this.language = "en_US"; + this.forceUnicodeFont = false; + this.mc = mcIn; + this.optionsFile = new File(optionsFileIn, "options.txt"); + + if (mcIn.isJava64bit() && Runtime.getRuntime().maxMemory() >= 1000000000L) { + GameSettings.Options.RENDER_DISTANCE.setValueMax(32.0F); + long i = 1000000L; + + if (Runtime.getRuntime().maxMemory() >= 1500L * i) { + GameSettings.Options.RENDER_DISTANCE.setValueMax(48.0F); + } + + if (Runtime.getRuntime().maxMemory() >= 2500L * i) { + GameSettings.Options.RENDER_DISTANCE.setValueMax(64.0F); + } + } else { + GameSettings.Options.RENDER_DISTANCE.setValueMax(16.0F); + } + + this.renderDistanceChunks = mcIn.isJava64bit() ? 12 : 8; + this.optionsFileOF = new File(optionsFileIn, "optionsof.txt"); + this.limitFramerate = (int) GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.ofKeyBindZoom = new KeyBinding("of.key.zoom", 46, "key.categories.misc"); + this.keyBindings = (KeyBinding[]) ((KeyBinding[]) ArrayUtils.add(this.keyBindings, this.ofKeyBindZoom)); + KeyUtils.fixKeyConflicts(this.keyBindings, new KeyBinding[]{this.ofKeyBindZoom}); + this.renderDistanceChunks = 8; + this.loadOptions(); + Config.initGameSettings(this); + } + + public GameSettings() { + this.keyBindings = (KeyBinding[]) ((KeyBinding[]) ArrayUtils.addAll(new KeyBinding[]{this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindSprint, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindStreamStartStop, this.keyBindStreamPauseUnpause, this.keyBindStreamCommercials, this.keyBindStreamToggleMic, this.keyBindFullscreen, this.keyBindSpectatorOutlines}, this.keyBindsHotbar)); + this.difficulty = EnumDifficulty.NORMAL; + this.lastServer = ""; + this.fovSetting = 70.0F; + this.language = "en_US"; + this.forceUnicodeFont = false; + } + + public static String getKeyDisplayString(int key) { + return key < 0 ? I18n.format("key.mouseButton", new Object[]{Integer.valueOf(key + 101)}) : (key < 256 ? Keyboard.getKeyName(key) : String.format("%c", new Object[]{Character.valueOf((char) (key - 256))}).toUpperCase()); + } + + public static boolean isKeyDown(KeyBinding key) { + return key.getKeyCode() == 0 ? false : (key.getKeyCode() < 0 ? Mouse.isButtonDown(key.getKeyCode() + 100) : Keyboard.isKeyDown(key.getKeyCode())); + } + + public void setOptionKeyBinding(KeyBinding key, int keyCode) { + key.setKeyCode(keyCode); + this.saveOptions(); + } + + public void setOptionFloatValue(GameSettings.Options settingsOption, float value) { + this.setOptionFloatValueOF(settingsOption, value); + + if (settingsOption == GameSettings.Options.SENSITIVITY) { + this.mouseSensitivity = value; + } + + if (settingsOption == GameSettings.Options.FOV) { + this.fovSetting = value; + } + + if (settingsOption == GameSettings.Options.GAMMA) { + this.gammaSetting = value; + } + + if (settingsOption == GameSettings.Options.FRAMERATE_LIMIT) { + this.limitFramerate = (int) value; + this.enableVsync = false; + + if (this.limitFramerate <= 0) { + this.limitFramerate = (int) GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.enableVsync = true; + } + + this.updateVSync(); + } + + if (settingsOption == GameSettings.Options.CHAT_OPACITY) { + this.chatOpacity = value; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (settingsOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED) { + this.chatHeightFocused = value; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (settingsOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED) { + this.chatHeightUnfocused = value; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (settingsOption == GameSettings.Options.CHAT_WIDTH) { + this.chatWidth = value; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (settingsOption == GameSettings.Options.CHAT_SCALE) { + this.chatScale = value; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (settingsOption == GameSettings.Options.MIPMAP_LEVELS) { + int i = this.mipmapLevels; + this.mipmapLevels = (int) value; + + if ((float) i != value) { + this.mc.getTextureMapBlocks().setMipmapLevels(this.mipmapLevels); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + this.mc.getTextureMapBlocks().setBlurMipmapDirect(false, this.mipmapLevels > 0); + this.mc.scheduleResourcesRefresh(); + } + } + + if (settingsOption == GameSettings.Options.BLOCK_ALTERNATIVES) { + this.allowBlockAlternatives = !this.allowBlockAlternatives; + this.mc.renderGlobal.loadRenderers(); + } + + if (settingsOption == GameSettings.Options.RENDER_DISTANCE) { + this.renderDistanceChunks = (int) value; + this.mc.renderGlobal.setDisplayListEntitiesDirty(); + } + + if (settingsOption == GameSettings.Options.STREAM_BYTES_PER_PIXEL) { + this.streamBytesPerPixel = value; + } + + if (settingsOption == GameSettings.Options.STREAM_VOLUME_MIC) { + this.streamMicVolume = value; + this.mc.getTwitchStream().updateStreamVolume(); + } + + if (settingsOption == GameSettings.Options.STREAM_VOLUME_SYSTEM) { + this.streamGameVolume = value; + this.mc.getTwitchStream().updateStreamVolume(); + } + + if (settingsOption == GameSettings.Options.STREAM_KBPS) { + this.streamKbps = value; + } + + if (settingsOption == GameSettings.Options.STREAM_FPS) { + this.streamFps = value; + } + } + + public void setOptionValue(GameSettings.Options settingsOption, int value) { + this.setOptionValueOF(settingsOption, value); + + if (settingsOption == GameSettings.Options.INVERT_MOUSE) { + this.invertMouse = !this.invertMouse; + } + + if (settingsOption == GameSettings.Options.GUI_SCALE) { + this.guiScale += value; + + if (GuiScreen.isShiftKeyDown()) { + this.guiScale = 0; + } + + DisplayMode displaymode = Config.getLargestDisplayMode(); + int i = displaymode.getWidth() / 320; + int j = displaymode.getHeight() / 240; + int k = Math.min(i, j); + + if (this.guiScale < 0) { + this.guiScale = k - 1; + } + + if (this.mc.isUnicode() && this.guiScale % 2 != 0) { + this.guiScale += value; + } + + if (this.guiScale < 0 || this.guiScale >= k) { + this.guiScale = 0; + } + } + + if (settingsOption == GameSettings.Options.PARTICLES) { + this.particleSetting = (this.particleSetting + value) % 3; + } + + if (settingsOption == GameSettings.Options.VIEW_BOBBING) { + this.viewBobbing = !this.viewBobbing; + } + + if (settingsOption == GameSettings.Options.RENDER_CLOUDS) { + this.clouds = (this.clouds + value) % 3; + } + + if (settingsOption == GameSettings.Options.FORCE_UNICODE_FONT) { + this.forceUnicodeFont = !this.forceUnicodeFont; + this.mc.fontRendererObj.setUnicodeFlag(this.mc.getLanguageManager().isCurrentLocaleUnicode() || this.forceUnicodeFont); + } + + if (settingsOption == GameSettings.Options.FBO_ENABLE) { + this.fboEnable = !this.fboEnable; + } + + if (settingsOption == GameSettings.Options.ANAGLYPH) { + if (!this.anaglyph && Config.isShaders()) { + Config.showGuiMessage(Lang.get("of.message.an.shaders1"), Lang.get("of.message.an.shaders2")); + return; + } + + this.anaglyph = !this.anaglyph; + this.mc.refreshResources(); + } + + if (settingsOption == GameSettings.Options.GRAPHICS) { + this.fancyGraphics = !this.fancyGraphics; + this.updateRenderClouds(); + this.mc.renderGlobal.loadRenderers(); + } + + if (settingsOption == GameSettings.Options.AMBIENT_OCCLUSION) { + this.ambientOcclusion = (this.ambientOcclusion + value) % 3; + this.mc.renderGlobal.loadRenderers(); + } + + if (settingsOption == GameSettings.Options.CHAT_VISIBILITY) { + this.chatVisibility = EnumChatVisibility.getEnumChatVisibility((this.chatVisibility.getChatVisibility() + value) % 3); + } + + if (settingsOption == GameSettings.Options.STREAM_COMPRESSION) { + this.streamCompression = (this.streamCompression + value) % 3; + } + + if (settingsOption == GameSettings.Options.STREAM_SEND_METADATA) { + this.streamSendMetadata = !this.streamSendMetadata; + } + + if (settingsOption == GameSettings.Options.STREAM_CHAT_ENABLED) { + this.streamChatEnabled = (this.streamChatEnabled + value) % 3; + } + + if (settingsOption == GameSettings.Options.STREAM_CHAT_USER_FILTER) { + this.streamChatUserFilter = (this.streamChatUserFilter + value) % 3; + } + + if (settingsOption == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR) { + this.streamMicToggleBehavior = (this.streamMicToggleBehavior + value) % 2; + } + + if (settingsOption == GameSettings.Options.CHAT_COLOR) { + this.chatColours = !this.chatColours; + } + + if (settingsOption == GameSettings.Options.CHAT_LINKS) { + this.chatLinks = !this.chatLinks; + } + + if (settingsOption == GameSettings.Options.CHAT_LINKS_PROMPT) { + this.chatLinksPrompt = !this.chatLinksPrompt; + } + + if (settingsOption == GameSettings.Options.SNOOPER_ENABLED) { + this.snooperEnabled = !this.snooperEnabled; + } + + if (settingsOption == GameSettings.Options.TOUCHSCREEN) { + this.touchscreen = !this.touchscreen; + } + + if (settingsOption == GameSettings.Options.USE_FULLSCREEN) { + this.fullScreen = !this.fullScreen; + + if (this.mc.isFullScreen() != this.fullScreen) { + this.mc.toggleFullscreen(); + } + } + + if (settingsOption == GameSettings.Options.ENABLE_VSYNC) { + this.enableVsync = !this.enableVsync; + Display.setVSyncEnabled(this.enableVsync); + } + + if (settingsOption == GameSettings.Options.USE_VBO) { + this.useVbo = !this.useVbo; + this.mc.renderGlobal.loadRenderers(); + } + + if (settingsOption == GameSettings.Options.BLOCK_ALTERNATIVES) { + this.allowBlockAlternatives = !this.allowBlockAlternatives; + this.mc.renderGlobal.loadRenderers(); + } + + if (settingsOption == GameSettings.Options.REDUCED_DEBUG_INFO) { + this.reducedDebugInfo = !this.reducedDebugInfo; + } + + if (settingsOption == GameSettings.Options.ENTITY_SHADOWS) { + this.entityShadows = !this.entityShadows; + CheatBreaker.getInstance().getGlobalSettings().entityShadows.setValue(this.entityShadows); + } + + if (settingsOption == GameSettings.Options.REALMS_NOTIFICATIONS) { + this.realmsNotifications = !this.realmsNotifications; + } + + this.saveOptions(); + } + + public float getOptionFloatValue(GameSettings.Options settingOption) { + float f = this.getOptionFloatValueOF(settingOption); + return f != Float.MAX_VALUE ? f : (settingOption == GameSettings.Options.FOV ? this.fovSetting : (settingOption == GameSettings.Options.GAMMA ? this.gammaSetting : (settingOption == GameSettings.Options.SATURATION ? this.saturation : (settingOption == GameSettings.Options.SENSITIVITY ? this.mouseSensitivity : (settingOption == GameSettings.Options.CHAT_OPACITY ? this.chatOpacity : (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (settingOption == GameSettings.Options.CHAT_SCALE ? this.chatScale : (settingOption == GameSettings.Options.CHAT_WIDTH ? this.chatWidth : (settingOption == GameSettings.Options.FRAMERATE_LIMIT ? (float) this.limitFramerate : (settingOption == GameSettings.Options.MIPMAP_LEVELS ? (float) this.mipmapLevels : (settingOption == GameSettings.Options.RENDER_DISTANCE ? (float) this.renderDistanceChunks : (settingOption == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? this.streamBytesPerPixel : (settingOption == GameSettings.Options.STREAM_VOLUME_MIC ? this.streamMicVolume : (settingOption == GameSettings.Options.STREAM_VOLUME_SYSTEM ? this.streamGameVolume : (settingOption == GameSettings.Options.STREAM_KBPS ? this.streamKbps : (settingOption == GameSettings.Options.STREAM_FPS ? this.streamFps : 0.0F))))))))))))))))); + } + + public boolean getOptionOrdinalValue(GameSettings.Options settingOption) { + switch (settingOption) { + case INVERT_MOUSE: + return this.invertMouse; + + case VIEW_BOBBING: + return this.viewBobbing; + + case ANAGLYPH: + return this.anaglyph; + + case FBO_ENABLE: + return this.fboEnable; + + case CHAT_COLOR: + return this.chatColours; + + case CHAT_LINKS: + return this.chatLinks; + + case CHAT_LINKS_PROMPT: + return this.chatLinksPrompt; + + case SNOOPER_ENABLED: + return this.snooperEnabled; + + case USE_FULLSCREEN: + return this.fullScreen; + + case ENABLE_VSYNC: + return this.enableVsync; + + case USE_VBO: + return this.useVbo; + + case TOUCHSCREEN: + return this.touchscreen; + + case STREAM_SEND_METADATA: + return this.streamSendMetadata; + + case FORCE_UNICODE_FONT: + return this.forceUnicodeFont; + + case BLOCK_ALTERNATIVES: + return this.allowBlockAlternatives; + + case REDUCED_DEBUG_INFO: + return this.reducedDebugInfo; + + case ENTITY_SHADOWS: + return this.entityShadows; + + case REALMS_NOTIFICATIONS: + return this.realmsNotifications; + + default: + return false; + } + } + + private static String getTranslation(String[] strArray, int index) { + if (index < 0 || index >= strArray.length) { + index = 0; + } + + return I18n.format(strArray[index], new Object[0]); + } + + public String getKeyBinding(GameSettings.Options settingOption) { + String s = this.getKeyBindingOF(settingOption); + + if (s != null) { + return s; + } else { + String s1 = I18n.format(settingOption.getEnumString(), new Object[0]) + ": "; + + if (settingOption.getEnumFloat()) { + float f1 = this.getOptionFloatValue(settingOption); + float f = settingOption.normalizeValue(f1); + return settingOption == GameSettings.Options.MIPMAP_LEVELS && (double) f1 >= 4.0D ? s1 + Lang.get("of.general.max") : (settingOption == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s1 + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.sensitivity.max", new Object[0]) : s1 + (int) (f * 200.0F) + "%")) : (settingOption == GameSettings.Options.FOV ? (f1 == 70.0F ? s1 + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s1 + I18n.format("options.fov.max", new Object[0]) : s1 + (int) f1)) : (settingOption == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == settingOption.valueMax ? s1 + I18n.format("options.framerateLimit.max", new Object[0]) : s1 + (int) f1 + " fps") : (settingOption == GameSettings.Options.RENDER_CLOUDS ? (f1 == settingOption.valueMin ? s1 + I18n.format("options.cloudHeight.min", new Object[0]) : s1 + ((int) f1 + 128)) : (settingOption == GameSettings.Options.GAMMA ? (f == 0.0F ? s1 + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s1 + I18n.format("options.gamma.max", new Object[0]) : s1 + "+" + (int) (f * 100.0F) + "%")) : (settingOption == GameSettings.Options.SATURATION ? s1 + (int) (f * 400.0F) + "%" : (settingOption == GameSettings.Options.CHAT_OPACITY ? s1 + (int) (f * 90.0F + 10.0F) + "%" : (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s1 + GuiNewChat.calculateChatboxHeight(f) + "px" : (settingOption == GameSettings.Options.CHAT_WIDTH ? s1 + GuiNewChat.calculateChatboxWidth(f) + "px" : (settingOption == GameSettings.Options.RENDER_DISTANCE ? s1 + (int) f1 + " chunks" : (settingOption == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int) f1) : (settingOption == GameSettings.Options.STREAM_FPS ? s1 + TwitchStream.formatStreamFps(f) + " fps" : (settingOption == GameSettings.Options.STREAM_KBPS ? s1 + TwitchStream.formatStreamKbps(f) + " Kbps" : (settingOption == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? s1 + String.format("%.3f bpp", new Object[]{Float.valueOf(TwitchStream.formatStreamBps(f))}) : (f == 0.0F ? s1 + I18n.format("options.off", new Object[0]) : s1 + (int) (f * 100.0F) + "%")))))))))))))))); + } else if (settingOption.getEnumBoolean()) { + boolean flag = this.getOptionOrdinalValue(settingOption); + return flag ? s1 + I18n.format("options.on", new Object[0]) : s1 + I18n.format("options.off", new Object[0]); + } else if (settingOption == GameSettings.Options.GUI_SCALE) { + return this.guiScale >= GUISCALES.length ? s1 + this.guiScale + "x" : s1 + getTranslation(GUISCALES, this.guiScale); + } else if (settingOption == GameSettings.Options.CHAT_VISIBILITY) { + return s1 + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]); + } else if (settingOption == GameSettings.Options.PARTICLES) { + return s1 + getTranslation(PARTICLES, this.particleSetting); + } else if (settingOption == GameSettings.Options.AMBIENT_OCCLUSION) { + return s1 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); + } else if (settingOption == GameSettings.Options.STREAM_COMPRESSION) { + return s1 + getTranslation(STREAM_COMPRESSIONS, this.streamCompression); + } else if (settingOption == GameSettings.Options.STREAM_CHAT_ENABLED) { + return s1 + getTranslation(STREAM_CHAT_MODES, this.streamChatEnabled); + } else if (settingOption == GameSettings.Options.STREAM_CHAT_USER_FILTER) { + return s1 + getTranslation(STREAM_CHAT_FILTER_MODES, this.streamChatUserFilter); + } else if (settingOption == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR) { + return s1 + getTranslation(STREAM_MIC_MODES, this.streamMicToggleBehavior); + } else if (settingOption == GameSettings.Options.RENDER_CLOUDS) { + return s1 + getTranslation(CLOUDS_TYPES, this.clouds); + } else if (settingOption == GameSettings.Options.GRAPHICS) { + if (this.fancyGraphics) { + return s1 + I18n.format("options.graphics.fancy", new Object[0]); + } else { + String s2 = "options.graphics.fast"; + return s1 + I18n.format("options.graphics.fast", new Object[0]); + } + } else { + return s1; + } + } + } + + public void loadOptions() { + FileInputStream fileinputstream = null; + label2: + { + try { + if (this.optionsFile.exists()) { + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(fileinputstream = new FileInputStream(this.optionsFile))); + String s; + this.mapSoundLevels.clear(); + + while ((s = bufferedreader.readLine()) != null) { + try { + String[] astring = s.split(":"); + + if (astring[0].equals("mouseSensitivity")) { + this.mouseSensitivity = this.parseFloat(astring[1]); + } + + if (astring[0].equals("fov")) { + this.fovSetting = this.parseFloat(astring[1]) * 40.0F + 70.0F; + } + + if (astring[0].equalsIgnoreCase("oldGamma")) { + this.oldGammaSetting = this.parseFloat(astring[1]); + } + + if (astring[0].equals("gamma")) { + this.gammaSetting = this.parseFloat(astring[1]); + } + + if (astring[0].equals("saturation")) { + this.saturation = this.parseFloat(astring[1]); + } + + if (astring[0].equals("invertYMouse")) { + this.invertMouse = astring[1].equals("true"); + } + + if (astring[0].equals("renderDistance")) { + this.renderDistanceChunks = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("guiScale")) { + this.guiScale = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("particles")) { + this.particleSetting = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("bobView")) { + this.viewBobbing = astring[1].equals("true"); + } + + if (astring[0].equals("anaglyph3d")) { + this.anaglyph = astring[1].equals("true"); + } + + if (astring[0].equals("maxFps")) { + this.limitFramerate = Integer.parseInt(astring[1]); + + if (this.enableVsync) { + this.limitFramerate = (int) GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + } + + if (this.limitFramerate <= 0) { + this.limitFramerate = (int) GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + } + } + + if (astring[0].equals("fboEnable")) { + this.fboEnable = astring[1].equals("true"); + } + + if (astring[0].equals("difficulty")) { + this.difficulty = EnumDifficulty.getDifficultyEnum(Integer.parseInt(astring[1])); + } + + if (astring[0].equals("fancyGraphics")) { + this.fancyGraphics = astring[1].equals("true"); + this.updateRenderClouds(); + } + + if (astring[0].equals("ao")) { + if (astring[1].equals("true")) { + this.ambientOcclusion = 2; + } else if (astring[1].equals("false")) { + this.ambientOcclusion = 0; + } else { + this.ambientOcclusion = Integer.parseInt(astring[1]); + } + } + + if (astring[0].equals("renderClouds")) { + switch (astring[1]) { + case "true": + this.clouds = 2; + break; + case "false": + this.clouds = 0; + break; + case "fast": + this.clouds = 1; + break; + } + } + + if (astring[0].equals("resourcePacks")) { + this.resourcePacks = gson.fromJson(s.substring(s.indexOf(58) + 1), typeListString); + + if (this.resourcePacks == null) { + this.resourcePacks = Lists.newArrayList(); + } + } + + if (astring[0].equals("incompatibleResourcePacks")) { + this.incompatibleResourcePacks = gson.fromJson(s.substring(s.indexOf(58) + 1), typeListString); + + if (this.incompatibleResourcePacks == null) { + this.incompatibleResourcePacks = Lists.newArrayList(); + } + } + + if (astring[0].equals("lastServer") && astring.length >= 2) { + this.lastServer = s.substring(s.indexOf(58) + 1); + } + + if (astring[0].equals("lang") && astring.length >= 2) { + this.language = astring[1]; + } + + if (astring[0].equals("chatVisibility")) { + this.chatVisibility = EnumChatVisibility.getEnumChatVisibility(Integer.parseInt(astring[1])); + } + + if (astring[0].equals("chatColors")) { + this.chatColours = astring[1].equals("true"); + } + + if (astring[0].equals("chatLinks")) { + this.chatLinks = astring[1].equals("true"); + } + + if (astring[0].equals("chatLinksPrompt")) { + this.chatLinksPrompt = astring[1].equals("true"); + } + + if (astring[0].equals("chatOpacity")) { + this.chatOpacity = this.parseFloat(astring[1]); + } + + if (astring[0].equals("snooperEnabled")) { + this.snooperEnabled = astring[1].equals("true"); + } + + if (astring[0].equals("fullscreen")) { + this.fullScreen = astring[1].equals("true"); + } + + if (astring[0].equals("enableVsync")) { + this.enableVsync = astring[1].equals("true"); + + if (this.enableVsync) { + this.limitFramerate = (int) GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + } + + this.updateVSync(); + } + + if (astring[0].equals("useVbo")) { + this.useVbo = astring[1].equals("true"); + } + + if (astring[0].equals("hideServerAddress")) { + this.hideServerAddress = astring[1].equals("true"); + } + + if (astring[0].equals("advancedItemTooltips")) { + this.advancedItemTooltips = astring[1].equals("true"); + } + + if (astring[0].equals("pauseOnLostFocus")) { + this.pauseOnLostFocus = astring[1].equals("true"); + } + + if (astring[0].equals("touchscreen")) { + this.touchscreen = astring[1].equals("true"); + } + + if (astring[0].equals("overrideHeight")) { + this.overrideHeight = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("overrideWidth")) { + this.overrideWidth = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("heldItemTooltips")) { + this.heldItemTooltips = astring[1].equals("true"); + } + + if (astring[0].equals("chatHeightFocused")) { + this.chatHeightFocused = this.parseFloat(astring[1]); + } + + if (astring[0].equals("chatHeightUnfocused")) { + this.chatHeightUnfocused = this.parseFloat(astring[1]); + } + + if (astring[0].equals("chatScale")) { + this.chatScale = this.parseFloat(astring[1]); + } + + if (astring[0].equals("chatWidth")) { + this.chatWidth = this.parseFloat(astring[1]); + } + + if (astring[0].equals("showInventoryAchievementHint")) { + this.showInventoryAchievementHint = astring[1].equals("true"); + } + + if (astring[0].equals("mipmapLevels")) { + this.mipmapLevels = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamBytesPerPixel")) { + this.streamBytesPerPixel = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamMicVolume")) { + this.streamMicVolume = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamSystemVolume")) { + this.streamGameVolume = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamKbps")) { + this.streamKbps = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamFps")) { + this.streamFps = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamCompression")) { + this.streamCompression = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamSendMetadata")) { + this.streamSendMetadata = astring[1].equals("true"); + } + + if (astring[0].equals("streamPreferredServer") && astring.length >= 2) { + this.streamPreferredServer = s.substring(s.indexOf(58) + 1); + } + + if (astring[0].equals("streamChatEnabled")) { + this.streamChatEnabled = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamChatUserFilter")) { + this.streamChatUserFilter = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamMicToggleBehavior")) { + this.streamMicToggleBehavior = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("forceUnicodeFont")) { + this.forceUnicodeFont = astring[1].equals("true"); + } + + if (astring[0].equals("allowBlockAlternatives")) { + this.allowBlockAlternatives = astring[1].equals("true"); + } + + if (astring[0].equals("reducedDebugInfo")) { + this.reducedDebugInfo = astring[1].equals("true"); + } + + if (astring[0].equals("useNativeTransport")) { + this.useNativeTransport = astring[1].equals("true"); + } + + if (astring[0].equals("entityShadows")) { + this.entityShadows = astring[1].equals("true"); + } + + if (astring[0].equals("realmsNotifications")) { + this.realmsNotifications = astring[1].equals("true"); + } + + for (KeyBinding keybinding : this.keyBindings) { + if (astring[0].equals("key_" + keybinding.getKeyDescription())) { + keybinding.setKeyCode(Integer.parseInt(astring[1])); + } + } + + for (SoundCategory soundcategory : SoundCategory.values()) { + if (astring[0].equals("soundCategory_" + soundcategory.getCategoryName())) { + this.mapSoundLevels.put(soundcategory, Float.valueOf(this.parseFloat(astring[1]))); + } + } + + for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) { + if (astring[0].equals("modelPart_" + enumplayermodelparts.getPartName())) { + this.setModelPartEnabled(enumplayermodelparts, astring[1].equals("true")); + } + } + + } catch (Exception exception) { + logger.warn("Skipping bad option: " + s); + exception.printStackTrace(); + } + } + + KeyBinding.resetKeyBindingArrayAndHash(); + bufferedreader.close(); + break label2; + } + } catch (Exception exception1) { + logger.error("Failed to load options", exception1); + break label2; + } finally { + IOUtils.closeQuietly(fileinputstream); + } + + return; + } + this.loadOfOptions(); + } + + private float parseFloat(String str) { + return str.equals("true") ? 1.0F : (str.equals("false") ? 0.0F : Float.parseFloat(str)); + } + + public void saveOptions() { + if (Reflector.FMLClientHandler.exists()) { + Object object = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); + + if (object != null && Reflector.callBoolean(object, Reflector.FMLClientHandler_isLoading, new Object[0])) { + return; + } + } + + try { + PrintWriter printwriter = new PrintWriter(new FileWriter(this.optionsFile)); + printwriter.println("invertYMouse:" + this.invertMouse); + printwriter.println("mouseSensitivity:" + this.mouseSensitivity); + printwriter.println("fov:" + (this.fovSetting - 70.0F) / 40.0F); + printwriter.println("gamma:" + this.gammaSetting); + + if (!CheatBreaker.getInstance().getGlobalSettings().fullBright.getBooleanValue()) { + printwriter.println("oldGamma:" + this.oldGammaSetting); + } + + printwriter.println("saturation:" + this.saturation); + printwriter.println("renderDistance:" + this.renderDistanceChunks); + printwriter.println("guiScale:" + this.guiScale); + printwriter.println("particles:" + this.particleSetting); + printwriter.println("bobView:" + this.viewBobbing); + printwriter.println("anaglyph3d:" + this.anaglyph); + printwriter.println("maxFps:" + this.limitFramerate); + printwriter.println("fboEnable:" + this.fboEnable); + printwriter.println("difficulty:" + this.difficulty.getDifficultyId()); + printwriter.println("fancyGraphics:" + this.fancyGraphics); + printwriter.println("ao:" + this.ambientOcclusion); + + switch (this.clouds) { + case 0: + printwriter.println("renderClouds:false"); + break; + + case 1: + printwriter.println("renderClouds:fast"); + break; + + case 2: + printwriter.println("renderClouds:true"); + } + + printwriter.println("resourcePacks:" + gson.toJson((Object) this.resourcePacks)); + printwriter.println("incompatibleResourcePacks:" + gson.toJson((Object) this.incompatibleResourcePacks)); + printwriter.println("lastServer:" + this.lastServer); + printwriter.println("lang:" + this.language); + printwriter.println("chatVisibility:" + this.chatVisibility.getChatVisibility()); + printwriter.println("chatColors:" + this.chatColours); + printwriter.println("chatLinks:" + this.chatLinks); + printwriter.println("chatLinksPrompt:" + this.chatLinksPrompt); + printwriter.println("chatOpacity:" + this.chatOpacity); + printwriter.println("snooperEnabled:" + this.snooperEnabled); + printwriter.println("fullscreen:" + this.fullScreen); + printwriter.println("enableVsync:" + this.enableVsync); + printwriter.println("useVbo:" + this.useVbo); + printwriter.println("hideServerAddress:" + this.hideServerAddress); + printwriter.println("advancedItemTooltips:" + this.advancedItemTooltips); + printwriter.println("pauseOnLostFocus:" + this.pauseOnLostFocus); + printwriter.println("touchscreen:" + this.touchscreen); + printwriter.println("overrideWidth:" + this.overrideWidth); + printwriter.println("overrideHeight:" + this.overrideHeight); + printwriter.println("heldItemTooltips:" + this.heldItemTooltips); + printwriter.println("chatHeightFocused:" + this.chatHeightFocused); + printwriter.println("chatHeightUnfocused:" + this.chatHeightUnfocused); + printwriter.println("chatScale:" + this.chatScale); + printwriter.println("chatWidth:" + this.chatWidth); + printwriter.println("showInventoryAchievementHint:" + this.showInventoryAchievementHint); + printwriter.println("mipmapLevels:" + this.mipmapLevels); + printwriter.println("streamBytesPerPixel:" + this.streamBytesPerPixel); + printwriter.println("streamMicVolume:" + this.streamMicVolume); + printwriter.println("streamSystemVolume:" + this.streamGameVolume); + printwriter.println("streamKbps:" + this.streamKbps); + printwriter.println("streamFps:" + this.streamFps); + printwriter.println("streamCompression:" + this.streamCompression); + printwriter.println("streamSendMetadata:" + this.streamSendMetadata); + printwriter.println("streamPreferredServer:" + this.streamPreferredServer); + printwriter.println("streamChatEnabled:" + this.streamChatEnabled); + printwriter.println("streamChatUserFilter:" + this.streamChatUserFilter); + printwriter.println("streamMicToggleBehavior:" + this.streamMicToggleBehavior); + printwriter.println("forceUnicodeFont:" + this.forceUnicodeFont); + printwriter.println("allowBlockAlternatives:" + this.allowBlockAlternatives); + printwriter.println("reducedDebugInfo:" + this.reducedDebugInfo); + printwriter.println("useNativeTransport:" + this.useNativeTransport); + printwriter.println("entityShadows:" + this.entityShadows); + printwriter.println("realmsNotifications:" + this.realmsNotifications); + + for (KeyBinding keybinding : this.keyBindings) { + printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode()); + } + + for (SoundCategory soundcategory : SoundCategory.values()) { + printwriter.println("soundCategory_" + soundcategory.getCategoryName() + ":" + this.getSoundLevel(soundcategory)); + } + + for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) { + printwriter.println("modelPart_" + enumplayermodelparts.getPartName() + ":" + this.setModelParts.contains(enumplayermodelparts)); + } + + printwriter.close(); + } catch (Exception exception) { + logger.error("Failed to save options", exception); + } + + this.saveOfOptions(); + this.sendSettingsToServer(); + } + + public float getSoundLevel(SoundCategory sndCategory) { + return this.mapSoundLevels.containsKey(sndCategory) ? ((Float) this.mapSoundLevels.get(sndCategory)).floatValue() : 1.0F; + } + + public void setSoundLevel(SoundCategory sndCategory, float soundLevel) { + this.mc.getSoundHandler().setSoundLevel(sndCategory, soundLevel); + this.mapSoundLevels.put(sndCategory, Float.valueOf(soundLevel)); + } + + public void sendSettingsToServer() { + if (this.mc.thePlayer != null) { + int i = 0; + + for (EnumPlayerModelParts enumplayermodelparts : this.setModelParts) { + i |= enumplayermodelparts.getPartMask(); + } + + this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language, this.renderDistanceChunks, this.chatVisibility, this.chatColours, i)); + } + } + + public Set getModelParts() { + return ImmutableSet.copyOf(this.setModelParts); + } + + public void setModelPartEnabled(EnumPlayerModelParts modelPart, boolean enable) { + if (enable) { + this.setModelParts.add(modelPart); + } else { + this.setModelParts.remove(modelPart); + } + + this.sendSettingsToServer(); + } + + public void switchModelPartEnabled(EnumPlayerModelParts modelPart) { + if (!this.getModelParts().contains(modelPart)) { + this.setModelParts.add(modelPart); + } else { + this.setModelParts.remove(modelPart); + } + + this.sendSettingsToServer(); + } + + public int shouldRenderClouds() { + return this.renderDistanceChunks >= 4 ? this.clouds : 0; + } + + public boolean isUsingNativeTransport() { + return this.useNativeTransport; + } + + private void setOptionFloatValueOF(GameSettings.Options p_setOptionFloatValueOF_1_, float p_setOptionFloatValueOF_2_) { + if (p_setOptionFloatValueOF_1_ == GameSettings.Options.CLOUD_HEIGHT) { + this.ofCloudsHeight = p_setOptionFloatValueOF_2_; + this.mc.renderGlobal.resetClouds(); + } + + if (p_setOptionFloatValueOF_1_ == GameSettings.Options.AO_LEVEL) { + this.ofAoLevel = p_setOptionFloatValueOF_2_; + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionFloatValueOF_1_ == GameSettings.Options.AA_LEVEL) { + int i = (int) p_setOptionFloatValueOF_2_; + + if (i > 0 && Config.isShaders()) { + Config.showGuiMessage(Lang.get("of.message.aa.shaders1"), Lang.get("of.message.aa.shaders2")); + return; + } + + int[] aint = new int[]{0, 2, 4, 6, 8, 12, 16}; + this.ofAaLevel = 0; + + for (int j = 0; j < aint.length; ++j) { + if (i >= aint[j]) { + this.ofAaLevel = aint[j]; + } + } + + this.ofAaLevel = Config.limit(this.ofAaLevel, 0, 16); + } + + if (p_setOptionFloatValueOF_1_ == GameSettings.Options.AF_LEVEL) { + int k = (int) p_setOptionFloatValueOF_2_; + + if (k > 1 && Config.isShaders()) { + Config.showGuiMessage(Lang.get("of.message.af.shaders1"), Lang.get("of.message.af.shaders2")); + return; + } + + for (this.ofAfLevel = 1; this.ofAfLevel * 2 <= k; this.ofAfLevel *= 2) { + ; + } + + this.ofAfLevel = Config.limit(this.ofAfLevel, 1, 16); + this.mc.refreshResources(); + } + + if (p_setOptionFloatValueOF_1_ == GameSettings.Options.MIPMAP_TYPE) { + int l = (int) p_setOptionFloatValueOF_2_; + this.ofMipmapType = Config.limit(l, 0, 3); + this.mc.refreshResources(); + } + + if (p_setOptionFloatValueOF_1_ == GameSettings.Options.FULLSCREEN_MODE) { + int i1 = (int) p_setOptionFloatValueOF_2_ - 1; + String[] astring = Config.getDisplayModeNames(); + + if (i1 < 0 || i1 >= astring.length) { + this.ofFullscreenMode = "Default"; + return; + } + + this.ofFullscreenMode = astring[i1]; + } + } + + private float getOptionFloatValueOF(GameSettings.Options p_getOptionFloatValueOF_1_) { + if (p_getOptionFloatValueOF_1_ == GameSettings.Options.CLOUD_HEIGHT) { + return this.ofCloudsHeight; + } else if (p_getOptionFloatValueOF_1_ == GameSettings.Options.AO_LEVEL) { + return this.ofAoLevel; + } else if (p_getOptionFloatValueOF_1_ == GameSettings.Options.AA_LEVEL) { + return (float) this.ofAaLevel; + } else if (p_getOptionFloatValueOF_1_ == GameSettings.Options.AF_LEVEL) { + return (float) this.ofAfLevel; + } else if (p_getOptionFloatValueOF_1_ == GameSettings.Options.MIPMAP_TYPE) { + return (float) this.ofMipmapType; + } else if (p_getOptionFloatValueOF_1_ == GameSettings.Options.FRAMERATE_LIMIT) { + return (float) this.limitFramerate == GameSettings.Options.FRAMERATE_LIMIT.getValueMax() && this.enableVsync ? 0.0F : (float) this.limitFramerate; + } else if (p_getOptionFloatValueOF_1_ == GameSettings.Options.FULLSCREEN_MODE) { + if (this.ofFullscreenMode.equals("Default")) { + return 0.0F; + } else { + List list = Arrays.asList(Config.getDisplayModeNames()); + int i = list.indexOf(this.ofFullscreenMode); + return i < 0 ? 0.0F : (float) (i + 1); + } + } else { + return Float.MAX_VALUE; + } + } + + private void setOptionValueOF(GameSettings.Options p_setOptionValueOF_1_, int p_setOptionValueOF_2_) { + if (p_setOptionValueOF_1_ == GameSettings.Options.FOG_FANCY) { + switch (this.ofFogType) { + case 1: + this.ofFogType = 2; + + if (!Config.isFancyFogAvailable()) { + this.ofFogType = 3; + } + + break; + + case 2: + this.ofFogType = 3; + break; + + case 3: + this.ofFogType = 1; + break; + + default: + this.ofFogType = 1; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.FOG_START) { + this.ofFogStart += 0.2F; + + if (this.ofFogStart > 0.81F) { + this.ofFogStart = 0.2F; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SMOOTH_FPS) { + this.ofSmoothFps = !this.ofSmoothFps; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SMOOTH_WORLD) { + this.ofSmoothWorld = !this.ofSmoothWorld; + Config.updateThreadPriorities(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CLOUDS) { + ++this.ofClouds; + + if (this.ofClouds > 3) { + this.ofClouds = 0; + } + + this.updateRenderClouds(); + this.mc.renderGlobal.resetClouds(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.TREES) { + this.ofTrees = nextValue(this.ofTrees, OF_TREES_VALUES); + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.DROPPED_ITEMS) { + ++this.ofDroppedItems; + + if (this.ofDroppedItems > 2) { + this.ofDroppedItems = 0; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.RAIN) { + ++this.ofRain; + + if (this.ofRain > 3) { + this.ofRain = 0; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_WATER) { + ++this.ofAnimatedWater; + + if (this.ofAnimatedWater == 1) { + ++this.ofAnimatedWater; + } + + if (this.ofAnimatedWater > 2) { + this.ofAnimatedWater = 0; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_LAVA) { + ++this.ofAnimatedLava; + + if (this.ofAnimatedLava == 1) { + ++this.ofAnimatedLava; + } + + if (this.ofAnimatedLava > 2) { + this.ofAnimatedLava = 0; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_FIRE) { + this.ofAnimatedFire = !this.ofAnimatedFire; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_PORTAL) { + this.ofAnimatedPortal = !this.ofAnimatedPortal; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_REDSTONE) { + this.ofAnimatedRedstone = !this.ofAnimatedRedstone; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_EXPLOSION) { + this.ofAnimatedExplosion = !this.ofAnimatedExplosion; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_FLAME) { + this.ofAnimatedFlame = !this.ofAnimatedFlame; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_SMOKE) { + this.ofAnimatedSmoke = !this.ofAnimatedSmoke; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.VOID_PARTICLES) { + this.ofVoidParticles = !this.ofVoidParticles; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.WATER_PARTICLES) { + this.ofWaterParticles = !this.ofWaterParticles; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.PORTAL_PARTICLES) { + this.ofPortalParticles = !this.ofPortalParticles; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.POTION_PARTICLES) { + this.ofPotionParticles = !this.ofPotionParticles; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.FIREWORK_PARTICLES) { + this.ofFireworkParticles = !this.ofFireworkParticles; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.DRIPPING_WATER_LAVA) { + this.ofDrippingWaterLava = !this.ofDrippingWaterLava; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_TERRAIN) { + this.ofAnimatedTerrain = !this.ofAnimatedTerrain; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ANIMATED_TEXTURES) { + this.ofAnimatedTextures = !this.ofAnimatedTextures; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.RAIN_SPLASH) { + this.ofRainSplash = !this.ofRainSplash; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.LAGOMETER) { + this.ofLagometer = !this.ofLagometer; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SHOW_FPS) { + this.ofShowFps = !this.ofShowFps; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.AUTOSAVE_TICKS) { + int i = 900; + this.ofAutoSaveTicks = Math.max(this.ofAutoSaveTicks / i * i, i); + this.ofAutoSaveTicks *= 2; + + if (this.ofAutoSaveTicks > 32 * i) { + this.ofAutoSaveTicks = i; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.BETTER_GRASS) { + ++this.ofBetterGrass; + + if (this.ofBetterGrass > 3) { + this.ofBetterGrass = 1; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CONNECTED_TEXTURES) { + ++this.ofConnectedTextures; + + if (this.ofConnectedTextures > 3) { + this.ofConnectedTextures = 1; + } + + if (this.ofConnectedTextures == 2) { + this.mc.renderGlobal.loadRenderers(); + } else { + this.mc.refreshResources(); + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.WEATHER) { + this.ofWeather = !this.ofWeather; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SKY) { + this.ofSky = !this.ofSky; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.STARS) { + this.ofStars = !this.ofStars; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SUN_MOON) { + this.ofSunMoon = !this.ofSunMoon; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.VIGNETTE) { + ++this.ofVignette; + + if (this.ofVignette > 2) { + this.ofVignette = 0; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CHUNK_UPDATES) { + ++this.ofChunkUpdates; + + if (this.ofChunkUpdates > 5) { + this.ofChunkUpdates = 1; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CHUNK_UPDATES_DYNAMIC) { + this.ofChunkUpdatesDynamic = !this.ofChunkUpdatesDynamic; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.TIME) { + ++this.ofTime; + + if (this.ofTime > 2) { + this.ofTime = 0; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CLEAR_WATER) { + this.ofClearWater = !this.ofClearWater; + this.updateWaterOpacity(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.PROFILER) { + this.ofProfiler = !this.ofProfiler; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.BETTER_SNOW) { + this.ofBetterSnow = !this.ofBetterSnow; + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SWAMP_COLORS) { + this.ofSwampColors = !this.ofSwampColors; + CustomColors.updateUseDefaultGrassFoliageColors(); + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.RANDOM_ENTITIES) { + this.ofRandomEntities = !this.ofRandomEntities; + RandomEntities.update(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SMOOTH_BIOMES) { + this.ofSmoothBiomes = !this.ofSmoothBiomes; + CustomColors.updateUseDefaultGrassFoliageColors(); + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CUSTOM_FONTS) { + this.ofCustomFonts = !this.ofCustomFonts; + this.mc.fontRendererObj.onResourceManagerReload(Config.getResourceManager()); + this.mc.standardGalacticFontRenderer.onResourceManagerReload(Config.getResourceManager()); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CUSTOM_COLORS) { + this.ofCustomColors = !this.ofCustomColors; + CustomColors.update(); + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CUSTOM_ITEMS) { + this.ofCustomItems = !this.ofCustomItems; + this.mc.refreshResources(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CUSTOM_SKY) { + this.ofCustomSky = !this.ofCustomSky; + CustomSky.update(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SHOW_CAPES) { + this.ofShowCapes = !this.ofShowCapes; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.NATURAL_TEXTURES) { + this.ofNaturalTextures = !this.ofNaturalTextures; + NaturalTextures.update(); + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.EMISSIVE_TEXTURES) { + this.ofEmissiveTextures = !this.ofEmissiveTextures; + this.mc.refreshResources(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.FAST_MATH) { + this.ofFastMath = !this.ofFastMath; + MathHelper.fastMath = this.ofFastMath; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.FAST_RENDER) { + if (!this.ofFastRender && Config.isShaders()) { + Config.showGuiMessage(Lang.get("of.message.fr.shaders1"), Lang.get("of.message.fr.shaders2")); + return; + } + + this.ofFastRender = !this.ofFastRender; + + if (this.ofFastRender) { + this.mc.entityRenderer.stopUseShader(); + } + + Config.updateFramebufferSize(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.TRANSLUCENT_BLOCKS) { + if (this.ofTranslucentBlocks == 0) { + this.ofTranslucentBlocks = 1; + } else if (this.ofTranslucentBlocks == 1) { + this.ofTranslucentBlocks = 2; + } else if (this.ofTranslucentBlocks == 2) { + this.ofTranslucentBlocks = 0; + } else { + this.ofTranslucentBlocks = 0; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.LAZY_CHUNK_LOADING) { + this.ofLazyChunkLoading = !this.ofLazyChunkLoading; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.RENDER_REGIONS) { + this.ofRenderRegions = !this.ofRenderRegions; + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SMART_ANIMATIONS) { + this.ofSmartAnimations = !this.ofSmartAnimations; + this.mc.renderGlobal.loadRenderers(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.DYNAMIC_FOV) { + this.ofDynamicFov = !this.ofDynamicFov; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ALTERNATE_BLOCKS) { + this.ofAlternateBlocks = !this.ofAlternateBlocks; + this.mc.refreshResources(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.DYNAMIC_LIGHTS) { + this.ofDynamicLights = nextValue(this.ofDynamicLights, OF_DYNAMIC_LIGHTS); + DynamicLights.removeLights(this.mc.renderGlobal); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SCREENSHOT_SIZE) { + ++this.ofScreenshotSize; + + if (this.ofScreenshotSize > 4) { + this.ofScreenshotSize = 1; + } + + if (!OpenGlHelper.isFramebufferEnabled()) { + this.ofScreenshotSize = 1; + } + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CUSTOM_ENTITY_MODELS) { + this.ofCustomEntityModels = !this.ofCustomEntityModels; + this.mc.refreshResources(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.CUSTOM_GUIS) { + this.ofCustomGuis = !this.ofCustomGuis; + CustomGuis.update(); + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.SHOW_GL_ERRORS) { + this.ofShowGlErrors = !this.ofShowGlErrors; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.HELD_ITEM_TOOLTIPS) { + this.heldItemTooltips = !this.heldItemTooltips; + } + + if (p_setOptionValueOF_1_ == GameSettings.Options.ADVANCED_TOOLTIPS) { + this.advancedItemTooltips = !this.advancedItemTooltips; + } + } + + private String getKeyBindingOF(GameSettings.Options p_getKeyBindingOF_1_) { + String s = I18n.format(p_getKeyBindingOF_1_.getEnumString(), new Object[0]) + ": "; + + if (s == null) { + s = p_getKeyBindingOF_1_.getEnumString(); + } + + if (p_getKeyBindingOF_1_ == GameSettings.Options.RENDER_DISTANCE) { + int i1 = (int) this.getOptionFloatValue(p_getKeyBindingOF_1_); + String s1 = I18n.format("options.renderDistance.tiny", new Object[0]); + int i = 2; + + if (i1 >= 4) { + s1 = I18n.format("options.renderDistance.short", new Object[0]); + i = 4; + } + + if (i1 >= 8) { + s1 = I18n.format("options.renderDistance.normal", new Object[0]); + i = 8; + } + + if (i1 >= 16) { + s1 = I18n.format("options.renderDistance.far", new Object[0]); + i = 16; + } + + if (i1 >= 32) { + s1 = Lang.get("of.options.renderDistance.extreme"); + i = 32; + } + + if (i1 >= 48) { + s1 = Lang.get("of.options.renderDistance.insane"); + i = 48; + } + + if (i1 >= 64) { + s1 = Lang.get("of.options.renderDistance.ludicrous"); + i = 64; + } + + int j = this.renderDistanceChunks - i; + String s2 = s1; + + if (j > 0) { + s2 = s1 + "+"; + } + + return s + i1 + " " + s2 + ""; + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.FOG_FANCY) { + switch (this.ofFogType) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + case 3: + return s + Lang.getOff(); + + default: + return s + Lang.getOff(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.FOG_START) { + return s + this.ofFogStart; + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.MIPMAP_TYPE) { + switch (this.ofMipmapType) { + case 0: + return s + Lang.get("of.options.mipmap.nearest"); + + case 1: + return s + Lang.get("of.options.mipmap.linear"); + + case 2: + return s + Lang.get("of.options.mipmap.bilinear"); + + case 3: + return s + Lang.get("of.options.mipmap.trilinear"); + + default: + return s + "of.options.mipmap.nearest"; + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SMOOTH_FPS) { + return this.ofSmoothFps ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SMOOTH_WORLD) { + return this.ofSmoothWorld ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CLOUDS) { + switch (this.ofClouds) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + case 3: + return s + Lang.getOff(); + + default: + return s + Lang.getDefault(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.TREES) { + switch (this.ofTrees) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + case 3: + default: + return s + Lang.getDefault(); + + case 4: + return s + Lang.get("of.general.smart"); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.DROPPED_ITEMS) { + switch (this.ofDroppedItems) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + default: + return s + Lang.getDefault(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.RAIN) { + switch (this.ofRain) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + case 3: + return s + Lang.getOff(); + + default: + return s + Lang.getDefault(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_WATER) { + switch (this.ofAnimatedWater) { + case 1: + return s + Lang.get("of.options.animation.dynamic"); + + case 2: + return s + Lang.getOff(); + + default: + return s + Lang.getOn(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_LAVA) { + switch (this.ofAnimatedLava) { + case 1: + return s + Lang.get("of.options.animation.dynamic"); + + case 2: + return s + Lang.getOff(); + + default: + return s + Lang.getOn(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_FIRE) { + return this.ofAnimatedFire ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_PORTAL) { + return this.ofAnimatedPortal ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_REDSTONE) { + return this.ofAnimatedRedstone ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_EXPLOSION) { + return this.ofAnimatedExplosion ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_FLAME) { + return this.ofAnimatedFlame ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_SMOKE) { + return this.ofAnimatedSmoke ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.VOID_PARTICLES) { + return this.ofVoidParticles ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.WATER_PARTICLES) { + return this.ofWaterParticles ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.PORTAL_PARTICLES) { + return this.ofPortalParticles ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.POTION_PARTICLES) { + return this.ofPotionParticles ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.FIREWORK_PARTICLES) { + return this.ofFireworkParticles ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.DRIPPING_WATER_LAVA) { + return this.ofDrippingWaterLava ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_TERRAIN) { + return this.ofAnimatedTerrain ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ANIMATED_TEXTURES) { + return this.ofAnimatedTextures ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.RAIN_SPLASH) { + return this.ofRainSplash ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.LAGOMETER) { + return this.ofLagometer ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SHOW_FPS) { + return this.ofShowFps ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.AUTOSAVE_TICKS) { + int l = 900; + return this.ofAutoSaveTicks <= l ? s + Lang.get("of.options.save.45s") : (this.ofAutoSaveTicks <= 2 * l ? s + Lang.get("of.options.save.90s") : (this.ofAutoSaveTicks <= 4 * l ? s + Lang.get("of.options.save.3min") : (this.ofAutoSaveTicks <= 8 * l ? s + Lang.get("of.options.save.6min") : (this.ofAutoSaveTicks <= 16 * l ? s + Lang.get("of.options.save.12min") : s + Lang.get("of.options.save.24min"))))); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.BETTER_GRASS) { + switch (this.ofBetterGrass) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + default: + return s + Lang.getOff(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CONNECTED_TEXTURES) { + switch (this.ofConnectedTextures) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + default: + return s + Lang.getOff(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.WEATHER) { + return this.ofWeather ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SKY) { + return this.ofSky ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.STARS) { + return this.ofStars ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SUN_MOON) { + return this.ofSunMoon ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.VIGNETTE) { + switch (this.ofVignette) { + case 1: + return s + Lang.getFast(); + + case 2: + return s + Lang.getFancy(); + + default: + return s + Lang.getDefault(); + } + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CHUNK_UPDATES) { + return s + this.ofChunkUpdates; + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CHUNK_UPDATES_DYNAMIC) { + return this.ofChunkUpdatesDynamic ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.TIME) { + return this.ofTime == 1 ? s + Lang.get("of.options.time.dayOnly") : (this.ofTime == 2 ? s + Lang.get("of.options.time.nightOnly") : s + Lang.getDefault()); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CLEAR_WATER) { + return this.ofClearWater ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.AA_LEVEL) { + String s3 = ""; + + if (this.ofAaLevel != Config.getAntialiasingLevel()) { + s3 = " (" + Lang.get("of.general.restart") + ")"; + } + + return this.ofAaLevel == 0 ? s + Lang.getOff() + s3 : s + this.ofAaLevel + s3; + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.AF_LEVEL) { + return this.ofAfLevel == 1 ? s + Lang.getOff() : s + this.ofAfLevel; + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.PROFILER) { + return this.ofProfiler ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.BETTER_SNOW) { + return this.ofBetterSnow ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SWAMP_COLORS) { + return this.ofSwampColors ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.RANDOM_ENTITIES) { + return this.ofRandomEntities ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SMOOTH_BIOMES) { + return this.ofSmoothBiomes ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CUSTOM_FONTS) { + return this.ofCustomFonts ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CUSTOM_COLORS) { + return this.ofCustomColors ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CUSTOM_SKY) { + return this.ofCustomSky ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SHOW_CAPES) { + return this.ofShowCapes ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CUSTOM_ITEMS) { + return this.ofCustomItems ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.NATURAL_TEXTURES) { + return this.ofNaturalTextures ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.EMISSIVE_TEXTURES) { + return this.ofEmissiveTextures ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.FAST_MATH) { + return this.ofFastMath ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.FAST_RENDER) { + return this.ofFastRender ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.TRANSLUCENT_BLOCKS) { + return this.ofTranslucentBlocks == 1 ? s + Lang.getFast() : (this.ofTranslucentBlocks == 2 ? s + Lang.getFancy() : s + Lang.getDefault()); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.LAZY_CHUNK_LOADING) { + return this.ofLazyChunkLoading ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.RENDER_REGIONS) { + return this.ofRenderRegions ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SMART_ANIMATIONS) { + return this.ofSmartAnimations ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.DYNAMIC_FOV) { + return this.ofDynamicFov ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ALTERNATE_BLOCKS) { + return this.ofAlternateBlocks ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.DYNAMIC_LIGHTS) { + int k = indexOf(this.ofDynamicLights, OF_DYNAMIC_LIGHTS); + return s + getTranslation(KEYS_DYNAMIC_LIGHTS, k); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SCREENSHOT_SIZE) { + return this.ofScreenshotSize <= 1 ? s + Lang.getDefault() : s + this.ofScreenshotSize + "x"; + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CUSTOM_ENTITY_MODELS) { + return this.ofCustomEntityModels ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.CUSTOM_GUIS) { + return this.ofCustomGuis ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.SHOW_GL_ERRORS) { + return this.ofShowGlErrors ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.FULLSCREEN_MODE) { + return this.ofFullscreenMode.equals("Default") ? s + Lang.getDefault() : s + this.ofFullscreenMode; + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.HELD_ITEM_TOOLTIPS) { + return this.heldItemTooltips ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.ADVANCED_TOOLTIPS) { + return this.advancedItemTooltips ? s + Lang.getOn() : s + Lang.getOff(); + } else if (p_getKeyBindingOF_1_ == GameSettings.Options.FRAMERATE_LIMIT) { + float f = this.getOptionFloatValue(p_getKeyBindingOF_1_); + return f == 0.0F ? s + Lang.get("of.options.framerateLimit.vsync") : (f == p_getKeyBindingOF_1_.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int) f + " fps"); + } else { + return null; + } + } + + public void loadOfOptions() { + try { + File file1 = this.optionsFileOF; + + if (!file1.exists()) { + file1 = this.optionsFile; + } + + if (!file1.exists()) { + return; + } + + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(new FileInputStream(file1), "UTF-8")); + String s = ""; + + while ((s = bufferedreader.readLine()) != null) { + try { + String[] astring = s.split(":"); + + if (astring[0].equals("ofRenderDistanceChunks") && astring.length >= 2) { + this.renderDistanceChunks = Integer.valueOf(astring[1]).intValue(); + this.renderDistanceChunks = Config.limit(this.renderDistanceChunks, 2, 1024); + } + + if (astring[0].equals("ofFogType") && astring.length >= 2) { + this.ofFogType = Integer.valueOf(astring[1]).intValue(); + this.ofFogType = Config.limit(this.ofFogType, 1, 3); + } + + if (astring[0].equals("ofFogStart") && astring.length >= 2) { + this.ofFogStart = Float.valueOf(astring[1]).floatValue(); + + if (this.ofFogStart < 0.2F) { + this.ofFogStart = 0.2F; + } + + if (this.ofFogStart > 0.81F) { + this.ofFogStart = 0.8F; + } + } + + if (astring[0].equals("ofMipmapType") && astring.length >= 2) { + this.ofMipmapType = Integer.valueOf(astring[1]).intValue(); + this.ofMipmapType = Config.limit(this.ofMipmapType, 0, 3); + } + + if (astring[0].equals("ofOcclusionFancy") && astring.length >= 2) { + this.ofOcclusionFancy = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofSmoothFps") && astring.length >= 2) { + this.ofSmoothFps = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofSmoothWorld") && astring.length >= 2) { + this.ofSmoothWorld = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAoLevel") && astring.length >= 2) { + this.ofAoLevel = Float.valueOf(astring[1]).floatValue(); + this.ofAoLevel = Config.limit(this.ofAoLevel, 0.0F, 1.0F); + } + + if (astring[0].equals("ofClouds") && astring.length >= 2) { + this.ofClouds = Integer.valueOf(astring[1]).intValue(); + this.ofClouds = Config.limit(this.ofClouds, 0, 3); + this.updateRenderClouds(); + } + + if (astring[0].equals("ofCloudsHeight") && astring.length >= 2) { + this.ofCloudsHeight = Float.valueOf(astring[1]).floatValue(); + this.ofCloudsHeight = Config.limit(this.ofCloudsHeight, 0.0F, 1.0F); + } + + if (astring[0].equals("ofTrees") && astring.length >= 2) { + this.ofTrees = Integer.valueOf(astring[1]).intValue(); + this.ofTrees = limit(this.ofTrees, OF_TREES_VALUES); + } + + if (astring[0].equals("ofDroppedItems") && astring.length >= 2) { + this.ofDroppedItems = Integer.valueOf(astring[1]).intValue(); + this.ofDroppedItems = Config.limit(this.ofDroppedItems, 0, 2); + } + + if (astring[0].equals("ofRain") && astring.length >= 2) { + this.ofRain = Integer.valueOf(astring[1]).intValue(); + this.ofRain = Config.limit(this.ofRain, 0, 3); + } + + if (astring[0].equals("ofAnimatedWater") && astring.length >= 2) { + this.ofAnimatedWater = Integer.valueOf(astring[1]).intValue(); + this.ofAnimatedWater = Config.limit(this.ofAnimatedWater, 0, 2); + } + + if (astring[0].equals("ofAnimatedLava") && astring.length >= 2) { + this.ofAnimatedLava = Integer.valueOf(astring[1]).intValue(); + this.ofAnimatedLava = Config.limit(this.ofAnimatedLava, 0, 2); + } + + if (astring[0].equals("ofAnimatedFire") && astring.length >= 2) { + this.ofAnimatedFire = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAnimatedPortal") && astring.length >= 2) { + this.ofAnimatedPortal = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAnimatedRedstone") && astring.length >= 2) { + this.ofAnimatedRedstone = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAnimatedExplosion") && astring.length >= 2) { + this.ofAnimatedExplosion = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAnimatedFlame") && astring.length >= 2) { + this.ofAnimatedFlame = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAnimatedSmoke") && astring.length >= 2) { + this.ofAnimatedSmoke = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofVoidParticles") && astring.length >= 2) { + this.ofVoidParticles = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofWaterParticles") && astring.length >= 2) { + this.ofWaterParticles = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofPortalParticles") && astring.length >= 2) { + this.ofPortalParticles = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofPotionParticles") && astring.length >= 2) { + this.ofPotionParticles = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofFireworkParticles") && astring.length >= 2) { + this.ofFireworkParticles = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofDrippingWaterLava") && astring.length >= 2) { + this.ofDrippingWaterLava = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAnimatedTerrain") && astring.length >= 2) { + this.ofAnimatedTerrain = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAnimatedTextures") && astring.length >= 2) { + this.ofAnimatedTextures = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofRainSplash") && astring.length >= 2) { + this.ofRainSplash = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofLagometer") && astring.length >= 2) { + this.ofLagometer = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofShowFps") && astring.length >= 2) { + this.ofShowFps = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAutoSaveTicks") && astring.length >= 2) { + this.ofAutoSaveTicks = Integer.valueOf(astring[1]).intValue(); + this.ofAutoSaveTicks = Config.limit(this.ofAutoSaveTicks, 40, 40000); + } + + if (astring[0].equals("ofBetterGrass") && astring.length >= 2) { + this.ofBetterGrass = Integer.valueOf(astring[1]).intValue(); + this.ofBetterGrass = Config.limit(this.ofBetterGrass, 1, 3); + } + + if (astring[0].equals("ofConnectedTextures") && astring.length >= 2) { + this.ofConnectedTextures = Integer.valueOf(astring[1]).intValue(); + this.ofConnectedTextures = Config.limit(this.ofConnectedTextures, 1, 3); + } + + if (astring[0].equals("ofWeather") && astring.length >= 2) { + this.ofWeather = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofSky") && astring.length >= 2) { + this.ofSky = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofStars") && astring.length >= 2) { + this.ofStars = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofSunMoon") && astring.length >= 2) { + this.ofSunMoon = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofVignette") && astring.length >= 2) { + this.ofVignette = Integer.valueOf(astring[1]).intValue(); + this.ofVignette = Config.limit(this.ofVignette, 0, 2); + } + + if (astring[0].equals("ofChunkUpdates") && astring.length >= 2) { + this.ofChunkUpdates = Integer.valueOf(astring[1]).intValue(); + this.ofChunkUpdates = Config.limit(this.ofChunkUpdates, 1, 5); + } + + if (astring[0].equals("ofChunkUpdatesDynamic") && astring.length >= 2) { + this.ofChunkUpdatesDynamic = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofTime") && astring.length >= 2) { + this.ofTime = Integer.valueOf(astring[1]).intValue(); + this.ofTime = Config.limit(this.ofTime, 0, 2); + } + + if (astring[0].equals("ofClearWater") && astring.length >= 2) { + this.ofClearWater = Boolean.valueOf(astring[1]).booleanValue(); + this.updateWaterOpacity(); + } + + if (astring[0].equals("ofAaLevel") && astring.length >= 2) { + this.ofAaLevel = Integer.valueOf(astring[1]).intValue(); + this.ofAaLevel = Config.limit(this.ofAaLevel, 0, 16); + } + + if (astring[0].equals("ofAfLevel") && astring.length >= 2) { + this.ofAfLevel = Integer.valueOf(astring[1]).intValue(); + this.ofAfLevel = Config.limit(this.ofAfLevel, 1, 16); + } + + if (astring[0].equals("ofProfiler") && astring.length >= 2) { + this.ofProfiler = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofBetterSnow") && astring.length >= 2) { + this.ofBetterSnow = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofSwampColors") && astring.length >= 2) { + this.ofSwampColors = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofRandomEntities") && astring.length >= 2) { + this.ofRandomEntities = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofSmoothBiomes") && astring.length >= 2) { + this.ofSmoothBiomes = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofCustomFonts") && astring.length >= 2) { + this.ofCustomFonts = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofCustomColors") && astring.length >= 2) { + this.ofCustomColors = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofCustomItems") && astring.length >= 2) { + this.ofCustomItems = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofCustomSky") && astring.length >= 2) { + this.ofCustomSky = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofShowCapes") && astring.length >= 2) { + this.ofShowCapes = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofNaturalTextures") && astring.length >= 2) { + this.ofNaturalTextures = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofEmissiveTextures") && astring.length >= 2) { + this.ofEmissiveTextures = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofLazyChunkLoading") && astring.length >= 2) { + this.ofLazyChunkLoading = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofRenderRegions") && astring.length >= 2) { + this.ofRenderRegions = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofSmartAnimations") && astring.length >= 2) { + this.ofSmartAnimations = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofDynamicFov") && astring.length >= 2) { + this.ofDynamicFov = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofAlternateBlocks") && astring.length >= 2) { + this.ofAlternateBlocks = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofDynamicLights") && astring.length >= 2) { + this.ofDynamicLights = Integer.valueOf(astring[1]).intValue(); + this.ofDynamicLights = limit(this.ofDynamicLights, OF_DYNAMIC_LIGHTS); + } + + if (astring[0].equals("ofScreenshotSize") && astring.length >= 2) { + this.ofScreenshotSize = Integer.valueOf(astring[1]).intValue(); + this.ofScreenshotSize = Config.limit(this.ofScreenshotSize, 1, 4); + } + + if (astring[0].equals("ofCustomEntityModels") && astring.length >= 2) { + this.ofCustomEntityModels = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofCustomGuis") && astring.length >= 2) { + this.ofCustomGuis = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofShowGlErrors") && astring.length >= 2) { + this.ofShowGlErrors = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofFullscreenMode") && astring.length >= 2) { + this.ofFullscreenMode = astring[1]; + } + + if (astring[0].equals("ofFastMath") && astring.length >= 2) { + this.ofFastMath = Boolean.valueOf(astring[1]).booleanValue(); + MathHelper.fastMath = this.ofFastMath; + } + + if (astring[0].equals("ofFastRender") && astring.length >= 2) { + this.ofFastRender = Boolean.valueOf(astring[1]).booleanValue(); + } + + if (astring[0].equals("ofTranslucentBlocks") && astring.length >= 2) { + this.ofTranslucentBlocks = Integer.valueOf(astring[1]).intValue(); + this.ofTranslucentBlocks = Config.limit(this.ofTranslucentBlocks, 0, 2); + } + + if (astring[0].equals("key_" + this.ofKeyBindZoom.getKeyDescription())) { + this.ofKeyBindZoom.setKeyCode(Integer.parseInt(astring[1])); + } + } catch (Exception exception) { + Config.dbg("Skipping bad option: " + s); + exception.printStackTrace(); + } + } + + KeyUtils.fixKeyConflicts(this.keyBindings, new KeyBinding[]{this.ofKeyBindZoom}); + KeyBinding.resetKeyBindingArrayAndHash(); + bufferedreader.close(); + } catch (Exception exception1) { + Config.warn("Failed to load options"); + exception1.printStackTrace(); + } + } + + public void saveOfOptions() { + try { + PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.optionsFileOF), "UTF-8")); + printwriter.println("ofFogType:" + this.ofFogType); + printwriter.println("ofFogStart:" + this.ofFogStart); + printwriter.println("ofMipmapType:" + this.ofMipmapType); + printwriter.println("ofOcclusionFancy:" + this.ofOcclusionFancy); + printwriter.println("ofSmoothFps:" + this.ofSmoothFps); + printwriter.println("ofSmoothWorld:" + this.ofSmoothWorld); + printwriter.println("ofAoLevel:" + this.ofAoLevel); + printwriter.println("ofClouds:" + this.ofClouds); + printwriter.println("ofCloudsHeight:" + this.ofCloudsHeight); + printwriter.println("ofTrees:" + this.ofTrees); + printwriter.println("ofDroppedItems:" + this.ofDroppedItems); + printwriter.println("ofRain:" + this.ofRain); + printwriter.println("ofAnimatedWater:" + this.ofAnimatedWater); + printwriter.println("ofAnimatedLava:" + this.ofAnimatedLava); + printwriter.println("ofAnimatedFire:" + this.ofAnimatedFire); + printwriter.println("ofAnimatedPortal:" + this.ofAnimatedPortal); + printwriter.println("ofAnimatedRedstone:" + this.ofAnimatedRedstone); + printwriter.println("ofAnimatedExplosion:" + this.ofAnimatedExplosion); + printwriter.println("ofAnimatedFlame:" + this.ofAnimatedFlame); + printwriter.println("ofAnimatedSmoke:" + this.ofAnimatedSmoke); + printwriter.println("ofVoidParticles:" + this.ofVoidParticles); + printwriter.println("ofWaterParticles:" + this.ofWaterParticles); + printwriter.println("ofPortalParticles:" + this.ofPortalParticles); + printwriter.println("ofPotionParticles:" + this.ofPotionParticles); + printwriter.println("ofFireworkParticles:" + this.ofFireworkParticles); + printwriter.println("ofDrippingWaterLava:" + this.ofDrippingWaterLava); + printwriter.println("ofAnimatedTerrain:" + this.ofAnimatedTerrain); + printwriter.println("ofAnimatedTextures:" + this.ofAnimatedTextures); + printwriter.println("ofRainSplash:" + this.ofRainSplash); + printwriter.println("ofLagometer:" + this.ofLagometer); + printwriter.println("ofShowFps:" + this.ofShowFps); + printwriter.println("ofAutoSaveTicks:" + this.ofAutoSaveTicks); + printwriter.println("ofBetterGrass:" + this.ofBetterGrass); + printwriter.println("ofConnectedTextures:" + this.ofConnectedTextures); + printwriter.println("ofWeather:" + this.ofWeather); + printwriter.println("ofSky:" + this.ofSky); + printwriter.println("ofStars:" + this.ofStars); + printwriter.println("ofSunMoon:" + this.ofSunMoon); + printwriter.println("ofVignette:" + this.ofVignette); + printwriter.println("ofChunkUpdates:" + this.ofChunkUpdates); + printwriter.println("ofChunkUpdatesDynamic:" + this.ofChunkUpdatesDynamic); + printwriter.println("ofTime:" + this.ofTime); + printwriter.println("ofClearWater:" + this.ofClearWater); + printwriter.println("ofAaLevel:" + this.ofAaLevel); + printwriter.println("ofAfLevel:" + this.ofAfLevel); + printwriter.println("ofProfiler:" + this.ofProfiler); + printwriter.println("ofBetterSnow:" + this.ofBetterSnow); + printwriter.println("ofSwampColors:" + this.ofSwampColors); + printwriter.println("ofRandomEntities:" + this.ofRandomEntities); + printwriter.println("ofSmoothBiomes:" + this.ofSmoothBiomes); + printwriter.println("ofCustomFonts:" + this.ofCustomFonts); + printwriter.println("ofCustomColors:" + this.ofCustomColors); + printwriter.println("ofCustomItems:" + this.ofCustomItems); + printwriter.println("ofCustomSky:" + this.ofCustomSky); + printwriter.println("ofShowCapes:" + this.ofShowCapes); + printwriter.println("ofNaturalTextures:" + this.ofNaturalTextures); + printwriter.println("ofEmissiveTextures:" + this.ofEmissiveTextures); + printwriter.println("ofLazyChunkLoading:" + this.ofLazyChunkLoading); + printwriter.println("ofRenderRegions:" + this.ofRenderRegions); + printwriter.println("ofSmartAnimations:" + this.ofSmartAnimations); + printwriter.println("ofDynamicFov:" + this.ofDynamicFov); + printwriter.println("ofAlternateBlocks:" + this.ofAlternateBlocks); + printwriter.println("ofDynamicLights:" + this.ofDynamicLights); + printwriter.println("ofScreenshotSize:" + this.ofScreenshotSize); + printwriter.println("ofCustomEntityModels:" + this.ofCustomEntityModels); + printwriter.println("ofCustomGuis:" + this.ofCustomGuis); + printwriter.println("ofShowGlErrors:" + this.ofShowGlErrors); + printwriter.println("ofFullscreenMode:" + this.ofFullscreenMode); + printwriter.println("ofFastMath:" + this.ofFastMath); + printwriter.println("ofFastRender:" + this.ofFastRender); + printwriter.println("ofTranslucentBlocks:" + this.ofTranslucentBlocks); + printwriter.println("key_" + this.ofKeyBindZoom.getKeyDescription() + ":" + this.ofKeyBindZoom.getKeyCode()); + printwriter.close(); + } catch (Exception exception) { + Config.warn("Failed to save options"); + exception.printStackTrace(); + } + } + + private void updateRenderClouds() { + switch (this.ofClouds) { + case 1: + this.clouds = 1; + break; + + case 2: + this.clouds = 2; + break; + + case 3: + this.clouds = 0; + break; + + default: + if (this.fancyGraphics) { + this.clouds = 2; + } else { + this.clouds = 1; + } + } + } + + public void resetSettings() { + this.renderDistanceChunks = 8; + this.viewBobbing = true; + this.anaglyph = false; + this.limitFramerate = (int) GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.enableVsync = false; + this.updateVSync(); + this.mipmapLevels = 4; + this.fancyGraphics = true; + this.ambientOcclusion = 2; + this.clouds = 2; + this.fovSetting = 70.0F; + this.gammaSetting = 0.0F; + this.guiScale = 0; + this.particleSetting = 0; + this.heldItemTooltips = true; + this.useVbo = false; + this.forceUnicodeFont = false; + this.ofFogType = 1; + this.ofFogStart = 0.8F; + this.ofMipmapType = 0; + this.ofOcclusionFancy = false; + this.ofSmartAnimations = false; + this.ofSmoothFps = false; + Config.updateAvailableProcessors(); + this.ofSmoothWorld = Config.isSingleProcessor(); + this.ofLazyChunkLoading = false; + this.ofRenderRegions = false; + this.ofFastMath = false; + this.ofFastRender = false; + this.ofTranslucentBlocks = 0; + this.ofDynamicFov = true; + this.ofAlternateBlocks = true; + this.ofDynamicLights = 3; + this.ofScreenshotSize = 1; + this.ofCustomEntityModels = true; + this.ofCustomGuis = true; + this.ofShowGlErrors = true; + this.ofAoLevel = 1.0F; + this.ofAaLevel = 0; + this.ofAfLevel = 1; + this.ofClouds = 0; + this.ofCloudsHeight = 0.0F; + this.ofTrees = 0; + this.ofRain = 0; + this.ofBetterGrass = 3; + this.ofAutoSaveTicks = 4000; + this.ofLagometer = false; + this.ofShowFps = false; + this.ofProfiler = false; + this.ofWeather = true; + this.ofSky = true; + this.ofStars = true; + this.ofSunMoon = true; + this.ofVignette = 0; + this.ofChunkUpdates = 1; + this.ofChunkUpdatesDynamic = false; + this.ofTime = 0; + this.ofClearWater = false; + this.ofBetterSnow = false; + this.ofFullscreenMode = "Default"; + this.ofSwampColors = true; + this.ofRandomEntities = true; + this.ofSmoothBiomes = true; + this.ofCustomFonts = true; + this.ofCustomColors = true; + this.ofCustomItems = true; + this.ofCustomSky = true; + this.ofShowCapes = true; + this.ofConnectedTextures = 2; + this.ofNaturalTextures = false; + this.ofEmissiveTextures = true; + this.ofAnimatedWater = 0; + this.ofAnimatedLava = 0; + this.ofAnimatedFire = true; + this.ofAnimatedPortal = true; + this.ofAnimatedRedstone = true; + this.ofAnimatedExplosion = true; + this.ofAnimatedFlame = true; + this.ofAnimatedSmoke = true; + this.ofVoidParticles = true; + this.ofWaterParticles = true; + this.ofRainSplash = true; + this.ofPortalParticles = true; + this.ofPotionParticles = true; + this.ofFireworkParticles = true; + this.ofDrippingWaterLava = true; + this.ofAnimatedTerrain = true; + this.ofAnimatedTextures = true; + Shaders.setShaderPack("OFF"); + Shaders.configAntialiasingLevel = 0; + Shaders.uninit(); + Shaders.storeConfig(); + this.updateWaterOpacity(); + this.mc.refreshResources(); + this.saveOptions(); + } + + public void updateVSync() { + Display.setVSyncEnabled(this.enableVsync); + } + + private void updateWaterOpacity() { + if (Config.isIntegratedServerRunning()) { + Config.waterOpacityChanged = true; + } + + ClearWater.updateWaterOpacity(this, this.mc.theWorld); + } + + public void setAllAnimations(boolean p_setAllAnimations_1_) { + int i = p_setAllAnimations_1_ ? 0 : 2; + this.ofAnimatedWater = i; + this.ofAnimatedLava = i; + this.ofAnimatedFire = p_setAllAnimations_1_; + this.ofAnimatedPortal = p_setAllAnimations_1_; + this.ofAnimatedRedstone = p_setAllAnimations_1_; + this.ofAnimatedExplosion = p_setAllAnimations_1_; + this.ofAnimatedFlame = p_setAllAnimations_1_; + this.ofAnimatedSmoke = p_setAllAnimations_1_; + this.ofVoidParticles = p_setAllAnimations_1_; + this.ofWaterParticles = p_setAllAnimations_1_; + this.ofRainSplash = p_setAllAnimations_1_; + this.ofPortalParticles = p_setAllAnimations_1_; + this.ofPotionParticles = p_setAllAnimations_1_; + this.ofFireworkParticles = p_setAllAnimations_1_; + this.particleSetting = p_setAllAnimations_1_ ? 0 : 2; + this.ofDrippingWaterLava = p_setAllAnimations_1_; + this.ofAnimatedTerrain = p_setAllAnimations_1_; + this.ofAnimatedTextures = p_setAllAnimations_1_; + } + + private static int nextValue(int p_nextValue_0_, int[] p_nextValue_1_) { + int i = indexOf(p_nextValue_0_, p_nextValue_1_); + + if (i < 0) { + return p_nextValue_1_[0]; + } else { + ++i; + + if (i >= p_nextValue_1_.length) { + i = 0; + } + + return p_nextValue_1_[i]; + } + } + + private static int limit(int p_limit_0_, int[] p_limit_1_) { + int i = indexOf(p_limit_0_, p_limit_1_); + return i < 0 ? p_limit_1_[0] : p_limit_0_; + } + + private static int indexOf(int p_indexOf_0_, int[] p_indexOf_1_) { + for (int i = 0; i < p_indexOf_1_.length; ++i) { + if (p_indexOf_1_[i] == p_indexOf_0_) { + return i; + } + } + + return -1; + } + + public enum Options { + INVERT_MOUSE("options.invertMouse", false, true), + SENSITIVITY("options.sensitivity", true, false), + FOV("options.fov", true, false, 30.0F, 110.0F, 1.0F), + GAMMA("options.gamma", true, false), + SATURATION("options.saturation", true, false), + RENDER_DISTANCE("options.renderDistance", true, false, 2.0F, 16.0F, 1.0F), + VIEW_BOBBING("options.viewBobbing", false, true), + ANAGLYPH("options.anaglyph", false, true), + FRAMERATE_LIMIT("options.framerateLimit", true, false, 0.0F, 260.0F, 5.0F), + FBO_ENABLE("options.fboEnable", false, true), + RENDER_CLOUDS("options.renderClouds", false, false), + GRAPHICS("options.graphics", false, false), + AMBIENT_OCCLUSION("options.ao", false, false), + GUI_SCALE("options.guiScale", false, false), + PARTICLES("options.particles", false, false), + CHAT_VISIBILITY("options.chat.visibility", false, false), + CHAT_COLOR("options.chat.color", false, true), + CHAT_LINKS("options.chat.links", false, true), + CHAT_OPACITY("options.chat.opacity", true, false), + CHAT_LINKS_PROMPT("options.chat.links.prompt", false, true), + SNOOPER_ENABLED("options.snooper", false, true), + USE_FULLSCREEN("options.fullscreen", false, true), + ENABLE_VSYNC("options.vsync", false, true), + USE_VBO("options.vbo", false, true), + TOUCHSCREEN("options.touchscreen", false, true), + CHAT_SCALE("options.chat.scale", true, false), + CHAT_WIDTH("options.chat.width", true, false), + CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), + CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false), + MIPMAP_LEVELS("options.mipmapLevels", true, false, 0.0F, 4.0F, 1.0F), + FORCE_UNICODE_FONT("options.forceUnicodeFont", false, true), + STREAM_BYTES_PER_PIXEL("options.stream.bytesPerPixel", true, false), + STREAM_VOLUME_MIC("options.stream.micVolumne", true, false), + STREAM_VOLUME_SYSTEM("options.stream.systemVolume", true, false), + STREAM_KBPS("options.stream.kbps", true, false), + STREAM_FPS("options.stream.fps", true, false), + STREAM_COMPRESSION("options.stream.compression", false, false), + STREAM_SEND_METADATA("options.stream.sendMetadata", false, true), + STREAM_CHAT_ENABLED("options.stream.chat.enabled", false, false), + STREAM_CHAT_USER_FILTER("options.stream.chat.userFilter", false, false), + STREAM_MIC_TOGGLE_BEHAVIOR("options.stream.micToggleBehavior", false, false), + BLOCK_ALTERNATIVES("options.blockAlternatives", false, true), + REDUCED_DEBUG_INFO("options.reducedDebugInfo", false, true), + ENTITY_SHADOWS("options.entityShadows", false, true), + REALMS_NOTIFICATIONS("options.realmsNotifications", false, true), + FOG_FANCY("of.options.FOG_FANCY", false, false), + FOG_START("of.options.FOG_START", false, false), + MIPMAP_TYPE("of.options.MIPMAP_TYPE", true, false, 0.0F, 3.0F, 1.0F), + SMOOTH_FPS("of.options.SMOOTH_FPS", false, false), + CLOUDS("of.options.CLOUDS", false, false), + CLOUD_HEIGHT("of.options.CLOUD_HEIGHT", true, false), + TREES("of.options.TREES", false, false), + RAIN("of.options.RAIN", false, false), + ANIMATED_WATER("of.options.ANIMATED_WATER", false, false), + ANIMATED_LAVA("of.options.ANIMATED_LAVA", false, false), + ANIMATED_FIRE("of.options.ANIMATED_FIRE", false, false), + ANIMATED_PORTAL("of.options.ANIMATED_PORTAL", false, false), + AO_LEVEL("of.options.AO_LEVEL", true, false), + LAGOMETER("of.options.LAGOMETER", false, false), + SHOW_FPS("of.options.SHOW_FPS", false, false), + AUTOSAVE_TICKS("of.options.AUTOSAVE_TICKS", false, false), + BETTER_GRASS("of.options.BETTER_GRASS", false, false), + ANIMATED_REDSTONE("of.options.ANIMATED_REDSTONE", false, false), + ANIMATED_EXPLOSION("of.options.ANIMATED_EXPLOSION", false, false), + ANIMATED_FLAME("of.options.ANIMATED_FLAME", false, false), + ANIMATED_SMOKE("of.options.ANIMATED_SMOKE", false, false), + WEATHER("of.options.WEATHER", false, false), + SKY("of.options.SKY", false, false), + STARS("of.options.STARS", false, false), + SUN_MOON("of.options.SUN_MOON", false, false), + VIGNETTE("of.options.VIGNETTE", false, false), + CHUNK_UPDATES("of.options.CHUNK_UPDATES", false, false), + CHUNK_UPDATES_DYNAMIC("of.options.CHUNK_UPDATES_DYNAMIC", false, false), + TIME("of.options.TIME", false, false), + CLEAR_WATER("of.options.CLEAR_WATER", false, false), + SMOOTH_WORLD("of.options.SMOOTH_WORLD", false, false), + VOID_PARTICLES("of.options.VOID_PARTICLES", false, false), + WATER_PARTICLES("of.options.WATER_PARTICLES", false, false), + RAIN_SPLASH("of.options.RAIN_SPLASH", false, false), + PORTAL_PARTICLES("of.options.PORTAL_PARTICLES", false, false), + POTION_PARTICLES("of.options.POTION_PARTICLES", false, false), + FIREWORK_PARTICLES("of.options.FIREWORK_PARTICLES", false, false), + PROFILER("of.options.PROFILER", false, false), + DRIPPING_WATER_LAVA("of.options.DRIPPING_WATER_LAVA", false, false), + BETTER_SNOW("of.options.BETTER_SNOW", false, false), + FULLSCREEN_MODE("of.options.FULLSCREEN_MODE", true, false, 0.0F, (float) Config.getDisplayModes().length, 1.0F), + ANIMATED_TERRAIN("of.options.ANIMATED_TERRAIN", false, false), + SWAMP_COLORS("of.options.SWAMP_COLORS", false, false), + RANDOM_ENTITIES("of.options.RANDOM_ENTITIES", false, false), + SMOOTH_BIOMES("of.options.SMOOTH_BIOMES", false, false), + CUSTOM_FONTS("of.options.CUSTOM_FONTS", false, false), + CUSTOM_COLORS("of.options.CUSTOM_COLORS", false, false), + SHOW_CAPES("of.options.SHOW_CAPES", false, false), + CONNECTED_TEXTURES("of.options.CONNECTED_TEXTURES", false, false), + CUSTOM_ITEMS("of.options.CUSTOM_ITEMS", false, false), + AA_LEVEL("of.options.AA_LEVEL", true, false, 0.0F, 16.0F, 1.0F), + AF_LEVEL("of.options.AF_LEVEL", true, false, 1.0F, 16.0F, 1.0F), + ANIMATED_TEXTURES("of.options.ANIMATED_TEXTURES", false, false), + NATURAL_TEXTURES("of.options.NATURAL_TEXTURES", false, false), + EMISSIVE_TEXTURES("of.options.EMISSIVE_TEXTURES", false, false), + HELD_ITEM_TOOLTIPS("of.options.HELD_ITEM_TOOLTIPS", false, false), + DROPPED_ITEMS("of.options.DROPPED_ITEMS", false, false), + LAZY_CHUNK_LOADING("of.options.LAZY_CHUNK_LOADING", false, false), + CUSTOM_SKY("of.options.CUSTOM_SKY", false, false), + FAST_MATH("of.options.FAST_MATH", false, false), + FAST_RENDER("of.options.FAST_RENDER", false, false), + TRANSLUCENT_BLOCKS("of.options.TRANSLUCENT_BLOCKS", false, false), + DYNAMIC_FOV("of.options.DYNAMIC_FOV", false, false), + DYNAMIC_LIGHTS("of.options.DYNAMIC_LIGHTS", false, false), + ALTERNATE_BLOCKS("of.options.ALTERNATE_BLOCKS", false, false), + CUSTOM_ENTITY_MODELS("of.options.CUSTOM_ENTITY_MODELS", false, false), + ADVANCED_TOOLTIPS("of.options.ADVANCED_TOOLTIPS", false, false), + SCREENSHOT_SIZE("of.options.SCREENSHOT_SIZE", false, false), + CUSTOM_GUIS("of.options.CUSTOM_GUIS", false, false), + RENDER_REGIONS("of.options.RENDER_REGIONS", false, false), + SHOW_GL_ERRORS("of.options.SHOW_GL_ERRORS", false, false), + SMART_ANIMATIONS("of.options.SMART_ANIMATIONS", false, false); + + private final boolean enumFloat; + private final boolean enumBoolean; + private final String enumString; + private final float valueStep; + private float valueMin; + private float valueMax; + + public static GameSettings.Options getEnumOptions(int ordinal) { + for (GameSettings.Options gamesettings$options : values()) { + if (gamesettings$options.returnEnumOrdinal() == ordinal) { + return gamesettings$options; + } + } + + return null; + } + + private Options(String str, boolean isFloat, boolean isBoolean) { + this(str, isFloat, isBoolean, 0.0F, 1.0F, 0.0F); + } + + private Options(String str, boolean isFloat, boolean isBoolean, float valMin, float valMax, float valStep) { + this.enumString = str; + this.enumFloat = isFloat; + this.enumBoolean = isBoolean; + this.valueMin = valMin; + this.valueMax = valMax; + this.valueStep = valStep; + } + + public boolean getEnumFloat() { + return this.enumFloat; + } + + public boolean getEnumBoolean() { + return this.enumBoolean; + } + + public int returnEnumOrdinal() { + return this.ordinal(); + } + + public String getEnumString() { + return this.enumString; + } + + public float getValueMax() { + return this.valueMax; + } + + public void setValueMax(float value) { + this.valueMax = value; + } + + public float normalizeValue(float value) { + return MathHelper.clamp_float((this.snapToStepClamp(value) - this.valueMin) / (this.valueMax - this.valueMin), 0.0F, 1.0F); + } + + public float denormalizeValue(float value) { + return this.snapToStepClamp(this.valueMin + (this.valueMax - this.valueMin) * MathHelper.clamp_float(value, 0.0F, 1.0F)); + } + + public float snapToStepClamp(float value) { + value = this.snapToStep(value); + return MathHelper.clamp_float(value, this.valueMin, this.valueMax); + } + + protected float snapToStep(float value) { + if (this.valueStep > 0.0F) { + value = this.valueStep * (float) Math.round(value / this.valueStep); + } + + return value; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/settings/KeyBinding.java b/Client-1.8.9/src/main/java/net/minecraft/client/settings/KeyBinding.java new file mode 100644 index 0000000..38e7ab6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/settings/KeyBinding.java @@ -0,0 +1,155 @@ +package net.minecraft.client.settings; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Set; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.IntHashMap; + +public class KeyBinding implements Comparable +{ + private static final List keybindArray = Lists.newArrayList(); + private static final IntHashMap hash = new IntHashMap(); + private static final Set keybindSet = Sets.newHashSet(); + private final String keyDescription; + private final int keyCodeDefault; + private final String keyCategory; + private int keyCode; + private boolean pressed; + private int pressTime; + public boolean isCheatBreakerKeybind; + + public static void onTick(int keyCode) + { + if (keyCode != 0) + { + KeyBinding keybinding = (KeyBinding)hash.lookup(keyCode); + + if (keybinding != null) + { + ++keybinding.pressTime; + } + } + } + + public static void setKeyBindState(int keyCode, boolean pressed) + { + if (keyCode != 0) + { + KeyBinding keybinding = (KeyBinding)hash.lookup(keyCode); + + if (keybinding != null) + { + keybinding.pressed = pressed; + } + } + } + + public static void unPressAllKeys() + { + for (KeyBinding keybinding : keybindArray) + { + keybinding.unpressKey(); + } + } + + public static void resetKeyBindingArrayAndHash() + { + hash.clearMap(); + + for (KeyBinding keybinding : keybindArray) + { + hash.addKey(keybinding.keyCode, keybinding); + } + } + + public static Set getKeybinds() + { + return keybindSet; + } + + public KeyBinding(String description, int keyCode, String category) + { + this.keyDescription = description; + this.keyCode = keyCode; + this.keyCodeDefault = keyCode; + this.keyCategory = category; + keybindArray.add(this); + hash.addKey(keyCode, this); + keybindSet.add(category); + } + + public KeyBinding(String keyDescription, int keyCode, String keyCategory, boolean cbKeybind) { + this.pressed = false; + this.keyDescription = keyDescription; + this.keyCode = keyCode; + this.keyCodeDefault = keyCode; + this.keyCategory = keyCategory; + this.isCheatBreakerKeybind = cbKeybind; + keybindArray.add(this); + hash.addKey(keyCode, this); + keybindSet.add(keyCategory); + } + + public boolean isKeyDown() + { + return this.pressed; + } + + public String getKeyCategory() + { + return this.keyCategory; + } + + public boolean isPressed() + { + if (this.pressTime == 0) + { + return false; + } + else + { + --this.pressTime; + return true; + } + } + + private void unpressKey() + { + this.pressTime = 0; + this.pressed = false; + } + + public String getKeyDescription() + { + return this.keyDescription; + } + + public int getKeyCodeDefault() + { + return this.keyCodeDefault; + } + + public int getKeyCode() + { + return this.keyCode; + } + + public void setKeyCode(int keyCode) + { + this.keyCode = keyCode; + } + + public int compareTo(KeyBinding p_compareTo_1_) + { + int i = I18n.format(this.keyCategory, new Object[0]).compareTo(I18n.format(p_compareTo_1_.keyCategory, new Object[0])); + + if (i == 0) + { + i = I18n.format(this.keyDescription, new Object[0]).compareTo(I18n.format(p_compareTo_1_.keyDescription, new Object[0])); + } + + return i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/Framebuffer.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/Framebuffer.java new file mode 100644 index 0000000..f73d58e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/Framebuffer.java @@ -0,0 +1,280 @@ +package net.minecraft.client.shader; + +import java.nio.ByteBuffer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import org.lwjgl.opengl.GL11; + +public class Framebuffer +{ + public int framebufferTextureWidth; + public int framebufferTextureHeight; + public int framebufferWidth; + public int framebufferHeight; + public boolean useDepth; + public int framebufferObject; + public int framebufferTexture; + public int depthBuffer; + public float[] framebufferColor; + public int framebufferFilter; + + public Framebuffer(int p_i45078_1_, int p_i45078_2_, boolean p_i45078_3_) + { + this.useDepth = p_i45078_3_; + this.framebufferObject = -1; + this.framebufferTexture = -1; + this.depthBuffer = -1; + this.framebufferColor = new float[4]; + this.framebufferColor[0] = 1.0F; + this.framebufferColor[1] = 1.0F; + this.framebufferColor[2] = 1.0F; + this.framebufferColor[3] = 0.0F; + this.createBindFramebuffer(p_i45078_1_, p_i45078_2_); + } + + public void createBindFramebuffer(int width, int height) + { + if (!OpenGlHelper.isFramebufferEnabled()) + { + this.framebufferWidth = width; + this.framebufferHeight = height; + } + else + { + GlStateManager.enableDepth(); + + if (this.framebufferObject >= 0) + { + this.deleteFramebuffer(); + } + + this.createFramebuffer(width, height); + this.checkFramebufferComplete(); + OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0); + } + } + + public void deleteFramebuffer() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + this.unbindFramebufferTexture(); + this.unbindFramebuffer(); + + if (this.depthBuffer > -1) + { + OpenGlHelper.glDeleteRenderbuffers(this.depthBuffer); + this.depthBuffer = -1; + } + + if (this.framebufferTexture > -1) + { + TextureUtil.deleteTexture(this.framebufferTexture); + this.framebufferTexture = -1; + } + + if (this.framebufferObject > -1) + { + OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0); + OpenGlHelper.glDeleteFramebuffers(this.framebufferObject); + this.framebufferObject = -1; + } + } + } + + public void createFramebuffer(int width, int height) + { + this.framebufferWidth = width; + this.framebufferHeight = height; + this.framebufferTextureWidth = width; + this.framebufferTextureHeight = height; + + if (!OpenGlHelper.isFramebufferEnabled()) + { + this.framebufferClear(); + } + else + { + this.framebufferObject = OpenGlHelper.glGenFramebuffers(); + this.framebufferTexture = TextureUtil.glGenTextures(); + + if (this.useDepth) + { + this.depthBuffer = OpenGlHelper.glGenRenderbuffers(); + } + + this.setFramebufferFilter(9728); + GlStateManager.bindTexture(this.framebufferTexture); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null)); + OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject); + OpenGlHelper.glFramebufferTexture2D(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_COLOR_ATTACHMENT0, 3553, this.framebufferTexture, 0); + + if (this.useDepth) + { + OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer); + OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight); + OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_DEPTH_ATTACHMENT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer); + } + + this.framebufferClear(); + this.unbindFramebufferTexture(); + } + } + + public void setFramebufferFilter(int p_147607_1_) + { + if (OpenGlHelper.isFramebufferEnabled()) + { + this.framebufferFilter = p_147607_1_; + GlStateManager.bindTexture(this.framebufferTexture); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, (float)p_147607_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, (float)p_147607_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F); + GlStateManager.bindTexture(0); + } + } + + public void checkFramebufferComplete() + { + int i = OpenGlHelper.glCheckFramebufferStatus(OpenGlHelper.GL_FRAMEBUFFER); + + if (i != OpenGlHelper.GL_FRAMEBUFFER_COMPLETE) + { + if (i == OpenGlHelper.GL_FB_INCOMPLETE_ATTACHMENT) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); + } + else if (i == OpenGlHelper.GL_FB_INCOMPLETE_MISS_ATTACH) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); + } + else if (i == OpenGlHelper.GL_FB_INCOMPLETE_DRAW_BUFFER) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER"); + } + else if (i == OpenGlHelper.GL_FB_INCOMPLETE_READ_BUFFER) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER"); + } + else + { + throw new RuntimeException("glCheckFramebufferStatus returned unknown status:" + i); + } + } + } + + public void bindFramebufferTexture() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + GlStateManager.bindTexture(this.framebufferTexture); + } + } + + public void unbindFramebufferTexture() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + GlStateManager.bindTexture(0); + } + } + + public void bindFramebuffer(boolean p_147610_1_) + { + if (OpenGlHelper.isFramebufferEnabled()) + { + OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject); + + if (p_147610_1_) + { + GlStateManager.viewport(0, 0, this.framebufferWidth, this.framebufferHeight); + } + } + } + + public void unbindFramebuffer() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0); + } + } + + public void setFramebufferColor(float p_147604_1_, float p_147604_2_, float p_147604_3_, float p_147604_4_) + { + this.framebufferColor[0] = p_147604_1_; + this.framebufferColor[1] = p_147604_2_; + this.framebufferColor[2] = p_147604_3_; + this.framebufferColor[3] = p_147604_4_; + } + + public void framebufferRender(int p_147615_1_, int p_147615_2_) + { + this.framebufferRenderExt(p_147615_1_, p_147615_2_, true); + } + + public void framebufferRenderExt(int p_178038_1_, int p_178038_2_, boolean p_178038_3_) + { + if (OpenGlHelper.isFramebufferEnabled()) + { + GlStateManager.colorMask(true, true, true, false); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.matrixMode(5889); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double)p_178038_1_, (double)p_178038_2_, 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + GlStateManager.viewport(0, 0, p_178038_1_, p_178038_2_); + GlStateManager.enableTexture2D(); + GlStateManager.disableLighting(); + GlStateManager.disableAlpha(); + + if (p_178038_3_) + { + GlStateManager.disableBlend(); + GlStateManager.enableColorMaterial(); + } + + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.bindFramebufferTexture(); + float f = (float)p_178038_1_; + float f1 = (float)p_178038_2_; + float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth; + float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex(); + tessellator.draw(); + this.unbindFramebufferTexture(); + GlStateManager.depthMask(true); + GlStateManager.colorMask(true, true, true, true); + } + } + + public void framebufferClear() + { + this.bindFramebuffer(true); + GlStateManager.clearColor(this.framebufferColor[0], this.framebufferColor[1], this.framebufferColor[2], this.framebufferColor[3]); + int i = 16384; + + if (this.useDepth) + { + GlStateManager.clearDepth(1.0D); + i |= 256; + } + + GlStateManager.clear(i); + this.unbindFramebuffer(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/Shader.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/Shader.java new file mode 100644 index 0000000..a96fb03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/Shader.java @@ -0,0 +1,117 @@ +package net.minecraft.client.shader; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import org.lwjgl.util.vector.Matrix4f; + +public class Shader +{ + private final ShaderManager manager; + public final Framebuffer framebufferIn; + public final Framebuffer framebufferOut; + private final List listAuxFramebuffers = Lists.newArrayList(); + private final List listAuxNames = Lists.newArrayList(); + private final List listAuxWidths = Lists.newArrayList(); + private final List listAuxHeights = Lists.newArrayList(); + private Matrix4f projectionMatrix; + + public Shader(IResourceManager p_i45089_1_, String p_i45089_2_, Framebuffer p_i45089_3_, Framebuffer p_i45089_4_) throws JsonException, IOException + { + this.manager = new ShaderManager(p_i45089_1_, p_i45089_2_); + this.framebufferIn = p_i45089_3_; + this.framebufferOut = p_i45089_4_; + } + + public void deleteShader() + { + this.manager.deleteShader(); + } + + public void addAuxFramebuffer(String p_148041_1_, Object p_148041_2_, int p_148041_3_, int p_148041_4_) + { + this.listAuxNames.add(this.listAuxNames.size(), p_148041_1_); + this.listAuxFramebuffers.add(this.listAuxFramebuffers.size(), p_148041_2_); + this.listAuxWidths.add(this.listAuxWidths.size(), Integer.valueOf(p_148041_3_)); + this.listAuxHeights.add(this.listAuxHeights.size(), Integer.valueOf(p_148041_4_)); + } + + private void preLoadShader() + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.disableDepth(); + GlStateManager.disableAlpha(); + GlStateManager.disableFog(); + GlStateManager.disableLighting(); + GlStateManager.disableColorMaterial(); + GlStateManager.enableTexture2D(); + GlStateManager.bindTexture(0); + } + + public void setProjectionMatrix(Matrix4f p_148045_1_) + { + this.projectionMatrix = p_148045_1_; + } + + public void loadShader(float p_148042_1_) + { + this.preLoadShader(); + this.framebufferIn.unbindFramebuffer(); + float f = (float)this.framebufferOut.framebufferTextureWidth; + float f1 = (float)this.framebufferOut.framebufferTextureHeight; + GlStateManager.viewport(0, 0, (int)f, (int)f1); + this.manager.addSamplerTexture("DiffuseSampler", this.framebufferIn); + + for (int i = 0; i < this.listAuxFramebuffers.size(); ++i) + { + this.manager.addSamplerTexture((String)this.listAuxNames.get(i), this.listAuxFramebuffers.get(i)); + this.manager.getShaderUniformOrDefault("AuxSize" + i).set((float)((Integer)this.listAuxWidths.get(i)).intValue(), (float)((Integer)this.listAuxHeights.get(i)).intValue()); + } + + this.manager.getShaderUniformOrDefault("ProjMat").set(this.projectionMatrix); + this.manager.getShaderUniformOrDefault("InSize").set((float)this.framebufferIn.framebufferTextureWidth, (float)this.framebufferIn.framebufferTextureHeight); + this.manager.getShaderUniformOrDefault("OutSize").set(f, f1); + this.manager.getShaderUniformOrDefault("Time").set(p_148042_1_); + Minecraft minecraft = Minecraft.getMinecraft(); + this.manager.getShaderUniformOrDefault("ScreenSize").set((float)minecraft.displayWidth, (float)minecraft.displayHeight); + this.manager.useShader(); + this.framebufferOut.framebufferClear(); + this.framebufferOut.bindFramebuffer(false); + GlStateManager.depthMask(false); + GlStateManager.colorMask(true, true, true, true); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(0.0D, (double)f1, 500.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double)f, (double)f1, 500.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double)f, 0.0D, 500.0D).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 500.0D).color(255, 255, 255, 255).endVertex(); + tessellator.draw(); + GlStateManager.depthMask(true); + GlStateManager.colorMask(true, true, true, true); + this.manager.endShader(); + this.framebufferOut.unbindFramebuffer(); + this.framebufferIn.unbindFramebufferTexture(); + + for (Object object : this.listAuxFramebuffers) + { + if (object instanceof Framebuffer) + { + ((Framebuffer)object).unbindFramebufferTexture(); + } + } + } + + public ShaderManager getShaderManager() + { + return this.manager; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderDefault.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderDefault.java new file mode 100644 index 0000000..67c7e57 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderDefault.java @@ -0,0 +1,47 @@ +package net.minecraft.client.shader; + +import org.lwjgl.util.vector.Matrix4f; + +public class ShaderDefault extends ShaderUniform +{ + public ShaderDefault() + { + super("dummy", 4, 1, (ShaderManager)null); + } + + public void set(float p_148090_1_) + { + } + + public void set(float p_148087_1_, float p_148087_2_) + { + } + + public void set(float p_148095_1_, float p_148095_2_, float p_148095_3_) + { + } + + public void set(float p_148081_1_, float p_148081_2_, float p_148081_3_, float p_148081_4_) + { + } + + public void func_148092_b(float p_148092_1_, float p_148092_2_, float p_148092_3_, float p_148092_4_) + { + } + + public void set(int p_148083_1_, int p_148083_2_, int p_148083_3_, int p_148083_4_) + { + } + + public void set(float[] p_148097_1_) + { + } + + public void set(float p_148094_1_, float p_148094_2_, float p_148094_3_, float p_148094_4_, float p_148094_5_, float p_148094_6_, float p_148094_7_, float p_148094_8_, float p_148094_9_, float p_148094_10_, float p_148094_11_, float p_148094_12_, float p_148094_13_, float p_148094_14_, float p_148094_15_, float p_148094_16_) + { + } + + public void set(Matrix4f p_148088_1_) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderGroup.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderGroup.java new file mode 100644 index 0000000..0ca766a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderGroup.java @@ -0,0 +1,409 @@ +package net.minecraft.client.shader; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.JsonSyntaxException; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +import lombok.Getter; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.vector.Matrix4f; + +public class ShaderGroup +{ + private Framebuffer mainFramebuffer; + private IResourceManager resourceManager; + private String shaderGroupName; + @Getter private final List listShaders = Lists.newArrayList(); + private final Map mapFramebuffers = Maps.newHashMap(); + private final List listFramebuffers = Lists.newArrayList(); + private Matrix4f projectionMatrix; + private int mainFramebufferWidth; + private int mainFramebufferHeight; + private float field_148036_j; + private float field_148037_k; + + public ShaderGroup(TextureManager p_i1050_1_, IResourceManager p_i1050_2_, Framebuffer p_i1050_3_, ResourceLocation p_i1050_4_) throws JsonException, IOException, JsonSyntaxException + { + this.resourceManager = p_i1050_2_; + this.mainFramebuffer = p_i1050_3_; + this.field_148036_j = 0.0F; + this.field_148037_k = 0.0F; + this.mainFramebufferWidth = p_i1050_3_.framebufferWidth; + this.mainFramebufferHeight = p_i1050_3_.framebufferHeight; + this.shaderGroupName = p_i1050_4_.toString(); + this.resetProjectionMatrix(); + this.parseGroup(p_i1050_1_, p_i1050_4_); + } + + public void parseGroup(TextureManager p_152765_1_, ResourceLocation p_152765_2_) throws JsonException, IOException, JsonSyntaxException + { + JsonParser jsonparser = new JsonParser(); + InputStream inputstream = null; + + try + { + IResource iresource = this.resourceManager.getResource(p_152765_2_); + inputstream = iresource.getInputStream(); + JsonObject jsonobject = jsonparser.parse(IOUtils.toString(inputstream, Charsets.UTF_8)).getAsJsonObject(); + + if (JsonUtils.isJsonArray(jsonobject, "targets")) + { + JsonArray jsonarray = jsonobject.getAsJsonArray("targets"); + int i = 0; + + for (JsonElement jsonelement : jsonarray) + { + try + { + this.initTarget(jsonelement); + } + catch (Exception exception1) + { + JsonException jsonexception1 = JsonException.func_151379_a(exception1); + jsonexception1.func_151380_a("targets[" + i + "]"); + throw jsonexception1; + } + + ++i; + } + } + + if (JsonUtils.isJsonArray(jsonobject, "passes")) + { + JsonArray jsonarray1 = jsonobject.getAsJsonArray("passes"); + int j = 0; + + for (JsonElement jsonelement1 : jsonarray1) + { + try + { + this.parsePass(p_152765_1_, jsonelement1); + } + catch (Exception exception) + { + JsonException jsonexception2 = JsonException.func_151379_a(exception); + jsonexception2.func_151380_a("passes[" + j + "]"); + throw jsonexception2; + } + + ++j; + } + } + } + catch (Exception exception2) + { + JsonException jsonexception = JsonException.func_151379_a(exception2); + jsonexception.func_151381_b(p_152765_2_.getResourcePath()); + throw jsonexception; + } + finally + { + IOUtils.closeQuietly(inputstream); + } + } + + private void initTarget(JsonElement p_148027_1_) throws JsonException + { + if (JsonUtils.isString(p_148027_1_)) + { + this.addFramebuffer(p_148027_1_.getAsString(), this.mainFramebufferWidth, this.mainFramebufferHeight); + } + else + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_148027_1_, "target"); + String s = JsonUtils.getString(jsonobject, "name"); + int i = JsonUtils.getInt(jsonobject, "width", this.mainFramebufferWidth); + int j = JsonUtils.getInt(jsonobject, "height", this.mainFramebufferHeight); + + if (this.mapFramebuffers.containsKey(s)) + { + throw new JsonException(s + " is already defined"); + } + + this.addFramebuffer(s, i, j); + } + } + + private void parsePass(TextureManager p_152764_1_, JsonElement p_152764_2_) throws JsonException, IOException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_152764_2_, "pass"); + String s = JsonUtils.getString(jsonobject, "name"); + String s1 = JsonUtils.getString(jsonobject, "intarget"); + String s2 = JsonUtils.getString(jsonobject, "outtarget"); + Framebuffer framebuffer = this.getFramebuffer(s1); + Framebuffer framebuffer1 = this.getFramebuffer(s2); + + if (framebuffer == null) + { + throw new JsonException("Input target \'" + s1 + "\' does not exist"); + } + else if (framebuffer1 == null) + { + throw new JsonException("Output target \'" + s2 + "\' does not exist"); + } + else + { + Shader shader = this.addShader(s, framebuffer, framebuffer1); + JsonArray jsonarray = JsonUtils.getJsonArray(jsonobject, "auxtargets", (JsonArray)null); + + if (jsonarray != null) + { + int i = 0; + + for (JsonElement jsonelement : jsonarray) + { + try + { + JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonelement, "auxtarget"); + String s4 = JsonUtils.getString(jsonobject1, "name"); + String s3 = JsonUtils.getString(jsonobject1, "id"); + Framebuffer framebuffer2 = this.getFramebuffer(s3); + + if (framebuffer2 == null) + { + ResourceLocation resourcelocation = new ResourceLocation("textures/effect/" + s3 + ".png"); + + try + { + this.resourceManager.getResource(resourcelocation); + } + catch (FileNotFoundException var24) + { + throw new JsonException("Render target or texture \'" + s3 + "\' does not exist"); + } + + p_152764_1_.bindTexture(resourcelocation); + ITextureObject itextureobject = p_152764_1_.getTexture(resourcelocation); + int j = JsonUtils.getInt(jsonobject1, "width"); + int k = JsonUtils.getInt(jsonobject1, "height"); + boolean flag = JsonUtils.getBoolean(jsonobject1, "bilinear"); + + if (flag) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + } + else + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + } + + shader.addAuxFramebuffer(s4, Integer.valueOf(itextureobject.getGlTextureId()), j, k); + } + else + { + shader.addAuxFramebuffer(s4, framebuffer2, framebuffer2.framebufferTextureWidth, framebuffer2.framebufferTextureHeight); + } + } + catch (Exception exception1) + { + JsonException jsonexception = JsonException.func_151379_a(exception1); + jsonexception.func_151380_a("auxtargets[" + i + "]"); + throw jsonexception; + } + + ++i; + } + } + + JsonArray jsonarray1 = JsonUtils.getJsonArray(jsonobject, "uniforms", (JsonArray)null); + + if (jsonarray1 != null) + { + int l = 0; + + for (JsonElement jsonelement1 : jsonarray1) + { + try + { + this.initUniform(jsonelement1); + } + catch (Exception exception) + { + JsonException jsonexception1 = JsonException.func_151379_a(exception); + jsonexception1.func_151380_a("uniforms[" + l + "]"); + throw jsonexception1; + } + + ++l; + } + } + } + } + + private void initUniform(JsonElement p_148028_1_) throws JsonException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_148028_1_, "uniform"); + String s = JsonUtils.getString(jsonobject, "name"); + ShaderUniform shaderuniform = ((Shader)this.listShaders.get(this.listShaders.size() - 1)).getShaderManager().getShaderUniform(s); + + if (shaderuniform == null) + { + throw new JsonException("Uniform \'" + s + "\' does not exist"); + } + else + { + float[] afloat = new float[4]; + int i = 0; + + for (JsonElement jsonelement : JsonUtils.getJsonArray(jsonobject, "values")) + { + try + { + afloat[i] = JsonUtils.getFloat(jsonelement, "value"); + } + catch (Exception exception) + { + JsonException jsonexception = JsonException.func_151379_a(exception); + jsonexception.func_151380_a("values[" + i + "]"); + throw jsonexception; + } + + ++i; + } + + switch (i) + { + case 0: + default: + break; + + case 1: + shaderuniform.set(afloat[0]); + break; + + case 2: + shaderuniform.set(afloat[0], afloat[1]); + break; + + case 3: + shaderuniform.set(afloat[0], afloat[1], afloat[2]); + break; + + case 4: + shaderuniform.set(afloat[0], afloat[1], afloat[2], afloat[3]); + } + } + } + + public Framebuffer getFramebufferRaw(String p_177066_1_) + { + return (Framebuffer)this.mapFramebuffers.get(p_177066_1_); + } + + public void addFramebuffer(String p_148020_1_, int p_148020_2_, int p_148020_3_) + { + Framebuffer framebuffer = new Framebuffer(p_148020_2_, p_148020_3_, true); + framebuffer.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F); + this.mapFramebuffers.put(p_148020_1_, framebuffer); + + if (p_148020_2_ == this.mainFramebufferWidth && p_148020_3_ == this.mainFramebufferHeight) + { + this.listFramebuffers.add(framebuffer); + } + } + + public void deleteShaderGroup() + { + for (Framebuffer framebuffer : this.mapFramebuffers.values()) + { + framebuffer.deleteFramebuffer(); + } + + for (Shader shader : this.listShaders) + { + shader.deleteShader(); + } + + this.listShaders.clear(); + } + + public Shader addShader(String p_148023_1_, Framebuffer p_148023_2_, Framebuffer p_148023_3_) throws JsonException, IOException + { + Shader shader = new Shader(this.resourceManager, p_148023_1_, p_148023_2_, p_148023_3_); + this.listShaders.add(this.listShaders.size(), shader); + return shader; + } + + private void resetProjectionMatrix() + { + this.projectionMatrix = new Matrix4f(); + this.projectionMatrix.setIdentity(); + this.projectionMatrix.m00 = 2.0F / (float)this.mainFramebuffer.framebufferTextureWidth; + this.projectionMatrix.m11 = 2.0F / (float)(-this.mainFramebuffer.framebufferTextureHeight); + this.projectionMatrix.m22 = -0.0020001999F; + this.projectionMatrix.m33 = 1.0F; + this.projectionMatrix.m03 = -1.0F; + this.projectionMatrix.m13 = 1.0F; + this.projectionMatrix.m23 = -1.0001999F; + } + + public void createBindFramebuffers(int width, int height) + { + this.mainFramebufferWidth = this.mainFramebuffer.framebufferTextureWidth; + this.mainFramebufferHeight = this.mainFramebuffer.framebufferTextureHeight; + this.resetProjectionMatrix(); + + for (Shader shader : this.listShaders) + { + shader.setProjectionMatrix(this.projectionMatrix); + } + + for (Framebuffer framebuffer : this.listFramebuffers) + { + framebuffer.createBindFramebuffer(width, height); + } + } + + public void loadShaderGroup(float partialTicks) + { + if (partialTicks < this.field_148037_k) + { + this.field_148036_j += 1.0F - this.field_148037_k; + this.field_148036_j += partialTicks; + } + else + { + this.field_148036_j += partialTicks - this.field_148037_k; + } + + for (this.field_148037_k = partialTicks; this.field_148036_j > 20.0F; this.field_148036_j -= 20.0F) + { + ; + } + + for (Shader shader : this.listShaders) + { + shader.loadShader(this.field_148036_j / 20.0F); + } + } + + public final String getShaderGroupName() + { + return this.shaderGroupName; + } + + private Framebuffer getFramebuffer(String p_148017_1_) + { + return p_148017_1_ == null ? null : (p_148017_1_.equals("minecraft:main") ? this.mainFramebuffer : (Framebuffer)this.mapFramebuffers.get(p_148017_1_)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderLinkHelper.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderLinkHelper.java new file mode 100644 index 0000000..a58a849 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderLinkHelper.java @@ -0,0 +1,58 @@ +package net.minecraft.client.shader; + +import java.io.IOException; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.util.JsonException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ShaderLinkHelper +{ + private static final Logger logger = LogManager.getLogger(); + private static ShaderLinkHelper staticShaderLinkHelper; + + public static void setNewStaticShaderLinkHelper() + { + staticShaderLinkHelper = new ShaderLinkHelper(); + } + + public static ShaderLinkHelper getStaticShaderLinkHelper() + { + return staticShaderLinkHelper; + } + + public void deleteShader(ShaderManager p_148077_1_) + { + p_148077_1_.getFragmentShaderLoader().deleteShader(p_148077_1_); + p_148077_1_.getVertexShaderLoader().deleteShader(p_148077_1_); + OpenGlHelper.glDeleteProgram(p_148077_1_.getProgram()); + } + + public int createProgram() throws JsonException + { + int i = OpenGlHelper.glCreateProgram(); + + if (i <= 0) + { + throw new JsonException("Could not create shader program (returned program ID " + i + ")"); + } + else + { + return i; + } + } + + public void linkProgram(ShaderManager manager) throws IOException + { + manager.getFragmentShaderLoader().attachShader(manager); + manager.getVertexShaderLoader().attachShader(manager); + OpenGlHelper.glLinkProgram(manager.getProgram()); + int i = OpenGlHelper.glGetProgrami(manager.getProgram(), OpenGlHelper.GL_LINK_STATUS); + + if (i == 0) + { + logger.warn("Error encountered when linking program containing VS " + manager.getVertexShaderLoader().getShaderFilename() + " and FS " + manager.getFragmentShaderLoader().getShaderFilename() + ". Log output:"); + logger.warn(OpenGlHelper.glGetProgramInfoLog(manager.getProgram(), 32768)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderLoader.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderLoader.java new file mode 100644 index 0000000..3aeef77 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderLoader.java @@ -0,0 +1,137 @@ +package net.minecraft.client.shader; + +import com.google.common.collect.Maps; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.Map; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.lwjgl.BufferUtils; + +public class ShaderLoader +{ + private final ShaderLoader.ShaderType shaderType; + private final String shaderFilename; + private int shader; + private int shaderAttachCount = 0; + + private ShaderLoader(ShaderLoader.ShaderType type, int shaderId, String filename) + { + this.shaderType = type; + this.shader = shaderId; + this.shaderFilename = filename; + } + + public void attachShader(ShaderManager manager) + { + ++this.shaderAttachCount; + OpenGlHelper.glAttachShader(manager.getProgram(), this.shader); + } + + public void deleteShader(ShaderManager manager) + { + --this.shaderAttachCount; + + if (this.shaderAttachCount <= 0) + { + OpenGlHelper.glDeleteShader(this.shader); + this.shaderType.getLoadedShaders().remove(this.shaderFilename); + } + } + + public String getShaderFilename() + { + return this.shaderFilename; + } + + public static ShaderLoader loadShader(IResourceManager resourceManager, ShaderLoader.ShaderType type, String filename) throws IOException + { + ShaderLoader shaderloader = (ShaderLoader)type.getLoadedShaders().get(filename); + + if (shaderloader == null) + { + ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + filename + type.getShaderExtension()); + BufferedInputStream bufferedinputstream = new BufferedInputStream(resourceManager.getResource(resourcelocation).getInputStream()); + byte[] abyte = toByteArray(bufferedinputstream); + ByteBuffer bytebuffer = BufferUtils.createByteBuffer(abyte.length); + bytebuffer.put(abyte); + bytebuffer.position(0); + int i = OpenGlHelper.glCreateShader(type.getShaderMode()); + OpenGlHelper.glShaderSource(i, bytebuffer); + OpenGlHelper.glCompileShader(i); + + if (OpenGlHelper.glGetShaderi(i, OpenGlHelper.GL_COMPILE_STATUS) == 0) + { + String s = StringUtils.trim(OpenGlHelper.glGetShaderInfoLog(i, 32768)); + JsonException jsonexception = new JsonException("Couldn\'t compile " + type.getShaderName() + " program: " + s); + jsonexception.func_151381_b(resourcelocation.getResourcePath()); + throw jsonexception; + } + + shaderloader = new ShaderLoader(type, i, filename); + type.getLoadedShaders().put(filename, shaderloader); + } + + return shaderloader; + } + + protected static byte[] toByteArray(BufferedInputStream p_177064_0_) throws IOException + { + byte[] abyte; + + try + { + abyte = IOUtils.toByteArray((InputStream)p_177064_0_); + } + finally + { + p_177064_0_.close(); + } + + return abyte; + } + + public static enum ShaderType + { + VERTEX("vertex", ".vsh", OpenGlHelper.GL_VERTEX_SHADER), + FRAGMENT("fragment", ".fsh", OpenGlHelper.GL_FRAGMENT_SHADER); + + private final String shaderName; + private final String shaderExtension; + private final int shaderMode; + private final Map loadedShaders = Maps.newHashMap(); + + private ShaderType(String p_i45090_3_, String p_i45090_4_, int p_i45090_5_) + { + this.shaderName = p_i45090_3_; + this.shaderExtension = p_i45090_4_; + this.shaderMode = p_i45090_5_; + } + + public String getShaderName() + { + return this.shaderName; + } + + protected String getShaderExtension() + { + return this.shaderExtension; + } + + protected int getShaderMode() + { + return this.shaderMode; + } + + protected Map getLoadedShaders() + { + return this.loadedShaders; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderManager.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderManager.java new file mode 100644 index 0000000..8116fb9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderManager.java @@ -0,0 +1,408 @@ +package net.minecraft.client.shader; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonBlendingMode; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ShaderManager +{ + private static final Logger logger = LogManager.getLogger(); + private static final ShaderDefault defaultShaderUniform = new ShaderDefault(); + private static ShaderManager staticShaderManager = null; + private static int currentProgram = -1; + private static boolean field_148000_e = true; + private final Map shaderSamplers = Maps.newHashMap(); + private final List samplerNames = Lists.newArrayList(); + private final List shaderSamplerLocations = Lists.newArrayList(); + private final List shaderUniforms = Lists.newArrayList(); + private final List shaderUniformLocations = Lists.newArrayList(); + private final Map mappedShaderUniforms = Maps.newHashMap(); + private final int program; + private final String programFilename; + private final boolean useFaceCulling; + private boolean isDirty; + private final JsonBlendingMode field_148016_p; + private final List attribLocations; + private final List attributes; + private final ShaderLoader vertexShaderLoader; + private final ShaderLoader fragmentShaderLoader; + + public ShaderManager(IResourceManager resourceManager, String programName) throws JsonException, IOException + { + JsonParser jsonparser = new JsonParser(); + ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + programName + ".json"); + this.programFilename = programName; + InputStream inputstream = null; + + try + { + inputstream = resourceManager.getResource(resourcelocation).getInputStream(); + JsonObject jsonobject = jsonparser.parse(IOUtils.toString(inputstream, Charsets.UTF_8)).getAsJsonObject(); + String s = JsonUtils.getString(jsonobject, "vertex"); + String s1 = JsonUtils.getString(jsonobject, "fragment"); + JsonArray jsonarray = JsonUtils.getJsonArray(jsonobject, "samplers", (JsonArray)null); + + if (jsonarray != null) + { + int i = 0; + + for (JsonElement jsonelement : jsonarray) + { + try + { + this.parseSampler(jsonelement); + } + catch (Exception exception2) + { + JsonException jsonexception1 = JsonException.func_151379_a(exception2); + jsonexception1.func_151380_a("samplers[" + i + "]"); + throw jsonexception1; + } + + ++i; + } + } + + JsonArray jsonarray1 = JsonUtils.getJsonArray(jsonobject, "attributes", (JsonArray)null); + + if (jsonarray1 != null) + { + int j = 0; + this.attribLocations = Lists.newArrayListWithCapacity(jsonarray1.size()); + this.attributes = Lists.newArrayListWithCapacity(jsonarray1.size()); + + for (JsonElement jsonelement1 : jsonarray1) + { + try + { + this.attributes.add(JsonUtils.getString(jsonelement1, "attribute")); + } + catch (Exception exception1) + { + JsonException jsonexception2 = JsonException.func_151379_a(exception1); + jsonexception2.func_151380_a("attributes[" + j + "]"); + throw jsonexception2; + } + + ++j; + } + } + else + { + this.attribLocations = null; + this.attributes = null; + } + + JsonArray jsonarray2 = JsonUtils.getJsonArray(jsonobject, "uniforms", (JsonArray)null); + + if (jsonarray2 != null) + { + int k = 0; + + for (JsonElement jsonelement2 : jsonarray2) + { + try + { + this.parseUniform(jsonelement2); + } + catch (Exception exception) + { + JsonException jsonexception3 = JsonException.func_151379_a(exception); + jsonexception3.func_151380_a("uniforms[" + k + "]"); + throw jsonexception3; + } + + ++k; + } + } + + this.field_148016_p = JsonBlendingMode.func_148110_a(JsonUtils.getJsonObject(jsonobject, "blend", (JsonObject)null)); + this.useFaceCulling = JsonUtils.getBoolean(jsonobject, "cull", true); + this.vertexShaderLoader = ShaderLoader.loadShader(resourceManager, ShaderLoader.ShaderType.VERTEX, s); + this.fragmentShaderLoader = ShaderLoader.loadShader(resourceManager, ShaderLoader.ShaderType.FRAGMENT, s1); + this.program = ShaderLinkHelper.getStaticShaderLinkHelper().createProgram(); + ShaderLinkHelper.getStaticShaderLinkHelper().linkProgram(this); + this.setupUniforms(); + + if (this.attributes != null) + { + for (String s2 : this.attributes) + { + int l = OpenGlHelper.glGetAttribLocation(this.program, s2); + this.attribLocations.add(Integer.valueOf(l)); + } + } + } + catch (Exception exception3) + { + JsonException jsonexception = JsonException.func_151379_a(exception3); + jsonexception.func_151381_b(resourcelocation.getResourcePath()); + throw jsonexception; + } + finally + { + IOUtils.closeQuietly(inputstream); + } + + this.markDirty(); + } + + public void deleteShader() + { + ShaderLinkHelper.getStaticShaderLinkHelper().deleteShader(this); + } + + public void endShader() + { + OpenGlHelper.glUseProgram(0); + currentProgram = -1; + staticShaderManager = null; + field_148000_e = true; + + for (int i = 0; i < this.shaderSamplerLocations.size(); ++i) + { + if (this.shaderSamplers.get(this.samplerNames.get(i)) != null) + { + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i); + GlStateManager.bindTexture(0); + } + } + } + + public void useShader() + { + this.isDirty = false; + staticShaderManager = this; + this.field_148016_p.func_148109_a(); + + if (this.program != currentProgram) + { + OpenGlHelper.glUseProgram(this.program); + currentProgram = this.program; + } + + if (this.useFaceCulling) + { + GlStateManager.enableCull(); + } + else + { + GlStateManager.disableCull(); + } + + for (int i = 0; i < this.shaderSamplerLocations.size(); ++i) + { + if (this.shaderSamplers.get(this.samplerNames.get(i)) != null) + { + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i); + GlStateManager.enableTexture2D(); + Object object = this.shaderSamplers.get(this.samplerNames.get(i)); + int j = -1; + + if (object instanceof Framebuffer) + { + j = ((Framebuffer)object).framebufferTexture; + } + else if (object instanceof ITextureObject) + { + j = ((ITextureObject)object).getGlTextureId(); + } + else if (object instanceof Integer) + { + j = ((Integer)object).intValue(); + } + + if (j != -1) + { + GlStateManager.bindTexture(j); + OpenGlHelper.glUniform1i(OpenGlHelper.glGetUniformLocation(this.program, (CharSequence)this.samplerNames.get(i)), i); + } + } + } + + for (ShaderUniform shaderuniform : this.shaderUniforms) + { + shaderuniform.upload(); + } + } + + public void markDirty() + { + this.isDirty = true; + } + + public ShaderUniform getShaderUniform(String p_147991_1_) + { + return this.mappedShaderUniforms.containsKey(p_147991_1_) ? (ShaderUniform)this.mappedShaderUniforms.get(p_147991_1_) : null; + } + + public ShaderUniform getShaderUniformOrDefault(String p_147984_1_) + { + return (ShaderUniform)(this.mappedShaderUniforms.containsKey(p_147984_1_) ? (ShaderUniform)this.mappedShaderUniforms.get(p_147984_1_) : defaultShaderUniform); + } + + private void setupUniforms() + { + int i = 0; + + for (int j = 0; i < this.samplerNames.size(); ++j) + { + String s = (String)this.samplerNames.get(i); + int k = OpenGlHelper.glGetUniformLocation(this.program, s); + + if (k == -1) + { + logger.warn("Shader " + this.programFilename + "could not find sampler named " + s + " in the specified shader program."); + this.shaderSamplers.remove(s); + this.samplerNames.remove(j); + --j; + } + else + { + this.shaderSamplerLocations.add(Integer.valueOf(k)); + } + + ++i; + } + + for (ShaderUniform shaderuniform : this.shaderUniforms) + { + String s1 = shaderuniform.getShaderName(); + int l = OpenGlHelper.glGetUniformLocation(this.program, s1); + + if (l == -1) + { + logger.warn("Could not find uniform named " + s1 + " in the specified" + " shader program."); + } + else + { + this.shaderUniformLocations.add(Integer.valueOf(l)); + shaderuniform.setUniformLocation(l); + this.mappedShaderUniforms.put(s1, shaderuniform); + } + } + } + + private void parseSampler(JsonElement p_147996_1_) throws JsonException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_147996_1_, "sampler"); + String s = JsonUtils.getString(jsonobject, "name"); + + if (!JsonUtils.isString(jsonobject, "file")) + { + this.shaderSamplers.put(s, (Object)null); + this.samplerNames.add(s); + } + else + { + this.samplerNames.add(s); + } + } + + public void addSamplerTexture(String p_147992_1_, Object p_147992_2_) + { + if (this.shaderSamplers.containsKey(p_147992_1_)) + { + this.shaderSamplers.remove(p_147992_1_); + } + + this.shaderSamplers.put(p_147992_1_, p_147992_2_); + this.markDirty(); + } + + private void parseUniform(JsonElement p_147987_1_) throws JsonException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_147987_1_, "uniform"); + String s = JsonUtils.getString(jsonobject, "name"); + int i = ShaderUniform.parseType(JsonUtils.getString(jsonobject, "type")); + int j = JsonUtils.getInt(jsonobject, "count"); + float[] afloat = new float[Math.max(j, 16)]; + JsonArray jsonarray = JsonUtils.getJsonArray(jsonobject, "values"); + + if (jsonarray.size() != j && jsonarray.size() > 1) + { + throw new JsonException("Invalid amount of values specified (expected " + j + ", found " + jsonarray.size() + ")"); + } + else + { + int k = 0; + + for (JsonElement jsonelement : jsonarray) + { + try + { + afloat[k] = JsonUtils.getFloat(jsonelement, "value"); + } + catch (Exception exception) + { + JsonException jsonexception = JsonException.func_151379_a(exception); + jsonexception.func_151380_a("values[" + k + "]"); + throw jsonexception; + } + + ++k; + } + + if (j > 1 && jsonarray.size() == 1) + { + while (k < j) + { + afloat[k] = afloat[0]; + ++k; + } + } + + int l = j > 1 && j <= 4 && i < 8 ? j - 1 : 0; + ShaderUniform shaderuniform = new ShaderUniform(s, i + l, j, this); + + if (i <= 3) + { + shaderuniform.set((int)afloat[0], (int)afloat[1], (int)afloat[2], (int)afloat[3]); + } + else if (i <= 7) + { + shaderuniform.func_148092_b(afloat[0], afloat[1], afloat[2], afloat[3]); + } + else + { + shaderuniform.set(afloat); + } + + this.shaderUniforms.add(shaderuniform); + } + } + + public ShaderLoader getVertexShaderLoader() + { + return this.vertexShaderLoader; + } + + public ShaderLoader getFragmentShaderLoader() + { + return this.fragmentShaderLoader; + } + + public int getProgram() + { + return this.program; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderUniform.java b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderUniform.java new file mode 100644 index 0000000..9a09436 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/shader/ShaderUniform.java @@ -0,0 +1,322 @@ +package net.minecraft.client.shader; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import net.minecraft.client.renderer.OpenGlHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; +import org.lwjgl.util.vector.Matrix4f; + +public class ShaderUniform +{ + private static final Logger logger = LogManager.getLogger(); + private int uniformLocation; + private final int uniformCount; + private final int uniformType; + private final IntBuffer uniformIntBuffer; + private final FloatBuffer uniformFloatBuffer; + private final String shaderName; + private boolean dirty; + private final ShaderManager shaderManager; + + public ShaderUniform(String name, int type, int count, ShaderManager manager) + { + this.shaderName = name; + this.uniformCount = count; + this.uniformType = type; + this.shaderManager = manager; + + if (type <= 3) + { + this.uniformIntBuffer = BufferUtils.createIntBuffer(count); + this.uniformFloatBuffer = null; + } + else + { + this.uniformIntBuffer = null; + this.uniformFloatBuffer = BufferUtils.createFloatBuffer(count); + } + + this.uniformLocation = -1; + this.markDirty(); + } + + private void markDirty() + { + this.dirty = true; + + if (this.shaderManager != null) + { + this.shaderManager.markDirty(); + } + } + + public static int parseType(String p_148085_0_) + { + int i = -1; + + if (p_148085_0_.equals("int")) + { + i = 0; + } + else if (p_148085_0_.equals("float")) + { + i = 4; + } + else if (p_148085_0_.startsWith("matrix")) + { + if (p_148085_0_.endsWith("2x2")) + { + i = 8; + } + else if (p_148085_0_.endsWith("3x3")) + { + i = 9; + } + else if (p_148085_0_.endsWith("4x4")) + { + i = 10; + } + } + + return i; + } + + public void setUniformLocation(int p_148084_1_) + { + this.uniformLocation = p_148084_1_; + } + + public String getShaderName() + { + return this.shaderName; + } + + public void set(float p_148090_1_) + { + this.uniformFloatBuffer.position(0); + this.uniformFloatBuffer.put(0, p_148090_1_); + this.markDirty(); + } + + public void set(float p_148087_1_, float p_148087_2_) + { + this.uniformFloatBuffer.position(0); + this.uniformFloatBuffer.put(0, p_148087_1_); + this.uniformFloatBuffer.put(1, p_148087_2_); + this.markDirty(); + } + + public void set(float p_148095_1_, float p_148095_2_, float p_148095_3_) + { + this.uniformFloatBuffer.position(0); + this.uniformFloatBuffer.put(0, p_148095_1_); + this.uniformFloatBuffer.put(1, p_148095_2_); + this.uniformFloatBuffer.put(2, p_148095_3_); + this.markDirty(); + } + + public void set(float p_148081_1_, float p_148081_2_, float p_148081_3_, float p_148081_4_) + { + this.uniformFloatBuffer.position(0); + this.uniformFloatBuffer.put(p_148081_1_); + this.uniformFloatBuffer.put(p_148081_2_); + this.uniformFloatBuffer.put(p_148081_3_); + this.uniformFloatBuffer.put(p_148081_4_); + this.uniformFloatBuffer.flip(); + this.markDirty(); + } + + public void func_148092_b(float p_148092_1_, float p_148092_2_, float p_148092_3_, float p_148092_4_) + { + this.uniformFloatBuffer.position(0); + + if (this.uniformType >= 4) + { + this.uniformFloatBuffer.put(0, p_148092_1_); + } + + if (this.uniformType >= 5) + { + this.uniformFloatBuffer.put(1, p_148092_2_); + } + + if (this.uniformType >= 6) + { + this.uniformFloatBuffer.put(2, p_148092_3_); + } + + if (this.uniformType >= 7) + { + this.uniformFloatBuffer.put(3, p_148092_4_); + } + + this.markDirty(); + } + + public void set(int p_148083_1_, int p_148083_2_, int p_148083_3_, int p_148083_4_) + { + this.uniformIntBuffer.position(0); + + if (this.uniformType >= 0) + { + this.uniformIntBuffer.put(0, p_148083_1_); + } + + if (this.uniformType >= 1) + { + this.uniformIntBuffer.put(1, p_148083_2_); + } + + if (this.uniformType >= 2) + { + this.uniformIntBuffer.put(2, p_148083_3_); + } + + if (this.uniformType >= 3) + { + this.uniformIntBuffer.put(3, p_148083_4_); + } + + this.markDirty(); + } + + public void set(float[] p_148097_1_) + { + if (p_148097_1_.length < this.uniformCount) + { + logger.warn("Uniform.set called with a too-small value array (expected " + this.uniformCount + ", got " + p_148097_1_.length + "). Ignoring."); + } + else + { + this.uniformFloatBuffer.position(0); + this.uniformFloatBuffer.put(p_148097_1_); + this.uniformFloatBuffer.position(0); + this.markDirty(); + } + } + + public void set(float p_148094_1_, float p_148094_2_, float p_148094_3_, float p_148094_4_, float p_148094_5_, float p_148094_6_, float p_148094_7_, float p_148094_8_, float p_148094_9_, float p_148094_10_, float p_148094_11_, float p_148094_12_, float p_148094_13_, float p_148094_14_, float p_148094_15_, float p_148094_16_) + { + this.uniformFloatBuffer.position(0); + this.uniformFloatBuffer.put(0, p_148094_1_); + this.uniformFloatBuffer.put(1, p_148094_2_); + this.uniformFloatBuffer.put(2, p_148094_3_); + this.uniformFloatBuffer.put(3, p_148094_4_); + this.uniformFloatBuffer.put(4, p_148094_5_); + this.uniformFloatBuffer.put(5, p_148094_6_); + this.uniformFloatBuffer.put(6, p_148094_7_); + this.uniformFloatBuffer.put(7, p_148094_8_); + this.uniformFloatBuffer.put(8, p_148094_9_); + this.uniformFloatBuffer.put(9, p_148094_10_); + this.uniformFloatBuffer.put(10, p_148094_11_); + this.uniformFloatBuffer.put(11, p_148094_12_); + this.uniformFloatBuffer.put(12, p_148094_13_); + this.uniformFloatBuffer.put(13, p_148094_14_); + this.uniformFloatBuffer.put(14, p_148094_15_); + this.uniformFloatBuffer.put(15, p_148094_16_); + this.markDirty(); + } + + public void set(Matrix4f p_148088_1_) + { + this.set(p_148088_1_.m00, p_148088_1_.m01, p_148088_1_.m02, p_148088_1_.m03, p_148088_1_.m10, p_148088_1_.m11, p_148088_1_.m12, p_148088_1_.m13, p_148088_1_.m20, p_148088_1_.m21, p_148088_1_.m22, p_148088_1_.m23, p_148088_1_.m30, p_148088_1_.m31, p_148088_1_.m32, p_148088_1_.m33); + } + + public void upload() + { + if (!this.dirty) + { + ; + } + + this.dirty = false; + + if (this.uniformType <= 3) + { + this.uploadInt(); + } + else if (this.uniformType <= 7) + { + this.uploadFloat(); + } + else + { + if (this.uniformType > 10) + { + logger.warn("Uniform.upload called, but type value (" + this.uniformType + ") is not " + "a valid type. Ignoring."); + return; + } + + this.uploadFloatMatrix(); + } + } + + private void uploadInt() + { + switch (this.uniformType) + { + case 0: + OpenGlHelper.glUniform1(this.uniformLocation, this.uniformIntBuffer); + break; + + case 1: + OpenGlHelper.glUniform2(this.uniformLocation, this.uniformIntBuffer); + break; + + case 2: + OpenGlHelper.glUniform3(this.uniformLocation, this.uniformIntBuffer); + break; + + case 3: + OpenGlHelper.glUniform4(this.uniformLocation, this.uniformIntBuffer); + break; + + default: + logger.warn("Uniform.upload called, but count value (" + this.uniformCount + ") is " + " not in the range of 1 to 4. Ignoring."); + } + } + + private void uploadFloat() + { + switch (this.uniformType) + { + case 4: + OpenGlHelper.glUniform1(this.uniformLocation, this.uniformFloatBuffer); + break; + + case 5: + OpenGlHelper.glUniform2(this.uniformLocation, this.uniformFloatBuffer); + break; + + case 6: + OpenGlHelper.glUniform3(this.uniformLocation, this.uniformFloatBuffer); + break; + + case 7: + OpenGlHelper.glUniform4(this.uniformLocation, this.uniformFloatBuffer); + break; + + default: + logger.warn("Uniform.upload called, but count value (" + this.uniformCount + ") is " + "not in the range of 1 to 4. Ignoring."); + } + } + + private void uploadFloatMatrix() + { + switch (this.uniformType) + { + case 8: + OpenGlHelper.glUniformMatrix2(this.uniformLocation, true, this.uniformFloatBuffer); + break; + + case 9: + OpenGlHelper.glUniformMatrix3(this.uniformLocation, true, this.uniformFloatBuffer); + break; + + case 10: + OpenGlHelper.glUniformMatrix4(this.uniformLocation, true, this.uniformFloatBuffer); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/BroadcastController.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/BroadcastController.java new file mode 100644 index 0000000..b4b9692 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/BroadcastController.java @@ -0,0 +1,1164 @@ +package net.minecraft.client.stream; + +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.List; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ThreadSafeBoundList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import tv.twitch.AuthToken; +import tv.twitch.Core; +import tv.twitch.ErrorCode; +import tv.twitch.MessageLevel; +import tv.twitch.StandardCoreAPI; +import tv.twitch.broadcast.ArchivingState; +import tv.twitch.broadcast.AudioDeviceType; +import tv.twitch.broadcast.AudioParams; +import tv.twitch.broadcast.ChannelInfo; +import tv.twitch.broadcast.DesktopStreamAPI; +import tv.twitch.broadcast.EncodingCpuUsage; +import tv.twitch.broadcast.FrameBuffer; +import tv.twitch.broadcast.GameInfo; +import tv.twitch.broadcast.GameInfoList; +import tv.twitch.broadcast.IStatCallbacks; +import tv.twitch.broadcast.IStreamCallbacks; +import tv.twitch.broadcast.IngestList; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.broadcast.PixelFormat; +import tv.twitch.broadcast.StartFlags; +import tv.twitch.broadcast.StatType; +import tv.twitch.broadcast.Stream; +import tv.twitch.broadcast.StreamInfo; +import tv.twitch.broadcast.StreamInfoForSetting; +import tv.twitch.broadcast.UserInfo; +import tv.twitch.broadcast.VideoParams; + +public class BroadcastController +{ + private static final Logger logger = LogManager.getLogger(); + protected final int field_152865_a = 30; + protected final int field_152866_b = 3; + private static final ThreadSafeBoundList field_152862_C = new ThreadSafeBoundList(String.class, 50); + private String lastError = null; + protected BroadcastController.BroadcastListener broadcastListener = null; + protected String field_152868_d = ""; + protected String field_152869_e = ""; + protected String field_152870_f = ""; + protected boolean field_152871_g = true; + protected Core streamCore = null; + protected Stream theStream = null; + protected List field_152874_j = Lists.newArrayList(); + protected List field_152875_k = Lists.newArrayList(); + protected boolean field_152876_l = false; + protected boolean field_152877_m = false; + protected boolean field_152878_n = false; + protected BroadcastController.BroadcastState broadcastState = BroadcastController.BroadcastState.Uninitialized; + protected String field_152880_p = null; + protected VideoParams videoParamaters = null; + protected AudioParams audioParamaters = null; + protected IngestList ingestList = new IngestList(new IngestServer[0]); + protected IngestServer ingestServ = null; + protected AuthToken authenticationToken = new AuthToken(); + protected ChannelInfo channelInfo = new ChannelInfo(); + protected UserInfo userInfo = new UserInfo(); + protected StreamInfo streamInfo = new StreamInfo(); + protected ArchivingState archivingState = new ArchivingState(); + protected long field_152890_z = 0L; + protected IngestServerTester ingestServTester = null; + private ErrorCode errorCode; + protected IStreamCallbacks streamCallback = new IStreamCallbacks() + { + public void requestAuthTokenCallback(ErrorCode p_requestAuthTokenCallback_1_, AuthToken p_requestAuthTokenCallback_2_) + { + if (ErrorCode.succeeded(p_requestAuthTokenCallback_1_)) + { + BroadcastController.this.authenticationToken = p_requestAuthTokenCallback_2_; + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.Authenticated); + } + else + { + BroadcastController.this.authenticationToken.data = ""; + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.Initialized); + String s = ErrorCode.getString(p_requestAuthTokenCallback_1_); + BroadcastController.this.logError(String.format("RequestAuthTokenDoneCallback got failure: %s", new Object[] {s})); + } + + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152900_a(p_requestAuthTokenCallback_1_, p_requestAuthTokenCallback_2_); + } + } + catch (Exception exception) + { + BroadcastController.this.logError(exception.toString()); + } + } + public void loginCallback(ErrorCode p_loginCallback_1_, ChannelInfo p_loginCallback_2_) + { + if (ErrorCode.succeeded(p_loginCallback_1_)) + { + BroadcastController.this.channelInfo = p_loginCallback_2_; + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.LoggedIn); + BroadcastController.this.field_152877_m = true; + } + else + { + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.Initialized); + BroadcastController.this.field_152877_m = false; + String s = ErrorCode.getString(p_loginCallback_1_); + BroadcastController.this.logError(String.format("LoginCallback got failure: %s", new Object[] {s})); + } + + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152897_a(p_loginCallback_1_); + } + } + catch (Exception exception) + { + BroadcastController.this.logError(exception.toString()); + } + } + public void getIngestServersCallback(ErrorCode p_getIngestServersCallback_1_, IngestList p_getIngestServersCallback_2_) + { + if (ErrorCode.succeeded(p_getIngestServersCallback_1_)) + { + BroadcastController.this.ingestList = p_getIngestServersCallback_2_; + BroadcastController.this.ingestServ = BroadcastController.this.ingestList.getDefaultServer(); + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.ReceivedIngestServers); + + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152896_a(p_getIngestServersCallback_2_); + } + } + catch (Exception exception) + { + BroadcastController.this.logError(exception.toString()); + } + } + else + { + String s = ErrorCode.getString(p_getIngestServersCallback_1_); + BroadcastController.this.logError(String.format("IngestListCallback got failure: %s", new Object[] {s})); + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.LoggingIn); + } + } + public void getUserInfoCallback(ErrorCode p_getUserInfoCallback_1_, UserInfo p_getUserInfoCallback_2_) + { + BroadcastController.this.userInfo = p_getUserInfoCallback_2_; + + if (ErrorCode.failed(p_getUserInfoCallback_1_)) + { + String s = ErrorCode.getString(p_getUserInfoCallback_1_); + BroadcastController.this.logError(String.format("UserInfoDoneCallback got failure: %s", new Object[] {s})); + } + } + public void getStreamInfoCallback(ErrorCode p_getStreamInfoCallback_1_, StreamInfo p_getStreamInfoCallback_2_) + { + if (ErrorCode.succeeded(p_getStreamInfoCallback_1_)) + { + BroadcastController.this.streamInfo = p_getStreamInfoCallback_2_; + + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152894_a(p_getStreamInfoCallback_2_); + } + } + catch (Exception exception) + { + BroadcastController.this.logError(exception.toString()); + } + } + else + { + String s = ErrorCode.getString(p_getStreamInfoCallback_1_); + BroadcastController.this.logWarning(String.format("StreamInfoDoneCallback got failure: %s", new Object[] {s})); + } + } + public void getArchivingStateCallback(ErrorCode p_getArchivingStateCallback_1_, ArchivingState p_getArchivingStateCallback_2_) + { + BroadcastController.this.archivingState = p_getArchivingStateCallback_2_; + + if (ErrorCode.failed(p_getArchivingStateCallback_1_)) + { + ; + } + } + public void runCommercialCallback(ErrorCode p_runCommercialCallback_1_) + { + if (ErrorCode.failed(p_runCommercialCallback_1_)) + { + String s = ErrorCode.getString(p_runCommercialCallback_1_); + BroadcastController.this.logWarning(String.format("RunCommercialCallback got failure: %s", new Object[] {s})); + } + } + public void setStreamInfoCallback(ErrorCode p_setStreamInfoCallback_1_) + { + if (ErrorCode.failed(p_setStreamInfoCallback_1_)) + { + String s = ErrorCode.getString(p_setStreamInfoCallback_1_); + BroadcastController.this.logWarning(String.format("SetStreamInfoCallback got failure: %s", new Object[] {s})); + } + } + public void getGameNameListCallback(ErrorCode p_getGameNameListCallback_1_, GameInfoList p_getGameNameListCallback_2_) + { + if (ErrorCode.failed(p_getGameNameListCallback_1_)) + { + String s = ErrorCode.getString(p_getGameNameListCallback_1_); + BroadcastController.this.logError(String.format("GameNameListCallback got failure: %s", new Object[] {s})); + } + + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152898_a(p_getGameNameListCallback_1_, p_getGameNameListCallback_2_ == null ? new GameInfo[0] : p_getGameNameListCallback_2_.list); + } + } + catch (Exception exception) + { + BroadcastController.this.logError(exception.toString()); + } + } + public void bufferUnlockCallback(long p_bufferUnlockCallback_1_) + { + FrameBuffer framebuffer = FrameBuffer.lookupBuffer(p_bufferUnlockCallback_1_); + BroadcastController.this.field_152875_k.add(framebuffer); + } + public void startCallback(ErrorCode p_startCallback_1_) + { + if (ErrorCode.succeeded(p_startCallback_1_)) + { + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152899_b(); + } + } + catch (Exception exception1) + { + BroadcastController.this.logError(exception1.toString()); + } + + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.Broadcasting); + } + else + { + BroadcastController.this.videoParamaters = null; + BroadcastController.this.audioParamaters = null; + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152892_c(p_startCallback_1_); + } + } + catch (Exception exception) + { + BroadcastController.this.logError(exception.toString()); + } + + String s = ErrorCode.getString(p_startCallback_1_); + BroadcastController.this.logError(String.format("startCallback got failure: %s", new Object[] {s})); + } + } + public void stopCallback(ErrorCode p_stopCallback_1_) + { + if (ErrorCode.succeeded(p_stopCallback_1_)) + { + BroadcastController.this.videoParamaters = null; + BroadcastController.this.audioParamaters = null; + BroadcastController.this.func_152831_M(); + + try + { + if (BroadcastController.this.broadcastListener != null) + { + BroadcastController.this.broadcastListener.func_152901_c(); + } + } + catch (Exception exception) + { + BroadcastController.this.logError(exception.toString()); + } + + if (BroadcastController.this.field_152877_m) + { + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + } + else + { + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.Initialized); + } + } + else + { + BroadcastController.this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + String s = ErrorCode.getString(p_stopCallback_1_); + BroadcastController.this.logError(String.format("stopCallback got failure: %s", new Object[] {s})); + } + } + public void sendActionMetaDataCallback(ErrorCode p_sendActionMetaDataCallback_1_) + { + if (ErrorCode.failed(p_sendActionMetaDataCallback_1_)) + { + String s = ErrorCode.getString(p_sendActionMetaDataCallback_1_); + BroadcastController.this.logError(String.format("sendActionMetaDataCallback got failure: %s", new Object[] {s})); + } + } + public void sendStartSpanMetaDataCallback(ErrorCode p_sendStartSpanMetaDataCallback_1_) + { + if (ErrorCode.failed(p_sendStartSpanMetaDataCallback_1_)) + { + String s = ErrorCode.getString(p_sendStartSpanMetaDataCallback_1_); + BroadcastController.this.logError(String.format("sendStartSpanMetaDataCallback got failure: %s", new Object[] {s})); + } + } + public void sendEndSpanMetaDataCallback(ErrorCode p_sendEndSpanMetaDataCallback_1_) + { + if (ErrorCode.failed(p_sendEndSpanMetaDataCallback_1_)) + { + String s = ErrorCode.getString(p_sendEndSpanMetaDataCallback_1_); + BroadcastController.this.logError(String.format("sendEndSpanMetaDataCallback got failure: %s", new Object[] {s})); + } + } + }; + protected IStatCallbacks field_177949_C = new IStatCallbacks() + { + public void statCallback(StatType p_statCallback_1_, long p_statCallback_2_) + { + } + }; + + public void setBroadcastListener(BroadcastController.BroadcastListener broadcastListenerIn) + { + this.broadcastListener = broadcastListenerIn; + } + + public boolean func_152858_b() + { + return this.field_152876_l; + } + + public void func_152842_a(String p_152842_1_) + { + this.field_152868_d = p_152842_1_; + } + + public StreamInfo getStreamInfo() + { + return this.streamInfo; + } + + public ChannelInfo getChannelInfo() + { + return this.channelInfo; + } + + public boolean isBroadcasting() + { + return this.broadcastState == BroadcastController.BroadcastState.Broadcasting || this.broadcastState == BroadcastController.BroadcastState.Paused; + } + + public boolean isReadyToBroadcast() + { + return this.broadcastState == BroadcastController.BroadcastState.ReadyToBroadcast; + } + + public boolean isIngestTesting() + { + return this.broadcastState == BroadcastController.BroadcastState.IngestTesting; + } + + public boolean isBroadcastPaused() + { + return this.broadcastState == BroadcastController.BroadcastState.Paused; + } + + public boolean func_152849_q() + { + return this.field_152877_m; + } + + public IngestServer getIngestServer() + { + return this.ingestServ; + } + + public void setIngestServer(IngestServer ingestServerSet) + { + this.ingestServ = ingestServerSet; + } + + public IngestList getIngestList() + { + return this.ingestList; + } + + public void setRecordingDeviceVolume(float volume) + { + this.theStream.setVolume(AudioDeviceType.TTV_RECORDER_DEVICE, volume); + } + + public void setPlaybackDeviceVolume(float volume) + { + this.theStream.setVolume(AudioDeviceType.TTV_PLAYBACK_DEVICE, volume); + } + + public IngestServerTester isReady() + { + return this.ingestServTester; + } + + public long getStreamTime() + { + return this.theStream.getStreamTime(); + } + + protected boolean func_152848_y() + { + return true; + } + + public ErrorCode getErrorCode() + { + return this.errorCode; + } + + public BroadcastController() + { + this.streamCore = Core.getInstance(); + + if (Core.getInstance() == null) + { + this.streamCore = new Core(new StandardCoreAPI()); + } + + this.theStream = new Stream(new DesktopStreamAPI()); + } + + protected PixelFormat getPixelFormat() + { + return PixelFormat.TTV_PF_RGBA; + } + + public boolean func_152817_A() + { + if (this.field_152876_l) + { + return false; + } + else + { + this.theStream.setStreamCallbacks(this.streamCallback); + ErrorCode errorcode = this.streamCore.initialize(this.field_152868_d, System.getProperty("java.library.path")); + + if (!this.func_152853_a(errorcode)) + { + this.theStream.setStreamCallbacks((IStreamCallbacks)null); + this.errorCode = errorcode; + return false; + } + else + { + errorcode = this.streamCore.setTraceLevel(MessageLevel.TTV_ML_ERROR); + + if (!this.func_152853_a(errorcode)) + { + this.theStream.setStreamCallbacks((IStreamCallbacks)null); + this.streamCore.shutdown(); + this.errorCode = errorcode; + return false; + } + else if (ErrorCode.succeeded(errorcode)) + { + this.field_152876_l = true; + this.func_152827_a(BroadcastController.BroadcastState.Initialized); + return true; + } + else + { + this.errorCode = errorcode; + this.streamCore.shutdown(); + return false; + } + } + } + } + + public boolean func_152851_B() + { + if (!this.field_152876_l) + { + return true; + } + else if (this.isIngestTesting()) + { + return false; + } + else + { + this.field_152878_n = true; + this.func_152845_C(); + this.theStream.setStreamCallbacks((IStreamCallbacks)null); + this.theStream.setStatCallbacks((IStatCallbacks)null); + ErrorCode errorcode = this.streamCore.shutdown(); + this.func_152853_a(errorcode); + this.field_152876_l = false; + this.field_152878_n = false; + this.func_152827_a(BroadcastController.BroadcastState.Uninitialized); + return true; + } + } + + public void statCallback() + { + if (this.broadcastState != BroadcastController.BroadcastState.Uninitialized) + { + if (this.ingestServTester != null) + { + this.ingestServTester.func_153039_l(); + } + + for (; this.ingestServTester != null; this.func_152821_H()) + { + try + { + Thread.sleep(200L); + } + catch (Exception exception) + { + this.logError(exception.toString()); + } + } + + this.func_152851_B(); + } + } + + public boolean func_152818_a(String p_152818_1_, AuthToken p_152818_2_) + { + if (this.isIngestTesting()) + { + return false; + } + else + { + this.func_152845_C(); + + if (p_152818_1_ != null && !p_152818_1_.isEmpty()) + { + if (p_152818_2_ != null && p_152818_2_.data != null && !p_152818_2_.data.isEmpty()) + { + this.field_152880_p = p_152818_1_; + this.authenticationToken = p_152818_2_; + + if (this.func_152858_b()) + { + this.func_152827_a(BroadcastController.BroadcastState.Authenticated); + } + + return true; + } + else + { + this.logError("Auth token must be valid"); + return false; + } + } + else + { + this.logError("Username must be valid"); + return false; + } + } + } + + public boolean func_152845_C() + { + if (this.isIngestTesting()) + { + return false; + } + else + { + if (this.isBroadcasting()) + { + this.theStream.stop(false); + } + + this.field_152880_p = ""; + this.authenticationToken = new AuthToken(); + + if (!this.field_152877_m) + { + return false; + } + else + { + this.field_152877_m = false; + + if (!this.field_152878_n) + { + try + { + if (this.broadcastListener != null) + { + this.broadcastListener.func_152895_a(); + } + } + catch (Exception exception) + { + this.logError(exception.toString()); + } + } + + this.func_152827_a(BroadcastController.BroadcastState.Initialized); + return true; + } + } + } + + public boolean func_152828_a(String p_152828_1_, String p_152828_2_, String p_152828_3_) + { + if (!this.field_152877_m) + { + return false; + } + else + { + if (p_152828_1_ == null || p_152828_1_.equals("")) + { + p_152828_1_ = this.field_152880_p; + } + + if (p_152828_2_ == null) + { + p_152828_2_ = ""; + } + + if (p_152828_3_ == null) + { + p_152828_3_ = ""; + } + + StreamInfoForSetting streaminfoforsetting = new StreamInfoForSetting(); + streaminfoforsetting.streamTitle = p_152828_3_; + streaminfoforsetting.gameName = p_152828_2_; + ErrorCode errorcode = this.theStream.setStreamInfo(this.authenticationToken, p_152828_1_, streaminfoforsetting); + this.func_152853_a(errorcode); + return ErrorCode.succeeded(errorcode); + } + } + + public boolean requestCommercial() + { + if (!this.isBroadcasting()) + { + return false; + } + else + { + ErrorCode errorcode = this.theStream.runCommercial(this.authenticationToken); + this.func_152853_a(errorcode); + return ErrorCode.succeeded(errorcode); + } + } + + public VideoParams func_152834_a(int maxKbps, int p_152834_2_, float p_152834_3_, float p_152834_4_) + { + int[] aint = this.theStream.getMaxResolution(maxKbps, p_152834_2_, p_152834_3_, p_152834_4_); + VideoParams videoparams = new VideoParams(); + videoparams.maxKbps = maxKbps; + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_HIGH; + videoparams.pixelFormat = this.getPixelFormat(); + videoparams.targetFps = p_152834_2_; + videoparams.outputWidth = aint[0]; + videoparams.outputHeight = aint[1]; + videoparams.disableAdaptiveBitrate = false; + videoparams.verticalFlip = false; + return videoparams; + } + + public boolean func_152836_a(VideoParams p_152836_1_) + { + if (p_152836_1_ != null && this.isReadyToBroadcast()) + { + this.videoParamaters = p_152836_1_.clone(); + this.audioParamaters = new AudioParams(); + this.audioParamaters.audioEnabled = this.field_152871_g && this.func_152848_y(); + this.audioParamaters.enableMicCapture = this.audioParamaters.audioEnabled; + this.audioParamaters.enablePlaybackCapture = this.audioParamaters.audioEnabled; + this.audioParamaters.enablePassthroughAudio = false; + + if (!this.func_152823_L()) + { + this.videoParamaters = null; + this.audioParamaters = null; + return false; + } + else + { + ErrorCode errorcode = this.theStream.start(p_152836_1_, this.audioParamaters, this.ingestServ, StartFlags.None, true); + + if (ErrorCode.failed(errorcode)) + { + this.func_152831_M(); + String s = ErrorCode.getString(errorcode); + this.logError(String.format("Error while starting to broadcast: %s", new Object[] {s})); + this.videoParamaters = null; + this.audioParamaters = null; + return false; + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Starting); + return true; + } + } + } + else + { + return false; + } + } + + public boolean stopBroadcasting() + { + if (!this.isBroadcasting()) + { + return false; + } + else + { + ErrorCode errorcode = this.theStream.stop(true); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.logError(String.format("Error while stopping the broadcast: %s", new Object[] {s})); + return false; + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Stopping); + return ErrorCode.succeeded(errorcode); + } + } + } + + public boolean func_152847_F() + { + if (!this.isBroadcasting()) + { + return false; + } + else + { + ErrorCode errorcode = this.theStream.pauseVideo(); + + if (ErrorCode.failed(errorcode)) + { + this.stopBroadcasting(); + String s = ErrorCode.getString(errorcode); + this.logError(String.format("Error pausing stream: %s\n", new Object[] {s})); + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Paused); + } + + return ErrorCode.succeeded(errorcode); + } + } + + public boolean func_152854_G() + { + if (!this.isBroadcastPaused()) + { + return false; + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Broadcasting); + return true; + } + } + + public boolean func_152840_a(String p_152840_1_, long p_152840_2_, String p_152840_4_, String p_152840_5_) + { + ErrorCode errorcode = this.theStream.sendActionMetaData(this.authenticationToken, p_152840_1_, p_152840_2_, p_152840_4_, p_152840_5_); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.logError(String.format("Error while sending meta data: %s\n", new Object[] {s})); + return false; + } + else + { + return true; + } + } + + public long func_177946_b(String p_177946_1_, long p_177946_2_, String p_177946_4_, String p_177946_5_) + { + long i = this.theStream.sendStartSpanMetaData(this.authenticationToken, p_177946_1_, p_177946_2_, p_177946_4_, p_177946_5_); + + if (i == -1L) + { + this.logError(String.format("Error in SendStartSpanMetaData\n", new Object[0])); + } + + return i; + } + + public boolean func_177947_a(String p_177947_1_, long p_177947_2_, long p_177947_4_, String p_177947_6_, String p_177947_7_) + { + if (p_177947_4_ == -1L) + { + this.logError(String.format("Invalid sequence id: %d\n", new Object[] {Long.valueOf(p_177947_4_)})); + return false; + } + else + { + ErrorCode errorcode = this.theStream.sendEndSpanMetaData(this.authenticationToken, p_177947_1_, p_177947_2_, p_177947_4_, p_177947_6_, p_177947_7_); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.logError(String.format("Error in SendStopSpanMetaData: %s\n", new Object[] {s})); + return false; + } + else + { + return true; + } + } + } + + protected void func_152827_a(BroadcastController.BroadcastState p_152827_1_) + { + if (p_152827_1_ != this.broadcastState) + { + this.broadcastState = p_152827_1_; + + try + { + if (this.broadcastListener != null) + { + this.broadcastListener.func_152891_a(p_152827_1_); + } + } + catch (Exception exception) + { + this.logError(exception.toString()); + } + } + } + + public void func_152821_H() + { + if (this.theStream != null && this.field_152876_l) + { + ErrorCode errorcode = this.theStream.pollTasks(); + this.func_152853_a(errorcode); + + if (this.isIngestTesting()) + { + this.ingestServTester.func_153041_j(); + + if (this.ingestServTester.func_153032_e()) + { + this.ingestServTester = null; + this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + } + } + + switch (this.broadcastState) + { + case Authenticated: + this.func_152827_a(BroadcastController.BroadcastState.LoggingIn); + errorcode = this.theStream.login(this.authenticationToken); + + if (ErrorCode.failed(errorcode)) + { + String s3 = ErrorCode.getString(errorcode); + this.logError(String.format("Error in TTV_Login: %s\n", new Object[] {s3})); + } + + break; + + case LoggedIn: + this.func_152827_a(BroadcastController.BroadcastState.FindingIngestServer); + errorcode = this.theStream.getIngestServers(this.authenticationToken); + + if (ErrorCode.failed(errorcode)) + { + this.func_152827_a(BroadcastController.BroadcastState.LoggedIn); + String s2 = ErrorCode.getString(errorcode); + this.logError(String.format("Error in TTV_GetIngestServers: %s\n", new Object[] {s2})); + } + + break; + + case ReceivedIngestServers: + this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + errorcode = this.theStream.getUserInfo(this.authenticationToken); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.logError(String.format("Error in TTV_GetUserInfo: %s\n", new Object[] {s})); + } + + this.func_152835_I(); + errorcode = this.theStream.getArchivingState(this.authenticationToken); + + if (ErrorCode.failed(errorcode)) + { + String s1 = ErrorCode.getString(errorcode); + this.logError(String.format("Error in TTV_GetArchivingState: %s\n", new Object[] {s1})); + } + + case Starting: + case Stopping: + case FindingIngestServer: + case Authenticating: + case Initialized: + case Uninitialized: + case IngestTesting: + default: + break; + + case Paused: + case Broadcasting: + this.func_152835_I(); + } + } + } + + protected void func_152835_I() + { + long i = System.nanoTime(); + long j = (i - this.field_152890_z) / 1000000000L; + + if (j >= 30L) + { + this.field_152890_z = i; + ErrorCode errorcode = this.theStream.getStreamInfo(this.authenticationToken, this.field_152880_p); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.logError(String.format("Error in TTV_GetStreamInfo: %s", new Object[] {s})); + } + } + } + + public IngestServerTester func_152838_J() + { + if (this.isReadyToBroadcast() && this.ingestList != null) + { + if (this.isIngestTesting()) + { + return null; + } + else + { + this.ingestServTester = new IngestServerTester(this.theStream, this.ingestList); + this.ingestServTester.func_176004_j(); + this.func_152827_a(BroadcastController.BroadcastState.IngestTesting); + return this.ingestServTester; + } + } + else + { + return null; + } + } + + protected boolean func_152823_L() + { + for (int i = 0; i < 3; ++i) + { + FrameBuffer framebuffer = this.theStream.allocateFrameBuffer(this.videoParamaters.outputWidth * this.videoParamaters.outputHeight * 4); + + if (!framebuffer.getIsValid()) + { + this.logError(String.format("Error while allocating frame buffer", new Object[0])); + return false; + } + + this.field_152874_j.add(framebuffer); + this.field_152875_k.add(framebuffer); + } + + return true; + } + + protected void func_152831_M() + { + for (int i = 0; i < this.field_152874_j.size(); ++i) + { + FrameBuffer framebuffer = (FrameBuffer)this.field_152874_j.get(i); + framebuffer.free(); + } + + this.field_152875_k.clear(); + this.field_152874_j.clear(); + } + + public FrameBuffer func_152822_N() + { + if (this.field_152875_k.size() == 0) + { + this.logError(String.format("Out of free buffers, this should never happen", new Object[0])); + return null; + } + else + { + FrameBuffer framebuffer = (FrameBuffer)this.field_152875_k.get(this.field_152875_k.size() - 1); + this.field_152875_k.remove(this.field_152875_k.size() - 1); + return framebuffer; + } + } + + public void captureFramebuffer(FrameBuffer p_152846_1_) + { + try + { + this.theStream.captureFrameBuffer_ReadPixels(p_152846_1_); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Trying to submit a frame to Twitch"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Broadcast State"); + crashreportcategory.addCrashSection("Last reported errors", Arrays.toString(field_152862_C.func_152756_c())); + crashreportcategory.addCrashSection("Buffer", p_152846_1_); + crashreportcategory.addCrashSection("Free buffer count", Integer.valueOf(this.field_152875_k.size())); + crashreportcategory.addCrashSection("Capture buffer count", Integer.valueOf(this.field_152874_j.size())); + throw new ReportedException(crashreport); + } + } + + public ErrorCode submitStreamFrame(FrameBuffer frame) + { + if (this.isBroadcastPaused()) + { + this.func_152854_G(); + } + else if (!this.isBroadcasting()) + { + return ErrorCode.TTV_EC_STREAM_NOT_STARTED; + } + + ErrorCode errorcode = this.theStream.submitVideoFrame(frame); + + if (errorcode != ErrorCode.TTV_EC_SUCCESS) + { + String s = ErrorCode.getString(errorcode); + + if (ErrorCode.succeeded(errorcode)) + { + this.logWarning(String.format("Warning in SubmitTexturePointer: %s\n", new Object[] {s})); + } + else + { + this.logError(String.format("Error in SubmitTexturePointer: %s\n", new Object[] {s})); + this.stopBroadcasting(); + } + + if (this.broadcastListener != null) + { + this.broadcastListener.func_152893_b(errorcode); + } + } + + return errorcode; + } + + protected boolean func_152853_a(ErrorCode p_152853_1_) + { + if (ErrorCode.failed(p_152853_1_)) + { + this.logError(ErrorCode.getString(p_152853_1_)); + return false; + } + else + { + return true; + } + } + + protected void logError(String error) + { + this.lastError = error; + field_152862_C.func_152757_a(" " + error); + logger.error(TwitchStream.STREAM_MARKER, "[Broadcast controller] {}", new Object[] {error}); + } + + protected void logWarning(String warning) + { + field_152862_C.func_152757_a(" " + warning); + logger.warn(TwitchStream.STREAM_MARKER, "[Broadcast controller] {}", new Object[] {warning}); + } + + public interface BroadcastListener + { + void func_152900_a(ErrorCode p_152900_1_, AuthToken p_152900_2_); + + void func_152897_a(ErrorCode p_152897_1_); + + void func_152898_a(ErrorCode p_152898_1_, GameInfo[] p_152898_2_); + + void func_152891_a(BroadcastController.BroadcastState p_152891_1_); + + void func_152895_a(); + + void func_152894_a(StreamInfo p_152894_1_); + + void func_152896_a(IngestList p_152896_1_); + + void func_152893_b(ErrorCode p_152893_1_); + + void func_152899_b(); + + void func_152901_c(); + + void func_152892_c(ErrorCode p_152892_1_); + } + + public static enum BroadcastState + { + Uninitialized, + Initialized, + Authenticating, + Authenticated, + LoggingIn, + LoggedIn, + FindingIngestServer, + ReceivedIngestServers, + ReadyToBroadcast, + Starting, + Broadcasting, + Stopping, + Paused, + IngestTesting; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/ChatController.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/ChatController.java new file mode 100644 index 0000000..10b03b3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/ChatController.java @@ -0,0 +1,921 @@ +package net.minecraft.client.stream; + +import com.google.common.collect.Lists; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import tv.twitch.AuthToken; +import tv.twitch.Core; +import tv.twitch.ErrorCode; +import tv.twitch.StandardCoreAPI; +import tv.twitch.chat.Chat; +import tv.twitch.chat.ChatBadgeData; +import tv.twitch.chat.ChatChannelInfo; +import tv.twitch.chat.ChatEmoticonData; +import tv.twitch.chat.ChatEvent; +import tv.twitch.chat.ChatRawMessage; +import tv.twitch.chat.ChatTokenizationOption; +import tv.twitch.chat.ChatTokenizedMessage; +import tv.twitch.chat.ChatUserInfo; +import tv.twitch.chat.IChatAPIListener; +import tv.twitch.chat.IChatChannelListener; +import tv.twitch.chat.StandardChatAPI; + +public class ChatController +{ + private static final Logger LOGGER = LogManager.getLogger(); + protected ChatController.ChatListener field_153003_a = null; + protected String field_153004_b = ""; + protected String field_153006_d = ""; + protected String field_153007_e = ""; + protected Core field_175992_e = null; + protected Chat field_153008_f = null; + protected ChatController.ChatState field_153011_i = ChatController.ChatState.Uninitialized; + protected AuthToken field_153012_j = new AuthToken(); + protected HashMap field_175998_i = new HashMap(); + protected int field_153015_m = 128; + protected ChatController.EnumEmoticonMode field_175997_k = ChatController.EnumEmoticonMode.None; + protected ChatController.EnumEmoticonMode field_175995_l = ChatController.EnumEmoticonMode.None; + protected ChatEmoticonData field_175996_m = null; + protected int field_175993_n = 500; + protected int field_175994_o = 2000; + protected IChatAPIListener field_175999_p = new IChatAPIListener() + { + public void chatInitializationCallback(ErrorCode p_chatInitializationCallback_1_) + { + if (ErrorCode.succeeded(p_chatInitializationCallback_1_)) + { + ChatController.this.field_153008_f.setMessageFlushInterval(ChatController.this.field_175993_n); + ChatController.this.field_153008_f.setUserChangeEventInterval(ChatController.this.field_175994_o); + ChatController.this.func_153001_r(); + ChatController.this.func_175985_a(ChatController.ChatState.Initialized); + } + else + { + ChatController.this.func_175985_a(ChatController.ChatState.Uninitialized); + } + + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_176023_d(p_chatInitializationCallback_1_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + public void chatShutdownCallback(ErrorCode p_chatShutdownCallback_1_) + { + if (ErrorCode.succeeded(p_chatShutdownCallback_1_)) + { + ErrorCode errorcode = ChatController.this.field_175992_e.shutdown(); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + ChatController.this.func_152995_h(String.format("Error shutting down the Twitch sdk: %s", new Object[] {s})); + } + + ChatController.this.func_175985_a(ChatController.ChatState.Uninitialized); + } + else + { + ChatController.this.func_175985_a(ChatController.ChatState.Initialized); + ChatController.this.func_152995_h(String.format("Error shutting down Twith chat: %s", new Object[] {p_chatShutdownCallback_1_})); + } + + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_176022_e(p_chatShutdownCallback_1_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + public void chatEmoticonDataDownloadCallback(ErrorCode p_chatEmoticonDataDownloadCallback_1_) + { + if (ErrorCode.succeeded(p_chatEmoticonDataDownloadCallback_1_)) + { + ChatController.this.func_152988_s(); + } + } + }; + + public void func_152990_a(ChatController.ChatListener p_152990_1_) + { + this.field_153003_a = p_152990_1_; + } + + public void func_152994_a(AuthToken p_152994_1_) + { + this.field_153012_j = p_152994_1_; + } + + public void func_152984_a(String p_152984_1_) + { + this.field_153006_d = p_152984_1_; + } + + public void func_152998_c(String p_152998_1_) + { + this.field_153004_b = p_152998_1_; + } + + public ChatController.ChatState func_153000_j() + { + return this.field_153011_i; + } + + public boolean func_175990_d(String p_175990_1_) + { + if (!this.field_175998_i.containsKey(p_175990_1_)) + { + return false; + } + else + { + ChatController.ChatChannelListener chatcontroller$chatchannellistener = (ChatController.ChatChannelListener)this.field_175998_i.get(p_175990_1_); + return chatcontroller$chatchannellistener.func_176040_a() == ChatController.EnumChannelState.Connected; + } + } + + public ChatController.EnumChannelState func_175989_e(String p_175989_1_) + { + if (!this.field_175998_i.containsKey(p_175989_1_)) + { + return ChatController.EnumChannelState.Disconnected; + } + else + { + ChatController.ChatChannelListener chatcontroller$chatchannellistener = (ChatController.ChatChannelListener)this.field_175998_i.get(p_175989_1_); + return chatcontroller$chatchannellistener.func_176040_a(); + } + } + + public ChatController() + { + this.field_175992_e = Core.getInstance(); + + if (this.field_175992_e == null) + { + this.field_175992_e = new Core(new StandardCoreAPI()); + } + + this.field_153008_f = new Chat(new StandardChatAPI()); + } + + public boolean func_175984_n() + { + if (this.field_153011_i != ChatController.ChatState.Uninitialized) + { + return false; + } + else + { + this.func_175985_a(ChatController.ChatState.Initializing); + ErrorCode errorcode = this.field_175992_e.initialize(this.field_153006_d, (String)null); + + if (ErrorCode.failed(errorcode)) + { + this.func_175985_a(ChatController.ChatState.Uninitialized); + String s1 = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error initializing Twitch sdk: %s", new Object[] {s1})); + return false; + } + else + { + this.field_175995_l = this.field_175997_k; + HashSet hashset = new HashSet(); + + switch (this.field_175997_k) + { + case None: + hashset.add(ChatTokenizationOption.TTV_CHAT_TOKENIZATION_OPTION_NONE); + break; + + case Url: + hashset.add(ChatTokenizationOption.TTV_CHAT_TOKENIZATION_OPTION_EMOTICON_URLS); + break; + + case TextureAtlas: + hashset.add(ChatTokenizationOption.TTV_CHAT_TOKENIZATION_OPTION_EMOTICON_TEXTURES); + } + + errorcode = this.field_153008_f.initialize(hashset, this.field_175999_p); + + if (ErrorCode.failed(errorcode)) + { + this.field_175992_e.shutdown(); + this.func_175985_a(ChatController.ChatState.Uninitialized); + String s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error initializing Twitch chat: %s", new Object[] {s})); + return false; + } + else + { + this.func_175985_a(ChatController.ChatState.Initialized); + return true; + } + } + } + } + + public boolean func_152986_d(String p_152986_1_) + { + return this.func_175987_a(p_152986_1_, false); + } + + protected boolean func_175987_a(String p_175987_1_, boolean p_175987_2_) + { + if (this.field_153011_i != ChatController.ChatState.Initialized) + { + return false; + } + else if (this.field_175998_i.containsKey(p_175987_1_)) + { + this.func_152995_h("Already in channel: " + p_175987_1_); + return false; + } + else if (p_175987_1_ != null && !p_175987_1_.equals("")) + { + ChatController.ChatChannelListener chatcontroller$chatchannellistener = new ChatController.ChatChannelListener(p_175987_1_); + this.field_175998_i.put(p_175987_1_, chatcontroller$chatchannellistener); + boolean flag = chatcontroller$chatchannellistener.func_176038_a(p_175987_2_); + + if (!flag) + { + this.field_175998_i.remove(p_175987_1_); + } + + return flag; + } + else + { + return false; + } + } + + public boolean func_175991_l(String p_175991_1_) + { + if (this.field_153011_i != ChatController.ChatState.Initialized) + { + return false; + } + else if (!this.field_175998_i.containsKey(p_175991_1_)) + { + this.func_152995_h("Not in channel: " + p_175991_1_); + return false; + } + else + { + ChatController.ChatChannelListener chatcontroller$chatchannellistener = (ChatController.ChatChannelListener)this.field_175998_i.get(p_175991_1_); + return chatcontroller$chatchannellistener.func_176034_g(); + } + } + + public boolean func_152993_m() + { + if (this.field_153011_i != ChatController.ChatState.Initialized) + { + return false; + } + else + { + ErrorCode errorcode = this.field_153008_f.shutdown(); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error shutting down chat: %s", new Object[] {s})); + return false; + } + else + { + this.func_152996_t(); + this.func_175985_a(ChatController.ChatState.ShuttingDown); + return true; + } + } + } + + public void func_175988_p() + { + if (this.func_153000_j() != ChatController.ChatState.Uninitialized) + { + this.func_152993_m(); + + if (this.func_153000_j() == ChatController.ChatState.ShuttingDown) + { + while (this.func_153000_j() != ChatController.ChatState.Uninitialized) + { + try + { + Thread.sleep(200L); + this.func_152997_n(); + } + catch (InterruptedException var2) + { + ; + } + } + } + } + } + + public void func_152997_n() + { + if (this.field_153011_i != ChatController.ChatState.Uninitialized) + { + ErrorCode errorcode = this.field_153008_f.flushEvents(); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error flushing chat events: %s", new Object[] {s})); + } + } + } + + public boolean func_175986_a(String p_175986_1_, String p_175986_2_) + { + if (this.field_153011_i != ChatController.ChatState.Initialized) + { + return false; + } + else if (!this.field_175998_i.containsKey(p_175986_1_)) + { + this.func_152995_h("Not in channel: " + p_175986_1_); + return false; + } + else + { + ChatController.ChatChannelListener chatcontroller$chatchannellistener = (ChatController.ChatChannelListener)this.field_175998_i.get(p_175986_1_); + return chatcontroller$chatchannellistener.func_176037_b(p_175986_2_); + } + } + + protected void func_175985_a(ChatController.ChatState p_175985_1_) + { + if (p_175985_1_ != this.field_153011_i) + { + this.field_153011_i = p_175985_1_; + + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_176017_a(p_175985_1_); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + } + } + + protected void func_153001_r() + { + if (this.field_175995_l != ChatController.EnumEmoticonMode.None) + { + if (this.field_175996_m == null) + { + ErrorCode errorcode = this.field_153008_f.downloadEmoticonData(); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error trying to download emoticon data: %s", new Object[] {s})); + } + } + } + } + + protected void func_152988_s() + { + if (this.field_175996_m == null) + { + this.field_175996_m = new ChatEmoticonData(); + ErrorCode errorcode = this.field_153008_f.getEmoticonData(this.field_175996_m); + + if (ErrorCode.succeeded(errorcode)) + { + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_176021_d(); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + } + else + { + this.func_152995_h("Error preparing emoticon data: " + ErrorCode.getString(errorcode)); + } + } + } + + protected void func_152996_t() + { + if (this.field_175996_m != null) + { + ErrorCode errorcode = this.field_153008_f.clearEmoticonData(); + + if (ErrorCode.succeeded(errorcode)) + { + this.field_175996_m = null; + + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_176024_e(); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + } + else + { + this.func_152995_h("Error clearing emoticon data: " + ErrorCode.getString(errorcode)); + } + } + } + + protected void func_152995_h(String p_152995_1_) + { + LOGGER.error(TwitchStream.STREAM_MARKER, "[Chat controller] {}", new Object[] {p_152995_1_}); + } + + public class ChatChannelListener implements IChatChannelListener + { + protected String field_176048_a = null; + protected boolean field_176046_b = false; + protected ChatController.EnumChannelState field_176047_c = ChatController.EnumChannelState.Created; + protected List field_176044_d = Lists.newArrayList(); + protected LinkedList field_176045_e = new LinkedList(); + protected LinkedList field_176042_f = new LinkedList(); + protected ChatBadgeData field_176043_g = null; + + public ChatChannelListener(String p_i46061_2_) + { + this.field_176048_a = p_i46061_2_; + } + + public ChatController.EnumChannelState func_176040_a() + { + return this.field_176047_c; + } + + public boolean func_176038_a(boolean p_176038_1_) + { + this.field_176046_b = p_176038_1_; + ErrorCode errorcode = ErrorCode.TTV_EC_SUCCESS; + + if (p_176038_1_) + { + errorcode = ChatController.this.field_153008_f.connectAnonymous(this.field_176048_a, this); + } + else + { + errorcode = ChatController.this.field_153008_f.connect(this.field_176048_a, ChatController.this.field_153004_b, ChatController.this.field_153012_j.data, this); + } + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + ChatController.this.func_152995_h(String.format("Error connecting: %s", new Object[] {s})); + this.func_176036_d(this.field_176048_a); + return false; + } + else + { + this.func_176035_a(ChatController.EnumChannelState.Connecting); + this.func_176041_h(); + return true; + } + } + + public boolean func_176034_g() + { + switch (this.field_176047_c) + { + case Connected: + case Connecting: + ErrorCode errorcode = ChatController.this.field_153008_f.disconnect(this.field_176048_a); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + ChatController.this.func_152995_h(String.format("Error disconnecting: %s", new Object[] {s})); + return false; + } + + this.func_176035_a(ChatController.EnumChannelState.Disconnecting); + return true; + + case Created: + case Disconnected: + case Disconnecting: + default: + return false; + } + } + + protected void func_176035_a(ChatController.EnumChannelState p_176035_1_) + { + if (p_176035_1_ != this.field_176047_c) + { + this.field_176047_c = p_176035_1_; + } + } + + public void func_176032_a(String p_176032_1_) + { + if (ChatController.this.field_175995_l == ChatController.EnumEmoticonMode.None) + { + this.field_176045_e.clear(); + this.field_176042_f.clear(); + } + else + { + if (this.field_176045_e.size() > 0) + { + ListIterator listiterator = this.field_176045_e.listIterator(); + + while (listiterator.hasNext()) + { + ChatRawMessage chatrawmessage = (ChatRawMessage)listiterator.next(); + + if (chatrawmessage.userName.equals(p_176032_1_)) + { + listiterator.remove(); + } + } + } + + if (this.field_176042_f.size() > 0) + { + ListIterator listiterator1 = this.field_176042_f.listIterator(); + + while (listiterator1.hasNext()) + { + ChatTokenizedMessage chattokenizedmessage = (ChatTokenizedMessage)listiterator1.next(); + + if (chattokenizedmessage.displayName.equals(p_176032_1_)) + { + listiterator1.remove(); + } + } + } + } + + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_176019_a(this.field_176048_a, p_176032_1_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + + public boolean func_176037_b(String p_176037_1_) + { + if (this.field_176047_c != ChatController.EnumChannelState.Connected) + { + return false; + } + else + { + ErrorCode errorcode = ChatController.this.field_153008_f.sendMessage(this.field_176048_a, p_176037_1_); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + ChatController.this.func_152995_h(String.format("Error sending chat message: %s", new Object[] {s})); + return false; + } + else + { + return true; + } + } + } + + protected void func_176041_h() + { + if (ChatController.this.field_175995_l != ChatController.EnumEmoticonMode.None) + { + if (this.field_176043_g == null) + { + ErrorCode errorcode = ChatController.this.field_153008_f.downloadBadgeData(this.field_176048_a); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + ChatController.this.func_152995_h(String.format("Error trying to download badge data: %s", new Object[] {s})); + } + } + } + } + + protected void func_176039_i() + { + if (this.field_176043_g == null) + { + this.field_176043_g = new ChatBadgeData(); + ErrorCode errorcode = ChatController.this.field_153008_f.getBadgeData(this.field_176048_a, this.field_176043_g); + + if (ErrorCode.succeeded(errorcode)) + { + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_176016_c(this.field_176048_a); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + else + { + ChatController.this.func_152995_h("Error preparing badge data: " + ErrorCode.getString(errorcode)); + } + } + } + + protected void func_176033_j() + { + if (this.field_176043_g != null) + { + ErrorCode errorcode = ChatController.this.field_153008_f.clearBadgeData(this.field_176048_a); + + if (ErrorCode.succeeded(errorcode)) + { + this.field_176043_g = null; + + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_176020_d(this.field_176048_a); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + else + { + ChatController.this.func_152995_h("Error releasing badge data: " + ErrorCode.getString(errorcode)); + } + } + } + + protected void func_176031_c(String p_176031_1_) + { + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_180606_a(p_176031_1_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + + protected void func_176036_d(String p_176036_1_) + { + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_180607_b(p_176036_1_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + + private void func_176030_k() + { + if (this.field_176047_c != ChatController.EnumChannelState.Disconnected) + { + this.func_176035_a(ChatController.EnumChannelState.Disconnected); + this.func_176036_d(this.field_176048_a); + this.func_176033_j(); + } + } + + public void chatStatusCallback(String p_chatStatusCallback_1_, ErrorCode p_chatStatusCallback_2_) + { + if (!ErrorCode.succeeded(p_chatStatusCallback_2_)) + { + ChatController.this.field_175998_i.remove(p_chatStatusCallback_1_); + this.func_176030_k(); + } + } + + public void chatChannelMembershipCallback(String p_chatChannelMembershipCallback_1_, ChatEvent p_chatChannelMembershipCallback_2_, ChatChannelInfo p_chatChannelMembershipCallback_3_) + { + switch (p_chatChannelMembershipCallback_2_) + { + case TTV_CHAT_JOINED_CHANNEL: + this.func_176035_a(ChatController.EnumChannelState.Connected); + this.func_176031_c(p_chatChannelMembershipCallback_1_); + break; + + case TTV_CHAT_LEFT_CHANNEL: + this.func_176030_k(); + } + } + + public void chatChannelUserChangeCallback(String p_chatChannelUserChangeCallback_1_, ChatUserInfo[] p_chatChannelUserChangeCallback_2_, ChatUserInfo[] p_chatChannelUserChangeCallback_3_, ChatUserInfo[] p_chatChannelUserChangeCallback_4_) + { + for (int i = 0; i < p_chatChannelUserChangeCallback_3_.length; ++i) + { + int j = this.field_176044_d.indexOf(p_chatChannelUserChangeCallback_3_[i]); + + if (j >= 0) + { + this.field_176044_d.remove(j); + } + } + + for (int k = 0; k < p_chatChannelUserChangeCallback_4_.length; ++k) + { + int i1 = this.field_176044_d.indexOf(p_chatChannelUserChangeCallback_4_[k]); + + if (i1 >= 0) + { + this.field_176044_d.remove(i1); + } + + this.field_176044_d.add(p_chatChannelUserChangeCallback_4_[k]); + } + + for (int l = 0; l < p_chatChannelUserChangeCallback_2_.length; ++l) + { + this.field_176044_d.add(p_chatChannelUserChangeCallback_2_[l]); + } + + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_176018_a(this.field_176048_a, p_chatChannelUserChangeCallback_2_, p_chatChannelUserChangeCallback_3_, p_chatChannelUserChangeCallback_4_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + } + + public void chatChannelRawMessageCallback(String p_chatChannelRawMessageCallback_1_, ChatRawMessage[] p_chatChannelRawMessageCallback_2_) + { + for (int i = 0; i < p_chatChannelRawMessageCallback_2_.length; ++i) + { + this.field_176045_e.addLast(p_chatChannelRawMessageCallback_2_[i]); + } + + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_180605_a(this.field_176048_a, p_chatChannelRawMessageCallback_2_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + + while (this.field_176045_e.size() > ChatController.this.field_153015_m) + { + this.field_176045_e.removeFirst(); + } + } + + public void chatChannelTokenizedMessageCallback(String p_chatChannelTokenizedMessageCallback_1_, ChatTokenizedMessage[] p_chatChannelTokenizedMessageCallback_2_) + { + for (int i = 0; i < p_chatChannelTokenizedMessageCallback_2_.length; ++i) + { + this.field_176042_f.addLast(p_chatChannelTokenizedMessageCallback_2_[i]); + } + + try + { + if (ChatController.this.field_153003_a != null) + { + ChatController.this.field_153003_a.func_176025_a(this.field_176048_a, p_chatChannelTokenizedMessageCallback_2_); + } + } + catch (Exception exception) + { + ChatController.this.func_152995_h(exception.toString()); + } + + while (this.field_176042_f.size() > ChatController.this.field_153015_m) + { + this.field_176042_f.removeFirst(); + } + } + + public void chatClearCallback(String p_chatClearCallback_1_, String p_chatClearCallback_2_) + { + this.func_176032_a(p_chatClearCallback_2_); + } + + public void chatBadgeDataDownloadCallback(String p_chatBadgeDataDownloadCallback_1_, ErrorCode p_chatBadgeDataDownloadCallback_2_) + { + if (ErrorCode.succeeded(p_chatBadgeDataDownloadCallback_2_)) + { + this.func_176039_i(); + } + } + } + + public interface ChatListener + { + void func_176023_d(ErrorCode p_176023_1_); + + void func_176022_e(ErrorCode p_176022_1_); + + void func_176021_d(); + + void func_176024_e(); + + void func_176017_a(ChatController.ChatState p_176017_1_); + + void func_176025_a(String p_176025_1_, ChatTokenizedMessage[] p_176025_2_); + + void func_180605_a(String p_180605_1_, ChatRawMessage[] p_180605_2_); + + void func_176018_a(String p_176018_1_, ChatUserInfo[] p_176018_2_, ChatUserInfo[] p_176018_3_, ChatUserInfo[] p_176018_4_); + + void func_180606_a(String p_180606_1_); + + void func_180607_b(String p_180607_1_); + + void func_176019_a(String p_176019_1_, String p_176019_2_); + + void func_176016_c(String p_176016_1_); + + void func_176020_d(String p_176020_1_); + } + + public static enum ChatState + { + Uninitialized, + Initializing, + Initialized, + ShuttingDown; + } + + public static enum EnumChannelState + { + Created, + Connecting, + Connected, + Disconnecting, + Disconnected; + } + + public static enum EnumEmoticonMode + { + None, + Url, + TextureAtlas; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/IStream.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/IStream.java new file mode 100644 index 0000000..af4f252 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/IStream.java @@ -0,0 +1,74 @@ +package net.minecraft.client.stream; + +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.chat.ChatUserInfo; + +public interface IStream +{ + void shutdownStream(); + + void func_152935_j(); + + void func_152922_k(); + + boolean func_152936_l(); + + boolean isReadyToBroadcast(); + + boolean isBroadcasting(); + + void func_152911_a(Metadata p_152911_1_, long p_152911_2_); + + void func_176026_a(Metadata p_176026_1_, long p_176026_2_, long p_176026_4_); + + boolean isPaused(); + + void requestCommercial(); + + void pause(); + + void unpause(); + + void updateStreamVolume(); + + void func_152930_t(); + + void stopBroadcasting(); + + IngestServer[] func_152925_v(); + + void func_152909_x(); + + IngestServerTester func_152932_y(); + + boolean func_152908_z(); + + int func_152920_A(); + + boolean func_152927_B(); + + String func_152921_C(); + + ChatUserInfo func_152926_a(String p_152926_1_); + + void func_152917_b(String p_152917_1_); + + boolean func_152928_D(); + + ErrorCode func_152912_E(); + + boolean func_152913_F(); + + void muteMicrophone(boolean p_152910_1_); + + boolean func_152929_G(); + + IStream.AuthFailureReason func_152918_H(); + + public static enum AuthFailureReason + { + ERROR, + INVALID_TOKEN; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/IngestServerTester.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/IngestServerTester.java new file mode 100644 index 0000000..4120c4a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/IngestServerTester.java @@ -0,0 +1,502 @@ +package net.minecraft.client.stream; + +import com.google.common.collect.Lists; +import java.util.List; +import tv.twitch.AuthToken; +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.ArchivingState; +import tv.twitch.broadcast.AudioParams; +import tv.twitch.broadcast.ChannelInfo; +import tv.twitch.broadcast.EncodingCpuUsage; +import tv.twitch.broadcast.FrameBuffer; +import tv.twitch.broadcast.GameInfoList; +import tv.twitch.broadcast.IStatCallbacks; +import tv.twitch.broadcast.IStreamCallbacks; +import tv.twitch.broadcast.IngestList; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.broadcast.PixelFormat; +import tv.twitch.broadcast.RTMPState; +import tv.twitch.broadcast.StartFlags; +import tv.twitch.broadcast.StatType; +import tv.twitch.broadcast.Stream; +import tv.twitch.broadcast.StreamInfo; +import tv.twitch.broadcast.UserInfo; +import tv.twitch.broadcast.VideoParams; + +public class IngestServerTester +{ + protected IngestServerTester.IngestTestListener field_153044_b = null; + protected Stream field_153045_c = null; + protected IngestList field_153046_d = null; + protected IngestServerTester.IngestTestState field_153047_e = IngestServerTester.IngestTestState.Uninitalized; + protected long field_153048_f = 8000L; + protected long field_153049_g = 2000L; + protected long field_153050_h = 0L; + protected RTMPState field_153051_i = RTMPState.Invalid; + protected VideoParams field_153052_j = null; + protected AudioParams audioParameters = null; + protected long field_153054_l = 0L; + protected List field_153055_m = null; + protected boolean field_153056_n = false; + protected IStreamCallbacks field_153057_o = null; + protected IStatCallbacks field_153058_p = null; + protected IngestServer field_153059_q = null; + protected boolean field_153060_r = false; + protected boolean field_153061_s = false; + protected int field_153062_t = -1; + protected int field_153063_u = 0; + protected long field_153064_v = 0L; + protected float field_153065_w = 0.0F; + protected float field_153066_x = 0.0F; + protected boolean field_176009_x = false; + protected boolean field_176008_y = false; + protected boolean field_176007_z = false; + protected IStreamCallbacks field_176005_A = new IStreamCallbacks() + { + public void requestAuthTokenCallback(ErrorCode p_requestAuthTokenCallback_1_, AuthToken p_requestAuthTokenCallback_2_) + { + } + public void loginCallback(ErrorCode p_loginCallback_1_, ChannelInfo p_loginCallback_2_) + { + } + public void getIngestServersCallback(ErrorCode p_getIngestServersCallback_1_, IngestList p_getIngestServersCallback_2_) + { + } + public void getUserInfoCallback(ErrorCode p_getUserInfoCallback_1_, UserInfo p_getUserInfoCallback_2_) + { + } + public void getStreamInfoCallback(ErrorCode p_getStreamInfoCallback_1_, StreamInfo p_getStreamInfoCallback_2_) + { + } + public void getArchivingStateCallback(ErrorCode p_getArchivingStateCallback_1_, ArchivingState p_getArchivingStateCallback_2_) + { + } + public void runCommercialCallback(ErrorCode p_runCommercialCallback_1_) + { + } + public void setStreamInfoCallback(ErrorCode p_setStreamInfoCallback_1_) + { + } + public void getGameNameListCallback(ErrorCode p_getGameNameListCallback_1_, GameInfoList p_getGameNameListCallback_2_) + { + } + public void bufferUnlockCallback(long p_bufferUnlockCallback_1_) + { + } + public void startCallback(ErrorCode p_startCallback_1_) + { + IngestServerTester.this.field_176008_y = false; + + if (ErrorCode.succeeded(p_startCallback_1_)) + { + IngestServerTester.this.field_176009_x = true; + IngestServerTester.this.field_153054_l = System.currentTimeMillis(); + IngestServerTester.this.func_153034_a(IngestServerTester.IngestTestState.ConnectingToServer); + } + else + { + IngestServerTester.this.field_153056_n = false; + IngestServerTester.this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + } + } + public void stopCallback(ErrorCode p_stopCallback_1_) + { + if (ErrorCode.failed(p_stopCallback_1_)) + { + System.out.println("IngestTester.stopCallback failed to stop - " + IngestServerTester.this.field_153059_q.serverName + ": " + p_stopCallback_1_.toString()); + } + + IngestServerTester.this.field_176007_z = false; + IngestServerTester.this.field_176009_x = false; + IngestServerTester.this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + IngestServerTester.this.field_153059_q = null; + + if (IngestServerTester.this.field_153060_r) + { + IngestServerTester.this.func_153034_a(IngestServerTester.IngestTestState.Cancelling); + } + } + public void sendActionMetaDataCallback(ErrorCode p_sendActionMetaDataCallback_1_) + { + } + public void sendStartSpanMetaDataCallback(ErrorCode p_sendStartSpanMetaDataCallback_1_) + { + } + public void sendEndSpanMetaDataCallback(ErrorCode p_sendEndSpanMetaDataCallback_1_) + { + } + }; + protected IStatCallbacks field_176006_B = new IStatCallbacks() + { + public void statCallback(StatType p_statCallback_1_, long p_statCallback_2_) + { + switch (p_statCallback_1_) + { + case TTV_ST_RTMPSTATE: + IngestServerTester.this.field_153051_i = RTMPState.lookupValue((int)p_statCallback_2_); + break; + + case TTV_ST_RTMPDATASENT: + IngestServerTester.this.field_153050_h = p_statCallback_2_; + } + } + }; + + public void func_153042_a(IngestServerTester.IngestTestListener p_153042_1_) + { + this.field_153044_b = p_153042_1_; + } + + public IngestServer func_153040_c() + { + return this.field_153059_q; + } + + public int func_153028_p() + { + return this.field_153062_t; + } + + public boolean func_153032_e() + { + return this.field_153047_e == IngestServerTester.IngestTestState.Finished || this.field_153047_e == IngestServerTester.IngestTestState.Cancelled || this.field_153047_e == IngestServerTester.IngestTestState.Failed; + } + + public float func_153030_h() + { + return this.field_153066_x; + } + + public IngestServerTester(Stream p_i1019_1_, IngestList p_i1019_2_) + { + this.field_153045_c = p_i1019_1_; + this.field_153046_d = p_i1019_2_; + } + + public void func_176004_j() + { + if (this.field_153047_e == IngestServerTester.IngestTestState.Uninitalized) + { + this.field_153062_t = 0; + this.field_153060_r = false; + this.field_153061_s = false; + this.field_176009_x = false; + this.field_176008_y = false; + this.field_176007_z = false; + this.field_153058_p = this.field_153045_c.getStatCallbacks(); + this.field_153045_c.setStatCallbacks(this.field_176006_B); + this.field_153057_o = this.field_153045_c.getStreamCallbacks(); + this.field_153045_c.setStreamCallbacks(this.field_176005_A); + this.field_153052_j = new VideoParams(); + this.field_153052_j.targetFps = 60; + this.field_153052_j.maxKbps = 3500; + this.field_153052_j.outputWidth = 1280; + this.field_153052_j.outputHeight = 720; + this.field_153052_j.pixelFormat = PixelFormat.TTV_PF_BGRA; + this.field_153052_j.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_HIGH; + this.field_153052_j.disableAdaptiveBitrate = true; + this.field_153052_j.verticalFlip = false; + this.field_153045_c.getDefaultParams(this.field_153052_j); + this.audioParameters = new AudioParams(); + this.audioParameters.audioEnabled = false; + this.audioParameters.enableMicCapture = false; + this.audioParameters.enablePlaybackCapture = false; + this.audioParameters.enablePassthroughAudio = false; + this.field_153055_m = Lists.newArrayList(); + int i = 3; + + for (int j = 0; j < i; ++j) + { + FrameBuffer framebuffer = this.field_153045_c.allocateFrameBuffer(this.field_153052_j.outputWidth * this.field_153052_j.outputHeight * 4); + + if (!framebuffer.getIsValid()) + { + this.func_153031_o(); + this.func_153034_a(IngestServerTester.IngestTestState.Failed); + return; + } + + this.field_153055_m.add(framebuffer); + this.field_153045_c.randomizeFrameBuffer(framebuffer); + } + + this.func_153034_a(IngestServerTester.IngestTestState.Starting); + this.field_153054_l = System.currentTimeMillis(); + } + } + + @SuppressWarnings("incomplete-switch") + public void func_153041_j() + { + if (!this.func_153032_e() && this.field_153047_e != IngestServerTester.IngestTestState.Uninitalized) + { + if (!this.field_176008_y && !this.field_176007_z) + { + switch (this.field_153047_e) + { + case Starting: + case DoneTestingServer: + if (this.field_153059_q != null) + { + if (this.field_153061_s || !this.field_153056_n) + { + this.field_153059_q.bitrateKbps = 0.0F; + } + + this.func_153035_b(this.field_153059_q); + } + else + { + this.field_153054_l = 0L; + this.field_153061_s = false; + this.field_153056_n = true; + + if (this.field_153047_e != IngestServerTester.IngestTestState.Starting) + { + ++this.field_153062_t; + } + + if (this.field_153062_t < this.field_153046_d.getServers().length) + { + this.field_153059_q = this.field_153046_d.getServers()[this.field_153062_t]; + this.func_153036_a(this.field_153059_q); + } + else + { + this.func_153034_a(IngestServerTester.IngestTestState.Finished); + } + } + + break; + + case ConnectingToServer: + case TestingServer: + this.func_153029_c(this.field_153059_q); + break; + + case Cancelling: + this.func_153034_a(IngestServerTester.IngestTestState.Cancelled); + } + + this.func_153038_n(); + + if (this.field_153047_e == IngestServerTester.IngestTestState.Cancelled || this.field_153047_e == IngestServerTester.IngestTestState.Finished) + { + this.func_153031_o(); + } + } + } + } + + public void func_153039_l() + { + if (!this.func_153032_e() && !this.field_153060_r) + { + this.field_153060_r = true; + + if (this.field_153059_q != null) + { + this.field_153059_q.bitrateKbps = 0.0F; + } + } + } + + protected boolean func_153036_a(IngestServer p_153036_1_) + { + this.field_153056_n = true; + this.field_153050_h = 0L; + this.field_153051_i = RTMPState.Idle; + this.field_153059_q = p_153036_1_; + this.field_176008_y = true; + this.func_153034_a(IngestServerTester.IngestTestState.ConnectingToServer); + ErrorCode errorcode = this.field_153045_c.start(this.field_153052_j, this.audioParameters, p_153036_1_, StartFlags.TTV_Start_BandwidthTest, true); + + if (ErrorCode.failed(errorcode)) + { + this.field_176008_y = false; + this.field_153056_n = false; + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + return false; + } + else + { + this.field_153064_v = this.field_153050_h; + p_153036_1_.bitrateKbps = 0.0F; + this.field_153063_u = 0; + return true; + } + } + + protected void func_153035_b(IngestServer p_153035_1_) + { + if (this.field_176008_y) + { + this.field_153061_s = true; + } + else if (this.field_176009_x) + { + this.field_176007_z = true; + ErrorCode errorcode = this.field_153045_c.stop(true); + + if (ErrorCode.failed(errorcode)) + { + this.field_176005_A.stopCallback(ErrorCode.TTV_EC_SUCCESS); + System.out.println("Stop failed: " + errorcode.toString()); + } + + this.field_153045_c.pollStats(); + } + else + { + this.field_176005_A.stopCallback(ErrorCode.TTV_EC_SUCCESS); + } + } + + protected long func_153037_m() + { + return System.currentTimeMillis() - this.field_153054_l; + } + + protected void func_153038_n() + { + float f = (float)this.func_153037_m(); + + switch (this.field_153047_e) + { + case Starting: + case ConnectingToServer: + case Uninitalized: + case Finished: + case Cancelled: + case Failed: + this.field_153066_x = 0.0F; + break; + + case DoneTestingServer: + this.field_153066_x = 1.0F; + break; + + case TestingServer: + case Cancelling: + default: + this.field_153066_x = f / (float)this.field_153048_f; + } + + switch (this.field_153047_e) + { + case Finished: + case Cancelled: + case Failed: + this.field_153065_w = 1.0F; + break; + + default: + this.field_153065_w = (float)this.field_153062_t / (float)this.field_153046_d.getServers().length; + this.field_153065_w += this.field_153066_x / (float)this.field_153046_d.getServers().length; + } + } + + protected boolean func_153029_c(IngestServer p_153029_1_) + { + if (!this.field_153061_s && !this.field_153060_r && this.func_153037_m() < this.field_153048_f) + { + if (!this.field_176008_y && !this.field_176007_z) + { + ErrorCode errorcode = this.field_153045_c.submitVideoFrame((FrameBuffer)this.field_153055_m.get(this.field_153063_u)); + + if (ErrorCode.failed(errorcode)) + { + this.field_153056_n = false; + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + return false; + } + else + { + this.field_153063_u = (this.field_153063_u + 1) % this.field_153055_m.size(); + this.field_153045_c.pollStats(); + + if (this.field_153051_i == RTMPState.SendVideo) + { + this.func_153034_a(IngestServerTester.IngestTestState.TestingServer); + long i = this.func_153037_m(); + + if (i > 0L && this.field_153050_h > this.field_153064_v) + { + p_153029_1_.bitrateKbps = (float)(this.field_153050_h * 8L) / (float)this.func_153037_m(); + this.field_153064_v = this.field_153050_h; + } + } + + return true; + } + } + else + { + return true; + } + } + else + { + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + return true; + } + } + + protected void func_153031_o() + { + this.field_153059_q = null; + + if (this.field_153055_m != null) + { + for (int i = 0; i < this.field_153055_m.size(); ++i) + { + ((FrameBuffer)this.field_153055_m.get(i)).free(); + } + + this.field_153055_m = null; + } + + if (this.field_153045_c.getStatCallbacks() == this.field_176006_B) + { + this.field_153045_c.setStatCallbacks(this.field_153058_p); + this.field_153058_p = null; + } + + if (this.field_153045_c.getStreamCallbacks() == this.field_176005_A) + { + this.field_153045_c.setStreamCallbacks(this.field_153057_o); + this.field_153057_o = null; + } + } + + protected void func_153034_a(IngestServerTester.IngestTestState p_153034_1_) + { + if (p_153034_1_ != this.field_153047_e) + { + this.field_153047_e = p_153034_1_; + + if (this.field_153044_b != null) + { + this.field_153044_b.func_152907_a(this, p_153034_1_); + } + } + } + + public interface IngestTestListener + { + void func_152907_a(IngestServerTester p_152907_1_, IngestServerTester.IngestTestState p_152907_2_); + } + + public static enum IngestTestState + { + Uninitalized, + Starting, + ConnectingToServer, + TestingServer, + DoneTestingServer, + Finished, + Cancelling, + Cancelled, + Failed; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/Metadata.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/Metadata.java new file mode 100644 index 0000000..a0b9052 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/Metadata.java @@ -0,0 +1,83 @@ +package net.minecraft.client.stream; + +import com.google.common.base.Objects; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import java.util.Map; + +public class Metadata +{ + private static final Gson field_152811_a = new Gson(); + private final String name; + private String description; + private Map payload; + + public Metadata(String p_i46345_1_, String p_i46345_2_) + { + this.name = p_i46345_1_; + this.description = p_i46345_2_; + } + + public Metadata(String p_i1030_1_) + { + this(p_i1030_1_, (String)null); + } + + public void func_152807_a(String p_152807_1_) + { + this.description = p_152807_1_; + } + + public String func_152809_a() + { + return this.description == null ? this.name : this.description; + } + + public void func_152808_a(String p_152808_1_, String p_152808_2_) + { + if (this.payload == null) + { + this.payload = Maps.newHashMap(); + } + + if (this.payload.size() > 50) + { + throw new IllegalArgumentException("Metadata payload is full, cannot add more to it!"); + } + else if (p_152808_1_ == null) + { + throw new IllegalArgumentException("Metadata payload key cannot be null!"); + } + else if (p_152808_1_.length() > 255) + { + throw new IllegalArgumentException("Metadata payload key is too long!"); + } + else if (p_152808_2_ == null) + { + throw new IllegalArgumentException("Metadata payload value cannot be null!"); + } + else if (p_152808_2_.length() > 255) + { + throw new IllegalArgumentException("Metadata payload value is too long!"); + } + else + { + this.payload.put(p_152808_1_, p_152808_2_); + } + } + + public String func_152806_b() + { + return this.payload != null && !this.payload.isEmpty() ? field_152811_a.toJson((Object)this.payload) : null; + } + + public String func_152810_c() + { + return this.name; + } + + public String toString() + { + return Objects.toStringHelper(this).add("name", this.name).add("description", this.description).add("data", this.func_152806_b()).toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataAchievement.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataAchievement.java new file mode 100644 index 0000000..dafc39d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataAchievement.java @@ -0,0 +1,15 @@ +package net.minecraft.client.stream; + +import net.minecraft.stats.Achievement; + +public class MetadataAchievement extends Metadata +{ + public MetadataAchievement(Achievement p_i1032_1_) + { + super("achievement"); + this.func_152808_a("achievement_id", p_i1032_1_.statId); + this.func_152808_a("achievement_name", p_i1032_1_.getStatName().getUnformattedText()); + this.func_152808_a("achievement_description", p_i1032_1_.getDescription()); + this.func_152807_a("Achievement \'" + p_i1032_1_.getStatName().getUnformattedText() + "\' obtained!"); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataCombat.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataCombat.java new file mode 100644 index 0000000..c423e99 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataCombat.java @@ -0,0 +1,26 @@ +package net.minecraft.client.stream; + +import net.minecraft.entity.EntityLivingBase; + +public class MetadataCombat extends Metadata +{ + public MetadataCombat(EntityLivingBase p_i46067_1_, EntityLivingBase p_i46067_2_) + { + super("player_combat"); + this.func_152808_a("player", p_i46067_1_.getName()); + + if (p_i46067_2_ != null) + { + this.func_152808_a("primary_opponent", p_i46067_2_.getName()); + } + + if (p_i46067_2_ != null) + { + this.func_152807_a("Combat between " + p_i46067_1_.getName() + " and " + p_i46067_2_.getName()); + } + else + { + this.func_152807_a("Combat between " + p_i46067_1_.getName() + " and others"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataPlayerDeath.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataPlayerDeath.java new file mode 100644 index 0000000..ba9daf0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/MetadataPlayerDeath.java @@ -0,0 +1,21 @@ +package net.minecraft.client.stream; + +import net.minecraft.entity.EntityLivingBase; + +public class MetadataPlayerDeath extends Metadata +{ + public MetadataPlayerDeath(EntityLivingBase p_i46066_1_, EntityLivingBase p_i46066_2_) + { + super("player_death"); + + if (p_i46066_1_ != null) + { + this.func_152808_a("player", p_i46066_1_.getName()); + } + + if (p_i46066_2_ != null) + { + this.func_152808_a("killer", p_i46066_2_.getName()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/NullStream.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/NullStream.java new file mode 100644 index 0000000..c1e275f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/NullStream.java @@ -0,0 +1,156 @@ +package net.minecraft.client.stream; + +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.chat.ChatUserInfo; + +public class NullStream implements IStream +{ + private final Throwable field_152938_a; + + public NullStream(Throwable p_i1006_1_) + { + this.field_152938_a = p_i1006_1_; + } + + public void shutdownStream() + { + } + + public void func_152935_j() + { + } + + public void func_152922_k() + { + } + + public boolean func_152936_l() + { + return false; + } + + public boolean isReadyToBroadcast() + { + return false; + } + + public boolean isBroadcasting() + { + return false; + } + + public void func_152911_a(Metadata p_152911_1_, long p_152911_2_) + { + } + + public void func_176026_a(Metadata p_176026_1_, long p_176026_2_, long p_176026_4_) + { + } + + public boolean isPaused() + { + return false; + } + + public void requestCommercial() + { + } + + public void pause() + { + } + + public void unpause() + { + } + + public void updateStreamVolume() + { + } + + public void func_152930_t() + { + } + + public void stopBroadcasting() + { + } + + public IngestServer[] func_152925_v() + { + return new IngestServer[0]; + } + + public void func_152909_x() + { + } + + public IngestServerTester func_152932_y() + { + return null; + } + + public boolean func_152908_z() + { + return false; + } + + public int func_152920_A() + { + return 0; + } + + public boolean func_152927_B() + { + return false; + } + + public String func_152921_C() + { + return null; + } + + public ChatUserInfo func_152926_a(String p_152926_1_) + { + return null; + } + + public void func_152917_b(String p_152917_1_) + { + } + + public boolean func_152928_D() + { + return false; + } + + public ErrorCode func_152912_E() + { + return null; + } + + public boolean func_152913_F() + { + return false; + } + + public void muteMicrophone(boolean p_152910_1_) + { + } + + public boolean func_152929_G() + { + return false; + } + + public IStream.AuthFailureReason func_152918_H() + { + return IStream.AuthFailureReason.ERROR; + } + + public Throwable func_152937_a() + { + return this.field_152938_a; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/stream/TwitchStream.java b/Client-1.8.9/src/main/java/net/minecraft/client/stream/TwitchStream.java new file mode 100644 index 0000000..fcb9491 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/stream/TwitchStream.java @@ -0,0 +1,751 @@ +package net.minecraft.client.stream; + +import com.google.common.base.Strings; +import com.google.common.collect.Maps; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.mojang.authlib.properties.Property; +import java.io.IOException; +import java.net.URL; +import java.net.URLEncoder; +import java.util.Map; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.stream.GuiTwitchUserMode; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.HttpUtil; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; +import org.lwjgl.opengl.GL11; +import tv.twitch.AuthToken; +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.EncodingCpuUsage; +import tv.twitch.broadcast.FrameBuffer; +import tv.twitch.broadcast.GameInfo; +import tv.twitch.broadcast.IngestList; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.broadcast.StreamInfo; +import tv.twitch.broadcast.VideoParams; +import tv.twitch.chat.*; + +public class TwitchStream implements BroadcastController.BroadcastListener, ChatController.ChatListener, IngestServerTester.IngestTestListener, IStream +{ + private static final Logger LOGGER = LogManager.getLogger(); + public static final Marker STREAM_MARKER = MarkerManager.getMarker("STREAM"); + private final BroadcastController broadcastController; + private final ChatController chatController; + private String field_176029_e; + private final Minecraft mc; + private final IChatComponent twitchComponent = new ChatComponentText("Twitch"); + private final Map field_152955_g = Maps.newHashMap(); + private Framebuffer framebuffer; + private boolean field_152957_i; + private int targetFPS = 30; + private long field_152959_k = 0L; + private boolean field_152960_l = false; + private boolean loggedIn; + private boolean field_152962_n; + private boolean field_152963_o; + private IStream.AuthFailureReason authFailureReason = IStream.AuthFailureReason.ERROR; + private static boolean field_152965_q; + + public TwitchStream(Minecraft mcIn, final Property streamProperty) + { + this.mc = mcIn; + this.broadcastController = new BroadcastController(); + this.chatController = new ChatController(); + this.broadcastController.setBroadcastListener(this); + this.chatController.func_152990_a(this); + this.broadcastController.func_152842_a("nmt37qblda36pvonovdkbopzfzw3wlq"); + this.chatController.func_152984_a("nmt37qblda36pvonovdkbopzfzw3wlq"); + this.twitchComponent.getChatStyle().setColor(EnumChatFormatting.DARK_PURPLE); + + if (streamProperty != null && !Strings.isNullOrEmpty(streamProperty.getValue()) && OpenGlHelper.framebufferSupported) + { + Thread thread = new Thread("Twitch authenticator") + { + public void run() + { + try + { + URL url = new URL("https://api.twitch.tv/kraken?oauth_token=" + URLEncoder.encode(streamProperty.getValue(), "UTF-8")); + String s = HttpUtil.get(url); + JsonObject jsonobject = JsonUtils.getJsonObject((new JsonParser()).parse(s), "Response"); + JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonobject, "token"); + + if (JsonUtils.getBoolean(jsonobject1, "valid")) + { + String s1 = JsonUtils.getString(jsonobject1, "user_name"); + TwitchStream.LOGGER.debug(TwitchStream.STREAM_MARKER, "Authenticated with twitch; username is {}", new Object[] {s1}); + AuthToken authtoken = new AuthToken(); + authtoken.data = streamProperty.getValue(); + TwitchStream.this.broadcastController.func_152818_a(s1, authtoken); + TwitchStream.this.chatController.func_152998_c(s1); + TwitchStream.this.chatController.func_152994_a(authtoken); + Runtime.getRuntime().addShutdownHook(new Thread("Twitch shutdown hook") + { + public void run() + { + TwitchStream.this.shutdownStream(); + } + }); + TwitchStream.this.broadcastController.func_152817_A(); + TwitchStream.this.chatController.func_175984_n(); + } + else + { + TwitchStream.this.authFailureReason = IStream.AuthFailureReason.INVALID_TOKEN; + TwitchStream.LOGGER.error(TwitchStream.STREAM_MARKER, "Given twitch access token is invalid"); + } + } + catch (IOException ioexception) + { + TwitchStream.this.authFailureReason = IStream.AuthFailureReason.ERROR; + TwitchStream.LOGGER.error(TwitchStream.STREAM_MARKER, (String)"Could not authenticate with twitch", (Throwable)ioexception); + } + } + }; + thread.setDaemon(true); + thread.start(); + } + } + + public void shutdownStream() + { + LOGGER.debug(STREAM_MARKER, "Shutdown streaming"); + this.broadcastController.statCallback(); + this.chatController.func_175988_p(); + } + + public void func_152935_j() + { + int i = this.mc.gameSettings.streamChatEnabled; + boolean flag = this.field_176029_e != null && this.chatController.func_175990_d(this.field_176029_e); + boolean flag1 = this.chatController.func_153000_j() == ChatController.ChatState.Initialized && (this.field_176029_e == null || this.chatController.func_175989_e(this.field_176029_e) == ChatController.EnumChannelState.Disconnected); + + if (i == 2) + { + if (flag) + { + LOGGER.debug(STREAM_MARKER, "Disconnecting from twitch chat per user options"); + this.chatController.func_175991_l(this.field_176029_e); + } + } + else if (i == 1) + { + if (flag1 && this.broadcastController.func_152849_q()) + { + LOGGER.debug(STREAM_MARKER, "Connecting to twitch chat per user options"); + this.func_152942_I(); + } + } + else if (i == 0) + { + if (flag && !this.isBroadcasting()) + { + LOGGER.debug(STREAM_MARKER, "Disconnecting from twitch chat as user is no longer streaming"); + this.chatController.func_175991_l(this.field_176029_e); + } + else if (flag1 && this.isBroadcasting()) + { + LOGGER.debug(STREAM_MARKER, "Connecting to twitch chat as user is streaming"); + this.func_152942_I(); + } + } + + this.broadcastController.func_152821_H(); + this.chatController.func_152997_n(); + } + + protected void func_152942_I() + { + ChatController.ChatState chatcontroller$chatstate = this.chatController.func_153000_j(); + String s = this.broadcastController.getChannelInfo().name; + this.field_176029_e = s; + + if (chatcontroller$chatstate != ChatController.ChatState.Initialized) + { + LOGGER.warn("Invalid twitch chat state {}", new Object[] {chatcontroller$chatstate}); + } + else if (this.chatController.func_175989_e(this.field_176029_e) == ChatController.EnumChannelState.Disconnected) + { + this.chatController.func_152986_d(s); + } + else + { + LOGGER.warn("Invalid twitch chat state {}", new Object[] {chatcontroller$chatstate}); + } + } + + public void func_152922_k() + { + if (this.broadcastController.isBroadcasting() && !this.broadcastController.isBroadcastPaused()) + { + long i = System.nanoTime(); + long j = (long)(1000000000 / this.targetFPS); + long k = i - this.field_152959_k; + boolean flag = k >= j; + + if (flag) + { + FrameBuffer framebuffer = this.broadcastController.func_152822_N(); + Framebuffer framebuffer1 = this.mc.getFramebuffer(); + this.framebuffer.bindFramebuffer(true); + GlStateManager.matrixMode(5889); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double)this.framebuffer.framebufferWidth, (double)this.framebuffer.framebufferHeight, 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.viewport(0, 0, this.framebuffer.framebufferWidth, this.framebuffer.framebufferHeight); + GlStateManager.enableTexture2D(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + float f = (float)this.framebuffer.framebufferWidth; + float f1 = (float)this.framebuffer.framebufferHeight; + float f2 = (float)framebuffer1.framebufferWidth / (float)framebuffer1.framebufferTextureWidth; + float f3 = (float)framebuffer1.framebufferHeight / (float)framebuffer1.framebufferTextureHeight; + framebuffer1.bindFramebufferTexture(); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, 9729.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, 9729.0F); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, (double)f3).endVertex(); + worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, (double)f3).endVertex(); + worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, 0.0D).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).endVertex(); + tessellator.draw(); + framebuffer1.unbindFramebufferTexture(); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5889); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + this.broadcastController.captureFramebuffer(framebuffer); + this.framebuffer.unbindFramebuffer(); + this.broadcastController.submitStreamFrame(framebuffer); + this.field_152959_k = i; + } + } + } + + public boolean func_152936_l() + { + return this.broadcastController.func_152849_q(); + } + + public boolean isReadyToBroadcast() + { + return this.broadcastController.isReadyToBroadcast(); + } + + public boolean isBroadcasting() + { + return this.broadcastController.isBroadcasting(); + } + + public void func_152911_a(Metadata p_152911_1_, long p_152911_2_) + { + if (this.isBroadcasting() && this.field_152957_i) + { + long i = this.broadcastController.getStreamTime(); + + if (!this.broadcastController.func_152840_a(p_152911_1_.func_152810_c(), i + p_152911_2_, p_152911_1_.func_152809_a(), p_152911_1_.func_152806_b())) + { + LOGGER.warn(STREAM_MARKER, "Couldn\'t send stream metadata action at {}: {}", new Object[] {Long.valueOf(i + p_152911_2_), p_152911_1_}); + } + else + { + LOGGER.debug(STREAM_MARKER, "Sent stream metadata action at {}: {}", new Object[] {Long.valueOf(i + p_152911_2_), p_152911_1_}); + } + } + } + + public void func_176026_a(Metadata p_176026_1_, long p_176026_2_, long p_176026_4_) + { + if (this.isBroadcasting() && this.field_152957_i) + { + long i = this.broadcastController.getStreamTime(); + String s = p_176026_1_.func_152809_a(); + String s1 = p_176026_1_.func_152806_b(); + long j = this.broadcastController.func_177946_b(p_176026_1_.func_152810_c(), i + p_176026_2_, s, s1); + + if (j < 0L) + { + LOGGER.warn(STREAM_MARKER, "Could not send stream metadata sequence from {} to {}: {}", new Object[] {Long.valueOf(i + p_176026_2_), Long.valueOf(i + p_176026_4_), p_176026_1_}); + } + else if (this.broadcastController.func_177947_a(p_176026_1_.func_152810_c(), i + p_176026_4_, j, s, s1)) + { + LOGGER.debug(STREAM_MARKER, "Sent stream metadata sequence from {} to {}: {}", new Object[] {Long.valueOf(i + p_176026_2_), Long.valueOf(i + p_176026_4_), p_176026_1_}); + } + else + { + LOGGER.warn(STREAM_MARKER, "Half-sent stream metadata sequence from {} to {}: {}", new Object[] {Long.valueOf(i + p_176026_2_), Long.valueOf(i + p_176026_4_), p_176026_1_}); + } + } + } + + public boolean isPaused() + { + return this.broadcastController.isBroadcastPaused(); + } + + public void requestCommercial() + { + if (this.broadcastController.requestCommercial()) + { + LOGGER.debug(STREAM_MARKER, "Requested commercial from Twitch"); + } + else + { + LOGGER.warn(STREAM_MARKER, "Could not request commercial from Twitch"); + } + } + + public void pause() + { + this.broadcastController.func_152847_F(); + this.field_152962_n = true; + this.updateStreamVolume(); + } + + public void unpause() + { + this.broadcastController.func_152854_G(); + this.field_152962_n = false; + this.updateStreamVolume(); + } + + public void updateStreamVolume() + { + if (this.isBroadcasting()) + { + float f = this.mc.gameSettings.streamGameVolume; + boolean flag = this.field_152962_n || f <= 0.0F; + this.broadcastController.setPlaybackDeviceVolume(flag ? 0.0F : f); + this.broadcastController.setRecordingDeviceVolume(this.func_152929_G() ? 0.0F : this.mc.gameSettings.streamMicVolume); + } + } + + public void func_152930_t() + { + GameSettings gamesettings = this.mc.gameSettings; + VideoParams videoparams = this.broadcastController.func_152834_a(formatStreamKbps(gamesettings.streamKbps), formatStreamFps(gamesettings.streamFps), formatStreamBps(gamesettings.streamBytesPerPixel), (float)this.mc.displayWidth / (float)this.mc.displayHeight); + + switch (gamesettings.streamCompression) + { + case 0: + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_LOW; + break; + + case 1: + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_MEDIUM; + break; + + case 2: + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_HIGH; + } + + if (this.framebuffer == null) + { + this.framebuffer = new Framebuffer(videoparams.outputWidth, videoparams.outputHeight, false); + } + else + { + this.framebuffer.createBindFramebuffer(videoparams.outputWidth, videoparams.outputHeight); + } + + if (gamesettings.streamPreferredServer != null && gamesettings.streamPreferredServer.length() > 0) + { + for (IngestServer ingestserver : this.func_152925_v()) + { + if (ingestserver.serverUrl.equals(gamesettings.streamPreferredServer)) + { + this.broadcastController.setIngestServer(ingestserver); + break; + } + } + } + + this.targetFPS = videoparams.targetFps; + this.field_152957_i = gamesettings.streamSendMetadata; + this.broadcastController.func_152836_a(videoparams); + LOGGER.info(STREAM_MARKER, "Streaming at {}/{} at {} kbps to {}", new Object[] {Integer.valueOf(videoparams.outputWidth), Integer.valueOf(videoparams.outputHeight), Integer.valueOf(videoparams.maxKbps), this.broadcastController.getIngestServer().serverUrl}); + this.broadcastController.func_152828_a((String)null, "Minecraft", (String)null); + } + + public void stopBroadcasting() + { + if (this.broadcastController.stopBroadcasting()) + { + LOGGER.info(STREAM_MARKER, "Stopped streaming to Twitch"); + } + else + { + LOGGER.warn(STREAM_MARKER, "Could not stop streaming to Twitch"); + } + } + + public void func_152900_a(ErrorCode p_152900_1_, AuthToken p_152900_2_) + { + } + + public void func_152897_a(ErrorCode p_152897_1_) + { + if (ErrorCode.succeeded(p_152897_1_)) + { + LOGGER.debug(STREAM_MARKER, "Login attempt successful"); + this.loggedIn = true; + } + else + { + LOGGER.warn(STREAM_MARKER, "Login attempt unsuccessful: {} (error code {})", new Object[] {ErrorCode.getString(p_152897_1_), Integer.valueOf(p_152897_1_.getValue())}); + this.loggedIn = false; + } + } + + public void func_152898_a(ErrorCode p_152898_1_, GameInfo[] p_152898_2_) + { + } + + public void func_152891_a(BroadcastController.BroadcastState p_152891_1_) + { + LOGGER.debug(STREAM_MARKER, "Broadcast state changed to {}", new Object[] {p_152891_1_}); + + if (p_152891_1_ == BroadcastController.BroadcastState.Initialized) + { + this.broadcastController.func_152827_a(BroadcastController.BroadcastState.Authenticated); + } + } + + public void func_152895_a() + { + LOGGER.info(STREAM_MARKER, "Logged out of twitch"); + } + + public void func_152894_a(StreamInfo p_152894_1_) + { + LOGGER.debug(STREAM_MARKER, "Stream info updated; {} viewers on stream ID {}", new Object[] {Integer.valueOf(p_152894_1_.viewers), Long.valueOf(p_152894_1_.streamId)}); + } + + public void func_152896_a(IngestList p_152896_1_) + { + } + + public void func_152893_b(ErrorCode p_152893_1_) + { + LOGGER.warn(STREAM_MARKER, "Issue submitting frame: {} (Error code {})", new Object[] {ErrorCode.getString(p_152893_1_), Integer.valueOf(p_152893_1_.getValue())}); + this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText("Issue streaming frame: " + p_152893_1_ + " (" + ErrorCode.getString(p_152893_1_) + ")"), 2); + } + + public void func_152899_b() + { + this.updateStreamVolume(); + LOGGER.info(STREAM_MARKER, "Broadcast to Twitch has started"); + } + + public void func_152901_c() + { + LOGGER.info(STREAM_MARKER, "Broadcast to Twitch has stopped"); + } + + public void func_152892_c(ErrorCode p_152892_1_) + { + if (p_152892_1_ == ErrorCode.TTV_EC_SOUNDFLOWER_NOT_INSTALLED) + { + IChatComponent ichatcomponent = new ChatComponentTranslation("stream.unavailable.soundflower.chat.link", new Object[0]); + ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://help.mojang.com/customer/portal/articles/1374877-configuring-soundflower-for-streaming-on-apple-computers")); + ichatcomponent.getChatStyle().setUnderlined(Boolean.valueOf(true)); + IChatComponent ichatcomponent1 = new ChatComponentTranslation("stream.unavailable.soundflower.chat", new Object[] {ichatcomponent}); + ichatcomponent1.getChatStyle().setColor(EnumChatFormatting.DARK_RED); + this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent1); + } + else + { + IChatComponent ichatcomponent2 = new ChatComponentTranslation("stream.unavailable.unknown.chat", new Object[] {ErrorCode.getString(p_152892_1_)}); + ichatcomponent2.getChatStyle().setColor(EnumChatFormatting.DARK_RED); + this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent2); + } + } + + public void func_152907_a(IngestServerTester p_152907_1_, IngestServerTester.IngestTestState p_152907_2_) + { + LOGGER.debug(STREAM_MARKER, "Ingest test state changed to {}", new Object[] {p_152907_2_}); + + if (p_152907_2_ == IngestServerTester.IngestTestState.Finished) + { + this.field_152960_l = true; + } + } + + public static int formatStreamFps(float p_152948_0_) + { + return MathHelper.floor_float(10.0F + p_152948_0_ * 50.0F); + } + + public static int formatStreamKbps(float p_152946_0_) + { + return MathHelper.floor_float(230.0F + p_152946_0_ * 3270.0F); + } + + public static float formatStreamBps(float p_152947_0_) + { + return 0.1F + p_152947_0_ * 0.1F; + } + + public IngestServer[] func_152925_v() + { + return this.broadcastController.getIngestList().getServers(); + } + + public void func_152909_x() + { + IngestServerTester ingestservertester = this.broadcastController.func_152838_J(); + + if (ingestservertester != null) + { + ingestservertester.func_153042_a(this); + } + } + + public IngestServerTester func_152932_y() + { + return this.broadcastController.isReady(); + } + + public boolean func_152908_z() + { + return this.broadcastController.isIngestTesting(); + } + + public int func_152920_A() + { + return this.isBroadcasting() ? this.broadcastController.getStreamInfo().viewers : 0; + } + + public void func_176023_d(ErrorCode p_176023_1_) + { + if (ErrorCode.failed(p_176023_1_)) + { + LOGGER.error(STREAM_MARKER, "Chat failed to initialize"); + } + } + + public void func_176022_e(ErrorCode p_176022_1_) + { + if (ErrorCode.failed(p_176022_1_)) + { + LOGGER.error(STREAM_MARKER, "Chat failed to shutdown"); + } + } + + public void func_176017_a(ChatController.ChatState p_176017_1_) + { + } + + public void func_180605_a(String p_180605_1_, ChatRawMessage[] p_180605_2_) + { + for (ChatRawMessage chatrawmessage : p_180605_2_) + { + this.func_176027_a(chatrawmessage.userName, chatrawmessage); + + if (this.func_176028_a(chatrawmessage.modes, chatrawmessage.subscriptions, this.mc.gameSettings.streamChatUserFilter)) + { + IChatComponent ichatcomponent = new ChatComponentText(chatrawmessage.userName); + IChatComponent ichatcomponent1 = new ChatComponentTranslation("chat.stream." + (chatrawmessage.action ? "emote" : "text"), new Object[] {this.twitchComponent, ichatcomponent, EnumChatFormatting.getTextWithoutFormattingCodes(chatrawmessage.message)}); + + if (chatrawmessage.action) + { + ichatcomponent1.getChatStyle().setItalic(Boolean.valueOf(true)); + } + + IChatComponent ichatcomponent2 = new ChatComponentText(""); + ichatcomponent2.appendSibling(new ChatComponentTranslation("stream.userinfo.chatTooltip", new Object[0])); + + for (IChatComponent ichatcomponent3 : GuiTwitchUserMode.func_152328_a(chatrawmessage.modes, chatrawmessage.subscriptions, (IStream)null)) + { + ichatcomponent2.appendText("\n"); + ichatcomponent2.appendSibling(ichatcomponent3); + } + + ichatcomponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, ichatcomponent2)); + ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.TWITCH_USER_INFO, chatrawmessage.userName)); + this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent1); + } + } + } + + public void func_176025_a(String p_176025_1_, ChatTokenizedMessage[] p_176025_2_) + { + } + + private void func_176027_a(String p_176027_1_, ChatRawMessage p_176027_2_) + { + ChatUserInfo chatuserinfo = (ChatUserInfo)this.field_152955_g.get(p_176027_1_); + + if (chatuserinfo == null) + { + chatuserinfo = new ChatUserInfo(); + chatuserinfo.displayName = p_176027_1_; + this.field_152955_g.put(p_176027_1_, chatuserinfo); + } + + chatuserinfo.subscriptions = p_176027_2_.subscriptions; + chatuserinfo.modes = p_176027_2_.modes; + chatuserinfo.nameColorARGB = p_176027_2_.nameColorARGB; + } + + private boolean func_176028_a(Set p_176028_1_, Set p_176028_2_, int p_176028_3_) + { + return p_176028_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_BANNED) ? false : (p_176028_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_ADMINSTRATOR) ? true : (p_176028_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_MODERATOR) ? true : (p_176028_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_STAFF) ? true : (p_176028_3_ == 0 ? true : (p_176028_3_ == 1 ? p_176028_2_.contains(ChatUserSubscription.TTV_CHAT_USERSUB_SUBSCRIBER) : false))))); + } + + public void func_176018_a(String p_176018_1_, ChatUserInfo[] p_176018_2_, ChatUserInfo[] p_176018_3_, ChatUserInfo[] p_176018_4_) + { + for (ChatUserInfo chatuserinfo : p_176018_3_) + { + this.field_152955_g.remove(chatuserinfo.displayName); + } + + for (ChatUserInfo chatuserinfo1 : p_176018_4_) + { + this.field_152955_g.put(chatuserinfo1.displayName, chatuserinfo1); + } + + for (ChatUserInfo chatuserinfo2 : p_176018_2_) + { + this.field_152955_g.put(chatuserinfo2.displayName, chatuserinfo2); + } + } + + public void func_180606_a(String p_180606_1_) + { + LOGGER.debug(STREAM_MARKER, "Chat connected"); + } + + public void func_180607_b(String p_180607_1_) + { + LOGGER.debug(STREAM_MARKER, "Chat disconnected"); + this.field_152955_g.clear(); + } + + public void func_176019_a(String p_176019_1_, String p_176019_2_) + { + } + + public void func_176021_d() + { + } + + public void func_176024_e() + { + } + + public void func_176016_c(String p_176016_1_) + { + } + + public void func_176020_d(String p_176020_1_) + { + } + + public boolean func_152927_B() + { + return this.field_176029_e != null && this.field_176029_e.equals(this.broadcastController.getChannelInfo().name); + } + + public String func_152921_C() + { + return this.field_176029_e; + } + + public ChatUserInfo func_152926_a(String p_152926_1_) + { + return (ChatUserInfo)this.field_152955_g.get(p_152926_1_); + } + + public void func_152917_b(String p_152917_1_) + { + this.chatController.func_175986_a(this.field_176029_e, p_152917_1_); + } + + public boolean func_152928_D() + { + return field_152965_q && this.broadcastController.func_152858_b(); + } + + public ErrorCode func_152912_E() + { + return !field_152965_q ? ErrorCode.TTV_EC_OS_TOO_OLD : this.broadcastController.getErrorCode(); + } + + public boolean func_152913_F() + { + return this.loggedIn; + } + + public void muteMicrophone(boolean p_152910_1_) + { + this.field_152963_o = p_152910_1_; + this.updateStreamVolume(); + } + + public boolean func_152929_G() + { + boolean flag = this.mc.gameSettings.streamMicToggleBehavior == 1; + return this.field_152962_n || this.mc.gameSettings.streamMicVolume <= 0.0F || flag != this.field_152963_o; + } + + public IStream.AuthFailureReason func_152918_H() + { + return this.authFailureReason; + } + + static + { + try + { + if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + System.loadLibrary("avutil-ttv-51"); + System.loadLibrary("swresample-ttv-0"); + System.loadLibrary("libmp3lame-ttv"); + + if (System.getProperty("os.arch").contains("64")) + { + System.loadLibrary("libmfxsw64"); + } + else + { + System.loadLibrary("libmfxsw32"); + } + } + + field_152965_q = true; + } + catch (Throwable var1) + { + field_152965_q = false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/util/JsonBlendingMode.java b/Client-1.8.9/src/main/java/net/minecraft/client/util/JsonBlendingMode.java new file mode 100644 index 0000000..9f154e2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/util/JsonBlendingMode.java @@ -0,0 +1,198 @@ +package net.minecraft.client.util; + +import com.google.gson.JsonObject; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.JsonUtils; +import org.lwjgl.opengl.GL14; + +public class JsonBlendingMode +{ + private static JsonBlendingMode field_148118_a = null; + private final int field_148116_b; + private final int field_148117_c; + private final int field_148114_d; + private final int field_148115_e; + private final int field_148112_f; + private final boolean field_148113_g; + private final boolean field_148119_h; + + private JsonBlendingMode(boolean p_i45084_1_, boolean p_i45084_2_, int p_i45084_3_, int p_i45084_4_, int p_i45084_5_, int p_i45084_6_, int p_i45084_7_) + { + this.field_148113_g = p_i45084_1_; + this.field_148116_b = p_i45084_3_; + this.field_148114_d = p_i45084_4_; + this.field_148117_c = p_i45084_5_; + this.field_148115_e = p_i45084_6_; + this.field_148119_h = p_i45084_2_; + this.field_148112_f = p_i45084_7_; + } + + public JsonBlendingMode() + { + this(false, true, 1, 0, 1, 0, 32774); + } + + public JsonBlendingMode(int p_i45085_1_, int p_i45085_2_, int p_i45085_3_) + { + this(false, false, p_i45085_1_, p_i45085_2_, p_i45085_1_, p_i45085_2_, p_i45085_3_); + } + + public JsonBlendingMode(int p_i45086_1_, int p_i45086_2_, int p_i45086_3_, int p_i45086_4_, int p_i45086_5_) + { + this(true, false, p_i45086_1_, p_i45086_2_, p_i45086_3_, p_i45086_4_, p_i45086_5_); + } + + public void func_148109_a() + { + if (!this.equals(field_148118_a)) + { + if (field_148118_a == null || this.field_148119_h != field_148118_a.func_148111_b()) + { + field_148118_a = this; + + if (this.field_148119_h) + { + GlStateManager.disableBlend(); + return; + } + + GlStateManager.enableBlend(); + } + + GL14.glBlendEquation(this.field_148112_f); + + if (this.field_148113_g) + { + GlStateManager.tryBlendFuncSeparate(this.field_148116_b, this.field_148114_d, this.field_148117_c, this.field_148115_e); + } + else + { + GlStateManager.blendFunc(this.field_148116_b, this.field_148114_d); + } + } + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof JsonBlendingMode)) + { + return false; + } + else + { + JsonBlendingMode jsonblendingmode = (JsonBlendingMode)p_equals_1_; + return this.field_148112_f != jsonblendingmode.field_148112_f ? false : (this.field_148115_e != jsonblendingmode.field_148115_e ? false : (this.field_148114_d != jsonblendingmode.field_148114_d ? false : (this.field_148119_h != jsonblendingmode.field_148119_h ? false : (this.field_148113_g != jsonblendingmode.field_148113_g ? false : (this.field_148117_c != jsonblendingmode.field_148117_c ? false : this.field_148116_b == jsonblendingmode.field_148116_b))))); + } + } + + public int hashCode() + { + int i = this.field_148116_b; + i = 31 * i + this.field_148117_c; + i = 31 * i + this.field_148114_d; + i = 31 * i + this.field_148115_e; + i = 31 * i + this.field_148112_f; + i = 31 * i + (this.field_148113_g ? 1 : 0); + i = 31 * i + (this.field_148119_h ? 1 : 0); + return i; + } + + public boolean func_148111_b() + { + return this.field_148119_h; + } + + public static JsonBlendingMode func_148110_a(JsonObject p_148110_0_) + { + if (p_148110_0_ == null) + { + return new JsonBlendingMode(); + } + else + { + int i = 32774; + int j = 1; + int k = 0; + int l = 1; + int i1 = 0; + boolean flag = true; + boolean flag1 = false; + + if (JsonUtils.isString(p_148110_0_, "func")) + { + i = func_148108_a(p_148110_0_.get("func").getAsString()); + + if (i != 32774) + { + flag = false; + } + } + + if (JsonUtils.isString(p_148110_0_, "srcrgb")) + { + j = func_148107_b(p_148110_0_.get("srcrgb").getAsString()); + + if (j != 1) + { + flag = false; + } + } + + if (JsonUtils.isString(p_148110_0_, "dstrgb")) + { + k = func_148107_b(p_148110_0_.get("dstrgb").getAsString()); + + if (k != 0) + { + flag = false; + } + } + + if (JsonUtils.isString(p_148110_0_, "srcalpha")) + { + l = func_148107_b(p_148110_0_.get("srcalpha").getAsString()); + + if (l != 1) + { + flag = false; + } + + flag1 = true; + } + + if (JsonUtils.isString(p_148110_0_, "dstalpha")) + { + i1 = func_148107_b(p_148110_0_.get("dstalpha").getAsString()); + + if (i1 != 0) + { + flag = false; + } + + flag1 = true; + } + + return flag ? new JsonBlendingMode() : (flag1 ? new JsonBlendingMode(j, k, l, i1, i) : new JsonBlendingMode(j, k, i)); + } + } + + private static int func_148108_a(String p_148108_0_) + { + String s = p_148108_0_.trim().toLowerCase(); + return s.equals("add") ? 32774 : (s.equals("subtract") ? 32778 : (s.equals("reversesubtract") ? 32779 : (s.equals("reverse_subtract") ? 32779 : (s.equals("min") ? 32775 : (s.equals("max") ? 32776 : 32774))))); + } + + private static int func_148107_b(String p_148107_0_) + { + String s = p_148107_0_.trim().toLowerCase(); + s = s.replaceAll("_", ""); + s = s.replaceAll("one", "1"); + s = s.replaceAll("zero", "0"); + s = s.replaceAll("minus", "-"); + return s.equals("0") ? 0 : (s.equals("1") ? 1 : (s.equals("srccolor") ? 768 : (s.equals("1-srccolor") ? 769 : (s.equals("dstcolor") ? 774 : (s.equals("1-dstcolor") ? 775 : (s.equals("srcalpha") ? 770 : (s.equals("1-srcalpha") ? 771 : (s.equals("dstalpha") ? 772 : (s.equals("1-dstalpha") ? 773 : -1))))))))); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/client/util/JsonException.java b/Client-1.8.9/src/main/java/net/minecraft/client/util/JsonException.java new file mode 100644 index 0000000..0b5e8c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/client/util/JsonException.java @@ -0,0 +1,88 @@ +package net.minecraft.client.util; + +import com.google.common.collect.Lists; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import org.apache.commons.lang3.StringUtils; + +public class JsonException extends IOException +{ + private final List field_151383_a = Lists.newArrayList(); + private final String exceptionMessage; + + public JsonException(String message) + { + this.field_151383_a.add(new JsonException.Entry()); + this.exceptionMessage = message; + } + + public JsonException(String message, Throwable cause) + { + super(cause); + this.field_151383_a.add(new JsonException.Entry()); + this.exceptionMessage = message; + } + + public void func_151380_a(String p_151380_1_) + { + ((JsonException.Entry)this.field_151383_a.get(0)).func_151373_a(p_151380_1_); + } + + public void func_151381_b(String p_151381_1_) + { + ((JsonException.Entry)this.field_151383_a.get(0)).field_151376_a = p_151381_1_; + this.field_151383_a.add(0, new JsonException.Entry()); + } + + public String getMessage() + { + return "Invalid " + ((JsonException.Entry)this.field_151383_a.get(this.field_151383_a.size() - 1)).toString() + ": " + this.exceptionMessage; + } + + public static JsonException func_151379_a(Exception p_151379_0_) + { + if (p_151379_0_ instanceof JsonException) + { + return (JsonException)p_151379_0_; + } + else + { + String s = p_151379_0_.getMessage(); + + if (p_151379_0_ instanceof FileNotFoundException) + { + s = "File not found"; + } + + return new JsonException(s, p_151379_0_); + } + } + + public static class Entry + { + private String field_151376_a; + private final List field_151375_b; + + private Entry() + { + this.field_151376_a = null; + this.field_151375_b = Lists.newArrayList(); + } + + private void func_151373_a(String p_151373_1_) + { + this.field_151375_b.add(0, p_151373_1_); + } + + public String func_151372_b() + { + return StringUtils.join((Iterable)this.field_151375_b, "->"); + } + + public String toString() + { + return this.field_151376_a != null ? (!this.field_151375_b.isEmpty() ? this.field_151376_a + " " + this.func_151372_b() : this.field_151376_a) : (!this.field_151375_b.isEmpty() ? "(Unknown file) " + this.func_151372_b() : "(Unknown file)"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandBase.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandBase.java new file mode 100644 index 0000000..f3239a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandBase.java @@ -0,0 +1,728 @@ +package net.minecraft.command; + +import com.google.common.base.Functions; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.primitives.Doubles; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; + +public abstract class CommandBase implements ICommand +{ + private static IAdminCommand theAdmin; + + public int getRequiredPermissionLevel() + { + return 4; + } + + public List getCommandAliases() + { + return Collections.emptyList(); + } + + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return sender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return null; + } + + public static int parseInt(String input) throws NumberInvalidException + { + try + { + return Integer.parseInt(input); + } + catch (NumberFormatException var2) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {input}); + } + } + + public static int parseInt(String input, int min) throws NumberInvalidException + { + return parseInt(input, min, Integer.MAX_VALUE); + } + + public static int parseInt(String input, int min, int max) throws NumberInvalidException + { + int i = parseInt(input); + + if (i < min) + { + throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {Integer.valueOf(i), Integer.valueOf(min)}); + } + else if (i > max) + { + throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {Integer.valueOf(i), Integer.valueOf(max)}); + } + else + { + return i; + } + } + + public static long parseLong(String input) throws NumberInvalidException + { + try + { + return Long.parseLong(input); + } + catch (NumberFormatException var2) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {input}); + } + } + + public static long parseLong(String input, long min, long max) throws NumberInvalidException + { + long i = parseLong(input); + + if (i < min) + { + throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {Long.valueOf(i), Long.valueOf(min)}); + } + else if (i > max) + { + throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {Long.valueOf(i), Long.valueOf(max)}); + } + else + { + return i; + } + } + + public static BlockPos parseBlockPos(ICommandSender sender, String[] args, int startIndex, boolean centerBlock) throws NumberInvalidException + { + BlockPos blockpos = sender.getPosition(); + return new BlockPos(parseDouble((double)blockpos.getX(), args[startIndex], -30000000, 30000000, centerBlock), parseDouble((double)blockpos.getY(), args[startIndex + 1], 0, 256, false), parseDouble((double)blockpos.getZ(), args[startIndex + 2], -30000000, 30000000, centerBlock)); + } + + public static double parseDouble(String input) throws NumberInvalidException + { + try + { + double d0 = Double.parseDouble(input); + + if (!Doubles.isFinite(d0)) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {input}); + } + else + { + return d0; + } + } + catch (NumberFormatException var3) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {input}); + } + } + + public static double parseDouble(String input, double min) throws NumberInvalidException + { + return parseDouble(input, min, Double.MAX_VALUE); + } + + public static double parseDouble(String input, double min, double max) throws NumberInvalidException + { + double d0 = parseDouble(input); + + if (d0 < min) + { + throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(d0), Double.valueOf(min)}); + } + else if (d0 > max) + { + throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(d0), Double.valueOf(max)}); + } + else + { + return d0; + } + } + + public static boolean parseBoolean(String input) throws CommandException + { + if (!input.equals("true") && !input.equals("1")) + { + if (!input.equals("false") && !input.equals("0")) + { + throw new CommandException("commands.generic.boolean.invalid", new Object[] {input}); + } + else + { + return false; + } + } + else + { + return true; + } + } + + public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender sender) throws PlayerNotFoundException + { + if (sender instanceof EntityPlayerMP) + { + return (EntityPlayerMP)sender; + } + else + { + throw new PlayerNotFoundException("You must specify which player you wish to perform this action on.", new Object[0]); + } + } + + public static EntityPlayerMP getPlayer(ICommandSender sender, String username) throws PlayerNotFoundException + { + EntityPlayerMP entityplayermp = PlayerSelector.matchOnePlayer(sender, username); + + if (entityplayermp == null) + { + try + { + entityplayermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUUID(UUID.fromString(username)); + } + catch (IllegalArgumentException var4) + { + ; + } + } + + if (entityplayermp == null) + { + entityplayermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(username); + } + + if (entityplayermp == null) + { + throw new PlayerNotFoundException(); + } + else + { + return entityplayermp; + } + } + + public static Entity getEntity(ICommandSender p_175768_0_, String p_175768_1_) throws EntityNotFoundException + { + return getEntity(p_175768_0_, p_175768_1_, Entity.class); + } + + public static T getEntity(ICommandSender commandSender, String p_175759_1_, Class p_175759_2_) throws EntityNotFoundException + { + Entity entity = PlayerSelector.matchOneEntity(commandSender, p_175759_1_, p_175759_2_); + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (entity == null) + { + entity = minecraftserver.getConfigurationManager().getPlayerByUsername(p_175759_1_); + } + + if (entity == null) + { + try + { + UUID uuid = UUID.fromString(p_175759_1_); + entity = minecraftserver.getEntityFromUuid(uuid); + + if (entity == null) + { + entity = minecraftserver.getConfigurationManager().getPlayerByUUID(uuid); + } + } + catch (IllegalArgumentException var6) + { + throw new EntityNotFoundException("commands.generic.entity.invalidUuid", new Object[0]); + } + } + + if (entity != null && p_175759_2_.isAssignableFrom(entity.getClass())) + { + return (T)entity; + } + else + { + throw new EntityNotFoundException(); + } + } + + public static List func_175763_c(ICommandSender p_175763_0_, String p_175763_1_) throws EntityNotFoundException + { + return (List)(PlayerSelector.hasArguments(p_175763_1_) ? PlayerSelector.matchEntities(p_175763_0_, p_175763_1_, Entity.class) : Lists.newArrayList(new Entity[] {getEntity(p_175763_0_, p_175763_1_)})); + } + + public static String getPlayerName(ICommandSender sender, String query) throws PlayerNotFoundException + { + try + { + return getPlayer(sender, query).getName(); + } + catch (PlayerNotFoundException playernotfoundexception) + { + if (PlayerSelector.hasArguments(query)) + { + throw playernotfoundexception; + } + else + { + return query; + } + } + } + + public static String getEntityName(ICommandSender p_175758_0_, String p_175758_1_) throws EntityNotFoundException + { + try + { + return getPlayer(p_175758_0_, p_175758_1_).getName(); + } + catch (PlayerNotFoundException var5) + { + try + { + return getEntity(p_175758_0_, p_175758_1_).getUniqueID().toString(); + } + catch (EntityNotFoundException entitynotfoundexception) + { + if (PlayerSelector.hasArguments(p_175758_1_)) + { + throw entitynotfoundexception; + } + else + { + return p_175758_1_; + } + } + } + } + + public static IChatComponent getChatComponentFromNthArg(ICommandSender sender, String[] args, int p_147178_2_) throws CommandException, PlayerNotFoundException + { + return getChatComponentFromNthArg(sender, args, p_147178_2_, false); + } + + public static IChatComponent getChatComponentFromNthArg(ICommandSender sender, String[] args, int index, boolean p_147176_3_) throws PlayerNotFoundException + { + IChatComponent ichatcomponent = new ChatComponentText(""); + + for (int i = index; i < args.length; ++i) + { + if (i > index) + { + ichatcomponent.appendText(" "); + } + + IChatComponent ichatcomponent1 = new ChatComponentText(args[i]); + + if (p_147176_3_) + { + IChatComponent ichatcomponent2 = PlayerSelector.matchEntitiesToChatComponent(sender, args[i]); + + if (ichatcomponent2 == null) + { + if (PlayerSelector.hasArguments(args[i])) + { + throw new PlayerNotFoundException(); + } + } + else + { + ichatcomponent1 = ichatcomponent2; + } + } + + ichatcomponent.appendSibling(ichatcomponent1); + } + + return ichatcomponent; + } + + public static String buildString(String[] args, int startPos) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = startPos; i < args.length; ++i) + { + if (i > startPos) + { + stringbuilder.append(" "); + } + + String s = args[i]; + stringbuilder.append(s); + } + + return stringbuilder.toString(); + } + + public static CommandBase.CoordinateArg parseCoordinate(double base, String p_175770_2_, boolean centerBlock) throws NumberInvalidException + { + return parseCoordinate(base, p_175770_2_, -30000000, 30000000, centerBlock); + } + + public static CommandBase.CoordinateArg parseCoordinate(double p_175767_0_, String p_175767_2_, int min, int max, boolean centerBlock) throws NumberInvalidException + { + boolean flag = p_175767_2_.startsWith("~"); + + if (flag && Double.isNaN(p_175767_0_)) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {Double.valueOf(p_175767_0_)}); + } + else + { + double d0 = 0.0D; + + if (!flag || p_175767_2_.length() > 1) + { + boolean flag1 = p_175767_2_.contains("."); + + if (flag) + { + p_175767_2_ = p_175767_2_.substring(1); + } + + d0 += parseDouble(p_175767_2_); + + if (!flag1 && !flag && centerBlock) + { + d0 += 0.5D; + } + } + + if (min != 0 || max != 0) + { + if (d0 < (double)min) + { + throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(d0), Integer.valueOf(min)}); + } + + if (d0 > (double)max) + { + throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(d0), Integer.valueOf(max)}); + } + } + + return new CommandBase.CoordinateArg(d0 + (flag ? p_175767_0_ : 0.0D), d0, flag); + } + } + + public static double parseDouble(double base, String input, boolean centerBlock) throws NumberInvalidException + { + return parseDouble(base, input, -30000000, 30000000, centerBlock); + } + + public static double parseDouble(double base, String input, int min, int max, boolean centerBlock) throws NumberInvalidException + { + boolean flag = input.startsWith("~"); + + if (flag && Double.isNaN(base)) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {Double.valueOf(base)}); + } + else + { + double d0 = flag ? base : 0.0D; + + if (!flag || input.length() > 1) + { + boolean flag1 = input.contains("."); + + if (flag) + { + input = input.substring(1); + } + + d0 += parseDouble(input); + + if (!flag1 && !flag && centerBlock) + { + d0 += 0.5D; + } + } + + if (min != 0 || max != 0) + { + if (d0 < (double)min) + { + throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(d0), Integer.valueOf(min)}); + } + + if (d0 > (double)max) + { + throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(d0), Integer.valueOf(max)}); + } + } + + return d0; + } + } + + public static Item getItemByText(ICommandSender sender, String id) throws NumberInvalidException + { + ResourceLocation resourcelocation = new ResourceLocation(id); + Item item = (Item)Item.itemRegistry.getObject(resourcelocation); + + if (item == null) + { + throw new NumberInvalidException("commands.give.item.notFound", new Object[] {resourcelocation}); + } + else + { + return item; + } + } + + public static Block getBlockByText(ICommandSender sender, String id) throws NumberInvalidException + { + ResourceLocation resourcelocation = new ResourceLocation(id); + + if (!Block.blockRegistry.containsKey(resourcelocation)) + { + throw new NumberInvalidException("commands.give.block.notFound", new Object[] {resourcelocation}); + } + else + { + Block block = (Block)Block.blockRegistry.getObject(resourcelocation); + + if (block == null) + { + throw new NumberInvalidException("commands.give.block.notFound", new Object[] {resourcelocation}); + } + else + { + return block; + } + } + } + + public static String joinNiceString(Object[] elements) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = 0; i < elements.length; ++i) + { + String s = elements[i].toString(); + + if (i > 0) + { + if (i == elements.length - 1) + { + stringbuilder.append(" and "); + } + else + { + stringbuilder.append(", "); + } + } + + stringbuilder.append(s); + } + + return stringbuilder.toString(); + } + + public static IChatComponent join(List components) + { + IChatComponent ichatcomponent = new ChatComponentText(""); + + for (int i = 0; i < components.size(); ++i) + { + if (i > 0) + { + if (i == components.size() - 1) + { + ichatcomponent.appendText(" and "); + } + else if (i > 0) + { + ichatcomponent.appendText(", "); + } + } + + ichatcomponent.appendSibling((IChatComponent)components.get(i)); + } + + return ichatcomponent; + } + + public static String joinNiceStringFromCollection(Collection strings) + { + return joinNiceString(strings.toArray(new String[strings.size()])); + } + + public static List func_175771_a(String[] p_175771_0_, int p_175771_1_, BlockPos p_175771_2_) + { + if (p_175771_2_ == null) + { + return null; + } + else + { + int i = p_175771_0_.length - 1; + String s; + + if (i == p_175771_1_) + { + s = Integer.toString(p_175771_2_.getX()); + } + else if (i == p_175771_1_ + 1) + { + s = Integer.toString(p_175771_2_.getY()); + } + else + { + if (i != p_175771_1_ + 2) + { + return null; + } + + s = Integer.toString(p_175771_2_.getZ()); + } + + return Lists.newArrayList(new String[] {s}); + } + } + + public static List func_181043_b(String[] p_181043_0_, int p_181043_1_, BlockPos p_181043_2_) + { + if (p_181043_2_ == null) + { + return null; + } + else + { + int i = p_181043_0_.length - 1; + String s; + + if (i == p_181043_1_) + { + s = Integer.toString(p_181043_2_.getX()); + } + else + { + if (i != p_181043_1_ + 1) + { + return null; + } + + s = Integer.toString(p_181043_2_.getZ()); + } + + return Lists.newArrayList(new String[] {s}); + } + } + + public static boolean doesStringStartWith(String original, String region) + { + return region.regionMatches(true, 0, original, 0, original.length()); + } + + public static List getListOfStringsMatchingLastWord(String[] args, String... possibilities) + { + return getListOfStringsMatchingLastWord(args, Arrays.asList(possibilities)); + } + + public static List getListOfStringsMatchingLastWord(String[] p_175762_0_, Collection p_175762_1_) + { + String s = p_175762_0_[p_175762_0_.length - 1]; + List list = Lists.newArrayList(); + + if (!p_175762_1_.isEmpty()) + { + for (String s1 : Iterables.transform(p_175762_1_, Functions.toStringFunction())) + { + if (doesStringStartWith(s, s1)) + { + list.add(s1); + } + } + + if (list.isEmpty()) + { + for (Object object : p_175762_1_) + { + if (object instanceof ResourceLocation && doesStringStartWith(s, ((ResourceLocation)object).getResourcePath())) + { + list.add(String.valueOf(object)); + } + } + } + } + + return list; + } + + public boolean isUsernameIndex(String[] args, int index) + { + return false; + } + + public static void notifyOperators(ICommandSender sender, ICommand command, String msgFormat, Object... msgParams) + { + notifyOperators(sender, command, 0, msgFormat, msgParams); + } + + public static void notifyOperators(ICommandSender sender, ICommand command, int p_152374_2_, String msgFormat, Object... msgParams) + { + if (theAdmin != null) + { + theAdmin.notifyOperators(sender, command, p_152374_2_, msgFormat, msgParams); + } + } + + public static void setAdminCommander(IAdminCommand command) + { + theAdmin = command; + } + + public int compareTo(ICommand p_compareTo_1_) + { + return this.getCommandName().compareTo(p_compareTo_1_.getCommandName()); + } + + public static class CoordinateArg + { + private final double field_179633_a; + private final double field_179631_b; + private final boolean field_179632_c; + + protected CoordinateArg(double p_i46051_1_, double p_i46051_3_, boolean p_i46051_5_) + { + this.field_179633_a = p_i46051_1_; + this.field_179631_b = p_i46051_3_; + this.field_179632_c = p_i46051_5_; + } + + public double func_179628_a() + { + return this.field_179633_a; + } + + public double func_179629_b() + { + return this.field_179631_b; + } + + public boolean func_179630_c() + { + return this.field_179632_c; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandBlockData.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandBlockData.java new file mode 100644 index 0000000..219cc0b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandBlockData.java @@ -0,0 +1,94 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class CommandBlockData extends CommandBase +{ + public String getCommandName() + { + return "blockdata"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.blockdata.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 4) + { + throw new WrongUsageException("commands.blockdata.usage", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(sender, args, 0, false); + World world = sender.getEntityWorld(); + + if (!world.isBlockLoaded(blockpos)) + { + throw new CommandException("commands.blockdata.outOfWorld", new Object[0]); + } + else + { + TileEntity tileentity = world.getTileEntity(blockpos); + + if (tileentity == null) + { + throw new CommandException("commands.blockdata.notValid", new Object[0]); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttagcompound.copy(); + NBTTagCompound nbttagcompound2; + + try + { + nbttagcompound2 = JsonToNBT.getTagFromJson(getChatComponentFromNthArg(sender, args, 3).getUnformattedText()); + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.blockdata.tagError", new Object[] {nbtexception.getMessage()}); + } + + nbttagcompound.merge(nbttagcompound2); + nbttagcompound.setInteger("x", blockpos.getX()); + nbttagcompound.setInteger("y", blockpos.getY()); + nbttagcompound.setInteger("z", blockpos.getZ()); + + if (nbttagcompound.equals(nbttagcompound1)) + { + throw new CommandException("commands.blockdata.failed", new Object[] {nbttagcompound.toString()}); + } + else + { + tileentity.readFromNBT(nbttagcompound); + tileentity.markDirty(); + world.markBlockForUpdate(blockpos); + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 1); + notifyOperators(sender, this, "commands.blockdata.success", new Object[] {nbttagcompound.toString()}); + } + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length > 0 && args.length <= 3 ? func_175771_a(args, 0, pos) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandClearInventory.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandClearInventory.java new file mode 100644 index 0000000..6ee9170 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandClearInventory.java @@ -0,0 +1,98 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandClearInventory extends CommandBase +{ + public String getCommandName() + { + return "clear"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.clear.usage"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + EntityPlayerMP entityplayermp = args.length == 0 ? getCommandSenderAsPlayer(sender) : getPlayer(sender, args[0]); + Item item = args.length >= 2 ? getItemByText(sender, args[1]) : null; + int i = args.length >= 3 ? parseInt(args[2], -1) : -1; + int j = args.length >= 4 ? parseInt(args[3], -1) : -1; + NBTTagCompound nbttagcompound = null; + + if (args.length >= 5) + { + try + { + nbttagcompound = JsonToNBT.getTagFromJson(buildString(args, 4)); + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.clear.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + if (args.length >= 2 && item == null) + { + throw new CommandException("commands.clear.failure", new Object[] {entityplayermp.getName()}); + } + else + { + int k = entityplayermp.inventory.clearMatchingItems(item, i, j, nbttagcompound); + entityplayermp.inventoryContainer.detectAndSendChanges(); + + if (!entityplayermp.capabilities.isCreativeMode) + { + entityplayermp.updateHeldItem(); + } + + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, k); + + if (k == 0) + { + throw new CommandException("commands.clear.failure", new Object[] {entityplayermp.getName()}); + } + else + { + if (j == 0) + { + sender.addChatMessage(new ChatComponentTranslation("commands.clear.testing", new Object[] {entityplayermp.getName(), Integer.valueOf(k)})); + } + else + { + notifyOperators(sender, this, "commands.clear.success", new Object[] {entityplayermp.getName(), Integer.valueOf(k)}); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.func_147209_d()) : (args.length == 2 ? getListOfStringsMatchingLastWord(args, Item.itemRegistry.getKeys()) : null); + } + + protected String[] func_147209_d() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandClone.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandClone.java new file mode 100644 index 0000000..be4cd1c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandClone.java @@ -0,0 +1,268 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.LinkedList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +public class CommandClone extends CommandBase +{ + public String getCommandName() + { + return "clone"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.clone.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 9) + { + throw new WrongUsageException("commands.clone.usage", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(sender, args, 0, false); + BlockPos blockpos1 = parseBlockPos(sender, args, 3, false); + BlockPos blockpos2 = parseBlockPos(sender, args, 6, false); + StructureBoundingBox structureboundingbox = new StructureBoundingBox(blockpos, blockpos1); + StructureBoundingBox structureboundingbox1 = new StructureBoundingBox(blockpos2, blockpos2.add(structureboundingbox.func_175896_b())); + int i = structureboundingbox.getXSize() * structureboundingbox.getYSize() * structureboundingbox.getZSize(); + + if (i > 32768) + { + throw new CommandException("commands.clone.tooManyBlocks", new Object[] {Integer.valueOf(i), Integer.valueOf(32768)}); + } + else + { + boolean flag = false; + Block block = null; + int j = -1; + + if ((args.length < 11 || !args[10].equals("force") && !args[10].equals("move")) && structureboundingbox.intersectsWith(structureboundingbox1)) + { + throw new CommandException("commands.clone.noOverlap", new Object[0]); + } + else + { + if (args.length >= 11 && args[10].equals("move")) + { + flag = true; + } + + if (structureboundingbox.minY >= 0 && structureboundingbox.maxY < 256 && structureboundingbox1.minY >= 0 && structureboundingbox1.maxY < 256) + { + World world = sender.getEntityWorld(); + + if (world.isAreaLoaded(structureboundingbox) && world.isAreaLoaded(structureboundingbox1)) + { + boolean flag1 = false; + + if (args.length >= 10) + { + if (args[9].equals("masked")) + { + flag1 = true; + } + else if (args[9].equals("filtered")) + { + if (args.length < 12) + { + throw new WrongUsageException("commands.clone.usage", new Object[0]); + } + + block = getBlockByText(sender, args[11]); + + if (args.length >= 13) + { + j = parseInt(args[12], 0, 15); + } + } + } + + List list = Lists.newArrayList(); + List list1 = Lists.newArrayList(); + List list2 = Lists.newArrayList(); + LinkedList linkedlist = Lists.newLinkedList(); + BlockPos blockpos3 = new BlockPos(structureboundingbox1.minX - structureboundingbox.minX, structureboundingbox1.minY - structureboundingbox.minY, structureboundingbox1.minZ - structureboundingbox.minZ); + + for (int k = structureboundingbox.minZ; k <= structureboundingbox.maxZ; ++k) + { + for (int l = structureboundingbox.minY; l <= structureboundingbox.maxY; ++l) + { + for (int i1 = structureboundingbox.minX; i1 <= structureboundingbox.maxX; ++i1) + { + BlockPos blockpos4 = new BlockPos(i1, l, k); + BlockPos blockpos5 = blockpos4.add(blockpos3); + IBlockState iblockstate = world.getBlockState(blockpos4); + + if ((!flag1 || iblockstate.getBlock() != Blocks.air) && (block == null || iblockstate.getBlock() == block && (j < 0 || iblockstate.getBlock().getMetaFromState(iblockstate) == j))) + { + TileEntity tileentity = world.getTileEntity(blockpos4); + + if (tileentity != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + list1.add(new CommandClone.StaticCloneData(blockpos5, iblockstate, nbttagcompound)); + linkedlist.addLast(blockpos4); + } + else if (!iblockstate.getBlock().isFullBlock() && !iblockstate.getBlock().isFullCube()) + { + list2.add(new CommandClone.StaticCloneData(blockpos5, iblockstate, (NBTTagCompound)null)); + linkedlist.addFirst(blockpos4); + } + else + { + list.add(new CommandClone.StaticCloneData(blockpos5, iblockstate, (NBTTagCompound)null)); + linkedlist.addLast(blockpos4); + } + } + } + } + } + + if (flag) + { + for (BlockPos blockpos6 : linkedlist) + { + TileEntity tileentity1 = world.getTileEntity(blockpos6); + + if (tileentity1 instanceof IInventory) + { + ((IInventory)tileentity1).clear(); + } + + world.setBlockState(blockpos6, Blocks.barrier.getDefaultState(), 2); + } + + for (BlockPos blockpos7 : linkedlist) + { + world.setBlockState(blockpos7, Blocks.air.getDefaultState(), 3); + } + } + + List list3 = Lists.newArrayList(); + list3.addAll(list); + list3.addAll(list1); + list3.addAll(list2); + List list4 = Lists.reverse(list3); + + for (CommandClone.StaticCloneData commandclone$staticclonedata : list4) + { + TileEntity tileentity2 = world.getTileEntity(commandclone$staticclonedata.pos); + + if (tileentity2 instanceof IInventory) + { + ((IInventory)tileentity2).clear(); + } + + world.setBlockState(commandclone$staticclonedata.pos, Blocks.barrier.getDefaultState(), 2); + } + + i = 0; + + for (CommandClone.StaticCloneData commandclone$staticclonedata1 : list3) + { + if (world.setBlockState(commandclone$staticclonedata1.pos, commandclone$staticclonedata1.blockState, 2)) + { + ++i; + } + } + + for (CommandClone.StaticCloneData commandclone$staticclonedata2 : list1) + { + TileEntity tileentity3 = world.getTileEntity(commandclone$staticclonedata2.pos); + + if (commandclone$staticclonedata2.compound != null && tileentity3 != null) + { + commandclone$staticclonedata2.compound.setInteger("x", commandclone$staticclonedata2.pos.getX()); + commandclone$staticclonedata2.compound.setInteger("y", commandclone$staticclonedata2.pos.getY()); + commandclone$staticclonedata2.compound.setInteger("z", commandclone$staticclonedata2.pos.getZ()); + tileentity3.readFromNBT(commandclone$staticclonedata2.compound); + tileentity3.markDirty(); + } + + world.setBlockState(commandclone$staticclonedata2.pos, commandclone$staticclonedata2.blockState, 2); + } + + for (CommandClone.StaticCloneData commandclone$staticclonedata3 : list4) + { + world.notifyNeighborsRespectDebug(commandclone$staticclonedata3.pos, commandclone$staticclonedata3.blockState.getBlock()); + } + + List list5 = world.func_175712_a(structureboundingbox, false); + + if (list5 != null) + { + for (NextTickListEntry nextticklistentry : list5) + { + if (structureboundingbox.isVecInside(nextticklistentry.position)) + { + BlockPos blockpos8 = nextticklistentry.position.add(blockpos3); + world.scheduleBlockUpdate(blockpos8, nextticklistentry.getBlock(), (int)(nextticklistentry.scheduledTime - world.getWorldInfo().getWorldTotalTime()), nextticklistentry.priority); + } + } + } + + if (i <= 0) + { + throw new CommandException("commands.clone.failed", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, i); + notifyOperators(sender, this, "commands.clone.success", new Object[] {Integer.valueOf(i)}); + } + } + else + { + throw new CommandException("commands.clone.outOfWorld", new Object[0]); + } + } + else + { + throw new CommandException("commands.clone.outOfWorld", new Object[0]); + } + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length > 0 && args.length <= 3 ? func_175771_a(args, 0, pos) : (args.length > 3 && args.length <= 6 ? func_175771_a(args, 3, pos) : (args.length > 6 && args.length <= 9 ? func_175771_a(args, 6, pos) : (args.length == 10 ? getListOfStringsMatchingLastWord(args, new String[] {"replace", "masked", "filtered"}): (args.length == 11 ? getListOfStringsMatchingLastWord(args, new String[] {"normal", "force", "move"}): (args.length == 12 && "filtered".equals(args[9]) ? getListOfStringsMatchingLastWord(args, Block.blockRegistry.getKeys()) : null))))); + } + + static class StaticCloneData + { + public final BlockPos pos; + public final IBlockState blockState; + public final NBTTagCompound compound; + + public StaticCloneData(BlockPos posIn, IBlockState stateIn, NBTTagCompound compoundIn) + { + this.pos = posIn; + this.blockState = stateIn; + this.compound = compoundIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandCompare.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandCompare.java new file mode 100644 index 0000000..d241427 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandCompare.java @@ -0,0 +1,143 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +public class CommandCompare extends CommandBase +{ + public String getCommandName() + { + return "testforblocks"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.compare.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 9) + { + throw new WrongUsageException("commands.compare.usage", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(sender, args, 0, false); + BlockPos blockpos1 = parseBlockPos(sender, args, 3, false); + BlockPos blockpos2 = parseBlockPos(sender, args, 6, false); + StructureBoundingBox structureboundingbox = new StructureBoundingBox(blockpos, blockpos1); + StructureBoundingBox structureboundingbox1 = new StructureBoundingBox(blockpos2, blockpos2.add(structureboundingbox.func_175896_b())); + int i = structureboundingbox.getXSize() * structureboundingbox.getYSize() * structureboundingbox.getZSize(); + + if (i > 524288) + { + throw new CommandException("commands.compare.tooManyBlocks", new Object[] {Integer.valueOf(i), Integer.valueOf(524288)}); + } + else if (structureboundingbox.minY >= 0 && structureboundingbox.maxY < 256 && structureboundingbox1.minY >= 0 && structureboundingbox1.maxY < 256) + { + World world = sender.getEntityWorld(); + + if (world.isAreaLoaded(structureboundingbox) && world.isAreaLoaded(structureboundingbox1)) + { + boolean flag = false; + + if (args.length > 9 && args[9].equals("masked")) + { + flag = true; + } + + i = 0; + BlockPos blockpos3 = new BlockPos(structureboundingbox1.minX - structureboundingbox.minX, structureboundingbox1.minY - structureboundingbox.minY, structureboundingbox1.minZ - structureboundingbox.minZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos(); + + for (int j = structureboundingbox.minZ; j <= structureboundingbox.maxZ; ++j) + { + for (int k = structureboundingbox.minY; k <= structureboundingbox.maxY; ++k) + { + for (int l = structureboundingbox.minX; l <= structureboundingbox.maxX; ++l) + { + blockpos$mutableblockpos.set(l, k, j); + blockpos$mutableblockpos1.set(l + blockpos3.getX(), k + blockpos3.getY(), j + blockpos3.getZ()); + boolean flag1 = false; + IBlockState iblockstate = world.getBlockState(blockpos$mutableblockpos); + + if (!flag || iblockstate.getBlock() != Blocks.air) + { + if (iblockstate == world.getBlockState(blockpos$mutableblockpos1)) + { + TileEntity tileentity = world.getTileEntity(blockpos$mutableblockpos); + TileEntity tileentity1 = world.getTileEntity(blockpos$mutableblockpos1); + + if (tileentity != null && tileentity1 != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("x"); + nbttagcompound.removeTag("y"); + nbttagcompound.removeTag("z"); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + tileentity1.writeToNBT(nbttagcompound1); + nbttagcompound1.removeTag("x"); + nbttagcompound1.removeTag("y"); + nbttagcompound1.removeTag("z"); + + if (!nbttagcompound.equals(nbttagcompound1)) + { + flag1 = true; + } + } + else if (tileentity != null) + { + flag1 = true; + } + } + else + { + flag1 = true; + } + + ++i; + + if (flag1) + { + throw new CommandException("commands.compare.failed", new Object[0]); + } + } + } + } + } + + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, i); + notifyOperators(sender, this, "commands.compare.success", new Object[] {Integer.valueOf(i)}); + } + else + { + throw new CommandException("commands.compare.outOfWorld", new Object[0]); + } + } + else + { + throw new CommandException("commands.compare.outOfWorld", new Object[0]); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length > 0 && args.length <= 3 ? func_175771_a(args, 0, pos) : (args.length > 3 && args.length <= 6 ? func_175771_a(args, 3, pos) : (args.length > 6 && args.length <= 9 ? func_175771_a(args, 6, pos) : (args.length == 10 ? getListOfStringsMatchingLastWord(args, new String[] {"masked", "all"}): null))); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandDebug.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandDebug.java new file mode 100644 index 0000000..e5bd7e7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandDebug.java @@ -0,0 +1,167 @@ +package net.minecraft.command; + +import java.io.File; +import java.io.FileWriter; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CommandDebug extends CommandBase +{ + private static final Logger logger = LogManager.getLogger(); + private long profileStartTime; + private int profileStartTick; + + public String getCommandName() + { + return "debug"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.debug.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.debug.usage", new Object[0]); + } + else + { + if (args[0].equals("start")) + { + if (args.length != 1) + { + throw new WrongUsageException("commands.debug.usage", new Object[0]); + } + + notifyOperators(sender, this, "commands.debug.start", new Object[0]); + MinecraftServer.getServer().enableProfiling(); + this.profileStartTime = MinecraftServer.getCurrentTimeMillis(); + this.profileStartTick = MinecraftServer.getServer().getTickCounter(); + } + else + { + if (!args[0].equals("stop")) + { + throw new WrongUsageException("commands.debug.usage", new Object[0]); + } + + if (args.length != 1) + { + throw new WrongUsageException("commands.debug.usage", new Object[0]); + } + + if (!MinecraftServer.getServer().theProfiler.profilingEnabled) + { + throw new CommandException("commands.debug.notStarted", new Object[0]); + } + + long i = MinecraftServer.getCurrentTimeMillis(); + int j = MinecraftServer.getServer().getTickCounter(); + long k = i - this.profileStartTime; + int l = j - this.profileStartTick; + this.saveProfileResults(k, l); + MinecraftServer.getServer().theProfiler.profilingEnabled = false; + notifyOperators(sender, this, "commands.debug.stop", new Object[] {Float.valueOf((float)k / 1000.0F), Integer.valueOf(l)}); + } + } + } + + private void saveProfileResults(long timeSpan, int tickSpan) + { + File file1 = new File(MinecraftServer.getServer().getFile("debug"), "profile-results-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + ".txt"); + file1.getParentFile().mkdirs(); + + try + { + FileWriter filewriter = new FileWriter(file1); + filewriter.write(this.getProfileResults(timeSpan, tickSpan)); + filewriter.close(); + } + catch (Throwable throwable) + { + logger.error("Could not save profiler results to " + file1, throwable); + } + } + + private String getProfileResults(long timeSpan, int tickSpan) + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append("---- Minecraft Profiler Results ----\n"); + stringbuilder.append("// "); + stringbuilder.append(getWittyComment()); + stringbuilder.append("\n\n"); + stringbuilder.append("Time span: ").append(timeSpan).append(" ms\n"); + stringbuilder.append("Tick span: ").append(tickSpan).append(" ticks\n"); + stringbuilder.append("// This is approximately ").append(String.format("%.2f", new Object[] {Float.valueOf((float)tickSpan / ((float)timeSpan / 1000.0F))})).append(" ticks per second. It should be ").append((int)20).append(" ticks per second\n\n"); + stringbuilder.append("--- BEGIN PROFILE DUMP ---\n\n"); + this.func_147202_a(0, "root", stringbuilder); + stringbuilder.append("--- END PROFILE DUMP ---\n\n"); + return stringbuilder.toString(); + } + + private void func_147202_a(int p_147202_1_, String p_147202_2_, StringBuilder stringBuilder) + { + List list = MinecraftServer.getServer().theProfiler.getProfilingData(p_147202_2_); + + if (list != null && list.size() >= 3) + { + for (int i = 1; i < list.size(); ++i) + { + Profiler.Result profiler$result = (Profiler.Result)list.get(i); + stringBuilder.append(String.format("[%02d] ", new Object[] {Integer.valueOf(p_147202_1_)})); + + for (int j = 0; j < p_147202_1_; ++j) + { + stringBuilder.append(" "); + } + + stringBuilder.append(profiler$result.field_76331_c).append(" - ").append(String.format("%.2f", new Object[] {Double.valueOf(profiler$result.field_76332_a)})).append("%/").append(String.format("%.2f", new Object[] {Double.valueOf(profiler$result.field_76330_b)})).append("%\n"); + + if (!profiler$result.field_76331_c.equals("unspecified")) + { + try + { + this.func_147202_a(p_147202_1_ + 1, p_147202_2_ + "." + profiler$result.field_76331_c, stringBuilder); + } + catch (Exception exception) + { + stringBuilder.append("[[ EXCEPTION ").append((Object)exception).append(" ]]"); + } + } + } + } + } + + private static String getWittyComment() + { + String[] astring = new String[] {"Shiny numbers!", "Am I not running fast enough? :(", "I\'m working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!", "Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers", "Now with the same numbers", "You should add flames to things, it makes them go faster!", "Do you feel the need for... optimization?", "*cracks redstone whip*", "Maybe if you treated it better then it\'ll have more motivation to work faster! Poor server."}; + + try + { + return astring[(int)(System.nanoTime() % (long)astring.length)]; + } + catch (Throwable var2) + { + return "Witty comment unavailable :("; + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"start", "stop"}): null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandDefaultGameMode.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandDefaultGameMode.java new file mode 100644 index 0000000..af05e84 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandDefaultGameMode.java @@ -0,0 +1,48 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.WorldSettings; + +public class CommandDefaultGameMode extends CommandGameMode +{ + public String getCommandName() + { + return "defaultgamemode"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.defaultgamemode.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length <= 0) + { + throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]); + } + else + { + WorldSettings.GameType worldsettings$gametype = this.getGameModeFromCommand(sender, args[0]); + this.setGameType(worldsettings$gametype); + notifyOperators(sender, this, "commands.defaultgamemode.success", new Object[] {new ChatComponentTranslation("gameMode." + worldsettings$gametype.getName(), new Object[0])}); + } + } + + protected void setGameType(WorldSettings.GameType gameMode) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + minecraftserver.setGameType(gameMode); + + if (minecraftserver.getForceGamemode()) + { + for (EntityPlayerMP entityplayermp : MinecraftServer.getServer().getConfigurationManager().getPlayerList()) + { + entityplayermp.setGameType(gameMode); + entityplayermp.fallDistance = 0.0F; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandDifficulty.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandDifficulty.java new file mode 100644 index 0000000..deac47d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandDifficulty.java @@ -0,0 +1,49 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.EnumDifficulty; + +public class CommandDifficulty extends CommandBase +{ + public String getCommandName() + { + return "difficulty"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.difficulty.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length <= 0) + { + throw new WrongUsageException("commands.difficulty.usage", new Object[0]); + } + else + { + EnumDifficulty enumdifficulty = this.getDifficultyFromCommand(args[0]); + MinecraftServer.getServer().setDifficultyForAllWorlds(enumdifficulty); + notifyOperators(sender, this, "commands.difficulty.success", new Object[] {new ChatComponentTranslation(enumdifficulty.getDifficultyResourceKey(), new Object[0])}); + } + } + + protected EnumDifficulty getDifficultyFromCommand(String p_180531_1_) throws CommandException, NumberInvalidException + { + return !p_180531_1_.equalsIgnoreCase("peaceful") && !p_180531_1_.equalsIgnoreCase("p") ? (!p_180531_1_.equalsIgnoreCase("easy") && !p_180531_1_.equalsIgnoreCase("e") ? (!p_180531_1_.equalsIgnoreCase("normal") && !p_180531_1_.equalsIgnoreCase("n") ? (!p_180531_1_.equalsIgnoreCase("hard") && !p_180531_1_.equalsIgnoreCase("h") ? EnumDifficulty.getDifficultyEnum(parseInt(p_180531_1_, 0, 3)) : EnumDifficulty.HARD) : EnumDifficulty.NORMAL) : EnumDifficulty.EASY) : EnumDifficulty.PEACEFUL; + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"peaceful", "easy", "normal", "hard"}): null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandEffect.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandEffect.java new file mode 100644 index 0000000..7c373ea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandEffect.java @@ -0,0 +1,146 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandEffect extends CommandBase +{ + public String getCommandName() + { + return "effect"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.effect.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.effect.usage", new Object[0]); + } + else + { + EntityLivingBase entitylivingbase = (EntityLivingBase)getEntity(sender, args[0], EntityLivingBase.class); + + if (args[1].equals("clear")) + { + if (entitylivingbase.getActivePotionEffects().isEmpty()) + { + throw new CommandException("commands.effect.failure.notActive.all", new Object[] {entitylivingbase.getName()}); + } + else + { + entitylivingbase.clearActivePotions(); + notifyOperators(sender, this, "commands.effect.success.removed.all", new Object[] {entitylivingbase.getName()}); + } + } + else + { + int i; + + try + { + i = parseInt(args[1], 1); + } + catch (NumberInvalidException numberinvalidexception) + { + Potion potion = Potion.getPotionFromResourceLocation(args[1]); + + if (potion == null) + { + throw numberinvalidexception; + } + + i = potion.id; + } + + int j = 600; + int l = 30; + int k = 0; + + if (i >= 0 && i < Potion.potionTypes.length && Potion.potionTypes[i] != null) + { + Potion potion1 = Potion.potionTypes[i]; + + if (args.length >= 3) + { + l = parseInt(args[2], 0, 1000000); + + if (potion1.isInstant()) + { + j = l; + } + else + { + j = l * 20; + } + } + else if (potion1.isInstant()) + { + j = 1; + } + + if (args.length >= 4) + { + k = parseInt(args[3], 0, 255); + } + + boolean flag = true; + + if (args.length >= 5 && "true".equalsIgnoreCase(args[4])) + { + flag = false; + } + + if (l > 0) + { + PotionEffect potioneffect = new PotionEffect(i, j, k, false, flag); + entitylivingbase.addPotionEffect(potioneffect); + notifyOperators(sender, this, "commands.effect.success", new Object[] {new ChatComponentTranslation(potioneffect.getEffectName(), new Object[0]), Integer.valueOf(i), Integer.valueOf(k), entitylivingbase.getName(), Integer.valueOf(l)}); + } + else if (entitylivingbase.isPotionActive(i)) + { + entitylivingbase.removePotionEffect(i); + notifyOperators(sender, this, "commands.effect.success.removed", new Object[] {new ChatComponentTranslation(potion1.getName(), new Object[0]), entitylivingbase.getName()}); + } + else + { + throw new CommandException("commands.effect.failure.notActive", new Object[] {new ChatComponentTranslation(potion1.getName(), new Object[0]), entitylivingbase.getName()}); + } + } + else + { + throw new NumberInvalidException("commands.effect.notFound", new Object[] {Integer.valueOf(i)}); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.getAllUsernames()) : (args.length == 2 ? getListOfStringsMatchingLastWord(args, Potion.getPotionLocations()) : (args.length == 5 ? getListOfStringsMatchingLastWord(args, new String[] {"true", "false"}): null)); + } + + protected String[] getAllUsernames() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandEnchant.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandEnchant.java new file mode 100644 index 0000000..67ff6ec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandEnchant.java @@ -0,0 +1,127 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandEnchant extends CommandBase +{ + public String getCommandName() + { + return "enchant"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.enchant.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.enchant.usage", new Object[0]); + } + else + { + EntityPlayer entityplayer = getPlayer(sender, args[0]); + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 0); + int i; + + try + { + i = parseInt(args[1], 0); + } + catch (NumberInvalidException numberinvalidexception) + { + Enchantment enchantment = Enchantment.getEnchantmentByLocation(args[1]); + + if (enchantment == null) + { + throw numberinvalidexception; + } + + i = enchantment.effectId; + } + + int j = 1; + ItemStack itemstack = entityplayer.getCurrentEquippedItem(); + + if (itemstack == null) + { + throw new CommandException("commands.enchant.noItem", new Object[0]); + } + else + { + Enchantment enchantment1 = Enchantment.getEnchantmentById(i); + + if (enchantment1 == null) + { + throw new NumberInvalidException("commands.enchant.notFound", new Object[] {Integer.valueOf(i)}); + } + else if (!enchantment1.canApply(itemstack)) + { + throw new CommandException("commands.enchant.cantEnchant", new Object[0]); + } + else + { + if (args.length >= 3) + { + j = parseInt(args[2], enchantment1.getMinLevel(), enchantment1.getMaxLevel()); + } + + if (itemstack.hasTagCompound()) + { + NBTTagList nbttaglist = itemstack.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (int k = 0; k < nbttaglist.tagCount(); ++k) + { + int l = nbttaglist.getCompoundTagAt(k).getShort("id"); + + if (Enchantment.getEnchantmentById(l) != null) + { + Enchantment enchantment2 = Enchantment.getEnchantmentById(l); + + if (!enchantment2.canApplyTogether(enchantment1)) + { + throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment1.getTranslatedName(j), enchantment2.getTranslatedName(nbttaglist.getCompoundTagAt(k).getShort("lvl"))}); + } + } + } + } + } + + itemstack.addEnchantment(enchantment1, j); + notifyOperators(sender, this, "commands.enchant.success", new Object[0]); + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 1); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.getListOfPlayers()) : (args.length == 2 ? getListOfStringsMatchingLastWord(args, Enchantment.func_181077_c()) : null); + } + + protected String[] getListOfPlayers() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandEntityData.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandEntityData.java new file mode 100644 index 0000000..de4eac3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandEntityData.java @@ -0,0 +1,77 @@ +package net.minecraft.command; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; + +public class CommandEntityData extends CommandBase +{ + public String getCommandName() + { + return "entitydata"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.entitydata.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.entitydata.usage", new Object[0]); + } + else + { + Entity entity = getEntity(sender, args[0]); + + if (entity instanceof EntityPlayer) + { + throw new CommandException("commands.entitydata.noPlayers", new Object[] {entity.getDisplayName()}); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + entity.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttagcompound.copy(); + NBTTagCompound nbttagcompound2; + + try + { + nbttagcompound2 = JsonToNBT.getTagFromJson(getChatComponentFromNthArg(sender, args, 1).getUnformattedText()); + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.entitydata.tagError", new Object[] {nbtexception.getMessage()}); + } + + nbttagcompound2.removeTag("UUIDMost"); + nbttagcompound2.removeTag("UUIDLeast"); + nbttagcompound.merge(nbttagcompound2); + + if (nbttagcompound.equals(nbttagcompound1)) + { + throw new CommandException("commands.entitydata.failed", new Object[] {nbttagcompound.toString()}); + } + else + { + entity.readFromNBT(nbttagcompound); + notifyOperators(sender, this, "commands.entitydata.success", new Object[] {nbttagcompound.toString()}); + } + } + } + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandException.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandException.java new file mode 100644 index 0000000..90a482f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandException.java @@ -0,0 +1,17 @@ +package net.minecraft.command; + +public class CommandException extends Exception +{ + private final Object[] errorObjects; + + public CommandException(String message, Object... objects) + { + super(message); + this.errorObjects = objects; + } + + public Object[] getErrorObjects() + { + return this.errorObjects; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandExecuteAt.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandExecuteAt.java new file mode 100644 index 0000000..711400b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandExecuteAt.java @@ -0,0 +1,136 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class CommandExecuteAt extends CommandBase +{ + public String getCommandName() + { + return "execute"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.execute.usage"; + } + + public void processCommand(final ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 5) + { + throw new WrongUsageException("commands.execute.usage", new Object[0]); + } + else + { + final Entity entity = getEntity(sender, args[0], Entity.class); + final double d0 = parseDouble(entity.posX, args[1], false); + final double d1 = parseDouble(entity.posY, args[2], false); + final double d2 = parseDouble(entity.posZ, args[3], false); + final BlockPos blockpos = new BlockPos(d0, d1, d2); + int i = 4; + + if ("detect".equals(args[4]) && args.length > 10) + { + World world = entity.getEntityWorld(); + double d3 = parseDouble(d0, args[5], false); + double d4 = parseDouble(d1, args[6], false); + double d5 = parseDouble(d2, args[7], false); + Block block = getBlockByText(sender, args[8]); + int k = parseInt(args[9], -1, 15); + BlockPos blockpos1 = new BlockPos(d3, d4, d5); + IBlockState iblockstate = world.getBlockState(blockpos1); + + if (iblockstate.getBlock() != block || k >= 0 && iblockstate.getBlock().getMetaFromState(iblockstate) != k) + { + throw new CommandException("commands.execute.failed", new Object[] {"detect", entity.getName()}); + } + + i = 10; + } + + String s = buildString(args, i); + ICommandSender icommandsender = new ICommandSender() + { + public String getName() + { + return entity.getName(); + } + public IChatComponent getDisplayName() + { + return entity.getDisplayName(); + } + public void addChatMessage(IChatComponent component) + { + sender.addChatMessage(component); + } + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return sender.canCommandSenderUseCommand(permLevel, commandName); + } + public BlockPos getPosition() + { + return blockpos; + } + public Vec3 getPositionVector() + { + return new Vec3(d0, d1, d2); + } + public World getEntityWorld() + { + return entity.worldObj; + } + public Entity getCommandSenderEntity() + { + return entity; + } + public boolean sendCommandFeedback() + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + return minecraftserver == null || minecraftserver.worldServers[0].getGameRules().getBoolean("commandBlockOutput"); + } + public void setCommandStat(CommandResultStats.Type type, int amount) + { + entity.setCommandStat(type, amount); + } + }; + ICommandManager icommandmanager = MinecraftServer.getServer().getCommandManager(); + + try + { + int j = icommandmanager.executeCommand(icommandsender, s); + + if (j < 1) + { + throw new CommandException("commands.execute.allInvocationsFailed", new Object[] {s}); + } + } + catch (Throwable var23) + { + throw new CommandException("commands.execute.failed", new Object[] {s, entity.getName()}); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : (args.length > 1 && args.length <= 4 ? func_175771_a(args, 1, pos) : (args.length > 5 && args.length <= 8 && "detect".equals(args[4]) ? func_175771_a(args, 5, pos) : (args.length == 9 && "detect".equals(args[4]) ? getListOfStringsMatchingLastWord(args, Block.blockRegistry.getKeys()) : null))); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandFill.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandFill.java new file mode 100644 index 0000000..23a26d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandFill.java @@ -0,0 +1,218 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class CommandFill extends CommandBase +{ + public String getCommandName() + { + return "fill"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.fill.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 7) + { + throw new WrongUsageException("commands.fill.usage", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(sender, args, 0, false); + BlockPos blockpos1 = parseBlockPos(sender, args, 3, false); + Block block = CommandBase.getBlockByText(sender, args[6]); + int i = 0; + + if (args.length >= 8) + { + i = parseInt(args[7], 0, 15); + } + + BlockPos blockpos2 = new BlockPos(Math.min(blockpos.getX(), blockpos1.getX()), Math.min(blockpos.getY(), blockpos1.getY()), Math.min(blockpos.getZ(), blockpos1.getZ())); + BlockPos blockpos3 = new BlockPos(Math.max(blockpos.getX(), blockpos1.getX()), Math.max(blockpos.getY(), blockpos1.getY()), Math.max(blockpos.getZ(), blockpos1.getZ())); + int j = (blockpos3.getX() - blockpos2.getX() + 1) * (blockpos3.getY() - blockpos2.getY() + 1) * (blockpos3.getZ() - blockpos2.getZ() + 1); + + if (j > 32768) + { + throw new CommandException("commands.fill.tooManyBlocks", new Object[] {Integer.valueOf(j), Integer.valueOf(32768)}); + } + else if (blockpos2.getY() >= 0 && blockpos3.getY() < 256) + { + World world = sender.getEntityWorld(); + + for (int k = blockpos2.getZ(); k < blockpos3.getZ() + 16; k += 16) + { + for (int l = blockpos2.getX(); l < blockpos3.getX() + 16; l += 16) + { + if (!world.isBlockLoaded(new BlockPos(l, blockpos3.getY() - blockpos2.getY(), k))) + { + throw new CommandException("commands.fill.outOfWorld", new Object[0]); + } + } + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + if (args.length >= 10 && block.hasTileEntity()) + { + String s = getChatComponentFromNthArg(sender, args, 9).getUnformattedText(); + + try + { + nbttagcompound = JsonToNBT.getTagFromJson(s); + flag = true; + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.fill.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + List list = Lists.newArrayList(); + j = 0; + + for (int i1 = blockpos2.getZ(); i1 <= blockpos3.getZ(); ++i1) + { + for (int j1 = blockpos2.getY(); j1 <= blockpos3.getY(); ++j1) + { + for (int k1 = blockpos2.getX(); k1 <= blockpos3.getX(); ++k1) + { + BlockPos blockpos4 = new BlockPos(k1, j1, i1); + + if (args.length >= 9) + { + if (!args[8].equals("outline") && !args[8].equals("hollow")) + { + if (args[8].equals("destroy")) + { + world.destroyBlock(blockpos4, true); + } + else if (args[8].equals("keep")) + { + if (!world.isAirBlock(blockpos4)) + { + continue; + } + } + else if (args[8].equals("replace") && !block.hasTileEntity()) + { + if (args.length > 9) + { + Block block1 = CommandBase.getBlockByText(sender, args[9]); + + if (world.getBlockState(blockpos4).getBlock() != block1) + { + continue; + } + } + + if (args.length > 10) + { + int l1 = CommandBase.parseInt(args[10]); + IBlockState iblockstate = world.getBlockState(blockpos4); + + if (iblockstate.getBlock().getMetaFromState(iblockstate) != l1) + { + continue; + } + } + } + } + else if (k1 != blockpos2.getX() && k1 != blockpos3.getX() && j1 != blockpos2.getY() && j1 != blockpos3.getY() && i1 != blockpos2.getZ() && i1 != blockpos3.getZ()) + { + if (args[8].equals("hollow")) + { + world.setBlockState(blockpos4, Blocks.air.getDefaultState(), 2); + list.add(blockpos4); + } + + continue; + } + } + + TileEntity tileentity1 = world.getTileEntity(blockpos4); + + if (tileentity1 != null) + { + if (tileentity1 instanceof IInventory) + { + ((IInventory)tileentity1).clear(); + } + + world.setBlockState(blockpos4, Blocks.barrier.getDefaultState(), block == Blocks.barrier ? 2 : 4); + } + + IBlockState iblockstate1 = block.getStateFromMeta(i); + + if (world.setBlockState(blockpos4, iblockstate1, 2)) + { + list.add(blockpos4); + ++j; + + if (flag) + { + TileEntity tileentity = world.getTileEntity(blockpos4); + + if (tileentity != null) + { + nbttagcompound.setInteger("x", blockpos4.getX()); + nbttagcompound.setInteger("y", blockpos4.getY()); + nbttagcompound.setInteger("z", blockpos4.getZ()); + tileentity.readFromNBT(nbttagcompound); + } + } + } + } + } + } + + for (BlockPos blockpos5 : list) + { + Block block2 = world.getBlockState(blockpos5).getBlock(); + world.notifyNeighborsRespectDebug(blockpos5, block2); + } + + if (j <= 0) + { + throw new CommandException("commands.fill.failed", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, j); + notifyOperators(sender, this, "commands.fill.success", new Object[] {Integer.valueOf(j)}); + } + } + else + { + throw new CommandException("commands.fill.outOfWorld", new Object[0]); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length > 0 && args.length <= 3 ? func_175771_a(args, 0, pos) : (args.length > 3 && args.length <= 6 ? func_175771_a(args, 3, pos) : (args.length == 7 ? getListOfStringsMatchingLastWord(args, Block.blockRegistry.getKeys()) : (args.length == 9 ? getListOfStringsMatchingLastWord(args, new String[] {"replace", "destroy", "keep", "hollow", "outline"}): (args.length == 10 && "replace".equals(args[8]) ? getListOfStringsMatchingLastWord(args, Block.blockRegistry.getKeys()) : null)))); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandGameMode.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandGameMode.java new file mode 100644 index 0000000..e50df45 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandGameMode.java @@ -0,0 +1,78 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.WorldSettings; + +public class CommandGameMode extends CommandBase +{ + public String getCommandName() + { + return "gamemode"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.gamemode.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length <= 0) + { + throw new WrongUsageException("commands.gamemode.usage", new Object[0]); + } + else + { + WorldSettings.GameType worldsettings$gametype = this.getGameModeFromCommand(sender, args[0]); + EntityPlayer entityplayer = args.length >= 2 ? getPlayer(sender, args[1]) : getCommandSenderAsPlayer(sender); + entityplayer.setGameType(worldsettings$gametype); + entityplayer.fallDistance = 0.0F; + + if (sender.getEntityWorld().getGameRules().getBoolean("sendCommandFeedback")) + { + entityplayer.addChatMessage(new ChatComponentTranslation("gameMode.changed", new Object[0])); + } + + IChatComponent ichatcomponent = new ChatComponentTranslation("gameMode." + worldsettings$gametype.getName(), new Object[0]); + + if (entityplayer != sender) + { + notifyOperators(sender, this, 1, "commands.gamemode.success.other", new Object[] {entityplayer.getName(), ichatcomponent}); + } + else + { + notifyOperators(sender, this, 1, "commands.gamemode.success.self", new Object[] {ichatcomponent}); + } + } + } + + protected WorldSettings.GameType getGameModeFromCommand(ICommandSender p_71539_1_, String p_71539_2_) throws CommandException, NumberInvalidException + { + return !p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.SURVIVAL.getName()) && !p_71539_2_.equalsIgnoreCase("s") ? (!p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.CREATIVE.getName()) && !p_71539_2_.equalsIgnoreCase("c") ? (!p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.ADVENTURE.getName()) && !p_71539_2_.equalsIgnoreCase("a") ? (!p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.SPECTATOR.getName()) && !p_71539_2_.equalsIgnoreCase("sp") ? WorldSettings.getGameTypeById(parseInt(p_71539_2_, 0, WorldSettings.GameType.values().length - 2)) : WorldSettings.GameType.SPECTATOR) : WorldSettings.GameType.ADVENTURE) : WorldSettings.GameType.CREATIVE) : WorldSettings.GameType.SURVIVAL; + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"survival", "creative", "adventure", "spectator"}): (args.length == 2 ? getListOfStringsMatchingLastWord(args, this.getListOfPlayerUsernames()) : null); + } + + protected String[] getListOfPlayerUsernames() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandGameRule.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandGameRule.java new file mode 100644 index 0000000..e3ff6dc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandGameRule.java @@ -0,0 +1,102 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.GameRules; + +public class CommandGameRule extends CommandBase +{ + public String getCommandName() + { + return "gamerule"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.gamerule.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + GameRules gamerules = this.getGameRules(); + String s = args.length > 0 ? args[0] : ""; + String s1 = args.length > 1 ? buildString(args, 1) : ""; + + switch (args.length) + { + case 0: + sender.addChatMessage(new ChatComponentText(joinNiceString(gamerules.getRules()))); + break; + + case 1: + if (!gamerules.hasRule(s)) + { + throw new CommandException("commands.gamerule.norule", new Object[] {s}); + } + + String s2 = gamerules.getString(s); + sender.addChatMessage((new ChatComponentText(s)).appendText(" = ").appendText(s2)); + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, gamerules.getInt(s)); + break; + + default: + if (gamerules.areSameType(s, GameRules.ValueType.BOOLEAN_VALUE) && !"true".equals(s1) && !"false".equals(s1)) + { + throw new CommandException("commands.generic.boolean.invalid", new Object[] {s1}); + } + + gamerules.setOrCreateGameRule(s, s1); + func_175773_a(gamerules, s); + notifyOperators(sender, this, "commands.gamerule.success", new Object[0]); + } + } + + public static void func_175773_a(GameRules rules, String p_175773_1_) + { + if ("reducedDebugInfo".equals(p_175773_1_)) + { + byte b0 = (byte)(rules.getBoolean(p_175773_1_) ? 22 : 23); + + for (EntityPlayerMP entityplayermp : MinecraftServer.getServer().getConfigurationManager().getPlayerList()) + { + entityplayermp.playerNetServerHandler.sendPacket(new S19PacketEntityStatus(entityplayermp, b0)); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + if (args.length == 1) + { + return getListOfStringsMatchingLastWord(args, this.getGameRules().getRules()); + } + else + { + if (args.length == 2) + { + GameRules gamerules = this.getGameRules(); + + if (gamerules.areSameType(args[0], GameRules.ValueType.BOOLEAN_VALUE)) + { + return getListOfStringsMatchingLastWord(args, new String[] {"true", "false"}); + } + } + + return null; + } + } + + private GameRules getGameRules() + { + return MinecraftServer.getServer().worldServerForDimension(0).getGameRules(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandGive.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandGive.java new file mode 100644 index 0000000..73cbecc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandGive.java @@ -0,0 +1,107 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandGive extends CommandBase +{ + public String getCommandName() + { + return "give"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.give.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.give.usage", new Object[0]); + } + else + { + EntityPlayer entityplayer = getPlayer(sender, args[0]); + Item item = getItemByText(sender, args[1]); + int i = args.length >= 3 ? parseInt(args[2], 1, 64) : 1; + int j = args.length >= 4 ? parseInt(args[3]) : 0; + ItemStack itemstack = new ItemStack(item, i, j); + + if (args.length >= 5) + { + String s = getChatComponentFromNthArg(sender, args, 4).getUnformattedText(); + + try + { + itemstack.setTagCompound(JsonToNBT.getTagFromJson(s)); + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.give.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + boolean flag = entityplayer.inventory.addItemStackToInventory(itemstack); + + if (flag) + { + entityplayer.worldObj.playSoundAtEntity(entityplayer, "random.pop", 0.2F, ((entityplayer.getRNG().nextFloat() - entityplayer.getRNG().nextFloat()) * 0.7F + 1.0F) * 2.0F); + entityplayer.inventoryContainer.detectAndSendChanges(); + } + + if (flag && itemstack.stackSize <= 0) + { + itemstack.stackSize = 1; + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, i); + EntityItem entityitem1 = entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + + if (entityitem1 != null) + { + entityitem1.func_174870_v(); + } + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, i - itemstack.stackSize); + EntityItem entityitem = entityplayer.dropPlayerItemWithRandomChoice(itemstack, false); + + if (entityitem != null) + { + entityitem.setNoPickupDelay(); + entityitem.setOwner(entityplayer.getName()); + } + } + + notifyOperators(sender, this, "commands.give.success", new Object[] {itemstack.getChatComponent(), Integer.valueOf(i), entityplayer.getName()}); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.getPlayers()) : (args.length == 2 ? getListOfStringsMatchingLastWord(args, Item.itemRegistry.getKeys()) : null); + } + + protected String[] getPlayers() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandHandler.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandHandler.java new file mode 100644 index 0000000..2de80d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandHandler.java @@ -0,0 +1,215 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CommandHandler implements ICommandManager +{ + private static final Logger logger = LogManager.getLogger(); + private final Map commandMap = Maps.newHashMap(); + private final Set commandSet = Sets.newHashSet(); + + public int executeCommand(ICommandSender sender, String rawCommand) + { + rawCommand = rawCommand.trim(); + + if (rawCommand.startsWith("/")) + { + rawCommand = rawCommand.substring(1); + } + + String[] astring = rawCommand.split(" "); + String s = astring[0]; + astring = dropFirstString(astring); + ICommand icommand = (ICommand)this.commandMap.get(s); + int i = this.getUsernameIndex(icommand, astring); + int j = 0; + + if (icommand == null) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.notFound", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation); + } + else if (icommand.canCommandSenderUseCommand(sender)) + { + if (i > -1) + { + List list = PlayerSelector.matchEntities(sender, astring[i], Entity.class); + String s1 = astring[i]; + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, list.size()); + + for (Entity entity : list) + { + astring[i] = entity.getUniqueID().toString(); + + if (this.tryExecute(sender, astring, icommand, rawCommand)) + { + ++j; + } + } + + astring[i] = s1; + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, 1); + + if (this.tryExecute(sender, astring, icommand, rawCommand)) + { + ++j; + } + } + } + else + { + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.generic.permission", new Object[0]); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation1); + } + + sender.setCommandStat(CommandResultStats.Type.SUCCESS_COUNT, j); + return j; + } + + protected boolean tryExecute(ICommandSender sender, String[] args, ICommand command, String input) + { + try + { + command.processCommand(sender, args); + return true; + } + catch (WrongUsageException wrongusageexception) + { + ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation("commands.generic.usage", new Object[] {new ChatComponentTranslation(wrongusageexception.getMessage(), wrongusageexception.getErrorObjects())}); + chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation2); + } + catch (CommandException commandexception) + { + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation(commandexception.getMessage(), commandexception.getErrorObjects()); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation1); + } + catch (Throwable var9) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.exception", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation); + logger.warn("Couldn\'t process command: \'" + input + "\'"); + } + + return false; + } + + public ICommand registerCommand(ICommand command) + { + this.commandMap.put(command.getCommandName(), command); + this.commandSet.add(command); + + for (String s : command.getCommandAliases()) + { + ICommand icommand = (ICommand)this.commandMap.get(s); + + if (icommand == null || !icommand.getCommandName().equals(s)) + { + this.commandMap.put(s, command); + } + } + + return command; + } + + private static String[] dropFirstString(String[] input) + { + String[] astring = new String[input.length - 1]; + System.arraycopy(input, 1, astring, 0, input.length - 1); + return astring; + } + + public List getTabCompletionOptions(ICommandSender sender, String input, BlockPos pos) + { + String[] astring = input.split(" ", -1); + String s = astring[0]; + + if (astring.length == 1) + { + List list = Lists.newArrayList(); + + for (Entry entry : this.commandMap.entrySet()) + { + if (CommandBase.doesStringStartWith(s, (String)entry.getKey()) && ((ICommand)entry.getValue()).canCommandSenderUseCommand(sender)) + { + list.add(entry.getKey()); + } + } + + return list; + } + else + { + if (astring.length > 1) + { + ICommand icommand = (ICommand)this.commandMap.get(s); + + if (icommand != null && icommand.canCommandSenderUseCommand(sender)) + { + return icommand.addTabCompletionOptions(sender, dropFirstString(astring), pos); + } + } + + return null; + } + } + + public List getPossibleCommands(ICommandSender sender) + { + List list = Lists.newArrayList(); + + for (ICommand icommand : this.commandSet) + { + if (icommand.canCommandSenderUseCommand(sender)) + { + list.add(icommand); + } + } + + return list; + } + + public Map getCommands() + { + return this.commandMap; + } + + private int getUsernameIndex(ICommand command, String[] args) + { + if (command == null) + { + return -1; + } + else + { + for (int i = 0; i < args.length; ++i) + { + if (command.isUsernameIndex(args, i) && PlayerSelector.matchesMultiplePlayers(args[i])) + { + return i; + } + } + + return -1; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandHelp.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandHelp.java new file mode 100644 index 0000000..8280411 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandHelp.java @@ -0,0 +1,112 @@ +package net.minecraft.command; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; + +public class CommandHelp extends CommandBase +{ + public String getCommandName() + { + return "help"; + } + + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.help.usage"; + } + + public List getCommandAliases() + { + return Arrays.asList(new String[] {"?"}); + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + List list = this.getSortedPossibleCommands(sender); + int i = 7; + int j = (list.size() - 1) / 7; + int k = 0; + + try + { + k = args.length == 0 ? 0 : parseInt(args[0], 1, j + 1) - 1; + } + catch (NumberInvalidException numberinvalidexception) + { + Map map = this.getCommands(); + ICommand icommand = (ICommand)map.get(args[0]); + + if (icommand != null) + { + throw new WrongUsageException(icommand.getCommandUsage(sender), new Object[0]); + } + + if (MathHelper.parseIntWithDefault(args[0], -1) != -1) + { + throw numberinvalidexception; + } + + throw new CommandNotFoundException(); + } + + int l = Math.min((k + 1) * 7, list.size()); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.help.header", new Object[] {Integer.valueOf(k + 1), Integer.valueOf(j + 1)}); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + sender.addChatMessage(chatcomponenttranslation1); + + for (int i1 = k * 7; i1 < l; ++i1) + { + ICommand icommand1 = (ICommand)list.get(i1); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(icommand1.getCommandUsage(sender), new Object[0]); + chatcomponenttranslation.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + icommand1.getCommandName() + " ")); + sender.addChatMessage(chatcomponenttranslation); + } + + if (k == 0 && sender instanceof EntityPlayer) + { + ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation("commands.help.footer", new Object[0]); + chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.GREEN); + sender.addChatMessage(chatcomponenttranslation2); + } + } + + protected List getSortedPossibleCommands(ICommandSender p_71534_1_) + { + List list = MinecraftServer.getServer().getCommandManager().getPossibleCommands(p_71534_1_); + Collections.sort(list); + return list; + } + + protected Map getCommands() + { + return MinecraftServer.getServer().getCommandManager().getCommands(); + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + if (args.length == 1) + { + Set set = this.getCommands().keySet(); + return getListOfStringsMatchingLastWord(args, (String[])set.toArray(new String[set.size()])); + } + else + { + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandKill.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandKill.java new file mode 100644 index 0000000..e45f3d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandKill.java @@ -0,0 +1,51 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandKill extends CommandBase +{ + public String getCommandName() + { + return "kill"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.kill.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length == 0) + { + EntityPlayer entityplayer = getCommandSenderAsPlayer(sender); + entityplayer.onKillCommand(); + notifyOperators(sender, this, "commands.kill.successful", new Object[] {entityplayer.getDisplayName()}); + } + else + { + Entity entity = getEntity(sender, args[0]); + entity.onKillCommand(); + notifyOperators(sender, this, "commands.kill.successful", new Object[] {entity.getDisplayName()}); + } + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandNotFoundException.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandNotFoundException.java new file mode 100644 index 0000000..5108bf3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandNotFoundException.java @@ -0,0 +1,14 @@ +package net.minecraft.command; + +public class CommandNotFoundException extends CommandException +{ + public CommandNotFoundException() + { + this("commands.generic.notFound", new Object[0]); + } + + public CommandNotFoundException(String p_i1363_1_, Object... p_i1363_2_) + { + super(p_i1363_1_, p_i1363_2_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandParticle.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandParticle.java new file mode 100644 index 0000000..7bf3bdf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandParticle.java @@ -0,0 +1,121 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class CommandParticle extends CommandBase +{ + public String getCommandName() + { + return "particle"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.particle.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 8) + { + throw new WrongUsageException("commands.particle.usage", new Object[0]); + } + else + { + boolean flag = false; + EnumParticleTypes enumparticletypes = null; + + for (EnumParticleTypes enumparticletypes1 : EnumParticleTypes.values()) + { + if (enumparticletypes1.hasArguments()) + { + if (args[0].startsWith(enumparticletypes1.getParticleName())) + { + flag = true; + enumparticletypes = enumparticletypes1; + break; + } + } + else if (args[0].equals(enumparticletypes1.getParticleName())) + { + flag = true; + enumparticletypes = enumparticletypes1; + break; + } + } + + if (!flag) + { + throw new CommandException("commands.particle.notFound", new Object[] {args[0]}); + } + else + { + String s = args[0]; + Vec3 vec3 = sender.getPositionVector(); + double d6 = (double)((float)parseDouble(vec3.xCoord, args[1], true)); + double d0 = (double)((float)parseDouble(vec3.yCoord, args[2], true)); + double d1 = (double)((float)parseDouble(vec3.zCoord, args[3], true)); + double d2 = (double)((float)parseDouble(args[4])); + double d3 = (double)((float)parseDouble(args[5])); + double d4 = (double)((float)parseDouble(args[6])); + double d5 = (double)((float)parseDouble(args[7])); + int i = 0; + + if (args.length > 8) + { + i = parseInt(args[8], 0); + } + + boolean flag1 = false; + + if (args.length > 9 && "force".equals(args[9])) + { + flag1 = true; + } + + World world = sender.getEntityWorld(); + + if (world instanceof WorldServer) + { + WorldServer worldserver = (WorldServer)world; + int[] aint = new int[enumparticletypes.getArgumentCount()]; + + if (enumparticletypes.hasArguments()) + { + String[] astring = args[0].split("_", 3); + + for (int j = 1; j < astring.length; ++j) + { + try + { + aint[j - 1] = Integer.parseInt(astring[j]); + } + catch (NumberFormatException var29) + { + throw new CommandException("commands.particle.notFound", new Object[] {args[0]}); + } + } + } + + worldserver.spawnParticle(enumparticletypes, flag1, d6, d0, d1, i, d2, d3, d4, d5, aint); + notifyOperators(sender, this, "commands.particle.success", new Object[] {s, Integer.valueOf(Math.max(i, 1))}); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, EnumParticleTypes.getParticleNames()) : (args.length > 1 && args.length <= 4 ? func_175771_a(args, 1, pos) : (args.length == 10 ? getListOfStringsMatchingLastWord(args, new String[] {"normal", "force"}): null)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandPlaySound.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandPlaySound.java new file mode 100644 index 0000000..51784c6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandPlaySound.java @@ -0,0 +1,120 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; + +public class CommandPlaySound extends CommandBase +{ + public String getCommandName() + { + return "playsound"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.playsound.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException(this.getCommandUsage(sender), new Object[0]); + } + else + { + int i = 0; + String s = args[i++]; + EntityPlayerMP entityplayermp = getPlayer(sender, args[i++]); + Vec3 vec3 = sender.getPositionVector(); + double d0 = vec3.xCoord; + + if (args.length > i) + { + d0 = parseDouble(d0, args[i++], true); + } + + double d1 = vec3.yCoord; + + if (args.length > i) + { + d1 = parseDouble(d1, args[i++], 0, 0, false); + } + + double d2 = vec3.zCoord; + + if (args.length > i) + { + d2 = parseDouble(d2, args[i++], true); + } + + double d3 = 1.0D; + + if (args.length > i) + { + d3 = parseDouble(args[i++], 0.0D, 3.4028234663852886E38D); + } + + double d4 = 1.0D; + + if (args.length > i) + { + d4 = parseDouble(args[i++], 0.0D, 2.0D); + } + + double d5 = 0.0D; + + if (args.length > i) + { + d5 = parseDouble(args[i], 0.0D, 1.0D); + } + + double d6 = d3 > 1.0D ? d3 * 16.0D : 16.0D; + double d7 = entityplayermp.getDistance(d0, d1, d2); + + if (d7 > d6) + { + if (d5 <= 0.0D) + { + throw new CommandException("commands.playsound.playerTooFar", new Object[] {entityplayermp.getName()}); + } + + double d8 = d0 - entityplayermp.posX; + double d9 = d1 - entityplayermp.posY; + double d10 = d2 - entityplayermp.posZ; + double d11 = Math.sqrt(d8 * d8 + d9 * d9 + d10 * d10); + + if (d11 > 0.0D) + { + d0 = entityplayermp.posX + d8 / d11 * 2.0D; + d1 = entityplayermp.posY + d9 / d11 * 2.0D; + d2 = entityplayermp.posZ + d10 / d11 * 2.0D; + } + + d3 = d5; + } + + entityplayermp.playerNetServerHandler.sendPacket(new S29PacketSoundEffect(s, d0, d1, d2, (float)d3, (float)d4)); + notifyOperators(sender, this, "commands.playsound.success", new Object[] {s, entityplayermp.getName()}); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 2 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : (args.length > 2 && args.length <= 5 ? func_175771_a(args, 2, pos) : null); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandReplaceItem.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandReplaceItem.java new file mode 100644 index 0000000..8b05e19 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandReplaceItem.java @@ -0,0 +1,238 @@ +package net.minecraft.command; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class CommandReplaceItem extends CommandBase +{ + private static final Map SHORTCUTS = Maps.newHashMap(); + + public String getCommandName() + { + return "replaceitem"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.replaceitem.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.replaceitem.usage", new Object[0]); + } + else + { + boolean flag; + + if (args[0].equals("entity")) + { + flag = false; + } + else + { + if (!args[0].equals("block")) + { + throw new WrongUsageException("commands.replaceitem.usage", new Object[0]); + } + + flag = true; + } + + int i; + + if (flag) + { + if (args.length < 6) + { + throw new WrongUsageException("commands.replaceitem.block.usage", new Object[0]); + } + + i = 4; + } + else + { + if (args.length < 4) + { + throw new WrongUsageException("commands.replaceitem.entity.usage", new Object[0]); + } + + i = 2; + } + + int j = this.getSlotForShortcut(args[i++]); + Item item; + + try + { + item = getItemByText(sender, args[i]); + } + catch (NumberInvalidException numberinvalidexception) + { + if (Block.getBlockFromName(args[i]) != Blocks.air) + { + throw numberinvalidexception; + } + + item = null; + } + + ++i; + int k = args.length > i ? parseInt(args[i++], 1, 64) : 1; + int l = args.length > i ? parseInt(args[i++]) : 0; + ItemStack itemstack = new ItemStack(item, k, l); + + if (args.length > i) + { + String s = getChatComponentFromNthArg(sender, args, i).getUnformattedText(); + + try + { + itemstack.setTagCompound(JsonToNBT.getTagFromJson(s)); + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.replaceitem.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + if (itemstack.getItem() == null) + { + itemstack = null; + } + + if (flag) + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 0); + BlockPos blockpos = parseBlockPos(sender, args, 1, false); + World world = sender.getEntityWorld(); + TileEntity tileentity = world.getTileEntity(blockpos); + + if (tileentity == null || !(tileentity instanceof IInventory)) + { + throw new CommandException("commands.replaceitem.noContainer", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + + IInventory iinventory = (IInventory)tileentity; + + if (j >= 0 && j < iinventory.getSizeInventory()) + { + iinventory.setInventorySlotContents(j, itemstack); + } + } + else + { + Entity entity = getEntity(sender, args[1]); + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, 0); + + if (entity instanceof EntityPlayer) + { + ((EntityPlayer)entity).inventoryContainer.detectAndSendChanges(); + } + + if (!entity.replaceItemInInventory(j, itemstack)) + { + throw new CommandException("commands.replaceitem.failed", new Object[] {Integer.valueOf(j), Integer.valueOf(k), itemstack == null ? "Air" : itemstack.getChatComponent()}); + } + + if (entity instanceof EntityPlayer) + { + ((EntityPlayer)entity).inventoryContainer.detectAndSendChanges(); + } + } + + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ITEMS, k); + notifyOperators(sender, this, "commands.replaceitem.success", new Object[] {Integer.valueOf(j), Integer.valueOf(k), itemstack == null ? "Air" : itemstack.getChatComponent()}); + } + } + + private int getSlotForShortcut(String shortcut) throws CommandException + { + if (!SHORTCUTS.containsKey(shortcut)) + { + throw new CommandException("commands.generic.parameter.invalid", new Object[] {shortcut}); + } + else + { + return ((Integer)SHORTCUTS.get(shortcut)).intValue(); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"entity", "block"}): (args.length == 2 && args[0].equals("entity") ? getListOfStringsMatchingLastWord(args, this.getUsernames()) : (args.length >= 2 && args.length <= 4 && args[0].equals("block") ? func_175771_a(args, 1, pos) : ((args.length != 3 || !args[0].equals("entity")) && (args.length != 5 || !args[0].equals("block")) ? ((args.length != 4 || !args[0].equals("entity")) && (args.length != 6 || !args[0].equals("block")) ? null : getListOfStringsMatchingLastWord(args, Item.itemRegistry.getKeys())) : getListOfStringsMatchingLastWord(args, SHORTCUTS.keySet())))); + } + + protected String[] getUsernames() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return args.length > 0 && args[0].equals("entity") && index == 1; + } + + static + { + for (int i = 0; i < 54; ++i) + { + SHORTCUTS.put("slot.container." + i, Integer.valueOf(i)); + } + + for (int j = 0; j < 9; ++j) + { + SHORTCUTS.put("slot.hotbar." + j, Integer.valueOf(j)); + } + + for (int k = 0; k < 27; ++k) + { + SHORTCUTS.put("slot.inventory." + k, Integer.valueOf(9 + k)); + } + + for (int l = 0; l < 27; ++l) + { + SHORTCUTS.put("slot.enderchest." + l, Integer.valueOf(200 + l)); + } + + for (int i1 = 0; i1 < 8; ++i1) + { + SHORTCUTS.put("slot.villager." + i1, Integer.valueOf(300 + i1)); + } + + for (int j1 = 0; j1 < 15; ++j1) + { + SHORTCUTS.put("slot.horse." + j1, Integer.valueOf(500 + j1)); + } + + SHORTCUTS.put("slot.weapon", Integer.valueOf(99)); + SHORTCUTS.put("slot.armor.head", Integer.valueOf(103)); + SHORTCUTS.put("slot.armor.chest", Integer.valueOf(102)); + SHORTCUTS.put("slot.armor.legs", Integer.valueOf(101)); + SHORTCUTS.put("slot.armor.feet", Integer.valueOf(100)); + SHORTCUTS.put("slot.horse.saddle", Integer.valueOf(400)); + SHORTCUTS.put("slot.horse.armor", Integer.valueOf(401)); + SHORTCUTS.put("slot.horse.chest", Integer.valueOf(499)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandResultStats.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandResultStats.java new file mode 100644 index 0000000..52094fd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandResultStats.java @@ -0,0 +1,253 @@ +package net.minecraft.command; + +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class CommandResultStats +{ + private static final int NUM_RESULT_TYPES = CommandResultStats.Type.values().length; + private static final String[] STRING_RESULT_TYPES = new String[NUM_RESULT_TYPES]; + private String[] entitiesID; + private String[] objectives; + + public CommandResultStats() + { + this.entitiesID = STRING_RESULT_TYPES; + this.objectives = STRING_RESULT_TYPES; + } + + public void setCommandStatScore(final ICommandSender sender, CommandResultStats.Type resultTypeIn, int scorePoint) + { + String s = this.entitiesID[resultTypeIn.getTypeID()]; + + if (s != null) + { + ICommandSender icommandsender = new ICommandSender() + { + public String getName() + { + return sender.getName(); + } + public IChatComponent getDisplayName() + { + return sender.getDisplayName(); + } + public void addChatMessage(IChatComponent component) + { + sender.addChatMessage(component); + } + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return true; + } + public BlockPos getPosition() + { + return sender.getPosition(); + } + public Vec3 getPositionVector() + { + return sender.getPositionVector(); + } + public World getEntityWorld() + { + return sender.getEntityWorld(); + } + public Entity getCommandSenderEntity() + { + return sender.getCommandSenderEntity(); + } + public boolean sendCommandFeedback() + { + return sender.sendCommandFeedback(); + } + public void setCommandStat(CommandResultStats.Type type, int amount) + { + sender.setCommandStat(type, amount); + } + }; + String s1; + + try + { + s1 = CommandBase.getEntityName(icommandsender, s); + } + catch (EntityNotFoundException var11) + { + return; + } + + String s2 = this.objectives[resultTypeIn.getTypeID()]; + + if (s2 != null) + { + Scoreboard scoreboard = sender.getEntityWorld().getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(s2); + + if (scoreobjective != null) + { + if (scoreboard.entityHasObjective(s1, scoreobjective)) + { + Score score = scoreboard.getValueFromObjective(s1, scoreobjective); + score.setScorePoints(scorePoint); + } + } + } + } + } + + public void readStatsFromNBT(NBTTagCompound tagcompound) + { + if (tagcompound.hasKey("CommandStats", 10)) + { + NBTTagCompound nbttagcompound = tagcompound.getCompoundTag("CommandStats"); + + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) + { + String s = commandresultstats$type.getTypeName() + "Name"; + String s1 = commandresultstats$type.getTypeName() + "Objective"; + + if (nbttagcompound.hasKey(s, 8) && nbttagcompound.hasKey(s1, 8)) + { + String s2 = nbttagcompound.getString(s); + String s3 = nbttagcompound.getString(s1); + setScoreBoardStat(this, commandresultstats$type, s2, s3); + } + } + } + } + + public void writeStatsToNBT(NBTTagCompound tagcompound) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) + { + String s = this.entitiesID[commandresultstats$type.getTypeID()]; + String s1 = this.objectives[commandresultstats$type.getTypeID()]; + + if (s != null && s1 != null) + { + nbttagcompound.setString(commandresultstats$type.getTypeName() + "Name", s); + nbttagcompound.setString(commandresultstats$type.getTypeName() + "Objective", s1); + } + } + + if (!nbttagcompound.hasNoTags()) + { + tagcompound.setTag("CommandStats", nbttagcompound); + } + } + + public static void setScoreBoardStat(CommandResultStats stats, CommandResultStats.Type resultType, String entityID, String objectiveName) + { + if (entityID != null && entityID.length() != 0 && objectiveName != null && objectiveName.length() != 0) + { + if (stats.entitiesID == STRING_RESULT_TYPES || stats.objectives == STRING_RESULT_TYPES) + { + stats.entitiesID = new String[NUM_RESULT_TYPES]; + stats.objectives = new String[NUM_RESULT_TYPES]; + } + + stats.entitiesID[resultType.getTypeID()] = entityID; + stats.objectives[resultType.getTypeID()] = objectiveName; + } + else + { + removeScoreBoardStat(stats, resultType); + } + } + + private static void removeScoreBoardStat(CommandResultStats resultStatsIn, CommandResultStats.Type resultTypeIn) + { + if (resultStatsIn.entitiesID != STRING_RESULT_TYPES && resultStatsIn.objectives != STRING_RESULT_TYPES) + { + resultStatsIn.entitiesID[resultTypeIn.getTypeID()] = null; + resultStatsIn.objectives[resultTypeIn.getTypeID()] = null; + boolean flag = true; + + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) + { + if (resultStatsIn.entitiesID[commandresultstats$type.getTypeID()] != null && resultStatsIn.objectives[commandresultstats$type.getTypeID()] != null) + { + flag = false; + break; + } + } + + if (flag) + { + resultStatsIn.entitiesID = STRING_RESULT_TYPES; + resultStatsIn.objectives = STRING_RESULT_TYPES; + } + } + } + + public void addAllStats(CommandResultStats resultStatsIn) + { + for (CommandResultStats.Type commandresultstats$type : CommandResultStats.Type.values()) + { + setScoreBoardStat(this, commandresultstats$type, resultStatsIn.entitiesID[commandresultstats$type.getTypeID()], resultStatsIn.objectives[commandresultstats$type.getTypeID()]); + } + } + + public static enum Type + { + SUCCESS_COUNT(0, "SuccessCount"), + AFFECTED_BLOCKS(1, "AffectedBlocks"), + AFFECTED_ENTITIES(2, "AffectedEntities"), + AFFECTED_ITEMS(3, "AffectedItems"), + QUERY_RESULT(4, "QueryResult"); + + final int typeID; + final String typeName; + + private Type(int id, String name) + { + this.typeID = id; + this.typeName = name; + } + + public int getTypeID() + { + return this.typeID; + } + + public String getTypeName() + { + return this.typeName; + } + + public static String[] getTypeNames() + { + String[] astring = new String[values().length]; + int i = 0; + + for (CommandResultStats.Type commandresultstats$type : values()) + { + astring[i++] = commandresultstats$type.getTypeName(); + } + + return astring; + } + + public static CommandResultStats.Type getTypeByName(String name) + { + for (CommandResultStats.Type commandresultstats$type : values()) + { + if (commandresultstats$type.getTypeName().equals(name)) + { + return commandresultstats$type; + } + } + + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandServerKick.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandServerKick.java new file mode 100644 index 0000000..bf9365d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandServerKick.java @@ -0,0 +1,67 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandServerKick extends CommandBase +{ + public String getCommandName() + { + return "kick"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.kick.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length > 0 && args[0].length() > 1) + { + EntityPlayerMP entityplayermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(args[0]); + String s = "Kicked by an operator."; + boolean flag = false; + + if (entityplayermp == null) + { + throw new PlayerNotFoundException(); + } + else + { + if (args.length >= 2) + { + s = getChatComponentFromNthArg(sender, args, 1).getUnformattedText(); + flag = true; + } + + entityplayermp.playerNetServerHandler.kickPlayerFromServer(s); + + if (flag) + { + notifyOperators(sender, this, "commands.kick.success.reason", new Object[] {entityplayermp.getName(), s}); + } + else + { + notifyOperators(sender, this, "commands.kick.success", new Object[] {entityplayermp.getName()}); + } + } + } + else + { + throw new WrongUsageException("commands.kick.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length >= 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java new file mode 100644 index 0000000..703ad7e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java @@ -0,0 +1,35 @@ +package net.minecraft.command; + +import net.minecraft.server.MinecraftServer; + +public class CommandSetPlayerTimeout extends CommandBase +{ + public String getCommandName() + { + return "setidletimeout"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.setidletimeout.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length != 1) + { + throw new WrongUsageException("commands.setidletimeout.usage", new Object[0]); + } + else + { + int i = parseInt(args[0], 0); + MinecraftServer.getServer().setPlayerIdleTimeout(i); + notifyOperators(sender, this, "commands.setidletimeout.success", new Object[] {Integer.valueOf(i)}); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java new file mode 100644 index 0000000..e5e1f96 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java @@ -0,0 +1,53 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandSetSpawnpoint extends CommandBase +{ + public String getCommandName() + { + return "spawnpoint"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.spawnpoint.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length > 1 && args.length < 4) + { + throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp = args.length > 0 ? getPlayer(sender, args[0]) : getCommandSenderAsPlayer(sender); + BlockPos blockpos = args.length > 3 ? parseBlockPos(sender, args, 1, true) : entityplayermp.getPosition(); + + if (entityplayermp.worldObj != null) + { + entityplayermp.setSpawnPoint(blockpos, true); + notifyOperators(sender, this, "commands.spawnpoint.success", new Object[] {entityplayermp.getName(), Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : (args.length > 1 && args.length <= 4 ? func_175771_a(args, 1, pos) : null); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandShowSeed.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandShowSeed.java new file mode 100644 index 0000000..6345891 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandShowSeed.java @@ -0,0 +1,35 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; + +public class CommandShowSeed extends CommandBase +{ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(sender); + } + + public String getCommandName() + { + return "seed"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.seed.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + World world = (World)(sender instanceof EntityPlayer ? ((EntityPlayer)sender).worldObj : MinecraftServer.getServer().worldServerForDimension(0)); + sender.addChatMessage(new ChatComponentTranslation("commands.seed.success", new Object[] {Long.valueOf(world.getSeed())})); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandSpreadPlayers.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandSpreadPlayers.java new file mode 100644 index 0000000..422ebf7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandSpreadPlayers.java @@ -0,0 +1,390 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class CommandSpreadPlayers extends CommandBase +{ + public String getCommandName() + { + return "spreadplayers"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.spreadplayers.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 6) + { + throw new WrongUsageException("commands.spreadplayers.usage", new Object[0]); + } + else + { + int i = 0; + BlockPos blockpos = sender.getPosition(); + double d0 = parseDouble((double)blockpos.getX(), args[i++], true); + double d1 = parseDouble((double)blockpos.getZ(), args[i++], true); + double d2 = parseDouble(args[i++], 0.0D); + double d3 = parseDouble(args[i++], d2 + 1.0D); + boolean flag = parseBoolean(args[i++]); + List list = Lists.newArrayList(); + + while (i < args.length) + { + String s = args[i++]; + + if (PlayerSelector.hasArguments(s)) + { + List list1 = PlayerSelector.matchEntities(sender, s, Entity.class); + + if (list1.size() == 0) + { + throw new EntityNotFoundException(); + } + + list.addAll(list1); + } + else + { + EntityPlayer entityplayer = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(s); + + if (entityplayer == null) + { + throw new PlayerNotFoundException(); + } + + list.add(entityplayer); + } + } + + sender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, list.size()); + + if (list.isEmpty()) + { + throw new EntityNotFoundException(); + } + else + { + sender.addChatMessage(new ChatComponentTranslation("commands.spreadplayers.spreading." + (flag ? "teams" : "players"), new Object[] {Integer.valueOf(list.size()), Double.valueOf(d3), Double.valueOf(d0), Double.valueOf(d1), Double.valueOf(d2)})); + this.func_110669_a(sender, list, new CommandSpreadPlayers.Position(d0, d1), d2, d3, ((Entity)list.get(0)).worldObj, flag); + } + } + } + + private void func_110669_a(ICommandSender p_110669_1_, List p_110669_2_, CommandSpreadPlayers.Position p_110669_3_, double p_110669_4_, double p_110669_6_, World worldIn, boolean p_110669_9_) throws CommandException + { + Random random = new Random(); + double d0 = p_110669_3_.field_111101_a - p_110669_6_; + double d1 = p_110669_3_.field_111100_b - p_110669_6_; + double d2 = p_110669_3_.field_111101_a + p_110669_6_; + double d3 = p_110669_3_.field_111100_b + p_110669_6_; + CommandSpreadPlayers.Position[] acommandspreadplayers$position = this.func_110670_a(random, p_110669_9_ ? this.func_110667_a(p_110669_2_) : p_110669_2_.size(), d0, d1, d2, d3); + int i = this.func_110668_a(p_110669_3_, p_110669_4_, worldIn, random, d0, d1, d2, d3, acommandspreadplayers$position, p_110669_9_); + double d4 = this.func_110671_a(p_110669_2_, worldIn, acommandspreadplayers$position, p_110669_9_); + notifyOperators(p_110669_1_, this, "commands.spreadplayers.success." + (p_110669_9_ ? "teams" : "players"), new Object[] {Integer.valueOf(acommandspreadplayers$position.length), Double.valueOf(p_110669_3_.field_111101_a), Double.valueOf(p_110669_3_.field_111100_b)}); + + if (acommandspreadplayers$position.length > 1) + { + p_110669_1_.addChatMessage(new ChatComponentTranslation("commands.spreadplayers.info." + (p_110669_9_ ? "teams" : "players"), new Object[] {String.format("%.2f", new Object[]{Double.valueOf(d4)}), Integer.valueOf(i)})); + } + } + + private int func_110667_a(List p_110667_1_) + { + Set set = Sets.newHashSet(); + + for (Entity entity : p_110667_1_) + { + if (entity instanceof EntityPlayer) + { + set.add(((EntityPlayer)entity).getTeam()); + } + else + { + set.add((Team)null); + } + } + + return set.size(); + } + + private int func_110668_a(CommandSpreadPlayers.Position p_110668_1_, double p_110668_2_, World worldIn, Random p_110668_5_, double p_110668_6_, double p_110668_8_, double p_110668_10_, double p_110668_12_, CommandSpreadPlayers.Position[] p_110668_14_, boolean p_110668_15_) throws CommandException + { + boolean flag = true; + double d0 = 3.4028234663852886E38D; + int i; + + for (i = 0; i < 10000 && flag; ++i) + { + flag = false; + d0 = 3.4028234663852886E38D; + + for (int j = 0; j < p_110668_14_.length; ++j) + { + CommandSpreadPlayers.Position commandspreadplayers$position = p_110668_14_[j]; + int k = 0; + CommandSpreadPlayers.Position commandspreadplayers$position1 = new CommandSpreadPlayers.Position(); + + for (int l = 0; l < p_110668_14_.length; ++l) + { + if (j != l) + { + CommandSpreadPlayers.Position commandspreadplayers$position2 = p_110668_14_[l]; + double d1 = commandspreadplayers$position.func_111099_a(commandspreadplayers$position2); + d0 = Math.min(d1, d0); + + if (d1 < p_110668_2_) + { + ++k; + commandspreadplayers$position1.field_111101_a += commandspreadplayers$position2.field_111101_a - commandspreadplayers$position.field_111101_a; + commandspreadplayers$position1.field_111100_b += commandspreadplayers$position2.field_111100_b - commandspreadplayers$position.field_111100_b; + } + } + } + + if (k > 0) + { + commandspreadplayers$position1.field_111101_a /= (double)k; + commandspreadplayers$position1.field_111100_b /= (double)k; + double d2 = (double)commandspreadplayers$position1.func_111096_b(); + + if (d2 > 0.0D) + { + commandspreadplayers$position1.func_111095_a(); + commandspreadplayers$position.func_111094_b(commandspreadplayers$position1); + } + else + { + commandspreadplayers$position.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_); + } + + flag = true; + } + + if (commandspreadplayers$position.func_111093_a(p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_)) + { + flag = true; + } + } + + if (!flag) + { + for (CommandSpreadPlayers.Position commandspreadplayers$position3 : p_110668_14_) + { + if (!commandspreadplayers$position3.func_111098_b(worldIn)) + { + commandspreadplayers$position3.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_); + flag = true; + } + } + } + } + + if (i >= 10000) + { + throw new CommandException("commands.spreadplayers.failure." + (p_110668_15_ ? "teams" : "players"), new Object[] {Integer.valueOf(p_110668_14_.length), Double.valueOf(p_110668_1_.field_111101_a), Double.valueOf(p_110668_1_.field_111100_b), String.format("%.2f", new Object[]{Double.valueOf(d0)})}); + } + else + { + return i; + } + } + + private double func_110671_a(List p_110671_1_, World worldIn, CommandSpreadPlayers.Position[] p_110671_3_, boolean p_110671_4_) + { + double d0 = 0.0D; + int i = 0; + Map map = Maps.newHashMap(); + + for (int j = 0; j < p_110671_1_.size(); ++j) + { + Entity entity = (Entity)p_110671_1_.get(j); + CommandSpreadPlayers.Position commandspreadplayers$position; + + if (p_110671_4_) + { + Team team = entity instanceof EntityPlayer ? ((EntityPlayer)entity).getTeam() : null; + + if (!map.containsKey(team)) + { + map.put(team, p_110671_3_[i++]); + } + + commandspreadplayers$position = (CommandSpreadPlayers.Position)map.get(team); + } + else + { + commandspreadplayers$position = p_110671_3_[i++]; + } + + entity.setPositionAndUpdate((double)((float)MathHelper.floor_double(commandspreadplayers$position.field_111101_a) + 0.5F), (double)commandspreadplayers$position.func_111092_a(worldIn), (double)MathHelper.floor_double(commandspreadplayers$position.field_111100_b) + 0.5D); + double d2 = Double.MAX_VALUE; + + for (int k = 0; k < p_110671_3_.length; ++k) + { + if (commandspreadplayers$position != p_110671_3_[k]) + { + double d1 = commandspreadplayers$position.func_111099_a(p_110671_3_[k]); + d2 = Math.min(d1, d2); + } + } + + d0 += d2; + } + + d0 = d0 / (double)p_110671_1_.size(); + return d0; + } + + private CommandSpreadPlayers.Position[] func_110670_a(Random p_110670_1_, int p_110670_2_, double p_110670_3_, double p_110670_5_, double p_110670_7_, double p_110670_9_) + { + CommandSpreadPlayers.Position[] acommandspreadplayers$position = new CommandSpreadPlayers.Position[p_110670_2_]; + + for (int i = 0; i < acommandspreadplayers$position.length; ++i) + { + CommandSpreadPlayers.Position commandspreadplayers$position = new CommandSpreadPlayers.Position(); + commandspreadplayers$position.func_111097_a(p_110670_1_, p_110670_3_, p_110670_5_, p_110670_7_, p_110670_9_); + acommandspreadplayers$position[i] = commandspreadplayers$position; + } + + return acommandspreadplayers$position; + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length >= 1 && args.length <= 2 ? func_181043_b(args, 0, pos) : null; + } + + static class Position + { + double field_111101_a; + double field_111100_b; + + Position() + { + } + + Position(double p_i1358_1_, double p_i1358_3_) + { + this.field_111101_a = p_i1358_1_; + this.field_111100_b = p_i1358_3_; + } + + double func_111099_a(CommandSpreadPlayers.Position p_111099_1_) + { + double d0 = this.field_111101_a - p_111099_1_.field_111101_a; + double d1 = this.field_111100_b - p_111099_1_.field_111100_b; + return Math.sqrt(d0 * d0 + d1 * d1); + } + + void func_111095_a() + { + double d0 = (double)this.func_111096_b(); + this.field_111101_a /= d0; + this.field_111100_b /= d0; + } + + float func_111096_b() + { + return MathHelper.sqrt_double(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b); + } + + public void func_111094_b(CommandSpreadPlayers.Position p_111094_1_) + { + this.field_111101_a -= p_111094_1_.field_111101_a; + this.field_111100_b -= p_111094_1_.field_111100_b; + } + + public boolean func_111093_a(double p_111093_1_, double p_111093_3_, double p_111093_5_, double p_111093_7_) + { + boolean flag = false; + + if (this.field_111101_a < p_111093_1_) + { + this.field_111101_a = p_111093_1_; + flag = true; + } + else if (this.field_111101_a > p_111093_5_) + { + this.field_111101_a = p_111093_5_; + flag = true; + } + + if (this.field_111100_b < p_111093_3_) + { + this.field_111100_b = p_111093_3_; + flag = true; + } + else if (this.field_111100_b > p_111093_7_) + { + this.field_111100_b = p_111093_7_; + flag = true; + } + + return flag; + } + + public int func_111092_a(World worldIn) + { + BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b); + + while (blockpos.getY() > 0) + { + blockpos = blockpos.down(); + + if (worldIn.getBlockState(blockpos).getBlock().getMaterial() != Material.air) + { + return blockpos.getY() + 1; + } + } + + return 257; + } + + public boolean func_111098_b(World worldIn) + { + BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b); + + while (blockpos.getY() > 0) + { + blockpos = blockpos.down(); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + + if (material != Material.air) + { + return !material.isLiquid() && material != Material.fire; + } + } + + return false; + } + + public void func_111097_a(Random p_111097_1_, double p_111097_2_, double p_111097_4_, double p_111097_6_, double p_111097_8_) + { + this.field_111101_a = MathHelper.getRandomDoubleInRange(p_111097_1_, p_111097_2_, p_111097_6_); + this.field_111100_b = MathHelper.getRandomDoubleInRange(p_111097_1_, p_111097_4_, p_111097_8_); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandStats.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandStats.java new file mode 100644 index 0000000..0b53a83 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandStats.java @@ -0,0 +1,209 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.Collection; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class CommandStats extends CommandBase +{ + public String getCommandName() + { + return "stats"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.stats.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.stats.usage", new Object[0]); + } + else + { + boolean flag; + + if (args[0].equals("entity")) + { + flag = false; + } + else + { + if (!args[0].equals("block")) + { + throw new WrongUsageException("commands.stats.usage", new Object[0]); + } + + flag = true; + } + + int i; + + if (flag) + { + if (args.length < 5) + { + throw new WrongUsageException("commands.stats.block.usage", new Object[0]); + } + + i = 4; + } + else + { + if (args.length < 3) + { + throw new WrongUsageException("commands.stats.entity.usage", new Object[0]); + } + + i = 2; + } + + String s = args[i++]; + + if ("set".equals(s)) + { + if (args.length < i + 3) + { + if (i == 5) + { + throw new WrongUsageException("commands.stats.block.set.usage", new Object[0]); + } + + throw new WrongUsageException("commands.stats.entity.set.usage", new Object[0]); + } + } + else + { + if (!"clear".equals(s)) + { + throw new WrongUsageException("commands.stats.usage", new Object[0]); + } + + if (args.length < i + 1) + { + if (i == 5) + { + throw new WrongUsageException("commands.stats.block.clear.usage", new Object[0]); + } + + throw new WrongUsageException("commands.stats.entity.clear.usage", new Object[0]); + } + } + + CommandResultStats.Type commandresultstats$type = CommandResultStats.Type.getTypeByName(args[i++]); + + if (commandresultstats$type == null) + { + throw new CommandException("commands.stats.failed", new Object[0]); + } + else + { + World world = sender.getEntityWorld(); + CommandResultStats commandresultstats; + + if (flag) + { + BlockPos blockpos = parseBlockPos(sender, args, 1, false); + TileEntity tileentity = world.getTileEntity(blockpos); + + if (tileentity == null) + { + throw new CommandException("commands.stats.noCompatibleBlock", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + + if (tileentity instanceof TileEntityCommandBlock) + { + commandresultstats = ((TileEntityCommandBlock)tileentity).getCommandResultStats(); + } + else + { + if (!(tileentity instanceof TileEntitySign)) + { + throw new CommandException("commands.stats.noCompatibleBlock", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + + commandresultstats = ((TileEntitySign)tileentity).getStats(); + } + } + else + { + Entity entity = getEntity(sender, args[1]); + commandresultstats = entity.getCommandStats(); + } + + if ("set".equals(s)) + { + String s1 = args[i++]; + String s2 = args[i]; + + if (s1.length() == 0 || s2.length() == 0) + { + throw new CommandException("commands.stats.failed", new Object[0]); + } + + CommandResultStats.setScoreBoardStat(commandresultstats, commandresultstats$type, s1, s2); + notifyOperators(sender, this, "commands.stats.success", new Object[] {commandresultstats$type.getTypeName(), s2, s1}); + } + else if ("clear".equals(s)) + { + CommandResultStats.setScoreBoardStat(commandresultstats, commandresultstats$type, (String)null, (String)null); + notifyOperators(sender, this, "commands.stats.cleared", new Object[] {commandresultstats$type.getTypeName()}); + } + + if (flag) + { + BlockPos blockpos1 = parseBlockPos(sender, args, 1, false); + TileEntity tileentity1 = world.getTileEntity(blockpos1); + tileentity1.markDirty(); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"entity", "block"}): (args.length == 2 && args[0].equals("entity") ? getListOfStringsMatchingLastWord(args, this.func_175776_d()) : (args.length >= 2 && args.length <= 4 && args[0].equals("block") ? func_175771_a(args, 1, pos) : ((args.length != 3 || !args[0].equals("entity")) && (args.length != 5 || !args[0].equals("block")) ? ((args.length != 4 || !args[0].equals("entity")) && (args.length != 6 || !args[0].equals("block")) ? ((args.length != 6 || !args[0].equals("entity")) && (args.length != 8 || !args[0].equals("block")) ? null : getListOfStringsMatchingLastWord(args, this.func_175777_e())) : getListOfStringsMatchingLastWord(args, CommandResultStats.Type.getTypeNames())) : getListOfStringsMatchingLastWord(args, new String[] {"set", "clear"})))); + } + + protected String[] func_175776_d() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + protected List func_175777_e() + { + Collection collection = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard().getScoreObjectives(); + List list = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : collection) + { + if (!scoreobjective.getCriteria().isReadOnly()) + { + list.add(scoreobjective.getName()); + } + } + + return list; + } + + public boolean isUsernameIndex(String[] args, int index) + { + return args.length > 0 && args[0].equals("entity") && index == 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandTime.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandTime.java new file mode 100644 index 0000000..875f6c5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandTime.java @@ -0,0 +1,103 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.world.WorldServer; + +public class CommandTime extends CommandBase +{ + public String getCommandName() + { + return "time"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.time.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length > 1) + { + if (args[0].equals("set")) + { + int l; + + if (args[1].equals("day")) + { + l = 1000; + } + else if (args[1].equals("night")) + { + l = 13000; + } + else + { + l = parseInt(args[1], 0); + } + + this.setTime(sender, l); + notifyOperators(sender, this, "commands.time.set", new Object[] {Integer.valueOf(l)}); + return; + } + + if (args[0].equals("add")) + { + int k = parseInt(args[1], 0); + this.addTime(sender, k); + notifyOperators(sender, this, "commands.time.added", new Object[] {Integer.valueOf(k)}); + return; + } + + if (args[0].equals("query")) + { + if (args[1].equals("daytime")) + { + int j = (int)(sender.getEntityWorld().getWorldTime() % 2147483647L); + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, j); + notifyOperators(sender, this, "commands.time.query", new Object[] {Integer.valueOf(j)}); + return; + } + + if (args[1].equals("gametime")) + { + int i = (int)(sender.getEntityWorld().getTotalWorldTime() % 2147483647L); + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, i); + notifyOperators(sender, this, "commands.time.query", new Object[] {Integer.valueOf(i)}); + return; + } + } + } + + throw new WrongUsageException("commands.time.usage", new Object[0]); + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"set", "add", "query"}): (args.length == 2 && args[0].equals("set") ? getListOfStringsMatchingLastWord(args, new String[] {"day", "night"}): (args.length == 2 && args[0].equals("query") ? getListOfStringsMatchingLastWord(args, new String[] {"daytime", "gametime"}): null)); + } + + protected void setTime(ICommandSender sender, int time) + { + for (int i = 0; i < MinecraftServer.getServer().worldServers.length; ++i) + { + MinecraftServer.getServer().worldServers[i].setWorldTime((long)time); + } + } + + protected void addTime(ICommandSender sender, int time) + { + for (int i = 0; i < MinecraftServer.getServer().worldServers.length; ++i) + { + WorldServer worldserver = MinecraftServer.getServer().worldServers[i]; + worldserver.setWorldTime(worldserver.getWorldTime() + (long)time); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandTitle.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandTitle.java new file mode 100644 index 0000000..8825edf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandTitle.java @@ -0,0 +1,122 @@ +package net.minecraft.command; + +import com.google.gson.JsonParseException; +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S45PacketTitle; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentProcessor; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CommandTitle extends CommandBase +{ + private static final Logger LOGGER = LogManager.getLogger(); + + public String getCommandName() + { + return "title"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.title.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } + else + { + if (args.length < 3) + { + if ("title".equals(args[1]) || "subtitle".equals(args[1])) + { + throw new WrongUsageException("commands.title.usage.title", new Object[0]); + } + + if ("times".equals(args[1])) + { + throw new WrongUsageException("commands.title.usage.times", new Object[0]); + } + } + + EntityPlayerMP entityplayermp = getPlayer(sender, args[0]); + S45PacketTitle.Type s45packettitle$type = S45PacketTitle.Type.byName(args[1]); + + if (s45packettitle$type != S45PacketTitle.Type.CLEAR && s45packettitle$type != S45PacketTitle.Type.RESET) + { + if (s45packettitle$type == S45PacketTitle.Type.TIMES) + { + if (args.length != 5) + { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } + else + { + int i = parseInt(args[2]); + int j = parseInt(args[3]); + int k = parseInt(args[4]); + S45PacketTitle s45packettitle2 = new S45PacketTitle(i, j, k); + entityplayermp.playerNetServerHandler.sendPacket(s45packettitle2); + notifyOperators(sender, this, "commands.title.success", new Object[0]); + } + } + else if (args.length < 3) + { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } + else + { + String s = buildString(args, 2); + IChatComponent ichatcomponent; + + try + { + ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + } + catch (JsonParseException jsonparseexception) + { + Throwable throwable = ExceptionUtils.getRootCause(jsonparseexception); + throw new SyntaxErrorException("commands.tellraw.jsonException", new Object[] {throwable == null ? "" : throwable.getMessage()}); + } + + S45PacketTitle s45packettitle1 = new S45PacketTitle(s45packettitle$type, ChatComponentProcessor.processComponent(sender, ichatcomponent, entityplayermp)); + entityplayermp.playerNetServerHandler.sendPacket(s45packettitle1); + notifyOperators(sender, this, "commands.title.success", new Object[0]); + } + } + else if (args.length != 2) + { + throw new WrongUsageException("commands.title.usage", new Object[0]); + } + else + { + S45PacketTitle s45packettitle = new S45PacketTitle(s45packettitle$type, (IChatComponent)null); + entityplayermp.playerNetServerHandler.sendPacket(s45packettitle); + notifyOperators(sender, this, "commands.title.success", new Object[0]); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : (args.length == 2 ? getListOfStringsMatchingLastWord(args, S45PacketTitle.Type.getNames()) : null); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandToggleDownfall.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandToggleDownfall.java new file mode 100644 index 0000000..b07e8f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandToggleDownfall.java @@ -0,0 +1,34 @@ +package net.minecraft.command; + +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.storage.WorldInfo; + +public class CommandToggleDownfall extends CommandBase +{ + public String getCommandName() + { + return "toggledownfall"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.downfall.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + this.toggleDownfall(); + notifyOperators(sender, this, "commands.downfall.success", new Object[0]); + } + + protected void toggleDownfall() + { + WorldInfo worldinfo = MinecraftServer.getServer().worldServers[0].getWorldInfo(); + worldinfo.setRaining(!worldinfo.isRaining()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandTrigger.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandTrigger.java new file mode 100644 index 0000000..716831b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandTrigger.java @@ -0,0 +1,130 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandTrigger extends CommandBase +{ + public String getCommandName() + { + return "trigger"; + } + + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.trigger.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 3) + { + throw new WrongUsageException("commands.trigger.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp; + + if (sender instanceof EntityPlayerMP) + { + entityplayermp = (EntityPlayerMP)sender; + } + else + { + Entity entity = sender.getCommandSenderEntity(); + + if (!(entity instanceof EntityPlayerMP)) + { + throw new CommandException("commands.trigger.invalidPlayer", new Object[0]); + } + + entityplayermp = (EntityPlayerMP)entity; + } + + Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(args[0]); + + if (scoreobjective != null && scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER) + { + int i = parseInt(args[2]); + + if (!scoreboard.entityHasObjective(entityplayermp.getName(), scoreobjective)) + { + throw new CommandException("commands.trigger.invalidObjective", new Object[] {args[0]}); + } + else + { + Score score = scoreboard.getValueFromObjective(entityplayermp.getName(), scoreobjective); + + if (score.isLocked()) + { + throw new CommandException("commands.trigger.disabled", new Object[] {args[0]}); + } + else + { + if ("set".equals(args[1])) + { + score.setScorePoints(i); + } + else + { + if (!"add".equals(args[1])) + { + throw new CommandException("commands.trigger.invalidMode", new Object[] {args[1]}); + } + + score.increseScore(i); + } + + score.setLocked(true); + + if (entityplayermp.theItemInWorldManager.isCreative()) + { + notifyOperators(sender, this, "commands.trigger.success", new Object[] {args[0], args[1], args[2]}); + } + } + } + } + else + { + throw new CommandException("commands.trigger.invalidObjective", new Object[] {args[0]}); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + if (args.length == 1) + { + Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + List list = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : scoreboard.getScoreObjectives()) + { + if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER) + { + list.add(scoreobjective.getName()); + } + } + + return getListOfStringsMatchingLastWord(args, (String[])list.toArray(new String[list.size()])); + } + else + { + return args.length == 2 ? getListOfStringsMatchingLastWord(args, new String[] {"add", "set"}): null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandWeather.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandWeather.java new file mode 100644 index 0000000..b2357ba --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandWeather.java @@ -0,0 +1,84 @@ +package net.minecraft.command; + +import java.util.List; +import java.util.Random; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.storage.WorldInfo; + +public class CommandWeather extends CommandBase +{ + public String getCommandName() + { + return "weather"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.weather.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length >= 1 && args.length <= 2) + { + int i = (300 + (new Random()).nextInt(600)) * 20; + + if (args.length >= 2) + { + i = parseInt(args[1], 1, 1000000) * 20; + } + + World world = MinecraftServer.getServer().worldServers[0]; + WorldInfo worldinfo = world.getWorldInfo(); + + if ("clear".equalsIgnoreCase(args[0])) + { + worldinfo.setCleanWeatherTime(i); + worldinfo.setRainTime(0); + worldinfo.setThunderTime(0); + worldinfo.setRaining(false); + worldinfo.setThundering(false); + notifyOperators(sender, this, "commands.weather.clear", new Object[0]); + } + else if ("rain".equalsIgnoreCase(args[0])) + { + worldinfo.setCleanWeatherTime(0); + worldinfo.setRainTime(i); + worldinfo.setThunderTime(i); + worldinfo.setRaining(true); + worldinfo.setThundering(false); + notifyOperators(sender, this, "commands.weather.rain", new Object[0]); + } + else + { + if (!"thunder".equalsIgnoreCase(args[0])) + { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + + worldinfo.setCleanWeatherTime(0); + worldinfo.setRainTime(i); + worldinfo.setThunderTime(i); + worldinfo.setRaining(true); + worldinfo.setThundering(true); + notifyOperators(sender, this, "commands.weather.thunder", new Object[0]); + } + } + else + { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"clear", "rain", "thunder"}): null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandWorldBorder.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandWorldBorder.java new file mode 100644 index 0000000..5bd17e5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandWorldBorder.java @@ -0,0 +1,197 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.border.WorldBorder; + +public class CommandWorldBorder extends CommandBase +{ + public String getCommandName() + { + return "worldborder"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.worldborder.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.worldborder.usage", new Object[0]); + } + else + { + WorldBorder worldborder = this.getWorldBorder(); + + if (args[0].equals("set")) + { + if (args.length != 2 && args.length != 3) + { + throw new WrongUsageException("commands.worldborder.set.usage", new Object[0]); + } + + double d0 = worldborder.getTargetSize(); + double d2 = parseDouble(args[1], 1.0D, 6.0E7D); + long i = args.length > 2 ? parseLong(args[2], 0L, 9223372036854775L) * 1000L : 0L; + + if (i > 0L) + { + worldborder.setTransition(d0, d2, i); + + if (d0 > d2) + { + notifyOperators(sender, this, "commands.worldborder.setSlowly.shrink.success", new Object[] {String.format("%.1f", new Object[]{Double.valueOf(d2)}), String.format("%.1f", new Object[]{Double.valueOf(d0)}), Long.toString(i / 1000L)}); + } + else + { + notifyOperators(sender, this, "commands.worldborder.setSlowly.grow.success", new Object[] {String.format("%.1f", new Object[]{Double.valueOf(d2)}), String.format("%.1f", new Object[]{Double.valueOf(d0)}), Long.toString(i / 1000L)}); + } + } + else + { + worldborder.setTransition(d2); + notifyOperators(sender, this, "commands.worldborder.set.success", new Object[] {String.format("%.1f", new Object[]{Double.valueOf(d2)}), String.format("%.1f", new Object[]{Double.valueOf(d0)})}); + } + } + else if (args[0].equals("add")) + { + if (args.length != 2 && args.length != 3) + { + throw new WrongUsageException("commands.worldborder.add.usage", new Object[0]); + } + + double d4 = worldborder.getDiameter(); + double d8 = d4 + parseDouble(args[1], -d4, 6.0E7D - d4); + long i1 = worldborder.getTimeUntilTarget() + (args.length > 2 ? parseLong(args[2], 0L, 9223372036854775L) * 1000L : 0L); + + if (i1 > 0L) + { + worldborder.setTransition(d4, d8, i1); + + if (d4 > d8) + { + notifyOperators(sender, this, "commands.worldborder.setSlowly.shrink.success", new Object[] {String.format("%.1f", new Object[]{Double.valueOf(d8)}), String.format("%.1f", new Object[]{Double.valueOf(d4)}), Long.toString(i1 / 1000L)}); + } + else + { + notifyOperators(sender, this, "commands.worldborder.setSlowly.grow.success", new Object[] {String.format("%.1f", new Object[]{Double.valueOf(d8)}), String.format("%.1f", new Object[]{Double.valueOf(d4)}), Long.toString(i1 / 1000L)}); + } + } + else + { + worldborder.setTransition(d8); + notifyOperators(sender, this, "commands.worldborder.set.success", new Object[] {String.format("%.1f", new Object[]{Double.valueOf(d8)}), String.format("%.1f", new Object[]{Double.valueOf(d4)})}); + } + } + else if (args[0].equals("center")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.worldborder.center.usage", new Object[0]); + } + + BlockPos blockpos = sender.getPosition(); + double d1 = parseDouble((double)blockpos.getX() + 0.5D, args[1], true); + double d3 = parseDouble((double)blockpos.getZ() + 0.5D, args[2], true); + worldborder.setCenter(d1, d3); + notifyOperators(sender, this, "commands.worldborder.center.success", new Object[] {Double.valueOf(d1), Double.valueOf(d3)}); + } + else if (args[0].equals("damage")) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.worldborder.damage.usage", new Object[0]); + } + + if (args[1].equals("buffer")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.worldborder.damage.buffer.usage", new Object[0]); + } + + double d5 = parseDouble(args[2], 0.0D); + double d9 = worldborder.getDamageBuffer(); + worldborder.setDamageBuffer(d5); + notifyOperators(sender, this, "commands.worldborder.damage.buffer.success", new Object[] {String.format("%.1f", new Object[]{Double.valueOf(d5)}), String.format("%.1f", new Object[]{Double.valueOf(d9)})}); + } + else if (args[1].equals("amount")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.worldborder.damage.amount.usage", new Object[0]); + } + + double d6 = parseDouble(args[2], 0.0D); + double d10 = worldborder.getDamageAmount(); + worldborder.setDamageAmount(d6); + notifyOperators(sender, this, "commands.worldborder.damage.amount.success", new Object[] {String.format("%.2f", new Object[]{Double.valueOf(d6)}), String.format("%.2f", new Object[]{Double.valueOf(d10)})}); + } + } + else if (args[0].equals("warning")) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.worldborder.warning.usage", new Object[0]); + } + + int j = parseInt(args[2], 0); + + if (args[1].equals("time")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.worldborder.warning.time.usage", new Object[0]); + } + + int k = worldborder.getWarningTime(); + worldborder.setWarningTime(j); + notifyOperators(sender, this, "commands.worldborder.warning.time.success", new Object[] {Integer.valueOf(j), Integer.valueOf(k)}); + } + else if (args[1].equals("distance")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.worldborder.warning.distance.usage", new Object[0]); + } + + int l = worldborder.getWarningDistance(); + worldborder.setWarningDistance(j); + notifyOperators(sender, this, "commands.worldborder.warning.distance.success", new Object[] {Integer.valueOf(j), Integer.valueOf(l)}); + } + } + else + { + if (!args[0].equals("get")) + { + throw new WrongUsageException("commands.worldborder.usage", new Object[0]); + } + + double d7 = worldborder.getDiameter(); + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, MathHelper.floor_double(d7 + 0.5D)); + sender.addChatMessage(new ChatComponentTranslation("commands.worldborder.get.success", new Object[] {String.format("%.0f", new Object[]{Double.valueOf(d7)})})); + } + } + } + + protected WorldBorder getWorldBorder() + { + return MinecraftServer.getServer().worldServers[0].getWorldBorder(); + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"set", "center", "damage", "warning", "add", "get"}): (args.length == 2 && args[0].equals("damage") ? getListOfStringsMatchingLastWord(args, new String[] {"buffer", "amount"}): (args.length >= 2 && args.length <= 3 && args[0].equals("center") ? func_181043_b(args, 1, pos) : (args.length == 2 && args[0].equals("warning") ? getListOfStringsMatchingLastWord(args, new String[] {"time", "distance"}): null))); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/CommandXP.java b/Client-1.8.9/src/main/java/net/minecraft/command/CommandXP.java new file mode 100644 index 0000000..61e2d8e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/CommandXP.java @@ -0,0 +1,95 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandXP extends CommandBase +{ + public String getCommandName() + { + return "xp"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.xp.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length <= 0) + { + throw new WrongUsageException("commands.xp.usage", new Object[0]); + } + else + { + String s = args[0]; + boolean flag = s.endsWith("l") || s.endsWith("L"); + + if (flag && s.length() > 1) + { + s = s.substring(0, s.length() - 1); + } + + int i = parseInt(s); + boolean flag1 = i < 0; + + if (flag1) + { + i *= -1; + } + + EntityPlayer entityplayer = args.length > 1 ? getPlayer(sender, args[1]) : getCommandSenderAsPlayer(sender); + + if (flag) + { + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, entityplayer.experienceLevel); + + if (flag1) + { + entityplayer.addExperienceLevel(-i); + notifyOperators(sender, this, "commands.xp.success.negative.levels", new Object[] {Integer.valueOf(i), entityplayer.getName()}); + } + else + { + entityplayer.addExperienceLevel(i); + notifyOperators(sender, this, "commands.xp.success.levels", new Object[] {Integer.valueOf(i), entityplayer.getName()}); + } + } + else + { + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, entityplayer.experienceTotal); + + if (flag1) + { + throw new CommandException("commands.xp.failure.widthdrawXp", new Object[0]); + } + + entityplayer.addExperience(i); + notifyOperators(sender, this, "commands.xp.success", new Object[] {Integer.valueOf(i), entityplayer.getName()}); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 2 ? getListOfStringsMatchingLastWord(args, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/EntityNotFoundException.java b/Client-1.8.9/src/main/java/net/minecraft/command/EntityNotFoundException.java new file mode 100644 index 0000000..ed735b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/EntityNotFoundException.java @@ -0,0 +1,14 @@ +package net.minecraft.command; + +public class EntityNotFoundException extends CommandException +{ + public EntityNotFoundException() + { + this("commands.generic.entity.notFound", new Object[0]); + } + + public EntityNotFoundException(String p_i46035_1_, Object... p_i46035_2_) + { + super(p_i46035_1_, p_i46035_2_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/IAdminCommand.java b/Client-1.8.9/src/main/java/net/minecraft/command/IAdminCommand.java new file mode 100644 index 0000000..d6a7962 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/IAdminCommand.java @@ -0,0 +1,6 @@ +package net.minecraft.command; + +public interface IAdminCommand +{ + void notifyOperators(ICommandSender sender, ICommand command, int flags, String msgFormat, Object... msgParams); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/ICommand.java b/Client-1.8.9/src/main/java/net/minecraft/command/ICommand.java new file mode 100644 index 0000000..5fb16b3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/ICommand.java @@ -0,0 +1,21 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.util.BlockPos; + +public interface ICommand extends Comparable +{ + String getCommandName(); + + String getCommandUsage(ICommandSender sender); + + List getCommandAliases(); + + void processCommand(ICommandSender sender, String[] args) throws CommandException; + + boolean canCommandSenderUseCommand(ICommandSender sender); + + List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos); + + boolean isUsernameIndex(String[] args, int index); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/ICommandManager.java b/Client-1.8.9/src/main/java/net/minecraft/command/ICommandManager.java new file mode 100644 index 0000000..5991fd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/ICommandManager.java @@ -0,0 +1,16 @@ +package net.minecraft.command; + +import java.util.List; +import java.util.Map; +import net.minecraft.util.BlockPos; + +public interface ICommandManager +{ + int executeCommand(ICommandSender sender, String rawCommand); + + List getTabCompletionOptions(ICommandSender sender, String input, BlockPos pos); + + List getPossibleCommands(ICommandSender sender); + + Map getCommands(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/ICommandSender.java b/Client-1.8.9/src/main/java/net/minecraft/command/ICommandSender.java new file mode 100644 index 0000000..6a956b4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/ICommandSender.java @@ -0,0 +1,30 @@ +package net.minecraft.command; + +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public interface ICommandSender +{ + String getName(); + + IChatComponent getDisplayName(); + + void addChatMessage(IChatComponent component); + + boolean canCommandSenderUseCommand(int permLevel, String commandName); + + BlockPos getPosition(); + + Vec3 getPositionVector(); + + World getEntityWorld(); + + Entity getCommandSenderEntity(); + + boolean sendCommandFeedback(); + + void setCommandStat(CommandResultStats.Type type, int amount); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/NumberInvalidException.java b/Client-1.8.9/src/main/java/net/minecraft/command/NumberInvalidException.java new file mode 100644 index 0000000..5565979 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/NumberInvalidException.java @@ -0,0 +1,14 @@ +package net.minecraft.command; + +public class NumberInvalidException extends CommandException +{ + public NumberInvalidException() + { + this("commands.generic.num.invalid", new Object[0]); + } + + public NumberInvalidException(String message, Object... replacements) + { + super(message, replacements); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/PlayerNotFoundException.java b/Client-1.8.9/src/main/java/net/minecraft/command/PlayerNotFoundException.java new file mode 100644 index 0000000..0935e87 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/PlayerNotFoundException.java @@ -0,0 +1,14 @@ +package net.minecraft.command; + +public class PlayerNotFoundException extends CommandException +{ + public PlayerNotFoundException() + { + this("commands.generic.player.notFound", new Object[0]); + } + + public PlayerNotFoundException(String message, Object... replacements) + { + super(message, replacements); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/PlayerSelector.java b/Client-1.8.9/src/main/java/net/minecraft/command/PlayerSelector.java new file mode 100644 index 0000000..9758e4d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/PlayerSelector.java @@ -0,0 +1,709 @@ +package net.minecraft.command; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.ComparisonChain; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; + +public class PlayerSelector +{ + private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w=,!-]*)\\])?$"); + private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); + private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); + private static final Set WORLD_BINDING_ARGS = Sets.newHashSet(new String[] {"x", "y", "z", "dx", "dy", "dz", "rm", "r"}); + + public static EntityPlayerMP matchOnePlayer(ICommandSender sender, String token) + { + return (EntityPlayerMP)matchOneEntity(sender, token, EntityPlayerMP.class); + } + + public static T matchOneEntity(ICommandSender sender, String token, Class targetClass) + { + List list = matchEntities(sender, token, targetClass); + return (T)(list.size() == 1 ? (Entity)list.get(0) : null); + } + + public static IChatComponent matchEntitiesToChatComponent(ICommandSender sender, String token) + { + List list = matchEntities(sender, token, Entity.class); + + if (list.isEmpty()) + { + return null; + } + else + { + List list1 = Lists.newArrayList(); + + for (Entity entity : list) + { + list1.add(entity.getDisplayName()); + } + + return CommandBase.join(list1); + } + } + + public static List matchEntities(ICommandSender sender, String token, Class targetClass) + { + Matcher matcher = tokenPattern.matcher(token); + + if (matcher.matches() && sender.canCommandSenderUseCommand(1, "@")) + { + Map map = getArgumentMap(matcher.group(2)); + + if (!isEntityTypeValid(sender, map)) + { + return Collections.emptyList(); + } + else + { + String s = matcher.group(1); + BlockPos blockpos = func_179664_b(map, sender.getPosition()); + List list = getWorlds(sender, map); + List list1 = Lists.newArrayList(); + + for (World world : list) + { + if (world != null) + { + List> list2 = Lists.>newArrayList(); + list2.addAll(func_179663_a(map, s)); + list2.addAll(getXpLevelPredicates(map)); + list2.addAll(getGamemodePredicates(map)); + list2.addAll(getTeamPredicates(map)); + list2.addAll(getScorePredicates(map)); + list2.addAll(getNamePredicates(map)); + list2.addAll(func_180698_a(map, blockpos)); + list2.addAll(getRotationsPredicates(map)); + list1.addAll(filterResults(map, targetClass, list2, s, world, blockpos)); + } + } + + return func_179658_a(list1, map, sender, targetClass, s, blockpos); + } + } + else + { + return Collections.emptyList(); + } + } + + private static List getWorlds(ICommandSender sender, Map argumentMap) + { + List list = Lists.newArrayList(); + + if (func_179665_h(argumentMap)) + { + list.add(sender.getEntityWorld()); + } + else + { + Collections.addAll(list, MinecraftServer.getServer().worldServers); + } + + return list; + } + + private static boolean isEntityTypeValid(ICommandSender commandSender, Map params) + { + String s = func_179651_b(params, "type"); + s = s != null && s.startsWith("!") ? s.substring(1) : s; + + if (s != null && !EntityList.isStringValidEntityName(s)) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.entity.invalidType", new Object[] {s}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + commandSender.addChatMessage(chatcomponenttranslation); + return false; + } + else + { + return true; + } + } + + private static List> func_179663_a(Map p_179663_0_, String p_179663_1_) + { + List> list = Lists.>newArrayList(); + String s = func_179651_b(p_179663_0_, "type"); + final boolean flag = s != null && s.startsWith("!"); + + if (flag) + { + s = s.substring(1); + } + + boolean flag1 = !p_179663_1_.equals("e"); + boolean flag2 = p_179663_1_.equals("r") && s != null; + + if ((s == null || !p_179663_1_.equals("e")) && !flag2) + { + if (flag1) + { + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ instanceof EntityPlayer; + } + }); + } + } + else + { + final String s_f = s; + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return EntityList.isStringEntityName(p_apply_1_, s_f) != flag; + } + }); + } + + return list; + } + + private static List> getXpLevelPredicates(Map p_179648_0_) + { + List> list = Lists.>newArrayList(); + final int i = parseIntWithDefault(p_179648_0_, "lm", -1); + final int j = parseIntWithDefault(p_179648_0_, "l", -1); + + if (i > -1 || j > -1) + { + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + if (!(p_apply_1_ instanceof EntityPlayerMP)) + { + return false; + } + else + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_; + return (i <= -1 || entityplayermp.experienceLevel >= i) && (j <= -1 || entityplayermp.experienceLevel <= j); + } + } + }); + } + + return list; + } + + private static List> getGamemodePredicates(Map p_179649_0_) + { + List> list = Lists.>newArrayList(); + final int i = parseIntWithDefault(p_179649_0_, "m", WorldSettings.GameType.NOT_SET.getID()); + + if (i != WorldSettings.GameType.NOT_SET.getID()) + { + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + if (!(p_apply_1_ instanceof EntityPlayerMP)) + { + return false; + } + else + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)p_apply_1_; + return entityplayermp.theItemInWorldManager.getGameType().getID() == i; + } + } + }); + } + + return list; + } + + private static List> getTeamPredicates(Map p_179659_0_) + { + List> list = Lists.>newArrayList(); + String s = func_179651_b(p_179659_0_, "team"); + final boolean flag = s != null && s.startsWith("!"); + + if (flag) + { + s = s.substring(1); + } + + if (s != null) + { + final String s_f = s; + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + if (!(p_apply_1_ instanceof EntityLivingBase)) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_; + Team team = entitylivingbase.getTeam(); + String s1 = team == null ? "" : team.getRegisteredName(); + return s1.equals(s_f) != flag; + } + } + }); + } + + return list; + } + + private static List> getScorePredicates(Map p_179657_0_) + { + List> list = Lists.>newArrayList(); + final Map map = func_96560_a(p_179657_0_); + + if (map != null && map.size() > 0) + { + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + + for (Entry entry : map.entrySet()) + { + String s = (String)entry.getKey(); + boolean flag = false; + + if (s.endsWith("_min") && s.length() > 4) + { + flag = true; + s = s.substring(0, s.length() - 4); + } + + ScoreObjective scoreobjective = scoreboard.getObjective(s); + + if (scoreobjective == null) + { + return false; + } + + String s1 = p_apply_1_ instanceof EntityPlayerMP ? p_apply_1_.getName() : p_apply_1_.getUniqueID().toString(); + + if (!scoreboard.entityHasObjective(s1, scoreobjective)) + { + return false; + } + + Score score = scoreboard.getValueFromObjective(s1, scoreobjective); + int i = score.getScorePoints(); + + if (i < ((Integer)entry.getValue()).intValue() && flag) + { + return false; + } + + if (i > ((Integer)entry.getValue()).intValue() && !flag) + { + return false; + } + } + + return true; + } + }); + } + + return list; + } + + private static List> getNamePredicates(Map p_179647_0_) + { + List> list = Lists.>newArrayList(); + String s = func_179651_b(p_179647_0_, "name"); + final boolean flag = s != null && s.startsWith("!"); + + if (flag) + { + s = s.substring(1); + } + + if (s != null) + { + final String s_f = s; + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_.getName().equals(s_f) != flag; + } + }); + } + + return list; + } + + private static List> func_180698_a(Map p_180698_0_, final BlockPos p_180698_1_) + { + List> list = Lists.>newArrayList(); + final int i = parseIntWithDefault(p_180698_0_, "rm", -1); + final int j = parseIntWithDefault(p_180698_0_, "r", -1); + + if (p_180698_1_ != null && (i >= 0 || j >= 0)) + { + final int k = i * i; + final int l = j * j; + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + int i1 = (int)p_apply_1_.getDistanceSqToCenter(p_180698_1_); + return (i < 0 || i1 >= k) && (j < 0 || i1 <= l); + } + }); + } + + return list; + } + + private static List> getRotationsPredicates(Map p_179662_0_) + { + List> list = Lists.>newArrayList(); + + if (p_179662_0_.containsKey("rym") || p_179662_0_.containsKey("ry")) + { + final int i = func_179650_a(parseIntWithDefault(p_179662_0_, "rym", 0)); + final int j = func_179650_a(parseIntWithDefault(p_179662_0_, "ry", 359)); + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + int i1 = PlayerSelector.func_179650_a((int)Math.floor((double)p_apply_1_.rotationYaw)); + return i > j ? i1 >= i || i1 <= j : i1 >= i && i1 <= j; + } + }); + } + + if (p_179662_0_.containsKey("rxm") || p_179662_0_.containsKey("rx")) + { + final int k = func_179650_a(parseIntWithDefault(p_179662_0_, "rxm", 0)); + final int l = func_179650_a(parseIntWithDefault(p_179662_0_, "rx", 359)); + list.add(new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + int i1 = PlayerSelector.func_179650_a((int)Math.floor((double)p_apply_1_.rotationPitch)); + return k > l ? i1 >= k || i1 <= l : i1 >= k && i1 <= l; + } + }); + } + + return list; + } + + private static List filterResults(Map params, Class entityClass, List> inputList, String type, World worldIn, BlockPos position) + { + List list = Lists.newArrayList(); + String s = func_179651_b(params, "type"); + s = s != null && s.startsWith("!") ? s.substring(1) : s; + boolean flag = !type.equals("e"); + boolean flag1 = type.equals("r") && s != null; + int i = parseIntWithDefault(params, "dx", 0); + int j = parseIntWithDefault(params, "dy", 0); + int k = parseIntWithDefault(params, "dz", 0); + int l = parseIntWithDefault(params, "r", -1); + Predicate predicate = Predicates.and(inputList); + Predicate predicate1 = Predicates. and (EntitySelectors.selectAnything, predicate); + + if (position != null) + { + int i1 = worldIn.playerEntities.size(); + int j1 = worldIn.loadedEntityList.size(); + boolean flag2 = i1 < j1 / 16; + + if (!params.containsKey("dx") && !params.containsKey("dy") && !params.containsKey("dz")) + { + if (l >= 0) + { + AxisAlignedBB axisalignedbb1 = new AxisAlignedBB((double)(position.getX() - l), (double)(position.getY() - l), (double)(position.getZ() - l), (double)(position.getX() + l + 1), (double)(position.getY() + l + 1), (double)(position.getZ() + l + 1)); + + if (flag && flag2 && !flag1) + { + list.addAll(worldIn.getPlayers(entityClass, predicate1)); + } + else + { + list.addAll(worldIn.getEntitiesWithinAABB(entityClass, axisalignedbb1, predicate1)); + } + } + else if (type.equals("a")) + { + list.addAll(worldIn.getPlayers(entityClass, predicate)); + } + else if (!type.equals("p") && (!type.equals("r") || flag1)) + { + list.addAll(worldIn.getEntities(entityClass, predicate1)); + } + else + { + list.addAll(worldIn.getPlayers(entityClass, predicate1)); + } + } + else + { + final AxisAlignedBB axisalignedbb = func_179661_a(position, i, j, k); + + if (flag && flag2 && !flag1) + { + Predicate predicate2 = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_.posX >= axisalignedbb.minX && p_apply_1_.posY >= axisalignedbb.minY && p_apply_1_.posZ >= axisalignedbb.minZ ? p_apply_1_.posX < axisalignedbb.maxX && p_apply_1_.posY < axisalignedbb.maxY && p_apply_1_.posZ < axisalignedbb.maxZ : false; + } + }; + list.addAll(worldIn.getPlayers(entityClass, Predicates. and (predicate1, predicate2))); + } + else + { + list.addAll(worldIn.getEntitiesWithinAABB(entityClass, axisalignedbb, predicate1)); + } + } + } + else if (type.equals("a")) + { + list.addAll(worldIn.getPlayers(entityClass, predicate)); + } + else if (!type.equals("p") && (!type.equals("r") || flag1)) + { + list.addAll(worldIn.getEntities(entityClass, predicate1)); + } + else + { + list.addAll(worldIn.getPlayers(entityClass, predicate1)); + } + + return list; + } + + private static List func_179658_a(List p_179658_0_, Map p_179658_1_, ICommandSender p_179658_2_, Class p_179658_3_, String p_179658_4_, final BlockPos p_179658_5_) + { + int i = parseIntWithDefault(p_179658_1_, "c", !p_179658_4_.equals("a") && !p_179658_4_.equals("e") ? 1 : 0); + + if (!p_179658_4_.equals("p") && !p_179658_4_.equals("a") && !p_179658_4_.equals("e")) + { + if (p_179658_4_.equals("r")) + { + Collections.shuffle((List)p_179658_0_); + } + } + else if (p_179658_5_ != null) + { + Collections.sort((List)p_179658_0_, new Comparator() + { + public int compare(Entity p_compare_1_, Entity p_compare_2_) + { + return ComparisonChain.start().compare(p_compare_1_.getDistanceSq(p_179658_5_), p_compare_2_.getDistanceSq(p_179658_5_)).result(); + } + }); + } + + Entity entity = p_179658_2_.getCommandSenderEntity(); + + if (entity != null && p_179658_3_.isAssignableFrom(entity.getClass()) && i == 1 && ((List)p_179658_0_).contains(entity) && !"r".equals(p_179658_4_)) + { + p_179658_0_ = Lists.newArrayList((T)entity); + } + + if (i != 0) + { + if (i < 0) + { + Collections.reverse((List)p_179658_0_); + } + + p_179658_0_ = ((List)p_179658_0_).subList(0, Math.min(Math.abs(i), ((List)p_179658_0_).size())); + } + + return (List)p_179658_0_; + } + + private static AxisAlignedBB func_179661_a(BlockPos p_179661_0_, int p_179661_1_, int p_179661_2_, int p_179661_3_) + { + boolean flag = p_179661_1_ < 0; + boolean flag1 = p_179661_2_ < 0; + boolean flag2 = p_179661_3_ < 0; + int i = p_179661_0_.getX() + (flag ? p_179661_1_ : 0); + int j = p_179661_0_.getY() + (flag1 ? p_179661_2_ : 0); + int k = p_179661_0_.getZ() + (flag2 ? p_179661_3_ : 0); + int l = p_179661_0_.getX() + (flag ? 0 : p_179661_1_) + 1; + int i1 = p_179661_0_.getY() + (flag1 ? 0 : p_179661_2_) + 1; + int j1 = p_179661_0_.getZ() + (flag2 ? 0 : p_179661_3_) + 1; + return new AxisAlignedBB((double)i, (double)j, (double)k, (double)l, (double)i1, (double)j1); + } + + public static int func_179650_a(int p_179650_0_) + { + p_179650_0_ = p_179650_0_ % 360; + + if (p_179650_0_ >= 160) + { + p_179650_0_ -= 360; + } + + if (p_179650_0_ < 0) + { + p_179650_0_ += 360; + } + + return p_179650_0_; + } + + private static BlockPos func_179664_b(Map p_179664_0_, BlockPos p_179664_1_) + { + return new BlockPos(parseIntWithDefault(p_179664_0_, "x", p_179664_1_.getX()), parseIntWithDefault(p_179664_0_, "y", p_179664_1_.getY()), parseIntWithDefault(p_179664_0_, "z", p_179664_1_.getZ())); + } + + private static boolean func_179665_h(Map p_179665_0_) + { + for (String s : WORLD_BINDING_ARGS) + { + if (p_179665_0_.containsKey(s)) + { + return true; + } + } + + return false; + } + + private static int parseIntWithDefault(Map p_179653_0_, String p_179653_1_, int p_179653_2_) + { + return p_179653_0_.containsKey(p_179653_1_) ? MathHelper.parseIntWithDefault((String)p_179653_0_.get(p_179653_1_), p_179653_2_) : p_179653_2_; + } + + private static String func_179651_b(Map p_179651_0_, String p_179651_1_) + { + return (String)p_179651_0_.get(p_179651_1_); + } + + public static Map func_96560_a(Map p_96560_0_) + { + Map map = Maps.newHashMap(); + + for (String s : p_96560_0_.keySet()) + { + if (s.startsWith("score_") && s.length() > "score_".length()) + { + map.put(s.substring("score_".length()), Integer.valueOf(MathHelper.parseIntWithDefault((String)p_96560_0_.get(s), 1))); + } + } + + return map; + } + + public static boolean matchesMultiplePlayers(String p_82377_0_) + { + Matcher matcher = tokenPattern.matcher(p_82377_0_); + + if (!matcher.matches()) + { + return false; + } + else + { + Map map = getArgumentMap(matcher.group(2)); + String s = matcher.group(1); + int i = !"a".equals(s) && !"e".equals(s) ? 1 : 0; + return parseIntWithDefault(map, "c", i) != 1; + } + } + + public static boolean hasArguments(String p_82378_0_) + { + return tokenPattern.matcher(p_82378_0_).matches(); + } + + private static Map getArgumentMap(String argumentString) + { + Map map = Maps.newHashMap(); + + if (argumentString == null) + { + return map; + } + else + { + int i = 0; + int j = -1; + + for (Matcher matcher = intListPattern.matcher(argumentString); matcher.find(); j = matcher.end()) + { + String s = null; + + switch (i++) + { + case 0: + s = "x"; + break; + + case 1: + s = "y"; + break; + + case 2: + s = "z"; + break; + + case 3: + s = "r"; + } + + if (s != null && matcher.group(1).length() > 0) + { + map.put(s, matcher.group(1)); + } + } + + if (j < argumentString.length()) + { + Matcher matcher1 = keyValueListPattern.matcher(j == -1 ? argumentString : argumentString.substring(j)); + + while (matcher1.find()) + { + map.put(matcher1.group(1), matcher1.group(2)); + } + } + + return map; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/ServerCommandManager.java b/Client-1.8.9/src/main/java/net/minecraft/command/ServerCommandManager.java new file mode 100644 index 0000000..746e4b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/ServerCommandManager.java @@ -0,0 +1,159 @@ +package net.minecraft.command; + +import net.minecraft.command.server.CommandAchievement; +import net.minecraft.command.server.CommandBanIp; +import net.minecraft.command.server.CommandBanPlayer; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.command.server.CommandBroadcast; +import net.minecraft.command.server.CommandDeOp; +import net.minecraft.command.server.CommandEmote; +import net.minecraft.command.server.CommandListBans; +import net.minecraft.command.server.CommandListPlayers; +import net.minecraft.command.server.CommandMessage; +import net.minecraft.command.server.CommandMessageRaw; +import net.minecraft.command.server.CommandOp; +import net.minecraft.command.server.CommandPardonIp; +import net.minecraft.command.server.CommandPardonPlayer; +import net.minecraft.command.server.CommandPublishLocalServer; +import net.minecraft.command.server.CommandSaveAll; +import net.minecraft.command.server.CommandSaveOff; +import net.minecraft.command.server.CommandSaveOn; +import net.minecraft.command.server.CommandScoreboard; +import net.minecraft.command.server.CommandSetBlock; +import net.minecraft.command.server.CommandSetDefaultSpawnpoint; +import net.minecraft.command.server.CommandStop; +import net.minecraft.command.server.CommandSummon; +import net.minecraft.command.server.CommandTeleport; +import net.minecraft.command.server.CommandTestFor; +import net.minecraft.command.server.CommandTestForBlock; +import net.minecraft.command.server.CommandWhitelist; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.rcon.RConConsoleSource; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class ServerCommandManager extends CommandHandler implements IAdminCommand +{ + public ServerCommandManager() + { + this.registerCommand(new CommandTime()); + this.registerCommand(new CommandGameMode()); + this.registerCommand(new CommandDifficulty()); + this.registerCommand(new CommandDefaultGameMode()); + this.registerCommand(new CommandKill()); + this.registerCommand(new CommandToggleDownfall()); + this.registerCommand(new CommandWeather()); + this.registerCommand(new CommandXP()); + this.registerCommand(new CommandTeleport()); + this.registerCommand(new CommandGive()); + this.registerCommand(new CommandReplaceItem()); + this.registerCommand(new CommandStats()); + this.registerCommand(new CommandEffect()); + this.registerCommand(new CommandEnchant()); + this.registerCommand(new CommandParticle()); + this.registerCommand(new CommandEmote()); + this.registerCommand(new CommandShowSeed()); + this.registerCommand(new CommandHelp()); + this.registerCommand(new CommandDebug()); + this.registerCommand(new CommandMessage()); + this.registerCommand(new CommandBroadcast()); + this.registerCommand(new CommandSetSpawnpoint()); + this.registerCommand(new CommandSetDefaultSpawnpoint()); + this.registerCommand(new CommandGameRule()); + this.registerCommand(new CommandClearInventory()); + this.registerCommand(new CommandTestFor()); + this.registerCommand(new CommandSpreadPlayers()); + this.registerCommand(new CommandPlaySound()); + this.registerCommand(new CommandScoreboard()); + this.registerCommand(new CommandExecuteAt()); + this.registerCommand(new CommandTrigger()); + this.registerCommand(new CommandAchievement()); + this.registerCommand(new CommandSummon()); + this.registerCommand(new CommandSetBlock()); + this.registerCommand(new CommandFill()); + this.registerCommand(new CommandClone()); + this.registerCommand(new CommandCompare()); + this.registerCommand(new CommandBlockData()); + this.registerCommand(new CommandTestForBlock()); + this.registerCommand(new CommandMessageRaw()); + this.registerCommand(new CommandWorldBorder()); + this.registerCommand(new CommandTitle()); + this.registerCommand(new CommandEntityData()); + + if (MinecraftServer.getServer().isDedicatedServer()) + { + this.registerCommand(new CommandOp()); + this.registerCommand(new CommandDeOp()); + this.registerCommand(new CommandStop()); + this.registerCommand(new CommandSaveAll()); + this.registerCommand(new CommandSaveOff()); + this.registerCommand(new CommandSaveOn()); + this.registerCommand(new CommandBanIp()); + this.registerCommand(new CommandPardonIp()); + this.registerCommand(new CommandBanPlayer()); + this.registerCommand(new CommandListBans()); + this.registerCommand(new CommandPardonPlayer()); + this.registerCommand(new CommandServerKick()); + this.registerCommand(new CommandListPlayers()); + this.registerCommand(new CommandWhitelist()); + this.registerCommand(new CommandSetPlayerTimeout()); + } + else + { + this.registerCommand(new CommandPublishLocalServer()); + } + + CommandBase.setAdminCommander(this); + } + + public void notifyOperators(ICommandSender sender, ICommand command, int flags, String msgFormat, Object... msgParams) + { + boolean flag = true; + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (!sender.sendCommandFeedback()) + { + flag = false; + } + + IChatComponent ichatcomponent = new ChatComponentTranslation("chat.type.admin", new Object[] {sender.getName(), new ChatComponentTranslation(msgFormat, msgParams)}); + ichatcomponent.getChatStyle().setColor(EnumChatFormatting.GRAY); + ichatcomponent.getChatStyle().setItalic(Boolean.valueOf(true)); + + if (flag) + { + for (EntityPlayer entityplayer : minecraftserver.getConfigurationManager().getPlayerList()) + { + if (entityplayer != sender && minecraftserver.getConfigurationManager().canSendCommands(entityplayer.getGameProfile()) && command.canCommandSenderUseCommand(sender)) + { + boolean flag1 = sender instanceof MinecraftServer && MinecraftServer.getServer().shouldBroadcastConsoleToOps(); + boolean flag2 = sender instanceof RConConsoleSource && MinecraftServer.getServer().shouldBroadcastRconToOps(); + + if (flag1 || flag2 || !(sender instanceof RConConsoleSource) && !(sender instanceof MinecraftServer)) + { + entityplayer.addChatMessage(ichatcomponent); + } + } + } + } + + if (sender != minecraftserver && minecraftserver.worldServers[0].getGameRules().getBoolean("logAdminCommands")) + { + minecraftserver.addChatMessage(ichatcomponent); + } + + boolean flag3 = minecraftserver.worldServers[0].getGameRules().getBoolean("sendCommandFeedback"); + + if (sender instanceof CommandBlockLogic) + { + flag3 = ((CommandBlockLogic)sender).shouldTrackOutput(); + } + + if ((flags & 1) != 1 && flag3 || sender instanceof MinecraftServer) + { + sender.addChatMessage(new ChatComponentTranslation(msgFormat, msgParams)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/SyntaxErrorException.java b/Client-1.8.9/src/main/java/net/minecraft/command/SyntaxErrorException.java new file mode 100644 index 0000000..ba62714 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/SyntaxErrorException.java @@ -0,0 +1,14 @@ +package net.minecraft.command; + +public class SyntaxErrorException extends CommandException +{ + public SyntaxErrorException() + { + this("commands.generic.snytax", new Object[0]); + } + + public SyntaxErrorException(String message, Object... replacements) + { + super(message, replacements); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/WrongUsageException.java b/Client-1.8.9/src/main/java/net/minecraft/command/WrongUsageException.java new file mode 100644 index 0000000..726c3ee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/WrongUsageException.java @@ -0,0 +1,9 @@ +package net.minecraft.command; + +public class WrongUsageException extends SyntaxErrorException +{ + public WrongUsageException(String message, Object... replacements) + { + super(message, replacements); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandAchievement.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandAchievement.java new file mode 100644 index 0000000..381bc30 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandAchievement.java @@ -0,0 +1,192 @@ +package net.minecraft.command.server; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; + +public class CommandAchievement extends CommandBase +{ + public String getCommandName() + { + return "achievement"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.achievement.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.achievement.usage", new Object[0]); + } + else + { + final StatBase statbase = StatList.getOneShotStat(args[1]); + + if (statbase == null && !args[1].equals("*")) + { + throw new CommandException("commands.achievement.unknownAchievement", new Object[] {args[1]}); + } + else + { + final EntityPlayerMP entityplayermp = args.length >= 3 ? getPlayer(sender, args[2]) : getCommandSenderAsPlayer(sender); + boolean flag = args[0].equalsIgnoreCase("give"); + boolean flag1 = args[0].equalsIgnoreCase("take"); + + if (flag || flag1) + { + if (statbase == null) + { + if (flag) + { + for (Achievement achievement4 : AchievementList.achievementList) + { + entityplayermp.triggerAchievement(achievement4); + } + + notifyOperators(sender, this, "commands.achievement.give.success.all", new Object[] {entityplayermp.getName()}); + } + else if (flag1) + { + for (Achievement achievement5 : Lists.reverse(AchievementList.achievementList)) + { + entityplayermp.func_175145_a(achievement5); + } + + notifyOperators(sender, this, "commands.achievement.take.success.all", new Object[] {entityplayermp.getName()}); + } + } + else + { + if (statbase instanceof Achievement) + { + Achievement achievement = (Achievement)statbase; + + if (flag) + { + if (entityplayermp.getStatFile().hasAchievementUnlocked(achievement)) + { + throw new CommandException("commands.achievement.alreadyHave", new Object[] {entityplayermp.getName(), statbase.createChatComponent()}); + } + + List list; + + for (list = Lists.newArrayList(); achievement.parentAchievement != null && !entityplayermp.getStatFile().hasAchievementUnlocked(achievement.parentAchievement); achievement = achievement.parentAchievement) + { + list.add(achievement.parentAchievement); + } + + for (Achievement achievement1 : Lists.reverse(list)) + { + entityplayermp.triggerAchievement(achievement1); + } + } + else if (flag1) + { + if (!entityplayermp.getStatFile().hasAchievementUnlocked(achievement)) + { + throw new CommandException("commands.achievement.dontHave", new Object[] {entityplayermp.getName(), statbase.createChatComponent()}); + } + + List list1 = Lists.newArrayList(Iterators.filter(AchievementList.achievementList.iterator(), new Predicate() + { + public boolean apply(Achievement p_apply_1_) + { + return entityplayermp.getStatFile().hasAchievementUnlocked(p_apply_1_) && p_apply_1_ != statbase; + } + })); + List list2 = Lists.newArrayList(list1); + + for (Achievement achievement2 : list1) + { + Achievement achievement3 = achievement2; + boolean flag2; + + for (flag2 = false; achievement3 != null; achievement3 = achievement3.parentAchievement) + { + if (achievement3 == statbase) + { + flag2 = true; + } + } + + if (!flag2) + { + for (achievement3 = achievement2; achievement3 != null; achievement3 = achievement3.parentAchievement) + { + list2.remove(achievement2); + } + } + } + + for (Achievement achievement6 : list2) + { + entityplayermp.func_175145_a(achievement6); + } + } + } + + if (flag) + { + entityplayermp.triggerAchievement(statbase); + notifyOperators(sender, this, "commands.achievement.give.success.one", new Object[] {entityplayermp.getName(), statbase.createChatComponent()}); + } + else if (flag1) + { + entityplayermp.func_175145_a(statbase); + notifyOperators(sender, this, "commands.achievement.take.success.one", new Object[] {statbase.createChatComponent(), entityplayermp.getName()}); + } + } + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + if (args.length == 1) + { + return getListOfStringsMatchingLastWord(args, new String[] {"give", "take"}); + } + else if (args.length != 2) + { + return args.length == 3 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } + else + { + List list = Lists.newArrayList(); + + for (StatBase statbase : StatList.allStats) + { + list.add(statbase.statId); + } + + return getListOfStringsMatchingLastWord(args, list); + } + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBanIp.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBanIp.java new file mode 100644 index 0000000..50ee0ab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBanIp.java @@ -0,0 +1,99 @@ +package net.minecraft.command.server; + +import java.util.Date; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.IPBanEntry; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; + +public class CommandBanIp extends CommandBase +{ + public static final Pattern field_147211_a = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); + + public String getCommandName() + { + return "ban-ip"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isLanServer() && super.canCommandSenderUseCommand(sender); + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.banip.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length >= 1 && args[0].length() > 1) + { + IChatComponent ichatcomponent = args.length >= 2 ? getChatComponentFromNthArg(sender, args, 1) : null; + Matcher matcher = field_147211_a.matcher(args[0]); + + if (matcher.matches()) + { + this.func_147210_a(sender, args[0], ichatcomponent == null ? null : ichatcomponent.getUnformattedText()); + } + else + { + EntityPlayerMP entityplayermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(args[0]); + + if (entityplayermp == null) + { + throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]); + } + + this.func_147210_a(sender, entityplayermp.getPlayerIP(), ichatcomponent == null ? null : ichatcomponent.getUnformattedText()); + } + } + else + { + throw new WrongUsageException("commands.banip.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } + + protected void func_147210_a(ICommandSender sender, String address, String reason) + { + IPBanEntry ipbanentry = new IPBanEntry(address, (Date)null, sender.getName(), (Date)null, reason); + MinecraftServer.getServer().getConfigurationManager().getBannedIPs().addEntry(ipbanentry); + List list = MinecraftServer.getServer().getConfigurationManager().getPlayersMatchingAddress(address); + String[] astring = new String[list.size()]; + int i = 0; + + for (EntityPlayerMP entityplayermp : list) + { + entityplayermp.playerNetServerHandler.kickPlayerFromServer("You have been IP banned."); + astring[i++] = entityplayermp.getName(); + } + + if (list.isEmpty()) + { + notifyOperators(sender, this, "commands.banip.success", new Object[] {address}); + } + else + { + notifyOperators(sender, this, "commands.banip.success.players", new Object[] {address, joinNiceString(astring)}); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBanPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBanPlayer.java new file mode 100644 index 0000000..55a1b89 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBanPlayer.java @@ -0,0 +1,79 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.Date; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.UserListBansEntry; +import net.minecraft.util.BlockPos; + +public class CommandBanPlayer extends CommandBase +{ + public String getCommandName() + { + return "ban"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.ban.usage"; + } + + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isLanServer() && super.canCommandSenderUseCommand(sender); + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length >= 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.getPlayerProfileCache().getGameProfileForUsername(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.ban.failed", new Object[] {args[0]}); + } + else + { + String s = null; + + if (args.length >= 2) + { + s = getChatComponentFromNthArg(sender, args, 1).getUnformattedText(); + } + + UserListBansEntry userlistbansentry = new UserListBansEntry(gameprofile, (Date)null, sender.getName(), (Date)null, s); + minecraftserver.getConfigurationManager().getBannedPlayers().addEntry(userlistbansentry); + EntityPlayerMP entityplayermp = minecraftserver.getConfigurationManager().getPlayerByUsername(args[0]); + + if (entityplayermp != null) + { + entityplayermp.playerNetServerHandler.kickPlayerFromServer("You are banned from this server."); + } + + notifyOperators(sender, this, "commands.ban.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.ban.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length >= 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBlockLogic.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBlockLogic.java new file mode 100644 index 0000000..38b5676 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBlockLogic.java @@ -0,0 +1,216 @@ +package net.minecraft.command.server; + +import io.netty.buffer.ByteBuf; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.Callable; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ReportedException; +import net.minecraft.world.World; + +public abstract class CommandBlockLogic implements ICommandSender +{ + private static final SimpleDateFormat timestampFormat = new SimpleDateFormat("HH:mm:ss"); + private int successCount; + private boolean trackOutput = true; + private IChatComponent lastOutput = null; + private String commandStored = ""; + private String customName = "@"; + private final CommandResultStats resultStats = new CommandResultStats(); + + public int getSuccessCount() + { + return this.successCount; + } + + public IChatComponent getLastOutput() + { + return this.lastOutput; + } + + public void writeDataToNBT(NBTTagCompound tagCompound) + { + tagCompound.setString("Command", this.commandStored); + tagCompound.setInteger("SuccessCount", this.successCount); + tagCompound.setString("CustomName", this.customName); + tagCompound.setBoolean("TrackOutput", this.trackOutput); + + if (this.lastOutput != null && this.trackOutput) + { + tagCompound.setString("LastOutput", IChatComponent.Serializer.componentToJson(this.lastOutput)); + } + + this.resultStats.writeStatsToNBT(tagCompound); + } + + public void readDataFromNBT(NBTTagCompound nbt) + { + this.commandStored = nbt.getString("Command"); + this.successCount = nbt.getInteger("SuccessCount"); + + if (nbt.hasKey("CustomName", 8)) + { + this.customName = nbt.getString("CustomName"); + } + + if (nbt.hasKey("TrackOutput", 1)) + { + this.trackOutput = nbt.getBoolean("TrackOutput"); + } + + if (nbt.hasKey("LastOutput", 8) && this.trackOutput) + { + this.lastOutput = IChatComponent.Serializer.jsonToComponent(nbt.getString("LastOutput")); + } + + this.resultStats.readStatsFromNBT(nbt); + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return permLevel <= 2; + } + + public void setCommand(String command) + { + this.commandStored = command; + this.successCount = 0; + } + + public String getCommand() + { + return this.commandStored; + } + + public void trigger(World worldIn) + { + if (worldIn.isRemote) + { + this.successCount = 0; + } + + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (minecraftserver != null && minecraftserver.isAnvilFileSet() && minecraftserver.isCommandBlockEnabled()) + { + ICommandManager icommandmanager = minecraftserver.getCommandManager(); + + try + { + this.lastOutput = null; + this.successCount = icommandmanager.executeCommand(this, this.commandStored); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Executing command block"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Command to be executed"); + crashreportcategory.addCrashSectionCallable("Command", new Callable() + { + public String call() throws Exception + { + return CommandBlockLogic.this.getCommand(); + } + }); + crashreportcategory.addCrashSectionCallable("Name", new Callable() + { + public String call() throws Exception + { + return CommandBlockLogic.this.getName(); + } + }); + throw new ReportedException(crashreport); + } + } + else + { + this.successCount = 0; + } + } + + public String getName() + { + return this.customName; + } + + public IChatComponent getDisplayName() + { + return new ChatComponentText(this.getName()); + } + + public void setName(String p_145754_1_) + { + this.customName = p_145754_1_; + } + + public void addChatMessage(IChatComponent component) + { + if (this.trackOutput && this.getEntityWorld() != null && !this.getEntityWorld().isRemote) + { + this.lastOutput = (new ChatComponentText("[" + timestampFormat.format(new Date()) + "] ")).appendSibling(component); + this.updateCommand(); + } + } + + public boolean sendCommandFeedback() + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + return minecraftserver == null || !minecraftserver.isAnvilFileSet() || minecraftserver.worldServers[0].getGameRules().getBoolean("commandBlockOutput"); + } + + public void setCommandStat(CommandResultStats.Type type, int amount) + { + this.resultStats.setCommandStatScore(this, type, amount); + } + + public abstract void updateCommand(); + + public abstract int func_145751_f(); + + public abstract void func_145757_a(ByteBuf p_145757_1_); + + public void setLastOutput(IChatComponent lastOutputMessage) + { + this.lastOutput = lastOutputMessage; + } + + public void setTrackOutput(boolean shouldTrackOutput) + { + this.trackOutput = shouldTrackOutput; + } + + public boolean shouldTrackOutput() + { + return this.trackOutput; + } + + public boolean tryOpenEditCommandBlock(EntityPlayer playerIn) + { + if (!playerIn.capabilities.isCreativeMode) + { + return false; + } + else + { + if (playerIn.getEntityWorld().isRemote) + { + playerIn.openEditCommandBlock(this); + } + + return true; + } + } + + public CommandResultStats getCommandResultStats() + { + return this.resultStats; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBroadcast.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBroadcast.java new file mode 100644 index 0000000..2d2e32e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandBroadcast.java @@ -0,0 +1,47 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class CommandBroadcast extends CommandBase +{ + public String getCommandName() + { + return "say"; + } + + public int getRequiredPermissionLevel() + { + return 1; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.say.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length > 0 && args[0].length() > 0) + { + IChatComponent ichatcomponent = getChatComponentFromNthArg(sender, args, 0, true); + MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentTranslation("chat.type.announcement", new Object[] {sender.getDisplayName(), ichatcomponent})); + } + else + { + throw new WrongUsageException("commands.say.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length >= 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandDeOp.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandDeOp.java new file mode 100644 index 0000000..be71551 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandDeOp.java @@ -0,0 +1,56 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandDeOp extends CommandBase +{ + public String getCommandName() + { + return "deop"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.deop.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length == 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.getConfigurationManager().getOppedPlayers().getGameProfileFromName(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.deop.failed", new Object[] {args[0]}); + } + else + { + minecraftserver.getConfigurationManager().removeOp(gameprofile); + notifyOperators(sender, this, "commands.deop.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.deop.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().getOppedPlayerNames()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandEmote.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandEmote.java new file mode 100644 index 0000000..dff25cf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandEmote.java @@ -0,0 +1,48 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class CommandEmote extends CommandBase +{ + public String getCommandName() + { + return "me"; + } + + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.me.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length <= 0) + { + throw new WrongUsageException("commands.me.usage", new Object[0]); + } + else + { + IChatComponent ichatcomponent = getChatComponentFromNthArg(sender, args, 0, !(sender instanceof EntityPlayer)); + MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentTranslation("chat.type.emote", new Object[] {sender.getDisplayName(), ichatcomponent})); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandListBans.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandListBans.java new file mode 100644 index 0000000..271b501 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandListBans.java @@ -0,0 +1,52 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandListBans extends CommandBase +{ + public String getCommandName() + { + return "banlist"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isLanServer() || MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isLanServer()) && super.canCommandSenderUseCommand(sender); + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.banlist.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length >= 1 && args[0].equalsIgnoreCase("ips")) + { + sender.addChatMessage(new ChatComponentTranslation("commands.banlist.ips", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getKeys().length)})); + sender.addChatMessage(new ChatComponentText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getKeys()))); + } + else + { + sender.addChatMessage(new ChatComponentTranslation("commands.banlist.players", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getKeys().length)})); + sender.addChatMessage(new ChatComponentText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getKeys()))); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"players", "ips"}): null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandListPlayers.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandListPlayers.java new file mode 100644 index 0000000..4dda402 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandListPlayers.java @@ -0,0 +1,35 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandListPlayers extends CommandBase +{ + public String getCommandName() + { + return "list"; + } + + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.players.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + int i = MinecraftServer.getServer().getCurrentPlayerCount(); + sender.addChatMessage(new ChatComponentTranslation("commands.players.list", new Object[] {Integer.valueOf(i), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())})); + sender.addChatMessage(new ChatComponentText(MinecraftServer.getServer().getConfigurationManager().func_181058_b(args.length > 0 && "uuids".equalsIgnoreCase(args[0])))); + sender.setCommandStat(CommandResultStats.Type.QUERY_RESULT, i); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandMessage.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandMessage.java new file mode 100644 index 0000000..55f00f5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandMessage.java @@ -0,0 +1,75 @@ +package net.minecraft.command.server; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class CommandMessage extends CommandBase +{ + public List getCommandAliases() + { + return Arrays.asList(new String[] {"w", "msg"}); + } + + public String getCommandName() + { + return "tell"; + } + + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.message.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.message.usage", new Object[0]); + } + else + { + EntityPlayer entityplayer = getPlayer(sender, args[0]); + + if (entityplayer == sender) + { + throw new PlayerNotFoundException("commands.message.sameTarget", new Object[0]); + } + else + { + IChatComponent ichatcomponent = getChatComponentFromNthArg(sender, args, 1, !(sender instanceof EntityPlayer)); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.message.display.incoming", new Object[] {sender.getDisplayName(), ichatcomponent.createCopy()}); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.message.display.outgoing", new Object[] {entityplayer.getDisplayName(), ichatcomponent.createCopy()}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true)); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true)); + entityplayer.addChatMessage(chatcomponenttranslation); + sender.addChatMessage(chatcomponenttranslation1); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandMessageRaw.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandMessageRaw.java new file mode 100644 index 0000000..8392b46 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandMessageRaw.java @@ -0,0 +1,67 @@ +package net.minecraft.command.server; + +import com.google.gson.JsonParseException; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentProcessor; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.exception.ExceptionUtils; + +public class CommandMessageRaw extends CommandBase +{ + public String getCommandName() + { + return "tellraw"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.tellraw.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 2) + { + throw new WrongUsageException("commands.tellraw.usage", new Object[0]); + } + else + { + EntityPlayer entityplayer = getPlayer(sender, args[0]); + String s = buildString(args, 1); + + try + { + IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + entityplayer.addChatMessage(ChatComponentProcessor.processComponent(sender, ichatcomponent, entityplayer)); + } + catch (JsonParseException jsonparseexception) + { + Throwable throwable = ExceptionUtils.getRootCause(jsonparseexception); + throw new SyntaxErrorException("commands.tellraw.jsonException", new Object[] {throwable == null ? "" : throwable.getMessage()}); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandOp.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandOp.java new file mode 100644 index 0000000..118084e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandOp.java @@ -0,0 +1,75 @@ +package net.minecraft.command.server; + +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandOp extends CommandBase +{ + public String getCommandName() + { + return "op"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.op.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length == 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.getPlayerProfileCache().getGameProfileForUsername(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.op.failed", new Object[] {args[0]}); + } + else + { + minecraftserver.getConfigurationManager().addOp(gameprofile); + notifyOperators(sender, this, "commands.op.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.op.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + if (args.length == 1) + { + String s = args[args.length - 1]; + List list = Lists.newArrayList(); + + for (GameProfile gameprofile : MinecraftServer.getServer().getGameProfiles()) + { + if (!MinecraftServer.getServer().getConfigurationManager().canSendCommands(gameprofile) && doesStringStartWith(s, gameprofile.getName())) + { + list.add(gameprofile.getName()); + } + } + + return list; + } + else + { + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPardonIp.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPardonIp.java new file mode 100644 index 0000000..0c1ebd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPardonIp.java @@ -0,0 +1,61 @@ +package net.minecraft.command.server; + +import java.util.List; +import java.util.regex.Matcher; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandPardonIp extends CommandBase +{ + public String getCommandName() + { + return "pardon-ip"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isLanServer() && super.canCommandSenderUseCommand(sender); + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.unbanip.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length == 1 && args[0].length() > 1) + { + Matcher matcher = CommandBanIp.field_147211_a.matcher(args[0]); + + if (matcher.matches()) + { + MinecraftServer.getServer().getConfigurationManager().getBannedIPs().removeEntry(args[0]); + notifyOperators(sender, this, "commands.unbanip.success", new Object[] {args[0]}); + } + else + { + throw new SyntaxErrorException("commands.unbanip.invalid", new Object[0]); + } + } + else + { + throw new WrongUsageException("commands.unbanip.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getKeys()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPardonPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPardonPlayer.java new file mode 100644 index 0000000..ef317e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPardonPlayer.java @@ -0,0 +1,61 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandPardonPlayer extends CommandBase +{ + public String getCommandName() + { + return "pardon"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.unban.usage"; + } + + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isLanServer() && super.canCommandSenderUseCommand(sender); + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length == 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.getConfigurationManager().getBannedPlayers().isUsernameBanned(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.unban.failed", new Object[] {args[0]}); + } + else + { + minecraftserver.getConfigurationManager().getBannedPlayers().removeEntry(gameprofile); + notifyOperators(sender, this, "commands.unban.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.unban.usage", new Object[0]); + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getKeys()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPublishLocalServer.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPublishLocalServer.java new file mode 100644 index 0000000..f96c47f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandPublishLocalServer.java @@ -0,0 +1,34 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldSettings; + +public class CommandPublishLocalServer extends CommandBase +{ + public String getCommandName() + { + return "publish"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.publish.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + String s = MinecraftServer.getServer().shareToLAN(WorldSettings.GameType.SURVIVAL, false); + + if (s != null) + { + notifyOperators(sender, this, "commands.publish.started", new Object[] {s}); + } + else + { + notifyOperators(sender, this, "commands.publish.failed", new Object[0]); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveAll.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveAll.java new file mode 100644 index 0000000..83ddb52 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveAll.java @@ -0,0 +1,75 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldServer; + +public class CommandSaveAll extends CommandBase +{ + public String getCommandName() + { + return "save-all"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.save.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + sender.addChatMessage(new ChatComponentTranslation("commands.save.start", new Object[0])); + + if (minecraftserver.getConfigurationManager() != null) + { + minecraftserver.getConfigurationManager().saveAllPlayerData(); + } + + try + { + for (int i = 0; i < minecraftserver.worldServers.length; ++i) + { + if (minecraftserver.worldServers[i] != null) + { + WorldServer worldserver = minecraftserver.worldServers[i]; + boolean flag = worldserver.disableLevelSaving; + worldserver.disableLevelSaving = false; + worldserver.saveAllChunks(true, (IProgressUpdate)null); + worldserver.disableLevelSaving = flag; + } + } + + if (args.length > 0 && "flush".equals(args[0])) + { + sender.addChatMessage(new ChatComponentTranslation("commands.save.flushStart", new Object[0])); + + for (int j = 0; j < minecraftserver.worldServers.length; ++j) + { + if (minecraftserver.worldServers[j] != null) + { + WorldServer worldserver1 = minecraftserver.worldServers[j]; + boolean flag1 = worldserver1.disableLevelSaving; + worldserver1.disableLevelSaving = false; + worldserver1.saveChunkData(); + worldserver1.disableLevelSaving = flag1; + } + } + + sender.addChatMessage(new ChatComponentTranslation("commands.save.flushEnd", new Object[0])); + } + } + catch (MinecraftException minecraftexception) + { + notifyOperators(sender, this, "commands.save.failed", new Object[] {minecraftexception.getMessage()}); + return; + } + + notifyOperators(sender, this, "commands.save.success", new Object[0]); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveOff.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveOff.java new file mode 100644 index 0000000..82db8f3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveOff.java @@ -0,0 +1,49 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandSaveOff extends CommandBase +{ + public String getCommandName() + { + return "save-off"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.save-off.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + boolean flag = false; + + for (int i = 0; i < minecraftserver.worldServers.length; ++i) + { + if (minecraftserver.worldServers[i] != null) + { + WorldServer worldserver = minecraftserver.worldServers[i]; + + if (!worldserver.disableLevelSaving) + { + worldserver.disableLevelSaving = true; + flag = true; + } + } + } + + if (flag) + { + notifyOperators(sender, this, "commands.save.disabled", new Object[0]); + } + else + { + throw new CommandException("commands.save-off.alreadyOff", new Object[0]); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveOn.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveOn.java new file mode 100644 index 0000000..aece596 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSaveOn.java @@ -0,0 +1,49 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandSaveOn extends CommandBase +{ + public String getCommandName() + { + return "save-on"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.save-on.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + boolean flag = false; + + for (int i = 0; i < minecraftserver.worldServers.length; ++i) + { + if (minecraftserver.worldServers[i] != null) + { + WorldServer worldserver = minecraftserver.worldServers[i]; + + if (worldserver.disableLevelSaving) + { + worldserver.disableLevelSaving = false; + flag = true; + } + } + } + + if (flag) + { + notifyOperators(sender, this, "commands.save.enabled", new Object[0]); + } + else + { + throw new CommandException("commands.save-on.alreadyOn", new Object[0]); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandScoreboard.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandScoreboard.java new file mode 100644 index 0000000..e339073 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandScoreboard.java @@ -0,0 +1,1339 @@ +package net.minecraft.command.server; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; + +public class CommandScoreboard extends CommandBase +{ + public String getCommandName() + { + return "scoreboard"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.scoreboard.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (!this.func_175780_b(sender, args)) + { + if (args.length < 1) + { + throw new WrongUsageException("commands.scoreboard.usage", new Object[0]); + } + else + { + if (args[0].equalsIgnoreCase("objectives")) + { + if (args.length == 1) + { + throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); + } + + if (args[1].equalsIgnoreCase("list")) + { + this.listObjectives(sender); + } + else if (args[1].equalsIgnoreCase("add")) + { + if (args.length < 4) + { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); + } + + this.addObjective(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.scoreboard.objectives.remove.usage", new Object[0]); + } + + this.removeObjective(sender, args[2]); + } + else + { + if (!args[1].equalsIgnoreCase("setdisplay")) + { + throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); + } + + if (args.length != 3 && args.length != 4) + { + throw new WrongUsageException("commands.scoreboard.objectives.setdisplay.usage", new Object[0]); + } + + this.setObjectiveDisplay(sender, args, 2); + } + } + else if (args[0].equalsIgnoreCase("players")) + { + if (args.length == 1) + { + throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); + } + + if (args[1].equalsIgnoreCase("list")) + { + if (args.length > 3) + { + throw new WrongUsageException("commands.scoreboard.players.list.usage", new Object[0]); + } + + this.listPlayers(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("add")) + { + if (args.length < 5) + { + throw new WrongUsageException("commands.scoreboard.players.add.usage", new Object[0]); + } + + this.setPlayer(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length < 5) + { + throw new WrongUsageException("commands.scoreboard.players.remove.usage", new Object[0]); + } + + this.setPlayer(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("set")) + { + if (args.length < 5) + { + throw new WrongUsageException("commands.scoreboard.players.set.usage", new Object[0]); + } + + this.setPlayer(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("reset")) + { + if (args.length != 3 && args.length != 4) + { + throw new WrongUsageException("commands.scoreboard.players.reset.usage", new Object[0]); + } + + this.resetPlayers(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("enable")) + { + if (args.length != 4) + { + throw new WrongUsageException("commands.scoreboard.players.enable.usage", new Object[0]); + } + + this.func_175779_n(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("test")) + { + if (args.length != 5 && args.length != 6) + { + throw new WrongUsageException("commands.scoreboard.players.test.usage", new Object[0]); + } + + this.func_175781_o(sender, args, 2); + } + else + { + if (!args[1].equalsIgnoreCase("operation")) + { + throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); + } + + if (args.length != 7) + { + throw new WrongUsageException("commands.scoreboard.players.operation.usage", new Object[0]); + } + + this.func_175778_p(sender, args, 2); + } + } + else + { + if (!args[0].equalsIgnoreCase("teams")) + { + throw new WrongUsageException("commands.scoreboard.usage", new Object[0]); + } + + if (args.length == 1) + { + throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); + } + + if (args[1].equalsIgnoreCase("list")) + { + if (args.length > 3) + { + throw new WrongUsageException("commands.scoreboard.teams.list.usage", new Object[0]); + } + + this.listTeams(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("add")) + { + if (args.length < 3) + { + throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); + } + + this.addTeam(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.scoreboard.teams.remove.usage", new Object[0]); + } + + this.removeTeam(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("empty")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.scoreboard.teams.empty.usage", new Object[0]); + } + + this.emptyTeam(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("join")) + { + if (args.length < 4 && (args.length != 3 || !(sender instanceof EntityPlayer))) + { + throw new WrongUsageException("commands.scoreboard.teams.join.usage", new Object[0]); + } + + this.joinTeam(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("leave")) + { + if (args.length < 3 && !(sender instanceof EntityPlayer)) + { + throw new WrongUsageException("commands.scoreboard.teams.leave.usage", new Object[0]); + } + + this.leaveTeam(sender, args, 2); + } + else + { + if (!args[1].equalsIgnoreCase("option")) + { + throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); + } + + if (args.length != 4 && args.length != 5) + { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } + + this.setTeamOption(sender, args, 2); + } + } + } + } + } + + private boolean func_175780_b(ICommandSender p_175780_1_, String[] p_175780_2_) throws CommandException + { + int i = -1; + + for (int j = 0; j < p_175780_2_.length; ++j) + { + if (this.isUsernameIndex(p_175780_2_, j) && "*".equals(p_175780_2_[j])) + { + if (i >= 0) + { + throw new CommandException("commands.scoreboard.noMultiWildcard", new Object[0]); + } + + i = j; + } + } + + if (i < 0) + { + return false; + } + else + { + List list1 = Lists.newArrayList(this.getScoreboard().getObjectiveNames()); + String s = p_175780_2_[i]; + List list = Lists.newArrayList(); + + for (String s1 : list1) + { + p_175780_2_[i] = s1; + + try + { + this.processCommand(p_175780_1_, p_175780_2_); + list.add(s1); + } + catch (CommandException commandexception) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(commandexception.getMessage(), commandexception.getErrorObjects()); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + p_175780_1_.addChatMessage(chatcomponenttranslation); + } + } + + p_175780_2_[i] = s; + p_175780_1_.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, list.size()); + + if (list.size() == 0) + { + throw new WrongUsageException("commands.scoreboard.allMatchesFailed", new Object[0]); + } + else + { + return true; + } + } + } + + protected Scoreboard getScoreboard() + { + return MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + } + + protected ScoreObjective getObjective(String name, boolean edit) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(name); + + if (scoreobjective == null) + { + throw new CommandException("commands.scoreboard.objectiveNotFound", new Object[] {name}); + } + else if (edit && scoreobjective.getCriteria().isReadOnly()) + { + throw new CommandException("commands.scoreboard.objectiveReadOnly", new Object[] {name}); + } + else + { + return scoreobjective; + } + } + + protected ScorePlayerTeam getTeam(String name) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + ScorePlayerTeam scoreplayerteam = scoreboard.getTeam(name); + + if (scoreplayerteam == null) + { + throw new CommandException("commands.scoreboard.teamNotFound", new Object[] {name}); + } + else + { + return scoreplayerteam; + } + } + + protected void addObjective(ICommandSender sender, String[] args, int index) throws CommandException + { + String s = args[index++]; + String s1 = args[index++]; + Scoreboard scoreboard = this.getScoreboard(); + IScoreObjectiveCriteria iscoreobjectivecriteria = (IScoreObjectiveCriteria)IScoreObjectiveCriteria.INSTANCES.get(s1); + + if (iscoreobjectivecriteria == null) + { + throw new WrongUsageException("commands.scoreboard.objectives.add.wrongType", new Object[] {s1}); + } + else if (scoreboard.getObjective(s) != null) + { + throw new CommandException("commands.scoreboard.objectives.add.alreadyExists", new Object[] {s}); + } + else if (s.length() > 16) + { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.tooLong", new Object[] {s, Integer.valueOf(16)}); + } + else if (s.length() == 0) + { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); + } + else + { + if (args.length > index) + { + String s2 = getChatComponentFromNthArg(sender, args, index).getUnformattedText(); + + if (s2.length() > 32) + { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.displayTooLong", new Object[] {s2, Integer.valueOf(32)}); + } + + if (s2.length() > 0) + { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria).setDisplayName(s2); + } + else + { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria); + } + } + else + { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria); + } + + notifyOperators(sender, this, "commands.scoreboard.objectives.add.success", new Object[] {s}); + } + } + + protected void addTeam(ICommandSender sender, String[] args, int index) throws CommandException + { + String s = args[index++]; + Scoreboard scoreboard = this.getScoreboard(); + + if (scoreboard.getTeam(s) != null) + { + throw new CommandException("commands.scoreboard.teams.add.alreadyExists", new Object[] {s}); + } + else if (s.length() > 16) + { + throw new SyntaxErrorException("commands.scoreboard.teams.add.tooLong", new Object[] {s, Integer.valueOf(16)}); + } + else if (s.length() == 0) + { + throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); + } + else + { + if (args.length > index) + { + String s1 = getChatComponentFromNthArg(sender, args, index).getUnformattedText(); + + if (s1.length() > 32) + { + throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", new Object[] {s1, Integer.valueOf(32)}); + } + + if (s1.length() > 0) + { + scoreboard.createTeam(s).setTeamName(s1); + } + else + { + scoreboard.createTeam(s); + } + } + else + { + scoreboard.createTeam(s); + } + + notifyOperators(sender, this, "commands.scoreboard.teams.add.success", new Object[] {s}); + } + } + + protected void setTeamOption(ICommandSender sender, String[] args, int index) throws CommandException + { + ScorePlayerTeam scoreplayerteam = this.getTeam(args[index++]); + + if (scoreplayerteam != null) + { + String s = args[index++].toLowerCase(); + + if (!s.equalsIgnoreCase("color") && !s.equalsIgnoreCase("friendlyfire") && !s.equalsIgnoreCase("seeFriendlyInvisibles") && !s.equalsIgnoreCase("nametagVisibility") && !s.equalsIgnoreCase("deathMessageVisibility")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } + else if (args.length == 4) + { + if (s.equalsIgnoreCase("color")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false))}); + } + else if (!s.equalsIgnoreCase("friendlyfire") && !s.equalsIgnoreCase("seeFriendlyInvisibles")) + { + if (!s.equalsIgnoreCase("nametagVisibility") && !s.equalsIgnoreCase("deathMessageVisibility")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } + else + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceString(Team.EnumVisible.func_178825_a())}); + } + } + else + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(Arrays.asList(new String[]{"true", "false"}))}); + } + } + else + { + String s1 = args[index]; + + if (s.equalsIgnoreCase("color")) + { + EnumChatFormatting enumchatformatting = EnumChatFormatting.getValueByName(s1); + + if (enumchatformatting == null || enumchatformatting.isFancyStyling()) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false))}); + } + + scoreplayerteam.setChatFormat(enumchatformatting); + scoreplayerteam.setNamePrefix(enumchatformatting.toString()); + scoreplayerteam.setNameSuffix(EnumChatFormatting.RESET.toString()); + } + else if (s.equalsIgnoreCase("friendlyfire")) + { + if (!s1.equalsIgnoreCase("true") && !s1.equalsIgnoreCase("false")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(Arrays.asList(new String[]{"true", "false"}))}); + } + + scoreplayerteam.setAllowFriendlyFire(s1.equalsIgnoreCase("true")); + } + else if (s.equalsIgnoreCase("seeFriendlyInvisibles")) + { + if (!s1.equalsIgnoreCase("true") && !s1.equalsIgnoreCase("false")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(Arrays.asList(new String[]{"true", "false"}))}); + } + + scoreplayerteam.setSeeFriendlyInvisiblesEnabled(s1.equalsIgnoreCase("true")); + } + else if (s.equalsIgnoreCase("nametagVisibility")) + { + Team.EnumVisible team$enumvisible = Team.EnumVisible.func_178824_a(s1); + + if (team$enumvisible == null) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceString(Team.EnumVisible.func_178825_a())}); + } + + scoreplayerteam.setNameTagVisibility(team$enumvisible); + } + else if (s.equalsIgnoreCase("deathMessageVisibility")) + { + Team.EnumVisible team$enumvisible1 = Team.EnumVisible.func_178824_a(s1); + + if (team$enumvisible1 == null) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceString(Team.EnumVisible.func_178825_a())}); + } + + scoreplayerteam.setDeathMessageVisibility(team$enumvisible1); + } + + notifyOperators(sender, this, "commands.scoreboard.teams.option.success", new Object[] {s, scoreplayerteam.getRegisteredName(), s1}); + } + } + } + + protected void removeTeam(ICommandSender p_147194_1_, String[] p_147194_2_, int p_147194_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + ScorePlayerTeam scoreplayerteam = this.getTeam(p_147194_2_[p_147194_3_]); + + if (scoreplayerteam != null) + { + scoreboard.removeTeam(scoreplayerteam); + notifyOperators(p_147194_1_, this, "commands.scoreboard.teams.remove.success", new Object[] {scoreplayerteam.getRegisteredName()}); + } + } + + protected void listTeams(ICommandSender p_147186_1_, String[] p_147186_2_, int p_147186_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + + if (p_147186_2_.length > p_147186_3_) + { + ScorePlayerTeam scoreplayerteam = this.getTeam(p_147186_2_[p_147186_3_]); + + if (scoreplayerteam == null) + { + return; + } + + Collection collection = scoreplayerteam.getMembershipCollection(); + p_147186_1_.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection.size()); + + if (collection.size() <= 0) + { + throw new CommandException("commands.scoreboard.teams.list.player.empty", new Object[] {scoreplayerteam.getRegisteredName()}); + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.teams.list.player.count", new Object[] {Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName()}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147186_1_.addChatMessage(chatcomponenttranslation); + p_147186_1_.addChatMessage(new ChatComponentText(joinNiceString(collection.toArray()))); + } + else + { + Collection collection1 = scoreboard.getTeams(); + p_147186_1_.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection1.size()); + + if (collection1.size() <= 0) + { + throw new CommandException("commands.scoreboard.teams.list.empty", new Object[0]); + } + + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.scoreboard.teams.list.count", new Object[] {Integer.valueOf(collection1.size())}); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147186_1_.addChatMessage(chatcomponenttranslation1); + + for (ScorePlayerTeam scoreplayerteam1 : collection1) + { + p_147186_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.teams.list.entry", new Object[] {scoreplayerteam1.getRegisteredName(), scoreplayerteam1.getTeamName(), Integer.valueOf(scoreplayerteam1.getMembershipCollection().size())})); + } + } + } + + protected void joinTeam(ICommandSender p_147190_1_, String[] p_147190_2_, int p_147190_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + String s = p_147190_2_[p_147190_3_++]; + Set set = Sets.newHashSet(); + Set set1 = Sets.newHashSet(); + + if (p_147190_1_ instanceof EntityPlayer && p_147190_3_ == p_147190_2_.length) + { + String s4 = getCommandSenderAsPlayer(p_147190_1_).getName(); + + if (scoreboard.addPlayerToTeam(s4, s)) + { + set.add(s4); + } + else + { + set1.add(s4); + } + } + else + { + while (p_147190_3_ < p_147190_2_.length) + { + String s1 = p_147190_2_[p_147190_3_++]; + + if (s1.startsWith("@")) + { + for (Entity entity : func_175763_c(p_147190_1_, s1)) + { + String s3 = getEntityName(p_147190_1_, entity.getUniqueID().toString()); + + if (scoreboard.addPlayerToTeam(s3, s)) + { + set.add(s3); + } + else + { + set1.add(s3); + } + } + } + else + { + String s2 = getEntityName(p_147190_1_, s1); + + if (scoreboard.addPlayerToTeam(s2, s)) + { + set.add(s2); + } + else + { + set1.add(s2); + } + } + } + } + + if (!set.isEmpty()) + { + p_147190_1_.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, set.size()); + notifyOperators(p_147190_1_, this, "commands.scoreboard.teams.join.success", new Object[] {Integer.valueOf(set.size()), s, joinNiceString(set.toArray(new String[set.size()]))}); + } + + if (!set1.isEmpty()) + { + throw new CommandException("commands.scoreboard.teams.join.failure", new Object[] {Integer.valueOf(set1.size()), s, joinNiceString(set1.toArray(new String[set1.size()]))}); + } + } + + protected void leaveTeam(ICommandSender p_147199_1_, String[] p_147199_2_, int p_147199_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + Set set = Sets.newHashSet(); + Set set1 = Sets.newHashSet(); + + if (p_147199_1_ instanceof EntityPlayer && p_147199_3_ == p_147199_2_.length) + { + String s3 = getCommandSenderAsPlayer(p_147199_1_).getName(); + + if (scoreboard.removePlayerFromTeams(s3)) + { + set.add(s3); + } + else + { + set1.add(s3); + } + } + else + { + while (p_147199_3_ < p_147199_2_.length) + { + String s = p_147199_2_[p_147199_3_++]; + + if (s.startsWith("@")) + { + for (Entity entity : func_175763_c(p_147199_1_, s)) + { + String s2 = getEntityName(p_147199_1_, entity.getUniqueID().toString()); + + if (scoreboard.removePlayerFromTeams(s2)) + { + set.add(s2); + } + else + { + set1.add(s2); + } + } + } + else + { + String s1 = getEntityName(p_147199_1_, s); + + if (scoreboard.removePlayerFromTeams(s1)) + { + set.add(s1); + } + else + { + set1.add(s1); + } + } + } + } + + if (!set.isEmpty()) + { + p_147199_1_.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, set.size()); + notifyOperators(p_147199_1_, this, "commands.scoreboard.teams.leave.success", new Object[] {Integer.valueOf(set.size()), joinNiceString(set.toArray(new String[set.size()]))}); + } + + if (!set1.isEmpty()) + { + throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[] {Integer.valueOf(set1.size()), joinNiceString(set1.toArray(new String[set1.size()]))}); + } + } + + protected void emptyTeam(ICommandSender p_147188_1_, String[] p_147188_2_, int p_147188_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + ScorePlayerTeam scoreplayerteam = this.getTeam(p_147188_2_[p_147188_3_]); + + if (scoreplayerteam != null) + { + Collection collection = Lists.newArrayList(scoreplayerteam.getMembershipCollection()); + p_147188_1_.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, collection.size()); + + if (collection.isEmpty()) + { + throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[] {scoreplayerteam.getRegisteredName()}); + } + else + { + for (String s : collection) + { + scoreboard.removePlayerFromTeam(s, scoreplayerteam); + } + + notifyOperators(p_147188_1_, this, "commands.scoreboard.teams.empty.success", new Object[] {Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName()}); + } + } + } + + protected void removeObjective(ICommandSender p_147191_1_, String p_147191_2_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + ScoreObjective scoreobjective = this.getObjective(p_147191_2_, false); + scoreboard.removeObjective(scoreobjective); + notifyOperators(p_147191_1_, this, "commands.scoreboard.objectives.remove.success", new Object[] {p_147191_2_}); + } + + protected void listObjectives(ICommandSender p_147196_1_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + Collection collection = scoreboard.getScoreObjectives(); + + if (collection.size() <= 0) + { + throw new CommandException("commands.scoreboard.objectives.list.empty", new Object[0]); + } + else + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.objectives.list.count", new Object[] {Integer.valueOf(collection.size())}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147196_1_.addChatMessage(chatcomponenttranslation); + + for (ScoreObjective scoreobjective : collection) + { + p_147196_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.objectives.list.entry", new Object[] {scoreobjective.getName(), scoreobjective.getDisplayName(), scoreobjective.getCriteria().getName()})); + } + } + } + + protected void setObjectiveDisplay(ICommandSender p_147198_1_, String[] p_147198_2_, int p_147198_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + String s = p_147198_2_[p_147198_3_++]; + int i = Scoreboard.getObjectiveDisplaySlotNumber(s); + ScoreObjective scoreobjective = null; + + if (p_147198_2_.length == 4) + { + scoreobjective = this.getObjective(p_147198_2_[p_147198_3_], false); + } + + if (i < 0) + { + throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", new Object[] {s}); + } + else + { + scoreboard.setObjectiveInDisplaySlot(i, scoreobjective); + + if (scoreobjective != null) + { + notifyOperators(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successSet", new Object[] {Scoreboard.getObjectiveDisplaySlot(i), scoreobjective.getName()}); + } + else + { + notifyOperators(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successCleared", new Object[] {Scoreboard.getObjectiveDisplaySlot(i)}); + } + } + } + + protected void listPlayers(ICommandSender p_147195_1_, String[] p_147195_2_, int p_147195_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + + if (p_147195_2_.length > p_147195_3_) + { + String s = getEntityName(p_147195_1_, p_147195_2_[p_147195_3_]); + Map map = scoreboard.getObjectivesForEntity(s); + p_147195_1_.setCommandStat(CommandResultStats.Type.QUERY_RESULT, map.size()); + + if (map.size() <= 0) + { + throw new CommandException("commands.scoreboard.players.list.player.empty", new Object[] {s}); + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.players.list.player.count", new Object[] {Integer.valueOf(map.size()), s}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147195_1_.addChatMessage(chatcomponenttranslation); + + for (Score score : map.values()) + { + p_147195_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.players.list.player.entry", new Object[] {Integer.valueOf(score.getScorePoints()), score.getObjective().getDisplayName(), score.getObjective().getName()})); + } + } + else + { + Collection collection = scoreboard.getObjectiveNames(); + p_147195_1_.setCommandStat(CommandResultStats.Type.QUERY_RESULT, collection.size()); + + if (collection.size() <= 0) + { + throw new CommandException("commands.scoreboard.players.list.empty", new Object[0]); + } + + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.scoreboard.players.list.count", new Object[] {Integer.valueOf(collection.size())}); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147195_1_.addChatMessage(chatcomponenttranslation1); + p_147195_1_.addChatMessage(new ChatComponentText(joinNiceString(collection.toArray()))); + } + } + + protected void setPlayer(ICommandSender p_147197_1_, String[] p_147197_2_, int p_147197_3_) throws CommandException + { + String s = p_147197_2_[p_147197_3_ - 1]; + int i = p_147197_3_; + String s1 = getEntityName(p_147197_1_, p_147197_2_[p_147197_3_++]); + + if (s1.length() > 40) + { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s1, Integer.valueOf(40)}); + } + else + { + ScoreObjective scoreobjective = this.getObjective(p_147197_2_[p_147197_3_++], true); + int j = s.equalsIgnoreCase("set") ? parseInt(p_147197_2_[p_147197_3_++]) : parseInt(p_147197_2_[p_147197_3_++], 0); + + if (p_147197_2_.length > p_147197_3_) + { + Entity entity = getEntity(p_147197_1_, p_147197_2_[i]); + + try + { + NBTTagCompound nbttagcompound = JsonToNBT.getTagFromJson(buildString(p_147197_2_, p_147197_3_)); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entity.writeToNBT(nbttagcompound1); + + if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true)) + { + throw new CommandException("commands.scoreboard.players.set.tagMismatch", new Object[] {s1}); + } + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.scoreboard.players.set.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + Scoreboard scoreboard = this.getScoreboard(); + Score score = scoreboard.getValueFromObjective(s1, scoreobjective); + + if (s.equalsIgnoreCase("set")) + { + score.setScorePoints(j); + } + else if (s.equalsIgnoreCase("add")) + { + score.increseScore(j); + } + else + { + score.decreaseScore(j); + } + + notifyOperators(p_147197_1_, this, "commands.scoreboard.players.set.success", new Object[] {scoreobjective.getName(), s1, Integer.valueOf(score.getScorePoints())}); + } + } + + protected void resetPlayers(ICommandSender p_147187_1_, String[] p_147187_2_, int p_147187_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + String s = getEntityName(p_147187_1_, p_147187_2_[p_147187_3_++]); + + if (p_147187_2_.length > p_147187_3_) + { + ScoreObjective scoreobjective = this.getObjective(p_147187_2_[p_147187_3_++], false); + scoreboard.removeObjectiveFromEntity(s, scoreobjective); + notifyOperators(p_147187_1_, this, "commands.scoreboard.players.resetscore.success", new Object[] {scoreobjective.getName(), s}); + } + else + { + scoreboard.removeObjectiveFromEntity(s, (ScoreObjective)null); + notifyOperators(p_147187_1_, this, "commands.scoreboard.players.reset.success", new Object[] {s}); + } + } + + protected void func_175779_n(ICommandSender p_175779_1_, String[] p_175779_2_, int p_175779_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + String s = getPlayerName(p_175779_1_, p_175779_2_[p_175779_3_++]); + + if (s.length() > 40) + { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)}); + } + else + { + ScoreObjective scoreobjective = this.getObjective(p_175779_2_[p_175779_3_], false); + + if (scoreobjective.getCriteria() != IScoreObjectiveCriteria.TRIGGER) + { + throw new CommandException("commands.scoreboard.players.enable.noTrigger", new Object[] {scoreobjective.getName()}); + } + else + { + Score score = scoreboard.getValueFromObjective(s, scoreobjective); + score.setLocked(false); + notifyOperators(p_175779_1_, this, "commands.scoreboard.players.enable.success", new Object[] {scoreobjective.getName(), s}); + } + } + } + + protected void func_175781_o(ICommandSender p_175781_1_, String[] p_175781_2_, int p_175781_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + String s = getEntityName(p_175781_1_, p_175781_2_[p_175781_3_++]); + + if (s.length() > 40) + { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)}); + } + else + { + ScoreObjective scoreobjective = this.getObjective(p_175781_2_[p_175781_3_++], false); + + if (!scoreboard.entityHasObjective(s, scoreobjective)) + { + throw new CommandException("commands.scoreboard.players.test.notFound", new Object[] {scoreobjective.getName(), s}); + } + else + { + int i = p_175781_2_[p_175781_3_].equals("*") ? Integer.MIN_VALUE : parseInt(p_175781_2_[p_175781_3_]); + ++p_175781_3_; + int j = p_175781_3_ < p_175781_2_.length && !p_175781_2_[p_175781_3_].equals("*") ? parseInt(p_175781_2_[p_175781_3_], i) : Integer.MAX_VALUE; + Score score = scoreboard.getValueFromObjective(s, scoreobjective); + + if (score.getScorePoints() >= i && score.getScorePoints() <= j) + { + notifyOperators(p_175781_1_, this, "commands.scoreboard.players.test.success", new Object[] {Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j)}); + } + else + { + throw new CommandException("commands.scoreboard.players.test.failed", new Object[] {Integer.valueOf(score.getScorePoints()), Integer.valueOf(i), Integer.valueOf(j)}); + } + } + } + } + + protected void func_175778_p(ICommandSender p_175778_1_, String[] p_175778_2_, int p_175778_3_) throws CommandException + { + Scoreboard scoreboard = this.getScoreboard(); + String s = getEntityName(p_175778_1_, p_175778_2_[p_175778_3_++]); + ScoreObjective scoreobjective = this.getObjective(p_175778_2_[p_175778_3_++], true); + String s1 = p_175778_2_[p_175778_3_++]; + String s2 = getEntityName(p_175778_1_, p_175778_2_[p_175778_3_++]); + ScoreObjective scoreobjective1 = this.getObjective(p_175778_2_[p_175778_3_], false); + + if (s.length() > 40) + { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s, Integer.valueOf(40)}); + } + else if (s2.length() > 40) + { + throw new SyntaxErrorException("commands.scoreboard.players.name.tooLong", new Object[] {s2, Integer.valueOf(40)}); + } + else + { + Score score = scoreboard.getValueFromObjective(s, scoreobjective); + + if (!scoreboard.entityHasObjective(s2, scoreobjective1)) + { + throw new CommandException("commands.scoreboard.players.operation.notFound", new Object[] {scoreobjective1.getName(), s2}); + } + else + { + Score score1 = scoreboard.getValueFromObjective(s2, scoreobjective1); + + if (s1.equals("+=")) + { + score.setScorePoints(score.getScorePoints() + score1.getScorePoints()); + } + else if (s1.equals("-=")) + { + score.setScorePoints(score.getScorePoints() - score1.getScorePoints()); + } + else if (s1.equals("*=")) + { + score.setScorePoints(score.getScorePoints() * score1.getScorePoints()); + } + else if (s1.equals("/=")) + { + if (score1.getScorePoints() != 0) + { + score.setScorePoints(score.getScorePoints() / score1.getScorePoints()); + } + } + else if (s1.equals("%=")) + { + if (score1.getScorePoints() != 0) + { + score.setScorePoints(score.getScorePoints() % score1.getScorePoints()); + } + } + else if (s1.equals("=")) + { + score.setScorePoints(score1.getScorePoints()); + } + else if (s1.equals("<")) + { + score.setScorePoints(Math.min(score.getScorePoints(), score1.getScorePoints())); + } + else if (s1.equals(">")) + { + score.setScorePoints(Math.max(score.getScorePoints(), score1.getScorePoints())); + } + else + { + if (!s1.equals("><")) + { + throw new CommandException("commands.scoreboard.players.operation.invalidOperation", new Object[] {s1}); + } + + int i = score.getScorePoints(); + score.setScorePoints(score1.getScorePoints()); + score1.setScorePoints(i); + } + + notifyOperators(p_175778_1_, this, "commands.scoreboard.players.operation.success", new Object[0]); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + if (args.length == 1) + { + return getListOfStringsMatchingLastWord(args, new String[] {"objectives", "players", "teams"}); + } + else + { + if (args[0].equalsIgnoreCase("objectives")) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, new String[] {"list", "add", "remove", "setdisplay"}); + } + + if (args[1].equalsIgnoreCase("add")) + { + if (args.length == 4) + { + Set set = IScoreObjectiveCriteria.INSTANCES.keySet(); + return getListOfStringsMatchingLastWord(args, set); + } + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, this.func_147184_a(false)); + } + } + else if (args[1].equalsIgnoreCase("setdisplay")) + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, Scoreboard.getDisplaySlotStrings()); + } + + if (args.length == 4) + { + return getListOfStringsMatchingLastWord(args, this.func_147184_a(false)); + } + } + } + else if (args[0].equalsIgnoreCase("players")) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, new String[] {"set", "add", "remove", "reset", "list", "enable", "test", "operation"}); + } + + if (!args[1].equalsIgnoreCase("set") && !args[1].equalsIgnoreCase("add") && !args[1].equalsIgnoreCase("remove") && !args[1].equalsIgnoreCase("reset")) + { + if (args[1].equalsIgnoreCase("enable")) + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + if (args.length == 4) + { + return getListOfStringsMatchingLastWord(args, this.func_175782_e()); + } + } + else if (!args[1].equalsIgnoreCase("list") && !args[1].equalsIgnoreCase("test")) + { + if (args[1].equalsIgnoreCase("operation")) + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, this.getScoreboard().getObjectiveNames()); + } + + if (args.length == 4) + { + return getListOfStringsMatchingLastWord(args, this.func_147184_a(true)); + } + + if (args.length == 5) + { + return getListOfStringsMatchingLastWord(args, new String[] {"+=", "-=", "*=", "/=", "%=", "=", "<", ">", "><"}); + } + + if (args.length == 6) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + if (args.length == 7) + { + return getListOfStringsMatchingLastWord(args, this.func_147184_a(false)); + } + } + } + else + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, this.getScoreboard().getObjectiveNames()); + } + + if (args.length == 4 && args[1].equalsIgnoreCase("test")) + { + return getListOfStringsMatchingLastWord(args, this.func_147184_a(false)); + } + } + } + else + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + if (args.length == 4) + { + return getListOfStringsMatchingLastWord(args, this.func_147184_a(true)); + } + } + } + else if (args[0].equalsIgnoreCase("teams")) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, new String[] {"add", "remove", "join", "leave", "empty", "list", "option"}); + } + + if (args[1].equalsIgnoreCase("join")) + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, this.getScoreboard().getTeamNames()); + } + + if (args.length >= 4) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + } + else + { + if (args[1].equalsIgnoreCase("leave")) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + if (!args[1].equalsIgnoreCase("empty") && !args[1].equalsIgnoreCase("list") && !args[1].equalsIgnoreCase("remove")) + { + if (args[1].equalsIgnoreCase("option")) + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, this.getScoreboard().getTeamNames()); + } + + if (args.length == 4) + { + return getListOfStringsMatchingLastWord(args, new String[] {"color", "friendlyfire", "seeFriendlyInvisibles", "nametagVisibility", "deathMessageVisibility"}); + } + + if (args.length == 5) + { + if (args[3].equalsIgnoreCase("color")) + { + return getListOfStringsMatchingLastWord(args, EnumChatFormatting.getValidValues(true, false)); + } + + if (args[3].equalsIgnoreCase("nametagVisibility") || args[3].equalsIgnoreCase("deathMessageVisibility")) + { + return getListOfStringsMatchingLastWord(args, Team.EnumVisible.func_178825_a()); + } + + if (args[3].equalsIgnoreCase("friendlyfire") || args[3].equalsIgnoreCase("seeFriendlyInvisibles")) + { + return getListOfStringsMatchingLastWord(args, new String[] {"true", "false"}); + } + } + } + } + else if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, this.getScoreboard().getTeamNames()); + } + } + } + + return null; + } + } + + protected List func_147184_a(boolean p_147184_1_) + { + Collection collection = this.getScoreboard().getScoreObjectives(); + List list = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : collection) + { + if (!p_147184_1_ || !scoreobjective.getCriteria().isReadOnly()) + { + list.add(scoreobjective.getName()); + } + } + + return list; + } + + protected List func_175782_e() + { + Collection collection = this.getScoreboard().getScoreObjectives(); + List list = Lists.newArrayList(); + + for (ScoreObjective scoreobjective : collection) + { + if (scoreobjective.getCriteria() == IScoreObjectiveCriteria.TRIGGER) + { + list.add(scoreobjective.getName()); + } + } + + return list; + } + + public boolean isUsernameIndex(String[] args, int index) + { + return !args[0].equalsIgnoreCase("players") ? (args[0].equalsIgnoreCase("teams") ? index == 2 : false) : (args.length > 1 && args[1].equalsIgnoreCase("operation") ? index == 2 || index == 5 : index == 2); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSetBlock.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSetBlock.java new file mode 100644 index 0000000..ba44088 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSetBlock.java @@ -0,0 +1,144 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class CommandSetBlock extends CommandBase +{ + public String getCommandName() + { + return "setblock"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.setblock.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 4) + { + throw new WrongUsageException("commands.setblock.usage", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(sender, args, 0, false); + Block block = CommandBase.getBlockByText(sender, args[3]); + int i = 0; + + if (args.length >= 5) + { + i = parseInt(args[4], 0, 15); + } + + World world = sender.getEntityWorld(); + + if (!world.isBlockLoaded(blockpos)) + { + throw new CommandException("commands.setblock.outOfWorld", new Object[0]); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + if (args.length >= 7 && block.hasTileEntity()) + { + String s = getChatComponentFromNthArg(sender, args, 6).getUnformattedText(); + + try + { + nbttagcompound = JsonToNBT.getTagFromJson(s); + flag = true; + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.setblock.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + if (args.length >= 6) + { + if (args[5].equals("destroy")) + { + world.destroyBlock(blockpos, true); + + if (block == Blocks.air) + { + notifyOperators(sender, this, "commands.setblock.success", new Object[0]); + return; + } + } + else if (args[5].equals("keep") && !world.isAirBlock(blockpos)) + { + throw new CommandException("commands.setblock.noChange", new Object[0]); + } + } + + TileEntity tileentity1 = world.getTileEntity(blockpos); + + if (tileentity1 != null) + { + if (tileentity1 instanceof IInventory) + { + ((IInventory)tileentity1).clear(); + } + + world.setBlockState(blockpos, Blocks.air.getDefaultState(), block == Blocks.air ? 2 : 4); + } + + IBlockState iblockstate = block.getStateFromMeta(i); + + if (!world.setBlockState(blockpos, iblockstate, 2)) + { + throw new CommandException("commands.setblock.noChange", new Object[0]); + } + else + { + if (flag) + { + TileEntity tileentity = world.getTileEntity(blockpos); + + if (tileentity != null) + { + nbttagcompound.setInteger("x", blockpos.getX()); + nbttagcompound.setInteger("y", blockpos.getY()); + nbttagcompound.setInteger("z", blockpos.getZ()); + tileentity.readFromNBT(nbttagcompound); + } + } + + world.notifyNeighborsRespectDebug(blockpos, iblockstate.getBlock()); + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 1); + notifyOperators(sender, this, "commands.setblock.success", new Object[0]); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length > 0 && args.length <= 3 ? func_175771_a(args, 0, pos) : (args.length == 4 ? getListOfStringsMatchingLastWord(args, Block.blockRegistry.getKeys()) : (args.length == 6 ? getListOfStringsMatchingLastWord(args, new String[] {"replace", "destroy", "keep"}): null)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java new file mode 100644 index 0000000..cc73886 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java @@ -0,0 +1,56 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandSetDefaultSpawnpoint extends CommandBase +{ + public String getCommandName() + { + return "setworldspawn"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.setworldspawn.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + BlockPos blockpos; + + if (args.length == 0) + { + blockpos = getCommandSenderAsPlayer(sender).getPosition(); + } + else + { + if (args.length != 3 || sender.getEntityWorld() == null) + { + throw new WrongUsageException("commands.setworldspawn.usage", new Object[0]); + } + + blockpos = parseBlockPos(sender, args, 0, true); + } + + sender.getEntityWorld().setSpawnPoint(blockpos); + MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(new S05PacketSpawnPosition(blockpos)); + notifyOperators(sender, this, "commands.setworldspawn.success", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length > 0 && args.length <= 3 ? func_175771_a(args, 0, pos) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandStop.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandStop.java new file mode 100644 index 0000000..375375b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandStop.java @@ -0,0 +1,29 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; + +public class CommandStop extends CommandBase +{ + public String getCommandName() + { + return "stop"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.stop.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (MinecraftServer.getServer().worldServers != null) + { + notifyOperators(sender, this, "commands.stop.start", new Object[0]); + } + + MinecraftServer.getServer().initiateShutdown(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSummon.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSummon.java new file mode 100644 index 0000000..8dcc238 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandSummon.java @@ -0,0 +1,144 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class CommandSummon extends CommandBase +{ + public String getCommandName() + { + return "summon"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.summon.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.summon.usage", new Object[0]); + } + else + { + String s = args[0]; + BlockPos blockpos = sender.getPosition(); + Vec3 vec3 = sender.getPositionVector(); + double d0 = vec3.xCoord; + double d1 = vec3.yCoord; + double d2 = vec3.zCoord; + + if (args.length >= 4) + { + d0 = parseDouble(d0, args[1], true); + d1 = parseDouble(d1, args[2], false); + d2 = parseDouble(d2, args[3], true); + blockpos = new BlockPos(d0, d1, d2); + } + + World world = sender.getEntityWorld(); + + if (!world.isBlockLoaded(blockpos)) + { + throw new CommandException("commands.summon.outOfWorld", new Object[0]); + } + else if ("LightningBolt".equals(s)) + { + world.addWeatherEffect(new EntityLightningBolt(world, d0, d1, d2)); + notifyOperators(sender, this, "commands.summon.success", new Object[0]); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + if (args.length >= 5) + { + IChatComponent ichatcomponent = getChatComponentFromNthArg(sender, args, 4); + + try + { + nbttagcompound = JsonToNBT.getTagFromJson(ichatcomponent.getUnformattedText()); + flag = true; + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.summon.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + nbttagcompound.setString("id", s); + Entity entity2; + + try + { + entity2 = EntityList.createEntityFromNBT(nbttagcompound, world); + } + catch (RuntimeException var19) + { + throw new CommandException("commands.summon.failed", new Object[0]); + } + + if (entity2 == null) + { + throw new CommandException("commands.summon.failed", new Object[0]); + } + else + { + entity2.setLocationAndAngles(d0, d1, d2, entity2.rotationYaw, entity2.rotationPitch); + + if (!flag && entity2 instanceof EntityLiving) + { + ((EntityLiving)entity2).onInitialSpawn(world.getDifficultyForLocation(new BlockPos(entity2)), (IEntityLivingData)null); + } + + world.spawnEntityInWorld(entity2); + Entity entity = entity2; + + for (NBTTagCompound nbttagcompound1 = nbttagcompound; entity != null && nbttagcompound1.hasKey("Riding", 10); nbttagcompound1 = nbttagcompound1.getCompoundTag("Riding")) + { + Entity entity1 = EntityList.createEntityFromNBT(nbttagcompound1.getCompoundTag("Riding"), world); + + if (entity1 != null) + { + entity1.setLocationAndAngles(d0, d1, d2, entity1.rotationYaw, entity1.rotationPitch); + world.spawnEntityInWorld(entity1); + entity.mountEntity(entity1); + } + + entity = entity1; + } + + notifyOperators(sender, this, "commands.summon.success", new Object[0]); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, EntityList.getEntityNameList()) : (args.length > 1 && args.length <= 4 ? func_175771_a(args, 1, pos) : null); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTeleport.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTeleport.java new file mode 100644 index 0000000..f872801 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTeleport.java @@ -0,0 +1,177 @@ +package net.minecraft.command.server; + +import java.util.EnumSet; +import java.util.List; +import java.util.Set; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; + +public class CommandTeleport extends CommandBase +{ + public String getCommandName() + { + return "tp"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.tp.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.tp.usage", new Object[0]); + } + else + { + int i = 0; + Entity entity; + + if (args.length != 2 && args.length != 4 && args.length != 6) + { + entity = getCommandSenderAsPlayer(sender); + } + else + { + entity = getEntity(sender, args[0]); + i = 1; + } + + if (args.length != 1 && args.length != 2) + { + if (args.length < i + 3) + { + throw new WrongUsageException("commands.tp.usage", new Object[0]); + } + else if (entity.worldObj != null) + { + int lvt_5_2_ = i + 1; + CommandBase.CoordinateArg commandbase$coordinatearg = parseCoordinate(entity.posX, args[i], true); + CommandBase.CoordinateArg commandbase$coordinatearg1 = parseCoordinate(entity.posY, args[lvt_5_2_++], 0, 0, false); + CommandBase.CoordinateArg commandbase$coordinatearg2 = parseCoordinate(entity.posZ, args[lvt_5_2_++], true); + CommandBase.CoordinateArg commandbase$coordinatearg3 = parseCoordinate((double)entity.rotationYaw, args.length > lvt_5_2_ ? args[lvt_5_2_++] : "~", false); + CommandBase.CoordinateArg commandbase$coordinatearg4 = parseCoordinate((double)entity.rotationPitch, args.length > lvt_5_2_ ? args[lvt_5_2_] : "~", false); + + if (entity instanceof EntityPlayerMP) + { + Set set = EnumSet.noneOf(S08PacketPlayerPosLook.EnumFlags.class); + + if (commandbase$coordinatearg.func_179630_c()) + { + set.add(S08PacketPlayerPosLook.EnumFlags.X); + } + + if (commandbase$coordinatearg1.func_179630_c()) + { + set.add(S08PacketPlayerPosLook.EnumFlags.Y); + } + + if (commandbase$coordinatearg2.func_179630_c()) + { + set.add(S08PacketPlayerPosLook.EnumFlags.Z); + } + + if (commandbase$coordinatearg4.func_179630_c()) + { + set.add(S08PacketPlayerPosLook.EnumFlags.X_ROT); + } + + if (commandbase$coordinatearg3.func_179630_c()) + { + set.add(S08PacketPlayerPosLook.EnumFlags.Y_ROT); + } + + float f = (float)commandbase$coordinatearg3.func_179629_b(); + + if (!commandbase$coordinatearg3.func_179630_c()) + { + f = MathHelper.wrapAngleTo180_float(f); + } + + float f1 = (float)commandbase$coordinatearg4.func_179629_b(); + + if (!commandbase$coordinatearg4.func_179630_c()) + { + f1 = MathHelper.wrapAngleTo180_float(f1); + } + + if (f1 > 90.0F || f1 < -90.0F) + { + f1 = MathHelper.wrapAngleTo180_float(180.0F - f1); + f = MathHelper.wrapAngleTo180_float(f + 180.0F); + } + + entity.mountEntity((Entity)null); + ((EntityPlayerMP)entity).playerNetServerHandler.setPlayerLocation(commandbase$coordinatearg.func_179629_b(), commandbase$coordinatearg1.func_179629_b(), commandbase$coordinatearg2.func_179629_b(), f, f1, set); + entity.setRotationYawHead(f); + } + else + { + float f2 = (float)MathHelper.wrapAngleTo180_double(commandbase$coordinatearg3.func_179628_a()); + float f3 = (float)MathHelper.wrapAngleTo180_double(commandbase$coordinatearg4.func_179628_a()); + + if (f3 > 90.0F || f3 < -90.0F) + { + f3 = MathHelper.wrapAngleTo180_float(180.0F - f3); + f2 = MathHelper.wrapAngleTo180_float(f2 + 180.0F); + } + + entity.setLocationAndAngles(commandbase$coordinatearg.func_179628_a(), commandbase$coordinatearg1.func_179628_a(), commandbase$coordinatearg2.func_179628_a(), f2, f3); + entity.setRotationYawHead(f2); + } + + notifyOperators(sender, this, "commands.tp.success.coordinates", new Object[] {entity.getName(), Double.valueOf(commandbase$coordinatearg.func_179628_a()), Double.valueOf(commandbase$coordinatearg1.func_179628_a()), Double.valueOf(commandbase$coordinatearg2.func_179628_a())}); + } + } + else + { + Entity entity1 = getEntity(sender, args[args.length - 1]); + + if (entity1.worldObj != entity.worldObj) + { + throw new CommandException("commands.tp.notSameDimension", new Object[0]); + } + else + { + entity.mountEntity((Entity)null); + + if (entity instanceof EntityPlayerMP) + { + ((EntityPlayerMP)entity).playerNetServerHandler.setPlayerLocation(entity1.posX, entity1.posY, entity1.posZ, entity1.rotationYaw, entity1.rotationPitch); + } + else + { + entity.setLocationAndAngles(entity1.posX, entity1.posY, entity1.posZ, entity1.rotationYaw, entity1.rotationPitch); + } + + notifyOperators(sender, this, "commands.tp.success", new Object[] {entity.getName(), entity1.getName()}); + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length != 1 && args.length != 2 ? null : getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTestFor.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTestFor.java new file mode 100644 index 0000000..01b04b9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTestFor.java @@ -0,0 +1,80 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class CommandTestFor extends CommandBase +{ + public String getCommandName() + { + return "testfor"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.testfor.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.testfor.usage", new Object[0]); + } + else + { + Entity entity = getEntity(sender, args[0]); + NBTTagCompound nbttagcompound = null; + + if (args.length >= 2) + { + try + { + nbttagcompound = JsonToNBT.getTagFromJson(buildString(args, 1)); + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.testfor.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + if (nbttagcompound != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entity.writeToNBT(nbttagcompound1); + + if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true)) + { + throw new CommandException("commands.testfor.failure", new Object[] {entity.getName()}); + } + } + + notifyOperators(sender, this, "commands.testfor.success", new Object[] {entity.getName()}); + } + } + + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTestForBlock.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTestForBlock.java new file mode 100644 index 0000000..8e8168c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandTestForBlock.java @@ -0,0 +1,137 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class CommandTestForBlock extends CommandBase +{ + public String getCommandName() + { + return "testforblock"; + } + + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.testforblock.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 4) + { + throw new WrongUsageException("commands.testforblock.usage", new Object[0]); + } + else + { + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 0); + BlockPos blockpos = parseBlockPos(sender, args, 0, false); + Block block = Block.getBlockFromName(args[3]); + + if (block == null) + { + throw new NumberInvalidException("commands.setblock.notFound", new Object[] {args[3]}); + } + else + { + int i = -1; + + if (args.length >= 5) + { + i = parseInt(args[4], -1, 15); + } + + World world = sender.getEntityWorld(); + + if (!world.isBlockLoaded(blockpos)) + { + throw new CommandException("commands.testforblock.outOfWorld", new Object[0]); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + if (args.length >= 6 && block.hasTileEntity()) + { + String s = getChatComponentFromNthArg(sender, args, 5).getUnformattedText(); + + try + { + nbttagcompound = JsonToNBT.getTagFromJson(s); + flag = true; + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.setblock.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + IBlockState iblockstate = world.getBlockState(blockpos); + Block block1 = iblockstate.getBlock(); + + if (block1 != block) + { + throw new CommandException("commands.testforblock.failed.tile", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()), block1.getLocalizedName(), block.getLocalizedName()}); + } + else + { + if (i > -1) + { + int j = iblockstate.getBlock().getMetaFromState(iblockstate); + + if (j != i) + { + throw new CommandException("commands.testforblock.failed.data", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ()), Integer.valueOf(j), Integer.valueOf(i)}); + } + } + + if (flag) + { + TileEntity tileentity = world.getTileEntity(blockpos); + + if (tileentity == null) + { + throw new CommandException("commands.testforblock.failed.tileEntity", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound1); + + if (!NBTUtil.func_181123_a(nbttagcompound, nbttagcompound1, true)) + { + throw new CommandException("commands.testforblock.failed.nbt", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + } + + sender.setCommandStat(CommandResultStats.Type.AFFECTED_BLOCKS, 1); + notifyOperators(sender, this, "commands.testforblock.success", new Object[] {Integer.valueOf(blockpos.getX()), Integer.valueOf(blockpos.getY()), Integer.valueOf(blockpos.getZ())}); + } + } + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + return args.length > 0 && args.length <= 3 ? func_175771_a(args, 0, pos) : (args.length == 4 ? getListOfStringsMatchingLastWord(args, Block.blockRegistry.getKeys()) : null); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandWhitelist.java b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandWhitelist.java new file mode 100644 index 0000000..9577086 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/command/server/CommandWhitelist.java @@ -0,0 +1,123 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandWhitelist extends CommandBase +{ + public String getCommandName() + { + return "whitelist"; + } + + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.whitelist.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) throws CommandException + { + if (args.length < 1) + { + throw new WrongUsageException("commands.whitelist.usage", new Object[0]); + } + else + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (args[0].equals("on")) + { + minecraftserver.getConfigurationManager().setWhiteListEnabled(true); + notifyOperators(sender, this, "commands.whitelist.enabled", new Object[0]); + } + else if (args[0].equals("off")) + { + minecraftserver.getConfigurationManager().setWhiteListEnabled(false); + notifyOperators(sender, this, "commands.whitelist.disabled", new Object[0]); + } + else if (args[0].equals("list")) + { + sender.addChatMessage(new ChatComponentTranslation("commands.whitelist.list", new Object[] {Integer.valueOf(minecraftserver.getConfigurationManager().getWhitelistedPlayerNames().length), Integer.valueOf(minecraftserver.getConfigurationManager().getAvailablePlayerDat().length)})); + String[] astring = minecraftserver.getConfigurationManager().getWhitelistedPlayerNames(); + sender.addChatMessage(new ChatComponentText(joinNiceString(astring))); + } + else if (args[0].equals("add")) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.whitelist.add.usage", new Object[0]); + } + + GameProfile gameprofile = minecraftserver.getPlayerProfileCache().getGameProfileForUsername(args[1]); + + if (gameprofile == null) + { + throw new CommandException("commands.whitelist.add.failed", new Object[] {args[1]}); + } + + minecraftserver.getConfigurationManager().addWhitelistedPlayer(gameprofile); + notifyOperators(sender, this, "commands.whitelist.add.success", new Object[] {args[1]}); + } + else if (args[0].equals("remove")) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.whitelist.remove.usage", new Object[0]); + } + + GameProfile gameprofile1 = minecraftserver.getConfigurationManager().getWhitelistedPlayers().getBannedProfile(args[1]); + + if (gameprofile1 == null) + { + throw new CommandException("commands.whitelist.remove.failed", new Object[] {args[1]}); + } + + minecraftserver.getConfigurationManager().removePlayerFromWhitelist(gameprofile1); + notifyOperators(sender, this, "commands.whitelist.remove.success", new Object[] {args[1]}); + } + else if (args[0].equals("reload")) + { + minecraftserver.getConfigurationManager().loadWhiteList(); + notifyOperators(sender, this, "commands.whitelist.reloaded", new Object[0]); + } + } + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) + { + if (args.length == 1) + { + return getListOfStringsMatchingLastWord(args, new String[] {"on", "off", "list", "add", "remove", "reload"}); + } + else + { + if (args.length == 2) + { + if (args[0].equals("remove")) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().getWhitelistedPlayerNames()); + } + + if (args[0].equals("add")) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getPlayerProfileCache().getUsernames()); + } + } + + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/crash/CrashReport.java b/Client-1.8.9/src/main/java/net/minecraft/crash/CrashReport.java new file mode 100644 index 0000000..880d1d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/crash/CrashReport.java @@ -0,0 +1,513 @@ +package net.minecraft.crash; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientCrashReport; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.util.ReportedException; +import net.minecraft.world.gen.layer.IntCache; +import net.optifine.CrashReporter; +import net.optifine.http.HttpUtils; +import net.optifine.reflect.Reflector; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.*; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.Callable; + +public class CrashReport +{ + private static final Logger logger = LogManager.getLogger(); + private final String description; + private final Throwable cause; + private final CrashReportCategory theReportCategory = new CrashReportCategory(this, "System Details"); + private final List crashReportSections = Lists.newArrayList(); + private File crashReportFile; + private boolean firstCategoryInCrashReport = true; + private StackTraceElement[] stacktrace = new StackTraceElement[0]; + private boolean reported = false; + + public CrashReport(String descriptionIn, Throwable causeThrowable) + { + this.description = descriptionIn; + this.cause = causeThrowable; + this.populateEnvironment(); + } + + private void populateEnvironment() + { + this.theReportCategory.addCrashSectionCallable("Minecraft Version", new Callable() + { + public String call() + { + return "1.8.9"; + } + }); + this.theReportCategory.addCrashSectionCallable("Operating System", new Callable() + { + public String call() + { + return System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version"); + } + }); + this.theReportCategory.addCrashSectionCallable("Java Version", new Callable() + { + public String call() + { + return System.getProperty("java.version") + ", " + System.getProperty("java.vendor"); + } + }); + this.theReportCategory.addCrashSectionCallable("Java VM Version", new Callable() + { + public String call() + { + return System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor"); + } + }); + this.theReportCategory.addCrashSectionCallable("Memory", new Callable() + { + public String call() + { + Runtime runtime = Runtime.getRuntime(); + long i = runtime.maxMemory(); + long j = runtime.totalMemory(); + long k = runtime.freeMemory(); + long l = i / 1024L / 1024L; + long i1 = j / 1024L / 1024L; + long j1 = k / 1024L / 1024L; + return k + " bytes (" + j1 + " MB) / " + j + " bytes (" + i1 + " MB) up to " + i + " bytes (" + l + " MB)"; + } + }); + this.theReportCategory.addCrashSectionCallable("JVM Flags", new Callable() + { + public String call() + { + RuntimeMXBean runtimemxbean = ManagementFactory.getRuntimeMXBean(); + List list = runtimemxbean.getInputArguments(); + int i = 0; + StringBuilder stringbuilder = new StringBuilder(); + + for (String s : list) + { + if (s.startsWith("-X")) + { + if (i++ > 0) + { + stringbuilder.append(" "); + } + + stringbuilder.append(s); + } + } + + return String.format("%d total; %s", new Object[] {Integer.valueOf(i), stringbuilder.toString()}); + } + }); + this.theReportCategory.addCrashSectionCallable("IntCache", new Callable() + { + public String call() throws Exception + { + return IntCache.getCacheSizes(); + } + }); + + if (Reflector.FMLCommonHandler_enhanceCrashReport.exists()) + { + Object object = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + Reflector.callString(object, Reflector.FMLCommonHandler_enhanceCrashReport, new Object[] {this, this.theReportCategory}); + } + } + + public String getDescription() + { + return this.description; + } + + public Throwable getCrashCause() + { + return this.cause; + } + + public void getSectionsInStringBuilder(StringBuilder builder) + { + if ((this.stacktrace == null || this.stacktrace.length <= 0) && this.crashReportSections.size() > 0) + { + this.stacktrace = (StackTraceElement[])((StackTraceElement[])ArrayUtils.subarray(((CrashReportCategory)this.crashReportSections.get(0)).getStackTrace(), 0, 1)); + } + + if (this.stacktrace != null && this.stacktrace.length > 0) + { + builder.append("-- Head --\n"); + builder.append("Stacktrace:\n"); + + for (StackTraceElement stacktraceelement : this.stacktrace) + { + builder.append("\t").append("at ").append(stacktraceelement.toString()); + builder.append("\n"); + } + + builder.append("\n"); + } + + for (CrashReportCategory crashreportcategory : this.crashReportSections) + { + crashreportcategory.appendToStringBuilder(builder); + builder.append("\n\n"); + } + + this.theReportCategory.appendToStringBuilder(builder); + } + + public String getCauseStackTraceOrString() + { + StringWriter stringwriter = null; + PrintWriter printwriter = null; + Throwable throwable = this.cause; + + if (throwable.getMessage() == null) + { + if (throwable instanceof NullPointerException) + { + throwable = new NullPointerException(this.description); + } + else if (throwable instanceof StackOverflowError) + { + throwable = new StackOverflowError(this.description); + } + else if (throwable instanceof OutOfMemoryError) + { + throwable = new OutOfMemoryError(this.description); + } + + throwable.setStackTrace(this.cause.getStackTrace()); + } + + String s = throwable.toString(); + + try + { + stringwriter = new StringWriter(); + printwriter = new PrintWriter(stringwriter); + throwable.printStackTrace(printwriter); + s = stringwriter.toString(); + } + finally + { + IOUtils.closeQuietly((Writer)stringwriter); + IOUtils.closeQuietly((Writer)printwriter); + } + + return s; + } + + public String getCompleteReport() + { + if (!this.reported) + { + this.reported = true; + CrashReporter.onCrashReport(this, this.theReportCategory); + } + + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append("---- Minecraft Crash Report ----\n"); + Reflector.call(Reflector.BlamingTransformer_onCrash, new Object[] {stringbuilder}); + Reflector.call(Reflector.CoreModManager_onCrash, new Object[] {stringbuilder}); + stringbuilder.append("// "); + stringbuilder.append(getWittyComment()); + stringbuilder.append("\n\n"); + stringbuilder.append("Time: "); + stringbuilder.append((new SimpleDateFormat()).format(new Date())); + stringbuilder.append("\n"); + stringbuilder.append("Description: "); + stringbuilder.append(this.description); + stringbuilder.append("\n\n"); + stringbuilder.append(this.getCauseStackTraceOrString()); + stringbuilder.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n"); + + for (int i = 0; i < 87; ++i) + { + stringbuilder.append("-"); + } + + stringbuilder.append("\n\n"); + this.getSectionsInStringBuilder(stringbuilder); + return stringbuilder.toString(); + } + + public File getFile() + { + return this.crashReportFile; + } + + public boolean saveToFile(File toFile) + { + if (this.crashReportFile != null) + { + return false; + } + else + { + if (toFile.getParentFile() != null) + { + toFile.getParentFile().mkdirs(); + } + + try + { + FileWriter filewriter = new FileWriter(toFile); + filewriter.write(this.getCompleteReport()); + filewriter.close(); + this.crashReportFile = toFile; + return true; + } + catch (Throwable throwable) + { + logger.error("Could not save crash report to " + toFile, throwable); + return false; + } + } + } + + public CrashReportCategory getCategory() + { + return this.theReportCategory; + } + + public CrashReportCategory makeCategory(String name) + { + return this.makeCategoryDepth(name, 1); + } + + public CrashReportCategory makeCategoryDepth(String categoryName, int stacktraceLength) + { + CrashReportCategory crashreportcategory = new CrashReportCategory(this, categoryName); + + if (this.firstCategoryInCrashReport) + { + int i = crashreportcategory.getPrunedStackTrace(stacktraceLength); + StackTraceElement[] astacktraceelement = this.cause.getStackTrace(); + StackTraceElement stacktraceelement = null; + StackTraceElement stacktraceelement1 = null; + int j = astacktraceelement.length - i; + + if (j < 0) + { + System.out.println("Negative index in crash report handler (" + astacktraceelement.length + "/" + i + ")"); + } + + if (astacktraceelement != null && 0 <= j && j < astacktraceelement.length) + { + stacktraceelement = astacktraceelement[j]; + + if (astacktraceelement.length + 1 - i < astacktraceelement.length) + { + stacktraceelement1 = astacktraceelement[astacktraceelement.length + 1 - i]; + } + } + + this.firstCategoryInCrashReport = crashreportcategory.firstTwoElementsOfStackTraceMatch(stacktraceelement, stacktraceelement1); + + if (i > 0 && !this.crashReportSections.isEmpty()) + { + CrashReportCategory crashreportcategory1 = (CrashReportCategory)this.crashReportSections.get(this.crashReportSections.size() - 1); + crashreportcategory1.trimStackTraceEntriesFromBottom(i); + } + else if (astacktraceelement != null && astacktraceelement.length >= i && 0 <= j && j < astacktraceelement.length) + { + this.stacktrace = new StackTraceElement[j]; + System.arraycopy(astacktraceelement, 0, this.stacktrace, 0, this.stacktrace.length); + } + else + { + this.firstCategoryInCrashReport = false; + } + } + + this.crashReportSections.add(crashreportcategory); + return crashreportcategory; + } + + private static String getWittyComment() + { + String[] astring = new String[] {"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!", "But it works on my machine."}; + + try + { + return astring[(int)(System.nanoTime() % (long)astring.length)]; + } + catch (Throwable var2) + { + return "Witty comment unavailable :("; + } + } + + public static CrashReport makeCrashReport(Throwable causeIn, String descriptionIn) + { + // CheatBreaker Crash Report System + try { + StackTraceElement[] stackTrace; + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(causeIn.getClass().getSimpleName()).append(": ").append(causeIn.getLocalizedMessage()); + for (StackTraceElement element : stackTrace = causeIn.getStackTrace()) { + stringBuilder.append("\n").append("\t").append("at ").append(element); + } + UUID uuid = UUID.randomUUID(); + StringSelection reportID = new StringSelection("CB-" + uuid); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(reportID, null); +// CrashHandler.handleCrash(causeIn.getStackTrace()); + sendCrashReport(uuid.toString(), stringBuilder.toString()); + if (causeIn.getClass().getSimpleName().equals("OutOfMemoryError")) { + new Thread(() -> JOptionPane.showMessageDialog(null, "Your client has ran out of memory." + + "\nYou can increase memory allocation in the launcher. " + + "\n\nPlease use the following code (also copied to your clipboard) when submitting a bug report: " + + "\n\nCB-" + uuid, "Out of Memory", 2)).start(); + } else { + new Thread(() -> JOptionPane.showMessageDialog(null, + "Your client has crashed. " + + "\n\nPlease use the following code (also copied to your clipboard) when submitting a bug report: " + + "\n\nCB-" + uuid, "Something went wrong", 2)).start(); + } + Thread.sleep(4000L); + } catch (Exception stackTrace) { + System.out.println("Something went wrong"); + stackTrace.printStackTrace(); + } + + // Normal Minecraft Crash Report System + CrashReport crashreport; + + if (causeIn instanceof ReportedException) + { + crashreport = ((ReportedException)causeIn).getCrashReport(); + } + else + { + crashreport = new CrashReport(descriptionIn, causeIn); + } + + return crashreport; + } + + private static void sendCrashReport(String crashId, String stackTrace) throws IOException { + StringBuilder descriptionBuilder = new StringBuilder(); + descriptionBuilder.append("OptiFine Version: ").append(Config.getVersion()).append("\n\n"); + descriptionBuilder.append("CheatBreaker client Version: ").append(CheatBreaker.getInstance().getGitCommitId() + "/" + + CheatBreaker.getInstance().getGitBranch()).append("\n\n"); + descriptionBuilder.append("= [ User Info ] =\n"); + if (Minecraft.getMinecraft().getSession() != null) { + try { + descriptionBuilder.append("User: " + Minecraft.getMinecraft().getSession().getUsername() + "\n"); + descriptionBuilder.append("UUID: " + Minecraft.getMinecraft().getSession().getPlayerID() + "\n\n"); + + } catch (Exception var20) { + var20.printStackTrace(); + } + } + descriptionBuilder.append("= [ Crash Info ] =\n"); + descriptionBuilder.append("Crash ID: " + crashId); + descriptionBuilder.append("\nStackTrace: " + stackTrace + "\n\n"); + BufferedReader var28; + String var29; + Runtime runtime = Runtime.getRuntime(); + long maxMemory = runtime.maxMemory(); + long totalMemory = runtime.totalMemory(); + long freeMemory = runtime.freeMemory(); + long maxMemDiv = maxMemory / 1024L / 1024L; + long totalMemDiv = totalMemory / 1024L / 1024L; + long freeMemDiv = freeMemory / 1024L / 1024L; + descriptionBuilder.append("= [ System Info ] =\n"); + descriptionBuilder.append("OpenGlVersion: " + Config.openGlVersion + "\n"); + descriptionBuilder.append("OpenGlRenderer: " + Config.openGlRenderer + "\n"); + descriptionBuilder.append("OpenGlVendor: " + Config.openGlVendor + "\n"); + descriptionBuilder.append("CpuCount: " + Config.getAvailableProcessors() + "\n"); + descriptionBuilder.append("OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n"); + descriptionBuilder.append("Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n"); + descriptionBuilder.append("Java VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor") + "\n"); + descriptionBuilder.append("Memory: " + freeMemory + " bytes (" + freeMemDiv + " MB) / " + totalMemory + " bytes (" + totalMemDiv + " MB) up to " + maxMemory + " bytes (" + maxMemDiv + " MB)\n"); + descriptionBuilder.append("JVM Flags: " + jvmargs() + "\n\n"); + descriptionBuilder.append("= [ Module Settings ] =").append("\n"); + for (AbstractModule var16 : CheatBreaker.getInstance().getModuleManager().playerMods) { + StringBuilder var17 = new StringBuilder(); + for (Setting var19 : var16.getSettingsList()) { + if (var19.getSettingName().equals("label")) continue; + var17.append(var19.getSettingName()).append("=").append(var19.getValue()).append(var16.getSettingsList().indexOf(var19) == var16.getSettingsList().size() - 1 ? "" : ", "); + } + descriptionBuilder.append(var16.getName() + ": [" + var17.toString() + "]\n"); + } + descriptionBuilder.append("\n= [ Global Settings ] =").append("\n"); + String var23 = ""; + List var24 =CheatBreaker.getInstance().getGlobalSettings().settingsList; + for (Setting var27 : var24) { + if (var27.getSettingName().equals("label")) continue; + var23 = var23 + var27.getSettingName() + "=" + var27.getValue() + (var24.indexOf(var27) == var24.size() - 1 ? "" : ", "); + } + descriptionBuilder.append("Global: [" + var23 + "]\n\n"); + GameSettings var26 = Minecraft.getMinecraft().gameSettings; + descriptionBuilder.append("= [ Options.txt ] =\n"); + try { + var28 = new BufferedReader(new FileReader(var26.optionsFile)); + while ((var29 = var28.readLine()) != null) { + if (var29.startsWith("stream") || var29.startsWith("key_") || var29.startsWith("soundCategory")) continue; + descriptionBuilder.append(var29 + "\n"); + } + } catch (IOException var22) { + var22.printStackTrace(); + } + descriptionBuilder.append("\n= [ OptionsOF.txt ] =\n"); + try { + var28 = new BufferedReader(new FileReader(var26.optionsFileOF)); + while ((var29 = var28.readLine()) != null) { + if (var29.startsWith("ofAnimated")) continue; + descriptionBuilder.append(var29 + "\n"); + } + } catch (IOException var21) { + var21.printStackTrace(); + } + + byte[] var4 = null; + try { + var4 = descriptionBuilder.toString().getBytes("ASCII"); + } catch (Exception exception) { + // empty catch block + } + ImmutableMap var5 = ImmutableMap.builder().put("branch", CheatBreaker.getInstance().getGitBranch()).put("buildType", CheatBreaker.getInstance().getGitBuildVersion()).put("crashID", crashId).put("version", Config.MC_VERSION).put("gitCommit", CheatBreaker.getInstance().getGitCommitIdAbbrev()).put("osInfo", System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version")).put("memoryInfo", "Memory: " + freeMemory + " bytes (" + freeMemDiv + " MB) / " + totalMemory + " bytes (" + totalMemDiv + " MB) up to " + maxMemory + " bytes (" + maxMemDiv + " MB)").put("username", Minecraft.getMinecraft().getSession().getUsername()).put("uuid", Minecraft.getMinecraft().getSession().getPlayerID()).build(); + HttpUtils.post(CheatBreaker.getInstance().getGlobalSettings().webapiCrashReportUpload, var5, var4); + if (CheatBreaker.getInstance().getWsNetHandler().isOpen()) { + WSPacketClientCrashReport crashReport = new WSPacketClientCrashReport(crashId, CheatBreaker.getInstance().getGitCommitId(), System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version"), "Memory: " + freeMemory + " bytes (" + freeMemDiv + " MB) / " + totalMemory + " bytes (" + totalMemDiv + " MB) up to " + maxMemory + " bytes (" + maxMemDiv + " MB)", descriptionBuilder.toString()); + CheatBreaker.getInstance().getWsNetHandler().sendPacket(crashReport); + } + } + + private static String jvmargs() { + RuntimeMXBean var0 = ManagementFactory.getRuntimeMXBean(); + List var1 = var0.getInputArguments(); + int var2 = 0; + StringBuilder var3 = new StringBuilder(); + for (String var5 : var1) { + if (!var5.startsWith("-X")) continue; + if (var2++ > 0) { + var3.append(" "); + } + var3.append(var5); + } + return String.format("%d total; %s", var2, var3.toString()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/crash/CrashReportCategory.java b/Client-1.8.9/src/main/java/net/minecraft/crash/CrashReportCategory.java new file mode 100644 index 0000000..7ea5c25 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/crash/CrashReportCategory.java @@ -0,0 +1,289 @@ +package net.minecraft.crash; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; + +public class CrashReportCategory +{ + private final CrashReport crashReport; + private final String name; + private final List children = Lists.newArrayList(); + private StackTraceElement[] stackTrace = new StackTraceElement[0]; + + public CrashReportCategory(CrashReport report, String name) + { + this.crashReport = report; + this.name = name; + } + + public static String getCoordinateInfo(double x, double y, double z) + { + return String.format("%.2f,%.2f,%.2f - %s", new Object[] {Double.valueOf(x), Double.valueOf(y), Double.valueOf(z), getCoordinateInfo(new BlockPos(x, y, z))}); + } + + public static String getCoordinateInfo(BlockPos pos) + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + StringBuilder stringbuilder = new StringBuilder(); + + try + { + stringbuilder.append(String.format("World: (%d,%d,%d)", new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k)})); + } + catch (Throwable var17) + { + stringbuilder.append("(Error finding world loc)"); + } + + stringbuilder.append(", "); + + try + { + int l = i >> 4; + int i1 = k >> 4; + int j1 = i & 15; + int k1 = j >> 4; + int l1 = k & 15; + int i2 = l << 4; + int j2 = i1 << 4; + int k2 = (l + 1 << 4) - 1; + int l2 = (i1 + 1 << 4) - 1; + stringbuilder.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(j1), Integer.valueOf(k1), Integer.valueOf(l1), Integer.valueOf(l), Integer.valueOf(i1), Integer.valueOf(i2), Integer.valueOf(j2), Integer.valueOf(k2), Integer.valueOf(l2)})); + } + catch (Throwable var16) + { + stringbuilder.append("(Error finding chunk loc)"); + } + + stringbuilder.append(", "); + + try + { + int j3 = i >> 9; + int k3 = k >> 9; + int l3 = j3 << 5; + int i4 = k3 << 5; + int j4 = (j3 + 1 << 5) - 1; + int k4 = (k3 + 1 << 5) - 1; + int l4 = j3 << 9; + int i5 = k3 << 9; + int j5 = (j3 + 1 << 9) - 1; + int i3 = (k3 + 1 << 9) - 1; + stringbuilder.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(j3), Integer.valueOf(k3), Integer.valueOf(l3), Integer.valueOf(i4), Integer.valueOf(j4), Integer.valueOf(k4), Integer.valueOf(l4), Integer.valueOf(i5), Integer.valueOf(j5), Integer.valueOf(i3)})); + } + catch (Throwable var15) + { + stringbuilder.append("(Error finding world loc)"); + } + + return stringbuilder.toString(); + } + + public void addCrashSectionCallable(String sectionName, Callable callable) + { + try + { + this.addCrashSection(sectionName, callable.call()); + } + catch (Throwable throwable) + { + this.addCrashSectionThrowable(sectionName, throwable); + } + } + + public void addCrashSection(String sectionName, Object value) + { + this.children.add(new CrashReportCategory.Entry(sectionName, value)); + } + + public void addCrashSectionThrowable(String sectionName, Throwable throwable) + { + this.addCrashSection(sectionName, throwable); + } + + public int getPrunedStackTrace(int size) + { + StackTraceElement[] astacktraceelement = Thread.currentThread().getStackTrace(); + + if (astacktraceelement.length <= 0) + { + return 0; + } + else + { + this.stackTrace = new StackTraceElement[astacktraceelement.length - 3 - size]; + System.arraycopy(astacktraceelement, 3 + size, this.stackTrace, 0, this.stackTrace.length); + return this.stackTrace.length; + } + } + + public boolean firstTwoElementsOfStackTraceMatch(StackTraceElement s1, StackTraceElement s2) + { + if (this.stackTrace.length != 0 && s1 != null) + { + StackTraceElement stacktraceelement = this.stackTrace[0]; + + if (stacktraceelement.isNativeMethod() == s1.isNativeMethod() && stacktraceelement.getClassName().equals(s1.getClassName()) && stacktraceelement.getFileName().equals(s1.getFileName()) && stacktraceelement.getMethodName().equals(s1.getMethodName())) + { + if (s2 != null != this.stackTrace.length > 1) + { + return false; + } + else if (s2 != null && !this.stackTrace[1].equals(s2)) + { + return false; + } + else + { + this.stackTrace[0] = s1; + return true; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + + public void trimStackTraceEntriesFromBottom(int amount) + { + StackTraceElement[] astacktraceelement = new StackTraceElement[this.stackTrace.length - amount]; + System.arraycopy(this.stackTrace, 0, astacktraceelement, 0, astacktraceelement.length); + this.stackTrace = astacktraceelement; + } + + public void appendToStringBuilder(StringBuilder builder) + { + builder.append("-- ").append(this.name).append(" --\n"); + builder.append("Details:"); + + for (CrashReportCategory.Entry crashreportcategory$entry : this.children) + { + builder.append("\n\t"); + builder.append(crashreportcategory$entry.getKey()); + builder.append(": "); + builder.append(crashreportcategory$entry.getValue()); + } + + if (this.stackTrace != null && this.stackTrace.length > 0) + { + builder.append("\nStacktrace:"); + + for (StackTraceElement stacktraceelement : this.stackTrace) + { + builder.append("\n\tat "); + builder.append(stacktraceelement.toString()); + } + } + } + + public StackTraceElement[] getStackTrace() + { + return this.stackTrace; + } + + public static void addBlockInfo(CrashReportCategory category, final BlockPos pos, final Block blockIn, final int blockData) + { + final int i = Block.getIdFromBlock(blockIn); + category.addCrashSectionCallable("Block type", new Callable() + { + public String call() throws Exception + { + try + { + return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(i), blockIn.getUnlocalizedName(), blockIn.getClass().getCanonicalName()}); + } + catch (Throwable var2) + { + return "ID #" + i; + } + } + }); + category.addCrashSectionCallable("Block data value", new Callable() + { + public String call() throws Exception + { + if (blockData < 0) + { + return "Unknown? (Got " + blockData + ")"; + } + else + { + String s = String.format("%4s", new Object[] {Integer.toBinaryString(blockData)}).replace(" ", "0"); + return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(blockData), s}); + } + } + }); + category.addCrashSectionCallable("Block location", new Callable() + { + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo(pos); + } + }); + } + + public static void addBlockInfo(CrashReportCategory category, final BlockPos pos, final IBlockState state) + { + category.addCrashSectionCallable("Block", new Callable() + { + public String call() throws Exception + { + return state.toString(); + } + }); + category.addCrashSectionCallable("Block location", new Callable() + { + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo(pos); + } + }); + } + + static class Entry + { + private final String key; + private final String value; + + public Entry(String key, Object value) + { + this.key = key; + + if (value == null) + { + this.value = "~~NULL~~"; + } + else if (value instanceof Throwable) + { + Throwable throwable = (Throwable)value; + this.value = "~~ERROR~~ " + throwable.getClass().getSimpleName() + ": " + throwable.getMessage(); + } + else + { + this.value = value.toString(); + } + } + + public String getKey() + { + return this.key; + } + + public String getValue() + { + return this.value; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/creativetab/CreativeTabs.java b/Client-1.8.9/src/main/java/net/minecraft/creativetab/CreativeTabs.java new file mode 100644 index 0000000..4aa61d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/creativetab/CreativeTabs.java @@ -0,0 +1,264 @@ +package net.minecraft.creativetab; + +import java.util.List; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public abstract class CreativeTabs +{ + public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12]; + public static final CreativeTabs tabBlock = new CreativeTabs(0, "buildingBlocks") + { + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.brick_block); + } + }; + public static final CreativeTabs tabDecorations = new CreativeTabs(1, "decorations") + { + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.double_plant); + } + public int getIconItemDamage() + { + return BlockDoublePlant.EnumPlantType.PAEONIA.getMeta(); + } + }; + public static final CreativeTabs tabRedstone = new CreativeTabs(2, "redstone") + { + public Item getTabIconItem() + { + return Items.redstone; + } + }; + public static final CreativeTabs tabTransport = new CreativeTabs(3, "transportation") + { + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.golden_rail); + } + }; + public static final CreativeTabs tabMisc = (new CreativeTabs(4, "misc") + { + public Item getTabIconItem() + { + return Items.lava_bucket; + } + }).setRelevantEnchantmentTypes(new EnumEnchantmentType[] {EnumEnchantmentType.ALL}); + public static final CreativeTabs tabAllSearch = (new CreativeTabs(5, "search") + { + public Item getTabIconItem() + { + return Items.compass; + } + }).setBackgroundImageName("item_search.png"); + public static final CreativeTabs tabFood = new CreativeTabs(6, "food") + { + public Item getTabIconItem() + { + return Items.apple; + } + }; + public static final CreativeTabs tabTools = (new CreativeTabs(7, "tools") + { + public Item getTabIconItem() + { + return Items.iron_axe; + } + }).setRelevantEnchantmentTypes(new EnumEnchantmentType[] {EnumEnchantmentType.DIGGER, EnumEnchantmentType.FISHING_ROD, EnumEnchantmentType.BREAKABLE}); + public static final CreativeTabs tabCombat = (new CreativeTabs(8, "combat") + { + public Item getTabIconItem() + { + return Items.golden_sword; + } + }).setRelevantEnchantmentTypes(new EnumEnchantmentType[] {EnumEnchantmentType.ARMOR, EnumEnchantmentType.ARMOR_FEET, EnumEnchantmentType.ARMOR_HEAD, EnumEnchantmentType.ARMOR_LEGS, EnumEnchantmentType.ARMOR_TORSO, EnumEnchantmentType.BOW, EnumEnchantmentType.WEAPON}); + public static final CreativeTabs tabBrewing = new CreativeTabs(9, "brewing") + { + public Item getTabIconItem() + { + return Items.potionitem; + } + }; + public static final CreativeTabs tabMaterials = new CreativeTabs(10, "materials") + { + public Item getTabIconItem() + { + return Items.stick; + } + }; + public static final CreativeTabs tabInventory = (new CreativeTabs(11, "inventory") + { + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.chest); + } + }).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); + private final int tabIndex; + private final String tabLabel; + private String theTexture = "items.png"; + private boolean hasScrollbar = true; + private boolean drawTitle = true; + private EnumEnchantmentType[] enchantmentTypes; + private ItemStack iconItemStack; + + public CreativeTabs(int index, String label) + { + this.tabIndex = index; + this.tabLabel = label; + creativeTabArray[index] = this; + } + + public int getTabIndex() + { + return this.tabIndex; + } + + public String getTabLabel() + { + return this.tabLabel; + } + + public String getTranslatedTabLabel() + { + return "itemGroup." + this.getTabLabel(); + } + + public ItemStack getIconItemStack() + { + if (this.iconItemStack == null) + { + this.iconItemStack = new ItemStack(this.getTabIconItem(), 1, this.getIconItemDamage()); + } + + return this.iconItemStack; + } + + public abstract Item getTabIconItem(); + + public int getIconItemDamage() + { + return 0; + } + + public String getBackgroundImageName() + { + return this.theTexture; + } + + public CreativeTabs setBackgroundImageName(String texture) + { + this.theTexture = texture; + return this; + } + + public boolean drawInForegroundOfTab() + { + return this.drawTitle; + } + + public CreativeTabs setNoTitle() + { + this.drawTitle = false; + return this; + } + + public boolean shouldHidePlayerInventory() + { + return this.hasScrollbar; + } + + public CreativeTabs setNoScrollbar() + { + this.hasScrollbar = false; + return this; + } + + public int getTabColumn() + { + return this.tabIndex % 6; + } + + public boolean isTabInFirstRow() + { + return this.tabIndex < 6; + } + + public EnumEnchantmentType[] getRelevantEnchantmentTypes() + { + return this.enchantmentTypes; + } + + public CreativeTabs setRelevantEnchantmentTypes(EnumEnchantmentType... types) + { + this.enchantmentTypes = types; + return this; + } + + public boolean hasRelevantEnchantmentType(EnumEnchantmentType enchantmentType) + { + if (this.enchantmentTypes == null) + { + return false; + } + else + { + for (EnumEnchantmentType enumenchantmenttype : this.enchantmentTypes) + { + if (enumenchantmenttype == enchantmentType) + { + return true; + } + } + + return false; + } + } + + public void displayAllReleventItems(List p_78018_1_) + { + for (Item item : Item.itemRegistry) + { + if (item != null && item.getCreativeTab() == this) + { + item.getSubItems(item, this, p_78018_1_); + } + } + + if (this.getRelevantEnchantmentTypes() != null) + { + this.addEnchantmentBooksToList(p_78018_1_, this.getRelevantEnchantmentTypes()); + } + } + + public void addEnchantmentBooksToList(List itemList, EnumEnchantmentType... enchantmentType) + { + for (Enchantment enchantment : Enchantment.enchantmentsBookList) + { + if (enchantment != null && enchantment.type != null) + { + boolean flag = false; + + for (int i = 0; i < enchantmentType.length && !flag; ++i) + { + if (enchantment.type == enchantmentType[i]) + { + flag = true; + } + } + + if (flag) + { + itemList.add(Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, enchantment.getMaxLevel()))); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java new file mode 100644 index 0000000..63687c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java @@ -0,0 +1,68 @@ +package net.minecraft.dispenser; + +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BehaviorDefaultDispenseItem implements IBehaviorDispenseItem +{ + public final ItemStack dispense(IBlockSource source, ItemStack stack) + { + ItemStack itemstack = this.dispenseStack(source, stack); + this.playDispenseSound(source); + this.spawnDispenseParticles(source, BlockDispenser.getFacing(source.getBlockMetadata())); + return itemstack; + } + + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + IPosition iposition = BlockDispenser.getDispensePosition(source); + ItemStack itemstack = stack.splitStack(1); + doDispense(source.getWorld(), itemstack, 6, enumfacing, iposition); + return stack; + } + + public static void doDispense(World worldIn, ItemStack stack, int speed, EnumFacing facing, IPosition position) + { + double d0 = position.getX(); + double d1 = position.getY(); + double d2 = position.getZ(); + + if (facing.getAxis() == EnumFacing.Axis.Y) + { + d1 = d1 - 0.125D; + } + else + { + d1 = d1 - 0.15625D; + } + + EntityItem entityitem = new EntityItem(worldIn, d0, d1, d2, stack); + double d3 = worldIn.rand.nextDouble() * 0.1D + 0.2D; + entityitem.motionX = (double)facing.getFrontOffsetX() * d3; + entityitem.motionY = 0.20000000298023224D; + entityitem.motionZ = (double)facing.getFrontOffsetZ() * d3; + entityitem.motionX += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed; + entityitem.motionY += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed; + entityitem.motionZ += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed; + worldIn.spawnEntityInWorld(entityitem); + } + + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + + protected void spawnDispenseParticles(IBlockSource source, EnumFacing facingIn) + { + source.getWorld().playAuxSFX(2000, source.getBlockPos(), this.func_82488_a(facingIn)); + } + + private int func_82488_a(EnumFacing facingIn) + { + return facingIn.getFrontOffsetX() + 1 + (facingIn.getFrontOffsetZ() + 1) * 3; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java new file mode 100644 index 0000000..1bafb8f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java @@ -0,0 +1,40 @@ +package net.minecraft.dispenser; + +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IProjectile; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public abstract class BehaviorProjectileDispense extends BehaviorDefaultDispenseItem +{ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + IPosition iposition = BlockDispenser.getDispensePosition(source); + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + IProjectile iprojectile = this.getProjectileEntity(world, iposition); + iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a()); + world.spawnEntityInWorld((Entity)iprojectile); + stack.splitStack(1); + return stack; + } + + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1002, source.getBlockPos(), 0); + } + + protected abstract IProjectile getProjectileEntity(World worldIn, IPosition position); + + protected float func_82498_a() + { + return 6.0F; + } + + protected float func_82500_b() + { + return 1.1F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java new file mode 100644 index 0000000..46f63c4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java @@ -0,0 +1,16 @@ +package net.minecraft.dispenser; + +import net.minecraft.item.ItemStack; + +public interface IBehaviorDispenseItem +{ + IBehaviorDispenseItem itemDispenseBehaviorProvider = new IBehaviorDispenseItem() + { + public ItemStack dispense(IBlockSource source, ItemStack stack) + { + return stack; + } + }; + + ItemStack dispense(IBlockSource source, ItemStack stack); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/IBlockSource.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/IBlockSource.java new file mode 100644 index 0000000..2f52975 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/IBlockSource.java @@ -0,0 +1,19 @@ +package net.minecraft.dispenser; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; + +public interface IBlockSource extends ILocatableSource +{ + double getX(); + + double getY(); + + double getZ(); + + BlockPos getBlockPos(); + + int getBlockMetadata(); + + T getBlockTileEntity(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/ILocatableSource.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/ILocatableSource.java new file mode 100644 index 0000000..7fad44b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/ILocatableSource.java @@ -0,0 +1,5 @@ +package net.minecraft.dispenser; + +public interface ILocatableSource extends ILocation +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/ILocation.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/ILocation.java new file mode 100644 index 0000000..33175ca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/ILocation.java @@ -0,0 +1,8 @@ +package net.minecraft.dispenser; + +import net.minecraft.world.World; + +public interface ILocation extends IPosition +{ + World getWorld(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/IPosition.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/IPosition.java new file mode 100644 index 0000000..af86d59 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/IPosition.java @@ -0,0 +1,10 @@ +package net.minecraft.dispenser; + +public interface IPosition +{ + double getX(); + + double getY(); + + double getZ(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/dispenser/PositionImpl.java b/Client-1.8.9/src/main/java/net/minecraft/dispenser/PositionImpl.java new file mode 100644 index 0000000..b7fe22f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/dispenser/PositionImpl.java @@ -0,0 +1,30 @@ +package net.minecraft.dispenser; + +public class PositionImpl implements IPosition +{ + protected final double x; + protected final double y; + protected final double z; + + public PositionImpl(double xCoord, double yCoord, double zCoord) + { + this.x = xCoord; + this.y = yCoord; + this.z = zCoord; + } + + public double getX() + { + return this.x; + } + + public double getY() + { + return this.y; + } + + public double getZ() + { + return this.z; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/Enchantment.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/Enchantment.java new file mode 100644 index 0000000..0f26c21 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/Enchantment.java @@ -0,0 +1,167 @@ +package net.minecraft.enchantment; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public abstract class Enchantment +{ + private static final Enchantment[] enchantmentsList = new Enchantment[256]; + public static final Enchantment[] enchantmentsBookList; + private static final Map locationEnchantments = Maps.newHashMap(); + public static final Enchantment protection = new EnchantmentProtection(0, new ResourceLocation("protection"), 10, 0); + public static final Enchantment fireProtection = new EnchantmentProtection(1, new ResourceLocation("fire_protection"), 5, 1); + public static final Enchantment featherFalling = new EnchantmentProtection(2, new ResourceLocation("feather_falling"), 5, 2); + public static final Enchantment blastProtection = new EnchantmentProtection(3, new ResourceLocation("blast_protection"), 2, 3); + public static final Enchantment projectileProtection = new EnchantmentProtection(4, new ResourceLocation("projectile_protection"), 5, 4); + public static final Enchantment respiration = new EnchantmentOxygen(5, new ResourceLocation("respiration"), 2); + public static final Enchantment aquaAffinity = new EnchantmentWaterWorker(6, new ResourceLocation("aqua_affinity"), 2); + public static final Enchantment thorns = new EnchantmentThorns(7, new ResourceLocation("thorns"), 1); + public static final Enchantment depthStrider = new EnchantmentWaterWalker(8, new ResourceLocation("depth_strider"), 2); + public static final Enchantment sharpness = new EnchantmentDamage(16, new ResourceLocation("sharpness"), 10, 0); + public static final Enchantment smite = new EnchantmentDamage(17, new ResourceLocation("smite"), 5, 1); + public static final Enchantment baneOfArthropods = new EnchantmentDamage(18, new ResourceLocation("bane_of_arthropods"), 5, 2); + public static final Enchantment knockback = new EnchantmentKnockback(19, new ResourceLocation("knockback"), 5); + public static final Enchantment fireAspect = new EnchantmentFireAspect(20, new ResourceLocation("fire_aspect"), 2); + public static final Enchantment looting = new EnchantmentLootBonus(21, new ResourceLocation("looting"), 2, EnumEnchantmentType.WEAPON); + public static final Enchantment efficiency = new EnchantmentDigging(32, new ResourceLocation("efficiency"), 10); + public static final Enchantment silkTouch = new EnchantmentUntouching(33, new ResourceLocation("silk_touch"), 1); + public static final Enchantment unbreaking = new EnchantmentDurability(34, new ResourceLocation("unbreaking"), 5); + public static final Enchantment fortune = new EnchantmentLootBonus(35, new ResourceLocation("fortune"), 2, EnumEnchantmentType.DIGGER); + public static final Enchantment power = new EnchantmentArrowDamage(48, new ResourceLocation("power"), 10); + public static final Enchantment punch = new EnchantmentArrowKnockback(49, new ResourceLocation("punch"), 2); + public static final Enchantment flame = new EnchantmentArrowFire(50, new ResourceLocation("flame"), 2); + public static final Enchantment infinity = new EnchantmentArrowInfinite(51, new ResourceLocation("infinity"), 1); + public static final Enchantment luckOfTheSea = new EnchantmentLootBonus(61, new ResourceLocation("luck_of_the_sea"), 2, EnumEnchantmentType.FISHING_ROD); + public static final Enchantment lure = new EnchantmentFishingSpeed(62, new ResourceLocation("lure"), 2, EnumEnchantmentType.FISHING_ROD); + public final int effectId; + private final int weight; + public EnumEnchantmentType type; + protected String name; + + public static Enchantment getEnchantmentById(int enchID) + { + return enchID >= 0 && enchID < enchantmentsList.length ? enchantmentsList[enchID] : null; + } + + protected Enchantment(int enchID, ResourceLocation enchName, int enchWeight, EnumEnchantmentType enchType) + { + this.effectId = enchID; + this.weight = enchWeight; + this.type = enchType; + + if (enchantmentsList[enchID] != null) + { + throw new IllegalArgumentException("Duplicate enchantment id!"); + } + else + { + enchantmentsList[enchID] = this; + locationEnchantments.put(enchName, this); + } + } + + public static Enchantment getEnchantmentByLocation(String location) + { + return (Enchantment)locationEnchantments.get(new ResourceLocation(location)); + } + + public static Set func_181077_c() + { + return locationEnchantments.keySet(); + } + + public int getWeight() + { + return this.weight; + } + + public int getMinLevel() + { + return 1; + } + + public int getMaxLevel() + { + return 1; + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 1 + enchantmentLevel * 10; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + 5; + } + + public int calcModifierDamage(int level, DamageSource source) + { + return 0; + } + + public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType) + { + return 0.0F; + } + + public boolean canApplyTogether(Enchantment ench) + { + return this != ench; + } + + public Enchantment setName(String enchName) + { + this.name = enchName; + return this; + } + + public String getName() + { + return "enchantment." + this.name; + } + + public String getTranslatedName(int level) + { + String s = StatCollector.translateToLocal(this.getName()); + return s + " " + StatCollector.translateToLocal("enchantment.level." + level); + } + + public boolean canApply(ItemStack stack) + { + return this.type.canEnchantItem(stack.getItem()); + } + + public void onEntityDamaged(EntityLivingBase user, Entity target, int level) + { + } + + public void onUserHurt(EntityLivingBase user, Entity attacker, int level) + { + } + + static + { + List list = Lists.newArrayList(); + + for (Enchantment enchantment : enchantmentsList) + { + if (enchantment != null) + { + list.add(enchantment); + } + } + + enchantmentsBookList = (Enchantment[])list.toArray(new Enchantment[list.size()]); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java new file mode 100644 index 0000000..dafa57e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentArrowDamage extends Enchantment +{ + public EnchantmentArrowDamage(int enchID, ResourceLocation enchName, int enchWeight) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowDamage"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 1 + (enchantmentLevel - 1) * 10; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + 15; + } + + public int getMaxLevel() + { + return 5; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java new file mode 100644 index 0000000..4a314f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentArrowFire extends Enchantment +{ + public EnchantmentArrowFire(int enchID, ResourceLocation enchName, int enchWeight) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowFire"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 20; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return 50; + } + + public int getMaxLevel() + { + return 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java new file mode 100644 index 0000000..4946525 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentArrowInfinite extends Enchantment +{ + public EnchantmentArrowInfinite(int enchID, ResourceLocation enchName, int enchWeight) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowInfinite"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 20; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return 50; + } + + public int getMaxLevel() + { + return 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java new file mode 100644 index 0000000..1893e12 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentArrowKnockback extends Enchantment +{ + public EnchantmentArrowKnockback(int enchID, ResourceLocation enchName, int enchWeight) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BOW); + this.setName("arrowKnockback"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 12 + (enchantmentLevel - 1) * 20; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + 25; + } + + public int getMaxLevel() + { + return 2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java new file mode 100644 index 0000000..f4d395d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java @@ -0,0 +1,74 @@ +package net.minecraft.enchantment; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; + +public class EnchantmentDamage extends Enchantment +{ + private static final String[] protectionName = new String[] {"all", "undead", "arthropods"}; + private static final int[] baseEnchantability = new int[] {1, 5, 5}; + private static final int[] levelEnchantability = new int[] {11, 8, 8}; + private static final int[] thresholdEnchantability = new int[] {20, 20, 20}; + public final int damageType; + + public EnchantmentDamage(int enchID, ResourceLocation enchName, int enchWeight, int classification) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.WEAPON); + this.damageType = classification; + } + + public int getMinEnchantability(int enchantmentLevel) + { + return baseEnchantability[this.damageType] + (enchantmentLevel - 1) * levelEnchantability[this.damageType]; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + thresholdEnchantability[this.damageType]; + } + + public int getMaxLevel() + { + return 5; + } + + public float calcDamageByCreature(int level, EnumCreatureAttribute creatureType) + { + return this.damageType == 0 ? (float)level * 1.25F : (this.damageType == 1 && creatureType == EnumCreatureAttribute.UNDEAD ? (float)level * 2.5F : (this.damageType == 2 && creatureType == EnumCreatureAttribute.ARTHROPOD ? (float)level * 2.5F : 0.0F)); + } + + public String getName() + { + return "enchantment.damage." + protectionName[this.damageType]; + } + + public boolean canApplyTogether(Enchantment ench) + { + return !(ench instanceof EnchantmentDamage); + } + + public boolean canApply(ItemStack stack) + { + return stack.getItem() instanceof ItemAxe ? true : super.canApply(stack); + } + + public void onEntityDamaged(EntityLivingBase user, Entity target, int level) + { + if (target instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)target; + + if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) + { + int i = 20 + user.getRNG().nextInt(10 * level); + entitylivingbase.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, i, 3)); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentData.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentData.java new file mode 100644 index 0000000..9cdce6f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentData.java @@ -0,0 +1,16 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.WeightedRandom; + +public class EnchantmentData extends WeightedRandom.Item +{ + public final Enchantment enchantmentobj; + public final int enchantmentLevel; + + public EnchantmentData(Enchantment enchantmentObj, int enchLevel) + { + super(enchantmentObj.getWeight()); + this.enchantmentobj = enchantmentObj; + this.enchantmentLevel = enchLevel; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java new file mode 100644 index 0000000..064be2d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java @@ -0,0 +1,34 @@ +package net.minecraft.enchantment; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class EnchantmentDigging extends Enchantment +{ + protected EnchantmentDigging(int enchID, ResourceLocation enchName, int enchWeight) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.DIGGER); + this.setName("digging"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 1 + 10 * (enchantmentLevel - 1); + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 5; + } + + public boolean canApply(ItemStack stack) + { + return stack.getItem() == Items.shears ? true : super.canApply(stack); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java new file mode 100644 index 0000000..d6876a8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java @@ -0,0 +1,40 @@ +package net.minecraft.enchantment; + +import java.util.Random; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class EnchantmentDurability extends Enchantment +{ + protected EnchantmentDurability(int enchID, ResourceLocation enchName, int enchWeight) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.BREAKABLE); + this.setName("durability"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 5 + (enchantmentLevel - 1) * 8; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 3; + } + + public boolean canApply(ItemStack stack) + { + return stack.isItemStackDamageable() ? true : super.canApply(stack); + } + + public static boolean negateDamage(ItemStack p_92097_0_, int p_92097_1_, Random p_92097_2_) + { + return p_92097_0_.getItem() instanceof ItemArmor && p_92097_2_.nextFloat() < 0.6F ? false : p_92097_2_.nextInt(p_92097_1_ + 1) > 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java new file mode 100644 index 0000000..88852ec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentFireAspect extends Enchantment +{ + protected EnchantmentFireAspect(int enchID, ResourceLocation enchName, int enchWeight) + { + super(enchID, enchName, enchWeight, EnumEnchantmentType.WEAPON); + this.setName("fire"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 10 + 20 * (enchantmentLevel - 1); + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java new file mode 100644 index 0000000..10ab29e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentFishingSpeed extends Enchantment +{ + protected EnchantmentFishingSpeed(int enchID, ResourceLocation enchName, int enchWeight, EnumEnchantmentType enchType) + { + super(enchID, enchName, enchWeight, enchType); + this.setName("fishingSpeed"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 15 + (enchantmentLevel - 1) * 9; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 3; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java new file mode 100644 index 0000000..301d8fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java @@ -0,0 +1,508 @@ +package net.minecraft.enchantment; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.WeightedRandom; + +public class EnchantmentHelper +{ + private static final Random enchantmentRand = new Random(); + private static final EnchantmentHelper.ModifierDamage enchantmentModifierDamage = new EnchantmentHelper.ModifierDamage(); + private static final EnchantmentHelper.ModifierLiving enchantmentModifierLiving = new EnchantmentHelper.ModifierLiving(); + private static final EnchantmentHelper.HurtIterator ENCHANTMENT_ITERATOR_HURT = new EnchantmentHelper.HurtIterator(); + private static final EnchantmentHelper.DamageIterator ENCHANTMENT_ITERATOR_DAMAGE = new EnchantmentHelper.DamageIterator(); + + public static int getEnchantmentLevel(int enchID, ItemStack stack) + { + if (stack == null) + { + return 0; + } + else + { + NBTTagList nbttaglist = stack.getEnchantmentTagList(); + + if (nbttaglist == null) + { + return 0; + } + else + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + int j = nbttaglist.getCompoundTagAt(i).getShort("id"); + int k = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + + if (j == enchID) + { + return k; + } + } + + return 0; + } + } + } + + public static Map getEnchantments(ItemStack stack) + { + Map map = Maps.newLinkedHashMap(); + NBTTagList nbttaglist = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) : stack.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + int j = nbttaglist.getCompoundTagAt(i).getShort("id"); + int k = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + map.put(Integer.valueOf(j), Integer.valueOf(k)); + } + } + + return map; + } + + public static void setEnchantments(Map enchMap, ItemStack stack) + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = enchMap.keySet().iterator(); + + while (iterator.hasNext()) + { + int i = ((Integer)iterator.next()).intValue(); + Enchantment enchantment = Enchantment.getEnchantmentById(i); + + if (enchantment != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setShort("id", (short)i); + nbttagcompound.setShort("lvl", (short)((Integer)enchMap.get(Integer.valueOf(i))).intValue()); + nbttaglist.appendTag(nbttagcompound); + + if (stack.getItem() == Items.enchanted_book) + { + Items.enchanted_book.addEnchantment(stack, new EnchantmentData(enchantment, ((Integer)enchMap.get(Integer.valueOf(i))).intValue())); + } + } + } + + if (nbttaglist.tagCount() > 0) + { + if (stack.getItem() != Items.enchanted_book) + { + stack.setTagInfo("ench", nbttaglist); + } + } + else if (stack.hasTagCompound()) + { + stack.getTagCompound().removeTag("ench"); + } + } + + public static int getMaxEnchantmentLevel(int enchID, ItemStack[] stacks) + { + if (stacks == null) + { + return 0; + } + else + { + int i = 0; + + for (ItemStack itemstack : stacks) + { + int j = getEnchantmentLevel(enchID, itemstack); + + if (j > i) + { + i = j; + } + } + + return i; + } + } + + private static void applyEnchantmentModifier(EnchantmentHelper.IModifier modifier, ItemStack stack) + { + if (stack != null) + { + NBTTagList nbttaglist = stack.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + int j = nbttaglist.getCompoundTagAt(i).getShort("id"); + int k = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + + if (Enchantment.getEnchantmentById(j) != null) + { + modifier.calculateModifier(Enchantment.getEnchantmentById(j), k); + } + } + } + } + } + + private static void applyEnchantmentModifierArray(EnchantmentHelper.IModifier modifier, ItemStack[] stacks) + { + for (ItemStack itemstack : stacks) + { + applyEnchantmentModifier(modifier, itemstack); + } + } + + public static int getEnchantmentModifierDamage(ItemStack[] stacks, DamageSource source) + { + enchantmentModifierDamage.damageModifier = 0; + enchantmentModifierDamage.source = source; + applyEnchantmentModifierArray(enchantmentModifierDamage, stacks); + + if (enchantmentModifierDamage.damageModifier > 25) + { + enchantmentModifierDamage.damageModifier = 25; + } + else if (enchantmentModifierDamage.damageModifier < 0) + { + enchantmentModifierDamage.damageModifier = 0; + } + + return (enchantmentModifierDamage.damageModifier + 1 >> 1) + enchantmentRand.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); + } + + public static float getModifierForCreature(ItemStack p_152377_0_, EnumCreatureAttribute p_152377_1_) + { + enchantmentModifierLiving.livingModifier = 0.0F; + enchantmentModifierLiving.entityLiving = p_152377_1_; + applyEnchantmentModifier(enchantmentModifierLiving, p_152377_0_); + return enchantmentModifierLiving.livingModifier; + } + + public static void applyThornEnchantments(EntityLivingBase p_151384_0_, Entity p_151384_1_) + { + ENCHANTMENT_ITERATOR_HURT.attacker = p_151384_1_; + ENCHANTMENT_ITERATOR_HURT.user = p_151384_0_; + + if (p_151384_0_ != null) + { + applyEnchantmentModifierArray(ENCHANTMENT_ITERATOR_HURT, p_151384_0_.getInventory()); + } + + if (p_151384_1_ instanceof EntityPlayer) + { + applyEnchantmentModifier(ENCHANTMENT_ITERATOR_HURT, p_151384_0_.getHeldItem()); + } + } + + public static void applyArthropodEnchantments(EntityLivingBase p_151385_0_, Entity p_151385_1_) + { + ENCHANTMENT_ITERATOR_DAMAGE.user = p_151385_0_; + ENCHANTMENT_ITERATOR_DAMAGE.target = p_151385_1_; + + if (p_151385_0_ != null) + { + applyEnchantmentModifierArray(ENCHANTMENT_ITERATOR_DAMAGE, p_151385_0_.getInventory()); + } + + if (p_151385_0_ instanceof EntityPlayer) + { + applyEnchantmentModifier(ENCHANTMENT_ITERATOR_DAMAGE, p_151385_0_.getHeldItem()); + } + } + + public static int getKnockbackModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.knockback.effectId, player.getHeldItem()); + } + + public static int getFireAspectModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.fireAspect.effectId, player.getHeldItem()); + } + + public static int getRespiration(Entity player) + { + return getMaxEnchantmentLevel(Enchantment.respiration.effectId, player.getInventory()); + } + + public static int getDepthStriderModifier(Entity player) + { + return getMaxEnchantmentLevel(Enchantment.depthStrider.effectId, player.getInventory()); + } + + public static int getEfficiencyModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.efficiency.effectId, player.getHeldItem()); + } + + public static boolean getSilkTouchModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.silkTouch.effectId, player.getHeldItem()) > 0; + } + + public static int getFortuneModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.fortune.effectId, player.getHeldItem()); + } + + public static int getLuckOfSeaModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.luckOfTheSea.effectId, player.getHeldItem()); + } + + public static int getLureModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.lure.effectId, player.getHeldItem()); + } + + public static int getLootingModifier(EntityLivingBase player) + { + return getEnchantmentLevel(Enchantment.looting.effectId, player.getHeldItem()); + } + + public static boolean getAquaAffinityModifier(EntityLivingBase player) + { + return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, player.getInventory()) > 0; + } + + public static ItemStack getEnchantedItem(Enchantment p_92099_0_, EntityLivingBase p_92099_1_) + { + for (ItemStack itemstack : p_92099_1_.getInventory()) + { + if (itemstack != null && getEnchantmentLevel(p_92099_0_.effectId, itemstack) > 0) + { + return itemstack; + } + } + + return null; + } + + public static int calcItemStackEnchantability(Random rand, int enchantNum, int power, ItemStack stack) + { + Item item = stack.getItem(); + int i = item.getItemEnchantability(); + + if (i <= 0) + { + return 0; + } + else + { + if (power > 15) + { + power = 15; + } + + int j = rand.nextInt(8) + 1 + (power >> 1) + rand.nextInt(power + 1); + return enchantNum == 0 ? Math.max(j / 3, 1) : (enchantNum == 1 ? j * 2 / 3 + 1 : Math.max(j, power * 2)); + } + } + + public static ItemStack addRandomEnchantment(Random p_77504_0_, ItemStack p_77504_1_, int p_77504_2_) + { + List list = buildEnchantmentList(p_77504_0_, p_77504_1_, p_77504_2_); + boolean flag = p_77504_1_.getItem() == Items.book; + + if (flag) + { + p_77504_1_.setItem(Items.enchanted_book); + } + + if (list != null) + { + for (EnchantmentData enchantmentdata : list) + { + if (flag) + { + Items.enchanted_book.addEnchantment(p_77504_1_, enchantmentdata); + } + else + { + p_77504_1_.addEnchantment(enchantmentdata.enchantmentobj, enchantmentdata.enchantmentLevel); + } + } + } + + return p_77504_1_; + } + + public static List buildEnchantmentList(Random randomIn, ItemStack itemStackIn, int p_77513_2_) + { + Item item = itemStackIn.getItem(); + int i = item.getItemEnchantability(); + + if (i <= 0) + { + return null; + } + else + { + i = i / 2; + i = 1 + randomIn.nextInt((i >> 1) + 1) + randomIn.nextInt((i >> 1) + 1); + int j = i + p_77513_2_; + float f = (randomIn.nextFloat() + randomIn.nextFloat() - 1.0F) * 0.15F; + int k = (int)((float)j * (1.0F + f) + 0.5F); + + if (k < 1) + { + k = 1; + } + + List list = null; + Map map = mapEnchantmentData(k, itemStackIn); + + if (map != null && !map.isEmpty()) + { + EnchantmentData enchantmentdata = (EnchantmentData)WeightedRandom.getRandomItem(randomIn, map.values()); + + if (enchantmentdata != null) + { + list = Lists.newArrayList(); + list.add(enchantmentdata); + + for (int l = k; randomIn.nextInt(50) <= l; l >>= 1) + { + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) + { + Integer integer = (Integer)iterator.next(); + boolean flag = true; + + for (EnchantmentData enchantmentdata1 : list) + { + if (!enchantmentdata1.enchantmentobj.canApplyTogether(Enchantment.getEnchantmentById(integer.intValue()))) + { + flag = false; + break; + } + } + + if (!flag) + { + iterator.remove(); + } + } + + if (!map.isEmpty()) + { + EnchantmentData enchantmentdata2 = (EnchantmentData)WeightedRandom.getRandomItem(randomIn, map.values()); + list.add(enchantmentdata2); + } + } + } + } + + return list; + } + } + + public static Map mapEnchantmentData(int p_77505_0_, ItemStack p_77505_1_) + { + Item item = p_77505_1_.getItem(); + Map map = null; + boolean flag = p_77505_1_.getItem() == Items.book; + + for (Enchantment enchantment : Enchantment.enchantmentsBookList) + { + if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag)) + { + for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); ++i) + { + if (p_77505_0_ >= enchantment.getMinEnchantability(i) && p_77505_0_ <= enchantment.getMaxEnchantability(i)) + { + if (map == null) + { + map = Maps.newHashMap(); + } + + map.put(Integer.valueOf(enchantment.effectId), new EnchantmentData(enchantment, i)); + } + } + } + } + + return map; + } + + static final class DamageIterator implements EnchantmentHelper.IModifier + { + public EntityLivingBase user; + public Entity target; + + private DamageIterator() + { + } + + public void calculateModifier(Enchantment enchantmentIn, int enchantmentLevel) + { + enchantmentIn.onEntityDamaged(this.user, this.target, enchantmentLevel); + } + } + + static final class HurtIterator implements EnchantmentHelper.IModifier + { + public EntityLivingBase user; + public Entity attacker; + + private HurtIterator() + { + } + + public void calculateModifier(Enchantment enchantmentIn, int enchantmentLevel) + { + enchantmentIn.onUserHurt(this.user, this.attacker, enchantmentLevel); + } + } + + interface IModifier + { + void calculateModifier(Enchantment enchantmentIn, int enchantmentLevel); + } + + static final class ModifierDamage implements EnchantmentHelper.IModifier + { + public int damageModifier; + public DamageSource source; + + private ModifierDamage() + { + } + + public void calculateModifier(Enchantment enchantmentIn, int enchantmentLevel) + { + this.damageModifier += enchantmentIn.calcModifierDamage(enchantmentLevel, this.source); + } + } + + static final class ModifierLiving implements EnchantmentHelper.IModifier + { + public float livingModifier; + public EnumCreatureAttribute entityLiving; + + private ModifierLiving() + { + } + + public void calculateModifier(Enchantment enchantmentIn, int enchantmentLevel) + { + this.livingModifier += enchantmentIn.calcDamageByCreature(enchantmentLevel, this.entityLiving); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java new file mode 100644 index 0000000..8924bcd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentKnockback extends Enchantment +{ + protected EnchantmentKnockback(int p_i45768_1_, ResourceLocation p_i45768_2_, int p_i45768_3_) + { + super(p_i45768_1_, p_i45768_2_, p_i45768_3_, EnumEnchantmentType.WEAPON); + this.setName("knockback"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 5 + 20 * (enchantmentLevel - 1); + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java new file mode 100644 index 0000000..353b410 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java @@ -0,0 +1,44 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentLootBonus extends Enchantment +{ + protected EnchantmentLootBonus(int p_i45767_1_, ResourceLocation p_i45767_2_, int p_i45767_3_, EnumEnchantmentType p_i45767_4_) + { + super(p_i45767_1_, p_i45767_2_, p_i45767_3_, p_i45767_4_); + + if (p_i45767_4_ == EnumEnchantmentType.DIGGER) + { + this.setName("lootBonusDigger"); + } + else if (p_i45767_4_ == EnumEnchantmentType.FISHING_ROD) + { + this.setName("lootBonusFishing"); + } + else + { + this.setName("lootBonus"); + } + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 15 + (enchantmentLevel - 1) * 9; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 3; + } + + public boolean canApplyTogether(Enchantment ench) + { + return super.canApplyTogether(ench) && ench.effectId != silkTouch.effectId; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java new file mode 100644 index 0000000..7330d69 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentOxygen extends Enchantment +{ + public EnchantmentOxygen(int enchID, ResourceLocation p_i45766_2_, int p_i45766_3_) + { + super(enchID, p_i45766_2_, p_i45766_3_, EnumEnchantmentType.ARMOR_HEAD); + this.setName("oxygen"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 10 * enchantmentLevel; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + 30; + } + + public int getMaxLevel() + { + return 3; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java new file mode 100644 index 0000000..c1422a5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java @@ -0,0 +1,96 @@ +package net.minecraft.enchantment; + +import net.minecraft.entity.Entity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class EnchantmentProtection extends Enchantment +{ + private static final String[] protectionName = new String[] {"all", "fire", "fall", "explosion", "projectile"}; + private static final int[] baseEnchantability = new int[] {1, 10, 5, 5, 3}; + private static final int[] levelEnchantability = new int[] {11, 8, 6, 8, 6}; + private static final int[] thresholdEnchantability = new int[] {20, 12, 10, 12, 15}; + public final int protectionType; + + public EnchantmentProtection(int p_i45765_1_, ResourceLocation p_i45765_2_, int p_i45765_3_, int p_i45765_4_) + { + super(p_i45765_1_, p_i45765_2_, p_i45765_3_, EnumEnchantmentType.ARMOR); + this.protectionType = p_i45765_4_; + + if (p_i45765_4_ == 2) + { + this.type = EnumEnchantmentType.ARMOR_FEET; + } + } + + public int getMinEnchantability(int enchantmentLevel) + { + return baseEnchantability[this.protectionType] + (enchantmentLevel - 1) * levelEnchantability[this.protectionType]; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + thresholdEnchantability[this.protectionType]; + } + + public int getMaxLevel() + { + return 4; + } + + public int calcModifierDamage(int level, DamageSource source) + { + if (source.canHarmInCreative()) + { + return 0; + } + else + { + float f = (float)(6 + level * level) / 3.0F; + return this.protectionType == 0 ? MathHelper.floor_float(f * 0.75F) : (this.protectionType == 1 && source.isFireDamage() ? MathHelper.floor_float(f * 1.25F) : (this.protectionType == 2 && source == DamageSource.fall ? MathHelper.floor_float(f * 2.5F) : (this.protectionType == 3 && source.isExplosion() ? MathHelper.floor_float(f * 1.5F) : (this.protectionType == 4 && source.isProjectile() ? MathHelper.floor_float(f * 1.5F) : 0)))); + } + } + + public String getName() + { + return "enchantment.protect." + protectionName[this.protectionType]; + } + + public boolean canApplyTogether(Enchantment ench) + { + if (ench instanceof EnchantmentProtection) + { + EnchantmentProtection enchantmentprotection = (EnchantmentProtection)ench; + return enchantmentprotection.protectionType == this.protectionType ? false : this.protectionType == 2 || enchantmentprotection.protectionType == 2; + } + else + { + return super.canApplyTogether(ench); + } + } + + public static int getFireTimeForEntity(Entity p_92093_0_, int p_92093_1_) + { + int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, p_92093_0_.getInventory()); + + if (i > 0) + { + p_92093_1_ -= MathHelper.floor_float((float)p_92093_1_ * (float)i * 0.15F); + } + + return p_92093_1_; + } + + public static double func_92092_a(Entity p_92092_0_, double p_92092_1_) + { + int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, p_92092_0_.getInventory()); + + if (i > 0) + { + p_92092_1_ -= (double)MathHelper.floor_double(p_92092_1_ * (double)((float)i * 0.15F)); + } + + return p_92092_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java new file mode 100644 index 0000000..d82a50d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java @@ -0,0 +1,72 @@ +package net.minecraft.enchantment; + +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; + +public class EnchantmentThorns extends Enchantment +{ + public EnchantmentThorns(int p_i45764_1_, ResourceLocation p_i45764_2_, int p_i45764_3_) + { + super(p_i45764_1_, p_i45764_2_, p_i45764_3_, EnumEnchantmentType.ARMOR_TORSO); + this.setName("thorns"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 10 + 20 * (enchantmentLevel - 1); + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 3; + } + + public boolean canApply(ItemStack stack) + { + return stack.getItem() instanceof ItemArmor ? true : super.canApply(stack); + } + + public void onUserHurt(EntityLivingBase user, Entity attacker, int level) + { + Random random = user.getRNG(); + ItemStack itemstack = EnchantmentHelper.getEnchantedItem(Enchantment.thorns, user); + + if (func_92094_a(level, random)) + { + if (attacker != null) + { + attacker.attackEntityFrom(DamageSource.causeThornsDamage(user), (float)func_92095_b(level, random)); + attacker.playSound("damage.thorns", 0.5F, 1.0F); + } + + if (itemstack != null) + { + itemstack.damageItem(3, user); + } + } + else if (itemstack != null) + { + itemstack.damageItem(1, user); + } + } + + public static boolean func_92094_a(int p_92094_0_, Random p_92094_1_) + { + return p_92094_0_ <= 0 ? false : p_92094_1_.nextFloat() < 0.15F * (float)p_92094_0_; + } + + public static int func_92095_b(int p_92095_0_, Random p_92095_1_) + { + return p_92095_0_ > 10 ? p_92095_0_ - 10 : 1 + p_92095_1_.nextInt(4); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java new file mode 100644 index 0000000..f6d9938 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java @@ -0,0 +1,39 @@ +package net.minecraft.enchantment; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class EnchantmentUntouching extends Enchantment +{ + protected EnchantmentUntouching(int p_i45763_1_, ResourceLocation p_i45763_2_, int p_i45763_3_) + { + super(p_i45763_1_, p_i45763_2_, p_i45763_3_, EnumEnchantmentType.DIGGER); + this.setName("untouching"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 15; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return super.getMinEnchantability(enchantmentLevel) + 50; + } + + public int getMaxLevel() + { + return 1; + } + + public boolean canApplyTogether(Enchantment ench) + { + return super.canApplyTogether(ench) && ench.effectId != fortune.effectId; + } + + public boolean canApply(ItemStack stack) + { + return stack.getItem() == Items.shears ? true : super.canApply(stack); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentWaterWalker.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentWaterWalker.java new file mode 100644 index 0000000..0543060 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentWaterWalker.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentWaterWalker extends Enchantment +{ + public EnchantmentWaterWalker(int p_i45762_1_, ResourceLocation p_i45762_2_, int p_i45762_3_) + { + super(p_i45762_1_, p_i45762_2_, p_i45762_3_, EnumEnchantmentType.ARMOR_FEET); + this.setName("waterWalker"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return enchantmentLevel * 10; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + 15; + } + + public int getMaxLevel() + { + return 3; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java new file mode 100644 index 0000000..d0e6381 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java @@ -0,0 +1,27 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.ResourceLocation; + +public class EnchantmentWaterWorker extends Enchantment +{ + public EnchantmentWaterWorker(int p_i45761_1_, ResourceLocation p_i45761_2_, int p_i45761_3_) + { + super(p_i45761_1_, p_i45761_2_, p_i45761_3_, EnumEnchantmentType.ARMOR_HEAD); + this.setName("waterWorker"); + } + + public int getMinEnchantability(int enchantmentLevel) + { + return 1; + } + + public int getMaxEnchantability(int enchantmentLevel) + { + return this.getMinEnchantability(enchantmentLevel) + 40; + } + + public int getMaxLevel() + { + return 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java new file mode 100644 index 0000000..94dcfca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java @@ -0,0 +1,51 @@ +package net.minecraft.enchantment; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemFishingRod; +import net.minecraft.item.ItemSword; +import net.minecraft.item.ItemTool; + +public enum EnumEnchantmentType +{ + ALL, + ARMOR, + ARMOR_FEET, + ARMOR_LEGS, + ARMOR_TORSO, + ARMOR_HEAD, + WEAPON, + DIGGER, + FISHING_ROD, + BREAKABLE, + BOW; + + public boolean canEnchantItem(Item p_77557_1_) + { + if (this == ALL) + { + return true; + } + else if (this == BREAKABLE && p_77557_1_.isDamageable()) + { + return true; + } + else if (p_77557_1_ instanceof ItemArmor) + { + if (this == ARMOR) + { + return true; + } + else + { + ItemArmor itemarmor = (ItemArmor)p_77557_1_; + return itemarmor.armorType == 0 ? this == ARMOR_HEAD : (itemarmor.armorType == 2 ? this == ARMOR_LEGS : (itemarmor.armorType == 1 ? this == ARMOR_TORSO : (itemarmor.armorType == 3 ? this == ARMOR_FEET : false))); + } + } + else + { + return p_77557_1_ instanceof ItemSword ? this == WEAPON : (p_77557_1_ instanceof ItemTool ? this == DIGGER : (p_77557_1_ instanceof ItemBow ? this == BOW : (p_77557_1_ instanceof ItemFishingRod ? this == FISHING_ROD : false))); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/DataWatcher.java b/Client-1.8.9/src/main/java/net/minecraft/entity/DataWatcher.java new file mode 100644 index 0000000..0d521eb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/DataWatcher.java @@ -0,0 +1,420 @@ +package net.minecraft.entity; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Rotations; +import net.minecraft.world.biome.BiomeGenBase; +import org.apache.commons.lang3.ObjectUtils; + +public class DataWatcher +{ + private final Entity owner; + private boolean isBlank = true; + private static final Map < Class, Integer > dataTypes = Maps. < Class, Integer > newHashMap(); + private final Map watchedObjects = Maps.newHashMap(); + private boolean objectChanged; + private ReadWriteLock lock = new ReentrantReadWriteLock(); + public BiomeGenBase spawnBiome = BiomeGenBase.plains; + public BlockPos spawnPosition = BlockPos.ORIGIN; + + public DataWatcher(Entity owner) + { + this.owner = owner; + } + + public void addObject(int id, T object) + { + Integer integer = (Integer)dataTypes.get(object.getClass()); + + if (integer == null) + { + throw new IllegalArgumentException("Unknown data type: " + object.getClass()); + } + else if (id > 31) + { + throw new IllegalArgumentException("Data value id is too big with " + id + "! (Max is " + 31 + ")"); + } + else if (this.watchedObjects.containsKey(Integer.valueOf(id))) + { + throw new IllegalArgumentException("Duplicate id value for " + id + "!"); + } + else + { + DataWatcher.WatchableObject datawatcher$watchableobject = new DataWatcher.WatchableObject(integer.intValue(), id, object); + this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(id), datawatcher$watchableobject); + this.lock.writeLock().unlock(); + this.isBlank = false; + } + } + + public void addObjectByDataType(int id, int type) + { + DataWatcher.WatchableObject datawatcher$watchableobject = new DataWatcher.WatchableObject(type, id, (Object)null); + this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(id), datawatcher$watchableobject); + this.lock.writeLock().unlock(); + this.isBlank = false; + } + + public byte getWatchableObjectByte(int id) + { + return ((Byte)this.getWatchedObject(id).getObject()).byteValue(); + } + + public short getWatchableObjectShort(int id) + { + return ((Short)this.getWatchedObject(id).getObject()).shortValue(); + } + + public int getWatchableObjectInt(int id) + { + return ((Integer)this.getWatchedObject(id).getObject()).intValue(); + } + + public float getWatchableObjectFloat(int id) + { + return ((Float)this.getWatchedObject(id).getObject()).floatValue(); + } + + public String getWatchableObjectString(int id) + { + return (String)this.getWatchedObject(id).getObject(); + } + + public ItemStack getWatchableObjectItemStack(int id) + { + return (ItemStack)this.getWatchedObject(id).getObject(); + } + + private DataWatcher.WatchableObject getWatchedObject(int id) + { + this.lock.readLock().lock(); + DataWatcher.WatchableObject datawatcher$watchableobject; + + try + { + datawatcher$watchableobject = (DataWatcher.WatchableObject)this.watchedObjects.get(Integer.valueOf(id)); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting synched entity data"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Synched entity data"); + crashreportcategory.addCrashSection("Data ID", Integer.valueOf(id)); + throw new ReportedException(crashreport); + } + + this.lock.readLock().unlock(); + return datawatcher$watchableobject; + } + + public Rotations getWatchableObjectRotations(int id) + { + return (Rotations)this.getWatchedObject(id).getObject(); + } + + public void updateObject(int id, T newData) + { + DataWatcher.WatchableObject datawatcher$watchableobject = this.getWatchedObject(id); + + if (ObjectUtils.notEqual(newData, datawatcher$watchableobject.getObject())) + { + datawatcher$watchableobject.setObject(newData); + this.owner.onDataWatcherUpdate(id); + datawatcher$watchableobject.setWatched(true); + this.objectChanged = true; + } + } + + public void setObjectWatched(int id) + { + this.getWatchedObject(id).watched = true; + this.objectChanged = true; + } + + public boolean hasObjectChanged() + { + return this.objectChanged; + } + + public static void writeWatchedListToPacketBuffer(List objectsList, PacketBuffer buffer) throws IOException + { + if (objectsList != null) + { + for (DataWatcher.WatchableObject datawatcher$watchableobject : objectsList) + { + writeWatchableObjectToPacketBuffer(buffer, datawatcher$watchableobject); + } + } + + buffer.writeByte(127); + } + + public List getChanged() + { + List list = null; + + if (this.objectChanged) + { + this.lock.readLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : this.watchedObjects.values()) + { + if (datawatcher$watchableobject.isWatched()) + { + datawatcher$watchableobject.setWatched(false); + + if (list == null) + { + list = Lists.newArrayList(); + } + + list.add(datawatcher$watchableobject); + } + } + + this.lock.readLock().unlock(); + } + + this.objectChanged = false; + return list; + } + + public void writeTo(PacketBuffer buffer) throws IOException + { + this.lock.readLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : this.watchedObjects.values()) + { + writeWatchableObjectToPacketBuffer(buffer, datawatcher$watchableobject); + } + + this.lock.readLock().unlock(); + buffer.writeByte(127); + } + + public List getAllWatched() + { + List list = null; + this.lock.readLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : this.watchedObjects.values()) + { + if (list == null) + { + list = Lists.newArrayList(); + } + + list.add(datawatcher$watchableobject); + } + + this.lock.readLock().unlock(); + return list; + } + + private static void writeWatchableObjectToPacketBuffer(PacketBuffer buffer, DataWatcher.WatchableObject object) throws IOException + { + int i = (object.getObjectType() << 5 | object.getDataValueId() & 31) & 255; + buffer.writeByte(i); + + switch (object.getObjectType()) + { + case 0: + buffer.writeByte(((Byte)object.getObject()).byteValue()); + break; + + case 1: + buffer.writeShort(((Short)object.getObject()).shortValue()); + break; + + case 2: + buffer.writeInt(((Integer)object.getObject()).intValue()); + break; + + case 3: + buffer.writeFloat(((Float)object.getObject()).floatValue()); + break; + + case 4: + buffer.writeString((String)object.getObject()); + break; + + case 5: + ItemStack itemstack = (ItemStack)object.getObject(); + buffer.writeItemStackToBuffer(itemstack); + break; + + case 6: + BlockPos blockpos = (BlockPos)object.getObject(); + buffer.writeInt(blockpos.getX()); + buffer.writeInt(blockpos.getY()); + buffer.writeInt(blockpos.getZ()); + break; + + case 7: + Rotations rotations = (Rotations)object.getObject(); + buffer.writeFloat(rotations.getX()); + buffer.writeFloat(rotations.getY()); + buffer.writeFloat(rotations.getZ()); + } + } + + public static List readWatchedListFromPacketBuffer(PacketBuffer buffer) throws IOException + { + List list = null; + + for (int i = buffer.readByte(); i != 127; i = buffer.readByte()) + { + if (list == null) + { + list = Lists.newArrayList(); + } + + int j = (i & 224) >> 5; + int k = i & 31; + DataWatcher.WatchableObject datawatcher$watchableobject = null; + + switch (j) + { + case 0: + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Byte.valueOf(buffer.readByte())); + break; + + case 1: + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Short.valueOf(buffer.readShort())); + break; + + case 2: + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Integer.valueOf(buffer.readInt())); + break; + + case 3: + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Float.valueOf(buffer.readFloat())); + break; + + case 4: + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, buffer.readStringFromBuffer(32767)); + break; + + case 5: + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, buffer.readItemStackFromBuffer()); + break; + + case 6: + int l = buffer.readInt(); + int i1 = buffer.readInt(); + int j1 = buffer.readInt(); + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, new BlockPos(l, i1, j1)); + break; + + case 7: + float f = buffer.readFloat(); + float f1 = buffer.readFloat(); + float f2 = buffer.readFloat(); + datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, new Rotations(f, f1, f2)); + } + + list.add(datawatcher$watchableobject); + } + + return list; + } + + public void updateWatchedObjectsFromList(List p_75687_1_) + { + this.lock.writeLock().lock(); + + for (DataWatcher.WatchableObject datawatcher$watchableobject : p_75687_1_) + { + DataWatcher.WatchableObject datawatcher$watchableobject1 = (DataWatcher.WatchableObject)this.watchedObjects.get(Integer.valueOf(datawatcher$watchableobject.getDataValueId())); + + if (datawatcher$watchableobject1 != null) + { + datawatcher$watchableobject1.setObject(datawatcher$watchableobject.getObject()); + this.owner.onDataWatcherUpdate(datawatcher$watchableobject.getDataValueId()); + } + } + + this.lock.writeLock().unlock(); + this.objectChanged = true; + } + + public boolean getIsBlank() + { + return this.isBlank; + } + + public void func_111144_e() + { + this.objectChanged = false; + } + + static + { + dataTypes.put(Byte.class, Integer.valueOf(0)); + dataTypes.put(Short.class, Integer.valueOf(1)); + dataTypes.put(Integer.class, Integer.valueOf(2)); + dataTypes.put(Float.class, Integer.valueOf(3)); + dataTypes.put(String.class, Integer.valueOf(4)); + dataTypes.put(ItemStack.class, Integer.valueOf(5)); + dataTypes.put(BlockPos.class, Integer.valueOf(6)); + dataTypes.put(Rotations.class, Integer.valueOf(7)); + } + + public static class WatchableObject + { + private final int objectType; + private final int dataValueId; + private Object watchedObject; + private boolean watched; + + public WatchableObject(int type, int id, Object object) + { + this.dataValueId = id; + this.watchedObject = object; + this.objectType = type; + this.watched = true; + } + + public int getDataValueId() + { + return this.dataValueId; + } + + public void setObject(Object object) + { + this.watchedObject = object; + } + + public Object getObject() + { + return this.watchedObject; + } + + public int getObjectType() + { + return this.objectType; + } + + public boolean isWatched() + { + return this.watched; + } + + public void setWatched(boolean watched) + { + this.watched = watched; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/Entity.java b/Client-1.8.9/src/main/java/net/minecraft/entity/Entity.java new file mode 100644 index 0000000..7ba2856 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/Entity.java @@ -0,0 +1,1917 @@ +package net.minecraft.entity; + +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.Callable; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleParticles; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockWall; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockPattern; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.EnchantmentProtection; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.event.HoverEvent; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public abstract class Entity implements ICommandSender { + private static final AxisAlignedBB ZERO_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + private static int nextEntityID; + private int entityId; + public double renderDistanceWeight; + public boolean preventEntitySpawning; + public Entity riddenByEntity; + public Entity ridingEntity; + public boolean forceSpawn; + public World worldObj; + public double prevPosX; + public double prevPosY; + public double prevPosZ; + public double posX; + public double posY; + public double posZ; + public double motionX; + public double motionY; + public double motionZ; + public float rotationYaw; + public float rotationPitch; + public float prevRotationYaw; + public float prevRotationPitch; + public AxisAlignedBB boundingBox; + public boolean onGround; + public boolean isCollidedHorizontally; + public boolean isCollidedVertically; + public boolean isCollided; + public boolean velocityChanged; + protected boolean isInWeb; + private boolean isOutsideBorder; + public boolean isDead; + public float width; + public float height; + public float prevDistanceWalkedModified; + public float distanceWalkedModified; + public float distanceWalkedOnStepModified; + public float fallDistance; + private int nextStepDistance; + public double lastTickPosX; + public double lastTickPosY; + public double lastTickPosZ; + public float stepHeight; + public boolean noClip; + public float entityCollisionReduction; + protected Random rand; + public int ticksExisted; + public int fireResistance; + private int fire; + protected boolean inWater; + public int hurtResistantTime; + protected boolean firstUpdate; + protected boolean isImmuneToFire; + protected DataWatcher dataWatcher; + private double entityRiderPitchDelta; + private double entityRiderYawDelta; + public boolean addedToChunk; + public int chunkCoordX; + public int chunkCoordY; + public int chunkCoordZ; + public int serverPosX; + public int serverPosY; + public int serverPosZ; + public boolean ignoreFrustumCheck; + public boolean isAirBorne; + public int timeUntilPortal; + protected boolean inPortal; + protected int portalCounter; + public int dimension; + protected BlockPos lastPortalPos; + protected Vec3 lastPortalVec; + protected EnumFacing teleportDirection; + private boolean invulnerable; + protected UUID entityUniqueID; + private final CommandResultStats cmdResultStats; + + public int getEntityId() { + return this.entityId; + } + + public void setEntityId(int id) { + this.entityId = id; + } + + public void onKillCommand() { + this.setDead(); + } + + public Entity(World worldIn) { + this.entityId = nextEntityID++; + this.renderDistanceWeight = 1.0D; + this.boundingBox = ZERO_AABB; + this.width = 0.6F; + this.height = 1.8F; + this.nextStepDistance = 1; + this.rand = new Random(); + this.fireResistance = 1; + this.firstUpdate = true; + this.entityUniqueID = MathHelper.getRandomUuid(this.rand); + this.cmdResultStats = new CommandResultStats(); + this.worldObj = worldIn; + this.setPosition(0.0D, 0.0D, 0.0D); + + if (worldIn != null) { + this.dimension = worldIn.provider.getDimensionId(); + } + + this.dataWatcher = new DataWatcher(this); + this.dataWatcher.addObject(0, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(1, Short.valueOf((short) 300)); + this.dataWatcher.addObject(3, Byte.valueOf((byte) 0)); + this.dataWatcher.addObject(2, ""); + this.dataWatcher.addObject(4, Byte.valueOf((byte) 0)); + this.entityInit(); + } + + protected abstract void entityInit(); + + public DataWatcher getDataWatcher() { + return this.dataWatcher; + } + + public boolean equals(Object p_equals_1_) { + return p_equals_1_ instanceof Entity ? ((Entity) p_equals_1_).entityId == this.entityId : false; + } + + public int hashCode() { + return this.entityId; + } + + protected void preparePlayerToSpawn() { + if (this.worldObj != null) { + while (this.posY > 0.0D && this.posY < 256.0D) { + this.setPosition(this.posX, this.posY, this.posZ); + + if (this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty()) { + break; + } + + ++this.posY; + } + + this.motionX = this.motionY = this.motionZ = 0.0D; + this.rotationPitch = 0.0F; + } + } + + public void setDead() { + this.isDead = true; + } + + protected void setSize(float width, float height) { + if (width != this.width || height != this.height) { + float f = this.width; + this.width = width; + this.height = height; + this.setEntityBoundingBox(new AxisAlignedBB(this.getEntityBoundingBox().minX, this.getEntityBoundingBox().minY, this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().minX + (double) this.width, this.getEntityBoundingBox().minY + (double) this.height, this.getEntityBoundingBox().minZ + (double) this.width)); + + if (this.width > f && !this.firstUpdate && !this.worldObj.isRemote) { + this.moveEntity((double) (f - this.width), 0.0D, (double) (f - this.width)); + } + } + } + + protected void setRotation(float yaw, float pitch) { + this.rotationYaw = yaw % 360.0F; + this.rotationPitch = pitch % 360.0F; + } + + public void setPosition(double x, double y, double z) { + this.posX = x; + this.posY = y; + this.posZ = z; + float f = this.width / 2.0F; + float f1 = this.height; + this.setEntityBoundingBox(new AxisAlignedBB(x - (double) f, y, z - (double) f, x + (double) f, y + (double) f1, z + (double) f)); + } + + public void setAngles(float yaw, float pitch) { + float f = this.rotationPitch; + float f1 = this.rotationYaw; + this.rotationYaw = (float) ((double) this.rotationYaw + (double) yaw * 0.15D); + this.rotationPitch = (float) ((double) this.rotationPitch - (double) pitch * 0.15D); + this.rotationPitch = MathHelper.clamp_float(this.rotationPitch, -90.0F, 90.0F); + this.prevRotationPitch += this.rotationPitch - f; + this.prevRotationYaw += this.rotationYaw - f1; + } + + public void onUpdate() { + this.onEntityUpdate(); + } + + public void onEntityUpdate() { + this.worldObj.theProfiler.startSection("entityBaseTick"); + + if (this.ridingEntity != null && this.ridingEntity.isDead) { + this.ridingEntity = null; + } + + this.prevDistanceWalkedModified = this.distanceWalkedModified; + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + + if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer minecraftserver = ((WorldServer) this.worldObj).getMinecraftServer(); + int i = this.getMaxInPortalTime(); + + if (this.inPortal) { + if (minecraftserver.getAllowNether()) { + if (this.ridingEntity == null && this.portalCounter++ >= i) { + this.portalCounter = i; + this.timeUntilPortal = this.getPortalCooldown(); + int j; + + if (this.worldObj.provider.getDimensionId() == -1) { + j = 0; + } else { + j = -1; + } + + this.travelToDimension(j); + } + + this.inPortal = false; + } + } else { + if (this.portalCounter > 0) { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + this.spawnRunningParticles(); + this.handleWaterMovement(); + + if (this.worldObj.isRemote) { + this.fire = 0; + } else if (this.fire > 0) { + if (this.isImmuneToFire) { + this.fire -= 4; + + if (this.fire < 0) { + this.fire = 0; + } + } else { + if (this.fire % 20 == 0) { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + --this.fire; + } + } + + if (this.isInLava()) { + this.setOnFireFromLava(); + this.fallDistance *= 0.5F; + } + + if (this.posY < -64.0D) { + this.kill(); + } + + if (!this.worldObj.isRemote) { + this.setFlag(0, this.fire > 0); + } + + this.firstUpdate = false; + this.worldObj.theProfiler.endSection(); + } + + public int getMaxInPortalTime() { + return 0; + } + + protected void setOnFireFromLava() { + if (!this.isImmuneToFire) { + this.attackEntityFrom(DamageSource.lava, 4.0F); + this.setFire(15); + } + } + + public void setFire(int seconds) { + int i = seconds * 20; + i = EnchantmentProtection.getFireTimeForEntity(this, i); + + if (this.fire < i) { + this.fire = i; + } + } + + public void extinguish() { + this.fire = 0; + } + + protected void kill() { + this.setDead(); + } + + public boolean isOffsetPositionInLiquid(double x, double y, double z) { + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox().offset(x, y, z); + return this.isLiquidPresentInAABB(axisalignedbb); + } + + private boolean isLiquidPresentInAABB(AxisAlignedBB bb) { + return this.worldObj.getCollidingBoundingBoxes(this, bb).isEmpty() && !this.worldObj.isAnyLiquid(bb); + } + + public void moveEntity(double x, double y, double z) { + if (this.noClip) { + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, y, z)); + this.resetPositionToBB(); + } else { + this.worldObj.theProfiler.startSection("move"); + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + + if (this.isInWeb) { + this.isInWeb = false; + x *= 0.25D; + y *= 0.05000000074505806D; + z *= 0.25D; + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + } + + double d3 = x; + double d4 = y; + double d5 = z; + boolean flag = this.onGround && this.isSneaking() && this instanceof EntityPlayer; + + if (flag) { + double d6; + + for (d6 = 0.05D; x != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox().offset(x, -1.0D, 0.0D)).isEmpty(); d3 = x) { + if (x < d6 && x >= -d6) { + x = 0.0D; + } else if (x > 0.0D) { + x -= d6; + } else { + x += d6; + } + } + + for (; z != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox().offset(0.0D, -1.0D, z)).isEmpty(); d5 = z) { + if (z < d6 && z >= -d6) { + z = 0.0D; + } else if (z > 0.0D) { + z -= d6; + } else { + z += d6; + } + } + + for (; x != 0.0D && z != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox().offset(x, -1.0D, z)).isEmpty(); d5 = z) { + if (x < d6 && x >= -d6) { + x = 0.0D; + } else if (x > 0.0D) { + x -= d6; + } else { + x += d6; + } + + d3 = x; + + if (z < d6 && z >= -d6) { + z = 0.0D; + } else if (z > 0.0D) { + z -= d6; + } else { + z += d6; + } + } + } + + List list1 = this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox().addCoord(x, y, z)); + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox(); + + for (AxisAlignedBB axisalignedbb1 : list1) { + y = axisalignedbb1.calculateYOffset(this.getEntityBoundingBox(), y); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, y, 0.0D)); + boolean flag1 = this.onGround || d4 != y && d4 < 0.0D; + + for (AxisAlignedBB axisalignedbb2 : list1) { + x = axisalignedbb2.calculateXOffset(this.getEntityBoundingBox(), x); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, 0.0D, 0.0D)); + + for (AxisAlignedBB axisalignedbb13 : list1) { + z = axisalignedbb13.calculateZOffset(this.getEntityBoundingBox(), z); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, 0.0D, z)); + + if (this.stepHeight > 0.0F && flag1 && (d3 != x || d5 != z)) { + double d11 = x; + double d7 = y; + double d8 = z; + AxisAlignedBB axisalignedbb3 = this.getEntityBoundingBox(); + this.setEntityBoundingBox(axisalignedbb); + y = (double) this.stepHeight; + List list = this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox().addCoord(d3, y, d5)); + AxisAlignedBB axisalignedbb4 = this.getEntityBoundingBox(); + AxisAlignedBB axisalignedbb5 = axisalignedbb4.addCoord(d3, 0.0D, d5); + double d9 = y; + + for (AxisAlignedBB axisalignedbb6 : list) { + d9 = axisalignedbb6.calculateYOffset(axisalignedbb5, d9); + } + + axisalignedbb4 = axisalignedbb4.offset(0.0D, d9, 0.0D); + double d15 = d3; + + for (AxisAlignedBB axisalignedbb7 : list) { + d15 = axisalignedbb7.calculateXOffset(axisalignedbb4, d15); + } + + axisalignedbb4 = axisalignedbb4.offset(d15, 0.0D, 0.0D); + double d16 = d5; + + for (AxisAlignedBB axisalignedbb8 : list) { + d16 = axisalignedbb8.calculateZOffset(axisalignedbb4, d16); + } + + axisalignedbb4 = axisalignedbb4.offset(0.0D, 0.0D, d16); + AxisAlignedBB axisalignedbb14 = this.getEntityBoundingBox(); + double d17 = y; + + for (AxisAlignedBB axisalignedbb9 : list) { + d17 = axisalignedbb9.calculateYOffset(axisalignedbb14, d17); + } + + axisalignedbb14 = axisalignedbb14.offset(0.0D, d17, 0.0D); + double d18 = d3; + + for (AxisAlignedBB axisalignedbb10 : list) { + d18 = axisalignedbb10.calculateXOffset(axisalignedbb14, d18); + } + + axisalignedbb14 = axisalignedbb14.offset(d18, 0.0D, 0.0D); + double d19 = d5; + + for (AxisAlignedBB axisalignedbb11 : list) { + d19 = axisalignedbb11.calculateZOffset(axisalignedbb14, d19); + } + + axisalignedbb14 = axisalignedbb14.offset(0.0D, 0.0D, d19); + double d20 = d15 * d15 + d16 * d16; + double d10 = d18 * d18 + d19 * d19; + + if (d20 > d10) { + x = d15; + z = d16; + y = -d9; + this.setEntityBoundingBox(axisalignedbb4); + } else { + x = d18; + z = d19; + y = -d17; + this.setEntityBoundingBox(axisalignedbb14); + } + + for (AxisAlignedBB axisalignedbb12 : list) { + y = axisalignedbb12.calculateYOffset(this.getEntityBoundingBox(), y); + } + + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(0.0D, y, 0.0D)); + + if (d11 * d11 + d8 * d8 >= x * x + z * z) { + x = d11; + y = d7; + z = d8; + this.setEntityBoundingBox(axisalignedbb3); + } + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rest"); + this.resetPositionToBB(); + this.isCollidedHorizontally = d3 != x || d5 != z; + this.isCollidedVertically = d4 != y; + this.onGround = this.isCollidedVertically && d4 < 0.0D; + this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically; + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + Block block1 = this.worldObj.getBlockState(blockpos).getBlock(); + + if (block1.getMaterial() == Material.air) { + Block block = this.worldObj.getBlockState(blockpos.down()).getBlock(); + + if (block instanceof BlockFence || block instanceof BlockWall || block instanceof BlockFenceGate) { + block1 = block; + blockpos = blockpos.down(); + } + } + + this.updateFallState(y, this.onGround, block1, blockpos); + + if (d3 != x) { + this.motionX = 0.0D; + } + + if (d5 != z) { + this.motionZ = 0.0D; + } + + if (d4 != y) { + block1.onLanded(this.worldObj, this); + } + + if (this.canTriggerWalking() && !flag && this.ridingEntity == null) { + double d12 = this.posX - d0; + double d13 = this.posY - d1; + double d14 = this.posZ - d2; + + if (block1 != Blocks.ladder) { + d13 = 0.0D; + } + + if (block1 != null && this.onGround) { + block1.onEntityCollidedWithBlock(this.worldObj, blockpos, this); + } + + this.distanceWalkedModified = (float) ((double) this.distanceWalkedModified + (double) MathHelper.sqrt_double(d12 * d12 + d14 * d14) * 0.6D); + this.distanceWalkedOnStepModified = (float) ((double) this.distanceWalkedOnStepModified + (double) MathHelper.sqrt_double(d12 * d12 + d13 * d13 + d14 * d14) * 0.6D); + + if (this.distanceWalkedOnStepModified > (float) this.nextStepDistance && block1.getMaterial() != Material.air) { + this.nextStepDistance = (int) this.distanceWalkedOnStepModified + 1; + + if (this.isInWater()) { + float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.35F; + + if (f > 1.0F) { + f = 1.0F; + } + + this.playSound(this.getSwimSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + } + + this.playStepSound(blockpos, block1); + } + } + + try { + this.doBlockCollisions(); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Checking entity block collision"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being checked for collision"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + + boolean flag2 = this.isWet(); + + if (this.worldObj.isFlammableWithin(this.getEntityBoundingBox().contract(0.001D, 0.001D, 0.001D))) { + this.dealFireDamage(1); + + if (!flag2) { + ++this.fire; + + if (this.fire == 0) { + this.setFire(8); + } + } + } else if (this.fire <= 0) { + this.fire = -this.fireResistance; + } + + if (flag2 && this.fire > 0) { + this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + this.fire = -this.fireResistance; + } + + this.worldObj.theProfiler.endSection(); + } + } + + private void resetPositionToBB() { + this.posX = (this.getEntityBoundingBox().minX + this.getEntityBoundingBox().maxX) / 2.0D; + this.posY = this.getEntityBoundingBox().minY; + this.posZ = (this.getEntityBoundingBox().minZ + this.getEntityBoundingBox().maxZ) / 2.0D; + } + + protected String getSwimSound() { + return "game.neutral.swim"; + } + + protected void doBlockCollisions() { + BlockPos blockpos = new BlockPos(this.getEntityBoundingBox().minX + 0.001D, this.getEntityBoundingBox().minY + 0.001D, this.getEntityBoundingBox().minZ + 0.001D); + BlockPos blockpos1 = new BlockPos(this.getEntityBoundingBox().maxX - 0.001D, this.getEntityBoundingBox().maxY - 0.001D, this.getEntityBoundingBox().maxZ - 0.001D); + + if (this.worldObj.isAreaLoaded(blockpos, blockpos1)) { + for (int i = blockpos.getX(); i <= blockpos1.getX(); ++i) { + for (int j = blockpos.getY(); j <= blockpos1.getY(); ++j) { + for (int k = blockpos.getZ(); k <= blockpos1.getZ(); ++k) { + BlockPos blockpos2 = new BlockPos(i, j, k); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos2); + + try { + iblockstate.getBlock().onEntityCollidedWithBlock(this.worldObj, blockpos2, iblockstate, this); + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Colliding entity with block"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being collided with"); + CrashReportCategory.addBlockInfo(crashreportcategory, blockpos2, iblockstate); + throw new ReportedException(crashreport); + } + } + } + } + } + } + + protected void playStepSound(BlockPos pos, Block blockIn) { + Block.SoundType block$soundtype = blockIn.stepSound; + + if (this.worldObj.getBlockState(pos.up()).getBlock() == Blocks.snow_layer) { + block$soundtype = Blocks.snow_layer.stepSound; + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + } else if (!blockIn.getMaterial().isLiquid()) { + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + } + } + + public void playSound(String name, float volume, float pitch) { + if (!this.isSilent()) { + this.worldObj.playSoundAtEntity(this, name, volume, pitch); + } + } + + public boolean isSilent() { + return this.dataWatcher.getWatchableObjectByte(4) == 1; + } + + public void setSilent(boolean isSilent) { + this.dataWatcher.updateObject(4, Byte.valueOf((byte) (isSilent ? 1 : 0))); + } + + protected boolean canTriggerWalking() { + return true; + } + + protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos) { + if (onGroundIn) { + if (this.fallDistance > 0.0F) { + if (blockIn != null) { + blockIn.onFallenUpon(this.worldObj, pos, this, this.fallDistance); + } else { + this.fall(this.fallDistance, 1.0F); + } + + this.fallDistance = 0.0F; + } + } else if (y < 0.0D) { + this.fallDistance = (float) ((double) this.fallDistance - y); + } + } + + public AxisAlignedBB getCollisionBoundingBox() { + return null; + } + + protected void dealFireDamage(int amount) { + if (!this.isImmuneToFire) { + this.attackEntityFrom(DamageSource.inFire, (float) amount); + } + } + + public final boolean isImmuneToFire() { + return this.isImmuneToFire; + } + + public void fall(float distance, float damageMultiplier) { + if (this.riddenByEntity != null) { + this.riddenByEntity.fall(distance, damageMultiplier); + } + } + + public boolean isWet() { + return this.inWater || this.worldObj.isRainingAt(new BlockPos(this.posX, this.posY, this.posZ)) || this.worldObj.isRainingAt(new BlockPos(this.posX, this.posY + (double) this.height, this.posZ)); + } + + public boolean isInWater() { + return this.inWater; + } + + public boolean handleWaterMovement() { + if (this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox().expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) { + if (!this.inWater && !this.firstUpdate) { + this.resetHeight(); + } + + this.fallDistance = 0.0F; + this.inWater = true; + this.fire = 0; + } else { + this.inWater = false; + } + + return this.inWater; + } + + protected void resetHeight() { + float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; + + if (f > 1.0F) { + f = 1.0F; + } + + this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float f1 = (float) MathHelper.floor_double(this.getEntityBoundingBox().minY); + + for (int i = 0; (float) i < 1.0F + this.width * 20.0F; ++i) { + float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + float f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + (double) f2, (double) (f1 + 1.0F), this.posZ + (double) f3, this.motionX, this.motionY - (double) (this.rand.nextFloat() * 0.2F), this.motionZ, new int[0]); + } + + for (int j = 0; (float) j < 1.0F + this.width * 20.0F; ++j) { + float f4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + float f5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double) f4, (double) (f1 + 1.0F), this.posZ + (double) f5, this.motionX, this.motionY, this.motionZ, new int[0]); + } + } + + public void spawnRunningParticles() { + if (this.isSprinting() && !this.isInWater()) { + this.createRunningParticles(); + } + } + + protected void createRunningParticles() { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + ModuleParticles mod = CheatBreaker.getInstance().getModuleManager().particlesMod; + if (!mod.isEnabled() || mod.sprintingParticles.getBooleanValue()) { + if (block.getRenderType() != -1) { + this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, this.posX + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double) this.rand.nextFloat() - 0.5D) * (double) this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D, new int[]{Block.getStateId(iblockstate)}); + } + } + } + + protected String getSplashSound() { + return "game.neutral.swim.splash"; + } + + public boolean isInsideOfMaterial(Material materialIn) { + double d0 = this.posY + (double) this.getEyeHeight(); + BlockPos blockpos = new BlockPos(this.posX, d0, this.posZ); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (block.getMaterial() == materialIn) { + float f = BlockLiquid.getLiquidHeightPercent(iblockstate.getBlock().getMetaFromState(iblockstate)) - 0.11111111F; + float f1 = (float) (blockpos.getY() + 1) - f; + boolean flag = d0 < (double) f1; + return !flag && this instanceof EntityPlayer ? false : flag; + } else { + return false; + } + } + + public boolean isInLava() { + return this.worldObj.isMaterialInBB(this.getEntityBoundingBox().expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.lava); + } + + public void moveFlying(float strafe, float forward, float friction) { + float f = strafe * strafe + forward * forward; + + if (f >= 1.0E-4F) { + f = MathHelper.sqrt_float(f); + + if (f < 1.0F) { + f = 1.0F; + } + + f = friction / f; + strafe = strafe * f; + forward = forward * f; + float f1 = MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F); + float f2 = MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F); + this.motionX += (double) (strafe * f2 - forward * f1); + this.motionZ += (double) (forward * f2 + strafe * f1); + } + } + + public int getBrightnessForRender(float partialTicks) { + BlockPos blockpos = new BlockPos(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + return this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getCombinedLight(blockpos, 0) : 0; + } + + public float getBrightness(float partialTicks) { + BlockPos blockpos = new BlockPos(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + return this.worldObj.isBlockLoaded(blockpos) ? this.worldObj.getLightBrightness(blockpos) : 0.0F; + } + + public void setWorld(World worldIn) { + this.worldObj = worldIn; + } + + public void setPositionAndRotation(double x, double y, double z, float yaw, float pitch) { + this.prevPosX = this.posX = x; + this.prevPosY = this.posY = y; + this.prevPosZ = this.posZ = z; + this.prevRotationYaw = this.rotationYaw = yaw; + this.prevRotationPitch = this.rotationPitch = pitch; + double d0 = (double) (this.prevRotationYaw - yaw); + + if (d0 < -180.0D) { + this.prevRotationYaw += 360.0F; + } + + if (d0 >= 180.0D) { + this.prevRotationYaw -= 360.0F; + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(yaw, pitch); + } + + public void moveToBlockPosAndAngles(BlockPos pos, float rotationYawIn, float rotationPitchIn) { + this.setLocationAndAngles((double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D, rotationYawIn, rotationPitchIn); + } + + public void setLocationAndAngles(double x, double y, double z, float yaw, float pitch) { + this.lastTickPosX = this.prevPosX = this.posX = x; + this.lastTickPosY = this.prevPosY = this.posY = y; + this.lastTickPosZ = this.prevPosZ = this.posZ = z; + this.rotationYaw = yaw; + this.rotationPitch = pitch; + this.setPosition(this.posX, this.posY, this.posZ); + } + + public float getDistanceToEntity(Entity entityIn) { + float f = (float) (this.posX - entityIn.posX); + float f1 = (float) (this.posY - entityIn.posY); + float f2 = (float) (this.posZ - entityIn.posZ); + return MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2); + } + + public double getDistanceSq(double x, double y, double z) { + double d0 = this.posX - x; + double d1 = this.posY - y; + double d2 = this.posZ - z; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public double getDistanceSq(BlockPos pos) { + return pos.distanceSq(this.posX, this.posY, this.posZ); + } + + public double getDistanceSqToCenter(BlockPos pos) { + return pos.distanceSqToCenter(this.posX, this.posY, this.posZ); + } + + public double getDistance(double x, double y, double z) { + double d0 = this.posX - x; + double d1 = this.posY - y; + double d2 = this.posZ - z; + return (double) MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2); + } + + public double getDistanceSqToEntity(Entity entityIn) { + double d0 = this.posX - entityIn.posX; + double d1 = this.posY - entityIn.posY; + double d2 = this.posZ - entityIn.posZ; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public void onCollideWithPlayer(EntityPlayer entityIn) { + } + + public void applyEntityCollision(Entity entityIn) { + if (entityIn.riddenByEntity != this && entityIn.ridingEntity != this) { + if (!entityIn.noClip && !this.noClip) { + double d0 = entityIn.posX - this.posX; + double d1 = entityIn.posZ - this.posZ; + double d2 = MathHelper.abs_max(d0, d1); + + if (d2 >= 0.009999999776482582D) { + d2 = (double) MathHelper.sqrt_double(d2); + d0 = d0 / d2; + d1 = d1 / d2; + double d3 = 1.0D / d2; + + if (d3 > 1.0D) { + d3 = 1.0D; + } + + d0 = d0 * d3; + d1 = d1 * d3; + d0 = d0 * 0.05000000074505806D; + d1 = d1 * 0.05000000074505806D; + d0 = d0 * (double) (1.0F - this.entityCollisionReduction); + d1 = d1 * (double) (1.0F - this.entityCollisionReduction); + + if (this.riddenByEntity == null) { + this.addVelocity(-d0, 0.0D, -d1); + } + + if (entityIn.riddenByEntity == null) { + entityIn.addVelocity(d0, 0.0D, d1); + } + } + } + } + } + + public void addVelocity(double x, double y, double z) { + this.motionX += x; + this.motionY += y; + this.motionZ += z; + this.isAirBorne = true; + } + + protected void setBeenAttacked() { + this.velocityChanged = true; + } + + public boolean attackEntityFrom(DamageSource source, float amount) { + if (this.isEntityInvulnerable(source)) { + return false; + } else { + this.setBeenAttacked(); + return false; + } + } + + public Vec3 getLook(float partialTicks) { + if (partialTicks == 1.0F) { + return this.getVectorForRotation(this.rotationPitch, this.rotationYaw); + } else { + float f = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * partialTicks; + float f1 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * partialTicks; + return this.getVectorForRotation(f, f1); + } + } + + protected final Vec3 getVectorForRotation(float pitch, float yaw) { + float f = MathHelper.cos(-yaw * 0.017453292F - (float) Math.PI); + float f1 = MathHelper.sin(-yaw * 0.017453292F - (float) Math.PI); + float f2 = -MathHelper.cos(-pitch * 0.017453292F); + float f3 = MathHelper.sin(-pitch * 0.017453292F); + return new Vec3((double) (f1 * f2), (double) f3, (double) (f * f2)); + } + + public Vec3 getPositionEyes(float partialTicks) { + if (partialTicks == 1.0F) { + return new Vec3(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ); + } else { + double d0 = this.prevPosX + (this.posX - this.prevPosX) * (double) partialTicks; + double d1 = this.prevPosY + (this.posY - this.prevPosY) * (double) partialTicks + (double) this.getEyeHeight(); + double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) partialTicks; + return new Vec3(d0, d1, d2); + } + } + + public MovingObjectPosition rayTrace(double blockReachDistance, float partialTicks) { + Vec3 vec3 = this.getPositionEyes(partialTicks); + Vec3 vec31 = this.getLook(partialTicks); + Vec3 vec32 = vec3.addVector(vec31.xCoord * blockReachDistance, vec31.yCoord * blockReachDistance, vec31.zCoord * blockReachDistance); + return this.worldObj.rayTraceBlocks(vec3, vec32, false, false, true); + } + + public boolean canBeCollidedWith() { + return false; + } + + public boolean canBePushed() { + return false; + } + + public void addToPlayerScore(Entity entityIn, int amount) { + } + + public boolean isInRangeToRender3d(double x, double y, double z) { + double d0 = this.posX - x; + double d1 = this.posY - y; + double d2 = this.posZ - z; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + return this.isInRangeToRenderDist(d3); + } + + public boolean isInRangeToRenderDist(double distance) { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength(); + + if (Double.isNaN(d0)) { + d0 = 1.0D; + } + + d0 = d0 * 64.0D * this.renderDistanceWeight; + return distance < d0 * d0; + } + + public boolean writeMountToNBT(NBTTagCompound tagCompund) { + String s = this.getEntityString(); + + if (!this.isDead && s != null) { + tagCompund.setString("id", s); + this.writeToNBT(tagCompund); + return true; + } else { + return false; + } + } + + public boolean writeToNBTOptional(NBTTagCompound tagCompund) { + String s = this.getEntityString(); + + if (!this.isDead && s != null && this.riddenByEntity == null) { + tagCompund.setString("id", s); + this.writeToNBT(tagCompund); + return true; + } else { + return false; + } + } + + public void writeToNBT(NBTTagCompound tagCompund) { + try { + tagCompund.setTag("Pos", this.newDoubleNBTList(new double[]{this.posX, this.posY, this.posZ})); + tagCompund.setTag("Motion", this.newDoubleNBTList(new double[]{this.motionX, this.motionY, this.motionZ})); + tagCompund.setTag("Rotation", this.newFloatNBTList(new float[]{this.rotationYaw, this.rotationPitch})); + tagCompund.setFloat("FallDistance", this.fallDistance); + tagCompund.setShort("Fire", (short) this.fire); + tagCompund.setShort("Air", (short) this.getAir()); + tagCompund.setBoolean("OnGround", this.onGround); + tagCompund.setInteger("Dimension", this.dimension); + tagCompund.setBoolean("Invulnerable", this.invulnerable); + tagCompund.setInteger("PortalCooldown", this.timeUntilPortal); + tagCompund.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits()); + tagCompund.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits()); + + if (this.getCustomNameTag() != null && this.getCustomNameTag().length() > 0) { + tagCompund.setString("CustomName", this.getCustomNameTag()); + tagCompund.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); + } + + this.cmdResultStats.writeStatsToNBT(tagCompund); + + if (this.isSilent()) { + tagCompund.setBoolean("Silent", this.isSilent()); + } + + this.writeEntityToNBT(tagCompund); + + if (this.ridingEntity != null) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + if (this.ridingEntity.writeMountToNBT(nbttagcompound)) { + tagCompund.setTag("Riding", nbttagcompound); + } + } + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Saving entity NBT"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being saved"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + public void readFromNBT(NBTTagCompound tagCompund) { + try { + NBTTagList nbttaglist = tagCompund.getTagList("Pos", 6); + NBTTagList nbttaglist1 = tagCompund.getTagList("Motion", 6); + NBTTagList nbttaglist2 = tagCompund.getTagList("Rotation", 5); + this.motionX = nbttaglist1.getDoubleAt(0); + this.motionY = nbttaglist1.getDoubleAt(1); + this.motionZ = nbttaglist1.getDoubleAt(2); + + if (Math.abs(this.motionX) > 10.0D) { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) > 10.0D) { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) > 10.0D) { + this.motionZ = 0.0D; + } + + this.prevPosX = this.lastTickPosX = this.posX = nbttaglist.getDoubleAt(0); + this.prevPosY = this.lastTickPosY = this.posY = nbttaglist.getDoubleAt(1); + this.prevPosZ = this.lastTickPosZ = this.posZ = nbttaglist.getDoubleAt(2); + this.prevRotationYaw = this.rotationYaw = nbttaglist2.getFloatAt(0); + this.prevRotationPitch = this.rotationPitch = nbttaglist2.getFloatAt(1); + this.setRotationYawHead(this.rotationYaw); + this.setRenderYawOffset(this.rotationYaw); + this.fallDistance = tagCompund.getFloat("FallDistance"); + this.fire = tagCompund.getShort("Fire"); + this.setAir(tagCompund.getShort("Air")); + this.onGround = tagCompund.getBoolean("OnGround"); + this.dimension = tagCompund.getInteger("Dimension"); + this.invulnerable = tagCompund.getBoolean("Invulnerable"); + this.timeUntilPortal = tagCompund.getInteger("PortalCooldown"); + + if (tagCompund.hasKey("UUIDMost", 4) && tagCompund.hasKey("UUIDLeast", 4)) { + this.entityUniqueID = new UUID(tagCompund.getLong("UUIDMost"), tagCompund.getLong("UUIDLeast")); + } else if (tagCompund.hasKey("UUID", 8)) { + this.entityUniqueID = UUID.fromString(tagCompund.getString("UUID")); + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + + if (tagCompund.hasKey("CustomName", 8) && tagCompund.getString("CustomName").length() > 0) { + this.setCustomNameTag(tagCompund.getString("CustomName")); + } + + this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible")); + this.cmdResultStats.readStatsFromNBT(tagCompund); + this.setSilent(tagCompund.getBoolean("Silent")); + this.readEntityFromNBT(tagCompund); + + if (this.shouldSetPosAfterLoading()) { + this.setPosition(this.posX, this.posY, this.posZ); + } + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Loading entity NBT"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being loaded"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + protected boolean shouldSetPosAfterLoading() { + return true; + } + + protected final String getEntityString() { + return EntityList.getEntityString(this); + } + + protected abstract void readEntityFromNBT(NBTTagCompound tagCompund); + + protected abstract void writeEntityToNBT(NBTTagCompound tagCompound); + + public void onChunkLoad() { + } + + protected NBTTagList newDoubleNBTList(double... numbers) { + NBTTagList nbttaglist = new NBTTagList(); + + for (double d0 : numbers) { + nbttaglist.appendTag(new NBTTagDouble(d0)); + } + + return nbttaglist; + } + + protected NBTTagList newFloatNBTList(float... numbers) { + NBTTagList nbttaglist = new NBTTagList(); + + for (float f : numbers) { + nbttaglist.appendTag(new NBTTagFloat(f)); + } + + return nbttaglist; + } + + public EntityItem dropItem(Item itemIn, int size) { + return this.dropItemWithOffset(itemIn, size, 0.0F); + } + + public EntityItem dropItemWithOffset(Item itemIn, int size, float offsetY) { + return this.entityDropItem(new ItemStack(itemIn, size, 0), offsetY); + } + + public EntityItem entityDropItem(ItemStack itemStackIn, float offsetY) { + if (itemStackIn.stackSize != 0 && itemStackIn.getItem() != null) { + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double) offsetY, this.posZ, itemStackIn); + entityitem.setDefaultPickupDelay(); + this.worldObj.spawnEntityInWorld(entityitem); + return entityitem; + } else { + return null; + } + } + + public boolean isEntityAlive() { + return !this.isDead; + } + + public boolean isEntityInsideOpaqueBlock() { + if (this.noClip) { + return false; + } else { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); + + for (int i = 0; i < 8; ++i) { + int j = MathHelper.floor_double(this.posY + (double) (((float) ((i >> 0) % 2) - 0.5F) * 0.1F) + (double) this.getEyeHeight()); + int k = MathHelper.floor_double(this.posX + (double) (((float) ((i >> 1) % 2) - 0.5F) * this.width * 0.8F)); + int l = MathHelper.floor_double(this.posZ + (double) (((float) ((i >> 2) % 2) - 0.5F) * this.width * 0.8F)); + + if (blockpos$mutableblockpos.getX() != k || blockpos$mutableblockpos.getY() != j || blockpos$mutableblockpos.getZ() != l) { + blockpos$mutableblockpos.set(k, j, l); + + if (this.worldObj.getBlockState(blockpos$mutableblockpos).getBlock().isVisuallyOpaque()) { + return true; + } + } + } + + return false; + } + } + + public boolean interactFirst(EntityPlayer playerIn) { + return false; + } + + public AxisAlignedBB getCollisionBox(Entity entityIn) { + return null; + } + + public void updateRidden() { + if (this.ridingEntity.isDead) { + this.ridingEntity = null; + } else { + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.onUpdate(); + + if (this.ridingEntity != null) { + this.ridingEntity.updateRiderPosition(); + this.entityRiderYawDelta += (double) (this.ridingEntity.rotationYaw - this.ridingEntity.prevRotationYaw); + + for (this.entityRiderPitchDelta += (double) (this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch); this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) { + ; + } + + while (this.entityRiderYawDelta < -180.0D) { + this.entityRiderYawDelta += 360.0D; + } + + while (this.entityRiderPitchDelta >= 180.0D) { + this.entityRiderPitchDelta -= 360.0D; + } + + while (this.entityRiderPitchDelta < -180.0D) { + this.entityRiderPitchDelta += 360.0D; + } + + double d0 = this.entityRiderYawDelta * 0.5D; + double d1 = this.entityRiderPitchDelta * 0.5D; + float f = 10.0F; + + if (d0 > (double) f) { + d0 = (double) f; + } + + if (d0 < (double) (-f)) { + d0 = (double) (-f); + } + + if (d1 > (double) f) { + d1 = (double) f; + } + + if (d1 < (double) (-f)) { + d1 = (double) (-f); + } + + this.entityRiderYawDelta -= d0; + this.entityRiderPitchDelta -= d1; + } + } + } + + public void updateRiderPosition() { + if (this.riddenByEntity != null) { + this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); + } + } + + public double getYOffset() { + return 0.0D; + } + + public double getMountedYOffset() { + return (double) this.height * 0.75D; + } + + public void mountEntity(Entity entityIn) { + this.entityRiderPitchDelta = 0.0D; + this.entityRiderYawDelta = 0.0D; + + if (entityIn == null) { + if (this.ridingEntity != null) { + this.setLocationAndAngles(this.ridingEntity.posX, this.ridingEntity.getEntityBoundingBox().minY + (double) this.ridingEntity.height, this.ridingEntity.posZ, this.rotationYaw, this.rotationPitch); + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } else { + if (this.ridingEntity != null) { + this.ridingEntity.riddenByEntity = null; + } + + if (entityIn != null) { + for (Entity entity = entityIn.ridingEntity; entity != null; entity = entity.ridingEntity) { + if (entity == this) { + return; + } + } + } + + this.ridingEntity = entityIn; + entityIn.riddenByEntity = this; + } + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) { + this.setPosition(x, y, z); + this.setRotation(yaw, pitch); + List list = this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox().contract(0.03125D, 0.0D, 0.03125D)); + + if (!list.isEmpty()) { + double d0 = 0.0D; + + for (AxisAlignedBB axisalignedbb : list) { + if (axisalignedbb.maxY > d0) { + d0 = axisalignedbb.maxY; + } + } + + y = y + (d0 - this.getEntityBoundingBox().minY); + this.setPosition(x, y, z); + } + } + + public float getCollisionBorderSize() { + return 0.1F; + } + + public Vec3 getLookVec() { + return null; + } + + public void setPortal(BlockPos pos) { + if (this.timeUntilPortal > 0) { + this.timeUntilPortal = this.getPortalCooldown(); + } else { + if (!this.worldObj.isRemote && !pos.equals(this.lastPortalPos)) { + this.lastPortalPos = pos; + BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.portal.func_181089_f(this.worldObj, pos); + double d0 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? (double) blockpattern$patternhelper.getPos().getZ() : (double) blockpattern$patternhelper.getPos().getX(); + double d1 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? this.posZ : this.posX; + d1 = Math.abs(MathHelper.func_181160_c(d1 - (double) (blockpattern$patternhelper.getFinger().rotateY().getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE ? 1 : 0), d0, d0 - (double) blockpattern$patternhelper.func_181118_d())); + double d2 = MathHelper.func_181160_c(this.posY - 1.0D, (double) blockpattern$patternhelper.getPos().getY(), (double) (blockpattern$patternhelper.getPos().getY() - blockpattern$patternhelper.func_181119_e())); + this.lastPortalVec = new Vec3(d1, d2, 0.0D); + this.teleportDirection = blockpattern$patternhelper.getFinger(); + } + + this.inPortal = true; + } + } + + public int getPortalCooldown() { + return 300; + } + + public void setVelocity(double x, double y, double z) { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + } + + public void handleStatusUpdate(byte id) { + } + + public void performHurtAnimation() { + } + + public ItemStack[] getInventory() { + return null; + } + + public void setCurrentItemOrArmor(int slotIn, ItemStack stack) { + } + + public boolean isBurning() { + boolean flag = this.worldObj != null && this.worldObj.isRemote; + return !this.isImmuneToFire && (this.fire > 0 || flag && this.getFlag(0)); + } + + public boolean isRiding() { + return this.ridingEntity != null; + } + + public boolean isSneaking() { + return this.getFlag(1); + } + + public void setSneaking(boolean sneaking) { + this.setFlag(1, sneaking); + } + + public boolean isSprinting() { + return this.getFlag(3); + } + + public void setSprinting(boolean sprinting) { + this.setFlag(3, sprinting); + } + + public boolean isInvisible() { + return this.getFlag(5); + } + + public boolean isInvisibleToPlayer(EntityPlayer player) { + return player.isSpectator() ? false : this.isInvisible(); + } + + public void setInvisible(boolean invisible) { + this.setFlag(5, invisible); + } + + public boolean isEating() { + return this.getFlag(4); + } + + public void setEating(boolean eating) { + this.setFlag(4, eating); + } + + protected boolean getFlag(int flag) { + return (this.dataWatcher.getWatchableObjectByte(0) & 1 << flag) != 0; + } + + protected void setFlag(int flag, boolean set) { + byte b0 = this.dataWatcher.getWatchableObjectByte(0); + + if (set) { + this.dataWatcher.updateObject(0, Byte.valueOf((byte) (b0 | 1 << flag))); + } else { + this.dataWatcher.updateObject(0, Byte.valueOf((byte) (b0 & ~(1 << flag)))); + } + } + + public int getAir() { + return this.dataWatcher.getWatchableObjectShort(1); + } + + public void setAir(int air) { + this.dataWatcher.updateObject(1, Short.valueOf((short) air)); + } + + public void onStruckByLightning(EntityLightningBolt lightningBolt) { + this.attackEntityFrom(DamageSource.lightningBolt, 5.0F); + ++this.fire; + + if (this.fire == 0) { + this.setFire(8); + } + } + + public void onKillEntity(EntityLivingBase entityLivingIn) { + } + + protected boolean pushOutOfBlocks(double x, double y, double z) { + BlockPos blockpos = new BlockPos(x, y, z); + double d0 = x - (double) blockpos.getX(); + double d1 = y - (double) blockpos.getY(); + double d2 = z - (double) blockpos.getZ(); + List list = this.worldObj.getCollisionBoxes(this.getEntityBoundingBox()); + + if (list.isEmpty() && !this.worldObj.isBlockFullCube(blockpos)) { + return false; + } else { + int i = 3; + double d3 = 9999.0D; + + if (!this.worldObj.isBlockFullCube(blockpos.west()) && d0 < d3) { + d3 = d0; + i = 0; + } + + if (!this.worldObj.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3) { + d3 = 1.0D - d0; + i = 1; + } + + if (!this.worldObj.isBlockFullCube(blockpos.up()) && 1.0D - d1 < d3) { + d3 = 1.0D - d1; + i = 3; + } + + if (!this.worldObj.isBlockFullCube(blockpos.north()) && d2 < d3) { + d3 = d2; + i = 4; + } + + if (!this.worldObj.isBlockFullCube(blockpos.south()) && 1.0D - d2 < d3) { + d3 = 1.0D - d2; + i = 5; + } + + float f = this.rand.nextFloat() * 0.2F + 0.1F; + + if (i == 0) { + this.motionX = (double) (-f); + } + + if (i == 1) { + this.motionX = (double) f; + } + + if (i == 3) { + this.motionY = (double) f; + } + + if (i == 4) { + this.motionZ = (double) (-f); + } + + if (i == 5) { + this.motionZ = (double) f; + } + + return true; + } + } + + public void setInWeb() { + this.isInWeb = true; + this.fallDistance = 0.0F; + } + + public String getName() { + if (this.hasCustomName()) { + return this.getCustomNameTag(); + } else { + String s = EntityList.getEntityString(this); + + if (s == null) { + s = "generic"; + } + + return StatCollector.translateToLocal("entity." + s + ".name"); + } + } + + public Entity[] getParts() { + return null; + } + + public boolean isEntityEqual(Entity entityIn) { + return this == entityIn; + } + + public float getRotationYawHead() { + return 0.0F; + } + + public void setRotationYawHead(float rotation) { + } + + public void setRenderYawOffset(float offset) { + } + + public boolean canAttackWithItem() { + return true; + } + + public boolean hitByEntity(Entity entityIn) { + return false; + } + + public String toString() { + return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[]{this.getClass().getSimpleName(), this.getName(), Integer.valueOf(this.entityId), this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}); + } + + public boolean isEntityInvulnerable(DamageSource source) { + return this.invulnerable && source != DamageSource.outOfWorld && !source.isCreativePlayer(); + } + + public void copyLocationAndAnglesFrom(Entity entityIn) { + this.setLocationAndAngles(entityIn.posX, entityIn.posY, entityIn.posZ, entityIn.rotationYaw, entityIn.rotationPitch); + } + + public void copyDataFromOld(Entity entityIn) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + entityIn.writeToNBT(nbttagcompound); + this.readFromNBT(nbttagcompound); + this.timeUntilPortal = entityIn.timeUntilPortal; + this.lastPortalPos = entityIn.lastPortalPos; + this.lastPortalVec = entityIn.lastPortalVec; + this.teleportDirection = entityIn.teleportDirection; + } + + public void travelToDimension(int dimensionId) { + if (!this.worldObj.isRemote && !this.isDead) { + this.worldObj.theProfiler.startSection("changeDimension"); + MinecraftServer minecraftserver = MinecraftServer.getServer(); + int i = this.dimension; + WorldServer worldserver = minecraftserver.worldServerForDimension(i); + WorldServer worldserver1 = minecraftserver.worldServerForDimension(dimensionId); + this.dimension = dimensionId; + + if (i == 1 && dimensionId == 1) { + worldserver1 = minecraftserver.worldServerForDimension(0); + this.dimension = 0; + } + + this.worldObj.removeEntity(this); + this.isDead = false; + this.worldObj.theProfiler.startSection("reposition"); + minecraftserver.getConfigurationManager().transferEntityToWorld(this, i, worldserver, worldserver1); + this.worldObj.theProfiler.endStartSection("reloading"); + Entity entity = EntityList.createEntityByName(EntityList.getEntityString(this), worldserver1); + + if (entity != null) { + entity.copyDataFromOld(this); + + if (i == 1 && dimensionId == 1) { + BlockPos blockpos = this.worldObj.getTopSolidOrLiquidBlock(worldserver1.getSpawnPoint()); + entity.moveToBlockPosAndAngles(blockpos, entity.rotationYaw, entity.rotationPitch); + } + + worldserver1.spawnEntityInWorld(entity); + } + + this.isDead = true; + this.worldObj.theProfiler.endSection(); + worldserver.resetUpdateEntityTick(); + worldserver1.resetUpdateEntityTick(); + this.worldObj.theProfiler.endSection(); + } + } + + public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { + return blockStateIn.getBlock().getExplosionResistance(this); + } + + public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) { + return true; + } + + public int getMaxFallHeight() { + return 3; + } + + public Vec3 func_181014_aG() { + return this.lastPortalVec; + } + + public EnumFacing getTeleportDirection() { + return this.teleportDirection; + } + + public boolean doesEntityNotTriggerPressurePlate() { + return false; + } + + public void addEntityCrashInfo(CrashReportCategory category) { + category.addCrashSectionCallable("Entity Type", new Callable() { + public String call() throws Exception { + return EntityList.getEntityString(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")"; + } + }); + category.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); + category.addCrashSectionCallable("Entity Name", new Callable() { + public String call() throws Exception { + return Entity.this.getName(); + } + }); + category.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)})); + category.addCrashSection("Entity\'s Block location", CrashReportCategory.getCoordinateInfo((double) MathHelper.floor_double(this.posX), (double) MathHelper.floor_double(this.posY), (double) MathHelper.floor_double(this.posZ))); + category.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)})); + category.addCrashSectionCallable("Entity\'s Rider", new Callable() { + public String call() throws Exception { + return Entity.this.riddenByEntity.toString(); + } + }); + category.addCrashSectionCallable("Entity\'s Vehicle", new Callable() { + public String call() throws Exception { + return Entity.this.ridingEntity.toString(); + } + }); + } + + public boolean canRenderOnFire() { + return this.isBurning(); + } + + public UUID getUniqueID() { + return this.entityUniqueID; + } + + public boolean isPushedByWater() { + return true; + } + + public IChatComponent getDisplayName() { + ChatComponentText chatcomponenttext = new ChatComponentText(this.getName()); + chatcomponenttext.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttext.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttext; + } + + public void setCustomNameTag(String name) { + this.dataWatcher.updateObject(2, name); + } + + public String getCustomNameTag() { + return this.dataWatcher.getWatchableObjectString(2); + } + + public boolean hasCustomName() { + return this.dataWatcher.getWatchableObjectString(2).length() > 0; + } + + public void setAlwaysRenderNameTag(boolean alwaysRenderNameTag) { + this.dataWatcher.updateObject(3, Byte.valueOf((byte) (alwaysRenderNameTag ? 1 : 0))); + } + + public boolean getAlwaysRenderNameTag() { + return this.dataWatcher.getWatchableObjectByte(3) == 1; + } + + public void setPositionAndUpdate(double x, double y, double z) { + this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch); + } + + public boolean getAlwaysRenderNameTagForRender() { + return this.getAlwaysRenderNameTag(); + } + + public void onDataWatcherUpdate(int dataID) { + } + + public EnumFacing getHorizontalFacing() { + return EnumFacing.getHorizontal(MathHelper.floor_double((double) (this.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3); + } + + protected HoverEvent getHoverEvent() { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + String s = EntityList.getEntityString(this); + nbttagcompound.setString("id", this.getUniqueID().toString()); + + if (s != null) { + nbttagcompound.setString("type", s); + } + + nbttagcompound.setString("name", this.getName()); + return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new ChatComponentText(nbttagcompound.toString())); + } + + public boolean isSpectatedByPlayer(EntityPlayerMP player) { + return true; + } + + public AxisAlignedBB getEntityBoundingBox() { + return this.boundingBox; + } + + public void setEntityBoundingBox(AxisAlignedBB bb) { + this.boundingBox = bb; + } + + public float getEyeHeight() { + return this.height * 0.85F; + } + + public boolean isOutsideBorder() { + return this.isOutsideBorder; + } + + public void setOutsideBorder(boolean outsideBorder) { + this.isOutsideBorder = outsideBorder; + } + + public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn) { + return false; + } + + public void addChatMessage(IChatComponent component) { + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) { + return true; + } + + public BlockPos getPosition() { + return new BlockPos(this.posX, this.posY + 0.5D, this.posZ); + } + + public Vec3 getPositionVector() { + return new Vec3(this.posX, this.posY, this.posZ); + } + + public World getEntityWorld() { + return this.worldObj; + } + + public Entity getCommandSenderEntity() { + return this; + } + + public boolean sendCommandFeedback() { + return false; + } + + public void setCommandStat(CommandResultStats.Type type, int amount) { + this.cmdResultStats.setCommandStatScore(this, type, amount); + } + + public CommandResultStats getCommandStats() { + return this.cmdResultStats; + } + + public void setCommandStats(Entity entityIn) { + this.cmdResultStats.addAllStats(entityIn.getCommandStats()); + } + + public NBTTagCompound getNBTTagCompound() { + return null; + } + + public void clientUpdateEntityNBT(NBTTagCompound compound) { + } + + public boolean interactAt(EntityPlayer player, Vec3 targetVec3) { + return false; + } + + public boolean isImmuneToExplosions() { + return false; + } + + protected void applyEnchantments(EntityLivingBase entityLivingBaseIn, Entity entityIn) { + if (entityIn instanceof EntityLivingBase) { + EnchantmentHelper.applyThornEnchantments((EntityLivingBase) entityIn, entityLivingBaseIn); + } + + EnchantmentHelper.applyArthropodEnchantments(entityLivingBaseIn, entityIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityAgeable.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityAgeable.java new file mode 100644 index 0000000..0e52f90 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityAgeable.java @@ -0,0 +1,214 @@ +package net.minecraft.entity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityAgeable extends EntityCreature +{ + protected int growingAge; + protected int field_175502_b; + protected int field_175503_c; + private float ageWidth = -1.0F; + private float ageHeight; + + public EntityAgeable(World worldIn) + { + super(worldIn); + } + + public abstract EntityAgeable createChild(EntityAgeable ageable); + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.spawn_egg) + { + if (!this.worldObj.isRemote) + { + Class oclass = EntityList.getClassFromID(itemstack.getMetadata()); + + if (oclass != null && this.getClass() == oclass) + { + EntityAgeable entityageable = this.createChild(this); + + if (entityageable != null) + { + entityageable.setGrowingAge(-24000); + entityageable.setLocationAndAngles(this.posX, this.posY, this.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityageable); + + if (itemstack.hasDisplayName()) + { + entityageable.setCustomNameTag(itemstack.getDisplayName()); + } + + if (!player.capabilities.isCreativeMode) + { + --itemstack.stackSize; + + if (itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(12, Byte.valueOf((byte)0)); + } + + public int getGrowingAge() + { + return this.worldObj.isRemote ? this.dataWatcher.getWatchableObjectByte(12) : this.growingAge; + } + + public void func_175501_a(int p_175501_1_, boolean p_175501_2_) + { + int i = this.getGrowingAge(); + int j = i; + i = i + p_175501_1_ * 20; + + if (i > 0) + { + i = 0; + + if (j < 0) + { + this.onGrowingAdult(); + } + } + + int k = i - j; + this.setGrowingAge(i); + + if (p_175501_2_) + { + this.field_175502_b += k; + + if (this.field_175503_c == 0) + { + this.field_175503_c = 40; + } + } + + if (this.getGrowingAge() == 0) + { + this.setGrowingAge(this.field_175502_b); + } + } + + public void addGrowth(int growth) + { + this.func_175501_a(growth, false); + } + + public void setGrowingAge(int age) + { + this.dataWatcher.updateObject(12, Byte.valueOf((byte)MathHelper.clamp_int(age, -1, 1))); + this.growingAge = age; + this.setScaleForAge(this.isChild()); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Age", this.getGrowingAge()); + tagCompound.setInteger("ForcedAge", this.field_175502_b); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setGrowingAge(tagCompund.getInteger("Age")); + this.field_175502_b = tagCompund.getInteger("ForcedAge"); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.worldObj.isRemote) + { + if (this.field_175503_c > 0) + { + if (this.field_175503_c % 4 == 0) + { + this.worldObj.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D, new int[0]); + } + + --this.field_175503_c; + } + + this.setScaleForAge(this.isChild()); + } + else + { + int i = this.getGrowingAge(); + + if (i < 0) + { + ++i; + this.setGrowingAge(i); + + if (i == 0) + { + this.onGrowingAdult(); + } + } + else if (i > 0) + { + --i; + this.setGrowingAge(i); + } + } + } + + protected void onGrowingAdult() + { + } + + public boolean isChild() + { + return this.getGrowingAge() < 0; + } + + public void setScaleForAge(boolean p_98054_1_) + { + this.setScale(p_98054_1_ ? 0.5F : 1.0F); + } + + protected final void setSize(float width, float height) + { + boolean flag = this.ageWidth > 0.0F; + this.ageWidth = width; + this.ageHeight = height; + + if (!flag) + { + this.setScale(1.0F); + } + } + + protected final void setScale(float scale) + { + super.setSize(this.ageWidth * scale, this.ageHeight * scale); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityBodyHelper.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityBodyHelper.java new file mode 100644 index 0000000..2e08f29 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityBodyHelper.java @@ -0,0 +1,68 @@ +package net.minecraft.entity; + +import net.minecraft.util.MathHelper; + +public class EntityBodyHelper +{ + private EntityLivingBase theLiving; + private int rotationTickCounter; + private float prevRenderYawHead; + + public EntityBodyHelper(EntityLivingBase p_i1611_1_) + { + this.theLiving = p_i1611_1_; + } + + public void updateRenderAngles() + { + double d0 = this.theLiving.posX - this.theLiving.prevPosX; + double d1 = this.theLiving.posZ - this.theLiving.prevPosZ; + + if (d0 * d0 + d1 * d1 > 2.500000277905201E-7D) + { + this.theLiving.renderYawOffset = this.theLiving.rotationYaw; + this.theLiving.rotationYawHead = this.computeAngleWithBound(this.theLiving.renderYawOffset, this.theLiving.rotationYawHead, 75.0F); + this.prevRenderYawHead = this.theLiving.rotationYawHead; + this.rotationTickCounter = 0; + } + else + { + float f = 75.0F; + + if (Math.abs(this.theLiving.rotationYawHead - this.prevRenderYawHead) > 15.0F) + { + this.rotationTickCounter = 0; + this.prevRenderYawHead = this.theLiving.rotationYawHead; + } + else + { + ++this.rotationTickCounter; + int i = 10; + + if (this.rotationTickCounter > 10) + { + f = Math.max(1.0F - (float)(this.rotationTickCounter - 10) / 10.0F, 0.0F) * 75.0F; + } + } + + this.theLiving.renderYawOffset = this.computeAngleWithBound(this.theLiving.rotationYawHead, this.theLiving.renderYawOffset, f); + } + } + + private float computeAngleWithBound(float p_75665_1_, float p_75665_2_, float p_75665_3_) + { + float f = MathHelper.wrapAngleTo180_float(p_75665_1_ - p_75665_2_); + + if (f < -p_75665_3_) + { + f = -p_75665_3_; + } + + if (f >= p_75665_3_) + { + f = p_75665_3_; + } + + return p_75665_1_ - f; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityCreature.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityCreature.java new file mode 100644 index 0000000..e5387f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityCreature.java @@ -0,0 +1,148 @@ +package net.minecraft.entity; + +import java.util.UUID; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public abstract class EntityCreature extends EntityLiving +{ + public static final UUID FLEEING_SPEED_MODIFIER_UUID = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); + public static final AttributeModifier FLEEING_SPEED_MODIFIER = (new AttributeModifier(FLEEING_SPEED_MODIFIER_UUID, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); + private BlockPos homePosition = BlockPos.ORIGIN; + private float maximumHomeDistance = -1.0F; + private EntityAIBase aiBase = new EntityAIMoveTowardsRestriction(this, 1.0D); + private boolean isMovementAITaskSet; + + public EntityCreature(World worldIn) + { + super(worldIn); + } + + public float getBlockPathWeight(BlockPos pos) + { + return 0.0F; + } + + public boolean getCanSpawnHere() + { + return super.getCanSpawnHere() && this.getBlockPathWeight(new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ)) >= 0.0F; + } + + public boolean hasPath() + { + return !this.navigator.noPath(); + } + + public boolean isWithinHomeDistanceCurrentPosition() + { + return this.isWithinHomeDistanceFromPosition(new BlockPos(this)); + } + + public boolean isWithinHomeDistanceFromPosition(BlockPos pos) + { + return this.maximumHomeDistance == -1.0F ? true : this.homePosition.distanceSq(pos) < (double)(this.maximumHomeDistance * this.maximumHomeDistance); + } + + public void setHomePosAndDistance(BlockPos pos, int distance) + { + this.homePosition = pos; + this.maximumHomeDistance = (float)distance; + } + + public BlockPos getHomePosition() + { + return this.homePosition; + } + + public float getMaximumHomeDistance() + { + return this.maximumHomeDistance; + } + + public void detachHome() + { + this.maximumHomeDistance = -1.0F; + } + + public boolean hasHome() + { + return this.maximumHomeDistance != -1.0F; + } + + protected void updateLeashedState() + { + super.updateLeashedState(); + + if (this.getLeashed() && this.getLeashedToEntity() != null && this.getLeashedToEntity().worldObj == this.worldObj) + { + Entity entity = this.getLeashedToEntity(); + this.setHomePosAndDistance(new BlockPos((int)entity.posX, (int)entity.posY, (int)entity.posZ), 5); + float f = this.getDistanceToEntity(entity); + + if (this instanceof EntityTameable && ((EntityTameable)this).isSitting()) + { + if (f > 10.0F) + { + this.clearLeashed(true, true); + } + + return; + } + + if (!this.isMovementAITaskSet) + { + this.tasks.addTask(2, this.aiBase); + + if (this.getNavigator() instanceof PathNavigateGround) + { + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(false); + } + + this.isMovementAITaskSet = true; + } + + this.func_142017_o(f); + + if (f > 4.0F) + { + this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); + } + + if (f > 6.0F) + { + double d0 = (entity.posX - this.posX) / (double)f; + double d1 = (entity.posY - this.posY) / (double)f; + double d2 = (entity.posZ - this.posZ) / (double)f; + this.motionX += d0 * Math.abs(d0) * 0.4D; + this.motionY += d1 * Math.abs(d1) * 0.4D; + this.motionZ += d2 * Math.abs(d2) * 0.4D; + } + + if (f > 10.0F) + { + this.clearLeashed(true, true); + } + } + else if (!this.getLeashed() && this.isMovementAITaskSet) + { + this.isMovementAITaskSet = false; + this.tasks.removeTask(this.aiBase); + + if (this.getNavigator() instanceof PathNavigateGround) + { + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + } + + this.detachHome(); + } + } + + protected void func_142017_o(float p_142017_1_) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityFlying.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityFlying.java new file mode 100644 index 0000000..4fd1b73 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityFlying.java @@ -0,0 +1,83 @@ +package net.minecraft.entity; + +import net.minecraft.block.Block; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityFlying extends EntityLiving +{ + public EntityFlying(World worldIn) + { + super(worldIn); + } + + public void fall(float distance, float damageMultiplier) + { + } + + protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos) + { + } + + public void moveEntityWithHeading(float strafe, float forward) + { + if (this.isInWater()) + { + this.moveFlying(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + } + else if (this.isInLava()) + { + this.moveFlying(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + else + { + float f = 0.91F; + + if (this.onGround) + { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + float f1 = 0.16277136F / (f * f * f); + this.moveFlying(strafe, forward, this.onGround ? 0.1F * f1 : 0.02F); + f = 0.91F; + + if (this.onGround) + { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= (double)f; + this.motionY *= (double)f; + this.motionZ *= (double)f; + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d1 = this.posX - this.prevPosX; + double d0 = this.posZ - this.prevPosZ; + float f2 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + this.limbSwingAmount += (f2 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + public boolean isOnLadder() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityHanging.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityHanging.java new file mode 100644 index 0000000..7e66cee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityHanging.java @@ -0,0 +1,258 @@ +package net.minecraft.entity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockRedstoneDiode; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import org.apache.commons.lang3.Validate; + +public abstract class EntityHanging extends Entity +{ + private int tickCounter1; + protected BlockPos hangingPosition; + public EnumFacing facingDirection; + + public EntityHanging(World worldIn) + { + super(worldIn); + this.setSize(0.5F, 0.5F); + } + + public EntityHanging(World worldIn, BlockPos hangingPositionIn) + { + this(worldIn); + this.hangingPosition = hangingPositionIn; + } + + protected void entityInit() + { + } + + protected void updateFacingWithBoundingBox(EnumFacing facingDirectionIn) + { + Validate.notNull(facingDirectionIn); + Validate.isTrue(facingDirectionIn.getAxis().isHorizontal()); + this.facingDirection = facingDirectionIn; + this.prevRotationYaw = this.rotationYaw = (float)(this.facingDirection.getHorizontalIndex() * 90); + this.updateBoundingBox(); + } + + private void updateBoundingBox() + { + if (this.facingDirection != null) + { + double d0 = (double)this.hangingPosition.getX() + 0.5D; + double d1 = (double)this.hangingPosition.getY() + 0.5D; + double d2 = (double)this.hangingPosition.getZ() + 0.5D; + double d3 = 0.46875D; + double d4 = this.func_174858_a(this.getWidthPixels()); + double d5 = this.func_174858_a(this.getHeightPixels()); + d0 = d0 - (double)this.facingDirection.getFrontOffsetX() * 0.46875D; + d2 = d2 - (double)this.facingDirection.getFrontOffsetZ() * 0.46875D; + d1 = d1 + d5; + EnumFacing enumfacing = this.facingDirection.rotateYCCW(); + d0 = d0 + d4 * (double)enumfacing.getFrontOffsetX(); + d2 = d2 + d4 * (double)enumfacing.getFrontOffsetZ(); + this.posX = d0; + this.posY = d1; + this.posZ = d2; + double d6 = (double)this.getWidthPixels(); + double d7 = (double)this.getHeightPixels(); + double d8 = (double)this.getWidthPixels(); + + if (this.facingDirection.getAxis() == EnumFacing.Axis.Z) + { + d8 = 1.0D; + } + else + { + d6 = 1.0D; + } + + d6 = d6 / 32.0D; + d7 = d7 / 32.0D; + d8 = d8 / 32.0D; + this.setEntityBoundingBox(new AxisAlignedBB(d0 - d6, d1 - d7, d2 - d8, d0 + d6, d1 + d7, d2 + d8)); + } + } + + private double func_174858_a(int p_174858_1_) + { + return p_174858_1_ % 32 == 0 ? 0.5D : 0.0D; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.tickCounter1++ == 100 && !this.worldObj.isRemote) + { + this.tickCounter1 = 0; + + if (!this.isDead && !this.onValidSurface()) + { + this.setDead(); + this.onBroken((Entity)null); + } + } + } + + public boolean onValidSurface() + { + if (!this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty()) + { + return false; + } + else + { + int i = Math.max(1, this.getWidthPixels() / 16); + int j = Math.max(1, this.getHeightPixels() / 16); + BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite()); + EnumFacing enumfacing = this.facingDirection.rotateYCCW(); + + for (int k = 0; k < i; ++k) + { + for (int l = 0; l < j; ++l) + { + BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l); + Block block = this.worldObj.getBlockState(blockpos1).getBlock(); + + if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block)) + { + return false; + } + } + } + + for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox())) + { + if (entity instanceof EntityHanging) + { + return false; + } + } + + return true; + } + } + + public boolean canBeCollidedWith() + { + return true; + } + + public boolean hitByEntity(Entity entityIn) + { + return entityIn instanceof EntityPlayer ? this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)entityIn), 0.0F) : false; + } + + public EnumFacing getHorizontalFacing() + { + return this.facingDirection; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + if (!this.isDead && !this.worldObj.isRemote) + { + this.setDead(); + this.setBeenAttacked(); + this.onBroken(source.getEntity()); + } + + return true; + } + } + + public void moveEntity(double x, double y, double z) + { + if (!this.worldObj.isRemote && !this.isDead && x * x + y * y + z * z > 0.0D) + { + this.setDead(); + this.onBroken((Entity)null); + } + } + + public void addVelocity(double x, double y, double z) + { + if (!this.worldObj.isRemote && !this.isDead && x * x + y * y + z * z > 0.0D) + { + this.setDead(); + this.onBroken((Entity)null); + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setByte("Facing", (byte)this.facingDirection.getHorizontalIndex()); + tagCompound.setInteger("TileX", this.getHangingPosition().getX()); + tagCompound.setInteger("TileY", this.getHangingPosition().getY()); + tagCompound.setInteger("TileZ", this.getHangingPosition().getZ()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.hangingPosition = new BlockPos(tagCompund.getInteger("TileX"), tagCompund.getInteger("TileY"), tagCompund.getInteger("TileZ")); + EnumFacing enumfacing; + + if (tagCompund.hasKey("Direction", 99)) + { + enumfacing = EnumFacing.getHorizontal(tagCompund.getByte("Direction")); + this.hangingPosition = this.hangingPosition.offset(enumfacing); + } + else if (tagCompund.hasKey("Facing", 99)) + { + enumfacing = EnumFacing.getHorizontal(tagCompund.getByte("Facing")); + } + else + { + enumfacing = EnumFacing.getHorizontal(tagCompund.getByte("Dir")); + } + + this.updateFacingWithBoundingBox(enumfacing); + } + + public abstract int getWidthPixels(); + + public abstract int getHeightPixels(); + + public abstract void onBroken(Entity brokenEntity); + + protected boolean shouldSetPosAfterLoading() + { + return false; + } + + public void setPosition(double x, double y, double z) + { + this.posX = x; + this.posY = y; + this.posZ = z; + BlockPos blockpos = this.hangingPosition; + this.hangingPosition = new BlockPos(x, y, z); + + if (!this.hangingPosition.equals(blockpos)) + { + this.updateBoundingBox(); + this.isAirBorne = true; + } + } + + public BlockPos getHangingPosition() + { + return this.hangingPosition; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLeashKnot.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLeashKnot.java new file mode 100644 index 0000000..063e278 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLeashKnot.java @@ -0,0 +1,145 @@ +package net.minecraft.entity; + +import net.minecraft.block.BlockFence; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class EntityLeashKnot extends EntityHanging +{ + public EntityLeashKnot(World worldIn) + { + super(worldIn); + } + + public EntityLeashKnot(World worldIn, BlockPos hangingPositionIn) + { + super(worldIn, hangingPositionIn); + this.setPosition((double)hangingPositionIn.getX() + 0.5D, (double)hangingPositionIn.getY() + 0.5D, (double)hangingPositionIn.getZ() + 0.5D); + float f = 0.125F; + float f1 = 0.1875F; + float f2 = 0.25F; + this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.1875D, this.posY - 0.25D + 0.125D, this.posZ - 0.1875D, this.posX + 0.1875D, this.posY + 0.25D + 0.125D, this.posZ + 0.1875D)); + } + + protected void entityInit() + { + super.entityInit(); + } + + public void updateFacingWithBoundingBox(EnumFacing facingDirectionIn) + { + } + + public int getWidthPixels() + { + return 9; + } + + public int getHeightPixels() + { + return 9; + } + + public float getEyeHeight() + { + return -0.0625F; + } + + public boolean isInRangeToRenderDist(double distance) + { + return distance < 1024.0D; + } + + public void onBroken(Entity brokenEntity) + { + } + + public boolean writeToNBTOptional(NBTTagCompound tagCompund) + { + return false; + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + } + + public boolean interactFirst(EntityPlayer playerIn) + { + ItemStack itemstack = playerIn.getHeldItem(); + boolean flag = false; + + if (itemstack != null && itemstack.getItem() == Items.lead && !this.worldObj.isRemote) + { + double d0 = 7.0D; + + for (EntityLiving entityliving : this.worldObj.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + d0, this.posZ + d0))) + { + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == playerIn) + { + entityliving.setLeashedToEntity(this, true); + flag = true; + } + } + } + + if (!this.worldObj.isRemote && !flag) + { + this.setDead(); + + if (playerIn.capabilities.isCreativeMode) + { + double d1 = 7.0D; + + for (EntityLiving entityliving1 : this.worldObj.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(this.posX - d1, this.posY - d1, this.posZ - d1, this.posX + d1, this.posY + d1, this.posZ + d1))) + { + if (entityliving1.getLeashed() && entityliving1.getLeashedToEntity() == this) + { + entityliving1.clearLeashed(true, false); + } + } + } + } + + return true; + } + + public boolean onValidSurface() + { + return this.worldObj.getBlockState(this.hangingPosition).getBlock() instanceof BlockFence; + } + + public static EntityLeashKnot createKnot(World worldIn, BlockPos fence) + { + EntityLeashKnot entityleashknot = new EntityLeashKnot(worldIn, fence); + entityleashknot.forceSpawn = true; + worldIn.spawnEntityInWorld(entityleashknot); + return entityleashknot; + } + + public static EntityLeashKnot getKnotForPosition(World worldIn, BlockPos pos) + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + + for (EntityLeashKnot entityleashknot : worldIn.getEntitiesWithinAABB(EntityLeashKnot.class, new AxisAlignedBB((double)i - 1.0D, (double)j - 1.0D, (double)k - 1.0D, (double)i + 1.0D, (double)j + 1.0D, (double)k + 1.0D))) + { + if (entityleashknot.getHangingPosition().equals(pos)) + { + return entityleashknot; + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityList.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityList.java new file mode 100644 index 0000000..f761831 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityList.java @@ -0,0 +1,358 @@ +package net.minecraft.entity; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.entity.item.EntityMinecartEmpty; +import net.minecraft.entity.item.EntityMinecartFurnace; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.item.EntityMinecartTNT; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCaveSpider; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntityEndermite; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityGiantZombie; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityList +{ + private static final Logger logger = LogManager.getLogger(); + private static final Map < String, Class > stringToClassMapping = Maps. < String, Class > newHashMap(); + private static final Map < Class , String > classToStringMapping = Maps. < Class , String > newHashMap(); + private static final Map < Integer, Class > idToClassMapping = Maps. < Integer, Class > newHashMap(); + private static final Map < Class , Integer > classToIDMapping = Maps. < Class , Integer > newHashMap(); + private static final Map stringToIDMapping = Maps.newHashMap(); + public static final Map entityEggs = Maps.newLinkedHashMap(); + + private static void addMapping(Class entityClass, String entityName, int id) + { + if (stringToClassMapping.containsKey(entityName)) + { + throw new IllegalArgumentException("ID is already registered: " + entityName); + } + else if (idToClassMapping.containsKey(Integer.valueOf(id))) + { + throw new IllegalArgumentException("ID is already registered: " + id); + } + else if (id == 0) + { + throw new IllegalArgumentException("Cannot register to reserved id: " + id); + } + else if (entityClass == null) + { + throw new IllegalArgumentException("Cannot register null clazz for id: " + id); + } + else + { + stringToClassMapping.put(entityName, entityClass); + classToStringMapping.put(entityClass, entityName); + idToClassMapping.put(Integer.valueOf(id), entityClass); + classToIDMapping.put(entityClass, Integer.valueOf(id)); + stringToIDMapping.put(entityName, Integer.valueOf(id)); + } + } + + private static void addMapping(Class entityClass, String entityName, int entityID, int baseColor, int spotColor) + { + addMapping(entityClass, entityName, entityID); + entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, baseColor, spotColor)); + } + + public static Entity createEntityByName(String entityName, World worldIn) + { + Entity entity = null; + + try + { + Class oclass = (Class)stringToClassMapping.get(entityName); + + if (oclass != null) + { + entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + return entity; + } + + public static Entity createEntityFromNBT(NBTTagCompound nbt, World worldIn) + { + Entity entity = null; + + if ("Minecart".equals(nbt.getString("id"))) + { + nbt.setString("id", EntityMinecart.EnumMinecartType.byNetworkID(nbt.getInteger("Type")).getName()); + nbt.removeTag("Type"); + } + + try + { + Class oclass = (Class)stringToClassMapping.get(nbt.getString("id")); + + if (oclass != null) + { + entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + if (entity != null) + { + entity.readFromNBT(nbt); + } + else + { + logger.warn("Skipping Entity with id " + nbt.getString("id")); + } + + return entity; + } + + public static Entity createEntityByID(int entityID, World worldIn) + { + Entity entity = null; + + try + { + Class oclass = getClassFromID(entityID); + + if (oclass != null) + { + entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + if (entity == null) + { + logger.warn("Skipping Entity with id " + entityID); + } + + return entity; + } + + public static int getEntityID(Entity entityIn) + { + Integer integer = (Integer)classToIDMapping.get(entityIn.getClass()); + return integer == null ? 0 : integer.intValue(); + } + + public static Class getClassFromID(int entityID) + { + return (Class)idToClassMapping.get(Integer.valueOf(entityID)); + } + + public static String getEntityString(Entity entityIn) + { + return (String)classToStringMapping.get(entityIn.getClass()); + } + + public static int getIDFromString(String entityName) + { + Integer integer = (Integer)stringToIDMapping.get(entityName); + return integer == null ? 90 : integer.intValue(); + } + + public static String getStringFromID(int entityID) + { + return (String)classToStringMapping.get(getClassFromID(entityID)); + } + + public static void func_151514_a() + { + } + + public static List getEntityNameList() + { + Set set = stringToClassMapping.keySet(); + List list = Lists.newArrayList(); + + for (String s : set) + { + Class oclass = (Class)stringToClassMapping.get(s); + + if ((oclass.getModifiers() & 1024) != 1024) + { + list.add(s); + } + } + + list.add("LightningBolt"); + return list; + } + + public static boolean isStringEntityName(Entity entityIn, String entityName) + { + String s = getEntityString(entityIn); + + if (s == null && entityIn instanceof EntityPlayer) + { + s = "Player"; + } + else if (s == null && entityIn instanceof EntityLightningBolt) + { + s = "LightningBolt"; + } + + return entityName.equals(s); + } + + public static boolean isStringValidEntityName(String entityName) + { + return "Player".equals(entityName) || getEntityNameList().contains(entityName); + } + + static + { + addMapping(EntityItem.class, "Item", 1); + addMapping(EntityXPOrb.class, "XPOrb", 2); + addMapping(EntityEgg.class, "ThrownEgg", 7); + addMapping(EntityLeashKnot.class, "LeashKnot", 8); + addMapping(EntityPainting.class, "Painting", 9); + addMapping(EntityArrow.class, "Arrow", 10); + addMapping(EntitySnowball.class, "Snowball", 11); + addMapping(EntityLargeFireball.class, "Fireball", 12); + addMapping(EntitySmallFireball.class, "SmallFireball", 13); + addMapping(EntityEnderPearl.class, "ThrownEnderpearl", 14); + addMapping(EntityEnderEye.class, "EyeOfEnderSignal", 15); + addMapping(EntityPotion.class, "ThrownPotion", 16); + addMapping(EntityExpBottle.class, "ThrownExpBottle", 17); + addMapping(EntityItemFrame.class, "ItemFrame", 18); + addMapping(EntityWitherSkull.class, "WitherSkull", 19); + addMapping(EntityTNTPrimed.class, "PrimedTnt", 20); + addMapping(EntityFallingBlock.class, "FallingSand", 21); + addMapping(EntityFireworkRocket.class, "FireworksRocketEntity", 22); + addMapping(EntityArmorStand.class, "ArmorStand", 30); + addMapping(EntityBoat.class, "Boat", 41); + addMapping(EntityMinecartEmpty.class, EntityMinecart.EnumMinecartType.RIDEABLE.getName(), 42); + addMapping(EntityMinecartChest.class, EntityMinecart.EnumMinecartType.CHEST.getName(), 43); + addMapping(EntityMinecartFurnace.class, EntityMinecart.EnumMinecartType.FURNACE.getName(), 44); + addMapping(EntityMinecartTNT.class, EntityMinecart.EnumMinecartType.TNT.getName(), 45); + addMapping(EntityMinecartHopper.class, EntityMinecart.EnumMinecartType.HOPPER.getName(), 46); + addMapping(EntityMinecartMobSpawner.class, EntityMinecart.EnumMinecartType.SPAWNER.getName(), 47); + addMapping(EntityMinecartCommandBlock.class, EntityMinecart.EnumMinecartType.COMMAND_BLOCK.getName(), 40); + addMapping(EntityLiving.class, "Mob", 48); + addMapping(EntityMob.class, "Monster", 49); + addMapping(EntityCreeper.class, "Creeper", 50, 894731, 0); + addMapping(EntitySkeleton.class, "Skeleton", 51, 12698049, 4802889); + addMapping(EntitySpider.class, "Spider", 52, 3419431, 11013646); + addMapping(EntityGiantZombie.class, "Giant", 53); + addMapping(EntityZombie.class, "Zombie", 54, 44975, 7969893); + addMapping(EntitySlime.class, "Slime", 55, 5349438, 8306542); + addMapping(EntityGhast.class, "Ghast", 56, 16382457, 12369084); + addMapping(EntityPigZombie.class, "PigZombie", 57, 15373203, 5009705); + addMapping(EntityEnderman.class, "Enderman", 58, 1447446, 0); + addMapping(EntityCaveSpider.class, "CaveSpider", 59, 803406, 11013646); + addMapping(EntitySilverfish.class, "Silverfish", 60, 7237230, 3158064); + addMapping(EntityBlaze.class, "Blaze", 61, 16167425, 16775294); + addMapping(EntityMagmaCube.class, "LavaSlime", 62, 3407872, 16579584); + addMapping(EntityDragon.class, "EnderDragon", 63); + addMapping(EntityWither.class, "WitherBoss", 64); + addMapping(EntityBat.class, "Bat", 65, 4996656, 986895); + addMapping(EntityWitch.class, "Witch", 66, 3407872, 5349438); + addMapping(EntityEndermite.class, "Endermite", 67, 1447446, 7237230); + addMapping(EntityGuardian.class, "Guardian", 68, 5931634, 15826224); + addMapping(EntityPig.class, "Pig", 90, 15771042, 14377823); + addMapping(EntitySheep.class, "Sheep", 91, 15198183, 16758197); + addMapping(EntityCow.class, "Cow", 92, 4470310, 10592673); + addMapping(EntityChicken.class, "Chicken", 93, 10592673, 16711680); + addMapping(EntitySquid.class, "Squid", 94, 2243405, 7375001); + addMapping(EntityWolf.class, "Wolf", 95, 14144467, 13545366); + addMapping(EntityMooshroom.class, "MushroomCow", 96, 10489616, 12040119); + addMapping(EntitySnowman.class, "SnowMan", 97); + addMapping(EntityOcelot.class, "Ozelot", 98, 15720061, 5653556); + addMapping(EntityIronGolem.class, "VillagerGolem", 99); + addMapping(EntityHorse.class, "EntityHorse", 100, 12623485, 15656192); + addMapping(EntityRabbit.class, "Rabbit", 101, 10051392, 7555121); + addMapping(EntityVillager.class, "Villager", 120, 5651507, 12422002); + addMapping(EntityEnderCrystal.class, "EnderCrystal", 200); + } + + public static class EntityEggInfo + { + public final int spawnedID; + public final int primaryColor; + public final int secondaryColor; + public final StatBase field_151512_d; + public final StatBase field_151513_e; + + public EntityEggInfo(int id, int baseColor, int spotColor) + { + this.spawnedID = id; + this.primaryColor = baseColor; + this.secondaryColor = spotColor; + this.field_151512_d = StatList.getStatKillEntity(this); + this.field_151513_e = StatList.getStatEntityKilledBy(this); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLiving.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLiving.java new file mode 100644 index 0000000..d273275 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLiving.java @@ -0,0 +1,1401 @@ +package net.minecraft.entity; + +import java.util.UUID; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.ai.EntityAITasks; +import net.minecraft.entity.ai.EntityJumpHelper; +import net.minecraft.entity.ai.EntityLookHelper; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.ai.EntitySenses; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.scoreboard.Team; +import net.minecraft.src.Config; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.optifine.reflect.Reflector; + +public abstract class EntityLiving extends EntityLivingBase +{ + /** Number of ticks since this EntityLiving last produced its sound */ + public int livingSoundTime; + + /** The experience points the Entity gives. */ + protected int experienceValue; + private EntityLookHelper lookHelper; + protected EntityMoveHelper moveHelper; + + /** Entity jumping helper */ + protected EntityJumpHelper jumpHelper; + private EntityBodyHelper bodyHelper; + protected PathNavigate navigator; + + /** Passive tasks (wandering, look, idle, ...) */ + protected final EntityAITasks tasks; + + /** Fighting tasks (used by monsters, wolves, ocelots) */ + protected final EntityAITasks targetTasks; + + /** The active target the Task system uses for tracking */ + private EntityLivingBase attackTarget; + private EntitySenses senses; + + /** Equipment (armor and held item) for this entity. */ + private ItemStack[] equipment = new ItemStack[5]; + + /** Chances for each equipment piece from dropping when this entity dies. */ + protected float[] equipmentDropChances = new float[5]; + + /** Whether this entity can pick up items from the ground. */ + private boolean canPickUpLoot; + + /** Whether this entity should NOT despawn. */ + private boolean persistenceRequired; + private boolean isLeashed; + private Entity leashedToEntity; + private NBTTagCompound leashNBTTag; + private UUID teamUuid = null; + private String teamUuidString = null; + + public EntityLiving(World worldIn) + { + super(worldIn); + this.tasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null); + this.targetTasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null); + this.lookHelper = new EntityLookHelper(this); + this.moveHelper = new EntityMoveHelper(this); + this.jumpHelper = new EntityJumpHelper(this); + this.bodyHelper = new EntityBodyHelper(this); + this.navigator = this.getNewNavigator(worldIn); + this.senses = new EntitySenses(this); + + for (int i = 0; i < this.equipmentDropChances.length; ++i) + { + this.equipmentDropChances[i] = 0.085F; + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D); + } + + /** + * Returns new PathNavigateGround instance + */ + protected PathNavigate getNewNavigator(World worldIn) + { + return new PathNavigateGround(this, worldIn); + } + + public EntityLookHelper getLookHelper() + { + return this.lookHelper; + } + + public EntityMoveHelper getMoveHelper() + { + return this.moveHelper; + } + + public EntityJumpHelper getJumpHelper() + { + return this.jumpHelper; + } + + public PathNavigate getNavigator() + { + return this.navigator; + } + + /** + * returns the EntitySenses Object for the EntityLiving + */ + public EntitySenses getEntitySenses() + { + return this.senses; + } + + /** + * Gets the active target the Task system uses for tracking + */ + public EntityLivingBase getAttackTarget() + { + return this.attackTarget; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase entitylivingbaseIn) + { + this.attackTarget = entitylivingbaseIn; + Reflector.callVoid(Reflector.ForgeHooks_onLivingSetAttackTarget, new Object[] {this, entitylivingbaseIn}); + } + + /** + * Returns true if this entity can attack entities of the specified class. + */ + public boolean canAttackClass(Class cls) + { + return cls != EntityGhast.class; + } + + /** + * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This + * function is used in the AIEatGrass) + */ + public void eatGrassBonus() + { + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(15, Byte.valueOf((byte)0)); + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() + { + return 80; + } + + /** + * Plays living's sound at its position + */ + public void playLivingSound() + { + String s = this.getLivingSound(); + + if (s != null) + { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() + { + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("mobBaseTick"); + + if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) + { + this.livingSoundTime = -this.getTalkInterval(); + this.playLivingSound(); + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer player) + { + if (this.experienceValue > 0) + { + int i = this.experienceValue; + ItemStack[] aitemstack = this.getInventory(); + + for (int j = 0; j < aitemstack.length; ++j) + { + if (aitemstack[j] != null && this.equipmentDropChances[j] <= 1.0F) + { + i += 1 + this.rand.nextInt(3); + } + } + + return i; + } + else + { + return this.experienceValue; + } + } + + /** + * Spawns an explosion particle around the Entity's location + */ + public void spawnExplosionParticle() + { + if (this.worldObj.isRemote) + { + for (int i = 0; i < 20; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + double d3 = 10.0D; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - d0 * d3, this.posY + (double)(this.rand.nextFloat() * this.height) - d1 * d3, this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - d2 * d3, d0, d1, d2, new int[0]); + } + } + else + { + this.worldObj.setEntityState(this, (byte)20); + } + } + + public void handleStatusUpdate(byte id) + { + if (id == 20) + { + this.spawnExplosionParticle(); + } + else + { + super.handleStatusUpdate(id); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (Config.isSmoothWorld() && this.canSkipUpdate()) + { + this.onUpdateMinimal(); + } + else + { + super.onUpdate(); + + if (!this.worldObj.isRemote) + { + this.updateLeashedState(); + } + } + } + + protected float func_110146_f(float p_110146_1_, float p_110146_2_) + { + this.bodyHelper.updateRenderAngles(); + return p_110146_2_; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return null; + } + + protected Item getDropItem() + { + return null; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + Item item = this.getDropItem(); + + if (item != null) + { + int i = this.rand.nextInt(3); + + if (p_70628_2_ > 0) + { + i += this.rand.nextInt(p_70628_2_ + 1); + } + + for (int j = 0; j < i; ++j) + { + this.dropItem(item, 1); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot()); + tagCompound.setBoolean("PersistenceRequired", this.persistenceRequired); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.equipment.length; ++i) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + if (this.equipment[i] != null) + { + this.equipment[i].writeToNBT(nbttagcompound); + } + + nbttaglist.appendTag(nbttagcompound); + } + + tagCompound.setTag("Equipment", nbttaglist); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (int j = 0; j < this.equipmentDropChances.length; ++j) + { + nbttaglist1.appendTag(new NBTTagFloat(this.equipmentDropChances[j])); + } + + tagCompound.setTag("DropChances", nbttaglist1); + tagCompound.setBoolean("Leashed", this.isLeashed); + + if (this.leashedToEntity != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + + if (this.leashedToEntity instanceof EntityLivingBase) + { + nbttagcompound1.setLong("UUIDMost", this.leashedToEntity.getUniqueID().getMostSignificantBits()); + nbttagcompound1.setLong("UUIDLeast", this.leashedToEntity.getUniqueID().getLeastSignificantBits()); + } + else if (this.leashedToEntity instanceof EntityHanging) + { + BlockPos blockpos = ((EntityHanging)this.leashedToEntity).getHangingPosition(); + nbttagcompound1.setInteger("X", blockpos.getX()); + nbttagcompound1.setInteger("Y", blockpos.getY()); + nbttagcompound1.setInteger("Z", blockpos.getZ()); + } + + tagCompound.setTag("Leash", nbttagcompound1); + } + + if (this.isAIDisabled()) + { + tagCompound.setBoolean("NoAI", this.isAIDisabled()); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("CanPickUpLoot", 1)) + { + this.setCanPickUpLoot(tagCompund.getBoolean("CanPickUpLoot")); + } + + this.persistenceRequired = tagCompund.getBoolean("PersistenceRequired"); + + if (tagCompund.hasKey("Equipment", 9)) + { + NBTTagList nbttaglist = tagCompund.getTagList("Equipment", 10); + + for (int i = 0; i < this.equipment.length; ++i) + { + this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); + } + } + + if (tagCompund.hasKey("DropChances", 9)) + { + NBTTagList nbttaglist1 = tagCompund.getTagList("DropChances", 5); + + for (int j = 0; j < nbttaglist1.tagCount(); ++j) + { + this.equipmentDropChances[j] = nbttaglist1.getFloatAt(j); + } + } + + this.isLeashed = tagCompund.getBoolean("Leashed"); + + if (this.isLeashed && tagCompund.hasKey("Leash", 10)) + { + this.leashNBTTag = tagCompund.getCompoundTag("Leash"); + } + + this.setNoAI(tagCompund.getBoolean("NoAI")); + } + + public void setMoveForward(float p_70657_1_) + { + this.moveForward = p_70657_1_; + } + + /** + * set the movespeed used for the new AI system + */ + public void setAIMoveSpeed(float speedIn) + { + super.setAIMoveSpeed(speedIn); + this.setMoveForward(speedIn); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.worldObj.theProfiler.startSection("looting"); + + if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getBoolean("mobGriefing")) + { + for (EntityItem entityitem : this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.getEntityBoundingBox().expand(1.0D, 0.0D, 1.0D))) + { + if (!entityitem.isDead && entityitem.getEntityItem() != null && !entityitem.cannotPickup()) + { + this.updateEquipmentIfNeeded(entityitem); + } + } + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Tests if this entity should pickup a weapon or an armor. Entity drops current weapon or armor if the new one is + * better. + */ + protected void updateEquipmentIfNeeded(EntityItem itemEntity) + { + ItemStack itemstack = itemEntity.getEntityItem(); + int i = getArmorPosition(itemstack); + + if (i > -1) + { + boolean flag = true; + ItemStack itemstack1 = this.getEquipmentInSlot(i); + + if (itemstack1 != null) + { + if (i == 0) + { + if (itemstack.getItem() instanceof ItemSword && !(itemstack1.getItem() instanceof ItemSword)) + { + flag = true; + } + else if (itemstack.getItem() instanceof ItemSword && itemstack1.getItem() instanceof ItemSword) + { + ItemSword itemsword = (ItemSword)itemstack.getItem(); + ItemSword itemsword1 = (ItemSword)itemstack1.getItem(); + + if (itemsword.getDamageVsEntity() != itemsword1.getDamageVsEntity()) + { + flag = itemsword.getDamageVsEntity() > itemsword1.getDamageVsEntity(); + } + else + { + flag = itemstack.getMetadata() > itemstack1.getMetadata() || itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } + } + else if (itemstack.getItem() instanceof ItemBow && itemstack1.getItem() instanceof ItemBow) + { + flag = itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } + else + { + flag = false; + } + } + else if (itemstack.getItem() instanceof ItemArmor && !(itemstack1.getItem() instanceof ItemArmor)) + { + flag = true; + } + else if (itemstack.getItem() instanceof ItemArmor && itemstack1.getItem() instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); + ItemArmor itemarmor1 = (ItemArmor)itemstack1.getItem(); + + if (itemarmor.damageReduceAmount != itemarmor1.damageReduceAmount) + { + flag = itemarmor.damageReduceAmount > itemarmor1.damageReduceAmount; + } + else + { + flag = itemstack.getMetadata() > itemstack1.getMetadata() || itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } + } + else + { + flag = false; + } + } + + if (flag && this.func_175448_a(itemstack)) + { + if (itemstack1 != null && this.rand.nextFloat() - 0.1F < this.equipmentDropChances[i]) + { + this.entityDropItem(itemstack1, 0.0F); + } + + if (itemstack.getItem() == Items.diamond && itemEntity.getThrower() != null) + { + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByName(itemEntity.getThrower()); + + if (entityplayer != null) + { + entityplayer.triggerAchievement(AchievementList.diamondsToYou); + } + } + + this.setCurrentItemOrArmor(i, itemstack); + this.equipmentDropChances[i] = 2.0F; + this.persistenceRequired = true; + this.onItemPickup(itemEntity, 1); + itemEntity.setDead(); + } + } + } + + protected boolean func_175448_a(ItemStack stack) + { + return true; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return true; + } + + /** + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() + { + Object object = null; + Object object1 = Reflector.getFieldValue(Reflector.Event_Result_DEFAULT); + Object object2 = Reflector.getFieldValue(Reflector.Event_Result_DENY); + + if (this.persistenceRequired) + { + this.entityAge = 0; + } + else if ((this.entityAge & 31) == 31 && (object = Reflector.call(Reflector.ForgeEventFactory_canEntityDespawn, new Object[] {this})) != object1) + { + if (object == object2) + { + this.entityAge = 0; + } + else + { + this.setDead(); + } + } + else + { + Entity entity = this.worldObj.getClosestPlayerToEntity(this, -1.0D); + + if (entity != null) + { + double d0 = entity.posX - this.posX; + double d1 = entity.posY - this.posY; + double d2 = entity.posZ - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (this.canDespawn() && d3 > 16384.0D) + { + this.setDead(); + } + + if (this.entityAge > 600 && this.rand.nextInt(800) == 0 && d3 > 1024.0D && this.canDespawn()) + { + this.setDead(); + } + else if (d3 < 1024.0D) + { + this.entityAge = 0; + } + } + } + } + + protected final void updateEntityActionState() + { + ++this.entityAge; + this.worldObj.theProfiler.startSection("checkDespawn"); + this.despawnEntity(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("sensing"); + this.senses.clearSensingCache(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("targetSelector"); + this.targetTasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("goalSelector"); + this.tasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("navigation"); + this.navigator.onUpdateNavigation(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("mob tick"); + this.updateAITasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("controls"); + this.worldObj.theProfiler.startSection("move"); + this.moveHelper.onUpdateMoveHelper(); + this.worldObj.theProfiler.endStartSection("look"); + this.lookHelper.onUpdateLook(); + this.worldObj.theProfiler.endStartSection("jump"); + this.jumpHelper.doJump(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.endSection(); + } + + protected void updateAITasks() + { + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return 40; + } + + /** + * Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument. + */ + public void faceEntity(Entity entityIn, float p_70625_2_, float p_70625_3_) + { + double d0 = entityIn.posX - this.posX; + double d1 = entityIn.posZ - this.posZ; + double d2; + + if (entityIn instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)entityIn; + d2 = entitylivingbase.posY + (double)entitylivingbase.getEyeHeight() - (this.posY + (double)this.getEyeHeight()); + } + else + { + d2 = (entityIn.getEntityBoundingBox().minY + entityIn.getEntityBoundingBox().maxY) / 2.0D - (this.posY + (double)this.getEyeHeight()); + } + + double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1); + float f = (float)(MathHelper.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F; + float f1 = (float)(-(MathHelper.atan2(d2, d3) * 180.0D / Math.PI)); + this.rotationPitch = this.updateRotation(this.rotationPitch, f1, p_70625_3_); + this.rotationYaw = this.updateRotation(this.rotationYaw, f, p_70625_2_); + } + + /** + * Arguments: current rotation, intended rotation, max increment. + */ + private float updateRotation(float p_70663_1_, float p_70663_2_, float p_70663_3_) + { + float f = MathHelper.wrapAngleTo180_float(p_70663_2_ - p_70663_1_); + + if (f > p_70663_3_) + { + f = p_70663_3_; + } + + if (f < -p_70663_3_) + { + f = -p_70663_3_; + } + + return p_70663_1_ + f; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return true; + } + + /** + * Checks that the entity is not colliding with any blocks / liquids + */ + public boolean isNotColliding() + { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); + } + + /** + * Returns render size modifier + */ + public float getRenderSizeModifier() + { + return 1.0F; + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() + { + return 4; + } + + /** + * The maximum height from where the entity is alowed to jump (used in pathfinder) + */ + public int getMaxFallHeight() + { + if (this.getAttackTarget() == null) + { + return 3; + } + else + { + int i = (int)(this.getHealth() - this.getMaxHealth() * 0.33F); + i = i - (3 - this.worldObj.getDifficulty().getDifficultyId()) * 4; + + if (i < 0) + { + i = 0; + } + + return i + 3; + } + } + + /** + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() + { + return this.equipment[0]; + } + + /** + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int slotIn) + { + return this.equipment[slotIn]; + } + + public ItemStack getCurrentArmor(int slotIn) + { + return this.equipment[slotIn + 1]; + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int slotIn, ItemStack stack) + { + this.equipment[slotIn] = stack; + } + + /** + * returns the inventory of this entity (only used in EntityPlayerMP it seems) + */ + public ItemStack[] getInventory() + { + return this.equipment; + } + + /** + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean p_82160_1_, int p_82160_2_) + { + for (int i = 0; i < this.getInventory().length; ++i) + { + ItemStack itemstack = this.getEquipmentInSlot(i); + boolean flag = this.equipmentDropChances[i] > 1.0F; + + if (itemstack != null && (p_82160_1_ || flag) && this.rand.nextFloat() - (float)p_82160_2_ * 0.01F < this.equipmentDropChances[i]) + { + if (!flag && itemstack.isItemStackDamageable()) + { + int j = Math.max(itemstack.getMaxDamage() - 25, 1); + int k = itemstack.getMaxDamage() - this.rand.nextInt(this.rand.nextInt(j) + 1); + + if (k > j) + { + k = j; + } + + if (k < 1) + { + k = 1; + } + + itemstack.setItemDamage(k); + } + + this.entityDropItem(itemstack, 0.0F); + } + } + } + + /** + * Gives armor or weapon for entity based on given DifficultyInstance + */ + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) + { + if (this.rand.nextFloat() < 0.15F * difficulty.getClampedAdditionalDifficulty()) + { + int i = this.rand.nextInt(2); + float f = this.worldObj.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.25F; + + if (this.rand.nextFloat() < 0.095F) + { + ++i; + } + + if (this.rand.nextFloat() < 0.095F) + { + ++i; + } + + if (this.rand.nextFloat() < 0.095F) + { + ++i; + } + + for (int j = 3; j >= 0; --j) + { + ItemStack itemstack = this.getCurrentArmor(j); + + if (j < 3 && this.rand.nextFloat() < f) + { + break; + } + + if (itemstack == null) + { + Item item = getArmorItemForSlot(j + 1, i); + + if (item != null) + { + this.setCurrentItemOrArmor(j + 1, new ItemStack(item)); + } + } + } + } + } + + public static int getArmorPosition(ItemStack stack) + { + if (stack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull) + { + if (stack.getItem() instanceof ItemArmor) + { + switch (((ItemArmor)stack.getItem()).armorType) + { + case 0: + return 4; + + case 1: + return 3; + + case 2: + return 2; + + case 3: + return 1; + } + } + + return 0; + } + else + { + return 4; + } + } + + /** + * Gets the vanilla armor Item that can go in the slot specified for the given tier. + */ + public static Item getArmorItemForSlot(int armorSlot, int itemTier) + { + switch (armorSlot) + { + case 4: + if (itemTier == 0) + { + return Items.leather_helmet; + } + else if (itemTier == 1) + { + return Items.golden_helmet; + } + else if (itemTier == 2) + { + return Items.chainmail_helmet; + } + else if (itemTier == 3) + { + return Items.iron_helmet; + } + else if (itemTier == 4) + { + return Items.diamond_helmet; + } + + case 3: + if (itemTier == 0) + { + return Items.leather_chestplate; + } + else if (itemTier == 1) + { + return Items.golden_chestplate; + } + else if (itemTier == 2) + { + return Items.chainmail_chestplate; + } + else if (itemTier == 3) + { + return Items.iron_chestplate; + } + else if (itemTier == 4) + { + return Items.diamond_chestplate; + } + + case 2: + if (itemTier == 0) + { + return Items.leather_leggings; + } + else if (itemTier == 1) + { + return Items.golden_leggings; + } + else if (itemTier == 2) + { + return Items.chainmail_leggings; + } + else if (itemTier == 3) + { + return Items.iron_leggings; + } + else if (itemTier == 4) + { + return Items.diamond_leggings; + } + + case 1: + if (itemTier == 0) + { + return Items.leather_boots; + } + else if (itemTier == 1) + { + return Items.golden_boots; + } + else if (itemTier == 2) + { + return Items.chainmail_boots; + } + else if (itemTier == 3) + { + return Items.iron_boots; + } + else if (itemTier == 4) + { + return Items.diamond_boots; + } + + default: + return null; + } + } + + /** + * Enchants Entity's current equipments based on given DifficultyInstance + */ + protected void setEnchantmentBasedOnDifficulty(DifficultyInstance difficulty) + { + float f = difficulty.getClampedAdditionalDifficulty(); + + if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * f) + { + EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), (int)(5.0F + f * (float)this.rand.nextInt(18))); + } + + for (int i = 0; i < 4; ++i) + { + ItemStack itemstack = this.getCurrentArmor(i); + + if (itemstack != null && this.rand.nextFloat() < 0.5F * f) + { + EnchantmentHelper.addRandomEnchantment(this.rand, itemstack, (int)(5.0F + f * (float)this.rand.nextInt(18))); + } + } + } + + /** + * Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called + * when entity is reloaded from nbt. Mainly used for initializing attributes and inventory + */ + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1)); + return livingdata; + } + + /** + * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden + * by a player and the player is holding a carrot-on-a-stick + */ + public boolean canBeSteered() + { + return false; + } + + /** + * Enable the Entity persistence + */ + public void enablePersistence() + { + this.persistenceRequired = true; + } + + public void setEquipmentDropChance(int slotIn, float chance) + { + this.equipmentDropChances[slotIn] = chance; + } + + public boolean canPickUpLoot() + { + return this.canPickUpLoot; + } + + public void setCanPickUpLoot(boolean canPickup) + { + this.canPickUpLoot = canPickup; + } + + public boolean isNoDespawnRequired() + { + return this.persistenceRequired; + } + + /** + * First layer of player interaction + */ + public final boolean interactFirst(EntityPlayer playerIn) + { + if (this.getLeashed() && this.getLeashedToEntity() == playerIn) + { + this.clearLeashed(true, !playerIn.capabilities.isCreativeMode); + return true; + } + else + { + ItemStack itemstack = playerIn.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.lead && this.allowLeashing()) + { + if (!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) + { + this.setLeashedToEntity(playerIn, true); + --itemstack.stackSize; + return true; + } + + if (((EntityTameable)this).isOwner(playerIn)) + { + this.setLeashedToEntity(playerIn, true); + --itemstack.stackSize; + return true; + } + } + + if (this.interact(playerIn)) + { + return true; + } + else + { + return super.interactFirst(playerIn); + } + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer player) + { + return false; + } + + /** + * Applies logic related to leashes, for example dragging the entity or breaking the leash. + */ + protected void updateLeashedState() + { + if (this.leashNBTTag != null) + { + this.recreateLeash(); + } + + if (this.isLeashed) + { + if (!this.isEntityAlive()) + { + this.clearLeashed(true, true); + } + + if (this.leashedToEntity == null || this.leashedToEntity.isDead) + { + this.clearLeashed(true, true); + } + } + } + + /** + * Removes the leash from this entity + * + * @param sendPacket set true to send a packet to surrounding players + * @param dropLead set true to drop a leash + */ + public void clearLeashed(boolean sendPacket, boolean dropLead) + { + if (this.isLeashed) + { + this.isLeashed = false; + this.leashedToEntity = null; + + if (!this.worldObj.isRemote && dropLead) + { + this.dropItem(Items.lead, 1); + } + + if (!this.worldObj.isRemote && sendPacket && this.worldObj instanceof WorldServer) + { + ((WorldServer)this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, (Entity)null)); + } + } + } + + public boolean allowLeashing() + { + return !this.getLeashed() && !(this instanceof IMob); + } + + public boolean getLeashed() + { + return this.isLeashed; + } + + public Entity getLeashedToEntity() + { + return this.leashedToEntity; + } + + /** + * Sets the entity to be leashed to. + */ + public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification) + { + this.isLeashed = true; + this.leashedToEntity = entityIn; + + if (!this.worldObj.isRemote && sendAttachNotification && this.worldObj instanceof WorldServer) + { + ((WorldServer)this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, new S1BPacketEntityAttach(1, this, this.leashedToEntity)); + } + } + + private void recreateLeash() + { + if (this.isLeashed && this.leashNBTTag != null) + { + if (this.leashNBTTag.hasKey("UUIDMost", 4) && this.leashNBTTag.hasKey("UUIDLeast", 4)) + { + UUID uuid = new UUID(this.leashNBTTag.getLong("UUIDMost"), this.leashNBTTag.getLong("UUIDLeast")); + + for (EntityLivingBase entitylivingbase : this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().expand(10.0D, 10.0D, 10.0D))) + { + if (entitylivingbase.getUniqueID().equals(uuid)) + { + this.leashedToEntity = entitylivingbase; + break; + } + } + } + else if (this.leashNBTTag.hasKey("X", 99) && this.leashNBTTag.hasKey("Y", 99) && this.leashNBTTag.hasKey("Z", 99)) + { + BlockPos blockpos = new BlockPos(this.leashNBTTag.getInteger("X"), this.leashNBTTag.getInteger("Y"), this.leashNBTTag.getInteger("Z")); + EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForPosition(this.worldObj, blockpos); + + if (entityleashknot == null) + { + entityleashknot = EntityLeashKnot.createKnot(this.worldObj, blockpos); + } + + this.leashedToEntity = entityleashknot; + } + else + { + this.clearLeashed(false, true); + } + } + + this.leashNBTTag = null; + } + + public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn) + { + int i; + + if (inventorySlot == 99) + { + i = 0; + } + else + { + i = inventorySlot - 100 + 1; + + if (i < 0 || i >= this.equipment.length) + { + return false; + } + } + + if (itemStackIn == null || getArmorPosition(itemStackIn) == i || i == 4 && itemStackIn.getItem() instanceof ItemBlock) + { + this.setCurrentItemOrArmor(i, itemStackIn); + return true; + } + else + { + return false; + } + } + + /** + * Returns whether the entity is in a server world + */ + public boolean isServerWorld() + { + return super.isServerWorld() && !this.isAIDisabled(); + } + + /** + * Set whether this Entity's AI is disabled + */ + public void setNoAI(boolean disable) + { + this.dataWatcher.updateObject(15, Byte.valueOf((byte)(disable ? 1 : 0))); + } + + /** + * Get whether this Entity's AI is disabled + */ + public boolean isAIDisabled() + { + return this.dataWatcher.getWatchableObjectByte(15) != 0; + } + + private boolean canSkipUpdate() + { + if (this.isChild()) + { + return false; + } + else if (this.hurtTime > 0) + { + return false; + } + else if (this.ticksExisted < 20) + { + return false; + } + else + { + World world = this.getEntityWorld(); + + if (world == null) + { + return false; + } + else if (world.playerEntities.size() != 1) + { + return false; + } + else + { + Entity entity = (Entity)world.playerEntities.get(0); + double d0 = Math.max(Math.abs(this.posX - entity.posX) - 16.0D, 0.0D); + double d1 = Math.max(Math.abs(this.posZ - entity.posZ) - 16.0D, 0.0D); + double d2 = d0 * d0 + d1 * d1; + return !this.isInRangeToRenderDist(d2); + } + } + } + + private void onUpdateMinimal() + { + ++this.entityAge; + + if (this instanceof EntityMob) + { + float f = this.getBrightness(1.0F); + + if (f > 0.5F) + { + this.entityAge += 2; + } + } + + this.despawnEntity(); + } + + public Team getTeam() + { + UUID uuid = this.getUniqueID(); + + if (this.teamUuid != uuid) + { + this.teamUuid = uuid; + this.teamUuidString = uuid.toString(); + } + + return this.worldObj.getScoreboard().getPlayersTeam(this.teamUuidString); + } + + public static enum SpawnPlacementType + { + ON_GROUND, + IN_AIR, + IN_WATER; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLivingBase.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLivingBase.java new file mode 100644 index 0000000..f1facd1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityLivingBase.java @@ -0,0 +1,2004 @@ +package net.minecraft.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntitySpellParticleFX; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.scoreboard.Team; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.CombatTracker; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public abstract class EntityLivingBase extends Entity +{ + private static final UUID sprintingSpeedBoostModifierUUID = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); + private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier(sprintingSpeedBoostModifierUUID, "Sprinting speed boost", 0.30000001192092896D, 2)).setSaved(false); + private BaseAttributeMap attributeMap; + private final CombatTracker _combatTracker = new CombatTracker(this); + private final Map activePotionsMap = Maps.newHashMap(); + private final ItemStack[] previousEquipment = new ItemStack[5]; + public boolean isSwingInProgress; + public int swingProgressInt; + public int arrowHitTimer; + public int hurtTime; + public int maxHurtTime; + public float attackedAtYaw; + public int deathTime; + public float prevSwingProgress; + public float swingProgress; + public float prevLimbSwingAmount; + public float limbSwingAmount; + public float limbSwing; + public int maxHurtResistantTime = 20; + public float prevCameraPitch; + public float cameraPitch; + public float randomUnused2; + public float randomUnused1; + public float renderYawOffset; + public float prevRenderYawOffset; + public float rotationYawHead; + public float prevRotationYawHead; + public float jumpMovementFactor = 0.02F; + protected EntityPlayer attackingPlayer; + protected int recentlyHit; + protected boolean dead; + protected int entityAge; + protected float prevOnGroundSpeedFactor; + protected float onGroundSpeedFactor; + protected float movedDistance; + protected float prevMovedDistance; + protected float unused180; + protected int scoreValue; + protected float lastDamage; + protected boolean isJumping; + public float moveStrafing; + public float moveForward; + protected float randomYawVelocity; + protected int newPosRotationIncrements; + protected double newPosX; + protected double newPosY; + protected double newPosZ; + protected double newRotationYaw; + protected double newRotationPitch; + private boolean potionsNeedUpdate = true; + private EntityLivingBase entityLivingToAttack; + private int revengeTimer; + private EntityLivingBase lastAttacker; + private int lastAttackerTime; + private float landMovementFactor; + private int jumpTicks; + private float absorptionAmount; + + public void onKillCommand() + { + this.attackEntityFrom(DamageSource.outOfWorld, Float.MAX_VALUE); + } + + public EntityLivingBase(World worldIn) + { + super(worldIn); + this.applyEntityAttributes(); + this.setHealth(this.getMaxHealth()); + this.preventEntitySpawning = true; + this.randomUnused1 = (float)((Math.random() + 1.0D) * 0.009999999776482582D); + this.setPosition(this.posX, this.posY, this.posZ); + this.randomUnused2 = (float)Math.random() * 12398.0F; + this.rotationYaw = (float)(Math.random() * Math.PI * 2.0D); + this.rotationYawHead = this.rotationYaw; + this.stepHeight = 0.6F; + } + + protected void entityInit() + { + this.dataWatcher.addObject(7, Integer.valueOf(0)); + this.dataWatcher.addObject(8, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(9, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(6, Float.valueOf(1.0F)); + } + + protected void applyEntityAttributes() + { + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed); + } + + protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos) + { + if (!this.isInWater()) + { + this.handleWaterMovement(); + } + + if (!this.worldObj.isRemote && this.fallDistance > 3.0F && onGroundIn) + { + IBlockState iblockstate = this.worldObj.getBlockState(pos); + Block block = iblockstate.getBlock(); + float f = (float)MathHelper.ceiling_float_int(this.fallDistance - 3.0F); + + if (block.getMaterial() != Material.air) + { + double d0 = (double)Math.min(0.2F + f / 15.0F, 10.0F); + + if (d0 > 2.5D) + { + d0 = 2.5D; + } + + int i = (int)(150.0D * d0); + ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, this.posY, this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, new int[] {Block.getStateId(iblockstate)}); + } + } + + super.updateFallState(y, onGroundIn, blockIn, pos); + } + + public boolean canBreatheUnderwater() + { + return false; + } + + public void onEntityUpdate() + { + this.prevSwingProgress = this.swingProgress; + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("livingEntityBaseTick"); + boolean flag = this instanceof EntityPlayer; + + if (this.isEntityAlive()) + { + if (this.isEntityInsideOpaqueBlock()) + { + this.attackEntityFrom(DamageSource.inWall, 1.0F); + } + else if (flag && !this.worldObj.getWorldBorder().contains(this.getEntityBoundingBox())) + { + double d0 = this.worldObj.getWorldBorder().getClosestDistance(this) + this.worldObj.getWorldBorder().getDamageBuffer(); + + if (d0 < 0.0D) + { + this.attackEntityFrom(DamageSource.inWall, (float)Math.max(1, MathHelper.floor_double(-d0 * this.worldObj.getWorldBorder().getDamageAmount()))); + } + } + } + + if (this.isImmuneToFire() || this.worldObj.isRemote) + { + this.extinguish(); + } + + boolean flag1 = flag && ((EntityPlayer)this).capabilities.disableDamage; + + if (this.isEntityAlive()) + { + if (this.isInsideOfMaterial(Material.water)) + { + if (!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !flag1) + { + this.setAir(this.decreaseAirSupply(this.getAir())); + + if (this.getAir() == -20) + { + this.setAir(0); + + for (int i = 0; i < 8; ++i) + { + float f = this.rand.nextFloat() - this.rand.nextFloat(); + float f1 = this.rand.nextFloat() - this.rand.nextFloat(); + float f2 = this.rand.nextFloat() - this.rand.nextFloat(); + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + (double)f, this.posY + (double)f1, this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ, new int[0]); + } + + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } + + if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) + { + this.mountEntity((Entity)null); + } + } + else + { + this.setAir(300); + } + } + + if (this.isEntityAlive() && this.isWet()) + { + this.extinguish(); + } + + this.prevCameraPitch = this.cameraPitch; + + if (this.hurtTime > 0) + { + --this.hurtTime; + } + + if (this.hurtResistantTime > 0 && !(this instanceof EntityPlayerMP)) + { + --this.hurtResistantTime; + } + + if (this.getHealth() <= 0.0F) + { + this.onDeathUpdate(); + } + + if (this.recentlyHit > 0) + { + --this.recentlyHit; + } + else + { + this.attackingPlayer = null; + } + + if (this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) + { + this.lastAttacker = null; + } + + if (this.entityLivingToAttack != null) + { + if (!this.entityLivingToAttack.isEntityAlive()) + { + this.setRevengeTarget((EntityLivingBase)null); + } + else if (this.ticksExisted - this.revengeTimer > 100) + { + this.setRevengeTarget((EntityLivingBase)null); + } + } + + this.updatePotionEffects(); + this.prevMovedDistance = this.movedDistance; + this.prevRenderYawOffset = this.renderYawOffset; + this.prevRotationYawHead = this.rotationYawHead; + this.prevRotationYaw = this.rotationYaw; + this.prevRotationPitch = this.rotationPitch; + this.worldObj.theProfiler.endSection(); + } + + public boolean isChild() + { + return false; + } + + protected void onDeathUpdate() + { + ++this.deathTime; + + if (this.deathTime == 20) + { + if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot")) + { + int i = this.getExperiencePoints(this.attackingPlayer); + + while (i > 0) + { + int j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + } + + this.setDead(); + + for (int k = 0; k < 20; ++k) + { + double d2 = this.rand.nextGaussian() * 0.02D; + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d2, d0, d1, new int[0]); + } + } + } + + protected boolean canDropLoot() + { + return !this.isChild(); + } + + protected int decreaseAirSupply(int p_70682_1_) + { + int i = EnchantmentHelper.getRespiration(this); + return i > 0 && this.rand.nextInt(i + 1) > 0 ? p_70682_1_ : p_70682_1_ - 1; + } + + protected int getExperiencePoints(EntityPlayer player) + { + return 0; + } + + protected boolean isPlayer() + { + return false; + } + + public Random getRNG() + { + return this.rand; + } + + public EntityLivingBase getAITarget() + { + return this.entityLivingToAttack; + } + + public int getRevengeTimer() + { + return this.revengeTimer; + } + + public void setRevengeTarget(EntityLivingBase livingBase) + { + this.entityLivingToAttack = livingBase; + this.revengeTimer = this.ticksExisted; + } + + public EntityLivingBase getLastAttacker() + { + return this.lastAttacker; + } + + public int getLastAttackerTime() + { + return this.lastAttackerTime; + } + + public void setLastAttacker(Entity entityIn) + { + if (entityIn instanceof EntityLivingBase) + { + this.lastAttacker = (EntityLivingBase)entityIn; + } + else + { + this.lastAttacker = null; + } + + this.lastAttackerTime = this.ticksExisted; + } + + public int getAge() + { + return this.entityAge; + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setFloat("HealF", this.getHealth()); + tagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); + tagCompound.setShort("HurtTime", (short)this.hurtTime); + tagCompound.setInteger("HurtByTimestamp", this.revengeTimer); + tagCompound.setShort("DeathTime", (short)this.deathTime); + tagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); + + for (ItemStack itemstack : this.getInventory()) + { + if (itemstack != null) + { + this.attributeMap.removeAttributeModifiers(itemstack.getAttributeModifiers()); + } + } + + tagCompound.setTag("Attributes", SharedMonsterAttributes.writeBaseAttributeMapToNBT(this.getAttributeMap())); + + for (ItemStack itemstack1 : this.getInventory()) + { + if (itemstack1 != null) + { + this.attributeMap.applyAttributeModifiers(itemstack1.getAttributeModifiers()); + } + } + + if (!this.activePotionsMap.isEmpty()) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (PotionEffect potioneffect : this.activePotionsMap.values()) + { + nbttaglist.appendTag(potioneffect.writeCustomPotionEffectToNBT(new NBTTagCompound())); + } + + tagCompound.setTag("ActiveEffects", nbttaglist); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.setAbsorptionAmount(tagCompund.getFloat("AbsorptionAmount")); + + if (tagCompund.hasKey("Attributes", 9) && this.worldObj != null && !this.worldObj.isRemote) + { + SharedMonsterAttributes.setAttributeModifiers(this.getAttributeMap(), tagCompund.getTagList("Attributes", 10)); + } + + if (tagCompund.hasKey("ActiveEffects", 9)) + { + NBTTagList nbttaglist = tagCompund.getTagList("ActiveEffects", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + PotionEffect potioneffect = PotionEffect.readCustomPotionEffectFromNBT(nbttagcompound); + + if (potioneffect != null) + { + this.activePotionsMap.put(Integer.valueOf(potioneffect.getPotionID()), potioneffect); + } + } + } + + if (tagCompund.hasKey("HealF", 99)) + { + this.setHealth(tagCompund.getFloat("HealF")); + } + else + { + NBTBase nbtbase = tagCompund.getTag("Health"); + + if (nbtbase == null) + { + this.setHealth(this.getMaxHealth()); + } + else if (nbtbase.getId() == 5) + { + this.setHealth(((NBTTagFloat)nbtbase).getFloat()); + } + else if (nbtbase.getId() == 2) + { + this.setHealth((float)((NBTTagShort)nbtbase).getShort()); + } + } + + this.hurtTime = tagCompund.getShort("HurtTime"); + this.deathTime = tagCompund.getShort("DeathTime"); + this.revengeTimer = tagCompund.getInteger("HurtByTimestamp"); + } + + protected void updatePotionEffects() + { + Iterator iterator = this.activePotionsMap.keySet().iterator(); + + while (iterator.hasNext()) + { + Integer integer = iterator.next(); + PotionEffect potioneffect = this.activePotionsMap.get(integer); + + if (!potioneffect.onUpdate(this)) + { + if (!this.worldObj.isRemote) + { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } + else if (potioneffect.getDuration() % 600 == 0) + { + this.onChangedPotionEffect(potioneffect, false); + } + } + + if (this.potionsNeedUpdate) + { + if (!this.worldObj.isRemote) + { + this.updatePotionMetadata(); + } + + this.potionsNeedUpdate = false; + } + + int i = this.dataWatcher.getWatchableObjectInt(7); + boolean flag1 = this.dataWatcher.getWatchableObjectByte(8) > 0; + + if (i > 0) + { + boolean flag = false; + + if (!this.isInvisible()) + { + flag = this.rand.nextBoolean(); + } + else + { + flag = this.rand.nextInt(15) == 0; + } + + if (flag1) + { + flag &= this.rand.nextInt(5) == 0; + } + + if (flag && i > 0) + { + + + boolean modFlag = CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().particlesMod.activeEffectParticles.getBooleanValue(); + + double d0 = (double)(i >> 16 & 255) / 255.0D; + double d1 = (double)(i >> 8 & 255) / 255.0D; + double d2 = (double)(i >> 0 & 255) / 255.0D; + + if (modFlag) { + this.worldObj.spawnParticle(flag1 ? EnumParticleTypes.SPELL_MOB_AMBIENT : EnumParticleTypes.SPELL_MOB, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, d0, d1, d2, new int[0]); + } else if (!CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled()) { + this.worldObj.spawnParticle(flag1 ? EnumParticleTypes.SPELL_MOB_AMBIENT : EnumParticleTypes.SPELL_MOB, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, d0, d1, d2, new int[0]); + } + } + } + } + + protected void updatePotionMetadata() + { + if (this.activePotionsMap.isEmpty()) + { + this.resetPotionEffectMetadata(); + this.setInvisible(false); + } + else + { + int i = PotionHelper.calcPotionLiquidColor(this.activePotionsMap.values()); + this.dataWatcher.updateObject(8, Byte.valueOf((byte)(PotionHelper.getAreAmbient(this.activePotionsMap.values()) ? 1 : 0))); + this.dataWatcher.updateObject(7, Integer.valueOf(i)); + this.setInvisible(this.isPotionActive(Potion.invisibility.id)); + } + } + + protected void resetPotionEffectMetadata() + { + this.dataWatcher.updateObject(8, Byte.valueOf((byte)0)); + this.dataWatcher.updateObject(7, Integer.valueOf(0)); + } + + public void clearActivePotions() + { + Iterator iterator = this.activePotionsMap.keySet().iterator(); + + while (iterator.hasNext()) + { + Integer integer = (Integer)iterator.next(); + PotionEffect potioneffect = (PotionEffect)this.activePotionsMap.get(integer); + + if (!this.worldObj.isRemote) + { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } + } + + public Collection getActivePotionEffects() + { + return this.activePotionsMap.values(); + } + + public boolean isPotionActive(int potionId) + { + return this.activePotionsMap.containsKey(Integer.valueOf(potionId)); + } + + public boolean isPotionActive(Potion potionIn) + { + return this.activePotionsMap.containsKey(Integer.valueOf(potionIn.id)); + } + + public PotionEffect getActivePotionEffect(Potion potionIn) + { + return (PotionEffect)this.activePotionsMap.get(Integer.valueOf(potionIn.id)); + } + + public void addPotionEffect(PotionEffect potioneffectIn) + { + if (this.isPotionApplicable(potioneffectIn)) + { + if (this.activePotionsMap.containsKey(Integer.valueOf(potioneffectIn.getPotionID()))) + { + ((PotionEffect)this.activePotionsMap.get(Integer.valueOf(potioneffectIn.getPotionID()))).combine(potioneffectIn); + this.onChangedPotionEffect((PotionEffect)this.activePotionsMap.get(Integer.valueOf(potioneffectIn.getPotionID())), true); + } + else + { + this.activePotionsMap.put(Integer.valueOf(potioneffectIn.getPotionID()), potioneffectIn); + this.onNewPotionEffect(potioneffectIn); + } + } + } + + public boolean isPotionApplicable(PotionEffect potioneffectIn) + { + if (this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) + { + int i = potioneffectIn.getPotionID(); + + if (i == Potion.regeneration.id || i == Potion.poison.id) + { + return false; + } + } + + return true; + } + + public boolean isEntityUndead() + { + return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; + } + + public void removePotionEffectClient(int potionId) + { + this.activePotionsMap.remove(Integer.valueOf(potionId)); + } + + public void removePotionEffect(int potionId) + { + PotionEffect potioneffect = (PotionEffect)this.activePotionsMap.remove(Integer.valueOf(potionId)); + + if (potioneffect != null) + { + this.onFinishedPotionEffect(potioneffect); + } + } + + protected void onNewPotionEffect(PotionEffect id) + { + this.potionsNeedUpdate = true; + + if (!this.worldObj.isRemote) + { + Potion.potionTypes[id.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), id.getAmplifier()); + } + } + + protected void onChangedPotionEffect(PotionEffect id, boolean p_70695_2_) + { + this.potionsNeedUpdate = true; + + if (p_70695_2_ && !this.worldObj.isRemote) + { + Potion.potionTypes[id.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), id.getAmplifier()); + Potion.potionTypes[id.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), id.getAmplifier()); + } + } + + protected void onFinishedPotionEffect(PotionEffect effect) + { + this.potionsNeedUpdate = true; + + if (!this.worldObj.isRemote) + { + Potion.potionTypes[effect.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), effect.getAmplifier()); + } + } + + public void heal(float healAmount) + { + float f = this.getHealth(); + + if (f > 0.0F) + { + this.setHealth(f + healAmount); + } + } + + public final float getHealth() + { + return this.dataWatcher.getWatchableObjectFloat(6); + } + + public void setHealth(float health) + { + this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(health, 0.0F, this.getMaxHealth()))); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (this.worldObj.isRemote) + { + return false; + } + else + { + this.entityAge = 0; + + if (this.getHealth() <= 0.0F) + { + return false; + } + else if (source.isFireDamage() && this.isPotionActive(Potion.fireResistance)) + { + return false; + } + else + { + if ((source == DamageSource.anvil || source == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) + { + this.getEquipmentInSlot(4).damageItem((int)(amount * 4.0F + this.rand.nextFloat() * amount * 2.0F), this); + amount *= 0.75F; + } + + this.limbSwingAmount = 1.5F; + boolean flag = true; + + if ((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) + { + if (amount <= this.lastDamage) + { + return false; + } + + this.damageEntity(source, amount - this.lastDamage); + this.lastDamage = amount; + flag = false; + } + else + { + this.lastDamage = amount; + this.hurtResistantTime = this.maxHurtResistantTime; + this.damageEntity(source, amount); + this.hurtTime = this.maxHurtTime = 10; + } + + this.attackedAtYaw = 0.0F; + Entity entity = source.getEntity(); + + if (entity != null) + { + if (entity instanceof EntityLivingBase) + { + this.setRevengeTarget((EntityLivingBase)entity); + } + + if (entity instanceof EntityPlayer) + { + this.recentlyHit = 100; + this.attackingPlayer = (EntityPlayer)entity; + } + else if (entity instanceof EntityWolf) + { + EntityWolf entitywolf = (EntityWolf)entity; + + if (entitywolf.isTamed()) + { + this.recentlyHit = 100; + this.attackingPlayer = null; + } + } + } + + if (flag) + { + this.worldObj.setEntityState(this, (byte)2); + + if (source != DamageSource.drown) + { + this.setBeenAttacked(); + } + + if (entity != null) + { + double d1 = entity.posX - this.posX; + double d0; + + for (d0 = entity.posZ - this.posZ; d1 * d1 + d0 * d0 < 1.0E-4D; d0 = (Math.random() - Math.random()) * 0.01D) + { + d1 = (Math.random() - Math.random()) * 0.01D; + } + + this.attackedAtYaw = (float)(MathHelper.atan2(d0, d1) * 180.0D / Math.PI - (double)this.rotationYaw); + this.knockBack(entity, amount, d1, d0); + } + else + { + this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180); + } + } + + if (this.getHealth() <= 0.0F) + { + String s = this.getDeathSound(); + + if (flag && s != null) + { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + + this.onDeath(source); + } + else + { + String s1 = this.getHurtSound(); + + if (flag && s1 != null) + { + this.playSound(s1, this.getSoundVolume(), this.getSoundPitch()); + } + } + + return true; + } + } + } + + public void renderBrokenItemStack(ItemStack stack) + { + this.playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F); + + for (int i = 0; i < 5; ++i) + { + Vec3 vec3 = new Vec3(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + vec3 = vec3.rotatePitch(-this.rotationPitch * (float)Math.PI / 180.0F); + vec3 = vec3.rotateYaw(-this.rotationYaw * (float)Math.PI / 180.0F); + double d0 = (double)(-this.rand.nextFloat()) * 0.6D - 0.3D; + Vec3 vec31 = new Vec3(((double)this.rand.nextFloat() - 0.5D) * 0.3D, d0, 0.6D); + vec31 = vec31.rotatePitch(-this.rotationPitch * (float)Math.PI / 180.0F); + vec31 = vec31.rotateYaw(-this.rotationYaw * (float)Math.PI / 180.0F); + vec31 = vec31.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord, new int[] {Item.getIdFromItem(stack.getItem())}); + } + } + + public void onDeath(DamageSource cause) + { + Entity entity = cause.getEntity(); + EntityLivingBase entitylivingbase = this.getAttackingEntity(); + + if (this.scoreValue >= 0 && entitylivingbase != null) + { + entitylivingbase.addToPlayerScore(this, this.scoreValue); + } + + if (entity != null) + { + entity.onKillEntity(this); + } + + this.dead = true; + this.getCombatTracker().reset(); + + if (!this.worldObj.isRemote) + { + int i = 0; + + if (entity instanceof EntityPlayer) + { + i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity); + } + + if (this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot")) + { + this.dropFewItems(this.recentlyHit > 0, i); + this.dropEquipment(this.recentlyHit > 0, i); + + if (this.recentlyHit > 0 && this.rand.nextFloat() < 0.025F + (float)i * 0.01F) + { + this.addRandomDrop(); + } + } + } + + this.worldObj.setEntityState(this, (byte)3); + } + + protected void dropEquipment(boolean wasRecentlyHit, int lootingModifier) + { + } + + public void knockBack(Entity entityIn, float p_70653_2_, double p_70653_3_, double p_70653_5_) + { + if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) + { + this.isAirBorne = true; + float f = MathHelper.sqrt_double(p_70653_3_ * p_70653_3_ + p_70653_5_ * p_70653_5_); + float f1 = 0.4F; + this.motionX /= 2.0D; + this.motionY /= 2.0D; + this.motionZ /= 2.0D; + this.motionX -= p_70653_3_ / (double)f * (double)f1; + this.motionY += (double)f1; + this.motionZ -= p_70653_5_ / (double)f * (double)f1; + + if (this.motionY > 0.4000000059604645D) + { + this.motionY = 0.4000000059604645D; + } + } + } + + protected String getHurtSound() + { + return "game.neutral.hurt"; + } + + protected String getDeathSound() + { + return "game.neutral.die"; + } + + protected void addRandomDrop() + { + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + } + + public boolean isOnLadder() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.getEntityBoundingBox().minY); + int k = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock(); + return (block == Blocks.ladder || block == Blocks.vine) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).isSpectator()); + } + + public boolean isEntityAlive() + { + return !this.isDead && this.getHealth() > 0.0F; + } + + public void fall(float distance, float damageMultiplier) + { + super.fall(distance, damageMultiplier); + PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump); + float f = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F; + int i = MathHelper.ceiling_float_int((distance - 3.0F - f) * damageMultiplier); + + if (i > 0) + { + this.playSound(this.getFallSoundString(i), 1.0F, 1.0F); + this.attackEntityFrom(DamageSource.fall, (float)i); + int j = MathHelper.floor_double(this.posX); + int k = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int l = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlockState(new BlockPos(j, k, l)).getBlock(); + + if (block.getMaterial() != Material.air) + { + Block.SoundType block$soundtype = block.stepSound; + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.5F, block$soundtype.getFrequency() * 0.75F); + } + } + } + + protected String getFallSoundString(int damageValue) + { + return damageValue > 4 ? "game.neutral.hurt.fall.big" : "game.neutral.hurt.fall.small"; + } + + public void performHurtAnimation() + { + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + } + + public int getTotalArmorValue() + { + int i = 0; + + for (ItemStack itemstack : this.getInventory()) + { + if (itemstack != null && itemstack.getItem() instanceof ItemArmor) + { + int j = ((ItemArmor)itemstack.getItem()).damageReduceAmount; + i += j; + } + } + + return i; + } + + protected void damageArmor(float p_70675_1_) + { + } + + protected float applyArmorCalculations(DamageSource source, float damage) + { + if (!source.isUnblockable()) + { + int i = 25 - this.getTotalArmorValue(); + float f = damage * (float)i; + this.damageArmor(damage); + damage = f / 25.0F; + } + + return damage; + } + + protected float applyPotionDamageCalculations(DamageSource source, float damage) + { + if (source.isDamageAbsolute()) + { + return damage; + } + else + { + if (this.isPotionActive(Potion.resistance) && source != DamageSource.outOfWorld) + { + int i = (this.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5; + int j = 25 - i; + float f = damage * (float)j; + damage = f / 25.0F; + } + + if (damage <= 0.0F) + { + return 0.0F; + } + else + { + int k = EnchantmentHelper.getEnchantmentModifierDamage(this.getInventory(), source); + + if (k > 20) + { + k = 20; + } + + if (k > 0 && k <= 20) + { + int l = 25 - k; + float f1 = damage * (float)l; + damage = f1 / 25.0F; + } + + return damage; + } + } + } + + protected void damageEntity(DamageSource damageSrc, float damageAmount) + { + if (!this.isEntityInvulnerable(damageSrc)) + { + damageAmount = this.applyArmorCalculations(damageSrc, damageAmount); + damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount); + float f = damageAmount; + damageAmount = Math.max(damageAmount - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (f - damageAmount)); + + if (damageAmount != 0.0F) + { + float f1 = this.getHealth(); + this.setHealth(f1 - damageAmount); + this.getCombatTracker().trackDamage(damageSrc, f1, damageAmount); + this.setAbsorptionAmount(this.getAbsorptionAmount() - damageAmount); + } + } + } + + public CombatTracker getCombatTracker() + { + return this._combatTracker; + } + + public EntityLivingBase getAttackingEntity() + { + return (EntityLivingBase)(this._combatTracker.func_94550_c() != null ? this._combatTracker.func_94550_c() : (this.attackingPlayer != null ? this.attackingPlayer : (this.entityLivingToAttack != null ? this.entityLivingToAttack : null))); + } + + public final float getMaxHealth() + { + return (float)this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(); + } + + public final int getArrowCountInEntity() + { + return this.dataWatcher.getWatchableObjectByte(9); + } + + public final void setArrowCountInEntity(int count) + { + this.dataWatcher.updateObject(9, Byte.valueOf((byte)count)); + } + + private int getArmSwingAnimationEnd() + { + return this.isPotionActive(Potion.digSpeed) ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6); + } + + public void swingItem() + { + if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) + { + this.swingProgressInt = -1; + this.isSwingInProgress = true; + + if (this.worldObj instanceof WorldServer) + { + ((WorldServer)this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, new S0BPacketAnimation(this, 0)); + } + } + } + + public void handleStatusUpdate(byte id) + { + if (id == 2) + { + this.limbSwingAmount = 1.5F; + this.hurtResistantTime = this.maxHurtResistantTime; + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + String s = this.getHurtSound(); + + if (s != null) + { + this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.attackEntityFrom(DamageSource.generic, 0.0F); + } + else if (id == 3) + { + String s1 = this.getDeathSound(); + + if (s1 != null) + { + this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.setHealth(0.0F); + this.onDeath(DamageSource.generic); + } + else + { + super.handleStatusUpdate(id); + } + } + + protected void kill() + { + this.attackEntityFrom(DamageSource.outOfWorld, 4.0F); + } + + protected void updateArmSwingProgress() + { + int i = this.getArmSwingAnimationEnd(); + + if (this.isSwingInProgress) + { + ++this.swingProgressInt; + + if (this.swingProgressInt >= i) + { + this.swingProgressInt = 0; + this.isSwingInProgress = false; + } + } + else + { + this.swingProgressInt = 0; + } + + this.swingProgress = (float)this.swingProgressInt / (float)i; + } + + public IAttributeInstance getEntityAttribute(IAttribute attribute) + { + return this.getAttributeMap().getAttributeInstance(attribute); + } + + public BaseAttributeMap getAttributeMap() + { + if (this.attributeMap == null) + { + this.attributeMap = new ServersideAttributeMap(); + } + + return this.attributeMap; + } + + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEFINED; + } + + public abstract ItemStack getHeldItem(); + + public abstract ItemStack getEquipmentInSlot(int slotIn); + + public abstract ItemStack getCurrentArmor(int slotIn); + + public abstract void setCurrentItemOrArmor(int slotIn, ItemStack stack); + + public void setSprinting(boolean sprinting) + { + super.setSprinting(sprinting); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (iattributeinstance.getModifier(sprintingSpeedBoostModifierUUID) != null) + { + iattributeinstance.removeModifier(sprintingSpeedBoostModifier); + } + + if (sprinting) + { + iattributeinstance.applyModifier(sprintingSpeedBoostModifier); + } + } + + public abstract ItemStack[] getInventory(); + + protected float getSoundVolume() + { + return 1.0F; + } + + protected float getSoundPitch() + { + return this.isChild() ? (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.5F : (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F; + } + + protected boolean isMovementBlocked() + { + return this.getHealth() <= 0.0F; + } + + public void dismountEntity(Entity entityIn) + { + double d0 = entityIn.posX; + double d1 = entityIn.getEntityBoundingBox().minY + (double)entityIn.height; + double d2 = entityIn.posZ; + int i = 1; + + for (int j = -i; j <= i; ++j) + { + for (int k = -i; k < i; ++k) + { + if (j != 0 || k != 0) + { + int l = (int)(this.posX + (double)j); + int i1 = (int)(this.posZ + (double)k); + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox().offset((double)j, 1.0D, (double)k); + + if (this.worldObj.getCollisionBoxes(axisalignedbb).isEmpty()) + { + if (World.doesBlockHaveSolidTopSurface(this.worldObj, new BlockPos(l, (int)this.posY, i1))) + { + this.setPositionAndUpdate(this.posX + (double)j, this.posY + 1.0D, this.posZ + (double)k); + return; + } + + if (World.doesBlockHaveSolidTopSurface(this.worldObj, new BlockPos(l, (int)this.posY - 1, i1)) || this.worldObj.getBlockState(new BlockPos(l, (int)this.posY - 1, i1)).getBlock().getMaterial() == Material.water) + { + d0 = this.posX + (double)j; + d1 = this.posY + 1.0D; + d2 = this.posZ + (double)k; + } + } + } + } + } + + this.setPositionAndUpdate(d0, d1, d2); + } + + public boolean getAlwaysRenderNameTagForRender() + { + return false; + } + + protected float getJumpUpwardsMotion() + { + return 0.42F; + } + + protected void jump() + { + this.motionY = (double)this.getJumpUpwardsMotion(); + + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + if (this.isSprinting()) + { + float f = this.rotationYaw * 0.017453292F; + this.motionX -= (double)(MathHelper.sin(f) * 0.2F); + this.motionZ += (double)(MathHelper.cos(f) * 0.2F); + } + + this.isAirBorne = true; + } + + protected void updateAITick() + { + this.motionY += 0.03999999910593033D; + } + + protected void handleJumpLava() + { + this.motionY += 0.03999999910593033D; + } + + public void moveEntityWithHeading(float strafe, float forward) + { + if (this.isServerWorld()) + { + if (!this.isInWater() || this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.isFlying) + { + if (!this.isInLava() || this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.isFlying) + { + float f4 = 0.91F; + + if (this.onGround) + { + f4 = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + float f = 0.16277136F / (f4 * f4 * f4); + float f5; + + if (this.onGround) + { + f5 = this.getAIMoveSpeed() * f; + } + else + { + f5 = this.jumpMovementFactor; + } + + this.moveFlying(strafe, forward, f5); + f4 = 0.91F; + + if (this.onGround) + { + f4 = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.91F; + } + + if (this.isOnLadder()) + { + float f6 = 0.15F; + this.motionX = MathHelper.clamp_double(this.motionX, (double)(-f6), (double)f6); + this.motionZ = MathHelper.clamp_double(this.motionZ, (double)(-f6), (double)f6); + this.fallDistance = 0.0F; + + if (this.motionY < -0.15D) + { + this.motionY = -0.15D; + } + + boolean flag = this.isSneaking() && this instanceof EntityPlayer; + + if (flag && this.motionY < 0.0D) + { + this.motionY = 0.0D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.isCollidedHorizontally && this.isOnLadder()) + { + this.motionY = 0.2D; + } + + if (this.worldObj.isRemote && (!this.worldObj.isBlockLoaded(new BlockPos((int)this.posX, 0, (int)this.posZ)) || !this.worldObj.getChunkFromBlockCoords(new BlockPos((int)this.posX, 0, (int)this.posZ)).isLoaded())) + { + if (this.posY > 0.0D) + { + this.motionY = -0.1D; + } + else + { + this.motionY = 0.0D; + } + } + else + { + this.motionY -= 0.08D; + } + + this.motionY *= 0.9800000190734863D; + this.motionX *= (double)f4; + this.motionZ *= (double)f4; + } + else + { + double d1 = this.posY; + this.moveFlying(strafe, forward, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + this.motionY -= 0.02D; + + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + d1, this.motionZ)) + { + this.motionY = 0.30000001192092896D; + } + } + } + else + { + double d0 = this.posY; + float f1 = 0.8F; + float f2 = 0.02F; + float f3 = (float)EnchantmentHelper.getDepthStriderModifier(this); + + if (f3 > 3.0F) + { + f3 = 3.0F; + } + + if (!this.onGround) + { + f3 *= 0.5F; + } + + if (f3 > 0.0F) + { + f1 += (0.54600006F - f1) * f3 / 3.0F; + f2 += (this.getAIMoveSpeed() * 1.0F - f2) * f3 / 3.0F; + } + + this.moveFlying(strafe, forward, f2); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= (double)f1; + this.motionY *= 0.800000011920929D; + this.motionZ *= (double)f1; + this.motionY -= 0.02D; + + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + d0, this.motionZ)) + { + this.motionY = 0.30000001192092896D; + } + } + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d2 = this.posX - this.prevPosX; + double d3 = this.posZ - this.prevPosZ; + float f7 = MathHelper.sqrt_double(d2 * d2 + d3 * d3) * 4.0F; + + if (f7 > 1.0F) + { + f7 = 1.0F; + } + + this.limbSwingAmount += (f7 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + public float getAIMoveSpeed() + { + return this.landMovementFactor; + } + + public void setAIMoveSpeed(float speedIn) + { + this.landMovementFactor = speedIn; + } + + public boolean attackEntityAsMob(Entity entityIn) + { + this.setLastAttacker(entityIn); + return false; + } + + public boolean isPlayerSleeping() + { + return false; + } + + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote) + { + int i = this.getArrowCountInEntity(); + + if (i > 0) + { + if (this.arrowHitTimer <= 0) + { + this.arrowHitTimer = 20 * (30 - i); + } + + --this.arrowHitTimer; + + if (this.arrowHitTimer <= 0) + { + this.setArrowCountInEntity(i - 1); + } + } + + for (int j = 0; j < 5; ++j) + { + ItemStack itemstack = this.previousEquipment[j]; + ItemStack itemstack1 = this.getEquipmentInSlot(j); + + if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) + { + ((WorldServer)this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, new S04PacketEntityEquipment(this.getEntityId(), j, itemstack1)); + + if (itemstack != null) + { + this.attributeMap.removeAttributeModifiers(itemstack.getAttributeModifiers()); + } + + if (itemstack1 != null) + { + this.attributeMap.applyAttributeModifiers(itemstack1.getAttributeModifiers()); + } + + this.previousEquipment[j] = itemstack1 == null ? null : itemstack1.copy(); + } + } + + if (this.ticksExisted % 20 == 0) + { + this.getCombatTracker().reset(); + } + } + + this.onLivingUpdate(); + double d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f = (float)(d0 * d0 + d1 * d1); + float f1 = this.renderYawOffset; + float f2 = 0.0F; + this.prevOnGroundSpeedFactor = this.onGroundSpeedFactor; + float f3 = 0.0F; + + if (f > 0.0025000002F) + { + f3 = 1.0F; + f2 = (float)Math.sqrt((double)f) * 3.0F; + f1 = (float)MathHelper.atan2(d1, d0) * 180.0F / (float)Math.PI - 90.0F; + } + + if (this.swingProgress > 0.0F) + { + f1 = this.rotationYaw; + } + + if (!this.onGround) + { + f3 = 0.0F; + } + + this.onGroundSpeedFactor += (f3 - this.onGroundSpeedFactor) * 0.3F; + this.worldObj.theProfiler.startSection("headTurn"); + f2 = this.updateDistance(f1, f2); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rangeChecks"); + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset < -180.0F) + { + this.prevRenderYawOffset -= 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) + { + this.prevRenderYawOffset += 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch < -180.0F) + { + this.prevRotationPitch -= 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead < -180.0F) + { + this.prevRotationYawHead -= 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead >= 180.0F) + { + this.prevRotationYawHead += 360.0F; + } + + this.worldObj.theProfiler.endSection(); + this.movedDistance += f2; + } + + protected float updateDistance(float p_110146_1_, float p_110146_2_) + { + float f = MathHelper.wrapAngleTo180_float(p_110146_1_ - this.renderYawOffset); + this.renderYawOffset += f * 0.3F; + float f1 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.renderYawOffset); + boolean flag = f1 < -90.0F || f1 >= 90.0F; + + if (f1 < -75.0F) + { + f1 = -75.0F; + } + + if (f1 >= 75.0F) + { + f1 = 75.0F; + } + + this.renderYawOffset = this.rotationYaw - f1; + + if (f1 * f1 > 2500.0F) + { + this.renderYawOffset += f1 * 0.2F; + } + + if (flag) + { + p_110146_2_ *= -1.0F; + } + + return p_110146_2_; + } + + public void onLivingUpdate() + { + if (this.jumpTicks > 0) + { + --this.jumpTicks; + } + + if (this.newPosRotationIncrements > 0) + { + double d0 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + double d1 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + double d2 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; + double d3 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d3 / (double)this.newPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(d0, d1, d2); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else if (!this.isServerWorld()) + { + this.motionX *= 0.98D; + this.motionY *= 0.98D; + this.motionZ *= 0.98D; + } + + if (Math.abs(this.motionX) < 0.005D) + { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) < 0.005D) + { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) < 0.005D) + { + this.motionZ = 0.0D; + } + + this.worldObj.theProfiler.startSection("ai"); + + if (this.isMovementBlocked()) + { + this.isJumping = false; + this.moveStrafing = 0.0F; + this.moveForward = 0.0F; + this.randomYawVelocity = 0.0F; + } + else if (this.isServerWorld()) + { + this.worldObj.theProfiler.startSection("newAi"); + this.updateEntityActionState(); + this.worldObj.theProfiler.endSection(); + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("jump"); + + if (this.isJumping) + { + if (this.isInWater()) + { + this.updateAITick(); + } + else if (this.isInLava()) + { + this.handleJumpLava(); + } + else if (this.onGround && this.jumpTicks == 0) + { + this.jump(); + this.jumpTicks = 10; + } + } + else + { + this.jumpTicks = 0; + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("travel"); + this.moveStrafing *= 0.98F; + this.moveForward *= 0.98F; + this.randomYawVelocity *= 0.9F; + this.moveEntityWithHeading(this.moveStrafing, this.moveForward); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("push"); + + if (!this.worldObj.isRemote) + { + this.collideWithNearbyEntities(); + } + + this.worldObj.theProfiler.endSection(); + } + + protected void updateEntityActionState() + { + } + + protected void collideWithNearbyEntities() + { + List list = this.worldObj.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D), Predicates. and (EntitySelectors.NOT_SPECTATING, new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_.canBePushed(); + } + })); + + if (!list.isEmpty()) + { + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + this.collideWithEntity(entity); + } + } + } + + protected void collideWithEntity(Entity entityIn) + { + entityIn.applyEntityCollision(this); + } + + public void mountEntity(Entity entityIn) + { + if (this.ridingEntity != null && entityIn == null) + { + if (!this.worldObj.isRemote) + { + this.dismountEntity(this.ridingEntity); + } + + if (this.ridingEntity != null) + { + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } + else + { + super.mountEntity(entityIn); + } + } + + public void updateRidden() + { + super.updateRidden(); + this.prevOnGroundSpeedFactor = this.onGroundSpeedFactor; + this.onGroundSpeedFactor = 0.0F; + this.fallDistance = 0.0F; + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) + { + this.newPosX = x; + this.newPosY = y; + this.newPosZ = z; + this.newRotationYaw = (double)yaw; + this.newRotationPitch = (double)pitch; + this.newPosRotationIncrements = posRotationIncrements; + } + + public void setJumping(boolean jumping) + { + this.isJumping = jumping; + } + + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) + { + if (!p_71001_1_.isDead && !this.worldObj.isRemote) + { + EntityTracker entitytracker = ((WorldServer)this.worldObj).getEntityTracker(); + + if (p_71001_1_ instanceof EntityItem) + { + entitytracker.sendToAllTrackingEntity(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + + if (p_71001_1_ instanceof EntityArrow) + { + entitytracker.sendToAllTrackingEntity(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + + if (p_71001_1_ instanceof EntityXPOrb) + { + entitytracker.sendToAllTrackingEntity(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + } + } + + public boolean canEntityBeSeen(Entity entityIn) + { + return this.worldObj.rayTraceBlocks(new Vec3(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), new Vec3(entityIn.posX, entityIn.posY + (double)entityIn.getEyeHeight(), entityIn.posZ)) == null; + } + + public Vec3 getLookVec() + { + return this.getLook(1.0F); + } + + public Vec3 getLook(float partialTicks) + { + if (partialTicks == 1.0F) + { + return this.getVectorForRotation(this.rotationPitch, this.rotationYawHead); + } + else + { + float f = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * partialTicks; + float f1 = this.prevRotationYawHead + (this.rotationYawHead - this.prevRotationYawHead) * partialTicks; + return this.getVectorForRotation(f, f1); + } + } + + public float getSwingProgress(float partialTickTime) + { + float f = this.swingProgress - this.prevSwingProgress; + + if (f < 0.0F) + { + ++f; + } + + return this.prevSwingProgress + f * partialTickTime; + } + + public boolean isServerWorld() + { + return !this.worldObj.isRemote; + } + + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + public boolean canBePushed() + { + return !this.isDead; + } + + protected void setBeenAttacked() + { + this.velocityChanged = this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); + } + + public float getRotationYawHead() + { + return this.rotationYawHead; + } + + public void setRotationYawHead(float rotation) + { + this.rotationYawHead = rotation; + } + + public void setRenderYawOffset(float offset) + { + this.renderYawOffset = offset; + } + + public float getAbsorptionAmount() + { + return this.absorptionAmount; + } + + public void setAbsorptionAmount(float amount) + { + if (amount < 0.0F) + { + amount = 0.0F; + } + + this.absorptionAmount = amount; + } + + public Team getTeam() + { + return this.worldObj.getScoreboard().getPlayersTeam(this.getUniqueID().toString()); + } + + public boolean isOnSameTeam(EntityLivingBase otherEntity) + { + return this.isOnTeam(otherEntity.getTeam()); + } + + public boolean isOnTeam(Team teamIn) + { + return this.getTeam() != null ? this.getTeam().isSameTeam(teamIn) : false; + } + + public void sendEnterCombat() + { + } + + public void sendEndCombat() + { + } + + protected void markPotionsDirty() + { + this.potionsNeedUpdate = true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java new file mode 100644 index 0000000..5292b52 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java @@ -0,0 +1,132 @@ +package net.minecraft.entity; + +import io.netty.buffer.ByteBuf; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityMinecartCommandBlock extends EntityMinecart +{ + private final CommandBlockLogic commandBlockLogic = new CommandBlockLogic() + { + public void updateCommand() + { + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(23, this.getCommand()); + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(24, IChatComponent.Serializer.componentToJson(this.getLastOutput())); + } + public int func_145751_f() + { + return 1; + } + public void func_145757_a(ByteBuf p_145757_1_) + { + p_145757_1_.writeInt(EntityMinecartCommandBlock.this.getEntityId()); + } + public BlockPos getPosition() + { + return new BlockPos(EntityMinecartCommandBlock.this.posX, EntityMinecartCommandBlock.this.posY + 0.5D, EntityMinecartCommandBlock.this.posZ); + } + public Vec3 getPositionVector() + { + return new Vec3(EntityMinecartCommandBlock.this.posX, EntityMinecartCommandBlock.this.posY, EntityMinecartCommandBlock.this.posZ); + } + public World getEntityWorld() + { + return EntityMinecartCommandBlock.this.worldObj; + } + public Entity getCommandSenderEntity() + { + return EntityMinecartCommandBlock.this; + } + }; + private int activatorRailCooldown = 0; + + public EntityMinecartCommandBlock(World worldIn) + { + super(worldIn); + } + + public EntityMinecartCommandBlock(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + protected void entityInit() + { + super.entityInit(); + this.getDataWatcher().addObject(23, ""); + this.getDataWatcher().addObject(24, ""); + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.commandBlockLogic.readDataFromNBT(tagCompund); + this.getDataWatcher().updateObject(23, this.getCommandBlockLogic().getCommand()); + this.getDataWatcher().updateObject(24, IChatComponent.Serializer.componentToJson(this.getCommandBlockLogic().getLastOutput())); + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + this.commandBlockLogic.writeDataToNBT(tagCompound); + } + + public EntityMinecart.EnumMinecartType getMinecartType() + { + return EntityMinecart.EnumMinecartType.COMMAND_BLOCK; + } + + public IBlockState getDefaultDisplayTile() + { + return Blocks.command_block.getDefaultState(); + } + + public CommandBlockLogic getCommandBlockLogic() + { + return this.commandBlockLogic; + } + + public void onActivatorRailPass(int x, int y, int z, boolean receivingPower) + { + if (receivingPower && this.ticksExisted - this.activatorRailCooldown >= 4) + { + this.getCommandBlockLogic().trigger(this.worldObj); + this.activatorRailCooldown = this.ticksExisted; + } + } + + public boolean interactFirst(EntityPlayer playerIn) + { + this.commandBlockLogic.tryOpenEditCommandBlock(playerIn); + return false; + } + + public void onDataWatcherUpdate(int dataID) + { + super.onDataWatcherUpdate(dataID); + + if (dataID == 24) + { + try + { + this.commandBlockLogic.setLastOutput(IChatComponent.Serializer.jsonToComponent(this.getDataWatcher().getWatchableObjectString(24))); + } + catch (Throwable var3) + { + ; + } + } + else if (dataID == 23) + { + this.commandBlockLogic.setCommand(this.getDataWatcher().getWatchableObjectString(23)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntitySpawnPlacementRegistry.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntitySpawnPlacementRegistry.java new file mode 100644 index 0000000..d00521f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntitySpawnPlacementRegistry.java @@ -0,0 +1,82 @@ +package net.minecraft.entity; + +import com.google.common.collect.Maps; +import java.util.HashMap; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCaveSpider; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntityEndermite; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityGiantZombie; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.passive.EntityWolf; + +public class EntitySpawnPlacementRegistry +{ + private static final HashMap ENTITY_PLACEMENTS = Maps.newHashMap(); + + public static EntityLiving.SpawnPlacementType getPlacementForEntity(Class entityClass) + { + return (EntityLiving.SpawnPlacementType)ENTITY_PLACEMENTS.get(entityClass); + } + + static + { + ENTITY_PLACEMENTS.put(EntityBat.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityChicken.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityCow.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityHorse.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityMooshroom.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityOcelot.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityPig.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityRabbit.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySheep.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySnowman.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySquid.class, EntityLiving.SpawnPlacementType.IN_WATER); + ENTITY_PLACEMENTS.put(EntityIronGolem.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityWolf.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityVillager.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityDragon.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityWither.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityBlaze.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityCaveSpider.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityCreeper.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityEnderman.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityEndermite.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityGhast.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityGiantZombie.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityGuardian.class, EntityLiving.SpawnPlacementType.IN_WATER); + ENTITY_PLACEMENTS.put(EntityMagmaCube.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityPigZombie.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySilverfish.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySkeleton.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySlime.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntitySpider.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityWitch.class, EntityLiving.SpawnPlacementType.ON_GROUND); + ENTITY_PLACEMENTS.put(EntityZombie.class, EntityLiving.SpawnPlacementType.ON_GROUND); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityTracker.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityTracker.java new file mode 100644 index 0000000..9543d82 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityTracker.java @@ -0,0 +1,334 @@ +package net.minecraft.entity; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.network.Packet; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityTracker +{ + private static final Logger logger = LogManager.getLogger(); + private final WorldServer theWorld; + private Set trackedEntities = Sets.newHashSet(); + private IntHashMap trackedEntityHashTable = new IntHashMap(); + private int maxTrackingDistanceThreshold; + + public EntityTracker(WorldServer theWorldIn) + { + this.theWorld = theWorldIn; + this.maxTrackingDistanceThreshold = theWorldIn.getMinecraftServer().getConfigurationManager().getEntityViewDistance(); + } + + public void trackEntity(Entity entityIn) + { + if (entityIn instanceof EntityPlayerMP) + { + this.trackEntity(entityIn, 512, 2); + EntityPlayerMP entityplayermp = (EntityPlayerMP)entityIn; + + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) + { + if (entitytrackerentry.trackedEntity != entityplayermp) + { + entitytrackerentry.updatePlayerEntity(entityplayermp); + } + } + } + else if (entityIn instanceof EntityFishHook) + { + this.addEntityToTracker(entityIn, 64, 5, true); + } + else if (entityIn instanceof EntityArrow) + { + this.addEntityToTracker(entityIn, 64, 20, false); + } + else if (entityIn instanceof EntitySmallFireball) + { + this.addEntityToTracker(entityIn, 64, 10, false); + } + else if (entityIn instanceof EntityFireball) + { + this.addEntityToTracker(entityIn, 64, 10, false); + } + else if (entityIn instanceof EntitySnowball) + { + this.addEntityToTracker(entityIn, 64, 10, true); + } + else if (entityIn instanceof EntityEnderPearl) + { + this.addEntityToTracker(entityIn, 64, 10, true); + } + else if (entityIn instanceof EntityEnderEye) + { + this.addEntityToTracker(entityIn, 64, 4, true); + } + else if (entityIn instanceof EntityEgg) + { + this.addEntityToTracker(entityIn, 64, 10, true); + } + else if (entityIn instanceof EntityPotion) + { + this.addEntityToTracker(entityIn, 64, 10, true); + } + else if (entityIn instanceof EntityExpBottle) + { + this.addEntityToTracker(entityIn, 64, 10, true); + } + else if (entityIn instanceof EntityFireworkRocket) + { + this.addEntityToTracker(entityIn, 64, 10, true); + } + else if (entityIn instanceof EntityItem) + { + this.addEntityToTracker(entityIn, 64, 20, true); + } + else if (entityIn instanceof EntityMinecart) + { + this.addEntityToTracker(entityIn, 80, 3, true); + } + else if (entityIn instanceof EntityBoat) + { + this.addEntityToTracker(entityIn, 80, 3, true); + } + else if (entityIn instanceof EntitySquid) + { + this.addEntityToTracker(entityIn, 64, 3, true); + } + else if (entityIn instanceof EntityWither) + { + this.addEntityToTracker(entityIn, 80, 3, false); + } + else if (entityIn instanceof EntityBat) + { + this.addEntityToTracker(entityIn, 80, 3, false); + } + else if (entityIn instanceof EntityDragon) + { + this.addEntityToTracker(entityIn, 160, 3, true); + } + else if (entityIn instanceof IAnimals) + { + this.addEntityToTracker(entityIn, 80, 3, true); + } + else if (entityIn instanceof EntityTNTPrimed) + { + this.addEntityToTracker(entityIn, 160, 10, true); + } + else if (entityIn instanceof EntityFallingBlock) + { + this.addEntityToTracker(entityIn, 160, 20, true); + } + else if (entityIn instanceof EntityHanging) + { + this.addEntityToTracker(entityIn, 160, Integer.MAX_VALUE, false); + } + else if (entityIn instanceof EntityArmorStand) + { + this.addEntityToTracker(entityIn, 160, 3, true); + } + else if (entityIn instanceof EntityXPOrb) + { + this.addEntityToTracker(entityIn, 160, 20, true); + } + else if (entityIn instanceof EntityEnderCrystal) + { + this.addEntityToTracker(entityIn, 256, Integer.MAX_VALUE, false); + } + } + + public void trackEntity(Entity entityIn, int trackingRange, int updateFrequency) + { + this.addEntityToTracker(entityIn, trackingRange, updateFrequency, false); + } + + public void addEntityToTracker(Entity entityIn, int trackingRange, final int updateFrequency, boolean sendVelocityUpdates) + { + if (trackingRange > this.maxTrackingDistanceThreshold) + { + trackingRange = this.maxTrackingDistanceThreshold; + } + + try + { + if (this.trackedEntityHashTable.containsItem(entityIn.getEntityId())) + { + throw new IllegalStateException("Entity is already tracked!"); + } + + EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(entityIn, trackingRange, updateFrequency, sendVelocityUpdates); + this.trackedEntities.add(entitytrackerentry); + this.trackedEntityHashTable.addKey(entityIn.getEntityId(), entitytrackerentry); + entitytrackerentry.updatePlayerEntities(this.theWorld.playerEntities); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding entity to track"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity To Track"); + crashreportcategory.addCrashSection("Tracking range", trackingRange + " blocks"); + crashreportcategory.addCrashSectionCallable("Update interval", new Callable() + { + public String call() throws Exception + { + String s = "Once per " + updateFrequency + " ticks"; + + if (updateFrequency == Integer.MAX_VALUE) + { + s = "Maximum (" + s + ")"; + } + + return s; + } + }); + entityIn.addEntityCrashInfo(crashreportcategory); + CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Entity That Is Already Tracked"); + ((EntityTrackerEntry)this.trackedEntityHashTable.lookup(entityIn.getEntityId())).trackedEntity.addEntityCrashInfo(crashreportcategory1); + + try + { + throw new ReportedException(crashreport); + } + catch (ReportedException reportedexception) + { + logger.error((String)"\"Silently\" catching entity tracking error.", (Throwable)reportedexception); + } + } + } + + public void untrackEntity(Entity entityIn) + { + if (entityIn instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)entityIn; + + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) + { + entitytrackerentry.removeFromTrackedPlayers(entityplayermp); + } + } + + EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry)this.trackedEntityHashTable.removeObject(entityIn.getEntityId()); + + if (entitytrackerentry1 != null) + { + this.trackedEntities.remove(entitytrackerentry1); + entitytrackerentry1.sendDestroyEntityPacketToTrackedPlayers(); + } + } + + public void updateTrackedEntities() + { + List list = Lists.newArrayList(); + + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) + { + entitytrackerentry.updatePlayerList(this.theWorld.playerEntities); + + if (entitytrackerentry.playerEntitiesUpdated && entitytrackerentry.trackedEntity instanceof EntityPlayerMP) + { + list.add((EntityPlayerMP)entitytrackerentry.trackedEntity); + } + } + + for (int i = 0; i < ((List)list).size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)list.get(i); + + for (EntityTrackerEntry entitytrackerentry1 : this.trackedEntities) + { + if (entitytrackerentry1.trackedEntity != entityplayermp) + { + entitytrackerentry1.updatePlayerEntity(entityplayermp); + } + } + } + } + + public void func_180245_a(EntityPlayerMP p_180245_1_) + { + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) + { + if (entitytrackerentry.trackedEntity == p_180245_1_) + { + entitytrackerentry.updatePlayerEntities(this.theWorld.playerEntities); + } + else + { + entitytrackerentry.updatePlayerEntity(p_180245_1_); + } + } + } + + public void sendToAllTrackingEntity(Entity entityIn, Packet p_151247_2_) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(entityIn.getEntityId()); + + if (entitytrackerentry != null) + { + entitytrackerentry.sendPacketToTrackedPlayers(p_151247_2_); + } + } + + public void func_151248_b(Entity entityIn, Packet p_151248_2_) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(entityIn.getEntityId()); + + if (entitytrackerentry != null) + { + entitytrackerentry.func_151261_b(p_151248_2_); + } + } + + public void removePlayerFromTrackers(EntityPlayerMP p_72787_1_) + { + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) + { + entitytrackerentry.removeTrackedPlayerSymmetric(p_72787_1_); + } + } + + public void func_85172_a(EntityPlayerMP p_85172_1_, Chunk p_85172_2_) + { + for (EntityTrackerEntry entitytrackerentry : this.trackedEntities) + { + if (entitytrackerentry.trackedEntity != p_85172_1_ && entitytrackerentry.trackedEntity.chunkCoordX == p_85172_2_.xPosition && entitytrackerentry.trackedEntity.chunkCoordZ == p_85172_2_.zPosition) + { + entitytrackerentry.updatePlayerEntity(p_85172_1_); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EntityTrackerEntry.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityTrackerEntry.java new file mode 100644 index 0000000..6743ba9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EntityTrackerEntry.java @@ -0,0 +1,614 @@ +package net.minecraft.entity; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Items; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.storage.MapData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityTrackerEntry +{ + private static final Logger logger = LogManager.getLogger(); + public Entity trackedEntity; + public int trackingDistanceThreshold; + public int updateFrequency; + public int encodedPosX; + public int encodedPosY; + public int encodedPosZ; + public int encodedRotationYaw; + public int encodedRotationPitch; + public int lastHeadMotion; + public double lastTrackedEntityMotionX; + public double lastTrackedEntityMotionY; + public double motionZ; + public int updateCounter; + private double lastTrackedEntityPosX; + private double lastTrackedEntityPosY; + private double lastTrackedEntityPosZ; + private boolean firstUpdateDone; + private boolean sendVelocityUpdates; + private int ticksSinceLastForcedTeleport; + private Entity field_85178_v; + private boolean ridingEntity; + private boolean onGround; + public boolean playerEntitiesUpdated; + public Set trackingPlayers = Sets.newHashSet(); + + public EntityTrackerEntry(Entity trackedEntityIn, int trackingDistanceThresholdIn, int updateFrequencyIn, boolean sendVelocityUpdatesIn) + { + this.trackedEntity = trackedEntityIn; + this.trackingDistanceThreshold = trackingDistanceThresholdIn; + this.updateFrequency = updateFrequencyIn; + this.sendVelocityUpdates = sendVelocityUpdatesIn; + this.encodedPosX = MathHelper.floor_double(trackedEntityIn.posX * 32.0D); + this.encodedPosY = MathHelper.floor_double(trackedEntityIn.posY * 32.0D); + this.encodedPosZ = MathHelper.floor_double(trackedEntityIn.posZ * 32.0D); + this.encodedRotationYaw = MathHelper.floor_float(trackedEntityIn.rotationYaw * 256.0F / 360.0F); + this.encodedRotationPitch = MathHelper.floor_float(trackedEntityIn.rotationPitch * 256.0F / 360.0F); + this.lastHeadMotion = MathHelper.floor_float(trackedEntityIn.getRotationYawHead() * 256.0F / 360.0F); + this.onGround = trackedEntityIn.onGround; + } + + public boolean equals(Object p_equals_1_) + { + return p_equals_1_ instanceof EntityTrackerEntry ? ((EntityTrackerEntry)p_equals_1_).trackedEntity.getEntityId() == this.trackedEntity.getEntityId() : false; + } + + public int hashCode() + { + return this.trackedEntity.getEntityId(); + } + + public void updatePlayerList(List players) + { + this.playerEntitiesUpdated = false; + + if (!this.firstUpdateDone || this.trackedEntity.getDistanceSq(this.lastTrackedEntityPosX, this.lastTrackedEntityPosY, this.lastTrackedEntityPosZ) > 16.0D) + { + this.lastTrackedEntityPosX = this.trackedEntity.posX; + this.lastTrackedEntityPosY = this.trackedEntity.posY; + this.lastTrackedEntityPosZ = this.trackedEntity.posZ; + this.firstUpdateDone = true; + this.playerEntitiesUpdated = true; + this.updatePlayerEntities(players); + } + + if (this.field_85178_v != this.trackedEntity.ridingEntity || this.trackedEntity.ridingEntity != null && this.updateCounter % 60 == 0) + { + this.field_85178_v = this.trackedEntity.ridingEntity; + this.sendPacketToTrackedPlayers(new S1BPacketEntityAttach(0, this.trackedEntity, this.trackedEntity.ridingEntity)); + } + + if (this.trackedEntity instanceof EntityItemFrame && this.updateCounter % 10 == 0) + { + EntityItemFrame entityitemframe = (EntityItemFrame)this.trackedEntity; + ItemStack itemstack = entityitemframe.getDisplayedItem(); + + if (itemstack != null && itemstack.getItem() instanceof ItemMap) + { + MapData mapdata = Items.filled_map.getMapData(itemstack, this.trackedEntity.worldObj); + + for (EntityPlayer entityplayer : players) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)entityplayer; + mapdata.updateVisiblePlayers(entityplayermp, itemstack); + Packet packet = Items.filled_map.createMapDataPacket(itemstack, this.trackedEntity.worldObj, entityplayermp); + + if (packet != null) + { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + } + + this.sendMetadataToAllAssociatedPlayers(); + } + + if (this.updateCounter % this.updateFrequency == 0 || this.trackedEntity.isAirBorne || this.trackedEntity.getDataWatcher().hasObjectChanged()) + { + if (this.trackedEntity.ridingEntity == null) + { + ++this.ticksSinceLastForcedTeleport; + int k = MathHelper.floor_double(this.trackedEntity.posX * 32.0D); + int j1 = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); + int k1 = MathHelper.floor_double(this.trackedEntity.posZ * 32.0D); + int l1 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); + int i2 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); + int j2 = k - this.encodedPosX; + int k2 = j1 - this.encodedPosY; + int i = k1 - this.encodedPosZ; + Packet packet1 = null; + boolean flag = Math.abs(j2) >= 4 || Math.abs(k2) >= 4 || Math.abs(i) >= 4 || this.updateCounter % 60 == 0; + boolean flag1 = Math.abs(l1 - this.encodedRotationYaw) >= 4 || Math.abs(i2 - this.encodedRotationPitch) >= 4; + + if (this.updateCounter > 0 || this.trackedEntity instanceof EntityArrow) + { + if (j2 >= -128 && j2 < 128 && k2 >= -128 && k2 < 128 && i >= -128 && i < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity && this.onGround == this.trackedEntity.onGround) + { + if ((!flag || !flag1) && !(this.trackedEntity instanceof EntityArrow)) + { + if (flag) + { + packet1 = new S14PacketEntity.S15PacketEntityRelMove(this.trackedEntity.getEntityId(), (byte)j2, (byte)k2, (byte)i, this.trackedEntity.onGround); + } + else if (flag1) + { + packet1 = new S14PacketEntity.S16PacketEntityLook(this.trackedEntity.getEntityId(), (byte)l1, (byte)i2, this.trackedEntity.onGround); + } + } + else + { + packet1 = new S14PacketEntity.S17PacketEntityLookMove(this.trackedEntity.getEntityId(), (byte)j2, (byte)k2, (byte)i, (byte)l1, (byte)i2, this.trackedEntity.onGround); + } + } + else + { + this.onGround = this.trackedEntity.onGround; + this.ticksSinceLastForcedTeleport = 0; + packet1 = new S18PacketEntityTeleport(this.trackedEntity.getEntityId(), k, j1, k1, (byte)l1, (byte)i2, this.trackedEntity.onGround); + } + } + + if (this.sendVelocityUpdates) + { + double d0 = this.trackedEntity.motionX - this.lastTrackedEntityMotionX; + double d1 = this.trackedEntity.motionY - this.lastTrackedEntityMotionY; + double d2 = this.trackedEntity.motionZ - this.motionZ; + double d3 = 0.02D; + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d4 > d3 * d3 || d4 > 0.0D && this.trackedEntity.motionX == 0.0D && this.trackedEntity.motionY == 0.0D && this.trackedEntity.motionZ == 0.0D) + { + this.lastTrackedEntityMotionX = this.trackedEntity.motionX; + this.lastTrackedEntityMotionY = this.trackedEntity.motionY; + this.motionZ = this.trackedEntity.motionZ; + this.sendPacketToTrackedPlayers(new S12PacketEntityVelocity(this.trackedEntity.getEntityId(), this.lastTrackedEntityMotionX, this.lastTrackedEntityMotionY, this.motionZ)); + } + } + + if (packet1 != null) + { + this.sendPacketToTrackedPlayers(packet1); + } + + this.sendMetadataToAllAssociatedPlayers(); + + if (flag) + { + this.encodedPosX = k; + this.encodedPosY = j1; + this.encodedPosZ = k1; + } + + if (flag1) + { + this.encodedRotationYaw = l1; + this.encodedRotationPitch = i2; + } + + this.ridingEntity = false; + } + else + { + int j = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); + int i1 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); + boolean flag2 = Math.abs(j - this.encodedRotationYaw) >= 4 || Math.abs(i1 - this.encodedRotationPitch) >= 4; + + if (flag2) + { + this.sendPacketToTrackedPlayers(new S14PacketEntity.S16PacketEntityLook(this.trackedEntity.getEntityId(), (byte)j, (byte)i1, this.trackedEntity.onGround)); + this.encodedRotationYaw = j; + this.encodedRotationPitch = i1; + } + + this.encodedPosX = MathHelper.floor_double(this.trackedEntity.posX * 32.0D); + this.encodedPosY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); + this.encodedPosZ = MathHelper.floor_double(this.trackedEntity.posZ * 32.0D); + this.sendMetadataToAllAssociatedPlayers(); + this.ridingEntity = true; + } + + int l = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); + + if (Math.abs(l - this.lastHeadMotion) >= 4) + { + this.sendPacketToTrackedPlayers(new S19PacketEntityHeadLook(this.trackedEntity, (byte)l)); + this.lastHeadMotion = l; + } + + this.trackedEntity.isAirBorne = false; + } + + ++this.updateCounter; + + if (this.trackedEntity.velocityChanged) + { + this.func_151261_b(new S12PacketEntityVelocity(this.trackedEntity)); + this.trackedEntity.velocityChanged = false; + } + } + + private void sendMetadataToAllAssociatedPlayers() + { + DataWatcher datawatcher = this.trackedEntity.getDataWatcher(); + + if (datawatcher.hasObjectChanged()) + { + this.func_151261_b(new S1CPacketEntityMetadata(this.trackedEntity.getEntityId(), datawatcher, false)); + } + + if (this.trackedEntity instanceof EntityLivingBase) + { + ServersideAttributeMap serversideattributemap = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); + Set set = serversideattributemap.getAttributeInstanceSet(); + + if (!set.isEmpty()) + { + this.func_151261_b(new S20PacketEntityProperties(this.trackedEntity.getEntityId(), set)); + } + + set.clear(); + } + } + + public void sendPacketToTrackedPlayers(Packet packetIn) + { + for (EntityPlayerMP entityplayermp : this.trackingPlayers) + { + entityplayermp.playerNetServerHandler.sendPacket(packetIn); + } + } + + public void func_151261_b(Packet packetIn) + { + this.sendPacketToTrackedPlayers(packetIn); + + if (this.trackedEntity instanceof EntityPlayerMP) + { + ((EntityPlayerMP)this.trackedEntity).playerNetServerHandler.sendPacket(packetIn); + } + } + + public void sendDestroyEntityPacketToTrackedPlayers() + { + for (EntityPlayerMP entityplayermp : this.trackingPlayers) + { + entityplayermp.removeEntity(this.trackedEntity); + } + } + + public void removeFromTrackedPlayers(EntityPlayerMP playerMP) + { + if (this.trackingPlayers.contains(playerMP)) + { + playerMP.removeEntity(this.trackedEntity); + this.trackingPlayers.remove(playerMP); + } + } + + public void updatePlayerEntity(EntityPlayerMP playerMP) + { + if (playerMP != this.trackedEntity) + { + if (this.func_180233_c(playerMP)) + { + if (!this.trackingPlayers.contains(playerMP) && (this.isPlayerWatchingThisChunk(playerMP) || this.trackedEntity.forceSpawn)) + { + this.trackingPlayers.add(playerMP); + Packet packet = this.createSpawnPacket(); + playerMP.playerNetServerHandler.sendPacket(packet); + + if (!this.trackedEntity.getDataWatcher().getIsBlank()) + { + playerMP.playerNetServerHandler.sendPacket(new S1CPacketEntityMetadata(this.trackedEntity.getEntityId(), this.trackedEntity.getDataWatcher(), true)); + } + + NBTTagCompound nbttagcompound = this.trackedEntity.getNBTTagCompound(); + + if (nbttagcompound != null) + { + playerMP.playerNetServerHandler.sendPacket(new S49PacketUpdateEntityNBT(this.trackedEntity.getEntityId(), nbttagcompound)); + } + + if (this.trackedEntity instanceof EntityLivingBase) + { + ServersideAttributeMap serversideattributemap = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); + Collection collection = serversideattributemap.getWatchedAttributes(); + + if (!collection.isEmpty()) + { + playerMP.playerNetServerHandler.sendPacket(new S20PacketEntityProperties(this.trackedEntity.getEntityId(), collection)); + } + } + + this.lastTrackedEntityMotionX = this.trackedEntity.motionX; + this.lastTrackedEntityMotionY = this.trackedEntity.motionY; + this.motionZ = this.trackedEntity.motionZ; + + if (this.sendVelocityUpdates && !(packet instanceof S0FPacketSpawnMob)) + { + playerMP.playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(this.trackedEntity.getEntityId(), this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); + } + + if (this.trackedEntity.ridingEntity != null) + { + playerMP.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this.trackedEntity, this.trackedEntity.ridingEntity)); + } + + if (this.trackedEntity instanceof EntityLiving && ((EntityLiving)this.trackedEntity).getLeashedToEntity() != null) + { + playerMP.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(1, this.trackedEntity, ((EntityLiving)this.trackedEntity).getLeashedToEntity())); + } + + if (this.trackedEntity instanceof EntityLivingBase) + { + for (int i = 0; i < 5; ++i) + { + ItemStack itemstack = ((EntityLivingBase)this.trackedEntity).getEquipmentInSlot(i); + + if (itemstack != null) + { + playerMP.playerNetServerHandler.sendPacket(new S04PacketEntityEquipment(this.trackedEntity.getEntityId(), i, itemstack)); + } + } + } + + if (this.trackedEntity instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)this.trackedEntity; + + if (entityplayer.isPlayerSleeping()) + { + playerMP.playerNetServerHandler.sendPacket(new S0APacketUseBed(entityplayer, new BlockPos(this.trackedEntity))); + } + } + + if (this.trackedEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)this.trackedEntity; + + for (PotionEffect potioneffect : entitylivingbase.getActivePotionEffects()) + { + playerMP.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.trackedEntity.getEntityId(), potioneffect)); + } + } + } + } + else if (this.trackingPlayers.contains(playerMP)) + { + this.trackingPlayers.remove(playerMP); + playerMP.removeEntity(this.trackedEntity); + } + } + } + + public boolean func_180233_c(EntityPlayerMP playerMP) + { + double d0 = playerMP.posX - (double)(this.encodedPosX / 32); + double d1 = playerMP.posZ - (double)(this.encodedPosZ / 32); + return d0 >= (double)(-this.trackingDistanceThreshold) && d0 <= (double)this.trackingDistanceThreshold && d1 >= (double)(-this.trackingDistanceThreshold) && d1 <= (double)this.trackingDistanceThreshold && this.trackedEntity.isSpectatedByPlayer(playerMP); + } + + private boolean isPlayerWatchingThisChunk(EntityPlayerMP playerMP) + { + return playerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(playerMP, this.trackedEntity.chunkCoordX, this.trackedEntity.chunkCoordZ); + } + + public void updatePlayerEntities(List players) + { + for (int i = 0; i < players.size(); ++i) + { + this.updatePlayerEntity((EntityPlayerMP)players.get(i)); + } + } + + private Packet createSpawnPacket() + { + if (this.trackedEntity.isDead) + { + logger.warn("Fetching addPacket for removed entity"); + } + + if (this.trackedEntity instanceof EntityItem) + { + return new S0EPacketSpawnObject(this.trackedEntity, 2, 1); + } + else if (this.trackedEntity instanceof EntityPlayerMP) + { + return new S0CPacketSpawnPlayer((EntityPlayer)this.trackedEntity); + } + else if (this.trackedEntity instanceof EntityMinecart) + { + EntityMinecart entityminecart = (EntityMinecart)this.trackedEntity; + return new S0EPacketSpawnObject(this.trackedEntity, 10, entityminecart.getMinecartType().getNetworkID()); + } + else if (this.trackedEntity instanceof EntityBoat) + { + return new S0EPacketSpawnObject(this.trackedEntity, 1); + } + else if (this.trackedEntity instanceof IAnimals) + { + this.lastHeadMotion = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); + return new S0FPacketSpawnMob((EntityLivingBase)this.trackedEntity); + } + else if (this.trackedEntity instanceof EntityFishHook) + { + Entity entity1 = ((EntityFishHook)this.trackedEntity).angler; + return new S0EPacketSpawnObject(this.trackedEntity, 90, entity1 != null ? entity1.getEntityId() : this.trackedEntity.getEntityId()); + } + else if (this.trackedEntity instanceof EntityArrow) + { + Entity entity = ((EntityArrow)this.trackedEntity).shootingEntity; + return new S0EPacketSpawnObject(this.trackedEntity, 60, entity != null ? entity.getEntityId() : this.trackedEntity.getEntityId()); + } + else if (this.trackedEntity instanceof EntitySnowball) + { + return new S0EPacketSpawnObject(this.trackedEntity, 61); + } + else if (this.trackedEntity instanceof EntityPotion) + { + return new S0EPacketSpawnObject(this.trackedEntity, 73, ((EntityPotion)this.trackedEntity).getPotionDamage()); + } + else if (this.trackedEntity instanceof EntityExpBottle) + { + return new S0EPacketSpawnObject(this.trackedEntity, 75); + } + else if (this.trackedEntity instanceof EntityEnderPearl) + { + return new S0EPacketSpawnObject(this.trackedEntity, 65); + } + else if (this.trackedEntity instanceof EntityEnderEye) + { + return new S0EPacketSpawnObject(this.trackedEntity, 72); + } + else if (this.trackedEntity instanceof EntityFireworkRocket) + { + return new S0EPacketSpawnObject(this.trackedEntity, 76); + } + else if (this.trackedEntity instanceof EntityFireball) + { + EntityFireball entityfireball = (EntityFireball)this.trackedEntity; + S0EPacketSpawnObject s0epacketspawnobject2 = null; + int i = 63; + + if (this.trackedEntity instanceof EntitySmallFireball) + { + i = 64; + } + else if (this.trackedEntity instanceof EntityWitherSkull) + { + i = 66; + } + + if (entityfireball.shootingEntity != null) + { + s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, i, ((EntityFireball)this.trackedEntity).shootingEntity.getEntityId()); + } + else + { + s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, i, 0); + } + + s0epacketspawnobject2.setSpeedX((int)(entityfireball.accelerationX * 8000.0D)); + s0epacketspawnobject2.setSpeedY((int)(entityfireball.accelerationY * 8000.0D)); + s0epacketspawnobject2.setSpeedZ((int)(entityfireball.accelerationZ * 8000.0D)); + return s0epacketspawnobject2; + } + else if (this.trackedEntity instanceof EntityEgg) + { + return new S0EPacketSpawnObject(this.trackedEntity, 62); + } + else if (this.trackedEntity instanceof EntityTNTPrimed) + { + return new S0EPacketSpawnObject(this.trackedEntity, 50); + } + else if (this.trackedEntity instanceof EntityEnderCrystal) + { + return new S0EPacketSpawnObject(this.trackedEntity, 51); + } + else if (this.trackedEntity instanceof EntityFallingBlock) + { + EntityFallingBlock entityfallingblock = (EntityFallingBlock)this.trackedEntity; + return new S0EPacketSpawnObject(this.trackedEntity, 70, Block.getStateId(entityfallingblock.getBlock())); + } + else if (this.trackedEntity instanceof EntityArmorStand) + { + return new S0EPacketSpawnObject(this.trackedEntity, 78); + } + else if (this.trackedEntity instanceof EntityPainting) + { + return new S10PacketSpawnPainting((EntityPainting)this.trackedEntity); + } + else if (this.trackedEntity instanceof EntityItemFrame) + { + EntityItemFrame entityitemframe = (EntityItemFrame)this.trackedEntity; + S0EPacketSpawnObject s0epacketspawnobject1 = new S0EPacketSpawnObject(this.trackedEntity, 71, entityitemframe.facingDirection.getHorizontalIndex()); + BlockPos blockpos1 = entityitemframe.getHangingPosition(); + s0epacketspawnobject1.setX(MathHelper.floor_float((float)(blockpos1.getX() * 32))); + s0epacketspawnobject1.setY(MathHelper.floor_float((float)(blockpos1.getY() * 32))); + s0epacketspawnobject1.setZ(MathHelper.floor_float((float)(blockpos1.getZ() * 32))); + return s0epacketspawnobject1; + } + else if (this.trackedEntity instanceof EntityLeashKnot) + { + EntityLeashKnot entityleashknot = (EntityLeashKnot)this.trackedEntity; + S0EPacketSpawnObject s0epacketspawnobject = new S0EPacketSpawnObject(this.trackedEntity, 77); + BlockPos blockpos = entityleashknot.getHangingPosition(); + s0epacketspawnobject.setX(MathHelper.floor_float((float)(blockpos.getX() * 32))); + s0epacketspawnobject.setY(MathHelper.floor_float((float)(blockpos.getY() * 32))); + s0epacketspawnobject.setZ(MathHelper.floor_float((float)(blockpos.getZ() * 32))); + return s0epacketspawnobject; + } + else if (this.trackedEntity instanceof EntityXPOrb) + { + return new S11PacketSpawnExperienceOrb((EntityXPOrb)this.trackedEntity); + } + else + { + throw new IllegalArgumentException("Don\'t know how to add " + this.trackedEntity.getClass() + "!"); + } + } + + public void removeTrackedPlayerSymmetric(EntityPlayerMP playerMP) + { + if (this.trackingPlayers.contains(playerMP)) + { + this.trackingPlayers.remove(playerMP); + playerMP.removeEntity(this.trackedEntity); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java new file mode 100644 index 0000000..98b58e4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java @@ -0,0 +1,8 @@ +package net.minecraft.entity; + +public enum EnumCreatureAttribute +{ + UNDEFINED, + UNDEAD, + ARTHROPOD; +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/EnumCreatureType.java b/Client-1.8.9/src/main/java/net/minecraft/entity/EnumCreatureType.java new file mode 100644 index 0000000..743ebe5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/EnumCreatureType.java @@ -0,0 +1,51 @@ +package net.minecraft.entity; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityAmbientCreature; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityWaterMob; +import net.minecraft.entity.passive.IAnimals; + +public enum EnumCreatureType +{ + MONSTER(IMob.class, 70, Material.air, false, false), + CREATURE(EntityAnimal.class, 10, Material.air, true, true), + AMBIENT(EntityAmbientCreature.class, 15, Material.air, true, false), + WATER_CREATURE(EntityWaterMob.class, 5, Material.water, true, false); + + private final Class creatureClass; + private final int maxNumberOfCreature; + private final Material creatureMaterial; + private final boolean isPeacefulCreature; + private final boolean isAnimal; + + private EnumCreatureType(Class creatureClassIn, int maxNumberOfCreatureIn, Material creatureMaterialIn, boolean isPeacefulCreatureIn, boolean isAnimalIn) + { + this.creatureClass = creatureClassIn; + this.maxNumberOfCreature = maxNumberOfCreatureIn; + this.creatureMaterial = creatureMaterialIn; + this.isPeacefulCreature = isPeacefulCreatureIn; + this.isAnimal = isAnimalIn; + } + + public Class getCreatureClass() + { + return this.creatureClass; + } + + public int getMaxNumberOfCreature() + { + return this.maxNumberOfCreature; + } + + public boolean getPeacefulCreature() + { + return this.isPeacefulCreature; + } + + public boolean getAnimal() + { + return this.isAnimal; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityLivingData.java b/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityLivingData.java new file mode 100644 index 0000000..88d7978 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityLivingData.java @@ -0,0 +1,5 @@ +package net.minecraft.entity; + +public interface IEntityLivingData +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityMultiPart.java b/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityMultiPart.java new file mode 100644 index 0000000..ff81a47 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityMultiPart.java @@ -0,0 +1,12 @@ +package net.minecraft.entity; + +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public interface IEntityMultiPart +{ + World getWorld(); + + boolean attackEntityFromPart(EntityDragonPart dragonPart, DamageSource source, float p_70965_3_); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityOwnable.java b/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityOwnable.java new file mode 100644 index 0000000..7049d78 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/IEntityOwnable.java @@ -0,0 +1,8 @@ +package net.minecraft.entity; + +public interface IEntityOwnable +{ + String getOwnerId(); + + Entity getOwner(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/IMerchant.java b/Client-1.8.9/src/main/java/net/minecraft/entity/IMerchant.java new file mode 100644 index 0000000..40bb76f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/IMerchant.java @@ -0,0 +1,24 @@ +package net.minecraft.entity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IChatComponent; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public interface IMerchant +{ + void setCustomer(EntityPlayer p_70932_1_); + + EntityPlayer getCustomer(); + + MerchantRecipeList getRecipes(EntityPlayer p_70934_1_); + + void setRecipes(MerchantRecipeList recipeList); + + void useRecipe(MerchantRecipe recipe); + + void verifySellingItem(ItemStack stack); + + IChatComponent getDisplayName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/INpc.java b/Client-1.8.9/src/main/java/net/minecraft/entity/INpc.java new file mode 100644 index 0000000..6975add --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/INpc.java @@ -0,0 +1,7 @@ +package net.minecraft.entity; + +import net.minecraft.entity.passive.IAnimals; + +public interface INpc extends IAnimals +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/IProjectile.java b/Client-1.8.9/src/main/java/net/minecraft/entity/IProjectile.java new file mode 100644 index 0000000..eca80c2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/IProjectile.java @@ -0,0 +1,6 @@ +package net.minecraft.entity; + +public interface IProjectile +{ + void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/IRangedAttackMob.java b/Client-1.8.9/src/main/java/net/minecraft/entity/IRangedAttackMob.java new file mode 100644 index 0000000..5d64ee4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/IRangedAttackMob.java @@ -0,0 +1,6 @@ +package net.minecraft.entity; + +public interface IRangedAttackMob +{ + void attackEntityWithRangedAttack(EntityLivingBase target, float p_82196_2_); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/NpcMerchant.java b/Client-1.8.9/src/main/java/net/minecraft/entity/NpcMerchant.java new file mode 100644 index 0000000..4f0d9b9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/NpcMerchant.java @@ -0,0 +1,57 @@ +package net.minecraft.entity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.InventoryMerchant; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public class NpcMerchant implements IMerchant +{ + private InventoryMerchant theMerchantInventory; + private EntityPlayer customer; + private MerchantRecipeList recipeList; + private IChatComponent field_175548_d; + + public NpcMerchant(EntityPlayer p_i45817_1_, IChatComponent p_i45817_2_) + { + this.customer = p_i45817_1_; + this.field_175548_d = p_i45817_2_; + this.theMerchantInventory = new InventoryMerchant(p_i45817_1_, this); + } + + public EntityPlayer getCustomer() + { + return this.customer; + } + + public void setCustomer(EntityPlayer p_70932_1_) + { + } + + public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) + { + return this.recipeList; + } + + public void setRecipes(MerchantRecipeList recipeList) + { + this.recipeList = recipeList; + } + + public void useRecipe(MerchantRecipe recipe) + { + recipe.incrementToolUses(); + } + + public void verifySellingItem(ItemStack stack) + { + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.field_175548_d != null ? this.field_175548_d : new ChatComponentTranslation("entity.Villager.name", new Object[0])); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java b/Client-1.8.9/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java new file mode 100644 index 0000000..f8ac8c6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java @@ -0,0 +1,132 @@ +package net.minecraft.entity; + +import java.util.Collection; +import java.util.UUID; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SharedMonsterAttributes +{ + private static final Logger logger = LogManager.getLogger(); + public static final IAttribute maxHealth = (new RangedAttribute((IAttribute)null, "generic.maxHealth", 20.0D, 0.0D, 1024.0D)).setDescription("Max Health").setShouldWatch(true); + public static final IAttribute followRange = (new RangedAttribute((IAttribute)null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).setDescription("Follow Range"); + public static final IAttribute knockbackResistance = (new RangedAttribute((IAttribute)null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).setDescription("Knockback Resistance"); + public static final IAttribute movementSpeed = (new RangedAttribute((IAttribute)null, "generic.movementSpeed", 0.699999988079071D, 0.0D, 1024.0D)).setDescription("Movement Speed").setShouldWatch(true); + public static final IAttribute attackDamage = new RangedAttribute((IAttribute)null, "generic.attackDamage", 2.0D, 0.0D, 2048.0D); + + public static NBTTagList writeBaseAttributeMapToNBT(BaseAttributeMap map) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (IAttributeInstance iattributeinstance : map.getAllAttributes()) + { + nbttaglist.appendTag(writeAttributeInstanceToNBT(iattributeinstance)); + } + + return nbttaglist; + } + + private static NBTTagCompound writeAttributeInstanceToNBT(IAttributeInstance instance) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + IAttribute iattribute = instance.getAttribute(); + nbttagcompound.setString("Name", iattribute.getAttributeUnlocalizedName()); + nbttagcompound.setDouble("Base", instance.getBaseValue()); + Collection collection = instance.func_111122_c(); + + if (collection != null && !collection.isEmpty()) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (AttributeModifier attributemodifier : collection) + { + if (attributemodifier.isSaved()) + { + nbttaglist.appendTag(writeAttributeModifierToNBT(attributemodifier)); + } + } + + nbttagcompound.setTag("Modifiers", nbttaglist); + } + + return nbttagcompound; + } + + private static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier modifier) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", modifier.getName()); + nbttagcompound.setDouble("Amount", modifier.getAmount()); + nbttagcompound.setInteger("Operation", modifier.getOperation()); + nbttagcompound.setLong("UUIDMost", modifier.getID().getMostSignificantBits()); + nbttagcompound.setLong("UUIDLeast", modifier.getID().getLeastSignificantBits()); + return nbttagcompound; + } + + public static void setAttributeModifiers(BaseAttributeMap map, NBTTagList list) + { + for (int i = 0; i < list.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = list.getCompoundTagAt(i); + IAttributeInstance iattributeinstance = map.getAttributeInstanceByName(nbttagcompound.getString("Name")); + + if (iattributeinstance != null) + { + applyModifiersToAttributeInstance(iattributeinstance, nbttagcompound); + } + else + { + logger.warn("Ignoring unknown attribute \'" + nbttagcompound.getString("Name") + "\'"); + } + } + } + + private static void applyModifiersToAttributeInstance(IAttributeInstance instance, NBTTagCompound compound) + { + instance.setBaseValue(compound.getDouble("Base")); + + if (compound.hasKey("Modifiers", 9)) + { + NBTTagList nbttaglist = compound.getTagList("Modifiers", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + AttributeModifier attributemodifier = readAttributeModifierFromNBT(nbttaglist.getCompoundTagAt(i)); + + if (attributemodifier != null) + { + AttributeModifier attributemodifier1 = instance.getModifier(attributemodifier.getID()); + + if (attributemodifier1 != null) + { + instance.removeModifier(attributemodifier1); + } + + instance.applyModifier(attributemodifier); + } + } + } + } + + public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound compound) + { + UUID uuid = new UUID(compound.getLong("UUIDMost"), compound.getLong("UUIDLeast")); + + try + { + return new AttributeModifier(uuid, compound.getString("Name"), compound.getDouble("Amount"), compound.getInteger("Operation")); + } + catch (Exception exception) + { + logger.warn("Unable to create attribute: " + exception.getMessage()); + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java new file mode 100644 index 0000000..156259e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java @@ -0,0 +1,117 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.util.MathHelper; + +public class EntityAIArrowAttack extends EntityAIBase +{ + private final EntityLiving entityHost; + private final IRangedAttackMob rangedAttackEntityHost; + private EntityLivingBase attackTarget; + private int rangedAttackTime; + private double entityMoveSpeed; + private int field_75318_f; + private int field_96561_g; + private int maxRangedAttackTime; + private float field_96562_i; + private float maxAttackDistance; + + public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1649_4_, float p_i1649_5_) + { + this(attacker, movespeed, p_i1649_4_, p_i1649_4_, p_i1649_5_); + } + + public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn) + { + this.rangedAttackTime = -1; + + if (!(attacker instanceof EntityLivingBase)) + { + throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); + } + else + { + this.rangedAttackEntityHost = attacker; + this.entityHost = (EntityLiving)attacker; + this.entityMoveSpeed = movespeed; + this.field_96561_g = p_i1650_4_; + this.maxRangedAttackTime = maxAttackTime; + this.field_96562_i = maxAttackDistanceIn; + this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn; + this.setMutexBits(3); + } + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.entityHost.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.attackTarget = entitylivingbase; + return true; + } + } + + public boolean continueExecuting() + { + return this.shouldExecute() || !this.entityHost.getNavigator().noPath(); + } + + public void resetTask() + { + this.attackTarget = null; + this.field_75318_f = 0; + this.rangedAttackTime = -1; + } + + public void updateTask() + { + double d0 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.getEntityBoundingBox().minY, this.attackTarget.posZ); + boolean flag = this.entityHost.getEntitySenses().canSee(this.attackTarget); + + if (flag) + { + ++this.field_75318_f; + } + else + { + this.field_75318_f = 0; + } + + if (d0 <= (double)this.maxAttackDistance && this.field_75318_f >= 20) + { + this.entityHost.getNavigator().clearPathEntity(); + } + else + { + this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed); + } + + this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F); + + if (--this.rangedAttackTime == 0) + { + if (d0 > (double)this.maxAttackDistance || !flag) + { + return; + } + + float f = MathHelper.sqrt_double(d0) / this.field_96562_i; + float lvt_5_1_ = MathHelper.clamp_float(f, 0.1F, 1.0F); + this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, lvt_5_1_); + this.rangedAttackTime = MathHelper.floor_float(f * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); + } + else if (this.rangedAttackTime < 0) + { + float f2 = MathHelper.sqrt_double(d0) / this.field_96562_i; + this.rangedAttackTime = MathHelper.floor_float(f2 * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java new file mode 100644 index 0000000..2f376ce --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java @@ -0,0 +1,128 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityAIAttackOnCollide extends EntityAIBase +{ + World worldObj; + protected EntityCreature attacker; + int attackTick; + double speedTowardsTarget; + boolean longMemory; + PathEntity entityPathEntity; + Class classTarget; + private int delayCounter; + private double targetX; + private double targetY; + private double targetZ; + + public EntityAIAttackOnCollide(EntityCreature creature, Class targetClass, double speedIn, boolean useLongMemory) + { + this(creature, speedIn, useLongMemory); + this.classTarget = targetClass; + } + + public EntityAIAttackOnCollide(EntityCreature creature, double speedIn, boolean useLongMemory) + { + this.attacker = creature; + this.worldObj = creature.worldObj; + this.speedTowardsTarget = speedIn; + this.longMemory = useLongMemory; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else if (!entitylivingbase.isEntityAlive()) + { + return false; + } + else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) + { + return false; + } + else + { + this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); + return this.entityPathEntity != null; + } + } + + public boolean continueExecuting() + { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistanceFromPosition(new BlockPos(entitylivingbase)))); + } + + public void startExecuting() + { + this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); + this.delayCounter = 0; + } + + public void resetTask() + { + this.attacker.getNavigator().clearPathEntity(); + } + + public void updateTask() + { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F); + double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.getEntityBoundingBox().minY, entitylivingbase.posZ); + double d1 = this.func_179512_a(entitylivingbase); + --this.delayCounter; + + if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.delayCounter <= 0 && (this.targetX == 0.0D && this.targetY == 0.0D && this.targetZ == 0.0D || entitylivingbase.getDistanceSq(this.targetX, this.targetY, this.targetZ) >= 1.0D || this.attacker.getRNG().nextFloat() < 0.05F)) + { + this.targetX = entitylivingbase.posX; + this.targetY = entitylivingbase.getEntityBoundingBox().minY; + this.targetZ = entitylivingbase.posZ; + this.delayCounter = 4 + this.attacker.getRNG().nextInt(7); + + if (d0 > 1024.0D) + { + this.delayCounter += 10; + } + else if (d0 > 256.0D) + { + this.delayCounter += 5; + } + + if (!this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) + { + this.delayCounter += 15; + } + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + + if (d0 <= d1 && this.attackTick <= 0) + { + this.attackTick = 20; + + if (this.attacker.getHeldItem() != null) + { + this.attacker.swingItem(); + } + + this.attacker.attackEntityAsMob(entitylivingbase); + } + } + + protected double func_179512_a(EntityLivingBase attackTarget) + { + return (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + attackTarget.width); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java new file mode 100644 index 0000000..ef59757 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java @@ -0,0 +1,105 @@ +package net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.Vec3; + +public class EntityAIAvoidEntity extends EntityAIBase +{ + private final Predicate canBeSeenSelector; + protected EntityCreature theEntity; + private double farSpeed; + private double nearSpeed; + protected T closestLivingEntity; + private float avoidDistance; + private PathEntity entityPathEntity; + private PathNavigate entityPathNavigate; + private Class classToAvoid; + private Predicate avoidTargetSelector; + + public EntityAIAvoidEntity(EntityCreature theEntityIn, Class classToAvoidIn, float avoidDistanceIn, double farSpeedIn, double nearSpeedIn) + { + this(theEntityIn, classToAvoidIn, Predicates.alwaysTrue(), avoidDistanceIn, farSpeedIn, nearSpeedIn); + } + + public EntityAIAvoidEntity(EntityCreature theEntityIn, Class classToAvoidIn, Predicate avoidTargetSelectorIn, float avoidDistanceIn, double farSpeedIn, double nearSpeedIn) + { + this.canBeSeenSelector = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_.isEntityAlive() && EntityAIAvoidEntity.this.theEntity.getEntitySenses().canSee(p_apply_1_); + } + }; + this.theEntity = theEntityIn; + this.classToAvoid = classToAvoidIn; + this.avoidTargetSelector = avoidTargetSelectorIn; + this.avoidDistance = avoidDistanceIn; + this.farSpeed = farSpeedIn; + this.nearSpeed = nearSpeedIn; + this.entityPathNavigate = theEntityIn.getNavigator(); + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + List list = this.theEntity.worldObj.getEntitiesWithinAABB(this.classToAvoid, this.theEntity.getEntityBoundingBox().expand((double)this.avoidDistance, 3.0D, (double)this.avoidDistance), Predicates.and(new Predicate[] {EntitySelectors.NOT_SPECTATING, this.canBeSeenSelector, this.avoidTargetSelector})); + + if (list.isEmpty()) + { + return false; + } + else + { + this.closestLivingEntity = list.get(0); + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.theEntity, 16, 7, new Vec3(this.closestLivingEntity.posX, this.closestLivingEntity.posY, this.closestLivingEntity.posZ)); + + if (vec3 == null) + { + return false; + } + else if (this.closestLivingEntity.getDistanceSq(vec3.xCoord, vec3.yCoord, vec3.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) + { + return false; + } + else + { + this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord); + return this.entityPathEntity == null ? false : this.entityPathEntity.isDestinationSame(vec3); + } + } + } + + public boolean continueExecuting() + { + return !this.entityPathNavigate.noPath(); + } + + public void startExecuting() + { + this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); + } + + public void resetTask() + { + this.closestLivingEntity = null; + } + + public void updateTask() + { + if (this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) + { + this.theEntity.getNavigator().setSpeed(this.nearSpeed); + } + else + { + this.theEntity.getNavigator().setSpeed(this.farSpeed); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBase.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBase.java new file mode 100644 index 0000000..a3fe0bb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBase.java @@ -0,0 +1,40 @@ +package net.minecraft.entity.ai; + +public abstract class EntityAIBase +{ + private int mutexBits; + + public abstract boolean shouldExecute(); + + public boolean continueExecuting() + { + return this.shouldExecute(); + } + + public boolean isInterruptible() + { + return true; + } + + public void startExecuting() + { + } + + public void resetTask() + { + } + + public void updateTask() + { + } + + public void setMutexBits(int mutexBitsIn) + { + this.mutexBits = mutexBitsIn; + } + + public int getMutexBits() + { + return this.mutexBits; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBeg.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBeg.java new file mode 100644 index 0000000..95038fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBeg.java @@ -0,0 +1,59 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class EntityAIBeg extends EntityAIBase +{ + private EntityWolf theWolf; + private EntityPlayer thePlayer; + private World worldObject; + private float minPlayerDistance; + private int timeoutCounter; + + public EntityAIBeg(EntityWolf wolf, float minDistance) + { + this.theWolf = wolf; + this.worldObject = wolf.worldObj; + this.minPlayerDistance = minDistance; + this.setMutexBits(2); + } + + public boolean shouldExecute() + { + this.thePlayer = this.worldObject.getClosestPlayerToEntity(this.theWolf, (double)this.minPlayerDistance); + return this.thePlayer == null ? false : this.hasPlayerGotBoneInHand(this.thePlayer); + } + + public boolean continueExecuting() + { + return !this.thePlayer.isEntityAlive() ? false : (this.theWolf.getDistanceSqToEntity(this.thePlayer) > (double)(this.minPlayerDistance * this.minPlayerDistance) ? false : this.timeoutCounter > 0 && this.hasPlayerGotBoneInHand(this.thePlayer)); + } + + public void startExecuting() + { + this.theWolf.setBegging(true); + this.timeoutCounter = 40 + this.theWolf.getRNG().nextInt(40); + } + + public void resetTask() + { + this.theWolf.setBegging(false); + this.thePlayer = null; + } + + public void updateTask() + { + this.theWolf.getLookHelper().setLookPosition(this.thePlayer.posX, this.thePlayer.posY + (double)this.thePlayer.getEyeHeight(), this.thePlayer.posZ, 10.0F, (float)this.theWolf.getVerticalFaceSpeed()); + --this.timeoutCounter; + } + + private boolean hasPlayerGotBoneInHand(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + return itemstack == null ? false : (!this.theWolf.isTamed() && itemstack.getItem() == Items.bone ? true : this.theWolf.isBreedingItem(itemstack)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java new file mode 100644 index 0000000..a38325c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java @@ -0,0 +1,92 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.entity.EntityLiving; +import net.minecraft.world.EnumDifficulty; + +public class EntityAIBreakDoor extends EntityAIDoorInteract +{ + private int breakingTime; + private int previousBreakProgress = -1; + + public EntityAIBreakDoor(EntityLiving entityIn) + { + super(entityIn); + } + + public boolean shouldExecute() + { + if (!super.shouldExecute()) + { + return false; + } + else if (!this.theEntity.worldObj.getGameRules().getBoolean("mobGriefing")) + { + return false; + } + else + { + BlockDoor blockdoor = this.doorBlock; + return !BlockDoor.isOpen(this.theEntity.worldObj, this.doorPosition); + } + } + + public void startExecuting() + { + super.startExecuting(); + this.breakingTime = 0; + } + + public boolean continueExecuting() + { + double d0 = this.theEntity.getDistanceSq(this.doorPosition); + boolean flag; + + if (this.breakingTime <= 240) + { + BlockDoor blockdoor = this.doorBlock; + + if (!BlockDoor.isOpen(this.theEntity.worldObj, this.doorPosition) && d0 < 4.0D) + { + flag = true; + return flag; + } + } + + flag = false; + return flag; + } + + public void resetTask() + { + super.resetTask(); + this.theEntity.worldObj.sendBlockBreakProgress(this.theEntity.getEntityId(), this.doorPosition, -1); + } + + public void updateTask() + { + super.updateTask(); + + if (this.theEntity.getRNG().nextInt(20) == 0) + { + this.theEntity.worldObj.playAuxSFX(1010, this.doorPosition, 0); + } + + ++this.breakingTime; + int i = (int)((float)this.breakingTime / 240.0F * 10.0F); + + if (i != this.previousBreakProgress) + { + this.theEntity.worldObj.sendBlockBreakProgress(this.theEntity.getEntityId(), this.doorPosition, i); + this.previousBreakProgress = i; + } + + if (this.breakingTime == 240 && this.theEntity.worldObj.getDifficulty() == EnumDifficulty.HARD) + { + this.theEntity.worldObj.setBlockToAir(this.doorPosition); + this.theEntity.worldObj.playAuxSFX(1012, this.doorPosition, 0); + this.theEntity.worldObj.playAuxSFX(2001, this.doorPosition, Block.getIdFromBlock(this.doorBlock)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java new file mode 100644 index 0000000..8178376 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java @@ -0,0 +1,195 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.pathfinder.WalkNodeProcessor; + +public class EntityAIControlledByPlayer extends EntityAIBase +{ + private final EntityLiving thisEntity; + private final float maxSpeed; + private float currentSpeed; + private boolean speedBoosted; + private int speedBoostTime; + private int maxSpeedBoostTime; + + public EntityAIControlledByPlayer(EntityLiving entitylivingIn, float maxspeed) + { + this.thisEntity = entitylivingIn; + this.maxSpeed = maxspeed; + this.setMutexBits(7); + } + + public void startExecuting() + { + this.currentSpeed = 0.0F; + } + + public void resetTask() + { + this.speedBoosted = false; + this.currentSpeed = 0.0F; + } + + public boolean shouldExecute() + { + return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); + } + + public void updateTask() + { + EntityPlayer entityplayer = (EntityPlayer)this.thisEntity.riddenByEntity; + EntityCreature entitycreature = (EntityCreature)this.thisEntity; + float f = MathHelper.wrapAngleTo180_float(entityplayer.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; + + if (f > 5.0F) + { + f = 5.0F; + } + + if (f < -5.0F) + { + f = -5.0F; + } + + this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + f); + + if (this.currentSpeed < this.maxSpeed) + { + this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; + } + + if (this.currentSpeed > this.maxSpeed) + { + this.currentSpeed = this.maxSpeed; + } + + int i = MathHelper.floor_double(this.thisEntity.posX); + int j = MathHelper.floor_double(this.thisEntity.posY); + int k = MathHelper.floor_double(this.thisEntity.posZ); + float f1 = this.currentSpeed; + + if (this.speedBoosted) + { + if (this.speedBoostTime++ > this.maxSpeedBoostTime) + { + this.speedBoosted = false; + } + + f1 += f1 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); + } + + float f2 = 0.91F; + + if (this.thisEntity.onGround) + { + f2 = this.thisEntity.worldObj.getBlockState(new BlockPos(MathHelper.floor_float((float)i), MathHelper.floor_float((float)j) - 1, MathHelper.floor_float((float)k))).getBlock().slipperiness * 0.91F; + } + + float f3 = 0.16277136F / (f2 * f2 * f2); + float f4 = MathHelper.sin(entitycreature.rotationYaw * (float)Math.PI / 180.0F); + float f5 = MathHelper.cos(entitycreature.rotationYaw * (float)Math.PI / 180.0F); + float f6 = entitycreature.getAIMoveSpeed() * f3; + float f7 = Math.max(f1, 1.0F); + f7 = f6 / f7; + float f8 = f1 * f7; + float f9 = -(f8 * f4); + float f10 = f8 * f5; + + if (MathHelper.abs(f9) > MathHelper.abs(f10)) + { + if (f9 < 0.0F) + { + f9 -= this.thisEntity.width / 2.0F; + } + + if (f9 > 0.0F) + { + f9 += this.thisEntity.width / 2.0F; + } + + f10 = 0.0F; + } + else + { + f9 = 0.0F; + + if (f10 < 0.0F) + { + f10 -= this.thisEntity.width / 2.0F; + } + + if (f10 > 0.0F) + { + f10 += this.thisEntity.width / 2.0F; + } + } + + int l = MathHelper.floor_double(this.thisEntity.posX + (double)f9); + int i1 = MathHelper.floor_double(this.thisEntity.posZ + (double)f10); + int j1 = MathHelper.floor_float(this.thisEntity.width + 1.0F); + int k1 = MathHelper.floor_float(this.thisEntity.height + entityplayer.height + 1.0F); + int l1 = MathHelper.floor_float(this.thisEntity.width + 1.0F); + + if (i != l || k != i1) + { + Block block = this.thisEntity.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock(); + boolean flag = !this.isStairOrSlab(block) && (block.getMaterial() != Material.air || !this.isStairOrSlab(this.thisEntity.worldObj.getBlockState(new BlockPos(i, j - 1, k)).getBlock())); + + if (flag && 0 == WalkNodeProcessor.func_176170_a(this.thisEntity.worldObj, this.thisEntity, l, j, i1, j1, k1, l1, false, false, true) && 1 == WalkNodeProcessor.func_176170_a(this.thisEntity.worldObj, this.thisEntity, i, j + 1, k, j1, k1, l1, false, false, true) && 1 == WalkNodeProcessor.func_176170_a(this.thisEntity.worldObj, this.thisEntity, l, j + 1, i1, j1, k1, l1, false, false, true)) + { + entitycreature.getJumpHelper().setJumping(); + } + } + + if (!entityplayer.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) + { + ItemStack itemstack = entityplayer.getHeldItem(); + + if (itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick) + { + itemstack.damageItem(1, entityplayer); + + if (itemstack.stackSize == 0) + { + ItemStack itemstack1 = new ItemStack(Items.fishing_rod); + itemstack1.setTagCompound(itemstack.getTagCompound()); + entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = itemstack1; + } + } + } + + this.thisEntity.moveEntityWithHeading(0.0F, f1); + } + + private boolean isStairOrSlab(Block blockIn) + { + return blockIn instanceof BlockStairs || blockIn instanceof BlockSlab; + } + + public boolean isSpeedBoosted() + { + return this.speedBoosted; + } + + public void boostSpeed() + { + this.speedBoosted = true; + this.speedBoostTime = 0; + this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; + } + + public boolean isControlledByPlayer() + { + return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java new file mode 100644 index 0000000..3196ecd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java @@ -0,0 +1,53 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; + +public class EntityAICreeperSwell extends EntityAIBase +{ + EntityCreeper swellingCreeper; + EntityLivingBase creeperAttackTarget; + + public EntityAICreeperSwell(EntityCreeper entitycreeperIn) + { + this.swellingCreeper = entitycreeperIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D; + } + + public void startExecuting() + { + this.swellingCreeper.getNavigator().clearPathEntity(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } + + public void resetTask() + { + this.creeperAttackTarget = null; + } + + public void updateTask() + { + if (this.creeperAttackTarget == null) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) + { + this.swellingCreeper.setCreeperState(-1); + } + else + { + this.swellingCreeper.setCreeperState(1); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java new file mode 100644 index 0000000..a473561 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java @@ -0,0 +1,60 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.village.Village; + +public class EntityAIDefendVillage extends EntityAITarget +{ + EntityIronGolem irongolem; + EntityLivingBase villageAgressorTarget; + + public EntityAIDefendVillage(EntityIronGolem ironGolemIn) + { + super(ironGolemIn, false, true); + this.irongolem = ironGolemIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + Village village = this.irongolem.getVillage(); + + if (village == null) + { + return false; + } + else + { + this.villageAgressorTarget = village.findNearestVillageAggressor(this.irongolem); + + if (this.villageAgressorTarget instanceof EntityCreeper) + { + return false; + } + else if (!this.isSuitableTarget(this.villageAgressorTarget, false)) + { + if (this.taskOwner.getRNG().nextInt(20) == 0) + { + this.villageAgressorTarget = village.getNearestTargetPlayer(this.irongolem); + return this.isSuitableTarget(this.villageAgressorTarget, false); + } + else + { + return false; + } + } + else + { + return true; + } + } + } + + public void startExecuting() + { + this.irongolem.setAttackTarget(this.villageAgressorTarget); + super.startExecuting(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java new file mode 100644 index 0000000..7373158 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java @@ -0,0 +1,100 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; + +public abstract class EntityAIDoorInteract extends EntityAIBase +{ + protected EntityLiving theEntity; + protected BlockPos doorPosition = BlockPos.ORIGIN; + protected BlockDoor doorBlock; + boolean hasStoppedDoorInteraction; + float entityPositionX; + float entityPositionZ; + + public EntityAIDoorInteract(EntityLiving entityIn) + { + this.theEntity = entityIn; + + if (!(entityIn.getNavigator() instanceof PathNavigateGround)) + { + throw new IllegalArgumentException("Unsupported mob type for DoorInteractGoal"); + } + } + + public boolean shouldExecute() + { + if (!this.theEntity.isCollidedHorizontally) + { + return false; + } + else + { + PathNavigateGround pathnavigateground = (PathNavigateGround)this.theEntity.getNavigator(); + PathEntity pathentity = pathnavigateground.getPath(); + + if (pathentity != null && !pathentity.isFinished() && pathnavigateground.getEnterDoors()) + { + for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i) + { + PathPoint pathpoint = pathentity.getPathPointFromIndex(i); + this.doorPosition = new BlockPos(pathpoint.xCoord, pathpoint.yCoord + 1, pathpoint.zCoord); + + if (this.theEntity.getDistanceSq((double)this.doorPosition.getX(), this.theEntity.posY, (double)this.doorPosition.getZ()) <= 2.25D) + { + this.doorBlock = this.getBlockDoor(this.doorPosition); + + if (this.doorBlock != null) + { + return true; + } + } + } + + this.doorPosition = (new BlockPos(this.theEntity)).up(); + this.doorBlock = this.getBlockDoor(this.doorPosition); + return this.doorBlock != null; + } + else + { + return false; + } + } + } + + public boolean continueExecuting() + { + return !this.hasStoppedDoorInteraction; + } + + public void startExecuting() + { + this.hasStoppedDoorInteraction = false; + this.entityPositionX = (float)((double)((float)this.doorPosition.getX() + 0.5F) - this.theEntity.posX); + this.entityPositionZ = (float)((double)((float)this.doorPosition.getZ() + 0.5F) - this.theEntity.posZ); + } + + public void updateTask() + { + float f = (float)((double)((float)this.doorPosition.getX() + 0.5F) - this.theEntity.posX); + float f1 = (float)((double)((float)this.doorPosition.getZ() + 0.5F) - this.theEntity.posZ); + float f2 = this.entityPositionX * f + this.entityPositionZ * f1; + + if (f2 < 0.0F) + { + this.hasStoppedDoorInteraction = true; + } + } + + private BlockDoor getBlockDoor(BlockPos pos) + { + Block block = this.theEntity.worldObj.getBlockState(pos).getBlock(); + return block instanceof BlockDoor && block.getMaterial() == Material.wood ? (BlockDoor)block : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java new file mode 100644 index 0000000..69574bf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java @@ -0,0 +1,97 @@ +package net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import net.minecraft.block.Block; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockStateHelper; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityAIEatGrass extends EntityAIBase +{ + private static final Predicate field_179505_b = BlockStateHelper.forBlock(Blocks.tallgrass).where(BlockTallGrass.TYPE, Predicates.equalTo(BlockTallGrass.EnumType.GRASS)); + private EntityLiving grassEaterEntity; + private World entityWorld; + int eatingGrassTimer; + + public EntityAIEatGrass(EntityLiving grassEaterEntityIn) + { + this.grassEaterEntity = grassEaterEntityIn; + this.entityWorld = grassEaterEntityIn.worldObj; + this.setMutexBits(7); + } + + public boolean shouldExecute() + { + if (this.grassEaterEntity.getRNG().nextInt(this.grassEaterEntity.isChild() ? 50 : 1000) != 0) + { + return false; + } + else + { + BlockPos blockpos = new BlockPos(this.grassEaterEntity.posX, this.grassEaterEntity.posY, this.grassEaterEntity.posZ); + return field_179505_b.apply(this.entityWorld.getBlockState(blockpos)) ? true : this.entityWorld.getBlockState(blockpos.down()).getBlock() == Blocks.grass; + } + } + + public void startExecuting() + { + this.eatingGrassTimer = 40; + this.entityWorld.setEntityState(this.grassEaterEntity, (byte)10); + this.grassEaterEntity.getNavigator().clearPathEntity(); + } + + public void resetTask() + { + this.eatingGrassTimer = 0; + } + + public boolean continueExecuting() + { + return this.eatingGrassTimer > 0; + } + + public int getEatingGrassTimer() + { + return this.eatingGrassTimer; + } + + public void updateTask() + { + this.eatingGrassTimer = Math.max(0, this.eatingGrassTimer - 1); + + if (this.eatingGrassTimer == 4) + { + BlockPos blockpos = new BlockPos(this.grassEaterEntity.posX, this.grassEaterEntity.posY, this.grassEaterEntity.posZ); + + if (field_179505_b.apply(this.entityWorld.getBlockState(blockpos))) + { + if (this.entityWorld.getGameRules().getBoolean("mobGriefing")) + { + this.entityWorld.destroyBlock(blockpos, false); + } + + this.grassEaterEntity.eatGrassBonus(); + } + else + { + BlockPos blockpos1 = blockpos.down(); + + if (this.entityWorld.getBlockState(blockpos1).getBlock() == Blocks.grass) + { + if (this.entityWorld.getGameRules().getBoolean("mobGriefing")) + { + this.entityWorld.playAuxSFX(2001, blockpos1, Block.getIdFromBlock(Blocks.grass)); + this.entityWorld.setBlockState(blockpos1, Blocks.dirt.getDefaultState(), 2); + } + + this.grassEaterEntity.eatGrassBonus(); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearest.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearest.java new file mode 100644 index 0000000..416eba4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearest.java @@ -0,0 +1,104 @@ +package net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import java.util.Collections; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayerMP; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityAIFindEntityNearest extends EntityAIBase +{ + private static final Logger LOGGER = LogManager.getLogger(); + private EntityLiving mob; + private final Predicate field_179443_c; + private final EntityAINearestAttackableTarget.Sorter field_179440_d; + private EntityLivingBase target; + private Class field_179439_f; + + public EntityAIFindEntityNearest(EntityLiving mobIn, Class p_i45884_2_) + { + this.mob = mobIn; + this.field_179439_f = p_i45884_2_; + + if (mobIn instanceof EntityCreature) + { + LOGGER.warn("Use NearestAttackableTargetGoal.class for PathfinerMob mobs!"); + } + + this.field_179443_c = new Predicate() + { + public boolean apply(EntityLivingBase p_apply_1_) + { + double d0 = EntityAIFindEntityNearest.this.getFollowRange(); + + if (p_apply_1_.isSneaking()) + { + d0 *= 0.800000011920929D; + } + + return p_apply_1_.isInvisible() ? false : ((double)p_apply_1_.getDistanceToEntity(EntityAIFindEntityNearest.this.mob) > d0 ? false : EntityAITarget.isSuitableTarget(EntityAIFindEntityNearest.this.mob, p_apply_1_, false, true)); + } + }; + this.field_179440_d = new EntityAINearestAttackableTarget.Sorter(mobIn); + } + + public boolean shouldExecute() + { + double d0 = this.getFollowRange(); + List list = this.mob.worldObj.getEntitiesWithinAABB(this.field_179439_f, this.mob.getEntityBoundingBox().expand(d0, 4.0D, d0), this.field_179443_c); + Collections.sort(list, this.field_179440_d); + + if (list.isEmpty()) + { + return false; + } + else + { + this.target = (EntityLivingBase)list.get(0); + return true; + } + } + + public boolean continueExecuting() + { + EntityLivingBase entitylivingbase = this.mob.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else if (!entitylivingbase.isEntityAlive()) + { + return false; + } + else + { + double d0 = this.getFollowRange(); + return this.mob.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative(); + } + } + + public void startExecuting() + { + this.mob.setAttackTarget(this.target); + super.startExecuting(); + } + + public void resetTask() + { + this.mob.setAttackTarget((EntityLivingBase)null); + super.startExecuting(); + } + + protected double getFollowRange() + { + IAttributeInstance iattributeinstance = this.mob.getEntityAttribute(SharedMonsterAttributes.followRange); + return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java new file mode 100644 index 0000000..6d9f2ec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java @@ -0,0 +1,142 @@ +package net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import java.util.Collections; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.Team; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityAIFindEntityNearestPlayer extends EntityAIBase +{ + private static final Logger LOGGER = LogManager.getLogger(); + private EntityLiving entityLiving; + private final Predicate predicate; + private final EntityAINearestAttackableTarget.Sorter sorter; + private EntityLivingBase entityTarget; + + public EntityAIFindEntityNearestPlayer(EntityLiving entityLivingIn) + { + this.entityLiving = entityLivingIn; + + if (entityLivingIn instanceof EntityCreature) + { + LOGGER.warn("Use NearestAttackableTargetGoal.class for PathfinerMob mobs!"); + } + + this.predicate = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + if (!(p_apply_1_ instanceof EntityPlayer)) + { + return false; + } + else if (((EntityPlayer)p_apply_1_).capabilities.disableDamage) + { + return false; + } + else + { + double d0 = EntityAIFindEntityNearestPlayer.this.maxTargetRange(); + + if (p_apply_1_.isSneaking()) + { + d0 *= 0.800000011920929D; + } + + if (p_apply_1_.isInvisible()) + { + float f = ((EntityPlayer)p_apply_1_).getArmorVisibility(); + + if (f < 0.1F) + { + f = 0.1F; + } + + d0 *= (double)(0.7F * f); + } + + return (double)p_apply_1_.getDistanceToEntity(EntityAIFindEntityNearestPlayer.this.entityLiving) > d0 ? false : EntityAITarget.isSuitableTarget(EntityAIFindEntityNearestPlayer.this.entityLiving, (EntityLivingBase)p_apply_1_, false, true); + } + } + }; + this.sorter = new EntityAINearestAttackableTarget.Sorter(entityLivingIn); + } + + public boolean shouldExecute() + { + double d0 = this.maxTargetRange(); + List list = this.entityLiving.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.entityLiving.getEntityBoundingBox().expand(d0, 4.0D, d0), this.predicate); + Collections.sort(list, this.sorter); + + if (list.isEmpty()) + { + return false; + } + else + { + this.entityTarget = (EntityLivingBase)list.get(0); + return true; + } + } + + public boolean continueExecuting() + { + EntityLivingBase entitylivingbase = this.entityLiving.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else if (!entitylivingbase.isEntityAlive()) + { + return false; + } + else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage) + { + return false; + } + else + { + Team team = this.entityLiving.getTeam(); + Team team1 = entitylivingbase.getTeam(); + + if (team != null && team1 == team) + { + return false; + } + else + { + double d0 = this.maxTargetRange(); + return this.entityLiving.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative(); + } + } + } + + public void startExecuting() + { + this.entityLiving.setAttackTarget(this.entityTarget); + super.startExecuting(); + } + + public void resetTask() + { + this.entityLiving.setAttackTarget((EntityLivingBase)null); + super.startExecuting(); + } + + protected double maxTargetRange() + { + IAttributeInstance iattributeinstance = this.entityLiving.getEntityAttribute(SharedMonsterAttributes.followRange); + return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java new file mode 100644 index 0000000..e5a015d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java @@ -0,0 +1,85 @@ +package net.minecraft.entity.ai; + +import java.util.Random; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityAIFleeSun extends EntityAIBase +{ + private EntityCreature theCreature; + private double shelterX; + private double shelterY; + private double shelterZ; + private double movementSpeed; + private World theWorld; + + public EntityAIFleeSun(EntityCreature theCreatureIn, double movementSpeedIn) + { + this.theCreature = theCreatureIn; + this.movementSpeed = movementSpeedIn; + this.theWorld = theCreatureIn.worldObj; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (!this.theWorld.isDaytime()) + { + return false; + } + else if (!this.theCreature.isBurning()) + { + return false; + } + else if (!this.theWorld.canSeeSky(new BlockPos(this.theCreature.posX, this.theCreature.getEntityBoundingBox().minY, this.theCreature.posZ))) + { + return false; + } + else + { + Vec3 vec3 = this.findPossibleShelter(); + + if (vec3 == null) + { + return false; + } + else + { + this.shelterX = vec3.xCoord; + this.shelterY = vec3.yCoord; + this.shelterZ = vec3.zCoord; + return true; + } + } + } + + public boolean continueExecuting() + { + return !this.theCreature.getNavigator().noPath(); + } + + public void startExecuting() + { + this.theCreature.getNavigator().tryMoveToXYZ(this.shelterX, this.shelterY, this.shelterZ, this.movementSpeed); + } + + private Vec3 findPossibleShelter() + { + Random random = this.theCreature.getRNG(); + BlockPos blockpos = new BlockPos(this.theCreature.posX, this.theCreature.getEntityBoundingBox().minY, this.theCreature.posZ); + + for (int i = 0; i < 10; ++i) + { + BlockPos blockpos1 = blockpos.add(random.nextInt(20) - 10, random.nextInt(6) - 3, random.nextInt(20) - 10); + + if (!this.theWorld.canSeeSky(blockpos1) && this.theCreature.getBlockPathWeight(blockpos1) < 0.0F) + { + return new Vec3((double)blockpos1.getX(), (double)blockpos1.getY(), (double)blockpos1.getZ()); + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java new file mode 100644 index 0000000..4d03d8f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java @@ -0,0 +1,88 @@ +package net.minecraft.entity.ai; + +import java.util.List; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; + +public class EntityAIFollowGolem extends EntityAIBase +{ + private EntityVillager theVillager; + private EntityIronGolem theGolem; + private int takeGolemRoseTick; + private boolean tookGolemRose; + + public EntityAIFollowGolem(EntityVillager theVillagerIn) + { + this.theVillager = theVillagerIn; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + if (this.theVillager.getGrowingAge() >= 0) + { + return false; + } + else if (!this.theVillager.worldObj.isDaytime()) + { + return false; + } + else + { + List list = this.theVillager.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, this.theVillager.getEntityBoundingBox().expand(6.0D, 2.0D, 6.0D)); + + if (list.isEmpty()) + { + return false; + } + else + { + for (EntityIronGolem entityirongolem : list) + { + if (entityirongolem.getHoldRoseTick() > 0) + { + this.theGolem = entityirongolem; + break; + } + } + + return this.theGolem != null; + } + } + } + + public boolean continueExecuting() + { + return this.theGolem.getHoldRoseTick() > 0; + } + + public void startExecuting() + { + this.takeGolemRoseTick = this.theVillager.getRNG().nextInt(320); + this.tookGolemRose = false; + this.theGolem.getNavigator().clearPathEntity(); + } + + public void resetTask() + { + this.theGolem = null; + this.theVillager.getNavigator().clearPathEntity(); + } + + public void updateTask() + { + this.theVillager.getLookHelper().setLookPositionWithEntity(this.theGolem, 30.0F, 30.0F); + + if (this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) + { + this.theVillager.getNavigator().tryMoveToEntityLiving(this.theGolem, 0.5D); + this.tookGolemRose = true; + } + + if (this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) + { + this.theGolem.setHoldingRose(false); + this.theVillager.getNavigator().clearPathEntity(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java new file mode 100644 index 0000000..438e4bb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java @@ -0,0 +1,134 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityAIFollowOwner extends EntityAIBase +{ + private EntityTameable thePet; + private EntityLivingBase theOwner; + World theWorld; + private double followSpeed; + private PathNavigate petPathfinder; + private int field_75343_h; + float maxDist; + float minDist; + private boolean field_75344_i; + + public EntityAIFollowOwner(EntityTameable thePetIn, double followSpeedIn, float minDistIn, float maxDistIn) + { + this.thePet = thePetIn; + this.theWorld = thePetIn.worldObj; + this.followSpeed = followSpeedIn; + this.petPathfinder = thePetIn.getNavigator(); + this.minDist = minDistIn; + this.maxDist = maxDistIn; + this.setMutexBits(3); + + if (!(thePetIn.getNavigator() instanceof PathNavigateGround)) + { + throw new IllegalArgumentException("Unsupported mob type for FollowOwnerGoal"); + } + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.thePet.getOwner(); + + if (entitylivingbase == null) + { + return false; + } + else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).isSpectator()) + { + return false; + } + else if (this.thePet.isSitting()) + { + return false; + } + else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double)(this.minDist * this.minDist)) + { + return false; + } + else + { + this.theOwner = entitylivingbase; + return true; + } + } + + public boolean continueExecuting() + { + return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting(); + } + + public void startExecuting() + { + this.field_75343_h = 0; + this.field_75344_i = ((PathNavigateGround)this.thePet.getNavigator()).getAvoidsWater(); + ((PathNavigateGround)this.thePet.getNavigator()).setAvoidsWater(false); + } + + public void resetTask() + { + this.theOwner = null; + this.petPathfinder.clearPathEntity(); + ((PathNavigateGround)this.thePet.getNavigator()).setAvoidsWater(true); + } + + private boolean func_181065_a(BlockPos p_181065_1_) + { + IBlockState iblockstate = this.theWorld.getBlockState(p_181065_1_); + Block block = iblockstate.getBlock(); + return block == Blocks.air ? true : !block.isFullCube(); + } + + public void updateTask() + { + this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); + + if (!this.thePet.isSitting()) + { + if (--this.field_75343_h <= 0) + { + this.field_75343_h = 10; + + if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.followSpeed)) + { + if (!this.thePet.getLeashed()) + { + if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) + { + int i = MathHelper.floor_double(this.theOwner.posX) - 2; + int j = MathHelper.floor_double(this.theOwner.posZ) - 2; + int k = MathHelper.floor_double(this.theOwner.getEntityBoundingBox().minY); + + for (int l = 0; l <= 4; ++l) + { + for (int i1 = 0; i1 <= 4; ++i1) + { + if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && World.doesBlockHaveSolidTopSurface(this.theWorld, new BlockPos(i + l, k - 1, j + i1)) && this.func_181065_a(new BlockPos(i + l, k, j + i1)) && this.func_181065_a(new BlockPos(i + l, k + 1, j + i1))) + { + this.thePet.setLocationAndAngles((double)((float)(i + l) + 0.5F), (double)k, (double)((float)(j + i1) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch); + this.petPathfinder.clearPathEntity(); + return; + } + } + } + } + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java new file mode 100644 index 0000000..42ca121 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java @@ -0,0 +1,96 @@ +package net.minecraft.entity.ai; + +import java.util.List; +import net.minecraft.entity.passive.EntityAnimal; + +public class EntityAIFollowParent extends EntityAIBase +{ + EntityAnimal childAnimal; + EntityAnimal parentAnimal; + double moveSpeed; + private int delayCounter; + + public EntityAIFollowParent(EntityAnimal animal, double speed) + { + this.childAnimal = animal; + this.moveSpeed = speed; + } + + public boolean shouldExecute() + { + if (this.childAnimal.getGrowingAge() >= 0) + { + return false; + } + else + { + List list = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.getEntityBoundingBox().expand(8.0D, 4.0D, 8.0D)); + EntityAnimal entityanimal = null; + double d0 = Double.MAX_VALUE; + + for (EntityAnimal entityanimal1 : list) + { + if (entityanimal1.getGrowingAge() >= 0) + { + double d1 = this.childAnimal.getDistanceSqToEntity(entityanimal1); + + if (d1 <= d0) + { + d0 = d1; + entityanimal = entityanimal1; + } + } + } + + if (entityanimal == null) + { + return false; + } + else if (d0 < 9.0D) + { + return false; + } + else + { + this.parentAnimal = entityanimal; + return true; + } + } + } + + public boolean continueExecuting() + { + if (this.childAnimal.getGrowingAge() >= 0) + { + return false; + } + else if (!this.parentAnimal.isEntityAlive()) + { + return false; + } + else + { + double d0 = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); + return d0 >= 9.0D && d0 <= 256.0D; + } + } + + public void startExecuting() + { + this.delayCounter = 0; + } + + public void resetTask() + { + this.parentAnimal = null; + } + + public void updateTask() + { + if (--this.delayCounter <= 0) + { + this.delayCounter = 10; + this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.moveSpeed); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIHarvestFarmland.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIHarvestFarmland.java new file mode 100644 index 0000000..3159a7b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIHarvestFarmland.java @@ -0,0 +1,147 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCrops; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityAIHarvestFarmland extends EntityAIMoveToBlock +{ + private final EntityVillager theVillager; + private boolean hasFarmItem; + private boolean field_179503_e; + private int field_179501_f; + + public EntityAIHarvestFarmland(EntityVillager theVillagerIn, double speedIn) + { + super(theVillagerIn, speedIn, 16); + this.theVillager = theVillagerIn; + } + + public boolean shouldExecute() + { + if (this.runDelay <= 0) + { + if (!this.theVillager.worldObj.getGameRules().getBoolean("mobGriefing")) + { + return false; + } + + this.field_179501_f = -1; + this.hasFarmItem = this.theVillager.isFarmItemInInventory(); + this.field_179503_e = this.theVillager.func_175557_cr(); + } + + return super.shouldExecute(); + } + + public boolean continueExecuting() + { + return this.field_179501_f >= 0 && super.continueExecuting(); + } + + public void startExecuting() + { + super.startExecuting(); + } + + public void resetTask() + { + super.resetTask(); + } + + public void updateTask() + { + super.updateTask(); + this.theVillager.getLookHelper().setLookPosition((double)this.destinationBlock.getX() + 0.5D, (double)(this.destinationBlock.getY() + 1), (double)this.destinationBlock.getZ() + 0.5D, 10.0F, (float)this.theVillager.getVerticalFaceSpeed()); + + if (this.getIsAboveDestination()) + { + World world = this.theVillager.worldObj; + BlockPos blockpos = this.destinationBlock.up(); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (this.field_179501_f == 0 && block instanceof BlockCrops && ((Integer)iblockstate.getValue(BlockCrops.AGE)).intValue() == 7) + { + world.destroyBlock(blockpos, true); + } + else if (this.field_179501_f == 1 && block == Blocks.air) + { + InventoryBasic inventorybasic = this.theVillager.getVillagerInventory(); + + for (int i = 0; i < inventorybasic.getSizeInventory(); ++i) + { + ItemStack itemstack = inventorybasic.getStackInSlot(i); + boolean flag = false; + + if (itemstack != null) + { + if (itemstack.getItem() == Items.wheat_seeds) + { + world.setBlockState(blockpos, Blocks.wheat.getDefaultState(), 3); + flag = true; + } + else if (itemstack.getItem() == Items.potato) + { + world.setBlockState(blockpos, Blocks.potatoes.getDefaultState(), 3); + flag = true; + } + else if (itemstack.getItem() == Items.carrot) + { + world.setBlockState(blockpos, Blocks.carrots.getDefaultState(), 3); + flag = true; + } + } + + if (flag) + { + --itemstack.stackSize; + + if (itemstack.stackSize <= 0) + { + inventorybasic.setInventorySlotContents(i, (ItemStack)null); + } + + break; + } + } + } + + this.field_179501_f = -1; + this.runDelay = 10; + } + } + + protected boolean shouldMoveTo(World worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos).getBlock(); + + if (block == Blocks.farmland) + { + pos = pos.up(); + IBlockState iblockstate = worldIn.getBlockState(pos); + block = iblockstate.getBlock(); + + if (block instanceof BlockCrops && ((Integer)iblockstate.getValue(BlockCrops.AGE)).intValue() == 7 && this.field_179503_e && (this.field_179501_f == 0 || this.field_179501_f < 0)) + { + this.field_179501_f = 0; + return true; + } + + if (block == Blocks.air && this.hasFarmItem && (this.field_179501_f == 1 || this.field_179501_f < 0)) + { + this.field_179501_f = 1; + return true; + } + } + + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java new file mode 100644 index 0000000..f99b2b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java @@ -0,0 +1,66 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.AxisAlignedBB; + +public class EntityAIHurtByTarget extends EntityAITarget +{ + private boolean entityCallsForHelp; + private int revengeTimerOld; + private final Class[] targetClasses; + + public EntityAIHurtByTarget(EntityCreature creatureIn, boolean entityCallsForHelpIn, Class... targetClassesIn) + { + super(creatureIn, false); + this.entityCallsForHelp = entityCallsForHelpIn; + this.targetClasses = targetClassesIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + int i = this.taskOwner.getRevengeTimer(); + return i != this.revengeTimerOld && this.isSuitableTarget(this.taskOwner.getAITarget(), false); + } + + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); + this.revengeTimerOld = this.taskOwner.getRevengeTimer(); + + if (this.entityCallsForHelp) + { + double d0 = this.getTargetDistance(); + + for (EntityCreature entitycreature : this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), (new AxisAlignedBB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D)).expand(d0, 10.0D, d0))) + { + if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) + { + boolean flag = false; + + for (Class oclass : this.targetClasses) + { + if (entitycreature.getClass() == oclass) + { + flag = true; + break; + } + } + + if (!flag) + { + this.setEntityAttackTarget(entitycreature, this.taskOwner.getAITarget()); + } + } + } + } + + super.startExecuting(); + } + + protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) + { + creatureIn.setAttackTarget(entityLivingBaseIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java new file mode 100644 index 0000000..e153401 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java @@ -0,0 +1,49 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +public class EntityAILeapAtTarget extends EntityAIBase +{ + EntityLiving leaper; + EntityLivingBase leapTarget; + float leapMotionY; + + public EntityAILeapAtTarget(EntityLiving leapingEntity, float leapMotionYIn) + { + this.leaper = leapingEntity; + this.leapMotionY = leapMotionYIn; + this.setMutexBits(5); + } + + public boolean shouldExecute() + { + this.leapTarget = this.leaper.getAttackTarget(); + + if (this.leapTarget == null) + { + return false; + } + else + { + double d0 = this.leaper.getDistanceSqToEntity(this.leapTarget); + return d0 >= 4.0D && d0 <= 16.0D ? (!this.leaper.onGround ? false : this.leaper.getRNG().nextInt(5) == 0) : false; + } + } + + public boolean continueExecuting() + { + return !this.leaper.onGround; + } + + public void startExecuting() + { + double d0 = this.leapTarget.posX - this.leaper.posX; + double d1 = this.leapTarget.posZ - this.leaper.posZ; + float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1); + this.leaper.motionX += d0 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; + this.leaper.motionZ += d1 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; + this.leaper.motionY = (double)this.leapMotionY; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java new file mode 100644 index 0000000..1ba205d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java @@ -0,0 +1,28 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; + +public class EntityAILookAtTradePlayer extends EntityAIWatchClosest +{ + private final EntityVillager theMerchant; + + public EntityAILookAtTradePlayer(EntityVillager theMerchantIn) + { + super(theMerchantIn, EntityPlayer.class, 8.0F); + this.theMerchant = theMerchantIn; + } + + public boolean shouldExecute() + { + if (this.theMerchant.isTrading()) + { + this.closestEntity = this.theMerchant.getCustomer(); + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java new file mode 100644 index 0000000..dcef2a9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java @@ -0,0 +1,57 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; + +public class EntityAILookAtVillager extends EntityAIBase +{ + private EntityIronGolem theGolem; + private EntityVillager theVillager; + private int lookTime; + + public EntityAILookAtVillager(EntityIronGolem theGolemIn) + { + this.theGolem = theGolemIn; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + if (!this.theGolem.worldObj.isDaytime()) + { + return false; + } + else if (this.theGolem.getRNG().nextInt(8000) != 0) + { + return false; + } + else + { + this.theVillager = (EntityVillager)this.theGolem.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.theGolem.getEntityBoundingBox().expand(6.0D, 2.0D, 6.0D), this.theGolem); + return this.theVillager != null; + } + } + + public boolean continueExecuting() + { + return this.lookTime > 0; + } + + public void startExecuting() + { + this.lookTime = 400; + this.theGolem.setHoldingRose(true); + } + + public void resetTask() + { + this.theGolem.setHoldingRose(false); + this.theVillager = null; + } + + public void updateTask() + { + this.theGolem.getLookHelper().setLookPositionWithEntity(this.theVillager, 30.0F, 30.0F); + --this.lookTime; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java new file mode 100644 index 0000000..37e8be1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java @@ -0,0 +1,41 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAILookIdle extends EntityAIBase +{ + private EntityLiving idleEntity; + private double lookX; + private double lookZ; + private int idleTime; + + public EntityAILookIdle(EntityLiving entitylivingIn) + { + this.idleEntity = entitylivingIn; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + return this.idleEntity.getRNG().nextFloat() < 0.02F; + } + + public boolean continueExecuting() + { + return this.idleTime >= 0; + } + + public void startExecuting() + { + double d0 = (Math.PI * 2D) * this.idleEntity.getRNG().nextDouble(); + this.lookX = Math.cos(d0); + this.lookZ = Math.sin(d0); + this.idleTime = 20 + this.idleEntity.getRNG().nextInt(20); + } + + public void updateTask() + { + --this.idleTime; + this.idleEntity.getLookHelper().setLookPosition(this.idleEntity.posX + this.lookX, this.idleEntity.posY + (double)this.idleEntity.getEyeHeight(), this.idleEntity.posZ + this.lookZ, 10.0F, (float)this.idleEntity.getVerticalFaceSpeed()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMate.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMate.java new file mode 100644 index 0000000..f2c3d99 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMate.java @@ -0,0 +1,135 @@ +package net.minecraft.entity.ai; + +import java.util.List; +import java.util.Random; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatList; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class EntityAIMate extends EntityAIBase +{ + private EntityAnimal theAnimal; + World theWorld; + private EntityAnimal targetMate; + int spawnBabyDelay; + double moveSpeed; + + public EntityAIMate(EntityAnimal animal, double speedIn) + { + this.theAnimal = animal; + this.theWorld = animal.worldObj; + this.moveSpeed = speedIn; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + if (!this.theAnimal.isInLove()) + { + return false; + } + else + { + this.targetMate = this.getNearbyMate(); + return this.targetMate != null; + } + } + + public boolean continueExecuting() + { + return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; + } + + public void resetTask() + { + this.targetMate = null; + this.spawnBabyDelay = 0; + } + + public void updateTask() + { + this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); + this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); + ++this.spawnBabyDelay; + + if (this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) + { + this.spawnBaby(); + } + } + + private EntityAnimal getNearbyMate() + { + float f = 8.0F; + List list = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.getEntityBoundingBox().expand((double)f, (double)f, (double)f)); + double d0 = Double.MAX_VALUE; + EntityAnimal entityanimal = null; + + for (EntityAnimal entityanimal1 : list) + { + if (this.theAnimal.canMateWith(entityanimal1) && this.theAnimal.getDistanceSqToEntity(entityanimal1) < d0) + { + entityanimal = entityanimal1; + d0 = this.theAnimal.getDistanceSqToEntity(entityanimal1); + } + } + + return entityanimal; + } + + private void spawnBaby() + { + EntityAgeable entityageable = this.theAnimal.createChild(this.targetMate); + + if (entityageable != null) + { + EntityPlayer entityplayer = this.theAnimal.getPlayerInLove(); + + if (entityplayer == null && this.targetMate.getPlayerInLove() != null) + { + entityplayer = this.targetMate.getPlayerInLove(); + } + + if (entityplayer != null) + { + entityplayer.triggerAchievement(StatList.animalsBredStat); + + if (this.theAnimal instanceof EntityCow) + { + entityplayer.triggerAchievement(AchievementList.breedCow); + } + } + + this.theAnimal.setGrowingAge(6000); + this.targetMate.setGrowingAge(6000); + this.theAnimal.resetInLove(); + this.targetMate.resetInLove(); + entityageable.setGrowingAge(-24000); + entityageable.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); + this.theWorld.spawnEntityInWorld(entityageable); + Random random = this.theAnimal.getRNG(); + + for (int i = 0; i < 7; ++i) + { + double d0 = random.nextGaussian() * 0.02D; + double d1 = random.nextGaussian() * 0.02D; + double d2 = random.nextGaussian() * 0.02D; + double d3 = random.nextDouble() * (double)this.theAnimal.width * 2.0D - (double)this.theAnimal.width; + double d4 = 0.5D + random.nextDouble() * (double)this.theAnimal.height; + double d5 = random.nextDouble() * (double)this.theAnimal.width * 2.0D - (double)this.theAnimal.width; + this.theWorld.spawnParticle(EnumParticleTypes.HEART, this.theAnimal.posX + d3, this.theAnimal.posY + d4, this.theAnimal.posZ + d5, d0, d1, d2, new int[0]); + } + + if (this.theWorld.getGameRules().getBoolean("doMobLoot")) + { + this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, random.nextInt(7) + 1)); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java new file mode 100644 index 0000000..106273c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java @@ -0,0 +1,91 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIMoveIndoors extends EntityAIBase +{ + private EntityCreature entityObj; + private VillageDoorInfo doorInfo; + private int insidePosX = -1; + private int insidePosZ = -1; + + public EntityAIMoveIndoors(EntityCreature entityObjIn) + { + this.entityObj = entityObjIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + BlockPos blockpos = new BlockPos(this.entityObj); + + if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() && !this.entityObj.worldObj.getBiomeGenForCoords(blockpos).canRain()) && !this.entityObj.worldObj.provider.getHasNoSky()) + { + if (this.entityObj.getRNG().nextInt(50) != 0) + { + return false; + } + else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D) + { + return false; + } + else + { + Village village = this.entityObj.worldObj.getVillageCollection().getNearestVillage(blockpos, 14); + + if (village == null) + { + return false; + } + else + { + this.doorInfo = village.getDoorInfo(blockpos); + return this.doorInfo != null; + } + } + } + else + { + return false; + } + } + + public boolean continueExecuting() + { + return !this.entityObj.getNavigator().noPath(); + } + + public void startExecuting() + { + this.insidePosX = -1; + BlockPos blockpos = this.doorInfo.getInsideBlockPos(); + int i = blockpos.getX(); + int j = blockpos.getY(); + int k = blockpos.getZ(); + + if (this.entityObj.getDistanceSq(blockpos) > 256.0D) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entityObj, 14, 3, new Vec3((double)i + 0.5D, (double)j, (double)k + 0.5D)); + + if (vec3 != null) + { + this.entityObj.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, 1.0D); + } + } + else + { + this.entityObj.getNavigator().tryMoveToXYZ((double)i + 0.5D, (double)j, (double)k + 0.5D, 1.0D); + } + } + + public void resetTask() + { + this.insidePosX = this.doorInfo.getInsideBlockPos().getX(); + this.insidePosZ = this.doorInfo.getInsideBlockPos().getZ(); + this.doorInfo = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java new file mode 100644 index 0000000..305c90f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java @@ -0,0 +1,158 @@ +package net.minecraft.entity.ai; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIMoveThroughVillage extends EntityAIBase +{ + private EntityCreature theEntity; + private double movementSpeed; + private PathEntity entityPathNavigate; + private VillageDoorInfo doorInfo; + private boolean isNocturnal; + private List doorList = Lists.newArrayList(); + + public EntityAIMoveThroughVillage(EntityCreature theEntityIn, double movementSpeedIn, boolean isNocturnalIn) + { + this.theEntity = theEntityIn; + this.movementSpeed = movementSpeedIn; + this.isNocturnal = isNocturnalIn; + this.setMutexBits(1); + + if (!(theEntityIn.getNavigator() instanceof PathNavigateGround)) + { + throw new IllegalArgumentException("Unsupported mob for MoveThroughVillageGoal"); + } + } + + public boolean shouldExecute() + { + this.resizeDoorList(); + + if (this.isNocturnal && this.theEntity.worldObj.isDaytime()) + { + return false; + } + else + { + Village village = this.theEntity.worldObj.getVillageCollection().getNearestVillage(new BlockPos(this.theEntity), 0); + + if (village == null) + { + return false; + } + else + { + this.doorInfo = this.findNearestDoor(village); + + if (this.doorInfo == null) + { + return false; + } + else + { + PathNavigateGround pathnavigateground = (PathNavigateGround)this.theEntity.getNavigator(); + boolean flag = pathnavigateground.getEnterDoors(); + pathnavigateground.setBreakDoors(false); + this.entityPathNavigate = pathnavigateground.getPathToPos(this.doorInfo.getDoorBlockPos()); + pathnavigateground.setBreakDoors(flag); + + if (this.entityPathNavigate != null) + { + return true; + } + else + { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 10, 7, new Vec3((double)this.doorInfo.getDoorBlockPos().getX(), (double)this.doorInfo.getDoorBlockPos().getY(), (double)this.doorInfo.getDoorBlockPos().getZ())); + + if (vec3 == null) + { + return false; + } + else + { + pathnavigateground.setBreakDoors(false); + this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord); + pathnavigateground.setBreakDoors(flag); + return this.entityPathNavigate != null; + } + } + } + } + } + } + + public boolean continueExecuting() + { + if (this.theEntity.getNavigator().noPath()) + { + return false; + } + else + { + float f = this.theEntity.width + 4.0F; + return this.theEntity.getDistanceSq(this.doorInfo.getDoorBlockPos()) > (double)(f * f); + } + } + + public void startExecuting() + { + this.theEntity.getNavigator().setPath(this.entityPathNavigate, this.movementSpeed); + } + + public void resetTask() + { + if (this.theEntity.getNavigator().noPath() || this.theEntity.getDistanceSq(this.doorInfo.getDoorBlockPos()) < 16.0D) + { + this.doorList.add(this.doorInfo); + } + } + + private VillageDoorInfo findNearestDoor(Village villageIn) + { + VillageDoorInfo villagedoorinfo = null; + int i = Integer.MAX_VALUE; + + for (VillageDoorInfo villagedoorinfo1 : villageIn.getVillageDoorInfoList()) + { + int j = villagedoorinfo1.getDistanceSquared(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ)); + + if (j < i && !this.doesDoorListContain(villagedoorinfo1)) + { + villagedoorinfo = villagedoorinfo1; + i = j; + } + } + + return villagedoorinfo; + } + + private boolean doesDoorListContain(VillageDoorInfo doorInfoIn) + { + for (VillageDoorInfo villagedoorinfo : this.doorList) + { + if (doorInfoIn.getDoorBlockPos().equals(villagedoorinfo.getDoorBlockPos())) + { + return true; + } + } + + return false; + } + + private void resizeDoorList() + { + if (this.doorList.size() > 15) + { + this.doorList.remove(0); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveToBlock.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveToBlock.java new file mode 100644 index 0000000..bb67136 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveToBlock.java @@ -0,0 +1,110 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public abstract class EntityAIMoveToBlock extends EntityAIBase +{ + private final EntityCreature theEntity; + private final double movementSpeed; + protected int runDelay; + private int timeoutCounter; + private int field_179490_f; + protected BlockPos destinationBlock = BlockPos.ORIGIN; + private boolean isAboveDestination; + private int searchLength; + + public EntityAIMoveToBlock(EntityCreature creature, double speedIn, int length) + { + this.theEntity = creature; + this.movementSpeed = speedIn; + this.searchLength = length; + this.setMutexBits(5); + } + + public boolean shouldExecute() + { + if (this.runDelay > 0) + { + --this.runDelay; + return false; + } + else + { + this.runDelay = 200 + this.theEntity.getRNG().nextInt(200); + return this.searchForDestination(); + } + } + + public boolean continueExecuting() + { + return this.timeoutCounter >= -this.field_179490_f && this.timeoutCounter <= 1200 && this.shouldMoveTo(this.theEntity.worldObj, this.destinationBlock); + } + + public void startExecuting() + { + this.theEntity.getNavigator().tryMoveToXYZ((double)((float)this.destinationBlock.getX()) + 0.5D, (double)(this.destinationBlock.getY() + 1), (double)((float)this.destinationBlock.getZ()) + 0.5D, this.movementSpeed); + this.timeoutCounter = 0; + this.field_179490_f = this.theEntity.getRNG().nextInt(this.theEntity.getRNG().nextInt(1200) + 1200) + 1200; + } + + public void resetTask() + { + } + + public void updateTask() + { + if (this.theEntity.getDistanceSqToCenter(this.destinationBlock.up()) > 1.0D) + { + this.isAboveDestination = false; + ++this.timeoutCounter; + + if (this.timeoutCounter % 40 == 0) + { + this.theEntity.getNavigator().tryMoveToXYZ((double)((float)this.destinationBlock.getX()) + 0.5D, (double)(this.destinationBlock.getY() + 1), (double)((float)this.destinationBlock.getZ()) + 0.5D, this.movementSpeed); + } + } + else + { + this.isAboveDestination = true; + --this.timeoutCounter; + } + } + + protected boolean getIsAboveDestination() + { + return this.isAboveDestination; + } + + private boolean searchForDestination() + { + int i = this.searchLength; + int j = 1; + BlockPos blockpos = new BlockPos(this.theEntity); + + for (int k = 0; k <= 1; k = k > 0 ? -k : 1 - k) + { + for (int l = 0; l < i; ++l) + { + for (int i1 = 0; i1 <= l; i1 = i1 > 0 ? -i1 : 1 - i1) + { + for (int j1 = i1 < l && i1 > -l ? l : 0; j1 <= l; j1 = j1 > 0 ? -j1 : 1 - j1) + { + BlockPos blockpos1 = blockpos.add(i1, k - 1, j1); + + if (this.theEntity.isWithinHomeDistanceFromPosition(blockpos1) && this.shouldMoveTo(this.theEntity.worldObj, blockpos1)) + { + this.destinationBlock = blockpos1; + return true; + } + } + } + } + } + + return false; + } + + protected abstract boolean shouldMoveTo(World worldIn, BlockPos pos); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java new file mode 100644 index 0000000..fce9c52 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java @@ -0,0 +1,56 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; + +public class EntityAIMoveTowardsRestriction extends EntityAIBase +{ + private EntityCreature theEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private double movementSpeed; + + public EntityAIMoveTowardsRestriction(EntityCreature creatureIn, double speedIn) + { + this.theEntity = creatureIn; + this.movementSpeed = speedIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (this.theEntity.isWithinHomeDistanceCurrentPosition()) + { + return false; + } + else + { + BlockPos blockpos = this.theEntity.getHomePosition(); + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, new Vec3((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ())); + + if (vec3 == null) + { + return false; + } + else + { + this.movePosX = vec3.xCoord; + this.movePosY = vec3.yCoord; + this.movePosZ = vec3.zCoord; + return true; + } + } + } + + public boolean continueExecuting() + { + return !this.theEntity.getNavigator().noPath(); + } + + public void startExecuting() + { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java new file mode 100644 index 0000000..df0cbb0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java @@ -0,0 +1,69 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.Vec3; + +public class EntityAIMoveTowardsTarget extends EntityAIBase +{ + private EntityCreature theEntity; + private EntityLivingBase targetEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private double speed; + private float maxTargetDistance; + + public EntityAIMoveTowardsTarget(EntityCreature creature, double speedIn, float targetMaxDistance) + { + this.theEntity = creature; + this.speed = speedIn; + this.maxTargetDistance = targetMaxDistance; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + this.targetEntity = this.theEntity.getAttackTarget(); + + if (this.targetEntity == null) + { + return false; + } + else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.maxTargetDistance * this.maxTargetDistance)) + { + return false; + } + else + { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, new Vec3(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); + + if (vec3 == null) + { + return false; + } + else + { + this.movePosX = vec3.xCoord; + this.movePosY = vec3.yCoord; + this.movePosZ = vec3.zCoord; + return true; + } + } + } + + public boolean continueExecuting() + { + return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.maxTargetDistance * this.maxTargetDistance); + } + + public void resetTask() + { + this.targetEntity = null; + } + + public void startExecuting() + { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.speed); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java new file mode 100644 index 0000000..b5fa3c1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java @@ -0,0 +1,128 @@ +package net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EntitySelectors; + +public class EntityAINearestAttackableTarget extends EntityAITarget +{ + protected final Class targetClass; + private final int targetChance; + protected final EntityAINearestAttackableTarget.Sorter theNearestAttackableTargetSorter; + protected Predicate targetEntitySelector; + protected EntityLivingBase targetEntity; + + public EntityAINearestAttackableTarget(EntityCreature creature, Class classTarget, boolean checkSight) + { + this(creature, classTarget, checkSight, false); + } + + public EntityAINearestAttackableTarget(EntityCreature creature, Class classTarget, boolean checkSight, boolean onlyNearby) + { + this(creature, classTarget, 10, checkSight, onlyNearby, (Predicate )null); + } + + public EntityAINearestAttackableTarget(EntityCreature creature, Class classTarget, int chance, boolean checkSight, boolean onlyNearby, final Predicate targetSelector) + { + super(creature, checkSight, onlyNearby); + this.targetClass = classTarget; + this.targetChance = chance; + this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(creature); + this.setMutexBits(1); + this.targetEntitySelector = new Predicate() + { + public boolean apply(T p_apply_1_) + { + if (targetSelector != null && !targetSelector.apply(p_apply_1_)) + { + return false; + } + else + { + if (p_apply_1_ instanceof EntityPlayer) + { + double d0 = EntityAINearestAttackableTarget.this.getTargetDistance(); + + if (p_apply_1_.isSneaking()) + { + d0 *= 0.800000011920929D; + } + + if (p_apply_1_.isInvisible()) + { + float f = ((EntityPlayer)p_apply_1_).getArmorVisibility(); + + if (f < 0.1F) + { + f = 0.1F; + } + + d0 *= (double)(0.7F * f); + } + + if ((double)p_apply_1_.getDistanceToEntity(EntityAINearestAttackableTarget.this.taskOwner) > d0) + { + return false; + } + } + + return EntityAINearestAttackableTarget.this.isSuitableTarget(p_apply_1_, false); + } + } + }; + } + + public boolean shouldExecute() + { + if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) + { + return false; + } + else + { + double d0 = this.getTargetDistance(); + List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.targetClass, this.taskOwner.getEntityBoundingBox().expand(d0, 4.0D, d0), Predicates. and (this.targetEntitySelector, EntitySelectors.NOT_SPECTATING)); + Collections.sort(list, this.theNearestAttackableTargetSorter); + + if (list.isEmpty()) + { + return false; + } + else + { + this.targetEntity = (EntityLivingBase)list.get(0); + return true; + } + } + } + + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.targetEntity); + super.startExecuting(); + } + + public static class Sorter implements Comparator + { + private final Entity theEntity; + + public Sorter(Entity theEntityIn) + { + this.theEntity = theEntityIn; + } + + public int compare(Entity p_compare_1_, Entity p_compare_2_) + { + double d0 = this.theEntity.getDistanceSqToEntity(p_compare_1_); + double d1 = this.theEntity.getDistanceSqToEntity(p_compare_2_); + return d0 < d1 ? -1 : (d0 > d1 ? 1 : 0); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java new file mode 100644 index 0000000..971563e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java @@ -0,0 +1,75 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public class EntityAIOcelotAttack extends EntityAIBase +{ + World theWorld; + EntityLiving theEntity; + EntityLivingBase theVictim; + int attackCountdown; + + public EntityAIOcelotAttack(EntityLiving theEntityIn) + { + this.theEntity = theEntityIn; + this.theWorld = theEntityIn.worldObj; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.theVictim = entitylivingbase; + return true; + } + } + + public boolean continueExecuting() + { + return !this.theVictim.isEntityAlive() ? false : (this.theEntity.getDistanceSqToEntity(this.theVictim) > 225.0D ? false : !this.theEntity.getNavigator().noPath() || this.shouldExecute()); + } + + public void resetTask() + { + this.theVictim = null; + this.theEntity.getNavigator().clearPathEntity(); + } + + public void updateTask() + { + this.theEntity.getLookHelper().setLookPositionWithEntity(this.theVictim, 30.0F, 30.0F); + double d0 = (double)(this.theEntity.width * 2.0F * this.theEntity.width * 2.0F); + double d1 = this.theEntity.getDistanceSq(this.theVictim.posX, this.theVictim.getEntityBoundingBox().minY, this.theVictim.posZ); + double d2 = 0.8D; + + if (d1 > d0 && d1 < 16.0D) + { + d2 = 1.33D; + } + else if (d1 < 225.0D) + { + d2 = 0.6D; + } + + this.theEntity.getNavigator().tryMoveToEntityLiving(this.theVictim, d2); + this.attackCountdown = Math.max(this.attackCountdown - 1, 0); + + if (d1 <= d0) + { + if (this.attackCountdown <= 0) + { + this.attackCountdown = 20; + this.theEntity.attackEntityAsMob(this.theVictim); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java new file mode 100644 index 0000000..82298da --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java @@ -0,0 +1,96 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityAIOcelotSit extends EntityAIMoveToBlock +{ + private final EntityOcelot ocelot; + + public EntityAIOcelotSit(EntityOcelot ocelotIn, double p_i45315_2_) + { + super(ocelotIn, p_i45315_2_, 8); + this.ocelot = ocelotIn; + } + + public boolean shouldExecute() + { + return this.ocelot.isTamed() && !this.ocelot.isSitting() && super.shouldExecute(); + } + + public boolean continueExecuting() + { + return super.continueExecuting(); + } + + public void startExecuting() + { + super.startExecuting(); + this.ocelot.getAISit().setSitting(false); + } + + public void resetTask() + { + super.resetTask(); + this.ocelot.setSitting(false); + } + + public void updateTask() + { + super.updateTask(); + this.ocelot.getAISit().setSitting(false); + + if (!this.getIsAboveDestination()) + { + this.ocelot.setSitting(false); + } + else if (!this.ocelot.isSitting()) + { + this.ocelot.setSitting(true); + } + } + + protected boolean shouldMoveTo(World worldIn, BlockPos pos) + { + if (!worldIn.isAirBlock(pos.up())) + { + return false; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (block == Blocks.chest) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityChest && ((TileEntityChest)tileentity).numPlayersUsing < 1) + { + return true; + } + } + else + { + if (block == Blocks.lit_furnace) + { + return true; + } + + if (block == Blocks.bed && iblockstate.getValue(BlockBed.PART) != BlockBed.EnumPartType.HEAD) + { + return true; + } + } + + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java new file mode 100644 index 0000000..5d45a5c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java @@ -0,0 +1,41 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAIOpenDoor extends EntityAIDoorInteract +{ + boolean closeDoor; + int closeDoorTemporisation; + + public EntityAIOpenDoor(EntityLiving entitylivingIn, boolean shouldClose) + { + super(entitylivingIn); + this.theEntity = entitylivingIn; + this.closeDoor = shouldClose; + } + + public boolean continueExecuting() + { + return this.closeDoor && this.closeDoorTemporisation > 0 && super.continueExecuting(); + } + + public void startExecuting() + { + this.closeDoorTemporisation = 20; + this.doorBlock.toggleDoor(this.theEntity.worldObj, this.doorPosition, true); + } + + public void resetTask() + { + if (this.closeDoor) + { + this.doorBlock.toggleDoor(this.theEntity.worldObj, this.doorPosition, false); + } + } + + public void updateTask() + { + --this.closeDoorTemporisation; + super.updateTask(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java new file mode 100644 index 0000000..2c04ca4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java @@ -0,0 +1,54 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAIOwnerHurtByTarget extends EntityAITarget +{ + EntityTameable theDefendingTameable; + EntityLivingBase theOwnerAttacker; + private int field_142051_e; + + public EntityAIOwnerHurtByTarget(EntityTameable theDefendingTameableIn) + { + super(theDefendingTameableIn, false); + this.theDefendingTameable = theDefendingTameableIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (!this.theDefendingTameable.isTamed()) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.theOwnerAttacker = entitylivingbase.getAITarget(); + int i = entitylivingbase.getRevengeTimer(); + return i != this.field_142051_e && this.isSuitableTarget(this.theOwnerAttacker, false) && this.theDefendingTameable.shouldAttackEntity(this.theOwnerAttacker, entitylivingbase); + } + } + } + + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.theOwnerAttacker); + EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner(); + + if (entitylivingbase != null) + { + this.field_142051_e = entitylivingbase.getRevengeTimer(); + } + + super.startExecuting(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java new file mode 100644 index 0000000..5a37b53 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java @@ -0,0 +1,54 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAIOwnerHurtTarget extends EntityAITarget +{ + EntityTameable theEntityTameable; + EntityLivingBase theTarget; + private int field_142050_e; + + public EntityAIOwnerHurtTarget(EntityTameable theEntityTameableIn) + { + super(theEntityTameableIn, false); + this.theEntityTameable = theEntityTameableIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (!this.theEntityTameable.isTamed()) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.theTarget = entitylivingbase.getLastAttacker(); + int i = entitylivingbase.getLastAttackerTime(); + return i != this.field_142050_e && this.isSuitableTarget(this.theTarget, false) && this.theEntityTameable.shouldAttackEntity(this.theTarget, entitylivingbase); + } + } + } + + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.theTarget); + EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner(); + + if (entitylivingbase != null) + { + this.field_142050_e = entitylivingbase.getLastAttackerTime(); + } + + super.startExecuting(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIPanic.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIPanic.java new file mode 100644 index 0000000..45f489a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIPanic.java @@ -0,0 +1,54 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.Vec3; + +public class EntityAIPanic extends EntityAIBase +{ + private EntityCreature theEntityCreature; + protected double speed; + private double randPosX; + private double randPosY; + private double randPosZ; + + public EntityAIPanic(EntityCreature creature, double speedIn) + { + this.theEntityCreature = creature; + this.speed = speedIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) + { + return false; + } + else + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); + + if (vec3 == null) + { + return false; + } + else + { + this.randPosX = vec3.xCoord; + this.randPosY = vec3.yCoord; + this.randPosZ = vec3.zCoord; + return true; + } + } + } + + public void startExecuting() + { + this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); + } + + public boolean continueExecuting() + { + return !this.theEntityCreature.getNavigator().noPath(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIPlay.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIPlay.java new file mode 100644 index 0000000..0f14442 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIPlay.java @@ -0,0 +1,109 @@ +package net.minecraft.entity.ai; + +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.Vec3; + +public class EntityAIPlay extends EntityAIBase +{ + private EntityVillager villagerObj; + private EntityLivingBase targetVillager; + private double speed; + private int playTime; + + public EntityAIPlay(EntityVillager villagerObjIn, double speedIn) + { + this.villagerObj = villagerObjIn; + this.speed = speedIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (this.villagerObj.getGrowingAge() >= 0) + { + return false; + } + else if (this.villagerObj.getRNG().nextInt(400) != 0) + { + return false; + } + else + { + List list = this.villagerObj.worldObj.getEntitiesWithinAABB(EntityVillager.class, this.villagerObj.getEntityBoundingBox().expand(6.0D, 3.0D, 6.0D)); + double d0 = Double.MAX_VALUE; + + for (EntityVillager entityvillager : list) + { + if (entityvillager != this.villagerObj && !entityvillager.isPlaying() && entityvillager.getGrowingAge() < 0) + { + double d1 = entityvillager.getDistanceSqToEntity(this.villagerObj); + + if (d1 <= d0) + { + d0 = d1; + this.targetVillager = entityvillager; + } + } + } + + if (this.targetVillager == null) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + + if (vec3 == null) + { + return false; + } + } + + return true; + } + } + + public boolean continueExecuting() + { + return this.playTime > 0; + } + + public void startExecuting() + { + if (this.targetVillager != null) + { + this.villagerObj.setPlaying(true); + } + + this.playTime = 1000; + } + + public void resetTask() + { + this.villagerObj.setPlaying(false); + this.targetVillager = null; + } + + public void updateTask() + { + --this.playTime; + + if (this.targetVillager != null) + { + if (this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) + { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.targetVillager, this.speed); + } + } + else if (this.villagerObj.getNavigator().noPath()) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + + if (vec3 == null) + { + return; + } + + this.villagerObj.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.speed); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java new file mode 100644 index 0000000..8dceb0c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java @@ -0,0 +1,69 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIRestrictOpenDoor extends EntityAIBase +{ + private EntityCreature entityObj; + private VillageDoorInfo frontDoor; + + public EntityAIRestrictOpenDoor(EntityCreature creatureIn) + { + this.entityObj = creatureIn; + + if (!(creatureIn.getNavigator() instanceof PathNavigateGround)) + { + throw new IllegalArgumentException("Unsupported mob type for RestrictOpenDoorGoal"); + } + } + + public boolean shouldExecute() + { + if (this.entityObj.worldObj.isDaytime()) + { + return false; + } + else + { + BlockPos blockpos = new BlockPos(this.entityObj); + Village village = this.entityObj.worldObj.getVillageCollection().getNearestVillage(blockpos, 16); + + if (village == null) + { + return false; + } + else + { + this.frontDoor = village.getNearestDoor(blockpos); + return this.frontDoor == null ? false : (double)this.frontDoor.getDistanceToInsideBlockSq(blockpos) < 2.25D; + } + } + } + + public boolean continueExecuting() + { + return this.entityObj.worldObj.isDaytime() ? false : !this.frontDoor.getIsDetachedFromVillageFlag() && this.frontDoor.func_179850_c(new BlockPos(this.entityObj)); + } + + public void startExecuting() + { + ((PathNavigateGround)this.entityObj.getNavigator()).setBreakDoors(false); + ((PathNavigateGround)this.entityObj.getNavigator()).setEnterDoors(false); + } + + public void resetTask() + { + ((PathNavigateGround)this.entityObj.getNavigator()).setBreakDoors(true); + ((PathNavigateGround)this.entityObj.getNavigator()).setEnterDoors(true); + this.frontDoor = null; + } + + public void updateTask() + { + this.frontDoor.incrementDoorOpeningRestrictionCounter(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java new file mode 100644 index 0000000..b121060 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java @@ -0,0 +1,29 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.pathfinding.PathNavigateGround; + +public class EntityAIRestrictSun extends EntityAIBase +{ + private EntityCreature theEntity; + + public EntityAIRestrictSun(EntityCreature creature) + { + this.theEntity = creature; + } + + public boolean shouldExecute() + { + return this.theEntity.worldObj.isDaytime(); + } + + public void startExecuting() + { + ((PathNavigateGround)this.theEntity.getNavigator()).setAvoidSun(true); + } + + public void resetTask() + { + ((PathNavigateGround)this.theEntity.getNavigator()).setAvoidSun(false); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java new file mode 100644 index 0000000..58b41a6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java @@ -0,0 +1,82 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; + +public class EntityAIRunAroundLikeCrazy extends EntityAIBase +{ + private EntityHorse horseHost; + private double speed; + private double targetX; + private double targetY; + private double targetZ; + + public EntityAIRunAroundLikeCrazy(EntityHorse horse, double speedIn) + { + this.horseHost = horse; + this.speed = speedIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.horseHost, 5, 4); + + if (vec3 == null) + { + return false; + } + else + { + this.targetX = vec3.xCoord; + this.targetY = vec3.yCoord; + this.targetZ = vec3.zCoord; + return true; + } + } + else + { + return false; + } + } + + public void startExecuting() + { + this.horseHost.getNavigator().tryMoveToXYZ(this.targetX, this.targetY, this.targetZ, this.speed); + } + + public boolean continueExecuting() + { + return !this.horseHost.getNavigator().noPath() && this.horseHost.riddenByEntity != null; + } + + public void updateTask() + { + if (this.horseHost.getRNG().nextInt(50) == 0) + { + if (this.horseHost.riddenByEntity instanceof EntityPlayer) + { + int i = this.horseHost.getTemper(); + int j = this.horseHost.getMaxTemper(); + + if (j > 0 && this.horseHost.getRNG().nextInt(j) < i) + { + this.horseHost.setTamedBy((EntityPlayer)this.horseHost.riddenByEntity); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)7); + return; + } + + this.horseHost.increaseTemper(5); + } + + this.horseHost.riddenByEntity.mountEntity((Entity)null); + this.horseHost.riddenByEntity = null; + this.horseHost.makeHorseRearWithSound(); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)6); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAISit.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAISit.java new file mode 100644 index 0000000..009eee4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAISit.java @@ -0,0 +1,53 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAISit extends EntityAIBase +{ + private EntityTameable theEntity; + private boolean isSitting; + + public EntityAISit(EntityTameable entityIn) + { + this.theEntity = entityIn; + this.setMutexBits(5); + } + + public boolean shouldExecute() + { + if (!this.theEntity.isTamed()) + { + return false; + } + else if (this.theEntity.isInWater()) + { + return false; + } + else if (!this.theEntity.onGround) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = this.theEntity.getOwner(); + return entitylivingbase == null ? true : (this.theEntity.getDistanceSqToEntity(entitylivingbase) < 144.0D && entitylivingbase.getAITarget() != null ? false : this.isSitting); + } + } + + public void startExecuting() + { + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.setSitting(true); + } + + public void resetTask() + { + this.theEntity.setSitting(false); + } + + public void setSitting(boolean sitting) + { + this.isSitting = sitting; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAISwimming.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAISwimming.java new file mode 100644 index 0000000..bdf5231 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAISwimming.java @@ -0,0 +1,29 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.pathfinding.PathNavigateGround; + +public class EntityAISwimming extends EntityAIBase +{ + private EntityLiving theEntity; + + public EntityAISwimming(EntityLiving entitylivingIn) + { + this.theEntity = entitylivingIn; + this.setMutexBits(4); + ((PathNavigateGround)entitylivingIn.getNavigator()).setCanSwim(true); + } + + public boolean shouldExecute() + { + return this.theEntity.isInWater() || this.theEntity.isInLava(); + } + + public void updateTask() + { + if (this.theEntity.getRNG().nextFloat() < 0.8F) + { + this.theEntity.getJumpHelper().setJumping(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITarget.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITarget.java new file mode 100644 index 0000000..b35b732 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITarget.java @@ -0,0 +1,215 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.scoreboard.Team; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.StringUtils; + +public abstract class EntityAITarget extends EntityAIBase +{ + protected final EntityCreature taskOwner; + protected boolean shouldCheckSight; + private boolean nearbyOnly; + private int targetSearchStatus; + private int targetSearchDelay; + private int targetUnseenTicks; + + public EntityAITarget(EntityCreature creature, boolean checkSight) + { + this(creature, checkSight, false); + } + + public EntityAITarget(EntityCreature creature, boolean checkSight, boolean onlyNearby) + { + this.taskOwner = creature; + this.shouldCheckSight = checkSight; + this.nearbyOnly = onlyNearby; + } + + public boolean continueExecuting() + { + EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else if (!entitylivingbase.isEntityAlive()) + { + return false; + } + else + { + Team team = this.taskOwner.getTeam(); + Team team1 = entitylivingbase.getTeam(); + + if (team != null && team1 == team) + { + return false; + } + else + { + double d0 = this.getTargetDistance(); + + if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0) + { + return false; + } + else + { + if (this.shouldCheckSight) + { + if (this.taskOwner.getEntitySenses().canSee(entitylivingbase)) + { + this.targetUnseenTicks = 0; + } + else if (++this.targetUnseenTicks > 60) + { + return false; + } + } + + return !(entitylivingbase instanceof EntityPlayer) || !((EntityPlayer)entitylivingbase).capabilities.disableDamage; + } + } + } + } + + protected double getTargetDistance() + { + IAttributeInstance iattributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); + return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); + } + + public void startExecuting() + { + this.targetSearchStatus = 0; + this.targetSearchDelay = 0; + this.targetUnseenTicks = 0; + } + + public void resetTask() + { + this.taskOwner.setAttackTarget((EntityLivingBase)null); + } + + public static boolean isSuitableTarget(EntityLiving attacker, EntityLivingBase target, boolean includeInvincibles, boolean checkSight) + { + if (target == null) + { + return false; + } + else if (target == attacker) + { + return false; + } + else if (!target.isEntityAlive()) + { + return false; + } + else if (!attacker.canAttackClass(target.getClass())) + { + return false; + } + else + { + Team team = attacker.getTeam(); + Team team1 = target.getTeam(); + + if (team != null && team1 == team) + { + return false; + } + else + { + if (attacker instanceof IEntityOwnable && StringUtils.isNotEmpty(((IEntityOwnable)attacker).getOwnerId())) + { + if (target instanceof IEntityOwnable && ((IEntityOwnable)attacker).getOwnerId().equals(((IEntityOwnable)target).getOwnerId())) + { + return false; + } + + if (target == ((IEntityOwnable)attacker).getOwner()) + { + return false; + } + } + else if (target instanceof EntityPlayer && !includeInvincibles && ((EntityPlayer)target).capabilities.disableDamage) + { + return false; + } + + return !checkSight || attacker.getEntitySenses().canSee(target); + } + } + } + + protected boolean isSuitableTarget(EntityLivingBase target, boolean includeInvincibles) + { + if (!isSuitableTarget(this.taskOwner, target, includeInvincibles, this.shouldCheckSight)) + { + return false; + } + else if (!this.taskOwner.isWithinHomeDistanceFromPosition(new BlockPos(target))) + { + return false; + } + else + { + if (this.nearbyOnly) + { + if (--this.targetSearchDelay <= 0) + { + this.targetSearchStatus = 0; + } + + if (this.targetSearchStatus == 0) + { + this.targetSearchStatus = this.canEasilyReach(target) ? 1 : 2; + } + + if (this.targetSearchStatus == 2) + { + return false; + } + } + + return true; + } + } + + private boolean canEasilyReach(EntityLivingBase target) + { + this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5); + PathEntity pathentity = this.taskOwner.getNavigator().getPathToEntityLiving(target); + + if (pathentity == null) + { + return false; + } + else + { + PathPoint pathpoint = pathentity.getFinalPathPoint(); + + if (pathpoint == null) + { + return false; + } + else + { + int i = pathpoint.xCoord - MathHelper.floor_double(target.posX); + int j = pathpoint.zCoord - MathHelper.floor_double(target.posZ); + return (double)(i * i + j * j) <= 2.25D; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java new file mode 100644 index 0000000..31328ff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java @@ -0,0 +1,21 @@ +package net.minecraft.entity.ai; + +import com.google.common.base.Predicate; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAITargetNonTamed extends EntityAINearestAttackableTarget +{ + private EntityTameable theTameable; + + public EntityAITargetNonTamed(EntityTameable entityIn, Class classTarget, boolean checkSight, Predicate targetSelector) + { + super(entityIn, classTarget, 10, checkSight, false, targetSelector); + this.theTameable = entityIn; + } + + public boolean shouldExecute() + { + return !this.theTameable.isTamed() && super.shouldExecute(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITasks.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITasks.java new file mode 100644 index 0000000..364354b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITasks.java @@ -0,0 +1,166 @@ +package net.minecraft.entity.ai; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import net.minecraft.profiler.Profiler; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityAITasks +{ + private static final Logger logger = LogManager.getLogger(); + private List taskEntries = Lists.newArrayList(); + private List executingTaskEntries = Lists.newArrayList(); + private final Profiler theProfiler; + private int tickCount; + private int tickRate = 3; + + public EntityAITasks(Profiler profilerIn) + { + this.theProfiler = profilerIn; + } + + public void addTask(int priority, EntityAIBase task) + { + this.taskEntries.add(new EntityAITasks.EntityAITaskEntry(priority, task)); + } + + public void removeTask(EntityAIBase task) + { + Iterator iterator = this.taskEntries.iterator(); + + while (iterator.hasNext()) + { + EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + EntityAIBase entityaibase = entityaitasks$entityaitaskentry.action; + + if (entityaibase == task) + { + if (this.executingTaskEntries.contains(entityaitasks$entityaitaskentry)) + { + entityaibase.resetTask(); + this.executingTaskEntries.remove(entityaitasks$entityaitaskentry); + } + + iterator.remove(); + } + } + } + + public void onUpdateTasks() + { + this.theProfiler.startSection("goalSetup"); + + if (this.tickCount++ % this.tickRate == 0) + { + Iterator iterator = this.taskEntries.iterator(); + label38: + + while (true) + { + EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry; + + while (true) + { + if (!iterator.hasNext()) + { + break label38; + } + + entityaitasks$entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + boolean flag = this.executingTaskEntries.contains(entityaitasks$entityaitaskentry); + + if (!flag) + { + break; + } + + if (!this.canUse(entityaitasks$entityaitaskentry) || !this.canContinue(entityaitasks$entityaitaskentry)) + { + entityaitasks$entityaitaskentry.action.resetTask(); + this.executingTaskEntries.remove(entityaitasks$entityaitaskentry); + break; + } + } + + if (this.canUse(entityaitasks$entityaitaskentry) && entityaitasks$entityaitaskentry.action.shouldExecute()) + { + entityaitasks$entityaitaskentry.action.startExecuting(); + this.executingTaskEntries.add(entityaitasks$entityaitaskentry); + } + } + } + else + { + Iterator iterator1 = this.executingTaskEntries.iterator(); + + while (iterator1.hasNext()) + { + EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry1 = (EntityAITasks.EntityAITaskEntry)iterator1.next(); + + if (!this.canContinue(entityaitasks$entityaitaskentry1)) + { + entityaitasks$entityaitaskentry1.action.resetTask(); + iterator1.remove(); + } + } + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("goalTick"); + + for (EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry2 : this.executingTaskEntries) + { + entityaitasks$entityaitaskentry2.action.updateTask(); + } + + this.theProfiler.endSection(); + } + + private boolean canContinue(EntityAITasks.EntityAITaskEntry taskEntry) + { + boolean flag = taskEntry.action.continueExecuting(); + return flag; + } + + private boolean canUse(EntityAITasks.EntityAITaskEntry taskEntry) + { + for (EntityAITasks.EntityAITaskEntry entityaitasks$entityaitaskentry : this.taskEntries) + { + if (entityaitasks$entityaitaskentry != taskEntry) + { + if (taskEntry.priority >= entityaitasks$entityaitaskentry.priority) + { + if (!this.areTasksCompatible(taskEntry, entityaitasks$entityaitaskentry) && this.executingTaskEntries.contains(entityaitasks$entityaitaskentry)) + { + return false; + } + } + else if (!entityaitasks$entityaitaskentry.action.isInterruptible() && this.executingTaskEntries.contains(entityaitasks$entityaitaskentry)) + { + return false; + } + } + } + + return true; + } + + private boolean areTasksCompatible(EntityAITasks.EntityAITaskEntry taskEntry1, EntityAITasks.EntityAITaskEntry taskEntry2) + { + return (taskEntry1.action.getMutexBits() & taskEntry2.action.getMutexBits()) == 0; + } + + class EntityAITaskEntry + { + public EntityAIBase action; + public int priority; + + public EntityAITaskEntry(int priorityIn, EntityAIBase task) + { + this.priority = priorityIn; + this.action = task; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITempt.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITempt.java new file mode 100644 index 0000000..977f590 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITempt.java @@ -0,0 +1,129 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathNavigateGround; + +public class EntityAITempt extends EntityAIBase +{ + private EntityCreature temptedEntity; + private double speed; + private double targetX; + private double targetY; + private double targetZ; + private double pitch; + private double yaw; + private EntityPlayer temptingPlayer; + private int delayTemptCounter; + private boolean isRunning; + private Item temptItem; + private boolean scaredByPlayerMovement; + private boolean avoidWater; + + public EntityAITempt(EntityCreature temptedEntityIn, double speedIn, Item temptItemIn, boolean scaredByPlayerMovementIn) + { + this.temptedEntity = temptedEntityIn; + this.speed = speedIn; + this.temptItem = temptItemIn; + this.scaredByPlayerMovement = scaredByPlayerMovementIn; + this.setMutexBits(3); + + if (!(temptedEntityIn.getNavigator() instanceof PathNavigateGround)) + { + throw new IllegalArgumentException("Unsupported mob type for TemptGoal"); + } + } + + public boolean shouldExecute() + { + if (this.delayTemptCounter > 0) + { + --this.delayTemptCounter; + return false; + } + else + { + this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); + + if (this.temptingPlayer == null) + { + return false; + } + else + { + ItemStack itemstack = this.temptingPlayer.getCurrentEquippedItem(); + return itemstack == null ? false : itemstack.getItem() == this.temptItem; + } + } + } + + public boolean continueExecuting() + { + if (this.scaredByPlayerMovement) + { + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) + { + if (this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.010000000000000002D) + { + return false; + } + + if (Math.abs((double)this.temptingPlayer.rotationPitch - this.pitch) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.yaw) > 5.0D) + { + return false; + } + } + else + { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + } + + this.pitch = (double)this.temptingPlayer.rotationPitch; + this.yaw = (double)this.temptingPlayer.rotationYaw; + } + + return this.shouldExecute(); + } + + public void startExecuting() + { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + this.isRunning = true; + this.avoidWater = ((PathNavigateGround)this.temptedEntity.getNavigator()).getAvoidsWater(); + ((PathNavigateGround)this.temptedEntity.getNavigator()).setAvoidsWater(false); + } + + public void resetTask() + { + this.temptingPlayer = null; + this.temptedEntity.getNavigator().clearPathEntity(); + this.delayTemptCounter = 100; + this.isRunning = false; + ((PathNavigateGround)this.temptedEntity.getNavigator()).setAvoidsWater(this.avoidWater); + } + + public void updateTask() + { + this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); + + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) + { + this.temptedEntity.getNavigator().clearPathEntity(); + } + else + { + this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); + } + } + + public boolean isRunning() + { + return this.isRunning; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java new file mode 100644 index 0000000..fc32ef0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java @@ -0,0 +1,51 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; + +public class EntityAITradePlayer extends EntityAIBase +{ + private EntityVillager villager; + + public EntityAITradePlayer(EntityVillager villagerIn) + { + this.villager = villagerIn; + this.setMutexBits(5); + } + + public boolean shouldExecute() + { + if (!this.villager.isEntityAlive()) + { + return false; + } + else if (this.villager.isInWater()) + { + return false; + } + else if (!this.villager.onGround) + { + return false; + } + else if (this.villager.velocityChanged) + { + return false; + } + else + { + EntityPlayer entityplayer = this.villager.getCustomer(); + return entityplayer == null ? false : (this.villager.getDistanceSqToEntity(entityplayer) > 16.0D ? false : entityplayer.openContainer instanceof Container); + } + } + + public void startExecuting() + { + this.villager.getNavigator().clearPathEntity(); + } + + public void resetTask() + { + this.villager.setCustomer((EntityPlayer)null); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIVillagerInteract.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIVillagerInteract.java new file mode 100644 index 0000000..07de933 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIVillagerInteract.java @@ -0,0 +1,95 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +public class EntityAIVillagerInteract extends EntityAIWatchClosest2 +{ + private int interactionDelay; + private EntityVillager villager; + + public EntityAIVillagerInteract(EntityVillager villagerIn) + { + super(villagerIn, EntityVillager.class, 3.0F, 0.02F); + this.villager = villagerIn; + } + + public void startExecuting() + { + super.startExecuting(); + + if (this.villager.canAbondonItems() && this.closestEntity instanceof EntityVillager && ((EntityVillager)this.closestEntity).func_175557_cr()) + { + this.interactionDelay = 10; + } + else + { + this.interactionDelay = 0; + } + } + + public void updateTask() + { + super.updateTask(); + + if (this.interactionDelay > 0) + { + --this.interactionDelay; + + if (this.interactionDelay == 0) + { + InventoryBasic inventorybasic = this.villager.getVillagerInventory(); + + for (int i = 0; i < inventorybasic.getSizeInventory(); ++i) + { + ItemStack itemstack = inventorybasic.getStackInSlot(i); + ItemStack itemstack1 = null; + + if (itemstack != null) + { + Item item = itemstack.getItem(); + + if ((item == Items.bread || item == Items.potato || item == Items.carrot) && itemstack.stackSize > 3) + { + int l = itemstack.stackSize / 2; + itemstack.stackSize -= l; + itemstack1 = new ItemStack(item, l, itemstack.getMetadata()); + } + else if (item == Items.wheat && itemstack.stackSize > 5) + { + int j = itemstack.stackSize / 2 / 3 * 3; + int k = j / 3; + itemstack.stackSize -= j; + itemstack1 = new ItemStack(Items.bread, k, 0); + } + + if (itemstack.stackSize <= 0) + { + inventorybasic.setInventorySlotContents(i, (ItemStack)null); + } + } + + if (itemstack1 != null) + { + double d0 = this.villager.posY - 0.30000001192092896D + (double)this.villager.getEyeHeight(); + EntityItem entityitem = new EntityItem(this.villager.worldObj, this.villager.posX, d0, this.villager.posZ, itemstack1); + float f = 0.3F; + float f1 = this.villager.rotationYawHead; + float f2 = this.villager.rotationPitch; + entityitem.motionX = (double)(-MathHelper.sin(f1 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI) * f); + entityitem.motionZ = (double)(MathHelper.cos(f1 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI) * f); + entityitem.motionY = (double)(-MathHelper.sin(f2 / 180.0F * (float)Math.PI) * f + 0.1F); + entityitem.setDefaultPickupDelay(); + this.villager.worldObj.spawnEntityInWorld(entityitem); + break; + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java new file mode 100644 index 0000000..5a110f8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java @@ -0,0 +1,126 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.BlockPos; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityAIVillagerMate extends EntityAIBase +{ + private EntityVillager villagerObj; + private EntityVillager mate; + private World worldObj; + private int matingTimeout; + Village villageObj; + + public EntityAIVillagerMate(EntityVillager villagerIn) + { + this.villagerObj = villagerIn; + this.worldObj = villagerIn.worldObj; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + if (this.villagerObj.getGrowingAge() != 0) + { + return false; + } + else if (this.villagerObj.getRNG().nextInt(500) != 0) + { + return false; + } + else + { + this.villageObj = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(this.villagerObj), 0); + + if (this.villageObj == null) + { + return false; + } + else if (this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getIsWillingToMate(true)) + { + Entity entity = this.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.villagerObj.getEntityBoundingBox().expand(8.0D, 3.0D, 8.0D), this.villagerObj); + + if (entity == null) + { + return false; + } + else + { + this.mate = (EntityVillager)entity; + return this.mate.getGrowingAge() == 0 && this.mate.getIsWillingToMate(true); + } + } + else + { + return false; + } + } + } + + public void startExecuting() + { + this.matingTimeout = 300; + this.villagerObj.setMating(true); + } + + public void resetTask() + { + this.villageObj = null; + this.mate = null; + this.villagerObj.setMating(false); + } + + public boolean continueExecuting() + { + return this.matingTimeout >= 0 && this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getGrowingAge() == 0 && this.villagerObj.getIsWillingToMate(false); + } + + public void updateTask() + { + --this.matingTimeout; + this.villagerObj.getLookHelper().setLookPositionWithEntity(this.mate, 10.0F, 30.0F); + + if (this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) + { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.mate, 0.25D); + } + else if (this.matingTimeout == 0 && this.mate.isMating()) + { + this.giveBirth(); + } + + if (this.villagerObj.getRNG().nextInt(35) == 0) + { + this.worldObj.setEntityState(this.villagerObj, (byte)12); + } + } + + private boolean checkSufficientDoorsPresentForNewVillager() + { + if (!this.villageObj.isMatingSeason()) + { + return false; + } + else + { + int i = (int)((double)((float)this.villageObj.getNumVillageDoors()) * 0.35D); + return this.villageObj.getNumVillagers() < i; + } + } + + private void giveBirth() + { + EntityVillager entityvillager = this.villagerObj.createChild(this.mate); + this.mate.setGrowingAge(6000); + this.villagerObj.setGrowingAge(6000); + this.mate.setIsWillingToMate(false); + this.villagerObj.setIsWillingToMate(false); + entityvillager.setGrowingAge(-24000); + entityvillager.setLocationAndAngles(this.villagerObj.posX, this.villagerObj.posY, this.villagerObj.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityvillager); + this.worldObj.setEntityState(entityvillager, (byte)12); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWander.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWander.java new file mode 100644 index 0000000..7f43807 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWander.java @@ -0,0 +1,79 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.Vec3; + +public class EntityAIWander extends EntityAIBase +{ + private EntityCreature entity; + private double xPosition; + private double yPosition; + private double zPosition; + private double speed; + private int executionChance; + private boolean mustUpdate; + + public EntityAIWander(EntityCreature creatureIn, double speedIn) + { + this(creatureIn, speedIn, 120); + } + + public EntityAIWander(EntityCreature creatureIn, double speedIn, int chance) + { + this.entity = creatureIn; + this.speed = speedIn; + this.executionChance = chance; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (!this.mustUpdate) + { + if (this.entity.getAge() >= 100) + { + return false; + } + + if (this.entity.getRNG().nextInt(this.executionChance) != 0) + { + return false; + } + } + + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); + + if (vec3 == null) + { + return false; + } + else + { + this.xPosition = vec3.xCoord; + this.yPosition = vec3.yCoord; + this.zPosition = vec3.zCoord; + this.mustUpdate = false; + return true; + } + } + + public boolean continueExecuting() + { + return !this.entity.getNavigator().noPath(); + } + + public void startExecuting() + { + this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); + } + + public void makeUpdate() + { + this.mustUpdate = true; + } + + public void setExecutionChance(int newchance) + { + this.executionChance = newchance; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java new file mode 100644 index 0000000..7e2817e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java @@ -0,0 +1,80 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; + +public class EntityAIWatchClosest extends EntityAIBase +{ + protected EntityLiving theWatcher; + protected Entity closestEntity; + protected float maxDistanceForPlayer; + private int lookTime; + private float chance; + protected Class watchedClass; + + public EntityAIWatchClosest(EntityLiving entitylivingIn, Class watchTargetClass, float maxDistance) + { + this.theWatcher = entitylivingIn; + this.watchedClass = watchTargetClass; + this.maxDistanceForPlayer = maxDistance; + this.chance = 0.02F; + this.setMutexBits(2); + } + + public EntityAIWatchClosest(EntityLiving entitylivingIn, Class watchTargetClass, float maxDistance, float chanceIn) + { + this.theWatcher = entitylivingIn; + this.watchedClass = watchTargetClass; + this.maxDistanceForPlayer = maxDistance; + this.chance = chanceIn; + this.setMutexBits(2); + } + + public boolean shouldExecute() + { + if (this.theWatcher.getRNG().nextFloat() >= this.chance) + { + return false; + } + else + { + if (this.theWatcher.getAttackTarget() != null) + { + this.closestEntity = this.theWatcher.getAttackTarget(); + } + + if (this.watchedClass == EntityPlayer.class) + { + this.closestEntity = this.theWatcher.worldObj.getClosestPlayerToEntity(this.theWatcher, (double)this.maxDistanceForPlayer); + } + else + { + this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.getEntityBoundingBox().expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); + } + + return this.closestEntity != null; + } + } + + public boolean continueExecuting() + { + return !this.closestEntity.isEntityAlive() ? false : (this.theWatcher.getDistanceSqToEntity(this.closestEntity) > (double)(this.maxDistanceForPlayer * this.maxDistanceForPlayer) ? false : this.lookTime > 0); + } + + public void startExecuting() + { + this.lookTime = 40 + this.theWatcher.getRNG().nextInt(40); + } + + public void resetTask() + { + this.closestEntity = null; + } + + public void updateTask() + { + this.theWatcher.getLookHelper().setLookPosition(this.closestEntity.posX, this.closestEntity.posY + (double)this.closestEntity.getEyeHeight(), this.closestEntity.posZ, 10.0F, (float)this.theWatcher.getVerticalFaceSpeed()); + --this.lookTime; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java new file mode 100644 index 0000000..56e249b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java @@ -0,0 +1,13 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; + +public class EntityAIWatchClosest2 extends EntityAIWatchClosest +{ + public EntityAIWatchClosest2(EntityLiving entitylivingIn, Class watchTargetClass, float maxDistance, float chanceIn) + { + super(entitylivingIn, watchTargetClass, maxDistance, chanceIn); + this.setMutexBits(3); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java new file mode 100644 index 0000000..b70ed50 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java @@ -0,0 +1,25 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityJumpHelper +{ + private EntityLiving entity; + protected boolean isJumping; + + public EntityJumpHelper(EntityLiving entityIn) + { + this.entity = entityIn; + } + + public void setJumping() + { + this.isJumping = true; + } + + public void doJump() + { + this.entity.setJumping(this.isJumping); + this.isJumping = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityLookHelper.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityLookHelper.java new file mode 100644 index 0000000..e42e939 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityLookHelper.java @@ -0,0 +1,125 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +public class EntityLookHelper +{ + private EntityLiving entity; + private float deltaLookYaw; + private float deltaLookPitch; + private boolean isLooking; + private double posX; + private double posY; + private double posZ; + + public EntityLookHelper(EntityLiving entitylivingIn) + { + this.entity = entitylivingIn; + } + + public void setLookPositionWithEntity(Entity entityIn, float deltaYaw, float deltaPitch) + { + this.posX = entityIn.posX; + + if (entityIn instanceof EntityLivingBase) + { + this.posY = entityIn.posY + (double)entityIn.getEyeHeight(); + } + else + { + this.posY = (entityIn.getEntityBoundingBox().minY + entityIn.getEntityBoundingBox().maxY) / 2.0D; + } + + this.posZ = entityIn.posZ; + this.deltaLookYaw = deltaYaw; + this.deltaLookPitch = deltaPitch; + this.isLooking = true; + } + + public void setLookPosition(double x, double y, double z, float deltaYaw, float deltaPitch) + { + this.posX = x; + this.posY = y; + this.posZ = z; + this.deltaLookYaw = deltaYaw; + this.deltaLookPitch = deltaPitch; + this.isLooking = true; + } + + public void onUpdateLook() + { + this.entity.rotationPitch = 0.0F; + + if (this.isLooking) + { + this.isLooking = false; + double d0 = this.posX - this.entity.posX; + double d1 = this.posY - (this.entity.posY + (double)this.entity.getEyeHeight()); + double d2 = this.posZ - this.entity.posZ; + double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); + float f = (float)(MathHelper.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f1 = (float)(-(MathHelper.atan2(d1, d3) * 180.0D / Math.PI)); + this.entity.rotationPitch = this.updateRotation(this.entity.rotationPitch, f1, this.deltaLookPitch); + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, f, this.deltaLookYaw); + } + else + { + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, this.entity.renderYawOffset, 10.0F); + } + + float f2 = MathHelper.wrapAngleTo180_float(this.entity.rotationYawHead - this.entity.renderYawOffset); + + if (!this.entity.getNavigator().noPath()) + { + if (f2 < -75.0F) + { + this.entity.rotationYawHead = this.entity.renderYawOffset - 75.0F; + } + + if (f2 > 75.0F) + { + this.entity.rotationYawHead = this.entity.renderYawOffset + 75.0F; + } + } + } + + private float updateRotation(float p_75652_1_, float p_75652_2_, float p_75652_3_) + { + float f = MathHelper.wrapAngleTo180_float(p_75652_2_ - p_75652_1_); + + if (f > p_75652_3_) + { + f = p_75652_3_; + } + + if (f < -p_75652_3_) + { + f = -p_75652_3_; + } + + return p_75652_1_ + f; + } + + public boolean getIsLooking() + { + return this.isLooking; + } + + public double getLookPosX() + { + return this.posX; + } + + public double getLookPosY() + { + return this.posY; + } + + public double getLookPosZ() + { + return this.posZ; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java new file mode 100644 index 0000000..291e898 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java @@ -0,0 +1,76 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityMinecartMobSpawner extends EntityMinecart +{ + private final MobSpawnerBaseLogic mobSpawnerLogic = new MobSpawnerBaseLogic() + { + public void func_98267_a(int id) + { + EntityMinecartMobSpawner.this.worldObj.setEntityState(EntityMinecartMobSpawner.this, (byte)id); + } + public World getSpawnerWorld() + { + return EntityMinecartMobSpawner.this.worldObj; + } + public BlockPos getSpawnerPosition() + { + return new BlockPos(EntityMinecartMobSpawner.this); + } + }; + + public EntityMinecartMobSpawner(World worldIn) + { + super(worldIn); + } + + public EntityMinecartMobSpawner(World worldIn, double p_i1726_2_, double p_i1726_4_, double p_i1726_6_) + { + super(worldIn, p_i1726_2_, p_i1726_4_, p_i1726_6_); + } + + public EntityMinecart.EnumMinecartType getMinecartType() + { + return EntityMinecart.EnumMinecartType.SPAWNER; + } + + public IBlockState getDefaultDisplayTile() + { + return Blocks.mob_spawner.getDefaultState(); + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.mobSpawnerLogic.readFromNBT(tagCompund); + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + this.mobSpawnerLogic.writeToNBT(tagCompound); + } + + public void handleStatusUpdate(byte id) + { + this.mobSpawnerLogic.setDelayToMin(id); + } + + public void onUpdate() + { + super.onUpdate(); + this.mobSpawnerLogic.updateSpawner(); + } + + public MobSpawnerBaseLogic func_98039_d() + { + return this.mobSpawnerLogic; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java new file mode 100644 index 0000000..6247f8c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java @@ -0,0 +1,112 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.MathHelper; + +public class EntityMoveHelper +{ + protected EntityLiving entity; + protected double posX; + protected double posY; + protected double posZ; + protected double speed; + protected boolean update; + + public EntityMoveHelper(EntityLiving entitylivingIn) + { + this.entity = entitylivingIn; + this.posX = entitylivingIn.posX; + this.posY = entitylivingIn.posY; + this.posZ = entitylivingIn.posZ; + } + + public boolean isUpdating() + { + return this.update; + } + + public double getSpeed() + { + return this.speed; + } + + public void setMoveTo(double x, double y, double z, double speedIn) + { + this.posX = x; + this.posY = y; + this.posZ = z; + this.speed = speedIn; + this.update = true; + } + + public void onUpdateMoveHelper() + { + this.entity.setMoveForward(0.0F); + + if (this.update) + { + this.update = false; + int i = MathHelper.floor_double(this.entity.getEntityBoundingBox().minY + 0.5D); + double d0 = this.posX - this.entity.posX; + double d1 = this.posZ - this.entity.posZ; + double d2 = this.posY - (double)i; + double d3 = d0 * d0 + d2 * d2 + d1 * d1; + + if (d3 >= 2.500000277905201E-7D) + { + float f = (float)(MathHelper.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F; + this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, f, 30.0F); + this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + + if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) + { + this.entity.getJumpHelper().setJumping(); + } + } + } + } + + protected float limitAngle(float p_75639_1_, float p_75639_2_, float p_75639_3_) + { + float f = MathHelper.wrapAngleTo180_float(p_75639_2_ - p_75639_1_); + + if (f > p_75639_3_) + { + f = p_75639_3_; + } + + if (f < -p_75639_3_) + { + f = -p_75639_3_; + } + + float f1 = p_75639_1_ + f; + + if (f1 < 0.0F) + { + f1 += 360.0F; + } + else if (f1 > 360.0F) + { + f1 -= 360.0F; + } + + return f1; + } + + public double getX() + { + return this.posX; + } + + public double getY() + { + return this.posY; + } + + public double getZ() + { + return this.posZ; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntitySenses.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntitySenses.java new file mode 100644 index 0000000..5fdfa39 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/EntitySenses.java @@ -0,0 +1,53 @@ +package net.minecraft.entity.ai; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; + +public class EntitySenses +{ + EntityLiving entityObj; + List seenEntities = Lists.newArrayList(); + List unseenEntities = Lists.newArrayList(); + + public EntitySenses(EntityLiving entityObjIn) + { + this.entityObj = entityObjIn; + } + + public void clearSensingCache() + { + this.seenEntities.clear(); + this.unseenEntities.clear(); + } + + public boolean canSee(Entity entityIn) + { + if (this.seenEntities.contains(entityIn)) + { + return true; + } + else if (this.unseenEntities.contains(entityIn)) + { + return false; + } + else + { + this.entityObj.worldObj.theProfiler.startSection("canSee"); + boolean flag = this.entityObj.canEntityBeSeen(entityIn); + this.entityObj.worldObj.theProfiler.endSection(); + + if (flag) + { + this.seenEntities.add(entityIn); + } + else + { + this.unseenEntities.add(entityIn); + } + + return flag; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java new file mode 100644 index 0000000..978514d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java @@ -0,0 +1,112 @@ +package net.minecraft.entity.ai; + +import java.util.Random; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class RandomPositionGenerator +{ + private static Vec3 staticVector = new Vec3(0.0D, 0.0D, 0.0D); + + public static Vec3 findRandomTarget(EntityCreature entitycreatureIn, int xz, int y) + { + return findRandomTargetBlock(entitycreatureIn, xz, y, (Vec3)null); + } + + public static Vec3 findRandomTargetBlockTowards(EntityCreature entitycreatureIn, int xz, int y, Vec3 targetVec3) + { + staticVector = targetVec3.subtract(entitycreatureIn.posX, entitycreatureIn.posY, entitycreatureIn.posZ); + return findRandomTargetBlock(entitycreatureIn, xz, y, staticVector); + } + + public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature entitycreatureIn, int xz, int y, Vec3 targetVec3) + { + staticVector = (new Vec3(entitycreatureIn.posX, entitycreatureIn.posY, entitycreatureIn.posZ)).subtract(targetVec3); + return findRandomTargetBlock(entitycreatureIn, xz, y, staticVector); + } + + private static Vec3 findRandomTargetBlock(EntityCreature entitycreatureIn, int xz, int y, Vec3 targetVec3) + { + Random random = entitycreatureIn.getRNG(); + boolean flag = false; + int i = 0; + int j = 0; + int k = 0; + float f = -99999.0F; + boolean flag1; + + if (entitycreatureIn.hasHome()) + { + double d0 = entitycreatureIn.getHomePosition().distanceSq((double)MathHelper.floor_double(entitycreatureIn.posX), (double)MathHelper.floor_double(entitycreatureIn.posY), (double)MathHelper.floor_double(entitycreatureIn.posZ)) + 4.0D; + double d1 = (double)(entitycreatureIn.getMaximumHomeDistance() + (float)xz); + flag1 = d0 < d1 * d1; + } + else + { + flag1 = false; + } + + for (int j1 = 0; j1 < 10; ++j1) + { + int l = random.nextInt(2 * xz + 1) - xz; + int k1 = random.nextInt(2 * y + 1) - y; + int i1 = random.nextInt(2 * xz + 1) - xz; + + if (targetVec3 == null || (double)l * targetVec3.xCoord + (double)i1 * targetVec3.zCoord >= 0.0D) + { + if (entitycreatureIn.hasHome() && xz > 1) + { + BlockPos blockpos = entitycreatureIn.getHomePosition(); + + if (entitycreatureIn.posX > (double)blockpos.getX()) + { + l -= random.nextInt(xz / 2); + } + else + { + l += random.nextInt(xz / 2); + } + + if (entitycreatureIn.posZ > (double)blockpos.getZ()) + { + i1 -= random.nextInt(xz / 2); + } + else + { + i1 += random.nextInt(xz / 2); + } + } + + l = l + MathHelper.floor_double(entitycreatureIn.posX); + k1 = k1 + MathHelper.floor_double(entitycreatureIn.posY); + i1 = i1 + MathHelper.floor_double(entitycreatureIn.posZ); + BlockPos blockpos1 = new BlockPos(l, k1, i1); + + if (!flag1 || entitycreatureIn.isWithinHomeDistanceFromPosition(blockpos1)) + { + float f1 = entitycreatureIn.getBlockPathWeight(blockpos1); + + if (f1 > f) + { + f = f1; + i = l; + j = k1; + k = i1; + flag = true; + } + } + } + } + + if (flag) + { + return new Vec3((double)i, (double)j, (double)k); + } + else + { + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java new file mode 100644 index 0000000..472ac28 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java @@ -0,0 +1,102 @@ +package net.minecraft.entity.ai.attributes; + +import io.netty.util.internal.ThreadLocalRandom; +import java.util.UUID; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.Validate; + +public class AttributeModifier +{ + private final double amount; + private final int operation; + private final String name; + private final UUID id; + private boolean isSaved; + + public AttributeModifier(String nameIn, double amountIn, int operationIn) + { + this(MathHelper.getRandomUuid(ThreadLocalRandom.current()), nameIn, amountIn, operationIn); + } + + public AttributeModifier(UUID idIn, String nameIn, double amountIn, int operationIn) + { + this.isSaved = true; + this.id = idIn; + this.name = nameIn; + this.amount = amountIn; + this.operation = operationIn; + Validate.notEmpty(nameIn, "Modifier name cannot be empty", new Object[0]); + Validate.inclusiveBetween(0L, 2L, (long)operationIn, "Invalid operation"); + } + + public UUID getID() + { + return this.id; + } + + public String getName() + { + return this.name; + } + + public int getOperation() + { + return this.operation; + } + + public double getAmount() + { + return this.amount; + } + + public boolean isSaved() + { + return this.isSaved; + } + + public AttributeModifier setSaved(boolean saved) + { + this.isSaved = saved; + return this; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + AttributeModifier attributemodifier = (AttributeModifier)p_equals_1_; + + if (this.id != null) + { + if (!this.id.equals(attributemodifier.id)) + { + return false; + } + } + else if (attributemodifier.id != null) + { + return false; + } + + return true; + } + else + { + return false; + } + } + + public int hashCode() + { + return this.id != null ? this.id.hashCode() : 0; + } + + public String toString() + { + return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name=\'" + this.name + '\'' + ", id=" + this.id + ", serialize=" + this.isSaved + '}'; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java new file mode 100644 index 0000000..0c87cd7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java @@ -0,0 +1,57 @@ +package net.minecraft.entity.ai.attributes; + +public abstract class BaseAttribute implements IAttribute +{ + private final IAttribute field_180373_a; + private final String unlocalizedName; + private final double defaultValue; + private boolean shouldWatch; + + protected BaseAttribute(IAttribute p_i45892_1_, String unlocalizedNameIn, double defaultValueIn) + { + this.field_180373_a = p_i45892_1_; + this.unlocalizedName = unlocalizedNameIn; + this.defaultValue = defaultValueIn; + + if (unlocalizedNameIn == null) + { + throw new IllegalArgumentException("Name cannot be null!"); + } + } + + public String getAttributeUnlocalizedName() + { + return this.unlocalizedName; + } + + public double getDefaultValue() + { + return this.defaultValue; + } + + public boolean getShouldWatch() + { + return this.shouldWatch; + } + + public BaseAttribute setShouldWatch(boolean shouldWatchIn) + { + this.shouldWatch = shouldWatchIn; + return this; + } + + public IAttribute func_180372_d() + { + return this.field_180373_a; + } + + public int hashCode() + { + return this.unlocalizedName.hashCode(); + } + + public boolean equals(Object p_equals_1_) + { + return p_equals_1_ instanceof IAttribute && this.unlocalizedName.equals(((IAttribute)p_equals_1_).getAttributeUnlocalizedName()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java new file mode 100644 index 0000000..8e815e5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java @@ -0,0 +1,85 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.server.management.LowerStringMap; + +public abstract class BaseAttributeMap +{ + protected final Map attributes = Maps.newHashMap(); + protected final Map attributesByName = new LowerStringMap(); + protected final Multimap field_180377_c = HashMultimap.create(); + + public IAttributeInstance getAttributeInstance(IAttribute attribute) + { + return (IAttributeInstance)this.attributes.get(attribute); + } + + public IAttributeInstance getAttributeInstanceByName(String attributeName) + { + return (IAttributeInstance)this.attributesByName.get(attributeName); + } + + public IAttributeInstance registerAttribute(IAttribute attribute) + { + if (this.attributesByName.containsKey(attribute.getAttributeUnlocalizedName())) + { + throw new IllegalArgumentException("Attribute is already registered!"); + } + else + { + IAttributeInstance iattributeinstance = this.func_180376_c(attribute); + this.attributesByName.put(attribute.getAttributeUnlocalizedName(), iattributeinstance); + this.attributes.put(attribute, iattributeinstance); + + for (IAttribute iattribute = attribute.func_180372_d(); iattribute != null; iattribute = iattribute.func_180372_d()) + { + this.field_180377_c.put(iattribute, attribute); + } + + return iattributeinstance; + } + } + + protected abstract IAttributeInstance func_180376_c(IAttribute attribute); + + public Collection getAllAttributes() + { + return this.attributesByName.values(); + } + + public void func_180794_a(IAttributeInstance instance) + { + } + + public void removeAttributeModifiers(Multimap modifiers) + { + for (Entry entry : modifiers.entries()) + { + IAttributeInstance iattributeinstance = this.getAttributeInstanceByName((String)entry.getKey()); + + if (iattributeinstance != null) + { + iattributeinstance.removeModifier((AttributeModifier)entry.getValue()); + } + } + } + + public void applyAttributeModifiers(Multimap modifiers) + { + for (Entry entry : modifiers.entries()) + { + IAttributeInstance iattributeinstance = this.getAttributeInstanceByName((String)entry.getKey()); + + if (iattributeinstance != null) + { + iattributeinstance.removeModifier((AttributeModifier)entry.getValue()); + iattributeinstance.applyModifier((AttributeModifier)entry.getValue()); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java new file mode 100644 index 0000000..07f1a11 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java @@ -0,0 +1,14 @@ +package net.minecraft.entity.ai.attributes; + +public interface IAttribute +{ + String getAttributeUnlocalizedName(); + + double clampValue(double p_111109_1_); + + double getDefaultValue(); + + boolean getShouldWatch(); + + IAttribute func_180372_d(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java new file mode 100644 index 0000000..1e753af --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java @@ -0,0 +1,29 @@ +package net.minecraft.entity.ai.attributes; + +import java.util.Collection; +import java.util.UUID; + +public interface IAttributeInstance +{ + IAttribute getAttribute(); + + double getBaseValue(); + + void setBaseValue(double baseValue); + + Collection getModifiersByOperation(int operation); + + Collection func_111122_c(); + + boolean hasModifier(AttributeModifier modifier); + + AttributeModifier getModifier(UUID uuid); + + void applyModifier(AttributeModifier modifier); + + void removeModifier(AttributeModifier modifier); + + void removeAllModifiers(); + + double getAttributeValue(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java new file mode 100644 index 0000000..a75d91e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java @@ -0,0 +1,197 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class ModifiableAttributeInstance implements IAttributeInstance +{ + private final BaseAttributeMap attributeMap; + private final IAttribute genericAttribute; + private final Map> mapByOperation = Maps.>newHashMap(); + private final Map> mapByName = Maps.>newHashMap(); + private final Map mapByUUID = Maps.newHashMap(); + private double baseValue; + private boolean needsUpdate = true; + private double cachedValue; + + public ModifiableAttributeInstance(BaseAttributeMap attributeMapIn, IAttribute genericAttributeIn) + { + this.attributeMap = attributeMapIn; + this.genericAttribute = genericAttributeIn; + this.baseValue = genericAttributeIn.getDefaultValue(); + + for (int i = 0; i < 3; ++i) + { + this.mapByOperation.put(Integer.valueOf(i), Sets.newHashSet()); + } + } + + public IAttribute getAttribute() + { + return this.genericAttribute; + } + + public double getBaseValue() + { + return this.baseValue; + } + + public void setBaseValue(double baseValue) + { + if (baseValue != this.getBaseValue()) + { + this.baseValue = baseValue; + this.flagForUpdate(); + } + } + + public Collection getModifiersByOperation(int operation) + { + return (Collection)this.mapByOperation.get(Integer.valueOf(operation)); + } + + public Collection func_111122_c() + { + Set set = Sets.newHashSet(); + + for (int i = 0; i < 3; ++i) + { + set.addAll(this.getModifiersByOperation(i)); + } + + return set; + } + + public AttributeModifier getModifier(UUID uuid) + { + return (AttributeModifier)this.mapByUUID.get(uuid); + } + + public boolean hasModifier(AttributeModifier modifier) + { + return this.mapByUUID.get(modifier.getID()) != null; + } + + public void applyModifier(AttributeModifier modifier) + { + if (this.getModifier(modifier.getID()) != null) + { + throw new IllegalArgumentException("Modifier is already applied on this attribute!"); + } + else + { + Set set = (Set)this.mapByName.get(modifier.getName()); + + if (set == null) + { + set = Sets.newHashSet(); + this.mapByName.put(modifier.getName(), set); + } + + ((Set)this.mapByOperation.get(Integer.valueOf(modifier.getOperation()))).add(modifier); + set.add(modifier); + this.mapByUUID.put(modifier.getID(), modifier); + this.flagForUpdate(); + } + } + + protected void flagForUpdate() + { + this.needsUpdate = true; + this.attributeMap.func_180794_a(this); + } + + public void removeModifier(AttributeModifier modifier) + { + for (int i = 0; i < 3; ++i) + { + Set set = (Set)this.mapByOperation.get(Integer.valueOf(i)); + set.remove(modifier); + } + + Set set1 = (Set)this.mapByName.get(modifier.getName()); + + if (set1 != null) + { + set1.remove(modifier); + + if (set1.isEmpty()) + { + this.mapByName.remove(modifier.getName()); + } + } + + this.mapByUUID.remove(modifier.getID()); + this.flagForUpdate(); + } + + public void removeAllModifiers() + { + Collection collection = this.func_111122_c(); + + if (collection != null) + { + for (AttributeModifier attributemodifier : Lists.newArrayList(collection)) + { + this.removeModifier(attributemodifier); + } + } + } + + public double getAttributeValue() + { + if (this.needsUpdate) + { + this.cachedValue = this.computeValue(); + this.needsUpdate = false; + } + + return this.cachedValue; + } + + private double computeValue() + { + double d0 = this.getBaseValue(); + + for (AttributeModifier attributemodifier : this.func_180375_b(0)) + { + d0 += attributemodifier.getAmount(); + } + + double d1 = d0; + + for (AttributeModifier attributemodifier1 : this.func_180375_b(1)) + { + d1 += d0 * attributemodifier1.getAmount(); + } + + for (AttributeModifier attributemodifier2 : this.func_180375_b(2)) + { + d1 *= 1.0D + attributemodifier2.getAmount(); + } + + return this.genericAttribute.clampValue(d1); + } + + private Collection func_180375_b(int operation) + { + Set set = Sets.newHashSet(this.getModifiersByOperation(operation)); + + for (IAttribute iattribute = this.genericAttribute.func_180372_d(); iattribute != null; iattribute = iattribute.func_180372_d()) + { + IAttributeInstance iattributeinstance = this.attributeMap.getAttributeInstance(iattribute); + + if (iattributeinstance != null) + { + set.addAll(iattributeinstance.getModifiersByOperation(operation)); + } + } + + return set; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java new file mode 100644 index 0000000..e324afa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java @@ -0,0 +1,47 @@ +package net.minecraft.entity.ai.attributes; + +import net.minecraft.util.MathHelper; + +public class RangedAttribute extends BaseAttribute +{ + private final double minimumValue; + private final double maximumValue; + private String description; + + public RangedAttribute(IAttribute p_i45891_1_, String unlocalizedNameIn, double defaultValue, double minimumValueIn, double maximumValueIn) + { + super(p_i45891_1_, unlocalizedNameIn, defaultValue); + this.minimumValue = minimumValueIn; + this.maximumValue = maximumValueIn; + + if (minimumValueIn > maximumValueIn) + { + throw new IllegalArgumentException("Minimum value cannot be bigger than maximum value!"); + } + else if (defaultValue < minimumValueIn) + { + throw new IllegalArgumentException("Default value cannot be lower than minimum value!"); + } + else if (defaultValue > maximumValueIn) + { + throw new IllegalArgumentException("Default value cannot be bigger than maximum value!"); + } + } + + public RangedAttribute setDescription(String descriptionIn) + { + this.description = descriptionIn; + return this; + } + + public String getDescription() + { + return this.description; + } + + public double clampValue(double p_111109_1_) + { + p_111109_1_ = MathHelper.clamp_double(p_111109_1_, this.minimumValue, this.maximumValue); + return p_111109_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java new file mode 100644 index 0000000..dfc0f97 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java @@ -0,0 +1,85 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import net.minecraft.server.management.LowerStringMap; + +public class ServersideAttributeMap extends BaseAttributeMap +{ + private final Set attributeInstanceSet = Sets.newHashSet(); + protected final Map descriptionToAttributeInstanceMap = new LowerStringMap(); + + public ModifiableAttributeInstance getAttributeInstance(IAttribute attribute) + { + return (ModifiableAttributeInstance)super.getAttributeInstance(attribute); + } + + public ModifiableAttributeInstance getAttributeInstanceByName(String attributeName) + { + IAttributeInstance iattributeinstance = super.getAttributeInstanceByName(attributeName); + + if (iattributeinstance == null) + { + iattributeinstance = (IAttributeInstance)this.descriptionToAttributeInstanceMap.get(attributeName); + } + + return (ModifiableAttributeInstance)iattributeinstance; + } + + public IAttributeInstance registerAttribute(IAttribute attribute) + { + IAttributeInstance iattributeinstance = super.registerAttribute(attribute); + + if (attribute instanceof RangedAttribute && ((RangedAttribute)attribute).getDescription() != null) + { + this.descriptionToAttributeInstanceMap.put(((RangedAttribute)attribute).getDescription(), iattributeinstance); + } + + return iattributeinstance; + } + + protected IAttributeInstance func_180376_c(IAttribute attribute) + { + return new ModifiableAttributeInstance(this, attribute); + } + + public void func_180794_a(IAttributeInstance instance) + { + if (instance.getAttribute().getShouldWatch()) + { + this.attributeInstanceSet.add(instance); + } + + for (IAttribute iattribute : this.field_180377_c.get(instance.getAttribute())) + { + ModifiableAttributeInstance modifiableattributeinstance = this.getAttributeInstance(iattribute); + + if (modifiableattributeinstance != null) + { + modifiableattributeinstance.flagForUpdate(); + } + } + } + + public Set getAttributeInstanceSet() + { + return this.attributeInstanceSet; + } + + public Collection getWatchedAttributes() + { + Set set = Sets.newHashSet(); + + for (IAttributeInstance iattributeinstance : this.getAllAttributes()) + { + if (iattributeinstance.getAttribute().getShouldWatch()) + { + set.add(iattributeinstance); + } + } + + return set; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/boss/BossStatus.java b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/BossStatus.java new file mode 100644 index 0000000..bf9963b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/BossStatus.java @@ -0,0 +1,17 @@ +package net.minecraft.entity.boss; + +public final class BossStatus +{ + public static float healthScale; + public static int statusBarTime; + public static String bossName; + public static boolean hasColorModifier; + + public static void setBossStatus(IBossDisplayData displayData, boolean hasColorModifierIn) + { + healthScale = displayData.getHealth() / displayData.getMaxHealth(); + statusBarTime = 100; + bossName = displayData.getDisplayName().getFormattedText(); + hasColorModifier = hasColorModifierIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityDragon.java b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityDragon.java new file mode 100644 index 0000000..a8f7add --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityDragon.java @@ -0,0 +1,694 @@ +package net.minecraft.entity.boss; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockTorch; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityDragon extends EntityLiving implements IBossDisplayData, IEntityMultiPart, IMob +{ + public double targetX; + public double targetY; + public double targetZ; + public double[][] ringBuffer = new double[64][3]; + public int ringBufferIndex = -1; + public EntityDragonPart[] dragonPartArray; + public EntityDragonPart dragonPartHead; + public EntityDragonPart dragonPartBody; + public EntityDragonPart dragonPartTail1; + public EntityDragonPart dragonPartTail2; + public EntityDragonPart dragonPartTail3; + public EntityDragonPart dragonPartWing1; + public EntityDragonPart dragonPartWing2; + public float prevAnimTime; + public float animTime; + public boolean forceNewTarget; + public boolean slowed; + private Entity target; + public int deathTicks; + public EntityEnderCrystal healingEnderCrystal; + + public EntityDragon(World worldIn) + { + super(worldIn); + this.dragonPartArray = new EntityDragonPart[] {this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)}; + this.setHealth(this.getMaxHealth()); + this.setSize(16.0F, 8.0F); + this.noClip = true; + this.isImmuneToFire = true; + this.targetY = 100.0D; + this.ignoreFrustumCheck = true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); + } + + protected void entityInit() + { + super.entityInit(); + } + + public double[] getMovementOffsets(int p_70974_1_, float p_70974_2_) + { + if (this.getHealth() <= 0.0F) + { + p_70974_2_ = 0.0F; + } + + p_70974_2_ = 1.0F - p_70974_2_; + int i = this.ringBufferIndex - p_70974_1_ * 1 & 63; + int j = this.ringBufferIndex - p_70974_1_ * 1 - 1 & 63; + double[] adouble = new double[3]; + double d0 = this.ringBuffer[i][0]; + double d1 = MathHelper.wrapAngleTo180_double(this.ringBuffer[j][0] - d0); + adouble[0] = d0 + d1 * (double)p_70974_2_; + d0 = this.ringBuffer[i][1]; + d1 = this.ringBuffer[j][1] - d0; + adouble[1] = d0 + d1 * (double)p_70974_2_; + adouble[2] = this.ringBuffer[i][2] + (this.ringBuffer[j][2] - this.ringBuffer[i][2]) * (double)p_70974_2_; + return adouble; + } + + public void onLivingUpdate() + { + if (this.worldObj.isRemote) + { + float f = MathHelper.cos(this.animTime * (float)Math.PI * 2.0F); + float f1 = MathHelper.cos(this.prevAnimTime * (float)Math.PI * 2.0F); + + if (f1 <= -0.3F && f >= -0.3F && !this.isSilent()) + { + this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false); + } + } + + this.prevAnimTime = this.animTime; + + if (this.getHealth() <= 0.0F) + { + float f11 = (this.rand.nextFloat() - 0.5F) * 8.0F; + float f13 = (this.rand.nextFloat() - 0.5F) * 4.0F; + float f14 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX + (double)f11, this.posY + 2.0D + (double)f13, this.posZ + (double)f14, 0.0D, 0.0D, 0.0D, new int[0]); + } + else + { + this.updateDragonEnderCrystal(); + float f10 = 0.2F / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F); + f10 = f10 * (float)Math.pow(2.0D, this.motionY); + + if (this.slowed) + { + this.animTime += f10 * 0.5F; + } + else + { + this.animTime += f10; + } + + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + + if (this.isAIDisabled()) + { + this.animTime = 0.5F; + } + else + { + if (this.ringBufferIndex < 0) + { + for (int i = 0; i < this.ringBuffer.length; ++i) + { + this.ringBuffer[i][0] = (double)this.rotationYaw; + this.ringBuffer[i][1] = this.posY; + } + } + + if (++this.ringBufferIndex == this.ringBuffer.length) + { + this.ringBufferIndex = 0; + } + + this.ringBuffer[this.ringBufferIndex][0] = (double)this.rotationYaw; + this.ringBuffer[this.ringBufferIndex][1] = this.posY; + + if (this.worldObj.isRemote) + { + if (this.newPosRotationIncrements > 0) + { + double d10 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + double d0 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + double d1 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; + double d2 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d2 / (double)this.newPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(d10, d0, d1); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } + else + { + double d11 = this.targetX - this.posX; + double d12 = this.targetY - this.posY; + double d13 = this.targetZ - this.posZ; + double d14 = d11 * d11 + d12 * d12 + d13 * d13; + + if (this.target != null) + { + this.targetX = this.target.posX; + this.targetZ = this.target.posZ; + double d3 = this.targetX - this.posX; + double d5 = this.targetZ - this.posZ; + double d7 = Math.sqrt(d3 * d3 + d5 * d5); + double d8 = 0.4000000059604645D + d7 / 80.0D - 1.0D; + + if (d8 > 10.0D) + { + d8 = 10.0D; + } + + this.targetY = this.target.getEntityBoundingBox().minY + d8; + } + else + { + this.targetX += this.rand.nextGaussian() * 2.0D; + this.targetZ += this.rand.nextGaussian() * 2.0D; + } + + if (this.forceNewTarget || d14 < 100.0D || d14 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) + { + this.setNewTarget(); + } + + d12 = d12 / (double)MathHelper.sqrt_double(d11 * d11 + d13 * d13); + float f17 = 0.6F; + d12 = MathHelper.clamp_double(d12, (double)(-f17), (double)f17); + this.motionY += d12 * 0.10000000149011612D; + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + double d4 = 180.0D - MathHelper.atan2(d11, d13) * 180.0D / Math.PI; + double d6 = MathHelper.wrapAngleTo180_double(d4 - (double)this.rotationYaw); + + if (d6 > 50.0D) + { + d6 = 50.0D; + } + + if (d6 < -50.0D) + { + d6 = -50.0D; + } + + Vec3 vec3 = (new Vec3(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ)).normalize(); + double d15 = (double)(-MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F)); + Vec3 vec31 = (new Vec3((double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F), this.motionY, d15)).normalize(); + float f5 = ((float)vec31.dotProduct(vec3) + 0.5F) / 1.5F; + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + this.randomYawVelocity *= 0.8F; + float f6 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F; + double d9 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D; + + if (d9 > 40.0D) + { + d9 = 40.0D; + } + + this.randomYawVelocity = (float)((double)this.randomYawVelocity + d6 * (0.699999988079071D / d9 / (double)f6)); + this.rotationYaw += this.randomYawVelocity * 0.1F; + float f7 = (float)(2.0D / (d9 + 1.0D)); + float f8 = 0.06F; + this.moveFlying(0.0F, -1.0F, f8 * (f5 * f7 + (1.0F - f7))); + + if (this.slowed) + { + this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D); + } + else + { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + Vec3 vec32 = (new Vec3(this.motionX, this.motionY, this.motionZ)).normalize(); + float f9 = ((float)vec32.dotProduct(vec31) + 1.0F) / 2.0F; + f9 = 0.8F + 0.15F * f9; + this.motionX *= (double)f9; + this.motionZ *= (double)f9; + this.motionY *= 0.9100000262260437D; + } + + this.renderYawOffset = this.rotationYaw; + this.dragonPartHead.width = this.dragonPartHead.height = 3.0F; + this.dragonPartTail1.width = this.dragonPartTail1.height = 2.0F; + this.dragonPartTail2.width = this.dragonPartTail2.height = 2.0F; + this.dragonPartTail3.width = this.dragonPartTail3.height = 2.0F; + this.dragonPartBody.height = 3.0F; + this.dragonPartBody.width = 5.0F; + this.dragonPartWing1.height = 2.0F; + this.dragonPartWing1.width = 4.0F; + this.dragonPartWing2.height = 3.0F; + this.dragonPartWing2.width = 4.0F; + float f12 = (float)(this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F / 180.0F * (float)Math.PI; + float f2 = MathHelper.cos(f12); + float f15 = -MathHelper.sin(f12); + float f3 = this.rotationYaw * (float)Math.PI / 180.0F; + float f16 = MathHelper.sin(f3); + float f4 = MathHelper.cos(f3); + this.dragonPartBody.onUpdate(); + this.dragonPartBody.setLocationAndAngles(this.posX + (double)(f16 * 0.5F), this.posY, this.posZ - (double)(f4 * 0.5F), 0.0F, 0.0F); + this.dragonPartWing1.onUpdate(); + this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(f4 * 4.5F), this.posY + 2.0D, this.posZ + (double)(f16 * 4.5F), 0.0F, 0.0F); + this.dragonPartWing2.onUpdate(); + this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(f4 * 4.5F), this.posY + 2.0D, this.posZ - (double)(f16 * 4.5F), 0.0F, 0.0F); + + if (!this.worldObj.isRemote && this.hurtTime == 0) + { + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.getEntityBoundingBox().expand(1.0D, 1.0D, 1.0D))); + } + + double[] adouble1 = this.getMovementOffsets(5, 1.0F); + double[] adouble = this.getMovementOffsets(0, 1.0F); + float f18 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F); + float f19 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F); + this.dragonPartHead.onUpdate(); + this.dragonPartHead.setLocationAndAngles(this.posX + (double)(f18 * 5.5F * f2), this.posY + (adouble[1] - adouble1[1]) * 1.0D + (double)(f15 * 5.5F), this.posZ - (double)(f19 * 5.5F * f2), 0.0F, 0.0F); + + for (int j = 0; j < 3; ++j) + { + EntityDragonPart entitydragonpart = null; + + if (j == 0) + { + entitydragonpart = this.dragonPartTail1; + } + + if (j == 1) + { + entitydragonpart = this.dragonPartTail2; + } + + if (j == 2) + { + entitydragonpart = this.dragonPartTail3; + } + + double[] adouble2 = this.getMovementOffsets(12 + j * 2, 1.0F); + float f20 = this.rotationYaw * (float)Math.PI / 180.0F + this.simplifyAngle(adouble2[0] - adouble1[0]) * (float)Math.PI / 180.0F * 1.0F; + float f21 = MathHelper.sin(f20); + float f22 = MathHelper.cos(f20); + float f23 = 1.5F; + float f24 = (float)(j + 1) * 2.0F; + entitydragonpart.onUpdate(); + entitydragonpart.setLocationAndAngles(this.posX - (double)((f16 * f23 + f21 * f24) * f2), this.posY + (adouble2[1] - adouble1[1]) * 1.0D - (double)((f24 + f23) * f15) + 1.5D, this.posZ + (double)((f4 * f23 + f22 * f24) * f2), 0.0F, 0.0F); + } + + if (!this.worldObj.isRemote) + { + this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.getEntityBoundingBox()) | this.destroyBlocksInAABB(this.dragonPartBody.getEntityBoundingBox()); + } + } + } + } + + private void updateDragonEnderCrystal() + { + if (this.healingEnderCrystal != null) + { + if (this.healingEnderCrystal.isDead) + { + if (!this.worldObj.isRemote) + { + this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion)null), 10.0F); + } + + this.healingEnderCrystal = null; + } + else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) + { + this.setHealth(this.getHealth() + 1.0F); + } + } + + if (this.rand.nextInt(10) == 0) + { + float f = 32.0F; + List list = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, this.getEntityBoundingBox().expand((double)f, (double)f, (double)f)); + EntityEnderCrystal entityendercrystal = null; + double d0 = Double.MAX_VALUE; + + for (EntityEnderCrystal entityendercrystal1 : list) + { + double d1 = entityendercrystal1.getDistanceSqToEntity(this); + + if (d1 < d0) + { + d0 = d1; + entityendercrystal = entityendercrystal1; + } + } + + this.healingEnderCrystal = entityendercrystal; + } + } + + private void collideWithEntities(List p_70970_1_) + { + double d0 = (this.dragonPartBody.getEntityBoundingBox().minX + this.dragonPartBody.getEntityBoundingBox().maxX) / 2.0D; + double d1 = (this.dragonPartBody.getEntityBoundingBox().minZ + this.dragonPartBody.getEntityBoundingBox().maxZ) / 2.0D; + + for (Entity entity : p_70970_1_) + { + if (entity instanceof EntityLivingBase) + { + double d2 = entity.posX - d0; + double d3 = entity.posZ - d1; + double d4 = d2 * d2 + d3 * d3; + entity.addVelocity(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D); + } + } + } + + private void attackEntitiesInList(List p_70971_1_) + { + for (int i = 0; i < p_70971_1_.size(); ++i) + { + Entity entity = (Entity)p_70971_1_.get(i); + + if (entity instanceof EntityLivingBase) + { + entity.attackEntityFrom(DamageSource.causeMobDamage(this), 10.0F); + this.applyEnchantments(this, entity); + } + } + } + + private void setNewTarget() + { + this.forceNewTarget = false; + List list = Lists.newArrayList(this.worldObj.playerEntities); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + if (((EntityPlayer)iterator.next()).isSpectator()) + { + iterator.remove(); + } + } + + if (this.rand.nextInt(2) == 0 && !list.isEmpty()) + { + this.target = (Entity)list.get(this.rand.nextInt(list.size())); + } + else + { + while (true) + { + this.targetX = 0.0D; + this.targetY = (double)(70.0F + this.rand.nextFloat() * 50.0F); + this.targetZ = 0.0D; + this.targetX += (double)(this.rand.nextFloat() * 120.0F - 60.0F); + this.targetZ += (double)(this.rand.nextFloat() * 120.0F - 60.0F); + double d0 = this.posX - this.targetX; + double d1 = this.posY - this.targetY; + double d2 = this.posZ - this.targetZ; + boolean flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D; + + if (flag) + { + break; + } + } + + this.target = null; + } + } + + private float simplifyAngle(double p_70973_1_) + { + return (float)MathHelper.wrapAngleTo180_double(p_70973_1_); + } + + private boolean destroyBlocksInAABB(AxisAlignedBB p_70972_1_) + { + int i = MathHelper.floor_double(p_70972_1_.minX); + int j = MathHelper.floor_double(p_70972_1_.minY); + int k = MathHelper.floor_double(p_70972_1_.minZ); + int l = MathHelper.floor_double(p_70972_1_.maxX); + int i1 = MathHelper.floor_double(p_70972_1_.maxY); + int j1 = MathHelper.floor_double(p_70972_1_.maxZ); + boolean flag = false; + boolean flag1 = false; + + for (int k1 = i; k1 <= l; ++k1) + { + for (int l1 = j; l1 <= i1; ++l1) + { + for (int i2 = k; i2 <= j1; ++i2) + { + BlockPos blockpos = new BlockPos(k1, l1, i2); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() != Material.air) + { + if (block != Blocks.barrier && block != Blocks.obsidian && block != Blocks.end_stone && block != Blocks.bedrock && block != Blocks.command_block && this.worldObj.getGameRules().getBoolean("mobGriefing")) + { + flag1 = this.worldObj.setBlockToAir(blockpos) || flag1; + } + else + { + flag = true; + } + } + } + } + } + + if (flag1) + { + double d0 = p_70972_1_.minX + (p_70972_1_.maxX - p_70972_1_.minX) * (double)this.rand.nextFloat(); + double d1 = p_70972_1_.minY + (p_70972_1_.maxY - p_70972_1_.minY) * (double)this.rand.nextFloat(); + double d2 = p_70972_1_.minZ + (p_70972_1_.maxZ - p_70972_1_.minZ) * (double)this.rand.nextFloat(); + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + return flag; + } + + public boolean attackEntityFromPart(EntityDragonPart dragonPart, DamageSource source, float p_70965_3_) + { + if (dragonPart != this.dragonPartHead) + { + p_70965_3_ = p_70965_3_ / 4.0F + 1.0F; + } + + float f = this.rotationYaw * (float)Math.PI / 180.0F; + float f1 = MathHelper.sin(f); + float f2 = MathHelper.cos(f); + this.targetX = this.posX + (double)(f1 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); + this.targetY = this.posY + (double)(this.rand.nextFloat() * 3.0F) + 1.0D; + this.targetZ = this.posZ - (double)(f2 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); + this.target = null; + + if (source.getEntity() instanceof EntityPlayer || source.isExplosion()) + { + this.attackDragonFrom(source, p_70965_3_); + } + + return true; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (source instanceof EntityDamageSource && ((EntityDamageSource)source).getIsThornsDamage()) + { + this.attackDragonFrom(source, amount); + } + + return false; + } + + protected boolean attackDragonFrom(DamageSource source, float amount) + { + return super.attackEntityFrom(source, amount); + } + + public void onKillCommand() + { + this.setDead(); + } + + protected void onDeathUpdate() + { + ++this.deathTicks; + + if (this.deathTicks >= 180 && this.deathTicks <= 200) + { + float f = (this.rand.nextFloat() - 0.5F) * 8.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 4.0F; + float f2 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.posX + (double)f, this.posY + 2.0D + (double)f1, this.posZ + (double)f2, 0.0D, 0.0D, 0.0D, new int[0]); + } + + boolean flag = this.worldObj.getGameRules().getBoolean("doMobLoot"); + + if (!this.worldObj.isRemote) + { + if (this.deathTicks > 150 && this.deathTicks % 5 == 0 && flag) + { + int i = 1000; + + while (i > 0) + { + int k = EntityXPOrb.getXPSplit(i); + i -= k; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, k)); + } + } + + if (this.deathTicks == 1) + { + this.worldObj.playBroadcastSound(1018, new BlockPos(this), 0); + } + } + + this.moveEntity(0.0D, 0.10000000149011612D, 0.0D); + this.renderYawOffset = this.rotationYaw += 20.0F; + + if (this.deathTicks == 200 && !this.worldObj.isRemote) + { + if (flag) + { + int j = 2000; + + while (j > 0) + { + int l = EntityXPOrb.getXPSplit(j); + j -= l; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, l)); + } + } + + this.generatePortal(new BlockPos(this.posX, 64.0D, this.posZ)); + this.setDead(); + } + } + + private void generatePortal(BlockPos pos) + { + int i = 4; + double d0 = 12.25D; + double d1 = 6.25D; + + for (int j = -1; j <= 32; ++j) + { + for (int k = -4; k <= 4; ++k) + { + for (int l = -4; l <= 4; ++l) + { + double d2 = (double)(k * k + l * l); + + if (d2 <= 12.25D) + { + BlockPos blockpos = pos.add(k, j, l); + + if (j < 0) + { + if (d2 <= 6.25D) + { + this.worldObj.setBlockState(blockpos, Blocks.bedrock.getDefaultState()); + } + } + else if (j > 0) + { + this.worldObj.setBlockState(blockpos, Blocks.air.getDefaultState()); + } + else if (d2 > 6.25D) + { + this.worldObj.setBlockState(blockpos, Blocks.bedrock.getDefaultState()); + } + else + { + this.worldObj.setBlockState(blockpos, Blocks.end_portal.getDefaultState()); + } + } + } + } + } + + this.worldObj.setBlockState(pos, Blocks.bedrock.getDefaultState()); + this.worldObj.setBlockState(pos.up(), Blocks.bedrock.getDefaultState()); + BlockPos blockpos1 = pos.up(2); + this.worldObj.setBlockState(blockpos1, Blocks.bedrock.getDefaultState()); + this.worldObj.setBlockState(blockpos1.west(), Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.EAST)); + this.worldObj.setBlockState(blockpos1.east(), Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.WEST)); + this.worldObj.setBlockState(blockpos1.north(), Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.SOUTH)); + this.worldObj.setBlockState(blockpos1.south(), Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.NORTH)); + this.worldObj.setBlockState(pos.up(3), Blocks.bedrock.getDefaultState()); + this.worldObj.setBlockState(pos.up(4), Blocks.dragon_egg.getDefaultState()); + } + + protected void despawnEntity() + { + } + + public Entity[] getParts() + { + return this.dragonPartArray; + } + + public boolean canBeCollidedWith() + { + return false; + } + + public World getWorld() + { + return this.worldObj; + } + + protected String getLivingSound() + { + return "mob.enderdragon.growl"; + } + + protected String getHurtSound() + { + return "mob.enderdragon.hit"; + } + + protected float getSoundVolume() + { + return 5.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java new file mode 100644 index 0000000..52e74d4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java @@ -0,0 +1,47 @@ +package net.minecraft.entity.boss; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; + +public class EntityDragonPart extends Entity +{ + public final IEntityMultiPart entityDragonObj; + public final String partName; + + public EntityDragonPart(IEntityMultiPart parent, String partName, float base, float sizeHeight) + { + super(parent.getWorld()); + this.setSize(base, sizeHeight); + this.entityDragonObj = parent; + this.partName = partName; + } + + protected void entityInit() + { + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + } + + public boolean canBeCollidedWith() + { + return true; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + return this.isEntityInvulnerable(source) ? false : this.entityDragonObj.attackEntityFromPart(this, source, amount); + } + + public boolean isEntityEqual(Entity entityIn) + { + return this == entityIn || this.entityDragonObj == entityIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityWither.java b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityWither.java new file mode 100644 index 0000000..df21010 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/EntityWither.java @@ -0,0 +1,608 @@ +package net.minecraft.entity.boss; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityWither extends EntityMob implements IBossDisplayData, IRangedAttackMob +{ + private float[] field_82220_d = new float[2]; + private float[] field_82221_e = new float[2]; + private float[] field_82217_f = new float[2]; + private float[] field_82218_g = new float[2]; + private int[] field_82223_h = new int[2]; + private int[] field_82224_i = new int[2]; + private int blockBreakCounter; + private static final Predicate attackEntitySelector = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ instanceof EntityLivingBase && ((EntityLivingBase)p_apply_1_).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; + } + }; + + public EntityWither(World worldIn) + { + super(worldIn); + this.setHealth(this.getMaxHealth()); + this.setSize(0.9F, 3.5F); + this.isImmuneToFire = true; + ((PathNavigateGround)this.getNavigator()).setCanSwim(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 40, 20.0F)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, attackEntitySelector)); + this.experienceValue = 50; + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(0)); + this.dataWatcher.addObject(19, new Integer(0)); + this.dataWatcher.addObject(20, new Integer(0)); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Invul", this.getInvulTime()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setInvulTime(tagCompund.getInteger("Invul")); + } + + protected String getLivingSound() + { + return "mob.wither.idle"; + } + + protected String getHurtSound() + { + return "mob.wither.hurt"; + } + + protected String getDeathSound() + { + return "mob.wither.death"; + } + + public void onLivingUpdate() + { + this.motionY *= 0.6000000238418579D; + + if (!this.worldObj.isRemote && this.getWatchedTargetId(0) > 0) + { + Entity entity = this.worldObj.getEntityByID(this.getWatchedTargetId(0)); + + if (entity != null) + { + if (this.posY < entity.posY || !this.isArmored() && this.posY < entity.posY + 5.0D) + { + if (this.motionY < 0.0D) + { + this.motionY = 0.0D; + } + + this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; + } + + double d0 = entity.posX - this.posX; + double d1 = entity.posZ - this.posZ; + double d3 = d0 * d0 + d1 * d1; + + if (d3 > 9.0D) + { + double d5 = (double)MathHelper.sqrt_double(d3); + this.motionX += (d0 / d5 * 0.5D - this.motionX) * 0.6000000238418579D; + this.motionZ += (d1 / d5 * 0.5D - this.motionZ) * 0.6000000238418579D; + } + } + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) + { + this.rotationYaw = (float)MathHelper.atan2(this.motionZ, this.motionX) * (180F / (float)Math.PI) - 90.0F; + } + + super.onLivingUpdate(); + + for (int i = 0; i < 2; ++i) + { + this.field_82218_g[i] = this.field_82221_e[i]; + this.field_82217_f[i] = this.field_82220_d[i]; + } + + for (int j = 0; j < 2; ++j) + { + int k = this.getWatchedTargetId(j + 1); + Entity entity1 = null; + + if (k > 0) + { + entity1 = this.worldObj.getEntityByID(k); + } + + if (entity1 != null) + { + double d11 = this.func_82214_u(j + 1); + double d12 = this.func_82208_v(j + 1); + double d13 = this.func_82213_w(j + 1); + double d6 = entity1.posX - d11; + double d7 = entity1.posY + (double)entity1.getEyeHeight() - d12; + double d8 = entity1.posZ - d13; + double d9 = (double)MathHelper.sqrt_double(d6 * d6 + d8 * d8); + float f = (float)(MathHelper.atan2(d8, d6) * 180.0D / Math.PI) - 90.0F; + float f1 = (float)(-(MathHelper.atan2(d7, d9) * 180.0D / Math.PI)); + this.field_82220_d[j] = this.func_82204_b(this.field_82220_d[j], f1, 40.0F); + this.field_82221_e[j] = this.func_82204_b(this.field_82221_e[j], f, 10.0F); + } + else + { + this.field_82221_e[j] = this.func_82204_b(this.field_82221_e[j], this.renderYawOffset, 10.0F); + } + } + + boolean flag = this.isArmored(); + + for (int l = 0; l < 3; ++l) + { + double d10 = this.func_82214_u(l); + double d2 = this.func_82208_v(l); + double d4 = this.func_82213_w(l); + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D, new int[0]); + + if (flag && this.worldObj.rand.nextInt(4) == 0) + { + this.worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB, d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D, new int[0]); + } + } + + if (this.getInvulTime() > 0) + { + for (int i1 = 0; i1 < 3; ++i1) + { + this.worldObj.spawnParticle(EnumParticleTypes.SPELL_MOB, this.posX + this.rand.nextGaussian() * 1.0D, this.posY + (double)(this.rand.nextFloat() * 3.3F), this.posZ + this.rand.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D, new int[0]); + } + } + } + + protected void updateAITasks() + { + if (this.getInvulTime() > 0) + { + int j1 = this.getInvulTime() - 1; + + if (j1 <= 0) + { + this.worldObj.newExplosion(this, this.posX, this.posY + (double)this.getEyeHeight(), this.posZ, 7.0F, false, this.worldObj.getGameRules().getBoolean("mobGriefing")); + this.worldObj.playBroadcastSound(1013, new BlockPos(this), 0); + } + + this.setInvulTime(j1); + + if (this.ticksExisted % 10 == 0) + { + this.heal(10.0F); + } + } + else + { + super.updateAITasks(); + + for (int i = 1; i < 3; ++i) + { + if (this.ticksExisted >= this.field_82223_h[i - 1]) + { + this.field_82223_h[i - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); + + if (this.worldObj.getDifficulty() == EnumDifficulty.NORMAL || this.worldObj.getDifficulty() == EnumDifficulty.HARD) + { + int j3 = i - 1; + int k3 = this.field_82224_i[i - 1]; + this.field_82224_i[j3] = this.field_82224_i[i - 1] + 1; + + if (k3 > 15) + { + float f = 10.0F; + float f1 = 5.0F; + double d0 = MathHelper.getRandomDoubleInRange(this.rand, this.posX - (double)f, this.posX + (double)f); + double d1 = MathHelper.getRandomDoubleInRange(this.rand, this.posY - (double)f1, this.posY + (double)f1); + double d2 = MathHelper.getRandomDoubleInRange(this.rand, this.posZ - (double)f, this.posZ + (double)f); + this.launchWitherSkullToCoords(i + 1, d0, d1, d2, true); + this.field_82224_i[i - 1] = 0; + } + } + + int k1 = this.getWatchedTargetId(i); + + if (k1 > 0) + { + Entity entity = this.worldObj.getEntityByID(k1); + + if (entity != null && entity.isEntityAlive() && this.getDistanceSqToEntity(entity) <= 900.0D && this.canEntityBeSeen(entity)) + { + if (entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.disableDamage) + { + this.updateWatchedTargetId(i, 0); + } + else + { + this.launchWitherSkullToEntity(i + 1, (EntityLivingBase)entity); + this.field_82223_h[i - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); + this.field_82224_i[i - 1] = 0; + } + } + else + { + this.updateWatchedTargetId(i, 0); + } + } + else + { + List list = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.getEntityBoundingBox().expand(20.0D, 8.0D, 20.0D), Predicates. and (attackEntitySelector, EntitySelectors.NOT_SPECTATING)); + + for (int j2 = 0; j2 < 10 && !list.isEmpty(); ++j2) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(this.rand.nextInt(list.size())); + + if (entitylivingbase != this && entitylivingbase.isEntityAlive() && this.canEntityBeSeen(entitylivingbase)) + { + if (entitylivingbase instanceof EntityPlayer) + { + if (!((EntityPlayer)entitylivingbase).capabilities.disableDamage) + { + this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); + } + } + else + { + this.updateWatchedTargetId(i, entitylivingbase.getEntityId()); + } + + break; + } + + list.remove(entitylivingbase); + } + } + } + } + + if (this.getAttackTarget() != null) + { + this.updateWatchedTargetId(0, this.getAttackTarget().getEntityId()); + } + else + { + this.updateWatchedTargetId(0, 0); + } + + if (this.blockBreakCounter > 0) + { + --this.blockBreakCounter; + + if (this.blockBreakCounter == 0 && this.worldObj.getGameRules().getBoolean("mobGriefing")) + { + int i1 = MathHelper.floor_double(this.posY); + int l1 = MathHelper.floor_double(this.posX); + int i2 = MathHelper.floor_double(this.posZ); + boolean flag = false; + + for (int k2 = -1; k2 <= 1; ++k2) + { + for (int l2 = -1; l2 <= 1; ++l2) + { + for (int j = 0; j <= 3; ++j) + { + int i3 = l1 + k2; + int k = i1 + j; + int l = i2 + l2; + BlockPos blockpos = new BlockPos(i3, k, l); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() != Material.air && canDestroyBlock(block)) + { + flag = this.worldObj.destroyBlock(blockpos, true) || flag; + } + } + } + } + + if (flag) + { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1012, new BlockPos(this), 0); + } + } + } + + if (this.ticksExisted % 20 == 0) + { + this.heal(1.0F); + } + } + } + + public static boolean canDestroyBlock(Block p_181033_0_) + { + return p_181033_0_ != Blocks.bedrock && p_181033_0_ != Blocks.end_portal && p_181033_0_ != Blocks.end_portal_frame && p_181033_0_ != Blocks.command_block && p_181033_0_ != Blocks.barrier; + } + + public void func_82206_m() + { + this.setInvulTime(220); + this.setHealth(this.getMaxHealth() / 3.0F); + } + + public void setInWeb() + { + } + + public int getTotalArmorValue() + { + return 4; + } + + private double func_82214_u(int p_82214_1_) + { + if (p_82214_1_ <= 0) + { + return this.posX; + } + else + { + float f = (this.renderYawOffset + (float)(180 * (p_82214_1_ - 1))) / 180.0F * (float)Math.PI; + float f1 = MathHelper.cos(f); + return this.posX + (double)f1 * 1.3D; + } + } + + private double func_82208_v(int p_82208_1_) + { + return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D; + } + + private double func_82213_w(int p_82213_1_) + { + if (p_82213_1_ <= 0) + { + return this.posZ; + } + else + { + float f = (this.renderYawOffset + (float)(180 * (p_82213_1_ - 1))) / 180.0F * (float)Math.PI; + float f1 = MathHelper.sin(f); + return this.posZ + (double)f1 * 1.3D; + } + } + + private float func_82204_b(float p_82204_1_, float p_82204_2_, float p_82204_3_) + { + float f = MathHelper.wrapAngleTo180_float(p_82204_2_ - p_82204_1_); + + if (f > p_82204_3_) + { + f = p_82204_3_; + } + + if (f < -p_82204_3_) + { + f = -p_82204_3_; + } + + return p_82204_1_ + f; + } + + private void launchWitherSkullToEntity(int p_82216_1_, EntityLivingBase p_82216_2_) + { + this.launchWitherSkullToCoords(p_82216_1_, p_82216_2_.posX, p_82216_2_.posY + (double)p_82216_2_.getEyeHeight() * 0.5D, p_82216_2_.posZ, p_82216_1_ == 0 && this.rand.nextFloat() < 0.001F); + } + + private void launchWitherSkullToCoords(int p_82209_1_, double x, double y, double z, boolean invulnerable) + { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1014, new BlockPos(this), 0); + double d0 = this.func_82214_u(p_82209_1_); + double d1 = this.func_82208_v(p_82209_1_); + double d2 = this.func_82213_w(p_82209_1_); + double d3 = x - d0; + double d4 = y - d1; + double d5 = z - d2; + EntityWitherSkull entitywitherskull = new EntityWitherSkull(this.worldObj, this, d3, d4, d5); + + if (invulnerable) + { + entitywitherskull.setInvulnerable(true); + } + + entitywitherskull.posY = d1; + entitywitherskull.posX = d0; + entitywitherskull.posZ = d2; + this.worldObj.spawnEntityInWorld(entitywitherskull); + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float p_82196_2_) + { + this.launchWitherSkullToEntity(0, target); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (source != DamageSource.drown && !(source.getEntity() instanceof EntityWither)) + { + if (this.getInvulTime() > 0 && source != DamageSource.outOfWorld) + { + return false; + } + else + { + if (this.isArmored()) + { + Entity entity = source.getSourceOfDamage(); + + if (entity instanceof EntityArrow) + { + return false; + } + } + + Entity entity1 = source.getEntity(); + + if (entity1 != null && !(entity1 instanceof EntityPlayer) && entity1 instanceof EntityLivingBase && ((EntityLivingBase)entity1).getCreatureAttribute() == this.getCreatureAttribute()) + { + return false; + } + else + { + if (this.blockBreakCounter <= 0) + { + this.blockBreakCounter = 20; + } + + for (int i = 0; i < this.field_82224_i.length; ++i) + { + this.field_82224_i[i] += 3; + } + + return super.attackEntityFrom(source, amount); + } + } + } + else + { + return false; + } + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + EntityItem entityitem = this.dropItem(Items.nether_star, 1); + + if (entityitem != null) + { + entityitem.setNoDespawn(); + } + + if (!this.worldObj.isRemote) + { + for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.getEntityBoundingBox().expand(50.0D, 100.0D, 50.0D))) + { + entityplayer.triggerAchievement(AchievementList.killWither); + } + } + } + + protected void despawnEntity() + { + this.entityAge = 0; + } + + public int getBrightnessForRender(float partialTicks) + { + return 15728880; + } + + public void fall(float distance, float damageMultiplier) + { + } + + public void addPotionEffect(PotionEffect potioneffectIn) + { + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(300.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + } + + public float func_82207_a(int p_82207_1_) + { + return this.field_82221_e[p_82207_1_]; + } + + public float func_82210_r(int p_82210_1_) + { + return this.field_82220_d[p_82210_1_]; + } + + public int getInvulTime() + { + return this.dataWatcher.getWatchableObjectInt(20); + } + + public void setInvulTime(int p_82215_1_) + { + this.dataWatcher.updateObject(20, Integer.valueOf(p_82215_1_)); + } + + public int getWatchedTargetId(int p_82203_1_) + { + return this.dataWatcher.getWatchableObjectInt(17 + p_82203_1_); + } + + public void updateWatchedTargetId(int targetOffset, int newId) + { + this.dataWatcher.updateObject(17 + targetOffset, Integer.valueOf(newId)); + } + + public boolean isArmored() + { + return this.getHealth() <= this.getMaxHealth() / 2.0F; + } + + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEAD; + } + + public void mountEntity(Entity entityIn) + { + this.ridingEntity = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java new file mode 100644 index 0000000..a944218 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java @@ -0,0 +1,12 @@ +package net.minecraft.entity.boss; + +import net.minecraft.util.IChatComponent; + +public interface IBossDisplayData +{ + float getMaxHealth(); + + float getHealth(); + + IChatComponent getDisplayName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java b/Client-1.8.9/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java new file mode 100644 index 0000000..65b4703 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java @@ -0,0 +1,110 @@ +package net.minecraft.entity.effect; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityLightningBolt extends EntityWeatherEffect +{ + private int lightningState; + public long boltVertex; + private int boltLivingTime; + + public EntityLightningBolt(World worldIn, double posX, double posY, double posZ) + { + super(worldIn); + this.setLocationAndAngles(posX, posY, posZ, 0.0F, 0.0F); + this.lightningState = 2; + this.boltVertex = this.rand.nextLong(); + this.boltLivingTime = this.rand.nextInt(3) + 1; + BlockPos blockpos = new BlockPos(this); + + if (!worldIn.isRemote && worldIn.getGameRules().getBoolean("doFireTick") && (worldIn.getDifficulty() == EnumDifficulty.NORMAL || worldIn.getDifficulty() == EnumDifficulty.HARD) && worldIn.isAreaLoaded(blockpos, 10)) + { + if (worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(worldIn, blockpos)) + { + worldIn.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + + for (int i = 0; i < 4; ++i) + { + BlockPos blockpos1 = blockpos.add(this.rand.nextInt(3) - 1, this.rand.nextInt(3) - 1, this.rand.nextInt(3) - 1); + + if (worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(worldIn, blockpos1)) + { + worldIn.setBlockState(blockpos1, Blocks.fire.getDefaultState()); + } + } + } + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.lightningState == 2) + { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.rand.nextFloat() * 0.2F); + } + + --this.lightningState; + + if (this.lightningState < 0) + { + if (this.boltLivingTime == 0) + { + this.setDead(); + } + else if (this.lightningState < -this.rand.nextInt(10)) + { + --this.boltLivingTime; + this.lightningState = 1; + this.boltVertex = this.rand.nextLong(); + BlockPos blockpos = new BlockPos(this); + + if (!this.worldObj.isRemote && this.worldObj.getGameRules().getBoolean("doFireTick") && this.worldObj.isAreaLoaded(blockpos, 10) && this.worldObj.getBlockState(blockpos).getBlock().getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(this.worldObj, blockpos)) + { + this.worldObj.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + } + } + + if (this.lightningState >= 0) + { + if (this.worldObj.isRemote) + { + this.worldObj.setLastLightningBolt(2); + } + else + { + double d0 = 3.0D; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, new AxisAlignedBB(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0)); + + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + entity.onStruckByLightning(this); + } + } + } + } + + protected void entityInit() + { + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java b/Client-1.8.9/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java new file mode 100644 index 0000000..80a9b0b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java @@ -0,0 +1,12 @@ +package net.minecraft.entity.effect; + +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public abstract class EntityWeatherEffect extends Entity +{ + public EntityWeatherEffect(World worldIn) + { + super(worldIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityArmorStand.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityArmorStand.java new file mode 100644 index 0000000..1ed2be3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityArmorStand.java @@ -0,0 +1,929 @@ +package net.minecraft.entity.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.Rotations; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class EntityArmorStand extends EntityLivingBase +{ + private static final Rotations DEFAULT_HEAD_ROTATION = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_BODY_ROTATION = new Rotations(0.0F, 0.0F, 0.0F); + private static final Rotations DEFAULT_LEFTARM_ROTATION = new Rotations(-10.0F, 0.0F, -10.0F); + private static final Rotations DEFAULT_RIGHTARM_ROTATION = new Rotations(-15.0F, 0.0F, 10.0F); + private static final Rotations DEFAULT_LEFTLEG_ROTATION = new Rotations(-1.0F, 0.0F, -1.0F); + private static final Rotations DEFAULT_RIGHTLEG_ROTATION = new Rotations(1.0F, 0.0F, 1.0F); + private final ItemStack[] contents; + private boolean canInteract; + private long punchCooldown; + private int disabledSlots; + private boolean field_181028_bj; + private Rotations headRotation; + private Rotations bodyRotation; + private Rotations leftArmRotation; + private Rotations rightArmRotation; + private Rotations leftLegRotation; + private Rotations rightLegRotation; + + public EntityArmorStand(World worldIn) + { + super(worldIn); + this.contents = new ItemStack[5]; + this.headRotation = DEFAULT_HEAD_ROTATION; + this.bodyRotation = DEFAULT_BODY_ROTATION; + this.leftArmRotation = DEFAULT_LEFTARM_ROTATION; + this.rightArmRotation = DEFAULT_RIGHTARM_ROTATION; + this.leftLegRotation = DEFAULT_LEFTLEG_ROTATION; + this.rightLegRotation = DEFAULT_RIGHTLEG_ROTATION; + this.setSilent(true); + this.noClip = this.hasNoGravity(); + this.setSize(0.5F, 1.975F); + } + + public EntityArmorStand(World worldIn, double posX, double posY, double posZ) + { + this(worldIn); + this.setPosition(posX, posY, posZ); + } + + public boolean isServerWorld() + { + return super.isServerWorld() && !this.hasNoGravity(); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(10, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(11, DEFAULT_HEAD_ROTATION); + this.dataWatcher.addObject(12, DEFAULT_BODY_ROTATION); + this.dataWatcher.addObject(13, DEFAULT_LEFTARM_ROTATION); + this.dataWatcher.addObject(14, DEFAULT_RIGHTARM_ROTATION); + this.dataWatcher.addObject(15, DEFAULT_LEFTLEG_ROTATION); + this.dataWatcher.addObject(16, DEFAULT_RIGHTLEG_ROTATION); + } + + public ItemStack getHeldItem() + { + return this.contents[0]; + } + + public ItemStack getEquipmentInSlot(int slotIn) + { + return this.contents[slotIn]; + } + + public ItemStack getCurrentArmor(int slotIn) + { + return this.contents[slotIn + 1]; + } + + public void setCurrentItemOrArmor(int slotIn, ItemStack stack) + { + this.contents[slotIn] = stack; + } + + public ItemStack[] getInventory() + { + return this.contents; + } + + public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn) + { + int i; + + if (inventorySlot == 99) + { + i = 0; + } + else + { + i = inventorySlot - 100 + 1; + + if (i < 0 || i >= this.contents.length) + { + return false; + } + } + + if (itemStackIn != null && EntityLiving.getArmorPosition(itemStackIn) != i && (i != 4 || !(itemStackIn.getItem() instanceof ItemBlock))) + { + return false; + } + else + { + this.setCurrentItemOrArmor(i, itemStackIn); + return true; + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.contents.length; ++i) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + if (this.contents[i] != null) + { + this.contents[i].writeToNBT(nbttagcompound); + } + + nbttaglist.appendTag(nbttagcompound); + } + + tagCompound.setTag("Equipment", nbttaglist); + + if (this.getAlwaysRenderNameTag() && (this.getCustomNameTag() == null || this.getCustomNameTag().length() == 0)) + { + tagCompound.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); + } + + tagCompound.setBoolean("Invisible", this.isInvisible()); + tagCompound.setBoolean("Small", this.isSmall()); + tagCompound.setBoolean("ShowArms", this.getShowArms()); + tagCompound.setInteger("DisabledSlots", this.disabledSlots); + tagCompound.setBoolean("NoGravity", this.hasNoGravity()); + tagCompound.setBoolean("NoBasePlate", this.hasNoBasePlate()); + + if (this.hasMarker()) + { + tagCompound.setBoolean("Marker", this.hasMarker()); + } + + tagCompound.setTag("Pose", this.readPoseFromNBT()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("Equipment", 9)) + { + NBTTagList nbttaglist = tagCompund.getTagList("Equipment", 10); + + for (int i = 0; i < this.contents.length; ++i) + { + this.contents[i] = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); + } + } + + this.setInvisible(tagCompund.getBoolean("Invisible")); + this.setSmall(tagCompund.getBoolean("Small")); + this.setShowArms(tagCompund.getBoolean("ShowArms")); + this.disabledSlots = tagCompund.getInteger("DisabledSlots"); + this.setNoGravity(tagCompund.getBoolean("NoGravity")); + this.setNoBasePlate(tagCompund.getBoolean("NoBasePlate")); + this.setMarker(tagCompund.getBoolean("Marker")); + this.field_181028_bj = !this.hasMarker(); + this.noClip = this.hasNoGravity(); + NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("Pose"); + this.writePoseToNBT(nbttagcompound); + } + + private void writePoseToNBT(NBTTagCompound tagCompound) + { + NBTTagList nbttaglist = tagCompound.getTagList("Head", 5); + + if (nbttaglist.tagCount() > 0) + { + this.setHeadRotation(new Rotations(nbttaglist)); + } + else + { + this.setHeadRotation(DEFAULT_HEAD_ROTATION); + } + + NBTTagList nbttaglist1 = tagCompound.getTagList("Body", 5); + + if (nbttaglist1.tagCount() > 0) + { + this.setBodyRotation(new Rotations(nbttaglist1)); + } + else + { + this.setBodyRotation(DEFAULT_BODY_ROTATION); + } + + NBTTagList nbttaglist2 = tagCompound.getTagList("LeftArm", 5); + + if (nbttaglist2.tagCount() > 0) + { + this.setLeftArmRotation(new Rotations(nbttaglist2)); + } + else + { + this.setLeftArmRotation(DEFAULT_LEFTARM_ROTATION); + } + + NBTTagList nbttaglist3 = tagCompound.getTagList("RightArm", 5); + + if (nbttaglist3.tagCount() > 0) + { + this.setRightArmRotation(new Rotations(nbttaglist3)); + } + else + { + this.setRightArmRotation(DEFAULT_RIGHTARM_ROTATION); + } + + NBTTagList nbttaglist4 = tagCompound.getTagList("LeftLeg", 5); + + if (nbttaglist4.tagCount() > 0) + { + this.setLeftLegRotation(new Rotations(nbttaglist4)); + } + else + { + this.setLeftLegRotation(DEFAULT_LEFTLEG_ROTATION); + } + + NBTTagList nbttaglist5 = tagCompound.getTagList("RightLeg", 5); + + if (nbttaglist5.tagCount() > 0) + { + this.setRightLegRotation(new Rotations(nbttaglist5)); + } + else + { + this.setRightLegRotation(DEFAULT_RIGHTLEG_ROTATION); + } + } + + private NBTTagCompound readPoseFromNBT() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + if (!DEFAULT_HEAD_ROTATION.equals(this.headRotation)) + { + nbttagcompound.setTag("Head", this.headRotation.writeToNBT()); + } + + if (!DEFAULT_BODY_ROTATION.equals(this.bodyRotation)) + { + nbttagcompound.setTag("Body", this.bodyRotation.writeToNBT()); + } + + if (!DEFAULT_LEFTARM_ROTATION.equals(this.leftArmRotation)) + { + nbttagcompound.setTag("LeftArm", this.leftArmRotation.writeToNBT()); + } + + if (!DEFAULT_RIGHTARM_ROTATION.equals(this.rightArmRotation)) + { + nbttagcompound.setTag("RightArm", this.rightArmRotation.writeToNBT()); + } + + if (!DEFAULT_LEFTLEG_ROTATION.equals(this.leftLegRotation)) + { + nbttagcompound.setTag("LeftLeg", this.leftLegRotation.writeToNBT()); + } + + if (!DEFAULT_RIGHTLEG_ROTATION.equals(this.rightLegRotation)) + { + nbttagcompound.setTag("RightLeg", this.rightLegRotation.writeToNBT()); + } + + return nbttagcompound; + } + + public boolean canBePushed() + { + return false; + } + + protected void collideWithEntity(Entity entityIn) + { + } + + protected void collideWithNearbyEntities() + { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()); + + if (list != null && !list.isEmpty()) + { + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (entity instanceof EntityMinecart && ((EntityMinecart)entity).getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE && this.getDistanceSqToEntity(entity) <= 0.2D) + { + entity.applyEntityCollision(this); + } + } + } + } + + public boolean interactAt(EntityPlayer player, Vec3 targetVec3) + { + if (this.hasMarker()) + { + return false; + } + else if (!this.worldObj.isRemote && !player.isSpectator()) + { + int i = 0; + ItemStack itemstack = player.getCurrentEquippedItem(); + boolean flag = itemstack != null; + + if (flag && itemstack.getItem() instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); + + if (itemarmor.armorType == 3) + { + i = 1; + } + else if (itemarmor.armorType == 2) + { + i = 2; + } + else if (itemarmor.armorType == 1) + { + i = 3; + } + else if (itemarmor.armorType == 0) + { + i = 4; + } + } + + if (flag && (itemstack.getItem() == Items.skull || itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))) + { + i = 4; + } + + double d4 = 0.1D; + double d0 = 0.9D; + double d1 = 0.4D; + double d2 = 1.6D; + int j = 0; + boolean flag1 = this.isSmall(); + double d3 = flag1 ? targetVec3.yCoord * 2.0D : targetVec3.yCoord; + + if (d3 >= 0.1D && d3 < 0.1D + (flag1 ? 0.8D : 0.45D) && this.contents[1] != null) + { + j = 1; + } + else if (d3 >= 0.9D + (flag1 ? 0.3D : 0.0D) && d3 < 0.9D + (flag1 ? 1.0D : 0.7D) && this.contents[3] != null) + { + j = 3; + } + else if (d3 >= 0.4D && d3 < 0.4D + (flag1 ? 1.0D : 0.8D) && this.contents[2] != null) + { + j = 2; + } + else if (d3 >= 1.6D && this.contents[4] != null) + { + j = 4; + } + + boolean flag2 = this.contents[j] != null; + + if ((this.disabledSlots & 1 << j) != 0 || (this.disabledSlots & 1 << i) != 0) + { + j = i; + + if ((this.disabledSlots & 1 << i) != 0) + { + if ((this.disabledSlots & 1) != 0) + { + return true; + } + + j = 0; + } + } + + if (flag && i == 0 && !this.getShowArms()) + { + return true; + } + else + { + if (flag) + { + this.func_175422_a(player, i); + } + else if (flag2) + { + this.func_175422_a(player, j); + } + + return true; + } + } + else + { + return true; + } + } + + private void func_175422_a(EntityPlayer p_175422_1_, int p_175422_2_) + { + ItemStack itemstack = this.contents[p_175422_2_]; + + if (itemstack == null || (this.disabledSlots & 1 << p_175422_2_ + 8) == 0) + { + if (itemstack != null || (this.disabledSlots & 1 << p_175422_2_ + 16) == 0) + { + int i = p_175422_1_.inventory.currentItem; + ItemStack itemstack1 = p_175422_1_.inventory.getStackInSlot(i); + + if (p_175422_1_.capabilities.isCreativeMode && (itemstack == null || itemstack.getItem() == Item.getItemFromBlock(Blocks.air)) && itemstack1 != null) + { + ItemStack itemstack3 = itemstack1.copy(); + itemstack3.stackSize = 1; + this.setCurrentItemOrArmor(p_175422_2_, itemstack3); + } + else if (itemstack1 != null && itemstack1.stackSize > 1) + { + if (itemstack == null) + { + ItemStack itemstack2 = itemstack1.copy(); + itemstack2.stackSize = 1; + this.setCurrentItemOrArmor(p_175422_2_, itemstack2); + --itemstack1.stackSize; + } + } + else + { + this.setCurrentItemOrArmor(p_175422_2_, itemstack1); + p_175422_1_.inventory.setInventorySlotContents(i, itemstack); + } + } + } + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.worldObj.isRemote) + { + return false; + } + else if (DamageSource.outOfWorld.equals(source)) + { + this.setDead(); + return false; + } + else if (!this.isEntityInvulnerable(source) && !this.canInteract && !this.hasMarker()) + { + if (source.isExplosion()) + { + this.dropContents(); + this.setDead(); + return false; + } + else if (DamageSource.inFire.equals(source)) + { + if (!this.isBurning()) + { + this.setFire(5); + } + else + { + this.damageArmorStand(0.15F); + } + + return false; + } + else if (DamageSource.onFire.equals(source) && this.getHealth() > 0.5F) + { + this.damageArmorStand(4.0F); + return false; + } + else + { + boolean flag = "arrow".equals(source.getDamageType()); + boolean flag1 = "player".equals(source.getDamageType()); + + if (!flag1 && !flag) + { + return false; + } + else + { + if (source.getSourceOfDamage() instanceof EntityArrow) + { + source.getSourceOfDamage().setDead(); + } + + if (source.getEntity() instanceof EntityPlayer && !((EntityPlayer)source.getEntity()).capabilities.allowEdit) + { + return false; + } + else if (source.isCreativePlayer()) + { + this.playParticles(); + this.setDead(); + return false; + } + else + { + long i = this.worldObj.getTotalWorldTime(); + + if (i - this.punchCooldown > 5L && !flag) + { + this.punchCooldown = i; + } + else + { + this.dropBlock(); + this.playParticles(); + this.setDead(); + } + + return false; + } + } + } + } + else + { + return false; + } + } + + public boolean isInRangeToRenderDist(double distance) + { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + + if (Double.isNaN(d0) || d0 == 0.0D) + { + d0 = 4.0D; + } + + d0 = d0 * 64.0D; + return distance < d0 * d0; + } + + private void playParticles() + { + if (this.worldObj instanceof WorldServer) + { + ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, this.posY + (double)this.height / 1.5D, this.posZ, 10, (double)(this.width / 4.0F), (double)(this.height / 4.0F), (double)(this.width / 4.0F), 0.05D, new int[] {Block.getStateId(Blocks.planks.getDefaultState())}); + } + } + + private void damageArmorStand(float p_175406_1_) + { + float f = this.getHealth(); + f = f - p_175406_1_; + + if (f <= 0.5F) + { + this.dropContents(); + this.setDead(); + } + else + { + this.setHealth(f); + } + } + + private void dropBlock() + { + Block.spawnAsEntity(this.worldObj, new BlockPos(this), new ItemStack(Items.armor_stand)); + this.dropContents(); + } + + private void dropContents() + { + for (int i = 0; i < this.contents.length; ++i) + { + if (this.contents[i] != null && this.contents[i].stackSize > 0) + { + if (this.contents[i] != null) + { + Block.spawnAsEntity(this.worldObj, (new BlockPos(this)).up(), this.contents[i]); + } + + this.contents[i] = null; + } + } + } + + protected float updateDistance(float p_110146_1_, float p_110146_2_) + { + this.prevRenderYawOffset = this.prevRotationYaw; + this.renderYawOffset = this.rotationYaw; + return 0.0F; + } + + public float getEyeHeight() + { + return this.isChild() ? this.height * 0.5F : this.height * 0.9F; + } + + public void moveEntityWithHeading(float strafe, float forward) + { + if (!this.hasNoGravity()) + { + super.moveEntityWithHeading(strafe, forward); + } + } + + public void onUpdate() + { + super.onUpdate(); + Rotations rotations = this.dataWatcher.getWatchableObjectRotations(11); + + if (!this.headRotation.equals(rotations)) + { + this.setHeadRotation(rotations); + } + + Rotations rotations1 = this.dataWatcher.getWatchableObjectRotations(12); + + if (!this.bodyRotation.equals(rotations1)) + { + this.setBodyRotation(rotations1); + } + + Rotations rotations2 = this.dataWatcher.getWatchableObjectRotations(13); + + if (!this.leftArmRotation.equals(rotations2)) + { + this.setLeftArmRotation(rotations2); + } + + Rotations rotations3 = this.dataWatcher.getWatchableObjectRotations(14); + + if (!this.rightArmRotation.equals(rotations3)) + { + this.setRightArmRotation(rotations3); + } + + Rotations rotations4 = this.dataWatcher.getWatchableObjectRotations(15); + + if (!this.leftLegRotation.equals(rotations4)) + { + this.setLeftLegRotation(rotations4); + } + + Rotations rotations5 = this.dataWatcher.getWatchableObjectRotations(16); + + if (!this.rightLegRotation.equals(rotations5)) + { + this.setRightLegRotation(rotations5); + } + + boolean flag = this.hasMarker(); + + if (!this.field_181028_bj && flag) + { + this.func_181550_a(false); + } + else + { + if (!this.field_181028_bj || flag) + { + return; + } + + this.func_181550_a(true); + } + + this.field_181028_bj = flag; + } + + private void func_181550_a(boolean p_181550_1_) + { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + + if (p_181550_1_) + { + this.setSize(0.5F, 1.975F); + } + else + { + this.setSize(0.0F, 0.0F); + } + + this.setPosition(d0, d1, d2); + } + + protected void updatePotionMetadata() + { + this.setInvisible(this.canInteract); + } + + public void setInvisible(boolean invisible) + { + this.canInteract = invisible; + super.setInvisible(invisible); + } + + public boolean isChild() + { + return this.isSmall(); + } + + public void onKillCommand() + { + this.setDead(); + } + + public boolean isImmuneToExplosions() + { + return this.isInvisible(); + } + + private void setSmall(boolean p_175420_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + + if (p_175420_1_) + { + b0 = (byte)(b0 | 1); + } + else + { + b0 = (byte)(b0 & -2); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean isSmall() + { + return (this.dataWatcher.getWatchableObjectByte(10) & 1) != 0; + } + + private void setNoGravity(boolean p_175425_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + + if (p_175425_1_) + { + b0 = (byte)(b0 | 2); + } + else + { + b0 = (byte)(b0 & -3); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean hasNoGravity() + { + return (this.dataWatcher.getWatchableObjectByte(10) & 2) != 0; + } + + private void setShowArms(boolean p_175413_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + + if (p_175413_1_) + { + b0 = (byte)(b0 | 4); + } + else + { + b0 = (byte)(b0 & -5); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean getShowArms() + { + return (this.dataWatcher.getWatchableObjectByte(10) & 4) != 0; + } + + private void setNoBasePlate(boolean p_175426_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + + if (p_175426_1_) + { + b0 = (byte)(b0 | 8); + } + else + { + b0 = (byte)(b0 & -9); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean hasNoBasePlate() + { + return (this.dataWatcher.getWatchableObjectByte(10) & 8) != 0; + } + + private void setMarker(boolean p_181027_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(10); + + if (p_181027_1_) + { + b0 = (byte)(b0 | 16); + } + else + { + b0 = (byte)(b0 & -17); + } + + this.dataWatcher.updateObject(10, Byte.valueOf(b0)); + } + + public boolean hasMarker() + { + return (this.dataWatcher.getWatchableObjectByte(10) & 16) != 0; + } + + public void setHeadRotation(Rotations p_175415_1_) + { + this.headRotation = p_175415_1_; + this.dataWatcher.updateObject(11, p_175415_1_); + } + + public void setBodyRotation(Rotations p_175424_1_) + { + this.bodyRotation = p_175424_1_; + this.dataWatcher.updateObject(12, p_175424_1_); + } + + public void setLeftArmRotation(Rotations p_175405_1_) + { + this.leftArmRotation = p_175405_1_; + this.dataWatcher.updateObject(13, p_175405_1_); + } + + public void setRightArmRotation(Rotations p_175428_1_) + { + this.rightArmRotation = p_175428_1_; + this.dataWatcher.updateObject(14, p_175428_1_); + } + + public void setLeftLegRotation(Rotations p_175417_1_) + { + this.leftLegRotation = p_175417_1_; + this.dataWatcher.updateObject(15, p_175417_1_); + } + + public void setRightLegRotation(Rotations p_175427_1_) + { + this.rightLegRotation = p_175427_1_; + this.dataWatcher.updateObject(16, p_175427_1_); + } + + public Rotations getHeadRotation() + { + return this.headRotation; + } + + public Rotations getBodyRotation() + { + return this.bodyRotation; + } + + public Rotations getLeftArmRotation() + { + return this.leftArmRotation; + } + + public Rotations getRightArmRotation() + { + return this.rightArmRotation; + } + + public Rotations getLeftLegRotation() + { + return this.leftLegRotation; + } + + public Rotations getRightLegRotation() + { + return this.rightLegRotation; + } + + public boolean canBeCollidedWith() + { + return super.canBeCollidedWith() && !this.hasMarker(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityBoat.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityBoat.java new file mode 100644 index 0000000..44e698c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityBoat.java @@ -0,0 +1,558 @@ +package net.minecraft.entity.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBoat extends Entity +{ + private boolean isBoatEmpty; + private double speedMultiplier; + private int boatPosRotationIncrements; + private double boatX; + private double boatY; + private double boatZ; + private double boatYaw; + private double boatPitch; + private double velocityX; + private double velocityY; + private double velocityZ; + + public EntityBoat(World worldIn) + { + super(worldIn); + this.isBoatEmpty = true; + this.speedMultiplier = 0.07D; + this.preventEntitySpawning = true; + this.setSize(1.5F, 0.6F); + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + } + + public AxisAlignedBB getCollisionBox(Entity entityIn) + { + return entityIn.getEntityBoundingBox(); + } + + public AxisAlignedBB getCollisionBoundingBox() + { + return this.getEntityBoundingBox(); + } + + public boolean canBePushed() + { + return true; + } + + public EntityBoat(World worldIn, double p_i1705_2_, double p_i1705_4_, double p_i1705_6_) + { + this(worldIn); + this.setPosition(p_i1705_2_, p_i1705_4_, p_i1705_6_); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = p_i1705_2_; + this.prevPosY = p_i1705_4_; + this.prevPosZ = p_i1705_6_; + } + + public double getMountedYOffset() + { + return -0.3D; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (!this.worldObj.isRemote && !this.isDead) + { + if (this.riddenByEntity != null && this.riddenByEntity == source.getEntity() && source instanceof EntityDamageSourceIndirect) + { + return false; + } + else + { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() + amount * 10.0F); + this.setBeenAttacked(); + boolean flag = source.getEntity() instanceof EntityPlayer && ((EntityPlayer)source.getEntity()).capabilities.isCreativeMode; + + if (flag || this.getDamageTaken() > 40.0F) + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity(this); + } + + if (!flag && this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + this.dropItemWithOffset(Items.boat, 1, 0.0F); + } + + this.setDead(); + } + + return true; + } + } + else + { + return true; + } + } + + public void performHurtAnimation() + { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() * 11.0F); + } + + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) + { + if (p_180426_10_ && this.riddenByEntity != null) + { + this.prevPosX = this.posX = x; + this.prevPosY = this.posY = y; + this.prevPosZ = this.posZ = z; + this.rotationYaw = yaw; + this.rotationPitch = pitch; + this.boatPosRotationIncrements = 0; + this.setPosition(x, y, z); + this.motionX = this.velocityX = 0.0D; + this.motionY = this.velocityY = 0.0D; + this.motionZ = this.velocityZ = 0.0D; + } + else + { + if (this.isBoatEmpty) + { + this.boatPosRotationIncrements = posRotationIncrements + 5; + } + else + { + double d0 = x - this.posX; + double d1 = y - this.posY; + double d2 = z - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d3 <= 1.0D) + { + return; + } + + this.boatPosRotationIncrements = 3; + } + + this.boatX = x; + this.boatY = y; + this.boatZ = z; + this.boatYaw = (double)yaw; + this.boatPitch = (double)pitch; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + } + + public void setVelocity(double x, double y, double z) + { + this.velocityX = this.motionX = x; + this.velocityY = this.motionY = y; + this.velocityZ = this.motionZ = z; + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.getTimeSinceHit() > 0) + { + this.setTimeSinceHit(this.getTimeSinceHit() - 1); + } + + if (this.getDamageTaken() > 0.0F) + { + this.setDamageTaken(this.getDamageTaken() - 1.0F); + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + int i = 5; + double d0 = 0.0D; + + for (int j = 0; j < i; ++j) + { + double d1 = this.getEntityBoundingBox().minY + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double)(j + 0) / (double)i - 0.125D; + double d3 = this.getEntityBoundingBox().minY + (this.getEntityBoundingBox().maxY - this.getEntityBoundingBox().minY) * (double)(j + 1) / (double)i - 0.125D; + AxisAlignedBB axisalignedbb = new AxisAlignedBB(this.getEntityBoundingBox().minX, d1, this.getEntityBoundingBox().minZ, this.getEntityBoundingBox().maxX, d3, this.getEntityBoundingBox().maxZ); + + if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.water)) + { + d0 += 1.0D / (double)i; + } + } + + double d9 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d9 > 0.2975D) + { + double d2 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D); + double d4 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D); + + for (int k = 0; (double)k < 1.0D + d9 * 60.0D; ++k) + { + double d5 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); + double d6 = (double)(this.rand.nextInt(2) * 2 - 1) * 0.7D; + + if (this.rand.nextBoolean()) + { + double d7 = this.posX - d2 * d5 * 0.8D + d4 * d6; + double d8 = this.posZ - d4 * d5 * 0.8D - d2 * d6; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, d7, this.posY - 0.125D, d8, this.motionX, this.motionY, this.motionZ, new int[0]); + } + else + { + double d24 = this.posX + d2 + d4 * d5 * 0.7D; + double d25 = this.posZ + d4 - d2 * d5 * 0.7D; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, d24, this.posY - 0.125D, d25, this.motionX, this.motionY, this.motionZ, new int[0]); + } + } + } + + if (this.worldObj.isRemote && this.isBoatEmpty) + { + if (this.boatPosRotationIncrements > 0) + { + double d12 = this.posX + (this.boatX - this.posX) / (double)this.boatPosRotationIncrements; + double d16 = this.posY + (this.boatY - this.posY) / (double)this.boatPosRotationIncrements; + double d19 = this.posZ + (this.boatZ - this.posZ) / (double)this.boatPosRotationIncrements; + double d22 = MathHelper.wrapAngleTo180_double(this.boatYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d22 / (double)this.boatPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.boatPitch - (double)this.rotationPitch) / (double)this.boatPosRotationIncrements); + --this.boatPosRotationIncrements; + this.setPosition(d12, d16, d19); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else + { + double d13 = this.posX + this.motionX; + double d17 = this.posY + this.motionY; + double d20 = this.posZ + this.motionZ; + this.setPosition(d13, d17, d20); + + if (this.onGround) + { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.9900000095367432D; + } + } + else + { + if (d0 < 1.0D) + { + double d10 = d0 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * d10; + } + else + { + if (this.motionY < 0.0D) + { + this.motionY /= 2.0D; + } + + this.motionY += 0.007000000216066837D; + } + + if (this.riddenByEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)this.riddenByEntity; + float f = this.riddenByEntity.rotationYaw + -entitylivingbase.moveStrafing * 90.0F; + this.motionX += -Math.sin((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D; + this.motionZ += Math.cos((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D; + } + + double d11 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d11 > 0.35D) + { + double d14 = 0.35D / d11; + this.motionX *= d14; + this.motionZ *= d14; + d11 = 0.35D; + } + + if (d11 > d9 && this.speedMultiplier < 0.35D) + { + this.speedMultiplier += (0.35D - this.speedMultiplier) / 35.0D; + + if (this.speedMultiplier > 0.35D) + { + this.speedMultiplier = 0.35D; + } + } + else + { + this.speedMultiplier -= (this.speedMultiplier - 0.07D) / 35.0D; + + if (this.speedMultiplier < 0.07D) + { + this.speedMultiplier = 0.07D; + } + } + + for (int i1 = 0; i1 < 4; ++i1) + { + int l1 = MathHelper.floor_double(this.posX + ((double)(i1 % 2) - 0.5D) * 0.8D); + int i2 = MathHelper.floor_double(this.posZ + ((double)(i1 / 2) - 0.5D) * 0.8D); + + for (int j2 = 0; j2 < 2; ++j2) + { + int l = MathHelper.floor_double(this.posY) + j2; + BlockPos blockpos = new BlockPos(l1, l, i2); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + + if (block == Blocks.snow_layer) + { + this.worldObj.setBlockToAir(blockpos); + this.isCollidedHorizontally = false; + } + else if (block == Blocks.waterlily) + { + this.worldObj.destroyBlock(blockpos, true); + this.isCollidedHorizontally = false; + } + } + } + + if (this.onGround) + { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.isCollidedHorizontally && d9 > 0.2975D) + { + if (!this.worldObj.isRemote && !this.isDead) + { + this.setDead(); + + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + for (int j1 = 0; j1 < 3; ++j1) + { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (int k1 = 0; k1 < 2; ++k1) + { + this.dropItemWithOffset(Items.stick, 1, 0.0F); + } + } + } + } + else + { + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.9900000095367432D; + } + + this.rotationPitch = 0.0F; + double d15 = (double)this.rotationYaw; + double d18 = this.prevPosX - this.posX; + double d21 = this.prevPosZ - this.posZ; + + if (d18 * d18 + d21 * d21 > 0.001D) + { + d15 = (double)((float)(MathHelper.atan2(d21, d18) * 180.0D / Math.PI)); + } + + double d23 = MathHelper.wrapAngleTo180_double(d15 - (double)this.rotationYaw); + + if (d23 > 20.0D) + { + d23 = 20.0D; + } + + if (d23 < -20.0D) + { + d23 = -20.0D; + } + + this.rotationYaw = (float)((double)this.rotationYaw + d23); + this.setRotation(this.rotationYaw, this.rotationPitch); + + if (!this.worldObj.isRemote) + { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + + if (list != null && !list.isEmpty()) + { + for (int k2 = 0; k2 < list.size(); ++k2) + { + Entity entity = (Entity)list.get(k2); + + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityBoat) + { + entity.applyEntityCollision(this); + } + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) + { + this.riddenByEntity = null; + } + } + } + } + + public void updateRiderPosition() + { + if (this.riddenByEntity != null) + { + double d0 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + double d1 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + this.riddenByEntity.setPosition(this.posX + d0, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + d1); + } + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + } + + public boolean interactFirst(EntityPlayer playerIn) + { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != playerIn) + { + return true; + } + else + { + if (!this.worldObj.isRemote) + { + playerIn.mountEntity(this); + } + + return true; + } + } + + protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos) + { + if (onGroundIn) + { + if (this.fallDistance > 3.0F) + { + this.fall(this.fallDistance, 1.0F); + + if (!this.worldObj.isRemote && !this.isDead) + { + this.setDead(); + + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + for (int i = 0; i < 3; ++i) + { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (int j = 0; j < 2; ++j) + { + this.dropItemWithOffset(Items.stick, 1, 0.0F); + } + } + } + + this.fallDistance = 0.0F; + } + } + else if (this.worldObj.getBlockState((new BlockPos(this)).down()).getBlock().getMaterial() != Material.water && y < 0.0D) + { + this.fallDistance = (float)((double)this.fallDistance - y); + } + } + + public void setDamageTaken(float p_70266_1_) + { + this.dataWatcher.updateObject(19, Float.valueOf(p_70266_1_)); + } + + public float getDamageTaken() + { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + public void setTimeSinceHit(int p_70265_1_) + { + this.dataWatcher.updateObject(17, Integer.valueOf(p_70265_1_)); + } + + public int getTimeSinceHit() + { + return this.dataWatcher.getWatchableObjectInt(17); + } + + public void setForwardDirection(int p_70269_1_) + { + this.dataWatcher.updateObject(18, Integer.valueOf(p_70269_1_)); + } + + public int getForwardDirection() + { + return this.dataWatcher.getWatchableObjectInt(18); + } + + public void setIsBoatEmpty(boolean p_70270_1_) + { + this.isBoatEmpty = p_70270_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java new file mode 100644 index 0000000..bb2a62a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java @@ -0,0 +1,98 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderEnd; + +public class EntityEnderCrystal extends Entity +{ + public int innerRotation; + public int health; + + public EntityEnderCrystal(World worldIn) + { + super(worldIn); + this.preventEntitySpawning = true; + this.setSize(2.0F, 2.0F); + this.health = 5; + this.innerRotation = this.rand.nextInt(100000); + } + + public EntityEnderCrystal(World worldIn, double x, double y, double z) + { + this(worldIn); + this.setPosition(x, y, z); + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(8, Integer.valueOf(this.health)); + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.innerRotation; + this.dataWatcher.updateObject(8, Integer.valueOf(this.health)); + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (this.worldObj.provider instanceof WorldProviderEnd && this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock() != Blocks.fire) + { + this.worldObj.setBlockState(new BlockPos(i, j, k), Blocks.fire.getDefaultState()); + } + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + } + + public boolean canBeCollidedWith() + { + return true; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + if (!this.isDead && !this.worldObj.isRemote) + { + this.health = 0; + + if (this.health <= 0) + { + this.setDead(); + + if (!this.worldObj.isRemote) + { + this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true); + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderEye.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderEye.java new file mode 100644 index 0000000..79ce41e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderEye.java @@ -0,0 +1,210 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityEnderEye extends Entity +{ + private double targetX; + private double targetY; + private double targetZ; + private int despawnTimer; + private boolean shatterOrDrop; + + public EntityEnderEye(World worldIn) + { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() + { + } + + public boolean isInRangeToRenderDist(double distance) + { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + + if (Double.isNaN(d0)) + { + d0 = 4.0D; + } + + d0 = d0 * 64.0D; + return distance < d0 * d0; + } + + public EntityEnderEye(World worldIn, double x, double y, double z) + { + super(worldIn); + this.despawnTimer = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + } + + public void moveTowards(BlockPos p_180465_1_) + { + double d0 = (double)p_180465_1_.getX(); + int i = p_180465_1_.getY(); + double d1 = (double)p_180465_1_.getZ(); + double d2 = d0 - this.posX; + double d3 = d1 - this.posZ; + float f = MathHelper.sqrt_double(d2 * d2 + d3 * d3); + + if (f > 12.0F) + { + this.targetX = this.posX + d2 / (double)f * 12.0D; + this.targetZ = this.posZ + d3 / (double)f * 12.0D; + this.targetY = this.posY + 8.0D; + } + else + { + this.targetX = d0; + this.targetY = (double)i; + this.targetZ = d1; + } + + this.despawnTimer = 0; + this.shatterOrDrop = this.rand.nextInt(5) > 0; + } + + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * 180.0D / Math.PI); + } + } + + public void onUpdate() + { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + + if (!this.worldObj.isRemote) + { + double d0 = this.targetX - this.posX; + double d1 = this.targetZ - this.posZ; + float f1 = (float)Math.sqrt(d0 * d0 + d1 * d1); + float f2 = (float)MathHelper.atan2(d1, d0); + double d2 = (double)f + (double)(f1 - f) * 0.0025D; + + if (f1 < 1.0F) + { + d2 *= 0.8D; + this.motionY *= 0.8D; + } + + this.motionX = Math.cos((double)f2) * d2; + this.motionZ = Math.sin((double)f2) * d2; + + if (this.posY < this.targetY) + { + this.motionY += (1.0D - this.motionY) * 0.014999999664723873D; + } + else + { + this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D; + } + } + + float f3 = 0.25F; + + if (this.isInWater()) + { + for (int i = 0; i < 4; ++i) + { + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ, new int[0]); + } + } + else + { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX - this.motionX * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)f3 - 0.5D, this.posZ - this.motionZ * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ, new int[0]); + } + + if (!this.worldObj.isRemote) + { + this.setPosition(this.posX, this.posY, this.posZ); + ++this.despawnTimer; + + if (this.despawnTimer > 80 && !this.worldObj.isRemote) + { + this.setDead(); + + if (this.shatterOrDrop) + { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye))); + } + else + { + this.worldObj.playAuxSFX(2003, new BlockPos(this), 0); + } + } + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + } + + public float getBrightness(float partialTicks) + { + return 1.0F; + } + + public int getBrightnessForRender(float partialTicks) + { + return 15728880; + } + + public boolean canAttackWithItem() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java new file mode 100644 index 0000000..102562d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java @@ -0,0 +1,102 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityEndermite; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityEnderPearl extends EntityThrowable +{ + private EntityLivingBase field_181555_c; + + public EntityEnderPearl(World worldIn) + { + super(worldIn); + } + + public EntityEnderPearl(World worldIn, EntityLivingBase p_i1783_2_) + { + super(worldIn, p_i1783_2_); + this.field_181555_c = p_i1783_2_; + } + + public EntityEnderPearl(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + protected void onImpact(MovingObjectPosition p_70184_1_) + { + EntityLivingBase entitylivingbase = this.getThrower(); + + if (p_70184_1_.entityHit != null) + { + if (p_70184_1_.entityHit == this.field_181555_c) + { + return; + } + + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, entitylivingbase), 0.0F); + } + + for (int i = 0; i < 32; ++i) + { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian(), new int[0]); + } + + if (!this.worldObj.isRemote) + { + if (entitylivingbase instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)entitylivingbase; + + if (entityplayermp.playerNetServerHandler.getNetworkManager().isChannelOpen() && entityplayermp.worldObj == this.worldObj && !entityplayermp.isPlayerSleeping()) + { + if (this.rand.nextFloat() < 0.05F && this.worldObj.getGameRules().getBoolean("doMobSpawning")) + { + EntityEndermite entityendermite = new EntityEndermite(this.worldObj); + entityendermite.setSpawnedByPlayer(true); + entityendermite.setLocationAndAngles(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ, entitylivingbase.rotationYaw, entitylivingbase.rotationPitch); + this.worldObj.spawnEntityInWorld(entityendermite); + } + + if (entitylivingbase.isRiding()) + { + entitylivingbase.mountEntity((Entity)null); + } + + entitylivingbase.setPositionAndUpdate(this.posX, this.posY, this.posZ); + entitylivingbase.fallDistance = 0.0F; + entitylivingbase.attackEntityFrom(DamageSource.fall, 5.0F); + } + } + else if (entitylivingbase != null) + { + entitylivingbase.setPositionAndUpdate(this.posX, this.posY, this.posZ); + entitylivingbase.fallDistance = 0.0F; + } + + this.setDead(); + } + } + + public void onUpdate() + { + EntityLivingBase entitylivingbase = this.getThrower(); + + if (entitylivingbase != null && entitylivingbase instanceof EntityPlayer && !entitylivingbase.isEntityAlive()) + { + this.setDead(); + } + else + { + super.onUpdate(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityExpBottle.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityExpBottle.java new file mode 100644 index 0000000..cbf4d63 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityExpBottle.java @@ -0,0 +1,58 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityExpBottle extends EntityThrowable +{ + public EntityExpBottle(World worldIn) + { + super(worldIn); + } + + public EntityExpBottle(World worldIn, EntityLivingBase p_i1786_2_) + { + super(worldIn, p_i1786_2_); + } + + public EntityExpBottle(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + protected float getGravityVelocity() + { + return 0.07F; + } + + protected float getVelocity() + { + return 0.7F; + } + + protected float getInaccuracy() + { + return -20.0F; + } + + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (!this.worldObj.isRemote) + { + this.worldObj.playAuxSFX(2002, new BlockPos(this), 0); + int i = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5); + + while (i > 0) + { + int j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + + this.setDead(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java new file mode 100644 index 0000000..f12fca8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java @@ -0,0 +1,305 @@ +package net.minecraft.entity.item; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class EntityFallingBlock extends Entity +{ + private IBlockState fallTile; + public int fallTime; + public boolean shouldDropItem = true; + private boolean canSetAsBlock; + private boolean hurtEntities; + private int fallHurtMax = 40; + private float fallHurtAmount = 2.0F; + public NBTTagCompound tileEntityData; + + public EntityFallingBlock(World worldIn) + { + super(worldIn); + } + + public EntityFallingBlock(World worldIn, double x, double y, double z, IBlockState fallingBlockState) + { + super(worldIn); + this.fallTile = fallingBlockState; + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.setPosition(x, y, z); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = x; + this.prevPosY = y; + this.prevPosZ = z; + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + } + + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + public void onUpdate() + { + Block block = this.fallTile.getBlock(); + + if (block.getMaterial() == Material.air) + { + this.setDead(); + } + else + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.fallTime++ == 0) + { + BlockPos blockpos = new BlockPos(this); + + if (this.worldObj.getBlockState(blockpos).getBlock() == block) + { + this.worldObj.setBlockToAir(blockpos); + } + else if (!this.worldObj.isRemote) + { + this.setDead(); + return; + } + } + + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (!this.worldObj.isRemote) + { + BlockPos blockpos1 = new BlockPos(this); + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + + if (this.worldObj.getBlockState(blockpos1).getBlock() != Blocks.piston_extension) + { + this.setDead(); + + if (!this.canSetAsBlock) + { + if (this.worldObj.canBlockBePlaced(block, blockpos1, true, EnumFacing.UP, (Entity)null, (ItemStack)null) && !BlockFalling.canFallInto(this.worldObj, blockpos1.down()) && this.worldObj.setBlockState(blockpos1, this.fallTile, 3)) + { + if (block instanceof BlockFalling) + { + ((BlockFalling)block).onEndFalling(this.worldObj, blockpos1); + } + + if (this.tileEntityData != null && block instanceof ITileEntityProvider) + { + TileEntity tileentity = this.worldObj.getTileEntity(blockpos1); + + if (tileentity != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + + for (String s : this.tileEntityData.getKeySet()) + { + NBTBase nbtbase = this.tileEntityData.getTag(s); + + if (!s.equals("x") && !s.equals("y") && !s.equals("z")) + { + nbttagcompound.setTag(s, nbtbase.copy()); + } + } + + tileentity.readFromNBT(nbttagcompound); + tileentity.markDirty(); + } + } + } + else if (this.shouldDropItem && this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + this.entityDropItem(new ItemStack(block, 1, block.damageDropped(this.fallTile)), 0.0F); + } + } + } + } + else if (this.fallTime > 100 && !this.worldObj.isRemote && (blockpos1.getY() < 1 || blockpos1.getY() > 256) || this.fallTime > 600) + { + if (this.shouldDropItem && this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + this.entityDropItem(new ItemStack(block, 1, block.damageDropped(this.fallTile)), 0.0F); + } + + this.setDead(); + } + } + } + } + + public void fall(float distance, float damageMultiplier) + { + Block block = this.fallTile.getBlock(); + + if (this.hurtEntities) + { + int i = MathHelper.ceiling_float_int(distance - 1.0F); + + if (i > 0) + { + List list = Lists.newArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox())); + boolean flag = block == Blocks.anvil; + DamageSource damagesource = flag ? DamageSource.anvil : DamageSource.fallingBlock; + + for (Entity entity : list) + { + entity.attackEntityFrom(damagesource, (float)Math.min(MathHelper.floor_float((float)i * this.fallHurtAmount), this.fallHurtMax)); + } + + if (flag && (double)this.rand.nextFloat() < 0.05000000074505806D + (double)i * 0.05D) + { + int j = ((Integer)this.fallTile.getValue(BlockAnvil.DAMAGE)).intValue(); + ++j; + + if (j > 2) + { + this.canSetAsBlock = true; + } + else + { + this.fallTile = this.fallTile.withProperty(BlockAnvil.DAMAGE, Integer.valueOf(j)); + } + } + } + } + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air; + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(block); + tagCompound.setString("Block", resourcelocation == null ? "" : resourcelocation.toString()); + tagCompound.setByte("Data", (byte)block.getMetaFromState(this.fallTile)); + tagCompound.setByte("Time", (byte)this.fallTime); + tagCompound.setBoolean("DropItem", this.shouldDropItem); + tagCompound.setBoolean("HurtEntities", this.hurtEntities); + tagCompound.setFloat("FallHurtAmount", this.fallHurtAmount); + tagCompound.setInteger("FallHurtMax", this.fallHurtMax); + + if (this.tileEntityData != null) + { + tagCompound.setTag("TileEntityData", this.tileEntityData); + } + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + int i = tagCompund.getByte("Data") & 255; + + if (tagCompund.hasKey("Block", 8)) + { + this.fallTile = Block.getBlockFromName(tagCompund.getString("Block")).getStateFromMeta(i); + } + else if (tagCompund.hasKey("TileID", 99)) + { + this.fallTile = Block.getBlockById(tagCompund.getInteger("TileID")).getStateFromMeta(i); + } + else + { + this.fallTile = Block.getBlockById(tagCompund.getByte("Tile") & 255).getStateFromMeta(i); + } + + this.fallTime = tagCompund.getByte("Time") & 255; + Block block = this.fallTile.getBlock(); + + if (tagCompund.hasKey("HurtEntities", 99)) + { + this.hurtEntities = tagCompund.getBoolean("HurtEntities"); + this.fallHurtAmount = tagCompund.getFloat("FallHurtAmount"); + this.fallHurtMax = tagCompund.getInteger("FallHurtMax"); + } + else if (block == Blocks.anvil) + { + this.hurtEntities = true; + } + + if (tagCompund.hasKey("DropItem", 99)) + { + this.shouldDropItem = tagCompund.getBoolean("DropItem"); + } + + if (tagCompund.hasKey("TileEntityData", 10)) + { + this.tileEntityData = tagCompund.getCompoundTag("TileEntityData"); + } + + if (block == null || block.getMaterial() == Material.air) + { + this.fallTile = Blocks.sand.getDefaultState(); + } + } + + public World getWorldObj() + { + return this.worldObj; + } + + public void setHurtEntities(boolean p_145806_1_) + { + this.hurtEntities = p_145806_1_; + } + + public boolean canRenderOnFire() + { + return false; + } + + public void addEntityCrashInfo(CrashReportCategory category) + { + super.addEntityCrashInfo(category); + + if (this.fallTile != null) + { + Block block = this.fallTile.getBlock(); + category.addCrashSection("Immitating block ID", Integer.valueOf(Block.getIdFromBlock(block))); + category.addCrashSection("Immitating block data", Integer.valueOf(block.getMetaFromState(this.fallTile))); + } + } + + public IBlockState getBlock() + { + return this.fallTile; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java new file mode 100644 index 0000000..6f750e9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java @@ -0,0 +1,189 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFireworkRocket extends Entity +{ + private int fireworkAge; + private int lifetime; + + public EntityFireworkRocket(World worldIn) + { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() + { + this.dataWatcher.addObjectByDataType(8, 5); + } + + public boolean isInRangeToRenderDist(double distance) + { + return distance < 4096.0D; + } + + public EntityFireworkRocket(World worldIn, double x, double y, double z, ItemStack givenItem) + { + super(worldIn); + this.fireworkAge = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + int i = 1; + + if (givenItem != null && givenItem.hasTagCompound()) + { + this.dataWatcher.updateObject(8, givenItem); + NBTTagCompound nbttagcompound = givenItem.getTagCompound(); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Fireworks"); + + if (nbttagcompound1 != null) + { + i += nbttagcompound1.getByte("Flight"); + } + } + + this.motionX = this.rand.nextGaussian() * 0.001D; + this.motionZ = this.rand.nextGaussian() * 0.001D; + this.motionY = 0.05D; + this.lifetime = 10 * i + this.rand.nextInt(6) + this.rand.nextInt(7); + } + + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * 180.0D / Math.PI); + } + } + + public void onUpdate() + { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.motionX *= 1.15D; + this.motionZ *= 1.15D; + this.motionY += 0.04D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + + if (this.fireworkAge == 0 && !this.isSilent()) + { + this.worldObj.playSoundAtEntity(this, "fireworks.launch", 3.0F, 1.0F); + } + + ++this.fireworkAge; + + if (this.worldObj.isRemote && this.fireworkAge % 2 < 2) + { + this.worldObj.spawnParticle(EnumParticleTypes.FIREWORKS_SPARK, this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D, new int[0]); + } + + if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) + { + this.worldObj.setEntityState(this, (byte)17); + this.setDead(); + } + } + + public void handleStatusUpdate(byte id) + { + if (id == 17 && this.worldObj.isRemote) + { + ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8); + NBTTagCompound nbttagcompound = null; + + if (itemstack != null && itemstack.hasTagCompound()) + { + nbttagcompound = itemstack.getTagCompound().getCompoundTag("Fireworks"); + } + + this.worldObj.makeFireworks(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, nbttagcompound); + } + + super.handleStatusUpdate(id); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setInteger("Life", this.fireworkAge); + tagCompound.setInteger("LifeTime", this.lifetime); + ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8); + + if (itemstack != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + itemstack.writeToNBT(nbttagcompound); + tagCompound.setTag("FireworksItem", nbttagcompound); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.fireworkAge = tagCompund.getInteger("Life"); + this.lifetime = tagCompund.getInteger("LifeTime"); + NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("FireworksItem"); + + if (nbttagcompound != null) + { + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound); + + if (itemstack != null) + { + this.dataWatcher.updateObject(8, itemstack); + } + } + } + + public float getBrightness(float partialTicks) + { + return super.getBrightness(partialTicks); + } + + public int getBrightnessForRender(float partialTicks) + { + return super.getBrightnessForRender(partialTicks); + } + + public boolean canAttackWithItem() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityItem.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityItem.java new file mode 100644 index 0000000..c4c8d70 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityItem.java @@ -0,0 +1,482 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityItem extends Entity +{ + private static final Logger logger = LogManager.getLogger(); + private int age; + private int delayBeforeCanPickup; + private int health; + private String thrower; + private String owner; + public float hoverStart; + + public EntityItem(World worldIn, double x, double y, double z) + { + super(worldIn); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + this.rotationYaw = (float)(Math.random() * 360.0D); + this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); + this.motionY = 0.20000000298023224D; + this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); + } + + public EntityItem(World worldIn, double x, double y, double z, ItemStack stack) + { + this(worldIn, x, y, z); + this.setEntityItemStack(stack); + } + + protected boolean canTriggerWalking() + { + return false; + } + + public EntityItem(World worldIn) + { + super(worldIn); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); + this.setEntityItemStack(new ItemStack(Blocks.air, 0)); + } + + protected void entityInit() + { + this.getDataWatcher().addObjectByDataType(10, 5); + } + + public void onUpdate() + { + if (this.getEntityItem() == null) + { + this.setDead(); + } + else + { + super.onUpdate(); + + if (this.delayBeforeCanPickup > 0 && this.delayBeforeCanPickup != 32767) + { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.noClip = this.pushOutOfBlocks(this.posX, (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, this.posZ); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + boolean flag = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ; + + if (flag || this.ticksExisted % 25 == 0) + { + if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava) + { + this.motionY = 0.20000000298023224D; + this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + if (!this.worldObj.isRemote) + { + this.searchForOtherItemsNearby(); + } + } + + float f = 0.98F; + + if (this.onGround) + { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.98F; + } + + this.motionX *= (double)f; + this.motionY *= 0.9800000190734863D; + this.motionZ *= (double)f; + + if (this.onGround) + { + this.motionY *= -0.5D; + } + + if (this.age != -32768) + { + ++this.age; + } + + this.handleWaterMovement(); + + if (!this.worldObj.isRemote && this.age >= 6000) + { + this.setDead(); + } + } + } + + private void searchForOtherItemsNearby() + { + for (EntityItem entityitem : this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.getEntityBoundingBox().expand(0.5D, 0.0D, 0.5D))) + { + this.combineItems(entityitem); + } + } + + private boolean combineItems(EntityItem other) + { + if (other == this) + { + return false; + } + else if (other.isEntityAlive() && this.isEntityAlive()) + { + ItemStack itemstack = this.getEntityItem(); + ItemStack itemstack1 = other.getEntityItem(); + + if (this.delayBeforeCanPickup != 32767 && other.delayBeforeCanPickup != 32767) + { + if (this.age != -32768 && other.age != -32768) + { + if (itemstack1.getItem() != itemstack.getItem()) + { + return false; + } + else if (itemstack1.hasTagCompound() ^ itemstack.hasTagCompound()) + { + return false; + } + else if (itemstack1.hasTagCompound() && !itemstack1.getTagCompound().equals(itemstack.getTagCompound())) + { + return false; + } + else if (itemstack1.getItem() == null) + { + return false; + } + else if (itemstack1.getItem().getHasSubtypes() && itemstack1.getMetadata() != itemstack.getMetadata()) + { + return false; + } + else if (itemstack1.stackSize < itemstack.stackSize) + { + return other.combineItems(this); + } + else if (itemstack1.stackSize + itemstack.stackSize > itemstack1.getMaxStackSize()) + { + return false; + } + else + { + itemstack1.stackSize += itemstack.stackSize; + other.delayBeforeCanPickup = Math.max(other.delayBeforeCanPickup, this.delayBeforeCanPickup); + other.age = Math.min(other.age, this.age); + other.setEntityItemStack(itemstack1); + this.setDead(); + return true; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + + public void setAgeToCreativeDespawnTime() + { + this.age = 4800; + } + + public boolean handleWaterMovement() + { + if (this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox(), Material.water, this)) + { + if (!this.inWater && !this.firstUpdate) + { + this.resetHeight(); + } + + this.inWater = true; + } + else + { + this.inWater = false; + } + + return this.inWater; + } + + protected void dealFireDamage(int amount) + { + this.attackEntityFrom(DamageSource.inFire, (float)amount); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && source.isExplosion()) + { + return false; + } + else + { + this.setBeenAttacked(); + this.health = (int)((float)this.health - amount); + + if (this.health <= 0) + { + this.setDead(); + } + + return false; + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("Health", (short)((byte)this.health)); + tagCompound.setShort("Age", (short)this.age); + tagCompound.setShort("PickupDelay", (short)this.delayBeforeCanPickup); + + if (this.getThrower() != null) + { + tagCompound.setString("Thrower", this.thrower); + } + + if (this.getOwner() != null) + { + tagCompound.setString("Owner", this.owner); + } + + if (this.getEntityItem() != null) + { + tagCompound.setTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.health = tagCompund.getShort("Health") & 255; + this.age = tagCompund.getShort("Age"); + + if (tagCompund.hasKey("PickupDelay")) + { + this.delayBeforeCanPickup = tagCompund.getShort("PickupDelay"); + } + + if (tagCompund.hasKey("Owner")) + { + this.owner = tagCompund.getString("Owner"); + } + + if (tagCompund.hasKey("Thrower")) + { + this.thrower = tagCompund.getString("Thrower"); + } + + NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("Item"); + this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound)); + + if (this.getEntityItem() == null) + { + this.setDead(); + } + } + + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (!this.worldObj.isRemote) + { + ItemStack itemstack = this.getEntityItem(); + int i = itemstack.stackSize; + + if (this.delayBeforeCanPickup == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityIn.getName())) && entityIn.inventory.addItemStackToInventory(itemstack)) + { + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log)) + { + entityIn.triggerAchievement(AchievementList.mineWood); + } + + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log2)) + { + entityIn.triggerAchievement(AchievementList.mineWood); + } + + if (itemstack.getItem() == Items.leather) + { + entityIn.triggerAchievement(AchievementList.killCow); + } + + if (itemstack.getItem() == Items.diamond) + { + entityIn.triggerAchievement(AchievementList.diamonds); + } + + if (itemstack.getItem() == Items.blaze_rod) + { + entityIn.triggerAchievement(AchievementList.blazeRod); + } + + if (itemstack.getItem() == Items.diamond && this.getThrower() != null) + { + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByName(this.getThrower()); + + if (entityplayer != null && entityplayer != entityIn) + { + entityplayer.triggerAchievement(AchievementList.diamondsToYou); + } + } + + if (!this.isSilent()) + { + this.worldObj.playSoundAtEntity(entityIn, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } + + entityIn.onItemPickup(this, i); + + if (itemstack.stackSize <= 0) + { + this.setDead(); + } + } + } + } + + public String getName() + { + return this.hasCustomName() ? this.getCustomNameTag() : StatCollector.translateToLocal("item." + this.getEntityItem().getUnlocalizedName()); + } + + public boolean canAttackWithItem() + { + return false; + } + + public void travelToDimension(int dimensionId) + { + super.travelToDimension(dimensionId); + + if (!this.worldObj.isRemote) + { + this.searchForOtherItemsNearby(); + } + } + + public ItemStack getEntityItem() + { + ItemStack itemstack = this.getDataWatcher().getWatchableObjectItemStack(10); + + if (itemstack == null) + { + if (this.worldObj != null) + { + logger.error("Item entity " + this.getEntityId() + " has no item?!"); + } + + return new ItemStack(Blocks.stone); + } + else + { + return itemstack; + } + } + + public void setEntityItemStack(ItemStack stack) + { + this.getDataWatcher().updateObject(10, stack); + this.getDataWatcher().setObjectWatched(10); + } + + public String getOwner() + { + return this.owner; + } + + public void setOwner(String owner) + { + this.owner = owner; + } + + public String getThrower() + { + return this.thrower; + } + + public void setThrower(String thrower) + { + this.thrower = thrower; + } + + public int getAge() + { + return this.age; + } + + public void setDefaultPickupDelay() + { + this.delayBeforeCanPickup = 10; + } + + public void setNoPickupDelay() + { + this.delayBeforeCanPickup = 0; + } + + public void setInfinitePickupDelay() + { + this.delayBeforeCanPickup = 32767; + } + + public void setPickupDelay(int ticks) + { + this.delayBeforeCanPickup = ticks; + } + + public boolean cannotPickup() + { + return this.delayBeforeCanPickup > 0; + } + + public void setNoDespawn() + { + this.age = -6000; + } + + public void func_174870_v() + { + this.setInfinitePickupDelay(); + this.age = 5999; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityItemFrame.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityItemFrame.java new file mode 100644 index 0000000..f4bb8ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityItemFrame.java @@ -0,0 +1,243 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class EntityItemFrame extends EntityHanging +{ + private float itemDropChance = 1.0F; + + public EntityItemFrame(World worldIn) + { + super(worldIn); + } + + public EntityItemFrame(World worldIn, BlockPos p_i45852_2_, EnumFacing p_i45852_3_) + { + super(worldIn, p_i45852_2_); + this.updateFacingWithBoundingBox(p_i45852_3_); + } + + protected void entityInit() + { + this.getDataWatcher().addObjectByDataType(8, 5); + this.getDataWatcher().addObject(9, Byte.valueOf((byte)0)); + } + + public float getCollisionBorderSize() + { + return 0.0F; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (!source.isExplosion() && this.getDisplayedItem() != null) + { + if (!this.worldObj.isRemote) + { + this.dropItemOrSelf(source.getEntity(), false); + this.setDisplayedItem((ItemStack)null); + } + + return true; + } + else + { + return super.attackEntityFrom(source, amount); + } + } + + public int getWidthPixels() + { + return 12; + } + + public int getHeightPixels() + { + return 12; + } + + public boolean isInRangeToRenderDist(double distance) + { + double d0 = 16.0D; + d0 = d0 * 64.0D * this.renderDistanceWeight; + return distance < d0 * d0; + } + + public void onBroken(Entity brokenEntity) + { + this.dropItemOrSelf(brokenEntity, true); + } + + public void dropItemOrSelf(Entity p_146065_1_, boolean p_146065_2_) + { + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + ItemStack itemstack = this.getDisplayedItem(); + + if (p_146065_1_ instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)p_146065_1_; + + if (entityplayer.capabilities.isCreativeMode) + { + this.removeFrameFromMap(itemstack); + return; + } + } + + if (p_146065_2_) + { + this.entityDropItem(new ItemStack(Items.item_frame), 0.0F); + } + + if (itemstack != null && this.rand.nextFloat() < this.itemDropChance) + { + itemstack = itemstack.copy(); + this.removeFrameFromMap(itemstack); + this.entityDropItem(itemstack, 0.0F); + } + } + } + + private void removeFrameFromMap(ItemStack p_110131_1_) + { + if (p_110131_1_ != null) + { + if (p_110131_1_.getItem() == Items.filled_map) + { + MapData mapdata = ((ItemMap)p_110131_1_.getItem()).getMapData(p_110131_1_, this.worldObj); + mapdata.mapDecorations.remove("frame-" + this.getEntityId()); + } + + p_110131_1_.setItemFrame((EntityItemFrame)null); + } + } + + public ItemStack getDisplayedItem() + { + return this.getDataWatcher().getWatchableObjectItemStack(8); + } + + public void setDisplayedItem(ItemStack p_82334_1_) + { + this.setDisplayedItemWithUpdate(p_82334_1_, true); + } + + private void setDisplayedItemWithUpdate(ItemStack p_174864_1_, boolean p_174864_2_) + { + if (p_174864_1_ != null) + { + p_174864_1_ = p_174864_1_.copy(); + p_174864_1_.stackSize = 1; + p_174864_1_.setItemFrame(this); + } + + this.getDataWatcher().updateObject(8, p_174864_1_); + this.getDataWatcher().setObjectWatched(8); + + if (p_174864_2_ && this.hangingPosition != null) + { + this.worldObj.updateComparatorOutputLevel(this.hangingPosition, Blocks.air); + } + } + + public int getRotation() + { + return this.getDataWatcher().getWatchableObjectByte(9); + } + + public void setItemRotation(int p_82336_1_) + { + this.func_174865_a(p_82336_1_, true); + } + + private void func_174865_a(int p_174865_1_, boolean p_174865_2_) + { + this.getDataWatcher().updateObject(9, Byte.valueOf((byte)(p_174865_1_ % 8))); + + if (p_174865_2_ && this.hangingPosition != null) + { + this.worldObj.updateComparatorOutputLevel(this.hangingPosition, Blocks.air); + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + if (this.getDisplayedItem() != null) + { + tagCompound.setTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); + tagCompound.setByte("ItemRotation", (byte)this.getRotation()); + tagCompound.setFloat("ItemDropChance", this.itemDropChance); + } + + super.writeEntityToNBT(tagCompound); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("Item"); + + if (nbttagcompound != null && !nbttagcompound.hasNoTags()) + { + this.setDisplayedItemWithUpdate(ItemStack.loadItemStackFromNBT(nbttagcompound), false); + this.func_174865_a(tagCompund.getByte("ItemRotation"), false); + + if (tagCompund.hasKey("ItemDropChance", 99)) + { + this.itemDropChance = tagCompund.getFloat("ItemDropChance"); + } + + if (tagCompund.hasKey("Direction")) + { + this.func_174865_a(this.getRotation() * 2, false); + } + } + + super.readEntityFromNBT(tagCompund); + } + + public boolean interactFirst(EntityPlayer playerIn) + { + if (this.getDisplayedItem() == null) + { + ItemStack itemstack = playerIn.getHeldItem(); + + if (itemstack != null && !this.worldObj.isRemote) + { + this.setDisplayedItem(itemstack); + + if (!playerIn.capabilities.isCreativeMode && --itemstack.stackSize <= 0) + { + playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, (ItemStack)null); + } + } + } + else if (!this.worldObj.isRemote) + { + this.setItemRotation(this.getRotation() + 1); + } + + return true; + } + + public int func_174866_q() + { + return this.getDisplayedItem() == null ? 0 : this.getRotation() % 8 + 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecart.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecart.java new file mode 100644 index 0000000..9b8ef3b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecart.java @@ -0,0 +1,1088 @@ +package net.minecraft.entity.item; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.BlockRailPowered; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.IWorldNameable; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public abstract class EntityMinecart extends Entity implements IWorldNameable +{ + private boolean isInReverse; + private String entityName; + private static final int[][][] matrix = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; + private int turnProgress; + private double minecartX; + private double minecartY; + private double minecartZ; + private double minecartYaw; + private double minecartPitch; + private double velocityX; + private double velocityY; + private double velocityZ; + + public EntityMinecart(World worldIn) + { + super(worldIn); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.7F); + } + + public static EntityMinecart getMinecart(World worldIn, double x, double y, double z, EntityMinecart.EnumMinecartType type) + { + switch (type) + { + case CHEST: + return new EntityMinecartChest(worldIn, x, y, z); + + case FURNACE: + return new EntityMinecartFurnace(worldIn, x, y, z); + + case TNT: + return new EntityMinecartTNT(worldIn, x, y, z); + + case SPAWNER: + return new EntityMinecartMobSpawner(worldIn, x, y, z); + + case HOPPER: + return new EntityMinecartHopper(worldIn, x, y, z); + + case COMMAND_BLOCK: + return new EntityMinecartCommandBlock(worldIn, x, y, z); + + default: + return new EntityMinecartEmpty(worldIn, x, y, z); + } + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + this.dataWatcher.addObject(20, new Integer(0)); + this.dataWatcher.addObject(21, new Integer(6)); + this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); + } + + public AxisAlignedBB getCollisionBox(Entity entityIn) + { + return entityIn.canBePushed() ? entityIn.getEntityBoundingBox() : null; + } + + public AxisAlignedBB getCollisionBoundingBox() + { + return null; + } + + public boolean canBePushed() + { + return true; + } + + public EntityMinecart(World worldIn, double x, double y, double z) + { + this(worldIn); + this.setPosition(x, y, z); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = x; + this.prevPosY = y; + this.prevPosZ = z; + } + + public double getMountedYOffset() + { + return 0.0D; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (!this.worldObj.isRemote && !this.isDead) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setBeenAttacked(); + this.setDamage(this.getDamage() + amount * 10.0F); + boolean flag = source.getEntity() instanceof EntityPlayer && ((EntityPlayer)source.getEntity()).capabilities.isCreativeMode; + + if (flag || this.getDamage() > 40.0F) + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity((Entity)null); + } + + if (flag && !this.hasCustomName()) + { + this.setDead(); + } + else + { + this.killMinecart(source); + } + } + + return true; + } + } + else + { + return true; + } + } + + public void killMinecart(DamageSource source) + { + this.setDead(); + + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + ItemStack itemstack = new ItemStack(Items.minecart, 1); + + if (this.entityName != null) + { + itemstack.setStackDisplayName(this.entityName); + } + + this.entityDropItem(itemstack, 0.0F); + } + } + + public void performHurtAnimation() + { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setDamage(this.getDamage() + this.getDamage() * 10.0F); + } + + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + public void setDead() + { + super.setDead(); + } + + public void onUpdate() + { + if (this.getRollingAmplitude() > 0) + { + this.setRollingAmplitude(this.getRollingAmplitude() - 1); + } + + if (this.getDamage() > 0.0F) + { + this.setDamage(this.getDamage() - 1.0F); + } + + if (this.posY < -64.0D) + { + this.kill(); + } + + if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) + { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer minecraftserver = ((WorldServer)this.worldObj).getMinecraftServer(); + int i = this.getMaxInPortalTime(); + + if (this.inPortal) + { + if (minecraftserver.getAllowNether()) + { + if (this.ridingEntity == null && this.portalCounter++ >= i) + { + this.portalCounter = i; + this.timeUntilPortal = this.getPortalCooldown(); + int j; + + if (this.worldObj.provider.getDimensionId() == -1) + { + j = 0; + } + else + { + j = -1; + } + + this.travelToDimension(j); + } + + this.inPortal = false; + } + } + else + { + if (this.portalCounter > 0) + { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) + { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) + { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + if (this.worldObj.isRemote) + { + if (this.turnProgress > 0) + { + double d4 = this.posX + (this.minecartX - this.posX) / (double)this.turnProgress; + double d5 = this.posY + (this.minecartY - this.posY) / (double)this.turnProgress; + double d6 = this.posZ + (this.minecartZ - this.posZ) / (double)this.turnProgress; + double d1 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d1 / (double)this.turnProgress); + this.rotationPitch = (float)((double)this.rotationPitch + (this.minecartPitch - (double)this.rotationPitch) / (double)this.turnProgress); + --this.turnProgress; + this.setPosition(d4, d5, d6); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else + { + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } + else + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + int k = MathHelper.floor_double(this.posX); + int l = MathHelper.floor_double(this.posY); + int i1 = MathHelper.floor_double(this.posZ); + + if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(k, l - 1, i1))) + { + --l; + } + + BlockPos blockpos = new BlockPos(k, l, i1); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + + if (BlockRailBase.isRailBlock(iblockstate)) + { + this.func_180460_a(blockpos, iblockstate); + + if (iblockstate.getBlock() == Blocks.activator_rail) + { + this.onActivatorRailPass(k, l, i1, ((Boolean)iblockstate.getValue(BlockRailPowered.POWERED)).booleanValue()); + } + } + else + { + this.moveDerailedMinecart(); + } + + this.doBlockCollisions(); + this.rotationPitch = 0.0F; + double d0 = this.prevPosX - this.posX; + double d2 = this.prevPosZ - this.posZ; + + if (d0 * d0 + d2 * d2 > 0.001D) + { + this.rotationYaw = (float)(MathHelper.atan2(d2, d0) * 180.0D / Math.PI); + + if (this.isInReverse) + { + this.rotationYaw += 180.0F; + } + } + + double d3 = (double)MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); + + if (d3 < -170.0D || d3 >= 170.0D) + { + this.rotationYaw += 180.0F; + this.isInReverse = !this.isInReverse; + } + + this.setRotation(this.rotationYaw, this.rotationPitch); + + for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D))) + { + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityMinecart) + { + entity.applyEntityCollision(this); + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) + { + if (this.riddenByEntity.ridingEntity == this) + { + this.riddenByEntity.ridingEntity = null; + } + + this.riddenByEntity = null; + } + + this.handleWaterMovement(); + } + } + + protected double getMaximumSpeed() + { + return 0.4D; + } + + public void onActivatorRailPass(int x, int y, int z, boolean receivingPower) + { + } + + protected void moveDerailedMinecart() + { + double d0 = this.getMaximumSpeed(); + this.motionX = MathHelper.clamp_double(this.motionX, -d0, d0); + this.motionZ = MathHelper.clamp_double(this.motionZ, -d0, d0); + + if (this.onGround) + { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (!this.onGround) + { + this.motionX *= 0.949999988079071D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.949999988079071D; + } + } + + @SuppressWarnings("incomplete-switch") + protected void func_180460_a(BlockPos p_180460_1_, IBlockState p_180460_2_) + { + this.fallDistance = 0.0F; + Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ); + this.posY = (double)p_180460_1_.getY(); + boolean flag = false; + boolean flag1 = false; + BlockRailBase blockrailbase = (BlockRailBase)p_180460_2_.getBlock(); + + if (blockrailbase == Blocks.golden_rail) + { + flag = ((Boolean)p_180460_2_.getValue(BlockRailPowered.POWERED)).booleanValue(); + flag1 = !flag; + } + + double d0 = 0.0078125D; + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.getValue(blockrailbase.getShapeProperty()); + + switch (blockrailbase$enumraildirection) + { + case ASCENDING_EAST: + this.motionX -= 0.0078125D; + ++this.posY; + break; + + case ASCENDING_WEST: + this.motionX += 0.0078125D; + ++this.posY; + break; + + case ASCENDING_NORTH: + this.motionZ += 0.0078125D; + ++this.posY; + break; + + case ASCENDING_SOUTH: + this.motionZ -= 0.0078125D; + ++this.posY; + } + + int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()]; + double d1 = (double)(aint[1][0] - aint[0][0]); + double d2 = (double)(aint[1][2] - aint[0][2]); + double d3 = Math.sqrt(d1 * d1 + d2 * d2); + double d4 = this.motionX * d1 + this.motionZ * d2; + + if (d4 < 0.0D) + { + d1 = -d1; + d2 = -d2; + } + + double d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d5 > 2.0D) + { + d5 = 2.0D; + } + + this.motionX = d5 * d1 / d3; + this.motionZ = d5 * d2 / d3; + + if (this.riddenByEntity instanceof EntityLivingBase) + { + double d6 = (double)((EntityLivingBase)this.riddenByEntity).moveForward; + + if (d6 > 0.0D) + { + double d7 = -Math.sin((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); + double d8 = Math.cos((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); + double d9 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (d9 < 0.01D) + { + this.motionX += d7 * 0.1D; + this.motionZ += d8 * 0.1D; + flag1 = false; + } + } + } + + if (flag1) + { + double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d17 < 0.03D) + { + this.motionX *= 0.0D; + this.motionY *= 0.0D; + this.motionZ *= 0.0D; + } + else + { + this.motionX *= 0.5D; + this.motionY *= 0.0D; + this.motionZ *= 0.5D; + } + } + + double d18 = 0.0D; + double d19 = (double)p_180460_1_.getX() + 0.5D + (double)aint[0][0] * 0.5D; + double d20 = (double)p_180460_1_.getZ() + 0.5D + (double)aint[0][2] * 0.5D; + double d21 = (double)p_180460_1_.getX() + 0.5D + (double)aint[1][0] * 0.5D; + double d10 = (double)p_180460_1_.getZ() + 0.5D + (double)aint[1][2] * 0.5D; + d1 = d21 - d19; + d2 = d10 - d20; + + if (d1 == 0.0D) + { + this.posX = (double)p_180460_1_.getX() + 0.5D; + d18 = this.posZ - (double)p_180460_1_.getZ(); + } + else if (d2 == 0.0D) + { + this.posZ = (double)p_180460_1_.getZ() + 0.5D; + d18 = this.posX - (double)p_180460_1_.getX(); + } + else + { + double d11 = this.posX - d19; + double d12 = this.posZ - d20; + d18 = (d11 * d1 + d12 * d2) * 2.0D; + } + + this.posX = d19 + d1 * d18; + this.posZ = d20 + d2 * d18; + this.setPosition(this.posX, this.posY, this.posZ); + double d22 = this.motionX; + double d23 = this.motionZ; + + if (this.riddenByEntity != null) + { + d22 *= 0.75D; + d23 *= 0.75D; + } + + double d13 = this.getMaximumSpeed(); + d22 = MathHelper.clamp_double(d22, -d13, d13); + d23 = MathHelper.clamp_double(d23, -d13, d13); + this.moveEntity(d22, 0.0D, d23); + + if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[0][0] && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[0][2]) + { + this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); + } + else if (aint[1][1] != 0 && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[1][0] && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[1][2]) + { + this.setPosition(this.posX, this.posY + (double)aint[1][1], this.posZ); + } + + this.applyDrag(); + Vec3 vec31 = this.func_70489_a(this.posX, this.posY, this.posZ); + + if (vec31 != null && vec3 != null) + { + double d14 = (vec3.yCoord - vec31.yCoord) * 0.05D; + d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d5 > 0.0D) + { + this.motionX = this.motionX / d5 * (d5 + d14); + this.motionZ = this.motionZ / d5 * (d5 + d14); + } + + this.setPosition(this.posX, vec31.yCoord, this.posZ); + } + + int j = MathHelper.floor_double(this.posX); + int i = MathHelper.floor_double(this.posZ); + + if (j != p_180460_1_.getX() || i != p_180460_1_.getZ()) + { + d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.motionX = d5 * (double)(j - p_180460_1_.getX()); + this.motionZ = d5 * (double)(i - p_180460_1_.getZ()); + } + + if (flag) + { + double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d15 > 0.01D) + { + double d16 = 0.06D; + this.motionX += this.motionX / d15 * d16; + this.motionZ += this.motionZ / d15 * d16; + } + else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) + { + if (this.worldObj.getBlockState(p_180460_1_.west()).getBlock().isNormalCube()) + { + this.motionX = 0.02D; + } + else if (this.worldObj.getBlockState(p_180460_1_.east()).getBlock().isNormalCube()) + { + this.motionX = -0.02D; + } + } + else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) + { + if (this.worldObj.getBlockState(p_180460_1_.north()).getBlock().isNormalCube()) + { + this.motionZ = 0.02D; + } + else if (this.worldObj.getBlockState(p_180460_1_.south()).getBlock().isNormalCube()) + { + this.motionZ = -0.02D; + } + } + } + } + + protected void applyDrag() + { + if (this.riddenByEntity != null) + { + this.motionX *= 0.996999979019165D; + this.motionY *= 0.0D; + this.motionZ *= 0.996999979019165D; + } + else + { + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.0D; + this.motionZ *= 0.9599999785423279D; + } + } + + public void setPosition(double x, double y, double z) + { + this.posX = x; + this.posY = y; + this.posZ = z; + float f = this.width / 2.0F; + float f1 = this.height; + this.setEntityBoundingBox(new AxisAlignedBB(x - (double)f, y, z - (double)f, x + (double)f, y + (double)f1, z + (double)f)); + } + + public Vec3 func_70495_a(double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_) + { + int i = MathHelper.floor_double(p_70495_1_); + int j = MathHelper.floor_double(p_70495_3_); + int k = MathHelper.floor_double(p_70495_5_); + + if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) + { + --j; + } + + IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k)); + + if (BlockRailBase.isRailBlock(iblockstate)) + { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()); + p_70495_3_ = (double)j; + + if (blockrailbase$enumraildirection.isAscending()) + { + p_70495_3_ = (double)(j + 1); + } + + int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()]; + double d0 = (double)(aint[1][0] - aint[0][0]); + double d1 = (double)(aint[1][2] - aint[0][2]); + double d2 = Math.sqrt(d0 * d0 + d1 * d1); + d0 = d0 / d2; + d1 = d1 / d2; + p_70495_1_ = p_70495_1_ + d0 * p_70495_7_; + p_70495_5_ = p_70495_5_ + d1 * p_70495_7_; + + if (aint[0][1] != 0 && MathHelper.floor_double(p_70495_1_) - i == aint[0][0] && MathHelper.floor_double(p_70495_5_) - k == aint[0][2]) + { + p_70495_3_ += (double)aint[0][1]; + } + else if (aint[1][1] != 0 && MathHelper.floor_double(p_70495_1_) - i == aint[1][0] && MathHelper.floor_double(p_70495_5_) - k == aint[1][2]) + { + p_70495_3_ += (double)aint[1][1]; + } + + return this.func_70489_a(p_70495_1_, p_70495_3_, p_70495_5_); + } + else + { + return null; + } + } + + public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_) + { + int i = MathHelper.floor_double(p_70489_1_); + int j = MathHelper.floor_double(p_70489_3_); + int k = MathHelper.floor_double(p_70489_5_); + + if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) + { + --j; + } + + IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k)); + + if (BlockRailBase.isRailBlock(iblockstate)) + { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()); + int[][] aint = matrix[blockrailbase$enumraildirection.getMetadata()]; + double d0 = 0.0D; + double d1 = (double)i + 0.5D + (double)aint[0][0] * 0.5D; + double d2 = (double)j + 0.0625D + (double)aint[0][1] * 0.5D; + double d3 = (double)k + 0.5D + (double)aint[0][2] * 0.5D; + double d4 = (double)i + 0.5D + (double)aint[1][0] * 0.5D; + double d5 = (double)j + 0.0625D + (double)aint[1][1] * 0.5D; + double d6 = (double)k + 0.5D + (double)aint[1][2] * 0.5D; + double d7 = d4 - d1; + double d8 = (d5 - d2) * 2.0D; + double d9 = d6 - d3; + + if (d7 == 0.0D) + { + p_70489_1_ = (double)i + 0.5D; + d0 = p_70489_5_ - (double)k; + } + else if (d9 == 0.0D) + { + p_70489_5_ = (double)k + 0.5D; + d0 = p_70489_1_ - (double)i; + } + else + { + double d10 = p_70489_1_ - d1; + double d11 = p_70489_5_ - d3; + d0 = (d10 * d7 + d11 * d9) * 2.0D; + } + + p_70489_1_ = d1 + d7 * d0; + p_70489_3_ = d2 + d8 * d0; + p_70489_5_ = d3 + d9 * d0; + + if (d8 < 0.0D) + { + ++p_70489_3_; + } + + if (d8 > 0.0D) + { + p_70489_3_ += 0.5D; + } + + return new Vec3(p_70489_1_, p_70489_3_, p_70489_5_); + } + else + { + return null; + } + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + if (tagCompund.getBoolean("CustomDisplayTile")) + { + int i = tagCompund.getInteger("DisplayData"); + + if (tagCompund.hasKey("DisplayTile", 8)) + { + Block block = Block.getBlockFromName(tagCompund.getString("DisplayTile")); + + if (block == null) + { + this.func_174899_a(Blocks.air.getDefaultState()); + } + else + { + this.func_174899_a(block.getStateFromMeta(i)); + } + } + else + { + Block block1 = Block.getBlockById(tagCompund.getInteger("DisplayTile")); + + if (block1 == null) + { + this.func_174899_a(Blocks.air.getDefaultState()); + } + else + { + this.func_174899_a(block1.getStateFromMeta(i)); + } + } + + this.setDisplayTileOffset(tagCompund.getInteger("DisplayOffset")); + } + + if (tagCompund.hasKey("CustomName", 8) && tagCompund.getString("CustomName").length() > 0) + { + this.entityName = tagCompund.getString("CustomName"); + } + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + if (this.hasDisplayTile()) + { + tagCompound.setBoolean("CustomDisplayTile", true); + IBlockState iblockstate = this.getDisplayTile(); + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(iblockstate.getBlock()); + tagCompound.setString("DisplayTile", resourcelocation == null ? "" : resourcelocation.toString()); + tagCompound.setInteger("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate)); + tagCompound.setInteger("DisplayOffset", this.getDisplayTileOffset()); + } + + if (this.entityName != null && this.entityName.length() > 0) + { + tagCompound.setString("CustomName", this.entityName); + } + } + + public void applyEntityCollision(Entity entityIn) + { + if (!this.worldObj.isRemote) + { + if (!entityIn.noClip && !this.noClip) + { + if (entityIn != this.riddenByEntity) + { + if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null) + { + entityIn.mountEntity(this); + } + + double d0 = entityIn.posX - this.posX; + double d1 = entityIn.posZ - this.posZ; + double d2 = d0 * d0 + d1 * d1; + + if (d2 >= 9.999999747378752E-5D) + { + d2 = (double)MathHelper.sqrt_double(d2); + d0 = d0 / d2; + d1 = d1 / d2; + double d3 = 1.0D / d2; + + if (d3 > 1.0D) + { + d3 = 1.0D; + } + + d0 = d0 * d3; + d1 = d1 * d3; + d0 = d0 * 0.10000000149011612D; + d1 = d1 * 0.10000000149011612D; + d0 = d0 * (double)(1.0F - this.entityCollisionReduction); + d1 = d1 * (double)(1.0F - this.entityCollisionReduction); + d0 = d0 * 0.5D; + d1 = d1 * 0.5D; + + if (entityIn instanceof EntityMinecart) + { + double d4 = entityIn.posX - this.posX; + double d5 = entityIn.posZ - this.posZ; + Vec3 vec3 = (new Vec3(d4, 0.0D, d5)).normalize(); + Vec3 vec31 = (new Vec3((double)MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F), 0.0D, (double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F))).normalize(); + double d6 = Math.abs(vec3.dotProduct(vec31)); + + if (d6 < 0.800000011920929D) + { + return; + } + + double d7 = entityIn.motionX + this.motionX; + double d8 = entityIn.motionZ + this.motionZ; + + if (((EntityMinecart)entityIn).getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE) + { + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(entityIn.motionX - d0, 0.0D, entityIn.motionZ - d1); + entityIn.motionX *= 0.949999988079071D; + entityIn.motionZ *= 0.949999988079071D; + } + else if (((EntityMinecart)entityIn).getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE) + { + entityIn.motionX *= 0.20000000298023224D; + entityIn.motionZ *= 0.20000000298023224D; + entityIn.addVelocity(this.motionX + d0, 0.0D, this.motionZ + d1); + this.motionX *= 0.949999988079071D; + this.motionZ *= 0.949999988079071D; + } + else + { + d7 = d7 / 2.0D; + d8 = d8 / 2.0D; + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(d7 - d0, 0.0D, d8 - d1); + entityIn.motionX *= 0.20000000298023224D; + entityIn.motionZ *= 0.20000000298023224D; + entityIn.addVelocity(d7 + d0, 0.0D, d8 + d1); + } + } + else + { + this.addVelocity(-d0, 0.0D, -d1); + entityIn.addVelocity(d0 / 4.0D, 0.0D, d1 / 4.0D); + } + } + } + } + } + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) + { + this.minecartX = x; + this.minecartY = y; + this.minecartZ = z; + this.minecartYaw = (double)yaw; + this.minecartPitch = (double)pitch; + this.turnProgress = posRotationIncrements + 2; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + public void setVelocity(double x, double y, double z) + { + this.velocityX = this.motionX = x; + this.velocityY = this.motionY = y; + this.velocityZ = this.motionZ = z; + } + + public void setDamage(float p_70492_1_) + { + this.dataWatcher.updateObject(19, Float.valueOf(p_70492_1_)); + } + + public float getDamage() + { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + public void setRollingAmplitude(int p_70497_1_) + { + this.dataWatcher.updateObject(17, Integer.valueOf(p_70497_1_)); + } + + public int getRollingAmplitude() + { + return this.dataWatcher.getWatchableObjectInt(17); + } + + public void setRollingDirection(int p_70494_1_) + { + this.dataWatcher.updateObject(18, Integer.valueOf(p_70494_1_)); + } + + public int getRollingDirection() + { + return this.dataWatcher.getWatchableObjectInt(18); + } + + public abstract EntityMinecart.EnumMinecartType getMinecartType(); + + public IBlockState getDisplayTile() + { + return !this.hasDisplayTile() ? this.getDefaultDisplayTile() : Block.getStateById(this.getDataWatcher().getWatchableObjectInt(20)); + } + + public IBlockState getDefaultDisplayTile() + { + return Blocks.air.getDefaultState(); + } + + public int getDisplayTileOffset() + { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileOffset() : this.getDataWatcher().getWatchableObjectInt(21); + } + + public int getDefaultDisplayTileOffset() + { + return 6; + } + + public void func_174899_a(IBlockState p_174899_1_) + { + this.getDataWatcher().updateObject(20, Integer.valueOf(Block.getStateId(p_174899_1_))); + this.setHasDisplayTile(true); + } + + public void setDisplayTileOffset(int p_94086_1_) + { + this.getDataWatcher().updateObject(21, Integer.valueOf(p_94086_1_)); + this.setHasDisplayTile(true); + } + + public boolean hasDisplayTile() + { + return this.getDataWatcher().getWatchableObjectByte(22) == 1; + } + + public void setHasDisplayTile(boolean p_94096_1_) + { + this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(p_94096_1_ ? 1 : 0))); + } + + public void setCustomNameTag(String name) + { + this.entityName = name; + } + + public String getName() + { + return this.entityName != null ? this.entityName : super.getName(); + } + + public boolean hasCustomName() + { + return this.entityName != null; + } + + public String getCustomNameTag() + { + return this.entityName; + } + + public IChatComponent getDisplayName() + { + if (this.hasCustomName()) + { + ChatComponentText chatcomponenttext = new ChatComponentText(this.entityName); + chatcomponenttext.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttext.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttext; + } + else + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(this.getName(), new Object[0]); + chatcomponenttranslation.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttranslation.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttranslation; + } + } + + public static enum EnumMinecartType + { + RIDEABLE(0, "MinecartRideable"), + CHEST(1, "MinecartChest"), + FURNACE(2, "MinecartFurnace"), + TNT(3, "MinecartTNT"), + SPAWNER(4, "MinecartSpawner"), + HOPPER(5, "MinecartHopper"), + COMMAND_BLOCK(6, "MinecartCommandBlock"); + + private static final Map ID_LOOKUP = Maps.newHashMap(); + private final int networkID; + private final String name; + + private EnumMinecartType(int networkID, String name) + { + this.networkID = networkID; + this.name = name; + } + + public int getNetworkID() + { + return this.networkID; + } + + public String getName() + { + return this.name; + } + + public static EntityMinecart.EnumMinecartType byNetworkID(int id) + { + EntityMinecart.EnumMinecartType entityminecart$enumminecarttype = (EntityMinecart.EnumMinecartType)ID_LOOKUP.get(Integer.valueOf(id)); + return entityminecart$enumminecarttype == null ? RIDEABLE : entityminecart$enumminecarttype; + } + + static { + for (EntityMinecart.EnumMinecartType entityminecart$enumminecarttype : values()) + { + ID_LOOKUP.put(Integer.valueOf(entityminecart$enumminecarttype.getNetworkID()), entityminecart$enumminecarttype); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java new file mode 100644 index 0000000..5f0b500 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java @@ -0,0 +1,66 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.BlockChest; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class EntityMinecartChest extends EntityMinecartContainer +{ + public EntityMinecartChest(World worldIn) + { + super(worldIn); + } + + public EntityMinecartChest(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + public void killMinecart(DamageSource source) + { + super.killMinecart(source); + + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.chest), 1, 0.0F); + } + } + + public int getSizeInventory() + { + return 27; + } + + public EntityMinecart.EnumMinecartType getMinecartType() + { + return EntityMinecart.EnumMinecartType.CHEST; + } + + public IBlockState getDefaultDisplayTile() + { + return Blocks.chest.getDefaultState().withProperty(BlockChest.FACING, EnumFacing.NORTH); + } + + public int getDefaultDisplayTileOffset() + { + return 8; + } + + public String getGuiID() + { + return "minecraft:chest"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerChest(playerInventory, this, playerIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java new file mode 100644 index 0000000..676c632 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java @@ -0,0 +1,235 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.LockCode; +import net.minecraft.world.World; + +public abstract class EntityMinecartContainer extends EntityMinecart implements ILockableContainer +{ + private ItemStack[] minecartContainerItems = new ItemStack[36]; + private boolean dropContentsWhenDead = true; + + public EntityMinecartContainer(World worldIn) + { + super(worldIn); + } + + public EntityMinecartContainer(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + public void killMinecart(DamageSource source) + { + super.killMinecart(source); + + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + InventoryHelper.dropInventoryItems(this.worldObj, this, this); + } + } + + public ItemStack getStackInSlot(int index) + { + return this.minecartContainerItems[index]; + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.minecartContainerItems[index] != null) + { + if (this.minecartContainerItems[index].stackSize <= count) + { + ItemStack itemstack1 = this.minecartContainerItems[index]; + this.minecartContainerItems[index] = null; + return itemstack1; + } + else + { + ItemStack itemstack = this.minecartContainerItems[index].splitStack(count); + + if (this.minecartContainerItems[index].stackSize == 0) + { + this.minecartContainerItems[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.minecartContainerItems[index] != null) + { + ItemStack itemstack = this.minecartContainerItems[index]; + this.minecartContainerItems[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.minecartContainerItems[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + } + + public void markDirty() + { + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.isDead ? false : player.getDistanceSqToEntity(this) <= 64.0D; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public String getName() + { + return this.hasCustomName() ? this.getCustomNameTag() : "container.minecart"; + } + + public int getInventoryStackLimit() + { + return 64; + } + + public void travelToDimension(int dimensionId) + { + this.dropContentsWhenDead = false; + super.travelToDimension(dimensionId); + } + + public void setDead() + { + if (this.dropContentsWhenDead) + { + InventoryHelper.dropInventoryItems(this.worldObj, this, this); + } + + super.setDead(); + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.minecartContainerItems.length; ++i) + { + if (this.minecartContainerItems[i] != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.minecartContainerItems[i].writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + tagCompound.setTag("Items", nbttaglist); + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + NBTTagList nbttaglist = tagCompund.getTagList("Items", 10); + this.minecartContainerItems = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + + if (j >= 0 && j < this.minecartContainerItems.length) + { + this.minecartContainerItems[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); + } + } + } + + public boolean interactFirst(EntityPlayer playerIn) + { + if (!this.worldObj.isRemote) + { + playerIn.displayGUIChest(this); + } + + return true; + } + + protected void applyDrag() + { + int i = 15 - Container.calcRedstoneFromInventory(this); + float f = 0.98F + (float)i * 0.001F; + this.motionX *= (double)f; + this.motionY *= 0.0D; + this.motionZ *= (double)f; + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public boolean isLocked() + { + return false; + } + + public void setLockCode(LockCode code) + { + } + + public LockCode getLockCode() + { + return LockCode.EMPTY_CODE; + } + + public void clear() + { + for (int i = 0; i < this.minecartContainerItems.length; ++i) + { + this.minecartContainerItems[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java new file mode 100644 index 0000000..e57c59b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -0,0 +1,63 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class EntityMinecartEmpty extends EntityMinecart +{ + public EntityMinecartEmpty(World worldIn) + { + super(worldIn); + } + + public EntityMinecartEmpty(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + public boolean interactFirst(EntityPlayer playerIn) + { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != playerIn) + { + return true; + } + else if (this.riddenByEntity != null && this.riddenByEntity != playerIn) + { + return false; + } + else + { + if (!this.worldObj.isRemote) + { + playerIn.mountEntity(this); + } + + return true; + } + } + + public void onActivatorRailPass(int x, int y, int z, boolean receivingPower) + { + if (receivingPower) + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity((Entity)null); + } + + if (this.getRollingAmplitude() == 0) + { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setDamage(50.0F); + this.setBeenAttacked(); + } + } + } + + public EntityMinecart.EnumMinecartType getMinecartType() + { + return EntityMinecart.EnumMinecartType.RIDEABLE; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java new file mode 100644 index 0000000..8601896 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java @@ -0,0 +1,188 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityMinecartFurnace extends EntityMinecart +{ + private int fuel; + public double pushX; + public double pushZ; + + public EntityMinecartFurnace(World worldIn) + { + super(worldIn); + } + + public EntityMinecartFurnace(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + public EntityMinecart.EnumMinecartType getMinecartType() + { + return EntityMinecart.EnumMinecartType.FURNACE; + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.fuel > 0) + { + --this.fuel; + } + + if (this.fuel <= 0) + { + this.pushX = this.pushZ = 0.0D; + } + + this.setMinecartPowered(this.fuel > 0); + + if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) + { + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + protected double getMaximumSpeed() + { + return 0.2D; + } + + public void killMinecart(DamageSource source) + { + super.killMinecart(source); + + if (!source.isExplosion() && this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + this.entityDropItem(new ItemStack(Blocks.furnace, 1), 0.0F); + } + } + + protected void func_180460_a(BlockPos p_180460_1_, IBlockState p_180460_2_) + { + super.func_180460_a(p_180460_1_, p_180460_2_); + double d0 = this.pushX * this.pushX + this.pushZ * this.pushZ; + + if (d0 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) + { + d0 = (double)MathHelper.sqrt_double(d0); + this.pushX /= d0; + this.pushZ /= d0; + + if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) + { + this.pushX = 0.0D; + this.pushZ = 0.0D; + } + else + { + double d1 = d0 / this.getMaximumSpeed(); + this.pushX *= d1; + this.pushZ *= d1; + } + } + } + + protected void applyDrag() + { + double d0 = this.pushX * this.pushX + this.pushZ * this.pushZ; + + if (d0 > 1.0E-4D) + { + d0 = (double)MathHelper.sqrt_double(d0); + this.pushX /= d0; + this.pushZ /= d0; + double d1 = 1.0D; + this.motionX *= 0.800000011920929D; + this.motionY *= 0.0D; + this.motionZ *= 0.800000011920929D; + this.motionX += this.pushX * d1; + this.motionZ += this.pushZ * d1; + } + else + { + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.0D; + this.motionZ *= 0.9800000190734863D; + } + + super.applyDrag(); + } + + public boolean interactFirst(EntityPlayer playerIn) + { + ItemStack itemstack = playerIn.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.coal) + { + if (!playerIn.capabilities.isCreativeMode && --itemstack.stackSize == 0) + { + playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, (ItemStack)null); + } + + this.fuel += 3600; + } + + this.pushX = this.posX - playerIn.posX; + this.pushZ = this.posZ - playerIn.posZ; + return true; + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setDouble("PushX", this.pushX); + tagCompound.setDouble("PushZ", this.pushZ); + tagCompound.setShort("Fuel", (short)this.fuel); + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.pushX = tagCompund.getDouble("PushX"); + this.pushZ = tagCompund.getDouble("PushZ"); + this.fuel = tagCompund.getShort("Fuel"); + } + + protected boolean isMinecartPowered() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + protected void setMinecartPowered(boolean p_94107_1_) + { + if (p_94107_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) & -2))); + } + } + + public IBlockState getDefaultDisplayTile() + { + return (this.isMinecartPowered() ? Blocks.lit_furnace : Blocks.furnace).getDefaultState().withProperty(BlockFurnace.FACING, EnumFacing.NORTH); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java new file mode 100644 index 0000000..0d74d00 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java @@ -0,0 +1,195 @@ +package net.minecraft.entity.item; + +import java.util.List; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerHopper; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.IHopper; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntitySelectors; +import net.minecraft.world.World; + +public class EntityMinecartHopper extends EntityMinecartContainer implements IHopper +{ + private boolean isBlocked = true; + private int transferTicker = -1; + private BlockPos field_174900_c = BlockPos.ORIGIN; + + public EntityMinecartHopper(World worldIn) + { + super(worldIn); + } + + public EntityMinecartHopper(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + public EntityMinecart.EnumMinecartType getMinecartType() + { + return EntityMinecart.EnumMinecartType.HOPPER; + } + + public IBlockState getDefaultDisplayTile() + { + return Blocks.hopper.getDefaultState(); + } + + public int getDefaultDisplayTileOffset() + { + return 1; + } + + public int getSizeInventory() + { + return 5; + } + + public boolean interactFirst(EntityPlayer playerIn) + { + if (!this.worldObj.isRemote) + { + playerIn.displayGUIChest(this); + } + + return true; + } + + public void onActivatorRailPass(int x, int y, int z, boolean receivingPower) + { + boolean flag = !receivingPower; + + if (flag != this.getBlocked()) + { + this.setBlocked(flag); + } + } + + public boolean getBlocked() + { + return this.isBlocked; + } + + public void setBlocked(boolean p_96110_1_) + { + this.isBlocked = p_96110_1_; + } + + public World getWorld() + { + return this.worldObj; + } + + public double getXPos() + { + return this.posX; + } + + public double getYPos() + { + return this.posY + 0.5D; + } + + public double getZPos() + { + return this.posZ; + } + + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked()) + { + BlockPos blockpos = new BlockPos(this); + + if (blockpos.equals(this.field_174900_c)) + { + --this.transferTicker; + } + else + { + this.setTransferTicker(0); + } + + if (!this.canTransfer()) + { + this.setTransferTicker(0); + + if (this.func_96112_aD()) + { + this.setTransferTicker(4); + this.markDirty(); + } + } + } + } + + public boolean func_96112_aD() + { + if (TileEntityHopper.captureDroppedItems(this)) + { + return true; + } + else + { + List list = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.getEntityBoundingBox().expand(0.25D, 0.0D, 0.25D), EntitySelectors.selectAnything); + + if (list.size() > 0) + { + TileEntityHopper.putDropInInventoryAllSlots(this, (EntityItem)list.get(0)); + } + + return false; + } + } + + public void killMinecart(DamageSource source) + { + super.killMinecart(source); + + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.hopper), 1, 0.0F); + } + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("TransferCooldown", this.transferTicker); + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.transferTicker = tagCompund.getInteger("TransferCooldown"); + } + + public void setTransferTicker(int p_98042_1_) + { + this.transferTicker = p_98042_1_; + } + + public boolean canTransfer() + { + return this.transferTicker > 0; + } + + public String getGuiID() + { + return "minecraft:hopper"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerHopper(playerInventory, this, playerIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java new file mode 100644 index 0000000..10985e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java @@ -0,0 +1,195 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityMinecartTNT extends EntityMinecart +{ + private int minecartTNTFuse = -1; + + public EntityMinecartTNT(World worldIn) + { + super(worldIn); + } + + public EntityMinecartTNT(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + public EntityMinecart.EnumMinecartType getMinecartType() + { + return EntityMinecart.EnumMinecartType.TNT; + } + + public IBlockState getDefaultDisplayTile() + { + return Blocks.tnt.getDefaultState(); + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.minecartTNTFuse > 0) + { + --this.minecartTNTFuse; + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + } + else if (this.minecartTNTFuse == 0) + { + this.explodeCart(this.motionX * this.motionX + this.motionZ * this.motionZ); + } + + if (this.isCollidedHorizontally) + { + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (d0 >= 0.009999999776482582D) + { + this.explodeCart(d0); + } + } + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + Entity entity = source.getSourceOfDamage(); + + if (entity instanceof EntityArrow) + { + EntityArrow entityarrow = (EntityArrow)entity; + + if (entityarrow.isBurning()) + { + this.explodeCart(entityarrow.motionX * entityarrow.motionX + entityarrow.motionY * entityarrow.motionY + entityarrow.motionZ * entityarrow.motionZ); + } + } + + return super.attackEntityFrom(source, amount); + } + + public void killMinecart(DamageSource source) + { + super.killMinecart(source); + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (!source.isExplosion() && this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + this.entityDropItem(new ItemStack(Blocks.tnt, 1), 0.0F); + } + + if (source.isFireDamage() || source.isExplosion() || d0 >= 0.009999999776482582D) + { + this.explodeCart(d0); + } + } + + protected void explodeCart(double p_94103_1_) + { + if (!this.worldObj.isRemote) + { + double d0 = Math.sqrt(p_94103_1_); + + if (d0 > 5.0D) + { + d0 = 5.0D; + } + + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.rand.nextDouble() * 1.5D * d0), true); + this.setDead(); + } + } + + public void fall(float distance, float damageMultiplier) + { + if (distance >= 3.0F) + { + float f = distance / 10.0F; + this.explodeCart((double)(f * f)); + } + + super.fall(distance, damageMultiplier); + } + + public void onActivatorRailPass(int x, int y, int z, boolean receivingPower) + { + if (receivingPower && this.minecartTNTFuse < 0) + { + this.ignite(); + } + } + + public void handleStatusUpdate(byte id) + { + if (id == 10) + { + this.ignite(); + } + else + { + super.handleStatusUpdate(id); + } + } + + public void ignite() + { + this.minecartTNTFuse = 80; + + if (!this.worldObj.isRemote) + { + this.worldObj.setEntityState(this, (byte)10); + + if (!this.isSilent()) + { + this.worldObj.playSoundAtEntity(this, "game.tnt.primed", 1.0F, 1.0F); + } + } + } + + public int getFuseTicks() + { + return this.minecartTNTFuse; + } + + public boolean isIgnited() + { + return this.minecartTNTFuse > -1; + } + + public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) + { + return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn) : 0.0F; + } + + public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) + { + return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.verifyExplosion(explosionIn, worldIn, pos, blockStateIn, p_174816_5_) : false; + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("TNTFuse", 99)) + { + this.minecartTNTFuse = tagCompund.getInteger("TNTFuse"); + } + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("TNTFuse", this.minecartTNTFuse); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityPainting.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityPainting.java new file mode 100644 index 0000000..687e21d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityPainting.java @@ -0,0 +1,175 @@ +package net.minecraft.entity.item; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class EntityPainting extends EntityHanging +{ + public EntityPainting.EnumArt art; + + public EntityPainting(World worldIn) + { + super(worldIn); + } + + public EntityPainting(World worldIn, BlockPos pos, EnumFacing facing) + { + super(worldIn, pos); + List list = Lists.newArrayList(); + + for (EntityPainting.EnumArt entitypainting$enumart : EntityPainting.EnumArt.values()) + { + this.art = entitypainting$enumart; + this.updateFacingWithBoundingBox(facing); + + if (this.onValidSurface()) + { + list.add(entitypainting$enumart); + } + } + + if (!list.isEmpty()) + { + this.art = (EntityPainting.EnumArt)list.get(this.rand.nextInt(list.size())); + } + + this.updateFacingWithBoundingBox(facing); + } + + public EntityPainting(World worldIn, BlockPos pos, EnumFacing facing, String title) + { + this(worldIn, pos, facing); + + for (EntityPainting.EnumArt entitypainting$enumart : EntityPainting.EnumArt.values()) + { + if (entitypainting$enumart.title.equals(title)) + { + this.art = entitypainting$enumart; + break; + } + } + + this.updateFacingWithBoundingBox(facing); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setString("Motive", this.art.title); + super.writeEntityToNBT(tagCompound); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + String s = tagCompund.getString("Motive"); + + for (EntityPainting.EnumArt entitypainting$enumart : EntityPainting.EnumArt.values()) + { + if (entitypainting$enumart.title.equals(s)) + { + this.art = entitypainting$enumart; + } + } + + if (this.art == null) + { + this.art = EntityPainting.EnumArt.KEBAB; + } + + super.readEntityFromNBT(tagCompund); + } + + public int getWidthPixels() + { + return this.art.sizeX; + } + + public int getHeightPixels() + { + return this.art.sizeY; + } + + public void onBroken(Entity brokenEntity) + { + if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) + { + if (brokenEntity instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)brokenEntity; + + if (entityplayer.capabilities.isCreativeMode) + { + return; + } + } + + this.entityDropItem(new ItemStack(Items.painting), 0.0F); + } + } + + public void setLocationAndAngles(double x, double y, double z, float yaw, float pitch) + { + BlockPos blockpos = this.hangingPosition.add(x - this.posX, y - this.posY, z - this.posZ); + this.setPosition((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) + { + BlockPos blockpos = this.hangingPosition.add(x - this.posX, y - this.posY, z - this.posZ); + this.setPosition((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); + } + + public static enum EnumArt + { + KEBAB("Kebab", 16, 16, 0, 0), + AZTEC("Aztec", 16, 16, 16, 0), + ALBAN("Alban", 16, 16, 32, 0), + AZTEC_2("Aztec2", 16, 16, 48, 0), + BOMB("Bomb", 16, 16, 64, 0), + PLANT("Plant", 16, 16, 80, 0), + WASTELAND("Wasteland", 16, 16, 96, 0), + POOL("Pool", 32, 16, 0, 32), + COURBET("Courbet", 32, 16, 32, 32), + SEA("Sea", 32, 16, 64, 32), + SUNSET("Sunset", 32, 16, 96, 32), + CREEBET("Creebet", 32, 16, 128, 32), + WANDERER("Wanderer", 16, 32, 0, 64), + GRAHAM("Graham", 16, 32, 16, 64), + MATCH("Match", 32, 32, 0, 128), + BUST("Bust", 32, 32, 32, 128), + STAGE("Stage", 32, 32, 64, 128), + VOID("Void", 32, 32, 96, 128), + SKULL_AND_ROSES("SkullAndRoses", 32, 32, 128, 128), + WITHER("Wither", 32, 32, 160, 128), + FIGHTERS("Fighters", 64, 32, 0, 96), + POINTER("Pointer", 64, 64, 0, 192), + PIGSCENE("Pigscene", 64, 64, 64, 192), + BURNING_SKULL("BurningSkull", 64, 64, 128, 192), + SKELETON("Skeleton", 64, 48, 192, 64), + DONKEY_KONG("DonkeyKong", 64, 48, 192, 112); + + public static final int field_180001_A = "SkullAndRoses".length(); + public final String title; + public final int sizeX; + public final int sizeY; + public final int offsetX; + public final int offsetY; + + private EnumArt(String titleIn, int width, int height, int textureU, int textureV) + { + this.title = titleIn; + this.sizeX = width; + this.sizeY = height; + this.offsetX = textureU; + this.offsetY = textureV; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java new file mode 100644 index 0000000..e1e8e03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java @@ -0,0 +1,109 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class EntityTNTPrimed extends Entity +{ + public int fuse; + private EntityLivingBase tntPlacedBy; + + public EntityTNTPrimed(World worldIn) + { + super(worldIn); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + } + + public EntityTNTPrimed(World worldIn, double x, double y, double z, EntityLivingBase igniter) + { + this(worldIn); + this.setPosition(x, y, z); + float f = (float)(Math.random() * Math.PI * 2.0D); + this.motionX = (double)(-((float)Math.sin((double)f)) * 0.02F); + this.motionY = 0.20000000298023224D; + this.motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F); + this.fuse = 80; + this.prevPosX = x; + this.prevPosY = y; + this.prevPosZ = z; + this.tntPlacedBy = igniter; + } + + protected void entityInit() + { + } + + protected boolean canTriggerWalking() + { + return false; + } + + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + } + + if (this.fuse-- <= 0) + { + this.setDead(); + + if (!this.worldObj.isRemote) + { + this.explode(); + } + } + else + { + this.handleWaterMovement(); + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + private void explode() + { + float f = 4.0F; + this.worldObj.createExplosion(this, this.posX, this.posY + (double)(this.height / 16.0F), this.posZ, f, true); + } + + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setByte("Fuse", (byte)this.fuse); + } + + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.fuse = tagCompund.getByte("Fuse"); + } + + public EntityLivingBase getTntPlacedBy() + { + return this.tntPlacedBy; + } + + public float getEyeHeight() + { + return 0.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityXPOrb.java b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityXPOrb.java new file mode 100644 index 0000000..cbdc9fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/item/EntityXPOrb.java @@ -0,0 +1,227 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityXPOrb extends Entity +{ + public int xpColor; + public int xpOrbAge; + public int delayBeforeCanPickup; + private int xpOrbHealth = 5; + private int xpValue; + private EntityPlayer closestPlayer; + private int xpTargetColor; + + public EntityXPOrb(World worldIn, double x, double y, double z, int expValue) + { + super(worldIn); + this.setSize(0.5F, 0.5F); + this.setPosition(x, y, z); + this.rotationYaw = (float)(Math.random() * 360.0D); + this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); + this.motionY = (double)((float)(Math.random() * 0.2D) * 2.0F); + this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); + this.xpValue = expValue; + } + + protected boolean canTriggerWalking() + { + return false; + } + + public EntityXPOrb(World worldIn) + { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() + { + } + + public int getBrightnessForRender(float partialTicks) + { + float f = 0.5F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + int i = super.getBrightnessForRender(partialTicks); + int j = i & 255; + int k = i >> 16 & 255; + j = j + (int)(f * 15.0F * 16.0F); + + if (j > 240) + { + j = 240; + } + + return j | k << 16; + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.delayBeforeCanPickup > 0) + { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.029999999329447746D; + + if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava) + { + this.motionY = 0.20000000298023224D; + this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + this.pushOutOfBlocks(this.posX, (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, this.posZ); + double d0 = 8.0D; + + if (this.xpTargetColor < this.xpColor - 20 + this.getEntityId() % 100) + { + if (this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > d0 * d0) + { + this.closestPlayer = this.worldObj.getClosestPlayerToEntity(this, d0); + } + + this.xpTargetColor = this.xpColor; + } + + if (this.closestPlayer != null && this.closestPlayer.isSpectator()) + { + this.closestPlayer = null; + } + + if (this.closestPlayer != null) + { + double d1 = (this.closestPlayer.posX - this.posX) / d0; + double d2 = (this.closestPlayer.posY + (double)this.closestPlayer.getEyeHeight() - this.posY) / d0; + double d3 = (this.closestPlayer.posZ - this.posZ) / d0; + double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3); + double d5 = 1.0D - d4; + + if (d5 > 0.0D) + { + d5 = d5 * d5; + this.motionX += d1 / d4 * d5 * 0.1D; + this.motionY += d2 / d4 * d5 * 0.1D; + this.motionZ += d3 / d4 * d5 * 0.1D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f = 0.98F; + + if (this.onGround) + { + f = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.getEntityBoundingBox().minY) - 1, MathHelper.floor_double(this.posZ))).getBlock().slipperiness * 0.98F; + } + + this.motionX *= (double)f; + this.motionY *= 0.9800000190734863D; + this.motionZ *= (double)f; + + if (this.onGround) + { + this.motionY *= -0.8999999761581421D; + } + + ++this.xpColor; + ++this.xpOrbAge; + + if (this.xpOrbAge >= 6000) + { + this.setDead(); + } + } + + public boolean handleWaterMovement() + { + return this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox(), Material.water, this); + } + + protected void dealFireDamage(int amount) + { + this.attackEntityFrom(DamageSource.inFire, (float)amount); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + this.setBeenAttacked(); + this.xpOrbHealth = (int)((float)this.xpOrbHealth - amount); + + if (this.xpOrbHealth <= 0) + { + this.setDead(); + } + + return false; + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("Health", (short)((byte)this.xpOrbHealth)); + tagCompound.setShort("Age", (short)this.xpOrbAge); + tagCompound.setShort("Value", (short)this.xpValue); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.xpOrbHealth = tagCompund.getShort("Health") & 255; + this.xpOrbAge = tagCompund.getShort("Age"); + this.xpValue = tagCompund.getShort("Value"); + } + + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (!this.worldObj.isRemote) + { + if (this.delayBeforeCanPickup == 0 && entityIn.xpCooldown == 0) + { + entityIn.xpCooldown = 2; + this.worldObj.playSoundAtEntity(entityIn, "random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); + entityIn.onItemPickup(this, 1); + entityIn.addExperience(this.xpValue); + this.setDead(); + } + } + } + + public int getXpValue() + { + return this.xpValue; + } + + public int getTextureByXP() + { + return this.xpValue >= 2477 ? 10 : (this.xpValue >= 1237 ? 9 : (this.xpValue >= 617 ? 8 : (this.xpValue >= 307 ? 7 : (this.xpValue >= 149 ? 6 : (this.xpValue >= 73 ? 5 : (this.xpValue >= 37 ? 4 : (this.xpValue >= 17 ? 3 : (this.xpValue >= 7 ? 2 : (this.xpValue >= 3 ? 1 : 0))))))))); + } + + public static int getXPSplit(int expValue) + { + return expValue >= 2477 ? 2477 : (expValue >= 1237 ? 1237 : (expValue >= 617 ? 617 : (expValue >= 307 ? 307 : (expValue >= 149 ? 149 : (expValue >= 73 ? 73 : (expValue >= 37 ? 37 : (expValue >= 17 ? 17 : (expValue >= 7 ? 7 : (expValue >= 3 ? 3 : 1))))))))); + } + + public boolean canAttackWithItem() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityBlaze.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityBlaze.java new file mode 100644 index 0000000..ae53ef1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityBlaze.java @@ -0,0 +1,277 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBlaze extends EntityMob +{ + private float heightOffset = 0.5F; + private int heightOffsetUpdateTime; + + public EntityBlaze(World worldIn) + { + super(worldIn); + this.isImmuneToFire = true; + this.experienceValue = 10; + this.tasks.addTask(4, new EntityBlaze.AIFireballAttack(this)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(48.0D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + protected String getLivingSound() + { + return "mob.blaze.breathe"; + } + + protected String getHurtSound() + { + return "mob.blaze.hit"; + } + + protected String getDeathSound() + { + return "mob.blaze.death"; + } + + public int getBrightnessForRender(float partialTicks) + { + return 15728880; + } + + public float getBrightness(float partialTicks) + { + return 1.0F; + } + + public void onLivingUpdate() + { + if (!this.onGround && this.motionY < 0.0D) + { + this.motionY *= 0.6D; + } + + if (this.worldObj.isRemote) + { + if (this.rand.nextInt(24) == 0 && !this.isSilent()) + { + this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); + } + + for (int i = 0; i < 2; ++i) + { + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + super.onLivingUpdate(); + } + + protected void updateAITasks() + { + if (this.isWet()) + { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + --this.heightOffsetUpdateTime; + + if (this.heightOffsetUpdateTime <= 0) + { + this.heightOffsetUpdateTime = 100; + this.heightOffset = 0.5F + (float)this.rand.nextGaussian() * 3.0F; + } + + EntityLivingBase entitylivingbase = this.getAttackTarget(); + + if (entitylivingbase != null && entitylivingbase.posY + (double)entitylivingbase.getEyeHeight() > this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) + { + this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D; + this.isAirBorne = true; + } + + super.updateAITasks(); + } + + public void fall(float distance, float damageMultiplier) + { + } + + protected Item getDropItem() + { + return Items.blaze_rod; + } + + public boolean isBurning() + { + return this.func_70845_n(); + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + if (wasRecentlyHit) + { + int i = this.rand.nextInt(2 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.blaze_rod, 1); + } + } + } + + public boolean func_70845_n() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setOnFire(boolean onFire) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (onFire) + { + b0 = (byte)(b0 | 1); + } + else + { + b0 = (byte)(b0 & -2); + } + + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + + protected boolean isValidLightLevel() + { + return true; + } + + static class AIFireballAttack extends EntityAIBase + { + private EntityBlaze blaze; + private int field_179467_b; + private int field_179468_c; + + public AIFireballAttack(EntityBlaze p_i45846_1_) + { + this.blaze = p_i45846_1_; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.blaze.getAttackTarget(); + return entitylivingbase != null && entitylivingbase.isEntityAlive(); + } + + public void startExecuting() + { + this.field_179467_b = 0; + } + + public void resetTask() + { + this.blaze.setOnFire(false); + } + + public void updateTask() + { + --this.field_179468_c; + EntityLivingBase entitylivingbase = this.blaze.getAttackTarget(); + double d0 = this.blaze.getDistanceSqToEntity(entitylivingbase); + + if (d0 < 4.0D) + { + if (this.field_179468_c <= 0) + { + this.field_179468_c = 20; + this.blaze.attackEntityAsMob(entitylivingbase); + } + + this.blaze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ, 1.0D); + } + else if (d0 < 256.0D) + { + double d1 = entitylivingbase.posX - this.blaze.posX; + double d2 = entitylivingbase.getEntityBoundingBox().minY + (double)(entitylivingbase.height / 2.0F) - (this.blaze.posY + (double)(this.blaze.height / 2.0F)); + double d3 = entitylivingbase.posZ - this.blaze.posZ; + + if (this.field_179468_c <= 0) + { + ++this.field_179467_b; + + if (this.field_179467_b == 1) + { + this.field_179468_c = 60; + this.blaze.setOnFire(true); + } + else if (this.field_179467_b <= 4) + { + this.field_179468_c = 6; + } + else + { + this.field_179468_c = 100; + this.field_179467_b = 0; + this.blaze.setOnFire(false); + } + + if (this.field_179467_b > 1) + { + float f = MathHelper.sqrt_float(MathHelper.sqrt_double(d0)) * 0.5F; + this.blaze.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, new BlockPos((int)this.blaze.posX, (int)this.blaze.posY, (int)this.blaze.posZ), 0); + + for (int i = 0; i < 1; ++i) + { + EntitySmallFireball entitysmallfireball = new EntitySmallFireball(this.blaze.worldObj, this.blaze, d1 + this.blaze.getRNG().nextGaussian() * (double)f, d2, d3 + this.blaze.getRNG().nextGaussian() * (double)f); + entitysmallfireball.posY = this.blaze.posY + (double)(this.blaze.height / 2.0F) + 0.5D; + this.blaze.worldObj.spawnEntityInWorld(entitysmallfireball); + } + } + } + + this.blaze.getLookHelper().setLookPositionWithEntity(entitylivingbase, 10.0F, 10.0F); + } + else + { + this.blaze.getNavigator().clearPathEntity(); + this.blaze.getMoveHelper().setMoveTo(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ, 1.0D); + } + + super.updateTask(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java new file mode 100644 index 0000000..9444c47 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java @@ -0,0 +1,67 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityCaveSpider extends EntitySpider +{ + public EntityCaveSpider(World worldIn) + { + super(worldIn); + this.setSize(0.7F, 0.5F); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(12.0D); + } + + public boolean attackEntityAsMob(Entity entityIn) + { + if (super.attackEntityAsMob(entityIn)) + { + if (entityIn instanceof EntityLivingBase) + { + int i = 0; + + if (this.worldObj.getDifficulty() == EnumDifficulty.NORMAL) + { + i = 7; + } + else if (this.worldObj.getDifficulty() == EnumDifficulty.HARD) + { + i = 15; + } + + if (i > 0) + { + ((EntityLivingBase)entityIn).addPotionEffect(new PotionEffect(Potion.poison.id, i * 20, 0)); + } + } + + return true; + } + else + { + return false; + } + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + return livingdata; + } + + public float getEyeHeight() + { + return 0.45F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityCreeper.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityCreeper.java new file mode 100644 index 0000000..44eea79 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityCreeper.java @@ -0,0 +1,260 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAICreeperSwell; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityCreeper extends EntityMob +{ + private int lastActiveTime; + private int timeSinceIgnited; + private int fuseTime = 30; + private int explosionRadius = 3; + private int field_175494_bm = 0; + + public EntityCreeper(World worldIn) + { + super(worldIn); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAICreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0])); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + public int getMaxFallHeight() + { + return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F); + } + + public void fall(float distance, float damageMultiplier) + { + super.fall(distance, damageMultiplier); + this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + distance * 1.5F); + + if (this.timeSinceIgnited > this.fuseTime - 5) + { + this.timeSinceIgnited = this.fuseTime - 5; + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1)); + this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.dataWatcher.getWatchableObjectByte(17) == 1) + { + tagCompound.setBoolean("powered", true); + } + + tagCompound.setShort("Fuse", (short)this.fuseTime); + tagCompound.setByte("ExplosionRadius", (byte)this.explosionRadius); + tagCompound.setBoolean("ignited", this.hasIgnited()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.dataWatcher.updateObject(17, Byte.valueOf((byte)(tagCompund.getBoolean("powered") ? 1 : 0))); + + if (tagCompund.hasKey("Fuse", 99)) + { + this.fuseTime = tagCompund.getShort("Fuse"); + } + + if (tagCompund.hasKey("ExplosionRadius", 99)) + { + this.explosionRadius = tagCompund.getByte("ExplosionRadius"); + } + + if (tagCompund.getBoolean("ignited")) + { + this.ignite(); + } + } + + public void onUpdate() + { + if (this.isEntityAlive()) + { + this.lastActiveTime = this.timeSinceIgnited; + + if (this.hasIgnited()) + { + this.setCreeperState(1); + } + + int i = this.getCreeperState(); + + if (i > 0 && this.timeSinceIgnited == 0) + { + this.playSound("creeper.primed", 1.0F, 0.5F); + } + + this.timeSinceIgnited += i; + + if (this.timeSinceIgnited < 0) + { + this.timeSinceIgnited = 0; + } + + if (this.timeSinceIgnited >= this.fuseTime) + { + this.timeSinceIgnited = this.fuseTime; + this.explode(); + } + } + + super.onUpdate(); + } + + protected String getHurtSound() + { + return "mob.creeper.say"; + } + + protected String getDeathSound() + { + return "mob.creeper.death"; + } + + public void onDeath(DamageSource cause) + { + super.onDeath(cause); + + if (cause.getEntity() instanceof EntitySkeleton) + { + int i = Item.getIdFromItem(Items.record_13); + int j = Item.getIdFromItem(Items.record_wait); + int k = i + this.rand.nextInt(j - i + 1); + this.dropItem(Item.getItemById(k), 1); + } + else if (cause.getEntity() instanceof EntityCreeper && cause.getEntity() != this && ((EntityCreeper)cause.getEntity()).getPowered() && ((EntityCreeper)cause.getEntity()).isAIEnabled()) + { + ((EntityCreeper)cause.getEntity()).func_175493_co(); + this.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F); + } + } + + public boolean attackEntityAsMob(Entity entityIn) + { + return true; + } + + public boolean getPowered() + { + return this.dataWatcher.getWatchableObjectByte(17) == 1; + } + + public float getCreeperFlashIntensity(float p_70831_1_) + { + return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float)(this.fuseTime - 2); + } + + protected Item getDropItem() + { + return Items.gunpowder; + } + + public int getCreeperState() + { + return this.dataWatcher.getWatchableObjectByte(16); + } + + public void setCreeperState(int state) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)state)); + } + + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + super.onStruckByLightning(lightningBolt); + this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); + } + + protected boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.flint_and_steel) + { + this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + player.swingItem(); + + if (!this.worldObj.isRemote) + { + this.ignite(); + itemstack.damageItem(1, player); + return true; + } + } + + return super.interact(player); + } + + private void explode() + { + if (!this.worldObj.isRemote) + { + boolean flag = this.worldObj.getGameRules().getBoolean("mobGriefing"); + float f = this.getPowered() ? 2.0F : 1.0F; + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius * f, flag); + this.setDead(); + } + } + + public boolean hasIgnited() + { + return this.dataWatcher.getWatchableObjectByte(18) != 0; + } + + public void ignite() + { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)1)); + } + + public boolean isAIEnabled() + { + return this.field_175494_bm < 1 && this.worldObj.getGameRules().getBoolean("doMobLoot"); + } + + public void func_175493_co() + { + ++this.field_175494_bm; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityEnderman.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityEnderman.java new file mode 100644 index 0000000..07a7cde --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityEnderman.java @@ -0,0 +1,570 @@ +package net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import com.google.common.collect.Sets; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityEnderman extends EntityMob +{ + private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); + private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", 0.15000000596046448D, 0)).setSaved(false); + private static final Set carriableBlocks = Sets.newIdentityHashSet(); + private boolean isAggressive; + + public EntityEnderman(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 2.9F); + this.stepHeight = 1.0F; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, false)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.tasks.addTask(10, new EntityEnderman.AIPlaceBlock(this)); + this.tasks.addTask(11, new EntityEnderman.AITakeBlock(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityEnderman.AIFindPlayer(this)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate() + { + public boolean apply(EntityEndermite p_apply_1_) + { + return p_apply_1_.isSpawnedByPlayer(); + } + })); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(7.0D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(64.0D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Short((short)0)); + this.dataWatcher.addObject(17, new Byte((byte)0)); + this.dataWatcher.addObject(18, new Byte((byte)0)); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + IBlockState iblockstate = this.getHeldBlockState(); + tagCompound.setShort("carried", (short)Block.getIdFromBlock(iblockstate.getBlock())); + tagCompound.setShort("carriedData", (short)iblockstate.getBlock().getMetaFromState(iblockstate)); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + IBlockState iblockstate; + + if (tagCompund.hasKey("carried", 8)) + { + iblockstate = Block.getBlockFromName(tagCompund.getString("carried")).getStateFromMeta(tagCompund.getShort("carriedData") & 65535); + } + else + { + iblockstate = Block.getBlockById(tagCompund.getShort("carried")).getStateFromMeta(tagCompund.getShort("carriedData") & 65535); + } + + this.setHeldBlockState(iblockstate); + } + + private boolean shouldAttackPlayer(EntityPlayer player) + { + ItemStack itemstack = player.inventory.armorInventory[3]; + + if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) + { + return false; + } + else + { + Vec3 vec3 = player.getLook(1.0F).normalize(); + Vec3 vec31 = new Vec3(this.posX - player.posX, this.getEntityBoundingBox().minY + (double)(this.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), this.posZ - player.posZ); + double d0 = vec31.lengthVector(); + vec31 = vec31.normalize(); + double d1 = vec3.dotProduct(vec31); + return d1 > 1.0D - 0.025D / d0 ? player.canEntityBeSeen(this) : false; + } + } + + public float getEyeHeight() + { + return 2.55F; + } + + public void onLivingUpdate() + { + if (this.worldObj.isRemote) + { + for (int i = 0; i < 2; ++i) + { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]); + } + } + + this.isJumping = false; + super.onLivingUpdate(); + } + + protected void updateAITasks() + { + if (this.isWet()) + { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) + { + this.setScreaming(false); + } + + if (this.worldObj.isDaytime()) + { + float f = this.getBrightness(1.0F); + + if (f > 0.5F && this.worldObj.canSeeSky(new BlockPos(this)) && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) + { + this.setAttackTarget((EntityLivingBase)null); + this.setScreaming(false); + this.isAggressive = false; + this.teleportRandomly(); + } + } + + super.updateAITasks(); + } + + protected boolean teleportRandomly() + { + double d0 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D; + double d1 = this.posY + (double)(this.rand.nextInt(64) - 32); + double d2 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D; + return this.teleportTo(d0, d1, d2); + } + + protected boolean teleportToEntity(Entity p_70816_1_) + { + Vec3 vec3 = new Vec3(this.posX - p_70816_1_.posX, this.getEntityBoundingBox().minY + (double)(this.height / 2.0F) - p_70816_1_.posY + (double)p_70816_1_.getEyeHeight(), this.posZ - p_70816_1_.posZ); + vec3 = vec3.normalize(); + double d0 = 16.0D; + double d1 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.xCoord * d0; + double d2 = this.posY + (double)(this.rand.nextInt(16) - 8) - vec3.yCoord * d0; + double d3 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.zCoord * d0; + return this.teleportTo(d1, d2, d3); + } + + protected boolean teleportTo(double x, double y, double z) + { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + this.posX = x; + this.posY = y; + this.posZ = z; + boolean flag = false; + BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ); + + if (this.worldObj.isBlockLoaded(blockpos)) + { + boolean flag1 = false; + + while (!flag1 && blockpos.getY() > 0) + { + BlockPos blockpos1 = blockpos.down(); + Block block = this.worldObj.getBlockState(blockpos1).getBlock(); + + if (block.getMaterial().blocksMovement()) + { + flag1 = true; + } + else + { + --this.posY; + blockpos = blockpos1; + } + } + + if (flag1) + { + super.setPositionAndUpdate(this.posX, this.posY, this.posZ); + + if (this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox())) + { + flag = true; + } + } + } + + if (!flag) + { + this.setPosition(d0, d1, d2); + return false; + } + else + { + int i = 128; + + for (int j = 0; j < i; ++j) + { + double d6 = (double)j / ((double)i - 1.0D); + float f = (this.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (this.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (this.rand.nextFloat() - 0.5F) * 0.2F; + double d3 = d0 + (this.posX - d0) * d6 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; + double d4 = d1 + (this.posY - d1) * d6 + this.rand.nextDouble() * (double)this.height; + double d5 = d2 + (this.posZ - d2) * d6 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d3, d4, d5, (double)f, (double)f1, (double)f2, new int[0]); + } + + this.worldObj.playSoundEffect(d0, d1, d2, "mob.endermen.portal", 1.0F, 1.0F); + this.playSound("mob.endermen.portal", 1.0F, 1.0F); + return true; + } + } + + protected String getLivingSound() + { + return this.isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle"; + } + + protected String getHurtSound() + { + return "mob.endermen.hit"; + } + + protected String getDeathSound() + { + return "mob.endermen.death"; + } + + protected Item getDropItem() + { + return Items.ender_pearl; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + Item item = this.getDropItem(); + + if (item != null) + { + int i = this.rand.nextInt(2 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + this.dropItem(item, 1); + } + } + } + + public void setHeldBlockState(IBlockState state) + { + this.dataWatcher.updateObject(16, Short.valueOf((short)(Block.getStateId(state) & 65535))); + } + + public IBlockState getHeldBlockState() + { + return Block.getStateById(this.dataWatcher.getWatchableObjectShort(16) & 65535); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + if (source.getEntity() == null || !(source.getEntity() instanceof EntityEndermite)) + { + if (!this.worldObj.isRemote) + { + this.setScreaming(true); + } + + if (source instanceof EntityDamageSource && source.getEntity() instanceof EntityPlayer) + { + if (source.getEntity() instanceof EntityPlayerMP && ((EntityPlayerMP)source.getEntity()).theItemInWorldManager.isCreative()) + { + this.setScreaming(false); + } + else + { + this.isAggressive = true; + } + } + + if (source instanceof EntityDamageSourceIndirect) + { + this.isAggressive = false; + + for (int i = 0; i < 64; ++i) + { + if (this.teleportRandomly()) + { + return true; + } + } + + return false; + } + } + + boolean flag = super.attackEntityFrom(source, amount); + + if (source.isUnblockable() && this.rand.nextInt(10) != 0) + { + this.teleportRandomly(); + } + + return flag; + } + } + + public boolean isScreaming() + { + return this.dataWatcher.getWatchableObjectByte(18) > 0; + } + + public void setScreaming(boolean screaming) + { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)(screaming ? 1 : 0))); + } + + static + { + carriableBlocks.add(Blocks.grass); + carriableBlocks.add(Blocks.dirt); + carriableBlocks.add(Blocks.sand); + carriableBlocks.add(Blocks.gravel); + carriableBlocks.add(Blocks.yellow_flower); + carriableBlocks.add(Blocks.red_flower); + carriableBlocks.add(Blocks.brown_mushroom); + carriableBlocks.add(Blocks.red_mushroom); + carriableBlocks.add(Blocks.tnt); + carriableBlocks.add(Blocks.cactus); + carriableBlocks.add(Blocks.clay); + carriableBlocks.add(Blocks.pumpkin); + carriableBlocks.add(Blocks.melon_block); + carriableBlocks.add(Blocks.mycelium); + } + + static class AIFindPlayer extends EntityAINearestAttackableTarget + { + private EntityPlayer player; + private int field_179450_h; + private int field_179451_i; + private EntityEnderman enderman; + + public AIFindPlayer(EntityEnderman p_i45842_1_) + { + super(p_i45842_1_, EntityPlayer.class, true); + this.enderman = p_i45842_1_; + } + + public boolean shouldExecute() + { + double d0 = this.getTargetDistance(); + List list = this.taskOwner.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.taskOwner.getEntityBoundingBox().expand(d0, 4.0D, d0), this.targetEntitySelector); + Collections.sort(list, this.theNearestAttackableTargetSorter); + + if (list.isEmpty()) + { + return false; + } + else + { + this.player = (EntityPlayer)list.get(0); + return true; + } + } + + public void startExecuting() + { + this.field_179450_h = 5; + this.field_179451_i = 0; + } + + public void resetTask() + { + this.player = null; + this.enderman.setScreaming(false); + IAttributeInstance iattributeinstance = this.enderman.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(EntityEnderman.attackingSpeedBoostModifier); + super.resetTask(); + } + + public boolean continueExecuting() + { + if (this.player != null) + { + if (!this.enderman.shouldAttackPlayer(this.player)) + { + return false; + } + else + { + this.enderman.isAggressive = true; + this.enderman.faceEntity(this.player, 10.0F, 10.0F); + return true; + } + } + else + { + return super.continueExecuting(); + } + } + + public void updateTask() + { + if (this.player != null) + { + if (--this.field_179450_h <= 0) + { + this.targetEntity = this.player; + this.player = null; + super.startExecuting(); + this.enderman.playSound("mob.endermen.stare", 1.0F, 1.0F); + this.enderman.setScreaming(true); + IAttributeInstance iattributeinstance = this.enderman.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.applyModifier(EntityEnderman.attackingSpeedBoostModifier); + } + } + else + { + if (this.targetEntity != null) + { + if (this.targetEntity instanceof EntityPlayer && this.enderman.shouldAttackPlayer((EntityPlayer)this.targetEntity)) + { + if (this.targetEntity.getDistanceSqToEntity(this.enderman) < 16.0D) + { + this.enderman.teleportRandomly(); + } + + this.field_179451_i = 0; + } + else if (this.targetEntity.getDistanceSqToEntity(this.enderman) > 256.0D && this.field_179451_i++ >= 30 && this.enderman.teleportToEntity(this.targetEntity)) + { + this.field_179451_i = 0; + } + } + + super.updateTask(); + } + } + } + + static class AIPlaceBlock extends EntityAIBase + { + private EntityEnderman enderman; + + public AIPlaceBlock(EntityEnderman p_i45843_1_) + { + this.enderman = p_i45843_1_; + } + + public boolean shouldExecute() + { + return !this.enderman.worldObj.getGameRules().getBoolean("mobGriefing") ? false : (this.enderman.getHeldBlockState().getBlock().getMaterial() == Material.air ? false : this.enderman.getRNG().nextInt(2000) == 0); + } + + public void updateTask() + { + Random random = this.enderman.getRNG(); + World world = this.enderman.worldObj; + int i = MathHelper.floor_double(this.enderman.posX - 1.0D + random.nextDouble() * 2.0D); + int j = MathHelper.floor_double(this.enderman.posY + random.nextDouble() * 2.0D); + int k = MathHelper.floor_double(this.enderman.posZ - 1.0D + random.nextDouble() * 2.0D); + BlockPos blockpos = new BlockPos(i, j, k); + Block block = world.getBlockState(blockpos).getBlock(); + Block block1 = world.getBlockState(blockpos.down()).getBlock(); + + if (this.func_179474_a(world, blockpos, this.enderman.getHeldBlockState().getBlock(), block, block1)) + { + world.setBlockState(blockpos, this.enderman.getHeldBlockState(), 3); + this.enderman.setHeldBlockState(Blocks.air.getDefaultState()); + } + } + + private boolean func_179474_a(World worldIn, BlockPos p_179474_2_, Block p_179474_3_, Block p_179474_4_, Block p_179474_5_) + { + return !p_179474_3_.canPlaceBlockAt(worldIn, p_179474_2_) ? false : (p_179474_4_.getMaterial() != Material.air ? false : (p_179474_5_.getMaterial() == Material.air ? false : p_179474_5_.isFullCube())); + } + } + + static class AITakeBlock extends EntityAIBase + { + private EntityEnderman enderman; + + public AITakeBlock(EntityEnderman p_i45841_1_) + { + this.enderman = p_i45841_1_; + } + + public boolean shouldExecute() + { + return !this.enderman.worldObj.getGameRules().getBoolean("mobGriefing") ? false : (this.enderman.getHeldBlockState().getBlock().getMaterial() != Material.air ? false : this.enderman.getRNG().nextInt(20) == 0); + } + + public void updateTask() + { + Random random = this.enderman.getRNG(); + World world = this.enderman.worldObj; + int i = MathHelper.floor_double(this.enderman.posX - 2.0D + random.nextDouble() * 4.0D); + int j = MathHelper.floor_double(this.enderman.posY + random.nextDouble() * 3.0D); + int k = MathHelper.floor_double(this.enderman.posZ - 2.0D + random.nextDouble() * 4.0D); + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (EntityEnderman.carriableBlocks.contains(block)) + { + this.enderman.setHeldBlockState(iblockstate); + world.setBlockState(blockpos, Blocks.air.getDefaultState()); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityEndermite.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityEndermite.java new file mode 100644 index 0000000..ba1c659 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityEndermite.java @@ -0,0 +1,159 @@ +package net.minecraft.entity.monster; + +import net.minecraft.block.Block; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class EntityEndermite extends EntityMob +{ + private int lifetime = 0; + private boolean playerSpawned = false; + + public EntityEndermite(World worldIn) + { + super(worldIn); + this.experienceValue = 3; + this.setSize(0.4F, 0.3F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(3, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + public float getEyeHeight() + { + return 0.1F; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected String getLivingSound() + { + return "mob.silverfish.say"; + } + + protected String getHurtSound() + { + return "mob.silverfish.hit"; + } + + protected String getDeathSound() + { + return "mob.silverfish.kill"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.silverfish.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return null; + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.lifetime = tagCompund.getInteger("Lifetime"); + this.playerSpawned = tagCompund.getBoolean("PlayerSpawned"); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Lifetime", this.lifetime); + tagCompound.setBoolean("PlayerSpawned", this.playerSpawned); + } + + public void onUpdate() + { + this.renderYawOffset = this.rotationYaw; + super.onUpdate(); + } + + public boolean isSpawnedByPlayer() + { + return this.playerSpawned; + } + + public void setSpawnedByPlayer(boolean spawnedByPlayer) + { + this.playerSpawned = spawnedByPlayer; + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.worldObj.isRemote) + { + for (int i = 0; i < 2; ++i) + { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]); + } + } + else + { + if (!this.isNoDespawnRequired()) + { + ++this.lifetime; + } + + if (this.lifetime >= 2400) + { + this.setDead(); + } + } + } + + protected boolean isValidLightLevel() + { + return true; + } + + public boolean getCanSpawnHere() + { + if (super.getCanSpawnHere()) + { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 5.0D); + return entityplayer == null; + } + else + { + return false; + } + } + + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.ARTHROPOD; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGhast.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGhast.java new file mode 100644 index 0000000..93bb582 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGhast.java @@ -0,0 +1,374 @@ +package net.minecraft.entity.monster; + +import java.util.Random; +import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityGhast extends EntityFlying implements IMob +{ + private int explosionStrength = 1; + + public EntityGhast(World worldIn) + { + super(worldIn); + this.setSize(4.0F, 4.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; + this.moveHelper = new EntityGhast.GhastMoveHelper(this); + this.tasks.addTask(5, new EntityGhast.AIRandomFly(this)); + this.tasks.addTask(7, new EntityGhast.AILookAround(this)); + this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this)); + this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); + } + + public boolean isAttacking() + { + return this.dataWatcher.getWatchableObjectByte(16) != 0; + } + + public void setAttacking(boolean attacking) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(attacking ? 1 : 0))); + } + + public int getFireballStrength() + { + return this.explosionStrength; + } + + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote && this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) + { + this.setDead(); + } + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if ("fireball".equals(source.getDamageType()) && source.getEntity() instanceof EntityPlayer) + { + super.attackEntityFrom(source, 1000.0F); + ((EntityPlayer)source.getEntity()).triggerAchievement(AchievementList.ghast); + return true; + } + else + { + return super.attackEntityFrom(source, amount); + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(100.0D); + } + + protected String getLivingSound() + { + return "mob.ghast.moan"; + } + + protected String getHurtSound() + { + return "mob.ghast.scream"; + } + + protected String getDeathSound() + { + return "mob.ghast.death"; + } + + protected Item getDropItem() + { + return Items.gunpowder; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(2) + this.rand.nextInt(1 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.ghast_tear, 1); + } + + i = this.rand.nextInt(3) + this.rand.nextInt(1 + lootingModifier); + + for (int k = 0; k < i; ++k) + { + this.dropItem(Items.gunpowder, 1); + } + } + + protected float getSoundVolume() + { + return 10.0F; + } + + public boolean getCanSpawnHere() + { + return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL; + } + + public int getMaxSpawnedInChunk() + { + return 1; + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("ExplosionPower", this.explosionStrength); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("ExplosionPower", 99)) + { + this.explosionStrength = tagCompund.getInteger("ExplosionPower"); + } + } + + public float getEyeHeight() + { + return 2.6F; + } + + static class AIFireballAttack extends EntityAIBase + { + private EntityGhast parentEntity; + public int attackTimer; + + public AIFireballAttack(EntityGhast ghast) + { + this.parentEntity = ghast; + } + + public boolean shouldExecute() + { + return this.parentEntity.getAttackTarget() != null; + } + + public void startExecuting() + { + this.attackTimer = 0; + } + + public void resetTask() + { + this.parentEntity.setAttacking(false); + } + + public void updateTask() + { + EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); + double d0 = 64.0D; + + if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < d0 * d0 && this.parentEntity.canEntityBeSeen(entitylivingbase)) + { + World world = this.parentEntity.worldObj; + ++this.attackTimer; + + if (this.attackTimer == 10) + { + world.playAuxSFXAtEntity((EntityPlayer)null, 1007, new BlockPos(this.parentEntity), 0); + } + + if (this.attackTimer == 20) + { + double d1 = 4.0D; + Vec3 vec3 = this.parentEntity.getLook(1.0F); + double d2 = entitylivingbase.posX - (this.parentEntity.posX + vec3.xCoord * d1); + double d3 = entitylivingbase.getEntityBoundingBox().minY + (double)(entitylivingbase.height / 2.0F) - (0.5D + this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F)); + double d4 = entitylivingbase.posZ - (this.parentEntity.posZ + vec3.zCoord * d1); + world.playAuxSFXAtEntity((EntityPlayer)null, 1008, new BlockPos(this.parentEntity), 0); + EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.parentEntity, d2, d3, d4); + entitylargefireball.explosionPower = this.parentEntity.getFireballStrength(); + entitylargefireball.posX = this.parentEntity.posX + vec3.xCoord * d1; + entitylargefireball.posY = this.parentEntity.posY + (double)(this.parentEntity.height / 2.0F) + 0.5D; + entitylargefireball.posZ = this.parentEntity.posZ + vec3.zCoord * d1; + world.spawnEntityInWorld(entitylargefireball); + this.attackTimer = -40; + } + } + else if (this.attackTimer > 0) + { + --this.attackTimer; + } + + this.parentEntity.setAttacking(this.attackTimer > 10); + } + } + + static class AILookAround extends EntityAIBase + { + private EntityGhast parentEntity; + + public AILookAround(EntityGhast ghast) + { + this.parentEntity = ghast; + this.setMutexBits(2); + } + + public boolean shouldExecute() + { + return true; + } + + public void updateTask() + { + if (this.parentEntity.getAttackTarget() == null) + { + this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw = -((float)MathHelper.atan2(this.parentEntity.motionX, this.parentEntity.motionZ)) * 180.0F / (float)Math.PI; + } + else + { + EntityLivingBase entitylivingbase = this.parentEntity.getAttackTarget(); + double d0 = 64.0D; + + if (entitylivingbase.getDistanceSqToEntity(this.parentEntity) < d0 * d0) + { + double d1 = entitylivingbase.posX - this.parentEntity.posX; + double d2 = entitylivingbase.posZ - this.parentEntity.posZ; + this.parentEntity.renderYawOffset = this.parentEntity.rotationYaw = -((float)MathHelper.atan2(d1, d2)) * 180.0F / (float)Math.PI; + } + } + } + } + + static class AIRandomFly extends EntityAIBase + { + private EntityGhast parentEntity; + + public AIRandomFly(EntityGhast ghast) + { + this.parentEntity = ghast; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper(); + + if (!entitymovehelper.isUpdating()) + { + return true; + } + else + { + double d0 = entitymovehelper.getX() - this.parentEntity.posX; + double d1 = entitymovehelper.getY() - this.parentEntity.posY; + double d2 = entitymovehelper.getZ() - this.parentEntity.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + return d3 < 1.0D || d3 > 3600.0D; + } + } + + public boolean continueExecuting() + { + return false; + } + + public void startExecuting() + { + Random random = this.parentEntity.getRNG(); + double d0 = this.parentEntity.posX + (double)((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + double d1 = this.parentEntity.posY + (double)((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + double d2 = this.parentEntity.posZ + (double)((random.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.parentEntity.getMoveHelper().setMoveTo(d0, d1, d2, 1.0D); + } + } + + static class GhastMoveHelper extends EntityMoveHelper + { + private EntityGhast parentEntity; + private int courseChangeCooldown; + + public GhastMoveHelper(EntityGhast ghast) + { + super(ghast); + this.parentEntity = ghast; + } + + public void onUpdateMoveHelper() + { + if (this.update) + { + double d0 = this.posX - this.parentEntity.posX; + double d1 = this.posY - this.parentEntity.posY; + double d2 = this.posZ - this.parentEntity.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (this.courseChangeCooldown-- <= 0) + { + this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2; + d3 = (double)MathHelper.sqrt_double(d3); + + if (this.isNotColliding(this.posX, this.posY, this.posZ, d3)) + { + this.parentEntity.motionX += d0 / d3 * 0.1D; + this.parentEntity.motionY += d1 / d3 * 0.1D; + this.parentEntity.motionZ += d2 / d3 * 0.1D; + } + else + { + this.update = false; + } + } + } + } + + private boolean isNotColliding(double x, double y, double z, double p_179926_7_) + { + double d0 = (x - this.parentEntity.posX) / p_179926_7_; + double d1 = (y - this.parentEntity.posY) / p_179926_7_; + double d2 = (z - this.parentEntity.posZ) / p_179926_7_; + AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox(); + + for (int i = 1; (double)i < p_179926_7_; ++i) + { + axisalignedbb = axisalignedbb.offset(d0, d1, d2); + + if (!this.parentEntity.worldObj.getCollidingBoundingBoxes(this.parentEntity, axisalignedbb).isEmpty()) + { + return false; + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java new file mode 100644 index 0000000..c6b45dc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java @@ -0,0 +1,32 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityGiantZombie extends EntityMob +{ + public EntityGiantZombie(World worldIn) + { + super(worldIn); + this.setSize(this.width * 6.0F, this.height * 6.0F); + } + + public float getEyeHeight() + { + return 10.440001F; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50.0D); + } + + public float getBlockPathWeight(BlockPos pos) + { + return this.worldObj.getLightBrightness(pos) - 0.5F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGolem.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGolem.java new file mode 100644 index 0000000..f5ed408 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGolem.java @@ -0,0 +1,42 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.world.World; + +public abstract class EntityGolem extends EntityCreature implements IAnimals +{ + public EntityGolem(World worldIn) + { + super(worldIn); + } + + public void fall(float distance, float damageMultiplier) + { + } + + protected String getLivingSound() + { + return "none"; + } + + protected String getHurtSound() + { + return "none"; + } + + protected String getDeathSound() + { + return "none"; + } + + public int getTalkInterval() + { + return 120; + } + + protected boolean canDespawn() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGuardian.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGuardian.java new file mode 100644 index 0000000..781026e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityGuardian.java @@ -0,0 +1,678 @@ +package net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityLookHelper; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemFishFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateSwimmer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomFishable; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityGuardian extends EntityMob +{ + private float field_175482_b; + private float field_175484_c; + private float field_175483_bk; + private float field_175485_bl; + private float field_175486_bm; + private EntityLivingBase targetedEntity; + private int field_175479_bo; + private boolean field_175480_bp; + private EntityAIWander wander; + + public EntityGuardian(World worldIn) + { + super(worldIn); + this.experienceValue = 10; + this.setSize(0.85F, 0.85F); + this.tasks.addTask(4, new EntityGuardian.AIGuardianAttack(this)); + EntityAIMoveTowardsRestriction entityaimovetowardsrestriction; + this.tasks.addTask(5, entityaimovetowardsrestriction = new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, this.wander = new EntityAIWander(this, 1.0D, 80)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityGuardian.class, 12.0F, 0.01F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.wander.setMutexBits(3); + entityaimovetowardsrestriction.setMutexBits(3); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLivingBase.class, 10, true, false, new EntityGuardian.GuardianTargetSelector(this))); + this.moveHelper = new EntityGuardian.GuardianMoveHelper(this); + this.field_175484_c = this.field_175482_b = this.rand.nextFloat(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setElder(tagCompund.getBoolean("Elder")); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("Elder", this.isElder()); + } + + protected PathNavigate getNewNavigator(World worldIn) + { + return new PathNavigateSwimmer(this, worldIn); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + this.dataWatcher.addObject(17, Integer.valueOf(0)); + } + + private boolean isSyncedFlagSet(int flagId) + { + return (this.dataWatcher.getWatchableObjectInt(16) & flagId) != 0; + } + + private void setSyncedFlag(int flagId, boolean state) + { + int i = this.dataWatcher.getWatchableObjectInt(16); + + if (state) + { + this.dataWatcher.updateObject(16, Integer.valueOf(i | flagId)); + } + else + { + this.dataWatcher.updateObject(16, Integer.valueOf(i & ~flagId)); + } + } + + public boolean func_175472_n() + { + return this.isSyncedFlagSet(2); + } + + private void func_175476_l(boolean p_175476_1_) + { + this.setSyncedFlag(2, p_175476_1_); + } + + public int func_175464_ck() + { + return this.isElder() ? 60 : 80; + } + + public boolean isElder() + { + return this.isSyncedFlagSet(4); + } + + public void setElder(boolean elder) + { + this.setSyncedFlag(4, elder); + + if (elder) + { + this.setSize(1.9975F, 1.9975F); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(80.0D); + this.enablePersistence(); + this.wander.setExecutionChance(400); + } + } + + public void setElder() + { + this.setElder(true); + this.field_175486_bm = this.field_175485_bl = 1.0F; + } + + private void setTargetedEntity(int entityId) + { + this.dataWatcher.updateObject(17, Integer.valueOf(entityId)); + } + + public boolean hasTargetedEntity() + { + return this.dataWatcher.getWatchableObjectInt(17) != 0; + } + + public EntityLivingBase getTargetedEntity() + { + if (!this.hasTargetedEntity()) + { + return null; + } + else if (this.worldObj.isRemote) + { + if (this.targetedEntity != null) + { + return this.targetedEntity; + } + else + { + Entity entity = this.worldObj.getEntityByID(this.dataWatcher.getWatchableObjectInt(17)); + + if (entity instanceof EntityLivingBase) + { + this.targetedEntity = (EntityLivingBase)entity; + return this.targetedEntity; + } + else + { + return null; + } + } + } + else + { + return this.getAttackTarget(); + } + } + + public void onDataWatcherUpdate(int dataID) + { + super.onDataWatcherUpdate(dataID); + + if (dataID == 16) + { + if (this.isElder() && this.width < 1.0F) + { + this.setSize(1.9975F, 1.9975F); + } + } + else if (dataID == 17) + { + this.field_175479_bo = 0; + this.targetedEntity = null; + } + } + + public int getTalkInterval() + { + return 160; + } + + protected String getLivingSound() + { + return !this.isInWater() ? "mob.guardian.land.idle" : (this.isElder() ? "mob.guardian.elder.idle" : "mob.guardian.idle"); + } + + protected String getHurtSound() + { + return !this.isInWater() ? "mob.guardian.land.hit" : (this.isElder() ? "mob.guardian.elder.hit" : "mob.guardian.hit"); + } + + protected String getDeathSound() + { + return !this.isInWater() ? "mob.guardian.land.death" : (this.isElder() ? "mob.guardian.elder.death" : "mob.guardian.death"); + } + + protected boolean canTriggerWalking() + { + return false; + } + + public float getEyeHeight() + { + return this.height * 0.5F; + } + + public float getBlockPathWeight(BlockPos pos) + { + return this.worldObj.getBlockState(pos).getBlock().getMaterial() == Material.water ? 10.0F + this.worldObj.getLightBrightness(pos) - 0.5F : super.getBlockPathWeight(pos); + } + + public void onLivingUpdate() + { + if (this.worldObj.isRemote) + { + this.field_175484_c = this.field_175482_b; + + if (!this.isInWater()) + { + this.field_175483_bk = 2.0F; + + if (this.motionY > 0.0D && this.field_175480_bp && !this.isSilent()) + { + this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.guardian.flop", 1.0F, 1.0F, false); + } + + this.field_175480_bp = this.motionY < 0.0D && this.worldObj.isBlockNormalCube((new BlockPos(this)).down(), false); + } + else if (this.func_175472_n()) + { + if (this.field_175483_bk < 0.5F) + { + this.field_175483_bk = 4.0F; + } + else + { + this.field_175483_bk += (0.5F - this.field_175483_bk) * 0.1F; + } + } + else + { + this.field_175483_bk += (0.125F - this.field_175483_bk) * 0.2F; + } + + this.field_175482_b += this.field_175483_bk; + this.field_175486_bm = this.field_175485_bl; + + if (!this.isInWater()) + { + this.field_175485_bl = this.rand.nextFloat(); + } + else if (this.func_175472_n()) + { + this.field_175485_bl += (0.0F - this.field_175485_bl) * 0.25F; + } + else + { + this.field_175485_bl += (1.0F - this.field_175485_bl) * 0.06F; + } + + if (this.func_175472_n() && this.isInWater()) + { + Vec3 vec3 = this.getLook(0.0F); + + for (int i = 0; i < 2; ++i) + { + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width - vec3.xCoord * 1.5D, this.posY + this.rand.nextDouble() * (double)this.height - vec3.yCoord * 1.5D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width - vec3.zCoord * 1.5D, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (this.hasTargetedEntity()) + { + if (this.field_175479_bo < this.func_175464_ck()) + { + ++this.field_175479_bo; + } + + EntityLivingBase entitylivingbase = this.getTargetedEntity(); + + if (entitylivingbase != null) + { + this.getLookHelper().setLookPositionWithEntity(entitylivingbase, 90.0F, 90.0F); + this.getLookHelper().onUpdateLook(); + double d5 = (double)this.func_175477_p(0.0F); + double d0 = entitylivingbase.posX - this.posX; + double d1 = entitylivingbase.posY + (double)(entitylivingbase.height * 0.5F) - (this.posY + (double)this.getEyeHeight()); + double d2 = entitylivingbase.posZ - this.posZ; + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + d0 = d0 / d3; + d1 = d1 / d3; + d2 = d2 / d3; + double d4 = this.rand.nextDouble(); + + while (d4 < d3) + { + d4 += 1.8D - d5 + this.rand.nextDouble() * (1.7D - d5); + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + d0 * d4, this.posY + d1 * d4 + (double)this.getEyeHeight(), this.posZ + d2 * d4, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } + } + + if (this.inWater) + { + this.setAir(300); + } + else if (this.onGround) + { + this.motionY += 0.5D; + this.motionX += (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 0.4F); + this.motionZ += (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 0.4F); + this.rotationYaw = this.rand.nextFloat() * 360.0F; + this.onGround = false; + this.isAirBorne = true; + } + + if (this.hasTargetedEntity()) + { + this.rotationYaw = this.rotationYawHead; + } + + super.onLivingUpdate(); + } + + public float func_175471_a(float p_175471_1_) + { + return this.field_175484_c + (this.field_175482_b - this.field_175484_c) * p_175471_1_; + } + + public float func_175469_o(float p_175469_1_) + { + return this.field_175486_bm + (this.field_175485_bl - this.field_175486_bm) * p_175469_1_; + } + + public float func_175477_p(float p_175477_1_) + { + return ((float)this.field_175479_bo + p_175477_1_) / (float)this.func_175464_ck(); + } + + protected void updateAITasks() + { + super.updateAITasks(); + + if (this.isElder()) + { + int i = 1200; + int j = 1200; + int k = 6000; + int l = 2; + + if ((this.ticksExisted + this.getEntityId()) % 1200 == 0) + { + Potion potion = Potion.digSlowdown; + + for (EntityPlayerMP entityplayermp : this.worldObj.getPlayers(EntityPlayerMP.class, new Predicate() + { + public boolean apply(EntityPlayerMP p_apply_1_) + { + return EntityGuardian.this.getDistanceSqToEntity(p_apply_1_) < 2500.0D && p_apply_1_.theItemInWorldManager.survivalOrAdventure(); + } + })) + { + if (!entityplayermp.isPotionActive(potion) || entityplayermp.getActivePotionEffect(potion).getAmplifier() < 2 || entityplayermp.getActivePotionEffect(potion).getDuration() < 1200) + { + entityplayermp.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(10, 0.0F)); + entityplayermp.addPotionEffect(new PotionEffect(potion.id, 6000, 2)); + } + } + } + + if (!this.hasHome()) + { + this.setHomePosAndDistance(new BlockPos(this), 16); + } + } + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(3) + this.rand.nextInt(lootingModifier + 1); + + if (i > 0) + { + this.entityDropItem(new ItemStack(Items.prismarine_shard, i, 0), 1.0F); + } + + if (this.rand.nextInt(3 + lootingModifier) > 1) + { + this.entityDropItem(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.getMetadata()), 1.0F); + } + else if (this.rand.nextInt(3 + lootingModifier) > 1) + { + this.entityDropItem(new ItemStack(Items.prismarine_crystals, 1, 0), 1.0F); + } + + if (wasRecentlyHit && this.isElder()) + { + this.entityDropItem(new ItemStack(Blocks.sponge, 1, 1), 1.0F); + } + } + + protected void addRandomDrop() + { + ItemStack itemstack = ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, EntityFishHook.func_174855_j())).getItemStack(this.rand); + this.entityDropItem(itemstack, 1.0F); + } + + protected boolean isValidLightLevel() + { + return true; + } + + public boolean isNotColliding() + { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty(); + } + + public boolean getCanSpawnHere() + { + return (this.rand.nextInt(20) == 0 || !this.worldObj.canBlockSeeSky(new BlockPos(this))) && super.getCanSpawnHere(); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (!this.func_175472_n() && !source.isMagicDamage() && source.getSourceOfDamage() instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)source.getSourceOfDamage(); + + if (!source.isExplosion()) + { + entitylivingbase.attackEntityFrom(DamageSource.causeThornsDamage(this), 2.0F); + entitylivingbase.playSound("damage.thorns", 0.5F, 1.0F); + } + } + + this.wander.makeUpdate(); + return super.attackEntityFrom(source, amount); + } + + public int getVerticalFaceSpeed() + { + return 180; + } + + public void moveEntityWithHeading(float strafe, float forward) + { + if (this.isServerWorld()) + { + if (this.isInWater()) + { + this.moveFlying(strafe, forward, 0.1F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8999999761581421D; + this.motionY *= 0.8999999761581421D; + this.motionZ *= 0.8999999761581421D; + + if (!this.func_175472_n() && this.getAttackTarget() == null) + { + this.motionY -= 0.005D; + } + } + else + { + super.moveEntityWithHeading(strafe, forward); + } + } + else + { + super.moveEntityWithHeading(strafe, forward); + } + } + + static class AIGuardianAttack extends EntityAIBase + { + private EntityGuardian theEntity; + private int tickCounter; + + public AIGuardianAttack(EntityGuardian guardian) + { + this.theEntity = guardian; + this.setMutexBits(3); + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget(); + return entitylivingbase != null && entitylivingbase.isEntityAlive(); + } + + public boolean continueExecuting() + { + return super.continueExecuting() && (this.theEntity.isElder() || this.theEntity.getDistanceSqToEntity(this.theEntity.getAttackTarget()) > 9.0D); + } + + public void startExecuting() + { + this.tickCounter = -10; + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.getLookHelper().setLookPositionWithEntity(this.theEntity.getAttackTarget(), 90.0F, 90.0F); + this.theEntity.isAirBorne = true; + } + + public void resetTask() + { + this.theEntity.setTargetedEntity(0); + this.theEntity.setAttackTarget((EntityLivingBase)null); + this.theEntity.wander.makeUpdate(); + } + + public void updateTask() + { + EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget(); + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 90.0F, 90.0F); + + if (!this.theEntity.canEntityBeSeen(entitylivingbase)) + { + this.theEntity.setAttackTarget((EntityLivingBase)null); + } + else + { + ++this.tickCounter; + + if (this.tickCounter == 0) + { + this.theEntity.setTargetedEntity(this.theEntity.getAttackTarget().getEntityId()); + this.theEntity.worldObj.setEntityState(this.theEntity, (byte)21); + } + else if (this.tickCounter >= this.theEntity.func_175464_ck()) + { + float f = 1.0F; + + if (this.theEntity.worldObj.getDifficulty() == EnumDifficulty.HARD) + { + f += 2.0F; + } + + if (this.theEntity.isElder()) + { + f += 2.0F; + } + + entitylivingbase.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this.theEntity, this.theEntity), f); + entitylivingbase.attackEntityFrom(DamageSource.causeMobDamage(this.theEntity), (float)this.theEntity.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue()); + this.theEntity.setAttackTarget((EntityLivingBase)null); + } + else if (this.tickCounter >= 60 && this.tickCounter % 20 == 0) + { + ; + } + + super.updateTask(); + } + } + } + + static class GuardianMoveHelper extends EntityMoveHelper + { + private EntityGuardian entityGuardian; + + public GuardianMoveHelper(EntityGuardian guardian) + { + super(guardian); + this.entityGuardian = guardian; + } + + public void onUpdateMoveHelper() + { + if (this.update && !this.entityGuardian.getNavigator().noPath()) + { + double d0 = this.posX - this.entityGuardian.posX; + double d1 = this.posY - this.entityGuardian.posY; + double d2 = this.posZ - this.entityGuardian.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + d3 = (double)MathHelper.sqrt_double(d3); + d1 = d1 / d3; + float f = (float)(MathHelper.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + this.entityGuardian.rotationYaw = this.limitAngle(this.entityGuardian.rotationYaw, f, 30.0F); + this.entityGuardian.renderYawOffset = this.entityGuardian.rotationYaw; + float f1 = (float)(this.speed * this.entityGuardian.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + this.entityGuardian.setAIMoveSpeed(this.entityGuardian.getAIMoveSpeed() + (f1 - this.entityGuardian.getAIMoveSpeed()) * 0.125F); + double d4 = Math.sin((double)(this.entityGuardian.ticksExisted + this.entityGuardian.getEntityId()) * 0.5D) * 0.05D; + double d5 = Math.cos((double)(this.entityGuardian.rotationYaw * (float)Math.PI / 180.0F)); + double d6 = Math.sin((double)(this.entityGuardian.rotationYaw * (float)Math.PI / 180.0F)); + this.entityGuardian.motionX += d4 * d5; + this.entityGuardian.motionZ += d4 * d6; + d4 = Math.sin((double)(this.entityGuardian.ticksExisted + this.entityGuardian.getEntityId()) * 0.75D) * 0.05D; + this.entityGuardian.motionY += d4 * (d6 + d5) * 0.25D; + this.entityGuardian.motionY += (double)this.entityGuardian.getAIMoveSpeed() * d1 * 0.1D; + EntityLookHelper entitylookhelper = this.entityGuardian.getLookHelper(); + double d7 = this.entityGuardian.posX + d0 / d3 * 2.0D; + double d8 = (double)this.entityGuardian.getEyeHeight() + this.entityGuardian.posY + d1 / d3 * 1.0D; + double d9 = this.entityGuardian.posZ + d2 / d3 * 2.0D; + double d10 = entitylookhelper.getLookPosX(); + double d11 = entitylookhelper.getLookPosY(); + double d12 = entitylookhelper.getLookPosZ(); + + if (!entitylookhelper.getIsLooking()) + { + d10 = d7; + d11 = d8; + d12 = d9; + } + + this.entityGuardian.getLookHelper().setLookPosition(d10 + (d7 - d10) * 0.125D, d11 + (d8 - d11) * 0.125D, d12 + (d9 - d12) * 0.125D, 10.0F, 40.0F); + this.entityGuardian.func_175476_l(true); + } + else + { + this.entityGuardian.setAIMoveSpeed(0.0F); + this.entityGuardian.func_175476_l(false); + } + } + } + + static class GuardianTargetSelector implements Predicate + { + private EntityGuardian parentEntity; + + public GuardianTargetSelector(EntityGuardian guardian) + { + this.parentEntity = guardian; + } + + public boolean apply(EntityLivingBase p_apply_1_) + { + return (p_apply_1_ instanceof EntityPlayer || p_apply_1_ instanceof EntitySquid) && p_apply_1_.getDistanceSqToEntity(this.parentEntity) > 9.0D; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java new file mode 100644 index 0000000..f1a290a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java @@ -0,0 +1,324 @@ +package net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIDefendVillage; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookAtVillager; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIMoveTowardsTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityIronGolem extends EntityGolem +{ + private int homeCheckTimer; + Village villageObj; + private int attackTimer; + private int holdRoseTick; + + public EntityIronGolem(World worldIn) + { + super(worldIn); + this.setSize(1.4F, 2.9F); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F)); + this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true)); + this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(5, new EntityAILookAtVillager(this)); + this.tasks.addTask(6, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIDefendVillage(this)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(3, new EntityIronGolem.AINearestAttackableTargetNonCreeper(this, EntityLiving.class, 10, false, true, IMob.VISIBLE_MOB_SELECTOR)); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + protected void updateAITasks() + { + if (--this.homeCheckTimer <= 0) + { + this.homeCheckTimer = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(this), 32); + + if (this.villageObj == null) + { + this.detachHome(); + } + else + { + BlockPos blockpos = this.villageObj.getCenter(); + this.setHomePosAndDistance(blockpos, (int)((float)this.villageObj.getVillageRadius() * 0.6F)); + } + } + + super.updateAITasks(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + protected int decreaseAirSupply(int p_70682_1_) + { + return p_70682_1_; + } + + protected void collideWithEntity(Entity entityIn) + { + if (entityIn instanceof IMob && !(entityIn instanceof EntityCreeper) && this.getRNG().nextInt(20) == 0) + { + this.setAttackTarget((EntityLivingBase)entityIn); + } + + super.collideWithEntity(entityIn); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.attackTimer > 0) + { + --this.attackTimer; + } + + if (this.holdRoseTick > 0) + { + --this.holdRoseTick; + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D && this.rand.nextInt(5) == 0) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + IBlockState iblockstate = this.worldObj.getBlockState(new BlockPos(i, j, k)); + Block block = iblockstate.getBlock(); + + if (block.getMaterial() != Material.air) + { + this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.rand.nextFloat() - 0.5D), 0.5D, ((double)this.rand.nextFloat() - 0.5D) * 4.0D, new int[] {Block.getStateId(iblockstate)}); + } + } + } + + public boolean canAttackClass(Class cls) + { + return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(cls) ? false : (cls == EntityCreeper.class ? false : super.canAttackClass(cls)); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("PlayerCreated", this.isPlayerCreated()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setPlayerCreated(tagCompund.getBoolean("PlayerCreated")); + } + + public boolean attackEntityAsMob(Entity entityIn) + { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte)4); + boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.rand.nextInt(15))); + + if (flag) + { + entityIn.motionY += 0.4000000059604645D; + this.applyEnchantments(this, entityIn); + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + public void handleStatusUpdate(byte id) + { + if (id == 4) + { + this.attackTimer = 10; + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + } + else if (id == 11) + { + this.holdRoseTick = 400; + } + else + { + super.handleStatusUpdate(id); + } + } + + public Village getVillage() + { + return this.villageObj; + } + + public int getAttackTimer() + { + return this.attackTimer; + } + + public void setHoldingRose(boolean p_70851_1_) + { + this.holdRoseTick = p_70851_1_ ? 400 : 0; + this.worldObj.setEntityState(this, (byte)11); + } + + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.irongolem.walk", 1.0F, 1.0F); + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(3); + + for (int j = 0; j < i; ++j) + { + this.dropItemWithOffset(Item.getItemFromBlock(Blocks.red_flower), 1, (float)BlockFlower.EnumFlowerType.POPPY.getMeta()); + } + + int l = 3 + this.rand.nextInt(3); + + for (int k = 0; k < l; ++k) + { + this.dropItem(Items.iron_ingot, 1); + } + } + + public int getHoldRoseTick() + { + return this.holdRoseTick; + } + + public boolean isPlayerCreated() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setPlayerCreated(boolean p_70849_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70849_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + public void onDeath(DamageSource cause) + { + if (!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) + { + this.villageObj.setReputationForPlayer(this.attackingPlayer.getName(), -5); + } + + super.onDeath(cause); + } + + static class AINearestAttackableTargetNonCreeper extends EntityAINearestAttackableTarget + { + public AINearestAttackableTargetNonCreeper(final EntityCreature creature, Class classTarget, int chance, boolean p_i45858_4_, boolean p_i45858_5_, final Predicate p_i45858_6_) + { + super(creature, classTarget, chance, p_i45858_4_, p_i45858_5_, p_i45858_6_); + this.targetEntitySelector = new Predicate() + { + public boolean apply(T p_apply_1_) + { + if (p_i45858_6_ != null && !p_i45858_6_.apply(p_apply_1_)) + { + return false; + } + else if (p_apply_1_ instanceof EntityCreeper) + { + return false; + } + else + { + if (p_apply_1_ instanceof EntityPlayer) + { + double d0 = AINearestAttackableTargetNonCreeper.this.getTargetDistance(); + + if (p_apply_1_.isSneaking()) + { + d0 *= 0.800000011920929D; + } + + if (p_apply_1_.isInvisible()) + { + float f = ((EntityPlayer)p_apply_1_).getArmorVisibility(); + + if (f < 0.1F) + { + f = 0.1F; + } + + d0 *= (double)(0.7F * f); + } + + if ((double)p_apply_1_.getDistanceToEntity(creature) > d0) + { + return false; + } + } + + return AINearestAttackableTargetNonCreeper.this.isSuitableTarget(p_apply_1_, false); + } + } + }; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java new file mode 100644 index 0000000..b8440e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java @@ -0,0 +1,134 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityMagmaCube extends EntitySlime +{ + public EntityMagmaCube(World worldIn) + { + super(worldIn); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + public boolean getCanSpawnHere() + { + return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL; + } + + public boolean isNotColliding() + { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); + } + + public int getTotalArmorValue() + { + return this.getSlimeSize() * 3; + } + + public int getBrightnessForRender(float partialTicks) + { + return 15728880; + } + + public float getBrightness(float partialTicks) + { + return 1.0F; + } + + protected EnumParticleTypes getParticleType() + { + return EnumParticleTypes.FLAME; + } + + protected EntitySlime createInstance() + { + return new EntityMagmaCube(this.worldObj); + } + + protected Item getDropItem() + { + return Items.magma_cream; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + Item item = this.getDropItem(); + + if (item != null && this.getSlimeSize() > 1) + { + int i = this.rand.nextInt(4) - 2; + + if (lootingModifier > 0) + { + i += this.rand.nextInt(lootingModifier + 1); + } + + for (int j = 0; j < i; ++j) + { + this.dropItem(item, 1); + } + } + } + + public boolean isBurning() + { + return false; + } + + protected int getJumpDelay() + { + return super.getJumpDelay() * 4; + } + + protected void alterSquishAmount() + { + this.squishAmount *= 0.9F; + } + + protected void jump() + { + this.motionY = (double)(0.42F + (float)this.getSlimeSize() * 0.1F); + this.isAirBorne = true; + } + + protected void handleJumpLava() + { + this.motionY = (double)(0.22F + (float)this.getSlimeSize() * 0.05F); + this.isAirBorne = true; + } + + public void fall(float distance, float damageMultiplier) + { + } + + protected boolean canDamagePlayer() + { + return true; + } + + protected int getAttackStrength() + { + return super.getAttackStrength() + 2; + } + + protected String getJumpSound() + { + return this.getSlimeSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small"; + } + + protected boolean makesSoundOnLand() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityMob.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityMob.java new file mode 100644 index 0000000..1c0388a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityMob.java @@ -0,0 +1,167 @@ +package net.minecraft.entity.monster; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public abstract class EntityMob extends EntityCreature implements IMob +{ + public EntityMob(World worldIn) + { + super(worldIn); + this.experienceValue = 5; + } + + public void onLivingUpdate() + { + this.updateArmSwingProgress(); + float f = this.getBrightness(1.0F); + + if (f > 0.5F) + { + this.entityAge += 2; + } + + super.onLivingUpdate(); + } + + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote && this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) + { + this.setDead(); + } + } + + protected String getSwimSound() + { + return "game.hostile.swim"; + } + + protected String getSplashSound() + { + return "game.hostile.swim.splash"; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (super.attackEntityFrom(source, amount)) + { + Entity entity = source.getEntity(); + return this.riddenByEntity != entity && this.ridingEntity != entity ? true : true; + } + else + { + return false; + } + } + + protected String getHurtSound() + { + return "game.hostile.hurt"; + } + + protected String getDeathSound() + { + return "game.hostile.die"; + } + + protected String getFallSoundString(int damageValue) + { + return damageValue > 4 ? "game.hostile.hurt.fall.big" : "game.hostile.hurt.fall.small"; + } + + public boolean attackEntityAsMob(Entity entityIn) + { + float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; + + if (entityIn instanceof EntityLivingBase) + { + f += EnchantmentHelper.getModifierForCreature(this.getHeldItem(), ((EntityLivingBase)entityIn).getCreatureAttribute()); + i += EnchantmentHelper.getKnockbackModifier(this); + } + + boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), f); + + if (flag) + { + if (i > 0) + { + entityIn.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + } + + int j = EnchantmentHelper.getFireAspectModifier(this); + + if (j > 0) + { + entityIn.setFire(j * 4); + } + + this.applyEnchantments(this, entityIn); + } + + return flag; + } + + public float getBlockPathWeight(BlockPos pos) + { + return 0.5F - this.worldObj.getLightBrightness(pos); + } + + protected boolean isValidLightLevel() + { + BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); + + if (this.worldObj.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) + { + return false; + } + else + { + int i = this.worldObj.getLightFromNeighbors(blockpos); + + if (this.worldObj.isThundering()) + { + int j = this.worldObj.getSkylightSubtracted(); + this.worldObj.setSkylightSubtracted(10); + i = this.worldObj.getLightFromNeighbors(blockpos); + this.worldObj.setSkylightSubtracted(j); + } + + return i <= this.rand.nextInt(8); + } + } + + public boolean getCanSpawnHere() + { + return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && this.isValidLightLevel() && super.getCanSpawnHere(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); + } + + protected boolean canDropLoot() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java new file mode 100644 index 0000000..36d44f4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java @@ -0,0 +1,263 @@ +package net.minecraft.entity.monster; + +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityPigZombie extends EntityZombie +{ + private static final UUID ATTACK_SPEED_BOOST_MODIFIER_UUID = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); + private static final AttributeModifier ATTACK_SPEED_BOOST_MODIFIER = (new AttributeModifier(ATTACK_SPEED_BOOST_MODIFIER_UUID, "Attacking speed boost", 0.05D, 0)).setSaved(false); + private int angerLevel; + private int randomSoundDelay; + private UUID angerTargetUUID; + + public EntityPigZombie(World worldIn) + { + super(worldIn); + this.isImmuneToFire = true; + } + + public void setRevengeTarget(EntityLivingBase livingBase) + { + super.setRevengeTarget(livingBase); + + if (livingBase != null) + { + this.angerTargetUUID = livingBase.getUniqueID(); + } + } + + protected void applyEntityAI() + { + this.targetTasks.addTask(1, new EntityPigZombie.AIHurtByAggressor(this)); + this.targetTasks.addTask(2, new EntityPigZombie.AITargetAggressor(this)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(reinforcementChance).setBaseValue(0.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D); + } + + public void onUpdate() + { + super.onUpdate(); + } + + protected void updateAITasks() + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (this.isAngry()) + { + if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) + { + iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER); + } + + --this.angerLevel; + } + else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER)) + { + iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER); + } + + if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) + { + this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F); + } + + if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getAITarget() == null) + { + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByUUID(this.angerTargetUUID); + this.setRevengeTarget(entityplayer); + this.attackingPlayer = entityplayer; + this.recentlyHit = this.getRevengeTimer(); + } + + super.updateAITasks(); + } + + public boolean getCanSpawnHere() + { + return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL; + } + + public boolean isNotColliding() + { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setShort("Anger", (short)this.angerLevel); + + if (this.angerTargetUUID != null) + { + tagCompound.setString("HurtBy", this.angerTargetUUID.toString()); + } + else + { + tagCompound.setString("HurtBy", ""); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.angerLevel = tagCompund.getShort("Anger"); + String s = tagCompund.getString("HurtBy"); + + if (s.length() > 0) + { + this.angerTargetUUID = UUID.fromString(s); + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByUUID(this.angerTargetUUID); + this.setRevengeTarget(entityplayer); + + if (entityplayer != null) + { + this.attackingPlayer = entityplayer; + this.recentlyHit = this.getRevengeTimer(); + } + } + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + Entity entity = source.getEntity(); + + if (entity instanceof EntityPlayer) + { + this.becomeAngryAt(entity); + } + + return super.attackEntityFrom(source, amount); + } + } + + private void becomeAngryAt(Entity p_70835_1_) + { + this.angerLevel = 400 + this.rand.nextInt(400); + this.randomSoundDelay = this.rand.nextInt(40); + + if (p_70835_1_ instanceof EntityLivingBase) + { + this.setRevengeTarget((EntityLivingBase)p_70835_1_); + } + } + + public boolean isAngry() + { + return this.angerLevel > 0; + } + + protected String getLivingSound() + { + return "mob.zombiepig.zpig"; + } + + protected String getHurtSound() + { + return "mob.zombiepig.zpighurt"; + } + + protected String getDeathSound() + { + return "mob.zombiepig.zpigdeath"; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(2 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.rotten_flesh, 1); + } + + i = this.rand.nextInt(2 + lootingModifier); + + for (int k = 0; k < i; ++k) + { + this.dropItem(Items.gold_nugget, 1); + } + } + + public boolean interact(EntityPlayer player) + { + return false; + } + + protected void addRandomDrop() + { + this.dropItem(Items.gold_ingot, 1); + } + + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + super.onInitialSpawn(difficulty, livingdata); + this.setVillager(false); + return livingdata; + } + + static class AIHurtByAggressor extends EntityAIHurtByTarget + { + public AIHurtByAggressor(EntityPigZombie p_i45828_1_) + { + super(p_i45828_1_, true, new Class[0]); + } + + protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) + { + super.setEntityAttackTarget(creatureIn, entityLivingBaseIn); + + if (creatureIn instanceof EntityPigZombie) + { + ((EntityPigZombie)creatureIn).becomeAngryAt(entityLivingBaseIn); + } + } + } + + static class AITargetAggressor extends EntityAINearestAttackableTarget + { + public AITargetAggressor(EntityPigZombie p_i45829_1_) + { + super(p_i45829_1_, EntityPlayer.class, true); + } + + public boolean shouldExecute() + { + return ((EntityPigZombie)this.taskOwner).isAngry() && super.shouldExecute(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java new file mode 100644 index 0000000..d8bc31e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java @@ -0,0 +1,275 @@ +package net.minecraft.entity.monster; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class EntitySilverfish extends EntityMob +{ + private EntitySilverfish.AISummonSilverfish summonSilverfish; + + public EntitySilverfish(World worldIn) + { + super(worldIn); + this.setSize(0.4F, 0.3F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(3, this.summonSilverfish = new EntitySilverfish.AISummonSilverfish(this)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(5, new EntitySilverfish.AIHideInStone(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + public double getYOffset() + { + return 0.2D; + } + + public float getEyeHeight() + { + return 0.1F; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected String getLivingSound() + { + return "mob.silverfish.say"; + } + + protected String getHurtSound() + { + return "mob.silverfish.hit"; + } + + protected String getDeathSound() + { + return "mob.silverfish.kill"; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + if (source instanceof EntityDamageSource || source == DamageSource.magic) + { + this.summonSilverfish.func_179462_f(); + } + + return super.attackEntityFrom(source, amount); + } + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.silverfish.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return null; + } + + public void onUpdate() + { + this.renderYawOffset = this.rotationYaw; + super.onUpdate(); + } + + public float getBlockPathWeight(BlockPos pos) + { + return this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.stone ? 10.0F : super.getBlockPathWeight(pos); + } + + protected boolean isValidLightLevel() + { + return true; + } + + public boolean getCanSpawnHere() + { + if (super.getCanSpawnHere()) + { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 5.0D); + return entityplayer == null; + } + else + { + return false; + } + } + + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.ARTHROPOD; + } + + static class AIHideInStone extends EntityAIWander + { + private final EntitySilverfish silverfish; + private EnumFacing facing; + private boolean field_179484_c; + + public AIHideInStone(EntitySilverfish silverfishIn) + { + super(silverfishIn, 1.0D, 10); + this.silverfish = silverfishIn; + this.setMutexBits(1); + } + + public boolean shouldExecute() + { + if (this.silverfish.getAttackTarget() != null) + { + return false; + } + else if (!this.silverfish.getNavigator().noPath()) + { + return false; + } + else + { + Random random = this.silverfish.getRNG(); + + if (random.nextInt(10) == 0) + { + this.facing = EnumFacing.random(random); + BlockPos blockpos = (new BlockPos(this.silverfish.posX, this.silverfish.posY + 0.5D, this.silverfish.posZ)).offset(this.facing); + IBlockState iblockstate = this.silverfish.worldObj.getBlockState(blockpos); + + if (BlockSilverfish.canContainSilverfish(iblockstate)) + { + this.field_179484_c = true; + return true; + } + } + + this.field_179484_c = false; + return super.shouldExecute(); + } + } + + public boolean continueExecuting() + { + return this.field_179484_c ? false : super.continueExecuting(); + } + + public void startExecuting() + { + if (!this.field_179484_c) + { + super.startExecuting(); + } + else + { + World world = this.silverfish.worldObj; + BlockPos blockpos = (new BlockPos(this.silverfish.posX, this.silverfish.posY + 0.5D, this.silverfish.posZ)).offset(this.facing); + IBlockState iblockstate = world.getBlockState(blockpos); + + if (BlockSilverfish.canContainSilverfish(iblockstate)) + { + world.setBlockState(blockpos, Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3); + this.silverfish.spawnExplosionParticle(); + this.silverfish.setDead(); + } + } + } + } + + static class AISummonSilverfish extends EntityAIBase + { + private EntitySilverfish silverfish; + private int field_179463_b; + + public AISummonSilverfish(EntitySilverfish silverfishIn) + { + this.silverfish = silverfishIn; + } + + public void func_179462_f() + { + if (this.field_179463_b == 0) + { + this.field_179463_b = 20; + } + } + + public boolean shouldExecute() + { + return this.field_179463_b > 0; + } + + public void updateTask() + { + --this.field_179463_b; + + if (this.field_179463_b <= 0) + { + World world = this.silverfish.worldObj; + Random random = this.silverfish.getRNG(); + BlockPos blockpos = new BlockPos(this.silverfish); + + for (int i = 0; i <= 5 && i >= -5; i = i <= 0 ? 1 - i : 0 - i) + { + for (int j = 0; j <= 10 && j >= -10; j = j <= 0 ? 1 - j : 0 - j) + { + for (int k = 0; k <= 10 && k >= -10; k = k <= 0 ? 1 - k : 0 - k) + { + BlockPos blockpos1 = blockpos.add(j, i, k); + IBlockState iblockstate = world.getBlockState(blockpos1); + + if (iblockstate.getBlock() == Blocks.monster_egg) + { + if (world.getGameRules().getBoolean("mobGriefing")) + { + world.destroyBlock(blockpos1, true); + } + else + { + world.setBlockState(blockpos1, ((BlockSilverfish.EnumType)iblockstate.getValue(BlockSilverfish.VARIANT)).getModelBlock(), 3); + } + + if (random.nextBoolean()) + { + return; + } + } + } + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java new file mode 100644 index 0000000..51f7d03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java @@ -0,0 +1,379 @@ +package net.minecraft.entity.monster; + +import java.util.Calendar; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFleeSun; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIRestrictSun; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderHell; + +public class EntitySkeleton extends EntityMob implements IRangedAttackMob +{ + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + public EntitySkeleton(World worldIn) + { + super(worldIn); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIRestrictSun(this)); + this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); + + if (worldIn != null && !worldIn.isRemote) + { + this.setCombatTask(); + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(13, new Byte((byte)0)); + } + + protected String getLivingSound() + { + return "mob.skeleton.say"; + } + + protected String getHurtSound() + { + return "mob.skeleton.hurt"; + } + + protected String getDeathSound() + { + return "mob.skeleton.death"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.skeleton.step", 0.15F, 1.0F); + } + + public boolean attackEntityAsMob(Entity entityIn) + { + if (super.attackEntityAsMob(entityIn)) + { + if (this.getSkeletonType() == 1 && entityIn instanceof EntityLivingBase) + { + ((EntityLivingBase)entityIn).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); + } + + return true; + } + else + { + return false; + } + } + + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEAD; + } + + public void onLivingUpdate() + { + if (this.worldObj.isDaytime() && !this.worldObj.isRemote) + { + float f = this.getBrightness(1.0F); + BlockPos blockpos = new BlockPos(this.posX, (double)Math.round(this.posY), this.posZ); + + if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canSeeSky(blockpos)) + { + boolean flag = true; + ItemStack itemstack = this.getEquipmentInSlot(4); + + if (itemstack != null) + { + if (itemstack.isItemStackDamageable()) + { + itemstack.setItemDamage(itemstack.getItemDamage() + this.rand.nextInt(2)); + + if (itemstack.getItemDamage() >= itemstack.getMaxDamage()) + { + this.renderBrokenItemStack(itemstack); + this.setCurrentItemOrArmor(4, (ItemStack)null); + } + } + + flag = false; + } + + if (flag) + { + this.setFire(8); + } + } + } + + if (this.worldObj.isRemote && this.getSkeletonType() == 1) + { + this.setSize(0.72F, 2.535F); + } + + super.onLivingUpdate(); + } + + public void updateRidden() + { + super.updateRidden(); + + if (this.ridingEntity instanceof EntityCreature) + { + EntityCreature entitycreature = (EntityCreature)this.ridingEntity; + this.renderYawOffset = entitycreature.renderYawOffset; + } + } + + public void onDeath(DamageSource cause) + { + super.onDeath(cause); + + if (cause.getSourceOfDamage() instanceof EntityArrow && cause.getEntity() instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)cause.getEntity(); + double d0 = entityplayer.posX - this.posX; + double d1 = entityplayer.posZ - this.posZ; + + if (d0 * d0 + d1 * d1 >= 2500.0D) + { + entityplayer.triggerAchievement(AchievementList.snipeSkeleton); + } + } + else if (cause.getEntity() instanceof EntityCreeper && ((EntityCreeper)cause.getEntity()).getPowered() && ((EntityCreeper)cause.getEntity()).isAIEnabled()) + { + ((EntityCreeper)cause.getEntity()).func_175493_co(); + this.entityDropItem(new ItemStack(Items.skull, 1, this.getSkeletonType() == 1 ? 1 : 0), 0.0F); + } + } + + protected Item getDropItem() + { + return Items.arrow; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + if (this.getSkeletonType() == 1) + { + int i = this.rand.nextInt(3 + lootingModifier) - 1; + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.coal, 1); + } + } + else + { + int k = this.rand.nextInt(3 + lootingModifier); + + for (int i1 = 0; i1 < k; ++i1) + { + this.dropItem(Items.arrow, 1); + } + } + + int l = this.rand.nextInt(3 + lootingModifier); + + for (int j1 = 0; j1 < l; ++j1) + { + this.dropItem(Items.bone, 1); + } + } + + protected void addRandomDrop() + { + if (this.getSkeletonType() == 1) + { + this.entityDropItem(new ItemStack(Items.skull, 1, 1), 0.0F); + } + } + + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) + { + super.setEquipmentBasedOnDifficulty(difficulty); + this.setCurrentItemOrArmor(0, new ItemStack(Items.bow)); + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + + if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) + { + this.tasks.addTask(4, this.aiAttackOnCollide); + this.setSkeletonType(1); + this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); + } + else + { + this.tasks.addTask(4, this.aiArrowAttack); + this.setEquipmentBasedOnDifficulty(difficulty); + this.setEnchantmentBasedOnDifficulty(difficulty); + } + + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * difficulty.getClampedAdditionalDifficulty()); + + if (this.getEquipmentInSlot(4) == null) + { + Calendar calendar = this.worldObj.getCurrentDate(); + + if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { + this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + return livingdata; + } + + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + + if (itemstack != null && itemstack.getItem() == Items.bow) + { + this.tasks.addTask(4, this.aiArrowAttack); + } + else + { + this.tasks.addTask(4, this.aiAttackOnCollide); + } + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float p_82196_2_) + { + EntityArrow entityarrow = new EntityArrow(this.worldObj, this, target, 1.6F, (float)(14 - this.worldObj.getDifficulty().getDifficultyId() * 4)); + int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); + entityarrow.setDamage((double)(p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D + (double)((float)this.worldObj.getDifficulty().getDifficultyId() * 0.11F)); + + if (i > 0) + { + entityarrow.setDamage(entityarrow.getDamage() + (double)i * 0.5D + 0.5D); + } + + if (j > 0) + { + entityarrow.setKnockbackStrength(j); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1) + { + entityarrow.setFire(100); + } + + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entityarrow); + } + + public int getSkeletonType() + { + return this.dataWatcher.getWatchableObjectByte(13); + } + + public void setSkeletonType(int p_82201_1_) + { + this.dataWatcher.updateObject(13, Byte.valueOf((byte)p_82201_1_)); + this.isImmuneToFire = p_82201_1_ == 1; + + if (p_82201_1_ == 1) + { + this.setSize(0.72F, 2.535F); + } + else + { + this.setSize(0.6F, 1.95F); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("SkeletonType", 99)) + { + int i = tagCompund.getByte("SkeletonType"); + this.setSkeletonType(i); + } + + this.setCombatTask(); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setByte("SkeletonType", (byte)this.getSkeletonType()); + } + + public void setCurrentItemOrArmor(int slotIn, ItemStack stack) + { + super.setCurrentItemOrArmor(slotIn, stack); + + if (!this.worldObj.isRemote && slotIn == 0) + { + this.setCombatTask(); + } + } + + public float getEyeHeight() + { + return this.getSkeletonType() == 1 ? super.getEyeHeight() : 1.74F; + } + + public double getYOffset() + { + return this.isChild() ? 0.0D : -0.35D; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySlime.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySlime.java new file mode 100644 index 0000000..94cf5f3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySlime.java @@ -0,0 +1,524 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIFindEntityNearest; +import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +public class EntitySlime extends EntityLiving implements IMob +{ + public float squishAmount; + public float squishFactor; + public float prevSquishFactor; + private boolean wasOnGround; + + public EntitySlime(World worldIn) + { + super(worldIn); + this.moveHelper = new EntitySlime.SlimeMoveHelper(this); + this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this)); + this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this)); + this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this)); + this.tasks.addTask(5, new EntitySlime.AISlimeHop(this)); + this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); + this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class)); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)1)); + } + + protected void setSlimeSize(int size) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)size)); + this.setSize(0.51000005F * (float)size, 0.51000005F * (float)size); + this.setPosition(this.posX, this.posY, this.posZ); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue((double)(size * size)); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue((double)(0.2F + 0.1F * (float)size)); + this.setHealth(this.getMaxHealth()); + this.experienceValue = size; + } + + public int getSlimeSize() + { + return this.dataWatcher.getWatchableObjectByte(16); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Size", this.getSlimeSize() - 1); + tagCompound.setBoolean("wasOnGround", this.wasOnGround); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + int i = tagCompund.getInteger("Size"); + + if (i < 0) + { + i = 0; + } + + this.setSlimeSize(i + 1); + this.wasOnGround = tagCompund.getBoolean("wasOnGround"); + } + + protected EnumParticleTypes getParticleType() + { + return EnumParticleTypes.SLIME; + } + + protected String getJumpSound() + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + public void onUpdate() + { + if (!this.worldObj.isRemote && this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL && this.getSlimeSize() > 0) + { + this.isDead = true; + } + + this.squishFactor += (this.squishAmount - this.squishFactor) * 0.5F; + this.prevSquishFactor = this.squishFactor; + super.onUpdate(); + + if (this.onGround && !this.wasOnGround) + { + int i = this.getSlimeSize(); + + for (int j = 0; j < i * 8; ++j) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = this.rand.nextFloat() * 0.5F + 0.5F; + float f2 = MathHelper.sin(f) * (float)i * 0.5F * f1; + float f3 = MathHelper.cos(f) * (float)i * 0.5F * f1; + World world = this.worldObj; + EnumParticleTypes enumparticletypes = this.getParticleType(); + double d0 = this.posX + (double)f2; + double d1 = this.posZ + (double)f3; + world.spawnParticle(enumparticletypes, d0, this.getEntityBoundingBox().minY, d1, 0.0D, 0.0D, 0.0D, new int[0]); + } + + if (this.makesSoundOnLand()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } + + this.squishAmount = -0.5F; + } + else if (!this.onGround && this.wasOnGround) + { + this.squishAmount = 1.0F; + } + + this.wasOnGround = this.onGround; + this.alterSquishAmount(); + } + + protected void alterSquishAmount() + { + this.squishAmount *= 0.6F; + } + + protected int getJumpDelay() + { + return this.rand.nextInt(20) + 10; + } + + protected EntitySlime createInstance() + { + return new EntitySlime(this.worldObj); + } + + public void onDataWatcherUpdate(int dataID) + { + if (dataID == 16) + { + int i = this.getSlimeSize(); + this.setSize(0.51000005F * (float)i, 0.51000005F * (float)i); + this.rotationYaw = this.rotationYawHead; + this.renderYawOffset = this.rotationYawHead; + + if (this.isInWater() && this.rand.nextInt(20) == 0) + { + this.resetHeight(); + } + } + + super.onDataWatcherUpdate(dataID); + } + + public void setDead() + { + int i = this.getSlimeSize(); + + if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0.0F) + { + int j = 2 + this.rand.nextInt(3); + + for (int k = 0; k < j; ++k) + { + float f = ((float)(k % 2) - 0.5F) * (float)i / 4.0F; + float f1 = ((float)(k / 2) - 0.5F) * (float)i / 4.0F; + EntitySlime entityslime = this.createInstance(); + + if (this.hasCustomName()) + { + entityslime.setCustomNameTag(this.getCustomNameTag()); + } + + if (this.isNoDespawnRequired()) + { + entityslime.enablePersistence(); + } + + entityslime.setSlimeSize(i / 2); + entityslime.setLocationAndAngles(this.posX + (double)f, this.posY + 0.5D, this.posZ + (double)f1, this.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityslime); + } + } + + super.setDead(); + } + + public void applyEntityCollision(Entity entityIn) + { + super.applyEntityCollision(entityIn); + + if (entityIn instanceof EntityIronGolem && this.canDamagePlayer()) + { + this.func_175451_e((EntityLivingBase)entityIn); + } + } + + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (this.canDamagePlayer()) + { + this.func_175451_e(entityIn); + } + } + + protected void func_175451_e(EntityLivingBase p_175451_1_) + { + int i = this.getSlimeSize(); + + if (this.canEntityBeSeen(p_175451_1_) && this.getDistanceSqToEntity(p_175451_1_) < 0.6D * (double)i * 0.6D * (double)i && p_175451_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength())) + { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.applyEnchantments(this, p_175451_1_); + } + } + + public float getEyeHeight() + { + return 0.625F * this.height; + } + + protected boolean canDamagePlayer() + { + return this.getSlimeSize() > 1; + } + + protected int getAttackStrength() + { + return this.getSlimeSize(); + } + + protected String getHurtSound() + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + protected String getDeathSound() + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + protected Item getDropItem() + { + return this.getSlimeSize() == 1 ? Items.slime_ball : null; + } + + public boolean getCanSpawnHere() + { + BlockPos blockpos = new BlockPos(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ)); + Chunk chunk = this.worldObj.getChunkFromBlockCoords(blockpos); + + if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) + { + return false; + } + else + { + if (this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL) + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos); + + if (biomegenbase == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getLightFromNeighbors(new BlockPos(this)) <= this.rand.nextInt(8)) + { + return super.getCanSpawnHere(); + } + + if (this.rand.nextInt(10) == 0 && chunk.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) + { + return super.getCanSpawnHere(); + } + } + + return false; + } + } + + protected float getSoundVolume() + { + return 0.4F * (float)this.getSlimeSize(); + } + + public int getVerticalFaceSpeed() + { + return 0; + } + + protected boolean makesSoundOnJump() + { + return this.getSlimeSize() > 0; + } + + protected boolean makesSoundOnLand() + { + return this.getSlimeSize() > 2; + } + + protected void jump() + { + this.motionY = 0.41999998688697815D; + this.isAirBorne = true; + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + int i = this.rand.nextInt(3); + + if (i < 2 && this.rand.nextFloat() < 0.5F * difficulty.getClampedAdditionalDifficulty()) + { + ++i; + } + + int j = 1 << i; + this.setSlimeSize(j); + return super.onInitialSpawn(difficulty, livingdata); + } + + static class AISlimeAttack extends EntityAIBase + { + private EntitySlime slime; + private int field_179465_b; + + public AISlimeAttack(EntitySlime slimeIn) + { + this.slime = slimeIn; + this.setMutexBits(2); + } + + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.slime.getAttackTarget(); + return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : !(entitylivingbase instanceof EntityPlayer) || !((EntityPlayer)entitylivingbase).capabilities.disableDamage); + } + + public void startExecuting() + { + this.field_179465_b = 300; + super.startExecuting(); + } + + public boolean continueExecuting() + { + EntityLivingBase entitylivingbase = this.slime.getAttackTarget(); + return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage ? false : --this.field_179465_b > 0)); + } + + public void updateTask() + { + this.slime.faceEntity(this.slime.getAttackTarget(), 10.0F, 10.0F); + ((EntitySlime.SlimeMoveHelper)this.slime.getMoveHelper()).func_179920_a(this.slime.rotationYaw, this.slime.canDamagePlayer()); + } + } + + static class AISlimeFaceRandom extends EntityAIBase + { + private EntitySlime slime; + private float field_179459_b; + private int field_179460_c; + + public AISlimeFaceRandom(EntitySlime slimeIn) + { + this.slime = slimeIn; + this.setMutexBits(2); + } + + public boolean shouldExecute() + { + return this.slime.getAttackTarget() == null && (this.slime.onGround || this.slime.isInWater() || this.slime.isInLava()); + } + + public void updateTask() + { + if (--this.field_179460_c <= 0) + { + this.field_179460_c = 40 + this.slime.getRNG().nextInt(60); + this.field_179459_b = (float)this.slime.getRNG().nextInt(360); + } + + ((EntitySlime.SlimeMoveHelper)this.slime.getMoveHelper()).func_179920_a(this.field_179459_b, false); + } + } + + static class AISlimeFloat extends EntityAIBase + { + private EntitySlime slime; + + public AISlimeFloat(EntitySlime slimeIn) + { + this.slime = slimeIn; + this.setMutexBits(5); + ((PathNavigateGround)slimeIn.getNavigator()).setCanSwim(true); + } + + public boolean shouldExecute() + { + return this.slime.isInWater() || this.slime.isInLava(); + } + + public void updateTask() + { + if (this.slime.getRNG().nextFloat() < 0.8F) + { + this.slime.getJumpHelper().setJumping(); + } + + ((EntitySlime.SlimeMoveHelper)this.slime.getMoveHelper()).setSpeed(1.2D); + } + } + + static class AISlimeHop extends EntityAIBase + { + private EntitySlime slime; + + public AISlimeHop(EntitySlime slimeIn) + { + this.slime = slimeIn; + this.setMutexBits(5); + } + + public boolean shouldExecute() + { + return true; + } + + public void updateTask() + { + ((EntitySlime.SlimeMoveHelper)this.slime.getMoveHelper()).setSpeed(1.0D); + } + } + + static class SlimeMoveHelper extends EntityMoveHelper + { + private float field_179922_g; + private int field_179924_h; + private EntitySlime slime; + private boolean field_179923_j; + + public SlimeMoveHelper(EntitySlime slimeIn) + { + super(slimeIn); + this.slime = slimeIn; + } + + public void func_179920_a(float p_179920_1_, boolean p_179920_2_) + { + this.field_179922_g = p_179920_1_; + this.field_179923_j = p_179920_2_; + } + + public void setSpeed(double speedIn) + { + this.speed = speedIn; + this.update = true; + } + + public void onUpdateMoveHelper() + { + this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, this.field_179922_g, 30.0F); + this.entity.rotationYawHead = this.entity.rotationYaw; + this.entity.renderYawOffset = this.entity.rotationYaw; + + if (!this.update) + { + this.entity.setMoveForward(0.0F); + } + else + { + this.update = false; + + if (this.entity.onGround) + { + this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + + if (this.field_179924_h-- <= 0) + { + this.field_179924_h = this.slime.getJumpDelay(); + + if (this.field_179923_j) + { + this.field_179924_h /= 3; + } + + this.slime.getJumpHelper().setJumping(); + + if (this.slime.makesSoundOnJump()) + { + this.slime.playSound(this.slime.getJumpSound(), this.slime.getSoundVolume(), ((this.slime.getRNG().nextFloat() - this.slime.getRNG().nextFloat()) * 0.2F + 1.0F) * 0.8F); + } + } + else + { + this.slime.moveStrafing = this.slime.moveForward = 0.0F; + this.entity.setAIMoveSpeed(0.0F); + } + } + else + { + this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySnowman.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySnowman.java new file mode 100644 index 0000000..b711f0e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySnowman.java @@ -0,0 +1,112 @@ +package net.minecraft.entity.monster; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySnowman extends EntityGolem implements IRangedAttackMob +{ + public EntitySnowman(World worldIn) + { + super(worldIn); + this.setSize(0.7F, 1.9F); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.25D, 20, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(4, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, IMob.mobSelector)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (!this.worldObj.isRemote) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (this.isWet()) + { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.worldObj.getBiomeGenForCoords(new BlockPos(i, 0, k)).getFloatTemperature(new BlockPos(i, j, k)) > 1.0F) + { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + for (int l = 0; l < 4; ++l) + { + i = MathHelper.floor_double(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F)); + j = MathHelper.floor_double(this.posY); + k = MathHelper.floor_double(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); + BlockPos blockpos = new BlockPos(i, j, k); + + if (this.worldObj.getBlockState(blockpos).getBlock().getMaterial() == Material.air && this.worldObj.getBiomeGenForCoords(new BlockPos(i, 0, k)).getFloatTemperature(blockpos) < 0.8F && Blocks.snow_layer.canPlaceBlockAt(this.worldObj, blockpos)) + { + this.worldObj.setBlockState(blockpos, Blocks.snow_layer.getDefaultState()); + } + } + } + } + + protected Item getDropItem() + { + return Items.snowball; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(16); + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.snowball, 1); + } + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float p_82196_2_) + { + EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this); + double d0 = target.posY + (double)target.getEyeHeight() - 1.100000023841858D; + double d1 = target.posX - this.posX; + double d2 = d0 - entitysnowball.posY; + double d3 = target.posZ - this.posZ; + float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3) * 0.2F; + entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F); + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entitysnowball); + } + + public float getEyeHeight() + { + return 1.7F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySpider.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySpider.java new file mode 100644 index 0000000..1794103 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntitySpider.java @@ -0,0 +1,265 @@ +package net.minecraft.entity.monster; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateClimber; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.BlockPos; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntitySpider extends EntityMob +{ + public EntitySpider(World worldIn) + { + super(worldIn); + this.setSize(1.4F, 0.9F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntitySpider.AISpiderAttack(this, EntityPlayer.class)); + this.tasks.addTask(4, new EntitySpider.AISpiderAttack(this, EntityIronGolem.class)); + this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntitySpider.AISpiderTarget(this, EntityPlayer.class)); + this.targetTasks.addTask(3, new EntitySpider.AISpiderTarget(this, EntityIronGolem.class)); + } + + public double getMountedYOffset() + { + return (double)(this.height * 0.5F); + } + + protected PathNavigate getNewNavigator(World worldIn) + { + return new PathNavigateClimber(this, worldIn); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote) + { + this.setBesideClimbableBlock(this.isCollidedHorizontally); + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(16.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + protected String getLivingSound() + { + return "mob.spider.say"; + } + + protected String getHurtSound() + { + return "mob.spider.say"; + } + + protected String getDeathSound() + { + return "mob.spider.death"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.spider.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return Items.string; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + super.dropFewItems(wasRecentlyHit, lootingModifier); + + if (wasRecentlyHit && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + lootingModifier) > 0)) + { + this.dropItem(Items.spider_eye, 1); + } + } + + public boolean isOnLadder() + { + return this.isBesideClimbableBlock(); + } + + public void setInWeb() + { + } + + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.ARTHROPOD; + } + + public boolean isPotionApplicable(PotionEffect potioneffectIn) + { + return potioneffectIn.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(potioneffectIn); + } + + public boolean isBesideClimbableBlock() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setBesideClimbableBlock(boolean p_70839_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70839_1_) + { + b0 = (byte)(b0 | 1); + } + else + { + b0 = (byte)(b0 & -2); + } + + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + + if (this.worldObj.rand.nextInt(100) == 0) + { + EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj); + entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityskeleton.onInitialSpawn(difficulty, (IEntityLivingData)null); + this.worldObj.spawnEntityInWorld(entityskeleton); + entityskeleton.mountEntity(this); + } + + if (livingdata == null) + { + livingdata = new EntitySpider.GroupData(); + + if (this.worldObj.getDifficulty() == EnumDifficulty.HARD && this.worldObj.rand.nextFloat() < 0.1F * difficulty.getClampedAdditionalDifficulty()) + { + ((EntitySpider.GroupData)livingdata).func_111104_a(this.worldObj.rand); + } + } + + if (livingdata instanceof EntitySpider.GroupData) + { + int i = ((EntitySpider.GroupData)livingdata).potionEffectId; + + if (i > 0 && Potion.potionTypes[i] != null) + { + this.addPotionEffect(new PotionEffect(i, Integer.MAX_VALUE)); + } + } + + return livingdata; + } + + public float getEyeHeight() + { + return 0.65F; + } + + static class AISpiderAttack extends EntityAIAttackOnCollide + { + public AISpiderAttack(EntitySpider spider, Class targetClass) + { + super(spider, targetClass, 1.0D, true); + } + + public boolean continueExecuting() + { + float f = this.attacker.getBrightness(1.0F); + + if (f >= 0.5F && this.attacker.getRNG().nextInt(100) == 0) + { + this.attacker.setAttackTarget((EntityLivingBase)null); + return false; + } + else + { + return super.continueExecuting(); + } + } + + protected double func_179512_a(EntityLivingBase attackTarget) + { + return (double)(4.0F + attackTarget.width); + } + } + + static class AISpiderTarget extends EntityAINearestAttackableTarget + { + public AISpiderTarget(EntitySpider spider, Class classTarget) + { + super(spider, classTarget, true); + } + + public boolean shouldExecute() + { + float f = this.taskOwner.getBrightness(1.0F); + return f >= 0.5F ? false : super.shouldExecute(); + } + } + + public static class GroupData implements IEntityLivingData + { + public int potionEffectId; + + public void func_111104_a(Random rand) + { + int i = rand.nextInt(5); + + if (i <= 1) + { + this.potionEffectId = Potion.moveSpeed.id; + } + else if (i <= 2) + { + this.potionEffectId = Potion.damageBoost.id; + } + else if (i <= 3) + { + this.potionEffectId = Potion.regeneration.id; + } + else if (i <= 4) + { + this.potionEffectId = Potion.invisibility.id; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityWitch.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityWitch.java new file mode 100644 index 0000000..94b618c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityWitch.java @@ -0,0 +1,248 @@ +package net.minecraft.entity.monster; + +import java.util.List; +import java.util.UUID; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityWitch extends EntityMob implements IRangedAttackMob +{ + private static final UUID MODIFIER_UUID = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); + private static final AttributeModifier MODIFIER = (new AttributeModifier(MODIFIER_UUID, "Drinking speed penalty", -0.25D, 0)).setSaved(false); + private static final Item[] witchDrops = new Item[] {Items.glowstone_dust, Items.sugar, Items.redstone, Items.spider_eye, Items.glass_bottle, Items.gunpowder, Items.stick, Items.stick}; + private int witchAttackTimer; + + public EntityWitch(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 1.95F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 60, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(3, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + } + + protected void entityInit() + { + super.entityInit(); + this.getDataWatcher().addObject(21, Byte.valueOf((byte)0)); + } + + protected String getLivingSound() + { + return null; + } + + protected String getHurtSound() + { + return null; + } + + protected String getDeathSound() + { + return null; + } + + public void setAggressive(boolean aggressive) + { + this.getDataWatcher().updateObject(21, Byte.valueOf((byte)(aggressive ? 1 : 0))); + } + + public boolean getAggressive() + { + return this.getDataWatcher().getWatchableObjectByte(21) == 1; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(26.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + public void onLivingUpdate() + { + if (!this.worldObj.isRemote) + { + if (this.getAggressive()) + { + if (this.witchAttackTimer-- <= 0) + { + this.setAggressive(false); + ItemStack itemstack = this.getHeldItem(); + this.setCurrentItemOrArmor(0, (ItemStack)null); + + if (itemstack != null && itemstack.getItem() == Items.potionitem) + { + List list = Items.potionitem.getEffects(itemstack); + + if (list != null) + { + for (PotionEffect potioneffect : list) + { + this.addPotionEffect(new PotionEffect(potioneffect)); + } + } + } + + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).removeModifier(MODIFIER); + } + } + else + { + int i = -1; + + if (this.rand.nextFloat() < 0.15F && this.isInsideOfMaterial(Material.water) && !this.isPotionActive(Potion.waterBreathing)) + { + i = 8237; + } + else if (this.rand.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) + { + i = 16307; + } + else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) + { + i = 16341; + } + else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) + { + i = 16274; + } + else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) + { + i = 16274; + } + + if (i > -1) + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.potionitem, 1, i)); + this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration(); + this.setAggressive(true); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(MODIFIER); + iattributeinstance.applyModifier(MODIFIER); + } + } + + if (this.rand.nextFloat() < 7.5E-4F) + { + this.worldObj.setEntityState(this, (byte)15); + } + } + + super.onLivingUpdate(); + } + + public void handleStatusUpdate(byte id) + { + if (id == 15) + { + for (int i = 0; i < this.rand.nextInt(35) + 10; ++i) + { + this.worldObj.spawnParticle(EnumParticleTypes.SPELL_WITCH, this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.getEntityBoundingBox().maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + else + { + super.handleStatusUpdate(id); + } + } + + protected float applyPotionDamageCalculations(DamageSource source, float damage) + { + damage = super.applyPotionDamageCalculations(source, damage); + + if (source.getEntity() == this) + { + damage = 0.0F; + } + + if (source.isMagicDamage()) + { + damage = (float)((double)damage * 0.15D); + } + + return damage; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(3) + 1; + + for (int j = 0; j < i; ++j) + { + int k = this.rand.nextInt(3); + Item item = witchDrops[this.rand.nextInt(witchDrops.length)]; + + if (lootingModifier > 0) + { + k += this.rand.nextInt(lootingModifier + 1); + } + + for (int l = 0; l < k; ++l) + { + this.dropItem(item, 1); + } + } + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float p_82196_2_) + { + if (!this.getAggressive()) + { + EntityPotion entitypotion = new EntityPotion(this.worldObj, this, 32732); + double d0 = target.posY + (double)target.getEyeHeight() - 1.100000023841858D; + entitypotion.rotationPitch -= -20.0F; + double d1 = target.posX + target.motionX - this.posX; + double d2 = d0 - this.posY; + double d3 = target.posZ + target.motionZ - this.posZ; + float f = MathHelper.sqrt_double(d1 * d1 + d3 * d3); + + if (f >= 8.0F && !target.isPotionActive(Potion.moveSlowdown)) + { + entitypotion.setPotionDamage(32698); + } + else if (target.getHealth() >= 8.0F && !target.isPotionActive(Potion.poison)) + { + entitypotion.setPotionDamage(32660); + } + else if (f <= 3.0F && !target.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F) + { + entitypotion.setPotionDamage(32696); + } + + entitypotion.setThrowableHeading(d1, d2 + (double)(f * 0.2F), d3, 0.75F, 8.0F); + this.worldObj.spawnEntityInWorld(entitypotion); + } + } + + public float getEyeHeight() + { + return 1.62F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityZombie.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityZombie.java new file mode 100644 index 0000000..c46340e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/EntityZombie.java @@ -0,0 +1,714 @@ +package net.minecraft.entity.monster; + +import java.util.Calendar; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBreakDoor; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.MathHelper; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityZombie extends EntityMob +{ + protected static final IAttribute reinforcementChance = (new RangedAttribute((IAttribute)null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).setDescription("Spawn Reinforcements Chance"); + private static final UUID babySpeedBoostUUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); + private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, "Baby speed boost", 0.5D, 1); + private final EntityAIBreakDoor breakDoor = new EntityAIBreakDoor(this); + private int conversionTime; + private boolean isBreakDoorsTaskSet = false; + private float zombieWidth = -1.0F; + private float zombieHeight; + + public EntityZombie(World worldIn) + { + super(worldIn); + ((PathNavigateGround)this.getNavigator()).setBreakDoors(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.applyEntityAI(); + this.setSize(0.6F, 1.95F); + } + + protected void applyEntityAI() + { + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityIronGolem.class, 1.0D, true)); + this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityPigZombie.class})); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(35.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); + this.getAttributeMap().registerAttribute(reinforcementChance).setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); + } + + protected void entityInit() + { + super.entityInit(); + this.getDataWatcher().addObject(12, Byte.valueOf((byte)0)); + this.getDataWatcher().addObject(13, Byte.valueOf((byte)0)); + this.getDataWatcher().addObject(14, Byte.valueOf((byte)0)); + } + + public int getTotalArmorValue() + { + int i = super.getTotalArmorValue() + 2; + + if (i > 20) + { + i = 20; + } + + return i; + } + + public boolean isBreakDoorsTaskSet() + { + return this.isBreakDoorsTaskSet; + } + + public void setBreakDoorsAItask(boolean par1) + { + if (this.isBreakDoorsTaskSet != par1) + { + this.isBreakDoorsTaskSet = par1; + + if (par1) + { + this.tasks.addTask(1, this.breakDoor); + } + else + { + this.tasks.removeTask(this.breakDoor); + } + } + } + + public boolean isChild() + { + return this.getDataWatcher().getWatchableObjectByte(12) == 1; + } + + protected int getExperiencePoints(EntityPlayer player) + { + if (this.isChild()) + { + this.experienceValue = (int)((float)this.experienceValue * 2.5F); + } + + return super.getExperiencePoints(player); + } + + public void setChild(boolean childZombie) + { + this.getDataWatcher().updateObject(12, Byte.valueOf((byte)(childZombie ? 1 : 0))); + + if (this.worldObj != null && !this.worldObj.isRemote) + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(babySpeedBoostModifier); + + if (childZombie) + { + iattributeinstance.applyModifier(babySpeedBoostModifier); + } + } + + this.setChildSize(childZombie); + } + + public boolean isVillager() + { + return this.getDataWatcher().getWatchableObjectByte(13) == 1; + } + + public void setVillager(boolean villager) + { + this.getDataWatcher().updateObject(13, Byte.valueOf((byte)(villager ? 1 : 0))); + } + + public void onLivingUpdate() + { + if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild()) + { + float f = this.getBrightness(1.0F); + BlockPos blockpos = new BlockPos(this.posX, (double)Math.round(this.posY), this.posZ); + + if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canSeeSky(blockpos)) + { + boolean flag = true; + ItemStack itemstack = this.getEquipmentInSlot(4); + + if (itemstack != null) + { + if (itemstack.isItemStackDamageable()) + { + itemstack.setItemDamage(itemstack.getItemDamage() + this.rand.nextInt(2)); + + if (itemstack.getItemDamage() >= itemstack.getMaxDamage()) + { + this.renderBrokenItemStack(itemstack); + this.setCurrentItemOrArmor(4, (ItemStack)null); + } + } + + flag = false; + } + + if (flag) + { + this.setFire(8); + } + } + } + + if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof EntityChicken) + { + ((EntityLiving)this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D); + } + + super.onLivingUpdate(); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (super.attackEntityFrom(source, amount)) + { + EntityLivingBase entitylivingbase = this.getAttackTarget(); + + if (entitylivingbase == null && source.getEntity() instanceof EntityLivingBase) + { + entitylivingbase = (EntityLivingBase)source.getEntity(); + } + + if (entitylivingbase != null && this.worldObj.getDifficulty() == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(reinforcementChance).getAttributeValue()) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + EntityZombie entityzombie = new EntityZombie(this.worldObj); + + for (int l = 0; l < 50; ++l) + { + int i1 = i + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int j1 = j + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int k1 = k + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + + if (World.doesBlockHaveSolidTopSurface(this.worldObj, new BlockPos(i1, j1 - 1, k1)) && this.worldObj.getLightFromNeighbors(new BlockPos(i1, j1, k1)) < 10) + { + entityzombie.setPosition((double)i1, (double)j1, (double)k1); + + if (!this.worldObj.isAnyPlayerWithinRangeAt((double)i1, (double)j1, (double)k1, 7.0D) && this.worldObj.checkNoEntityCollision(entityzombie.getEntityBoundingBox(), entityzombie) && this.worldObj.getCollidingBoundingBoxes(entityzombie, entityzombie.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(entityzombie.getEntityBoundingBox())) + { + this.worldObj.spawnEntityInWorld(entityzombie); + entityzombie.setAttackTarget(entitylivingbase); + entityzombie.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), (IEntityLivingData)null); + this.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + entityzombie.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); + break; + } + } + } + } + + return true; + } + else + { + return false; + } + } + + public void onUpdate() + { + if (!this.worldObj.isRemote && this.isConverting()) + { + int i = this.getConversionTimeBoost(); + this.conversionTime -= i; + + if (this.conversionTime <= 0) + { + this.convertToVillager(); + } + } + + super.onUpdate(); + } + + public boolean attackEntityAsMob(Entity entityIn) + { + boolean flag = super.attackEntityAsMob(entityIn); + + if (flag) + { + int i = this.worldObj.getDifficulty().getDifficultyId(); + + if (this.getHeldItem() == null && this.isBurning() && this.rand.nextFloat() < (float)i * 0.3F) + { + entityIn.setFire(2 * i); + } + } + + return flag; + } + + protected String getLivingSound() + { + return "mob.zombie.say"; + } + + protected String getHurtSound() + { + return "mob.zombie.hurt"; + } + + protected String getDeathSound() + { + return "mob.zombie.death"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return Items.rotten_flesh; + } + + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEAD; + } + + protected void addRandomDrop() + { + switch (this.rand.nextInt(3)) + { + case 0: + this.dropItem(Items.iron_ingot, 1); + break; + + case 1: + this.dropItem(Items.carrot, 1); + break; + + case 2: + this.dropItem(Items.potato, 1); + } + } + + protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) + { + super.setEquipmentBasedOnDifficulty(difficulty); + + if (this.rand.nextFloat() < (this.worldObj.getDifficulty() == EnumDifficulty.HARD ? 0.05F : 0.01F)) + { + int i = this.rand.nextInt(3); + + if (i == 0) + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); + } + else + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_shovel)); + } + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.isChild()) + { + tagCompound.setBoolean("IsBaby", true); + } + + if (this.isVillager()) + { + tagCompound.setBoolean("IsVillager", true); + } + + tagCompound.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); + tagCompound.setBoolean("CanBreakDoors", this.isBreakDoorsTaskSet()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.getBoolean("IsBaby")) + { + this.setChild(true); + } + + if (tagCompund.getBoolean("IsVillager")) + { + this.setVillager(true); + } + + if (tagCompund.hasKey("ConversionTime", 99) && tagCompund.getInteger("ConversionTime") > -1) + { + this.startConversion(tagCompund.getInteger("ConversionTime")); + } + + this.setBreakDoorsAItask(tagCompund.getBoolean("CanBreakDoors")); + } + + public void onKillEntity(EntityLivingBase entityLivingIn) + { + super.onKillEntity(entityLivingIn); + + if ((this.worldObj.getDifficulty() == EnumDifficulty.NORMAL || this.worldObj.getDifficulty() == EnumDifficulty.HARD) && entityLivingIn instanceof EntityVillager) + { + if (this.worldObj.getDifficulty() != EnumDifficulty.HARD && this.rand.nextBoolean()) + { + return; + } + + EntityLiving entityliving = (EntityLiving)entityLivingIn; + EntityZombie entityzombie = new EntityZombie(this.worldObj); + entityzombie.copyLocationAndAnglesFrom(entityLivingIn); + this.worldObj.removeEntity(entityLivingIn); + entityzombie.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), (IEntityLivingData)null); + entityzombie.setVillager(true); + + if (entityLivingIn.isChild()) + { + entityzombie.setChild(true); + } + + entityzombie.setNoAI(entityliving.isAIDisabled()); + + if (entityliving.hasCustomName()) + { + entityzombie.setCustomNameTag(entityliving.getCustomNameTag()); + entityzombie.setAlwaysRenderNameTag(entityliving.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entityzombie); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0); + } + } + + public float getEyeHeight() + { + float f = 1.74F; + + if (this.isChild()) + { + f = (float)((double)f - 0.81D); + } + + return f; + } + + protected boolean func_175448_a(ItemStack stack) + { + return stack.getItem() == Items.egg && this.isChild() && this.isRiding() ? false : super.func_175448_a(stack); + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + float f = difficulty.getClampedAdditionalDifficulty(); + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f); + + if (livingdata == null) + { + livingdata = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < 0.05F, this.worldObj.rand.nextFloat() < 0.05F); + } + + if (livingdata instanceof EntityZombie.GroupData) + { + EntityZombie.GroupData entityzombie$groupdata = (EntityZombie.GroupData)livingdata; + + if (entityzombie$groupdata.isVillager) + { + this.setVillager(true); + } + + if (entityzombie$groupdata.isChild) + { + this.setChild(true); + + if ((double)this.worldObj.rand.nextFloat() < 0.05D) + { + List list = this.worldObj.getEntitiesWithinAABB(EntityChicken.class, this.getEntityBoundingBox().expand(5.0D, 3.0D, 5.0D), EntitySelectors.IS_STANDALONE); + + if (!list.isEmpty()) + { + EntityChicken entitychicken = (EntityChicken)list.get(0); + entitychicken.setChickenJockey(true); + this.mountEntity(entitychicken); + } + } + else if ((double)this.worldObj.rand.nextFloat() < 0.05D) + { + EntityChicken entitychicken1 = new EntityChicken(this.worldObj); + entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entitychicken1.onInitialSpawn(difficulty, (IEntityLivingData)null); + entitychicken1.setChickenJockey(true); + this.worldObj.spawnEntityInWorld(entitychicken1); + this.mountEntity(entitychicken1); + } + } + } + + this.setBreakDoorsAItask(this.rand.nextFloat() < f * 0.1F); + this.setEquipmentBasedOnDifficulty(difficulty); + this.setEnchantmentBasedOnDifficulty(difficulty); + + if (this.getEquipmentInSlot(4) == null) + { + Calendar calendar = this.worldObj.getCurrentDate(); + + if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { + this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0)); + double d0 = this.rand.nextDouble() * 1.5D * (double)f; + + if (d0 > 1.0D) + { + this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2)); + } + + if (this.rand.nextFloat() < f * 0.05F) + { + this.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0)); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2)); + this.setBreakDoorsAItask(true); + } + + return livingdata; + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.getCurrentEquippedItem(); + + if (itemstack != null && itemstack.getItem() == Items.golden_apple && itemstack.getMetadata() == 0 && this.isVillager() && this.isPotionActive(Potion.weakness)) + { + if (!player.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + if (!this.worldObj.isRemote) + { + this.startConversion(this.rand.nextInt(2401) + 3600); + } + + return true; + } + else + { + return false; + } + } + + protected void startConversion(int ticks) + { + this.conversionTime = ticks; + this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1)); + this.removePotionEffect(Potion.weakness.id); + this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, ticks, Math.min(this.worldObj.getDifficulty().getDifficultyId() - 1, 0))); + this.worldObj.setEntityState(this, (byte)16); + } + + public void handleStatusUpdate(byte id) + { + if (id == 16) + { + if (!this.isSilent()) + { + this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); + } + } + else + { + super.handleStatusUpdate(id); + } + } + + protected boolean canDespawn() + { + return !this.isConverting(); + } + + public boolean isConverting() + { + return this.getDataWatcher().getWatchableObjectByte(14) == 1; + } + + protected void convertToVillager() + { + EntityVillager entityvillager = new EntityVillager(this.worldObj); + entityvillager.copyLocationAndAnglesFrom(this); + entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null); + entityvillager.setLookingForHome(); + + if (this.isChild()) + { + entityvillager.setGrowingAge(-24000); + } + + this.worldObj.removeEntity(this); + entityvillager.setNoAI(this.isAIDisabled()); + + if (this.hasCustomName()) + { + entityvillager.setCustomNameTag(this.getCustomNameTag()); + entityvillager.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entityvillager); + entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, new BlockPos((int)this.posX, (int)this.posY, (int)this.posZ), 0); + } + + protected int getConversionTimeBoost() + { + int i = 1; + + if (this.rand.nextFloat() < 0.01F) + { + int j = 0; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = (int)this.posX - 4; k < (int)this.posX + 4 && j < 14; ++k) + { + for (int l = (int)this.posY - 4; l < (int)this.posY + 4 && j < 14; ++l) + { + for (int i1 = (int)this.posZ - 4; i1 < (int)this.posZ + 4 && j < 14; ++i1) + { + Block block = this.worldObj.getBlockState(blockpos$mutableblockpos.set(k, l, i1)).getBlock(); + + if (block == Blocks.iron_bars || block == Blocks.bed) + { + if (this.rand.nextFloat() < 0.3F) + { + ++i; + } + + ++j; + } + } + } + } + } + + return i; + } + + public void setChildSize(boolean isChild) + { + this.multiplySize(isChild ? 0.5F : 1.0F); + } + + protected final void setSize(float width, float height) + { + boolean flag = this.zombieWidth > 0.0F && this.zombieHeight > 0.0F; + this.zombieWidth = width; + this.zombieHeight = height; + + if (!flag) + { + this.multiplySize(1.0F); + } + } + + protected final void multiplySize(float size) + { + super.setSize(this.zombieWidth * size, this.zombieHeight * size); + } + + public double getYOffset() + { + return this.isChild() ? 0.0D : -0.35D; + } + + public void onDeath(DamageSource cause) + { + super.onDeath(cause); + + if (cause.getEntity() instanceof EntityCreeper && !(this instanceof EntityPigZombie) && ((EntityCreeper)cause.getEntity()).getPowered() && ((EntityCreeper)cause.getEntity()).isAIEnabled()) + { + ((EntityCreeper)cause.getEntity()).func_175493_co(); + this.entityDropItem(new ItemStack(Items.skull, 1, 2), 0.0F); + } + } + + class GroupData implements IEntityLivingData + { + public boolean isChild; + public boolean isVillager; + + private GroupData(boolean isBaby, boolean isVillagerZombie) + { + this.isChild = false; + this.isVillager = false; + this.isChild = isBaby; + this.isVillager = isVillagerZombie; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/monster/IMob.java b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/IMob.java new file mode 100644 index 0000000..9b17cd2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/monster/IMob.java @@ -0,0 +1,23 @@ +package net.minecraft.entity.monster; + +import com.google.common.base.Predicate; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.IAnimals; + +public interface IMob extends IAnimals +{ + Predicate mobSelector = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ instanceof IMob; + } + }; + Predicate VISIBLE_MOB_SELECTOR = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ instanceof IMob && !p_apply_1_.isInvisible(); + } + }; +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java new file mode 100644 index 0000000..e13548f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java @@ -0,0 +1,23 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public abstract class EntityAmbientCreature extends EntityLiving implements IAnimals +{ + public EntityAmbientCreature(World worldIn) + { + super(worldIn); + } + + public boolean allowLeashing() + { + return false; + } + + protected boolean interact(EntityPlayer player) + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityAnimal.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityAnimal.java new file mode 100644 index 0000000..04826e4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityAnimal.java @@ -0,0 +1,200 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityAnimal extends EntityAgeable implements IAnimals +{ + protected Block spawnableBlock = Blocks.grass; + private int inLove; + private EntityPlayer playerInLove; + + public EntityAnimal(World worldIn) + { + super(worldIn); + } + + protected void updateAITasks() + { + if (this.getGrowingAge() != 0) + { + this.inLove = 0; + } + + super.updateAITasks(); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.getGrowingAge() != 0) + { + this.inLove = 0; + } + + if (this.inLove > 0) + { + --this.inLove; + + if (this.inLove % 10 == 0) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(EnumParticleTypes.HEART, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2, new int[0]); + } + } + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + this.inLove = 0; + return super.attackEntityFrom(source, amount); + } + } + + public float getBlockPathWeight(BlockPos pos) + { + return this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.grass ? 10.0F : this.worldObj.getLightBrightness(pos) - 0.5F; + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("InLove", this.inLove); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.inLove = tagCompund.getInteger("InLove"); + } + + public boolean getCanSpawnHere() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.getEntityBoundingBox().minY); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + return this.worldObj.getBlockState(blockpos.down()).getBlock() == this.spawnableBlock && this.worldObj.getLight(blockpos) > 8 && super.getCanSpawnHere(); + } + + public int getTalkInterval() + { + return 120; + } + + protected boolean canDespawn() + { + return false; + } + + protected int getExperiencePoints(EntityPlayer player) + { + return 1 + this.worldObj.rand.nextInt(3); + } + + public boolean isBreedingItem(ItemStack stack) + { + return stack == null ? false : stack.getItem() == Items.wheat; + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null) + { + if (this.isBreedingItem(itemstack) && this.getGrowingAge() == 0 && this.inLove <= 0) + { + this.consumeItemFromStack(player, itemstack); + this.setInLove(player); + return true; + } + + if (this.isChild() && this.isBreedingItem(itemstack)) + { + this.consumeItemFromStack(player, itemstack); + this.func_175501_a((int)((float)(-this.getGrowingAge() / 20) * 0.1F), true); + return true; + } + } + + return super.interact(player); + } + + protected void consumeItemFromStack(EntityPlayer player, ItemStack stack) + { + if (!player.capabilities.isCreativeMode) + { + --stack.stackSize; + + if (stack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + } + } + + public void setInLove(EntityPlayer player) + { + this.inLove = 600; + this.playerInLove = player; + this.worldObj.setEntityState(this, (byte)18); + } + + public EntityPlayer getPlayerInLove() + { + return this.playerInLove; + } + + public boolean isInLove() + { + return this.inLove > 0; + } + + public void resetInLove() + { + this.inLove = 0; + } + + public boolean canMateWith(EntityAnimal otherAnimal) + { + return otherAnimal == this ? false : (otherAnimal.getClass() != this.getClass() ? false : this.isInLove() && otherAnimal.isInLove()); + } + + public void handleStatusUpdate(byte id) + { + if (id == 18) + { + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(EnumParticleTypes.HEART, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2, new int[0]); + } + } + else + { + super.handleStatusUpdate(id); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityBat.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityBat.java new file mode 100644 index 0000000..90b4f07 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityBat.java @@ -0,0 +1,248 @@ +package net.minecraft.entity.passive; + +import java.util.Calendar; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBat extends EntityAmbientCreature +{ + private BlockPos spawnPosition; + + public EntityBat(World worldIn) + { + super(worldIn); + this.setSize(0.5F, 0.9F); + this.setIsBatHanging(true); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + protected float getSoundVolume() + { + return 0.1F; + } + + protected float getSoundPitch() + { + return super.getSoundPitch() * 0.95F; + } + + protected String getLivingSound() + { + return this.getIsBatHanging() && this.rand.nextInt(4) != 0 ? null : "mob.bat.idle"; + } + + protected String getHurtSound() + { + return "mob.bat.hurt"; + } + + protected String getDeathSound() + { + return "mob.bat.death"; + } + + public boolean canBePushed() + { + return false; + } + + protected void collideWithEntity(Entity entityIn) + { + } + + protected void collideWithNearbyEntities() + { + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(6.0D); + } + + public boolean getIsBatHanging() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setIsBatHanging(boolean isHanging) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (isHanging) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.getIsBatHanging()) + { + this.motionX = this.motionY = this.motionZ = 0.0D; + this.posY = (double)MathHelper.floor_double(this.posY) + 1.0D - (double)this.height; + } + else + { + this.motionY *= 0.6000000238418579D; + } + } + + protected void updateAITasks() + { + super.updateAITasks(); + BlockPos blockpos = new BlockPos(this); + BlockPos blockpos1 = blockpos.up(); + + if (this.getIsBatHanging()) + { + if (!this.worldObj.getBlockState(blockpos1).getBlock().isNormalCube()) + { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, blockpos, 0); + } + else + { + if (this.rand.nextInt(200) == 0) + { + this.rotationYawHead = (float)this.rand.nextInt(360); + } + + if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) + { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, blockpos, 0); + } + } + } + else + { + if (this.spawnPosition != null && (!this.worldObj.isAirBlock(this.spawnPosition) || this.spawnPosition.getY() < 1)) + { + this.spawnPosition = null; + } + + if (this.spawnPosition == null || this.rand.nextInt(30) == 0 || this.spawnPosition.distanceSq((double)((int)this.posX), (double)((int)this.posY), (double)((int)this.posZ)) < 4.0D) + { + this.spawnPosition = new BlockPos((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); + } + + double d0 = (double)this.spawnPosition.getX() + 0.5D - this.posX; + double d1 = (double)this.spawnPosition.getY() + 0.1D - this.posY; + double d2 = (double)this.spawnPosition.getZ() + 0.5D - this.posZ; + this.motionX += (Math.signum(d0) * 0.5D - this.motionX) * 0.10000000149011612D; + this.motionY += (Math.signum(d1) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; + this.motionZ += (Math.signum(d2) * 0.5D - this.motionZ) * 0.10000000149011612D; + float f = (float)(MathHelper.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; + float f1 = MathHelper.wrapAngleTo180_float(f - this.rotationYaw); + this.moveForward = 0.5F; + this.rotationYaw += f1; + + if (this.rand.nextInt(100) == 0 && this.worldObj.getBlockState(blockpos1).getBlock().isNormalCube()) + { + this.setIsBatHanging(true); + } + } + } + + protected boolean canTriggerWalking() + { + return false; + } + + public void fall(float distance, float damageMultiplier) + { + } + + protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos) + { + } + + public boolean doesEntityNotTriggerPressurePlate() + { + return true; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + if (!this.worldObj.isRemote && this.getIsBatHanging()) + { + this.setIsBatHanging(false); + } + + return super.attackEntityFrom(source, amount); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.dataWatcher.updateObject(16, Byte.valueOf(tagCompund.getByte("BatFlags"))); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); + } + + public boolean getCanSpawnHere() + { + BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); + + if (blockpos.getY() >= this.worldObj.getSeaLevel()) + { + return false; + } + else + { + int i = this.worldObj.getLightFromNeighbors(blockpos); + int j = 4; + + if (this.isDateAroundHalloween(this.worldObj.getCurrentDate())) + { + j = 7; + } + else if (this.rand.nextBoolean()) + { + return false; + } + + return i > this.rand.nextInt(j) ? false : super.getCanSpawnHere(); + } + } + + private boolean isDateAroundHalloween(Calendar p_175569_1_) + { + return p_175569_1_.get(2) + 1 == 10 && p_175569_1_.get(5) >= 20 || p_175569_1_.get(2) + 1 == 11 && p_175569_1_.get(5) <= 3; + } + + public float getEyeHeight() + { + return this.height / 2.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityChicken.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityChicken.java new file mode 100644 index 0000000..4d7475a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityChicken.java @@ -0,0 +1,201 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityChicken extends EntityAnimal +{ + public float wingRotation; + public float destPos; + public float field_70884_g; + public float field_70888_h; + public float wingRotDelta = 1.0F; + public int timeUntilNextEgg; + public boolean chickenJockey; + + public EntityChicken(World worldIn) + { + super(worldIn); + this.setSize(0.4F, 0.7F); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.wheat_seeds, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + public float getEyeHeight() + { + return this.height; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.field_70888_h = this.wingRotation; + this.field_70884_g = this.destPos; + this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D); + this.destPos = MathHelper.clamp_float(this.destPos, 0.0F, 1.0F); + + if (!this.onGround && this.wingRotDelta < 1.0F) + { + this.wingRotDelta = 1.0F; + } + + this.wingRotDelta = (float)((double)this.wingRotDelta * 0.9D); + + if (!this.onGround && this.motionY < 0.0D) + { + this.motionY *= 0.6D; + } + + this.wingRotation += this.wingRotDelta * 2.0F; + + if (!this.worldObj.isRemote && !this.isChild() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0) + { + this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.dropItem(Items.egg, 1); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + } + } + + public void fall(float distance, float damageMultiplier) + { + } + + protected String getLivingSound() + { + return "mob.chicken.say"; + } + + protected String getHurtSound() + { + return "mob.chicken.hurt"; + } + + protected String getDeathSound() + { + return "mob.chicken.hurt"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.chicken.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return Items.feather; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(3) + this.rand.nextInt(1 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.feather, 1); + } + + if (this.isBurning()) + { + this.dropItem(Items.cooked_chicken, 1); + } + else + { + this.dropItem(Items.chicken, 1); + } + } + + public EntityChicken createChild(EntityAgeable ageable) + { + return new EntityChicken(this.worldObj); + } + + public boolean isBreedingItem(ItemStack stack) + { + return stack != null && stack.getItem() == Items.wheat_seeds; + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.chickenJockey = tagCompund.getBoolean("IsChickenJockey"); + + if (tagCompund.hasKey("EggLayTime")) + { + this.timeUntilNextEgg = tagCompund.getInteger("EggLayTime"); + } + } + + protected int getExperiencePoints(EntityPlayer player) + { + return this.isChickenJockey() ? 10 : super.getExperiencePoints(player); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("IsChickenJockey", this.chickenJockey); + tagCompound.setInteger("EggLayTime", this.timeUntilNextEgg); + } + + protected boolean canDespawn() + { + return this.isChickenJockey() && this.riddenByEntity == null; + } + + public void updateRiderPosition() + { + super.updateRiderPosition(); + float f = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float f1 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float f2 = 0.1F; + float f3 = 0.0F; + this.riddenByEntity.setPosition(this.posX + (double)(f2 * f), this.posY + (double)(this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double)f3, this.posZ - (double)(f2 * f1)); + + if (this.riddenByEntity instanceof EntityLivingBase) + { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + + public boolean isChickenJockey() + { + return this.chickenJockey; + } + + public void setChickenJockey(boolean jockey) + { + this.chickenJockey = jockey; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityCow.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityCow.java new file mode 100644 index 0000000..c80bad3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityCow.java @@ -0,0 +1,132 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityCow extends EntityAnimal +{ + public EntityCow(World worldIn) + { + super(worldIn); + this.setSize(0.9F, 1.3F); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + protected String getLivingSound() + { + return "mob.cow.say"; + } + + protected String getHurtSound() + { + return "mob.cow.hurt"; + } + + protected String getDeathSound() + { + return "mob.cow.hurt"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.cow.step", 0.15F, 1.0F); + } + + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return Items.leather; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(3) + this.rand.nextInt(1 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.leather, 1); + } + + i = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + lootingModifier); + + for (int k = 0; k < i; ++k) + { + if (this.isBurning()) + { + this.dropItem(Items.cooked_beef, 1); + } + else + { + this.dropItem(Items.beef, 1); + } + } + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.bucket && !player.capabilities.isCreativeMode && !this.isChild()) + { + if (itemstack.stackSize-- == 1) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.milk_bucket)); + } + else if (!player.inventory.addItemStackToInventory(new ItemStack(Items.milk_bucket))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(Items.milk_bucket, 1, 0), false); + } + + return true; + } + else + { + return super.interact(player); + } + } + + public EntityCow createChild(EntityAgeable ageable) + { + return new EntityCow(this.worldObj); + } + + public float getEyeHeight() + { + return this.height; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityHorse.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityHorse.java new file mode 100644 index 0000000..fc2fd2c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityHorse.java @@ -0,0 +1,1749 @@ +package net.minecraft.entity.passive; + +import com.google.common.base.Predicate; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAIRunAroundLikeCrazy; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.IInvBasic; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.potion.Potion; +import net.minecraft.server.management.PreYggdrasilConverter; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.World; + +public class EntityHorse extends EntityAnimal implements IInvBasic +{ + private static final Predicate horseBreedingSelector = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ instanceof EntityHorse && ((EntityHorse)p_apply_1_).isBreeding(); + } + }; + private static final IAttribute horseJumpStrength = (new RangedAttribute((IAttribute)null, "horse.jumpStrength", 0.7D, 0.0D, 2.0D)).setDescription("Jump Strength").setShouldWatch(true); + private static final String[] horseArmorTextures = new String[] {null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; + private static final String[] HORSE_ARMOR_TEXTURES_ABBR = new String[] {"", "meo", "goo", "dio"}; + private static final int[] armorValues = new int[] {0, 5, 7, 11}; + private static final String[] horseTextures = new String[] {"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; + private static final String[] HORSE_TEXTURES_ABBR = new String[] {"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; + private static final String[] horseMarkingTextures = new String[] {null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; + private static final String[] HORSE_MARKING_TEXTURES_ABBR = new String[] {"", "wo_", "wmo", "wdo", "bdo"}; + private int eatingHaystackCounter; + private int openMouthCounter; + private int jumpRearingCounter; + public int field_110278_bp; + public int field_110279_bq; + protected boolean horseJumping; + private AnimalChest horseChest; + private boolean hasReproduced; + protected int temper; + protected float jumpPower; + private boolean field_110294_bI; + private float headLean; + private float prevHeadLean; + private float rearingAmount; + private float prevRearingAmount; + private float mouthOpenness; + private float prevMouthOpenness; + private int gallopTime; + private String texturePrefix; + private String[] horseTexturesArray = new String[3]; + private boolean field_175508_bO = false; + + public EntityHorse(World worldIn) + { + super(worldIn); + this.setSize(1.4F, 1.6F); + this.isImmuneToFire = false; + this.setChested(false); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.2D)); + this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWander(this, 0.7D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.initHorseChest(); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + this.dataWatcher.addObject(19, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(20, Integer.valueOf(0)); + this.dataWatcher.addObject(21, String.valueOf((Object)"")); + this.dataWatcher.addObject(22, Integer.valueOf(0)); + } + + public void setHorseType(int type) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)type)); + this.resetTexturePrefix(); + } + + public int getHorseType() + { + return this.dataWatcher.getWatchableObjectByte(19); + } + + public void setHorseVariant(int variant) + { + this.dataWatcher.updateObject(20, Integer.valueOf(variant)); + this.resetTexturePrefix(); + } + + public int getHorseVariant() + { + return this.dataWatcher.getWatchableObjectInt(20); + } + + public String getName() + { + if (this.hasCustomName()) + { + return this.getCustomNameTag(); + } + else + { + int i = this.getHorseType(); + + switch (i) + { + case 0: + default: + return StatCollector.translateToLocal("entity.horse.name"); + + case 1: + return StatCollector.translateToLocal("entity.donkey.name"); + + case 2: + return StatCollector.translateToLocal("entity.mule.name"); + + case 3: + return StatCollector.translateToLocal("entity.zombiehorse.name"); + + case 4: + return StatCollector.translateToLocal("entity.skeletonhorse.name"); + } + } + } + + private boolean getHorseWatchableBoolean(int p_110233_1_) + { + return (this.dataWatcher.getWatchableObjectInt(16) & p_110233_1_) != 0; + } + + private void setHorseWatchableBoolean(int p_110208_1_, boolean p_110208_2_) + { + int i = this.dataWatcher.getWatchableObjectInt(16); + + if (p_110208_2_) + { + this.dataWatcher.updateObject(16, Integer.valueOf(i | p_110208_1_)); + } + else + { + this.dataWatcher.updateObject(16, Integer.valueOf(i & ~p_110208_1_)); + } + } + + public boolean isAdultHorse() + { + return !this.isChild(); + } + + public boolean isTame() + { + return this.getHorseWatchableBoolean(2); + } + + public boolean func_110253_bW() + { + return this.isAdultHorse(); + } + + public String getOwnerId() + { + return this.dataWatcher.getWatchableObjectString(21); + } + + public void setOwnerId(String id) + { + this.dataWatcher.updateObject(21, id); + } + + public float getHorseSize() + { + return 0.5F; + } + + public void setScaleForAge(boolean p_98054_1_) + { + if (p_98054_1_) + { + this.setScale(this.getHorseSize()); + } + else + { + this.setScale(1.0F); + } + } + + public boolean isHorseJumping() + { + return this.horseJumping; + } + + public void setHorseTamed(boolean tamed) + { + this.setHorseWatchableBoolean(2, tamed); + } + + public void setHorseJumping(boolean jumping) + { + this.horseJumping = jumping; + } + + public boolean allowLeashing() + { + return !this.isUndead() && super.allowLeashing(); + } + + protected void func_142017_o(float p_142017_1_) + { + if (p_142017_1_ > 6.0F && this.isEatingHaystack()) + { + this.setEatingHaystack(false); + } + } + + public boolean isChested() + { + return this.getHorseWatchableBoolean(8); + } + + public int getHorseArmorIndexSynced() + { + return this.dataWatcher.getWatchableObjectInt(22); + } + + private int getHorseArmorIndex(ItemStack itemStackIn) + { + if (itemStackIn == null) + { + return 0; + } + else + { + Item item = itemStackIn.getItem(); + return item == Items.iron_horse_armor ? 1 : (item == Items.golden_horse_armor ? 2 : (item == Items.diamond_horse_armor ? 3 : 0)); + } + } + + public boolean isEatingHaystack() + { + return this.getHorseWatchableBoolean(32); + } + + public boolean isRearing() + { + return this.getHorseWatchableBoolean(64); + } + + public boolean isBreeding() + { + return this.getHorseWatchableBoolean(16); + } + + public boolean getHasReproduced() + { + return this.hasReproduced; + } + + public void setHorseArmorStack(ItemStack itemStackIn) + { + this.dataWatcher.updateObject(22, Integer.valueOf(this.getHorseArmorIndex(itemStackIn))); + this.resetTexturePrefix(); + } + + public void setBreeding(boolean breeding) + { + this.setHorseWatchableBoolean(16, breeding); + } + + public void setChested(boolean chested) + { + this.setHorseWatchableBoolean(8, chested); + } + + public void setHasReproduced(boolean hasReproducedIn) + { + this.hasReproduced = hasReproducedIn; + } + + public void setHorseSaddled(boolean saddled) + { + this.setHorseWatchableBoolean(4, saddled); + } + + public int getTemper() + { + return this.temper; + } + + public void setTemper(int temperIn) + { + this.temper = temperIn; + } + + public int increaseTemper(int p_110198_1_) + { + int i = MathHelper.clamp_int(this.getTemper() + p_110198_1_, 0, this.getMaxTemper()); + this.setTemper(i); + return i; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + Entity entity = source.getEntity(); + return this.riddenByEntity != null && this.riddenByEntity.equals(entity) ? false : super.attackEntityFrom(source, amount); + } + + public int getTotalArmorValue() + { + return armorValues[this.getHorseArmorIndexSynced()]; + } + + public boolean canBePushed() + { + return this.riddenByEntity == null; + } + + public boolean prepareChunkForSpawn() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posZ); + this.worldObj.getBiomeGenForCoords(new BlockPos(i, 0, j)); + return true; + } + + public void dropChests() + { + if (!this.worldObj.isRemote && this.isChested()) + { + this.dropItem(Item.getItemFromBlock(Blocks.chest), 1); + this.setChested(false); + } + } + + private void func_110266_cB() + { + this.openHorseMouth(); + + if (!this.isSilent()) + { + this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + } + } + + public void fall(float distance, float damageMultiplier) + { + if (distance > 1.0F) + { + this.playSound("mob.horse.land", 0.4F, 1.0F); + } + + int i = MathHelper.ceiling_float_int((distance * 0.5F - 3.0F) * damageMultiplier); + + if (i > 0) + { + this.attackEntityFrom(DamageSource.fall, (float)i); + + if (this.riddenByEntity != null) + { + this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)i); + } + + Block block = this.worldObj.getBlockState(new BlockPos(this.posX, this.posY - 0.2D - (double)this.prevRotationYaw, this.posZ)).getBlock(); + + if (block.getMaterial() != Material.air && !this.isSilent()) + { + Block.SoundType block$soundtype = block.stepSound; + this.worldObj.playSoundAtEntity(this, block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.5F, block$soundtype.getFrequency() * 0.75F); + } + } + } + + private int getChestSize() + { + int i = this.getHorseType(); + return !this.isChested() || i != 1 && i != 2 ? 2 : 17; + } + + private void initHorseChest() + { + AnimalChest animalchest = this.horseChest; + this.horseChest = new AnimalChest("HorseChest", this.getChestSize()); + this.horseChest.setCustomName(this.getName()); + + if (animalchest != null) + { + animalchest.removeInventoryChangeListener(this); + int i = Math.min(animalchest.getSizeInventory(), this.horseChest.getSizeInventory()); + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = animalchest.getStackInSlot(j); + + if (itemstack != null) + { + this.horseChest.setInventorySlotContents(j, itemstack.copy()); + } + } + } + + this.horseChest.addInventoryChangeListener(this); + this.updateHorseSlots(); + } + + private void updateHorseSlots() + { + if (!this.worldObj.isRemote) + { + this.setHorseSaddled(this.horseChest.getStackInSlot(0) != null); + + if (this.canWearArmor()) + { + this.setHorseArmorStack(this.horseChest.getStackInSlot(1)); + } + } + } + + public void onInventoryChanged(InventoryBasic p_76316_1_) + { + int i = this.getHorseArmorIndexSynced(); + boolean flag = this.isHorseSaddled(); + this.updateHorseSlots(); + + if (this.ticksExisted > 20) + { + if (i == 0 && i != this.getHorseArmorIndexSynced()) + { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + else if (i != this.getHorseArmorIndexSynced()) + { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + + if (!flag && this.isHorseSaddled()) + { + this.playSound("mob.horse.leather", 0.5F, 1.0F); + } + } + } + + public boolean getCanSpawnHere() + { + this.prepareChunkForSpawn(); + return super.getCanSpawnHere(); + } + + protected EntityHorse getClosestHorse(Entity entityIn, double distance) + { + double d0 = Double.MAX_VALUE; + Entity entity = null; + + for (Entity entity1 : this.worldObj.getEntitiesInAABBexcluding(entityIn, entityIn.getEntityBoundingBox().addCoord(distance, distance, distance), horseBreedingSelector)) + { + double d1 = entity1.getDistanceSq(entityIn.posX, entityIn.posY, entityIn.posZ); + + if (d1 < d0) + { + entity = entity1; + d0 = d1; + } + } + + return (EntityHorse)entity; + } + + public double getHorseJumpStrength() + { + return this.getEntityAttribute(horseJumpStrength).getAttributeValue(); + } + + protected String getDeathSound() + { + this.openHorseMouth(); + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.death" : (i == 4 ? "mob.horse.skeleton.death" : (i != 1 && i != 2 ? "mob.horse.death" : "mob.horse.donkey.death")); + } + + protected Item getDropItem() + { + boolean flag = this.rand.nextInt(4) == 0; + int i = this.getHorseType(); + return i == 4 ? Items.bone : (i == 3 ? (flag ? null : Items.rotten_flesh) : Items.leather); + } + + protected String getHurtSound() + { + this.openHorseMouth(); + + if (this.rand.nextInt(3) == 0) + { + this.makeHorseRear(); + } + + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.hit" : (i == 4 ? "mob.horse.skeleton.hit" : (i != 1 && i != 2 ? "mob.horse.hit" : "mob.horse.donkey.hit")); + } + + public boolean isHorseSaddled() + { + return this.getHorseWatchableBoolean(4); + } + + protected String getLivingSound() + { + this.openHorseMouth(); + + if (this.rand.nextInt(10) == 0 && !this.isMovementBlocked()) + { + this.makeHorseRear(); + } + + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.idle" : (i == 4 ? "mob.horse.skeleton.idle" : (i != 1 && i != 2 ? "mob.horse.idle" : "mob.horse.donkey.idle")); + } + + protected String getAngrySoundName() + { + this.openHorseMouth(); + this.makeHorseRear(); + int i = this.getHorseType(); + return i != 3 && i != 4 ? (i != 1 && i != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + Block.SoundType block$soundtype = blockIn.stepSound; + + if (this.worldObj.getBlockState(pos.up()).getBlock() == Blocks.snow_layer) + { + block$soundtype = Blocks.snow_layer.stepSound; + } + + if (!blockIn.getMaterial().isLiquid()) + { + int i = this.getHorseType(); + + if (this.riddenByEntity != null && i != 1 && i != 2) + { + ++this.gallopTime; + + if (this.gallopTime > 5 && this.gallopTime % 3 == 0) + { + this.playSound("mob.horse.gallop", block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + + if (i == 0 && this.rand.nextInt(10) == 0) + { + this.playSound("mob.horse.breathe", block$soundtype.getVolume() * 0.6F, block$soundtype.getFrequency()); + } + } + else if (this.gallopTime <= 5) + { + this.playSound("mob.horse.wood", block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + } + } + else if (block$soundtype == Block.soundTypeWood) + { + this.playSound("mob.horse.wood", block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + } + else + { + this.playSound("mob.horse.soft", block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + } + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(horseJumpStrength); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(53.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.22499999403953552D); + } + + public int getMaxSpawnedInChunk() + { + return 6; + } + + public int getMaxTemper() + { + return 100; + } + + protected float getSoundVolume() + { + return 0.8F; + } + + public int getTalkInterval() + { + return 400; + } + + public boolean func_110239_cn() + { + return this.getHorseType() == 0 || this.getHorseArmorIndexSynced() > 0; + } + + private void resetTexturePrefix() + { + this.texturePrefix = null; + } + + public boolean func_175507_cI() + { + return this.field_175508_bO; + } + + private void setHorseTexturePaths() + { + this.texturePrefix = "horse/"; + this.horseTexturesArray[0] = null; + this.horseTexturesArray[1] = null; + this.horseTexturesArray[2] = null; + int i = this.getHorseType(); + int j = this.getHorseVariant(); + + if (i == 0) + { + int k = j & 255; + int l = (j & 65280) >> 8; + + if (k >= horseTextures.length) + { + this.field_175508_bO = false; + return; + } + + this.horseTexturesArray[0] = horseTextures[k]; + this.texturePrefix = this.texturePrefix + HORSE_TEXTURES_ABBR[k]; + + if (l >= horseMarkingTextures.length) + { + this.field_175508_bO = false; + return; + } + + this.horseTexturesArray[1] = horseMarkingTextures[l]; + this.texturePrefix = this.texturePrefix + HORSE_MARKING_TEXTURES_ABBR[l]; + } + else + { + this.horseTexturesArray[0] = ""; + this.texturePrefix = this.texturePrefix + "_" + i + "_"; + } + + int i1 = this.getHorseArmorIndexSynced(); + + if (i1 >= horseArmorTextures.length) + { + this.field_175508_bO = false; + } + else + { + this.horseTexturesArray[2] = horseArmorTextures[i1]; + this.texturePrefix = this.texturePrefix + HORSE_ARMOR_TEXTURES_ABBR[i1]; + this.field_175508_bO = true; + } + } + + public String getHorseTexture() + { + if (this.texturePrefix == null) + { + this.setHorseTexturePaths(); + } + + return this.texturePrefix; + } + + public String[] getVariantTexturePaths() + { + if (this.texturePrefix == null) + { + this.setHorseTexturePaths(); + } + + return this.horseTexturesArray; + } + + public void openGUI(EntityPlayer playerEntity) + { + if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == playerEntity) && this.isTame()) + { + this.horseChest.setCustomName(this.getName()); + playerEntity.displayGUIHorse(this, this.horseChest); + } + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.spawn_egg) + { + return super.interact(player); + } + else if (!this.isTame() && this.isUndead()) + { + return false; + } + else if (this.isTame() && this.isAdultHorse() && player.isSneaking()) + { + this.openGUI(player); + return true; + } + else if (this.func_110253_bW() && this.riddenByEntity != null) + { + return super.interact(player); + } + else + { + if (itemstack != null) + { + boolean flag = false; + + if (this.canWearArmor()) + { + int i = -1; + + if (itemstack.getItem() == Items.iron_horse_armor) + { + i = 1; + } + else if (itemstack.getItem() == Items.golden_horse_armor) + { + i = 2; + } + else if (itemstack.getItem() == Items.diamond_horse_armor) + { + i = 3; + } + + if (i >= 0) + { + if (!this.isTame()) + { + this.makeHorseRearWithSound(); + return true; + } + + this.openGUI(player); + return true; + } + } + + if (!flag && !this.isUndead()) + { + float f = 0.0F; + int j = 0; + int k = 0; + + if (itemstack.getItem() == Items.wheat) + { + f = 2.0F; + j = 20; + k = 3; + } + else if (itemstack.getItem() == Items.sugar) + { + f = 1.0F; + j = 30; + k = 3; + } + else if (Block.getBlockFromItem(itemstack.getItem()) == Blocks.hay_block) + { + f = 20.0F; + j = 180; + } + else if (itemstack.getItem() == Items.apple) + { + f = 3.0F; + j = 60; + k = 3; + } + else if (itemstack.getItem() == Items.golden_carrot) + { + f = 4.0F; + j = 60; + k = 5; + + if (this.isTame() && this.getGrowingAge() == 0) + { + flag = true; + this.setInLove(player); + } + } + else if (itemstack.getItem() == Items.golden_apple) + { + f = 10.0F; + j = 240; + k = 10; + + if (this.isTame() && this.getGrowingAge() == 0) + { + flag = true; + this.setInLove(player); + } + } + + if (this.getHealth() < this.getMaxHealth() && f > 0.0F) + { + this.heal(f); + flag = true; + } + + if (!this.isAdultHorse() && j > 0) + { + this.addGrowth(j); + flag = true; + } + + if (k > 0 && (flag || !this.isTame()) && k < this.getMaxTemper()) + { + flag = true; + this.increaseTemper(k); + } + + if (flag) + { + this.func_110266_cB(); + } + } + + if (!this.isTame() && !flag) + { + if (itemstack != null && itemstack.interactWithEntity(player, this)) + { + return true; + } + + this.makeHorseRearWithSound(); + return true; + } + + if (!flag && this.canCarryChest() && !this.isChested() && itemstack.getItem() == Item.getItemFromBlock(Blocks.chest)) + { + this.setChested(true); + this.playSound("mob.chickenplop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + flag = true; + this.initHorseChest(); + } + + if (!flag && this.func_110253_bW() && !this.isHorseSaddled() && itemstack.getItem() == Items.saddle) + { + this.openGUI(player); + return true; + } + + if (flag) + { + if (!player.capabilities.isCreativeMode && --itemstack.stackSize == 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + + if (this.func_110253_bW() && this.riddenByEntity == null) + { + if (itemstack != null && itemstack.interactWithEntity(player, this)) + { + return true; + } + else + { + this.mountTo(player); + return true; + } + } + else + { + return super.interact(player); + } + } + } + + private void mountTo(EntityPlayer player) + { + player.rotationYaw = this.rotationYaw; + player.rotationPitch = this.rotationPitch; + this.setEatingHaystack(false); + this.setRearing(false); + + if (!this.worldObj.isRemote) + { + player.mountEntity(this); + } + } + + public boolean canWearArmor() + { + return this.getHorseType() == 0; + } + + public boolean canCarryChest() + { + int i = this.getHorseType(); + return i == 2 || i == 1; + } + + protected boolean isMovementBlocked() + { + return this.riddenByEntity != null && this.isHorseSaddled() ? true : this.isEatingHaystack() || this.isRearing(); + } + + public boolean isUndead() + { + int i = this.getHorseType(); + return i == 3 || i == 4; + } + + public boolean isSterile() + { + return this.isUndead() || this.getHorseType() == 2; + } + + public boolean isBreedingItem(ItemStack stack) + { + return false; + } + + private void func_110210_cH() + { + this.field_110278_bp = 1; + } + + public void onDeath(DamageSource cause) + { + super.onDeath(cause); + + if (!this.worldObj.isRemote) + { + this.dropChestItems(); + } + } + + public void onLivingUpdate() + { + if (this.rand.nextInt(200) == 0) + { + this.func_110210_cH(); + } + + super.onLivingUpdate(); + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(900) == 0 && this.deathTime == 0) + { + this.heal(1.0F); + } + + if (!this.isEatingHaystack() && this.riddenByEntity == null && this.rand.nextInt(300) == 0 && this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ))).getBlock() == Blocks.grass) + { + this.setEatingHaystack(true); + } + + if (this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) + { + this.eatingHaystackCounter = 0; + this.setEatingHaystack(false); + } + + if (this.isBreeding() && !this.isAdultHorse() && !this.isEatingHaystack()) + { + EntityHorse entityhorse = this.getClosestHorse(this, 16.0D); + + if (entityhorse != null && this.getDistanceSqToEntity(entityhorse) > 4.0D) + { + this.navigator.getPathToEntityLiving(entityhorse); + } + } + } + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.worldObj.isRemote && this.dataWatcher.hasObjectChanged()) + { + this.dataWatcher.func_111144_e(); + this.resetTexturePrefix(); + } + + if (this.openMouthCounter > 0 && ++this.openMouthCounter > 30) + { + this.openMouthCounter = 0; + this.setHorseWatchableBoolean(128, false); + } + + if (!this.worldObj.isRemote && this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) + { + this.jumpRearingCounter = 0; + this.setRearing(false); + } + + if (this.field_110278_bp > 0 && ++this.field_110278_bp > 8) + { + this.field_110278_bp = 0; + } + + if (this.field_110279_bq > 0) + { + ++this.field_110279_bq; + + if (this.field_110279_bq > 300) + { + this.field_110279_bq = 0; + } + } + + this.prevHeadLean = this.headLean; + + if (this.isEatingHaystack()) + { + this.headLean += (1.0F - this.headLean) * 0.4F + 0.05F; + + if (this.headLean > 1.0F) + { + this.headLean = 1.0F; + } + } + else + { + this.headLean += (0.0F - this.headLean) * 0.4F - 0.05F; + + if (this.headLean < 0.0F) + { + this.headLean = 0.0F; + } + } + + this.prevRearingAmount = this.rearingAmount; + + if (this.isRearing()) + { + this.prevHeadLean = this.headLean = 0.0F; + this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F; + + if (this.rearingAmount > 1.0F) + { + this.rearingAmount = 1.0F; + } + } + else + { + this.field_110294_bI = false; + this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount - this.rearingAmount) * 0.6F - 0.05F; + + if (this.rearingAmount < 0.0F) + { + this.rearingAmount = 0.0F; + } + } + + this.prevMouthOpenness = this.mouthOpenness; + + if (this.getHorseWatchableBoolean(128)) + { + this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F; + + if (this.mouthOpenness > 1.0F) + { + this.mouthOpenness = 1.0F; + } + } + else + { + this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F; + + if (this.mouthOpenness < 0.0F) + { + this.mouthOpenness = 0.0F; + } + } + } + + private void openHorseMouth() + { + if (!this.worldObj.isRemote) + { + this.openMouthCounter = 1; + this.setHorseWatchableBoolean(128, true); + } + } + + private boolean canMate() + { + return this.riddenByEntity == null && this.ridingEntity == null && this.isTame() && this.isAdultHorse() && !this.isSterile() && this.getHealth() >= this.getMaxHealth() && this.isInLove(); + } + + public void setEating(boolean eating) + { + this.setHorseWatchableBoolean(32, eating); + } + + public void setEatingHaystack(boolean p_110227_1_) + { + this.setEating(p_110227_1_); + } + + public void setRearing(boolean rearing) + { + if (rearing) + { + this.setEatingHaystack(false); + } + + this.setHorseWatchableBoolean(64, rearing); + } + + private void makeHorseRear() + { + if (!this.worldObj.isRemote) + { + this.jumpRearingCounter = 1; + this.setRearing(true); + } + } + + public void makeHorseRearWithSound() + { + this.makeHorseRear(); + String s = this.getAngrySoundName(); + + if (s != null) + { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + } + + public void dropChestItems() + { + this.dropItemsInChest(this, this.horseChest); + this.dropChests(); + } + + private void dropItemsInChest(Entity entityIn, AnimalChest animalChestIn) + { + if (animalChestIn != null && !this.worldObj.isRemote) + { + for (int i = 0; i < animalChestIn.getSizeInventory(); ++i) + { + ItemStack itemstack = animalChestIn.getStackInSlot(i); + + if (itemstack != null) + { + this.entityDropItem(itemstack, 0.0F); + } + } + } + } + + public boolean setTamedBy(EntityPlayer player) + { + this.setOwnerId(player.getUniqueID().toString()); + this.setHorseTamed(true); + return true; + } + + public void moveEntityWithHeading(float strafe, float forward) + { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase && this.isHorseSaddled()) + { + this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; + this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; + this.setRotation(this.rotationYaw, this.rotationPitch); + this.rotationYawHead = this.renderYawOffset = this.rotationYaw; + strafe = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; + forward = ((EntityLivingBase)this.riddenByEntity).moveForward; + + if (forward <= 0.0F) + { + forward *= 0.25F; + this.gallopTime = 0; + } + + if (this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) + { + strafe = 0.0F; + forward = 0.0F; + } + + if (this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) + { + this.motionY = this.getHorseJumpStrength() * (double)this.jumpPower; + + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + this.setHorseJumping(true); + this.isAirBorne = true; + + if (forward > 0.0F) + { + float f = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float f1 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); + this.motionX += (double)(-0.4F * f * this.jumpPower); + this.motionZ += (double)(0.4F * f1 * this.jumpPower); + this.playSound("mob.horse.jump", 0.4F, 1.0F); + } + + this.jumpPower = 0.0F; + } + + this.stepHeight = 1.0F; + this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; + + if (!this.worldObj.isRemote) + { + this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + super.moveEntityWithHeading(strafe, forward); + } + + if (this.onGround) + { + this.jumpPower = 0.0F; + this.setHorseJumping(false); + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d1 = this.posX - this.prevPosX; + double d0 = this.posZ - this.prevPosZ; + float f2 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + this.limbSwingAmount += (f2 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + else + { + this.stepHeight = 0.5F; + this.jumpMovementFactor = 0.02F; + super.moveEntityWithHeading(strafe, forward); + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("EatingHaystack", this.isEatingHaystack()); + tagCompound.setBoolean("ChestedHorse", this.isChested()); + tagCompound.setBoolean("HasReproduced", this.getHasReproduced()); + tagCompound.setBoolean("Bred", this.isBreeding()); + tagCompound.setInteger("Type", this.getHorseType()); + tagCompound.setInteger("Variant", this.getHorseVariant()); + tagCompound.setInteger("Temper", this.getTemper()); + tagCompound.setBoolean("Tame", this.isTame()); + tagCompound.setString("OwnerUUID", this.getOwnerId()); + + if (this.isChested()) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 2; i < this.horseChest.getSizeInventory(); ++i) + { + ItemStack itemstack = this.horseChest.getStackInSlot(i); + + if (itemstack != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + itemstack.writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + tagCompound.setTag("Items", nbttaglist); + } + + if (this.horseChest.getStackInSlot(1) != null) + { + tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound())); + } + + if (this.horseChest.getStackInSlot(0) != null) + { + tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound())); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setEatingHaystack(tagCompund.getBoolean("EatingHaystack")); + this.setBreeding(tagCompund.getBoolean("Bred")); + this.setChested(tagCompund.getBoolean("ChestedHorse")); + this.setHasReproduced(tagCompund.getBoolean("HasReproduced")); + this.setHorseType(tagCompund.getInteger("Type")); + this.setHorseVariant(tagCompund.getInteger("Variant")); + this.setTemper(tagCompund.getInteger("Temper")); + this.setHorseTamed(tagCompund.getBoolean("Tame")); + String s = ""; + + if (tagCompund.hasKey("OwnerUUID", 8)) + { + s = tagCompund.getString("OwnerUUID"); + } + else + { + String s1 = tagCompund.getString("Owner"); + s = PreYggdrasilConverter.getStringUUIDFromName(s1); + } + + if (s.length() > 0) + { + this.setOwnerId(s); + } + + IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed"); + + if (iattributeinstance != null) + { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(iattributeinstance.getBaseValue() * 0.25D); + } + + if (this.isChested()) + { + NBTTagList nbttaglist = tagCompund.getTagList("Items", 10); + this.initHorseChest(); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + + if (j >= 2 && j < this.horseChest.getSizeInventory()) + { + this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound)); + } + } + } + + if (tagCompund.hasKey("ArmorItem", 10)) + { + ItemStack itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("ArmorItem")); + + if (itemstack != null && isArmorItem(itemstack.getItem())) + { + this.horseChest.setInventorySlotContents(1, itemstack); + } + } + + if (tagCompund.hasKey("SaddleItem", 10)) + { + ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("SaddleItem")); + + if (itemstack1 != null && itemstack1.getItem() == Items.saddle) + { + this.horseChest.setInventorySlotContents(0, itemstack1); + } + } + else if (tagCompund.getBoolean("Saddle")) + { + this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle)); + } + + this.updateHorseSlots(); + } + + public boolean canMateWith(EntityAnimal otherAnimal) + { + if (otherAnimal == this) + { + return false; + } + else if (otherAnimal.getClass() != this.getClass()) + { + return false; + } + else + { + EntityHorse entityhorse = (EntityHorse)otherAnimal; + + if (this.canMate() && entityhorse.canMate()) + { + int i = this.getHorseType(); + int j = entityhorse.getHorseType(); + return i == j || i == 0 && j == 1 || i == 1 && j == 0; + } + else + { + return false; + } + } + } + + public EntityAgeable createChild(EntityAgeable ageable) + { + EntityHorse entityhorse = (EntityHorse)ageable; + EntityHorse entityhorse1 = new EntityHorse(this.worldObj); + int i = this.getHorseType(); + int j = entityhorse.getHorseType(); + int k = 0; + + if (i == j) + { + k = i; + } + else if (i == 0 && j == 1 || i == 1 && j == 0) + { + k = 2; + } + + if (k == 0) + { + int i1 = this.rand.nextInt(9); + int l; + + if (i1 < 4) + { + l = this.getHorseVariant() & 255; + } + else if (i1 < 8) + { + l = entityhorse.getHorseVariant() & 255; + } + else + { + l = this.rand.nextInt(7); + } + + int j1 = this.rand.nextInt(5); + + if (j1 < 2) + { + l = l | this.getHorseVariant() & 65280; + } + else if (j1 < 4) + { + l = l | entityhorse.getHorseVariant() & 65280; + } + else + { + l = l | this.rand.nextInt(5) << 8 & 65280; + } + + entityhorse1.setHorseVariant(l); + } + + entityhorse1.setHorseType(k); + double d1 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + ageable.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + (double)this.getModifiedMaxHealth(); + entityhorse1.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(d1 / 3.0D); + double d2 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + ageable.getEntityAttribute(horseJumpStrength).getBaseValue() + this.getModifiedJumpStrength(); + entityhorse1.getEntityAttribute(horseJumpStrength).setBaseValue(d2 / 3.0D); + double d0 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + ageable.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + this.getModifiedMovementSpeed(); + entityhorse1.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(d0 / 3.0D); + return entityhorse1; + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + int i = 0; + int j = 0; + + if (livingdata instanceof EntityHorse.GroupData) + { + i = ((EntityHorse.GroupData)livingdata).horseType; + j = ((EntityHorse.GroupData)livingdata).horseVariant & 255 | this.rand.nextInt(5) << 8; + } + else + { + if (this.rand.nextInt(10) == 0) + { + i = 1; + } + else + { + int k = this.rand.nextInt(7); + int l = this.rand.nextInt(5); + i = 0; + j = k | l << 8; + } + + livingdata = new EntityHorse.GroupData(i, j); + } + + this.setHorseType(i); + this.setHorseVariant(j); + + if (this.rand.nextInt(5) == 0) + { + this.setGrowingAge(-24000); + } + + if (i != 4 && i != 3) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue((double)this.getModifiedMaxHealth()); + + if (i == 0) + { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(this.getModifiedMovementSpeed()); + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.17499999701976776D); + } + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + if (i != 2 && i != 1) + { + this.getEntityAttribute(horseJumpStrength).setBaseValue(this.getModifiedJumpStrength()); + } + else + { + this.getEntityAttribute(horseJumpStrength).setBaseValue(0.5D); + } + + this.setHealth(this.getMaxHealth()); + return livingdata; + } + + public float getGrassEatingAmount(float p_110258_1_) + { + return this.prevHeadLean + (this.headLean - this.prevHeadLean) * p_110258_1_; + } + + public float getRearingAmount(float p_110223_1_) + { + return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * p_110223_1_; + } + + public float getMouthOpennessAngle(float p_110201_1_) + { + return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * p_110201_1_; + } + + public void setJumpPower(int jumpPowerIn) + { + if (this.isHorseSaddled()) + { + if (jumpPowerIn < 0) + { + jumpPowerIn = 0; + } + else + { + this.field_110294_bI = true; + this.makeHorseRear(); + } + + if (jumpPowerIn >= 90) + { + this.jumpPower = 1.0F; + } + else + { + this.jumpPower = 0.4F + 0.4F * (float)jumpPowerIn / 90.0F; + } + } + } + + protected void spawnHorseParticles(boolean p_110216_1_) + { + EnumParticleTypes enumparticletypes = p_110216_1_ ? EnumParticleTypes.HEART : EnumParticleTypes.SMOKE_NORMAL; + + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(enumparticletypes, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2, new int[0]); + } + } + + public void handleStatusUpdate(byte id) + { + if (id == 7) + { + this.spawnHorseParticles(true); + } + else if (id == 6) + { + this.spawnHorseParticles(false); + } + else + { + super.handleStatusUpdate(id); + } + } + + public void updateRiderPosition() + { + super.updateRiderPosition(); + + if (this.prevRearingAmount > 0.0F) + { + float f = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float f1 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float f2 = 0.7F * this.prevRearingAmount; + float f3 = 0.15F * this.prevRearingAmount; + this.riddenByEntity.setPosition(this.posX + (double)(f2 * f), this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + (double)f3, this.posZ - (double)(f2 * f1)); + + if (this.riddenByEntity instanceof EntityLivingBase) + { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + } + + private float getModifiedMaxHealth() + { + return 15.0F + (float)this.rand.nextInt(8) + (float)this.rand.nextInt(9); + } + + private double getModifiedJumpStrength() + { + return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D; + } + + private double getModifiedMovementSpeed() + { + return (0.44999998807907104D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D) * 0.25D; + } + + public static boolean isArmorItem(Item p_146085_0_) + { + return p_146085_0_ == Items.iron_horse_armor || p_146085_0_ == Items.golden_horse_armor || p_146085_0_ == Items.diamond_horse_armor; + } + + public boolean isOnLadder() + { + return false; + } + + public float getEyeHeight() + { + return this.height; + } + + public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn) + { + if (inventorySlot == 499 && this.canCarryChest()) + { + if (itemStackIn == null && this.isChested()) + { + this.setChested(false); + this.initHorseChest(); + return true; + } + + if (itemStackIn != null && itemStackIn.getItem() == Item.getItemFromBlock(Blocks.chest) && !this.isChested()) + { + this.setChested(true); + this.initHorseChest(); + return true; + } + } + + int i = inventorySlot - 400; + + if (i >= 0 && i < 2 && i < this.horseChest.getSizeInventory()) + { + if (i == 0 && itemStackIn != null && itemStackIn.getItem() != Items.saddle) + { + return false; + } + else if (i != 1 || (itemStackIn == null || isArmorItem(itemStackIn.getItem())) && this.canWearArmor()) + { + this.horseChest.setInventorySlotContents(i, itemStackIn); + this.updateHorseSlots(); + return true; + } + else + { + return false; + } + } + else + { + int j = inventorySlot - 500 + 2; + + if (j >= 2 && j < this.horseChest.getSizeInventory()) + { + this.horseChest.setInventorySlotContents(j, itemStackIn); + return true; + } + else + { + return false; + } + } + } + + public static class GroupData implements IEntityLivingData + { + public int horseType; + public int horseVariant; + + public GroupData(int type, int variant) + { + this.horseType = type; + this.horseVariant = variant; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java new file mode 100644 index 0000000..4cf8931 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java @@ -0,0 +1,80 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class EntityMooshroom extends EntityCow +{ + public EntityMooshroom(World worldIn) + { + super(worldIn); + this.setSize(0.9F, 1.3F); + this.spawnableBlock = Blocks.mycelium; + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.bowl && this.getGrowingAge() >= 0) + { + if (itemstack.stackSize == 1) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.mushroom_stew)); + return true; + } + + if (player.inventory.addItemStackToInventory(new ItemStack(Items.mushroom_stew)) && !player.capabilities.isCreativeMode) + { + player.inventory.decrStackSize(player.inventory.currentItem, 1); + return true; + } + } + + if (itemstack != null && itemstack.getItem() == Items.shears && this.getGrowingAge() >= 0) + { + this.setDead(); + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + + if (!this.worldObj.isRemote) + { + EntityCow entitycow = new EntityCow(this.worldObj); + entitycow.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + entitycow.setHealth(this.getHealth()); + entitycow.renderYawOffset = this.renderYawOffset; + + if (this.hasCustomName()) + { + entitycow.setCustomNameTag(this.getCustomNameTag()); + } + + this.worldObj.spawnEntityInWorld(entitycow); + + for (int i = 0; i < 5; ++i) + { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Blocks.red_mushroom))); + } + + itemstack.damageItem(1, player); + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + } + + return true; + } + else + { + return super.interact(player); + } + } + + public EntityMooshroom createChild(EntityAgeable ageable) + { + return new EntityMooshroom(this.worldObj); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityOcelot.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityOcelot.java new file mode 100644 index 0000000..dd76319 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityOcelot.java @@ -0,0 +1,333 @@ +package net.minecraft.entity.passive; + +import com.google.common.base.Predicate; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIOcelotAttack; +import net.minecraft.entity.ai.EntityAIOcelotSit; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.StatCollector; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.World; + +public class EntityOcelot extends EntityTameable +{ + private EntityAIAvoidEntity avoidEntity; + private EntityAITempt aiTempt; + + public EntityOcelot(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 0.7F); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F)); + this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D)); + this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F)); + this.tasks.addTask(8, new EntityAIOcelotAttack(this)); + this.tasks.addTask(9, new EntityAIMate(this, 0.8D)); + this.tasks.addTask(10, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); + this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null)); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + public void updateAITasks() + { + if (this.getMoveHelper().isUpdating()) + { + double d0 = this.getMoveHelper().getSpeed(); + + if (d0 == 0.6D) + { + this.setSneaking(true); + this.setSprinting(false); + } + else if (d0 == 1.33D) + { + this.setSneaking(false); + this.setSprinting(true); + } + else + { + this.setSneaking(false); + this.setSprinting(false); + } + } + else + { + this.setSneaking(false); + this.setSprinting(false); + } + } + + protected boolean canDespawn() + { + return !this.isTamed() && this.ticksExisted > 2400; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + public void fall(float distance, float damageMultiplier) + { + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("CatType", this.getTameSkin()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setTameSkin(tagCompund.getInteger("CatType")); + } + + protected String getLivingSound() + { + return this.isTamed() ? (this.isInLove() ? "mob.cat.purr" : (this.rand.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; + } + + protected String getHurtSound() + { + return "mob.cat.hitt"; + } + + protected String getDeathSound() + { + return "mob.cat.hitt"; + } + + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return Items.leather; + } + + public boolean attackEntityAsMob(Entity entityIn) + { + return entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + this.aiSit.setSitting(false); + return super.attackEntityFrom(source, amount); + } + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (this.isOwner(player) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) + { + this.aiSit.setSitting(!this.isSitting()); + } + } + else if (this.aiTempt.isRunning() && itemstack != null && itemstack.getItem() == Items.fish && player.getDistanceSqToEntity(this) < 9.0D) + { + if (!player.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(3) == 0) + { + this.setTamed(true); + this.setTameSkin(1 + this.worldObj.rand.nextInt(3)); + this.setOwnerId(player.getUniqueID().toString()); + this.playTameEffect(true); + this.aiSit.setSitting(true); + this.worldObj.setEntityState(this, (byte)7); + } + else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte)6); + } + } + + return true; + } + + return super.interact(player); + } + + public EntityOcelot createChild(EntityAgeable ageable) + { + EntityOcelot entityocelot = new EntityOcelot(this.worldObj); + + if (this.isTamed()) + { + entityocelot.setOwnerId(this.getOwnerId()); + entityocelot.setTamed(true); + entityocelot.setTameSkin(this.getTameSkin()); + } + + return entityocelot; + } + + public boolean isBreedingItem(ItemStack stack) + { + return stack != null && stack.getItem() == Items.fish; + } + + public boolean canMateWith(EntityAnimal otherAnimal) + { + if (otherAnimal == this) + { + return false; + } + else if (!this.isTamed()) + { + return false; + } + else if (!(otherAnimal instanceof EntityOcelot)) + { + return false; + } + else + { + EntityOcelot entityocelot = (EntityOcelot)otherAnimal; + return !entityocelot.isTamed() ? false : this.isInLove() && entityocelot.isInLove(); + } + } + + public int getTameSkin() + { + return this.dataWatcher.getWatchableObjectByte(18); + } + + public void setTameSkin(int skinId) + { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)skinId)); + } + + public boolean getCanSpawnHere() + { + return this.worldObj.rand.nextInt(3) != 0; + } + + public boolean isNotColliding() + { + if (this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox())) + { + BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); + + if (blockpos.getY() < this.worldObj.getSeaLevel()) + { + return false; + } + + Block block = this.worldObj.getBlockState(blockpos.down()).getBlock(); + + if (block == Blocks.grass || block.getMaterial() == Material.leaves) + { + return true; + } + } + + return false; + } + + public String getName() + { + return this.hasCustomName() ? this.getCustomNameTag() : (this.isTamed() ? StatCollector.translateToLocal("entity.Cat.name") : super.getName()); + } + + public void setTamed(boolean tamed) + { + super.setTamed(tamed); + } + + protected void setupTamedAI() + { + if (this.avoidEntity == null) + { + this.avoidEntity = new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D); + } + + this.tasks.removeTask(this.avoidEntity); + + if (!this.isTamed()) + { + this.tasks.addTask(4, this.avoidEntity); + } + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + + if (this.worldObj.rand.nextInt(7) == 0) + { + for (int i = 0; i < 2; ++i) + { + EntityOcelot entityocelot = new EntityOcelot(this.worldObj); + entityocelot.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityocelot.setGrowingAge(-24000); + this.worldObj.spawnEntityInWorld(entityocelot); + } + } + + return livingdata; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityPig.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityPig.java new file mode 100644 index 0000000..3756feb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityPig.java @@ -0,0 +1,204 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIControlledByPlayer; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class EntityPig extends EntityAnimal +{ + private final EntityAIControlledByPlayer aiControlledByPlayer; + + public EntityPig(World worldIn) + { + super(worldIn); + this.setSize(0.9F, 0.9F); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F)); + this.tasks.addTask(3, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false)); + this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + public boolean canBeSteered() + { + ItemStack itemstack = ((EntityPlayer)this.riddenByEntity).getHeldItem(); + return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick; + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("Saddle", this.getSaddled()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setSaddled(tagCompund.getBoolean("Saddle")); + } + + protected String getLivingSound() + { + return "mob.pig.say"; + } + + protected String getHurtSound() + { + return "mob.pig.say"; + } + + protected String getDeathSound() + { + return "mob.pig.death"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.pig.step", 0.15F, 1.0F); + } + + public boolean interact(EntityPlayer player) + { + if (super.interact(player)) + { + return true; + } + else if (!this.getSaddled() || this.worldObj.isRemote || this.riddenByEntity != null && this.riddenByEntity != player) + { + return false; + } + else + { + player.mountEntity(this); + return true; + } + } + + protected Item getDropItem() + { + return this.isBurning() ? Items.cooked_porkchop : Items.porkchop; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + if (this.isBurning()) + { + this.dropItem(Items.cooked_porkchop, 1); + } + else + { + this.dropItem(Items.porkchop, 1); + } + } + + if (this.getSaddled()) + { + this.dropItem(Items.saddle, 1); + } + } + + public boolean getSaddled() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setSaddled(boolean saddled) + { + if (saddled) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)1)); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)0)); + } + } + + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + if (!this.worldObj.isRemote && !this.isDead) + { + EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj); + entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + entitypigzombie.setNoAI(this.isAIDisabled()); + + if (this.hasCustomName()) + { + entitypigzombie.setCustomNameTag(this.getCustomNameTag()); + entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entitypigzombie); + this.setDead(); + } + } + + public void fall(float distance, float damageMultiplier) + { + super.fall(distance, damageMultiplier); + + if (distance > 5.0F && this.riddenByEntity instanceof EntityPlayer) + { + ((EntityPlayer)this.riddenByEntity).triggerAchievement(AchievementList.flyPig); + } + } + + public EntityPig createChild(EntityAgeable ageable) + { + return new EntityPig(this.worldObj); + } + + public boolean isBreedingItem(ItemStack stack) + { + return stack != null && stack.getItem() == Items.carrot; + } + + public EntityAIControlledByPlayer getAIControlledByPlayer() + { + return this.aiControlledByPlayer; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityRabbit.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityRabbit.java new file mode 100644 index 0000000..6a3feb6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityRabbit.java @@ -0,0 +1,695 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockCarrot; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIMoveToBlock; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityJumpHelper; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.World; + +public class EntityRabbit extends EntityAnimal +{ + private EntityRabbit.AIAvoidEntity aiAvoidWolves; + private int field_175540_bm = 0; + private int field_175535_bn = 0; + private boolean field_175536_bo = false; + private boolean field_175537_bp = false; + private int currentMoveTypeDuration = 0; + private EntityRabbit.EnumMoveType moveType = EntityRabbit.EnumMoveType.HOP; + private int carrotTicks = 0; + private EntityPlayer field_175543_bt = null; + + public EntityRabbit(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 0.7F); + this.jumpHelper = new EntityRabbit.RabbitJumpHelper(this); + this.moveHelper = new EntityRabbit.RabbitMoveHelper(this); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.navigator.setHeightRequirement(2.5F); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityRabbit.AIPanic(this, 1.33D)); + this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.carrot, false)); + this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.golden_carrot, false)); + this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Item.getItemFromBlock(Blocks.yellow_flower), false)); + this.tasks.addTask(3, new EntityAIMate(this, 0.8D)); + this.tasks.addTask(5, new EntityRabbit.AIRaidFarm(this)); + this.tasks.addTask(5, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); + this.aiAvoidWolves = new EntityRabbit.AIAvoidEntity(this, EntityWolf.class, 16.0F, 1.33D, 1.33D); + this.tasks.addTask(4, this.aiAvoidWolves); + this.setMovementSpeed(0.0D); + } + + protected float getJumpUpwardsMotion() + { + return this.moveHelper.isUpdating() && this.moveHelper.getY() > this.posY + 0.5D ? 0.5F : this.moveType.func_180074_b(); + } + + public void setMoveType(EntityRabbit.EnumMoveType type) + { + this.moveType = type; + } + + public float func_175521_o(float p_175521_1_) + { + return this.field_175535_bn == 0 ? 0.0F : ((float)this.field_175540_bm + p_175521_1_) / (float)this.field_175535_bn; + } + + public void setMovementSpeed(double newSpeed) + { + this.getNavigator().setSpeed(newSpeed); + this.moveHelper.setMoveTo(this.moveHelper.getX(), this.moveHelper.getY(), this.moveHelper.getZ(), newSpeed); + } + + public void setJumping(boolean jump, EntityRabbit.EnumMoveType moveTypeIn) + { + super.setJumping(jump); + + if (!jump) + { + if (this.moveType == EntityRabbit.EnumMoveType.ATTACK) + { + this.moveType = EntityRabbit.EnumMoveType.HOP; + } + } + else + { + this.setMovementSpeed(1.5D * (double)moveTypeIn.getSpeed()); + this.playSound(this.getJumpingSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } + + this.field_175536_bo = jump; + } + + public void doMovementAction(EntityRabbit.EnumMoveType movetype) + { + this.setJumping(true, movetype); + this.field_175535_bn = movetype.func_180073_d(); + this.field_175540_bm = 0; + } + + public boolean func_175523_cj() + { + return this.field_175536_bo; + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + public void updateAITasks() + { + if (this.moveHelper.getSpeed() > 0.8D) + { + this.setMoveType(EntityRabbit.EnumMoveType.SPRINT); + } + else if (this.moveType != EntityRabbit.EnumMoveType.ATTACK) + { + this.setMoveType(EntityRabbit.EnumMoveType.HOP); + } + + if (this.currentMoveTypeDuration > 0) + { + --this.currentMoveTypeDuration; + } + + if (this.carrotTicks > 0) + { + this.carrotTicks -= this.rand.nextInt(3); + + if (this.carrotTicks < 0) + { + this.carrotTicks = 0; + } + } + + if (this.onGround) + { + if (!this.field_175537_bp) + { + this.setJumping(false, EntityRabbit.EnumMoveType.NONE); + this.func_175517_cu(); + } + + if (this.getRabbitType() == 99 && this.currentMoveTypeDuration == 0) + { + EntityLivingBase entitylivingbase = this.getAttackTarget(); + + if (entitylivingbase != null && this.getDistanceSqToEntity(entitylivingbase) < 16.0D) + { + this.calculateRotationYaw(entitylivingbase.posX, entitylivingbase.posZ); + this.moveHelper.setMoveTo(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ, this.moveHelper.getSpeed()); + this.doMovementAction(EntityRabbit.EnumMoveType.ATTACK); + this.field_175537_bp = true; + } + } + + EntityRabbit.RabbitJumpHelper entityrabbit$rabbitjumphelper = (EntityRabbit.RabbitJumpHelper)this.jumpHelper; + + if (!entityrabbit$rabbitjumphelper.getIsJumping()) + { + if (this.moveHelper.isUpdating() && this.currentMoveTypeDuration == 0) + { + PathEntity pathentity = this.navigator.getPath(); + Vec3 vec3 = new Vec3(this.moveHelper.getX(), this.moveHelper.getY(), this.moveHelper.getZ()); + + if (pathentity != null && pathentity.getCurrentPathIndex() < pathentity.getCurrentPathLength()) + { + vec3 = pathentity.getPosition(this); + } + + this.calculateRotationYaw(vec3.xCoord, vec3.zCoord); + this.doMovementAction(this.moveType); + } + } + else if (!entityrabbit$rabbitjumphelper.func_180065_d()) + { + this.func_175518_cr(); + } + } + + this.field_175537_bp = this.onGround; + } + + public void spawnRunningParticles() + { + } + + private void calculateRotationYaw(double x, double z) + { + this.rotationYaw = (float)(MathHelper.atan2(z - this.posZ, x - this.posX) * 180.0D / Math.PI) - 90.0F; + } + + private void func_175518_cr() + { + ((EntityRabbit.RabbitJumpHelper)this.jumpHelper).func_180066_a(true); + } + + private void func_175520_cs() + { + ((EntityRabbit.RabbitJumpHelper)this.jumpHelper).func_180066_a(false); + } + + private void updateMoveTypeDuration() + { + this.currentMoveTypeDuration = this.getMoveTypeDuration(); + } + + private void func_175517_cu() + { + this.updateMoveTypeDuration(); + this.func_175520_cs(); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.field_175540_bm != this.field_175535_bn) + { + if (this.field_175540_bm == 0 && !this.worldObj.isRemote) + { + this.worldObj.setEntityState(this, (byte)1); + } + + ++this.field_175540_bm; + } + else if (this.field_175535_bn != 0) + { + this.field_175540_bm = 0; + this.field_175535_bn = 0; + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("RabbitType", this.getRabbitType()); + tagCompound.setInteger("MoreCarrotTicks", this.carrotTicks); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setRabbitType(tagCompund.getInteger("RabbitType")); + this.carrotTicks = tagCompund.getInteger("MoreCarrotTicks"); + } + + protected String getJumpingSound() + { + return "mob.rabbit.hop"; + } + + protected String getLivingSound() + { + return "mob.rabbit.idle"; + } + + protected String getHurtSound() + { + return "mob.rabbit.hurt"; + } + + protected String getDeathSound() + { + return "mob.rabbit.death"; + } + + public boolean attackEntityAsMob(Entity entityIn) + { + if (this.getRabbitType() == 99) + { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + return entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 8.0F); + } + else + { + return entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); + } + } + + public int getTotalArmorValue() + { + return this.getRabbitType() == 99 ? 8 : super.getTotalArmorValue(); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + return this.isEntityInvulnerable(source) ? false : super.attackEntityFrom(source, amount); + } + + protected void addRandomDrop() + { + this.entityDropItem(new ItemStack(Items.rabbit_foot, 1), 0.0F); + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(2) + this.rand.nextInt(1 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + this.dropItem(Items.rabbit_hide, 1); + } + + i = this.rand.nextInt(2); + + for (int k = 0; k < i; ++k) + { + if (this.isBurning()) + { + this.dropItem(Items.cooked_rabbit, 1); + } + else + { + this.dropItem(Items.rabbit, 1); + } + } + } + + private boolean isRabbitBreedingItem(Item itemIn) + { + return itemIn == Items.carrot || itemIn == Items.golden_carrot || itemIn == Item.getItemFromBlock(Blocks.yellow_flower); + } + + public EntityRabbit createChild(EntityAgeable ageable) + { + EntityRabbit entityrabbit = new EntityRabbit(this.worldObj); + + if (ageable instanceof EntityRabbit) + { + entityrabbit.setRabbitType(this.rand.nextBoolean() ? this.getRabbitType() : ((EntityRabbit)ageable).getRabbitType()); + } + + return entityrabbit; + } + + public boolean isBreedingItem(ItemStack stack) + { + return stack != null && this.isRabbitBreedingItem(stack.getItem()); + } + + public int getRabbitType() + { + return this.dataWatcher.getWatchableObjectByte(18); + } + + public void setRabbitType(int rabbitTypeId) + { + if (rabbitTypeId == 99) + { + this.tasks.removeTask(this.aiAvoidWolves); + this.tasks.addTask(4, new EntityRabbit.AIEvilAttack(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, true)); + + if (!this.hasCustomName()) + { + this.setCustomNameTag(StatCollector.translateToLocal("entity.KillerBunny.name")); + } + } + + this.dataWatcher.updateObject(18, Byte.valueOf((byte)rabbitTypeId)); + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + int i = this.rand.nextInt(6); + boolean flag = false; + + if (livingdata instanceof EntityRabbit.RabbitTypeData) + { + i = ((EntityRabbit.RabbitTypeData)livingdata).typeData; + flag = true; + } + else + { + livingdata = new EntityRabbit.RabbitTypeData(i); + } + + this.setRabbitType(i); + + if (flag) + { + this.setGrowingAge(-24000); + } + + return livingdata; + } + + private boolean isCarrotEaten() + { + return this.carrotTicks == 0; + } + + protected int getMoveTypeDuration() + { + return this.moveType.getDuration(); + } + + protected void createEatingParticles() + { + this.worldObj.spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(Blocks.carrots.getStateFromMeta(7))}); + this.carrotTicks = 100; + } + + public void handleStatusUpdate(byte id) + { + if (id == 1) + { + this.createRunningParticles(); + this.field_175535_bn = 10; + this.field_175540_bm = 0; + } + else + { + super.handleStatusUpdate(id); + } + } + + static class AIAvoidEntity extends EntityAIAvoidEntity + { + private EntityRabbit entityInstance; + + public AIAvoidEntity(EntityRabbit rabbit, Class p_i46403_2_, float p_i46403_3_, double p_i46403_4_, double p_i46403_6_) + { + super(rabbit, p_i46403_2_, p_i46403_3_, p_i46403_4_, p_i46403_6_); + this.entityInstance = rabbit; + } + + public void updateTask() + { + super.updateTask(); + } + } + + static class AIEvilAttack extends EntityAIAttackOnCollide + { + public AIEvilAttack(EntityRabbit rabbit) + { + super(rabbit, EntityLivingBase.class, 1.4D, true); + } + + protected double func_179512_a(EntityLivingBase attackTarget) + { + return (double)(4.0F + attackTarget.width); + } + } + + static class AIPanic extends EntityAIPanic + { + private EntityRabbit theEntity; + + public AIPanic(EntityRabbit rabbit, double speedIn) + { + super(rabbit, speedIn); + this.theEntity = rabbit; + } + + public void updateTask() + { + super.updateTask(); + this.theEntity.setMovementSpeed(this.speed); + } + } + + static class AIRaidFarm extends EntityAIMoveToBlock + { + private final EntityRabbit rabbit; + private boolean field_179498_d; + private boolean field_179499_e = false; + + public AIRaidFarm(EntityRabbit rabbitIn) + { + super(rabbitIn, 0.699999988079071D, 16); + this.rabbit = rabbitIn; + } + + public boolean shouldExecute() + { + if (this.runDelay <= 0) + { + if (!this.rabbit.worldObj.getGameRules().getBoolean("mobGriefing")) + { + return false; + } + + this.field_179499_e = false; + this.field_179498_d = this.rabbit.isCarrotEaten(); + } + + return super.shouldExecute(); + } + + public boolean continueExecuting() + { + return this.field_179499_e && super.continueExecuting(); + } + + public void startExecuting() + { + super.startExecuting(); + } + + public void resetTask() + { + super.resetTask(); + } + + public void updateTask() + { + super.updateTask(); + this.rabbit.getLookHelper().setLookPosition((double)this.destinationBlock.getX() + 0.5D, (double)(this.destinationBlock.getY() + 1), (double)this.destinationBlock.getZ() + 0.5D, 10.0F, (float)this.rabbit.getVerticalFaceSpeed()); + + if (this.getIsAboveDestination()) + { + World world = this.rabbit.worldObj; + BlockPos blockpos = this.destinationBlock.up(); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (this.field_179499_e && block instanceof BlockCarrot && ((Integer)iblockstate.getValue(BlockCarrot.AGE)).intValue() == 7) + { + world.setBlockState(blockpos, Blocks.air.getDefaultState(), 2); + world.destroyBlock(blockpos, true); + this.rabbit.createEatingParticles(); + } + + this.field_179499_e = false; + this.runDelay = 10; + } + } + + protected boolean shouldMoveTo(World worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos).getBlock(); + + if (block == Blocks.farmland) + { + pos = pos.up(); + IBlockState iblockstate = worldIn.getBlockState(pos); + block = iblockstate.getBlock(); + + if (block instanceof BlockCarrot && ((Integer)iblockstate.getValue(BlockCarrot.AGE)).intValue() == 7 && this.field_179498_d && !this.field_179499_e) + { + this.field_179499_e = true; + return true; + } + } + + return false; + } + } + + static enum EnumMoveType + { + NONE(0.0F, 0.0F, 30, 1), + HOP(0.8F, 0.2F, 20, 10), + STEP(1.0F, 0.45F, 14, 14), + SPRINT(1.75F, 0.4F, 1, 8), + ATTACK(2.0F, 0.7F, 7, 8); + + private final float speed; + private final float field_180077_g; + private final int duration; + private final int field_180085_i; + + private EnumMoveType(float typeSpeed, float p_i45866_4_, int typeDuration, int p_i45866_6_) + { + this.speed = typeSpeed; + this.field_180077_g = p_i45866_4_; + this.duration = typeDuration; + this.field_180085_i = p_i45866_6_; + } + + public float getSpeed() + { + return this.speed; + } + + public float func_180074_b() + { + return this.field_180077_g; + } + + public int getDuration() + { + return this.duration; + } + + public int func_180073_d() + { + return this.field_180085_i; + } + } + + public class RabbitJumpHelper extends EntityJumpHelper + { + private EntityRabbit theEntity; + private boolean field_180068_d = false; + + public RabbitJumpHelper(EntityRabbit rabbit) + { + super(rabbit); + this.theEntity = rabbit; + } + + public boolean getIsJumping() + { + return this.isJumping; + } + + public boolean func_180065_d() + { + return this.field_180068_d; + } + + public void func_180066_a(boolean p_180066_1_) + { + this.field_180068_d = p_180066_1_; + } + + public void doJump() + { + if (this.isJumping) + { + this.theEntity.doMovementAction(EntityRabbit.EnumMoveType.STEP); + this.isJumping = false; + } + } + } + + static class RabbitMoveHelper extends EntityMoveHelper + { + private EntityRabbit theEntity; + + public RabbitMoveHelper(EntityRabbit rabbit) + { + super(rabbit); + this.theEntity = rabbit; + } + + public void onUpdateMoveHelper() + { + if (this.theEntity.onGround && !this.theEntity.func_175523_cj()) + { + this.theEntity.setMovementSpeed(0.0D); + } + + super.onUpdateMoveHelper(); + } + } + + public static class RabbitTypeData implements IEntityLivingData + { + public int typeData; + + public RabbitTypeData(int type) + { + this.typeData = type; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntitySheep.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntitySheep.java new file mode 100644 index 0000000..1825d66 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntitySheep.java @@ -0,0 +1,325 @@ +package net.minecraft.entity.passive; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIEatGrass; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.World; + +public class EntitySheep extends EntityAnimal +{ + private final InventoryCrafting inventoryCrafting = new InventoryCrafting(new Container() + { + public boolean canInteractWith(EntityPlayer playerIn) + { + return false; + } + }, 2, 1); + private static final Map DYE_TO_RGB = Maps.newEnumMap(EnumDyeColor.class); + private int sheepTimer; + private EntityAIEatGrass entityAIEatGrass = new EntityAIEatGrass(this); + + public static float[] getDyeRgb(EnumDyeColor dyeColor) + { + return (float[])DYE_TO_RGB.get(dyeColor); + } + + public EntitySheep(World worldIn) + { + super(worldIn); + this.setSize(0.9F, 1.3F); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, this.entityAIEatGrass); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.inventoryCrafting.setInventorySlotContents(0, new ItemStack(Items.dye, 1, 0)); + this.inventoryCrafting.setInventorySlotContents(1, new ItemStack(Items.dye, 1, 0)); + } + + protected void updateAITasks() + { + this.sheepTimer = this.entityAIEatGrass.getEatingGrassTimer(); + super.updateAITasks(); + } + + public void onLivingUpdate() + { + if (this.worldObj.isRemote) + { + this.sheepTimer = Math.max(0, this.sheepTimer - 1); + } + + super.onLivingUpdate(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + if (!this.getSheared()) + { + this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor().getMetadata()), 0.0F); + } + + int i = this.rand.nextInt(2) + 1 + this.rand.nextInt(1 + lootingModifier); + + for (int j = 0; j < i; ++j) + { + if (this.isBurning()) + { + this.dropItem(Items.cooked_mutton, 1); + } + else + { + this.dropItem(Items.mutton, 1); + } + } + } + + protected Item getDropItem() + { + return Item.getItemFromBlock(Blocks.wool); + } + + public void handleStatusUpdate(byte id) + { + if (id == 10) + { + this.sheepTimer = 40; + } + else + { + super.handleStatusUpdate(id); + } + } + + public float getHeadRotationPointY(float p_70894_1_) + { + return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - p_70894_1_) / 4.0F : -((float)(this.sheepTimer - 40) - p_70894_1_) / 4.0F)); + } + + public float getHeadRotationAngleX(float p_70890_1_) + { + if (this.sheepTimer > 4 && this.sheepTimer <= 36) + { + float f = ((float)(this.sheepTimer - 4) - p_70890_1_) / 32.0F; + return ((float)Math.PI / 5F) + ((float)Math.PI * 7F / 100F) * MathHelper.sin(f * 28.7F); + } + else + { + return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch / (180F / (float)Math.PI); + } + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) + { + if (!this.worldObj.isRemote) + { + this.setSheared(true); + int i = 1 + this.rand.nextInt(3); + + for (int j = 0; j < i; ++j) + { + EntityItem entityitem = this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor().getMetadata()), 1.0F); + entityitem.motionY += (double)(this.rand.nextFloat() * 0.05F); + entityitem.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + entityitem.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + } + } + + itemstack.damageItem(1, player); + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + } + + return super.interact(player); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("Sheared", this.getSheared()); + tagCompound.setByte("Color", (byte)this.getFleeceColor().getMetadata()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setSheared(tagCompund.getBoolean("Sheared")); + this.setFleeceColor(EnumDyeColor.byMetadata(tagCompund.getByte("Color"))); + } + + protected String getLivingSound() + { + return "mob.sheep.say"; + } + + protected String getHurtSound() + { + return "mob.sheep.say"; + } + + protected String getDeathSound() + { + return "mob.sheep.say"; + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.sheep.step", 0.15F, 1.0F); + } + + public EnumDyeColor getFleeceColor() + { + return EnumDyeColor.byMetadata(this.dataWatcher.getWatchableObjectByte(16) & 15); + } + + public void setFleeceColor(EnumDyeColor color) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & 240 | color.getMetadata() & 15))); + } + + public boolean getSheared() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 16) != 0; + } + + public void setSheared(boolean sheared) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (sheared) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 16))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -17))); + } + } + + public static EnumDyeColor getRandomSheepColor(Random random) + { + int i = random.nextInt(100); + return i < 5 ? EnumDyeColor.BLACK : (i < 10 ? EnumDyeColor.GRAY : (i < 15 ? EnumDyeColor.SILVER : (i < 18 ? EnumDyeColor.BROWN : (random.nextInt(500) == 0 ? EnumDyeColor.PINK : EnumDyeColor.WHITE)))); + } + + public EntitySheep createChild(EntityAgeable ageable) + { + EntitySheep entitysheep = (EntitySheep)ageable; + EntitySheep entitysheep1 = new EntitySheep(this.worldObj); + entitysheep1.setFleeceColor(this.getDyeColorMixFromParents(this, entitysheep)); + return entitysheep1; + } + + public void eatGrassBonus() + { + this.setSheared(false); + + if (this.isChild()) + { + this.addGrowth(60); + } + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + this.setFleeceColor(getRandomSheepColor(this.worldObj.rand)); + return livingdata; + } + + private EnumDyeColor getDyeColorMixFromParents(EntityAnimal father, EntityAnimal mother) + { + int i = ((EntitySheep)father).getFleeceColor().getDyeDamage(); + int j = ((EntitySheep)mother).getFleeceColor().getDyeDamage(); + this.inventoryCrafting.getStackInSlot(0).setItemDamage(i); + this.inventoryCrafting.getStackInSlot(1).setItemDamage(j); + ItemStack itemstack = CraftingManager.getInstance().findMatchingRecipe(this.inventoryCrafting, ((EntitySheep)father).worldObj); + int k; + + if (itemstack != null && itemstack.getItem() == Items.dye) + { + k = itemstack.getMetadata(); + } + else + { + k = this.worldObj.rand.nextBoolean() ? i : j; + } + + return EnumDyeColor.byDyeDamage(k); + } + + public float getEyeHeight() + { + return 0.95F * this.height; + } + + static + { + DYE_TO_RGB.put(EnumDyeColor.WHITE, new float[] {1.0F, 1.0F, 1.0F}); + DYE_TO_RGB.put(EnumDyeColor.ORANGE, new float[] {0.85F, 0.5F, 0.2F}); + DYE_TO_RGB.put(EnumDyeColor.MAGENTA, new float[] {0.7F, 0.3F, 0.85F}); + DYE_TO_RGB.put(EnumDyeColor.LIGHT_BLUE, new float[] {0.4F, 0.6F, 0.85F}); + DYE_TO_RGB.put(EnumDyeColor.YELLOW, new float[] {0.9F, 0.9F, 0.2F}); + DYE_TO_RGB.put(EnumDyeColor.LIME, new float[] {0.5F, 0.8F, 0.1F}); + DYE_TO_RGB.put(EnumDyeColor.PINK, new float[] {0.95F, 0.5F, 0.65F}); + DYE_TO_RGB.put(EnumDyeColor.GRAY, new float[] {0.3F, 0.3F, 0.3F}); + DYE_TO_RGB.put(EnumDyeColor.SILVER, new float[] {0.6F, 0.6F, 0.6F}); + DYE_TO_RGB.put(EnumDyeColor.CYAN, new float[] {0.3F, 0.5F, 0.6F}); + DYE_TO_RGB.put(EnumDyeColor.PURPLE, new float[] {0.5F, 0.25F, 0.7F}); + DYE_TO_RGB.put(EnumDyeColor.BLUE, new float[] {0.2F, 0.3F, 0.7F}); + DYE_TO_RGB.put(EnumDyeColor.BROWN, new float[] {0.4F, 0.3F, 0.2F}); + DYE_TO_RGB.put(EnumDyeColor.GREEN, new float[] {0.4F, 0.5F, 0.2F}); + DYE_TO_RGB.put(EnumDyeColor.RED, new float[] {0.6F, 0.2F, 0.2F}); + DYE_TO_RGB.put(EnumDyeColor.BLACK, new float[] {0.1F, 0.1F, 0.1F}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntitySquid.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntitySquid.java new file mode 100644 index 0000000..27bebea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntitySquid.java @@ -0,0 +1,242 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySquid extends EntityWaterMob +{ + public float squidPitch; + public float prevSquidPitch; + public float squidYaw; + public float prevSquidYaw; + public float squidRotation; + public float prevSquidRotation; + public float tentacleAngle; + public float lastTentacleAngle; + private float randomMotionSpeed; + private float rotationVelocity; + private float field_70871_bB; + private float randomMotionVecX; + private float randomMotionVecY; + private float randomMotionVecZ; + + public EntitySquid(World worldIn) + { + super(worldIn); + this.setSize(0.95F, 0.95F); + this.rand.setSeed((long)(1 + this.getEntityId())); + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + this.tasks.addTask(0, new EntitySquid.AIMoveRandom(this)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + } + + public float getEyeHeight() + { + return this.height * 0.5F; + } + + protected String getLivingSound() + { + return null; + } + + protected String getHurtSound() + { + return null; + } + + protected String getDeathSound() + { + return null; + } + + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return null; + } + + protected boolean canTriggerWalking() + { + return false; + } + + protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier) + { + int i = this.rand.nextInt(3 + lootingModifier) + 1; + + for (int j = 0; j < i; ++j) + { + this.entityDropItem(new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), 0.0F); + } + } + + public boolean isInWater() + { + return this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox().expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.prevSquidPitch = this.squidPitch; + this.prevSquidYaw = this.squidYaw; + this.prevSquidRotation = this.squidRotation; + this.lastTentacleAngle = this.tentacleAngle; + this.squidRotation += this.rotationVelocity; + + if ((double)this.squidRotation > (Math.PI * 2D)) + { + if (this.worldObj.isRemote) + { + this.squidRotation = ((float)Math.PI * 2F); + } + else + { + this.squidRotation = (float)((double)this.squidRotation - (Math.PI * 2D)); + + if (this.rand.nextInt(10) == 0) + { + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + + this.worldObj.setEntityState(this, (byte)19); + } + } + + if (this.inWater) + { + if (this.squidRotation < (float)Math.PI) + { + float f = this.squidRotation / (float)Math.PI; + this.tentacleAngle = MathHelper.sin(f * f * (float)Math.PI) * (float)Math.PI * 0.25F; + + if ((double)f > 0.75D) + { + this.randomMotionSpeed = 1.0F; + this.field_70871_bB = 1.0F; + } + else + { + this.field_70871_bB *= 0.8F; + } + } + else + { + this.tentacleAngle = 0.0F; + this.randomMotionSpeed *= 0.9F; + this.field_70871_bB *= 0.99F; + } + + if (!this.worldObj.isRemote) + { + this.motionX = (double)(this.randomMotionVecX * this.randomMotionSpeed); + this.motionY = (double)(this.randomMotionVecY * this.randomMotionSpeed); + this.motionZ = (double)(this.randomMotionVecZ * this.randomMotionSpeed); + } + + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.renderYawOffset += (-((float)MathHelper.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI - this.renderYawOffset) * 0.1F; + this.rotationYaw = this.renderYawOffset; + this.squidYaw = (float)((double)this.squidYaw + Math.PI * (double)this.field_70871_bB * 1.5D); + this.squidPitch += (-((float)MathHelper.atan2((double)f1, this.motionY)) * 180.0F / (float)Math.PI - this.squidPitch) * 0.1F; + } + else + { + this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.squidRotation)) * (float)Math.PI * 0.25F; + + if (!this.worldObj.isRemote) + { + this.motionX = 0.0D; + this.motionY -= 0.08D; + this.motionY *= 0.9800000190734863D; + this.motionZ = 0.0D; + } + + this.squidPitch = (float)((double)this.squidPitch + (double)(-90.0F - this.squidPitch) * 0.02D); + } + } + + public void moveEntityWithHeading(float strafe, float forward) + { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + public boolean getCanSpawnHere() + { + return this.posY > 45.0D && this.posY < (double)this.worldObj.getSeaLevel() && super.getCanSpawnHere(); + } + + public void handleStatusUpdate(byte id) + { + if (id == 19) + { + this.squidRotation = 0.0F; + } + else + { + super.handleStatusUpdate(id); + } + } + + public void func_175568_b(float randomMotionVecXIn, float randomMotionVecYIn, float randomMotionVecZIn) + { + this.randomMotionVecX = randomMotionVecXIn; + this.randomMotionVecY = randomMotionVecYIn; + this.randomMotionVecZ = randomMotionVecZIn; + } + + public boolean func_175567_n() + { + return this.randomMotionVecX != 0.0F || this.randomMotionVecY != 0.0F || this.randomMotionVecZ != 0.0F; + } + + static class AIMoveRandom extends EntityAIBase + { + private EntitySquid squid; + + public AIMoveRandom(EntitySquid p_i45859_1_) + { + this.squid = p_i45859_1_; + } + + public boolean shouldExecute() + { + return true; + } + + public void updateTask() + { + int i = this.squid.getAge(); + + if (i > 100) + { + this.squid.func_175568_b(0.0F, 0.0F, 0.0F); + } + else if (this.squid.getRNG().nextInt(50) == 0 || !this.squid.inWater || !this.squid.func_175567_n()) + { + float f = this.squid.getRNG().nextFloat() * (float)Math.PI * 2.0F; + float f1 = MathHelper.cos(f) * 0.2F; + float f2 = -0.1F + this.squid.getRNG().nextFloat() * 0.2F; + float f3 = MathHelper.sin(f) * 0.2F; + this.squid.func_175568_b(f1, f2, f3); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityTameable.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityTameable.java new file mode 100644 index 0000000..105b1c8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityTameable.java @@ -0,0 +1,233 @@ +package net.minecraft.entity.passive; + +import java.util.UUID; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.ai.EntityAISit; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.management.PreYggdrasilConverter; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public abstract class EntityTameable extends EntityAnimal implements IEntityOwnable +{ + protected EntityAISit aiSit = new EntityAISit(this); + + public EntityTameable(World worldIn) + { + super(worldIn); + this.setupTamedAI(); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(17, ""); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.getOwnerId() == null) + { + tagCompound.setString("OwnerUUID", ""); + } + else + { + tagCompound.setString("OwnerUUID", this.getOwnerId()); + } + + tagCompound.setBoolean("Sitting", this.isSitting()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + String s = ""; + + if (tagCompund.hasKey("OwnerUUID", 8)) + { + s = tagCompund.getString("OwnerUUID"); + } + else + { + String s1 = tagCompund.getString("Owner"); + s = PreYggdrasilConverter.getStringUUIDFromName(s1); + } + + if (s.length() > 0) + { + this.setOwnerId(s); + this.setTamed(true); + } + + this.aiSit.setSitting(tagCompund.getBoolean("Sitting")); + this.setSitting(tagCompund.getBoolean("Sitting")); + } + + protected void playTameEffect(boolean play) + { + EnumParticleTypes enumparticletypes = EnumParticleTypes.HEART; + + if (!play) + { + enumparticletypes = EnumParticleTypes.SMOKE_NORMAL; + } + + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(enumparticletypes, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2, new int[0]); + } + } + + public void handleStatusUpdate(byte id) + { + if (id == 7) + { + this.playTameEffect(true); + } + else if (id == 6) + { + this.playTameEffect(false); + } + else + { + super.handleStatusUpdate(id); + } + } + + public boolean isTamed() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0; + } + + public void setTamed(boolean tamed) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (tamed) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 4))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -5))); + } + + this.setupTamedAI(); + } + + protected void setupTamedAI() + { + } + + public boolean isSitting() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setSitting(boolean sitting) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (sitting) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + public String getOwnerId() + { + return this.dataWatcher.getWatchableObjectString(17); + } + + public void setOwnerId(String ownerUuid) + { + this.dataWatcher.updateObject(17, ownerUuid); + } + + public EntityLivingBase getOwner() + { + try + { + UUID uuid = UUID.fromString(this.getOwnerId()); + return uuid == null ? null : this.worldObj.getPlayerEntityByUUID(uuid); + } + catch (IllegalArgumentException var2) + { + return null; + } + } + + public boolean isOwner(EntityLivingBase entityIn) + { + return entityIn == this.getOwner(); + } + + public EntityAISit getAISit() + { + return this.aiSit; + } + + public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) + { + return true; + } + + public Team getTeam() + { + if (this.isTamed()) + { + EntityLivingBase entitylivingbase = this.getOwner(); + + if (entitylivingbase != null) + { + return entitylivingbase.getTeam(); + } + } + + return super.getTeam(); + } + + public boolean isOnSameTeam(EntityLivingBase otherEntity) + { + if (this.isTamed()) + { + EntityLivingBase entitylivingbase = this.getOwner(); + + if (otherEntity == entitylivingbase) + { + return true; + } + + if (entitylivingbase != null) + { + return entitylivingbase.isOnSameTeam(otherEntity); + } + } + + return super.isOnSameTeam(otherEntity); + } + + public void onDeath(DamageSource cause) + { + if (!this.worldObj.isRemote && this.worldObj.getGameRules().getBoolean("showDeathMessages") && this.hasCustomName() && this.getOwner() instanceof EntityPlayerMP) + { + ((EntityPlayerMP)this.getOwner()).addChatMessage(this.getCombatTracker().getDeathMessage()); + } + + super.onDeath(cause); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityVillager.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityVillager.java new file mode 100644 index 0000000..69c0fc1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityVillager.java @@ -0,0 +1,1011 @@ +package net.minecraft.entity.passive; + +import java.util.Random; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.INpc; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowGolem; +import net.minecraft.entity.ai.EntityAIHarvestFarmland; +import net.minecraft.entity.ai.EntityAILookAtTradePlayer; +import net.minecraft.entity.ai.EntityAIMoveIndoors; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAIPlay; +import net.minecraft.entity.ai.EntityAIRestrictOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITradePlayer; +import net.minecraft.entity.ai.EntityAIVillagerInteract; +import net.minecraft.entity.ai.EntityAIVillagerMate; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Tuple; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.village.Village; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.World; + +public class EntityVillager extends EntityAgeable implements IMerchant, INpc +{ + private int randomTickDivider; + private boolean isMating; + private boolean isPlaying; + Village villageObj; + private EntityPlayer buyingPlayer; + private MerchantRecipeList buyingList; + private int timeUntilReset; + private boolean needsInitilization; + private boolean isWillingToMate; + private int wealth; + private String lastBuyingPlayer; + private int careerId; + private int careerLevel; + private boolean isLookingForHome; + private boolean areAdditionalTasksSet; + private InventoryBasic villagerInventory; + private static final EntityVillager.ITradeList[][][][] DEFAULT_TRADE_LIST_MAP = new EntityVillager.ITradeList[][][][] {{{{new EntityVillager.EmeraldForItems(Items.wheat, new EntityVillager.PriceInfo(18, 22)), new EntityVillager.EmeraldForItems(Items.potato, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.EmeraldForItems(Items.carrot, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.ListItemForEmeralds(Items.bread, new EntityVillager.PriceInfo(-4, -2))}, {new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), new EntityVillager.PriceInfo(8, 13)), new EntityVillager.ListItemForEmeralds(Items.pumpkin_pie, new EntityVillager.PriceInfo(-3, -2))}, {new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), new EntityVillager.PriceInfo(7, 12)), new EntityVillager.ListItemForEmeralds(Items.apple, new EntityVillager.PriceInfo(-5, -7))}, {new EntityVillager.ListItemForEmeralds(Items.cookie, new EntityVillager.PriceInfo(-6, -10)), new EntityVillager.ListItemForEmeralds(Items.cake, new EntityVillager.PriceInfo(1, 1))}}, {{new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ItemAndEmeraldToItem(Items.fish, new EntityVillager.PriceInfo(6, 6), Items.cooked_fish, new EntityVillager.PriceInfo(6, 6))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.fishing_rod, new EntityVillager.PriceInfo(7, 8))}}, {{new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.wool), new EntityVillager.PriceInfo(16, 22)), new EntityVillager.ListItemForEmeralds(Items.shears, new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 1), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 2), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 3), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 4), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 5), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 6), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 7), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 8), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 9), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 10), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 11), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 12), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 13), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 14), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 15), new EntityVillager.PriceInfo(1, 2))}}, {{new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.ListItemForEmeralds(Items.arrow, new EntityVillager.PriceInfo(-12, -8))}, {new EntityVillager.ListItemForEmeralds(Items.bow, new EntityVillager.PriceInfo(2, 3)), new EntityVillager.ItemAndEmeraldToItem(Item.getItemFromBlock(Blocks.gravel), new EntityVillager.PriceInfo(10, 10), Items.flint, new EntityVillager.PriceInfo(6, 10))}}}, {{{new EntityVillager.EmeraldForItems(Items.paper, new EntityVillager.PriceInfo(24, 36)), new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.EmeraldForItems(Items.book, new EntityVillager.PriceInfo(8, 10)), new EntityVillager.ListItemForEmeralds(Items.compass, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.bookshelf), new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.EmeraldForItems(Items.written_book, new EntityVillager.PriceInfo(2, 2)), new EntityVillager.ListItemForEmeralds(Items.clock, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glass), new EntityVillager.PriceInfo(-5, -3))}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListItemForEmeralds(Items.name_tag, new EntityVillager.PriceInfo(20, 22))}}}, {{{new EntityVillager.EmeraldForItems(Items.rotten_flesh, new EntityVillager.PriceInfo(36, 40)), new EntityVillager.EmeraldForItems(Items.gold_ingot, new EntityVillager.PriceInfo(8, 10))}, {new EntityVillager.ListItemForEmeralds(Items.redstone, new EntityVillager.PriceInfo(-4, -1)), new EntityVillager.ListItemForEmeralds(new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new EntityVillager.PriceInfo(-2, -1))}, {new EntityVillager.ListItemForEmeralds(Items.ender_eye, new EntityVillager.PriceInfo(7, 11)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glowstone), new EntityVillager.PriceInfo(-3, -1))}, {new EntityVillager.ListItemForEmeralds(Items.experience_bottle, new EntityVillager.PriceInfo(3, 11))}}}, {{{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.iron_helmet, new EntityVillager.PriceInfo(4, 6))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListItemForEmeralds(Items.iron_chestplate, new EntityVillager.PriceInfo(10, 14))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_chestplate, new EntityVillager.PriceInfo(16, 19))}, {new EntityVillager.ListItemForEmeralds(Items.chainmail_boots, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.chainmail_leggings, new EntityVillager.PriceInfo(9, 11)), new EntityVillager.ListItemForEmeralds(Items.chainmail_helmet, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.chainmail_chestplate, new EntityVillager.PriceInfo(11, 15))}}, {{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.iron_axe, new EntityVillager.PriceInfo(6, 8))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_sword, new EntityVillager.PriceInfo(9, 10))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_sword, new EntityVillager.PriceInfo(12, 15)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_axe, new EntityVillager.PriceInfo(9, 12))}}, {{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_shovel, new EntityVillager.PriceInfo(5, 7))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_pickaxe, new EntityVillager.PriceInfo(9, 11))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_pickaxe, new EntityVillager.PriceInfo(12, 15))}}}, {{{new EntityVillager.EmeraldForItems(Items.porkchop, new EntityVillager.PriceInfo(14, 18)), new EntityVillager.EmeraldForItems(Items.chicken, new EntityVillager.PriceInfo(14, 18))}, {new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.cooked_porkchop, new EntityVillager.PriceInfo(-7, -5)), new EntityVillager.ListItemForEmeralds(Items.cooked_chicken, new EntityVillager.PriceInfo(-8, -6))}}, {{new EntityVillager.EmeraldForItems(Items.leather, new EntityVillager.PriceInfo(9, 12)), new EntityVillager.ListItemForEmeralds(Items.leather_leggings, new EntityVillager.PriceInfo(2, 4))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.leather_chestplate, new EntityVillager.PriceInfo(7, 12))}, {new EntityVillager.ListItemForEmeralds(Items.saddle, new EntityVillager.PriceInfo(8, 10))}}}}; + + public EntityVillager(World worldIn) + { + this(worldIn, 0); + } + + public EntityVillager(World worldIn, int professionId) + { + super(worldIn); + this.villagerInventory = new InventoryBasic("Items", false, 8); + this.setProfession(professionId); + this.setSize(0.6F, 1.8F); + ((PathNavigateGround)this.getNavigator()).setBreakDoors(true); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); + this.tasks.addTask(1, new EntityAITradePlayer(this)); + this.tasks.addTask(1, new EntityAILookAtTradePlayer(this)); + this.tasks.addTask(2, new EntityAIMoveIndoors(this)); + this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); + this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); + this.tasks.addTask(6, new EntityAIVillagerMate(this)); + this.tasks.addTask(7, new EntityAIFollowGolem(this)); + this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); + this.tasks.addTask(9, new EntityAIVillagerInteract(this)); + this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); + this.setCanPickUpLoot(true); + } + + private void setAdditionalAItasks() + { + if (!this.areAdditionalTasksSet) + { + this.areAdditionalTasksSet = true; + + if (this.isChild()) + { + this.tasks.addTask(8, new EntityAIPlay(this, 0.32D)); + } + else if (this.getProfession() == 0) + { + this.tasks.addTask(6, new EntityAIHarvestFarmland(this, 0.6D)); + } + } + } + + protected void onGrowingAdult() + { + if (this.getProfession() == 0) + { + this.tasks.addTask(8, new EntityAIHarvestFarmland(this, 0.6D)); + } + + super.onGrowingAdult(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + } + + protected void updateAITasks() + { + if (--this.randomTickDivider <= 0) + { + BlockPos blockpos = new BlockPos(this); + this.worldObj.getVillageCollection().addToVillagerPositionList(blockpos); + this.randomTickDivider = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.getVillageCollection().getNearestVillage(blockpos, 32); + + if (this.villageObj == null) + { + this.detachHome(); + } + else + { + BlockPos blockpos1 = this.villageObj.getCenter(); + this.setHomePosAndDistance(blockpos1, (int)((float)this.villageObj.getVillageRadius() * 1.0F)); + + if (this.isLookingForHome) + { + this.isLookingForHome = false; + this.villageObj.setDefaultPlayerReputation(5); + } + } + } + + if (!this.isTrading() && this.timeUntilReset > 0) + { + --this.timeUntilReset; + + if (this.timeUntilReset <= 0) + { + if (this.needsInitilization) + { + for (MerchantRecipe merchantrecipe : this.buyingList) + { + if (merchantrecipe.isRecipeDisabled()) + { + merchantrecipe.increaseMaxTradeUses(this.rand.nextInt(6) + this.rand.nextInt(6) + 2); + } + } + + this.populateBuyingList(); + this.needsInitilization = false; + + if (this.villageObj != null && this.lastBuyingPlayer != null) + { + this.worldObj.setEntityState(this, (byte)14); + this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1); + } + } + + this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0)); + } + } + + super.updateAITasks(); + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg; + + if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild()) + { + if (!this.worldObj.isRemote && (this.buyingList == null || this.buyingList.size() > 0)) + { + this.setCustomer(player); + player.displayVillagerTradeGui(this); + } + + player.triggerAchievement(StatList.timesTalkedToVillagerStat); + return true; + } + else + { + return super.interact(player); + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Profession", this.getProfession()); + tagCompound.setInteger("Riches", this.wealth); + tagCompound.setInteger("Career", this.careerId); + tagCompound.setInteger("CareerLevel", this.careerLevel); + tagCompound.setBoolean("Willing", this.isWillingToMate); + + if (this.buyingList != null) + { + tagCompound.setTag("Offers", this.buyingList.getRecipiesAsTags()); + } + + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) + { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + + if (itemstack != null) + { + nbttaglist.appendTag(itemstack.writeToNBT(new NBTTagCompound())); + } + } + + tagCompound.setTag("Inventory", nbttaglist); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setProfession(tagCompund.getInteger("Profession")); + this.wealth = tagCompund.getInteger("Riches"); + this.careerId = tagCompund.getInteger("Career"); + this.careerLevel = tagCompund.getInteger("CareerLevel"); + this.isWillingToMate = tagCompund.getBoolean("Willing"); + + if (tagCompund.hasKey("Offers", 10)) + { + NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("Offers"); + this.buyingList = new MerchantRecipeList(nbttagcompound); + } + + NBTTagList nbttaglist = tagCompund.getTagList("Inventory", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); + + if (itemstack != null) + { + this.villagerInventory.func_174894_a(itemstack); + } + } + + this.setCanPickUpLoot(true); + this.setAdditionalAItasks(); + } + + protected boolean canDespawn() + { + return false; + } + + protected String getLivingSound() + { + return this.isTrading() ? "mob.villager.haggle" : "mob.villager.idle"; + } + + protected String getHurtSound() + { + return "mob.villager.hit"; + } + + protected String getDeathSound() + { + return "mob.villager.death"; + } + + public void setProfession(int professionId) + { + this.dataWatcher.updateObject(16, Integer.valueOf(professionId)); + } + + public int getProfession() + { + return Math.max(this.dataWatcher.getWatchableObjectInt(16) % 5, 0); + } + + public boolean isMating() + { + return this.isMating; + } + + public void setMating(boolean mating) + { + this.isMating = mating; + } + + public void setPlaying(boolean playing) + { + this.isPlaying = playing; + } + + public boolean isPlaying() + { + return this.isPlaying; + } + + public void setRevengeTarget(EntityLivingBase livingBase) + { + super.setRevengeTarget(livingBase); + + if (this.villageObj != null && livingBase != null) + { + this.villageObj.addOrRenewAgressor(livingBase); + + if (livingBase instanceof EntityPlayer) + { + int i = -1; + + if (this.isChild()) + { + i = -3; + } + + this.villageObj.setReputationForPlayer(livingBase.getName(), i); + + if (this.isEntityAlive()) + { + this.worldObj.setEntityState(this, (byte)13); + } + } + } + } + + public void onDeath(DamageSource cause) + { + if (this.villageObj != null) + { + Entity entity = cause.getEntity(); + + if (entity != null) + { + if (entity instanceof EntityPlayer) + { + this.villageObj.setReputationForPlayer(entity.getName(), -2); + } + else if (entity instanceof IMob) + { + this.villageObj.endMatingSeason(); + } + } + else + { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 16.0D); + + if (entityplayer != null) + { + this.villageObj.endMatingSeason(); + } + } + } + + super.onDeath(cause); + } + + public void setCustomer(EntityPlayer p_70932_1_) + { + this.buyingPlayer = p_70932_1_; + } + + public EntityPlayer getCustomer() + { + return this.buyingPlayer; + } + + public boolean isTrading() + { + return this.buyingPlayer != null; + } + + public boolean getIsWillingToMate(boolean updateFirst) + { + if (!this.isWillingToMate && updateFirst && this.func_175553_cp()) + { + boolean flag = false; + + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) + { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + + if (itemstack != null) + { + if (itemstack.getItem() == Items.bread && itemstack.stackSize >= 3) + { + flag = true; + this.villagerInventory.decrStackSize(i, 3); + } + else if ((itemstack.getItem() == Items.potato || itemstack.getItem() == Items.carrot) && itemstack.stackSize >= 12) + { + flag = true; + this.villagerInventory.decrStackSize(i, 12); + } + } + + if (flag) + { + this.worldObj.setEntityState(this, (byte)18); + this.isWillingToMate = true; + break; + } + } + } + + return this.isWillingToMate; + } + + public void setIsWillingToMate(boolean willingToTrade) + { + this.isWillingToMate = willingToTrade; + } + + public void useRecipe(MerchantRecipe recipe) + { + recipe.incrementToolUses(); + this.livingSoundTime = -this.getTalkInterval(); + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + int i = 3 + this.rand.nextInt(4); + + if (recipe.getToolUses() == 1 || this.rand.nextInt(5) == 0) + { + this.timeUntilReset = 40; + this.needsInitilization = true; + this.isWillingToMate = true; + + if (this.buyingPlayer != null) + { + this.lastBuyingPlayer = this.buyingPlayer.getName(); + } + else + { + this.lastBuyingPlayer = null; + } + + i += 5; + } + + if (recipe.getItemToBuy().getItem() == Items.emerald) + { + this.wealth += recipe.getItemToBuy().stackSize; + } + + if (recipe.getRewardsExp()) + { + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i)); + } + } + + public void verifySellingItem(ItemStack stack) + { + if (!this.worldObj.isRemote && this.livingSoundTime > -this.getTalkInterval() + 20) + { + this.livingSoundTime = -this.getTalkInterval(); + + if (stack != null) + { + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + } + else + { + this.playSound("mob.villager.no", this.getSoundVolume(), this.getSoundPitch()); + } + } + } + + public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) + { + if (this.buyingList == null) + { + this.populateBuyingList(); + } + + return this.buyingList; + } + + private void populateBuyingList() + { + EntityVillager.ITradeList[][][] aentityvillager$itradelist = DEFAULT_TRADE_LIST_MAP[this.getProfession()]; + + if (this.careerId != 0 && this.careerLevel != 0) + { + ++this.careerLevel; + } + else + { + this.careerId = this.rand.nextInt(aentityvillager$itradelist.length) + 1; + this.careerLevel = 1; + } + + if (this.buyingList == null) + { + this.buyingList = new MerchantRecipeList(); + } + + int i = this.careerId - 1; + int j = this.careerLevel - 1; + EntityVillager.ITradeList[][] aentityvillager$itradelist1 = aentityvillager$itradelist[i]; + + if (j >= 0 && j < aentityvillager$itradelist1.length) + { + EntityVillager.ITradeList[] aentityvillager$itradelist2 = aentityvillager$itradelist1[j]; + + for (EntityVillager.ITradeList entityvillager$itradelist : aentityvillager$itradelist2) + { + entityvillager$itradelist.modifyMerchantRecipeList(this.buyingList, this.rand); + } + } + } + + public void setRecipes(MerchantRecipeList recipeList) + { + } + + public IChatComponent getDisplayName() + { + String s = this.getCustomNameTag(); + + if (s != null && s.length() > 0) + { + ChatComponentText chatcomponenttext = new ChatComponentText(s); + chatcomponenttext.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttext.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttext; + } + else + { + if (this.buyingList == null) + { + this.populateBuyingList(); + } + + String s1 = null; + + switch (this.getProfession()) + { + case 0: + if (this.careerId == 1) + { + s1 = "farmer"; + } + else if (this.careerId == 2) + { + s1 = "fisherman"; + } + else if (this.careerId == 3) + { + s1 = "shepherd"; + } + else if (this.careerId == 4) + { + s1 = "fletcher"; + } + + break; + + case 1: + s1 = "librarian"; + break; + + case 2: + s1 = "cleric"; + break; + + case 3: + if (this.careerId == 1) + { + s1 = "armor"; + } + else if (this.careerId == 2) + { + s1 = "weapon"; + } + else if (this.careerId == 3) + { + s1 = "tool"; + } + + break; + + case 4: + if (this.careerId == 1) + { + s1 = "butcher"; + } + else if (this.careerId == 2) + { + s1 = "leather"; + } + } + + if (s1 != null) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("entity.Villager." + s1, new Object[0]); + chatcomponenttranslation.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + chatcomponenttranslation.getChatStyle().setInsertion(this.getUniqueID().toString()); + return chatcomponenttranslation; + } + else + { + return super.getDisplayName(); + } + } + } + + public float getEyeHeight() + { + float f = 1.62F; + + if (this.isChild()) + { + f = (float)((double)f - 0.81D); + } + + return f; + } + + public void handleStatusUpdate(byte id) + { + if (id == 12) + { + this.spawnParticles(EnumParticleTypes.HEART); + } + else if (id == 13) + { + this.spawnParticles(EnumParticleTypes.VILLAGER_ANGRY); + } + else if (id == 14) + { + this.spawnParticles(EnumParticleTypes.VILLAGER_HAPPY); + } + else + { + super.handleStatusUpdate(id); + } + } + + private void spawnParticles(EnumParticleTypes particleType) + { + for (int i = 0; i < 5; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(particleType, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2, new int[0]); + } + } + + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + livingdata = super.onInitialSpawn(difficulty, livingdata); + this.setProfession(this.worldObj.rand.nextInt(5)); + this.setAdditionalAItasks(); + return livingdata; + } + + public void setLookingForHome() + { + this.isLookingForHome = true; + } + + public EntityVillager createChild(EntityAgeable ageable) + { + EntityVillager entityvillager = new EntityVillager(this.worldObj); + entityvillager.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null); + return entityvillager; + } + + public boolean allowLeashing() + { + return false; + } + + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + if (!this.worldObj.isRemote && !this.isDead) + { + EntityWitch entitywitch = new EntityWitch(this.worldObj); + entitywitch.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + entitywitch.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entitywitch)), (IEntityLivingData)null); + entitywitch.setNoAI(this.isAIDisabled()); + + if (this.hasCustomName()) + { + entitywitch.setCustomNameTag(this.getCustomNameTag()); + entitywitch.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag()); + } + + this.worldObj.spawnEntityInWorld(entitywitch); + this.setDead(); + } + } + + public InventoryBasic getVillagerInventory() + { + return this.villagerInventory; + } + + protected void updateEquipmentIfNeeded(EntityItem itemEntity) + { + ItemStack itemstack = itemEntity.getEntityItem(); + Item item = itemstack.getItem(); + + if (this.canVillagerPickupItem(item)) + { + ItemStack itemstack1 = this.villagerInventory.func_174894_a(itemstack); + + if (itemstack1 == null) + { + itemEntity.setDead(); + } + else + { + itemstack.stackSize = itemstack1.stackSize; + } + } + } + + private boolean canVillagerPickupItem(Item itemIn) + { + return itemIn == Items.bread || itemIn == Items.potato || itemIn == Items.carrot || itemIn == Items.wheat || itemIn == Items.wheat_seeds; + } + + public boolean func_175553_cp() + { + return this.hasEnoughItems(1); + } + + public boolean canAbondonItems() + { + return this.hasEnoughItems(2); + } + + public boolean func_175557_cr() + { + boolean flag = this.getProfession() == 0; + return flag ? !this.hasEnoughItems(5) : !this.hasEnoughItems(1); + } + + private boolean hasEnoughItems(int multiplier) + { + boolean flag = this.getProfession() == 0; + + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) + { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + + if (itemstack != null) + { + if (itemstack.getItem() == Items.bread && itemstack.stackSize >= 3 * multiplier || itemstack.getItem() == Items.potato && itemstack.stackSize >= 12 * multiplier || itemstack.getItem() == Items.carrot && itemstack.stackSize >= 12 * multiplier) + { + return true; + } + + if (flag && itemstack.getItem() == Items.wheat && itemstack.stackSize >= 9 * multiplier) + { + return true; + } + } + } + + return false; + } + + public boolean isFarmItemInInventory() + { + for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i) + { + ItemStack itemstack = this.villagerInventory.getStackInSlot(i); + + if (itemstack != null && (itemstack.getItem() == Items.wheat_seeds || itemstack.getItem() == Items.potato || itemstack.getItem() == Items.carrot)) + { + return true; + } + } + + return false; + } + + public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn) + { + if (super.replaceItemInInventory(inventorySlot, itemStackIn)) + { + return true; + } + else + { + int i = inventorySlot - 300; + + if (i >= 0 && i < this.villagerInventory.getSizeInventory()) + { + this.villagerInventory.setInventorySlotContents(i, itemStackIn); + return true; + } + else + { + return false; + } + } + } + + static class EmeraldForItems implements EntityVillager.ITradeList + { + public Item sellItem; + public EntityVillager.PriceInfo price; + + public EmeraldForItems(Item itemIn, EntityVillager.PriceInfo priceIn) + { + this.sellItem = itemIn; + this.price = priceIn; + } + + public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) + { + int i = 1; + + if (this.price != null) + { + i = this.price.getPrice(random); + } + + recipeList.add(new MerchantRecipe(new ItemStack(this.sellItem, i, 0), Items.emerald)); + } + } + + interface ITradeList + { + void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random); + } + + static class ItemAndEmeraldToItem implements EntityVillager.ITradeList + { + public ItemStack buyingItemStack; + public EntityVillager.PriceInfo buyingPriceInfo; + public ItemStack sellingItemstack; + public EntityVillager.PriceInfo field_179408_d; + + public ItemAndEmeraldToItem(Item p_i45813_1_, EntityVillager.PriceInfo p_i45813_2_, Item p_i45813_3_, EntityVillager.PriceInfo p_i45813_4_) + { + this.buyingItemStack = new ItemStack(p_i45813_1_); + this.buyingPriceInfo = p_i45813_2_; + this.sellingItemstack = new ItemStack(p_i45813_3_); + this.field_179408_d = p_i45813_4_; + } + + public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) + { + int i = 1; + + if (this.buyingPriceInfo != null) + { + i = this.buyingPriceInfo.getPrice(random); + } + + int j = 1; + + if (this.field_179408_d != null) + { + j = this.field_179408_d.getPrice(random); + } + + recipeList.add(new MerchantRecipe(new ItemStack(this.buyingItemStack.getItem(), i, this.buyingItemStack.getMetadata()), new ItemStack(Items.emerald), new ItemStack(this.sellingItemstack.getItem(), j, this.sellingItemstack.getMetadata()))); + } + } + + static class ListEnchantedBookForEmeralds implements EntityVillager.ITradeList + { + public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) + { + Enchantment enchantment = Enchantment.enchantmentsBookList[random.nextInt(Enchantment.enchantmentsBookList.length)]; + int i = MathHelper.getRandomIntegerInRange(random, enchantment.getMinLevel(), enchantment.getMaxLevel()); + ItemStack itemstack = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i)); + int j = 2 + random.nextInt(5 + i * 10) + 3 * i; + + if (j > 64) + { + j = 64; + } + + recipeList.add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, j), itemstack)); + } + } + + static class ListEnchantedItemForEmeralds implements EntityVillager.ITradeList + { + public ItemStack enchantedItemStack; + public EntityVillager.PriceInfo priceInfo; + + public ListEnchantedItemForEmeralds(Item p_i45814_1_, EntityVillager.PriceInfo p_i45814_2_) + { + this.enchantedItemStack = new ItemStack(p_i45814_1_); + this.priceInfo = p_i45814_2_; + } + + public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) + { + int i = 1; + + if (this.priceInfo != null) + { + i = this.priceInfo.getPrice(random); + } + + ItemStack itemstack = new ItemStack(Items.emerald, i, 0); + ItemStack itemstack1 = new ItemStack(this.enchantedItemStack.getItem(), 1, this.enchantedItemStack.getMetadata()); + itemstack1 = EnchantmentHelper.addRandomEnchantment(random, itemstack1, 5 + random.nextInt(15)); + recipeList.add(new MerchantRecipe(itemstack, itemstack1)); + } + } + + static class ListItemForEmeralds implements EntityVillager.ITradeList + { + public ItemStack itemToBuy; + public EntityVillager.PriceInfo priceInfo; + + public ListItemForEmeralds(Item par1Item, EntityVillager.PriceInfo priceInfo) + { + this.itemToBuy = new ItemStack(par1Item); + this.priceInfo = priceInfo; + } + + public ListItemForEmeralds(ItemStack stack, EntityVillager.PriceInfo priceInfo) + { + this.itemToBuy = stack; + this.priceInfo = priceInfo; + } + + public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) + { + int i = 1; + + if (this.priceInfo != null) + { + i = this.priceInfo.getPrice(random); + } + + ItemStack itemstack; + ItemStack itemstack1; + + if (i < 0) + { + itemstack = new ItemStack(Items.emerald, 1, 0); + itemstack1 = new ItemStack(this.itemToBuy.getItem(), -i, this.itemToBuy.getMetadata()); + } + else + { + itemstack = new ItemStack(Items.emerald, i, 0); + itemstack1 = new ItemStack(this.itemToBuy.getItem(), 1, this.itemToBuy.getMetadata()); + } + + recipeList.add(new MerchantRecipe(itemstack, itemstack1)); + } + } + + static class PriceInfo extends Tuple + { + public PriceInfo(int p_i45810_1_, int p_i45810_2_) + { + super(Integer.valueOf(p_i45810_1_), Integer.valueOf(p_i45810_2_)); + } + + public int getPrice(Random rand) + { + return ((Integer)this.getFirst()).intValue() >= ((Integer)this.getSecond()).intValue() ? ((Integer)this.getFirst()).intValue() : ((Integer)this.getFirst()).intValue() + rand.nextInt(((Integer)this.getSecond()).intValue() - ((Integer)this.getFirst()).intValue() + 1); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java new file mode 100644 index 0000000..d8b0855 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java @@ -0,0 +1,71 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public abstract class EntityWaterMob extends EntityLiving implements IAnimals +{ + public EntityWaterMob(World worldIn) + { + super(worldIn); + } + + public boolean canBreatheUnderwater() + { + return true; + } + + public boolean getCanSpawnHere() + { + return true; + } + + public boolean isNotColliding() + { + return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this); + } + + public int getTalkInterval() + { + return 120; + } + + protected boolean canDespawn() + { + return true; + } + + protected int getExperiencePoints(EntityPlayer player) + { + return 1 + this.worldObj.rand.nextInt(3); + } + + public void onEntityUpdate() + { + int i = this.getAir(); + super.onEntityUpdate(); + + if (this.isEntityAlive() && !this.isInWater()) + { + --i; + this.setAir(i); + + if (this.getAir() == -20) + { + this.setAir(0); + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } + else + { + this.setAir(300); + } + } + + public boolean isPushedByWater() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityWolf.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityWolf.java new file mode 100644 index 0000000..aba3fe6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/EntityWolf.java @@ -0,0 +1,567 @@ +package net.minecraft.entity.passive; + +import com.google.common.base.Predicate; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBeg; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityWolf extends EntityTameable +{ + private float headRotationCourse; + private float headRotationCourseOld; + private boolean isWet; + private boolean isShaking; + private float timeWolfIsShaking; + private float prevTimeWolfIsShaking; + + public EntityWolf(World worldIn) + { + super(worldIn); + this.setSize(0.6F, 0.8F); + ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0])); + this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit; + } + })); + this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, false)); + this.setTamed(false); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0D); + } + + public void setAttackTarget(EntityLivingBase entitylivingbaseIn) + { + super.setAttackTarget(entitylivingbaseIn); + + if (entitylivingbaseIn == null) + { + this.setAngry(false); + } + else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + protected void updateAITasks() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte)0)); + this.dataWatcher.addObject(20, new Byte((byte)EnumDyeColor.RED.getMetadata())); + } + + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound("mob.wolf.step", 0.15F, 1.0F); + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("Angry", this.isAngry()); + tagCompound.setByte("CollarColor", (byte)this.getCollarColor().getDyeDamage()); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setAngry(tagCompund.getBoolean("Angry")); + + if (tagCompund.hasKey("CollarColor", 99)) + { + this.setCollarColor(EnumDyeColor.byDyeDamage(tagCompund.getByte("CollarColor"))); + } + } + + protected String getLivingSound() + { + return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); + } + + protected String getHurtSound() + { + return "mob.wolf.hurt"; + } + + protected String getDeathSound() + { + return "mob.wolf.death"; + } + + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return Item.getItemById(-1); + } + + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (!this.worldObj.isRemote && this.isWet && !this.isShaking && !this.hasPath() && this.onGround) + { + this.isShaking = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + this.worldObj.setEntityState(this, (byte)8); + } + + if (!this.worldObj.isRemote && this.getAttackTarget() == null && this.isAngry()) + { + this.setAngry(false); + } + } + + public void onUpdate() + { + super.onUpdate(); + this.headRotationCourseOld = this.headRotationCourse; + + if (this.isBegging()) + { + this.headRotationCourse += (1.0F - this.headRotationCourse) * 0.4F; + } + else + { + this.headRotationCourse += (0.0F - this.headRotationCourse) * 0.4F; + } + + if (this.isWet()) + { + this.isWet = true; + this.isShaking = false; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } + else if ((this.isWet || this.isShaking) && this.isShaking) + { + if (this.timeWolfIsShaking == 0.0F) + { + this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.prevTimeWolfIsShaking = this.timeWolfIsShaking; + this.timeWolfIsShaking += 0.05F; + + if (this.prevTimeWolfIsShaking >= 2.0F) + { + this.isWet = false; + this.isShaking = false; + this.prevTimeWolfIsShaking = 0.0F; + this.timeWolfIsShaking = 0.0F; + } + + if (this.timeWolfIsShaking > 0.4F) + { + float f = (float)this.getEntityBoundingBox().minY; + int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F); + + for (int j = 0; j < i; ++j) + { + float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ, new int[0]); + } + } + } + } + + public boolean isWolfWet() + { + return this.isWet; + } + + public float getShadingWhileWet(float p_70915_1_) + { + return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F; + } + + public float getShakeAngle(float p_70923_1_, float p_70923_2_) + { + float f = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F; + + if (f < 0.0F) + { + f = 0.0F; + } + else if (f > 1.0F) + { + f = 1.0F; + } + + return MathHelper.sin(f * (float)Math.PI) * MathHelper.sin(f * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI; + } + + public float getInterestedAngle(float p_70917_1_) + { + return (this.headRotationCourseOld + (this.headRotationCourse - this.headRotationCourseOld) * p_70917_1_) * 0.15F * (float)Math.PI; + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + Entity entity = source.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + amount = (amount + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(source, amount); + } + } + + public boolean attackEntityAsMob(Entity entityIn) + { + boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue())); + + if (flag) + { + this.applyEnchantments(this, entityIn); + } + + return flag; + } + + public void setTamed(boolean tamed) + { + super.setTamed(tamed); + + if (tamed) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); + } + + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood)itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) + { + if (!player.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float)itemfood.getHealAmount(itemstack)); + + if (itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + else if (itemstack.getItem() == Items.dye) + { + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(itemstack.getMetadata()); + + if (enumdyecolor != this.getCollarColor()) + { + this.setCollarColor(enumdyecolor); + + if (!player.capabilities.isCreativeMode && --itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + } + + if (this.isOwner(player) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.navigator.clearPathEntity(); + this.setAttackTarget((EntityLivingBase)null); + } + } + else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry()) + { + if (!player.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(3) == 0) + { + this.setTamed(true); + this.navigator.clearPathEntity(); + this.setAttackTarget((EntityLivingBase)null); + this.aiSit.setSitting(true); + this.setHealth(20.0F); + this.setOwnerId(player.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte)7); + } + else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte)6); + } + } + + return true; + } + + return super.interact(player); + } + + public void handleStatusUpdate(byte id) + { + if (id == 8) + { + this.isShaking = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } + else + { + super.handleStatusUpdate(id); + } + } + + public float getTailRotation() + { + return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F)); + } + + public boolean isBreedingItem(ItemStack stack) + { + return stack == null ? false : (!(stack.getItem() instanceof ItemFood) ? false : ((ItemFood)stack.getItem()).isWolfsFavoriteMeat()); + } + + public int getMaxSpawnedInChunk() + { + return 8; + } + + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + public void setAngry(boolean angry) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (angry) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + public EnumDyeColor getCollarColor() + { + return EnumDyeColor.byDyeDamage(this.dataWatcher.getWatchableObjectByte(20) & 15); + } + + public void setCollarColor(EnumDyeColor collarcolor) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte)(collarcolor.getDyeDamage() & 15))); + } + + public EntityWolf createChild(EntityAgeable ageable) + { + EntityWolf entitywolf = new EntityWolf(this.worldObj); + String s = this.getOwnerId(); + + if (s != null && s.trim().length() > 0) + { + entitywolf.setOwnerId(s); + entitywolf.setTamed(true); + } + + return entitywolf; + } + + public void setBegging(boolean beg) + { + if (beg) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)1)); + } + else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)0)); + } + } + + public boolean canMateWith(EntityAnimal otherAnimal) + { + if (otherAnimal == this) + { + return false; + } + else if (!this.isTamed()) + { + return false; + } + else if (!(otherAnimal instanceof EntityWolf)) + { + return false; + } + else + { + EntityWolf entitywolf = (EntityWolf)otherAnimal; + return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove()); + } + } + + public boolean isBegging() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + protected boolean canDespawn() + { + return !this.isTamed() && this.ticksExisted > 2400; + } + + public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) + { + if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) + { + if (p_142018_1_ instanceof EntityWolf) + { + EntityWolf entitywolf = (EntityWolf)p_142018_1_; + + if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) + { + return false; + } + } + + return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame(); + } + else + { + return false; + } + } + + public boolean allowLeashing() + { + return !this.isAngry() && super.allowLeashing(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/passive/IAnimals.java b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/IAnimals.java new file mode 100644 index 0000000..0a0cdd2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/passive/IAnimals.java @@ -0,0 +1,5 @@ +package net.minecraft.entity.passive; + +public interface IAnimals +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/entity/player/EntityPlayer.java new file mode 100644 index 0000000..410ace8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -0,0 +1,2247 @@ +package net.minecraft.entity.player; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; +import java.util.Collection; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityCrit2FX; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.event.ClickEvent; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryEnderChest; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.FoodStats; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.IInteractionObject; +import net.minecraft.world.LockCode; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; + +@SuppressWarnings("incomplete-switch") +public abstract class EntityPlayer extends EntityLivingBase +{ + public InventoryPlayer inventory = new InventoryPlayer(this); + private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); + public Container inventoryContainer; + public Container openContainer; + protected FoodStats foodStats = new FoodStats(); + protected int flyToggleTimer; + public float prevCameraYaw; + public float cameraYaw; + public int xpCooldown; + public double prevChasingPosX; + public double prevChasingPosY; + public double prevChasingPosZ; + public double chasingPosX; + public double chasingPosY; + public double chasingPosZ; + protected boolean sleeping; + public BlockPos playerLocation; + private int sleepTimer; + public float renderOffsetX; + public float renderOffsetY; + public float renderOffsetZ; + private BlockPos spawnChunk; + private boolean spawnForced; + private BlockPos startMinecartRidingCoordinate; + public PlayerCapabilities capabilities = new PlayerCapabilities(); + public int experienceLevel; + public int experienceTotal; + public float experience; + private int xpSeed; + private ItemStack itemInUse; + private int itemInUseCount; + protected float speedOnGround = 0.1F; + protected float speedInAir = 0.02F; + private int lastXPSound; + private final GameProfile gameProfile; + private boolean hasReducedDebug = false; + public EntityFishHook fishEntity; + + private Cosmetic playerCapes = null; + private Cosmetic playerWings = null; + + public Cosmetic getPlayerCape() { + return this.playerCapes; + } + + public boolean hasCape() { + return this.playerCapes != null; + } + + public boolean hasWings() { + return this.playerWings != null; + } + + public void setCBCape(Cosmetic cosmetic) { + this.playerCapes = cosmetic; + } + + public Cosmetic getWings() { + return this.playerWings; + } + + public void setCBWings(Cosmetic cosmetic) { + this.playerWings = cosmetic; + } + + public EntityPlayer(World worldIn, GameProfile gameProfileIn) + { + super(worldIn); + this.entityUniqueID = getUUID(gameProfileIn); + this.gameProfile = gameProfileIn; + this.inventoryContainer = new ContainerPlayer(this.inventory, !worldIn.isRemote, this); + this.openContainer = this.inventoryContainer; + BlockPos blockpos = worldIn.getSpawnPoint(); + this.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)(blockpos.getY() + 1), (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F); + this.unused180 = 180.0F; + this.fireResistance = 20; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.10000000149011612D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(17, Float.valueOf(0.0F)); + this.dataWatcher.addObject(18, Integer.valueOf(0)); + this.dataWatcher.addObject(10, Byte.valueOf((byte)0)); + } + + public ItemStack getItemInUse() + { + return this.itemInUse; + } + + public int getItemInUseCount() + { + return this.itemInUseCount; + } + + public boolean isUsingItem() + { + return this.itemInUse != null; + } + + public int getItemInUseDuration() + { + return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0; + } + + public void stopUsingItem() + { + if (this.itemInUse != null) + { + this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); + } + + this.clearItemInUse(); + } + + public void clearItemInUse() + { + this.itemInUse = null; + this.itemInUseCount = 0; + + if (!this.worldObj.isRemote) + { + this.setEating(false); + } + } + + public boolean isBlocking() + { + return this.isUsingItem() && this.itemInUse.getItem().getItemUseAction(this.itemInUse) == EnumAction.BLOCK; + } + + public void onUpdate() + { + this.noClip = this.isSpectator(); + + if (this.isSpectator()) + { + this.onGround = false; + } + + if (this.itemInUse != null) + { + ItemStack itemstack = this.inventory.getCurrentItem(); + + if (itemstack == this.itemInUse) + { + if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) + { + this.updateItemUse(itemstack, 5); + } + + if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) + { + this.onItemUseFinish(); + } + } + else + { + this.clearItemInUse(); + } + } + + if (this.xpCooldown > 0) + { + --this.xpCooldown; + } + + if (this.isPlayerSleeping()) + { + ++this.sleepTimer; + + if (this.sleepTimer > 100) + { + this.sleepTimer = 100; + } + + if (!this.worldObj.isRemote) + { + if (!this.isInBed()) + { + this.wakeUpPlayer(true, true, false); + } + else if (this.worldObj.isDaytime()) + { + this.wakeUpPlayer(false, true, true); + } + } + } + else if (this.sleepTimer > 0) + { + ++this.sleepTimer; + + if (this.sleepTimer >= 110) + { + this.sleepTimer = 0; + } + } + + super.onUpdate(); + + if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) + { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + if (this.isBurning() && this.capabilities.disableDamage) + { + this.extinguish(); + } + + this.prevChasingPosX = this.chasingPosX; + this.prevChasingPosY = this.chasingPosY; + this.prevChasingPosZ = this.chasingPosZ; + double d5 = this.posX - this.chasingPosX; + double d0 = this.posY - this.chasingPosY; + double d1 = this.posZ - this.chasingPosZ; + double d2 = 10.0D; + + if (d5 > d2) + { + this.prevChasingPosX = this.chasingPosX = this.posX; + } + + if (d1 > d2) + { + this.prevChasingPosZ = this.chasingPosZ = this.posZ; + } + + if (d0 > d2) + { + this.prevChasingPosY = this.chasingPosY = this.posY; + } + + if (d5 < -d2) + { + this.prevChasingPosX = this.chasingPosX = this.posX; + } + + if (d1 < -d2) + { + this.prevChasingPosZ = this.chasingPosZ = this.posZ; + } + + if (d0 < -d2) + { + this.prevChasingPosY = this.chasingPosY = this.posY; + } + + this.chasingPosX += d5 * 0.25D; + this.chasingPosZ += d1 * 0.25D; + this.chasingPosY += d0 * 0.25D; + + if (this.ridingEntity == null) + { + this.startMinecartRidingCoordinate = null; + } + + if (!this.worldObj.isRemote) + { + this.foodStats.onUpdate(this); + this.triggerAchievement(StatList.minutesPlayedStat); + + if (this.isEntityAlive()) + { + this.triggerAchievement(StatList.timeSinceDeathStat); + } + } + + int i = 29999999; + double d3 = MathHelper.clamp_double(this.posX, -2.9999999E7D, 2.9999999E7D); + double d4 = MathHelper.clamp_double(this.posZ, -2.9999999E7D, 2.9999999E7D); + + if (d3 != this.posX || d4 != this.posZ) + { + this.setPosition(d3, this.posY, d4); + } + } + + public int getMaxInPortalTime() + { + return this.capabilities.disableDamage ? 0 : 80; + } + + protected String getSwimSound() + { + return "game.player.swim"; + } + + protected String getSplashSound() + { + return "game.player.swim.splash"; + } + + public int getPortalCooldown() + { + return 10; + } + + public void playSound(String name, float volume, float pitch) + { + this.worldObj.playSoundToNearExcept(this, name, volume, pitch); + } + + protected void updateItemUse(ItemStack itemStackIn, int p_71010_2_) + { + if (itemStackIn.getItemUseAction() == EnumAction.DRINK) + { + this.playSound("random.drink", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (itemStackIn.getItemUseAction() == EnumAction.EAT) + { + for (int i = 0; i < p_71010_2_; ++i) + { + Vec3 vec3 = new Vec3(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + vec3 = vec3.rotatePitch(-this.rotationPitch * (float)Math.PI / 180.0F); + vec3 = vec3.rotateYaw(-this.rotationYaw * (float)Math.PI / 180.0F); + double d0 = (double)(-this.rand.nextFloat()) * 0.6D - 0.3D; + Vec3 vec31 = new Vec3(((double)this.rand.nextFloat() - 0.5D) * 0.3D, d0, 0.6D); + vec31 = vec31.rotatePitch(-this.rotationPitch * (float)Math.PI / 180.0F); + vec31 = vec31.rotateYaw(-this.rotationYaw * (float)Math.PI / 180.0F); + vec31 = vec31.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); + + if (itemStackIn.getHasSubtypes()) + { + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord, new int[] {Item.getIdFromItem(itemStackIn.getItem()), itemStackIn.getMetadata()}); + } + else + { + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord, new int[] {Item.getIdFromItem(itemStackIn.getItem())}); + } + } + + this.playSound("random.eat", 0.5F + 0.5F * (float)this.rand.nextInt(2), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } + + protected void onItemUseFinish() + { + if (this.itemInUse != null) + { + this.updateItemUse(this.itemInUse, 16); + int i = this.itemInUse.stackSize; + ItemStack itemstack = this.itemInUse.onItemUseFinish(this.worldObj, this); + + if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i) + { + this.inventory.mainInventory[this.inventory.currentItem] = itemstack; + + if (itemstack.stackSize == 0) + { + this.inventory.mainInventory[this.inventory.currentItem] = null; + } + } + + this.clearItemInUse(); + } + } + + public void handleStatusUpdate(byte id) + { + if (id == 9) + { + this.onItemUseFinish(); + } + else if (id == 23) + { + this.hasReducedDebug = false; + } + else if (id == 22) + { + this.hasReducedDebug = true; + } + else + { + super.handleStatusUpdate(id); + } + } + + protected boolean isMovementBlocked() + { + return this.getHealth() <= 0.0F || this.isPlayerSleeping(); + } + + protected void closeScreen() + { + this.openContainer = this.inventoryContainer; + } + + public void updateRidden() + { + if (!this.worldObj.isRemote && this.isSneaking()) + { + this.mountEntity((Entity)null); + this.setSneaking(false); + } + else + { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + float f = this.rotationYaw; + float f1 = this.rotationPitch; + super.updateRidden(); + this.prevCameraYaw = this.cameraYaw; + this.cameraYaw = 0.0F; + this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + + if (this.ridingEntity instanceof EntityPig) + { + this.rotationPitch = f1; + this.rotationYaw = f; + this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; + } + } + } + + public void preparePlayerToSpawn() + { + this.setSize(0.6F, 1.8F); + super.preparePlayerToSpawn(); + this.setHealth(this.getMaxHealth()); + this.deathTime = 0; + } + + protected void updateEntityActionState() + { + super.updateEntityActionState(); + this.updateArmSwingProgress(); + this.rotationYawHead = this.rotationYaw; + } + + public void onLivingUpdate() + { + if (this.flyToggleTimer > 0) + { + --this.flyToggleTimer; + } + + if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL && this.worldObj.getGameRules().getBoolean("naturalRegeneration")) + { + if (this.getHealth() < this.getMaxHealth() && this.ticksExisted % 20 == 0) + { + this.heal(1.0F); + } + + if (this.foodStats.needFood() && this.ticksExisted % 10 == 0) + { + this.foodStats.setFoodLevel(this.foodStats.getFoodLevel() + 1); + } + } + + this.inventory.decrementAnimations(); + this.prevCameraYaw = this.cameraYaw; + super.onLivingUpdate(); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (!this.worldObj.isRemote) + { + iattributeinstance.setBaseValue((double)this.capabilities.getWalkSpeed()); + } + + this.jumpMovementFactor = this.speedInAir; + + if (this.isSprinting()) + { + this.jumpMovementFactor = (float)((double)this.jumpMovementFactor + (double)this.speedInAir * 0.3D); + } + + this.setAIMoveSpeed((float)iattributeinstance.getAttributeValue()); + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float f1 = (float)(Math.atan(-this.motionY * 0.20000000298023224D) * 15.0D); + + if (f > 0.1F) + { + f = 0.1F; + } + + if (!this.onGround || this.getHealth() <= 0.0F) + { + f = 0.0F; + } + + if (this.onGround || this.getHealth() <= 0.0F) + { + f1 = 0.0F; + } + + this.cameraYaw += (f - this.cameraYaw) * 0.4F; + this.cameraPitch += (f1 - this.cameraPitch) * 0.8F; + + if (this.getHealth() > 0.0F && !this.isSpectator()) + { + AxisAlignedBB axisalignedbb = null; + + if (this.ridingEntity != null && !this.ridingEntity.isDead) + { + axisalignedbb = this.getEntityBoundingBox().union(this.ridingEntity.getEntityBoundingBox()).expand(1.0D, 0.0D, 1.0D); + } + else + { + axisalignedbb = this.getEntityBoundingBox().expand(1.0D, 0.5D, 1.0D); + } + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, axisalignedbb); + + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (!entity.isDead) + { + this.collideWithPlayer(entity); + } + } + } + } + + private void collideWithPlayer(Entity p_71044_1_) + { + p_71044_1_.onCollideWithPlayer(this); + } + + public int getScore() + { + return this.dataWatcher.getWatchableObjectInt(18); + } + + public void setScore(int p_85040_1_) + { + this.dataWatcher.updateObject(18, Integer.valueOf(p_85040_1_)); + } + + public void addScore(int p_85039_1_) + { + int i = this.getScore(); + this.dataWatcher.updateObject(18, Integer.valueOf(i + p_85039_1_)); + } + + public void onDeath(DamageSource cause) + { + super.onDeath(cause); + this.setSize(0.2F, 0.2F); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionY = 0.10000000149011612D; + + if (this.getName().equals("Notch")) + { + this.dropItem(new ItemStack(Items.apple, 1), true, false); + } + + if (!this.worldObj.getGameRules().getBoolean("keepInventory")) + { + this.inventory.dropAllItems(); + } + + if (cause != null) + { + this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); + this.motionZ = (double)(-MathHelper.sin((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); + } + else + { + this.motionX = this.motionZ = 0.0D; + } + + this.triggerAchievement(StatList.deathsStat); + this.func_175145_a(StatList.timeSinceDeathStat); + } + + protected String getHurtSound() + { + return "game.player.hurt"; + } + + protected String getDeathSound() + { + return "game.player.die"; + } + + public void addToPlayerScore(Entity entityIn, int amount) + { + this.addScore(amount); + Collection collection = this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.totalKillCount); + + if (entityIn instanceof EntityPlayer) + { + this.triggerAchievement(StatList.playerKillsStat); + collection.addAll(this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.playerKillCount)); + collection.addAll(this.func_175137_e(entityIn)); + } + else + { + this.triggerAchievement(StatList.mobKillsStat); + } + + for (ScoreObjective scoreobjective : collection) + { + Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective); + score.func_96648_a(); + } + } + + private Collection func_175137_e(Entity p_175137_1_) + { + ScorePlayerTeam scoreplayerteam = this.getWorldScoreboard().getPlayersTeam(this.getName()); + + if (scoreplayerteam != null) + { + int i = scoreplayerteam.getChatFormat().getColorIndex(); + + if (i >= 0 && i < IScoreObjectiveCriteria.field_178793_i.length) + { + for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178793_i[i])) + { + Score score = this.getWorldScoreboard().getValueFromObjective(p_175137_1_.getName(), scoreobjective); + score.func_96648_a(); + } + } + } + + ScorePlayerTeam scoreplayerteam1 = this.getWorldScoreboard().getPlayersTeam(p_175137_1_.getName()); + + if (scoreplayerteam1 != null) + { + int j = scoreplayerteam1.getChatFormat().getColorIndex(); + + if (j >= 0 && j < IScoreObjectiveCriteria.field_178792_h.length) + { + return this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.field_178792_h[j]); + } + } + + return Lists.newArrayList(); + } + + public EntityItem dropOneItem(boolean dropAll) + { + return this.dropItem(this.inventory.decrStackSize(this.inventory.currentItem, dropAll && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false, true); + } + + public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean unused) + { + return this.dropItem(itemStackIn, false, false); + } + + public EntityItem dropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem) + { + if (droppedItem == null) + { + return null; + } + else if (droppedItem.stackSize == 0) + { + return null; + } + else + { + double d0 = this.posY - 0.30000001192092896D + (double)this.getEyeHeight(); + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, d0, this.posZ, droppedItem); + entityitem.setPickupDelay(40); + + if (traceItem) + { + entityitem.setThrower(this.getName()); + } + + if (dropAround) + { + float f = this.rand.nextFloat() * 0.5F; + float f1 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + entityitem.motionX = (double)(-MathHelper.sin(f1) * f); + entityitem.motionZ = (double)(MathHelper.cos(f1) * f); + entityitem.motionY = 0.20000000298023224D; + } + else + { + float f2 = 0.3F; + entityitem.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f2); + entityitem.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f2); + entityitem.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * f2 + 0.1F); + float f3 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + f2 = 0.02F * this.rand.nextFloat(); + entityitem.motionX += Math.cos((double)f3) * (double)f2; + entityitem.motionY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + entityitem.motionZ += Math.sin((double)f3) * (double)f2; + } + + this.joinEntityItemWithWorld(entityitem); + + if (traceItem) + { + this.triggerAchievement(StatList.dropStat); + } + + return entityitem; + } + } + + protected void joinEntityItemWithWorld(EntityItem itemIn) + { + this.worldObj.spawnEntityInWorld(itemIn); + } + + public float getToolDigEfficiency(Block p_180471_1_) + { + float f = this.inventory.getStrVsBlock(p_180471_1_); + + if (f > 1.0F) + { + int i = EnchantmentHelper.getEfficiencyModifier(this); + ItemStack itemstack = this.inventory.getCurrentItem(); + + if (i > 0 && itemstack != null) + { + f += (float)(i * i + 1); + } + } + + if (this.isPotionActive(Potion.digSpeed)) + { + f *= 1.0F + (float)(this.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F; + } + + if (this.isPotionActive(Potion.digSlowdown)) + { + float f1 = 1.0F; + + switch (this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) + { + case 0: + f1 = 0.3F; + break; + + case 1: + f1 = 0.09F; + break; + + case 2: + f1 = 0.0027F; + break; + + case 3: + default: + f1 = 8.1E-4F; + } + + f *= f1; + } + + if (this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) + { + f /= 5.0F; + } + + if (!this.onGround) + { + f /= 5.0F; + } + + return f; + } + + public boolean canHarvestBlock(Block blockToHarvest) + { + return this.inventory.canHeldItemHarvest(blockToHarvest); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.entityUniqueID = getUUID(this.gameProfile); + NBTTagList nbttaglist = tagCompund.getTagList("Inventory", 10); + this.inventory.readFromNBT(nbttaglist); + this.inventory.currentItem = tagCompund.getInteger("SelectedItemSlot"); + this.sleeping = tagCompund.getBoolean("Sleeping"); + this.sleepTimer = tagCompund.getShort("SleepTimer"); + this.experience = tagCompund.getFloat("XpP"); + this.experienceLevel = tagCompund.getInteger("XpLevel"); + this.experienceTotal = tagCompund.getInteger("XpTotal"); + this.xpSeed = tagCompund.getInteger("XpSeed"); + + if (this.xpSeed == 0) + { + this.xpSeed = this.rand.nextInt(); + } + + this.setScore(tagCompund.getInteger("Score")); + + if (this.sleeping) + { + this.playerLocation = new BlockPos(this); + this.wakeUpPlayer(true, true, false); + } + + if (tagCompund.hasKey("SpawnX", 99) && tagCompund.hasKey("SpawnY", 99) && tagCompund.hasKey("SpawnZ", 99)) + { + this.spawnChunk = new BlockPos(tagCompund.getInteger("SpawnX"), tagCompund.getInteger("SpawnY"), tagCompund.getInteger("SpawnZ")); + this.spawnForced = tagCompund.getBoolean("SpawnForced"); + } + + this.foodStats.readNBT(tagCompund); + this.capabilities.readCapabilitiesFromNBT(tagCompund); + + if (tagCompund.hasKey("EnderItems", 9)) + { + NBTTagList nbttaglist1 = tagCompund.getTagList("EnderItems", 10); + this.theInventoryEnderChest.loadInventoryFromNBT(nbttaglist1); + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); + tagCompound.setInteger("SelectedItemSlot", this.inventory.currentItem); + tagCompound.setBoolean("Sleeping", this.sleeping); + tagCompound.setShort("SleepTimer", (short)this.sleepTimer); + tagCompound.setFloat("XpP", this.experience); + tagCompound.setInteger("XpLevel", this.experienceLevel); + tagCompound.setInteger("XpTotal", this.experienceTotal); + tagCompound.setInteger("XpSeed", this.xpSeed); + tagCompound.setInteger("Score", this.getScore()); + + if (this.spawnChunk != null) + { + tagCompound.setInteger("SpawnX", this.spawnChunk.getX()); + tagCompound.setInteger("SpawnY", this.spawnChunk.getY()); + tagCompound.setInteger("SpawnZ", this.spawnChunk.getZ()); + tagCompound.setBoolean("SpawnForced", this.spawnForced); + } + + this.foodStats.writeNBT(tagCompound); + this.capabilities.writeCapabilitiesToNBT(tagCompound); + tagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); + ItemStack itemstack = this.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() != null) + { + tagCompound.setTag("SelectedItem", itemstack.writeToNBT(new NBTTagCompound())); + } + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else if (this.capabilities.disableDamage && !source.canHarmInCreative()) + { + return false; + } + else + { + this.entityAge = 0; + + if (this.getHealth() <= 0.0F) + { + return false; + } + else + { + if (this.isPlayerSleeping() && !this.worldObj.isRemote) + { + this.wakeUpPlayer(true, true, false); + } + + if (source.isDifficultyScaled()) + { + if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) + { + amount = 0.0F; + } + + if (this.worldObj.getDifficulty() == EnumDifficulty.EASY) + { + amount = amount / 2.0F + 1.0F; + } + + if (this.worldObj.getDifficulty() == EnumDifficulty.HARD) + { + amount = amount * 3.0F / 2.0F; + } + } + + if (amount == 0.0F) + { + return false; + } + else + { + Entity entity = source.getEntity(); + + if (entity instanceof EntityArrow && ((EntityArrow)entity).shootingEntity != null) + { + entity = ((EntityArrow)entity).shootingEntity; + } + + return super.attackEntityFrom(source, amount); + } + } + } + } + + public boolean canAttackPlayer(EntityPlayer other) + { + Team team = this.getTeam(); + Team team1 = other.getTeam(); + return team == null ? true : (!team.isSameTeam(team1) ? true : team.getAllowFriendlyFire()); + } + + protected void damageArmor(float p_70675_1_) + { + this.inventory.damageArmor(p_70675_1_); + } + + public int getTotalArmorValue() + { + return this.inventory.getTotalArmorValue(); + } + + public float getArmorVisibility() + { + int i = 0; + + for (ItemStack itemstack : this.inventory.armorInventory) + { + if (itemstack != null) + { + ++i; + } + } + + return (float)i / (float)this.inventory.armorInventory.length; + } + + protected void damageEntity(DamageSource damageSrc, float damageAmount) + { + if (!this.isEntityInvulnerable(damageSrc)) + { + if (!damageSrc.isUnblockable() && this.isBlocking() && damageAmount > 0.0F) + { + damageAmount = (1.0F + damageAmount) * 0.5F; + } + + damageAmount = this.applyArmorCalculations(damageSrc, damageAmount); + damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount); + float f = damageAmount; + damageAmount = Math.max(damageAmount - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (f - damageAmount)); + + if (damageAmount != 0.0F) + { + this.addExhaustion(damageSrc.getHungerDamage()); + float f1 = this.getHealth(); + this.setHealth(this.getHealth() - damageAmount); + this.getCombatTracker().trackDamage(damageSrc, f1, damageAmount); + + if (damageAmount < 3.4028235E37F) + { + this.addStat(StatList.damageTakenStat, Math.round(damageAmount * 10.0F)); + } + } + } + } + + public void openEditSign(TileEntitySign signTile) + { + } + + public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic) + { + } + + public void displayVillagerTradeGui(IMerchant villager) + { + } + + public void displayGUIChest(IInventory chestInventory) + { + } + + public void displayGUIHorse(EntityHorse horse, IInventory horseInventory) + { + } + + public void displayGui(IInteractionObject guiOwner) + { + } + + public void displayGUIBook(ItemStack bookStack) + { + } + + public boolean interactWith(Entity targetEntity) + { + if (this.isSpectator()) + { + if (targetEntity instanceof IInventory) + { + this.displayGUIChest((IInventory)targetEntity); + } + + return false; + } + else + { + ItemStack itemstack = this.getCurrentEquippedItem(); + ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; + + if (!targetEntity.interactFirst(this)) + { + if (itemstack != null && targetEntity instanceof EntityLivingBase) + { + if (this.capabilities.isCreativeMode) + { + itemstack = itemstack1; + } + + if (itemstack.interactWithEntity(this, (EntityLivingBase)targetEntity)) + { + if (itemstack.stackSize <= 0 && !this.capabilities.isCreativeMode) + { + this.destroyCurrentEquippedItem(); + } + + return true; + } + } + + return false; + } + else + { + if (itemstack != null && itemstack == this.getCurrentEquippedItem()) + { + if (itemstack.stackSize <= 0 && !this.capabilities.isCreativeMode) + { + this.destroyCurrentEquippedItem(); + } + else if (itemstack.stackSize < itemstack1.stackSize && this.capabilities.isCreativeMode) + { + itemstack.stackSize = itemstack1.stackSize; + } + } + + return true; + } + } + } + + public ItemStack getCurrentEquippedItem() + { + return this.inventory.getCurrentItem(); + } + + public void destroyCurrentEquippedItem() + { + this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); + } + + public double getYOffset() + { + return -0.35D; + } + + public void attackTargetEntityWithCurrentItem(Entity targetEntity) + { + if (targetEntity.canAttackWithItem()) + { + if (!targetEntity.hitByEntity(this)) + { + float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; + float f1 = 0.0F; + + if (targetEntity instanceof EntityLivingBase) + { + f1 = EnchantmentHelper.getModifierForCreature(this.getHeldItem(), ((EntityLivingBase)targetEntity).getCreatureAttribute()); + } + else + { + f1 = EnchantmentHelper.getModifierForCreature(this.getHeldItem(), EnumCreatureAttribute.UNDEFINED); + } + + i = i + EnchantmentHelper.getKnockbackModifier(this); + + if (this.isSprinting()) + { + ++i; + } + + if (f > 0.0F || f1 > 0.0F) + { + boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && targetEntity instanceof EntityLivingBase; + + if (flag && f > 0.0F) + { + f *= 1.5F; + } + + f = f + f1; + boolean flag1 = false; + int j = EnchantmentHelper.getFireAspectModifier(this); + + if (targetEntity instanceof EntityLivingBase && j > 0 && !targetEntity.isBurning()) + { + flag1 = true; + targetEntity.setFire(1); + } + + double d0 = targetEntity.motionX; + double d1 = targetEntity.motionY; + double d2 = targetEntity.motionZ; + boolean flag2 = targetEntity.attackEntityFrom(DamageSource.causePlayerDamage(this), f); + + if (flag2) + { + if (i > 0) + { + targetEntity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + this.setSprinting(false); + } + + if (targetEntity instanceof EntityPlayerMP && targetEntity.velocityChanged) + { + ((EntityPlayerMP)targetEntity).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(targetEntity)); + targetEntity.velocityChanged = false; + targetEntity.motionX = d0; + targetEntity.motionY = d1; + targetEntity.motionZ = d2; + } + + boolean override = Minecraft.getMinecraft().isSingleplayer() ? (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.damaged.getValue().equals("Override") : (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.attacking.getValue().equals("Override"); + boolean vanilla = Minecraft.getMinecraft().isSingleplayer() ? (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.damaged.getValue().equals("Vanilla") : (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.attacking.getValue().equals("Vanilla"); + + if (flag || CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().particlesMod.critParticles.getValue().equals("Always") && !vanilla) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && !vanilla) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.critParticles.getValue().equals("Never") && override) { + float multiplierValue = (float) CheatBreaker.getInstance().getModuleManager().particlesMod.critParticlesMultiplier.getValue(); + Minecraft.getMinecraft().effectRenderer.emitParticleAtEntity(targetEntity, EnumParticleTypes.CRIT, multiplierValue); + } + } else { + this.onCriticalHit(targetEntity); + } + } + + if (f1 > 0.0F || CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticles.getValue().equals("Always") && !vanilla) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && !vanilla) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticles.getValue().equals("Never") && override) { + float multiplierValue = (float) CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticlesMultiplier.getValue(); + Minecraft.getMinecraft().effectRenderer.emitParticleAtEntity(targetEntity, EnumParticleTypes.CRIT_MAGIC, multiplierValue); + } + } else { + this.onEnchantmentCritical(targetEntity); + } + } + + if (f >= 18.0F) + { + this.triggerAchievement(AchievementList.overkill); + } + + this.setLastAttacker(targetEntity); + + if (targetEntity instanceof EntityLivingBase) + { + EnchantmentHelper.applyThornEnchantments((EntityLivingBase)targetEntity, this); + } + + EnchantmentHelper.applyArthropodEnchantments(this, targetEntity); + ItemStack itemstack = this.getCurrentEquippedItem(); + Entity entity = targetEntity; + + if (targetEntity instanceof EntityDragonPart) + { + IEntityMultiPart ientitymultipart = ((EntityDragonPart)targetEntity).entityDragonObj; + + if (ientitymultipart instanceof EntityLivingBase) + { + entity = (EntityLivingBase)ientitymultipart; + } + } + + if (itemstack != null && entity instanceof EntityLivingBase) + { + itemstack.hitEntity((EntityLivingBase)entity, this); + + if (itemstack.stackSize <= 0) + { + this.destroyCurrentEquippedItem(); + } + } + + if (targetEntity instanceof EntityLivingBase) + { + this.addStat(StatList.damageDealtStat, Math.round(f * 10.0F)); + + if (j > 0) + { + targetEntity.setFire(j * 4); + } + } + + this.addExhaustion(0.3F); + } + else if (flag1) + { + targetEntity.extinguish(); + } + } + } + } + } + + public void onCriticalHit(Entity entityHit) + { + } + + public void onEnchantmentCritical(Entity entityHit) + { + } + + public void respawnPlayer() + { + } + + public void setDead() + { + super.setDead(); + this.inventoryContainer.onContainerClosed(this); + + if (this.openContainer != null) + { + this.openContainer.onContainerClosed(this); + } + } + + public boolean isEntityInsideOpaqueBlock() + { + return !this.sleeping && super.isEntityInsideOpaqueBlock(); + } + + public boolean isUser() + { + return false; + } + + public GameProfile getGameProfile() + { + return this.gameProfile; + } + + public EntityPlayer.EnumStatus trySleep(BlockPos bedLocation) + { + if (!this.worldObj.isRemote) + { + if (this.isPlayerSleeping() || !this.isEntityAlive()) + { + return EntityPlayer.EnumStatus.OTHER_PROBLEM; + } + + if (!this.worldObj.provider.isSurfaceWorld()) + { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_HERE; + } + + if (this.worldObj.isDaytime()) + { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW; + } + + if (Math.abs(this.posX - (double)bedLocation.getX()) > 3.0D || Math.abs(this.posY - (double)bedLocation.getY()) > 2.0D || Math.abs(this.posZ - (double)bedLocation.getZ()) > 3.0D) + { + return EntityPlayer.EnumStatus.TOO_FAR_AWAY; + } + + double d0 = 8.0D; + double d1 = 5.0D; + List list = this.worldObj.getEntitiesWithinAABB(EntityMob.class, new AxisAlignedBB((double)bedLocation.getX() - d0, (double)bedLocation.getY() - d1, (double)bedLocation.getZ() - d0, (double)bedLocation.getX() + d0, (double)bedLocation.getY() + d1, (double)bedLocation.getZ() + d0)); + + if (!list.isEmpty()) + { + return EntityPlayer.EnumStatus.NOT_SAFE; + } + } + + if (this.isRiding()) + { + this.mountEntity((Entity)null); + } + + this.setSize(0.2F, 0.2F); + + if (this.worldObj.isBlockLoaded(bedLocation)) + { + EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(bedLocation).getValue(BlockDirectional.FACING); + float f = 0.5F; + float f1 = 0.5F; + + switch (enumfacing) + { + case SOUTH: + f1 = 0.9F; + break; + + case NORTH: + f1 = 0.1F; + break; + + case WEST: + f = 0.1F; + break; + + case EAST: + f = 0.9F; + } + + this.func_175139_a(enumfacing); + this.setPosition((double)((float)bedLocation.getX() + f), (double)((float)bedLocation.getY() + 0.6875F), (double)((float)bedLocation.getZ() + f1)); + } + else + { + this.setPosition((double)((float)bedLocation.getX() + 0.5F), (double)((float)bedLocation.getY() + 0.6875F), (double)((float)bedLocation.getZ() + 0.5F)); + } + + this.sleeping = true; + this.sleepTimer = 0; + this.playerLocation = bedLocation; + this.motionX = this.motionZ = this.motionY = 0.0D; + + if (!this.worldObj.isRemote) + { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + return EntityPlayer.EnumStatus.OK; + } + + private void func_175139_a(EnumFacing p_175139_1_) + { + this.renderOffsetX = 0.0F; + this.renderOffsetZ = 0.0F; + + switch (p_175139_1_) + { + case SOUTH: + this.renderOffsetZ = -1.8F; + break; + + case NORTH: + this.renderOffsetZ = 1.8F; + break; + + case WEST: + this.renderOffsetX = 1.8F; + break; + + case EAST: + this.renderOffsetX = -1.8F; + } + } + + public void wakeUpPlayer(boolean immediately, boolean updateWorldFlag, boolean setSpawn) + { + this.setSize(0.6F, 1.8F); + IBlockState iblockstate = this.worldObj.getBlockState(this.playerLocation); + + if (this.playerLocation != null && iblockstate.getBlock() == Blocks.bed) + { + this.worldObj.setBlockState(this.playerLocation, iblockstate.withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)), 4); + BlockPos blockpos = BlockBed.getSafeExitLocation(this.worldObj, this.playerLocation, 0); + + if (blockpos == null) + { + blockpos = this.playerLocation.up(); + } + + this.setPosition((double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.1F), (double)((float)blockpos.getZ() + 0.5F)); + } + + this.sleeping = false; + + if (!this.worldObj.isRemote && updateWorldFlag) + { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + this.sleepTimer = immediately ? 0 : 100; + + if (setSpawn) + { + this.setSpawnPoint(this.playerLocation, false); + } + } + + private boolean isInBed() + { + return this.worldObj.getBlockState(this.playerLocation).getBlock() == Blocks.bed; + } + + public static BlockPos getBedSpawnLocation(World worldIn, BlockPos bedLocation, boolean forceSpawn) + { + Block block = worldIn.getBlockState(bedLocation).getBlock(); + + if (block != Blocks.bed) + { + if (!forceSpawn) + { + return null; + } + else + { + boolean flag = block.canSpawnInBlock(); + boolean flag1 = worldIn.getBlockState(bedLocation.up()).getBlock().canSpawnInBlock(); + return flag && flag1 ? bedLocation : null; + } + } + else + { + return BlockBed.getSafeExitLocation(worldIn, bedLocation, 0); + } + } + + public float getBedOrientationInDegrees() + { + if (this.playerLocation != null) + { + EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(this.playerLocation).getValue(BlockDirectional.FACING); + + switch (enumfacing) + { + case SOUTH: + return 90.0F; + + case NORTH: + return 270.0F; + + case WEST: + return 0.0F; + + case EAST: + return 180.0F; + } + } + + return 0.0F; + } + + public boolean isPlayerSleeping() + { + return this.sleeping; + } + + public boolean isPlayerFullyAsleep() + { + return this.sleeping && this.sleepTimer >= 100; + } + + public int getSleepTimer() + { + return this.sleepTimer; + } + + public void addChatComponentMessage(IChatComponent chatComponent) + { + } + + public BlockPos getBedLocation() + { + return this.spawnChunk; + } + + public boolean isSpawnForced() + { + return this.spawnForced; + } + + public void setSpawnPoint(BlockPos pos, boolean forced) + { + if (pos != null) + { + this.spawnChunk = pos; + this.spawnForced = forced; + } + else + { + this.spawnChunk = null; + this.spawnForced = false; + } + } + + public void triggerAchievement(StatBase achievementIn) + { + this.addStat(achievementIn, 1); + } + + public void addStat(StatBase stat, int amount) + { + } + + public void func_175145_a(StatBase p_175145_1_) + { + } + + public void jump() + { + super.jump(); + this.triggerAchievement(StatList.jumpStat); + + if (this.isSprinting()) + { + this.addExhaustion(0.8F); + } + else + { + this.addExhaustion(0.2F); + } + } + + public void moveEntityWithHeading(float strafe, float forward) + { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + + if (this.capabilities.isFlying && this.ridingEntity == null) + { + double d3 = this.motionY; + float f = this.jumpMovementFactor; + this.jumpMovementFactor = this.capabilities.getFlySpeed() * (float)(this.isSprinting() ? 2 : 1); + super.moveEntityWithHeading(strafe, forward); + this.motionY = d3 * 0.6D; + this.jumpMovementFactor = f; + } + else + { + super.moveEntityWithHeading(strafe, forward); + } + + this.addMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + } + + public float getAIMoveSpeed() + { + return (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); + } + + public void addMovementStat(double p_71000_1_, double p_71000_3_, double p_71000_5_) + { + if (this.ridingEntity == null) + { + if (this.isInsideOfMaterial(Material.water)) + { + int i = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_3_ * p_71000_3_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (i > 0) + { + this.addStat(StatList.distanceDoveStat, i); + this.addExhaustion(0.015F * (float)i * 0.01F); + } + } + else if (this.isInWater()) + { + int j = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (j > 0) + { + this.addStat(StatList.distanceSwumStat, j); + this.addExhaustion(0.015F * (float)j * 0.01F); + } + } + else if (this.isOnLadder()) + { + if (p_71000_3_ > 0.0D) + { + this.addStat(StatList.distanceClimbedStat, (int)Math.round(p_71000_3_ * 100.0D)); + } + } + else if (this.onGround) + { + int k = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (k > 0) + { + this.addStat(StatList.distanceWalkedStat, k); + + if (this.isSprinting()) + { + this.addStat(StatList.distanceSprintedStat, k); + this.addExhaustion(0.099999994F * (float)k * 0.01F); + } + else + { + if (this.isSneaking()) + { + this.addStat(StatList.distanceCrouchedStat, k); + } + + this.addExhaustion(0.01F * (float)k * 0.01F); + } + } + } + else + { + int l = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (l > 25) + { + this.addStat(StatList.distanceFlownStat, l); + } + } + } + } + + private void addMountedMovementStat(double p_71015_1_, double p_71015_3_, double p_71015_5_) + { + if (this.ridingEntity != null) + { + int i = Math.round(MathHelper.sqrt_double(p_71015_1_ * p_71015_1_ + p_71015_3_ * p_71015_3_ + p_71015_5_ * p_71015_5_) * 100.0F); + + if (i > 0) + { + if (this.ridingEntity instanceof EntityMinecart) + { + this.addStat(StatList.distanceByMinecartStat, i); + + if (this.startMinecartRidingCoordinate == null) + { + this.startMinecartRidingCoordinate = new BlockPos(this); + } + else if (this.startMinecartRidingCoordinate.distanceSq((double)MathHelper.floor_double(this.posX), (double)MathHelper.floor_double(this.posY), (double)MathHelper.floor_double(this.posZ)) >= 1000000.0D) + { + this.triggerAchievement(AchievementList.onARail); + } + } + else if (this.ridingEntity instanceof EntityBoat) + { + this.addStat(StatList.distanceByBoatStat, i); + } + else if (this.ridingEntity instanceof EntityPig) + { + this.addStat(StatList.distanceByPigStat, i); + } + else if (this.ridingEntity instanceof EntityHorse) + { + this.addStat(StatList.distanceByHorseStat, i); + } + } + } + } + + public void fall(float distance, float damageMultiplier) + { + if (!this.capabilities.allowFlying) + { + if (distance >= 2.0F) + { + this.addStat(StatList.distanceFallenStat, (int)Math.round((double)distance * 100.0D)); + } + + super.fall(distance, damageMultiplier); + } + } + + protected void resetHeight() + { + if (!this.isSpectator()) + { + super.resetHeight(); + } + } + + protected String getFallSoundString(int damageValue) + { + return damageValue > 4 ? "game.player.hurt.fall.big" : "game.player.hurt.fall.small"; + } + + public void onKillEntity(EntityLivingBase entityLivingIn) + { + if (entityLivingIn instanceof IMob) + { + this.triggerAchievement(AchievementList.killEnemy); + } + + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entityLivingIn))); + + if (entitylist$entityegginfo != null) + { + this.triggerAchievement(entitylist$entityegginfo.field_151512_d); + } + } + + public void setInWeb() + { + if (!this.capabilities.isFlying) + { + super.setInWeb(); + } + } + + public ItemStack getCurrentArmor(int slotIn) + { + return this.inventory.armorItemInSlot(slotIn); + } + + public void addExperience(int amount) + { + this.addScore(amount); + int i = Integer.MAX_VALUE - this.experienceTotal; + + if (amount > i) + { + amount = i; + } + + this.experience += (float)amount / (float)this.xpBarCap(); + + for (this.experienceTotal += amount; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) + { + this.experience = (this.experience - 1.0F) * (float)this.xpBarCap(); + this.addExperienceLevel(1); + } + } + + public int getXPSeed() + { + return this.xpSeed; + } + + public void removeExperienceLevel(int levels) + { + this.experienceLevel -= levels; + + if (this.experienceLevel < 0) + { + this.experienceLevel = 0; + this.experience = 0.0F; + this.experienceTotal = 0; + } + + this.xpSeed = this.rand.nextInt(); + } + + public void addExperienceLevel(int levels) + { + this.experienceLevel += levels; + + if (this.experienceLevel < 0) + { + this.experienceLevel = 0; + this.experience = 0.0F; + this.experienceTotal = 0; + } + + if (levels > 0 && this.experienceLevel % 5 == 0 && (float)this.lastXPSound < (float)this.ticksExisted - 100.0F) + { + float f = this.experienceLevel > 30 ? 1.0F : (float)this.experienceLevel / 30.0F; + this.worldObj.playSoundAtEntity(this, "random.levelup", f * 0.75F, 1.0F); + this.lastXPSound = this.ticksExisted; + } + } + + public int xpBarCap() + { + return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); + } + + public void addExhaustion(float p_71020_1_) + { + if (!this.capabilities.disableDamage) + { + if (!this.worldObj.isRemote) + { + this.foodStats.addExhaustion(p_71020_1_); + } + } + } + + public FoodStats getFoodStats() + { + return this.foodStats; + } + + public boolean canEat(boolean ignoreHunger) + { + return (ignoreHunger || this.foodStats.needFood()) && !this.capabilities.disableDamage; + } + + public boolean shouldHeal() + { + return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); + } + + public void setItemInUse(ItemStack stack, int duration) + { + if (stack != this.itemInUse) + { + this.itemInUse = stack; + this.itemInUseCount = duration; + + if (!this.worldObj.isRemote) + { + this.setEating(true); + } + } + } + + public boolean isAllowEdit() + { + return this.capabilities.allowEdit; + } + + public boolean canPlayerEdit(BlockPos p_175151_1_, EnumFacing p_175151_2_, ItemStack p_175151_3_) + { + if (this.capabilities.allowEdit) + { + return true; + } + else if (p_175151_3_ == null) + { + return false; + } + else + { + BlockPos blockpos = p_175151_1_.offset(p_175151_2_.getOpposite()); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + return p_175151_3_.canPlaceOn(block) || p_175151_3_.canEditBlocks(); + } + } + + protected int getExperiencePoints(EntityPlayer player) + { + if (this.worldObj.getGameRules().getBoolean("keepInventory")) + { + return 0; + } + else + { + int i = this.experienceLevel * 7; + return i > 100 ? 100 : i; + } + } + + protected boolean isPlayer() + { + return true; + } + + public boolean getAlwaysRenderNameTagForRender() + { + return true; + } + + public void clonePlayer(EntityPlayer oldPlayer, boolean respawnFromEnd) + { + if (respawnFromEnd) + { + this.inventory.copyInventory(oldPlayer.inventory); + this.setHealth(oldPlayer.getHealth()); + this.foodStats = oldPlayer.foodStats; + this.experienceLevel = oldPlayer.experienceLevel; + this.experienceTotal = oldPlayer.experienceTotal; + this.experience = oldPlayer.experience; + this.setScore(oldPlayer.getScore()); + this.lastPortalPos = oldPlayer.lastPortalPos; + this.lastPortalVec = oldPlayer.lastPortalVec; + this.teleportDirection = oldPlayer.teleportDirection; + } + else if (this.worldObj.getGameRules().getBoolean("keepInventory")) + { + this.inventory.copyInventory(oldPlayer.inventory); + this.experienceLevel = oldPlayer.experienceLevel; + this.experienceTotal = oldPlayer.experienceTotal; + this.experience = oldPlayer.experience; + this.setScore(oldPlayer.getScore()); + } + + this.xpSeed = oldPlayer.xpSeed; + this.theInventoryEnderChest = oldPlayer.theInventoryEnderChest; + this.getDataWatcher().updateObject(10, Byte.valueOf(oldPlayer.getDataWatcher().getWatchableObjectByte(10))); + } + + protected boolean canTriggerWalking() + { + return !this.capabilities.isFlying; + } + + public void sendPlayerAbilities() + { + } + + public void setGameType(WorldSettings.GameType gameType) + { + } + + public String getName() + { + return this.gameProfile.getName(); + } + + public InventoryEnderChest getInventoryEnderChest() + { + return this.theInventoryEnderChest; + } + + public ItemStack getEquipmentInSlot(int slotIn) + { + return slotIn == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[slotIn - 1]; + } + + public ItemStack getHeldItem() + { + return this.inventory.getCurrentItem(); + } + + public void setCurrentItemOrArmor(int slotIn, ItemStack stack) + { + this.inventory.armorInventory[slotIn] = stack; + } + + public boolean isInvisibleToPlayer(EntityPlayer player) + { + if (!this.isInvisible()) + { + return false; + } + else if (player.isSpectator()) + { + return false; + } + else + { + Team team = this.getTeam(); + return team == null || player == null || player.getTeam() != team || !team.getSeeFriendlyInvisiblesEnabled(); + } + } + + public abstract boolean isSpectator(); + + public ItemStack[] getInventory() + { + return this.inventory.armorInventory; + } + + public boolean isPushedByWater() + { + return !this.capabilities.isFlying; + } + + public Scoreboard getWorldScoreboard() + { + return this.worldObj.getScoreboard(); + } + + public Team getTeam() + { + return this.getWorldScoreboard().getPlayersTeam(this.getName()); + } + + public IChatComponent getDisplayName() + { + IChatComponent ichatcomponent = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getName())); + ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getName() + " ")); + ichatcomponent.getChatStyle().setChatHoverEvent(this.getHoverEvent()); + ichatcomponent.getChatStyle().setInsertion(this.getName()); + return ichatcomponent; + } + + public float getEyeHeight() + { + float f = 1.62F; + + if (this.isPlayerSleeping()) + { + f = 0.2F; + } + + if (this.isSneaking()) + { + f -= 0.08F; + } + + return f; + } + + public void setAbsorptionAmount(float amount) + { + if (amount < 0.0F) + { + amount = 0.0F; + } + + this.getDataWatcher().updateObject(17, Float.valueOf(amount)); + } + + public float getAbsorptionAmount() + { + return this.getDataWatcher().getWatchableObjectFloat(17); + } + + public static UUID getUUID(GameProfile profile) + { + UUID uuid = profile.getId(); + + if (uuid == null) + { + uuid = getOfflineUUID(profile.getName()); + } + + return uuid; + } + + public static UUID getOfflineUUID(String username) + { + return UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes(Charsets.UTF_8)); + } + + public boolean canOpen(LockCode code) + { + if (code.isEmpty()) + { + return true; + } + else + { + ItemStack itemstack = this.getCurrentEquippedItem(); + return itemstack != null && itemstack.hasDisplayName() ? itemstack.getDisplayName().equals(code.getLock()) : false; + } + } + + public boolean isWearing(EnumPlayerModelParts p_175148_1_) + { + return (this.getDataWatcher().getWatchableObjectByte(10) & p_175148_1_.getPartMask()) == p_175148_1_.getPartMask(); + } + + public boolean sendCommandFeedback() + { + return MinecraftServer.getServer().worldServers[0].getGameRules().getBoolean("sendCommandFeedback"); + } + + public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn) + { + if (inventorySlot >= 0 && inventorySlot < this.inventory.mainInventory.length) + { + this.inventory.setInventorySlotContents(inventorySlot, itemStackIn); + return true; + } + else + { + int i = inventorySlot - 100; + + if (i >= 0 && i < this.inventory.armorInventory.length) + { + int k = i + 1; + + if (itemStackIn != null && itemStackIn.getItem() != null) + { + if (itemStackIn.getItem() instanceof ItemArmor) + { + if (EntityLiving.getArmorPosition(itemStackIn) != k) + { + return false; + } + } + else if (k != 4 || itemStackIn.getItem() != Items.skull && !(itemStackIn.getItem() instanceof ItemBlock)) + { + return false; + } + } + + this.inventory.setInventorySlotContents(i + this.inventory.mainInventory.length, itemStackIn); + return true; + } + else + { + int j = inventorySlot - 200; + + if (j >= 0 && j < this.theInventoryEnderChest.getSizeInventory()) + { + this.theInventoryEnderChest.setInventorySlotContents(j, itemStackIn); + return true; + } + else + { + return false; + } + } + } + } + + public boolean hasReducedDebug() + { + return this.hasReducedDebug; + } + + public void setReducedDebug(boolean reducedDebug) + { + this.hasReducedDebug = reducedDebug; + } + + public static enum EnumChatVisibility + { + FULL(0, "options.chat.visibility.full"), + SYSTEM(1, "options.chat.visibility.system"), + HIDDEN(2, "options.chat.visibility.hidden"); + + private static final EntityPlayer.EnumChatVisibility[] ID_LOOKUP = new EntityPlayer.EnumChatVisibility[values().length]; + private final int chatVisibility; + private final String resourceKey; + + private EnumChatVisibility(int id, String resourceKey) + { + this.chatVisibility = id; + this.resourceKey = resourceKey; + } + + public int getChatVisibility() + { + return this.chatVisibility; + } + + public static EntityPlayer.EnumChatVisibility getEnumChatVisibility(int id) + { + return ID_LOOKUP[id % ID_LOOKUP.length]; + } + + public String getResourceKey() + { + return this.resourceKey; + } + + static { + for (EntityPlayer.EnumChatVisibility entityplayer$enumchatvisibility : values()) + { + ID_LOOKUP[entityplayer$enumchatvisibility.chatVisibility] = entityplayer$enumchatvisibility; + } + } + } + + public static enum EnumStatus + { + OK, + NOT_POSSIBLE_HERE, + NOT_POSSIBLE_NOW, + TOO_FAR_AWAY, + OTHER_PROBLEM, + NOT_SAFE; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java b/Client-1.8.9/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java new file mode 100644 index 0000000..b862f32 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java @@ -0,0 +1,1119 @@ +package net.minecraft.entity.player; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.mojang.authlib.GameProfile; +import io.netty.buffer.Unpooled; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockWall; +import net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.SlotCrafting; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMapBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S42PacketCombatEvent; +import net.minecraft.network.play.server.S43PacketCamera; +import net.minecraft.network.play.server.S48PacketResourcePackSend; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.server.management.UserListOpsEntry; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonSerializableSet; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.IInteractionObject; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityPlayerMP extends EntityPlayer implements ICrafting +{ + private static final Logger logger = LogManager.getLogger(); + private String translator = "en_US"; + public NetHandlerPlayServer playerNetServerHandler; + public final MinecraftServer mcServer; + public final ItemInWorldManager theItemInWorldManager; + public double managedPosX; + public double managedPosZ; + public final List loadedChunks = Lists.newLinkedList(); + private final List destroyedItemsNetCache = Lists.newLinkedList(); + private final StatisticsFile statsFile; + private float combinedHealth = Float.MIN_VALUE; + private float lastHealth = -1.0E8F; + private int lastFoodLevel = -99999999; + private boolean wasHungry = true; + private int lastExperience = -99999999; + private int respawnInvulnerabilityTicks = 60; + private EntityPlayer.EnumChatVisibility chatVisibility; + private boolean chatColours = true; + private long playerLastActiveTime = System.currentTimeMillis(); + private Entity spectatingEntity = null; + private int currentWindowId; + public boolean isChangingQuantityOnly; + public int ping; + public boolean playerConqueredTheEnd; + + public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, ItemInWorldManager interactionManager) + { + super(worldIn, profile); + interactionManager.thisPlayerMP = this; + this.theItemInWorldManager = interactionManager; + BlockPos blockpos = worldIn.getSpawnPoint(); + + if (!worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) + { + int i = Math.max(5, server.getSpawnProtectionSize() - 6); + int j = MathHelper.floor_double(worldIn.getWorldBorder().getClosestDistance((double)blockpos.getX(), (double)blockpos.getZ())); + + if (j < i) + { + i = j; + } + + if (j <= 1) + { + i = 1; + } + + blockpos = worldIn.getTopSolidOrLiquidBlock(blockpos.add(this.rand.nextInt(i * 2) - i, 0, this.rand.nextInt(i * 2) - i)); + } + + this.mcServer = server; + this.statsFile = server.getConfigurationManager().getPlayerStatsFile(this); + this.stepHeight = 0.0F; + this.moveToBlockPosAndAngles(blockpos, 0.0F, 0.0F); + + while (!worldIn.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && this.posY < 255.0D) + { + this.setPosition(this.posX, this.posY + 1.0D, this.posZ); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("playerGameType", 99)) + { + if (MinecraftServer.getServer().getForceGamemode()) + { + this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType()); + } + else + { + this.theItemInWorldManager.setGameType(WorldSettings.GameType.getByID(tagCompund.getInteger("playerGameType"))); + } + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); + } + + public void addExperienceLevel(int levels) + { + super.addExperienceLevel(levels); + this.lastExperience = -1; + } + + public void removeExperienceLevel(int levels) + { + super.removeExperienceLevel(levels); + this.lastExperience = -1; + } + + public void addSelfToInternalCraftingInventory() + { + this.openContainer.onCraftGuiOpened(this); + } + + public void sendEnterCombat() + { + super.sendEnterCombat(); + this.playerNetServerHandler.sendPacket(new S42PacketCombatEvent(this.getCombatTracker(), S42PacketCombatEvent.Event.ENTER_COMBAT)); + } + + public void sendEndCombat() + { + super.sendEndCombat(); + this.playerNetServerHandler.sendPacket(new S42PacketCombatEvent(this.getCombatTracker(), S42PacketCombatEvent.Event.END_COMBAT)); + } + + public void onUpdate() + { + this.theItemInWorldManager.updateBlockRemoving(); + --this.respawnInvulnerabilityTicks; + + if (this.hurtResistantTime > 0) + { + --this.hurtResistantTime; + } + + this.openContainer.detectAndSendChanges(); + + if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) + { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + while (!this.destroyedItemsNetCache.isEmpty()) + { + int i = Math.min(this.destroyedItemsNetCache.size(), Integer.MAX_VALUE); + int[] aint = new int[i]; + Iterator iterator = this.destroyedItemsNetCache.iterator(); + int j = 0; + + while (iterator.hasNext() && j < i) + { + aint[j++] = ((Integer)iterator.next()).intValue(); + iterator.remove(); + } + + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(aint)); + } + + if (!this.loadedChunks.isEmpty()) + { + List list = Lists.newArrayList(); + Iterator iterator1 = this.loadedChunks.iterator(); + List list1 = Lists.newArrayList(); + + while (iterator1.hasNext() && ((List)list).size() < 10) + { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)iterator1.next(); + + if (chunkcoordintpair != null) + { + if (this.worldObj.isBlockLoaded(new BlockPos(chunkcoordintpair.chunkXPos << 4, 0, chunkcoordintpair.chunkZPos << 4))) + { + Chunk chunk = this.worldObj.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); + + if (chunk.isPopulated()) + { + list.add(chunk); + list1.addAll(((WorldServer)this.worldObj).getTileEntitiesIn(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16)); + iterator1.remove(); + } + } + } + else + { + iterator1.remove(); + } + } + + if (!list.isEmpty()) + { + if (list.size() == 1) + { + this.playerNetServerHandler.sendPacket(new S21PacketChunkData((Chunk)list.get(0), true, 65535)); + } + else + { + this.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(list)); + } + + for (TileEntity tileentity : list1) + { + this.sendTileEntityUpdate(tileentity); + } + + for (Chunk chunk1 : list) + { + this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk1); + } + } + } + + Entity entity = this.getSpectatingEntity(); + + if (entity != this) + { + if (!entity.isEntityAlive()) + { + this.setSpectatingEntity(this); + } + else + { + this.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); + this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this); + + if (this.isSneaking()) + { + this.setSpectatingEntity(this); + } + } + } + } + + public void onUpdateEntity() + { + try + { + super.onUpdate(); + + for (int i = 0; i < this.inventory.getSizeInventory(); ++i) + { + ItemStack itemstack = this.inventory.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().isMap()) + { + Packet packet = ((ItemMapBase)itemstack.getItem()).createMapDataPacket(itemstack, this.worldObj, this); + + if (packet != null) + { + this.playerNetServerHandler.sendPacket(packet); + } + } + } + + if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) + { + this.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); + this.lastHealth = this.getHealth(); + this.lastFoodLevel = this.foodStats.getFoodLevel(); + this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; + } + + if (this.getHealth() + this.getAbsorptionAmount() != this.combinedHealth) + { + this.combinedHealth = this.getHealth() + this.getAbsorptionAmount(); + + for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.health)) + { + this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective).func_96651_a(Arrays.asList(new EntityPlayer[] {this})); + } + } + + if (this.experienceTotal != this.lastExperience) + { + this.lastExperience = this.experienceTotal; + this.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(this.experience, this.experienceTotal, this.experienceLevel)); + } + + if (this.ticksExisted % 20 * 5 == 0 && !this.getStatFile().hasAchievementUnlocked(AchievementList.exploreAllBiomes)) + { + this.updateBiomesExplored(); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking player"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Player being ticked"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + protected void updateBiomesExplored() + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))); + String s = biomegenbase.biomeName; + JsonSerializableSet jsonserializableset = (JsonSerializableSet)this.getStatFile().func_150870_b(AchievementList.exploreAllBiomes); + + if (jsonserializableset == null) + { + jsonserializableset = (JsonSerializableSet)this.getStatFile().func_150872_a(AchievementList.exploreAllBiomes, new JsonSerializableSet()); + } + + jsonserializableset.add(s); + + if (this.getStatFile().canUnlockAchievement(AchievementList.exploreAllBiomes) && jsonserializableset.size() >= BiomeGenBase.explorationBiomesList.size()) + { + Set set = Sets.newHashSet(BiomeGenBase.explorationBiomesList); + + for (String s1 : jsonserializableset) + { + Iterator iterator = set.iterator(); + + while (iterator.hasNext()) + { + BiomeGenBase biomegenbase1 = (BiomeGenBase)iterator.next(); + + if (biomegenbase1.biomeName.equals(s1)) + { + iterator.remove(); + } + } + + if (set.isEmpty()) + { + break; + } + } + + if (set.isEmpty()) + { + this.triggerAchievement(AchievementList.exploreAllBiomes); + } + } + } + + public void onDeath(DamageSource cause) + { + if (this.worldObj.getGameRules().getBoolean("showDeathMessages")) + { + Team team = this.getTeam(); + + if (team != null && team.getDeathMessageVisibility() != Team.EnumVisible.ALWAYS) + { + if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OTHER_TEAMS) + { + this.mcServer.getConfigurationManager().sendMessageToAllTeamMembers(this, this.getCombatTracker().getDeathMessage()); + } + else if (team.getDeathMessageVisibility() == Team.EnumVisible.HIDE_FOR_OWN_TEAM) + { + this.mcServer.getConfigurationManager().sendMessageToTeamOrEvryPlayer(this, this.getCombatTracker().getDeathMessage()); + } + } + else + { + this.mcServer.getConfigurationManager().sendChatMsg(this.getCombatTracker().getDeathMessage()); + } + } + + if (!this.worldObj.getGameRules().getBoolean("keepInventory")) + { + this.inventory.dropAllItems(); + } + + for (ScoreObjective scoreobjective : this.worldObj.getScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.deathCount)) + { + Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective); + score.func_96648_a(); + } + + EntityLivingBase entitylivingbase = this.getAttackingEntity(); + + if (entitylivingbase != null) + { + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase))); + + if (entitylist$entityegginfo != null) + { + this.triggerAchievement(entitylist$entityegginfo.field_151513_e); + } + + entitylivingbase.addToPlayerScore(this, this.scoreValue); + } + + this.triggerAchievement(StatList.deathsStat); + this.func_175145_a(StatList.timeSinceDeathStat); + this.getCombatTracker().reset(); + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + boolean flag = this.mcServer.isDedicatedServer() && this.canPlayersAttack() && "fall".equals(source.damageType); + + if (!flag && this.respawnInvulnerabilityTicks > 0 && source != DamageSource.outOfWorld) + { + return false; + } + else + { + if (source instanceof EntityDamageSource) + { + Entity entity = source.getEntity(); + + if (entity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)entity)) + { + return false; + } + + if (entity instanceof EntityArrow) + { + EntityArrow entityarrow = (EntityArrow)entity; + + if (entityarrow.shootingEntity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)entityarrow.shootingEntity)) + { + return false; + } + } + } + + return super.attackEntityFrom(source, amount); + } + } + } + + public boolean canAttackPlayer(EntityPlayer other) + { + return !this.canPlayersAttack() ? false : super.canAttackPlayer(other); + } + + private boolean canPlayersAttack() + { + return this.mcServer.isPVPEnabled(); + } + + public void travelToDimension(int dimensionId) + { + if (this.dimension == 1 && dimensionId == 1) + { + this.triggerAchievement(AchievementList.theEnd2); + this.worldObj.removeEntity(this); + this.playerConqueredTheEnd = true; + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(4, 0.0F)); + } + else + { + if (this.dimension == 0 && dimensionId == 1) + { + this.triggerAchievement(AchievementList.theEnd); + BlockPos blockpos = this.mcServer.worldServerForDimension(dimensionId).getSpawnCoordinate(); + + if (blockpos != null) + { + this.playerNetServerHandler.setPlayerLocation((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ(), 0.0F, 0.0F); + } + + dimensionId = 1; + } + else + { + this.triggerAchievement(AchievementList.portal); + } + + this.mcServer.getConfigurationManager().transferPlayerToDimension(this, dimensionId); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + } + } + + public boolean isSpectatedByPlayer(EntityPlayerMP player) + { + return player.isSpectator() ? this.getSpectatingEntity() == this : (this.isSpectator() ? false : super.isSpectatedByPlayer(player)); + } + + private void sendTileEntityUpdate(TileEntity p_147097_1_) + { + if (p_147097_1_ != null) + { + Packet packet = p_147097_1_.getDescriptionPacket(); + + if (packet != null) + { + this.playerNetServerHandler.sendPacket(packet); + } + } + } + + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) + { + super.onItemPickup(p_71001_1_, p_71001_2_); + this.openContainer.detectAndSendChanges(); + } + + public EntityPlayer.EnumStatus trySleep(BlockPos bedLocation) + { + EntityPlayer.EnumStatus entityplayer$enumstatus = super.trySleep(bedLocation); + + if (entityplayer$enumstatus == EntityPlayer.EnumStatus.OK) + { + Packet packet = new S0APacketUseBed(this, bedLocation); + this.getServerForPlayer().getEntityTracker().sendToAllTrackingEntity(this, packet); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.playerNetServerHandler.sendPacket(packet); + } + + return entityplayer$enumstatus; + } + + public void wakeUpPlayer(boolean immediately, boolean updateWorldFlag, boolean setSpawn) + { + if (this.isPlayerSleeping()) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 2)); + } + + super.wakeUpPlayer(immediately, updateWorldFlag, setSpawn); + + if (this.playerNetServerHandler != null) + { + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + } + + public void mountEntity(Entity entityIn) + { + Entity entity = this.ridingEntity; + super.mountEntity(entityIn); + + if (entityIn != entity) + { + this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity)); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + } + + protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos) + { + } + + public void handleFalling(double p_71122_1_, boolean p_71122_3_) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D); + int k = MathHelper.floor_double(this.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() == Material.air) + { + Block block1 = this.worldObj.getBlockState(blockpos.down()).getBlock(); + + if (block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate) + { + blockpos = blockpos.down(); + block = this.worldObj.getBlockState(blockpos).getBlock(); + } + } + + super.updateFallState(p_71122_1_, p_71122_3_, block, blockpos); + } + + public void openEditSign(TileEntitySign signTile) + { + signTile.setPlayer(this); + this.playerNetServerHandler.sendPacket(new S36PacketSignEditorOpen(signTile.getPos())); + } + + private void getNextWindowId() + { + this.currentWindowId = this.currentWindowId % 100 + 1; + } + + public void displayGui(IInteractionObject guiOwner) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, guiOwner.getGuiID(), guiOwner.getDisplayName())); + this.openContainer = guiOwner.createContainer(this.inventory, this); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + } + + public void displayGUIChest(IInventory chestInventory) + { + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + + if (chestInventory instanceof ILockableContainer) + { + ILockableContainer ilockablecontainer = (ILockableContainer)chestInventory; + + if (ilockablecontainer.isLocked() && !this.canOpen(ilockablecontainer.getLockCode()) && !this.isSpectator()) + { + this.playerNetServerHandler.sendPacket(new S02PacketChat(new ChatComponentTranslation("container.isLocked", new Object[] {chestInventory.getDisplayName()}), (byte)2)); + this.playerNetServerHandler.sendPacket(new S29PacketSoundEffect("random.door_close", this.posX, this.posY, this.posZ, 1.0F, 1.0F)); + return; + } + } + + this.getNextWindowId(); + + if (chestInventory instanceof IInteractionObject) + { + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, ((IInteractionObject)chestInventory).getGuiID(), chestInventory.getDisplayName(), chestInventory.getSizeInventory())); + this.openContainer = ((IInteractionObject)chestInventory).createContainer(this.inventory, this); + } + else + { + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "minecraft:container", chestInventory.getDisplayName(), chestInventory.getSizeInventory())); + this.openContainer = new ContainerChest(this.inventory, chestInventory, this); + } + + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + } + + public void displayVillagerTradeGui(IMerchant villager) + { + this.getNextWindowId(); + this.openContainer = new ContainerMerchant(this.inventory, villager, this.worldObj); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + IInventory iinventory = ((ContainerMerchant)this.openContainer).getMerchantInventory(); + IChatComponent ichatcomponent = villager.getDisplayName(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "minecraft:villager", ichatcomponent, iinventory.getSizeInventory())); + MerchantRecipeList merchantrecipelist = villager.getRecipes(this); + + if (merchantrecipelist != null) + { + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + packetbuffer.writeInt(this.currentWindowId); + merchantrecipelist.writeToBuf(packetbuffer); + this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|TrList", packetbuffer)); + } + } + + public void displayGUIHorse(EntityHorse horse, IInventory horseInventory) + { + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "EntityHorse", horseInventory.getDisplayName(), horseInventory.getSizeInventory(), horse.getEntityId())); + this.openContainer = new ContainerHorseInventory(this.inventory, horseInventory, horse, this); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.onCraftGuiOpened(this); + } + + public void displayGUIBook(ItemStack bookStack) + { + Item item = bookStack.getItem(); + + if (item == Items.written_book) + { + this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|BOpen", new PacketBuffer(Unpooled.buffer()))); + } + } + + public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack) + { + if (!(containerToSend.getSlot(slotInd) instanceof SlotCrafting)) + { + if (!this.isChangingQuantityOnly) + { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(containerToSend.windowId, slotInd, stack)); + } + } + } + + public void sendContainerToPlayer(Container p_71120_1_) + { + this.updateCraftingInventory(p_71120_1_, p_71120_1_.getInventory()); + } + + public void updateCraftingInventory(Container containerToSend, List itemsList) + { + this.playerNetServerHandler.sendPacket(new S30PacketWindowItems(containerToSend.windowId, itemsList)); + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + + public void sendProgressBarUpdate(Container containerIn, int varToUpdate, int newValue) + { + this.playerNetServerHandler.sendPacket(new S31PacketWindowProperty(containerIn.windowId, varToUpdate, newValue)); + } + + public void sendAllWindowProperties(Container p_175173_1_, IInventory p_175173_2_) + { + for (int i = 0; i < p_175173_2_.getFieldCount(); ++i) + { + this.playerNetServerHandler.sendPacket(new S31PacketWindowProperty(p_175173_1_.windowId, i, p_175173_2_.getField(i))); + } + } + + public void closeScreen() + { + this.playerNetServerHandler.sendPacket(new S2EPacketCloseWindow(this.openContainer.windowId)); + this.closeContainer(); + } + + public void updateHeldItem() + { + if (!this.isChangingQuantityOnly) + { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + } + + public void closeContainer() + { + this.openContainer.onContainerClosed(this); + this.openContainer = this.inventoryContainer; + } + + public void setEntityActionState(float p_110430_1_, float p_110430_2_, boolean p_110430_3_, boolean sneaking) + { + if (this.ridingEntity != null) + { + if (p_110430_1_ >= -1.0F && p_110430_1_ <= 1.0F) + { + this.moveStrafing = p_110430_1_; + } + + if (p_110430_2_ >= -1.0F && p_110430_2_ <= 1.0F) + { + this.moveForward = p_110430_2_; + } + + this.isJumping = p_110430_3_; + this.setSneaking(sneaking); + } + } + + public void addStat(StatBase stat, int amount) + { + if (stat != null) + { + this.statsFile.increaseStat(this, stat, amount); + + for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(stat.getCriteria())) + { + this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective).increseScore(amount); + } + + if (this.statsFile.func_150879_e()) + { + this.statsFile.func_150876_a(this); + } + } + } + + public void func_175145_a(StatBase p_175145_1_) + { + if (p_175145_1_ != null) + { + this.statsFile.unlockAchievement(this, p_175145_1_, 0); + + for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(p_175145_1_.getCriteria())) + { + this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective).setScorePoints(0); + } + + if (this.statsFile.func_150879_e()) + { + this.statsFile.func_150876_a(this); + } + } + } + + public void mountEntityAndWakeUp() + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity(this); + } + + if (this.sleeping) + { + this.wakeUpPlayer(true, false, false); + } + } + + public void setPlayerHealthUpdated() + { + this.lastHealth = -1.0E8F; + } + + public void addChatComponentMessage(IChatComponent chatComponent) + { + this.playerNetServerHandler.sendPacket(new S02PacketChat(chatComponent)); + } + + protected void onItemUseFinish() + { + this.playerNetServerHandler.sendPacket(new S19PacketEntityStatus(this, (byte)9)); + super.onItemUseFinish(); + } + + public void setItemInUse(ItemStack stack, int duration) + { + super.setItemInUse(stack, duration); + + if (stack != null && stack.getItem() != null && stack.getItem().getItemUseAction(stack) == EnumAction.EAT) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 3)); + } + } + + public void clonePlayer(EntityPlayer oldPlayer, boolean respawnFromEnd) + { + super.clonePlayer(oldPlayer, respawnFromEnd); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + this.destroyedItemsNetCache.addAll(((EntityPlayerMP)oldPlayer).destroyedItemsNetCache); + } + + protected void onNewPotionEffect(PotionEffect id) + { + super.onNewPotionEffect(id); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), id)); + } + + protected void onChangedPotionEffect(PotionEffect id, boolean p_70695_2_) + { + super.onChangedPotionEffect(id, p_70695_2_); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), id)); + } + + protected void onFinishedPotionEffect(PotionEffect effect) + { + super.onFinishedPotionEffect(effect); + this.playerNetServerHandler.sendPacket(new S1EPacketRemoveEntityEffect(this.getEntityId(), effect)); + } + + public void setPositionAndUpdate(double x, double y, double z) + { + this.playerNetServerHandler.setPlayerLocation(x, y, z, this.rotationYaw, this.rotationPitch); + } + + public void onCriticalHit(Entity entityHit) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(entityHit, 4)); + } + + public void onEnchantmentCritical(Entity entityHit) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(entityHit, 5)); + } + + public void sendPlayerAbilities() + { + if (this.playerNetServerHandler != null) + { + this.playerNetServerHandler.sendPacket(new S39PacketPlayerAbilities(this.capabilities)); + this.updatePotionMetadata(); + } + } + + public WorldServer getServerForPlayer() + { + return (WorldServer)this.worldObj; + } + + public void setGameType(WorldSettings.GameType gameType) + { + this.theItemInWorldManager.setGameType(gameType); + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(3, (float)gameType.getID())); + + if (gameType == WorldSettings.GameType.SPECTATOR) + { + this.mountEntity((Entity)null); + } + else + { + this.setSpectatingEntity(this); + } + + this.sendPlayerAbilities(); + this.markPotionsDirty(); + } + + public boolean isSpectator() + { + return this.theItemInWorldManager.getGameType() == WorldSettings.GameType.SPECTATOR; + } + + public void addChatMessage(IChatComponent component) + { + this.playerNetServerHandler.sendPacket(new S02PacketChat(component)); + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + if ("seed".equals(commandName) && !this.mcServer.isDedicatedServer()) + { + return true; + } + else if (!"tell".equals(commandName) && !"help".equals(commandName) && !"me".equals(commandName) && !"trigger".equals(commandName)) + { + if (this.mcServer.getConfigurationManager().canSendCommands(this.getGameProfile())) + { + UserListOpsEntry userlistopsentry = (UserListOpsEntry)this.mcServer.getConfigurationManager().getOppedPlayers().getEntry(this.getGameProfile()); + return userlistopsentry != null ? userlistopsentry.getPermissionLevel() >= permLevel : this.mcServer.getOpPermissionLevel() >= permLevel; + } + else + { + return false; + } + } + else + { + return true; + } + } + + public String getPlayerIP() + { + String s = this.playerNetServerHandler.netManager.getRemoteAddress().toString(); + s = s.substring(s.indexOf("/") + 1); + s = s.substring(0, s.indexOf(":")); + return s; + } + + public void handleClientSettings(C15PacketClientSettings packetIn) + { + this.translator = packetIn.getLang(); + this.chatVisibility = packetIn.getChatVisibility(); + this.chatColours = packetIn.isColorsEnabled(); + this.getDataWatcher().updateObject(10, Byte.valueOf((byte)packetIn.getModelPartFlags())); + } + + public EntityPlayer.EnumChatVisibility getChatVisibility() + { + return this.chatVisibility; + } + + public void loadResourcePack(String url, String hash) + { + this.playerNetServerHandler.sendPacket(new S48PacketResourcePackSend(url, hash)); + } + + public BlockPos getPosition() + { + return new BlockPos(this.posX, this.posY + 0.5D, this.posZ); + } + + public void markPlayerActive() + { + this.playerLastActiveTime = MinecraftServer.getCurrentTimeMillis(); + } + + public StatisticsFile getStatFile() + { + return this.statsFile; + } + + public void removeEntity(Entity p_152339_1_) + { + if (p_152339_1_ instanceof EntityPlayer) + { + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(new int[] {p_152339_1_.getEntityId()})); + } + else + { + this.destroyedItemsNetCache.add(Integer.valueOf(p_152339_1_.getEntityId())); + } + } + + protected void updatePotionMetadata() + { + if (this.isSpectator()) + { + this.resetPotionEffectMetadata(); + this.setInvisible(true); + } + else + { + super.updatePotionMetadata(); + } + + this.getServerForPlayer().getEntityTracker().func_180245_a(this); + } + + public Entity getSpectatingEntity() + { + return (Entity)(this.spectatingEntity == null ? this : this.spectatingEntity); + } + + public void setSpectatingEntity(Entity entityToSpectate) + { + Entity entity = this.getSpectatingEntity(); + this.spectatingEntity = (Entity)(entityToSpectate == null ? this : entityToSpectate); + + if (entity != this.spectatingEntity) + { + this.playerNetServerHandler.sendPacket(new S43PacketCamera(this.spectatingEntity)); + this.setPositionAndUpdate(this.spectatingEntity.posX, this.spectatingEntity.posY, this.spectatingEntity.posZ); + } + } + + public void attackTargetEntityWithCurrentItem(Entity targetEntity) + { + if (this.theItemInWorldManager.getGameType() == WorldSettings.GameType.SPECTATOR) + { + this.setSpectatingEntity(targetEntity); + } + else + { + super.attackTargetEntityWithCurrentItem(targetEntity); + } + } + + public long getLastActiveTime() + { + return this.playerLastActiveTime; + } + + public IChatComponent getTabListDisplayName() + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/player/EnumPlayerModelParts.java b/Client-1.8.9/src/main/java/net/minecraft/entity/player/EnumPlayerModelParts.java new file mode 100644 index 0000000..f099c4d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/player/EnumPlayerModelParts.java @@ -0,0 +1,48 @@ +package net.minecraft.entity.player; + +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public enum EnumPlayerModelParts +{ + CAPE(0, "cape"), + JACKET(1, "jacket"), + LEFT_SLEEVE(2, "left_sleeve"), + RIGHT_SLEEVE(3, "right_sleeve"), + LEFT_PANTS_LEG(4, "left_pants_leg"), + RIGHT_PANTS_LEG(5, "right_pants_leg"), + HAT(6, "hat"); + + private final int partId; + private final int partMask; + private final String partName; + private final IChatComponent field_179339_k; + + private EnumPlayerModelParts(int partIdIn, String partNameIn) + { + this.partId = partIdIn; + this.partMask = 1 << partIdIn; + this.partName = partNameIn; + this.field_179339_k = new ChatComponentTranslation("options.modelPart." + partNameIn, new Object[0]); + } + + public int getPartMask() + { + return this.partMask; + } + + public int getPartId() + { + return this.partId; + } + + public String getPartName() + { + return this.partName; + } + + public IChatComponent func_179326_d() + { + return this.field_179339_k; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/player/InventoryPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/entity/player/InventoryPlayer.java new file mode 100644 index 0000000..254c459 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/player/InventoryPlayer.java @@ -0,0 +1,762 @@ +package net.minecraft.entity.player; + +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ReportedException; + +public class InventoryPlayer implements IInventory +{ + public ItemStack[] mainInventory = new ItemStack[36]; + public ItemStack[] armorInventory = new ItemStack[4]; + public int currentItem; + public EntityPlayer player; + private ItemStack itemStack; + public boolean inventoryChanged; + + public InventoryPlayer(EntityPlayer playerIn) + { + this.player = playerIn; + } + + public ItemStack getCurrentItem() + { + return this.currentItem < 9 && this.currentItem >= 0 ? this.mainInventory[this.currentItem] : null; + } + + public static int getHotbarSize() + { + return 9; + } + + private int getInventorySlotContainItem(Item itemIn) + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemIn) + { + return i; + } + } + + return -1; + } + + private int getInventorySlotContainItemAndDamage(Item itemIn, int metadataIn) + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemIn && this.mainInventory[i].getMetadata() == metadataIn) + { + return i; + } + } + + return -1; + } + + private int storeItemStack(ItemStack itemStackIn) + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemStackIn.getItem() && this.mainInventory[i].isStackable() && this.mainInventory[i].stackSize < this.mainInventory[i].getMaxStackSize() && this.mainInventory[i].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[i].getHasSubtypes() || this.mainInventory[i].getMetadata() == itemStackIn.getMetadata()) && ItemStack.areItemStackTagsEqual(this.mainInventory[i], itemStackIn)) + { + return i; + } + } + + return -1; + } + + public int getFirstEmptyStack() + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] == null) + { + return i; + } + } + + return -1; + } + + public void setCurrentItem(Item itemIn, int metadataIn, boolean isMetaSpecific, boolean p_146030_4_) + { + ItemStack itemstack = this.getCurrentItem(); + int i = isMetaSpecific ? this.getInventorySlotContainItemAndDamage(itemIn, metadataIn) : this.getInventorySlotContainItem(itemIn); + + if (i >= 0 && i < 9) + { + this.currentItem = i; + } + else if (p_146030_4_ && itemIn != null) + { + int j = this.getFirstEmptyStack(); + + if (j >= 0 && j < 9) + { + this.currentItem = j; + } + + if (itemstack == null || !itemstack.isItemEnchantable() || this.getInventorySlotContainItemAndDamage(itemstack.getItem(), itemstack.getItemDamage()) != this.currentItem) + { + int k = this.getInventorySlotContainItemAndDamage(itemIn, metadataIn); + int l; + + if (k >= 0) + { + l = this.mainInventory[k].stackSize; + this.mainInventory[k] = this.mainInventory[this.currentItem]; + } + else + { + l = 1; + } + + this.mainInventory[this.currentItem] = new ItemStack(itemIn, l, metadataIn); + } + } + } + + public void changeCurrentItem(int direction) + { + if (direction > 0) + { + direction = 1; + } + + if (direction < 0) + { + direction = -1; + } + + for (this.currentItem -= direction; this.currentItem < 0; this.currentItem += 9) + { + ; + } + + while (this.currentItem >= 9) + { + this.currentItem -= 9; + } + } + + public int clearMatchingItems(Item itemIn, int metadataIn, int removeCount, NBTTagCompound itemNBT) + { + int i = 0; + + for (int j = 0; j < this.mainInventory.length; ++j) + { + ItemStack itemstack = this.mainInventory[j]; + + if (itemstack != null && (itemIn == null || itemstack.getItem() == itemIn) && (metadataIn <= -1 || itemstack.getMetadata() == metadataIn) && (itemNBT == null || NBTUtil.func_181123_a(itemNBT, itemstack.getTagCompound(), true))) + { + int k = removeCount <= 0 ? itemstack.stackSize : Math.min(removeCount - i, itemstack.stackSize); + i += k; + + if (removeCount != 0) + { + this.mainInventory[j].stackSize -= k; + + if (this.mainInventory[j].stackSize == 0) + { + this.mainInventory[j] = null; + } + + if (removeCount > 0 && i >= removeCount) + { + return i; + } + } + } + } + + for (int l = 0; l < this.armorInventory.length; ++l) + { + ItemStack itemstack1 = this.armorInventory[l]; + + if (itemstack1 != null && (itemIn == null || itemstack1.getItem() == itemIn) && (metadataIn <= -1 || itemstack1.getMetadata() == metadataIn) && (itemNBT == null || NBTUtil.func_181123_a(itemNBT, itemstack1.getTagCompound(), false))) + { + int j1 = removeCount <= 0 ? itemstack1.stackSize : Math.min(removeCount - i, itemstack1.stackSize); + i += j1; + + if (removeCount != 0) + { + this.armorInventory[l].stackSize -= j1; + + if (this.armorInventory[l].stackSize == 0) + { + this.armorInventory[l] = null; + } + + if (removeCount > 0 && i >= removeCount) + { + return i; + } + } + } + } + + if (this.itemStack != null) + { + if (itemIn != null && this.itemStack.getItem() != itemIn) + { + return i; + } + + if (metadataIn > -1 && this.itemStack.getMetadata() != metadataIn) + { + return i; + } + + if (itemNBT != null && !NBTUtil.func_181123_a(itemNBT, this.itemStack.getTagCompound(), false)) + { + return i; + } + + int i1 = removeCount <= 0 ? this.itemStack.stackSize : Math.min(removeCount - i, this.itemStack.stackSize); + i += i1; + + if (removeCount != 0) + { + this.itemStack.stackSize -= i1; + + if (this.itemStack.stackSize == 0) + { + this.itemStack = null; + } + + if (removeCount > 0 && i >= removeCount) + { + return i; + } + } + } + + return i; + } + + private int storePartialItemStack(ItemStack itemStackIn) + { + Item item = itemStackIn.getItem(); + int i = itemStackIn.stackSize; + int j = this.storeItemStack(itemStackIn); + + if (j < 0) + { + j = this.getFirstEmptyStack(); + } + + if (j < 0) + { + return i; + } + else + { + if (this.mainInventory[j] == null) + { + this.mainInventory[j] = new ItemStack(item, 0, itemStackIn.getMetadata()); + + if (itemStackIn.hasTagCompound()) + { + this.mainInventory[j].setTagCompound((NBTTagCompound)itemStackIn.getTagCompound().copy()); + } + } + + int k = i; + + if (i > this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize) + { + k = this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize; + } + + if (k > this.getInventoryStackLimit() - this.mainInventory[j].stackSize) + { + k = this.getInventoryStackLimit() - this.mainInventory[j].stackSize; + } + + if (k == 0) + { + return i; + } + else + { + i = i - k; + this.mainInventory[j].stackSize += k; + this.mainInventory[j].animationsToGo = 5; + return i; + } + } + } + + public void decrementAnimations() + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null) + { + this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); + } + } + } + + public boolean consumeInventoryItem(Item itemIn) + { + int i = this.getInventorySlotContainItem(itemIn); + + if (i < 0) + { + return false; + } + else + { + if (--this.mainInventory[i].stackSize <= 0) + { + this.mainInventory[i] = null; + } + + return true; + } + } + + public boolean hasItem(Item itemIn) + { + int i = this.getInventorySlotContainItem(itemIn); + return i >= 0; + } + + public boolean addItemStackToInventory(final ItemStack itemStackIn) + { + if (itemStackIn != null && itemStackIn.stackSize != 0 && itemStackIn.getItem() != null) + { + try + { + if (itemStackIn.isItemDamaged()) + { + int j = this.getFirstEmptyStack(); + + if (j >= 0) + { + this.mainInventory[j] = ItemStack.copyItemStack(itemStackIn); + this.mainInventory[j].animationsToGo = 5; + itemStackIn.stackSize = 0; + return true; + } + else if (this.player.capabilities.isCreativeMode) + { + itemStackIn.stackSize = 0; + return true; + } + else + { + return false; + } + } + else + { + int i; + + while (true) + { + i = itemStackIn.stackSize; + itemStackIn.stackSize = this.storePartialItemStack(itemStackIn); + + if (itemStackIn.stackSize <= 0 || itemStackIn.stackSize >= i) + { + break; + } + } + + if (itemStackIn.stackSize == i && this.player.capabilities.isCreativeMode) + { + itemStackIn.stackSize = 0; + return true; + } + else + { + return itemStackIn.stackSize < i; + } + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding item to inventory"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being added"); + crashreportcategory.addCrashSection("Item ID", Integer.valueOf(Item.getIdFromItem(itemStackIn.getItem()))); + crashreportcategory.addCrashSection("Item data", Integer.valueOf(itemStackIn.getMetadata())); + crashreportcategory.addCrashSectionCallable("Item name", new Callable() + { + public String call() throws Exception + { + return itemStackIn.getDisplayName(); + } + }); + throw new ReportedException(crashreport); + } + } + else + { + return false; + } + } + + public ItemStack decrStackSize(int index, int count) + { + ItemStack[] aitemstack = this.mainInventory; + + if (index >= this.mainInventory.length) + { + aitemstack = this.armorInventory; + index -= this.mainInventory.length; + } + + if (aitemstack[index] != null) + { + if (aitemstack[index].stackSize <= count) + { + ItemStack itemstack1 = aitemstack[index]; + aitemstack[index] = null; + return itemstack1; + } + else + { + ItemStack itemstack = aitemstack[index].splitStack(count); + + if (aitemstack[index].stackSize == 0) + { + aitemstack[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + ItemStack[] aitemstack = this.mainInventory; + + if (index >= this.mainInventory.length) + { + aitemstack = this.armorInventory; + index -= this.mainInventory.length; + } + + if (aitemstack[index] != null) + { + ItemStack itemstack = aitemstack[index]; + aitemstack[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + ItemStack[] aitemstack = this.mainInventory; + + if (index >= aitemstack.length) + { + index -= aitemstack.length; + aitemstack = this.armorInventory; + } + + aitemstack[index] = stack; + } + + public float getStrVsBlock(Block blockIn) + { + float f = 1.0F; + + if (this.mainInventory[this.currentItem] != null) + { + f *= this.mainInventory[this.currentItem].getStrVsBlock(blockIn); + } + + return f; + } + + public NBTTagList writeToNBT(NBTTagList nbtTagListIn) + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.mainInventory[i].writeToNBT(nbttagcompound); + nbtTagListIn.appendTag(nbttagcompound); + } + } + + for (int j = 0; j < this.armorInventory.length; ++j) + { + if (this.armorInventory[j] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)(j + 100)); + this.armorInventory[j].writeToNBT(nbttagcompound1); + nbtTagListIn.appendTag(nbttagcompound1); + } + } + + return nbtTagListIn; + } + + public void readFromNBT(NBTTagList nbtTagListIn) + { + this.mainInventory = new ItemStack[36]; + this.armorInventory = new ItemStack[4]; + + for (int i = 0; i < nbtTagListIn.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbtTagListIn.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound); + + if (itemstack != null) + { + if (j >= 0 && j < this.mainInventory.length) + { + this.mainInventory[j] = itemstack; + } + + if (j >= 100 && j < this.armorInventory.length + 100) + { + this.armorInventory[j - 100] = itemstack; + } + } + } + } + + public int getSizeInventory() + { + return this.mainInventory.length + 4; + } + + public ItemStack getStackInSlot(int index) + { + ItemStack[] aitemstack = this.mainInventory; + + if (index >= aitemstack.length) + { + index -= aitemstack.length; + aitemstack = this.armorInventory; + } + + return aitemstack[index]; + } + + public String getName() + { + return "container.inventory"; + } + + public boolean hasCustomName() + { + return false; + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public int getInventoryStackLimit() + { + return 64; + } + + public boolean canHeldItemHarvest(Block blockIn) + { + if (blockIn.getMaterial().isToolNotRequired()) + { + return true; + } + else + { + ItemStack itemstack = this.getStackInSlot(this.currentItem); + return itemstack != null ? itemstack.canHarvestBlock(blockIn) : false; + } + } + + public ItemStack armorItemInSlot(int slotIn) + { + return this.armorInventory[slotIn]; + } + + public int getTotalArmorValue() + { + int i = 0; + + for (int j = 0; j < this.armorInventory.length; ++j) + { + if (this.armorInventory[j] != null && this.armorInventory[j].getItem() instanceof ItemArmor) + { + int k = ((ItemArmor)this.armorInventory[j].getItem()).damageReduceAmount; + i += k; + } + } + + return i; + } + + public void damageArmor(float damage) + { + damage = damage / 4.0F; + + if (damage < 1.0F) + { + damage = 1.0F; + } + + for (int i = 0; i < this.armorInventory.length; ++i) + { + if (this.armorInventory[i] != null && this.armorInventory[i].getItem() instanceof ItemArmor) + { + this.armorInventory[i].damageItem((int)damage, this.player); + + if (this.armorInventory[i].stackSize == 0) + { + this.armorInventory[i] = null; + } + } + } + } + + public void dropAllItems() + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null) + { + this.player.dropItem(this.mainInventory[i], true, false); + this.mainInventory[i] = null; + } + } + + for (int j = 0; j < this.armorInventory.length; ++j) + { + if (this.armorInventory[j] != null) + { + this.player.dropItem(this.armorInventory[j], true, false); + this.armorInventory[j] = null; + } + } + } + + public void markDirty() + { + this.inventoryChanged = true; + } + + public void setItemStack(ItemStack itemStackIn) + { + this.itemStack = itemStackIn; + } + + public ItemStack getItemStack() + { + return this.itemStack; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.player.isDead ? false : player.getDistanceSqToEntity(this.player) <= 64.0D; + } + + public boolean hasItemStack(ItemStack itemStackIn) + { + for (int i = 0; i < this.armorInventory.length; ++i) + { + if (this.armorInventory[i] != null && this.armorInventory[i].isItemEqual(itemStackIn)) + { + return true; + } + } + + for (int j = 0; j < this.mainInventory.length; ++j) + { + if (this.mainInventory[j] != null && this.mainInventory[j].isItemEqual(itemStackIn)) + { + return true; + } + } + + return false; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public void copyInventory(InventoryPlayer playerInventory) + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + this.mainInventory[i] = ItemStack.copyItemStack(playerInventory.mainInventory[i]); + } + + for (int j = 0; j < this.armorInventory.length; ++j) + { + this.armorInventory[j] = ItemStack.copyItemStack(playerInventory.armorInventory[j]); + } + + this.currentItem = playerInventory.currentItem; + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + this.mainInventory[i] = null; + } + + for (int j = 0; j < this.armorInventory.length; ++j) + { + this.armorInventory[j] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java b/Client-1.8.9/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java new file mode 100644 index 0000000..b91eb2a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java @@ -0,0 +1,70 @@ +package net.minecraft.entity.player; + +import net.minecraft.nbt.NBTTagCompound; + +public class PlayerCapabilities +{ + public boolean disableDamage; + public boolean isFlying; + public boolean allowFlying; + public boolean isCreativeMode; + public boolean allowEdit = true; + private float flySpeed = 0.05F; + private float walkSpeed = 0.1F; + + public void writeCapabilitiesToNBT(NBTTagCompound tagCompound) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setBoolean("invulnerable", this.disableDamage); + nbttagcompound.setBoolean("flying", this.isFlying); + nbttagcompound.setBoolean("mayfly", this.allowFlying); + nbttagcompound.setBoolean("instabuild", this.isCreativeMode); + nbttagcompound.setBoolean("mayBuild", this.allowEdit); + nbttagcompound.setFloat("flySpeed", this.flySpeed); + nbttagcompound.setFloat("walkSpeed", this.walkSpeed); + tagCompound.setTag("abilities", nbttagcompound); + } + + public void readCapabilitiesFromNBT(NBTTagCompound tagCompound) + { + if (tagCompound.hasKey("abilities", 10)) + { + NBTTagCompound nbttagcompound = tagCompound.getCompoundTag("abilities"); + this.disableDamage = nbttagcompound.getBoolean("invulnerable"); + this.isFlying = nbttagcompound.getBoolean("flying"); + this.allowFlying = nbttagcompound.getBoolean("mayfly"); + this.isCreativeMode = nbttagcompound.getBoolean("instabuild"); + + if (nbttagcompound.hasKey("flySpeed", 99)) + { + this.flySpeed = nbttagcompound.getFloat("flySpeed"); + this.walkSpeed = nbttagcompound.getFloat("walkSpeed"); + } + + if (nbttagcompound.hasKey("mayBuild", 1)) + { + this.allowEdit = nbttagcompound.getBoolean("mayBuild"); + } + } + } + + public float getFlySpeed() + { + return this.flySpeed; + } + + public void setFlySpeed(float speed) + { + this.flySpeed = speed; + } + + public float getWalkSpeed() + { + return this.walkSpeed; + } + + public void setPlayerWalkSpeed(float speed) + { + this.walkSpeed = speed; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityArrow.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityArrow.java new file mode 100644 index 0000000..0677446 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityArrow.java @@ -0,0 +1,555 @@ +package net.minecraft.entity.projectile; + +import lombok.Getter; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.util.*; +import net.minecraft.world.World; + +import java.util.List; + +public class EntityArrow extends Entity implements IProjectile +{ + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + private int inData; + @Getter private boolean inGround; + public int canBePickedUp; + public int arrowShake; + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + private int knockbackStrength; + + public EntityArrow(World worldIn) + { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityArrow(World worldIn, double x, double y, double z) + { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(x, y, z); + } + + public EntityArrow(World worldIn, EntityLivingBase shooter, EntityLivingBase target, float velocity, float innacuracy) + { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = shooter; + + if (shooter instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.posY = shooter.posY + (double)shooter.getEyeHeight() - 0.10000000149011612D; + double d0 = target.posX - shooter.posX; + double d1 = target.getEntityBoundingBox().minY + (double)(target.height / 3.0F) - this.posY; + double d2 = target.posZ - shooter.posZ; + double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if (d3 >= 1.0E-7D) + { + float f = (float)(MathHelper.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f1 = (float)(-(MathHelper.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(shooter.posX + d4, this.posY, shooter.posZ + d5, f, f1); + float f2 = (float)(d3 * 0.20000000298023224D); + this.setThrowableHeading(d0, d1 + (double)f2, d2, velocity, innacuracy); + } + } + + public EntityArrow(World worldIn, EntityLivingBase shooter, float velocity) + { + super(worldIn); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = shooter; + + if (shooter instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(shooter.posX, shooter.posY + (double)shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, velocity * 1.5F, 1.0F); + } + + protected void entityInit() + { + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) + { + float f = MathHelper.sqrt_double(x * x + y * y + z * z); + x = x / (double)f; + y = y / (double)f; + z = z / (double)f; + x = x + this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; + y = y + this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; + z = z + this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)inaccuracy; + x = x * (double)velocity; + y = y * (double)velocity; + z = z * (double)velocity; + this.motionX = x; + this.motionY = y; + this.motionZ = z; + float f1 = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f1) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) + { + this.setPosition(x, y, z); + this.setRotation(yaw, pitch); + } + + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * 180.0D / Math.PI); + } + + BlockPos blockpos = new BlockPos(this.xTile, this.yTile, this.zTile); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if (block.getMaterial() != Material.air) + { + block.setBlockBoundsBasedOnState(this.worldObj, blockpos); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBox(this.worldObj, blockpos, iblockstate); + + if (axisalignedbb != null && axisalignedbb.isVecInside(new Vec3(this.posX, this.posY, this.posZ))) + { + this.inGround = true; + } + } + + if (this.arrowShake > 0) + { + --this.arrowShake; + } + + if (this.inGround) + { + int j = block.getMetaFromState(iblockstate); + + if (block == this.inTile && j == this.inData) + { + ++this.ticksInGround; + + if (this.ticksInGround >= 1200) + { + this.setDead(); + } + } + else + { + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } + else + { + ++this.ticksInAir; + Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3, false, true, false); + vec31 = new Vec3(this.posX, this.posY, this.posZ); + vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) + { + float f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand((double)f1, (double)f1, (double)f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + + if (movingobjectposition1 != null) + { + double d1 = vec31.squareDistanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + + if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) + { + movingobjectposition = null; + } + } + + if (movingobjectposition != null) + { + if (movingobjectposition.entityHit != null) + { + float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int l = MathHelper.ceiling_double_int((double)f2 * this.damage); + + if (this.getIsCritical()) + { + l += this.rand.nextInt(l / 2 + 2); + } + + DamageSource damagesource; + + if (this.shootingEntity == null) + { + damagesource = DamageSource.causeArrowDamage(this, this); + } + else + { + damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity); + } + + if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) + { + movingobjectposition.entityHit.setFire(5); + } + + if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float)l)) + { + if (movingobjectposition.entityHit instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit; + + if (!this.worldObj.isRemote) + { + entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); + } + + if (this.knockbackStrength > 0) + { + float f7 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (f7 > 0.0F) + { + movingobjectposition.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f7, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f7); + } + } + + if (this.shootingEntity instanceof EntityLivingBase) + { + EnchantmentHelper.applyThornEnchantments(entitylivingbase, this.shootingEntity); + EnchantmentHelper.applyArthropodEnchantments((EntityLivingBase)this.shootingEntity, entitylivingbase); + } + + if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) + { + ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + } + } + + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + + if (!(movingobjectposition.entityHit instanceof EntityEnderman)) + { + this.setDead(); + } + } + else + { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } + else + { + BlockPos blockpos1 = movingobjectposition.getBlockPos(); + this.xTile = blockpos1.getX(); + this.yTile = blockpos1.getY(); + this.zTile = blockpos1.getZ(); + IBlockState iblockstate1 = this.worldObj.getBlockState(blockpos1); + this.inTile = iblockstate1.getBlock(); + this.inData = this.inTile.getMetaFromState(iblockstate1); + this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX)); + this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY)); + this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ)); + float f5 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / (double)f5 * 0.05000000074505806D; + this.posY -= this.motionY / (double)f5 * 0.05000000074505806D; + this.posZ -= this.motionZ / (double)f5 * 0.05000000074505806D; + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); + + if (this.inTile.getMaterial() != Material.air) + { + this.inTile.onEntityCollidedWithBlock(this.worldObj, blockpos1, iblockstate1, this); + } + } + } + + if (this.getIsCritical()) + { + for (int k = 0; k < 4; ++k) + { + this.worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX + this.motionX * (double)k / 4.0D, this.posY + this.motionY * (double)k / 4.0D, this.posZ + this.motionZ * (double)k / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ, new int[0]); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f3) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f4 = 0.99F; + float f6 = 0.05F; + + if (this.isInWater()) + { + for (int i1 = 0; i1 < 4; ++i1) + { + float f8 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f8, this.posY - this.motionY * (double)f8, this.posZ - this.motionZ * (double)f8, this.motionX, this.motionY, this.motionZ, new int[0]); + } + + f4 = 0.6F; + } + + if (this.isWet()) + { + this.extinguish(); + } + + this.motionX *= (double)f4; + this.motionY *= (double)f4; + this.motionZ *= (double)f4; + this.motionY -= (double)f6; + this.setPosition(this.posX, this.posY, this.posZ); + this.doBlockCollisions(); + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.xTile); + tagCompound.setShort("yTile", (short)this.yTile); + tagCompound.setShort("zTile", (short)this.zTile); + tagCompound.setShort("life", (short)this.ticksInGround); + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile); + tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + tagCompound.setByte("inData", (byte)this.inData); + tagCompound.setByte("shake", (byte)this.arrowShake); + tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + tagCompound.setByte("pickup", (byte)this.canBePickedUp); + tagCompound.setDouble("damage", this.damage); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.xTile = tagCompund.getShort("xTile"); + this.yTile = tagCompund.getShort("yTile"); + this.zTile = tagCompund.getShort("zTile"); + this.ticksInGround = tagCompund.getShort("life"); + + if (tagCompund.hasKey("inTile", 8)) + { + this.inTile = Block.getBlockFromName(tagCompund.getString("inTile")); + } + else + { + this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255); + } + + this.inData = tagCompund.getByte("inData") & 255; + this.arrowShake = tagCompund.getByte("shake") & 255; + this.inGround = tagCompund.getByte("inGround") == 1; + + if (tagCompund.hasKey("damage", 99)) + { + this.damage = tagCompund.getDouble("damage"); + } + + if (tagCompund.hasKey("pickup", 99)) + { + this.canBePickedUp = tagCompund.getByte("pickup"); + } + else if (tagCompund.hasKey("player", 99)) + { + this.canBePickedUp = tagCompund.getBoolean("player") ? 1 : 0; + } + } + + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) + { + boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && entityIn.capabilities.isCreativeMode; + + if (this.canBePickedUp == 1 && !entityIn.inventory.addItemStackToInventory(new ItemStack(Items.arrow, 1))) + { + flag = false; + } + + if (flag) + { + this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + entityIn.onItemPickup(this, 1); + this.setDead(); + } + } + } + + protected boolean canTriggerWalking() + { + return false; + } + + public void setDamage(double damageIn) + { + this.damage = damageIn; + } + + public double getDamage() + { + return this.damage; + } + + public void setKnockbackStrength(int knockbackStrengthIn) + { + this.knockbackStrength = knockbackStrengthIn; + } + + public boolean canAttackWithItem() + { + return false; + } + + public float getEyeHeight() + { + return 0.0F; + } + + public void setIsCritical(boolean critical) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (critical) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + public boolean getIsCritical() + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + return (b0 & 1) != 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityEgg.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityEgg.java new file mode 100644 index 0000000..829f56a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityEgg.java @@ -0,0 +1,66 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityEgg extends EntityThrowable +{ + public EntityEgg(World worldIn) + { + super(worldIn); + } + + public EntityEgg(World worldIn, EntityLivingBase throwerIn) + { + super(worldIn, throwerIn); + } + + public EntityEgg(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (p_70184_1_.entityHit != null) + { + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); + } + + if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0) + { + int i = 1; + + if (this.rand.nextInt(32) == 0) + { + i = 4; + } + + for (int j = 0; j < i; ++j) + { + EntityChicken entitychicken = new EntityChicken(this.worldObj); + entitychicken.setGrowingAge(-24000); + entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + this.worldObj.spawnEntityInWorld(entitychicken); + } + } + + double d0 = 0.08D; + + for (int k = 0; k < 8; ++k) + { + this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(Items.egg)}); + } + + if (!this.worldObj.isRemote) + { + this.setDead(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityFireball.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityFireball.java new file mode 100644 index 0000000..f907357 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityFireball.java @@ -0,0 +1,327 @@ +package net.minecraft.entity.projectile; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class EntityFireball extends Entity +{ + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + private boolean inGround; + public EntityLivingBase shootingEntity; + private int ticksAlive; + private int ticksInAir; + public double accelerationX; + public double accelerationY; + public double accelerationZ; + + public EntityFireball(World worldIn) + { + super(worldIn); + this.setSize(1.0F, 1.0F); + } + + protected void entityInit() + { + } + + public boolean isInRangeToRenderDist(double distance) + { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + + if (Double.isNaN(d0)) + { + d0 = 4.0D; + } + + d0 = d0 * 64.0D; + return distance < d0 * d0; + } + + public EntityFireball(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ) + { + super(worldIn); + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch); + this.setPosition(x, y, z); + double d0 = (double)MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ); + this.accelerationX = accelX / d0 * 0.1D; + this.accelerationY = accelY / d0 * 0.1D; + this.accelerationZ = accelZ / d0 * 0.1D; + } + + public EntityFireball(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) + { + super(worldIn); + this.shootingEntity = shooter; + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(shooter.posX, shooter.posY, shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionX = this.motionY = this.motionZ = 0.0D; + accelX = accelX + this.rand.nextGaussian() * 0.4D; + accelY = accelY + this.rand.nextGaussian() * 0.4D; + accelZ = accelZ + this.rand.nextGaussian() * 0.4D; + double d0 = (double)MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ); + this.accelerationX = accelX / d0 * 0.1D; + this.accelerationY = accelY / d0 * 0.1D; + this.accelerationZ = accelZ / d0 * 0.1D; + } + + public void onUpdate() + { + if (this.worldObj.isRemote || (this.shootingEntity == null || !this.shootingEntity.isDead) && this.worldObj.isBlockLoaded(new BlockPos(this))) + { + super.onUpdate(); + this.setFire(1); + + if (this.inGround) + { + if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile) + { + ++this.ticksAlive; + + if (this.ticksAlive == 600) + { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksAlive = 0; + this.ticksInAir = 0; + } + else + { + ++this.ticksInAir; + } + + Vec3 vec3 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = new Vec3(this.posX, this.posY, this.posZ); + vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) + { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double)f, (double)f, (double)f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + + if (movingobjectposition1 != null) + { + double d1 = vec3.squareDistanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null) + { + this.onImpact(movingobjectposition); + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; + + for (this.rotationPitch = (float)(MathHelper.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f2 = this.getMotionFactor(); + + if (this.isInWater()) + { + for (int j = 0; j < 4; ++j) + { + float f3 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ, new int[0]); + } + + f2 = 0.8F; + } + + this.motionX += this.accelerationX; + this.motionY += this.accelerationY; + this.motionZ += this.accelerationZ; + this.motionX *= (double)f2; + this.motionY *= (double)f2; + this.motionZ *= (double)f2; + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + this.setPosition(this.posX, this.posY, this.posZ); + } + else + { + this.setDead(); + } + } + + protected float getMotionFactor() + { + return 0.95F; + } + + protected abstract void onImpact(MovingObjectPosition movingObject); + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.xTile); + tagCompound.setShort("yTile", (short)this.yTile); + tagCompound.setShort("zTile", (short)this.zTile); + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile); + tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + tagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.xTile = tagCompund.getShort("xTile"); + this.yTile = tagCompund.getShort("yTile"); + this.zTile = tagCompund.getShort("zTile"); + + if (tagCompund.hasKey("inTile", 8)) + { + this.inTile = Block.getBlockFromName(tagCompund.getString("inTile")); + } + else + { + this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255); + } + + this.inGround = tagCompund.getByte("inGround") == 1; + + if (tagCompund.hasKey("direction", 9)) + { + NBTTagList nbttaglist = tagCompund.getTagList("direction", 6); + this.motionX = nbttaglist.getDoubleAt(0); + this.motionY = nbttaglist.getDoubleAt(1); + this.motionZ = nbttaglist.getDoubleAt(2); + } + else + { + this.setDead(); + } + } + + public boolean canBeCollidedWith() + { + return true; + } + + public float getCollisionBorderSize() + { + return 1.0F; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable(source)) + { + return false; + } + else + { + this.setBeenAttacked(); + + if (source.getEntity() != null) + { + Vec3 vec3 = source.getEntity().getLookVec(); + + if (vec3 != null) + { + this.motionX = vec3.xCoord; + this.motionY = vec3.yCoord; + this.motionZ = vec3.zCoord; + this.accelerationX = this.motionX * 0.1D; + this.accelerationY = this.motionY * 0.1D; + this.accelerationZ = this.motionZ * 0.1D; + } + + if (source.getEntity() instanceof EntityLivingBase) + { + this.shootingEntity = (EntityLivingBase)source.getEntity(); + } + + return true; + } + else + { + return false; + } + } + } + + public float getBrightness(float partialTicks) + { + return 1.0F; + } + + public int getBrightnessForRender(float partialTicks) + { + return 15728880; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java new file mode 100644 index 0000000..7e5921c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java @@ -0,0 +1,603 @@ +package net.minecraft.entity.projectile; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemFishFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomFishable; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class EntityFishHook extends Entity +{ + private static final List JUNK = Arrays.asList(new WeightedRandomFishable[] {(new WeightedRandomFishable(new ItemStack(Items.leather_boots), 10)).setMaxDamagePercent(0.9F), new WeightedRandomFishable(new ItemStack(Items.leather), 10), new WeightedRandomFishable(new ItemStack(Items.bone), 10), new WeightedRandomFishable(new ItemStack(Items.potionitem), 10), new WeightedRandomFishable(new ItemStack(Items.string), 5), (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 2)).setMaxDamagePercent(0.9F), new WeightedRandomFishable(new ItemStack(Items.bowl), 10), new WeightedRandomFishable(new ItemStack(Items.stick), 5), new WeightedRandomFishable(new ItemStack(Items.dye, 10, EnumDyeColor.BLACK.getDyeDamage()), 1), new WeightedRandomFishable(new ItemStack(Blocks.tripwire_hook), 10), new WeightedRandomFishable(new ItemStack(Items.rotten_flesh), 10)}); + private static final List TREASURE = Arrays.asList(new WeightedRandomFishable[] {new WeightedRandomFishable(new ItemStack(Blocks.waterlily), 1), new WeightedRandomFishable(new ItemStack(Items.name_tag), 1), new WeightedRandomFishable(new ItemStack(Items.saddle), 1), (new WeightedRandomFishable(new ItemStack(Items.bow), 1)).setMaxDamagePercent(0.25F).setEnchantable(), (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 1)).setMaxDamagePercent(0.25F).setEnchantable(), (new WeightedRandomFishable(new ItemStack(Items.book), 1)).setEnchantable()}); + private static final List FISH = Arrays.asList(new WeightedRandomFishable[] {new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.getMetadata()), 60), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.SALMON.getMetadata()), 25), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.CLOWNFISH.getMetadata()), 2), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.PUFFERFISH.getMetadata()), 13)}); + private int xTile; + private int yTile; + private int zTile; + private Block inTile; + private boolean inGround; + public int shake; + public EntityPlayer angler; + private int ticksInGround; + private int ticksInAir; + private int ticksCatchable; + private int ticksCaughtDelay; + private int ticksCatchableDelay; + private float fishApproachAngle; + public Entity caughtEntity; + private int fishPosRotationIncrements; + private double fishX; + private double fishY; + private double fishZ; + private double fishYaw; + private double fishPitch; + private double clientMotionX; + private double clientMotionY; + private double clientMotionZ; + + public static List func_174855_j() + { + return FISH; + } + + public EntityFishHook(World worldIn) + { + super(worldIn); + this.xTile = -1; + this.yTile = -1; + this.zTile = -1; + this.setSize(0.25F, 0.25F); + this.ignoreFrustumCheck = true; + } + + public EntityFishHook(World worldIn, double x, double y, double z, EntityPlayer anglerIn) + { + this(worldIn); + this.setPosition(x, y, z); + this.ignoreFrustumCheck = true; + this.angler = anglerIn; + anglerIn.fishEntity = this; + } + + public EntityFishHook(World worldIn, EntityPlayer fishingPlayer) + { + super(worldIn); + this.xTile = -1; + this.yTile = -1; + this.zTile = -1; + this.ignoreFrustumCheck = true; + this.angler = fishingPlayer; + this.angler.fishEntity = this; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(fishingPlayer.posX, fishingPlayer.posY + (double)fishingPlayer.getEyeHeight(), fishingPlayer.posZ, fishingPlayer.rotationYaw, fishingPlayer.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + float f = 0.4F; + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.handleHookCasting(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F); + } + + protected void entityInit() + { + } + + public boolean isInRangeToRenderDist(double distance) + { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + + if (Double.isNaN(d0)) + { + d0 = 4.0D; + } + + d0 = d0 * 64.0D; + return distance < d0 * d0; + } + + public void handleHookCasting(double p_146035_1_, double p_146035_3_, double p_146035_5_, float p_146035_7_, float p_146035_8_) + { + float f = MathHelper.sqrt_double(p_146035_1_ * p_146035_1_ + p_146035_3_ * p_146035_3_ + p_146035_5_ * p_146035_5_); + p_146035_1_ = p_146035_1_ / (double)f; + p_146035_3_ = p_146035_3_ / (double)f; + p_146035_5_ = p_146035_5_ / (double)f; + p_146035_1_ = p_146035_1_ + this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_3_ = p_146035_3_ + this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_5_ = p_146035_5_ + this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_1_ = p_146035_1_ * (double)p_146035_7_; + p_146035_3_ = p_146035_3_ * (double)p_146035_7_; + p_146035_5_ = p_146035_5_ * (double)p_146035_7_; + this.motionX = p_146035_1_; + this.motionY = p_146035_3_; + this.motionZ = p_146035_5_; + float f1 = MathHelper.sqrt_double(p_146035_1_ * p_146035_1_ + p_146035_5_ * p_146035_5_); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(p_146035_1_, p_146035_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(p_146035_3_, (double)f1) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_) + { + this.fishX = x; + this.fishY = y; + this.fishZ = z; + this.fishYaw = (double)yaw; + this.fishPitch = (double)pitch; + this.fishPosRotationIncrements = posRotationIncrements; + this.motionX = this.clientMotionX; + this.motionY = this.clientMotionY; + this.motionZ = this.clientMotionZ; + } + + public void setVelocity(double x, double y, double z) + { + this.clientMotionX = this.motionX = x; + this.clientMotionY = this.motionY = y; + this.clientMotionZ = this.motionZ = z; + } + + public void onUpdate() + { + super.onUpdate(); + + if (this.fishPosRotationIncrements > 0) + { + double d7 = this.posX + (this.fishX - this.posX) / (double)this.fishPosRotationIncrements; + double d8 = this.posY + (this.fishY - this.posY) / (double)this.fishPosRotationIncrements; + double d9 = this.posZ + (this.fishZ - this.posZ) / (double)this.fishPosRotationIncrements; + double d1 = MathHelper.wrapAngleTo180_double(this.fishYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d1 / (double)this.fishPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.fishPitch - (double)this.rotationPitch) / (double)this.fishPosRotationIncrements); + --this.fishPosRotationIncrements; + this.setPosition(d7, d8, d9); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else + { + if (!this.worldObj.isRemote) + { + ItemStack itemstack = this.angler.getCurrentEquippedItem(); + + if (this.angler.isDead || !this.angler.isEntityAlive() || itemstack == null || itemstack.getItem() != Items.fishing_rod || this.getDistanceSqToEntity(this.angler) > 1024.0D) + { + this.setDead(); + this.angler.fishEntity = null; + return; + } + + if (this.caughtEntity != null) + { + if (!this.caughtEntity.isDead) + { + this.posX = this.caughtEntity.posX; + double d17 = (double)this.caughtEntity.height; + this.posY = this.caughtEntity.getEntityBoundingBox().minY + d17 * 0.8D; + this.posZ = this.caughtEntity.posZ; + return; + } + + this.caughtEntity = null; + } + } + + if (this.shake > 0) + { + --this.shake; + } + + if (this.inGround) + { + if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile) + { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) + { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + else + { + ++this.ticksInAir; + } + + Vec3 vec31 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3); + vec31 = new Vec3(this.posX, this.posY, this.posZ); + vec3 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec3 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (entity1 != this.angler || this.ticksInAir >= 5)) + { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double)f, (double)f, (double)f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec31, vec3); + + if (movingobjectposition1 != null) + { + double d2 = vec31.squareDistanceTo(movingobjectposition1.hitVec); + + if (d2 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d2; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null) + { + if (movingobjectposition.entityHit != null) + { + if (movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.angler), 0.0F)) + { + this.caughtEntity = movingobjectposition.entityHit; + } + } + else + { + this.inGround = true; + } + } + + if (!this.inGround) + { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f5 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f5) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f6 = 0.92F; + + if (this.onGround || this.isCollidedHorizontally) + { + f6 = 0.5F; + } + + int j = 5; + double d10 = 0.0D; + + for (int k = 0; k < j; ++k) + { + AxisAlignedBB axisalignedbb1 = this.getEntityBoundingBox(); + double d3 = axisalignedbb1.maxY - axisalignedbb1.minY; + double d4 = axisalignedbb1.minY + d3 * (double)k / (double)j; + double d5 = axisalignedbb1.minY + d3 * (double)(k + 1) / (double)j; + AxisAlignedBB axisalignedbb2 = new AxisAlignedBB(axisalignedbb1.minX, d4, axisalignedbb1.minZ, axisalignedbb1.maxX, d5, axisalignedbb1.maxZ); + + if (this.worldObj.isAABBInMaterial(axisalignedbb2, Material.water)) + { + d10 += 1.0D / (double)j; + } + } + + if (!this.worldObj.isRemote && d10 > 0.0D) + { + WorldServer worldserver = (WorldServer)this.worldObj; + int l = 1; + BlockPos blockpos = (new BlockPos(this)).up(); + + if (this.rand.nextFloat() < 0.25F && this.worldObj.isRainingAt(blockpos)) + { + l = 2; + } + + if (this.rand.nextFloat() < 0.5F && !this.worldObj.canSeeSky(blockpos)) + { + --l; + } + + if (this.ticksCatchable > 0) + { + --this.ticksCatchable; + + if (this.ticksCatchable <= 0) + { + this.ticksCaughtDelay = 0; + this.ticksCatchableDelay = 0; + } + } + else if (this.ticksCatchableDelay > 0) + { + this.ticksCatchableDelay -= l; + + if (this.ticksCatchableDelay <= 0) + { + this.motionY -= 0.20000000298023224D; + this.playSound("random.splash", 0.25F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float f8 = (float)MathHelper.floor_double(this.getEntityBoundingBox().minY); + worldserver.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D, new int[0]); + worldserver.spawnParticle(EnumParticleTypes.WATER_WAKE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D, new int[0]); + this.ticksCatchable = MathHelper.getRandomIntegerInRange(this.rand, 10, 30); + } + else + { + this.fishApproachAngle = (float)((double)this.fishApproachAngle + this.rand.nextGaussian() * 4.0D); + float f7 = this.fishApproachAngle * 0.017453292F; + float f10 = MathHelper.sin(f7); + float f11 = MathHelper.cos(f7); + double d13 = this.posX + (double)(f10 * (float)this.ticksCatchableDelay * 0.1F); + double d15 = (double)((float)MathHelper.floor_double(this.getEntityBoundingBox().minY) + 1.0F); + double d16 = this.posZ + (double)(f11 * (float)this.ticksCatchableDelay * 0.1F); + Block block1 = worldserver.getBlockState(new BlockPos((int)d13, (int)d15 - 1, (int)d16)).getBlock(); + + if (block1 == Blocks.water || block1 == Blocks.flowing_water) + { + if (this.rand.nextFloat() < 0.15F) + { + worldserver.spawnParticle(EnumParticleTypes.WATER_BUBBLE, d13, d15 - 0.10000000149011612D, d16, 1, (double)f10, 0.1D, (double)f11, 0.0D, new int[0]); + } + + float f3 = f10 * 0.04F; + float f4 = f11 * 0.04F; + worldserver.spawnParticle(EnumParticleTypes.WATER_WAKE, d13, d15, d16, 0, (double)f4, 0.01D, (double)(-f3), 1.0D, new int[0]); + worldserver.spawnParticle(EnumParticleTypes.WATER_WAKE, d13, d15, d16, 0, (double)(-f4), 0.01D, (double)f3, 1.0D, new int[0]); + } + } + } + else if (this.ticksCaughtDelay > 0) + { + this.ticksCaughtDelay -= l; + float f1 = 0.15F; + + if (this.ticksCaughtDelay < 20) + { + f1 = (float)((double)f1 + (double)(20 - this.ticksCaughtDelay) * 0.05D); + } + else if (this.ticksCaughtDelay < 40) + { + f1 = (float)((double)f1 + (double)(40 - this.ticksCaughtDelay) * 0.02D); + } + else if (this.ticksCaughtDelay < 60) + { + f1 = (float)((double)f1 + (double)(60 - this.ticksCaughtDelay) * 0.01D); + } + + if (this.rand.nextFloat() < f1) + { + float f9 = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F) * 0.017453292F; + float f2 = MathHelper.randomFloatClamp(this.rand, 25.0F, 60.0F); + double d12 = this.posX + (double)(MathHelper.sin(f9) * f2 * 0.1F); + double d14 = (double)((float)MathHelper.floor_double(this.getEntityBoundingBox().minY) + 1.0F); + double d6 = this.posZ + (double)(MathHelper.cos(f9) * f2 * 0.1F); + Block block = worldserver.getBlockState(new BlockPos((int)d12, (int)d14 - 1, (int)d6)).getBlock(); + + if (block == Blocks.water || block == Blocks.flowing_water) + { + worldserver.spawnParticle(EnumParticleTypes.WATER_SPLASH, d12, d14, d6, 2 + this.rand.nextInt(2), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D, new int[0]); + } + } + + if (this.ticksCaughtDelay <= 0) + { + this.fishApproachAngle = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F); + this.ticksCatchableDelay = MathHelper.getRandomIntegerInRange(this.rand, 20, 80); + } + } + else + { + this.ticksCaughtDelay = MathHelper.getRandomIntegerInRange(this.rand, 100, 900); + this.ticksCaughtDelay -= EnchantmentHelper.getLureModifier(this.angler) * 20 * 5; + } + + if (this.ticksCatchable > 0) + { + this.motionY -= (double)(this.rand.nextFloat() * this.rand.nextFloat() * this.rand.nextFloat()) * 0.2D; + } + } + + double d11 = d10 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * d11; + + if (d10 > 0.0D) + { + f6 = (float)((double)f6 * 0.9D); + this.motionY *= 0.8D; + } + + this.motionX *= (double)f6; + this.motionY *= (double)f6; + this.motionZ *= (double)f6; + this.setPosition(this.posX, this.posY, this.posZ); + } + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.xTile); + tagCompound.setShort("yTile", (short)this.yTile); + tagCompound.setShort("zTile", (short)this.zTile); + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile); + tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + tagCompound.setByte("shake", (byte)this.shake); + tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.xTile = tagCompund.getShort("xTile"); + this.yTile = tagCompund.getShort("yTile"); + this.zTile = tagCompund.getShort("zTile"); + + if (tagCompund.hasKey("inTile", 8)) + { + this.inTile = Block.getBlockFromName(tagCompund.getString("inTile")); + } + else + { + this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255); + } + + this.shake = tagCompund.getByte("shake") & 255; + this.inGround = tagCompund.getByte("inGround") == 1; + } + + public int handleHookRetraction() + { + if (this.worldObj.isRemote) + { + return 0; + } + else + { + int i = 0; + + if (this.caughtEntity != null) + { + double d0 = this.angler.posX - this.posX; + double d2 = this.angler.posY - this.posY; + double d4 = this.angler.posZ - this.posZ; + double d6 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2 + d4 * d4); + double d8 = 0.1D; + this.caughtEntity.motionX += d0 * d8; + this.caughtEntity.motionY += d2 * d8 + (double)MathHelper.sqrt_double(d6) * 0.08D; + this.caughtEntity.motionZ += d4 * d8; + i = 3; + } + else if (this.ticksCatchable > 0) + { + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, this.getFishingResult()); + double d1 = this.angler.posX - this.posX; + double d3 = this.angler.posY - this.posY; + double d5 = this.angler.posZ - this.posZ; + double d7 = (double)MathHelper.sqrt_double(d1 * d1 + d3 * d3 + d5 * d5); + double d9 = 0.1D; + entityitem.motionX = d1 * d9; + entityitem.motionY = d3 * d9 + (double)MathHelper.sqrt_double(d7) * 0.08D; + entityitem.motionZ = d5 * d9; + this.worldObj.spawnEntityInWorld(entityitem); + this.angler.worldObj.spawnEntityInWorld(new EntityXPOrb(this.angler.worldObj, this.angler.posX, this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.rand.nextInt(6) + 1)); + i = 1; + } + + if (this.inGround) + { + i = 2; + } + + this.setDead(); + this.angler.fishEntity = null; + return i; + } + } + + private ItemStack getFishingResult() + { + float f = this.worldObj.rand.nextFloat(); + int i = EnchantmentHelper.getLuckOfSeaModifier(this.angler); + int j = EnchantmentHelper.getLureModifier(this.angler); + float f1 = 0.1F - (float)i * 0.025F - (float)j * 0.01F; + float f2 = 0.05F + (float)i * 0.01F - (float)j * 0.01F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f2 = MathHelper.clamp_float(f2, 0.0F, 1.0F); + + if (f < f1) + { + this.angler.triggerAchievement(StatList.junkFishedStat); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, JUNK)).getItemStack(this.rand); + } + else + { + f = f - f1; + + if (f < f2) + { + this.angler.triggerAchievement(StatList.treasureFishedStat); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, TREASURE)).getItemStack(this.rand); + } + else + { + float f3 = f - f2; + this.angler.triggerAchievement(StatList.fishCaughtStat); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, FISH)).getItemStack(this.rand); + } + } + } + + public void setDead() + { + super.setDead(); + + if (this.angler != null) + { + this.angler.fishEntity = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java new file mode 100644 index 0000000..83b205d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java @@ -0,0 +1,60 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityLargeFireball extends EntityFireball +{ + public int explosionPower = 1; + + public EntityLargeFireball(World worldIn) + { + super(worldIn); + } + + public EntityLargeFireball(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ) + { + super(worldIn, x, y, z, accelX, accelY, accelZ); + } + + public EntityLargeFireball(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) + { + super(worldIn, shooter, accelX, accelY, accelZ); + } + + protected void onImpact(MovingObjectPosition movingObject) + { + if (!this.worldObj.isRemote) + { + if (movingObject.entityHit != null) + { + movingObject.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); + this.applyEnchantments(this.shootingEntity, movingObject.entityHit); + } + + boolean flag = this.worldObj.getGameRules().getBoolean("mobGriefing"); + this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.explosionPower, flag, flag); + this.setDead(); + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("ExplosionPower", this.explosionPower); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("ExplosionPower", 99)) + { + this.explosionPower = tagCompund.getInteger("ExplosionPower"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityPotion.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityPotion.java new file mode 100644 index 0000000..1c019b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityPotion.java @@ -0,0 +1,163 @@ +package net.minecraft.entity.projectile; + +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityPotion extends EntityThrowable +{ + private ItemStack potionDamage; + + public EntityPotion(World worldIn) + { + super(worldIn); + } + + public EntityPotion(World worldIn, EntityLivingBase throwerIn, int meta) + { + this(worldIn, throwerIn, new ItemStack(Items.potionitem, 1, meta)); + } + + public EntityPotion(World worldIn, EntityLivingBase throwerIn, ItemStack potionDamageIn) + { + super(worldIn, throwerIn); + this.potionDamage = potionDamageIn; + } + + public EntityPotion(World worldIn, double x, double y, double z, int p_i1791_8_) + { + this(worldIn, x, y, z, new ItemStack(Items.potionitem, 1, p_i1791_8_)); + } + + public EntityPotion(World worldIn, double x, double y, double z, ItemStack potionDamageIn) + { + super(worldIn, x, y, z); + this.potionDamage = potionDamageIn; + } + + protected float getGravityVelocity() + { + return 0.05F; + } + + protected float getVelocity() + { + return 0.5F; + } + + protected float getInaccuracy() + { + return -20.0F; + } + + public void setPotionDamage(int potionId) + { + if (this.potionDamage == null) + { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + this.potionDamage.setItemDamage(potionId); + } + + public int getPotionDamage() + { + if (this.potionDamage == null) + { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + return this.potionDamage.getMetadata(); + } + + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (!this.worldObj.isRemote) + { + List list = Items.potionitem.getEffects(this.potionDamage); + + if (list != null && !list.isEmpty()) + { + AxisAlignedBB axisalignedbb = this.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + + if (!list1.isEmpty()) + { + for (EntityLivingBase entitylivingbase : list1) + { + double d0 = this.getDistanceSqToEntity(entitylivingbase); + + if (d0 < 16.0D) + { + double d1 = 1.0D - Math.sqrt(d0) / 4.0D; + + if (entitylivingbase == p_70184_1_.entityHit) + { + d1 = 1.0D; + } + + for (PotionEffect potioneffect : list) + { + int i = potioneffect.getPotionID(); + + if (Potion.potionTypes[i].isInstant()) + { + Potion.potionTypes[i].affectEntity(this, this.getThrower(), entitylivingbase, potioneffect.getAmplifier(), d1); + } + else + { + int j = (int)(d1 * (double)potioneffect.getDuration() + 0.5D); + + if (j > 20) + { + entitylivingbase.addPotionEffect(new PotionEffect(i, j, potioneffect.getAmplifier())); + } + } + } + } + } + } + } + + this.worldObj.playAuxSFX(2002, new BlockPos(this), this.getPotionDamage()); + this.setDead(); + } + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("Potion", 10)) + { + this.potionDamage = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("Potion")); + } + else + { + this.setPotionDamage(tagCompund.getInteger("potionValue")); + } + + if (this.potionDamage == null) + { + this.setDead(); + } + } + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.potionDamage != null) + { + tagCompound.setTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java new file mode 100644 index 0000000..b4e2494 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java @@ -0,0 +1,82 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntitySmallFireball extends EntityFireball +{ + public EntitySmallFireball(World worldIn) + { + super(worldIn); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) + { + super(worldIn, shooter, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ) + { + super(worldIn, x, y, z, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + protected void onImpact(MovingObjectPosition movingObject) + { + if (!this.worldObj.isRemote) + { + if (movingObject.entityHit != null) + { + boolean flag = movingObject.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F); + + if (flag) + { + this.applyEnchantments(this.shootingEntity, movingObject.entityHit); + + if (!movingObject.entityHit.isImmuneToFire()) + { + movingObject.entityHit.setFire(5); + } + } + } + else + { + boolean flag1 = true; + + if (this.shootingEntity != null && this.shootingEntity instanceof EntityLiving) + { + flag1 = this.worldObj.getGameRules().getBoolean("mobGriefing"); + } + + if (flag1) + { + BlockPos blockpos = movingObject.getBlockPos().offset(movingObject.sideHit); + + if (this.worldObj.isAirBlock(blockpos)) + { + this.worldObj.setBlockState(blockpos, Blocks.fire.getDefaultState()); + } + } + } + + this.setDead(); + } + } + + public boolean canBeCollidedWith() + { + return false; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java new file mode 100644 index 0000000..122c631 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java @@ -0,0 +1,51 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntitySnowball extends EntityThrowable +{ + public EntitySnowball(World worldIn) + { + super(worldIn); + } + + public EntitySnowball(World worldIn, EntityLivingBase throwerIn) + { + super(worldIn, throwerIn); + } + + public EntitySnowball(World worldIn, double x, double y, double z) + { + super(worldIn, x, y, z); + } + + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (p_70184_1_.entityHit != null) + { + int i = 0; + + if (p_70184_1_.entityHit instanceof EntityBlaze) + { + i = 3; + } + + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)i); + } + + for (int j = 0; j < 8; ++j) + { + this.worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + } + + if (!this.worldObj.isRemote) + { + this.setDead(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java new file mode 100644 index 0000000..a377616 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java @@ -0,0 +1,353 @@ +package net.minecraft.entity.projectile; + +import java.util.List; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public abstract class EntityThrowable extends Entity implements IProjectile +{ + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + protected boolean inGround; + public int throwableShake; + private EntityLivingBase thrower; + private String throwerName; + private int ticksInGround; + private int ticksInAir; + + public EntityThrowable(World worldIn) + { + super(worldIn); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() + { + } + + public boolean isInRangeToRenderDist(double distance) + { + double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; + + if (Double.isNaN(d0)) + { + d0 = 4.0D; + } + + d0 = d0 * 64.0D; + return distance < d0 * d0; + } + + public EntityThrowable(World worldIn, EntityLivingBase throwerIn) + { + super(worldIn); + this.thrower = throwerIn; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(throwerIn.posX, throwerIn.posY + (double)throwerIn.getEyeHeight(), throwerIn.posZ, throwerIn.rotationYaw, throwerIn.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + float f = 0.4F; + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionY = (double)(-MathHelper.sin((this.rotationPitch + this.getInaccuracy()) / 180.0F * (float)Math.PI) * f); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.getVelocity(), 1.0F); + } + + public EntityThrowable(World worldIn, double x, double y, double z) + { + super(worldIn); + this.ticksInGround = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(x, y, z); + } + + protected float getVelocity() + { + return 1.5F; + } + + protected float getInaccuracy() + { + return 0.0F; + } + + public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) + { + float f = MathHelper.sqrt_double(x * x + y * y + z * z); + x = x / (double)f; + y = y / (double)f; + z = z / (double)f; + x = x + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy; + y = y + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy; + z = z + this.rand.nextGaussian() * 0.007499999832361937D * (double)inaccuracy; + x = x * (double)velocity; + y = y * (double)velocity; + z = z * (double)velocity; + this.motionX = x; + this.motionY = y; + this.motionZ = z; + float f1 = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f1) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(MathHelper.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * 180.0D / Math.PI); + } + } + + public void onUpdate() + { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + + if (this.throwableShake > 0) + { + --this.throwableShake; + } + + if (this.inGround) + { + if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile) + { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) + { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + else + { + ++this.ticksInAir; + } + + Vec3 vec3 = new Vec3(this.posX, this.posY, this.posZ); + Vec3 vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = new Vec3(this.posX, this.posY, this.posZ); + vec31 = new Vec3(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec31 = new Vec3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + if (!this.worldObj.isRemote) + { + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + EntityLivingBase entitylivingbase = this.getThrower(); + + for (int j = 0; j < list.size(); ++j) + { + Entity entity1 = (Entity)list.get(j); + + if (entity1.canBeCollidedWith() && (entity1 != entitylivingbase || this.ticksInAir >= 5)) + { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand((double)f, (double)f, (double)f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + + if (movingobjectposition1 != null) + { + double d1 = vec3.squareDistanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + } + + if (movingobjectposition != null) + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.worldObj.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.portal) + { + this.setPortal(movingobjectposition.getBlockPos()); + } + else + { + this.onImpact(movingobjectposition); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f2 = 0.99F; + float f3 = this.getGravityVelocity(); + + if (this.isInWater()) + { + for (int i = 0; i < 4; ++i) + { + float f4 = 0.25F; + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ, new int[0]); + } + + f2 = 0.8F; + } + + this.motionX *= (double)f2; + this.motionY *= (double)f2; + this.motionZ *= (double)f2; + this.motionY -= (double)f3; + this.setPosition(this.posX, this.posY, this.posZ); + } + + protected float getGravityVelocity() + { + return 0.03F; + } + + protected abstract void onImpact(MovingObjectPosition p_70184_1_); + + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.xTile); + tagCompound.setShort("yTile", (short)this.yTile); + tagCompound.setShort("zTile", (short)this.zTile); + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.inTile); + tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString()); + tagCompound.setByte("shake", (byte)this.throwableShake); + tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + + if ((this.throwerName == null || this.throwerName.length() == 0) && this.thrower instanceof EntityPlayer) + { + this.throwerName = this.thrower.getName(); + } + + tagCompound.setString("ownerName", this.throwerName == null ? "" : this.throwerName); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.xTile = tagCompund.getShort("xTile"); + this.yTile = tagCompund.getShort("yTile"); + this.zTile = tagCompund.getShort("zTile"); + + if (tagCompund.hasKey("inTile", 8)) + { + this.inTile = Block.getBlockFromName(tagCompund.getString("inTile")); + } + else + { + this.inTile = Block.getBlockById(tagCompund.getByte("inTile") & 255); + } + + this.throwableShake = tagCompund.getByte("shake") & 255; + this.inGround = tagCompund.getByte("inGround") == 1; + this.thrower = null; + this.throwerName = tagCompund.getString("ownerName"); + + if (this.throwerName != null && this.throwerName.length() == 0) + { + this.throwerName = null; + } + + this.thrower = this.getThrower(); + } + + public EntityLivingBase getThrower() + { + if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0) + { + this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName); + + if (this.thrower == null && this.worldObj instanceof WorldServer) + { + try + { + Entity entity = ((WorldServer)this.worldObj).getEntityFromUuid(UUID.fromString(this.throwerName)); + + if (entity instanceof EntityLivingBase) + { + this.thrower = (EntityLivingBase)entity; + } + } + catch (Throwable var2) + { + this.thrower = null; + } + } + } + + return this.thrower; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java new file mode 100644 index 0000000..a2eee5b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java @@ -0,0 +1,133 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityWitherSkull extends EntityFireball +{ + public EntityWitherSkull(World worldIn) + { + super(worldIn); + this.setSize(0.3125F, 0.3125F); + } + + public EntityWitherSkull(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ) + { + super(worldIn, shooter, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + protected float getMotionFactor() + { + return this.isInvulnerable() ? 0.73F : super.getMotionFactor(); + } + + public EntityWitherSkull(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ) + { + super(worldIn, x, y, z, accelX, accelY, accelZ); + this.setSize(0.3125F, 0.3125F); + } + + public boolean isBurning() + { + return false; + } + + public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) + { + float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); + Block block = blockStateIn.getBlock(); + + if (this.isInvulnerable() && EntityWither.canDestroyBlock(block)) + { + f = Math.min(0.8F, f); + } + + return f; + } + + protected void onImpact(MovingObjectPosition movingObject) + { + if (!this.worldObj.isRemote) + { + if (movingObject.entityHit != null) + { + if (this.shootingEntity != null) + { + if (movingObject.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F)) + { + if (!movingObject.entityHit.isEntityAlive()) + { + this.shootingEntity.heal(5.0F); + } + else + { + this.applyEnchantments(this.shootingEntity, movingObject.entityHit); + } + } + } + else + { + movingObject.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); + } + + if (movingObject.entityHit instanceof EntityLivingBase) + { + int i = 0; + + if (this.worldObj.getDifficulty() == EnumDifficulty.NORMAL) + { + i = 10; + } + else if (this.worldObj.getDifficulty() == EnumDifficulty.HARD) + { + i = 40; + } + + if (i > 0) + { + ((EntityLivingBase)movingObject.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * i, 1)); + } + } + } + + this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, this.worldObj.getGameRules().getBoolean("mobGriefing")); + this.setDead(); + } + } + + public boolean canBeCollidedWith() + { + return false; + } + + public boolean attackEntityFrom(DamageSource source, float amount) + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(10, Byte.valueOf((byte)0)); + } + + public boolean isInvulnerable() + { + return this.dataWatcher.getWatchableObjectByte(10) == 1; + } + + public void setInvulnerable(boolean invulnerable) + { + this.dataWatcher.updateObject(10, Byte.valueOf((byte)(invulnerable ? 1 : 0))); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/event/ClickEvent.java b/Client-1.8.9/src/main/java/net/minecraft/event/ClickEvent.java new file mode 100644 index 0000000..ee0c177 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/event/ClickEvent.java @@ -0,0 +1,119 @@ +package net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; + +public class ClickEvent +{ + private final ClickEvent.Action action; + private final String value; + + public ClickEvent(ClickEvent.Action theAction, String theValue) + { + this.action = theAction; + this.value = theValue; + } + + public ClickEvent.Action getAction() + { + return this.action; + } + + public String getValue() + { + return this.value; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + ClickEvent clickevent = (ClickEvent)p_equals_1_; + + if (this.action != clickevent.action) + { + return false; + } + else + { + if (this.value != null) + { + if (!this.value.equals(clickevent.value)) + { + return false; + } + } + else if (clickevent.value != null) + { + return false; + } + + return true; + } + } + else + { + return false; + } + } + + public String toString() + { + return "ClickEvent{action=" + this.action + ", value=\'" + this.value + '\'' + '}'; + } + + public int hashCode() + { + int i = this.action.hashCode(); + i = 31 * i + (this.value != null ? this.value.hashCode() : 0); + return i; + } + + public static enum Action + { + OPEN_URL("open_url", true), + OPEN_FILE("open_file", false), + RUN_COMMAND("run_command", true), + TWITCH_USER_INFO("twitch_user_info", false), + SUGGEST_COMMAND("suggest_command", true), + CHANGE_PAGE("change_page", true), + UPLOAD_SCREENSHOT("upload_screenshot", false), + COPY_SCREENSHOT("copy_screenshot", false); + + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + private final String canonicalName; + + private Action(String canonicalNameIn, boolean allowedInChatIn) + { + this.canonicalName = canonicalNameIn; + this.allowedInChat = allowedInChatIn; + } + + public boolean shouldAllowInChat() + { + return this.allowedInChat; + } + + public String getCanonicalName() + { + return this.canonicalName; + } + + public static ClickEvent.Action getValueByCanonicalName(String canonicalNameIn) + { + return (ClickEvent.Action)nameMapping.get(canonicalNameIn); + } + + static { + for (ClickEvent.Action clickevent$action : values()) + { + nameMapping.put(clickevent$action.getCanonicalName(), clickevent$action); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/event/HoverEvent.java b/Client-1.8.9/src/main/java/net/minecraft/event/HoverEvent.java new file mode 100644 index 0000000..9e6b97f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/event/HoverEvent.java @@ -0,0 +1,116 @@ +package net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.util.IChatComponent; + +public class HoverEvent +{ + private final HoverEvent.Action action; + private final IChatComponent value; + + public HoverEvent(HoverEvent.Action actionIn, IChatComponent valueIn) + { + this.action = actionIn; + this.value = valueIn; + } + + public HoverEvent.Action getAction() + { + return this.action; + } + + public IChatComponent getValue() + { + return this.value; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + HoverEvent hoverevent = (HoverEvent)p_equals_1_; + + if (this.action != hoverevent.action) + { + return false; + } + else + { + if (this.value != null) + { + if (!this.value.equals(hoverevent.value)) + { + return false; + } + } + else if (hoverevent.value != null) + { + return false; + } + + return true; + } + } + else + { + return false; + } + } + + public String toString() + { + return "HoverEvent{action=" + this.action + ", value=\'" + this.value + '\'' + '}'; + } + + public int hashCode() + { + int i = this.action.hashCode(); + i = 31 * i + (this.value != null ? this.value.hashCode() : 0); + return i; + } + + public static enum Action + { + SHOW_TEXT("show_text", true), + SHOW_ACHIEVEMENT("show_achievement", true), + SHOW_ITEM("show_item", true), + SHOW_ENTITY("show_entity", true); + + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + private final String canonicalName; + + private Action(String canonicalNameIn, boolean allowedInChatIn) + { + this.canonicalName = canonicalNameIn; + this.allowedInChat = allowedInChatIn; + } + + public boolean shouldAllowInChat() + { + return this.allowedInChat; + } + + public String getCanonicalName() + { + return this.canonicalName; + } + + public static HoverEvent.Action getValueByCanonicalName(String canonicalNameIn) + { + return (HoverEvent.Action)nameMapping.get(canonicalNameIn); + } + + static { + for (HoverEvent.Action hoverevent$action : values()) + { + nameMapping.put(hoverevent$action.getCanonicalName(), hoverevent$action); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/init/Blocks.java b/Client-1.8.9/src/main/java/net/minecraft/init/Blocks.java new file mode 100644 index 0000000..4d923d8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/init/Blocks.java @@ -0,0 +1,451 @@ +package net.minecraft.init; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBeacon; +import net.minecraft.block.BlockBush; +import net.minecraft.block.BlockCactus; +import net.minecraft.block.BlockCauldron; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockDaylightDetector; +import net.minecraft.block.BlockDeadBush; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockDynamicLiquid; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockGrass; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockMycelium; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.BlockPistonMoving; +import net.minecraft.block.BlockPortal; +import net.minecraft.block.BlockRedstoneComparator; +import net.minecraft.block.BlockRedstoneRepeater; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.BlockReed; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSkull; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.BlockStaticLiquid; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.BlockTripWireHook; +import net.minecraft.util.ResourceLocation; + +public class Blocks +{ + public static final Block air; + public static final Block stone; + public static final BlockGrass grass; + public static final Block dirt; + public static final Block cobblestone; + public static final Block planks; + public static final Block sapling; + public static final Block bedrock; + public static final BlockDynamicLiquid flowing_water; + public static final BlockStaticLiquid water; + public static final BlockDynamicLiquid flowing_lava; + public static final BlockStaticLiquid lava; + public static final BlockSand sand; + public static final Block gravel; + public static final Block gold_ore; + public static final Block iron_ore; + public static final Block coal_ore; + public static final Block log; + public static final Block log2; + public static final BlockLeaves leaves; + public static final BlockLeaves leaves2; + public static final Block sponge; + public static final Block glass; + public static final Block lapis_ore; + public static final Block lapis_block; + public static final Block dispenser; + public static final Block sandstone; + public static final Block noteblock; + public static final Block bed; + public static final Block golden_rail; + public static final Block detector_rail; + public static final BlockPistonBase sticky_piston; + public static final Block web; + public static final BlockTallGrass tallgrass; + public static final BlockDeadBush deadbush; + public static final BlockPistonBase piston; + public static final BlockPistonExtension piston_head; + public static final Block wool; + public static final BlockPistonMoving piston_extension; + public static final BlockFlower yellow_flower; + public static final BlockFlower red_flower; + public static final BlockBush brown_mushroom; + public static final BlockBush red_mushroom; + public static final Block gold_block; + public static final Block iron_block; + public static final BlockSlab double_stone_slab; + public static final BlockSlab stone_slab; + public static final Block brick_block; + public static final Block tnt; + public static final Block bookshelf; + public static final Block mossy_cobblestone; + public static final Block obsidian; + public static final Block torch; + public static final BlockFire fire; + public static final Block mob_spawner; + public static final Block oak_stairs; + public static final BlockChest chest; + public static final BlockRedstoneWire redstone_wire; + public static final Block diamond_ore; + public static final Block diamond_block; + public static final Block crafting_table; + public static final Block wheat; + public static final Block farmland; + public static final Block furnace; + public static final Block lit_furnace; + public static final Block standing_sign; + public static final Block oak_door; + public static final Block spruce_door; + public static final Block birch_door; + public static final Block jungle_door; + public static final Block acacia_door; + public static final Block dark_oak_door; + public static final Block ladder; + public static final Block rail; + public static final Block stone_stairs; + public static final Block wall_sign; + public static final Block lever; + public static final Block stone_pressure_plate; + public static final Block iron_door; + public static final Block wooden_pressure_plate; + public static final Block redstone_ore; + public static final Block lit_redstone_ore; + public static final Block unlit_redstone_torch; + public static final Block redstone_torch; + public static final Block stone_button; + public static final Block snow_layer; + public static final Block ice; + public static final Block snow; + public static final BlockCactus cactus; + public static final Block clay; + public static final BlockReed reeds; + public static final Block jukebox; + public static final Block oak_fence; + public static final Block spruce_fence; + public static final Block birch_fence; + public static final Block jungle_fence; + public static final Block dark_oak_fence; + public static final Block acacia_fence; + public static final Block pumpkin; + public static final Block netherrack; + public static final Block soul_sand; + public static final Block glowstone; + public static final BlockPortal portal; + public static final Block lit_pumpkin; + public static final Block cake; + public static final BlockRedstoneRepeater unpowered_repeater; + public static final BlockRedstoneRepeater powered_repeater; + public static final Block trapdoor; + public static final Block monster_egg; + public static final Block stonebrick; + public static final Block brown_mushroom_block; + public static final Block red_mushroom_block; + public static final Block iron_bars; + public static final Block glass_pane; + public static final Block melon_block; + public static final Block pumpkin_stem; + public static final Block melon_stem; + public static final Block vine; + public static final Block oak_fence_gate; + public static final Block spruce_fence_gate; + public static final Block birch_fence_gate; + public static final Block jungle_fence_gate; + public static final Block dark_oak_fence_gate; + public static final Block acacia_fence_gate; + public static final Block brick_stairs; + public static final Block stone_brick_stairs; + public static final BlockMycelium mycelium; + public static final Block waterlily; + public static final Block nether_brick; + public static final Block nether_brick_fence; + public static final Block nether_brick_stairs; + public static final Block nether_wart; + public static final Block enchanting_table; + public static final Block brewing_stand; + public static final BlockCauldron cauldron; + public static final Block end_portal; + public static final Block end_portal_frame; + public static final Block end_stone; + public static final Block dragon_egg; + public static final Block redstone_lamp; + public static final Block lit_redstone_lamp; + public static final BlockSlab double_wooden_slab; + public static final BlockSlab wooden_slab; + public static final Block cocoa; + public static final Block sandstone_stairs; + public static final Block emerald_ore; + public static final Block ender_chest; + public static final BlockTripWireHook tripwire_hook; + public static final Block tripwire; + public static final Block emerald_block; + public static final Block spruce_stairs; + public static final Block birch_stairs; + public static final Block jungle_stairs; + public static final Block command_block; + public static final BlockBeacon beacon; + public static final Block cobblestone_wall; + public static final Block flower_pot; + public static final Block carrots; + public static final Block potatoes; + public static final Block wooden_button; + public static final BlockSkull skull; + public static final Block anvil; + public static final Block trapped_chest; + public static final Block light_weighted_pressure_plate; + public static final Block heavy_weighted_pressure_plate; + public static final BlockRedstoneComparator unpowered_comparator; + public static final BlockRedstoneComparator powered_comparator; + public static final BlockDaylightDetector daylight_detector; + public static final BlockDaylightDetector daylight_detector_inverted; + public static final Block redstone_block; + public static final Block quartz_ore; + public static final BlockHopper hopper; + public static final Block quartz_block; + public static final Block quartz_stairs; + public static final Block activator_rail; + public static final Block dropper; + public static final Block stained_hardened_clay; + public static final Block barrier; + public static final Block iron_trapdoor; + public static final Block hay_block; + public static final Block carpet; + public static final Block hardened_clay; + public static final Block coal_block; + public static final Block packed_ice; + public static final Block acacia_stairs; + public static final Block dark_oak_stairs; + public static final Block slime_block; + public static final BlockDoublePlant double_plant; + public static final BlockStainedGlass stained_glass; + public static final BlockStainedGlassPane stained_glass_pane; + public static final Block prismarine; + public static final Block sea_lantern; + public static final Block standing_banner; + public static final Block wall_banner; + public static final Block red_sandstone; + public static final Block red_sandstone_stairs; + public static final BlockSlab double_stone_slab2; + public static final BlockSlab stone_slab2; + + private static Block getRegisteredBlock(String blockName) + { + return (Block)Block.blockRegistry.getObject(new ResourceLocation(blockName)); + } + + static + { + if (!Bootstrap.isRegistered()) + { + throw new RuntimeException("Accessed Blocks before Bootstrap!"); + } + else + { + air = getRegisteredBlock("air"); + stone = getRegisteredBlock("stone"); + grass = (BlockGrass)getRegisteredBlock("grass"); + dirt = getRegisteredBlock("dirt"); + cobblestone = getRegisteredBlock("cobblestone"); + planks = getRegisteredBlock("planks"); + sapling = getRegisteredBlock("sapling"); + bedrock = getRegisteredBlock("bedrock"); + flowing_water = (BlockDynamicLiquid)getRegisteredBlock("flowing_water"); + water = (BlockStaticLiquid)getRegisteredBlock("water"); + flowing_lava = (BlockDynamicLiquid)getRegisteredBlock("flowing_lava"); + lava = (BlockStaticLiquid)getRegisteredBlock("lava"); + sand = (BlockSand)getRegisteredBlock("sand"); + gravel = getRegisteredBlock("gravel"); + gold_ore = getRegisteredBlock("gold_ore"); + iron_ore = getRegisteredBlock("iron_ore"); + coal_ore = getRegisteredBlock("coal_ore"); + log = getRegisteredBlock("log"); + log2 = getRegisteredBlock("log2"); + leaves = (BlockLeaves)getRegisteredBlock("leaves"); + leaves2 = (BlockLeaves)getRegisteredBlock("leaves2"); + sponge = getRegisteredBlock("sponge"); + glass = getRegisteredBlock("glass"); + lapis_ore = getRegisteredBlock("lapis_ore"); + lapis_block = getRegisteredBlock("lapis_block"); + dispenser = getRegisteredBlock("dispenser"); + sandstone = getRegisteredBlock("sandstone"); + noteblock = getRegisteredBlock("noteblock"); + bed = getRegisteredBlock("bed"); + golden_rail = getRegisteredBlock("golden_rail"); + detector_rail = getRegisteredBlock("detector_rail"); + sticky_piston = (BlockPistonBase)getRegisteredBlock("sticky_piston"); + web = getRegisteredBlock("web"); + tallgrass = (BlockTallGrass)getRegisteredBlock("tallgrass"); + deadbush = (BlockDeadBush)getRegisteredBlock("deadbush"); + piston = (BlockPistonBase)getRegisteredBlock("piston"); + piston_head = (BlockPistonExtension)getRegisteredBlock("piston_head"); + wool = getRegisteredBlock("wool"); + piston_extension = (BlockPistonMoving)getRegisteredBlock("piston_extension"); + yellow_flower = (BlockFlower)getRegisteredBlock("yellow_flower"); + red_flower = (BlockFlower)getRegisteredBlock("red_flower"); + brown_mushroom = (BlockBush)getRegisteredBlock("brown_mushroom"); + red_mushroom = (BlockBush)getRegisteredBlock("red_mushroom"); + gold_block = getRegisteredBlock("gold_block"); + iron_block = getRegisteredBlock("iron_block"); + double_stone_slab = (BlockSlab)getRegisteredBlock("double_stone_slab"); + stone_slab = (BlockSlab)getRegisteredBlock("stone_slab"); + brick_block = getRegisteredBlock("brick_block"); + tnt = getRegisteredBlock("tnt"); + bookshelf = getRegisteredBlock("bookshelf"); + mossy_cobblestone = getRegisteredBlock("mossy_cobblestone"); + obsidian = getRegisteredBlock("obsidian"); + torch = getRegisteredBlock("torch"); + fire = (BlockFire)getRegisteredBlock("fire"); + mob_spawner = getRegisteredBlock("mob_spawner"); + oak_stairs = getRegisteredBlock("oak_stairs"); + chest = (BlockChest)getRegisteredBlock("chest"); + redstone_wire = (BlockRedstoneWire)getRegisteredBlock("redstone_wire"); + diamond_ore = getRegisteredBlock("diamond_ore"); + diamond_block = getRegisteredBlock("diamond_block"); + crafting_table = getRegisteredBlock("crafting_table"); + wheat = getRegisteredBlock("wheat"); + farmland = getRegisteredBlock("farmland"); + furnace = getRegisteredBlock("furnace"); + lit_furnace = getRegisteredBlock("lit_furnace"); + standing_sign = getRegisteredBlock("standing_sign"); + oak_door = getRegisteredBlock("wooden_door"); + spruce_door = getRegisteredBlock("spruce_door"); + birch_door = getRegisteredBlock("birch_door"); + jungle_door = getRegisteredBlock("jungle_door"); + acacia_door = getRegisteredBlock("acacia_door"); + dark_oak_door = getRegisteredBlock("dark_oak_door"); + ladder = getRegisteredBlock("ladder"); + rail = getRegisteredBlock("rail"); + stone_stairs = getRegisteredBlock("stone_stairs"); + wall_sign = getRegisteredBlock("wall_sign"); + lever = getRegisteredBlock("lever"); + stone_pressure_plate = getRegisteredBlock("stone_pressure_plate"); + iron_door = getRegisteredBlock("iron_door"); + wooden_pressure_plate = getRegisteredBlock("wooden_pressure_plate"); + redstone_ore = getRegisteredBlock("redstone_ore"); + lit_redstone_ore = getRegisteredBlock("lit_redstone_ore"); + unlit_redstone_torch = getRegisteredBlock("unlit_redstone_torch"); + redstone_torch = getRegisteredBlock("redstone_torch"); + stone_button = getRegisteredBlock("stone_button"); + snow_layer = getRegisteredBlock("snow_layer"); + ice = getRegisteredBlock("ice"); + snow = getRegisteredBlock("snow"); + cactus = (BlockCactus)getRegisteredBlock("cactus"); + clay = getRegisteredBlock("clay"); + reeds = (BlockReed)getRegisteredBlock("reeds"); + jukebox = getRegisteredBlock("jukebox"); + oak_fence = getRegisteredBlock("fence"); + spruce_fence = getRegisteredBlock("spruce_fence"); + birch_fence = getRegisteredBlock("birch_fence"); + jungle_fence = getRegisteredBlock("jungle_fence"); + dark_oak_fence = getRegisteredBlock("dark_oak_fence"); + acacia_fence = getRegisteredBlock("acacia_fence"); + pumpkin = getRegisteredBlock("pumpkin"); + netherrack = getRegisteredBlock("netherrack"); + soul_sand = getRegisteredBlock("soul_sand"); + glowstone = getRegisteredBlock("glowstone"); + portal = (BlockPortal)getRegisteredBlock("portal"); + lit_pumpkin = getRegisteredBlock("lit_pumpkin"); + cake = getRegisteredBlock("cake"); + unpowered_repeater = (BlockRedstoneRepeater)getRegisteredBlock("unpowered_repeater"); + powered_repeater = (BlockRedstoneRepeater)getRegisteredBlock("powered_repeater"); + trapdoor = getRegisteredBlock("trapdoor"); + monster_egg = getRegisteredBlock("monster_egg"); + stonebrick = getRegisteredBlock("stonebrick"); + brown_mushroom_block = getRegisteredBlock("brown_mushroom_block"); + red_mushroom_block = getRegisteredBlock("red_mushroom_block"); + iron_bars = getRegisteredBlock("iron_bars"); + glass_pane = getRegisteredBlock("glass_pane"); + melon_block = getRegisteredBlock("melon_block"); + pumpkin_stem = getRegisteredBlock("pumpkin_stem"); + melon_stem = getRegisteredBlock("melon_stem"); + vine = getRegisteredBlock("vine"); + oak_fence_gate = getRegisteredBlock("fence_gate"); + spruce_fence_gate = getRegisteredBlock("spruce_fence_gate"); + birch_fence_gate = getRegisteredBlock("birch_fence_gate"); + jungle_fence_gate = getRegisteredBlock("jungle_fence_gate"); + dark_oak_fence_gate = getRegisteredBlock("dark_oak_fence_gate"); + acacia_fence_gate = getRegisteredBlock("acacia_fence_gate"); + brick_stairs = getRegisteredBlock("brick_stairs"); + stone_brick_stairs = getRegisteredBlock("stone_brick_stairs"); + mycelium = (BlockMycelium)getRegisteredBlock("mycelium"); + waterlily = getRegisteredBlock("waterlily"); + nether_brick = getRegisteredBlock("nether_brick"); + nether_brick_fence = getRegisteredBlock("nether_brick_fence"); + nether_brick_stairs = getRegisteredBlock("nether_brick_stairs"); + nether_wart = getRegisteredBlock("nether_wart"); + enchanting_table = getRegisteredBlock("enchanting_table"); + brewing_stand = getRegisteredBlock("brewing_stand"); + cauldron = (BlockCauldron)getRegisteredBlock("cauldron"); + end_portal = getRegisteredBlock("end_portal"); + end_portal_frame = getRegisteredBlock("end_portal_frame"); + end_stone = getRegisteredBlock("end_stone"); + dragon_egg = getRegisteredBlock("dragon_egg"); + redstone_lamp = getRegisteredBlock("redstone_lamp"); + lit_redstone_lamp = getRegisteredBlock("lit_redstone_lamp"); + double_wooden_slab = (BlockSlab)getRegisteredBlock("double_wooden_slab"); + wooden_slab = (BlockSlab)getRegisteredBlock("wooden_slab"); + cocoa = getRegisteredBlock("cocoa"); + sandstone_stairs = getRegisteredBlock("sandstone_stairs"); + emerald_ore = getRegisteredBlock("emerald_ore"); + ender_chest = getRegisteredBlock("ender_chest"); + tripwire_hook = (BlockTripWireHook)getRegisteredBlock("tripwire_hook"); + tripwire = getRegisteredBlock("tripwire"); + emerald_block = getRegisteredBlock("emerald_block"); + spruce_stairs = getRegisteredBlock("spruce_stairs"); + birch_stairs = getRegisteredBlock("birch_stairs"); + jungle_stairs = getRegisteredBlock("jungle_stairs"); + command_block = getRegisteredBlock("command_block"); + beacon = (BlockBeacon)getRegisteredBlock("beacon"); + cobblestone_wall = getRegisteredBlock("cobblestone_wall"); + flower_pot = getRegisteredBlock("flower_pot"); + carrots = getRegisteredBlock("carrots"); + potatoes = getRegisteredBlock("potatoes"); + wooden_button = getRegisteredBlock("wooden_button"); + skull = (BlockSkull)getRegisteredBlock("skull"); + anvil = getRegisteredBlock("anvil"); + trapped_chest = getRegisteredBlock("trapped_chest"); + light_weighted_pressure_plate = getRegisteredBlock("light_weighted_pressure_plate"); + heavy_weighted_pressure_plate = getRegisteredBlock("heavy_weighted_pressure_plate"); + unpowered_comparator = (BlockRedstoneComparator)getRegisteredBlock("unpowered_comparator"); + powered_comparator = (BlockRedstoneComparator)getRegisteredBlock("powered_comparator"); + daylight_detector = (BlockDaylightDetector)getRegisteredBlock("daylight_detector"); + daylight_detector_inverted = (BlockDaylightDetector)getRegisteredBlock("daylight_detector_inverted"); + redstone_block = getRegisteredBlock("redstone_block"); + quartz_ore = getRegisteredBlock("quartz_ore"); + hopper = (BlockHopper)getRegisteredBlock("hopper"); + quartz_block = getRegisteredBlock("quartz_block"); + quartz_stairs = getRegisteredBlock("quartz_stairs"); + activator_rail = getRegisteredBlock("activator_rail"); + dropper = getRegisteredBlock("dropper"); + stained_hardened_clay = getRegisteredBlock("stained_hardened_clay"); + barrier = getRegisteredBlock("barrier"); + iron_trapdoor = getRegisteredBlock("iron_trapdoor"); + hay_block = getRegisteredBlock("hay_block"); + carpet = getRegisteredBlock("carpet"); + hardened_clay = getRegisteredBlock("hardened_clay"); + coal_block = getRegisteredBlock("coal_block"); + packed_ice = getRegisteredBlock("packed_ice"); + acacia_stairs = getRegisteredBlock("acacia_stairs"); + dark_oak_stairs = getRegisteredBlock("dark_oak_stairs"); + slime_block = getRegisteredBlock("slime"); + double_plant = (BlockDoublePlant)getRegisteredBlock("double_plant"); + stained_glass = (BlockStainedGlass)getRegisteredBlock("stained_glass"); + stained_glass_pane = (BlockStainedGlassPane)getRegisteredBlock("stained_glass_pane"); + prismarine = getRegisteredBlock("prismarine"); + sea_lantern = getRegisteredBlock("sea_lantern"); + standing_banner = getRegisteredBlock("standing_banner"); + wall_banner = getRegisteredBlock("wall_banner"); + red_sandstone = getRegisteredBlock("red_sandstone"); + red_sandstone_stairs = getRegisteredBlock("red_sandstone_stairs"); + double_stone_slab2 = (BlockSlab)getRegisteredBlock("double_stone_slab2"); + stone_slab2 = (BlockSlab)getRegisteredBlock("stone_slab2"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/init/Bootstrap.java b/Client-1.8.9/src/main/java/net/minecraft/init/Bootstrap.java new file mode 100644 index 0000000..d59f9d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/init/Bootstrap.java @@ -0,0 +1,527 @@ +package net.minecraft.init; + +import com.mojang.authlib.GameProfile; +import java.io.PrintStream; +import java.util.Random; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockPumpkin; +import net.minecraft.block.BlockSkull; +import net.minecraft.block.BlockTNT; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.BehaviorProjectileDispense; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemMonsterPlacer; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.LoggingPrintStream; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Bootstrap +{ + private static final PrintStream SYSOUT = System.out; + private static boolean alreadyRegistered = false; + private static final Logger LOGGER = LogManager.getLogger(); + + public static boolean isRegistered() + { + return alreadyRegistered; + } + + static void registerDispenserBehaviors() + { + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.arrow, new BehaviorProjectileDispense() + { + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + EntityArrow entityarrow = new EntityArrow(worldIn, position.getX(), position.getY(), position.getZ()); + entityarrow.canBePickedUp = 1; + return entityarrow; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.egg, new BehaviorProjectileDispense() + { + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntityEgg(worldIn, position.getX(), position.getY(), position.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.snowball, new BehaviorProjectileDispense() + { + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntitySnowball(worldIn, position.getX(), position.getY(), position.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.experience_bottle, new BehaviorProjectileDispense() + { + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntityExpBottle(worldIn, position.getX(), position.getY(), position.getZ()); + } + protected float func_82498_a() + { + return super.func_82498_a() * 0.5F; + } + protected float func_82500_b() + { + return super.func_82500_b() * 1.25F; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.potionitem, new IBehaviorDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150843_b = new BehaviorDefaultDispenseItem(); + public ItemStack dispense(IBlockSource source, final ItemStack stack) + { + return ItemPotion.isSplash(stack.getMetadata()) ? (new BehaviorProjectileDispense() + { + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntityPotion(worldIn, position.getX(), position.getY(), position.getZ(), stack.copy()); + } + protected float func_82498_a() + { + return super.func_82498_a() * 0.5F; + } + protected float func_82500_b() + { + return super.func_82500_b() * 1.25F; + } + }).dispense(source, stack): this.field_150843_b.dispense(source, stack); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.spawn_egg, new BehaviorDefaultDispenseItem() + { + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + double d0 = source.getX() + (double)enumfacing.getFrontOffsetX(); + double d1 = (double)((float)source.getBlockPos().getY() + 0.2F); + double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); + Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), stack.getMetadata(), d0, d1, d2); + + if (entity instanceof EntityLivingBase && stack.hasDisplayName()) + { + ((EntityLiving)entity).setCustomNameTag(stack.getDisplayName()); + } + + stack.splitStack(1); + return stack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fireworks, new BehaviorDefaultDispenseItem() + { + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + double d0 = source.getX() + (double)enumfacing.getFrontOffsetX(); + double d1 = (double)((float)source.getBlockPos().getY() + 0.2F); + double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); + EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(source.getWorld(), d0, d1, d2, stack); + source.getWorld().spawnEntityInWorld(entityfireworkrocket); + stack.splitStack(1); + return stack; + } + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1002, source.getBlockPos(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fire_charge, new BehaviorDefaultDispenseItem() + { + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + IPosition iposition = BlockDispenser.getDispensePosition(source); + double d0 = iposition.getX() + (double)((float)enumfacing.getFrontOffsetX() * 0.3F); + double d1 = iposition.getY() + (double)((float)enumfacing.getFrontOffsetY() * 0.3F); + double d2 = iposition.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 0.3F); + World world = source.getWorld(); + Random random = world.rand; + double d3 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetX(); + double d4 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetY(); + double d5 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetZ(); + world.spawnEntityInWorld(new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5)); + stack.splitStack(1); + return stack; + } + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1009, source.getBlockPos(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.boat, new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150842_b = new BehaviorDefaultDispenseItem(); + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + World world = source.getWorld(); + double d0 = source.getX() + (double)((float)enumfacing.getFrontOffsetX() * 1.125F); + double d1 = source.getY() + (double)((float)enumfacing.getFrontOffsetY() * 1.125F); + double d2 = source.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 1.125F); + BlockPos blockpos = source.getBlockPos().offset(enumfacing); + Material material = world.getBlockState(blockpos).getBlock().getMaterial(); + double d3; + + if (Material.water.equals(material)) + { + d3 = 1.0D; + } + else + { + if (!Material.air.equals(material) || !Material.water.equals(world.getBlockState(blockpos.down()).getBlock().getMaterial())) + { + return this.field_150842_b.dispense(source, stack); + } + + d3 = 0.0D; + } + + EntityBoat entityboat = new EntityBoat(world, d0, d1 + d3, d2); + world.spawnEntityInWorld(entityboat); + stack.splitStack(1); + return stack; + } + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + }); + IBehaviorDispenseItem ibehaviordispenseitem = new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150841_b = new BehaviorDefaultDispenseItem(); + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + ItemBucket itembucket = (ItemBucket)stack.getItem(); + BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); + + if (itembucket.tryPlaceContainedLiquid(source.getWorld(), blockpos)) + { + stack.setItem(Items.bucket); + stack.stackSize = 1; + return stack; + } + else + { + return this.field_150841_b.dispense(source, stack); + } + } + }; + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.lava_bucket, ibehaviordispenseitem); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.water_bucket, ibehaviordispenseitem); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); + IBlockState iblockstate = world.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + Material material = block.getMaterial(); + Item item; + + if (Material.water.equals(material) && block instanceof BlockLiquid && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) + { + item = Items.water_bucket; + } + else + { + if (!Material.lava.equals(material) || !(block instanceof BlockLiquid) || ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() != 0) + { + return super.dispenseStack(source, stack); + } + + item = Items.lava_bucket; + } + + world.setBlockToAir(blockpos); + + if (--stack.stackSize == 0) + { + stack.setItem(item); + stack.stackSize = 1; + } + else if (((TileEntityDispenser)source.getBlockTileEntity()).addItemStack(new ItemStack(item)) < 0) + { + this.field_150840_b.dispense(source, new ItemStack(item)); + } + + return stack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.flint_and_steel, new BehaviorDefaultDispenseItem() + { + private boolean field_150839_b = true; + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); + + if (world.isAirBlock(blockpos)) + { + world.setBlockState(blockpos, Blocks.fire.getDefaultState()); + + if (stack.attemptDamageItem(1, world.rand)) + { + stack.stackSize = 0; + } + } + else if (world.getBlockState(blockpos).getBlock() == Blocks.tnt) + { + Blocks.tnt.onBlockDestroyedByPlayer(world, blockpos, Blocks.tnt.getDefaultState().withProperty(BlockTNT.EXPLODE, Boolean.valueOf(true))); + world.setBlockToAir(blockpos); + } + else + { + this.field_150839_b = false; + } + + return stack; + } + protected void playDispenseSound(IBlockSource source) + { + if (this.field_150839_b) + { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + else + { + source.getWorld().playAuxSFX(1001, source.getBlockPos(), 0); + } + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.dye, new BehaviorDefaultDispenseItem() + { + private boolean field_150838_b = true; + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + if (EnumDyeColor.WHITE == EnumDyeColor.byDyeDamage(stack.getMetadata())) + { + World world = source.getWorld(); + BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); + + if (ItemDye.applyBonemeal(stack, world, blockpos)) + { + if (!world.isRemote) + { + world.playAuxSFX(2005, blockpos, 0); + } + } + else + { + this.field_150838_b = false; + } + + return stack; + } + else + { + return super.dispenseStack(source, stack); + } + } + protected void playDispenseSound(IBlockSource source) + { + if (this.field_150838_b) + { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + else + { + source.getWorld().playAuxSFX(1001, source.getBlockPos(), 0); + } + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Item.getItemFromBlock(Blocks.tnt), new BehaviorDefaultDispenseItem() + { + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double)blockpos.getX() + 0.5D, (double)blockpos.getY(), (double)blockpos.getZ() + 0.5D, (EntityLivingBase)null); + world.spawnEntityInWorld(entitytntprimed); + world.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); + --stack.stackSize; + return stack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.skull, new BehaviorDefaultDispenseItem() + { + private boolean field_179240_b = true; + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + BlockPos blockpos = source.getBlockPos().offset(enumfacing); + BlockSkull blockskull = Blocks.skull; + + if (world.isAirBlock(blockpos) && blockskull.canDispenserPlace(world, blockpos, stack)) + { + if (!world.isRemote) + { + world.setBlockState(blockpos, blockskull.getDefaultState().withProperty(BlockSkull.FACING, EnumFacing.UP), 3); + TileEntity tileentity = world.getTileEntity(blockpos); + + if (tileentity instanceof TileEntitySkull) + { + if (stack.getMetadata() == 3) + { + GameProfile gameprofile = null; + + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8)) + { + String s = nbttagcompound.getString("SkullOwner"); + + if (!StringUtils.isNullOrEmpty(s)) + { + gameprofile = new GameProfile((UUID)null, s); + } + } + } + + ((TileEntitySkull)tileentity).setPlayerProfile(gameprofile); + } + else + { + ((TileEntitySkull)tileentity).setType(stack.getMetadata()); + } + + ((TileEntitySkull)tileentity).setSkullRotation(enumfacing.getOpposite().getHorizontalIndex() * 4); + Blocks.skull.checkWitherSpawn(world, blockpos, (TileEntitySkull)tileentity); + } + + --stack.stackSize; + } + } + else + { + this.field_179240_b = false; + } + + return stack; + } + protected void playDispenseSound(IBlockSource source) + { + if (this.field_179240_b) + { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + else + { + source.getWorld().playAuxSFX(1001, source.getBlockPos(), 0); + } + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Item.getItemFromBlock(Blocks.pumpkin), new BehaviorDefaultDispenseItem() + { + private boolean field_179241_b = true; + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); + BlockPumpkin blockpumpkin = (BlockPumpkin)Blocks.pumpkin; + + if (world.isAirBlock(blockpos) && blockpumpkin.canDispenserPlace(world, blockpos)) + { + if (!world.isRemote) + { + world.setBlockState(blockpos, blockpumpkin.getDefaultState(), 3); + } + + --stack.stackSize; + } + else + { + this.field_179241_b = false; + } + + return stack; + } + protected void playDispenseSound(IBlockSource source) + { + if (this.field_179241_b) + { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + else + { + source.getWorld().playAuxSFX(1001, source.getBlockPos(), 0); + } + } + }); + } + + public static void register() + { + if (!alreadyRegistered) + { + alreadyRegistered = true; + + if (LOGGER.isDebugEnabled()) + { + redirectOutputToLog(); + } + + Block.registerBlocks(); + BlockFire.init(); + Item.registerItems(); + StatList.init(); + registerDispenserBehaviors(); + } + } + + private static void redirectOutputToLog() + { + System.setErr(new LoggingPrintStream("STDERR", System.err)); + System.setOut(new LoggingPrintStream("STDOUT", SYSOUT)); + } + + public static void printToSYSOUT(String p_179870_0_) + { + SYSOUT.println(p_179870_0_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/init/Items.java b/Client-1.8.9/src/main/java/net/minecraft/init/Items.java new file mode 100644 index 0000000..8e4d9e7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/init/Items.java @@ -0,0 +1,407 @@ +package net.minecraft.init; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemArmorStand; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemEmptyMap; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.item.ItemFishingRod; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemShears; +import net.minecraft.util.ResourceLocation; + +public class Items +{ + public static final Item iron_shovel; + public static final Item iron_pickaxe; + public static final Item iron_axe; + public static final Item flint_and_steel; + public static final Item apple; + public static final ItemBow bow; + public static final Item arrow; + public static final Item coal; + public static final Item diamond; + public static final Item iron_ingot; + public static final Item gold_ingot; + public static final Item iron_sword; + public static final Item wooden_sword; + public static final Item wooden_shovel; + public static final Item wooden_pickaxe; + public static final Item wooden_axe; + public static final Item stone_sword; + public static final Item stone_shovel; + public static final Item stone_pickaxe; + public static final Item stone_axe; + public static final Item diamond_sword; + public static final Item diamond_shovel; + public static final Item diamond_pickaxe; + public static final Item diamond_axe; + public static final Item stick; + public static final Item bowl; + public static final Item mushroom_stew; + public static final Item golden_sword; + public static final Item golden_shovel; + public static final Item golden_pickaxe; + public static final Item golden_axe; + public static final Item string; + public static final Item feather; + public static final Item gunpowder; + public static final Item wooden_hoe; + public static final Item stone_hoe; + public static final Item iron_hoe; + public static final Item diamond_hoe; + public static final Item golden_hoe; + public static final Item wheat_seeds; + public static final Item wheat; + public static final Item bread; + public static final ItemArmor leather_helmet; + public static final ItemArmor leather_chestplate; + public static final ItemArmor leather_leggings; + public static final ItemArmor leather_boots; + public static final ItemArmor chainmail_helmet; + public static final ItemArmor chainmail_chestplate; + public static final ItemArmor chainmail_leggings; + public static final ItemArmor chainmail_boots; + public static final ItemArmor iron_helmet; + public static final ItemArmor iron_chestplate; + public static final ItemArmor iron_leggings; + public static final ItemArmor iron_boots; + public static final ItemArmor diamond_helmet; + public static final ItemArmor diamond_chestplate; + public static final ItemArmor diamond_leggings; + public static final ItemArmor diamond_boots; + public static final ItemArmor golden_helmet; + public static final ItemArmor golden_chestplate; + public static final ItemArmor golden_leggings; + public static final ItemArmor golden_boots; + public static final Item flint; + public static final Item porkchop; + public static final Item cooked_porkchop; + public static final Item painting; + public static final Item golden_apple; + public static final Item sign; + public static final Item oak_door; + public static final Item spruce_door; + public static final Item birch_door; + public static final Item jungle_door; + public static final Item acacia_door; + public static final Item dark_oak_door; + public static final Item bucket; + public static final Item water_bucket; + public static final Item lava_bucket; + public static final Item minecart; + public static final Item saddle; + public static final Item iron_door; + public static final Item redstone; + public static final Item snowball; + public static final Item boat; + public static final Item leather; + public static final Item milk_bucket; + public static final Item brick; + public static final Item clay_ball; + public static final Item reeds; + public static final Item paper; + public static final Item book; + public static final Item slime_ball; + public static final Item chest_minecart; + public static final Item furnace_minecart; + public static final Item egg; + public static final Item compass; + public static final ItemFishingRod fishing_rod; + public static final Item clock; + public static final Item glowstone_dust; + public static final Item fish; + public static final Item cooked_fish; + public static final Item dye; + public static final Item bone; + public static final Item sugar; + public static final Item cake; + public static final Item bed; + public static final Item repeater; + public static final Item cookie; + public static final ItemMap filled_map; + public static final ItemShears shears; + public static final Item melon; + public static final Item pumpkin_seeds; + public static final Item melon_seeds; + public static final Item beef; + public static final Item cooked_beef; + public static final Item chicken; + public static final Item cooked_chicken; + public static final Item mutton; + public static final Item cooked_mutton; + public static final Item rabbit; + public static final Item cooked_rabbit; + public static final Item rabbit_stew; + public static final Item rabbit_foot; + public static final Item rabbit_hide; + public static final Item rotten_flesh; + public static final Item ender_pearl; + public static final Item blaze_rod; + public static final Item ghast_tear; + public static final Item gold_nugget; + public static final Item nether_wart; + public static final ItemPotion potionitem; + public static final Item glass_bottle; + public static final Item spider_eye; + public static final Item fermented_spider_eye; + public static final Item blaze_powder; + public static final Item magma_cream; + public static final Item brewing_stand; + public static final Item cauldron; + public static final Item ender_eye; + public static final Item speckled_melon; + public static final Item spawn_egg; + public static final Item experience_bottle; + public static final Item fire_charge; + public static final Item writable_book; + public static final Item written_book; + public static final Item emerald; + public static final Item item_frame; + public static final Item flower_pot; + public static final Item carrot; + public static final Item potato; + public static final Item baked_potato; + public static final Item poisonous_potato; + public static final ItemEmptyMap map; + public static final Item golden_carrot; + public static final Item skull; + public static final Item carrot_on_a_stick; + public static final Item nether_star; + public static final Item pumpkin_pie; + public static final Item fireworks; + public static final Item firework_charge; + public static final ItemEnchantedBook enchanted_book; + public static final Item comparator; + public static final Item netherbrick; + public static final Item quartz; + public static final Item tnt_minecart; + public static final Item hopper_minecart; + public static final ItemArmorStand armor_stand; + public static final Item iron_horse_armor; + public static final Item golden_horse_armor; + public static final Item diamond_horse_armor; + public static final Item lead; + public static final Item name_tag; + public static final Item command_block_minecart; + public static final Item record_13; + public static final Item record_cat; + public static final Item record_blocks; + public static final Item record_chirp; + public static final Item record_far; + public static final Item record_mall; + public static final Item record_mellohi; + public static final Item record_stal; + public static final Item record_strad; + public static final Item record_ward; + public static final Item record_11; + public static final Item record_wait; + public static final Item prismarine_shard; + public static final Item prismarine_crystals; + public static final Item banner; + + private static Item getRegisteredItem(String name) + { + return (Item)Item.itemRegistry.getObject(new ResourceLocation(name)); + } + + static + { + if (!Bootstrap.isRegistered()) + { + throw new RuntimeException("Accessed Items before Bootstrap!"); + } + else + { + iron_shovel = getRegisteredItem("iron_shovel"); + iron_pickaxe = getRegisteredItem("iron_pickaxe"); + iron_axe = getRegisteredItem("iron_axe"); + flint_and_steel = getRegisteredItem("flint_and_steel"); + apple = getRegisteredItem("apple"); + bow = (ItemBow)getRegisteredItem("bow"); + arrow = getRegisteredItem("arrow"); + coal = getRegisteredItem("coal"); + diamond = getRegisteredItem("diamond"); + iron_ingot = getRegisteredItem("iron_ingot"); + gold_ingot = getRegisteredItem("gold_ingot"); + iron_sword = getRegisteredItem("iron_sword"); + wooden_sword = getRegisteredItem("wooden_sword"); + wooden_shovel = getRegisteredItem("wooden_shovel"); + wooden_pickaxe = getRegisteredItem("wooden_pickaxe"); + wooden_axe = getRegisteredItem("wooden_axe"); + stone_sword = getRegisteredItem("stone_sword"); + stone_shovel = getRegisteredItem("stone_shovel"); + stone_pickaxe = getRegisteredItem("stone_pickaxe"); + stone_axe = getRegisteredItem("stone_axe"); + diamond_sword = getRegisteredItem("diamond_sword"); + diamond_shovel = getRegisteredItem("diamond_shovel"); + diamond_pickaxe = getRegisteredItem("diamond_pickaxe"); + diamond_axe = getRegisteredItem("diamond_axe"); + stick = getRegisteredItem("stick"); + bowl = getRegisteredItem("bowl"); + mushroom_stew = getRegisteredItem("mushroom_stew"); + golden_sword = getRegisteredItem("golden_sword"); + golden_shovel = getRegisteredItem("golden_shovel"); + golden_pickaxe = getRegisteredItem("golden_pickaxe"); + golden_axe = getRegisteredItem("golden_axe"); + string = getRegisteredItem("string"); + feather = getRegisteredItem("feather"); + gunpowder = getRegisteredItem("gunpowder"); + wooden_hoe = getRegisteredItem("wooden_hoe"); + stone_hoe = getRegisteredItem("stone_hoe"); + iron_hoe = getRegisteredItem("iron_hoe"); + diamond_hoe = getRegisteredItem("diamond_hoe"); + golden_hoe = getRegisteredItem("golden_hoe"); + wheat_seeds = getRegisteredItem("wheat_seeds"); + wheat = getRegisteredItem("wheat"); + bread = getRegisteredItem("bread"); + leather_helmet = (ItemArmor)getRegisteredItem("leather_helmet"); + leather_chestplate = (ItemArmor)getRegisteredItem("leather_chestplate"); + leather_leggings = (ItemArmor)getRegisteredItem("leather_leggings"); + leather_boots = (ItemArmor)getRegisteredItem("leather_boots"); + chainmail_helmet = (ItemArmor)getRegisteredItem("chainmail_helmet"); + chainmail_chestplate = (ItemArmor)getRegisteredItem("chainmail_chestplate"); + chainmail_leggings = (ItemArmor)getRegisteredItem("chainmail_leggings"); + chainmail_boots = (ItemArmor)getRegisteredItem("chainmail_boots"); + iron_helmet = (ItemArmor)getRegisteredItem("iron_helmet"); + iron_chestplate = (ItemArmor)getRegisteredItem("iron_chestplate"); + iron_leggings = (ItemArmor)getRegisteredItem("iron_leggings"); + iron_boots = (ItemArmor)getRegisteredItem("iron_boots"); + diamond_helmet = (ItemArmor)getRegisteredItem("diamond_helmet"); + diamond_chestplate = (ItemArmor)getRegisteredItem("diamond_chestplate"); + diamond_leggings = (ItemArmor)getRegisteredItem("diamond_leggings"); + diamond_boots = (ItemArmor)getRegisteredItem("diamond_boots"); + golden_helmet = (ItemArmor)getRegisteredItem("golden_helmet"); + golden_chestplate = (ItemArmor)getRegisteredItem("golden_chestplate"); + golden_leggings = (ItemArmor)getRegisteredItem("golden_leggings"); + golden_boots = (ItemArmor)getRegisteredItem("golden_boots"); + flint = getRegisteredItem("flint"); + porkchop = getRegisteredItem("porkchop"); + cooked_porkchop = getRegisteredItem("cooked_porkchop"); + painting = getRegisteredItem("painting"); + golden_apple = getRegisteredItem("golden_apple"); + sign = getRegisteredItem("sign"); + oak_door = getRegisteredItem("wooden_door"); + spruce_door = getRegisteredItem("spruce_door"); + birch_door = getRegisteredItem("birch_door"); + jungle_door = getRegisteredItem("jungle_door"); + acacia_door = getRegisteredItem("acacia_door"); + dark_oak_door = getRegisteredItem("dark_oak_door"); + bucket = getRegisteredItem("bucket"); + water_bucket = getRegisteredItem("water_bucket"); + lava_bucket = getRegisteredItem("lava_bucket"); + minecart = getRegisteredItem("minecart"); + saddle = getRegisteredItem("saddle"); + iron_door = getRegisteredItem("iron_door"); + redstone = getRegisteredItem("redstone"); + snowball = getRegisteredItem("snowball"); + boat = getRegisteredItem("boat"); + leather = getRegisteredItem("leather"); + milk_bucket = getRegisteredItem("milk_bucket"); + brick = getRegisteredItem("brick"); + clay_ball = getRegisteredItem("clay_ball"); + reeds = getRegisteredItem("reeds"); + paper = getRegisteredItem("paper"); + book = getRegisteredItem("book"); + slime_ball = getRegisteredItem("slime_ball"); + chest_minecart = getRegisteredItem("chest_minecart"); + furnace_minecart = getRegisteredItem("furnace_minecart"); + egg = getRegisteredItem("egg"); + compass = getRegisteredItem("compass"); + fishing_rod = (ItemFishingRod)getRegisteredItem("fishing_rod"); + clock = getRegisteredItem("clock"); + glowstone_dust = getRegisteredItem("glowstone_dust"); + fish = getRegisteredItem("fish"); + cooked_fish = getRegisteredItem("cooked_fish"); + dye = getRegisteredItem("dye"); + bone = getRegisteredItem("bone"); + sugar = getRegisteredItem("sugar"); + cake = getRegisteredItem("cake"); + bed = getRegisteredItem("bed"); + repeater = getRegisteredItem("repeater"); + cookie = getRegisteredItem("cookie"); + filled_map = (ItemMap)getRegisteredItem("filled_map"); + shears = (ItemShears)getRegisteredItem("shears"); + melon = getRegisteredItem("melon"); + pumpkin_seeds = getRegisteredItem("pumpkin_seeds"); + melon_seeds = getRegisteredItem("melon_seeds"); + beef = getRegisteredItem("beef"); + cooked_beef = getRegisteredItem("cooked_beef"); + chicken = getRegisteredItem("chicken"); + cooked_chicken = getRegisteredItem("cooked_chicken"); + mutton = getRegisteredItem("mutton"); + cooked_mutton = getRegisteredItem("cooked_mutton"); + rabbit = getRegisteredItem("rabbit"); + cooked_rabbit = getRegisteredItem("cooked_rabbit"); + rabbit_stew = getRegisteredItem("rabbit_stew"); + rabbit_foot = getRegisteredItem("rabbit_foot"); + rabbit_hide = getRegisteredItem("rabbit_hide"); + rotten_flesh = getRegisteredItem("rotten_flesh"); + ender_pearl = getRegisteredItem("ender_pearl"); + blaze_rod = getRegisteredItem("blaze_rod"); + ghast_tear = getRegisteredItem("ghast_tear"); + gold_nugget = getRegisteredItem("gold_nugget"); + nether_wart = getRegisteredItem("nether_wart"); + potionitem = (ItemPotion)getRegisteredItem("potion"); + glass_bottle = getRegisteredItem("glass_bottle"); + spider_eye = getRegisteredItem("spider_eye"); + fermented_spider_eye = getRegisteredItem("fermented_spider_eye"); + blaze_powder = getRegisteredItem("blaze_powder"); + magma_cream = getRegisteredItem("magma_cream"); + brewing_stand = getRegisteredItem("brewing_stand"); + cauldron = getRegisteredItem("cauldron"); + ender_eye = getRegisteredItem("ender_eye"); + speckled_melon = getRegisteredItem("speckled_melon"); + spawn_egg = getRegisteredItem("spawn_egg"); + experience_bottle = getRegisteredItem("experience_bottle"); + fire_charge = getRegisteredItem("fire_charge"); + writable_book = getRegisteredItem("writable_book"); + written_book = getRegisteredItem("written_book"); + emerald = getRegisteredItem("emerald"); + item_frame = getRegisteredItem("item_frame"); + flower_pot = getRegisteredItem("flower_pot"); + carrot = getRegisteredItem("carrot"); + potato = getRegisteredItem("potato"); + baked_potato = getRegisteredItem("baked_potato"); + poisonous_potato = getRegisteredItem("poisonous_potato"); + map = (ItemEmptyMap)getRegisteredItem("map"); + golden_carrot = getRegisteredItem("golden_carrot"); + skull = getRegisteredItem("skull"); + carrot_on_a_stick = getRegisteredItem("carrot_on_a_stick"); + nether_star = getRegisteredItem("nether_star"); + pumpkin_pie = getRegisteredItem("pumpkin_pie"); + fireworks = getRegisteredItem("fireworks"); + firework_charge = getRegisteredItem("firework_charge"); + enchanted_book = (ItemEnchantedBook)getRegisteredItem("enchanted_book"); + comparator = getRegisteredItem("comparator"); + netherbrick = getRegisteredItem("netherbrick"); + quartz = getRegisteredItem("quartz"); + tnt_minecart = getRegisteredItem("tnt_minecart"); + hopper_minecart = getRegisteredItem("hopper_minecart"); + armor_stand = (ItemArmorStand)getRegisteredItem("armor_stand"); + iron_horse_armor = getRegisteredItem("iron_horse_armor"); + golden_horse_armor = getRegisteredItem("golden_horse_armor"); + diamond_horse_armor = getRegisteredItem("diamond_horse_armor"); + lead = getRegisteredItem("lead"); + name_tag = getRegisteredItem("name_tag"); + command_block_minecart = getRegisteredItem("command_block_minecart"); + record_13 = getRegisteredItem("record_13"); + record_cat = getRegisteredItem("record_cat"); + record_blocks = getRegisteredItem("record_blocks"); + record_chirp = getRegisteredItem("record_chirp"); + record_far = getRegisteredItem("record_far"); + record_mall = getRegisteredItem("record_mall"); + record_mellohi = getRegisteredItem("record_mellohi"); + record_stal = getRegisteredItem("record_stal"); + record_strad = getRegisteredItem("record_strad"); + record_ward = getRegisteredItem("record_ward"); + record_11 = getRegisteredItem("record_11"); + record_wait = getRegisteredItem("record_wait"); + prismarine_shard = getRegisteredItem("prismarine_shard"); + prismarine_crystals = getRegisteredItem("prismarine_crystals"); + banner = getRegisteredItem("banner"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/AnimalChest.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/AnimalChest.java new file mode 100644 index 0000000..0fde8df --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/AnimalChest.java @@ -0,0 +1,16 @@ +package net.minecraft.inventory; + +import net.minecraft.util.IChatComponent; + +public class AnimalChest extends InventoryBasic +{ + public AnimalChest(String inventoryName, int slotCount) + { + super(inventoryName, false, slotCount); + } + + public AnimalChest(IChatComponent invTitle, int slotCount) + { + super(invTitle, slotCount); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/Container.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/Container.java new file mode 100644 index 0000000..7a18f21 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/Container.java @@ -0,0 +1,720 @@ +package net.minecraft.inventory; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Set; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; + +public abstract class Container +{ + public List inventoryItemStacks = Lists.newArrayList(); + public List inventorySlots = Lists.newArrayList(); + public int windowId; + private short transactionID; + private int dragMode = -1; + private int dragEvent; + private final Set dragSlots = Sets.newHashSet(); + protected List crafters = Lists.newArrayList(); + private Set playerList = Sets.newHashSet(); + + protected Slot addSlotToContainer(Slot slotIn) + { + slotIn.slotNumber = this.inventorySlots.size(); + this.inventorySlots.add(slotIn); + this.inventoryItemStacks.add((ItemStack)null); + return slotIn; + } + + public void onCraftGuiOpened(ICrafting listener) + { + if (this.crafters.contains(listener)) + { + throw new IllegalArgumentException("Listener already listening"); + } + else + { + this.crafters.add(listener); + listener.updateCraftingInventory(this, this.getInventory()); + this.detectAndSendChanges(); + } + } + + public void removeCraftingFromCrafters(ICrafting listeners) + { + this.crafters.remove(listeners); + } + + public List getInventory() + { + List list = Lists.newArrayList(); + + for (int i = 0; i < this.inventorySlots.size(); ++i) + { + list.add(((Slot)this.inventorySlots.get(i)).getStack()); + } + + return list; + } + + public void detectAndSendChanges() + { + for (int i = 0; i < this.inventorySlots.size(); ++i) + { + ItemStack itemstack = ((Slot)this.inventorySlots.get(i)).getStack(); + ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i); + + if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) + { + itemstack1 = itemstack == null ? null : itemstack.copy(); + this.inventoryItemStacks.set(i, itemstack1); + + for (int j = 0; j < this.crafters.size(); ++j) + { + ((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1); + } + } + } + } + + public boolean enchantItem(EntityPlayer playerIn, int id) + { + return false; + } + + public Slot getSlotFromInventory(IInventory inv, int slotIn) + { + for (int i = 0; i < this.inventorySlots.size(); ++i) + { + Slot slot = (Slot)this.inventorySlots.get(i); + + if (slot.isHere(inv, slotIn)) + { + return slot; + } + } + + return null; + } + + public Slot getSlot(int slotId) + { + return (Slot)this.inventorySlots.get(slotId); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + Slot slot = (Slot)this.inventorySlots.get(index); + return slot != null ? slot.getStack() : null; + } + + public ItemStack slotClick(int slotId, int clickedButton, int mode, EntityPlayer playerIn) + { + ItemStack itemstack = null; + InventoryPlayer inventoryplayer = playerIn.inventory; + + if (mode == 5) + { + int i = this.dragEvent; + this.dragEvent = getDragEvent(clickedButton); + + if ((i != 1 || this.dragEvent != 2) && i != this.dragEvent) + { + this.resetDrag(); + } + else if (inventoryplayer.getItemStack() == null) + { + this.resetDrag(); + } + else if (this.dragEvent == 0) + { + this.dragMode = extractDragMode(clickedButton); + + if (isValidDragMode(this.dragMode, playerIn)) + { + this.dragEvent = 1; + this.dragSlots.clear(); + } + else + { + this.resetDrag(); + } + } + else if (this.dragEvent == 1) + { + Slot slot = (Slot)this.inventorySlots.get(slotId); + + if (slot != null && canAddItemToSlot(slot, inventoryplayer.getItemStack(), true) && slot.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().stackSize > this.dragSlots.size() && this.canDragIntoSlot(slot)) + { + this.dragSlots.add(slot); + } + } + else if (this.dragEvent == 2) + { + if (!this.dragSlots.isEmpty()) + { + ItemStack itemstack3 = inventoryplayer.getItemStack().copy(); + int j = inventoryplayer.getItemStack().stackSize; + + for (Slot slot1 : this.dragSlots) + { + if (slot1 != null && canAddItemToSlot(slot1, inventoryplayer.getItemStack(), true) && slot1.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().stackSize >= this.dragSlots.size() && this.canDragIntoSlot(slot1)) + { + ItemStack itemstack1 = itemstack3.copy(); + int k = slot1.getHasStack() ? slot1.getStack().stackSize : 0; + computeStackSize(this.dragSlots, this.dragMode, itemstack1, k); + + if (itemstack1.stackSize > itemstack1.getMaxStackSize()) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + + if (itemstack1.stackSize > slot1.getItemStackLimit(itemstack1)) + { + itemstack1.stackSize = slot1.getItemStackLimit(itemstack1); + } + + j -= itemstack1.stackSize - k; + slot1.putStack(itemstack1); + } + } + + itemstack3.stackSize = j; + + if (itemstack3.stackSize <= 0) + { + itemstack3 = null; + } + + inventoryplayer.setItemStack(itemstack3); + } + + this.resetDrag(); + } + else + { + this.resetDrag(); + } + } + else if (this.dragEvent != 0) + { + this.resetDrag(); + } + else if ((mode == 0 || mode == 1) && (clickedButton == 0 || clickedButton == 1)) + { + if (slotId == -999) + { + if (inventoryplayer.getItemStack() != null) + { + if (clickedButton == 0) + { + playerIn.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), true); + inventoryplayer.setItemStack((ItemStack)null); + } + + if (clickedButton == 1) + { + playerIn.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack().splitStack(1), true); + + if (inventoryplayer.getItemStack().stackSize == 0) + { + inventoryplayer.setItemStack((ItemStack)null); + } + } + } + } + else if (mode == 1) + { + if (slotId < 0) + { + return null; + } + + Slot slot6 = (Slot)this.inventorySlots.get(slotId); + + if (slot6 != null && slot6.canTakeStack(playerIn)) + { + ItemStack itemstack8 = this.transferStackInSlot(playerIn, slotId); + + if (itemstack8 != null) + { + Item item = itemstack8.getItem(); + itemstack = itemstack8.copy(); + + if (slot6.getStack() != null && slot6.getStack().getItem() == item) + { + this.retrySlotClick(slotId, clickedButton, true, playerIn); + } + } + } + } + else + { + if (slotId < 0) + { + return null; + } + + Slot slot7 = (Slot)this.inventorySlots.get(slotId); + + if (slot7 != null) + { + ItemStack itemstack9 = slot7.getStack(); + ItemStack itemstack10 = inventoryplayer.getItemStack(); + + if (itemstack9 != null) + { + itemstack = itemstack9.copy(); + } + + if (itemstack9 == null) + { + if (itemstack10 != null && slot7.isItemValid(itemstack10)) + { + int k2 = clickedButton == 0 ? itemstack10.stackSize : 1; + + if (k2 > slot7.getItemStackLimit(itemstack10)) + { + k2 = slot7.getItemStackLimit(itemstack10); + } + + if (itemstack10.stackSize >= k2) + { + slot7.putStack(itemstack10.splitStack(k2)); + } + + if (itemstack10.stackSize == 0) + { + inventoryplayer.setItemStack((ItemStack)null); + } + } + } + else if (slot7.canTakeStack(playerIn)) + { + if (itemstack10 == null) + { + int j2 = clickedButton == 0 ? itemstack9.stackSize : (itemstack9.stackSize + 1) / 2; + ItemStack itemstack12 = slot7.decrStackSize(j2); + inventoryplayer.setItemStack(itemstack12); + + if (itemstack9.stackSize == 0) + { + slot7.putStack((ItemStack)null); + } + + slot7.onPickupFromSlot(playerIn, inventoryplayer.getItemStack()); + } + else if (slot7.isItemValid(itemstack10)) + { + if (itemstack9.getItem() == itemstack10.getItem() && itemstack9.getMetadata() == itemstack10.getMetadata() && ItemStack.areItemStackTagsEqual(itemstack9, itemstack10)) + { + int i2 = clickedButton == 0 ? itemstack10.stackSize : 1; + + if (i2 > slot7.getItemStackLimit(itemstack10) - itemstack9.stackSize) + { + i2 = slot7.getItemStackLimit(itemstack10) - itemstack9.stackSize; + } + + if (i2 > itemstack10.getMaxStackSize() - itemstack9.stackSize) + { + i2 = itemstack10.getMaxStackSize() - itemstack9.stackSize; + } + + itemstack10.splitStack(i2); + + if (itemstack10.stackSize == 0) + { + inventoryplayer.setItemStack((ItemStack)null); + } + + itemstack9.stackSize += i2; + } + else if (itemstack10.stackSize <= slot7.getItemStackLimit(itemstack10)) + { + slot7.putStack(itemstack10); + inventoryplayer.setItemStack(itemstack9); + } + } + else if (itemstack9.getItem() == itemstack10.getItem() && itemstack10.getMaxStackSize() > 1 && (!itemstack9.getHasSubtypes() || itemstack9.getMetadata() == itemstack10.getMetadata()) && ItemStack.areItemStackTagsEqual(itemstack9, itemstack10)) + { + int l1 = itemstack9.stackSize; + + if (l1 > 0 && l1 + itemstack10.stackSize <= itemstack10.getMaxStackSize()) + { + itemstack10.stackSize += l1; + itemstack9 = slot7.decrStackSize(l1); + + if (itemstack9.stackSize == 0) + { + slot7.putStack((ItemStack)null); + } + + slot7.onPickupFromSlot(playerIn, inventoryplayer.getItemStack()); + } + } + } + + slot7.onSlotChanged(); + } + } + } + else if (mode == 2 && clickedButton >= 0 && clickedButton < 9) + { + Slot slot5 = (Slot)this.inventorySlots.get(slotId); + + if (slot5.canTakeStack(playerIn)) + { + ItemStack itemstack7 = inventoryplayer.getStackInSlot(clickedButton); + boolean flag = itemstack7 == null || slot5.inventory == inventoryplayer && slot5.isItemValid(itemstack7); + int k1 = -1; + + if (!flag) + { + k1 = inventoryplayer.getFirstEmptyStack(); + flag |= k1 > -1; + } + + if (slot5.getHasStack() && flag) + { + ItemStack itemstack11 = slot5.getStack(); + inventoryplayer.setInventorySlotContents(clickedButton, itemstack11.copy()); + + if ((slot5.inventory != inventoryplayer || !slot5.isItemValid(itemstack7)) && itemstack7 != null) + { + if (k1 > -1) + { + inventoryplayer.addItemStackToInventory(itemstack7); + slot5.decrStackSize(itemstack11.stackSize); + slot5.putStack((ItemStack)null); + slot5.onPickupFromSlot(playerIn, itemstack11); + } + } + else + { + slot5.decrStackSize(itemstack11.stackSize); + slot5.putStack(itemstack7); + slot5.onPickupFromSlot(playerIn, itemstack11); + } + } + else if (!slot5.getHasStack() && itemstack7 != null && slot5.isItemValid(itemstack7)) + { + inventoryplayer.setInventorySlotContents(clickedButton, (ItemStack)null); + slot5.putStack(itemstack7); + } + } + } + else if (mode == 3 && playerIn.capabilities.isCreativeMode && inventoryplayer.getItemStack() == null && slotId >= 0) + { + Slot slot4 = (Slot)this.inventorySlots.get(slotId); + + if (slot4 != null && slot4.getHasStack()) + { + ItemStack itemstack6 = slot4.getStack().copy(); + itemstack6.stackSize = itemstack6.getMaxStackSize(); + inventoryplayer.setItemStack(itemstack6); + } + } + else if (mode == 4 && inventoryplayer.getItemStack() == null && slotId >= 0) + { + Slot slot3 = (Slot)this.inventorySlots.get(slotId); + + if (slot3 != null && slot3.getHasStack() && slot3.canTakeStack(playerIn)) + { + ItemStack itemstack5 = slot3.decrStackSize(clickedButton == 0 ? 1 : slot3.getStack().stackSize); + slot3.onPickupFromSlot(playerIn, itemstack5); + playerIn.dropPlayerItemWithRandomChoice(itemstack5, true); + } + } + else if (mode == 6 && slotId >= 0) + { + Slot slot2 = (Slot)this.inventorySlots.get(slotId); + ItemStack itemstack4 = inventoryplayer.getItemStack(); + + if (itemstack4 != null && (slot2 == null || !slot2.getHasStack() || !slot2.canTakeStack(playerIn))) + { + int i1 = clickedButton == 0 ? 0 : this.inventorySlots.size() - 1; + int j1 = clickedButton == 0 ? 1 : -1; + + for (int l2 = 0; l2 < 2; ++l2) + { + for (int i3 = i1; i3 >= 0 && i3 < this.inventorySlots.size() && itemstack4.stackSize < itemstack4.getMaxStackSize(); i3 += j1) + { + Slot slot8 = (Slot)this.inventorySlots.get(i3); + + if (slot8.getHasStack() && canAddItemToSlot(slot8, itemstack4, true) && slot8.canTakeStack(playerIn) && this.canMergeSlot(itemstack4, slot8) && (l2 != 0 || slot8.getStack().stackSize != slot8.getStack().getMaxStackSize())) + { + int l = Math.min(itemstack4.getMaxStackSize() - itemstack4.stackSize, slot8.getStack().stackSize); + ItemStack itemstack2 = slot8.decrStackSize(l); + itemstack4.stackSize += l; + + if (itemstack2.stackSize <= 0) + { + slot8.putStack((ItemStack)null); + } + + slot8.onPickupFromSlot(playerIn, itemstack2); + } + } + } + } + + this.detectAndSendChanges(); + } + + return itemstack; + } + + public boolean canMergeSlot(ItemStack stack, Slot slotIn) + { + return true; + } + + protected void retrySlotClick(int slotId, int clickedButton, boolean mode, EntityPlayer playerIn) + { + this.slotClick(slotId, clickedButton, 1, playerIn); + } + + public void onContainerClosed(EntityPlayer playerIn) + { + InventoryPlayer inventoryplayer = playerIn.inventory; + + if (inventoryplayer.getItemStack() != null) + { + playerIn.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), false); + inventoryplayer.setItemStack((ItemStack)null); + } + } + + public void onCraftMatrixChanged(IInventory inventoryIn) + { + this.detectAndSendChanges(); + } + + public void putStackInSlot(int slotID, ItemStack stack) + { + this.getSlot(slotID).putStack(stack); + } + + public void putStacksInSlots(ItemStack[] p_75131_1_) + { + for (int i = 0; i < p_75131_1_.length; ++i) + { + this.getSlot(i).putStack(p_75131_1_[i]); + } + } + + public void updateProgressBar(int id, int data) + { + } + + public short getNextTransactionID(InventoryPlayer p_75136_1_) + { + ++this.transactionID; + return this.transactionID; + } + + public boolean getCanCraft(EntityPlayer p_75129_1_) + { + return !this.playerList.contains(p_75129_1_); + } + + public void setCanCraft(EntityPlayer p_75128_1_, boolean p_75128_2_) + { + if (p_75128_2_) + { + this.playerList.remove(p_75128_1_); + } + else + { + this.playerList.add(p_75128_1_); + } + } + + public abstract boolean canInteractWith(EntityPlayer playerIn); + + protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) + { + boolean flag = false; + int i = startIndex; + + if (reverseDirection) + { + i = endIndex - 1; + } + + if (stack.isStackable()) + { + while (stack.stackSize > 0 && (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex)) + { + Slot slot = (Slot)this.inventorySlots.get(i); + ItemStack itemstack = slot.getStack(); + + if (itemstack != null && itemstack.getItem() == stack.getItem() && (!stack.getHasSubtypes() || stack.getMetadata() == itemstack.getMetadata()) && ItemStack.areItemStackTagsEqual(stack, itemstack)) + { + int j = itemstack.stackSize + stack.stackSize; + + if (j <= stack.getMaxStackSize()) + { + stack.stackSize = 0; + itemstack.stackSize = j; + slot.onSlotChanged(); + flag = true; + } + else if (itemstack.stackSize < stack.getMaxStackSize()) + { + stack.stackSize -= stack.getMaxStackSize() - itemstack.stackSize; + itemstack.stackSize = stack.getMaxStackSize(); + slot.onSlotChanged(); + flag = true; + } + } + + if (reverseDirection) + { + --i; + } + else + { + ++i; + } + } + } + + if (stack.stackSize > 0) + { + if (reverseDirection) + { + i = endIndex - 1; + } + else + { + i = startIndex; + } + + while (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex) + { + Slot slot1 = (Slot)this.inventorySlots.get(i); + ItemStack itemstack1 = slot1.getStack(); + + if (itemstack1 == null) + { + slot1.putStack(stack.copy()); + slot1.onSlotChanged(); + stack.stackSize = 0; + flag = true; + break; + } + + if (reverseDirection) + { + --i; + } + else + { + ++i; + } + } + } + + return flag; + } + + public static int extractDragMode(int p_94529_0_) + { + return p_94529_0_ >> 2 & 3; + } + + public static int getDragEvent(int p_94532_0_) + { + return p_94532_0_ & 3; + } + + public static int func_94534_d(int p_94534_0_, int p_94534_1_) + { + return p_94534_0_ & 3 | (p_94534_1_ & 3) << 2; + } + + public static boolean isValidDragMode(int dragModeIn, EntityPlayer player) + { + return dragModeIn == 0 ? true : (dragModeIn == 1 ? true : dragModeIn == 2 && player.capabilities.isCreativeMode); + } + + protected void resetDrag() + { + this.dragEvent = 0; + this.dragSlots.clear(); + } + + public static boolean canAddItemToSlot(Slot slotIn, ItemStack stack, boolean stackSizeMatters) + { + boolean flag = slotIn == null || !slotIn.getHasStack(); + + if (slotIn != null && slotIn.getHasStack() && stack != null && stack.isItemEqual(slotIn.getStack()) && ItemStack.areItemStackTagsEqual(slotIn.getStack(), stack)) + { + flag |= slotIn.getStack().stackSize + (stackSizeMatters ? 0 : stack.stackSize) <= stack.getMaxStackSize(); + } + + return flag; + } + + public static void computeStackSize(Set p_94525_0_, int p_94525_1_, ItemStack p_94525_2_, int p_94525_3_) + { + switch (p_94525_1_) + { + case 0: + p_94525_2_.stackSize = MathHelper.floor_float((float)p_94525_2_.stackSize / (float)p_94525_0_.size()); + break; + + case 1: + p_94525_2_.stackSize = 1; + break; + + case 2: + p_94525_2_.stackSize = p_94525_2_.getItem().getItemStackLimit(); + } + + p_94525_2_.stackSize += p_94525_3_; + } + + public boolean canDragIntoSlot(Slot p_94531_1_) + { + return true; + } + + public static int calcRedstone(TileEntity te) + { + return te instanceof IInventory ? calcRedstoneFromInventory((IInventory)te) : 0; + } + + public static int calcRedstoneFromInventory(IInventory inv) + { + if (inv == null) + { + return 0; + } + else + { + int i = 0; + float f = 0.0F; + + for (int j = 0; j < inv.getSizeInventory(); ++j) + { + ItemStack itemstack = inv.getStackInSlot(j); + + if (itemstack != null) + { + f += (float)itemstack.stackSize / (float)Math.min(inv.getInventoryStackLimit(), itemstack.getMaxStackSize()); + ++i; + } + } + + f = f / (float)inv.getSizeInventory(); + return MathHelper.floor_float(f * 14.0F) + (i > 0 ? 1 : 0); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerBeacon.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerBeacon.java new file mode 100644 index 0000000..aa6a545 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerBeacon.java @@ -0,0 +1,151 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class ContainerBeacon extends Container +{ + private IInventory tileBeacon; + private final ContainerBeacon.BeaconSlot beaconSlot; + + public ContainerBeacon(IInventory playerInventory, IInventory tileBeaconIn) + { + this.tileBeacon = tileBeaconIn; + this.addSlotToContainer(this.beaconSlot = new ContainerBeacon.BeaconSlot(tileBeaconIn, 0, 136, 110)); + int i = 36; + int j = 137; + + for (int k = 0; k < 3; ++k) + { + for (int l = 0; l < 9; ++l) + { + this.addSlotToContainer(new Slot(playerInventory, l + k * 9 + 9, i + l * 18, j + k * 18)); + } + } + + for (int i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(playerInventory, i1, i + i1 * 18, 58 + j)); + } + } + + public void onCraftGuiOpened(ICrafting listener) + { + super.onCraftGuiOpened(listener); + listener.sendAllWindowProperties(this, this.tileBeacon); + } + + public void updateProgressBar(int id, int data) + { + this.tileBeacon.setField(id, data); + } + + public IInventory func_180611_e() + { + return this.tileBeacon; + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + + if (playerIn != null && !playerIn.worldObj.isRemote) + { + ItemStack itemstack = this.beaconSlot.decrStackSize(this.beaconSlot.getSlotStackLimit()); + + if (itemstack != null) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.tileBeacon.isUseableByPlayer(playerIn); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 1, 37, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(itemstack1) && itemstack1.stackSize == 1) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (index >= 1 && index < 28) + { + if (!this.mergeItemStack(itemstack1, 28, 37, false)) + { + return null; + } + } + else if (index >= 28 && index < 37) + { + if (!this.mergeItemStack(itemstack1, 1, 28, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 1, 37, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } + + class BeaconSlot extends Slot + { + public BeaconSlot(IInventory p_i1801_2_, int p_i1801_3_, int p_i1801_4_, int p_i1801_5_) + { + super(p_i1801_2_, p_i1801_3_, p_i1801_4_, p_i1801_5_); + } + + public boolean isItemValid(ItemStack stack) + { + return stack == null ? false : stack.getItem() == Items.emerald || stack.getItem() == Items.diamond || stack.getItem() == Items.gold_ingot || stack.getItem() == Items.iron_ingot; + } + + public int getSlotStackLimit() + { + return 1; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java new file mode 100644 index 0000000..ea89619 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java @@ -0,0 +1,198 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.AchievementList; + +public class ContainerBrewingStand extends Container +{ + private IInventory tileBrewingStand; + private final Slot theSlot; + private int brewTime; + + public ContainerBrewingStand(InventoryPlayer playerInventory, IInventory tileBrewingStandIn) + { + this.tileBrewingStand = tileBrewingStandIn; + this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 0, 56, 46)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 1, 79, 53)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 2, 102, 46)); + this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(tileBrewingStandIn, 3, 79, 17)); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + } + + public void onCraftGuiOpened(ICrafting listener) + { + super.onCraftGuiOpened(listener); + listener.sendAllWindowProperties(this, this.tileBrewingStand); + } + + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.brewTime != this.tileBrewingStand.getField(0)) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getField(0)); + } + } + + this.brewTime = this.tileBrewingStand.getField(0); + } + + public void updateProgressBar(int id, int data) + { + this.tileBrewingStand.setField(id, data); + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.tileBrewingStand.isUseableByPlayer(playerIn); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if ((index < 0 || index > 2) && index != 3) + { + if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 3, 4, false)) + { + return null; + } + } + else if (ContainerBrewingStand.Potion.canHoldPotion(itemstack)) + { + if (!this.mergeItemStack(itemstack1, 0, 3, false)) + { + return null; + } + } + else if (index >= 4 && index < 31) + { + if (!this.mergeItemStack(itemstack1, 31, 40, false)) + { + return null; + } + } + else if (index >= 31 && index < 40) + { + if (!this.mergeItemStack(itemstack1, 4, 31, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 4, 40, false)) + { + return null; + } + } + else + { + if (!this.mergeItemStack(itemstack1, 4, 40, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } + + class Ingredient extends Slot + { + public Ingredient(IInventory inventoryIn, int index, int xPosition, int yPosition) + { + super(inventoryIn, index, xPosition, yPosition); + } + + public boolean isItemValid(ItemStack stack) + { + return stack != null ? stack.getItem().isPotionIngredient(stack) : false; + } + + public int getSlotStackLimit() + { + return 64; + } + } + + static class Potion extends Slot + { + private EntityPlayer player; + + public Potion(EntityPlayer playerIn, IInventory inventoryIn, int index, int xPosition, int yPosition) + { + super(inventoryIn, index, xPosition, yPosition); + this.player = playerIn; + } + + public boolean isItemValid(ItemStack stack) + { + return canHoldPotion(stack); + } + + public int getSlotStackLimit() + { + return 1; + } + + public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + { + if (stack.getItem() == Items.potionitem && stack.getMetadata() > 0) + { + this.player.triggerAchievement(AchievementList.potion); + } + + super.onPickupFromSlot(playerIn, stack); + } + + public static boolean canHoldPotion(ItemStack stack) + { + return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerChest.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerChest.java new file mode 100644 index 0000000..876a371 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerChest.java @@ -0,0 +1,90 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ContainerChest extends Container +{ + private IInventory lowerChestInventory; + private int numRows; + + public ContainerChest(IInventory playerInventory, IInventory chestInventory, EntityPlayer player) + { + this.lowerChestInventory = chestInventory; + this.numRows = chestInventory.getSizeInventory() / 9; + chestInventory.openInventory(player); + int i = (this.numRows - 4) * 18; + + for (int j = 0; j < this.numRows; ++j) + { + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(chestInventory, k + j * 9, 8 + k * 18, 18 + j * 18)); + } + } + + for (int l = 0; l < 3; ++l) + { + for (int j1 = 0; j1 < 9; ++j1) + { + this.addSlotToContainer(new Slot(playerInventory, j1 + l * 9 + 9, 8 + j1 * 18, 103 + l * 18 + i)); + } + } + + for (int i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 161 + i)); + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.lowerChestInventory.isUseableByPlayer(playerIn); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < this.numRows * 9) + { + if (!this.mergeItemStack(itemstack1, this.numRows * 9, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 0, this.numRows * 9, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + this.lowerChestInventory.closeInventory(playerIn); + } + + public IInventory getLowerChestInventory() + { + return this.lowerChestInventory; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerDispenser.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerDispenser.java new file mode 100644 index 0000000..c4b746d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerDispenser.java @@ -0,0 +1,82 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ContainerDispenser extends Container +{ + private IInventory dispenserInventory; + + public ContainerDispenser(IInventory playerInventory, IInventory dispenserInventoryIn) + { + this.dispenserInventory = dispenserInventoryIn; + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 3; ++j) + { + this.addSlotToContainer(new Slot(dispenserInventoryIn, j + i * 3, 62 + j * 18, 17 + i * 18)); + } + } + + for (int k = 0; k < 3; ++k) + { + for (int i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18)); + } + } + + for (int l = 0; l < 9; ++l) + { + this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142)); + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.dispenserInventory.isUseableByPlayer(playerIn); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < 9) + { + if (!this.mergeItemStack(itemstack1, 9, 45, true)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 0, 9, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerEnchantment.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerEnchantment.java new file mode 100644 index 0000000..1b77d2a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerEnchantment.java @@ -0,0 +1,405 @@ +package net.minecraft.inventory; + +import java.util.List; +import java.util.Random; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class ContainerEnchantment extends Container +{ + public IInventory tableInventory; + private World worldPointer; + private BlockPos position; + private Random rand; + public int xpSeed; + public int[] enchantLevels; + public int[] enchantmentIds; + + public ContainerEnchantment(InventoryPlayer playerInv, World worldIn) + { + this(playerInv, worldIn, BlockPos.ORIGIN); + } + + public ContainerEnchantment(InventoryPlayer playerInv, World worldIn, BlockPos pos) + { + this.tableInventory = new InventoryBasic("Enchant", true, 2) + { + public int getInventoryStackLimit() + { + return 64; + } + public void markDirty() + { + super.markDirty(); + ContainerEnchantment.this.onCraftMatrixChanged(this); + } + }; + this.rand = new Random(); + this.enchantLevels = new int[3]; + this.enchantmentIds = new int[] { -1, -1, -1}; + this.worldPointer = worldIn; + this.position = pos; + this.xpSeed = playerInv.player.getXPSeed(); + this.addSlotToContainer(new Slot(this.tableInventory, 0, 15, 47) + { + public boolean isItemValid(ItemStack stack) + { + return true; + } + public int getSlotStackLimit() + { + return 1; + } + }); + this.addSlotToContainer(new Slot(this.tableInventory, 1, 35, 47) + { + public boolean isItemValid(ItemStack stack) + { + return stack.getItem() == Items.dye && EnumDyeColor.byDyeDamage(stack.getMetadata()) == EnumDyeColor.BLUE; + } + }); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(playerInv, k, 8 + k * 18, 142)); + } + } + + public void onCraftGuiOpened(ICrafting listener) + { + super.onCraftGuiOpened(listener); + listener.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + listener.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + listener.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + listener.sendProgressBarUpdate(this, 3, this.xpSeed & -16); + listener.sendProgressBarUpdate(this, 4, this.enchantmentIds[0]); + listener.sendProgressBarUpdate(this, 5, this.enchantmentIds[1]); + listener.sendProgressBarUpdate(this, 6, this.enchantmentIds[2]); + } + + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + icrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + icrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + icrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + icrafting.sendProgressBarUpdate(this, 3, this.xpSeed & -16); + icrafting.sendProgressBarUpdate(this, 4, this.enchantmentIds[0]); + icrafting.sendProgressBarUpdate(this, 5, this.enchantmentIds[1]); + icrafting.sendProgressBarUpdate(this, 6, this.enchantmentIds[2]); + } + } + + public void updateProgressBar(int id, int data) + { + if (id >= 0 && id <= 2) + { + this.enchantLevels[id] = data; + } + else if (id == 3) + { + this.xpSeed = data; + } + else if (id >= 4 && id <= 6) + { + this.enchantmentIds[id - 4] = data; + } + else + { + super.updateProgressBar(id, data); + } + } + + public void onCraftMatrixChanged(IInventory inventoryIn) + { + if (inventoryIn == this.tableInventory) + { + ItemStack itemstack = inventoryIn.getStackInSlot(0); + + if (itemstack != null && itemstack.isItemEnchantable()) + { + if (!this.worldPointer.isRemote) + { + int l = 0; + + for (int j = -1; j <= 1; ++j) + { + for (int k = -1; k <= 1; ++k) + { + if ((j != 0 || k != 0) && this.worldPointer.isAirBlock(this.position.add(k, 0, j)) && this.worldPointer.isAirBlock(this.position.add(k, 1, j))) + { + if (this.worldPointer.getBlockState(this.position.add(k * 2, 0, j * 2)).getBlock() == Blocks.bookshelf) + { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k * 2, 1, j * 2)).getBlock() == Blocks.bookshelf) + { + ++l; + } + + if (k != 0 && j != 0) + { + if (this.worldPointer.getBlockState(this.position.add(k * 2, 0, j)).getBlock() == Blocks.bookshelf) + { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k * 2, 1, j)).getBlock() == Blocks.bookshelf) + { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k, 0, j * 2)).getBlock() == Blocks.bookshelf) + { + ++l; + } + + if (this.worldPointer.getBlockState(this.position.add(k, 1, j * 2)).getBlock() == Blocks.bookshelf) + { + ++l; + } + } + } + } + } + + this.rand.setSeed((long)this.xpSeed); + + for (int i1 = 0; i1 < 3; ++i1) + { + this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, l, itemstack); + this.enchantmentIds[i1] = -1; + + if (this.enchantLevels[i1] < i1 + 1) + { + this.enchantLevels[i1] = 0; + } + } + + for (int j1 = 0; j1 < 3; ++j1) + { + if (this.enchantLevels[j1] > 0) + { + List list = this.func_178148_a(itemstack, j1, this.enchantLevels[j1]); + + if (list != null && !list.isEmpty()) + { + EnchantmentData enchantmentdata = (EnchantmentData)list.get(this.rand.nextInt(list.size())); + this.enchantmentIds[j1] = enchantmentdata.enchantmentobj.effectId | enchantmentdata.enchantmentLevel << 8; + } + } + } + + this.detectAndSendChanges(); + } + } + else + { + for (int i = 0; i < 3; ++i) + { + this.enchantLevels[i] = 0; + this.enchantmentIds[i] = -1; + } + } + } + } + + public boolean enchantItem(EntityPlayer playerIn, int id) + { + ItemStack itemstack = this.tableInventory.getStackInSlot(0); + ItemStack itemstack1 = this.tableInventory.getStackInSlot(1); + int i = id + 1; + + if ((itemstack1 == null || itemstack1.stackSize < i) && !playerIn.capabilities.isCreativeMode) + { + return false; + } + else if (this.enchantLevels[id] > 0 && itemstack != null && (playerIn.experienceLevel >= i && playerIn.experienceLevel >= this.enchantLevels[id] || playerIn.capabilities.isCreativeMode)) + { + if (!this.worldPointer.isRemote) + { + List list = this.func_178148_a(itemstack, id, this.enchantLevels[id]); + boolean flag = itemstack.getItem() == Items.book; + + if (list != null) + { + playerIn.removeExperienceLevel(i); + + if (flag) + { + itemstack.setItem(Items.enchanted_book); + } + + for (int j = 0; j < list.size(); ++j) + { + EnchantmentData enchantmentdata = (EnchantmentData)list.get(j); + + if (flag) + { + Items.enchanted_book.addEnchantment(itemstack, enchantmentdata); + } + else + { + itemstack.addEnchantment(enchantmentdata.enchantmentobj, enchantmentdata.enchantmentLevel); + } + } + + if (!playerIn.capabilities.isCreativeMode) + { + itemstack1.stackSize -= i; + + if (itemstack1.stackSize <= 0) + { + this.tableInventory.setInventorySlotContents(1, (ItemStack)null); + } + } + + playerIn.triggerAchievement(StatList.field_181739_W); + this.tableInventory.markDirty(); + this.xpSeed = playerIn.getXPSeed(); + this.onCraftMatrixChanged(this.tableInventory); + } + } + + return true; + } + else + { + return false; + } + } + + private List func_178148_a(ItemStack stack, int p_178148_2_, int p_178148_3_) + { + this.rand.setSeed((long)(this.xpSeed + p_178148_2_)); + List list = EnchantmentHelper.buildEnchantmentList(this.rand, stack, p_178148_3_); + + if (stack.getItem() == Items.book && list != null && list.size() > 1) + { + list.remove(this.rand.nextInt(list.size())); + } + + return list; + } + + public int getLapisAmount() + { + ItemStack itemstack = this.tableInventory.getStackInSlot(1); + return itemstack == null ? 0 : itemstack.stackSize; + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + + if (!this.worldPointer.isRemote) + { + for (int i = 0; i < this.tableInventory.getSizeInventory(); ++i) + { + ItemStack itemstack = this.tableInventory.removeStackFromSlot(i); + + if (itemstack != null) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.worldPointer.getBlockState(this.position).getBlock() != Blocks.enchanting_table ? false : playerIn.getDistanceSq((double)this.position.getX() + 0.5D, (double)this.position.getY() + 0.5D, (double)this.position.getZ() + 0.5D) <= 64.0D; + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) + { + return null; + } + } + else if (index == 1) + { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) + { + return null; + } + } + else if (itemstack1.getItem() == Items.dye && EnumDyeColor.byDyeDamage(itemstack1.getMetadata()) == EnumDyeColor.BLUE) + { + if (!this.mergeItemStack(itemstack1, 1, 2, true)) + { + return null; + } + } + else + { + if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(itemstack1)) + { + return null; + } + + if (itemstack1.hasTagCompound() && itemstack1.stackSize == 1) + { + ((Slot)this.inventorySlots.get(0)).putStack(itemstack1.copy()); + itemstack1.stackSize = 0; + } + else if (itemstack1.stackSize >= 1) + { + ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getMetadata())); + --itemstack1.stackSize; + } + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerFurnace.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerFurnace.java new file mode 100644 index 0000000..bb8954a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerFurnace.java @@ -0,0 +1,160 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.tileentity.TileEntityFurnace; + +public class ContainerFurnace extends Container +{ + private final IInventory tileFurnace; + private int cookTime; + private int totalCookTime; + private int furnaceBurnTime; + private int currentItemBurnTime; + + public ContainerFurnace(InventoryPlayer playerInventory, IInventory furnaceInventory) + { + this.tileFurnace = furnaceInventory; + this.addSlotToContainer(new Slot(furnaceInventory, 0, 56, 17)); + this.addSlotToContainer(new SlotFurnaceFuel(furnaceInventory, 1, 56, 53)); + this.addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, furnaceInventory, 2, 116, 35)); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + } + + public void onCraftGuiOpened(ICrafting listener) + { + super.onCraftGuiOpened(listener); + listener.sendAllWindowProperties(this, this.tileFurnace); + } + + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.cookTime != this.tileFurnace.getField(2)) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.getField(2)); + } + + if (this.furnaceBurnTime != this.tileFurnace.getField(0)) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.getField(0)); + } + + if (this.currentItemBurnTime != this.tileFurnace.getField(1)) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.getField(1)); + } + + if (this.totalCookTime != this.tileFurnace.getField(3)) + { + icrafting.sendProgressBarUpdate(this, 3, this.tileFurnace.getField(3)); + } + } + + this.cookTime = this.tileFurnace.getField(2); + this.furnaceBurnTime = this.tileFurnace.getField(0); + this.currentItemBurnTime = this.tileFurnace.getField(1); + this.totalCookTime = this.tileFurnace.getField(3); + } + + public void updateProgressBar(int id, int data) + { + this.tileFurnace.setField(id, data); + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.tileFurnace.isUseableByPlayer(playerIn); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index != 1 && index != 0) + { + if (FurnaceRecipes.instance().getSmeltingResult(itemstack1) != null) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (TileEntityFurnace.isItemFuel(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (index >= 3 && index < 30) + { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) + { + return null; + } + } + else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerHopper.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerHopper.java new file mode 100644 index 0000000..52f1b46 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerHopper.java @@ -0,0 +1,81 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class ContainerHopper extends Container +{ + private final IInventory hopperInventory; + + public ContainerHopper(InventoryPlayer playerInventory, IInventory hopperInventoryIn, EntityPlayer player) + { + this.hopperInventory = hopperInventoryIn; + hopperInventoryIn.openInventory(player); + int i = 51; + + for (int j = 0; j < hopperInventoryIn.getSizeInventory(); ++j) + { + this.addSlotToContainer(new Slot(hopperInventoryIn, j, 44 + j * 18, 20)); + } + + for (int l = 0; l < 3; ++l) + { + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(playerInventory, k + l * 9 + 9, 8 + k * 18, l * 18 + i)); + } + } + + for (int i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 58 + i)); + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.hopperInventory.isUseableByPlayer(playerIn); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < this.hopperInventory.getSizeInventory()) + { + if (!this.mergeItemStack(itemstack1, this.hopperInventory.getSizeInventory(), this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 0, this.hopperInventory.getSizeInventory(), false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + this.hopperInventory.closeInventory(playerIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java new file mode 100644 index 0000000..3faff19 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java @@ -0,0 +1,123 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class ContainerHorseInventory extends Container +{ + private IInventory horseInventory; + private EntityHorse theHorse; + + public ContainerHorseInventory(IInventory playerInventory, final IInventory horseInventoryIn, final EntityHorse horse, EntityPlayer player) + { + this.horseInventory = horseInventoryIn; + this.theHorse = horse; + int i = 3; + horseInventoryIn.openInventory(player); + int j = (i - 4) * 18; + this.addSlotToContainer(new Slot(horseInventoryIn, 0, 8, 18) + { + public boolean isItemValid(ItemStack stack) + { + return super.isItemValid(stack) && stack.getItem() == Items.saddle && !this.getHasStack(); + } + }); + this.addSlotToContainer(new Slot(horseInventoryIn, 1, 8, 36) + { + public boolean isItemValid(ItemStack stack) + { + return super.isItemValid(stack) && horse.canWearArmor() && EntityHorse.isArmorItem(stack.getItem()); + } + public boolean canBeHovered() + { + return horse.canWearArmor(); + } + }); + + if (horse.isChested()) + { + for (int k = 0; k < i; ++k) + { + for (int l = 0; l < 5; ++l) + { + this.addSlotToContainer(new Slot(horseInventoryIn, 2 + l + k * 5, 80 + l * 18, 18 + k * 18)); + } + } + } + + for (int i1 = 0; i1 < 3; ++i1) + { + for (int k1 = 0; k1 < 9; ++k1) + { + this.addSlotToContainer(new Slot(playerInventory, k1 + i1 * 9 + 9, 8 + k1 * 18, 102 + i1 * 18 + j)); + } + } + + for (int j1 = 0; j1 < 9; ++j1) + { + this.addSlotToContainer(new Slot(playerInventory, j1, 8 + j1 * 18, 160 + j)); + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.horseInventory.isUseableByPlayer(playerIn) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(playerIn) < 8.0F; + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < this.horseInventory.getSizeInventory()) + { + if (!this.mergeItemStack(itemstack1, this.horseInventory.getSizeInventory(), this.inventorySlots.size(), true)) + { + return null; + } + } + else if (this.getSlot(1).isItemValid(itemstack1) && !this.getSlot(1).getHasStack()) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (this.getSlot(0).isItemValid(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (this.horseInventory.getSizeInventory() <= 2 || !this.mergeItemStack(itemstack1, 2, this.horseInventory.getSizeInventory(), false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + this.horseInventory.closeInventory(playerIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerMerchant.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerMerchant.java new file mode 100644 index 0000000..8c86f5f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerMerchant.java @@ -0,0 +1,154 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ContainerMerchant extends Container +{ + private IMerchant theMerchant; + private InventoryMerchant merchantInventory; + private final World theWorld; + + public ContainerMerchant(InventoryPlayer playerInventory, IMerchant merchant, World worldIn) + { + this.theMerchant = merchant; + this.theWorld = worldIn; + this.merchantInventory = new InventoryMerchant(playerInventory.player, merchant); + this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53)); + this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53)); + this.addSlotToContainer(new SlotMerchantResult(playerInventory.player, merchant, this.merchantInventory, 2, 120, 53)); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + } + + public InventoryMerchant getMerchantInventory() + { + return this.merchantInventory; + } + + public void onCraftGuiOpened(ICrafting listener) + { + super.onCraftGuiOpened(listener); + } + + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + } + + public void onCraftMatrixChanged(IInventory inventoryIn) + { + this.merchantInventory.resetRecipeAndSlots(); + super.onCraftMatrixChanged(inventoryIn); + } + + public void setCurrentRecipeIndex(int currentRecipeIndex) + { + this.merchantInventory.setCurrentRecipeIndex(currentRecipeIndex); + } + + public void updateProgressBar(int id, int data) + { + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.theMerchant.getCustomer() == playerIn; + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index != 0 && index != 1) + { + if (index >= 3 && index < 30) + { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) + { + return null; + } + } + else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + this.theMerchant.setCustomer((EntityPlayer)null); + super.onContainerClosed(playerIn); + + if (!this.theWorld.isRemote) + { + ItemStack itemstack = this.merchantInventory.removeStackFromSlot(0); + + if (itemstack != null) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + + itemstack = this.merchantInventory.removeStackFromSlot(1); + + if (itemstack != null) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerPlayer.java new file mode 100644 index 0000000..a67d029 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerPlayer.java @@ -0,0 +1,181 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; + +public class ContainerPlayer extends Container +{ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2); + public IInventory craftResult = new InventoryCraftResult(); + public boolean isLocalWorld; + private final EntityPlayer thePlayer; + + public ContainerPlayer(final InventoryPlayer playerInventory, boolean localWorld, EntityPlayer player) + { + this.isLocalWorld = localWorld; + this.thePlayer = player; + this.addSlotToContainer(new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 144, 36)); + + for (int i = 0; i < 2; ++i) + { + for (int j = 0; j < 2; ++j) + { + this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 2, 88 + j * 18, 26 + i * 18)); + } + } + + for (int k = 0; k < 4; ++k) + { + final int k_f = k; + this.addSlotToContainer(new Slot(playerInventory, playerInventory.getSizeInventory() - 1 - k, 8, 8 + k * 18) + { + public int getSlotStackLimit() + { + return 1; + } + public boolean isItemValid(ItemStack stack) + { + return stack == null ? false : (stack.getItem() instanceof ItemArmor ? ((ItemArmor)stack.getItem()).armorType == k_f : (stack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull ? false : k_f == 0)); + } + public String getSlotTexture() + { + return ItemArmor.EMPTY_SLOT_NAMES[k_f]; + } + }); + } + + for (int l = 0; l < 3; ++l) + { + for (int j1 = 0; j1 < 9; ++j1) + { + this.addSlotToContainer(new Slot(playerInventory, j1 + (l + 1) * 9, 8 + j1 * 18, 84 + l * 18)); + } + } + + for (int i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + public void onCraftMatrixChanged(IInventory inventoryIn) + { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj)); + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + + for (int i = 0; i < 4; ++i) + { + ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i); + + if (itemstack != null) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + + this.craftResult.setInventorySlotContents(0, (ItemStack)null); + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return true; + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 9, 45, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index >= 1 && index < 5) + { + if (!this.mergeItemStack(itemstack1, 9, 45, false)) + { + return null; + } + } + else if (index >= 5 && index < 9) + { + if (!this.mergeItemStack(itemstack1, 9, 45, false)) + { + return null; + } + } + else if (itemstack.getItem() instanceof ItemArmor && !((Slot)this.inventorySlots.get(5 + ((ItemArmor)itemstack.getItem()).armorType)).getHasStack()) + { + int i = 5 + ((ItemArmor)itemstack.getItem()).armorType; + + if (!this.mergeItemStack(itemstack1, i, i + 1, false)) + { + return null; + } + } + else if (index >= 9 && index < 36) + { + if (!this.mergeItemStack(itemstack1, 36, 45, false)) + { + return null; + } + } + else if (index >= 36 && index < 45) + { + if (!this.mergeItemStack(itemstack1, 9, 36, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 9, 45, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } + + public boolean canMergeSlot(ItemStack stack, Slot slotIn) + { + return slotIn.inventory != this.craftResult && super.canMergeSlot(stack, slotIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerRepair.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerRepair.java new file mode 100644 index 0000000..e6605b9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerRepair.java @@ -0,0 +1,479 @@ +package net.minecraft.inventory; + +import java.util.Iterator; +import java.util.Map; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.state.IBlockState; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ContainerRepair extends Container +{ + private static final Logger logger = LogManager.getLogger(); + private IInventory outputSlot; + private IInventory inputSlots; + private World theWorld; + private BlockPos selfPosition; + public int maximumCost; + private int materialCost; + private String repairedItemName; + private final EntityPlayer thePlayer; + + public ContainerRepair(InventoryPlayer playerInventory, World worldIn, EntityPlayer player) + { + this(playerInventory, worldIn, BlockPos.ORIGIN, player); + } + + public ContainerRepair(InventoryPlayer playerInventory, final World worldIn, final BlockPos blockPosIn, EntityPlayer player) + { + this.outputSlot = new InventoryCraftResult(); + this.inputSlots = new InventoryBasic("Repair", true, 2) + { + public void markDirty() + { + super.markDirty(); + ContainerRepair.this.onCraftMatrixChanged(this); + } + }; + this.selfPosition = blockPosIn; + this.theWorld = worldIn; + this.thePlayer = player; + this.addSlotToContainer(new Slot(this.inputSlots, 0, 27, 47)); + this.addSlotToContainer(new Slot(this.inputSlots, 1, 76, 47)); + this.addSlotToContainer(new Slot(this.outputSlot, 2, 134, 47) + { + public boolean isItemValid(ItemStack stack) + { + return false; + } + public boolean canTakeStack(EntityPlayer playerIn) + { + return (playerIn.capabilities.isCreativeMode || playerIn.experienceLevel >= ContainerRepair.this.maximumCost) && ContainerRepair.this.maximumCost > 0 && this.getHasStack(); + } + public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + { + if (!playerIn.capabilities.isCreativeMode) + { + playerIn.addExperienceLevel(-ContainerRepair.this.maximumCost); + } + + ContainerRepair.this.inputSlots.setInventorySlotContents(0, (ItemStack)null); + + if (ContainerRepair.this.materialCost > 0) + { + ItemStack itemstack = ContainerRepair.this.inputSlots.getStackInSlot(1); + + if (itemstack != null && itemstack.stackSize > ContainerRepair.this.materialCost) + { + itemstack.stackSize -= ContainerRepair.this.materialCost; + ContainerRepair.this.inputSlots.setInventorySlotContents(1, itemstack); + } + else + { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack)null); + } + } + else + { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack)null); + } + + ContainerRepair.this.maximumCost = 0; + IBlockState iblockstate = worldIn.getBlockState(blockPosIn); + + if (!playerIn.capabilities.isCreativeMode && !worldIn.isRemote && iblockstate.getBlock() == Blocks.anvil && playerIn.getRNG().nextFloat() < 0.12F) + { + int l = ((Integer)iblockstate.getValue(BlockAnvil.DAMAGE)).intValue(); + ++l; + + if (l > 2) + { + worldIn.setBlockToAir(blockPosIn); + worldIn.playAuxSFX(1020, blockPosIn, 0); + } + else + { + worldIn.setBlockState(blockPosIn, iblockstate.withProperty(BlockAnvil.DAMAGE, Integer.valueOf(l)), 2); + worldIn.playAuxSFX(1021, blockPosIn, 0); + } + } + else if (!worldIn.isRemote) + { + worldIn.playAuxSFX(1021, blockPosIn, 0); + } + } + }); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } + } + + public void onCraftMatrixChanged(IInventory inventoryIn) + { + super.onCraftMatrixChanged(inventoryIn); + + if (inventoryIn == this.inputSlots) + { + this.updateRepairOutput(); + } + } + + public void updateRepairOutput() + { + int i = 0; + int j = 1; + int k = 1; + int l = 1; + int i1 = 2; + int j1 = 1; + int k1 = 1; + ItemStack itemstack = this.inputSlots.getStackInSlot(0); + this.maximumCost = 1; + int l1 = 0; + int i2 = 0; + int j2 = 0; + + if (itemstack == null) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + } + else + { + ItemStack itemstack1 = itemstack.copy(); + ItemStack itemstack2 = this.inputSlots.getStackInSlot(1); + Map map = EnchantmentHelper.getEnchantments(itemstack1); + boolean flag = false; + i2 = i2 + itemstack.getRepairCost() + (itemstack2 == null ? 0 : itemstack2.getRepairCost()); + this.materialCost = 0; + + if (itemstack2 != null) + { + flag = itemstack2.getItem() == Items.enchanted_book && Items.enchanted_book.getEnchantments(itemstack2).tagCount() > 0; + + if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) + { + int j4 = Math.min(itemstack1.getItemDamage(), itemstack1.getMaxDamage() / 4); + + if (j4 <= 0) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + return; + } + + int l4; + + for (l4 = 0; j4 > 0 && l4 < itemstack2.stackSize; ++l4) + { + int j5 = itemstack1.getItemDamage() - j4; + itemstack1.setItemDamage(j5); + ++l1; + j4 = Math.min(itemstack1.getItemDamage(), itemstack1.getMaxDamage() / 4); + } + + this.materialCost = l4; + } + else + { + if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.isItemStackDamageable())) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + return; + } + + if (itemstack1.isItemStackDamageable() && !flag) + { + int k2 = itemstack.getMaxDamage() - itemstack.getItemDamage(); + int l2 = itemstack2.getMaxDamage() - itemstack2.getItemDamage(); + int i3 = l2 + itemstack1.getMaxDamage() * 12 / 100; + int j3 = k2 + i3; + int k3 = itemstack1.getMaxDamage() - j3; + + if (k3 < 0) + { + k3 = 0; + } + + if (k3 < itemstack1.getMetadata()) + { + itemstack1.setItemDamage(k3); + l1 += 2; + } + } + + Map map1 = EnchantmentHelper.getEnchantments(itemstack2); + Iterator iterator1 = map1.keySet().iterator(); + + while (iterator1.hasNext()) + { + int i5 = ((Integer)iterator1.next()).intValue(); + Enchantment enchantment = Enchantment.getEnchantmentById(i5); + + if (enchantment != null) + { + int k5 = map.containsKey(Integer.valueOf(i5)) ? ((Integer)map.get(Integer.valueOf(i5))).intValue() : 0; + int l3 = ((Integer)map1.get(Integer.valueOf(i5))).intValue(); + int i6; + + if (k5 == l3) + { + ++l3; + i6 = l3; + } + else + { + i6 = Math.max(l3, k5); + } + + l3 = i6; + boolean flag1 = enchantment.canApply(itemstack); + + if (this.thePlayer.capabilities.isCreativeMode || itemstack.getItem() == Items.enchanted_book) + { + flag1 = true; + } + + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) + { + int i4 = ((Integer)iterator.next()).intValue(); + + if (i4 != i5 && !enchantment.canApplyTogether(Enchantment.getEnchantmentById(i4))) + { + flag1 = false; + ++l1; + } + } + + if (flag1) + { + if (l3 > enchantment.getMaxLevel()) + { + l3 = enchantment.getMaxLevel(); + } + + map.put(Integer.valueOf(i5), Integer.valueOf(l3)); + int l5 = 0; + + switch (enchantment.getWeight()) + { + case 1: + l5 = 8; + break; + + case 2: + l5 = 4; + + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + + case 5: + l5 = 2; + break; + + case 10: + l5 = 1; + } + + if (flag) + { + l5 = Math.max(1, l5 / 2); + } + + l1 += l5 * l3; + } + } + } + } + } + + if (StringUtils.isBlank(this.repairedItemName)) + { + if (itemstack.hasDisplayName()) + { + j2 = 1; + l1 += j2; + itemstack1.clearCustomName(); + } + } + else if (!this.repairedItemName.equals(itemstack.getDisplayName())) + { + j2 = 1; + l1 += j2; + itemstack1.setStackDisplayName(this.repairedItemName); + } + + this.maximumCost = i2 + l1; + + if (l1 <= 0) + { + itemstack1 = null; + } + + if (j2 == l1 && j2 > 0 && this.maximumCost >= 40) + { + this.maximumCost = 39; + } + + if (this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) + { + itemstack1 = null; + } + + if (itemstack1 != null) + { + int k4 = itemstack1.getRepairCost(); + + if (itemstack2 != null && k4 < itemstack2.getRepairCost()) + { + k4 = itemstack2.getRepairCost(); + } + + k4 = k4 * 2 + 1; + itemstack1.setRepairCost(k4); + EnchantmentHelper.setEnchantments(map, itemstack1); + } + + this.outputSlot.setInventorySlotContents(0, itemstack1); + this.detectAndSendChanges(); + } + } + + public void onCraftGuiOpened(ICrafting listener) + { + super.onCraftGuiOpened(listener); + listener.sendProgressBarUpdate(this, 0, this.maximumCost); + } + + public void updateProgressBar(int id, int data) + { + if (id == 0) + { + this.maximumCost = data; + } + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + + if (!this.theWorld.isRemote) + { + for (int i = 0; i < this.inputSlots.getSizeInventory(); ++i) + { + ItemStack itemstack = this.inputSlots.removeStackFromSlot(i); + + if (itemstack != null) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.theWorld.getBlockState(this.selfPosition).getBlock() != Blocks.anvil ? false : playerIn.getDistanceSq((double)this.selfPosition.getX() + 0.5D, (double)this.selfPosition.getY() + 0.5D, (double)this.selfPosition.getZ() + 0.5D) <= 64.0D; + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index != 0 && index != 1) + { + if (index >= 3 && index < 39 && !this.mergeItemStack(itemstack1, 0, 2, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } + + public void updateItemName(String newName) + { + this.repairedItemName = newName; + + if (this.getSlot(2).getHasStack()) + { + ItemStack itemstack = this.getSlot(2).getStack(); + + if (StringUtils.isBlank(newName)) + { + itemstack.clearCustomName(); + } + else + { + itemstack.setStackDisplayName(this.repairedItemName); + } + } + + this.updateRepairOutput(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerWorkbench.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerWorkbench.java new file mode 100644 index 0000000..053a181 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ContainerWorkbench.java @@ -0,0 +1,138 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class ContainerWorkbench extends Container +{ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); + public IInventory craftResult = new InventoryCraftResult(); + private World worldObj; + private BlockPos pos; + + public ContainerWorkbench(InventoryPlayer playerInventory, World worldIn, BlockPos posIn) + { + this.worldObj = worldIn; + this.pos = posIn; + this.addSlotToContainer(new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 124, 35)); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 3; ++j) + { + this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18)); + } + } + + for (int k = 0; k < 3; ++k) + { + for (int i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18)); + } + } + + for (int l = 0; l < 9; ++l) + { + this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + public void onCraftMatrixChanged(IInventory inventoryIn) + { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); + } + + public void onContainerClosed(EntityPlayer playerIn) + { + super.onContainerClosed(playerIn); + + if (!this.worldObj.isRemote) + { + for (int i = 0; i < 9; ++i) + { + ItemStack itemstack = this.craftMatrix.removeStackFromSlot(i); + + if (itemstack != null) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer playerIn) + { + return this.worldObj.getBlockState(this.pos).getBlock() != Blocks.crafting_table ? false : playerIn.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 10, 46, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index >= 10 && index < 37) + { + if (!this.mergeItemStack(itemstack1, 37, 46, false)) + { + return null; + } + } + else if (index >= 37 && index < 46) + { + if (!this.mergeItemStack(itemstack1, 10, 37, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 10, 46, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(playerIn, itemstack1); + } + + return itemstack; + } + + public boolean canMergeSlot(ItemStack stack, Slot slotIn) + { + return slotIn.inventory != this.craftResult && super.canMergeSlot(stack, slotIn); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ICrafting.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ICrafting.java new file mode 100644 index 0000000..261b3ed --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ICrafting.java @@ -0,0 +1,15 @@ +package net.minecraft.inventory; + +import java.util.List; +import net.minecraft.item.ItemStack; + +public interface ICrafting +{ + void updateCraftingInventory(Container containerToSend, List itemsList); + + void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack); + + void sendProgressBarUpdate(Container containerIn, int varToUpdate, int newValue); + + void sendAllWindowProperties(Container p_175173_1_, IInventory p_175173_2_); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/IInvBasic.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/IInvBasic.java new file mode 100644 index 0000000..7c879a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/IInvBasic.java @@ -0,0 +1,6 @@ +package net.minecraft.inventory; + +public interface IInvBasic +{ + void onInventoryChanged(InventoryBasic p_76316_1_); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/IInventory.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/IInventory.java new file mode 100644 index 0000000..57cf864 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/IInventory.java @@ -0,0 +1,38 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IWorldNameable; + +public interface IInventory extends IWorldNameable +{ + int getSizeInventory(); + + ItemStack getStackInSlot(int index); + + ItemStack decrStackSize(int index, int count); + + ItemStack removeStackFromSlot(int index); + + void setInventorySlotContents(int index, ItemStack stack); + + int getInventoryStackLimit(); + + void markDirty(); + + boolean isUseableByPlayer(EntityPlayer player); + + void openInventory(EntityPlayer player); + + void closeInventory(EntityPlayer player); + + boolean isItemValidForSlot(int index, ItemStack stack); + + int getField(int id); + + void setField(int id, int value); + + int getFieldCount(); + + void clear(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/ISidedInventory.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/ISidedInventory.java new file mode 100644 index 0000000..a52df02 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/ISidedInventory.java @@ -0,0 +1,13 @@ +package net.minecraft.inventory; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; + +public interface ISidedInventory extends IInventory +{ + int[] getSlotsForFace(EnumFacing side); + + boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction); + + boolean canExtractItem(int index, ItemStack stack, EnumFacing direction); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryBasic.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryBasic.java new file mode 100644 index 0000000..5a4d900 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryBasic.java @@ -0,0 +1,231 @@ +package net.minecraft.inventory; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class InventoryBasic implements IInventory +{ + private String inventoryTitle; + private int slotsCount; + private ItemStack[] inventoryContents; + private List changeListeners; + private boolean hasCustomName; + + public InventoryBasic(String title, boolean customName, int slotCount) + { + this.inventoryTitle = title; + this.hasCustomName = customName; + this.slotsCount = slotCount; + this.inventoryContents = new ItemStack[slotCount]; + } + + public InventoryBasic(IChatComponent title, int slotCount) + { + this(title.getUnformattedText(), true, slotCount); + } + + public void addInventoryChangeListener(IInvBasic listener) + { + if (this.changeListeners == null) + { + this.changeListeners = Lists.newArrayList(); + } + + this.changeListeners.add(listener); + } + + public void removeInventoryChangeListener(IInvBasic listener) + { + this.changeListeners.remove(listener); + } + + public ItemStack getStackInSlot(int index) + { + return index >= 0 && index < this.inventoryContents.length ? this.inventoryContents[index] : null; + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.inventoryContents[index] != null) + { + if (this.inventoryContents[index].stackSize <= count) + { + ItemStack itemstack1 = this.inventoryContents[index]; + this.inventoryContents[index] = null; + this.markDirty(); + return itemstack1; + } + else + { + ItemStack itemstack = this.inventoryContents[index].splitStack(count); + + if (this.inventoryContents[index].stackSize == 0) + { + this.inventoryContents[index] = null; + } + + this.markDirty(); + return itemstack; + } + } + else + { + return null; + } + } + + public ItemStack func_174894_a(ItemStack stack) + { + ItemStack itemstack = stack.copy(); + + for (int i = 0; i < this.slotsCount; ++i) + { + ItemStack itemstack1 = this.getStackInSlot(i); + + if (itemstack1 == null) + { + this.setInventorySlotContents(i, itemstack); + this.markDirty(); + return null; + } + + if (ItemStack.areItemsEqual(itemstack1, itemstack)) + { + int j = Math.min(this.getInventoryStackLimit(), itemstack1.getMaxStackSize()); + int k = Math.min(itemstack.stackSize, j - itemstack1.stackSize); + + if (k > 0) + { + itemstack1.stackSize += k; + itemstack.stackSize -= k; + + if (itemstack.stackSize <= 0) + { + this.markDirty(); + return null; + } + } + } + } + + if (itemstack.stackSize != stack.stackSize) + { + this.markDirty(); + } + + return itemstack; + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.inventoryContents[index] != null) + { + ItemStack itemstack = this.inventoryContents[index]; + this.inventoryContents[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.inventoryContents[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + public int getSizeInventory() + { + return this.slotsCount; + } + + public String getName() + { + return this.inventoryTitle; + } + + public boolean hasCustomName() + { + return this.hasCustomName; + } + + public void setCustomName(String inventoryTitleIn) + { + this.hasCustomName = true; + this.inventoryTitle = inventoryTitleIn; + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public int getInventoryStackLimit() + { + return 64; + } + + public void markDirty() + { + if (this.changeListeners != null) + { + for (int i = 0; i < this.changeListeners.size(); ++i) + { + ((IInvBasic)this.changeListeners.get(i)).onInventoryChanged(this); + } + } + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return true; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.inventoryContents.length; ++i) + { + this.inventoryContents[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryCraftResult.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryCraftResult.java new file mode 100644 index 0000000..05383fe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryCraftResult.java @@ -0,0 +1,119 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class InventoryCraftResult implements IInventory +{ + private ItemStack[] stackResult = new ItemStack[1]; + + public int getSizeInventory() + { + return 1; + } + + public ItemStack getStackInSlot(int index) + { + return this.stackResult[0]; + } + + public String getName() + { + return "Result"; + } + + public boolean hasCustomName() + { + return false; + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.stackResult[0] != null) + { + ItemStack itemstack = this.stackResult[0]; + this.stackResult[0] = null; + return itemstack; + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.stackResult[0] != null) + { + ItemStack itemstack = this.stackResult[0]; + this.stackResult[0] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.stackResult[0] = stack; + } + + public int getInventoryStackLimit() + { + return 64; + } + + public void markDirty() + { + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return true; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.stackResult.length; ++i) + { + this.stackResult[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryCrafting.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryCrafting.java new file mode 100644 index 0000000..5f23e88 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryCrafting.java @@ -0,0 +1,163 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class InventoryCrafting implements IInventory +{ + private final ItemStack[] stackList; + private final int inventoryWidth; + private final int inventoryHeight; + private final Container eventHandler; + + public InventoryCrafting(Container eventHandlerIn, int width, int height) + { + int i = width * height; + this.stackList = new ItemStack[i]; + this.eventHandler = eventHandlerIn; + this.inventoryWidth = width; + this.inventoryHeight = height; + } + + public int getSizeInventory() + { + return this.stackList.length; + } + + public ItemStack getStackInSlot(int index) + { + return index >= this.getSizeInventory() ? null : this.stackList[index]; + } + + public ItemStack getStackInRowAndColumn(int row, int column) + { + return row >= 0 && row < this.inventoryWidth && column >= 0 && column <= this.inventoryHeight ? this.getStackInSlot(row + column * this.inventoryWidth) : null; + } + + public String getName() + { + return "container.crafting"; + } + + public boolean hasCustomName() + { + return false; + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.stackList[index] != null) + { + ItemStack itemstack = this.stackList[index]; + this.stackList[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.stackList[index] != null) + { + if (this.stackList[index].stackSize <= count) + { + ItemStack itemstack1 = this.stackList[index]; + this.stackList[index] = null; + this.eventHandler.onCraftMatrixChanged(this); + return itemstack1; + } + else + { + ItemStack itemstack = this.stackList[index].splitStack(count); + + if (this.stackList[index].stackSize == 0) + { + this.stackList[index] = null; + } + + this.eventHandler.onCraftMatrixChanged(this); + return itemstack; + } + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.stackList[index] = stack; + this.eventHandler.onCraftMatrixChanged(this); + } + + public int getInventoryStackLimit() + { + return 64; + } + + public void markDirty() + { + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return true; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.stackList.length; ++i) + { + this.stackList[i] = null; + } + } + + public int getHeight() + { + return this.inventoryHeight; + } + + public int getWidth() + { + return this.inventoryWidth; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryEnderChest.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryEnderChest.java new file mode 100644 index 0000000..103eb20 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryEnderChest.java @@ -0,0 +1,87 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntityEnderChest; + +public class InventoryEnderChest extends InventoryBasic +{ + private TileEntityEnderChest associatedChest; + + public InventoryEnderChest() + { + super("container.enderchest", false, 27); + } + + public void setChestTileEntity(TileEntityEnderChest chestTileEntity) + { + this.associatedChest = chestTileEntity; + } + + public void loadInventoryFromNBT(NBTTagList p_70486_1_) + { + for (int i = 0; i < this.getSizeInventory(); ++i) + { + this.setInventorySlotContents(i, (ItemStack)null); + } + + for (int k = 0; k < p_70486_1_.tagCount(); ++k) + { + NBTTagCompound nbttagcompound = p_70486_1_.getCompoundTagAt(k); + int j = nbttagcompound.getByte("Slot") & 255; + + if (j >= 0 && j < this.getSizeInventory()) + { + this.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound)); + } + } + } + + public NBTTagList saveInventoryToNBT() + { + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.getSizeInventory(); ++i) + { + ItemStack itemstack = this.getStackInSlot(i); + + if (itemstack != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + itemstack.writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + return nbttaglist; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.associatedChest != null && !this.associatedChest.canBeUsed(player) ? false : super.isUseableByPlayer(player); + } + + public void openInventory(EntityPlayer player) + { + if (this.associatedChest != null) + { + this.associatedChest.openChest(); + } + + super.openInventory(player); + } + + public void closeInventory(EntityPlayer player) + { + if (this.associatedChest != null) + { + this.associatedChest.closeChest(); + } + + super.closeInventory(player); + this.associatedChest = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryHelper.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryHelper.java new file mode 100644 index 0000000..dcc8276 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryHelper.java @@ -0,0 +1,68 @@ +package net.minecraft.inventory; + +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class InventoryHelper +{ + private static final Random RANDOM = new Random(); + + public static void dropInventoryItems(World worldIn, BlockPos pos, IInventory inventory) + { + dropInventoryItems(worldIn, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), inventory); + } + + public static void dropInventoryItems(World worldIn, Entity entityAt, IInventory inventory) + { + dropInventoryItems(worldIn, entityAt.posX, entityAt.posY, entityAt.posZ, inventory); + } + + private static void dropInventoryItems(World worldIn, double x, double y, double z, IInventory inventory) + { + for (int i = 0; i < inventory.getSizeInventory(); ++i) + { + ItemStack itemstack = inventory.getStackInSlot(i); + + if (itemstack != null) + { + spawnItemStack(worldIn, x, y, z, itemstack); + } + } + } + + private static void spawnItemStack(World worldIn, double x, double y, double z, ItemStack stack) + { + float f = RANDOM.nextFloat() * 0.8F + 0.1F; + float f1 = RANDOM.nextFloat() * 0.8F + 0.1F; + float f2 = RANDOM.nextFloat() * 0.8F + 0.1F; + + while (stack.stackSize > 0) + { + int i = RANDOM.nextInt(21) + 10; + + if (i > stack.stackSize) + { + i = stack.stackSize; + } + + stack.stackSize -= i; + EntityItem entityitem = new EntityItem(worldIn, x + (double)f, y + (double)f1, z + (double)f2, new ItemStack(stack.getItem(), i, stack.getMetadata())); + + if (stack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = RANDOM.nextGaussian() * (double)f3; + entityitem.motionY = RANDOM.nextGaussian() * (double)f3 + 0.20000000298023224D; + entityitem.motionZ = RANDOM.nextGaussian() * (double)f3; + worldIn.spawnEntityInWorld(entityitem); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryLargeChest.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryLargeChest.java new file mode 100644 index 0000000..b3028df --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryLargeChest.java @@ -0,0 +1,175 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.LockCode; + +public class InventoryLargeChest implements ILockableContainer +{ + private String name; + private ILockableContainer upperChest; + private ILockableContainer lowerChest; + + public InventoryLargeChest(String nameIn, ILockableContainer upperChestIn, ILockableContainer lowerChestIn) + { + this.name = nameIn; + + if (upperChestIn == null) + { + upperChestIn = lowerChestIn; + } + + if (lowerChestIn == null) + { + lowerChestIn = upperChestIn; + } + + this.upperChest = upperChestIn; + this.lowerChest = lowerChestIn; + + if (upperChestIn.isLocked()) + { + lowerChestIn.setLockCode(upperChestIn.getLockCode()); + } + else if (lowerChestIn.isLocked()) + { + upperChestIn.setLockCode(lowerChestIn.getLockCode()); + } + } + + public int getSizeInventory() + { + return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory(); + } + + public boolean isPartOfLargeChest(IInventory inventoryIn) + { + return this.upperChest == inventoryIn || this.lowerChest == inventoryIn; + } + + public String getName() + { + return this.upperChest.hasCustomName() ? this.upperChest.getName() : (this.lowerChest.hasCustomName() ? this.lowerChest.getName() : this.name); + } + + public boolean hasCustomName() + { + return this.upperChest.hasCustomName() || this.lowerChest.hasCustomName(); + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public ItemStack getStackInSlot(int index) + { + return index >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlot(index - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlot(index); + } + + public ItemStack decrStackSize(int index, int count) + { + return index >= this.upperChest.getSizeInventory() ? this.lowerChest.decrStackSize(index - this.upperChest.getSizeInventory(), count) : this.upperChest.decrStackSize(index, count); + } + + public ItemStack removeStackFromSlot(int index) + { + return index >= this.upperChest.getSizeInventory() ? this.lowerChest.removeStackFromSlot(index - this.upperChest.getSizeInventory()) : this.upperChest.removeStackFromSlot(index); + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + if (index >= this.upperChest.getSizeInventory()) + { + this.lowerChest.setInventorySlotContents(index - this.upperChest.getSizeInventory(), stack); + } + else + { + this.upperChest.setInventorySlotContents(index, stack); + } + } + + public int getInventoryStackLimit() + { + return this.upperChest.getInventoryStackLimit(); + } + + public void markDirty() + { + this.upperChest.markDirty(); + this.lowerChest.markDirty(); + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.upperChest.isUseableByPlayer(player) && this.lowerChest.isUseableByPlayer(player); + } + + public void openInventory(EntityPlayer player) + { + this.upperChest.openInventory(player); + this.lowerChest.openInventory(player); + } + + public void closeInventory(EntityPlayer player) + { + this.upperChest.closeInventory(player); + this.lowerChest.closeInventory(player); + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public boolean isLocked() + { + return this.upperChest.isLocked() || this.lowerChest.isLocked(); + } + + public void setLockCode(LockCode code) + { + this.upperChest.setLockCode(code); + this.lowerChest.setLockCode(code); + } + + public LockCode getLockCode() + { + return this.upperChest.getLockCode(); + } + + public String getGuiID() + { + return this.upperChest.getGuiID(); + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerChest(playerInventory, this, playerIn); + } + + public void clear() + { + this.upperChest.clear(); + this.lowerChest.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryMerchant.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryMerchant.java new file mode 100644 index 0000000..4eed847 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/InventoryMerchant.java @@ -0,0 +1,243 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public class InventoryMerchant implements IInventory +{ + private final IMerchant theMerchant; + private ItemStack[] theInventory = new ItemStack[3]; + private final EntityPlayer thePlayer; + private MerchantRecipe currentRecipe; + private int currentRecipeIndex; + + public InventoryMerchant(EntityPlayer thePlayerIn, IMerchant theMerchantIn) + { + this.thePlayer = thePlayerIn; + this.theMerchant = theMerchantIn; + } + + public int getSizeInventory() + { + return this.theInventory.length; + } + + public ItemStack getStackInSlot(int index) + { + return this.theInventory[index]; + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.theInventory[index] != null) + { + if (index == 2) + { + ItemStack itemstack2 = this.theInventory[index]; + this.theInventory[index] = null; + return itemstack2; + } + else if (this.theInventory[index].stackSize <= count) + { + ItemStack itemstack1 = this.theInventory[index]; + this.theInventory[index] = null; + + if (this.inventoryResetNeededOnSlotChange(index)) + { + this.resetRecipeAndSlots(); + } + + return itemstack1; + } + else + { + ItemStack itemstack = this.theInventory[index].splitStack(count); + + if (this.theInventory[index].stackSize == 0) + { + this.theInventory[index] = null; + } + + if (this.inventoryResetNeededOnSlotChange(index)) + { + this.resetRecipeAndSlots(); + } + + return itemstack; + } + } + else + { + return null; + } + } + + private boolean inventoryResetNeededOnSlotChange(int p_70469_1_) + { + return p_70469_1_ == 0 || p_70469_1_ == 1; + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.theInventory[index] != null) + { + ItemStack itemstack = this.theInventory[index]; + this.theInventory[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.theInventory[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + if (this.inventoryResetNeededOnSlotChange(index)) + { + this.resetRecipeAndSlots(); + } + } + + public String getName() + { + return "mob.villager"; + } + + public boolean hasCustomName() + { + return false; + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public int getInventoryStackLimit() + { + return 64; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.theMerchant.getCustomer() == player; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public void markDirty() + { + this.resetRecipeAndSlots(); + } + + public void resetRecipeAndSlots() + { + this.currentRecipe = null; + ItemStack itemstack = this.theInventory[0]; + ItemStack itemstack1 = this.theInventory[1]; + + if (itemstack == null) + { + itemstack = itemstack1; + itemstack1 = null; + } + + if (itemstack == null) + { + this.setInventorySlotContents(2, (ItemStack)null); + } + else + { + MerchantRecipeList merchantrecipelist = this.theMerchant.getRecipes(this.thePlayer); + + if (merchantrecipelist != null) + { + MerchantRecipe merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack, itemstack1, this.currentRecipeIndex); + + if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) + { + this.currentRecipe = merchantrecipe; + this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy()); + } + else if (itemstack1 != null) + { + merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack1, itemstack, this.currentRecipeIndex); + + if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) + { + this.currentRecipe = merchantrecipe; + this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy()); + } + else + { + this.setInventorySlotContents(2, (ItemStack)null); + } + } + else + { + this.setInventorySlotContents(2, (ItemStack)null); + } + } + } + + this.theMerchant.verifySellingItem(this.getStackInSlot(2)); + } + + public MerchantRecipe getCurrentRecipe() + { + return this.currentRecipe; + } + + public void setCurrentRecipeIndex(int currentRecipeIndexIn) + { + this.currentRecipeIndex = currentRecipeIndexIn; + this.resetRecipeAndSlots(); + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.theInventory.length; ++i) + { + this.theInventory[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/Slot.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/Slot.java new file mode 100644 index 0000000..368aef2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/Slot.java @@ -0,0 +1,111 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class Slot +{ + private final int slotIndex; + public final IInventory inventory; + public int slotNumber; + public int xDisplayPosition; + public int yDisplayPosition; + + public Slot(IInventory inventoryIn, int index, int xPosition, int yPosition) + { + this.inventory = inventoryIn; + this.slotIndex = index; + this.xDisplayPosition = xPosition; + this.yDisplayPosition = yPosition; + } + + public void onSlotChange(ItemStack p_75220_1_, ItemStack p_75220_2_) + { + if (p_75220_1_ != null && p_75220_2_ != null) + { + if (p_75220_1_.getItem() == p_75220_2_.getItem()) + { + int i = p_75220_2_.stackSize - p_75220_1_.stackSize; + + if (i > 0) + { + this.onCrafting(p_75220_1_, i); + } + } + } + } + + protected void onCrafting(ItemStack stack, int amount) + { + } + + protected void onCrafting(ItemStack stack) + { + } + + public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + { + this.onSlotChanged(); + } + + public boolean isItemValid(ItemStack stack) + { + return true; + } + + public ItemStack getStack() + { + return this.inventory.getStackInSlot(this.slotIndex); + } + + public boolean getHasStack() + { + return this.getStack() != null; + } + + public void putStack(ItemStack stack) + { + this.inventory.setInventorySlotContents(this.slotIndex, stack); + this.onSlotChanged(); + } + + public void onSlotChanged() + { + this.inventory.markDirty(); + } + + public int getSlotStackLimit() + { + return this.inventory.getInventoryStackLimit(); + } + + public int getItemStackLimit(ItemStack stack) + { + return this.getSlotStackLimit(); + } + + public String getSlotTexture() + { + return null; + } + + public ItemStack decrStackSize(int amount) + { + return this.inventory.decrStackSize(this.slotIndex, amount); + } + + public boolean isHere(IInventory inv, int slotIn) + { + return inv == this.inventory && slotIn == this.slotIndex; + } + + public boolean canTakeStack(EntityPlayer playerIn) + { + return true; + } + + public boolean canBeHovered() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotCrafting.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotCrafting.java new file mode 100644 index 0000000..188fd5a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotCrafting.java @@ -0,0 +1,141 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.stats.AchievementList; + +public class SlotCrafting extends Slot +{ + private final InventoryCrafting craftMatrix; + private final EntityPlayer thePlayer; + private int amountCrafted; + + public SlotCrafting(EntityPlayer player, InventoryCrafting craftingInventory, IInventory p_i45790_3_, int slotIndex, int xPosition, int yPosition) + { + super(p_i45790_3_, slotIndex, xPosition, yPosition); + this.thePlayer = player; + this.craftMatrix = craftingInventory; + } + + public boolean isItemValid(ItemStack stack) + { + return false; + } + + public ItemStack decrStackSize(int amount) + { + if (this.getHasStack()) + { + this.amountCrafted += Math.min(amount, this.getStack().stackSize); + } + + return super.decrStackSize(amount); + } + + protected void onCrafting(ItemStack stack, int amount) + { + this.amountCrafted += amount; + this.onCrafting(stack); + } + + protected void onCrafting(ItemStack stack) + { + if (this.amountCrafted > 0) + { + stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); + } + + this.amountCrafted = 0; + + if (stack.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) + { + this.thePlayer.triggerAchievement(AchievementList.buildWorkBench); + } + + if (stack.getItem() instanceof ItemPickaxe) + { + this.thePlayer.triggerAchievement(AchievementList.buildPickaxe); + } + + if (stack.getItem() == Item.getItemFromBlock(Blocks.furnace)) + { + this.thePlayer.triggerAchievement(AchievementList.buildFurnace); + } + + if (stack.getItem() instanceof ItemHoe) + { + this.thePlayer.triggerAchievement(AchievementList.buildHoe); + } + + if (stack.getItem() == Items.bread) + { + this.thePlayer.triggerAchievement(AchievementList.makeBread); + } + + if (stack.getItem() == Items.cake) + { + this.thePlayer.triggerAchievement(AchievementList.bakeCake); + } + + if (stack.getItem() instanceof ItemPickaxe && ((ItemPickaxe)stack.getItem()).getToolMaterial() != Item.ToolMaterial.WOOD) + { + this.thePlayer.triggerAchievement(AchievementList.buildBetterPickaxe); + } + + if (stack.getItem() instanceof ItemSword) + { + this.thePlayer.triggerAchievement(AchievementList.buildSword); + } + + if (stack.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) + { + this.thePlayer.triggerAchievement(AchievementList.enchantments); + } + + if (stack.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) + { + this.thePlayer.triggerAchievement(AchievementList.bookcase); + } + + if (stack.getItem() == Items.golden_apple && stack.getMetadata() == 1) + { + this.thePlayer.triggerAchievement(AchievementList.overpowered); + } + } + + public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + { + this.onCrafting(stack); + ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(this.craftMatrix, playerIn.worldObj); + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = this.craftMatrix.getStackInSlot(i); + ItemStack itemstack1 = aitemstack[i]; + + if (itemstack != null) + { + this.craftMatrix.decrStackSize(i, 1); + } + + if (itemstack1 != null) + { + if (this.craftMatrix.getStackInSlot(i) == null) + { + this.craftMatrix.setInventorySlotContents(i, itemstack1); + } + else if (!this.thePlayer.inventory.addItemStackToInventory(itemstack1)) + { + this.thePlayer.dropPlayerItemWithRandomChoice(itemstack1, false); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotFurnaceFuel.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotFurnaceFuel.java new file mode 100644 index 0000000..19bc1f5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotFurnaceFuel.java @@ -0,0 +1,28 @@ +package net.minecraft.inventory; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; + +public class SlotFurnaceFuel extends Slot +{ + public SlotFurnaceFuel(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition) + { + super(inventoryIn, slotIndex, xPosition, yPosition); + } + + public boolean isItemValid(ItemStack stack) + { + return TileEntityFurnace.isItemFuel(stack) || isBucket(stack); + } + + public int getItemStackLimit(ItemStack stack) + { + return isBucket(stack) ? 1 : super.getItemStackLimit(stack); + } + + public static boolean isBucket(ItemStack stack) + { + return stack != null && stack.getItem() != null && stack.getItem() == Items.bucket; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java new file mode 100644 index 0000000..4410917 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java @@ -0,0 +1,94 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.MathHelper; + +public class SlotFurnaceOutput extends Slot +{ + private EntityPlayer thePlayer; + private int field_75228_b; + + public SlotFurnaceOutput(EntityPlayer player, IInventory inventoryIn, int slotIndex, int xPosition, int yPosition) + { + super(inventoryIn, slotIndex, xPosition, yPosition); + this.thePlayer = player; + } + + public boolean isItemValid(ItemStack stack) + { + return false; + } + + public ItemStack decrStackSize(int amount) + { + if (this.getHasStack()) + { + this.field_75228_b += Math.min(amount, this.getStack().stackSize); + } + + return super.decrStackSize(amount); + } + + public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + { + this.onCrafting(stack); + super.onPickupFromSlot(playerIn, stack); + } + + protected void onCrafting(ItemStack stack, int amount) + { + this.field_75228_b += amount; + this.onCrafting(stack); + } + + protected void onCrafting(ItemStack stack) + { + stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); + + if (!this.thePlayer.worldObj.isRemote) + { + int i = this.field_75228_b; + float f = FurnaceRecipes.instance().getSmeltingExperience(stack); + + if (f == 0.0F) + { + i = 0; + } + else if (f < 1.0F) + { + int j = MathHelper.floor_float((float)i * f); + + if (j < MathHelper.ceiling_float_int((float)i * f) && Math.random() < (double)((float)i * f - (float)j)) + { + ++j; + } + + i = j; + } + + while (i > 0) + { + int k = EntityXPOrb.getXPSplit(i); + i -= k; + this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, k)); + } + } + + this.field_75228_b = 0; + + if (stack.getItem() == Items.iron_ingot) + { + this.thePlayer.triggerAchievement(AchievementList.acquireIron); + } + + if (stack.getItem() == Items.cooked_fish) + { + this.thePlayer.triggerAchievement(AchievementList.cookFish); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotMerchantResult.java b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotMerchantResult.java new file mode 100644 index 0000000..49101a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/inventory/SlotMerchantResult.java @@ -0,0 +1,105 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.village.MerchantRecipe; + +public class SlotMerchantResult extends Slot +{ + private final InventoryMerchant theMerchantInventory; + private EntityPlayer thePlayer; + private int field_75231_g; + private final IMerchant theMerchant; + + public SlotMerchantResult(EntityPlayer player, IMerchant merchant, InventoryMerchant merchantInventory, int slotIndex, int xPosition, int yPosition) + { + super(merchantInventory, slotIndex, xPosition, yPosition); + this.thePlayer = player; + this.theMerchant = merchant; + this.theMerchantInventory = merchantInventory; + } + + public boolean isItemValid(ItemStack stack) + { + return false; + } + + public ItemStack decrStackSize(int amount) + { + if (this.getHasStack()) + { + this.field_75231_g += Math.min(amount, this.getStack().stackSize); + } + + return super.decrStackSize(amount); + } + + protected void onCrafting(ItemStack stack, int amount) + { + this.field_75231_g += amount; + this.onCrafting(stack); + } + + protected void onCrafting(ItemStack stack) + { + stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75231_g); + this.field_75231_g = 0; + } + + public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + { + this.onCrafting(stack); + MerchantRecipe merchantrecipe = this.theMerchantInventory.getCurrentRecipe(); + + if (merchantrecipe != null) + { + ItemStack itemstack = this.theMerchantInventory.getStackInSlot(0); + ItemStack itemstack1 = this.theMerchantInventory.getStackInSlot(1); + + if (this.doTrade(merchantrecipe, itemstack, itemstack1) || this.doTrade(merchantrecipe, itemstack1, itemstack)) + { + this.theMerchant.useRecipe(merchantrecipe); + playerIn.triggerAchievement(StatList.timesTradedWithVillagerStat); + + if (itemstack != null && itemstack.stackSize <= 0) + { + itemstack = null; + } + + if (itemstack1 != null && itemstack1.stackSize <= 0) + { + itemstack1 = null; + } + + this.theMerchantInventory.setInventorySlotContents(0, itemstack); + this.theMerchantInventory.setInventorySlotContents(1, itemstack1); + } + } + } + + private boolean doTrade(MerchantRecipe trade, ItemStack firstItem, ItemStack secondItem) + { + ItemStack itemstack = trade.getItemToBuy(); + ItemStack itemstack1 = trade.getSecondItemToBuy(); + + if (firstItem != null && firstItem.getItem() == itemstack.getItem()) + { + if (itemstack1 != null && secondItem != null && itemstack1.getItem() == secondItem.getItem()) + { + firstItem.stackSize -= itemstack.stackSize; + secondItem.stackSize -= itemstack1.stackSize; + return true; + } + + if (itemstack1 == null && secondItem == null) + { + firstItem.stackSize -= itemstack.stackSize; + return true; + } + } + + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/EnumAction.java b/Client-1.8.9/src/main/java/net/minecraft/item/EnumAction.java new file mode 100644 index 0000000..2a39f8f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/EnumAction.java @@ -0,0 +1,10 @@ +package net.minecraft.item; + +public enum EnumAction +{ + NONE, + EAT, + DRINK, + BLOCK, + BOW; +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/EnumDyeColor.java b/Client-1.8.9/src/main/java/net/minecraft/item/EnumDyeColor.java new file mode 100644 index 0000000..fdd05b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/EnumDyeColor.java @@ -0,0 +1,102 @@ +package net.minecraft.item; + +import net.minecraft.block.material.MapColor; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IStringSerializable; + +public enum EnumDyeColor implements IStringSerializable +{ + WHITE(0, 15, "white", "white", MapColor.snowColor, EnumChatFormatting.WHITE), + ORANGE(1, 14, "orange", "orange", MapColor.adobeColor, EnumChatFormatting.GOLD), + MAGENTA(2, 13, "magenta", "magenta", MapColor.magentaColor, EnumChatFormatting.AQUA), + LIGHT_BLUE(3, 12, "light_blue", "lightBlue", MapColor.lightBlueColor, EnumChatFormatting.BLUE), + YELLOW(4, 11, "yellow", "yellow", MapColor.yellowColor, EnumChatFormatting.YELLOW), + LIME(5, 10, "lime", "lime", MapColor.limeColor, EnumChatFormatting.GREEN), + PINK(6, 9, "pink", "pink", MapColor.pinkColor, EnumChatFormatting.LIGHT_PURPLE), + GRAY(7, 8, "gray", "gray", MapColor.grayColor, EnumChatFormatting.DARK_GRAY), + SILVER(8, 7, "silver", "silver", MapColor.silverColor, EnumChatFormatting.GRAY), + CYAN(9, 6, "cyan", "cyan", MapColor.cyanColor, EnumChatFormatting.DARK_AQUA), + PURPLE(10, 5, "purple", "purple", MapColor.purpleColor, EnumChatFormatting.DARK_PURPLE), + BLUE(11, 4, "blue", "blue", MapColor.blueColor, EnumChatFormatting.DARK_BLUE), + BROWN(12, 3, "brown", "brown", MapColor.brownColor, EnumChatFormatting.GOLD), + GREEN(13, 2, "green", "green", MapColor.greenColor, EnumChatFormatting.DARK_GREEN), + RED(14, 1, "red", "red", MapColor.redColor, EnumChatFormatting.DARK_RED), + BLACK(15, 0, "black", "black", MapColor.blackColor, EnumChatFormatting.BLACK); + + private static final EnumDyeColor[] META_LOOKUP = new EnumDyeColor[values().length]; + private static final EnumDyeColor[] DYE_DMG_LOOKUP = new EnumDyeColor[values().length]; + private final int meta; + private final int dyeDamage; + private final String name; + private final String unlocalizedName; + private final MapColor mapColor; + private final EnumChatFormatting chatColor; + + private EnumDyeColor(int meta, int dyeDamage, String name, String unlocalizedName, MapColor mapColorIn, EnumChatFormatting chatColor) + { + this.meta = meta; + this.dyeDamage = dyeDamage; + this.name = name; + this.unlocalizedName = unlocalizedName; + this.mapColor = mapColorIn; + this.chatColor = chatColor; + } + + public int getMetadata() + { + return this.meta; + } + + public int getDyeDamage() + { + return this.dyeDamage; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + public MapColor getMapColor() + { + return this.mapColor; + } + + public static EnumDyeColor byDyeDamage(int damage) + { + if (damage < 0 || damage >= DYE_DMG_LOOKUP.length) + { + damage = 0; + } + + return DYE_DMG_LOOKUP[damage]; + } + + public static EnumDyeColor byMetadata(int meta) + { + if (meta < 0 || meta >= META_LOOKUP.length) + { + meta = 0; + } + + return META_LOOKUP[meta]; + } + + public String toString() + { + return this.unlocalizedName; + } + + public String getName() + { + return this.name; + } + + static { + for (EnumDyeColor enumdyecolor : values()) + { + META_LOOKUP[enumdyecolor.getMetadata()] = enumdyecolor; + DYE_DMG_LOOKUP[enumdyecolor.getDyeDamage()] = enumdyecolor; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/EnumRarity.java b/Client-1.8.9/src/main/java/net/minecraft/item/EnumRarity.java new file mode 100644 index 0000000..2942346 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/EnumRarity.java @@ -0,0 +1,20 @@ +package net.minecraft.item; + +import net.minecraft.util.EnumChatFormatting; + +public enum EnumRarity +{ + COMMON(EnumChatFormatting.WHITE, "Common"), + UNCOMMON(EnumChatFormatting.YELLOW, "Uncommon"), + RARE(EnumChatFormatting.AQUA, "Rare"), + EPIC(EnumChatFormatting.LIGHT_PURPLE, "Epic"); + + public final EnumChatFormatting rarityColor; + public final String rarityName; + + private EnumRarity(EnumChatFormatting color, String name) + { + this.rarityColor = color; + this.rarityName = name; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/Item.java b/Client-1.8.9/src/main/java/net/minecraft/item/Item.java new file mode 100644 index 0000000..64543e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/Item.java @@ -0,0 +1,888 @@ +package net.minecraft.item; + +import com.google.common.base.Function; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockPrismarine; +import net.minecraft.block.BlockRedSandstone; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.BlockStone; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockWall; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.RegistryNamespaced; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class Item +{ + public static final RegistryNamespaced itemRegistry = new RegistryNamespaced(); + private static final Map BLOCK_TO_ITEM = Maps.newHashMap(); + protected static final UUID itemModifierUUID = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + private CreativeTabs tabToDisplayOn; + protected static Random itemRand = new Random(); + protected int maxStackSize = 64; + private int maxDamage; + protected boolean bFull3D; + protected boolean hasSubtypes; + private Item containerItem; + private String potionEffect; + private String unlocalizedName; + + public static int getIdFromItem(Item itemIn) + { + return itemIn == null ? 0 : itemRegistry.getIDForObject(itemIn); + } + + public static Item getItemById(int id) + { + return (Item)itemRegistry.getObjectById(id); + } + + public static Item getItemFromBlock(Block blockIn) + { + return (Item)BLOCK_TO_ITEM.get(blockIn); + } + + public static Item getByNameOrId(String id) + { + Item item = (Item)itemRegistry.getObject(new ResourceLocation(id)); + + if (item == null) + { + try + { + return getItemById(Integer.parseInt(id)); + } + catch (NumberFormatException var3) + { + ; + } + } + + return item; + } + + public boolean updateItemStackNBT(NBTTagCompound nbt) + { + return false; + } + + public Item setMaxStackSize(int maxStackSize) + { + this.maxStackSize = maxStackSize; + return this; + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + return false; + } + + public float getStrVsBlock(ItemStack stack, Block state) + { + return 1.0F; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + return itemStackIn; + } + + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + return stack; + } + + public int getItemStackLimit() + { + return this.maxStackSize; + } + + public int getMetadata(int damage) + { + return 0; + } + + public boolean getHasSubtypes() + { + return this.hasSubtypes; + } + + protected Item setHasSubtypes(boolean hasSubtypes) + { + this.hasSubtypes = hasSubtypes; + return this; + } + + public int getMaxDamage() + { + return this.maxDamage; + } + + protected Item setMaxDamage(int maxDamageIn) + { + this.maxDamage = maxDamageIn; + return this; + } + + public boolean isDamageable() + { + return this.maxDamage > 0 && !this.hasSubtypes; + } + + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) + { + return false; + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) + { + return false; + } + + public boolean canHarvestBlock(Block blockIn) + { + return false; + } + + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) + { + return false; + } + + public Item setFull3D() + { + this.bFull3D = true; + return this; + } + + public boolean isFull3D() + { + return this.bFull3D; + } + + public boolean shouldRotateAroundWhenRendering() + { + return false; + } + + public Item setUnlocalizedName(String unlocalizedName) + { + this.unlocalizedName = unlocalizedName; + return this; + } + + public String getUnlocalizedNameInefficiently(ItemStack stack) + { + String s = this.getUnlocalizedName(stack); + return s == null ? "" : StatCollector.translateToLocal(s); + } + + public String getUnlocalizedName() + { + return "item." + this.unlocalizedName; + } + + public String getUnlocalizedName(ItemStack stack) + { + return "item." + this.unlocalizedName; + } + + public Item setContainerItem(Item containerItem) + { + this.containerItem = containerItem; + return this; + } + + public boolean getShareTag() + { + return true; + } + + public Item getContainerItem() + { + return this.containerItem; + } + + public boolean hasContainerItem() + { + return this.containerItem != null; + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + return 16777215; + } + + public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) + { + } + + public void onCreated(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + } + + public boolean isMap() + { + return false; + } + + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.NONE; + } + + public int getMaxItemUseDuration(ItemStack stack) + { + return 0; + } + + public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityPlayer playerIn, int timeLeft) + { + } + + protected Item setPotionEffect(String potionEffect) + { + this.potionEffect = potionEffect; + return this; + } + + public String getPotionEffect(ItemStack stack) + { + return this.potionEffect; + } + + public boolean isPotionIngredient(ItemStack stack) + { + return this.getPotionEffect(stack) != null; + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + } + + public String getItemStackDisplayName(ItemStack stack) + { + return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + + public boolean hasEffect(ItemStack stack) + { + return stack.isItemEnchanted(); + } + + public EnumRarity getRarity(ItemStack stack) + { + return stack.isItemEnchanted() ? EnumRarity.RARE : EnumRarity.COMMON; + } + + public boolean isItemTool(ItemStack stack) + { + return this.getItemStackLimit() == 1 && this.isDamageable(); + } + + protected MovingObjectPosition getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer playerIn, boolean useLiquids) + { + float f = playerIn.rotationPitch; + float f1 = playerIn.rotationYaw; + double d0 = playerIn.posX; + double d1 = playerIn.posY + (double)playerIn.getEyeHeight(); + double d2 = playerIn.posZ; + Vec3 vec3 = new Vec3(d0, d1, d2); + float f2 = MathHelper.cos(-f1 * 0.017453292F - (float)Math.PI); + float f3 = MathHelper.sin(-f1 * 0.017453292F - (float)Math.PI); + float f4 = -MathHelper.cos(-f * 0.017453292F); + float f5 = MathHelper.sin(-f * 0.017453292F); + float f6 = f3 * f4; + float f7 = f2 * f4; + double d3 = 5.0D; + Vec3 vec31 = vec3.addVector((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); + return worldIn.rayTraceBlocks(vec3, vec31, useLiquids, !useLiquids, false); + } + + public int getItemEnchantability() + { + return 0; + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + subItems.add(new ItemStack(itemIn, 1, 0)); + } + + public CreativeTabs getCreativeTab() + { + return this.tabToDisplayOn; + } + + public Item setCreativeTab(CreativeTabs tab) + { + this.tabToDisplayOn = tab; + return this; + } + + public boolean canItemEditBlocks() + { + return false; + } + + public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) + { + return false; + } + + public Multimap getItemAttributeModifiers() + { + return HashMultimap.create(); + } + + public static void registerItems() + { + registerItemBlock(Blocks.stone, (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockStone.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("stone")); + registerItemBlock(Blocks.grass, new ItemColored(Blocks.grass, false)); + registerItemBlock(Blocks.dirt, (new ItemMultiTexture(Blocks.dirt, Blocks.dirt, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockDirt.DirtType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("dirt")); + registerItemBlock(Blocks.cobblestone); + registerItemBlock(Blocks.planks, (new ItemMultiTexture(Blocks.planks, Blocks.planks, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("wood")); + registerItemBlock(Blocks.sapling, (new ItemMultiTexture(Blocks.sapling, Blocks.sapling, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("sapling")); + registerItemBlock(Blocks.bedrock); + registerItemBlock(Blocks.sand, (new ItemMultiTexture(Blocks.sand, Blocks.sand, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockSand.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("sand")); + registerItemBlock(Blocks.gravel); + registerItemBlock(Blocks.gold_ore); + registerItemBlock(Blocks.iron_ore); + registerItemBlock(Blocks.coal_ore); + registerItemBlock(Blocks.log, (new ItemMultiTexture(Blocks.log, Blocks.log, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("log")); + registerItemBlock(Blocks.log2, (new ItemMultiTexture(Blocks.log2, Blocks.log2, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata() + 4).getUnlocalizedName(); + } + })).setUnlocalizedName("log")); + registerItemBlock(Blocks.leaves, (new ItemLeaves(Blocks.leaves)).setUnlocalizedName("leaves")); + registerItemBlock(Blocks.leaves2, (new ItemLeaves(Blocks.leaves2)).setUnlocalizedName("leaves")); + registerItemBlock(Blocks.sponge, (new ItemMultiTexture(Blocks.sponge, Blocks.sponge, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return (p_apply_1_.getMetadata() & 1) == 1 ? "wet" : "dry"; + } + })).setUnlocalizedName("sponge")); + registerItemBlock(Blocks.glass); + registerItemBlock(Blocks.lapis_ore); + registerItemBlock(Blocks.lapis_block); + registerItemBlock(Blocks.dispenser); + registerItemBlock(Blocks.sandstone, (new ItemMultiTexture(Blocks.sandstone, Blocks.sandstone, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockSandStone.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("sandStone")); + registerItemBlock(Blocks.noteblock); + registerItemBlock(Blocks.golden_rail); + registerItemBlock(Blocks.detector_rail); + registerItemBlock(Blocks.sticky_piston, new ItemPiston(Blocks.sticky_piston)); + registerItemBlock(Blocks.web); + registerItemBlock(Blocks.tallgrass, (new ItemColored(Blocks.tallgrass, true)).setSubtypeNames(new String[] {"shrub", "grass", "fern"})); + registerItemBlock(Blocks.deadbush); + registerItemBlock(Blocks.piston, new ItemPiston(Blocks.piston)); + registerItemBlock(Blocks.wool, (new ItemCloth(Blocks.wool)).setUnlocalizedName("cloth")); + registerItemBlock(Blocks.yellow_flower, (new ItemMultiTexture(Blocks.yellow_flower, Blocks.yellow_flower, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.YELLOW, p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("flower")); + registerItemBlock(Blocks.red_flower, (new ItemMultiTexture(Blocks.red_flower, Blocks.red_flower, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.RED, p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("rose")); + registerItemBlock(Blocks.brown_mushroom); + registerItemBlock(Blocks.red_mushroom); + registerItemBlock(Blocks.gold_block); + registerItemBlock(Blocks.iron_block); + registerItemBlock(Blocks.stone_slab, (new ItemSlab(Blocks.stone_slab, Blocks.stone_slab, Blocks.double_stone_slab)).setUnlocalizedName("stoneSlab")); + registerItemBlock(Blocks.brick_block); + registerItemBlock(Blocks.tnt); + registerItemBlock(Blocks.bookshelf); + registerItemBlock(Blocks.mossy_cobblestone); + registerItemBlock(Blocks.obsidian); + registerItemBlock(Blocks.torch); + registerItemBlock(Blocks.mob_spawner); + registerItemBlock(Blocks.oak_stairs); + registerItemBlock(Blocks.chest); + registerItemBlock(Blocks.diamond_ore); + registerItemBlock(Blocks.diamond_block); + registerItemBlock(Blocks.crafting_table); + registerItemBlock(Blocks.farmland); + registerItemBlock(Blocks.furnace); + registerItemBlock(Blocks.lit_furnace); + registerItemBlock(Blocks.ladder); + registerItemBlock(Blocks.rail); + registerItemBlock(Blocks.stone_stairs); + registerItemBlock(Blocks.lever); + registerItemBlock(Blocks.stone_pressure_plate); + registerItemBlock(Blocks.wooden_pressure_plate); + registerItemBlock(Blocks.redstone_ore); + registerItemBlock(Blocks.redstone_torch); + registerItemBlock(Blocks.stone_button); + registerItemBlock(Blocks.snow_layer, new ItemSnow(Blocks.snow_layer)); + registerItemBlock(Blocks.ice); + registerItemBlock(Blocks.snow); + registerItemBlock(Blocks.cactus); + registerItemBlock(Blocks.clay); + registerItemBlock(Blocks.jukebox); + registerItemBlock(Blocks.oak_fence); + registerItemBlock(Blocks.spruce_fence); + registerItemBlock(Blocks.birch_fence); + registerItemBlock(Blocks.jungle_fence); + registerItemBlock(Blocks.dark_oak_fence); + registerItemBlock(Blocks.acacia_fence); + registerItemBlock(Blocks.pumpkin); + registerItemBlock(Blocks.netherrack); + registerItemBlock(Blocks.soul_sand); + registerItemBlock(Blocks.glowstone); + registerItemBlock(Blocks.lit_pumpkin); + registerItemBlock(Blocks.trapdoor); + registerItemBlock(Blocks.monster_egg, (new ItemMultiTexture(Blocks.monster_egg, Blocks.monster_egg, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockSilverfish.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("monsterStoneEgg")); + registerItemBlock(Blocks.stonebrick, (new ItemMultiTexture(Blocks.stonebrick, Blocks.stonebrick, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockStoneBrick.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("stonebricksmooth")); + registerItemBlock(Blocks.brown_mushroom_block); + registerItemBlock(Blocks.red_mushroom_block); + registerItemBlock(Blocks.iron_bars); + registerItemBlock(Blocks.glass_pane); + registerItemBlock(Blocks.melon_block); + registerItemBlock(Blocks.vine, new ItemColored(Blocks.vine, false)); + registerItemBlock(Blocks.oak_fence_gate); + registerItemBlock(Blocks.spruce_fence_gate); + registerItemBlock(Blocks.birch_fence_gate); + registerItemBlock(Blocks.jungle_fence_gate); + registerItemBlock(Blocks.dark_oak_fence_gate); + registerItemBlock(Blocks.acacia_fence_gate); + registerItemBlock(Blocks.brick_stairs); + registerItemBlock(Blocks.stone_brick_stairs); + registerItemBlock(Blocks.mycelium); + registerItemBlock(Blocks.waterlily, new ItemLilyPad(Blocks.waterlily)); + registerItemBlock(Blocks.nether_brick); + registerItemBlock(Blocks.nether_brick_fence); + registerItemBlock(Blocks.nether_brick_stairs); + registerItemBlock(Blocks.enchanting_table); + registerItemBlock(Blocks.end_portal_frame); + registerItemBlock(Blocks.end_stone); + registerItemBlock(Blocks.dragon_egg); + registerItemBlock(Blocks.redstone_lamp); + registerItemBlock(Blocks.wooden_slab, (new ItemSlab(Blocks.wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab)).setUnlocalizedName("woodSlab")); + registerItemBlock(Blocks.sandstone_stairs); + registerItemBlock(Blocks.emerald_ore); + registerItemBlock(Blocks.ender_chest); + registerItemBlock(Blocks.tripwire_hook); + registerItemBlock(Blocks.emerald_block); + registerItemBlock(Blocks.spruce_stairs); + registerItemBlock(Blocks.birch_stairs); + registerItemBlock(Blocks.jungle_stairs); + registerItemBlock(Blocks.command_block); + registerItemBlock(Blocks.beacon); + registerItemBlock(Blocks.cobblestone_wall, (new ItemMultiTexture(Blocks.cobblestone_wall, Blocks.cobblestone_wall, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockWall.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("cobbleWall")); + registerItemBlock(Blocks.wooden_button); + registerItemBlock(Blocks.anvil, (new ItemAnvilBlock(Blocks.anvil)).setUnlocalizedName("anvil")); + registerItemBlock(Blocks.trapped_chest); + registerItemBlock(Blocks.light_weighted_pressure_plate); + registerItemBlock(Blocks.heavy_weighted_pressure_plate); + registerItemBlock(Blocks.daylight_detector); + registerItemBlock(Blocks.redstone_block); + registerItemBlock(Blocks.quartz_ore); + registerItemBlock(Blocks.hopper); + registerItemBlock(Blocks.quartz_block, (new ItemMultiTexture(Blocks.quartz_block, Blocks.quartz_block, new String[] {"default", "chiseled", "lines"})).setUnlocalizedName("quartzBlock")); + registerItemBlock(Blocks.quartz_stairs); + registerItemBlock(Blocks.activator_rail); + registerItemBlock(Blocks.dropper); + registerItemBlock(Blocks.stained_hardened_clay, (new ItemCloth(Blocks.stained_hardened_clay)).setUnlocalizedName("clayHardenedStained")); + registerItemBlock(Blocks.barrier); + registerItemBlock(Blocks.iron_trapdoor); + registerItemBlock(Blocks.hay_block); + registerItemBlock(Blocks.carpet, (new ItemCloth(Blocks.carpet)).setUnlocalizedName("woolCarpet")); + registerItemBlock(Blocks.hardened_clay); + registerItemBlock(Blocks.coal_block); + registerItemBlock(Blocks.packed_ice); + registerItemBlock(Blocks.acacia_stairs); + registerItemBlock(Blocks.dark_oak_stairs); + registerItemBlock(Blocks.slime_block); + registerItemBlock(Blocks.double_plant, (new ItemDoublePlant(Blocks.double_plant, Blocks.double_plant, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockDoublePlant.EnumPlantType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("doublePlant")); + registerItemBlock(Blocks.stained_glass, (new ItemCloth(Blocks.stained_glass)).setUnlocalizedName("stainedGlass")); + registerItemBlock(Blocks.stained_glass_pane, (new ItemCloth(Blocks.stained_glass_pane)).setUnlocalizedName("stainedGlassPane")); + registerItemBlock(Blocks.prismarine, (new ItemMultiTexture(Blocks.prismarine, Blocks.prismarine, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockPrismarine.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("prismarine")); + registerItemBlock(Blocks.sea_lantern); + registerItemBlock(Blocks.red_sandstone, (new ItemMultiTexture(Blocks.red_sandstone, Blocks.red_sandstone, new Function() + { + public String apply(ItemStack p_apply_1_) + { + return BlockRedSandstone.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName(); + } + })).setUnlocalizedName("redSandStone")); + registerItemBlock(Blocks.red_sandstone_stairs); + registerItemBlock(Blocks.stone_slab2, (new ItemSlab(Blocks.stone_slab2, Blocks.stone_slab2, Blocks.double_stone_slab2)).setUnlocalizedName("stoneSlab2")); + registerItem(256, "iron_shovel", (new ItemSpade(Item.ToolMaterial.IRON)).setUnlocalizedName("shovelIron")); + registerItem(257, "iron_pickaxe", (new ItemPickaxe(Item.ToolMaterial.IRON)).setUnlocalizedName("pickaxeIron")); + registerItem(258, "iron_axe", (new ItemAxe(Item.ToolMaterial.IRON)).setUnlocalizedName("hatchetIron")); + registerItem(259, "flint_and_steel", (new ItemFlintAndSteel()).setUnlocalizedName("flintAndSteel")); + registerItem(260, "apple", (new ItemFood(4, 0.3F, false)).setUnlocalizedName("apple")); + registerItem(261, "bow", (new ItemBow()).setUnlocalizedName("bow")); + registerItem(262, "arrow", (new Item()).setUnlocalizedName("arrow").setCreativeTab(CreativeTabs.tabCombat)); + registerItem(263, "coal", (new ItemCoal()).setUnlocalizedName("coal")); + registerItem(264, "diamond", (new Item()).setUnlocalizedName("diamond").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(265, "iron_ingot", (new Item()).setUnlocalizedName("ingotIron").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(266, "gold_ingot", (new Item()).setUnlocalizedName("ingotGold").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(267, "iron_sword", (new ItemSword(Item.ToolMaterial.IRON)).setUnlocalizedName("swordIron")); + registerItem(268, "wooden_sword", (new ItemSword(Item.ToolMaterial.WOOD)).setUnlocalizedName("swordWood")); + registerItem(269, "wooden_shovel", (new ItemSpade(Item.ToolMaterial.WOOD)).setUnlocalizedName("shovelWood")); + registerItem(270, "wooden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("pickaxeWood")); + registerItem(271, "wooden_axe", (new ItemAxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hatchetWood")); + registerItem(272, "stone_sword", (new ItemSword(Item.ToolMaterial.STONE)).setUnlocalizedName("swordStone")); + registerItem(273, "stone_shovel", (new ItemSpade(Item.ToolMaterial.STONE)).setUnlocalizedName("shovelStone")); + registerItem(274, "stone_pickaxe", (new ItemPickaxe(Item.ToolMaterial.STONE)).setUnlocalizedName("pickaxeStone")); + registerItem(275, "stone_axe", (new ItemAxe(Item.ToolMaterial.STONE)).setUnlocalizedName("hatchetStone")); + registerItem(276, "diamond_sword", (new ItemSword(Item.ToolMaterial.EMERALD)).setUnlocalizedName("swordDiamond")); + registerItem(277, "diamond_shovel", (new ItemSpade(Item.ToolMaterial.EMERALD)).setUnlocalizedName("shovelDiamond")); + registerItem(278, "diamond_pickaxe", (new ItemPickaxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("pickaxeDiamond")); + registerItem(279, "diamond_axe", (new ItemAxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hatchetDiamond")); + registerItem(280, "stick", (new Item()).setFull3D().setUnlocalizedName("stick").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(281, "bowl", (new Item()).setUnlocalizedName("bowl").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(282, "mushroom_stew", (new ItemSoup(6)).setUnlocalizedName("mushroomStew")); + registerItem(283, "golden_sword", (new ItemSword(Item.ToolMaterial.GOLD)).setUnlocalizedName("swordGold")); + registerItem(284, "golden_shovel", (new ItemSpade(Item.ToolMaterial.GOLD)).setUnlocalizedName("shovelGold")); + registerItem(285, "golden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("pickaxeGold")); + registerItem(286, "golden_axe", (new ItemAxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hatchetGold")); + registerItem(287, "string", (new ItemReed(Blocks.tripwire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(288, "feather", (new Item()).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(289, "gunpowder", (new Item()).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(290, "wooden_hoe", (new ItemHoe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hoeWood")); + registerItem(291, "stone_hoe", (new ItemHoe(Item.ToolMaterial.STONE)).setUnlocalizedName("hoeStone")); + registerItem(292, "iron_hoe", (new ItemHoe(Item.ToolMaterial.IRON)).setUnlocalizedName("hoeIron")); + registerItem(293, "diamond_hoe", (new ItemHoe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hoeDiamond")); + registerItem(294, "golden_hoe", (new ItemHoe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hoeGold")); + registerItem(295, "wheat_seeds", (new ItemSeeds(Blocks.wheat, Blocks.farmland)).setUnlocalizedName("seeds")); + registerItem(296, "wheat", (new Item()).setUnlocalizedName("wheat").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(297, "bread", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("bread")); + registerItem(298, "leather_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 0)).setUnlocalizedName("helmetCloth")); + registerItem(299, "leather_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 1)).setUnlocalizedName("chestplateCloth")); + registerItem(300, "leather_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 2)).setUnlocalizedName("leggingsCloth")); + registerItem(301, "leather_boots", (new ItemArmor(ItemArmor.ArmorMaterial.LEATHER, 0, 3)).setUnlocalizedName("bootsCloth")); + registerItem(302, "chainmail_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 0)).setUnlocalizedName("helmetChain")); + registerItem(303, "chainmail_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 1)).setUnlocalizedName("chestplateChain")); + registerItem(304, "chainmail_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 2)).setUnlocalizedName("leggingsChain")); + registerItem(305, "chainmail_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 3)).setUnlocalizedName("bootsChain")); + registerItem(306, "iron_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 0)).setUnlocalizedName("helmetIron")); + registerItem(307, "iron_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 1)).setUnlocalizedName("chestplateIron")); + registerItem(308, "iron_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 2)).setUnlocalizedName("leggingsIron")); + registerItem(309, "iron_boots", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 3)).setUnlocalizedName("bootsIron")); + registerItem(310, "diamond_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)).setUnlocalizedName("helmetDiamond")); + registerItem(311, "diamond_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 1)).setUnlocalizedName("chestplateDiamond")); + registerItem(312, "diamond_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 2)).setUnlocalizedName("leggingsDiamond")); + registerItem(313, "diamond_boots", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)).setUnlocalizedName("bootsDiamond")); + registerItem(314, "golden_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 0)).setUnlocalizedName("helmetGold")); + registerItem(315, "golden_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold")); + registerItem(316, "golden_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold")); + registerItem(317, "golden_boots", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold")); + registerItem(318, "flint", (new Item()).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(319, "porkchop", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("porkchopRaw")); + registerItem(320, "cooked_porkchop", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("porkchopCooked")); + registerItem(321, "painting", (new ItemHangingEntity(EntityPainting.class)).setUnlocalizedName("painting")); + registerItem(322, "golden_apple", (new ItemAppleGold(4, 1.2F, false)).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 1, 1.0F).setUnlocalizedName("appleGold")); + registerItem(323, "sign", (new ItemSign()).setUnlocalizedName("sign")); + registerItem(324, "wooden_door", (new ItemDoor(Blocks.oak_door)).setUnlocalizedName("doorOak")); + Item item = (new ItemBucket(Blocks.air)).setUnlocalizedName("bucket").setMaxStackSize(16); + registerItem(325, "bucket", item); + registerItem(326, "water_bucket", (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(item)); + registerItem(327, "lava_bucket", (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(item)); + registerItem(328, "minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.RIDEABLE)).setUnlocalizedName("minecart")); + registerItem(329, "saddle", (new ItemSaddle()).setUnlocalizedName("saddle")); + registerItem(330, "iron_door", (new ItemDoor(Blocks.iron_door)).setUnlocalizedName("doorIron")); + registerItem(331, "redstone", (new ItemRedstone()).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect)); + registerItem(332, "snowball", (new ItemSnowball()).setUnlocalizedName("snowball")); + registerItem(333, "boat", (new ItemBoat()).setUnlocalizedName("boat")); + registerItem(334, "leather", (new Item()).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(335, "milk_bucket", (new ItemBucketMilk()).setUnlocalizedName("milk").setContainerItem(item)); + registerItem(336, "brick", (new Item()).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(337, "clay_ball", (new Item()).setUnlocalizedName("clay").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(338, "reeds", (new ItemReed(Blocks.reeds)).setUnlocalizedName("reeds").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(339, "paper", (new Item()).setUnlocalizedName("paper").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(340, "book", (new ItemBook()).setUnlocalizedName("book").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(341, "slime_ball", (new Item()).setUnlocalizedName("slimeball").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(342, "chest_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.CHEST)).setUnlocalizedName("minecartChest")); + registerItem(343, "furnace_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.FURNACE)).setUnlocalizedName("minecartFurnace")); + registerItem(344, "egg", (new ItemEgg()).setUnlocalizedName("egg")); + registerItem(345, "compass", (new Item()).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools)); + registerItem(346, "fishing_rod", (new ItemFishingRod()).setUnlocalizedName("fishingRod")); + registerItem(347, "clock", (new Item()).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools)); + registerItem(348, "glowstone_dust", (new Item()).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(349, "fish", (new ItemFishFood(false)).setUnlocalizedName("fish").setHasSubtypes(true)); + registerItem(350, "cooked_fish", (new ItemFishFood(true)).setUnlocalizedName("fish").setHasSubtypes(true)); + registerItem(351, "dye", (new ItemDye()).setUnlocalizedName("dyePowder")); + registerItem(352, "bone", (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc)); + registerItem(353, "sugar", (new Item()).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(354, "cake", (new ItemReed(Blocks.cake)).setMaxStackSize(1).setUnlocalizedName("cake").setCreativeTab(CreativeTabs.tabFood)); + registerItem(355, "bed", (new ItemBed()).setMaxStackSize(1).setUnlocalizedName("bed")); + registerItem(356, "repeater", (new ItemReed(Blocks.unpowered_repeater)).setUnlocalizedName("diode").setCreativeTab(CreativeTabs.tabRedstone)); + registerItem(357, "cookie", (new ItemFood(2, 0.1F, false)).setUnlocalizedName("cookie")); + registerItem(358, "filled_map", (new ItemMap()).setUnlocalizedName("map")); + registerItem(359, "shears", (new ItemShears()).setUnlocalizedName("shears")); + registerItem(360, "melon", (new ItemFood(2, 0.3F, false)).setUnlocalizedName("melon")); + registerItem(361, "pumpkin_seeds", (new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland)).setUnlocalizedName("seeds_pumpkin")); + registerItem(362, "melon_seeds", (new ItemSeeds(Blocks.melon_stem, Blocks.farmland)).setUnlocalizedName("seeds_melon")); + registerItem(363, "beef", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("beefRaw")); + registerItem(364, "cooked_beef", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("beefCooked")); + registerItem(365, "chicken", (new ItemFood(2, 0.3F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("chickenRaw")); + registerItem(366, "cooked_chicken", (new ItemFood(6, 0.6F, true)).setUnlocalizedName("chickenCooked")); + registerItem(367, "rotten_flesh", (new ItemFood(4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh")); + registerItem(368, "ender_pearl", (new ItemEnderPearl()).setUnlocalizedName("enderPearl")); + registerItem(369, "blaze_rod", (new Item()).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setFull3D()); + registerItem(370, "ghast_tear", (new Item()).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(371, "gold_nugget", (new Item()).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(372, "nether_wart", (new ItemSeeds(Blocks.nether_wart, Blocks.soul_sand)).setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4")); + registerItem(373, "potion", (new ItemPotion()).setUnlocalizedName("potion")); + registerItem(374, "glass_bottle", (new ItemGlassBottle()).setUnlocalizedName("glassBottle")); + registerItem(375, "spider_eye", (new ItemFood(2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect)); + registerItem(376, "fermented_spider_eye", (new Item()).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(377, "blaze_powder", (new Item()).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(378, "magma_cream", (new Item()).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(379, "brewing_stand", (new ItemReed(Blocks.brewing_stand)).setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(380, "cauldron", (new ItemReed(Blocks.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(381, "ender_eye", (new ItemEnderEye()).setUnlocalizedName("eyeOfEnder")); + registerItem(382, "speckled_melon", (new Item()).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(383, "spawn_egg", (new ItemMonsterPlacer()).setUnlocalizedName("monsterPlacer")); + registerItem(384, "experience_bottle", (new ItemExpBottle()).setUnlocalizedName("expBottle")); + registerItem(385, "fire_charge", (new ItemFireball()).setUnlocalizedName("fireball")); + registerItem(386, "writable_book", (new ItemWritableBook()).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(387, "written_book", (new ItemEditableBook()).setUnlocalizedName("writtenBook").setMaxStackSize(16)); + registerItem(388, "emerald", (new Item()).setUnlocalizedName("emerald").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(389, "item_frame", (new ItemHangingEntity(EntityItemFrame.class)).setUnlocalizedName("frame")); + registerItem(390, "flower_pot", (new ItemReed(Blocks.flower_pot)).setUnlocalizedName("flowerPot").setCreativeTab(CreativeTabs.tabDecorations)); + registerItem(391, "carrot", (new ItemSeedFood(3, 0.6F, Blocks.carrots, Blocks.farmland)).setUnlocalizedName("carrots")); + registerItem(392, "potato", (new ItemSeedFood(1, 0.3F, Blocks.potatoes, Blocks.farmland)).setUnlocalizedName("potato")); + registerItem(393, "baked_potato", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("potatoBaked")); + registerItem(394, "poisonous_potato", (new ItemFood(2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous")); + registerItem(395, "map", (new ItemEmptyMap()).setUnlocalizedName("emptyMap")); + registerItem(396, "golden_carrot", (new ItemFood(6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.goldenCarrotEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(397, "skull", (new ItemSkull()).setUnlocalizedName("skull")); + registerItem(398, "carrot_on_a_stick", (new ItemCarrotOnAStick()).setUnlocalizedName("carrotOnAStick")); + registerItem(399, "nether_star", (new ItemSimpleFoiled()).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(400, "pumpkin_pie", (new ItemFood(8, 0.3F, false)).setUnlocalizedName("pumpkinPie").setCreativeTab(CreativeTabs.tabFood)); + registerItem(401, "fireworks", (new ItemFirework()).setUnlocalizedName("fireworks")); + registerItem(402, "firework_charge", (new ItemFireworkCharge()).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc)); + registerItem(403, "enchanted_book", (new ItemEnchantedBook()).setMaxStackSize(1).setUnlocalizedName("enchantedBook")); + registerItem(404, "comparator", (new ItemReed(Blocks.unpowered_comparator)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone)); + registerItem(405, "netherbrick", (new Item()).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(406, "quartz", (new Item()).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(407, "tnt_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.TNT)).setUnlocalizedName("minecartTnt")); + registerItem(408, "hopper_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.HOPPER)).setUnlocalizedName("minecartHopper")); + registerItem(409, "prismarine_shard", (new Item()).setUnlocalizedName("prismarineShard").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(410, "prismarine_crystals", (new Item()).setUnlocalizedName("prismarineCrystals").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(411, "rabbit", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("rabbitRaw")); + registerItem(412, "cooked_rabbit", (new ItemFood(5, 0.6F, true)).setUnlocalizedName("rabbitCooked")); + registerItem(413, "rabbit_stew", (new ItemSoup(10)).setUnlocalizedName("rabbitStew")); + registerItem(414, "rabbit_foot", (new Item()).setUnlocalizedName("rabbitFoot").setPotionEffect(PotionHelper.rabbitFootEffect).setCreativeTab(CreativeTabs.tabBrewing)); + registerItem(415, "rabbit_hide", (new Item()).setUnlocalizedName("rabbitHide").setCreativeTab(CreativeTabs.tabMaterials)); + registerItem(416, "armor_stand", (new ItemArmorStand()).setUnlocalizedName("armorStand").setMaxStackSize(16)); + registerItem(417, "iron_horse_armor", (new Item()).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc)); + registerItem(418, "golden_horse_armor", (new Item()).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc)); + registerItem(419, "diamond_horse_armor", (new Item()).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc)); + registerItem(420, "lead", (new ItemLead()).setUnlocalizedName("leash")); + registerItem(421, "name_tag", (new ItemNameTag()).setUnlocalizedName("nameTag")); + registerItem(422, "command_block_minecart", (new ItemMinecart(EntityMinecart.EnumMinecartType.COMMAND_BLOCK)).setUnlocalizedName("minecartCommandBlock").setCreativeTab((CreativeTabs)null)); + registerItem(423, "mutton", (new ItemFood(2, 0.3F, true)).setUnlocalizedName("muttonRaw")); + registerItem(424, "cooked_mutton", (new ItemFood(6, 0.8F, true)).setUnlocalizedName("muttonCooked")); + registerItem(425, "banner", (new ItemBanner()).setUnlocalizedName("banner")); + registerItem(427, "spruce_door", (new ItemDoor(Blocks.spruce_door)).setUnlocalizedName("doorSpruce")); + registerItem(428, "birch_door", (new ItemDoor(Blocks.birch_door)).setUnlocalizedName("doorBirch")); + registerItem(429, "jungle_door", (new ItemDoor(Blocks.jungle_door)).setUnlocalizedName("doorJungle")); + registerItem(430, "acacia_door", (new ItemDoor(Blocks.acacia_door)).setUnlocalizedName("doorAcacia")); + registerItem(431, "dark_oak_door", (new ItemDoor(Blocks.dark_oak_door)).setUnlocalizedName("doorDarkOak")); + registerItem(2256, "record_13", (new ItemRecord("13")).setUnlocalizedName("record")); + registerItem(2257, "record_cat", (new ItemRecord("cat")).setUnlocalizedName("record")); + registerItem(2258, "record_blocks", (new ItemRecord("blocks")).setUnlocalizedName("record")); + registerItem(2259, "record_chirp", (new ItemRecord("chirp")).setUnlocalizedName("record")); + registerItem(2260, "record_far", (new ItemRecord("far")).setUnlocalizedName("record")); + registerItem(2261, "record_mall", (new ItemRecord("mall")).setUnlocalizedName("record")); + registerItem(2262, "record_mellohi", (new ItemRecord("mellohi")).setUnlocalizedName("record")); + registerItem(2263, "record_stal", (new ItemRecord("stal")).setUnlocalizedName("record")); + registerItem(2264, "record_strad", (new ItemRecord("strad")).setUnlocalizedName("record")); + registerItem(2265, "record_ward", (new ItemRecord("ward")).setUnlocalizedName("record")); + registerItem(2266, "record_11", (new ItemRecord("11")).setUnlocalizedName("record")); + registerItem(2267, "record_wait", (new ItemRecord("wait")).setUnlocalizedName("record")); + } + + private static void registerItemBlock(Block blockIn) + { + registerItemBlock(blockIn, new ItemBlock(blockIn)); + } + + protected static void registerItemBlock(Block blockIn, Item itemIn) + { + registerItem(Block.getIdFromBlock(blockIn), (ResourceLocation)Block.blockRegistry.getNameForObject(blockIn), itemIn); + BLOCK_TO_ITEM.put(blockIn, itemIn); + } + + private static void registerItem(int id, String textualID, Item itemIn) + { + registerItem(id, new ResourceLocation(textualID), itemIn); + } + + private static void registerItem(int id, ResourceLocation textualID, Item itemIn) + { + itemRegistry.register(id, textualID, itemIn); + } + + public static enum ToolMaterial + { + WOOD(0, 59, 2.0F, 0.0F, 15), + STONE(1, 131, 4.0F, 1.0F, 5), + IRON(2, 250, 6.0F, 2.0F, 14), + EMERALD(3, 1561, 8.0F, 3.0F, 10), + GOLD(0, 32, 12.0F, 0.0F, 22); + + private final int harvestLevel; + private final int maxUses; + private final float efficiencyOnProperMaterial; + private final float damageVsEntity; + private final int enchantability; + + private ToolMaterial(int harvestLevel, int maxUses, float efficiency, float damageVsEntity, int enchantability) + { + this.harvestLevel = harvestLevel; + this.maxUses = maxUses; + this.efficiencyOnProperMaterial = efficiency; + this.damageVsEntity = damageVsEntity; + this.enchantability = enchantability; + } + + public int getMaxUses() + { + return this.maxUses; + } + + public float getEfficiencyOnProperMaterial() + { + return this.efficiencyOnProperMaterial; + } + + public float getDamageVsEntity() + { + return this.damageVsEntity; + } + + public int getHarvestLevel() + { + return this.harvestLevel; + } + + public int getEnchantability() + { + return this.enchantability; + } + + public Item getRepairItem() + { + return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemAnvilBlock.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemAnvilBlock.java new file mode 100644 index 0000000..8b53d1c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemAnvilBlock.java @@ -0,0 +1,16 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; + +public class ItemAnvilBlock extends ItemMultiTexture +{ + public ItemAnvilBlock(Block block) + { + super(block, block, new String[] {"intact", "slightlyDamaged", "veryDamaged"}); + } + + public int getMetadata(int damage) + { + return damage << 2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemAppleGold.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemAppleGold.java new file mode 100644 index 0000000..21fc2ce --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemAppleGold.java @@ -0,0 +1,55 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class ItemAppleGold extends ItemFood +{ + public ItemAppleGold(int amount, float saturation, boolean isWolfFood) + { + super(amount, saturation, isWolfFood); + this.setHasSubtypes(true); + } + + public boolean hasEffect(ItemStack stack) + { + return stack.getMetadata() > 0; + } + + public EnumRarity getRarity(ItemStack stack) + { + return stack.getMetadata() == 0 ? EnumRarity.RARE : EnumRarity.EPIC; + } + + protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) + { + if (!worldIn.isRemote) + { + player.addPotionEffect(new PotionEffect(Potion.absorption.id, 2400, 0)); + } + + if (stack.getMetadata() > 0) + { + if (!worldIn.isRemote) + { + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); + player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); + } + } + else + { + super.onFoodEaten(stack, worldIn, player); + } + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + subItems.add(new ItemStack(itemIn, 1, 0)); + subItems.add(new ItemStack(itemIn, 1, 1)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemArmor.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemArmor.java new file mode 100644 index 0000000..52516dd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemArmor.java @@ -0,0 +1,243 @@ +package net.minecraft.item; + +import com.google.common.base.Predicates; +import java.util.List; +import net.minecraft.block.BlockDispenser; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EntitySelectors; +import net.minecraft.world.World; + +public class ItemArmor extends Item +{ + private static final int[] maxDamageArray = new int[] {11, 16, 15, 13}; + public static final String[] EMPTY_SLOT_NAMES = new String[] {"minecraft:items/empty_armor_slot_helmet", "minecraft:items/empty_armor_slot_chestplate", "minecraft:items/empty_armor_slot_leggings", "minecraft:items/empty_armor_slot_boots"}; + private static final IBehaviorDispenseItem dispenserBehavior = new BehaviorDefaultDispenseItem() + { + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); + int i = blockpos.getX(); + int j = blockpos.getY(); + int k = blockpos.getZ(); + AxisAlignedBB axisalignedbb = new AxisAlignedBB((double)i, (double)j, (double)k, (double)(i + 1), (double)(j + 1), (double)(k + 1)); + List list = source.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb, Predicates. and (EntitySelectors.NOT_SPECTATING, new EntitySelectors.ArmoredMob(stack))); + + if (list.size() > 0) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0); + int l = entitylivingbase instanceof EntityPlayer ? 1 : 0; + int i1 = EntityLiving.getArmorPosition(stack); + ItemStack itemstack = stack.copy(); + itemstack.stackSize = 1; + entitylivingbase.setCurrentItemOrArmor(i1 - l, itemstack); + + if (entitylivingbase instanceof EntityLiving) + { + ((EntityLiving)entitylivingbase).setEquipmentDropChance(i1, 2.0F); + } + + --stack.stackSize; + return stack; + } + else + { + return super.dispenseStack(source, stack); + } + } + }; + public final int armorType; + public final int damageReduceAmount; + public final int renderIndex; + private final ItemArmor.ArmorMaterial material; + + public ItemArmor(ItemArmor.ArmorMaterial material, int renderIndex, int armorType) + { + this.material = material; + this.armorType = armorType; + this.renderIndex = renderIndex; + this.damageReduceAmount = material.getDamageReductionAmount(armorType); + this.setMaxDamage(material.getDurability(armorType)); + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabCombat); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserBehavior); + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + if (renderPass > 0) + { + return 16777215; + } + else + { + int i = this.getColor(stack); + + if (i < 0) + { + i = 16777215; + } + + return i; + } + } + + public int getItemEnchantability() + { + return this.material.getEnchantability(); + } + + public ItemArmor.ArmorMaterial getArmorMaterial() + { + return this.material; + } + + public boolean hasColor(ItemStack stack) + { + return this.material != ItemArmor.ArmorMaterial.LEATHER ? false : (!stack.hasTagCompound() ? false : (!stack.getTagCompound().hasKey("display", 10) ? false : stack.getTagCompound().getCompoundTag("display").hasKey("color", 3))); + } + + public int getColor(ItemStack stack) + { + if (this.material != ItemArmor.ArmorMaterial.LEATHER) + { + return -1; + } + else + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound != null) + { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + + if (nbttagcompound1 != null && nbttagcompound1.hasKey("color", 3)) + { + return nbttagcompound1.getInteger("color"); + } + } + + return 10511680; + } + } + + public void removeColor(ItemStack stack) + { + if (this.material == ItemArmor.ArmorMaterial.LEATHER) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound != null) + { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + + if (nbttagcompound1.hasKey("color")) + { + nbttagcompound1.removeTag("color"); + } + } + } + } + + public void setColor(ItemStack stack, int color) + { + if (this.material != ItemArmor.ArmorMaterial.LEATHER) + { + throw new UnsupportedOperationException("Can\'t dye non-leather!"); + } + else + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound == null) + { + nbttagcompound = new NBTTagCompound(); + stack.setTagCompound(nbttagcompound); + } + + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + + if (!nbttagcompound.hasKey("display", 10)) + { + nbttagcompound.setTag("display", nbttagcompound1); + } + + nbttagcompound1.setInteger("color", color); + } + } + + public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) + { + return this.material.getRepairItem() == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + int i = EntityLiving.getArmorPosition(itemStackIn) - 1; + ItemStack itemstack = playerIn.getCurrentArmor(i); + + if (itemstack == null) + { + playerIn.setCurrentItemOrArmor(i, itemStackIn.copy()); + itemStackIn.stackSize = 0; + } + + return itemStackIn; + } + + public static enum ArmorMaterial + { + LEATHER("leather", 5, new int[]{1, 3, 2, 1}, 15), + CHAIN("chainmail", 15, new int[]{2, 5, 4, 1}, 12), + IRON("iron", 15, new int[]{2, 6, 5, 2}, 9), + GOLD("gold", 7, new int[]{2, 5, 3, 1}, 25), + DIAMOND("diamond", 33, new int[]{3, 8, 6, 3}, 10); + + private final String name; + private final int maxDamageFactor; + private final int[] damageReductionAmountArray; + private final int enchantability; + + private ArmorMaterial(String name, int maxDamage, int[] reductionAmounts, int enchantability) + { + this.name = name; + this.maxDamageFactor = maxDamage; + this.damageReductionAmountArray = reductionAmounts; + this.enchantability = enchantability; + } + + public int getDurability(int armorType) + { + return ItemArmor.maxDamageArray[armorType] * this.maxDamageFactor; + } + + public int getDamageReductionAmount(int armorType) + { + return this.damageReductionAmountArray[armorType]; + } + + public int getEnchantability() + { + return this.enchantability; + } + + public Item getRepairItem() + { + return this == LEATHER ? Items.leather : (this == CHAIN ? Items.iron_ingot : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == DIAMOND ? Items.diamond : null)))); + } + + public String getName() + { + return this.name; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemArmorStand.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemArmorStand.java new file mode 100644 index 0000000..18c1383 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemArmorStand.java @@ -0,0 +1,103 @@ +package net.minecraft.item; + +import java.util.List; +import java.util.Random; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Rotations; +import net.minecraft.world.World; + +public class ItemArmorStand extends Item +{ + public ItemArmorStand() + { + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side == EnumFacing.DOWN) + { + return false; + } + else + { + boolean flag = worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos); + BlockPos blockpos = flag ? pos : pos.offset(side); + + if (!playerIn.canPlayerEdit(blockpos, side, stack)) + { + return false; + } + else + { + BlockPos blockpos1 = blockpos.up(); + boolean flag1 = !worldIn.isAirBlock(blockpos) && !worldIn.getBlockState(blockpos).getBlock().isReplaceable(worldIn, blockpos); + flag1 = flag1 | (!worldIn.isAirBlock(blockpos1) && !worldIn.getBlockState(blockpos1).getBlock().isReplaceable(worldIn, blockpos1)); + + if (flag1) + { + return false; + } + else + { + double d0 = (double)blockpos.getX(); + double d1 = (double)blockpos.getY(); + double d2 = (double)blockpos.getZ(); + List list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.fromBounds(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D)); + + if (list.size() > 0) + { + return false; + } + else + { + if (!worldIn.isRemote) + { + worldIn.setBlockToAir(blockpos); + worldIn.setBlockToAir(blockpos1); + EntityArmorStand entityarmorstand = new EntityArmorStand(worldIn, d0 + 0.5D, d1, d2 + 0.5D); + float f = (float)MathHelper.floor_float((MathHelper.wrapAngleTo180_float(playerIn.rotationYaw - 180.0F) + 22.5F) / 45.0F) * 45.0F; + entityarmorstand.setLocationAndAngles(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F); + this.applyRandomRotations(entityarmorstand, worldIn.rand); + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound != null && nbttagcompound.hasKey("EntityTag", 10)) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entityarmorstand.writeToNBTOptional(nbttagcompound1); + nbttagcompound1.merge(nbttagcompound.getCompoundTag("EntityTag")); + entityarmorstand.readFromNBT(nbttagcompound1); + } + + worldIn.spawnEntityInWorld(entityarmorstand); + } + + --stack.stackSize; + return true; + } + } + } + } + } + + private void applyRandomRotations(EntityArmorStand armorStand, Random rand) + { + Rotations rotations = armorStand.getHeadRotation(); + float f = rand.nextFloat() * 5.0F; + float f1 = rand.nextFloat() * 20.0F - 10.0F; + Rotations rotations1 = new Rotations(rotations.getX() + f, rotations.getY() + f1, rotations.getZ()); + armorStand.setHeadRotation(rotations1); + rotations = armorStand.getBodyRotation(); + f = rand.nextFloat() * 10.0F - 5.0F; + rotations1 = new Rotations(rotations.getX(), rotations.getY() + f, rotations.getZ()); + armorStand.setBodyRotation(rotations1); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemAxe.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemAxe.java new file mode 100644 index 0000000..6859a4b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemAxe.java @@ -0,0 +1,22 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; + +public class ItemAxe extends ItemTool +{ + private static final Set EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder}); + + protected ItemAxe(Item.ToolMaterial material) + { + super(3.0F, material, EFFECTIVE_ON); + } + + public float getStrVsBlock(ItemStack stack, Block state) + { + return state.getMaterial() != Material.wood && state.getMaterial() != Material.plants && state.getMaterial() != Material.vine ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBanner.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBanner.java new file mode 100644 index 0000000..9601a0b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBanner.java @@ -0,0 +1,159 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.block.BlockStandingSign; +import net.minecraft.block.BlockWallSign; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemBanner extends ItemBlock +{ + public ItemBanner() + { + super(Blocks.standing_banner); + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side == EnumFacing.DOWN) + { + return false; + } + else if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid()) + { + return false; + } + else + { + pos = pos.offset(side); + + if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else if (!Blocks.standing_banner.canPlaceBlockAt(worldIn, pos)) + { + return false; + } + else if (worldIn.isRemote) + { + return true; + } + else + { + if (side == EnumFacing.UP) + { + int i = MathHelper.floor_double((double)((playerIn.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; + worldIn.setBlockState(pos, Blocks.standing_banner.getDefaultState().withProperty(BlockStandingSign.ROTATION, Integer.valueOf(i)), 3); + } + else + { + worldIn.setBlockState(pos, Blocks.wall_banner.getDefaultState().withProperty(BlockWallSign.FACING, side), 3); + } + + --stack.stackSize; + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityBanner) + { + ((TileEntityBanner)tileentity).setItemValues(stack); + } + + return true; + } + } + } + + public String getItemStackDisplayName(ItemStack stack) + { + String s = "item.banner."; + EnumDyeColor enumdyecolor = this.getBaseColor(stack); + s = s + enumdyecolor.getUnlocalizedName() + ".name"; + return StatCollector.translateToLocal(s); + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + + if (nbttagcompound != null && nbttagcompound.hasKey("Patterns")) + { + NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10); + + for (int i = 0; i < nbttaglist.tagCount() && i < 6; ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound1.getInteger("Color")); + TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern")); + + if (tileentitybanner$enumbannerpattern != null) + { + tooltip.add(StatCollector.translateToLocal("item.banner." + tileentitybanner$enumbannerpattern.getPatternName() + "." + enumdyecolor.getUnlocalizedName())); + } + } + } + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + if (renderPass == 0) + { + return 16777215; + } + else + { + EnumDyeColor enumdyecolor = this.getBaseColor(stack); + return enumdyecolor.getMapColor().colorValue; + } + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, enumdyecolor.getDyeDamage(), (NBTTagList)null); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("BlockEntityTag", nbttagcompound); + ItemStack itemstack = new ItemStack(itemIn, 1, enumdyecolor.getDyeDamage()); + itemstack.setTagCompound(nbttagcompound1); + subItems.add(itemstack); + } + } + + public CreativeTabs getCreativeTab() + { + return CreativeTabs.tabDecorations; + } + + private EnumDyeColor getBaseColor(ItemStack stack) + { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + EnumDyeColor enumdyecolor = null; + + if (nbttagcompound != null && nbttagcompound.hasKey("Base")) + { + enumdyecolor = EnumDyeColor.byDyeDamage(nbttagcompound.getInteger("Base")); + } + else + { + enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata()); + } + + return enumdyecolor; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBed.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBed.java new file mode 100644 index 0000000..265ae79 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBed.java @@ -0,0 +1,76 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemBed extends Item +{ + public ItemBed() + { + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else if (side != EnumFacing.UP) + { + return false; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + boolean flag = block.isReplaceable(worldIn, pos); + + if (!flag) + { + pos = pos.up(); + } + + int i = MathHelper.floor_double((double)(playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + EnumFacing enumfacing = EnumFacing.getHorizontal(i); + BlockPos blockpos = pos.offset(enumfacing); + + if (playerIn.canPlayerEdit(pos, side, stack) && playerIn.canPlayerEdit(blockpos, side, stack)) + { + boolean flag1 = worldIn.getBlockState(blockpos).getBlock().isReplaceable(worldIn, blockpos); + boolean flag2 = flag || worldIn.isAirBlock(pos); + boolean flag3 = flag1 || worldIn.isAirBlock(blockpos); + + if (flag2 && flag3 && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && World.doesBlockHaveSolidTopSurface(worldIn, blockpos.down())) + { + IBlockState iblockstate1 = Blocks.bed.getDefaultState().withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)).withProperty(BlockBed.FACING, enumfacing).withProperty(BlockBed.PART, BlockBed.EnumPartType.FOOT); + + if (worldIn.setBlockState(pos, iblockstate1, 3)) + { + IBlockState iblockstate2 = iblockstate1.withProperty(BlockBed.PART, BlockBed.EnumPartType.HEAD); + worldIn.setBlockState(blockpos, iblockstate2, 3); + } + + --stack.stackSize; + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBlock.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBlock.java new file mode 100644 index 0000000..ba76ce1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBlock.java @@ -0,0 +1,160 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemBlock extends Item +{ + protected final Block block; + + public ItemBlock(Block block) + { + this.block = block; + } + + public ItemBlock setUnlocalizedName(String unlocalizedName) + { + super.setUnlocalizedName(unlocalizedName); + return this; + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (!block.isReplaceable(worldIn, pos)) + { + pos = pos.offset(side); + } + + if (stack.stackSize == 0) + { + return false; + } + else if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else if (worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity)null, stack)) + { + int i = this.getMetadata(stack.getMetadata()); + IBlockState iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, i, playerIn); + + if (worldIn.setBlockState(pos, iblockstate1, 3)) + { + iblockstate1 = worldIn.getBlockState(pos); + + if (iblockstate1.getBlock() == this.block) + { + setTileEntityNBT(worldIn, playerIn, pos, stack); + this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); + } + + worldIn.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F); + --stack.stackSize; + } + + return true; + } + else + { + return false; + } + } + + public static boolean setTileEntityNBT(World worldIn, EntityPlayer pos, BlockPos stack, ItemStack p_179224_3_) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (minecraftserver == null) + { + return false; + } + else + { + if (p_179224_3_.hasTagCompound() && p_179224_3_.getTagCompound().hasKey("BlockEntityTag", 10)) + { + TileEntity tileentity = worldIn.getTileEntity(stack); + + if (tileentity != null) + { + if (!worldIn.isRemote && tileentity.func_183000_F() && !minecraftserver.getConfigurationManager().canSendCommands(pos.getGameProfile())) + { + return false; + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttagcompound.copy(); + tileentity.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound2 = (NBTTagCompound)p_179224_3_.getTagCompound().getTag("BlockEntityTag"); + nbttagcompound.merge(nbttagcompound2); + nbttagcompound.setInteger("x", stack.getX()); + nbttagcompound.setInteger("y", stack.getY()); + nbttagcompound.setInteger("z", stack.getZ()); + + if (!nbttagcompound.equals(nbttagcompound1)) + { + tileentity.readFromNBT(nbttagcompound); + tileentity.markDirty(); + return true; + } + } + } + + return false; + } + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) + { + Block block = worldIn.getBlockState(pos).getBlock(); + + if (block == Blocks.snow_layer) + { + side = EnumFacing.UP; + } + else if (!block.isReplaceable(worldIn, pos)) + { + pos = pos.offset(side); + } + + return worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity)null, stack); + } + + public String getUnlocalizedName(ItemStack stack) + { + return this.block.getUnlocalizedName(); + } + + public String getUnlocalizedName() + { + return this.block.getUnlocalizedName(); + } + + public CreativeTabs getCreativeTab() + { + return this.block.getCreativeTabToDisplayOn(); + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + this.block.getSubBlocks(itemIn, tab, subItems); + } + + public Block getBlock() + { + return this.block; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBoat.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBoat.java new file mode 100644 index 0000000..a275c3b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBoat.java @@ -0,0 +1,111 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class ItemBoat extends Item +{ + public ItemBoat() + { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + float f = 1.0F; + float f1 = playerIn.prevRotationPitch + (playerIn.rotationPitch - playerIn.prevRotationPitch) * f; + float f2 = playerIn.prevRotationYaw + (playerIn.rotationYaw - playerIn.prevRotationYaw) * f; + double d0 = playerIn.prevPosX + (playerIn.posX - playerIn.prevPosX) * (double)f; + double d1 = playerIn.prevPosY + (playerIn.posY - playerIn.prevPosY) * (double)f + (double)playerIn.getEyeHeight(); + double d2 = playerIn.prevPosZ + (playerIn.posZ - playerIn.prevPosZ) * (double)f; + Vec3 vec3 = new Vec3(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; + Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); + MovingObjectPosition movingobjectposition = worldIn.rayTraceBlocks(vec3, vec31, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + Vec3 vec32 = playerIn.getLook(f); + boolean flag = false; + float f9 = 1.0F; + List list = worldIn.getEntitiesWithinAABBExcludingEntity(playerIn, playerIn.getEntityBoundingBox().addCoord(vec32.xCoord * d3, vec32.yCoord * d3, vec32.zCoord * d3).expand((double)f9, (double)f9, (double)f9)); + + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (entity.canBeCollidedWith()) + { + float f10 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.getEntityBoundingBox().expand((double)f10, (double)f10, (double)f10); + + if (axisalignedbb.isVecInside(vec3)) + { + flag = true; + } + } + } + + if (flag) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + BlockPos blockpos = movingobjectposition.getBlockPos(); + + if (worldIn.getBlockState(blockpos).getBlock() == Blocks.snow_layer) + { + blockpos = blockpos.down(); + } + + EntityBoat entityboat = new EntityBoat(worldIn, (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 1.0F), (double)((float)blockpos.getZ() + 0.5F)); + entityboat.rotationYaw = (float)(((MathHelper.floor_double((double)(playerIn.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); + + if (!worldIn.getCollidingBoundingBoxes(entityboat, entityboat.getEntityBoundingBox().expand(-0.1D, -0.1D, -0.1D)).isEmpty()) + { + return itemStackIn; + } + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(entityboat); + } + + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + + return itemStackIn; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBook.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBook.java new file mode 100644 index 0000000..f3ba85a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBook.java @@ -0,0 +1,14 @@ +package net.minecraft.item; + +public class ItemBook extends Item +{ + public boolean isItemTool(ItemStack stack) + { + return stack.stackSize == 1; + } + + public int getItemEnchantability() + { + return 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBow.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBow.java new file mode 100644 index 0000000..3b1c5fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBow.java @@ -0,0 +1,119 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemBow extends Item +{ + public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; + + public ItemBow() + { + this.maxStackSize = 1; + this.setMaxDamage(384); + this.setCreativeTab(CreativeTabs.tabCombat); + } + + public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityPlayer playerIn, int timeLeft) + { + boolean flag = playerIn.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0; + + if (flag || playerIn.inventory.hasItem(Items.arrow)) + { + int i = this.getMaxItemUseDuration(stack) - timeLeft; + float f = (float)i / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; + + if ((double)f < 0.1D) + { + return; + } + + if (f > 1.0F) + { + f = 1.0F; + } + + EntityArrow entityarrow = new EntityArrow(worldIn, playerIn, f * 2.0F); + + if (f == 1.0F) + { + entityarrow.setIsCritical(true); + } + + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, stack); + + if (j > 0) + { + entityarrow.setDamage(entityarrow.getDamage() + (double)j * 0.5D + 0.5D); + } + + int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, stack); + + if (k > 0) + { + entityarrow.setKnockbackStrength(k); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, stack) > 0) + { + entityarrow.setFire(100); + } + + stack.damageItem(1, playerIn); + worldIn.playSoundAtEntity(playerIn, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + + if (flag) + { + entityarrow.canBePickedUp = 2; + } + else + { + playerIn.inventory.consumeInventoryItem(Items.arrow); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(entityarrow); + } + } + } + + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + return stack; + } + + public int getMaxItemUseDuration(ItemStack stack) + { + return 72000; + } + + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.BOW; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (playerIn.capabilities.isCreativeMode || playerIn.inventory.hasItem(Items.arrow)) + { + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + } + + return itemStackIn; + } + + public int getItemEnchantability() + { + return 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBucket.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBucket.java new file mode 100644 index 0000000..e6eee57 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBucket.java @@ -0,0 +1,162 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemBucket extends Item +{ + private Block isFull; + + public ItemBucket(Block containedBlock) + { + this.maxStackSize = 1; + this.isFull = containedBlock; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + boolean flag = this.isFull == Blocks.air; + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, playerIn, flag); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + BlockPos blockpos = movingobjectposition.getBlockPos(); + + if (!worldIn.isBlockModifiable(playerIn, blockpos)) + { + return itemStackIn; + } + + if (flag) + { + if (!playerIn.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Material material = iblockstate.getBlock().getMaterial(); + + if (material == Material.water && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) + { + worldIn.setBlockToAir(blockpos); + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return this.fillBucket(itemStackIn, playerIn, Items.water_bucket); + } + + if (material == Material.lava && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) + { + worldIn.setBlockToAir(blockpos); + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return this.fillBucket(itemStackIn, playerIn, Items.lava_bucket); + } + } + else + { + if (this.isFull == Blocks.air) + { + return new ItemStack(Items.bucket); + } + + BlockPos blockpos1 = blockpos.offset(movingobjectposition.sideHit); + + if (!playerIn.canPlayerEdit(blockpos1, movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + if (this.tryPlaceContainedLiquid(worldIn, blockpos1) && !playerIn.capabilities.isCreativeMode) + { + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return new ItemStack(Items.bucket); + } + } + } + + return itemStackIn; + } + } + + private ItemStack fillBucket(ItemStack emptyBuckets, EntityPlayer player, Item fullBucket) + { + if (player.capabilities.isCreativeMode) + { + return emptyBuckets; + } + else if (--emptyBuckets.stackSize <= 0) + { + return new ItemStack(fullBucket); + } + else + { + if (!player.inventory.addItemStackToInventory(new ItemStack(fullBucket))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(fullBucket, 1, 0), false); + } + + return emptyBuckets; + } + } + + public boolean tryPlaceContainedLiquid(World worldIn, BlockPos pos) + { + if (this.isFull == Blocks.air) + { + return false; + } + else + { + Material material = worldIn.getBlockState(pos).getBlock().getMaterial(); + boolean flag = !material.isSolid(); + + if (!worldIn.isAirBlock(pos) && !flag) + { + return false; + } + else + { + if (worldIn.provider.doesWaterVaporize() && this.isFull == Blocks.flowing_water) + { + int i = pos.getX(); + int j = pos.getY(); + int k = pos.getZ(); + worldIn.playSoundEffect((double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F), "random.fizz", 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + + for (int l = 0; l < 8; ++l) + { + worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)i + Math.random(), (double)j + Math.random(), (double)k + Math.random(), 0.0D, 0.0D, 0.0D, new int[0]); + } + } + else + { + if (!worldIn.isRemote && flag && !material.isLiquid()) + { + worldIn.destroyBlock(pos, true); + } + + worldIn.setBlockState(pos, this.isFull.getDefaultState(), 3); + } + + return true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemBucketMilk.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBucketMilk.java new file mode 100644 index 0000000..028e239 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemBucketMilk.java @@ -0,0 +1,48 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemBucketMilk extends Item +{ + public ItemBucketMilk() + { + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + if (!playerIn.capabilities.isCreativeMode) + { + --stack.stackSize; + } + + if (!worldIn.isRemote) + { + playerIn.clearActivePotions(); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return stack.stackSize <= 0 ? new ItemStack(Items.bucket) : stack; + } + + public int getMaxItemUseDuration(ItemStack stack) + { + return 32; + } + + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.DRINK; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java new file mode 100644 index 0000000..a28377e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java @@ -0,0 +1,52 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemCarrotOnAStick extends Item +{ + public ItemCarrotOnAStick() + { + this.setCreativeTab(CreativeTabs.tabTransport); + this.setMaxStackSize(1); + this.setMaxDamage(25); + } + + public boolean isFull3D() + { + return true; + } + + public boolean shouldRotateAroundWhenRendering() + { + return true; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (playerIn.isRiding() && playerIn.ridingEntity instanceof EntityPig) + { + EntityPig entitypig = (EntityPig)playerIn.ridingEntity; + + if (entitypig.getAIControlledByPlayer().isControlledByPlayer() && itemStackIn.getMaxDamage() - itemStackIn.getMetadata() >= 7) + { + entitypig.getAIControlledByPlayer().boostSpeed(); + itemStackIn.damageItem(7, playerIn); + + if (itemStackIn.stackSize == 0) + { + ItemStack itemstack = new ItemStack(Items.fishing_rod); + itemstack.setTagCompound(itemStackIn.getTagCompound()); + return itemstack; + } + } + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemCloth.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemCloth.java new file mode 100644 index 0000000..393f72a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemCloth.java @@ -0,0 +1,23 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; + +public class ItemCloth extends ItemBlock +{ + public ItemCloth(Block block) + { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + public int getMetadata(int damage) + { + return damage; + } + + public String getUnlocalizedName(ItemStack stack) + { + return super.getUnlocalizedName() + "." + EnumDyeColor.byMetadata(stack.getMetadata()).getUnlocalizedName(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemCoal.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemCoal.java new file mode 100644 index 0000000..8f749ab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemCoal.java @@ -0,0 +1,25 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; + +public class ItemCoal extends Item +{ + public ItemCoal() + { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + public String getUnlocalizedName(ItemStack stack) + { + return stack.getMetadata() == 1 ? "item.charcoal" : "item.coal"; + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + subItems.add(new ItemStack(itemIn, 1, 0)); + subItems.add(new ItemStack(itemIn, 1, 1)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemColored.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemColored.java new file mode 100644 index 0000000..193df4e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemColored.java @@ -0,0 +1,50 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; + +public class ItemColored extends ItemBlock +{ + private final Block coloredBlock; + private String[] subtypeNames; + + public ItemColored(Block block, boolean hasSubtypes) + { + super(block); + this.coloredBlock = block; + + if (hasSubtypes) + { + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + return this.coloredBlock.getRenderColor(this.coloredBlock.getStateFromMeta(stack.getMetadata())); + } + + public int getMetadata(int damage) + { + return damage; + } + + public ItemColored setSubtypeNames(String[] names) + { + this.subtypeNames = names; + return this; + } + + public String getUnlocalizedName(ItemStack stack) + { + if (this.subtypeNames == null) + { + return super.getUnlocalizedName(stack); + } + else + { + int i = stack.getMetadata(); + return i >= 0 && i < this.subtypeNames.length ? super.getUnlocalizedName(stack) + "." + this.subtypeNames[i] : super.getUnlocalizedName(stack); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemDoor.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemDoor.java new file mode 100644 index 0000000..c52767f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemDoor.java @@ -0,0 +1,77 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemDoor extends Item +{ + private Block block; + + public ItemDoor(Block block) + { + this.block = block; + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side != EnumFacing.UP) + { + return false; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (!block.isReplaceable(worldIn, pos)) + { + pos = pos.offset(side); + } + + if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else if (!this.block.canPlaceBlockAt(worldIn, pos)) + { + return false; + } + else + { + placeDoor(worldIn, pos, EnumFacing.fromAngle((double)playerIn.rotationYaw), this.block); + --stack.stackSize; + return true; + } + } + } + + public static void placeDoor(World worldIn, BlockPos pos, EnumFacing facing, Block door) + { + BlockPos blockpos = pos.offset(facing.rotateY()); + BlockPos blockpos1 = pos.offset(facing.rotateYCCW()); + int i = (worldIn.getBlockState(blockpos1).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getBlockState(blockpos1.up()).getBlock().isNormalCube() ? 1 : 0); + int j = (worldIn.getBlockState(blockpos).getBlock().isNormalCube() ? 1 : 0) + (worldIn.getBlockState(blockpos.up()).getBlock().isNormalCube() ? 1 : 0); + boolean flag = worldIn.getBlockState(blockpos1).getBlock() == door || worldIn.getBlockState(blockpos1.up()).getBlock() == door; + boolean flag1 = worldIn.getBlockState(blockpos).getBlock() == door || worldIn.getBlockState(blockpos.up()).getBlock() == door; + boolean flag2 = false; + + if (flag && !flag1 || j > i) + { + flag2 = true; + } + + BlockPos blockpos2 = pos.up(); + IBlockState iblockstate = door.getDefaultState().withProperty(BlockDoor.FACING, facing).withProperty(BlockDoor.HINGE, flag2 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT); + worldIn.setBlockState(pos, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER), 2); + worldIn.setBlockState(blockpos2, iblockstate.withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2); + worldIn.notifyNeighborsOfStateChange(pos, door); + worldIn.notifyNeighborsOfStateChange(blockpos2, door); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemDoublePlant.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemDoublePlant.java new file mode 100644 index 0000000..502bf77 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemDoublePlant.java @@ -0,0 +1,20 @@ +package net.minecraft.item; + +import com.google.common.base.Function; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.world.ColorizerGrass; + +public class ItemDoublePlant extends ItemMultiTexture +{ + public ItemDoublePlant(Block block, Block block2, Function nameFunction) + { + super(block, block2, nameFunction); + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = BlockDoublePlant.EnumPlantType.byMetadata(stack.getMetadata()); + return blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN ? super.getColorFromItemStack(stack, renderPass) : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemDye.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemDye.java new file mode 100644 index 0000000..934fce0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemDye.java @@ -0,0 +1,174 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.IGrowable; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; + +public class ItemDye extends Item +{ + public static final int[] dyeColors = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; + + public ItemDye() + { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + public String getUnlocalizedName(ItemStack stack) + { + int i = stack.getMetadata(); + return super.getUnlocalizedName() + "." + EnumDyeColor.byDyeDamage(i).getUnlocalizedName(); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) + { + return false; + } + else + { + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata()); + + if (enumdyecolor == EnumDyeColor.WHITE) + { + if (applyBonemeal(stack, worldIn, pos)) + { + if (!worldIn.isRemote) + { + worldIn.playAuxSFX(2005, pos, 0); + } + + return true; + } + } + else if (enumdyecolor == EnumDyeColor.BROWN) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (block == Blocks.log && iblockstate.getValue(BlockPlanks.VARIANT) == BlockPlanks.EnumType.JUNGLE) + { + if (side == EnumFacing.DOWN) + { + return false; + } + + if (side == EnumFacing.UP) + { + return false; + } + + pos = pos.offset(side); + + if (worldIn.isAirBlock(pos)) + { + IBlockState iblockstate1 = Blocks.cocoa.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, 0, playerIn); + worldIn.setBlockState(pos, iblockstate1, 2); + + if (!playerIn.capabilities.isCreativeMode) + { + --stack.stackSize; + } + } + + return true; + } + } + + return false; + } + } + + public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target) + { + IBlockState iblockstate = worldIn.getBlockState(target); + + if (iblockstate.getBlock() instanceof IGrowable) + { + IGrowable igrowable = (IGrowable)iblockstate.getBlock(); + + if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.isRemote)) + { + if (!worldIn.isRemote) + { + if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate)) + { + igrowable.grow(worldIn, worldIn.rand, target, iblockstate); + } + + --stack.stackSize; + } + + return true; + } + } + + return false; + } + + public static void spawnBonemealParticles(World worldIn, BlockPos pos, int amount) + { + if (amount == 0) + { + amount = 15; + } + + Block block = worldIn.getBlockState(pos).getBlock(); + + if (block.getMaterial() != Material.air) + { + block.setBlockBoundsBasedOnState(worldIn, pos); + + for (int i = 0; i < amount; ++i) + { + double d0 = itemRand.nextGaussian() * 0.02D; + double d1 = itemRand.nextGaussian() * 0.02D; + double d2 = itemRand.nextGaussian() * 0.02D; + worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)pos.getX() + itemRand.nextFloat()), (double)pos.getY() + (double)itemRand.nextFloat() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); + } + } + } + + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) + { + if (target instanceof EntitySheep) + { + EntitySheep entitysheep = (EntitySheep)target; + EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata()); + + if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor) + { + entitysheep.setFleeceColor(enumdyecolor); + --stack.stackSize; + } + + return true; + } + else + { + return false; + } + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + for (int i = 0; i < 16; ++i) + { + subItems.add(new ItemStack(itemIn, 1, i)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemEditableBook.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEditableBook.java new file mode 100644 index 0000000..5d16e02 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEditableBook.java @@ -0,0 +1,141 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Slot; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.stats.StatList; +import net.minecraft.util.ChatComponentProcessor; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StatCollector; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; + +public class ItemEditableBook extends Item +{ + public ItemEditableBook() + { + this.setMaxStackSize(1); + } + + public static boolean validBookTagContents(NBTTagCompound nbt) + { + if (!ItemWritableBook.isNBTValid(nbt)) + { + return false; + } + else if (!nbt.hasKey("title", 8)) + { + return false; + } + else + { + String s = nbt.getString("title"); + return s != null && s.length() <= 32 ? nbt.hasKey("author", 8) : false; + } + } + + public static int getGeneration(ItemStack book) + { + return book.getTagCompound().getInteger("generation"); + } + + public String getItemStackDisplayName(ItemStack stack) + { + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + String s = nbttagcompound.getString("title"); + + if (!StringUtils.isNullOrEmpty(s)) + { + return s; + } + } + + return super.getItemStackDisplayName(stack); + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + String s = nbttagcompound.getString("author"); + + if (!StringUtils.isNullOrEmpty(s)) + { + tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {s})); + } + + tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("book.generation." + nbttagcompound.getInteger("generation"))); + } + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (!worldIn.isRemote) + { + this.resolveContents(itemStackIn, playerIn); + } + + playerIn.displayGUIBook(itemStackIn); + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } + + private void resolveContents(ItemStack stack, EntityPlayer player) + { + if (stack != null && stack.getTagCompound() != null) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (!nbttagcompound.getBoolean("resolved")) + { + nbttagcompound.setBoolean("resolved", true); + + if (validBookTagContents(nbttagcompound)) + { + NBTTagList nbttaglist = nbttagcompound.getTagList("pages", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + String s = nbttaglist.getStringTagAt(i); + IChatComponent ichatcomponent; + + try + { + ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + ichatcomponent = ChatComponentProcessor.processComponent(player, ichatcomponent, player); + } + catch (Exception var9) + { + ichatcomponent = new ChatComponentText(s); + } + + nbttaglist.set(i, new NBTTagString(IChatComponent.Serializer.componentToJson(ichatcomponent))); + } + + nbttagcompound.setTag("pages", nbttaglist); + + if (player instanceof EntityPlayerMP && player.getCurrentEquippedItem() == stack) + { + Slot slot = player.openContainer.getSlotFromInventory(player.inventory, player.inventory.currentItem); + ((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new S2FPacketSetSlot(0, slot.slotNumber, stack)); + } + } + } + } + } + + public boolean hasEffect(ItemStack stack) + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemEgg.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEgg.java new file mode 100644 index 0000000..c9b4447 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEgg.java @@ -0,0 +1,34 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemEgg extends Item +{ + public ItemEgg() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityEgg(worldIn, playerIn)); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemEmptyMap.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEmptyMap.java new file mode 100644 index 0000000..f35da04 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEmptyMap.java @@ -0,0 +1,44 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class ItemEmptyMap extends ItemMapBase +{ + protected ItemEmptyMap() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + ItemStack itemstack = new ItemStack(Items.filled_map, 1, worldIn.getUniqueDataId("map")); + String s = "map_" + itemstack.getMetadata(); + MapData mapdata = new MapData(s); + worldIn.setItemData(s, mapdata); + mapdata.scale = 0; + mapdata.calculateMapCenter(playerIn.posX, playerIn.posZ, mapdata.scale); + mapdata.dimension = (byte)worldIn.provider.getDimensionId(); + mapdata.markDirty(); + --itemStackIn.stackSize; + + if (itemStackIn.stackSize <= 0) + { + return itemstack; + } + else + { + if (!playerIn.inventory.addItemStackToInventory(itemstack.copy())) + { + playerIn.dropPlayerItemWithRandomChoice(itemstack, false); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnchantedBook.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnchantedBook.java new file mode 100644 index 0000000..f6479b1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnchantedBook.java @@ -0,0 +1,120 @@ +package net.minecraft.item; + +import java.util.List; +import java.util.Random; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.WeightedRandomChestContent; + +public class ItemEnchantedBook extends Item +{ + public boolean hasEffect(ItemStack stack) + { + return true; + } + + public boolean isItemTool(ItemStack stack) + { + return false; + } + + public EnumRarity getRarity(ItemStack stack) + { + return this.getEnchantments(stack).tagCount() > 0 ? EnumRarity.UNCOMMON : super.getRarity(stack); + } + + public NBTTagList getEnchantments(ItemStack stack) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + return nbttagcompound != null && nbttagcompound.hasKey("StoredEnchantments", 9) ? (NBTTagList)nbttagcompound.getTag("StoredEnchantments") : new NBTTagList(); + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + super.addInformation(stack, playerIn, tooltip, advanced); + NBTTagList nbttaglist = this.getEnchantments(stack); + + if (nbttaglist != null) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + int j = nbttaglist.getCompoundTagAt(i).getShort("id"); + int k = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + + if (Enchantment.getEnchantmentById(j) != null) + { + tooltip.add(Enchantment.getEnchantmentById(j).getTranslatedName(k)); + } + } + } + } + + public void addEnchantment(ItemStack stack, EnchantmentData enchantment) + { + NBTTagList nbttaglist = this.getEnchantments(stack); + boolean flag = true; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + + if (nbttagcompound.getShort("id") == enchantment.enchantmentobj.effectId) + { + if (nbttagcompound.getShort("lvl") < enchantment.enchantmentLevel) + { + nbttagcompound.setShort("lvl", (short)enchantment.enchantmentLevel); + } + + flag = false; + break; + } + } + + if (flag) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setShort("id", (short)enchantment.enchantmentobj.effectId); + nbttagcompound1.setShort("lvl", (short)enchantment.enchantmentLevel); + nbttaglist.appendTag(nbttagcompound1); + } + + if (!stack.hasTagCompound()) + { + stack.setTagCompound(new NBTTagCompound()); + } + + stack.getTagCompound().setTag("StoredEnchantments", nbttaglist); + } + + public ItemStack getEnchantedItemStack(EnchantmentData data) + { + ItemStack itemstack = new ItemStack(this); + this.addEnchantment(itemstack, data); + return itemstack; + } + + public void getAll(Enchantment enchantment, List list) + { + for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); ++i) + { + list.add(this.getEnchantedItemStack(new EnchantmentData(enchantment, i))); + } + } + + public WeightedRandomChestContent getRandom(Random rand) + { + return this.getRandom(rand, 1, 1, 1); + } + + public WeightedRandomChestContent getRandom(Random rand, int minChance, int maxChance, int weight) + { + ItemStack itemstack = new ItemStack(Items.book, 1, 0); + EnchantmentHelper.addRandomEnchantment(rand, itemstack, 30); + return new WeightedRandomChestContent(itemstack, minChance, maxChance, weight); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnderEye.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnderEye.java new file mode 100644 index 0000000..c32b24a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnderEye.java @@ -0,0 +1,171 @@ +package net.minecraft.item; + +import net.minecraft.block.BlockEndPortalFrame; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemEnderEye extends Item +{ + public ItemEnderEye() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (playerIn.canPlayerEdit(pos.offset(side), side, stack) && iblockstate.getBlock() == Blocks.end_portal_frame && !((Boolean)iblockstate.getValue(BlockEndPortalFrame.EYE)).booleanValue()) + { + if (worldIn.isRemote) + { + return true; + } + else + { + worldIn.setBlockState(pos, iblockstate.withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(true)), 2); + worldIn.updateComparatorOutputLevel(pos, Blocks.end_portal_frame); + --stack.stackSize; + + for (int i = 0; i < 16; ++i) + { + double d0 = (double)((float)pos.getX() + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); + double d1 = (double)((float)pos.getY() + 0.8125F); + double d2 = (double)((float)pos.getZ() + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(BlockEndPortalFrame.FACING); + int l = 0; + int j = 0; + boolean flag1 = false; + boolean flag = true; + EnumFacing enumfacing1 = enumfacing.rotateY(); + + for (int k = -2; k <= 2; ++k) + { + BlockPos blockpos1 = pos.offset(enumfacing1, k); + IBlockState iblockstate1 = worldIn.getBlockState(blockpos1); + + if (iblockstate1.getBlock() == Blocks.end_portal_frame) + { + if (!((Boolean)iblockstate1.getValue(BlockEndPortalFrame.EYE)).booleanValue()) + { + flag = false; + break; + } + + j = k; + + if (!flag1) + { + l = k; + flag1 = true; + } + } + } + + if (flag && j == l + 2) + { + BlockPos blockpos = pos.offset(enumfacing, 4); + + for (int i1 = l; i1 <= j; ++i1) + { + BlockPos blockpos2 = blockpos.offset(enumfacing1, i1); + IBlockState iblockstate3 = worldIn.getBlockState(blockpos2); + + if (iblockstate3.getBlock() != Blocks.end_portal_frame || !((Boolean)iblockstate3.getValue(BlockEndPortalFrame.EYE)).booleanValue()) + { + flag = false; + break; + } + } + + for (int j1 = l - 1; j1 <= j + 1; j1 += 4) + { + blockpos = pos.offset(enumfacing1, j1); + + for (int l1 = 1; l1 <= 3; ++l1) + { + BlockPos blockpos3 = blockpos.offset(enumfacing, l1); + IBlockState iblockstate2 = worldIn.getBlockState(blockpos3); + + if (iblockstate2.getBlock() != Blocks.end_portal_frame || !((Boolean)iblockstate2.getValue(BlockEndPortalFrame.EYE)).booleanValue()) + { + flag = false; + break; + } + } + } + + if (flag) + { + for (int k1 = l; k1 <= j; ++k1) + { + blockpos = pos.offset(enumfacing1, k1); + + for (int i2 = 1; i2 <= 3; ++i2) + { + BlockPos blockpos4 = blockpos.offset(enumfacing, i2); + worldIn.setBlockState(blockpos4, Blocks.end_portal.getDefaultState(), 2); + } + } + } + } + + return true; + } + } + else + { + return false; + } + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, playerIn, false); + + if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && worldIn.getBlockState(movingobjectposition.getBlockPos()).getBlock() == Blocks.end_portal_frame) + { + return itemStackIn; + } + else + { + if (!worldIn.isRemote) + { + BlockPos blockpos = worldIn.getStrongholdPos("Stronghold", new BlockPos(playerIn)); + + if (blockpos != null) + { + EntityEnderEye entityendereye = new EntityEnderEye(worldIn, playerIn.posX, playerIn.posY, playerIn.posZ); + entityendereye.moveTowards(blockpos); + worldIn.spawnEntityInWorld(entityendereye); + worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1002, new BlockPos(playerIn), 0); + + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + } + + return itemStackIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnderPearl.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnderPearl.java new file mode 100644 index 0000000..d286c5e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemEnderPearl.java @@ -0,0 +1,37 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemEnderPearl extends Item +{ + public ItemEnderPearl() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (playerIn.capabilities.isCreativeMode) + { + return itemStackIn; + } + else + { + --itemStackIn.stackSize; + worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityEnderPearl(worldIn, playerIn)); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemExpBottle.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemExpBottle.java new file mode 100644 index 0000000..5bafb47 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemExpBottle.java @@ -0,0 +1,38 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemExpBottle extends Item +{ + public ItemExpBottle() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public boolean hasEffect(ItemStack stack) + { + return true; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityExpBottle(worldIn, playerIn)); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemFireball.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFireball.java new file mode 100644 index 0000000..9549953 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFireball.java @@ -0,0 +1,49 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemFireball extends Item +{ + public ItemFireball() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + pos = pos.offset(side); + + if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else + { + if (worldIn.getBlockState(pos).getBlock().getMaterial() == Material.air) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "item.fireCharge.use", 1.0F, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2F + 1.0F); + worldIn.setBlockState(pos, Blocks.fire.getDefaultState()); + } + + if (!playerIn.capabilities.isCreativeMode) + { + --stack.stackSize; + } + + return true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemFirework.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFirework.java new file mode 100644 index 0000000..55e533a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFirework.java @@ -0,0 +1,73 @@ +package net.minecraft.item; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemFirework extends Item +{ + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!worldIn.isRemote) + { + EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(worldIn, (double)((float)pos.getX() + hitX), (double)((float)pos.getY() + hitY), (double)((float)pos.getZ() + hitZ), stack); + worldIn.spawnEntityInWorld(entityfireworkrocket); + + if (!playerIn.capabilities.isCreativeMode) + { + --stack.stackSize; + } + + return true; + } + else + { + return false; + } + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("Fireworks"); + + if (nbttagcompound != null) + { + if (nbttagcompound.hasKey("Flight", 99)) + { + tooltip.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + nbttagcompound.getByte("Flight")); + } + + NBTTagList nbttaglist = nbttagcompound.getTagList("Explosions", 10); + + if (nbttaglist != null && nbttaglist.tagCount() > 0) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + List list = Lists.newArrayList(); + ItemFireworkCharge.addExplosionInfo(nbttagcompound1, list); + + if (list.size() > 0) + { + for (int j = 1; j < ((List)list).size(); ++j) + { + list.set(j, " " + (String)list.get(j)); + } + + tooltip.addAll(list); + } + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemFireworkCharge.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFireworkCharge.java new file mode 100644 index 0000000..42a5e2a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFireworkCharge.java @@ -0,0 +1,184 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagIntArray; +import net.minecraft.util.StatCollector; + +public class ItemFireworkCharge extends Item +{ + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + if (renderPass != 1) + { + return super.getColorFromItemStack(stack, renderPass); + } + else + { + NBTBase nbtbase = getExplosionTag(stack, "Colors"); + + if (!(nbtbase instanceof NBTTagIntArray)) + { + return 9079434; + } + else + { + NBTTagIntArray nbttagintarray = (NBTTagIntArray)nbtbase; + int[] aint = nbttagintarray.getIntArray(); + + if (aint.length == 1) + { + return aint[0]; + } + else + { + int i = 0; + int j = 0; + int k = 0; + + for (int l : aint) + { + i += (l & 16711680) >> 16; + j += (l & 65280) >> 8; + k += (l & 255) >> 0; + } + + i = i / aint.length; + j = j / aint.length; + k = k / aint.length; + return i << 16 | j << 8 | k; + } + } + } + } + + public static NBTBase getExplosionTag(ItemStack stack, String key) + { + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("Explosion"); + + if (nbttagcompound != null) + { + return nbttagcompound.getTag(key); + } + } + + return null; + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("Explosion"); + + if (nbttagcompound != null) + { + addExplosionInfo(nbttagcompound, tooltip); + } + } + } + + public static void addExplosionInfo(NBTTagCompound nbt, List tooltip) + { + byte b0 = nbt.getByte("Type"); + + if (b0 >= 0 && b0 <= 4) + { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.type." + b0).trim()); + } + else + { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); + } + + int[] aint = nbt.getIntArray("Colors"); + + if (aint.length > 0) + { + boolean flag = true; + String s = ""; + + for (int i : aint) + { + if (!flag) + { + s = s + ", "; + } + + flag = false; + boolean flag1 = false; + + for (int j = 0; j < ItemDye.dyeColors.length; ++j) + { + if (i == ItemDye.dyeColors[j]) + { + flag1 = true; + s = s + StatCollector.translateToLocal("item.fireworksCharge." + EnumDyeColor.byDyeDamage(j).getUnlocalizedName()); + break; + } + } + + if (!flag1) + { + s = s + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + tooltip.add(s); + } + + int[] aint1 = nbt.getIntArray("FadeColors"); + + if (aint1.length > 0) + { + boolean flag2 = true; + String s1 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " "; + + for (int l : aint1) + { + if (!flag2) + { + s1 = s1 + ", "; + } + + flag2 = false; + boolean flag5 = false; + + for (int k = 0; k < 16; ++k) + { + if (l == ItemDye.dyeColors[k]) + { + flag5 = true; + s1 = s1 + StatCollector.translateToLocal("item.fireworksCharge." + EnumDyeColor.byDyeDamage(k).getUnlocalizedName()); + break; + } + } + + if (!flag5) + { + s1 = s1 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + tooltip.add(s1); + } + + boolean flag3 = nbt.getBoolean("Trail"); + + if (flag3) + { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); + } + + boolean flag4 = nbt.getBoolean("Flicker"); + + if (flag4) + { + tooltip.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemFishFood.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFishFood.java new file mode 100644 index 0000000..e5519a2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFishFood.java @@ -0,0 +1,162 @@ +package net.minecraft.item; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.world.World; + +public class ItemFishFood extends ItemFood +{ + private final boolean cooked; + + public ItemFishFood(boolean cooked) + { + super(0, 0.0F, false); + this.cooked = cooked; + } + + public int getHealAmount(ItemStack stack) + { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(stack); + return this.cooked && itemfishfood$fishtype.canCook() ? itemfishfood$fishtype.getCookedHealAmount() : itemfishfood$fishtype.getUncookedHealAmount(); + } + + public float getSaturationModifier(ItemStack stack) + { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(stack); + return this.cooked && itemfishfood$fishtype.canCook() ? itemfishfood$fishtype.getCookedSaturationModifier() : itemfishfood$fishtype.getUncookedSaturationModifier(); + } + + public String getPotionEffect(ItemStack stack) + { + return ItemFishFood.FishType.byItemStack(stack) == ItemFishFood.FishType.PUFFERFISH ? PotionHelper.pufferfishEffect : null; + } + + protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) + { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(stack); + + if (itemfishfood$fishtype == ItemFishFood.FishType.PUFFERFISH) + { + player.addPotionEffect(new PotionEffect(Potion.poison.id, 1200, 3)); + player.addPotionEffect(new PotionEffect(Potion.hunger.id, 300, 2)); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 1)); + } + + super.onFoodEaten(stack, worldIn, player); + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + for (ItemFishFood.FishType itemfishfood$fishtype : ItemFishFood.FishType.values()) + { + if (!this.cooked || itemfishfood$fishtype.canCook()) + { + subItems.add(new ItemStack(this, 1, itemfishfood$fishtype.getMetadata())); + } + } + } + + public String getUnlocalizedName(ItemStack stack) + { + ItemFishFood.FishType itemfishfood$fishtype = ItemFishFood.FishType.byItemStack(stack); + return this.getUnlocalizedName() + "." + itemfishfood$fishtype.getUnlocalizedName() + "." + (this.cooked && itemfishfood$fishtype.canCook() ? "cooked" : "raw"); + } + + public static enum FishType + { + COD(0, "cod", 2, 0.1F, 5, 0.6F), + SALMON(1, "salmon", 2, 0.1F, 6, 0.8F), + CLOWNFISH(2, "clownfish", 1, 0.1F), + PUFFERFISH(3, "pufferfish", 1, 0.1F); + + private static final Map META_LOOKUP = Maps.newHashMap(); + private final int meta; + private final String unlocalizedName; + private final int uncookedHealAmount; + private final float uncookedSaturationModifier; + private final int cookedHealAmount; + private final float cookedSaturationModifier; + private boolean cookable = false; + + private FishType(int meta, String unlocalizedName, int uncookedHeal, float uncookedSaturation, int cookedHeal, float cookedSaturation) + { + this.meta = meta; + this.unlocalizedName = unlocalizedName; + this.uncookedHealAmount = uncookedHeal; + this.uncookedSaturationModifier = uncookedSaturation; + this.cookedHealAmount = cookedHeal; + this.cookedSaturationModifier = cookedSaturation; + this.cookable = true; + } + + private FishType(int meta, String unlocalizedName, int uncookedHeal, float uncookedSaturation) + { + this.meta = meta; + this.unlocalizedName = unlocalizedName; + this.uncookedHealAmount = uncookedHeal; + this.uncookedSaturationModifier = uncookedSaturation; + this.cookedHealAmount = 0; + this.cookedSaturationModifier = 0.0F; + this.cookable = false; + } + + public int getMetadata() + { + return this.meta; + } + + public String getUnlocalizedName() + { + return this.unlocalizedName; + } + + public int getUncookedHealAmount() + { + return this.uncookedHealAmount; + } + + public float getUncookedSaturationModifier() + { + return this.uncookedSaturationModifier; + } + + public int getCookedHealAmount() + { + return this.cookedHealAmount; + } + + public float getCookedSaturationModifier() + { + return this.cookedSaturationModifier; + } + + public boolean canCook() + { + return this.cookable; + } + + public static ItemFishFood.FishType byMetadata(int meta) + { + ItemFishFood.FishType itemfishfood$fishtype = (ItemFishFood.FishType)META_LOOKUP.get(Integer.valueOf(meta)); + return itemfishfood$fishtype == null ? COD : itemfishfood$fishtype; + } + + public static ItemFishFood.FishType byItemStack(ItemStack stack) + { + return stack.getItem() instanceof ItemFishFood ? byMetadata(stack.getMetadata()) : COD; + } + + static { + for (ItemFishFood.FishType itemfishfood$fishtype : values()) + { + META_LOOKUP.put(Integer.valueOf(itemfishfood$fishtype.getMetadata()), itemfishfood$fishtype); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemFishingRod.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFishingRod.java new file mode 100644 index 0000000..933e2b6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFishingRod.java @@ -0,0 +1,61 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemFishingRod extends Item +{ + public ItemFishingRod() + { + this.setMaxDamage(64); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public boolean isFull3D() + { + return true; + } + + public boolean shouldRotateAroundWhenRendering() + { + return true; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (playerIn.fishEntity != null) + { + int i = playerIn.fishEntity.handleHookRetraction(); + itemStackIn.damageItem(i, playerIn); + playerIn.swingItem(); + } + else + { + worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityFishHook(worldIn, playerIn)); + } + + playerIn.swingItem(); + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + + return itemStackIn; + } + + public boolean isItemTool(ItemStack stack) + { + return super.isItemTool(stack); + } + + public int getItemEnchantability() + { + return 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemFlintAndSteel.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFlintAndSteel.java new file mode 100644 index 0000000..f10a01c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFlintAndSteel.java @@ -0,0 +1,40 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemFlintAndSteel extends Item +{ + public ItemFlintAndSteel() + { + this.maxStackSize = 1; + this.setMaxDamage(64); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + pos = pos.offset(side); + + if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else + { + if (worldIn.getBlockState(pos).getBlock().getMaterial() == Material.air) + { + worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + worldIn.setBlockState(pos, Blocks.fire.getDefaultState()); + } + + stack.damageItem(1, playerIn); + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemFood.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFood.java new file mode 100644 index 0000000..26f3875 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemFood.java @@ -0,0 +1,103 @@ +package net.minecraft.item; + +import lombok.Getter; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemFood extends Item +{ + public final int itemUseDuration; + private final int healAmount; + private final float saturationModifier; + private final boolean isWolfsFavoriteMeat; + @Getter private boolean alwaysEdible; + private int potionId; + private int potionDuration; + private int potionAmplifier; + private float potionEffectProbability; + + public ItemFood(int amount, float saturation, boolean isWolfFood) + { + this.itemUseDuration = 32; + this.healAmount = amount; + this.isWolfsFavoriteMeat = isWolfFood; + this.saturationModifier = saturation; + this.setCreativeTab(CreativeTabs.tabFood); + } + + public ItemFood(int amount, boolean isWolfFood) + { + this(amount, 0.6F, isWolfFood); + } + + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + --stack.stackSize; + playerIn.getFoodStats().addStats(this, stack); + worldIn.playSoundAtEntity(playerIn, "random.burp", 0.5F, worldIn.rand.nextFloat() * 0.1F + 0.9F); + this.onFoodEaten(stack, worldIn, playerIn); + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return stack; + } + + protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) + { + if (!worldIn.isRemote && this.potionId > 0 && worldIn.rand.nextFloat() < this.potionEffectProbability) + { + player.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); + } + } + + public int getMaxItemUseDuration(ItemStack stack) + { + return 32; + } + + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.EAT; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (playerIn.canEat(this.alwaysEdible)) + { + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + } + + return itemStackIn; + } + + public int getHealAmount(ItemStack stack) + { + return this.healAmount; + } + + public float getSaturationModifier(ItemStack stack) + { + return this.saturationModifier; + } + + public boolean isWolfsFavoriteMeat() + { + return this.isWolfsFavoriteMeat; + } + + public ItemFood setPotionEffect(int id, int duration, int amplifier, float probability) + { + this.potionId = id; + this.potionDuration = duration; + this.potionAmplifier = amplifier; + this.potionEffectProbability = probability; + return this; + } + + public ItemFood setAlwaysEdible() + { + this.alwaysEdible = true; + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemGlassBottle.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemGlassBottle.java new file mode 100644 index 0000000..9f09064 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemGlassBottle.java @@ -0,0 +1,63 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemGlassBottle extends Item +{ + public ItemGlassBottle() + { + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, playerIn, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + BlockPos blockpos = movingobjectposition.getBlockPos(); + + if (!worldIn.isBlockModifiable(playerIn, blockpos)) + { + return itemStackIn; + } + + if (!playerIn.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + if (worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.water) + { + --itemStackIn.stackSize; + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + + if (itemStackIn.stackSize <= 0) + { + return new ItemStack(Items.potionitem); + } + + if (!playerIn.inventory.addItemStackToInventory(new ItemStack(Items.potionitem))) + { + playerIn.dropPlayerItemWithRandomChoice(new ItemStack(Items.potionitem, 1, 0), false); + } + } + } + + return itemStackIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemHangingEntity.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemHangingEntity.java new file mode 100644 index 0000000..1018a89 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemHangingEntity.java @@ -0,0 +1,63 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemHangingEntity extends Item +{ + private final Class hangingEntityClass; + + public ItemHangingEntity(Class entityClass) + { + this.hangingEntityClass = entityClass; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side == EnumFacing.DOWN) + { + return false; + } + else if (side == EnumFacing.UP) + { + return false; + } + else + { + BlockPos blockpos = pos.offset(side); + + if (!playerIn.canPlayerEdit(blockpos, side, stack)) + { + return false; + } + else + { + EntityHanging entityhanging = this.createEntity(worldIn, blockpos, side); + + if (entityhanging != null && entityhanging.onValidSurface()) + { + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(entityhanging); + } + + --stack.stackSize; + } + + return true; + } + } + } + + private EntityHanging createEntity(World worldIn, BlockPos pos, EnumFacing clickedSide) + { + return (EntityHanging)(this.hangingEntityClass == EntityPainting.class ? new EntityPainting(worldIn, pos, clickedSide) : (this.hangingEntityClass == EntityItemFrame.class ? new EntityItemFrame(worldIn, pos, clickedSide) : null)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemHoe.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemHoe.java new file mode 100644 index 0000000..c0a4803 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemHoe.java @@ -0,0 +1,87 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemHoe extends Item +{ + protected Item.ToolMaterial theToolMaterial; + + public ItemHoe(Item.ToolMaterial material) + { + this.theToolMaterial = material; + this.maxStackSize = 1; + this.setMaxDamage(material.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabTools); + } + + @SuppressWarnings("incomplete-switch") + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) + { + return false; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (side != EnumFacing.DOWN && worldIn.getBlockState(pos.up()).getBlock().getMaterial() == Material.air) + { + if (block == Blocks.grass) + { + return this.useHoe(stack, playerIn, worldIn, pos, Blocks.farmland.getDefaultState()); + } + + if (block == Blocks.dirt) + { + switch ((BlockDirt.DirtType)iblockstate.getValue(BlockDirt.VARIANT)) + { + case DIRT: + return this.useHoe(stack, playerIn, worldIn, pos, Blocks.farmland.getDefaultState()); + + case COARSE_DIRT: + return this.useHoe(stack, playerIn, worldIn, pos, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); + } + } + } + + return false; + } + } + + protected boolean useHoe(ItemStack stack, EntityPlayer player, World worldIn, BlockPos target, IBlockState newState) + { + worldIn.playSoundEffect((double)((float)target.getX() + 0.5F), (double)((float)target.getY() + 0.5F), (double)((float)target.getZ() + 0.5F), newState.getBlock().stepSound.getStepSound(), (newState.getBlock().stepSound.getVolume() + 1.0F) / 2.0F, newState.getBlock().stepSound.getFrequency() * 0.8F); + + if (worldIn.isRemote) + { + return true; + } + else + { + worldIn.setBlockState(target, newState); + stack.damageItem(1, player); + return true; + } + } + + public boolean isFull3D() + { + return true; + } + + public String getMaterialName() + { + return this.theToolMaterial.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemLead.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemLead.java new file mode 100644 index 0000000..7c3c9f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemLead.java @@ -0,0 +1,68 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFence; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemLead extends Item +{ + public ItemLead() + { + this.setCreativeTab(CreativeTabs.tabTools); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + Block block = worldIn.getBlockState(pos).getBlock(); + + if (block instanceof BlockFence) + { + if (worldIn.isRemote) + { + return true; + } + else + { + attachToFence(playerIn, worldIn, pos); + return true; + } + } + else + { + return false; + } + } + + public static boolean attachToFence(EntityPlayer player, World worldIn, BlockPos fence) + { + EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForPosition(worldIn, fence); + boolean flag = false; + double d0 = 7.0D; + int i = fence.getX(); + int j = fence.getY(); + int k = fence.getZ(); + + for (EntityLiving entityliving : worldIn.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB((double)i - d0, (double)j - d0, (double)k - d0, (double)i + d0, (double)j + d0, (double)k + d0))) + { + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == player) + { + if (entityleashknot == null) + { + entityleashknot = EntityLeashKnot.createKnot(worldIn, fence); + } + + entityliving.setLeashedToEntity(entityleashknot, true); + flag = true; + } + } + + return flag; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemLeaves.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemLeaves.java new file mode 100644 index 0000000..cfbf446 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemLeaves.java @@ -0,0 +1,31 @@ +package net.minecraft.item; + +import net.minecraft.block.BlockLeaves; + +public class ItemLeaves extends ItemBlock +{ + private final BlockLeaves leaves; + + public ItemLeaves(BlockLeaves block) + { + super(block); + this.leaves = block; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + public int getMetadata(int damage) + { + return damage | 4; + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + return this.leaves.getRenderColor(this.leaves.getStateFromMeta(stack.getMetadata())); + } + + public String getUnlocalizedName(ItemStack stack) + { + return super.getUnlocalizedName() + "." + this.leaves.getWoodType(stack.getMetadata()).getUnlocalizedName(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemLilyPad.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemLilyPad.java new file mode 100644 index 0000000..63eb3c1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemLilyPad.java @@ -0,0 +1,69 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemLilyPad extends ItemColored +{ + public ItemLilyPad(Block block) + { + super(block, false); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, playerIn, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + BlockPos blockpos = movingobjectposition.getBlockPos(); + + if (!worldIn.isBlockModifiable(playerIn, blockpos)) + { + return itemStackIn; + } + + if (!playerIn.canPlayerEdit(blockpos.offset(movingobjectposition.sideHit), movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + BlockPos blockpos1 = blockpos.up(); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + + if (iblockstate.getBlock().getMaterial() == Material.water && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) + { + worldIn.setBlockState(blockpos1, Blocks.waterlily.getDefaultState()); + + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + } + + return itemStackIn; + } + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + return Blocks.waterlily.getRenderColor(Blocks.waterlily.getStateFromMeta(stack.getMetadata())); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemMap.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMap.java new file mode 100644 index 0000000..b75b4dc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMap.java @@ -0,0 +1,293 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Iterables; +import com.google.common.collect.Multiset; +import com.google.common.collect.Multisets; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockStone; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.network.Packet; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.MapData; + +public class ItemMap extends ItemMapBase +{ + protected ItemMap() + { + this.setHasSubtypes(true); + } + + public static MapData loadMapData(int mapId, World worldIn) + { + String s = "map_" + mapId; + MapData mapdata = (MapData)worldIn.loadItemData(MapData.class, s); + + if (mapdata == null) + { + mapdata = new MapData(s); + worldIn.setItemData(s, mapdata); + } + + return mapdata; + } + + public MapData getMapData(ItemStack stack, World worldIn) + { + String s = "map_" + stack.getMetadata(); + MapData mapdata = (MapData)worldIn.loadItemData(MapData.class, s); + + if (mapdata == null && !worldIn.isRemote) + { + stack.setItemDamage(worldIn.getUniqueDataId("map")); + s = "map_" + stack.getMetadata(); + mapdata = new MapData(s); + mapdata.scale = 3; + mapdata.calculateMapCenter((double)worldIn.getWorldInfo().getSpawnX(), (double)worldIn.getWorldInfo().getSpawnZ(), mapdata.scale); + mapdata.dimension = (byte)worldIn.provider.getDimensionId(); + mapdata.markDirty(); + worldIn.setItemData(s, mapdata); + } + + return mapdata; + } + + public void updateMapData(World worldIn, Entity viewer, MapData data) + { + if (worldIn.provider.getDimensionId() == data.dimension && viewer instanceof EntityPlayer) + { + int i = 1 << data.scale; + int j = data.xCenter; + int k = data.zCenter; + int l = MathHelper.floor_double(viewer.posX - (double)j) / i + 64; + int i1 = MathHelper.floor_double(viewer.posZ - (double)k) / i + 64; + int j1 = 128 / i; + + if (worldIn.provider.getHasNoSky()) + { + j1 /= 2; + } + + MapData.MapInfo mapdata$mapinfo = data.getMapInfo((EntityPlayer)viewer); + ++mapdata$mapinfo.field_82569_d; + boolean flag = false; + + for (int k1 = l - j1 + 1; k1 < l + j1; ++k1) + { + if ((k1 & 15) == (mapdata$mapinfo.field_82569_d & 15) || flag) + { + flag = false; + double d0 = 0.0D; + + for (int l1 = i1 - j1 - 1; l1 < i1 + j1; ++l1) + { + if (k1 >= 0 && l1 >= -1 && k1 < 128 && l1 < 128) + { + int i2 = k1 - l; + int j2 = l1 - i1; + boolean flag1 = i2 * i2 + j2 * j2 > (j1 - 2) * (j1 - 2); + int k2 = (j / i + k1 - 64) * i; + int l2 = (k / i + l1 - 64) * i; + Multiset multiset = HashMultiset.create(); + Chunk chunk = worldIn.getChunkFromBlockCoords(new BlockPos(k2, 0, l2)); + + if (!chunk.isEmpty()) + { + int i3 = k2 & 15; + int j3 = l2 & 15; + int k3 = 0; + double d1 = 0.0D; + + if (worldIn.provider.getHasNoSky()) + { + int l3 = k2 + l2 * 231871; + l3 = l3 * l3 * 31287121 + l3 * 11; + + if ((l3 >> 20 & 1) == 0) + { + multiset.add(Blocks.dirt.getMapColor(Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)), 10); + } + else + { + multiset.add(Blocks.stone.getMapColor(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE)), 100); + } + + d1 = 100.0D; + } + else + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i4 = 0; i4 < i; ++i4) + { + for (int j4 = 0; j4 < i; ++j4) + { + int k4 = chunk.getHeightValue(i4 + i3, j4 + j3) + 1; + IBlockState iblockstate = Blocks.air.getDefaultState(); + + if (k4 > 1) + { + label541: + { + while (true) + { + --k4; + iblockstate = chunk.getBlockState(blockpos$mutableblockpos.set(i4 + i3, k4, j4 + j3)); + + if (iblockstate.getBlock().getMapColor(iblockstate) != MapColor.airColor || k4 <= 0) + { + break; + } + } + + if (k4 > 0 && iblockstate.getBlock().getMaterial().isLiquid()) + { + int l4 = k4 - 1; + + while (true) + { + Block block = chunk.getBlock(i4 + i3, l4--, j4 + j3); + ++k3; + + if (l4 <= 0 || !block.getMaterial().isLiquid()) + { + break label541; + } + } + } + } + } + + d1 += (double)k4 / (double)(i * i); + multiset.add(iblockstate.getBlock().getMapColor(iblockstate)); + } + } + } + + k3 = k3 / (i * i); + double d2 = (d1 - d0) * 4.0D / (double)(i + 4) + ((double)(k1 + l1 & 1) - 0.5D) * 0.4D; + int i5 = 1; + + if (d2 > 0.6D) + { + i5 = 2; + } + + if (d2 < -0.6D) + { + i5 = 0; + } + + MapColor mapcolor = (MapColor)Iterables.getFirst(Multisets.copyHighestCountFirst(multiset), MapColor.airColor); + + if (mapcolor == MapColor.waterColor) + { + d2 = (double)k3 * 0.1D + (double)(k1 + l1 & 1) * 0.2D; + i5 = 1; + + if (d2 < 0.5D) + { + i5 = 2; + } + + if (d2 > 0.9D) + { + i5 = 0; + } + } + + d0 = d1; + + if (l1 >= 0 && i2 * i2 + j2 * j2 < j1 * j1 && (!flag1 || (k1 + l1 & 1) != 0)) + { + byte b0 = data.colors[k1 + l1 * 128]; + byte b1 = (byte)(mapcolor.colorIndex * 4 + i5); + + if (b0 != b1) + { + data.colors[k1 + l1 * 128] = b1; + data.updateMapData(k1, l1); + flag = true; + } + } + } + } + } + } + } + } + } + + public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) + { + if (!worldIn.isRemote) + { + MapData mapdata = this.getMapData(stack, worldIn); + + if (entityIn instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)entityIn; + mapdata.updateVisiblePlayers(entityplayer, stack); + } + + if (isSelected) + { + this.updateMapData(worldIn, entityIn, mapdata); + } + } + } + + public Packet createMapDataPacket(ItemStack stack, World worldIn, EntityPlayer player) + { + return this.getMapData(stack, worldIn).getMapPacket(stack, worldIn, player); + } + + public void onCreated(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + if (stack.hasTagCompound() && stack.getTagCompound().getBoolean("map_is_scaling")) + { + MapData mapdata = Items.filled_map.getMapData(stack, worldIn); + stack.setItemDamage(worldIn.getUniqueDataId("map")); + MapData mapdata1 = new MapData("map_" + stack.getMetadata()); + mapdata1.scale = (byte)(mapdata.scale + 1); + + if (mapdata1.scale > 4) + { + mapdata1.scale = 4; + } + + mapdata1.calculateMapCenter((double)mapdata.xCenter, (double)mapdata.zCenter, mapdata1.scale); + mapdata1.dimension = mapdata.dimension; + mapdata1.markDirty(); + worldIn.setItemData("map_" + stack.getMetadata(), mapdata1); + } + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + MapData mapdata = this.getMapData(stack, playerIn.worldObj); + + if (advanced) + { + if (mapdata == null) + { + tooltip.add("Unknown map"); + } + else + { + tooltip.add("Scaling at 1:" + (1 << mapdata.scale)); + tooltip.add("(Level " + mapdata.scale + "/" + 4 + ")"); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemMapBase.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMapBase.java new file mode 100644 index 0000000..100b53e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMapBase.java @@ -0,0 +1,18 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.Packet; +import net.minecraft.world.World; + +public class ItemMapBase extends Item +{ + public boolean isMap() + { + return true; + } + + public Packet createMapDataPacket(ItemStack stack, World worldIn, EntityPlayer player) + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemMinecart.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMinecart.java new file mode 100644 index 0000000..81c5c5e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMinecart.java @@ -0,0 +1,125 @@ +package net.minecraft.item; + +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemMinecart extends Item +{ + private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata()); + World world = source.getWorld(); + double d0 = source.getX() + (double)enumfacing.getFrontOffsetX() * 1.125D; + double d1 = Math.floor(source.getY()) + (double)enumfacing.getFrontOffsetY(); + double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ() * 1.125D; + BlockPos blockpos = source.getBlockPos().offset(enumfacing); + IBlockState iblockstate = world.getBlockState(blockpos); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + double d3; + + if (BlockRailBase.isRailBlock(iblockstate)) + { + if (blockrailbase$enumraildirection.isAscending()) + { + d3 = 0.6D; + } + else + { + d3 = 0.1D; + } + } + else + { + if (iblockstate.getBlock().getMaterial() != Material.air || !BlockRailBase.isRailBlock(world.getBlockState(blockpos.down()))) + { + return this.behaviourDefaultDispenseItem.dispense(source, stack); + } + + IBlockState iblockstate1 = world.getBlockState(blockpos.down()); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate1.getValue(((BlockRailBase)iblockstate1.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + + if (enumfacing != EnumFacing.DOWN && blockrailbase$enumraildirection1.isAscending()) + { + d3 = -0.4D; + } + else + { + d3 = -0.9D; + } + } + + EntityMinecart entityminecart = EntityMinecart.getMinecart(world, d0, d1 + d3, d2, ((ItemMinecart)stack.getItem()).minecartType); + + if (stack.hasDisplayName()) + { + entityminecart.setCustomNameTag(stack.getDisplayName()); + } + + world.spawnEntityInWorld(entityminecart); + stack.splitStack(1); + return stack; + } + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0); + } + }; + private final EntityMinecart.EnumMinecartType minecartType; + + public ItemMinecart(EntityMinecart.EnumMinecartType type) + { + this.maxStackSize = 1; + this.minecartType = type; + this.setCreativeTab(CreativeTabs.tabTransport); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserMinecartBehavior); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (BlockRailBase.isRailBlock(iblockstate)) + { + if (!worldIn.isRemote) + { + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; + double d0 = 0.0D; + + if (blockrailbase$enumraildirection.isAscending()) + { + d0 = 0.5D; + } + + EntityMinecart entityminecart = EntityMinecart.getMinecart(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.0625D + d0, (double)pos.getZ() + 0.5D, this.minecartType); + + if (stack.hasDisplayName()) + { + entityminecart.setCustomNameTag(stack.getDisplayName()); + } + + worldIn.spawnEntityInWorld(entityminecart); + } + + --stack.stackSize; + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemMonsterPlacer.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMonsterPlacer.java new file mode 100644 index 0000000..8a28b69 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMonsterPlacer.java @@ -0,0 +1,207 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemMonsterPlacer extends Item +{ + public ItemMonsterPlacer() + { + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public String getItemStackDisplayName(ItemStack stack) + { + String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); + String s1 = EntityList.getStringFromID(stack.getMetadata()); + + if (s1 != null) + { + s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name"); + } + + return s; + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(stack.getMetadata())); + return entitylist$entityegginfo != null ? (renderPass == 0 ? entitylist$entityegginfo.primaryColor : entitylist$entityegginfo.secondaryColor) : 16777215; + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (worldIn.isRemote) + { + return true; + } + else if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) + { + return false; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == Blocks.mob_spawner) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntityMobSpawner) + { + MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic(); + mobspawnerbaselogic.setEntityName(EntityList.getStringFromID(stack.getMetadata())); + tileentity.markDirty(); + worldIn.markBlockForUpdate(pos); + + if (!playerIn.capabilities.isCreativeMode) + { + --stack.stackSize; + } + + return true; + } + } + + pos = pos.offset(side); + double d0 = 0.0D; + + if (side == EnumFacing.UP && iblockstate instanceof BlockFence) + { + d0 = 0.5D; + } + + Entity entity = spawnCreature(worldIn, stack.getMetadata(), (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && stack.hasDisplayName()) + { + entity.setCustomNameTag(stack.getDisplayName()); + } + + if (!playerIn.capabilities.isCreativeMode) + { + --stack.stackSize; + } + } + + return true; + } + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (worldIn.isRemote) + { + return itemStackIn; + } + else + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, playerIn, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + BlockPos blockpos = movingobjectposition.getBlockPos(); + + if (!worldIn.isBlockModifiable(playerIn, blockpos)) + { + return itemStackIn; + } + + if (!playerIn.canPlayerEdit(blockpos, movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + if (worldIn.getBlockState(blockpos).getBlock() instanceof BlockLiquid) + { + Entity entity = spawnCreature(worldIn, itemStackIn.getMetadata(), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && itemStackIn.hasDisplayName()) + { + ((EntityLiving)entity).setCustomNameTag(itemStackIn.getDisplayName()); + } + + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + } + } + } + + return itemStackIn; + } + } + } + + public static Entity spawnCreature(World worldIn, int entityID, double x, double y, double z) + { + if (!EntityList.entityEggs.containsKey(Integer.valueOf(entityID))) + { + return null; + } + else + { + Entity entity = null; + + for (int i = 0; i < 1; ++i) + { + entity = EntityList.createEntityByID(entityID, worldIn); + + if (entity instanceof EntityLivingBase) + { + EntityLiving entityliving = (EntityLiving)entity; + entity.setLocationAndAngles(x, y, z, MathHelper.wrapAngleTo180_float(worldIn.rand.nextFloat() * 360.0F), 0.0F); + entityliving.rotationYawHead = entityliving.rotationYaw; + entityliving.renderYawOffset = entityliving.rotationYaw; + entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null); + worldIn.spawnEntityInWorld(entity); + entityliving.playLivingSound(); + } + } + + return entity; + } + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values()) + { + subItems.add(new ItemStack(itemIn, 1, entitylist$entityegginfo.spawnedID)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemMultiTexture.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMultiTexture.java new file mode 100644 index 0000000..5400674 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemMultiTexture.java @@ -0,0 +1,47 @@ +package net.minecraft.item; + +import com.google.common.base.Function; +import net.minecraft.block.Block; + +public class ItemMultiTexture extends ItemBlock +{ + protected final Block theBlock; + protected final Function nameFunction; + + public ItemMultiTexture(Block block, Block block2, Function nameFunction) + { + super(block); + this.theBlock = block2; + this.nameFunction = nameFunction; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + public ItemMultiTexture(Block block, Block block2, final String[] namesByMeta) + { + this(block, block2, new Function() + { + public String apply(ItemStack p_apply_1_) + { + int i = p_apply_1_.getMetadata(); + + if (i < 0 || i >= namesByMeta.length) + { + i = 0; + } + + return namesByMeta[i]; + } + }); + } + + public int getMetadata(int damage) + { + return damage; + } + + public String getUnlocalizedName(ItemStack stack) + { + return super.getUnlocalizedName() + "." + (String)this.nameFunction.apply(stack); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemNameTag.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemNameTag.java new file mode 100644 index 0000000..5a84cd2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemNameTag.java @@ -0,0 +1,34 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; + +public class ItemNameTag extends Item +{ + public ItemNameTag() + { + this.setCreativeTab(CreativeTabs.tabTools); + } + + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) + { + if (!stack.hasDisplayName()) + { + return false; + } + else if (target instanceof EntityLiving) + { + EntityLiving entityliving = (EntityLiving)target; + entityliving.setCustomNameTag(stack.getDisplayName()); + entityliving.enablePersistence(); + --stack.stackSize; + return true; + } + else + { + return super.itemInteractionForEntity(stack, playerIn, target); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemPickaxe.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemPickaxe.java new file mode 100644 index 0000000..71baaba --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemPickaxe.java @@ -0,0 +1,27 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; + +public class ItemPickaxe extends ItemTool +{ + private static final Set EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.activator_rail, Blocks.coal_ore, Blocks.cobblestone, Blocks.detector_rail, Blocks.diamond_block, Blocks.diamond_ore, Blocks.double_stone_slab, Blocks.golden_rail, Blocks.gold_block, Blocks.gold_ore, Blocks.ice, Blocks.iron_block, Blocks.iron_ore, Blocks.lapis_block, Blocks.lapis_ore, Blocks.lit_redstone_ore, Blocks.mossy_cobblestone, Blocks.netherrack, Blocks.packed_ice, Blocks.rail, Blocks.redstone_ore, Blocks.sandstone, Blocks.red_sandstone, Blocks.stone, Blocks.stone_slab}); + + protected ItemPickaxe(Item.ToolMaterial material) + { + super(2.0F, material, EFFECTIVE_ON); + } + + public boolean canHarvestBlock(Block blockIn) + { + return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore ? (blockIn != Blocks.redstone_ore && blockIn != Blocks.lit_redstone_ore ? (blockIn.getMaterial() == Material.rock ? true : (blockIn.getMaterial() == Material.iron ? true : blockIn.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); + } + + public float getStrVsBlock(ItemStack stack, Block state) + { + return state.getMaterial() != Material.iron && state.getMaterial() != Material.anvil && state.getMaterial() != Material.rock ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemPiston.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemPiston.java new file mode 100644 index 0000000..f8f17c1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemPiston.java @@ -0,0 +1,16 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; + +public class ItemPiston extends ItemBlock +{ + public ItemPiston(Block block) + { + super(block); + } + + public int getMetadata(int damage) + { + return 7; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemPotion.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemPotion.java new file mode 100644 index 0000000..32ce58c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemPotion.java @@ -0,0 +1,373 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.stats.StatList; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemPotion extends Item +{ + private Map> effectCache = Maps.>newHashMap(); + private static final Map, Integer> SUB_ITEMS_CACHE = Maps., Integer>newLinkedHashMap(); + + public ItemPotion() + { + this.setMaxStackSize(1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + public List getEffects(ItemStack stack) + { + if (stack.hasTagCompound() && stack.getTagCompound().hasKey("CustomPotionEffects", 9)) + { + List list1 = Lists.newArrayList(); + NBTTagList nbttaglist = stack.getTagCompound().getTagList("CustomPotionEffects", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + PotionEffect potioneffect = PotionEffect.readCustomPotionEffectFromNBT(nbttagcompound); + + if (potioneffect != null) + { + list1.add(potioneffect); + } + } + + return list1; + } + else + { + List list = (List)this.effectCache.get(Integer.valueOf(stack.getMetadata())); + + if (list == null) + { + list = PotionHelper.getPotionEffects(stack.getMetadata(), false); + this.effectCache.put(Integer.valueOf(stack.getMetadata()), list); + } + + return list; + } + } + + public List getEffects(int meta) + { + List list = (List)this.effectCache.get(Integer.valueOf(meta)); + + if (list == null) + { + list = PotionHelper.getPotionEffects(meta, false); + this.effectCache.put(Integer.valueOf(meta), list); + } + + return list; + } + + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + if (!playerIn.capabilities.isCreativeMode) + { + --stack.stackSize; + } + + if (!worldIn.isRemote) + { + List list = this.getEffects(stack); + + if (list != null) + { + for (PotionEffect potioneffect : list) + { + playerIn.addPotionEffect(new PotionEffect(potioneffect)); + } + } + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + + if (!playerIn.capabilities.isCreativeMode) + { + if (stack.stackSize <= 0) + { + return new ItemStack(Items.glass_bottle); + } + + playerIn.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); + } + + return stack; + } + + public int getMaxItemUseDuration(ItemStack stack) + { + return 32; + } + + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.DRINK; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (isSplash(itemStackIn.getMetadata())) + { + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityPotion(worldIn, playerIn, itemStackIn)); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } + else + { + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } + } + + public static boolean isSplash(int meta) + { + return (meta & 16384) != 0; + } + + public int getColorFromDamage(int meta) + { + return PotionHelper.getLiquidColor(meta, false); + } + + public int getColorFromItemStack(ItemStack stack, int renderPass) + { + return renderPass > 0 ? 16777215 : this.getColorFromDamage(stack.getMetadata()); + } + + public boolean isEffectInstant(int meta) + { + List list = this.getEffects(meta); + + if (list != null && !list.isEmpty()) + { + for (PotionEffect potioneffect : list) + { + if (Potion.potionTypes[potioneffect.getPotionID()].isInstant()) + { + return true; + } + } + + return false; + } + else + { + return false; + } + } + + public String getItemStackDisplayName(ItemStack stack) + { + if (stack.getMetadata() == 0) + { + return StatCollector.translateToLocal("item.emptyPotion.name").trim(); + } + else + { + String s = ""; + + if (isSplash(stack.getMetadata())) + { + s = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " "; + } + + List list = Items.potionitem.getEffects(stack); + + if (list != null && !list.isEmpty()) + { + String s2 = ((PotionEffect)list.get(0)).getEffectName(); + s2 = s2 + ".postfix"; + return s + StatCollector.translateToLocal(s2).trim(); + } + else + { + String s1 = PotionHelper.getPotionPrefix(stack.getMetadata()); + return StatCollector.translateToLocal(s1).trim() + " " + super.getItemStackDisplayName(stack); + } + } + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + if (stack.getMetadata() != 0) + { + List list = Items.potionitem.getEffects(stack); + Multimap multimap = HashMultimap.create(); + + if (list != null && !list.isEmpty()) + { + for (PotionEffect potioneffect : list) + { + String s1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); + Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; + Map map = potion.getAttributeModifierMap(); + + if (map != null && map.size() > 0) + { + for (Entry entry : map.entrySet()) + { + AttributeModifier attributemodifier = (AttributeModifier)entry.getValue(); + AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.getAttributeModifierAmount(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation()); + multimap.put(((IAttribute)entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1); + } + } + + if (potioneffect.getAmplifier() > 0) + { + s1 = s1 + " " + StatCollector.translateToLocal("potion.potency." + potioneffect.getAmplifier()).trim(); + } + + if (potioneffect.getDuration() > 20) + { + s1 = s1 + " (" + Potion.getDurationString(potioneffect) + ")"; + } + + if (potion.isBadEffect()) + { + tooltip.add(EnumChatFormatting.RED + s1); + } + else + { + tooltip.add(EnumChatFormatting.GRAY + s1); + } + } + } + else + { + String s = StatCollector.translateToLocal("potion.empty").trim(); + tooltip.add(EnumChatFormatting.GRAY + s); + } + + if (!multimap.isEmpty()) + { + tooltip.add(""); + tooltip.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); + + for (Entry entry1 : multimap.entries()) + { + AttributeModifier attributemodifier2 = (AttributeModifier)entry1.getValue(); + double d0 = attributemodifier2.getAmount(); + double d1; + + if (attributemodifier2.getOperation() != 1 && attributemodifier2.getOperation() != 2) + { + d1 = attributemodifier2.getAmount(); + } + else + { + d1 = attributemodifier2.getAmount() * 100.0D; + } + + if (d0 > 0.0D) + { + tooltip.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[] {ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry1.getKey())})); + } + else if (d0 < 0.0D) + { + d1 = d1 * -1.0D; + tooltip.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[] {ItemStack.DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry1.getKey())})); + } + } + } + } + } + + public boolean hasEffect(ItemStack stack) + { + List list = this.getEffects(stack); + return list != null && !list.isEmpty(); + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + super.getSubItems(itemIn, tab, subItems); + + if (SUB_ITEMS_CACHE.isEmpty()) + { + for (int i = 0; i <= 15; ++i) + { + for (int j = 0; j <= 1; ++j) + { + int lvt_6_1_; + + if (j == 0) + { + lvt_6_1_ = i | 8192; + } + else + { + lvt_6_1_ = i | 16384; + } + + for (int l = 0; l <= 2; ++l) + { + int i1 = lvt_6_1_; + + if (l != 0) + { + if (l == 1) + { + i1 = lvt_6_1_ | 32; + } + else if (l == 2) + { + i1 = lvt_6_1_ | 64; + } + } + + List list = PotionHelper.getPotionEffects(i1, false); + + if (list != null && !list.isEmpty()) + { + SUB_ITEMS_CACHE.put(list, Integer.valueOf(i1)); + } + } + } + } + } + + Iterator iterator = SUB_ITEMS_CACHE.values().iterator(); + + while (iterator.hasNext()) + { + int j1 = ((Integer)iterator.next()).intValue(); + subItems.add(new ItemStack(itemIn, 1, j1)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemRecord.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemRecord.java new file mode 100644 index 0000000..b454036 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemRecord.java @@ -0,0 +1,74 @@ +package net.minecraft.item; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.minecraft.block.BlockJukebox; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemRecord extends Item +{ + private static final Map RECORDS = Maps.newHashMap(); + public final String recordName; + + protected ItemRecord(String name) + { + this.recordName = name; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabMisc); + RECORDS.put("records." + name, this); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == Blocks.jukebox && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue()) + { + if (worldIn.isRemote) + { + return true; + } + else + { + ((BlockJukebox)Blocks.jukebox).insertRecord(worldIn, pos, iblockstate, stack); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1005, pos, Item.getIdFromItem(this)); + --stack.stackSize; + playerIn.triggerAchievement(StatList.field_181740_X); + return true; + } + } + else + { + return false; + } + } + + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + tooltip.add(this.getRecordNameLocal()); + } + + public String getRecordNameLocal() + { + return StatCollector.translateToLocal("item.record." + this.recordName + ".desc"); + } + + public EnumRarity getRarity(ItemStack stack) + { + return EnumRarity.RARE; + } + + public static ItemRecord getRecord(String name) + { + return (ItemRecord)RECORDS.get(name); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemRedstone.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemRedstone.java new file mode 100644 index 0000000..2adc31b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemRedstone.java @@ -0,0 +1,48 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemRedstone extends Item +{ + public ItemRedstone() + { + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + boolean flag = worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos); + BlockPos blockpos = flag ? pos : pos.offset(side); + + if (!playerIn.canPlayerEdit(blockpos, side, stack)) + { + return false; + } + else + { + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (!worldIn.canBlockBePlaced(block, blockpos, false, side, (Entity)null, stack)) + { + return false; + } + else if (Blocks.redstone_wire.canPlaceBlockAt(worldIn, blockpos)) + { + --stack.stackSize; + worldIn.setBlockState(blockpos, Blocks.redstone_wire.getDefaultState()); + return true; + } + else + { + return false; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemReed.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemReed.java new file mode 100644 index 0000000..141577b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemReed.java @@ -0,0 +1,69 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSnow; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemReed extends Item +{ + private Block block; + + public ItemReed(Block block) + { + this.block = block; + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (block == Blocks.snow_layer && ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue() < 1) + { + side = EnumFacing.UP; + } + else if (!block.isReplaceable(worldIn, pos)) + { + pos = pos.offset(side); + } + + if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else if (stack.stackSize == 0) + { + return false; + } + else + { + if (worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity)null, stack)) + { + IBlockState iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, 0, playerIn); + + if (worldIn.setBlockState(pos, iblockstate1, 3)) + { + iblockstate1 = worldIn.getBlockState(pos); + + if (iblockstate1.getBlock() == this.block) + { + ItemBlock.setTileEntityNBT(worldIn, playerIn, pos, stack); + iblockstate1.getBlock().onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); + } + + worldIn.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F); + --stack.stackSize; + return true; + } + } + + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSaddle.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSaddle.java new file mode 100644 index 0000000..3fb2a6d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSaddle.java @@ -0,0 +1,42 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.EntityPlayer; + +public class ItemSaddle extends Item +{ + public ItemSaddle() + { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) + { + if (target instanceof EntityPig) + { + EntityPig entitypig = (EntityPig)target; + + if (!entitypig.getSaddled() && !entitypig.isChild()) + { + entitypig.setSaddled(true); + entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F); + --stack.stackSize; + } + + return true; + } + else + { + return false; + } + } + + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) + { + this.itemInteractionForEntity(stack, (EntityPlayer)null, target); + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSeedFood.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSeedFood.java new file mode 100644 index 0000000..a246ecb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSeedFood.java @@ -0,0 +1,42 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemSeedFood extends ItemFood +{ + private Block crops; + private Block soilId; + + public ItemSeedFood(int healAmount, float saturation, Block crops, Block soil) + { + super(healAmount, saturation, false); + this.crops = crops; + this.soilId = soil; + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side != EnumFacing.UP) + { + return false; + } + else if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) + { + return false; + } + else if (worldIn.getBlockState(pos).getBlock() == this.soilId && worldIn.isAirBlock(pos.up())) + { + worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); + --stack.stackSize; + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSeeds.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSeeds.java new file mode 100644 index 0000000..a6bc80c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSeeds.java @@ -0,0 +1,43 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemSeeds extends Item +{ + private Block crops; + private Block soilBlockID; + + public ItemSeeds(Block crops, Block soil) + { + this.crops = crops; + this.soilBlockID = soil; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side != EnumFacing.UP) + { + return false; + } + else if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) + { + return false; + } + else if (worldIn.getBlockState(pos).getBlock() == this.soilBlockID && worldIn.isAirBlock(pos.up())) + { + worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); + --stack.stackSize; + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemShears.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemShears.java new file mode 100644 index 0000000..7e2c5d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemShears.java @@ -0,0 +1,42 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class ItemShears extends Item +{ + public ItemShears() + { + this.setMaxStackSize(1); + this.setMaxDamage(238); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) + { + if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool) + { + return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn); + } + else + { + stack.damageItem(1, playerIn); + return true; + } + } + + public boolean canHarvestBlock(Block blockIn) + { + return blockIn == Blocks.web || blockIn == Blocks.redstone_wire || blockIn == Blocks.tripwire; + } + + public float getStrVsBlock(ItemStack stack, Block state) + { + return state != Blocks.web && state.getMaterial() != Material.leaves ? (state == Blocks.wool ? 5.0F : super.getStrVsBlock(stack, state)) : 15.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSign.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSign.java new file mode 100644 index 0000000..c7bda19 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSign.java @@ -0,0 +1,73 @@ +package net.minecraft.item; + +import net.minecraft.block.BlockStandingSign; +import net.minecraft.block.BlockWallSign; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemSign extends Item +{ + public ItemSign() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side == EnumFacing.DOWN) + { + return false; + } + else if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid()) + { + return false; + } + else + { + pos = pos.offset(side); + + if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else if (!Blocks.standing_sign.canPlaceBlockAt(worldIn, pos)) + { + return false; + } + else if (worldIn.isRemote) + { + return true; + } + else + { + if (side == EnumFacing.UP) + { + int i = MathHelper.floor_double((double)((playerIn.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; + worldIn.setBlockState(pos, Blocks.standing_sign.getDefaultState().withProperty(BlockStandingSign.ROTATION, Integer.valueOf(i)), 3); + } + else + { + worldIn.setBlockState(pos, Blocks.wall_sign.getDefaultState().withProperty(BlockWallSign.FACING, side), 3); + } + + --stack.stackSize; + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntitySign && !ItemBlock.setTileEntityNBT(worldIn, playerIn, pos, stack)) + { + playerIn.openEditSign((TileEntitySign)tileentity); + } + + return true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSimpleFoiled.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSimpleFoiled.java new file mode 100644 index 0000000..4f5e2ae --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSimpleFoiled.java @@ -0,0 +1,9 @@ +package net.minecraft.item; + +public class ItemSimpleFoiled extends Item +{ + public boolean hasEffect(ItemStack stack) + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSkull.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSkull.java new file mode 100644 index 0000000..cd4ddd7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSkull.java @@ -0,0 +1,182 @@ +package net.minecraft.item; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSkull; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemSkull extends Item +{ + private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper"}; + + public ItemSkull() + { + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (side == EnumFacing.DOWN) + { + return false; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + boolean flag = block.isReplaceable(worldIn, pos); + + if (!flag) + { + if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid()) + { + return false; + } + + pos = pos.offset(side); + } + + if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else if (!Blocks.skull.canPlaceBlockAt(worldIn, pos)) + { + return false; + } + else + { + if (!worldIn.isRemote) + { + worldIn.setBlockState(pos, Blocks.skull.getDefaultState().withProperty(BlockSkull.FACING, side), 3); + int i = 0; + + if (side == EnumFacing.UP) + { + i = MathHelper.floor_double((double)(playerIn.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; + } + + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof TileEntitySkull) + { + TileEntitySkull tileentityskull = (TileEntitySkull)tileentity; + + if (stack.getMetadata() == 3) + { + GameProfile gameprofile = null; + + if (stack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = stack.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) + { + gameprofile = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner")); + } + } + + tileentityskull.setPlayerProfile(gameprofile); + } + else + { + tileentityskull.setType(stack.getMetadata()); + } + + tileentityskull.setSkullRotation(i); + Blocks.skull.checkWitherSpawn(worldIn, pos, tileentityskull); + } + + --stack.stackSize; + } + + return true; + } + } + } + + public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + { + for (int i = 0; i < skullTypes.length; ++i) + { + subItems.add(new ItemStack(itemIn, 1, i)); + } + } + + public int getMetadata(int damage) + { + return damage; + } + + public String getUnlocalizedName(ItemStack stack) + { + int i = stack.getMetadata(); + + if (i < 0 || i >= skullTypes.length) + { + i = 0; + } + + return super.getUnlocalizedName() + "." + skullTypes[i]; + } + + public String getItemStackDisplayName(ItemStack stack) + { + if (stack.getMetadata() == 3 && stack.hasTagCompound()) + { + if (stack.getTagCompound().hasKey("SkullOwner", 8)) + { + return StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {stack.getTagCompound().getString("SkullOwner")}); + } + + if (stack.getTagCompound().hasKey("SkullOwner", 10)) + { + NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("SkullOwner"); + + if (nbttagcompound.hasKey("Name", 8)) + { + return StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {nbttagcompound.getString("Name")}); + } + } + } + + return super.getItemStackDisplayName(stack); + } + + public boolean updateItemStackNBT(NBTTagCompound nbt) + { + super.updateItemStackNBT(nbt); + + if (nbt.hasKey("SkullOwner", 8) && nbt.getString("SkullOwner").length() > 0) + { + GameProfile gameprofile = new GameProfile((UUID)null, nbt.getString("SkullOwner")); + gameprofile = TileEntitySkull.updateGameprofile(gameprofile); + nbt.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile)); + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSlab.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSlab.java new file mode 100644 index 0000000..8bc911d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSlab.java @@ -0,0 +1,121 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemSlab extends ItemBlock +{ + private final BlockSlab singleSlab; + private final BlockSlab doubleSlab; + + public ItemSlab(Block block, BlockSlab singleSlab, BlockSlab doubleSlab) + { + super(block); + this.singleSlab = singleSlab; + this.doubleSlab = doubleSlab; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + public int getMetadata(int damage) + { + return damage; + } + + public String getUnlocalizedName(ItemStack stack) + { + return this.singleSlab.getUnlocalizedName(stack.getMetadata()); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (stack.stackSize == 0) + { + return false; + } + else if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) + { + return false; + } + else + { + Object object = this.singleSlab.getVariant(stack); + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this.singleSlab) + { + IProperty iproperty = this.singleSlab.getVariantProperty(); + Comparable comparable = iblockstate.getValue(iproperty); + BlockSlab.EnumBlockHalf blockslab$enumblockhalf = (BlockSlab.EnumBlockHalf)iblockstate.getValue(BlockSlab.HALF); + + if ((side == EnumFacing.UP && blockslab$enumblockhalf == BlockSlab.EnumBlockHalf.BOTTOM || side == EnumFacing.DOWN && blockslab$enumblockhalf == BlockSlab.EnumBlockHalf.TOP) && comparable == object) + { + IBlockState iblockstate1 = this.doubleSlab.getDefaultState().withProperty(iproperty, comparable); + + if (worldIn.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(worldIn, pos, iblockstate1)) && worldIn.setBlockState(pos, iblockstate1, 3)) + { + worldIn.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getFrequency() * 0.8F); + --stack.stackSize; + } + + return true; + } + } + + return this.tryPlace(stack, worldIn, pos.offset(side), object) ? true : super.onItemUse(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ); + } + } + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) + { + BlockPos blockpos = pos; + IProperty iproperty = this.singleSlab.getVariantProperty(); + Object object = this.singleSlab.getVariant(stack); + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this.singleSlab) + { + boolean flag = iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP; + + if ((side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) && object == iblockstate.getValue(iproperty)) + { + return true; + } + } + + pos = pos.offset(side); + IBlockState iblockstate1 = worldIn.getBlockState(pos); + return iblockstate1.getBlock() == this.singleSlab && object == iblockstate1.getValue(iproperty) ? true : super.canPlaceBlockOnSide(worldIn, blockpos, side, player, stack); + } + + private boolean tryPlace(ItemStack stack, World worldIn, BlockPos pos, Object variantInStack) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock() == this.singleSlab) + { + Comparable comparable = iblockstate.getValue(this.singleSlab.getVariantProperty()); + + if (comparable == variantInStack) + { + IBlockState iblockstate1 = this.doubleSlab.getDefaultState().withProperty((IProperty)this.singleSlab.getVariantProperty(), comparable); + + if (worldIn.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(worldIn, pos, iblockstate1)) && worldIn.setBlockState(pos, iblockstate1, 3)) + { + worldIn.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getFrequency() * 0.8F); + --stack.stackSize; + } + + return true; + } + } + + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSnow.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSnow.java new file mode 100644 index 0000000..c96867a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSnow.java @@ -0,0 +1,70 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSnow; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemSnow extends ItemBlock +{ + public ItemSnow(Block block) + { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (stack.stackSize == 0) + { + return false; + } + else if (!playerIn.canPlayerEdit(pos, side, stack)) + { + return false; + } + else + { + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + BlockPos blockpos = pos; + + if ((side != EnumFacing.UP || block != this.block) && !block.isReplaceable(worldIn, pos)) + { + blockpos = pos.offset(side); + iblockstate = worldIn.getBlockState(blockpos); + block = iblockstate.getBlock(); + } + + if (block == this.block) + { + int i = ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue(); + + if (i <= 7) + { + IBlockState iblockstate1 = iblockstate.withProperty(BlockSnow.LAYERS, Integer.valueOf(i + 1)); + AxisAlignedBB axisalignedbb = this.block.getCollisionBoundingBox(worldIn, blockpos, iblockstate1); + + if (axisalignedbb != null && worldIn.checkNoEntityCollision(axisalignedbb) && worldIn.setBlockState(blockpos, iblockstate1, 2)) + { + worldIn.playSoundEffect((double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F), this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F); + --stack.stackSize; + return true; + } + } + } + + return super.onItemUse(stack, playerIn, worldIn, blockpos, side, hitX, hitY, hitZ); + } + } + + public int getMetadata(int damage) + { + return damage; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSnowball.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSnowball.java new file mode 100644 index 0000000..d8f9a99 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSnowball.java @@ -0,0 +1,34 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemSnowball extends Item +{ + public ItemSnowball() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + if (!playerIn.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntitySnowball(worldIn, playerIn)); + } + + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSoup.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSoup.java new file mode 100644 index 0000000..cbbf2fd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSoup.java @@ -0,0 +1,20 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + +public class ItemSoup extends ItemFood +{ + public ItemSoup(int healAmount) + { + super(healAmount, false); + this.setMaxStackSize(1); + } + + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) + { + super.onItemUseFinish(stack, worldIn, playerIn); + return new ItemStack(Items.bowl); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSpade.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSpade.java new file mode 100644 index 0000000..606f300 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSpade.java @@ -0,0 +1,21 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class ItemSpade extends ItemTool +{ + private static final Set EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.clay, Blocks.dirt, Blocks.farmland, Blocks.grass, Blocks.gravel, Blocks.mycelium, Blocks.sand, Blocks.snow, Blocks.snow_layer, Blocks.soul_sand}); + + public ItemSpade(Item.ToolMaterial material) + { + super(1.0F, material, EFFECTIVE_ON); + } + + public boolean canHarvestBlock(Block blockIn) + { + return blockIn == Blocks.snow_layer ? true : blockIn == Blocks.snow; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemStack.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemStack.java new file mode 100644 index 0000000..efa8411 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemStack.java @@ -0,0 +1,944 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import java.text.DecimalFormat; +import java.util.List; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentDurability; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.HoverEvent; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public final class ItemStack +{ + public static final DecimalFormat DECIMALFORMAT = new DecimalFormat("#.###"); + public int stackSize; + public int animationsToGo; + private Item item; + private NBTTagCompound stackTagCompound; + private int itemDamage; + private EntityItemFrame itemFrame; + private Block canDestroyCacheBlock; + private boolean canDestroyCacheResult; + private Block canPlaceOnCacheBlock; + private boolean canPlaceOnCacheResult; + + public ItemStack(Block blockIn) + { + this((Block)blockIn, 1); + } + + public ItemStack(Block blockIn, int amount) + { + this((Block)blockIn, amount, 0); + } + + public ItemStack(Block blockIn, int amount, int meta) + { + this(Item.getItemFromBlock(blockIn), amount, meta); + } + + public ItemStack(Item itemIn) + { + this((Item)itemIn, 1); + } + + public ItemStack(Item itemIn, int amount) + { + this((Item)itemIn, amount, 0); + } + + public ItemStack(Item itemIn, int amount, int meta) + { + this.canDestroyCacheBlock = null; + this.canDestroyCacheResult = false; + this.canPlaceOnCacheBlock = null; + this.canPlaceOnCacheResult = false; + this.item = itemIn; + this.stackSize = amount; + this.itemDamage = meta; + + if (this.itemDamage < 0) + { + this.itemDamage = 0; + } + } + + public static ItemStack loadItemStackFromNBT(NBTTagCompound nbt) + { + ItemStack itemstack = new ItemStack(); + itemstack.readFromNBT(nbt); + return itemstack.getItem() != null ? itemstack : null; + } + + private ItemStack() + { + this.canDestroyCacheBlock = null; + this.canDestroyCacheResult = false; + this.canPlaceOnCacheBlock = null; + this.canPlaceOnCacheResult = false; + } + + public ItemStack splitStack(int amount) + { + ItemStack itemstack = new ItemStack(this.item, amount, this.itemDamage); + + if (this.stackTagCompound != null) + { + itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + + this.stackSize -= amount; + return itemstack; + } + + public Item getItem() + { + return this.item; + } + + public boolean onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { + boolean flag = this.getItem().onItemUse(this, playerIn, worldIn, pos, side, hitX, hitY, hitZ); + + if (flag) + { + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this.item)]); + } + + return flag; + } + + public float getStrVsBlock(Block blockIn) + { + return this.getItem().getStrVsBlock(this, blockIn); + } + + public ItemStack useItemRightClick(World worldIn, EntityPlayer playerIn) + { + return this.getItem().onItemRightClick(this, worldIn, playerIn); + } + + public ItemStack onItemUseFinish(World worldIn, EntityPlayer playerIn) + { + return this.getItem().onItemUseFinish(this, worldIn, playerIn); + } + + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { + ResourceLocation resourcelocation = (ResourceLocation)Item.itemRegistry.getNameForObject(this.item); + nbt.setString("id", resourcelocation == null ? "minecraft:air" : resourcelocation.toString()); + nbt.setByte("Count", (byte)this.stackSize); + nbt.setShort("Damage", (short)this.itemDamage); + + if (this.stackTagCompound != null) + { + nbt.setTag("tag", this.stackTagCompound); + } + + return nbt; + } + + public void readFromNBT(NBTTagCompound nbt) + { + if (nbt.hasKey("id", 8)) + { + this.item = Item.getByNameOrId(nbt.getString("id")); + } + else + { + this.item = Item.getItemById(nbt.getShort("id")); + } + + this.stackSize = nbt.getByte("Count"); + this.itemDamage = nbt.getShort("Damage"); + + if (this.itemDamage < 0) + { + this.itemDamage = 0; + } + + if (nbt.hasKey("tag", 10)) + { + this.stackTagCompound = nbt.getCompoundTag("tag"); + + if (this.item != null) + { + this.item.updateItemStackNBT(this.stackTagCompound); + } + } + } + + public int getMaxStackSize() + { + return this.getItem().getItemStackLimit(); + } + + public boolean isStackable() + { + return this.getMaxStackSize() > 1 && (!this.isItemStackDamageable() || !this.isItemDamaged()); + } + + public boolean isItemStackDamageable() + { + return this.item == null ? false : (this.item.getMaxDamage() <= 0 ? false : !this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable")); + } + + public boolean getHasSubtypes() + { + return this.item.getHasSubtypes(); + } + + public boolean isItemDamaged() + { + return this.isItemStackDamageable() && this.itemDamage > 0; + } + + public int getItemDamage() + { + return this.itemDamage; + } + + public int getMetadata() + { + return this.itemDamage; + } + + public void setItemDamage(int meta) + { + this.itemDamage = meta; + + if (this.itemDamage < 0) + { + this.itemDamage = 0; + } + } + + public int getMaxDamage() + { + return this.item.getMaxDamage(); + } + + public boolean attemptDamageItem(int amount, Random rand) + { + if (!this.isItemStackDamageable()) + { + return false; + } + else + { + if (amount > 0) + { + int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, this); + int j = 0; + + for (int k = 0; i > 0 && k < amount; ++k) + { + if (EnchantmentDurability.negateDamage(this, i, rand)) + { + ++j; + } + } + + amount -= j; + + if (amount <= 0) + { + return false; + } + } + + this.itemDamage += amount; + return this.itemDamage > this.getMaxDamage(); + } + } + + public void damageItem(int amount, EntityLivingBase entityIn) + { + if (!(entityIn instanceof EntityPlayer) || !((EntityPlayer)entityIn).capabilities.isCreativeMode) + { + if (this.isItemStackDamageable()) + { + if (this.attemptDamageItem(amount, entityIn.getRNG())) + { + entityIn.renderBrokenItemStack(this); + --this.stackSize; + + if (entityIn instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)entityIn; + entityplayer.triggerAchievement(StatList.objectBreakStats[Item.getIdFromItem(this.item)]); + + if (this.stackSize == 0 && this.getItem() instanceof ItemBow) + { + entityplayer.destroyCurrentEquippedItem(); + } + } + + if (this.stackSize < 0) + { + this.stackSize = 0; + } + + this.itemDamage = 0; + } + } + } + } + + public void hitEntity(EntityLivingBase entityIn, EntityPlayer playerIn) + { + boolean flag = this.item.hitEntity(this, entityIn, playerIn); + + if (flag) + { + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this.item)]); + } + } + + public void onBlockDestroyed(World worldIn, Block blockIn, BlockPos pos, EntityPlayer playerIn) + { + boolean flag = this.item.onBlockDestroyed(this, worldIn, blockIn, pos, playerIn); + + if (flag) + { + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this.item)]); + } + } + + public boolean canHarvestBlock(Block blockIn) + { + return this.item.canHarvestBlock(blockIn); + } + + public boolean interactWithEntity(EntityPlayer playerIn, EntityLivingBase entityIn) + { + return this.item.itemInteractionForEntity(this, playerIn, entityIn); + } + + public ItemStack copy() + { + ItemStack itemstack = new ItemStack(this.item, this.stackSize, this.itemDamage); + + if (this.stackTagCompound != null) + { + itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + + return itemstack; + } + + public static boolean areItemStackTagsEqual(ItemStack stackA, ItemStack stackB) + { + return stackA == null && stackB == null ? true : (stackA != null && stackB != null ? (stackA.stackTagCompound == null && stackB.stackTagCompound != null ? false : stackA.stackTagCompound == null || stackA.stackTagCompound.equals(stackB.stackTagCompound)) : false); + } + + public static boolean areItemStacksEqual(ItemStack stackA, ItemStack stackB) + { + return stackA == null && stackB == null ? true : (stackA != null && stackB != null ? stackA.isItemStackEqual(stackB) : false); + } + + private boolean isItemStackEqual(ItemStack other) + { + return this.stackSize != other.stackSize ? false : (this.item != other.item ? false : (this.itemDamage != other.itemDamage ? false : (this.stackTagCompound == null && other.stackTagCompound != null ? false : this.stackTagCompound == null || this.stackTagCompound.equals(other.stackTagCompound)))); + } + + public static boolean areItemsEqual(ItemStack stackA, ItemStack stackB) + { + return stackA == null && stackB == null ? true : (stackA != null && stackB != null ? stackA.isItemEqual(stackB) : false); + } + + public boolean isItemEqual(ItemStack other) + { + return other != null && this.item == other.item && this.itemDamage == other.itemDamage; + } + + public String getUnlocalizedName() + { + return this.item.getUnlocalizedName(this); + } + + public static ItemStack copyItemStack(ItemStack stack) + { + return stack == null ? null : stack.copy(); + } + + public String toString() + { + return this.stackSize + "x" + this.item.getUnlocalizedName() + "@" + this.itemDamage; + } + + public void updateAnimation(World worldIn, Entity entityIn, int inventorySlot, boolean isCurrentItem) + { + if (this.animationsToGo > 0) + { + --this.animationsToGo; + } + + this.item.onUpdate(this, worldIn, entityIn, inventorySlot, isCurrentItem); + } + + public void onCrafting(World worldIn, EntityPlayer playerIn, int amount) + { + playerIn.addStat(StatList.objectCraftStats[Item.getIdFromItem(this.item)], amount); + this.item.onCreated(this, worldIn, playerIn); + } + + public boolean getIsItemStackEqual(ItemStack p_179549_1_) + { + return this.isItemStackEqual(p_179549_1_); + } + + public int getMaxItemUseDuration() + { + return this.getItem().getMaxItemUseDuration(this); + } + + public EnumAction getItemUseAction() + { + return this.getItem().getItemUseAction(this); + } + + public void onPlayerStoppedUsing(World worldIn, EntityPlayer playerIn, int timeLeft) + { + this.getItem().onPlayerStoppedUsing(this, worldIn, playerIn, timeLeft); + } + + public boolean hasTagCompound() + { + return this.stackTagCompound != null; + } + + public NBTTagCompound getTagCompound() + { + return this.stackTagCompound; + } + + public NBTTagCompound getSubCompound(String key, boolean create) + { + if (this.stackTagCompound != null && this.stackTagCompound.hasKey(key, 10)) + { + return this.stackTagCompound.getCompoundTag(key); + } + else if (create) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.setTagInfo(key, nbttagcompound); + return nbttagcompound; + } + else + { + return null; + } + } + + public NBTTagList getEnchantmentTagList() + { + return this.stackTagCompound == null ? null : this.stackTagCompound.getTagList("ench", 10); + } + + public void setTagCompound(NBTTagCompound nbt) + { + this.stackTagCompound = nbt; + } + + public String getDisplayName() + { + String s = this.getItem().getItemStackDisplayName(this); + + if (this.stackTagCompound != null && this.stackTagCompound.hasKey("display", 10)) + { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + + if (nbttagcompound.hasKey("Name", 8)) + { + s = nbttagcompound.getString("Name"); + } + } + + return s; + } + + public ItemStack setStackDisplayName(String displayName) + { + if (this.stackTagCompound == null) + { + this.stackTagCompound = new NBTTagCompound(); + } + + if (!this.stackTagCompound.hasKey("display", 10)) + { + this.stackTagCompound.setTag("display", new NBTTagCompound()); + } + + this.stackTagCompound.getCompoundTag("display").setString("Name", displayName); + return this; + } + + public void clearCustomName() + { + if (this.stackTagCompound != null) + { + if (this.stackTagCompound.hasKey("display", 10)) + { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + nbttagcompound.removeTag("Name"); + + if (nbttagcompound.hasNoTags()) + { + this.stackTagCompound.removeTag("display"); + + if (this.stackTagCompound.hasNoTags()) + { + this.setTagCompound((NBTTagCompound)null); + } + } + } + } + } + + public boolean hasDisplayName() + { + return this.stackTagCompound == null ? false : (!this.stackTagCompound.hasKey("display", 10) ? false : this.stackTagCompound.getCompoundTag("display").hasKey("Name", 8)); + } + + public List getTooltip(EntityPlayer playerIn, boolean advanced) + { + List list = Lists.newArrayList(); + String s = this.getDisplayName(); + + if (this.hasDisplayName()) + { + s = EnumChatFormatting.ITALIC + s; + } + + s = s + EnumChatFormatting.RESET; + + if (advanced) + { + String s1 = ""; + + if (s.length() > 0) + { + s = s + " ("; + s1 = ")"; + } + + int i = Item.getIdFromItem(this.item); + + if (this.getHasSubtypes()) + { + s = s + String.format("#%04d/%d%s", new Object[] {Integer.valueOf(i), Integer.valueOf(this.itemDamage), s1}); + } + else + { + s = s + String.format("#%04d%s", new Object[] {Integer.valueOf(i), s1}); + } + } + else if (!this.hasDisplayName() && this.item == Items.filled_map) + { + s = s + " #" + this.itemDamage; + } + + list.add(s); + int i1 = 0; + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("HideFlags", 99)) + { + i1 = this.stackTagCompound.getInteger("HideFlags"); + } + + if ((i1 & 32) == 0) + { + this.item.addInformation(this, playerIn, list, advanced); + } + + if (this.hasTagCompound()) + { + if ((i1 & 1) == 0) + { + NBTTagList nbttaglist = this.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (int j = 0; j < nbttaglist.tagCount(); ++j) + { + int k = nbttaglist.getCompoundTagAt(j).getShort("id"); + int l = nbttaglist.getCompoundTagAt(j).getShort("lvl"); + + if (Enchantment.getEnchantmentById(k) != null) + { + list.add(Enchantment.getEnchantmentById(k).getTranslatedName(l)); + } + } + } + } + + if (this.stackTagCompound.hasKey("display", 10)) + { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + + if (nbttagcompound.hasKey("color", 3)) + { + if (advanced) + { + list.add("Color: #" + Integer.toHexString(nbttagcompound.getInteger("color")).toUpperCase()); + } + else + { + list.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed")); + } + } + + if (nbttagcompound.getTagId("Lore") == 9) + { + NBTTagList nbttaglist1 = nbttagcompound.getTagList("Lore", 8); + + if (nbttaglist1.tagCount() > 0) + { + for (int j1 = 0; j1 < nbttaglist1.tagCount(); ++j1) + { + list.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + nbttaglist1.getStringTagAt(j1)); + } + } + } + } + } + + Multimap multimap = this.getAttributeModifiers(); + + if (!multimap.isEmpty() && (i1 & 2) == 0) + { + list.add(""); + + for (Entry entry : multimap.entries()) + { + AttributeModifier attributemodifier = (AttributeModifier)entry.getValue(); + double d0 = attributemodifier.getAmount(); + + if (attributemodifier.getID() == Item.itemModifierUUID) + { + d0 += (double)EnchantmentHelper.getModifierForCreature(this, EnumCreatureAttribute.UNDEFINED); + } + + double d1; + + if (attributemodifier.getOperation() != 1 && attributemodifier.getOperation() != 2) + { + d1 = d0; + } + else + { + d1 = d0 * 100.0D; + } + + if (d0 > 0.0D) + { + list.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier.getOperation(), new Object[] {DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry.getKey())})); + } + else if (d0 < 0.0D) + { + d1 = d1 * -1.0D; + list.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier.getOperation(), new Object[] {DECIMALFORMAT.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry.getKey())})); + } + } + } + + if (this.hasTagCompound() && this.getTagCompound().getBoolean("Unbreakable") && (i1 & 4) == 0) + { + list.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal("item.unbreakable")); + } + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanDestroy", 9) && (i1 & 8) == 0) + { + NBTTagList nbttaglist2 = this.stackTagCompound.getTagList("CanDestroy", 8); + + if (nbttaglist2.tagCount() > 0) + { + list.add(""); + list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.canBreak")); + + for (int k1 = 0; k1 < nbttaglist2.tagCount(); ++k1) + { + Block block = Block.getBlockFromName(nbttaglist2.getStringTagAt(k1)); + + if (block != null) + { + list.add(EnumChatFormatting.DARK_GRAY + block.getLocalizedName()); + } + else + { + list.add(EnumChatFormatting.DARK_GRAY + "missingno"); + } + } + } + } + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanPlaceOn", 9) && (i1 & 16) == 0) + { + NBTTagList nbttaglist3 = this.stackTagCompound.getTagList("CanPlaceOn", 8); + + if (nbttaglist3.tagCount() > 0) + { + list.add(""); + list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item.canPlace")); + + for (int l1 = 0; l1 < nbttaglist3.tagCount(); ++l1) + { + Block block1 = Block.getBlockFromName(nbttaglist3.getStringTagAt(l1)); + + if (block1 != null) + { + list.add(EnumChatFormatting.DARK_GRAY + block1.getLocalizedName()); + } + else + { + list.add(EnumChatFormatting.DARK_GRAY + "missingno"); + } + } + } + } + + if (advanced) + { + if (this.isItemDamaged()) + { + list.add("Durability: " + (this.getMaxDamage() - this.getItemDamage()) + " / " + this.getMaxDamage()); + } + + list.add(EnumChatFormatting.DARK_GRAY + ((ResourceLocation)Item.itemRegistry.getNameForObject(this.item)).toString()); + + if (this.hasTagCompound()) + { + list.add(EnumChatFormatting.DARK_GRAY + "NBT: " + this.getTagCompound().getKeySet().size() + " tag(s)"); + } + } + + return list; + } + + public boolean hasEffect() + { + return this.getItem().hasEffect(this); + } + + public EnumRarity getRarity() + { + return this.getItem().getRarity(this); + } + + public boolean isItemEnchantable() + { + return !this.getItem().isItemTool(this) ? false : !this.isItemEnchanted(); + } + + public void addEnchantment(Enchantment ench, int level) + { + if (this.stackTagCompound == null) + { + this.setTagCompound(new NBTTagCompound()); + } + + if (!this.stackTagCompound.hasKey("ench", 9)) + { + this.stackTagCompound.setTag("ench", new NBTTagList()); + } + + NBTTagList nbttaglist = this.stackTagCompound.getTagList("ench", 10); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setShort("id", (short)ench.effectId); + nbttagcompound.setShort("lvl", (short)((byte)level)); + nbttaglist.appendTag(nbttagcompound); + } + + public boolean isItemEnchanted() + { + return this.stackTagCompound != null && this.stackTagCompound.hasKey("ench", 9); + } + + public void setTagInfo(String key, NBTBase value) + { + if (this.stackTagCompound == null) + { + this.setTagCompound(new NBTTagCompound()); + } + + this.stackTagCompound.setTag(key, value); + } + + public boolean canEditBlocks() + { + return this.getItem().canItemEditBlocks(); + } + + public boolean isOnItemFrame() + { + return this.itemFrame != null; + } + + public void setItemFrame(EntityItemFrame frame) + { + this.itemFrame = frame; + } + + public EntityItemFrame getItemFrame() + { + return this.itemFrame; + } + + public int getRepairCost() + { + return this.hasTagCompound() && this.stackTagCompound.hasKey("RepairCost", 3) ? this.stackTagCompound.getInteger("RepairCost") : 0; + } + + public void setRepairCost(int cost) + { + if (!this.hasTagCompound()) + { + this.stackTagCompound = new NBTTagCompound(); + } + + this.stackTagCompound.setInteger("RepairCost", cost); + } + + public Multimap getAttributeModifiers() + { + Multimap multimap; + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers", 9)) + { + multimap = HashMultimap.create(); + NBTTagList nbttaglist = this.stackTagCompound.getTagList("AttributeModifiers", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + AttributeModifier attributemodifier = SharedMonsterAttributes.readAttributeModifierFromNBT(nbttagcompound); + + if (attributemodifier != null && attributemodifier.getID().getLeastSignificantBits() != 0L && attributemodifier.getID().getMostSignificantBits() != 0L) + { + multimap.put(nbttagcompound.getString("AttributeName"), attributemodifier); + } + } + } + else + { + multimap = this.getItem().getItemAttributeModifiers(); + } + + return multimap; + } + + public void setItem(Item newItem) + { + this.item = newItem; + } + + public IChatComponent getChatComponent() + { + ChatComponentText chatcomponenttext = new ChatComponentText(this.getDisplayName()); + + if (this.hasDisplayName()) + { + chatcomponenttext.getChatStyle().setItalic(Boolean.valueOf(true)); + } + + IChatComponent ichatcomponent = (new ChatComponentText("[")).appendSibling(chatcomponenttext).appendText("]"); + + if (this.item != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + ichatcomponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString()))); + ichatcomponent.getChatStyle().setColor(this.getRarity().rarityColor); + } + + return ichatcomponent; + } + + public boolean canDestroy(Block blockIn) + { + if (blockIn == this.canDestroyCacheBlock) + { + return this.canDestroyCacheResult; + } + else + { + this.canDestroyCacheBlock = blockIn; + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanDestroy", 9)) + { + NBTTagList nbttaglist = this.stackTagCompound.getTagList("CanDestroy", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + Block block = Block.getBlockFromName(nbttaglist.getStringTagAt(i)); + + if (block == blockIn) + { + this.canDestroyCacheResult = true; + return true; + } + } + } + + this.canDestroyCacheResult = false; + return false; + } + } + + public boolean canPlaceOn(Block blockIn) + { + if (blockIn == this.canPlaceOnCacheBlock) + { + return this.canPlaceOnCacheResult; + } + else + { + this.canPlaceOnCacheBlock = blockIn; + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("CanPlaceOn", 9)) + { + NBTTagList nbttaglist = this.stackTagCompound.getTagList("CanPlaceOn", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + Block block = Block.getBlockFromName(nbttaglist.getStringTagAt(i)); + + if (block == blockIn) + { + this.canPlaceOnCacheResult = true; + return true; + } + } + } + + this.canPlaceOnCacheResult = false; + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemSword.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSword.java new file mode 100644 index 0000000..f738bd4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemSword.java @@ -0,0 +1,110 @@ +package net.minecraft.item; + +import com.google.common.collect.Multimap; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class ItemSword extends Item +{ + private float attackDamage; + private final Item.ToolMaterial material; + + public ItemSword(Item.ToolMaterial material) + { + this.material = material; + this.maxStackSize = 1; + this.setMaxDamage(material.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabCombat); + this.attackDamage = 4.0F + material.getDamageVsEntity(); + } + + public float getDamageVsEntity() + { + return this.material.getDamageVsEntity(); + } + + public float getStrVsBlock(ItemStack stack, Block state) + { + if (state == Blocks.web) + { + return 15.0F; + } + else + { + Material material = state.getMaterial(); + return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F; + } + } + + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) + { + stack.damageItem(1, attacker); + return true; + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) + { + if ((double)blockIn.getBlockHardness(worldIn, pos) != 0.0D) + { + stack.damageItem(2, playerIn); + } + + return true; + } + + public boolean isFull3D() + { + return true; + } + + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.BLOCK; + } + + public int getMaxItemUseDuration(ItemStack stack) + { + return 72000; + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } + + public boolean canHarvestBlock(Block blockIn) + { + return blockIn == Blocks.web; + } + + public int getItemEnchantability() + { + return this.material.getEnchantability(); + } + + public String getToolMaterialName() + { + return this.material.toString(); + } + + public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) + { + return this.material.getRepairItem() == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); + } + + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Weapon modifier", (double)this.attackDamage, 0)); + return multimap; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemTool.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemTool.java new file mode 100644 index 0000000..d13e483 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemTool.java @@ -0,0 +1,83 @@ +package net.minecraft.item; + +import com.google.common.collect.Multimap; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class ItemTool extends Item +{ + private Set effectiveBlocks; + protected float efficiencyOnProperMaterial = 4.0F; + private float damageVsEntity; + protected Item.ToolMaterial toolMaterial; + + protected ItemTool(float attackDamage, Item.ToolMaterial material, Set effectiveBlocks) + { + this.toolMaterial = material; + this.effectiveBlocks = effectiveBlocks; + this.maxStackSize = 1; + this.setMaxDamage(material.getMaxUses()); + this.efficiencyOnProperMaterial = material.getEfficiencyOnProperMaterial(); + this.damageVsEntity = attackDamage + material.getDamageVsEntity(); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public float getStrVsBlock(ItemStack stack, Block state) + { + return this.effectiveBlocks.contains(state) ? this.efficiencyOnProperMaterial : 1.0F; + } + + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) + { + stack.damageItem(2, attacker); + return true; + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) + { + if ((double)blockIn.getBlockHardness(worldIn, pos) != 0.0D) + { + stack.damageItem(1, playerIn); + } + + return true; + } + + public boolean isFull3D() + { + return true; + } + + public Item.ToolMaterial getToolMaterial() + { + return this.toolMaterial; + } + + public int getItemEnchantability() + { + return this.toolMaterial.getEnchantability(); + } + + public String getToolMaterialName() + { + return this.toolMaterial.toString(); + } + + public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) + { + return this.toolMaterial.getRepairItem() == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); + } + + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Tool modifier", (double)this.damageVsEntity, 0)); + return multimap; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/ItemWritableBook.java b/Client-1.8.9/src/main/java/net/minecraft/item/ItemWritableBook.java new file mode 100644 index 0000000..2645fe3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/ItemWritableBook.java @@ -0,0 +1,55 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class ItemWritableBook extends Item +{ + public ItemWritableBook() + { + this.setMaxStackSize(1); + } + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { + playerIn.displayGUIBook(itemStackIn); + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + return itemStackIn; + } + + public static boolean isNBTValid(NBTTagCompound nbt) + { + if (nbt == null) + { + return false; + } + else if (!nbt.hasKey("pages", 9)) + { + return false; + } + else + { + NBTTagList nbttaglist = nbt.getTagList("pages", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + String s = nbttaglist.getStringTagAt(i); + + if (s == null) + { + return false; + } + + if (s.length() > 32767) + { + return false; + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/CraftingManager.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/CraftingManager.java new file mode 100644 index 0000000..c3a37a7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/CraftingManager.java @@ -0,0 +1,336 @@ +package net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockStone; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.block.BlockStoneSlabNew; +import net.minecraft.block.BlockWall; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class CraftingManager +{ + private static final CraftingManager instance = new CraftingManager(); + private final List recipes = Lists.newArrayList(); + + public static CraftingManager getInstance() + { + return instance; + } + + private CraftingManager() + { + (new RecipesTools()).addRecipes(this); + (new RecipesWeapons()).addRecipes(this); + (new RecipesIngots()).addRecipes(this); + (new RecipesFood()).addRecipes(this); + (new RecipesCrafting()).addRecipes(this); + (new RecipesArmor()).addRecipes(this); + (new RecipesDyes()).addRecipes(this); + this.recipes.add(new RecipesArmorDyes()); + this.recipes.add(new RecipeBookCloning()); + this.recipes.add(new RecipesMapCloning()); + this.recipes.add(new RecipesMapExtending()); + this.recipes.add(new RecipeFireworks()); + this.recipes.add(new RecipeRepairItem()); + (new RecipesBanners()).addRecipes(this); + this.addRecipe(new ItemStack(Items.paper, 3), new Object[] {"###", '#', Items.reeds}); + this.addShapelessRecipe(new ItemStack(Items.book, 1), new Object[] {Items.paper, Items.paper, Items.paper, Items.leather}); + this.addShapelessRecipe(new ItemStack(Items.writable_book, 1), new Object[] {Items.book, new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), Items.feather}); + this.addRecipe(new ItemStack(Blocks.oak_fence, 3), new Object[] {"W#W", "W#W", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.birch_fence, 3), new Object[] {"W#W", "W#W", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.spruce_fence, 3), new Object[] {"W#W", "W#W", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.jungle_fence, 3), new Object[] {"W#W", "W#W", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.acacia_fence, 3), new Object[] {"W#W", "W#W", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.dark_oak_fence, 3), new Object[] {"W#W", "W#W", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, BlockWall.EnumType.NORMAL.getMetadata()), new Object[] {"###", "###", '#', Blocks.cobblestone}); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, BlockWall.EnumType.MOSSY.getMetadata()), new Object[] {"###", "###", '#', Blocks.mossy_cobblestone}); + this.addRecipe(new ItemStack(Blocks.nether_brick_fence, 6), new Object[] {"###", "###", '#', Blocks.nether_brick}); + this.addRecipe(new ItemStack(Blocks.oak_fence_gate, 1), new Object[] {"#W#", "#W#", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.birch_fence_gate, 1), new Object[] {"#W#", "#W#", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.spruce_fence_gate, 1), new Object[] {"#W#", "#W#", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.jungle_fence_gate, 1), new Object[] {"#W#", "#W#", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.acacia_fence_gate, 1), new Object[] {"#W#", "#W#", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.dark_oak_fence_gate, 1), new Object[] {"#W#", "#W#", '#', Items.stick, 'W', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.jukebox, 1), new Object[] {"###", "#X#", "###", '#', Blocks.planks, 'X', Items.diamond}); + this.addRecipe(new ItemStack(Items.lead, 2), new Object[] {"~~ ", "~O ", " ~", '~', Items.string, 'O', Items.slime_ball}); + this.addRecipe(new ItemStack(Blocks.noteblock, 1), new Object[] {"###", "#X#", "###", '#', Blocks.planks, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Blocks.bookshelf, 1), new Object[] {"###", "XXX", "###", '#', Blocks.planks, 'X', Items.book}); + this.addRecipe(new ItemStack(Blocks.snow, 1), new Object[] {"##", "##", '#', Items.snowball}); + this.addRecipe(new ItemStack(Blocks.snow_layer, 6), new Object[] {"###", '#', Blocks.snow}); + this.addRecipe(new ItemStack(Blocks.clay, 1), new Object[] {"##", "##", '#', Items.clay_ball}); + this.addRecipe(new ItemStack(Blocks.brick_block, 1), new Object[] {"##", "##", '#', Items.brick}); + this.addRecipe(new ItemStack(Blocks.glowstone, 1), new Object[] {"##", "##", '#', Items.glowstone_dust}); + this.addRecipe(new ItemStack(Blocks.quartz_block, 1), new Object[] {"##", "##", '#', Items.quartz}); + this.addRecipe(new ItemStack(Blocks.wool, 1), new Object[] {"##", "##", '#', Items.string}); + this.addRecipe(new ItemStack(Blocks.tnt, 1), new Object[] {"X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Blocks.sand}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.COBBLESTONE.getMetadata()), new Object[] {"###", '#', Blocks.cobblestone}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.STONE.getMetadata()), new Object[] {"###", '#', new ItemStack(Blocks.stone, BlockStone.EnumType.STONE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.SAND.getMetadata()), new Object[] {"###", '#', Blocks.sandstone}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.BRICK.getMetadata()), new Object[] {"###", '#', Blocks.brick_block}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), new Object[] {"###", '#', Blocks.stonebrick}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.NETHERBRICK.getMetadata()), new Object[] {"###", '#', Blocks.nether_brick}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, BlockStoneSlab.EnumType.QUARTZ.getMetadata()), new Object[] {"###", '#', Blocks.quartz_block}); + this.addRecipe(new ItemStack(Blocks.stone_slab2, 6, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata()), new Object[] {"###", '#', Blocks.red_sandstone}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 0), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, BlockPlanks.EnumType.BIRCH.getMetadata()), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, BlockPlanks.EnumType.SPRUCE.getMetadata()), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, BlockPlanks.EnumType.JUNGLE.getMetadata()), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.ladder, 3), new Object[] {"# #", "###", "# #", '#', Items.stick}); + this.addRecipe(new ItemStack(Items.oak_door, 3), new Object[] {"##", "##", "##", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata())}); + this.addRecipe(new ItemStack(Items.spruce_door, 3), new Object[] {"##", "##", "##", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())}); + this.addRecipe(new ItemStack(Items.birch_door, 3), new Object[] {"##", "##", "##", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata())}); + this.addRecipe(new ItemStack(Items.jungle_door, 3), new Object[] {"##", "##", "##", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())}); + this.addRecipe(new ItemStack(Items.acacia_door, 3), new Object[] {"##", "##", "##", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.ACACIA.getMetadata())}); + this.addRecipe(new ItemStack(Items.dark_oak_door, 3), new Object[] {"##", "##", "##", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.trapdoor, 2), new Object[] {"###", "###", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Items.iron_door, 3), new Object[] {"##", "##", "##", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Blocks.iron_trapdoor, 1), new Object[] {"##", "##", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.sign, 3), new Object[] {"###", "###", " X ", '#', Blocks.planks, 'X', Items.stick}); + this.addRecipe(new ItemStack(Items.cake, 1), new Object[] {"AAA", "BEB", "CCC", 'A', Items.milk_bucket, 'B', Items.sugar, 'C', Items.wheat, 'E', Items.egg}); + this.addRecipe(new ItemStack(Items.sugar, 1), new Object[] {"#", '#', Items.reeds}); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.OAK.getMetadata()), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.OAK.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.SPRUCE.getMetadata()), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.BIRCH.getMetadata()), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.BIRCH.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.planks, 4, BlockPlanks.EnumType.JUNGLE.getMetadata()), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4), new Object[] {"#", '#', new ItemStack(Blocks.log2, 1, BlockPlanks.EnumType.ACACIA.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4), new Object[] {"#", '#', new ItemStack(Blocks.log2, 1, BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Items.stick, 4), new Object[] {"#", "#", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.torch, 4), new Object[] {"X", "#", 'X', Items.coal, '#', Items.stick}); + this.addRecipe(new ItemStack(Blocks.torch, 4), new Object[] {"X", "#", 'X', new ItemStack(Items.coal, 1, 1), '#', Items.stick}); + this.addRecipe(new ItemStack(Items.bowl, 4), new Object[] {"# #", " # ", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Items.glass_bottle, 3), new Object[] {"# #", " # ", '#', Blocks.glass}); + this.addRecipe(new ItemStack(Blocks.rail, 16), new Object[] {"X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick}); + this.addRecipe(new ItemStack(Blocks.golden_rail, 6), new Object[] {"X X", "X#X", "XRX", 'X', Items.gold_ingot, 'R', Items.redstone, '#', Items.stick}); + this.addRecipe(new ItemStack(Blocks.activator_rail, 6), new Object[] {"XSX", "X#X", "XSX", 'X', Items.iron_ingot, '#', Blocks.redstone_torch, 'S', Items.stick}); + this.addRecipe(new ItemStack(Blocks.detector_rail, 6), new Object[] {"X X", "X#X", "XRX", 'X', Items.iron_ingot, 'R', Items.redstone, '#', Blocks.stone_pressure_plate}); + this.addRecipe(new ItemStack(Items.minecart, 1), new Object[] {"# #", "###", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.brewing_stand, 1), new Object[] {" B ", "###", '#', Blocks.cobblestone, 'B', Items.blaze_rod}); + this.addRecipe(new ItemStack(Blocks.lit_pumpkin, 1), new Object[] {"A", "B", 'A', Blocks.pumpkin, 'B', Blocks.torch}); + this.addRecipe(new ItemStack(Items.chest_minecart, 1), new Object[] {"A", "B", 'A', Blocks.chest, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.furnace_minecart, 1), new Object[] {"A", "B", 'A', Blocks.furnace, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.tnt_minecart, 1), new Object[] {"A", "B", 'A', Blocks.tnt, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.hopper_minecart, 1), new Object[] {"A", "B", 'A', Blocks.hopper, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.boat, 1), new Object[] {"# #", "###", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Items.bucket, 1), new Object[] {"# #", " # ", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.flower_pot, 1), new Object[] {"# #", " # ", '#', Items.brick}); + this.addShapelessRecipe(new ItemStack(Items.flint_and_steel, 1), new Object[] {new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1)}); + this.addRecipe(new ItemStack(Items.bread, 1), new Object[] {"###", '#', Items.wheat}); + this.addRecipe(new ItemStack(Blocks.oak_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.OAK.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.birch_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.BIRCH.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.spruce_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.SPRUCE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.jungle_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, BlockPlanks.EnumType.JUNGLE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.acacia_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.ACACIA.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Blocks.dark_oak_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 4 + BlockPlanks.EnumType.DARK_OAK.getMetadata() - 4)}); + this.addRecipe(new ItemStack(Items.fishing_rod, 1), new Object[] {" #", " #X", "# X", '#', Items.stick, 'X', Items.string}); + this.addRecipe(new ItemStack(Items.carrot_on_a_stick, 1), new Object[] {"# ", " X", '#', Items.fishing_rod, 'X', Items.carrot}); + this.addRecipe(new ItemStack(Blocks.stone_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.cobblestone}); + this.addRecipe(new ItemStack(Blocks.brick_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.brick_block}); + this.addRecipe(new ItemStack(Blocks.stone_brick_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.stonebrick}); + this.addRecipe(new ItemStack(Blocks.nether_brick_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.nether_brick}); + this.addRecipe(new ItemStack(Blocks.sandstone_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.sandstone}); + this.addRecipe(new ItemStack(Blocks.red_sandstone_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.red_sandstone}); + this.addRecipe(new ItemStack(Blocks.quartz_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.quartz_block}); + this.addRecipe(new ItemStack(Items.painting, 1), new Object[] {"###", "#X#", "###", '#', Items.stick, 'X', Blocks.wool}); + this.addRecipe(new ItemStack(Items.item_frame, 1), new Object[] {"###", "#X#", "###", '#', Items.stick, 'X', Items.leather}); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 0), new Object[] {"###", "#X#", "###", '#', Items.gold_ingot, 'X', Items.apple}); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 1), new Object[] {"###", "#X#", "###", '#', Blocks.gold_block, 'X', Items.apple}); + this.addRecipe(new ItemStack(Items.golden_carrot, 1, 0), new Object[] {"###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot}); + this.addRecipe(new ItemStack(Items.speckled_melon, 1), new Object[] {"###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.melon}); + this.addRecipe(new ItemStack(Blocks.lever, 1), new Object[] {"X", "#", '#', Blocks.cobblestone, 'X', Items.stick}); + this.addRecipe(new ItemStack(Blocks.tripwire_hook, 2), new Object[] {"I", "S", "#", '#', Blocks.planks, 'S', Items.stick, 'I', Items.iron_ingot}); + this.addRecipe(new ItemStack(Blocks.redstone_torch, 1), new Object[] {"X", "#", '#', Items.stick, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Items.repeater, 1), new Object[] {"#X#", "III", '#', Blocks.redstone_torch, 'X', Items.redstone, 'I', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())}); + this.addRecipe(new ItemStack(Items.comparator, 1), new Object[] {" # ", "#X#", "III", '#', Blocks.redstone_torch, 'X', Items.quartz, 'I', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())}); + this.addRecipe(new ItemStack(Items.clock, 1), new Object[] {" # ", "#X#", " # ", '#', Items.gold_ingot, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Items.compass, 1), new Object[] {" # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Items.map, 1), new Object[] {"###", "#X#", "###", '#', Items.paper, 'X', Items.compass}); + this.addRecipe(new ItemStack(Blocks.stone_button, 1), new Object[] {"#", '#', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.wooden_button, 1), new Object[] {"#", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.stone_pressure_plate, 1), new Object[] {"##", '#', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())}); + this.addRecipe(new ItemStack(Blocks.wooden_pressure_plate, 1), new Object[] {"##", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.heavy_weighted_pressure_plate, 1), new Object[] {"##", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Blocks.light_weighted_pressure_plate, 1), new Object[] {"##", '#', Items.gold_ingot}); + this.addRecipe(new ItemStack(Blocks.dispenser, 1), new Object[] {"###", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.bow, 'R', Items.redstone}); + this.addRecipe(new ItemStack(Blocks.dropper, 1), new Object[] {"###", "# #", "#R#", '#', Blocks.cobblestone, 'R', Items.redstone}); + this.addRecipe(new ItemStack(Blocks.piston, 1), new Object[] {"TTT", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.iron_ingot, 'R', Items.redstone, 'T', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.sticky_piston, 1), new Object[] {"S", "P", 'S', Items.slime_ball, 'P', Blocks.piston}); + this.addRecipe(new ItemStack(Items.bed, 1), new Object[] {"###", "XXX", '#', Blocks.wool, 'X', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.enchanting_table, 1), new Object[] {" B ", "D#D", "###", '#', Blocks.obsidian, 'B', Items.book, 'D', Items.diamond}); + this.addRecipe(new ItemStack(Blocks.anvil, 1), new Object[] {"III", " i ", "iii", 'I', Blocks.iron_block, 'i', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.leather), new Object[] {"##", "##", '#', Items.rabbit_hide}); + this.addShapelessRecipe(new ItemStack(Items.ender_eye, 1), new Object[] {Items.ender_pearl, Items.blaze_powder}); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), new Object[] {Items.gunpowder, Items.blaze_powder, Items.coal}); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), new Object[] {Items.gunpowder, Items.blaze_powder, new ItemStack(Items.coal, 1, 1)}); + this.addRecipe(new ItemStack(Blocks.daylight_detector), new Object[] {"GGG", "QQQ", "WWW", 'G', Blocks.glass, 'Q', Items.quartz, 'W', Blocks.wooden_slab}); + this.addRecipe(new ItemStack(Blocks.hopper), new Object[] {"I I", "ICI", " I ", 'I', Items.iron_ingot, 'C', Blocks.chest}); + this.addRecipe(new ItemStack(Items.armor_stand, 1), new Object[] {"///", " / ", "/_/", '/', Items.stick, '_', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.STONE.getMetadata())}); + Collections.sort(this.recipes, new Comparator() + { + public int compare(IRecipe p_compare_1_, IRecipe p_compare_2_) + { + return p_compare_1_ instanceof ShapelessRecipes && p_compare_2_ instanceof ShapedRecipes ? 1 : (p_compare_2_ instanceof ShapelessRecipes && p_compare_1_ instanceof ShapedRecipes ? -1 : (p_compare_2_.getRecipeSize() < p_compare_1_.getRecipeSize() ? -1 : (p_compare_2_.getRecipeSize() > p_compare_1_.getRecipeSize() ? 1 : 0))); + } + }); + } + + public ShapedRecipes addRecipe(ItemStack stack, Object... recipeComponents) + { + String s = ""; + int i = 0; + int j = 0; + int k = 0; + + if (recipeComponents[i] instanceof String[]) + { + String[] astring = (String[])((String[])recipeComponents[i++]); + + for (int l = 0; l < astring.length; ++l) + { + String s2 = astring[l]; + ++k; + j = s2.length(); + s = s + s2; + } + } + else + { + while (recipeComponents[i] instanceof String) + { + String s1 = (String)recipeComponents[i++]; + ++k; + j = s1.length(); + s = s + s1; + } + } + + Map map; + + for (map = Maps.newHashMap(); i < recipeComponents.length; i += 2) + { + Character character = (Character)recipeComponents[i]; + ItemStack itemstack = null; + + if (recipeComponents[i + 1] instanceof Item) + { + itemstack = new ItemStack((Item)recipeComponents[i + 1]); + } + else if (recipeComponents[i + 1] instanceof Block) + { + itemstack = new ItemStack((Block)recipeComponents[i + 1], 1, 32767); + } + else if (recipeComponents[i + 1] instanceof ItemStack) + { + itemstack = (ItemStack)recipeComponents[i + 1]; + } + + map.put(character, itemstack); + } + + ItemStack[] aitemstack = new ItemStack[j * k]; + + for (int i1 = 0; i1 < j * k; ++i1) + { + char c0 = s.charAt(i1); + + if (map.containsKey(Character.valueOf(c0))) + { + aitemstack[i1] = ((ItemStack)map.get(Character.valueOf(c0))).copy(); + } + else + { + aitemstack[i1] = null; + } + } + + ShapedRecipes shapedrecipes = new ShapedRecipes(j, k, aitemstack, stack); + this.recipes.add(shapedrecipes); + return shapedrecipes; + } + + public void addShapelessRecipe(ItemStack stack, Object... recipeComponents) + { + List list = Lists.newArrayList(); + + for (Object object : recipeComponents) + { + if (object instanceof ItemStack) + { + list.add(((ItemStack)object).copy()); + } + else if (object instanceof Item) + { + list.add(new ItemStack((Item)object)); + } + else + { + if (!(object instanceof Block)) + { + throw new IllegalArgumentException("Invalid shapeless recipe: unknown type " + object.getClass().getName() + "!"); + } + + list.add(new ItemStack((Block)object)); + } + } + + this.recipes.add(new ShapelessRecipes(stack, list)); + } + + public void addRecipe(IRecipe recipe) + { + this.recipes.add(recipe); + } + + public ItemStack findMatchingRecipe(InventoryCrafting p_82787_1_, World worldIn) + { + for (IRecipe irecipe : this.recipes) + { + if (irecipe.matches(p_82787_1_, worldIn)) + { + return irecipe.getCraftingResult(p_82787_1_); + } + } + + return null; + } + + public ItemStack[] func_180303_b(InventoryCrafting p_180303_1_, World worldIn) + { + for (IRecipe irecipe : this.recipes) + { + if (irecipe.matches(p_180303_1_, worldIn)) + { + return irecipe.getRemainingItems(p_180303_1_); + } + } + + ItemStack[] aitemstack = new ItemStack[p_180303_1_.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + aitemstack[i] = p_180303_1_.getStackInSlot(i); + } + + return aitemstack; + } + + public List getRecipeList() + { + return this.recipes; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java new file mode 100644 index 0000000..0dc16a8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java @@ -0,0 +1,114 @@ +package net.minecraft.item.crafting; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFishFood; +import net.minecraft.item.ItemStack; + +public class FurnaceRecipes +{ + private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); + private Map smeltingList = Maps.newHashMap(); + private Map experienceList = Maps.newHashMap(); + + public static FurnaceRecipes instance() + { + return smeltingBase; + } + + private FurnaceRecipes() + { + this.addSmeltingRecipeForBlock(Blocks.iron_ore, new ItemStack(Items.iron_ingot), 0.7F); + this.addSmeltingRecipeForBlock(Blocks.gold_ore, new ItemStack(Items.gold_ingot), 1.0F); + this.addSmeltingRecipeForBlock(Blocks.diamond_ore, new ItemStack(Items.diamond), 1.0F); + this.addSmeltingRecipeForBlock(Blocks.sand, new ItemStack(Blocks.glass), 0.1F); + this.addSmelting(Items.porkchop, new ItemStack(Items.cooked_porkchop), 0.35F); + this.addSmelting(Items.beef, new ItemStack(Items.cooked_beef), 0.35F); + this.addSmelting(Items.chicken, new ItemStack(Items.cooked_chicken), 0.35F); + this.addSmelting(Items.rabbit, new ItemStack(Items.cooked_rabbit), 0.35F); + this.addSmelting(Items.mutton, new ItemStack(Items.cooked_mutton), 0.35F); + this.addSmeltingRecipeForBlock(Blocks.cobblestone, new ItemStack(Blocks.stone), 0.1F); + this.addSmeltingRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.DEFAULT_META), new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CRACKED_META), 0.1F); + this.addSmelting(Items.clay_ball, new ItemStack(Items.brick), 0.3F); + this.addSmeltingRecipeForBlock(Blocks.clay, new ItemStack(Blocks.hardened_clay), 0.35F); + this.addSmeltingRecipeForBlock(Blocks.cactus, new ItemStack(Items.dye, 1, EnumDyeColor.GREEN.getDyeDamage()), 0.2F); + this.addSmeltingRecipeForBlock(Blocks.log, new ItemStack(Items.coal, 1, 1), 0.15F); + this.addSmeltingRecipeForBlock(Blocks.log2, new ItemStack(Items.coal, 1, 1), 0.15F); + this.addSmeltingRecipeForBlock(Blocks.emerald_ore, new ItemStack(Items.emerald), 1.0F); + this.addSmelting(Items.potato, new ItemStack(Items.baked_potato), 0.35F); + this.addSmeltingRecipeForBlock(Blocks.netherrack, new ItemStack(Items.netherbrick), 0.1F); + this.addSmeltingRecipe(new ItemStack(Blocks.sponge, 1, 1), new ItemStack(Blocks.sponge, 1, 0), 0.15F); + + for (ItemFishFood.FishType itemfishfood$fishtype : ItemFishFood.FishType.values()) + { + if (itemfishfood$fishtype.canCook()) + { + this.addSmeltingRecipe(new ItemStack(Items.fish, 1, itemfishfood$fishtype.getMetadata()), new ItemStack(Items.cooked_fish, 1, itemfishfood$fishtype.getMetadata()), 0.35F); + } + } + + this.addSmeltingRecipeForBlock(Blocks.coal_ore, new ItemStack(Items.coal), 0.1F); + this.addSmeltingRecipeForBlock(Blocks.redstone_ore, new ItemStack(Items.redstone), 0.7F); + this.addSmeltingRecipeForBlock(Blocks.lapis_ore, new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), 0.2F); + this.addSmeltingRecipeForBlock(Blocks.quartz_ore, new ItemStack(Items.quartz), 0.2F); + } + + public void addSmeltingRecipeForBlock(Block input, ItemStack stack, float experience) + { + this.addSmelting(Item.getItemFromBlock(input), stack, experience); + } + + public void addSmelting(Item input, ItemStack stack, float experience) + { + this.addSmeltingRecipe(new ItemStack(input, 1, 32767), stack, experience); + } + + public void addSmeltingRecipe(ItemStack input, ItemStack stack, float experience) + { + this.smeltingList.put(input, stack); + this.experienceList.put(stack, Float.valueOf(experience)); + } + + public ItemStack getSmeltingResult(ItemStack stack) + { + for (Entry entry : this.smeltingList.entrySet()) + { + if (this.compareItemStacks(stack, (ItemStack)entry.getKey())) + { + return (ItemStack)entry.getValue(); + } + } + + return null; + } + + private boolean compareItemStacks(ItemStack stack1, ItemStack stack2) + { + return stack2.getItem() == stack1.getItem() && (stack2.getMetadata() == 32767 || stack2.getMetadata() == stack1.getMetadata()); + } + + public Map getSmeltingList() + { + return this.smeltingList; + } + + public float getSmeltingExperience(ItemStack stack) + { + for (Entry entry : this.experienceList.entrySet()) + { + if (this.compareItemStacks(stack, (ItemStack)entry.getKey())) + { + return ((Float)entry.getValue()).floatValue(); + } + } + + return 0.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/IRecipe.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/IRecipe.java new file mode 100644 index 0000000..80c69e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/IRecipe.java @@ -0,0 +1,18 @@ +package net.minecraft.item.crafting; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IRecipe +{ + boolean matches(InventoryCrafting inv, World worldIn); + + ItemStack getCraftingResult(InventoryCrafting inv); + + int getRecipeSize(); + + ItemStack getRecipeOutput(); + + ItemStack[] getRemainingItems(InventoryCrafting inv); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java new file mode 100644 index 0000000..ecc87e5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java @@ -0,0 +1,125 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemEditableBook; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class RecipeBookCloning implements IRecipe +{ + public boolean matches(InventoryCrafting inv, World worldIn) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inv.getSizeInventory(); ++j) + { + ItemStack itemstack1 = inv.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.written_book) + { + if (itemstack != null) + { + return false; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.writable_book) + { + return false; + } + + ++i; + } + } + } + + return itemstack != null && i > 0; + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inv.getSizeInventory(); ++j) + { + ItemStack itemstack1 = inv.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.written_book) + { + if (itemstack != null) + { + return null; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.writable_book) + { + return null; + } + + ++i; + } + } + } + + if (itemstack != null && i >= 1 && ItemEditableBook.getGeneration(itemstack) < 2) + { + ItemStack itemstack2 = new ItemStack(Items.written_book, i); + itemstack2.setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + itemstack2.getTagCompound().setInteger("generation", ItemEditableBook.getGeneration(itemstack) + 1); + + if (itemstack.hasDisplayName()) + { + itemstack2.setStackDisplayName(itemstack.getDisplayName()); + } + + return itemstack2; + } + else + { + return null; + } + } + + public int getRecipeSize() + { + return 9; + } + + public ItemStack getRecipeOutput() + { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem() instanceof ItemEditableBook) + { + aitemstack[i] = itemstack; + break; + } + } + + return aitemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java new file mode 100644 index 0000000..20cf75e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java @@ -0,0 +1,261 @@ +package net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public class RecipeFireworks implements IRecipe +{ + private ItemStack field_92102_a; + + public boolean matches(InventoryCrafting inv, World worldIn) + { + this.field_92102_a = null; + int i = 0; + int j = 0; + int k = 0; + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = 0; k1 < inv.getSizeInventory(); ++k1) + { + ItemStack itemstack = inv.getStackInSlot(k1); + + if (itemstack != null) + { + if (itemstack.getItem() == Items.gunpowder) + { + ++j; + } + else if (itemstack.getItem() == Items.firework_charge) + { + ++l; + } + else if (itemstack.getItem() == Items.dye) + { + ++k; + } + else if (itemstack.getItem() == Items.paper) + { + ++i; + } + else if (itemstack.getItem() == Items.glowstone_dust) + { + ++i1; + } + else if (itemstack.getItem() == Items.diamond) + { + ++i1; + } + else if (itemstack.getItem() == Items.fire_charge) + { + ++j1; + } + else if (itemstack.getItem() == Items.feather) + { + ++j1; + } + else if (itemstack.getItem() == Items.gold_nugget) + { + ++j1; + } + else + { + if (itemstack.getItem() != Items.skull) + { + return false; + } + + ++j1; + } + } + } + + i1 = i1 + k + j1; + + if (j <= 3 && i <= 1) + { + if (j >= 1 && i == 1 && i1 == 0) + { + this.field_92102_a = new ItemStack(Items.fireworks); + + if (l > 0) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + + for (int k2 = 0; k2 < inv.getSizeInventory(); ++k2) + { + ItemStack itemstack3 = inv.getStackInSlot(k2); + + if (itemstack3 != null && itemstack3.getItem() == Items.firework_charge && itemstack3.hasTagCompound() && itemstack3.getTagCompound().hasKey("Explosion", 10)) + { + nbttaglist.appendTag(itemstack3.getTagCompound().getCompoundTag("Explosion")); + } + } + + nbttagcompound3.setTag("Explosions", nbttaglist); + nbttagcompound3.setByte("Flight", (byte)j); + nbttagcompound1.setTag("Fireworks", nbttagcompound3); + this.field_92102_a.setTagCompound(nbttagcompound1); + } + + return true; + } + else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1) + { + this.field_92102_a = new ItemStack(Items.firework_charge); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + byte b0 = 0; + List list = Lists.newArrayList(); + + for (int l1 = 0; l1 < inv.getSizeInventory(); ++l1) + { + ItemStack itemstack2 = inv.getStackInSlot(l1); + + if (itemstack2 != null) + { + if (itemstack2.getItem() == Items.dye) + { + list.add(Integer.valueOf(ItemDye.dyeColors[itemstack2.getMetadata() & 15])); + } + else if (itemstack2.getItem() == Items.glowstone_dust) + { + nbttagcompound2.setBoolean("Flicker", true); + } + else if (itemstack2.getItem() == Items.diamond) + { + nbttagcompound2.setBoolean("Trail", true); + } + else if (itemstack2.getItem() == Items.fire_charge) + { + b0 = 1; + } + else if (itemstack2.getItem() == Items.feather) + { + b0 = 4; + } + else if (itemstack2.getItem() == Items.gold_nugget) + { + b0 = 2; + } + else if (itemstack2.getItem() == Items.skull) + { + b0 = 3; + } + } + } + + int[] aint1 = new int[list.size()]; + + for (int l2 = 0; l2 < aint1.length; ++l2) + { + aint1[l2] = ((Integer)list.get(l2)).intValue(); + } + + nbttagcompound2.setIntArray("Colors", aint1); + nbttagcompound2.setByte("Type", b0); + nbttagcompound.setTag("Explosion", nbttagcompound2); + this.field_92102_a.setTagCompound(nbttagcompound); + return true; + } + else if (j == 0 && i == 0 && l == 1 && k > 0 && k == i1) + { + List list1 = Lists.newArrayList(); + + for (int i2 = 0; i2 < inv.getSizeInventory(); ++i2) + { + ItemStack itemstack1 = inv.getStackInSlot(i2); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.dye) + { + list1.add(Integer.valueOf(ItemDye.dyeColors[itemstack1.getMetadata() & 15])); + } + else if (itemstack1.getItem() == Items.firework_charge) + { + this.field_92102_a = itemstack1.copy(); + this.field_92102_a.stackSize = 1; + } + } + } + + int[] aint = new int[list1.size()]; + + for (int j2 = 0; j2 < aint.length; ++j2) + { + aint[j2] = ((Integer)list1.get(j2)).intValue(); + } + + if (this.field_92102_a != null && this.field_92102_a.hasTagCompound()) + { + NBTTagCompound nbttagcompound4 = this.field_92102_a.getTagCompound().getCompoundTag("Explosion"); + + if (nbttagcompound4 == null) + { + return false; + } + else + { + nbttagcompound4.setIntArray("FadeColors", aint); + return true; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + return this.field_92102_a.copy(); + } + + public int getRecipeSize() + { + return 10; + } + + public ItemStack getRecipeOutput() + { + return this.field_92102_a; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeRepairItem.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeRepairItem.java new file mode 100644 index 0000000..e5617b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipeRepairItem.java @@ -0,0 +1,114 @@ +package net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RecipeRepairItem implements IRecipe +{ + public boolean matches(InventoryCrafting inv, World worldIn) + { + List list = Lists.newArrayList(); + + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null) + { + list.add(itemstack); + + if (list.size() > 1) + { + ItemStack itemstack1 = (ItemStack)list.get(0); + + if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable()) + { + return false; + } + } + } + } + + return list.size() == 2; + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + List list = Lists.newArrayList(); + + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null) + { + list.add(itemstack); + + if (list.size() > 1) + { + ItemStack itemstack1 = (ItemStack)list.get(0); + + if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable()) + { + return null; + } + } + } + } + + if (list.size() == 2) + { + ItemStack itemstack2 = (ItemStack)list.get(0); + ItemStack itemstack3 = (ItemStack)list.get(1); + + if (itemstack2.getItem() == itemstack3.getItem() && itemstack2.stackSize == 1 && itemstack3.stackSize == 1 && itemstack2.getItem().isDamageable()) + { + Item item = itemstack2.getItem(); + int j = item.getMaxDamage() - itemstack2.getItemDamage(); + int k = item.getMaxDamage() - itemstack3.getItemDamage(); + int l = j + k + item.getMaxDamage() * 5 / 100; + int i1 = item.getMaxDamage() - l; + + if (i1 < 0) + { + i1 = 0; + } + + return new ItemStack(itemstack2.getItem(), 1, i1); + } + } + + return null; + } + + public int getRecipeSize() + { + return 4; + } + + public ItemStack getRecipeOutput() + { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesArmor.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesArmor.java new file mode 100644 index 0000000..48906bb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesArmor.java @@ -0,0 +1,25 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesArmor +{ + private String[][] recipePatterns = new String[][] {{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}}; + private Item[][] recipeItems = new Item[][] {{Items.leather, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.leather_helmet, Items.iron_helmet, Items.diamond_helmet, Items.golden_helmet}, {Items.leather_chestplate, Items.iron_chestplate, Items.diamond_chestplate, Items.golden_chestplate}, {Items.leather_leggings, Items.iron_leggings, Items.diamond_leggings, Items.golden_leggings}, {Items.leather_boots, Items.iron_boots, Items.diamond_boots, Items.golden_boots}}; + + public void addRecipes(CraftingManager craftManager) + { + for (int i = 0; i < this.recipeItems[0].length; ++i) + { + Item item = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) + { + Item item1 = this.recipeItems[j + 1][i]; + craftManager.addRecipe(new ItemStack(item1), new Object[] {this.recipePatterns[j], 'X', item}); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java new file mode 100644 index 0000000..a2f1867 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java @@ -0,0 +1,158 @@ +package net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RecipesArmorDyes implements IRecipe +{ + public boolean matches(InventoryCrafting inv, World worldIn) + { + ItemStack itemstack = null; + List list = Lists.newArrayList(); + + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack1 = inv.getStackInSlot(i); + + if (itemstack1 != null) + { + if (itemstack1.getItem() instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)itemstack1.getItem(); + + if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || itemstack != null) + { + return false; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.dye) + { + return false; + } + + list.add(itemstack1); + } + } + } + + return itemstack != null && !list.isEmpty(); + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + ItemStack itemstack = null; + int[] aint = new int[3]; + int i = 0; + int j = 0; + ItemArmor itemarmor = null; + + for (int k = 0; k < inv.getSizeInventory(); ++k) + { + ItemStack itemstack1 = inv.getStackInSlot(k); + + if (itemstack1 != null) + { + if (itemstack1.getItem() instanceof ItemArmor) + { + itemarmor = (ItemArmor)itemstack1.getItem(); + + if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.LEATHER || itemstack != null) + { + return null; + } + + itemstack = itemstack1.copy(); + itemstack.stackSize = 1; + + if (itemarmor.hasColor(itemstack1)) + { + int l = itemarmor.getColor(itemstack); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + i = (int)((float)i + Math.max(f, Math.max(f1, f2)) * 255.0F); + aint[0] = (int)((float)aint[0] + f * 255.0F); + aint[1] = (int)((float)aint[1] + f1 * 255.0F); + aint[2] = (int)((float)aint[2] + f2 * 255.0F); + ++j; + } + } + else + { + if (itemstack1.getItem() != Items.dye) + { + return null; + } + + float[] afloat = EntitySheep.getDyeRgb(EnumDyeColor.byDyeDamage(itemstack1.getMetadata())); + int l1 = (int)(afloat[0] * 255.0F); + int i2 = (int)(afloat[1] * 255.0F); + int j2 = (int)(afloat[2] * 255.0F); + i += Math.max(l1, Math.max(i2, j2)); + aint[0] += l1; + aint[1] += i2; + aint[2] += j2; + ++j; + } + } + } + + if (itemarmor == null) + { + return null; + } + else + { + int i1 = aint[0] / j; + int j1 = aint[1] / j; + int k1 = aint[2] / j; + float f3 = (float)i / (float)j; + float f4 = (float)Math.max(i1, Math.max(j1, k1)); + i1 = (int)((float)i1 * f3 / f4); + j1 = (int)((float)j1 * f3 / f4); + k1 = (int)((float)k1 * f3 / f4); + int lvt_12_3_ = (i1 << 8) + j1; + lvt_12_3_ = (lvt_12_3_ << 8) + k1; + itemarmor.setColor(itemstack, lvt_12_3_); + return itemstack; + } + } + + public int getRecipeSize() + { + return 10; + } + + public ItemStack getRecipeOutput() + { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesBanners.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesBanners.java new file mode 100644 index 0000000..fecff03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesBanners.java @@ -0,0 +1,374 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntityBanner; +import net.minecraft.world.World; + +public class RecipesBanners +{ + void addRecipes(CraftingManager p_179534_1_) + { + for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) + { + p_179534_1_.addRecipe(new ItemStack(Items.banner, 1, enumdyecolor.getDyeDamage()), new Object[] {"###", "###", " | ", '#', new ItemStack(Blocks.wool, 1, enumdyecolor.getMetadata()), '|', Items.stick}); + } + + p_179534_1_.addRecipe(new RecipesBanners.RecipeDuplicatePattern()); + p_179534_1_.addRecipe(new RecipesBanners.RecipeAddPattern()); + } + + static class RecipeAddPattern implements IRecipe + { + private RecipeAddPattern() + { + } + + public boolean matches(InventoryCrafting inv, World worldIn) + { + boolean flag = false; + + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem() == Items.banner) + { + if (flag) + { + return false; + } + + if (TileEntityBanner.getPatterns(itemstack) >= 6) + { + return false; + } + + flag = true; + } + } + + if (!flag) + { + return false; + } + else + { + return this.func_179533_c(inv) != null; + } + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + ItemStack itemstack = null; + + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack1 = inv.getStackInSlot(i); + + if (itemstack1 != null && itemstack1.getItem() == Items.banner) + { + itemstack = itemstack1.copy(); + itemstack.stackSize = 1; + break; + } + } + + TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = this.func_179533_c(inv); + + if (tileentitybanner$enumbannerpattern != null) + { + int k = 0; + + for (int j = 0; j < inv.getSizeInventory(); ++j) + { + ItemStack itemstack2 = inv.getStackInSlot(j); + + if (itemstack2 != null && itemstack2.getItem() == Items.dye) + { + k = itemstack2.getMetadata(); + break; + } + } + + NBTTagCompound nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true); + NBTTagList nbttaglist = null; + + if (nbttagcompound1.hasKey("Patterns", 9)) + { + nbttaglist = nbttagcompound1.getTagList("Patterns", 10); + } + else + { + nbttaglist = new NBTTagList(); + nbttagcompound1.setTag("Patterns", nbttaglist); + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Pattern", tileentitybanner$enumbannerpattern.getPatternID()); + nbttagcompound.setInteger("Color", k); + nbttaglist.appendTag(nbttagcompound); + } + + return itemstack; + } + + public int getRecipeSize() + { + return 10; + } + + public ItemStack getRecipeOutput() + { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } + + private TileEntityBanner.EnumBannerPattern func_179533_c(InventoryCrafting p_179533_1_) + { + for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : TileEntityBanner.EnumBannerPattern.values()) + { + if (tileentitybanner$enumbannerpattern.hasValidCrafting()) + { + boolean flag = true; + + if (tileentitybanner$enumbannerpattern.hasCraftingStack()) + { + boolean flag1 = false; + boolean flag2 = false; + + for (int i = 0; i < p_179533_1_.getSizeInventory() && flag; ++i) + { + ItemStack itemstack = p_179533_1_.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem() != Items.banner) + { + if (itemstack.getItem() == Items.dye) + { + if (flag2) + { + flag = false; + break; + } + + flag2 = true; + } + else + { + if (flag1 || !itemstack.isItemEqual(tileentitybanner$enumbannerpattern.getCraftingStack())) + { + flag = false; + break; + } + + flag1 = true; + } + } + } + + if (!flag1) + { + flag = false; + } + } + else if (p_179533_1_.getSizeInventory() == tileentitybanner$enumbannerpattern.getCraftingLayers().length * tileentitybanner$enumbannerpattern.getCraftingLayers()[0].length()) + { + int j = -1; + + for (int k = 0; k < p_179533_1_.getSizeInventory() && flag; ++k) + { + int l = k / 3; + int i1 = k % 3; + ItemStack itemstack1 = p_179533_1_.getStackInSlot(k); + + if (itemstack1 != null && itemstack1.getItem() != Items.banner) + { + if (itemstack1.getItem() != Items.dye) + { + flag = false; + break; + } + + if (j != -1 && j != itemstack1.getMetadata()) + { + flag = false; + break; + } + + if (tileentitybanner$enumbannerpattern.getCraftingLayers()[l].charAt(i1) == 32) + { + flag = false; + break; + } + + j = itemstack1.getMetadata(); + } + else if (tileentitybanner$enumbannerpattern.getCraftingLayers()[l].charAt(i1) != 32) + { + flag = false; + break; + } + } + } + else + { + flag = false; + } + + if (flag) + { + return tileentitybanner$enumbannerpattern; + } + } + } + + return null; + } + } + + static class RecipeDuplicatePattern implements IRecipe + { + private RecipeDuplicatePattern() + { + } + + public boolean matches(InventoryCrafting inv, World worldIn) + { + ItemStack itemstack = null; + ItemStack itemstack1 = null; + + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack2 = inv.getStackInSlot(i); + + if (itemstack2 != null) + { + if (itemstack2.getItem() != Items.banner) + { + return false; + } + + if (itemstack != null && itemstack1 != null) + { + return false; + } + + int j = TileEntityBanner.getBaseColor(itemstack2); + boolean flag = TileEntityBanner.getPatterns(itemstack2) > 0; + + if (itemstack != null) + { + if (flag) + { + return false; + } + + if (j != TileEntityBanner.getBaseColor(itemstack)) + { + return false; + } + + itemstack1 = itemstack2; + } + else if (itemstack1 != null) + { + if (!flag) + { + return false; + } + + if (j != TileEntityBanner.getBaseColor(itemstack1)) + { + return false; + } + + itemstack = itemstack2; + } + else if (flag) + { + itemstack = itemstack2; + } + else + { + itemstack1 = itemstack2; + } + } + } + + return itemstack != null && itemstack1 != null; + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && TileEntityBanner.getPatterns(itemstack) > 0) + { + ItemStack itemstack1 = itemstack.copy(); + itemstack1.stackSize = 1; + return itemstack1; + } + } + + return null; + } + + public int getRecipeSize() + { + return 2; + } + + public ItemStack getRecipeOutput() + { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null) + { + if (itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + else if (itemstack.hasTagCompound() && TileEntityBanner.getPatterns(itemstack) > 0) + { + aitemstack[i] = itemstack.copy(); + aitemstack[i].stackSize = 1; + } + } + } + + return aitemstack; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java new file mode 100644 index 0000000..6931626 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java @@ -0,0 +1,56 @@ +package net.minecraft.item.crafting; + +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockPrismarine; +import net.minecraft.block.BlockQuartz; +import net.minecraft.block.BlockRedSandstone; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockStone; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.block.BlockStoneSlabNew; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; + +public class RecipesCrafting +{ + public void addRecipes(CraftingManager p_77589_1_) + { + p_77589_1_.addRecipe(new ItemStack(Blocks.chest), new Object[] {"###", "# #", "###", '#', Blocks.planks}); + p_77589_1_.addRecipe(new ItemStack(Blocks.trapped_chest), new Object[] {"#-", '#', Blocks.chest, '-', Blocks.tripwire_hook}); + p_77589_1_.addRecipe(new ItemStack(Blocks.ender_chest), new Object[] {"###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.ender_eye}); + p_77589_1_.addRecipe(new ItemStack(Blocks.furnace), new Object[] {"###", "# #", "###", '#', Blocks.cobblestone}); + p_77589_1_.addRecipe(new ItemStack(Blocks.crafting_table), new Object[] {"##", "##", '#', Blocks.planks}); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.SAND.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.RED_SAND.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.DEFAULT.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SAND.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 4), new Object[] {"##", "##", '#', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CHISELED_META), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata())}); + p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.MOSSY_META), new Object[] {Blocks.stonebrick, Blocks.vine}); + p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone, 1), new Object[] {Blocks.cobblestone, Blocks.vine}); + p_77589_1_.addRecipe(new ItemStack(Blocks.iron_bars, 16), new Object[] {"###", "###", '#', Items.iron_ingot}); + p_77589_1_.addRecipe(new ItemStack(Blocks.glass_pane, 16), new Object[] {"###", "###", '#', Blocks.glass}); + p_77589_1_.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone}); + p_77589_1_.addRecipe(new ItemStack(Blocks.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.nether_star, 'O', Blocks.obsidian}); + p_77589_1_.addRecipe(new ItemStack(Blocks.nether_brick, 1), new Object[] {"NN", "NN", 'N', Items.netherbrick}); + p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.DIORITE.getMetadata()), new Object[] {"CQ", "QC", 'C', Blocks.cobblestone, 'Q', Items.quartz}); + p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Items.quartz}); + p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.ANDESITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Blocks.cobblestone}); + p_77589_1_.addRecipe(new ItemStack(Blocks.dirt, 4, BlockDirt.DirtType.COARSE_DIRT.getMetadata()), new Object[] {"DG", "GD", 'D', new ItemStack(Blocks.dirt, 1, BlockDirt.DirtType.DIRT.getMetadata()), 'G', Blocks.gravel}); + p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.DIORITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.GRANITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.ANDESITE.getMetadata())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.ROUGH_META), new Object[] {"SS", "SS", 'S', Items.prismarine_shard}); + p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.BRICKS_META), new Object[] {"SSS", "SSS", "SSS", 'S', Items.prismarine_shard}); + p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.DARK_META), new Object[] {"SSS", "SIS", "SSS", 'S', Items.prismarine_shard, 'I', new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage())}); + p_77589_1_.addRecipe(new ItemStack(Blocks.sea_lantern, 1, 0), new Object[] {"SCS", "CCC", "SCS", 'S', Items.prismarine_shard, 'C', Items.prismarine_crystals}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesDyes.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesDyes.java new file mode 100644 index 0000000..084243d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesDyes.java @@ -0,0 +1,56 @@ +package net.minecraft.item.crafting; + +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesDyes +{ + public void addRecipes(CraftingManager p_77607_1_) + { + for (int i = 0; i < 16; ++i) + { + p_77607_1_.addShapelessRecipe(new ItemStack(Blocks.wool, 1, i), new Object[] {new ItemStack(Items.dye, 1, 15 - i), new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0)}); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_hardened_clay, 8, 15 - i), new Object[] {"###", "#X#", "###", '#', new ItemStack(Blocks.hardened_clay), 'X', new ItemStack(Items.dye, 1, i)}); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_glass, 8, 15 - i), new Object[] {"###", "#X#", "###", '#', new ItemStack(Blocks.glass), 'X', new ItemStack(Items.dye, 1, i)}); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_glass_pane, 16, i), new Object[] {"###", "###", '#', new ItemStack(Blocks.stained_glass, 1, i)}); + } + + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.YELLOW.getDyeDamage()), new Object[] {new ItemStack(Blocks.yellow_flower, 1, BlockFlower.EnumFlowerType.DANDELION.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.POPPY.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, EnumDyeColor.WHITE.getDyeDamage()), new Object[] {Items.bone}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.PINK.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.ORANGE.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.YELLOW.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.LIME.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.GREEN.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.GRAY.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.SILVER.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.GRAY.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, EnumDyeColor.SILVER.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.LIGHT_BLUE.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.CYAN.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.GREEN.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.PURPLE.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.MAGENTA.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.PURPLE.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.PINK.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, EnumDyeColor.MAGENTA.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.PINK.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 4, EnumDyeColor.MAGENTA.getDyeDamage()), new Object[] {new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), new ItemStack(Items.dye, 1, EnumDyeColor.WHITE.getDyeDamage())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.LIGHT_BLUE.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.BLUE_ORCHID.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.MAGENTA.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.ALLIUM.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.SILVER.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.HOUSTONIA.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.RED.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.RED_TULIP.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.ORANGE.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.ORANGE_TULIP.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.SILVER.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.WHITE_TULIP.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.PINK.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.PINK_TULIP.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, EnumDyeColor.SILVER.getDyeDamage()), new Object[] {new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.OXEYE_DAISY.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.YELLOW.getDyeDamage()), new Object[] {new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.SUNFLOWER.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.MAGENTA.getDyeDamage()), new Object[] {new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.SYRINGA.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.RED.getDyeDamage()), new Object[] {new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.ROSE.getMeta())}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, EnumDyeColor.PINK.getDyeDamage()), new Object[] {new ItemStack(Blocks.double_plant, 1, BlockDoublePlant.EnumPlantType.PAEONIA.getMeta())}); + + for (int j = 0; j < 16; ++j) + { + p_77607_1_.addRecipe(new ItemStack(Blocks.carpet, 3, j), new Object[] {"##", '#', new ItemStack(Blocks.wool, 1, j)}); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesFood.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesFood.java new file mode 100644 index 0000000..e8eccd5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesFood.java @@ -0,0 +1,24 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; + +public class RecipesFood +{ + public void addRecipes(CraftingManager p_77608_1_) + { + p_77608_1_.addShapelessRecipe(new ItemStack(Items.mushroom_stew), new Object[] {Blocks.brown_mushroom, Blocks.red_mushroom, Items.bowl}); + p_77608_1_.addRecipe(new ItemStack(Items.cookie, 8), new Object[] {"#X#", 'X', new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage()), '#', Items.wheat}); + p_77608_1_.addRecipe(new ItemStack(Items.rabbit_stew), new Object[] {" R ", "CPM", " B ", 'R', new ItemStack(Items.cooked_rabbit), 'C', Items.carrot, 'P', Items.baked_potato, 'M', Blocks.brown_mushroom, 'B', Items.bowl}); + p_77608_1_.addRecipe(new ItemStack(Items.rabbit_stew), new Object[] {" R ", "CPD", " B ", 'R', new ItemStack(Items.cooked_rabbit), 'C', Items.carrot, 'P', Items.baked_potato, 'D', Blocks.red_mushroom, 'B', Items.bowl}); + p_77608_1_.addRecipe(new ItemStack(Blocks.melon_block), new Object[] {"MMM", "MMM", "MMM", 'M', Items.melon}); + p_77608_1_.addRecipe(new ItemStack(Items.melon_seeds), new Object[] {"M", 'M', Items.melon}); + p_77608_1_.addRecipe(new ItemStack(Items.pumpkin_seeds, 4), new Object[] {"M", 'M', Blocks.pumpkin}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.pumpkin_pie), new Object[] {Blocks.pumpkin, Items.sugar, Items.egg}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.fermented_spider_eye), new Object[] {Items.spider_eye, Blocks.brown_mushroom, Items.sugar}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.blaze_powder, 2), new Object[] {Items.blaze_rod}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.magma_cream), new Object[] {Items.blaze_powder, Items.slime_ball}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesIngots.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesIngots.java new file mode 100644 index 0000000..d379bb7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesIngots.java @@ -0,0 +1,26 @@ +package net.minecraft.item.crafting; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; + +public class RecipesIngots +{ + private Object[][] recipeItems = new Object[][] {{Blocks.gold_block, new ItemStack(Items.gold_ingot, 9)}, {Blocks.iron_block, new ItemStack(Items.iron_ingot, 9)}, {Blocks.diamond_block, new ItemStack(Items.diamond, 9)}, {Blocks.emerald_block, new ItemStack(Items.emerald, 9)}, {Blocks.lapis_block, new ItemStack(Items.dye, 9, EnumDyeColor.BLUE.getDyeDamage())}, {Blocks.redstone_block, new ItemStack(Items.redstone, 9)}, {Blocks.coal_block, new ItemStack(Items.coal, 9, 0)}, {Blocks.hay_block, new ItemStack(Items.wheat, 9)}, {Blocks.slime_block, new ItemStack(Items.slime_ball, 9)}}; + + public void addRecipes(CraftingManager p_77590_1_) + { + for (int i = 0; i < this.recipeItems.length; ++i) + { + Block block = (Block)this.recipeItems[i][0]; + ItemStack itemstack = (ItemStack)this.recipeItems[i][1]; + p_77590_1_.addRecipe(new ItemStack(block), new Object[] {"###", "###", "###", '#', itemstack}); + p_77590_1_.addRecipe(itemstack, new Object[] {"#", '#', block}); + } + + p_77590_1_.addRecipe(new ItemStack(Items.gold_ingot), new Object[] {"###", "###", "###", '#', Items.gold_nugget}); + p_77590_1_.addRecipe(new ItemStack(Items.gold_nugget, 9), new Object[] {"#", '#', Items.gold_ingot}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java new file mode 100644 index 0000000..8420828 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java @@ -0,0 +1,120 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RecipesMapCloning implements IRecipe +{ + public boolean matches(InventoryCrafting inv, World worldIn) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inv.getSizeInventory(); ++j) + { + ItemStack itemstack1 = inv.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.filled_map) + { + if (itemstack != null) + { + return false; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.map) + { + return false; + } + + ++i; + } + } + } + + return itemstack != null && i > 0; + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < inv.getSizeInventory(); ++j) + { + ItemStack itemstack1 = inv.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.filled_map) + { + if (itemstack != null) + { + return null; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.map) + { + return null; + } + + ++i; + } + } + } + + if (itemstack != null && i >= 1) + { + ItemStack itemstack2 = new ItemStack(Items.filled_map, i + 1, itemstack.getMetadata()); + + if (itemstack.hasDisplayName()) + { + itemstack2.setStackDisplayName(itemstack.getDisplayName()); + } + + return itemstack2; + } + else + { + return null; + } + } + + public int getRecipeSize() + { + return 9; + } + + public ItemStack getRecipeOutput() + { + return null; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java new file mode 100644 index 0000000..98ed579 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java @@ -0,0 +1,74 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class RecipesMapExtending extends ShapedRecipes +{ + public RecipesMapExtending() + { + super(3, 3, new ItemStack[] {new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.filled_map, 0, 32767), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper)}, new ItemStack(Items.map, 0, 0)); + } + + public boolean matches(InventoryCrafting inv, World worldIn) + { + if (!super.matches(inv, worldIn)) + { + return false; + } + else + { + ItemStack itemstack = null; + + for (int i = 0; i < inv.getSizeInventory() && itemstack == null; ++i) + { + ItemStack itemstack1 = inv.getStackInSlot(i); + + if (itemstack1 != null && itemstack1.getItem() == Items.filled_map) + { + itemstack = itemstack1; + } + } + + if (itemstack == null) + { + return false; + } + else + { + MapData mapdata = Items.filled_map.getMapData(itemstack, worldIn); + return mapdata == null ? false : mapdata.scale < 4; + } + } + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + ItemStack itemstack = null; + + for (int i = 0; i < inv.getSizeInventory() && itemstack == null; ++i) + { + ItemStack itemstack1 = inv.getStackInSlot(i); + + if (itemstack1 != null && itemstack1.getItem() == Items.filled_map) + { + itemstack = itemstack1; + } + } + + itemstack = itemstack.copy(); + itemstack.stackSize = 1; + + if (itemstack.getTagCompound() == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.getTagCompound().setBoolean("map_is_scaling", true); + return itemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesTools.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesTools.java new file mode 100644 index 0000000..1dc8721 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesTools.java @@ -0,0 +1,28 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesTools +{ + private String[][] recipePatterns = new String[][] {{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}}; + private Object[][] recipeItems = new Object[][] {{Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.wooden_pickaxe, Items.stone_pickaxe, Items.iron_pickaxe, Items.diamond_pickaxe, Items.golden_pickaxe}, {Items.wooden_shovel, Items.stone_shovel, Items.iron_shovel, Items.diamond_shovel, Items.golden_shovel}, {Items.wooden_axe, Items.stone_axe, Items.iron_axe, Items.diamond_axe, Items.golden_axe}, {Items.wooden_hoe, Items.stone_hoe, Items.iron_hoe, Items.diamond_hoe, Items.golden_hoe}}; + + public void addRecipes(CraftingManager p_77586_1_) + { + for (int i = 0; i < this.recipeItems[0].length; ++i) + { + Object object = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) + { + Item item = (Item)this.recipeItems[j + 1][i]; + p_77586_1_.addRecipe(new ItemStack(item), new Object[] {this.recipePatterns[j], '#', Items.stick, 'X', object}); + } + } + + p_77586_1_.addRecipe(new ItemStack(Items.shears), new Object[] {" #", "# ", '#', Items.iron_ingot}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java new file mode 100644 index 0000000..4604423 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java @@ -0,0 +1,29 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesWeapons +{ + private String[][] recipePatterns = new String[][] {{"X", "X", "#"}}; + private Object[][] recipeItems = new Object[][] {{Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.wooden_sword, Items.stone_sword, Items.iron_sword, Items.diamond_sword, Items.golden_sword}}; + + public void addRecipes(CraftingManager p_77583_1_) + { + for (int i = 0; i < this.recipeItems[0].length; ++i) + { + Object object = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) + { + Item item = (Item)this.recipeItems[j + 1][i]; + p_77583_1_.addRecipe(new ItemStack(item), new Object[] {this.recipePatterns[j], '#', Items.stick, 'X', object}); + } + } + + p_77583_1_.addRecipe(new ItemStack(Items.bow, 1), new Object[] {" #X", "# X", " #X", 'X', Items.string, '#', Items.stick}); + p_77583_1_.addRecipe(new ItemStack(Items.arrow, 4), new Object[] {"X", "#", "Y", 'Y', Items.feather, 'X', Items.flint, '#', Items.stick}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java new file mode 100644 index 0000000..04e0cf6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java @@ -0,0 +1,138 @@ +package net.minecraft.item.crafting; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class ShapedRecipes implements IRecipe +{ + private final int recipeWidth; + private final int recipeHeight; + private final ItemStack[] recipeItems; + private final ItemStack recipeOutput; + private boolean copyIngredientNBT; + + public ShapedRecipes(int width, int height, ItemStack[] p_i1917_3_, ItemStack output) + { + this.recipeWidth = width; + this.recipeHeight = height; + this.recipeItems = p_i1917_3_; + this.recipeOutput = output; + } + + public ItemStack getRecipeOutput() + { + return this.recipeOutput; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } + + public boolean matches(InventoryCrafting inv, World worldIn) + { + for (int i = 0; i <= 3 - this.recipeWidth; ++i) + { + for (int j = 0; j <= 3 - this.recipeHeight; ++j) + { + if (this.checkMatch(inv, i, j, true)) + { + return true; + } + + if (this.checkMatch(inv, i, j, false)) + { + return true; + } + } + } + + return false; + } + + private boolean checkMatch(InventoryCrafting p_77573_1_, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) + { + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 3; ++j) + { + int k = i - p_77573_2_; + int l = j - p_77573_3_; + ItemStack itemstack = null; + + if (k >= 0 && l >= 0 && k < this.recipeWidth && l < this.recipeHeight) + { + if (p_77573_4_) + { + itemstack = this.recipeItems[this.recipeWidth - k - 1 + l * this.recipeWidth]; + } + else + { + itemstack = this.recipeItems[k + l * this.recipeWidth]; + } + } + + ItemStack itemstack1 = p_77573_1_.getStackInRowAndColumn(i, j); + + if (itemstack1 != null || itemstack != null) + { + if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) + { + return false; + } + + if (itemstack.getItem() != itemstack1.getItem()) + { + return false; + } + + if (itemstack.getMetadata() != 32767 && itemstack.getMetadata() != itemstack1.getMetadata()) + { + return false; + } + } + } + } + + return true; + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + ItemStack itemstack = this.getRecipeOutput().copy(); + + if (this.copyIngredientNBT) + { + for (int i = 0; i < inv.getSizeInventory(); ++i) + { + ItemStack itemstack1 = inv.getStackInSlot(i); + + if (itemstack1 != null && itemstack1.hasTagCompound()) + { + itemstack.setTagCompound((NBTTagCompound)itemstack1.getTagCompound().copy()); + } + } + } + + return itemstack; + } + + public int getRecipeSize() + { + return this.recipeWidth * this.recipeHeight; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java new file mode 100644 index 0000000..9a02279 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java @@ -0,0 +1,86 @@ +package net.minecraft.item.crafting; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ShapelessRecipes implements IRecipe +{ + private final ItemStack recipeOutput; + private final List recipeItems; + + public ShapelessRecipes(ItemStack output, List inputList) + { + this.recipeOutput = output; + this.recipeItems = inputList; + } + + public ItemStack getRecipeOutput() + { + return this.recipeOutput; + } + + public ItemStack[] getRemainingItems(InventoryCrafting inv) + { + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + + for (int i = 0; i < aitemstack.length; ++i) + { + ItemStack itemstack = inv.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().hasContainerItem()) + { + aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); + } + } + + return aitemstack; + } + + public boolean matches(InventoryCrafting inv, World worldIn) + { + List list = Lists.newArrayList(this.recipeItems); + + for (int i = 0; i < inv.getHeight(); ++i) + { + for (int j = 0; j < inv.getWidth(); ++j) + { + ItemStack itemstack = inv.getStackInRowAndColumn(j, i); + + if (itemstack != null) + { + boolean flag = false; + + for (ItemStack itemstack1 : list) + { + if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getMetadata() == 32767 || itemstack.getMetadata() == itemstack1.getMetadata())) + { + flag = true; + list.remove(itemstack1); + break; + } + } + + if (!flag) + { + return false; + } + } + } + } + + return list.isEmpty(); + } + + public ItemStack getCraftingResult(InventoryCrafting inv) + { + return this.recipeOutput.copy(); + } + + public int getRecipeSize() + { + return this.recipeItems.size(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/CompressedStreamTools.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/CompressedStreamTools.java new file mode 100644 index 0000000..db57578 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/CompressedStreamTools.java @@ -0,0 +1,181 @@ +package net.minecraft.nbt; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; + +public class CompressedStreamTools +{ + public static NBTTagCompound readCompressed(InputStream is) throws IOException + { + DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(is))); + NBTTagCompound nbttagcompound; + + try + { + nbttagcompound = read(datainputstream, NBTSizeTracker.INFINITE); + } + finally + { + datainputstream.close(); + } + + return nbttagcompound; + } + + public static void writeCompressed(NBTTagCompound p_74799_0_, OutputStream outputStream) throws IOException + { + DataOutputStream dataoutputstream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(outputStream))); + + try + { + write(p_74799_0_, dataoutputstream); + } + finally + { + dataoutputstream.close(); + } + } + + public static void safeWrite(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException + { + File file1 = new File(p_74793_1_.getAbsolutePath() + "_tmp"); + + if (file1.exists()) + { + file1.delete(); + } + + write(p_74793_0_, file1); + + if (p_74793_1_.exists()) + { + p_74793_1_.delete(); + } + + if (p_74793_1_.exists()) + { + throw new IOException("Failed to delete " + p_74793_1_); + } + else + { + file1.renameTo(p_74793_1_); + } + } + + public static void write(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException + { + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(p_74795_1_)); + + try + { + write(p_74795_0_, dataoutputstream); + } + finally + { + dataoutputstream.close(); + } + } + + public static NBTTagCompound read(File p_74797_0_) throws IOException + { + if (!p_74797_0_.exists()) + { + return null; + } + else + { + DataInputStream datainputstream = new DataInputStream(new FileInputStream(p_74797_0_)); + NBTTagCompound nbttagcompound; + + try + { + nbttagcompound = read(datainputstream, NBTSizeTracker.INFINITE); + } + finally + { + datainputstream.close(); + } + + return nbttagcompound; + } + } + + public static NBTTagCompound read(DataInputStream inputStream) throws IOException + { + return read(inputStream, NBTSizeTracker.INFINITE); + } + + public static NBTTagCompound read(DataInput p_152456_0_, NBTSizeTracker p_152456_1_) throws IOException + { + NBTBase nbtbase = func_152455_a(p_152456_0_, 0, p_152456_1_); + + if (nbtbase instanceof NBTTagCompound) + { + return (NBTTagCompound)nbtbase; + } + else + { + throw new IOException("Root tag must be a named compound tag"); + } + } + + public static void write(NBTTagCompound p_74800_0_, DataOutput p_74800_1_) throws IOException + { + writeTag(p_74800_0_, p_74800_1_); + } + + private static void writeTag(NBTBase p_150663_0_, DataOutput p_150663_1_) throws IOException + { + p_150663_1_.writeByte(p_150663_0_.getId()); + + if (p_150663_0_.getId() != 0) + { + p_150663_1_.writeUTF(""); + p_150663_0_.write(p_150663_1_); + } + } + + private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException + { + byte b0 = p_152455_0_.readByte(); + + if (b0 == 0) + { + return new NBTTagEnd(); + } + else + { + p_152455_0_.readUTF(); + NBTBase nbtbase = NBTBase.createNewByType(b0); + + try + { + nbtbase.read(p_152455_0_, p_152455_1_, p_152455_2_); + return nbtbase; + } + catch (IOException ioexception) + { + CrashReport crashreport = CrashReport.makeCrashReport(ioexception, "Loading NBT data"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("NBT Tag"); + crashreportcategory.addCrashSection("Tag name", "[UNNAMED TAG]"); + crashreportcategory.addCrashSection("Tag type", Byte.valueOf(b0)); + throw new ReportedException(crashreport); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/JsonToNBT.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/JsonToNBT.java new file mode 100644 index 0000000..5554aca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/JsonToNBT.java @@ -0,0 +1,553 @@ +package net.minecraft.nbt; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import java.util.Stack; +import java.util.regex.Pattern; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class JsonToNBT +{ + private static final Logger logger = LogManager.getLogger(); + private static final Pattern field_179273_b = Pattern.compile("\\[[-+\\d|,\\s]+\\]"); + + public static NBTTagCompound getTagFromJson(String jsonString) throws NBTException + { + jsonString = jsonString.trim(); + + if (!jsonString.startsWith("{")) + { + throw new NBTException("Invalid tag encountered, expected \'{\' as first char."); + } + else if (func_150310_b(jsonString) != 1) + { + throw new NBTException("Encountered multiple top tags, only one expected"); + } + else + { + return (NBTTagCompound)func_150316_a("tag", jsonString).parse(); + } + } + + static int func_150310_b(String p_150310_0_) throws NBTException + { + int i = 0; + boolean flag = false; + Stack stack = new Stack(); + + for (int j = 0; j < p_150310_0_.length(); ++j) + { + char c0 = p_150310_0_.charAt(j); + + if (c0 == 34) + { + if (func_179271_b(p_150310_0_, j)) + { + if (!flag) + { + throw new NBTException("Illegal use of \\\": " + p_150310_0_); + } + } + else + { + flag = !flag; + } + } + else if (!flag) + { + if (c0 != 123 && c0 != 91) + { + if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123)) + { + throw new NBTException("Unbalanced curly brackets {}: " + p_150310_0_); + } + + if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91)) + { + throw new NBTException("Unbalanced square brackets []: " + p_150310_0_); + } + } + else + { + if (stack.isEmpty()) + { + ++i; + } + + stack.push(Character.valueOf(c0)); + } + } + } + + if (flag) + { + throw new NBTException("Unbalanced quotation: " + p_150310_0_); + } + else if (!stack.isEmpty()) + { + throw new NBTException("Unbalanced brackets: " + p_150310_0_); + } + else + { + if (i == 0 && !p_150310_0_.isEmpty()) + { + i = 1; + } + + return i; + } + } + + static JsonToNBT.Any func_179272_a(String... p_179272_0_) throws NBTException + { + return func_150316_a(p_179272_0_[0], p_179272_0_[1]); + } + + static JsonToNBT.Any func_150316_a(String p_150316_0_, String p_150316_1_) throws NBTException + { + p_150316_1_ = p_150316_1_.trim(); + + if (p_150316_1_.startsWith("{")) + { + p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1); + JsonToNBT.Compound jsontonbt$compound; + String s1; + + for (jsontonbt$compound = new JsonToNBT.Compound(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s1.length() + 1)) + { + s1 = func_150314_a(p_150316_1_, true); + + if (s1.length() > 0) + { + boolean flag1 = false; + jsontonbt$compound.field_150491_b.add(func_179270_a(s1, flag1)); + } + + if (p_150316_1_.length() < s1.length() + 1) + { + break; + } + + char c1 = p_150316_1_.charAt(s1.length()); + + if (c1 != 44 && c1 != 123 && c1 != 125 && c1 != 91 && c1 != 93) + { + throw new NBTException("Unexpected token \'" + c1 + "\' at: " + p_150316_1_.substring(s1.length())); + } + } + + return jsontonbt$compound; + } + else if (p_150316_1_.startsWith("[") && !field_179273_b.matcher(p_150316_1_).matches()) + { + p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1); + JsonToNBT.List jsontonbt$list; + String s; + + for (jsontonbt$list = new JsonToNBT.List(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s.length() + 1)) + { + s = func_150314_a(p_150316_1_, false); + + if (s.length() > 0) + { + boolean flag = true; + jsontonbt$list.field_150492_b.add(func_179270_a(s, flag)); + } + + if (p_150316_1_.length() < s.length() + 1) + { + break; + } + + char c0 = p_150316_1_.charAt(s.length()); + + if (c0 != 44 && c0 != 123 && c0 != 125 && c0 != 91 && c0 != 93) + { + throw new NBTException("Unexpected token \'" + c0 + "\' at: " + p_150316_1_.substring(s.length())); + } + } + + return jsontonbt$list; + } + else + { + return new JsonToNBT.Primitive(p_150316_0_, p_150316_1_); + } + } + + private static JsonToNBT.Any func_179270_a(String p_179270_0_, boolean p_179270_1_) throws NBTException + { + String s = func_150313_b(p_179270_0_, p_179270_1_); + String s1 = func_150311_c(p_179270_0_, p_179270_1_); + return func_179272_a(new String[] {s, s1}); + } + + private static String func_150314_a(String p_150314_0_, boolean p_150314_1_) throws NBTException + { + int i = func_150312_a(p_150314_0_, ':'); + int j = func_150312_a(p_150314_0_, ','); + + if (p_150314_1_) + { + if (i == -1) + { + throw new NBTException("Unable to locate name/value separator for string: " + p_150314_0_); + } + + if (j != -1 && j < i) + { + throw new NBTException("Name error at: " + p_150314_0_); + } + } + else if (i == -1 || i > j) + { + i = -1; + } + + return func_179269_a(p_150314_0_, i); + } + + private static String func_179269_a(String p_179269_0_, int p_179269_1_) throws NBTException + { + Stack stack = new Stack(); + int i = p_179269_1_ + 1; + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + + for (int j = 0; i < p_179269_0_.length(); ++i) + { + char c0 = p_179269_0_.charAt(i); + + if (c0 == 34) + { + if (func_179271_b(p_179269_0_, i)) + { + if (!flag) + { + throw new NBTException("Illegal use of \\\": " + p_179269_0_); + } + } + else + { + flag = !flag; + + if (flag && !flag2) + { + flag1 = true; + } + + if (!flag) + { + j = i; + } + } + } + else if (!flag) + { + if (c0 != 123 && c0 != 91) + { + if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123)) + { + throw new NBTException("Unbalanced curly brackets {}: " + p_179269_0_); + } + + if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91)) + { + throw new NBTException("Unbalanced square brackets []: " + p_179269_0_); + } + + if (c0 == 44 && stack.isEmpty()) + { + return p_179269_0_.substring(0, i); + } + } + else + { + stack.push(Character.valueOf(c0)); + } + } + + if (!Character.isWhitespace(c0)) + { + if (!flag && flag1 && j != i) + { + return p_179269_0_.substring(0, j + 1); + } + + flag2 = true; + } + } + + return p_179269_0_.substring(0, i); + } + + private static String func_150313_b(String p_150313_0_, boolean p_150313_1_) throws NBTException + { + if (p_150313_1_) + { + p_150313_0_ = p_150313_0_.trim(); + + if (p_150313_0_.startsWith("{") || p_150313_0_.startsWith("[")) + { + return ""; + } + } + + int i = func_150312_a(p_150313_0_, ':'); + + if (i == -1) + { + if (p_150313_1_) + { + return ""; + } + else + { + throw new NBTException("Unable to locate name/value separator for string: " + p_150313_0_); + } + } + else + { + return p_150313_0_.substring(0, i).trim(); + } + } + + private static String func_150311_c(String p_150311_0_, boolean p_150311_1_) throws NBTException + { + if (p_150311_1_) + { + p_150311_0_ = p_150311_0_.trim(); + + if (p_150311_0_.startsWith("{") || p_150311_0_.startsWith("[")) + { + return p_150311_0_; + } + } + + int i = func_150312_a(p_150311_0_, ':'); + + if (i == -1) + { + if (p_150311_1_) + { + return p_150311_0_; + } + else + { + throw new NBTException("Unable to locate name/value separator for string: " + p_150311_0_); + } + } + else + { + return p_150311_0_.substring(i + 1).trim(); + } + } + + private static int func_150312_a(String p_150312_0_, char p_150312_1_) + { + int i = 0; + + for (boolean flag = true; i < p_150312_0_.length(); ++i) + { + char c0 = p_150312_0_.charAt(i); + + if (c0 == 34) + { + if (!func_179271_b(p_150312_0_, i)) + { + flag = !flag; + } + } + else if (flag) + { + if (c0 == p_150312_1_) + { + return i; + } + + if (c0 == 123 || c0 == 91) + { + return -1; + } + } + } + + return -1; + } + + private static boolean func_179271_b(String p_179271_0_, int p_179271_1_) + { + return p_179271_1_ > 0 && p_179271_0_.charAt(p_179271_1_ - 1) == 92 && !func_179271_b(p_179271_0_, p_179271_1_ - 1); + } + + abstract static class Any + { + protected String json; + + public abstract NBTBase parse() throws NBTException; + } + + static class Compound extends JsonToNBT.Any + { + protected java.util.List field_150491_b = Lists.newArrayList(); + + public Compound(String p_i45137_1_) + { + this.json = p_i45137_1_; + } + + public NBTBase parse() throws NBTException + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (JsonToNBT.Any jsontonbt$any : this.field_150491_b) + { + nbttagcompound.setTag(jsontonbt$any.json, jsontonbt$any.parse()); + } + + return nbttagcompound; + } + } + + static class List extends JsonToNBT.Any + { + protected java.util.List field_150492_b = Lists.newArrayList(); + + public List(String json) + { + this.json = json; + } + + public NBTBase parse() throws NBTException + { + NBTTagList nbttaglist = new NBTTagList(); + + for (JsonToNBT.Any jsontonbt$any : this.field_150492_b) + { + nbttaglist.appendTag(jsontonbt$any.parse()); + } + + return nbttaglist; + } + } + + static class Primitive extends JsonToNBT.Any + { + private static final Pattern DOUBLE = Pattern.compile("[-+]?[0-9]*\\.?[0-9]+[d|D]"); + private static final Pattern FLOAT = Pattern.compile("[-+]?[0-9]*\\.?[0-9]+[f|F]"); + private static final Pattern BYTE = Pattern.compile("[-+]?[0-9]+[b|B]"); + private static final Pattern LONG = Pattern.compile("[-+]?[0-9]+[l|L]"); + private static final Pattern SHORT = Pattern.compile("[-+]?[0-9]+[s|S]"); + private static final Pattern INTEGER = Pattern.compile("[-+]?[0-9]+"); + private static final Pattern DOUBLE_UNTYPED = Pattern.compile("[-+]?[0-9]*\\.?[0-9]+"); + private static final Splitter SPLITTER = Splitter.on(',').omitEmptyStrings(); + protected String jsonValue; + + public Primitive(String p_i45139_1_, String p_i45139_2_) + { + this.json = p_i45139_1_; + this.jsonValue = p_i45139_2_; + } + + public NBTBase parse() throws NBTException + { + try + { + if (DOUBLE.matcher(this.jsonValue).matches()) + { + return new NBTTagDouble(Double.parseDouble(this.jsonValue.substring(0, this.jsonValue.length() - 1))); + } + + if (FLOAT.matcher(this.jsonValue).matches()) + { + return new NBTTagFloat(Float.parseFloat(this.jsonValue.substring(0, this.jsonValue.length() - 1))); + } + + if (BYTE.matcher(this.jsonValue).matches()) + { + return new NBTTagByte(Byte.parseByte(this.jsonValue.substring(0, this.jsonValue.length() - 1))); + } + + if (LONG.matcher(this.jsonValue).matches()) + { + return new NBTTagLong(Long.parseLong(this.jsonValue.substring(0, this.jsonValue.length() - 1))); + } + + if (SHORT.matcher(this.jsonValue).matches()) + { + return new NBTTagShort(Short.parseShort(this.jsonValue.substring(0, this.jsonValue.length() - 1))); + } + + if (INTEGER.matcher(this.jsonValue).matches()) + { + return new NBTTagInt(Integer.parseInt(this.jsonValue)); + } + + if (DOUBLE_UNTYPED.matcher(this.jsonValue).matches()) + { + return new NBTTagDouble(Double.parseDouble(this.jsonValue)); + } + + if (this.jsonValue.equalsIgnoreCase("true") || this.jsonValue.equalsIgnoreCase("false")) + { + return new NBTTagByte((byte)(Boolean.parseBoolean(this.jsonValue) ? 1 : 0)); + } + } + catch (NumberFormatException var6) + { + this.jsonValue = this.jsonValue.replaceAll("\\\\\"", "\""); + return new NBTTagString(this.jsonValue); + } + + if (this.jsonValue.startsWith("[") && this.jsonValue.endsWith("]")) + { + String s = this.jsonValue.substring(1, this.jsonValue.length() - 1); + String[] astring = (String[])Iterables.toArray(SPLITTER.split(s), String.class); + + try + { + int[] aint = new int[astring.length]; + + for (int j = 0; j < astring.length; ++j) + { + aint[j] = Integer.parseInt(astring[j].trim()); + } + + return new NBTTagIntArray(aint); + } + catch (NumberFormatException var5) + { + return new NBTTagString(this.jsonValue); + } + } + else + { + if (this.jsonValue.startsWith("\"") && this.jsonValue.endsWith("\"")) + { + this.jsonValue = this.jsonValue.substring(1, this.jsonValue.length() - 1); + } + + this.jsonValue = this.jsonValue.replaceAll("\\\\\"", "\""); + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = 0; i < this.jsonValue.length(); ++i) + { + if (i < this.jsonValue.length() - 1 && this.jsonValue.charAt(i) == 92 && this.jsonValue.charAt(i + 1) == 92) + { + stringbuilder.append('\\'); + ++i; + } + else + { + stringbuilder.append(this.jsonValue.charAt(i)); + } + } + + return new NBTTagString(stringbuilder.toString()); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTBase.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTBase.java new file mode 100644 index 0000000..3e543c7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTBase.java @@ -0,0 +1,108 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public abstract class NBTBase +{ + public static final String[] NBT_TYPES = new String[] {"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"}; + + abstract void write(DataOutput output) throws IOException; + + abstract void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException; + + public abstract String toString(); + + public abstract byte getId(); + + protected static NBTBase createNewByType(byte id) + { + switch (id) + { + case 0: + return new NBTTagEnd(); + + case 1: + return new NBTTagByte(); + + case 2: + return new NBTTagShort(); + + case 3: + return new NBTTagInt(); + + case 4: + return new NBTTagLong(); + + case 5: + return new NBTTagFloat(); + + case 6: + return new NBTTagDouble(); + + case 7: + return new NBTTagByteArray(); + + case 8: + return new NBTTagString(); + + case 9: + return new NBTTagList(); + + case 10: + return new NBTTagCompound(); + + case 11: + return new NBTTagIntArray(); + + default: + return null; + } + } + + public abstract NBTBase copy(); + + public boolean hasNoTags() + { + return false; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof NBTBase)) + { + return false; + } + else + { + NBTBase nbtbase = (NBTBase)p_equals_1_; + return this.getId() == nbtbase.getId(); + } + } + + public int hashCode() + { + return this.getId(); + } + + protected String getString() + { + return this.toString(); + } + + public abstract static class NBTPrimitive extends NBTBase + { + public abstract long getLong(); + + public abstract int getInt(); + + public abstract short getShort(); + + public abstract byte getByte(); + + public abstract double getDouble(); + + public abstract float getFloat(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTException.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTException.java new file mode 100644 index 0000000..1a8b884 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTException.java @@ -0,0 +1,9 @@ +package net.minecraft.nbt; + +public class NBTException extends Exception +{ + public NBTException(String p_i45136_1_) + { + super(p_i45136_1_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTSizeTracker.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTSizeTracker.java new file mode 100644 index 0000000..c5a63fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTSizeTracker.java @@ -0,0 +1,28 @@ +package net.minecraft.nbt; + +public class NBTSizeTracker +{ + public static final NBTSizeTracker INFINITE = new NBTSizeTracker(0L) + { + public void read(long bits) + { + } + }; + private final long max; + private long read; + + public NBTSizeTracker(long max) + { + this.max = max; + } + + public void read(long bits) + { + this.read += bits / 8L; + + if (this.read > this.max) + { + throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.read + "bytes where max allowed: " + this.max); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagByte.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagByte.java new file mode 100644 index 0000000..6c85fe9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagByte.java @@ -0,0 +1,93 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagByte extends NBTBase.NBTPrimitive +{ + private byte data; + + NBTTagByte() + { + } + + public NBTTagByte(byte data) + { + this.data = data; + } + + void write(DataOutput output) throws IOException + { + output.writeByte(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(72L); + this.data = input.readByte(); + } + + public byte getId() + { + return (byte)1; + } + + public String toString() + { + return "" + this.data + "b"; + } + + public NBTBase copy() + { + return new NBTTagByte(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagByte nbttagbyte = (NBTTagByte)p_equals_1_; + return this.data == nbttagbyte.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data; + } + + public long getLong() + { + return (long)this.data; + } + + public int getInt() + { + return this.data; + } + + public short getShort() + { + return (short)this.data; + } + + public byte getByte() + { + return this.data; + } + + public double getDouble() + { + return (double)this.data; + } + + public float getFloat() + { + return (float)this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagByteArray.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagByteArray.java new file mode 100644 index 0000000..ab77f32 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagByteArray.java @@ -0,0 +1,67 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Arrays; + +public class NBTTagByteArray extends NBTBase +{ + private byte[] data; + + NBTTagByteArray() + { + } + + public NBTTagByteArray(byte[] data) + { + this.data = data; + } + + void write(DataOutput output) throws IOException + { + output.writeInt(this.data.length); + output.write(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(192L); + int i = input.readInt(); + sizeTracker.read((long)(8 * i)); + this.data = new byte[i]; + input.readFully(this.data); + } + + public byte getId() + { + return (byte)7; + } + + public String toString() + { + return "[" + this.data.length + " bytes]"; + } + + public NBTBase copy() + { + byte[] abyte = new byte[this.data.length]; + System.arraycopy(this.data, 0, abyte, 0, this.data.length); + return new NBTTagByteArray(abyte); + } + + public boolean equals(Object p_equals_1_) + { + return super.equals(p_equals_1_) ? Arrays.equals(this.data, ((NBTTagByteArray)p_equals_1_).data) : false; + } + + public int hashCode() + { + return super.hashCode() ^ Arrays.hashCode(this.data); + } + + public byte[] getByteArray() + { + return this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagCompound.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagCompound.java new file mode 100644 index 0000000..a608ec3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagCompound.java @@ -0,0 +1,449 @@ +package net.minecraft.nbt; + +import com.google.common.collect.Maps; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; + +public class NBTTagCompound extends NBTBase +{ + private Map tagMap = Maps.newHashMap(); + + void write(DataOutput output) throws IOException + { + for (String s : this.tagMap.keySet()) + { + NBTBase nbtbase = (NBTBase)this.tagMap.get(s); + writeEntry(s, nbtbase, output); + } + + output.writeByte(0); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(384L); + + if (depth > 512) + { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } + else + { + this.tagMap.clear(); + byte b0; + + while ((b0 = readType(input, sizeTracker)) != 0) + { + String s = readKey(input, sizeTracker); + sizeTracker.read((long)(224 + 16 * s.length())); + NBTBase nbtbase = readNBT(b0, s, input, depth + 1, sizeTracker); + + if (this.tagMap.put(s, nbtbase) != null) + { + sizeTracker.read(288L); + } + } + } + } + + public Set getKeySet() + { + return this.tagMap.keySet(); + } + + public byte getId() + { + return (byte)10; + } + + public void setTag(String key, NBTBase value) + { + this.tagMap.put(key, value); + } + + public void setByte(String key, byte value) + { + this.tagMap.put(key, new NBTTagByte(value)); + } + + public void setShort(String key, short value) + { + this.tagMap.put(key, new NBTTagShort(value)); + } + + public void setInteger(String key, int value) + { + this.tagMap.put(key, new NBTTagInt(value)); + } + + public void setLong(String key, long value) + { + this.tagMap.put(key, new NBTTagLong(value)); + } + + public void setFloat(String key, float value) + { + this.tagMap.put(key, new NBTTagFloat(value)); + } + + public void setDouble(String key, double value) + { + this.tagMap.put(key, new NBTTagDouble(value)); + } + + public void setString(String key, String value) + { + this.tagMap.put(key, new NBTTagString(value)); + } + + public void setByteArray(String key, byte[] value) + { + this.tagMap.put(key, new NBTTagByteArray(value)); + } + + public void setIntArray(String key, int[] value) + { + this.tagMap.put(key, new NBTTagIntArray(value)); + } + + public void setBoolean(String key, boolean value) + { + this.setByte(key, (byte)(value ? 1 : 0)); + } + + public NBTBase getTag(String key) + { + return (NBTBase)this.tagMap.get(key); + } + + public byte getTagId(String key) + { + NBTBase nbtbase = (NBTBase)this.tagMap.get(key); + return nbtbase != null ? nbtbase.getId() : 0; + } + + public boolean hasKey(String key) + { + return this.tagMap.containsKey(key); + } + + public boolean hasKey(String key, int type) + { + int i = this.getTagId(key); + + if (i == type) + { + return true; + } + else if (type != 99) + { + if (i > 0) + { + ; + } + + return false; + } + else + { + return i == 1 || i == 2 || i == 3 || i == 4 || i == 5 || i == 6; + } + } + + public byte getByte(String key) + { + try + { + return !this.hasKey(key, 99) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).getByte(); + } + catch (ClassCastException var3) + { + return (byte)0; + } + } + + public short getShort(String key) + { + try + { + return !this.hasKey(key, 99) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).getShort(); + } + catch (ClassCastException var3) + { + return (short)0; + } + } + + public int getInteger(String key) + { + try + { + return !this.hasKey(key, 99) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).getInt(); + } + catch (ClassCastException var3) + { + return 0; + } + } + + public long getLong(String key) + { + try + { + return !this.hasKey(key, 99) ? 0L : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).getLong(); + } + catch (ClassCastException var3) + { + return 0L; + } + } + + public float getFloat(String key) + { + try + { + return !this.hasKey(key, 99) ? 0.0F : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).getFloat(); + } + catch (ClassCastException var3) + { + return 0.0F; + } + } + + public double getDouble(String key) + { + try + { + return !this.hasKey(key, 99) ? 0.0D : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).getDouble(); + } + catch (ClassCastException var3) + { + return 0.0D; + } + } + + public String getString(String key) + { + try + { + return !this.hasKey(key, 8) ? "" : ((NBTBase)this.tagMap.get(key)).getString(); + } + catch (ClassCastException var3) + { + return ""; + } + } + + public byte[] getByteArray(String key) + { + try + { + return !this.hasKey(key, 7) ? new byte[0] : ((NBTTagByteArray)this.tagMap.get(key)).getByteArray(); + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 7, classcastexception)); + } + } + + public int[] getIntArray(String key) + { + try + { + return !this.hasKey(key, 11) ? new int[0] : ((NBTTagIntArray)this.tagMap.get(key)).getIntArray(); + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 11, classcastexception)); + } + } + + public NBTTagCompound getCompoundTag(String key) + { + try + { + return !this.hasKey(key, 10) ? new NBTTagCompound() : (NBTTagCompound)this.tagMap.get(key); + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 10, classcastexception)); + } + } + + public NBTTagList getTagList(String key, int type) + { + try + { + if (this.getTagId(key) != 9) + { + return new NBTTagList(); + } + else + { + NBTTagList nbttaglist = (NBTTagList)this.tagMap.get(key); + return nbttaglist.tagCount() > 0 && nbttaglist.getTagType() != type ? new NBTTagList() : nbttaglist; + } + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 9, classcastexception)); + } + } + + public boolean getBoolean(String key) + { + return this.getByte(key) != 0; + } + + public void removeTag(String key) + { + this.tagMap.remove(key); + } + + public String toString() + { + StringBuilder stringbuilder = new StringBuilder("{"); + + for (Entry entry : this.tagMap.entrySet()) + { + if (stringbuilder.length() != 1) + { + stringbuilder.append(','); + } + + stringbuilder.append((String)entry.getKey()).append(':').append(entry.getValue()); + } + + return stringbuilder.append('}').toString(); + } + + public boolean hasNoTags() + { + return this.tagMap.isEmpty(); + } + + private CrashReport createCrashReport(final String key, final int expectedType, ClassCastException ex) + { + CrashReport crashreport = CrashReport.makeCrashReport(ex, "Reading NBT data"); + CrashReportCategory crashreportcategory = crashreport.makeCategoryDepth("Corrupt NBT tag", 1); + crashreportcategory.addCrashSectionCallable("Tag type found", new Callable() + { + public String call() throws Exception + { + return NBTBase.NBT_TYPES[((NBTBase)NBTTagCompound.this.tagMap.get(key)).getId()]; + } + }); + crashreportcategory.addCrashSectionCallable("Tag type expected", new Callable() + { + public String call() throws Exception + { + return NBTBase.NBT_TYPES[expectedType]; + } + }); + crashreportcategory.addCrashSection("Tag name", key); + return crashreport; + } + + public NBTBase copy() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (String s : this.tagMap.keySet()) + { + nbttagcompound.setTag(s, ((NBTBase)this.tagMap.get(s)).copy()); + } + + return nbttagcompound; + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)p_equals_1_; + return this.tagMap.entrySet().equals(nbttagcompound.tagMap.entrySet()); + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.tagMap.hashCode(); + } + + private static void writeEntry(String name, NBTBase data, DataOutput output) throws IOException + { + output.writeByte(data.getId()); + + if (data.getId() != 0) + { + output.writeUTF(name); + data.write(output); + } + } + + private static byte readType(DataInput input, NBTSizeTracker sizeTracker) throws IOException + { + return input.readByte(); + } + + private static String readKey(DataInput input, NBTSizeTracker sizeTracker) throws IOException + { + return input.readUTF(); + } + + static NBTBase readNBT(byte id, String key, DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + NBTBase nbtbase = NBTBase.createNewByType(id); + + try + { + nbtbase.read(input, depth, sizeTracker); + return nbtbase; + } + catch (IOException ioexception) + { + CrashReport crashreport = CrashReport.makeCrashReport(ioexception, "Loading NBT data"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("NBT Tag"); + crashreportcategory.addCrashSection("Tag name", key); + crashreportcategory.addCrashSection("Tag type", Byte.valueOf(id)); + throw new ReportedException(crashreport); + } + } + + public void merge(NBTTagCompound other) + { + for (String s : other.tagMap.keySet()) + { + NBTBase nbtbase = (NBTBase)other.tagMap.get(s); + + if (nbtbase.getId() == 10) + { + if (this.hasKey(s, 10)) + { + NBTTagCompound nbttagcompound = this.getCompoundTag(s); + nbttagcompound.merge((NBTTagCompound)nbtbase); + } + else + { + this.setTag(s, nbtbase.copy()); + } + } + else + { + this.setTag(s, nbtbase.copy()); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagDouble.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagDouble.java new file mode 100644 index 0000000..1ceb1ed --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagDouble.java @@ -0,0 +1,95 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import net.minecraft.util.MathHelper; + +public class NBTTagDouble extends NBTBase.NBTPrimitive +{ + private double data; + + NBTTagDouble() + { + } + + public NBTTagDouble(double data) + { + this.data = data; + } + + void write(DataOutput output) throws IOException + { + output.writeDouble(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(128L); + this.data = input.readDouble(); + } + + public byte getId() + { + return (byte)6; + } + + public String toString() + { + return "" + this.data + "d"; + } + + public NBTBase copy() + { + return new NBTTagDouble(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagDouble nbttagdouble = (NBTTagDouble)p_equals_1_; + return this.data == nbttagdouble.data; + } + else + { + return false; + } + } + + public int hashCode() + { + long i = Double.doubleToLongBits(this.data); + return super.hashCode() ^ (int)(i ^ i >>> 32); + } + + public long getLong() + { + return (long)Math.floor(this.data); + } + + public int getInt() + { + return MathHelper.floor_double(this.data); + } + + public short getShort() + { + return (short)(MathHelper.floor_double(this.data) & 65535); + } + + public byte getByte() + { + return (byte)(MathHelper.floor_double(this.data) & 255); + } + + public double getDouble() + { + return this.data; + } + + public float getFloat() + { + return (float)this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagEnd.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagEnd.java new file mode 100644 index 0000000..f4c2a20 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagEnd.java @@ -0,0 +1,32 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagEnd extends NBTBase +{ + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(64L); + } + + void write(DataOutput output) throws IOException + { + } + + public byte getId() + { + return (byte)0; + } + + public String toString() + { + return "END"; + } + + public NBTBase copy() + { + return new NBTTagEnd(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagFloat.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagFloat.java new file mode 100644 index 0000000..62f8bca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagFloat.java @@ -0,0 +1,94 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import net.minecraft.util.MathHelper; + +public class NBTTagFloat extends NBTBase.NBTPrimitive +{ + private float data; + + NBTTagFloat() + { + } + + public NBTTagFloat(float data) + { + this.data = data; + } + + void write(DataOutput output) throws IOException + { + output.writeFloat(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(96L); + this.data = input.readFloat(); + } + + public byte getId() + { + return (byte)5; + } + + public String toString() + { + return "" + this.data + "f"; + } + + public NBTBase copy() + { + return new NBTTagFloat(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagFloat nbttagfloat = (NBTTagFloat)p_equals_1_; + return this.data == nbttagfloat.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ Float.floatToIntBits(this.data); + } + + public long getLong() + { + return (long)this.data; + } + + public int getInt() + { + return MathHelper.floor_float(this.data); + } + + public short getShort() + { + return (short)(MathHelper.floor_float(this.data) & 65535); + } + + public byte getByte() + { + return (byte)(MathHelper.floor_float(this.data) & 255); + } + + public double getDouble() + { + return (double)this.data; + } + + public float getFloat() + { + return this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagInt.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagInt.java new file mode 100644 index 0000000..bf52147 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagInt.java @@ -0,0 +1,93 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagInt extends NBTBase.NBTPrimitive +{ + private int data; + + NBTTagInt() + { + } + + public NBTTagInt(int data) + { + this.data = data; + } + + void write(DataOutput output) throws IOException + { + output.writeInt(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(96L); + this.data = input.readInt(); + } + + public byte getId() + { + return (byte)3; + } + + public String toString() + { + return "" + this.data; + } + + public NBTBase copy() + { + return new NBTTagInt(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagInt nbttagint = (NBTTagInt)p_equals_1_; + return this.data == nbttagint.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data; + } + + public long getLong() + { + return (long)this.data; + } + + public int getInt() + { + return this.data; + } + + public short getShort() + { + return (short)(this.data & 65535); + } + + public byte getByte() + { + return (byte)(this.data & 255); + } + + public double getDouble() + { + return (double)this.data; + } + + public float getFloat() + { + return (float)this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagIntArray.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagIntArray.java new file mode 100644 index 0000000..c971f9b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagIntArray.java @@ -0,0 +1,82 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Arrays; + +public class NBTTagIntArray extends NBTBase +{ + private int[] intArray; + + NBTTagIntArray() + { + } + + public NBTTagIntArray(int[] p_i45132_1_) + { + this.intArray = p_i45132_1_; + } + + void write(DataOutput output) throws IOException + { + output.writeInt(this.intArray.length); + + for (int i = 0; i < this.intArray.length; ++i) + { + output.writeInt(this.intArray[i]); + } + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(192L); + int i = input.readInt(); + sizeTracker.read((long)(32 * i)); + this.intArray = new int[i]; + + for (int j = 0; j < i; ++j) + { + this.intArray[j] = input.readInt(); + } + } + + public byte getId() + { + return (byte)11; + } + + public String toString() + { + String s = "["; + + for (int i : this.intArray) + { + s = s + i + ","; + } + + return s + "]"; + } + + public NBTBase copy() + { + int[] aint = new int[this.intArray.length]; + System.arraycopy(this.intArray, 0, aint, 0, this.intArray.length); + return new NBTTagIntArray(aint); + } + + public boolean equals(Object p_equals_1_) + { + return super.equals(p_equals_1_) ? Arrays.equals(this.intArray, ((NBTTagIntArray)p_equals_1_).intArray) : false; + } + + public int hashCode() + { + return super.hashCode() ^ Arrays.hashCode(this.intArray); + } + + public int[] getIntArray() + { + return this.intArray; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagList.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagList.java new file mode 100644 index 0000000..bd960a9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagList.java @@ -0,0 +1,262 @@ +package net.minecraft.nbt; + +import com.google.common.collect.Lists; +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NBTTagList extends NBTBase +{ + private static final Logger LOGGER = LogManager.getLogger(); + private List tagList = Lists.newArrayList(); + private byte tagType = 0; + + void write(DataOutput output) throws IOException + { + if (!this.tagList.isEmpty()) + { + this.tagType = ((NBTBase)this.tagList.get(0)).getId(); + } + else + { + this.tagType = 0; + } + + output.writeByte(this.tagType); + output.writeInt(this.tagList.size()); + + for (int i = 0; i < this.tagList.size(); ++i) + { + ((NBTBase)this.tagList.get(i)).write(output); + } + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(296L); + + if (depth > 512) + { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } + else + { + this.tagType = input.readByte(); + int i = input.readInt(); + + if (this.tagType == 0 && i > 0) + { + throw new RuntimeException("Missing type on ListTag"); + } + else + { + sizeTracker.read(32L * (long)i); + this.tagList = Lists.newArrayListWithCapacity(i); + + for (int j = 0; j < i; ++j) + { + NBTBase nbtbase = NBTBase.createNewByType(this.tagType); + nbtbase.read(input, depth + 1, sizeTracker); + this.tagList.add(nbtbase); + } + } + } + } + + public byte getId() + { + return (byte)9; + } + + public String toString() + { + StringBuilder stringbuilder = new StringBuilder("["); + + for (int i = 0; i < this.tagList.size(); ++i) + { + if (i != 0) + { + stringbuilder.append(','); + } + + stringbuilder.append(i).append(':').append(this.tagList.get(i)); + } + + return stringbuilder.append(']').toString(); + } + + public void appendTag(NBTBase nbt) + { + if (nbt.getId() == 0) + { + LOGGER.warn("Invalid TagEnd added to ListTag"); + } + else + { + if (this.tagType == 0) + { + this.tagType = nbt.getId(); + } + else if (this.tagType != nbt.getId()) + { + LOGGER.warn("Adding mismatching tag types to tag list"); + return; + } + + this.tagList.add(nbt); + } + } + + public void set(int idx, NBTBase nbt) + { + if (nbt.getId() == 0) + { + LOGGER.warn("Invalid TagEnd added to ListTag"); + } + else if (idx >= 0 && idx < this.tagList.size()) + { + if (this.tagType == 0) + { + this.tagType = nbt.getId(); + } + else if (this.tagType != nbt.getId()) + { + LOGGER.warn("Adding mismatching tag types to tag list"); + return; + } + + this.tagList.set(idx, nbt); + } + else + { + LOGGER.warn("index out of bounds to set tag in tag list"); + } + } + + public NBTBase removeTag(int i) + { + return (NBTBase)this.tagList.remove(i); + } + + public boolean hasNoTags() + { + return this.tagList.isEmpty(); + } + + public NBTTagCompound getCompoundTagAt(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 10 ? (NBTTagCompound)nbtbase : new NBTTagCompound(); + } + else + { + return new NBTTagCompound(); + } + } + + public int[] getIntArrayAt(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 11 ? ((NBTTagIntArray)nbtbase).getIntArray() : new int[0]; + } + else + { + return new int[0]; + } + } + + public double getDoubleAt(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 6 ? ((NBTTagDouble)nbtbase).getDouble() : 0.0D; + } + else + { + return 0.0D; + } + } + + public float getFloatAt(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 5 ? ((NBTTagFloat)nbtbase).getFloat() : 0.0F; + } + else + { + return 0.0F; + } + } + + public String getStringTagAt(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 8 ? nbtbase.getString() : nbtbase.toString(); + } + else + { + return ""; + } + } + + public NBTBase get(int idx) + { + return (NBTBase)(idx >= 0 && idx < this.tagList.size() ? (NBTBase)this.tagList.get(idx) : new NBTTagEnd()); + } + + public int tagCount() + { + return this.tagList.size(); + } + + public NBTBase copy() + { + NBTTagList nbttaglist = new NBTTagList(); + nbttaglist.tagType = this.tagType; + + for (NBTBase nbtbase : this.tagList) + { + NBTBase nbtbase1 = nbtbase.copy(); + nbttaglist.tagList.add(nbtbase1); + } + + return nbttaglist; + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagList nbttaglist = (NBTTagList)p_equals_1_; + + if (this.tagType == nbttaglist.tagType) + { + return this.tagList.equals(nbttaglist.tagList); + } + } + + return false; + } + + public int hashCode() + { + return super.hashCode() ^ this.tagList.hashCode(); + } + + public int getTagType() + { + return this.tagType; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagLong.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagLong.java new file mode 100644 index 0000000..7162226 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagLong.java @@ -0,0 +1,93 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagLong extends NBTBase.NBTPrimitive +{ + private long data; + + NBTTagLong() + { + } + + public NBTTagLong(long data) + { + this.data = data; + } + + void write(DataOutput output) throws IOException + { + output.writeLong(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(128L); + this.data = input.readLong(); + } + + public byte getId() + { + return (byte)4; + } + + public String toString() + { + return "" + this.data + "L"; + } + + public NBTBase copy() + { + return new NBTTagLong(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagLong nbttaglong = (NBTTagLong)p_equals_1_; + return this.data == nbttaglong.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ (int)(this.data ^ this.data >>> 32); + } + + public long getLong() + { + return this.data; + } + + public int getInt() + { + return (int)(this.data & -1L); + } + + public short getShort() + { + return (short)((int)(this.data & 65535L)); + } + + public byte getByte() + { + return (byte)((int)(this.data & 255L)); + } + + public double getDouble() + { + return (double)this.data; + } + + public float getFloat() + { + return (float)this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagShort.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagShort.java new file mode 100644 index 0000000..44bb045 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagShort.java @@ -0,0 +1,93 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagShort extends NBTBase.NBTPrimitive +{ + private short data; + + public NBTTagShort() + { + } + + public NBTTagShort(short data) + { + this.data = data; + } + + void write(DataOutput output) throws IOException + { + output.writeShort(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(80L); + this.data = input.readShort(); + } + + public byte getId() + { + return (byte)2; + } + + public String toString() + { + return "" + this.data + "s"; + } + + public NBTBase copy() + { + return new NBTTagShort(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagShort nbttagshort = (NBTTagShort)p_equals_1_; + return this.data == nbttagshort.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data; + } + + public long getLong() + { + return (long)this.data; + } + + public int getInt() + { + return this.data; + } + + public short getShort() + { + return this.data; + } + + public byte getByte() + { + return (byte)(this.data & 255); + } + + public double getDouble() + { + return (double)this.data; + } + + public float getFloat() + { + return (float)this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagString.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagString.java new file mode 100644 index 0000000..3ad1761 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTTagString.java @@ -0,0 +1,80 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagString extends NBTBase +{ + private String data; + + public NBTTagString() + { + this.data = ""; + } + + public NBTTagString(String data) + { + this.data = data; + + if (data == null) + { + throw new IllegalArgumentException("Empty string not allowed"); + } + } + + void write(DataOutput output) throws IOException + { + output.writeUTF(this.data); + } + + void read(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.read(288L); + this.data = input.readUTF(); + sizeTracker.read((long)(16 * this.data.length())); + } + + public byte getId() + { + return (byte)8; + } + + public String toString() + { + return "\"" + this.data.replace("\"", "\\\"") + "\""; + } + + public NBTBase copy() + { + return new NBTTagString(this.data); + } + + public boolean hasNoTags() + { + return this.data.isEmpty(); + } + + public boolean equals(Object p_equals_1_) + { + if (!super.equals(p_equals_1_)) + { + return false; + } + else + { + NBTTagString nbttagstring = (NBTTagString)p_equals_1_; + return this.data == null && nbttagstring.data == null || this.data != null && this.data.equals(nbttagstring.data); + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data.hashCode(); + } + + public String getString() + { + return this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTUtil.java b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTUtil.java new file mode 100644 index 0000000..71870a8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/nbt/NBTUtil.java @@ -0,0 +1,189 @@ +package net.minecraft.nbt; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import java.util.UUID; +import net.minecraft.util.StringUtils; + +public final class NBTUtil +{ + public static GameProfile readGameProfileFromNBT(NBTTagCompound compound) + { + String s = null; + String s1 = null; + + if (compound.hasKey("Name", 8)) + { + s = compound.getString("Name"); + } + + if (compound.hasKey("Id", 8)) + { + s1 = compound.getString("Id"); + } + + if (StringUtils.isNullOrEmpty(s) && StringUtils.isNullOrEmpty(s1)) + { + return null; + } + else + { + UUID uuid; + + try + { + uuid = UUID.fromString(s1); + } + catch (Throwable var12) + { + uuid = null; + } + + GameProfile gameprofile = new GameProfile(uuid, s); + + if (compound.hasKey("Properties", 10)) + { + NBTTagCompound nbttagcompound = compound.getCompoundTag("Properties"); + + for (String s2 : nbttagcompound.getKeySet()) + { + NBTTagList nbttaglist = nbttagcompound.getTagList(s2, 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + String s3 = nbttagcompound1.getString("Value"); + + if (nbttagcompound1.hasKey("Signature", 8)) + { + gameprofile.getProperties().put(s2, new Property(s2, s3, nbttagcompound1.getString("Signature"))); + } + else + { + gameprofile.getProperties().put(s2, new Property(s2, s3)); + } + } + } + } + + return gameprofile; + } + } + + public static NBTTagCompound writeGameProfile(NBTTagCompound tagCompound, GameProfile profile) + { + if (!StringUtils.isNullOrEmpty(profile.getName())) + { + tagCompound.setString("Name", profile.getName()); + } + + if (profile.getId() != null) + { + tagCompound.setString("Id", profile.getId().toString()); + } + + if (!profile.getProperties().isEmpty()) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (String s : profile.getProperties().keySet()) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (Property property : profile.getProperties().get(s)) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setString("Value", property.getValue()); + + if (property.hasSignature()) + { + nbttagcompound1.setString("Signature", property.getSignature()); + } + + nbttaglist.appendTag(nbttagcompound1); + } + + nbttagcompound.setTag(s, nbttaglist); + } + + tagCompound.setTag("Properties", nbttagcompound); + } + + return tagCompound; + } + + public static boolean func_181123_a(NBTBase p_181123_0_, NBTBase p_181123_1_, boolean p_181123_2_) + { + if (p_181123_0_ == p_181123_1_) + { + return true; + } + else if (p_181123_0_ == null) + { + return true; + } + else if (p_181123_1_ == null) + { + return false; + } + else if (!p_181123_0_.getClass().equals(p_181123_1_.getClass())) + { + return false; + } + else if (p_181123_0_ instanceof NBTTagCompound) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)p_181123_0_; + NBTTagCompound nbttagcompound1 = (NBTTagCompound)p_181123_1_; + + for (String s : nbttagcompound.getKeySet()) + { + NBTBase nbtbase1 = nbttagcompound.getTag(s); + + if (!func_181123_a(nbtbase1, nbttagcompound1.getTag(s), p_181123_2_)) + { + return false; + } + } + + return true; + } + else if (p_181123_0_ instanceof NBTTagList && p_181123_2_) + { + NBTTagList nbttaglist = (NBTTagList)p_181123_0_; + NBTTagList nbttaglist1 = (NBTTagList)p_181123_1_; + + if (nbttaglist.tagCount() == 0) + { + return nbttaglist1.tagCount() == 0; + } + else + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTBase nbtbase = nbttaglist.get(i); + boolean flag = false; + + for (int j = 0; j < nbttaglist1.tagCount(); ++j) + { + if (func_181123_a(nbtbase, nbttaglist1.get(j), p_181123_2_)) + { + flag = true; + break; + } + } + + if (!flag) + { + return false; + } + } + + return true; + } + } + else + { + return p_181123_0_.equals(p_181123_1_); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/EnumConnectionState.java b/Client-1.8.9/src/main/java/net/minecraft/network/EnumConnectionState.java new file mode 100644 index 0000000..d051db8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/EnumConnectionState.java @@ -0,0 +1,344 @@ +package net.minecraft.network; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.login.server.S03PacketEnableCompression; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.client.C18PacketSpectate; +import net.minecraft.network.play.client.C19PacketResourcePackStatus; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.network.play.server.S41PacketServerDifficulty; +import net.minecraft.network.play.server.S42PacketCombatEvent; +import net.minecraft.network.play.server.S43PacketCamera; +import net.minecraft.network.play.server.S44PacketWorldBorder; +import net.minecraft.network.play.server.S45PacketTitle; +import net.minecraft.network.play.server.S46PacketSetCompressionLevel; +import net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; +import net.minecraft.network.play.server.S48PacketResourcePackSend; +import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import org.apache.logging.log4j.LogManager; + +public enum EnumConnectionState +{ + HANDSHAKING(-1) + { + { + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00Handshake.class); + } + }, + PLAY(0) + { + { + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketKeepAlive.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketJoinGame.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S02PacketChat.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S03PacketTimeUpdate.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S04PacketEntityEquipment.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S05PacketSpawnPosition.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S06PacketUpdateHealth.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S07PacketRespawn.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S08PacketPlayerPosLook.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S09PacketHeldItemChange.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0APacketUseBed.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0BPacketAnimation.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0CPacketSpawnPlayer.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0DPacketCollectItem.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0EPacketSpawnObject.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S0FPacketSpawnMob.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S10PacketSpawnPainting.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S11PacketSpawnExperienceOrb.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S12PacketEntityVelocity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S13PacketDestroyEntities.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S15PacketEntityRelMove.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S16PacketEntityLook.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S14PacketEntity.S17PacketEntityLookMove.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S18PacketEntityTeleport.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S19PacketEntityHeadLook.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S19PacketEntityStatus.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1BPacketEntityAttach.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1CPacketEntityMetadata.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1DPacketEntityEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1EPacketRemoveEntityEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S1FPacketSetExperience.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S20PacketEntityProperties.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S21PacketChunkData.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S22PacketMultiBlockChange.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S23PacketBlockChange.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S24PacketBlockAction.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S25PacketBlockBreakAnim.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S26PacketMapChunkBulk.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S27PacketExplosion.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S28PacketEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S29PacketSoundEffect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2APacketParticles.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2BPacketChangeGameState.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2CPacketSpawnGlobalEntity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2DPacketOpenWindow.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2EPacketCloseWindow.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S2FPacketSetSlot.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S30PacketWindowItems.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S31PacketWindowProperty.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S32PacketConfirmTransaction.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S33PacketUpdateSign.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S34PacketMaps.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S35PacketUpdateTileEntity.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S36PacketSignEditorOpen.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S37PacketStatistics.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S38PacketPlayerListItem.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S39PacketPlayerAbilities.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3APacketTabComplete.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3BPacketScoreboardObjective.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3CPacketUpdateScore.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3DPacketDisplayScoreboard.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3EPacketTeams.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S3FPacketCustomPayload.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S40PacketDisconnect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S41PacketServerDifficulty.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S42PacketCombatEvent.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S43PacketCamera.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S44PacketWorldBorder.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S45PacketTitle.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S46PacketSetCompressionLevel.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S47PacketPlayerListHeaderFooter.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S48PacketResourcePackSend.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S49PacketUpdateEntityNBT.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketKeepAlive.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketChatMessage.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C02PacketUseEntity.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C04PacketPlayerPosition.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C05PacketPlayerLook.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C03PacketPlayer.C06PacketPlayerPosLook.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C07PacketPlayerDigging.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C08PacketPlayerBlockPlacement.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C09PacketHeldItemChange.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0APacketAnimation.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0BPacketEntityAction.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0CPacketInput.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0DPacketCloseWindow.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0EPacketClickWindow.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C0FPacketConfirmTransaction.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C10PacketCreativeInventoryAction.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C11PacketEnchantItem.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C12PacketUpdateSign.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C13PacketPlayerAbilities.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C14PacketTabComplete.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C15PacketClientSettings.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C16PacketClientStatus.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C17PacketCustomPayload.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C18PacketSpectate.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C19PacketResourcePackStatus.class); + } + }, + STATUS(1) + { + { + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketServerQuery.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketServerInfo.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketPing.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketPong.class); + } + }, + LOGIN(2) + { + { + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketDisconnect.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketEncryptionRequest.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S02PacketLoginSuccess.class); + this.registerPacket(EnumPacketDirection.CLIENTBOUND, S03PacketEnableCompression.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketLoginStart.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketEncryptionResponse.class); + } + }; + + private static int field_181136_e = -1; + private static int field_181137_f = 2; + private static final EnumConnectionState[] STATES_BY_ID = new EnumConnectionState[field_181137_f - field_181136_e + 1]; + private static final Map < Class , EnumConnectionState > STATES_BY_CLASS = Maps. < Class , EnumConnectionState > newHashMap(); + private final int id; + private final Map < EnumPacketDirection, BiMap < Integer, Class >> directionMaps; + + private EnumConnectionState(int protocolId) + { + this.directionMaps = Maps.newEnumMap(EnumPacketDirection.class); + this.id = protocolId; + } + + protected EnumConnectionState registerPacket(EnumPacketDirection direction, Class packetClass) + { + BiMap < Integer, Class > bimap = (BiMap)this.directionMaps.get(direction); + + if (bimap == null) + { + bimap = HashBiMap. < Integer, Class > create(); + this.directionMaps.put(direction, bimap); + } + + if (bimap.containsValue(packetClass)) + { + String s = direction + " packet " + packetClass + " is already known to ID " + bimap.inverse().get(packetClass); + LogManager.getLogger().fatal(s); + throw new IllegalArgumentException(s); + } + else + { + bimap.put(Integer.valueOf(bimap.size()), packetClass); + return this; + } + } + + public Integer getPacketId(EnumPacketDirection direction, Packet packetIn) + { + return (Integer)((BiMap)this.directionMaps.get(direction)).inverse().get(packetIn.getClass()); + } + + public Packet getPacket(EnumPacketDirection direction, int packetId) throws InstantiationException, IllegalAccessException { + Class oclass = (Class)((BiMap)this.directionMaps.get(direction)).get(Integer.valueOf(packetId)); + return oclass == null ? null : (Packet)oclass.newInstance(); + } + + public int getId() + { + return this.id; + } + + public static EnumConnectionState getById(int stateId) + { + return stateId >= field_181136_e && stateId <= field_181137_f ? STATES_BY_ID[stateId - field_181136_e] : null; + } + + public static EnumConnectionState getFromPacket(Packet packetIn) + { + return (EnumConnectionState)STATES_BY_CLASS.get(packetIn.getClass()); + } + + static { + for (EnumConnectionState enumconnectionstate : values()) + { + int i = enumconnectionstate.getId(); + + if (i < field_181136_e || i > field_181137_f) + { + throw new Error("Invalid protocol ID " + Integer.toString(i)); + } + + STATES_BY_ID[i - field_181136_e] = enumconnectionstate; + + for (EnumPacketDirection enumpacketdirection : enumconnectionstate.directionMaps.keySet()) + { + for (Class oclass : (enumconnectionstate.directionMaps.get(enumpacketdirection)).values()) + { + if (STATES_BY_CLASS.containsKey(oclass) && STATES_BY_CLASS.get(oclass) != enumconnectionstate) + { + throw new Error("Packet " + oclass + " is already assigned to protocol " + STATES_BY_CLASS.get(oclass) + " - can\'t reassign to " + enumconnectionstate); + } + + try + { + oclass.newInstance(); + } + catch (Throwable var10) + { + throw new Error("Packet " + oclass + " fails instantiation checks! " + oclass); + } + + STATES_BY_CLASS.put(oclass, enumconnectionstate); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/EnumPacketDirection.java b/Client-1.8.9/src/main/java/net/minecraft/network/EnumPacketDirection.java new file mode 100644 index 0000000..134151f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/EnumPacketDirection.java @@ -0,0 +1,7 @@ +package net.minecraft.network; + +public enum EnumPacketDirection +{ + SERVERBOUND, + CLIENTBOUND; +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/INetHandler.java b/Client-1.8.9/src/main/java/net/minecraft/network/INetHandler.java new file mode 100644 index 0000000..bf27567 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/INetHandler.java @@ -0,0 +1,8 @@ +package net.minecraft.network; + +import net.minecraft.util.IChatComponent; + +public interface INetHandler +{ + void onDisconnect(IChatComponent reason); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NetHandlerPlayServer.java b/Client-1.8.9/src/main/java/net/minecraft/network/NetHandlerPlayServer.java new file mode 100644 index 0000000..bf3fff4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NetHandlerPlayServer.java @@ -0,0 +1,1369 @@ +package net.minecraft.network; + +import com.google.common.collect.Lists; +import com.google.common.primitives.Doubles; +import com.google.common.primitives.Floats; +import com.google.common.util.concurrent.Futures; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.IOException; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.block.material.Material; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemEditableBook; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemWritableBook; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.client.C18PacketSpectate; +import net.minecraft.network.play.client.C19PacketResourcePackStatus; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.UserListBansEntry; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ITickable; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldServer; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable +{ + private static final Logger logger = LogManager.getLogger(); + public final NetworkManager netManager; + private final MinecraftServer serverController; + public EntityPlayerMP playerEntity; + private int networkTickCount; + private int field_175090_f; + private int floatingTickCount; + private boolean field_147366_g; + private int field_147378_h; + private long lastPingTime; + private long lastSentPingPacket; + private int chatSpamThresholdCount; + private int itemDropThreshold; + private IntHashMap field_147372_n = new IntHashMap(); + private double lastPosX; + private double lastPosY; + private double lastPosZ; + private boolean hasMoved = true; + + public NetHandlerPlayServer(MinecraftServer server, NetworkManager networkManagerIn, EntityPlayerMP playerIn) + { + this.serverController = server; + this.netManager = networkManagerIn; + networkManagerIn.setNetHandler(this); + this.playerEntity = playerIn; + playerIn.playerNetServerHandler = this; + } + + public void update() + { + this.field_147366_g = false; + ++this.networkTickCount; + this.serverController.theProfiler.startSection("keepAlive"); + + if ((long)this.networkTickCount - this.lastSentPingPacket > 40L) + { + this.lastSentPingPacket = (long)this.networkTickCount; + this.lastPingTime = this.currentTimeMillis(); + this.field_147378_h = (int)this.lastPingTime; + this.sendPacket(new S00PacketKeepAlive(this.field_147378_h)); + } + + this.serverController.theProfiler.endSection(); + + if (this.chatSpamThresholdCount > 0) + { + --this.chatSpamThresholdCount; + } + + if (this.itemDropThreshold > 0) + { + --this.itemDropThreshold; + } + + if (this.playerEntity.getLastActiveTime() > 0L && this.serverController.getMaxPlayerIdleMinutes() > 0 && MinecraftServer.getCurrentTimeMillis() - this.playerEntity.getLastActiveTime() > (long)(this.serverController.getMaxPlayerIdleMinutes() * 1000 * 60)) + { + this.kickPlayerFromServer("You have been idle for too long!"); + } + } + + public NetworkManager getNetworkManager() + { + return this.netManager; + } + + public void kickPlayerFromServer(String reason) + { + final ChatComponentText chatcomponenttext = new ChatComponentText(reason); + this.netManager.sendPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener < Future > () + { + public void operationComplete(Future p_operationComplete_1_) throws Exception + { + NetHandlerPlayServer.this.netManager.closeChannel(chatcomponenttext); + } + }, new GenericFutureListener[0]); + this.netManager.disableAutoRead(); + Futures.getUnchecked(this.serverController.addScheduledTask(new Runnable() + { + public void run() + { + NetHandlerPlayServer.this.netManager.checkDisconnected(); + } + })); + } + + public void processInput(C0CPacketInput packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.setEntityActionState(packetIn.getStrafeSpeed(), packetIn.getForwardSpeed(), packetIn.isJumping(), packetIn.isSneaking()); + } + + private boolean func_183006_b(C03PacketPlayer p_183006_1_) + { + return !Doubles.isFinite(p_183006_1_.getPositionX()) || !Doubles.isFinite(p_183006_1_.getPositionY()) || !Doubles.isFinite(p_183006_1_.getPositionZ()) || !Floats.isFinite(p_183006_1_.getPitch()) || !Floats.isFinite(p_183006_1_.getYaw()); + } + + public void processPlayer(C03PacketPlayer packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + + if (this.func_183006_b(packetIn)) + { + this.kickPlayerFromServer("Invalid move packet received"); + } + else + { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + this.field_147366_g = true; + + if (!this.playerEntity.playerConqueredTheEnd) + { + double d0 = this.playerEntity.posX; + double d1 = this.playerEntity.posY; + double d2 = this.playerEntity.posZ; + double d3 = 0.0D; + double d4 = packetIn.getPositionX() - this.lastPosX; + double d5 = packetIn.getPositionY() - this.lastPosY; + double d6 = packetIn.getPositionZ() - this.lastPosZ; + + if (packetIn.isMoving()) + { + d3 = d4 * d4 + d5 * d5 + d6 * d6; + + if (!this.hasMoved && d3 < 0.25D) + { + this.hasMoved = true; + } + } + + if (this.hasMoved) + { + this.field_175090_f = this.networkTickCount; + + if (this.playerEntity.ridingEntity != null) + { + float f4 = this.playerEntity.rotationYaw; + float f = this.playerEntity.rotationPitch; + this.playerEntity.ridingEntity.updateRiderPosition(); + double d16 = this.playerEntity.posX; + double d17 = this.playerEntity.posY; + double d18 = this.playerEntity.posZ; + + if (packetIn.getRotating()) + { + f4 = packetIn.getYaw(); + f = packetIn.getPitch(); + } + + this.playerEntity.onGround = packetIn.isOnGround(); + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(d16, d17, d18, f4, f); + + if (this.playerEntity.ridingEntity != null) + { + this.playerEntity.ridingEntity.updateRiderPosition(); + } + + this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + + if (this.playerEntity.ridingEntity != null) + { + if (d3 > 4.0D) + { + Entity entity = this.playerEntity.ridingEntity; + this.playerEntity.playerNetServerHandler.sendPacket(new S18PacketEntityTeleport(entity)); + this.setPlayerLocation(this.playerEntity.posX, this.playerEntity.posY, this.playerEntity.posZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + } + + this.playerEntity.ridingEntity.isAirBorne = true; + } + + if (this.hasMoved) + { + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + } + + worldserver.updateEntity(this.playerEntity); + return; + } + + if (this.playerEntity.isPlayerSleeping()) + { + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + worldserver.updateEntity(this.playerEntity); + return; + } + + double d7 = this.playerEntity.posY; + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + double d8 = this.playerEntity.posX; + double d9 = this.playerEntity.posY; + double d10 = this.playerEntity.posZ; + float f1 = this.playerEntity.rotationYaw; + float f2 = this.playerEntity.rotationPitch; + + if (packetIn.isMoving() && packetIn.getPositionY() == -999.0D) + { + packetIn.setMoving(false); + } + + if (packetIn.isMoving()) + { + d8 = packetIn.getPositionX(); + d9 = packetIn.getPositionY(); + d10 = packetIn.getPositionZ(); + + if (Math.abs(packetIn.getPositionX()) > 3.0E7D || Math.abs(packetIn.getPositionZ()) > 3.0E7D) + { + this.kickPlayerFromServer("Illegal position"); + return; + } + } + + if (packetIn.getRotating()) + { + f1 = packetIn.getYaw(); + f2 = packetIn.getPitch(); + } + + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + + if (!this.hasMoved) + { + return; + } + + double d11 = d8 - this.playerEntity.posX; + double d12 = d9 - this.playerEntity.posY; + double d13 = d10 - this.playerEntity.posZ; + double d14 = this.playerEntity.motionX * this.playerEntity.motionX + this.playerEntity.motionY * this.playerEntity.motionY + this.playerEntity.motionZ * this.playerEntity.motionZ; + double d15 = d11 * d11 + d12 * d12 + d13 * d13; + + if (d15 - d14 > 100.0D && (!this.serverController.isSinglePlayer() || !this.serverController.getServerOwner().equals(this.playerEntity.getName()))) + { + logger.warn(this.playerEntity.getName() + " moved too quickly! " + d11 + "," + d12 + "," + d13 + " (" + d11 + ", " + d12 + ", " + d13 + ")"); + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + return; + } + + float f3 = 0.0625F; + boolean flag = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.getEntityBoundingBox().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + + if (this.playerEntity.onGround && !packetIn.isOnGround() && d12 > 0.0D) + { + this.playerEntity.jump(); + } + + this.playerEntity.moveEntity(d11, d12, d13); + this.playerEntity.onGround = packetIn.isOnGround(); + d11 = d8 - this.playerEntity.posX; + d12 = d9 - this.playerEntity.posY; + + if (d12 > -0.5D || d12 < 0.5D) + { + d12 = 0.0D; + } + + d13 = d10 - this.playerEntity.posZ; + d15 = d11 * d11 + d12 * d12 + d13 * d13; + boolean flag1 = false; + + if (d15 > 0.0625D && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.theItemInWorldManager.isCreative()) + { + flag1 = true; + logger.warn(this.playerEntity.getName() + " moved wrongly!"); + } + + this.playerEntity.setPositionAndRotation(d8, d9, d10, f1, f2); + this.playerEntity.addMovementStat(this.playerEntity.posX - d0, this.playerEntity.posY - d1, this.playerEntity.posZ - d2); + + if (!this.playerEntity.noClip) + { + boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.getEntityBoundingBox().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + + if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping()) + { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + return; + } + } + + AxisAlignedBB axisalignedbb = this.playerEntity.getEntityBoundingBox().expand((double)f3, (double)f3, (double)f3).addCoord(0.0D, -0.55D, 0.0D); + + if (!this.serverController.isFlightAllowed() && !this.playerEntity.capabilities.allowFlying && !worldserver.checkBlockCollision(axisalignedbb)) + { + if (d12 >= -0.03125D) + { + ++this.floatingTickCount; + + if (this.floatingTickCount > 80) + { + logger.warn(this.playerEntity.getName() + " was kicked for floating too long!"); + this.kickPlayerFromServer("Flying is not enabled on this server"); + return; + } + } + } + else + { + this.floatingTickCount = 0; + } + + this.playerEntity.onGround = packetIn.isOnGround(); + this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + this.playerEntity.handleFalling(this.playerEntity.posY - d7, packetIn.isOnGround()); + } + else if (this.networkTickCount - this.field_175090_f > 20) + { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + } + } + } + } + + public void setPlayerLocation(double x, double y, double z, float yaw, float pitch) + { + this.setPlayerLocation(x, y, z, yaw, pitch, Collections.emptySet()); + } + + public void setPlayerLocation(double x, double y, double z, float yaw, float pitch, Set relativeSet) + { + this.hasMoved = false; + this.lastPosX = x; + this.lastPosY = y; + this.lastPosZ = z; + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.X)) + { + this.lastPosX += this.playerEntity.posX; + } + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Y)) + { + this.lastPosY += this.playerEntity.posY; + } + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Z)) + { + this.lastPosZ += this.playerEntity.posZ; + } + + float f = yaw; + float f1 = pitch; + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT)) + { + f = yaw + this.playerEntity.rotationYaw; + } + + if (relativeSet.contains(S08PacketPlayerPosLook.EnumFlags.X_ROT)) + { + f1 = pitch + this.playerEntity.rotationPitch; + } + + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, f, f1); + this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(x, y, z, yaw, pitch, relativeSet)); + } + + public void processPlayerDigging(C07PacketPlayerDigging packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + BlockPos blockpos = packetIn.getPosition(); + this.playerEntity.markPlayerActive(); + + switch (packetIn.getStatus()) + { + case DROP_ITEM: + if (!this.playerEntity.isSpectator()) + { + this.playerEntity.dropOneItem(false); + } + + return; + + case DROP_ALL_ITEMS: + if (!this.playerEntity.isSpectator()) + { + this.playerEntity.dropOneItem(true); + } + + return; + + case RELEASE_USE_ITEM: + this.playerEntity.stopUsingItem(); + return; + + case START_DESTROY_BLOCK: + case ABORT_DESTROY_BLOCK: + case STOP_DESTROY_BLOCK: + double d0 = this.playerEntity.posX - ((double)blockpos.getX() + 0.5D); + double d1 = this.playerEntity.posY - ((double)blockpos.getY() + 0.5D) + 1.5D; + double d2 = this.playerEntity.posZ - ((double)blockpos.getZ() + 0.5D); + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d3 > 36.0D) + { + return; + } + else if (blockpos.getY() >= this.serverController.getBuildLimit()) + { + return; + } + else + { + if (packetIn.getStatus() == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) + { + if (!this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos)) + { + this.playerEntity.theItemInWorldManager.onBlockClicked(blockpos, packetIn.getFacing()); + } + else + { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(worldserver, blockpos)); + } + } + else + { + if (packetIn.getStatus() == C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK) + { + this.playerEntity.theItemInWorldManager.blockRemoving(blockpos); + } + else if (packetIn.getStatus() == C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK) + { + this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(); + } + + if (worldserver.getBlockState(blockpos).getBlock().getMaterial() != Material.air) + { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(worldserver, blockpos)); + } + } + + return; + } + + default: + throw new IllegalArgumentException("Invalid player action"); + } + } + + public void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + ItemStack itemstack = this.playerEntity.inventory.getCurrentItem(); + boolean flag = false; + BlockPos blockpos = packetIn.getPosition(); + EnumFacing enumfacing = EnumFacing.getFront(packetIn.getPlacedBlockDirection()); + this.playerEntity.markPlayerActive(); + + if (packetIn.getPlacedBlockDirection() == 255) + { + if (itemstack == null) + { + return; + } + + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); + } + else if (blockpos.getY() < this.serverController.getBuildLimit() - 1 || enumfacing != EnumFacing.UP && blockpos.getY() < this.serverController.getBuildLimit()) + { + if (this.hasMoved && this.playerEntity.getDistanceSq((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D) < 64.0D && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos)) + { + this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ()); + } + + flag = true; + } + else + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("build.tooHigh", new Object[] {Integer.valueOf(this.serverController.getBuildLimit())}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + this.playerEntity.playerNetServerHandler.sendPacket(new S02PacketChat(chatcomponenttranslation)); + flag = true; + } + + if (flag) + { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(worldserver, blockpos)); + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(worldserver, blockpos.offset(enumfacing))); + } + + itemstack = this.playerEntity.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.stackSize == 0) + { + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = null; + itemstack = null; + } + + if (itemstack == null || itemstack.getMaxItemUseDuration() == 0) + { + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot slot = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.isChangingQuantityOnly = false; + + if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.getStack())) + { + this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); + } + } + } + + public void handleSpectate(C18PacketSpectate packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + + if (this.playerEntity.isSpectator()) + { + Entity entity = null; + + for (WorldServer worldserver : this.serverController.worldServers) + { + if (worldserver != null) + { + entity = packetIn.getEntity(worldserver); + + if (entity != null) + { + break; + } + } + } + + if (entity != null) + { + this.playerEntity.setSpectatingEntity(this.playerEntity); + this.playerEntity.mountEntity((Entity)null); + + if (entity.worldObj != this.playerEntity.worldObj) + { + WorldServer worldserver1 = this.playerEntity.getServerForPlayer(); + WorldServer worldserver2 = (WorldServer)entity.worldObj; + this.playerEntity.dimension = entity.dimension; + this.sendPacket(new S07PacketRespawn(this.playerEntity.dimension, worldserver1.getDifficulty(), worldserver1.getWorldInfo().getTerrainType(), this.playerEntity.theItemInWorldManager.getGameType())); + worldserver1.removePlayerEntityDangerously(this.playerEntity); + this.playerEntity.isDead = false; + this.playerEntity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); + + if (this.playerEntity.isEntityAlive()) + { + worldserver1.updateEntityWithOptionalForce(this.playerEntity, false); + worldserver2.spawnEntityInWorld(this.playerEntity); + worldserver2.updateEntityWithOptionalForce(this.playerEntity, false); + } + + this.playerEntity.setWorld(worldserver2); + this.serverController.getConfigurationManager().preparePlayer(this.playerEntity, worldserver1); + this.playerEntity.setPositionAndUpdate(entity.posX, entity.posY, entity.posZ); + this.playerEntity.theItemInWorldManager.setWorld(worldserver2); + this.serverController.getConfigurationManager().updateTimeAndWeatherForPlayer(this.playerEntity, worldserver2); + this.serverController.getConfigurationManager().syncPlayerInventory(this.playerEntity); + } + else + { + this.playerEntity.setPositionAndUpdate(entity.posX, entity.posY, entity.posZ); + } + } + } + } + + public void handleResourcePackStatus(C19PacketResourcePackStatus packetIn) + { + } + + public void onDisconnect(IChatComponent reason) + { + logger.info(this.playerEntity.getName() + " lost connection: " + reason); + this.serverController.refreshStatusNextTick(); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.left", new Object[] {this.playerEntity.getDisplayName()}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.serverController.getConfigurationManager().sendChatMsg(chatcomponenttranslation); + this.playerEntity.mountEntityAndWakeUp(); + this.serverController.getConfigurationManager().playerLoggedOut(this.playerEntity); + + if (this.serverController.isSinglePlayer() && this.playerEntity.getName().equals(this.serverController.getServerOwner())) + { + logger.info("Stopping singleplayer server as player logged out"); + this.serverController.initiateShutdown(); + } + } + + public void sendPacket(final Packet packetIn) + { + if (packetIn instanceof S02PacketChat) + { + S02PacketChat s02packetchat = (S02PacketChat)packetIn; + EntityPlayer.EnumChatVisibility entityplayer$enumchatvisibility = this.playerEntity.getChatVisibility(); + + if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.HIDDEN) + { + return; + } + + if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.SYSTEM && !s02packetchat.isChat()) + { + return; + } + } + + try + { + this.netManager.sendPacket(packetIn); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Sending packet"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Packet being sent"); + crashreportcategory.addCrashSectionCallable("Packet class", new Callable() + { + public String call() throws Exception + { + return packetIn.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + } + + public void processHeldItemChange(C09PacketHeldItemChange packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + + if (packetIn.getSlotId() >= 0 && packetIn.getSlotId() < InventoryPlayer.getHotbarSize()) + { + this.playerEntity.inventory.currentItem = packetIn.getSlotId(); + this.playerEntity.markPlayerActive(); + } + else + { + logger.warn(this.playerEntity.getName() + " tried to set an invalid carried item"); + } + } + + public void processChatMessage(C01PacketChatMessage packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + + if (this.playerEntity.getChatVisibility() == EntityPlayer.EnumChatVisibility.HIDDEN) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.cannotSend", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + this.sendPacket(new S02PacketChat(chatcomponenttranslation)); + } + else + { + this.playerEntity.markPlayerActive(); + String s = packetIn.getMessage(); + s = StringUtils.normalizeSpace(s); + + for (int i = 0; i < s.length(); ++i) + { + if (!ChatAllowedCharacters.isAllowedCharacter(s.charAt(i))) + { + this.kickPlayerFromServer("Illegal characters in chat"); + return; + } + } + + if (s.startsWith("/")) + { + this.handleSlashCommand(s); + } + else + { + IChatComponent ichatcomponent = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.getDisplayName(), s}); + this.serverController.getConfigurationManager().sendChatMsgImpl(ichatcomponent, false); + } + + this.chatSpamThresholdCount += 20; + + if (this.chatSpamThresholdCount > 200 && !this.serverController.getConfigurationManager().canSendCommands(this.playerEntity.getGameProfile())) + { + this.kickPlayerFromServer("disconnect.spam"); + } + } + } + + private void handleSlashCommand(String command) + { + this.serverController.getCommandManager().executeCommand(this.playerEntity, command); + } + + public void handleAnimation(C0APacketAnimation packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.markPlayerActive(); + this.playerEntity.swingItem(); + } + + public void processEntityAction(C0BPacketEntityAction packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.markPlayerActive(); + + switch (packetIn.getAction()) + { + case START_SNEAKING: + this.playerEntity.setSneaking(true); + break; + + case STOP_SNEAKING: + this.playerEntity.setSneaking(false); + break; + + case START_SPRINTING: + this.playerEntity.setSprinting(true); + break; + + case STOP_SPRINTING: + this.playerEntity.setSprinting(false); + break; + + case STOP_SLEEPING: + this.playerEntity.wakeUpPlayer(false, true, true); + this.hasMoved = false; + break; + + case RIDING_JUMP: + if (this.playerEntity.ridingEntity instanceof EntityHorse) + { + ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(packetIn.getAuxData()); + } + + break; + + case OPEN_INVENTORY: + if (this.playerEntity.ridingEntity instanceof EntityHorse) + { + ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity); + } + + break; + + default: + throw new IllegalArgumentException("Invalid client command!"); + } + } + + public void processUseEntity(C02PacketUseEntity packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + Entity entity = packetIn.getEntityFromWorld(worldserver); + this.playerEntity.markPlayerActive(); + + if (entity != null) + { + boolean flag = this.playerEntity.canEntityBeSeen(entity); + double d0 = 36.0D; + + if (!flag) + { + d0 = 9.0D; + } + + if (this.playerEntity.getDistanceSqToEntity(entity) < d0) + { + if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT) + { + this.playerEntity.interactWith(entity); + } + else if (packetIn.getAction() == C02PacketUseEntity.Action.INTERACT_AT) + { + entity.interactAt(this.playerEntity, packetIn.getHitVec()); + } + else if (packetIn.getAction() == C02PacketUseEntity.Action.ATTACK) + { + if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity) + { + this.kickPlayerFromServer("Attempting to attack an invalid entity"); + this.serverController.logWarning("Player " + this.playerEntity.getName() + " tried to attack an invalid entity"); + return; + } + + this.playerEntity.attackTargetEntityWithCurrentItem(entity); + } + } + } + } + + public void processClientStatus(C16PacketClientStatus packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.markPlayerActive(); + C16PacketClientStatus.EnumState c16packetclientstatus$enumstate = packetIn.getStatus(); + + switch (c16packetclientstatus$enumstate) + { + case PERFORM_RESPAWN: + if (this.playerEntity.playerConqueredTheEnd) + { + this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, true); + } + else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) + { + if (this.serverController.isSinglePlayer() && this.playerEntity.getName().equals(this.serverController.getServerOwner())) + { + this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + this.serverController.deleteWorldAndStopServer(); + } + else + { + UserListBansEntry userlistbansentry = new UserListBansEntry(this.playerEntity.getGameProfile(), (Date)null, "(You just lost the game)", (Date)null, "Death in Hardcore"); + this.serverController.getConfigurationManager().getBannedPlayers().addEntry(userlistbansentry); + this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + } + } + else + { + if (this.playerEntity.getHealth() > 0.0F) + { + return; + } + + this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false); + } + + break; + + case REQUEST_STATS: + this.playerEntity.getStatFile().func_150876_a(this.playerEntity); + break; + + case OPEN_INVENTORY_ACHIEVEMENT: + this.playerEntity.triggerAchievement(AchievementList.openInventory); + } + } + + public void processCloseWindow(C0DPacketCloseWindow packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.closeContainer(); + } + + public void processClickWindow(C0EPacketClickWindow packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.markPlayerActive(); + + if (this.playerEntity.openContainer.windowId == packetIn.getWindowId() && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) + { + if (this.playerEntity.isSpectator()) + { + List list = Lists.newArrayList(); + + for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i) + { + list.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(i)).getStack()); + } + + this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list); + } + else + { + ItemStack itemstack = this.playerEntity.openContainer.slotClick(packetIn.getSlotId(), packetIn.getUsedButton(), packetIn.getMode(), this.playerEntity); + + if (ItemStack.areItemStacksEqual(packetIn.getClickedItem(), itemstack)) + { + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true)); + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.updateHeldItem(); + this.playerEntity.isChangingQuantityOnly = false; + } + else + { + this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(packetIn.getActionNumber())); + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), false)); + this.playerEntity.openContainer.setCanCraft(this.playerEntity, false); + List list1 = Lists.newArrayList(); + + for (int j = 0; j < this.playerEntity.openContainer.inventorySlots.size(); ++j) + { + list1.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(j)).getStack()); + } + + this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, list1); + } + } + } + } + + public void processEnchantItem(C11PacketEnchantItem packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.markPlayerActive(); + + if (this.playerEntity.openContainer.windowId == packetIn.getWindowId() && this.playerEntity.openContainer.getCanCraft(this.playerEntity) && !this.playerEntity.isSpectator()) + { + this.playerEntity.openContainer.enchantItem(this.playerEntity, packetIn.getButton()); + this.playerEntity.openContainer.detectAndSendChanges(); + } + } + + public void processCreativeInventoryAction(C10PacketCreativeInventoryAction packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + + if (this.playerEntity.theItemInWorldManager.isCreative()) + { + boolean flag = packetIn.getSlotId() < 0; + ItemStack itemstack = packetIn.getStack(); + + if (itemstack != null && itemstack.hasTagCompound() && itemstack.getTagCompound().hasKey("BlockEntityTag", 10)) + { + NBTTagCompound nbttagcompound = itemstack.getTagCompound().getCompoundTag("BlockEntityTag"); + + if (nbttagcompound.hasKey("x") && nbttagcompound.hasKey("y") && nbttagcompound.hasKey("z")) + { + BlockPos blockpos = new BlockPos(nbttagcompound.getInteger("x"), nbttagcompound.getInteger("y"), nbttagcompound.getInteger("z")); + TileEntity tileentity = this.playerEntity.worldObj.getTileEntity(blockpos); + + if (tileentity != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound1); + nbttagcompound1.removeTag("x"); + nbttagcompound1.removeTag("y"); + nbttagcompound1.removeTag("z"); + itemstack.setTagInfo("BlockEntityTag", nbttagcompound1); + } + } + } + + boolean flag1 = packetIn.getSlotId() >= 1 && packetIn.getSlotId() < 36 + InventoryPlayer.getHotbarSize(); + boolean flag2 = itemstack == null || itemstack.getItem() != null; + boolean flag3 = itemstack == null || itemstack.getMetadata() >= 0 && itemstack.stackSize <= 64 && itemstack.stackSize > 0; + + if (flag1 && flag2 && flag3) + { + if (itemstack == null) + { + this.playerEntity.inventoryContainer.putStackInSlot(packetIn.getSlotId(), (ItemStack)null); + } + else + { + this.playerEntity.inventoryContainer.putStackInSlot(packetIn.getSlotId(), itemstack); + } + + this.playerEntity.inventoryContainer.setCanCraft(this.playerEntity, true); + } + else if (flag && flag2 && flag3 && this.itemDropThreshold < 200) + { + this.itemDropThreshold += 20; + EntityItem entityitem = this.playerEntity.dropPlayerItemWithRandomChoice(itemstack, true); + + if (entityitem != null) + { + entityitem.setAgeToCreativeDespawnTime(); + } + } + } + } + + public void processConfirmTransaction(C0FPacketConfirmTransaction packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + Short oshort = (Short)this.field_147372_n.lookup(this.playerEntity.openContainer.windowId); + + if (oshort != null && packetIn.getUid() == oshort.shortValue() && this.playerEntity.openContainer.windowId == packetIn.getWindowId() && !this.playerEntity.openContainer.getCanCraft(this.playerEntity) && !this.playerEntity.isSpectator()) + { + this.playerEntity.openContainer.setCanCraft(this.playerEntity, true); + } + } + + public void processUpdateSign(C12PacketUpdateSign packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.markPlayerActive(); + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + BlockPos blockpos = packetIn.getPosition(); + + if (worldserver.isBlockLoaded(blockpos)) + { + TileEntity tileentity = worldserver.getTileEntity(blockpos); + + if (!(tileentity instanceof TileEntitySign)) + { + return; + } + + TileEntitySign tileentitysign = (TileEntitySign)tileentity; + + if (!tileentitysign.getIsEditable() || tileentitysign.getPlayer() != this.playerEntity) + { + this.serverController.logWarning("Player " + this.playerEntity.getName() + " just tried to change non-editable sign"); + return; + } + + IChatComponent[] aichatcomponent = packetIn.getLines(); + + for (int i = 0; i < aichatcomponent.length; ++i) + { + tileentitysign.signText[i] = new ChatComponentText(EnumChatFormatting.getTextWithoutFormattingCodes(aichatcomponent[i].getUnformattedText())); + } + + tileentitysign.markDirty(); + worldserver.markBlockForUpdate(blockpos); + } + } + + public void processKeepAlive(C00PacketKeepAlive packetIn) + { + if (packetIn.getKey() == this.field_147378_h) + { + int i = (int)(this.currentTimeMillis() - this.lastPingTime); + this.playerEntity.ping = (this.playerEntity.ping * 3 + i) / 4; + } + } + + private long currentTimeMillis() + { + return System.nanoTime() / 1000000L; + } + + public void processPlayerAbilities(C13PacketPlayerAbilities packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.capabilities.isFlying = packetIn.isFlying() && this.playerEntity.capabilities.allowFlying; + } + + public void processTabComplete(C14PacketTabComplete packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + List list = Lists.newArrayList(); + + for (String s : this.serverController.getTabCompletions(this.playerEntity, packetIn.getMessage(), packetIn.getTargetBlock())) + { + list.add(s); + } + + this.playerEntity.playerNetServerHandler.sendPacket(new S3APacketTabComplete((String[])list.toArray(new String[list.size()]))); + } + + public void processClientSettings(C15PacketClientSettings packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + this.playerEntity.handleClientSettings(packetIn); + } + + public void processVanilla250Packet(C17PacketCustomPayload packetIn) + { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); + + if ("MC|BEdit".equals(packetIn.getChannelName())) + { + PacketBuffer packetbuffer3 = new PacketBuffer(Unpooled.wrappedBuffer((ByteBuf)packetIn.getBufferData())); + + try + { + ItemStack itemstack1 = packetbuffer3.readItemStackFromBuffer(); + + if (itemstack1 != null) + { + if (!ItemWritableBook.isNBTValid(itemstack1.getTagCompound())) + { + throw new IOException("Invalid book tag!"); + } + + ItemStack itemstack3 = this.playerEntity.inventory.getCurrentItem(); + + if (itemstack3 == null) + { + return; + } + + if (itemstack1.getItem() == Items.writable_book && itemstack1.getItem() == itemstack3.getItem()) + { + itemstack3.setTagInfo("pages", itemstack1.getTagCompound().getTagList("pages", 8)); + } + + return; + } + } + catch (Exception exception3) + { + logger.error((String)"Couldn\'t handle book info", (Throwable)exception3); + return; + } + finally + { + packetbuffer3.release(); + } + + return; + } + else if ("MC|BSign".equals(packetIn.getChannelName())) + { + PacketBuffer packetbuffer2 = new PacketBuffer(Unpooled.wrappedBuffer((ByteBuf)packetIn.getBufferData())); + + try + { + ItemStack itemstack = packetbuffer2.readItemStackFromBuffer(); + + if (itemstack != null) + { + if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound())) + { + throw new IOException("Invalid book tag!"); + } + + ItemStack itemstack2 = this.playerEntity.inventory.getCurrentItem(); + + if (itemstack2 == null) + { + return; + } + + if (itemstack.getItem() == Items.written_book && itemstack2.getItem() == Items.writable_book) + { + itemstack2.setTagInfo("author", new NBTTagString(this.playerEntity.getName())); + itemstack2.setTagInfo("title", new NBTTagString(itemstack.getTagCompound().getString("title"))); + itemstack2.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8)); + itemstack2.setItem(Items.written_book); + } + + return; + } + } + catch (Exception exception4) + { + logger.error((String)"Couldn\'t sign book", (Throwable)exception4); + return; + } + finally + { + packetbuffer2.release(); + } + + return; + } + else if ("MC|TrSel".equals(packetIn.getChannelName())) + { + try + { + int i = packetIn.getBufferData().readInt(); + Container container = this.playerEntity.openContainer; + + if (container instanceof ContainerMerchant) + { + ((ContainerMerchant)container).setCurrentRecipeIndex(i); + } + } + catch (Exception exception2) + { + logger.error((String)"Couldn\'t select trade", (Throwable)exception2); + } + } + else if ("MC|AdvCdm".equals(packetIn.getChannelName())) + { + if (!this.serverController.isCommandBlockEnabled()) + { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notEnabled", new Object[0])); + } + else if (this.playerEntity.canCommandSenderUseCommand(2, "") && this.playerEntity.capabilities.isCreativeMode) + { + PacketBuffer packetbuffer = packetIn.getBufferData(); + + try + { + int j = packetbuffer.readByte(); + CommandBlockLogic commandblocklogic = null; + + if (j == 0) + { + TileEntity tileentity = this.playerEntity.worldObj.getTileEntity(new BlockPos(packetbuffer.readInt(), packetbuffer.readInt(), packetbuffer.readInt())); + + if (tileentity instanceof TileEntityCommandBlock) + { + commandblocklogic = ((TileEntityCommandBlock)tileentity).getCommandBlockLogic(); + } + } + else if (j == 1) + { + Entity entity = this.playerEntity.worldObj.getEntityByID(packetbuffer.readInt()); + + if (entity instanceof EntityMinecartCommandBlock) + { + commandblocklogic = ((EntityMinecartCommandBlock)entity).getCommandBlockLogic(); + } + } + + String s1 = packetbuffer.readStringFromBuffer(packetbuffer.readableBytes()); + boolean flag = packetbuffer.readBoolean(); + + if (commandblocklogic != null) + { + commandblocklogic.setCommand(s1); + commandblocklogic.setTrackOutput(flag); + + if (!flag) + { + commandblocklogic.setLastOutput((IChatComponent)null); + } + + commandblocklogic.updateCommand(); + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.setCommand.success", new Object[] {s1})); + } + } + catch (Exception exception1) + { + logger.error((String)"Couldn\'t set command block", (Throwable)exception1); + } + finally + { + packetbuffer.release(); + } + } + else + { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notAllowed", new Object[0])); + } + } + else if ("MC|Beacon".equals(packetIn.getChannelName())) + { + if (this.playerEntity.openContainer instanceof ContainerBeacon) + { + try + { + PacketBuffer packetbuffer1 = packetIn.getBufferData(); + int k = packetbuffer1.readInt(); + int l = packetbuffer1.readInt(); + ContainerBeacon containerbeacon = (ContainerBeacon)this.playerEntity.openContainer; + Slot slot = containerbeacon.getSlot(0); + + if (slot.getHasStack()) + { + slot.decrStackSize(1); + IInventory iinventory = containerbeacon.func_180611_e(); + iinventory.setField(1, k); + iinventory.setField(2, l); + iinventory.markDirty(); + } + } + catch (Exception exception) + { + logger.error((String)"Couldn\'t set beacon", (Throwable)exception); + } + } + } + else if ("MC|ItemName".equals(packetIn.getChannelName()) && this.playerEntity.openContainer instanceof ContainerRepair) + { + ContainerRepair containerrepair = (ContainerRepair)this.playerEntity.openContainer; + + if (packetIn.getBufferData() != null && packetIn.getBufferData().readableBytes() >= 1) + { + String s = ChatAllowedCharacters.filterAllowedCharacters(packetIn.getBufferData().readStringFromBuffer(32767)); + + if (s.length() <= 30) + { + containerrepair.updateItemName(s); + } + } + else + { + containerrepair.updateItemName(""); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NettyCompressionDecoder.java b/Client-1.8.9/src/main/java/net/minecraft/network/NettyCompressionDecoder.java new file mode 100644 index 0000000..7596a28 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NettyCompressionDecoder.java @@ -0,0 +1,61 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.handler.codec.DecoderException; +import java.util.List; +import java.util.zip.DataFormatException; +import java.util.zip.Inflater; + +public class NettyCompressionDecoder extends ByteToMessageDecoder +{ + private final Inflater inflater; + private int treshold; + + public NettyCompressionDecoder(int treshold) + { + this.treshold = treshold; + this.inflater = new Inflater(); + } + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws DataFormatException, Exception + { + if (p_decode_2_.readableBytes() != 0) + { + PacketBuffer packetbuffer = new PacketBuffer(p_decode_2_); + int i = packetbuffer.readVarIntFromBuffer(); + + if (i == 0) + { + p_decode_3_.add(packetbuffer.readBytes(packetbuffer.readableBytes())); + } + else + { + if (i < this.treshold) + { + throw new DecoderException("Badly compressed packet - size of " + i + " is below server threshold of " + this.treshold); + } + + if (i > 2097152) + { + throw new DecoderException("Badly compressed packet - size of " + i + " is larger than protocol maximum of " + 2097152); + } + + byte[] abyte = new byte[packetbuffer.readableBytes()]; + packetbuffer.readBytes(abyte); + this.inflater.setInput(abyte); + byte[] abyte1 = new byte[i]; + this.inflater.inflate(abyte1); + p_decode_3_.add(Unpooled.wrappedBuffer(abyte1)); + this.inflater.reset(); + } + } + } + + public void setCompressionTreshold(int treshold) + { + this.treshold = treshold; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NettyCompressionEncoder.java b/Client-1.8.9/src/main/java/net/minecraft/network/NettyCompressionEncoder.java new file mode 100644 index 0000000..8aca97f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NettyCompressionEncoder.java @@ -0,0 +1,52 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import java.util.zip.Deflater; + +public class NettyCompressionEncoder extends MessageToByteEncoder +{ + private final byte[] buffer = new byte[8192]; + private final Deflater deflater; + private int treshold; + + public NettyCompressionEncoder(int treshold) + { + this.treshold = treshold; + this.deflater = new Deflater(); + } + + protected void encode(ChannelHandlerContext p_encode_1_, ByteBuf p_encode_2_, ByteBuf p_encode_3_) throws Exception + { + int i = p_encode_2_.readableBytes(); + PacketBuffer packetbuffer = new PacketBuffer(p_encode_3_); + + if (i < this.treshold) + { + packetbuffer.writeVarIntToBuffer(0); + packetbuffer.writeBytes(p_encode_2_); + } + else + { + byte[] abyte = new byte[i]; + p_encode_2_.readBytes(abyte); + packetbuffer.writeVarIntToBuffer(abyte.length); + this.deflater.setInput(abyte, 0, i); + this.deflater.finish(); + + while (!this.deflater.finished()) + { + int j = this.deflater.deflate(this.buffer); + packetbuffer.writeBytes((byte[])this.buffer, 0, j); + } + + this.deflater.reset(); + } + } + + public void setCompressionTreshold(int treshold) + { + this.treshold = treshold; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptingDecoder.java b/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptingDecoder.java new file mode 100644 index 0000000..11bab63 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptingDecoder.java @@ -0,0 +1,23 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToMessageDecoder; +import java.util.List; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptingDecoder extends MessageToMessageDecoder +{ + private final NettyEncryptionTranslator decryptionCodec; + + public NettyEncryptingDecoder(Cipher cipher) + { + this.decryptionCodec = new NettyEncryptionTranslator(cipher); + } + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws ShortBufferException, Exception + { + p_decode_3_.add(this.decryptionCodec.decipher(p_decode_1_, p_decode_2_)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptingEncoder.java b/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptingEncoder.java new file mode 100644 index 0000000..e4ec004 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptingEncoder.java @@ -0,0 +1,22 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptingEncoder extends MessageToByteEncoder +{ + private final NettyEncryptionTranslator encryptionCodec; + + public NettyEncryptingEncoder(Cipher cipher) + { + this.encryptionCodec = new NettyEncryptionTranslator(cipher); + } + + protected void encode(ChannelHandlerContext p_encode_1_, ByteBuf p_encode_2_, ByteBuf p_encode_3_) throws ShortBufferException, Exception + { + this.encryptionCodec.cipher(p_encode_2_, p_encode_3_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptionTranslator.java b/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptionTranslator.java new file mode 100644 index 0000000..76dba4d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NettyEncryptionTranslator.java @@ -0,0 +1,54 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptionTranslator +{ + private final Cipher cipher; + private byte[] field_150505_b = new byte[0]; + private byte[] field_150506_c = new byte[0]; + + protected NettyEncryptionTranslator(Cipher cipherIn) + { + this.cipher = cipherIn; + } + + private byte[] func_150502_a(ByteBuf buf) + { + int i = buf.readableBytes(); + + if (this.field_150505_b.length < i) + { + this.field_150505_b = new byte[i]; + } + + buf.readBytes((byte[])this.field_150505_b, 0, i); + return this.field_150505_b; + } + + protected ByteBuf decipher(ChannelHandlerContext ctx, ByteBuf buffer) throws ShortBufferException + { + int i = buffer.readableBytes(); + byte[] abyte = this.func_150502_a(buffer); + ByteBuf bytebuf = ctx.alloc().heapBuffer(this.cipher.getOutputSize(i)); + bytebuf.writerIndex(this.cipher.update(abyte, 0, i, bytebuf.array(), bytebuf.arrayOffset())); + return bytebuf; + } + + protected void cipher(ByteBuf in, ByteBuf out) throws ShortBufferException + { + int i = in.readableBytes(); + byte[] abyte = this.func_150502_a(in); + int j = this.cipher.getOutputSize(i); + + if (this.field_150506_c.length < j) + { + this.field_150506_c = new byte[j]; + } + + out.writeBytes((byte[])this.field_150506_c, 0, this.cipher.update(abyte, 0, i, this.field_150506_c)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NetworkManager.java b/Client-1.8.9/src/main/java/net/minecraft/network/NetworkManager.java new file mode 100644 index 0000000..afb0b79 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NetworkManager.java @@ -0,0 +1,448 @@ +package net.minecraft.network; + +import com.google.common.collect.Queues; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.*; +import io.netty.channel.epoll.Epoll; +import io.netty.channel.epoll.EpollEventLoopGroup; +import io.netty.channel.epoll.EpollSocketChannel; +import io.netty.channel.local.LocalChannel; +import io.netty.channel.local.LocalEventLoopGroup; +import io.netty.channel.local.LocalServerChannel; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.handler.timeout.TimeoutException; +import io.netty.util.AttributeKey; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import lombok.Getter; +import net.minecraft.util.*; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +import javax.crypto.SecretKey; +import java.net.InetAddress; +import java.net.SocketAddress; +import java.util.Queue; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +public class NetworkManager extends SimpleChannelInboundHandler +{ + private static final Logger logger = LogManager.getLogger(); + public static final Marker logMarkerNetwork = MarkerManager.getMarker("NETWORK"); + public static final Marker logMarkerPackets = MarkerManager.getMarker("NETWORK_PACKETS", logMarkerNetwork); + public static final AttributeKey attrKeyConnectionState = AttributeKey.valueOf("protocol"); + public static final LazyLoadBase CLIENT_NIO_EVENTLOOP = new LazyLoadBase() + { + protected NioEventLoopGroup load() + { + return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Client IO #%d").setDaemon(true).build()); + } + }; + public static final LazyLoadBase CLIENT_EPOLL_EVENTLOOP = new LazyLoadBase() + { + protected EpollEventLoopGroup load() + { + return new EpollEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Epoll Client IO #%d").setDaemon(true).build()); + } + }; + public static final LazyLoadBase CLIENT_LOCAL_EVENTLOOP = new LazyLoadBase() + { + protected LocalEventLoopGroup load() + { + return new LocalEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Client IO #%d").setDaemon(true).build()); + } + }; + private final EnumPacketDirection direction; + private final Queue outboundPacketsQueue = Queues.newConcurrentLinkedQueue(); + private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(); + @Getter private Channel channel; + private SocketAddress socketAddress; + private INetHandler packetListener; + private IChatComponent terminationReason; + private boolean isEncrypted; + private boolean disconnected; + + public NetworkManager(EnumPacketDirection packetDirection) + { + this.direction = packetDirection; + } + + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception + { + super.channelActive(p_channelActive_1_); + this.channel = p_channelActive_1_.channel(); + this.socketAddress = this.channel.remoteAddress(); + + try + { + this.setConnectionState(EnumConnectionState.HANDSHAKING); + } + catch (Throwable throwable) + { + logger.fatal((Object)throwable); + } + } + + public void setConnectionState(EnumConnectionState newState) + { + this.channel.attr(attrKeyConnectionState).set(newState); + this.channel.config().setAutoRead(true); + logger.debug("Enabled auto read"); + } + + public void channelInactive(ChannelHandlerContext p_channelInactive_1_) throws Exception + { + this.closeChannel(new ChatComponentTranslation("disconnect.endOfStream", new Object[0])); + } + + public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) throws Exception + { + ChatComponentTranslation chatcomponenttranslation; + + if (p_exceptionCaught_2_ instanceof TimeoutException) + { + chatcomponenttranslation = new ChatComponentTranslation("disconnect.timeout", new Object[0]); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Internal Exception: " + p_exceptionCaught_2_}); + } + + this.closeChannel(chatcomponenttranslation); + } + + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet p_channelRead0_2_) throws Exception + { + if (this.channel.isOpen()) + { + try + { + p_channelRead0_2_.processPacket(this.packetListener); + } + catch (ThreadQuickExitException var4) + { + ; + } + } + } + + public void setNetHandler(INetHandler handler) + { + Validate.notNull(handler, "packetListener", new Object[0]); + logger.debug("Set listener of {} to {}", new Object[] {this, handler}); + this.packetListener = handler; + } + + public void sendPacket(Packet packetIn) + { + if (this.isChannelOpen()) + { + this.flushOutboundQueue(); + this.dispatchPacket(packetIn, (GenericFutureListener > [])null); + } + else + { + this.readWriteLock.writeLock().lock(); + + try + { + this.outboundPacketsQueue.add(new NetworkManager.InboundHandlerTuplePacketListener(packetIn, (GenericFutureListener[])null)); + } + finally + { + this.readWriteLock.writeLock().unlock(); + } + } + } + + public void sendPacket(Packet packetIn, GenericFutureListener > listener, GenericFutureListener > ... listeners) + { + if (this.isChannelOpen()) + { + this.flushOutboundQueue(); + this.dispatchPacket(packetIn, (GenericFutureListener[])ArrayUtils.add(listeners, 0, listener)); + } + else + { + this.readWriteLock.writeLock().lock(); + + try + { + this.outboundPacketsQueue.add(new NetworkManager.InboundHandlerTuplePacketListener(packetIn, (GenericFutureListener[])ArrayUtils.add(listeners, 0, listener))); + } + finally + { + this.readWriteLock.writeLock().unlock(); + } + } + } + + private void dispatchPacket(final Packet inPacket, final GenericFutureListener > [] futureListeners) + { + final EnumConnectionState enumconnectionstate = EnumConnectionState.getFromPacket(inPacket); + final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.channel.attr(attrKeyConnectionState).get(); + + if (enumconnectionstate1 != enumconnectionstate) + { + logger.debug("Disabled auto read"); + this.channel.config().setAutoRead(false); + } + + if (this.channel.eventLoop().inEventLoop()) + { + if (enumconnectionstate != enumconnectionstate1) + { + this.setConnectionState(enumconnectionstate); + } + + ChannelFuture channelfuture = this.channel.writeAndFlush(inPacket); + + if (futureListeners != null) + { + channelfuture.addListeners(futureListeners); + } + + channelfuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + else + { + this.channel.eventLoop().execute(new Runnable() + { + public void run() + { + if (enumconnectionstate != enumconnectionstate1) + { + NetworkManager.this.setConnectionState(enumconnectionstate); + } + + ChannelFuture channelfuture1 = NetworkManager.this.channel.writeAndFlush(inPacket); + + if (futureListeners != null) + { + channelfuture1.addListeners(futureListeners); + } + + channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + }); + } + } + + private void flushOutboundQueue() + { + if (this.channel != null && this.channel.isOpen()) + { + this.readWriteLock.readLock().lock(); + + try + { + while (!this.outboundPacketsQueue.isEmpty()) + { + NetworkManager.InboundHandlerTuplePacketListener networkmanager$inboundhandlertuplepacketlistener = (NetworkManager.InboundHandlerTuplePacketListener)this.outboundPacketsQueue.poll(); + this.dispatchPacket(networkmanager$inboundhandlertuplepacketlistener.packet, networkmanager$inboundhandlertuplepacketlistener.futureListeners); + } + } + finally + { + this.readWriteLock.readLock().unlock(); + } + } + } + + public void processReceivedPackets() + { + this.flushOutboundQueue(); + + if (this.packetListener instanceof ITickable) + { + ((ITickable)this.packetListener).update(); + } + + this.channel.flush(); + } + + public SocketAddress getRemoteAddress() + { + return this.socketAddress; + } + + public void closeChannel(IChatComponent message) + { + if (this.channel.isOpen()) + { + this.channel.close().awaitUninterruptibly(); + this.terminationReason = message; + } + } + + public boolean isLocalChannel() + { + return this.channel instanceof LocalChannel || this.channel instanceof LocalServerChannel; + } + + public static NetworkManager createNetworkManagerAndConnect(InetAddress address, int serverPort, boolean useNativeTransport) + { + final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND); + Class oclass; + LazyLoadBase lazyloadbase; + + if (Epoll.isAvailable() && useNativeTransport) + { + oclass = EpollSocketChannel.class; + lazyloadbase = CLIENT_EPOLL_EVENTLOOP; + } + else + { + oclass = NioSocketChannel.class; + lazyloadbase = CLIENT_NIO_EVENTLOOP; + } + + ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)lazyloadbase.getValue())).handler(new ChannelInitializer() + { + protected void initChannel(Channel p_initChannel_1_) throws Exception + { + try + { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(true)); + } + catch (ChannelException var3) + { + ; + } + + p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.CLIENTBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"packet_handler", (ChannelHandler)networkmanager); + } + })).channel(oclass)).connect(address, serverPort).syncUninterruptibly(); + return networkmanager; + } + + public static NetworkManager provideLocalClient(SocketAddress address) + { + final NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.CLIENTBOUND); + ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)CLIENT_LOCAL_EVENTLOOP.getValue())).handler(new ChannelInitializer() + { + protected void initChannel(Channel p_initChannel_1_) throws Exception + { + p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); + } + })).channel(LocalChannel.class)).connect(address).syncUninterruptibly(); + return networkmanager; + } + + public void enableEncryption(SecretKey key) + { + this.isEncrypted = true; + this.channel.pipeline().addBefore("splitter", "decrypt", new NettyEncryptingDecoder(CryptManager.createNetCipherInstance(2, key))); + this.channel.pipeline().addBefore("prepender", "encrypt", new NettyEncryptingEncoder(CryptManager.createNetCipherInstance(1, key))); + } + + public boolean getIsencrypted() + { + return this.isEncrypted; + } + + public boolean isChannelOpen() + { + return this.channel != null && this.channel.isOpen(); + } + + public boolean hasNoChannel() + { + return this.channel == null; + } + + public INetHandler getNetHandler() + { + return this.packetListener; + } + + public IChatComponent getExitMessage() + { + return this.terminationReason; + } + + public void disableAutoRead() + { + this.channel.config().setAutoRead(false); + } + + public void setCompressionTreshold(int treshold) + { + if (treshold >= 0) + { + if (this.channel.pipeline().get("decompress") instanceof NettyCompressionDecoder) + { + ((NettyCompressionDecoder)this.channel.pipeline().get("decompress")).setCompressionTreshold(treshold); + } + else + { + this.channel.pipeline().addBefore("decoder", "decompress", new NettyCompressionDecoder(treshold)); + } + + if (this.channel.pipeline().get("compress") instanceof NettyCompressionEncoder) + { + ((NettyCompressionEncoder)this.channel.pipeline().get("decompress")).setCompressionTreshold(treshold); + } + else + { + this.channel.pipeline().addBefore("encoder", "compress", new NettyCompressionEncoder(treshold)); + } + } + else + { + if (this.channel.pipeline().get("decompress") instanceof NettyCompressionDecoder) + { + this.channel.pipeline().remove("decompress"); + } + + if (this.channel.pipeline().get("compress") instanceof NettyCompressionEncoder) + { + this.channel.pipeline().remove("compress"); + } + } + } + + public void checkDisconnected() + { + if (this.channel != null && !this.channel.isOpen()) + { + if (!this.disconnected) + { + this.disconnected = true; + + if (this.getExitMessage() != null) + { + this.getNetHandler().onDisconnect(this.getExitMessage()); + } + else if (this.getNetHandler() != null) + { + this.getNetHandler().onDisconnect(new ChatComponentText("Disconnected")); + } + } + else + { + logger.warn("handleDisconnection() called twice"); + } + } + } + + static class InboundHandlerTuplePacketListener + { + private final Packet packet; + private final GenericFutureListener > [] futureListeners; + + public InboundHandlerTuplePacketListener(Packet inPacket, GenericFutureListener > ... inFutureListeners) + { + this.packet = inPacket; + this.futureListeners = inFutureListeners; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/NetworkSystem.java b/Client-1.8.9/src/main/java/net/minecraft/network/NetworkSystem.java new file mode 100644 index 0000000..4b7cf22 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/NetworkSystem.java @@ -0,0 +1,225 @@ +package net.minecraft.network; + +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelException; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.epoll.Epoll; +import io.netty.channel.epoll.EpollEventLoopGroup; +import io.netty.channel.epoll.EpollServerSocketChannel; +import io.netty.channel.local.LocalAddress; +import io.netty.channel.local.LocalEventLoopGroup; +import io.netty.channel.local.LocalServerChannel; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.ServerSocketChannel; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.IOException; +import java.net.InetAddress; +import java.net.SocketAddress; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.client.network.NetHandlerHandshakeMemory; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.NetHandlerHandshakeTCP; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.MessageDeserializer; +import net.minecraft.util.MessageDeserializer2; +import net.minecraft.util.MessageSerializer; +import net.minecraft.util.MessageSerializer2; +import net.minecraft.util.ReportedException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetworkSystem +{ + private static final Logger logger = LogManager.getLogger(); + public static final LazyLoadBase eventLoops = new LazyLoadBase() + { + protected NioEventLoopGroup load() + { + return new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Server IO #%d").setDaemon(true).build()); + } + }; + public static final LazyLoadBase SERVER_EPOLL_EVENTLOOP = new LazyLoadBase() + { + protected EpollEventLoopGroup load() + { + return new EpollEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Epoll Server IO #%d").setDaemon(true).build()); + } + }; + public static final LazyLoadBase SERVER_LOCAL_EVENTLOOP = new LazyLoadBase() + { + protected LocalEventLoopGroup load() + { + return new LocalEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Local Server IO #%d").setDaemon(true).build()); + } + }; + private final MinecraftServer mcServer; + public volatile boolean isAlive; + private final List endpoints = Collections.synchronizedList(Lists.newArrayList()); + private final List networkManagers = Collections.synchronizedList(Lists.newArrayList()); + + public NetworkSystem(MinecraftServer server) + { + this.mcServer = server; + this.isAlive = true; + } + + public void addLanEndpoint(InetAddress address, int port) throws IOException + { + synchronized (this.endpoints) + { + Class oclass; + LazyLoadBase lazyloadbase; + + if (Epoll.isAvailable() && this.mcServer.shouldUseNativeTransport()) + { + oclass = EpollServerSocketChannel.class; + lazyloadbase = SERVER_EPOLL_EVENTLOOP; + logger.info("Using epoll channel type"); + } + else + { + oclass = NioServerSocketChannel.class; + lazyloadbase = eventLoops; + logger.info("Using default channel type"); + } + + this.endpoints.add(((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(oclass)).childHandler(new ChannelInitializer() + { + protected void initChannel(Channel p_initChannel_1_) throws Exception + { + try + { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(true)); + } + catch (ChannelException var3) + { + ; + } + + p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); + NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); + NetworkSystem.this.networkManagers.add(networkmanager); + p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); + networkmanager.setNetHandler(new NetHandlerHandshakeTCP(NetworkSystem.this.mcServer, networkmanager)); + } + }).group((EventLoopGroup)lazyloadbase.getValue()).localAddress(address, port)).bind().syncUninterruptibly()); + } + } + + public SocketAddress addLocalEndpoint() + { + ChannelFuture channelfuture; + + synchronized (this.endpoints) + { + channelfuture = ((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(LocalServerChannel.class)).childHandler(new ChannelInitializer() + { + protected void initChannel(Channel p_initChannel_1_) throws Exception + { + NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); + networkmanager.setNetHandler(new NetHandlerHandshakeMemory(NetworkSystem.this.mcServer, networkmanager)); + NetworkSystem.this.networkManagers.add(networkmanager); + p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); + } + }).group((EventLoopGroup)eventLoops.getValue()).localAddress(LocalAddress.ANY)).bind().syncUninterruptibly(); + this.endpoints.add(channelfuture); + } + + return channelfuture.channel().localAddress(); + } + + public void terminateEndpoints() + { + this.isAlive = false; + + for (ChannelFuture channelfuture : this.endpoints) + { + try + { + channelfuture.channel().close().sync(); + } + catch (InterruptedException var4) + { + logger.error("Interrupted whilst closing channel"); + } + } + } + + public void networkTick() + { + synchronized (this.networkManagers) + { + Iterator iterator = this.networkManagers.iterator(); + + while (iterator.hasNext()) + { + final NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (!networkmanager.hasNoChannel()) + { + if (!networkmanager.isChannelOpen()) + { + iterator.remove(); + networkmanager.checkDisconnected(); + } + else + { + try + { + networkmanager.processReceivedPackets(); + } + catch (Exception exception) + { + if (networkmanager.isLocalChannel()) + { + CrashReport crashreport = CrashReport.makeCrashReport(exception, "Ticking memory connection"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Ticking connection"); + crashreportcategory.addCrashSectionCallable("Connection", new Callable() + { + public String call() throws Exception + { + return networkmanager.toString(); + } + }); + throw new ReportedException(crashreport); + } + + logger.warn((String)("Failed to handle packet for " + networkmanager.getRemoteAddress()), (Throwable)exception); + final ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error"); + networkmanager.sendPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener < Future > () + { + public void operationComplete(Future p_operationComplete_1_) throws Exception + { + networkmanager.closeChannel(chatcomponenttext); + } + }, new GenericFutureListener[0]); + networkmanager.disableAutoRead(); + } + } + } + } + } + } + + public MinecraftServer getServer() + { + return this.mcServer; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/Packet.java b/Client-1.8.9/src/main/java/net/minecraft/network/Packet.java new file mode 100644 index 0000000..e3191f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/Packet.java @@ -0,0 +1,12 @@ +package net.minecraft.network; + +import java.io.IOException; + +public interface Packet +{ + void readPacketData(PacketBuffer buf) throws IOException; + + void writePacketData(PacketBuffer buf) throws IOException; + + void processPacket(T handler); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/PacketBuffer.java b/Client-1.8.9/src/main/java/net/minecraft/network/PacketBuffer.java new file mode 100644 index 0000000..ab6de78 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/PacketBuffer.java @@ -0,0 +1,1014 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.ByteBufOutputStream; +import io.netty.buffer.ByteBufProcessor; +import io.netty.handler.codec.DecoderException; +import io.netty.handler.codec.EncoderException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.GatheringByteChannel; +import java.nio.channels.ScatteringByteChannel; +import java.nio.charset.Charset; +import java.util.UUID; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTSizeTracker; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; + +public class PacketBuffer extends ByteBuf +{ + private final ByteBuf buf; + + public PacketBuffer(ByteBuf wrapped) + { + this.buf = wrapped; + } + + public static int getVarIntSize(int input) + { + for (int i = 1; i < 5; ++i) + { + if ((input & -1 << i * 7) == 0) + { + return i; + } + } + + return 5; + } + + public void writeByteArray(byte[] array) + { + this.writeVarIntToBuffer(array.length); + this.writeBytes(array); + } + + public byte[] readByteArray() + { + byte[] abyte = new byte[this.readVarIntFromBuffer()]; + this.readBytes(abyte); + return abyte; + } + + public BlockPos readBlockPos() + { + return BlockPos.fromLong(this.readLong()); + } + + public void writeBlockPos(BlockPos pos) + { + this.writeLong(pos.toLong()); + } + + public IChatComponent readChatComponent() throws IOException + { + return IChatComponent.Serializer.jsonToComponent(this.readStringFromBuffer(32767)); + } + + public void writeChatComponent(IChatComponent component) throws IOException + { + this.writeString(IChatComponent.Serializer.componentToJson(component)); + } + + public > T readEnumValue(Class enumClass) + { + return (T)((Enum[])enumClass.getEnumConstants())[this.readVarIntFromBuffer()]; + } + + public void writeEnumValue(Enum value) + { + this.writeVarIntToBuffer(value.ordinal()); + } + + public int readVarIntFromBuffer() + { + int i = 0; + int j = 0; + + while (true) + { + byte b0 = this.readByte(); + i |= (b0 & 127) << j++ * 7; + + if (j > 5) + { + throw new RuntimeException("VarInt too big"); + } + + if ((b0 & 128) != 128) + { + break; + } + } + + return i; + } + + public long readVarLong() + { + long i = 0L; + int j = 0; + + while (true) + { + byte b0 = this.readByte(); + i |= (long)(b0 & 127) << j++ * 7; + + if (j > 10) + { + throw new RuntimeException("VarLong too big"); + } + + if ((b0 & 128) != 128) + { + break; + } + } + + return i; + } + + public void writeUuid(UUID uuid) + { + this.writeLong(uuid.getMostSignificantBits()); + this.writeLong(uuid.getLeastSignificantBits()); + } + + public UUID readUuid() + { + return new UUID(this.readLong(), this.readLong()); + } + + public void writeVarIntToBuffer(int input) + { + while ((input & -128) != 0) + { + this.writeByte(input & 127 | 128); + input >>>= 7; + } + + this.writeByte(input); + } + + public void writeVarLong(long value) + { + while ((value & -128L) != 0L) + { + this.writeByte((int)(value & 127L) | 128); + value >>>= 7; + } + + this.writeByte((int)value); + } + + public void writeNBTTagCompoundToBuffer(NBTTagCompound nbt) + { + if (nbt == null) + { + this.writeByte(0); + } + else + { + try + { + CompressedStreamTools.write(nbt, new ByteBufOutputStream(this)); + } + catch (IOException ioexception) + { + throw new EncoderException(ioexception); + } + } + } + + public NBTTagCompound readNBTTagCompoundFromBuffer() throws IOException + { + int i = this.readerIndex(); + byte b0 = this.readByte(); + + if (b0 == 0) + { + return null; + } + else + { + this.readerIndex(i); + return CompressedStreamTools.read(new ByteBufInputStream(this), new NBTSizeTracker(2097152L)); + } + } + + public void writeItemStackToBuffer(ItemStack stack) + { + if (stack == null) + { + this.writeShort(-1); + } + else + { + this.writeShort(Item.getIdFromItem(stack.getItem())); + this.writeByte(stack.stackSize); + this.writeShort(stack.getMetadata()); + NBTTagCompound nbttagcompound = null; + + if (stack.getItem().isDamageable() || stack.getItem().getShareTag()) + { + nbttagcompound = stack.getTagCompound(); + } + + this.writeNBTTagCompoundToBuffer(nbttagcompound); + } + } + + public ItemStack readItemStackFromBuffer() throws IOException + { + ItemStack itemstack = null; + int i = this.readShort(); + + if (i >= 0) + { + int j = this.readByte(); + int k = this.readShort(); + itemstack = new ItemStack(Item.getItemById(i), j, k); + itemstack.setTagCompound(this.readNBTTagCompoundFromBuffer()); + } + + return itemstack; + } + + public String readStringFromBuffer(int maxLength) + { + int i = this.readVarIntFromBuffer(); + + if (i > maxLength * 4) + { + throw new DecoderException("The received encoded string buffer length is longer than maximum allowed (" + i + " > " + maxLength * 4 + ")"); + } + else if (i < 0) + { + throw new DecoderException("The received encoded string buffer length is less than zero! Weird string!"); + } + else + { + String s = new String(this.readBytes(i).array(), Charsets.UTF_8); + + if (s.length() > maxLength) + { + throw new DecoderException("The received string length is longer than maximum allowed (" + i + " > " + maxLength + ")"); + } + else + { + return s; + } + } + } + + public PacketBuffer writeString(String string) + { + byte[] abyte = string.getBytes(Charsets.UTF_8); + + if (abyte.length > 32767) + { + throw new EncoderException("String too big (was " + string.length() + " bytes encoded, max " + 32767 + ")"); + } + else + { + this.writeVarIntToBuffer(abyte.length); + this.writeBytes(abyte); + return this; + } + } + + public int capacity() + { + return this.buf.capacity(); + } + + public ByteBuf capacity(int p_capacity_1_) + { + return this.buf.capacity(p_capacity_1_); + } + + public int maxCapacity() + { + return this.buf.maxCapacity(); + } + + public ByteBufAllocator alloc() + { + return this.buf.alloc(); + } + + public ByteOrder order() + { + return this.buf.order(); + } + + public ByteBuf order(ByteOrder p_order_1_) + { + return this.buf.order(p_order_1_); + } + + public ByteBuf unwrap() + { + return this.buf.unwrap(); + } + + public boolean isDirect() + { + return this.buf.isDirect(); + } + + public int readerIndex() + { + return this.buf.readerIndex(); + } + + public ByteBuf readerIndex(int p_readerIndex_1_) + { + return this.buf.readerIndex(p_readerIndex_1_); + } + + public int writerIndex() + { + return this.buf.writerIndex(); + } + + public ByteBuf writerIndex(int p_writerIndex_1_) + { + return this.buf.writerIndex(p_writerIndex_1_); + } + + public ByteBuf setIndex(int p_setIndex_1_, int p_setIndex_2_) + { + return this.buf.setIndex(p_setIndex_1_, p_setIndex_2_); + } + + public int readableBytes() + { + return this.buf.readableBytes(); + } + + public int writableBytes() + { + return this.buf.writableBytes(); + } + + public int maxWritableBytes() + { + return this.buf.maxWritableBytes(); + } + + public boolean isReadable() + { + return this.buf.isReadable(); + } + + public boolean isReadable(int p_isReadable_1_) + { + return this.buf.isReadable(p_isReadable_1_); + } + + public boolean isWritable() + { + return this.buf.isWritable(); + } + + public boolean isWritable(int p_isWritable_1_) + { + return this.buf.isWritable(p_isWritable_1_); + } + + public ByteBuf clear() + { + return this.buf.clear(); + } + + public ByteBuf markReaderIndex() + { + return this.buf.markReaderIndex(); + } + + public ByteBuf resetReaderIndex() + { + return this.buf.resetReaderIndex(); + } + + public ByteBuf markWriterIndex() + { + return this.buf.markWriterIndex(); + } + + public ByteBuf resetWriterIndex() + { + return this.buf.resetWriterIndex(); + } + + public ByteBuf discardReadBytes() + { + return this.buf.discardReadBytes(); + } + + public ByteBuf discardSomeReadBytes() + { + return this.buf.discardSomeReadBytes(); + } + + public ByteBuf ensureWritable(int p_ensureWritable_1_) + { + return this.buf.ensureWritable(p_ensureWritable_1_); + } + + public int ensureWritable(int p_ensureWritable_1_, boolean p_ensureWritable_2_) + { + return this.buf.ensureWritable(p_ensureWritable_1_, p_ensureWritable_2_); + } + + public boolean getBoolean(int p_getBoolean_1_) + { + return this.buf.getBoolean(p_getBoolean_1_); + } + + public byte getByte(int p_getByte_1_) + { + return this.buf.getByte(p_getByte_1_); + } + + public short getUnsignedByte(int p_getUnsignedByte_1_) + { + return this.buf.getUnsignedByte(p_getUnsignedByte_1_); + } + + public short getShort(int p_getShort_1_) + { + return this.buf.getShort(p_getShort_1_); + } + + public int getUnsignedShort(int p_getUnsignedShort_1_) + { + return this.buf.getUnsignedShort(p_getUnsignedShort_1_); + } + + public int getMedium(int p_getMedium_1_) + { + return this.buf.getMedium(p_getMedium_1_); + } + + public int getUnsignedMedium(int p_getUnsignedMedium_1_) + { + return this.buf.getUnsignedMedium(p_getUnsignedMedium_1_); + } + + public int getInt(int p_getInt_1_) + { + return this.buf.getInt(p_getInt_1_); + } + + public long getUnsignedInt(int p_getUnsignedInt_1_) + { + return this.buf.getUnsignedInt(p_getUnsignedInt_1_); + } + + public long getLong(int p_getLong_1_) + { + return this.buf.getLong(p_getLong_1_); + } + + public char getChar(int p_getChar_1_) + { + return this.buf.getChar(p_getChar_1_); + } + + public float getFloat(int p_getFloat_1_) + { + return this.buf.getFloat(p_getFloat_1_); + } + + public double getDouble(int p_getDouble_1_) + { + return this.buf.getDouble(p_getDouble_1_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_) + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_) + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_); + } + + public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_) + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuffer p_getBytes_2_) + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, OutputStream p_getBytes_2_, int p_getBytes_3_) throws IOException + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public int getBytes(int p_getBytes_1_, GatheringByteChannel p_getBytes_2_, int p_getBytes_3_) throws IOException + { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public ByteBuf setBoolean(int p_setBoolean_1_, boolean p_setBoolean_2_) + { + return this.buf.setBoolean(p_setBoolean_1_, p_setBoolean_2_); + } + + public ByteBuf setByte(int p_setByte_1_, int p_setByte_2_) + { + return this.buf.setByte(p_setByte_1_, p_setByte_2_); + } + + public ByteBuf setShort(int p_setShort_1_, int p_setShort_2_) + { + return this.buf.setShort(p_setShort_1_, p_setShort_2_); + } + + public ByteBuf setMedium(int p_setMedium_1_, int p_setMedium_2_) + { + return this.buf.setMedium(p_setMedium_1_, p_setMedium_2_); + } + + public ByteBuf setInt(int p_setInt_1_, int p_setInt_2_) + { + return this.buf.setInt(p_setInt_1_, p_setInt_2_); + } + + public ByteBuf setLong(int p_setLong_1_, long p_setLong_2_) + { + return this.buf.setLong(p_setLong_1_, p_setLong_2_); + } + + public ByteBuf setChar(int p_setChar_1_, int p_setChar_2_) + { + return this.buf.setChar(p_setChar_1_, p_setChar_2_); + } + + public ByteBuf setFloat(int p_setFloat_1_, float p_setFloat_2_) + { + return this.buf.setFloat(p_setFloat_1_, p_setFloat_2_); + } + + public ByteBuf setDouble(int p_setDouble_1_, double p_setDouble_2_) + { + return this.buf.setDouble(p_setDouble_1_, p_setDouble_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_) + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_) + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_); + } + + public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_) + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuffer p_setBytes_2_) + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public int setBytes(int p_setBytes_1_, InputStream p_setBytes_2_, int p_setBytes_3_) throws IOException + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public int setBytes(int p_setBytes_1_, ScatteringByteChannel p_setBytes_2_, int p_setBytes_3_) throws IOException + { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public ByteBuf setZero(int p_setZero_1_, int p_setZero_2_) + { + return this.buf.setZero(p_setZero_1_, p_setZero_2_); + } + + public boolean readBoolean() + { + return this.buf.readBoolean(); + } + + public byte readByte() + { + return this.buf.readByte(); + } + + public short readUnsignedByte() + { + return this.buf.readUnsignedByte(); + } + + public short readShort() + { + return this.buf.readShort(); + } + + public int readUnsignedShort() + { + return this.buf.readUnsignedShort(); + } + + public int readMedium() + { + return this.buf.readMedium(); + } + + public int readUnsignedMedium() + { + return this.buf.readUnsignedMedium(); + } + + public int readInt() + { + return this.buf.readInt(); + } + + public long readUnsignedInt() + { + return this.buf.readUnsignedInt(); + } + + public long readLong() + { + return this.buf.readLong(); + } + + public char readChar() + { + return this.buf.readChar(); + } + + public float readFloat() + { + return this.buf.readFloat(); + } + + public double readDouble() + { + return this.buf.readDouble(); + } + + public ByteBuf readBytes(int p_readBytes_1_) + { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readSlice(int p_readSlice_1_) + { + return this.buf.readSlice(p_readSlice_1_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_) + { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_) + { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) + { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_); + } + + public ByteBuf readBytes(byte[] p_readBytes_1_) + { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(byte[] p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) + { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_); + } + + public ByteBuf readBytes(ByteBuffer p_readBytes_1_) + { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(OutputStream p_readBytes_1_, int p_readBytes_2_) throws IOException + { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public int readBytes(GatheringByteChannel p_readBytes_1_, int p_readBytes_2_) throws IOException + { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public ByteBuf skipBytes(int p_skipBytes_1_) + { + return this.buf.skipBytes(p_skipBytes_1_); + } + + public ByteBuf writeBoolean(boolean p_writeBoolean_1_) + { + return this.buf.writeBoolean(p_writeBoolean_1_); + } + + public ByteBuf writeByte(int p_writeByte_1_) + { + return this.buf.writeByte(p_writeByte_1_); + } + + public ByteBuf writeShort(int p_writeShort_1_) + { + return this.buf.writeShort(p_writeShort_1_); + } + + public ByteBuf writeMedium(int p_writeMedium_1_) + { + return this.buf.writeMedium(p_writeMedium_1_); + } + + public ByteBuf writeInt(int p_writeInt_1_) + { + return this.buf.writeInt(p_writeInt_1_); + } + + public ByteBuf writeLong(long p_writeLong_1_) + { + return this.buf.writeLong(p_writeLong_1_); + } + + public ByteBuf writeChar(int p_writeChar_1_) + { + return this.buf.writeChar(p_writeChar_1_); + } + + public ByteBuf writeFloat(float p_writeFloat_1_) + { + return this.buf.writeFloat(p_writeFloat_1_); + } + + public ByteBuf writeDouble(double p_writeDouble_1_) + { + return this.buf.writeDouble(p_writeDouble_1_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_) + { + return this.buf.writeBytes(p_writeBytes_1_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_) + { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) + { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_); + } + + public ByteBuf writeBytes(byte[] p_writeBytes_1_) + { + return this.buf.writeBytes(p_writeBytes_1_); + } + + public ByteBuf writeBytes(byte[] p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) + { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_); + } + + public ByteBuf writeBytes(ByteBuffer p_writeBytes_1_) + { + return this.buf.writeBytes(p_writeBytes_1_); + } + + public int writeBytes(InputStream p_writeBytes_1_, int p_writeBytes_2_) throws IOException + { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public int writeBytes(ScatteringByteChannel p_writeBytes_1_, int p_writeBytes_2_) throws IOException + { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public ByteBuf writeZero(int p_writeZero_1_) + { + return this.buf.writeZero(p_writeZero_1_); + } + + public int indexOf(int p_indexOf_1_, int p_indexOf_2_, byte p_indexOf_3_) + { + return this.buf.indexOf(p_indexOf_1_, p_indexOf_2_, p_indexOf_3_); + } + + public int bytesBefore(byte p_bytesBefore_1_) + { + return this.buf.bytesBefore(p_bytesBefore_1_); + } + + public int bytesBefore(int p_bytesBefore_1_, byte p_bytesBefore_2_) + { + return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_); + } + + public int bytesBefore(int p_bytesBefore_1_, int p_bytesBefore_2_, byte p_bytesBefore_3_) + { + return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_, p_bytesBefore_3_); + } + + public int forEachByte(ByteBufProcessor p_forEachByte_1_) + { + return this.buf.forEachByte(p_forEachByte_1_); + } + + public int forEachByte(int p_forEachByte_1_, int p_forEachByte_2_, ByteBufProcessor p_forEachByte_3_) + { + return this.buf.forEachByte(p_forEachByte_1_, p_forEachByte_2_, p_forEachByte_3_); + } + + public int forEachByteDesc(ByteBufProcessor p_forEachByteDesc_1_) + { + return this.buf.forEachByteDesc(p_forEachByteDesc_1_); + } + + public int forEachByteDesc(int p_forEachByteDesc_1_, int p_forEachByteDesc_2_, ByteBufProcessor p_forEachByteDesc_3_) + { + return this.buf.forEachByteDesc(p_forEachByteDesc_1_, p_forEachByteDesc_2_, p_forEachByteDesc_3_); + } + + public ByteBuf copy() + { + return this.buf.copy(); + } + + public ByteBuf copy(int p_copy_1_, int p_copy_2_) + { + return this.buf.copy(p_copy_1_, p_copy_2_); + } + + public ByteBuf slice() + { + return this.buf.slice(); + } + + public ByteBuf slice(int p_slice_1_, int p_slice_2_) + { + return this.buf.slice(p_slice_1_, p_slice_2_); + } + + public ByteBuf duplicate() + { + return this.buf.duplicate(); + } + + public int nioBufferCount() + { + return this.buf.nioBufferCount(); + } + + public ByteBuffer nioBuffer() + { + return this.buf.nioBuffer(); + } + + public ByteBuffer nioBuffer(int p_nioBuffer_1_, int p_nioBuffer_2_) + { + return this.buf.nioBuffer(p_nioBuffer_1_, p_nioBuffer_2_); + } + + public ByteBuffer internalNioBuffer(int p_internalNioBuffer_1_, int p_internalNioBuffer_2_) + { + return this.buf.internalNioBuffer(p_internalNioBuffer_1_, p_internalNioBuffer_2_); + } + + public ByteBuffer[] nioBuffers() + { + return this.buf.nioBuffers(); + } + + public ByteBuffer[] nioBuffers(int p_nioBuffers_1_, int p_nioBuffers_2_) + { + return this.buf.nioBuffers(p_nioBuffers_1_, p_nioBuffers_2_); + } + + public boolean hasArray() + { + return this.buf.hasArray(); + } + + public byte[] array() + { + return this.buf.array(); + } + + public int arrayOffset() + { + return this.buf.arrayOffset(); + } + + public boolean hasMemoryAddress() + { + return this.buf.hasMemoryAddress(); + } + + public long memoryAddress() + { + return this.buf.memoryAddress(); + } + + public String toString(Charset p_toString_1_) + { + return this.buf.toString(p_toString_1_); + } + + public String toString(int p_toString_1_, int p_toString_2_, Charset p_toString_3_) + { + return this.buf.toString(p_toString_1_, p_toString_2_, p_toString_3_); + } + + public int hashCode() + { + return this.buf.hashCode(); + } + + public boolean equals(Object p_equals_1_) + { + return this.buf.equals(p_equals_1_); + } + + public int compareTo(ByteBuf p_compareTo_1_) + { + return this.buf.compareTo(p_compareTo_1_); + } + + public String toString() + { + return this.buf.toString(); + } + + public ByteBuf retain(int p_retain_1_) + { + return this.buf.retain(p_retain_1_); + } + + public ByteBuf retain() + { + return this.buf.retain(); + } + + public int refCnt() + { + return this.buf.refCnt(); + } + + public boolean release() + { + return this.buf.release(); + } + + public boolean release(int p_release_1_) + { + return this.buf.release(p_release_1_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/PacketThreadUtil.java b/Client-1.8.9/src/main/java/net/minecraft/network/PacketThreadUtil.java new file mode 100644 index 0000000..a978b3f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/PacketThreadUtil.java @@ -0,0 +1,55 @@ +package net.minecraft.network; + +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.src.Config; +import net.minecraft.util.IThreadListener; + +public class PacketThreadUtil +{ + public static int lastDimensionId = Integer.MIN_VALUE; + + public static void checkThreadAndEnqueue(final Packet p_180031_0_, final T p_180031_1_, IThreadListener p_180031_2_) throws ThreadQuickExitException + { + if (!p_180031_2_.isCallingFromMinecraftThread()) + { + p_180031_2_.addScheduledTask(new Runnable() + { + public void run() + { + PacketThreadUtil.clientPreProcessPacket(p_180031_0_); + p_180031_0_.processPacket(p_180031_1_); + } + }); + throw ThreadQuickExitException.INSTANCE; + } + else + { + clientPreProcessPacket(p_180031_0_); + } + } + + protected static void clientPreProcessPacket(Packet p_clientPreProcessPacket_0_) + { + if (p_clientPreProcessPacket_0_ instanceof S08PacketPlayerPosLook) + { + Config.getRenderGlobal().onPlayerPositionSet(); + } + + if (p_clientPreProcessPacket_0_ instanceof S07PacketRespawn) + { + S07PacketRespawn s07packetrespawn = (S07PacketRespawn)p_clientPreProcessPacket_0_; + lastDimensionId = s07packetrespawn.getDimensionID(); + } + else if (p_clientPreProcessPacket_0_ instanceof S01PacketJoinGame) + { + S01PacketJoinGame s01packetjoingame = (S01PacketJoinGame)p_clientPreProcessPacket_0_; + lastDimensionId = s01packetjoingame.getDimension(); + } + else + { + lastDimensionId = Integer.MIN_VALUE; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/PingResponseHandler.java b/Client-1.8.9/src/main/java/net/minecraft/network/PingResponseHandler.java new file mode 100644 index 0000000..41e5efb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/PingResponseHandler.java @@ -0,0 +1,125 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import java.net.InetSocketAddress; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PingResponseHandler extends ChannelInboundHandlerAdapter +{ + private static final Logger logger = LogManager.getLogger(); + private NetworkSystem networkSystem; + + public PingResponseHandler(NetworkSystem networkSystemIn) + { + this.networkSystem = networkSystemIn; + } + + public void channelRead(ChannelHandlerContext p_channelRead_1_, Object p_channelRead_2_) throws Exception + { + ByteBuf bytebuf = (ByteBuf)p_channelRead_2_; + bytebuf.markReaderIndex(); + boolean flag = true; + + try + { + if (bytebuf.readUnsignedByte() == 254) + { + InetSocketAddress inetsocketaddress = (InetSocketAddress)p_channelRead_1_.channel().remoteAddress(); + MinecraftServer minecraftserver = this.networkSystem.getServer(); + int i = bytebuf.readableBytes(); + + switch (i) + { + case 0: + logger.debug("Ping: (<1.3.x) from {}:{}", new Object[] {inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())}); + String s2 = String.format("%s\u00a7%d\u00a7%d", new Object[] {minecraftserver.getMOTD(), Integer.valueOf(minecraftserver.getCurrentPlayerCount()), Integer.valueOf(minecraftserver.getMaxPlayers())}); + this.writeAndFlush(p_channelRead_1_, this.getStringBuffer(s2)); + break; + + case 1: + if (bytebuf.readUnsignedByte() != 1) + { + return; + } + + logger.debug("Ping: (1.4-1.5.x) from {}:{}", new Object[] {inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())}); + String s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] {Integer.valueOf(127), minecraftserver.getMinecraftVersion(), minecraftserver.getMOTD(), Integer.valueOf(minecraftserver.getCurrentPlayerCount()), Integer.valueOf(minecraftserver.getMaxPlayers())}); + this.writeAndFlush(p_channelRead_1_, this.getStringBuffer(s)); + break; + + default: + boolean flag1 = bytebuf.readUnsignedByte() == 1; + flag1 = flag1 & bytebuf.readUnsignedByte() == 250; + flag1 = flag1 & "MC|PingHost".equals(new String(bytebuf.readBytes(bytebuf.readShort() * 2).array(), Charsets.UTF_16BE)); + int j = bytebuf.readUnsignedShort(); + flag1 = flag1 & bytebuf.readUnsignedByte() >= 73; + flag1 = flag1 & 3 + bytebuf.readBytes(bytebuf.readShort() * 2).array().length + 4 == j; + flag1 = flag1 & bytebuf.readInt() <= 65535; + flag1 = flag1 & bytebuf.readableBytes() == 0; + + if (!flag1) + { + return; + } + + logger.debug("Ping: (1.6) from {}:{}", new Object[] {inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())}); + String s1 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] {Integer.valueOf(127), minecraftserver.getMinecraftVersion(), minecraftserver.getMOTD(), Integer.valueOf(minecraftserver.getCurrentPlayerCount()), Integer.valueOf(minecraftserver.getMaxPlayers())}); + ByteBuf bytebuf1 = this.getStringBuffer(s1); + + try + { + this.writeAndFlush(p_channelRead_1_, bytebuf1); + } + finally + { + bytebuf1.release(); + } + } + + bytebuf.release(); + flag = false; + return; + } + } + catch (RuntimeException var21) + { + return; + } + finally + { + if (flag) + { + bytebuf.resetReaderIndex(); + p_channelRead_1_.channel().pipeline().remove("legacy_query"); + p_channelRead_1_.fireChannelRead(p_channelRead_2_); + } + } + } + + private void writeAndFlush(ChannelHandlerContext ctx, ByteBuf data) + { + ctx.pipeline().firstContext().writeAndFlush(data).addListener(ChannelFutureListener.CLOSE); + } + + private ByteBuf getStringBuffer(String string) + { + ByteBuf bytebuf = Unpooled.buffer(); + bytebuf.writeByte(255); + char[] achar = string.toCharArray(); + bytebuf.writeShort(achar.length); + + for (char c0 : achar) + { + bytebuf.writeChar(c0); + } + + return bytebuf; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/ServerStatusResponse.java b/Client-1.8.9/src/main/java/net/minecraft/network/ServerStatusResponse.java new file mode 100644 index 0000000..2f9a21e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/ServerStatusResponse.java @@ -0,0 +1,249 @@ +package net.minecraft.network; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.mojang.authlib.GameProfile; +import java.lang.reflect.Type; +import java.util.UUID; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; + +public class ServerStatusResponse +{ + private IChatComponent serverMotd; + private ServerStatusResponse.PlayerCountData playerCount; + private ServerStatusResponse.MinecraftProtocolVersionIdentifier protocolVersion; + private String favicon; + public String lcString; + + public IChatComponent getServerDescription() + { + return this.serverMotd; + } + + public void setServerDescription(IChatComponent motd) + { + this.serverMotd = motd; + } + + public ServerStatusResponse.PlayerCountData getPlayerCountData() + { + return this.playerCount; + } + + public void setPlayerCountData(ServerStatusResponse.PlayerCountData countData) + { + this.playerCount = countData; + } + + public ServerStatusResponse.MinecraftProtocolVersionIdentifier getProtocolVersionInfo() + { + return this.protocolVersion; + } + + public void setProtocolVersionInfo(ServerStatusResponse.MinecraftProtocolVersionIdentifier protocolVersionData) + { + this.protocolVersion = protocolVersionData; + } + + public void setFavicon(String faviconBlob) + { + this.favicon = faviconBlob; + } + + public String getFavicon() + { + return this.favicon; + } + + public static class MinecraftProtocolVersionIdentifier + { + private final String name; + private final int protocol; + + public MinecraftProtocolVersionIdentifier(String nameIn, int protocolIn) + { + this.name = nameIn; + this.protocol = protocolIn; + } + + public String getName() + { + return this.name; + } + + public int getProtocol() + { + return this.protocol; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + public ServerStatusResponse.MinecraftProtocolVersionIdentifier deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_deserialize_1_, "version"); + return new ServerStatusResponse.MinecraftProtocolVersionIdentifier(JsonUtils.getString(jsonobject, "name"), JsonUtils.getInt(jsonobject, "protocol")); + } + + public JsonElement serialize(ServerStatusResponse.MinecraftProtocolVersionIdentifier p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("name", p_serialize_1_.getName()); + jsonobject.addProperty("protocol", (Number)Integer.valueOf(p_serialize_1_.getProtocol())); + return jsonobject; + } + } + } + + public static class PlayerCountData + { + private final int maxPlayers; + private final int onlinePlayerCount; + private GameProfile[] players; + + public PlayerCountData(int maxOnlinePlayers, int onlinePlayers) + { + this.maxPlayers = maxOnlinePlayers; + this.onlinePlayerCount = onlinePlayers; + } + + public int getMaxPlayers() + { + return this.maxPlayers; + } + + public int getOnlinePlayerCount() + { + return this.onlinePlayerCount; + } + + public GameProfile[] getPlayers() + { + return this.players; + } + + public void setPlayers(GameProfile[] playersIn) + { + this.players = playersIn; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + public ServerStatusResponse.PlayerCountData deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_deserialize_1_, "players"); + ServerStatusResponse.PlayerCountData serverstatusresponse$playercountdata = new ServerStatusResponse.PlayerCountData(JsonUtils.getInt(jsonobject, "max"), JsonUtils.getInt(jsonobject, "online")); + + if (JsonUtils.isJsonArray(jsonobject, "sample")) + { + JsonArray jsonarray = JsonUtils.getJsonArray(jsonobject, "sample"); + + if (jsonarray.size() > 0) + { + GameProfile[] agameprofile = new GameProfile[jsonarray.size()]; + + for (int i = 0; i < agameprofile.length; ++i) + { + JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonarray.get(i), "player[" + i + "]"); + String s = JsonUtils.getString(jsonobject1, "id"); + agameprofile[i] = new GameProfile(UUID.fromString(s), JsonUtils.getString(jsonobject1, "name")); + } + + serverstatusresponse$playercountdata.setPlayers(agameprofile); + } + } + + return serverstatusresponse$playercountdata; + } + + public JsonElement serialize(ServerStatusResponse.PlayerCountData p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("max", (Number)Integer.valueOf(p_serialize_1_.getMaxPlayers())); + jsonobject.addProperty("online", (Number)Integer.valueOf(p_serialize_1_.getOnlinePlayerCount())); + + if (p_serialize_1_.getPlayers() != null && p_serialize_1_.getPlayers().length > 0) + { + JsonArray jsonarray = new JsonArray(); + + for (int i = 0; i < p_serialize_1_.getPlayers().length; ++i) + { + JsonObject jsonobject1 = new JsonObject(); + UUID uuid = p_serialize_1_.getPlayers()[i].getId(); + jsonobject1.addProperty("id", uuid == null ? "" : uuid.toString()); + jsonobject1.addProperty("name", p_serialize_1_.getPlayers()[i].getName()); + jsonarray.add(jsonobject1); + } + + jsonobject.add("sample", jsonarray); + } + + return jsonobject; + } + } + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + public ServerStatusResponse deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = JsonUtils.getJsonObject(p_deserialize_1_, "status"); + ServerStatusResponse serverstatusresponse = new ServerStatusResponse(); + + if (jsonobject.has("description")) + { + serverstatusresponse.setServerDescription((IChatComponent)p_deserialize_3_.deserialize(jsonobject.get("description"), IChatComponent.class)); + } + + if (jsonobject.has("players")) + { + serverstatusresponse.setPlayerCountData((ServerStatusResponse.PlayerCountData)p_deserialize_3_.deserialize(jsonobject.get("players"), ServerStatusResponse.PlayerCountData.class)); + } + + if (jsonobject.has("version")) + { + serverstatusresponse.setProtocolVersionInfo((ServerStatusResponse.MinecraftProtocolVersionIdentifier)p_deserialize_3_.deserialize(jsonobject.get("version"), ServerStatusResponse.MinecraftProtocolVersionIdentifier.class)); + } + + if (jsonobject.has("favicon")) + { + serverstatusresponse.setFavicon(JsonUtils.getString(jsonobject, "favicon")); + } + + return serverstatusresponse; + } + + public JsonElement serialize(ServerStatusResponse p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + + if (p_serialize_1_.getServerDescription() != null) + { + jsonobject.add("description", p_serialize_3_.serialize(p_serialize_1_.getServerDescription())); + } + + if (p_serialize_1_.getPlayerCountData() != null) + { + jsonobject.add("players", p_serialize_3_.serialize(p_serialize_1_.getPlayerCountData())); + } + + if (p_serialize_1_.getProtocolVersionInfo() != null) + { + jsonobject.add("version", p_serialize_3_.serialize(p_serialize_1_.getProtocolVersionInfo())); + } + + if (p_serialize_1_.getFavicon() != null) + { + jsonobject.addProperty("favicon", p_serialize_1_.getFavicon()); + } + + return jsonobject; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/ThreadQuickExitException.java b/Client-1.8.9/src/main/java/net/minecraft/network/ThreadQuickExitException.java new file mode 100644 index 0000000..7ace0f0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/ThreadQuickExitException.java @@ -0,0 +1,17 @@ +package net.minecraft.network; + +public final class ThreadQuickExitException extends RuntimeException +{ + public static final ThreadQuickExitException INSTANCE = new ThreadQuickExitException(); + + private ThreadQuickExitException() + { + this.setStackTrace(new StackTraceElement[0]); + } + + public synchronized Throwable fillInStackTrace() + { + this.setStackTrace(new StackTraceElement[0]); + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java b/Client-1.8.9/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java new file mode 100644 index 0000000..a54598f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java @@ -0,0 +1,9 @@ +package net.minecraft.network.handshake; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.handshake.client.C00Handshake; + +public interface INetHandlerHandshakeServer extends INetHandler +{ + void processHandshake(C00Handshake packetIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java b/Client-1.8.9/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java new file mode 100644 index 0000000..29ffe33 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java @@ -0,0 +1,58 @@ +package net.minecraft.network.handshake.client; + +import java.io.IOException; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; + +public class C00Handshake implements Packet +{ + private int protocolVersion; + private String ip; + private int port; + private EnumConnectionState requestedState; + + public C00Handshake() + { + } + + public C00Handshake(int version, String ip, int port, EnumConnectionState requestedState) + { + this.protocolVersion = version; + this.ip = ip; + this.port = port; + this.requestedState = requestedState; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.protocolVersion = buf.readVarIntFromBuffer(); + this.ip = buf.readStringFromBuffer(255); + this.port = buf.readUnsignedShort(); + this.requestedState = EnumConnectionState.getById(buf.readVarIntFromBuffer()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.protocolVersion); + buf.writeString(this.ip); + buf.writeShort(this.port); + buf.writeVarIntToBuffer(this.requestedState.getId()); + } + + public void processPacket(INetHandlerHandshakeServer handler) + { + handler.processHandshake(this); + } + + public EnumConnectionState getRequestedState() + { + return this.requestedState; + } + + public int getProtocolVersion() + { + return this.protocolVersion; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java new file mode 100644 index 0000000..f8264f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java @@ -0,0 +1,18 @@ +package net.minecraft.network.login; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.login.server.S03PacketEnableCompression; + +public interface INetHandlerLoginClient extends INetHandler +{ + void handleEncryptionRequest(S01PacketEncryptionRequest packetIn); + + void handleLoginSuccess(S02PacketLoginSuccess packetIn); + + void handleDisconnect(S00PacketDisconnect packetIn); + + void handleEnableCompression(S03PacketEnableCompression packetIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java new file mode 100644 index 0000000..6b45c38 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java @@ -0,0 +1,12 @@ +package net.minecraft.network.login; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; + +public interface INetHandlerLoginServer extends INetHandler +{ + void processLoginStart(C00PacketLoginStart packetIn); + + void processEncryptionResponse(C01PacketEncryptionResponse packetIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java new file mode 100644 index 0000000..26fe5b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java @@ -0,0 +1,42 @@ +package net.minecraft.network.login.client; + +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.UUID; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginServer; + +public class C00PacketLoginStart implements Packet +{ + private GameProfile profile; + + public C00PacketLoginStart() + { + } + + public C00PacketLoginStart(GameProfile profileIn) + { + this.profile = profileIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.profile = new GameProfile((UUID)null, buf.readStringFromBuffer(16)); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.profile.getName()); + } + + public void processPacket(INetHandlerLoginServer handler) + { + handler.processLoginStart(this); + } + + public GameProfile getProfile() + { + return this.profile; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java new file mode 100644 index 0000000..a39caca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java @@ -0,0 +1,53 @@ +package net.minecraft.network.login.client; + +import java.io.IOException; +import java.security.PrivateKey; +import java.security.PublicKey; +import javax.crypto.SecretKey; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginServer; +import net.minecraft.util.CryptManager; + +public class C01PacketEncryptionResponse implements Packet +{ + private byte[] secretKeyEncrypted = new byte[0]; + private byte[] verifyTokenEncrypted = new byte[0]; + + public C01PacketEncryptionResponse() + { + } + + public C01PacketEncryptionResponse(SecretKey secretKey, PublicKey publicKey, byte[] verifyToken) + { + this.secretKeyEncrypted = CryptManager.encryptData(publicKey, secretKey.getEncoded()); + this.verifyTokenEncrypted = CryptManager.encryptData(publicKey, verifyToken); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.secretKeyEncrypted = buf.readByteArray(); + this.verifyTokenEncrypted = buf.readByteArray(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByteArray(this.secretKeyEncrypted); + buf.writeByteArray(this.verifyTokenEncrypted); + } + + public void processPacket(INetHandlerLoginServer handler) + { + handler.processEncryptionResponse(this); + } + + public SecretKey getSecretKey(PrivateKey key) + { + return CryptManager.decryptSharedKey(key, this.secretKeyEncrypted); + } + + public byte[] getVerifyToken(PrivateKey key) + { + return key == null ? this.verifyTokenEncrypted : CryptManager.decryptData(key, this.verifyTokenEncrypted); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java new file mode 100644 index 0000000..01078bd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java @@ -0,0 +1,41 @@ +package net.minecraft.network.login.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.util.IChatComponent; + +public class S00PacketDisconnect implements Packet +{ + private IChatComponent reason; + + public S00PacketDisconnect() + { + } + + public S00PacketDisconnect(IChatComponent reasonIn) + { + this.reason = reasonIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.reason = buf.readChatComponent(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeChatComponent(this.reason); + } + + public void processPacket(INetHandlerLoginClient handler) + { + handler.handleDisconnect(this); + } + + public IChatComponent func_149603_c() + { + return this.reason; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java new file mode 100644 index 0000000..2b6dddf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java @@ -0,0 +1,60 @@ +package net.minecraft.network.login.server; + +import java.io.IOException; +import java.security.PublicKey; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.util.CryptManager; + +public class S01PacketEncryptionRequest implements Packet +{ + private String hashedServerId; + private PublicKey publicKey; + private byte[] verifyToken; + + public S01PacketEncryptionRequest() + { + } + + public S01PacketEncryptionRequest(String serverId, PublicKey key, byte[] verifyToken) + { + this.hashedServerId = serverId; + this.publicKey = key; + this.verifyToken = verifyToken; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.hashedServerId = buf.readStringFromBuffer(20); + this.publicKey = CryptManager.decodePublicKey(buf.readByteArray()); + this.verifyToken = buf.readByteArray(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.hashedServerId); + buf.writeByteArray(this.publicKey.getEncoded()); + buf.writeByteArray(this.verifyToken); + } + + public void processPacket(INetHandlerLoginClient handler) + { + handler.handleEncryptionRequest(this); + } + + public String getServerId() + { + return this.hashedServerId; + } + + public PublicKey getPublicKey() + { + return this.publicKey; + } + + public byte[] getVerifyToken() + { + return this.verifyToken; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java new file mode 100644 index 0000000..7fc80f5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java @@ -0,0 +1,47 @@ +package net.minecraft.network.login.server; + +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.UUID; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; + +public class S02PacketLoginSuccess implements Packet +{ + private GameProfile profile; + + public S02PacketLoginSuccess() + { + } + + public S02PacketLoginSuccess(GameProfile profileIn) + { + this.profile = profileIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + String s = buf.readStringFromBuffer(36); + String s1 = buf.readStringFromBuffer(16); + UUID uuid = UUID.fromString(s); + this.profile = new GameProfile(uuid, s1); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + UUID uuid = this.profile.getId(); + buf.writeString(uuid == null ? "" : uuid.toString()); + buf.writeString(this.profile.getName()); + } + + public void processPacket(INetHandlerLoginClient handler) + { + handler.handleLoginSuccess(this); + } + + public GameProfile getProfile() + { + return this.profile; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S03PacketEnableCompression.java b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S03PacketEnableCompression.java new file mode 100644 index 0000000..d8368f0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/login/server/S03PacketEnableCompression.java @@ -0,0 +1,40 @@ +package net.minecraft.network.login.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; + +public class S03PacketEnableCompression implements Packet +{ + private int compressionTreshold; + + public S03PacketEnableCompression() + { + } + + public S03PacketEnableCompression(int compressionTresholdIn) + { + this.compressionTreshold = compressionTresholdIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.compressionTreshold = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.compressionTreshold); + } + + public void processPacket(INetHandlerLoginClient handler) + { + handler.handleEnableCompression(this); + } + + public int getCompressionTreshold() + { + return this.compressionTreshold; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java new file mode 100644 index 0000000..f0f0d26 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java @@ -0,0 +1,219 @@ +package net.minecraft.network.play; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.network.play.server.S41PacketServerDifficulty; +import net.minecraft.network.play.server.S42PacketCombatEvent; +import net.minecraft.network.play.server.S43PacketCamera; +import net.minecraft.network.play.server.S44PacketWorldBorder; +import net.minecraft.network.play.server.S45PacketTitle; +import net.minecraft.network.play.server.S46PacketSetCompressionLevel; +import net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; +import net.minecraft.network.play.server.S48PacketResourcePackSend; +import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; + +public interface INetHandlerPlayClient extends INetHandler +{ + void handleSpawnObject(S0EPacketSpawnObject packetIn); + + void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb packetIn); + + void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity packetIn); + + void handleSpawnMob(S0FPacketSpawnMob packetIn); + + void handleScoreboardObjective(S3BPacketScoreboardObjective packetIn); + + void handleSpawnPainting(S10PacketSpawnPainting packetIn); + + void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn); + + void handleAnimation(S0BPacketAnimation packetIn); + + void handleStatistics(S37PacketStatistics packetIn); + + void handleBlockBreakAnim(S25PacketBlockBreakAnim packetIn); + + void handleSignEditorOpen(S36PacketSignEditorOpen packetIn); + + void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn); + + void handleBlockAction(S24PacketBlockAction packetIn); + + void handleBlockChange(S23PacketBlockChange packetIn); + + void handleChat(S02PacketChat packetIn); + + void handleTabComplete(S3APacketTabComplete packetIn); + + void handleMultiBlockChange(S22PacketMultiBlockChange packetIn); + + void handleMaps(S34PacketMaps packetIn); + + void handleConfirmTransaction(S32PacketConfirmTransaction packetIn); + + void handleCloseWindow(S2EPacketCloseWindow packetIn); + + void handleWindowItems(S30PacketWindowItems packetIn); + + void handleOpenWindow(S2DPacketOpenWindow packetIn); + + void handleWindowProperty(S31PacketWindowProperty packetIn); + + void handleSetSlot(S2FPacketSetSlot packetIn); + + void handleCustomPayload(S3FPacketCustomPayload packetIn); + + void handleDisconnect(S40PacketDisconnect packetIn); + + void handleUseBed(S0APacketUseBed packetIn); + + void handleEntityStatus(S19PacketEntityStatus packetIn); + + void handleEntityAttach(S1BPacketEntityAttach packetIn); + + void handleExplosion(S27PacketExplosion packetIn); + + void handleChangeGameState(S2BPacketChangeGameState packetIn); + + void handleKeepAlive(S00PacketKeepAlive packetIn); + + void handleChunkData(S21PacketChunkData packetIn); + + void handleMapChunkBulk(S26PacketMapChunkBulk packetIn); + + void handleEffect(S28PacketEffect packetIn); + + void handleJoinGame(S01PacketJoinGame packetIn); + + void handleEntityMovement(S14PacketEntity packetIn); + + void handlePlayerPosLook(S08PacketPlayerPosLook packetIn); + + void handleParticles(S2APacketParticles packetIn); + + void handlePlayerAbilities(S39PacketPlayerAbilities packetIn); + + void handlePlayerListItem(S38PacketPlayerListItem packetIn); + + void handleDestroyEntities(S13PacketDestroyEntities packetIn); + + void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect packetIn); + + void handleRespawn(S07PacketRespawn packetIn); + + void handleEntityHeadLook(S19PacketEntityHeadLook packetIn); + + void handleHeldItemChange(S09PacketHeldItemChange packetIn); + + void handleDisplayScoreboard(S3DPacketDisplayScoreboard packetIn); + + void handleEntityMetadata(S1CPacketEntityMetadata packetIn); + + void handleEntityVelocity(S12PacketEntityVelocity packetIn); + + void handleEntityEquipment(S04PacketEntityEquipment packetIn); + + void handleSetExperience(S1FPacketSetExperience packetIn); + + void handleUpdateHealth(S06PacketUpdateHealth packetIn); + + void handleTeams(S3EPacketTeams packetIn); + + void handleUpdateScore(S3CPacketUpdateScore packetIn); + + void handleSpawnPosition(S05PacketSpawnPosition packetIn); + + void handleTimeUpdate(S03PacketTimeUpdate packetIn); + + void handleUpdateSign(S33PacketUpdateSign packetIn); + + void handleSoundEffect(S29PacketSoundEffect packetIn); + + void handleCollectItem(S0DPacketCollectItem packetIn); + + void handleEntityTeleport(S18PacketEntityTeleport packetIn); + + void handleEntityProperties(S20PacketEntityProperties packetIn); + + void handleEntityEffect(S1DPacketEntityEffect packetIn); + + void handleCombatEvent(S42PacketCombatEvent packetIn); + + void handleServerDifficulty(S41PacketServerDifficulty packetIn); + + void handleCamera(S43PacketCamera packetIn); + + void handleWorldBorder(S44PacketWorldBorder packetIn); + + void handleTitle(S45PacketTitle packetIn); + + void handleSetCompressionLevel(S46PacketSetCompressionLevel packetIn); + + void handlePlayerListHeaderFooter(S47PacketPlayerListHeaderFooter packetIn); + + void handleResourcePack(S48PacketResourcePackSend packetIn); + + void handleEntityNBT(S49PacketUpdateEntityNBT packetIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java new file mode 100644 index 0000000..fd1ce4a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java @@ -0,0 +1,75 @@ +package net.minecraft.network.play; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.client.C18PacketSpectate; +import net.minecraft.network.play.client.C19PacketResourcePackStatus; + +public interface INetHandlerPlayServer extends INetHandler +{ + void handleAnimation(C0APacketAnimation packetIn); + + void processChatMessage(C01PacketChatMessage packetIn); + + void processTabComplete(C14PacketTabComplete packetIn); + + void processClientStatus(C16PacketClientStatus packetIn); + + void processClientSettings(C15PacketClientSettings packetIn); + + void processConfirmTransaction(C0FPacketConfirmTransaction packetIn); + + void processEnchantItem(C11PacketEnchantItem packetIn); + + void processClickWindow(C0EPacketClickWindow packetIn); + + void processCloseWindow(C0DPacketCloseWindow packetIn); + + void processVanilla250Packet(C17PacketCustomPayload packetIn); + + void processUseEntity(C02PacketUseEntity packetIn); + + void processKeepAlive(C00PacketKeepAlive packetIn); + + void processPlayer(C03PacketPlayer packetIn); + + void processPlayerAbilities(C13PacketPlayerAbilities packetIn); + + void processPlayerDigging(C07PacketPlayerDigging packetIn); + + void processEntityAction(C0BPacketEntityAction packetIn); + + void processInput(C0CPacketInput packetIn); + + void processHeldItemChange(C09PacketHeldItemChange packetIn); + + void processCreativeInventoryAction(C10PacketCreativeInventoryAction packetIn); + + void processUpdateSign(C12PacketUpdateSign packetIn); + + void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement packetIn); + + void handleSpectate(C18PacketSpectate packetIn); + + void handleResourcePackStatus(C19PacketResourcePackStatus packetIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java new file mode 100644 index 0000000..95ac8ed --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java @@ -0,0 +1,40 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C00PacketKeepAlive implements Packet +{ + private int key; + + public C00PacketKeepAlive() + { + } + + public C00PacketKeepAlive(int key) + { + this.key = key; + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processKeepAlive(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.key = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.key); + } + + public int getKey() + { + return this.key; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java new file mode 100644 index 0000000..a8f77e1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java @@ -0,0 +1,45 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C01PacketChatMessage implements Packet +{ + private String message; + + public C01PacketChatMessage() + { + } + + public C01PacketChatMessage(String messageIn) + { + if (messageIn.length() > 100) + { + messageIn = messageIn.substring(0, 100); + } + + this.message = messageIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.message = buf.readStringFromBuffer(100); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.message); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processChatMessage(this); + } + + public String getMessage() + { + return this.message; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java new file mode 100644 index 0000000..59eba7c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java @@ -0,0 +1,83 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class C02PacketUseEntity implements Packet +{ + private int entityId; + private C02PacketUseEntity.Action action; + private Vec3 hitVec; + + public C02PacketUseEntity() + { + } + + public C02PacketUseEntity(Entity entity, C02PacketUseEntity.Action action) + { + this.entityId = entity.getEntityId(); + this.action = action; + } + + public C02PacketUseEntity(Entity entity, Vec3 hitVec) + { + this(entity, C02PacketUseEntity.Action.INTERACT_AT); + this.hitVec = hitVec; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.action = (C02PacketUseEntity.Action)buf.readEnumValue(C02PacketUseEntity.Action.class); + + if (this.action == C02PacketUseEntity.Action.INTERACT_AT) + { + this.hitVec = new Vec3((double)buf.readFloat(), (double)buf.readFloat(), (double)buf.readFloat()); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeEnumValue(this.action); + + if (this.action == C02PacketUseEntity.Action.INTERACT_AT) + { + buf.writeFloat((float)this.hitVec.xCoord); + buf.writeFloat((float)this.hitVec.yCoord); + buf.writeFloat((float)this.hitVec.zCoord); + } + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processUseEntity(this); + } + + public Entity getEntityFromWorld(World worldIn) + { + return worldIn.getEntityByID(this.entityId); + } + + public C02PacketUseEntity.Action getAction() + { + return this.action; + } + + public Vec3 getHitVec() + { + return this.hitVec; + } + + public static enum Action + { + INTERACT, + ATTACK, + INTERACT_AT; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java new file mode 100644 index 0000000..085a3fe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java @@ -0,0 +1,191 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C03PacketPlayer implements Packet +{ + protected double x; + protected double y; + protected double z; + protected float yaw; + protected float pitch; + protected boolean onGround; + protected boolean moving; + protected boolean rotating; + + public C03PacketPlayer() + { + } + + public C03PacketPlayer(boolean isOnGround) + { + this.onGround = isOnGround; + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayer(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.onGround = buf.readUnsignedByte() != 0; + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.onGround ? 1 : 0); + } + + public double getPositionX() + { + return this.x; + } + + public double getPositionY() + { + return this.y; + } + + public double getPositionZ() + { + return this.z; + } + + public float getYaw() + { + return this.yaw; + } + + public float getPitch() + { + return this.pitch; + } + + public boolean isOnGround() + { + return this.onGround; + } + + public boolean isMoving() + { + return this.moving; + } + + public boolean getRotating() + { + return this.rotating; + } + + public void setMoving(boolean isMoving) + { + this.moving = isMoving; + } + + public static class C04PacketPlayerPosition extends C03PacketPlayer + { + public C04PacketPlayerPosition() + { + this.moving = true; + } + + public C04PacketPlayerPosition(double posX, double posY, double posZ, boolean isOnGround) + { + this.x = posX; + this.y = posY; + this.z = posZ; + this.onGround = isOnGround; + this.moving = true; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.x = buf.readDouble(); + this.y = buf.readDouble(); + this.z = buf.readDouble(); + super.readPacketData(buf); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeDouble(this.x); + buf.writeDouble(this.y); + buf.writeDouble(this.z); + super.writePacketData(buf); + } + } + + public static class C05PacketPlayerLook extends C03PacketPlayer + { + public C05PacketPlayerLook() + { + this.rotating = true; + } + + public C05PacketPlayerLook(float playerYaw, float playerPitch, boolean isOnGround) + { + this.yaw = playerYaw; + this.pitch = playerPitch; + this.onGround = isOnGround; + this.rotating = true; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.yaw = buf.readFloat(); + this.pitch = buf.readFloat(); + super.readPacketData(buf); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeFloat(this.yaw); + buf.writeFloat(this.pitch); + super.writePacketData(buf); + } + } + + public static class C06PacketPlayerPosLook extends C03PacketPlayer + { + public C06PacketPlayerPosLook() + { + this.moving = true; + this.rotating = true; + } + + public C06PacketPlayerPosLook(double playerX, double playerY, double playerZ, float playerYaw, float playerPitch, boolean playerIsOnGround) + { + this.x = playerX; + this.y = playerY; + this.z = playerZ; + this.yaw = playerYaw; + this.pitch = playerPitch; + this.onGround = playerIsOnGround; + this.rotating = true; + this.moving = true; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.x = buf.readDouble(); + this.y = buf.readDouble(); + this.z = buf.readDouble(); + this.yaw = buf.readFloat(); + this.pitch = buf.readFloat(); + super.readPacketData(buf); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeDouble(this.x); + buf.writeDouble(this.y); + buf.writeDouble(this.z); + buf.writeFloat(this.yaw); + buf.writeFloat(this.pitch); + super.writePacketData(buf); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java new file mode 100644 index 0000000..d6222d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; + +public class C07PacketPlayerDigging implements Packet +{ + private BlockPos position; + private EnumFacing facing; + private C07PacketPlayerDigging.Action status; + + public C07PacketPlayerDigging() + { + } + + public C07PacketPlayerDigging(C07PacketPlayerDigging.Action statusIn, BlockPos posIn, EnumFacing facingIn) + { + this.status = statusIn; + this.position = posIn; + this.facing = facingIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.status = (C07PacketPlayerDigging.Action)buf.readEnumValue(C07PacketPlayerDigging.Action.class); + this.position = buf.readBlockPos(); + this.facing = EnumFacing.getFront(buf.readUnsignedByte()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeEnumValue(this.status); + buf.writeBlockPos(this.position); + buf.writeByte(this.facing.getIndex()); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayerDigging(this); + } + + public BlockPos getPosition() + { + return this.position; + } + + public EnumFacing getFacing() + { + return this.facing; + } + + public C07PacketPlayerDigging.Action getStatus() + { + return this.status; + } + + public static enum Action + { + START_DESTROY_BLOCK, + ABORT_DESTROY_BLOCK, + STOP_DESTROY_BLOCK, + DROP_ALL_ITEMS, + DROP_ITEM, + RELEASE_USE_ITEM; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java new file mode 100644 index 0000000..d03c9a4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java @@ -0,0 +1,93 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.util.BlockPos; + +public class C08PacketPlayerBlockPlacement implements Packet +{ + private static final BlockPos field_179726_a = new BlockPos(-1, -1, -1); + private BlockPos position; + private int placedBlockDirection; + private ItemStack stack; + private float facingX; + private float facingY; + private float facingZ; + + public C08PacketPlayerBlockPlacement() + { + } + + public C08PacketPlayerBlockPlacement(ItemStack stackIn) + { + this(field_179726_a, 255, stackIn, 0.0F, 0.0F, 0.0F); + } + + public C08PacketPlayerBlockPlacement(BlockPos positionIn, int placedBlockDirectionIn, ItemStack stackIn, float facingXIn, float facingYIn, float facingZIn) + { + this.position = positionIn; + this.placedBlockDirection = placedBlockDirectionIn; + this.stack = stackIn != null ? stackIn.copy() : null; + this.facingX = facingXIn; + this.facingY = facingYIn; + this.facingZ = facingZIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.position = buf.readBlockPos(); + this.placedBlockDirection = buf.readUnsignedByte(); + this.stack = buf.readItemStackFromBuffer(); + this.facingX = (float)buf.readUnsignedByte() / 16.0F; + this.facingY = (float)buf.readUnsignedByte() / 16.0F; + this.facingZ = (float)buf.readUnsignedByte() / 16.0F; + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.position); + buf.writeByte(this.placedBlockDirection); + buf.writeItemStackToBuffer(this.stack); + buf.writeByte((int)(this.facingX * 16.0F)); + buf.writeByte((int)(this.facingY * 16.0F)); + buf.writeByte((int)(this.facingZ * 16.0F)); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayerBlockPlacement(this); + } + + public BlockPos getPosition() + { + return this.position; + } + + public int getPlacedBlockDirection() + { + return this.placedBlockDirection; + } + + public ItemStack getStack() + { + return this.stack; + } + + public float getPlacedBlockOffsetX() + { + return this.facingX; + } + + public float getPlacedBlockOffsetY() + { + return this.facingY; + } + + public float getPlacedBlockOffsetZ() + { + return this.facingZ; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java new file mode 100644 index 0000000..fcdd103 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java @@ -0,0 +1,40 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C09PacketHeldItemChange implements Packet +{ + private int slotId; + + public C09PacketHeldItemChange() + { + } + + public C09PacketHeldItemChange(int slotId) + { + this.slotId = slotId; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.slotId = buf.readShort(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeShort(this.slotId); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processHeldItemChange(this); + } + + public int getSlotId() + { + return this.slotId; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java new file mode 100644 index 0000000..d784b89 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java @@ -0,0 +1,22 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0APacketAnimation implements Packet +{ + public void readPacketData(PacketBuffer buf) throws IOException + { + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.handleAnimation(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java new file mode 100644 index 0000000..7e7081a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0BPacketEntityAction implements Packet +{ + private int entityID; + private C0BPacketEntityAction.Action action; + private int auxData; + + public C0BPacketEntityAction() + { + } + + public C0BPacketEntityAction(Entity entity, C0BPacketEntityAction.Action action) + { + this(entity, action, 0); + } + + public C0BPacketEntityAction(Entity entity, C0BPacketEntityAction.Action action, int auxData) + { + this.entityID = entity.getEntityId(); + this.action = action; + this.auxData = auxData; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityID = buf.readVarIntFromBuffer(); + this.action = (C0BPacketEntityAction.Action)buf.readEnumValue(C0BPacketEntityAction.Action.class); + this.auxData = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityID); + buf.writeEnumValue(this.action); + buf.writeVarIntToBuffer(this.auxData); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processEntityAction(this); + } + + public C0BPacketEntityAction.Action getAction() + { + return this.action; + } + + public int getAuxData() + { + return this.auxData; + } + + public static enum Action + { + START_SNEAKING, + STOP_SNEAKING, + STOP_SLEEPING, + START_SPRINTING, + STOP_SPRINTING, + RIDING_JUMP, + OPEN_INVENTORY; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java new file mode 100644 index 0000000..22192ec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java @@ -0,0 +1,79 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0CPacketInput implements Packet +{ + private float strafeSpeed; + private float forwardSpeed; + private boolean jumping; + private boolean sneaking; + + public C0CPacketInput() + { + } + + public C0CPacketInput(float strafeSpeed, float forwardSpeed, boolean jumping, boolean sneaking) + { + this.strafeSpeed = strafeSpeed; + this.forwardSpeed = forwardSpeed; + this.jumping = jumping; + this.sneaking = sneaking; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.strafeSpeed = buf.readFloat(); + this.forwardSpeed = buf.readFloat(); + byte b0 = buf.readByte(); + this.jumping = (b0 & 1) > 0; + this.sneaking = (b0 & 2) > 0; + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeFloat(this.strafeSpeed); + buf.writeFloat(this.forwardSpeed); + byte b0 = 0; + + if (this.jumping) + { + b0 = (byte)(b0 | 1); + } + + if (this.sneaking) + { + b0 = (byte)(b0 | 2); + } + + buf.writeByte(b0); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processInput(this); + } + + public float getStrafeSpeed() + { + return this.strafeSpeed; + } + + public float getForwardSpeed() + { + return this.forwardSpeed; + } + + public boolean isJumping() + { + return this.jumping; + } + + public boolean isSneaking() + { + return this.sneaking; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java new file mode 100644 index 0000000..1cb6432 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java @@ -0,0 +1,35 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0DPacketCloseWindow implements Packet +{ + private int windowId; + + public C0DPacketCloseWindow() + { + } + + public C0DPacketCloseWindow(int windowId) + { + this.windowId = windowId; + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processCloseWindow(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java new file mode 100644 index 0000000..8e80f23 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java @@ -0,0 +1,86 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0EPacketClickWindow implements Packet +{ + private int windowId; + private int slotId; + private int usedButton; + private short actionNumber; + private ItemStack clickedItem; + private int mode; + + public C0EPacketClickWindow() + { + } + + public C0EPacketClickWindow(int windowId, int slotId, int usedButton, int mode, ItemStack clickedItem, short actionNumber) + { + this.windowId = windowId; + this.slotId = slotId; + this.usedButton = usedButton; + this.clickedItem = clickedItem != null ? clickedItem.copy() : null; + this.actionNumber = actionNumber; + this.mode = mode; + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processClickWindow(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readByte(); + this.slotId = buf.readShort(); + this.usedButton = buf.readByte(); + this.actionNumber = buf.readShort(); + this.mode = buf.readByte(); + this.clickedItem = buf.readItemStackFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeShort(this.slotId); + buf.writeByte(this.usedButton); + buf.writeShort(this.actionNumber); + buf.writeByte(this.mode); + buf.writeItemStackToBuffer(this.clickedItem); + } + + public int getWindowId() + { + return this.windowId; + } + + public int getSlotId() + { + return this.slotId; + } + + public int getUsedButton() + { + return this.usedButton; + } + + public short getActionNumber() + { + return this.actionNumber; + } + + public ItemStack getClickedItem() + { + return this.clickedItem; + } + + public int getMode() + { + return this.mode; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java new file mode 100644 index 0000000..371ca54 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java @@ -0,0 +1,53 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0FPacketConfirmTransaction implements Packet +{ + private int windowId; + private short uid; + private boolean accepted; + + public C0FPacketConfirmTransaction() + { + } + + public C0FPacketConfirmTransaction(int windowId, short uid, boolean accepted) + { + this.windowId = windowId; + this.uid = uid; + this.accepted = accepted; + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processConfirmTransaction(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readByte(); + this.uid = buf.readShort(); + this.accepted = buf.readByte() != 0; + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeShort(this.uid); + buf.writeByte(this.accepted ? 1 : 0); + } + + public int getWindowId() + { + return this.windowId; + } + + public short getUid() + { + return this.uid; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java new file mode 100644 index 0000000..e900519 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java @@ -0,0 +1,50 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C10PacketCreativeInventoryAction implements Packet +{ + private int slotId; + private ItemStack stack; + + public C10PacketCreativeInventoryAction() + { + } + + public C10PacketCreativeInventoryAction(int slotIdIn, ItemStack stackIn) + { + this.slotId = slotIdIn; + this.stack = stackIn != null ? stackIn.copy() : null; + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processCreativeInventoryAction(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.slotId = buf.readShort(); + this.stack = buf.readItemStackFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeShort(this.slotId); + buf.writeItemStackToBuffer(this.stack); + } + + public int getSlotId() + { + return this.slotId; + } + + public ItemStack getStack() + { + return this.stack; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java new file mode 100644 index 0000000..1cb8981 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java @@ -0,0 +1,49 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C11PacketEnchantItem implements Packet +{ + private int windowId; + private int button; + + public C11PacketEnchantItem() + { + } + + public C11PacketEnchantItem(int windowId, int button) + { + this.windowId = windowId; + this.button = button; + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processEnchantItem(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readByte(); + this.button = buf.readByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeByte(this.button); + } + + public int getWindowId() + { + return this.windowId; + } + + public int getButton() + { + return this.button; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java new file mode 100644 index 0000000..e47354f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java @@ -0,0 +1,64 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; + +public class C12PacketUpdateSign implements Packet +{ + private BlockPos pos; + private IChatComponent[] lines; + + public C12PacketUpdateSign() + { + } + + public C12PacketUpdateSign(BlockPos pos, IChatComponent[] lines) + { + this.pos = pos; + this.lines = new IChatComponent[] {lines[0], lines[1], lines[2], lines[3]}; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.pos = buf.readBlockPos(); + this.lines = new IChatComponent[4]; + + for (int i = 0; i < 4; ++i) + { + String s = buf.readStringFromBuffer(384); + IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + this.lines[i] = ichatcomponent; + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.pos); + + for (int i = 0; i < 4; ++i) + { + IChatComponent ichatcomponent = this.lines[i]; + String s = IChatComponent.Serializer.componentToJson(ichatcomponent); + buf.writeString(s); + } + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processUpdateSign(this); + } + + public BlockPos getPosition() + { + return this.pos; + } + + public IChatComponent[] getLines() + { + return this.lines; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java new file mode 100644 index 0000000..3fdfeeb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java @@ -0,0 +1,126 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C13PacketPlayerAbilities implements Packet +{ + private boolean invulnerable; + private boolean flying; + private boolean allowFlying; + private boolean creativeMode; + private float flySpeed; + private float walkSpeed; + + public C13PacketPlayerAbilities() + { + } + + public C13PacketPlayerAbilities(PlayerCapabilities capabilities) + { + this.setInvulnerable(capabilities.disableDamage); + this.setFlying(capabilities.isFlying); + this.setAllowFlying(capabilities.allowFlying); + this.setCreativeMode(capabilities.isCreativeMode); + this.setFlySpeed(capabilities.getFlySpeed()); + this.setWalkSpeed(capabilities.getWalkSpeed()); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + byte b0 = buf.readByte(); + this.setInvulnerable((b0 & 1) > 0); + this.setFlying((b0 & 2) > 0); + this.setAllowFlying((b0 & 4) > 0); + this.setCreativeMode((b0 & 8) > 0); + this.setFlySpeed(buf.readFloat()); + this.setWalkSpeed(buf.readFloat()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + byte b0 = 0; + + if (this.isInvulnerable()) + { + b0 = (byte)(b0 | 1); + } + + if (this.isFlying()) + { + b0 = (byte)(b0 | 2); + } + + if (this.isAllowFlying()) + { + b0 = (byte)(b0 | 4); + } + + if (this.isCreativeMode()) + { + b0 = (byte)(b0 | 8); + } + + buf.writeByte(b0); + buf.writeFloat(this.flySpeed); + buf.writeFloat(this.walkSpeed); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayerAbilities(this); + } + + public boolean isInvulnerable() + { + return this.invulnerable; + } + + public void setInvulnerable(boolean isInvulnerable) + { + this.invulnerable = isInvulnerable; + } + + public boolean isFlying() + { + return this.flying; + } + + public void setFlying(boolean isFlying) + { + this.flying = isFlying; + } + + public boolean isAllowFlying() + { + return this.allowFlying; + } + + public void setAllowFlying(boolean isAllowFlying) + { + this.allowFlying = isAllowFlying; + } + + public boolean isCreativeMode() + { + return this.creativeMode; + } + + public void setCreativeMode(boolean isCreativeMode) + { + this.creativeMode = isCreativeMode; + } + + public void setFlySpeed(float flySpeedIn) + { + this.flySpeed = flySpeedIn; + } + + public void setWalkSpeed(float walkSpeedIn) + { + this.walkSpeed = walkSpeedIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java new file mode 100644 index 0000000..f0d2733 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java @@ -0,0 +1,67 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.util.BlockPos; +import org.apache.commons.lang3.StringUtils; + +public class C14PacketTabComplete implements Packet +{ + private String message; + private BlockPos targetBlock; + + public C14PacketTabComplete() + { + } + + public C14PacketTabComplete(String msg) + { + this(msg, (BlockPos)null); + } + + public C14PacketTabComplete(String msg, BlockPos target) + { + this.message = msg; + this.targetBlock = target; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.message = buf.readStringFromBuffer(32767); + boolean flag = buf.readBoolean(); + + if (flag) + { + this.targetBlock = buf.readBlockPos(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(StringUtils.substring(this.message, 0, 32767)); + boolean flag = this.targetBlock != null; + buf.writeBoolean(flag); + + if (flag) + { + buf.writeBlockPos(this.targetBlock); + } + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processTabComplete(this); + } + + public String getMessage() + { + return this.message; + } + + public BlockPos getTargetBlock() + { + return this.targetBlock; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java new file mode 100644 index 0000000..930c797 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java @@ -0,0 +1,72 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C15PacketClientSettings implements Packet +{ + private String lang; + private int view; + private EntityPlayer.EnumChatVisibility chatVisibility; + private boolean enableColors; + private int modelPartFlags; + + public C15PacketClientSettings() + { + } + + public C15PacketClientSettings(String langIn, int viewIn, EntityPlayer.EnumChatVisibility chatVisibilityIn, boolean enableColorsIn, int modelPartFlagsIn) + { + this.lang = langIn; + this.view = viewIn; + this.chatVisibility = chatVisibilityIn; + this.enableColors = enableColorsIn; + this.modelPartFlags = modelPartFlagsIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.lang = buf.readStringFromBuffer(7); + this.view = buf.readByte(); + this.chatVisibility = EntityPlayer.EnumChatVisibility.getEnumChatVisibility(buf.readByte()); + this.enableColors = buf.readBoolean(); + this.modelPartFlags = buf.readUnsignedByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.lang); + buf.writeByte(this.view); + buf.writeByte(this.chatVisibility.getChatVisibility()); + buf.writeBoolean(this.enableColors); + buf.writeByte(this.modelPartFlags); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processClientSettings(this); + } + + public String getLang() + { + return this.lang; + } + + public EntityPlayer.EnumChatVisibility getChatVisibility() + { + return this.chatVisibility; + } + + public boolean isColorsEnabled() + { + return this.enableColors; + } + + public int getModelPartFlags() + { + return this.modelPartFlags; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java new file mode 100644 index 0000000..25c5d3d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java @@ -0,0 +1,47 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C16PacketClientStatus implements Packet +{ + private C16PacketClientStatus.EnumState status; + + public C16PacketClientStatus() + { + } + + public C16PacketClientStatus(C16PacketClientStatus.EnumState statusIn) + { + this.status = statusIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.status = (C16PacketClientStatus.EnumState)buf.readEnumValue(C16PacketClientStatus.EnumState.class); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeEnumValue(this.status); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processClientStatus(this); + } + + public C16PacketClientStatus.EnumState getStatus() + { + return this.status; + } + + public static enum EnumState + { + PERFORM_RESPAWN, + REQUEST_STATS, + OPEN_INVENTORY_ACHIEVEMENT; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java new file mode 100644 index 0000000..758aacb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java @@ -0,0 +1,65 @@ +package net.minecraft.network.play.client; + +import io.netty.buffer.ByteBuf; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +import java.io.IOException; + +public class C17PacketCustomPayload implements Packet +{ + private String channel; + private PacketBuffer data; + + public C17PacketCustomPayload() + { + } + + public C17PacketCustomPayload(String channelIn, PacketBuffer dataIn) + { + this.channel = channelIn; + this.data = dataIn; + + if (dataIn.writerIndex() > 32767) + { + throw new IllegalArgumentException("Payload may not be larger than 32767 bytes"); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.channel = buf.readStringFromBuffer(20); + int i = buf.readableBytes(); + + if (i >= 0 && i <= 32767) + { + this.data = new PacketBuffer(buf.readBytes(i)); + } + else + { + throw new IOException("Payload may not be larger than 32767 bytes"); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.channel); + buf.writeBytes((ByteBuf)this.data); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.processVanilla250Packet(this); + } + + public String getChannelName() + { + return this.channel; + } + + public PacketBuffer getBufferData() + { + return this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java new file mode 100644 index 0000000..34b377f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java @@ -0,0 +1,43 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.world.WorldServer; + +public class C18PacketSpectate implements Packet +{ + private UUID id; + + public C18PacketSpectate() + { + } + + public C18PacketSpectate(UUID id) + { + this.id = id; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.id = buf.readUuid(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeUuid(this.id); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.handleSpectate(this); + } + + public Entity getEntity(WorldServer worldIn) + { + return worldIn.getEntityFromUuid(this.id); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C19PacketResourcePackStatus.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C19PacketResourcePackStatus.java new file mode 100644 index 0000000..431a376 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/client/C19PacketResourcePackStatus.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C19PacketResourcePackStatus implements Packet +{ + private String hash; + private C19PacketResourcePackStatus.Action status; + + public C19PacketResourcePackStatus() + { + } + + public C19PacketResourcePackStatus(String hashIn, C19PacketResourcePackStatus.Action statusIn) + { + if (hashIn.length() > 40) + { + hashIn = hashIn.substring(0, 40); + } + + this.hash = hashIn; + this.status = statusIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.hash = buf.readStringFromBuffer(40); + this.status = (C19PacketResourcePackStatus.Action)buf.readEnumValue(C19PacketResourcePackStatus.Action.class); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.hash); + buf.writeEnumValue(this.status); + } + + public void processPacket(INetHandlerPlayServer handler) + { + handler.handleResourcePackStatus(this); + } + + public static enum Action + { + SUCCESSFULLY_LOADED, + DECLINED, + FAILED_DOWNLOAD, + ACCEPTED; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java new file mode 100644 index 0000000..be0f5de --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java @@ -0,0 +1,40 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S00PacketKeepAlive implements Packet +{ + private int id; + + public S00PacketKeepAlive() + { + } + + public S00PacketKeepAlive(int idIn) + { + this.id = idIn; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleKeepAlive(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.id = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.id); + } + + public int func_149134_c() + { + return this.id; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java new file mode 100644 index 0000000..fb7f7ed --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java @@ -0,0 +1,120 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class S01PacketJoinGame implements Packet +{ + private int entityId; + private boolean hardcoreMode; + private WorldSettings.GameType gameType; + private int dimension; + private EnumDifficulty difficulty; + private int maxPlayers; + private WorldType worldType; + private boolean reducedDebugInfo; + + public S01PacketJoinGame() + { + } + + public S01PacketJoinGame(int entityIdIn, WorldSettings.GameType gameTypeIn, boolean hardcoreModeIn, int dimensionIn, EnumDifficulty difficultyIn, int maxPlayersIn, WorldType worldTypeIn, boolean reducedDebugInfoIn) + { + this.entityId = entityIdIn; + this.dimension = dimensionIn; + this.difficulty = difficultyIn; + this.gameType = gameTypeIn; + this.maxPlayers = maxPlayersIn; + this.hardcoreMode = hardcoreModeIn; + this.worldType = worldTypeIn; + this.reducedDebugInfo = reducedDebugInfoIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readInt(); + int i = buf.readUnsignedByte(); + this.hardcoreMode = (i & 8) == 8; + i = i & -9; + this.gameType = WorldSettings.GameType.getByID(i); + this.dimension = buf.readByte(); + this.difficulty = EnumDifficulty.getDifficultyEnum(buf.readUnsignedByte()); + this.maxPlayers = buf.readUnsignedByte(); + this.worldType = WorldType.parseWorldType(buf.readStringFromBuffer(16)); + + if (this.worldType == null) + { + this.worldType = WorldType.DEFAULT; + } + + this.reducedDebugInfo = buf.readBoolean(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.entityId); + int i = this.gameType.getID(); + + if (this.hardcoreMode) + { + i |= 8; + } + + buf.writeByte(i); + buf.writeByte(this.dimension); + buf.writeByte(this.difficulty.getDifficultyId()); + buf.writeByte(this.maxPlayers); + buf.writeString(this.worldType.getWorldTypeName()); + buf.writeBoolean(this.reducedDebugInfo); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleJoinGame(this); + } + + public int getEntityId() + { + return this.entityId; + } + + public boolean isHardcoreMode() + { + return this.hardcoreMode; + } + + public WorldSettings.GameType getGameType() + { + return this.gameType; + } + + public int getDimension() + { + return this.dimension; + } + + public EnumDifficulty getDifficulty() + { + return this.difficulty; + } + + public int getMaxPlayers() + { + return this.maxPlayers; + } + + public WorldType getWorldType() + { + return this.worldType; + } + + public boolean isReducedDebugInfo() + { + return this.reducedDebugInfo; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S02PacketChat.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S02PacketChat.java new file mode 100644 index 0000000..abf0161 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S02PacketChat.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S02PacketChat implements Packet +{ + private IChatComponent chatComponent; + private byte type; + + public S02PacketChat() + { + } + + public S02PacketChat(IChatComponent component) + { + this(component, (byte)1); + } + + public S02PacketChat(IChatComponent message, byte typeIn) + { + this.chatComponent = message; + this.type = typeIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.chatComponent = buf.readChatComponent(); + this.type = buf.readByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeChatComponent(this.chatComponent); + buf.writeByte(this.type); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleChat(this); + } + + public IChatComponent getChatComponent() + { + return this.chatComponent; + } + + public boolean isChat() + { + return this.type == 1 || this.type == 2; + } + + public byte getType() + { + return this.type; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java new file mode 100644 index 0000000..66a4bcb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S03PacketTimeUpdate implements Packet +{ + private long totalWorldTime; + private long worldTime; + + public S03PacketTimeUpdate() + { + } + + public S03PacketTimeUpdate(long totalWorldTimeIn, long totalTimeIn, boolean doDayLightCycle) + { + this.totalWorldTime = totalWorldTimeIn; + this.worldTime = totalTimeIn; + + if (!doDayLightCycle) + { + this.worldTime = -this.worldTime; + + if (this.worldTime == 0L) + { + this.worldTime = -1L; + } + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.totalWorldTime = buf.readLong(); + this.worldTime = buf.readLong(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeLong(this.totalWorldTime); + buf.writeLong(this.worldTime); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleTimeUpdate(this); + } + + public long getTotalWorldTime() + { + return this.totalWorldTime; + } + + public long getWorldTime() + { + return this.worldTime; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java new file mode 100644 index 0000000..72ce1d2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S04PacketEntityEquipment implements Packet +{ + private int entityID; + private int equipmentSlot; + private ItemStack itemStack; + + public S04PacketEntityEquipment() + { + } + + public S04PacketEntityEquipment(int entityIDIn, int p_i45221_2_, ItemStack itemStackIn) + { + this.entityID = entityIDIn; + this.equipmentSlot = p_i45221_2_; + this.itemStack = itemStackIn == null ? null : itemStackIn.copy(); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityID = buf.readVarIntFromBuffer(); + this.equipmentSlot = buf.readShort(); + this.itemStack = buf.readItemStackFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityID); + buf.writeShort(this.equipmentSlot); + buf.writeItemStackToBuffer(this.itemStack); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityEquipment(this); + } + + public ItemStack getItemStack() + { + return this.itemStack; + } + + public int getEntityID() + { + return this.entityID; + } + + public int getEquipmentSlot() + { + return this.equipmentSlot; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java new file mode 100644 index 0000000..754e7b3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java @@ -0,0 +1,41 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; + +public class S05PacketSpawnPosition implements Packet +{ + private BlockPos spawnBlockPos; + + public S05PacketSpawnPosition() + { + } + + public S05PacketSpawnPosition(BlockPos spawnBlockPosIn) + { + this.spawnBlockPos = spawnBlockPosIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.spawnBlockPos = buf.readBlockPos(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.spawnBlockPos); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnPosition(this); + } + + public BlockPos getSpawnPos() + { + return this.spawnBlockPos; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java new file mode 100644 index 0000000..d85376e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java @@ -0,0 +1,58 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S06PacketUpdateHealth implements Packet +{ + private float health; + private int foodLevel; + private float saturationLevel; + + public S06PacketUpdateHealth() + { + } + + public S06PacketUpdateHealth(float healthIn, int foodLevelIn, float saturationIn) + { + this.health = healthIn; + this.foodLevel = foodLevelIn; + this.saturationLevel = saturationIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.health = buf.readFloat(); + this.foodLevel = buf.readVarIntFromBuffer(); + this.saturationLevel = buf.readFloat(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeFloat(this.health); + buf.writeVarIntToBuffer(this.foodLevel); + buf.writeFloat(this.saturationLevel); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateHealth(this); + } + + public float getHealth() + { + return this.health; + } + + public int getFoodLevel() + { + return this.foodLevel; + } + + public float getSaturationLevel() + { + return this.saturationLevel; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java new file mode 100644 index 0000000..aa6d40e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java @@ -0,0 +1,75 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class S07PacketRespawn implements Packet +{ + private int dimensionID; + private EnumDifficulty difficulty; + private WorldSettings.GameType gameType; + private WorldType worldType; + + public S07PacketRespawn() + { + } + + public S07PacketRespawn(int dimensionIDIn, EnumDifficulty difficultyIn, WorldType worldTypeIn, WorldSettings.GameType gameTypeIn) + { + this.dimensionID = dimensionIDIn; + this.difficulty = difficultyIn; + this.gameType = gameTypeIn; + this.worldType = worldTypeIn; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleRespawn(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.dimensionID = buf.readInt(); + this.difficulty = EnumDifficulty.getDifficultyEnum(buf.readUnsignedByte()); + this.gameType = WorldSettings.GameType.getByID(buf.readUnsignedByte()); + this.worldType = WorldType.parseWorldType(buf.readStringFromBuffer(16)); + + if (this.worldType == null) + { + this.worldType = WorldType.DEFAULT; + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.dimensionID); + buf.writeByte(this.difficulty.getDifficultyId()); + buf.writeByte(this.gameType.getID()); + buf.writeString(this.worldType.getWorldTypeName()); + } + + public int getDimensionID() + { + return this.dimensionID; + } + + public EnumDifficulty getDifficulty() + { + return this.difficulty; + } + + public WorldSettings.GameType getGameType() + { + return this.gameType; + } + + public WorldType getWorldType() + { + return this.worldType; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java new file mode 100644 index 0000000..9ebc6d1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java @@ -0,0 +1,140 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.EnumSet; +import java.util.Set; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S08PacketPlayerPosLook implements Packet +{ + private double x; + private double y; + private double z; + private float yaw; + private float pitch; + private Set field_179835_f; + + public S08PacketPlayerPosLook() + { + } + + public S08PacketPlayerPosLook(double xIn, double yIn, double zIn, float yawIn, float pitchIn, Set p_i45993_9_) + { + this.x = xIn; + this.y = yIn; + this.z = zIn; + this.yaw = yawIn; + this.pitch = pitchIn; + this.field_179835_f = p_i45993_9_; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.x = buf.readDouble(); + this.y = buf.readDouble(); + this.z = buf.readDouble(); + this.yaw = buf.readFloat(); + this.pitch = buf.readFloat(); + this.field_179835_f = S08PacketPlayerPosLook.EnumFlags.func_180053_a(buf.readUnsignedByte()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeDouble(this.x); + buf.writeDouble(this.y); + buf.writeDouble(this.z); + buf.writeFloat(this.yaw); + buf.writeFloat(this.pitch); + buf.writeByte(S08PacketPlayerPosLook.EnumFlags.func_180056_a(this.field_179835_f)); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handlePlayerPosLook(this); + } + + public double getX() + { + return this.x; + } + + public double getY() + { + return this.y; + } + + public double getZ() + { + return this.z; + } + + public float getYaw() + { + return this.yaw; + } + + public float getPitch() + { + return this.pitch; + } + + public Set func_179834_f() + { + return this.field_179835_f; + } + + public static enum EnumFlags + { + X(0), + Y(1), + Z(2), + Y_ROT(3), + X_ROT(4); + + private int field_180058_f; + + private EnumFlags(int p_i45992_3_) + { + this.field_180058_f = p_i45992_3_; + } + + private int func_180055_a() + { + return 1 << this.field_180058_f; + } + + private boolean func_180054_b(int p_180054_1_) + { + return (p_180054_1_ & this.func_180055_a()) == this.func_180055_a(); + } + + public static Set func_180053_a(int p_180053_0_) + { + Set set = EnumSet.noneOf(S08PacketPlayerPosLook.EnumFlags.class); + + for (S08PacketPlayerPosLook.EnumFlags s08packetplayerposlook$enumflags : values()) + { + if (s08packetplayerposlook$enumflags.func_180054_b(p_180053_0_)) + { + set.add(s08packetplayerposlook$enumflags); + } + } + + return set; + } + + public static int func_180056_a(Set p_180056_0_) + { + int i = 0; + + for (S08PacketPlayerPosLook.EnumFlags s08packetplayerposlook$enumflags : p_180056_0_) + { + i |= s08packetplayerposlook$enumflags.func_180055_a(); + } + + return i; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java new file mode 100644 index 0000000..04ad9e0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java @@ -0,0 +1,40 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S09PacketHeldItemChange implements Packet +{ + private int heldItemHotbarIndex; + + public S09PacketHeldItemChange() + { + } + + public S09PacketHeldItemChange(int hotbarIndexIn) + { + this.heldItemHotbarIndex = hotbarIndexIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.heldItemHotbarIndex = buf.readByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.heldItemHotbarIndex); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleHeldItemChange(this); + } + + public int getHeldItemHotbarIndex() + { + return this.heldItemHotbarIndex; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java new file mode 100644 index 0000000..af6eeae --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class S0APacketUseBed implements Packet +{ + private int playerID; + private BlockPos bedPos; + + public S0APacketUseBed() + { + } + + public S0APacketUseBed(EntityPlayer player, BlockPos bedPosIn) + { + this.playerID = player.getEntityId(); + this.bedPos = bedPosIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.playerID = buf.readVarIntFromBuffer(); + this.bedPos = buf.readBlockPos(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.playerID); + buf.writeBlockPos(this.bedPos); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUseBed(this); + } + + public EntityPlayer getPlayer(World worldIn) + { + return (EntityPlayer)worldIn.getEntityByID(this.playerID); + } + + public BlockPos getBedPosition() + { + return this.bedPos; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java new file mode 100644 index 0000000..a79e267 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java @@ -0,0 +1,50 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S0BPacketAnimation implements Packet +{ + private int entityId; + private int type; + + public S0BPacketAnimation() + { + } + + public S0BPacketAnimation(Entity ent, int animationType) + { + this.entityId = ent.getEntityId(); + this.type = animationType; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.type = buf.readUnsignedByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeByte(this.type); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleAnimation(this); + } + + public int getEntityID() + { + return this.entityId; + } + + public int getAnimationType() + { + return this.type; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java new file mode 100644 index 0000000..0c1668e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java @@ -0,0 +1,126 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0CPacketSpawnPlayer implements Packet +{ + private int entityId; + private UUID playerId; + private int x; + private int y; + private int z; + private byte yaw; + private byte pitch; + private int currentItem; + private DataWatcher watcher; + private List field_148958_j; + + public S0CPacketSpawnPlayer() + { + } + + public S0CPacketSpawnPlayer(EntityPlayer player) + { + this.entityId = player.getEntityId(); + this.playerId = player.getGameProfile().getId(); + this.x = MathHelper.floor_double(player.posX * 32.0D); + this.y = MathHelper.floor_double(player.posY * 32.0D); + this.z = MathHelper.floor_double(player.posZ * 32.0D); + this.yaw = (byte)((int)(player.rotationYaw * 256.0F / 360.0F)); + this.pitch = (byte)((int)(player.rotationPitch * 256.0F / 360.0F)); + ItemStack itemstack = player.inventory.getCurrentItem(); + this.currentItem = itemstack == null ? 0 : Item.getIdFromItem(itemstack.getItem()); + this.watcher = player.getDataWatcher(); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.playerId = buf.readUuid(); + this.x = buf.readInt(); + this.y = buf.readInt(); + this.z = buf.readInt(); + this.yaw = buf.readByte(); + this.pitch = buf.readByte(); + this.currentItem = buf.readShort(); + this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(buf); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeUuid(this.playerId); + buf.writeInt(this.x); + buf.writeInt(this.y); + buf.writeInt(this.z); + buf.writeByte(this.yaw); + buf.writeByte(this.pitch); + buf.writeShort(this.currentItem); + this.watcher.writeTo(buf); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnPlayer(this); + } + + public List func_148944_c() + { + if (this.field_148958_j == null) + { + this.field_148958_j = this.watcher.getAllWatched(); + } + + return this.field_148958_j; + } + + public int getEntityID() + { + return this.entityId; + } + + public UUID getPlayer() + { + return this.playerId; + } + + public int getX() + { + return this.x; + } + + public int getY() + { + return this.y; + } + + public int getZ() + { + return this.z; + } + + public byte getYaw() + { + return this.yaw; + } + + public byte getPitch() + { + return this.pitch; + } + + public int getCurrentItemID() + { + return this.currentItem; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java new file mode 100644 index 0000000..84e53b2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java @@ -0,0 +1,49 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S0DPacketCollectItem implements Packet +{ + private int collectedItemEntityId; + private int entityId; + + public S0DPacketCollectItem() + { + } + + public S0DPacketCollectItem(int collectedItemEntityIdIn, int entityIdIn) + { + this.collectedItemEntityId = collectedItemEntityIdIn; + this.entityId = entityIdIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.collectedItemEntityId = buf.readVarIntFromBuffer(); + this.entityId = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.collectedItemEntityId); + buf.writeVarIntToBuffer(this.entityId); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCollectItem(this); + } + + public int getCollectedItemEntityID() + { + return this.collectedItemEntityId; + } + + public int getEntityID() + { + return this.entityId; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java new file mode 100644 index 0000000..89b9549 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java @@ -0,0 +1,219 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0EPacketSpawnObject implements Packet +{ + private int entityId; + private int x; + private int y; + private int z; + private int speedX; + private int speedY; + private int speedZ; + private int pitch; + private int yaw; + private int type; + private int field_149020_k; + + public S0EPacketSpawnObject() + { + } + + public S0EPacketSpawnObject(Entity entityIn, int typeIn) + { + this(entityIn, typeIn, 0); + } + + public S0EPacketSpawnObject(Entity entityIn, int typeIn, int p_i45166_3_) + { + this.entityId = entityIn.getEntityId(); + this.x = MathHelper.floor_double(entityIn.posX * 32.0D); + this.y = MathHelper.floor_double(entityIn.posY * 32.0D); + this.z = MathHelper.floor_double(entityIn.posZ * 32.0D); + this.pitch = MathHelper.floor_float(entityIn.rotationPitch * 256.0F / 360.0F); + this.yaw = MathHelper.floor_float(entityIn.rotationYaw * 256.0F / 360.0F); + this.type = typeIn; + this.field_149020_k = p_i45166_3_; + + if (p_i45166_3_ > 0) + { + double d0 = entityIn.motionX; + double d1 = entityIn.motionY; + double d2 = entityIn.motionZ; + double d3 = 3.9D; + + if (d0 < -d3) + { + d0 = -d3; + } + + if (d1 < -d3) + { + d1 = -d3; + } + + if (d2 < -d3) + { + d2 = -d3; + } + + if (d0 > d3) + { + d0 = d3; + } + + if (d1 > d3) + { + d1 = d3; + } + + if (d2 > d3) + { + d2 = d3; + } + + this.speedX = (int)(d0 * 8000.0D); + this.speedY = (int)(d1 * 8000.0D); + this.speedZ = (int)(d2 * 8000.0D); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.type = buf.readByte(); + this.x = buf.readInt(); + this.y = buf.readInt(); + this.z = buf.readInt(); + this.pitch = buf.readByte(); + this.yaw = buf.readByte(); + this.field_149020_k = buf.readInt(); + + if (this.field_149020_k > 0) + { + this.speedX = buf.readShort(); + this.speedY = buf.readShort(); + this.speedZ = buf.readShort(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeByte(this.type); + buf.writeInt(this.x); + buf.writeInt(this.y); + buf.writeInt(this.z); + buf.writeByte(this.pitch); + buf.writeByte(this.yaw); + buf.writeInt(this.field_149020_k); + + if (this.field_149020_k > 0) + { + buf.writeShort(this.speedX); + buf.writeShort(this.speedY); + buf.writeShort(this.speedZ); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnObject(this); + } + + public int getEntityID() + { + return this.entityId; + } + + public int getX() + { + return this.x; + } + + public int getY() + { + return this.y; + } + + public int getZ() + { + return this.z; + } + + public int getSpeedX() + { + return this.speedX; + } + + public int getSpeedY() + { + return this.speedY; + } + + public int getSpeedZ() + { + return this.speedZ; + } + + public int getPitch() + { + return this.pitch; + } + + public int getYaw() + { + return this.yaw; + } + + public int getType() + { + return this.type; + } + + public int func_149009_m() + { + return this.field_149020_k; + } + + public void setX(int newX) + { + this.x = newX; + } + + public void setY(int newY) + { + this.y = newY; + } + + public void setZ(int newZ) + { + this.z = newZ; + } + + public void setSpeedX(int newSpeedX) + { + this.speedX = newSpeedX; + } + + public void setSpeedY(int newSpeedY) + { + this.speedY = newSpeedY; + } + + public void setSpeedZ(int newSpeedZ) + { + this.speedZ = newSpeedZ; + } + + public void func_149002_g(int p_149002_1_) + { + this.field_149020_k = p_149002_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java new file mode 100644 index 0000000..c28c08e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java @@ -0,0 +1,185 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0FPacketSpawnMob implements Packet +{ + private int entityId; + private int type; + private int x; + private int y; + private int z; + private int velocityX; + private int velocityY; + private int velocityZ; + private byte yaw; + private byte pitch; + private byte headPitch; + private DataWatcher field_149043_l; + private List watcher; + + public S0FPacketSpawnMob() + { + } + + public S0FPacketSpawnMob(EntityLivingBase entityIn) + { + this.entityId = entityIn.getEntityId(); + this.type = (byte)EntityList.getEntityID(entityIn); + this.x = MathHelper.floor_double(entityIn.posX * 32.0D); + this.y = MathHelper.floor_double(entityIn.posY * 32.0D); + this.z = MathHelper.floor_double(entityIn.posZ * 32.0D); + this.yaw = (byte)((int)(entityIn.rotationYaw * 256.0F / 360.0F)); + this.pitch = (byte)((int)(entityIn.rotationPitch * 256.0F / 360.0F)); + this.headPitch = (byte)((int)(entityIn.rotationYawHead * 256.0F / 360.0F)); + double d0 = 3.9D; + double d1 = entityIn.motionX; + double d2 = entityIn.motionY; + double d3 = entityIn.motionZ; + + if (d1 < -d0) + { + d1 = -d0; + } + + if (d2 < -d0) + { + d2 = -d0; + } + + if (d3 < -d0) + { + d3 = -d0; + } + + if (d1 > d0) + { + d1 = d0; + } + + if (d2 > d0) + { + d2 = d0; + } + + if (d3 > d0) + { + d3 = d0; + } + + this.velocityX = (int)(d1 * 8000.0D); + this.velocityY = (int)(d2 * 8000.0D); + this.velocityZ = (int)(d3 * 8000.0D); + this.field_149043_l = entityIn.getDataWatcher(); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.type = buf.readByte() & 255; + this.x = buf.readInt(); + this.y = buf.readInt(); + this.z = buf.readInt(); + this.yaw = buf.readByte(); + this.pitch = buf.readByte(); + this.headPitch = buf.readByte(); + this.velocityX = buf.readShort(); + this.velocityY = buf.readShort(); + this.velocityZ = buf.readShort(); + this.watcher = DataWatcher.readWatchedListFromPacketBuffer(buf); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeByte(this.type & 255); + buf.writeInt(this.x); + buf.writeInt(this.y); + buf.writeInt(this.z); + buf.writeByte(this.yaw); + buf.writeByte(this.pitch); + buf.writeByte(this.headPitch); + buf.writeShort(this.velocityX); + buf.writeShort(this.velocityY); + buf.writeShort(this.velocityZ); + this.field_149043_l.writeTo(buf); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnMob(this); + } + + public List func_149027_c() + { + if (this.watcher == null) + { + this.watcher = this.field_149043_l.getAllWatched(); + } + + return this.watcher; + } + + public int getEntityID() + { + return this.entityId; + } + + public int getEntityType() + { + return this.type; + } + + public int getX() + { + return this.x; + } + + public int getY() + { + return this.y; + } + + public int getZ() + { + return this.z; + } + + public int getVelocityX() + { + return this.velocityX; + } + + public int getVelocityY() + { + return this.velocityY; + } + + public int getVelocityZ() + { + return this.velocityZ; + } + + public byte getYaw() + { + return this.yaw; + } + + public byte getPitch() + { + return this.pitch; + } + + public byte getHeadPitch() + { + return this.headPitch; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java new file mode 100644 index 0000000..479144f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; + +public class S10PacketSpawnPainting implements Packet +{ + private int entityID; + private BlockPos position; + private EnumFacing facing; + private String title; + + public S10PacketSpawnPainting() + { + } + + public S10PacketSpawnPainting(EntityPainting painting) + { + this.entityID = painting.getEntityId(); + this.position = painting.getHangingPosition(); + this.facing = painting.facingDirection; + this.title = painting.art.title; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityID = buf.readVarIntFromBuffer(); + this.title = buf.readStringFromBuffer(EntityPainting.EnumArt.field_180001_A); + this.position = buf.readBlockPos(); + this.facing = EnumFacing.getHorizontal(buf.readUnsignedByte()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityID); + buf.writeString(this.title); + buf.writeBlockPos(this.position); + buf.writeByte(this.facing.getHorizontalIndex()); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnPainting(this); + } + + public int getEntityID() + { + return this.entityID; + } + + public BlockPos getPosition() + { + return this.position; + } + + public EnumFacing getFacing() + { + return this.facing; + } + + public String getTitle() + { + return this.title; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java new file mode 100644 index 0000000..488c61c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java @@ -0,0 +1,78 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S11PacketSpawnExperienceOrb implements Packet +{ + private int entityID; + private int posX; + private int posY; + private int posZ; + private int xpValue; + + public S11PacketSpawnExperienceOrb() + { + } + + public S11PacketSpawnExperienceOrb(EntityXPOrb xpOrb) + { + this.entityID = xpOrb.getEntityId(); + this.posX = MathHelper.floor_double(xpOrb.posX * 32.0D); + this.posY = MathHelper.floor_double(xpOrb.posY * 32.0D); + this.posZ = MathHelper.floor_double(xpOrb.posZ * 32.0D); + this.xpValue = xpOrb.getXpValue(); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityID = buf.readVarIntFromBuffer(); + this.posX = buf.readInt(); + this.posY = buf.readInt(); + this.posZ = buf.readInt(); + this.xpValue = buf.readShort(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityID); + buf.writeInt(this.posX); + buf.writeInt(this.posY); + buf.writeInt(this.posZ); + buf.writeShort(this.xpValue); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnExperienceOrb(this); + } + + public int getEntityID() + { + return this.entityID; + } + + public int getX() + { + return this.posX; + } + + public int getY() + { + return this.posY; + } + + public int getZ() + { + return this.posZ; + } + + public int getXPValue() + { + return this.xpValue; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java new file mode 100644 index 0000000..f5fa0d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java @@ -0,0 +1,105 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S12PacketEntityVelocity implements Packet +{ + private int entityID; + private int motionX; + private int motionY; + private int motionZ; + + public S12PacketEntityVelocity() + { + } + + public S12PacketEntityVelocity(Entity entityIn) + { + this(entityIn.getEntityId(), entityIn.motionX, entityIn.motionY, entityIn.motionZ); + } + + public S12PacketEntityVelocity(int entityIDIn, double motionXIn, double motionYIn, double motionZIn) + { + this.entityID = entityIDIn; + double d0 = 3.9D; + + if (motionXIn < -d0) + { + motionXIn = -d0; + } + + if (motionYIn < -d0) + { + motionYIn = -d0; + } + + if (motionZIn < -d0) + { + motionZIn = -d0; + } + + if (motionXIn > d0) + { + motionXIn = d0; + } + + if (motionYIn > d0) + { + motionYIn = d0; + } + + if (motionZIn > d0) + { + motionZIn = d0; + } + + this.motionX = (int)(motionXIn * 8000.0D); + this.motionY = (int)(motionYIn * 8000.0D); + this.motionZ = (int)(motionZIn * 8000.0D); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityID = buf.readVarIntFromBuffer(); + this.motionX = buf.readShort(); + this.motionY = buf.readShort(); + this.motionZ = buf.readShort(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityID); + buf.writeShort(this.motionX); + buf.writeShort(this.motionY); + buf.writeShort(this.motionZ); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityVelocity(this); + } + + public int getEntityID() + { + return this.entityID; + } + + public int getMotionX() + { + return this.motionX; + } + + public int getMotionY() + { + return this.motionY; + } + + public int getMotionZ() + { + return this.motionZ; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java new file mode 100644 index 0000000..4b786b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java @@ -0,0 +1,50 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S13PacketDestroyEntities implements Packet +{ + private int[] entityIDs; + + public S13PacketDestroyEntities() + { + } + + public S13PacketDestroyEntities(int... entityIDsIn) + { + this.entityIDs = entityIDsIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityIDs = new int[buf.readVarIntFromBuffer()]; + + for (int i = 0; i < this.entityIDs.length; ++i) + { + this.entityIDs[i] = buf.readVarIntFromBuffer(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityIDs.length); + + for (int i = 0; i < this.entityIDs.length; ++i) + { + buf.writeVarIntToBuffer(this.entityIDs[i]); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleDestroyEntities(this); + } + + public int[] getEntityIDs() + { + return this.entityIDs; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java new file mode 100644 index 0000000..09e544f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java @@ -0,0 +1,198 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S14PacketEntity implements Packet +{ + protected int entityId; + protected byte posX; + protected byte posY; + protected byte posZ; + protected byte yaw; + protected byte pitch; + protected boolean onGround; + protected boolean field_149069_g; + + public S14PacketEntity() + { + } + + public S14PacketEntity(int entityIdIn) + { + this.entityId = entityIdIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityMovement(this); + } + + public String toString() + { + return "Entity_" + super.toString(); + } + + public Entity getEntity(World worldIn) + { + return worldIn.getEntityByID(this.entityId); + } + + public byte func_149062_c() + { + return this.posX; + } + + public byte func_149061_d() + { + return this.posY; + } + + public byte func_149064_e() + { + return this.posZ; + } + + public byte func_149066_f() + { + return this.yaw; + } + + public byte func_149063_g() + { + return this.pitch; + } + + public boolean func_149060_h() + { + return this.field_149069_g; + } + + public boolean getOnGround() + { + return this.onGround; + } + + public static class S15PacketEntityRelMove extends S14PacketEntity + { + public S15PacketEntityRelMove() + { + } + + public S15PacketEntityRelMove(int entityIdIn, byte x, byte y, byte z, boolean onGroundIn) + { + super(entityIdIn); + this.posX = x; + this.posY = y; + this.posZ = z; + this.onGround = onGroundIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + super.readPacketData(buf); + this.posX = buf.readByte(); + this.posY = buf.readByte(); + this.posZ = buf.readByte(); + this.onGround = buf.readBoolean(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + super.writePacketData(buf); + buf.writeByte(this.posX); + buf.writeByte(this.posY); + buf.writeByte(this.posZ); + buf.writeBoolean(this.onGround); + } + } + + public static class S16PacketEntityLook extends S14PacketEntity + { + public S16PacketEntityLook() + { + this.field_149069_g = true; + } + + public S16PacketEntityLook(int entityIdIn, byte yawIn, byte pitchIn, boolean onGroundIn) + { + super(entityIdIn); + this.yaw = yawIn; + this.pitch = pitchIn; + this.field_149069_g = true; + this.onGround = onGroundIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + super.readPacketData(buf); + this.yaw = buf.readByte(); + this.pitch = buf.readByte(); + this.onGround = buf.readBoolean(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + super.writePacketData(buf); + buf.writeByte(this.yaw); + buf.writeByte(this.pitch); + buf.writeBoolean(this.onGround); + } + } + + public static class S17PacketEntityLookMove extends S14PacketEntity + { + public S17PacketEntityLookMove() + { + this.field_149069_g = true; + } + + public S17PacketEntityLookMove(int p_i45973_1_, byte p_i45973_2_, byte p_i45973_3_, byte p_i45973_4_, byte p_i45973_5_, byte p_i45973_6_, boolean p_i45973_7_) + { + super(p_i45973_1_); + this.posX = p_i45973_2_; + this.posY = p_i45973_3_; + this.posZ = p_i45973_4_; + this.yaw = p_i45973_5_; + this.pitch = p_i45973_6_; + this.onGround = p_i45973_7_; + this.field_149069_g = true; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + super.readPacketData(buf); + this.posX = buf.readByte(); + this.posY = buf.readByte(); + this.posZ = buf.readByte(); + this.yaw = buf.readByte(); + this.pitch = buf.readByte(); + this.onGround = buf.readBoolean(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + super.writePacketData(buf); + buf.writeByte(this.posX); + buf.writeByte(this.posY); + buf.writeByte(this.posZ); + buf.writeByte(this.yaw); + buf.writeByte(this.pitch); + buf.writeBoolean(this.onGround); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java new file mode 100644 index 0000000..920f9b4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java @@ -0,0 +1,107 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S18PacketEntityTeleport implements Packet +{ + private int entityId; + private int posX; + private int posY; + private int posZ; + private byte yaw; + private byte pitch; + private boolean onGround; + + public S18PacketEntityTeleport() + { + } + + public S18PacketEntityTeleport(Entity entityIn) + { + this.entityId = entityIn.getEntityId(); + this.posX = MathHelper.floor_double(entityIn.posX * 32.0D); + this.posY = MathHelper.floor_double(entityIn.posY * 32.0D); + this.posZ = MathHelper.floor_double(entityIn.posZ * 32.0D); + this.yaw = (byte)((int)(entityIn.rotationYaw * 256.0F / 360.0F)); + this.pitch = (byte)((int)(entityIn.rotationPitch * 256.0F / 360.0F)); + this.onGround = entityIn.onGround; + } + + public S18PacketEntityTeleport(int entityIdIn, int posXIn, int posYIn, int posZIn, byte yawIn, byte pitchIn, boolean onGroundIn) + { + this.entityId = entityIdIn; + this.posX = posXIn; + this.posY = posYIn; + this.posZ = posZIn; + this.yaw = yawIn; + this.pitch = pitchIn; + this.onGround = onGroundIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.posX = buf.readInt(); + this.posY = buf.readInt(); + this.posZ = buf.readInt(); + this.yaw = buf.readByte(); + this.pitch = buf.readByte(); + this.onGround = buf.readBoolean(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeInt(this.posX); + buf.writeInt(this.posY); + buf.writeInt(this.posZ); + buf.writeByte(this.yaw); + buf.writeByte(this.pitch); + buf.writeBoolean(this.onGround); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityTeleport(this); + } + + public int getEntityId() + { + return this.entityId; + } + + public int getX() + { + return this.posX; + } + + public int getY() + { + return this.posY; + } + + public int getZ() + { + return this.posZ; + } + + public byte getYaw() + { + return this.yaw; + } + + public byte getPitch() + { + return this.pitch; + } + + public boolean getOnGround() + { + return this.onGround; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java new file mode 100644 index 0000000..16ae5b1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java @@ -0,0 +1,51 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S19PacketEntityHeadLook implements Packet +{ + private int entityId; + private byte yaw; + + public S19PacketEntityHeadLook() + { + } + + public S19PacketEntityHeadLook(Entity entityIn, byte p_i45214_2_) + { + this.entityId = entityIn.getEntityId(); + this.yaw = p_i45214_2_; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.yaw = buf.readByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeByte(this.yaw); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityHeadLook(this); + } + + public Entity getEntity(World worldIn) + { + return worldIn.getEntityByID(this.entityId); + } + + public byte getYaw() + { + return this.yaw; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java new file mode 100644 index 0000000..6c0b133 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java @@ -0,0 +1,51 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S19PacketEntityStatus implements Packet +{ + private int entityId; + private byte logicOpcode; + + public S19PacketEntityStatus() + { + } + + public S19PacketEntityStatus(Entity entityIn, byte opCodeIn) + { + this.entityId = entityIn.getEntityId(); + this.logicOpcode = opCodeIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readInt(); + this.logicOpcode = buf.readByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.entityId); + buf.writeByte(this.logicOpcode); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityStatus(this); + } + + public Entity getEntity(World worldIn) + { + return worldIn.getEntityByID(this.entityId); + } + + public byte getOpCode() + { + return this.logicOpcode; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java new file mode 100644 index 0000000..eeae92e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1BPacketEntityAttach implements Packet +{ + private int leash; + private int entityId; + private int vehicleEntityId; + + public S1BPacketEntityAttach() + { + } + + public S1BPacketEntityAttach(int leashIn, Entity entityIn, Entity vehicle) + { + this.leash = leashIn; + this.entityId = entityIn.getEntityId(); + this.vehicleEntityId = vehicle != null ? vehicle.getEntityId() : -1; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readInt(); + this.vehicleEntityId = buf.readInt(); + this.leash = buf.readUnsignedByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.entityId); + buf.writeInt(this.vehicleEntityId); + buf.writeByte(this.leash); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityAttach(this); + } + + public int getLeash() + { + return this.leash; + } + + public int getEntityId() + { + return this.entityId; + } + + public int getVehicleEntityId() + { + return this.vehicleEntityId; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java new file mode 100644 index 0000000..ca925b2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.minecraft.entity.DataWatcher; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1CPacketEntityMetadata implements Packet +{ + private int entityId; + private List field_149378_b; + + public S1CPacketEntityMetadata() + { + } + + public S1CPacketEntityMetadata(int entityIdIn, DataWatcher p_i45217_2_, boolean p_i45217_3_) + { + this.entityId = entityIdIn; + + if (p_i45217_3_) + { + this.field_149378_b = p_i45217_2_.getAllWatched(); + } + else + { + this.field_149378_b = p_i45217_2_.getChanged(); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.field_149378_b = DataWatcher.readWatchedListFromPacketBuffer(buf); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + DataWatcher.writeWatchedListToPacketBuffer(this.field_149378_b, buf); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityMetadata(this); + } + + public List func_149376_c() + { + return this.field_149378_b; + } + + public int getEntityId() + { + return this.entityId; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java new file mode 100644 index 0000000..90c587c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java @@ -0,0 +1,91 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.potion.PotionEffect; + +public class S1DPacketEntityEffect implements Packet +{ + private int entityId; + private byte effectId; + private byte amplifier; + private int duration; + private byte hideParticles; + + public S1DPacketEntityEffect() + { + } + + public S1DPacketEntityEffect(int entityIdIn, PotionEffect effect) + { + this.entityId = entityIdIn; + this.effectId = (byte)(effect.getPotionID() & 255); + this.amplifier = (byte)(effect.getAmplifier() & 255); + + if (effect.getDuration() > 32767) + { + this.duration = 32767; + } + else + { + this.duration = effect.getDuration(); + } + + this.hideParticles = (byte)(effect.getIsShowParticles() ? 1 : 0); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.effectId = buf.readByte(); + this.amplifier = buf.readByte(); + this.duration = buf.readVarIntFromBuffer(); + this.hideParticles = buf.readByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeByte(this.effectId); + buf.writeByte(this.amplifier); + buf.writeVarIntToBuffer(this.duration); + buf.writeByte(this.hideParticles); + } + + public boolean func_149429_c() + { + return this.duration == 32767; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityEffect(this); + } + + public int getEntityId() + { + return this.entityId; + } + + public byte getEffectId() + { + return this.effectId; + } + + public byte getAmplifier() + { + return this.amplifier; + } + + public int getDuration() + { + return this.duration; + } + + public boolean func_179707_f() + { + return this.hideParticles != 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java new file mode 100644 index 0000000..2673520 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java @@ -0,0 +1,50 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.potion.PotionEffect; + +public class S1EPacketRemoveEntityEffect implements Packet +{ + private int entityId; + private int effectId; + + public S1EPacketRemoveEntityEffect() + { + } + + public S1EPacketRemoveEntityEffect(int entityIdIn, PotionEffect effect) + { + this.entityId = entityIdIn; + this.effectId = effect.getPotionID(); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.effectId = buf.readUnsignedByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeByte(this.effectId); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleRemoveEntityEffect(this); + } + + public int getEntityId() + { + return this.entityId; + } + + public int getEffectId() + { + return this.effectId; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java new file mode 100644 index 0000000..f1a86b0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java @@ -0,0 +1,58 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1FPacketSetExperience implements Packet +{ + private float field_149401_a; + private int totalExperience; + private int level; + + public S1FPacketSetExperience() + { + } + + public S1FPacketSetExperience(float p_i45222_1_, int totalExperienceIn, int levelIn) + { + this.field_149401_a = p_i45222_1_; + this.totalExperience = totalExperienceIn; + this.level = levelIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.field_149401_a = buf.readFloat(); + this.level = buf.readVarIntFromBuffer(); + this.totalExperience = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeFloat(this.field_149401_a); + buf.writeVarIntToBuffer(this.level); + buf.writeVarIntToBuffer(this.totalExperience); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSetExperience(this); + } + + public float func_149397_c() + { + return this.field_149401_a; + } + + public int getTotalExperience() + { + return this.totalExperience; + } + + public int getLevel() + { + return this.level; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java new file mode 100644 index 0000000..6dfbce9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java @@ -0,0 +1,118 @@ +package net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S20PacketEntityProperties implements Packet +{ + private int entityId; + private final List field_149444_b = Lists.newArrayList(); + + public S20PacketEntityProperties() + { + } + + public S20PacketEntityProperties(int entityIdIn, Collection p_i45236_2_) + { + this.entityId = entityIdIn; + + for (IAttributeInstance iattributeinstance : p_i45236_2_) + { + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot(iattributeinstance.getAttribute().getAttributeUnlocalizedName(), iattributeinstance.getBaseValue(), iattributeinstance.func_111122_c())); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + int i = buf.readInt(); + + for (int j = 0; j < i; ++j) + { + String s = buf.readStringFromBuffer(64); + double d0 = buf.readDouble(); + List list = Lists.newArrayList(); + int k = buf.readVarIntFromBuffer(); + + for (int l = 0; l < k; ++l) + { + UUID uuid = buf.readUuid(); + list.add(new AttributeModifier(uuid, "Unknown synced attribute modifier", buf.readDouble(), buf.readByte())); + } + + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot(s, d0, list)); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeInt(this.field_149444_b.size()); + + for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : this.field_149444_b) + { + buf.writeString(s20packetentityproperties$snapshot.func_151409_a()); + buf.writeDouble(s20packetentityproperties$snapshot.func_151410_b()); + buf.writeVarIntToBuffer(s20packetentityproperties$snapshot.func_151408_c().size()); + + for (AttributeModifier attributemodifier : s20packetentityproperties$snapshot.func_151408_c()) + { + buf.writeUuid(attributemodifier.getID()); + buf.writeDouble(attributemodifier.getAmount()); + buf.writeByte(attributemodifier.getOperation()); + } + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityProperties(this); + } + + public int getEntityId() + { + return this.entityId; + } + + public List func_149441_d() + { + return this.field_149444_b; + } + + public class Snapshot + { + private final String field_151412_b; + private final double field_151413_c; + private final Collection field_151411_d; + + public Snapshot(String p_i45235_2_, double p_i45235_3_, Collection p_i45235_5_) + { + this.field_151412_b = p_i45235_2_; + this.field_151413_c = p_i45235_3_; + this.field_151411_d = p_i45235_5_; + } + + public String func_151409_a() + { + return this.field_151412_b; + } + + public double func_151410_b() + { + return this.field_151413_c; + } + + public Collection func_151408_c() + { + return this.field_151411_d; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java new file mode 100644 index 0000000..3f8098b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java @@ -0,0 +1,152 @@ +package net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +public class S21PacketChunkData implements Packet +{ + private int chunkX; + private int chunkZ; + private S21PacketChunkData.Extracted extractedData; + private boolean field_149279_g; + + public S21PacketChunkData() + { + } + + public S21PacketChunkData(Chunk chunkIn, boolean p_i45196_2_, int p_i45196_3_) + { + this.chunkX = chunkIn.xPosition; + this.chunkZ = chunkIn.zPosition; + this.field_149279_g = p_i45196_2_; + this.extractedData = getExtractedData(chunkIn, p_i45196_2_, !chunkIn.getWorld().provider.getHasNoSky(), p_i45196_3_); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.chunkX = buf.readInt(); + this.chunkZ = buf.readInt(); + this.field_149279_g = buf.readBoolean(); + this.extractedData = new S21PacketChunkData.Extracted(); + this.extractedData.dataSize = buf.readShort(); + this.extractedData.data = buf.readByteArray(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.chunkX); + buf.writeInt(this.chunkZ); + buf.writeBoolean(this.field_149279_g); + buf.writeShort((short)(this.extractedData.dataSize & 65535)); + buf.writeByteArray(this.extractedData.data); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleChunkData(this); + } + + public byte[] getExtractedDataBytes() + { + return this.extractedData.data; + } + + protected static int func_180737_a(int p_180737_0_, boolean p_180737_1_, boolean p_180737_2_) + { + int i = p_180737_0_ * 2 * 16 * 16 * 16; + int j = p_180737_0_ * 16 * 16 * 16 / 2; + int k = p_180737_1_ ? p_180737_0_ * 16 * 16 * 16 / 2 : 0; + int l = p_180737_2_ ? 256 : 0; + return i + j + k + l; + } + + public static S21PacketChunkData.Extracted getExtractedData(Chunk p_179756_0_, boolean p_179756_1_, boolean p_179756_2_, int p_179756_3_) + { + ExtendedBlockStorage[] aextendedblockstorage = p_179756_0_.getBlockStorageArray(); + S21PacketChunkData.Extracted s21packetchunkdata$extracted = new S21PacketChunkData.Extracted(); + List list = Lists.newArrayList(); + + for (int i = 0; i < aextendedblockstorage.length; ++i) + { + ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[i]; + + if (extendedblockstorage != null && (!p_179756_1_ || !extendedblockstorage.isEmpty()) && (p_179756_3_ & 1 << i) != 0) + { + s21packetchunkdata$extracted.dataSize |= 1 << i; + list.add(extendedblockstorage); + } + } + + s21packetchunkdata$extracted.data = new byte[func_180737_a(Integer.bitCount(s21packetchunkdata$extracted.dataSize), p_179756_2_, p_179756_1_)]; + int j = 0; + + for (ExtendedBlockStorage extendedblockstorage1 : list) + { + char[] achar = extendedblockstorage1.getData(); + + for (char c0 : achar) + { + s21packetchunkdata$extracted.data[j++] = (byte)(c0 & 255); + s21packetchunkdata$extracted.data[j++] = (byte)(c0 >> 8 & 255); + } + } + + for (ExtendedBlockStorage extendedblockstorage2 : list) + { + j = func_179757_a(extendedblockstorage2.getBlocklightArray().getData(), s21packetchunkdata$extracted.data, j); + } + + if (p_179756_2_) + { + for (ExtendedBlockStorage extendedblockstorage3 : list) + { + j = func_179757_a(extendedblockstorage3.getSkylightArray().getData(), s21packetchunkdata$extracted.data, j); + } + } + + if (p_179756_1_) + { + func_179757_a(p_179756_0_.getBiomeArray(), s21packetchunkdata$extracted.data, j); + } + + return s21packetchunkdata$extracted; + } + + private static int func_179757_a(byte[] p_179757_0_, byte[] p_179757_1_, int p_179757_2_) + { + System.arraycopy(p_179757_0_, 0, p_179757_1_, p_179757_2_, p_179757_0_.length); + return p_179757_2_ + p_179757_0_.length; + } + + public int getChunkX() + { + return this.chunkX; + } + + public int getChunkZ() + { + return this.chunkZ; + } + + public int getExtractedSize() + { + return this.extractedData.dataSize; + } + + public boolean func_149274_i() + { + return this.field_149279_g; + } + + public static class Extracted + { + public byte[] data; + public int dataSize; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java new file mode 100644 index 0000000..306fd9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java @@ -0,0 +1,99 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.chunk.Chunk; + +public class S22PacketMultiBlockChange implements Packet +{ + private ChunkCoordIntPair chunkPosCoord; + private S22PacketMultiBlockChange.BlockUpdateData[] changedBlocks; + + public S22PacketMultiBlockChange() + { + } + + public S22PacketMultiBlockChange(int p_i45181_1_, short[] crammedPositionsIn, Chunk chunkIn) + { + this.chunkPosCoord = new ChunkCoordIntPair(chunkIn.xPosition, chunkIn.zPosition); + this.changedBlocks = new S22PacketMultiBlockChange.BlockUpdateData[p_i45181_1_]; + + for (int i = 0; i < this.changedBlocks.length; ++i) + { + this.changedBlocks[i] = new S22PacketMultiBlockChange.BlockUpdateData(crammedPositionsIn[i], chunkIn); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.chunkPosCoord = new ChunkCoordIntPair(buf.readInt(), buf.readInt()); + this.changedBlocks = new S22PacketMultiBlockChange.BlockUpdateData[buf.readVarIntFromBuffer()]; + + for (int i = 0; i < this.changedBlocks.length; ++i) + { + this.changedBlocks[i] = new S22PacketMultiBlockChange.BlockUpdateData(buf.readShort(), (IBlockState)Block.BLOCK_STATE_IDS.getByValue(buf.readVarIntFromBuffer())); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.chunkPosCoord.chunkXPos); + buf.writeInt(this.chunkPosCoord.chunkZPos); + buf.writeVarIntToBuffer(this.changedBlocks.length); + + for (S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata : this.changedBlocks) + { + buf.writeShort(s22packetmultiblockchange$blockupdatedata.func_180089_b()); + buf.writeVarIntToBuffer(Block.BLOCK_STATE_IDS.get(s22packetmultiblockchange$blockupdatedata.getBlockState())); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleMultiBlockChange(this); + } + + public S22PacketMultiBlockChange.BlockUpdateData[] getChangedBlocks() + { + return this.changedBlocks; + } + + public class BlockUpdateData + { + private final short chunkPosCrammed; + private final IBlockState blockState; + + public BlockUpdateData(short p_i45984_2_, IBlockState state) + { + this.chunkPosCrammed = p_i45984_2_; + this.blockState = state; + } + + public BlockUpdateData(short p_i45985_2_, Chunk chunkIn) + { + this.chunkPosCrammed = p_i45985_2_; + this.blockState = chunkIn.getBlockState(this.getPos()); + } + + public BlockPos getPos() + { + return new BlockPos(S22PacketMultiBlockChange.this.chunkPosCoord.getBlock(this.chunkPosCrammed >> 12 & 15, this.chunkPosCrammed & 255, this.chunkPosCrammed >> 8 & 15)); + } + + public short func_180089_b() + { + return this.chunkPosCrammed; + } + + public IBlockState getBlockState() + { + return this.blockState; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java new file mode 100644 index 0000000..ec28caa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java @@ -0,0 +1,53 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class S23PacketBlockChange implements Packet +{ + private BlockPos blockPosition; + private IBlockState blockState; + + public S23PacketBlockChange() + { + } + + public S23PacketBlockChange(World worldIn, BlockPos blockPositionIn) + { + this.blockPosition = blockPositionIn; + this.blockState = worldIn.getBlockState(blockPositionIn); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.blockPosition = buf.readBlockPos(); + this.blockState = (IBlockState)Block.BLOCK_STATE_IDS.getByValue(buf.readVarIntFromBuffer()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.blockPosition); + buf.writeVarIntToBuffer(Block.BLOCK_STATE_IDS.get(this.blockState)); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleBlockChange(this); + } + + public IBlockState getBlockState() + { + return this.blockState; + } + + public BlockPos getBlockPosition() + { + return this.blockPosition; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java new file mode 100644 index 0000000..b9d8c6b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java @@ -0,0 +1,69 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; + +public class S24PacketBlockAction implements Packet +{ + private BlockPos blockPosition; + private int instrument; + private int pitch; + private Block block; + + public S24PacketBlockAction() + { + } + + public S24PacketBlockAction(BlockPos blockPositionIn, Block blockIn, int instrumentIn, int pitchIn) + { + this.blockPosition = blockPositionIn; + this.instrument = instrumentIn; + this.pitch = pitchIn; + this.block = blockIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.blockPosition = buf.readBlockPos(); + this.instrument = buf.readUnsignedByte(); + this.pitch = buf.readUnsignedByte(); + this.block = Block.getBlockById(buf.readVarIntFromBuffer() & 4095); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.blockPosition); + buf.writeByte(this.instrument); + buf.writeByte(this.pitch); + buf.writeVarIntToBuffer(Block.getIdFromBlock(this.block) & 4095); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleBlockAction(this); + } + + public BlockPos getBlockPosition() + { + return this.blockPosition; + } + + public int getData1() + { + return this.instrument; + } + + public int getData2() + { + return this.pitch; + } + + public Block getBlockType() + { + return this.block; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java new file mode 100644 index 0000000..658f0c0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; + +public class S25PacketBlockBreakAnim implements Packet +{ + private int breakerId; + private BlockPos position; + private int progress; + + public S25PacketBlockBreakAnim() + { + } + + public S25PacketBlockBreakAnim(int breakerId, BlockPos pos, int progress) + { + this.breakerId = breakerId; + this.position = pos; + this.progress = progress; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.breakerId = buf.readVarIntFromBuffer(); + this.position = buf.readBlockPos(); + this.progress = buf.readUnsignedByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.breakerId); + buf.writeBlockPos(this.position); + buf.writeByte(this.progress); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleBlockBreakAnim(this); + } + + public int getBreakerId() + { + return this.breakerId; + } + + public BlockPos getPosition() + { + return this.position; + } + + public int getProgress() + { + return this.progress; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java new file mode 100644 index 0000000..9b4a1cc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java @@ -0,0 +1,109 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.chunk.Chunk; + +public class S26PacketMapChunkBulk implements Packet +{ + private int[] xPositions; + private int[] zPositions; + private S21PacketChunkData.Extracted[] chunksData; + private boolean isOverworld; + + public S26PacketMapChunkBulk() + { + } + + public S26PacketMapChunkBulk(List chunks) + { + int i = chunks.size(); + this.xPositions = new int[i]; + this.zPositions = new int[i]; + this.chunksData = new S21PacketChunkData.Extracted[i]; + this.isOverworld = !((Chunk)chunks.get(0)).getWorld().provider.getHasNoSky(); + + for (int j = 0; j < i; ++j) + { + Chunk chunk = (Chunk)chunks.get(j); + S21PacketChunkData.Extracted s21packetchunkdata$extracted = S21PacketChunkData.getExtractedData(chunk, true, this.isOverworld, 65535); + this.xPositions[j] = chunk.xPosition; + this.zPositions[j] = chunk.zPosition; + this.chunksData[j] = s21packetchunkdata$extracted; + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.isOverworld = buf.readBoolean(); + int i = buf.readVarIntFromBuffer(); + this.xPositions = new int[i]; + this.zPositions = new int[i]; + this.chunksData = new S21PacketChunkData.Extracted[i]; + + for (int j = 0; j < i; ++j) + { + this.xPositions[j] = buf.readInt(); + this.zPositions[j] = buf.readInt(); + this.chunksData[j] = new S21PacketChunkData.Extracted(); + this.chunksData[j].dataSize = buf.readShort() & 65535; + this.chunksData[j].data = new byte[S21PacketChunkData.func_180737_a(Integer.bitCount(this.chunksData[j].dataSize), this.isOverworld, true)]; + } + + for (int k = 0; k < i; ++k) + { + buf.readBytes(this.chunksData[k].data); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBoolean(this.isOverworld); + buf.writeVarIntToBuffer(this.chunksData.length); + + for (int i = 0; i < this.xPositions.length; ++i) + { + buf.writeInt(this.xPositions[i]); + buf.writeInt(this.zPositions[i]); + buf.writeShort((short)(this.chunksData[i].dataSize & 65535)); + } + + for (int j = 0; j < this.xPositions.length; ++j) + { + buf.writeBytes(this.chunksData[j].data); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleMapChunkBulk(this); + } + + public int getChunkX(int p_149255_1_) + { + return this.xPositions[p_149255_1_]; + } + + public int getChunkZ(int p_149253_1_) + { + return this.zPositions[p_149253_1_]; + } + + public int getChunkCount() + { + return this.xPositions.length; + } + + public byte[] getChunkBytes(int p_149256_1_) + { + return this.chunksData[p_149256_1_].data; + } + + public int getChunkSize(int p_179754_1_) + { + return this.chunksData[p_179754_1_].dataSize; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java new file mode 100644 index 0000000..733dbe2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java @@ -0,0 +1,138 @@ +package net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; + +public class S27PacketExplosion implements Packet +{ + private double posX; + private double posY; + private double posZ; + private float strength; + private List affectedBlockPositions; + private float field_149152_f; + private float field_149153_g; + private float field_149159_h; + + public S27PacketExplosion() + { + } + + public S27PacketExplosion(double p_i45193_1_, double y, double z, float strengthIn, List affectedBlocksIn, Vec3 p_i45193_9_) + { + this.posX = p_i45193_1_; + this.posY = y; + this.posZ = z; + this.strength = strengthIn; + this.affectedBlockPositions = Lists.newArrayList(affectedBlocksIn); + + if (p_i45193_9_ != null) + { + this.field_149152_f = (float)p_i45193_9_.xCoord; + this.field_149153_g = (float)p_i45193_9_.yCoord; + this.field_149159_h = (float)p_i45193_9_.zCoord; + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.posX = (double)buf.readFloat(); + this.posY = (double)buf.readFloat(); + this.posZ = (double)buf.readFloat(); + this.strength = buf.readFloat(); + int i = buf.readInt(); + this.affectedBlockPositions = Lists.newArrayListWithCapacity(i); + int j = (int)this.posX; + int k = (int)this.posY; + int l = (int)this.posZ; + + for (int i1 = 0; i1 < i; ++i1) + { + int j1 = buf.readByte() + j; + int k1 = buf.readByte() + k; + int l1 = buf.readByte() + l; + this.affectedBlockPositions.add(new BlockPos(j1, k1, l1)); + } + + this.field_149152_f = buf.readFloat(); + this.field_149153_g = buf.readFloat(); + this.field_149159_h = buf.readFloat(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeFloat((float)this.posX); + buf.writeFloat((float)this.posY); + buf.writeFloat((float)this.posZ); + buf.writeFloat(this.strength); + buf.writeInt(this.affectedBlockPositions.size()); + int i = (int)this.posX; + int j = (int)this.posY; + int k = (int)this.posZ; + + for (BlockPos blockpos : this.affectedBlockPositions) + { + int l = blockpos.getX() - i; + int i1 = blockpos.getY() - j; + int j1 = blockpos.getZ() - k; + buf.writeByte(l); + buf.writeByte(i1); + buf.writeByte(j1); + } + + buf.writeFloat(this.field_149152_f); + buf.writeFloat(this.field_149153_g); + buf.writeFloat(this.field_149159_h); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleExplosion(this); + } + + public float func_149149_c() + { + return this.field_149152_f; + } + + public float func_149144_d() + { + return this.field_149153_g; + } + + public float func_149147_e() + { + return this.field_149159_h; + } + + public double getX() + { + return this.posX; + } + + public double getY() + { + return this.posY; + } + + public double getZ() + { + return this.posZ; + } + + public float getStrength() + { + return this.strength; + } + + public List getAffectedBlockPositions() + { + return this.affectedBlockPositions; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java new file mode 100644 index 0000000..3f2b949 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java @@ -0,0 +1,68 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; + +public class S28PacketEffect implements Packet +{ + private int soundType; + private BlockPos soundPos; + private int soundData; + private boolean serverWide; + + public S28PacketEffect() + { + } + + public S28PacketEffect(int soundTypeIn, BlockPos soundPosIn, int soundDataIn, boolean serverWideIn) + { + this.soundType = soundTypeIn; + this.soundPos = soundPosIn; + this.soundData = soundDataIn; + this.serverWide = serverWideIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.soundType = buf.readInt(); + this.soundPos = buf.readBlockPos(); + this.soundData = buf.readInt(); + this.serverWide = buf.readBoolean(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.soundType); + buf.writeBlockPos(this.soundPos); + buf.writeInt(this.soundData); + buf.writeBoolean(this.serverWide); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEffect(this); + } + + public boolean isSoundServerwide() + { + return this.serverWide; + } + + public int getSoundType() + { + return this.soundType; + } + + public int getSoundData() + { + return this.soundData; + } + + public BlockPos getSoundPos() + { + return this.soundPos; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java new file mode 100644 index 0000000..1ad0d57 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java @@ -0,0 +1,89 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.Validate; + +public class S29PacketSoundEffect implements Packet +{ + private String soundName; + private int posX; + private int posY = Integer.MAX_VALUE; + private int posZ; + private float soundVolume; + private int soundPitch; + + public S29PacketSoundEffect() + { + } + + public S29PacketSoundEffect(String soundNameIn, double soundX, double soundY, double soundZ, float volume, float pitch) + { + Validate.notNull(soundNameIn, "name", new Object[0]); + this.soundName = soundNameIn; + this.posX = (int)(soundX * 8.0D); + this.posY = (int)(soundY * 8.0D); + this.posZ = (int)(soundZ * 8.0D); + this.soundVolume = volume; + this.soundPitch = (int)(pitch * 63.0F); + pitch = MathHelper.clamp_float(pitch, 0.0F, 255.0F); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.soundName = buf.readStringFromBuffer(256); + this.posX = buf.readInt(); + this.posY = buf.readInt(); + this.posZ = buf.readInt(); + this.soundVolume = buf.readFloat(); + this.soundPitch = buf.readUnsignedByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.soundName); + buf.writeInt(this.posX); + buf.writeInt(this.posY); + buf.writeInt(this.posZ); + buf.writeFloat(this.soundVolume); + buf.writeByte(this.soundPitch); + } + + public String getSoundName() + { + return this.soundName; + } + + public double getX() + { + return (double)((float)this.posX / 8.0F); + } + + public double getY() + { + return (double)((float)this.posY / 8.0F); + } + + public double getZ() + { + return (double)((float)this.posZ / 8.0F); + } + + public float getVolume() + { + return this.soundVolume; + } + + public float getPitch() + { + return (float)this.soundPitch / 63.0F; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSoundEffect(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java new file mode 100644 index 0000000..369479f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java @@ -0,0 +1,148 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.EnumParticleTypes; + +public class S2APacketParticles implements Packet +{ + private EnumParticleTypes particleType; + private float xCoord; + private float yCoord; + private float zCoord; + private float xOffset; + private float yOffset; + private float zOffset; + private float particleSpeed; + private int particleCount; + private boolean longDistance; + private int[] particleArguments; + + public S2APacketParticles() + { + } + + public S2APacketParticles(EnumParticleTypes particleTypeIn, boolean longDistanceIn, float x, float y, float z, float xOffsetIn, float yOffset, float zOffset, float particleSpeedIn, int particleCountIn, int... particleArgumentsIn) + { + this.particleType = particleTypeIn; + this.longDistance = longDistanceIn; + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.xOffset = xOffsetIn; + this.yOffset = yOffset; + this.zOffset = zOffset; + this.particleSpeed = particleSpeedIn; + this.particleCount = particleCountIn; + this.particleArguments = particleArgumentsIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.particleType = EnumParticleTypes.getParticleFromId(buf.readInt()); + + if (this.particleType == null) + { + this.particleType = EnumParticleTypes.BARRIER; + } + + this.longDistance = buf.readBoolean(); + this.xCoord = buf.readFloat(); + this.yCoord = buf.readFloat(); + this.zCoord = buf.readFloat(); + this.xOffset = buf.readFloat(); + this.yOffset = buf.readFloat(); + this.zOffset = buf.readFloat(); + this.particleSpeed = buf.readFloat(); + this.particleCount = buf.readInt(); + int i = this.particleType.getArgumentCount(); + this.particleArguments = new int[i]; + + for (int j = 0; j < i; ++j) + { + this.particleArguments[j] = buf.readVarIntFromBuffer(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeInt(this.particleType.getParticleID()); + buf.writeBoolean(this.longDistance); + buf.writeFloat(this.xCoord); + buf.writeFloat(this.yCoord); + buf.writeFloat(this.zCoord); + buf.writeFloat(this.xOffset); + buf.writeFloat(this.yOffset); + buf.writeFloat(this.zOffset); + buf.writeFloat(this.particleSpeed); + buf.writeInt(this.particleCount); + int i = this.particleType.getArgumentCount(); + + for (int j = 0; j < i; ++j) + { + buf.writeVarIntToBuffer(this.particleArguments[j]); + } + } + + public EnumParticleTypes getParticleType() + { + return this.particleType; + } + + public boolean isLongDistance() + { + return this.longDistance; + } + + public double getXCoordinate() + { + return (double)this.xCoord; + } + + public double getYCoordinate() + { + return (double)this.yCoord; + } + + public double getZCoordinate() + { + return (double)this.zCoord; + } + + public float getXOffset() + { + return this.xOffset; + } + + public float getYOffset() + { + return this.yOffset; + } + + public float getZOffset() + { + return this.zOffset; + } + + public float getParticleSpeed() + { + return this.particleSpeed; + } + + public int getParticleCount() + { + return this.particleCount; + } + + public int[] getParticleArgs() + { + return this.particleArguments; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleParticles(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java new file mode 100644 index 0000000..74606b4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java @@ -0,0 +1,50 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2BPacketChangeGameState implements Packet +{ + public static final String[] MESSAGE_NAMES = new String[] {"tile.bed.notValid"}; + private int state; + private float field_149141_c; + + public S2BPacketChangeGameState() + { + } + + public S2BPacketChangeGameState(int stateIn, float p_i45194_2_) + { + this.state = stateIn; + this.field_149141_c = p_i45194_2_; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.state = buf.readUnsignedByte(); + this.field_149141_c = buf.readFloat(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.state); + buf.writeFloat(this.field_149141_c); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleChangeGameState(this); + } + + public int getGameState() + { + return this.state; + } + + public float func_149137_d() + { + return this.field_149141_c; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java new file mode 100644 index 0000000..8dcf794 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java @@ -0,0 +1,83 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S2CPacketSpawnGlobalEntity implements Packet +{ + private int entityId; + private int x; + private int y; + private int z; + private int type; + + public S2CPacketSpawnGlobalEntity() + { + } + + public S2CPacketSpawnGlobalEntity(Entity entityIn) + { + this.entityId = entityIn.getEntityId(); + this.x = MathHelper.floor_double(entityIn.posX * 32.0D); + this.y = MathHelper.floor_double(entityIn.posY * 32.0D); + this.z = MathHelper.floor_double(entityIn.posZ * 32.0D); + + if (entityIn instanceof EntityLightningBolt) + { + this.type = 1; + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.type = buf.readByte(); + this.x = buf.readInt(); + this.y = buf.readInt(); + this.z = buf.readInt(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeByte(this.type); + buf.writeInt(this.x); + buf.writeInt(this.y); + buf.writeInt(this.z); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnGlobalEntity(this); + } + + public int func_149052_c() + { + return this.entityId; + } + + public int func_149051_d() + { + return this.x; + } + + public int func_149050_e() + { + return this.y; + } + + public int func_149049_f() + { + return this.z; + } + + public int func_149053_g() + { + return this.type; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java new file mode 100644 index 0000000..d7418df --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java @@ -0,0 +1,100 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S2DPacketOpenWindow implements Packet +{ + private int windowId; + private String inventoryType; + private IChatComponent windowTitle; + private int slotCount; + private int entityId; + + public S2DPacketOpenWindow() + { + } + + public S2DPacketOpenWindow(int incomingWindowId, String incomingWindowTitle, IChatComponent windowTitleIn) + { + this(incomingWindowId, incomingWindowTitle, windowTitleIn, 0); + } + + public S2DPacketOpenWindow(int windowIdIn, String guiId, IChatComponent windowTitleIn, int slotCountIn) + { + this.windowId = windowIdIn; + this.inventoryType = guiId; + this.windowTitle = windowTitleIn; + this.slotCount = slotCountIn; + } + + public S2DPacketOpenWindow(int windowIdIn, String guiId, IChatComponent windowTitleIn, int slotCountIn, int incomingEntityId) + { + this(windowIdIn, guiId, windowTitleIn, slotCountIn); + this.entityId = incomingEntityId; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleOpenWindow(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readUnsignedByte(); + this.inventoryType = buf.readStringFromBuffer(32); + this.windowTitle = buf.readChatComponent(); + this.slotCount = buf.readUnsignedByte(); + + if (this.inventoryType.equals("EntityHorse")) + { + this.entityId = buf.readInt(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeString(this.inventoryType); + buf.writeChatComponent(this.windowTitle); + buf.writeByte(this.slotCount); + + if (this.inventoryType.equals("EntityHorse")) + { + buf.writeInt(this.entityId); + } + } + + public int getWindowId() + { + return this.windowId; + } + + public String getGuiId() + { + return this.inventoryType; + } + + public IChatComponent getWindowTitle() + { + return this.windowTitle; + } + + public int getSlotCount() + { + return this.slotCount; + } + + public int getEntityId() + { + return this.entityId; + } + + public boolean hasSlots() + { + return this.slotCount > 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java new file mode 100644 index 0000000..d0fc6d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java @@ -0,0 +1,35 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2EPacketCloseWindow implements Packet +{ + private int windowId; + + public S2EPacketCloseWindow() + { + } + + public S2EPacketCloseWindow(int windowIdIn) + { + this.windowId = windowIdIn; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCloseWindow(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readUnsignedByte(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java new file mode 100644 index 0000000..444153d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2FPacketSetSlot implements Packet +{ + private int windowId; + private int slot; + private ItemStack item; + + public S2FPacketSetSlot() + { + } + + public S2FPacketSetSlot(int windowIdIn, int slotIn, ItemStack itemIn) + { + this.windowId = windowIdIn; + this.slot = slotIn; + this.item = itemIn == null ? null : itemIn.copy(); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSetSlot(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readByte(); + this.slot = buf.readShort(); + this.item = buf.readItemStackFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeShort(this.slot); + buf.writeItemStackToBuffer(this.item); + } + + public int func_149175_c() + { + return this.windowId; + } + + public int func_149173_d() + { + return this.slot; + } + + public ItemStack func_149174_e() + { + return this.item; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java new file mode 100644 index 0000000..965e999 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java @@ -0,0 +1,68 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S30PacketWindowItems implements Packet +{ + private int windowId; + private ItemStack[] itemStacks; + + public S30PacketWindowItems() + { + } + + public S30PacketWindowItems(int windowIdIn, List p_i45186_2_) + { + this.windowId = windowIdIn; + this.itemStacks = new ItemStack[p_i45186_2_.size()]; + + for (int i = 0; i < this.itemStacks.length; ++i) + { + ItemStack itemstack = (ItemStack)p_i45186_2_.get(i); + this.itemStacks[i] = itemstack == null ? null : itemstack.copy(); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readUnsignedByte(); + int i = buf.readShort(); + this.itemStacks = new ItemStack[i]; + + for (int j = 0; j < i; ++j) + { + this.itemStacks[j] = buf.readItemStackFromBuffer(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeShort(this.itemStacks.length); + + for (ItemStack itemstack : this.itemStacks) + { + buf.writeItemStackToBuffer(itemstack); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleWindowItems(this); + } + + public int func_148911_c() + { + return this.windowId; + } + + public ItemStack[] getItemStacks() + { + return this.itemStacks; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java new file mode 100644 index 0000000..114c5ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java @@ -0,0 +1,58 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S31PacketWindowProperty implements Packet +{ + private int windowId; + private int varIndex; + private int varValue; + + public S31PacketWindowProperty() + { + } + + public S31PacketWindowProperty(int windowIdIn, int varIndexIn, int varValueIn) + { + this.windowId = windowIdIn; + this.varIndex = varIndexIn; + this.varValue = varValueIn; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleWindowProperty(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readUnsignedByte(); + this.varIndex = buf.readShort(); + this.varValue = buf.readShort(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeShort(this.varIndex); + buf.writeShort(this.varValue); + } + + public int getWindowId() + { + return this.windowId; + } + + public int getVarIndex() + { + return this.varIndex; + } + + public int getVarValue() + { + return this.varValue; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java new file mode 100644 index 0000000..b91b680 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java @@ -0,0 +1,58 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S32PacketConfirmTransaction implements Packet +{ + private int windowId; + private short actionNumber; + private boolean field_148893_c; + + public S32PacketConfirmTransaction() + { + } + + public S32PacketConfirmTransaction(int windowIdIn, short actionNumberIn, boolean p_i45182_3_) + { + this.windowId = windowIdIn; + this.actionNumber = actionNumberIn; + this.field_148893_c = p_i45182_3_; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleConfirmTransaction(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.windowId = buf.readUnsignedByte(); + this.actionNumber = buf.readShort(); + this.field_148893_c = buf.readBoolean(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.windowId); + buf.writeShort(this.actionNumber); + buf.writeBoolean(this.field_148893_c); + } + + public int getWindowId() + { + return this.windowId; + } + + public short getActionNumber() + { + return this.actionNumber; + } + + public boolean func_148888_e() + { + return this.field_148893_c; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java new file mode 100644 index 0000000..37cc214 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java @@ -0,0 +1,63 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public class S33PacketUpdateSign implements Packet +{ + private World world; + private BlockPos blockPos; + private IChatComponent[] lines; + + public S33PacketUpdateSign() + { + } + + public S33PacketUpdateSign(World worldIn, BlockPos blockPosIn, IChatComponent[] linesIn) + { + this.world = worldIn; + this.blockPos = blockPosIn; + this.lines = new IChatComponent[] {linesIn[0], linesIn[1], linesIn[2], linesIn[3]}; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.blockPos = buf.readBlockPos(); + this.lines = new IChatComponent[4]; + + for (int i = 0; i < 4; ++i) + { + this.lines[i] = buf.readChatComponent(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.blockPos); + + for (int i = 0; i < 4; ++i) + { + buf.writeChatComponent(this.lines[i]); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateSign(this); + } + + public BlockPos getPos() + { + return this.blockPos; + } + + public IChatComponent[] getLines() + { + return this.lines; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java new file mode 100644 index 0000000..a04c289 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java @@ -0,0 +1,122 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.Collection; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.Vec4b; +import net.minecraft.world.storage.MapData; + +public class S34PacketMaps implements Packet +{ + private int mapId; + private byte mapScale; + private Vec4b[] mapVisiblePlayersVec4b; + private int mapMinX; + private int mapMinY; + private int mapMaxX; + private int mapMaxY; + private byte[] mapDataBytes; + + public S34PacketMaps() + { + } + + public S34PacketMaps(int mapIdIn, byte scale, Collection visiblePlayers, byte[] colors, int minX, int minY, int maxX, int maxY) + { + this.mapId = mapIdIn; + this.mapScale = scale; + this.mapVisiblePlayersVec4b = (Vec4b[])visiblePlayers.toArray(new Vec4b[visiblePlayers.size()]); + this.mapMinX = minX; + this.mapMinY = minY; + this.mapMaxX = maxX; + this.mapMaxY = maxY; + this.mapDataBytes = new byte[maxX * maxY]; + + for (int i = 0; i < maxX; ++i) + { + for (int j = 0; j < maxY; ++j) + { + this.mapDataBytes[i + j * maxX] = colors[minX + i + (minY + j) * 128]; + } + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.mapId = buf.readVarIntFromBuffer(); + this.mapScale = buf.readByte(); + this.mapVisiblePlayersVec4b = new Vec4b[buf.readVarIntFromBuffer()]; + + for (int i = 0; i < this.mapVisiblePlayersVec4b.length; ++i) + { + short short1 = (short)buf.readByte(); + this.mapVisiblePlayersVec4b[i] = new Vec4b((byte)(short1 >> 4 & 15), buf.readByte(), buf.readByte(), (byte)(short1 & 15)); + } + + this.mapMaxX = buf.readUnsignedByte(); + + if (this.mapMaxX > 0) + { + this.mapMaxY = buf.readUnsignedByte(); + this.mapMinX = buf.readUnsignedByte(); + this.mapMinY = buf.readUnsignedByte(); + this.mapDataBytes = buf.readByteArray(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.mapId); + buf.writeByte(this.mapScale); + buf.writeVarIntToBuffer(this.mapVisiblePlayersVec4b.length); + + for (Vec4b vec4b : this.mapVisiblePlayersVec4b) + { + buf.writeByte((vec4b.func_176110_a() & 15) << 4 | vec4b.func_176111_d() & 15); + buf.writeByte(vec4b.func_176112_b()); + buf.writeByte(vec4b.func_176113_c()); + } + + buf.writeByte(this.mapMaxX); + + if (this.mapMaxX > 0) + { + buf.writeByte(this.mapMaxY); + buf.writeByte(this.mapMinX); + buf.writeByte(this.mapMinY); + buf.writeByteArray(this.mapDataBytes); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleMaps(this); + } + + public int getMapId() + { + return this.mapId; + } + + public void setMapdataTo(MapData mapdataIn) + { + mapdataIn.scale = this.mapScale; + mapdataIn.mapDecorations.clear(); + + for (int i = 0; i < this.mapVisiblePlayersVec4b.length; ++i) + { + Vec4b vec4b = this.mapVisiblePlayersVec4b[i]; + mapdataIn.mapDecorations.put("icon-" + i, vec4b); + } + + for (int j = 0; j < this.mapMaxX; ++j) + { + for (int k = 0; k < this.mapMaxY; ++k) + { + mapdataIn.colors[this.mapMinX + j + (this.mapMinY + k) * 128] = this.mapDataBytes[j + k * this.mapMaxX]; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java new file mode 100644 index 0000000..fda2796 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; + +public class S35PacketUpdateTileEntity implements Packet +{ + private BlockPos blockPos; + private int metadata; + private NBTTagCompound nbt; + + public S35PacketUpdateTileEntity() + { + } + + public S35PacketUpdateTileEntity(BlockPos blockPosIn, int metadataIn, NBTTagCompound nbtIn) + { + this.blockPos = blockPosIn; + this.metadata = metadataIn; + this.nbt = nbtIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.blockPos = buf.readBlockPos(); + this.metadata = buf.readUnsignedByte(); + this.nbt = buf.readNBTTagCompoundFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.blockPos); + buf.writeByte((byte)this.metadata); + buf.writeNBTTagCompoundToBuffer(this.nbt); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateTileEntity(this); + } + + public BlockPos getPos() + { + return this.blockPos; + } + + public int getTileEntityType() + { + return this.metadata; + } + + public NBTTagCompound getNbtCompound() + { + return this.nbt; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java new file mode 100644 index 0000000..9190aca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java @@ -0,0 +1,41 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.BlockPos; + +public class S36PacketSignEditorOpen implements Packet +{ + private BlockPos signPosition; + + public S36PacketSignEditorOpen() + { + } + + public S36PacketSignEditorOpen(BlockPos signPositionIn) + { + this.signPosition = signPositionIn; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSignEditorOpen(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.signPosition = buf.readBlockPos(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeBlockPos(this.signPosition); + } + + public BlockPos getSignPosition() + { + return this.signPosition; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java new file mode 100644 index 0000000..10f53af --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java @@ -0,0 +1,63 @@ +package net.minecraft.network.play.server; + +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; + +public class S37PacketStatistics implements Packet +{ + private Map field_148976_a; + + public S37PacketStatistics() + { + } + + public S37PacketStatistics(Map p_i45173_1_) + { + this.field_148976_a = p_i45173_1_; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleStatistics(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + int i = buf.readVarIntFromBuffer(); + this.field_148976_a = Maps.newHashMap(); + + for (int j = 0; j < i; ++j) + { + StatBase statbase = StatList.getOneShotStat(buf.readStringFromBuffer(32767)); + int k = buf.readVarIntFromBuffer(); + + if (statbase != null) + { + this.field_148976_a.put(statbase, Integer.valueOf(k)); + } + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.field_148976_a.size()); + + for (Entry entry : this.field_148976_a.entrySet()) + { + buf.writeString(((StatBase)entry.getKey()).statId); + buf.writeVarIntToBuffer(((Integer)entry.getValue()).intValue()); + } + } + + public Map func_148974_c() + { + return this.field_148976_a; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java new file mode 100644 index 0000000..7a322b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java @@ -0,0 +1,262 @@ +package net.minecraft.network.play.server; + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import java.io.IOException; +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.WorldSettings; + +public class S38PacketPlayerListItem implements Packet +{ + private S38PacketPlayerListItem.Action action; + private final List players = Lists.newArrayList(); + + public S38PacketPlayerListItem() + { + } + + public S38PacketPlayerListItem(S38PacketPlayerListItem.Action actionIn, EntityPlayerMP... players) + { + this.action = actionIn; + + for (EntityPlayerMP entityplayermp : players) + { + this.players.add(new S38PacketPlayerListItem.AddPlayerData(entityplayermp.getGameProfile(), entityplayermp.ping, entityplayermp.theItemInWorldManager.getGameType(), entityplayermp.getTabListDisplayName())); + } + } + + public S38PacketPlayerListItem(S38PacketPlayerListItem.Action actionIn, Iterable players) + { + this.action = actionIn; + + for (EntityPlayerMP entityplayermp : players) + { + this.players.add(new S38PacketPlayerListItem.AddPlayerData(entityplayermp.getGameProfile(), entityplayermp.ping, entityplayermp.theItemInWorldManager.getGameType(), entityplayermp.getTabListDisplayName())); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.action = (S38PacketPlayerListItem.Action)buf.readEnumValue(S38PacketPlayerListItem.Action.class); + int i = buf.readVarIntFromBuffer(); + + for (int j = 0; j < i; ++j) + { + GameProfile gameprofile = null; + int k = 0; + WorldSettings.GameType worldsettings$gametype = null; + IChatComponent ichatcomponent = null; + + switch (this.action) + { + case ADD_PLAYER: + gameprofile = new GameProfile(buf.readUuid(), buf.readStringFromBuffer(16)); + int l = buf.readVarIntFromBuffer(); + int i1 = 0; + + for (; i1 < l; ++i1) + { + String s = buf.readStringFromBuffer(32767); + String s1 = buf.readStringFromBuffer(32767); + + if (buf.readBoolean()) + { + gameprofile.getProperties().put(s, new Property(s, s1, buf.readStringFromBuffer(32767))); + } + else + { + gameprofile.getProperties().put(s, new Property(s, s1)); + } + } + + worldsettings$gametype = WorldSettings.GameType.getByID(buf.readVarIntFromBuffer()); + k = buf.readVarIntFromBuffer(); + + if (buf.readBoolean()) + { + ichatcomponent = buf.readChatComponent(); + } + + break; + + case UPDATE_GAME_MODE: + gameprofile = new GameProfile(buf.readUuid(), (String)null); + worldsettings$gametype = WorldSettings.GameType.getByID(buf.readVarIntFromBuffer()); + break; + + case UPDATE_LATENCY: + gameprofile = new GameProfile(buf.readUuid(), (String)null); + k = buf.readVarIntFromBuffer(); + break; + + case UPDATE_DISPLAY_NAME: + gameprofile = new GameProfile(buf.readUuid(), (String)null); + + if (buf.readBoolean()) + { + ichatcomponent = buf.readChatComponent(); + } + + break; + + case REMOVE_PLAYER: + gameprofile = new GameProfile(buf.readUuid(), (String)null); + } + + this.players.add(new S38PacketPlayerListItem.AddPlayerData(gameprofile, k, worldsettings$gametype, ichatcomponent)); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeEnumValue(this.action); + buf.writeVarIntToBuffer(this.players.size()); + + for (S38PacketPlayerListItem.AddPlayerData s38packetplayerlistitem$addplayerdata : this.players) + { + switch (this.action) + { + case ADD_PLAYER: + buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + buf.writeString(s38packetplayerlistitem$addplayerdata.getProfile().getName()); + buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getProfile().getProperties().size()); + + for (Property property : s38packetplayerlistitem$addplayerdata.getProfile().getProperties().values()) + { + buf.writeString(property.getName()); + buf.writeString(property.getValue()); + + if (property.hasSignature()) + { + buf.writeBoolean(true); + buf.writeString(property.getSignature()); + } + else + { + buf.writeBoolean(false); + } + } + + buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID()); + buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing()); + + if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null) + { + buf.writeBoolean(false); + } + else + { + buf.writeBoolean(true); + buf.writeChatComponent(s38packetplayerlistitem$addplayerdata.getDisplayName()); + } + + break; + + case UPDATE_GAME_MODE: + buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getGameMode().getID()); + break; + + case UPDATE_LATENCY: + buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + buf.writeVarIntToBuffer(s38packetplayerlistitem$addplayerdata.getPing()); + break; + + case UPDATE_DISPLAY_NAME: + buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + + if (s38packetplayerlistitem$addplayerdata.getDisplayName() == null) + { + buf.writeBoolean(false); + } + else + { + buf.writeBoolean(true); + buf.writeChatComponent(s38packetplayerlistitem$addplayerdata.getDisplayName()); + } + + break; + + case REMOVE_PLAYER: + buf.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + } + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handlePlayerListItem(this); + } + + public List getEntries() + { + return this.players; + } + + public S38PacketPlayerListItem.Action getAction() + { + return this.action; + } + + public String toString() + { + return Objects.toStringHelper(this).add("action", this.action).add("entries", this.players).toString(); + } + + public static enum Action + { + ADD_PLAYER, + UPDATE_GAME_MODE, + UPDATE_LATENCY, + UPDATE_DISPLAY_NAME, + REMOVE_PLAYER; + } + + public class AddPlayerData + { + private final int ping; + private final WorldSettings.GameType gamemode; + private final GameProfile profile; + private final IChatComponent displayName; + + public AddPlayerData(GameProfile profile, int pingIn, WorldSettings.GameType gamemodeIn, IChatComponent displayNameIn) + { + this.profile = profile; + this.ping = pingIn; + this.gamemode = gamemodeIn; + this.displayName = displayNameIn; + } + + public GameProfile getProfile() + { + return this.profile; + } + + public int getPing() + { + return this.ping; + } + + public WorldSettings.GameType getGameMode() + { + return this.gamemode; + } + + public IChatComponent getDisplayName() + { + return this.displayName; + } + + public String toString() + { + return Objects.toStringHelper(this).add("latency", this.ping).add("gameMode", this.gamemode).add("profile", this.profile).add("displayName", this.displayName == null ? null : IChatComponent.Serializer.componentToJson(this.displayName)).toString(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java new file mode 100644 index 0000000..069dfcb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java @@ -0,0 +1,136 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S39PacketPlayerAbilities implements Packet +{ + private boolean invulnerable; + private boolean flying; + private boolean allowFlying; + private boolean creativeMode; + private float flySpeed; + private float walkSpeed; + + public S39PacketPlayerAbilities() + { + } + + public S39PacketPlayerAbilities(PlayerCapabilities capabilities) + { + this.setInvulnerable(capabilities.disableDamage); + this.setFlying(capabilities.isFlying); + this.setAllowFlying(capabilities.allowFlying); + this.setCreativeMode(capabilities.isCreativeMode); + this.setFlySpeed(capabilities.getFlySpeed()); + this.setWalkSpeed(capabilities.getWalkSpeed()); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + byte b0 = buf.readByte(); + this.setInvulnerable((b0 & 1) > 0); + this.setFlying((b0 & 2) > 0); + this.setAllowFlying((b0 & 4) > 0); + this.setCreativeMode((b0 & 8) > 0); + this.setFlySpeed(buf.readFloat()); + this.setWalkSpeed(buf.readFloat()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + byte b0 = 0; + + if (this.isInvulnerable()) + { + b0 = (byte)(b0 | 1); + } + + if (this.isFlying()) + { + b0 = (byte)(b0 | 2); + } + + if (this.isAllowFlying()) + { + b0 = (byte)(b0 | 4); + } + + if (this.isCreativeMode()) + { + b0 = (byte)(b0 | 8); + } + + buf.writeByte(b0); + buf.writeFloat(this.flySpeed); + buf.writeFloat(this.walkSpeed); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handlePlayerAbilities(this); + } + + public boolean isInvulnerable() + { + return this.invulnerable; + } + + public void setInvulnerable(boolean isInvulnerable) + { + this.invulnerable = isInvulnerable; + } + + public boolean isFlying() + { + return this.flying; + } + + public void setFlying(boolean isFlying) + { + this.flying = isFlying; + } + + public boolean isAllowFlying() + { + return this.allowFlying; + } + + public void setAllowFlying(boolean isAllowFlying) + { + this.allowFlying = isAllowFlying; + } + + public boolean isCreativeMode() + { + return this.creativeMode; + } + + public void setCreativeMode(boolean isCreativeMode) + { + this.creativeMode = isCreativeMode; + } + + public float getFlySpeed() + { + return this.flySpeed; + } + + public void setFlySpeed(float flySpeedIn) + { + this.flySpeed = flySpeedIn; + } + + public float getWalkSpeed() + { + return this.walkSpeed; + } + + public void setWalkSpeed(float walkSpeedIn) + { + this.walkSpeed = walkSpeedIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java new file mode 100644 index 0000000..3626d0f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java @@ -0,0 +1,50 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S3APacketTabComplete implements Packet +{ + private String[] matches; + + public S3APacketTabComplete() + { + } + + public S3APacketTabComplete(String[] matchesIn) + { + this.matches = matchesIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.matches = new String[buf.readVarIntFromBuffer()]; + + for (int i = 0; i < this.matches.length; ++i) + { + this.matches[i] = buf.readStringFromBuffer(32767); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.matches.length); + + for (String s : this.matches) + { + buf.writeString(s); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleTabComplete(this); + } + + public String[] func_149630_c() + { + return this.matches; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java new file mode 100644 index 0000000..5ba9aa7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java @@ -0,0 +1,77 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.ScoreObjective; + +public class S3BPacketScoreboardObjective implements Packet +{ + private String objectiveName; + private String objectiveValue; + private IScoreObjectiveCriteria.EnumRenderType type; + private int field_149342_c; + + public S3BPacketScoreboardObjective() + { + } + + public S3BPacketScoreboardObjective(ScoreObjective p_i45224_1_, int p_i45224_2_) + { + this.objectiveName = p_i45224_1_.getName(); + this.objectiveValue = p_i45224_1_.getDisplayName(); + this.type = p_i45224_1_.getCriteria().getRenderType(); + this.field_149342_c = p_i45224_2_; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.objectiveName = buf.readStringFromBuffer(16); + this.field_149342_c = buf.readByte(); + + if (this.field_149342_c == 0 || this.field_149342_c == 2) + { + this.objectiveValue = buf.readStringFromBuffer(32); + this.type = IScoreObjectiveCriteria.EnumRenderType.func_178795_a(buf.readStringFromBuffer(16)); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.objectiveName); + buf.writeByte(this.field_149342_c); + + if (this.field_149342_c == 0 || this.field_149342_c == 2) + { + buf.writeString(this.objectiveValue); + buf.writeString(this.type.func_178796_a()); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleScoreboardObjective(this); + } + + public String func_149339_c() + { + return this.objectiveName; + } + + public String func_149337_d() + { + return this.objectiveValue; + } + + public int func_149338_e() + { + return this.field_149342_c; + } + + public IScoreObjectiveCriteria.EnumRenderType func_179817_d() + { + return this.type; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java new file mode 100644 index 0000000..85d0d93 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java @@ -0,0 +1,99 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; + +public class S3CPacketUpdateScore implements Packet +{ + private String name = ""; + private String objective = ""; + private int value; + private S3CPacketUpdateScore.Action action; + + public S3CPacketUpdateScore() + { + } + + public S3CPacketUpdateScore(Score scoreIn) + { + this.name = scoreIn.getPlayerName(); + this.objective = scoreIn.getObjective().getName(); + this.value = scoreIn.getScorePoints(); + this.action = S3CPacketUpdateScore.Action.CHANGE; + } + + public S3CPacketUpdateScore(String nameIn) + { + this.name = nameIn; + this.objective = ""; + this.value = 0; + this.action = S3CPacketUpdateScore.Action.REMOVE; + } + + public S3CPacketUpdateScore(String nameIn, ScoreObjective objectiveIn) + { + this.name = nameIn; + this.objective = objectiveIn.getName(); + this.value = 0; + this.action = S3CPacketUpdateScore.Action.REMOVE; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.name = buf.readStringFromBuffer(40); + this.action = (S3CPacketUpdateScore.Action)buf.readEnumValue(S3CPacketUpdateScore.Action.class); + this.objective = buf.readStringFromBuffer(16); + + if (this.action != S3CPacketUpdateScore.Action.REMOVE) + { + this.value = buf.readVarIntFromBuffer(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.name); + buf.writeEnumValue(this.action); + buf.writeString(this.objective); + + if (this.action != S3CPacketUpdateScore.Action.REMOVE) + { + buf.writeVarIntToBuffer(this.value); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateScore(this); + } + + public String getPlayerName() + { + return this.name; + } + + public String getObjectiveName() + { + return this.objective; + } + + public int getScoreValue() + { + return this.value; + } + + public S3CPacketUpdateScore.Action getScoreAction() + { + return this.action; + } + + public static enum Action + { + CHANGE, + REMOVE; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java new file mode 100644 index 0000000..8ee13e7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java @@ -0,0 +1,58 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScoreObjective; + +public class S3DPacketDisplayScoreboard implements Packet +{ + private int position; + private String scoreName; + + public S3DPacketDisplayScoreboard() + { + } + + public S3DPacketDisplayScoreboard(int positionIn, ScoreObjective scoreIn) + { + this.position = positionIn; + + if (scoreIn == null) + { + this.scoreName = ""; + } + else + { + this.scoreName = scoreIn.getName(); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.position = buf.readByte(); + this.scoreName = buf.readStringFromBuffer(16); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.position); + buf.writeString(this.scoreName); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleDisplayScoreboard(this); + } + + public int func_149371_c() + { + return this.position; + } + + public String func_149370_d() + { + return this.scoreName; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java new file mode 100644 index 0000000..e8c1724 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java @@ -0,0 +1,178 @@ +package net.minecraft.network.play.server; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Collection; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Team; + +public class S3EPacketTeams implements Packet +{ + private String name = ""; + private String displayName = ""; + private String prefix = ""; + private String suffix = ""; + private String nameTagVisibility; + private int color; + private Collection players; + private int action; + private int friendlyFlags; + + public S3EPacketTeams() + { + this.nameTagVisibility = Team.EnumVisible.ALWAYS.internalName; + this.color = -1; + this.players = Lists.newArrayList(); + } + + public S3EPacketTeams(ScorePlayerTeam teamIn, int actionIn) + { + this.nameTagVisibility = Team.EnumVisible.ALWAYS.internalName; + this.color = -1; + this.players = Lists.newArrayList(); + this.name = teamIn.getRegisteredName(); + this.action = actionIn; + + if (actionIn == 0 || actionIn == 2) + { + this.displayName = teamIn.getTeamName(); + this.prefix = teamIn.getColorPrefix(); + this.suffix = teamIn.getColorSuffix(); + this.friendlyFlags = teamIn.func_98299_i(); + this.nameTagVisibility = teamIn.getNameTagVisibility().internalName; + this.color = teamIn.getChatFormat().getColorIndex(); + } + + if (actionIn == 0) + { + this.players.addAll(teamIn.getMembershipCollection()); + } + } + + public S3EPacketTeams(ScorePlayerTeam teamIn, Collection playersIn, int actionIn) + { + this.nameTagVisibility = Team.EnumVisible.ALWAYS.internalName; + this.color = -1; + this.players = Lists.newArrayList(); + + if (actionIn != 3 && actionIn != 4) + { + throw new IllegalArgumentException("Method must be join or leave for player constructor"); + } + else if (playersIn != null && !playersIn.isEmpty()) + { + this.action = actionIn; + this.name = teamIn.getRegisteredName(); + this.players.addAll(playersIn); + } + else + { + throw new IllegalArgumentException("Players cannot be null/empty"); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.name = buf.readStringFromBuffer(16); + this.action = buf.readByte(); + + if (this.action == 0 || this.action == 2) + { + this.displayName = buf.readStringFromBuffer(32); + this.prefix = buf.readStringFromBuffer(16); + this.suffix = buf.readStringFromBuffer(16); + this.friendlyFlags = buf.readByte(); + this.nameTagVisibility = buf.readStringFromBuffer(32); + this.color = buf.readByte(); + } + + if (this.action == 0 || this.action == 3 || this.action == 4) + { + int i = buf.readVarIntFromBuffer(); + + for (int j = 0; j < i; ++j) + { + this.players.add(buf.readStringFromBuffer(40)); + } + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.name); + buf.writeByte(this.action); + + if (this.action == 0 || this.action == 2) + { + buf.writeString(this.displayName); + buf.writeString(this.prefix); + buf.writeString(this.suffix); + buf.writeByte(this.friendlyFlags); + buf.writeString(this.nameTagVisibility); + buf.writeByte(this.color); + } + + if (this.action == 0 || this.action == 3 || this.action == 4) + { + buf.writeVarIntToBuffer(this.players.size()); + + for (String s : this.players) + { + buf.writeString(s); + } + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleTeams(this); + } + + public String getName() + { + return this.name; + } + + public String getDisplayName() + { + return this.displayName; + } + + public String getPrefix() + { + return this.prefix; + } + + public String getSuffix() + { + return this.suffix; + } + + public Collection getPlayers() + { + return this.players; + } + + public int getAction() + { + return this.action; + } + + public int getFriendlyFlags() + { + return this.friendlyFlags; + } + + public int getColor() + { + return this.color; + } + + public String getNameTagVisibility() + { + return this.nameTagVisibility; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java new file mode 100644 index 0000000..37a9eb8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java @@ -0,0 +1,64 @@ +package net.minecraft.network.play.server; + +import io.netty.buffer.ByteBuf; +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S3FPacketCustomPayload implements Packet +{ + private String channel; + private PacketBuffer data; + + public S3FPacketCustomPayload() + { + } + + public S3FPacketCustomPayload(String channelName, PacketBuffer dataIn) + { + this.channel = channelName; + this.data = dataIn; + + if (dataIn.writerIndex() > 1048576) + { + throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes"); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.channel = buf.readStringFromBuffer(20); + int i = buf.readableBytes(); + + if (i >= 0 && i <= 1048576) + { + this.data = new PacketBuffer(buf.readBytes(i)); + } + else + { + throw new IOException("Payload may not be larger than 1048576 bytes"); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.channel); + buf.writeBytes((ByteBuf)this.data); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCustomPayload(this); + } + + public String getChannelName() + { + return this.channel; + } + + public PacketBuffer getBufferData() + { + return this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java new file mode 100644 index 0000000..fd9794d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java @@ -0,0 +1,41 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S40PacketDisconnect implements Packet +{ + private IChatComponent reason; + + public S40PacketDisconnect() + { + } + + public S40PacketDisconnect(IChatComponent reasonIn) + { + this.reason = reasonIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.reason = buf.readChatComponent(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeChatComponent(this.reason); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleDisconnect(this); + } + + public IChatComponent getReason() + { + return this.reason; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S41PacketServerDifficulty.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S41PacketServerDifficulty.java new file mode 100644 index 0000000..636bcab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S41PacketServerDifficulty.java @@ -0,0 +1,48 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.EnumDifficulty; + +public class S41PacketServerDifficulty implements Packet +{ + private EnumDifficulty difficulty; + private boolean difficultyLocked; + + public S41PacketServerDifficulty() + { + } + + public S41PacketServerDifficulty(EnumDifficulty difficultyIn, boolean lockedIn) + { + this.difficulty = difficultyIn; + this.difficultyLocked = lockedIn; + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleServerDifficulty(this); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.difficulty = EnumDifficulty.getDifficultyEnum(buf.readUnsignedByte()); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeByte(this.difficulty.getDifficultyId()); + } + + public boolean isDifficultyLocked() + { + return this.difficultyLocked; + } + + public EnumDifficulty getDifficulty() + { + return this.difficulty; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S42PacketCombatEvent.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S42PacketCombatEvent.java new file mode 100644 index 0000000..4a9b4f3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S42PacketCombatEvent.java @@ -0,0 +1,87 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.CombatTracker; + +public class S42PacketCombatEvent implements Packet +{ + public S42PacketCombatEvent.Event eventType; + public int field_179774_b; + public int field_179775_c; + public int field_179772_d; + public String deathMessage; + + public S42PacketCombatEvent() + { + } + + @SuppressWarnings("incomplete-switch") + public S42PacketCombatEvent(CombatTracker combatTrackerIn, S42PacketCombatEvent.Event combatEventType) + { + this.eventType = combatEventType; + EntityLivingBase entitylivingbase = combatTrackerIn.func_94550_c(); + + switch (combatEventType) + { + case END_COMBAT: + this.field_179772_d = combatTrackerIn.func_180134_f(); + this.field_179775_c = entitylivingbase == null ? -1 : entitylivingbase.getEntityId(); + break; + + case ENTITY_DIED: + this.field_179774_b = combatTrackerIn.getFighter().getEntityId(); + this.field_179775_c = entitylivingbase == null ? -1 : entitylivingbase.getEntityId(); + this.deathMessage = combatTrackerIn.getDeathMessage().getUnformattedText(); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.eventType = (S42PacketCombatEvent.Event)buf.readEnumValue(S42PacketCombatEvent.Event.class); + + if (this.eventType == S42PacketCombatEvent.Event.END_COMBAT) + { + this.field_179772_d = buf.readVarIntFromBuffer(); + this.field_179775_c = buf.readInt(); + } + else if (this.eventType == S42PacketCombatEvent.Event.ENTITY_DIED) + { + this.field_179774_b = buf.readVarIntFromBuffer(); + this.field_179775_c = buf.readInt(); + this.deathMessage = buf.readStringFromBuffer(32767); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeEnumValue(this.eventType); + + if (this.eventType == S42PacketCombatEvent.Event.END_COMBAT) + { + buf.writeVarIntToBuffer(this.field_179772_d); + buf.writeInt(this.field_179775_c); + } + else if (this.eventType == S42PacketCombatEvent.Event.ENTITY_DIED) + { + buf.writeVarIntToBuffer(this.field_179774_b); + buf.writeInt(this.field_179775_c); + buf.writeString(this.deathMessage); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCombatEvent(this); + } + + public static enum Event + { + ENTER_COMBAT, + END_COMBAT, + ENTITY_DIED; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S43PacketCamera.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S43PacketCamera.java new file mode 100644 index 0000000..23ae2d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S43PacketCamera.java @@ -0,0 +1,42 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S43PacketCamera implements Packet +{ + public int entityId; + + public S43PacketCamera() + { + } + + public S43PacketCamera(Entity entityIn) + { + this.entityId = entityIn.getEntityId(); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCamera(this); + } + + public Entity getEntity(World worldIn) + { + return worldIn.getEntityByID(this.entityId); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S44PacketWorldBorder.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S44PacketWorldBorder.java new file mode 100644 index 0000000..c5dae5c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S44PacketWorldBorder.java @@ -0,0 +1,176 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.border.WorldBorder; + +public class S44PacketWorldBorder implements Packet +{ + private S44PacketWorldBorder.Action action; + private int size; + private double centerX; + private double centerZ; + private double targetSize; + private double diameter; + private long timeUntilTarget; + private int warningTime; + private int warningDistance; + + public S44PacketWorldBorder() + { + } + + public S44PacketWorldBorder(WorldBorder border, S44PacketWorldBorder.Action actionIn) + { + this.action = actionIn; + this.centerX = border.getCenterX(); + this.centerZ = border.getCenterZ(); + this.diameter = border.getDiameter(); + this.targetSize = border.getTargetSize(); + this.timeUntilTarget = border.getTimeUntilTarget(); + this.size = border.getSize(); + this.warningDistance = border.getWarningDistance(); + this.warningTime = border.getWarningTime(); + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.action = (S44PacketWorldBorder.Action)buf.readEnumValue(S44PacketWorldBorder.Action.class); + + switch (this.action) + { + case SET_SIZE: + this.targetSize = buf.readDouble(); + break; + + case LERP_SIZE: + this.diameter = buf.readDouble(); + this.targetSize = buf.readDouble(); + this.timeUntilTarget = buf.readVarLong(); + break; + + case SET_CENTER: + this.centerX = buf.readDouble(); + this.centerZ = buf.readDouble(); + break; + + case SET_WARNING_BLOCKS: + this.warningDistance = buf.readVarIntFromBuffer(); + break; + + case SET_WARNING_TIME: + this.warningTime = buf.readVarIntFromBuffer(); + break; + + case INITIALIZE: + this.centerX = buf.readDouble(); + this.centerZ = buf.readDouble(); + this.diameter = buf.readDouble(); + this.targetSize = buf.readDouble(); + this.timeUntilTarget = buf.readVarLong(); + this.size = buf.readVarIntFromBuffer(); + this.warningDistance = buf.readVarIntFromBuffer(); + this.warningTime = buf.readVarIntFromBuffer(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeEnumValue(this.action); + + switch (this.action) + { + case SET_SIZE: + buf.writeDouble(this.targetSize); + break; + + case LERP_SIZE: + buf.writeDouble(this.diameter); + buf.writeDouble(this.targetSize); + buf.writeVarLong(this.timeUntilTarget); + break; + + case SET_CENTER: + buf.writeDouble(this.centerX); + buf.writeDouble(this.centerZ); + break; + + case SET_WARNING_BLOCKS: + buf.writeVarIntToBuffer(this.warningDistance); + break; + + case SET_WARNING_TIME: + buf.writeVarIntToBuffer(this.warningTime); + break; + + case INITIALIZE: + buf.writeDouble(this.centerX); + buf.writeDouble(this.centerZ); + buf.writeDouble(this.diameter); + buf.writeDouble(this.targetSize); + buf.writeVarLong(this.timeUntilTarget); + buf.writeVarIntToBuffer(this.size); + buf.writeVarIntToBuffer(this.warningDistance); + buf.writeVarIntToBuffer(this.warningTime); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleWorldBorder(this); + } + + public void func_179788_a(WorldBorder border) + { + switch (this.action) + { + case SET_SIZE: + border.setTransition(this.targetSize); + break; + + case LERP_SIZE: + border.setTransition(this.diameter, this.targetSize, this.timeUntilTarget); + break; + + case SET_CENTER: + border.setCenter(this.centerX, this.centerZ); + break; + + case SET_WARNING_BLOCKS: + border.setWarningDistance(this.warningDistance); + break; + + case SET_WARNING_TIME: + border.setWarningTime(this.warningTime); + break; + + case INITIALIZE: + border.setCenter(this.centerX, this.centerZ); + + if (this.timeUntilTarget > 0L) + { + border.setTransition(this.diameter, this.targetSize, this.timeUntilTarget); + } + else + { + border.setTransition(this.targetSize); + } + + border.setSize(this.size); + border.setWarningDistance(this.warningDistance); + border.setWarningTime(this.warningTime); + } + } + + public static enum Action + { + SET_SIZE, + LERP_SIZE, + SET_CENTER, + INITIALIZE, + SET_WARNING_TIME, + SET_WARNING_BLOCKS; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S45PacketTitle.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S45PacketTitle.java new file mode 100644 index 0000000..51e8e9a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S45PacketTitle.java @@ -0,0 +1,138 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S45PacketTitle implements Packet +{ + private S45PacketTitle.Type type; + private IChatComponent message; + private int fadeInTime; + private int displayTime; + private int fadeOutTime; + + public S45PacketTitle() + { + } + + public S45PacketTitle(S45PacketTitle.Type type, IChatComponent message) + { + this(type, message, -1, -1, -1); + } + + public S45PacketTitle(int fadeInTime, int displayTime, int fadeOutTime) + { + this(S45PacketTitle.Type.TIMES, (IChatComponent)null, fadeInTime, displayTime, fadeOutTime); + } + + public S45PacketTitle(S45PacketTitle.Type type, IChatComponent message, int fadeInTime, int displayTime, int fadeOutTime) + { + this.type = type; + this.message = message; + this.fadeInTime = fadeInTime; + this.displayTime = displayTime; + this.fadeOutTime = fadeOutTime; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.type = (S45PacketTitle.Type)buf.readEnumValue(S45PacketTitle.Type.class); + + if (this.type == S45PacketTitle.Type.TITLE || this.type == S45PacketTitle.Type.SUBTITLE) + { + this.message = buf.readChatComponent(); + } + + if (this.type == S45PacketTitle.Type.TIMES) + { + this.fadeInTime = buf.readInt(); + this.displayTime = buf.readInt(); + this.fadeOutTime = buf.readInt(); + } + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeEnumValue(this.type); + + if (this.type == S45PacketTitle.Type.TITLE || this.type == S45PacketTitle.Type.SUBTITLE) + { + buf.writeChatComponent(this.message); + } + + if (this.type == S45PacketTitle.Type.TIMES) + { + buf.writeInt(this.fadeInTime); + buf.writeInt(this.displayTime); + buf.writeInt(this.fadeOutTime); + } + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleTitle(this); + } + + public S45PacketTitle.Type getType() + { + return this.type; + } + + public IChatComponent getMessage() + { + return this.message; + } + + public int getFadeInTime() + { + return this.fadeInTime; + } + + public int getDisplayTime() + { + return this.displayTime; + } + + public int getFadeOutTime() + { + return this.fadeOutTime; + } + + public static enum Type + { + TITLE, + SUBTITLE, + TIMES, + CLEAR, + RESET; + + public static S45PacketTitle.Type byName(String name) + { + for (S45PacketTitle.Type s45packettitle$type : values()) + { + if (s45packettitle$type.name().equalsIgnoreCase(name)) + { + return s45packettitle$type; + } + } + + return TITLE; + } + + public static String[] getNames() + { + String[] astring = new String[values().length]; + int i = 0; + + for (S45PacketTitle.Type s45packettitle$type : values()) + { + astring[i++] = s45packettitle$type.name().toLowerCase(); + } + + return astring; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java new file mode 100644 index 0000000..9fa601d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java @@ -0,0 +1,31 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S46PacketSetCompressionLevel implements Packet +{ + private int threshold; + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.threshold = buf.readVarIntFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.threshold); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSetCompressionLevel(this); + } + + public int getThreshold() + { + return this.threshold; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java new file mode 100644 index 0000000..84c19fd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java @@ -0,0 +1,49 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S47PacketPlayerListHeaderFooter implements Packet +{ + private IChatComponent header; + private IChatComponent footer; + + public S47PacketPlayerListHeaderFooter() + { + } + + public S47PacketPlayerListHeaderFooter(IChatComponent headerIn) + { + this.header = headerIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.header = buf.readChatComponent(); + this.footer = buf.readChatComponent(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeChatComponent(this.header); + buf.writeChatComponent(this.footer); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handlePlayerListHeaderFooter(this); + } + + public IChatComponent getHeader() + { + return this.header; + } + + public IChatComponent getFooter() + { + return this.footer; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S48PacketResourcePackSend.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S48PacketResourcePackSend.java new file mode 100644 index 0000000..082b1e8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S48PacketResourcePackSend.java @@ -0,0 +1,54 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S48PacketResourcePackSend implements Packet +{ + private String url; + private String hash; + + public S48PacketResourcePackSend() + { + } + + public S48PacketResourcePackSend(String url, String hash) + { + this.url = url; + this.hash = hash; + + if (hash.length() > 40) + { + throw new IllegalArgumentException("Hash is too long (max 40, was " + hash.length() + ")"); + } + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.url = buf.readStringFromBuffer(32767); + this.hash = buf.readStringFromBuffer(40); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(this.url); + buf.writeString(this.hash); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleResourcePack(this); + } + + public String getURL() + { + return this.url; + } + + public String getHash() + { + return this.hash; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java new file mode 100644 index 0000000..35d21e1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S49PacketUpdateEntityNBT implements Packet +{ + private int entityId; + private NBTTagCompound tagCompound; + + public S49PacketUpdateEntityNBT() + { + } + + public S49PacketUpdateEntityNBT(int entityIdIn, NBTTagCompound tagCompoundIn) + { + this.entityId = entityIdIn; + this.tagCompound = tagCompoundIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.entityId = buf.readVarIntFromBuffer(); + this.tagCompound = buf.readNBTTagCompoundFromBuffer(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(this.entityId); + buf.writeNBTTagCompoundToBuffer(this.tagCompound); + } + + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityNBT(this); + } + + public NBTTagCompound getTagCompound() + { + return this.tagCompound; + } + + public Entity getEntity(World worldIn) + { + return worldIn.getEntityByID(this.entityId); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/rcon/RConConsoleSource.java b/Client-1.8.9/src/main/java/net/minecraft/network/rcon/RConConsoleSource.java new file mode 100644 index 0000000..6a7b7ca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/rcon/RConConsoleSource.java @@ -0,0 +1,66 @@ +package net.minecraft.network.rcon; + +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.Entity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class RConConsoleSource implements ICommandSender +{ + private static final RConConsoleSource instance = new RConConsoleSource(); + private StringBuffer buffer = new StringBuffer(); + + public String getName() + { + return "Rcon"; + } + + public IChatComponent getDisplayName() + { + return new ChatComponentText(this.getName()); + } + + public void addChatMessage(IChatComponent component) + { + this.buffer.append(component.getUnformattedText()); + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return true; + } + + public BlockPos getPosition() + { + return new BlockPos(0, 0, 0); + } + + public Vec3 getPositionVector() + { + return new Vec3(0.0D, 0.0D, 0.0D); + } + + public World getEntityWorld() + { + return MinecraftServer.getServer().getEntityWorld(); + } + + public Entity getCommandSenderEntity() + { + return null; + } + + public boolean sendCommandFeedback() + { + return true; + } + + public void setCommandStat(CommandResultStats.Type type, int amount) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java b/Client-1.8.9/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java new file mode 100644 index 0000000..ebff468 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java @@ -0,0 +1,12 @@ +package net.minecraft.network.status; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; + +public interface INetHandlerStatusClient extends INetHandler +{ + void handleServerInfo(S00PacketServerInfo packetIn); + + void handlePong(S01PacketPong packetIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java b/Client-1.8.9/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java new file mode 100644 index 0000000..cfdd5b3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java @@ -0,0 +1,12 @@ +package net.minecraft.network.status; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; + +public interface INetHandlerStatusServer extends INetHandler +{ + void processPing(C01PacketPing packetIn); + + void processServerQuery(C00PacketServerQuery packetIn); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java b/Client-1.8.9/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java new file mode 100644 index 0000000..a9b5814 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java @@ -0,0 +1,22 @@ +package net.minecraft.network.status.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusServer; + +public class C00PacketServerQuery implements Packet +{ + public void readPacketData(PacketBuffer buf) throws IOException + { + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + } + + public void processPacket(INetHandlerStatusServer handler) + { + handler.processServerQuery(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/status/client/C01PacketPing.java b/Client-1.8.9/src/main/java/net/minecraft/network/status/client/C01PacketPing.java new file mode 100644 index 0000000..7ae431f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/status/client/C01PacketPing.java @@ -0,0 +1,40 @@ +package net.minecraft.network.status.client; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusServer; + +public class C01PacketPing implements Packet +{ + private long clientTime; + + public C01PacketPing() + { + } + + public C01PacketPing(long ping) + { + this.clientTime = ping; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.clientTime = buf.readLong(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeLong(this.clientTime); + } + + public void processPacket(INetHandlerStatusServer handler) + { + handler.processPing(this); + } + + public long getClientTime() + { + return this.clientTime; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java b/Client-1.8.9/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java new file mode 100644 index 0000000..4e0c90c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java @@ -0,0 +1,47 @@ +package net.minecraft.network.status.server; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumTypeAdapterFactory; +import net.minecraft.util.IChatComponent; + +public class S00PacketServerInfo implements Packet +{ + private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ServerStatusResponse.MinecraftProtocolVersionIdentifier.class, new ServerStatusResponse.MinecraftProtocolVersionIdentifier.Serializer()).registerTypeAdapter(ServerStatusResponse.PlayerCountData.class, new ServerStatusResponse.PlayerCountData.Serializer()).registerTypeAdapter(ServerStatusResponse.class, new ServerStatusResponse.Serializer()).registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()).registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()).registerTypeAdapterFactory(new EnumTypeAdapterFactory()).create(); + private ServerStatusResponse response; + + public S00PacketServerInfo() + { + } + + public S00PacketServerInfo(ServerStatusResponse responseIn) + { + this.response = responseIn; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.response = (ServerStatusResponse)GSON.fromJson(buf.readStringFromBuffer(32767), ServerStatusResponse.class); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeString(GSON.toJson((Object)this.response)); + } + + public void processPacket(INetHandlerStatusClient handler) + { + handler.handleServerInfo(this); + } + + public ServerStatusResponse getResponse() + { + return this.response; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/network/status/server/S01PacketPong.java b/Client-1.8.9/src/main/java/net/minecraft/network/status/server/S01PacketPong.java new file mode 100644 index 0000000..a43766a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/network/status/server/S01PacketPong.java @@ -0,0 +1,35 @@ +package net.minecraft.network.status.server; + +import java.io.IOException; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusClient; + +public class S01PacketPong implements Packet +{ + private long clientTime; + + public S01PacketPong() + { + } + + public S01PacketPong(long time) + { + this.clientTime = time; + } + + public void readPacketData(PacketBuffer buf) throws IOException + { + this.clientTime = buf.readLong(); + } + + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeLong(this.clientTime); + } + + public void processPacket(INetHandlerStatusClient handler) + { + handler.handlePong(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/Path.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/Path.java new file mode 100644 index 0000000..c823c13 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/Path.java @@ -0,0 +1,151 @@ +package net.minecraft.pathfinding; + +public class Path +{ + private PathPoint[] pathPoints = new PathPoint[1024]; + private int count; + + public PathPoint addPoint(PathPoint point) + { + if (point.index >= 0) + { + throw new IllegalStateException("OW KNOWS!"); + } + else + { + if (this.count == this.pathPoints.length) + { + PathPoint[] apathpoint = new PathPoint[this.count << 1]; + System.arraycopy(this.pathPoints, 0, apathpoint, 0, this.count); + this.pathPoints = apathpoint; + } + + this.pathPoints[this.count] = point; + point.index = this.count; + this.sortBack(this.count++); + return point; + } + } + + public void clearPath() + { + this.count = 0; + } + + public PathPoint dequeue() + { + PathPoint pathpoint = this.pathPoints[0]; + this.pathPoints[0] = this.pathPoints[--this.count]; + this.pathPoints[this.count] = null; + + if (this.count > 0) + { + this.sortForward(0); + } + + pathpoint.index = -1; + return pathpoint; + } + + public void changeDistance(PathPoint p_75850_1_, float p_75850_2_) + { + float f = p_75850_1_.distanceToTarget; + p_75850_1_.distanceToTarget = p_75850_2_; + + if (p_75850_2_ < f) + { + this.sortBack(p_75850_1_.index); + } + else + { + this.sortForward(p_75850_1_.index); + } + } + + private void sortBack(int p_75847_1_) + { + PathPoint pathpoint = this.pathPoints[p_75847_1_]; + int i; + + for (float f = pathpoint.distanceToTarget; p_75847_1_ > 0; p_75847_1_ = i) + { + i = p_75847_1_ - 1 >> 1; + PathPoint pathpoint1 = this.pathPoints[i]; + + if (f >= pathpoint1.distanceToTarget) + { + break; + } + + this.pathPoints[p_75847_1_] = pathpoint1; + pathpoint1.index = p_75847_1_; + } + + this.pathPoints[p_75847_1_] = pathpoint; + pathpoint.index = p_75847_1_; + } + + private void sortForward(int p_75846_1_) + { + PathPoint pathpoint = this.pathPoints[p_75846_1_]; + float f = pathpoint.distanceToTarget; + + while (true) + { + int i = 1 + (p_75846_1_ << 1); + int j = i + 1; + + if (i >= this.count) + { + break; + } + + PathPoint pathpoint1 = this.pathPoints[i]; + float f1 = pathpoint1.distanceToTarget; + PathPoint pathpoint2; + float f2; + + if (j >= this.count) + { + pathpoint2 = null; + f2 = Float.POSITIVE_INFINITY; + } + else + { + pathpoint2 = this.pathPoints[j]; + f2 = pathpoint2.distanceToTarget; + } + + if (f1 < f2) + { + if (f1 >= f) + { + break; + } + + this.pathPoints[p_75846_1_] = pathpoint1; + pathpoint1.index = p_75846_1_; + p_75846_1_ = i; + } + else + { + if (f2 >= f) + { + break; + } + + this.pathPoints[p_75846_1_] = pathpoint2; + pathpoint2.index = p_75846_1_; + p_75846_1_ = j; + } + } + + this.pathPoints[p_75846_1_] = pathpoint; + pathpoint.index = p_75846_1_; + } + + public boolean isPathEmpty() + { + return this.count == 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathEntity.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathEntity.java new file mode 100644 index 0000000..0826417 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathEntity.java @@ -0,0 +1,100 @@ +package net.minecraft.pathfinding; + +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; + +public class PathEntity +{ + private final PathPoint[] points; + private int currentPathIndex; + private int pathLength; + + public PathEntity(PathPoint[] pathpoints) + { + this.points = pathpoints; + this.pathLength = pathpoints.length; + } + + public void incrementPathIndex() + { + ++this.currentPathIndex; + } + + public boolean isFinished() + { + return this.currentPathIndex >= this.pathLength; + } + + public PathPoint getFinalPathPoint() + { + return this.pathLength > 0 ? this.points[this.pathLength - 1] : null; + } + + public PathPoint getPathPointFromIndex(int index) + { + return this.points[index]; + } + + public int getCurrentPathLength() + { + return this.pathLength; + } + + public void setCurrentPathLength(int length) + { + this.pathLength = length; + } + + public int getCurrentPathIndex() + { + return this.currentPathIndex; + } + + public void setCurrentPathIndex(int currentPathIndexIn) + { + this.currentPathIndex = currentPathIndexIn; + } + + public Vec3 getVectorFromIndex(Entity entityIn, int index) + { + double d0 = (double)this.points[index].xCoord + (double)((int)(entityIn.width + 1.0F)) * 0.5D; + double d1 = (double)this.points[index].yCoord; + double d2 = (double)this.points[index].zCoord + (double)((int)(entityIn.width + 1.0F)) * 0.5D; + return new Vec3(d0, d1, d2); + } + + public Vec3 getPosition(Entity entityIn) + { + return this.getVectorFromIndex(entityIn, this.currentPathIndex); + } + + public boolean isSamePath(PathEntity pathentityIn) + { + if (pathentityIn == null) + { + return false; + } + else if (pathentityIn.points.length != this.points.length) + { + return false; + } + else + { + for (int i = 0; i < this.points.length; ++i) + { + if (this.points[i].xCoord != pathentityIn.points[i].xCoord || this.points[i].yCoord != pathentityIn.points[i].yCoord || this.points[i].zCoord != pathentityIn.points[i].zCoord) + { + return false; + } + } + + return true; + } + } + + public boolean isDestinationSame(Vec3 vec) + { + PathPoint pathpoint = this.getFinalPathPoint(); + return pathpoint == null ? false : pathpoint.xCoord == (int)vec.xCoord && pathpoint.zCoord == (int)vec.zCoord; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathFinder.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathFinder.java new file mode 100644 index 0000000..002abaa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathFinder.java @@ -0,0 +1,121 @@ +package net.minecraft.pathfinding; + +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.pathfinder.NodeProcessor; + +public class PathFinder +{ + private Path path = new Path(); + private PathPoint[] pathOptions = new PathPoint[32]; + private NodeProcessor nodeProcessor; + + public PathFinder(NodeProcessor nodeProcessorIn) + { + this.nodeProcessor = nodeProcessorIn; + } + + public PathEntity createEntityPathTo(IBlockAccess blockaccess, Entity entityFrom, Entity entityTo, float dist) + { + return this.createEntityPathTo(blockaccess, entityFrom, entityTo.posX, entityTo.getEntityBoundingBox().minY, entityTo.posZ, dist); + } + + public PathEntity createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, BlockPos targetPos, float dist) + { + return this.createEntityPathTo(blockaccess, entityIn, (double)((float)targetPos.getX() + 0.5F), (double)((float)targetPos.getY() + 0.5F), (double)((float)targetPos.getZ() + 0.5F), dist); + } + + private PathEntity createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, double x, double y, double z, float distance) + { + this.path.clearPath(); + this.nodeProcessor.initProcessor(blockaccess, entityIn); + PathPoint pathpoint = this.nodeProcessor.getPathPointTo(entityIn); + PathPoint pathpoint1 = this.nodeProcessor.getPathPointToCoords(entityIn, x, y, z); + PathEntity pathentity = this.addToPath(entityIn, pathpoint, pathpoint1, distance); + this.nodeProcessor.postProcess(); + return pathentity; + } + + private PathEntity addToPath(Entity entityIn, PathPoint pathpointStart, PathPoint pathpointEnd, float maxDistance) + { + pathpointStart.totalPathDistance = 0.0F; + pathpointStart.distanceToNext = pathpointStart.distanceToSquared(pathpointEnd); + pathpointStart.distanceToTarget = pathpointStart.distanceToNext; + this.path.clearPath(); + this.path.addPoint(pathpointStart); + PathPoint pathpoint = pathpointStart; + + while (!this.path.isPathEmpty()) + { + PathPoint pathpoint1 = this.path.dequeue(); + + if (pathpoint1.equals(pathpointEnd)) + { + return this.createEntityPath(pathpointStart, pathpointEnd); + } + + if (pathpoint1.distanceToSquared(pathpointEnd) < pathpoint.distanceToSquared(pathpointEnd)) + { + pathpoint = pathpoint1; + } + + pathpoint1.visited = true; + int i = this.nodeProcessor.findPathOptions(this.pathOptions, entityIn, pathpoint1, pathpointEnd, maxDistance); + + for (int j = 0; j < i; ++j) + { + PathPoint pathpoint2 = this.pathOptions[j]; + float f = pathpoint1.totalPathDistance + pathpoint1.distanceToSquared(pathpoint2); + + if (f < maxDistance * 2.0F && (!pathpoint2.isAssigned() || f < pathpoint2.totalPathDistance)) + { + pathpoint2.previous = pathpoint1; + pathpoint2.totalPathDistance = f; + pathpoint2.distanceToNext = pathpoint2.distanceToSquared(pathpointEnd); + + if (pathpoint2.isAssigned()) + { + this.path.changeDistance(pathpoint2, pathpoint2.totalPathDistance + pathpoint2.distanceToNext); + } + else + { + pathpoint2.distanceToTarget = pathpoint2.totalPathDistance + pathpoint2.distanceToNext; + this.path.addPoint(pathpoint2); + } + } + } + } + + if (pathpoint == pathpointStart) + { + return null; + } + else + { + return this.createEntityPath(pathpointStart, pathpoint); + } + } + + private PathEntity createEntityPath(PathPoint start, PathPoint end) + { + int i = 1; + + for (PathPoint pathpoint = end; pathpoint.previous != null; pathpoint = pathpoint.previous) + { + ++i; + } + + PathPoint[] apathpoint = new PathPoint[i]; + PathPoint pathpoint1 = end; + --i; + + for (apathpoint[i] = end; pathpoint1.previous != null; apathpoint[i] = pathpoint1) + { + pathpoint1 = pathpoint1.previous; + --i; + } + + return new PathEntity(apathpoint); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigate.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigate.java new file mode 100644 index 0000000..3c39de0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigate.java @@ -0,0 +1,267 @@ +package net.minecraft.pathfinding; + +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.World; + +public abstract class PathNavigate +{ + protected EntityLiving theEntity; + protected World worldObj; + protected PathEntity currentPath; + protected double speed; + private final IAttributeInstance pathSearchRange; + private int totalTicks; + private int ticksAtLastPos; + private Vec3 lastPosCheck = new Vec3(0.0D, 0.0D, 0.0D); + private float heightRequirement = 1.0F; + private final PathFinder pathFinder; + + public PathNavigate(EntityLiving entitylivingIn, World worldIn) + { + this.theEntity = entitylivingIn; + this.worldObj = worldIn; + this.pathSearchRange = entitylivingIn.getEntityAttribute(SharedMonsterAttributes.followRange); + this.pathFinder = this.getPathFinder(); + } + + protected abstract PathFinder getPathFinder(); + + public void setSpeed(double speedIn) + { + this.speed = speedIn; + } + + public float getPathSearchRange() + { + return (float)this.pathSearchRange.getAttributeValue(); + } + + public final PathEntity getPathToXYZ(double x, double y, double z) + { + return this.getPathToPos(new BlockPos(MathHelper.floor_double(x), (int)y, MathHelper.floor_double(z))); + } + + public PathEntity getPathToPos(BlockPos pos) + { + if (!this.canNavigate()) + { + return null; + } + else + { + float f = this.getPathSearchRange(); + this.worldObj.theProfiler.startSection("pathfind"); + BlockPos blockpos = new BlockPos(this.theEntity); + int i = (int)(f + 8.0F); + ChunkCache chunkcache = new ChunkCache(this.worldObj, blockpos.add(-i, -i, -i), blockpos.add(i, i, i), 0); + PathEntity pathentity = this.pathFinder.createEntityPathTo(chunkcache, this.theEntity, pos, f); + this.worldObj.theProfiler.endSection(); + return pathentity; + } + } + + public boolean tryMoveToXYZ(double x, double y, double z, double speedIn) + { + PathEntity pathentity = this.getPathToXYZ((double)MathHelper.floor_double(x), (double)((int)y), (double)MathHelper.floor_double(z)); + return this.setPath(pathentity, speedIn); + } + + public void setHeightRequirement(float jumpHeight) + { + this.heightRequirement = jumpHeight; + } + + public PathEntity getPathToEntityLiving(Entity entityIn) + { + if (!this.canNavigate()) + { + return null; + } + else + { + float f = this.getPathSearchRange(); + this.worldObj.theProfiler.startSection("pathfind"); + BlockPos blockpos = (new BlockPos(this.theEntity)).up(); + int i = (int)(f + 16.0F); + ChunkCache chunkcache = new ChunkCache(this.worldObj, blockpos.add(-i, -i, -i), blockpos.add(i, i, i), 0); + PathEntity pathentity = this.pathFinder.createEntityPathTo(chunkcache, this.theEntity, entityIn, f); + this.worldObj.theProfiler.endSection(); + return pathentity; + } + } + + public boolean tryMoveToEntityLiving(Entity entityIn, double speedIn) + { + PathEntity pathentity = this.getPathToEntityLiving(entityIn); + return pathentity != null ? this.setPath(pathentity, speedIn) : false; + } + + public boolean setPath(PathEntity pathentityIn, double speedIn) + { + if (pathentityIn == null) + { + this.currentPath = null; + return false; + } + else + { + if (!pathentityIn.isSamePath(this.currentPath)) + { + this.currentPath = pathentityIn; + } + + this.removeSunnyPath(); + + if (this.currentPath.getCurrentPathLength() == 0) + { + return false; + } + else + { + this.speed = speedIn; + Vec3 vec3 = this.getEntityPosition(); + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck = vec3; + return true; + } + } + } + + public PathEntity getPath() + { + return this.currentPath; + } + + public void onUpdateNavigation() + { + ++this.totalTicks; + + if (!this.noPath()) + { + if (this.canNavigate()) + { + this.pathFollow(); + } + else if (this.currentPath != null && this.currentPath.getCurrentPathIndex() < this.currentPath.getCurrentPathLength()) + { + Vec3 vec3 = this.getEntityPosition(); + Vec3 vec31 = this.currentPath.getVectorFromIndex(this.theEntity, this.currentPath.getCurrentPathIndex()); + + if (vec3.yCoord > vec31.yCoord && !this.theEntity.onGround && MathHelper.floor_double(vec3.xCoord) == MathHelper.floor_double(vec31.xCoord) && MathHelper.floor_double(vec3.zCoord) == MathHelper.floor_double(vec31.zCoord)) + { + this.currentPath.setCurrentPathIndex(this.currentPath.getCurrentPathIndex() + 1); + } + } + + if (!this.noPath()) + { + Vec3 vec32 = this.currentPath.getPosition(this.theEntity); + + if (vec32 != null) + { + AxisAlignedBB axisalignedbb1 = (new AxisAlignedBB(vec32.xCoord, vec32.yCoord, vec32.zCoord, vec32.xCoord, vec32.yCoord, vec32.zCoord)).expand(0.5D, 0.5D, 0.5D); + List list = this.worldObj.getCollidingBoundingBoxes(this.theEntity, axisalignedbb1.addCoord(0.0D, -1.0D, 0.0D)); + double d0 = -1.0D; + axisalignedbb1 = axisalignedbb1.offset(0.0D, 1.0D, 0.0D); + + for (AxisAlignedBB axisalignedbb : list) + { + d0 = axisalignedbb.calculateYOffset(axisalignedbb1, d0); + } + + this.theEntity.getMoveHelper().setMoveTo(vec32.xCoord, vec32.yCoord + d0, vec32.zCoord, this.speed); + } + } + } + } + + protected void pathFollow() + { + Vec3 vec3 = this.getEntityPosition(); + int i = this.currentPath.getCurrentPathLength(); + + for (int j = this.currentPath.getCurrentPathIndex(); j < this.currentPath.getCurrentPathLength(); ++j) + { + if (this.currentPath.getPathPointFromIndex(j).yCoord != (int)vec3.yCoord) + { + i = j; + break; + } + } + + float f = this.theEntity.width * this.theEntity.width * this.heightRequirement; + + for (int k = this.currentPath.getCurrentPathIndex(); k < i; ++k) + { + Vec3 vec31 = this.currentPath.getVectorFromIndex(this.theEntity, k); + + if (vec3.squareDistanceTo(vec31) < (double)f) + { + this.currentPath.setCurrentPathIndex(k + 1); + } + } + + int j1 = MathHelper.ceiling_float_int(this.theEntity.width); + int k1 = (int)this.theEntity.height + 1; + int l = j1; + + for (int i1 = i - 1; i1 >= this.currentPath.getCurrentPathIndex(); --i1) + { + if (this.isDirectPathBetweenPoints(vec3, this.currentPath.getVectorFromIndex(this.theEntity, i1), j1, k1, l)) + { + this.currentPath.setCurrentPathIndex(i1); + break; + } + } + + this.checkForStuck(vec3); + } + + protected void checkForStuck(Vec3 positionVec3) + { + if (this.totalTicks - this.ticksAtLastPos > 100) + { + if (positionVec3.squareDistanceTo(this.lastPosCheck) < 2.25D) + { + this.clearPathEntity(); + } + + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck = positionVec3; + } + } + + public boolean noPath() + { + return this.currentPath == null || this.currentPath.isFinished(); + } + + public void clearPathEntity() + { + this.currentPath = null; + } + + protected abstract Vec3 getEntityPosition(); + + protected abstract boolean canNavigate(); + + protected boolean isInLiquid() + { + return this.theEntity.isInWater() || this.theEntity.isInLava(); + } + + protected void removeSunnyPath() + { + } + + protected abstract boolean isDirectPathBetweenPoints(Vec3 posVec31, Vec3 posVec32, int sizeX, int sizeY, int sizeZ); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateClimber.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateClimber.java new file mode 100644 index 0000000..8c093e6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateClimber.java @@ -0,0 +1,69 @@ +package net.minecraft.pathfinding; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class PathNavigateClimber extends PathNavigateGround +{ + private BlockPos targetPosition; + + public PathNavigateClimber(EntityLiving entityLivingIn, World worldIn) + { + super(entityLivingIn, worldIn); + } + + public PathEntity getPathToPos(BlockPos pos) + { + this.targetPosition = pos; + return super.getPathToPos(pos); + } + + public PathEntity getPathToEntityLiving(Entity entityIn) + { + this.targetPosition = new BlockPos(entityIn); + return super.getPathToEntityLiving(entityIn); + } + + public boolean tryMoveToEntityLiving(Entity entityIn, double speedIn) + { + PathEntity pathentity = this.getPathToEntityLiving(entityIn); + + if (pathentity != null) + { + return this.setPath(pathentity, speedIn); + } + else + { + this.targetPosition = new BlockPos(entityIn); + this.speed = speedIn; + return true; + } + } + + public void onUpdateNavigation() + { + if (!this.noPath()) + { + super.onUpdateNavigation(); + } + else + { + if (this.targetPosition != null) + { + double d0 = (double)(this.theEntity.width * this.theEntity.width); + + if (this.theEntity.getDistanceSqToCenter(this.targetPosition) >= d0 && (this.theEntity.posY <= (double)this.targetPosition.getY() || this.theEntity.getDistanceSqToCenter(new BlockPos(this.targetPosition.getX(), MathHelper.floor_double(this.theEntity.posY), this.targetPosition.getZ())) >= d0)) + { + this.theEntity.getMoveHelper().setMoveTo((double)this.targetPosition.getX(), (double)this.targetPosition.getY(), (double)this.targetPosition.getZ(), this.speed); + } + else + { + this.targetPosition = null; + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateGround.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateGround.java new file mode 100644 index 0000000..42f16e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateGround.java @@ -0,0 +1,277 @@ +package net.minecraft.pathfinding; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.pathfinder.WalkNodeProcessor; + +public class PathNavigateGround extends PathNavigate +{ + protected WalkNodeProcessor nodeProcessor; + private boolean shouldAvoidSun; + + public PathNavigateGround(EntityLiving entitylivingIn, World worldIn) + { + super(entitylivingIn, worldIn); + } + + protected PathFinder getPathFinder() + { + this.nodeProcessor = new WalkNodeProcessor(); + this.nodeProcessor.setEnterDoors(true); + return new PathFinder(this.nodeProcessor); + } + + protected boolean canNavigate() + { + return this.theEntity.onGround || this.getCanSwim() && this.isInLiquid() || this.theEntity.isRiding() && this.theEntity instanceof EntityZombie && this.theEntity.ridingEntity instanceof EntityChicken; + } + + protected Vec3 getEntityPosition() + { + return new Vec3(this.theEntity.posX, (double)this.getPathablePosY(), this.theEntity.posZ); + } + + private int getPathablePosY() + { + if (this.theEntity.isInWater() && this.getCanSwim()) + { + int i = (int)this.theEntity.getEntityBoundingBox().minY; + Block block = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.theEntity.posX), i, MathHelper.floor_double(this.theEntity.posZ))).getBlock(); + int j = 0; + + while (block == Blocks.flowing_water || block == Blocks.water) + { + ++i; + block = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.theEntity.posX), i, MathHelper.floor_double(this.theEntity.posZ))).getBlock(); + ++j; + + if (j > 16) + { + return (int)this.theEntity.getEntityBoundingBox().minY; + } + } + + return i; + } + else + { + return (int)(this.theEntity.getEntityBoundingBox().minY + 0.5D); + } + } + + protected void removeSunnyPath() + { + super.removeSunnyPath(); + + if (this.shouldAvoidSun) + { + if (this.worldObj.canSeeSky(new BlockPos(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.getEntityBoundingBox().minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ)))) + { + return; + } + + for (int i = 0; i < this.currentPath.getCurrentPathLength(); ++i) + { + PathPoint pathpoint = this.currentPath.getPathPointFromIndex(i); + + if (this.worldObj.canSeeSky(new BlockPos(pathpoint.xCoord, pathpoint.yCoord, pathpoint.zCoord))) + { + this.currentPath.setCurrentPathLength(i - 1); + return; + } + } + } + } + + protected boolean isDirectPathBetweenPoints(Vec3 posVec31, Vec3 posVec32, int sizeX, int sizeY, int sizeZ) + { + int i = MathHelper.floor_double(posVec31.xCoord); + int j = MathHelper.floor_double(posVec31.zCoord); + double d0 = posVec32.xCoord - posVec31.xCoord; + double d1 = posVec32.zCoord - posVec31.zCoord; + double d2 = d0 * d0 + d1 * d1; + + if (d2 < 1.0E-8D) + { + return false; + } + else + { + double d3 = 1.0D / Math.sqrt(d2); + d0 = d0 * d3; + d1 = d1 * d3; + sizeX = sizeX + 2; + sizeZ = sizeZ + 2; + + if (!this.isSafeToStandAt(i, (int)posVec31.yCoord, j, sizeX, sizeY, sizeZ, posVec31, d0, d1)) + { + return false; + } + else + { + sizeX = sizeX - 2; + sizeZ = sizeZ - 2; + double d4 = 1.0D / Math.abs(d0); + double d5 = 1.0D / Math.abs(d1); + double d6 = (double)(i * 1) - posVec31.xCoord; + double d7 = (double)(j * 1) - posVec31.zCoord; + + if (d0 >= 0.0D) + { + ++d6; + } + + if (d1 >= 0.0D) + { + ++d7; + } + + d6 = d6 / d0; + d7 = d7 / d1; + int k = d0 < 0.0D ? -1 : 1; + int l = d1 < 0.0D ? -1 : 1; + int i1 = MathHelper.floor_double(posVec32.xCoord); + int j1 = MathHelper.floor_double(posVec32.zCoord); + int k1 = i1 - i; + int l1 = j1 - j; + + while (k1 * k > 0 || l1 * l > 0) + { + if (d6 < d7) + { + d6 += d4; + i += k; + k1 = i1 - i; + } + else + { + d7 += d5; + j += l; + l1 = j1 - j; + } + + if (!this.isSafeToStandAt(i, (int)posVec31.yCoord, j, sizeX, sizeY, sizeZ, posVec31, d0, d1)) + { + return false; + } + } + + return true; + } + } + } + + private boolean isSafeToStandAt(int x, int y, int z, int sizeX, int sizeY, int sizeZ, Vec3 vec31, double p_179683_8_, double p_179683_10_) + { + int i = x - sizeX / 2; + int j = z - sizeZ / 2; + + if (!this.isPositionClear(i, y, j, sizeX, sizeY, sizeZ, vec31, p_179683_8_, p_179683_10_)) + { + return false; + } + else + { + for (int k = i; k < i + sizeX; ++k) + { + for (int l = j; l < j + sizeZ; ++l) + { + double d0 = (double)k + 0.5D - vec31.xCoord; + double d1 = (double)l + 0.5D - vec31.zCoord; + + if (d0 * p_179683_8_ + d1 * p_179683_10_ >= 0.0D) + { + Block block = this.worldObj.getBlockState(new BlockPos(k, y - 1, l)).getBlock(); + Material material = block.getMaterial(); + + if (material == Material.air) + { + return false; + } + + if (material == Material.water && !this.theEntity.isInWater()) + { + return false; + } + + if (material == Material.lava) + { + return false; + } + } + } + } + + return true; + } + } + + private boolean isPositionClear(int p_179692_1_, int p_179692_2_, int p_179692_3_, int p_179692_4_, int p_179692_5_, int p_179692_6_, Vec3 p_179692_7_, double p_179692_8_, double p_179692_10_) + { + for (BlockPos blockpos : BlockPos.getAllInBox(new BlockPos(p_179692_1_, p_179692_2_, p_179692_3_), new BlockPos(p_179692_1_ + p_179692_4_ - 1, p_179692_2_ + p_179692_5_ - 1, p_179692_3_ + p_179692_6_ - 1))) + { + double d0 = (double)blockpos.getX() + 0.5D - p_179692_7_.xCoord; + double d1 = (double)blockpos.getZ() + 0.5D - p_179692_7_.zCoord; + + if (d0 * p_179692_8_ + d1 * p_179692_10_ >= 0.0D) + { + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + + if (!block.isPassable(this.worldObj, blockpos)) + { + return false; + } + } + } + + return true; + } + + public void setAvoidsWater(boolean avoidsWater) + { + this.nodeProcessor.setAvoidsWater(avoidsWater); + } + + public boolean getAvoidsWater() + { + return this.nodeProcessor.getAvoidsWater(); + } + + public void setBreakDoors(boolean canBreakDoors) + { + this.nodeProcessor.setBreakDoors(canBreakDoors); + } + + public void setEnterDoors(boolean par1) + { + this.nodeProcessor.setEnterDoors(par1); + } + + public boolean getEnterDoors() + { + return this.nodeProcessor.getEnterDoors(); + } + + public void setCanSwim(boolean canSwim) + { + this.nodeProcessor.setCanSwim(canSwim); + } + + public boolean getCanSwim() + { + return this.nodeProcessor.getCanSwim(); + } + + public void setAvoidSun(boolean par1) + { + this.shouldAvoidSun = par1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateSwimmer.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateSwimmer.java new file mode 100644 index 0000000..0904d4f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathNavigateSwimmer.java @@ -0,0 +1,66 @@ +package net.minecraft.pathfinding; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.pathfinder.SwimNodeProcessor; + +public class PathNavigateSwimmer extends PathNavigate +{ + public PathNavigateSwimmer(EntityLiving entitylivingIn, World worldIn) + { + super(entitylivingIn, worldIn); + } + + protected PathFinder getPathFinder() + { + return new PathFinder(new SwimNodeProcessor()); + } + + protected boolean canNavigate() + { + return this.isInLiquid(); + } + + protected Vec3 getEntityPosition() + { + return new Vec3(this.theEntity.posX, this.theEntity.posY + (double)this.theEntity.height * 0.5D, this.theEntity.posZ); + } + + protected void pathFollow() + { + Vec3 vec3 = this.getEntityPosition(); + float f = this.theEntity.width * this.theEntity.width; + int i = 6; + + if (vec3.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, this.currentPath.getCurrentPathIndex())) < (double)f) + { + this.currentPath.incrementPathIndex(); + } + + for (int j = Math.min(this.currentPath.getCurrentPathIndex() + i, this.currentPath.getCurrentPathLength() - 1); j > this.currentPath.getCurrentPathIndex(); --j) + { + Vec3 vec31 = this.currentPath.getVectorFromIndex(this.theEntity, j); + + if (vec31.squareDistanceTo(vec3) <= 36.0D && this.isDirectPathBetweenPoints(vec3, vec31, 0, 0, 0)) + { + this.currentPath.setCurrentPathIndex(j); + break; + } + } + + this.checkForStuck(vec3); + } + + protected void removeSunnyPath() + { + super.removeSunnyPath(); + } + + protected boolean isDirectPathBetweenPoints(Vec3 posVec31, Vec3 posVec32, int sizeX, int sizeY, int sizeZ) + { + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(posVec31, new Vec3(posVec32.xCoord, posVec32.yCoord + (double)this.theEntity.height * 0.5D, posVec32.zCoord), false, true, false); + return movingobjectposition == null || movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.MISS; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathPoint.java b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathPoint.java new file mode 100644 index 0000000..ed9d4cf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/pathfinding/PathPoint.java @@ -0,0 +1,74 @@ +package net.minecraft.pathfinding; + +import net.minecraft.util.MathHelper; + +public class PathPoint +{ + public final int xCoord; + public final int yCoord; + public final int zCoord; + private final int hash; + int index = -1; + float totalPathDistance; + float distanceToNext; + float distanceToTarget; + PathPoint previous; + public boolean visited; + + public PathPoint(int x, int y, int z) + { + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.hash = makeHash(x, y, z); + } + + public static int makeHash(int x, int y, int z) + { + return y & 255 | (x & 32767) << 8 | (z & 32767) << 24 | (x < 0 ? Integer.MIN_VALUE : 0) | (z < 0 ? 32768 : 0); + } + + public float distanceTo(PathPoint pathpointIn) + { + float f = (float)(pathpointIn.xCoord - this.xCoord); + float f1 = (float)(pathpointIn.yCoord - this.yCoord); + float f2 = (float)(pathpointIn.zCoord - this.zCoord); + return MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2); + } + + public float distanceToSquared(PathPoint pathpointIn) + { + float f = (float)(pathpointIn.xCoord - this.xCoord); + float f1 = (float)(pathpointIn.yCoord - this.yCoord); + float f2 = (float)(pathpointIn.zCoord - this.zCoord); + return f * f + f1 * f1 + f2 * f2; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof PathPoint)) + { + return false; + } + else + { + PathPoint pathpoint = (PathPoint)p_equals_1_; + return this.hash == pathpoint.hash && this.xCoord == pathpoint.xCoord && this.yCoord == pathpoint.yCoord && this.zCoord == pathpoint.zCoord; + } + } + + public int hashCode() + { + return this.hash; + } + + public boolean isAssigned() + { + return this.index >= 0; + } + + public String toString() + { + return this.xCoord + ", " + this.yCoord + ", " + this.zCoord; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/potion/Potion.java b/Client-1.8.9/src/main/java/net/minecraft/potion/Potion.java new file mode 100644 index 0000000..44cd4fe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/potion/Potion.java @@ -0,0 +1,306 @@ +package net.minecraft.potion; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; + +public class Potion +{ + public static final Potion[] potionTypes = new Potion[32]; + private static final Map field_180150_I = Maps.newHashMap(); + public static final Potion field_180151_b = null; + public static final Potion moveSpeed = (new Potion(1, new ResourceLocation("speed"), false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); + public static final Potion moveSlowdown = (new Potion(2, new ResourceLocation("slowness"), true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", -0.15000000596046448D, 2); + public static final Potion digSpeed = (new Potion(3, new ResourceLocation("haste"), false, 14270531)).setPotionName("potion.digSpeed").setIconIndex(2, 0).setEffectiveness(1.5D); + public static final Potion digSlowdown = (new Potion(4, new ResourceLocation("mining_fatigue"), true, 4866583)).setPotionName("potion.digSlowDown").setIconIndex(3, 0); + public static final Potion damageBoost = (new PotionAttackDamage(5, new ResourceLocation("strength"), false, 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).registerPotionAttributeModifier(SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 2.5D, 2); + public static final Potion heal = (new PotionHealth(6, new ResourceLocation("instant_health"), false, 16262179)).setPotionName("potion.heal"); + public static final Potion harm = (new PotionHealth(7, new ResourceLocation("instant_damage"), true, 4393481)).setPotionName("potion.harm"); + public static final Potion jump = (new Potion(8, new ResourceLocation("jump_boost"), false, 2293580)).setPotionName("potion.jump").setIconIndex(2, 1); + public static final Potion confusion = (new Potion(9, new ResourceLocation("nausea"), true, 5578058)).setPotionName("potion.confusion").setIconIndex(3, 1).setEffectiveness(0.25D); + public static final Potion regeneration = (new Potion(10, new ResourceLocation("regeneration"), false, 13458603)).setPotionName("potion.regeneration").setIconIndex(7, 0).setEffectiveness(0.25D); + public static final Potion resistance = (new Potion(11, new ResourceLocation("resistance"), false, 10044730)).setPotionName("potion.resistance").setIconIndex(6, 1); + public static final Potion fireResistance = (new Potion(12, new ResourceLocation("fire_resistance"), false, 14981690)).setPotionName("potion.fireResistance").setIconIndex(7, 1); + public static final Potion waterBreathing = (new Potion(13, new ResourceLocation("water_breathing"), false, 3035801)).setPotionName("potion.waterBreathing").setIconIndex(0, 2); + public static final Potion invisibility = (new Potion(14, new ResourceLocation("invisibility"), false, 8356754)).setPotionName("potion.invisibility").setIconIndex(0, 1); + public static final Potion blindness = (new Potion(15, new ResourceLocation("blindness"), true, 2039587)).setPotionName("potion.blindness").setIconIndex(5, 1).setEffectiveness(0.25D); + public static final Potion nightVision = (new Potion(16, new ResourceLocation("night_vision"), false, 2039713)).setPotionName("potion.nightVision").setIconIndex(4, 1); + public static final Potion hunger = (new Potion(17, new ResourceLocation("hunger"), true, 5797459)).setPotionName("potion.hunger").setIconIndex(1, 1); + public static final Potion weakness = (new PotionAttackDamage(18, new ResourceLocation("weakness"), true, 4738376)).setPotionName("potion.weakness").setIconIndex(5, 0).registerPotionAttributeModifier(SharedMonsterAttributes.attackDamage, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); + public static final Potion poison = (new Potion(19, new ResourceLocation("poison"), true, 5149489)).setPotionName("potion.poison").setIconIndex(6, 0).setEffectiveness(0.25D); + public static final Potion wither = (new Potion(20, new ResourceLocation("wither"), true, 3484199)).setPotionName("potion.wither").setIconIndex(1, 2).setEffectiveness(0.25D); + public static final Potion healthBoost = (new PotionHealthBoost(21, new ResourceLocation("health_boost"), false, 16284963)).setPotionName("potion.healthBoost").setIconIndex(2, 2).registerPotionAttributeModifier(SharedMonsterAttributes.maxHealth, "5D6F0BA2-1186-46AC-B896-C61C5CEE99CC", 4.0D, 0); + public static final Potion absorption = (new PotionAbsorption(22, new ResourceLocation("absorption"), false, 2445989)).setPotionName("potion.absorption").setIconIndex(2, 2); + public static final Potion saturation = (new PotionHealth(23, new ResourceLocation("saturation"), false, 16262179)).setPotionName("potion.saturation"); + public static final Potion field_180153_z = null; + public static final Potion field_180147_A = null; + public static final Potion field_180148_B = null; + public static final Potion field_180149_C = null; + public static final Potion field_180143_D = null; + public static final Potion field_180144_E = null; + public static final Potion field_180145_F = null; + public static final Potion field_180146_G = null; + public final int id; + private final Map attributeModifierMap = Maps.newHashMap(); + private final boolean isBadEffect; + private final int liquidColor; + private String name = ""; + private int statusIconIndex = -1; + private double effectiveness; + private boolean usable; + + protected Potion(int potionID, ResourceLocation location, boolean badEffect, int potionColor) + { + this.id = potionID; + potionTypes[potionID] = this; + field_180150_I.put(location, this); + this.isBadEffect = badEffect; + + if (badEffect) + { + this.effectiveness = 0.5D; + } + else + { + this.effectiveness = 1.0D; + } + + this.liquidColor = potionColor; + } + + public static Potion getPotionFromResourceLocation(String location) + { + return (Potion)field_180150_I.get(new ResourceLocation(location)); + } + + public static Set getPotionLocations() + { + return field_180150_I.keySet(); + } + + protected Potion setIconIndex(int p_76399_1_, int p_76399_2_) + { + this.statusIconIndex = p_76399_1_ + p_76399_2_ * 8; + return this; + } + + public int getId() + { + return this.id; + } + + public void performEffect(EntityLivingBase entityLivingBaseIn, int p_76394_2_) + { + if (this.id == regeneration.id) + { + if (entityLivingBaseIn.getHealth() < entityLivingBaseIn.getMaxHealth()) + { + entityLivingBaseIn.heal(1.0F); + } + } + else if (this.id == poison.id) + { + if (entityLivingBaseIn.getHealth() > 1.0F) + { + entityLivingBaseIn.attackEntityFrom(DamageSource.magic, 1.0F); + } + } + else if (this.id == wither.id) + { + entityLivingBaseIn.attackEntityFrom(DamageSource.wither, 1.0F); + } + else if (this.id == hunger.id && entityLivingBaseIn instanceof EntityPlayer) + { + ((EntityPlayer)entityLivingBaseIn).addExhaustion(0.025F * (float)(p_76394_2_ + 1)); + } + else if (this.id == saturation.id && entityLivingBaseIn instanceof EntityPlayer) + { + if (!entityLivingBaseIn.worldObj.isRemote) + { + ((EntityPlayer)entityLivingBaseIn).getFoodStats().addStats(p_76394_2_ + 1, 1.0F); + } + } + else if ((this.id != heal.id || entityLivingBaseIn.isEntityUndead()) && (this.id != harm.id || !entityLivingBaseIn.isEntityUndead())) + { + if (this.id == harm.id && !entityLivingBaseIn.isEntityUndead() || this.id == heal.id && entityLivingBaseIn.isEntityUndead()) + { + entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)(6 << p_76394_2_)); + } + } + else + { + entityLivingBaseIn.heal((float)Math.max(4 << p_76394_2_, 0)); + } + } + + public void affectEntity(Entity p_180793_1_, Entity p_180793_2_, EntityLivingBase entityLivingBaseIn, int p_180793_4_, double p_180793_5_) + { + if ((this.id != heal.id || entityLivingBaseIn.isEntityUndead()) && (this.id != harm.id || !entityLivingBaseIn.isEntityUndead())) + { + if (this.id == harm.id && !entityLivingBaseIn.isEntityUndead() || this.id == heal.id && entityLivingBaseIn.isEntityUndead()) + { + int j = (int)(p_180793_5_ * (double)(6 << p_180793_4_) + 0.5D); + + if (p_180793_1_ == null) + { + entityLivingBaseIn.attackEntityFrom(DamageSource.magic, (float)j); + } + else + { + entityLivingBaseIn.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p_180793_1_, p_180793_2_), (float)j); + } + } + } + else + { + int i = (int)(p_180793_5_ * (double)(4 << p_180793_4_) + 0.5D); + entityLivingBaseIn.heal((float)i); + } + } + + public boolean isInstant() + { + return false; + } + + public boolean isReady(int p_76397_1_, int p_76397_2_) + { + if (this.id == regeneration.id) + { + int k = 50 >> p_76397_2_; + return k > 0 ? p_76397_1_ % k == 0 : true; + } + else if (this.id == poison.id) + { + int j = 25 >> p_76397_2_; + return j > 0 ? p_76397_1_ % j == 0 : true; + } + else if (this.id == wither.id) + { + int i = 40 >> p_76397_2_; + return i > 0 ? p_76397_1_ % i == 0 : true; + } + else + { + return this.id == hunger.id; + } + } + + public Potion setPotionName(String nameIn) + { + this.name = nameIn; + return this; + } + + public String getName() + { + return this.name; + } + + public boolean hasStatusIcon() + { + return this.statusIconIndex >= 0; + } + + public int getStatusIconIndex() + { + return this.statusIconIndex; + } + + public boolean isBadEffect() + { + return this.isBadEffect; + } + + public static String getDurationString(PotionEffect effect) + { + if (effect.getIsPotionDurationMax()) + { + return "**:**"; + } + else + { + int i = effect.getDuration(); + return StringUtils.ticksToElapsedTime(i); + } + } + + protected Potion setEffectiveness(double effectivenessIn) + { + this.effectiveness = effectivenessIn; + return this; + } + + public double getEffectiveness() + { + return this.effectiveness; + } + + public boolean isUsable() + { + return this.usable; + } + + public int getLiquidColor() + { + return this.liquidColor; + } + + public Potion registerPotionAttributeModifier(IAttribute p_111184_1_, String p_111184_2_, double p_111184_3_, int p_111184_5_) + { + AttributeModifier attributemodifier = new AttributeModifier(UUID.fromString(p_111184_2_), this.getName(), p_111184_3_, p_111184_5_); + this.attributeModifierMap.put(p_111184_1_, attributemodifier); + return this; + } + + public Map getAttributeModifierMap() + { + return this.attributeModifierMap; + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111187_2_, int amplifier) + { + for (Entry entry : this.attributeModifierMap.entrySet()) + { + IAttributeInstance iattributeinstance = p_111187_2_.getAttributeInstance((IAttribute)entry.getKey()); + + if (iattributeinstance != null) + { + iattributeinstance.removeModifier((AttributeModifier)entry.getValue()); + } + } + } + + public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111185_2_, int amplifier) + { + for (Entry entry : this.attributeModifierMap.entrySet()) + { + IAttributeInstance iattributeinstance = p_111185_2_.getAttributeInstance((IAttribute)entry.getKey()); + + if (iattributeinstance != null) + { + AttributeModifier attributemodifier = (AttributeModifier)entry.getValue(); + iattributeinstance.removeModifier(attributemodifier); + iattributeinstance.applyModifier(new AttributeModifier(attributemodifier.getID(), this.getName() + " " + amplifier, this.getAttributeModifierAmount(amplifier, attributemodifier), attributemodifier.getOperation())); + } + } + } + + public double getAttributeModifierAmount(int p_111183_1_, AttributeModifier modifier) + { + return modifier.getAmount() * (double)(p_111183_1_ + 1); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/potion/PotionAbsorption.java b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionAbsorption.java new file mode 100644 index 0000000..56a1ca5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionAbsorption.java @@ -0,0 +1,25 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.util.ResourceLocation; + +public class PotionAbsorption extends Potion +{ + protected PotionAbsorption(int potionID, ResourceLocation location, boolean badEffect, int potionColor) + { + super(potionID, location, badEffect, potionColor); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111187_2_, int amplifier) + { + entityLivingBaseIn.setAbsorptionAmount(entityLivingBaseIn.getAbsorptionAmount() - (float)(4 * (amplifier + 1))); + super.removeAttributesModifiersFromEntity(entityLivingBaseIn, p_111187_2_, amplifier); + } + + public void applyAttributesModifiersToEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111185_2_, int amplifier) + { + entityLivingBaseIn.setAbsorptionAmount(entityLivingBaseIn.getAbsorptionAmount() + (float)(4 * (amplifier + 1))); + super.applyAttributesModifiersToEntity(entityLivingBaseIn, p_111185_2_, amplifier); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/potion/PotionAttackDamage.java b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionAttackDamage.java new file mode 100644 index 0000000..ac13196 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionAttackDamage.java @@ -0,0 +1,17 @@ +package net.minecraft.potion; + +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.util.ResourceLocation; + +public class PotionAttackDamage extends Potion +{ + protected PotionAttackDamage(int potionID, ResourceLocation location, boolean badEffect, int potionColor) + { + super(potionID, location, badEffect, potionColor); + } + + public double getAttributeModifierAmount(int p_111183_1_, AttributeModifier modifier) + { + return this.id == Potion.weakness.id ? (double)(-0.5F * (float)(p_111183_1_ + 1)) : 1.3D * (double)(p_111183_1_ + 1); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/potion/PotionEffect.java b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionEffect.java new file mode 100644 index 0000000..bc63ca8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionEffect.java @@ -0,0 +1,221 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PotionEffect +{ + private static final Logger LOGGER = LogManager.getLogger(); + private int potionID; + private int duration; + private int amplifier; + private boolean isSplashPotion; + private boolean isAmbient; + private boolean isPotionDurationMax; + private boolean showParticles; + + public PotionEffect(int id, int effectDuration) + { + this(id, effectDuration, 0); + } + + public PotionEffect(int id, int effectDuration, int effectAmplifier) + { + this(id, effectDuration, effectAmplifier, false, true); + } + + public PotionEffect(int id, int effectDuration, int effectAmplifier, boolean ambient, boolean showParticles) + { + this.potionID = id; + this.duration = effectDuration; + this.amplifier = effectAmplifier; + this.isAmbient = ambient; + this.showParticles = showParticles; + } + + public PotionEffect(PotionEffect other) + { + this.potionID = other.potionID; + this.duration = other.duration; + this.amplifier = other.amplifier; + this.isAmbient = other.isAmbient; + this.showParticles = other.showParticles; + } + + public void combine(PotionEffect other) + { + if (this.potionID != other.potionID) + { + LOGGER.warn("This method should only be called for matching effects!"); + } + + if (other.amplifier > this.amplifier) + { + this.amplifier = other.amplifier; + this.duration = other.duration; + } + else if (other.amplifier == this.amplifier && this.duration < other.duration) + { + this.duration = other.duration; + } + else if (!other.isAmbient && this.isAmbient) + { + this.isAmbient = other.isAmbient; + } + + this.showParticles = other.showParticles; + } + + public int getPotionID() + { + return this.potionID; + } + + public int getDuration() + { + return this.duration; + } + + public int getAmplifier() + { + return this.amplifier; + } + + public void setSplashPotion(boolean splashPotion) + { + this.isSplashPotion = splashPotion; + } + + public boolean getIsAmbient() + { + return this.isAmbient; + } + + public boolean getIsShowParticles() + { + return this.showParticles; + } + + public boolean onUpdate(EntityLivingBase entityIn) + { + if (this.duration > 0) + { + if (Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) + { + this.performEffect(entityIn); + } + + this.deincrementDuration(); + } + + return this.duration > 0; + } + + private int deincrementDuration() + { + return --this.duration; + } + + public void performEffect(EntityLivingBase entityIn) + { + if (this.duration > 0) + { + Potion.potionTypes[this.potionID].performEffect(entityIn, this.amplifier); + } + } + + public String getEffectName() + { + return Potion.potionTypes[this.potionID].getName(); + } + + public int hashCode() + { + return this.potionID; + } + + public String toString() + { + String s = ""; + + if (this.getAmplifier() > 0) + { + s = this.getEffectName() + " x " + (this.getAmplifier() + 1) + ", Duration: " + this.getDuration(); + } + else + { + s = this.getEffectName() + ", Duration: " + this.getDuration(); + } + + if (this.isSplashPotion) + { + s = s + ", Splash: true"; + } + + if (!this.showParticles) + { + s = s + ", Particles: false"; + } + + return Potion.potionTypes[this.potionID].isUsable() ? "(" + s + ")" : s; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof PotionEffect)) + { + return false; + } + else + { + PotionEffect potioneffect = (PotionEffect)p_equals_1_; + return this.potionID == potioneffect.potionID && this.amplifier == potioneffect.amplifier && this.duration == potioneffect.duration && this.isSplashPotion == potioneffect.isSplashPotion && this.isAmbient == potioneffect.isAmbient; + } + } + + public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound nbt) + { + nbt.setByte("Id", (byte)this.getPotionID()); + nbt.setByte("Amplifier", (byte)this.getAmplifier()); + nbt.setInteger("Duration", this.getDuration()); + nbt.setBoolean("Ambient", this.getIsAmbient()); + nbt.setBoolean("ShowParticles", this.getIsShowParticles()); + return nbt; + } + + public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt) + { + int i = nbt.getByte("Id"); + + if (i >= 0 && i < Potion.potionTypes.length && Potion.potionTypes[i] != null) + { + int j = nbt.getByte("Amplifier"); + int k = nbt.getInteger("Duration"); + boolean flag = nbt.getBoolean("Ambient"); + boolean flag1 = true; + + if (nbt.hasKey("ShowParticles", 1)) + { + flag1 = nbt.getBoolean("ShowParticles"); + } + + return new PotionEffect(i, k, j, flag, flag1); + } + else + { + return null; + } + } + + public void setPotionDurationMax(boolean maxDuration) + { + this.isPotionDurationMax = maxDuration; + } + + public boolean getIsPotionDurationMax() + { + return this.isPotionDurationMax; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHealth.java b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHealth.java new file mode 100644 index 0000000..e638ca9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHealth.java @@ -0,0 +1,21 @@ +package net.minecraft.potion; + +import net.minecraft.util.ResourceLocation; + +public class PotionHealth extends Potion +{ + public PotionHealth(int potionID, ResourceLocation location, boolean badEffect, int potionColor) + { + super(potionID, location, badEffect, potionColor); + } + + public boolean isInstant() + { + return true; + } + + public boolean isReady(int p_76397_1_, int p_76397_2_) + { + return p_76397_1_ >= 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHealthBoost.java b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHealthBoost.java new file mode 100644 index 0000000..f0a16ba --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHealthBoost.java @@ -0,0 +1,23 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.util.ResourceLocation; + +public class PotionHealthBoost extends Potion +{ + public PotionHealthBoost(int potionID, ResourceLocation location, boolean badEffect, int potionColor) + { + super(potionID, location, badEffect, potionColor); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase entityLivingBaseIn, BaseAttributeMap p_111187_2_, int amplifier) + { + super.removeAttributesModifiersFromEntity(entityLivingBaseIn, p_111187_2_, amplifier); + + if (entityLivingBaseIn.getHealth() > entityLivingBaseIn.getMaxHealth()) + { + entityLivingBaseIn.setHealth(entityLivingBaseIn.getMaxHealth()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHelper.java b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHelper.java new file mode 100644 index 0000000..1cef222 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/potion/PotionHelper.java @@ -0,0 +1,576 @@ +package net.minecraft.potion; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import net.minecraft.src.Config; +import net.minecraft.util.IntegerCache; +import net.optifine.CustomColors; + +public class PotionHelper +{ + public static final String unusedString = null; + public static final String sugarEffect = "-0+1-2-3&4-4+13"; + public static final String ghastTearEffect = "+0-1-2-3&4-4+13"; + public static final String spiderEyeEffect = "-0-1+2-3&4-4+13"; + public static final String fermentedSpiderEyeEffect = "-0+3-4+13"; + public static final String speckledMelonEffect = "+0-1+2-3&4-4+13"; + public static final String blazePowderEffect = "+0-1-2+3&4-4+13"; + public static final String magmaCreamEffect = "+0+1-2-3&4-4+13"; + public static final String redstoneEffect = "-5+6-7"; + public static final String glowstoneEffect = "+5-6-7"; + public static final String gunpowderEffect = "+14&13-13"; + public static final String goldenCarrotEffect = "-0+1+2-3+13&4-4"; + public static final String pufferfishEffect = "+0-1+2+3+13&4-4"; + public static final String rabbitFootEffect = "+0+1-2+3&4-4+13"; + private static final Map potionRequirements = Maps.newHashMap(); + private static final Map potionAmplifiers = Maps.newHashMap(); + private static final Map DATAVALUE_COLORS = Maps.newHashMap(); + private static final String[] potionPrefixes = new String[] {"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"}; + + public static boolean checkFlag(int p_77914_0_, int p_77914_1_) + { + return (p_77914_0_ & 1 << p_77914_1_) != 0; + } + + private static int isFlagSet(int p_77910_0_, int p_77910_1_) + { + return checkFlag(p_77910_0_, p_77910_1_) ? 1 : 0; + } + + private static int isFlagUnset(int p_77916_0_, int p_77916_1_) + { + return checkFlag(p_77916_0_, p_77916_1_) ? 0 : 1; + } + + public static int getPotionPrefixIndex(int dataValue) + { + return getPotionPrefixIndexFlags(dataValue, 5, 4, 3, 2, 1); + } + + public static int calcPotionLiquidColor(Collection p_77911_0_) + { + int i = 3694022; + + if (p_77911_0_ != null && !p_77911_0_.isEmpty()) + { + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + float f3 = 0.0F; + + for (PotionEffect potioneffect : p_77911_0_) + { + if (potioneffect.getIsShowParticles()) + { + int j = Potion.potionTypes[potioneffect.getPotionID()].getLiquidColor(); + + if (Config.isCustomColors()) + { + j = CustomColors.getPotionColor(potioneffect.getPotionID(), j); + } + + for (int k = 0; k <= potioneffect.getAmplifier(); ++k) + { + f += (float)(j >> 16 & 255) / 255.0F; + f1 += (float)(j >> 8 & 255) / 255.0F; + f2 += (float)(j >> 0 & 255) / 255.0F; + ++f3; + } + } + } + + if (f3 == 0.0F) + { + return 0; + } + else + { + f = f / f3 * 255.0F; + f1 = f1 / f3 * 255.0F; + f2 = f2 / f3 * 255.0F; + return (int)f << 16 | (int)f1 << 8 | (int)f2; + } + } + else + { + return Config.isCustomColors() ? CustomColors.getPotionColor(0, i) : i; + } + } + + public static boolean getAreAmbient(Collection potionEffects) + { + for (PotionEffect potioneffect : potionEffects) + { + if (!potioneffect.getIsAmbient()) + { + return false; + } + } + + return true; + } + + public static int getLiquidColor(int dataValue, boolean bypassCache) + { + Integer integer = IntegerCache.getInteger(dataValue); + + if (!bypassCache) + { + if (DATAVALUE_COLORS.containsKey(integer)) + { + return ((Integer)DATAVALUE_COLORS.get(integer)).intValue(); + } + else + { + int i = calcPotionLiquidColor(getPotionEffects(integer.intValue(), false)); + DATAVALUE_COLORS.put(integer, Integer.valueOf(i)); + return i; + } + } + else + { + return calcPotionLiquidColor(getPotionEffects(integer.intValue(), true)); + } + } + + public static String getPotionPrefix(int dataValue) + { + int i = getPotionPrefixIndex(dataValue); + return potionPrefixes[i]; + } + + private static int getPotionEffect(boolean p_77904_0_, boolean p_77904_1_, boolean p_77904_2_, int p_77904_3_, int p_77904_4_, int p_77904_5_, int p_77904_6_) + { + int i = 0; + + if (p_77904_0_) + { + i = isFlagUnset(p_77904_6_, p_77904_4_); + } + else if (p_77904_3_ != -1) + { + if (p_77904_3_ == 0 && countSetFlags(p_77904_6_) == p_77904_4_) + { + i = 1; + } + else if (p_77904_3_ == 1 && countSetFlags(p_77904_6_) > p_77904_4_) + { + i = 1; + } + else if (p_77904_3_ == 2 && countSetFlags(p_77904_6_) < p_77904_4_) + { + i = 1; + } + } + else + { + i = isFlagSet(p_77904_6_, p_77904_4_); + } + + if (p_77904_1_) + { + i *= p_77904_5_; + } + + if (p_77904_2_) + { + i *= -1; + } + + return i; + } + + private static int countSetFlags(int p_77907_0_) + { + int i; + + for (i = 0; p_77907_0_ > 0; ++i) + { + p_77907_0_ &= p_77907_0_ - 1; + } + + return i; + } + + private static int parsePotionEffects(String p_77912_0_, int p_77912_1_, int p_77912_2_, int p_77912_3_) + { + if (p_77912_1_ < p_77912_0_.length() && p_77912_2_ >= 0 && p_77912_1_ < p_77912_2_) + { + int i = p_77912_0_.indexOf(124, p_77912_1_); + + if (i >= 0 && i < p_77912_2_) + { + int l1 = parsePotionEffects(p_77912_0_, p_77912_1_, i - 1, p_77912_3_); + + if (l1 > 0) + { + return l1; + } + else + { + int j2 = parsePotionEffects(p_77912_0_, i + 1, p_77912_2_, p_77912_3_); + return j2 > 0 ? j2 : 0; + } + } + else + { + int j = p_77912_0_.indexOf(38, p_77912_1_); + + if (j >= 0 && j < p_77912_2_) + { + int i2 = parsePotionEffects(p_77912_0_, p_77912_1_, j - 1, p_77912_3_); + + if (i2 <= 0) + { + return 0; + } + else + { + int k2 = parsePotionEffects(p_77912_0_, j + 1, p_77912_2_, p_77912_3_); + return k2 <= 0 ? 0 : (i2 > k2 ? i2 : k2); + } + } + else + { + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + boolean flag4 = false; + int k = -1; + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = p_77912_1_; k1 < p_77912_2_; ++k1) + { + char c0 = p_77912_0_.charAt(k1); + + if (c0 >= 48 && c0 <= 57) + { + if (flag) + { + i1 = c0 - 48; + flag1 = true; + } + else + { + l = l * 10; + l = l + (c0 - 48); + flag2 = true; + } + } + else if (c0 == 42) + { + flag = true; + } + else if (c0 == 33) + { + if (flag2) + { + j1 += getPotionEffect(flag3, flag1, flag4, k, l, i1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + i1 = 0; + l = 0; + k = -1; + } + + flag3 = true; + } + else if (c0 == 45) + { + if (flag2) + { + j1 += getPotionEffect(flag3, flag1, flag4, k, l, i1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + i1 = 0; + l = 0; + k = -1; + } + + flag4 = true; + } + else if (c0 != 61 && c0 != 60 && c0 != 62) + { + if (c0 == 43 && flag2) + { + j1 += getPotionEffect(flag3, flag1, flag4, k, l, i1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + i1 = 0; + l = 0; + k = -1; + } + } + else + { + if (flag2) + { + j1 += getPotionEffect(flag3, flag1, flag4, k, l, i1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + i1 = 0; + l = 0; + k = -1; + } + + if (c0 == 61) + { + k = 0; + } + else if (c0 == 60) + { + k = 2; + } + else if (c0 == 62) + { + k = 1; + } + } + } + + if (flag2) + { + j1 += getPotionEffect(flag3, flag1, flag4, k, l, i1, p_77912_3_); + } + + return j1; + } + } + } + else + { + return 0; + } + } + + public static List getPotionEffects(int p_77917_0_, boolean p_77917_1_) + { + List list = null; + + for (Potion potion : Potion.potionTypes) + { + if (potion != null && (!potion.isUsable() || p_77917_1_)) + { + String s = (String)potionRequirements.get(Integer.valueOf(potion.getId())); + + if (s != null) + { + int i = parsePotionEffects(s, 0, s.length(), p_77917_0_); + + if (i > 0) + { + int j = 0; + String s1 = (String)potionAmplifiers.get(Integer.valueOf(potion.getId())); + + if (s1 != null) + { + j = parsePotionEffects(s1, 0, s1.length(), p_77917_0_); + + if (j < 0) + { + j = 0; + } + } + + if (potion.isInstant()) + { + i = 1; + } + else + { + i = 1200 * (i * 3 + (i - 1) * 2); + i = i >> j; + i = (int)Math.round((double)i * potion.getEffectiveness()); + + if ((p_77917_0_ & 16384) != 0) + { + i = (int)Math.round((double)i * 0.75D + 0.5D); + } + } + + if (list == null) + { + list = Lists.newArrayList(); + } + + PotionEffect potioneffect = new PotionEffect(potion.getId(), i, j); + + if ((p_77917_0_ & 16384) != 0) + { + potioneffect.setSplashPotion(true); + } + + list.add(potioneffect); + } + } + } + } + + return list; + } + + private static int brewBitOperations(int p_77906_0_, int p_77906_1_, boolean p_77906_2_, boolean p_77906_3_, boolean p_77906_4_) + { + if (p_77906_4_) + { + if (!checkFlag(p_77906_0_, p_77906_1_)) + { + return 0; + } + } + else if (p_77906_2_) + { + p_77906_0_ &= ~(1 << p_77906_1_); + } + else if (p_77906_3_) + { + if ((p_77906_0_ & 1 << p_77906_1_) == 0) + { + p_77906_0_ |= 1 << p_77906_1_; + } + else + { + p_77906_0_ &= ~(1 << p_77906_1_); + } + } + else + { + p_77906_0_ |= 1 << p_77906_1_; + } + + return p_77906_0_; + } + + public static int applyIngredient(int p_77913_0_, String p_77913_1_) + { + int i = 0; + int j = p_77913_1_.length(); + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + int k = 0; + + for (int l = i; l < j; ++l) + { + char c0 = p_77913_1_.charAt(l); + + if (c0 >= 48 && c0 <= 57) + { + k = k * 10; + k = k + (c0 - 48); + flag = true; + } + else if (c0 == 33) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + + flag1 = true; + } + else if (c0 == 45) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + + flag2 = true; + } + else if (c0 == 43) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + } + else if (c0 == 38) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + + flag3 = true; + } + } + + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + } + + return p_77913_0_ & 32767; + } + + public static int getPotionPrefixIndexFlags(int p_77908_0_, int p_77908_1_, int p_77908_2_, int p_77908_3_, int p_77908_4_, int p_77908_5_) + { + return (checkFlag(p_77908_0_, p_77908_1_) ? 16 : 0) | (checkFlag(p_77908_0_, p_77908_2_) ? 8 : 0) | (checkFlag(p_77908_0_, p_77908_3_) ? 4 : 0) | (checkFlag(p_77908_0_, p_77908_4_) ? 2 : 0) | (checkFlag(p_77908_0_, p_77908_5_) ? 1 : 0); + } + + static + { + potionRequirements.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); + potionRequirements.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); + potionRequirements.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); + potionRequirements.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); + potionRequirements.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); + potionRequirements.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.waterBreathing.getId()), "0 & !1 & 2 & 3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.jump.getId()), "0 & 1 & !2 & 3 & 3+6"); + potionAmplifiers.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.regeneration.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.harm.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.heal.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.resistance.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.poison.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.jump.getId()), "5"); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/profiler/IPlayerUsage.java b/Client-1.8.9/src/main/java/net/minecraft/profiler/IPlayerUsage.java new file mode 100644 index 0000000..85781d8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/profiler/IPlayerUsage.java @@ -0,0 +1,10 @@ +package net.minecraft.profiler; + +public interface IPlayerUsage +{ + void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper); + + void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper); + + boolean isSnooperEnabled(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/profiler/PlayerUsageSnooper.java b/Client-1.8.9/src/main/java/net/minecraft/profiler/PlayerUsageSnooper.java new file mode 100644 index 0000000..88476a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/profiler/PlayerUsageSnooper.java @@ -0,0 +1,174 @@ +package net.minecraft.profiler; + +import com.google.common.collect.Maps; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.util.HttpUtil; + +public class PlayerUsageSnooper +{ + private final Map snooperStats = Maps.newHashMap(); + private final Map clientStats = Maps.newHashMap(); + private final String uniqueID = UUID.randomUUID().toString(); + private final URL serverUrl; + private final IPlayerUsage playerStatsCollector; + private final Timer threadTrigger = new Timer("Snooper Timer", true); + private final Object syncLock = new Object(); + private final long minecraftStartTimeMilis; + private boolean isRunning; + private int selfCounter; + + public PlayerUsageSnooper(String side, IPlayerUsage playerStatCollector, long startTime) + { + try + { + this.serverUrl = new URL("http://snoop.minecraft.net/" + side + "?version=" + 2); + } + catch (MalformedURLException var6) + { + throw new IllegalArgumentException(); + } + + this.playerStatsCollector = playerStatCollector; + this.minecraftStartTimeMilis = startTime; + } + + public void startSnooper() + { + if (!this.isRunning) + { + this.isRunning = true; + this.addOSData(); + this.threadTrigger.schedule(new TimerTask() + { + public void run() + { + if (PlayerUsageSnooper.this.playerStatsCollector.isSnooperEnabled()) + { + Map map; + + synchronized (PlayerUsageSnooper.this.syncLock) + { + map = Maps.newHashMap(PlayerUsageSnooper.this.clientStats); + + if (PlayerUsageSnooper.this.selfCounter == 0) + { + map.putAll(PlayerUsageSnooper.this.snooperStats); + } + + map.put("snooper_count", Integer.valueOf(PlayerUsageSnooper.this.selfCounter++)); + map.put("snooper_token", PlayerUsageSnooper.this.uniqueID); + } + + HttpUtil.postMap(PlayerUsageSnooper.this.serverUrl, map, true); + } + } + }, 0L, 900000L); + } + } + + private void addOSData() + { + this.addJvmArgsToSnooper(); + this.addClientStat("snooper_token", this.uniqueID); + this.addStatToSnooper("snooper_token", this.uniqueID); + this.addStatToSnooper("os_name", System.getProperty("os.name")); + this.addStatToSnooper("os_version", System.getProperty("os.version")); + this.addStatToSnooper("os_architecture", System.getProperty("os.arch")); + this.addStatToSnooper("java_version", System.getProperty("java.version")); + this.addClientStat("version", "1.8.9"); + this.playerStatsCollector.addServerTypeToSnooper(this); + } + + private void addJvmArgsToSnooper() + { + RuntimeMXBean runtimemxbean = ManagementFactory.getRuntimeMXBean(); + List list = runtimemxbean.getInputArguments(); + int i = 0; + + for (String s : list) + { + if (s.startsWith("-X")) + { + this.addClientStat("jvm_arg[" + i++ + "]", s); + } + } + + this.addClientStat("jvm_args", Integer.valueOf(i)); + } + + public void addMemoryStatsToSnooper() + { + this.addStatToSnooper("memory_total", Long.valueOf(Runtime.getRuntime().totalMemory())); + this.addStatToSnooper("memory_max", Long.valueOf(Runtime.getRuntime().maxMemory())); + this.addStatToSnooper("memory_free", Long.valueOf(Runtime.getRuntime().freeMemory())); + this.addStatToSnooper("cpu_cores", Integer.valueOf(Runtime.getRuntime().availableProcessors())); + this.playerStatsCollector.addServerStatsToSnooper(this); + } + + public void addClientStat(String statName, Object statValue) + { + synchronized (this.syncLock) + { + this.clientStats.put(statName, statValue); + } + } + + public void addStatToSnooper(String statName, Object statValue) + { + synchronized (this.syncLock) + { + this.snooperStats.put(statName, statValue); + } + } + + public Map getCurrentStats() + { + Map map = Maps.newLinkedHashMap(); + + synchronized (this.syncLock) + { + this.addMemoryStatsToSnooper(); + + for (Entry entry : this.snooperStats.entrySet()) + { + map.put(entry.getKey(), entry.getValue().toString()); + } + + for (Entry entry1 : this.clientStats.entrySet()) + { + map.put(entry1.getKey(), entry1.getValue().toString()); + } + + return map; + } + } + + public boolean isSnooperRunning() + { + return this.isRunning; + } + + public void stopSnooper() + { + this.threadTrigger.cancel(); + } + + public String getUniqueID() + { + return this.uniqueID; + } + + public long getMinecraftStartTimeMillis() + { + return this.minecraftStartTimeMilis; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/profiler/Profiler.java b/Client-1.8.9/src/main/java/net/minecraft/profiler/Profiler.java new file mode 100644 index 0000000..91d2dac --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/profiler/Profiler.java @@ -0,0 +1,241 @@ +package net.minecraft.profiler; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.src.Config; +import net.optifine.Lagometer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Profiler +{ + private static final Logger logger = LogManager.getLogger(); + private final List sectionList = Lists.newArrayList(); + private final List timestampList = Lists.newArrayList(); + public boolean profilingEnabled; + private String profilingSection = ""; + private final Map profilingMap = Maps.newHashMap(); + public boolean profilerGlobalEnabled = true; + private boolean profilerLocalEnabled; + private static final String SCHEDULED_EXECUTABLES = "scheduledExecutables"; + private static final String TICK = "tick"; + private static final String PRE_RENDER_ERRORS = "preRenderErrors"; + private static final String RENDER = "render"; + private static final String DISPLAY = "display"; + private static final int HASH_SCHEDULED_EXECUTABLES = "scheduledExecutables".hashCode(); + private static final int HASH_TICK = "tick".hashCode(); + private static final int HASH_PRE_RENDER_ERRORS = "preRenderErrors".hashCode(); + private static final int HASH_RENDER = "render".hashCode(); + private static final int HASH_DISPLAY = "display".hashCode(); + + public Profiler() + { + this.profilerLocalEnabled = this.profilerGlobalEnabled; + } + + public void clearProfiling() + { + this.profilingMap.clear(); + this.profilingSection = ""; + this.sectionList.clear(); + this.profilerLocalEnabled = this.profilerGlobalEnabled; + } + + public void startSection(String name) + { + if (Lagometer.isActive()) + { + int i = name.hashCode(); + + if (i == HASH_SCHEDULED_EXECUTABLES && name.equals("scheduledExecutables")) + { + Lagometer.timerScheduledExecutables.start(); + } + else if (i == HASH_TICK && name.equals("tick") && Config.isMinecraftThread()) + { + Lagometer.timerScheduledExecutables.end(); + Lagometer.timerTick.start(); + } + else if (i == HASH_PRE_RENDER_ERRORS && name.equals("preRenderErrors")) + { + Lagometer.timerTick.end(); + } + } + + if (Config.isFastRender()) + { + int j = name.hashCode(); + + if (j == HASH_RENDER && name.equals("render")) + { + GlStateManager.clearEnabled = false; + } + else if (j == HASH_DISPLAY && name.equals("display")) + { + GlStateManager.clearEnabled = true; + } + } + + if (this.profilerLocalEnabled) + { + if (this.profilingEnabled) + { + if (this.profilingSection.length() > 0) + { + this.profilingSection = this.profilingSection + "."; + } + + this.profilingSection = this.profilingSection + name; + this.sectionList.add(this.profilingSection); + this.timestampList.add(Long.valueOf(System.nanoTime())); + } + } + } + + public void endSection() + { + if (this.profilerLocalEnabled) + { + if (this.profilingEnabled) + { + long i = System.nanoTime(); + long j = ((Long)this.timestampList.remove(this.timestampList.size() - 1)).longValue(); + this.sectionList.remove(this.sectionList.size() - 1); + long k = i - j; + + if (this.profilingMap.containsKey(this.profilingSection)) + { + this.profilingMap.put(this.profilingSection, Long.valueOf(((Long)this.profilingMap.get(this.profilingSection)).longValue() + k)); + } + else + { + this.profilingMap.put(this.profilingSection, Long.valueOf(k)); + } + + if (k > 100000000L) + { + logger.warn("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox " + (double)k / 1000000.0D + " ms"); + } + + this.profilingSection = !this.sectionList.isEmpty() ? (String)this.sectionList.get(this.sectionList.size() - 1) : ""; + } + } + } + + public List getProfilingData(String profilerName) + { + if (!this.profilingEnabled) + { + return null; + } + else + { + long i = this.profilingMap.containsKey("root") ? ((Long)this.profilingMap.get("root")).longValue() : 0L; + long j = this.profilingMap.containsKey(profilerName) ? ((Long)this.profilingMap.get(profilerName)).longValue() : -1L; + List list = Lists.newArrayList(); + + if (profilerName.length() > 0) + { + profilerName = profilerName + "."; + } + + long k = 0L; + + for (String s : this.profilingMap.keySet()) + { + if (s.length() > profilerName.length() && s.startsWith(profilerName) && s.indexOf(".", profilerName.length() + 1) < 0) + { + k += ((Long)this.profilingMap.get(s)).longValue(); + } + } + + float f = (float)k; + + if (k < j) + { + k = j; + } + + if (i < k) + { + i = k; + } + + for (String s1 : this.profilingMap.keySet()) + { + if (s1.length() > profilerName.length() && s1.startsWith(profilerName) && s1.indexOf(".", profilerName.length() + 1) < 0) + { + long l = ((Long)this.profilingMap.get(s1)).longValue(); + double d0 = (double)l * 100.0D / (double)k; + double d1 = (double)l * 100.0D / (double)i; + String s2 = s1.substring(profilerName.length()); + list.add(new Profiler.Result(s2, d0, d1)); + } + } + + for (String s3 : this.profilingMap.keySet()) + { + this.profilingMap.put(s3, Long.valueOf(((Long)this.profilingMap.get(s3)).longValue() * 950L / 1000L)); + } + + if ((float)k > f) + { + list.add(new Profiler.Result("unspecified", (double)((float)k - f) * 100.0D / (double)k, (double)((float)k - f) * 100.0D / (double)i)); + } + + Collections.sort(list); + list.add(0, new Profiler.Result(profilerName, 100.0D, (double)k * 100.0D / (double)i)); + return list; + } + } + + public void endStartSection(String name) + { + if (this.profilerLocalEnabled) + { + this.endSection(); + this.startSection(name); + } + } + + public String getNameOfLastSection() + { + return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String)this.sectionList.get(this.sectionList.size() - 1); + } + + public void startSection(Class p_startSection_1_) + { + if (this.profilingEnabled) + { + this.startSection(p_startSection_1_.getSimpleName()); + } + } + + public static final class Result implements Comparable + { + public double field_76332_a; + public double field_76330_b; + public String field_76331_c; + + public Result(String profilerName, double usePercentage, double totalUsePercentage) + { + this.field_76331_c = profilerName; + this.field_76332_a = usePercentage; + this.field_76330_b = totalUsePercentage; + } + + public int compareTo(Profiler.Result p_compareTo_1_) + { + return p_compareTo_1_.field_76332_a < this.field_76332_a ? -1 : (p_compareTo_1_.field_76332_a > this.field_76332_a ? 1 : p_compareTo_1_.field_76331_c.compareTo(this.field_76331_c)); + } + + public int getColor() + { + return (this.field_76331_c.hashCode() & 11184810) + 4473924; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/DisconnectedRealmsScreen.java b/Client-1.8.9/src/main/java/net/minecraft/realms/DisconnectedRealmsScreen.java new file mode 100644 index 0000000..4bd1e46 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/DisconnectedRealmsScreen.java @@ -0,0 +1,63 @@ +package net.minecraft.realms; + +import java.util.List; +import net.minecraft.util.IChatComponent; + +public class DisconnectedRealmsScreen extends RealmsScreen +{ + private String title; + private IChatComponent reason; + private List lines; + private final RealmsScreen parent; + private int textHeight; + + public DisconnectedRealmsScreen(RealmsScreen parentIn, String unlocalizedTitle, IChatComponent reasonIn) + { + this.parent = parentIn; + this.title = getLocalizedString(unlocalizedTitle); + this.reason = reasonIn; + } + + public void init() + { + Realms.setConnectedToRealms(false); + this.buttonsClear(); + this.lines = this.fontSplit(this.reason.getFormattedText(), this.width() - 50); + this.textHeight = this.lines.size() * this.fontLineHeight(); + this.buttonsAdd(newButton(0, this.width() / 2 - 100, this.height() / 2 + this.textHeight / 2 + this.fontLineHeight(), getLocalizedString("gui.back"))); + } + + public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) + { + if (p_keyPressed_2_ == 1) + { + Realms.setScreen(this.parent); + } + } + + public void buttonClicked(RealmsButton p_buttonClicked_1_) + { + if (p_buttonClicked_1_.id() == 0) + { + Realms.setScreen(this.parent); + } + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + this.renderBackground(); + this.drawCenteredString(this.title, this.width() / 2, this.height() / 2 - this.textHeight / 2 - this.fontLineHeight() * 2, 11184810); + int i = this.height() / 2 - this.textHeight / 2; + + if (this.lines != null) + { + for (String s : this.lines) + { + this.drawCenteredString(s, this.width() / 2, i, 16777215); + i += this.fontLineHeight(); + } + } + + super.render(p_render_1_, p_render_2_, p_render_3_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/Realms.java b/Client-1.8.9/src/main/java/net/minecraft/realms/Realms.java new file mode 100644 index 0000000..3cba0d7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/Realms.java @@ -0,0 +1,117 @@ +package net.minecraft.realms; + +import com.google.common.util.concurrent.ListenableFuture; +import com.mojang.authlib.GameProfile; +import com.mojang.util.UUIDTypeAdapter; +import java.net.Proxy; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.Session; +import net.minecraft.world.WorldSettings; + +public class Realms +{ + public static boolean isTouchScreen() + { + return Minecraft.getMinecraft().gameSettings.touchscreen; + } + + public static Proxy getProxy() + { + return Minecraft.getMinecraft().getProxy(); + } + + public static String sessionId() + { + Session session = Minecraft.getMinecraft().getSession(); + return session == null ? null : session.getSessionID(); + } + + public static String userName() + { + Session session = Minecraft.getMinecraft().getSession(); + return session == null ? null : session.getUsername(); + } + + public static long currentTimeMillis() + { + return Minecraft.getSystemTime(); + } + + public static String getSessionId() + { + return Minecraft.getMinecraft().getSession().getSessionID(); + } + + public static String getUUID() + { + return Minecraft.getMinecraft().getSession().getPlayerID(); + } + + public static String getName() + { + return Minecraft.getMinecraft().getSession().getUsername(); + } + + public static String uuidToName(String p_uuidToName_0_) + { + return Minecraft.getMinecraft().getSessionService().fillProfileProperties(new GameProfile(UUIDTypeAdapter.fromString(p_uuidToName_0_), (String)null), false).getName(); + } + + public static void setScreen(RealmsScreen p_setScreen_0_) + { + Minecraft.getMinecraft().displayGuiScreen(p_setScreen_0_.getProxy()); + } + + public static String getGameDirectoryPath() + { + return Minecraft.getMinecraft().mcDataDir.getAbsolutePath(); + } + + public static int survivalId() + { + return WorldSettings.GameType.SURVIVAL.getID(); + } + + public static int creativeId() + { + return WorldSettings.GameType.CREATIVE.getID(); + } + + public static int adventureId() + { + return WorldSettings.GameType.ADVENTURE.getID(); + } + + public static int spectatorId() + { + return WorldSettings.GameType.SPECTATOR.getID(); + } + + public static void setConnectedToRealms(boolean p_setConnectedToRealms_0_) + { + Minecraft.getMinecraft().setConnectedToRealms(p_setConnectedToRealms_0_); + } + + public static ListenableFuture downloadResourcePack(String p_downloadResourcePack_0_, String p_downloadResourcePack_1_) + { + ListenableFuture listenablefuture = Minecraft.getMinecraft().getResourcePackRepository().downloadResourcePack(p_downloadResourcePack_0_, p_downloadResourcePack_1_); + return listenablefuture; + } + + public static void clearResourcePack() + { + Minecraft.getMinecraft().getResourcePackRepository().clearResourcePack(); + } + + public static boolean getRealmsNotificationsEnabled() + { + return Minecraft.getMinecraft().gameSettings.getOptionOrdinalValue(GameSettings.Options.REALMS_NOTIFICATIONS); + } + + public static boolean inTitleScreen() + { + return Minecraft.getMinecraft().currentScreen != null && Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java new file mode 100644 index 0000000..f7f2f38 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java @@ -0,0 +1,75 @@ +package net.minecraft.realms; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.SaveFormatComparator; + +public class RealmsAnvilLevelStorageSource +{ + private ISaveFormat levelStorageSource; + + public RealmsAnvilLevelStorageSource(ISaveFormat levelStorageSourceIn) + { + this.levelStorageSource = levelStorageSourceIn; + } + + public String getName() + { + return this.levelStorageSource.getName(); + } + + public boolean levelExists(String p_levelExists_1_) + { + return this.levelStorageSource.canLoadWorld(p_levelExists_1_); + } + + public boolean convertLevel(String p_convertLevel_1_, IProgressUpdate p_convertLevel_2_) + { + return this.levelStorageSource.convertMapFormat(p_convertLevel_1_, p_convertLevel_2_); + } + + public boolean requiresConversion(String p_requiresConversion_1_) + { + return this.levelStorageSource.isOldMapFormat(p_requiresConversion_1_); + } + + public boolean isNewLevelIdAcceptable(String p_isNewLevelIdAcceptable_1_) + { + return this.levelStorageSource.isNewLevelIdAcceptable(p_isNewLevelIdAcceptable_1_); + } + + public boolean deleteLevel(String p_deleteLevel_1_) + { + return this.levelStorageSource.deleteWorldDirectory(p_deleteLevel_1_); + } + + public boolean isConvertible(String p_isConvertible_1_) + { + return this.levelStorageSource.isConvertible(p_isConvertible_1_); + } + + public void renameLevel(String p_renameLevel_1_, String p_renameLevel_2_) + { + this.levelStorageSource.renameWorld(p_renameLevel_1_, p_renameLevel_2_); + } + + public void clearAll() + { + this.levelStorageSource.flushCache(); + } + + public List getLevelList() throws AnvilConverterException + { + List list = Lists.newArrayList(); + + for (SaveFormatComparator saveformatcomparator : this.levelStorageSource.getSaveList()) + { + list.add(new RealmsLevelSummary(saveformatcomparator)); + } + + return list; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsBridge.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsBridge.java new file mode 100644 index 0000000..75fb9f5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsBridge.java @@ -0,0 +1,55 @@ +package net.minecraft.realms; + +import java.lang.reflect.Constructor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiScreenRealmsProxy; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RealmsBridge extends RealmsScreen +{ + private static final Logger LOGGER = LogManager.getLogger(); + private GuiScreen previousScreen; + + public void switchToRealms(GuiScreen p_switchToRealms_1_) + { + this.previousScreen = p_switchToRealms_1_; + + try + { + Class oclass = Class.forName("com.mojang.realmsclient.RealmsMainScreen"); + Constructor constructor = oclass.getDeclaredConstructor(new Class[] {RealmsScreen.class}); + constructor.setAccessible(true); + Object object = constructor.newInstance(new Object[] {this}); + Minecraft.getMinecraft().displayGuiScreen(((RealmsScreen)object).getProxy()); + } + catch (Exception exception) + { + LOGGER.error((String)"Realms module missing", (Throwable)exception); + } + } + + public GuiScreenRealmsProxy getNotificationScreen(GuiScreen p_getNotificationScreen_1_) + { + try + { + this.previousScreen = p_getNotificationScreen_1_; + Class oclass = Class.forName("com.mojang.realmsclient.gui.screens.RealmsNotificationsScreen"); + Constructor constructor = oclass.getDeclaredConstructor(new Class[] {RealmsScreen.class}); + constructor.setAccessible(true); + Object object = constructor.newInstance(new Object[] {this}); + return ((RealmsScreen)object).getProxy(); + } + catch (Exception exception) + { + LOGGER.error((String)"Realms module missing", (Throwable)exception); + return null; + } + } + + public void init() + { + Minecraft.getMinecraft().displayGuiScreen(this.previousScreen); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsBufferBuilder.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsBufferBuilder.java new file mode 100644 index 0000000..b748b6d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsBufferBuilder.java @@ -0,0 +1,151 @@ +package net.minecraft.realms; + +import java.nio.ByteBuffer; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.VertexFormat; + +public class RealmsBufferBuilder +{ + private WorldRenderer b; + + public RealmsBufferBuilder(WorldRenderer p_i46442_1_) + { + this.b = p_i46442_1_; + } + + public RealmsBufferBuilder from(WorldRenderer p_from_1_) + { + this.b = p_from_1_; + return this; + } + + public void sortQuads(float p_sortQuads_1_, float p_sortQuads_2_, float p_sortQuads_3_) + { + this.b.sortVertexData(p_sortQuads_1_, p_sortQuads_2_, p_sortQuads_3_); + } + + public void fixupQuadColor(int p_fixupQuadColor_1_) + { + this.b.putColor4(p_fixupQuadColor_1_); + } + + public ByteBuffer getBuffer() + { + return this.b.getByteBuffer(); + } + + public void postNormal(float p_postNormal_1_, float p_postNormal_2_, float p_postNormal_3_) + { + this.b.putNormal(p_postNormal_1_, p_postNormal_2_, p_postNormal_3_); + } + + public int getDrawMode() + { + return this.b.getDrawMode(); + } + + public void offset(double p_offset_1_, double p_offset_3_, double p_offset_5_) + { + this.b.setTranslation(p_offset_1_, p_offset_3_, p_offset_5_); + } + + public void restoreState(WorldRenderer.State p_restoreState_1_) + { + this.b.setVertexState(p_restoreState_1_); + } + + public void endVertex() + { + this.b.endVertex(); + } + + public RealmsBufferBuilder normal(float p_normal_1_, float p_normal_2_, float p_normal_3_) + { + return this.from(this.b.normal(p_normal_1_, p_normal_2_, p_normal_3_)); + } + + public void end() + { + this.b.finishDrawing(); + } + + public void begin(int p_begin_1_, VertexFormat p_begin_2_) + { + this.b.begin(p_begin_1_, p_begin_2_); + } + + public RealmsBufferBuilder color(int p_color_1_, int p_color_2_, int p_color_3_, int p_color_4_) + { + return this.from(this.b.color(p_color_1_, p_color_2_, p_color_3_, p_color_4_)); + } + + public void faceTex2(int p_faceTex2_1_, int p_faceTex2_2_, int p_faceTex2_3_, int p_faceTex2_4_) + { + this.b.putBrightness4(p_faceTex2_1_, p_faceTex2_2_, p_faceTex2_3_, p_faceTex2_4_); + } + + public void postProcessFacePosition(double p_postProcessFacePosition_1_, double p_postProcessFacePosition_3_, double p_postProcessFacePosition_5_) + { + this.b.putPosition(p_postProcessFacePosition_1_, p_postProcessFacePosition_3_, p_postProcessFacePosition_5_); + } + + public void fixupVertexColor(float p_fixupVertexColor_1_, float p_fixupVertexColor_2_, float p_fixupVertexColor_3_, int p_fixupVertexColor_4_) + { + this.b.putColorRGB_F(p_fixupVertexColor_1_, p_fixupVertexColor_2_, p_fixupVertexColor_3_, p_fixupVertexColor_4_); + } + + public RealmsBufferBuilder color(float p_color_1_, float p_color_2_, float p_color_3_, float p_color_4_) + { + return this.from(this.b.color(p_color_1_, p_color_2_, p_color_3_, p_color_4_)); + } + + public RealmsVertexFormat getVertexFormat() + { + return new RealmsVertexFormat(this.b.getVertexFormat()); + } + + public void faceTint(float p_faceTint_1_, float p_faceTint_2_, float p_faceTint_3_, int p_faceTint_4_) + { + this.b.putColorMultiplier(p_faceTint_1_, p_faceTint_2_, p_faceTint_3_, p_faceTint_4_); + } + + public RealmsBufferBuilder tex2(int p_tex2_1_, int p_tex2_2_) + { + return this.from(this.b.lightmap(p_tex2_1_, p_tex2_2_)); + } + + public void putBulkData(int[] p_putBulkData_1_) + { + this.b.addVertexData(p_putBulkData_1_); + } + + public RealmsBufferBuilder tex(double p_tex_1_, double p_tex_3_) + { + return this.from(this.b.tex(p_tex_1_, p_tex_3_)); + } + + public int getVertexCount() + { + return this.b.getVertexCount(); + } + + public void clear() + { + this.b.reset(); + } + + public RealmsBufferBuilder vertex(double p_vertex_1_, double p_vertex_3_, double p_vertex_5_) + { + return this.from(this.b.pos(p_vertex_1_, p_vertex_3_, p_vertex_5_)); + } + + public void fixupQuadColor(float p_fixupQuadColor_1_, float p_fixupQuadColor_2_, float p_fixupQuadColor_3_) + { + this.b.putColorRGB_F4(p_fixupQuadColor_1_, p_fixupQuadColor_2_, p_fixupQuadColor_3_); + } + + public void noColor() + { + this.b.noColor(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsButton.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsButton.java new file mode 100644 index 0000000..83d31b2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsButton.java @@ -0,0 +1,89 @@ +package net.minecraft.realms; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiButtonRealmsProxy; +import net.minecraft.util.ResourceLocation; + +public class RealmsButton +{ + protected static final ResourceLocation WIDGETS_LOCATION = new ResourceLocation("textures/gui/widgets.png"); + private GuiButtonRealmsProxy proxy; + + public RealmsButton(int buttonId, int x, int y, String text) + { + this.proxy = new GuiButtonRealmsProxy(this, buttonId, x, y, text); + } + + public RealmsButton(int buttonId, int x, int y, int widthIn, int heightIn, String text) + { + this.proxy = new GuiButtonRealmsProxy(this, buttonId, x, y, text, widthIn, heightIn); + } + + public GuiButton getProxy() + { + return this.proxy; + } + + public int id() + { + return this.proxy.getId(); + } + + public boolean active() + { + return this.proxy.getEnabled(); + } + + public void active(boolean p_active_1_) + { + this.proxy.setEnabled(p_active_1_); + } + + public void msg(String p_msg_1_) + { + this.proxy.setText(p_msg_1_); + } + + public int getWidth() + { + return this.proxy.getButtonWidth(); + } + + public int getHeight() + { + return this.proxy.getHeight(); + } + + public int y() + { + return this.proxy.getPositionY(); + } + + public void render(int p_render_1_, int p_render_2_) + { + this.proxy.drawButton(Minecraft.getMinecraft(), p_render_1_, p_render_2_); + } + + public void clicked(int p_clicked_1_, int p_clicked_2_) + { + } + + public void released(int p_released_1_, int p_released_2_) + { + } + + public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_) + { + this.proxy.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_); + } + + public void renderBg(int p_renderBg_1_, int p_renderBg_2_) + { + } + + public int getYImage(boolean p_getYImage_1_) + { + return this.proxy.func_154312_c(p_getYImage_1_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsClickableScrolledSelectionList.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsClickableScrolledSelectionList.java new file mode 100644 index 0000000..1776e58 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsClickableScrolledSelectionList.java @@ -0,0 +1,106 @@ +package net.minecraft.realms; + +import net.minecraft.client.gui.GuiClickableScrolledSelectionListProxy; + +public class RealmsClickableScrolledSelectionList +{ + private final GuiClickableScrolledSelectionListProxy proxy; + + public RealmsClickableScrolledSelectionList(int p_i46052_1_, int p_i46052_2_, int p_i46052_3_, int p_i46052_4_, int p_i46052_5_) + { + this.proxy = new GuiClickableScrolledSelectionListProxy(this, p_i46052_1_, p_i46052_2_, p_i46052_3_, p_i46052_4_, p_i46052_5_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + this.proxy.drawScreen(p_render_1_, p_render_2_, p_render_3_); + } + + public int width() + { + return this.proxy.func_178044_e(); + } + + public int ym() + { + return this.proxy.func_178042_f(); + } + + public int xm() + { + return this.proxy.func_178045_g(); + } + + protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_) + { + } + + public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_) + { + this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_); + } + + public int getItemCount() + { + return 0; + } + + public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_) + { + } + + public boolean isSelectedItem(int p_isSelectedItem_1_) + { + return false; + } + + public void renderBackground() + { + } + + public int getMaxPosition() + { + return 0; + } + + public int getScrollbarPosition() + { + return this.proxy.func_178044_e() / 2 + 124; + } + + public void mouseEvent() + { + this.proxy.handleMouseInput(); + } + + public void customMouseEvent(int p_customMouseEvent_1_, int p_customMouseEvent_2_, int p_customMouseEvent_3_, float p_customMouseEvent_4_, int p_customMouseEvent_5_) + { + } + + public void scroll(int p_scroll_1_) + { + this.proxy.scrollBy(p_scroll_1_); + } + + public int getScroll() + { + return this.proxy.getAmountScrolled(); + } + + protected void renderList(int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_) + { + } + + public void itemClicked(int p_itemClicked_1_, int p_itemClicked_2_, int p_itemClicked_3_, int p_itemClicked_4_, int p_itemClicked_5_) + { + } + + public void renderSelected(int p_renderSelected_1_, int p_renderSelected_2_, int p_renderSelected_3_, Tezzelator p_renderSelected_4_) + { + } + + public void setLeftPos(int p_setLeftPos_1_) + { + this.proxy.setSlotXBoundsFromLeft(p_setLeftPos_1_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsConnect.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsConnect.java new file mode 100644 index 0000000..06d6cd1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsConnect.java @@ -0,0 +1,124 @@ +package net.minecraft.realms; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentTranslation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RealmsConnect +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final RealmsScreen onlineScreen; + private volatile boolean aborted = false; + private NetworkManager connection; + + public RealmsConnect(RealmsScreen p_i1079_1_) + { + this.onlineScreen = p_i1079_1_; + } + + public void connect(final String p_connect_1_, final int p_connect_2_) + { + Realms.setConnectedToRealms(true); + (new Thread("Realms-connect-task") + { + public void run() + { + InetAddress inetaddress = null; + + try + { + inetaddress = InetAddress.getByName(p_connect_1_); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection = NetworkManager.createNetworkManagerAndConnect(inetaddress, p_connect_2_, Minecraft.getMinecraft().gameSettings.isUsingNativeTransport()); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection.setNetHandler(new NetHandlerLoginClient(RealmsConnect.this.connection, Minecraft.getMinecraft(), RealmsConnect.this.onlineScreen.getProxy())); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection.sendPacket(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection.sendPacket(new C00PacketLoginStart(Minecraft.getMinecraft().getSession().getProfile())); + } + catch (UnknownHostException unknownhostexception) + { + Realms.clearResourcePack(); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.LOGGER.error((String)"Couldn\'t connect to world", (Throwable)unknownhostexception); + Minecraft.getMinecraft().getResourcePackRepository().clearResourcePack(); + Realms.setScreen(new DisconnectedRealmsScreen(RealmsConnect.this.onlineScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Unknown host \'" + p_connect_1_ + "\'"}))); + } + catch (Exception exception) + { + Realms.clearResourcePack(); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.LOGGER.error((String)"Couldn\'t connect to world", (Throwable)exception); + String s = exception.toString(); + + if (inetaddress != null) + { + String s1 = inetaddress.toString() + ":" + p_connect_2_; + s = s.replaceAll(s1, ""); + } + + Realms.setScreen(new DisconnectedRealmsScreen(RealmsConnect.this.onlineScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {s}))); + } + } + }).start(); + } + + public void abort() + { + this.aborted = true; + } + + public void tick() + { + if (this.connection != null) + { + if (this.connection.isChannelOpen()) + { + this.connection.processReceivedPackets(); + } + else + { + this.connection.checkDisconnected(); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsDefaultVertexFormat.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsDefaultVertexFormat.java new file mode 100644 index 0000000..926498e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsDefaultVertexFormat.java @@ -0,0 +1,71 @@ +package net.minecraft.realms; + +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; + +public class RealmsDefaultVertexFormat +{ + public static final RealmsVertexFormat BLOCK = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat BLOCK_NORMALS = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat ENTITY = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat PARTICLE = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION_COLOR = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION_TEX = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION_NORMAL = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION_TEX_COLOR = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION_TEX_NORMAL = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION_TEX2_COLOR = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormat POSITION_TEX_COLOR_NORMAL = new RealmsVertexFormat(new VertexFormat()); + public static final RealmsVertexFormatElement ELEMENT_POSITION = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3)); + public static final RealmsVertexFormatElement ELEMENT_COLOR = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.UBYTE, VertexFormatElement.EnumUsage.COLOR, 4)); + public static final RealmsVertexFormatElement ELEMENT_UV0 = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.UV, 2)); + public static final RealmsVertexFormatElement ELEMENT_UV1 = new RealmsVertexFormatElement(new VertexFormatElement(1, VertexFormatElement.EnumType.SHORT, VertexFormatElement.EnumUsage.UV, 2)); + public static final RealmsVertexFormatElement ELEMENT_NORMAL = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.BYTE, VertexFormatElement.EnumUsage.NORMAL, 3)); + public static final RealmsVertexFormatElement ELEMENT_PADDING = new RealmsVertexFormatElement(new VertexFormatElement(0, VertexFormatElement.EnumType.BYTE, VertexFormatElement.EnumUsage.PADDING, 1)); + + static + { + BLOCK.addElement(ELEMENT_POSITION); + BLOCK.addElement(ELEMENT_COLOR); + BLOCK.addElement(ELEMENT_UV0); + BLOCK.addElement(ELEMENT_UV1); + BLOCK_NORMALS.addElement(ELEMENT_POSITION); + BLOCK_NORMALS.addElement(ELEMENT_COLOR); + BLOCK_NORMALS.addElement(ELEMENT_UV0); + BLOCK_NORMALS.addElement(ELEMENT_NORMAL); + BLOCK_NORMALS.addElement(ELEMENT_PADDING); + ENTITY.addElement(ELEMENT_POSITION); + ENTITY.addElement(ELEMENT_UV0); + ENTITY.addElement(ELEMENT_NORMAL); + ENTITY.addElement(ELEMENT_PADDING); + PARTICLE.addElement(ELEMENT_POSITION); + PARTICLE.addElement(ELEMENT_UV0); + PARTICLE.addElement(ELEMENT_COLOR); + PARTICLE.addElement(ELEMENT_UV1); + POSITION.addElement(ELEMENT_POSITION); + POSITION_COLOR.addElement(ELEMENT_POSITION); + POSITION_COLOR.addElement(ELEMENT_COLOR); + POSITION_TEX.addElement(ELEMENT_POSITION); + POSITION_TEX.addElement(ELEMENT_UV0); + POSITION_NORMAL.addElement(ELEMENT_POSITION); + POSITION_NORMAL.addElement(ELEMENT_NORMAL); + POSITION_NORMAL.addElement(ELEMENT_PADDING); + POSITION_TEX_COLOR.addElement(ELEMENT_POSITION); + POSITION_TEX_COLOR.addElement(ELEMENT_UV0); + POSITION_TEX_COLOR.addElement(ELEMENT_COLOR); + POSITION_TEX_NORMAL.addElement(ELEMENT_POSITION); + POSITION_TEX_NORMAL.addElement(ELEMENT_UV0); + POSITION_TEX_NORMAL.addElement(ELEMENT_NORMAL); + POSITION_TEX_NORMAL.addElement(ELEMENT_PADDING); + POSITION_TEX2_COLOR.addElement(ELEMENT_POSITION); + POSITION_TEX2_COLOR.addElement(ELEMENT_UV0); + POSITION_TEX2_COLOR.addElement(ELEMENT_UV1); + POSITION_TEX2_COLOR.addElement(ELEMENT_COLOR); + POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_POSITION); + POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_UV0); + POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_COLOR); + POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_NORMAL); + POSITION_TEX_COLOR_NORMAL.addElement(ELEMENT_PADDING); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsEditBox.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsEditBox.java new file mode 100644 index 0000000..d5846d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsEditBox.java @@ -0,0 +1,64 @@ +package net.minecraft.realms; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiTextField; + +public class RealmsEditBox +{ + private final GuiTextField editBox; + + public RealmsEditBox(int p_i45743_1_, int p_i45743_2_, int p_i45743_3_, int p_i45743_4_, int p_i45743_5_) + { + this.editBox = new GuiTextField(p_i45743_1_, Minecraft.getMinecraft().fontRendererObj, p_i45743_2_, p_i45743_3_, p_i45743_4_, p_i45743_5_); + } + + public String getValue() + { + return this.editBox.getText(); + } + + public void tick() + { + this.editBox.updateCursorCounter(); + } + + public void setFocus(boolean p_setFocus_1_) + { + this.editBox.setFocused(p_setFocus_1_); + } + + public void setValue(String p_setValue_1_) + { + this.editBox.setText(p_setValue_1_); + } + + public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) + { + this.editBox.textboxKeyTyped(p_keyPressed_1_, p_keyPressed_2_); + } + + public boolean isFocused() + { + return this.editBox.isFocused(); + } + + public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_) + { + this.editBox.mouseClicked(p_mouseClicked_1_, p_mouseClicked_2_, p_mouseClicked_3_); + } + + public void render() + { + this.editBox.drawTextBox(); + } + + public void setMaxLength(int p_setMaxLength_1_) + { + this.editBox.setMaxStringLength(p_setMaxLength_1_); + } + + public void setIsEditable(boolean p_setIsEditable_1_) + { + this.editBox.setEnabled(p_setIsEditable_1_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsLevelSummary.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsLevelSummary.java new file mode 100644 index 0000000..d4dd859 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsLevelSummary.java @@ -0,0 +1,63 @@ +package net.minecraft.realms; + +import net.minecraft.world.storage.SaveFormatComparator; + +public class RealmsLevelSummary implements Comparable +{ + private SaveFormatComparator levelSummary; + + public RealmsLevelSummary(SaveFormatComparator p_i1109_1_) + { + this.levelSummary = p_i1109_1_; + } + + public int getGameMode() + { + return this.levelSummary.getEnumGameType().getID(); + } + + public String getLevelId() + { + return this.levelSummary.getFileName(); + } + + public boolean hasCheats() + { + return this.levelSummary.getCheatsEnabled(); + } + + public boolean isHardcore() + { + return this.levelSummary.isHardcoreModeEnabled(); + } + + public boolean isRequiresConversion() + { + return this.levelSummary.requiresConversion(); + } + + public String getLevelName() + { + return this.levelSummary.getDisplayName(); + } + + public long getLastPlayed() + { + return this.levelSummary.getLastTimePlayed(); + } + + public int compareTo(SaveFormatComparator p_compareTo_1_) + { + return this.levelSummary.compareTo(p_compareTo_1_); + } + + public long getSizeOnDisk() + { + return this.levelSummary.getSizeOnDisk(); + } + + public int compareTo(RealmsLevelSummary p_compareTo_1_) + { + return this.levelSummary.getLastTimePlayed() < p_compareTo_1_.getLastPlayed() ? 1 : (this.levelSummary.getLastTimePlayed() > p_compareTo_1_.getLastPlayed() ? -1 : this.levelSummary.getFileName().compareTo(p_compareTo_1_.getLevelId())); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsMth.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsMth.java new file mode 100644 index 0000000..d8feb50 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsMth.java @@ -0,0 +1,173 @@ +package net.minecraft.realms; + +import java.util.Random; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.StringUtils; + +public class RealmsMth +{ + public static float sin(float p_sin_0_) + { + return MathHelper.sin(p_sin_0_); + } + + public static double nextDouble(Random p_nextDouble_0_, double p_nextDouble_1_, double p_nextDouble_3_) + { + return MathHelper.getRandomDoubleInRange(p_nextDouble_0_, p_nextDouble_1_, p_nextDouble_3_); + } + + public static int ceil(float p_ceil_0_) + { + return MathHelper.ceiling_float_int(p_ceil_0_); + } + + public static int floor(double p_floor_0_) + { + return MathHelper.floor_double(p_floor_0_); + } + + public static int intFloorDiv(int p_intFloorDiv_0_, int p_intFloorDiv_1_) + { + return MathHelper.bucketInt(p_intFloorDiv_0_, p_intFloorDiv_1_); + } + + public static float abs(float p_abs_0_) + { + return MathHelper.abs(p_abs_0_); + } + + public static int clamp(int p_clamp_0_, int p_clamp_1_, int p_clamp_2_) + { + return MathHelper.clamp_int(p_clamp_0_, p_clamp_1_, p_clamp_2_); + } + + public static double clampedLerp(double p_clampedLerp_0_, double p_clampedLerp_2_, double p_clampedLerp_4_) + { + return MathHelper.denormalizeClamp(p_clampedLerp_0_, p_clampedLerp_2_, p_clampedLerp_4_); + } + + public static int ceil(double p_ceil_0_) + { + return MathHelper.ceiling_double_int(p_ceil_0_); + } + + public static boolean isEmpty(String p_isEmpty_0_) + { + return StringUtils.isEmpty(p_isEmpty_0_); + } + + public static long lfloor(double p_lfloor_0_) + { + return MathHelper.floor_double_long(p_lfloor_0_); + } + + public static float sqrt(double p_sqrt_0_) + { + return MathHelper.sqrt_double(p_sqrt_0_); + } + + public static double clamp(double p_clamp_0_, double p_clamp_2_, double p_clamp_4_) + { + return MathHelper.clamp_double(p_clamp_0_, p_clamp_2_, p_clamp_4_); + } + + public static int getInt(String p_getInt_0_, int p_getInt_1_) + { + return MathHelper.parseIntWithDefault(p_getInt_0_, p_getInt_1_); + } + + public static double getDouble(String p_getDouble_0_, double p_getDouble_1_) + { + return MathHelper.parseDoubleWithDefault(p_getDouble_0_, p_getDouble_1_); + } + + public static int log2(int p_log2_0_) + { + return MathHelper.calculateLogBaseTwo(p_log2_0_); + } + + public static int absFloor(double p_absFloor_0_) + { + return MathHelper.func_154353_e(p_absFloor_0_); + } + + public static int smallestEncompassingPowerOfTwo(int p_smallestEncompassingPowerOfTwo_0_) + { + return MathHelper.roundUpToPowerOfTwo(p_smallestEncompassingPowerOfTwo_0_); + } + + public static float sqrt(float p_sqrt_0_) + { + return MathHelper.sqrt_float(p_sqrt_0_); + } + + public static float cos(float p_cos_0_) + { + return MathHelper.cos(p_cos_0_); + } + + public static int getInt(String p_getInt_0_, int p_getInt_1_, int p_getInt_2_) + { + return MathHelper.parseIntWithDefaultAndMax(p_getInt_0_, p_getInt_1_, p_getInt_2_); + } + + public static int fastFloor(double p_fastFloor_0_) + { + return MathHelper.truncateDoubleToInt(p_fastFloor_0_); + } + + public static double absMax(double p_absMax_0_, double p_absMax_2_) + { + return MathHelper.abs_max(p_absMax_0_, p_absMax_2_); + } + + public static float nextFloat(Random p_nextFloat_0_, float p_nextFloat_1_, float p_nextFloat_2_) + { + return MathHelper.randomFloatClamp(p_nextFloat_0_, p_nextFloat_1_, p_nextFloat_2_); + } + + public static double wrapDegrees(double p_wrapDegrees_0_) + { + return MathHelper.wrapAngleTo180_double(p_wrapDegrees_0_); + } + + public static float wrapDegrees(float p_wrapDegrees_0_) + { + return MathHelper.wrapAngleTo180_float(p_wrapDegrees_0_); + } + + public static float clamp(float p_clamp_0_, float p_clamp_1_, float p_clamp_2_) + { + return MathHelper.clamp_float(p_clamp_0_, p_clamp_1_, p_clamp_2_); + } + + public static double getDouble(String p_getDouble_0_, double p_getDouble_1_, double p_getDouble_3_) + { + return MathHelper.parseDoubleWithDefaultAndMax(p_getDouble_0_, p_getDouble_1_, p_getDouble_3_); + } + + public static int roundUp(int p_roundUp_0_, int p_roundUp_1_) + { + return MathHelper.roundUp(p_roundUp_0_, p_roundUp_1_); + } + + public static double average(long[] p_average_0_) + { + return MathHelper.average(p_average_0_); + } + + public static int floor(float p_floor_0_) + { + return MathHelper.floor_float(p_floor_0_); + } + + public static int abs(int p_abs_0_) + { + return MathHelper.abs_int(p_abs_0_); + } + + public static int nextInt(Random p_nextInt_0_, int p_nextInt_1_, int p_nextInt_2_) + { + return MathHelper.getRandomIntegerInRange(p_nextInt_0_, p_nextInt_1_, p_nextInt_2_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsScreen.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsScreen.java new file mode 100644 index 0000000..fd1b57f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsScreen.java @@ -0,0 +1,255 @@ +package net.minecraft.realms; + +import com.mojang.util.UUIDTypeAdapter; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreenRealmsProxy; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class RealmsScreen +{ + public static final int SKIN_HEAD_U = 8; + public static final int SKIN_HEAD_V = 8; + public static final int SKIN_HEAD_WIDTH = 8; + public static final int SKIN_HEAD_HEIGHT = 8; + public static final int SKIN_HAT_U = 40; + public static final int SKIN_HAT_V = 8; + public static final int SKIN_HAT_WIDTH = 8; + public static final int SKIN_HAT_HEIGHT = 8; + public static final int SKIN_TEX_WIDTH = 64; + public static final int SKIN_TEX_HEIGHT = 64; + protected Minecraft minecraft; + public int width; + public int height; + private GuiScreenRealmsProxy proxy = new GuiScreenRealmsProxy(this); + + public GuiScreenRealmsProxy getProxy() + { + return this.proxy; + } + + public void init() + { + } + + public void init(Minecraft p_init_1_, int p_init_2_, int p_init_3_) + { + } + + public void drawCenteredString(String p_drawCenteredString_1_, int p_drawCenteredString_2_, int p_drawCenteredString_3_, int p_drawCenteredString_4_) + { + this.proxy.func_154325_a(p_drawCenteredString_1_, p_drawCenteredString_2_, p_drawCenteredString_3_, p_drawCenteredString_4_); + } + + public void drawString(String p_drawString_1_, int p_drawString_2_, int p_drawString_3_, int p_drawString_4_) + { + this.drawString(p_drawString_1_, p_drawString_2_, p_drawString_3_, p_drawString_4_, true); + } + + public void drawString(String p_drawString_1_, int p_drawString_2_, int p_drawString_3_, int p_drawString_4_, boolean p_drawString_5_) + { + this.proxy.func_154322_b(p_drawString_1_, p_drawString_2_, p_drawString_3_, p_drawString_4_, false); + } + + public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_) + { + this.proxy.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_); + } + + public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_, int p_blit_7_, float p_blit_8_, float p_blit_9_) + { + Gui.drawScaledCustomSizeModalRect(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_, p_blit_8_, p_blit_9_); + } + + public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, float p_blit_6_, float p_blit_7_) + { + Gui.drawModalRectWithCustomSizedTexture(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_); + } + + public void fillGradient(int p_fillGradient_1_, int p_fillGradient_2_, int p_fillGradient_3_, int p_fillGradient_4_, int p_fillGradient_5_, int p_fillGradient_6_) + { + this.proxy.drawGradientRect(p_fillGradient_1_, p_fillGradient_2_, p_fillGradient_3_, p_fillGradient_4_, p_fillGradient_5_, p_fillGradient_6_); + } + + public void renderBackground() + { + this.proxy.drawDefaultBackground(); + } + + public boolean isPauseScreen() + { + return this.proxy.doesGuiPauseGame(); + } + + public void renderBackground(int p_renderBackground_1_) + { + this.proxy.drawWorldBackground(p_renderBackground_1_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + for (int i = 0; i < this.proxy.func_154320_j().size(); ++i) + { + ((RealmsButton)this.proxy.func_154320_j().get(i)).render(p_render_1_, p_render_2_); + } + } + + public void renderTooltip(ItemStack p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) + { + this.proxy.renderToolTip(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public void renderTooltip(String p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) + { + this.proxy.drawCreativeTabHoveringText(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public void renderTooltip(List p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) + { + this.proxy.drawHoveringText(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public static void bindFace(String p_bindFace_0_, String p_bindFace_1_) + { + ResourceLocation resourcelocation = AbstractClientPlayer.getLocationSkin(p_bindFace_1_); + + if (resourcelocation == null) + { + resourcelocation = DefaultPlayerSkin.getDefaultSkin(UUIDTypeAdapter.fromString(p_bindFace_0_)); + } + + AbstractClientPlayer.getDownloadImageSkin(resourcelocation, p_bindFace_1_); + Minecraft.getMinecraft().getTextureManager().bindTexture(resourcelocation); + } + + public static void bind(String p_bind_0_) + { + ResourceLocation resourcelocation = new ResourceLocation(p_bind_0_); + Minecraft.getMinecraft().getTextureManager().bindTexture(resourcelocation); + } + + public void tick() + { + } + + public int width() + { + return this.proxy.width; + } + + public int height() + { + return this.proxy.height; + } + + public int fontLineHeight() + { + return this.proxy.func_154329_h(); + } + + public int fontWidth(String p_fontWidth_1_) + { + return this.proxy.func_154326_c(p_fontWidth_1_); + } + + public void fontDrawShadow(String p_fontDrawShadow_1_, int p_fontDrawShadow_2_, int p_fontDrawShadow_3_, int p_fontDrawShadow_4_) + { + this.proxy.func_154319_c(p_fontDrawShadow_1_, p_fontDrawShadow_2_, p_fontDrawShadow_3_, p_fontDrawShadow_4_); + } + + public List fontSplit(String p_fontSplit_1_, int p_fontSplit_2_) + { + return this.proxy.func_154323_a(p_fontSplit_1_, p_fontSplit_2_); + } + + public void buttonClicked(RealmsButton p_buttonClicked_1_) + { + } + + public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, String p_newButton_3_) + { + return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_); + } + + public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, int p_newButton_3_, int p_newButton_4_, String p_newButton_5_) + { + return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_, p_newButton_4_, p_newButton_5_); + } + + public void buttonsClear() + { + this.proxy.func_154324_i(); + } + + public void buttonsAdd(RealmsButton p_buttonsAdd_1_) + { + this.proxy.func_154327_a(p_buttonsAdd_1_); + } + + public List buttons() + { + return this.proxy.func_154320_j(); + } + + public void buttonsRemove(RealmsButton p_buttonsRemove_1_) + { + this.proxy.func_154328_b(p_buttonsRemove_1_); + } + + public RealmsEditBox newEditBox(int p_newEditBox_1_, int p_newEditBox_2_, int p_newEditBox_3_, int p_newEditBox_4_, int p_newEditBox_5_) + { + return new RealmsEditBox(p_newEditBox_1_, p_newEditBox_2_, p_newEditBox_3_, p_newEditBox_4_, p_newEditBox_5_); + } + + public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_) + { + } + + public void mouseEvent() + { + } + + public void keyboardEvent() + { + } + + public void mouseReleased(int p_mouseReleased_1_, int p_mouseReleased_2_, int p_mouseReleased_3_) + { + } + + public void mouseDragged(int p_mouseDragged_1_, int p_mouseDragged_2_, int p_mouseDragged_3_, long p_mouseDragged_4_) + { + } + + public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) + { + } + + public void confirmResult(boolean p_confirmResult_1_, int p_confirmResult_2_) + { + } + + public static String getLocalizedString(String p_getLocalizedString_0_) + { + return I18n.format(p_getLocalizedString_0_, new Object[0]); + } + + public static String getLocalizedString(String p_getLocalizedString_0_, Object... p_getLocalizedString_1_) + { + return I18n.format(p_getLocalizedString_0_, p_getLocalizedString_1_); + } + + public RealmsAnvilLevelStorageSource getLevelStorageSource() + { + return new RealmsAnvilLevelStorageSource(Minecraft.getMinecraft().getSaveLoader()); + } + + public void removed() + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsScrolledSelectionList.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsScrolledSelectionList.java new file mode 100644 index 0000000..8378078 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsScrolledSelectionList.java @@ -0,0 +1,89 @@ +package net.minecraft.realms; + +import net.minecraft.client.gui.GuiSlotRealmsProxy; + +public class RealmsScrolledSelectionList +{ + private final GuiSlotRealmsProxy proxy; + + public RealmsScrolledSelectionList(int p_i1119_1_, int p_i1119_2_, int p_i1119_3_, int p_i1119_4_, int p_i1119_5_) + { + this.proxy = new GuiSlotRealmsProxy(this, p_i1119_1_, p_i1119_2_, p_i1119_3_, p_i1119_4_, p_i1119_5_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + this.proxy.drawScreen(p_render_1_, p_render_2_, p_render_3_); + } + + public int width() + { + return this.proxy.getWidth(); + } + + public int ym() + { + return this.proxy.getMouseY(); + } + + public int xm() + { + return this.proxy.getMouseX(); + } + + protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_) + { + } + + public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_) + { + this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_); + } + + public int getItemCount() + { + return 0; + } + + public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_) + { + } + + public boolean isSelectedItem(int p_isSelectedItem_1_) + { + return false; + } + + public void renderBackground() + { + } + + public int getMaxPosition() + { + return 0; + } + + public int getScrollbarPosition() + { + return this.proxy.getWidth() / 2 + 124; + } + + public void mouseEvent() + { + this.proxy.handleMouseInput(); + } + + public void scroll(int p_scroll_1_) + { + this.proxy.scrollBy(p_scroll_1_); + } + + public int getScroll() + { + return this.proxy.getAmountScrolled(); + } + + protected void renderList(int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerAddress.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerAddress.java new file mode 100644 index 0000000..d7d429d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerAddress.java @@ -0,0 +1,31 @@ +package net.minecraft.realms; + +import net.minecraft.client.multiplayer.ServerAddress; + +public class RealmsServerAddress +{ + private final String host; + private final int port; + + protected RealmsServerAddress(String hostIn, int portIn) + { + this.host = hostIn; + this.port = portIn; + } + + public String getHost() + { + return this.host; + } + + public int getPort() + { + return this.port; + } + + public static RealmsServerAddress parseString(String p_parseString_0_) + { + ServerAddress serveraddress = ServerAddress.fromString(p_parseString_0_); + return new RealmsServerAddress(serveraddress.getIP(), serveraddress.getPort()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerPing.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerPing.java new file mode 100644 index 0000000..d573026 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerPing.java @@ -0,0 +1,8 @@ +package net.minecraft.realms; + +public class RealmsServerPing +{ + public volatile String nrOfPlayers = "0"; + public volatile long lastPingSnapshot = 0L; + public volatile String playerList = ""; +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerStatusPinger.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerStatusPinger.java new file mode 100644 index 0000000..a83ad8a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsServerStatusPinger.java @@ -0,0 +1,149 @@ +package net.minecraft.realms; + +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RealmsServerStatusPinger +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final List connections = Collections.synchronizedList(Lists.newArrayList()); + + public void pingServer(final String p_pingServer_1_, final RealmsServerPing p_pingServer_2_) throws UnknownHostException + { + if (p_pingServer_1_ != null && !p_pingServer_1_.startsWith("0.0.0.0") && !p_pingServer_1_.isEmpty()) + { + RealmsServerAddress realmsserveraddress = RealmsServerAddress.parseString(p_pingServer_1_); + final NetworkManager networkmanager = NetworkManager.createNetworkManagerAndConnect(InetAddress.getByName(realmsserveraddress.getHost()), realmsserveraddress.getPort(), false); + this.connections.add(networkmanager); + networkmanager.setNetHandler(new INetHandlerStatusClient() + { + private boolean field_154345_e = false; + public void handleServerInfo(S00PacketServerInfo packetIn) + { + ServerStatusResponse serverstatusresponse = packetIn.getResponse(); + + if (serverstatusresponse.getPlayerCountData() != null) + { + p_pingServer_2_.nrOfPlayers = String.valueOf(serverstatusresponse.getPlayerCountData().getOnlinePlayerCount()); + + if (ArrayUtils.isNotEmpty(serverstatusresponse.getPlayerCountData().getPlayers())) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (GameProfile gameprofile : serverstatusresponse.getPlayerCountData().getPlayers()) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append("\n"); + } + + stringbuilder.append(gameprofile.getName()); + } + + if (serverstatusresponse.getPlayerCountData().getPlayers().length < serverstatusresponse.getPlayerCountData().getOnlinePlayerCount()) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append("\n"); + } + + stringbuilder.append("... and ").append(serverstatusresponse.getPlayerCountData().getOnlinePlayerCount() - serverstatusresponse.getPlayerCountData().getPlayers().length).append(" more ..."); + } + + p_pingServer_2_.playerList = stringbuilder.toString(); + } + } + else + { + p_pingServer_2_.playerList = ""; + } + + networkmanager.sendPacket(new C01PacketPing(Realms.currentTimeMillis())); + this.field_154345_e = true; + } + public void handlePong(S01PacketPong packetIn) + { + networkmanager.closeChannel(new ChatComponentText("Finished")); + } + public void onDisconnect(IChatComponent reason) + { + if (!this.field_154345_e) + { + RealmsServerStatusPinger.LOGGER.error("Can\'t ping " + p_pingServer_1_ + ": " + reason.getUnformattedText()); + } + } + }); + + try + { + networkmanager.sendPacket(new C00Handshake(RealmsSharedConstants.NETWORK_PROTOCOL_VERSION, realmsserveraddress.getHost(), realmsserveraddress.getPort(), EnumConnectionState.STATUS)); + networkmanager.sendPacket(new C00PacketServerQuery()); + } + catch (Throwable throwable) + { + LOGGER.error((Object)throwable); + } + } + } + + public void tick() + { + synchronized (this.connections) + { + Iterator iterator = this.connections.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + networkmanager.processReceivedPackets(); + } + else + { + iterator.remove(); + networkmanager.checkDisconnected(); + } + } + } + } + + public void removeAll() + { + synchronized (this.connections) + { + Iterator iterator = this.connections.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + iterator.remove(); + networkmanager.closeChannel(new ChatComponentText("Cancelled")); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSharedConstants.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSharedConstants.java new file mode 100644 index 0000000..9e32584 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSharedConstants.java @@ -0,0 +1,11 @@ +package net.minecraft.realms; + +import net.minecraft.util.ChatAllowedCharacters; + +public class RealmsSharedConstants +{ + public static int NETWORK_PROTOCOL_VERSION = 47; + public static int TICKS_PER_SECOND = 20; + public static String VERSION_STRING = "1.8.9"; + public static char[] ILLEGAL_FILE_CHARACTERS = ChatAllowedCharacters.allowedCharactersArray; +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSimpleScrolledSelectionList.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSimpleScrolledSelectionList.java new file mode 100644 index 0000000..ea3c7d1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSimpleScrolledSelectionList.java @@ -0,0 +1,89 @@ +package net.minecraft.realms; + +import net.minecraft.client.gui.GuiSimpleScrolledSelectionListProxy; + +public class RealmsSimpleScrolledSelectionList +{ + private final GuiSimpleScrolledSelectionListProxy proxy; + + public RealmsSimpleScrolledSelectionList(int p_i45803_1_, int p_i45803_2_, int p_i45803_3_, int p_i45803_4_, int p_i45803_5_) + { + this.proxy = new GuiSimpleScrolledSelectionListProxy(this, p_i45803_1_, p_i45803_2_, p_i45803_3_, p_i45803_4_, p_i45803_5_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + this.proxy.drawScreen(p_render_1_, p_render_2_, p_render_3_); + } + + public int width() + { + return this.proxy.getWidth(); + } + + public int ym() + { + return this.proxy.getMouseY(); + } + + public int xm() + { + return this.proxy.getMouseX(); + } + + protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_) + { + } + + public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_) + { + this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_); + } + + public int getItemCount() + { + return 0; + } + + public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_) + { + } + + public boolean isSelectedItem(int p_isSelectedItem_1_) + { + return false; + } + + public void renderBackground() + { + } + + public int getMaxPosition() + { + return 0; + } + + public int getScrollbarPosition() + { + return this.proxy.getWidth() / 2 + 124; + } + + public void mouseEvent() + { + this.proxy.handleMouseInput(); + } + + public void scroll(int p_scroll_1_) + { + this.proxy.scrollBy(p_scroll_1_); + } + + public int getScroll() + { + return this.proxy.getAmountScrolled(); + } + + protected void renderList(int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSliderButton.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSliderButton.java new file mode 100644 index 0000000..1760226 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsSliderButton.java @@ -0,0 +1,104 @@ +package net.minecraft.realms; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; + +public class RealmsSliderButton extends RealmsButton +{ + public float value; + public boolean sliding; + private final float minValue; + private final float maxValue; + private int steps; + + public RealmsSliderButton(int p_i1056_1_, int p_i1056_2_, int p_i1056_3_, int p_i1056_4_, int p_i1056_5_, int p_i1056_6_) + { + this(p_i1056_1_, p_i1056_2_, p_i1056_3_, p_i1056_4_, p_i1056_6_, 0, 1.0F, (float)p_i1056_5_); + } + + public RealmsSliderButton(int p_i1057_1_, int p_i1057_2_, int p_i1057_3_, int p_i1057_4_, int p_i1057_5_, int p_i1057_6_, float p_i1057_7_, float p_i1057_8_) + { + super(p_i1057_1_, p_i1057_2_, p_i1057_3_, p_i1057_4_, 20, ""); + this.value = 1.0F; + this.minValue = p_i1057_7_; + this.maxValue = p_i1057_8_; + this.value = this.toPct((float)p_i1057_6_); + this.getProxy().displayString = this.getMessage(); + } + + public String getMessage() + { + return ""; + } + + public float toPct(float p_toPct_1_) + { + return MathHelper.clamp_float((this.clamp(p_toPct_1_) - this.minValue) / (this.maxValue - this.minValue), 0.0F, 1.0F); + } + + public float toValue(float p_toValue_1_) + { + return this.clamp(this.minValue + (this.maxValue - this.minValue) * MathHelper.clamp_float(p_toValue_1_, 0.0F, 1.0F)); + } + + public float clamp(float p_clamp_1_) + { + p_clamp_1_ = this.clampSteps(p_clamp_1_); + return MathHelper.clamp_float(p_clamp_1_, this.minValue, this.maxValue); + } + + protected float clampSteps(float p_clampSteps_1_) + { + if (this.steps > 0) + { + p_clampSteps_1_ = (float)(this.steps * Math.round(p_clampSteps_1_ / (float)this.steps)); + } + + return p_clampSteps_1_; + } + + public int getYImage(boolean p_getYImage_1_) + { + return 0; + } + + public void renderBg(int p_renderBg_1_, int p_renderBg_2_) + { + if (this.getProxy().visible) + { + if (this.sliding) + { + this.value = (float)(p_renderBg_1_ - (this.getProxy().xPosition + 4)) / (float)(this.getProxy().getButtonWidth() - 8); + this.value = MathHelper.clamp_float(this.value, 0.0F, 1.0F); + float f = this.toValue(this.value); + this.clicked(f); + this.value = this.toPct(f); + this.getProxy().displayString = this.getMessage(); + } + + Minecraft.getMinecraft().getTextureManager().bindTexture(WIDGETS_LOCATION); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.blit(this.getProxy().xPosition + (int)(this.value * (float)(this.getProxy().getButtonWidth() - 8)), this.getProxy().yPosition, 0, 66, 4, 20); + this.blit(this.getProxy().xPosition + (int)(this.value * (float)(this.getProxy().getButtonWidth() - 8)) + 4, this.getProxy().yPosition, 196, 66, 4, 20); + } + } + + public void clicked(int p_clicked_1_, int p_clicked_2_) + { + this.value = (float)(p_clicked_1_ - (this.getProxy().xPosition + 4)) / (float)(this.getProxy().getButtonWidth() - 8); + this.value = MathHelper.clamp_float(this.value, 0.0F, 1.0F); + this.clicked(this.toValue(this.value)); + this.getProxy().displayString = this.getMessage(); + this.sliding = true; + } + + public void clicked(float p_clicked_1_) + { + } + + public void released(int p_released_1_, int p_released_2_) + { + this.sliding = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsVertexFormat.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsVertexFormat.java new file mode 100644 index 0000000..0a8abe6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsVertexFormat.java @@ -0,0 +1,119 @@ +package net.minecraft.realms; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; + +public class RealmsVertexFormat +{ + private VertexFormat v; + + public RealmsVertexFormat(VertexFormat vIn) + { + this.v = vIn; + } + + public RealmsVertexFormat from(VertexFormat p_from_1_) + { + this.v = p_from_1_; + return this; + } + + public VertexFormat getVertexFormat() + { + return this.v; + } + + public void clear() + { + this.v.clear(); + } + + public int getUvOffset(int p_getUvOffset_1_) + { + return this.v.getUvOffsetById(p_getUvOffset_1_); + } + + public int getElementCount() + { + return this.v.getElementCount(); + } + + public boolean hasColor() + { + return this.v.hasColor(); + } + + public boolean hasUv(int p_hasUv_1_) + { + return this.v.hasUvOffset(p_hasUv_1_); + } + + public RealmsVertexFormatElement getElement(int p_getElement_1_) + { + return new RealmsVertexFormatElement(this.v.getElement(p_getElement_1_)); + } + + public RealmsVertexFormat addElement(RealmsVertexFormatElement p_addElement_1_) + { + return this.from(this.v.addElement(p_addElement_1_.getVertexFormatElement())); + } + + public int getColorOffset() + { + return this.v.getColorOffset(); + } + + public List getElements() + { + List list = new ArrayList(); + + for (VertexFormatElement vertexformatelement : this.v.getElements()) + { + list.add(new RealmsVertexFormatElement(vertexformatelement)); + } + + return list; + } + + public boolean hasNormal() + { + return this.v.hasNormal(); + } + + public int getVertexSize() + { + return this.v.getNextOffset(); + } + + public int getOffset(int p_getOffset_1_) + { + return this.v.getOffset(p_getOffset_1_); + } + + public int getNormalOffset() + { + return this.v.getNormalOffset(); + } + + public int getIntegerSize() + { + return this.v.getIntegerSize(); + } + + public boolean equals(Object p_equals_1_) + { + return this.v.equals(p_equals_1_); + } + + public int hashCode() + { + return this.v.hashCode(); + } + + public String toString() + { + return this.v.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsVertexFormatElement.java b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsVertexFormatElement.java new file mode 100644 index 0000000..af9f896 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/RealmsVertexFormatElement.java @@ -0,0 +1,53 @@ +package net.minecraft.realms; + +import net.minecraft.client.renderer.vertex.VertexFormatElement; + +public class RealmsVertexFormatElement +{ + private VertexFormatElement v; + + public RealmsVertexFormatElement(VertexFormatElement vIn) + { + this.v = vIn; + } + + public VertexFormatElement getVertexFormatElement() + { + return this.v; + } + + public boolean isPosition() + { + return this.v.isPositionElement(); + } + + public int getIndex() + { + return this.v.getIndex(); + } + + public int getByteSize() + { + return this.v.getSize(); + } + + public int getCount() + { + return this.v.getElementCount(); + } + + public int hashCode() + { + return this.v.hashCode(); + } + + public boolean equals(Object p_equals_1_) + { + return this.v.equals(p_equals_1_); + } + + public String toString() + { + return this.v.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/realms/Tezzelator.java b/Client-1.8.9/src/main/java/net/minecraft/realms/Tezzelator.java new file mode 100644 index 0000000..fb76d74 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/realms/Tezzelator.java @@ -0,0 +1,61 @@ +package net.minecraft.realms; + +import net.minecraft.client.renderer.Tessellator; + +public class Tezzelator +{ + public static Tessellator t = Tessellator.getInstance(); + public static final Tezzelator instance = new Tezzelator(); + + public void end() + { + t.draw(); + } + + public Tezzelator vertex(double p_vertex_1_, double p_vertex_3_, double p_vertex_5_) + { + t.getWorldRenderer().pos(p_vertex_1_, p_vertex_3_, p_vertex_5_); + return this; + } + + public void color(float p_color_1_, float p_color_2_, float p_color_3_, float p_color_4_) + { + t.getWorldRenderer().color(p_color_1_, p_color_2_, p_color_3_, p_color_4_); + } + + public void tex2(short p_tex2_1_, short p_tex2_2_) + { + t.getWorldRenderer().lightmap(p_tex2_1_, p_tex2_2_); + } + + public void normal(float p_normal_1_, float p_normal_2_, float p_normal_3_) + { + t.getWorldRenderer().normal(p_normal_1_, p_normal_2_, p_normal_3_); + } + + public void begin(int p_begin_1_, RealmsVertexFormat p_begin_2_) + { + t.getWorldRenderer().begin(p_begin_1_, p_begin_2_.getVertexFormat()); + } + + public void endVertex() + { + t.getWorldRenderer().endVertex(); + } + + public void offset(double p_offset_1_, double p_offset_3_, double p_offset_5_) + { + t.getWorldRenderer().setTranslation(p_offset_1_, p_offset_3_, p_offset_5_); + } + + public RealmsBufferBuilder color(int p_color_1_, int p_color_2_, int p_color_3_, int p_color_4_) + { + return new RealmsBufferBuilder(t.getWorldRenderer().color(p_color_1_, p_color_2_, p_color_3_, p_color_4_)); + } + + public Tezzelator tex(double p_tex_1_, double p_tex_3_) + { + t.getWorldRenderer().tex(p_tex_1_, p_tex_3_); + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/GoalColor.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/GoalColor.java new file mode 100644 index 0000000..614242d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/GoalColor.java @@ -0,0 +1,36 @@ +package net.minecraft.scoreboard; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; + +public class GoalColor implements IScoreObjectiveCriteria +{ + private final String goalName; + + public GoalColor(String p_i45549_1_, EnumChatFormatting p_i45549_2_) + { + this.goalName = p_i45549_1_ + p_i45549_2_.getFriendlyName(); + IScoreObjectiveCriteria.INSTANCES.put(this.goalName, this); + } + + public String getName() + { + return this.goalName; + } + + public int setScore(List p_96635_1_) + { + return 0; + } + + public boolean isReadOnly() + { + return false; + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() + { + return IScoreObjectiveCriteria.EnumRenderType.INTEGER; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java new file mode 100644 index 0000000..42d3a90 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java @@ -0,0 +1,60 @@ +package net.minecraft.scoreboard; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; + +public interface IScoreObjectiveCriteria +{ + Map INSTANCES = Maps.newHashMap(); + IScoreObjectiveCriteria DUMMY = new ScoreDummyCriteria("dummy"); + IScoreObjectiveCriteria TRIGGER = new ScoreDummyCriteria("trigger"); + IScoreObjectiveCriteria deathCount = new ScoreDummyCriteria("deathCount"); + IScoreObjectiveCriteria playerKillCount = new ScoreDummyCriteria("playerKillCount"); + IScoreObjectiveCriteria totalKillCount = new ScoreDummyCriteria("totalKillCount"); + IScoreObjectiveCriteria health = new ScoreHealthCriteria("health"); + IScoreObjectiveCriteria[] field_178792_h = new IScoreObjectiveCriteria[] {new GoalColor("teamkill.", EnumChatFormatting.BLACK), new GoalColor("teamkill.", EnumChatFormatting.DARK_BLUE), new GoalColor("teamkill.", EnumChatFormatting.DARK_GREEN), new GoalColor("teamkill.", EnumChatFormatting.DARK_AQUA), new GoalColor("teamkill.", EnumChatFormatting.DARK_RED), new GoalColor("teamkill.", EnumChatFormatting.DARK_PURPLE), new GoalColor("teamkill.", EnumChatFormatting.GOLD), new GoalColor("teamkill.", EnumChatFormatting.GRAY), new GoalColor("teamkill.", EnumChatFormatting.DARK_GRAY), new GoalColor("teamkill.", EnumChatFormatting.BLUE), new GoalColor("teamkill.", EnumChatFormatting.GREEN), new GoalColor("teamkill.", EnumChatFormatting.AQUA), new GoalColor("teamkill.", EnumChatFormatting.RED), new GoalColor("teamkill.", EnumChatFormatting.LIGHT_PURPLE), new GoalColor("teamkill.", EnumChatFormatting.YELLOW), new GoalColor("teamkill.", EnumChatFormatting.WHITE)}; + IScoreObjectiveCriteria[] field_178793_i = new IScoreObjectiveCriteria[] {new GoalColor("killedByTeam.", EnumChatFormatting.BLACK), new GoalColor("killedByTeam.", EnumChatFormatting.DARK_BLUE), new GoalColor("killedByTeam.", EnumChatFormatting.DARK_GREEN), new GoalColor("killedByTeam.", EnumChatFormatting.DARK_AQUA), new GoalColor("killedByTeam.", EnumChatFormatting.DARK_RED), new GoalColor("killedByTeam.", EnumChatFormatting.DARK_PURPLE), new GoalColor("killedByTeam.", EnumChatFormatting.GOLD), new GoalColor("killedByTeam.", EnumChatFormatting.GRAY), new GoalColor("killedByTeam.", EnumChatFormatting.DARK_GRAY), new GoalColor("killedByTeam.", EnumChatFormatting.BLUE), new GoalColor("killedByTeam.", EnumChatFormatting.GREEN), new GoalColor("killedByTeam.", EnumChatFormatting.AQUA), new GoalColor("killedByTeam.", EnumChatFormatting.RED), new GoalColor("killedByTeam.", EnumChatFormatting.LIGHT_PURPLE), new GoalColor("killedByTeam.", EnumChatFormatting.YELLOW), new GoalColor("killedByTeam.", EnumChatFormatting.WHITE)}; + + String getName(); + + int setScore(List p_96635_1_); + + boolean isReadOnly(); + + IScoreObjectiveCriteria.EnumRenderType getRenderType(); + + public static enum EnumRenderType + { + INTEGER("integer"), + HEARTS("hearts"); + + private static final Map field_178801_c = Maps.newHashMap(); + private final String field_178798_d; + + private EnumRenderType(String p_i45548_3_) + { + this.field_178798_d = p_i45548_3_; + } + + public String func_178796_a() + { + return this.field_178798_d; + } + + public static IScoreObjectiveCriteria.EnumRenderType func_178795_a(String p_178795_0_) + { + IScoreObjectiveCriteria.EnumRenderType iscoreobjectivecriteria$enumrendertype = (IScoreObjectiveCriteria.EnumRenderType)field_178801_c.get(p_178795_0_); + return iscoreobjectivecriteria$enumrendertype == null ? INTEGER : iscoreobjectivecriteria$enumrendertype; + } + + static { + for (IScoreObjectiveCriteria.EnumRenderType iscoreobjectivecriteria$enumrendertype : values()) + { + field_178801_c.put(iscoreobjectivecriteria$enumrendertype.func_178796_a(), iscoreobjectivecriteria$enumrendertype); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Score.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Score.java new file mode 100644 index 0000000..da84e1a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Score.java @@ -0,0 +1,113 @@ +package net.minecraft.scoreboard; + +import java.util.Comparator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; + +public class Score +{ + public static final Comparator scoreComparator = new Comparator() + { + public int compare(Score p_compare_1_, Score p_compare_2_) + { + return p_compare_1_.getScorePoints() > p_compare_2_.getScorePoints() ? 1 : (p_compare_1_.getScorePoints() < p_compare_2_.getScorePoints() ? -1 : p_compare_2_.getPlayerName().compareToIgnoreCase(p_compare_1_.getPlayerName())); + } + }; + private final Scoreboard theScoreboard; + private final ScoreObjective theScoreObjective; + private final String scorePlayerName; + private int scorePoints; + private boolean locked; + private boolean forceUpdate; + + public Score(Scoreboard theScoreboardIn, ScoreObjective theScoreObjectiveIn, String scorePlayerNameIn) + { + this.theScoreboard = theScoreboardIn; + this.theScoreObjective = theScoreObjectiveIn; + this.scorePlayerName = scorePlayerNameIn; + this.forceUpdate = true; + } + + public void increseScore(int amount) + { + if (this.theScoreObjective.getCriteria().isReadOnly()) + { + throw new IllegalStateException("Cannot modify read-only score"); + } + else + { + this.setScorePoints(this.getScorePoints() + amount); + } + } + + public void decreaseScore(int amount) + { + if (this.theScoreObjective.getCriteria().isReadOnly()) + { + throw new IllegalStateException("Cannot modify read-only score"); + } + else + { + this.setScorePoints(this.getScorePoints() - amount); + } + } + + public void func_96648_a() + { + if (this.theScoreObjective.getCriteria().isReadOnly()) + { + throw new IllegalStateException("Cannot modify read-only score"); + } + else + { + this.increseScore(1); + } + } + + public int getScorePoints() + { + return this.scorePoints; + } + + public void setScorePoints(int points) + { + int i = this.scorePoints; + this.scorePoints = points; + + if (i != points || this.forceUpdate) + { + this.forceUpdate = false; + this.getScoreScoreboard().func_96536_a(this); + } + } + + public ScoreObjective getObjective() + { + return this.theScoreObjective; + } + + public String getPlayerName() + { + return this.scorePlayerName; + } + + public Scoreboard getScoreScoreboard() + { + return this.theScoreboard; + } + + public boolean isLocked() + { + return this.locked; + } + + public void setLocked(boolean locked) + { + this.locked = locked; + } + + public void func_96651_a(List p_96651_1_) + { + this.setScorePoints(this.theScoreObjective.getCriteria().setScore(p_96651_1_)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java new file mode 100644 index 0000000..e9ecc3d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java @@ -0,0 +1,35 @@ +package net.minecraft.scoreboard; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; + +public class ScoreDummyCriteria implements IScoreObjectiveCriteria +{ + private final String dummyName; + + public ScoreDummyCriteria(String name) + { + this.dummyName = name; + IScoreObjectiveCriteria.INSTANCES.put(name, this); + } + + public String getName() + { + return this.dummyName; + } + + public int setScore(List p_96635_1_) + { + return 0; + } + + public boolean isReadOnly() + { + return false; + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() + { + return IScoreObjectiveCriteria.EnumRenderType.INTEGER; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java new file mode 100644 index 0000000..27b324c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java @@ -0,0 +1,40 @@ +package net.minecraft.scoreboard; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; + +public class ScoreHealthCriteria extends ScoreDummyCriteria +{ + public ScoreHealthCriteria(String name) + { + super(name); + } + + public int setScore(List p_96635_1_) + { + float f = 0.0F; + + for (EntityPlayer entityplayer : p_96635_1_) + { + f += entityplayer.getHealth() + entityplayer.getAbsorptionAmount(); + } + + if (p_96635_1_.size() > 0) + { + f /= (float)p_96635_1_.size(); + } + + return MathHelper.ceiling_float_int(f); + } + + public boolean isReadOnly() + { + return true; + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() + { + return IScoreObjectiveCriteria.EnumRenderType.HEARTS; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreObjective.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreObjective.java new file mode 100644 index 0000000..04c77f9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreObjective.java @@ -0,0 +1,56 @@ +package net.minecraft.scoreboard; + +public class ScoreObjective +{ + private final Scoreboard theScoreboard; + private final String name; + private final IScoreObjectiveCriteria objectiveCriteria; + private IScoreObjectiveCriteria.EnumRenderType renderType; + private String displayName; + + public ScoreObjective(Scoreboard theScoreboardIn, String nameIn, IScoreObjectiveCriteria objectiveCriteriaIn) + { + this.theScoreboard = theScoreboardIn; + this.name = nameIn; + this.objectiveCriteria = objectiveCriteriaIn; + this.displayName = nameIn; + this.renderType = objectiveCriteriaIn.getRenderType(); + } + + public Scoreboard getScoreboard() + { + return this.theScoreboard; + } + + public String getName() + { + return this.name; + } + + public IScoreObjectiveCriteria getCriteria() + { + return this.objectiveCriteria; + } + + public String getDisplayName() + { + return this.displayName; + } + + public void setDisplayName(String nameIn) + { + this.displayName = nameIn; + this.theScoreboard.onObjectiveDisplayNameChanged(this); + } + + public IScoreObjectiveCriteria.EnumRenderType getRenderType() + { + return this.renderType; + } + + public void setRenderType(IScoreObjectiveCriteria.EnumRenderType type) + { + this.renderType = type; + this.theScoreboard.onObjectiveDisplayNameChanged(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java new file mode 100644 index 0000000..e6018e8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java @@ -0,0 +1,172 @@ +package net.minecraft.scoreboard; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.Set; +import net.minecraft.util.EnumChatFormatting; + +public class ScorePlayerTeam extends Team +{ + private final Scoreboard theScoreboard; + private final String registeredName; + private final Set membershipSet = Sets.newHashSet(); + private String teamNameSPT; + private String namePrefixSPT = ""; + private String colorSuffix = ""; + private boolean allowFriendlyFire = true; + private boolean canSeeFriendlyInvisibles = true; + private Team.EnumVisible nameTagVisibility = Team.EnumVisible.ALWAYS; + private Team.EnumVisible deathMessageVisibility = Team.EnumVisible.ALWAYS; + private EnumChatFormatting chatFormat = EnumChatFormatting.RESET; + + public ScorePlayerTeam(Scoreboard theScoreboardIn, String name) + { + this.theScoreboard = theScoreboardIn; + this.registeredName = name; + this.teamNameSPT = name; + } + + public String getRegisteredName() + { + return this.registeredName; + } + + public String getTeamName() + { + return this.teamNameSPT; + } + + public void setTeamName(String name) + { + if (name == null) + { + throw new IllegalArgumentException("Name cannot be null"); + } + else + { + this.teamNameSPT = name; + this.theScoreboard.sendTeamUpdate(this); + } + } + + public Collection getMembershipCollection() + { + return this.membershipSet; + } + + public String getColorPrefix() + { + return this.namePrefixSPT; + } + + public void setNamePrefix(String prefix) + { + if (prefix == null) + { + throw new IllegalArgumentException("Prefix cannot be null"); + } + else + { + this.namePrefixSPT = prefix; + this.theScoreboard.sendTeamUpdate(this); + } + } + + public String getColorSuffix() + { + return this.colorSuffix; + } + + public void setNameSuffix(String suffix) + { + this.colorSuffix = suffix; + this.theScoreboard.sendTeamUpdate(this); + } + + public String formatString(String input) + { + return this.getColorPrefix() + input + this.getColorSuffix(); + } + + public static String formatPlayerName(Team p_96667_0_, String p_96667_1_) + { + return p_96667_0_ == null ? p_96667_1_ : p_96667_0_.formatString(p_96667_1_); + } + + public boolean getAllowFriendlyFire() + { + return this.allowFriendlyFire; + } + + public void setAllowFriendlyFire(boolean friendlyFire) + { + this.allowFriendlyFire = friendlyFire; + this.theScoreboard.sendTeamUpdate(this); + } + + public boolean getSeeFriendlyInvisiblesEnabled() + { + return this.canSeeFriendlyInvisibles; + } + + public void setSeeFriendlyInvisiblesEnabled(boolean friendlyInvisibles) + { + this.canSeeFriendlyInvisibles = friendlyInvisibles; + this.theScoreboard.sendTeamUpdate(this); + } + + public Team.EnumVisible getNameTagVisibility() + { + return this.nameTagVisibility; + } + + public Team.EnumVisible getDeathMessageVisibility() + { + return this.deathMessageVisibility; + } + + public void setNameTagVisibility(Team.EnumVisible p_178772_1_) + { + this.nameTagVisibility = p_178772_1_; + this.theScoreboard.sendTeamUpdate(this); + } + + public void setDeathMessageVisibility(Team.EnumVisible p_178773_1_) + { + this.deathMessageVisibility = p_178773_1_; + this.theScoreboard.sendTeamUpdate(this); + } + + public int func_98299_i() + { + int i = 0; + + if (this.getAllowFriendlyFire()) + { + i |= 1; + } + + if (this.getSeeFriendlyInvisiblesEnabled()) + { + i |= 2; + } + + return i; + } + + public void func_98298_a(int p_98298_1_) + { + this.setAllowFriendlyFire((p_98298_1_ & 1) > 0); + this.setSeeFriendlyInvisiblesEnabled((p_98298_1_ & 2) > 0); + } + + public void setChatFormat(EnumChatFormatting p_178774_1_) + { + this.chatFormat = p_178774_1_; + } + + public EnumChatFormatting getChatFormat() + { + return this.chatFormat; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Scoreboard.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Scoreboard.java new file mode 100644 index 0000000..4b49c8a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Scoreboard.java @@ -0,0 +1,468 @@ +package net.minecraft.scoreboard; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; + +public class Scoreboard +{ + private final Map scoreObjectives = Maps.newHashMap(); + private final Map> scoreObjectiveCriterias = Maps.>newHashMap(); + private final Map> entitiesScoreObjectives = Maps.>newHashMap(); + private final ScoreObjective[] objectiveDisplaySlots = new ScoreObjective[19]; + private final Map teams = Maps.newHashMap(); + private final Map teamMemberships = Maps.newHashMap(); + private static String[] field_178823_g = null; + + public ScoreObjective getObjective(String name) + { + return (ScoreObjective)this.scoreObjectives.get(name); + } + + public ScoreObjective addScoreObjective(String name, IScoreObjectiveCriteria criteria) + { + if (name.length() > 16) + { + throw new IllegalArgumentException("The objective name \'" + name + "\' is too long!"); + } + else + { + ScoreObjective scoreobjective = this.getObjective(name); + + if (scoreobjective != null) + { + throw new IllegalArgumentException("An objective with the name \'" + name + "\' already exists!"); + } + else + { + scoreobjective = new ScoreObjective(this, name, criteria); + List list = (List)this.scoreObjectiveCriterias.get(criteria); + + if (list == null) + { + list = Lists.newArrayList(); + this.scoreObjectiveCriterias.put(criteria, list); + } + + list.add(scoreobjective); + this.scoreObjectives.put(name, scoreobjective); + this.onScoreObjectiveAdded(scoreobjective); + return scoreobjective; + } + } + } + + public Collection getObjectivesFromCriteria(IScoreObjectiveCriteria criteria) + { + Collection collection = (Collection)this.scoreObjectiveCriterias.get(criteria); + return collection == null ? Lists.newArrayList() : Lists.newArrayList(collection); + } + + public boolean entityHasObjective(String name, ScoreObjective p_178819_2_) + { + Map map = (Map)this.entitiesScoreObjectives.get(name); + + if (map == null) + { + return false; + } + else + { + Score score = (Score)map.get(p_178819_2_); + return score != null; + } + } + + public Score getValueFromObjective(String name, ScoreObjective objective) + { + if (name.length() > 40) + { + throw new IllegalArgumentException("The player name \'" + name + "\' is too long!"); + } + else + { + Map map = (Map)this.entitiesScoreObjectives.get(name); + + if (map == null) + { + map = Maps.newHashMap(); + this.entitiesScoreObjectives.put(name, map); + } + + Score score = (Score)map.get(objective); + + if (score == null) + { + score = new Score(this, objective, name); + map.put(objective, score); + } + + return score; + } + } + + public Collection getSortedScores(ScoreObjective objective) + { + List list = Lists.newArrayList(); + + for (Map map : this.entitiesScoreObjectives.values()) + { + Score score = (Score)map.get(objective); + + if (score != null) + { + list.add(score); + } + } + + Collections.sort(list, Score.scoreComparator); + return list; + } + + public Collection getScoreObjectives() + { + return this.scoreObjectives.values(); + } + + public Collection getObjectiveNames() + { + return this.entitiesScoreObjectives.keySet(); + } + + public void removeObjectiveFromEntity(String name, ScoreObjective objective) + { + if (objective == null) + { + Map map = (Map)this.entitiesScoreObjectives.remove(name); + + if (map != null) + { + this.func_96516_a(name); + } + } + else + { + Map map2 = (Map)this.entitiesScoreObjectives.get(name); + + if (map2 != null) + { + Score score = (Score)map2.remove(objective); + + if (map2.size() < 1) + { + Map map1 = (Map)this.entitiesScoreObjectives.remove(name); + + if (map1 != null) + { + this.func_96516_a(name); + } + } + else if (score != null) + { + this.func_178820_a(name, objective); + } + } + } + } + + public Collection getScores() + { + Collection> collection = this.entitiesScoreObjectives.values(); + List list = Lists.newArrayList(); + + for (Map map : collection) + { + list.addAll(map.values()); + } + + return list; + } + + public Map getObjectivesForEntity(String name) + { + Map map = (Map)this.entitiesScoreObjectives.get(name); + + if (map == null) + { + map = Maps.newHashMap(); + } + + return map; + } + + public void removeObjective(ScoreObjective p_96519_1_) + { + if (p_96519_1_ == null) return; + + this.scoreObjectives.remove(p_96519_1_.getName()); + + for (int i = 0; i < 19; ++i) + { + if (this.getObjectiveInDisplaySlot(i) == p_96519_1_) + { + this.setObjectiveInDisplaySlot(i, null); + } + } + + List list = this.scoreObjectiveCriterias.get(p_96519_1_.getCriteria()); + + if (list != null) + { + list.remove(p_96519_1_); + } + + for (Map map : this.entitiesScoreObjectives.values()) + { + map.remove(p_96519_1_); + } + + this.onScoreObjectiveRemoved(p_96519_1_); + } + + public void setObjectiveInDisplaySlot(int p_96530_1_, ScoreObjective p_96530_2_) + { + this.objectiveDisplaySlots[p_96530_1_] = p_96530_2_; + } + + public ScoreObjective getObjectiveInDisplaySlot(int p_96539_1_) + { + return this.objectiveDisplaySlots[p_96539_1_]; + } + + public ScorePlayerTeam getTeam(String p_96508_1_) + { + return (ScorePlayerTeam)this.teams.get(p_96508_1_); + } + + public ScorePlayerTeam createTeam(String name) + { + if (name.length() > 16) + { + throw new IllegalArgumentException("The team name \'" + name + "\' is too long!"); + } + else + { + ScorePlayerTeam scoreplayerteam = this.getTeam(name); + + if (scoreplayerteam != null) + { + return null; + } + else + { + scoreplayerteam = new ScorePlayerTeam(this, name); + this.teams.put(name, scoreplayerteam); + this.broadcastTeamCreated(scoreplayerteam); + return scoreplayerteam; + } + } + } + + public void removeTeam(ScorePlayerTeam p_96511_1_) + { + if (p_96511_1_ == null) return; + + this.teams.remove(p_96511_1_.getRegisteredName()); + + for (String s : p_96511_1_.getMembershipCollection()) + { + this.teamMemberships.remove(s); + } + + this.func_96513_c(p_96511_1_); + } + + public boolean addPlayerToTeam(String player, String newTeam) + { + if (player.length() > 40) + { + throw new IllegalArgumentException("The player name \'" + player + "\' is too long!"); + } + else if (!this.teams.containsKey(newTeam)) + { + return false; + } + else + { + ScorePlayerTeam scoreplayerteam = this.getTeam(newTeam); + + if (this.getPlayersTeam(player) != null) + { + this.removePlayerFromTeams(player); + } + + this.teamMemberships.put(player, scoreplayerteam); + scoreplayerteam.getMembershipCollection().add(player); + return true; + } + } + + public boolean removePlayerFromTeams(String p_96524_1_) + { + ScorePlayerTeam scoreplayerteam = this.getPlayersTeam(p_96524_1_); + + if (scoreplayerteam != null) + { + this.removePlayerFromTeam(p_96524_1_, scoreplayerteam); + return true; + } + else + { + return false; + } + } + + public void removePlayerFromTeam(String p_96512_1_, ScorePlayerTeam p_96512_2_) + { + if (this.getPlayersTeam(p_96512_1_) != p_96512_2_) + { + throw new IllegalStateException("Player is either on another team or not on any team. Cannot remove from team \'" + p_96512_2_.getRegisteredName() + "\'."); + } + else + { + this.teamMemberships.remove(p_96512_1_); + p_96512_2_.getMembershipCollection().remove(p_96512_1_); + } + } + + public Collection getTeamNames() + { + return this.teams.keySet(); + } + + public Collection getTeams() + { + return this.teams.values(); + } + + public ScorePlayerTeam getPlayersTeam(String p_96509_1_) + { + return (ScorePlayerTeam)this.teamMemberships.get(p_96509_1_); + } + + public void onScoreObjectiveAdded(ScoreObjective scoreObjectiveIn) + { + } + + public void onObjectiveDisplayNameChanged(ScoreObjective p_96532_1_) + { + } + + public void onScoreObjectiveRemoved(ScoreObjective p_96533_1_) + { + } + + public void func_96536_a(Score p_96536_1_) + { + } + + public void func_96516_a(String p_96516_1_) + { + } + + public void func_178820_a(String p_178820_1_, ScoreObjective p_178820_2_) + { + } + + public void broadcastTeamCreated(ScorePlayerTeam playerTeam) + { + } + + public void sendTeamUpdate(ScorePlayerTeam playerTeam) + { + } + + public void func_96513_c(ScorePlayerTeam playerTeam) + { + } + + public static String getObjectiveDisplaySlot(int p_96517_0_) + { + switch (p_96517_0_) + { + case 0: + return "list"; + + case 1: + return "sidebar"; + + case 2: + return "belowName"; + + default: + if (p_96517_0_ >= 3 && p_96517_0_ <= 18) + { + EnumChatFormatting enumchatformatting = EnumChatFormatting.func_175744_a(p_96517_0_ - 3); + + if (enumchatformatting != null && enumchatformatting != EnumChatFormatting.RESET) + { + return "sidebar.team." + enumchatformatting.getFriendlyName(); + } + } + + return null; + } + } + + public static int getObjectiveDisplaySlotNumber(String p_96537_0_) + { + if (p_96537_0_.equalsIgnoreCase("list")) + { + return 0; + } + else if (p_96537_0_.equalsIgnoreCase("sidebar")) + { + return 1; + } + else if (p_96537_0_.equalsIgnoreCase("belowName")) + { + return 2; + } + else + { + if (p_96537_0_.startsWith("sidebar.team.")) + { + String s = p_96537_0_.substring("sidebar.team.".length()); + EnumChatFormatting enumchatformatting = EnumChatFormatting.getValueByName(s); + + if (enumchatformatting != null && enumchatformatting.getColorIndex() >= 0) + { + return enumchatformatting.getColorIndex() + 3; + } + } + + return -1; + } + } + + public static String[] getDisplaySlotStrings() + { + if (field_178823_g == null) + { + field_178823_g = new String[19]; + + for (int i = 0; i < 19; ++i) + { + field_178823_g[i] = getObjectiveDisplaySlot(i); + } + } + + return field_178823_g; + } + + public void func_181140_a(Entity p_181140_1_) + { + if (p_181140_1_ != null && !(p_181140_1_ instanceof EntityPlayer) && !p_181140_1_.isEntityAlive()) + { + String s = p_181140_1_.getUniqueID().toString(); + this.removeObjectiveFromEntity(s, (ScoreObjective)null); + this.removePlayerFromTeams(s); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java new file mode 100644 index 0000000..4f2e4d2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java @@ -0,0 +1,302 @@ +package net.minecraft.scoreboard; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.WorldSavedData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ScoreboardSaveData extends WorldSavedData +{ + private static final Logger logger = LogManager.getLogger(); + private Scoreboard theScoreboard; + private NBTTagCompound delayedInitNbt; + + public ScoreboardSaveData() + { + this("scoreboard"); + } + + public ScoreboardSaveData(String name) + { + super(name); + } + + public void setScoreboard(Scoreboard scoreboardIn) + { + this.theScoreboard = scoreboardIn; + + if (this.delayedInitNbt != null) + { + this.readFromNBT(this.delayedInitNbt); + } + } + + public void readFromNBT(NBTTagCompound nbt) + { + if (this.theScoreboard == null) + { + this.delayedInitNbt = nbt; + } + else + { + this.readObjectives(nbt.getTagList("Objectives", 10)); + this.readScores(nbt.getTagList("PlayerScores", 10)); + + if (nbt.hasKey("DisplaySlots", 10)) + { + this.readDisplayConfig(nbt.getCompoundTag("DisplaySlots")); + } + + if (nbt.hasKey("Teams", 9)) + { + this.readTeams(nbt.getTagList("Teams", 10)); + } + } + } + + protected void readTeams(NBTTagList p_96498_1_) + { + for (int i = 0; i < p_96498_1_.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = p_96498_1_.getCompoundTagAt(i); + String s = nbttagcompound.getString("Name"); + + if (s.length() > 16) + { + s = s.substring(0, 16); + } + + ScorePlayerTeam scoreplayerteam = this.theScoreboard.createTeam(s); + String s1 = nbttagcompound.getString("DisplayName"); + + if (s1.length() > 32) + { + s1 = s1.substring(0, 32); + } + + scoreplayerteam.setTeamName(s1); + + if (nbttagcompound.hasKey("TeamColor", 8)) + { + scoreplayerteam.setChatFormat(EnumChatFormatting.getValueByName(nbttagcompound.getString("TeamColor"))); + } + + scoreplayerteam.setNamePrefix(nbttagcompound.getString("Prefix")); + scoreplayerteam.setNameSuffix(nbttagcompound.getString("Suffix")); + + if (nbttagcompound.hasKey("AllowFriendlyFire", 99)) + { + scoreplayerteam.setAllowFriendlyFire(nbttagcompound.getBoolean("AllowFriendlyFire")); + } + + if (nbttagcompound.hasKey("SeeFriendlyInvisibles", 99)) + { + scoreplayerteam.setSeeFriendlyInvisiblesEnabled(nbttagcompound.getBoolean("SeeFriendlyInvisibles")); + } + + if (nbttagcompound.hasKey("NameTagVisibility", 8)) + { + Team.EnumVisible team$enumvisible = Team.EnumVisible.func_178824_a(nbttagcompound.getString("NameTagVisibility")); + + if (team$enumvisible != null) + { + scoreplayerteam.setNameTagVisibility(team$enumvisible); + } + } + + if (nbttagcompound.hasKey("DeathMessageVisibility", 8)) + { + Team.EnumVisible team$enumvisible1 = Team.EnumVisible.func_178824_a(nbttagcompound.getString("DeathMessageVisibility")); + + if (team$enumvisible1 != null) + { + scoreplayerteam.setDeathMessageVisibility(team$enumvisible1); + } + } + + this.func_96502_a(scoreplayerteam, nbttagcompound.getTagList("Players", 8)); + } + } + + protected void func_96502_a(ScorePlayerTeam p_96502_1_, NBTTagList p_96502_2_) + { + for (int i = 0; i < p_96502_2_.tagCount(); ++i) + { + this.theScoreboard.addPlayerToTeam(p_96502_2_.getStringTagAt(i), p_96502_1_.getRegisteredName()); + } + } + + protected void readDisplayConfig(NBTTagCompound p_96504_1_) + { + for (int i = 0; i < 19; ++i) + { + if (p_96504_1_.hasKey("slot_" + i, 8)) + { + String s = p_96504_1_.getString("slot_" + i); + ScoreObjective scoreobjective = this.theScoreboard.getObjective(s); + this.theScoreboard.setObjectiveInDisplaySlot(i, scoreobjective); + } + } + } + + protected void readObjectives(NBTTagList nbt) + { + for (int i = 0; i < nbt.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbt.getCompoundTagAt(i); + IScoreObjectiveCriteria iscoreobjectivecriteria = (IScoreObjectiveCriteria)IScoreObjectiveCriteria.INSTANCES.get(nbttagcompound.getString("CriteriaName")); + + if (iscoreobjectivecriteria != null) + { + String s = nbttagcompound.getString("Name"); + + if (s.length() > 16) + { + s = s.substring(0, 16); + } + + ScoreObjective scoreobjective = this.theScoreboard.addScoreObjective(s, iscoreobjectivecriteria); + scoreobjective.setDisplayName(nbttagcompound.getString("DisplayName")); + scoreobjective.setRenderType(IScoreObjectiveCriteria.EnumRenderType.func_178795_a(nbttagcompound.getString("RenderType"))); + } + } + } + + protected void readScores(NBTTagList nbt) + { + for (int i = 0; i < nbt.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbt.getCompoundTagAt(i); + ScoreObjective scoreobjective = this.theScoreboard.getObjective(nbttagcompound.getString("Objective")); + String s = nbttagcompound.getString("Name"); + + if (s.length() > 40) + { + s = s.substring(0, 40); + } + + Score score = this.theScoreboard.getValueFromObjective(s, scoreobjective); + score.setScorePoints(nbttagcompound.getInteger("Score")); + + if (nbttagcompound.hasKey("Locked")) + { + score.setLocked(nbttagcompound.getBoolean("Locked")); + } + } + } + + public void writeToNBT(NBTTagCompound nbt) + { + if (this.theScoreboard == null) + { + logger.warn("Tried to save scoreboard without having a scoreboard..."); + } + else + { + nbt.setTag("Objectives", this.objectivesToNbt()); + nbt.setTag("PlayerScores", this.scoresToNbt()); + nbt.setTag("Teams", this.func_96496_a()); + this.func_96497_d(nbt); + } + } + + protected NBTTagList func_96496_a() + { + NBTTagList nbttaglist = new NBTTagList(); + + for (ScorePlayerTeam scoreplayerteam : this.theScoreboard.getTeams()) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", scoreplayerteam.getRegisteredName()); + nbttagcompound.setString("DisplayName", scoreplayerteam.getTeamName()); + + if (scoreplayerteam.getChatFormat().getColorIndex() >= 0) + { + nbttagcompound.setString("TeamColor", scoreplayerteam.getChatFormat().getFriendlyName()); + } + + nbttagcompound.setString("Prefix", scoreplayerteam.getColorPrefix()); + nbttagcompound.setString("Suffix", scoreplayerteam.getColorSuffix()); + nbttagcompound.setBoolean("AllowFriendlyFire", scoreplayerteam.getAllowFriendlyFire()); + nbttagcompound.setBoolean("SeeFriendlyInvisibles", scoreplayerteam.getSeeFriendlyInvisiblesEnabled()); + nbttagcompound.setString("NameTagVisibility", scoreplayerteam.getNameTagVisibility().internalName); + nbttagcompound.setString("DeathMessageVisibility", scoreplayerteam.getDeathMessageVisibility().internalName); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (String s : scoreplayerteam.getMembershipCollection()) + { + nbttaglist1.appendTag(new NBTTagString(s)); + } + + nbttagcompound.setTag("Players", nbttaglist1); + nbttaglist.appendTag(nbttagcompound); + } + + return nbttaglist; + } + + protected void func_96497_d(NBTTagCompound p_96497_1_) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + for (int i = 0; i < 19; ++i) + { + ScoreObjective scoreobjective = this.theScoreboard.getObjectiveInDisplaySlot(i); + + if (scoreobjective != null) + { + nbttagcompound.setString("slot_" + i, scoreobjective.getName()); + flag = true; + } + } + + if (flag) + { + p_96497_1_.setTag("DisplaySlots", nbttagcompound); + } + } + + protected NBTTagList objectivesToNbt() + { + NBTTagList nbttaglist = new NBTTagList(); + + for (ScoreObjective scoreobjective : this.theScoreboard.getScoreObjectives()) + { + if (scoreobjective.getCriteria() != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", scoreobjective.getName()); + nbttagcompound.setString("CriteriaName", scoreobjective.getCriteria().getName()); + nbttagcompound.setString("DisplayName", scoreobjective.getDisplayName()); + nbttagcompound.setString("RenderType", scoreobjective.getRenderType().func_178796_a()); + nbttaglist.appendTag(nbttagcompound); + } + } + + return nbttaglist; + } + + protected NBTTagList scoresToNbt() + { + NBTTagList nbttaglist = new NBTTagList(); + + for (Score score : this.theScoreboard.getScores()) + { + if (score.getObjective() != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", score.getPlayerName()); + nbttagcompound.setString("Objective", score.getObjective().getName()); + nbttagcompound.setInteger("Score", score.getScorePoints()); + nbttagcompound.setBoolean("Locked", score.isLocked()); + nbttaglist.appendTag(nbttagcompound); + } + } + + return nbttaglist; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java new file mode 100644 index 0000000..97c2049 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java @@ -0,0 +1,252 @@ +package net.minecraft.scoreboard; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.server.MinecraftServer; + +public class ServerScoreboard extends Scoreboard +{ + private final MinecraftServer scoreboardMCServer; + private final Set field_96553_b = Sets.newHashSet(); + private ScoreboardSaveData scoreboardSaveData; + + public ServerScoreboard(MinecraftServer mcServer) + { + this.scoreboardMCServer = mcServer; + } + + public void func_96536_a(Score p_96536_1_) + { + super.func_96536_a(p_96536_1_); + + if (this.field_96553_b.contains(p_96536_1_.getObjective())) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_96536_1_)); + } + + this.markSaveDataDirty(); + } + + public void func_96516_a(String p_96516_1_) + { + super.func_96516_a(p_96516_1_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_96516_1_)); + this.markSaveDataDirty(); + } + + public void func_178820_a(String p_178820_1_, ScoreObjective p_178820_2_) + { + super.func_178820_a(p_178820_1_, p_178820_2_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_178820_1_, p_178820_2_)); + this.markSaveDataDirty(); + } + + public void setObjectiveInDisplaySlot(int p_96530_1_, ScoreObjective p_96530_2_) + { + ScoreObjective scoreobjective = this.getObjectiveInDisplaySlot(p_96530_1_); + super.setObjectiveInDisplaySlot(p_96530_1_, p_96530_2_); + + if (scoreobjective != p_96530_2_ && scoreobjective != null) + { + if (this.func_96552_h(scoreobjective) > 0) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3DPacketDisplayScoreboard(p_96530_1_, p_96530_2_)); + } + else + { + this.sendDisplaySlotRemovalPackets(scoreobjective); + } + } + + if (p_96530_2_ != null) + { + if (this.field_96553_b.contains(p_96530_2_)) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3DPacketDisplayScoreboard(p_96530_1_, p_96530_2_)); + } + else + { + this.func_96549_e(p_96530_2_); + } + } + + this.markSaveDataDirty(); + } + + public boolean addPlayerToTeam(String player, String newTeam) + { + if (super.addPlayerToTeam(player, newTeam)) + { + ScorePlayerTeam scoreplayerteam = this.getTeam(newTeam); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, Arrays.asList(new String[] {player}), 3)); + this.markSaveDataDirty(); + return true; + } + else + { + return false; + } + } + + public void removePlayerFromTeam(String p_96512_1_, ScorePlayerTeam p_96512_2_) + { + super.removePlayerFromTeam(p_96512_1_, p_96512_2_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(p_96512_2_, Arrays.asList(new String[] {p_96512_1_}), 4)); + this.markSaveDataDirty(); + } + + public void onScoreObjectiveAdded(ScoreObjective scoreObjectiveIn) + { + super.onScoreObjectiveAdded(scoreObjectiveIn); + this.markSaveDataDirty(); + } + + public void onObjectiveDisplayNameChanged(ScoreObjective p_96532_1_) + { + super.onObjectiveDisplayNameChanged(p_96532_1_); + + if (this.field_96553_b.contains(p_96532_1_)) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3BPacketScoreboardObjective(p_96532_1_, 2)); + } + + this.markSaveDataDirty(); + } + + public void onScoreObjectiveRemoved(ScoreObjective p_96533_1_) + { + super.onScoreObjectiveRemoved(p_96533_1_); + + if (this.field_96553_b.contains(p_96533_1_)) + { + this.sendDisplaySlotRemovalPackets(p_96533_1_); + } + + this.markSaveDataDirty(); + } + + public void broadcastTeamCreated(ScorePlayerTeam playerTeam) + { + super.broadcastTeamCreated(playerTeam); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(playerTeam, 0)); + this.markSaveDataDirty(); + } + + public void sendTeamUpdate(ScorePlayerTeam playerTeam) + { + super.sendTeamUpdate(playerTeam); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(playerTeam, 2)); + this.markSaveDataDirty(); + } + + public void func_96513_c(ScorePlayerTeam playerTeam) + { + super.func_96513_c(playerTeam); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(playerTeam, 1)); + this.markSaveDataDirty(); + } + + public void func_96547_a(ScoreboardSaveData p_96547_1_) + { + this.scoreboardSaveData = p_96547_1_; + } + + protected void markSaveDataDirty() + { + if (this.scoreboardSaveData != null) + { + this.scoreboardSaveData.markDirty(); + } + } + + public List func_96550_d(ScoreObjective p_96550_1_) + { + List list = Lists.newArrayList(); + list.add(new S3BPacketScoreboardObjective(p_96550_1_, 0)); + + for (int i = 0; i < 19; ++i) + { + if (this.getObjectiveInDisplaySlot(i) == p_96550_1_) + { + list.add(new S3DPacketDisplayScoreboard(i, p_96550_1_)); + } + } + + for (Score score : this.getSortedScores(p_96550_1_)) + { + list.add(new S3CPacketUpdateScore(score)); + } + + return list; + } + + public void func_96549_e(ScoreObjective p_96549_1_) + { + List list = this.func_96550_d(p_96549_1_); + + for (EntityPlayerMP entityplayermp : this.scoreboardMCServer.getConfigurationManager().getPlayerList()) + { + for (Packet packet : list) + { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + + this.field_96553_b.add(p_96549_1_); + } + + public List func_96548_f(ScoreObjective p_96548_1_) + { + List list = Lists.newArrayList(); + list.add(new S3BPacketScoreboardObjective(p_96548_1_, 1)); + + for (int i = 0; i < 19; ++i) + { + if (this.getObjectiveInDisplaySlot(i) == p_96548_1_) + { + list.add(new S3DPacketDisplayScoreboard(i, p_96548_1_)); + } + } + + return list; + } + + public void sendDisplaySlotRemovalPackets(ScoreObjective p_96546_1_) + { + List list = this.func_96548_f(p_96546_1_); + + for (EntityPlayerMP entityplayermp : this.scoreboardMCServer.getConfigurationManager().getPlayerList()) + { + for (Packet packet : list) + { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + + this.field_96553_b.remove(p_96546_1_); + } + + public int func_96552_h(ScoreObjective p_96552_1_) + { + int i = 0; + + for (int j = 0; j < 19; ++j) + { + if (this.getObjectiveInDisplaySlot(j) == p_96552_1_) + { + ++i; + } + } + + return i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Team.java b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Team.java new file mode 100644 index 0000000..f20eb40 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/scoreboard/Team.java @@ -0,0 +1,62 @@ +package net.minecraft.scoreboard; + +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.Map; + +public abstract class Team +{ + public boolean isSameTeam(Team other) + { + return other == null ? false : this == other; + } + + public abstract String getRegisteredName(); + + public abstract String formatString(String input); + + public abstract boolean getSeeFriendlyInvisiblesEnabled(); + + public abstract boolean getAllowFriendlyFire(); + + public abstract Team.EnumVisible getNameTagVisibility(); + + public abstract Collection getMembershipCollection(); + + public abstract Team.EnumVisible getDeathMessageVisibility(); + + public static enum EnumVisible + { + ALWAYS("always", 0), + NEVER("never", 1), + HIDE_FOR_OTHER_TEAMS("hideForOtherTeams", 2), + HIDE_FOR_OWN_TEAM("hideForOwnTeam", 3); + + private static Map field_178828_g = Maps.newHashMap(); + public final String internalName; + public final int id; + + public static String[] func_178825_a() + { + return (String[])field_178828_g.keySet().toArray(new String[field_178828_g.size()]); + } + + public static Team.EnumVisible func_178824_a(String p_178824_0_) + { + return (Team.EnumVisible)field_178828_g.get(p_178824_0_); + } + + private EnumVisible(String p_i45550_3_, int p_i45550_4_) + { + this.internalName = p_i45550_3_; + this.id = p_i45550_4_; + } + + static { + for (Team.EnumVisible team$enumvisible : values()) + { + field_178828_g.put(team$enumvisible.internalName, team$enumvisible); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/MinecraftServer.java b/Client-1.8.9/src/main/java/net/minecraft/server/MinecraftServer.java new file mode 100644 index 0000000..a2dbc61 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +1,1358 @@ +package net.minecraft.server; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Queues; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListenableFutureTask; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.GameProfileRepository; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufOutputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import java.awt.GraphicsEnvironment; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.Proxy; +import java.security.KeyPair; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Queue; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.Callable; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; +import javax.imageio.ImageIO; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.ServerCommandManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetworkSystem; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.profiler.IPlayerUsage; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.management.PlayerProfileCache; +import net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.IThreadListener; +import net.minecraft.util.ITickable; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Util; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldServerMulti; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.chunk.storage.AnvilSaveConverter; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class MinecraftServer implements Runnable, ICommandSender, IThreadListener, IPlayerUsage +{ + private static final Logger logger = LogManager.getLogger(); + public static final File USER_CACHE_FILE = new File("usercache.json"); + private static MinecraftServer mcServer; + private final ISaveFormat anvilConverterForAnvilFile; + private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("server", this, getCurrentTimeMillis()); + private final File anvilFile; + private final List playersOnline = Lists.newArrayList(); + protected final ICommandManager commandManager; + public final Profiler theProfiler = new Profiler(); + private final NetworkSystem networkSystem; + private final ServerStatusResponse statusResponse = new ServerStatusResponse(); + private final Random random = new Random(); + private int serverPort = -1; + public WorldServer[] worldServers; + private ServerConfigurationManager serverConfigManager; + private boolean serverRunning = true; + private boolean serverStopped; + private int tickCounter; + protected final Proxy serverProxy; + public String currentTask; + public int percentDone; + private boolean onlineMode; + private boolean canSpawnAnimals; + private boolean canSpawnNPCs; + private boolean pvpEnabled; + private boolean allowFlight; + private String motd; + private int buildLimit; + private int maxPlayerIdleMinutes = 0; + public final long[] tickTimeArray = new long[100]; + public long[][] timeOfLastDimensionTick; + private KeyPair serverKeyPair; + private String serverOwner; + private String folderName; + private String worldName; + private boolean isDemo; + private boolean enableBonusChest; + private boolean worldIsBeingDeleted; + private String resourcePackUrl = ""; + private String resourcePackHash = ""; + private boolean serverIsRunning; + private long timeOfLastWarning; + private String userMessage; + private boolean startProfiling; + private boolean isGamemodeForced; + private final YggdrasilAuthenticationService authService; + private final MinecraftSessionService sessionService; + private long nanoTimeSinceStatusRefresh = 0L; + private final GameProfileRepository profileRepo; + private final PlayerProfileCache profileCache; + protected final Queue < FutureTask> futureTaskQueue = Queues. < FutureTask> newArrayDeque(); + private Thread serverThread; + private long currentTime = getCurrentTimeMillis(); + + public MinecraftServer(Proxy proxy, File workDir) + { + this.serverProxy = proxy; + mcServer = this; + this.anvilFile = null; + this.networkSystem = null; + this.profileCache = new PlayerProfileCache(this, workDir); + this.commandManager = null; + this.anvilConverterForAnvilFile = null; + this.authService = new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString()); + this.sessionService = this.authService.createMinecraftSessionService(); + this.profileRepo = this.authService.createProfileRepository(); + } + + public MinecraftServer(File workDir, Proxy proxy, File profileCacheDir) + { + this.serverProxy = proxy; + mcServer = this; + this.anvilFile = workDir; + this.networkSystem = new NetworkSystem(this); + this.profileCache = new PlayerProfileCache(this, profileCacheDir); + this.commandManager = this.createNewCommandManager(); + this.anvilConverterForAnvilFile = new AnvilSaveConverter(workDir); + this.authService = new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString()); + this.sessionService = this.authService.createMinecraftSessionService(); + this.profileRepo = this.authService.createProfileRepository(); + } + + protected ServerCommandManager createNewCommandManager() + { + return new ServerCommandManager(); + } + + protected abstract boolean startServer() throws IOException; + + protected void convertMapIfNeeded(String worldNameIn) + { + if (this.getActiveAnvilConverter().isOldMapFormat(worldNameIn)) + { + logger.info("Converting map!"); + this.setUserMessage("menu.convertingLevel"); + this.getActiveAnvilConverter().convertMapFormat(worldNameIn, new IProgressUpdate() + { + private long startTime = System.currentTimeMillis(); + public void displaySavingString(String message) + { + } + public void resetProgressAndMessage(String message) + { + } + public void setLoadingProgress(int progress) + { + if (System.currentTimeMillis() - this.startTime >= 1000L) + { + this.startTime = System.currentTimeMillis(); + MinecraftServer.logger.info("Converting... " + progress + "%"); + } + } + public void setDoneWorking() + { + } + public void displayLoadingString(String message) + { + } + }); + } + } + + protected synchronized void setUserMessage(String message) + { + this.userMessage = message; + } + + public synchronized String getUserMessage() + { + return this.userMessage; + } + + protected void loadAllWorlds(String saveName, String worldNameIn, long seed, WorldType type, String worldNameIn2) + { + this.convertMapIfNeeded(saveName); + this.setUserMessage("menu.loadingLevel"); + this.worldServers = new WorldServer[3]; + this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; + ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(saveName, true); + this.setResourcePackFromWorld(this.getFolderName(), isavehandler); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + WorldSettings worldsettings; + + if (worldinfo == null) + { + if (this.isDemo()) + { + worldsettings = DemoWorldServer.demoWorldSettings; + } + else + { + worldsettings = new WorldSettings(seed, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), type); + worldsettings.setWorldName(worldNameIn2); + + if (this.enableBonusChest) + { + worldsettings.enableBonusChest(); + } + } + + worldinfo = new WorldInfo(worldsettings, worldNameIn); + } + else + { + worldinfo.setWorldName(worldNameIn); + worldsettings = new WorldSettings(worldinfo); + } + + for (int i = 0; i < this.worldServers.length; ++i) + { + int j = 0; + + if (i == 1) + { + j = -1; + } + + if (i == 2) + { + j = 1; + } + + if (i == 0) + { + if (this.isDemo()) + { + this.worldServers[i] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); + } + else + { + this.worldServers[i] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); + } + + this.worldServers[i].initialize(worldsettings); + } + else + { + this.worldServers[i] = (WorldServer)(new WorldServerMulti(this, isavehandler, j, this.worldServers[0], this.theProfiler)).init(); + } + + this.worldServers[i].addWorldAccess(new WorldManager(this, this.worldServers[i])); + + if (!this.isSinglePlayer()) + { + this.worldServers[i].getWorldInfo().setGameType(this.getGameType()); + } + } + + this.serverConfigManager.setPlayerManager(this.worldServers); + this.setDifficultyForAllWorlds(this.getDifficulty()); + this.initialWorldChunkLoad(); + } + + protected void initialWorldChunkLoad() + { + int i = 16; + int j = 4; + int k = 192; + int l = 625; + int i1 = 0; + this.setUserMessage("menu.generatingTerrain"); + int j1 = 0; + logger.info("Preparing start region for level " + j1); + WorldServer worldserver = this.worldServers[j1]; + BlockPos blockpos = worldserver.getSpawnPoint(); + long k1 = getCurrentTimeMillis(); + + for (int l1 = -192; l1 <= 192 && this.isServerRunning(); l1 += 16) + { + for (int i2 = -192; i2 <= 192 && this.isServerRunning(); i2 += 16) + { + long j2 = getCurrentTimeMillis(); + + if (j2 - k1 > 1000L) + { + this.outputPercentRemaining("Preparing spawn area", i1 * 100 / 625); + k1 = j2; + } + + ++i1; + worldserver.theChunkProviderServer.loadChunk(blockpos.getX() + l1 >> 4, blockpos.getZ() + i2 >> 4); + } + } + + this.clearCurrentTask(); + } + + protected void setResourcePackFromWorld(String worldNameIn, ISaveHandler saveHandlerIn) + { + File file1 = new File(saveHandlerIn.getWorldDirectory(), "resources.zip"); + + if (file1.isFile()) + { + this.setResourcePack("level://" + worldNameIn + "/" + file1.getName(), ""); + } + } + + public abstract boolean canStructuresSpawn(); + + public abstract WorldSettings.GameType getGameType(); + + public abstract EnumDifficulty getDifficulty(); + + public abstract boolean isHardcore(); + + public abstract int getOpPermissionLevel(); + + public abstract boolean shouldBroadcastRconToOps(); + + public abstract boolean shouldBroadcastConsoleToOps(); + + protected void outputPercentRemaining(String message, int percent) + { + this.currentTask = message; + this.percentDone = percent; + logger.info(message + ": " + percent + "%"); + } + + protected void clearCurrentTask() + { + this.currentTask = null; + this.percentDone = 0; + } + + protected void saveAllWorlds(boolean dontLog) + { + if (!this.worldIsBeingDeleted) + { + for (WorldServer worldserver : this.worldServers) + { + if (worldserver != null) + { + if (!dontLog) + { + logger.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionName()); + } + + try + { + worldserver.saveAllChunks(true, (IProgressUpdate)null); + } + catch (MinecraftException minecraftexception) + { + logger.warn(minecraftexception.getMessage()); + } + } + } + } + } + + public void stopServer() + { + if (!this.worldIsBeingDeleted) + { + logger.info("Stopping server"); + + if (this.getNetworkSystem() != null) + { + this.getNetworkSystem().terminateEndpoints(); + } + + if (this.serverConfigManager != null) + { + logger.info("Saving players"); + this.serverConfigManager.saveAllPlayerData(); + this.serverConfigManager.removeAllPlayers(); + } + + if (this.worldServers != null) + { + logger.info("Saving worlds"); + this.saveAllWorlds(false); + + for (int i = 0; i < this.worldServers.length; ++i) + { + WorldServer worldserver = this.worldServers[i]; + worldserver.flush(); + } + } + + if (this.usageSnooper.isSnooperRunning()) + { + this.usageSnooper.stopSnooper(); + } + } + } + + public boolean isServerRunning() + { + return this.serverRunning; + } + + public void initiateShutdown() + { + this.serverRunning = false; + } + + protected void setInstance() + { + mcServer = this; + } + + public void run() + { + try + { + if (this.startServer()) + { + this.currentTime = getCurrentTimeMillis(); + long i = 0L; + this.statusResponse.setServerDescription(new ChatComponentText(this.motd)); + this.statusResponse.setProtocolVersionInfo(new ServerStatusResponse.MinecraftProtocolVersionIdentifier("1.8.9", 47)); + this.addFaviconToStatusResponse(this.statusResponse); + + while (this.serverRunning) + { + long k = getCurrentTimeMillis(); + long j = k - this.currentTime; + + if (j > 2000L && this.currentTime - this.timeOfLastWarning >= 15000L) + { + logger.warn("Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", new Object[] {Long.valueOf(j), Long.valueOf(j / 50L)}); + j = 2000L; + this.timeOfLastWarning = this.currentTime; + } + + if (j < 0L) + { + logger.warn("Time ran backwards! Did the system time change?"); + j = 0L; + } + + i += j; + this.currentTime = k; + + if (this.worldServers[0].areAllPlayersAsleep()) + { + this.tick(); + i = 0L; + } + else + { + while (i > 50L) + { + i -= 50L; + this.tick(); + } + } + + Thread.sleep(Math.max(1L, 50L - i)); + this.serverIsRunning = true; + } + } + else + { + this.finalTick((CrashReport)null); + } + } + catch (Throwable throwable1) + { + logger.error("Encountered an unexpected exception", throwable1); + CrashReport crashreport = null; + + if (throwable1 instanceof ReportedException) + { + crashreport = this.addServerInfoToCrashReport(((ReportedException)throwable1).getCrashReport()); + } + else + { + crashreport = this.addServerInfoToCrashReport(new CrashReport("Exception in server tick loop", throwable1)); + } + + File file1 = new File(new File(this.getDataDirectory(), "crash-reports"), "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-server.txt"); + + if (crashreport.saveToFile(file1)) + { + logger.error("This crash report has been saved to: " + file1.getAbsolutePath()); + } + else + { + logger.error("We were unable to save this crash report to disk."); + } + + this.finalTick(crashreport); + } + finally + { + try + { + this.serverStopped = true; + this.stopServer(); + } + catch (Throwable throwable) + { + logger.error("Exception stopping the server", throwable); + } + finally + { + this.systemExitNow(); + } + } + } + + private void addFaviconToStatusResponse(ServerStatusResponse response) + { + File file1 = this.getFile("server-icon.png"); + + if (file1.isFile()) + { + ByteBuf bytebuf = Unpooled.buffer(); + + try + { + BufferedImage bufferedimage = ImageIO.read(file1); + Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]); + Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high", new Object[0]); + ImageIO.write(bufferedimage, "PNG", (OutputStream)(new ByteBufOutputStream(bytebuf))); + ByteBuf bytebuf1 = Base64.encode(bytebuf); + response.setFavicon("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8)); + } + catch (Exception exception) + { + logger.error((String)"Couldn\'t load server icon", (Throwable)exception); + } + finally + { + bytebuf.release(); + } + } + } + + public File getDataDirectory() + { + return new File("."); + } + + protected void finalTick(CrashReport report) + { + } + + protected void systemExitNow() + { + } + + public void tick() + { + long i = System.nanoTime(); + ++this.tickCounter; + + if (this.startProfiling) + { + this.startProfiling = false; + this.theProfiler.profilingEnabled = true; + this.theProfiler.clearProfiling(); + } + + this.theProfiler.startSection("root"); + this.updateTimeLightAndEntities(); + + if (i - this.nanoTimeSinceStatusRefresh >= 5000000000L) + { + this.nanoTimeSinceStatusRefresh = i; + this.statusResponse.setPlayerCountData(new ServerStatusResponse.PlayerCountData(this.getMaxPlayers(), this.getCurrentPlayerCount())); + GameProfile[] agameprofile = new GameProfile[Math.min(this.getCurrentPlayerCount(), 12)]; + int j = MathHelper.getRandomIntegerInRange(this.random, 0, this.getCurrentPlayerCount() - agameprofile.length); + + for (int k = 0; k < agameprofile.length; ++k) + { + agameprofile[k] = ((EntityPlayerMP)this.serverConfigManager.getPlayerList().get(j + k)).getGameProfile(); + } + + Collections.shuffle(Arrays.asList(agameprofile)); + this.statusResponse.getPlayerCountData().setPlayers(agameprofile); + } + + if (this.tickCounter % 900 == 0) + { + this.theProfiler.startSection("save"); + this.serverConfigManager.saveAllPlayerData(); + this.saveAllWorlds(true); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tallying"); + this.tickTimeArray[this.tickCounter % 100] = System.nanoTime() - i; + this.theProfiler.endSection(); + this.theProfiler.startSection("snooper"); + + if (!this.usageSnooper.isSnooperRunning() && this.tickCounter > 100) + { + this.usageSnooper.startSnooper(); + } + + if (this.tickCounter % 6000 == 0) + { + this.usageSnooper.addMemoryStatsToSnooper(); + } + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + public void updateTimeLightAndEntities() + { + this.theProfiler.startSection("jobs"); + + synchronized (this.futureTaskQueue) + { + while (!this.futureTaskQueue.isEmpty()) + { + Util.runTask((FutureTask)this.futureTaskQueue.poll(), logger); + } + } + + this.theProfiler.endStartSection("levels"); + + for (int j = 0; j < this.worldServers.length; ++j) + { + long i = System.nanoTime(); + + if (j == 0 || this.getAllowNether()) + { + WorldServer worldserver = this.worldServers[j]; + this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); + + if (this.tickCounter % 20 == 0) + { + this.theProfiler.startSection("timeSync"); + this.serverConfigManager.sendPacketToAllPlayersInDimension(new S03PacketTimeUpdate(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getBoolean("doDaylightCycle")), worldserver.provider.getDimensionId()); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tick"); + + try + { + worldserver.tick(); + } + catch (Throwable throwable1) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Exception ticking world"); + worldserver.addWorldInfoToCrashReport(crashreport); + throw new ReportedException(crashreport); + } + + try + { + worldserver.updateEntities(); + } + catch (Throwable throwable) + { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Exception ticking world entities"); + worldserver.addWorldInfoToCrashReport(crashreport1); + throw new ReportedException(crashreport1); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("tracker"); + worldserver.getEntityTracker().updateTrackedEntities(); + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + this.timeOfLastDimensionTick[j][this.tickCounter % 100] = System.nanoTime() - i; + } + + this.theProfiler.endStartSection("connection"); + this.getNetworkSystem().networkTick(); + this.theProfiler.endStartSection("players"); + this.serverConfigManager.onTick(); + this.theProfiler.endStartSection("tickables"); + + for (int k = 0; k < this.playersOnline.size(); ++k) + { + ((ITickable)this.playersOnline.get(k)).update(); + } + + this.theProfiler.endSection(); + } + + public boolean getAllowNether() + { + return true; + } + + public void startServerThread() + { + this.serverThread = new Thread(this, "Server thread"); + this.serverThread.start(); + } + + public File getFile(String fileName) + { + return new File(this.getDataDirectory(), fileName); + } + + public void logWarning(String msg) + { + logger.warn(msg); + } + + public WorldServer worldServerForDimension(int dimension) + { + return dimension == -1 ? this.worldServers[1] : (dimension == 1 ? this.worldServers[2] : this.worldServers[0]); + } + + public String getMinecraftVersion() + { + return "1.8.9"; + } + + public int getCurrentPlayerCount() + { + return this.serverConfigManager.getCurrentPlayerCount(); + } + + public int getMaxPlayers() + { + return this.serverConfigManager.getMaxPlayers(); + } + + public String[] getAllUsernames() + { + return this.serverConfigManager.getAllUsernames(); + } + + public GameProfile[] getGameProfiles() + { + return this.serverConfigManager.getAllProfiles(); + } + + public String getServerModName() + { + return "vanilla"; + } + + public CrashReport addServerInfoToCrashReport(CrashReport report) + { + report.getCategory().addCrashSectionCallable("Profiler Position", new Callable() + { + public String call() throws Exception + { + return MinecraftServer.this.theProfiler.profilingEnabled ? MinecraftServer.this.theProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + }); + + if (this.serverConfigManager != null) + { + report.getCategory().addCrashSectionCallable("Player Count", new Callable() + { + public String call() + { + return MinecraftServer.this.serverConfigManager.getCurrentPlayerCount() + " / " + MinecraftServer.this.serverConfigManager.getMaxPlayers() + "; " + MinecraftServer.this.serverConfigManager.getPlayerList(); + } + }); + } + + return report; + } + + public List getTabCompletions(ICommandSender sender, String input, BlockPos pos) + { + List list = Lists.newArrayList(); + + if (input.startsWith("/")) + { + input = input.substring(1); + boolean flag = !input.contains(" "); + List list1 = this.commandManager.getTabCompletionOptions(sender, input, pos); + + if (list1 != null) + { + for (String s2 : list1) + { + if (flag) + { + list.add("/" + s2); + } + else + { + list.add(s2); + } + } + } + + return list; + } + else + { + String[] astring = input.split(" ", -1); + String s = astring[astring.length - 1]; + + for (String s1 : this.serverConfigManager.getAllUsernames()) + { + if (CommandBase.doesStringStartWith(s, s1)) + { + list.add(s1); + } + } + + return list; + } + } + + public static MinecraftServer getServer() + { + return mcServer; + } + + public boolean isAnvilFileSet() + { + return this.anvilFile != null; + } + + public String getName() + { + return "Server"; + } + + public void addChatMessage(IChatComponent component) + { + logger.info(component.getUnformattedText()); + } + + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return true; + } + + public ICommandManager getCommandManager() + { + return this.commandManager; + } + + public KeyPair getKeyPair() + { + return this.serverKeyPair; + } + + public String getServerOwner() + { + return this.serverOwner; + } + + public void setServerOwner(String owner) + { + this.serverOwner = owner; + } + + public boolean isSinglePlayer() + { + return this.serverOwner != null; + } + + public String getFolderName() + { + return this.folderName; + } + + public void setFolderName(String name) + { + this.folderName = name; + } + + public void setWorldName(String p_71246_1_) + { + this.worldName = p_71246_1_; + } + + public String getWorldName() + { + return this.worldName; + } + + public void setKeyPair(KeyPair keyPair) + { + this.serverKeyPair = keyPair; + } + + public void setDifficultyForAllWorlds(EnumDifficulty difficulty) + { + for (int i = 0; i < this.worldServers.length; ++i) + { + World world = this.worldServers[i]; + + if (world != null) + { + if (world.getWorldInfo().isHardcoreModeEnabled()) + { + world.getWorldInfo().setDifficulty(EnumDifficulty.HARD); + world.setAllowedSpawnTypes(true, true); + } + else if (this.isSinglePlayer()) + { + world.getWorldInfo().setDifficulty(difficulty); + world.setAllowedSpawnTypes(world.getDifficulty() != EnumDifficulty.PEACEFUL, true); + } + else + { + world.getWorldInfo().setDifficulty(difficulty); + world.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals); + } + } + } + } + + protected boolean allowSpawnMonsters() + { + return true; + } + + public boolean isDemo() + { + return this.isDemo; + } + + public void setDemo(boolean demo) + { + this.isDemo = demo; + } + + public void canCreateBonusChest(boolean enable) + { + this.enableBonusChest = enable; + } + + public ISaveFormat getActiveAnvilConverter() + { + return this.anvilConverterForAnvilFile; + } + + public void deleteWorldAndStopServer() + { + this.worldIsBeingDeleted = true; + this.getActiveAnvilConverter().flushCache(); + + for (int i = 0; i < this.worldServers.length; ++i) + { + WorldServer worldserver = this.worldServers[i]; + + if (worldserver != null) + { + worldserver.flush(); + } + } + + this.getActiveAnvilConverter().deleteWorldDirectory(this.worldServers[0].getSaveHandler().getWorldDirectoryName()); + this.initiateShutdown(); + } + + public String getResourcePackUrl() + { + return this.resourcePackUrl; + } + + public String getResourcePackHash() + { + return this.resourcePackHash; + } + + public void setResourcePack(String url, String hash) + { + this.resourcePackUrl = url; + this.resourcePackHash = hash; + } + + public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) + { + playerSnooper.addClientStat("whitelist_enabled", Boolean.valueOf(false)); + playerSnooper.addClientStat("whitelist_count", Integer.valueOf(0)); + + if (this.serverConfigManager != null) + { + playerSnooper.addClientStat("players_current", Integer.valueOf(this.getCurrentPlayerCount())); + playerSnooper.addClientStat("players_max", Integer.valueOf(this.getMaxPlayers())); + playerSnooper.addClientStat("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); + } + + playerSnooper.addClientStat("uses_auth", Boolean.valueOf(this.onlineMode)); + playerSnooper.addClientStat("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); + playerSnooper.addClientStat("run_time", Long.valueOf((getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L)); + playerSnooper.addClientStat("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D))); + int i = 0; + + if (this.worldServers != null) + { + for (int j = 0; j < this.worldServers.length; ++j) + { + if (this.worldServers[j] != null) + { + WorldServer worldserver = this.worldServers[j]; + WorldInfo worldinfo = worldserver.getWorldInfo(); + playerSnooper.addClientStat("world[" + i + "][dimension]", Integer.valueOf(worldserver.provider.getDimensionId())); + playerSnooper.addClientStat("world[" + i + "][mode]", worldinfo.getGameType()); + playerSnooper.addClientStat("world[" + i + "][difficulty]", worldserver.getDifficulty()); + playerSnooper.addClientStat("world[" + i + "][hardcore]", Boolean.valueOf(worldinfo.isHardcoreModeEnabled())); + playerSnooper.addClientStat("world[" + i + "][generator_name]", worldinfo.getTerrainType().getWorldTypeName()); + playerSnooper.addClientStat("world[" + i + "][generator_version]", Integer.valueOf(worldinfo.getTerrainType().getGeneratorVersion())); + playerSnooper.addClientStat("world[" + i + "][height]", Integer.valueOf(this.buildLimit)); + playerSnooper.addClientStat("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.getChunkProvider().getLoadedChunkCount())); + ++i; + } + } + } + + playerSnooper.addClientStat("worlds", Integer.valueOf(i)); + } + + public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) + { + playerSnooper.addStatToSnooper("singleplayer", Boolean.valueOf(this.isSinglePlayer())); + playerSnooper.addStatToSnooper("server_brand", this.getServerModName()); + playerSnooper.addStatToSnooper("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); + playerSnooper.addStatToSnooper("dedicated", Boolean.valueOf(this.isDedicatedServer())); + } + + public boolean isSnooperEnabled() + { + return true; + } + + public abstract boolean isDedicatedServer(); + + public boolean isServerInOnlineMode() + { + return this.onlineMode; + } + + public void setOnlineMode(boolean online) + { + this.onlineMode = online; + } + + public boolean getCanSpawnAnimals() + { + return this.canSpawnAnimals; + } + + public void setCanSpawnAnimals(boolean spawnAnimals) + { + this.canSpawnAnimals = spawnAnimals; + } + + public boolean getCanSpawnNPCs() + { + return this.canSpawnNPCs; + } + + public abstract boolean shouldUseNativeTransport(); + + public void setCanSpawnNPCs(boolean spawnNpcs) + { + this.canSpawnNPCs = spawnNpcs; + } + + public boolean isPVPEnabled() + { + return this.pvpEnabled; + } + + public void setAllowPvp(boolean allowPvp) + { + this.pvpEnabled = allowPvp; + } + + public boolean isFlightAllowed() + { + return this.allowFlight; + } + + public void setAllowFlight(boolean allow) + { + this.allowFlight = allow; + } + + public abstract boolean isCommandBlockEnabled(); + + public String getMOTD() + { + return this.motd; + } + + public void setMOTD(String motdIn) + { + this.motd = motdIn; + } + + public int getBuildLimit() + { + return this.buildLimit; + } + + public void setBuildLimit(int maxBuildHeight) + { + this.buildLimit = maxBuildHeight; + } + + public boolean isServerStopped() + { + return this.serverStopped; + } + + public ServerConfigurationManager getConfigurationManager() + { + return this.serverConfigManager; + } + + public void setConfigManager(ServerConfigurationManager configManager) + { + this.serverConfigManager = configManager; + } + + public void setGameType(WorldSettings.GameType gameMode) + { + for (int i = 0; i < this.worldServers.length; ++i) + { + getServer().worldServers[i].getWorldInfo().setGameType(gameMode); + } + } + + public NetworkSystem getNetworkSystem() + { + return this.networkSystem; + } + + public boolean serverIsInRunLoop() + { + return this.serverIsRunning; + } + + public boolean getGuiEnabled() + { + return false; + } + + public abstract String shareToLAN(WorldSettings.GameType type, boolean allowCheats); + + public int getTickCounter() + { + return this.tickCounter; + } + + public void enableProfiling() + { + this.startProfiling = true; + } + + public PlayerUsageSnooper getPlayerUsageSnooper() + { + return this.usageSnooper; + } + + public BlockPos getPosition() + { + return BlockPos.ORIGIN; + } + + public Vec3 getPositionVector() + { + return new Vec3(0.0D, 0.0D, 0.0D); + } + + public World getEntityWorld() + { + return this.worldServers[0]; + } + + public Entity getCommandSenderEntity() + { + return null; + } + + public int getSpawnProtectionSize() + { + return 16; + } + + public boolean isBlockProtected(World worldIn, BlockPos pos, EntityPlayer playerIn) + { + return false; + } + + public boolean getForceGamemode() + { + return this.isGamemodeForced; + } + + public Proxy getServerProxy() + { + return this.serverProxy; + } + + public static long getCurrentTimeMillis() + { + return System.currentTimeMillis(); + } + + public int getMaxPlayerIdleMinutes() + { + return this.maxPlayerIdleMinutes; + } + + public void setPlayerIdleTimeout(int idleTimeout) + { + this.maxPlayerIdleMinutes = idleTimeout; + } + + public IChatComponent getDisplayName() + { + return new ChatComponentText(this.getName()); + } + + public boolean isAnnouncingPlayerAchievements() + { + return true; + } + + public MinecraftSessionService getMinecraftSessionService() + { + return this.sessionService; + } + + public GameProfileRepository getGameProfileRepository() + { + return this.profileRepo; + } + + public PlayerProfileCache getPlayerProfileCache() + { + return this.profileCache; + } + + public ServerStatusResponse getServerStatusResponse() + { + return this.statusResponse; + } + + public void refreshStatusNextTick() + { + this.nanoTimeSinceStatusRefresh = 0L; + } + + public Entity getEntityFromUuid(UUID uuid) + { + for (WorldServer worldserver : this.worldServers) + { + if (worldserver != null) + { + Entity entity = worldserver.getEntityFromUuid(uuid); + + if (entity != null) + { + return entity; + } + } + } + + return null; + } + + public boolean sendCommandFeedback() + { + return getServer().worldServers[0].getGameRules().getBoolean("sendCommandFeedback"); + } + + public void setCommandStat(CommandResultStats.Type type, int amount) + { + } + + public int getMaxWorldSize() + { + return 29999984; + } + + public ListenableFuture callFromMainThread(Callable callable) + { + Validate.notNull(callable); + + if (!this.isCallingFromMinecraftThread() && !this.isServerStopped()) + { + ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable); + + synchronized (this.futureTaskQueue) + { + this.futureTaskQueue.add(listenablefuturetask); + return listenablefuturetask; + } + } + else + { + try + { + return Futures.immediateFuture(callable.call()); + } + catch (Exception exception) + { + return Futures.immediateFailedCheckedFuture(exception); + } + } + } + + public ListenableFuture addScheduledTask(Runnable runnableToSchedule) + { + Validate.notNull(runnableToSchedule); + return this.callFromMainThread(Executors.callable(runnableToSchedule)); + } + + public boolean isCallingFromMinecraftThread() + { + return Thread.currentThread() == this.serverThread; + } + + public int getNetworkCompressionTreshold() + { + return 256; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedPlayerList.java b/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedPlayerList.java new file mode 100644 index 0000000..c06123d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedPlayerList.java @@ -0,0 +1,44 @@ +package net.minecraft.server.integrated; + +import com.mojang.authlib.GameProfile; +import java.net.SocketAddress; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.management.ServerConfigurationManager; + +public class IntegratedPlayerList extends ServerConfigurationManager +{ + private NBTTagCompound hostPlayerData; + + public IntegratedPlayerList(IntegratedServer server) + { + super(server); + this.setViewDistance(10); + } + + protected void writePlayerData(EntityPlayerMP playerIn) + { + if (playerIn.getName().equals(this.getServerInstance().getServerOwner())) + { + this.hostPlayerData = new NBTTagCompound(); + playerIn.writeToNBT(this.hostPlayerData); + } + + super.writePlayerData(playerIn); + } + + public String allowUserToConnect(SocketAddress address, GameProfile profile) + { + return profile.getName().equalsIgnoreCase(this.getServerInstance().getServerOwner()) && this.getPlayerByUsername(profile.getName()) != null ? "That name is already taken." : super.allowUserToConnect(address, profile); + } + + public IntegratedServer getServerInstance() + { + return (IntegratedServer)super.getServerInstance(); + } + + public NBTTagCompound getHostPlayerData() + { + return this.hostPlayerData; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedServer.java b/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedServer.java new file mode 100644 index 0000000..04a2c55 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedServer.java @@ -0,0 +1,662 @@ +package net.minecraft.server.integrated; + +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.Futures; +import java.io.File; +import java.io.IOException; +import java.net.InetAddress; +import java.util.Arrays; +import java.util.concurrent.Callable; +import java.util.concurrent.FutureTask; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ThreadLanServerPing; +import net.minecraft.command.ServerCommandManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketThreadUtil; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.server.MinecraftServer; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.CryptManager; +import net.minecraft.util.HttpUtil; +import net.minecraft.util.Util; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldServerMulti; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; +import net.optifine.ClearWater; +import net.optifine.reflect.Reflector; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class IntegratedServer extends MinecraftServer +{ + private static final Logger logger = LogManager.getLogger(); + + /** The Minecraft instance. */ + private final Minecraft mc; + private final WorldSettings theWorldSettings; + private boolean isGamePaused; + private boolean isPublic; + private ThreadLanServerPing lanServerPing; + private long ticksSaveLast = 0L; + public World difficultyUpdateWorld = null; + public BlockPos difficultyUpdatePos = null; + public DifficultyInstance difficultyLast = null; + + public IntegratedServer(Minecraft mcIn) + { + super(mcIn.getProxy(), new File(mcIn.mcDataDir, USER_CACHE_FILE.getName())); + this.mc = mcIn; + this.theWorldSettings = null; + } + + public IntegratedServer(Minecraft mcIn, String folderName, String worldName, WorldSettings settings) + { + super(new File(mcIn.mcDataDir, "saves"), mcIn.getProxy(), new File(mcIn.mcDataDir, USER_CACHE_FILE.getName())); + this.setServerOwner(mcIn.getSession().getUsername()); + this.setFolderName(folderName); + this.setWorldName(worldName); + this.setDemo(mcIn.isDemo()); + this.canCreateBonusChest(settings.isBonusChestEnabled()); + this.setBuildLimit(256); + this.setConfigManager(new IntegratedPlayerList(this)); + this.mc = mcIn; + this.theWorldSettings = this.isDemo() ? DemoWorldServer.demoWorldSettings : settings; + ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(folderName, false); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + + if (worldinfo != null) + { + NBTTagCompound nbttagcompound = worldinfo.getPlayerNBTTagCompound(); + + if (nbttagcompound != null && nbttagcompound.hasKey("Dimension")) + { + int i = nbttagcompound.getInteger("Dimension"); + PacketThreadUtil.lastDimensionId = i; + this.mc.loadingScreen.setLoadingProgress(-1); + } + } + } + + protected ServerCommandManager createNewCommandManager() + { + return new IntegratedServerCommandManager(); + } + + protected void loadAllWorlds(String saveName, String worldNameIn, long seed, WorldType type, String worldNameIn2) + { + this.convertMapIfNeeded(saveName); + boolean flag = Reflector.DimensionManager.exists(); + + if (!flag) + { + this.worldServers = new WorldServer[3]; + this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; + } + + ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(saveName, true); + this.setResourcePackFromWorld(this.getFolderName(), isavehandler); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + + if (worldinfo == null) + { + worldinfo = new WorldInfo(this.theWorldSettings, worldNameIn); + } + else + { + worldinfo.setWorldName(worldNameIn); + } + + if (flag) + { + WorldServer worldserver = this.isDemo() ? (WorldServer)((WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init()) : (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init(); + worldserver.initialize(this.theWorldSettings); + Integer[] ainteger = (Integer[])((Integer[])Reflector.call(Reflector.DimensionManager_getStaticDimensionIDs, new Object[0])); + Integer[] ainteger1 = ainteger; + int i = ainteger.length; + + for (int j = 0; j < i; ++j) + { + int k = ainteger1[j].intValue(); + WorldServer worldserver1 = k == 0 ? worldserver : (WorldServer)((WorldServer)(new WorldServerMulti(this, isavehandler, k, worldserver, this.theProfiler)).init()); + worldserver1.addWorldAccess(new WorldManager(this, worldserver1)); + + if (!this.isSinglePlayer()) + { + worldserver1.getWorldInfo().setGameType(this.getGameType()); + } + + if (Reflector.EventBus.exists()) + { + Reflector.postForgeBusEvent(Reflector.WorldEvent_Load_Constructor, new Object[] {worldserver1}); + } + } + + this.getConfigurationManager().setPlayerManager(new WorldServer[] {worldserver}); + + if (worldserver.getWorldInfo().getDifficulty() == null) + { + this.setDifficultyForAllWorlds(this.mc.gameSettings.difficulty); + } + } + else + { + for (int l = 0; l < this.worldServers.length; ++l) + { + int i1 = 0; + + if (l == 1) + { + i1 = -1; + } + + if (l == 2) + { + i1 = 1; + } + + if (l == 0) + { + if (this.isDemo()) + { + this.worldServers[l] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, i1, this.theProfiler)).init(); + } + else + { + this.worldServers[l] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, i1, this.theProfiler)).init(); + } + + this.worldServers[l].initialize(this.theWorldSettings); + } + else + { + this.worldServers[l] = (WorldServer)(new WorldServerMulti(this, isavehandler, i1, this.worldServers[0], this.theProfiler)).init(); + } + + this.worldServers[l].addWorldAccess(new WorldManager(this, this.worldServers[l])); + } + + this.getConfigurationManager().setPlayerManager(this.worldServers); + + if (this.worldServers[0].getWorldInfo().getDifficulty() == null) + { + this.setDifficultyForAllWorlds(this.mc.gameSettings.difficulty); + } + } + + this.initialWorldChunkLoad(); + } + + /** + * Initialises the server and starts it. + */ + protected boolean startServer() throws IOException + { + logger.info("Starting integrated minecraft server version 1.9"); + this.setOnlineMode(true); + this.setCanSpawnAnimals(true); + this.setCanSpawnNPCs(true); + this.setAllowPvp(true); + this.setAllowFlight(true); + logger.info("Generating keypair"); + this.setKeyPair(CryptManager.generateKeyPair()); + + if (Reflector.FMLCommonHandler_handleServerAboutToStart.exists()) + { + Object object = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + + if (!Reflector.callBoolean(object, Reflector.FMLCommonHandler_handleServerAboutToStart, new Object[] {this})) + { + return false; + } + } + + this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.getWorldName()); + this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName()); + + if (Reflector.FMLCommonHandler_handleServerStarting.exists()) + { + Object object1 = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + + if (Reflector.FMLCommonHandler_handleServerStarting.getReturnType() == Boolean.TYPE) + { + return Reflector.callBoolean(object1, Reflector.FMLCommonHandler_handleServerStarting, new Object[] {this}); + } + + Reflector.callVoid(object1, Reflector.FMLCommonHandler_handleServerStarting, new Object[] {this}); + } + + return true; + } + + /** + * Main function called by run() every loop. + */ + public void tick() + { + this.onTick(); + boolean flag = this.isGamePaused; + this.isGamePaused = Minecraft.getMinecraft().getNetHandler() != null && Minecraft.getMinecraft().isGamePaused(); + + if (!flag && this.isGamePaused) + { + logger.info("Saving and pausing game..."); + this.getConfigurationManager().saveAllPlayerData(); + this.saveAllWorlds(false); + } + + if (this.isGamePaused) + { + synchronized (this.futureTaskQueue) + { + while (!this.futureTaskQueue.isEmpty()) + { + Util.runTask((FutureTask)this.futureTaskQueue.poll(), logger); + } + } + } + else + { + super.tick(); + + if (this.mc.gameSettings.renderDistanceChunks != this.getConfigurationManager().getViewDistance()) + { + logger.info("Changing view distance to {}, from {}", new Object[] {Integer.valueOf(this.mc.gameSettings.renderDistanceChunks), Integer.valueOf(this.getConfigurationManager().getViewDistance())}); + this.getConfigurationManager().setViewDistance(this.mc.gameSettings.renderDistanceChunks); + } + + if (this.mc.theWorld != null) + { + WorldInfo worldinfo1 = this.worldServers[0].getWorldInfo(); + WorldInfo worldinfo = this.mc.theWorld.getWorldInfo(); + + if (!worldinfo1.isDifficultyLocked() && worldinfo.getDifficulty() != worldinfo1.getDifficulty()) + { + logger.info("Changing difficulty to {}, from {}", new Object[] {worldinfo.getDifficulty(), worldinfo1.getDifficulty()}); + this.setDifficultyForAllWorlds(worldinfo.getDifficulty()); + } + else if (worldinfo.isDifficultyLocked() && !worldinfo1.isDifficultyLocked()) + { + logger.info("Locking difficulty to {}", new Object[] {worldinfo.getDifficulty()}); + + for (WorldServer worldserver : this.worldServers) + { + if (worldserver != null) + { + worldserver.getWorldInfo().setDifficultyLocked(true); + } + } + } + } + } + } + + public boolean canStructuresSpawn() + { + return false; + } + + public WorldSettings.GameType getGameType() + { + return this.theWorldSettings.getGameType(); + } + + /** + * Get the server's difficulty + */ + public EnumDifficulty getDifficulty() + { + return this.mc.theWorld == null ? this.mc.gameSettings.difficulty : this.mc.theWorld.getWorldInfo().getDifficulty(); + } + + /** + * Defaults to false. + */ + public boolean isHardcore() + { + return this.theWorldSettings.getHardcoreEnabled(); + } + + /** + * Get if RCON command events should be broadcast to ops + */ + public boolean shouldBroadcastRconToOps() + { + return true; + } + + /** + * Get if console command events should be broadcast to ops + */ + public boolean shouldBroadcastConsoleToOps() + { + return true; + } + + /** + * par1 indicates if a log message should be output. + */ + public void saveAllWorlds(boolean dontLog) + { + if (dontLog) + { + int i = this.getTickCounter(); + int j = this.mc.gameSettings.ofAutoSaveTicks; + + if ((long)i < this.ticksSaveLast + (long)j) + { + return; + } + + this.ticksSaveLast = (long)i; + } + + super.saveAllWorlds(dontLog); + } + + public File getDataDirectory() + { + return this.mc.mcDataDir; + } + + public boolean isDedicatedServer() + { + return false; + } + + /** + * Get if native transport should be used. Native transport means linux server performance improvements and + * optimized packet sending/receiving on linux + */ + public boolean shouldUseNativeTransport() + { + return false; + } + + /** + * Called on exit from the main run() loop. + */ + protected void finalTick(CrashReport report) + { + this.mc.crashed(report); + } + + /** + * Adds the server info, including from theWorldServer, to the crash report. + */ + public CrashReport addServerInfoToCrashReport(CrashReport report) + { + report = super.addServerInfoToCrashReport(report); + report.getCategory().addCrashSectionCallable("Type", new Callable() + { + public String call() throws Exception + { + return "Integrated Server (map_client.txt)"; + } + }); + report.getCategory().addCrashSectionCallable("Is Modded", new Callable() + { + public String call() throws Exception + { + String s = ClientBrandRetriever.getClientModName(); + + if (!s.equals("vanilla")) + { + return "Definitely; Client brand changed to \'" + s + "\'"; + } + else + { + s = IntegratedServer.this.getServerModName(); + return !s.equals("vanilla") ? "Definitely; Server brand changed to \'" + s + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and both client + server brands are untouched."); + } + } + }); + return report; + } + + public void setDifficultyForAllWorlds(EnumDifficulty difficulty) + { + super.setDifficultyForAllWorlds(difficulty); + + if (this.mc.theWorld != null) + { + this.mc.theWorld.getWorldInfo().setDifficulty(difficulty); + } + } + + public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) + { + super.addServerStatsToSnooper(playerSnooper); + playerSnooper.addClientStat("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() + { + return Minecraft.getMinecraft().isSnooperEnabled(); + } + + /** + * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. + */ + public String shareToLAN(WorldSettings.GameType type, boolean allowCheats) + { + try + { + int i = -1; + + try + { + i = HttpUtil.getSuitableLanPort(); + } + catch (IOException var5) + { + ; + } + + if (i <= 0) + { + i = 25564; + } + + this.getNetworkSystem().addLanEndpoint((InetAddress)null, i); + logger.info("Started on " + i); + this.isPublic = true; + this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), i + ""); + this.lanServerPing.start(); + this.getConfigurationManager().setGameType(type); + this.getConfigurationManager().setCommandsAllowedForAll(allowCheats); + return i + ""; + } + catch (IOException var6) + { + return null; + } + } + + /** + * Saves all necessary data as preparation for stopping the server. + */ + public void stopServer() + { + super.stopServer(); + + if (this.lanServerPing != null) + { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } + } + + /** + * Sets the serverRunning variable to false, in order to get the server to shut down. + */ + public void initiateShutdown() + { + if (!Reflector.MinecraftForge.exists() || this.isServerRunning()) + { + Futures.getUnchecked(this.addScheduledTask(new Runnable() + { + public void run() + { + for (EntityPlayerMP entityplayermp : Lists.newArrayList(IntegratedServer.this.getConfigurationManager().getPlayerList())) + { + IntegratedServer.this.getConfigurationManager().playerLoggedOut(entityplayermp); + } + } + })); + } + + super.initiateShutdown(); + + if (this.lanServerPing != null) + { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } + } + + public void setStaticInstance() + { + this.setInstance(); + } + + /** + * Returns true if this integrated server is open to LAN + */ + public boolean getPublic() + { + return this.isPublic; + } + + /** + * Sets the game type for all worlds. + */ + public void setGameType(WorldSettings.GameType gameMode) + { + this.getConfigurationManager().setGameType(gameMode); + } + + /** + * Return whether command blocks are enabled. + */ + public boolean isCommandBlockEnabled() + { + return true; + } + + public int getOpPermissionLevel() + { + return 4; + } + + private void onTick() + { + for (WorldServer worldserver : Arrays.asList(this.worldServers)) + { + this.onTick(worldserver); + } + } + + public DifficultyInstance getDifficultyAsync(World p_getDifficultyAsync_1_, BlockPos p_getDifficultyAsync_2_) + { + this.difficultyUpdateWorld = p_getDifficultyAsync_1_; + this.difficultyUpdatePos = p_getDifficultyAsync_2_; + return this.difficultyLast; + } + + private void onTick(WorldServer p_onTick_1_) + { + if (!Config.isTimeDefault()) + { + this.fixWorldTime(p_onTick_1_); + } + + if (!Config.isWeatherEnabled()) + { + this.fixWorldWeather(p_onTick_1_); + } + + if (Config.waterOpacityChanged) + { + Config.waterOpacityChanged = false; + ClearWater.updateWaterOpacity(Config.getGameSettings(), p_onTick_1_); + } + + if (this.difficultyUpdateWorld == p_onTick_1_ && this.difficultyUpdatePos != null) + { + this.difficultyLast = p_onTick_1_.getDifficultyForLocation(this.difficultyUpdatePos); + this.difficultyUpdateWorld = null; + this.difficultyUpdatePos = null; + } + } + + private void fixWorldWeather(WorldServer p_fixWorldWeather_1_) + { + WorldInfo worldinfo = p_fixWorldWeather_1_.getWorldInfo(); + + if (worldinfo.isRaining() || worldinfo.isThundering()) + { + worldinfo.setRainTime(0); + worldinfo.setRaining(false); + p_fixWorldWeather_1_.setRainStrength(0.0F); + worldinfo.setThunderTime(0); + worldinfo.setThundering(false); + p_fixWorldWeather_1_.setThunderStrength(0.0F); + this.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(2, 0.0F)); + this.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(7, 0.0F)); + this.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(8, 0.0F)); + } + } + + private void fixWorldTime(WorldServer p_fixWorldTime_1_) + { + WorldInfo worldinfo = p_fixWorldTime_1_.getWorldInfo(); + + if (worldinfo.getGameType().getID() == 1) + { + long i = p_fixWorldTime_1_.getWorldTime(); + long j = i % 24000L; + + if (Config.isTimeDayOnly()) + { + if (j <= 1000L) + { + p_fixWorldTime_1_.setWorldTime(i - j + 1001L); + } + + if (j >= 11000L) + { + p_fixWorldTime_1_.setWorldTime(i - j + 24001L); + } + } + + if (Config.isTimeNightOnly()) + { + if (j <= 14000L) + { + p_fixWorldTime_1_.setWorldTime(i - j + 14001L); + } + + if (j >= 22000L) + { + p_fixWorldTime_1_.setWorldTime(i - j + 24000L + 14001L); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedServerCommandManager.java b/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedServerCommandManager.java new file mode 100644 index 0000000..b7b93f4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/integrated/IntegratedServerCommandManager.java @@ -0,0 +1,7 @@ +package net.minecraft.server.integrated; + +import net.minecraft.command.ServerCommandManager; + +public class IntegratedServerCommandManager extends ServerCommandManager +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/BanEntry.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/BanEntry.java new file mode 100644 index 0000000..8dd02cc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/BanEntry.java @@ -0,0 +1,78 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +public abstract class BanEntry extends UserListEntry +{ + public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); + protected final Date banStartDate; + protected final String bannedBy; + protected final Date banEndDate; + protected final String reason; + + public BanEntry(T valueIn, Date startDate, String banner, Date endDate, String banReason) + { + super(valueIn); + this.banStartDate = startDate == null ? new Date() : startDate; + this.bannedBy = banner == null ? "(Unknown)" : banner; + this.banEndDate = endDate; + this.reason = banReason == null ? "Banned by an operator." : banReason; + } + + protected BanEntry(T valueIn, JsonObject json) + { + super(valueIn, json); + Date date; + + try + { + date = json.has("created") ? dateFormat.parse(json.get("created").getAsString()) : new Date(); + } + catch (ParseException var7) + { + date = new Date(); + } + + this.banStartDate = date; + this.bannedBy = json.has("source") ? json.get("source").getAsString() : "(Unknown)"; + Date date1; + + try + { + date1 = json.has("expires") ? dateFormat.parse(json.get("expires").getAsString()) : null; + } + catch (ParseException var6) + { + date1 = null; + } + + this.banEndDate = date1; + this.reason = json.has("reason") ? json.get("reason").getAsString() : "Banned by an operator."; + } + + public Date getBanEndDate() + { + return this.banEndDate; + } + + public String getBanReason() + { + return this.reason; + } + + boolean hasBanExpired() + { + return this.banEndDate == null ? false : this.banEndDate.before(new Date()); + } + + protected void onSerialization(JsonObject data) + { + data.addProperty("created", dateFormat.format(this.banStartDate)); + data.addProperty("source", this.bannedBy); + data.addProperty("expires", this.banEndDate == null ? "forever" : dateFormat.format(this.banEndDate)); + data.addProperty("reason", this.reason); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/BanList.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/BanList.java new file mode 100644 index 0000000..5988b8c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/BanList.java @@ -0,0 +1,47 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.io.File; +import java.net.SocketAddress; + +public class BanList extends UserList +{ + public BanList(File bansFile) + { + super(bansFile); + } + + protected UserListEntry createEntry(JsonObject entryData) + { + return new IPBanEntry(entryData); + } + + public boolean isBanned(SocketAddress address) + { + String s = this.addressToString(address); + return this.hasEntry(s); + } + + public IPBanEntry getBanEntry(SocketAddress address) + { + String s = this.addressToString(address); + return (IPBanEntry)this.getEntry(s); + } + + private String addressToString(SocketAddress address) + { + String s = address.toString(); + + if (s.contains("/")) + { + s = s.substring(s.indexOf(47) + 1); + } + + if (s.contains(":")) + { + s = s.substring(0, s.indexOf(58)); + } + + return s; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/IPBanEntry.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/IPBanEntry.java new file mode 100644 index 0000000..8135734 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/IPBanEntry.java @@ -0,0 +1,36 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.util.Date; + +public class IPBanEntry extends BanEntry +{ + public IPBanEntry(String valueIn) + { + this(valueIn, (Date)null, (String)null, (Date)null, (String)null); + } + + public IPBanEntry(String valueIn, Date startDate, String banner, Date endDate, String banReason) + { + super(valueIn, startDate, banner, endDate, banReason); + } + + public IPBanEntry(JsonObject json) + { + super(getIPFromJson(json), json); + } + + private static String getIPFromJson(JsonObject json) + { + return json.has("ip") ? json.get("ip").getAsString() : null; + } + + protected void onSerialization(JsonObject data) + { + if (this.getValue() != null) + { + data.addProperty("ip", (String)this.getValue()); + super.onSerialization(data); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/ItemInWorldManager.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/ItemInWorldManager.java new file mode 100644 index 0000000..26e59a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/ItemInWorldManager.java @@ -0,0 +1,417 @@ +package net.minecraft.server.management; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; + +public class ItemInWorldManager +{ + public World theWorld; + public EntityPlayerMP thisPlayerMP; + private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; + private boolean isDestroyingBlock; + private int initialDamage; + private BlockPos field_180240_f = BlockPos.ORIGIN; + private int curblockDamage; + private boolean receivedFinishDiggingPacket; + private BlockPos field_180241_i = BlockPos.ORIGIN; + private int initialBlockDamage; + private int durabilityRemainingOnBlock = -1; + + public ItemInWorldManager(World worldIn) + { + this.theWorld = worldIn; + } + + public void setGameType(WorldSettings.GameType type) + { + this.gameType = type; + type.configurePlayerCapabilities(this.thisPlayerMP.capabilities); + this.thisPlayerMP.sendPlayerAbilities(); + this.thisPlayerMP.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.UPDATE_GAME_MODE, new EntityPlayerMP[] {this.thisPlayerMP})); + } + + public WorldSettings.GameType getGameType() + { + return this.gameType; + } + + public boolean survivalOrAdventure() + { + return this.gameType.isSurvivalOrAdventure(); + } + + public boolean isCreative() + { + return this.gameType.isCreative(); + } + + public void initializeGameType(WorldSettings.GameType type) + { + if (this.gameType == WorldSettings.GameType.NOT_SET) + { + this.gameType = type; + } + + this.setGameType(this.gameType); + } + + public void updateBlockRemoving() + { + ++this.curblockDamage; + + if (this.receivedFinishDiggingPacket) + { + int i = this.curblockDamage - this.initialBlockDamage; + Block block = this.theWorld.getBlockState(this.field_180241_i).getBlock(); + + if (block.getMaterial() == Material.air) + { + this.receivedFinishDiggingPacket = false; + } + else + { + float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180241_i) * (float)(i + 1); + int j = (int)(f * 10.0F); + + if (j != this.durabilityRemainingOnBlock) + { + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180241_i, j); + this.durabilityRemainingOnBlock = j; + } + + if (f >= 1.0F) + { + this.receivedFinishDiggingPacket = false; + this.tryHarvestBlock(this.field_180241_i); + } + } + } + else if (this.isDestroyingBlock) + { + Block block1 = this.theWorld.getBlockState(this.field_180240_f).getBlock(); + + if (block1.getMaterial() == Material.air) + { + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180240_f, -1); + this.durabilityRemainingOnBlock = -1; + this.isDestroyingBlock = false; + } + else + { + int k = this.curblockDamage - this.initialDamage; + float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180241_i) * (float)(k + 1); + int l = (int)(f1 * 10.0F); + + if (l != this.durabilityRemainingOnBlock) + { + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180240_f, l); + this.durabilityRemainingOnBlock = l; + } + } + } + } + + public void onBlockClicked(BlockPos pos, EnumFacing side) + { + if (this.isCreative()) + { + if (!this.theWorld.extinguishFire((EntityPlayer)null, pos, side)) + { + this.tryHarvestBlock(pos); + } + } + else + { + Block block = this.theWorld.getBlockState(pos).getBlock(); + + if (this.gameType.isAdventure()) + { + if (this.gameType == WorldSettings.GameType.SPECTATOR) + { + return; + } + + if (!this.thisPlayerMP.isAllowEdit()) + { + ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); + + if (itemstack == null) + { + return; + } + + if (!itemstack.canDestroy(block)) + { + return; + } + } + } + + this.theWorld.extinguishFire((EntityPlayer)null, pos, side); + this.initialDamage = this.curblockDamage; + float f = 1.0F; + + if (block.getMaterial() != Material.air) + { + block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); + f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos); + } + + if (block.getMaterial() != Material.air && f >= 1.0F) + { + this.tryHarvestBlock(pos); + } + else + { + this.isDestroyingBlock = true; + this.field_180240_f = pos; + int i = (int)(f * 10.0F); + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), pos, i); + this.durabilityRemainingOnBlock = i; + } + } + } + + public void blockRemoving(BlockPos pos) + { + if (pos.equals(this.field_180240_f)) + { + int i = this.curblockDamage - this.initialDamage; + Block block = this.theWorld.getBlockState(pos).getBlock(); + + if (block.getMaterial() != Material.air) + { + float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos) * (float)(i + 1); + + if (f >= 0.7F) + { + this.isDestroyingBlock = false; + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), pos, -1); + this.tryHarvestBlock(pos); + } + else if (!this.receivedFinishDiggingPacket) + { + this.isDestroyingBlock = false; + this.receivedFinishDiggingPacket = true; + this.field_180241_i = pos; + this.initialBlockDamage = this.initialDamage; + } + } + } + } + + public void cancelDestroyingBlock() + { + this.isDestroyingBlock = false; + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180240_f, -1); + } + + private boolean removeBlock(BlockPos pos) + { + IBlockState iblockstate = this.theWorld.getBlockState(pos); + iblockstate.getBlock().onBlockHarvested(this.theWorld, pos, iblockstate, this.thisPlayerMP); + boolean flag = this.theWorld.setBlockToAir(pos); + + if (flag) + { + iblockstate.getBlock().onBlockDestroyedByPlayer(this.theWorld, pos, iblockstate); + } + + return flag; + } + + public boolean tryHarvestBlock(BlockPos pos) + { + if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) + { + return false; + } + else + { + IBlockState iblockstate = this.theWorld.getBlockState(pos); + TileEntity tileentity = this.theWorld.getTileEntity(pos); + + if (this.gameType.isAdventure()) + { + if (this.gameType == WorldSettings.GameType.SPECTATOR) + { + return false; + } + + if (!this.thisPlayerMP.isAllowEdit()) + { + ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); + + if (itemstack == null) + { + return false; + } + + if (!itemstack.canDestroy(iblockstate.getBlock())) + { + return false; + } + } + } + + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, pos, Block.getStateId(iblockstate)); + boolean flag1 = this.removeBlock(pos); + + if (this.isCreative()) + { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(this.theWorld, pos)); + } + else + { + ItemStack itemstack1 = this.thisPlayerMP.getCurrentEquippedItem(); + boolean flag = this.thisPlayerMP.canHarvestBlock(iblockstate.getBlock()); + + if (itemstack1 != null) + { + itemstack1.onBlockDestroyed(this.theWorld, iblockstate.getBlock(), pos, this.thisPlayerMP); + + if (itemstack1.stackSize == 0) + { + this.thisPlayerMP.destroyCurrentEquippedItem(); + } + } + + if (flag1 && flag) + { + iblockstate.getBlock().harvestBlock(this.theWorld, this.thisPlayerMP, pos, iblockstate, tileentity); + } + } + + return flag1; + } + } + + public boolean tryUseItem(EntityPlayer player, World worldIn, ItemStack stack) + { + if (this.gameType == WorldSettings.GameType.SPECTATOR) + { + return false; + } + else + { + int i = stack.stackSize; + int j = stack.getMetadata(); + ItemStack itemstack = stack.useItemRightClick(worldIn, player); + + if (itemstack != stack || itemstack != null && (itemstack.stackSize != i || itemstack.getMaxItemUseDuration() > 0 || itemstack.getMetadata() != j)) + { + player.inventory.mainInventory[player.inventory.currentItem] = itemstack; + + if (this.isCreative()) + { + itemstack.stackSize = i; + + if (itemstack.isItemStackDamageable()) + { + itemstack.setItemDamage(j); + } + } + + if (itemstack.stackSize == 0) + { + player.inventory.mainInventory[player.inventory.currentItem] = null; + } + + if (!player.isUsingItem()) + { + ((EntityPlayerMP)player).sendContainerToPlayer(player.inventoryContainer); + } + + return true; + } + else + { + return false; + } + } + } + + public boolean activateBlockOrUseItem(EntityPlayer player, World worldIn, ItemStack stack, BlockPos pos, EnumFacing side, float offsetX, float offsetY, float offsetZ) + { + if (this.gameType == WorldSettings.GameType.SPECTATOR) + { + TileEntity tileentity = worldIn.getTileEntity(pos); + + if (tileentity instanceof ILockableContainer) + { + Block block = worldIn.getBlockState(pos).getBlock(); + ILockableContainer ilockablecontainer = (ILockableContainer)tileentity; + + if (ilockablecontainer instanceof TileEntityChest && block instanceof BlockChest) + { + ilockablecontainer = ((BlockChest)block).getLockableContainer(worldIn, pos); + } + + if (ilockablecontainer != null) + { + player.displayGUIChest(ilockablecontainer); + return true; + } + } + else if (tileentity instanceof IInventory) + { + player.displayGUIChest((IInventory)tileentity); + return true; + } + + return false; + } + else + { + if (!player.isSneaking() || player.getHeldItem() == null) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + + if (iblockstate.getBlock().onBlockActivated(worldIn, pos, iblockstate, player, side, offsetX, offsetY, offsetZ)) + { + return true; + } + } + + if (stack == null) + { + return false; + } + else if (this.isCreative()) + { + int j = stack.getMetadata(); + int i = stack.stackSize; + boolean flag = stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); + stack.setItemDamage(j); + stack.stackSize = i; + return flag; + } + else + { + return stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); + } + } + } + + public void setWorld(WorldServer serverWorld) + { + this.theWorld = serverWorld; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/LowerStringMap.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/LowerStringMap.java new file mode 100644 index 0000000..ba99178 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/LowerStringMap.java @@ -0,0 +1,75 @@ +package net.minecraft.server.management; + +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +public class LowerStringMap implements Map +{ + private final Map internalMap = Maps.newLinkedHashMap(); + + public int size() + { + return this.internalMap.size(); + } + + public boolean isEmpty() + { + return this.internalMap.isEmpty(); + } + + public boolean containsKey(Object p_containsKey_1_) + { + return this.internalMap.containsKey(p_containsKey_1_.toString().toLowerCase()); + } + + public boolean containsValue(Object p_containsValue_1_) + { + return this.internalMap.containsKey(p_containsValue_1_); + } + + public V get(Object p_get_1_) + { + return this.internalMap.get(p_get_1_.toString().toLowerCase()); + } + + public V put(String p_put_1_, V p_put_2_) + { + return this.internalMap.put(p_put_1_.toLowerCase(), p_put_2_); + } + + public V remove(Object p_remove_1_) + { + return this.internalMap.remove(p_remove_1_.toString().toLowerCase()); + } + + public void putAll(Map p_putAll_1_) + { + for (Entry entry : p_putAll_1_.entrySet()) + { + this.put((String)entry.getKey(), entry.getValue()); + } + } + + public void clear() + { + this.internalMap.clear(); + } + + public Set keySet() + { + return this.internalMap.keySet(); + } + + public Collection values() + { + return this.internalMap.values(); + } + + public Set> entrySet() + { + return this.internalMap.entrySet(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/PlayerManager.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/PlayerManager.java new file mode 100644 index 0000000..504ef27 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/PlayerManager.java @@ -0,0 +1,703 @@ +package net.minecraft.server.management; + +import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.PriorityQueue; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.optifine.ChunkPosComparator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PlayerManager +{ + private static final Logger pmLogger = LogManager.getLogger(); + private final WorldServer theWorldServer; + private final List players = Lists.newArrayList(); + private final LongHashMap playerInstances = new LongHashMap(); + private final List playerInstancesToUpdate = Lists.newArrayList(); + private final List playerInstanceList = Lists.newArrayList(); + + /** + * Number of chunks the server sends to the client. Valid 3<=x<=15. In server.properties. + */ + private int playerViewRadius; + + /** time what is using to check if InhabitedTime should be calculated */ + private long previousTotalWorldTime; + + /** x, z direction vectors: east, south, west, north */ + private final int[][] xzDirectionsConst = new int[][] {{1, 0}, {0, 1}, { -1, 0}, {0, -1}}; + private final Map> mapPlayerPendingEntries = new HashMap(); + + public PlayerManager(WorldServer serverWorld) + { + this.theWorldServer = serverWorld; + this.setPlayerViewRadius(serverWorld.getMinecraftServer().getConfigurationManager().getViewDistance()); + } + + /** + * Returns the WorldServer associated with this PlayerManager + */ + public WorldServer getWorldServer() + { + return this.theWorldServer; + } + + /** + * updates all the player instances that need to be updated + */ + public void updatePlayerInstances() + { + Set>> set = this.mapPlayerPendingEntries.entrySet(); + Iterator iterator = set.iterator(); + + while (iterator.hasNext()) + { + Entry> entry = (Entry)iterator.next(); + Set set1 = (Set)entry.getValue(); + + if (!set1.isEmpty()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)entry.getKey(); + + if (entityplayermp.worldObj != this.theWorldServer) + { + iterator.remove(); + } + else + { + int i = this.playerViewRadius / 3 + 1; + + if (!Config.isLazyChunkLoading()) + { + i = this.playerViewRadius * 2 + 1; + } + + for (ChunkCoordIntPair chunkcoordintpair : this.getNearest(set1, entityplayermp, i)) + { + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos, true); + playermanager$playerinstance.addPlayer(entityplayermp); + set1.remove(chunkcoordintpair); + } + } + } + } + + long j = this.theWorldServer.getTotalWorldTime(); + + if (j - this.previousTotalWorldTime > 8000L) + { + this.previousTotalWorldTime = j; + + for (int k = 0; k < this.playerInstanceList.size(); ++k) + { + PlayerManager.PlayerInstance playermanager$playerinstance1 = (PlayerManager.PlayerInstance)this.playerInstanceList.get(k); + playermanager$playerinstance1.onUpdate(); + playermanager$playerinstance1.processChunk(); + } + } + else + { + for (int l = 0; l < this.playerInstancesToUpdate.size(); ++l) + { + PlayerManager.PlayerInstance playermanager$playerinstance2 = (PlayerManager.PlayerInstance)this.playerInstancesToUpdate.get(l); + playermanager$playerinstance2.onUpdate(); + } + } + + this.playerInstancesToUpdate.clear(); + + if (this.players.isEmpty()) + { + WorldProvider worldprovider = this.theWorldServer.provider; + + if (!worldprovider.canRespawnHere()) + { + this.theWorldServer.theChunkProviderServer.unloadAllChunks(); + } + } + } + + public boolean hasPlayerInstance(int chunkX, int chunkZ) + { + long i = (long)chunkX + 2147483647L | (long)chunkZ + 2147483647L << 32; + return this.playerInstances.getValueByKey(i) != null; + } + + /** + * passi n the chunk x and y and a flag as to whether or not the instance should be made if it doesnt exist + * + * @param chunkX The chunk X coordinate + * @param chunkZ The chunk Z coordinate + * @param createIfAbsent If the player instance should be created if it doesn't exist + */ + private PlayerManager.PlayerInstance getPlayerInstance(int chunkX, int chunkZ, boolean createIfAbsent) + { + long i = (long)chunkX + 2147483647L | (long)chunkZ + 2147483647L << 32; + PlayerManager.PlayerInstance playermanager$playerinstance = (PlayerManager.PlayerInstance)this.playerInstances.getValueByKey(i); + + if (playermanager$playerinstance == null && createIfAbsent) + { + playermanager$playerinstance = new PlayerManager.PlayerInstance(chunkX, chunkZ); + this.playerInstances.add(i, playermanager$playerinstance); + this.playerInstanceList.add(playermanager$playerinstance); + } + + return playermanager$playerinstance; + } + + public void markBlockForUpdate(BlockPos pos) + { + int i = pos.getX() >> 4; + int j = pos.getZ() >> 4; + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(i, j, false); + + if (playermanager$playerinstance != null) + { + playermanager$playerinstance.flagChunkForUpdate(pos.getX() & 15, pos.getY(), pos.getZ() & 15); + } + } + + /** + * Adds an EntityPlayerMP to the PlayerManager and to all player instances within player visibility + * + * @param player The player to add + */ + public void addPlayer(EntityPlayerMP player) + { + int i = (int)player.posX >> 4; + int j = (int)player.posZ >> 4; + player.managedPosX = player.posX; + player.managedPosZ = player.posZ; + int k = Math.min(this.playerViewRadius, 8); + int l = i - k; + int i1 = i + k; + int j1 = j - k; + int k1 = j + k; + Set set = this.getPendingEntriesSafe(player); + + for (int l1 = i - this.playerViewRadius; l1 <= i + this.playerViewRadius; ++l1) + { + for (int i2 = j - this.playerViewRadius; i2 <= j + this.playerViewRadius; ++i2) + { + if (l1 >= l && l1 <= i1 && i2 >= j1 && i2 <= k1) + { + this.getPlayerInstance(l1, i2, true).addPlayer(player); + } + else + { + set.add(new ChunkCoordIntPair(l1, i2)); + } + } + } + + this.players.add(player); + this.filterChunkLoadQueue(player); + } + + /** + * Removes all chunks from the given player's chunk load queue that are not in viewing range of the player. + */ + public void filterChunkLoadQueue(EntityPlayerMP player) + { + List list = Lists.newArrayList(player.loadedChunks); + int i = 0; + int j = this.playerViewRadius; + int k = (int)player.posX >> 4; + int l = (int)player.posZ >> 4; + int i1 = 0; + int j1 = 0; + ChunkCoordIntPair chunkcoordintpair = this.getPlayerInstance(k, l, true).chunkCoords; + player.loadedChunks.clear(); + + if (list.contains(chunkcoordintpair)) + { + player.loadedChunks.add(chunkcoordintpair); + } + + for (int k1 = 1; k1 <= j * 2; ++k1) + { + for (int l1 = 0; l1 < 2; ++l1) + { + int[] aint = this.xzDirectionsConst[i++ % 4]; + + for (int i2 = 0; i2 < k1; ++i2) + { + i1 += aint[0]; + j1 += aint[1]; + chunkcoordintpair = this.getPlayerInstance(k + i1, l + j1, true).chunkCoords; + + if (list.contains(chunkcoordintpair)) + { + player.loadedChunks.add(chunkcoordintpair); + } + } + } + } + + i = i % 4; + + for (int j2 = 0; j2 < j * 2; ++j2) + { + i1 += this.xzDirectionsConst[i][0]; + j1 += this.xzDirectionsConst[i][1]; + chunkcoordintpair = this.getPlayerInstance(k + i1, l + j1, true).chunkCoords; + + if (list.contains(chunkcoordintpair)) + { + player.loadedChunks.add(chunkcoordintpair); + } + } + } + + /** + * Removes an EntityPlayerMP from the PlayerManager. + * + * @param player The player to remove + */ + public void removePlayer(EntityPlayerMP player) + { + this.mapPlayerPendingEntries.remove(player); + int i = (int)player.managedPosX >> 4; + int j = (int)player.managedPosZ >> 4; + + for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) + { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) + { + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(k, l, false); + + if (playermanager$playerinstance != null) + { + playermanager$playerinstance.removePlayer(player); + } + } + } + + this.players.remove(player); + } + + /** + * Determine if two rectangles centered at the given points overlap for the provided radius. Arguments: x1, z1, x2, + * z2, radius. + * + * @param x1 The first X coordinate + * @param z1 The first Z coordinate + * @param x2 The second X coordinate + * @param z2 The second Z coordinate + * @param radius The radius + */ + private boolean overlaps(int x1, int z1, int x2, int z2, int radius) + { + int i = x1 - x2; + int j = z1 - z2; + return i >= -radius && i <= radius ? j >= -radius && j <= radius : false; + } + + /** + * update chunks around a player being moved by server logic (e.g. cart, boat) + * + * @param player The player to update chunks around + */ + public void updateMountedMovingPlayer(EntityPlayerMP player) + { + int i = (int)player.posX >> 4; + int j = (int)player.posZ >> 4; + double d0 = player.managedPosX - player.posX; + double d1 = player.managedPosZ - player.posZ; + double d2 = d0 * d0 + d1 * d1; + + if (d2 >= 64.0D) + { + int k = (int)player.managedPosX >> 4; + int l = (int)player.managedPosZ >> 4; + int i1 = this.playerViewRadius; + int j1 = i - k; + int k1 = j - l; + + if (j1 != 0 || k1 != 0) + { + Set set = this.getPendingEntriesSafe(player); + + for (int l1 = i - i1; l1 <= i + i1; ++l1) + { + for (int i2 = j - i1; i2 <= j + i1; ++i2) + { + if (!this.overlaps(l1, i2, k, l, i1)) + { + if (Config.isLazyChunkLoading()) + { + set.add(new ChunkCoordIntPair(l1, i2)); + } + else + { + this.getPlayerInstance(l1, i2, true).addPlayer(player); + } + } + + if (!this.overlaps(l1 - j1, i2 - k1, i, j, i1)) + { + set.remove(new ChunkCoordIntPair(l1 - j1, i2 - k1)); + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(l1 - j1, i2 - k1, false); + + if (playermanager$playerinstance != null) + { + playermanager$playerinstance.removePlayer(player); + } + } + } + } + + this.filterChunkLoadQueue(player); + player.managedPosX = player.posX; + player.managedPosZ = player.posZ; + } + } + } + + public boolean isPlayerWatchingChunk(EntityPlayerMP player, int chunkX, int chunkZ) + { + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(chunkX, chunkZ, false); + return playermanager$playerinstance != null && playermanager$playerinstance.playersWatchingChunk.contains(player) && !player.loadedChunks.contains(playermanager$playerinstance.chunkCoords); + } + + public void setPlayerViewRadius(int radius) + { + radius = MathHelper.clamp_int(radius, 3, 64); + + if (radius != this.playerViewRadius) + { + int i = radius - this.playerViewRadius; + + for (EntityPlayerMP entityplayermp : Lists.newArrayList(this.players)) + { + int j = (int)entityplayermp.posX >> 4; + int k = (int)entityplayermp.posZ >> 4; + Set set = this.getPendingEntriesSafe(entityplayermp); + + if (i > 0) + { + for (int j1 = j - radius; j1 <= j + radius; ++j1) + { + for (int k1 = k - radius; k1 <= k + radius; ++k1) + { + if (Config.isLazyChunkLoading()) + { + set.add(new ChunkCoordIntPair(j1, k1)); + } + else + { + PlayerManager.PlayerInstance playermanager$playerinstance1 = this.getPlayerInstance(j1, k1, true); + + if (!playermanager$playerinstance1.playersWatchingChunk.contains(entityplayermp)) + { + playermanager$playerinstance1.addPlayer(entityplayermp); + } + } + } + } + } + else + { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) + { + for (int i1 = k - this.playerViewRadius; i1 <= k + this.playerViewRadius; ++i1) + { + if (!this.overlaps(l, i1, j, k, radius)) + { + set.remove(new ChunkCoordIntPair(l, i1)); + PlayerManager.PlayerInstance playermanager$playerinstance = this.getPlayerInstance(l, i1, true); + + if (playermanager$playerinstance != null) + { + playermanager$playerinstance.removePlayer(entityplayermp); + } + } + } + } + } + } + + this.playerViewRadius = radius; + } + } + + /** + * Get the furthest viewable block given player's view distance + */ + public static int getFurthestViewableBlock(int distance) + { + return distance * 16 - 16; + } + + private PriorityQueue getNearest(Set p_getNearest_1_, EntityPlayerMP p_getNearest_2_, int p_getNearest_3_) + { + float f; + + for (f = p_getNearest_2_.rotationYaw + 90.0F; f <= -180.0F; f += 360.0F) + { + ; + } + + while (f > 180.0F) + { + f -= 360.0F; + } + + double d0 = (double)f * 0.017453292519943295D; + double d1 = (double)p_getNearest_2_.rotationPitch; + double d2 = d1 * 0.017453292519943295D; + ChunkPosComparator chunkposcomparator = new ChunkPosComparator(p_getNearest_2_.chunkCoordX, p_getNearest_2_.chunkCoordZ, d0, d2); + Comparator comparator = Collections.reverseOrder(chunkposcomparator); + PriorityQueue priorityqueue = new PriorityQueue(p_getNearest_3_, comparator); + + for (ChunkCoordIntPair chunkcoordintpair : p_getNearest_1_) + { + if (priorityqueue.size() < p_getNearest_3_) + { + priorityqueue.add(chunkcoordintpair); + } + else + { + ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair)priorityqueue.peek(); + + if (chunkposcomparator.compare(chunkcoordintpair, chunkcoordintpair1) < 0) + { + priorityqueue.remove(); + priorityqueue.add(chunkcoordintpair); + } + } + } + + return priorityqueue; + } + + private Set getPendingEntriesSafe(EntityPlayerMP p_getPendingEntriesSafe_1_) + { + Set set = (Set)this.mapPlayerPendingEntries.get(p_getPendingEntriesSafe_1_); + + if (set != null) + { + return set; + } + else + { + int i = Math.min(this.playerViewRadius, 8); + int j = this.playerViewRadius * 2 + 1; + int k = i * 2 + 1; + int l = j * j - k * k; + l = Math.max(l, 16); + HashSet hashset = new HashSet(l); + this.mapPlayerPendingEntries.put(p_getPendingEntriesSafe_1_, hashset); + return hashset; + } + } + + class PlayerInstance + { + private final List playersWatchingChunk = Lists.newArrayList(); + private final ChunkCoordIntPair chunkCoords; + private short[] locationOfBlockChange = new short[64]; + private int numBlocksToUpdate; + private int flagsYAreasToUpdate; + private long previousWorldTime; + + public PlayerInstance(int chunkX, int chunkZ) + { + this.chunkCoords = new ChunkCoordIntPair(chunkX, chunkZ); + PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(chunkX, chunkZ); + } + + public void addPlayer(EntityPlayerMP player) + { + if (this.playersWatchingChunk.contains(player)) + { + PlayerManager.pmLogger.debug("Failed to add player. {} already is in chunk {}, {}", new Object[] {player, Integer.valueOf(this.chunkCoords.chunkXPos), Integer.valueOf(this.chunkCoords.chunkZPos)}); + } + else + { + if (this.playersWatchingChunk.isEmpty()) + { + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + this.playersWatchingChunk.add(player); + player.loadedChunks.add(this.chunkCoords); + } + } + + public void removePlayer(EntityPlayerMP player) + { + if (this.playersWatchingChunk.contains(player)) + { + Chunk chunk = PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos); + + if (chunk.isPopulated()) + { + player.playerNetServerHandler.sendPacket(new S21PacketChunkData(chunk, true, 0)); + } + + this.playersWatchingChunk.remove(player); + player.loadedChunks.remove(this.chunkCoords); + + if (this.playersWatchingChunk.isEmpty()) + { + long i = (long)this.chunkCoords.chunkXPos + 2147483647L | (long)this.chunkCoords.chunkZPos + 2147483647L << 32; + this.increaseInhabitedTime(chunk); + PlayerManager.this.playerInstances.remove(i); + PlayerManager.this.playerInstanceList.remove(this); + + if (this.numBlocksToUpdate > 0) + { + PlayerManager.this.playerInstancesToUpdate.remove(this); + } + + PlayerManager.this.getWorldServer().theChunkProviderServer.dropChunk(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos); + } + } + } + + public void processChunk() + { + this.increaseInhabitedTime(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos)); + } + + private void increaseInhabitedTime(Chunk theChunk) + { + theChunk.setInhabitedTime(theChunk.getInhabitedTime() + PlayerManager.this.theWorldServer.getTotalWorldTime() - this.previousWorldTime); + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + public void flagChunkForUpdate(int x, int y, int z) + { + if (this.numBlocksToUpdate == 0) + { + PlayerManager.this.playerInstancesToUpdate.add(this); + } + + this.flagsYAreasToUpdate |= 1 << (y >> 4); + + if (this.numBlocksToUpdate < 64) + { + short short1 = (short)(x << 12 | z << 8 | y); + + for (int i = 0; i < this.numBlocksToUpdate; ++i) + { + if (this.locationOfBlockChange[i] == short1) + { + return; + } + } + + this.locationOfBlockChange[this.numBlocksToUpdate++] = short1; + } + } + + public void sendToAllPlayersWatchingChunk(Packet thePacket) + { + for (int i = 0; i < this.playersWatchingChunk.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playersWatchingChunk.get(i); + + if (!entityplayermp.loadedChunks.contains(this.chunkCoords)) + { + entityplayermp.playerNetServerHandler.sendPacket(thePacket); + } + } + } + + public void onUpdate() + { + if (this.numBlocksToUpdate != 0) + { + if (this.numBlocksToUpdate == 1) + { + int k1 = (this.locationOfBlockChange[0] >> 12 & 15) + this.chunkCoords.chunkXPos * 16; + int i2 = this.locationOfBlockChange[0] & 255; + int k2 = (this.locationOfBlockChange[0] >> 8 & 15) + this.chunkCoords.chunkZPos * 16; + BlockPos blockpos = new BlockPos(k1, i2, k2); + this.sendToAllPlayersWatchingChunk(new S23PacketBlockChange(PlayerManager.this.theWorldServer, blockpos)); + + if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity()) + { + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos)); + } + } + else if (this.numBlocksToUpdate != 64) + { + this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numBlocksToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos))); + + for (int j1 = 0; j1 < this.numBlocksToUpdate; ++j1) + { + int l1 = (this.locationOfBlockChange[j1] >> 12 & 15) + this.chunkCoords.chunkXPos * 16; + int j2 = this.locationOfBlockChange[j1] & 255; + int l2 = (this.locationOfBlockChange[j1] >> 8 & 15) + this.chunkCoords.chunkZPos * 16; + BlockPos blockpos1 = new BlockPos(l1, j2, l2); + + if (PlayerManager.this.theWorldServer.getBlockState(blockpos1).getBlock().hasTileEntity()) + { + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos1)); + } + } + } + else + { + int i = this.chunkCoords.chunkXPos * 16; + int j = this.chunkCoords.chunkZPos * 16; + this.sendToAllPlayersWatchingChunk(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos), false, this.flagsYAreasToUpdate)); + + for (int k = 0; k < 16; ++k) + { + if ((this.flagsYAreasToUpdate & 1 << k) != 0) + { + int l = k << 4; + List list = PlayerManager.this.theWorldServer.getTileEntitiesIn(i, l, j, i + 16, l + 16, j + 16); + + for (int i1 = 0; i1 < list.size(); ++i1) + { + this.sendTileToAllPlayersWatchingChunk((TileEntity)list.get(i1)); + } + } + } + } + + this.numBlocksToUpdate = 0; + this.flagsYAreasToUpdate = 0; + } + } + + private void sendTileToAllPlayersWatchingChunk(TileEntity theTileEntity) + { + if (theTileEntity != null) + { + Packet packet = theTileEntity.getDescriptionPacket(); + + if (packet != null) + { + this.sendToAllPlayersWatchingChunk(packet); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/PlayerProfileCache.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/PlayerProfileCache.java new file mode 100644 index 0000000..71993ee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/PlayerProfileCache.java @@ -0,0 +1,370 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.mojang.authlib.Agent; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.ProfileLookupCallback; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import org.apache.commons.io.IOUtils; + +public class PlayerProfileCache +{ + public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); + private final Map usernameToProfileEntryMap = Maps.newHashMap(); + private final Map uuidToProfileEntryMap = Maps.newHashMap(); + private final LinkedList gameProfiles = Lists.newLinkedList(); + private final MinecraftServer mcServer; + protected final Gson gson; + private final File usercacheFile; + private static final ParameterizedType TYPE = new ParameterizedType() + { + public Type[] getActualTypeArguments() + { + return new Type[] {PlayerProfileCache.ProfileEntry.class}; + } + public Type getRawType() + { + return List.class; + } + public Type getOwnerType() + { + return null; + } + }; + + public PlayerProfileCache(MinecraftServer server, File cacheFile) + { + this.mcServer = server; + this.usercacheFile = cacheFile; + GsonBuilder gsonbuilder = new GsonBuilder(); + gsonbuilder.registerTypeHierarchyAdapter(PlayerProfileCache.ProfileEntry.class, new PlayerProfileCache.Serializer()); + this.gson = gsonbuilder.create(); + this.load(); + } + + private static GameProfile getGameProfile(MinecraftServer server, String username) + { + final GameProfile[] agameprofile = new GameProfile[1]; + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + agameprofile[0] = p_onProfileLookupSucceeded_1_; + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + agameprofile[0] = null; + } + }; + server.getGameProfileRepository().findProfilesByNames(new String[] {username}, Agent.MINECRAFT, profilelookupcallback); + + if (!server.isServerInOnlineMode() && agameprofile[0] == null) + { + UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, username)); + GameProfile gameprofile = new GameProfile(uuid, username); + profilelookupcallback.onProfileLookupSucceeded(gameprofile); + } + + return agameprofile[0]; + } + + public void addEntry(GameProfile gameProfile) + { + this.addEntry(gameProfile, (Date)null); + } + + private void addEntry(GameProfile gameProfile, Date expirationDate) + { + UUID uuid = gameProfile.getId(); + + if (expirationDate == null) + { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(2, 1); + expirationDate = calendar.getTime(); + } + + String s = gameProfile.getName().toLowerCase(Locale.ROOT); + PlayerProfileCache.ProfileEntry playerprofilecache$profileentry = new PlayerProfileCache.ProfileEntry(gameProfile, expirationDate); + + if (this.uuidToProfileEntryMap.containsKey(uuid)) + { + PlayerProfileCache.ProfileEntry playerprofilecache$profileentry1 = (PlayerProfileCache.ProfileEntry)this.uuidToProfileEntryMap.get(uuid); + this.usernameToProfileEntryMap.remove(playerprofilecache$profileentry1.getGameProfile().getName().toLowerCase(Locale.ROOT)); + this.gameProfiles.remove(gameProfile); + } + + this.usernameToProfileEntryMap.put(gameProfile.getName().toLowerCase(Locale.ROOT), playerprofilecache$profileentry); + this.uuidToProfileEntryMap.put(uuid, playerprofilecache$profileentry); + this.gameProfiles.addFirst(gameProfile); + this.save(); + } + + public GameProfile getGameProfileForUsername(String username) + { + String s = username.toLowerCase(Locale.ROOT); + PlayerProfileCache.ProfileEntry playerprofilecache$profileentry = (PlayerProfileCache.ProfileEntry)this.usernameToProfileEntryMap.get(s); + + if (playerprofilecache$profileentry != null && (new Date()).getTime() >= playerprofilecache$profileentry.expirationDate.getTime()) + { + this.uuidToProfileEntryMap.remove(playerprofilecache$profileentry.getGameProfile().getId()); + this.usernameToProfileEntryMap.remove(playerprofilecache$profileentry.getGameProfile().getName().toLowerCase(Locale.ROOT)); + this.gameProfiles.remove(playerprofilecache$profileentry.getGameProfile()); + playerprofilecache$profileentry = null; + } + + if (playerprofilecache$profileentry != null) + { + GameProfile gameprofile = playerprofilecache$profileentry.getGameProfile(); + this.gameProfiles.remove(gameprofile); + this.gameProfiles.addFirst(gameprofile); + } + else + { + GameProfile gameprofile1 = getGameProfile(this.mcServer, s); + + if (gameprofile1 != null) + { + this.addEntry(gameprofile1); + playerprofilecache$profileentry = (PlayerProfileCache.ProfileEntry)this.usernameToProfileEntryMap.get(s); + } + } + + this.save(); + return playerprofilecache$profileentry == null ? null : playerprofilecache$profileentry.getGameProfile(); + } + + public String[] getUsernames() + { + List list = Lists.newArrayList(this.usernameToProfileEntryMap.keySet()); + return (String[])list.toArray(new String[list.size()]); + } + + public GameProfile getProfileByUUID(UUID uuid) + { + PlayerProfileCache.ProfileEntry playerprofilecache$profileentry = (PlayerProfileCache.ProfileEntry)this.uuidToProfileEntryMap.get(uuid); + return playerprofilecache$profileentry == null ? null : playerprofilecache$profileentry.getGameProfile(); + } + + private PlayerProfileCache.ProfileEntry getByUUID(UUID uuid) + { + PlayerProfileCache.ProfileEntry playerprofilecache$profileentry = (PlayerProfileCache.ProfileEntry)this.uuidToProfileEntryMap.get(uuid); + + if (playerprofilecache$profileentry != null) + { + GameProfile gameprofile = playerprofilecache$profileentry.getGameProfile(); + this.gameProfiles.remove(gameprofile); + this.gameProfiles.addFirst(gameprofile); + } + + return playerprofilecache$profileentry; + } + + public void load() + { + BufferedReader bufferedreader = null; + + try + { + bufferedreader = Files.newReader(this.usercacheFile, Charsets.UTF_8); + List list = (List)this.gson.fromJson((Reader)bufferedreader, TYPE); + this.usernameToProfileEntryMap.clear(); + this.uuidToProfileEntryMap.clear(); + this.gameProfiles.clear(); + + for (PlayerProfileCache.ProfileEntry playerprofilecache$profileentry : Lists.reverse(list)) + { + if (playerprofilecache$profileentry != null) + { + this.addEntry(playerprofilecache$profileentry.getGameProfile(), playerprofilecache$profileentry.getExpirationDate()); + } + } + } + catch (FileNotFoundException var9) + { + ; + } + catch (JsonParseException var10) + { + ; + } + finally + { + IOUtils.closeQuietly((Reader)bufferedreader); + } + } + + public void save() + { + String s = this.gson.toJson((Object)this.getEntriesWithLimit(1000)); + BufferedWriter bufferedwriter = null; + + try + { + bufferedwriter = Files.newWriter(this.usercacheFile, Charsets.UTF_8); + bufferedwriter.write(s); + return; + } + catch (FileNotFoundException var8) + { + ; + } + catch (IOException var9) + { + return; + } + finally + { + IOUtils.closeQuietly((Writer)bufferedwriter); + } + } + + private List getEntriesWithLimit(int limitSize) + { + ArrayList arraylist = Lists.newArrayList(); + + for (GameProfile gameprofile : Lists.newArrayList(Iterators.limit(this.gameProfiles.iterator(), limitSize))) + { + PlayerProfileCache.ProfileEntry playerprofilecache$profileentry = this.getByUUID(gameprofile.getId()); + + if (playerprofilecache$profileentry != null) + { + arraylist.add(playerprofilecache$profileentry); + } + } + + return arraylist; + } + + class ProfileEntry + { + private final GameProfile gameProfile; + private final Date expirationDate; + + private ProfileEntry(GameProfile gameProfileIn, Date expirationDateIn) + { + this.gameProfile = gameProfileIn; + this.expirationDate = expirationDateIn; + } + + public GameProfile getGameProfile() + { + return this.gameProfile; + } + + public Date getExpirationDate() + { + return this.expirationDate; + } + } + + class Serializer implements JsonDeserializer, JsonSerializer + { + private Serializer() + { + } + + public JsonElement serialize(PlayerProfileCache.ProfileEntry p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("name", p_serialize_1_.getGameProfile().getName()); + UUID uuid = p_serialize_1_.getGameProfile().getId(); + jsonobject.addProperty("uuid", uuid == null ? "" : uuid.toString()); + jsonobject.addProperty("expiresOn", PlayerProfileCache.dateFormat.format(p_serialize_1_.getExpirationDate())); + return jsonobject; + } + + public PlayerProfileCache.ProfileEntry deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + if (p_deserialize_1_.isJsonObject()) + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + JsonElement jsonelement = jsonobject.get("name"); + JsonElement jsonelement1 = jsonobject.get("uuid"); + JsonElement jsonelement2 = jsonobject.get("expiresOn"); + + if (jsonelement != null && jsonelement1 != null) + { + String s = jsonelement1.getAsString(); + String s1 = jsonelement.getAsString(); + Date date = null; + + if (jsonelement2 != null) + { + try + { + date = PlayerProfileCache.dateFormat.parse(jsonelement2.getAsString()); + } + catch (ParseException var14) + { + date = null; + } + } + + if (s1 != null && s != null) + { + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable var13) + { + return null; + } + + PlayerProfileCache.ProfileEntry playerprofilecache$profileentry = PlayerProfileCache.this.new ProfileEntry(new GameProfile(uuid, s1), date); + return playerprofilecache$profileentry; + } + else + { + return null; + } + } + else + { + return null; + } + } + else + { + return null; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/PreYggdrasilConverter.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/PreYggdrasilConverter.java new file mode 100644 index 0000000..07793a7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/PreYggdrasilConverter.java @@ -0,0 +1,91 @@ +package net.minecraft.server.management; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.mojang.authlib.Agent; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.ProfileLookupCallback; +import java.io.File; +import java.util.Collection; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PreYggdrasilConverter +{ + private static final Logger LOGGER = LogManager.getLogger(); + public static final File OLD_IPBAN_FILE = new File("banned-ips.txt"); + public static final File OLD_PLAYERBAN_FILE = new File("banned-players.txt"); + public static final File OLD_OPS_FILE = new File("ops.txt"); + public static final File OLD_WHITELIST_FILE = new File("white-list.txt"); + + private static void lookupNames(MinecraftServer server, Collection names, ProfileLookupCallback callback) + { + String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate() + { + public boolean apply(String p_apply_1_) + { + return !StringUtils.isNullOrEmpty(p_apply_1_); + } + }), String.class); + + if (server.isServerInOnlineMode()) + { + server.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback); + } + else + { + for (String s : astring) + { + UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, s)); + GameProfile gameprofile = new GameProfile(uuid, s); + callback.onProfileLookupSucceeded(gameprofile); + } + } + } + + public static String getStringUUIDFromName(String p_152719_0_) + { + if (!StringUtils.isNullOrEmpty(p_152719_0_) && p_152719_0_.length() <= 16) + { + final MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.getPlayerProfileCache().getGameProfileForUsername(p_152719_0_); + + if (gameprofile != null && gameprofile.getId() != null) + { + return gameprofile.getId().toString(); + } + else if (!minecraftserver.isSinglePlayer() && minecraftserver.isServerInOnlineMode()) + { + final List list = Lists.newArrayList(); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + minecraftserver.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_); + list.add(p_onProfileLookupSucceeded_1_); + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + PreYggdrasilConverter.LOGGER.warn((String)("Could not lookup user whitelist entry for " + p_onProfileLookupFailed_1_.getName()), (Throwable)p_onProfileLookupFailed_2_); + } + }; + lookupNames(minecraftserver, Lists.newArrayList(new String[] {p_152719_0_}), profilelookupcallback); + return list.size() > 0 && ((GameProfile)list.get(0)).getId() != null ? ((GameProfile)list.get(0)).getId().toString() : ""; + } + else + { + return EntityPlayer.getUUID(new GameProfile((UUID)null, p_152719_0_)).toString(); + } + } + else + { + return p_152719_0_; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java new file mode 100644 index 0000000..1f6017a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java @@ -0,0 +1,972 @@ +package net.minecraft.server.management; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.mojang.authlib.GameProfile; +import io.netty.buffer.Unpooled; +import java.io.File; +import java.net.SocketAddress; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S41PacketServerDifficulty; +import net.minecraft.network.play.server.S44PacketWorldBorder; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.border.IBorderListener; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.demo.DemoWorldManager; +import net.minecraft.world.storage.IPlayerFileData; +import net.minecraft.world.storage.WorldInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class ServerConfigurationManager +{ + public static final File FILE_PLAYERBANS = new File("banned-players.json"); + public static final File FILE_IPBANS = new File("banned-ips.json"); + public static final File FILE_OPS = new File("ops.json"); + public static final File FILE_WHITELIST = new File("whitelist.json"); + private static final Logger logger = LogManager.getLogger(); + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); + private final MinecraftServer mcServer; + private final List playerEntityList = Lists.newArrayList(); + private final Map uuidToPlayerMap = Maps.newHashMap(); + private final UserListBans bannedPlayers; + private final BanList bannedIPs; + private final UserListOps ops; + private final UserListWhitelist whiteListedPlayers; + private final Map playerStatFiles; + private IPlayerFileData playerNBTManagerObj; + private boolean whiteListEnforced; + protected int maxPlayers; + private int viewDistance; + private WorldSettings.GameType gameType; + private boolean commandsAllowedForAll; + private int playerPingIndex; + + public ServerConfigurationManager(MinecraftServer server) + { + this.bannedPlayers = new UserListBans(FILE_PLAYERBANS); + this.bannedIPs = new BanList(FILE_IPBANS); + this.ops = new UserListOps(FILE_OPS); + this.whiteListedPlayers = new UserListWhitelist(FILE_WHITELIST); + this.playerStatFiles = Maps.newHashMap(); + this.mcServer = server; + this.bannedPlayers.setLanServer(false); + this.bannedIPs.setLanServer(false); + this.maxPlayers = 8; + } + + public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn) + { + GameProfile gameprofile = playerIn.getGameProfile(); + PlayerProfileCache playerprofilecache = this.mcServer.getPlayerProfileCache(); + GameProfile gameprofile1 = playerprofilecache.getProfileByUUID(gameprofile.getId()); + String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); + playerprofilecache.addEntry(gameprofile); + NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(playerIn); + playerIn.setWorld(this.mcServer.worldServerForDimension(playerIn.dimension)); + playerIn.theItemInWorldManager.setWorld((WorldServer)playerIn.worldObj); + String s1 = "local"; + + if (netManager.getRemoteAddress() != null) + { + s1 = netManager.getRemoteAddress().toString(); + } + + logger.info(playerIn.getName() + "[" + s1 + "] logged in with entity id " + playerIn.getEntityId() + " at (" + playerIn.posX + ", " + playerIn.posY + ", " + playerIn.posZ + ")"); + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + WorldInfo worldinfo = worldserver.getWorldInfo(); + BlockPos blockpos = worldserver.getSpawnPoint(); + this.setPlayerGameTypeBasedOnOther(playerIn, (EntityPlayerMP)null, worldserver); + NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.mcServer, netManager, playerIn); + nethandlerplayserver.sendPacket(new S01PacketJoinGame(playerIn.getEntityId(), playerIn.theItemInWorldManager.getGameType(), worldinfo.isHardcoreModeEnabled(), worldserver.provider.getDimensionId(), worldserver.getDifficulty(), this.getMaxPlayers(), worldinfo.getTerrainType(), worldserver.getGameRules().getBoolean("reducedDebugInfo"))); + nethandlerplayserver.sendPacket(new S3FPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(this.getServerInstance().getServerModName()))); + nethandlerplayserver.sendPacket(new S41PacketServerDifficulty(worldinfo.getDifficulty(), worldinfo.isDifficultyLocked())); + nethandlerplayserver.sendPacket(new S05PacketSpawnPosition(blockpos)); + nethandlerplayserver.sendPacket(new S39PacketPlayerAbilities(playerIn.capabilities)); + nethandlerplayserver.sendPacket(new S09PacketHeldItemChange(playerIn.inventory.currentItem)); + playerIn.getStatFile().func_150877_d(); + playerIn.getStatFile().sendAchievements(playerIn); + this.sendScoreboard((ServerScoreboard)worldserver.getScoreboard(), playerIn); + this.mcServer.refreshStatusNextTick(); + ChatComponentTranslation chatcomponenttranslation; + + if (!playerIn.getName().equalsIgnoreCase(s)) + { + chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined.renamed", new Object[] {playerIn.getDisplayName(), s}); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined", new Object[] {playerIn.getDisplayName()}); + } + + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.sendChatMsg(chatcomponenttranslation); + this.playerLoggedIn(playerIn); + nethandlerplayserver.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, playerIn.rotationPitch); + this.updateTimeAndWeatherForPlayer(playerIn, worldserver); + + if (this.mcServer.getResourcePackUrl().length() > 0) + { + playerIn.loadResourcePack(this.mcServer.getResourcePackUrl(), this.mcServer.getResourcePackHash()); + } + + for (PotionEffect potioneffect : playerIn.getActivePotionEffects()) + { + nethandlerplayserver.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect)); + } + + playerIn.addSelfToInternalCraftingInventory(); + + if (nbttagcompound != null && nbttagcompound.hasKey("Riding", 10)) + { + Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver); + + if (entity != null) + { + entity.forceSpawn = true; + worldserver.spawnEntityInWorld(entity); + playerIn.mountEntity(entity); + entity.forceSpawn = false; + } + } + } + + protected void sendScoreboard(ServerScoreboard scoreboardIn, EntityPlayerMP playerIn) + { + Set set = Sets.newHashSet(); + + for (ScorePlayerTeam scoreplayerteam : scoreboardIn.getTeams()) + { + playerIn.playerNetServerHandler.sendPacket(new S3EPacketTeams(scoreplayerteam, 0)); + } + + for (int i = 0; i < 19; ++i) + { + ScoreObjective scoreobjective = scoreboardIn.getObjectiveInDisplaySlot(i); + + if (scoreobjective != null && !set.contains(scoreobjective)) + { + for (Packet packet : scoreboardIn.func_96550_d(scoreobjective)) + { + playerIn.playerNetServerHandler.sendPacket(packet); + } + + set.add(scoreobjective); + } + } + } + + public void setPlayerManager(WorldServer[] worldServers) + { + this.playerNBTManagerObj = worldServers[0].getSaveHandler().getPlayerNBTManager(); + worldServers[0].getWorldBorder().addListener(new IBorderListener() + { + public void onSizeChanged(WorldBorder border, double newSize) + { + ServerConfigurationManager.this.sendPacketToAllPlayers(new S44PacketWorldBorder(border, S44PacketWorldBorder.Action.SET_SIZE)); + } + public void onTransitionStarted(WorldBorder border, double oldSize, double newSize, long time) + { + ServerConfigurationManager.this.sendPacketToAllPlayers(new S44PacketWorldBorder(border, S44PacketWorldBorder.Action.LERP_SIZE)); + } + public void onCenterChanged(WorldBorder border, double x, double z) + { + ServerConfigurationManager.this.sendPacketToAllPlayers(new S44PacketWorldBorder(border, S44PacketWorldBorder.Action.SET_CENTER)); + } + public void onWarningTimeChanged(WorldBorder border, int newTime) + { + ServerConfigurationManager.this.sendPacketToAllPlayers(new S44PacketWorldBorder(border, S44PacketWorldBorder.Action.SET_WARNING_TIME)); + } + public void onWarningDistanceChanged(WorldBorder border, int newDistance) + { + ServerConfigurationManager.this.sendPacketToAllPlayers(new S44PacketWorldBorder(border, S44PacketWorldBorder.Action.SET_WARNING_BLOCKS)); + } + public void onDamageAmountChanged(WorldBorder border, double newAmount) + { + } + public void onDamageBufferChanged(WorldBorder border, double newSize) + { + } + }); + } + + public void preparePlayer(EntityPlayerMP playerIn, WorldServer worldIn) + { + WorldServer worldserver = playerIn.getServerForPlayer(); + + if (worldIn != null) + { + worldIn.getPlayerManager().removePlayer(playerIn); + } + + worldserver.getPlayerManager().addPlayer(playerIn); + worldserver.theChunkProviderServer.loadChunk((int)playerIn.posX >> 4, (int)playerIn.posZ >> 4); + } + + public int getEntityViewDistance() + { + return PlayerManager.getFurthestViewableBlock(this.getViewDistance()); + } + + public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP playerIn) + { + NBTTagCompound nbttagcompound = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); + NBTTagCompound nbttagcompound1; + + if (playerIn.getName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null) + { + playerIn.readFromNBT(nbttagcompound); + nbttagcompound1 = nbttagcompound; + logger.debug("loading single player"); + } + else + { + nbttagcompound1 = this.playerNBTManagerObj.readPlayerData(playerIn); + } + + return nbttagcompound1; + } + + protected void writePlayerData(EntityPlayerMP playerIn) + { + this.playerNBTManagerObj.writePlayerData(playerIn); + StatisticsFile statisticsfile = (StatisticsFile)this.playerStatFiles.get(playerIn.getUniqueID()); + + if (statisticsfile != null) + { + statisticsfile.saveStatFile(); + } + } + + public void playerLoggedIn(EntityPlayerMP playerIn) + { + this.playerEntityList.add(playerIn); + this.uuidToPlayerMap.put(playerIn.getUniqueID(), playerIn); + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {playerIn})); + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + worldserver.spawnEntityInWorld(playerIn); + this.preparePlayer(playerIn, (WorldServer)null); + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i); + playerIn.playerNetServerHandler.sendPacket(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {entityplayermp})); + } + } + + public void serverUpdateMountedMovingPlayer(EntityPlayerMP playerIn) + { + playerIn.getServerForPlayer().getPlayerManager().updateMountedMovingPlayer(playerIn); + } + + public void playerLoggedOut(EntityPlayerMP playerIn) + { + playerIn.triggerAchievement(StatList.leaveGameStat); + this.writePlayerData(playerIn); + WorldServer worldserver = playerIn.getServerForPlayer(); + + if (playerIn.ridingEntity != null) + { + worldserver.removePlayerEntityDangerously(playerIn.ridingEntity); + logger.debug("removing player mount"); + } + + worldserver.removeEntity(playerIn); + worldserver.getPlayerManager().removePlayer(playerIn); + this.playerEntityList.remove(playerIn); + UUID uuid = playerIn.getUniqueID(); + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.uuidToPlayerMap.get(uuid); + + if (entityplayermp == playerIn) + { + this.uuidToPlayerMap.remove(uuid); + this.playerStatFiles.remove(uuid); + } + + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {playerIn})); + } + + public String allowUserToConnect(SocketAddress address, GameProfile profile) + { + if (this.bannedPlayers.isBanned(profile)) + { + UserListBansEntry userlistbansentry = (UserListBansEntry)this.bannedPlayers.getEntry(profile); + String s1 = "You are banned from this server!\nReason: " + userlistbansentry.getBanReason(); + + if (userlistbansentry.getBanEndDate() != null) + { + s1 = s1 + "\nYour ban will be removed on " + dateFormat.format(userlistbansentry.getBanEndDate()); + } + + return s1; + } + else if (!this.canJoin(profile)) + { + return "You are not white-listed on this server!"; + } + else if (this.bannedIPs.isBanned(address)) + { + IPBanEntry ipbanentry = this.bannedIPs.getBanEntry(address); + String s = "Your IP address is banned from this server!\nReason: " + ipbanentry.getBanReason(); + + if (ipbanentry.getBanEndDate() != null) + { + s = s + "\nYour ban will be removed on " + dateFormat.format(ipbanentry.getBanEndDate()); + } + + return s; + } + else + { + return this.playerEntityList.size() >= this.maxPlayers && !this.bypassesPlayerLimit(profile) ? "The server is full!" : null; + } + } + + public EntityPlayerMP createPlayerForUser(GameProfile profile) + { + UUID uuid = EntityPlayer.getUUID(profile); + List list = Lists.newArrayList(); + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i); + + if (entityplayermp.getUniqueID().equals(uuid)) + { + list.add(entityplayermp); + } + } + + EntityPlayerMP entityplayermp2 = (EntityPlayerMP)this.uuidToPlayerMap.get(profile.getId()); + + if (entityplayermp2 != null && !list.contains(entityplayermp2)) + { + list.add(entityplayermp2); + } + + for (EntityPlayerMP entityplayermp1 : list) + { + entityplayermp1.playerNetServerHandler.kickPlayerFromServer("You logged in from another location"); + } + + ItemInWorldManager iteminworldmanager; + + if (this.mcServer.isDemo()) + { + iteminworldmanager = new DemoWorldManager(this.mcServer.worldServerForDimension(0)); + } + else + { + iteminworldmanager = new ItemInWorldManager(this.mcServer.worldServerForDimension(0)); + } + + return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), profile, iteminworldmanager); + } + + public EntityPlayerMP recreatePlayerEntity(EntityPlayerMP playerIn, int dimension, boolean conqueredEnd) + { + playerIn.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(playerIn); + playerIn.getServerForPlayer().getEntityTracker().untrackEntity(playerIn); + playerIn.getServerForPlayer().getPlayerManager().removePlayer(playerIn); + this.playerEntityList.remove(playerIn); + this.mcServer.worldServerForDimension(playerIn.dimension).removePlayerEntityDangerously(playerIn); + BlockPos blockpos = playerIn.getBedLocation(); + boolean flag = playerIn.isSpawnForced(); + playerIn.dimension = dimension; + ItemInWorldManager iteminworldmanager; + + if (this.mcServer.isDemo()) + { + iteminworldmanager = new DemoWorldManager(this.mcServer.worldServerForDimension(playerIn.dimension)); + } + else + { + iteminworldmanager = new ItemInWorldManager(this.mcServer.worldServerForDimension(playerIn.dimension)); + } + + EntityPlayerMP entityplayermp = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(playerIn.dimension), playerIn.getGameProfile(), iteminworldmanager); + entityplayermp.playerNetServerHandler = playerIn.playerNetServerHandler; + entityplayermp.clonePlayer(playerIn, conqueredEnd); + entityplayermp.setEntityId(playerIn.getEntityId()); + entityplayermp.setCommandStats(playerIn); + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + this.setPlayerGameTypeBasedOnOther(entityplayermp, playerIn, worldserver); + + if (blockpos != null) + { + BlockPos blockpos1 = EntityPlayer.getBedSpawnLocation(this.mcServer.worldServerForDimension(playerIn.dimension), blockpos, flag); + + if (blockpos1 != null) + { + entityplayermp.setLocationAndAngles((double)((float)blockpos1.getX() + 0.5F), (double)((float)blockpos1.getY() + 0.1F), (double)((float)blockpos1.getZ() + 0.5F), 0.0F, 0.0F); + entityplayermp.setSpawnPoint(blockpos, flag); + } + else + { + entityplayermp.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(0, 0.0F)); + } + } + + worldserver.theChunkProviderServer.loadChunk((int)entityplayermp.posX >> 4, (int)entityplayermp.posZ >> 4); + + while (!worldserver.getCollidingBoundingBoxes(entityplayermp, entityplayermp.getEntityBoundingBox()).isEmpty() && entityplayermp.posY < 256.0D) + { + entityplayermp.setPosition(entityplayermp.posX, entityplayermp.posY + 1.0D, entityplayermp.posZ); + } + + entityplayermp.playerNetServerHandler.sendPacket(new S07PacketRespawn(entityplayermp.dimension, entityplayermp.worldObj.getDifficulty(), entityplayermp.worldObj.getWorldInfo().getTerrainType(), entityplayermp.theItemInWorldManager.getGameType())); + BlockPos blockpos2 = worldserver.getSpawnPoint(); + entityplayermp.playerNetServerHandler.setPlayerLocation(entityplayermp.posX, entityplayermp.posY, entityplayermp.posZ, entityplayermp.rotationYaw, entityplayermp.rotationPitch); + entityplayermp.playerNetServerHandler.sendPacket(new S05PacketSpawnPosition(blockpos2)); + entityplayermp.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(entityplayermp.experience, entityplayermp.experienceTotal, entityplayermp.experienceLevel)); + this.updateTimeAndWeatherForPlayer(entityplayermp, worldserver); + worldserver.getPlayerManager().addPlayer(entityplayermp); + worldserver.spawnEntityInWorld(entityplayermp); + this.playerEntityList.add(entityplayermp); + this.uuidToPlayerMap.put(entityplayermp.getUniqueID(), entityplayermp); + entityplayermp.addSelfToInternalCraftingInventory(); + entityplayermp.setHealth(entityplayermp.getHealth()); + return entityplayermp; + } + + public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension) + { + int i = playerIn.dimension; + WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + playerIn.dimension = dimension; + WorldServer worldserver1 = this.mcServer.worldServerForDimension(playerIn.dimension); + playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, playerIn.worldObj.getDifficulty(), playerIn.worldObj.getWorldInfo().getTerrainType(), playerIn.theItemInWorldManager.getGameType())); + worldserver.removePlayerEntityDangerously(playerIn); + playerIn.isDead = false; + this.transferEntityToWorld(playerIn, i, worldserver, worldserver1); + this.preparePlayer(playerIn, worldserver); + playerIn.playerNetServerHandler.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, playerIn.rotationPitch); + playerIn.theItemInWorldManager.setWorld(worldserver1); + this.updateTimeAndWeatherForPlayer(playerIn, worldserver1); + this.syncPlayerInventory(playerIn); + + for (PotionEffect potioneffect : playerIn.getActivePotionEffects()) + { + playerIn.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect)); + } + } + + public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer oldWorldIn, WorldServer toWorldIn) + { + double d0 = entityIn.posX; + double d1 = entityIn.posZ; + double d2 = 8.0D; + float f = entityIn.rotationYaw; + oldWorldIn.theProfiler.startSection("moving"); + + if (entityIn.dimension == -1) + { + d0 = MathHelper.clamp_double(d0 / d2, toWorldIn.getWorldBorder().minX() + 16.0D, toWorldIn.getWorldBorder().maxX() - 16.0D); + d1 = MathHelper.clamp_double(d1 / d2, toWorldIn.getWorldBorder().minZ() + 16.0D, toWorldIn.getWorldBorder().maxZ() - 16.0D); + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); + + if (entityIn.isEntityAlive()) + { + oldWorldIn.updateEntityWithOptionalForce(entityIn, false); + } + } + else if (entityIn.dimension == 0) + { + d0 = MathHelper.clamp_double(d0 * d2, toWorldIn.getWorldBorder().minX() + 16.0D, toWorldIn.getWorldBorder().maxX() - 16.0D); + d1 = MathHelper.clamp_double(d1 * d2, toWorldIn.getWorldBorder().minZ() + 16.0D, toWorldIn.getWorldBorder().maxZ() - 16.0D); + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); + + if (entityIn.isEntityAlive()) + { + oldWorldIn.updateEntityWithOptionalForce(entityIn, false); + } + } + else + { + BlockPos blockpos; + + if (p_82448_2_ == 1) + { + blockpos = toWorldIn.getSpawnPoint(); + } + else + { + blockpos = toWorldIn.getSpawnCoordinate(); + } + + d0 = (double)blockpos.getX(); + entityIn.posY = (double)blockpos.getY(); + d1 = (double)blockpos.getZ(); + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, 90.0F, 0.0F); + + if (entityIn.isEntityAlive()) + { + oldWorldIn.updateEntityWithOptionalForce(entityIn, false); + } + } + + oldWorldIn.theProfiler.endSection(); + + if (p_82448_2_ != 1) + { + oldWorldIn.theProfiler.startSection("placing"); + d0 = (double)MathHelper.clamp_int((int)d0, -29999872, 29999872); + d1 = (double)MathHelper.clamp_int((int)d1, -29999872, 29999872); + + if (entityIn.isEntityAlive()) + { + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); + toWorldIn.getDefaultTeleporter().placeInPortal(entityIn, f); + toWorldIn.spawnEntityInWorld(entityIn); + toWorldIn.updateEntityWithOptionalForce(entityIn, false); + } + + oldWorldIn.theProfiler.endSection(); + } + + entityIn.setWorld(toWorldIn); + } + + public void onTick() + { + if (++this.playerPingIndex > 600) + { + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.UPDATE_LATENCY, this.playerEntityList)); + this.playerPingIndex = 0; + } + } + + public void sendPacketToAllPlayers(Packet packetIn) + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + ((EntityPlayerMP)this.playerEntityList.get(i)).playerNetServerHandler.sendPacket(packetIn); + } + } + + public void sendPacketToAllPlayersInDimension(Packet packetIn, int dimension) + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i); + + if (entityplayermp.dimension == dimension) + { + entityplayermp.playerNetServerHandler.sendPacket(packetIn); + } + } + } + + public void sendMessageToAllTeamMembers(EntityPlayer player, IChatComponent message) + { + Team team = player.getTeam(); + + if (team != null) + { + for (String s : team.getMembershipCollection()) + { + EntityPlayerMP entityplayermp = this.getPlayerByUsername(s); + + if (entityplayermp != null && entityplayermp != player) + { + entityplayermp.addChatMessage(message); + } + } + } + } + + public void sendMessageToTeamOrEvryPlayer(EntityPlayer player, IChatComponent message) + { + Team team = player.getTeam(); + + if (team == null) + { + this.sendChatMsg(message); + } + else + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i); + + if (entityplayermp.getTeam() != team) + { + entityplayermp.addChatMessage(message); + } + } + } + } + + public String func_181058_b(boolean p_181058_1_) + { + String s = ""; + List list = Lists.newArrayList(this.playerEntityList); + + for (int i = 0; i < ((List)list).size(); ++i) + { + if (i > 0) + { + s = s + ", "; + } + + s = s + ((EntityPlayerMP)list.get(i)).getName(); + + if (p_181058_1_) + { + s = s + " (" + ((EntityPlayerMP)list.get(i)).getUniqueID().toString() + ")"; + } + } + + return s; + } + + public String[] getAllUsernames() + { + String[] astring = new String[this.playerEntityList.size()]; + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + astring[i] = ((EntityPlayerMP)this.playerEntityList.get(i)).getName(); + } + + return astring; + } + + public GameProfile[] getAllProfiles() + { + GameProfile[] agameprofile = new GameProfile[this.playerEntityList.size()]; + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + agameprofile[i] = ((EntityPlayerMP)this.playerEntityList.get(i)).getGameProfile(); + } + + return agameprofile; + } + + public UserListBans getBannedPlayers() + { + return this.bannedPlayers; + } + + public BanList getBannedIPs() + { + return this.bannedIPs; + } + + public void addOp(GameProfile profile) + { + this.ops.addEntry(new UserListOpsEntry(profile, this.mcServer.getOpPermissionLevel(), this.ops.bypassesPlayerLimit(profile))); + } + + public void removeOp(GameProfile profile) + { + this.ops.removeEntry(profile); + } + + public boolean canJoin(GameProfile profile) + { + return !this.whiteListEnforced || this.ops.hasEntry(profile) || this.whiteListedPlayers.hasEntry(profile); + } + + public boolean canSendCommands(GameProfile profile) + { + return this.ops.hasEntry(profile) || this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() && this.mcServer.getServerOwner().equalsIgnoreCase(profile.getName()) || this.commandsAllowedForAll; + } + + public EntityPlayerMP getPlayerByUsername(String username) + { + for (EntityPlayerMP entityplayermp : this.playerEntityList) + { + if (entityplayermp.getName().equalsIgnoreCase(username)) + { + return entityplayermp; + } + } + + return null; + } + + public void sendToAllNear(double x, double y, double z, double radius, int dimension, Packet packetIn) + { + this.sendToAllNearExcept((EntityPlayer)null, x, y, z, radius, dimension, packetIn); + } + + public void sendToAllNearExcept(EntityPlayer p_148543_1_, double x, double y, double z, double radius, int dimension, Packet p_148543_11_) + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i); + + if (entityplayermp != p_148543_1_ && entityplayermp.dimension == dimension) + { + double d0 = x - entityplayermp.posX; + double d1 = y - entityplayermp.posY; + double d2 = z - entityplayermp.posZ; + + if (d0 * d0 + d1 * d1 + d2 * d2 < radius * radius) + { + entityplayermp.playerNetServerHandler.sendPacket(p_148543_11_); + } + } + } + } + + public void saveAllPlayerData() + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + this.writePlayerData((EntityPlayerMP)this.playerEntityList.get(i)); + } + } + + public void addWhitelistedPlayer(GameProfile profile) + { + this.whiteListedPlayers.addEntry(new UserListWhitelistEntry(profile)); + } + + public void removePlayerFromWhitelist(GameProfile profile) + { + this.whiteListedPlayers.removeEntry(profile); + } + + public UserListWhitelist getWhitelistedPlayers() + { + return this.whiteListedPlayers; + } + + public String[] getWhitelistedPlayerNames() + { + return this.whiteListedPlayers.getKeys(); + } + + public UserListOps getOppedPlayers() + { + return this.ops; + } + + public String[] getOppedPlayerNames() + { + return this.ops.getKeys(); + } + + public void loadWhiteList() + { + } + + public void updateTimeAndWeatherForPlayer(EntityPlayerMP playerIn, WorldServer worldIn) + { + WorldBorder worldborder = this.mcServer.worldServers[0].getWorldBorder(); + playerIn.playerNetServerHandler.sendPacket(new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.INITIALIZE)); + playerIn.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(worldIn.getTotalWorldTime(), worldIn.getWorldTime(), worldIn.getGameRules().getBoolean("doDaylightCycle"))); + + if (worldIn.isRaining()) + { + playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); + playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, worldIn.getRainStrength(1.0F))); + playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, worldIn.getThunderStrength(1.0F))); + } + } + + public void syncPlayerInventory(EntityPlayerMP playerIn) + { + playerIn.sendContainerToPlayer(playerIn.inventoryContainer); + playerIn.setPlayerHealthUpdated(); + playerIn.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(playerIn.inventory.currentItem)); + } + + public int getCurrentPlayerCount() + { + return this.playerEntityList.size(); + } + + public int getMaxPlayers() + { + return this.maxPlayers; + } + + public String[] getAvailablePlayerDat() + { + return this.mcServer.worldServers[0].getSaveHandler().getPlayerNBTManager().getAvailablePlayerDat(); + } + + public void setWhiteListEnabled(boolean whitelistEnabled) + { + this.whiteListEnforced = whitelistEnabled; + } + + public List getPlayersMatchingAddress(String address) + { + List list = Lists.newArrayList(); + + for (EntityPlayerMP entityplayermp : this.playerEntityList) + { + if (entityplayermp.getPlayerIP().equals(address)) + { + list.add(entityplayermp); + } + } + + return list; + } + + public int getViewDistance() + { + return this.viewDistance; + } + + public MinecraftServer getServerInstance() + { + return this.mcServer; + } + + public NBTTagCompound getHostPlayerData() + { + return null; + } + + public void setGameType(WorldSettings.GameType p_152604_1_) + { + this.gameType = p_152604_1_; + } + + private void setPlayerGameTypeBasedOnOther(EntityPlayerMP p_72381_1_, EntityPlayerMP p_72381_2_, World worldIn) + { + if (p_72381_2_ != null) + { + p_72381_1_.theItemInWorldManager.setGameType(p_72381_2_.theItemInWorldManager.getGameType()); + } + else if (this.gameType != null) + { + p_72381_1_.theItemInWorldManager.setGameType(this.gameType); + } + + p_72381_1_.theItemInWorldManager.initializeGameType(worldIn.getWorldInfo().getGameType()); + } + + public void setCommandsAllowedForAll(boolean p_72387_1_) + { + this.commandsAllowedForAll = p_72387_1_; + } + + public void removeAllPlayers() + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + ((EntityPlayerMP)this.playerEntityList.get(i)).playerNetServerHandler.kickPlayerFromServer("Server closed"); + } + } + + public void sendChatMsgImpl(IChatComponent component, boolean isChat) + { + this.mcServer.addChatMessage(component); + byte b0 = (byte)(isChat ? 1 : 0); + this.sendPacketToAllPlayers(new S02PacketChat(component, b0)); + } + + public void sendChatMsg(IChatComponent component) + { + this.sendChatMsgImpl(component, true); + } + + public StatisticsFile getPlayerStatsFile(EntityPlayer playerIn) + { + UUID uuid = playerIn.getUniqueID(); + StatisticsFile statisticsfile = uuid == null ? null : (StatisticsFile)this.playerStatFiles.get(uuid); + + if (statisticsfile == null) + { + File file1 = new File(this.mcServer.worldServerForDimension(0).getSaveHandler().getWorldDirectory(), "stats"); + File file2 = new File(file1, uuid.toString() + ".json"); + + if (!file2.exists()) + { + File file3 = new File(file1, playerIn.getName() + ".json"); + + if (file3.exists() && file3.isFile()) + { + file3.renameTo(file2); + } + } + + statisticsfile = new StatisticsFile(this.mcServer, file2); + statisticsfile.readStatFile(); + this.playerStatFiles.put(uuid, statisticsfile); + } + + return statisticsfile; + } + + public void setViewDistance(int distance) + { + this.viewDistance = distance; + + if (this.mcServer.worldServers != null) + { + for (WorldServer worldserver : this.mcServer.worldServers) + { + if (worldserver != null) + { + worldserver.getPlayerManager().setPlayerViewRadius(distance); + } + } + } + } + + public List getPlayerList() + { + return this.playerEntityList; + } + + public EntityPlayerMP getPlayerByUUID(UUID playerUUID) + { + return (EntityPlayerMP)this.uuidToPlayerMap.get(playerUUID); + } + + public boolean bypassesPlayerLimit(GameProfile p_183023_1_) + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserList.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserList.java new file mode 100644 index 0000000..163e7aa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserList.java @@ -0,0 +1,191 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.io.Writer; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class UserList> +{ + protected static final Logger logger = LogManager.getLogger(); + protected final Gson gson; + private final File saveFile; + private final Map values = Maps.newHashMap(); + private boolean lanServer = true; + private static final ParameterizedType saveFileFormat = new ParameterizedType() + { + public Type[] getActualTypeArguments() + { + return new Type[] {UserListEntry.class}; + } + public Type getRawType() + { + return List.class; + } + public Type getOwnerType() + { + return null; + } + }; + + public UserList(File saveFile) + { + this.saveFile = saveFile; + GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting(); + gsonbuilder.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer()); + this.gson = gsonbuilder.create(); + } + + public boolean isLanServer() + { + return this.lanServer; + } + + public void setLanServer(boolean state) + { + this.lanServer = state; + } + + public void addEntry(V entry) + { + this.values.put(this.getObjectKey(entry.getValue()), entry); + + try + { + this.writeChanges(); + } + catch (IOException ioexception) + { + logger.warn((String)"Could not save the list after adding a user.", (Throwable)ioexception); + } + } + + public V getEntry(K obj) + { + this.removeExpired(); + return (V)((UserListEntry)this.values.get(this.getObjectKey(obj))); + } + + public void removeEntry(K entry) + { + this.values.remove(this.getObjectKey(entry)); + + try + { + this.writeChanges(); + } + catch (IOException ioexception) + { + logger.warn((String)"Could not save the list after removing a user.", (Throwable)ioexception); + } + } + + public String[] getKeys() + { + return (String[])this.values.keySet().toArray(new String[this.values.size()]); + } + + protected String getObjectKey(K obj) + { + return obj.toString(); + } + + protected boolean hasEntry(K entry) + { + return this.values.containsKey(this.getObjectKey(entry)); + } + + private void removeExpired() + { + List list = Lists.newArrayList(); + + for (V v : this.values.values()) + { + if (v.hasBanExpired()) + { + list.add(v.getValue()); + } + } + + for (K k : list) + { + this.values.remove(k); + } + } + + protected UserListEntry createEntry(JsonObject entryData) + { + return new UserListEntry((Object)null, entryData); + } + + protected Map getValues() + { + return this.values; + } + + public void writeChanges() throws IOException + { + Collection collection = this.values.values(); + String s = this.gson.toJson((Object)collection); + BufferedWriter bufferedwriter = null; + + try + { + bufferedwriter = Files.newWriter(this.saveFile, Charsets.UTF_8); + bufferedwriter.write(s); + } + finally + { + IOUtils.closeQuietly((Writer)bufferedwriter); + } + } + + class Serializer implements JsonDeserializer>, JsonSerializer> + { + private Serializer() + { + } + + public JsonElement serialize(UserListEntry p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + p_serialize_1_.onSerialization(jsonobject); + return jsonobject; + } + + public UserListEntry deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + if (p_deserialize_1_.isJsonObject()) + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + UserListEntry userlistentry = UserList.this.createEntry(jsonobject); + return userlistentry; + } + else + { + return null; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListBans.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListBans.java new file mode 100644 index 0000000..60a7ea0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListBans.java @@ -0,0 +1,54 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; + +public class UserListBans extends UserList +{ + public UserListBans(File bansFile) + { + super(bansFile); + } + + protected UserListEntry createEntry(JsonObject entryData) + { + return new UserListBansEntry(entryData); + } + + public boolean isBanned(GameProfile profile) + { + return this.hasEntry(profile); + } + + public String[] getKeys() + { + String[] astring = new String[this.getValues().size()]; + int i = 0; + + for (UserListBansEntry userlistbansentry : this.getValues().values()) + { + astring[i++] = ((GameProfile)userlistbansentry.getValue()).getName(); + } + + return astring; + } + + protected String getObjectKey(GameProfile obj) + { + return obj.getId().toString(); + } + + public GameProfile isUsernameBanned(String username) + { + for (UserListBansEntry userlistbansentry : this.getValues().values()) + { + if (username.equalsIgnoreCase(((GameProfile)userlistbansentry.getValue()).getName())) + { + return (GameProfile)userlistbansentry.getValue(); + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListBansEntry.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListBansEntry.java new file mode 100644 index 0000000..3ec7891 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListBansEntry.java @@ -0,0 +1,58 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.Date; +import java.util.UUID; + +public class UserListBansEntry extends BanEntry +{ + public UserListBansEntry(GameProfile profile) + { + this(profile, (Date)null, (String)null, (Date)null, (String)null); + } + + public UserListBansEntry(GameProfile profile, Date startDate, String banner, Date endDate, String banReason) + { + super(profile, endDate, banner, endDate, banReason); + } + + public UserListBansEntry(JsonObject json) + { + super(toGameProfile(json), json); + } + + protected void onSerialization(JsonObject data) + { + if (this.getValue() != null) + { + data.addProperty("uuid", ((GameProfile)this.getValue()).getId() == null ? "" : ((GameProfile)this.getValue()).getId().toString()); + data.addProperty("name", ((GameProfile)this.getValue()).getName()); + super.onSerialization(data); + } + } + + private static GameProfile toGameProfile(JsonObject json) + { + if (json.has("uuid") && json.has("name")) + { + String s = json.get("uuid").getAsString(); + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable var4) + { + return null; + } + + return new GameProfile(uuid, json.get("name").getAsString()); + } + else + { + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListEntry.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListEntry.java new file mode 100644 index 0000000..9b8b9b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListEntry.java @@ -0,0 +1,32 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; + +public class UserListEntry +{ + private final T value; + + public UserListEntry(T valueIn) + { + this.value = valueIn; + } + + protected UserListEntry(T valueIn, JsonObject json) + { + this.value = valueIn; + } + + T getValue() + { + return this.value; + } + + boolean hasBanExpired() + { + return false; + } + + protected void onSerialization(JsonObject data) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListOps.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListOps.java new file mode 100644 index 0000000..7697c21 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListOps.java @@ -0,0 +1,55 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; + +public class UserListOps extends UserList +{ + public UserListOps(File saveFile) + { + super(saveFile); + } + + protected UserListEntry createEntry(JsonObject entryData) + { + return new UserListOpsEntry(entryData); + } + + public String[] getKeys() + { + String[] astring = new String[this.getValues().size()]; + int i = 0; + + for (UserListOpsEntry userlistopsentry : this.getValues().values()) + { + astring[i++] = ((GameProfile)userlistopsentry.getValue()).getName(); + } + + return astring; + } + + public boolean bypassesPlayerLimit(GameProfile profile) + { + UserListOpsEntry userlistopsentry = (UserListOpsEntry)this.getEntry(profile); + return userlistopsentry != null ? userlistopsentry.bypassesPlayerLimit() : false; + } + + protected String getObjectKey(GameProfile obj) + { + return obj.getId().toString(); + } + + public GameProfile getGameProfileFromName(String username) + { + for (UserListOpsEntry userlistopsentry : this.getValues().values()) + { + if (username.equalsIgnoreCase(((GameProfile)userlistopsentry.getValue()).getName())) + { + return (GameProfile)userlistopsentry.getValue(); + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListOpsEntry.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListOpsEntry.java new file mode 100644 index 0000000..d6ea112 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListOpsEntry.java @@ -0,0 +1,71 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.UUID; + +public class UserListOpsEntry extends UserListEntry +{ + private final int permissionLevel; + private final boolean bypassesPlayerLimit; + + public UserListOpsEntry(GameProfile player, int permissionLevelIn, boolean bypassesPlayerLimitIn) + { + super(player); + this.permissionLevel = permissionLevelIn; + this.bypassesPlayerLimit = bypassesPlayerLimitIn; + } + + public UserListOpsEntry(JsonObject p_i1150_1_) + { + super(constructProfile(p_i1150_1_), p_i1150_1_); + this.permissionLevel = p_i1150_1_.has("level") ? p_i1150_1_.get("level").getAsInt() : 0; + this.bypassesPlayerLimit = p_i1150_1_.has("bypassesPlayerLimit") && p_i1150_1_.get("bypassesPlayerLimit").getAsBoolean(); + } + + public int getPermissionLevel() + { + return this.permissionLevel; + } + + public boolean bypassesPlayerLimit() + { + return this.bypassesPlayerLimit; + } + + protected void onSerialization(JsonObject data) + { + if (this.getValue() != null) + { + data.addProperty("uuid", ((GameProfile)this.getValue()).getId() == null ? "" : ((GameProfile)this.getValue()).getId().toString()); + data.addProperty("name", ((GameProfile)this.getValue()).getName()); + super.onSerialization(data); + data.addProperty("level", (Number)Integer.valueOf(this.permissionLevel)); + data.addProperty("bypassesPlayerLimit", Boolean.valueOf(this.bypassesPlayerLimit)); + } + } + + private static GameProfile constructProfile(JsonObject p_152643_0_) + { + if (p_152643_0_.has("uuid") && p_152643_0_.has("name")) + { + String s = p_152643_0_.get("uuid").getAsString(); + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable var4) + { + return null; + } + + return new GameProfile(uuid, p_152643_0_.get("name").getAsString()); + } + else + { + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListWhitelist.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListWhitelist.java new file mode 100644 index 0000000..3739786 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListWhitelist.java @@ -0,0 +1,49 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; + +public class UserListWhitelist extends UserList +{ + public UserListWhitelist(File p_i1132_1_) + { + super(p_i1132_1_); + } + + protected UserListEntry createEntry(JsonObject entryData) + { + return new UserListWhitelistEntry(entryData); + } + + public String[] getKeys() + { + String[] astring = new String[this.getValues().size()]; + int i = 0; + + for (UserListWhitelistEntry userlistwhitelistentry : this.getValues().values()) + { + astring[i++] = ((GameProfile)userlistwhitelistentry.getValue()).getName(); + } + + return astring; + } + + protected String getObjectKey(GameProfile obj) + { + return obj.getId().toString(); + } + + public GameProfile getBannedProfile(String name) + { + for (UserListWhitelistEntry userlistwhitelistentry : this.getValues().values()) + { + if (name.equalsIgnoreCase(((GameProfile)userlistwhitelistentry.getValue()).getName())) + { + return (GameProfile)userlistwhitelistentry.getValue(); + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListWhitelistEntry.java b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListWhitelistEntry.java new file mode 100644 index 0000000..a8a2164 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/management/UserListWhitelistEntry.java @@ -0,0 +1,52 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.UUID; + +public class UserListWhitelistEntry extends UserListEntry +{ + public UserListWhitelistEntry(GameProfile profile) + { + super(profile); + } + + public UserListWhitelistEntry(JsonObject json) + { + super(gameProfileFromJsonObject(json), json); + } + + protected void onSerialization(JsonObject data) + { + if (this.getValue() != null) + { + data.addProperty("uuid", ((GameProfile)this.getValue()).getId() == null ? "" : ((GameProfile)this.getValue()).getId().toString()); + data.addProperty("name", ((GameProfile)this.getValue()).getName()); + super.onSerialization(data); + } + } + + private static GameProfile gameProfileFromJsonObject(JsonObject json) + { + if (json.has("uuid") && json.has("name")) + { + String s = json.get("uuid").getAsString(); + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable var4) + { + return null; + } + + return new GameProfile(uuid, json.get("name").getAsString()); + } + else + { + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java b/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java new file mode 100644 index 0000000..7c45d9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java @@ -0,0 +1,62 @@ +package net.minecraft.server.network; + +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; + +public class NetHandlerHandshakeTCP implements INetHandlerHandshakeServer +{ + private final MinecraftServer server; + private final NetworkManager networkManager; + + public NetHandlerHandshakeTCP(MinecraftServer serverIn, NetworkManager netManager) + { + this.server = serverIn; + this.networkManager = netManager; + } + + public void processHandshake(C00Handshake packetIn) + { + switch (packetIn.getRequestedState()) + { + case LOGIN: + this.networkManager.setConnectionState(EnumConnectionState.LOGIN); + + if (packetIn.getProtocolVersion() > 47) + { + ChatComponentText chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.9"); + this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext)); + this.networkManager.closeChannel(chatcomponenttext); + } + else if (packetIn.getProtocolVersion() < 47) + { + ChatComponentText chatcomponenttext1 = new ChatComponentText("Outdated client! Please use 1.8.9"); + this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext1)); + this.networkManager.closeChannel(chatcomponenttext1); + } + else + { + this.networkManager.setNetHandler(new NetHandlerLoginServer(this.server, this.networkManager)); + } + + break; + + case STATUS: + this.networkManager.setConnectionState(EnumConnectionState.STATUS); + this.networkManager.setNetHandler(new NetHandlerStatusServer(this.server, this.networkManager)); + break; + + default: + throw new UnsupportedOperationException("Invalid intention " + packetIn.getRequestedState()); + } + } + + public void onDisconnect(IChatComponent reason) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java b/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java new file mode 100644 index 0000000..c615e81 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java @@ -0,0 +1,240 @@ +package net.minecraft.server.network; + +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelFutureListener; +import io.netty.util.concurrent.GenericFutureListener; +import java.math.BigInteger; +import java.security.PrivateKey; +import java.util.Arrays; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; +import javax.crypto.SecretKey; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.login.INetHandlerLoginServer; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.login.server.S03PacketEnableCompression; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.CryptManager; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ITickable; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetHandlerLoginServer implements INetHandlerLoginServer, ITickable +{ + private static final AtomicInteger AUTHENTICATOR_THREAD_ID = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private static final Random RANDOM = new Random(); + private final byte[] verifyToken = new byte[4]; + private final MinecraftServer server; + public final NetworkManager networkManager; + private NetHandlerLoginServer.LoginState currentLoginState = NetHandlerLoginServer.LoginState.HELLO; + private int connectionTimer; + private GameProfile loginGameProfile; + private String serverId = ""; + private SecretKey secretKey; + private EntityPlayerMP player; + + public NetHandlerLoginServer(MinecraftServer serverIn, NetworkManager networkManagerIn) + { + this.server = serverIn; + this.networkManager = networkManagerIn; + RANDOM.nextBytes(this.verifyToken); + } + + public void update() + { + if (this.currentLoginState == NetHandlerLoginServer.LoginState.READY_TO_ACCEPT) + { + this.tryAcceptPlayer(); + } + else if (this.currentLoginState == NetHandlerLoginServer.LoginState.DELAY_ACCEPT) + { + EntityPlayerMP entityplayermp = this.server.getConfigurationManager().getPlayerByUUID(this.loginGameProfile.getId()); + + if (entityplayermp == null) + { + this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.player); + this.player = null; + } + } + + if (this.connectionTimer++ == 600) + { + this.closeConnection("Took too long to log in"); + } + } + + public void closeConnection(String reason) + { + try + { + logger.info("Disconnecting " + this.getConnectionInfo() + ": " + reason); + ChatComponentText chatcomponenttext = new ChatComponentText(reason); + this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext)); + this.networkManager.closeChannel(chatcomponenttext); + } + catch (Exception exception) + { + logger.error((String)"Error whilst disconnecting player", (Throwable)exception); + } + } + + public void tryAcceptPlayer() + { + if (!this.loginGameProfile.isComplete()) + { + this.loginGameProfile = this.getOfflineProfile(this.loginGameProfile); + } + + String s = this.server.getConfigurationManager().allowUserToConnect(this.networkManager.getRemoteAddress(), this.loginGameProfile); + + if (s != null) + { + this.closeConnection(s); + } + else + { + this.currentLoginState = NetHandlerLoginServer.LoginState.ACCEPTED; + + if (this.server.getNetworkCompressionTreshold() >= 0 && !this.networkManager.isLocalChannel()) + { + this.networkManager.sendPacket(new S03PacketEnableCompression(this.server.getNetworkCompressionTreshold()), new ChannelFutureListener() + { + public void operationComplete(ChannelFuture p_operationComplete_1_) throws Exception + { + NetHandlerLoginServer.this.networkManager.setCompressionTreshold(NetHandlerLoginServer.this.server.getNetworkCompressionTreshold()); + } + }, new GenericFutureListener[0]); + } + + this.networkManager.sendPacket(new S02PacketLoginSuccess(this.loginGameProfile)); + EntityPlayerMP entityplayermp = this.server.getConfigurationManager().getPlayerByUUID(this.loginGameProfile.getId()); + + if (entityplayermp != null) + { + this.currentLoginState = NetHandlerLoginServer.LoginState.DELAY_ACCEPT; + this.player = this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile); + } + else + { + this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile)); + } + } + } + + public void onDisconnect(IChatComponent reason) + { + logger.info(this.getConnectionInfo() + " lost connection: " + reason.getUnformattedText()); + } + + public String getConnectionInfo() + { + return this.loginGameProfile != null ? this.loginGameProfile.toString() + " (" + this.networkManager.getRemoteAddress().toString() + ")" : String.valueOf((Object)this.networkManager.getRemoteAddress()); + } + + public void processLoginStart(C00PacketLoginStart packetIn) + { + Validate.validState(this.currentLoginState == NetHandlerLoginServer.LoginState.HELLO, "Unexpected hello packet", new Object[0]); + this.loginGameProfile = packetIn.getProfile(); + + if (this.server.isServerInOnlineMode() && !this.networkManager.isLocalChannel()) + { + this.currentLoginState = NetHandlerLoginServer.LoginState.KEY; + this.networkManager.sendPacket(new S01PacketEncryptionRequest(this.serverId, this.server.getKeyPair().getPublic(), this.verifyToken)); + } + else + { + this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + } + + public void processEncryptionResponse(C01PacketEncryptionResponse packetIn) + { + Validate.validState(this.currentLoginState == NetHandlerLoginServer.LoginState.KEY, "Unexpected key packet", new Object[0]); + PrivateKey privatekey = this.server.getKeyPair().getPrivate(); + + if (!Arrays.equals(this.verifyToken, packetIn.getVerifyToken(privatekey))) + { + throw new IllegalStateException("Invalid nonce!"); + } + else + { + this.secretKey = packetIn.getSecretKey(privatekey); + this.currentLoginState = NetHandlerLoginServer.LoginState.AUTHENTICATING; + this.networkManager.enableEncryption(this.secretKey); + (new Thread("User Authenticator #" + AUTHENTICATOR_THREAD_ID.incrementAndGet()) + { + public void run() + { + GameProfile gameprofile = NetHandlerLoginServer.this.loginGameProfile; + + try + { + String s = (new BigInteger(CryptManager.getServerIdHash(NetHandlerLoginServer.this.serverId, NetHandlerLoginServer.this.server.getKeyPair().getPublic(), NetHandlerLoginServer.this.secretKey))).toString(16); + NetHandlerLoginServer.this.loginGameProfile = NetHandlerLoginServer.this.server.getMinecraftSessionService().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s); + + if (NetHandlerLoginServer.this.loginGameProfile != null) + { + NetHandlerLoginServer.logger.info("UUID of player " + NetHandlerLoginServer.this.loginGameProfile.getName() + " is " + NetHandlerLoginServer.this.loginGameProfile.getId()); + NetHandlerLoginServer.this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + else if (NetHandlerLoginServer.this.server.isSinglePlayer()) + { + NetHandlerLoginServer.logger.warn("Failed to verify username but will let them in anyway!"); + NetHandlerLoginServer.this.loginGameProfile = NetHandlerLoginServer.this.getOfflineProfile(gameprofile); + NetHandlerLoginServer.this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + else + { + NetHandlerLoginServer.this.closeConnection("Failed to verify username!"); + NetHandlerLoginServer.logger.error("Username \'" + NetHandlerLoginServer.this.loginGameProfile.getName() + "\' tried to join with an invalid session"); + } + } + catch (AuthenticationUnavailableException var3) + { + if (NetHandlerLoginServer.this.server.isSinglePlayer()) + { + NetHandlerLoginServer.logger.warn("Authentication servers are down but will let them in anyway!"); + NetHandlerLoginServer.this.loginGameProfile = NetHandlerLoginServer.this.getOfflineProfile(gameprofile); + NetHandlerLoginServer.this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + else + { + NetHandlerLoginServer.this.closeConnection("Authentication servers are down. Please try again later, sorry!"); + NetHandlerLoginServer.logger.error("Couldn\'t verify username because servers are unavailable"); + } + } + } + }).start(); + } + } + + protected GameProfile getOfflineProfile(GameProfile original) + { + UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + original.getName()).getBytes(Charsets.UTF_8)); + return new GameProfile(uuid, original.getName()); + } + + static enum LoginState + { + HELLO, + KEY, + AUTHENTICATING, + READY_TO_ACCEPT, + DELAY_ACCEPT, + ACCEPTED; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerStatusServer.java b/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerStatusServer.java new file mode 100644 index 0000000..c782e22 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/server/network/NetHandlerStatusServer.java @@ -0,0 +1,48 @@ +package net.minecraft.server.network; + +import net.minecraft.network.NetworkManager; +import net.minecraft.network.status.INetHandlerStatusServer; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; + +public class NetHandlerStatusServer implements INetHandlerStatusServer +{ + private static final IChatComponent EXIT_MESSAGE = new ChatComponentText("Status request has been handled."); + private final MinecraftServer server; + private final NetworkManager networkManager; + private boolean handled; + + public NetHandlerStatusServer(MinecraftServer serverIn, NetworkManager netManager) + { + this.server = serverIn; + this.networkManager = netManager; + } + + public void onDisconnect(IChatComponent reason) + { + } + + public void processServerQuery(C00PacketServerQuery packetIn) + { + if (this.handled) + { + this.networkManager.closeChannel(EXIT_MESSAGE); + } + else + { + this.handled = true; + this.networkManager.sendPacket(new S00PacketServerInfo(this.server.getServerStatusResponse())); + } + } + + public void processPing(C01PacketPing packetIn) + { + this.networkManager.sendPacket(new S01PacketPong(packetIn.getClientTime())); + this.networkManager.closeChannel(EXIT_MESSAGE); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/src/Config.java b/Client-1.8.9/src/main/java/net/minecraft/src/Config.java new file mode 100644 index 0000000..c3c5dea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/src/Config.java @@ -0,0 +1,2530 @@ +package net.minecraft.src; + +import java.awt.Desktop; +import java.awt.Dimension; +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Array; +import java.net.URI; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.imageio.ImageIO; +import net.minecraft.client.LoadingScreenRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.FrameTimer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Util; +import net.optifine.DynamicLights; +import net.optifine.GlErrors; +import net.optifine.VersionCheckThread; +import net.optifine.config.GlVersion; +import net.optifine.gui.GuiMessage; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.shaders.Shaders; +import net.optifine.util.DisplayModeComparator; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.TextureUtils; +import net.optifine.util.TimedEvent; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; +import org.lwjgl.opengl.GL12; +import org.lwjgl.opengl.GL30; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.opengl.PixelFormat; + +public class Config +{ + public static final String OF_NAME = "OptiFine"; + public static final String MC_VERSION = "1.8.9"; + public static final String OF_EDITION = "HD_U"; + public static final String OF_RELEASE = "M6_pre2"; + public static final String VERSION = "OptiFine_1.8.9_HD_U_M6_pre2"; + private static String build = null; + private static String newRelease = null; + private static boolean notify64BitJava = false; + public static String openGlVersion = null; + public static String openGlRenderer = null; + public static String openGlVendor = null; + public static String[] openGlExtensions = null; + public static GlVersion glVersion = null; + public static GlVersion glslVersion = null; + public static int minecraftVersionInt = -1; + public static boolean fancyFogAvailable = false; + public static boolean occlusionAvailable = false; + private static GameSettings gameSettings = null; + private static Minecraft minecraft = Minecraft.getMinecraft(); + private static boolean initialized = false; + private static Thread minecraftThread = null; + private static DisplayMode desktopDisplayMode = null; + private static DisplayMode[] displayModes = null; + private static int antialiasingLevel = 0; + private static int availableProcessors = 0; + public static boolean zoomMode = false; + public static boolean zoomSmoothCamera = false; + private static int texturePackClouds = 0; + public static boolean waterOpacityChanged = false; + private static boolean fullscreenModeChecked = false; + private static boolean desktopModeChecked = false; + private static DefaultResourcePack defaultResourcePackLazy = null; + public static final Float DEF_ALPHA_FUNC_LEVEL = Float.valueOf(0.1F); + private static final Logger LOGGER = LogManager.getLogger(); + public static final boolean logDetail = System.getProperty("log.detail", "false").equals("true"); + private static String mcDebugLast = null; + private static int fpsMinLast = 0; + public static float renderPartialTicks; + + public static String getVersion() + { + return "OptiFine_1.8.9_HD_U_M6_pre2"; + } + + public static String getVersionDebug() + { + StringBuffer stringbuffer = new StringBuffer(32); + + if (isDynamicLights()) + { + stringbuffer.append("DL: "); + stringbuffer.append(String.valueOf(DynamicLights.getCount())); + stringbuffer.append(", "); + } + + stringbuffer.append("OptiFine_1.8.9_HD_U_M6_pre2"); + String s = Shaders.getShaderPackName(); + + if (s != null) + { + stringbuffer.append(", "); + stringbuffer.append(s); + } + + return stringbuffer.toString(); + } + + public static void initGameSettings(GameSettings p_initGameSettings_0_) + { + if (gameSettings == null) + { + gameSettings = p_initGameSettings_0_; + desktopDisplayMode = Display.getDesktopDisplayMode(); + updateAvailableProcessors(); + ReflectorForge.putLaunchBlackboard("optifine.ForgeSplashCompatible", Boolean.TRUE); + } + } + + public static void initDisplay() + { + checkInitialized(); + antialiasingLevel = gameSettings.ofAaLevel; + checkDisplaySettings(); + checkDisplayMode(); + minecraftThread = Thread.currentThread(); + updateThreadPriorities(); + Shaders.startup(Minecraft.getMinecraft()); + } + + public static void checkInitialized() + { + if (!initialized) + { + if (Display.isCreated()) + { + initialized = true; + checkOpenGlCaps(); + startVersionCheckThread(); + } + } + } + + private static void checkOpenGlCaps() + { + log(""); + log(getVersion()); + log("Build: " + getBuild()); + log("OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version")); + log("Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor")); + log("VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor")); + log("LWJGL: " + Sys.getVersion()); + openGlVersion = GL11.glGetString(GL11.GL_VERSION); + openGlRenderer = GL11.glGetString(GL11.GL_RENDERER); + openGlVendor = GL11.glGetString(GL11.GL_VENDOR); + log("OpenGL: " + openGlRenderer + ", version " + openGlVersion + ", " + openGlVendor); + log("OpenGL Version: " + getOpenGlVersionString()); + + if (!GLContext.getCapabilities().OpenGL12) + { + log("OpenGL Mipmap levels: Not available (GL12.GL_TEXTURE_MAX_LEVEL)"); + } + + fancyFogAvailable = GLContext.getCapabilities().GL_NV_fog_distance; + + if (!fancyFogAvailable) + { + log("OpenGL Fancy fog: Not available (GL_NV_fog_distance)"); + } + + occlusionAvailable = GLContext.getCapabilities().GL_ARB_occlusion_query; + + if (!occlusionAvailable) + { + log("OpenGL Occlussion culling: Not available (GL_ARB_occlusion_query)"); + } + + int i = TextureUtils.getGLMaximumTextureSize(); + dbg("Maximum texture size: " + i + "x" + i); + } + + public static String getBuild() + { + if (build == null) + { + try + { + InputStream inputstream = Config.class.getResourceAsStream("/buildof.txt"); + + if (inputstream == null) + { + return null; + } + + build = readLines(inputstream)[0]; + } + catch (Exception exception) + { + warn("" + exception.getClass().getName() + ": " + exception.getMessage()); + build = ""; + } + } + + return build; + } + + public static boolean isFancyFogAvailable() + { + return fancyFogAvailable; + } + + public static boolean isOcclusionAvailable() + { + return occlusionAvailable; + } + + public static int getMinecraftVersionInt() + { + if (minecraftVersionInt < 0) + { + String[] astring = tokenize("1.8.9", "."); + int i = 0; + + if (astring.length > 0) + { + i += 10000 * parseInt(astring[0], 0); + } + + if (astring.length > 1) + { + i += 100 * parseInt(astring[1], 0); + } + + if (astring.length > 2) + { + i += 1 * parseInt(astring[2], 0); + } + + minecraftVersionInt = i; + } + + return minecraftVersionInt; + } + + public static String getOpenGlVersionString() + { + GlVersion glversion = getGlVersion(); + String s = "" + glversion.getMajor() + "." + glversion.getMinor() + "." + glversion.getRelease(); + return s; + } + + private static GlVersion getGlVersionLwjgl() + { + return GLContext.getCapabilities().OpenGL44 ? new GlVersion(4, 4) : (GLContext.getCapabilities().OpenGL43 ? new GlVersion(4, 3) : (GLContext.getCapabilities().OpenGL42 ? new GlVersion(4, 2) : (GLContext.getCapabilities().OpenGL41 ? new GlVersion(4, 1) : (GLContext.getCapabilities().OpenGL40 ? new GlVersion(4, 0) : (GLContext.getCapabilities().OpenGL33 ? new GlVersion(3, 3) : (GLContext.getCapabilities().OpenGL32 ? new GlVersion(3, 2) : (GLContext.getCapabilities().OpenGL31 ? new GlVersion(3, 1) : (GLContext.getCapabilities().OpenGL30 ? new GlVersion(3, 0) : (GLContext.getCapabilities().OpenGL21 ? new GlVersion(2, 1) : (GLContext.getCapabilities().OpenGL20 ? new GlVersion(2, 0) : (GLContext.getCapabilities().OpenGL15 ? new GlVersion(1, 5) : (GLContext.getCapabilities().OpenGL14 ? new GlVersion(1, 4) : (GLContext.getCapabilities().OpenGL13 ? new GlVersion(1, 3) : (GLContext.getCapabilities().OpenGL12 ? new GlVersion(1, 2) : (GLContext.getCapabilities().OpenGL11 ? new GlVersion(1, 1) : new GlVersion(1, 0)))))))))))))))); + } + + public static GlVersion getGlVersion() + { + if (glVersion == null) + { + String s = GL11.glGetString(GL11.GL_VERSION); + glVersion = parseGlVersion(s, (GlVersion)null); + + if (glVersion == null) + { + glVersion = getGlVersionLwjgl(); + } + + if (glVersion == null) + { + glVersion = new GlVersion(1, 0); + } + } + + return glVersion; + } + + public static GlVersion getGlslVersion() + { + if (glslVersion == null) + { + String s = GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION); + glslVersion = parseGlVersion(s, (GlVersion)null); + + if (glslVersion == null) + { + glslVersion = new GlVersion(1, 10); + } + } + + return glslVersion; + } + + public static GlVersion parseGlVersion(String p_parseGlVersion_0_, GlVersion p_parseGlVersion_1_) + { + try + { + if (p_parseGlVersion_0_ == null) + { + return p_parseGlVersion_1_; + } + else + { + Pattern pattern = Pattern.compile("([0-9]+)\\.([0-9]+)(\\.([0-9]+))?(.+)?"); + Matcher matcher = pattern.matcher(p_parseGlVersion_0_); + + if (!matcher.matches()) + { + return p_parseGlVersion_1_; + } + else + { + int i = Integer.parseInt(matcher.group(1)); + int j = Integer.parseInt(matcher.group(2)); + int k = matcher.group(4) != null ? Integer.parseInt(matcher.group(4)) : 0; + String s = matcher.group(5); + return new GlVersion(i, j, k, s); + } + } + } + catch (Exception exception) + { + exception.printStackTrace(); + return p_parseGlVersion_1_; + } + } + + public static String[] getOpenGlExtensions() + { + if (openGlExtensions == null) + { + openGlExtensions = detectOpenGlExtensions(); + } + + return openGlExtensions; + } + + private static String[] detectOpenGlExtensions() + { + try + { + GlVersion glversion = getGlVersion(); + + if (glversion.getMajor() >= 3) + { + int i = GL11.glGetInteger(33309); + + if (i > 0) + { + String[] astring = new String[i]; + + for (int j = 0; j < i; ++j) + { + astring[j] = GL30.glGetStringi(7939, j); + } + + return astring; + } + } + } + catch (Exception exception1) + { + exception1.printStackTrace(); + } + + try + { + String s = GL11.glGetString(GL11.GL_EXTENSIONS); + String[] astring1 = s.split(" "); + return astring1; + } + catch (Exception exception) + { + exception.printStackTrace(); + return new String[0]; + } + } + + public static void updateThreadPriorities() + { + updateAvailableProcessors(); + int i = 8; + + if (isSingleProcessor()) { + if (isSmoothWorld()) { + minecraftThread.setPriority(10); + setThreadPriority("Server thread", 1); + } else { + minecraftThread.setPriority(5); + setThreadPriority("Server thread", 5); + } + } + else + { + minecraftThread.setPriority(10); + setThreadPriority("Server thread", 5); + } + } + + private static void setThreadPriority(String p_setThreadPriority_0_, int p_setThreadPriority_1_) + { + try + { + ThreadGroup threadgroup = Thread.currentThread().getThreadGroup(); + + if (threadgroup == null) + { + return; + } + + int i = (threadgroup.activeCount() + 10) * 2; + Thread[] athread = new Thread[i]; + threadgroup.enumerate(athread, false); + + for (int j = 0; j < athread.length; ++j) + { + Thread thread = athread[j]; + + if (thread != null && thread.getName().startsWith(p_setThreadPriority_0_)) + { + thread.setPriority(p_setThreadPriority_1_); + } + } + } + catch (Throwable throwable) + { + warn(throwable.getClass().getName() + ": " + throwable.getMessage()); + } + } + + public static boolean isMinecraftThread() + { + return Thread.currentThread() == minecraftThread; + } + + private static void startVersionCheckThread() + { + VersionCheckThread versioncheckthread = new VersionCheckThread(); + versioncheckthread.start(); + } + + public static boolean isMipmaps() + { + return gameSettings.mipmapLevels > 0; + } + + public static int getMipmapLevels() + { + return gameSettings.mipmapLevels; + } + + public static int getMipmapType() + { + switch (gameSettings.ofMipmapType) + { + case 0: + return 9986; + + case 1: + return 9986; + + case 2: + if (isMultiTexture()) + { + return 9985; + } + + return 9986; + + case 3: + if (isMultiTexture()) + { + return 9987; + } + + return 9986; + + default: + return 9986; + } + } + + public static boolean isUseAlphaFunc() + { + float f = getAlphaFuncLevel(); + return f > DEF_ALPHA_FUNC_LEVEL.floatValue() + 1.0E-5F; + } + + public static float getAlphaFuncLevel() + { + return DEF_ALPHA_FUNC_LEVEL.floatValue(); + } + + public static boolean isFogFancy() + { + return !isFancyFogAvailable() ? false : gameSettings.ofFogType == 2; + } + + public static boolean isFogFast() + { + return gameSettings.ofFogType == 1; + } + + public static boolean isFogOff() + { + return gameSettings.ofFogType == 3; + } + + public static boolean isFogOn() + { + return gameSettings.ofFogType != 3; + } + + public static float getFogStart() + { + return gameSettings.ofFogStart; + } + + public static void detail(String p_detail_0_) + { + if (logDetail) + { + LOGGER.info("[OptiFine] " + p_detail_0_); + } + } + + public static void dbg(String p_dbg_0_) + { + LOGGER.info("[OptiFine] " + p_dbg_0_); + } + + public static void warn(String p_warn_0_) + { + LOGGER.warn("[OptiFine] " + p_warn_0_); + } + + public static void error(String p_error_0_) + { + LOGGER.error("[OptiFine] " + p_error_0_); + } + + public static void log(String p_log_0_) + { + dbg(p_log_0_); + } + + public static int getUpdatesPerFrame() + { + return gameSettings.ofChunkUpdates; + } + + public static boolean isDynamicUpdates() + { + return gameSettings.ofChunkUpdatesDynamic; + } + + public static boolean isRainFancy() + { + return gameSettings.ofRain == 0 ? gameSettings.fancyGraphics : gameSettings.ofRain == 2; + } + + public static boolean isRainOff() + { + return gameSettings.ofRain == 3; + } + + public static boolean isCloudsFancy() + { + return gameSettings.ofClouds != 0 ? gameSettings.ofClouds == 2 : (isShaders() && !Shaders.shaderPackClouds.isDefault() ? Shaders.shaderPackClouds.isFancy() : (texturePackClouds != 0 ? texturePackClouds == 2 : gameSettings.fancyGraphics)); + } + + public static boolean isCloudsOff() + { + return gameSettings.ofClouds != 0 ? gameSettings.ofClouds == 3 : (isShaders() && !Shaders.shaderPackClouds.isDefault() ? Shaders.shaderPackClouds.isOff() : (texturePackClouds != 0 ? texturePackClouds == 3 : false)); + } + + public static void updateTexturePackClouds() + { + texturePackClouds = 0; + IResourceManager iresourcemanager = getResourceManager(); + + if (iresourcemanager != null) + { + try + { + InputStream inputstream = iresourcemanager.getResource(new ResourceLocation("mcpatcher/color.properties")).getInputStream(); + + if (inputstream == null) + { + return; + } + + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + String s = properties.getProperty("clouds"); + + if (s == null) + { + return; + } + + dbg("Texture pack clouds: " + s); + s = s.toLowerCase(); + + if (s.equals("fast")) + { + texturePackClouds = 1; + } + + if (s.equals("fancy")) + { + texturePackClouds = 2; + } + + if (s.equals("off")) + { + texturePackClouds = 3; + } + } + catch (Exception var4) + { + ; + } + } + } + + public static ModelManager getModelManager() + { + return minecraft.getRenderItem().modelManager; + } + + public static boolean isTreesFancy() + { + return gameSettings.ofTrees == 0 ? gameSettings.fancyGraphics : gameSettings.ofTrees != 1; + } + + public static boolean isTreesSmart() + { + return gameSettings.ofTrees == 4; + } + + public static boolean isCullFacesLeaves() + { + return gameSettings.ofTrees == 0 ? !gameSettings.fancyGraphics : gameSettings.ofTrees == 4; + } + + public static boolean isDroppedItemsFancy() + { + return gameSettings.ofDroppedItems == 0 ? gameSettings.fancyGraphics : gameSettings.ofDroppedItems == 2; + } + + public static int limit(int p_limit_0_, int p_limit_1_, int p_limit_2_) + { + return p_limit_0_ < p_limit_1_ ? p_limit_1_ : (p_limit_0_ > p_limit_2_ ? p_limit_2_ : p_limit_0_); + } + + public static float limit(float p_limit_0_, float p_limit_1_, float p_limit_2_) + { + return p_limit_0_ < p_limit_1_ ? p_limit_1_ : (p_limit_0_ > p_limit_2_ ? p_limit_2_ : p_limit_0_); + } + + public static double limit(double p_limit_0_, double p_limit_2_, double p_limit_4_) + { + return p_limit_0_ < p_limit_2_ ? p_limit_2_ : (p_limit_0_ > p_limit_4_ ? p_limit_4_ : p_limit_0_); + } + + public static float limitTo1(float p_limitTo1_0_) + { + return p_limitTo1_0_ < 0.0F ? 0.0F : (p_limitTo1_0_ > 1.0F ? 1.0F : p_limitTo1_0_); + } + + public static boolean isAnimatedWater() + { + return gameSettings.ofAnimatedWater != 2; + } + + public static boolean isGeneratedWater() + { + return gameSettings.ofAnimatedWater == 1; + } + + public static boolean isAnimatedPortal() + { + return gameSettings.ofAnimatedPortal; + } + + public static boolean isAnimatedLava() + { + return gameSettings.ofAnimatedLava != 2; + } + + public static boolean isGeneratedLava() + { + return gameSettings.ofAnimatedLava == 1; + } + + public static boolean isAnimatedFire() + { + return gameSettings.ofAnimatedFire; + } + + public static boolean isAnimatedRedstone() + { + return gameSettings.ofAnimatedRedstone; + } + + public static boolean isAnimatedExplosion() + { + return gameSettings.ofAnimatedExplosion; + } + + public static boolean isAnimatedFlame() + { + return gameSettings.ofAnimatedFlame; + } + + public static boolean isAnimatedSmoke() + { + return gameSettings.ofAnimatedSmoke; + } + + public static boolean isVoidParticles() + { + return gameSettings.ofVoidParticles; + } + + public static boolean isWaterParticles() + { + return gameSettings.ofWaterParticles; + } + + public static boolean isRainSplash() + { + return gameSettings.ofRainSplash; + } + + public static boolean isPortalParticles() + { + return gameSettings.ofPortalParticles; + } + + public static boolean isPotionParticles() + { + return gameSettings.ofPotionParticles; + } + + public static boolean isFireworkParticles() + { + return gameSettings.ofFireworkParticles; + } + + public static float getAmbientOcclusionLevel() + { + return isShaders() && Shaders.aoLevel >= 0.0F ? Shaders.aoLevel : gameSettings.ofAoLevel; + } + + public static String listToString(List p_listToString_0_) + { + return listToString(p_listToString_0_, ", "); + } + + public static String listToString(List p_listToString_0_, String p_listToString_1_) + { + if (p_listToString_0_ == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(p_listToString_0_.size() * 5); + + for (int i = 0; i < p_listToString_0_.size(); ++i) + { + Object object = p_listToString_0_.get(i); + + if (i > 0) + { + stringbuffer.append(p_listToString_1_); + } + + stringbuffer.append(String.valueOf(object)); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToString(Object[] p_arrayToString_0_) + { + return arrayToString(p_arrayToString_0_, ", "); + } + + public static String arrayToString(Object[] p_arrayToString_0_, String p_arrayToString_1_) + { + if (p_arrayToString_0_ == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(p_arrayToString_0_.length * 5); + + for (int i = 0; i < p_arrayToString_0_.length; ++i) + { + Object object = p_arrayToString_0_[i]; + + if (i > 0) + { + stringbuffer.append(p_arrayToString_1_); + } + + stringbuffer.append(String.valueOf(object)); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToString(int[] p_arrayToString_0_) + { + return arrayToString(p_arrayToString_0_, ", "); + } + + public static String arrayToString(int[] p_arrayToString_0_, String p_arrayToString_1_) + { + if (p_arrayToString_0_ == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(p_arrayToString_0_.length * 5); + + for (int i = 0; i < p_arrayToString_0_.length; ++i) + { + int j = p_arrayToString_0_[i]; + + if (i > 0) + { + stringbuffer.append(p_arrayToString_1_); + } + + stringbuffer.append(String.valueOf(j)); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToString(float[] p_arrayToString_0_) + { + return arrayToString(p_arrayToString_0_, ", "); + } + + public static String arrayToString(float[] p_arrayToString_0_, String p_arrayToString_1_) + { + if (p_arrayToString_0_ == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(p_arrayToString_0_.length * 5); + + for (int i = 0; i < p_arrayToString_0_.length; ++i) + { + float f = p_arrayToString_0_[i]; + + if (i > 0) + { + stringbuffer.append(p_arrayToString_1_); + } + + stringbuffer.append(String.valueOf(f)); + } + + return stringbuffer.toString(); + } + } + + public static Minecraft getMinecraft() + { + return minecraft; + } + + public static TextureManager getTextureManager() + { + return minecraft.getTextureManager(); + } + + public static IResourceManager getResourceManager() + { + return minecraft.getResourceManager(); + } + + public static InputStream getResourceStream(ResourceLocation p_getResourceStream_0_) throws IOException + { + return getResourceStream(minecraft.getResourceManager(), p_getResourceStream_0_); + } + + public static InputStream getResourceStream(IResourceManager p_getResourceStream_0_, ResourceLocation p_getResourceStream_1_) throws IOException + { + IResource iresource = p_getResourceStream_0_.getResource(p_getResourceStream_1_); + return iresource == null ? null : iresource.getInputStream(); + } + + public static IResource getResource(ResourceLocation p_getResource_0_) throws IOException + { + return minecraft.getResourceManager().getResource(p_getResource_0_); + } + + public static boolean hasResource(ResourceLocation p_hasResource_0_) + { + if (p_hasResource_0_ == null) + { + return false; + } + else + { + IResourcePack iresourcepack = getDefiningResourcePack(p_hasResource_0_); + return iresourcepack != null; + } + } + + public static boolean hasResource(IResourceManager p_hasResource_0_, ResourceLocation p_hasResource_1_) + { + try + { + IResource iresource = p_hasResource_0_.getResource(p_hasResource_1_); + return iresource != null; + } + catch (IOException var3) + { + return false; + } + } + + public static IResourcePack[] getResourcePacks() + { + ResourcePackRepository resourcepackrepository = minecraft.getResourcePackRepository(); + List list = resourcepackrepository.getRepositoryEntries(); + List list1 = new ArrayList(); + + for (Object resourcepackrepository$entry0 : list) + { + ResourcePackRepository.Entry resourcepackrepository$entry = (ResourcePackRepository.Entry) resourcepackrepository$entry0; + list1.add(resourcepackrepository$entry.getResourcePack()); + } + + if (resourcepackrepository.getResourcePackInstance() != null) + { + list1.add(resourcepackrepository.getResourcePackInstance()); + } + + IResourcePack[] airesourcepack = (IResourcePack[])((IResourcePack[])list1.toArray(new IResourcePack[list1.size()])); + return airesourcepack; + } + + public static String getResourcePackNames() + { + if (minecraft.getResourcePackRepository() == null) + { + return ""; + } + else + { + IResourcePack[] airesourcepack = getResourcePacks(); + + if (airesourcepack.length <= 0) + { + return getDefaultResourcePack().getPackName(); + } + else + { + String[] astring = new String[airesourcepack.length]; + + for (int i = 0; i < airesourcepack.length; ++i) + { + astring[i] = airesourcepack[i].getPackName(); + } + + String s = arrayToString((Object[])astring); + return s; + } + } + } + + public static DefaultResourcePack getDefaultResourcePack() + { + if (defaultResourcePackLazy == null) + { + Minecraft minecraft = Minecraft.getMinecraft(); + defaultResourcePackLazy = (DefaultResourcePack)Reflector.getFieldValue(minecraft, Reflector.Minecraft_defaultResourcePack); + + if (defaultResourcePackLazy == null) + { + ResourcePackRepository resourcepackrepository = minecraft.getResourcePackRepository(); + + if (resourcepackrepository != null) + { + defaultResourcePackLazy = (DefaultResourcePack)resourcepackrepository.rprDefaultResourcePack; + } + } + } + + return defaultResourcePackLazy; + } + + public static boolean isFromDefaultResourcePack(ResourceLocation p_isFromDefaultResourcePack_0_) + { + IResourcePack iresourcepack = getDefiningResourcePack(p_isFromDefaultResourcePack_0_); + return iresourcepack == getDefaultResourcePack(); + } + + public static IResourcePack getDefiningResourcePack(ResourceLocation p_getDefiningResourcePack_0_) + { + ResourcePackRepository resourcepackrepository = minecraft.getResourcePackRepository(); + IResourcePack iresourcepack = resourcepackrepository.getResourcePackInstance(); + + if (iresourcepack != null && iresourcepack.resourceExists(p_getDefiningResourcePack_0_)) + { + return iresourcepack; + } + else + { + List list = resourcepackrepository.repositoryEntries; + + for (int i = list.size() - 1; i >= 0; --i) + { + ResourcePackRepository.Entry resourcepackrepository$entry = (ResourcePackRepository.Entry)list.get(i); + IResourcePack iresourcepack1 = resourcepackrepository$entry.getResourcePack(); + + if (iresourcepack1.resourceExists(p_getDefiningResourcePack_0_)) + { + return iresourcepack1; + } + } + + if (getDefaultResourcePack().resourceExists(p_getDefiningResourcePack_0_)) + { + return getDefaultResourcePack(); + } + else + { + return null; + } + } + } + + public static RenderGlobal getRenderGlobal() + { + return minecraft.renderGlobal; + } + + public static boolean isBetterGrass() + { + return gameSettings.ofBetterGrass != 3; + } + + public static boolean isBetterGrassFancy() + { + return gameSettings.ofBetterGrass == 2; + } + + public static boolean isWeatherEnabled() + { + return gameSettings.ofWeather; + } + + public static boolean isSkyEnabled() + { + return gameSettings.ofSky; + } + + public static boolean isSunMoonEnabled() + { + return gameSettings.ofSunMoon; + } + + public static boolean isSunTexture() + { + return !isSunMoonEnabled() ? false : !isShaders() || Shaders.isSun(); + } + + public static boolean isMoonTexture() + { + return !isSunMoonEnabled() ? false : !isShaders() || Shaders.isMoon(); + } + + public static boolean isVignetteEnabled() + { + return isShaders() && !Shaders.isVignette() ? false : (gameSettings.ofVignette == 0 ? gameSettings.fancyGraphics : gameSettings.ofVignette == 2); + } + + public static boolean isStarsEnabled() + { + return gameSettings.ofStars; + } + + public static void sleep(long p_sleep_0_) + { + try + { + Thread.sleep(p_sleep_0_); + } + catch (InterruptedException interruptedexception) + { + interruptedexception.printStackTrace(); + } + } + + public static boolean isTimeDayOnly() + { + return gameSettings.ofTime == 1; + } + + public static boolean isTimeDefault() + { + return gameSettings.ofTime == 0; + } + + public static boolean isTimeNightOnly() + { + return gameSettings.ofTime == 2; + } + + public static boolean isClearWater() + { + return gameSettings.ofClearWater; + } + + public static int getAnisotropicFilterLevel() + { + return gameSettings.ofAfLevel; + } + + public static boolean isAnisotropicFiltering() + { + return getAnisotropicFilterLevel() > 1; + } + + public static int getAntialiasingLevel() + { + return antialiasingLevel; + } + + public static boolean isAntialiasing() + { + return getAntialiasingLevel() > 0; + } + + public static boolean isAntialiasingConfigured() + { + return getGameSettings().ofAaLevel > 0; + } + + public static boolean isMultiTexture() + { + return getAnisotropicFilterLevel() > 1 ? true : getAntialiasingLevel() > 0; + } + + public static boolean between(int p_between_0_, int p_between_1_, int p_between_2_) + { + return p_between_0_ >= p_between_1_ && p_between_0_ <= p_between_2_; + } + + public static boolean between(float p_between_0_, float p_between_1_, float p_between_2_) + { + return p_between_0_ >= p_between_1_ && p_between_0_ <= p_between_2_; + } + + public static boolean isDrippingWaterLava() + { + return gameSettings.ofDrippingWaterLava; + } + + public static boolean isBetterSnow() + { + return gameSettings.ofBetterSnow; + } + + public static Dimension getFullscreenDimension() + { + if (desktopDisplayMode == null) + { + return null; + } + else if (gameSettings == null) + { + return new Dimension(desktopDisplayMode.getWidth(), desktopDisplayMode.getHeight()); + } + else + { + String s = gameSettings.ofFullscreenMode; + + if (s.equals("Default")) + { + return new Dimension(desktopDisplayMode.getWidth(), desktopDisplayMode.getHeight()); + } + else + { + String[] astring = tokenize(s, " x"); + return astring.length < 2 ? new Dimension(desktopDisplayMode.getWidth(), desktopDisplayMode.getHeight()) : new Dimension(parseInt(astring[0], -1), parseInt(astring[1], -1)); + } + } + } + + public static int parseInt(String p_parseInt_0_, int p_parseInt_1_) + { + try + { + if (p_parseInt_0_ == null) + { + return p_parseInt_1_; + } + else + { + p_parseInt_0_ = p_parseInt_0_.trim(); + return Integer.parseInt(p_parseInt_0_); + } + } + catch (NumberFormatException var3) + { + return p_parseInt_1_; + } + } + + public static float parseFloat(String p_parseFloat_0_, float p_parseFloat_1_) + { + try + { + if (p_parseFloat_0_ == null) + { + return p_parseFloat_1_; + } + else + { + p_parseFloat_0_ = p_parseFloat_0_.trim(); + return Float.parseFloat(p_parseFloat_0_); + } + } + catch (NumberFormatException var3) + { + return p_parseFloat_1_; + } + } + + public static boolean parseBoolean(String p_parseBoolean_0_, boolean p_parseBoolean_1_) + { + try + { + if (p_parseBoolean_0_ == null) + { + return p_parseBoolean_1_; + } + else + { + p_parseBoolean_0_ = p_parseBoolean_0_.trim(); + return Boolean.parseBoolean(p_parseBoolean_0_); + } + } + catch (NumberFormatException var3) + { + return p_parseBoolean_1_; + } + } + + public static Boolean parseBoolean(String p_parseBoolean_0_, Boolean p_parseBoolean_1_) + { + try + { + if (p_parseBoolean_0_ == null) + { + return p_parseBoolean_1_; + } + else + { + p_parseBoolean_0_ = p_parseBoolean_0_.trim().toLowerCase(); + return p_parseBoolean_0_.equals("true") ? Boolean.TRUE : (p_parseBoolean_0_.equals("false") ? Boolean.FALSE : p_parseBoolean_1_); + } + } + catch (NumberFormatException var3) + { + return p_parseBoolean_1_; + } + } + + public static String[] tokenize(String p_tokenize_0_, String p_tokenize_1_) + { + StringTokenizer stringtokenizer = new StringTokenizer(p_tokenize_0_, p_tokenize_1_); + List list = new ArrayList(); + + while (stringtokenizer.hasMoreTokens()) + { + String s = stringtokenizer.nextToken(); + list.add(s); + } + + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } + + public static DisplayMode getDesktopDisplayMode() + { + return desktopDisplayMode; + } + + public static DisplayMode[] getDisplayModes() + { + if (displayModes == null) + { + try + { + DisplayMode[] adisplaymode = Display.getAvailableDisplayModes(); + Set set = getDisplayModeDimensions(adisplaymode); + List list = new ArrayList(); + + for (Dimension dimension : set) + { + DisplayMode[] adisplaymode1 = getDisplayModes(adisplaymode, dimension); + DisplayMode displaymode = getDisplayMode(adisplaymode1, desktopDisplayMode); + + if (displaymode != null) + { + list.add(displaymode); + } + } + + DisplayMode[] adisplaymode2 = (DisplayMode[])((DisplayMode[])list.toArray(new DisplayMode[list.size()])); + Arrays.sort(adisplaymode2, new DisplayModeComparator()); + return adisplaymode2; + } + catch (Exception exception) + { + exception.printStackTrace(); + displayModes = new DisplayMode[] {desktopDisplayMode}; + } + } + + return displayModes; + } + + public static DisplayMode getLargestDisplayMode() + { + DisplayMode[] adisplaymode = getDisplayModes(); + + if (adisplaymode != null && adisplaymode.length >= 1) + { + DisplayMode displaymode = adisplaymode[adisplaymode.length - 1]; + return desktopDisplayMode.getWidth() > displaymode.getWidth() ? desktopDisplayMode : (desktopDisplayMode.getWidth() == displaymode.getWidth() && desktopDisplayMode.getHeight() > displaymode.getHeight() ? desktopDisplayMode : displaymode); + } + else + { + return desktopDisplayMode; + } + } + + private static Set getDisplayModeDimensions(DisplayMode[] p_getDisplayModeDimensions_0_) + { + Set set = new HashSet(); + + for (int i = 0; i < p_getDisplayModeDimensions_0_.length; ++i) + { + DisplayMode displaymode = p_getDisplayModeDimensions_0_[i]; + Dimension dimension = new Dimension(displaymode.getWidth(), displaymode.getHeight()); + set.add(dimension); + } + + return set; + } + + private static DisplayMode[] getDisplayModes(DisplayMode[] p_getDisplayModes_0_, Dimension p_getDisplayModes_1_) + { + List list = new ArrayList(); + + for (int i = 0; i < p_getDisplayModes_0_.length; ++i) + { + DisplayMode displaymode = p_getDisplayModes_0_[i]; + + if ((double)displaymode.getWidth() == p_getDisplayModes_1_.getWidth() && (double)displaymode.getHeight() == p_getDisplayModes_1_.getHeight()) + { + list.add(displaymode); + } + } + + DisplayMode[] adisplaymode = (DisplayMode[])((DisplayMode[])list.toArray(new DisplayMode[list.size()])); + return adisplaymode; + } + + private static DisplayMode getDisplayMode(DisplayMode[] p_getDisplayMode_0_, DisplayMode p_getDisplayMode_1_) + { + if (p_getDisplayMode_1_ != null) + { + for (int i = 0; i < p_getDisplayMode_0_.length; ++i) + { + DisplayMode displaymode = p_getDisplayMode_0_[i]; + + if (displaymode.getBitsPerPixel() == p_getDisplayMode_1_.getBitsPerPixel() && displaymode.getFrequency() == p_getDisplayMode_1_.getFrequency()) + { + return displaymode; + } + } + } + + if (p_getDisplayMode_0_.length <= 0) + { + return null; + } + else + { + Arrays.sort(p_getDisplayMode_0_, new DisplayModeComparator()); + return p_getDisplayMode_0_[p_getDisplayMode_0_.length - 1]; + } + } + + public static String[] getDisplayModeNames() + { + DisplayMode[] adisplaymode = getDisplayModes(); + String[] astring = new String[adisplaymode.length]; + + for (int i = 0; i < adisplaymode.length; ++i) + { + DisplayMode displaymode = adisplaymode[i]; + String s = "" + displaymode.getWidth() + "x" + displaymode.getHeight(); + astring[i] = s; + } + + return astring; + } + + public static DisplayMode getDisplayMode(Dimension p_getDisplayMode_0_) throws LWJGLException + { + DisplayMode[] adisplaymode = getDisplayModes(); + + for (int i = 0; i < adisplaymode.length; ++i) + { + DisplayMode displaymode = adisplaymode[i]; + + if (displaymode.getWidth() == p_getDisplayMode_0_.width && displaymode.getHeight() == p_getDisplayMode_0_.height) + { + return displaymode; + } + } + + return desktopDisplayMode; + } + + public static boolean isAnimatedTerrain() + { + return gameSettings.ofAnimatedTerrain; + } + + public static boolean isAnimatedTextures() + { + return gameSettings.ofAnimatedTextures; + } + + public static boolean isSwampColors() + { + return gameSettings.ofSwampColors; + } + + public static boolean isRandomEntities() + { + return gameSettings.ofRandomEntities; + } + + public static void checkGlError(String p_checkGlError_0_) + { + int i = GlStateManager.glGetError(); + + if (i != 0 && GlErrors.isEnabled(i)) + { + String s = getGlErrorString(i); + String s1 = String.format("OpenGL error: %s (%s), at: %s", new Object[] {Integer.valueOf(i), s, p_checkGlError_0_}); + error(s1); + + if (isShowGlErrors() && TimedEvent.isActive("ShowGlError", 10000L)) + { + String s2 = I18n.format("of.message.openglError", new Object[] {Integer.valueOf(i), s}); + minecraft.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(s2)); + } + } + } + + public static boolean isSmoothBiomes() + { + return gameSettings.ofSmoothBiomes; + } + + public static boolean isCustomColors() + { + return gameSettings.ofCustomColors; + } + + public static boolean isCustomSky() + { + return gameSettings.ofCustomSky; + } + + public static boolean isCustomFonts() + { + return gameSettings.ofCustomFonts; + } + + public static boolean isShowCapes() + { + return gameSettings.ofShowCapes; + } + + public static boolean isConnectedTextures() + { + return gameSettings.ofConnectedTextures != 3; + } + + public static boolean isNaturalTextures() + { + return gameSettings.ofNaturalTextures; + } + + public static boolean isEmissiveTextures() + { + return gameSettings.ofEmissiveTextures; + } + + public static boolean isConnectedTexturesFancy() + { + return gameSettings.ofConnectedTextures == 2; + } + + public static boolean isFastRender() + { + return gameSettings.ofFastRender; + } + + public static boolean isTranslucentBlocksFancy() + { + return gameSettings.ofTranslucentBlocks == 0 ? gameSettings.fancyGraphics : gameSettings.ofTranslucentBlocks == 2; + } + + public static boolean isShaders() + { + return Shaders.shaderPackLoaded; + } + + public static String[] readLines(File p_readLines_0_) throws IOException + { + FileInputStream fileinputstream = new FileInputStream(p_readLines_0_); + return readLines((InputStream)fileinputstream); + } + + public static String[] readLines(InputStream p_readLines_0_) throws IOException + { + List list = new ArrayList(); + InputStreamReader inputstreamreader = new InputStreamReader(p_readLines_0_, "ASCII"); + BufferedReader bufferedreader = new BufferedReader(inputstreamreader); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } + + list.add(s); + } + } + + public static String readFile(File p_readFile_0_) throws IOException + { + FileInputStream fileinputstream = new FileInputStream(p_readFile_0_); + return readInputStream(fileinputstream, "ASCII"); + } + + public static String readInputStream(InputStream p_readInputStream_0_) throws IOException + { + return readInputStream(p_readInputStream_0_, "ASCII"); + } + + public static String readInputStream(InputStream p_readInputStream_0_, String p_readInputStream_1_) throws IOException + { + InputStreamReader inputstreamreader = new InputStreamReader(p_readInputStream_0_, p_readInputStream_1_); + BufferedReader bufferedreader = new BufferedReader(inputstreamreader); + StringBuffer stringbuffer = new StringBuffer(); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + return stringbuffer.toString(); + } + + stringbuffer.append(s); + stringbuffer.append("\n"); + } + } + + public static byte[] readAll(InputStream p_readAll_0_) throws IOException + { + ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); + byte[] abyte = new byte[1024]; + + while (true) + { + int i = p_readAll_0_.read(abyte); + + if (i < 0) + { + p_readAll_0_.close(); + byte[] abyte1 = bytearrayoutputstream.toByteArray(); + return abyte1; + } + + bytearrayoutputstream.write(abyte, 0, i); + } + } + + public static GameSettings getGameSettings() + { + return gameSettings; + } + + public static String getNewRelease() + { + return newRelease; + } + + public static void setNewRelease(String p_setNewRelease_0_) + { + newRelease = p_setNewRelease_0_; + } + + public static int compareRelease(String p_compareRelease_0_, String p_compareRelease_1_) + { + String[] astring = splitRelease(p_compareRelease_0_); + String[] astring1 = splitRelease(p_compareRelease_1_); + String s = astring[0]; + String s1 = astring1[0]; + + if (!s.equals(s1)) + { + return s.compareTo(s1); + } + else + { + int i = parseInt(astring[1], -1); + int j = parseInt(astring1[1], -1); + + if (i != j) + { + return i - j; + } + else + { + String s2 = astring[2]; + String s3 = astring1[2]; + + if (!s2.equals(s3)) + { + if (s2.isEmpty()) + { + return 1; + } + + if (s3.isEmpty()) + { + return -1; + } + } + + return s2.compareTo(s3); + } + } + } + + private static String[] splitRelease(String p_splitRelease_0_) + { + if (p_splitRelease_0_ != null && p_splitRelease_0_.length() > 0) + { + Pattern pattern = Pattern.compile("([A-Z])([0-9]+)(.*)"); + Matcher matcher = pattern.matcher(p_splitRelease_0_); + + if (!matcher.matches()) + { + return new String[] {"", "", ""}; + } + else + { + String s = normalize(matcher.group(1)); + String s1 = normalize(matcher.group(2)); + String s2 = normalize(matcher.group(3)); + return new String[] {s, s1, s2}; + } + } + else + { + return new String[] {"", "", ""}; + } + } + + public static int intHash(int p_intHash_0_) + { + p_intHash_0_ = p_intHash_0_ ^ 61 ^ p_intHash_0_ >> 16; + p_intHash_0_ = p_intHash_0_ + (p_intHash_0_ << 3); + p_intHash_0_ = p_intHash_0_ ^ p_intHash_0_ >> 4; + p_intHash_0_ = p_intHash_0_ * 668265261; + p_intHash_0_ = p_intHash_0_ ^ p_intHash_0_ >> 15; + return p_intHash_0_; + } + + public static int getRandom(BlockPos p_getRandom_0_, int p_getRandom_1_) + { + int i = intHash(p_getRandom_1_ + 37); + i = intHash(i + p_getRandom_0_.getX()); + i = intHash(i + p_getRandom_0_.getZ()); + i = intHash(i + p_getRandom_0_.getY()); + return i; + } + + public static int getAvailableProcessors() + { + return availableProcessors; + } + + public static void updateAvailableProcessors() + { + availableProcessors = Runtime.getRuntime().availableProcessors(); + } + + public static boolean isSingleProcessor() + { + return getAvailableProcessors() <= 1; + } + + public static boolean isSmoothWorld() + { + return gameSettings.ofSmoothWorld; + } + + public static boolean isLazyChunkLoading() + { + return gameSettings.ofLazyChunkLoading; + } + + public static boolean isDynamicFov() + { + return gameSettings.ofDynamicFov; + } + + public static boolean isAlternateBlocks() + { + return gameSettings.ofAlternateBlocks; + } + + public static int getChunkViewDistance() + { + if (gameSettings == null) + { + return 10; + } + else + { + int i = gameSettings.renderDistanceChunks; + return i; + } + } + + public static boolean equals(Object p_equals_0_, Object p_equals_1_) + { + return p_equals_0_ == p_equals_1_ ? true : (p_equals_0_ == null ? false : p_equals_0_.equals(p_equals_1_)); + } + + public static boolean equalsOne(Object p_equalsOne_0_, Object[] p_equalsOne_1_) + { + if (p_equalsOne_1_ == null) + { + return false; + } + else + { + for (int i = 0; i < p_equalsOne_1_.length; ++i) + { + Object object = p_equalsOne_1_[i]; + + if (equals(p_equalsOne_0_, object)) + { + return true; + } + } + + return false; + } + } + + public static boolean equalsOne(int p_equalsOne_0_, int[] p_equalsOne_1_) + { + for (int i = 0; i < p_equalsOne_1_.length; ++i) + { + if (p_equalsOne_1_[i] == p_equalsOne_0_) + { + return true; + } + } + + return false; + } + + public static boolean isSameOne(Object p_isSameOne_0_, Object[] p_isSameOne_1_) + { + if (p_isSameOne_1_ == null) + { + return false; + } + else + { + for (int i = 0; i < p_isSameOne_1_.length; ++i) + { + Object object = p_isSameOne_1_[i]; + + if (p_isSameOne_0_ == object) + { + return true; + } + } + + return false; + } + } + + public static String normalize(String p_normalize_0_) + { + return p_normalize_0_ == null ? "" : p_normalize_0_; + } + + public static void checkDisplaySettings() + { + int i = getAntialiasingLevel(); + + if (i > 0) + { + DisplayMode displaymode = Display.getDisplayMode(); + dbg("FSAA Samples: " + i); + + try + { + Display.destroy(); + Display.setDisplayMode(displaymode); + Display.create((new PixelFormat()).withDepthBits(24).withSamples(i)); + + if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + Display.setResizable(false); + Display.setResizable(true); + } + } + catch (LWJGLException lwjglexception2) + { + warn("Error setting FSAA: " + i + "x"); + lwjglexception2.printStackTrace(); + + try + { + Display.setDisplayMode(displaymode); + Display.create((new PixelFormat()).withDepthBits(24)); + + if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + Display.setResizable(false); + Display.setResizable(true); + } + } + catch (LWJGLException lwjglexception1) + { + lwjglexception1.printStackTrace(); + + try + { + Display.setDisplayMode(displaymode); + Display.create(); + + if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + Display.setResizable(false); + Display.setResizable(true); + } + } + catch (LWJGLException lwjglexception) + { + lwjglexception.printStackTrace(); + } + } + } + + if (!Minecraft.isRunningOnMac && getDefaultResourcePack() != null) + { + InputStream inputstream = null; + InputStream inputstream1 = null; + + try + { + inputstream = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_16x16.png")); + inputstream1 = getDefaultResourcePack().getInputStreamAssets(new ResourceLocation("icons/icon_32x32.png")); + + if (inputstream != null && inputstream1 != null) + { + Display.setIcon(new ByteBuffer[] {readIconImage(inputstream), readIconImage(inputstream1)}); + } + } + catch (IOException ioexception) + { + warn("Error setting window icon: " + ioexception.getClass().getName() + ": " + ioexception.getMessage()); + } + finally + { + IOUtils.closeQuietly(inputstream); + IOUtils.closeQuietly(inputstream1); + } + } + } + } + + private static ByteBuffer readIconImage(InputStream p_readIconImage_0_) throws IOException + { + BufferedImage bufferedimage = ImageIO.read(p_readIconImage_0_); + int[] aint = bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), (int[])null, 0, bufferedimage.getWidth()); + ByteBuffer bytebuffer = ByteBuffer.allocate(4 * aint.length); + + for (int i : aint) + { + bytebuffer.putInt(i << 8 | i >> 24 & 255); + } + + bytebuffer.flip(); + return bytebuffer; + } + + public static void checkDisplayMode() + { + try + { + if (minecraft.isFullScreen()) + { + if (fullscreenModeChecked) + { + return; + } + + fullscreenModeChecked = true; + desktopModeChecked = false; + DisplayMode displaymode = Display.getDisplayMode(); + Dimension dimension = getFullscreenDimension(); + + if (dimension == null) + { + return; + } + + if (displaymode.getWidth() == dimension.width && displaymode.getHeight() == dimension.height) + { + return; + } + + DisplayMode displaymode1 = getDisplayMode(dimension); + + if (displaymode1 == null) + { + return; + } + + Display.setDisplayMode(displaymode1); + minecraft.displayWidth = Display.getDisplayMode().getWidth(); + minecraft.displayHeight = Display.getDisplayMode().getHeight(); + + if (minecraft.displayWidth <= 0) + { + minecraft.displayWidth = 1; + } + + if (minecraft.displayHeight <= 0) + { + minecraft.displayHeight = 1; + } + + if (minecraft.currentScreen != null) + { + ScaledResolution scaledresolution = new ScaledResolution(minecraft); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + minecraft.currentScreen.setWorldAndResolution(minecraft, i, j); + } + + updateFramebufferSize(); + Display.setFullscreen(true); + minecraft.gameSettings.updateVSync(); + GlStateManager.enableTexture2D(); + } + else + { + if (desktopModeChecked) + { + return; + } + + desktopModeChecked = true; + fullscreenModeChecked = false; + minecraft.gameSettings.updateVSync(); + Display.update(); + GlStateManager.enableTexture2D(); + + if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + Display.setResizable(false); + Display.setResizable(true); + } + } + } + catch (Exception exception) + { + exception.printStackTrace(); + gameSettings.ofFullscreenMode = "Default"; + gameSettings.saveOfOptions(); + } + } + + public static void updateFramebufferSize() + { + minecraft.getFramebuffer().createBindFramebuffer(minecraft.displayWidth, minecraft.displayHeight); + + if (minecraft.entityRenderer != null) + { + minecraft.entityRenderer.updateShaderGroupSize(minecraft.displayWidth, minecraft.displayHeight); + } + + minecraft.loadingScreen = new LoadingScreenRenderer(minecraft); + } + + public static Object[] addObjectToArray(Object[] p_addObjectToArray_0_, Object p_addObjectToArray_1_) + { + if (p_addObjectToArray_0_ == null) + { + throw new NullPointerException("The given array is NULL"); + } + else + { + int i = p_addObjectToArray_0_.length; + int j = i + 1; + Object[] aobject = (Object[])((Object[])Array.newInstance(p_addObjectToArray_0_.getClass().getComponentType(), j)); + System.arraycopy(p_addObjectToArray_0_, 0, aobject, 0, i); + aobject[i] = p_addObjectToArray_1_; + return aobject; + } + } + + public static Object[] addObjectToArray(Object[] p_addObjectToArray_0_, Object p_addObjectToArray_1_, int p_addObjectToArray_2_) + { + List list = new ArrayList(Arrays.asList(p_addObjectToArray_0_)); + list.add(p_addObjectToArray_2_, p_addObjectToArray_1_); + Object[] aobject = (Object[])((Object[])Array.newInstance(p_addObjectToArray_0_.getClass().getComponentType(), list.size())); + return list.toArray(aobject); + } + + public static Object[] addObjectsToArray(Object[] p_addObjectsToArray_0_, Object[] p_addObjectsToArray_1_) + { + if (p_addObjectsToArray_0_ == null) + { + throw new NullPointerException("The given array is NULL"); + } + else if (p_addObjectsToArray_1_.length == 0) + { + return p_addObjectsToArray_0_; + } + else + { + int i = p_addObjectsToArray_0_.length; + int j = i + p_addObjectsToArray_1_.length; + Object[] aobject = (Object[])((Object[])Array.newInstance(p_addObjectsToArray_0_.getClass().getComponentType(), j)); + System.arraycopy(p_addObjectsToArray_0_, 0, aobject, 0, i); + System.arraycopy(p_addObjectsToArray_1_, 0, aobject, i, p_addObjectsToArray_1_.length); + return aobject; + } + } + + public static Object[] removeObjectFromArray(Object[] p_removeObjectFromArray_0_, Object p_removeObjectFromArray_1_) + { + List list = new ArrayList(Arrays.asList(p_removeObjectFromArray_0_)); + list.remove(p_removeObjectFromArray_1_); + Object[] aobject = collectionToArray(list, p_removeObjectFromArray_0_.getClass().getComponentType()); + return aobject; + } + + public static Object[] collectionToArray(Collection p_collectionToArray_0_, Class p_collectionToArray_1_) + { + if (p_collectionToArray_0_ == null) + { + return null; + } + else if (p_collectionToArray_1_ == null) + { + return null; + } + else if (p_collectionToArray_1_.isPrimitive()) + { + throw new IllegalArgumentException("Can not make arrays with primitive elements (int, double), element class: " + p_collectionToArray_1_); + } + else + { + Object[] aobject = (Object[])((Object[])Array.newInstance(p_collectionToArray_1_, p_collectionToArray_0_.size())); + return p_collectionToArray_0_.toArray(aobject); + } + } + + public static boolean isCustomItems() + { + return gameSettings.ofCustomItems; + } + + public static void drawFps() + { + int i = Minecraft.getDebugFPS(); + String s = getUpdates(minecraft.debug); + int j = minecraft.renderGlobal.getCountActiveRenderers(); + int k = minecraft.renderGlobal.getCountEntitiesRendered(); + int l = minecraft.renderGlobal.getCountTileEntitiesRendered(); + String s1 = "" + i + "/" + getFpsMin() + " fps, C: " + j + ", E: " + k + "+" + l + ", U: " + s; + minecraft.fontRendererObj.drawString(s1, 2, 2, -2039584); + } + + public static int getFpsMin() + { + if (minecraft.debug == mcDebugLast) + { + return fpsMinLast; + } + else + { + mcDebugLast = minecraft.debug; + FrameTimer frametimer = minecraft.getFrameTimer(); + long[] along = frametimer.getFrames(); + int i = frametimer.getIndex(); + int j = frametimer.getLastIndex(); + + if (i == j) + { + return fpsMinLast; + } + else + { + int k = Minecraft.getDebugFPS(); + + if (k <= 0) + { + k = 1; + } + + long l = (long)(1.0D / (double)k * 1.0E9D); + long i1 = l; + long j1 = 0L; + + for (int k1 = MathHelper.normalizeAngle(i - 1, along.length); k1 != j && (double)j1 < 1.0E9D; k1 = MathHelper.normalizeAngle(k1 - 1, along.length)) + { + long l1 = along[k1]; + + if (l1 > i1) + { + i1 = l1; + } + + j1 += l1; + } + + double d0 = (double)i1 / 1.0E9D; + fpsMinLast = (int)(1.0D / d0); + return fpsMinLast; + } + } + } + + private static String getUpdates(String p_getUpdates_0_) + { + int i = p_getUpdates_0_.indexOf(40); + + if (i < 0) + { + return ""; + } + else + { + int j = p_getUpdates_0_.indexOf(32, i); + return j < 0 ? "" : p_getUpdates_0_.substring(i + 1, j); + } + } + + public static int getBitsOs() + { + String s = System.getenv("ProgramFiles(X86)"); + return s != null ? 64 : 32; + } + + public static int getBitsJre() + { + String[] astring = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + String s1 = System.getProperty(s); + + if (s1 != null && s1.contains("64")) + { + return 64; + } + } + + return 32; + } + + public static boolean isNotify64BitJava() + { + return notify64BitJava; + } + + public static void setNotify64BitJava(boolean p_setNotify64BitJava_0_) + { + notify64BitJava = p_setNotify64BitJava_0_; + } + + public static boolean isConnectedModels() + { + return false; + } + + public static void showGuiMessage(String p_showGuiMessage_0_, String p_showGuiMessage_1_) + { + GuiMessage guimessage = new GuiMessage(minecraft.currentScreen, p_showGuiMessage_0_, p_showGuiMessage_1_); + minecraft.displayGuiScreen(guimessage); + } + + public static int[] addIntToArray(int[] p_addIntToArray_0_, int p_addIntToArray_1_) + { + return addIntsToArray(p_addIntToArray_0_, new int[] {p_addIntToArray_1_}); + } + + public static int[] addIntsToArray(int[] p_addIntsToArray_0_, int[] p_addIntsToArray_1_) + { + if (p_addIntsToArray_0_ != null && p_addIntsToArray_1_ != null) + { + int i = p_addIntsToArray_0_.length; + int j = i + p_addIntsToArray_1_.length; + int[] aint = new int[j]; + System.arraycopy(p_addIntsToArray_0_, 0, aint, 0, i); + + for (int k = 0; k < p_addIntsToArray_1_.length; ++k) + { + aint[k + i] = p_addIntsToArray_1_[k]; + } + + return aint; + } + else + { + throw new NullPointerException("The given array is NULL"); + } + } + + public static DynamicTexture getMojangLogoTexture(DynamicTexture p_getMojangLogoTexture_0_) + { + try + { + ResourceLocation resourcelocation = new ResourceLocation("textures/gui/title/mojang.png"); + InputStream inputstream = getResourceStream(resourcelocation); + + if (inputstream == null) + { + return p_getMojangLogoTexture_0_; + } + else + { + BufferedImage bufferedimage = ImageIO.read(inputstream); + + if (bufferedimage == null) + { + return p_getMojangLogoTexture_0_; + } + else + { + DynamicTexture dynamictexture = new DynamicTexture(bufferedimage); + return dynamictexture; + } + } + } + catch (Exception exception) + { + warn(exception.getClass().getName() + ": " + exception.getMessage()); + return p_getMojangLogoTexture_0_; + } + } + + public static void writeFile(File p_writeFile_0_, String p_writeFile_1_) throws IOException + { + FileOutputStream fileoutputstream = new FileOutputStream(p_writeFile_0_); + byte[] abyte = p_writeFile_1_.getBytes("ASCII"); + fileoutputstream.write(abyte); + fileoutputstream.close(); + } + + public static TextureMap getTextureMap() + { + return getMinecraft().getTextureMapBlocks(); + } + + public static boolean isDynamicLights() + { + return gameSettings.ofDynamicLights != 3; + } + + public static boolean isDynamicLightsFast() + { + return gameSettings.ofDynamicLights == 1; + } + + public static boolean isDynamicHandLight() + { + return !isDynamicLights() ? false : (isShaders() ? Shaders.isDynamicHandLight() : true); + } + + public static boolean isCustomEntityModels() + { + return gameSettings.ofCustomEntityModels; + } + + public static boolean isCustomGuis() + { + return gameSettings.ofCustomGuis; + } + + public static int getScreenshotSize() + { + return gameSettings.ofScreenshotSize; + } + + public static int[] toPrimitive(Integer[] p_toPrimitive_0_) + { + if (p_toPrimitive_0_ == null) + { + return null; + } + else if (p_toPrimitive_0_.length == 0) + { + return new int[0]; + } + else + { + int[] aint = new int[p_toPrimitive_0_.length]; + + for (int i = 0; i < aint.length; ++i) + { + aint[i] = p_toPrimitive_0_[i].intValue(); + } + + return aint; + } + } + + public static boolean isRenderRegions() + { + return gameSettings.ofRenderRegions; + } + + public static boolean isVbo() + { + return OpenGlHelper.useVbo(); + } + + public static boolean isSmoothFps() + { + return gameSettings.ofSmoothFps; + } + + public static boolean openWebLink(URI p_openWebLink_0_) + { + try + { + Desktop.getDesktop().browse(p_openWebLink_0_); + return true; + } + catch (Exception exception) + { + warn("Error opening link: " + p_openWebLink_0_); + warn(exception.getClass().getName() + ": " + exception.getMessage()); + return false; + } + } + + public static boolean isShowGlErrors() + { + return gameSettings.ofShowGlErrors; + } + + public static String arrayToString(boolean[] p_arrayToString_0_, String p_arrayToString_1_) + { + if (p_arrayToString_0_ == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(p_arrayToString_0_.length * 5); + + for (int i = 0; i < p_arrayToString_0_.length; ++i) + { + boolean flag = p_arrayToString_0_[i]; + + if (i > 0) + { + stringbuffer.append(p_arrayToString_1_); + } + + stringbuffer.append(String.valueOf(flag)); + } + + return stringbuffer.toString(); + } + } + + public static boolean isIntegratedServerRunning() + { + return minecraft.getIntegratedServer() == null ? false : minecraft.isIntegratedServerRunning(); + } + + public static IntBuffer createDirectIntBuffer(int p_createDirectIntBuffer_0_) + { + return GLAllocation.createDirectByteBuffer(p_createDirectIntBuffer_0_ << 2).asIntBuffer(); + } + + public static String getGlErrorString(int p_getGlErrorString_0_) + { + switch (p_getGlErrorString_0_) + { + case 0: + return "No error"; + + case 1280: + return "Invalid enum"; + + case 1281: + return "Invalid value"; + + case 1282: + return "Invalid operation"; + + case 1283: + return "Stack overflow"; + + case 1284: + return "Stack underflow"; + + case 1285: + return "Out of memory"; + + case 1286: + return "Invalid framebuffer operation"; + + default: + return "Unknown"; + } + } + + public static boolean isTrue(Boolean p_isTrue_0_) + { + return p_isTrue_0_ != null && p_isTrue_0_.booleanValue(); + } + + public static boolean isQuadsToTriangles() + { + return !isShaders() ? false : !Shaders.canRenderQuads(); + } + + public static void checkNull(Object p_checkNull_0_, String p_checkNull_1_) throws NullPointerException + { + if (p_checkNull_0_ == null) + { + throw new NullPointerException(p_checkNull_1_); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/Achievement.java b/Client-1.8.9/src/main/java/net/minecraft/stats/Achievement.java new file mode 100644 index 0000000..91f1c2e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/Achievement.java @@ -0,0 +1,114 @@ +package net.minecraft.stats; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.StatCollector; + +public class Achievement extends StatBase +{ + public final int displayColumn; + public final int displayRow; + public final Achievement parentAchievement; + private final String achievementDescription; + private IStatStringFormat statStringFormatter; + public final ItemStack theItemStack; + private boolean isSpecial; + + public Achievement(String statIdIn, String unlocalizedName, int column, int row, Item itemIn, Achievement parent) + { + this(statIdIn, unlocalizedName, column, row, new ItemStack(itemIn), parent); + } + + public Achievement(String statIdIn, String unlocalizedName, int column, int row, Block blockIn, Achievement parent) + { + this(statIdIn, unlocalizedName, column, row, new ItemStack(blockIn), parent); + } + + public Achievement(String statIdIn, String unlocalizedName, int column, int row, ItemStack stack, Achievement parent) + { + super(statIdIn, new ChatComponentTranslation("achievement." + unlocalizedName, new Object[0])); + this.theItemStack = stack; + this.achievementDescription = "achievement." + unlocalizedName + ".desc"; + this.displayColumn = column; + this.displayRow = row; + + if (column < AchievementList.minDisplayColumn) + { + AchievementList.minDisplayColumn = column; + } + + if (row < AchievementList.minDisplayRow) + { + AchievementList.minDisplayRow = row; + } + + if (column > AchievementList.maxDisplayColumn) + { + AchievementList.maxDisplayColumn = column; + } + + if (row > AchievementList.maxDisplayRow) + { + AchievementList.maxDisplayRow = row; + } + + this.parentAchievement = parent; + } + + public Achievement initIndependentStat() + { + this.isIndependent = true; + return this; + } + + public Achievement setSpecial() + { + this.isSpecial = true; + return this; + } + + public Achievement registerStat() + { + super.registerStat(); + AchievementList.achievementList.add(this); + return this; + } + + public boolean isAchievement() + { + return true; + } + + public IChatComponent getStatName() + { + IChatComponent ichatcomponent = super.getStatName(); + ichatcomponent.getChatStyle().setColor(this.getSpecial() ? EnumChatFormatting.DARK_PURPLE : EnumChatFormatting.GREEN); + return ichatcomponent; + } + + public Achievement func_150953_b(Class p_150953_1_) + { + return (Achievement)super.func_150953_b(p_150953_1_); + } + + public String getDescription() + { + return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) : StatCollector.translateToLocal(this.achievementDescription); + } + + public Achievement setStatStringFormatter(IStatStringFormat statStringFormatterIn) + { + this.statStringFormatter = statStringFormatterIn; + return this; + } + + public boolean getSpecial() + { + return this.isSpecial; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/AchievementList.java b/Client-1.8.9/src/main/java/net/minecraft/stats/AchievementList.java new file mode 100644 index 0000000..59af5fb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/AchievementList.java @@ -0,0 +1,55 @@ +package net.minecraft.stats; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.JsonSerializableSet; + +public class AchievementList +{ + public static int minDisplayColumn; + public static int minDisplayRow; + public static int maxDisplayColumn; + public static int maxDisplayRow; + public static List achievementList = Lists.newArrayList(); + public static Achievement openInventory = (new Achievement("achievement.openInventory", "openInventory", 0, 0, Items.book, (Achievement)null)).initIndependentStat().registerStat(); + public static Achievement mineWood = (new Achievement("achievement.mineWood", "mineWood", 2, 1, Blocks.log, openInventory)).registerStat(); + public static Achievement buildWorkBench = (new Achievement("achievement.buildWorkBench", "buildWorkBench", 4, -1, Blocks.crafting_table, mineWood)).registerStat(); + public static Achievement buildPickaxe = (new Achievement("achievement.buildPickaxe", "buildPickaxe", 4, 2, Items.wooden_pickaxe, buildWorkBench)).registerStat(); + public static Achievement buildFurnace = (new Achievement("achievement.buildFurnace", "buildFurnace", 3, 4, Blocks.furnace, buildPickaxe)).registerStat(); + public static Achievement acquireIron = (new Achievement("achievement.acquireIron", "acquireIron", 1, 4, Items.iron_ingot, buildFurnace)).registerStat(); + public static Achievement buildHoe = (new Achievement("achievement.buildHoe", "buildHoe", 2, -3, Items.wooden_hoe, buildWorkBench)).registerStat(); + public static Achievement makeBread = (new Achievement("achievement.makeBread", "makeBread", -1, -3, Items.bread, buildHoe)).registerStat(); + public static Achievement bakeCake = (new Achievement("achievement.bakeCake", "bakeCake", 0, -5, Items.cake, buildHoe)).registerStat(); + public static Achievement buildBetterPickaxe = (new Achievement("achievement.buildBetterPickaxe", "buildBetterPickaxe", 6, 2, Items.stone_pickaxe, buildPickaxe)).registerStat(); + public static Achievement cookFish = (new Achievement("achievement.cookFish", "cookFish", 2, 6, Items.cooked_fish, buildFurnace)).registerStat(); + public static Achievement onARail = (new Achievement("achievement.onARail", "onARail", 2, 3, Blocks.rail, acquireIron)).setSpecial().registerStat(); + public static Achievement buildSword = (new Achievement("achievement.buildSword", "buildSword", 6, -1, Items.wooden_sword, buildWorkBench)).registerStat(); + public static Achievement killEnemy = (new Achievement("achievement.killEnemy", "killEnemy", 8, -1, Items.bone, buildSword)).registerStat(); + public static Achievement killCow = (new Achievement("achievement.killCow", "killCow", 7, -3, Items.leather, buildSword)).registerStat(); + public static Achievement flyPig = (new Achievement("achievement.flyPig", "flyPig", 9, -3, Items.saddle, killCow)).setSpecial().registerStat(); + public static Achievement snipeSkeleton = (new Achievement("achievement.snipeSkeleton", "snipeSkeleton", 7, 0, Items.bow, killEnemy)).setSpecial().registerStat(); + public static Achievement diamonds = (new Achievement("achievement.diamonds", "diamonds", -1, 5, Blocks.diamond_ore, acquireIron)).registerStat(); + public static Achievement diamondsToYou = (new Achievement("achievement.diamondsToYou", "diamondsToYou", -1, 2, Items.diamond, diamonds)).registerStat(); + public static Achievement portal = (new Achievement("achievement.portal", "portal", -1, 7, Blocks.obsidian, diamonds)).registerStat(); + public static Achievement ghast = (new Achievement("achievement.ghast", "ghast", -4, 8, Items.ghast_tear, portal)).setSpecial().registerStat(); + public static Achievement blazeRod = (new Achievement("achievement.blazeRod", "blazeRod", 0, 9, Items.blaze_rod, portal)).registerStat(); + public static Achievement potion = (new Achievement("achievement.potion", "potion", 2, 8, Items.potionitem, blazeRod)).registerStat(); + public static Achievement theEnd = (new Achievement("achievement.theEnd", "theEnd", 3, 10, Items.ender_eye, blazeRod)).setSpecial().registerStat(); + public static Achievement theEnd2 = (new Achievement("achievement.theEnd2", "theEnd2", 4, 13, Blocks.dragon_egg, theEnd)).setSpecial().registerStat(); + public static Achievement enchantments = (new Achievement("achievement.enchantments", "enchantments", -4, 4, Blocks.enchanting_table, diamonds)).registerStat(); + public static Achievement overkill = (new Achievement("achievement.overkill", "overkill", -4, 1, Items.diamond_sword, enchantments)).setSpecial().registerStat(); + public static Achievement bookcase = (new Achievement("achievement.bookcase", "bookcase", -3, 6, Blocks.bookshelf, enchantments)).registerStat(); + public static Achievement breedCow = (new Achievement("achievement.breedCow", "breedCow", 7, -5, Items.wheat, killCow)).registerStat(); + public static Achievement spawnWither = (new Achievement("achievement.spawnWither", "spawnWither", 7, 12, new ItemStack(Items.skull, 1, 1), theEnd2)).registerStat(); + public static Achievement killWither = (new Achievement("achievement.killWither", "killWither", 7, 10, Items.nether_star, spawnWither)).registerStat(); + public static Achievement fullBeacon = (new Achievement("achievement.fullBeacon", "fullBeacon", 7, 8, Blocks.beacon, killWither)).setSpecial().registerStat(); + public static Achievement exploreAllBiomes = (new Achievement("achievement.exploreAllBiomes", "exploreAllBiomes", 4, 8, Items.diamond_boots, theEnd)).func_150953_b(JsonSerializableSet.class).setSpecial().registerStat(); + public static Achievement overpowered = (new Achievement("achievement.overpowered", "overpowered", 6, 4, new ItemStack(Items.golden_apple, 1, 1), buildBetterPickaxe)).setSpecial().registerStat(); + + public static void init() + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/IStatStringFormat.java b/Client-1.8.9/src/main/java/net/minecraft/stats/IStatStringFormat.java new file mode 100644 index 0000000..67ce06e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/IStatStringFormat.java @@ -0,0 +1,6 @@ +package net.minecraft.stats; + +public interface IStatStringFormat +{ + String formatString(String str); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/IStatType.java b/Client-1.8.9/src/main/java/net/minecraft/stats/IStatType.java new file mode 100644 index 0000000..2c1a71c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/IStatType.java @@ -0,0 +1,6 @@ +package net.minecraft.stats; + +public interface IStatType +{ + String format(int number); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/ObjectiveStat.java b/Client-1.8.9/src/main/java/net/minecraft/stats/ObjectiveStat.java new file mode 100644 index 0000000..abe7976 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/ObjectiveStat.java @@ -0,0 +1,14 @@ +package net.minecraft.stats; + +import net.minecraft.scoreboard.ScoreDummyCriteria; + +public class ObjectiveStat extends ScoreDummyCriteria +{ + private final StatBase stat; + + public ObjectiveStat(StatBase statIn) + { + super(statIn.statId); + this.stat = statIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/StatBase.java b/Client-1.8.9/src/main/java/net/minecraft/stats/StatBase.java new file mode 100644 index 0000000..9d2f9ce --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/StatBase.java @@ -0,0 +1,161 @@ +package net.minecraft.stats; + +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.Locale; +import net.minecraft.event.HoverEvent; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IJsonSerializable; + +public class StatBase +{ + public final String statId; + private final IChatComponent statName; + public boolean isIndependent; + private final IStatType type; + private final IScoreObjectiveCriteria objectiveCriteria; + private Class field_150956_d; + private static NumberFormat numberFormat = NumberFormat.getIntegerInstance(Locale.US); + public static IStatType simpleStatType = new IStatType() + { + public String format(int number) + { + return StatBase.numberFormat.format((long)number); + } + }; + private static DecimalFormat decimalFormat = new DecimalFormat("########0.00"); + public static IStatType timeStatType = new IStatType() + { + public String format(int number) + { + double d0 = (double)number / 20.0D; + double d1 = d0 / 60.0D; + double d2 = d1 / 60.0D; + double d3 = d2 / 24.0D; + double d4 = d3 / 365.0D; + return d4 > 0.5D ? StatBase.decimalFormat.format(d4) + " y" : (d3 > 0.5D ? StatBase.decimalFormat.format(d3) + " d" : (d2 > 0.5D ? StatBase.decimalFormat.format(d2) + " h" : (d1 > 0.5D ? StatBase.decimalFormat.format(d1) + " m" : d0 + " s"))); + } + }; + public static IStatType distanceStatType = new IStatType() + { + public String format(int number) + { + double d0 = (double)number / 100.0D; + double d1 = d0 / 1000.0D; + return d1 > 0.5D ? StatBase.decimalFormat.format(d1) + " km" : (d0 > 0.5D ? StatBase.decimalFormat.format(d0) + " m" : number + " cm"); + } + }; + public static IStatType field_111202_k = new IStatType() + { + public String format(int number) + { + return StatBase.decimalFormat.format((double)number * 0.1D); + } + }; + + public StatBase(String statIdIn, IChatComponent statNameIn, IStatType typeIn) + { + this.statId = statIdIn; + this.statName = statNameIn; + this.type = typeIn; + this.objectiveCriteria = new ObjectiveStat(this); + IScoreObjectiveCriteria.INSTANCES.put(this.objectiveCriteria.getName(), this.objectiveCriteria); + } + + public StatBase(String statIdIn, IChatComponent statNameIn) + { + this(statIdIn, statNameIn, simpleStatType); + } + + public StatBase initIndependentStat() + { + this.isIndependent = true; + return this; + } + + public StatBase registerStat() + { + if (StatList.oneShotStats.containsKey(this.statId)) + { + throw new RuntimeException("Duplicate stat id: \"" + ((StatBase)StatList.oneShotStats.get(this.statId)).statName + "\" and \"" + this.statName + "\" at id " + this.statId); + } + else + { + StatList.allStats.add(this); + StatList.oneShotStats.put(this.statId, this); + return this; + } + } + + public boolean isAchievement() + { + return false; + } + + public String format(int p_75968_1_) + { + return this.type.format(p_75968_1_); + } + + public IChatComponent getStatName() + { + IChatComponent ichatcomponent = this.statName.createCopy(); + ichatcomponent.getChatStyle().setColor(EnumChatFormatting.GRAY); + ichatcomponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ACHIEVEMENT, new ChatComponentText(this.statId))); + return ichatcomponent; + } + + public IChatComponent createChatComponent() + { + IChatComponent ichatcomponent = this.getStatName(); + IChatComponent ichatcomponent1 = (new ChatComponentText("[")).appendSibling(ichatcomponent).appendText("]"); + ichatcomponent1.setChatStyle(ichatcomponent.getChatStyle()); + return ichatcomponent1; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + StatBase statbase = (StatBase)p_equals_1_; + return this.statId.equals(statbase.statId); + } + else + { + return false; + } + } + + public int hashCode() + { + return this.statId.hashCode(); + } + + public String toString() + { + return "Stat{id=" + this.statId + ", nameId=" + this.statName + ", awardLocallyOnly=" + this.isIndependent + ", formatter=" + this.type + ", objectiveCriteria=" + this.objectiveCriteria + '}'; + } + + public IScoreObjectiveCriteria getCriteria() + { + return this.objectiveCriteria; + } + + public Class func_150954_l() + { + return this.field_150956_d; + } + + public StatBase func_150953_b(Class p_150953_1_) + { + this.field_150956_d = p_150953_1_; + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/StatBasic.java b/Client-1.8.9/src/main/java/net/minecraft/stats/StatBasic.java new file mode 100644 index 0000000..d326753 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/StatBasic.java @@ -0,0 +1,23 @@ +package net.minecraft.stats; + +import net.minecraft.util.IChatComponent; + +public class StatBasic extends StatBase +{ + public StatBasic(String statIdIn, IChatComponent statNameIn, IStatType typeIn) + { + super(statIdIn, statNameIn, typeIn); + } + + public StatBasic(String statIdIn, IChatComponent statNameIn) + { + super(statIdIn, statNameIn); + } + + public StatBase registerStat() + { + super.registerStat(); + StatList.generalStats.add(this); + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/StatCrafting.java b/Client-1.8.9/src/main/java/net/minecraft/stats/StatCrafting.java new file mode 100644 index 0000000..af45be4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/StatCrafting.java @@ -0,0 +1,27 @@ +package net.minecraft.stats; + +import net.minecraft.item.Item; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.util.IChatComponent; + +public class StatCrafting extends StatBase +{ + private final Item field_150960_a; + + public StatCrafting(String p_i45910_1_, String p_i45910_2_, IChatComponent statNameIn, Item p_i45910_4_) + { + super(p_i45910_1_ + p_i45910_2_, statNameIn); + this.field_150960_a = p_i45910_4_; + int i = Item.getIdFromItem(p_i45910_4_); + + if (i != 0) + { + IScoreObjectiveCriteria.INSTANCES.put(p_i45910_1_ + i, this.getCriteria()); + } + } + + public Item func_150959_a() + { + return this.field_150960_a; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/StatFileWriter.java b/Client-1.8.9/src/main/java/net/minecraft/stats/StatFileWriter.java new file mode 100644 index 0000000..538a040 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/StatFileWriter.java @@ -0,0 +1,88 @@ +package net.minecraft.stats; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.TupleIntJsonSerializable; + +public class StatFileWriter +{ + protected final Map statsData = Maps.newConcurrentMap(); + + public boolean hasAchievementUnlocked(Achievement achievementIn) + { + return this.readStat(achievementIn) > 0; + } + + public boolean canUnlockAchievement(Achievement achievementIn) + { + return achievementIn.parentAchievement == null || this.hasAchievementUnlocked(achievementIn.parentAchievement); + } + + public int func_150874_c(Achievement p_150874_1_) + { + if (this.hasAchievementUnlocked(p_150874_1_)) + { + return 0; + } + else + { + int i = 0; + + for (Achievement achievement = p_150874_1_.parentAchievement; achievement != null && !this.hasAchievementUnlocked(achievement); ++i) + { + achievement = achievement.parentAchievement; + } + + return i; + } + } + + public void increaseStat(EntityPlayer player, StatBase stat, int amount) + { + if (!stat.isAchievement() || this.canUnlockAchievement((Achievement)stat)) + { + this.unlockAchievement(player, stat, this.readStat(stat) + amount); + } + } + + public void unlockAchievement(EntityPlayer playerIn, StatBase statIn, int p_150873_3_) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.statsData.get(statIn); + + if (tupleintjsonserializable == null) + { + tupleintjsonserializable = new TupleIntJsonSerializable(); + this.statsData.put(statIn, tupleintjsonserializable); + } + + tupleintjsonserializable.setIntegerValue(p_150873_3_); + } + + public int readStat(StatBase stat) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.statsData.get(stat); + return tupleintjsonserializable == null ? 0 : tupleintjsonserializable.getIntegerValue(); + } + + public T func_150870_b(StatBase p_150870_1_) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.statsData.get(p_150870_1_); + return (T)(tupleintjsonserializable != null ? tupleintjsonserializable.getJsonSerializableValue() : null); + } + + public T func_150872_a(StatBase p_150872_1_, T p_150872_2_) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.statsData.get(p_150872_1_); + + if (tupleintjsonserializable == null) + { + tupleintjsonserializable = new TupleIntJsonSerializable(); + this.statsData.put(p_150872_1_, tupleintjsonserializable); + } + + tupleintjsonserializable.setJsonSerializableValue(p_150872_2_); + return (T)p_150872_2_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/StatList.java b/Client-1.8.9/src/main/java/net/minecraft/stats/StatList.java new file mode 100644 index 0000000..597f0af --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/StatList.java @@ -0,0 +1,248 @@ +package net.minecraft.stats; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ResourceLocation; + +public class StatList +{ + protected static Map oneShotStats = Maps.newHashMap(); + public static List allStats = Lists.newArrayList(); + public static List generalStats = Lists.newArrayList(); + public static List itemStats = Lists.newArrayList(); + public static List objectMineStats = Lists.newArrayList(); + public static StatBase leaveGameStat = (new StatBasic("stat.leaveGame", new ChatComponentTranslation("stat.leaveGame", new Object[0]))).initIndependentStat().registerStat(); + public static StatBase minutesPlayedStat = (new StatBasic("stat.playOneMinute", new ChatComponentTranslation("stat.playOneMinute", new Object[0]), StatBase.timeStatType)).initIndependentStat().registerStat(); + public static StatBase timeSinceDeathStat = (new StatBasic("stat.timeSinceDeath", new ChatComponentTranslation("stat.timeSinceDeath", new Object[0]), StatBase.timeStatType)).initIndependentStat().registerStat(); + public static StatBase distanceWalkedStat = (new StatBasic("stat.walkOneCm", new ChatComponentTranslation("stat.walkOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceCrouchedStat = (new StatBasic("stat.crouchOneCm", new ChatComponentTranslation("stat.crouchOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceSprintedStat = (new StatBasic("stat.sprintOneCm", new ChatComponentTranslation("stat.sprintOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceSwumStat = (new StatBasic("stat.swimOneCm", new ChatComponentTranslation("stat.swimOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceFallenStat = (new StatBasic("stat.fallOneCm", new ChatComponentTranslation("stat.fallOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceClimbedStat = (new StatBasic("stat.climbOneCm", new ChatComponentTranslation("stat.climbOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceFlownStat = (new StatBasic("stat.flyOneCm", new ChatComponentTranslation("stat.flyOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceDoveStat = (new StatBasic("stat.diveOneCm", new ChatComponentTranslation("stat.diveOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceByMinecartStat = (new StatBasic("stat.minecartOneCm", new ChatComponentTranslation("stat.minecartOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceByBoatStat = (new StatBasic("stat.boatOneCm", new ChatComponentTranslation("stat.boatOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceByPigStat = (new StatBasic("stat.pigOneCm", new ChatComponentTranslation("stat.pigOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase distanceByHorseStat = (new StatBasic("stat.horseOneCm", new ChatComponentTranslation("stat.horseOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase jumpStat = (new StatBasic("stat.jump", new ChatComponentTranslation("stat.jump", new Object[0]))).initIndependentStat().registerStat(); + public static StatBase dropStat = (new StatBasic("stat.drop", new ChatComponentTranslation("stat.drop", new Object[0]))).initIndependentStat().registerStat(); + public static StatBase damageDealtStat = (new StatBasic("stat.damageDealt", new ChatComponentTranslation("stat.damageDealt", new Object[0]), StatBase.field_111202_k)).registerStat(); + public static StatBase damageTakenStat = (new StatBasic("stat.damageTaken", new ChatComponentTranslation("stat.damageTaken", new Object[0]), StatBase.field_111202_k)).registerStat(); + public static StatBase deathsStat = (new StatBasic("stat.deaths", new ChatComponentTranslation("stat.deaths", new Object[0]))).registerStat(); + public static StatBase mobKillsStat = (new StatBasic("stat.mobKills", new ChatComponentTranslation("stat.mobKills", new Object[0]))).registerStat(); + public static StatBase animalsBredStat = (new StatBasic("stat.animalsBred", new ChatComponentTranslation("stat.animalsBred", new Object[0]))).registerStat(); + public static StatBase playerKillsStat = (new StatBasic("stat.playerKills", new ChatComponentTranslation("stat.playerKills", new Object[0]))).registerStat(); + public static StatBase fishCaughtStat = (new StatBasic("stat.fishCaught", new ChatComponentTranslation("stat.fishCaught", new Object[0]))).registerStat(); + public static StatBase junkFishedStat = (new StatBasic("stat.junkFished", new ChatComponentTranslation("stat.junkFished", new Object[0]))).registerStat(); + public static StatBase treasureFishedStat = (new StatBasic("stat.treasureFished", new ChatComponentTranslation("stat.treasureFished", new Object[0]))).registerStat(); + public static StatBase timesTalkedToVillagerStat = (new StatBasic("stat.talkedToVillager", new ChatComponentTranslation("stat.talkedToVillager", new Object[0]))).registerStat(); + public static StatBase timesTradedWithVillagerStat = (new StatBasic("stat.tradedWithVillager", new ChatComponentTranslation("stat.tradedWithVillager", new Object[0]))).registerStat(); + public static StatBase field_181724_H = (new StatBasic("stat.cakeSlicesEaten", new ChatComponentTranslation("stat.cakeSlicesEaten", new Object[0]))).registerStat(); + public static StatBase field_181725_I = (new StatBasic("stat.cauldronFilled", new ChatComponentTranslation("stat.cauldronFilled", new Object[0]))).registerStat(); + public static StatBase field_181726_J = (new StatBasic("stat.cauldronUsed", new ChatComponentTranslation("stat.cauldronUsed", new Object[0]))).registerStat(); + public static StatBase field_181727_K = (new StatBasic("stat.armorCleaned", new ChatComponentTranslation("stat.armorCleaned", new Object[0]))).registerStat(); + public static StatBase field_181728_L = (new StatBasic("stat.bannerCleaned", new ChatComponentTranslation("stat.bannerCleaned", new Object[0]))).registerStat(); + public static StatBase field_181729_M = (new StatBasic("stat.brewingstandInteraction", new ChatComponentTranslation("stat.brewingstandInteraction", new Object[0]))).registerStat(); + public static StatBase field_181730_N = (new StatBasic("stat.beaconInteraction", new ChatComponentTranslation("stat.beaconInteraction", new Object[0]))).registerStat(); + public static StatBase field_181731_O = (new StatBasic("stat.dropperInspected", new ChatComponentTranslation("stat.dropperInspected", new Object[0]))).registerStat(); + public static StatBase field_181732_P = (new StatBasic("stat.hopperInspected", new ChatComponentTranslation("stat.hopperInspected", new Object[0]))).registerStat(); + public static StatBase field_181733_Q = (new StatBasic("stat.dispenserInspected", new ChatComponentTranslation("stat.dispenserInspected", new Object[0]))).registerStat(); + public static StatBase field_181734_R = (new StatBasic("stat.noteblockPlayed", new ChatComponentTranslation("stat.noteblockPlayed", new Object[0]))).registerStat(); + public static StatBase field_181735_S = (new StatBasic("stat.noteblockTuned", new ChatComponentTranslation("stat.noteblockTuned", new Object[0]))).registerStat(); + public static StatBase field_181736_T = (new StatBasic("stat.flowerPotted", new ChatComponentTranslation("stat.flowerPotted", new Object[0]))).registerStat(); + public static StatBase field_181737_U = (new StatBasic("stat.trappedChestTriggered", new ChatComponentTranslation("stat.trappedChestTriggered", new Object[0]))).registerStat(); + public static StatBase field_181738_V = (new StatBasic("stat.enderchestOpened", new ChatComponentTranslation("stat.enderchestOpened", new Object[0]))).registerStat(); + public static StatBase field_181739_W = (new StatBasic("stat.itemEnchanted", new ChatComponentTranslation("stat.itemEnchanted", new Object[0]))).registerStat(); + public static StatBase field_181740_X = (new StatBasic("stat.recordPlayed", new ChatComponentTranslation("stat.recordPlayed", new Object[0]))).registerStat(); + public static StatBase field_181741_Y = (new StatBasic("stat.furnaceInteraction", new ChatComponentTranslation("stat.furnaceInteraction", new Object[0]))).registerStat(); + public static StatBase field_181742_Z = (new StatBasic("stat.craftingTableInteraction", new ChatComponentTranslation("stat.workbenchInteraction", new Object[0]))).registerStat(); + public static StatBase field_181723_aa = (new StatBasic("stat.chestOpened", new ChatComponentTranslation("stat.chestOpened", new Object[0]))).registerStat(); + public static final StatBase[] mineBlockStatArray = new StatBase[4096]; + public static final StatBase[] objectCraftStats = new StatBase[32000]; + public static final StatBase[] objectUseStats = new StatBase[32000]; + public static final StatBase[] objectBreakStats = new StatBase[32000]; + + public static void init() + { + initMiningStats(); + initStats(); + initItemDepleteStats(); + initCraftableStats(); + AchievementList.init(); + EntityList.func_151514_a(); + } + + private static void initCraftableStats() + { + Set set = Sets.newHashSet(); + + for (IRecipe irecipe : CraftingManager.getInstance().getRecipeList()) + { + if (irecipe.getRecipeOutput() != null) + { + set.add(irecipe.getRecipeOutput().getItem()); + } + } + + for (ItemStack itemstack : FurnaceRecipes.instance().getSmeltingList().values()) + { + set.add(itemstack.getItem()); + } + + for (Item item : set) + { + if (item != null) + { + int i = Item.getIdFromItem(item); + String s = func_180204_a(item); + + if (s != null) + { + objectCraftStats[i] = (new StatCrafting("stat.craftItem.", s, new ChatComponentTranslation("stat.craftItem", new Object[] {(new ItemStack(item)).getChatComponent()}), item)).registerStat(); + } + } + } + + replaceAllSimilarBlocks(objectCraftStats); + } + + private static void initMiningStats() + { + for (Block block : Block.blockRegistry) + { + Item item = Item.getItemFromBlock(block); + + if (item != null) + { + int i = Block.getIdFromBlock(block); + String s = func_180204_a(item); + + if (s != null && block.getEnableStats()) + { + mineBlockStatArray[i] = (new StatCrafting("stat.mineBlock.", s, new ChatComponentTranslation("stat.mineBlock", new Object[] {(new ItemStack(block)).getChatComponent()}), item)).registerStat(); + objectMineStats.add((StatCrafting)mineBlockStatArray[i]); + } + } + } + + replaceAllSimilarBlocks(mineBlockStatArray); + } + + private static void initStats() + { + for (Item item : Item.itemRegistry) + { + if (item != null) + { + int i = Item.getIdFromItem(item); + String s = func_180204_a(item); + + if (s != null) + { + objectUseStats[i] = (new StatCrafting("stat.useItem.", s, new ChatComponentTranslation("stat.useItem", new Object[] {(new ItemStack(item)).getChatComponent()}), item)).registerStat(); + + if (!(item instanceof ItemBlock)) + { + itemStats.add((StatCrafting)objectUseStats[i]); + } + } + } + } + + replaceAllSimilarBlocks(objectUseStats); + } + + private static void initItemDepleteStats() + { + for (Item item : Item.itemRegistry) + { + if (item != null) + { + int i = Item.getIdFromItem(item); + String s = func_180204_a(item); + + if (s != null && item.isDamageable()) + { + objectBreakStats[i] = (new StatCrafting("stat.breakItem.", s, new ChatComponentTranslation("stat.breakItem", new Object[] {(new ItemStack(item)).getChatComponent()}), item)).registerStat(); + } + } + } + + replaceAllSimilarBlocks(objectBreakStats); + } + + private static String func_180204_a(Item p_180204_0_) + { + ResourceLocation resourcelocation = (ResourceLocation)Item.itemRegistry.getNameForObject(p_180204_0_); + return resourcelocation != null ? resourcelocation.toString().replace(':', '.') : null; + } + + private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_) + { + mergeStatBases(p_75924_0_, Blocks.water, Blocks.flowing_water); + mergeStatBases(p_75924_0_, Blocks.lava, Blocks.flowing_lava); + mergeStatBases(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin); + mergeStatBases(p_75924_0_, Blocks.lit_furnace, Blocks.furnace); + mergeStatBases(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore); + mergeStatBases(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater); + mergeStatBases(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator); + mergeStatBases(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch); + mergeStatBases(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp); + mergeStatBases(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab); + mergeStatBases(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab); + mergeStatBases(p_75924_0_, Blocks.double_stone_slab2, Blocks.stone_slab2); + mergeStatBases(p_75924_0_, Blocks.grass, Blocks.dirt); + mergeStatBases(p_75924_0_, Blocks.farmland, Blocks.dirt); + } + + private static void mergeStatBases(StatBase[] statBaseIn, Block p_151180_1_, Block p_151180_2_) + { + int i = Block.getIdFromBlock(p_151180_1_); + int j = Block.getIdFromBlock(p_151180_2_); + + if (statBaseIn[i] != null && statBaseIn[j] == null) + { + statBaseIn[j] = statBaseIn[i]; + } + else + { + allStats.remove(statBaseIn[i]); + objectMineStats.remove(statBaseIn[i]); + generalStats.remove(statBaseIn[i]); + statBaseIn[i] = statBaseIn[j]; + } + } + + public static StatBase getStatKillEntity(EntityList.EntityEggInfo eggInfo) + { + String s = EntityList.getStringFromID(eggInfo.spawnedID); + return s == null ? null : (new StatBase("stat.killEntity." + s, new ChatComponentTranslation("stat.entityKill", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat(); + } + + public static StatBase getStatEntityKilledBy(EntityList.EntityEggInfo eggInfo) + { + String s = EntityList.getStringFromID(eggInfo.spawnedID); + return s == null ? null : (new StatBase("stat.entityKilledBy." + s, new ChatComponentTranslation("stat.entityKilledBy", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat(); + } + + public static StatBase getOneShotStat(String p_151177_0_) + { + return (StatBase)oneShotStats.get(p_151177_0_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/stats/StatisticsFile.java b/Client-1.8.9/src/main/java/net/minecraft/stats/StatisticsFile.java new file mode 100644 index 0000000..ce6086c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/stats/StatisticsFile.java @@ -0,0 +1,247 @@ +package net.minecraft.stats; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.TupleIntJsonSerializable; +import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class StatisticsFile extends StatFileWriter +{ + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer mcServer; + private final File statsFile; + private final Set field_150888_e = Sets.newHashSet(); + private int field_150885_f = -300; + private boolean field_150886_g = false; + + public StatisticsFile(MinecraftServer serverIn, File statsFileIn) + { + this.mcServer = serverIn; + this.statsFile = statsFileIn; + } + + public void readStatFile() + { + if (this.statsFile.isFile()) + { + try + { + this.statsData.clear(); + this.statsData.putAll(this.parseJson(FileUtils.readFileToString(this.statsFile))); + } + catch (IOException ioexception) + { + logger.error((String)("Couldn\'t read statistics file " + this.statsFile), (Throwable)ioexception); + } + catch (JsonParseException jsonparseexception) + { + logger.error((String)("Couldn\'t parse statistics file " + this.statsFile), (Throwable)jsonparseexception); + } + } + } + + public void saveStatFile() + { + try + { + FileUtils.writeStringToFile(this.statsFile, dumpJson(this.statsData)); + } + catch (IOException ioexception) + { + logger.error((String)"Couldn\'t save stats", (Throwable)ioexception); + } + } + + public void unlockAchievement(EntityPlayer playerIn, StatBase statIn, int p_150873_3_) + { + int i = statIn.isAchievement() ? this.readStat(statIn) : 0; + super.unlockAchievement(playerIn, statIn, p_150873_3_); + this.field_150888_e.add(statIn); + + if (statIn.isAchievement() && i == 0 && p_150873_3_ > 0) + { + this.field_150886_g = true; + + if (this.mcServer.isAnnouncingPlayerAchievements()) + { + this.mcServer.getConfigurationManager().sendChatMsg(new ChatComponentTranslation("chat.type.achievement", new Object[] {playerIn.getDisplayName(), statIn.createChatComponent()})); + } + } + + if (statIn.isAchievement() && i > 0 && p_150873_3_ == 0) + { + this.field_150886_g = true; + + if (this.mcServer.isAnnouncingPlayerAchievements()) + { + this.mcServer.getConfigurationManager().sendChatMsg(new ChatComponentTranslation("chat.type.achievement.taken", new Object[] {playerIn.getDisplayName(), statIn.createChatComponent()})); + } + } + } + + public Set func_150878_c() + { + Set set = Sets.newHashSet(this.field_150888_e); + this.field_150888_e.clear(); + this.field_150886_g = false; + return set; + } + + public Map parseJson(String p_150881_1_) + { + JsonElement jsonelement = (new JsonParser()).parse(p_150881_1_); + + if (!jsonelement.isJsonObject()) + { + return Maps.newHashMap(); + } + else + { + JsonObject jsonobject = jsonelement.getAsJsonObject(); + Map map = Maps.newHashMap(); + + for (Entry entry : jsonobject.entrySet()) + { + StatBase statbase = StatList.getOneShotStat((String)entry.getKey()); + + if (statbase != null) + { + TupleIntJsonSerializable tupleintjsonserializable = new TupleIntJsonSerializable(); + + if (((JsonElement)entry.getValue()).isJsonPrimitive() && ((JsonElement)entry.getValue()).getAsJsonPrimitive().isNumber()) + { + tupleintjsonserializable.setIntegerValue(((JsonElement)entry.getValue()).getAsInt()); + } + else if (((JsonElement)entry.getValue()).isJsonObject()) + { + JsonObject jsonobject1 = ((JsonElement)entry.getValue()).getAsJsonObject(); + + if (jsonobject1.has("value") && jsonobject1.get("value").isJsonPrimitive() && jsonobject1.get("value").getAsJsonPrimitive().isNumber()) + { + tupleintjsonserializable.setIntegerValue(jsonobject1.getAsJsonPrimitive("value").getAsInt()); + } + + if (jsonobject1.has("progress") && statbase.func_150954_l() != null) + { + try + { + Constructor constructor = statbase.func_150954_l().getConstructor(new Class[0]); + IJsonSerializable ijsonserializable = (IJsonSerializable)constructor.newInstance(new Object[0]); + ijsonserializable.fromJson(jsonobject1.get("progress")); + tupleintjsonserializable.setJsonSerializableValue(ijsonserializable); + } + catch (Throwable throwable) + { + logger.warn("Invalid statistic progress in " + this.statsFile, throwable); + } + } + } + + map.put(statbase, tupleintjsonserializable); + } + else + { + logger.warn("Invalid statistic in " + this.statsFile + ": Don\'t know what " + (String)entry.getKey() + " is"); + } + } + + return map; + } + } + + public static String dumpJson(Map p_150880_0_) + { + JsonObject jsonobject = new JsonObject(); + + for (Entry entry : p_150880_0_.entrySet()) + { + if (((TupleIntJsonSerializable)entry.getValue()).getJsonSerializableValue() != null) + { + JsonObject jsonobject1 = new JsonObject(); + jsonobject1.addProperty("value", (Number)Integer.valueOf(((TupleIntJsonSerializable)entry.getValue()).getIntegerValue())); + + try + { + jsonobject1.add("progress", ((TupleIntJsonSerializable)entry.getValue()).getJsonSerializableValue().getSerializableElement()); + } + catch (Throwable throwable) + { + logger.warn("Couldn\'t save statistic " + ((StatBase)entry.getKey()).getStatName() + ": error serializing progress", throwable); + } + + jsonobject.add(((StatBase)entry.getKey()).statId, jsonobject1); + } + else + { + jsonobject.addProperty(((StatBase)entry.getKey()).statId, (Number)Integer.valueOf(((TupleIntJsonSerializable)entry.getValue()).getIntegerValue())); + } + } + + return jsonobject.toString(); + } + + public void func_150877_d() + { + for (StatBase statbase : this.statsData.keySet()) + { + this.field_150888_e.add(statbase); + } + } + + public void func_150876_a(EntityPlayerMP p_150876_1_) + { + int i = this.mcServer.getTickCounter(); + Map map = Maps.newHashMap(); + + if (this.field_150886_g || i - this.field_150885_f > 300) + { + this.field_150885_f = i; + + for (StatBase statbase : this.func_150878_c()) + { + map.put(statbase, Integer.valueOf(this.readStat(statbase))); + } + } + + p_150876_1_.playerNetServerHandler.sendPacket(new S37PacketStatistics(map)); + } + + public void sendAchievements(EntityPlayerMP player) + { + Map map = Maps.newHashMap(); + + for (Achievement achievement : AchievementList.achievementList) + { + if (this.hasAchievementUnlocked(achievement)) + { + map.put(achievement, Integer.valueOf(this.readStat(achievement))); + this.field_150888_e.remove(achievement); + } + } + + player.playerNetServerHandler.sendPacket(new S37PacketStatistics(map)); + } + + public boolean func_150879_e() + { + return this.field_150886_g; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/IHopper.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/IHopper.java new file mode 100644 index 0000000..6725ef9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/IHopper.java @@ -0,0 +1,15 @@ +package net.minecraft.tileentity; + +import net.minecraft.inventory.IInventory; +import net.minecraft.world.World; + +public interface IHopper extends IInventory +{ + World getWorld(); + + double getXPos(); + + double getYPos(); + + double getZPos(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java new file mode 100644 index 0000000..e9cc712 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java @@ -0,0 +1,421 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.StringUtils; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.World; + +public abstract class MobSpawnerBaseLogic +{ + private int spawnDelay = 20; + private String mobID = "Pig"; + private final List minecartToSpawn = Lists.newArrayList(); + private MobSpawnerBaseLogic.WeightedRandomMinecart randomEntity; + private double mobRotation; + private double prevMobRotation; + private int minSpawnDelay = 200; + private int maxSpawnDelay = 800; + private int spawnCount = 4; + private Entity cachedEntity; + private int maxNearbyEntities = 6; + private int activatingRangeFromPlayer = 16; + private int spawnRange = 4; + + private String getEntityNameToSpawn() + { + if (this.getRandomEntity() == null) + { + if (this.mobID != null && this.mobID.equals("Minecart")) + { + this.mobID = "MinecartRideable"; + } + + return this.mobID; + } + else + { + return this.getRandomEntity().entityType; + } + } + + public void setEntityName(String name) + { + this.mobID = name; + } + + private boolean isActivated() + { + BlockPos blockpos = this.getSpawnerPosition(); + return this.getSpawnerWorld().isAnyPlayerWithinRangeAt((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D, (double)this.activatingRangeFromPlayer); + } + + public void updateSpawner() + { + if (this.isActivated()) + { + BlockPos blockpos = this.getSpawnerPosition(); + + if (this.getSpawnerWorld().isRemote) + { + double d3 = (double)((float)blockpos.getX() + this.getSpawnerWorld().rand.nextFloat()); + double d4 = (double)((float)blockpos.getY() + this.getSpawnerWorld().rand.nextFloat()); + double d5 = (double)((float)blockpos.getZ() + this.getSpawnerWorld().rand.nextFloat()); + this.getSpawnerWorld().spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d3, d4, d5, 0.0D, 0.0D, 0.0D, new int[0]); + this.getSpawnerWorld().spawnParticle(EnumParticleTypes.FLAME, d3, d4, d5, 0.0D, 0.0D, 0.0D, new int[0]); + + if (this.spawnDelay > 0) + { + --this.spawnDelay; + } + + this.prevMobRotation = this.mobRotation; + this.mobRotation = (this.mobRotation + (double)(1000.0F / ((float)this.spawnDelay + 200.0F))) % 360.0D; + } + else + { + if (this.spawnDelay == -1) + { + this.resetTimer(); + } + + if (this.spawnDelay > 0) + { + --this.spawnDelay; + return; + } + + boolean flag = false; + + for (int i = 0; i < this.spawnCount; ++i) + { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); + + if (entity == null) + { + return; + } + + int j = this.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), (new AxisAlignedBB((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ(), (double)(blockpos.getX() + 1), (double)(blockpos.getY() + 1), (double)(blockpos.getZ() + 1))).expand((double)this.spawnRange, (double)this.spawnRange, (double)this.spawnRange)).size(); + + if (j >= this.maxNearbyEntities) + { + this.resetTimer(); + return; + } + + double d0 = (double)blockpos.getX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange + 0.5D; + double d1 = (double)(blockpos.getY() + this.getSpawnerWorld().rand.nextInt(3) - 1); + double d2 = (double)blockpos.getZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange + 0.5D; + EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null; + entity.setLocationAndAngles(d0, d1, d2, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); + + if (entityliving == null || entityliving.getCanSpawnHere() && entityliving.isNotColliding()) + { + this.spawnNewEntity(entity, true); + this.getSpawnerWorld().playAuxSFX(2004, blockpos, 0); + + if (entityliving != null) + { + entityliving.spawnExplosionParticle(); + } + + flag = true; + } + } + + if (flag) + { + this.resetTimer(); + } + } + } + } + + private Entity spawnNewEntity(Entity entityIn, boolean spawn) + { + if (this.getRandomEntity() != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + entityIn.writeToNBTOptional(nbttagcompound); + + for (String s : this.getRandomEntity().nbtData.getKeySet()) + { + NBTBase nbtbase = this.getRandomEntity().nbtData.getTag(s); + nbttagcompound.setTag(s, nbtbase.copy()); + } + + entityIn.readFromNBT(nbttagcompound); + + if (entityIn.worldObj != null && spawn) + { + entityIn.worldObj.spawnEntityInWorld(entityIn); + } + + NBTTagCompound nbttagcompound2; + + for (Entity entity = entityIn; nbttagcompound.hasKey("Riding", 10); nbttagcompound = nbttagcompound2) + { + nbttagcompound2 = nbttagcompound.getCompoundTag("Riding"); + Entity entity1 = EntityList.createEntityByName(nbttagcompound2.getString("id"), entityIn.worldObj); + + if (entity1 != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entity1.writeToNBTOptional(nbttagcompound1); + + for (String s1 : nbttagcompound2.getKeySet()) + { + NBTBase nbtbase1 = nbttagcompound2.getTag(s1); + nbttagcompound1.setTag(s1, nbtbase1.copy()); + } + + entity1.readFromNBT(nbttagcompound1); + entity1.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); + + if (entityIn.worldObj != null && spawn) + { + entityIn.worldObj.spawnEntityInWorld(entity1); + } + + entity.mountEntity(entity1); + } + + entity = entity1; + } + } + else if (entityIn instanceof EntityLivingBase && entityIn.worldObj != null && spawn) + { + if (entityIn instanceof EntityLiving) + { + ((EntityLiving)entityIn).onInitialSpawn(entityIn.worldObj.getDifficultyForLocation(new BlockPos(entityIn)), (IEntityLivingData)null); + } + + entityIn.worldObj.spawnEntityInWorld(entityIn); + } + + return entityIn; + } + + private void resetTimer() + { + if (this.maxSpawnDelay <= this.minSpawnDelay) + { + this.spawnDelay = this.minSpawnDelay; + } + else + { + int i = this.maxSpawnDelay - this.minSpawnDelay; + this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(i); + } + + if (this.minecartToSpawn.size() > 0) + { + this.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().rand, this.minecartToSpawn)); + } + + this.func_98267_a(1); + } + + public void readFromNBT(NBTTagCompound nbt) + { + this.mobID = nbt.getString("EntityId"); + this.spawnDelay = nbt.getShort("Delay"); + this.minecartToSpawn.clear(); + + if (nbt.hasKey("SpawnPotentials", 9)) + { + NBTTagList nbttaglist = nbt.getTagList("SpawnPotentials", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + this.minecartToSpawn.add(new MobSpawnerBaseLogic.WeightedRandomMinecart(nbttaglist.getCompoundTagAt(i))); + } + } + + if (nbt.hasKey("SpawnData", 10)) + { + this.setRandomEntity(new MobSpawnerBaseLogic.WeightedRandomMinecart(nbt.getCompoundTag("SpawnData"), this.mobID)); + } + else + { + this.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)null); + } + + if (nbt.hasKey("MinSpawnDelay", 99)) + { + this.minSpawnDelay = nbt.getShort("MinSpawnDelay"); + this.maxSpawnDelay = nbt.getShort("MaxSpawnDelay"); + this.spawnCount = nbt.getShort("SpawnCount"); + } + + if (nbt.hasKey("MaxNearbyEntities", 99)) + { + this.maxNearbyEntities = nbt.getShort("MaxNearbyEntities"); + this.activatingRangeFromPlayer = nbt.getShort("RequiredPlayerRange"); + } + + if (nbt.hasKey("SpawnRange", 99)) + { + this.spawnRange = nbt.getShort("SpawnRange"); + } + + if (this.getSpawnerWorld() != null) + { + this.cachedEntity = null; + } + } + + public void writeToNBT(NBTTagCompound nbt) + { + String s = this.getEntityNameToSpawn(); + + if (!StringUtils.isNullOrEmpty(s)) + { + nbt.setString("EntityId", s); + nbt.setShort("Delay", (short)this.spawnDelay); + nbt.setShort("MinSpawnDelay", (short)this.minSpawnDelay); + nbt.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); + nbt.setShort("SpawnCount", (short)this.spawnCount); + nbt.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); + nbt.setShort("RequiredPlayerRange", (short)this.activatingRangeFromPlayer); + nbt.setShort("SpawnRange", (short)this.spawnRange); + + if (this.getRandomEntity() != null) + { + nbt.setTag("SpawnData", this.getRandomEntity().nbtData.copy()); + } + + if (this.getRandomEntity() != null || this.minecartToSpawn.size() > 0) + { + NBTTagList nbttaglist = new NBTTagList(); + + if (this.minecartToSpawn.size() > 0) + { + for (MobSpawnerBaseLogic.WeightedRandomMinecart mobspawnerbaselogic$weightedrandomminecart : this.minecartToSpawn) + { + nbttaglist.appendTag(mobspawnerbaselogic$weightedrandomminecart.toNBT()); + } + } + else + { + nbttaglist.appendTag(this.getRandomEntity().toNBT()); + } + + nbt.setTag("SpawnPotentials", nbttaglist); + } + } + } + + public Entity func_180612_a(World worldIn) + { + if (this.cachedEntity == null) + { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), worldIn); + + if (entity != null) + { + entity = this.spawnNewEntity(entity, false); + this.cachedEntity = entity; + } + } + + return this.cachedEntity; + } + + public boolean setDelayToMin(int delay) + { + if (delay == 1 && this.getSpawnerWorld().isRemote) + { + this.spawnDelay = this.minSpawnDelay; + return true; + } + else + { + return false; + } + } + + private MobSpawnerBaseLogic.WeightedRandomMinecart getRandomEntity() + { + return this.randomEntity; + } + + public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) + { + this.randomEntity = p_98277_1_; + } + + public abstract void func_98267_a(int id); + + public abstract World getSpawnerWorld(); + + public abstract BlockPos getSpawnerPosition(); + + public double getMobRotation() + { + return this.mobRotation; + } + + public double getPrevMobRotation() + { + return this.prevMobRotation; + } + + public class WeightedRandomMinecart extends WeightedRandom.Item + { + private final NBTTagCompound nbtData; + private final String entityType; + + public WeightedRandomMinecart(NBTTagCompound tagCompound) + { + this(tagCompound.getCompoundTag("Properties"), tagCompound.getString("Type"), tagCompound.getInteger("Weight")); + } + + public WeightedRandomMinecart(NBTTagCompound tagCompound, String type) + { + this(tagCompound, type, 1); + } + + private WeightedRandomMinecart(NBTTagCompound tagCompound, String type, int weight) + { + super(weight); + + if (type.equals("Minecart")) + { + if (tagCompound != null) + { + type = EntityMinecart.EnumMinecartType.byNetworkID(tagCompound.getInteger("Type")).getName(); + } + else + { + type = "MinecartRideable"; + } + } + + this.nbtData = tagCompound; + this.entityType = type; + } + + public NBTTagCompound toNBT() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("Properties", this.nbtData); + nbttagcompound.setString("Type", this.entityType); + nbttagcompound.setInteger("Weight", this.itemWeight); + return nbttagcompound; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntity.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntity.java new file mode 100644 index 0000000..c4fecc1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntity.java @@ -0,0 +1,278 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Maps; +import java.util.Map; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockJukebox; +import net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class TileEntity +{ + private static final Logger logger = LogManager.getLogger(); + private static Map < String, Class > nameToClassMap = Maps. < String, Class > newHashMap(); + private static Map < Class , String > classToNameMap = Maps. < Class , String > newHashMap(); + protected World worldObj; + protected BlockPos pos = BlockPos.ORIGIN; + protected boolean tileEntityInvalid; + private int blockMetadata = -1; + protected Block blockType; + + private static void addMapping(Class cl, String id) + { + if (nameToClassMap.containsKey(id)) + { + throw new IllegalArgumentException("Duplicate id: " + id); + } + else + { + nameToClassMap.put(id, cl); + classToNameMap.put(cl, id); + } + } + + public World getWorld() + { + return this.worldObj; + } + + public void setWorldObj(World worldIn) + { + this.worldObj = worldIn; + } + + public boolean hasWorldObj() + { + return this.worldObj != null; + } + + public void readFromNBT(NBTTagCompound compound) + { + this.pos = new BlockPos(compound.getInteger("x"), compound.getInteger("y"), compound.getInteger("z")); + } + + public void writeToNBT(NBTTagCompound compound) + { + String s = (String)classToNameMap.get(this.getClass()); + + if (s == null) + { + throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!"); + } + else + { + compound.setString("id", s); + compound.setInteger("x", this.pos.getX()); + compound.setInteger("y", this.pos.getY()); + compound.setInteger("z", this.pos.getZ()); + } + } + + public static TileEntity createAndLoadEntity(NBTTagCompound nbt) + { + TileEntity tileentity = null; + + try + { + Class oclass = (Class)nameToClassMap.get(nbt.getString("id")); + + if (oclass != null) + { + tileentity = (TileEntity)oclass.newInstance(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + if (tileentity != null) + { + tileentity.readFromNBT(nbt); + } + else + { + logger.warn("Skipping BlockEntity with id " + nbt.getString("id")); + } + + return tileentity; + } + + public int getBlockMetadata() + { + if (this.blockMetadata == -1) + { + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + this.blockMetadata = iblockstate.getBlock().getMetaFromState(iblockstate); + } + + return this.blockMetadata; + } + + public void markDirty() + { + if (this.worldObj != null) + { + IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + this.blockMetadata = iblockstate.getBlock().getMetaFromState(iblockstate); + this.worldObj.markChunkDirty(this.pos, this); + + if (this.getBlockType() != Blocks.air) + { + this.worldObj.updateComparatorOutputLevel(this.pos, this.getBlockType()); + } + } + } + + public double getDistanceSq(double x, double y, double z) + { + double d0 = (double)this.pos.getX() + 0.5D - x; + double d1 = (double)this.pos.getY() + 0.5D - y; + double d2 = (double)this.pos.getZ() + 0.5D - z; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public double getMaxRenderDistanceSquared() + { + return 4096.0D; + } + + public BlockPos getPos() + { + return this.pos; + } + + public Block getBlockType() + { + if (this.blockType == null) + { + this.blockType = this.worldObj.getBlockState(this.pos).getBlock(); + } + + return this.blockType; + } + + public Packet getDescriptionPacket() + { + return null; + } + + public boolean isInvalid() + { + return this.tileEntityInvalid; + } + + public void invalidate() + { + this.tileEntityInvalid = true; + } + + public void validate() + { + this.tileEntityInvalid = false; + } + + public boolean receiveClientEvent(int id, int type) + { + return false; + } + + public void updateContainingBlockInfo() + { + this.blockType = null; + this.blockMetadata = -1; + } + + public void addInfoToCrashReport(CrashReportCategory reportCategory) + { + reportCategory.addCrashSectionCallable("Name", new Callable() + { + public String call() throws Exception + { + return (String)TileEntity.classToNameMap.get(TileEntity.this.getClass()) + " // " + TileEntity.this.getClass().getCanonicalName(); + } + }); + + if (this.worldObj != null) + { + CrashReportCategory.addBlockInfo(reportCategory, this.pos, this.getBlockType(), this.getBlockMetadata()); + reportCategory.addCrashSectionCallable("Actual block type", new Callable() + { + public String call() throws Exception + { + int i = Block.getIdFromBlock(TileEntity.this.worldObj.getBlockState(TileEntity.this.pos).getBlock()); + + try + { + return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(i), Block.getBlockById(i).getUnlocalizedName(), Block.getBlockById(i).getClass().getCanonicalName()}); + } + catch (Throwable var3) + { + return "ID #" + i; + } + } + }); + reportCategory.addCrashSectionCallable("Actual block data value", new Callable() + { + public String call() throws Exception + { + IBlockState iblockstate = TileEntity.this.worldObj.getBlockState(TileEntity.this.pos); + int i = iblockstate.getBlock().getMetaFromState(iblockstate); + + if (i < 0) + { + return "Unknown? (Got " + i + ")"; + } + else + { + String s = String.format("%4s", new Object[] {Integer.toBinaryString(i)}).replace(" ", "0"); + return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(i), s}); + } + } + }); + } + } + + public void setPos(BlockPos posIn) + { + this.pos = posIn; + } + + public boolean func_183000_F() + { + return false; + } + + static + { + addMapping(TileEntityFurnace.class, "Furnace"); + addMapping(TileEntityChest.class, "Chest"); + addMapping(TileEntityEnderChest.class, "EnderChest"); + addMapping(BlockJukebox.TileEntityJukebox.class, "RecordPlayer"); + addMapping(TileEntityDispenser.class, "Trap"); + addMapping(TileEntityDropper.class, "Dropper"); + addMapping(TileEntitySign.class, "Sign"); + addMapping(TileEntityMobSpawner.class, "MobSpawner"); + addMapping(TileEntityNote.class, "Music"); + addMapping(TileEntityPiston.class, "Piston"); + addMapping(TileEntityBrewingStand.class, "Cauldron"); + addMapping(TileEntityEnchantmentTable.class, "EnchantTable"); + addMapping(TileEntityEndPortal.class, "Airportal"); + addMapping(TileEntityCommandBlock.class, "Control"); + addMapping(TileEntityBeacon.class, "Beacon"); + addMapping(TileEntitySkull.class, "Skull"); + addMapping(TileEntityDaylightDetector.class, "DLDetector"); + addMapping(TileEntityHopper.class, "Hopper"); + addMapping(TileEntityComparator.class, "Comparator"); + addMapping(TileEntityFlowerPot.class, "FlowerPot"); + addMapping(TileEntityBanner.class, "Banner"); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBanner.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBanner.java new file mode 100644 index 0000000..76e06c6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBanner.java @@ -0,0 +1,303 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.BlockFlower; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; + +public class TileEntityBanner extends TileEntity +{ + private int baseColor; + private NBTTagList patterns; + private boolean field_175119_g; + private List patternList; + private List colorList; + private String patternResourceLocation; + + public void setItemValues(ItemStack stack) + { + this.patterns = null; + + if (stack.hasTagCompound() && stack.getTagCompound().hasKey("BlockEntityTag", 10)) + { + NBTTagCompound nbttagcompound = stack.getTagCompound().getCompoundTag("BlockEntityTag"); + + if (nbttagcompound.hasKey("Patterns")) + { + this.patterns = (NBTTagList)nbttagcompound.getTagList("Patterns", 10).copy(); + } + + if (nbttagcompound.hasKey("Base", 99)) + { + this.baseColor = nbttagcompound.getInteger("Base"); + } + else + { + this.baseColor = stack.getMetadata() & 15; + } + } + else + { + this.baseColor = stack.getMetadata() & 15; + } + + this.patternList = null; + this.colorList = null; + this.patternResourceLocation = ""; + this.field_175119_g = true; + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + setBaseColorAndPatterns(compound, this.baseColor, this.patterns); + } + + public static void setBaseColorAndPatterns(NBTTagCompound compound, int baseColorIn, NBTTagList patternsIn) + { + compound.setInteger("Base", baseColorIn); + + if (patternsIn != null) + { + compound.setTag("Patterns", patternsIn); + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.baseColor = compound.getInteger("Base"); + this.patterns = compound.getTagList("Patterns", 10); + this.patternList = null; + this.colorList = null; + this.patternResourceLocation = null; + this.field_175119_g = true; + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 6, nbttagcompound); + } + + public int getBaseColor() + { + return this.baseColor; + } + + public static int getBaseColor(ItemStack stack) + { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + return nbttagcompound != null && nbttagcompound.hasKey("Base") ? nbttagcompound.getInteger("Base") : stack.getMetadata(); + } + + public static int getPatterns(ItemStack stack) + { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + return nbttagcompound != null && nbttagcompound.hasKey("Patterns") ? nbttagcompound.getTagList("Patterns", 10).tagCount() : 0; + } + + public List getPatternList() + { + this.initializeBannerData(); + return this.patternList; + } + + public NBTTagList getPatterns() + { + return this.patterns; + } + + public List getColorList() + { + this.initializeBannerData(); + return this.colorList; + } + + public String getPatternResourceLocation() + { + this.initializeBannerData(); + return this.patternResourceLocation; + } + + private void initializeBannerData() + { + if (this.patternList == null || this.colorList == null || this.patternResourceLocation == null) + { + if (!this.field_175119_g) + { + this.patternResourceLocation = ""; + } + else + { + this.patternList = Lists.newArrayList(); + this.colorList = Lists.newArrayList(); + this.patternList.add(TileEntityBanner.EnumBannerPattern.BASE); + this.colorList.add(EnumDyeColor.byDyeDamage(this.baseColor)); + this.patternResourceLocation = "b" + this.baseColor; + + if (this.patterns != null) + { + for (int i = 0; i < this.patterns.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = this.patterns.getCompoundTagAt(i); + TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound.getString("Pattern")); + + if (tileentitybanner$enumbannerpattern != null) + { + this.patternList.add(tileentitybanner$enumbannerpattern); + int j = nbttagcompound.getInteger("Color"); + this.colorList.add(EnumDyeColor.byDyeDamage(j)); + this.patternResourceLocation = this.patternResourceLocation + tileentitybanner$enumbannerpattern.getPatternID() + j; + } + } + } + } + } + } + + public static void removeBannerData(ItemStack stack) + { + NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false); + + if (nbttagcompound != null && nbttagcompound.hasKey("Patterns", 9)) + { + NBTTagList nbttaglist = nbttagcompound.getTagList("Patterns", 10); + + if (nbttaglist.tagCount() > 0) + { + nbttaglist.removeTag(nbttaglist.tagCount() - 1); + + if (nbttaglist.hasNoTags()) + { + stack.getTagCompound().removeTag("BlockEntityTag"); + + if (stack.getTagCompound().hasNoTags()) + { + stack.setTagCompound((NBTTagCompound)null); + } + } + } + } + } + + public static enum EnumBannerPattern + { + BASE("base", "b"), + SQUARE_BOTTOM_LEFT("square_bottom_left", "bl", " ", " ", "# "), + SQUARE_BOTTOM_RIGHT("square_bottom_right", "br", " ", " ", " #"), + SQUARE_TOP_LEFT("square_top_left", "tl", "# ", " ", " "), + SQUARE_TOP_RIGHT("square_top_right", "tr", " #", " ", " "), + STRIPE_BOTTOM("stripe_bottom", "bs", " ", " ", "###"), + STRIPE_TOP("stripe_top", "ts", "###", " ", " "), + STRIPE_LEFT("stripe_left", "ls", "# ", "# ", "# "), + STRIPE_RIGHT("stripe_right", "rs", " #", " #", " #"), + STRIPE_CENTER("stripe_center", "cs", " # ", " # ", " # "), + STRIPE_MIDDLE("stripe_middle", "ms", " ", "###", " "), + STRIPE_DOWNRIGHT("stripe_downright", "drs", "# ", " # ", " #"), + STRIPE_DOWNLEFT("stripe_downleft", "dls", " #", " # ", "# "), + STRIPE_SMALL("small_stripes", "ss", "# #", "# #", " "), + CROSS("cross", "cr", "# #", " # ", "# #"), + STRAIGHT_CROSS("straight_cross", "sc", " # ", "###", " # "), + TRIANGLE_BOTTOM("triangle_bottom", "bt", " ", " # ", "# #"), + TRIANGLE_TOP("triangle_top", "tt", "# #", " # ", " "), + TRIANGLES_BOTTOM("triangles_bottom", "bts", " ", "# #", " # "), + TRIANGLES_TOP("triangles_top", "tts", " # ", "# #", " "), + DIAGONAL_LEFT("diagonal_left", "ld", "## ", "# ", " "), + DIAGONAL_RIGHT("diagonal_up_right", "rd", " ", " #", " ##"), + DIAGONAL_LEFT_MIRROR("diagonal_up_left", "lud", " ", "# ", "## "), + DIAGONAL_RIGHT_MIRROR("diagonal_right", "rud", " ##", " #", " "), + CIRCLE_MIDDLE("circle", "mc", " ", " # ", " "), + RHOMBUS_MIDDLE("rhombus", "mr", " # ", "# #", " # "), + HALF_VERTICAL("half_vertical", "vh", "## ", "## ", "## "), + HALF_HORIZONTAL("half_horizontal", "hh", "###", "###", " "), + HALF_VERTICAL_MIRROR("half_vertical_right", "vhr", " ##", " ##", " ##"), + HALF_HORIZONTAL_MIRROR("half_horizontal_bottom", "hhb", " ", "###", "###"), + BORDER("border", "bo", "###", "# #", "###"), + CURLY_BORDER("curly_border", "cbo", new ItemStack(Blocks.vine)), + CREEPER("creeper", "cre", new ItemStack(Items.skull, 1, 4)), + GRADIENT("gradient", "gra", "# #", " # ", " # "), + GRADIENT_UP("gradient_up", "gru", " # ", " # ", "# #"), + BRICKS("bricks", "bri", new ItemStack(Blocks.brick_block)), + SKULL("skull", "sku", new ItemStack(Items.skull, 1, 1)), + FLOWER("flower", "flo", new ItemStack(Blocks.red_flower, 1, BlockFlower.EnumFlowerType.OXEYE_DAISY.getMeta())), + MOJANG("mojang", "moj", new ItemStack(Items.golden_apple, 1, 1)); + + private String patternName; + private String patternID; + private String[] craftingLayers; + private ItemStack patternCraftingStack; + + private EnumBannerPattern(String name, String id) + { + this.craftingLayers = new String[3]; + this.patternName = name; + this.patternID = id; + } + + private EnumBannerPattern(String name, String id, ItemStack craftingItem) + { + this(name, id); + this.patternCraftingStack = craftingItem; + } + + private EnumBannerPattern(String name, String id, String craftingTop, String craftingMid, String craftingBot) + { + this(name, id); + this.craftingLayers[0] = craftingTop; + this.craftingLayers[1] = craftingMid; + this.craftingLayers[2] = craftingBot; + } + + public String getPatternName() + { + return this.patternName; + } + + public String getPatternID() + { + return this.patternID; + } + + public String[] getCraftingLayers() + { + return this.craftingLayers; + } + + public boolean hasValidCrafting() + { + return this.patternCraftingStack != null || this.craftingLayers[0] != null; + } + + public boolean hasCraftingStack() + { + return this.patternCraftingStack != null; + } + + public ItemStack getCraftingStack() + { + return this.patternCraftingStack; + } + + public static TileEntityBanner.EnumBannerPattern getPatternByID(String id) + { + for (TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern : values()) + { + if (tileentitybanner$enumbannerpattern.patternID.equals(id)) + { + return tileentitybanner$enumbannerpattern; + } + } + + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java new file mode 100644 index 0000000..d1dce25 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java @@ -0,0 +1,461 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ITickable; + +public class TileEntityBeacon extends TileEntityLockable implements ITickable, IInventory +{ + public static final Potion[][] effectsList = new Potion[][] {{Potion.moveSpeed, Potion.digSpeed}, {Potion.resistance, Potion.jump}, {Potion.damageBoost}, {Potion.regeneration}}; + private final List beamSegments = Lists.newArrayList(); + private long beamRenderCounter; + private float field_146014_j; + private boolean isComplete; + private int levels = -1; + private int primaryEffect; + private int secondaryEffect; + private ItemStack payment; + private String customName; + + public void update() + { + if (this.worldObj.getTotalWorldTime() % 80L == 0L) + { + this.updateBeacon(); + } + } + + public void updateBeacon() + { + this.updateSegmentColors(); + this.addEffectsToPlayers(); + } + + private void addEffectsToPlayers() + { + if (this.isComplete && this.levels > 0 && !this.worldObj.isRemote && this.primaryEffect > 0) + { + double d0 = (double)(this.levels * 10 + 10); + int i = 0; + + if (this.levels >= 4 && this.primaryEffect == this.secondaryEffect) + { + i = 1; + } + + int j = this.pos.getX(); + int k = this.pos.getY(); + int l = this.pos.getZ(); + AxisAlignedBB axisalignedbb = (new AxisAlignedBB((double)j, (double)k, (double)l, (double)(j + 1), (double)(k + 1), (double)(l + 1))).expand(d0, d0, d0).addCoord(0.0D, (double)this.worldObj.getHeight(), 0.0D); + List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb); + + for (EntityPlayer entityplayer : list) + { + entityplayer.addPotionEffect(new PotionEffect(this.primaryEffect, 180, i, true, true)); + } + + if (this.levels >= 4 && this.primaryEffect != this.secondaryEffect && this.secondaryEffect > 0) + { + for (EntityPlayer entityplayer1 : list) + { + entityplayer1.addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true, true)); + } + } + } + } + + private void updateSegmentColors() + { + int i = this.levels; + int j = this.pos.getX(); + int k = this.pos.getY(); + int l = this.pos.getZ(); + this.levels = 0; + this.beamSegments.clear(); + this.isComplete = true; + TileEntityBeacon.BeamSegment tileentitybeacon$beamsegment = new TileEntityBeacon.BeamSegment(EntitySheep.getDyeRgb(EnumDyeColor.WHITE)); + this.beamSegments.add(tileentitybeacon$beamsegment); + boolean flag = true; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i1 = k + 1; i1 < 256; ++i1) + { + IBlockState iblockstate = this.worldObj.getBlockState(blockpos$mutableblockpos.set(j, i1, l)); + float[] afloat; + + if (iblockstate.getBlock() == Blocks.stained_glass) + { + afloat = EntitySheep.getDyeRgb((EnumDyeColor)iblockstate.getValue(BlockStainedGlass.COLOR)); + } + else + { + if (iblockstate.getBlock() != Blocks.stained_glass_pane) + { + if (iblockstate.getBlock().getLightOpacity() >= 15 && iblockstate.getBlock() != Blocks.bedrock) + { + this.isComplete = false; + this.beamSegments.clear(); + break; + } + + tileentitybeacon$beamsegment.incrementHeight(); + continue; + } + + afloat = EntitySheep.getDyeRgb((EnumDyeColor)iblockstate.getValue(BlockStainedGlassPane.COLOR)); + } + + if (!flag) + { + afloat = new float[] {(tileentitybeacon$beamsegment.getColors()[0] + afloat[0]) / 2.0F, (tileentitybeacon$beamsegment.getColors()[1] + afloat[1]) / 2.0F, (tileentitybeacon$beamsegment.getColors()[2] + afloat[2]) / 2.0F}; + } + + if (Arrays.equals(afloat, tileentitybeacon$beamsegment.getColors())) + { + tileentitybeacon$beamsegment.incrementHeight(); + } + else + { + tileentitybeacon$beamsegment = new TileEntityBeacon.BeamSegment(afloat); + this.beamSegments.add(tileentitybeacon$beamsegment); + } + + flag = false; + } + + if (this.isComplete) + { + for (int l1 = 1; l1 <= 4; this.levels = l1++) + { + int i2 = k - l1; + + if (i2 < 0) + { + break; + } + + boolean flag1 = true; + + for (int j1 = j - l1; j1 <= j + l1 && flag1; ++j1) + { + for (int k1 = l - l1; k1 <= l + l1; ++k1) + { + Block block = this.worldObj.getBlockState(new BlockPos(j1, i2, k1)).getBlock(); + + if (block != Blocks.emerald_block && block != Blocks.gold_block && block != Blocks.diamond_block && block != Blocks.iron_block) + { + flag1 = false; + break; + } + } + } + + if (!flag1) + { + break; + } + } + + if (this.levels == 0) + { + this.isComplete = false; + } + } + + if (!this.worldObj.isRemote && this.levels == 4 && i < this.levels) + { + for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, (new AxisAlignedBB((double)j, (double)k, (double)l, (double)j, (double)(k - 4), (double)l)).expand(10.0D, 5.0D, 10.0D))) + { + entityplayer.triggerAchievement(AchievementList.fullBeacon); + } + } + } + + public List getBeamSegments() + { + return this.beamSegments; + } + + public float shouldBeamRender() + { + if (!this.isComplete) + { + return 0.0F; + } + else + { + int i = (int)(this.worldObj.getTotalWorldTime() - this.beamRenderCounter); + this.beamRenderCounter = this.worldObj.getTotalWorldTime(); + + if (i > 1) + { + this.field_146014_j -= (float)i / 40.0F; + + if (this.field_146014_j < 0.0F) + { + this.field_146014_j = 0.0F; + } + } + + this.field_146014_j += 0.025F; + + if (this.field_146014_j > 1.0F) + { + this.field_146014_j = 1.0F; + } + + return this.field_146014_j; + } + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 3, nbttagcompound); + } + + public double getMaxRenderDistanceSquared() + { + return 65536.0D; + } + + private int func_183001_h(int p_183001_1_) + { + if (p_183001_1_ >= 0 && p_183001_1_ < Potion.potionTypes.length && Potion.potionTypes[p_183001_1_] != null) + { + Potion potion = Potion.potionTypes[p_183001_1_]; + return potion != Potion.moveSpeed && potion != Potion.digSpeed && potion != Potion.resistance && potion != Potion.jump && potion != Potion.damageBoost && potion != Potion.regeneration ? 0 : p_183001_1_; + } + else + { + return 0; + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.primaryEffect = this.func_183001_h(compound.getInteger("Primary")); + this.secondaryEffect = this.func_183001_h(compound.getInteger("Secondary")); + this.levels = compound.getInteger("Levels"); + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setInteger("Primary", this.primaryEffect); + compound.setInteger("Secondary", this.secondaryEffect); + compound.setInteger("Levels", this.levels); + } + + public int getSizeInventory() + { + return 1; + } + + public ItemStack getStackInSlot(int index) + { + return index == 0 ? this.payment : null; + } + + public ItemStack decrStackSize(int index, int count) + { + if (index == 0 && this.payment != null) + { + if (count >= this.payment.stackSize) + { + ItemStack itemstack = this.payment; + this.payment = null; + return itemstack; + } + else + { + this.payment.stackSize -= count; + return new ItemStack(this.payment.getItem(), count, this.payment.getMetadata()); + } + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (index == 0 && this.payment != null) + { + ItemStack itemstack = this.payment; + this.payment = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + if (index == 0) + { + this.payment = stack; + } + } + + public String getName() + { + return this.hasCustomName() ? this.customName : "container.beacon"; + } + + public boolean hasCustomName() + { + return this.customName != null && this.customName.length() > 0; + } + + public void setName(String name) + { + this.customName = name; + } + + public int getInventoryStackLimit() + { + return 1; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return stack.getItem() == Items.emerald || stack.getItem() == Items.diamond || stack.getItem() == Items.gold_ingot || stack.getItem() == Items.iron_ingot; + } + + public String getGuiID() + { + return "minecraft:beacon"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerBeacon(playerInventory, this); + } + + public int getField(int id) + { + switch (id) + { + case 0: + return this.levels; + + case 1: + return this.primaryEffect; + + case 2: + return this.secondaryEffect; + + default: + return 0; + } + } + + public void setField(int id, int value) + { + switch (id) + { + case 0: + this.levels = value; + break; + + case 1: + this.primaryEffect = this.func_183001_h(value); + break; + + case 2: + this.secondaryEffect = this.func_183001_h(value); + } + } + + public int getFieldCount() + { + return 3; + } + + public void clear() + { + this.payment = null; + } + + public boolean receiveClientEvent(int id, int type) + { + if (id == 1) + { + this.updateBeacon(); + return true; + } + else + { + return super.receiveClientEvent(id, type); + } + } + + public static class BeamSegment + { + private final float[] colors; + private int height; + + public BeamSegment(float[] p_i45669_1_) + { + this.colors = p_i45669_1_; + this.height = 1; + } + + protected void incrementHeight() + { + ++this.height; + } + + public float[] getColors() + { + return this.colors; + } + + public int getHeight() + { + return this.height; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java new file mode 100644 index 0000000..154dd33 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -0,0 +1,391 @@ +package net.minecraft.tileentity; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.block.BlockBrewingStand; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBrewingStand; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; + +public class TileEntityBrewingStand extends TileEntityLockable implements ITickable, ISidedInventory +{ + private static final int[] inputSlots = new int[] {3}; + private static final int[] outputSlots = new int[] {0, 1, 2}; + private ItemStack[] brewingItemStacks = new ItemStack[4]; + private int brewTime; + private boolean[] filledSlots; + private Item ingredientID; + private String customName; + + public String getName() + { + return this.hasCustomName() ? this.customName : "container.brewing"; + } + + public boolean hasCustomName() + { + return this.customName != null && this.customName.length() > 0; + } + + public void setName(String name) + { + this.customName = name; + } + + public int getSizeInventory() + { + return this.brewingItemStacks.length; + } + + public void update() + { + if (this.brewTime > 0) + { + --this.brewTime; + + if (this.brewTime == 0) + { + this.brewPotions(); + this.markDirty(); + } + else if (!this.canBrew()) + { + this.brewTime = 0; + this.markDirty(); + } + else if (this.ingredientID != this.brewingItemStacks[3].getItem()) + { + this.brewTime = 0; + this.markDirty(); + } + } + else if (this.canBrew()) + { + this.brewTime = 400; + this.ingredientID = this.brewingItemStacks[3].getItem(); + } + + if (!this.worldObj.isRemote) + { + boolean[] aboolean = this.func_174902_m(); + + if (!Arrays.equals(aboolean, this.filledSlots)) + { + this.filledSlots = aboolean; + IBlockState iblockstate = this.worldObj.getBlockState(this.getPos()); + + if (!(iblockstate.getBlock() instanceof BlockBrewingStand)) + { + return; + } + + for (int i = 0; i < BlockBrewingStand.HAS_BOTTLE.length; ++i) + { + iblockstate = iblockstate.withProperty(BlockBrewingStand.HAS_BOTTLE[i], Boolean.valueOf(aboolean[i])); + } + + this.worldObj.setBlockState(this.pos, iblockstate, 2); + } + } + } + + private boolean canBrew() + { + if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) + { + ItemStack itemstack = this.brewingItemStacks[3]; + + if (!itemstack.getItem().isPotionIngredient(itemstack)) + { + return false; + } + else + { + boolean flag = false; + + for (int i = 0; i < 3; ++i) + { + if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) + { + int j = this.brewingItemStacks[i].getMetadata(); + int k = this.getPotionResult(j, itemstack); + + if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k)) + { + flag = true; + break; + } + + List list = Items.potionitem.getEffects(j); + List list1 = Items.potionitem.getEffects(k); + + if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) && j != k) + { + flag = true; + break; + } + } + } + + return flag; + } + } + else + { + return false; + } + } + + private void brewPotions() + { + if (this.canBrew()) + { + ItemStack itemstack = this.brewingItemStacks[3]; + + for (int i = 0; i < 3; ++i) + { + if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) + { + int j = this.brewingItemStacks[i].getMetadata(); + int k = this.getPotionResult(j, itemstack); + List list = Items.potionitem.getEffects(j); + List list1 = Items.potionitem.getEffects(k); + + if (j > 0 && list == list1 || list != null && (list.equals(list1) || list1 == null)) + { + if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k)) + { + this.brewingItemStacks[i].setItemDamage(k); + } + } + else if (j != k) + { + this.brewingItemStacks[i].setItemDamage(k); + } + } + } + + if (itemstack.getItem().hasContainerItem()) + { + this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem()); + } + else + { + --this.brewingItemStacks[3].stackSize; + + if (this.brewingItemStacks[3].stackSize <= 0) + { + this.brewingItemStacks[3] = null; + } + } + } + } + + private int getPotionResult(int meta, ItemStack stack) + { + return stack == null ? meta : (stack.getItem().isPotionIngredient(stack) ? PotionHelper.applyIngredient(meta, stack.getItem().getPotionEffect(stack)) : meta); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot"); + + if (j >= 0 && j < this.brewingItemStacks.length) + { + this.brewingItemStacks[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); + } + } + + this.brewTime = compound.getShort("BrewTime"); + + if (compound.hasKey("CustomName", 8)) + { + this.customName = compound.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setShort("BrewTime", (short)this.brewTime); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.brewingItemStacks.length; ++i) + { + if (this.brewingItemStacks[i] != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.brewingItemStacks[i].writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomName()) + { + compound.setString("CustomName", this.customName); + } + } + + public ItemStack getStackInSlot(int index) + { + return index >= 0 && index < this.brewingItemStacks.length ? this.brewingItemStacks[index] : null; + } + + public ItemStack decrStackSize(int index, int count) + { + if (index >= 0 && index < this.brewingItemStacks.length) + { + ItemStack itemstack = this.brewingItemStacks[index]; + this.brewingItemStacks[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (index >= 0 && index < this.brewingItemStacks.length) + { + ItemStack itemstack = this.brewingItemStacks[index]; + this.brewingItemStacks[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + if (index >= 0 && index < this.brewingItemStacks.length) + { + this.brewingItemStacks[index] = stack; + } + } + + public int getInventoryStackLimit() + { + return 64; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle; + } + + public boolean[] func_174902_m() + { + boolean[] aboolean = new boolean[3]; + + for (int i = 0; i < 3; ++i) + { + if (this.brewingItemStacks[i] != null) + { + aboolean[i] = true; + } + } + + return aboolean; + } + + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.UP ? inputSlots : outputSlots; + } + + public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) + { + return this.isItemValidForSlot(index, itemStackIn); + } + + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) + { + return true; + } + + public String getGuiID() + { + return "minecraft:brewing_stand"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerBrewingStand(playerInventory, this); + } + + public int getField(int id) + { + switch (id) + { + case 0: + return this.brewTime; + + default: + return 0; + } + } + + public void setField(int id, int value) + { + switch (id) + { + case 0: + this.brewTime = value; + + default: + } + } + + public int getFieldCount() + { + return 1; + } + + public void clear() + { + for (int i = 0; i < this.brewingItemStacks.length; ++i) + { + this.brewingItemStacks[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityChest.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityChest.java new file mode 100644 index 0000000..b4aeeeb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityChest.java @@ -0,0 +1,467 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryLargeChest; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; + +public class TileEntityChest extends TileEntityLockable implements ITickable, IInventory +{ + private ItemStack[] chestContents = new ItemStack[27]; + public boolean adjacentChestChecked; + public TileEntityChest adjacentChestZNeg; + public TileEntityChest adjacentChestXPos; + public TileEntityChest adjacentChestXNeg; + public TileEntityChest adjacentChestZPos; + public float lidAngle; + public float prevLidAngle; + public int numPlayersUsing; + private int ticksSinceSync; + private int cachedChestType; + private String customName; + + public TileEntityChest() + { + this.cachedChestType = -1; + } + + public TileEntityChest(int chestType) + { + this.cachedChestType = chestType; + } + + public int getSizeInventory() + { + return 27; + } + + public ItemStack getStackInSlot(int index) + { + return this.chestContents[index]; + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.chestContents[index] != null) + { + if (this.chestContents[index].stackSize <= count) + { + ItemStack itemstack1 = this.chestContents[index]; + this.chestContents[index] = null; + this.markDirty(); + return itemstack1; + } + else + { + ItemStack itemstack = this.chestContents[index].splitStack(count); + + if (this.chestContents[index].stackSize == 0) + { + this.chestContents[index] = null; + } + + this.markDirty(); + return itemstack; + } + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.chestContents[index] != null) + { + ItemStack itemstack = this.chestContents[index]; + this.chestContents[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.chestContents[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + public String getName() + { + return this.hasCustomName() ? this.customName : "container.chest"; + } + + public boolean hasCustomName() + { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String name) + { + this.customName = name; + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.chestContents = new ItemStack[this.getSizeInventory()]; + + if (compound.hasKey("CustomName", 8)) + { + this.customName = compound.getString("CustomName"); + } + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + + if (j >= 0 && j < this.chestContents.length) + { + this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); + } + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.chestContents.length; ++i) + { + if (this.chestContents[i] != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.chestContents[i].writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomName()) + { + compound.setString("CustomName", this.customName); + } + } + + public int getInventoryStackLimit() + { + return 64; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void updateContainingBlockInfo() + { + super.updateContainingBlockInfo(); + this.adjacentChestChecked = false; + } + + @SuppressWarnings("incomplete-switch") + private void func_174910_a(TileEntityChest chestTe, EnumFacing side) + { + if (chestTe.isInvalid()) + { + this.adjacentChestChecked = false; + } + else if (this.adjacentChestChecked) + { + switch (side) + { + case NORTH: + if (this.adjacentChestZNeg != chestTe) + { + this.adjacentChestChecked = false; + } + + break; + + case SOUTH: + if (this.adjacentChestZPos != chestTe) + { + this.adjacentChestChecked = false; + } + + break; + + case EAST: + if (this.adjacentChestXPos != chestTe) + { + this.adjacentChestChecked = false; + } + + break; + + case WEST: + if (this.adjacentChestXNeg != chestTe) + { + this.adjacentChestChecked = false; + } + } + } + } + + public void checkForAdjacentChests() + { + if (!this.adjacentChestChecked) + { + this.adjacentChestChecked = true; + this.adjacentChestXNeg = this.getAdjacentChest(EnumFacing.WEST); + this.adjacentChestXPos = this.getAdjacentChest(EnumFacing.EAST); + this.adjacentChestZNeg = this.getAdjacentChest(EnumFacing.NORTH); + this.adjacentChestZPos = this.getAdjacentChest(EnumFacing.SOUTH); + } + } + + protected TileEntityChest getAdjacentChest(EnumFacing side) + { + BlockPos blockpos = this.pos.offset(side); + + if (this.isChestAt(blockpos)) + { + TileEntity tileentity = this.worldObj.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityChest) + { + TileEntityChest tileentitychest = (TileEntityChest)tileentity; + tileentitychest.func_174910_a(this, side.getOpposite()); + return tileentitychest; + } + } + + return null; + } + + private boolean isChestAt(BlockPos posIn) + { + if (this.worldObj == null) + { + return false; + } + else + { + Block block = this.worldObj.getBlockState(posIn).getBlock(); + return block instanceof BlockChest && ((BlockChest)block).chestType == this.getChestType(); + } + } + + public void update() + { + this.checkForAdjacentChests(); + int i = this.pos.getX(); + int j = this.pos.getY(); + int k = this.pos.getZ(); + ++this.ticksSinceSync; + + if (!this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + i + j + k) % 200 == 0) + { + this.numPlayersUsing = 0; + float f = 5.0F; + + for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB((double)((float)i - f), (double)((float)j - f), (double)((float)k - f), (double)((float)(i + 1) + f), (double)((float)(j + 1) + f), (double)((float)(k + 1) + f)))) + { + if (entityplayer.openContainer instanceof ContainerChest) + { + IInventory iinventory = ((ContainerChest)entityplayer.openContainer).getLowerChestInventory(); + + if (iinventory == this || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest)iinventory).isPartOfLargeChest(this)) + { + ++this.numPlayersUsing; + } + } + } + } + + this.prevLidAngle = this.lidAngle; + float f1 = 0.1F; + + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) + { + double d1 = (double)i + 0.5D; + double d2 = (double)k + 0.5D; + + if (this.adjacentChestZPos != null) + { + d2 += 0.5D; + } + + if (this.adjacentChestXPos != null) + { + d1 += 0.5D; + } + + this.worldObj.playSoundEffect(d1, (double)j + 0.5D, d2, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) + { + float f2 = this.lidAngle; + + if (this.numPlayersUsing > 0) + { + this.lidAngle += f1; + } + else + { + this.lidAngle -= f1; + } + + if (this.lidAngle > 1.0F) + { + this.lidAngle = 1.0F; + } + + float f3 = 0.5F; + + if (this.lidAngle < f3 && f2 >= f3 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) + { + double d3 = (double)i + 0.5D; + double d0 = (double)k + 0.5D; + + if (this.adjacentChestZPos != null) + { + d0 += 0.5D; + } + + if (this.adjacentChestXPos != null) + { + d3 += 0.5D; + } + + this.worldObj.playSoundEffect(d3, (double)j + 0.5D, d0, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.lidAngle < 0.0F) + { + this.lidAngle = 0.0F; + } + } + } + + public boolean receiveClientEvent(int id, int type) + { + if (id == 1) + { + this.numPlayersUsing = type; + return true; + } + else + { + return super.receiveClientEvent(id, type); + } + } + + public void openInventory(EntityPlayer player) + { + if (!player.isSpectator()) + { + if (this.numPlayersUsing < 0) + { + this.numPlayersUsing = 0; + } + + ++this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing); + this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType()); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType()); + } + } + + public void closeInventory(EntityPlayer player) + { + if (!player.isSpectator() && this.getBlockType() instanceof BlockChest) + { + --this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, this.getBlockType(), 1, this.numPlayersUsing); + this.worldObj.notifyNeighborsOfStateChange(this.pos, this.getBlockType()); + this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), this.getBlockType()); + } + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public void invalidate() + { + super.invalidate(); + this.updateContainingBlockInfo(); + this.checkForAdjacentChests(); + } + + public int getChestType() + { + if (this.cachedChestType == -1) + { + if (this.worldObj == null || !(this.getBlockType() instanceof BlockChest)) + { + return 0; + } + + this.cachedChestType = ((BlockChest)this.getBlockType()).chestType; + } + + return this.cachedChestType; + } + + public String getGuiID() + { + return "minecraft:chest"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerChest(playerInventory, this, playerIn); + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.chestContents.length; ++i) + { + this.chestContents[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java new file mode 100644 index 0000000..9cdb701 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java @@ -0,0 +1,88 @@ +package net.minecraft.tileentity; + +import io.netty.buffer.ByteBuf; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class TileEntityCommandBlock extends TileEntity +{ + private final CommandBlockLogic commandBlockLogic = new CommandBlockLogic() + { + public BlockPos getPosition() + { + return TileEntityCommandBlock.this.pos; + } + public Vec3 getPositionVector() + { + return new Vec3((double)TileEntityCommandBlock.this.pos.getX() + 0.5D, (double)TileEntityCommandBlock.this.pos.getY() + 0.5D, (double)TileEntityCommandBlock.this.pos.getZ() + 0.5D); + } + public World getEntityWorld() + { + return TileEntityCommandBlock.this.getWorld(); + } + public void setCommand(String command) + { + super.setCommand(command); + TileEntityCommandBlock.this.markDirty(); + } + public void updateCommand() + { + TileEntityCommandBlock.this.getWorld().markBlockForUpdate(TileEntityCommandBlock.this.pos); + } + public int func_145751_f() + { + return 0; + } + public void func_145757_a(ByteBuf p_145757_1_) + { + p_145757_1_.writeInt(TileEntityCommandBlock.this.pos.getX()); + p_145757_1_.writeInt(TileEntityCommandBlock.this.pos.getY()); + p_145757_1_.writeInt(TileEntityCommandBlock.this.pos.getZ()); + } + public Entity getCommandSenderEntity() + { + return null; + } + }; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + this.commandBlockLogic.writeDataToNBT(compound); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.commandBlockLogic.readDataFromNBT(compound); + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 2, nbttagcompound); + } + + public boolean func_183000_F() + { + return true; + } + + public CommandBlockLogic getCommandBlockLogic() + { + return this.commandBlockLogic; + } + + public CommandResultStats getCommandResultStats() + { + return this.commandBlockLogic.getCommandResultStats(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityComparator.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityComparator.java new file mode 100644 index 0000000..755b9c8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityComparator.java @@ -0,0 +1,30 @@ +package net.minecraft.tileentity; + +import net.minecraft.nbt.NBTTagCompound; + +public class TileEntityComparator extends TileEntity +{ + private int outputSignal; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setInteger("OutputSignal", this.outputSignal); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.outputSignal = compound.getInteger("OutputSignal"); + } + + public int getOutputSignal() + { + return this.outputSignal; + } + + public void setOutputSignal(int p_145995_1_) + { + this.outputSignal = p_145995_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java new file mode 100644 index 0000000..79a3e38 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java @@ -0,0 +1,20 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.BlockDaylightDetector; +import net.minecraft.util.ITickable; + +public class TileEntityDaylightDetector extends TileEntity implements ITickable +{ + public void update() + { + if (this.worldObj != null && !this.worldObj.isRemote && this.worldObj.getTotalWorldTime() % 20L == 0L) + { + this.blockType = this.getBlockType(); + + if (this.blockType instanceof BlockDaylightDetector) + { + ((BlockDaylightDetector)this.blockType).updatePower(this.worldObj, this.pos); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java new file mode 100644 index 0000000..d987e80 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java @@ -0,0 +1,231 @@ +package net.minecraft.tileentity; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerDispenser; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class TileEntityDispenser extends TileEntityLockable implements IInventory +{ + private static final Random RNG = new Random(); + private ItemStack[] stacks = new ItemStack[9]; + protected String customName; + + public int getSizeInventory() + { + return 9; + } + + public ItemStack getStackInSlot(int index) + { + return this.stacks[index]; + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.stacks[index] != null) + { + if (this.stacks[index].stackSize <= count) + { + ItemStack itemstack1 = this.stacks[index]; + this.stacks[index] = null; + this.markDirty(); + return itemstack1; + } + else + { + ItemStack itemstack = this.stacks[index].splitStack(count); + + if (this.stacks[index].stackSize == 0) + { + this.stacks[index] = null; + } + + this.markDirty(); + return itemstack; + } + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.stacks[index] != null) + { + ItemStack itemstack = this.stacks[index]; + this.stacks[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public int getDispenseSlot() + { + int i = -1; + int j = 1; + + for (int k = 0; k < this.stacks.length; ++k) + { + if (this.stacks[k] != null && RNG.nextInt(j++) == 0) + { + i = k; + } + } + + return i; + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.stacks[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + public int addItemStack(ItemStack stack) + { + for (int i = 0; i < this.stacks.length; ++i) + { + if (this.stacks[i] == null || this.stacks[i].getItem() == null) + { + this.setInventorySlotContents(i, stack); + return i; + } + } + + return -1; + } + + public String getName() + { + return this.hasCustomName() ? this.customName : "container.dispenser"; + } + + public void setCustomName(String customName) + { + this.customName = customName; + } + + public boolean hasCustomName() + { + return this.customName != null; + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.stacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + + if (j >= 0 && j < this.stacks.length) + { + this.stacks[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); + } + } + + if (compound.hasKey("CustomName", 8)) + { + this.customName = compound.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.stacks.length; ++i) + { + if (this.stacks[i] != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.stacks[i].writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomName()) + { + compound.setString("CustomName", this.customName); + } + } + + public int getInventoryStackLimit() + { + return 64; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public String getGuiID() + { + return "minecraft:dispenser"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerDispenser(playerInventory, this); + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.stacks.length; ++i) + { + this.stacks[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDropper.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDropper.java new file mode 100644 index 0000000..4260284 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityDropper.java @@ -0,0 +1,14 @@ +package net.minecraft.tileentity; + +public class TileEntityDropper extends TileEntityDispenser +{ + public String getName() + { + return this.hasCustomName() ? this.customName : "container.dropper"; + } + + public String getGuiID() + { + return "minecraft:dropper"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java new file mode 100644 index 0000000..3c66b42 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java @@ -0,0 +1,157 @@ +package net.minecraft.tileentity; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerEnchantment; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ITickable; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IInteractionObject; + +public class TileEntityEnchantmentTable extends TileEntity implements ITickable, IInteractionObject +{ + public int tickCount; + public float pageFlip; + public float pageFlipPrev; + public float field_145932_k; + public float field_145929_l; + public float bookSpread; + public float bookSpreadPrev; + public float bookRotation; + public float bookRotationPrev; + public float field_145924_q; + private static Random rand = new Random(); + private String customName; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + + if (this.hasCustomName()) + { + compound.setString("CustomName", this.customName); + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + + if (compound.hasKey("CustomName", 8)) + { + this.customName = compound.getString("CustomName"); + } + } + + public void update() + { + this.bookSpreadPrev = this.bookSpread; + this.bookRotationPrev = this.bookRotation; + EntityPlayer entityplayer = this.worldObj.getClosestPlayer((double)((float)this.pos.getX() + 0.5F), (double)((float)this.pos.getY() + 0.5F), (double)((float)this.pos.getZ() + 0.5F), 3.0D); + + if (entityplayer != null) + { + double d0 = entityplayer.posX - (double)((float)this.pos.getX() + 0.5F); + double d1 = entityplayer.posZ - (double)((float)this.pos.getZ() + 0.5F); + this.field_145924_q = (float)MathHelper.atan2(d1, d0); + this.bookSpread += 0.1F; + + if (this.bookSpread < 0.5F || rand.nextInt(40) == 0) + { + float f1 = this.field_145932_k; + + while (true) + { + this.field_145932_k += (float)(rand.nextInt(4) - rand.nextInt(4)); + + if (f1 != this.field_145932_k) + { + break; + } + } + } + } + else + { + this.field_145924_q += 0.02F; + this.bookSpread -= 0.1F; + } + + while (this.bookRotation >= (float)Math.PI) + { + this.bookRotation -= ((float)Math.PI * 2F); + } + + while (this.bookRotation < -(float)Math.PI) + { + this.bookRotation += ((float)Math.PI * 2F); + } + + while (this.field_145924_q >= (float)Math.PI) + { + this.field_145924_q -= ((float)Math.PI * 2F); + } + + while (this.field_145924_q < -(float)Math.PI) + { + this.field_145924_q += ((float)Math.PI * 2F); + } + + float f2; + + for (f2 = this.field_145924_q - this.bookRotation; f2 >= (float)Math.PI; f2 -= ((float)Math.PI * 2F)) + { + ; + } + + while (f2 < -(float)Math.PI) + { + f2 += ((float)Math.PI * 2F); + } + + this.bookRotation += f2 * 0.4F; + this.bookSpread = MathHelper.clamp_float(this.bookSpread, 0.0F, 1.0F); + ++this.tickCount; + this.pageFlipPrev = this.pageFlip; + float f = (this.field_145932_k - this.pageFlip) * 0.4F; + float f3 = 0.2F; + f = MathHelper.clamp_float(f, -f3, f3); + this.field_145929_l += (f - this.field_145929_l) * 0.9F; + this.pageFlip += this.field_145929_l; + } + + public String getName() + { + return this.hasCustomName() ? this.customName : "container.enchant"; + } + + public boolean hasCustomName() + { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String customNameIn) + { + this.customName = customNameIn; + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerEnchantment(playerInventory, this.worldObj, this.pos); + } + + public String getGuiID() + { + return "minecraft:enchanting_table"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java new file mode 100644 index 0000000..3aa0d3e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java @@ -0,0 +1,5 @@ +package net.minecraft.tileentity; + +public class TileEntityEndPortal extends TileEntity +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java new file mode 100644 index 0000000..d85b950 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java @@ -0,0 +1,103 @@ +package net.minecraft.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.ITickable; + +public class TileEntityEnderChest extends TileEntity implements ITickable +{ + public float lidAngle; + public float prevLidAngle; + public int numPlayersUsing; + private int ticksSinceSync; + + public void update() + { + if (++this.ticksSinceSync % 20 * 4 == 0) + { + this.worldObj.addBlockEvent(this.pos, Blocks.ender_chest, 1, this.numPlayersUsing); + } + + this.prevLidAngle = this.lidAngle; + int i = this.pos.getX(); + int j = this.pos.getY(); + int k = this.pos.getZ(); + float f = 0.1F; + + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F) + { + double d0 = (double)i + 0.5D; + double d1 = (double)k + 0.5D; + this.worldObj.playSoundEffect(d0, (double)j + 0.5D, d1, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) + { + float f2 = this.lidAngle; + + if (this.numPlayersUsing > 0) + { + this.lidAngle += f; + } + else + { + this.lidAngle -= f; + } + + if (this.lidAngle > 1.0F) + { + this.lidAngle = 1.0F; + } + + float f1 = 0.5F; + + if (this.lidAngle < f1 && f2 >= f1) + { + double d3 = (double)i + 0.5D; + double d2 = (double)k + 0.5D; + this.worldObj.playSoundEffect(d3, (double)j + 0.5D, d2, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.lidAngle < 0.0F) + { + this.lidAngle = 0.0F; + } + } + } + + public boolean receiveClientEvent(int id, int type) + { + if (id == 1) + { + this.numPlayersUsing = type; + return true; + } + else + { + return super.receiveClientEvent(id, type); + } + } + + public void invalidate() + { + this.updateContainingBlockInfo(); + super.invalidate(); + } + + public void openChest() + { + ++this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, Blocks.ender_chest, 1, this.numPlayersUsing); + } + + public void closeChest() + { + --this.numPlayersUsing; + this.worldObj.addBlockEvent(this.pos, Blocks.ender_chest, 1, this.numPlayersUsing); + } + + public boolean canBeUsed(EntityPlayer p_145971_1_) + { + return this.worldObj.getTileEntity(this.pos) != this ? false : p_145971_1_.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java new file mode 100644 index 0000000..3f3b6d2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java @@ -0,0 +1,72 @@ +package net.minecraft.tileentity; + +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.ResourceLocation; + +public class TileEntityFlowerPot extends TileEntity +{ + private Item flowerPotItem; + private int flowerPotData; + + public TileEntityFlowerPot() + { + } + + public TileEntityFlowerPot(Item potItem, int potData) + { + this.flowerPotItem = potItem; + this.flowerPotData = potData; + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + ResourceLocation resourcelocation = (ResourceLocation)Item.itemRegistry.getNameForObject(this.flowerPotItem); + compound.setString("Item", resourcelocation == null ? "" : resourcelocation.toString()); + compound.setInteger("Data", this.flowerPotData); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + + if (compound.hasKey("Item", 8)) + { + this.flowerPotItem = Item.getByNameOrId(compound.getString("Item")); + } + else + { + this.flowerPotItem = Item.getItemById(compound.getInteger("Item")); + } + + this.flowerPotData = compound.getInteger("Data"); + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("Item"); + nbttagcompound.setInteger("Item", Item.getIdFromItem(this.flowerPotItem)); + return new S35PacketUpdateTileEntity(this.pos, 5, nbttagcompound); + } + + public void setFlowerPotData(Item potItem, int potData) + { + this.flowerPotItem = potItem; + this.flowerPotData = potData; + } + + public Item getFlowerPotItem() + { + return this.flowerPotItem; + } + + public int getFlowerPotData() + { + return this.flowerPotData; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java new file mode 100644 index 0000000..e3d4dbf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java @@ -0,0 +1,458 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerFurnace; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.inventory.SlotFurnaceFuel; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.item.ItemTool; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.MathHelper; + +public class TileEntityFurnace extends TileEntityLockable implements ITickable, ISidedInventory +{ + private static final int[] slotsTop = new int[] {0}; + private static final int[] slotsBottom = new int[] {2, 1}; + private static final int[] slotsSides = new int[] {1}; + private ItemStack[] furnaceItemStacks = new ItemStack[3]; + private int furnaceBurnTime; + private int currentItemBurnTime; + private int cookTime; + private int totalCookTime; + private String furnaceCustomName; + + public int getSizeInventory() + { + return this.furnaceItemStacks.length; + } + + public ItemStack getStackInSlot(int index) + { + return this.furnaceItemStacks[index]; + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.furnaceItemStacks[index] != null) + { + if (this.furnaceItemStacks[index].stackSize <= count) + { + ItemStack itemstack1 = this.furnaceItemStacks[index]; + this.furnaceItemStacks[index] = null; + return itemstack1; + } + else + { + ItemStack itemstack = this.furnaceItemStacks[index].splitStack(count); + + if (this.furnaceItemStacks[index].stackSize == 0) + { + this.furnaceItemStacks[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.furnaceItemStacks[index] != null) + { + ItemStack itemstack = this.furnaceItemStacks[index]; + this.furnaceItemStacks[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + boolean flag = stack != null && stack.isItemEqual(this.furnaceItemStacks[index]) && ItemStack.areItemStackTagsEqual(stack, this.furnaceItemStacks[index]); + this.furnaceItemStacks[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + if (index == 0 && !flag) + { + this.totalCookTime = this.getCookTime(stack); + this.cookTime = 0; + this.markDirty(); + } + } + + public String getName() + { + return this.hasCustomName() ? this.furnaceCustomName : "container.furnace"; + } + + public boolean hasCustomName() + { + return this.furnaceCustomName != null && this.furnaceCustomName.length() > 0; + } + + public void setCustomInventoryName(String p_145951_1_) + { + this.furnaceCustomName = p_145951_1_; + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.furnaceItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot"); + + if (j >= 0 && j < this.furnaceItemStacks.length) + { + this.furnaceItemStacks[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); + } + } + + this.furnaceBurnTime = compound.getShort("BurnTime"); + this.cookTime = compound.getShort("CookTime"); + this.totalCookTime = compound.getShort("CookTimeTotal"); + this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); + + if (compound.hasKey("CustomName", 8)) + { + this.furnaceCustomName = compound.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setShort("BurnTime", (short)this.furnaceBurnTime); + compound.setShort("CookTime", (short)this.cookTime); + compound.setShort("CookTimeTotal", (short)this.totalCookTime); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.furnaceItemStacks.length; ++i) + { + if (this.furnaceItemStacks[i] != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.furnaceItemStacks[i].writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomName()) + { + compound.setString("CustomName", this.furnaceCustomName); + } + } + + public int getInventoryStackLimit() + { + return 64; + } + + public boolean isBurning() + { + return this.furnaceBurnTime > 0; + } + + public static boolean isBurning(IInventory p_174903_0_) + { + return p_174903_0_.getField(0) > 0; + } + + public void update() + { + boolean flag = this.isBurning(); + boolean flag1 = false; + + if (this.isBurning()) + { + --this.furnaceBurnTime; + } + + if (!this.worldObj.isRemote) + { + if (this.isBurning() || this.furnaceItemStacks[1] != null && this.furnaceItemStacks[0] != null) + { + if (!this.isBurning() && this.canSmelt()) + { + this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); + + if (this.isBurning()) + { + flag1 = true; + + if (this.furnaceItemStacks[1] != null) + { + --this.furnaceItemStacks[1].stackSize; + + if (this.furnaceItemStacks[1].stackSize == 0) + { + Item item = this.furnaceItemStacks[1].getItem().getContainerItem(); + this.furnaceItemStacks[1] = item != null ? new ItemStack(item) : null; + } + } + } + } + + if (this.isBurning() && this.canSmelt()) + { + ++this.cookTime; + + if (this.cookTime == this.totalCookTime) + { + this.cookTime = 0; + this.totalCookTime = this.getCookTime(this.furnaceItemStacks[0]); + this.smeltItem(); + flag1 = true; + } + } + else + { + this.cookTime = 0; + } + } + else if (!this.isBurning() && this.cookTime > 0) + { + this.cookTime = MathHelper.clamp_int(this.cookTime - 2, 0, this.totalCookTime); + } + + if (flag != this.isBurning()) + { + flag1 = true; + BlockFurnace.setState(this.isBurning(), this.worldObj, this.pos); + } + } + + if (flag1) + { + this.markDirty(); + } + } + + public int getCookTime(ItemStack stack) + { + return 200; + } + + private boolean canSmelt() + { + if (this.furnaceItemStacks[0] == null) + { + return false; + } + else + { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks[0]); + return itemstack == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(itemstack) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < itemstack.getMaxStackSize()))); + } + } + + public void smeltItem() + { + if (this.canSmelt()) + { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks[0]); + + if (this.furnaceItemStacks[2] == null) + { + this.furnaceItemStacks[2] = itemstack.copy(); + } + else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem()) + { + ++this.furnaceItemStacks[2].stackSize; + } + + if (this.furnaceItemStacks[0].getItem() == Item.getItemFromBlock(Blocks.sponge) && this.furnaceItemStacks[0].getMetadata() == 1 && this.furnaceItemStacks[1] != null && this.furnaceItemStacks[1].getItem() == Items.bucket) + { + this.furnaceItemStacks[1] = new ItemStack(Items.water_bucket); + } + + --this.furnaceItemStacks[0].stackSize; + + if (this.furnaceItemStacks[0].stackSize <= 0) + { + this.furnaceItemStacks[0] = null; + } + } + } + + public static int getItemBurnTime(ItemStack p_145952_0_) + { + if (p_145952_0_ == null) + { + return 0; + } + else + { + Item item = p_145952_0_.getItem(); + + if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) + { + Block block = Block.getBlockFromItem(item); + + if (block == Blocks.wooden_slab) + { + return 150; + } + + if (block.getMaterial() == Material.wood) + { + return 300; + } + + if (block == Blocks.coal_block) + { + return 16000; + } + } + + return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0))))))); + } + } + + public static boolean isItemFuel(ItemStack p_145954_0_) + { + return getItemBurnTime(p_145954_0_) > 0; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return index == 2 ? false : (index != 1 ? true : isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack)); + } + + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides); + } + + public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) + { + return this.isItemValidForSlot(index, itemStackIn); + } + + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) + { + if (direction == EnumFacing.DOWN && index == 1) + { + Item item = stack.getItem(); + + if (item != Items.water_bucket && item != Items.bucket) + { + return false; + } + } + + return true; + } + + public String getGuiID() + { + return "minecraft:furnace"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerFurnace(playerInventory, this); + } + + public int getField(int id) + { + switch (id) + { + case 0: + return this.furnaceBurnTime; + + case 1: + return this.currentItemBurnTime; + + case 2: + return this.cookTime; + + case 3: + return this.totalCookTime; + + default: + return 0; + } + } + + public void setField(int id, int value) + { + switch (id) + { + case 0: + this.furnaceBurnTime = value; + break; + + case 1: + this.currentItemBurnTime = value; + break; + + case 2: + this.cookTime = value; + break; + + case 3: + this.totalCookTime = value; + } + } + + public int getFieldCount() + { + return 4; + } + + public void clear() + { + for (int i = 0; i < this.furnaceItemStacks.length; ++i) + { + this.furnaceItemStacks[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityHopper.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityHopper.java new file mode 100644 index 0000000..293a207 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityHopper.java @@ -0,0 +1,671 @@ +package net.minecraft.tileentity; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockHopper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerHopper; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class TileEntityHopper extends TileEntityLockable implements IHopper, ITickable +{ + private ItemStack[] inventory = new ItemStack[5]; + private String customName; + private int transferCooldown = -1; + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.inventory = new ItemStack[this.getSizeInventory()]; + + if (compound.hasKey("CustomName", 8)) + { + this.customName = compound.getString("CustomName"); + } + + this.transferCooldown = compound.getInteger("TransferCooldown"); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot"); + + if (j >= 0 && j < this.inventory.length) + { + this.inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound); + } + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.inventory.length; ++i) + { + if (this.inventory[i] != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.inventory[i].writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + compound.setTag("Items", nbttaglist); + compound.setInteger("TransferCooldown", this.transferCooldown); + + if (this.hasCustomName()) + { + compound.setString("CustomName", this.customName); + } + } + + public void markDirty() + { + super.markDirty(); + } + + public int getSizeInventory() + { + return this.inventory.length; + } + + public ItemStack getStackInSlot(int index) + { + return this.inventory[index]; + } + + public ItemStack decrStackSize(int index, int count) + { + if (this.inventory[index] != null) + { + if (this.inventory[index].stackSize <= count) + { + ItemStack itemstack1 = this.inventory[index]; + this.inventory[index] = null; + return itemstack1; + } + else + { + ItemStack itemstack = this.inventory[index].splitStack(count); + + if (this.inventory[index].stackSize == 0) + { + this.inventory[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + public ItemStack removeStackFromSlot(int index) + { + if (this.inventory[index] != null) + { + ItemStack itemstack = this.inventory[index]; + this.inventory[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public void setInventorySlotContents(int index, ItemStack stack) + { + this.inventory[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + } + + public String getName() + { + return this.hasCustomName() ? this.customName : "container.hopper"; + } + + public boolean hasCustomName() + { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String customNameIn) + { + this.customName = customNameIn; + } + + public int getInventoryStackLimit() + { + return 64; + } + + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; + } + + public void openInventory(EntityPlayer player) + { + } + + public void closeInventory(EntityPlayer player) + { + } + + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public void update() + { + if (this.worldObj != null && !this.worldObj.isRemote) + { + --this.transferCooldown; + + if (!this.isOnTransferCooldown()) + { + this.setTransferCooldown(0); + this.updateHopper(); + } + } + } + + public boolean updateHopper() + { + if (this.worldObj != null && !this.worldObj.isRemote) + { + if (!this.isOnTransferCooldown() && BlockHopper.isEnabled(this.getBlockMetadata())) + { + boolean flag = false; + + if (!this.isEmpty()) + { + flag = this.transferItemsOut(); + } + + if (!this.isFull()) + { + flag = captureDroppedItems(this) || flag; + } + + if (flag) + { + this.setTransferCooldown(8); + this.markDirty(); + return true; + } + } + + return false; + } + else + { + return false; + } + } + + private boolean isEmpty() + { + for (ItemStack itemstack : this.inventory) + { + if (itemstack != null) + { + return false; + } + } + + return true; + } + + private boolean isFull() + { + for (ItemStack itemstack : this.inventory) + { + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) + { + return false; + } + } + + return true; + } + + private boolean transferItemsOut() + { + IInventory iinventory = this.getInventoryForHopperTransfer(); + + if (iinventory == null) + { + return false; + } + else + { + EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()).getOpposite(); + + if (this.isInventoryFull(iinventory, enumfacing)) + { + return false; + } + else + { + for (int i = 0; i < this.getSizeInventory(); ++i) + { + if (this.getStackInSlot(i) != null) + { + ItemStack itemstack = this.getStackInSlot(i).copy(); + ItemStack itemstack1 = putStackInInventoryAllSlots(iinventory, this.decrStackSize(i, 1), enumfacing); + + if (itemstack1 == null || itemstack1.stackSize == 0) + { + iinventory.markDirty(); + return true; + } + + this.setInventorySlotContents(i, itemstack); + } + } + + return false; + } + } + } + + private boolean isInventoryFull(IInventory inventoryIn, EnumFacing side) + { + if (inventoryIn instanceof ISidedInventory) + { + ISidedInventory isidedinventory = (ISidedInventory)inventoryIn; + int[] aint = isidedinventory.getSlotsForFace(side); + + for (int k = 0; k < aint.length; ++k) + { + ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[k]); + + if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize()) + { + return false; + } + } + } + else + { + int i = inventoryIn.getSizeInventory(); + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = inventoryIn.getStackInSlot(j); + + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) + { + return false; + } + } + } + + return true; + } + + private static boolean isInventoryEmpty(IInventory inventoryIn, EnumFacing side) + { + if (inventoryIn instanceof ISidedInventory) + { + ISidedInventory isidedinventory = (ISidedInventory)inventoryIn; + int[] aint = isidedinventory.getSlotsForFace(side); + + for (int i = 0; i < aint.length; ++i) + { + if (isidedinventory.getStackInSlot(aint[i]) != null) + { + return false; + } + } + } + else + { + int j = inventoryIn.getSizeInventory(); + + for (int k = 0; k < j; ++k) + { + if (inventoryIn.getStackInSlot(k) != null) + { + return false; + } + } + } + + return true; + } + + public static boolean captureDroppedItems(IHopper p_145891_0_) + { + IInventory iinventory = getHopperInventory(p_145891_0_); + + if (iinventory != null) + { + EnumFacing enumfacing = EnumFacing.DOWN; + + if (isInventoryEmpty(iinventory, enumfacing)) + { + return false; + } + + if (iinventory instanceof ISidedInventory) + { + ISidedInventory isidedinventory = (ISidedInventory)iinventory; + int[] aint = isidedinventory.getSlotsForFace(enumfacing); + + for (int i = 0; i < aint.length; ++i) + { + if (pullItemFromSlot(p_145891_0_, iinventory, aint[i], enumfacing)) + { + return true; + } + } + } + else + { + int j = iinventory.getSizeInventory(); + + for (int k = 0; k < j; ++k) + { + if (pullItemFromSlot(p_145891_0_, iinventory, k, enumfacing)) + { + return true; + } + } + } + } + else + { + for (EntityItem entityitem : func_181556_a(p_145891_0_.getWorld(), p_145891_0_.getXPos(), p_145891_0_.getYPos() + 1.0D, p_145891_0_.getZPos())) + { + if (putDropInInventoryAllSlots(p_145891_0_, entityitem)) + { + return true; + } + } + } + + return false; + } + + private static boolean pullItemFromSlot(IHopper hopper, IInventory inventoryIn, int index, EnumFacing direction) + { + ItemStack itemstack = inventoryIn.getStackInSlot(index); + + if (itemstack != null && canExtractItemFromSlot(inventoryIn, itemstack, index, direction)) + { + ItemStack itemstack1 = itemstack.copy(); + ItemStack itemstack2 = putStackInInventoryAllSlots(hopper, inventoryIn.decrStackSize(index, 1), (EnumFacing)null); + + if (itemstack2 == null || itemstack2.stackSize == 0) + { + inventoryIn.markDirty(); + return true; + } + + inventoryIn.setInventorySlotContents(index, itemstack1); + } + + return false; + } + + public static boolean putDropInInventoryAllSlots(IInventory p_145898_0_, EntityItem itemIn) + { + boolean flag = false; + + if (itemIn == null) + { + return false; + } + else + { + ItemStack itemstack = itemIn.getEntityItem().copy(); + ItemStack itemstack1 = putStackInInventoryAllSlots(p_145898_0_, itemstack, (EnumFacing)null); + + if (itemstack1 != null && itemstack1.stackSize != 0) + { + itemIn.setEntityItemStack(itemstack1); + } + else + { + flag = true; + itemIn.setDead(); + } + + return flag; + } + } + + public static ItemStack putStackInInventoryAllSlots(IInventory inventoryIn, ItemStack stack, EnumFacing side) + { + if (inventoryIn instanceof ISidedInventory && side != null) + { + ISidedInventory isidedinventory = (ISidedInventory)inventoryIn; + int[] aint = isidedinventory.getSlotsForFace(side); + + for (int k = 0; k < aint.length && stack != null && stack.stackSize > 0; ++k) + { + stack = insertStack(inventoryIn, stack, aint[k], side); + } + } + else + { + int i = inventoryIn.getSizeInventory(); + + for (int j = 0; j < i && stack != null && stack.stackSize > 0; ++j) + { + stack = insertStack(inventoryIn, stack, j, side); + } + } + + if (stack != null && stack.stackSize == 0) + { + stack = null; + } + + return stack; + } + + private static boolean canInsertItemInSlot(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side) + { + return !inventoryIn.isItemValidForSlot(index, stack) ? false : !(inventoryIn instanceof ISidedInventory) || ((ISidedInventory)inventoryIn).canInsertItem(index, stack, side); + } + + private static boolean canExtractItemFromSlot(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side) + { + return !(inventoryIn instanceof ISidedInventory) || ((ISidedInventory)inventoryIn).canExtractItem(index, stack, side); + } + + private static ItemStack insertStack(IInventory inventoryIn, ItemStack stack, int index, EnumFacing side) + { + ItemStack itemstack = inventoryIn.getStackInSlot(index); + + if (canInsertItemInSlot(inventoryIn, stack, index, side)) + { + boolean flag = false; + + if (itemstack == null) + { + inventoryIn.setInventorySlotContents(index, stack); + stack = null; + flag = true; + } + else if (canCombine(itemstack, stack)) + { + int i = stack.getMaxStackSize() - itemstack.stackSize; + int j = Math.min(stack.stackSize, i); + stack.stackSize -= j; + itemstack.stackSize += j; + flag = j > 0; + } + + if (flag) + { + if (inventoryIn instanceof TileEntityHopper) + { + TileEntityHopper tileentityhopper = (TileEntityHopper)inventoryIn; + + if (tileentityhopper.mayTransfer()) + { + tileentityhopper.setTransferCooldown(8); + } + + inventoryIn.markDirty(); + } + + inventoryIn.markDirty(); + } + } + + return stack; + } + + private IInventory getInventoryForHopperTransfer() + { + EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()); + return getInventoryAtPosition(this.getWorld(), (double)(this.pos.getX() + enumfacing.getFrontOffsetX()), (double)(this.pos.getY() + enumfacing.getFrontOffsetY()), (double)(this.pos.getZ() + enumfacing.getFrontOffsetZ())); + } + + public static IInventory getHopperInventory(IHopper hopper) + { + return getInventoryAtPosition(hopper.getWorld(), hopper.getXPos(), hopper.getYPos() + 1.0D, hopper.getZPos()); + } + + public static List func_181556_a(World p_181556_0_, double p_181556_1_, double p_181556_3_, double p_181556_5_) + { + return p_181556_0_.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(p_181556_1_ - 0.5D, p_181556_3_ - 0.5D, p_181556_5_ - 0.5D, p_181556_1_ + 0.5D, p_181556_3_ + 0.5D, p_181556_5_ + 0.5D), EntitySelectors.selectAnything); + } + + public static IInventory getInventoryAtPosition(World worldIn, double x, double y, double z) + { + IInventory iinventory = null; + int i = MathHelper.floor_double(x); + int j = MathHelper.floor_double(y); + int k = MathHelper.floor_double(z); + BlockPos blockpos = new BlockPos(i, j, k); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block.hasTileEntity()) + { + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof IInventory) + { + iinventory = (IInventory)tileentity; + + if (iinventory instanceof TileEntityChest && block instanceof BlockChest) + { + iinventory = ((BlockChest)block).getLockableContainer(worldIn, blockpos); + } + } + } + + if (iinventory == null) + { + List list = worldIn.getEntitiesInAABBexcluding((Entity)null, new AxisAlignedBB(x - 0.5D, y - 0.5D, z - 0.5D, x + 0.5D, y + 0.5D, z + 0.5D), EntitySelectors.selectInventories); + + if (list.size() > 0) + { + iinventory = (IInventory)list.get(worldIn.rand.nextInt(list.size())); + } + } + + return iinventory; + } + + private static boolean canCombine(ItemStack stack1, ItemStack stack2) + { + return stack1.getItem() != stack2.getItem() ? false : (stack1.getMetadata() != stack2.getMetadata() ? false : (stack1.stackSize > stack1.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(stack1, stack2))); + } + + public double getXPos() + { + return (double)this.pos.getX() + 0.5D; + } + + public double getYPos() + { + return (double)this.pos.getY() + 0.5D; + } + + public double getZPos() + { + return (double)this.pos.getZ() + 0.5D; + } + + public void setTransferCooldown(int ticks) + { + this.transferCooldown = ticks; + } + + public boolean isOnTransferCooldown() + { + return this.transferCooldown > 0; + } + + public boolean mayTransfer() + { + return this.transferCooldown <= 1; + } + + public String getGuiID() + { + return "minecraft:hopper"; + } + + public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) + { + return new ContainerHopper(playerInventory, this, playerIn); + } + + public int getField(int id) + { + return 0; + } + + public void setField(int id, int value) + { + } + + public int getFieldCount() + { + return 0; + } + + public void clear() + { + for (int i = 0; i < this.inventory.length; ++i) + { + this.inventory[i] = null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityLockable.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityLockable.java new file mode 100644 index 0000000..7b93594 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityLockable.java @@ -0,0 +1,50 @@ +package net.minecraft.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.IInteractionObject; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.LockCode; + +public abstract class TileEntityLockable extends TileEntity implements IInteractionObject, ILockableContainer +{ + private LockCode code = LockCode.EMPTY_CODE; + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.code = LockCode.fromNBT(compound); + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + + if (this.code != null) + { + this.code.toNBT(compound); + } + } + + public boolean isLocked() + { + return this.code != null && !this.code.isEmpty(); + } + + public LockCode getLockCode() + { + return this.code; + } + + public void setLockCode(LockCode code) + { + this.code = code; + } + + public IChatComponent getDisplayName() + { + return (IChatComponent)(this.hasCustomName() ? new ChatComponentText(this.getName()) : new ChatComponentTranslation(this.getName(), new Object[0])); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java new file mode 100644 index 0000000..b88f467 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java @@ -0,0 +1,77 @@ +package net.minecraft.tileentity; + +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ITickable; +import net.minecraft.world.World; + +public class TileEntityMobSpawner extends TileEntity implements ITickable +{ + private final MobSpawnerBaseLogic spawnerLogic = new MobSpawnerBaseLogic() + { + public void func_98267_a(int id) + { + TileEntityMobSpawner.this.worldObj.addBlockEvent(TileEntityMobSpawner.this.pos, Blocks.mob_spawner, id, 0); + } + public World getSpawnerWorld() + { + return TileEntityMobSpawner.this.worldObj; + } + public BlockPos getSpawnerPosition() + { + return TileEntityMobSpawner.this.pos; + } + public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) + { + super.setRandomEntity(p_98277_1_); + + if (this.getSpawnerWorld() != null) + { + this.getSpawnerWorld().markBlockForUpdate(TileEntityMobSpawner.this.pos); + } + } + }; + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.spawnerLogic.readFromNBT(compound); + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + this.spawnerLogic.writeToNBT(compound); + } + + public void update() + { + this.spawnerLogic.updateSpawner(); + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("SpawnPotentials"); + return new S35PacketUpdateTileEntity(this.pos, 1, nbttagcompound); + } + + public boolean receiveClientEvent(int id, int type) + { + return this.spawnerLogic.setDelayToMin(id) ? true : super.receiveClientEvent(id, type); + } + + public boolean func_183000_F() + { + return true; + } + + public MobSpawnerBaseLogic getSpawnerBaseLogic() + { + return this.spawnerLogic; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityNote.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityNote.java new file mode 100644 index 0000000..29c6cae --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityNote.java @@ -0,0 +1,64 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class TileEntityNote extends TileEntity +{ + public byte note; + public boolean previousRedstoneState; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setByte("note", this.note); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.note = compound.getByte("note"); + this.note = (byte)MathHelper.clamp_int(this.note, 0, 24); + } + + public void changePitch() + { + this.note = (byte)((this.note + 1) % 25); + this.markDirty(); + } + + public void triggerNote(World worldIn, BlockPos p_175108_2_) + { + if (worldIn.getBlockState(p_175108_2_.up()).getBlock().getMaterial() == Material.air) + { + Material material = worldIn.getBlockState(p_175108_2_.down()).getBlock().getMaterial(); + int i = 0; + + if (material == Material.rock) + { + i = 1; + } + + if (material == Material.sand) + { + i = 2; + } + + if (material == Material.glass) + { + i = 3; + } + + if (material == Material.wood) + { + i = 4; + } + + worldIn.addBlockEvent(p_175108_2_, Blocks.noteblock, i, this.note); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityPiston.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityPiston.java new file mode 100644 index 0000000..75b07b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntityPiston.java @@ -0,0 +1,202 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; + +public class TileEntityPiston extends TileEntity implements ITickable +{ + private IBlockState pistonState; + private EnumFacing pistonFacing; + private boolean extending; + private boolean shouldHeadBeRendered; + private float progress; + private float lastProgress; + private List field_174933_k = Lists.newArrayList(); + + public TileEntityPiston() + { + } + + public TileEntityPiston(IBlockState pistonStateIn, EnumFacing pistonFacingIn, boolean extendingIn, boolean shouldHeadBeRenderedIn) + { + this.pistonState = pistonStateIn; + this.pistonFacing = pistonFacingIn; + this.extending = extendingIn; + this.shouldHeadBeRendered = shouldHeadBeRenderedIn; + } + + public IBlockState getPistonState() + { + return this.pistonState; + } + + public int getBlockMetadata() + { + return 0; + } + + public boolean isExtending() + { + return this.extending; + } + + public EnumFacing getFacing() + { + return this.pistonFacing; + } + + public boolean shouldPistonHeadBeRendered() + { + return this.shouldHeadBeRendered; + } + + public float getProgress(float ticks) + { + if (ticks > 1.0F) + { + ticks = 1.0F; + } + + return this.lastProgress + (this.progress - this.lastProgress) * ticks; + } + + public float getOffsetX(float ticks) + { + return this.extending ? (this.getProgress(ticks) - 1.0F) * (float)this.pistonFacing.getFrontOffsetX() : (1.0F - this.getProgress(ticks)) * (float)this.pistonFacing.getFrontOffsetX(); + } + + public float getOffsetY(float ticks) + { + return this.extending ? (this.getProgress(ticks) - 1.0F) * (float)this.pistonFacing.getFrontOffsetY() : (1.0F - this.getProgress(ticks)) * (float)this.pistonFacing.getFrontOffsetY(); + } + + public float getOffsetZ(float ticks) + { + return this.extending ? (this.getProgress(ticks) - 1.0F) * (float)this.pistonFacing.getFrontOffsetZ() : (1.0F - this.getProgress(ticks)) * (float)this.pistonFacing.getFrontOffsetZ(); + } + + private void launchWithSlimeBlock(float p_145863_1_, float p_145863_2_) + { + if (this.extending) + { + p_145863_1_ = 1.0F - p_145863_1_; + } + else + { + --p_145863_1_; + } + + AxisAlignedBB axisalignedbb = Blocks.piston_extension.getBoundingBox(this.worldObj, this.pos, this.pistonState, p_145863_1_, this.pistonFacing); + + if (axisalignedbb != null) + { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb); + + if (!list.isEmpty()) + { + this.field_174933_k.addAll(list); + + for (Entity entity : this.field_174933_k) + { + if (this.pistonState.getBlock() == Blocks.slime_block && this.extending) + { + switch (this.pistonFacing.getAxis()) + { + case X: + entity.motionX = (double)this.pistonFacing.getFrontOffsetX(); + break; + + case Y: + entity.motionY = (double)this.pistonFacing.getFrontOffsetY(); + break; + + case Z: + entity.motionZ = (double)this.pistonFacing.getFrontOffsetZ(); + } + } + else + { + entity.moveEntity((double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetX()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetY()), (double)(p_145863_2_ * (float)this.pistonFacing.getFrontOffsetZ())); + } + } + + this.field_174933_k.clear(); + } + } + } + + public void clearPistonTileEntity() + { + if (this.lastProgress < 1.0F && this.worldObj != null) + { + this.lastProgress = this.progress = 1.0F; + this.worldObj.removeTileEntity(this.pos); + this.invalidate(); + + if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) + { + this.worldObj.setBlockState(this.pos, this.pistonState, 3); + this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); + } + } + } + + public void update() + { + this.lastProgress = this.progress; + + if (this.lastProgress >= 1.0F) + { + this.launchWithSlimeBlock(1.0F, 0.25F); + this.worldObj.removeTileEntity(this.pos); + this.invalidate(); + + if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) + { + this.worldObj.setBlockState(this.pos, this.pistonState, 3); + this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); + } + } + else + { + this.progress += 0.5F; + + if (this.progress >= 1.0F) + { + this.progress = 1.0F; + } + + if (this.extending) + { + this.launchWithSlimeBlock(this.progress, this.progress - this.lastProgress + 0.0625F); + } + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.pistonState = Block.getBlockById(compound.getInteger("blockId")).getStateFromMeta(compound.getInteger("blockData")); + this.pistonFacing = EnumFacing.getFront(compound.getInteger("facing")); + this.lastProgress = this.progress = compound.getFloat("progress"); + this.extending = compound.getBoolean("extending"); + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setInteger("blockId", Block.getIdFromBlock(this.pistonState.getBlock())); + compound.setInteger("blockData", this.pistonState.getBlock().getMetaFromState(this.pistonState)); + compound.setInteger("facing", this.pistonFacing.getIndex()); + compound.setFloat("progress", this.lastProgress); + compound.setBoolean("extending", this.extending); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntitySign.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntitySign.java new file mode 100644 index 0000000..265e6ab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntitySign.java @@ -0,0 +1,219 @@ +package net.minecraft.tileentity; + +import com.google.gson.JsonParseException; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentProcessor; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class TileEntitySign extends TileEntity +{ + public final IChatComponent[] signText = new IChatComponent[] {new ChatComponentText(""), new ChatComponentText(""), new ChatComponentText(""), new ChatComponentText("")}; + public int lineBeingEdited = -1; + private boolean isEditable = true; + private EntityPlayer player; + private final CommandResultStats stats = new CommandResultStats(); + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + + for (int i = 0; i < 4; ++i) + { + String s = IChatComponent.Serializer.componentToJson(this.signText[i]); + compound.setString("Text" + (i + 1), s); + } + + this.stats.writeStatsToNBT(compound); + } + + public void readFromNBT(NBTTagCompound compound) + { + this.isEditable = false; + super.readFromNBT(compound); + ICommandSender icommandsender = new ICommandSender() + { + public String getName() + { + return "Sign"; + } + public IChatComponent getDisplayName() + { + return new ChatComponentText(this.getName()); + } + public void addChatMessage(IChatComponent component) + { + } + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return true; + } + public BlockPos getPosition() + { + return TileEntitySign.this.pos; + } + public Vec3 getPositionVector() + { + return new Vec3((double)TileEntitySign.this.pos.getX() + 0.5D, (double)TileEntitySign.this.pos.getY() + 0.5D, (double)TileEntitySign.this.pos.getZ() + 0.5D); + } + public World getEntityWorld() + { + return TileEntitySign.this.worldObj; + } + public Entity getCommandSenderEntity() + { + return null; + } + public boolean sendCommandFeedback() + { + return false; + } + public void setCommandStat(CommandResultStats.Type type, int amount) + { + } + }; + + for (int i = 0; i < 4; ++i) + { + String s = compound.getString("Text" + (i + 1)); + + try + { + IChatComponent ichatcomponent = IChatComponent.Serializer.jsonToComponent(s); + + try + { + this.signText[i] = ChatComponentProcessor.processComponent(icommandsender, ichatcomponent, (Entity)null); + } + catch (CommandException var7) + { + this.signText[i] = ichatcomponent; + } + } + catch (JsonParseException var8) + { + this.signText[i] = new ChatComponentText(s); + } + } + + this.stats.readStatsFromNBT(compound); + } + + public Packet getDescriptionPacket() + { + IChatComponent[] aichatcomponent = new IChatComponent[4]; + System.arraycopy(this.signText, 0, aichatcomponent, 0, 4); + return new S33PacketUpdateSign(this.worldObj, this.pos, aichatcomponent); + } + + public boolean func_183000_F() + { + return true; + } + + public boolean getIsEditable() + { + return this.isEditable; + } + + public void setEditable(boolean isEditableIn) + { + this.isEditable = isEditableIn; + + if (!isEditableIn) + { + this.player = null; + } + } + + public void setPlayer(EntityPlayer playerIn) + { + this.player = playerIn; + } + + public EntityPlayer getPlayer() + { + return this.player; + } + + public boolean executeCommand(final EntityPlayer playerIn) + { + ICommandSender icommandsender = new ICommandSender() + { + public String getName() + { + return playerIn.getName(); + } + public IChatComponent getDisplayName() + { + return playerIn.getDisplayName(); + } + public void addChatMessage(IChatComponent component) + { + } + public boolean canCommandSenderUseCommand(int permLevel, String commandName) + { + return permLevel <= 2; + } + public BlockPos getPosition() + { + return TileEntitySign.this.pos; + } + public Vec3 getPositionVector() + { + return new Vec3((double)TileEntitySign.this.pos.getX() + 0.5D, (double)TileEntitySign.this.pos.getY() + 0.5D, (double)TileEntitySign.this.pos.getZ() + 0.5D); + } + public World getEntityWorld() + { + return playerIn.getEntityWorld(); + } + public Entity getCommandSenderEntity() + { + return playerIn; + } + public boolean sendCommandFeedback() + { + return false; + } + public void setCommandStat(CommandResultStats.Type type, int amount) + { + TileEntitySign.this.stats.setCommandStatScore(this, type, amount); + } + }; + + for (int i = 0; i < this.signText.length; ++i) + { + ChatStyle chatstyle = this.signText[i] == null ? null : this.signText[i].getChatStyle(); + + if (chatstyle != null && chatstyle.getChatClickEvent() != null) + { + ClickEvent clickevent = chatstyle.getChatClickEvent(); + + if (clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) + { + MinecraftServer.getServer().getCommandManager().executeCommand(icommandsender, clickevent.getValue()); + } + } + } + + return true; + } + + public CommandResultStats getStats() + { + return this.stats; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntitySkull.java b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntitySkull.java new file mode 100644 index 0000000..8b82164 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/tileentity/TileEntitySkull.java @@ -0,0 +1,143 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Iterables; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import java.util.UUID; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.StringUtils; + +public class TileEntitySkull extends TileEntity +{ + private int skullType; + private int skullRotation; + private GameProfile playerProfile = null; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setByte("SkullType", (byte)(this.skullType & 255)); + compound.setByte("Rot", (byte)(this.skullRotation & 255)); + + if (this.playerProfile != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTUtil.writeGameProfile(nbttagcompound, this.playerProfile); + compound.setTag("Owner", nbttagcompound); + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.skullType = compound.getByte("SkullType"); + this.skullRotation = compound.getByte("Rot"); + + if (this.skullType == 3) + { + if (compound.hasKey("Owner", 10)) + { + this.playerProfile = NBTUtil.readGameProfileFromNBT(compound.getCompoundTag("Owner")); + } + else if (compound.hasKey("ExtraType", 8)) + { + String s = compound.getString("ExtraType"); + + if (!StringUtils.isNullOrEmpty(s)) + { + this.playerProfile = new GameProfile((UUID)null, s); + this.updatePlayerProfile(); + } + } + } + } + + public GameProfile getPlayerProfile() + { + return this.playerProfile; + } + + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.pos, 4, nbttagcompound); + } + + public void setType(int type) + { + this.skullType = type; + this.playerProfile = null; + } + + public void setPlayerProfile(GameProfile playerProfile) + { + this.skullType = 3; + this.playerProfile = playerProfile; + this.updatePlayerProfile(); + } + + private void updatePlayerProfile() + { + this.playerProfile = updateGameprofile(this.playerProfile); + this.markDirty(); + } + + public static GameProfile updateGameprofile(GameProfile input) + { + if (input != null && !StringUtils.isNullOrEmpty(input.getName())) + { + if (input.isComplete() && input.getProperties().containsKey("textures")) + { + return input; + } + else if (MinecraftServer.getServer() == null) + { + return input; + } + else + { + GameProfile gameprofile = MinecraftServer.getServer().getPlayerProfileCache().getGameProfileForUsername(input.getName()); + + if (gameprofile == null) + { + return input; + } + else + { + Property property = (Property)Iterables.getFirst(gameprofile.getProperties().get("textures"), null); + + if (property == null) + { + gameprofile = MinecraftServer.getServer().getMinecraftSessionService().fillProfileProperties(gameprofile, true); + } + + return gameprofile; + } + } + } + else + { + return input; + } + } + + public int getSkullType() + { + return this.skullType; + } + + public int getSkullRotation() + { + return this.skullRotation; + } + + public void setSkullRotation(int rotation) + { + this.skullRotation = rotation; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/AxisAlignedBB.java b/Client-1.8.9/src/main/java/net/minecraft/util/AxisAlignedBB.java new file mode 100644 index 0000000..31d14e4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/AxisAlignedBB.java @@ -0,0 +1,363 @@ +package net.minecraft.util; + +public class AxisAlignedBB +{ + public final double minX; + public final double minY; + public final double minZ; + public final double maxX; + public final double maxY; + public final double maxZ; + + public AxisAlignedBB(double x1, double y1, double z1, double x2, double y2, double z2) + { + this.minX = Math.min(x1, x2); + this.minY = Math.min(y1, y2); + this.minZ = Math.min(z1, z2); + this.maxX = Math.max(x1, x2); + this.maxY = Math.max(y1, y2); + this.maxZ = Math.max(z1, z2); + } + + public AxisAlignedBB(BlockPos pos1, BlockPos pos2) + { + this.minX = (double)pos1.getX(); + this.minY = (double)pos1.getY(); + this.minZ = (double)pos1.getZ(); + this.maxX = (double)pos2.getX(); + this.maxY = (double)pos2.getY(); + this.maxZ = (double)pos2.getZ(); + } + + public AxisAlignedBB addCoord(double x, double y, double z) + { + double d0 = this.minX; + double d1 = this.minY; + double d2 = this.minZ; + double d3 = this.maxX; + double d4 = this.maxY; + double d5 = this.maxZ; + + if (x < 0.0D) + { + d0 += x; + } + else if (x > 0.0D) + { + d3 += x; + } + + if (y < 0.0D) + { + d1 += y; + } + else if (y > 0.0D) + { + d4 += y; + } + + if (z < 0.0D) + { + d2 += z; + } + else if (z > 0.0D) + { + d5 += z; + } + + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + public AxisAlignedBB expand(double x, double y, double z) + { + double d0 = this.minX - x; + double d1 = this.minY - y; + double d2 = this.minZ - z; + double d3 = this.maxX + x; + double d4 = this.maxY + y; + double d5 = this.maxZ + z; + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + public AxisAlignedBB union(AxisAlignedBB other) + { + double d0 = Math.min(this.minX, other.minX); + double d1 = Math.min(this.minY, other.minY); + double d2 = Math.min(this.minZ, other.minZ); + double d3 = Math.max(this.maxX, other.maxX); + double d4 = Math.max(this.maxY, other.maxY); + double d5 = Math.max(this.maxZ, other.maxZ); + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + public static AxisAlignedBB fromBounds(double x1, double y1, double z1, double x2, double y2, double z2) + { + double d0 = Math.min(x1, x2); + double d1 = Math.min(y1, y2); + double d2 = Math.min(z1, z2); + double d3 = Math.max(x1, x2); + double d4 = Math.max(y1, y2); + double d5 = Math.max(z1, z2); + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + public AxisAlignedBB offset(double x, double y, double z) + { + return new AxisAlignedBB(this.minX + x, this.minY + y, this.minZ + z, this.maxX + x, this.maxY + y, this.maxZ + z); + } + + public double calculateXOffset(AxisAlignedBB other, double offsetX) + { + if (other.maxY > this.minY && other.minY < this.maxY && other.maxZ > this.minZ && other.minZ < this.maxZ) + { + if (offsetX > 0.0D && other.maxX <= this.minX) + { + double d1 = this.minX - other.maxX; + + if (d1 < offsetX) + { + offsetX = d1; + } + } + else if (offsetX < 0.0D && other.minX >= this.maxX) + { + double d0 = this.maxX - other.minX; + + if (d0 > offsetX) + { + offsetX = d0; + } + } + + return offsetX; + } + else + { + return offsetX; + } + } + + public double calculateYOffset(AxisAlignedBB other, double offsetY) + { + if (other.maxX > this.minX && other.minX < this.maxX && other.maxZ > this.minZ && other.minZ < this.maxZ) + { + if (offsetY > 0.0D && other.maxY <= this.minY) + { + double d1 = this.minY - other.maxY; + + if (d1 < offsetY) + { + offsetY = d1; + } + } + else if (offsetY < 0.0D && other.minY >= this.maxY) + { + double d0 = this.maxY - other.minY; + + if (d0 > offsetY) + { + offsetY = d0; + } + } + + return offsetY; + } + else + { + return offsetY; + } + } + + public double calculateZOffset(AxisAlignedBB other, double offsetZ) + { + if (other.maxX > this.minX && other.minX < this.maxX && other.maxY > this.minY && other.minY < this.maxY) + { + if (offsetZ > 0.0D && other.maxZ <= this.minZ) + { + double d1 = this.minZ - other.maxZ; + + if (d1 < offsetZ) + { + offsetZ = d1; + } + } + else if (offsetZ < 0.0D && other.minZ >= this.maxZ) + { + double d0 = this.maxZ - other.minZ; + + if (d0 > offsetZ) + { + offsetZ = d0; + } + } + + return offsetZ; + } + else + { + return offsetZ; + } + } + + public boolean intersectsWith(AxisAlignedBB other) + { + return other.maxX > this.minX && other.minX < this.maxX ? (other.maxY > this.minY && other.minY < this.maxY ? other.maxZ > this.minZ && other.minZ < this.maxZ : false) : false; + } + + public boolean isVecInside(Vec3 vec) + { + return vec.xCoord > this.minX && vec.xCoord < this.maxX ? (vec.yCoord > this.minY && vec.yCoord < this.maxY ? vec.zCoord > this.minZ && vec.zCoord < this.maxZ : false) : false; + } + + public double getAverageEdgeLength() + { + double d0 = this.maxX - this.minX; + double d1 = this.maxY - this.minY; + double d2 = this.maxZ - this.minZ; + return (d0 + d1 + d2) / 3.0D; + } + + public AxisAlignedBB contract(double x, double y, double z) + { + double d0 = this.minX + x; + double d1 = this.minY + y; + double d2 = this.minZ + z; + double d3 = this.maxX - x; + double d4 = this.maxY - y; + double d5 = this.maxZ - z; + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + + public MovingObjectPosition calculateIntercept(Vec3 vecA, Vec3 vecB) + { + Vec3 vec3 = vecA.getIntermediateWithXValue(vecB, this.minX); + Vec3 vec31 = vecA.getIntermediateWithXValue(vecB, this.maxX); + Vec3 vec32 = vecA.getIntermediateWithYValue(vecB, this.minY); + Vec3 vec33 = vecA.getIntermediateWithYValue(vecB, this.maxY); + Vec3 vec34 = vecA.getIntermediateWithZValue(vecB, this.minZ); + Vec3 vec35 = vecA.getIntermediateWithZValue(vecB, this.maxZ); + + if (!this.isVecInYZ(vec3)) + { + vec3 = null; + } + + if (!this.isVecInYZ(vec31)) + { + vec31 = null; + } + + if (!this.isVecInXZ(vec32)) + { + vec32 = null; + } + + if (!this.isVecInXZ(vec33)) + { + vec33 = null; + } + + if (!this.isVecInXY(vec34)) + { + vec34 = null; + } + + if (!this.isVecInXY(vec35)) + { + vec35 = null; + } + + Vec3 vec36 = null; + + if (vec3 != null) + { + vec36 = vec3; + } + + if (vec31 != null && (vec36 == null || vecA.squareDistanceTo(vec31) < vecA.squareDistanceTo(vec36))) + { + vec36 = vec31; + } + + if (vec32 != null && (vec36 == null || vecA.squareDistanceTo(vec32) < vecA.squareDistanceTo(vec36))) + { + vec36 = vec32; + } + + if (vec33 != null && (vec36 == null || vecA.squareDistanceTo(vec33) < vecA.squareDistanceTo(vec36))) + { + vec36 = vec33; + } + + if (vec34 != null && (vec36 == null || vecA.squareDistanceTo(vec34) < vecA.squareDistanceTo(vec36))) + { + vec36 = vec34; + } + + if (vec35 != null && (vec36 == null || vecA.squareDistanceTo(vec35) < vecA.squareDistanceTo(vec36))) + { + vec36 = vec35; + } + + if (vec36 == null) + { + return null; + } + else + { + EnumFacing enumfacing = null; + + if (vec36 == vec3) + { + enumfacing = EnumFacing.WEST; + } + else if (vec36 == vec31) + { + enumfacing = EnumFacing.EAST; + } + else if (vec36 == vec32) + { + enumfacing = EnumFacing.DOWN; + } + else if (vec36 == vec33) + { + enumfacing = EnumFacing.UP; + } + else if (vec36 == vec34) + { + enumfacing = EnumFacing.NORTH; + } + else + { + enumfacing = EnumFacing.SOUTH; + } + + return new MovingObjectPosition(vec36, enumfacing); + } + } + + private boolean isVecInYZ(Vec3 vec) + { + return vec == null ? false : vec.yCoord >= this.minY && vec.yCoord <= this.maxY && vec.zCoord >= this.minZ && vec.zCoord <= this.maxZ; + } + + private boolean isVecInXZ(Vec3 vec) + { + return vec == null ? false : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.zCoord >= this.minZ && vec.zCoord <= this.maxZ; + } + + private boolean isVecInXY(Vec3 vec) + { + return vec == null ? false : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.yCoord >= this.minY && vec.yCoord <= this.maxY; + } + + public String toString() + { + return "box[" + this.minX + ", " + this.minY + ", " + this.minZ + " -> " + this.maxX + ", " + this.maxY + ", " + this.maxZ + "]"; + } + + public boolean hasNaN() + { + return Double.isNaN(this.minX) || Double.isNaN(this.minY) || Double.isNaN(this.minZ) || Double.isNaN(this.maxX) || Double.isNaN(this.maxY) || Double.isNaN(this.maxZ); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/BlockPos.java b/Client-1.8.9/src/main/java/net/minecraft/util/BlockPos.java new file mode 100644 index 0000000..497eb00 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/BlockPos.java @@ -0,0 +1,302 @@ +package net.minecraft.util; + +import com.google.common.collect.AbstractIterator; +import java.util.Iterator; +import net.minecraft.entity.Entity; + +public class BlockPos extends Vec3i +{ + public static final BlockPos ORIGIN = new BlockPos(0, 0, 0); + private static final int NUM_X_BITS = 1 + MathHelper.calculateLogBaseTwo(MathHelper.roundUpToPowerOfTwo(30000000)); + private static final int NUM_Z_BITS = NUM_X_BITS; + private static final int NUM_Y_BITS = 64 - NUM_X_BITS - NUM_Z_BITS; + private static final int Y_SHIFT = 0 + NUM_Z_BITS; + private static final int X_SHIFT = Y_SHIFT + NUM_Y_BITS; + private static final long X_MASK = (1L << NUM_X_BITS) - 1L; + private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L; + private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L; + + public BlockPos(int x, int y, int z) + { + super(x, y, z); + } + + public BlockPos(double x, double y, double z) + { + super(x, y, z); + } + + public BlockPos(Entity source) + { + this(source.posX, source.posY, source.posZ); + } + + public BlockPos(Vec3 source) + { + this(source.xCoord, source.yCoord, source.zCoord); + } + + public BlockPos(Vec3i source) + { + this(source.getX(), source.getY(), source.getZ()); + } + + public BlockPos add(double x, double y, double z) + { + return x == 0.0D && y == 0.0D && z == 0.0D ? this : new BlockPos((double)this.getX() + x, (double)this.getY() + y, (double)this.getZ() + z); + } + + public BlockPos add(int x, int y, int z) + { + return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getX() + x, this.getY() + y, this.getZ() + z); + } + + public BlockPos add(Vec3i vec) + { + return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this : new BlockPos(this.getX() + vec.getX(), this.getY() + vec.getY(), this.getZ() + vec.getZ()); + } + + public BlockPos subtract(Vec3i vec) + { + return vec.getX() == 0 && vec.getY() == 0 && vec.getZ() == 0 ? this : new BlockPos(this.getX() - vec.getX(), this.getY() - vec.getY(), this.getZ() - vec.getZ()); + } + + public BlockPos up() + { + return this.up(1); + } + + public BlockPos up(int n) + { + return this.offset(EnumFacing.UP, n); + } + + public BlockPos down() + { + return this.down(1); + } + + public BlockPos down(int n) + { + return this.offset(EnumFacing.DOWN, n); + } + + public BlockPos north() + { + return this.north(1); + } + + public BlockPos north(int n) + { + return this.offset(EnumFacing.NORTH, n); + } + + public BlockPos south() + { + return this.south(1); + } + + public BlockPos south(int n) + { + return this.offset(EnumFacing.SOUTH, n); + } + + public BlockPos west() + { + return this.west(1); + } + + public BlockPos west(int n) + { + return this.offset(EnumFacing.WEST, n); + } + + public BlockPos east() + { + return this.east(1); + } + + public BlockPos east(int n) + { + return this.offset(EnumFacing.EAST, n); + } + + public BlockPos offset(EnumFacing facing) + { + return this.offset(facing, 1); + } + + public BlockPos offset(EnumFacing facing, int n) + { + return n == 0 ? this : new BlockPos(this.getX() + facing.getFrontOffsetX() * n, this.getY() + facing.getFrontOffsetY() * n, this.getZ() + facing.getFrontOffsetZ() * n); + } + + public BlockPos crossProduct(Vec3i vec) + { + return new BlockPos(this.getY() * vec.getZ() - this.getZ() * vec.getY(), this.getZ() * vec.getX() - this.getX() * vec.getZ(), this.getX() * vec.getY() - this.getY() * vec.getX()); + } + + public long toLong() + { + return ((long)this.getX() & X_MASK) << X_SHIFT | ((long)this.getY() & Y_MASK) << Y_SHIFT | ((long)this.getZ() & Z_MASK) << 0; + } + + public static BlockPos fromLong(long serialized) + { + int i = (int)(serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS); + int j = (int)(serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS); + int k = (int)(serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS); + return new BlockPos(i, j, k); + } + + public static Iterable getAllInBox(BlockPos from, BlockPos to) + { + final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ())); + final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ())); + return new Iterable() + { + public Iterator iterator() + { + return new AbstractIterator() + { + private BlockPos lastReturned = null; + protected BlockPos computeNext() + { + if (this.lastReturned == null) + { + this.lastReturned = blockpos; + return this.lastReturned; + } + else if (this.lastReturned.equals(blockpos1)) + { + return (BlockPos)this.endOfData(); + } + else + { + int i = this.lastReturned.getX(); + int j = this.lastReturned.getY(); + int k = this.lastReturned.getZ(); + + if (i < blockpos1.getX()) + { + ++i; + } + else if (j < blockpos1.getY()) + { + i = blockpos.getX(); + ++j; + } + else if (k < blockpos1.getZ()) + { + i = blockpos.getX(); + j = blockpos.getY(); + ++k; + } + + this.lastReturned = new BlockPos(i, j, k); + return this.lastReturned; + } + } + }; + } + }; + } + + public static Iterable getAllInBoxMutable(BlockPos from, BlockPos to) + { + final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ())); + final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ())); + return new Iterable() + { + public Iterator iterator() + { + return new AbstractIterator() + { + private BlockPos.MutableBlockPos theBlockPos = null; + protected BlockPos.MutableBlockPos computeNext() + { + if (this.theBlockPos == null) + { + this.theBlockPos = new BlockPos.MutableBlockPos(blockpos.getX(), blockpos.getY(), blockpos.getZ()); + return this.theBlockPos; + } + else if (this.theBlockPos.equals(blockpos1)) + { + return (BlockPos.MutableBlockPos)this.endOfData(); + } + else + { + int i = this.theBlockPos.getX(); + int j = this.theBlockPos.getY(); + int k = this.theBlockPos.getZ(); + + if (i < blockpos1.getX()) + { + ++i; + } + else if (j < blockpos1.getY()) + { + i = blockpos.getX(); + ++j; + } + else if (k < blockpos1.getZ()) + { + i = blockpos.getX(); + j = blockpos.getY(); + ++k; + } + + this.theBlockPos.x = i; + this.theBlockPos.y = j; + this.theBlockPos.z = k; + return this.theBlockPos; + } + } + }; + } + }; + } + + public static final class MutableBlockPos extends BlockPos + { + private int x; + private int y; + private int z; + + public MutableBlockPos() + { + this(0, 0, 0); + } + + public MutableBlockPos(int x_, int y_, int z_) + { + super(0, 0, 0); + this.x = x_; + this.y = y_; + this.z = z_; + } + + public int getX() + { + return this.x; + } + + public int getY() + { + return this.y; + } + + public int getZ() + { + return this.z; + } + + public BlockPos.MutableBlockPos set(int xIn, int yIn, int zIn) + { + this.x = xIn; + this.y = yIn; + this.z = zIn; + return this; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Cartesian.java b/Client-1.8.9/src/main/java/net/minecraft/util/Cartesian.java new file mode 100644 index 0000000..54955f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Cartesian.java @@ -0,0 +1,174 @@ +package net.minecraft.util; + +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.UnmodifiableIterator; +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; + +public class Cartesian +{ + public static Iterable cartesianProduct(Class clazz, Iterable > sets) + { + return new Cartesian.Product(clazz, (Iterable[])toArray(Iterable.class, sets)); + } + + public static Iterable> cartesianProduct(Iterable > sets) + { + return arraysAsLists(cartesianProduct(Object.class, sets)); + } + + private static Iterable> arraysAsLists(Iterable arrays) + { + return Iterables.transform(arrays, new Cartesian.GetList()); + } + + private static T[] toArray(Class clazz, Iterable it) + { + List list = Lists.newArrayList(); + + for (T t : it) + { + list.add(t); + } + + return (T[])((Object[])list.toArray(createArray(clazz, list.size()))); + } + + private static T[] createArray(Class p_179319_0_, int p_179319_1_) + { + return (T[])((Object[])((Object[])Array.newInstance(p_179319_0_, p_179319_1_))); + } + + static class GetList implements Function> + { + private GetList() + { + } + + public List apply(Object[] p_apply_1_) + { + return Arrays.asList((T[])p_apply_1_); + } + } + + static class Product implements Iterable + { + private final Class clazz; + private final Iterable [] iterables; + + private Product(Class clazz, Iterable [] iterables) + { + this.clazz = clazz; + this.iterables = iterables; + } + + public Iterator iterator() + { + return (Iterator)(this.iterables.length <= 0 ? Collections.singletonList(Cartesian.createArray(this.clazz, 0)).iterator() : new Cartesian.Product.ProductIterator(this.clazz, this.iterables)); + } + + static class ProductIterator extends UnmodifiableIterator + { + private int index; + private final Iterable [] iterables; + private final Iterator [] iterators; + private final T[] results; + + private ProductIterator(Class clazz, Iterable [] iterables) + { + this.index = -2; + this.iterables = iterables; + this.iterators = (Iterator[])Cartesian.createArray(Iterator.class, this.iterables.length); + + for (int i = 0; i < this.iterables.length; ++i) + { + this.iterators[i] = iterables[i].iterator(); + } + + this.results = Cartesian.createArray(clazz, this.iterators.length); + } + + private void endOfData() + { + this.index = -1; + Arrays.fill(this.iterators, (Object)null); + Arrays.fill(this.results, (Object)null); + } + + public boolean hasNext() + { + if (this.index == -2) + { + this.index = 0; + + for (Iterator iterator1 : this.iterators) + { + if (!iterator1.hasNext()) + { + this.endOfData(); + break; + } + } + + return true; + } + else + { + if (this.index >= this.iterators.length) + { + for (this.index = this.iterators.length - 1; this.index >= 0; --this.index) + { + Iterator iterator = this.iterators[this.index]; + + if (iterator.hasNext()) + { + break; + } + + if (this.index == 0) + { + this.endOfData(); + break; + } + + iterator = this.iterables[this.index].iterator(); + this.iterators[this.index] = iterator; + + if (!iterator.hasNext()) + { + this.endOfData(); + break; + } + } + } + + return this.index >= 0; + } + } + + public T[] next() + { + if (!this.hasNext()) + { + throw new NoSuchElementException(); + } + else + { + while (this.index < this.iterators.length) + { + this.results[this.index] = this.iterators[this.index].next(); + ++this.index; + } + + return (T[])((Object[])this.results.clone()); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatAllowedCharacters.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatAllowedCharacters.java new file mode 100644 index 0000000..35ab764 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatAllowedCharacters.java @@ -0,0 +1,26 @@ +package net.minecraft.util; + +public class ChatAllowedCharacters +{ + public static final char[] allowedCharactersArray = new char[] {'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'}; + + public static boolean isAllowedCharacter(char character) + { + return character != 167 && character >= 32 && character != 127; + } + + public static String filterAllowedCharacters(String input) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (char c0 : input.toCharArray()) + { + if (isAllowedCharacter(c0)) + { + stringbuilder.append(c0); + } + } + + return stringbuilder.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentProcessor.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentProcessor.java new file mode 100644 index 0000000..808a33f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentProcessor.java @@ -0,0 +1,86 @@ +package net.minecraft.util; + +import java.util.List; +import net.minecraft.command.CommandException; +import net.minecraft.command.EntityNotFoundException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerSelector; +import net.minecraft.entity.Entity; + +public class ChatComponentProcessor +{ + public static IChatComponent processComponent(ICommandSender commandSender, IChatComponent component, Entity entityIn) throws CommandException + { + IChatComponent ichatcomponent = null; + + if (component instanceof ChatComponentScore) + { + ChatComponentScore chatcomponentscore = (ChatComponentScore)component; + String s = chatcomponentscore.getName(); + + if (PlayerSelector.hasArguments(s)) + { + List list = PlayerSelector.matchEntities(commandSender, s, Entity.class); + + if (list.size() != 1) + { + throw new EntityNotFoundException(); + } + + s = ((Entity)list.get(0)).getName(); + } + + ichatcomponent = entityIn != null && s.equals("*") ? new ChatComponentScore(entityIn.getName(), chatcomponentscore.getObjective()) : new ChatComponentScore(s, chatcomponentscore.getObjective()); + ((ChatComponentScore)ichatcomponent).setValue(chatcomponentscore.getUnformattedTextForChat()); + } + else if (component instanceof ChatComponentSelector) + { + String s1 = ((ChatComponentSelector)component).getSelector(); + ichatcomponent = PlayerSelector.matchEntitiesToChatComponent(commandSender, s1); + + if (ichatcomponent == null) + { + ichatcomponent = new ChatComponentText(""); + } + } + else if (component instanceof ChatComponentText) + { + ichatcomponent = new ChatComponentText(((ChatComponentText)component).getChatComponentText_TextValue()); + } + else + { + if (!(component instanceof ChatComponentTranslation)) + { + return component; + } + + Object[] aobject = ((ChatComponentTranslation)component).getFormatArgs(); + + for (int i = 0; i < aobject.length; ++i) + { + Object object = aobject[i]; + + if (object instanceof IChatComponent) + { + aobject[i] = processComponent(commandSender, (IChatComponent)object, entityIn); + } + } + + ichatcomponent = new ChatComponentTranslation(((ChatComponentTranslation)component).getKey(), aobject); + } + + ChatStyle chatstyle = component.getChatStyle(); + + if (chatstyle != null) + { + ichatcomponent.setChatStyle(chatstyle.createShallowCopy()); + } + + for (IChatComponent ichatcomponent1 : component.getSiblings()) + { + ichatcomponent.appendSibling(processComponent(commandSender, ichatcomponent1, entityIn)); + } + + return ichatcomponent; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentScore.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentScore.java new file mode 100644 index 0000000..82bda97 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentScore.java @@ -0,0 +1,93 @@ +package net.minecraft.util; + +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; + +public class ChatComponentScore extends ChatComponentStyle +{ + private final String name; + private final String objective; + private String value = ""; + + public ChatComponentScore(String nameIn, String objectiveIn) + { + this.name = nameIn; + this.objective = objectiveIn; + } + + public String getName() + { + return this.name; + } + + public String getObjective() + { + return this.objective; + } + + public void setValue(String valueIn) + { + this.value = valueIn; + } + + public String getUnformattedTextForChat() + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (minecraftserver != null && minecraftserver.isAnvilFileSet() && StringUtils.isNullOrEmpty(this.value)) + { + Scoreboard scoreboard = minecraftserver.worldServerForDimension(0).getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(this.objective); + + if (scoreboard.entityHasObjective(this.name, scoreobjective)) + { + Score score = scoreboard.getValueFromObjective(this.name, scoreobjective); + this.setValue(String.format("%d", new Object[] {Integer.valueOf(score.getScorePoints())})); + } + else + { + this.value = ""; + } + } + + return this.value; + } + + public ChatComponentScore createCopy() + { + ChatComponentScore chatcomponentscore = new ChatComponentScore(this.name, this.objective); + chatcomponentscore.setValue(this.value); + chatcomponentscore.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) + { + chatcomponentscore.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponentscore; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentScore)) + { + return false; + } + else + { + ChatComponentScore chatcomponentscore = (ChatComponentScore)p_equals_1_; + return this.name.equals(chatcomponentscore.name) && this.objective.equals(chatcomponentscore.objective) && super.equals(p_equals_1_); + } + } + + public String toString() + { + return "ScoreComponent{name=\'" + this.name + '\'' + "objective=\'" + this.objective + '\'' + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentSelector.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentSelector.java new file mode 100644 index 0000000..901867c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentSelector.java @@ -0,0 +1,56 @@ +package net.minecraft.util; + +public class ChatComponentSelector extends ChatComponentStyle +{ + private final String selector; + + public ChatComponentSelector(String selectorIn) + { + this.selector = selectorIn; + } + + public String getSelector() + { + return this.selector; + } + + public String getUnformattedTextForChat() + { + return this.selector; + } + + public ChatComponentSelector createCopy() + { + ChatComponentSelector chatcomponentselector = new ChatComponentSelector(this.selector); + chatcomponentselector.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) + { + chatcomponentselector.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponentselector; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentSelector)) + { + return false; + } + else + { + ChatComponentSelector chatcomponentselector = (ChatComponentSelector)p_equals_1_; + return this.selector.equals(chatcomponentselector.selector) && super.equals(p_equals_1_); + } + } + + public String toString() + { + return "SelectorComponent{pattern=\'" + this.selector + '\'' + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentStyle.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentStyle.java new file mode 100644 index 0000000..782b197 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentStyle.java @@ -0,0 +1,136 @@ +package net.minecraft.util; + +import com.google.common.base.Function; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; + +public abstract class ChatComponentStyle implements IChatComponent +{ + protected List siblings = Lists.newArrayList(); + private ChatStyle style; + + public IChatComponent appendSibling(IChatComponent component) + { + component.getChatStyle().setParentStyle(this.getChatStyle()); + this.siblings.add(component); + return this; + } + + public List getSiblings() + { + return this.siblings; + } + + public IChatComponent appendText(String text) + { + return this.appendSibling(new ChatComponentText(text)); + } + + public IChatComponent setChatStyle(ChatStyle style) + { + this.style = style; + + for (IChatComponent ichatcomponent : this.siblings) + { + ichatcomponent.getChatStyle().setParentStyle(this.getChatStyle()); + } + + return this; + } + + public ChatStyle getChatStyle() + { + if (this.style == null) + { + this.style = new ChatStyle(); + + for (IChatComponent ichatcomponent : this.siblings) + { + ichatcomponent.getChatStyle().setParentStyle(this.style); + } + } + + return this.style; + } + + public Iterator iterator() + { + return Iterators.concat(Iterators.forArray(new ChatComponentStyle[] {this}), createDeepCopyIterator(this.siblings)); + } + + public final String getUnformattedText() + { + StringBuilder stringbuilder = new StringBuilder(); + + for (IChatComponent ichatcomponent : this) + { + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + } + + return stringbuilder.toString(); + } + + public final String getFormattedText() + { + StringBuilder stringbuilder = new StringBuilder(); + + for (IChatComponent ichatcomponent : this) + { + stringbuilder.append(ichatcomponent.getChatStyle().getFormattingCode()); + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + stringbuilder.append((Object)EnumChatFormatting.RESET); + } + + return stringbuilder.toString(); + } + + public static Iterator createDeepCopyIterator(Iterable components) + { + Iterator iterator = Iterators.concat(Iterators.transform(components.iterator(), new Function>() + { + public Iterator apply(IChatComponent p_apply_1_) + { + return p_apply_1_.iterator(); + } + })); + iterator = Iterators.transform(iterator, new Function() + { + public IChatComponent apply(IChatComponent p_apply_1_) + { + IChatComponent ichatcomponent = p_apply_1_.createCopy(); + ichatcomponent.setChatStyle(ichatcomponent.getChatStyle().createDeepCopy()); + return ichatcomponent; + } + }); + return iterator; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentStyle)) + { + return false; + } + else + { + ChatComponentStyle chatcomponentstyle = (ChatComponentStyle)p_equals_1_; + return this.siblings.equals(chatcomponentstyle.siblings) && this.getChatStyle().equals(chatcomponentstyle.getChatStyle()); + } + } + + public int hashCode() + { + return 31 * this.style.hashCode() + this.siblings.hashCode(); + } + + public String toString() + { + return "BaseComponent{style=" + this.style + ", siblings=" + this.siblings + '}'; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentText.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentText.java new file mode 100644 index 0000000..47d3aef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentText.java @@ -0,0 +1,60 @@ +package net.minecraft.util; + +import lombok.Getter; +import lombok.Setter; + +public class ChatComponentText extends ChatComponentStyle +{ + private final String text; + @Getter @Setter private boolean branded; + + public ChatComponentText(String msg) + { + this.text = msg; + } + + public String getChatComponentText_TextValue() + { + return this.text; + } + + public String getUnformattedTextForChat() + { + return this.text; + } + + public ChatComponentText createCopy() + { + ChatComponentText chatcomponenttext = new ChatComponentText(this.text); + chatcomponenttext.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) + { + chatcomponenttext.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponenttext; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentText)) + { + return false; + } + else + { + ChatComponentText chatcomponenttext = (ChatComponentText)p_equals_1_; + return this.text.equals(chatcomponenttext.getChatComponentText_TextValue()) && super.equals(p_equals_1_); + } + } + + public String toString() + { + return "TextComponent{text=\'" + this.text + '\'' + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentTranslation.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentTranslation.java new file mode 100644 index 0000000..dc3e1c1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentTranslation.java @@ -0,0 +1,264 @@ +package net.minecraft.util; + +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.IllegalFormatException; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ChatComponentTranslation extends ChatComponentStyle +{ + private final String key; + private final Object[] formatArgs; + private final Object syncLock = new Object(); + private long lastTranslationUpdateTimeInMilliseconds = -1L; + List children = Lists.newArrayList(); + public static final Pattern stringVariablePattern = Pattern.compile("%(?:(\\d+)\\$)?([A-Za-z%]|$)"); + + public ChatComponentTranslation(String translationKey, Object... args) + { + this.key = translationKey; + this.formatArgs = args; + + for (Object object : args) + { + if (object instanceof IChatComponent) + { + ((IChatComponent)object).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + } + + synchronized void ensureInitialized() + { + synchronized (this.syncLock) + { + long i = StatCollector.getLastTranslationUpdateTimeInMilliseconds(); + + if (i == this.lastTranslationUpdateTimeInMilliseconds) + { + return; + } + + this.lastTranslationUpdateTimeInMilliseconds = i; + this.children.clear(); + } + + try + { + this.initializeFromFormat(StatCollector.translateToLocal(this.key)); + } + catch (ChatComponentTranslationFormatException chatcomponenttranslationformatexception) + { + this.children.clear(); + + try + { + this.initializeFromFormat(StatCollector.translateToFallback(this.key)); + } + catch (ChatComponentTranslationFormatException var5) + { + throw chatcomponenttranslationformatexception; + } + } + } + + protected void initializeFromFormat(String format) + { + boolean flag = false; + Matcher matcher = stringVariablePattern.matcher(format); + int i = 0; + int j = 0; + + try + { + int l; + + for (; matcher.find(j); j = l) + { + int k = matcher.start(); + l = matcher.end(); + + if (k > j) + { + ChatComponentText chatcomponenttext = new ChatComponentText(String.format(format.substring(j, k), new Object[0])); + chatcomponenttext.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext); + } + + String s2 = matcher.group(2); + String s = format.substring(k, l); + + if ("%".equals(s2) && "%%".equals(s)) + { + ChatComponentText chatcomponenttext2 = new ChatComponentText("%"); + chatcomponenttext2.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext2); + } + else + { + if (!"s".equals(s2)) + { + throw new ChatComponentTranslationFormatException(this, "Unsupported format: \'" + s + "\'"); + } + + String s1 = matcher.group(1); + int i1 = s1 != null ? Integer.parseInt(s1) - 1 : i++; + + if (i1 < this.formatArgs.length) + { + this.children.add(this.getFormatArgumentAsComponent(i1)); + } + } + } + + if (j < format.length()) + { + ChatComponentText chatcomponenttext1 = new ChatComponentText(String.format(format.substring(j), new Object[0])); + chatcomponenttext1.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext1); + } + } + catch (IllegalFormatException illegalformatexception) + { + throw new ChatComponentTranslationFormatException(this, illegalformatexception); + } + } + + private IChatComponent getFormatArgumentAsComponent(int index) + { + if (index >= this.formatArgs.length) + { + throw new ChatComponentTranslationFormatException(this, index); + } + else + { + Object object = this.formatArgs[index]; + IChatComponent ichatcomponent; + + if (object instanceof IChatComponent) + { + ichatcomponent = (IChatComponent)object; + } + else + { + ichatcomponent = new ChatComponentText(object == null ? "null" : object.toString()); + ichatcomponent.getChatStyle().setParentStyle(this.getChatStyle()); + } + + return ichatcomponent; + } + } + + public IChatComponent setChatStyle(ChatStyle style) + { + super.setChatStyle(style); + + for (Object object : this.formatArgs) + { + if (object instanceof IChatComponent) + { + ((IChatComponent)object).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + + if (this.lastTranslationUpdateTimeInMilliseconds > -1L) + { + for (IChatComponent ichatcomponent : this.children) + { + ichatcomponent.getChatStyle().setParentStyle(style); + } + } + + return this; + } + + public Iterator iterator() + { + this.ensureInitialized(); + return Iterators.concat(createDeepCopyIterator(this.children), createDeepCopyIterator(this.siblings)); + } + + public String getUnformattedTextForChat() + { + this.ensureInitialized(); + StringBuilder stringbuilder = new StringBuilder(); + + for (IChatComponent ichatcomponent : this.children) + { + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + } + + return stringbuilder.toString(); + } + + public ChatComponentTranslation createCopy() + { + Object[] aobject = new Object[this.formatArgs.length]; + + for (int i = 0; i < this.formatArgs.length; ++i) + { + if (this.formatArgs[i] instanceof IChatComponent) + { + aobject[i] = ((IChatComponent)this.formatArgs[i]).createCopy(); + } + else + { + aobject[i] = this.formatArgs[i]; + } + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(this.key, aobject); + chatcomponenttranslation.setChatStyle(this.getChatStyle().createShallowCopy()); + + for (IChatComponent ichatcomponent : this.getSiblings()) + { + chatcomponenttranslation.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponenttranslation; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentTranslation)) + { + return false; + } + else + { + ChatComponentTranslation chatcomponenttranslation = (ChatComponentTranslation)p_equals_1_; + return Arrays.equals(this.formatArgs, chatcomponenttranslation.formatArgs) && this.key.equals(chatcomponenttranslation.key) && super.equals(p_equals_1_); + } + } + + public int hashCode() + { + int i = super.hashCode(); + i = 31 * i + this.key.hashCode(); + i = 31 * i + Arrays.hashCode(this.formatArgs); + return i; + } + + public String toString() + { + return "TranslatableComponent{key=\'" + this.key + '\'' + ", args=" + Arrays.toString(this.formatArgs) + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } + + public String getKey() + { + return this.key; + } + + public Object[] getFormatArgs() + { + return this.formatArgs; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java new file mode 100644 index 0000000..daf4a52 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java @@ -0,0 +1,19 @@ +package net.minecraft.util; + +public class ChatComponentTranslationFormatException extends IllegalArgumentException +{ + public ChatComponentTranslationFormatException(ChatComponentTranslation component, String message) + { + super(String.format("Error parsing: %s: %s", new Object[] {component, message})); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, int index) + { + super(String.format("Invalid index %d requested for %s", new Object[] {Integer.valueOf(index), component})); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, Throwable cause) + { + super(String.format("Error while parsing: %s", new Object[] {component}), cause); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ChatStyle.java b/Client-1.8.9/src/main/java/net/minecraft/util/ChatStyle.java new file mode 100644 index 0000000..aca1d2d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ChatStyle.java @@ -0,0 +1,554 @@ +package net.minecraft.util; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; + +public class ChatStyle +{ + private ChatStyle parentStyle; + private EnumChatFormatting color; + private Boolean bold; + private Boolean italic; + private Boolean underlined; + private Boolean strikethrough; + private Boolean obfuscated; + private ClickEvent chatClickEvent; + private HoverEvent chatHoverEvent; + private String insertion; + private static final ChatStyle rootStyle = new ChatStyle() + { + public EnumChatFormatting getColor() + { + return null; + } + public boolean getBold() + { + return false; + } + public boolean getItalic() + { + return false; + } + public boolean getStrikethrough() + { + return false; + } + public boolean getUnderlined() + { + return false; + } + public boolean getObfuscated() + { + return false; + } + public ClickEvent getChatClickEvent() + { + return null; + } + public HoverEvent getChatHoverEvent() + { + return null; + } + public String getInsertion() + { + return null; + } + public ChatStyle setColor(EnumChatFormatting color) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setBold(Boolean boldIn) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setItalic(Boolean italic) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setStrikethrough(Boolean strikethrough) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setUnderlined(Boolean underlined) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setObfuscated(Boolean obfuscated) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setChatClickEvent(ClickEvent event) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setChatHoverEvent(HoverEvent event) + { + throw new UnsupportedOperationException(); + } + public ChatStyle setParentStyle(ChatStyle parent) + { + throw new UnsupportedOperationException(); + } + public String toString() + { + return "Style.ROOT"; + } + public ChatStyle createShallowCopy() + { + return this; + } + public ChatStyle createDeepCopy() + { + return this; + } + public String getFormattingCode() + { + return ""; + } + }; + + public EnumChatFormatting getColor() + { + return this.color == null ? this.getParent().getColor() : this.color; + } + + public boolean getBold() + { + return this.bold == null ? this.getParent().getBold() : this.bold.booleanValue(); + } + + public boolean getItalic() + { + return this.italic == null ? this.getParent().getItalic() : this.italic.booleanValue(); + } + + public boolean getStrikethrough() + { + return this.strikethrough == null ? this.getParent().getStrikethrough() : this.strikethrough.booleanValue(); + } + + public boolean getUnderlined() + { + return this.underlined == null ? this.getParent().getUnderlined() : this.underlined.booleanValue(); + } + + public boolean getObfuscated() + { + return this.obfuscated == null ? this.getParent().getObfuscated() : this.obfuscated.booleanValue(); + } + + public boolean isEmpty() + { + return this.bold == null && this.italic == null && this.strikethrough == null && this.underlined == null && this.obfuscated == null && this.color == null && this.chatClickEvent == null && this.chatHoverEvent == null; + } + + public ClickEvent getChatClickEvent() + { + return this.chatClickEvent == null ? this.getParent().getChatClickEvent() : this.chatClickEvent; + } + + public HoverEvent getChatHoverEvent() + { + return this.chatHoverEvent == null ? this.getParent().getChatHoverEvent() : this.chatHoverEvent; + } + + public String getInsertion() + { + return this.insertion == null ? this.getParent().getInsertion() : this.insertion; + } + + public ChatStyle setColor(EnumChatFormatting color) + { + this.color = color; + return this; + } + + public ChatStyle setBold(Boolean boldIn) + { + this.bold = boldIn; + return this; + } + + public ChatStyle setItalic(Boolean italic) + { + this.italic = italic; + return this; + } + + public ChatStyle setStrikethrough(Boolean strikethrough) + { + this.strikethrough = strikethrough; + return this; + } + + public ChatStyle setUnderlined(Boolean underlined) + { + this.underlined = underlined; + return this; + } + + public ChatStyle setObfuscated(Boolean obfuscated) + { + this.obfuscated = obfuscated; + return this; + } + + public ChatStyle setChatClickEvent(ClickEvent event) + { + this.chatClickEvent = event; + return this; + } + + public ChatStyle setChatHoverEvent(HoverEvent event) + { + this.chatHoverEvent = event; + return this; + } + + public ChatStyle setInsertion(String insertion) + { + this.insertion = insertion; + return this; + } + + public ChatStyle setParentStyle(ChatStyle parent) + { + this.parentStyle = parent; + return this; + } + + public String getFormattingCode() + { + if (this.isEmpty()) + { + return this.parentStyle != null ? this.parentStyle.getFormattingCode() : ""; + } + else + { + StringBuilder stringbuilder = new StringBuilder(); + + if (this.getColor() != null) + { + stringbuilder.append((Object)this.getColor()); + } + + if (this.getBold()) + { + stringbuilder.append((Object)EnumChatFormatting.BOLD); + } + + if (this.getItalic()) + { + stringbuilder.append((Object)EnumChatFormatting.ITALIC); + } + + if (this.getUnderlined()) + { + stringbuilder.append((Object)EnumChatFormatting.UNDERLINE); + } + + if (this.getObfuscated()) + { + stringbuilder.append((Object)EnumChatFormatting.OBFUSCATED); + } + + if (this.getStrikethrough()) + { + stringbuilder.append((Object)EnumChatFormatting.STRIKETHROUGH); + } + + return stringbuilder.toString(); + } + } + + private ChatStyle getParent() + { + return this.parentStyle == null ? rootStyle : this.parentStyle; + } + + public String toString() + { + return "Style{hasParent=" + (this.parentStyle != null) + ", color=" + this.color + ", bold=" + this.bold + ", italic=" + this.italic + ", underlined=" + this.underlined + ", obfuscated=" + this.obfuscated + ", clickEvent=" + this.getChatClickEvent() + ", hoverEvent=" + this.getChatHoverEvent() + ", insertion=" + this.getInsertion() + '}'; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatStyle)) + { + return false; + } + else + { + boolean flag; + label0: + { + ChatStyle chatstyle = (ChatStyle)p_equals_1_; + + if (this.getBold() == chatstyle.getBold() && this.getColor() == chatstyle.getColor() && this.getItalic() == chatstyle.getItalic() && this.getObfuscated() == chatstyle.getObfuscated() && this.getStrikethrough() == chatstyle.getStrikethrough() && this.getUnderlined() == chatstyle.getUnderlined()) + { + label85: + { + if (this.getChatClickEvent() != null) + { + if (!this.getChatClickEvent().equals(chatstyle.getChatClickEvent())) + { + break label85; + } + } + else if (chatstyle.getChatClickEvent() != null) + { + break label85; + } + + if (this.getChatHoverEvent() != null) + { + if (!this.getChatHoverEvent().equals(chatstyle.getChatHoverEvent())) + { + break label85; + } + } + else if (chatstyle.getChatHoverEvent() != null) + { + break label85; + } + + if (this.getInsertion() != null) + { + if (this.getInsertion().equals(chatstyle.getInsertion())) + { + break label0; + } + } + else if (chatstyle.getInsertion() == null) + { + break label0; + } + } + } + + flag = false; + return flag; + } + flag = true; + return flag; + } + } + + public int hashCode() + { + int i = this.color.hashCode(); + i = 31 * i + this.bold.hashCode(); + i = 31 * i + this.italic.hashCode(); + i = 31 * i + this.underlined.hashCode(); + i = 31 * i + this.strikethrough.hashCode(); + i = 31 * i + this.obfuscated.hashCode(); + i = 31 * i + this.chatClickEvent.hashCode(); + i = 31 * i + this.chatHoverEvent.hashCode(); + i = 31 * i + this.insertion.hashCode(); + return i; + } + + public ChatStyle createShallowCopy() + { + ChatStyle chatstyle = new ChatStyle(); + chatstyle.bold = this.bold; + chatstyle.italic = this.italic; + chatstyle.strikethrough = this.strikethrough; + chatstyle.underlined = this.underlined; + chatstyle.obfuscated = this.obfuscated; + chatstyle.color = this.color; + chatstyle.chatClickEvent = this.chatClickEvent; + chatstyle.chatHoverEvent = this.chatHoverEvent; + chatstyle.parentStyle = this.parentStyle; + chatstyle.insertion = this.insertion; + return chatstyle; + } + + public ChatStyle createDeepCopy() + { + ChatStyle chatstyle = new ChatStyle(); + chatstyle.setBold(Boolean.valueOf(this.getBold())); + chatstyle.setItalic(Boolean.valueOf(this.getItalic())); + chatstyle.setStrikethrough(Boolean.valueOf(this.getStrikethrough())); + chatstyle.setUnderlined(Boolean.valueOf(this.getUnderlined())); + chatstyle.setObfuscated(Boolean.valueOf(this.getObfuscated())); + chatstyle.setColor(this.getColor()); + chatstyle.setChatClickEvent(this.getChatClickEvent()); + chatstyle.setChatHoverEvent(this.getChatHoverEvent()); + chatstyle.setInsertion(this.getInsertion()); + return chatstyle; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + public ChatStyle deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + if (p_deserialize_1_.isJsonObject()) + { + ChatStyle chatstyle = new ChatStyle(); + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + + if (jsonobject == null) + { + return null; + } + else + { + if (jsonobject.has("bold")) + { + chatstyle.bold = Boolean.valueOf(jsonobject.get("bold").getAsBoolean()); + } + + if (jsonobject.has("italic")) + { + chatstyle.italic = Boolean.valueOf(jsonobject.get("italic").getAsBoolean()); + } + + if (jsonobject.has("underlined")) + { + chatstyle.underlined = Boolean.valueOf(jsonobject.get("underlined").getAsBoolean()); + } + + if (jsonobject.has("strikethrough")) + { + chatstyle.strikethrough = Boolean.valueOf(jsonobject.get("strikethrough").getAsBoolean()); + } + + if (jsonobject.has("obfuscated")) + { + chatstyle.obfuscated = Boolean.valueOf(jsonobject.get("obfuscated").getAsBoolean()); + } + + if (jsonobject.has("color")) + { + chatstyle.color = (EnumChatFormatting)p_deserialize_3_.deserialize(jsonobject.get("color"), EnumChatFormatting.class); + } + + if (jsonobject.has("insertion")) + { + chatstyle.insertion = jsonobject.get("insertion").getAsString(); + } + + if (jsonobject.has("clickEvent")) + { + JsonObject jsonobject1 = jsonobject.getAsJsonObject("clickEvent"); + + if (jsonobject1 != null) + { + JsonPrimitive jsonprimitive = jsonobject1.getAsJsonPrimitive("action"); + ClickEvent.Action clickevent$action = jsonprimitive == null ? null : ClickEvent.Action.getValueByCanonicalName(jsonprimitive.getAsString()); + JsonPrimitive jsonprimitive1 = jsonobject1.getAsJsonPrimitive("value"); + String s = jsonprimitive1 == null ? null : jsonprimitive1.getAsString(); + + if (clickevent$action != null && s != null && clickevent$action.shouldAllowInChat()) + { + chatstyle.chatClickEvent = new ClickEvent(clickevent$action, s); + } + } + } + + if (jsonobject.has("hoverEvent")) + { + JsonObject jsonobject2 = jsonobject.getAsJsonObject("hoverEvent"); + + if (jsonobject2 != null) + { + JsonPrimitive jsonprimitive2 = jsonobject2.getAsJsonPrimitive("action"); + HoverEvent.Action hoverevent$action = jsonprimitive2 == null ? null : HoverEvent.Action.getValueByCanonicalName(jsonprimitive2.getAsString()); + IChatComponent ichatcomponent = (IChatComponent)p_deserialize_3_.deserialize(jsonobject2.get("value"), IChatComponent.class); + + if (hoverevent$action != null && ichatcomponent != null && hoverevent$action.shouldAllowInChat()) + { + chatstyle.chatHoverEvent = new HoverEvent(hoverevent$action, ichatcomponent); + } + } + } + + return chatstyle; + } + } + else + { + return null; + } + } + + public JsonElement serialize(ChatStyle p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + if (p_serialize_1_.isEmpty()) + { + return null; + } + else + { + JsonObject jsonobject = new JsonObject(); + + if (p_serialize_1_.bold != null) + { + jsonobject.addProperty("bold", p_serialize_1_.bold); + } + + if (p_serialize_1_.italic != null) + { + jsonobject.addProperty("italic", p_serialize_1_.italic); + } + + if (p_serialize_1_.underlined != null) + { + jsonobject.addProperty("underlined", p_serialize_1_.underlined); + } + + if (p_serialize_1_.strikethrough != null) + { + jsonobject.addProperty("strikethrough", p_serialize_1_.strikethrough); + } + + if (p_serialize_1_.obfuscated != null) + { + jsonobject.addProperty("obfuscated", p_serialize_1_.obfuscated); + } + + if (p_serialize_1_.color != null) + { + jsonobject.add("color", p_serialize_3_.serialize(p_serialize_1_.color)); + } + + if (p_serialize_1_.insertion != null) + { + jsonobject.add("insertion", p_serialize_3_.serialize(p_serialize_1_.insertion)); + } + + if (p_serialize_1_.chatClickEvent != null) + { + JsonObject jsonobject1 = new JsonObject(); + jsonobject1.addProperty("action", p_serialize_1_.chatClickEvent.getAction().getCanonicalName()); + jsonobject1.addProperty("value", p_serialize_1_.chatClickEvent.getValue()); + jsonobject.add("clickEvent", jsonobject1); + } + + if (p_serialize_1_.chatHoverEvent != null) + { + JsonObject jsonobject2 = new JsonObject(); + jsonobject2.addProperty("action", p_serialize_1_.chatHoverEvent.getAction().getCanonicalName()); + jsonobject2.add("value", p_serialize_3_.serialize(p_serialize_1_.chatHoverEvent.getValue())); + jsonobject.add("hoverEvent", jsonobject2); + } + + return jsonobject; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ClassInherita# b/Client-1.8.9/src/main/java/net/minecraft/util/ClassInherita# new file mode 100644 index 0000000..094fe11 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ClassInherita# @@ -0,0 +1,17 @@ +*************** +*** 108,114 **** + } + + public Iterator iterator() { +- return this.field_181745_e.isEmpty()?Iterators.emptyIterator():Iterators.unmodifiableIterator(this.field_181745_e.iterator()); + } + + public int size() { +--- 108,114 ---- + } + + public Iterator iterator() { ++ return this.field_181745_e.isEmpty()?Iterators.emptyIterator():Iterators.unmodifiableIterator(this.field_181745_e.iterator()); + } + + public int size() { diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ClassInheritanceMultiMap.java b/Client-1.8.9/src/main/java/net/minecraft/util/ClassInheritanceMultiMap.java new file mode 100644 index 0000000..4c8cc71 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ClassInheritanceMultiMap.java @@ -0,0 +1,166 @@ +package net.minecraft.util; + +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.AbstractSet; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.optifine.util.IteratorCache; + +public class ClassInheritanceMultiMap extends AbstractSet +{ + private static final Set < Class> field_181158_a = Collections. < Class> newSetFromMap(new ConcurrentHashMap()); + private final Map < Class, List> map = Maps. < Class, List> newHashMap(); + private final Set < Class> knownKeys = Sets. < Class> newIdentityHashSet(); + private final Class baseClass; + private final List values = Lists.newArrayList(); + public boolean empty; + + public ClassInheritanceMultiMap(Class baseClassIn) + { + this.baseClass = baseClassIn; + this.knownKeys.add(baseClassIn); + this.map.put(baseClassIn, this.values); + + for (Class oclass : field_181158_a) + { + this.createLookup(oclass); + } + + this.empty = this.values.size() == 0; + } + + protected void createLookup(Class clazz) + { + field_181158_a.add(clazz); + int i = this.values.size(); + + for (int j = 0; j < i; ++j) + { + T t = this.values.get(j); + + if (clazz.isAssignableFrom(t.getClass())) + { + this.addForClass(t, clazz); + } + } + + this.knownKeys.add(clazz); + } + + protected Class initializeClassLookup(Class clazz) + { + if (this.baseClass.isAssignableFrom(clazz)) + { + if (!this.knownKeys.contains(clazz)) + { + this.createLookup(clazz); + } + + return clazz; + } + else + { + throw new IllegalArgumentException("Don\'t know how to search for " + clazz); + } + } + + public boolean add(T p_add_1_) + { + for (Class oclass : this.knownKeys) + { + if (oclass.isAssignableFrom(p_add_1_.getClass())) + { + this.addForClass(p_add_1_, oclass); + } + } + + this.empty = this.values.size() == 0; + return true; + } + + private void addForClass(T value, Class parentClass) + { + List list = (List)this.map.get(parentClass); + + if (list == null) + { + this.map.put(parentClass, Lists.newArrayList(value)); + } + else + { + list.add(value); + } + + this.empty = this.values.size() == 0; + } + + public boolean remove(Object p_remove_1_) + { + T t = (T)p_remove_1_; + boolean flag = false; + + for (Class oclass : this.knownKeys) + { + if (oclass.isAssignableFrom(t.getClass())) + { + List list = (List)this.map.get(oclass); + + if (list != null && list.remove(t)) + { + flag = true; + } + } + } + + this.empty = this.values.size() == 0; + return flag; + } + + public boolean contains(Object p_contains_1_) + { + return Iterators.contains(this.getByClass(p_contains_1_.getClass()).iterator(), p_contains_1_); + } + + public Iterable getByClass(final Class clazz) + { + return new Iterable() + { + public Iterator iterator() + { + List list = (List)ClassInheritanceMultiMap.this.map.get(ClassInheritanceMultiMap.this.initializeClassLookup(clazz)); + + if (list == null) + { + return Iterators.emptyIterator(); + } + else + { + Iterator iterator = list.iterator(); + return Iterators.filter(iterator, clazz); + } + } + }; + } + + public Iterator iterator() + { + return (Iterator)(this.values.isEmpty() ? Iterators.emptyIterator() : IteratorCache.getReadOnly(this.values)); + } + + public int size() + { + return this.values.size(); + } + + public boolean isEmpty() + { + return this.empty; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ClassInherita~ b/Client-1.8.9/src/main/java/net/minecraft/util/ClassInherita~ new file mode 100644 index 0000000..b8d007d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ClassInherita~ @@ -0,0 +1,130 @@ +package net.minecraft.util; + +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.AbstractSet; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.optifine.util.IteratorCache; + +public class ClassInheritanceMultiMap extends AbstractSet { + private static final Set> field_181158_a = Collections.>newSetFromMap(new ConcurrentHashMap()); + private final Map, List> field_180218_a = Maps., List>newHashMap(); + private final Set> field_180216_b = Sets.>newIdentityHashSet(); + private final Class field_180217_c; + private final List field_181745_e = Lists.newArrayList(); + public boolean empty; + + public ClassInheritanceMultiMap(Class p_i45909_1_) { + this.field_180217_c = p_i45909_1_; + this.field_180216_b.add(p_i45909_1_); + this.field_180218_a.put(p_i45909_1_, this.field_181745_e); + + for(Class oclass : field_181158_a) { + this.func_180213_a(oclass); + } + + this.empty = this.field_181745_e.size() == 0; + } + + protected void func_180213_a(Class p_180213_1_) { + field_181158_a.add(p_180213_1_); + int i = this.field_181745_e.size(); + + for(int j = 0; j < i; ++j) { + T t = this.field_181745_e.get(j); + if(p_180213_1_.isAssignableFrom(t.getClass())) { + this.func_181743_a(t, p_180213_1_); + } + } + + this.field_180216_b.add(p_180213_1_); + } + + protected Class func_181157_b(Class p_181157_1_) { + if(this.field_180217_c.isAssignableFrom(p_181157_1_)) { + if(!this.field_180216_b.contains(p_181157_1_)) { + this.func_180213_a(p_181157_1_); + } + + return p_181157_1_; + } else { + throw new IllegalArgumentException("Don\'t know how to search for " + p_181157_1_); + } + } + + public boolean add(T p_add_1_) { + for(Class oclass : this.field_180216_b) { + if(oclass.isAssignableFrom(p_add_1_.getClass())) { + this.func_181743_a(p_add_1_, oclass); + } + } + + this.empty = this.field_181745_e.size() == 0; + return true; + } + + private void func_181743_a(T p_181743_1_, Class p_181743_2_) { + List list = (List)this.field_180218_a.get(p_181743_2_); + if(list == null) { + this.field_180218_a.put(p_181743_2_, Lists.newArrayList(new Object[]{p_181743_1_})); + } else { + list.add(p_181743_1_); + } + + this.empty = this.field_181745_e.size() == 0; + } + + public boolean remove(Object p_remove_1_) { + T t = p_remove_1_; + boolean flag = false; + + for(Class oclass : this.field_180216_b) { + if(oclass.isAssignableFrom(t.getClass())) { + List list = (List)this.field_180218_a.get(oclass); + if(list != null && list.remove(t)) { + flag = true; + } + } + } + + this.empty = this.field_181745_e.size() == 0; + return flag; + } + + public boolean contains(Object p_contains_1_) { + return Iterators.contains(this.func_180215_b(p_contains_1_.getClass()).iterator(), p_contains_1_); + } + + public Iterable func_180215_b(final Class p_180215_1_) { + return new Iterable() { + public Iterator iterator() { + List list = (List)ClassInheritanceMultiMap.this.field_180218_a.get(ClassInheritanceMultiMap.this.func_181157_b(p_180215_1_)); + if(list == null) { + return Iterators.emptyIterator(); + } else { + Iterator iterator = list.iterator(); + return Iterators.filter(iterator, p_180215_1_); + } + } + }; + } + + public Iterator iterator() { + return (Iterator)(this.field_181745_e.isEmpty()?Iterators.emptyIterator():IteratorCache.getReadOnly(this.field_181745_e)); + } + + public int size() { + return this.field_181745_e.size(); + } + + public boolean isEmpty() { + return this.empty; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/CombatEntry.java b/Client-1.8.9/src/main/java/net/minecraft/util/CombatEntry.java new file mode 100644 index 0000000..9ba7fb7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/CombatEntry.java @@ -0,0 +1,53 @@ +package net.minecraft.util; + +import net.minecraft.entity.EntityLivingBase; + +public class CombatEntry +{ + private final DamageSource damageSrc; + private final int field_94567_b; + private final float damage; + private final float health; + private final String field_94566_e; + private final float fallDistance; + + public CombatEntry(DamageSource damageSrcIn, int p_i1564_2_, float healthAmount, float damageAmount, String p_i1564_5_, float fallDistanceIn) + { + this.damageSrc = damageSrcIn; + this.field_94567_b = p_i1564_2_; + this.damage = damageAmount; + this.health = healthAmount; + this.field_94566_e = p_i1564_5_; + this.fallDistance = fallDistanceIn; + } + + public DamageSource getDamageSrc() + { + return this.damageSrc; + } + + public float func_94563_c() + { + return this.damage; + } + + public boolean isLivingDamageSrc() + { + return this.damageSrc.getEntity() instanceof EntityLivingBase; + } + + public String func_94562_g() + { + return this.field_94566_e; + } + + public IChatComponent getDamageSrcDisplayName() + { + return this.getDamageSrc().getEntity() == null ? null : this.getDamageSrc().getEntity().getDisplayName(); + } + + public float getDamageAmount() + { + return this.damageSrc == DamageSource.outOfWorld ? Float.MAX_VALUE : this.fallDistance; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/CombatTracker.java b/Client-1.8.9/src/main/java/net/minecraft/util/CombatTracker.java new file mode 100644 index 0000000..c4d9f62 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/CombatTracker.java @@ -0,0 +1,252 @@ +package net.minecraft.util; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class CombatTracker +{ + private final List combatEntries = Lists.newArrayList(); + private final EntityLivingBase fighter; + private int field_94555_c; + private int field_152775_d; + private int field_152776_e; + private boolean field_94552_d; + private boolean field_94553_e; + private String field_94551_f; + + public CombatTracker(EntityLivingBase fighterIn) + { + this.fighter = fighterIn; + } + + public void func_94545_a() + { + this.func_94542_g(); + + if (this.fighter.isOnLadder()) + { + Block block = this.fighter.worldObj.getBlockState(new BlockPos(this.fighter.posX, this.fighter.getEntityBoundingBox().minY, this.fighter.posZ)).getBlock(); + + if (block == Blocks.ladder) + { + this.field_94551_f = "ladder"; + } + else if (block == Blocks.vine) + { + this.field_94551_f = "vines"; + } + } + else if (this.fighter.isInWater()) + { + this.field_94551_f = "water"; + } + } + + public void trackDamage(DamageSource damageSrc, float healthIn, float damageAmount) + { + this.reset(); + this.func_94545_a(); + CombatEntry combatentry = new CombatEntry(damageSrc, this.fighter.ticksExisted, healthIn, damageAmount, this.field_94551_f, this.fighter.fallDistance); + this.combatEntries.add(combatentry); + this.field_94555_c = this.fighter.ticksExisted; + this.field_94553_e = true; + + if (combatentry.isLivingDamageSrc() && !this.field_94552_d && this.fighter.isEntityAlive()) + { + this.field_94552_d = true; + this.field_152775_d = this.fighter.ticksExisted; + this.field_152776_e = this.field_152775_d; + this.fighter.sendEnterCombat(); + } + } + + public IChatComponent getDeathMessage() + { + if (this.combatEntries.size() == 0) + { + return new ChatComponentTranslation("death.attack.generic", new Object[] {this.fighter.getDisplayName()}); + } + else + { + CombatEntry combatentry = this.func_94544_f(); + CombatEntry combatentry1 = (CombatEntry)this.combatEntries.get(this.combatEntries.size() - 1); + IChatComponent ichatcomponent1 = combatentry1.getDamageSrcDisplayName(); + Entity entity = combatentry1.getDamageSrc().getEntity(); + IChatComponent ichatcomponent; + + if (combatentry != null && combatentry1.getDamageSrc() == DamageSource.fall) + { + IChatComponent ichatcomponent2 = combatentry.getDamageSrcDisplayName(); + + if (combatentry.getDamageSrc() != DamageSource.fall && combatentry.getDamageSrc() != DamageSource.outOfWorld) + { + if (ichatcomponent2 != null && (ichatcomponent1 == null || !ichatcomponent2.equals(ichatcomponent1))) + { + Entity entity1 = combatentry.getDamageSrc().getEntity(); + ItemStack itemstack1 = entity1 instanceof EntityLivingBase ? ((EntityLivingBase)entity1).getHeldItem() : null; + + if (itemstack1 != null && itemstack1.hasDisplayName()) + { + ichatcomponent = new ChatComponentTranslation("death.fell.assist.item", new Object[] {this.fighter.getDisplayName(), ichatcomponent2, itemstack1.getChatComponent()}); + } + else + { + ichatcomponent = new ChatComponentTranslation("death.fell.assist", new Object[] {this.fighter.getDisplayName(), ichatcomponent2}); + } + } + else if (ichatcomponent1 != null) + { + ItemStack itemstack = entity instanceof EntityLivingBase ? ((EntityLivingBase)entity).getHeldItem() : null; + + if (itemstack != null && itemstack.hasDisplayName()) + { + ichatcomponent = new ChatComponentTranslation("death.fell.finish.item", new Object[] {this.fighter.getDisplayName(), ichatcomponent1, itemstack.getChatComponent()}); + } + else + { + ichatcomponent = new ChatComponentTranslation("death.fell.finish", new Object[] {this.fighter.getDisplayName(), ichatcomponent1}); + } + } + else + { + ichatcomponent = new ChatComponentTranslation("death.fell.killer", new Object[] {this.fighter.getDisplayName()}); + } + } + else + { + ichatcomponent = new ChatComponentTranslation("death.fell.accident." + this.func_94548_b(combatentry), new Object[] {this.fighter.getDisplayName()}); + } + } + else + { + ichatcomponent = combatentry1.getDamageSrc().getDeathMessage(this.fighter); + } + + return ichatcomponent; + } + } + + public EntityLivingBase func_94550_c() + { + EntityLivingBase entitylivingbase = null; + EntityPlayer entityplayer = null; + float f = 0.0F; + float f1 = 0.0F; + + for (CombatEntry combatentry : this.combatEntries) + { + if (combatentry.getDamageSrc().getEntity() instanceof EntityPlayer && (entityplayer == null || combatentry.func_94563_c() > f1)) + { + f1 = combatentry.func_94563_c(); + entityplayer = (EntityPlayer)combatentry.getDamageSrc().getEntity(); + } + + if (combatentry.getDamageSrc().getEntity() instanceof EntityLivingBase && (entitylivingbase == null || combatentry.func_94563_c() > f)) + { + f = combatentry.func_94563_c(); + entitylivingbase = (EntityLivingBase)combatentry.getDamageSrc().getEntity(); + } + } + + if (entityplayer != null && f1 >= f / 3.0F) + { + return entityplayer; + } + else + { + return entitylivingbase; + } + } + + private CombatEntry func_94544_f() + { + CombatEntry combatentry = null; + CombatEntry combatentry1 = null; + int i = 0; + float f = 0.0F; + + for (int j = 0; j < this.combatEntries.size(); ++j) + { + CombatEntry combatentry2 = (CombatEntry)this.combatEntries.get(j); + CombatEntry combatentry3 = j > 0 ? (CombatEntry)this.combatEntries.get(j - 1) : null; + + if ((combatentry2.getDamageSrc() == DamageSource.fall || combatentry2.getDamageSrc() == DamageSource.outOfWorld) && combatentry2.getDamageAmount() > 0.0F && (combatentry == null || combatentry2.getDamageAmount() > f)) + { + if (j > 0) + { + combatentry = combatentry3; + } + else + { + combatentry = combatentry2; + } + + f = combatentry2.getDamageAmount(); + } + + if (combatentry2.func_94562_g() != null && (combatentry1 == null || combatentry2.func_94563_c() > (float)i)) + { + combatentry1 = combatentry2; + } + } + + if (f > 5.0F && combatentry != null) + { + return combatentry; + } + else if (i > 5 && combatentry1 != null) + { + return combatentry1; + } + else + { + return null; + } + } + + private String func_94548_b(CombatEntry p_94548_1_) + { + return p_94548_1_.func_94562_g() == null ? "generic" : p_94548_1_.func_94562_g(); + } + + public int func_180134_f() + { + return this.field_94552_d ? this.fighter.ticksExisted - this.field_152775_d : this.field_152776_e - this.field_152775_d; + } + + private void func_94542_g() + { + this.field_94551_f = null; + } + + public void reset() + { + int i = this.field_94552_d ? 300 : 100; + + if (this.field_94553_e && (!this.fighter.isEntityAlive() || this.fighter.ticksExisted - this.field_94555_c > i)) + { + boolean flag = this.field_94552_d; + this.field_94553_e = false; + this.field_94552_d = false; + this.field_152776_e = this.fighter.ticksExisted; + + if (flag) + { + this.fighter.sendEndCombat(); + } + + this.combatEntries.clear(); + } + } + + public EntityLivingBase getFighter() + { + return this.fighter; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/CryptManager.java b/Client-1.8.9/src/main/java/net/minecraft/util/CryptManager.java new file mode 100644 index 0000000..24fdd7e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/CryptManager.java @@ -0,0 +1,189 @@ +package net.minecraft.util; + +import java.io.UnsupportedEncodingException; +import java.security.GeneralSecurityException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.EncodedKeySpec; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.KeyGenerator; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CryptManager +{ + private static final Logger LOGGER = LogManager.getLogger(); + + public static SecretKey createNewSharedKey() + { + try + { + KeyGenerator keygenerator = KeyGenerator.getInstance("AES"); + keygenerator.init(128); + return keygenerator.generateKey(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + throw new Error(nosuchalgorithmexception); + } + } + + public static KeyPair generateKeyPair() + { + try + { + KeyPairGenerator keypairgenerator = KeyPairGenerator.getInstance("RSA"); + keypairgenerator.initialize(1024); + return keypairgenerator.generateKeyPair(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + nosuchalgorithmexception.printStackTrace(); + LOGGER.error("Key pair generation failed!"); + return null; + } + } + + public static byte[] getServerIdHash(String serverId, PublicKey publicKey, SecretKey secretKey) + { + try + { + return digestOperation("SHA-1", new byte[][] {serverId.getBytes("ISO_8859_1"), secretKey.getEncoded(), publicKey.getEncoded()}); + } + catch (UnsupportedEncodingException unsupportedencodingexception) + { + unsupportedencodingexception.printStackTrace(); + return null; + } + } + + private static byte[] digestOperation(String algorithm, byte[]... data) + { + try + { + MessageDigest messagedigest = MessageDigest.getInstance(algorithm); + + for (byte[] abyte : data) + { + messagedigest.update(abyte); + } + + return messagedigest.digest(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + nosuchalgorithmexception.printStackTrace(); + return null; + } + } + + public static PublicKey decodePublicKey(byte[] encodedKey) + { + try + { + EncodedKeySpec encodedkeyspec = new X509EncodedKeySpec(encodedKey); + KeyFactory keyfactory = KeyFactory.getInstance("RSA"); + return keyfactory.generatePublic(encodedkeyspec); + } + catch (NoSuchAlgorithmException var3) + { + ; + } + catch (InvalidKeySpecException var4) + { + ; + } + + LOGGER.error("Public key reconstitute failed!"); + return null; + } + + public static SecretKey decryptSharedKey(PrivateKey key, byte[] secretKeyEncrypted) + { + return new SecretKeySpec(decryptData(key, secretKeyEncrypted), "AES"); + } + + public static byte[] encryptData(Key key, byte[] data) + { + return cipherOperation(1, key, data); + } + + public static byte[] decryptData(Key key, byte[] data) + { + return cipherOperation(2, key, data); + } + + private static byte[] cipherOperation(int opMode, Key key, byte[] data) + { + try + { + return createTheCipherInstance(opMode, key.getAlgorithm(), key).doFinal(data); + } + catch (IllegalBlockSizeException illegalblocksizeexception) + { + illegalblocksizeexception.printStackTrace(); + } + catch (BadPaddingException badpaddingexception) + { + badpaddingexception.printStackTrace(); + } + + LOGGER.error("Cipher data failed!"); + return null; + } + + private static Cipher createTheCipherInstance(int opMode, String transformation, Key key) + { + try + { + Cipher cipher = Cipher.getInstance(transformation); + cipher.init(opMode, key); + return cipher; + } + catch (InvalidKeyException invalidkeyexception) + { + invalidkeyexception.printStackTrace(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + nosuchalgorithmexception.printStackTrace(); + } + catch (NoSuchPaddingException nosuchpaddingexception) + { + nosuchpaddingexception.printStackTrace(); + } + + LOGGER.error("Cipher creation failed!"); + return null; + } + + public static Cipher createNetCipherInstance(int opMode, Key key) + { + try + { + Cipher cipher = Cipher.getInstance("AES/CFB8/NoPadding"); + cipher.init(opMode, (Key)key, (AlgorithmParameterSpec)(new IvParameterSpec(key.getEncoded()))); + return cipher; + } + catch (GeneralSecurityException generalsecurityexception) + { + throw new RuntimeException(generalsecurityexception); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/DamageSource.java b/Client-1.8.9/src/main/java/net/minecraft/util/DamageSource.java new file mode 100644 index 0000000..c5b4514 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/DamageSource.java @@ -0,0 +1,206 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.world.Explosion; + +public class DamageSource +{ + public static DamageSource inFire = (new DamageSource("inFire")).setFireDamage(); + public static DamageSource lightningBolt = new DamageSource("lightningBolt"); + public static DamageSource onFire = (new DamageSource("onFire")).setDamageBypassesArmor().setFireDamage(); + public static DamageSource lava = (new DamageSource("lava")).setFireDamage(); + public static DamageSource inWall = (new DamageSource("inWall")).setDamageBypassesArmor(); + public static DamageSource drown = (new DamageSource("drown")).setDamageBypassesArmor(); + public static DamageSource starve = (new DamageSource("starve")).setDamageBypassesArmor().setDamageIsAbsolute(); + public static DamageSource cactus = new DamageSource("cactus"); + public static DamageSource fall = (new DamageSource("fall")).setDamageBypassesArmor(); + public static DamageSource outOfWorld = (new DamageSource("outOfWorld")).setDamageBypassesArmor().setDamageAllowedInCreativeMode(); + public static DamageSource generic = (new DamageSource("generic")).setDamageBypassesArmor(); + public static DamageSource magic = (new DamageSource("magic")).setDamageBypassesArmor().setMagicDamage(); + public static DamageSource wither = (new DamageSource("wither")).setDamageBypassesArmor(); + public static DamageSource anvil = new DamageSource("anvil"); + public static DamageSource fallingBlock = new DamageSource("fallingBlock"); + private boolean isUnblockable; + private boolean isDamageAllowedInCreativeMode; + private boolean damageIsAbsolute; + private float hungerDamage = 0.3F; + private boolean fireDamage; + private boolean projectile; + private boolean difficultyScaled; + private boolean magicDamage; + private boolean explosion; + public String damageType; + + public static DamageSource causeMobDamage(EntityLivingBase mob) + { + return new EntityDamageSource("mob", mob); + } + + public static DamageSource causePlayerDamage(EntityPlayer player) + { + return new EntityDamageSource("player", player); + } + + public static DamageSource causeArrowDamage(EntityArrow arrow, Entity indirectEntityIn) + { + return (new EntityDamageSourceIndirect("arrow", arrow, indirectEntityIn)).setProjectile(); + } + + public static DamageSource causeFireballDamage(EntityFireball fireball, Entity indirectEntityIn) + { + return indirectEntityIn == null ? (new EntityDamageSourceIndirect("onFire", fireball, fireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", fireball, indirectEntityIn)).setFireDamage().setProjectile(); + } + + public static DamageSource causeThrownDamage(Entity source, Entity indirectEntityIn) + { + return (new EntityDamageSourceIndirect("thrown", source, indirectEntityIn)).setProjectile(); + } + + public static DamageSource causeIndirectMagicDamage(Entity source, Entity indirectEntityIn) + { + return (new EntityDamageSourceIndirect("indirectMagic", source, indirectEntityIn)).setDamageBypassesArmor().setMagicDamage(); + } + + public static DamageSource causeThornsDamage(Entity source) + { + return (new EntityDamageSource("thorns", source)).setIsThornsDamage().setMagicDamage(); + } + + public static DamageSource setExplosionSource(Explosion explosionIn) + { + return explosionIn != null && explosionIn.getExplosivePlacedBy() != null ? (new EntityDamageSource("explosion.player", explosionIn.getExplosivePlacedBy())).setDifficultyScaled().setExplosion() : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); + } + + public boolean isProjectile() + { + return this.projectile; + } + + public DamageSource setProjectile() + { + this.projectile = true; + return this; + } + + public boolean isExplosion() + { + return this.explosion; + } + + public DamageSource setExplosion() + { + this.explosion = true; + return this; + } + + public boolean isUnblockable() + { + return this.isUnblockable; + } + + public float getHungerDamage() + { + return this.hungerDamage; + } + + public boolean canHarmInCreative() + { + return this.isDamageAllowedInCreativeMode; + } + + public boolean isDamageAbsolute() + { + return this.damageIsAbsolute; + } + + protected DamageSource(String damageTypeIn) + { + this.damageType = damageTypeIn; + } + + public Entity getSourceOfDamage() + { + return this.getEntity(); + } + + public Entity getEntity() + { + return null; + } + + protected DamageSource setDamageBypassesArmor() + { + this.isUnblockable = true; + this.hungerDamage = 0.0F; + return this; + } + + protected DamageSource setDamageAllowedInCreativeMode() + { + this.isDamageAllowedInCreativeMode = true; + return this; + } + + protected DamageSource setDamageIsAbsolute() + { + this.damageIsAbsolute = true; + this.hungerDamage = 0.0F; + return this; + } + + protected DamageSource setFireDamage() + { + this.fireDamage = true; + return this; + } + + public IChatComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) + { + EntityLivingBase entitylivingbase = entityLivingBaseIn.getAttackingEntity(); + String s = "death.attack." + this.damageType; + String s1 = s + ".player"; + return entitylivingbase != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), entitylivingbase.getDisplayName()}): new ChatComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName()}); + } + + public boolean isFireDamage() + { + return this.fireDamage; + } + + public String getDamageType() + { + return this.damageType; + } + + public DamageSource setDifficultyScaled() + { + this.difficultyScaled = true; + return this; + } + + public boolean isDifficultyScaled() + { + return this.difficultyScaled; + } + + public boolean isMagicDamage() + { + return this.magicDamage; + } + + public DamageSource setMagicDamage() + { + this.magicDamage = true; + return this; + } + + public boolean isCreativePlayer() + { + Entity entity = this.getEntity(); + return entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EnchantmentNameParts.java b/Client-1.8.9/src/main/java/net/minecraft/util/EnchantmentNameParts.java new file mode 100644 index 0000000..d9b1d8d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EnchantmentNameParts.java @@ -0,0 +1,38 @@ +package net.minecraft.util; + +import java.util.Random; + +public class EnchantmentNameParts +{ + private static final EnchantmentNameParts instance = new EnchantmentNameParts(); + private Random rand = new Random(); + private String[] namePartsArray = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); + + public static EnchantmentNameParts getInstance() + { + return instance; + } + + public String generateNewRandomName() + { + int i = this.rand.nextInt(2) + 3; + String s = ""; + + for (int j = 0; j < i; ++j) + { + if (j > 0) + { + s = s + " "; + } + + s = s + this.namePartsArray[this.rand.nextInt(this.namePartsArray.length)]; + } + + return s; + } + + public void reseedRandomGenerator(long seed) + { + this.rand.setSeed(seed); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EntityDamageSource.java b/Client-1.8.9/src/main/java/net/minecraft/util/EntityDamageSource.java new file mode 100644 index 0000000..8b107e9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EntityDamageSource.java @@ -0,0 +1,47 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class EntityDamageSource extends DamageSource +{ + protected Entity damageSourceEntity; + private boolean isThornsDamage = false; + + public EntityDamageSource(String damageTypeIn, Entity damageSourceEntityIn) + { + super(damageTypeIn); + this.damageSourceEntity = damageSourceEntityIn; + } + + public EntityDamageSource setIsThornsDamage() + { + this.isThornsDamage = true; + return this; + } + + public boolean getIsThornsDamage() + { + return this.isThornsDamage; + } + + public Entity getEntity() + { + return this.damageSourceEntity; + } + + public IChatComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) + { + ItemStack itemstack = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItem() : null; + String s = "death.attack." + this.damageType; + String s1 = s + ".item"; + return itemstack != null && itemstack.hasDisplayName() && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), this.damageSourceEntity.getDisplayName(), itemstack.getChatComponent()}): new ChatComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName(), this.damageSourceEntity.getDisplayName()}); + } + + public boolean isDifficultyScaled() + { + return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLivingBase && !(this.damageSourceEntity instanceof EntityPlayer); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java b/Client-1.8.9/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java new file mode 100644 index 0000000..993e227 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java @@ -0,0 +1,35 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +public class EntityDamageSourceIndirect extends EntityDamageSource +{ + private Entity indirectEntity; + + public EntityDamageSourceIndirect(String damageTypeIn, Entity source, Entity indirectEntityIn) + { + super(damageTypeIn, source); + this.indirectEntity = indirectEntityIn; + } + + public Entity getSourceOfDamage() + { + return this.damageSourceEntity; + } + + public Entity getEntity() + { + return this.indirectEntity; + } + + public IChatComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) + { + IChatComponent ichatcomponent = this.indirectEntity == null ? this.damageSourceEntity.getDisplayName() : this.indirectEntity.getDisplayName(); + ItemStack itemstack = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItem() : null; + String s = "death.attack." + this.damageType; + String s1 = s + ".item"; + return itemstack != null && itemstack.hasDisplayName() && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {entityLivingBaseIn.getDisplayName(), ichatcomponent, itemstack.getChatComponent()}): new ChatComponentTranslation(s, new Object[] {entityLivingBaseIn.getDisplayName(), ichatcomponent}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EntitySelectors.java b/Client-1.8.9/src/main/java/net/minecraft/util/EntitySelectors.java new file mode 100644 index 0000000..74b48cd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EntitySelectors.java @@ -0,0 +1,69 @@ +package net.minecraft.util; + +import com.google.common.base.Predicate; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +public final class EntitySelectors +{ + public static final Predicate selectAnything = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_.isEntityAlive(); + } + }; + public static final Predicate IS_STANDALONE = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_.isEntityAlive() && p_apply_1_.riddenByEntity == null && p_apply_1_.ridingEntity == null; + } + }; + public static final Predicate selectInventories = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return p_apply_1_ instanceof IInventory && p_apply_1_.isEntityAlive(); + } + }; + public static final Predicate NOT_SPECTATING = new Predicate() + { + public boolean apply(Entity p_apply_1_) + { + return !(p_apply_1_ instanceof EntityPlayer) || !((EntityPlayer)p_apply_1_).isSpectator(); + } + }; + + public static class ArmoredMob implements Predicate + { + private final ItemStack armor; + + public ArmoredMob(ItemStack armor) + { + this.armor = armor; + } + + public boolean apply(Entity p_apply_1_) + { + if (!p_apply_1_.isEntityAlive()) + { + return false; + } + else if (!(p_apply_1_ instanceof EntityLivingBase)) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_; + return entitylivingbase.getEquipmentInSlot(EntityLiving.getArmorPosition(this.armor)) != null ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer)); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EnumChatFormatting.java b/Client-1.8.9/src/main/java/net/minecraft/util/EnumChatFormatting.java new file mode 100644 index 0000000..aec5bb2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EnumChatFormatting.java @@ -0,0 +1,159 @@ +package net.minecraft.util; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public enum EnumChatFormatting +{ + BLACK("BLACK", '0', 0), + DARK_BLUE("DARK_BLUE", '1', 1), + DARK_GREEN("DARK_GREEN", '2', 2), + DARK_AQUA("DARK_AQUA", '3', 3), + DARK_RED("DARK_RED", '4', 4), + DARK_PURPLE("DARK_PURPLE", '5', 5), + GOLD("GOLD", '6', 6), + GRAY("GRAY", '7', 7), + DARK_GRAY("DARK_GRAY", '8', 8), + BLUE("BLUE", '9', 9), + GREEN("GREEN", 'a', 10), + AQUA("AQUA", 'b', 11), + RED("RED", 'c', 12), + LIGHT_PURPLE("LIGHT_PURPLE", 'd', 13), + YELLOW("YELLOW", 'e', 14), + WHITE("WHITE", 'f', 15), + OBFUSCATED("OBFUSCATED", 'k', true), + BOLD("BOLD", 'l', true), + STRIKETHROUGH("STRIKETHROUGH", 'm', true), + UNDERLINE("UNDERLINE", 'n', true), + ITALIC("ITALIC", 'o', true), + RESET("RESET", 'r', -1); + + private static final Map nameMapping = Maps.newHashMap(); + private static final Pattern formattingCodePattern = Pattern.compile("(?i)" + '\u00a7' + "[0-9A-FK-OR]"); + + /** + * CheatBreaker - Matches formatting codes that indicate that the client should treat the following text as recolored. + */ + private static final Pattern CBformattingCodePattern = Pattern.compile("(?i)" + '§' + "[0-9A-FR]"); + + private final String name; + private final char formattingCode; + private final boolean fancyStyling; + private final String controlString; + private final int colorIndex; + + private static String func_175745_c(String p_175745_0_) + { + return p_175745_0_.toLowerCase().replaceAll("[^a-z]", ""); + } + + private EnumChatFormatting(String formattingName, char formattingCodeIn, int colorIndex) + { + this(formattingName, formattingCodeIn, false, colorIndex); + } + + private EnumChatFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn) + { + this(formattingName, formattingCodeIn, fancyStylingIn, -1); + } + + private EnumChatFormatting(String formattingName, char formattingCodeIn, boolean fancyStylingIn, int colorIndex) + { + this.name = formattingName; + this.formattingCode = formattingCodeIn; + this.fancyStyling = fancyStylingIn; + this.colorIndex = colorIndex; + this.controlString = "\u00a7" + formattingCodeIn; + } + + public int getColorIndex() + { + return this.colorIndex; + } + + public boolean isFancyStyling() + { + return this.fancyStyling; + } + + public boolean isColor() + { + return !this.fancyStyling && this != RESET; + } + + public String getFriendlyName() + { + return this.name().toLowerCase(); + } + + public String toString() + { + return this.controlString; + } + + public static String getTextWithoutFormattingCodes(String text) + { + return text == null ? null : formattingCodePattern.matcher(text).replaceAll(""); + } + + public static EnumChatFormatting getValueByName(String friendlyName) + { + return friendlyName == null ? null : (EnumChatFormatting)nameMapping.get(func_175745_c(friendlyName)); + } + + public static EnumChatFormatting func_175744_a(int p_175744_0_) + { + if (p_175744_0_ < 0) + { + return RESET; + } + else + { + for (EnumChatFormatting enumchatformatting : values()) + { + if (enumchatformatting.getColorIndex() == p_175744_0_) + { + return enumchatformatting; + } + } + + return null; + } + } + + public static Collection getValidValues(boolean p_96296_0_, boolean p_96296_1_) + { + List list = Lists.newArrayList(); + + for (EnumChatFormatting enumchatformatting : values()) + { + if ((!enumchatformatting.isColor() || p_96296_0_) && (!enumchatformatting.isFancyStyling() || p_96296_1_)) + { + list.add(enumchatformatting.getFriendlyName()); + } + } + + return list; + } + + static { + for (EnumChatFormatting enumchatformatting : values()) + { + nameMapping.put(func_175745_c(enumchatformatting.name), enumchatformatting); + } + } + + public static String formatColor(String input) { + Matcher matcher = CBformattingCodePattern.matcher(input); + String group = ""; + while (matcher.find()) { + group = matcher.group(); + } + return group; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EnumFacing.java b/Client-1.8.9/src/main/java/net/minecraft/util/EnumFacing.java new file mode 100644 index 0000000..82ce801 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EnumFacing.java @@ -0,0 +1,412 @@ +package net.minecraft.util; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.Map; +import java.util.Random; + +public enum EnumFacing implements IStringSerializable +{ + DOWN(0, 1, -1, "down", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.Y, new Vec3i(0, -1, 0)), + UP(1, 0, -1, "up", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.Y, new Vec3i(0, 1, 0)), + NORTH(2, 3, 2, "north", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.Z, new Vec3i(0, 0, -1)), + SOUTH(3, 2, 0, "south", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.Z, new Vec3i(0, 0, 1)), + WEST(4, 5, 1, "west", EnumFacing.AxisDirection.NEGATIVE, EnumFacing.Axis.X, new Vec3i(-1, 0, 0)), + EAST(5, 4, 3, "east", EnumFacing.AxisDirection.POSITIVE, EnumFacing.Axis.X, new Vec3i(1, 0, 0)); + + private final int index; + private final int opposite; + private final int horizontalIndex; + private final String name; + private final EnumFacing.Axis axis; + private final EnumFacing.AxisDirection axisDirection; + private final Vec3i directionVec; + public static final EnumFacing[] VALUES = new EnumFacing[6]; + private static final EnumFacing[] HORIZONTALS = new EnumFacing[4]; + private static final Map NAME_LOOKUP = Maps.newHashMap(); + + private EnumFacing(int indexIn, int oppositeIn, int horizontalIndexIn, String nameIn, EnumFacing.AxisDirection axisDirectionIn, EnumFacing.Axis axisIn, Vec3i directionVecIn) + { + this.index = indexIn; + this.horizontalIndex = horizontalIndexIn; + this.opposite = oppositeIn; + this.name = nameIn; + this.axis = axisIn; + this.axisDirection = axisDirectionIn; + this.directionVec = directionVecIn; + } + + public int getIndex() + { + return this.index; + } + + public int getHorizontalIndex() + { + return this.horizontalIndex; + } + + public EnumFacing.AxisDirection getAxisDirection() + { + return this.axisDirection; + } + + public EnumFacing getOpposite() + { + return VALUES[this.opposite]; + } + + public EnumFacing rotateAround(EnumFacing.Axis axis) + { + switch (axis) + { + case X: + if (this != WEST && this != EAST) + { + return this.rotateX(); + } + + return this; + + case Y: + if (this != UP && this != DOWN) + { + return this.rotateY(); + } + + return this; + + case Z: + if (this != NORTH && this != SOUTH) + { + return this.rotateZ(); + } + + return this; + + default: + throw new IllegalStateException("Unable to get CW facing for axis " + axis); + } + } + + public EnumFacing rotateY() + { + switch (this) + { + case NORTH: + return EAST; + + case EAST: + return SOUTH; + + case SOUTH: + return WEST; + + case WEST: + return NORTH; + + default: + throw new IllegalStateException("Unable to get Y-rotated facing of " + this); + } + } + + private EnumFacing rotateX() + { + switch (this) + { + case NORTH: + return DOWN; + + case EAST: + case WEST: + default: + throw new IllegalStateException("Unable to get X-rotated facing of " + this); + + case SOUTH: + return UP; + + case UP: + return NORTH; + + case DOWN: + return SOUTH; + } + } + + private EnumFacing rotateZ() + { + switch (this) + { + case EAST: + return DOWN; + + case SOUTH: + default: + throw new IllegalStateException("Unable to get Z-rotated facing of " + this); + + case WEST: + return UP; + + case UP: + return EAST; + + case DOWN: + return WEST; + } + } + + public EnumFacing rotateYCCW() + { + switch (this) + { + case NORTH: + return WEST; + + case EAST: + return NORTH; + + case SOUTH: + return EAST; + + case WEST: + return SOUTH; + + default: + throw new IllegalStateException("Unable to get CCW facing of " + this); + } + } + + public int getFrontOffsetX() + { + return this.axis == EnumFacing.Axis.X ? this.axisDirection.getOffset() : 0; + } + + public int getFrontOffsetY() + { + return this.axis == EnumFacing.Axis.Y ? this.axisDirection.getOffset() : 0; + } + + public int getFrontOffsetZ() + { + return this.axis == EnumFacing.Axis.Z ? this.axisDirection.getOffset() : 0; + } + + public String getName2() + { + return this.name; + } + + public EnumFacing.Axis getAxis() + { + return this.axis; + } + + public static EnumFacing byName(String name) + { + return name == null ? null : (EnumFacing)NAME_LOOKUP.get(name.toLowerCase()); + } + + public static EnumFacing getFront(int index) + { + return VALUES[MathHelper.abs_int(index % VALUES.length)]; + } + + public static EnumFacing getHorizontal(int p_176731_0_) + { + return HORIZONTALS[MathHelper.abs_int(p_176731_0_ % HORIZONTALS.length)]; + } + + public static EnumFacing fromAngle(double angle) + { + return getHorizontal(MathHelper.floor_double(angle / 90.0D + 0.5D) & 3); + } + + public static EnumFacing random(Random rand) + { + return values()[rand.nextInt(values().length)]; + } + + public static EnumFacing getFacingFromVector(float p_176737_0_, float p_176737_1_, float p_176737_2_) + { + EnumFacing enumfacing = NORTH; + float f = Float.MIN_VALUE; + + for (EnumFacing enumfacing1 : values()) + { + float f1 = p_176737_0_ * (float)enumfacing1.directionVec.getX() + p_176737_1_ * (float)enumfacing1.directionVec.getY() + p_176737_2_ * (float)enumfacing1.directionVec.getZ(); + + if (f1 > f) + { + f = f1; + enumfacing = enumfacing1; + } + } + + return enumfacing; + } + + public String toString() + { + return this.name; + } + + public String getName() + { + return this.name; + } + + public static EnumFacing getFacingFromAxis(EnumFacing.AxisDirection p_181076_0_, EnumFacing.Axis p_181076_1_) + { + for (EnumFacing enumfacing : values()) + { + if (enumfacing.getAxisDirection() == p_181076_0_ && enumfacing.getAxis() == p_181076_1_) + { + return enumfacing; + } + } + + throw new IllegalArgumentException("No such direction: " + p_181076_0_ + " " + p_181076_1_); + } + + public Vec3i getDirectionVec() + { + return this.directionVec; + } + + static { + for (EnumFacing enumfacing : values()) + { + VALUES[enumfacing.index] = enumfacing; + + if (enumfacing.getAxis().isHorizontal()) + { + HORIZONTALS[enumfacing.horizontalIndex] = enumfacing; + } + + NAME_LOOKUP.put(enumfacing.getName2().toLowerCase(), enumfacing); + } + } + + public static enum Axis implements Predicate, IStringSerializable { + X("x", EnumFacing.Plane.HORIZONTAL), + Y("y", EnumFacing.Plane.VERTICAL), + Z("z", EnumFacing.Plane.HORIZONTAL); + + private static final Map NAME_LOOKUP = Maps.newHashMap(); + private final String name; + private final EnumFacing.Plane plane; + + private Axis(String name, EnumFacing.Plane plane) + { + this.name = name; + this.plane = plane; + } + + public static EnumFacing.Axis byName(String name) + { + return name == null ? null : (EnumFacing.Axis)NAME_LOOKUP.get(name.toLowerCase()); + } + + public String getName2() + { + return this.name; + } + + public boolean isVertical() + { + return this.plane == EnumFacing.Plane.VERTICAL; + } + + public boolean isHorizontal() + { + return this.plane == EnumFacing.Plane.HORIZONTAL; + } + + public String toString() + { + return this.name; + } + + public boolean apply(EnumFacing p_apply_1_) + { + return p_apply_1_ != null && p_apply_1_.getAxis() == this; + } + + public EnumFacing.Plane getPlane() + { + return this.plane; + } + + public String getName() + { + return this.name; + } + + static { + for (EnumFacing.Axis enumfacing$axis : values()) + { + NAME_LOOKUP.put(enumfacing$axis.getName2().toLowerCase(), enumfacing$axis); + } + } + } + + public static enum AxisDirection { + POSITIVE(1, "Towards positive"), + NEGATIVE(-1, "Towards negative"); + + private final int offset; + private final String description; + + private AxisDirection(int offset, String description) + { + this.offset = offset; + this.description = description; + } + + public int getOffset() + { + return this.offset; + } + + public String toString() + { + return this.description; + } + } + + public static enum Plane implements Predicate, Iterable { + HORIZONTAL, + VERTICAL; + + public EnumFacing[] facings() + { + switch (this) + { + case HORIZONTAL: + return new EnumFacing[] {EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST}; + case VERTICAL: + return new EnumFacing[] {EnumFacing.UP, EnumFacing.DOWN}; + default: + throw new Error("Someone\'s been tampering with the universe!"); + } + } + + public EnumFacing random(Random rand) + { + EnumFacing[] aenumfacing = this.facings(); + return aenumfacing[rand.nextInt(aenumfacing.length)]; + } + + public boolean apply(EnumFacing p_apply_1_) + { + return p_apply_1_ != null && p_apply_1_.getAxis().getPlane() == this; + } + + public Iterator iterator() + { + return Iterators.forArray(this.facings()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EnumParticleTypes.java b/Client-1.8.9/src/main/java/net/minecraft/util/EnumParticleTypes.java new file mode 100644 index 0000000..8cf32e3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EnumParticleTypes.java @@ -0,0 +1,123 @@ +package net.minecraft.util; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; + +public enum EnumParticleTypes +{ + EXPLOSION_NORMAL("explode", 0, true), + EXPLOSION_LARGE("largeexplode", 1, true), + EXPLOSION_HUGE("hugeexplosion", 2, true), + FIREWORKS_SPARK("fireworksSpark", 3, false), + WATER_BUBBLE("bubble", 4, false), + WATER_SPLASH("splash", 5, false), + WATER_WAKE("wake", 6, false), + SUSPENDED("suspended", 7, false), + SUSPENDED_DEPTH("depthsuspend", 8, false), + CRIT("crit", 9, false), + CRIT_MAGIC("magicCrit", 10, false), + SMOKE_NORMAL("smoke", 11, false), + SMOKE_LARGE("largesmoke", 12, false), + SPELL("spell", 13, false), + SPELL_INSTANT("instantSpell", 14, false), + SPELL_MOB("mobSpell", 15, false), + SPELL_MOB_AMBIENT("mobSpellAmbient", 16, false), + SPELL_WITCH("witchMagic", 17, false), + DRIP_WATER("dripWater", 18, false), + DRIP_LAVA("dripLava", 19, false), + VILLAGER_ANGRY("angryVillager", 20, false), + VILLAGER_HAPPY("happyVillager", 21, false), + TOWN_AURA("townaura", 22, false), + NOTE("note", 23, false), + PORTAL("portal", 24, false), + ENCHANTMENT_TABLE("enchantmenttable", 25, false), + FLAME("flame", 26, false), + LAVA("lava", 27, false), + FOOTSTEP("footstep", 28, false), + CLOUD("cloud", 29, false), + REDSTONE("reddust", 30, false), + SNOWBALL("snowballpoof", 31, false), + SNOW_SHOVEL("snowshovel", 32, false), + SLIME("slime", 33, false), + HEART("heart", 34, false), + BARRIER("barrier", 35, false), + ITEM_CRACK("iconcrack_", 36, false, 2), + BLOCK_CRACK("blockcrack_", 37, false, 1), + BLOCK_DUST("blockdust_", 38, false, 1), + WATER_DROP("droplet", 39, false), + ITEM_TAKE("take", 40, false), + MOB_APPEARANCE("mobappearance", 41, true); + + private final String particleName; + private final int particleID; + private final boolean shouldIgnoreRange; + private final int argumentCount; + private static final Map PARTICLES = Maps.newHashMap(); + private static final String[] PARTICLE_NAMES; + + private EnumParticleTypes(String particleNameIn, int particleIDIn, boolean p_i46011_5_, int argumentCountIn) + { + this.particleName = particleNameIn; + this.particleID = particleIDIn; + this.shouldIgnoreRange = p_i46011_5_; + this.argumentCount = argumentCountIn; + } + + private EnumParticleTypes(String particleNameIn, int particleIDIn, boolean p_i46012_5_) + { + this(particleNameIn, particleIDIn, p_i46012_5_, 0); + } + + public static String[] getParticleNames() + { + return PARTICLE_NAMES; + } + + public String getParticleName() + { + return this.particleName; + } + + public int getParticleID() + { + return this.particleID; + } + + public int getArgumentCount() + { + return this.argumentCount; + } + + public boolean getShouldIgnoreRange() + { + return this.shouldIgnoreRange; + } + + public boolean hasArguments() + { + return this.argumentCount > 0; + } + + public static EnumParticleTypes getParticleFromId(int particleId) + { + return (EnumParticleTypes)PARTICLES.get(Integer.valueOf(particleId)); + } + + static { + List list = Lists.newArrayList(); + + for (EnumParticleTypes enumparticletypes : values()) + { + PARTICLES.put(Integer.valueOf(enumparticletypes.getParticleID()), enumparticletypes); + + if (!enumparticletypes.getParticleName().endsWith("_")) + { + list.add(enumparticletypes.getParticleName()); + } + } + + PARTICLE_NAMES = (String[])list.toArray(new String[list.size()]); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EnumTypeAdapterFactory.java b/Client-1.8.9/src/main/java/net/minecraft/util/EnumTypeAdapterFactory.java new file mode 100644 index 0000000..5276922 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EnumTypeAdapterFactory.java @@ -0,0 +1,67 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonToken; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Locale; +import java.util.Map; + +public class EnumTypeAdapterFactory implements TypeAdapterFactory +{ + public TypeAdapter create(Gson p_create_1_, TypeToken p_create_2_) + { + Class oclass = (Class)p_create_2_.getRawType(); + + if (!oclass.isEnum()) + { + return null; + } + else + { + final Map map = Maps.newHashMap(); + + for (T t : oclass.getEnumConstants()) + { + map.put(this.func_151232_a(t), t); + } + + return new TypeAdapter() + { + public void write(JsonWriter p_write_1_, T p_write_2_) throws IOException + { + if (p_write_2_ == null) + { + p_write_1_.nullValue(); + } + else + { + p_write_1_.value(EnumTypeAdapterFactory.this.func_151232_a(p_write_2_)); + } + } + public T read(JsonReader p_read_1_) throws IOException + { + if (p_read_1_.peek() == JsonToken.NULL) + { + p_read_1_.nextNull(); + return (T)null; + } + else + { + return (T)map.get(p_read_1_.nextString()); + } + } + }; + } + } + + private String func_151232_a(Object p_151232_1_) + { + return p_151232_1_ instanceof Enum ? ((Enum)p_151232_1_).name().toLowerCase(Locale.US) : p_151232_1_.toString().toLowerCase(Locale.US); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/EnumWorldBlockLayer.java b/Client-1.8.9/src/main/java/net/minecraft/util/EnumWorldBlockLayer.java new file mode 100644 index 0000000..8b19104 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/EnumWorldBlockLayer.java @@ -0,0 +1,21 @@ +package net.minecraft.util; + +public enum EnumWorldBlockLayer +{ + SOLID("Solid"), + CUTOUT_MIPPED("Mipped Cutout"), + CUTOUT("Cutout"), + TRANSLUCENT("Translucent"); + + private final String layerName; + + private EnumWorldBlockLayer(String layerNameIn) + { + this.layerName = layerNameIn; + } + + public String toString() + { + return this.layerName; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/FoodStats.java b/Client-1.8.9/src/main/java/net/minecraft/util/FoodStats.java new file mode 100644 index 0000000..84ff916 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/FoodStats.java @@ -0,0 +1,131 @@ +package net.minecraft.util; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.EnumDifficulty; + +public class FoodStats +{ + private int foodLevel = 20; + private float foodSaturationLevel = 5.0F; + private float foodExhaustionLevel; + private int foodTimer; + private int prevFoodLevel = 20; + + public void addStats(int foodLevelIn, float foodSaturationModifier) + { + this.foodLevel = Math.min(foodLevelIn + this.foodLevel, 20); + this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)foodLevelIn * foodSaturationModifier * 2.0F, (float)this.foodLevel); + } + + public void addStats(ItemFood foodItem, ItemStack p_151686_2_) + { + this.addStats(foodItem.getHealAmount(p_151686_2_), foodItem.getSaturationModifier(p_151686_2_)); + } + + public void onUpdate(EntityPlayer player) + { + EnumDifficulty enumdifficulty = player.worldObj.getDifficulty(); + this.prevFoodLevel = this.foodLevel; + + if (this.foodExhaustionLevel > 4.0F) + { + this.foodExhaustionLevel -= 4.0F; + + if (this.foodSaturationLevel > 0.0F) + { + this.foodSaturationLevel = Math.max(this.foodSaturationLevel - 1.0F, 0.0F); + } + else if (enumdifficulty != EnumDifficulty.PEACEFUL) + { + this.foodLevel = Math.max(this.foodLevel - 1, 0); + } + } + + if (player.worldObj.getGameRules().getBoolean("naturalRegeneration") && this.foodLevel >= 18 && player.shouldHeal()) + { + ++this.foodTimer; + + if (this.foodTimer >= 80) + { + player.heal(1.0F); + this.addExhaustion(3.0F); + this.foodTimer = 0; + } + } + else if (this.foodLevel <= 0) + { + ++this.foodTimer; + + if (this.foodTimer >= 80) + { + if (player.getHealth() > 10.0F || enumdifficulty == EnumDifficulty.HARD || player.getHealth() > 1.0F && enumdifficulty == EnumDifficulty.NORMAL) + { + player.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.foodTimer = 0; + } + } + else + { + this.foodTimer = 0; + } + } + + public void readNBT(NBTTagCompound p_75112_1_) + { + if (p_75112_1_.hasKey("foodLevel", 99)) + { + this.foodLevel = p_75112_1_.getInteger("foodLevel"); + this.foodTimer = p_75112_1_.getInteger("foodTickTimer"); + this.foodSaturationLevel = p_75112_1_.getFloat("foodSaturationLevel"); + this.foodExhaustionLevel = p_75112_1_.getFloat("foodExhaustionLevel"); + } + } + + public void writeNBT(NBTTagCompound p_75117_1_) + { + p_75117_1_.setInteger("foodLevel", this.foodLevel); + p_75117_1_.setInteger("foodTickTimer", this.foodTimer); + p_75117_1_.setFloat("foodSaturationLevel", this.foodSaturationLevel); + p_75117_1_.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); + } + + public int getFoodLevel() + { + return this.foodLevel; + } + + public int getPrevFoodLevel() + { + return this.prevFoodLevel; + } + + public boolean needFood() + { + return this.foodLevel < 20; + } + + public void addExhaustion(float p_75113_1_) + { + this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + p_75113_1_, 40.0F); + } + + public float getSaturationLevel() + { + return this.foodSaturationLevel; + } + + public void setFoodLevel(int foodLevelIn) + { + this.foodLevel = foodLevelIn; + } + + public void setFoodSaturationLevel(float foodSaturationLevelIn) + { + this.foodSaturationLevel = foodSaturationLevelIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/FrameTimer.java b/Client-1.8.9/src/main/java/net/minecraft/util/FrameTimer.java new file mode 100644 index 0000000..9590c4c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/FrameTimer.java @@ -0,0 +1,56 @@ +package net.minecraft.util; + +public class FrameTimer +{ + private final long[] frames = new long[240]; + private int lastIndex; + private int counter; + private int index; + + public void addFrame(long runningTime) + { + this.frames[this.index] = runningTime; + ++this.index; + + if (this.index == 240) + { + this.index = 0; + } + + if (this.counter < 240) + { + this.lastIndex = 0; + ++this.counter; + } + else + { + this.lastIndex = this.parseIndex(this.index + 1); + } + } + + public int getLagometerValue(long time, int multiplier) + { + double d0 = (double)time / 1.6666666E7D; + return (int)(d0 * (double)multiplier); + } + + public int getLastIndex() + { + return this.lastIndex; + } + + public int getIndex() + { + return this.index; + } + + public int parseIndex(int rawIndex) + { + return rawIndex % 240; + } + + public long[] getFrames() + { + return this.frames; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/HttpUtil.java b/Client-1.8.9/src/main/java/net/minecraft/util/HttpUtil.java new file mode 100644 index 0000000..9412fc1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/HttpUtil.java @@ -0,0 +1,328 @@ +package net.minecraft.util; + +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.Proxy; +import java.net.ServerSocket; +import java.net.URL; +import java.net.URLEncoder; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicInteger; +import net.minecraft.server.MinecraftServer; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class HttpUtil +{ + public static final ListeningExecutorService field_180193_a = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool((new ThreadFactoryBuilder()).setDaemon(true).setNameFormat("Downloader %d").build())); + private static final AtomicInteger downloadThreadsStarted = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + + public static String buildPostString(Map data) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (Entry entry : data.entrySet()) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append('&'); + } + + try + { + stringbuilder.append(URLEncoder.encode((String)entry.getKey(), "UTF-8")); + } + catch (UnsupportedEncodingException unsupportedencodingexception1) + { + unsupportedencodingexception1.printStackTrace(); + } + + if (entry.getValue() != null) + { + stringbuilder.append('='); + + try + { + stringbuilder.append(URLEncoder.encode(entry.getValue().toString(), "UTF-8")); + } + catch (UnsupportedEncodingException unsupportedencodingexception) + { + unsupportedencodingexception.printStackTrace(); + } + } + } + + return stringbuilder.toString(); + } + + public static String postMap(URL url, Map data, boolean skipLoggingErrors) + { + return post(url, buildPostString(data), skipLoggingErrors); + } + + private static String post(URL url, String content, boolean skipLoggingErrors) + { + try + { + Proxy proxy = MinecraftServer.getServer() == null ? null : MinecraftServer.getServer().getServerProxy(); + + if (proxy == null) + { + proxy = Proxy.NO_PROXY; + } + + HttpURLConnection httpurlconnection = (HttpURLConnection)url.openConnection(proxy); + httpurlconnection.setRequestMethod("POST"); + httpurlconnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + httpurlconnection.setRequestProperty("Content-Length", "" + content.getBytes().length); + httpurlconnection.setRequestProperty("Content-Language", "en-US"); + httpurlconnection.setUseCaches(false); + httpurlconnection.setDoInput(true); + httpurlconnection.setDoOutput(true); + DataOutputStream dataoutputstream = new DataOutputStream(httpurlconnection.getOutputStream()); + dataoutputstream.writeBytes(content); + dataoutputstream.flush(); + dataoutputstream.close(); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(httpurlconnection.getInputStream())); + StringBuffer stringbuffer = new StringBuffer(); + String s; + + while ((s = bufferedreader.readLine()) != null) + { + stringbuffer.append(s); + stringbuffer.append('\r'); + } + + bufferedreader.close(); + return stringbuffer.toString(); + } + catch (Exception exception) + { + if (!skipLoggingErrors) + { + logger.error((String)("Could not post to " + url), (Throwable)exception); + } + + return ""; + } + } + + public static ListenableFuture downloadResourcePack(final File saveFile, final String packUrl, final Map p_180192_2_, final int maxSize, final IProgressUpdate p_180192_4_, final Proxy p_180192_5_) + { + ListenableFuture listenablefuture = field_180193_a.submit(new Runnable() + { + public void run() + { + HttpURLConnection httpurlconnection = null; + InputStream inputstream = null; + OutputStream outputstream = null; + + if (p_180192_4_ != null) + { + p_180192_4_.resetProgressAndMessage("Downloading Resource Pack"); + p_180192_4_.displayLoadingString("Making Request..."); + } + + try + { + try + { + byte[] abyte = new byte[4096]; + URL url = new URL(packUrl); + httpurlconnection = (HttpURLConnection)url.openConnection(p_180192_5_); + float f = 0.0F; + float f1 = (float)p_180192_2_.entrySet().size(); + + for (Entry entry : p_180192_2_.entrySet()) + { + httpurlconnection.setRequestProperty((String)entry.getKey(), (String)entry.getValue()); + + if (p_180192_4_ != null) + { + p_180192_4_.setLoadingProgress((int)(++f / f1 * 100.0F)); + } + } + + inputstream = httpurlconnection.getInputStream(); + f1 = (float)httpurlconnection.getContentLength(); + int i = httpurlconnection.getContentLength(); + + if (p_180192_4_ != null) + { + p_180192_4_.displayLoadingString(String.format("Downloading file (%.2f MB)...", new Object[] {Float.valueOf(f1 / 1000.0F / 1000.0F)})); + } + + if (saveFile.exists()) + { + long j = saveFile.length(); + + if (j == (long)i) + { + if (p_180192_4_ != null) + { + p_180192_4_.setDoneWorking(); + } + + return; + } + + HttpUtil.logger.warn("Deleting " + saveFile + " as it does not match what we currently have (" + i + " vs our " + j + ")."); + FileUtils.deleteQuietly(saveFile); + } + else if (saveFile.getParentFile() != null) + { + saveFile.getParentFile().mkdirs(); + } + + outputstream = new DataOutputStream(new FileOutputStream(saveFile)); + + if (maxSize > 0 && f1 > (float)maxSize) + { + if (p_180192_4_ != null) + { + p_180192_4_.setDoneWorking(); + } + + throw new IOException("Filesize is bigger than maximum allowed (file is " + f + ", limit is " + maxSize + ")"); + } + + int k = 0; + + while ((k = inputstream.read(abyte)) >= 0) + { + f += (float)k; + + if (p_180192_4_ != null) + { + p_180192_4_.setLoadingProgress((int)(f / f1 * 100.0F)); + } + + if (maxSize > 0 && f > (float)maxSize) + { + if (p_180192_4_ != null) + { + p_180192_4_.setDoneWorking(); + } + + throw new IOException("Filesize was bigger than maximum allowed (got >= " + f + ", limit was " + maxSize + ")"); + } + + if (Thread.interrupted()) + { + HttpUtil.logger.error("INTERRUPTED"); + + if (p_180192_4_ != null) + { + p_180192_4_.setDoneWorking(); + } + + return; + } + + outputstream.write(abyte, 0, k); + } + + if (p_180192_4_ != null) + { + p_180192_4_.setDoneWorking(); + return; + } + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + + if (httpurlconnection != null) + { + InputStream inputstream1 = httpurlconnection.getErrorStream(); + + try + { + HttpUtil.logger.error(IOUtils.toString(inputstream1)); + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + if (p_180192_4_ != null) + { + p_180192_4_.setDoneWorking(); + return; + } + } + } + finally + { + IOUtils.closeQuietly(inputstream); + IOUtils.closeQuietly(outputstream); + } + } + }); + return (ListenableFuture) listenablefuture; + } + + public static int getSuitableLanPort() throws IOException + { + ServerSocket serversocket = null; + int i = -1; + + try + { + serversocket = new ServerSocket(0); + i = serversocket.getLocalPort(); + } + finally + { + try + { + if (serversocket != null) + { + serversocket.close(); + } + } + catch (IOException var8) + { + ; + } + } + + return i; + } + + public static String get(URL url) throws IOException + { + HttpURLConnection httpurlconnection = (HttpURLConnection)url.openConnection(); + httpurlconnection.setRequestMethod("GET"); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(httpurlconnection.getInputStream())); + StringBuilder stringbuilder = new StringBuilder(); + String s; + + while ((s = bufferedreader.readLine()) != null) + { + stringbuilder.append(s); + stringbuilder.append('\r'); + } + + bufferedreader.close(); + return stringbuilder.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IChatComponent.java b/Client-1.8.9/src/main/java/net/minecraft/util/IChatComponent.java new file mode 100644 index 0000000..d41c7e8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IChatComponent.java @@ -0,0 +1,275 @@ +package net.minecraft.util; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Map.Entry; + +public interface IChatComponent extends Iterable +{ + IChatComponent setChatStyle(ChatStyle style); + + ChatStyle getChatStyle(); + + IChatComponent appendText(String text); + + IChatComponent appendSibling(IChatComponent component); + + String getUnformattedTextForChat(); + + String getUnformattedText(); + + String getFormattedText(); + + List getSiblings(); + + IChatComponent createCopy(); + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + private static final Gson GSON; + + public IChatComponent deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + if (p_deserialize_1_.isJsonPrimitive()) + { + return new ChatComponentText(p_deserialize_1_.getAsString()); + } + else if (!p_deserialize_1_.isJsonObject()) + { + if (p_deserialize_1_.isJsonArray()) + { + JsonArray jsonarray1 = p_deserialize_1_.getAsJsonArray(); + IChatComponent ichatcomponent1 = null; + + for (JsonElement jsonelement : jsonarray1) + { + IChatComponent ichatcomponent2 = this.deserialize(jsonelement, jsonelement.getClass(), p_deserialize_3_); + + if (ichatcomponent1 == null) + { + ichatcomponent1 = ichatcomponent2; + } + else + { + ichatcomponent1.appendSibling(ichatcomponent2); + } + } + + return ichatcomponent1; + } + else + { + throw new JsonParseException("Don\'t know how to turn " + p_deserialize_1_.toString() + " into a Component"); + } + } + else + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + IChatComponent ichatcomponent; + + if (jsonobject.has("text")) + { + ichatcomponent = new ChatComponentText(jsonobject.get("text").getAsString()); + } + else if (jsonobject.has("translate")) + { + String s = jsonobject.get("translate").getAsString(); + + if (jsonobject.has("with")) + { + JsonArray jsonarray = jsonobject.getAsJsonArray("with"); + Object[] aobject = new Object[jsonarray.size()]; + + for (int i = 0; i < aobject.length; ++i) + { + aobject[i] = this.deserialize(jsonarray.get(i), p_deserialize_2_, p_deserialize_3_); + + if (aobject[i] instanceof ChatComponentText) + { + ChatComponentText chatcomponenttext = (ChatComponentText)aobject[i]; + + if (chatcomponenttext.getChatStyle().isEmpty() && chatcomponenttext.getSiblings().isEmpty()) + { + aobject[i] = chatcomponenttext.getChatComponentText_TextValue(); + } + } + } + + ichatcomponent = new ChatComponentTranslation(s, aobject); + } + else + { + ichatcomponent = new ChatComponentTranslation(s, new Object[0]); + } + } + else if (jsonobject.has("score")) + { + JsonObject jsonobject1 = jsonobject.getAsJsonObject("score"); + + if (!jsonobject1.has("name") || !jsonobject1.has("objective")) + { + throw new JsonParseException("A score component needs a least a name and an objective"); + } + + ichatcomponent = new ChatComponentScore(JsonUtils.getString(jsonobject1, "name"), JsonUtils.getString(jsonobject1, "objective")); + + if (jsonobject1.has("value")) + { + ((ChatComponentScore)ichatcomponent).setValue(JsonUtils.getString(jsonobject1, "value")); + } + } + else + { + if (!jsonobject.has("selector")) + { + throw new JsonParseException("Don\'t know how to turn " + p_deserialize_1_.toString() + " into a Component"); + } + + ichatcomponent = new ChatComponentSelector(JsonUtils.getString(jsonobject, "selector")); + } + + if (jsonobject.has("extra")) + { + JsonArray jsonarray2 = jsonobject.getAsJsonArray("extra"); + + if (jsonarray2.size() <= 0) + { + throw new JsonParseException("Unexpected empty array of components"); + } + + for (int j = 0; j < jsonarray2.size(); ++j) + { + ichatcomponent.appendSibling(this.deserialize(jsonarray2.get(j), p_deserialize_2_, p_deserialize_3_)); + } + } + + ichatcomponent.setChatStyle((ChatStyle)p_deserialize_3_.deserialize(p_deserialize_1_, ChatStyle.class)); + return ichatcomponent; + } + } + + private void serializeChatStyle(ChatStyle style, JsonObject object, JsonSerializationContext ctx) + { + JsonElement jsonelement = ctx.serialize(style); + + if (jsonelement.isJsonObject()) + { + JsonObject jsonobject = (JsonObject)jsonelement; + + for (Entry entry : jsonobject.entrySet()) + { + object.add((String)entry.getKey(), (JsonElement)entry.getValue()); + } + } + } + + public JsonElement serialize(IChatComponent p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + if (p_serialize_1_ instanceof ChatComponentText && p_serialize_1_.getChatStyle().isEmpty() && p_serialize_1_.getSiblings().isEmpty()) + { + return new JsonPrimitive(((ChatComponentText)p_serialize_1_).getChatComponentText_TextValue()); + } + else + { + JsonObject jsonobject = new JsonObject(); + + if (!p_serialize_1_.getChatStyle().isEmpty()) + { + this.serializeChatStyle(p_serialize_1_.getChatStyle(), jsonobject, p_serialize_3_); + } + + if (!p_serialize_1_.getSiblings().isEmpty()) + { + JsonArray jsonarray = new JsonArray(); + + for (IChatComponent ichatcomponent : p_serialize_1_.getSiblings()) + { + jsonarray.add(this.serialize((IChatComponent)ichatcomponent, ichatcomponent.getClass(), p_serialize_3_)); + } + + jsonobject.add("extra", jsonarray); + } + + if (p_serialize_1_ instanceof ChatComponentText) + { + jsonobject.addProperty("text", ((ChatComponentText)p_serialize_1_).getChatComponentText_TextValue()); + } + else if (p_serialize_1_ instanceof ChatComponentTranslation) + { + ChatComponentTranslation chatcomponenttranslation = (ChatComponentTranslation)p_serialize_1_; + jsonobject.addProperty("translate", chatcomponenttranslation.getKey()); + + if (chatcomponenttranslation.getFormatArgs() != null && chatcomponenttranslation.getFormatArgs().length > 0) + { + JsonArray jsonarray1 = new JsonArray(); + + for (Object object : chatcomponenttranslation.getFormatArgs()) + { + if (object instanceof IChatComponent) + { + jsonarray1.add(this.serialize((IChatComponent)((IChatComponent)object), object.getClass(), p_serialize_3_)); + } + else + { + jsonarray1.add(new JsonPrimitive(String.valueOf(object))); + } + } + + jsonobject.add("with", jsonarray1); + } + } + else if (p_serialize_1_ instanceof ChatComponentScore) + { + ChatComponentScore chatcomponentscore = (ChatComponentScore)p_serialize_1_; + JsonObject jsonobject1 = new JsonObject(); + jsonobject1.addProperty("name", chatcomponentscore.getName()); + jsonobject1.addProperty("objective", chatcomponentscore.getObjective()); + jsonobject1.addProperty("value", chatcomponentscore.getUnformattedTextForChat()); + jsonobject.add("score", jsonobject1); + } + else + { + if (!(p_serialize_1_ instanceof ChatComponentSelector)) + { + throw new IllegalArgumentException("Don\'t know how to serialize " + p_serialize_1_ + " as a Component"); + } + + ChatComponentSelector chatcomponentselector = (ChatComponentSelector)p_serialize_1_; + jsonobject.addProperty("selector", chatcomponentselector.getSelector()); + } + + return jsonobject; + } + } + + public static String componentToJson(IChatComponent component) + { + return GSON.toJson((Object)component); + } + + public static IChatComponent jsonToComponent(String json) + { + return (IChatComponent)GSON.fromJson(json, IChatComponent.class); + } + + static + { + GsonBuilder gsonbuilder = new GsonBuilder(); + gsonbuilder.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()); + gsonbuilder.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()); + gsonbuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); + GSON = gsonbuilder.create(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IJsonSerializable.java b/Client-1.8.9/src/main/java/net/minecraft/util/IJsonSerializable.java new file mode 100644 index 0000000..bb480ca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IJsonSerializable.java @@ -0,0 +1,10 @@ +package net.minecraft.util; + +import com.google.gson.JsonElement; + +public interface IJsonSerializable +{ + void fromJson(JsonElement json); + + JsonElement getSerializableElement(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IObjectIntIterable.java b/Client-1.8.9/src/main/java/net/minecraft/util/IObjectIntIterable.java new file mode 100644 index 0000000..35172e5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IObjectIntIterable.java @@ -0,0 +1,5 @@ +package net.minecraft.util; + +public interface IObjectIntIterable extends Iterable +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IProgressUpdate.java b/Client-1.8.9/src/main/java/net/minecraft/util/IProgressUpdate.java new file mode 100644 index 0000000..1e32c8e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IProgressUpdate.java @@ -0,0 +1,14 @@ +package net.minecraft.util; + +public interface IProgressUpdate +{ + void displaySavingString(String message); + + void resetProgressAndMessage(String message); + + void displayLoadingString(String message); + + void setLoadingProgress(int progress); + + void setDoneWorking(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IRegistry.java b/Client-1.8.9/src/main/java/net/minecraft/util/IRegistry.java new file mode 100644 index 0000000..5ff1f92 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IRegistry.java @@ -0,0 +1,8 @@ +package net.minecraft.util; + +public interface IRegistry extends Iterable +{ + V getObject(K name); + + void putObject(K key, V value); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IStringSerializable.java b/Client-1.8.9/src/main/java/net/minecraft/util/IStringSerializable.java new file mode 100644 index 0000000..bffc686 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IStringSerializable.java @@ -0,0 +1,6 @@ +package net.minecraft.util; + +public interface IStringSerializable +{ + String getName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IThreadListener.java b/Client-1.8.9/src/main/java/net/minecraft/util/IThreadListener.java new file mode 100644 index 0000000..9b9703e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IThreadListener.java @@ -0,0 +1,10 @@ +package net.minecraft.util; + +import com.google.common.util.concurrent.ListenableFuture; + +public interface IThreadListener +{ + ListenableFuture addScheduledTask(Runnable runnableToSchedule); + + boolean isCallingFromMinecraftThread(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ITickable.java b/Client-1.8.9/src/main/java/net/minecraft/util/ITickable.java new file mode 100644 index 0000000..dd5c9de --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ITickable.java @@ -0,0 +1,6 @@ +package net.minecraft.util; + +public interface ITickable +{ + void update(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IntHashMap.java b/Client-1.8.9/src/main/java/net/minecraft/util/IntHashMap.java new file mode 100644 index 0000000..62de7f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IntHashMap.java @@ -0,0 +1,246 @@ +package net.minecraft.util; + +public class IntHashMap +{ + private transient IntHashMap.Entry[] slots = new IntHashMap.Entry[16]; + private transient int count; + private int threshold = 12; + private final float growFactor = 0.75F; + + private static int computeHash(int integer) + { + integer = integer ^ integer >>> 20 ^ integer >>> 12; + return integer ^ integer >>> 7 ^ integer >>> 4; + } + + private static int getSlotIndex(int hash, int slotCount) + { + return hash & slotCount - 1; + } + + public V lookup(int p_76041_1_) + { + int i = computeHash(p_76041_1_); + + for (IntHashMap.Entry entry = this.slots[getSlotIndex(i, this.slots.length)]; entry != null; entry = entry.nextEntry) + { + if (entry.hashEntry == p_76041_1_) + { + return entry.valueEntry; + } + } + + return (V)null; + } + + public boolean containsItem(int p_76037_1_) + { + return this.lookupEntry(p_76037_1_) != null; + } + + final IntHashMap.Entry lookupEntry(int p_76045_1_) + { + int i = computeHash(p_76045_1_); + + for (IntHashMap.Entry entry = this.slots[getSlotIndex(i, this.slots.length)]; entry != null; entry = entry.nextEntry) + { + if (entry.hashEntry == p_76045_1_) + { + return entry; + } + } + + return null; + } + + public void addKey(int p_76038_1_, V p_76038_2_) + { + int i = computeHash(p_76038_1_); + int j = getSlotIndex(i, this.slots.length); + + for (IntHashMap.Entry entry = this.slots[j]; entry != null; entry = entry.nextEntry) + { + if (entry.hashEntry == p_76038_1_) + { + entry.valueEntry = p_76038_2_; + return; + } + } + + this.insert(i, p_76038_1_, p_76038_2_, j); + } + + private void grow(int p_76047_1_) + { + IntHashMap.Entry[] entry = this.slots; + int i = entry.length; + + if (i == 1073741824) + { + this.threshold = Integer.MAX_VALUE; + } + else + { + IntHashMap.Entry[] entry1 = new IntHashMap.Entry[p_76047_1_]; + this.copyTo(entry1); + this.slots = entry1; + this.threshold = (int)((float)p_76047_1_ * this.growFactor); + } + } + + private void copyTo(IntHashMap.Entry[] p_76048_1_) + { + IntHashMap.Entry[] entry = this.slots; + int i = p_76048_1_.length; + + for (int j = 0; j < entry.length; ++j) + { + IntHashMap.Entry entry1 = entry[j]; + + if (entry1 != null) + { + entry[j] = null; + + while (true) + { + IntHashMap.Entry entry2 = entry1.nextEntry; + int k = getSlotIndex(entry1.slotHash, i); + entry1.nextEntry = p_76048_1_[k]; + p_76048_1_[k] = entry1; + entry1 = entry2; + + if (entry2 == null) + { + break; + } + } + } + } + } + + public V removeObject(int p_76049_1_) + { + IntHashMap.Entry entry = this.removeEntry(p_76049_1_); + return (V)(entry == null ? null : entry.valueEntry); + } + + final IntHashMap.Entry removeEntry(int p_76036_1_) + { + int i = computeHash(p_76036_1_); + int j = getSlotIndex(i, this.slots.length); + IntHashMap.Entry entry = this.slots[j]; + IntHashMap.Entry entry1; + IntHashMap.Entry entry2; + + for (entry1 = entry; entry1 != null; entry1 = entry2) + { + entry2 = entry1.nextEntry; + + if (entry1.hashEntry == p_76036_1_) + { + --this.count; + + if (entry == entry1) + { + this.slots[j] = entry2; + } + else + { + entry.nextEntry = entry2; + } + + return entry1; + } + + entry = entry1; + } + + return entry1; + } + + public void clearMap() + { + IntHashMap.Entry[] entry = this.slots; + + for (int i = 0; i < entry.length; ++i) + { + entry[i] = null; + } + + this.count = 0; + } + + private void insert(int p_76040_1_, int p_76040_2_, V p_76040_3_, int p_76040_4_) + { + IntHashMap.Entry entry = this.slots[p_76040_4_]; + this.slots[p_76040_4_] = new IntHashMap.Entry(p_76040_1_, p_76040_2_, p_76040_3_, entry); + + if (this.count++ >= this.threshold) + { + this.grow(2 * this.slots.length); + } + } + + static class Entry + { + final int hashEntry; + V valueEntry; + IntHashMap.Entry nextEntry; + final int slotHash; + + Entry(int p_i1552_1_, int p_i1552_2_, V p_i1552_3_, IntHashMap.Entry p_i1552_4_) + { + this.valueEntry = p_i1552_3_; + this.nextEntry = p_i1552_4_; + this.hashEntry = p_i1552_2_; + this.slotHash = p_i1552_1_; + } + + public final int getHash() + { + return this.hashEntry; + } + + public final V getValue() + { + return this.valueEntry; + } + + public final boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof IntHashMap.Entry)) + { + return false; + } + else + { + IntHashMap.Entry entry = (IntHashMap.Entry)p_equals_1_; + Object object = Integer.valueOf(this.getHash()); + Object object1 = Integer.valueOf(entry.getHash()); + + if (object == object1 || object != null && object.equals(object1)) + { + Object object2 = this.getValue(); + Object object3 = entry.getValue(); + + if (object2 == object3 || object2 != null && object2.equals(object3)) + { + return true; + } + } + + return false; + } + } + + public final int hashCode() + { + return IntHashMap.computeHash(this.hashEntry); + } + + public final String toString() + { + return this.getHash() + "=" + this.getValue(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/IntegerCache.java b/Client-1.8.9/src/main/java/net/minecraft/util/IntegerCache.java new file mode 100644 index 0000000..818173b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/IntegerCache.java @@ -0,0 +1,21 @@ +package net.minecraft.util; + +public class IntegerCache +{ + private static final Integer[] CACHE = new Integer[65535]; + + public static Integer getInteger(int value) + { + return value >= 0 && value < CACHE.length ? CACHE[value] : new Integer(value); + } + + static + { + int i = 0; + + for (int j = CACHE.length; i < j; ++i) + { + CACHE[i] = Integer.valueOf(i); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/JsonSerializableSet.java b/Client-1.8.9/src/main/java/net/minecraft/util/JsonSerializableSet.java new file mode 100644 index 0000000..b766db0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/JsonSerializableSet.java @@ -0,0 +1,41 @@ +package net.minecraft.util; + +import com.google.common.collect.ForwardingSet; +import com.google.common.collect.Sets; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonPrimitive; +import java.util.Set; + +public class JsonSerializableSet extends ForwardingSet implements IJsonSerializable +{ + private final Set underlyingSet = Sets.newHashSet(); + + public void fromJson(JsonElement json) + { + if (json.isJsonArray()) + { + for (JsonElement jsonelement : json.getAsJsonArray()) + { + this.add(jsonelement.getAsString()); + } + } + } + + public JsonElement getSerializableElement() + { + JsonArray jsonarray = new JsonArray(); + + for (String s : this) + { + jsonarray.add(new JsonPrimitive(s)); + } + + return jsonarray; + } + + protected Set delegate() + { + return this.underlyingSet; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/JsonUtils.java b/Client-1.8.9/src/main/java/net/minecraft/util/JsonUtils.java new file mode 100644 index 0000000..cf055fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/JsonUtils.java @@ -0,0 +1,255 @@ +package net.minecraft.util; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSyntaxException; + +public class JsonUtils +{ + public static boolean isString(JsonObject p_151205_0_, String p_151205_1_) + { + return !isJsonPrimitive(p_151205_0_, p_151205_1_) ? false : p_151205_0_.getAsJsonPrimitive(p_151205_1_).isString(); + } + + public static boolean isString(JsonElement p_151211_0_) + { + return !p_151211_0_.isJsonPrimitive() ? false : p_151211_0_.getAsJsonPrimitive().isString(); + } + + public static boolean isBoolean(JsonObject p_180199_0_, String p_180199_1_) + { + return !isJsonPrimitive(p_180199_0_, p_180199_1_) ? false : p_180199_0_.getAsJsonPrimitive(p_180199_1_).isBoolean(); + } + + public static boolean isJsonArray(JsonObject p_151202_0_, String p_151202_1_) + { + return !hasField(p_151202_0_, p_151202_1_) ? false : p_151202_0_.get(p_151202_1_).isJsonArray(); + } + + public static boolean isJsonPrimitive(JsonObject p_151201_0_, String p_151201_1_) + { + return !hasField(p_151201_0_, p_151201_1_) ? false : p_151201_0_.get(p_151201_1_).isJsonPrimitive(); + } + + public static boolean hasField(JsonObject p_151204_0_, String p_151204_1_) + { + return p_151204_0_ == null ? false : p_151204_0_.get(p_151204_1_) != null; + } + + public static String getString(JsonElement p_151206_0_, String p_151206_1_) + { + if (p_151206_0_.isJsonPrimitive()) + { + return p_151206_0_.getAsString(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151206_1_ + " to be a string, was " + toString(p_151206_0_)); + } + } + + public static String getString(JsonObject p_151200_0_, String p_151200_1_) + { + if (p_151200_0_.has(p_151200_1_)) + { + return getString(p_151200_0_.get(p_151200_1_), p_151200_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151200_1_ + ", expected to find a string"); + } + } + + public static String getString(JsonObject p_151219_0_, String p_151219_1_, String p_151219_2_) + { + return p_151219_0_.has(p_151219_1_) ? getString(p_151219_0_.get(p_151219_1_), p_151219_1_) : p_151219_2_; + } + + public static boolean getBoolean(JsonElement p_151216_0_, String p_151216_1_) + { + if (p_151216_0_.isJsonPrimitive()) + { + return p_151216_0_.getAsBoolean(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151216_1_ + " to be a Boolean, was " + toString(p_151216_0_)); + } + } + + public static boolean getBoolean(JsonObject p_151212_0_, String p_151212_1_) + { + if (p_151212_0_.has(p_151212_1_)) + { + return getBoolean(p_151212_0_.get(p_151212_1_), p_151212_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151212_1_ + ", expected to find a Boolean"); + } + } + + public static boolean getBoolean(JsonObject p_151209_0_, String p_151209_1_, boolean p_151209_2_) + { + return p_151209_0_.has(p_151209_1_) ? getBoolean(p_151209_0_.get(p_151209_1_), p_151209_1_) : p_151209_2_; + } + + public static float getFloat(JsonElement p_151220_0_, String p_151220_1_) + { + if (p_151220_0_.isJsonPrimitive() && p_151220_0_.getAsJsonPrimitive().isNumber()) + { + return p_151220_0_.getAsFloat(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151220_1_ + " to be a Float, was " + toString(p_151220_0_)); + } + } + + public static float getFloat(JsonObject p_151217_0_, String p_151217_1_) + { + if (p_151217_0_.has(p_151217_1_)) + { + return getFloat(p_151217_0_.get(p_151217_1_), p_151217_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151217_1_ + ", expected to find a Float"); + } + } + + public static float getFloat(JsonObject p_151221_0_, String p_151221_1_, float p_151221_2_) + { + return p_151221_0_.has(p_151221_1_) ? getFloat(p_151221_0_.get(p_151221_1_), p_151221_1_) : p_151221_2_; + } + + public static int getInt(JsonElement p_151215_0_, String p_151215_1_) + { + if (p_151215_0_.isJsonPrimitive() && p_151215_0_.getAsJsonPrimitive().isNumber()) + { + return p_151215_0_.getAsInt(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151215_1_ + " to be a Int, was " + toString(p_151215_0_)); + } + } + + public static int getInt(JsonObject p_151203_0_, String p_151203_1_) + { + if (p_151203_0_.has(p_151203_1_)) + { + return getInt(p_151203_0_.get(p_151203_1_), p_151203_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151203_1_ + ", expected to find a Int"); + } + } + + public static int getInt(JsonObject p_151208_0_, String p_151208_1_, int p_151208_2_) + { + return p_151208_0_.has(p_151208_1_) ? getInt(p_151208_0_.get(p_151208_1_), p_151208_1_) : p_151208_2_; + } + + public static JsonObject getJsonObject(JsonElement p_151210_0_, String p_151210_1_) + { + if (p_151210_0_.isJsonObject()) + { + return p_151210_0_.getAsJsonObject(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151210_1_ + " to be a JsonObject, was " + toString(p_151210_0_)); + } + } + + public static JsonObject getJsonObject(JsonObject base, String key) + { + if (base.has(key)) + { + return getJsonObject(base.get(key), key); + } + else + { + throw new JsonSyntaxException("Missing " + key + ", expected to find a JsonObject"); + } + } + + public static JsonObject getJsonObject(JsonObject p_151218_0_, String p_151218_1_, JsonObject p_151218_2_) + { + return p_151218_0_.has(p_151218_1_) ? getJsonObject(p_151218_0_.get(p_151218_1_), p_151218_1_) : p_151218_2_; + } + + public static JsonArray getJsonArray(JsonElement p_151207_0_, String p_151207_1_) + { + if (p_151207_0_.isJsonArray()) + { + return p_151207_0_.getAsJsonArray(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151207_1_ + " to be a JsonArray, was " + toString(p_151207_0_)); + } + } + + public static JsonArray getJsonArray(JsonObject p_151214_0_, String p_151214_1_) + { + if (p_151214_0_.has(p_151214_1_)) + { + return getJsonArray(p_151214_0_.get(p_151214_1_), p_151214_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151214_1_ + ", expected to find a JsonArray"); + } + } + + public static JsonArray getJsonArray(JsonObject p_151213_0_, String p_151213_1_, JsonArray p_151213_2_) + { + return p_151213_0_.has(p_151213_1_) ? getJsonArray(p_151213_0_.get(p_151213_1_), p_151213_1_) : p_151213_2_; + } + + public static String toString(JsonElement p_151222_0_) + { + String s = org.apache.commons.lang3.StringUtils.abbreviateMiddle(String.valueOf((Object)p_151222_0_), "...", 10); + + if (p_151222_0_ == null) + { + return "null (missing)"; + } + else if (p_151222_0_.isJsonNull()) + { + return "null (json)"; + } + else if (p_151222_0_.isJsonArray()) + { + return "an array (" + s + ")"; + } + else if (p_151222_0_.isJsonObject()) + { + return "an object (" + s + ")"; + } + else + { + if (p_151222_0_.isJsonPrimitive()) + { + JsonPrimitive jsonprimitive = p_151222_0_.getAsJsonPrimitive(); + + if (jsonprimitive.isNumber()) + { + return "a number (" + s + ")"; + } + + if (jsonprimitive.isBoolean()) + { + return "a boolean (" + s + ")"; + } + } + + return s; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/LazyLoadBase.java b/Client-1.8.9/src/main/java/net/minecraft/util/LazyLoadBase.java new file mode 100644 index 0000000..de33456 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/LazyLoadBase.java @@ -0,0 +1,20 @@ +package net.minecraft.util; + +public abstract class LazyLoadBase +{ + private T value; + private boolean isLoaded = false; + + public T getValue() + { + if (!this.isLoaded) + { + this.isLoaded = true; + this.value = this.load(); + } + + return this.value; + } + + protected abstract T load(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/LoggingPrintStream.java b/Client-1.8.9/src/main/java/net/minecraft/util/LoggingPrintStream.java new file mode 100644 index 0000000..75d89e7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/LoggingPrintStream.java @@ -0,0 +1,35 @@ +package net.minecraft.util; + +import java.io.OutputStream; +import java.io.PrintStream; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class LoggingPrintStream extends PrintStream +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final String domain; + + public LoggingPrintStream(String domainIn, OutputStream outStream) + { + super(outStream); + this.domain = domainIn; + } + + public void println(String p_println_1_) + { + this.logString(p_println_1_); + } + + public void println(Object p_println_1_) + { + this.logString(String.valueOf(p_println_1_)); + } + + private void logString(String string) + { + StackTraceElement[] astacktraceelement = Thread.currentThread().getStackTrace(); + StackTraceElement stacktraceelement = astacktraceelement[Math.min(3, astacktraceelement.length)]; + LOGGER.info("[{}]@.({}:{}): {}", new Object[] {this.domain, stacktraceelement.getFileName(), Integer.valueOf(stacktraceelement.getLineNumber()), string}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/LongHashMap.java b/Client-1.8.9/src/main/java/net/minecraft/util/LongHashMap.java new file mode 100644 index 0000000..2a2b4c4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/LongHashMap.java @@ -0,0 +1,271 @@ +package net.minecraft.util; + +public class LongHashMap +{ + private transient LongHashMap.Entry[] hashArray = new LongHashMap.Entry[4096]; + private transient int numHashElements; + private int mask; + private int capacity = 3072; + private final float percentUseable = 0.75F; + private transient volatile int modCount; + + public LongHashMap() + { + this.mask = this.hashArray.length - 1; + } + + private static int getHashedKey(long originalKey) + { + return (int)(originalKey ^ originalKey >>> 27); + } + + private static int hash(int integer) + { + integer = integer ^ integer >>> 20 ^ integer >>> 12; + return integer ^ integer >>> 7 ^ integer >>> 4; + } + + private static int getHashIndex(int p_76158_0_, int p_76158_1_) + { + return p_76158_0_ & p_76158_1_; + } + + public int getNumHashElements() + { + return this.numHashElements; + } + + public V getValueByKey(long p_76164_1_) + { + int i = getHashedKey(p_76164_1_); + + for (LongHashMap.Entry entry = this.hashArray[getHashIndex(i, this.mask)]; entry != null; entry = entry.nextEntry) + { + if (entry.key == p_76164_1_) + { + return entry.value; + } + } + + return (V)((Object)null); + } + + public boolean containsItem(long p_76161_1_) + { + return this.getEntry(p_76161_1_) != null; + } + + final LongHashMap.Entry getEntry(long p_76160_1_) + { + int i = getHashedKey(p_76160_1_); + + for (LongHashMap.Entry entry = this.hashArray[getHashIndex(i, this.mask)]; entry != null; entry = entry.nextEntry) + { + if (entry.key == p_76160_1_) + { + return entry; + } + } + + return null; + } + + public void add(long p_76163_1_, V p_76163_3_) + { + int i = getHashedKey(p_76163_1_); + int j = getHashIndex(i, this.mask); + + for (LongHashMap.Entry entry = this.hashArray[j]; entry != null; entry = entry.nextEntry) + { + if (entry.key == p_76163_1_) + { + entry.value = p_76163_3_; + return; + } + } + + ++this.modCount; + this.createKey(i, p_76163_1_, p_76163_3_, j); + } + + private void resizeTable(int p_76153_1_) + { + LongHashMap.Entry[] entry = this.hashArray; + int i = entry.length; + + if (i == 1073741824) + { + this.capacity = Integer.MAX_VALUE; + } + else + { + LongHashMap.Entry[] entry1 = new LongHashMap.Entry[p_76153_1_]; + this.copyHashTableTo(entry1); + this.hashArray = entry1; + this.mask = this.hashArray.length - 1; + float f = (float)p_76153_1_; + this.getClass(); + this.capacity = (int)(f * 0.75F); + } + } + + private void copyHashTableTo(LongHashMap.Entry[] p_76154_1_) + { + LongHashMap.Entry[] entry = this.hashArray; + int i = p_76154_1_.length; + + for (int j = 0; j < entry.length; ++j) + { + LongHashMap.Entry entry1 = entry[j]; + + if (entry1 != null) + { + entry[j] = null; + + while (true) + { + LongHashMap.Entry entry2 = entry1.nextEntry; + int k = getHashIndex(entry1.hash, i - 1); + entry1.nextEntry = p_76154_1_[k]; + p_76154_1_[k] = entry1; + entry1 = entry2; + + if (entry2 == null) + { + break; + } + } + } + } + } + + public V remove(long p_76159_1_) + { + LongHashMap.Entry entry = this.removeKey(p_76159_1_); + return (V)(entry == null ? null : entry.value); + } + + final LongHashMap.Entry removeKey(long p_76152_1_) + { + int i = getHashedKey(p_76152_1_); + int j = getHashIndex(i, this.mask); + LongHashMap.Entry entry = this.hashArray[j]; + LongHashMap.Entry entry1; + LongHashMap.Entry entry2; + + for (entry1 = entry; entry1 != null; entry1 = entry2) + { + entry2 = entry1.nextEntry; + + if (entry1.key == p_76152_1_) + { + ++this.modCount; + --this.numHashElements; + + if (entry == entry1) + { + this.hashArray[j] = entry2; + } + else + { + entry.nextEntry = entry2; + } + + return entry1; + } + + entry = entry1; + } + + return entry1; + } + + private void createKey(int p_76156_1_, long p_76156_2_, V p_76156_4_, int p_76156_5_) + { + LongHashMap.Entry entry = this.hashArray[p_76156_5_]; + this.hashArray[p_76156_5_] = new LongHashMap.Entry(p_76156_1_, p_76156_2_, p_76156_4_, entry); + + if (this.numHashElements++ >= this.capacity) + { + this.resizeTable(2 * this.hashArray.length); + } + } + + public double getKeyDistribution() + { + int i = 0; + + for (int j = 0; j < this.hashArray.length; ++j) + { + if (this.hashArray[j] != null) + { + ++i; + } + } + + return 1.0D * (double)i / (double)this.numHashElements; + } + + static class Entry + { + final long key; + V value; + LongHashMap.Entry nextEntry; + final int hash; + + Entry(int p_i1553_1_, long p_i1553_2_, V p_i1553_4_, LongHashMap.Entry p_i1553_5_) + { + this.value = p_i1553_4_; + this.nextEntry = p_i1553_5_; + this.key = p_i1553_2_; + this.hash = p_i1553_1_; + } + + public final long getKey() + { + return this.key; + } + + public final V getValue() + { + return this.value; + } + + public final boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof LongHashMap.Entry)) + { + return false; + } + else + { + LongHashMap.Entry entry = (LongHashMap.Entry)p_equals_1_; + Object object = Long.valueOf(this.getKey()); + Object object1 = Long.valueOf(entry.getKey()); + + if (object == object1 || object != null && object.equals(object1)) + { + Object object2 = this.getValue(); + Object object3 = entry.getValue(); + + if (object2 == object3 || object2 != null && object2.equals(object3)) + { + return true; + } + } + + return false; + } + } + + public final int hashCode() + { + return LongHashMap.getHashedKey(this.key); + } + + public final String toString() + { + return this.getKey() + "=" + this.getValue(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MapPopulator.java b/Client-1.8.9/src/main/java/net/minecraft/util/MapPopulator.java new file mode 100644 index 0000000..21506e2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MapPopulator.java @@ -0,0 +1,33 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.Map; +import java.util.NoSuchElementException; + +public class MapPopulator +{ + public static Map createMap(Iterable keys, Iterable values) + { + return populateMap(keys, values, Maps.newLinkedHashMap()); + } + + public static Map populateMap(Iterable keys, Iterable values, Map map) + { + Iterator iterator = values.iterator(); + + for (K k : keys) + { + map.put(k, iterator.next()); + } + + if (iterator.hasNext()) + { + throw new NoSuchElementException(); + } + else + { + return map; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MathHelper.java b/Client-1.8.9/src/main/java/net/minecraft/util/MathHelper.java new file mode 100644 index 0000000..2da5799 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MathHelper.java @@ -0,0 +1,504 @@ +package net.minecraft.util; + +import java.util.Random; +import java.util.UUID; +import net.optifine.util.MathUtils; + +public class MathHelper +{ + public static final float SQRT_2 = sqrt_float(2.0F); + private static final int SIN_BITS = 12; + private static final int SIN_MASK = 4095; + private static final int SIN_COUNT = 4096; + private static final int SIN_COUNT_D4 = 1024; + public static final float PI = MathUtils.roundToFloat(Math.PI); + public static final float PI2 = MathUtils.roundToFloat((Math.PI * 2D)); + public static final float PId2 = MathUtils.roundToFloat((Math.PI / 2D)); + private static final float radToIndex = MathUtils.roundToFloat(651.8986469044033D); + public static final float deg2Rad = MathUtils.roundToFloat(0.017453292519943295D); + private static final float[] SIN_TABLE_FAST = new float[4096]; + public static boolean fastMath = false; + private static final float[] SIN_TABLE = new float[65536]; + private static final int[] multiplyDeBruijnBitPosition; + private static final double field_181163_d; + private static final double[] field_181164_e; + private static final double[] field_181165_f; + + public static float sin(float p_76126_0_) + { + return fastMath ? SIN_TABLE_FAST[(int)(p_76126_0_ * radToIndex) & 4095] : SIN_TABLE[(int)(p_76126_0_ * 10430.378F) & 65535]; + } + + public static float cos(float value) + { + return fastMath ? SIN_TABLE_FAST[(int)(value * radToIndex + 1024.0F) & 4095] : SIN_TABLE[(int)(value * 10430.378F + 16384.0F) & 65535]; + } + + public static float sqrt_float(float value) + { + return (float)Math.sqrt((double)value); + } + + public static float sqrt_double(double value) + { + return (float)Math.sqrt(value); + } + + public static int floor_float(float value) + { + int i = (int)value; + return value < (float)i ? i - 1 : i; + } + + public static int truncateDoubleToInt(double value) + { + return (int)(value + 1024.0D) - 1024; + } + + public static int floor_double(double value) + { + int i = (int)value; + return value < (double)i ? i - 1 : i; + } + + public static long floor_double_long(double value) + { + long i = (long)value; + return value < (double)i ? i - 1L : i; + } + + public static int func_154353_e(double value) + { + return (int)(value >= 0.0D ? value : -value + 1.0D); + } + + public static float abs(float value) + { + return value >= 0.0F ? value : -value; + } + + public static int abs_int(int value) + { + return value >= 0 ? value : -value; + } + + public static int ceiling_float_int(float value) + { + int i = (int)value; + return value > (float)i ? i + 1 : i; + } + + public static int ceiling_double_int(double value) + { + int i = (int)value; + return value > (double)i ? i + 1 : i; + } + + public static int clamp_int(int num, int min, int max) + { + return num < min ? min : (num > max ? max : num); + } + + public static float clamp_float(float num, float min, float max) + { + return num < min ? min : (num > max ? max : num); + } + + public static double clamp_double(double num, double min, double max) + { + return num < min ? min : (num > max ? max : num); + } + + public static double denormalizeClamp(double lowerBnd, double upperBnd, double slide) + { + return slide < 0.0D ? lowerBnd : (slide > 1.0D ? upperBnd : lowerBnd + (upperBnd - lowerBnd) * slide); + } + + public static double abs_max(double p_76132_0_, double p_76132_2_) + { + if (p_76132_0_ < 0.0D) + { + p_76132_0_ = -p_76132_0_; + } + + if (p_76132_2_ < 0.0D) + { + p_76132_2_ = -p_76132_2_; + } + + return p_76132_0_ > p_76132_2_ ? p_76132_0_ : p_76132_2_; + } + + public static int bucketInt(int p_76137_0_, int p_76137_1_) + { + return p_76137_0_ < 0 ? -((-p_76137_0_ - 1) / p_76137_1_) - 1 : p_76137_0_ / p_76137_1_; + } + + public static int getRandomIntegerInRange(Random p_76136_0_, int p_76136_1_, int p_76136_2_) + { + return p_76136_1_ >= p_76136_2_ ? p_76136_1_ : p_76136_0_.nextInt(p_76136_2_ - p_76136_1_ + 1) + p_76136_1_; + } + + public static float randomFloatClamp(Random p_151240_0_, float p_151240_1_, float p_151240_2_) + { + return p_151240_1_ >= p_151240_2_ ? p_151240_1_ : p_151240_0_.nextFloat() * (p_151240_2_ - p_151240_1_) + p_151240_1_; + } + + public static double getRandomDoubleInRange(Random p_82716_0_, double p_82716_1_, double p_82716_3_) + { + return p_82716_1_ >= p_82716_3_ ? p_82716_1_ : p_82716_0_.nextDouble() * (p_82716_3_ - p_82716_1_) + p_82716_1_; + } + + public static double average(long[] values) + { + long i = 0L; + + for (long j : values) + { + i += j; + } + + return (double)i / (double)values.length; + } + + public static boolean epsilonEquals(float p_180185_0_, float p_180185_1_) + { + return abs(p_180185_1_ - p_180185_0_) < 1.0E-5F; + } + + public static int normalizeAngle(int p_180184_0_, int p_180184_1_) + { + return (p_180184_0_ % p_180184_1_ + p_180184_1_) % p_180184_1_; + } + + public static float wrapAngleTo180_float(float value) + { + value = value % 360.0F; + + if (value >= 180.0F) + { + value -= 360.0F; + } + + if (value < -180.0F) + { + value += 360.0F; + } + + return value; + } + + public static double wrapAngleTo180_double(double value) + { + value = value % 360.0D; + + if (value >= 180.0D) + { + value -= 360.0D; + } + + if (value < -180.0D) + { + value += 360.0D; + } + + return value; + } + + public static int parseIntWithDefault(String p_82715_0_, int p_82715_1_) + { + try + { + return Integer.parseInt(p_82715_0_); + } + catch (Throwable var3) + { + return p_82715_1_; + } + } + + public static int parseIntWithDefaultAndMax(String p_82714_0_, int p_82714_1_, int p_82714_2_) + { + return Math.max(p_82714_2_, parseIntWithDefault(p_82714_0_, p_82714_1_)); + } + + public static double parseDoubleWithDefault(String p_82712_0_, double p_82712_1_) + { + try + { + return Double.parseDouble(p_82712_0_); + } + catch (Throwable var4) + { + return p_82712_1_; + } + } + + public static double parseDoubleWithDefaultAndMax(String p_82713_0_, double p_82713_1_, double p_82713_3_) + { + return Math.max(p_82713_3_, parseDoubleWithDefault(p_82713_0_, p_82713_1_)); + } + + public static int roundUpToPowerOfTwo(int value) + { + int i = value - 1; + i = i | i >> 1; + i = i | i >> 2; + i = i | i >> 4; + i = i | i >> 8; + i = i | i >> 16; + return i + 1; + } + + private static boolean isPowerOfTwo(int value) + { + return value != 0 && (value & value - 1) == 0; + } + + private static int calculateLogBaseTwoDeBruijn(int value) + { + value = isPowerOfTwo(value) ? value : roundUpToPowerOfTwo(value); + return multiplyDeBruijnBitPosition[(int)((long)value * 125613361L >> 27) & 31]; + } + + public static int calculateLogBaseTwo(int value) + { + return calculateLogBaseTwoDeBruijn(value) - (isPowerOfTwo(value) ? 0 : 1); + } + + public static int roundUp(int p_154354_0_, int p_154354_1_) + { + if (p_154354_1_ == 0) + { + return 0; + } + else if (p_154354_0_ == 0) + { + return p_154354_1_; + } + else + { + if (p_154354_0_ < 0) + { + p_154354_1_ *= -1; + } + + int i = p_154354_0_ % p_154354_1_; + return i == 0 ? p_154354_0_ : p_154354_0_ + p_154354_1_ - i; + } + } + + public static int func_180183_b(float p_180183_0_, float p_180183_1_, float p_180183_2_) + { + return func_180181_b(floor_float(p_180183_0_ * 255.0F), floor_float(p_180183_1_ * 255.0F), floor_float(p_180183_2_ * 255.0F)); + } + + public static int func_180181_b(int p_180181_0_, int p_180181_1_, int p_180181_2_) + { + int i = (p_180181_0_ << 8) + p_180181_1_; + i = (i << 8) + p_180181_2_; + return i; + } + + public static int func_180188_d(int p_180188_0_, int p_180188_1_) + { + int i = (p_180188_0_ & 16711680) >> 16; + int j = (p_180188_1_ & 16711680) >> 16; + int k = (p_180188_0_ & 65280) >> 8; + int l = (p_180188_1_ & 65280) >> 8; + int i1 = (p_180188_0_ & 255) >> 0; + int j1 = (p_180188_1_ & 255) >> 0; + int k1 = (int)((float)i * (float)j / 255.0F); + int l1 = (int)((float)k * (float)l / 255.0F); + int i2 = (int)((float)i1 * (float)j1 / 255.0F); + return p_180188_0_ & -16777216 | k1 << 16 | l1 << 8 | i2; + } + + public static double func_181162_h(double p_181162_0_) + { + return p_181162_0_ - Math.floor(p_181162_0_); + } + + public static long getPositionRandom(Vec3i pos) + { + return getCoordinateRandom(pos.getX(), pos.getY(), pos.getZ()); + } + + public static long getCoordinateRandom(int x, int y, int z) + { + long i = (long)(x * 3129871) ^ (long)z * 116129781L ^ (long)y; + i = i * i * 42317861L + i * 11L; + return i; + } + + public static UUID getRandomUuid(Random rand) + { + long i = rand.nextLong() & -61441L | 16384L; + long j = rand.nextLong() & 4611686018427387903L | Long.MIN_VALUE; + return new UUID(i, j); + } + + public static double func_181160_c(double p_181160_0_, double p_181160_2_, double p_181160_4_) + { + return (p_181160_0_ - p_181160_2_) / (p_181160_4_ - p_181160_2_); + } + + public static double atan2(double p_181159_0_, double p_181159_2_) + { + double d0 = p_181159_2_ * p_181159_2_ + p_181159_0_ * p_181159_0_; + + if (Double.isNaN(d0)) + { + return Double.NaN; + } + else + { + boolean flag = p_181159_0_ < 0.0D; + + if (flag) + { + p_181159_0_ = -p_181159_0_; + } + + boolean flag1 = p_181159_2_ < 0.0D; + + if (flag1) + { + p_181159_2_ = -p_181159_2_; + } + + boolean flag2 = p_181159_0_ > p_181159_2_; + + if (flag2) + { + double d1 = p_181159_2_; + p_181159_2_ = p_181159_0_; + p_181159_0_ = d1; + } + + double d9 = func_181161_i(d0); + p_181159_2_ = p_181159_2_ * d9; + p_181159_0_ = p_181159_0_ * d9; + double d2 = field_181163_d + p_181159_0_; + int i = (int)Double.doubleToRawLongBits(d2); + double d3 = field_181164_e[i]; + double d4 = field_181165_f[i]; + double d5 = d2 - field_181163_d; + double d6 = p_181159_0_ * d4 - p_181159_2_ * d5; + double d7 = (6.0D + d6 * d6) * d6 * 0.16666666666666666D; + double d8 = d3 + d7; + + if (flag2) + { + d8 = (Math.PI / 2D) - d8; + } + + if (flag1) + { + d8 = Math.PI - d8; + } + + if (flag) + { + d8 = -d8; + } + + return d8; + } + } + + public static double func_181161_i(double p_181161_0_) + { + double d0 = 0.5D * p_181161_0_; + long i = Double.doubleToRawLongBits(p_181161_0_); + i = 6910469410427058090L - (i >> 1); + p_181161_0_ = Double.longBitsToDouble(i); + p_181161_0_ = p_181161_0_ * (1.5D - d0 * p_181161_0_ * p_181161_0_); + return p_181161_0_; + } + + public static int hsvToRGB(float p_181758_0_, float p_181758_1_, float p_181758_2_) + { + int i = (int)(p_181758_0_ * 6.0F) % 6; + float f = p_181758_0_ * 6.0F - (float)i; + float f1 = p_181758_2_ * (1.0F - p_181758_1_); + float f2 = p_181758_2_ * (1.0F - f * p_181758_1_); + float f3 = p_181758_2_ * (1.0F - (1.0F - f) * p_181758_1_); + float f4; + float f5; + float f6; + + switch (i) + { + case 0: + f4 = p_181758_2_; + f5 = f3; + f6 = f1; + break; + + case 1: + f4 = f2; + f5 = p_181758_2_; + f6 = f1; + break; + + case 2: + f4 = f1; + f5 = p_181758_2_; + f6 = f3; + break; + + case 3: + f4 = f1; + f5 = f2; + f6 = p_181758_2_; + break; + + case 4: + f4 = f3; + f5 = f1; + f6 = p_181758_2_; + break; + + case 5: + f4 = p_181758_2_; + f5 = f1; + f6 = f2; + break; + + default: + throw new RuntimeException("Something went wrong when converting from HSV to RGB. Input was " + p_181758_0_ + ", " + p_181758_1_ + ", " + p_181758_2_); + } + + int j = clamp_int((int)(f4 * 255.0F), 0, 255); + int k = clamp_int((int)(f5 * 255.0F), 0, 255); + int l = clamp_int((int)(f6 * 255.0F), 0, 255); + return j << 16 | k << 8 | l; + } + + static + { + for (int i = 0; i < 65536; ++i) + { + SIN_TABLE[i] = (float)Math.sin((double)i * Math.PI * 2.0D / 65536.0D); + } + + for (int j = 0; j < SIN_TABLE_FAST.length; ++j) + { + SIN_TABLE_FAST[j] = MathUtils.roundToFloat(Math.sin((double)j * Math.PI * 2.0D / 4096.0D)); + } + + multiplyDeBruijnBitPosition = new int[] {0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9}; + field_181163_d = Double.longBitsToDouble(4805340802404319232L); + field_181164_e = new double[257]; + field_181165_f = new double[257]; + + for (int k = 0; k < 257; ++k) + { + double d0 = (double)k / 256.0D; + double d1 = Math.asin(d0); + field_181165_f[k] = Math.cos(d1); + field_181164_e[k] = d1; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Matrix4f.java b/Client-1.8.9/src/main/java/net/minecraft/util/Matrix4f.java new file mode 100644 index 0000000..8f7ea07 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Matrix4f.java @@ -0,0 +1,29 @@ +package net.minecraft.util; + +public class Matrix4f extends org.lwjgl.util.vector.Matrix4f +{ + public Matrix4f(float[] p_i46413_1_) + { + this.m00 = p_i46413_1_[0]; + this.m01 = p_i46413_1_[1]; + this.m02 = p_i46413_1_[2]; + this.m03 = p_i46413_1_[3]; + this.m10 = p_i46413_1_[4]; + this.m11 = p_i46413_1_[5]; + this.m12 = p_i46413_1_[6]; + this.m13 = p_i46413_1_[7]; + this.m20 = p_i46413_1_[8]; + this.m21 = p_i46413_1_[9]; + this.m22 = p_i46413_1_[10]; + this.m23 = p_i46413_1_[11]; + this.m30 = p_i46413_1_[12]; + this.m31 = p_i46413_1_[13]; + this.m32 = p_i46413_1_[14]; + this.m33 = p_i46413_1_[15]; + } + + public Matrix4f() + { + this.m00 = this.m01 = this.m02 = this.m03 = this.m10 = this.m11 = this.m12 = this.m13 = this.m20 = this.m21 = this.m22 = this.m23 = this.m30 = this.m31 = this.m32 = this.m33 = 0.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MessageDeserializer.java b/Client-1.8.9/src/main/java/net/minecraft/util/MessageDeserializer.java new file mode 100644 index 0000000..dddaada --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MessageDeserializer.java @@ -0,0 +1,61 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +import java.io.IOException; +import java.util.List; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.EnumPacketDirection; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class MessageDeserializer extends ByteToMessageDecoder +{ + private static final Logger logger = LogManager.getLogger(); + private static final Marker RECEIVED_PACKET_MARKER = MarkerManager.getMarker("PACKET_RECEIVED", NetworkManager.logMarkerPackets); + private final EnumPacketDirection direction; + + public MessageDeserializer(EnumPacketDirection direction) + { + this.direction = direction; + } + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws IOException, InstantiationException, IllegalAccessException, Exception + { + if (p_decode_2_.readableBytes() != 0) + { + PacketBuffer packetbuffer = new PacketBuffer(p_decode_2_); + int i = packetbuffer.readVarIntFromBuffer(); + Packet packet = ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getPacket(this.direction, i); + + if (packet == null) + { + throw new IOException("Bad packet id " + i); + } + else + { + packet.readPacketData(packetbuffer); + + if (packetbuffer.readableBytes() > 0) + { + throw new IOException("Packet " + ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getId() + "/" + i + " (" + packet.getClass().getSimpleName() + ") was larger than I expected, found " + packetbuffer.readableBytes() + " bytes extra whilst reading packet " + i); + } + else + { + p_decode_3_.add(packet); + + if (logger.isDebugEnabled()) + { + logger.debug(RECEIVED_PACKET_MARKER, " IN: [{}:{}] {}", new Object[] {p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), Integer.valueOf(i), packet.getClass().getName()}); + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MessageDeserializer2.java b/Client-1.8.9/src/main/java/net/minecraft/util/MessageDeserializer2.java new file mode 100644 index 0000000..5de4c95 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MessageDeserializer2.java @@ -0,0 +1,55 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.handler.codec.CorruptedFrameException; +import java.util.List; +import net.minecraft.network.PacketBuffer; + +public class MessageDeserializer2 extends ByteToMessageDecoder +{ + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws Exception + { + p_decode_2_.markReaderIndex(); + byte[] abyte = new byte[3]; + + for (int i = 0; i < abyte.length; ++i) + { + if (!p_decode_2_.isReadable()) + { + p_decode_2_.resetReaderIndex(); + return; + } + + abyte[i] = p_decode_2_.readByte(); + + if (abyte[i] >= 0) + { + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(abyte)); + + try + { + int j = packetbuffer.readVarIntFromBuffer(); + + if (p_decode_2_.readableBytes() >= j) + { + p_decode_3_.add(p_decode_2_.readBytes(j)); + return; + } + + p_decode_2_.resetReaderIndex(); + } + finally + { + packetbuffer.release(); + } + + return; + } + } + + throw new CorruptedFrameException("length wider than 21-bit"); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MessageSerializer.java b/Client-1.8.9/src/main/java/net/minecraft/util/MessageSerializer.java new file mode 100644 index 0000000..9463125 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MessageSerializer.java @@ -0,0 +1,57 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import java.io.IOException; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.EnumPacketDirection; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class MessageSerializer extends MessageToByteEncoder +{ + private static final Logger logger = LogManager.getLogger(); + private static final Marker RECEIVED_PACKET_MARKER = MarkerManager.getMarker("PACKET_SENT", NetworkManager.logMarkerPackets); + private final EnumPacketDirection direction; + + public MessageSerializer(EnumPacketDirection direction) + { + this.direction = direction; + } + + protected void encode(ChannelHandlerContext p_encode_1_, Packet p_encode_2_, ByteBuf p_encode_3_) throws IOException, Exception + { + Integer integer = ((EnumConnectionState)p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getPacketId(this.direction, p_encode_2_); + + if (logger.isDebugEnabled()) + { + logger.debug(RECEIVED_PACKET_MARKER, "OUT: [{}:{}] {}", new Object[] {p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), integer, p_encode_2_.getClass().getName()}); + } + + if (integer == null) + { + throw new IOException("Can\'t serialize unregistered packet"); + } + else + { + PacketBuffer packetbuffer = new PacketBuffer(p_encode_3_); + packetbuffer.writeVarIntToBuffer(integer.intValue()); + + try + { + p_encode_2_.writePacketData(packetbuffer); + } + catch (Throwable throwable) + { + logger.error((Object)throwable); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MessageSerializer2.java b/Client-1.8.9/src/main/java/net/minecraft/util/MessageSerializer2.java new file mode 100644 index 0000000..25bdd87 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MessageSerializer2.java @@ -0,0 +1,27 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import net.minecraft.network.PacketBuffer; + +public class MessageSerializer2 extends MessageToByteEncoder +{ + protected void encode(ChannelHandlerContext p_encode_1_, ByteBuf p_encode_2_, ByteBuf p_encode_3_) throws Exception + { + int i = p_encode_2_.readableBytes(); + int j = PacketBuffer.getVarIntSize(i); + + if (j > 3) + { + throw new IllegalArgumentException("unable to fit " + i + " into " + 3); + } + else + { + PacketBuffer packetbuffer = new PacketBuffer(p_encode_3_); + packetbuffer.ensureWritable(j + i); + packetbuffer.writeVarIntToBuffer(i); + packetbuffer.writeBytes(p_encode_2_, p_encode_2_.readerIndex(), i); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MinecraftError.java b/Client-1.8.9/src/main/java/net/minecraft/util/MinecraftError.java new file mode 100644 index 0000000..83c1361 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MinecraftError.java @@ -0,0 +1,5 @@ +package net.minecraft.util; + +public class MinecraftError extends Error +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MouseFilter.java b/Client-1.8.9/src/main/java/net/minecraft/util/MouseFilter.java new file mode 100644 index 0000000..6af6ec9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MouseFilter.java @@ -0,0 +1,30 @@ +package net.minecraft.util; + +public class MouseFilter +{ + private float field_76336_a; + private float field_76334_b; + private float field_76335_c; + + public float smooth(float p_76333_1_, float p_76333_2_) + { + this.field_76336_a += p_76333_1_; + p_76333_1_ = (this.field_76336_a - this.field_76334_b) * p_76333_2_; + this.field_76335_c += (p_76333_1_ - this.field_76335_c) * 0.5F; + + if (p_76333_1_ > 0.0F && p_76333_1_ > this.field_76335_c || p_76333_1_ < 0.0F && p_76333_1_ < this.field_76335_c) + { + p_76333_1_ = this.field_76335_c; + } + + this.field_76334_b += p_76333_1_; + return p_76333_1_; + } + + public void reset() + { + this.field_76336_a = 0.0F; + this.field_76334_b = 0.0F; + this.field_76335_c = 0.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MouseHelper.java b/Client-1.8.9/src/main/java/net/minecraft/util/MouseHelper.java new file mode 100644 index 0000000..65534b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MouseHelper.java @@ -0,0 +1,29 @@ +package net.minecraft.util; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; + +public class MouseHelper +{ + public int deltaX; + public int deltaY; + + public void grabMouseCursor() + { + Mouse.setGrabbed(true); + this.deltaX = 0; + this.deltaY = 0; + } + + public void ungrabMouseCursor() + { + Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); + Mouse.setGrabbed(false); + } + + public void mouseXYChange() + { + this.deltaX = Mouse.getDX(); + this.deltaY = Mouse.getDY(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MovementInput.java b/Client-1.8.9/src/main/java/net/minecraft/util/MovementInput.java new file mode 100644 index 0000000..bbfc7e8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MovementInput.java @@ -0,0 +1,13 @@ +package net.minecraft.util; + +public class MovementInput +{ + public float moveStrafe; + public float moveForward; + public boolean jump; + public boolean sneak; + + public void updatePlayerMoveState() + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MovementInputFromOptions.java b/Client-1.8.9/src/main/java/net/minecraft/util/MovementInputFromOptions.java new file mode 100644 index 0000000..f5c5192 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MovementInputFromOptions.java @@ -0,0 +1,48 @@ +package net.minecraft.util; + +import net.minecraft.client.settings.GameSettings; + +public class MovementInputFromOptions extends MovementInput +{ + private final GameSettings gameSettings; + + public MovementInputFromOptions(GameSettings gameSettingsIn) + { + this.gameSettings = gameSettingsIn; + } + + public void updatePlayerMoveState() + { + this.moveStrafe = 0.0F; + this.moveForward = 0.0F; + + if (this.gameSettings.keyBindForward.isKeyDown()) + { + ++this.moveForward; + } + + if (this.gameSettings.keyBindBack.isKeyDown()) + { + --this.moveForward; + } + + if (this.gameSettings.keyBindLeft.isKeyDown()) + { + ++this.moveStrafe; + } + + if (this.gameSettings.keyBindRight.isKeyDown()) + { + --this.moveStrafe; + } + + this.jump = this.gameSettings.keyBindJump.isKeyDown(); + this.sneak = this.gameSettings.keyBindSneak.isKeyDown(); + + if (this.sneak) + { + this.moveStrafe = (float)((double)this.moveStrafe * 0.3D); + this.moveForward = (float)((double)this.moveForward * 0.3D); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/MovingObjectPosition.java b/Client-1.8.9/src/main/java/net/minecraft/util/MovingObjectPosition.java new file mode 100644 index 0000000..c74a16b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/MovingObjectPosition.java @@ -0,0 +1,59 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; + +public class MovingObjectPosition +{ + private BlockPos blockPos; + public MovingObjectPosition.MovingObjectType typeOfHit; + public EnumFacing sideHit; + public Vec3 hitVec; + public Entity entityHit; + + public MovingObjectPosition(Vec3 hitVecIn, EnumFacing facing, BlockPos blockPosIn) + { + this(MovingObjectPosition.MovingObjectType.BLOCK, hitVecIn, facing, blockPosIn); + } + + public MovingObjectPosition(Vec3 p_i45552_1_, EnumFacing facing) + { + this(MovingObjectPosition.MovingObjectType.BLOCK, p_i45552_1_, facing, BlockPos.ORIGIN); + } + + public MovingObjectPosition(Entity entityIn) + { + this(entityIn, new Vec3(entityIn.posX, entityIn.posY, entityIn.posZ)); + } + + public MovingObjectPosition(MovingObjectPosition.MovingObjectType typeOfHitIn, Vec3 hitVecIn, EnumFacing sideHitIn, BlockPos blockPosIn) + { + this.typeOfHit = typeOfHitIn; + this.blockPos = blockPosIn; + this.sideHit = sideHitIn; + this.hitVec = new Vec3(hitVecIn.xCoord, hitVecIn.yCoord, hitVecIn.zCoord); + } + + public MovingObjectPosition(Entity entityHitIn, Vec3 hitVecIn) + { + this.typeOfHit = MovingObjectPosition.MovingObjectType.ENTITY; + this.entityHit = entityHitIn; + this.hitVec = hitVecIn; + } + + public BlockPos getBlockPos() + { + return this.blockPos; + } + + public String toString() + { + return "HitResult{type=" + this.typeOfHit + ", blockpos=" + this.blockPos + ", f=" + this.sideHit + ", pos=" + this.hitVec + ", entity=" + this.entityHit + '}'; + } + + public static enum MovingObjectType + { + MISS, + BLOCK, + ENTITY; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java b/Client-1.8.9/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java new file mode 100644 index 0000000..e7a4cff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java @@ -0,0 +1,42 @@ +package net.minecraft.util; + +import com.google.common.base.Predicates; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.IdentityHashMap; +import java.util.Iterator; +import java.util.List; + +public class ObjectIntIdentityMap implements IObjectIntIterable +{ + private final IdentityHashMap identityMap = new IdentityHashMap(512); + private final List objectList = Lists.newArrayList(); + + public void put(T key, int value) + { + this.identityMap.put(key, Integer.valueOf(value)); + + while (this.objectList.size() <= value) + { + this.objectList.add(null); + } + + this.objectList.set(value, key); + } + + public int get(T key) + { + Integer integer = (Integer)this.identityMap.get(key); + return integer == null ? -1 : integer.intValue(); + } + + public final T getByValue(int value) + { + return (T)(value >= 0 && value < this.objectList.size() ? this.objectList.get(value) : null); + } + + public Iterator iterator() + { + return Iterators.filter(this.objectList.iterator(), Predicates.notNull()); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/RegistryDefaulted.java b/Client-1.8.9/src/main/java/net/minecraft/util/RegistryDefaulted.java new file mode 100644 index 0000000..0ceb6e1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/RegistryDefaulted.java @@ -0,0 +1,17 @@ +package net.minecraft.util; + +public class RegistryDefaulted extends RegistrySimple +{ + private final V defaultObject; + + public RegistryDefaulted(V defaultObjectIn) + { + this.defaultObject = defaultObjectIn; + } + + public V getObject(K name) + { + V v = super.getObject(name); + return (V)(v == null ? this.defaultObject : v); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/RegistryNamespaced.java b/Client-1.8.9/src/main/java/net/minecraft/util/RegistryNamespaced.java new file mode 100644 index 0000000..123664a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/RegistryNamespaced.java @@ -0,0 +1,58 @@ +package net.minecraft.util; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import java.util.Iterator; +import java.util.Map; + +public class RegistryNamespaced extends RegistrySimple implements IObjectIntIterable +{ + protected final ObjectIntIdentityMap underlyingIntegerMap = new ObjectIntIdentityMap(); + protected final Map inverseObjectRegistry; + + public RegistryNamespaced() + { + this.inverseObjectRegistry = ((BiMap)this.registryObjects).inverse(); + } + + public void register(int id, K key, V value) + { + this.underlyingIntegerMap.put(value, id); + this.putObject(key, value); + } + + protected Map createUnderlyingMap() + { + return HashBiMap.create(); + } + + public V getObject(K name) + { + return super.getObject(name); + } + + public K getNameForObject(V value) + { + return (K)this.inverseObjectRegistry.get(value); + } + + public boolean containsKey(K key) + { + return super.containsKey(key); + } + + public int getIDForObject(V value) + { + return this.underlyingIntegerMap.get(value); + } + + public V getObjectById(int id) + { + return (V)this.underlyingIntegerMap.getByValue(id); + } + + public Iterator iterator() + { + return this.underlyingIntegerMap.iterator(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java b/Client-1.8.9/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java new file mode 100644 index 0000000..a97cb5a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java @@ -0,0 +1,41 @@ +package net.minecraft.util; + +import org.apache.commons.lang3.Validate; + +public class RegistryNamespacedDefaultedByKey extends RegistryNamespaced +{ + private final K defaultValueKey; + private V defaultValue; + + public RegistryNamespacedDefaultedByKey(K defaultValueKeyIn) + { + this.defaultValueKey = defaultValueKeyIn; + } + + public void register(int id, K key, V value) + { + if (this.defaultValueKey.equals(key)) + { + this.defaultValue = value; + } + + super.register(id, key, value); + } + + public void validateKey() + { + Validate.notNull(this.defaultValueKey); + } + + public V getObject(K name) + { + V v = super.getObject(name); + return (V)(v == null ? this.defaultValue : v); + } + + public V getObjectById(int id) + { + V v = super.getObjectById(id); + return (V)(v == null ? this.defaultValue : v); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/RegistrySimple.java b/Client-1.8.9/src/main/java/net/minecraft/util/RegistrySimple.java new file mode 100644 index 0000000..6c550d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/RegistrySimple.java @@ -0,0 +1,54 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RegistrySimple implements IRegistry +{ + private static final Logger logger = LogManager.getLogger(); + protected final Map registryObjects = this.createUnderlyingMap(); + + protected Map createUnderlyingMap() + { + return Maps.newHashMap(); + } + + public V getObject(K name) + { + return this.registryObjects.get(name); + } + + public void putObject(K key, V value) + { + Validate.notNull(key); + Validate.notNull(value); + + if (this.registryObjects.containsKey(key)) + { + logger.debug("Adding duplicate key \'" + key + "\' to registry"); + } + + this.registryObjects.put(key, value); + } + + public Set getKeys() + { + return Collections.unmodifiableSet(this.registryObjects.keySet()); + } + + public boolean containsKey(K key) + { + return this.registryObjects.containsKey(key); + } + + public Iterator iterator() + { + return this.registryObjects.values().iterator(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ReportedException.java b/Client-1.8.9/src/main/java/net/minecraft/util/ReportedException.java new file mode 100644 index 0000000..3cdf3eb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ReportedException.java @@ -0,0 +1,28 @@ +package net.minecraft.util; + +import net.minecraft.crash.CrashReport; + +public class ReportedException extends RuntimeException +{ + private final CrashReport theReportedExceptionCrashReport; + + public ReportedException(CrashReport report) + { + this.theReportedExceptionCrashReport = report; + } + + public CrashReport getCrashReport() + { + return this.theReportedExceptionCrashReport; + } + + public Throwable getCause() + { + return this.theReportedExceptionCrashReport.getCrashCause(); + } + + public String getMessage() + { + return this.theReportedExceptionCrashReport.getDescription(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ResourceLocation.java b/Client-1.8.9/src/main/java/net/minecraft/util/ResourceLocation.java new file mode 100644 index 0000000..337cc23 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ResourceLocation.java @@ -0,0 +1,81 @@ +package net.minecraft.util; + +import org.apache.commons.lang3.Validate; + +public class ResourceLocation +{ + protected final String resourceDomain; + protected final String resourcePath; + + protected ResourceLocation(int p_i45928_1_, String... resourceName) + { + this.resourceDomain = org.apache.commons.lang3.StringUtils.isEmpty(resourceName[0]) ? "minecraft" : resourceName[0].toLowerCase(); + this.resourcePath = resourceName[1]; + Validate.notNull(this.resourcePath); + } + + public ResourceLocation(String resourceName) + { + this(0, splitObjectName(resourceName)); + } + + public ResourceLocation(String resourceDomainIn, String resourcePathIn) + { + this(0, new String[] {resourceDomainIn, resourcePathIn}); + } + + protected static String[] splitObjectName(String toSplit) + { + String[] astring = new String[] {null, toSplit}; + int i = toSplit.indexOf(58); + + if (i >= 0) + { + astring[1] = toSplit.substring(i + 1, toSplit.length()); + + if (i > 1) + { + astring[0] = toSplit.substring(0, i); + } + } + + return astring; + } + + public String getResourcePath() + { + return this.resourcePath; + } + + public String getResourceDomain() + { + return this.resourceDomain; + } + + public String toString() + { + return this.resourceDomain + ':' + this.resourcePath; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ResourceLocation)) + { + return false; + } + else + { + ResourceLocation resourcelocation = (ResourceLocation)p_equals_1_; + return this.resourceDomain.equals(resourcelocation.resourceDomain) && this.resourcePath.equals(resourcelocation.resourcePath); + } + } + + public int hashCode() + { + return 31 * this.resourceDomain.hashCode() + this.resourcePath.hashCode(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Rotations.java b/Client-1.8.9/src/main/java/net/minecraft/util/Rotations.java new file mode 100644 index 0000000..4dea7bc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Rotations.java @@ -0,0 +1,62 @@ +package net.minecraft.util; + +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; + +public class Rotations +{ + protected final float x; + protected final float y; + protected final float z; + + public Rotations(float x, float y, float z) + { + this.x = x; + this.y = y; + this.z = z; + } + + public Rotations(NBTTagList nbt) + { + this.x = nbt.getFloatAt(0); + this.y = nbt.getFloatAt(1); + this.z = nbt.getFloatAt(2); + } + + public NBTTagList writeToNBT() + { + NBTTagList nbttaglist = new NBTTagList(); + nbttaglist.appendTag(new NBTTagFloat(this.x)); + nbttaglist.appendTag(new NBTTagFloat(this.y)); + nbttaglist.appendTag(new NBTTagFloat(this.z)); + return nbttaglist; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof Rotations)) + { + return false; + } + else + { + Rotations rotations = (Rotations)p_equals_1_; + return this.x == rotations.x && this.y == rotations.y && this.z == rotations.z; + } + } + + public float getX() + { + return this.x; + } + + public float getY() + { + return this.y; + } + + public float getZ() + { + return this.z; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ScreenShotHelper.java b/Client-1.8.9/src/main/java/net/minecraft/util/ScreenShotHelper.java new file mode 100644 index 0000000..fe77ed5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ScreenShotHelper.java @@ -0,0 +1,217 @@ +package net.minecraft.util; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.nio.IntBuffer; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ScreenShotHelper { + private static final Logger logger = LogManager.getLogger(); + private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"); + private static IntBuffer pixelBuffer; + private static int[] pixelValues; + + public static IChatComponent lIIIIlIIllIIlIIlIIIlIIllI(File file, int n, int n2, Framebuffer frameBuffer) { + return ScreenShotHelper.lIIIIlIIllIIlIIlIIIlIIllI(file, null, n, n2, frameBuffer); + } + + public static void saveScreenshot(File file, int n, int n2, Framebuffer frameBuffer) { + try { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().shutterSound.getValue()) { + CheatBreaker.getInstance().getAudioManager().playSound("shutter"); + } + File file2 = new File(file, "screenshots"); + if (!file2.exists()) { + file2.mkdir(); + } + if (OpenGlHelper.isFramebufferEnabled()) { + n = frameBuffer.framebufferTextureWidth; + n2 = frameBuffer.framebufferTextureHeight; + } + int n3 = n * n2; + if (pixelBuffer == null || pixelBuffer.capacity() < n3) { + pixelBuffer = BufferUtils.createIntBuffer(n3); + pixelValues = new int[n3]; + } + + GL11.glPixelStorei(3333, 1); + GL11.glPixelStorei(3317, 1); + pixelBuffer.clear(); + + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glBindTexture(3553, frameBuffer.framebufferTexture); + GL11.glGetTexImage(3553, 0, 32993, 33639, pixelBuffer); + } else { + GL11.glReadPixels(0, 0, n, n2, 32993, 33639, pixelBuffer); + } + + pixelBuffer.get(pixelValues); + int n4 = n; + int n5 = n2; + new Thread(() -> { + TextureUtil.processPixelValues(pixelValues, n4, n5); + BufferedImage bufferedImage = null; + if (OpenGlHelper.isFramebufferEnabled()) { + int n33; + bufferedImage = new BufferedImage(frameBuffer.framebufferWidth, frameBuffer.framebufferHeight, 1); + for (int i = n33 = frameBuffer.framebufferTextureHeight - frameBuffer.framebufferHeight; i < frameBuffer.framebufferTextureHeight; ++i) { + for (int j = 0; j < frameBuffer.framebufferWidth; ++j) { + bufferedImage.setRGB(j, i - n33, pixelValues[i * frameBuffer.framebufferTextureWidth + j]); + } + } + } else { + bufferedImage = new BufferedImage(n4, n5, 1); + bufferedImage.setRGB(0, 0, n4, n5, pixelValues, 0, n4); + } + File file22 = ScreenShotHelper.getTimestampedPNGFileForDirectory(file2); + try { + ImageIO.write(bufferedImage, "png", file22); + ChatComponentText open = new ChatComponentText(EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().compactOptions.getValue() ? " [OPN]" : " [Open]")); + open.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, file22.getCanonicalPath())); + open.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(file22.getName()))); + ChatComponentText copy = new ChatComponentText(EnumChatFormatting.BLUE + "" + EnumChatFormatting.BOLD + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().compactOptions.getValue() ? " [CPY]" : " [Copy]")); + copy.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.COPY_SCREENSHOT, file22.getName())); + copy.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("Copy the screenshot"))); + ChatComponentText upload = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().compactOptions.getValue() ? " [UPL]" : " [Upload]")); + upload.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.UPLOAD_SCREENSHOT, file22.getName())); + upload.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("Upload to " + EnumChatFormatting.GREEN + "imgur.com & open"))); + ChatComponentText savedMessage = new ChatComponentText("Saved" + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().copyAutomatically.getValue() ? " and copied " : " ") + "screenshot"); + savedMessage.getChatStyle().setUnderlined(true); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().openOption.getValue()) savedMessage.appendSibling(open); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().copyOption.getValue()) savedMessage.appendSibling(copy); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().uploadOption.getValue()) savedMessage.appendSibling(upload); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().copyAutomatically.getValue()) IllIlIIIllllIIllIIlllIIlI(file22.getName()); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().sendScreenshotMessage.getValue()) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(savedMessage); + } + + } catch (IOException iOException) { + logger.warn("Couldn't save screenshot"); + } + }).start(); + } catch (Exception exception) { + logger.warn("Couldn't save screenshot", exception); + } + } + + public static void IllIlIIIllllIIllIIlllIIlI(String var1) { + File var2 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "screenshots" + File.separator + var1); + List listOfFiles = new ArrayList(); + listOfFiles.add(var2); + + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Info", "&9Copied &fscreenshot.", 2000L); + + IllIlIIIllllIIIllIIlllIIll ft = new IllIlIIIllllIIIllIIlllIIll(listOfFiles); + + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ft, (clipboard, contents) -> System.out.println("Lost ownership")); + } + + public static class IllIlIIIllllIIIllIIlllIIll implements Transferable { + + private final List n; + + public IllIlIIIllllIIIllIIlllIIll(List n) { + this.n = n; + } + + @Override + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[]{DataFlavor.javaFileListFlavor}; + } + + @Override + public boolean isDataFlavorSupported(DataFlavor flavor) { + return DataFlavor.javaFileListFlavor.equals(flavor); + } + + @Override + public Object getTransferData(DataFlavor flavor) { + return n; + } + } + + public static IChatComponent lIIIIlIIllIIlIIlIIIlIIllI(File file, String string, int n, int n2, Framebuffer frameBuffer) { + try { + File file2 = new File(file, "screenshots"); + if (!file2.exists()) { + file2.mkdir(); + } + if (OpenGlHelper.isFramebufferEnabled()) { + n = frameBuffer.framebufferTextureWidth; + n2 = frameBuffer.framebufferTextureHeight; + } + int n3 = n * n2; + if (pixelBuffer == null || pixelBuffer.capacity() < n3) { + pixelBuffer = BufferUtils.createIntBuffer(n3); + pixelValues = new int[n3]; + } + GL11.glPixelStorei(3333, 1); + GL11.glPixelStorei(3317, 1); + pixelBuffer.clear(); + + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glBindTexture(3553, frameBuffer.framebufferTexture); + GL11.glGetTexImage(3553, 0, 32993, 33639, pixelBuffer); + } else { + GL11.glReadPixels(0, 0, n, n2, 32993, 33639, pixelBuffer); + } + + pixelBuffer.get(pixelValues); + TextureUtil.processPixelValues(pixelValues, n, n2); + BufferedImage bufferedImage; + if (OpenGlHelper.isFramebufferEnabled()) { + int n4; + bufferedImage = new BufferedImage(frameBuffer.framebufferWidth, frameBuffer.framebufferHeight, 1); + for (int i = n4 = frameBuffer.framebufferTextureHeight - frameBuffer.framebufferHeight; i < frameBuffer.framebufferTextureHeight; ++i) { + for (int j = 0; j < frameBuffer.framebufferWidth; ++j) { + bufferedImage.setRGB(j, i - n4, pixelValues[i * frameBuffer.framebufferTextureWidth + j]); + } + } + } else { + bufferedImage = new BufferedImage(n, n2, 1); + bufferedImage.setRGB(0, 0, n, n2, pixelValues, 0, n); + } + + File file3 = string == null ? ScreenShotHelper.getTimestampedPNGFileForDirectory(file2) : new File(file2, string); + ImageIO.write(bufferedImage, "png", file3); + ChatComponentText chatComponentText = new ChatComponentText(file3.getName()); + chatComponentText.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, file3.getAbsolutePath())); + chatComponentText.getChatStyle().setUnderlined(true); + return new ChatComponentTranslation("screenshot.success", chatComponentText); + } catch (Exception exception) { + logger.warn("Couldn't save screenshot", exception); + return new ChatComponentTranslation("screenshot.failure", exception.getMessage()); + } + } + + private static File getTimestampedPNGFileForDirectory(File file) { + String string = dateFormat.format(new Date()); + int n = 1; + File file2; + while ((file2 = new File(file, string + (n == 1 ? "" : "_" + n) + ".png")).exists()) { + ++n; + } + return file2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Session.java b/Client-1.8.9/src/main/java/net/minecraft/util/Session.java new file mode 100644 index 0000000..3565998 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Session.java @@ -0,0 +1,87 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import com.mojang.util.UUIDTypeAdapter; +import java.util.Map; +import java.util.UUID; + +public class Session +{ + private final String username; + private final String playerID; + private final String token; + private final Session.Type sessionType; + + public Session(String usernameIn, String playerIDIn, String tokenIn, String sessionTypeIn) + { + this.username = usernameIn; + this.playerID = playerIDIn; + this.token = tokenIn; + this.sessionType = Session.Type.setSessionType(sessionTypeIn); + } + + public String getSessionID() + { + return "token:" + this.token + ":" + this.playerID; + } + + public String getPlayerID() + { + return this.playerID; + } + + public String getUsername() + { + return this.username; + } + + public String getToken() + { + return this.token; + } + + public GameProfile getProfile() + { + try + { + UUID uuid = UUIDTypeAdapter.fromString(this.getPlayerID()); + return new GameProfile(uuid, this.getUsername()); + } + catch (IllegalArgumentException var2) + { + return new GameProfile((UUID)null, this.getUsername()); + } + } + + public Session.Type getSessionType() + { + return this.sessionType; + } + + public static enum Type + { + LEGACY("legacy"), + MOJANG("mojang"); + + private static final Map SESSION_TYPES = Maps.newHashMap(); + private final String sessionType; + + private Type(String sessionTypeIn) + { + this.sessionType = sessionTypeIn; + } + + public static Session.Type setSessionType(String sessionTypeIn) + { + return (Session.Type)SESSION_TYPES.get(sessionTypeIn.toLowerCase()); + } + + static { + for (Session.Type session$type : values()) + { + SESSION_TYPES.put(session$type.sessionType, session$type); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/StatCollector.java b/Client-1.8.9/src/main/java/net/minecraft/util/StatCollector.java new file mode 100644 index 0000000..b950be8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/StatCollector.java @@ -0,0 +1,32 @@ +package net.minecraft.util; + +public class StatCollector +{ + private static StringTranslate localizedName = StringTranslate.getInstance(); + private static StringTranslate fallbackTranslator = new StringTranslate(); + + public static String translateToLocal(String key) + { + return localizedName.translateKey(key); + } + + public static String translateToLocalFormatted(String key, Object... format) + { + return localizedName.translateKeyFormat(key, format); + } + + public static String translateToFallback(String key) + { + return fallbackTranslator.translateKey(key); + } + + public static boolean canTranslate(String key) + { + return localizedName.isKeyTranslated(key); + } + + public static long getLastTranslationUpdateTimeInMilliseconds() + { + return localizedName.getLastUpdateTimeInMilliseconds(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/StringTranslate.java b/Client-1.8.9/src/main/java/net/minecraft/util/StringTranslate.java new file mode 100644 index 0000000..71a0c89 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/StringTranslate.java @@ -0,0 +1,97 @@ +package net.minecraft.util; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.io.InputStream; +import java.util.IllegalFormatException; +import java.util.Map; +import java.util.regex.Pattern; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +public class StringTranslate +{ + private static final Pattern numericVariablePattern = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + private static final Splitter equalSignSplitter = Splitter.on('=').limit(2); + private static StringTranslate instance = new StringTranslate(); + private final Map languageList = Maps.newHashMap(); + private long lastUpdateTimeInMilliseconds; + + public StringTranslate() + { + try + { + InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); + + for (String s : IOUtils.readLines(inputstream, Charsets.UTF_8)) + { + if (!s.isEmpty() && s.charAt(0) != 35) + { + String[] astring = (String[])Iterables.toArray(equalSignSplitter.split(s), String.class); + + if (astring != null && astring.length == 2) + { + String s1 = astring[0]; + String s2 = numericVariablePattern.matcher(astring[1]).replaceAll("%$1s"); + this.languageList.put(s1, s2); + } + } + } + + this.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } + catch (IOException var7) + { + ; + } + } + + static StringTranslate getInstance() + { + return instance; + } + + public static synchronized void replaceWith(Map p_135063_0_) + { + instance.languageList.clear(); + instance.languageList.putAll(p_135063_0_); + instance.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } + + public synchronized String translateKey(String key) + { + return this.tryTranslateKey(key); + } + + public synchronized String translateKeyFormat(String key, Object... format) + { + String s = this.tryTranslateKey(key); + + try + { + return String.format(s, format); + } + catch (IllegalFormatException var5) + { + return "Format error: " + s; + } + } + + private String tryTranslateKey(String key) + { + String s = (String)this.languageList.get(key); + return s == null ? key : s; + } + + public synchronized boolean isKeyTranslated(String key) + { + return this.languageList.containsKey(key); + } + + public long getLastUpdateTimeInMilliseconds() + { + return this.lastUpdateTimeInMilliseconds; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/StringUtils.java b/Client-1.8.9/src/main/java/net/minecraft/util/StringUtils.java new file mode 100644 index 0000000..1c0e582 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/StringUtils.java @@ -0,0 +1,26 @@ +package net.minecraft.util; + +import java.util.regex.Pattern; + +public class StringUtils +{ + private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); + + public static String ticksToElapsedTime(int ticks) + { + int i = ticks / 20; + int j = i / 60; + i = i % 60; + return i < 10 ? j + ":0" + i : j + ":" + i; + } + + public static String stripControlCodes(String text) + { + return patternControlCode.matcher(text).replaceAll(""); + } + + public static boolean isNullOrEmpty(String string) + { + return org.apache.commons.lang3.StringUtils.isEmpty(string); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/ThreadSafeBoundList.java b/Client-1.8.9/src/main/java/net/minecraft/util/ThreadSafeBoundList.java new file mode 100644 index 0000000..1dbc5ad --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/ThreadSafeBoundList.java @@ -0,0 +1,64 @@ +package net.minecraft.util; + +import java.lang.reflect.Array; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +public class ThreadSafeBoundList +{ + private final T[] field_152759_a; + private final Class field_152760_b; + private final ReadWriteLock field_152761_c = new ReentrantReadWriteLock(); + private int field_152762_d; + private int field_152763_e; + + public ThreadSafeBoundList(Class p_i1126_1_, int p_i1126_2_) + { + this.field_152760_b = p_i1126_1_; + this.field_152759_a = (T[])Array.newInstance(p_i1126_1_, p_i1126_2_); + } + + public T func_152757_a(T p_152757_1_) + { + this.field_152761_c.writeLock().lock(); + this.field_152759_a[this.field_152763_e] = p_152757_1_; + this.field_152763_e = (this.field_152763_e + 1) % this.func_152758_b(); + + if (this.field_152762_d < this.func_152758_b()) + { + ++this.field_152762_d; + } + + this.field_152761_c.writeLock().unlock(); + return (T)p_152757_1_; + } + + public int func_152758_b() + { + this.field_152761_c.readLock().lock(); + int i = this.field_152759_a.length; + this.field_152761_c.readLock().unlock(); + return i; + } + + public T[] func_152756_c() + { + T[] at = (T[])((Object[])Array.newInstance(this.field_152760_b, this.field_152762_d)); + this.field_152761_c.readLock().lock(); + + for (int i = 0; i < this.field_152762_d; ++i) + { + int j = (this.field_152763_e - this.field_152762_d + i) % this.func_152758_b(); + + if (j < 0) + { + j += this.func_152758_b(); + } + + at[i] = this.field_152759_a[j]; + } + + this.field_152761_c.readLock().unlock(); + return at; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Timer.java b/Client-1.8.9/src/main/java/net/minecraft/util/Timer.java new file mode 100644 index 0000000..a72d42f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Timer.java @@ -0,0 +1,70 @@ +package net.minecraft.util; + +import net.minecraft.client.Minecraft; + +public class Timer +{ + float ticksPerSecond; + private double lastHRTime; + public int elapsedTicks; + public float renderPartialTicks; + public float timerSpeed = 1.0F; + public float elapsedPartialTicks; + private long lastSyncSysClock; + private long lastSyncHRClock; + private long counter; + private double timeSyncAdjustment = 1.0D; + + public Timer(float tps) + { + this.ticksPerSecond = tps; + this.lastSyncSysClock = Minecraft.getSystemTime(); + this.lastSyncHRClock = System.nanoTime() / 1000000L; + } + + public void updateTimer() + { + long i = Minecraft.getSystemTime(); + long j = i - this.lastSyncSysClock; + long k = System.nanoTime() / 1000000L; + double d0 = (double)k / 1000.0D; + + if (j <= 1000L && j >= 0L) + { + this.counter += j; + + if (this.counter > 1000L) + { + long l = k - this.lastSyncHRClock; + double d1 = (double)this.counter / (double)l; + this.timeSyncAdjustment += (d1 - this.timeSyncAdjustment) * 0.20000000298023224D; + this.lastSyncHRClock = k; + this.counter = 0L; + } + + if (this.counter < 0L) + { + this.lastSyncHRClock = k; + } + } + else + { + this.lastHRTime = d0; + } + + this.lastSyncSysClock = i; + double d2 = (d0 - this.lastHRTime) * this.timeSyncAdjustment; + this.lastHRTime = d0; + d2 = MathHelper.clamp_double(d2, 0.0D, 1.0D); + this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + d2 * (double)this.timerSpeed * (double)this.ticksPerSecond); + this.elapsedTicks = (int)this.elapsedPartialTicks; + this.elapsedPartialTicks -= (float)this.elapsedTicks; + + if (this.elapsedTicks > 10) + { + this.elapsedTicks = 10; + } + + this.renderPartialTicks = this.elapsedPartialTicks; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Tuple.java b/Client-1.8.9/src/main/java/net/minecraft/util/Tuple.java new file mode 100644 index 0000000..b36c17a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Tuple.java @@ -0,0 +1,23 @@ +package net.minecraft.util; + +public class Tuple +{ + private A a; + private B b; + + public Tuple(A aIn, B bIn) + { + this.a = aIn; + this.b = bIn; + } + + public A getFirst() + { + return this.a; + } + + public B getSecond() + { + return this.b; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java b/Client-1.8.9/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java new file mode 100644 index 0000000..670f22f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java @@ -0,0 +1,27 @@ +package net.minecraft.util; + +public class TupleIntJsonSerializable +{ + private int integerValue; + private IJsonSerializable jsonSerializableValue; + + public int getIntegerValue() + { + return this.integerValue; + } + + public void setIntegerValue(int integerValueIn) + { + this.integerValue = integerValueIn; + } + + public T getJsonSerializableValue() + { + return (T)this.jsonSerializableValue; + } + + public void setJsonSerializableValue(IJsonSerializable jsonSerializableValueIn) + { + this.jsonSerializableValue = jsonSerializableValueIn; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Util.java b/Client-1.8.9/src/main/java/net/minecraft/util/Util.java new file mode 100644 index 0000000..321e08e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Util.java @@ -0,0 +1,48 @@ +package net.minecraft.util; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import org.apache.logging.log4j.Logger; + +public class Util +{ + public static Util.EnumOS getOSType() + { + String s = System.getProperty("os.name").toLowerCase(); + return s.contains("win") ? Util.EnumOS.WINDOWS : (s.contains("mac") ? Util.EnumOS.OSX : (s.contains("solaris") ? Util.EnumOS.SOLARIS : (s.contains("sunos") ? Util.EnumOS.SOLARIS : (s.contains("linux") ? Util.EnumOS.LINUX : (s.contains("unix") ? Util.EnumOS.LINUX : Util.EnumOS.UNKNOWN))))); + } + + public static V runTask(FutureTask task, Logger logger) + { + try + { + task.run(); + return task.get(); + } + catch (ExecutionException executionexception) + { + logger.fatal((String)"Error executing task", (Throwable)executionexception); + + if (executionexception.getCause() instanceof OutOfMemoryError) + { + OutOfMemoryError outofmemoryerror = (OutOfMemoryError)executionexception.getCause(); + throw outofmemoryerror; + } + } + catch (InterruptedException interruptedexception) + { + logger.fatal((String)"Error executing task", (Throwable)interruptedexception); + } + + return (V)((Object)null); + } + + public static enum EnumOS + { + LINUX, + SOLARIS, + WINDOWS, + OSX, + UNKNOWN; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Vec3.java b/Client-1.8.9/src/main/java/net/minecraft/util/Vec3.java new file mode 100644 index 0000000..326fec7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Vec3.java @@ -0,0 +1,173 @@ +package net.minecraft.util; + +public class Vec3 +{ + public final double xCoord; + public final double yCoord; + public final double zCoord; + + public Vec3(double x, double y, double z) + { + if (x == -0.0D) + { + x = 0.0D; + } + + if (y == -0.0D) + { + y = 0.0D; + } + + if (z == -0.0D) + { + z = 0.0D; + } + + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + } + + public Vec3(Vec3i p_i46377_1_) + { + this((double)p_i46377_1_.getX(), (double)p_i46377_1_.getY(), (double)p_i46377_1_.getZ()); + } + + public Vec3 subtractReverse(Vec3 vec) + { + return new Vec3(vec.xCoord - this.xCoord, vec.yCoord - this.yCoord, vec.zCoord - this.zCoord); + } + + public Vec3 normalize() + { + double d0 = (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + return d0 < 1.0E-4D ? new Vec3(0.0D, 0.0D, 0.0D) : new Vec3(this.xCoord / d0, this.yCoord / d0, this.zCoord / d0); + } + + public double dotProduct(Vec3 vec) + { + return this.xCoord * vec.xCoord + this.yCoord * vec.yCoord + this.zCoord * vec.zCoord; + } + + public Vec3 crossProduct(Vec3 vec) + { + return new Vec3(this.yCoord * vec.zCoord - this.zCoord * vec.yCoord, this.zCoord * vec.xCoord - this.xCoord * vec.zCoord, this.xCoord * vec.yCoord - this.yCoord * vec.xCoord); + } + + public Vec3 subtract(Vec3 vec) + { + return this.subtract(vec.xCoord, vec.yCoord, vec.zCoord); + } + + public Vec3 subtract(double x, double y, double z) + { + return this.addVector(-x, -y, -z); + } + + public Vec3 add(Vec3 vec) + { + return this.addVector(vec.xCoord, vec.yCoord, vec.zCoord); + } + + public Vec3 addVector(double x, double y, double z) + { + return new Vec3(this.xCoord + x, this.yCoord + y, this.zCoord + z); + } + + public double distanceTo(Vec3 vec) + { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + return (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2); + } + + public double squareDistanceTo(Vec3 vec) + { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public double lengthVector() + { + return (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + } + + public Vec3 getIntermediateWithXValue(Vec3 vec, double x) + { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + + if (d0 * d0 < 1.0000000116860974E-7D) + { + return null; + } + else + { + double d3 = (x - this.xCoord) / d0; + return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null; + } + } + + public Vec3 getIntermediateWithYValue(Vec3 vec, double y) + { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + + if (d1 * d1 < 1.0000000116860974E-7D) + { + return null; + } + else + { + double d3 = (y - this.yCoord) / d1; + return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null; + } + } + + public Vec3 getIntermediateWithZValue(Vec3 vec, double z) + { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + + if (d2 * d2 < 1.0000000116860974E-7D) + { + return null; + } + else + { + double d3 = (z - this.zCoord) / d2; + return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null; + } + } + + public String toString() + { + return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")"; + } + + public Vec3 rotatePitch(float pitch) + { + float f = MathHelper.cos(pitch); + float f1 = MathHelper.sin(pitch); + double d0 = this.xCoord; + double d1 = this.yCoord * (double)f + this.zCoord * (double)f1; + double d2 = this.zCoord * (double)f - this.yCoord * (double)f1; + return new Vec3(d0, d1, d2); + } + + public Vec3 rotateYaw(float yaw) + { + float f = MathHelper.cos(yaw); + float f1 = MathHelper.sin(yaw); + double d0 = this.xCoord * (double)f + this.zCoord * (double)f1; + double d1 = this.yCoord; + double d2 = this.zCoord * (double)f - this.xCoord * (double)f1; + return new Vec3(d0, d1, d2); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Vec3i.java b/Client-1.8.9/src/main/java/net/minecraft/util/Vec3i.java new file mode 100644 index 0000000..b8c545f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Vec3i.java @@ -0,0 +1,96 @@ +package net.minecraft.util; + +import com.google.common.base.Objects; + +public class Vec3i implements Comparable +{ + public static final Vec3i NULL_VECTOR = new Vec3i(0, 0, 0); + private final int x; + private final int y; + private final int z; + + public Vec3i(int xIn, int yIn, int zIn) + { + this.x = xIn; + this.y = yIn; + this.z = zIn; + } + + public Vec3i(double xIn, double yIn, double zIn) + { + this(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn)); + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof Vec3i)) + { + return false; + } + else + { + Vec3i vec3i = (Vec3i)p_equals_1_; + return this.getX() == vec3i.getX() && (this.getY() != vec3i.getY() ? false : this.getZ() == vec3i.getZ()); + } + } + + public int hashCode() + { + return (this.getY() + this.getZ() * 31) * 31 + this.getX(); + } + + public int compareTo(Vec3i p_compareTo_1_) + { + return this.getY() == p_compareTo_1_.getY() ? (this.getZ() == p_compareTo_1_.getZ() ? this.getX() - p_compareTo_1_.getX() : this.getZ() - p_compareTo_1_.getZ()) : this.getY() - p_compareTo_1_.getY(); + } + + public int getX() + { + return this.x; + } + + public int getY() + { + return this.y; + } + + public int getZ() + { + return this.z; + } + + public Vec3i crossProduct(Vec3i vec) + { + return new Vec3i(this.getY() * vec.getZ() - this.getZ() * vec.getY(), this.getZ() * vec.getX() - this.getX() * vec.getZ(), this.getX() * vec.getY() - this.getY() * vec.getX()); + } + + public double distanceSq(double toX, double toY, double toZ) + { + double d0 = (double)this.getX() - toX; + double d1 = (double)this.getY() - toY; + double d2 = (double)this.getZ() - toZ; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public double distanceSqToCenter(double xIn, double yIn, double zIn) + { + double d0 = (double)this.getX() + 0.5D - xIn; + double d1 = (double)this.getY() + 0.5D - yIn; + double d2 = (double)this.getZ() + 0.5D - zIn; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + public double distanceSq(Vec3i to) + { + return this.distanceSq((double)to.getX(), (double)to.getY(), (double)to.getZ()); + } + + public String toString() + { + return Objects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Vec4b.java b/Client-1.8.9/src/main/java/net/minecraft/util/Vec4b.java new file mode 100644 index 0000000..edb7248 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Vec4b.java @@ -0,0 +1,71 @@ +package net.minecraft.util; + +public class Vec4b +{ + private byte field_176117_a; + private byte field_176115_b; + private byte field_176116_c; + private byte field_176114_d; + + public Vec4b(byte p_i45555_1_, byte p_i45555_2_, byte p_i45555_3_, byte p_i45555_4_) + { + this.field_176117_a = p_i45555_1_; + this.field_176115_b = p_i45555_2_; + this.field_176116_c = p_i45555_3_; + this.field_176114_d = p_i45555_4_; + } + + public Vec4b(Vec4b p_i45556_1_) + { + this.field_176117_a = p_i45556_1_.field_176117_a; + this.field_176115_b = p_i45556_1_.field_176115_b; + this.field_176116_c = p_i45556_1_.field_176116_c; + this.field_176114_d = p_i45556_1_.field_176114_d; + } + + public byte func_176110_a() + { + return this.field_176117_a; + } + + public byte func_176112_b() + { + return this.field_176115_b; + } + + public byte func_176113_c() + { + return this.field_176116_c; + } + + public byte func_176111_d() + { + return this.field_176114_d; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof Vec4b)) + { + return false; + } + else + { + Vec4b vec4b = (Vec4b)p_equals_1_; + return this.field_176117_a != vec4b.field_176117_a ? false : (this.field_176114_d != vec4b.field_176114_d ? false : (this.field_176115_b != vec4b.field_176115_b ? false : this.field_176116_c == vec4b.field_176116_c)); + } + } + + public int hashCode() + { + int i = this.field_176117_a; + i = 31 * i + this.field_176115_b; + i = 31 * i + this.field_176116_c; + i = 31 * i + this.field_176114_d; + return i; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/Vector3d.java b/Client-1.8.9/src/main/java/net/minecraft/util/Vector3d.java new file mode 100644 index 0000000..a93501e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/Vector3d.java @@ -0,0 +1,13 @@ +package net.minecraft.util; + +public class Vector3d +{ + public double x; + public double y; + public double z; + + public Vector3d() + { + this.x = this.y = this.z = 0.0D; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandom.java b/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandom.java new file mode 100644 index 0000000..e6bfeea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandom.java @@ -0,0 +1,62 @@ +package net.minecraft.util; + +import java.util.Collection; +import java.util.Random; + +public class WeightedRandom +{ + public static int getTotalWeight(Collection collection) + { + int i = 0; + + for (WeightedRandom.Item weightedrandom$item : collection) + { + i += weightedrandom$item.itemWeight; + } + + return i; + } + + public static T getRandomItem(Random random, Collection collection, int totalWeight) + { + if (totalWeight <= 0) + { + throw new IllegalArgumentException(); + } + else + { + int i = random.nextInt(totalWeight); + return getRandomItem(collection, i); + } + } + + public static T getRandomItem(Collection collection, int weight) + { + for (T t : collection) + { + weight -= t.itemWeight; + + if (weight < 0) + { + return t; + } + } + + return (T)null; + } + + public static T getRandomItem(Random random, Collection collection) + { + return getRandomItem(random, collection, getTotalWeight(collection)); + } + + public static class Item + { + protected int itemWeight; + + public Item(int itemWeightIn) + { + this.itemWeight = itemWeightIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandomChestContent.java b/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandomChestContent.java new file mode 100644 index 0000000..09a4039 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandomChestContent.java @@ -0,0 +1,90 @@ +package net.minecraft.util; + +import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityDispenser; + +public class WeightedRandomChestContent extends WeightedRandom.Item +{ + private ItemStack theItemId; + private int minStackSize; + private int maxStackSize; + + public WeightedRandomChestContent(Item p_i45311_1_, int p_i45311_2_, int minimumChance, int maximumChance, int itemWeightIn) + { + super(itemWeightIn); + this.theItemId = new ItemStack(p_i45311_1_, 1, p_i45311_2_); + this.minStackSize = minimumChance; + this.maxStackSize = maximumChance; + } + + public WeightedRandomChestContent(ItemStack stack, int minimumChance, int maximumChance, int itemWeightIn) + { + super(itemWeightIn); + this.theItemId = stack; + this.minStackSize = minimumChance; + this.maxStackSize = maximumChance; + } + + public static void generateChestContents(Random random, List listIn, IInventory inv, int max) + { + for (int i = 0; i < max; ++i) + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, listIn); + int j = weightedrandomchestcontent.minStackSize + random.nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); + + if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) + { + ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); + itemstack1.stackSize = j; + inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack1); + } + else + { + for (int k = 0; k < j; ++k) + { + ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); + itemstack.stackSize = 1; + inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack); + } + } + } + } + + public static void generateDispenserContents(Random random, List listIn, TileEntityDispenser dispenser, int max) + { + for (int i = 0; i < max; ++i) + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, listIn); + int j = weightedrandomchestcontent.minStackSize + random.nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); + + if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) + { + ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); + itemstack1.stackSize = j; + dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack1); + } + else + { + for (int k = 0; k < j; ++k) + { + ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); + itemstack.stackSize = 1; + dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack); + } + } + } + } + + public static List func_177629_a(List p_177629_0_, WeightedRandomChestContent... p_177629_1_) + { + List list = Lists.newArrayList(p_177629_0_); + Collections.addAll(list, p_177629_1_); + return list; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandomFishable.java b/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandomFishable.java new file mode 100644 index 0000000..5f15f78 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/util/WeightedRandomFishable.java @@ -0,0 +1,60 @@ +package net.minecraft.util; + +import java.util.Random; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.item.ItemStack; + +public class WeightedRandomFishable extends WeightedRandom.Item +{ + private final ItemStack returnStack; + private float maxDamagePercent; + private boolean enchantable; + + public WeightedRandomFishable(ItemStack returnStackIn, int itemWeightIn) + { + super(itemWeightIn); + this.returnStack = returnStackIn; + } + + public ItemStack getItemStack(Random random) + { + ItemStack itemstack = this.returnStack.copy(); + + if (this.maxDamagePercent > 0.0F) + { + int i = (int)(this.maxDamagePercent * (float)this.returnStack.getMaxDamage()); + int j = itemstack.getMaxDamage() - random.nextInt(random.nextInt(i) + 1); + + if (j > i) + { + j = i; + } + + if (j < 1) + { + j = 1; + } + + itemstack.setItemDamage(j); + } + + if (this.enchantable) + { + EnchantmentHelper.addRandomEnchantment(random, itemstack, 30); + } + + return itemstack; + } + + public WeightedRandomFishable setMaxDamagePercent(float maxDamagePercentIn) + { + this.maxDamagePercent = maxDamagePercentIn; + return this; + } + + public WeightedRandomFishable setEnchantable() + { + this.enchantable = true; + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/village/MerchantRecipe.java b/Client-1.8.9/src/main/java/net/minecraft/village/MerchantRecipe.java new file mode 100644 index 0000000..f43bfd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/village/MerchantRecipe.java @@ -0,0 +1,153 @@ +package net.minecraft.village; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class MerchantRecipe +{ + private ItemStack itemToBuy; + private ItemStack secondItemToBuy; + private ItemStack itemToSell; + private int toolUses; + private int maxTradeUses; + private boolean rewardsExp; + + public MerchantRecipe(NBTTagCompound tagCompound) + { + this.readFromTags(tagCompound); + } + + public MerchantRecipe(ItemStack buy1, ItemStack buy2, ItemStack sell) + { + this(buy1, buy2, sell, 0, 7); + } + + public MerchantRecipe(ItemStack buy1, ItemStack buy2, ItemStack sell, int toolUsesIn, int maxTradeUsesIn) + { + this.itemToBuy = buy1; + this.secondItemToBuy = buy2; + this.itemToSell = sell; + this.toolUses = toolUsesIn; + this.maxTradeUses = maxTradeUsesIn; + this.rewardsExp = true; + } + + public MerchantRecipe(ItemStack buy1, ItemStack sell) + { + this(buy1, (ItemStack)null, sell); + } + + public MerchantRecipe(ItemStack buy1, Item sellItem) + { + this(buy1, new ItemStack(sellItem)); + } + + public ItemStack getItemToBuy() + { + return this.itemToBuy; + } + + public ItemStack getSecondItemToBuy() + { + return this.secondItemToBuy; + } + + public boolean hasSecondItemToBuy() + { + return this.secondItemToBuy != null; + } + + public ItemStack getItemToSell() + { + return this.itemToSell; + } + + public int getToolUses() + { + return this.toolUses; + } + + public int getMaxTradeUses() + { + return this.maxTradeUses; + } + + public void incrementToolUses() + { + ++this.toolUses; + } + + public void increaseMaxTradeUses(int increment) + { + this.maxTradeUses += increment; + } + + public boolean isRecipeDisabled() + { + return this.toolUses >= this.maxTradeUses; + } + + public void compensateToolUses() + { + this.toolUses = this.maxTradeUses; + } + + public boolean getRewardsExp() + { + return this.rewardsExp; + } + + public void readFromTags(NBTTagCompound tagCompound) + { + NBTTagCompound nbttagcompound = tagCompound.getCompoundTag("buy"); + this.itemToBuy = ItemStack.loadItemStackFromNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = tagCompound.getCompoundTag("sell"); + this.itemToSell = ItemStack.loadItemStackFromNBT(nbttagcompound1); + + if (tagCompound.hasKey("buyB", 10)) + { + this.secondItemToBuy = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("buyB")); + } + + if (tagCompound.hasKey("uses", 99)) + { + this.toolUses = tagCompound.getInteger("uses"); + } + + if (tagCompound.hasKey("maxUses", 99)) + { + this.maxTradeUses = tagCompound.getInteger("maxUses"); + } + else + { + this.maxTradeUses = 7; + } + + if (tagCompound.hasKey("rewardExp", 1)) + { + this.rewardsExp = tagCompound.getBoolean("rewardExp"); + } + else + { + this.rewardsExp = true; + } + } + + public NBTTagCompound writeToTags() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("buy", this.itemToBuy.writeToNBT(new NBTTagCompound())); + nbttagcompound.setTag("sell", this.itemToSell.writeToNBT(new NBTTagCompound())); + + if (this.secondItemToBuy != null) + { + nbttagcompound.setTag("buyB", this.secondItemToBuy.writeToNBT(new NBTTagCompound())); + } + + nbttagcompound.setInteger("uses", this.toolUses); + nbttagcompound.setInteger("maxUses", this.maxTradeUses); + nbttagcompound.setBoolean("rewardExp", this.rewardsExp); + return nbttagcompound; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/village/MerchantRecipeList.java b/Client-1.8.9/src/main/java/net/minecraft/village/MerchantRecipeList.java new file mode 100644 index 0000000..230d5fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/village/MerchantRecipeList.java @@ -0,0 +1,130 @@ +package net.minecraft.village; + +import java.io.IOException; +import java.util.ArrayList; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.PacketBuffer; + +public class MerchantRecipeList extends ArrayList +{ + public MerchantRecipeList() + { + } + + public MerchantRecipeList(NBTTagCompound compound) + { + this.readRecipiesFromTags(compound); + } + + public MerchantRecipe canRecipeBeUsed(ItemStack p_77203_1_, ItemStack p_77203_2_, int p_77203_3_) + { + if (p_77203_3_ > 0 && p_77203_3_ < this.size()) + { + MerchantRecipe merchantrecipe1 = (MerchantRecipe)this.get(p_77203_3_); + return !this.func_181078_a(p_77203_1_, merchantrecipe1.getItemToBuy()) || (p_77203_2_ != null || merchantrecipe1.hasSecondItemToBuy()) && (!merchantrecipe1.hasSecondItemToBuy() || !this.func_181078_a(p_77203_2_, merchantrecipe1.getSecondItemToBuy())) || p_77203_1_.stackSize < merchantrecipe1.getItemToBuy().stackSize || merchantrecipe1.hasSecondItemToBuy() && p_77203_2_.stackSize < merchantrecipe1.getSecondItemToBuy().stackSize ? null : merchantrecipe1; + } + else + { + for (int i = 0; i < this.size(); ++i) + { + MerchantRecipe merchantrecipe = (MerchantRecipe)this.get(i); + + if (this.func_181078_a(p_77203_1_, merchantrecipe.getItemToBuy()) && p_77203_1_.stackSize >= merchantrecipe.getItemToBuy().stackSize && (!merchantrecipe.hasSecondItemToBuy() && p_77203_2_ == null || merchantrecipe.hasSecondItemToBuy() && this.func_181078_a(p_77203_2_, merchantrecipe.getSecondItemToBuy()) && p_77203_2_.stackSize >= merchantrecipe.getSecondItemToBuy().stackSize)) + { + return merchantrecipe; + } + } + + return null; + } + } + + private boolean func_181078_a(ItemStack p_181078_1_, ItemStack p_181078_2_) + { + return ItemStack.areItemsEqual(p_181078_1_, p_181078_2_) && (!p_181078_2_.hasTagCompound() || p_181078_1_.hasTagCompound() && NBTUtil.func_181123_a(p_181078_2_.getTagCompound(), p_181078_1_.getTagCompound(), false)); + } + + public void writeToBuf(PacketBuffer buffer) + { + buffer.writeByte((byte)(this.size() & 255)); + + for (int i = 0; i < this.size(); ++i) + { + MerchantRecipe merchantrecipe = (MerchantRecipe)this.get(i); + buffer.writeItemStackToBuffer(merchantrecipe.getItemToBuy()); + buffer.writeItemStackToBuffer(merchantrecipe.getItemToSell()); + ItemStack itemstack = merchantrecipe.getSecondItemToBuy(); + buffer.writeBoolean(itemstack != null); + + if (itemstack != null) + { + buffer.writeItemStackToBuffer(itemstack); + } + + buffer.writeBoolean(merchantrecipe.isRecipeDisabled()); + buffer.writeInt(merchantrecipe.getToolUses()); + buffer.writeInt(merchantrecipe.getMaxTradeUses()); + } + } + + public static MerchantRecipeList readFromBuf(PacketBuffer buffer) throws IOException + { + MerchantRecipeList merchantrecipelist = new MerchantRecipeList(); + int i = buffer.readByte() & 255; + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = buffer.readItemStackFromBuffer(); + ItemStack itemstack1 = buffer.readItemStackFromBuffer(); + ItemStack itemstack2 = null; + + if (buffer.readBoolean()) + { + itemstack2 = buffer.readItemStackFromBuffer(); + } + + boolean flag = buffer.readBoolean(); + int k = buffer.readInt(); + int l = buffer.readInt(); + MerchantRecipe merchantrecipe = new MerchantRecipe(itemstack, itemstack2, itemstack1, k, l); + + if (flag) + { + merchantrecipe.compensateToolUses(); + } + + merchantrecipelist.add(merchantrecipe); + } + + return merchantrecipelist; + } + + public void readRecipiesFromTags(NBTTagCompound compound) + { + NBTTagList nbttaglist = compound.getTagList("Recipes", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + this.add(new MerchantRecipe(nbttagcompound)); + } + } + + public NBTTagCompound getRecipiesAsTags() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.size(); ++i) + { + MerchantRecipe merchantrecipe = (MerchantRecipe)this.get(i); + nbttaglist.appendTag(merchantrecipe.writeToTags()); + } + + nbttagcompound.setTag("Recipes", nbttaglist); + return nbttagcompound; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/village/Village.java b/Client-1.8.9/src/main/java/net/minecraft/village/Village.java new file mode 100644 index 0000000..2003b97 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/village/Village.java @@ -0,0 +1,536 @@ +package net.minecraft.village; + +import com.google.common.collect.Lists; +import com.mojang.authlib.GameProfile; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.PlayerProfileCache; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class Village +{ + private World worldObj; + private final List villageDoorInfoList = Lists.newArrayList(); + private BlockPos centerHelper = BlockPos.ORIGIN; + private BlockPos center = BlockPos.ORIGIN; + private int villageRadius; + private int lastAddDoorTimestamp; + private int tickCounter; + private int numVillagers; + private int noBreedTicks; + private TreeMap playerReputation = new TreeMap(); + private List villageAgressors = Lists.newArrayList(); + private int numIronGolems; + + public Village() + { + } + + public Village(World worldIn) + { + this.worldObj = worldIn; + } + + public void setWorld(World worldIn) + { + this.worldObj = worldIn; + } + + public void tick(int p_75560_1_) + { + this.tickCounter = p_75560_1_; + this.removeDeadAndOutOfRangeDoors(); + this.removeDeadAndOldAgressors(); + + if (p_75560_1_ % 20 == 0) + { + this.updateNumVillagers(); + } + + if (p_75560_1_ % 30 == 0) + { + this.updateNumIronGolems(); + } + + int i = this.numVillagers / 10; + + if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0) + { + Vec3 vec3 = this.func_179862_a(this.center, 2, 4, 2); + + if (vec3 != null) + { + EntityIronGolem entityirongolem = new EntityIronGolem(this.worldObj); + entityirongolem.setPosition(vec3.xCoord, vec3.yCoord, vec3.zCoord); + this.worldObj.spawnEntityInWorld(entityirongolem); + ++this.numIronGolems; + } + } + } + + private Vec3 func_179862_a(BlockPos p_179862_1_, int p_179862_2_, int p_179862_3_, int p_179862_4_) + { + for (int i = 0; i < 10; ++i) + { + BlockPos blockpos = p_179862_1_.add(this.worldObj.rand.nextInt(16) - 8, this.worldObj.rand.nextInt(6) - 3, this.worldObj.rand.nextInt(16) - 8); + + if (this.func_179866_a(blockpos) && this.func_179861_a(new BlockPos(p_179862_2_, p_179862_3_, p_179862_4_), blockpos)) + { + return new Vec3((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); + } + } + + return null; + } + + private boolean func_179861_a(BlockPos p_179861_1_, BlockPos p_179861_2_) + { + if (!World.doesBlockHaveSolidTopSurface(this.worldObj, p_179861_2_.down())) + { + return false; + } + else + { + int i = p_179861_2_.getX() - p_179861_1_.getX() / 2; + int j = p_179861_2_.getZ() - p_179861_1_.getZ() / 2; + + for (int k = i; k < i + p_179861_1_.getX(); ++k) + { + for (int l = p_179861_2_.getY(); l < p_179861_2_.getY() + p_179861_1_.getY(); ++l) + { + for (int i1 = j; i1 < j + p_179861_1_.getZ(); ++i1) + { + if (this.worldObj.getBlockState(new BlockPos(k, l, i1)).getBlock().isNormalCube()) + { + return false; + } + } + } + } + + return true; + } + } + + private void updateNumIronGolems() + { + List list = this.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, new AxisAlignedBB((double)(this.center.getX() - this.villageRadius), (double)(this.center.getY() - 4), (double)(this.center.getZ() - this.villageRadius), (double)(this.center.getX() + this.villageRadius), (double)(this.center.getY() + 4), (double)(this.center.getZ() + this.villageRadius))); + this.numIronGolems = list.size(); + } + + private void updateNumVillagers() + { + List list = this.worldObj.getEntitiesWithinAABB(EntityVillager.class, new AxisAlignedBB((double)(this.center.getX() - this.villageRadius), (double)(this.center.getY() - 4), (double)(this.center.getZ() - this.villageRadius), (double)(this.center.getX() + this.villageRadius), (double)(this.center.getY() + 4), (double)(this.center.getZ() + this.villageRadius))); + this.numVillagers = list.size(); + + if (this.numVillagers == 0) + { + this.playerReputation.clear(); + } + } + + public BlockPos getCenter() + { + return this.center; + } + + public int getVillageRadius() + { + return this.villageRadius; + } + + public int getNumVillageDoors() + { + return this.villageDoorInfoList.size(); + } + + public int getTicksSinceLastDoorAdding() + { + return this.tickCounter - this.lastAddDoorTimestamp; + } + + public int getNumVillagers() + { + return this.numVillagers; + } + + public boolean func_179866_a(BlockPos pos) + { + return this.center.distanceSq(pos) < (double)(this.villageRadius * this.villageRadius); + } + + public List getVillageDoorInfoList() + { + return this.villageDoorInfoList; + } + + public VillageDoorInfo getNearestDoor(BlockPos pos) + { + VillageDoorInfo villagedoorinfo = null; + int i = Integer.MAX_VALUE; + + for (VillageDoorInfo villagedoorinfo1 : this.villageDoorInfoList) + { + int j = villagedoorinfo1.getDistanceToDoorBlockSq(pos); + + if (j < i) + { + villagedoorinfo = villagedoorinfo1; + i = j; + } + } + + return villagedoorinfo; + } + + public VillageDoorInfo getDoorInfo(BlockPos pos) + { + VillageDoorInfo villagedoorinfo = null; + int i = Integer.MAX_VALUE; + + for (VillageDoorInfo villagedoorinfo1 : this.villageDoorInfoList) + { + int j = villagedoorinfo1.getDistanceToDoorBlockSq(pos); + + if (j > 256) + { + j = j * 1000; + } + else + { + j = villagedoorinfo1.getDoorOpeningRestrictionCounter(); + } + + if (j < i) + { + villagedoorinfo = villagedoorinfo1; + i = j; + } + } + + return villagedoorinfo; + } + + public VillageDoorInfo getExistedDoor(BlockPos doorBlock) + { + if (this.center.distanceSq(doorBlock) > (double)(this.villageRadius * this.villageRadius)) + { + return null; + } + else + { + for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList) + { + if (villagedoorinfo.getDoorBlockPos().getX() == doorBlock.getX() && villagedoorinfo.getDoorBlockPos().getZ() == doorBlock.getZ() && Math.abs(villagedoorinfo.getDoorBlockPos().getY() - doorBlock.getY()) <= 1) + { + return villagedoorinfo; + } + } + + return null; + } + } + + public void addVillageDoorInfo(VillageDoorInfo doorInfo) + { + this.villageDoorInfoList.add(doorInfo); + this.centerHelper = this.centerHelper.add(doorInfo.getDoorBlockPos()); + this.updateVillageRadiusAndCenter(); + this.lastAddDoorTimestamp = doorInfo.getInsidePosY(); + } + + public boolean isAnnihilated() + { + return this.villageDoorInfoList.isEmpty(); + } + + public void addOrRenewAgressor(EntityLivingBase entitylivingbaseIn) + { + for (Village.VillageAggressor village$villageaggressor : this.villageAgressors) + { + if (village$villageaggressor.agressor == entitylivingbaseIn) + { + village$villageaggressor.agressionTime = this.tickCounter; + return; + } + } + + this.villageAgressors.add(new Village.VillageAggressor(entitylivingbaseIn, this.tickCounter)); + } + + public EntityLivingBase findNearestVillageAggressor(EntityLivingBase entitylivingbaseIn) + { + double d0 = Double.MAX_VALUE; + Village.VillageAggressor village$villageaggressor = null; + + for (int i = 0; i < this.villageAgressors.size(); ++i) + { + Village.VillageAggressor village$villageaggressor1 = (Village.VillageAggressor)this.villageAgressors.get(i); + double d1 = village$villageaggressor1.agressor.getDistanceSqToEntity(entitylivingbaseIn); + + if (d1 <= d0) + { + village$villageaggressor = village$villageaggressor1; + d0 = d1; + } + } + + return village$villageaggressor != null ? village$villageaggressor.agressor : null; + } + + public EntityPlayer getNearestTargetPlayer(EntityLivingBase villageDefender) + { + double d0 = Double.MAX_VALUE; + EntityPlayer entityplayer = null; + + for (String s : this.playerReputation.keySet()) + { + if (this.isPlayerReputationTooLow(s)) + { + EntityPlayer entityplayer1 = this.worldObj.getPlayerEntityByName(s); + + if (entityplayer1 != null) + { + double d1 = entityplayer1.getDistanceSqToEntity(villageDefender); + + if (d1 <= d0) + { + entityplayer = entityplayer1; + d0 = d1; + } + } + } + } + + return entityplayer; + } + + private void removeDeadAndOldAgressors() + { + Iterator iterator = this.villageAgressors.iterator(); + + while (iterator.hasNext()) + { + Village.VillageAggressor village$villageaggressor = (Village.VillageAggressor)iterator.next(); + + if (!village$villageaggressor.agressor.isEntityAlive() || Math.abs(this.tickCounter - village$villageaggressor.agressionTime) > 300) + { + iterator.remove(); + } + } + } + + private void removeDeadAndOutOfRangeDoors() + { + boolean flag = false; + boolean flag1 = this.worldObj.rand.nextInt(50) == 0; + Iterator iterator = this.villageDoorInfoList.iterator(); + + while (iterator.hasNext()) + { + VillageDoorInfo villagedoorinfo = (VillageDoorInfo)iterator.next(); + + if (flag1) + { + villagedoorinfo.resetDoorOpeningRestrictionCounter(); + } + + if (!this.isWoodDoor(villagedoorinfo.getDoorBlockPos()) || Math.abs(this.tickCounter - villagedoorinfo.getInsidePosY()) > 1200) + { + this.centerHelper = this.centerHelper.subtract(villagedoorinfo.getDoorBlockPos()); + flag = true; + villagedoorinfo.setIsDetachedFromVillageFlag(true); + iterator.remove(); + } + } + + if (flag) + { + this.updateVillageRadiusAndCenter(); + } + } + + private boolean isWoodDoor(BlockPos pos) + { + Block block = this.worldObj.getBlockState(pos).getBlock(); + return block instanceof BlockDoor ? block.getMaterial() == Material.wood : false; + } + + private void updateVillageRadiusAndCenter() + { + int i = this.villageDoorInfoList.size(); + + if (i == 0) + { + this.center = new BlockPos(0, 0, 0); + this.villageRadius = 0; + } + else + { + this.center = new BlockPos(this.centerHelper.getX() / i, this.centerHelper.getY() / i, this.centerHelper.getZ() / i); + int j = 0; + + for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList) + { + j = Math.max(villagedoorinfo.getDistanceToDoorBlockSq(this.center), j); + } + + this.villageRadius = Math.max(32, (int)Math.sqrt((double)j) + 1); + } + } + + public int getReputationForPlayer(String p_82684_1_) + { + Integer integer = (Integer)this.playerReputation.get(p_82684_1_); + return integer != null ? integer.intValue() : 0; + } + + public int setReputationForPlayer(String p_82688_1_, int p_82688_2_) + { + int i = this.getReputationForPlayer(p_82688_1_); + int j = MathHelper.clamp_int(i + p_82688_2_, -30, 10); + this.playerReputation.put(p_82688_1_, Integer.valueOf(j)); + return j; + } + + public boolean isPlayerReputationTooLow(String p_82687_1_) + { + return this.getReputationForPlayer(p_82687_1_) <= -15; + } + + public void readVillageDataFromNBT(NBTTagCompound compound) + { + this.numVillagers = compound.getInteger("PopSize"); + this.villageRadius = compound.getInteger("Radius"); + this.numIronGolems = compound.getInteger("Golems"); + this.lastAddDoorTimestamp = compound.getInteger("Stable"); + this.tickCounter = compound.getInteger("Tick"); + this.noBreedTicks = compound.getInteger("MTick"); + this.center = new BlockPos(compound.getInteger("CX"), compound.getInteger("CY"), compound.getInteger("CZ")); + this.centerHelper = new BlockPos(compound.getInteger("ACX"), compound.getInteger("ACY"), compound.getInteger("ACZ")); + NBTTagList nbttaglist = compound.getTagList("Doors", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + VillageDoorInfo villagedoorinfo = new VillageDoorInfo(new BlockPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Y"), nbttagcompound.getInteger("Z")), nbttagcompound.getInteger("IDX"), nbttagcompound.getInteger("IDZ"), nbttagcompound.getInteger("TS")); + this.villageDoorInfoList.add(villagedoorinfo); + } + + NBTTagList nbttaglist1 = compound.getTagList("Players", 10); + + for (int j = 0; j < nbttaglist1.tagCount(); ++j) + { + NBTTagCompound nbttagcompound1 = nbttaglist1.getCompoundTagAt(j); + + if (nbttagcompound1.hasKey("UUID")) + { + PlayerProfileCache playerprofilecache = MinecraftServer.getServer().getPlayerProfileCache(); + GameProfile gameprofile = playerprofilecache.getProfileByUUID(UUID.fromString(nbttagcompound1.getString("UUID"))); + + if (gameprofile != null) + { + this.playerReputation.put(gameprofile.getName(), Integer.valueOf(nbttagcompound1.getInteger("S"))); + } + } + else + { + this.playerReputation.put(nbttagcompound1.getString("Name"), Integer.valueOf(nbttagcompound1.getInteger("S"))); + } + } + } + + public void writeVillageDataToNBT(NBTTagCompound compound) + { + compound.setInteger("PopSize", this.numVillagers); + compound.setInteger("Radius", this.villageRadius); + compound.setInteger("Golems", this.numIronGolems); + compound.setInteger("Stable", this.lastAddDoorTimestamp); + compound.setInteger("Tick", this.tickCounter); + compound.setInteger("MTick", this.noBreedTicks); + compound.setInteger("CX", this.center.getX()); + compound.setInteger("CY", this.center.getY()); + compound.setInteger("CZ", this.center.getZ()); + compound.setInteger("ACX", this.centerHelper.getX()); + compound.setInteger("ACY", this.centerHelper.getY()); + compound.setInteger("ACZ", this.centerHelper.getZ()); + NBTTagList nbttaglist = new NBTTagList(); + + for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setInteger("X", villagedoorinfo.getDoorBlockPos().getX()); + nbttagcompound.setInteger("Y", villagedoorinfo.getDoorBlockPos().getY()); + nbttagcompound.setInteger("Z", villagedoorinfo.getDoorBlockPos().getZ()); + nbttagcompound.setInteger("IDX", villagedoorinfo.getInsideOffsetX()); + nbttagcompound.setInteger("IDZ", villagedoorinfo.getInsideOffsetZ()); + nbttagcompound.setInteger("TS", villagedoorinfo.getInsidePosY()); + nbttaglist.appendTag(nbttagcompound); + } + + compound.setTag("Doors", nbttaglist); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (String s : this.playerReputation.keySet()) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + PlayerProfileCache playerprofilecache = MinecraftServer.getServer().getPlayerProfileCache(); + GameProfile gameprofile = playerprofilecache.getGameProfileForUsername(s); + + if (gameprofile != null) + { + nbttagcompound1.setString("UUID", gameprofile.getId().toString()); + nbttagcompound1.setInteger("S", ((Integer)this.playerReputation.get(s)).intValue()); + nbttaglist1.appendTag(nbttagcompound1); + } + } + + compound.setTag("Players", nbttaglist1); + } + + public void endMatingSeason() + { + this.noBreedTicks = this.tickCounter; + } + + public boolean isMatingSeason() + { + return this.noBreedTicks == 0 || this.tickCounter - this.noBreedTicks >= 3600; + } + + public void setDefaultPlayerReputation(int p_82683_1_) + { + for (String s : this.playerReputation.keySet()) + { + this.setReputationForPlayer(s, p_82683_1_); + } + } + + class VillageAggressor + { + public EntityLivingBase agressor; + public int agressionTime; + + VillageAggressor(EntityLivingBase p_i1674_2_, int p_i1674_3_) + { + this.agressor = p_i1674_2_; + this.agressionTime = p_i1674_3_; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/village/VillageCollection.java b/Client-1.8.9/src/main/java/net/minecraft/village/VillageCollection.java new file mode 100644 index 0000000..17162a1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/village/VillageCollection.java @@ -0,0 +1,290 @@ +package net.minecraft.village; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.material.Material; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldSavedData; + +public class VillageCollection extends WorldSavedData +{ + private World worldObj; + private final List villagerPositionsList = Lists.newArrayList(); + private final List newDoors = Lists.newArrayList(); + private final List villageList = Lists.newArrayList(); + private int tickCounter; + + public VillageCollection(String name) + { + super(name); + } + + public VillageCollection(World worldIn) + { + super(fileNameForProvider(worldIn.provider)); + this.worldObj = worldIn; + this.markDirty(); + } + + public void setWorldsForAll(World worldIn) + { + this.worldObj = worldIn; + + for (Village village : this.villageList) + { + village.setWorld(worldIn); + } + } + + public void addToVillagerPositionList(BlockPos pos) + { + if (this.villagerPositionsList.size() <= 64) + { + if (!this.positionInList(pos)) + { + this.villagerPositionsList.add(pos); + } + } + } + + public void tick() + { + ++this.tickCounter; + + for (Village village : this.villageList) + { + village.tick(this.tickCounter); + } + + this.removeAnnihilatedVillages(); + this.dropOldestVillagerPosition(); + this.addNewDoorsToVillageOrCreateVillage(); + + if (this.tickCounter % 400 == 0) + { + this.markDirty(); + } + } + + private void removeAnnihilatedVillages() + { + Iterator iterator = this.villageList.iterator(); + + while (iterator.hasNext()) + { + Village village = (Village)iterator.next(); + + if (village.isAnnihilated()) + { + iterator.remove(); + this.markDirty(); + } + } + } + + public List getVillageList() + { + return this.villageList; + } + + public Village getNearestVillage(BlockPos doorBlock, int radius) + { + Village village = null; + double d0 = 3.4028234663852886E38D; + + for (Village village1 : this.villageList) + { + double d1 = village1.getCenter().distanceSq(doorBlock); + + if (d1 < d0) + { + float f = (float)(radius + village1.getVillageRadius()); + + if (d1 <= (double)(f * f)) + { + village = village1; + d0 = d1; + } + } + } + + return village; + } + + private void dropOldestVillagerPosition() + { + if (!this.villagerPositionsList.isEmpty()) + { + this.addDoorsAround((BlockPos)this.villagerPositionsList.remove(0)); + } + } + + private void addNewDoorsToVillageOrCreateVillage() + { + for (int i = 0; i < this.newDoors.size(); ++i) + { + VillageDoorInfo villagedoorinfo = (VillageDoorInfo)this.newDoors.get(i); + Village village = this.getNearestVillage(villagedoorinfo.getDoorBlockPos(), 32); + + if (village == null) + { + village = new Village(this.worldObj); + this.villageList.add(village); + this.markDirty(); + } + + village.addVillageDoorInfo(villagedoorinfo); + } + + this.newDoors.clear(); + } + + private void addDoorsAround(BlockPos central) + { + int i = 16; + int j = 4; + int k = 16; + + for (int l = -i; l < i; ++l) + { + for (int i1 = -j; i1 < j; ++i1) + { + for (int j1 = -k; j1 < k; ++j1) + { + BlockPos blockpos = central.add(l, i1, j1); + + if (this.isWoodDoor(blockpos)) + { + VillageDoorInfo villagedoorinfo = this.checkDoorExistence(blockpos); + + if (villagedoorinfo == null) + { + this.addToNewDoorsList(blockpos); + } + else + { + villagedoorinfo.func_179849_a(this.tickCounter); + } + } + } + } + } + } + + private VillageDoorInfo checkDoorExistence(BlockPos doorBlock) + { + for (VillageDoorInfo villagedoorinfo : this.newDoors) + { + if (villagedoorinfo.getDoorBlockPos().getX() == doorBlock.getX() && villagedoorinfo.getDoorBlockPos().getZ() == doorBlock.getZ() && Math.abs(villagedoorinfo.getDoorBlockPos().getY() - doorBlock.getY()) <= 1) + { + return villagedoorinfo; + } + } + + for (Village village : this.villageList) + { + VillageDoorInfo villagedoorinfo1 = village.getExistedDoor(doorBlock); + + if (villagedoorinfo1 != null) + { + return villagedoorinfo1; + } + } + + return null; + } + + private void addToNewDoorsList(BlockPos doorBlock) + { + EnumFacing enumfacing = BlockDoor.getFacing(this.worldObj, doorBlock); + EnumFacing enumfacing1 = enumfacing.getOpposite(); + int i = this.countBlocksCanSeeSky(doorBlock, enumfacing, 5); + int j = this.countBlocksCanSeeSky(doorBlock, enumfacing1, i + 1); + + if (i != j) + { + this.newDoors.add(new VillageDoorInfo(doorBlock, i < j ? enumfacing : enumfacing1, this.tickCounter)); + } + } + + private int countBlocksCanSeeSky(BlockPos centerPos, EnumFacing direction, int limitation) + { + int i = 0; + + for (int j = 1; j <= 5; ++j) + { + if (this.worldObj.canSeeSky(centerPos.offset(direction, j))) + { + ++i; + + if (i >= limitation) + { + return i; + } + } + } + + return i; + } + + private boolean positionInList(BlockPos pos) + { + for (BlockPos blockpos : this.villagerPositionsList) + { + if (blockpos.equals(pos)) + { + return true; + } + } + + return false; + } + + private boolean isWoodDoor(BlockPos doorPos) + { + Block block = this.worldObj.getBlockState(doorPos).getBlock(); + return block instanceof BlockDoor ? block.getMaterial() == Material.wood : false; + } + + public void readFromNBT(NBTTagCompound nbt) + { + this.tickCounter = nbt.getInteger("Tick"); + NBTTagList nbttaglist = nbt.getTagList("Villages", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + Village village = new Village(); + village.readVillageDataFromNBT(nbttagcompound); + this.villageList.add(village); + } + } + + public void writeToNBT(NBTTagCompound nbt) + { + nbt.setInteger("Tick", this.tickCounter); + NBTTagList nbttaglist = new NBTTagList(); + + for (Village village : this.villageList) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + village.writeVillageDataToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + + nbt.setTag("Villages", nbttaglist); + } + + public static String fileNameForProvider(WorldProvider provider) + { + return "villages" + provider.getInternalNameSuffix(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/village/VillageDoorInfo.java b/Client-1.8.9/src/main/java/net/minecraft/village/VillageDoorInfo.java new file mode 100644 index 0000000..c949b26 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/village/VillageDoorInfo.java @@ -0,0 +1,109 @@ +package net.minecraft.village; + +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; + +public class VillageDoorInfo +{ + private final BlockPos doorBlockPos; + private final BlockPos insideBlock; + private final EnumFacing insideDirection; + private int lastActivityTimestamp; + private boolean isDetachedFromVillageFlag; + private int doorOpeningRestrictionCounter; + + public VillageDoorInfo(BlockPos pos, int p_i45871_2_, int p_i45871_3_, int p_i45871_4_) + { + this(pos, getFaceDirection(p_i45871_2_, p_i45871_3_), p_i45871_4_); + } + + private static EnumFacing getFaceDirection(int deltaX, int deltaZ) + { + return deltaX < 0 ? EnumFacing.WEST : (deltaX > 0 ? EnumFacing.EAST : (deltaZ < 0 ? EnumFacing.NORTH : EnumFacing.SOUTH)); + } + + public VillageDoorInfo(BlockPos pos, EnumFacing facing, int timestamp) + { + this.doorBlockPos = pos; + this.insideDirection = facing; + this.insideBlock = pos.offset(facing, 2); + this.lastActivityTimestamp = timestamp; + } + + public int getDistanceSquared(int x, int y, int z) + { + return (int)this.doorBlockPos.distanceSq((double)x, (double)y, (double)z); + } + + public int getDistanceToDoorBlockSq(BlockPos pos) + { + return (int)pos.distanceSq(this.getDoorBlockPos()); + } + + public int getDistanceToInsideBlockSq(BlockPos pos) + { + return (int)this.insideBlock.distanceSq(pos); + } + + public boolean func_179850_c(BlockPos pos) + { + int i = pos.getX() - this.doorBlockPos.getX(); + int j = pos.getZ() - this.doorBlockPos.getY(); + return i * this.insideDirection.getFrontOffsetX() + j * this.insideDirection.getFrontOffsetZ() >= 0; + } + + public void resetDoorOpeningRestrictionCounter() + { + this.doorOpeningRestrictionCounter = 0; + } + + public void incrementDoorOpeningRestrictionCounter() + { + ++this.doorOpeningRestrictionCounter; + } + + public int getDoorOpeningRestrictionCounter() + { + return this.doorOpeningRestrictionCounter; + } + + public BlockPos getDoorBlockPos() + { + return this.doorBlockPos; + } + + public BlockPos getInsideBlockPos() + { + return this.insideBlock; + } + + public int getInsideOffsetX() + { + return this.insideDirection.getFrontOffsetX() * 2; + } + + public int getInsideOffsetZ() + { + return this.insideDirection.getFrontOffsetZ() * 2; + } + + public int getInsidePosY() + { + return this.lastActivityTimestamp; + } + + public void func_179849_a(int timestamp) + { + this.lastActivityTimestamp = timestamp; + } + + public boolean getIsDetachedFromVillageFlag() + { + return this.isDetachedFromVillageFlag; + } + + public void setIsDetachedFromVillageFlag(boolean detached) + { + this.isDetachedFromVillageFlag = detached; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/village/VillageSiege.java b/Client-1.8.9/src/main/java/net/minecraft/village/VillageSiege.java new file mode 100644 index 0000000..802cb38 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/village/VillageSiege.java @@ -0,0 +1,205 @@ +package net.minecraft.village; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; + +public class VillageSiege +{ + private World worldObj; + private boolean field_75535_b; + private int field_75536_c = -1; + private int field_75533_d; + private int field_75534_e; + private Village theVillage; + private int field_75532_g; + private int field_75538_h; + private int field_75539_i; + + public VillageSiege(World worldIn) + { + this.worldObj = worldIn; + } + + public void tick() + { + if (this.worldObj.isDaytime()) + { + this.field_75536_c = 0; + } + else if (this.field_75536_c != 2) + { + if (this.field_75536_c == 0) + { + float f = this.worldObj.getCelestialAngle(0.0F); + + if ((double)f < 0.5D || (double)f > 0.501D) + { + return; + } + + this.field_75536_c = this.worldObj.rand.nextInt(10) == 0 ? 1 : 2; + this.field_75535_b = false; + + if (this.field_75536_c == 2) + { + return; + } + } + + if (this.field_75536_c != -1) + { + if (!this.field_75535_b) + { + if (!this.func_75529_b()) + { + return; + } + + this.field_75535_b = true; + } + + if (this.field_75534_e > 0) + { + --this.field_75534_e; + } + else + { + this.field_75534_e = 2; + + if (this.field_75533_d > 0) + { + this.spawnZombie(); + --this.field_75533_d; + } + else + { + this.field_75536_c = 2; + } + } + } + } + } + + private boolean func_75529_b() + { + List list = this.worldObj.playerEntities; + Iterator iterator = list.iterator(); + + while (true) + { + if (!iterator.hasNext()) + { + return false; + } + + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + + if (!entityplayer.isSpectator()) + { + this.theVillage = this.worldObj.getVillageCollection().getNearestVillage(new BlockPos(entityplayer), 1); + + if (this.theVillage != null && this.theVillage.getNumVillageDoors() >= 10 && this.theVillage.getTicksSinceLastDoorAdding() >= 20 && this.theVillage.getNumVillagers() >= 20) + { + BlockPos blockpos = this.theVillage.getCenter(); + float f = (float)this.theVillage.getVillageRadius(); + boolean flag = false; + + for (int i = 0; i < 10; ++i) + { + float f1 = this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F; + this.field_75532_g = blockpos.getX() + (int)((double)(MathHelper.cos(f1) * f) * 0.9D); + this.field_75538_h = blockpos.getY(); + this.field_75539_i = blockpos.getZ() + (int)((double)(MathHelper.sin(f1) * f) * 0.9D); + flag = false; + + for (Village village : this.worldObj.getVillageCollection().getVillageList()) + { + if (village != this.theVillage && village.func_179866_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i))) + { + flag = true; + break; + } + } + + if (!flag) + { + break; + } + } + + if (flag) + { + return false; + } + + Vec3 vec3 = this.func_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)); + + if (vec3 != null) + { + break; + } + } + } + } + + this.field_75534_e = 0; + this.field_75533_d = 20; + return true; + } + + private boolean spawnZombie() + { + Vec3 vec3 = this.func_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i)); + + if (vec3 == null) + { + return false; + } + else + { + EntityZombie entityzombie; + + try + { + entityzombie = new EntityZombie(this.worldObj); + entityzombie.onInitialSpawn(this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), (IEntityLivingData)null); + entityzombie.setVillager(false); + } + catch (Exception exception) + { + exception.printStackTrace(); + return false; + } + + entityzombie.setLocationAndAngles(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityzombie); + BlockPos blockpos = this.theVillage.getCenter(); + entityzombie.setHomePosAndDistance(blockpos, this.theVillage.getVillageRadius()); + return true; + } + } + + private Vec3 func_179867_a(BlockPos p_179867_1_) + { + for (int i = 0; i < 10; ++i) + { + BlockPos blockpos = p_179867_1_.add(this.worldObj.rand.nextInt(16) - 8, this.worldObj.rand.nextInt(6) - 3, this.worldObj.rand.nextInt(16) - 8); + + if (this.theVillage.func_179866_a(blockpos) && SpawnerAnimals.canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType.ON_GROUND, this.worldObj, blockpos)) + { + return new Vec3((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/ChunkCache.java b/Client-1.8.9/src/main/java/net/minecraft/world/ChunkCache.java new file mode 100644 index 0000000..0c0758f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/ChunkCache.java @@ -0,0 +1,174 @@ +package net.minecraft.world; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +public class ChunkCache implements IBlockAccess +{ + protected int chunkX; + protected int chunkZ; + protected Chunk[][] chunkArray; + protected boolean hasExtendedLevels; + protected World worldObj; + + public ChunkCache(World worldIn, BlockPos posFromIn, BlockPos posToIn, int subIn) + { + this.worldObj = worldIn; + this.chunkX = posFromIn.getX() - subIn >> 4; + this.chunkZ = posFromIn.getZ() - subIn >> 4; + int i = posToIn.getX() + subIn >> 4; + int j = posToIn.getZ() + subIn >> 4; + this.chunkArray = new Chunk[i - this.chunkX + 1][j - this.chunkZ + 1]; + this.hasExtendedLevels = true; + + for (int k = this.chunkX; k <= i; ++k) + { + for (int l = this.chunkZ; l <= j; ++l) + { + this.chunkArray[k - this.chunkX][l - this.chunkZ] = worldIn.getChunkFromChunkCoords(k, l); + } + } + + for (int i1 = posFromIn.getX() >> 4; i1 <= posToIn.getX() >> 4; ++i1) + { + for (int j1 = posFromIn.getZ() >> 4; j1 <= posToIn.getZ() >> 4; ++j1) + { + Chunk chunk = this.chunkArray[i1 - this.chunkX][j1 - this.chunkZ]; + + if (chunk != null && !chunk.getAreLevelsEmpty(posFromIn.getY(), posToIn.getY())) + { + this.hasExtendedLevels = false; + } + } + } + } + + public boolean extendedLevelsInChunkCache() + { + return this.hasExtendedLevels; + } + + public TileEntity getTileEntity(BlockPos pos) + { + int i = (pos.getX() >> 4) - this.chunkX; + int j = (pos.getZ() >> 4) - this.chunkZ; + return this.chunkArray[i][j].getTileEntity(pos, Chunk.EnumCreateEntityType.IMMEDIATE); + } + + public int getCombinedLight(BlockPos pos, int lightValue) + { + int i = this.getLightForExt(EnumSkyBlock.SKY, pos); + int j = this.getLightForExt(EnumSkyBlock.BLOCK, pos); + + if (j < lightValue) + { + j = lightValue; + } + + return i << 20 | j << 4; + } + + public IBlockState getBlockState(BlockPos pos) + { + if (pos.getY() >= 0 && pos.getY() < 256) + { + int i = (pos.getX() >> 4) - this.chunkX; + int j = (pos.getZ() >> 4) - this.chunkZ; + + if (i >= 0 && i < this.chunkArray.length && j >= 0 && j < this.chunkArray[i].length) + { + Chunk chunk = this.chunkArray[i][j]; + + if (chunk != null) + { + return chunk.getBlockState(pos); + } + } + } + + return Blocks.air.getDefaultState(); + } + + public BiomeGenBase getBiomeGenForCoords(BlockPos pos) + { + return this.worldObj.getBiomeGenForCoords(pos); + } + + private int getLightForExt(EnumSkyBlock p_175629_1_, BlockPos pos) + { + if (p_175629_1_ == EnumSkyBlock.SKY && this.worldObj.provider.getHasNoSky()) + { + return 0; + } + else if (pos.getY() >= 0 && pos.getY() < 256) + { + if (this.getBlockState(pos).getBlock().getUseNeighborBrightness()) + { + int l = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + int k = this.getLightFor(p_175629_1_, pos.offset(enumfacing)); + + if (k > l) + { + l = k; + } + + if (l >= 15) + { + return l; + } + } + + return l; + } + else + { + int i = (pos.getX() >> 4) - this.chunkX; + int j = (pos.getZ() >> 4) - this.chunkZ; + return this.chunkArray[i][j].getLightFor(p_175629_1_, pos); + } + } + else + { + return p_175629_1_.defaultLightValue; + } + } + + public boolean isAirBlock(BlockPos pos) + { + return this.getBlockState(pos).getBlock().getMaterial() == Material.air; + } + + public int getLightFor(EnumSkyBlock p_175628_1_, BlockPos pos) + { + if (pos.getY() >= 0 && pos.getY() < 256) + { + int i = (pos.getX() >> 4) - this.chunkX; + int j = (pos.getZ() >> 4) - this.chunkZ; + return this.chunkArray[i][j].getLightFor(p_175628_1_, pos); + } + else + { + return p_175628_1_.defaultLightValue; + } + } + + public int getStrongPower(BlockPos pos, EnumFacing direction) + { + IBlockState iblockstate = this.getBlockState(pos); + return iblockstate.getBlock().getStrongPower(this, pos, iblockstate, direction); + } + + public WorldType getWorldType() + { + return this.worldObj.getWorldType(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/ChunkCoordIntPair.java b/Client-1.8.9/src/main/java/net/minecraft/world/ChunkCoordIntPair.java new file mode 100644 index 0000000..4d3ecef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/ChunkCoordIntPair.java @@ -0,0 +1,95 @@ +package net.minecraft.world; + +import net.minecraft.util.BlockPos; + +public class ChunkCoordIntPair +{ + public final int chunkXPos; + public final int chunkZPos; + private int cachedHashCode = 0; + + public ChunkCoordIntPair(int x, int z) + { + this.chunkXPos = x; + this.chunkZPos = z; + } + + public static long chunkXZ2Int(int x, int z) + { + return (long)x & 4294967295L | ((long)z & 4294967295L) << 32; + } + + public int hashCode() + { + if (this.cachedHashCode == 0) + { + int i = 1664525 * this.chunkXPos + 1013904223; + int j = 1664525 * (this.chunkZPos ^ -559038737) + 1013904223; + this.cachedHashCode = i ^ j; + } + + return this.cachedHashCode; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChunkCoordIntPair)) + { + return false; + } + else + { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)p_equals_1_; + return this.chunkXPos == chunkcoordintpair.chunkXPos && this.chunkZPos == chunkcoordintpair.chunkZPos; + } + } + + public int getCenterXPos() + { + return (this.chunkXPos << 4) + 8; + } + + public int getCenterZPosition() + { + return (this.chunkZPos << 4) + 8; + } + + public int getXStart() + { + return this.chunkXPos << 4; + } + + public int getZStart() + { + return this.chunkZPos << 4; + } + + public int getXEnd() + { + return (this.chunkXPos << 4) + 15; + } + + public int getZEnd() + { + return (this.chunkZPos << 4) + 15; + } + + public BlockPos getBlock(int x, int y, int z) + { + return new BlockPos((this.chunkXPos << 4) + x, y, (this.chunkZPos << 4) + z); + } + + public BlockPos getCenterBlock(int y) + { + return new BlockPos(this.getCenterXPos(), y, this.getCenterZPosition()); + } + + public String toString() + { + return "[" + this.chunkXPos + ", " + this.chunkZPos + "]"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/ColorizerFoliage.java b/Client-1.8.9/src/main/java/net/minecraft/world/ColorizerFoliage.java new file mode 100644 index 0000000..f6795cb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/ColorizerFoliage.java @@ -0,0 +1,34 @@ +package net.minecraft.world; + +public class ColorizerFoliage +{ + private static int[] foliageBuffer = new int[65536]; + + public static void setFoliageBiomeColorizer(int[] p_77467_0_) + { + foliageBuffer = p_77467_0_; + } + + public static int getFoliageColor(double p_77470_0_, double p_77470_2_) + { + p_77470_2_ = p_77470_2_ * p_77470_0_; + int i = (int)((1.0D - p_77470_0_) * 255.0D); + int j = (int)((1.0D - p_77470_2_) * 255.0D); + return foliageBuffer[j << 8 | i]; + } + + public static int getFoliageColorPine() + { + return 6396257; + } + + public static int getFoliageColorBirch() + { + return 8431445; + } + + public static int getFoliageColorBasic() + { + return 4764952; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/ColorizerGrass.java b/Client-1.8.9/src/main/java/net/minecraft/world/ColorizerGrass.java new file mode 100644 index 0000000..854760a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/ColorizerGrass.java @@ -0,0 +1,20 @@ +package net.minecraft.world; + +public class ColorizerGrass +{ + private static int[] grassBuffer = new int[65536]; + + public static void setGrassBiomeColorizer(int[] p_77479_0_) + { + grassBuffer = p_77479_0_; + } + + public static int getGrassColor(double p_77480_0_, double p_77480_2_) + { + p_77480_2_ = p_77480_2_ * p_77480_0_; + int i = (int)((1.0D - p_77480_0_) * 255.0D); + int j = (int)((1.0D - p_77480_2_) * 255.0D); + int k = j << 8 | i; + return k > grassBuffer.length ? -65281 : grassBuffer[k]; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/DifficultyInstance.java b/Client-1.8.9/src/main/java/net/minecraft/world/DifficultyInstance.java new file mode 100644 index 0000000..372db1d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/DifficultyInstance.java @@ -0,0 +1,51 @@ +package net.minecraft.world; + +import net.minecraft.util.MathHelper; + +public class DifficultyInstance +{ + private final EnumDifficulty worldDifficulty; + private final float additionalDifficulty; + + public DifficultyInstance(EnumDifficulty worldDifficulty, long worldTime, long chunkInhabitedTime, float moonPhaseFactor) + { + this.worldDifficulty = worldDifficulty; + this.additionalDifficulty = this.calculateAdditionalDifficulty(worldDifficulty, worldTime, chunkInhabitedTime, moonPhaseFactor); + } + + public float getAdditionalDifficulty() + { + return this.additionalDifficulty; + } + + public float getClampedAdditionalDifficulty() + { + return this.additionalDifficulty < 2.0F ? 0.0F : (this.additionalDifficulty > 4.0F ? 1.0F : (this.additionalDifficulty - 2.0F) / 2.0F); + } + + private float calculateAdditionalDifficulty(EnumDifficulty difficulty, long worldTime, long chunkInhabitedTime, float moonPhaseFactor) + { + if (difficulty == EnumDifficulty.PEACEFUL) + { + return 0.0F; + } + else + { + boolean flag = difficulty == EnumDifficulty.HARD; + float f = 0.75F; + float f1 = MathHelper.clamp_float(((float)worldTime + -72000.0F) / 1440000.0F, 0.0F, 1.0F) * 0.25F; + f = f + f1; + float f2 = 0.0F; + f2 = f2 + MathHelper.clamp_float((float)chunkInhabitedTime / 3600000.0F, 0.0F, 1.0F) * (flag ? 1.0F : 0.75F); + f2 = f2 + MathHelper.clamp_float(moonPhaseFactor * 0.25F, 0.0F, f1); + + if (difficulty == EnumDifficulty.EASY) + { + f2 *= 0.5F; + } + + f = f + f2; + return (float)difficulty.getDifficultyId() * f; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/EnumDifficulty.java b/Client-1.8.9/src/main/java/net/minecraft/world/EnumDifficulty.java new file mode 100644 index 0000000..a010eb2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/EnumDifficulty.java @@ -0,0 +1,41 @@ +package net.minecraft.world; + +public enum EnumDifficulty +{ + PEACEFUL(0, "options.difficulty.peaceful"), + EASY(1, "options.difficulty.easy"), + NORMAL(2, "options.difficulty.normal"), + HARD(3, "options.difficulty.hard"); + + private static final EnumDifficulty[] difficultyEnums = new EnumDifficulty[values().length]; + private final int difficultyId; + private final String difficultyResourceKey; + + private EnumDifficulty(int difficultyIdIn, String difficultyResourceKeyIn) + { + this.difficultyId = difficultyIdIn; + this.difficultyResourceKey = difficultyResourceKeyIn; + } + + public int getDifficultyId() + { + return this.difficultyId; + } + + public static EnumDifficulty getDifficultyEnum(int p_151523_0_) + { + return difficultyEnums[p_151523_0_ % difficultyEnums.length]; + } + + public String getDifficultyResourceKey() + { + return this.difficultyResourceKey; + } + + static { + for (EnumDifficulty enumdifficulty : values()) + { + difficultyEnums[enumdifficulty.difficultyId] = enumdifficulty; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/EnumSkyBlock.java b/Client-1.8.9/src/main/java/net/minecraft/world/EnumSkyBlock.java new file mode 100644 index 0000000..37a6069 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/EnumSkyBlock.java @@ -0,0 +1,14 @@ +package net.minecraft.world; + +public enum EnumSkyBlock +{ + SKY(15), + BLOCK(0); + + public final int defaultLightValue; + + private EnumSkyBlock(int p_i1961_3_) + { + this.defaultLightValue = p_i1961_3_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/Explosion.java b/Client-1.8.9/src/main/java/net/minecraft/world/Explosion.java new file mode 100644 index 0000000..31e5bc3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/Explosion.java @@ -0,0 +1,249 @@ +package net.minecraft.world; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.enchantment.EnchantmentProtection; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class Explosion +{ + private final boolean isFlaming; + private final boolean isSmoking; + private final Random explosionRNG; + private final World worldObj; + private final double explosionX; + private final double explosionY; + private final double explosionZ; + private final Entity exploder; + private final float explosionSize; + private final List affectedBlockPositions; + private final Map playerKnockbackMap; + + public Explosion(World worldIn, Entity entityIn, double x, double y, double z, float size, List affectedPositions) + { + this(worldIn, entityIn, x, y, z, size, false, true, affectedPositions); + } + + public Explosion(World worldIn, Entity entityIn, double x, double y, double z, float size, boolean flaming, boolean smoking, List affectedPositions) + { + this(worldIn, entityIn, x, y, z, size, flaming, smoking); + this.affectedBlockPositions.addAll(affectedPositions); + } + + public Explosion(World worldIn, Entity entityIn, double x, double y, double z, float size, boolean flaming, boolean smoking) + { + this.explosionRNG = new Random(); + this.affectedBlockPositions = Lists.newArrayList(); + this.playerKnockbackMap = Maps.newHashMap(); + this.worldObj = worldIn; + this.exploder = entityIn; + this.explosionSize = size; + this.explosionX = x; + this.explosionY = y; + this.explosionZ = z; + this.isFlaming = flaming; + this.isSmoking = smoking; + } + + public void doExplosionA() + { + Set set = Sets.newHashSet(); + int i = 16; + + for (int j = 0; j < 16; ++j) + { + for (int k = 0; k < 16; ++k) + { + for (int l = 0; l < 16; ++l) + { + if (j == 0 || j == 15 || k == 0 || k == 15 || l == 0 || l == 15) + { + double d0 = (double)((float)j / 15.0F * 2.0F - 1.0F); + double d1 = (double)((float)k / 15.0F * 2.0F - 1.0F); + double d2 = (double)((float)l / 15.0F * 2.0F - 1.0F); + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + d0 = d0 / d3; + d1 = d1 / d3; + d2 = d2 / d3; + float f = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); + double d4 = this.explosionX; + double d6 = this.explosionY; + double d8 = this.explosionZ; + + for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) + { + BlockPos blockpos = new BlockPos(d4, d6, d8); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + + if (iblockstate.getBlock().getMaterial() != Material.air) + { + float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance((Entity)null); + f -= (f2 + 0.3F) * 0.3F; + } + + if (f > 0.0F && (this.exploder == null || this.exploder.verifyExplosion(this, this.worldObj, blockpos, iblockstate, f))) + { + set.add(blockpos); + } + + d4 += d0 * 0.30000001192092896D; + d6 += d1 * 0.30000001192092896D; + d8 += d2 * 0.30000001192092896D; + } + } + } + } + } + + this.affectedBlockPositions.addAll(set); + float f3 = this.explosionSize * 2.0F; + int k1 = MathHelper.floor_double(this.explosionX - (double)f3 - 1.0D); + int l1 = MathHelper.floor_double(this.explosionX + (double)f3 + 1.0D); + int i2 = MathHelper.floor_double(this.explosionY - (double)f3 - 1.0D); + int i1 = MathHelper.floor_double(this.explosionY + (double)f3 + 1.0D); + int j2 = MathHelper.floor_double(this.explosionZ - (double)f3 - 1.0D); + int j1 = MathHelper.floor_double(this.explosionZ + (double)f3 + 1.0D); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, new AxisAlignedBB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); + Vec3 vec3 = new Vec3(this.explosionX, this.explosionY, this.explosionZ); + + for (int k2 = 0; k2 < list.size(); ++k2) + { + Entity entity = (Entity)list.get(k2); + + if (!entity.isImmuneToExplosions()) + { + double d12 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double)f3; + + if (d12 <= 1.0D) + { + double d5 = entity.posX - this.explosionX; + double d7 = entity.posY + (double)entity.getEyeHeight() - this.explosionY; + double d9 = entity.posZ - this.explosionZ; + double d13 = (double)MathHelper.sqrt_double(d5 * d5 + d7 * d7 + d9 * d9); + + if (d13 != 0.0D) + { + d5 = d5 / d13; + d7 = d7 / d13; + d9 = d9 / d13; + double d14 = (double)this.worldObj.getBlockDensity(vec3, entity.getEntityBoundingBox()); + double d10 = (1.0D - d12) * d14; + entity.attackEntityFrom(DamageSource.setExplosionSource(this), (float)((int)((d10 * d10 + d10) / 2.0D * 8.0D * (double)f3 + 1.0D))); + double d11 = EnchantmentProtection.func_92092_a(entity, d10); + entity.motionX += d5 * d11; + entity.motionY += d7 * d11; + entity.motionZ += d9 * d11; + + if (entity instanceof EntityPlayer && !((EntityPlayer)entity).capabilities.disableDamage) + { + this.playerKnockbackMap.put((EntityPlayer)entity, new Vec3(d5 * d10, d7 * d10, d9 * d10)); + } + } + } + } + } + } + + public void doExplosionB(boolean spawnParticles) + { + this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + + if (this.explosionSize >= 2.0F && this.isSmoking) + { + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D, new int[0]); + } + else + { + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D, new int[0]); + } + + if (this.isSmoking) + { + for (BlockPos blockpos : this.affectedBlockPositions) + { + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + + if (spawnParticles) + { + double d0 = (double)((float)blockpos.getX() + this.worldObj.rand.nextFloat()); + double d1 = (double)((float)blockpos.getY() + this.worldObj.rand.nextFloat()); + double d2 = (double)((float)blockpos.getZ() + this.worldObj.rand.nextFloat()); + double d3 = d0 - this.explosionX; + double d4 = d1 - this.explosionY; + double d5 = d2 - this.explosionZ; + double d6 = (double)MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5); + d3 = d3 / d6; + d4 = d4 / d6; + d5 = d5 / d6; + double d7 = 0.5D / (d6 / (double)this.explosionSize + 0.1D); + d7 = d7 * (double)(this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F); + d3 = d3 * d7; + d4 = d4 * d7; + d5 = d5 * d7; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, (d2 + this.explosionZ * 1.0D) / 2.0D, d3, d4, d5, new int[0]); + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, d3, d4, d5, new int[0]); + } + + if (block.getMaterial() != Material.air) + { + if (block.canDropFromExplosion(this)) + { + block.dropBlockAsItemWithChance(this.worldObj, blockpos, this.worldObj.getBlockState(blockpos), 1.0F / this.explosionSize, 0); + } + + this.worldObj.setBlockState(blockpos, Blocks.air.getDefaultState(), 3); + block.onBlockDestroyedByExplosion(this.worldObj, blockpos, this); + } + } + } + + if (this.isFlaming) + { + for (BlockPos blockpos1 : this.affectedBlockPositions) + { + if (this.worldObj.getBlockState(blockpos1).getBlock().getMaterial() == Material.air && this.worldObj.getBlockState(blockpos1.down()).getBlock().isFullBlock() && this.explosionRNG.nextInt(3) == 0) + { + this.worldObj.setBlockState(blockpos1, Blocks.fire.getDefaultState()); + } + } + } + } + + public Map getPlayerKnockbackMap() + { + return this.playerKnockbackMap; + } + + public EntityLivingBase getExplosivePlacedBy() + { + return this.exploder == null ? null : (this.exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null)); + } + + public void clearAffectedBlockPositions() + { + this.affectedBlockPositions.clear(); + } + + public List getAffectedBlockPositions() + { + return this.affectedBlockPositions; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/GameRules.java b/Client-1.8.9/src/main/java/net/minecraft/world/GameRules.java new file mode 100644 index 0000000..a2a1351 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/GameRules.java @@ -0,0 +1,188 @@ +package net.minecraft.world; + +import java.util.Set; +import java.util.TreeMap; +import net.minecraft.nbt.NBTTagCompound; + +public class GameRules +{ + private TreeMap theGameRules = new TreeMap(); + + public GameRules() + { + this.addGameRule("doFireTick", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("mobGriefing", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("keepInventory", "false", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doMobSpawning", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doMobLoot", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doTileDrops", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doEntityDrops", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("commandBlockOutput", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("naturalRegeneration", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("doDaylightCycle", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("logAdminCommands", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("showDeathMessages", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("randomTickSpeed", "3", GameRules.ValueType.NUMERICAL_VALUE); + this.addGameRule("sendCommandFeedback", "true", GameRules.ValueType.BOOLEAN_VALUE); + this.addGameRule("reducedDebugInfo", "false", GameRules.ValueType.BOOLEAN_VALUE); + } + + public void addGameRule(String key, String value, GameRules.ValueType type) + { + this.theGameRules.put(key, new GameRules.Value(value, type)); + } + + public void setOrCreateGameRule(String key, String ruleValue) + { + GameRules.Value gamerules$value = (GameRules.Value)this.theGameRules.get(key); + + if (gamerules$value != null) + { + gamerules$value.setValue(ruleValue); + } + else + { + this.addGameRule(key, ruleValue, GameRules.ValueType.ANY_VALUE); + } + } + + public String getString(String name) + { + GameRules.Value gamerules$value = (GameRules.Value)this.theGameRules.get(name); + return gamerules$value != null ? gamerules$value.getString() : ""; + } + + public boolean getBoolean(String name) + { + GameRules.Value gamerules$value = (GameRules.Value)this.theGameRules.get(name); + return gamerules$value != null ? gamerules$value.getBoolean() : false; + } + + public int getInt(String name) + { + GameRules.Value gamerules$value = (GameRules.Value)this.theGameRules.get(name); + return gamerules$value != null ? gamerules$value.getInt() : 0; + } + + public NBTTagCompound writeToNBT() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (String s : this.theGameRules.keySet()) + { + GameRules.Value gamerules$value = (GameRules.Value)this.theGameRules.get(s); + nbttagcompound.setString(s, gamerules$value.getString()); + } + + return nbttagcompound; + } + + public void readFromNBT(NBTTagCompound nbt) + { + for (String s : nbt.getKeySet()) + { + String s1 = nbt.getString(s); + this.setOrCreateGameRule(s, s1); + } + } + + public String[] getRules() + { + Set set = this.theGameRules.keySet(); + return (String[])((String[])set.toArray(new String[set.size()])); + } + + public boolean hasRule(String name) + { + return this.theGameRules.containsKey(name); + } + + public boolean areSameType(String key, GameRules.ValueType otherValue) + { + GameRules.Value gamerules$value = (GameRules.Value)this.theGameRules.get(key); + return gamerules$value != null && (gamerules$value.getType() == otherValue || otherValue == GameRules.ValueType.ANY_VALUE); + } + + static class Value + { + private String valueString; + private boolean valueBoolean; + private int valueInteger; + private double valueDouble; + private final GameRules.ValueType type; + + public Value(String value, GameRules.ValueType type) + { + this.type = type; + this.setValue(value); + } + + public void setValue(String value) + { + this.valueString = value; + + if (value != null) + { + if (value.equals("false")) + { + this.valueBoolean = false; + return; + } + + if (value.equals("true")) + { + this.valueBoolean = true; + return; + } + } + + this.valueBoolean = Boolean.parseBoolean(value); + this.valueInteger = this.valueBoolean ? 1 : 0; + + try + { + this.valueInteger = Integer.parseInt(value); + } + catch (NumberFormatException var4) + { + ; + } + + try + { + this.valueDouble = Double.parseDouble(value); + } + catch (NumberFormatException var3) + { + ; + } + } + + public String getString() + { + return this.valueString; + } + + public boolean getBoolean() + { + return this.valueBoolean; + } + + public int getInt() + { + return this.valueInteger; + } + + public GameRules.ValueType getType() + { + return this.type; + } + } + + public static enum ValueType + { + ANY_VALUE, + BOOLEAN_VALUE, + NUMERICAL_VALUE; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/IBlockAccess.java b/Client-1.8.9/src/main/java/net/minecraft/world/IBlockAccess.java new file mode 100644 index 0000000..663ad17 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/IBlockAccess.java @@ -0,0 +1,26 @@ +package net.minecraft.world; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.biome.BiomeGenBase; + +public interface IBlockAccess +{ + TileEntity getTileEntity(BlockPos pos); + + int getCombinedLight(BlockPos pos, int lightValue); + + IBlockState getBlockState(BlockPos pos); + + boolean isAirBlock(BlockPos pos); + + BiomeGenBase getBiomeGenForCoords(BlockPos pos); + + boolean extendedLevelsInChunkCache(); + + int getStrongPower(BlockPos pos, EnumFacing direction); + + WorldType getWorldType(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/IInteractionObject.java b/Client-1.8.9/src/main/java/net/minecraft/world/IInteractionObject.java new file mode 100644 index 0000000..6a49f18 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/IInteractionObject.java @@ -0,0 +1,12 @@ +package net.minecraft.world; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; + +public interface IInteractionObject extends IWorldNameable +{ + Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn); + + String getGuiID(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/ILockableContainer.java b/Client-1.8.9/src/main/java/net/minecraft/world/ILockableContainer.java new file mode 100644 index 0000000..07cf659 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/ILockableContainer.java @@ -0,0 +1,12 @@ +package net.minecraft.world; + +import net.minecraft.inventory.IInventory; + +public interface ILockableContainer extends IInventory, IInteractionObject +{ + boolean isLocked(); + + void setLockCode(LockCode code); + + LockCode getLockCode(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/IWorldAccess.java b/Client-1.8.9/src/main/java/net/minecraft/world/IWorldAccess.java new file mode 100644 index 0000000..bd74fd2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/IWorldAccess.java @@ -0,0 +1,32 @@ +package net.minecraft.world; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +public interface IWorldAccess +{ + void markBlockForUpdate(BlockPos pos); + + void notifyLightSet(BlockPos pos); + + void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2); + + void playSound(String soundName, double x, double y, double z, float volume, float pitch); + + void playSoundToNearExcept(EntityPlayer except, String soundName, double x, double y, double z, float volume, float pitch); + + void spawnParticle(int particleID, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... parameters); + + void onEntityAdded(Entity entityIn); + + void onEntityRemoved(Entity entityIn); + + void playRecord(String recordName, BlockPos blockPosIn); + + void broadcastSound(int soundID, BlockPos pos, int data); + + void playAuxSFX(EntityPlayer player, int sfxType, BlockPos blockPosIn, int data); + + void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/IWorldNameable.java b/Client-1.8.9/src/main/java/net/minecraft/world/IWorldNameable.java new file mode 100644 index 0000000..2f98070 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/IWorldNameable.java @@ -0,0 +1,12 @@ +package net.minecraft.world; + +import net.minecraft.util.IChatComponent; + +public interface IWorldNameable +{ + String getName(); + + boolean hasCustomName(); + + IChatComponent getDisplayName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/LockCode.java b/Client-1.8.9/src/main/java/net/minecraft/world/LockCode.java new file mode 100644 index 0000000..033bd5d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/LockCode.java @@ -0,0 +1,42 @@ +package net.minecraft.world; + +import net.minecraft.nbt.NBTTagCompound; + +public class LockCode +{ + public static final LockCode EMPTY_CODE = new LockCode(""); + private final String lock; + + public LockCode(String code) + { + this.lock = code; + } + + public boolean isEmpty() + { + return this.lock == null || this.lock.isEmpty(); + } + + public String getLock() + { + return this.lock; + } + + public void toNBT(NBTTagCompound nbt) + { + nbt.setString("Lock", this.lock); + } + + public static LockCode fromNBT(NBTTagCompound nbt) + { + if (nbt.hasKey("Lock", 8)) + { + String s = nbt.getString("Lock"); + return new LockCode(s); + } + else + { + return EMPTY_CODE; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/MinecraftException.java b/Client-1.8.9/src/main/java/net/minecraft/world/MinecraftException.java new file mode 100644 index 0000000..7730d42 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/MinecraftException.java @@ -0,0 +1,9 @@ +package net.minecraft.world; + +public class MinecraftException extends Exception +{ + public MinecraftException(String msg) + { + super(msg); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/NextTickListEntry.java b/Client-1.8.9/src/main/java/net/minecraft/world/NextTickListEntry.java new file mode 100644 index 0000000..152fe8f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/NextTickListEntry.java @@ -0,0 +1,65 @@ +package net.minecraft.world; + +import net.minecraft.block.Block; +import net.minecraft.util.BlockPos; + +public class NextTickListEntry implements Comparable +{ + private static long nextTickEntryID; + private final Block block; + public final BlockPos position; + public long scheduledTime; + public int priority; + private long tickEntryID; + + public NextTickListEntry(BlockPos positionIn, Block blockIn) + { + this.tickEntryID = (long)(nextTickEntryID++); + this.position = positionIn; + this.block = blockIn; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof NextTickListEntry)) + { + return false; + } + else + { + NextTickListEntry nextticklistentry = (NextTickListEntry)p_equals_1_; + return this.position.equals(nextticklistentry.position) && Block.isEqualTo(this.block, nextticklistentry.block); + } + } + + public int hashCode() + { + return this.position.hashCode(); + } + + public NextTickListEntry setScheduledTime(long scheduledTimeIn) + { + this.scheduledTime = scheduledTimeIn; + return this; + } + + public void setPriority(int priorityIn) + { + this.priority = priorityIn; + } + + public int compareTo(NextTickListEntry p_compareTo_1_) + { + return this.scheduledTime < p_compareTo_1_.scheduledTime ? -1 : (this.scheduledTime > p_compareTo_1_.scheduledTime ? 1 : (this.priority != p_compareTo_1_.priority ? this.priority - p_compareTo_1_.priority : (this.tickEntryID < p_compareTo_1_.tickEntryID ? -1 : (this.tickEntryID > p_compareTo_1_.tickEntryID ? 1 : 0)))); + } + + public String toString() + { + return Block.getIdFromBlock(this.block) + ": " + this.position + ", " + this.scheduledTime + ", " + this.priority + ", " + this.tickEntryID; + } + + public Block getBlock() + { + return this.block; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/SpawnerAnimals.java b/Client-1.8.9/src/main/java/net/minecraft/world/SpawnerAnimals.java new file mode 100644 index 0000000..be3b0a0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/SpawnerAnimals.java @@ -0,0 +1,362 @@ +package net.minecraft.world; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.optifine.BlockPosM; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; + +public final class SpawnerAnimals +{ + private static final int MOB_COUNT_DIV = (int)Math.pow(17.0D, 2.0D); + private final Set eligibleChunksForSpawning = Sets.newHashSet(); + private Map mapSampleEntitiesByClass = new HashMap(); + private int lastPlayerChunkX = Integer.MAX_VALUE; + private int lastPlayerChunkZ = Integer.MAX_VALUE; + private int countChunkPos; + + /** + * adds all chunks within the spawn radius of the players to eligibleChunksForSpawning. pars: the world, + * hostileCreatures, passiveCreatures. returns number of eligible chunks. + */ + public int findChunksForSpawning(WorldServer p_77192_1_, boolean spawnHostileMobs, boolean spawnPeacefulMobs, boolean p_77192_4_) + { + if (!spawnHostileMobs && !spawnPeacefulMobs) + { + return 0; + } + else + { + boolean flag = true; + EntityPlayer entityplayer = null; + + if (p_77192_1_.playerEntities.size() == 1) + { + entityplayer = (EntityPlayer)p_77192_1_.playerEntities.get(0); + + if (this.eligibleChunksForSpawning.size() > 0 && entityplayer != null && entityplayer.chunkCoordX == this.lastPlayerChunkX && entityplayer.chunkCoordZ == this.lastPlayerChunkZ) + { + flag = false; + } + } + + if (flag) + { + this.eligibleChunksForSpawning.clear(); + int i = 0; + + for (EntityPlayer entityplayer1 : p_77192_1_.playerEntities) + { + if (!entityplayer1.isSpectator()) + { + int j = MathHelper.floor_double(entityplayer1.posX / 16.0D); + int k = MathHelper.floor_double(entityplayer1.posZ / 16.0D); + int l = 8; + + for (int i1 = -l; i1 <= l; ++i1) + { + for (int j1 = -l; j1 <= l; ++j1) + { + boolean flag1 = i1 == -l || i1 == l || j1 == -l || j1 == l; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i1 + j, j1 + k); + + if (!this.eligibleChunksForSpawning.contains(chunkcoordintpair)) + { + ++i; + + if (!flag1 && p_77192_1_.getWorldBorder().contains(chunkcoordintpair)) + { + this.eligibleChunksForSpawning.add(chunkcoordintpair); + } + } + } + } + } + } + + this.countChunkPos = i; + + if (entityplayer != null) + { + this.lastPlayerChunkX = entityplayer.chunkCoordX; + this.lastPlayerChunkZ = entityplayer.chunkCoordZ; + } + } + + int j4 = 0; + BlockPos blockpos2 = p_77192_1_.getSpawnPoint(); + BlockPosM blockposm = new BlockPosM(0, 0, 0); + new BlockPos.MutableBlockPos(); + + for (EnumCreatureType enumcreaturetype : EnumCreatureType.values()) + { + if ((!enumcreaturetype.getPeacefulCreature() || spawnPeacefulMobs) && (enumcreaturetype.getPeacefulCreature() || spawnHostileMobs) && (!enumcreaturetype.getAnimal() || p_77192_4_)) + { + int k4 = Reflector.ForgeWorld_countEntities.exists() ? Reflector.callInt(p_77192_1_, Reflector.ForgeWorld_countEntities, new Object[] {enumcreaturetype, Boolean.valueOf(true)}): p_77192_1_.countEntities(enumcreaturetype.getCreatureClass()); + int l4 = enumcreaturetype.getMaxNumberOfCreature() * this.countChunkPos / MOB_COUNT_DIV; + + if (k4 <= l4) + { + Collection collection = this.eligibleChunksForSpawning; + + if (Reflector.ForgeHooksClient.exists()) + { + ArrayList arraylist = Lists.newArrayList(collection); + Collections.shuffle(arraylist); + collection = arraylist; + } + + label561: + + for (ChunkCoordIntPair chunkcoordintpair1 : collection) + { + BlockPos blockpos = getRandomChunkPosition(p_77192_1_, chunkcoordintpair1.chunkXPos, chunkcoordintpair1.chunkZPos, blockposm); + int k1 = blockpos.getX(); + int l1 = blockpos.getY(); + int i2 = blockpos.getZ(); + Block block = p_77192_1_.getBlockState(blockpos).getBlock(); + + if (!block.isNormalCube()) + { + int j2 = 0; + + for (int k2 = 0; k2 < 3; ++k2) + { + int l2 = k1; + int i3 = l1; + int j3 = i2; + int k3 = 6; + BiomeGenBase.SpawnListEntry biomegenbase$spawnlistentry = null; + IEntityLivingData ientitylivingdata = null; + + for (int l3 = 0; l3 < 4; ++l3) + { + l2 += p_77192_1_.rand.nextInt(k3) - p_77192_1_.rand.nextInt(k3); + i3 += p_77192_1_.rand.nextInt(1) - p_77192_1_.rand.nextInt(1); + j3 += p_77192_1_.rand.nextInt(k3) - p_77192_1_.rand.nextInt(k3); + BlockPos blockpos1 = new BlockPos(l2, i3, j3); + float f = (float)l2 + 0.5F; + float f1 = (float)j3 + 0.5F; + + if (!p_77192_1_.isAnyPlayerWithinRangeAt((double)f, (double)i3, (double)f1, 24.0D) && blockpos2.distanceSq((double)f, (double)i3, (double)f1) >= 576.0D) + { + if (biomegenbase$spawnlistentry == null) + { + biomegenbase$spawnlistentry = p_77192_1_.getSpawnListEntryForTypeAt(enumcreaturetype, blockpos1); + + if (biomegenbase$spawnlistentry == null) + { + break; + } + } + + if (p_77192_1_.canCreatureTypeSpawnHere(enumcreaturetype, biomegenbase$spawnlistentry, blockpos1) && canCreatureTypeSpawnAtLocation(EntitySpawnPlacementRegistry.getPlacementForEntity(biomegenbase$spawnlistentry.entityClass), p_77192_1_, blockpos1)) + { + EntityLiving entityliving; + + try + { + entityliving = (EntityLiving)this.mapSampleEntitiesByClass.get(biomegenbase$spawnlistentry.entityClass); + + if (entityliving == null) + { + entityliving = (EntityLiving)biomegenbase$spawnlistentry.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_77192_1_}); + this.mapSampleEntitiesByClass.put(biomegenbase$spawnlistentry.entityClass, entityliving); + } + } + catch (Exception exception1) + { + exception1.printStackTrace(); + return j4; + } + + entityliving.setLocationAndAngles((double)f, (double)i3, (double)f1, p_77192_1_.rand.nextFloat() * 360.0F, 0.0F); + boolean flag2 = Reflector.ForgeEventFactory_canEntitySpawn.exists() ? ReflectorForge.canEntitySpawn(entityliving, p_77192_1_, f, (float)i3, f1) : entityliving.getCanSpawnHere() && entityliving.isNotColliding(); + + if (flag2) + { + this.mapSampleEntitiesByClass.remove(biomegenbase$spawnlistentry.entityClass); + + if (!ReflectorForge.doSpecialSpawn(entityliving, p_77192_1_, f, i3, f1)) + { + ientitylivingdata = entityliving.onInitialSpawn(p_77192_1_.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); + } + + if (entityliving.isNotColliding()) + { + ++j2; + p_77192_1_.spawnEntityInWorld(entityliving); + } + + int i4 = Reflector.ForgeEventFactory_getMaxSpawnPackSize.exists() ? Reflector.callInt(Reflector.ForgeEventFactory_getMaxSpawnPackSize, new Object[] {entityliving}): entityliving.getMaxSpawnedInChunk(); + + if (j2 >= i4) + { + continue label561; + } + } + + j4 += j2; + } + } + } + } + } + } + } + } + } + + return j4; + } + } + + protected static BlockPos getRandomChunkPosition(World worldIn, int x, int z) + { + Chunk chunk = worldIn.getChunkFromChunkCoords(x, z); + int i = x * 16 + worldIn.rand.nextInt(16); + int j = z * 16 + worldIn.rand.nextInt(16); + int k = MathHelper.roundUp(chunk.getHeight(new BlockPos(i, 0, j)) + 1, 16); + int l = worldIn.rand.nextInt(k > 0 ? k : chunk.getTopFilledSegment() + 16 - 1); + return new BlockPos(i, l, j); + } + + private static BlockPosM getRandomChunkPosition(World p_getRandomChunkPosition_0_, int p_getRandomChunkPosition_1_, int p_getRandomChunkPosition_2_, BlockPosM p_getRandomChunkPosition_3_) + { + Chunk chunk = p_getRandomChunkPosition_0_.getChunkFromChunkCoords(p_getRandomChunkPosition_1_, p_getRandomChunkPosition_2_); + int i = p_getRandomChunkPosition_1_ * 16 + p_getRandomChunkPosition_0_.rand.nextInt(16); + int j = p_getRandomChunkPosition_2_ * 16 + p_getRandomChunkPosition_0_.rand.nextInt(16); + int k = MathHelper.roundUp(chunk.getHeightValue(i & 15, j & 15) + 1, 16); + int l = p_getRandomChunkPosition_0_.rand.nextInt(k > 0 ? k : chunk.getTopFilledSegment() + 16 - 1); + p_getRandomChunkPosition_3_.setXyz(i, l, j); + return p_getRandomChunkPosition_3_; + } + + public static boolean canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType p_180267_0_, World worldIn, BlockPos pos) + { + if (!worldIn.getWorldBorder().contains(pos)) + { + return false; + } + else if (p_180267_0_ == null) + { + return false; + } + else + { + Block block = worldIn.getBlockState(pos).getBlock(); + + if (p_180267_0_ == EntityLiving.SpawnPlacementType.IN_WATER) + { + return block.getMaterial().isLiquid() && worldIn.getBlockState(pos.down()).getBlock().getMaterial().isLiquid() && !worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); + } + else + { + BlockPos blockpos = pos.down(); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + boolean flag = Reflector.ForgeBlock_canCreatureSpawn.exists() ? Reflector.callBoolean(iblockstate.getBlock(), Reflector.ForgeBlock_canCreatureSpawn, new Object[] {worldIn, blockpos, p_180267_0_}): World.doesBlockHaveSolidTopSurface(worldIn, blockpos); + + if (!flag) + { + return false; + } + else + { + Block block1 = worldIn.getBlockState(blockpos).getBlock(); + boolean flag1 = block1 != Blocks.bedrock && block1 != Blocks.barrier; + return flag1 && !block.isNormalCube() && !block.getMaterial().isLiquid() && !worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); + } + } + } + } + + /** + * Called during chunk generation to spawn initial creatures. + */ + public static void performWorldGenSpawning(World worldIn, BiomeGenBase p_77191_1_, int p_77191_2_, int p_77191_3_, int p_77191_4_, int p_77191_5_, Random p_77191_6_) + { + List list = p_77191_1_.getSpawnableList(EnumCreatureType.CREATURE); + + if (!list.isEmpty()) + { + while (p_77191_6_.nextFloat() < p_77191_1_.getSpawningChance()) + { + BiomeGenBase.SpawnListEntry biomegenbase$spawnlistentry = (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(worldIn.rand, list); + int i = biomegenbase$spawnlistentry.minGroupCount + p_77191_6_.nextInt(1 + biomegenbase$spawnlistentry.maxGroupCount - biomegenbase$spawnlistentry.minGroupCount); + IEntityLivingData ientitylivingdata = null; + int j = p_77191_2_ + p_77191_6_.nextInt(p_77191_4_); + int k = p_77191_3_ + p_77191_6_.nextInt(p_77191_5_); + int l = j; + int i1 = k; + + for (int j1 = 0; j1 < i; ++j1) + { + boolean flag = false; + + for (int k1 = 0; !flag && k1 < 4; ++k1) + { + BlockPos blockpos = worldIn.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)); + + if (canCreatureTypeSpawnAtLocation(EntityLiving.SpawnPlacementType.ON_GROUND, worldIn, blockpos)) + { + EntityLiving entityliving; + + try + { + entityliving = (EntityLiving)biomegenbase$spawnlistentry.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn}); + } + catch (Exception exception1) + { + exception1.printStackTrace(); + continue; + } + + if (Reflector.ForgeEventFactory_canEntitySpawn.exists()) + { + Object object = Reflector.call(Reflector.ForgeEventFactory_canEntitySpawn, new Object[] {entityliving, worldIn, Float.valueOf((float)j + 0.5F), Integer.valueOf(blockpos.getY()), Float.valueOf((float)k + 0.5F)}); + + if (object == ReflectorForge.EVENT_RESULT_DENY) + { + continue; + } + } + + entityliving.setLocationAndAngles((double)((float)j + 0.5F), (double)blockpos.getY(), (double)((float)k + 0.5F), p_77191_6_.nextFloat() * 360.0F, 0.0F); + worldIn.spawnEntityInWorld(entityliving); + ientitylivingdata = entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); + flag = true; + } + + j += p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5); + + for (k += p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5); j < p_77191_2_ || j >= p_77191_2_ + p_77191_4_ || k < p_77191_3_ || k >= p_77191_3_ + p_77191_4_; k = i1 + p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5)) + { + j = l + p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5); + } + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/Teleporter.java b/Client-1.8.9/src/main/java/net/minecraft/world/Teleporter.java new file mode 100644 index 0000000..ec9e1b2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/Teleporter.java @@ -0,0 +1,424 @@ +package net.minecraft.world; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.BlockPortal; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockPattern; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; + +public class Teleporter +{ + private final WorldServer worldServerInstance; + private final Random random; + private final LongHashMap destinationCoordinateCache = new LongHashMap(); + private final List destinationCoordinateKeys = Lists.newArrayList(); + + public Teleporter(WorldServer worldIn) + { + this.worldServerInstance = worldIn; + this.random = new Random(worldIn.getSeed()); + } + + public void placeInPortal(Entity entityIn, float rotationYaw) + { + if (this.worldServerInstance.provider.getDimensionId() != 1) + { + if (!this.placeInExistingPortal(entityIn, rotationYaw)) + { + this.makePortal(entityIn); + this.placeInExistingPortal(entityIn, rotationYaw); + } + } + else + { + int i = MathHelper.floor_double(entityIn.posX); + int j = MathHelper.floor_double(entityIn.posY) - 1; + int k = MathHelper.floor_double(entityIn.posZ); + int l = 1; + int i1 = 0; + + for (int j1 = -2; j1 <= 2; ++j1) + { + for (int k1 = -2; k1 <= 2; ++k1) + { + for (int l1 = -1; l1 < 3; ++l1) + { + int i2 = i + k1 * l + j1 * i1; + int j2 = j + l1; + int k2 = k + k1 * i1 - j1 * l; + boolean flag = l1 < 0; + this.worldServerInstance.setBlockState(new BlockPos(i2, j2, k2), flag ? Blocks.obsidian.getDefaultState() : Blocks.air.getDefaultState()); + } + } + } + + entityIn.setLocationAndAngles((double)i, (double)j, (double)k, entityIn.rotationYaw, 0.0F); + entityIn.motionX = entityIn.motionY = entityIn.motionZ = 0.0D; + } + } + + public boolean placeInExistingPortal(Entity entityIn, float rotationYaw) + { + int i = 128; + double d0 = -1.0D; + int j = MathHelper.floor_double(entityIn.posX); + int k = MathHelper.floor_double(entityIn.posZ); + boolean flag = true; + BlockPos blockpos = BlockPos.ORIGIN; + long l = ChunkCoordIntPair.chunkXZ2Int(j, k); + + if (this.destinationCoordinateCache.containsItem(l)) + { + Teleporter.PortalPosition teleporter$portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(l); + d0 = 0.0D; + blockpos = teleporter$portalposition; + teleporter$portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime(); + flag = false; + } + else + { + BlockPos blockpos3 = new BlockPos(entityIn); + + for (int i1 = -128; i1 <= 128; ++i1) + { + BlockPos blockpos2; + + for (int j1 = -128; j1 <= 128; ++j1) + { + for (BlockPos blockpos1 = blockpos3.add(i1, this.worldServerInstance.getActualHeight() - 1 - blockpos3.getY(), j1); blockpos1.getY() >= 0; blockpos1 = blockpos2) + { + blockpos2 = blockpos1.down(); + + if (this.worldServerInstance.getBlockState(blockpos1).getBlock() == Blocks.portal) + { + while (this.worldServerInstance.getBlockState(blockpos2 = blockpos1.down()).getBlock() == Blocks.portal) + { + blockpos1 = blockpos2; + } + + double d1 = blockpos1.distanceSq(blockpos3); + + if (d0 < 0.0D || d1 < d0) + { + d0 = d1; + blockpos = blockpos1; + } + } + } + } + } + } + + if (d0 >= 0.0D) + { + if (flag) + { + this.destinationCoordinateCache.add(l, new Teleporter.PortalPosition(blockpos, this.worldServerInstance.getTotalWorldTime())); + this.destinationCoordinateKeys.add(Long.valueOf(l)); + } + + double d5 = (double)blockpos.getX() + 0.5D; + double d6 = (double)blockpos.getY() + 0.5D; + double d7 = (double)blockpos.getZ() + 0.5D; + BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.portal.func_181089_f(this.worldServerInstance, blockpos); + boolean flag1 = blockpattern$patternhelper.getFinger().rotateY().getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE; + double d2 = blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X ? (double)blockpattern$patternhelper.getPos().getZ() : (double)blockpattern$patternhelper.getPos().getX(); + d6 = (double)(blockpattern$patternhelper.getPos().getY() + 1) - entityIn.func_181014_aG().yCoord * (double)blockpattern$patternhelper.func_181119_e(); + + if (flag1) + { + ++d2; + } + + if (blockpattern$patternhelper.getFinger().getAxis() == EnumFacing.Axis.X) + { + d7 = d2 + (1.0D - entityIn.func_181014_aG().xCoord) * (double)blockpattern$patternhelper.func_181118_d() * (double)blockpattern$patternhelper.getFinger().rotateY().getAxisDirection().getOffset(); + } + else + { + d5 = d2 + (1.0D - entityIn.func_181014_aG().xCoord) * (double)blockpattern$patternhelper.func_181118_d() * (double)blockpattern$patternhelper.getFinger().rotateY().getAxisDirection().getOffset(); + } + + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + float f3 = 0.0F; + + if (blockpattern$patternhelper.getFinger().getOpposite() == entityIn.getTeleportDirection()) + { + f = 1.0F; + f1 = 1.0F; + } + else if (blockpattern$patternhelper.getFinger().getOpposite() == entityIn.getTeleportDirection().getOpposite()) + { + f = -1.0F; + f1 = -1.0F; + } + else if (blockpattern$patternhelper.getFinger().getOpposite() == entityIn.getTeleportDirection().rotateY()) + { + f2 = 1.0F; + f3 = -1.0F; + } + else + { + f2 = -1.0F; + f3 = 1.0F; + } + + double d3 = entityIn.motionX; + double d4 = entityIn.motionZ; + entityIn.motionX = d3 * (double)f + d4 * (double)f3; + entityIn.motionZ = d3 * (double)f2 + d4 * (double)f1; + entityIn.rotationYaw = rotationYaw - (float)(entityIn.getTeleportDirection().getOpposite().getHorizontalIndex() * 90) + (float)(blockpattern$patternhelper.getFinger().getHorizontalIndex() * 90); + entityIn.setLocationAndAngles(d5, d6, d7, entityIn.rotationYaw, entityIn.rotationPitch); + return true; + } + else + { + return false; + } + } + + public boolean makePortal(Entity entityIn) + { + int i = 16; + double d0 = -1.0D; + int j = MathHelper.floor_double(entityIn.posX); + int k = MathHelper.floor_double(entityIn.posY); + int l = MathHelper.floor_double(entityIn.posZ); + int i1 = j; + int j1 = k; + int k1 = l; + int l1 = 0; + int i2 = this.random.nextInt(4); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j2 = j - i; j2 <= j + i; ++j2) + { + double d1 = (double)j2 + 0.5D - entityIn.posX; + + for (int l2 = l - i; l2 <= l + i; ++l2) + { + double d2 = (double)l2 + 0.5D - entityIn.posZ; + label142: + + for (int j3 = this.worldServerInstance.getActualHeight() - 1; j3 >= 0; --j3) + { + if (this.worldServerInstance.isAirBlock(blockpos$mutableblockpos.set(j2, j3, l2))) + { + while (j3 > 0 && this.worldServerInstance.isAirBlock(blockpos$mutableblockpos.set(j2, j3 - 1, l2))) + { + --j3; + } + + for (int k3 = i2; k3 < i2 + 4; ++k3) + { + int l3 = k3 % 2; + int i4 = 1 - l3; + + if (k3 % 4 >= 2) + { + l3 = -l3; + i4 = -i4; + } + + for (int j4 = 0; j4 < 3; ++j4) + { + for (int k4 = 0; k4 < 4; ++k4) + { + for (int l4 = -1; l4 < 4; ++l4) + { + int i5 = j2 + (k4 - 1) * l3 + j4 * i4; + int j5 = j3 + l4; + int k5 = l2 + (k4 - 1) * i4 - j4 * l3; + blockpos$mutableblockpos.set(i5, j5, k5); + + if (l4 < 0 && !this.worldServerInstance.getBlockState(blockpos$mutableblockpos).getBlock().getMaterial().isSolid() || l4 >= 0 && !this.worldServerInstance.isAirBlock(blockpos$mutableblockpos)) + { + continue label142; + } + } + } + } + + double d5 = (double)j3 + 0.5D - entityIn.posY; + double d7 = d1 * d1 + d5 * d5 + d2 * d2; + + if (d0 < 0.0D || d7 < d0) + { + d0 = d7; + i1 = j2; + j1 = j3; + k1 = l2; + l1 = k3 % 4; + } + } + } + } + } + } + + if (d0 < 0.0D) + { + for (int l5 = j - i; l5 <= j + i; ++l5) + { + double d3 = (double)l5 + 0.5D - entityIn.posX; + + for (int j6 = l - i; j6 <= l + i; ++j6) + { + double d4 = (double)j6 + 0.5D - entityIn.posZ; + label562: + + for (int i7 = this.worldServerInstance.getActualHeight() - 1; i7 >= 0; --i7) + { + if (this.worldServerInstance.isAirBlock(blockpos$mutableblockpos.set(l5, i7, j6))) + { + while (i7 > 0 && this.worldServerInstance.isAirBlock(blockpos$mutableblockpos.set(l5, i7 - 1, j6))) + { + --i7; + } + + for (int k7 = i2; k7 < i2 + 2; ++k7) + { + int j8 = k7 % 2; + int j9 = 1 - j8; + + for (int j10 = 0; j10 < 4; ++j10) + { + for (int j11 = -1; j11 < 4; ++j11) + { + int j12 = l5 + (j10 - 1) * j8; + int i13 = i7 + j11; + int j13 = j6 + (j10 - 1) * j9; + blockpos$mutableblockpos.set(j12, i13, j13); + + if (j11 < 0 && !this.worldServerInstance.getBlockState(blockpos$mutableblockpos).getBlock().getMaterial().isSolid() || j11 >= 0 && !this.worldServerInstance.isAirBlock(blockpos$mutableblockpos)) + { + continue label562; + } + } + } + + double d6 = (double)i7 + 0.5D - entityIn.posY; + double d8 = d3 * d3 + d6 * d6 + d4 * d4; + + if (d0 < 0.0D || d8 < d0) + { + d0 = d8; + i1 = l5; + j1 = i7; + k1 = j6; + l1 = k7 % 2; + } + } + } + } + } + } + } + + int i6 = i1; + int k2 = j1; + int k6 = k1; + int l6 = l1 % 2; + int i3 = 1 - l6; + + if (l1 % 4 >= 2) + { + l6 = -l6; + i3 = -i3; + } + + if (d0 < 0.0D) + { + j1 = MathHelper.clamp_int(j1, 70, this.worldServerInstance.getActualHeight() - 10); + k2 = j1; + + for (int j7 = -1; j7 <= 1; ++j7) + { + for (int l7 = 1; l7 < 3; ++l7) + { + for (int k8 = -1; k8 < 3; ++k8) + { + int k9 = i6 + (l7 - 1) * l6 + j7 * i3; + int k10 = k2 + k8; + int k11 = k6 + (l7 - 1) * i3 - j7 * l6; + boolean flag = k8 < 0; + this.worldServerInstance.setBlockState(new BlockPos(k9, k10, k11), flag ? Blocks.obsidian.getDefaultState() : Blocks.air.getDefaultState()); + } + } + } + } + + IBlockState iblockstate = Blocks.portal.getDefaultState().withProperty(BlockPortal.AXIS, l6 != 0 ? EnumFacing.Axis.X : EnumFacing.Axis.Z); + + for (int i8 = 0; i8 < 4; ++i8) + { + for (int l8 = 0; l8 < 4; ++l8) + { + for (int l9 = -1; l9 < 4; ++l9) + { + int l10 = i6 + (l8 - 1) * l6; + int l11 = k2 + l9; + int k12 = k6 + (l8 - 1) * i3; + boolean flag1 = l8 == 0 || l8 == 3 || l9 == -1 || l9 == 3; + this.worldServerInstance.setBlockState(new BlockPos(l10, l11, k12), flag1 ? Blocks.obsidian.getDefaultState() : iblockstate, 2); + } + } + + for (int i9 = 0; i9 < 4; ++i9) + { + for (int i10 = -1; i10 < 4; ++i10) + { + int i11 = i6 + (i9 - 1) * l6; + int i12 = k2 + i10; + int l12 = k6 + (i9 - 1) * i3; + BlockPos blockpos = new BlockPos(i11, i12, l12); + this.worldServerInstance.notifyNeighborsOfStateChange(blockpos, this.worldServerInstance.getBlockState(blockpos).getBlock()); + } + } + } + + return true; + } + + public void removeStalePortalLocations(long worldTime) + { + if (worldTime % 100L == 0L) + { + Iterator iterator = this.destinationCoordinateKeys.iterator(); + long i = worldTime - 300L; + + while (iterator.hasNext()) + { + Long olong = (Long)iterator.next(); + Teleporter.PortalPosition teleporter$portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(olong.longValue()); + + if (teleporter$portalposition == null || teleporter$portalposition.lastUpdateTime < i) + { + iterator.remove(); + this.destinationCoordinateCache.remove(olong.longValue()); + } + } + } + } + + public class PortalPosition extends BlockPos + { + public long lastUpdateTime; + + public PortalPosition(BlockPos pos, long lastUpdate) + { + super(pos.getX(), pos.getY(), pos.getZ()); + this.lastUpdateTime = lastUpdate; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/World.java b/Client-1.8.9/src/main/java/net/minecraft/world/World.java new file mode 100644 index 0000000..7663539 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/World.java @@ -0,0 +1,3502 @@ +package net.minecraft.world; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.base.Predicate; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import net.minecraft.block.*; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.*; +import net.minecraft.village.VillageCollection; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.MapStorage; +import net.minecraft.world.storage.WorldInfo; + +import java.util.*; +import java.util.concurrent.Callable; + +public abstract class World implements IBlockAccess +{ + private int seaLevel = 63; + protected boolean scheduledUpdatesAreImmediate; + public final List loadedEntityList = Lists.newArrayList(); + protected final List unloadedEntityList = Lists.newArrayList(); + public final List loadedTileEntityList = Lists.newArrayList(); + public final List tickableTileEntities = Lists.newArrayList(); + private final List addedTileEntityList = Lists.newArrayList(); + private final List tileEntitiesToBeRemoved = Lists.newArrayList(); + public final List playerEntities = Lists.newArrayList(); + public final List weatherEffects = Lists.newArrayList(); + protected final IntHashMap entitiesById = new IntHashMap(); + private long cloudColour = 16777215L; + private int skylightSubtracted; + protected int updateLCG = (new Random()).nextInt(); + protected final int DIST_HASH_MAGIC = 1013904223; + protected float prevRainingStrength; + protected float rainingStrength; + protected float prevThunderingStrength; + protected float thunderingStrength; + private int lastLightningBolt; + public final Random rand = new Random(); + public final WorldProvider provider; + protected List worldAccesses = Lists.newArrayList(); + protected IChunkProvider chunkProvider; + protected final ISaveHandler saveHandler; + protected WorldInfo worldInfo; + protected boolean findingSpawnPoint; + protected MapStorage mapStorage; + protected VillageCollection villageCollectionObj; + public final Profiler theProfiler; + private final Calendar theCalendar = Calendar.getInstance(); + protected Scoreboard worldScoreboard = new Scoreboard(); + public final boolean isRemote; + protected Set activeChunkSet = Sets.newHashSet(); + private int ambientTickCountdown; + protected boolean spawnHostileMobs; + protected boolean spawnPeacefulMobs; + private boolean processingLoadedTiles; + private final WorldBorder worldBorder; + int[] lightUpdateBlockList; + + protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client) + { + this.ambientTickCountdown = this.rand.nextInt(12000); + this.spawnHostileMobs = true; + this.spawnPeacefulMobs = true; + this.lightUpdateBlockList = new int[32768]; + this.saveHandler = saveHandlerIn; + this.theProfiler = profilerIn; + this.worldInfo = info; + this.provider = providerIn; + this.isRemote = client; + this.worldBorder = providerIn.getWorldBorder(); + } + + public World init() + { + return this; + } + + public BiomeGenBase getBiomeGenForCoords(final BlockPos pos) + { + if (this.isBlockLoaded(pos)) + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + + try + { + return chunk.getBiome(pos, this.provider.getWorldChunkManager()); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() + { + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo(pos); + } + }); + throw new ReportedException(crashreport); + } + } + else + { + return this.provider.getWorldChunkManager().getBiomeGenerator(pos, BiomeGenBase.plains); + } + } + + public WorldChunkManager getWorldChunkManager() + { + return this.provider.getWorldChunkManager(); + } + + protected abstract IChunkProvider createChunkProvider(); + + public void initialize(WorldSettings settings) + { + this.worldInfo.setServerInitialized(true); + } + + public void setInitialSpawnLocation() + { + this.setSpawnPoint(new BlockPos(8, 64, 8)); + } + + public Block getGroundAboveSeaLevel(BlockPos pos) + { + BlockPos blockpos; + + for (blockpos = new BlockPos(pos.getX(), this.getSeaLevel(), pos.getZ()); !this.isAirBlock(blockpos.up()); blockpos = blockpos.up()) + { + ; + } + + return this.getBlockState(blockpos).getBlock(); + } + + private boolean isValid(BlockPos pos) + { + return pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000 && pos.getY() >= 0 && pos.getY() < 256; + } + + public boolean isAirBlock(BlockPos pos) + { + return this.getBlockState(pos).getBlock().getMaterial() == Material.air; + } + + public boolean isBlockLoaded(BlockPos pos) + { + return this.isBlockLoaded(pos, true); + } + + public boolean isBlockLoaded(BlockPos pos, boolean allowEmpty) + { + return !this.isValid(pos) ? false : this.isChunkLoaded(pos.getX() >> 4, pos.getZ() >> 4, allowEmpty); + } + + public boolean isAreaLoaded(BlockPos center, int radius) + { + return this.isAreaLoaded(center, radius, true); + } + + public boolean isAreaLoaded(BlockPos center, int radius, boolean allowEmpty) + { + return this.isAreaLoaded(center.getX() - radius, center.getY() - radius, center.getZ() - radius, center.getX() + radius, center.getY() + radius, center.getZ() + radius, allowEmpty); + } + + public boolean isAreaLoaded(BlockPos from, BlockPos to) + { + return this.isAreaLoaded(from, to, true); + } + + public boolean isAreaLoaded(BlockPos from, BlockPos to, boolean allowEmpty) + { + return this.isAreaLoaded(from.getX(), from.getY(), from.getZ(), to.getX(), to.getY(), to.getZ(), allowEmpty); + } + + public boolean isAreaLoaded(StructureBoundingBox box) + { + return this.isAreaLoaded(box, true); + } + + public boolean isAreaLoaded(StructureBoundingBox box, boolean allowEmpty) + { + return this.isAreaLoaded(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, allowEmpty); + } + + private boolean isAreaLoaded(int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, boolean allowEmpty) + { + if (yEnd >= 0 && yStart < 256) + { + xStart = xStart >> 4; + zStart = zStart >> 4; + xEnd = xEnd >> 4; + zEnd = zEnd >> 4; + + for (int i = xStart; i <= xEnd; ++i) + { + for (int j = zStart; j <= zEnd; ++j) + { + if (!this.isChunkLoaded(i, j, allowEmpty)) + { + return false; + } + } + } + + return true; + } + else + { + return false; + } + } + + protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) + { + return this.chunkProvider.chunkExists(x, z) && (allowEmpty || !this.chunkProvider.provideChunk(x, z).isEmpty()); + } + + public Chunk getChunkFromBlockCoords(BlockPos pos) + { + return this.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4); + } + + public Chunk getChunkFromChunkCoords(int chunkX, int chunkZ) + { + return this.chunkProvider.provideChunk(chunkX, chunkZ); + } + + public boolean setBlockState(BlockPos pos, IBlockState newState, int flags) + { + if (!this.isValid(pos)) + { + return false; + } + else if (!this.isRemote && this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) + { + return false; + } + else + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + Block block = newState.getBlock(); + IBlockState iblockstate = chunk.setBlockState(pos, newState); + + if (iblockstate == null) + { + return false; + } + else + { + Block block1 = iblockstate.getBlock(); + + if (block.getLightOpacity() != block1.getLightOpacity() || block.getLightValue() != block1.getLightValue()) + { + this.theProfiler.startSection("checkLight"); + this.checkLight(pos); + this.theProfiler.endSection(); + } + + if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && chunk.isPopulated()) + { + this.markBlockForUpdate(pos); + } + + if (!this.isRemote && (flags & 1) != 0) + { + this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock()); + + if (block.hasComparatorInputOverride()) + { + this.updateComparatorOutputLevel(pos, block); + } + } + + return true; + } + } + } + + public boolean setBlockToAir(BlockPos pos) + { + return this.setBlockState(pos, Blocks.air.getDefaultState(), 3); + } + + public boolean destroyBlock(BlockPos pos, boolean dropBlock) + { + IBlockState iblockstate = this.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if (block.getMaterial() == Material.air) + { + return false; + } + else + { + this.playAuxSFX(2001, pos, Block.getStateId(iblockstate)); + + if (dropBlock) + { + block.dropBlockAsItem(this, pos, iblockstate, 0); + } + + return this.setBlockState(pos, Blocks.air.getDefaultState(), 3); + } + } + + public boolean setBlockState(BlockPos pos, IBlockState state) + { + return this.setBlockState(pos, state, 3); + } + + public void markBlockForUpdate(BlockPos pos) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).markBlockForUpdate(pos); + } + } + + public void notifyNeighborsRespectDebug(BlockPos pos, Block blockType) + { + if (this.worldInfo.getTerrainType() != WorldType.DEBUG_WORLD) + { + this.notifyNeighborsOfStateChange(pos, blockType); + } + } + + public void markBlocksDirtyVertical(int x1, int z1, int x2, int z2) + { + if (x2 > z2) + { + int i = z2; + z2 = x2; + x2 = i; + } + + if (!this.provider.getHasNoSky()) + { + for (int j = x2; j <= z2; ++j) + { + this.checkLightFor(EnumSkyBlock.SKY, new BlockPos(x1, j, z1)); + } + } + + this.markBlockRangeForRenderUpdate(x1, x2, z1, x1, z2, z1); + } + + public void markBlockRangeForRenderUpdate(BlockPos rangeMin, BlockPos rangeMax) + { + this.markBlockRangeForRenderUpdate(rangeMin.getX(), rangeMin.getY(), rangeMin.getZ(), rangeMax.getX(), rangeMax.getY(), rangeMax.getZ()); + } + + public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).markBlockRangeForRenderUpdate(x1, y1, z1, x2, y2, z2); + } + } + + public void notifyNeighborsOfStateChange(BlockPos pos, Block blockType) + { + this.notifyBlockOfStateChange(pos.west(), blockType); + this.notifyBlockOfStateChange(pos.east(), blockType); + this.notifyBlockOfStateChange(pos.down(), blockType); + this.notifyBlockOfStateChange(pos.up(), blockType); + this.notifyBlockOfStateChange(pos.north(), blockType); + this.notifyBlockOfStateChange(pos.south(), blockType); + } + + public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide) + { + if (skipSide != EnumFacing.WEST) + { + this.notifyBlockOfStateChange(pos.west(), blockType); + } + + if (skipSide != EnumFacing.EAST) + { + this.notifyBlockOfStateChange(pos.east(), blockType); + } + + if (skipSide != EnumFacing.DOWN) + { + this.notifyBlockOfStateChange(pos.down(), blockType); + } + + if (skipSide != EnumFacing.UP) + { + this.notifyBlockOfStateChange(pos.up(), blockType); + } + + if (skipSide != EnumFacing.NORTH) + { + this.notifyBlockOfStateChange(pos.north(), blockType); + } + + if (skipSide != EnumFacing.SOUTH) + { + this.notifyBlockOfStateChange(pos.south(), blockType); + } + } + + public void notifyBlockOfStateChange(BlockPos pos, final Block blockIn) + { + if (!this.isRemote) + { + IBlockState iblockstate = this.getBlockState(pos); + + try + { + iblockstate.getBlock().onNeighborBlockChange(this, pos, iblockstate, blockIn); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while updating neighbours"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being updated"); + crashreportcategory.addCrashSectionCallable("Source block type", new Callable() + { + public String call() throws Exception + { + try + { + return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(Block.getIdFromBlock(blockIn)), blockIn.getUnlocalizedName(), blockIn.getClass().getCanonicalName()}); + } + catch (Throwable var2) + { + return "ID #" + Block.getIdFromBlock(blockIn); + } + } + }); + CrashReportCategory.addBlockInfo(crashreportcategory, pos, iblockstate); + throw new ReportedException(crashreport); + } + } + } + + public boolean isBlockTickPending(BlockPos pos, Block blockType) + { + return false; + } + + public boolean canSeeSky(BlockPos pos) + { + return this.getChunkFromBlockCoords(pos).canSeeSky(pos); + } + + public boolean canBlockSeeSky(BlockPos pos) + { + if (pos.getY() >= this.getSeaLevel()) + { + return this.canSeeSky(pos); + } + else + { + BlockPos blockpos = new BlockPos(pos.getX(), this.getSeaLevel(), pos.getZ()); + + if (!this.canSeeSky(blockpos)) + { + return false; + } + else + { + for (blockpos = blockpos.down(); blockpos.getY() > pos.getY(); blockpos = blockpos.down()) + { + Block block = this.getBlockState(blockpos).getBlock(); + + if (block.getLightOpacity() > 0 && !block.getMaterial().isLiquid()) + { + return false; + } + } + + return true; + } + } + } + + public int getLight(BlockPos pos) + { + if (pos.getY() < 0) + { + return 0; + } + else + { + if (pos.getY() >= 256) + { + pos = new BlockPos(pos.getX(), 255, pos.getZ()); + } + + return this.getChunkFromBlockCoords(pos).getLightSubtracted(pos, 0); + } + } + + public int getLightFromNeighbors(BlockPos pos) + { + return this.getLight(pos, true); + } + + public int getLight(BlockPos pos, boolean checkNeighbors) + { + if (pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000) + { + if (checkNeighbors && this.getBlockState(pos).getBlock().getUseNeighborBrightness()) + { + int i1 = this.getLight(pos.up(), false); + int i = this.getLight(pos.east(), false); + int j = this.getLight(pos.west(), false); + int k = this.getLight(pos.south(), false); + int l = this.getLight(pos.north(), false); + + if (i > i1) + { + i1 = i; + } + + if (j > i1) + { + i1 = j; + } + + if (k > i1) + { + i1 = k; + } + + if (l > i1) + { + i1 = l; + } + + return i1; + } + else if (pos.getY() < 0) + { + return 0; + } + else + { + if (pos.getY() >= 256) + { + pos = new BlockPos(pos.getX(), 255, pos.getZ()); + } + + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getLightSubtracted(pos, this.skylightSubtracted); + } + } + else + { + return 15; + } + } + + public BlockPos getHeight(BlockPos pos) + { + int i; + + if (pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000) + { + if (this.isChunkLoaded(pos.getX() >> 4, pos.getZ() >> 4, true)) + { + i = this.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4).getHeightValue(pos.getX() & 15, pos.getZ() & 15); + } + else + { + i = 0; + } + } + else + { + i = this.getSeaLevel() + 1; + } + + return new BlockPos(pos.getX(), i, pos.getZ()); + } + + public int getChunksLowestHorizon(int x, int z) + { + if (x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000) + { + if (!this.isChunkLoaded(x >> 4, z >> 4, true)) + { + return 0; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(x >> 4, z >> 4); + return chunk.getLowestHeight(); + } + } + else + { + return this.getSeaLevel() + 1; + } + } + + public int getLightFromNeighborsFor(EnumSkyBlock type, BlockPos pos) + { + if (this.provider.getHasNoSky() && type == EnumSkyBlock.SKY) + { + return 0; + } + else + { + if (pos.getY() < 0) + { + pos = new BlockPos(pos.getX(), 0, pos.getZ()); + } + + if (!this.isValid(pos)) + { + return type.defaultLightValue; + } + else if (!this.isBlockLoaded(pos)) + { + return type.defaultLightValue; + } + else if (this.getBlockState(pos).getBlock().getUseNeighborBrightness()) + { + int i1 = this.getLightFor(type, pos.up()); + int i = this.getLightFor(type, pos.east()); + int j = this.getLightFor(type, pos.west()); + int k = this.getLightFor(type, pos.south()); + int l = this.getLightFor(type, pos.north()); + + if (i > i1) + { + i1 = i; + } + + if (j > i1) + { + i1 = j; + } + + if (k > i1) + { + i1 = k; + } + + if (l > i1) + { + i1 = l; + } + + return i1; + } + else + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getLightFor(type, pos); + } + } + } + + public int getLightFor(EnumSkyBlock type, BlockPos pos) + { + if (pos.getY() < 0) + { + pos = new BlockPos(pos.getX(), 0, pos.getZ()); + } + + if (!this.isValid(pos)) + { + return type.defaultLightValue; + } + else if (!this.isBlockLoaded(pos)) + { + return type.defaultLightValue; + } + else + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getLightFor(type, pos); + } + } + + public void setLightFor(EnumSkyBlock type, BlockPos pos, int lightValue) + { + if (this.isValid(pos)) + { + if (this.isBlockLoaded(pos)) + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + chunk.setLightFor(type, pos, lightValue); + this.notifyLightSet(pos); + } + } + } + + public void notifyLightSet(BlockPos pos) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).notifyLightSet(pos); + } + } + + public int getCombinedLight(BlockPos pos, int lightValue) + { + int i = this.getLightFromNeighborsFor(EnumSkyBlock.SKY, pos); + int j = this.getLightFromNeighborsFor(EnumSkyBlock.BLOCK, pos); + + if (j < lightValue) + { + j = lightValue; + } + + return i << 20 | j << 4; + } + + public float getLightBrightness(BlockPos pos) + { + return this.provider.getLightBrightnessTable()[this.getLightFromNeighbors(pos)]; + } + + public IBlockState getBlockState(BlockPos pos) + { + if (!this.isValid(pos)) + { + return Blocks.air.getDefaultState(); + } + else + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + return chunk.getBlockState(pos); + } + } + + public boolean isDaytime() + { + return this.skylightSubtracted < 4; + } + + public MovingObjectPosition rayTraceBlocks(Vec3 p_72933_1_, Vec3 p_72933_2_) + { + return this.rayTraceBlocks(p_72933_1_, p_72933_2_, false, false, false); + } + + public MovingObjectPosition rayTraceBlocks(Vec3 start, Vec3 end, boolean stopOnLiquid) + { + return this.rayTraceBlocks(start, end, stopOnLiquid, false, false); + } + + public MovingObjectPosition rayTraceBlocks(Vec3 vec31, Vec3 vec32, boolean stopOnLiquid, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) + { + if (!Double.isNaN(vec31.xCoord) && !Double.isNaN(vec31.yCoord) && !Double.isNaN(vec31.zCoord)) + { + if (!Double.isNaN(vec32.xCoord) && !Double.isNaN(vec32.yCoord) && !Double.isNaN(vec32.zCoord)) + { + int i = MathHelper.floor_double(vec32.xCoord); + int j = MathHelper.floor_double(vec32.yCoord); + int k = MathHelper.floor_double(vec32.zCoord); + int l = MathHelper.floor_double(vec31.xCoord); + int i1 = MathHelper.floor_double(vec31.yCoord); + int j1 = MathHelper.floor_double(vec31.zCoord); + BlockPos blockpos = new BlockPos(l, i1, j1); + IBlockState iblockstate = this.getBlockState(blockpos); + Block block = iblockstate.getBlock(); + + if ((!ignoreBlockWithoutBoundingBox || block.getCollisionBoundingBox(this, blockpos, iblockstate) != null) && block.canCollideCheck(iblockstate, stopOnLiquid)) + { + MovingObjectPosition movingobjectposition = block.collisionRayTrace(this, blockpos, vec31, vec32); + + if (movingobjectposition != null) + { + return movingobjectposition; + } + } + + MovingObjectPosition movingobjectposition2 = null; + int k1 = 200; + + while (k1-- >= 0) + { + if (Double.isNaN(vec31.xCoord) || Double.isNaN(vec31.yCoord) || Double.isNaN(vec31.zCoord)) + { + return null; + } + + if (l == i && i1 == j && j1 == k) + { + return returnLastUncollidableBlock ? movingobjectposition2 : null; + } + + boolean flag2 = true; + boolean flag = true; + boolean flag1 = true; + double d0 = 999.0D; + double d1 = 999.0D; + double d2 = 999.0D; + + if (i > l) + { + d0 = (double)l + 1.0D; + } + else if (i < l) + { + d0 = (double)l + 0.0D; + } + else + { + flag2 = false; + } + + if (j > i1) + { + d1 = (double)i1 + 1.0D; + } + else if (j < i1) + { + d1 = (double)i1 + 0.0D; + } + else + { + flag = false; + } + + if (k > j1) + { + d2 = (double)j1 + 1.0D; + } + else if (k < j1) + { + d2 = (double)j1 + 0.0D; + } + else + { + flag1 = false; + } + + double d3 = 999.0D; + double d4 = 999.0D; + double d5 = 999.0D; + double d6 = vec32.xCoord - vec31.xCoord; + double d7 = vec32.yCoord - vec31.yCoord; + double d8 = vec32.zCoord - vec31.zCoord; + + if (flag2) + { + d3 = (d0 - vec31.xCoord) / d6; + } + + if (flag) + { + d4 = (d1 - vec31.yCoord) / d7; + } + + if (flag1) + { + d5 = (d2 - vec31.zCoord) / d8; + } + + if (d3 == -0.0D) + { + d3 = -1.0E-4D; + } + + if (d4 == -0.0D) + { + d4 = -1.0E-4D; + } + + if (d5 == -0.0D) + { + d5 = -1.0E-4D; + } + + EnumFacing enumfacing; + + if (d3 < d4 && d3 < d5) + { + enumfacing = i > l ? EnumFacing.WEST : EnumFacing.EAST; + vec31 = new Vec3(d0, vec31.yCoord + d7 * d3, vec31.zCoord + d8 * d3); + } + else if (d4 < d5) + { + enumfacing = j > i1 ? EnumFacing.DOWN : EnumFacing.UP; + vec31 = new Vec3(vec31.xCoord + d6 * d4, d1, vec31.zCoord + d8 * d4); + } + else + { + enumfacing = k > j1 ? EnumFacing.NORTH : EnumFacing.SOUTH; + vec31 = new Vec3(vec31.xCoord + d6 * d5, vec31.yCoord + d7 * d5, d2); + } + + l = MathHelper.floor_double(vec31.xCoord) - (enumfacing == EnumFacing.EAST ? 1 : 0); + i1 = MathHelper.floor_double(vec31.yCoord) - (enumfacing == EnumFacing.UP ? 1 : 0); + j1 = MathHelper.floor_double(vec31.zCoord) - (enumfacing == EnumFacing.SOUTH ? 1 : 0); + blockpos = new BlockPos(l, i1, j1); + IBlockState iblockstate1 = this.getBlockState(blockpos); + Block block1 = iblockstate1.getBlock(); + + if (!ignoreBlockWithoutBoundingBox || block1.getCollisionBoundingBox(this, blockpos, iblockstate1) != null) + { + if (block1.canCollideCheck(iblockstate1, stopOnLiquid)) + { + MovingObjectPosition movingobjectposition1 = block1.collisionRayTrace(this, blockpos, vec31, vec32); + + if (movingobjectposition1 != null) + { + return movingobjectposition1; + } + } + else + { + movingobjectposition2 = new MovingObjectPosition(MovingObjectPosition.MovingObjectType.MISS, vec31, enumfacing, blockpos); + } + } + } + + return returnLastUncollidableBlock ? movingobjectposition2 : null; + } + else + { + return null; + } + } + else + { + return null; + } + } + + public void playSoundAtEntity(Entity entityIn, String name, float volume, float pitch) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playSound(name, entityIn.posX, entityIn.posY, entityIn.posZ, volume, pitch); + } + } + + public void playSoundToNearExcept(EntityPlayer player, String name, float volume, float pitch) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playSoundToNearExcept(player, name, player.posX, player.posY, player.posZ, volume, pitch); + } + } + + public void playSoundEffect(double x, double y, double z, String soundName, float volume, float pitch) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playSound(soundName, x, y, z, volume, pitch); + } + } + + public void playSound(double x, double y, double z, String soundName, float volume, float pitch, boolean distanceDelay) + { + } + + public void playRecord(BlockPos pos, String name) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playRecord(name, pos); + } + } + + public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... p_175688_14_) + { + this.spawnParticle(particleType.getParticleID(), particleType.getShouldIgnoreRange(), xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, p_175688_14_); + } + + public void spawnParticle(EnumParticleTypes particleType, boolean p_175682_2_, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... p_175682_15_) + { + this.spawnParticle(particleType.getParticleID(), particleType.getShouldIgnoreRange() | p_175682_2_, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, p_175682_15_); + } + + private void spawnParticle(int particleID, boolean p_175720_2_, double xCood, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... p_175720_15_) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).spawnParticle(particleID, p_175720_2_, xCood, yCoord, zCoord, xOffset, yOffset, zOffset, p_175720_15_); + } + } + + public boolean addWeatherEffect(Entity entityIn) + { + this.weatherEffects.add(entityIn); + return true; + } + + public boolean spawnEntityInWorld(Entity entityIn) + { + int i = MathHelper.floor_double(entityIn.posX / 16.0D); + int j = MathHelper.floor_double(entityIn.posZ / 16.0D); + boolean flag = entityIn.forceSpawn; + + if (entityIn instanceof EntityPlayer) + { + flag = true; + } + + if (!flag && !this.isChunkLoaded(i, j, true)) + { + return false; + } + else + { + if (entityIn instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)entityIn; + this.playerEntities.add(entityplayer); + this.updateAllPlayersSleepingFlag(); + } + + this.getChunkFromChunkCoords(i, j).addEntity(entityIn); + this.loadedEntityList.add(entityIn); + this.onEntityAdded(entityIn); + return true; + } + } + + protected void onEntityAdded(Entity entityIn) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).onEntityAdded(entityIn); + } + } + + protected void onEntityRemoved(Entity entityIn) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).onEntityRemoved(entityIn); + } + } + + public void removeEntity(Entity entityIn) + { + if (entityIn.riddenByEntity != null) + { + entityIn.riddenByEntity.mountEntity((Entity)null); + } + + if (entityIn.ridingEntity != null) + { + entityIn.mountEntity((Entity)null); + } + + entityIn.setDead(); + + if (entityIn instanceof EntityPlayer) + { + this.playerEntities.remove(entityIn); + this.updateAllPlayersSleepingFlag(); + this.onEntityRemoved(entityIn); + } + } + + public void removePlayerEntityDangerously(Entity entityIn) + { + entityIn.setDead(); + + if (entityIn instanceof EntityPlayer) + { + this.playerEntities.remove(entityIn); + this.updateAllPlayersSleepingFlag(); + } + + int i = entityIn.chunkCoordX; + int j = entityIn.chunkCoordZ; + + if (entityIn.addedToChunk && this.isChunkLoaded(i, j, true)) + { + this.getChunkFromChunkCoords(i, j).removeEntity(entityIn); + } + + this.loadedEntityList.remove(entityIn); + this.onEntityRemoved(entityIn); + } + + public void addWorldAccess(IWorldAccess worldAccess) + { + this.worldAccesses.add(worldAccess); + } + + public void removeWorldAccess(IWorldAccess worldAccess) + { + this.worldAccesses.remove(worldAccess); + } + + public List getCollidingBoundingBoxes(Entity entityIn, AxisAlignedBB bb) + { + List list = Lists.newArrayList(); + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + WorldBorder worldborder = this.getWorldBorder(); + boolean flag = entityIn.isOutsideBorder(); + boolean flag1 = this.isInsideBorder(worldborder, entityIn); + IBlockState iblockstate = Blocks.stone.getDefaultState(); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = i1; l1 < j1; ++l1) + { + if (this.isBlockLoaded(blockpos$mutableblockpos.set(k1, 64, l1))) + { + for (int i2 = k - 1; i2 < l; ++i2) + { + blockpos$mutableblockpos.set(k1, i2, l1); + + if (flag && flag1) + { + entityIn.setOutsideBorder(false); + } + else if (!flag && !flag1) + { + entityIn.setOutsideBorder(true); + } + + IBlockState iblockstate1 = iblockstate; + + if (worldborder.contains(blockpos$mutableblockpos) || !flag1) + { + iblockstate1 = this.getBlockState(blockpos$mutableblockpos); + } + + iblockstate1.getBlock().addCollisionBoxesToList(this, blockpos$mutableblockpos, iblockstate1, bb, list, entityIn); + } + } + } + } + + double d0 = 0.25D; + List list1 = this.getEntitiesWithinAABBExcludingEntity(entityIn, bb.expand(d0, d0, d0)); + + for (int j2 = 0; j2 < list1.size(); ++j2) + { + if (entityIn.riddenByEntity != list1 && entityIn.ridingEntity != list1) + { + AxisAlignedBB axisalignedbb = ((Entity)list1.get(j2)).getCollisionBoundingBox(); + + if (axisalignedbb != null && axisalignedbb.intersectsWith(bb)) + { + list.add(axisalignedbb); + } + + axisalignedbb = entityIn.getCollisionBox((Entity)list1.get(j2)); + + if (axisalignedbb != null && axisalignedbb.intersectsWith(bb)) + { + list.add(axisalignedbb); + } + } + } + + return list; + } + + public boolean isInsideBorder(WorldBorder worldBorderIn, Entity entityIn) + { + double d0 = worldBorderIn.minX(); + double d1 = worldBorderIn.minZ(); + double d2 = worldBorderIn.maxX(); + double d3 = worldBorderIn.maxZ(); + + if (entityIn.isOutsideBorder()) + { + ++d0; + ++d1; + --d2; + --d3; + } + else + { + --d0; + --d1; + ++d2; + ++d3; + } + + return entityIn.posX > d0 && entityIn.posX < d2 && entityIn.posZ > d1 && entityIn.posZ < d3; + } + + public List getCollisionBoxes(AxisAlignedBB bb) + { + List list = Lists.newArrayList(); + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = i1; l1 < j1; ++l1) + { + if (this.isBlockLoaded(blockpos$mutableblockpos.set(k1, 64, l1))) + { + for (int i2 = k - 1; i2 < l; ++i2) + { + blockpos$mutableblockpos.set(k1, i2, l1); + IBlockState iblockstate; + + if (k1 >= -30000000 && k1 < 30000000 && l1 >= -30000000 && l1 < 30000000) + { + iblockstate = this.getBlockState(blockpos$mutableblockpos); + } + else + { + iblockstate = Blocks.bedrock.getDefaultState(); + } + + iblockstate.getBlock().addCollisionBoxesToList(this, blockpos$mutableblockpos, iblockstate, bb, list, (Entity)null); + } + } + } + } + + return list; + } + + public int calculateSkylightSubtracted(float p_72967_1_) + { + float f = this.getCelestialAngle(p_72967_1_); + float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F); + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f1 = 1.0F - f1; + f1 = (float)((double)f1 * (1.0D - (double)(this.getRainStrength(p_72967_1_) * 5.0F) / 16.0D)); + f1 = (float)((double)f1 * (1.0D - (double)(this.getThunderStrength(p_72967_1_) * 5.0F) / 16.0D)); + f1 = 1.0F - f1; + return (int)(f1 * 11.0F); + } + + public float getSunBrightness(float p_72971_1_) + { + float f = this.getCelestialAngle(p_72971_1_); + float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F); + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f1 = 1.0F - f1; + f1 = (float)((double)f1 * (1.0D - (double)(this.getRainStrength(p_72971_1_) * 5.0F) / 16.0D)); + f1 = (float)((double)f1 * (1.0D - (double)(this.getThunderStrength(p_72971_1_) * 5.0F) / 16.0D)); + return f1 * 0.8F + 0.2F; + } + + public Vec3 getSkyColor(Entity entityIn, float partialTicks) + { + float f = this.getCelestialAngle(partialTicks); + float f1 = MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + int i = MathHelper.floor_double(entityIn.posX); + int j = MathHelper.floor_double(entityIn.posY); + int k = MathHelper.floor_double(entityIn.posZ); + BlockPos blockpos = new BlockPos(i, j, k); + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(blockpos); + float f2 = biomegenbase.getFloatTemperature(blockpos); + int l = biomegenbase.getSkyColorByTemp(f2); + float f3 = (float)(l >> 16 & 255) / 255.0F; + float f4 = (float)(l >> 8 & 255) / 255.0F; + float f5 = (float)(l & 255) / 255.0F; + f3 = f3 * f1; + f4 = f4 * f1; + f5 = f5 * f1; + float f6 = this.getRainStrength(partialTicks); + + if (f6 > 0.0F) + { + float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F; + float f8 = 1.0F - f6 * 0.75F; + f3 = f3 * f8 + f7 * (1.0F - f8); + f4 = f4 * f8 + f7 * (1.0F - f8); + f5 = f5 * f8 + f7 * (1.0F - f8); + } + + float f10 = this.getThunderStrength(partialTicks); + + if (f10 > 0.0F) + { + float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F; + float f9 = 1.0F - f10 * 0.75F; + f3 = f3 * f9 + f11 * (1.0F - f9); + f4 = f4 * f9 + f11 * (1.0F - f9); + f5 = f5 * f9 + f11 * (1.0F - f9); + } + + if (this.lastLightningBolt > 0) + { + float f12 = (float)this.lastLightningBolt - partialTicks; + + if (f12 > 1.0F) + { + f12 = 1.0F; + } + + f12 = f12 * 0.45F; + f3 = f3 * (1.0F - f12) + 0.8F * f12; + f4 = f4 * (1.0F - f12) + 0.8F * f12; + f5 = f5 * (1.0F - f12) + 1.0F * f12; + } + + return new Vec3((double)f3, (double)f4, (double)f5); + } + + public float getCelestialAngle(float partialTicks) + { + return this.provider.calculateCelestialAngle(this.worldInfo.getWorldTime(), partialTicks); + } + + public int getMoonPhase() + { + return this.provider.getMoonPhase(this.worldInfo.getWorldTime()); + } + + public float getCurrentMoonPhaseFactor() + { + return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; + } + + public float getCelestialAngleRadians(float partialTicks) + { + float f = this.getCelestialAngle(partialTicks); + return f * (float)Math.PI * 2.0F; + } + + public Vec3 getCloudColour(float partialTicks) + { + float f = this.getCelestialAngle(partialTicks); + float f1 = MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f2 = (float)(this.cloudColour >> 16 & 255L) / 255.0F; + float f3 = (float)(this.cloudColour >> 8 & 255L) / 255.0F; + float f4 = (float)(this.cloudColour & 255L) / 255.0F; + float f5 = this.getRainStrength(partialTicks); + + if (f5 > 0.0F) + { + float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F; + float f7 = 1.0F - f5 * 0.95F; + f2 = f2 * f7 + f6 * (1.0F - f7); + f3 = f3 * f7 + f6 * (1.0F - f7); + f4 = f4 * f7 + f6 * (1.0F - f7); + } + + f2 = f2 * (f1 * 0.9F + 0.1F); + f3 = f3 * (f1 * 0.9F + 0.1F); + f4 = f4 * (f1 * 0.85F + 0.15F); + float f9 = this.getThunderStrength(partialTicks); + + if (f9 > 0.0F) + { + float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F; + float f8 = 1.0F - f9 * 0.95F; + f2 = f2 * f8 + f10 * (1.0F - f8); + f3 = f3 * f8 + f10 * (1.0F - f8); + f4 = f4 * f8 + f10 * (1.0F - f8); + } + + return new Vec3((double)f2, (double)f3, (double)f4); + } + + public Vec3 getFogColor(float partialTicks) + { + float f = this.getCelestialAngle(partialTicks); + return this.provider.getFogColor(f, partialTicks); + } + + public BlockPos getPrecipitationHeight(BlockPos pos) + { + return this.getChunkFromBlockCoords(pos).getPrecipitationHeight(pos); + } + + public BlockPos getTopSolidOrLiquidBlock(BlockPos pos) + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + BlockPos blockpos; + BlockPos blockpos1; + + for (blockpos = new BlockPos(pos.getX(), chunk.getTopFilledSegment() + 16, pos.getZ()); blockpos.getY() >= 0; blockpos = blockpos1) + { + blockpos1 = blockpos.down(); + Material material = chunk.getBlock(blockpos1).getMaterial(); + + if (material.blocksMovement() && material != Material.leaves) + { + break; + } + } + + return blockpos; + } + + public float getStarBrightness(float partialTicks) + { + float f = this.getCelestialAngle(partialTicks); + float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + return f1 * f1 * 0.5F; + } + + public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) + { + } + + public void updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority) + { + } + + public void scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority) + { + } + + public void updateEntities() + { + this.theProfiler.startSection("entities"); + this.theProfiler.startSection("global"); + + for (int i = 0; i < this.weatherEffects.size(); ++i) + { + Entity entity = (Entity)this.weatherEffects.get(i); + + try + { + ++entity.ticksExisted; + entity.onUpdate(); + } + catch (Throwable throwable2) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable2, "Ticking entity"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being ticked"); + + if (entity == null) + { + crashreportcategory.addCrashSection("Entity", "~~NULL~~"); + } + else + { + entity.addEntityCrashInfo(crashreportcategory); + } + + throw new ReportedException(crashreport); + } + + if (entity.isDead) + { + this.weatherEffects.remove(i--); + } + } + + this.theProfiler.endStartSection("remove"); + this.loadedEntityList.removeAll(this.unloadedEntityList); + + for (int k = 0; k < this.unloadedEntityList.size(); ++k) + { + Entity entity1 = (Entity)this.unloadedEntityList.get(k); + int j = entity1.chunkCoordX; + int l1 = entity1.chunkCoordZ; + + if (entity1.addedToChunk && this.isChunkLoaded(j, l1, true)) + { + this.getChunkFromChunkCoords(j, l1).removeEntity(entity1); + } + } + + for (int l = 0; l < this.unloadedEntityList.size(); ++l) + { + this.onEntityRemoved((Entity)this.unloadedEntityList.get(l)); + } + + this.unloadedEntityList.clear(); + this.theProfiler.endStartSection("regular"); + + for (int i1 = 0; i1 < this.loadedEntityList.size(); ++i1) + { + Entity entity2 = (Entity)this.loadedEntityList.get(i1); + + if (entity2.ridingEntity != null) + { + if (!entity2.ridingEntity.isDead && entity2.ridingEntity.riddenByEntity == entity2) + { + continue; + } + + entity2.ridingEntity.riddenByEntity = null; + entity2.ridingEntity = null; + } + + this.theProfiler.startSection("tick"); + + if (!entity2.isDead) + { + try + { + this.updateEntity(entity2); + } + catch (Throwable throwable1) + { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable1, "Ticking entity"); + CrashReportCategory crashreportcategory2 = crashreport1.makeCategory("Entity being ticked"); + entity2.addEntityCrashInfo(crashreportcategory2); + throw new ReportedException(crashreport1); + } + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("remove"); + + if (entity2.isDead) + { + int k1 = entity2.chunkCoordX; + int i2 = entity2.chunkCoordZ; + + if (entity2.addedToChunk && this.isChunkLoaded(k1, i2, true)) + { + this.getChunkFromChunkCoords(k1, i2).removeEntity(entity2); + } + + this.loadedEntityList.remove(i1--); + this.onEntityRemoved(entity2); + } + + this.theProfiler.endSection(); + } + + this.theProfiler.endStartSection("blockEntities"); + this.processingLoadedTiles = true; + Iterator iterator = this.tickableTileEntities.iterator(); + + while (iterator.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator.next(); + + if (!tileentity.isInvalid() && tileentity.hasWorldObj()) + { + BlockPos blockpos = tileentity.getPos(); + + if (this.isBlockLoaded(blockpos) && this.worldBorder.contains(blockpos)) + { + try + { + ((ITickable)tileentity).update(); + } + catch (Throwable throwable) + { + CrashReport crashreport2 = CrashReport.makeCrashReport(throwable, "Ticking block entity"); + CrashReportCategory crashreportcategory1 = crashreport2.makeCategory("Block entity being ticked"); + tileentity.addInfoToCrashReport(crashreportcategory1); + throw new ReportedException(crashreport2); + } + } + } + + if (tileentity.isInvalid()) + { + iterator.remove(); + this.loadedTileEntityList.remove(tileentity); + + if (this.isBlockLoaded(tileentity.getPos())) + { + this.getChunkFromBlockCoords(tileentity.getPos()).removeTileEntity(tileentity.getPos()); + } + } + } + + this.processingLoadedTiles = false; + + if (!this.tileEntitiesToBeRemoved.isEmpty()) + { + this.tickableTileEntities.removeAll(this.tileEntitiesToBeRemoved); + this.loadedTileEntityList.removeAll(this.tileEntitiesToBeRemoved); + this.tileEntitiesToBeRemoved.clear(); + } + + this.theProfiler.endStartSection("pendingBlockEntities"); + + if (!this.addedTileEntityList.isEmpty()) + { + for (int j1 = 0; j1 < this.addedTileEntityList.size(); ++j1) + { + TileEntity tileentity1 = (TileEntity)this.addedTileEntityList.get(j1); + + if (!tileentity1.isInvalid()) + { + if (!this.loadedTileEntityList.contains(tileentity1)) + { + this.addTileEntity(tileentity1); + } + + if (this.isBlockLoaded(tileentity1.getPos())) + { + this.getChunkFromBlockCoords(tileentity1.getPos()).addTileEntity(tileentity1.getPos(), tileentity1); + } + + this.markBlockForUpdate(tileentity1.getPos()); + } + } + + this.addedTileEntityList.clear(); + } + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + public boolean addTileEntity(TileEntity tile) + { + boolean flag = this.loadedTileEntityList.add(tile); + + if (flag && tile instanceof ITickable) + { + this.tickableTileEntities.add(tile); + } + + return flag; + } + + public void addTileEntities(Collection tileEntityCollection) + { + if (this.processingLoadedTiles) + { + this.addedTileEntityList.addAll(tileEntityCollection); + } + else + { + for (TileEntity tileentity : tileEntityCollection) + { + this.loadedTileEntityList.add(tileentity); + + if (tileentity instanceof ITickable) + { + this.tickableTileEntities.add(tileentity); + } + } + } + } + + public void updateEntity(Entity ent) + { + this.updateEntityWithOptionalForce(ent, true); + } + + public void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate) + { + int i = MathHelper.floor_double(entityIn.posX); + int j = MathHelper.floor_double(entityIn.posZ); + int k = 32; + + if (!forceUpdate || this.isAreaLoaded(i - k, 0, j - k, i + k, 0, j + k, true)) + { + entityIn.lastTickPosX = entityIn.posX; + entityIn.lastTickPosY = entityIn.posY; + entityIn.lastTickPosZ = entityIn.posZ; + entityIn.prevRotationYaw = entityIn.rotationYaw; + entityIn.prevRotationPitch = entityIn.rotationPitch; + + if (forceUpdate && entityIn.addedToChunk) + { + ++entityIn.ticksExisted; + + if (entityIn.ridingEntity != null) + { + entityIn.updateRidden(); + } + else + { + entityIn.onUpdate(); + } + } + + this.theProfiler.startSection("chunkCheck"); + + if (Double.isNaN(entityIn.posX) || Double.isInfinite(entityIn.posX)) + { + entityIn.posX = entityIn.lastTickPosX; + } + + if (Double.isNaN(entityIn.posY) || Double.isInfinite(entityIn.posY)) + { + entityIn.posY = entityIn.lastTickPosY; + } + + if (Double.isNaN(entityIn.posZ) || Double.isInfinite(entityIn.posZ)) + { + entityIn.posZ = entityIn.lastTickPosZ; + } + + if (Double.isNaN((double)entityIn.rotationPitch) || Double.isInfinite((double)entityIn.rotationPitch)) + { + entityIn.rotationPitch = entityIn.prevRotationPitch; + } + + if (Double.isNaN((double)entityIn.rotationYaw) || Double.isInfinite((double)entityIn.rotationYaw)) + { + entityIn.rotationYaw = entityIn.prevRotationYaw; + } + + int l = MathHelper.floor_double(entityIn.posX / 16.0D); + int i1 = MathHelper.floor_double(entityIn.posY / 16.0D); + int j1 = MathHelper.floor_double(entityIn.posZ / 16.0D); + + if (!entityIn.addedToChunk || entityIn.chunkCoordX != l || entityIn.chunkCoordY != i1 || entityIn.chunkCoordZ != j1) + { + if (entityIn.addedToChunk && this.isChunkLoaded(entityIn.chunkCoordX, entityIn.chunkCoordZ, true)) + { + this.getChunkFromChunkCoords(entityIn.chunkCoordX, entityIn.chunkCoordZ).removeEntityAtIndex(entityIn, entityIn.chunkCoordY); + } + + if (this.isChunkLoaded(l, j1, true)) + { + entityIn.addedToChunk = true; + this.getChunkFromChunkCoords(l, j1).addEntity(entityIn); + } + else + { + entityIn.addedToChunk = false; + } + } + + this.theProfiler.endSection(); + + if (forceUpdate && entityIn.addedToChunk && entityIn.riddenByEntity != null) + { + if (!entityIn.riddenByEntity.isDead && entityIn.riddenByEntity.ridingEntity == entityIn) + { + this.updateEntity(entityIn.riddenByEntity); + } + else + { + entityIn.riddenByEntity.ridingEntity = null; + entityIn.riddenByEntity = null; + } + } + } + } + + public boolean checkNoEntityCollision(AxisAlignedBB bb) + { + return this.checkNoEntityCollision(bb, (Entity)null); + } + + public boolean checkNoEntityCollision(AxisAlignedBB bb, Entity entityIn) + { + List list = this.getEntitiesWithinAABBExcludingEntity((Entity)null, bb); + + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (!entity.isDead && entity.preventEntitySpawning && entity != entityIn && (entityIn == null || entityIn.ridingEntity != entity && entityIn.riddenByEntity != entity)) + { + return false; + } + } + + return true; + } + + public boolean checkBlockCollision(AxisAlignedBB bb) + { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 <= j; ++k1) + { + for (int l1 = k; l1 <= l; ++l1) + { + for (int i2 = i1; i2 <= j1; ++i2) + { + Block block = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)).getBlock(); + + if (block.getMaterial() != Material.air) + { + return true; + } + } + } + } + + return false; + } + + public boolean isAnyLiquid(AxisAlignedBB bb) + { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 <= j; ++k1) + { + for (int l1 = k; l1 <= l; ++l1) + { + for (int i2 = i1; i2 <= j1; ++i2) + { + Block block = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)).getBlock(); + + if (block.getMaterial().isLiquid()) + { + return true; + } + } + } + } + + return false; + } + + public boolean isFlammableWithin(AxisAlignedBB bb) + { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + + if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + Block block = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)).getBlock(); + + if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) + { + return true; + } + } + } + } + } + + return false; + } + + public boolean handleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn) + { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + + if (!this.isAreaLoaded(i, k, i1, j, l, j1, true)) + { + return false; + } + else + { + boolean flag = false; + Vec3 vec3 = new Vec3(0.0D, 0.0D, 0.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + blockpos$mutableblockpos.set(k1, l1, i2); + IBlockState iblockstate = this.getBlockState(blockpos$mutableblockpos); + Block block = iblockstate.getBlock(); + + if (block.getMaterial() == materialIn) + { + double d0 = (double)((float)(l1 + 1) - BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue())); + + if ((double)l >= d0) + { + flag = true; + vec3 = block.modifyAcceleration(this, blockpos$mutableblockpos, entityIn, vec3); + } + } + } + } + } + + if (vec3.lengthVector() > 0.0D && entityIn.isPushedByWater()) + { + vec3 = vec3.normalize(); + double d1 = 0.014D; + entityIn.motionX += vec3.xCoord * d1; + entityIn.motionY += vec3.yCoord * d1; + entityIn.motionZ += vec3.zCoord * d1; + } + + return flag; + } + } + + public boolean isMaterialInBB(AxisAlignedBB bb, Material materialIn) + { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + if (this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)).getBlock().getMaterial() == materialIn) + { + return true; + } + } + } + } + + return false; + } + + public boolean isAABBInMaterial(AxisAlignedBB bb, Material materialIn) + { + int i = MathHelper.floor_double(bb.minX); + int j = MathHelper.floor_double(bb.maxX + 1.0D); + int k = MathHelper.floor_double(bb.minY); + int l = MathHelper.floor_double(bb.maxY + 1.0D); + int i1 = MathHelper.floor_double(bb.minZ); + int j1 = MathHelper.floor_double(bb.maxZ + 1.0D); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + IBlockState iblockstate = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)); + Block block = iblockstate.getBlock(); + + if (block.getMaterial() == materialIn) + { + int j2 = ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue(); + double d0 = (double)(l1 + 1); + + if (j2 < 8) + { + d0 = (double)(l1 + 1) - (double)j2 / 8.0D; + } + + if (d0 >= bb.minY) + { + return true; + } + } + } + } + } + + return false; + } + + public Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking) + { + return this.newExplosion(entityIn, x, y, z, strength, false, isSmoking); + } + + public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) + { + Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking); + explosion.doExplosionA(); + explosion.doExplosionB(true); + return explosion; + } + + public float getBlockDensity(Vec3 vec, AxisAlignedBB bb) + { + double d0 = 1.0D / ((bb.maxX - bb.minX) * 2.0D + 1.0D); + double d1 = 1.0D / ((bb.maxY - bb.minY) * 2.0D + 1.0D); + double d2 = 1.0D / ((bb.maxZ - bb.minZ) * 2.0D + 1.0D); + double d3 = (1.0D - Math.floor(1.0D / d0) * d0) / 2.0D; + double d4 = (1.0D - Math.floor(1.0D / d2) * d2) / 2.0D; + + if (d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) + { + int i = 0; + int j = 0; + + for (float f = 0.0F; f <= 1.0F; f = (float)((double)f + d0)) + { + for (float f1 = 0.0F; f1 <= 1.0F; f1 = (float)((double)f1 + d1)) + { + for (float f2 = 0.0F; f2 <= 1.0F; f2 = (float)((double)f2 + d2)) + { + double d5 = bb.minX + (bb.maxX - bb.minX) * (double)f; + double d6 = bb.minY + (bb.maxY - bb.minY) * (double)f1; + double d7 = bb.minZ + (bb.maxZ - bb.minZ) * (double)f2; + + if (this.rayTraceBlocks(new Vec3(d5 + d3, d6, d7 + d4), vec) == null) + { + ++i; + } + + ++j; + } + } + } + + return (float)i / (float)j; + } + else + { + return 0.0F; + } + } + + public boolean extinguishFire(EntityPlayer player, BlockPos pos, EnumFacing side) + { + pos = pos.offset(side); + + if (this.getBlockState(pos).getBlock() == Blocks.fire) + { + this.playAuxSFXAtEntity(player, 1004, pos, 0); + this.setBlockToAir(pos); + return true; + } + else + { + return false; + } + } + + public String getDebugLoadedEntities() + { + return "All: " + this.loadedEntityList.size(); + } + + public String getProviderName() + { + return this.chunkProvider.makeString(); + } + + public TileEntity getTileEntity(BlockPos pos) + { + if (!this.isValid(pos)) + { + return null; + } + else + { + TileEntity tileentity = null; + + if (this.processingLoadedTiles) + { + for (int i = 0; i < this.addedTileEntityList.size(); ++i) + { + TileEntity tileentity1 = (TileEntity)this.addedTileEntityList.get(i); + + if (!tileentity1.isInvalid() && tileentity1.getPos().equals(pos)) + { + tileentity = tileentity1; + break; + } + } + } + + if (tileentity == null) + { + tileentity = this.getChunkFromBlockCoords(pos).getTileEntity(pos, Chunk.EnumCreateEntityType.IMMEDIATE); + } + + if (tileentity == null) + { + for (int j = 0; j < this.addedTileEntityList.size(); ++j) + { + TileEntity tileentity2 = (TileEntity)this.addedTileEntityList.get(j); + + if (!tileentity2.isInvalid() && tileentity2.getPos().equals(pos)) + { + tileentity = tileentity2; + break; + } + } + } + + return tileentity; + } + } + + public void setTileEntity(BlockPos pos, TileEntity tileEntityIn) + { + if (tileEntityIn != null && !tileEntityIn.isInvalid()) + { + if (this.processingLoadedTiles) + { + tileEntityIn.setPos(pos); + Iterator iterator = this.addedTileEntityList.iterator(); + + while (iterator.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator.next(); + + if (tileentity.getPos().equals(pos)) + { + tileentity.invalidate(); + iterator.remove(); + } + } + + this.addedTileEntityList.add(tileEntityIn); + } + else + { + this.addTileEntity(tileEntityIn); + this.getChunkFromBlockCoords(pos).addTileEntity(pos, tileEntityIn); + } + } + } + + public void removeTileEntity(BlockPos pos) + { + TileEntity tileentity = this.getTileEntity(pos); + + if (tileentity != null && this.processingLoadedTiles) + { + tileentity.invalidate(); + this.addedTileEntityList.remove(tileentity); + } + else + { + if (tileentity != null) + { + this.addedTileEntityList.remove(tileentity); + this.loadedTileEntityList.remove(tileentity); + this.tickableTileEntities.remove(tileentity); + } + + this.getChunkFromBlockCoords(pos).removeTileEntity(pos); + } + } + + public void markTileEntityForRemoval(TileEntity tileEntityIn) + { + this.tileEntitiesToBeRemoved.add(tileEntityIn); + } + + public boolean isBlockFullCube(BlockPos pos) + { + IBlockState iblockstate = this.getBlockState(pos); + AxisAlignedBB axisalignedbb = iblockstate.getBlock().getCollisionBoundingBox(this, pos, iblockstate); + return axisalignedbb != null && axisalignedbb.getAverageEdgeLength() >= 1.0D; + } + + public static boolean doesBlockHaveSolidTopSurface(IBlockAccess blockAccess, BlockPos pos) + { + IBlockState iblockstate = blockAccess.getBlockState(pos); + Block block = iblockstate.getBlock(); + return block.getMaterial().isOpaque() && block.isFullCube() ? true : (block instanceof BlockStairs ? iblockstate.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP : (block instanceof BlockSlab ? iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue() == 7 : false)))); + } + + public boolean isBlockNormalCube(BlockPos pos, boolean _default) + { + if (!this.isValid(pos)) + { + return _default; + } + else + { + Chunk chunk = this.chunkProvider.provideChunk(pos); + + if (chunk.isEmpty()) + { + return _default; + } + else + { + Block block = this.getBlockState(pos).getBlock(); + return block.getMaterial().isOpaque() && block.isFullCube(); + } + } + } + + public void calculateInitialSkylight() + { + int i = this.calculateSkylightSubtracted(1.0F); + + if (i != this.skylightSubtracted) + { + this.skylightSubtracted = i; + } + } + + public void setAllowedSpawnTypes(boolean hostile, boolean peaceful) + { + this.spawnHostileMobs = hostile; + this.spawnPeacefulMobs = peaceful; + } + + public void tick() + { + this.updateWeather(); + } + + protected void calculateInitialWeather() + { + if (this.worldInfo.isRaining()) + { + this.rainingStrength = 1.0F; + + if (this.worldInfo.isThundering()) + { + this.thunderingStrength = 1.0F; + } + } + } + + protected void updateWeather() + { + if (!this.provider.getHasNoSky()) + { + if (!this.isRemote) + { + int i = this.worldInfo.getCleanWeatherTime(); + + if (i > 0) + { + --i; + this.worldInfo.setCleanWeatherTime(i); + this.worldInfo.setThunderTime(this.worldInfo.isThundering() ? 1 : 2); + this.worldInfo.setRainTime(this.worldInfo.isRaining() ? 1 : 2); + } + + int j = this.worldInfo.getThunderTime(); + + if (j <= 0) + { + if (this.worldInfo.isThundering()) + { + this.worldInfo.setThunderTime(this.rand.nextInt(12000) + 3600); + } + else + { + this.worldInfo.setThunderTime(this.rand.nextInt(168000) + 12000); + } + } + else + { + --j; + this.worldInfo.setThunderTime(j); + + if (j <= 0) + { + this.worldInfo.setThundering(!this.worldInfo.isThundering()); + } + } + + this.prevThunderingStrength = this.thunderingStrength; + + if (this.worldInfo.isThundering()) + { + this.thunderingStrength = (float)((double)this.thunderingStrength + 0.01D); + } + else + { + this.thunderingStrength = (float)((double)this.thunderingStrength - 0.01D); + } + + this.thunderingStrength = MathHelper.clamp_float(this.thunderingStrength, 0.0F, 1.0F); + int k = this.worldInfo.getRainTime(); + + if (k <= 0) + { + if (this.worldInfo.isRaining()) + { + this.worldInfo.setRainTime(this.rand.nextInt(12000) + 12000); + } + else + { + this.worldInfo.setRainTime(this.rand.nextInt(168000) + 12000); + } + } + else + { + --k; + this.worldInfo.setRainTime(k); + + if (k <= 0) + { + this.worldInfo.setRaining(!this.worldInfo.isRaining()); + } + } + + this.prevRainingStrength = this.rainingStrength; + + if (this.worldInfo.isRaining()) + { + this.rainingStrength = (float)((double)this.rainingStrength + 0.01D); + } + else + { + this.rainingStrength = (float)((double)this.rainingStrength - 0.01D); + } + + this.rainingStrength = MathHelper.clamp_float(this.rainingStrength, 0.0F, 1.0F); + } + } + } + + protected void setActivePlayerChunksAndCheckLight() + { + this.activeChunkSet.clear(); + this.theProfiler.startSection("buildList"); + + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)this.playerEntities.get(i); + int j = MathHelper.floor_double(entityplayer.posX / 16.0D); + int k = MathHelper.floor_double(entityplayer.posZ / 16.0D); + int l = this.getRenderDistanceChunks(); + + for (int i1 = -l; i1 <= l; ++i1) + { + for (int j1 = -l; j1 <= l; ++j1) + { + this.activeChunkSet.add(new ChunkCoordIntPair(i1 + j, j1 + k)); + } + } + } + + this.theProfiler.endSection(); + + if (this.ambientTickCountdown > 0) + { + --this.ambientTickCountdown; + } + + this.theProfiler.startSection("playerCheckLight"); + + if (!this.playerEntities.isEmpty()) + { + int k1 = this.rand.nextInt(this.playerEntities.size()); + EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(k1); + int l1 = MathHelper.floor_double(entityplayer1.posX) + this.rand.nextInt(11) - 5; + int i2 = MathHelper.floor_double(entityplayer1.posY) + this.rand.nextInt(11) - 5; + int j2 = MathHelper.floor_double(entityplayer1.posZ) + this.rand.nextInt(11) - 5; + this.checkLight(new BlockPos(l1, i2, j2)); + } + + this.theProfiler.endSection(); + } + + protected abstract int getRenderDistanceChunks(); + + protected void playMoodSoundAndCheckLight(int p_147467_1_, int p_147467_2_, Chunk chunkIn) + { + this.theProfiler.endStartSection("moodSound"); + + if (this.ambientTickCountdown == 0 && !this.isRemote) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int i = this.updateLCG >> 2; + int j = i & 15; + int k = i >> 8 & 15; + int l = i >> 16 & 255; + BlockPos blockpos = new BlockPos(j, l, k); + Block block = chunkIn.getBlock(blockpos); + j = j + p_147467_1_; + k = k + p_147467_2_; + + if (block.getMaterial() == Material.air && this.getLight(blockpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, blockpos) <= 0) + { + EntityPlayer entityplayer = this.getClosestPlayer((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, 8.0D); + + if (entityplayer != null && entityplayer.getDistanceSq((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D) > 4.0D) + { + this.playSoundEffect((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.rand.nextFloat() * 0.2F); + this.ambientTickCountdown = this.rand.nextInt(12000) + 6000; + } + } + } + + this.theProfiler.endStartSection("checkLight"); + chunkIn.enqueueRelightChecks(); + } + + protected void updateBlocks() + { + this.setActivePlayerChunksAndCheckLight(); + } + + public void forceBlockUpdateTick(Block blockType, BlockPos pos, Random random) + { + this.scheduledUpdatesAreImmediate = true; + blockType.updateTick(this, pos, this.getBlockState(pos), random); + this.scheduledUpdatesAreImmediate = false; + } + + public boolean canBlockFreezeWater(BlockPos pos) + { + return this.canBlockFreeze(pos, false); + } + + public boolean canBlockFreezeNoWater(BlockPos pos) + { + return this.canBlockFreeze(pos, true); + } + + public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj) + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); + float f = biomegenbase.getFloatTemperature(pos); + + if (f > 0.15F) + { + return false; + } + else + { + if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10) + { + IBlockState iblockstate = this.getBlockState(pos); + Block block = iblockstate.getBlock(); + + if ((block == Blocks.water || block == Blocks.flowing_water) && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0) + { + if (!noWaterAdj) + { + return true; + } + + boolean flag = this.isWater(pos.west()) && this.isWater(pos.east()) && this.isWater(pos.north()) && this.isWater(pos.south()); + + if (!flag) + { + return true; + } + } + } + + return false; + } + } + + private boolean isWater(BlockPos pos) + { + return this.getBlockState(pos).getBlock().getMaterial() == Material.water; + } + + public boolean canSnowAt(BlockPos pos, boolean checkLight) + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); + float f = biomegenbase.getFloatTemperature(pos); + + if (f > 0.15F) + { + return false; + } + else if (!checkLight) + { + return true; + } + else + { + if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10) + { + Block block = this.getBlockState(pos).getBlock(); + + if (block.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, pos)) + { + return true; + } + } + + return false; + } + } + + public boolean checkLight(BlockPos pos) + { + boolean flag = false; + + if (!this.provider.getHasNoSky()) + { + flag |= this.checkLightFor(EnumSkyBlock.SKY, pos); + } + + flag = flag | this.checkLightFor(EnumSkyBlock.BLOCK, pos); + return flag; + } + + private int getRawLight(BlockPos pos, EnumSkyBlock lightType) + { + if (lightType == EnumSkyBlock.SKY && this.canSeeSky(pos)) + { + return 15; + } + else + { + Block block = this.getBlockState(pos).getBlock(); + int i = lightType == EnumSkyBlock.SKY ? 0 : block.getLightValue(); + int j = block.getLightOpacity(); + + if (j >= 15 && block.getLightValue() > 0) + { + j = 1; + } + + if (j < 1) + { + j = 1; + } + + if (j >= 15) + { + return 0; + } + else if (i >= 14) + { + return i; + } + else + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + BlockPos blockpos = pos.offset(enumfacing); + int k = this.getLightFor(lightType, blockpos) - j; + + if (k > i) + { + i = k; + } + + if (i >= 14) + { + return i; + } + } + + return i; + } + } + } + + public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) + { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().enableFpsBoost.getValue() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().fullBright.getValue()) { + return true; + } + if (!this.isAreaLoaded(pos, 17, false)) + { + return false; + } + else + { + int i = 0; + int j = 0; + this.theProfiler.startSection("getBrightness"); + int k = this.getLightFor(lightType, pos); + int l = this.getRawLight(pos, lightType); + int i1 = pos.getX(); + int j1 = pos.getY(); + int k1 = pos.getZ(); + + if (l > k) + { + this.lightUpdateBlockList[j++] = 133152; + } + else if (l < k) + { + this.lightUpdateBlockList[j++] = 133152 | k << 18; + + while (i < j) + { + int l1 = this.lightUpdateBlockList[i++]; + int i2 = (l1 & 63) - 32 + i1; + int j2 = (l1 >> 6 & 63) - 32 + j1; + int k2 = (l1 >> 12 & 63) - 32 + k1; + int l2 = l1 >> 18 & 15; + BlockPos blockpos = new BlockPos(i2, j2, k2); + int i3 = this.getLightFor(lightType, blockpos); + + if (i3 == l2) + { + this.setLightFor(lightType, blockpos, 0); + + if (l2 > 0) + { + int j3 = MathHelper.abs_int(i2 - i1); + int k3 = MathHelper.abs_int(j2 - j1); + int l3 = MathHelper.abs_int(k2 - k1); + + if (j3 + k3 + l3 < 17) + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (EnumFacing enumfacing : EnumFacing.values()) + { + int i4 = i2 + enumfacing.getFrontOffsetX(); + int j4 = j2 + enumfacing.getFrontOffsetY(); + int k4 = k2 + enumfacing.getFrontOffsetZ(); + blockpos$mutableblockpos.set(i4, j4, k4); + int l4 = Math.max(1, this.getBlockState(blockpos$mutableblockpos).getBlock().getLightOpacity()); + i3 = this.getLightFor(lightType, blockpos$mutableblockpos); + + if (i3 == l2 - l4 && j < this.lightUpdateBlockList.length) + { + this.lightUpdateBlockList[j++] = i4 - i1 + 32 | j4 - j1 + 32 << 6 | k4 - k1 + 32 << 12 | l2 - l4 << 18; + } + } + } + } + } + } + + i = 0; + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("checkedPosition < toCheckCount"); + + while (i < j) + { + int i5 = this.lightUpdateBlockList[i++]; + int j5 = (i5 & 63) - 32 + i1; + int k5 = (i5 >> 6 & 63) - 32 + j1; + int l5 = (i5 >> 12 & 63) - 32 + k1; + BlockPos blockpos1 = new BlockPos(j5, k5, l5); + int i6 = this.getLightFor(lightType, blockpos1); + int j6 = this.getRawLight(blockpos1, lightType); + + if (j6 != i6) + { + this.setLightFor(lightType, blockpos1, j6); + + if (j6 > i6) + { + int k6 = Math.abs(j5 - i1); + int l6 = Math.abs(k5 - j1); + int i7 = Math.abs(l5 - k1); + boolean flag = j < this.lightUpdateBlockList.length - 6; + + if (k6 + l6 + i7 < 17 && flag) + { + if (this.getLightFor(lightType, blockpos1.west()) < j6) + { + this.lightUpdateBlockList[j++] = j5 - 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.east()) < j6) + { + this.lightUpdateBlockList[j++] = j5 + 1 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.down()) < j6) + { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.up()) < j6) + { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 + 1 - j1 + 32 << 6) + (l5 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.north()) < j6) + { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 - 1 - k1 + 32 << 12); + } + + if (this.getLightFor(lightType, blockpos1.south()) < j6) + { + this.lightUpdateBlockList[j++] = j5 - i1 + 32 + (k5 - j1 + 32 << 6) + (l5 + 1 - k1 + 32 << 12); + } + } + } + } + } + + this.theProfiler.endSection(); + return true; + } + } + + public boolean tickUpdates(boolean p_72955_1_) + { + return false; + } + + public List getPendingBlockUpdates(Chunk chunkIn, boolean p_72920_2_) + { + return null; + } + + public List func_175712_a(StructureBoundingBox structureBB, boolean p_175712_2_) + { + return null; + } + + public List getEntitiesWithinAABBExcludingEntity(Entity entityIn, AxisAlignedBB bb) + { + return this.getEntitiesInAABBexcluding(entityIn, bb, EntitySelectors.NOT_SPECTATING); + } + + public List getEntitiesInAABBexcluding(Entity entityIn, AxisAlignedBB boundingBox, Predicate predicate) + { + List list = Lists.newArrayList(); + int i = MathHelper.floor_double((boundingBox.minX - 2.0D) / 16.0D); + int j = MathHelper.floor_double((boundingBox.maxX + 2.0D) / 16.0D); + int k = MathHelper.floor_double((boundingBox.minZ - 2.0D) / 16.0D); + int l = MathHelper.floor_double((boundingBox.maxZ + 2.0D) / 16.0D); + + for (int i1 = i; i1 <= j; ++i1) + { + for (int j1 = k; j1 <= l; ++j1) + { + if (this.isChunkLoaded(i1, j1, true)) + { + this.getChunkFromChunkCoords(i1, j1).getEntitiesWithinAABBForEntity(entityIn, boundingBox, list, predicate); + } + } + } + + return list; + } + + public List getEntities(Class entityType, Predicate filter) + { + List list = Lists.newArrayList(); + + for (Entity entity : this.loadedEntityList) + { + if (entityType.isAssignableFrom(entity.getClass()) && filter.apply((T)entity)) + { + list.add((T)entity); + } + } + + return list; + } + + public List getPlayers(Class playerType, Predicate filter) + { + List list = Lists.newArrayList(); + + for (Entity entity : this.playerEntities) + { + if (playerType.isAssignableFrom(entity.getClass()) && filter.apply((T)entity)) + { + list.add((T)entity); + } + } + + return list; + } + + public List getEntitiesWithinAABB(Class classEntity, AxisAlignedBB bb) + { + return this.getEntitiesWithinAABB(classEntity, bb, EntitySelectors.NOT_SPECTATING); + } + + public List getEntitiesWithinAABB(Class clazz, AxisAlignedBB aabb, Predicate filter) + { + int i = MathHelper.floor_double((aabb.minX - 2.0D) / 16.0D); + int j = MathHelper.floor_double((aabb.maxX + 2.0D) / 16.0D); + int k = MathHelper.floor_double((aabb.minZ - 2.0D) / 16.0D); + int l = MathHelper.floor_double((aabb.maxZ + 2.0D) / 16.0D); + List list = Lists.newArrayList(); + + for (int i1 = i; i1 <= j; ++i1) + { + for (int j1 = k; j1 <= l; ++j1) + { + if (this.isChunkLoaded(i1, j1, true)) + { + this.getChunkFromChunkCoords(i1, j1).getEntitiesOfTypeWithinAAAB(clazz, aabb, list, filter); + } + } + } + + return list; + } + + public T findNearestEntityWithinAABB(Class entityType, AxisAlignedBB aabb, T closestTo) + { + List list = this.getEntitiesWithinAABB(entityType, aabb); + T t = null; + double d0 = Double.MAX_VALUE; + + for (int i = 0; i < list.size(); ++i) + { + T t1 = list.get(i); + + if (t1 != closestTo && EntitySelectors.NOT_SPECTATING.apply(t1)) + { + double d1 = closestTo.getDistanceSqToEntity(t1); + + if (d1 <= d0) + { + t = t1; + d0 = d1; + } + } + } + + return t; + } + + public Entity getEntityByID(int id) + { + return (Entity)this.entitiesById.lookup(id); + } + + public List getLoadedEntityList() + { + return this.loadedEntityList; + } + + public void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity) + { + if (this.isBlockLoaded(pos)) + { + this.getChunkFromBlockCoords(pos).setChunkModified(); + } + } + + public int countEntities(Class entityType) + { + int i = 0; + + for (Entity entity : this.loadedEntityList) + { + if ((!(entity instanceof EntityLiving) || !((EntityLiving)entity).isNoDespawnRequired()) && entityType.isAssignableFrom(entity.getClass())) + { + ++i; + } + } + + return i; + } + + public void loadEntities(Collection entityCollection) + { + this.loadedEntityList.addAll(entityCollection); + + for (Entity entity : entityCollection) + { + this.onEntityAdded(entity); + } + } + + public void unloadEntities(Collection entityCollection) + { + this.unloadedEntityList.addAll(entityCollection); + } + + public boolean canBlockBePlaced(Block blockIn, BlockPos pos, boolean p_175716_3_, EnumFacing side, Entity entityIn, ItemStack itemStackIn) + { + Block block = this.getBlockState(pos).getBlock(); + AxisAlignedBB axisalignedbb = p_175716_3_ ? null : blockIn.getCollisionBoundingBox(this, pos, blockIn.getDefaultState()); + return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, entityIn) ? false : (block.getMaterial() == Material.circuits && blockIn == Blocks.anvil ? true : block.getMaterial().isReplaceable() && blockIn.canReplace(this, pos, side, itemStackIn)); + } + + public int getSeaLevel() + { + return this.seaLevel; + } + + public void setSeaLevel(int p_181544_1_) + { + this.seaLevel = p_181544_1_; + } + + public int getStrongPower(BlockPos pos, EnumFacing direction) + { + IBlockState iblockstate = this.getBlockState(pos); + return iblockstate.getBlock().getStrongPower(this, pos, iblockstate, direction); + } + + public WorldType getWorldType() + { + return this.worldInfo.getTerrainType(); + } + + public int getStrongPower(BlockPos pos) + { + int i = 0; + i = Math.max(i, this.getStrongPower(pos.down(), EnumFacing.DOWN)); + + if (i >= 15) + { + return i; + } + else + { + i = Math.max(i, this.getStrongPower(pos.up(), EnumFacing.UP)); + + if (i >= 15) + { + return i; + } + else + { + i = Math.max(i, this.getStrongPower(pos.north(), EnumFacing.NORTH)); + + if (i >= 15) + { + return i; + } + else + { + i = Math.max(i, this.getStrongPower(pos.south(), EnumFacing.SOUTH)); + + if (i >= 15) + { + return i; + } + else + { + i = Math.max(i, this.getStrongPower(pos.west(), EnumFacing.WEST)); + + if (i >= 15) + { + return i; + } + else + { + i = Math.max(i, this.getStrongPower(pos.east(), EnumFacing.EAST)); + return i >= 15 ? i : i; + } + } + } + } + } + } + + public boolean isSidePowered(BlockPos pos, EnumFacing side) + { + return this.getRedstonePower(pos, side) > 0; + } + + public int getRedstonePower(BlockPos pos, EnumFacing facing) + { + IBlockState iblockstate = this.getBlockState(pos); + Block block = iblockstate.getBlock(); + return block.isNormalCube() ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing); + } + + public boolean isBlockPowered(BlockPos pos) + { + return this.getRedstonePower(pos.down(), EnumFacing.DOWN) > 0 ? true : (this.getRedstonePower(pos.up(), EnumFacing.UP) > 0 ? true : (this.getRedstonePower(pos.north(), EnumFacing.NORTH) > 0 ? true : (this.getRedstonePower(pos.south(), EnumFacing.SOUTH) > 0 ? true : (this.getRedstonePower(pos.west(), EnumFacing.WEST) > 0 ? true : this.getRedstonePower(pos.east(), EnumFacing.EAST) > 0)))); + } + + public int isBlockIndirectlyGettingPowered(BlockPos pos) + { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + int j = this.getRedstonePower(pos.offset(enumfacing), enumfacing); + + if (j >= 15) + { + return 15; + } + + if (j > i) + { + i = j; + } + } + + return i; + } + + public EntityPlayer getClosestPlayerToEntity(Entity entityIn, double distance) + { + return this.getClosestPlayer(entityIn.posX, entityIn.posY, entityIn.posZ, distance); + } + + public EntityPlayer getClosestPlayer(double x, double y, double z, double distance) + { + double d0 = -1.0D; + EntityPlayer entityplayer = null; + + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); + + if (EntitySelectors.NOT_SPECTATING.apply(entityplayer1)) + { + double d1 = entityplayer1.getDistanceSq(x, y, z); + + if ((distance < 0.0D || d1 < distance * distance) && (d0 == -1.0D || d1 < d0)) + { + d0 = d1; + entityplayer = entityplayer1; + } + } + } + + return entityplayer; + } + + public boolean isAnyPlayerWithinRangeAt(double x, double y, double z, double range) + { + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)this.playerEntities.get(i); + + if (EntitySelectors.NOT_SPECTATING.apply(entityplayer)) + { + double d0 = entityplayer.getDistanceSq(x, y, z); + + if (range < 0.0D || d0 < range * range) + { + return true; + } + } + } + + return false; + } + + public EntityPlayer getPlayerEntityByName(String name) + { + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)this.playerEntities.get(i); + + if (name.equals(entityplayer.getName())) + { + return entityplayer; + } + } + + return null; + } + + /** + * CheatBreaker + **/ + public EntityPlayer isPlayerTeamMate(String string) { + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer entityPlayer = this.playerEntities.get(i); + if (!entityPlayer.isEntityAlive() || !string.equals(entityPlayer.getGameProfile().getId().toString()) && !string.equals(entityPlayer.getGameProfile().getId().toString().replaceAll("-", ""))) continue; + return entityPlayer; + } + return null; + } + + public EntityPlayer getPlayerEntityByUUID(UUID uuid) + { + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)this.playerEntities.get(i); + + if (uuid.equals(entityplayer.getUniqueID())) + { + return entityplayer; + } + } + + return null; + } + + public void sendQuittingDisconnectingPacket() + { + } + + public void checkSessionLock() throws MinecraftException + { + this.saveHandler.checkSessionLock(); + } + + public void setTotalWorldTime(long worldTime) + { + this.worldInfo.setWorldTotalTime(worldTime); + } + + public long getSeed() + { + return this.worldInfo.getSeed(); + } + + public long getTotalWorldTime() + { + return this.worldInfo.getWorldTotalTime(); + } + + public long getWorldTime() + { + return this.worldInfo.getWorldTime(); + } + + public void setWorldTime(long time) + { + this.worldInfo.setWorldTime(time); + } + + public BlockPos getSpawnPoint() + { + BlockPos blockpos = new BlockPos(this.worldInfo.getSpawnX(), this.worldInfo.getSpawnY(), this.worldInfo.getSpawnZ()); + + if (!this.getWorldBorder().contains(blockpos)) + { + blockpos = this.getHeight(new BlockPos(this.getWorldBorder().getCenterX(), 0.0D, this.getWorldBorder().getCenterZ())); + } + + return blockpos; + } + + public void setSpawnPoint(BlockPos pos) + { + this.worldInfo.setSpawn(pos); + } + + public void joinEntityInSurroundings(Entity entityIn) + { + int i = MathHelper.floor_double(entityIn.posX / 16.0D); + int j = MathHelper.floor_double(entityIn.posZ / 16.0D); + int k = 2; + + for (int l = i - k; l <= i + k; ++l) + { + for (int i1 = j - k; i1 <= j + k; ++i1) + { + this.getChunkFromChunkCoords(l, i1); + } + } + + if (!this.loadedEntityList.contains(entityIn)) + { + this.loadedEntityList.add(entityIn); + } + } + + public boolean isBlockModifiable(EntityPlayer player, BlockPos pos) + { + return true; + } + + public void setEntityState(Entity entityIn, byte state) + { + } + + public IChunkProvider getChunkProvider() + { + return this.chunkProvider; + } + + public void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam) + { + blockIn.onBlockEventReceived(this, pos, this.getBlockState(pos), eventID, eventParam); + } + + public ISaveHandler getSaveHandler() + { + return this.saveHandler; + } + + public WorldInfo getWorldInfo() + { + return this.worldInfo; + } + + public GameRules getGameRules() + { + return this.worldInfo.getGameRulesInstance(); + } + + public void updateAllPlayersSleepingFlag() + { + } + + public float getThunderStrength(float delta) + { + return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * delta) * this.getRainStrength(delta); + } + + public void setThunderStrength(float strength) + { + this.prevThunderingStrength = strength; + this.thunderingStrength = strength; + } + + public float getRainStrength(float delta) + { + return this.prevRainingStrength + (this.rainingStrength - this.prevRainingStrength) * delta; + } + + public void setRainStrength(float strength) + { + this.prevRainingStrength = strength; + this.rainingStrength = strength; + } + + public boolean isThundering() + { + return (double)this.getThunderStrength(1.0F) > 0.9D; + } + + public boolean isRaining() + { + return (double)this.getRainStrength(1.0F) > 0.2D; + } + + public boolean isRainingAt(BlockPos strikePosition) + { + if (!this.isRaining()) + { + return false; + } + else if (!this.canSeeSky(strikePosition)) + { + return false; + } + else if (this.getPrecipitationHeight(strikePosition).getY() > strikePosition.getY()) + { + return false; + } + else + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(strikePosition); + return biomegenbase.getEnableSnow() ? false : (this.canSnowAt(strikePosition, false) ? false : biomegenbase.canRain()); + } + } + + public boolean isBlockinHighHumidity(BlockPos pos) + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); + return biomegenbase.isHighHumidity(); + } + + public MapStorage getMapStorage() + { + return this.mapStorage; + } + + public void setItemData(String dataID, WorldSavedData worldSavedDataIn) + { + this.mapStorage.setData(dataID, worldSavedDataIn); + } + + public WorldSavedData loadItemData(Class clazz, String dataID) + { + return this.mapStorage.loadData(clazz, dataID); + } + + public int getUniqueDataId(String key) + { + return this.mapStorage.getUniqueDataId(key); + } + + public void playBroadcastSound(int p_175669_1_, BlockPos pos, int p_175669_3_) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).broadcastSound(p_175669_1_, pos, p_175669_3_); + } + } + + public void playAuxSFX(int p_175718_1_, BlockPos pos, int p_175718_3_) + { + this.playAuxSFXAtEntity((EntityPlayer)null, p_175718_1_, pos, p_175718_3_); + } + + public void playAuxSFXAtEntity(EntityPlayer player, int sfxType, BlockPos pos, int p_180498_4_) + { + try + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playAuxSFX(player, sfxType, pos, p_180498_4_); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Playing level event"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Level event being played"); + crashreportcategory.addCrashSection("Block coordinates", CrashReportCategory.getCoordinateInfo(pos)); + crashreportcategory.addCrashSection("Event source", player); + crashreportcategory.addCrashSection("Event type", Integer.valueOf(sfxType)); + crashreportcategory.addCrashSection("Event data", Integer.valueOf(p_180498_4_)); + throw new ReportedException(crashreport); + } + } + + public int getHeight() + { + return 256; + } + + public int getActualHeight() + { + return this.provider.getHasNoSky() ? 128 : 256; + } + + public Random setRandomSeed(int p_72843_1_, int p_72843_2_, int p_72843_3_) + { + long i = (long)p_72843_1_ * 341873128712L + (long)p_72843_2_ * 132897987541L + this.getWorldInfo().getSeed() + (long)p_72843_3_; + this.rand.setSeed(i); + return this.rand; + } + + public BlockPos getStrongholdPos(String name, BlockPos pos) + { + return this.getChunkProvider().getStrongholdGen(this, name, pos); + } + + public boolean extendedLevelsInChunkCache() + { + return false; + } + + public double getHorizon() + { + return this.worldInfo.getTerrainType() == WorldType.FLAT ? 0.0D : 63.0D; + } + + public CrashReportCategory addWorldInfoToCrashReport(CrashReport report) + { + CrashReportCategory crashreportcategory = report.makeCategoryDepth("Affected level", 1); + crashreportcategory.addCrashSection("Level name", this.worldInfo == null ? "????" : this.worldInfo.getWorldName()); + crashreportcategory.addCrashSectionCallable("All players", new Callable() + { + public String call() + { + return World.this.playerEntities.size() + " total; " + World.this.playerEntities.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Chunk stats", new Callable() + { + public String call() + { + return World.this.chunkProvider.makeString(); + } + }); + + try + { + this.worldInfo.addToCrashReport(crashreportcategory); + } + catch (Throwable throwable) + { + crashreportcategory.addCrashSectionThrowable("Level Data Unobtainable", throwable); + } + + return crashreportcategory; + } + + public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + IWorldAccess iworldaccess = (IWorldAccess)this.worldAccesses.get(i); + iworldaccess.sendBlockBreakProgress(breakerId, pos, progress); + } + } + + public Calendar getCurrentDate() + { + if (this.getTotalWorldTime() % 600L == 0L) + { + this.theCalendar.setTimeInMillis(MinecraftServer.getCurrentTimeMillis()); + } + + return this.theCalendar; + } + + public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund) + { + } + + public Scoreboard getScoreboard() + { + return this.worldScoreboard; + } + + public void updateComparatorOutputLevel(BlockPos pos, Block blockIn) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + BlockPos blockpos = pos.offset(enumfacing); + + if (this.isBlockLoaded(blockpos)) + { + IBlockState iblockstate = this.getBlockState(blockpos); + + if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) + { + iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); + } + else if (iblockstate.getBlock().isNormalCube()) + { + blockpos = blockpos.offset(enumfacing); + iblockstate = this.getBlockState(blockpos); + + if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) + { + iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); + } + } + } + } + } + + public DifficultyInstance getDifficultyForLocation(BlockPos pos) + { + long i = 0L; + float f = 0.0F; + + if (this.isBlockLoaded(pos)) + { + f = this.getCurrentMoonPhaseFactor(); + i = this.getChunkFromBlockCoords(pos).getInhabitedTime(); + } + + return new DifficultyInstance(this.getDifficulty(), this.getWorldTime(), i, f); + } + + public EnumDifficulty getDifficulty() + { + return this.getWorldInfo().getDifficulty(); + } + + public int getSkylightSubtracted() + { + return this.skylightSubtracted; + } + + public void setSkylightSubtracted(int newSkylightSubtracted) + { + this.skylightSubtracted = newSkylightSubtracted; + } + + public int getLastLightningBolt() + { + return this.lastLightningBolt; + } + + public void setLastLightningBolt(int lastLightningBoltIn) + { + this.lastLightningBolt = lastLightningBoltIn; + } + + public boolean isFindingSpawnPoint() + { + return this.findingSpawnPoint; + } + + public VillageCollection getVillageCollection() + { + return this.villageCollectionObj; + } + + public WorldBorder getWorldBorder() + { + return this.worldBorder; + } + + public boolean isSpawnChunk(int x, int z) + { + BlockPos blockpos = this.getSpawnPoint(); + int i = x * 16 + 8 - blockpos.getX(); + int j = z * 16 + 8 - blockpos.getZ(); + int k = 128; + return i >= -k && i <= k && j >= -k && j <= k; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldManager.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldManager.java new file mode 100644 index 0000000..1f1cb01 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldManager.java @@ -0,0 +1,92 @@ +package net.minecraft.world; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; + +public class WorldManager implements IWorldAccess +{ + private MinecraftServer mcServer; + private WorldServer theWorldServer; + + public WorldManager(MinecraftServer mcServerIn, WorldServer worldServerIn) + { + this.mcServer = mcServerIn; + this.theWorldServer = worldServerIn; + } + + public void spawnParticle(int particleID, boolean ignoreRange, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int... parameters) + { + } + + public void onEntityAdded(Entity entityIn) + { + this.theWorldServer.getEntityTracker().trackEntity(entityIn); + } + + public void onEntityRemoved(Entity entityIn) + { + this.theWorldServer.getEntityTracker().untrackEntity(entityIn); + this.theWorldServer.getScoreboard().func_181140_a(entityIn); + } + + public void playSound(String soundName, double x, double y, double z, float volume, float pitch) + { + this.mcServer.getConfigurationManager().sendToAllNear(x, y, z, volume > 1.0F ? (double)(16.0F * volume) : 16.0D, this.theWorldServer.provider.getDimensionId(), new S29PacketSoundEffect(soundName, x, y, z, volume, pitch)); + } + + public void playSoundToNearExcept(EntityPlayer except, String soundName, double x, double y, double z, float volume, float pitch) + { + this.mcServer.getConfigurationManager().sendToAllNearExcept(except, x, y, z, volume > 1.0F ? (double)(16.0F * volume) : 16.0D, this.theWorldServer.provider.getDimensionId(), new S29PacketSoundEffect(soundName, x, y, z, volume, pitch)); + } + + public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) + { + } + + public void markBlockForUpdate(BlockPos pos) + { + this.theWorldServer.getPlayerManager().markBlockForUpdate(pos); + } + + public void notifyLightSet(BlockPos pos) + { + } + + public void playRecord(String recordName, BlockPos blockPosIn) + { + } + + public void playAuxSFX(EntityPlayer player, int sfxType, BlockPos blockPosIn, int data) + { + this.mcServer.getConfigurationManager().sendToAllNearExcept(player, (double)blockPosIn.getX(), (double)blockPosIn.getY(), (double)blockPosIn.getZ(), 64.0D, this.theWorldServer.provider.getDimensionId(), new S28PacketEffect(sfxType, blockPosIn, data, false)); + } + + public void broadcastSound(int soundID, BlockPos pos, int data) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S28PacketEffect(soundID, pos, data, true)); + } + + public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) + { + for (EntityPlayerMP entityplayermp : this.mcServer.getConfigurationManager().getPlayerList()) + { + if (entityplayermp != null && entityplayermp.worldObj == this.theWorldServer && entityplayermp.getEntityId() != breakerId) + { + double d0 = (double)pos.getX() - entityplayermp.posX; + double d1 = (double)pos.getY() - entityplayermp.posY; + double d2 = (double)pos.getZ() - entityplayermp.posZ; + + if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) + { + entityplayermp.playerNetServerHandler.sendPacket(new S25PacketBlockBreakAnim(breakerId, pos, progress)); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldProvider.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProvider.java new file mode 100644 index 0000000..3c07a99 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProvider.java @@ -0,0 +1,218 @@ +package net.minecraft.world; + +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderDebug; +import net.minecraft.world.gen.ChunkProviderFlat; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.FlatGeneratorInfo; + +public abstract class WorldProvider +{ + public static final float[] moonPhaseFactors = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F}; + protected World worldObj; + private WorldType terrainType; + private String generatorSettings; + protected WorldChunkManager worldChunkMgr; + protected boolean isHellWorld; + protected boolean hasNoSky; + protected final float[] lightBrightnessTable = new float[16]; + protected int dimensionId; + private final float[] colorsSunriseSunset = new float[4]; + + public final void registerWorld(World worldIn) + { + this.worldObj = worldIn; + this.terrainType = worldIn.getWorldInfo().getTerrainType(); + this.generatorSettings = worldIn.getWorldInfo().getGeneratorOptions(); + this.registerWorldChunkManager(); + this.generateLightBrightnessTable(); + } + + protected void generateLightBrightnessTable() + { + float f = 0.0F; + + for (int i = 0; i <= 15; ++i) + { + float f1 = 1.0F - (float)i / 15.0F; + this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + } + } + + protected void registerWorldChunkManager() + { + WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType(); + + if (worldtype == WorldType.FLAT) + { + FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.getBiomeFromBiomeList(flatgeneratorinfo.getBiome(), BiomeGenBase.field_180279_ad), 0.5F); + } + else if (worldtype == WorldType.DEBUG_WORLD) + { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.plains, 0.0F); + } + else + { + this.worldChunkMgr = new WorldChunkManager(this.worldObj); + } + } + + public IChunkProvider createChunkGenerator() + { + return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) : (this.terrainType == WorldType.CUSTOMIZED ? new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings)))); + } + + public boolean canCoordinateBeSpawn(int x, int z) + { + return this.worldObj.getGroundAboveSeaLevel(new BlockPos(x, 0, z)) == Blocks.grass; + } + + public float calculateCelestialAngle(long worldTime, float partialTicks) + { + int i = (int)(worldTime % 24000L); + float f = ((float)i + partialTicks) / 24000.0F - 0.25F; + + if (f < 0.0F) + { + ++f; + } + + if (f > 1.0F) + { + --f; + } + + f = 1.0F - (float)((Math.cos((double)f * Math.PI) + 1.0D) / 2.0D); + f = f + (f - f) / 3.0F; + return f; + } + + public int getMoonPhase(long worldTime) + { + return (int)(worldTime / 24000L % 8L + 8L) % 8; + } + + public boolean isSurfaceWorld() + { + return true; + } + + public float[] calcSunriseSunsetColors(float celestialAngle, float partialTicks) + { + float f = 0.4F; + float f1 = MathHelper.cos(celestialAngle * (float)Math.PI * 2.0F) - 0.0F; + float f2 = -0.0F; + + if (f1 >= f2 - f && f1 <= f2 + f) + { + float f3 = (f1 - f2) / f * 0.5F + 0.5F; + float f4 = 1.0F - (1.0F - MathHelper.sin(f3 * (float)Math.PI)) * 0.99F; + f4 = f4 * f4; + this.colorsSunriseSunset[0] = f3 * 0.3F + 0.7F; + this.colorsSunriseSunset[1] = f3 * f3 * 0.7F + 0.2F; + this.colorsSunriseSunset[2] = f3 * f3 * 0.0F + 0.2F; + this.colorsSunriseSunset[3] = f4; + return this.colorsSunriseSunset; + } + else + { + return null; + } + } + + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) + { + float f = MathHelper.cos(p_76562_1_ * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + float f1 = 0.7529412F; + float f2 = 0.84705883F; + float f3 = 1.0F; + f1 = f1 * (f * 0.94F + 0.06F); + f2 = f2 * (f * 0.94F + 0.06F); + f3 = f3 * (f * 0.91F + 0.09F); + return new Vec3((double)f1, (double)f2, (double)f3); + } + + public boolean canRespawnHere() + { + return true; + } + + public static WorldProvider getProviderForDimension(int dimension) + { + return (WorldProvider)(dimension == -1 ? new WorldProviderHell() : (dimension == 0 ? new WorldProviderSurface() : (dimension == 1 ? new WorldProviderEnd() : null))); + } + + public float getCloudHeight() + { + return 128.0F; + } + + public boolean isSkyColored() + { + return true; + } + + public BlockPos getSpawnCoordinate() + { + return null; + } + + public int getAverageGroundLevel() + { + return this.terrainType == WorldType.FLAT ? 4 : this.worldObj.getSeaLevel() + 1; + } + + public double getVoidFogYFactor() + { + return this.terrainType == WorldType.FLAT ? 1.0D : 0.03125D; + } + + public boolean doesXZShowFog(int x, int z) + { + return false; + } + + public abstract String getDimensionName(); + + public abstract String getInternalNameSuffix(); + + public WorldChunkManager getWorldChunkManager() + { + return this.worldChunkMgr; + } + + public boolean doesWaterVaporize() + { + return this.isHellWorld; + } + + public boolean getHasNoSky() + { + return this.hasNoSky; + } + + public float[] getLightBrightnessTable() + { + return this.lightBrightnessTable; + } + + public int getDimensionId() + { + return this.dimensionId; + } + + public WorldBorder getWorldBorder() + { + return new WorldBorder(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderEnd.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderEnd.java new file mode 100644 index 0000000..1fdaa8e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderEnd.java @@ -0,0 +1,98 @@ +package net.minecraft.world; + +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderEnd; + +public class WorldProviderEnd extends WorldProvider +{ + public void registerWorldChunkManager() + { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F); + this.dimensionId = 1; + this.hasNoSky = true; + } + + public IChunkProvider createChunkGenerator() + { + return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); + } + + public float calculateCelestialAngle(long worldTime, float partialTicks) + { + return 0.0F; + } + + public float[] calcSunriseSunsetColors(float celestialAngle, float partialTicks) + { + return null; + } + + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) + { + int i = 10518688; + float f = MathHelper.cos(p_76562_1_ * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + float f1 = (float)(i >> 16 & 255) / 255.0F; + float f2 = (float)(i >> 8 & 255) / 255.0F; + float f3 = (float)(i & 255) / 255.0F; + f1 = f1 * (f * 0.0F + 0.15F); + f2 = f2 * (f * 0.0F + 0.15F); + f3 = f3 * (f * 0.0F + 0.15F); + return new Vec3((double)f1, (double)f2, (double)f3); + } + + public boolean isSkyColored() + { + return false; + } + + public boolean canRespawnHere() + { + return false; + } + + public boolean isSurfaceWorld() + { + return false; + } + + public float getCloudHeight() + { + return 8.0F; + } + + public boolean canCoordinateBeSpawn(int x, int z) + { + return this.worldObj.getGroundAboveSeaLevel(new BlockPos(x, 0, z)).getMaterial().blocksMovement(); + } + + public BlockPos getSpawnCoordinate() + { + return new BlockPos(100, 50, 0); + } + + public int getAverageGroundLevel() + { + return 50; + } + + public boolean doesXZShowFog(int x, int z) + { + return true; + } + + public String getDimensionName() + { + return "The End"; + } + + public String getInternalNameSuffix() + { + return "_end"; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderHell.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderHell.java new file mode 100644 index 0000000..5b46570 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderHell.java @@ -0,0 +1,90 @@ +package net.minecraft.world; + +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderHell; + +public class WorldProviderHell extends WorldProvider +{ + public void registerWorldChunkManager() + { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F); + this.isHellWorld = true; + this.hasNoSky = true; + this.dimensionId = -1; + } + + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) + { + return new Vec3(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D); + } + + protected void generateLightBrightnessTable() + { + float f = 0.1F; + + for (int i = 0; i <= 15; ++i) + { + float f1 = 1.0F - (float)i / 15.0F; + this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + } + } + + public IChunkProvider createChunkGenerator() + { + return new ChunkProviderHell(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed()); + } + + public boolean isSurfaceWorld() + { + return false; + } + + public boolean canCoordinateBeSpawn(int x, int z) + { + return false; + } + + public float calculateCelestialAngle(long worldTime, float partialTicks) + { + return 0.5F; + } + + public boolean canRespawnHere() + { + return false; + } + + public boolean doesXZShowFog(int x, int z) + { + return true; + } + + public String getDimensionName() + { + return "Nether"; + } + + public String getInternalNameSuffix() + { + return "_nether"; + } + + public WorldBorder getWorldBorder() + { + return new WorldBorder() + { + public double getCenterX() + { + return super.getCenterX() / 8.0D; + } + public double getCenterZ() + { + return super.getCenterZ() / 8.0D; + } + }; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderSurface.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderSurface.java new file mode 100644 index 0000000..fc3a311 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldProviderSurface.java @@ -0,0 +1,14 @@ +package net.minecraft.world; + +public class WorldProviderSurface extends WorldProvider +{ + public String getDimensionName() + { + return "Overworld"; + } + + public String getInternalNameSuffix() + { + return ""; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldSavedData.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldSavedData.java new file mode 100644 index 0000000..9d04a35 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldSavedData.java @@ -0,0 +1,33 @@ +package net.minecraft.world; + +import net.minecraft.nbt.NBTTagCompound; + +public abstract class WorldSavedData +{ + public final String mapName; + private boolean dirty; + + public WorldSavedData(String name) + { + this.mapName = name; + } + + public abstract void readFromNBT(NBTTagCompound nbt); + + public abstract void writeToNBT(NBTTagCompound nbt); + + public void markDirty() + { + this.setDirty(true); + } + + public void setDirty(boolean isDirty) + { + this.dirty = isDirty; + } + + public boolean isDirty() + { + return this.dirty; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldServer.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldServer.java new file mode 100644 index 0000000..8e76833 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldServer.java @@ -0,0 +1,1110 @@ +package net.minecraft.world; + +import com.google.common.base.Predicate; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.util.concurrent.ListenableFuture; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.TreeSet; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEventData; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityTracker; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.INpc; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityWaterMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.ScoreboardSaveData; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.PlayerManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.IThreadListener; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.village.VillageCollection; +import net.minecraft.village.VillageSiege; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraft.world.gen.feature.WorldGeneratorBonusChest; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.MapStorage; +import net.minecraft.world.storage.WorldInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class WorldServer extends World implements IThreadListener +{ + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer mcServer; + private final EntityTracker theEntityTracker; + private final PlayerManager thePlayerManager; + private final Set pendingTickListEntriesHashSet = Sets.newHashSet(); + private final TreeSet pendingTickListEntriesTreeSet = new TreeSet(); + private final Map entitiesByUuid = Maps.newHashMap(); + public ChunkProviderServer theChunkProviderServer; + public boolean disableLevelSaving; + private boolean allPlayersSleeping; + private int updateEntityTick; + private final Teleporter worldTeleporter; + private final SpawnerAnimals mobSpawner = new SpawnerAnimals(); + protected final VillageSiege villageSiege = new VillageSiege(this); + private WorldServer.ServerBlockEventList[] blockEventQueue = new WorldServer.ServerBlockEventList[] {new WorldServer.ServerBlockEventList(), new WorldServer.ServerBlockEventList()}; + private int blockEventCacheIndex; + private static final List bonusChestContent = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.stick, 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.planks), 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log), 0, 1, 3, 10), new WeightedRandomChestContent(Items.stone_axe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_axe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.stone_pickaxe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.apple, 0, 2, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 2, 3, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log2), 0, 1, 3, 10)}); + private List pendingTickListEntriesThisTick = Lists.newArrayList(); + + public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn) + { + super(saveHandlerIn, info, WorldProvider.getProviderForDimension(dimensionId), profilerIn, false); + this.mcServer = server; + this.theEntityTracker = new EntityTracker(this); + this.thePlayerManager = new PlayerManager(this); + this.provider.registerWorld(this); + this.chunkProvider = this.createChunkProvider(); + this.worldTeleporter = new Teleporter(this); + this.calculateInitialSkylight(); + this.calculateInitialWeather(); + this.getWorldBorder().setSize(server.getMaxWorldSize()); + } + + public World init() + { + this.mapStorage = new MapStorage(this.saveHandler); + String s = VillageCollection.fileNameForProvider(this.provider); + VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, s); + + if (villagecollection == null) + { + this.villageCollectionObj = new VillageCollection(this); + this.mapStorage.setData(s, this.villageCollectionObj); + } + else + { + this.villageCollectionObj = villagecollection; + this.villageCollectionObj.setWorldsForAll(this); + } + + this.worldScoreboard = new ServerScoreboard(this.mcServer); + ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData)this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard"); + + if (scoreboardsavedata == null) + { + scoreboardsavedata = new ScoreboardSaveData(); + this.mapStorage.setData("scoreboard", scoreboardsavedata); + } + + scoreboardsavedata.setScoreboard(this.worldScoreboard); + ((ServerScoreboard)this.worldScoreboard).func_96547_a(scoreboardsavedata); + this.getWorldBorder().setCenter(this.worldInfo.getBorderCenterX(), this.worldInfo.getBorderCenterZ()); + this.getWorldBorder().setDamageAmount(this.worldInfo.getBorderDamagePerBlock()); + this.getWorldBorder().setDamageBuffer(this.worldInfo.getBorderSafeZone()); + this.getWorldBorder().setWarningDistance(this.worldInfo.getBorderWarningDistance()); + this.getWorldBorder().setWarningTime(this.worldInfo.getBorderWarningTime()); + + if (this.worldInfo.getBorderLerpTime() > 0L) + { + this.getWorldBorder().setTransition(this.worldInfo.getBorderSize(), this.worldInfo.getBorderLerpTarget(), this.worldInfo.getBorderLerpTime()); + } + else + { + this.getWorldBorder().setTransition(this.worldInfo.getBorderSize()); + } + + return this; + } + + public void tick() + { + super.tick(); + + if (this.getWorldInfo().isHardcoreModeEnabled() && this.getDifficulty() != EnumDifficulty.HARD) + { + this.getWorldInfo().setDifficulty(EnumDifficulty.HARD); + } + + this.provider.getWorldChunkManager().cleanupCache(); + + if (this.areAllPlayersAsleep()) + { + if (this.getGameRules().getBoolean("doDaylightCycle")) + { + long i = this.worldInfo.getWorldTime() + 24000L; + this.worldInfo.setWorldTime(i - i % 24000L); + } + + this.wakeAllPlayers(); + } + + this.theProfiler.startSection("mobSpawner"); + + if (this.getGameRules().getBoolean("doMobSpawning") && this.worldInfo.getTerrainType() != WorldType.DEBUG_WORLD) + { + this.mobSpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getWorldTotalTime() % 400L == 0L); + } + + this.theProfiler.endStartSection("chunkSource"); + this.chunkProvider.unloadQueuedChunks(); + int j = this.calculateSkylightSubtracted(1.0F); + + if (j != this.getSkylightSubtracted()) + { + this.setSkylightSubtracted(j); + } + + this.worldInfo.setWorldTotalTime(this.worldInfo.getWorldTotalTime() + 1L); + + if (this.getGameRules().getBoolean("doDaylightCycle")) + { + this.worldInfo.setWorldTime(this.worldInfo.getWorldTime() + 1L); + } + + this.theProfiler.endStartSection("tickPending"); + this.tickUpdates(false); + this.theProfiler.endStartSection("tickBlocks"); + this.updateBlocks(); + this.theProfiler.endStartSection("chunkMap"); + this.thePlayerManager.updatePlayerInstances(); + this.theProfiler.endStartSection("village"); + this.villageCollectionObj.tick(); + this.villageSiege.tick(); + this.theProfiler.endStartSection("portalForcer"); + this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime()); + this.theProfiler.endSection(); + this.sendQueuedBlockEvents(); + } + + public BiomeGenBase.SpawnListEntry getSpawnListEntryForTypeAt(EnumCreatureType creatureType, BlockPos pos) + { + List list = this.getChunkProvider().getPossibleCreatures(creatureType, pos); + return list != null && !list.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(this.rand, list) : null; + } + + public boolean canCreatureTypeSpawnHere(EnumCreatureType creatureType, BiomeGenBase.SpawnListEntry spawnListEntry, BlockPos pos) + { + List list = this.getChunkProvider().getPossibleCreatures(creatureType, pos); + return list != null && !list.isEmpty() ? list.contains(spawnListEntry) : false; + } + + public void updateAllPlayersSleepingFlag() + { + this.allPlayersSleeping = false; + + if (!this.playerEntities.isEmpty()) + { + int i = 0; + int j = 0; + + for (EntityPlayer entityplayer : this.playerEntities) + { + if (entityplayer.isSpectator()) + { + ++i; + } + else if (entityplayer.isPlayerSleeping()) + { + ++j; + } + } + + this.allPlayersSleeping = j > 0 && j >= this.playerEntities.size() - i; + } + } + + protected void wakeAllPlayers() + { + this.allPlayersSleeping = false; + + for (EntityPlayer entityplayer : this.playerEntities) + { + if (entityplayer.isPlayerSleeping()) + { + entityplayer.wakeUpPlayer(false, false, true); + } + } + + this.resetRainAndThunder(); + } + + private void resetRainAndThunder() + { + this.worldInfo.setRainTime(0); + this.worldInfo.setRaining(false); + this.worldInfo.setThunderTime(0); + this.worldInfo.setThundering(false); + } + + public boolean areAllPlayersAsleep() + { + if (this.allPlayersSleeping && !this.isRemote) + { + for (EntityPlayer entityplayer : this.playerEntities) + { + if (entityplayer.isSpectator() || !entityplayer.isPlayerFullyAsleep()) + { + return false; + } + } + + return true; + } + else + { + return false; + } + } + + public void setInitialSpawnLocation() + { + if (this.worldInfo.getSpawnY() <= 0) + { + this.worldInfo.setSpawnY(this.getSeaLevel() + 1); + } + + int i = this.worldInfo.getSpawnX(); + int j = this.worldInfo.getSpawnZ(); + int k = 0; + + while (this.getGroundAboveSeaLevel(new BlockPos(i, 0, j)).getMaterial() == Material.air) + { + i += this.rand.nextInt(8) - this.rand.nextInt(8); + j += this.rand.nextInt(8) - this.rand.nextInt(8); + ++k; + + if (k == 10000) + { + break; + } + } + + this.worldInfo.setSpawnX(i); + this.worldInfo.setSpawnZ(j); + } + + protected void updateBlocks() + { + super.updateBlocks(); + + if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) + { + for (ChunkCoordIntPair chunkcoordintpair1 : this.activeChunkSet) + { + this.getChunkFromChunkCoords(chunkcoordintpair1.chunkXPos, chunkcoordintpair1.chunkZPos).func_150804_b(false); + } + } + else + { + int i = 0; + int j = 0; + + for (ChunkCoordIntPair chunkcoordintpair : this.activeChunkSet) + { + int k = chunkcoordintpair.chunkXPos * 16; + int l = chunkcoordintpair.chunkZPos * 16; + this.theProfiler.startSection("getChunk"); + Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); + this.playMoodSoundAndCheckLight(k, l, chunk); + this.theProfiler.endStartSection("tickChunk"); + chunk.func_150804_b(false); + this.theProfiler.endStartSection("thunder"); + + if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int i1 = this.updateLCG >> 2; + BlockPos blockpos = this.adjustPosToNearbyEntity(new BlockPos(k + (i1 & 15), 0, l + (i1 >> 8 & 15))); + + if (this.isRainingAt(blockpos)) + { + this.addWeatherEffect(new EntityLightningBolt(this, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ())); + } + } + + this.theProfiler.endStartSection("iceandsnow"); + + if (this.rand.nextInt(16) == 0) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int k2 = this.updateLCG >> 2; + BlockPos blockpos2 = this.getPrecipitationHeight(new BlockPos(k + (k2 & 15), 0, l + (k2 >> 8 & 15))); + BlockPos blockpos1 = blockpos2.down(); + + if (this.canBlockFreezeNoWater(blockpos1)) + { + this.setBlockState(blockpos1, Blocks.ice.getDefaultState()); + } + + if (this.isRaining() && this.canSnowAt(blockpos2, true)) + { + this.setBlockState(blockpos2, Blocks.snow_layer.getDefaultState()); + } + + if (this.isRaining() && this.getBiomeGenForCoords(blockpos1).canRain()) + { + this.getBlockState(blockpos1).getBlock().fillWithRain(this, blockpos1); + } + } + + this.theProfiler.endStartSection("tickBlocks"); + int l2 = this.getGameRules().getInt("randomTickSpeed"); + + if (l2 > 0) + { + for (ExtendedBlockStorage extendedblockstorage : chunk.getBlockStorageArray()) + { + if (extendedblockstorage != null && extendedblockstorage.getNeedsRandomTick()) + { + for (int j1 = 0; j1 < l2; ++j1) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int k1 = this.updateLCG >> 2; + int l1 = k1 & 15; + int i2 = k1 >> 8 & 15; + int j2 = k1 >> 16 & 15; + ++j; + IBlockState iblockstate = extendedblockstorage.get(l1, j2, i2); + Block block = iblockstate.getBlock(); + + if (block.getTickRandomly()) + { + ++i; + block.randomTick(this, new BlockPos(l1 + k, j2 + extendedblockstorage.getYLocation(), i2 + l), iblockstate, this.rand); + } + } + } + } + } + + this.theProfiler.endSection(); + } + } + } + + protected BlockPos adjustPosToNearbyEntity(BlockPos pos) + { + BlockPos blockpos = this.getPrecipitationHeight(pos); + AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockpos, new BlockPos(blockpos.getX(), this.getHeight(), blockpos.getZ()))).expand(3.0D, 3.0D, 3.0D); + List list = this.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb, new Predicate() + { + public boolean apply(EntityLivingBase p_apply_1_) + { + return p_apply_1_ != null && p_apply_1_.isEntityAlive() && WorldServer.this.canSeeSky(p_apply_1_.getPosition()); + } + }); + return !list.isEmpty() ? ((EntityLivingBase)list.get(this.rand.nextInt(list.size()))).getPosition() : blockpos; + } + + public boolean isBlockTickPending(BlockPos pos, Block blockType) + { + NextTickListEntry nextticklistentry = new NextTickListEntry(pos, blockType); + return this.pendingTickListEntriesThisTick.contains(nextticklistentry); + } + + public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) + { + this.updateBlockTick(pos, blockIn, delay, 0); + } + + public void updateBlockTick(BlockPos pos, Block blockIn, int delay, int priority) + { + NextTickListEntry nextticklistentry = new NextTickListEntry(pos, blockIn); + int i = 0; + + if (this.scheduledUpdatesAreImmediate && blockIn.getMaterial() != Material.air) + { + if (blockIn.requiresUpdates()) + { + i = 8; + + if (this.isAreaLoaded(nextticklistentry.position.add(-i, -i, -i), nextticklistentry.position.add(i, i, i))) + { + IBlockState iblockstate = this.getBlockState(nextticklistentry.position); + + if (iblockstate.getBlock().getMaterial() != Material.air && iblockstate.getBlock() == nextticklistentry.getBlock()) + { + iblockstate.getBlock().updateTick(this, nextticklistentry.position, iblockstate, this.rand); + } + } + + return; + } + + delay = 1; + } + + if (this.isAreaLoaded(pos.add(-i, -i, -i), pos.add(i, i, i))) + { + if (blockIn.getMaterial() != Material.air) + { + nextticklistentry.setScheduledTime((long)delay + this.worldInfo.getWorldTotalTime()); + nextticklistentry.setPriority(priority); + } + + if (!this.pendingTickListEntriesHashSet.contains(nextticklistentry)) + { + this.pendingTickListEntriesHashSet.add(nextticklistentry); + this.pendingTickListEntriesTreeSet.add(nextticklistentry); + } + } + } + + public void scheduleBlockUpdate(BlockPos pos, Block blockIn, int delay, int priority) + { + NextTickListEntry nextticklistentry = new NextTickListEntry(pos, blockIn); + nextticklistentry.setPriority(priority); + + if (blockIn.getMaterial() != Material.air) + { + nextticklistentry.setScheduledTime((long)delay + this.worldInfo.getWorldTotalTime()); + } + + if (!this.pendingTickListEntriesHashSet.contains(nextticklistentry)) + { + this.pendingTickListEntriesHashSet.add(nextticklistentry); + this.pendingTickListEntriesTreeSet.add(nextticklistentry); + } + } + + public void updateEntities() + { + if (this.playerEntities.isEmpty()) + { + if (this.updateEntityTick++ >= 1200) + { + return; + } + } + else + { + this.resetUpdateEntityTick(); + } + + super.updateEntities(); + } + + public void resetUpdateEntityTick() + { + this.updateEntityTick = 0; + } + + public boolean tickUpdates(boolean p_72955_1_) + { + if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) + { + return false; + } + else + { + int i = this.pendingTickListEntriesTreeSet.size(); + + if (i != this.pendingTickListEntriesHashSet.size()) + { + throw new IllegalStateException("TickNextTick list out of synch"); + } + else + { + if (i > 1000) + { + i = 1000; + } + + this.theProfiler.startSection("cleaning"); + + for (int j = 0; j < i; ++j) + { + NextTickListEntry nextticklistentry = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first(); + + if (!p_72955_1_ && nextticklistentry.scheduledTime > this.worldInfo.getWorldTotalTime()) + { + break; + } + + this.pendingTickListEntriesTreeSet.remove(nextticklistentry); + this.pendingTickListEntriesHashSet.remove(nextticklistentry); + this.pendingTickListEntriesThisTick.add(nextticklistentry); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("ticking"); + Iterator iterator = this.pendingTickListEntriesThisTick.iterator(); + + while (iterator.hasNext()) + { + NextTickListEntry nextticklistentry1 = (NextTickListEntry)iterator.next(); + iterator.remove(); + int k = 0; + + if (this.isAreaLoaded(nextticklistentry1.position.add(-k, -k, -k), nextticklistentry1.position.add(k, k, k))) + { + IBlockState iblockstate = this.getBlockState(nextticklistentry1.position); + + if (iblockstate.getBlock().getMaterial() != Material.air && Block.isEqualTo(iblockstate.getBlock(), nextticklistentry1.getBlock())) + { + try + { + iblockstate.getBlock().updateTick(this, nextticklistentry1.position, iblockstate, this.rand); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while ticking a block"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being ticked"); + CrashReportCategory.addBlockInfo(crashreportcategory, nextticklistentry1.position, iblockstate); + throw new ReportedException(crashreport); + } + } + } + else + { + this.scheduleUpdate(nextticklistentry1.position, nextticklistentry1.getBlock(), 0); + } + } + + this.theProfiler.endSection(); + this.pendingTickListEntriesThisTick.clear(); + return !this.pendingTickListEntriesTreeSet.isEmpty(); + } + } + } + + public List getPendingBlockUpdates(Chunk chunkIn, boolean p_72920_2_) + { + ChunkCoordIntPair chunkcoordintpair = chunkIn.getChunkCoordIntPair(); + int i = (chunkcoordintpair.chunkXPos << 4) - 2; + int j = i + 16 + 2; + int k = (chunkcoordintpair.chunkZPos << 4) - 2; + int l = k + 16 + 2; + return this.func_175712_a(new StructureBoundingBox(i, 0, k, j, 256, l), p_72920_2_); + } + + public List func_175712_a(StructureBoundingBox structureBB, boolean p_175712_2_) + { + List list = null; + + for (int i = 0; i < 2; ++i) + { + Iterator iterator; + + if (i == 0) + { + iterator = this.pendingTickListEntriesTreeSet.iterator(); + } + else + { + iterator = this.pendingTickListEntriesThisTick.iterator(); + } + + while (iterator.hasNext()) + { + NextTickListEntry nextticklistentry = (NextTickListEntry)iterator.next(); + BlockPos blockpos = nextticklistentry.position; + + if (blockpos.getX() >= structureBB.minX && blockpos.getX() < structureBB.maxX && blockpos.getZ() >= structureBB.minZ && blockpos.getZ() < structureBB.maxZ) + { + if (p_175712_2_) + { + this.pendingTickListEntriesHashSet.remove(nextticklistentry); + iterator.remove(); + } + + if (list == null) + { + list = Lists.newArrayList(); + } + + list.add(nextticklistentry); + } + } + } + + return list; + } + + public void updateEntityWithOptionalForce(Entity entityIn, boolean forceUpdate) + { + if (!this.canSpawnAnimals() && (entityIn instanceof EntityAnimal || entityIn instanceof EntityWaterMob)) + { + entityIn.setDead(); + } + + if (!this.canSpawnNPCs() && entityIn instanceof INpc) + { + entityIn.setDead(); + } + + super.updateEntityWithOptionalForce(entityIn, forceUpdate); + } + + private boolean canSpawnNPCs() + { + return this.mcServer.getCanSpawnNPCs(); + } + + private boolean canSpawnAnimals() + { + return this.mcServer.getCanSpawnAnimals(); + } + + protected IChunkProvider createChunkProvider() + { + IChunkLoader ichunkloader = this.saveHandler.getChunkLoader(this.provider); + this.theChunkProviderServer = new ChunkProviderServer(this, ichunkloader, this.provider.createChunkGenerator()); + return this.theChunkProviderServer; + } + + public List getTileEntitiesIn(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) + { + List list = Lists.newArrayList(); + + for (int i = 0; i < this.loadedTileEntityList.size(); ++i) + { + TileEntity tileentity = (TileEntity)this.loadedTileEntityList.get(i); + BlockPos blockpos = tileentity.getPos(); + + if (blockpos.getX() >= minX && blockpos.getY() >= minY && blockpos.getZ() >= minZ && blockpos.getX() < maxX && blockpos.getY() < maxY && blockpos.getZ() < maxZ) + { + list.add(tileentity); + } + } + + return list; + } + + public boolean isBlockModifiable(EntityPlayer player, BlockPos pos) + { + return !this.mcServer.isBlockProtected(this, pos, player) && this.getWorldBorder().contains(pos); + } + + public void initialize(WorldSettings settings) + { + if (!this.worldInfo.isInitialized()) + { + try + { + this.createSpawnPosition(settings); + + if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) + { + this.setDebugWorldSettings(); + } + + super.initialize(settings); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception initializing level"); + + try + { + this.addWorldInfoToCrashReport(crashreport); + } + catch (Throwable var5) + { + ; + } + + throw new ReportedException(crashreport); + } + + this.worldInfo.setServerInitialized(true); + } + } + + private void setDebugWorldSettings() + { + this.worldInfo.setMapFeaturesEnabled(false); + this.worldInfo.setAllowCommands(true); + this.worldInfo.setRaining(false); + this.worldInfo.setThundering(false); + this.worldInfo.setCleanWeatherTime(1000000000); + this.worldInfo.setWorldTime(6000L); + this.worldInfo.setGameType(WorldSettings.GameType.SPECTATOR); + this.worldInfo.setHardcore(false); + this.worldInfo.setDifficulty(EnumDifficulty.PEACEFUL); + this.worldInfo.setDifficultyLocked(true); + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "false"); + } + + private void createSpawnPosition(WorldSettings settings) + { + if (!this.provider.canRespawnHere()) + { + this.worldInfo.setSpawn(BlockPos.ORIGIN.up(this.provider.getAverageGroundLevel())); + } + else if (this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) + { + this.worldInfo.setSpawn(BlockPos.ORIGIN.up()); + } + else + { + this.findingSpawnPoint = true; + WorldChunkManager worldchunkmanager = this.provider.getWorldChunkManager(); + List list = worldchunkmanager.getBiomesToSpawnIn(); + Random random = new Random(this.getSeed()); + BlockPos blockpos = worldchunkmanager.findBiomePosition(0, 0, 256, list, random); + int i = 0; + int j = this.provider.getAverageGroundLevel(); + int k = 0; + + if (blockpos != null) + { + i = blockpos.getX(); + k = blockpos.getZ(); + } + else + { + logger.warn("Unable to find spawn biome"); + } + + int l = 0; + + while (!this.provider.canCoordinateBeSpawn(i, k)) + { + i += random.nextInt(64) - random.nextInt(64); + k += random.nextInt(64) - random.nextInt(64); + ++l; + + if (l == 1000) + { + break; + } + } + + this.worldInfo.setSpawn(new BlockPos(i, j, k)); + this.findingSpawnPoint = false; + + if (settings.isBonusChestEnabled()) + { + this.createBonusChest(); + } + } + } + + protected void createBonusChest() + { + WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10); + + for (int i = 0; i < 10; ++i) + { + int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6); + int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6); + BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up(); + + if (worldgeneratorbonuschest.generate(this, this.rand, blockpos)) + { + break; + } + } + } + + public BlockPos getSpawnCoordinate() + { + return this.provider.getSpawnCoordinate(); + } + + public void saveAllChunks(boolean p_73044_1_, IProgressUpdate progressCallback) throws MinecraftException + { + if (this.chunkProvider.canSave()) + { + if (progressCallback != null) + { + progressCallback.displaySavingString("Saving level"); + } + + this.saveLevel(); + + if (progressCallback != null) + { + progressCallback.displayLoadingString("Saving chunks"); + } + + this.chunkProvider.saveChunks(p_73044_1_, progressCallback); + + for (Chunk chunk : Lists.newArrayList(this.theChunkProviderServer.func_152380_a())) + { + if (chunk != null && !this.thePlayerManager.hasPlayerInstance(chunk.xPosition, chunk.zPosition)) + { + this.theChunkProviderServer.dropChunk(chunk.xPosition, chunk.zPosition); + } + } + } + } + + public void saveChunkData() + { + if (this.chunkProvider.canSave()) + { + this.chunkProvider.saveExtraData(); + } + } + + protected void saveLevel() throws MinecraftException + { + this.checkSessionLock(); + this.worldInfo.setBorderSize(this.getWorldBorder().getDiameter()); + this.worldInfo.getBorderCenterX(this.getWorldBorder().getCenterX()); + this.worldInfo.getBorderCenterZ(this.getWorldBorder().getCenterZ()); + this.worldInfo.setBorderSafeZone(this.getWorldBorder().getDamageBuffer()); + this.worldInfo.setBorderDamagePerBlock(this.getWorldBorder().getDamageAmount()); + this.worldInfo.setBorderWarningDistance(this.getWorldBorder().getWarningDistance()); + this.worldInfo.setBorderWarningTime(this.getWorldBorder().getWarningTime()); + this.worldInfo.setBorderLerpTarget(this.getWorldBorder().getTargetSize()); + this.worldInfo.setBorderLerpTime(this.getWorldBorder().getTimeUntilTarget()); + this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); + this.mapStorage.saveAllData(); + } + + protected void onEntityAdded(Entity entityIn) + { + super.onEntityAdded(entityIn); + this.entitiesById.addKey(entityIn.getEntityId(), entityIn); + this.entitiesByUuid.put(entityIn.getUniqueID(), entityIn); + Entity[] aentity = entityIn.getParts(); + + if (aentity != null) + { + for (int i = 0; i < aentity.length; ++i) + { + this.entitiesById.addKey(aentity[i].getEntityId(), aentity[i]); + } + } + } + + protected void onEntityRemoved(Entity entityIn) + { + super.onEntityRemoved(entityIn); + this.entitiesById.removeObject(entityIn.getEntityId()); + this.entitiesByUuid.remove(entityIn.getUniqueID()); + Entity[] aentity = entityIn.getParts(); + + if (aentity != null) + { + for (int i = 0; i < aentity.length; ++i) + { + this.entitiesById.removeObject(aentity[i].getEntityId()); + } + } + } + + public boolean addWeatherEffect(Entity entityIn) + { + if (super.addWeatherEffect(entityIn)) + { + this.mcServer.getConfigurationManager().sendToAllNear(entityIn.posX, entityIn.posY, entityIn.posZ, 512.0D, this.provider.getDimensionId(), new S2CPacketSpawnGlobalEntity(entityIn)); + return true; + } + else + { + return false; + } + } + + public void setEntityState(Entity entityIn, byte state) + { + this.getEntityTracker().func_151248_b(entityIn, new S19PacketEntityStatus(entityIn, state)); + } + + public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) + { + Explosion explosion = new Explosion(this, entityIn, x, y, z, strength, isFlaming, isSmoking); + explosion.doExplosionA(); + explosion.doExplosionB(false); + + if (!isSmoking) + { + explosion.clearAffectedBlockPositions(); + } + + for (EntityPlayer entityplayer : this.playerEntities) + { + if (entityplayer.getDistanceSq(x, y, z) < 4096.0D) + { + ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(x, y, z, strength, explosion.getAffectedBlockPositions(), (Vec3)explosion.getPlayerKnockbackMap().get(entityplayer))); + } + } + + return explosion; + } + + public void addBlockEvent(BlockPos pos, Block blockIn, int eventID, int eventParam) + { + BlockEventData blockeventdata = new BlockEventData(pos, blockIn, eventID, eventParam); + + for (BlockEventData blockeventdata1 : this.blockEventQueue[this.blockEventCacheIndex]) + { + if (blockeventdata1.equals(blockeventdata)) + { + return; + } + } + + this.blockEventQueue[this.blockEventCacheIndex].add(blockeventdata); + } + + private void sendQueuedBlockEvents() + { + while (!this.blockEventQueue[this.blockEventCacheIndex].isEmpty()) + { + int i = this.blockEventCacheIndex; + this.blockEventCacheIndex ^= 1; + + for (BlockEventData blockeventdata : this.blockEventQueue[i]) + { + if (this.fireBlockEvent(blockeventdata)) + { + this.mcServer.getConfigurationManager().sendToAllNear((double)blockeventdata.getPosition().getX(), (double)blockeventdata.getPosition().getY(), (double)blockeventdata.getPosition().getZ(), 64.0D, this.provider.getDimensionId(), new S24PacketBlockAction(blockeventdata.getPosition(), blockeventdata.getBlock(), blockeventdata.getEventID(), blockeventdata.getEventParameter())); + } + } + + this.blockEventQueue[i].clear(); + } + } + + private boolean fireBlockEvent(BlockEventData event) + { + IBlockState iblockstate = this.getBlockState(event.getPosition()); + return iblockstate.getBlock() == event.getBlock() ? iblockstate.getBlock().onBlockEventReceived(this, event.getPosition(), iblockstate, event.getEventID(), event.getEventParameter()) : false; + } + + public void flush() + { + this.saveHandler.flush(); + } + + protected void updateWeather() + { + boolean flag = this.isRaining(); + super.updateWeather(); + + if (this.prevRainingStrength != this.rainingStrength) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.getDimensionId()); + } + + if (this.prevThunderingStrength != this.thunderingStrength) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.getDimensionId()); + } + + if (flag != this.isRaining()) + { + if (flag) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(2, 0.0F)); + } + else + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(1, 0.0F)); + } + + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(7, this.rainingStrength)); + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(8, this.thunderingStrength)); + } + } + + protected int getRenderDistanceChunks() + { + return this.mcServer.getConfigurationManager().getViewDistance(); + } + + public MinecraftServer getMinecraftServer() + { + return this.mcServer; + } + + public EntityTracker getEntityTracker() + { + return this.theEntityTracker; + } + + public PlayerManager getPlayerManager() + { + return this.thePlayerManager; + } + + public Teleporter getDefaultTeleporter() + { + return this.worldTeleporter; + } + + public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... particleArguments) + { + this.spawnParticle(particleType, false, xCoord, yCoord, zCoord, numberOfParticles, xOffset, yOffset, zOffset, particleSpeed, particleArguments); + } + + public void spawnParticle(EnumParticleTypes particleType, boolean longDistance, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int... particleArguments) + { + Packet packet = new S2APacketParticles(particleType, longDistance, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset, (float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, particleArguments); + + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(i); + BlockPos blockpos = entityplayermp.getPosition(); + double d0 = blockpos.distanceSq(xCoord, yCoord, zCoord); + + if (d0 <= 256.0D || longDistance && d0 <= 65536.0D) + { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + } + + public Entity getEntityFromUuid(UUID uuid) + { + return (Entity)this.entitiesByUuid.get(uuid); + } + + public ListenableFuture addScheduledTask(Runnable runnableToSchedule) + { + return this.mcServer.addScheduledTask(runnableToSchedule); + } + + public boolean isCallingFromMinecraftThread() + { + return this.mcServer.isCallingFromMinecraftThread(); + } + + static class ServerBlockEventList extends ArrayList + { + private ServerBlockEventList() + { + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldServerMulti.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldServerMulti.java new file mode 100644 index 0000000..1962854 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldServerMulti.java @@ -0,0 +1,76 @@ +package net.minecraft.world; + +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.village.VillageCollection; +import net.minecraft.world.border.IBorderListener; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.storage.DerivedWorldInfo; +import net.minecraft.world.storage.ISaveHandler; + +public class WorldServerMulti extends WorldServer +{ + private WorldServer delegate; + + public WorldServerMulti(MinecraftServer server, ISaveHandler saveHandlerIn, int dimensionId, WorldServer delegate, Profiler profilerIn) + { + super(server, saveHandlerIn, new DerivedWorldInfo(delegate.getWorldInfo()), dimensionId, profilerIn); + this.delegate = delegate; + delegate.getWorldBorder().addListener(new IBorderListener() + { + public void onSizeChanged(WorldBorder border, double newSize) + { + WorldServerMulti.this.getWorldBorder().setTransition(newSize); + } + public void onTransitionStarted(WorldBorder border, double oldSize, double newSize, long time) + { + WorldServerMulti.this.getWorldBorder().setTransition(oldSize, newSize, time); + } + public void onCenterChanged(WorldBorder border, double x, double z) + { + WorldServerMulti.this.getWorldBorder().setCenter(x, z); + } + public void onWarningTimeChanged(WorldBorder border, int newTime) + { + WorldServerMulti.this.getWorldBorder().setWarningTime(newTime); + } + public void onWarningDistanceChanged(WorldBorder border, int newDistance) + { + WorldServerMulti.this.getWorldBorder().setWarningDistance(newDistance); + } + public void onDamageAmountChanged(WorldBorder border, double newAmount) + { + WorldServerMulti.this.getWorldBorder().setDamageAmount(newAmount); + } + public void onDamageBufferChanged(WorldBorder border, double newSize) + { + WorldServerMulti.this.getWorldBorder().setDamageBuffer(newSize); + } + }); + } + + protected void saveLevel() throws MinecraftException + { + } + + public World init() + { + this.mapStorage = this.delegate.getMapStorage(); + this.worldScoreboard = this.delegate.getScoreboard(); + String s = VillageCollection.fileNameForProvider(this.provider); + VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, s); + + if (villagecollection == null) + { + this.villageCollectionObj = new VillageCollection(this); + this.mapStorage.setData(s, this.villageCollectionObj); + } + else + { + this.villageCollectionObj = villagecollection; + this.villageCollectionObj.setWorldsForAll(this); + } + + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldSettings.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldSettings.java new file mode 100644 index 0000000..c40cdd4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldSettings.java @@ -0,0 +1,189 @@ +package net.minecraft.world; + +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.world.storage.WorldInfo; + +public final class WorldSettings +{ + private final long seed; + private final WorldSettings.GameType theGameType; + private final boolean mapFeaturesEnabled; + private final boolean hardcoreEnabled; + private final WorldType terrainType; + private boolean commandsAllowed; + private boolean bonusChestEnabled; + private String worldName; + + public WorldSettings(long seedIn, WorldSettings.GameType gameType, boolean enableMapFeatures, boolean hardcoreMode, WorldType worldTypeIn) + { + this.worldName = ""; + this.seed = seedIn; + this.theGameType = gameType; + this.mapFeaturesEnabled = enableMapFeatures; + this.hardcoreEnabled = hardcoreMode; + this.terrainType = worldTypeIn; + } + + public WorldSettings(WorldInfo info) + { + this(info.getSeed(), info.getGameType(), info.isMapFeaturesEnabled(), info.isHardcoreModeEnabled(), info.getTerrainType()); + } + + public WorldSettings enableBonusChest() + { + this.bonusChestEnabled = true; + return this; + } + + public WorldSettings enableCommands() + { + this.commandsAllowed = true; + return this; + } + + public WorldSettings setWorldName(String name) + { + this.worldName = name; + return this; + } + + public boolean isBonusChestEnabled() + { + return this.bonusChestEnabled; + } + + public long getSeed() + { + return this.seed; + } + + public WorldSettings.GameType getGameType() + { + return this.theGameType; + } + + public boolean getHardcoreEnabled() + { + return this.hardcoreEnabled; + } + + public boolean isMapFeaturesEnabled() + { + return this.mapFeaturesEnabled; + } + + public WorldType getTerrainType() + { + return this.terrainType; + } + + public boolean areCommandsAllowed() + { + return this.commandsAllowed; + } + + public static WorldSettings.GameType getGameTypeById(int id) + { + return WorldSettings.GameType.getByID(id); + } + + public String getWorldName() + { + return this.worldName; + } + + public static enum GameType + { + NOT_SET(-1, ""), + SURVIVAL(0, "survival"), + CREATIVE(1, "creative"), + ADVENTURE(2, "adventure"), + SPECTATOR(3, "spectator"); + + int id; + String name; + + private GameType(int typeId, String nameIn) + { + this.id = typeId; + this.name = nameIn; + } + + public int getID() + { + return this.id; + } + + public String getName() + { + return this.name; + } + + public void configurePlayerCapabilities(PlayerCapabilities capabilities) + { + if (this == CREATIVE) + { + capabilities.allowFlying = true; + capabilities.isCreativeMode = true; + capabilities.disableDamage = true; + } + else if (this == SPECTATOR) + { + capabilities.allowFlying = true; + capabilities.isCreativeMode = false; + capabilities.disableDamage = true; + capabilities.isFlying = true; + } + else + { + capabilities.allowFlying = false; + capabilities.isCreativeMode = false; + capabilities.disableDamage = false; + capabilities.isFlying = false; + } + + capabilities.allowEdit = !this.isAdventure(); + } + + public boolean isAdventure() + { + return this == ADVENTURE || this == SPECTATOR; + } + + public boolean isCreative() + { + return this == CREATIVE; + } + + public boolean isSurvivalOrAdventure() + { + return this == SURVIVAL || this == ADVENTURE; + } + + public static WorldSettings.GameType getByID(int idIn) + { + for (WorldSettings.GameType worldsettings$gametype : values()) + { + if (worldsettings$gametype.id == idIn) + { + return worldsettings$gametype; + } + } + + return SURVIVAL; + } + + public static WorldSettings.GameType getByName(String gamemodeName) + { + for (WorldSettings.GameType worldsettings$gametype : values()) + { + if (worldsettings$gametype.name.equals(gamemodeName)) + { + return worldsettings$gametype; + } + } + + return SURVIVAL; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/WorldType.java b/Client-1.8.9/src/main/java/net/minecraft/world/WorldType.java new file mode 100644 index 0000000..a22f06f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/WorldType.java @@ -0,0 +1,109 @@ +package net.minecraft.world; + +public class WorldType +{ + public static final WorldType[] worldTypes = new WorldType[16]; + public static final WorldType DEFAULT = (new WorldType(0, "default", 1)).setVersioned(); + public static final WorldType FLAT = new WorldType(1, "flat"); + public static final WorldType LARGE_BIOMES = new WorldType(2, "largeBiomes"); + public static final WorldType AMPLIFIED = (new WorldType(3, "amplified")).setNotificationData(); + public static final WorldType CUSTOMIZED = new WorldType(4, "customized"); + public static final WorldType DEBUG_WORLD = new WorldType(5, "debug_all_block_states"); + public static final WorldType DEFAULT_1_1 = (new WorldType(8, "default_1_1", 0)).setCanBeCreated(false); + private final int worldTypeId; + private final String worldType; + private final int generatorVersion; + private boolean canBeCreated; + private boolean isWorldTypeVersioned; + private boolean hasNotificationData; + + private WorldType(int id, String name) + { + this(id, name, 0); + } + + private WorldType(int id, String name, int version) + { + this.worldType = name; + this.generatorVersion = version; + this.canBeCreated = true; + this.worldTypeId = id; + worldTypes[id] = this; + } + + public String getWorldTypeName() + { + return this.worldType; + } + + public String getTranslateName() + { + return "generator." + this.worldType; + } + + public String getTranslatedInfo() + { + return this.getTranslateName() + ".info"; + } + + public int getGeneratorVersion() + { + return this.generatorVersion; + } + + public WorldType getWorldTypeForGeneratorVersion(int version) + { + return this == DEFAULT && version == 0 ? DEFAULT_1_1 : this; + } + + private WorldType setCanBeCreated(boolean enable) + { + this.canBeCreated = enable; + return this; + } + + public boolean getCanBeCreated() + { + return this.canBeCreated; + } + + private WorldType setVersioned() + { + this.isWorldTypeVersioned = true; + return this; + } + + public boolean isVersioned() + { + return this.isWorldTypeVersioned; + } + + public static WorldType parseWorldType(String type) + { + for (int i = 0; i < worldTypes.length; ++i) + { + if (worldTypes[i] != null && worldTypes[i].worldType.equalsIgnoreCase(type)) + { + return worldTypes[i]; + } + } + + return null; + } + + public int getWorldTypeID() + { + return this.worldTypeId; + } + + public boolean showWorldInfoNotice() + { + return this.hasNotificationData; + } + + private WorldType setNotificationData() + { + this.hasNotificationData = true; + return this; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeCache.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeCache.java new file mode 100644 index 0000000..b76f3a3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeCache.java @@ -0,0 +1,94 @@ +package net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.LongHashMap; + +public class BiomeCache +{ + private final WorldChunkManager chunkManager; + private long lastCleanupTime; + private LongHashMap cacheMap = new LongHashMap(); + private List cache = Lists.newArrayList(); + + public BiomeCache(WorldChunkManager chunkManagerIn) + { + this.chunkManager = chunkManagerIn; + } + + public BiomeCache.Block getBiomeCacheBlock(int x, int z) + { + x = x >> 4; + z = z >> 4; + long i = (long)x & 4294967295L | ((long)z & 4294967295L) << 32; + BiomeCache.Block biomecache$block = (BiomeCache.Block)this.cacheMap.getValueByKey(i); + + if (biomecache$block == null) + { + biomecache$block = new BiomeCache.Block(x, z); + this.cacheMap.add(i, biomecache$block); + this.cache.add(biomecache$block); + } + + biomecache$block.lastAccessTime = MinecraftServer.getCurrentTimeMillis(); + return biomecache$block; + } + + public BiomeGenBase func_180284_a(int x, int z, BiomeGenBase p_180284_3_) + { + BiomeGenBase biomegenbase = this.getBiomeCacheBlock(x, z).getBiomeGenAt(x, z); + return biomegenbase == null ? p_180284_3_ : biomegenbase; + } + + public void cleanupCache() + { + long i = MinecraftServer.getCurrentTimeMillis(); + long j = i - this.lastCleanupTime; + + if (j > 7500L || j < 0L) + { + this.lastCleanupTime = i; + + for (int k = 0; k < this.cache.size(); ++k) + { + BiomeCache.Block biomecache$block = (BiomeCache.Block)this.cache.get(k); + long l = i - biomecache$block.lastAccessTime; + + if (l > 30000L || l < 0L) + { + this.cache.remove(k--); + long i1 = (long)biomecache$block.xPosition & 4294967295L | ((long)biomecache$block.zPosition & 4294967295L) << 32; + this.cacheMap.remove(i1); + } + } + } + } + + public BiomeGenBase[] getCachedBiomes(int x, int z) + { + return this.getBiomeCacheBlock(x, z).biomes; + } + + public class Block + { + public float[] rainfallValues = new float[256]; + public BiomeGenBase[] biomes = new BiomeGenBase[256]; + public int xPosition; + public int zPosition; + public long lastAccessTime; + + public Block(int x, int z) + { + this.xPosition = x; + this.zPosition = z; + BiomeCache.this.chunkManager.getRainfall(this.rainfallValues, x << 4, z << 4, 16, 16); + BiomeCache.this.chunkManager.getBiomeGenAt(this.biomes, x << 4, z << 4, 16, 16, false); + } + + public BiomeGenBase getBiomeGenAt(int x, int z) + { + return this.biomes[x & 15 | (z & 15) << 4]; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeColorHelper.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeColorHelper.java new file mode 100644 index 0000000..6d8792d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeColorHelper.java @@ -0,0 +1,66 @@ +package net.minecraft.world.biome; + +import net.minecraft.util.BlockPos; +import net.minecraft.world.IBlockAccess; + +public class BiomeColorHelper +{ + private static final BiomeColorHelper.ColorResolver GRASS_COLOR = new BiomeColorHelper.ColorResolver() + { + public int getColorAtPos(BiomeGenBase biome, BlockPos blockPosition) + { + return biome.getGrassColorAtPos(blockPosition); + } + }; + private static final BiomeColorHelper.ColorResolver FOLIAGE_COLOR = new BiomeColorHelper.ColorResolver() + { + public int getColorAtPos(BiomeGenBase biome, BlockPos blockPosition) + { + return biome.getFoliageColorAtPos(blockPosition); + } + }; + private static final BiomeColorHelper.ColorResolver WATER_COLOR_MULTIPLIER = new BiomeColorHelper.ColorResolver() + { + public int getColorAtPos(BiomeGenBase biome, BlockPos blockPosition) + { + return biome.waterColorMultiplier; + } + }; + + private static int getColorAtPos(IBlockAccess blockAccess, BlockPos pos, BiomeColorHelper.ColorResolver colorResolver) + { + int i = 0; + int j = 0; + int k = 0; + + for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(pos.add(-1, 0, -1), pos.add(1, 0, 1))) + { + int l = colorResolver.getColorAtPos(blockAccess.getBiomeGenForCoords(blockpos$mutableblockpos), blockpos$mutableblockpos); + i += (l & 16711680) >> 16; + j += (l & 65280) >> 8; + k += l & 255; + } + + return (i / 9 & 255) << 16 | (j / 9 & 255) << 8 | k / 9 & 255; + } + + public static int getGrassColorAtPos(IBlockAccess p_180286_0_, BlockPos p_180286_1_) + { + return getColorAtPos(p_180286_0_, p_180286_1_, GRASS_COLOR); + } + + public static int getFoliageColorAtPos(IBlockAccess p_180287_0_, BlockPos p_180287_1_) + { + return getColorAtPos(p_180287_0_, p_180287_1_, FOLIAGE_COLOR); + } + + public static int getWaterColorAtPos(IBlockAccess p_180288_0_, BlockPos p_180288_1_) + { + return getColorAtPos(p_180288_0_, p_180288_1_, WATER_COLOR_MULTIPLIER); + } + + interface ColorResolver + { + int getColorAtPos(BiomeGenBase biome, BlockPos blockPosition); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeDecorator.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeDecorator.java new file mode 100644 index 0000000..b3941aa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeDecorator.java @@ -0,0 +1,412 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockStone; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.ChunkProviderSettings; +import net.minecraft.world.gen.GeneratorBushFeature; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCactus; +import net.minecraft.world.gen.feature.WorldGenClay; +import net.minecraft.world.gen.feature.WorldGenDeadBush; +import net.minecraft.world.gen.feature.WorldGenFlowers; +import net.minecraft.world.gen.feature.WorldGenLiquids; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenPumpkin; +import net.minecraft.world.gen.feature.WorldGenReed; +import net.minecraft.world.gen.feature.WorldGenSand; +import net.minecraft.world.gen.feature.WorldGenWaterlily; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeDecorator +{ + protected World currentWorld; + protected Random randomGenerator; + protected BlockPos field_180294_c; + protected ChunkProviderSettings chunkProviderSettings; + protected WorldGenerator clayGen = new WorldGenClay(4); + protected WorldGenerator sandGen = new WorldGenSand(Blocks.sand, 7); + protected WorldGenerator gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6); + protected WorldGenerator dirtGen; + protected WorldGenerator gravelGen; + protected WorldGenerator graniteGen; + protected WorldGenerator dioriteGen; + protected WorldGenerator andesiteGen; + protected WorldGenerator coalGen; + protected WorldGenerator ironGen; + protected WorldGenerator goldGen; + protected WorldGenerator redstoneGen; + protected WorldGenerator diamondGen; + protected WorldGenerator lapisGen; + protected WorldGenFlowers yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower, BlockFlower.EnumFlowerType.DANDELION); + protected WorldGenerator mushroomBrownGen = new GeneratorBushFeature(Blocks.brown_mushroom); + protected WorldGenerator mushroomRedGen = new GeneratorBushFeature(Blocks.red_mushroom); + protected WorldGenerator bigMushroomGen = new WorldGenBigMushroom(); + protected WorldGenerator reedGen = new WorldGenReed(); + protected WorldGenerator cactusGen = new WorldGenCactus(); + protected WorldGenerator waterlilyGen = new WorldGenWaterlily(); + protected int waterlilyPerChunk; + protected int treesPerChunk; + protected int flowersPerChunk = 2; + protected int grassPerChunk = 1; + protected int deadBushPerChunk; + protected int mushroomsPerChunk; + protected int reedsPerChunk; + protected int cactiPerChunk; + protected int sandPerChunk = 1; + protected int sandPerChunk2 = 3; + protected int clayPerChunk = 1; + protected int bigMushroomsPerChunk; + public boolean generateLakes = true; + + public void decorate(World worldIn, Random random, BiomeGenBase biome, BlockPos p_180292_4_) + { + if (this.currentWorld != null) + { + throw new RuntimeException("Already decorating"); + } + else + { + this.currentWorld = worldIn; + String s = worldIn.getWorldInfo().getGeneratorOptions(); + + if (s != null) + { + this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(s).func_177864_b(); + } + else + { + this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory("").func_177864_b(); + } + + this.randomGenerator = random; + this.field_180294_c = p_180292_4_; + this.dirtGen = new WorldGenMinable(Blocks.dirt.getDefaultState(), this.chunkProviderSettings.dirtSize); + this.gravelGen = new WorldGenMinable(Blocks.gravel.getDefaultState(), this.chunkProviderSettings.gravelSize); + this.graniteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize); + this.dioriteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize); + this.andesiteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize); + this.coalGen = new WorldGenMinable(Blocks.coal_ore.getDefaultState(), this.chunkProviderSettings.coalSize); + this.ironGen = new WorldGenMinable(Blocks.iron_ore.getDefaultState(), this.chunkProviderSettings.ironSize); + this.goldGen = new WorldGenMinable(Blocks.gold_ore.getDefaultState(), this.chunkProviderSettings.goldSize); + this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore.getDefaultState(), this.chunkProviderSettings.redstoneSize); + this.diamondGen = new WorldGenMinable(Blocks.diamond_ore.getDefaultState(), this.chunkProviderSettings.diamondSize); + this.lapisGen = new WorldGenMinable(Blocks.lapis_ore.getDefaultState(), this.chunkProviderSettings.lapisSize); + this.genDecorations(biome); + this.currentWorld = null; + this.randomGenerator = null; + } + } + + protected void genDecorations(BiomeGenBase biomeGenBaseIn) + { + this.generateOres(); + + for (int i = 0; i < this.sandPerChunk2; ++i) + { + int j = this.randomGenerator.nextInt(16) + 8; + int k = this.randomGenerator.nextInt(16) + 8; + this.sandGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(j, 0, k))); + } + + for (int i1 = 0; i1 < this.clayPerChunk; ++i1) + { + int l1 = this.randomGenerator.nextInt(16) + 8; + int i6 = this.randomGenerator.nextInt(16) + 8; + this.clayGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(l1, 0, i6))); + } + + for (int j1 = 0; j1 < this.sandPerChunk; ++j1) + { + int i2 = this.randomGenerator.nextInt(16) + 8; + int j6 = this.randomGenerator.nextInt(16) + 8; + this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i2, 0, j6))); + } + + int k1 = this.treesPerChunk; + + if (this.randomGenerator.nextInt(10) == 0) + { + ++k1; + } + + for (int j2 = 0; j2 < k1; ++j2) + { + int k6 = this.randomGenerator.nextInt(16) + 8; + int l = this.randomGenerator.nextInt(16) + 8; + WorldGenAbstractTree worldgenabstracttree = biomeGenBaseIn.genBigTreeChance(this.randomGenerator); + worldgenabstracttree.func_175904_e(); + BlockPos blockpos = this.currentWorld.getHeight(this.field_180294_c.add(k6, 0, l)); + + if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, blockpos)) + { + worldgenabstracttree.func_180711_a(this.currentWorld, this.randomGenerator, blockpos); + } + } + + for (int k2 = 0; k2 < this.bigMushroomsPerChunk; ++k2) + { + int l6 = this.randomGenerator.nextInt(16) + 8; + int k10 = this.randomGenerator.nextInt(16) + 8; + this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getHeight(this.field_180294_c.add(l6, 0, k10))); + } + + for (int l2 = 0; l2 < this.flowersPerChunk; ++l2) + { + int i7 = this.randomGenerator.nextInt(16) + 8; + int l10 = this.randomGenerator.nextInt(16) + 8; + int j14 = this.currentWorld.getHeight(this.field_180294_c.add(i7, 0, l10)).getY() + 32; + + if (j14 > 0) + { + int k17 = this.randomGenerator.nextInt(j14); + BlockPos blockpos1 = this.field_180294_c.add(i7, k17, l10); + BlockFlower.EnumFlowerType blockflower$enumflowertype = biomeGenBaseIn.pickRandomFlower(this.randomGenerator, blockpos1); + BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock(); + + if (blockflower.getMaterial() != Material.air) + { + this.yellowFlowerGen.setGeneratedBlock(blockflower, blockflower$enumflowertype); + this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, blockpos1); + } + } + } + + for (int i3 = 0; i3 < this.grassPerChunk; ++i3) + { + int j7 = this.randomGenerator.nextInt(16) + 8; + int i11 = this.randomGenerator.nextInt(16) + 8; + int k14 = this.currentWorld.getHeight(this.field_180294_c.add(j7, 0, i11)).getY() * 2; + + if (k14 > 0) + { + int l17 = this.randomGenerator.nextInt(k14); + biomeGenBaseIn.getRandomWorldGenForGrass(this.randomGenerator).generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j7, l17, i11)); + } + } + + for (int j3 = 0; j3 < this.deadBushPerChunk; ++j3) + { + int k7 = this.randomGenerator.nextInt(16) + 8; + int j11 = this.randomGenerator.nextInt(16) + 8; + int l14 = this.currentWorld.getHeight(this.field_180294_c.add(k7, 0, j11)).getY() * 2; + + if (l14 > 0) + { + int i18 = this.randomGenerator.nextInt(l14); + (new WorldGenDeadBush()).generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(k7, i18, j11)); + } + } + + for (int k3 = 0; k3 < this.waterlilyPerChunk; ++k3) + { + int l7 = this.randomGenerator.nextInt(16) + 8; + int k11 = this.randomGenerator.nextInt(16) + 8; + int i15 = this.currentWorld.getHeight(this.field_180294_c.add(l7, 0, k11)).getY() * 2; + + if (i15 > 0) + { + int j18 = this.randomGenerator.nextInt(i15); + BlockPos blockpos4; + BlockPos blockpos7; + + for (blockpos4 = this.field_180294_c.add(l7, j18, k11); blockpos4.getY() > 0; blockpos4 = blockpos7) + { + blockpos7 = blockpos4.down(); + + if (!this.currentWorld.isAirBlock(blockpos7)) + { + break; + } + } + + this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, blockpos4); + } + } + + for (int l3 = 0; l3 < this.mushroomsPerChunk; ++l3) + { + if (this.randomGenerator.nextInt(4) == 0) + { + int i8 = this.randomGenerator.nextInt(16) + 8; + int l11 = this.randomGenerator.nextInt(16) + 8; + BlockPos blockpos2 = this.currentWorld.getHeight(this.field_180294_c.add(i8, 0, l11)); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, blockpos2); + } + + if (this.randomGenerator.nextInt(8) == 0) + { + int j8 = this.randomGenerator.nextInt(16) + 8; + int i12 = this.randomGenerator.nextInt(16) + 8; + int j15 = this.currentWorld.getHeight(this.field_180294_c.add(j8, 0, i12)).getY() * 2; + + if (j15 > 0) + { + int k18 = this.randomGenerator.nextInt(j15); + BlockPos blockpos5 = this.field_180294_c.add(j8, k18, i12); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, blockpos5); + } + } + } + + if (this.randomGenerator.nextInt(4) == 0) + { + int i4 = this.randomGenerator.nextInt(16) + 8; + int k8 = this.randomGenerator.nextInt(16) + 8; + int j12 = this.currentWorld.getHeight(this.field_180294_c.add(i4, 0, k8)).getY() * 2; + + if (j12 > 0) + { + int k15 = this.randomGenerator.nextInt(j12); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(i4, k15, k8)); + } + } + + if (this.randomGenerator.nextInt(8) == 0) + { + int j4 = this.randomGenerator.nextInt(16) + 8; + int l8 = this.randomGenerator.nextInt(16) + 8; + int k12 = this.currentWorld.getHeight(this.field_180294_c.add(j4, 0, l8)).getY() * 2; + + if (k12 > 0) + { + int l15 = this.randomGenerator.nextInt(k12); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j4, l15, l8)); + } + } + + for (int k4 = 0; k4 < this.reedsPerChunk; ++k4) + { + int i9 = this.randomGenerator.nextInt(16) + 8; + int l12 = this.randomGenerator.nextInt(16) + 8; + int i16 = this.currentWorld.getHeight(this.field_180294_c.add(i9, 0, l12)).getY() * 2; + + if (i16 > 0) + { + int l18 = this.randomGenerator.nextInt(i16); + this.reedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(i9, l18, l12)); + } + } + + for (int l4 = 0; l4 < 10; ++l4) + { + int j9 = this.randomGenerator.nextInt(16) + 8; + int i13 = this.randomGenerator.nextInt(16) + 8; + int j16 = this.currentWorld.getHeight(this.field_180294_c.add(j9, 0, i13)).getY() * 2; + + if (j16 > 0) + { + int i19 = this.randomGenerator.nextInt(j16); + this.reedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j9, i19, i13)); + } + } + + if (this.randomGenerator.nextInt(32) == 0) + { + int i5 = this.randomGenerator.nextInt(16) + 8; + int k9 = this.randomGenerator.nextInt(16) + 8; + int j13 = this.currentWorld.getHeight(this.field_180294_c.add(i5, 0, k9)).getY() * 2; + + if (j13 > 0) + { + int k16 = this.randomGenerator.nextInt(j13); + (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(i5, k16, k9)); + } + } + + for (int j5 = 0; j5 < this.cactiPerChunk; ++j5) + { + int l9 = this.randomGenerator.nextInt(16) + 8; + int k13 = this.randomGenerator.nextInt(16) + 8; + int l16 = this.currentWorld.getHeight(this.field_180294_c.add(l9, 0, k13)).getY() * 2; + + if (l16 > 0) + { + int j19 = this.randomGenerator.nextInt(l16); + this.cactusGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(l9, j19, k13)); + } + } + + if (this.generateLakes) + { + for (int k5 = 0; k5 < 50; ++k5) + { + int i10 = this.randomGenerator.nextInt(16) + 8; + int l13 = this.randomGenerator.nextInt(16) + 8; + int i17 = this.randomGenerator.nextInt(248) + 8; + + if (i17 > 0) + { + int k19 = this.randomGenerator.nextInt(i17); + BlockPos blockpos6 = this.field_180294_c.add(i10, k19, l13); + (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, blockpos6); + } + } + + for (int l5 = 0; l5 < 20; ++l5) + { + int j10 = this.randomGenerator.nextInt(16) + 8; + int i14 = this.randomGenerator.nextInt(16) + 8; + int j17 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); + BlockPos blockpos3 = this.field_180294_c.add(j10, j17, i14); + (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, blockpos3); + } + } + } + + protected void genStandardOre1(int blockCount, WorldGenerator generator, int minHeight, int maxHeight) + { + if (maxHeight < minHeight) + { + int i = minHeight; + minHeight = maxHeight; + maxHeight = i; + } + else if (maxHeight == minHeight) + { + if (minHeight < 255) + { + ++maxHeight; + } + else + { + --minHeight; + } + } + + for (int j = 0; j < blockCount; ++j) + { + BlockPos blockpos = this.field_180294_c.add(this.randomGenerator.nextInt(16), this.randomGenerator.nextInt(maxHeight - minHeight) + minHeight, this.randomGenerator.nextInt(16)); + generator.generate(this.currentWorld, this.randomGenerator, blockpos); + } + } + + protected void genStandardOre2(int blockCount, WorldGenerator generator, int centerHeight, int spread) + { + for (int i = 0; i < blockCount; ++i) + { + BlockPos blockpos = this.field_180294_c.add(this.randomGenerator.nextInt(16), this.randomGenerator.nextInt(spread) + this.randomGenerator.nextInt(spread) + centerHeight - spread, this.randomGenerator.nextInt(16)); + generator.generate(this.currentWorld, this.randomGenerator, blockpos); + } + } + + protected void generateOres() + { + this.genStandardOre1(this.chunkProviderSettings.dirtCount, this.dirtGen, this.chunkProviderSettings.dirtMinHeight, this.chunkProviderSettings.dirtMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.gravelCount, this.gravelGen, this.chunkProviderSettings.gravelMinHeight, this.chunkProviderSettings.gravelMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.dioriteCount, this.dioriteGen, this.chunkProviderSettings.dioriteMinHeight, this.chunkProviderSettings.dioriteMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.graniteCount, this.graniteGen, this.chunkProviderSettings.graniteMinHeight, this.chunkProviderSettings.graniteMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.andesiteCount, this.andesiteGen, this.chunkProviderSettings.andesiteMinHeight, this.chunkProviderSettings.andesiteMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.coalCount, this.coalGen, this.chunkProviderSettings.coalMinHeight, this.chunkProviderSettings.coalMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.ironCount, this.ironGen, this.chunkProviderSettings.ironMinHeight, this.chunkProviderSettings.ironMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.goldCount, this.goldGen, this.chunkProviderSettings.goldMinHeight, this.chunkProviderSettings.goldMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.redstoneCount, this.redstoneGen, this.chunkProviderSettings.redstoneMinHeight, this.chunkProviderSettings.redstoneMaxHeight); + this.genStandardOre1(this.chunkProviderSettings.diamondCount, this.diamondGen, this.chunkProviderSettings.diamondMinHeight, this.chunkProviderSettings.diamondMaxHeight); + this.genStandardOre2(this.chunkProviderSettings.lapisCount, this.lapisGen, this.chunkProviderSettings.lapisCenterHeight, this.chunkProviderSettings.lapisSpread); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java new file mode 100644 index 0000000..e9594f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java @@ -0,0 +1,30 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenSpikes; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeEndDecorator extends BiomeDecorator +{ + protected WorldGenerator spikeGen = new WorldGenSpikes(Blocks.end_stone); + + protected void genDecorations(BiomeGenBase biomeGenBaseIn) + { + this.generateOres(); + + if (this.randomGenerator.nextInt(5) == 0) + { + int i = this.randomGenerator.nextInt(16) + 8; + int j = this.randomGenerator.nextInt(16) + 8; + this.spikeGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(i, 0, j))); + } + + if (this.field_180294_c.getX() == 0 && this.field_180294_c.getZ() == 0) + { + EntityDragon entitydragon = new EntityDragon(this.currentWorld); + entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F); + this.currentWorld.spawnEntityInWorld(entitydragon); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenBase.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenBase.java new file mode 100644 index 0000000..6a7be31 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenBase.java @@ -0,0 +1,593 @@ +package net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenDoublePlant; +import net.minecraft.world.gen.feature.WorldGenSwamp; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class BiomeGenBase +{ + private static final Logger logger = LogManager.getLogger(); + protected static final BiomeGenBase.Height height_Default = new BiomeGenBase.Height(0.1F, 0.2F); + protected static final BiomeGenBase.Height height_ShallowWaters = new BiomeGenBase.Height(-0.5F, 0.0F); + protected static final BiomeGenBase.Height height_Oceans = new BiomeGenBase.Height(-1.0F, 0.1F); + protected static final BiomeGenBase.Height height_DeepOceans = new BiomeGenBase.Height(-1.8F, 0.1F); + protected static final BiomeGenBase.Height height_LowPlains = new BiomeGenBase.Height(0.125F, 0.05F); + protected static final BiomeGenBase.Height height_MidPlains = new BiomeGenBase.Height(0.2F, 0.2F); + protected static final BiomeGenBase.Height height_LowHills = new BiomeGenBase.Height(0.45F, 0.3F); + protected static final BiomeGenBase.Height height_HighPlateaus = new BiomeGenBase.Height(1.5F, 0.025F); + protected static final BiomeGenBase.Height height_MidHills = new BiomeGenBase.Height(1.0F, 0.5F); + protected static final BiomeGenBase.Height height_Shores = new BiomeGenBase.Height(0.0F, 0.025F); + protected static final BiomeGenBase.Height height_RockyWaters = new BiomeGenBase.Height(0.1F, 0.8F); + protected static final BiomeGenBase.Height height_LowIslands = new BiomeGenBase.Height(0.2F, 0.3F); + protected static final BiomeGenBase.Height height_PartiallySubmerged = new BiomeGenBase.Height(-0.2F, 0.1F); + private static final BiomeGenBase[] biomeList = new BiomeGenBase[256]; + public static final Set explorationBiomesList = Sets.newHashSet(); + public static final Map BIOME_ID_MAP = Maps.newHashMap(); + public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans); + public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains"); + public static final BiomeGenBase desert = (new BiomeGenDesert(2)).setColor(16421912).setBiomeName("Desert").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowPlains); + public static final BiomeGenBase extremeHills = (new BiomeGenHills(3, false)).setColor(6316128).setBiomeName("Extreme Hills").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); + public static final BiomeGenBase forest = (new BiomeGenForest(4, 0)).setColor(353825).setBiomeName("Forest"); + public static final BiomeGenBase taiga = (new BiomeGenTaiga(5, 0)).setColor(747097).setBiomeName("Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_MidPlains); + public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").setFillerBlockMetadata(9154376).setHeight(height_PartiallySubmerged).setTemperatureRainfall(0.8F, 0.9F); + public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setHeight(height_ShallowWaters); + public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F); + public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("The End").setDisableRain(); + public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().setHeight(height_Oceans).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().setHeight(height_ShallowWaters).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase icePlains = (new BiomeGenSnow(12, false)).setColor(16777215).setBiomeName("Ice Plains").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setHeight(height_LowPlains); + public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13, false)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().setHeight(height_LowHills).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_LowIslands); + public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_Shores); + public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).setHeight(height_Shores); + public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowHills); + public static final BiomeGenBase forestHills = (new BiomeGenForest(18, 0)).setColor(2250012).setBiomeName("ForestHills").setHeight(height_LowHills); + public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19, 0)).setColor(1456435).setBiomeName("TaigaHills").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_LowHills); + public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20, true)).setColor(7501978).setBiomeName("Extreme Hills Edge").setHeight(height_MidHills.attenuate()).setTemperatureRainfall(0.2F, 0.3F); + public static final BiomeGenBase jungle = (new BiomeGenJungle(21, false)).setColor(5470985).setBiomeName("Jungle").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F); + public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22, false)).setColor(2900485).setBiomeName("JungleHills").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.9F).setHeight(height_LowHills); + public static final BiomeGenBase jungleEdge = (new BiomeGenJungle(23, true)).setColor(6458135).setBiomeName("JungleEdge").setFillerBlockMetadata(5470985).setTemperatureRainfall(0.95F, 0.8F); + public static final BiomeGenBase deepOcean = (new BiomeGenOcean(24)).setColor(48).setBiomeName("Deep Ocean").setHeight(height_DeepOceans); + public static final BiomeGenBase stoneBeach = (new BiomeGenStoneBeach(25)).setColor(10658436).setBiomeName("Stone Beach").setTemperatureRainfall(0.2F, 0.3F).setHeight(height_RockyWaters); + public static final BiomeGenBase coldBeach = (new BiomeGenBeach(26)).setColor(16445632).setBiomeName("Cold Beach").setTemperatureRainfall(0.05F, 0.3F).setHeight(height_Shores).setEnableSnow(); + public static final BiomeGenBase birchForest = (new BiomeGenForest(27, 2)).setBiomeName("Birch Forest").setColor(3175492); + public static final BiomeGenBase birchForestHills = (new BiomeGenForest(28, 2)).setBiomeName("Birch Forest Hills").setColor(2055986).setHeight(height_LowHills); + public static final BiomeGenBase roofedForest = (new BiomeGenForest(29, 3)).setColor(4215066).setBiomeName("Roofed Forest"); + public static final BiomeGenBase coldTaiga = (new BiomeGenTaiga(30, 0)).setColor(3233098).setBiomeName("Cold Taiga").setFillerBlockMetadata(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).setHeight(height_MidPlains).func_150563_c(16777215); + public static final BiomeGenBase coldTaigaHills = (new BiomeGenTaiga(31, 0)).setColor(2375478).setBiomeName("Cold Taiga Hills").setFillerBlockMetadata(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).setHeight(height_LowHills).func_150563_c(16777215); + public static final BiomeGenBase megaTaiga = (new BiomeGenTaiga(32, 1)).setColor(5858897).setBiomeName("Mega Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_MidPlains); + public static final BiomeGenBase megaTaigaHills = (new BiomeGenTaiga(33, 1)).setColor(4542270).setBiomeName("Mega Taiga Hills").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_LowHills); + public static final BiomeGenBase extremeHillsPlus = (new BiomeGenHills(34, true)).setColor(5271632).setBiomeName("Extreme Hills+").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); + public static final BiomeGenBase savanna = (new BiomeGenSavanna(35)).setColor(12431967).setBiomeName("Savanna").setTemperatureRainfall(1.2F, 0.0F).setDisableRain().setHeight(height_LowPlains); + public static final BiomeGenBase savannaPlateau = (new BiomeGenSavanna(36)).setColor(10984804).setBiomeName("Savanna Plateau").setTemperatureRainfall(1.0F, 0.0F).setDisableRain().setHeight(height_HighPlateaus); + public static final BiomeGenBase mesa = (new BiomeGenMesa(37, false, false)).setColor(14238997).setBiomeName("Mesa"); + public static final BiomeGenBase mesaPlateau_F = (new BiomeGenMesa(38, false, true)).setColor(11573093).setBiomeName("Mesa Plateau F").setHeight(height_HighPlateaus); + public static final BiomeGenBase mesaPlateau = (new BiomeGenMesa(39, false, false)).setColor(13274213).setBiomeName("Mesa Plateau").setHeight(height_HighPlateaus); + public static final BiomeGenBase field_180279_ad = ocean; + protected static final NoiseGeneratorPerlin temperatureNoise; + protected static final NoiseGeneratorPerlin GRASS_COLOR_NOISE; + protected static final WorldGenDoublePlant DOUBLE_PLANT_GENERATOR; + public String biomeName; + public int color; + public int field_150609_ah; + public IBlockState topBlock = Blocks.grass.getDefaultState(); + public IBlockState fillerBlock = Blocks.dirt.getDefaultState(); + public int fillerBlockMetadata = 5169201; + public float minHeight; + public float maxHeight; + public float temperature; + public float rainfall; + public int waterColorMultiplier; + public BiomeDecorator theBiomeDecorator; + protected List spawnableMonsterList; + protected List spawnableCreatureList; + protected List spawnableWaterCreatureList; + protected List spawnableCaveCreatureList; + protected boolean enableSnow; + protected boolean enableRain; + public final int biomeID; + protected WorldGenTrees worldGeneratorTrees; + protected WorldGenBigTree worldGeneratorBigTree; + protected WorldGenSwamp worldGeneratorSwamp; + + protected BiomeGenBase(int id) + { + this.minHeight = height_Default.rootHeight; + this.maxHeight = height_Default.variation; + this.temperature = 0.5F; + this.rainfall = 0.5F; + this.waterColorMultiplier = 16777215; + this.spawnableMonsterList = Lists.newArrayList(); + this.spawnableCreatureList = Lists.newArrayList(); + this.spawnableWaterCreatureList = Lists.newArrayList(); + this.spawnableCaveCreatureList = Lists.newArrayList(); + this.enableRain = true; + this.worldGeneratorTrees = new WorldGenTrees(false); + this.worldGeneratorBigTree = new WorldGenBigTree(false); + this.worldGeneratorSwamp = new WorldGenSwamp(); + this.biomeID = id; + biomeList[id] = this; + this.theBiomeDecorator = this.createBiomeDecorator(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + } + + protected BiomeDecorator createBiomeDecorator() + { + return new BiomeDecorator(); + } + + protected BiomeGenBase setTemperatureRainfall(float temperatureIn, float rainfallIn) + { + if (temperatureIn > 0.1F && temperatureIn < 0.2F) + { + throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow"); + } + else + { + this.temperature = temperatureIn; + this.rainfall = rainfallIn; + return this; + } + } + + protected final BiomeGenBase setHeight(BiomeGenBase.Height heights) + { + this.minHeight = heights.rootHeight; + this.maxHeight = heights.variation; + return this; + } + + protected BiomeGenBase setDisableRain() + { + this.enableRain = false; + return this; + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees); + } + + public WorldGenerator getRandomWorldGenForGrass(Random rand) + { + return new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); + } + + public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) + { + return rand.nextInt(3) > 0 ? BlockFlower.EnumFlowerType.DANDELION : BlockFlower.EnumFlowerType.POPPY; + } + + protected BiomeGenBase setEnableSnow() + { + this.enableSnow = true; + return this; + } + + protected BiomeGenBase setBiomeName(String name) + { + this.biomeName = name; + return this; + } + + protected BiomeGenBase setFillerBlockMetadata(int meta) + { + this.fillerBlockMetadata = meta; + return this; + } + + protected BiomeGenBase setColor(int colorIn) + { + this.func_150557_a(colorIn, false); + return this; + } + + protected BiomeGenBase func_150563_c(int p_150563_1_) + { + this.field_150609_ah = p_150563_1_; + return this; + } + + protected BiomeGenBase func_150557_a(int colorIn, boolean p_150557_2_) + { + this.color = colorIn; + + if (p_150557_2_) + { + this.field_150609_ah = (colorIn & 16711422) >> 1; + } + else + { + this.field_150609_ah = colorIn; + } + + return this; + } + + public int getSkyColorByTemp(float p_76731_1_) + { + p_76731_1_ = p_76731_1_ / 3.0F; + p_76731_1_ = MathHelper.clamp_float(p_76731_1_, -1.0F, 1.0F); + return MathHelper.hsvToRGB(0.62222224F - p_76731_1_ * 0.05F, 0.5F + p_76731_1_ * 0.1F, 1.0F); + } + + public List getSpawnableList(EnumCreatureType creatureType) + { + switch (creatureType) + { + case MONSTER: + return this.spawnableMonsterList; + + case CREATURE: + return this.spawnableCreatureList; + + case WATER_CREATURE: + return this.spawnableWaterCreatureList; + + case AMBIENT: + return this.spawnableCaveCreatureList; + + default: + return Collections.emptyList(); + } + } + + public boolean getEnableSnow() + { + return this.isSnowyBiome(); + } + + public boolean canRain() + { + return this.isSnowyBiome() ? false : this.enableRain; + } + + public boolean isHighHumidity() + { + return this.rainfall > 0.85F; + } + + public float getSpawningChance() + { + return 0.1F; + } + + public final int getIntRainfall() + { + return (int)(this.rainfall * 65536.0F); + } + + public final float getFloatRainfall() + { + return this.rainfall; + } + + public final float getFloatTemperature(BlockPos pos) + { + if (pos.getY() > 64) + { + float f = (float)(temperatureNoise.func_151601_a((double)pos.getX() * 1.0D / 8.0D, (double)pos.getZ() * 1.0D / 8.0D) * 4.0D); + return this.temperature - (f + (float)pos.getY() - 64.0F) * 0.05F / 30.0F; + } + else + { + return this.temperature; + } + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + this.theBiomeDecorator.decorate(worldIn, rand, this, pos); + } + + public int getGrassColorAtPos(BlockPos pos) + { + double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F); + double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return ColorizerGrass.getGrassColor(d0, d1); + } + + public int getFoliageColorAtPos(BlockPos pos) + { + double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(pos), 0.0F, 1.0F); + double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return ColorizerFoliage.getFoliageColor(d0, d1); + } + + public boolean isSnowyBiome() + { + return this.enableSnow; + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); + } + + public final void generateBiomeTerrain(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + int i = worldIn.getSeaLevel(); + IBlockState iblockstate = this.topBlock; + IBlockState iblockstate1 = this.fillerBlock; + int j = -1; + int k = (int)(noiseVal / 3.0D + 3.0D + rand.nextDouble() * 0.25D); + int l = x & 15; + int i1 = z & 15; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j1 = 255; j1 >= 0; --j1) + { + if (j1 <= rand.nextInt(5)) + { + chunkPrimerIn.setBlockState(i1, j1, l, Blocks.bedrock.getDefaultState()); + } + else + { + IBlockState iblockstate2 = chunkPrimerIn.getBlockState(i1, j1, l); + + if (iblockstate2.getBlock().getMaterial() == Material.air) + { + j = -1; + } + else if (iblockstate2.getBlock() == Blocks.stone) + { + if (j == -1) + { + if (k <= 0) + { + iblockstate = null; + iblockstate1 = Blocks.stone.getDefaultState(); + } + else if (j1 >= i - 4 && j1 <= i + 1) + { + iblockstate = this.topBlock; + iblockstate1 = this.fillerBlock; + } + + if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air)) + { + if (this.getFloatTemperature(blockpos$mutableblockpos.set(x, j1, z)) < 0.15F) + { + iblockstate = Blocks.ice.getDefaultState(); + } + else + { + iblockstate = Blocks.water.getDefaultState(); + } + } + + j = k; + + if (j1 >= i - 1) + { + chunkPrimerIn.setBlockState(i1, j1, l, iblockstate); + } + else if (j1 < i - 7 - k) + { + iblockstate = null; + iblockstate1 = Blocks.stone.getDefaultState(); + chunkPrimerIn.setBlockState(i1, j1, l, Blocks.gravel.getDefaultState()); + } + else + { + chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); + } + } + else if (j > 0) + { + --j; + chunkPrimerIn.setBlockState(i1, j1, l, iblockstate1); + + if (j == 0 && iblockstate1.getBlock() == Blocks.sand) + { + j = rand.nextInt(4) + Math.max(0, j1 - 63); + iblockstate1 = iblockstate1.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.red_sandstone.getDefaultState() : Blocks.sandstone.getDefaultState(); + } + } + } + } + } + } + + protected BiomeGenBase createMutation() + { + return this.createMutatedBiome(this.biomeID + 128); + } + + protected BiomeGenBase createMutatedBiome(int p_180277_1_) + { + return new BiomeGenMutated(p_180277_1_, this); + } + + public Class getBiomeClass() + { + return this.getClass(); + } + + public boolean isEqualTo(BiomeGenBase biome) + { + return biome == this ? true : (biome == null ? false : this.getBiomeClass() == biome.getBiomeClass()); + } + + public BiomeGenBase.TempCategory getTempCategory() + { + return (double)this.temperature < 0.2D ? BiomeGenBase.TempCategory.COLD : ((double)this.temperature < 1.0D ? BiomeGenBase.TempCategory.MEDIUM : BiomeGenBase.TempCategory.WARM); + } + + public static BiomeGenBase[] getBiomeGenArray() + { + return biomeList; + } + + public static BiomeGenBase getBiome(int id) + { + return getBiomeFromBiomeList(id, (BiomeGenBase)null); + } + + public static BiomeGenBase getBiomeFromBiomeList(int biomeId, BiomeGenBase biome) + { + if (biomeId >= 0 && biomeId <= biomeList.length) + { + BiomeGenBase biomegenbase = biomeList[biomeId]; + return biomegenbase == null ? biome : biomegenbase; + } + else + { + logger.warn("Biome ID is out of bounds: " + biomeId + ", defaulting to 0 (Ocean)"); + return ocean; + } + } + + static + { + plains.createMutation(); + desert.createMutation(); + forest.createMutation(); + taiga.createMutation(); + swampland.createMutation(); + icePlains.createMutation(); + jungle.createMutation(); + jungleEdge.createMutation(); + coldTaiga.createMutation(); + savanna.createMutation(); + savannaPlateau.createMutation(); + mesa.createMutation(); + mesaPlateau_F.createMutation(); + mesaPlateau.createMutation(); + birchForest.createMutation(); + birchForestHills.createMutation(); + roofedForest.createMutation(); + megaTaiga.createMutation(); + extremeHills.createMutation(); + extremeHillsPlus.createMutation(); + megaTaiga.createMutatedBiome(megaTaigaHills.biomeID + 128).setBiomeName("Redwood Taiga Hills M"); + + for (BiomeGenBase biomegenbase : biomeList) + { + if (biomegenbase != null) + { + if (BIOME_ID_MAP.containsKey(biomegenbase.biomeName)) + { + throw new Error("Biome \"" + biomegenbase.biomeName + "\" is defined as both ID " + ((BiomeGenBase)BIOME_ID_MAP.get(biomegenbase.biomeName)).biomeID + " and " + biomegenbase.biomeID); + } + + BIOME_ID_MAP.put(biomegenbase.biomeName, biomegenbase); + + if (biomegenbase.biomeID < 128) + { + explorationBiomesList.add(biomegenbase); + } + } + } + + explorationBiomesList.remove(hell); + explorationBiomesList.remove(sky); + explorationBiomesList.remove(frozenOcean); + explorationBiomesList.remove(extremeHillsEdge); + temperatureNoise = new NoiseGeneratorPerlin(new Random(1234L), 1); + GRASS_COLOR_NOISE = new NoiseGeneratorPerlin(new Random(2345L), 1); + DOUBLE_PLANT_GENERATOR = new WorldGenDoublePlant(); + } + + public static class Height + { + public float rootHeight; + public float variation; + + public Height(float rootHeightIn, float variationIn) + { + this.rootHeight = rootHeightIn; + this.variation = variationIn; + } + + public BiomeGenBase.Height attenuate() + { + return new BiomeGenBase.Height(this.rootHeight * 0.8F, this.variation * 0.6F); + } + } + + public static class SpawnListEntry extends WeightedRandom.Item + { + public Class entityClass; + public int minGroupCount; + public int maxGroupCount; + + public SpawnListEntry(Class entityclassIn, int weight, int groupCountMin, int groupCountMax) + { + super(weight); + this.entityClass = entityclassIn; + this.minGroupCount = groupCountMin; + this.maxGroupCount = groupCountMax; + } + + public String toString() + { + return this.entityClass.getSimpleName() + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + this.itemWeight; + } + } + + public static enum TempCategory + { + OCEAN, + COLD, + MEDIUM, + WARM; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java new file mode 100644 index 0000000..9186d3b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java @@ -0,0 +1,18 @@ +package net.minecraft.world.biome; + +import net.minecraft.init.Blocks; + +public class BiomeGenBeach extends BiomeGenBase +{ + public BiomeGenBeach(int id) + { + super(id); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand.getDefaultState(); + this.fillerBlock = Blocks.sand.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java new file mode 100644 index 0000000..b9bb9a6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java @@ -0,0 +1,36 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenDesertWells; + +public class BiomeGenDesert extends BiomeGenBase +{ + public BiomeGenDesert(int id) + { + super(id); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand.getDefaultState(); + this.fillerBlock = Blocks.sand.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 2; + this.theBiomeDecorator.reedsPerChunk = 50; + this.theBiomeDecorator.cactiPerChunk = 10; + this.spawnableCreatureList.clear(); + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + super.decorate(worldIn, rand, pos); + + if (rand.nextInt(1000) == 0) + { + int i = rand.nextInt(16) + 8; + int j = rand.nextInt(16) + 8; + BlockPos blockpos = worldIn.getHeight(pos.add(i, 0, j)).up(); + (new WorldGenDesertWells()).generate(worldIn, rand, blockpos); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java new file mode 100644 index 0000000..b6e9fe2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java @@ -0,0 +1,25 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.init.Blocks; + +public class BiomeGenEnd extends BiomeGenBase +{ + public BiomeGenEnd(int id) + { + super(id); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4)); + this.topBlock = Blocks.dirt.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + this.theBiomeDecorator = new BiomeEndDecorator(); + } + + public int getSkyColorByTemp(float p_76731_1_) + { + return 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenForest.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenForest.java new file mode 100644 index 0000000..09062f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenForest.java @@ -0,0 +1,201 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; + +public class BiomeGenForest extends BiomeGenBase +{ + private int field_150632_aF; + protected static final WorldGenForest field_150629_aC = new WorldGenForest(false, true); + protected static final WorldGenForest field_150630_aD = new WorldGenForest(false, false); + protected static final WorldGenCanopyTree field_150631_aE = new WorldGenCanopyTree(false); + + public BiomeGenForest(int id, int p_i45377_2_) + { + super(id); + this.field_150632_aF = p_i45377_2_; + this.theBiomeDecorator.treesPerChunk = 10; + this.theBiomeDecorator.grassPerChunk = 2; + + if (this.field_150632_aF == 1) + { + this.theBiomeDecorator.treesPerChunk = 6; + this.theBiomeDecorator.flowersPerChunk = 100; + this.theBiomeDecorator.grassPerChunk = 1; + } + + this.setFillerBlockMetadata(5159473); + this.setTemperatureRainfall(0.7F, 0.8F); + + if (this.field_150632_aF == 2) + { + this.field_150609_ah = 353825; + this.color = 3175492; + this.setTemperatureRainfall(0.6F, 0.6F); + } + + if (this.field_150632_aF == 0) + { + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 4, 4)); + } + + if (this.field_150632_aF == 3) + { + this.theBiomeDecorator.treesPerChunk = -999; + } + } + + protected BiomeGenBase func_150557_a(int colorIn, boolean p_150557_2_) + { + if (this.field_150632_aF == 2) + { + this.field_150609_ah = 353825; + this.color = colorIn; + + if (p_150557_2_) + { + this.field_150609_ah = (this.field_150609_ah & 16711422) >> 1; + } + + return this; + } + else + { + return super.func_150557_a(colorIn, p_150557_2_); + } + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return (WorldGenAbstractTree)(this.field_150632_aF == 3 && rand.nextInt(3) > 0 ? field_150631_aE : (this.field_150632_aF != 2 && rand.nextInt(5) != 0 ? this.worldGeneratorTrees : field_150630_aD)); + } + + public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) + { + if (this.field_150632_aF == 1) + { + double d0 = MathHelper.clamp_double((1.0D + GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() / 48.0D, (double)pos.getZ() / 48.0D)) / 2.0D, 0.0D, 0.9999D); + BlockFlower.EnumFlowerType blockflower$enumflowertype = BlockFlower.EnumFlowerType.values()[(int)(d0 * (double)BlockFlower.EnumFlowerType.values().length)]; + return blockflower$enumflowertype == BlockFlower.EnumFlowerType.BLUE_ORCHID ? BlockFlower.EnumFlowerType.POPPY : blockflower$enumflowertype; + } + else + { + return super.pickRandomFlower(rand, pos); + } + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + if (this.field_150632_aF == 3) + { + for (int i = 0; i < 4; ++i) + { + for (int j = 0; j < 4; ++j) + { + int k = i * 4 + 1 + 8 + rand.nextInt(3); + int l = j * 4 + 1 + 8 + rand.nextInt(3); + BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l)); + + if (rand.nextInt(20) == 0) + { + WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom(); + worldgenbigmushroom.generate(worldIn, rand, blockpos); + } + else + { + WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(rand); + worldgenabstracttree.func_175904_e(); + + if (worldgenabstracttree.generate(worldIn, rand, blockpos)) + { + worldgenabstracttree.func_180711_a(worldIn, rand, blockpos); + } + } + } + } + } + + int j1 = rand.nextInt(5) - 3; + + if (this.field_150632_aF == 1) + { + j1 += 2; + } + + for (int k1 = 0; k1 < j1; ++k1) + { + int l1 = rand.nextInt(3); + + if (l1 == 0) + { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SYRINGA); + } + else if (l1 == 1) + { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.ROSE); + } + else if (l1 == 2) + { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.PAEONIA); + } + + for (int i2 = 0; i2 < 5; ++i2) + { + int j2 = rand.nextInt(16) + 8; + int k2 = rand.nextInt(16) + 8; + int i1 = rand.nextInt(worldIn.getHeight(pos.add(j2, 0, k2)).getY() + 32); + + if (DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, new BlockPos(pos.getX() + j2, i1, pos.getZ() + k2))) + { + break; + } + } + } + + super.decorate(worldIn, rand, pos); + } + + public int getGrassColorAtPos(BlockPos pos) + { + int i = super.getGrassColorAtPos(pos); + return this.field_150632_aF == 3 ? (i & 16711422) + 2634762 >> 1 : i; + } + + protected BiomeGenBase createMutatedBiome(final int p_180277_1_) + { + if (this.biomeID == BiomeGenBase.forest.biomeID) + { + BiomeGenForest biomegenforest = new BiomeGenForest(p_180277_1_, 1); + biomegenforest.setHeight(new BiomeGenBase.Height(this.minHeight, this.maxHeight + 0.2F)); + biomegenforest.setBiomeName("Flower Forest"); + biomegenforest.func_150557_a(6976549, true); + biomegenforest.setFillerBlockMetadata(8233509); + return biomegenforest; + } + else + { + return this.biomeID != BiomeGenBase.birchForest.biomeID && this.biomeID != BiomeGenBase.birchForestHills.biomeID ? new BiomeGenMutated(p_180277_1_, this) + { + public void decorate(World worldIn, Random rand, BlockPos pos) + { + this.baseBiome.decorate(worldIn, rand, pos); + } + }: new BiomeGenMutated(p_180277_1_, this) + { + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return rand.nextBoolean() ? BiomeGenForest.field_150629_aC : BiomeGenForest.field_150630_aD; + } + }; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenHell.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenHell.java new file mode 100644 index 0000000..5257e0c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenHell.java @@ -0,0 +1,20 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; + +public class BiomeGenHell extends BiomeGenBase +{ + public BiomeGenHell(int id) + { + super(id); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 50, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenHills.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenHills.java new file mode 100644 index 0000000..a7687b2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenHills.java @@ -0,0 +1,100 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenHills extends BiomeGenBase +{ + private WorldGenerator theWorldGenerator = new WorldGenMinable(Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE), 9); + private WorldGenTaiga2 field_150634_aD = new WorldGenTaiga2(false); + private int field_150635_aE = 0; + private int field_150636_aF = 1; + private int field_150637_aG = 2; + private int field_150638_aH; + + protected BiomeGenHills(int id, boolean p_i45373_2_) + { + super(id); + this.field_150638_aH = this.field_150635_aE; + + if (p_i45373_2_) + { + this.theBiomeDecorator.treesPerChunk = 3; + this.field_150638_aH = this.field_150636_aF; + } + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return (WorldGenAbstractTree)(rand.nextInt(3) > 0 ? this.field_150634_aD : super.genBigTreeChance(rand)); + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + super.decorate(worldIn, rand, pos); + int i = 3 + rand.nextInt(6); + + for (int j = 0; j < i; ++j) + { + int k = rand.nextInt(16); + int l = rand.nextInt(28) + 4; + int i1 = rand.nextInt(16); + BlockPos blockpos = pos.add(k, l, i1); + + if (worldIn.getBlockState(blockpos).getBlock() == Blocks.stone) + { + worldIn.setBlockState(blockpos, Blocks.emerald_ore.getDefaultState(), 2); + } + } + + for (i = 0; i < 7; ++i) + { + int j1 = rand.nextInt(16); + int k1 = rand.nextInt(64); + int l1 = rand.nextInt(16); + this.theWorldGenerator.generate(worldIn, rand, pos.add(j1, k1, l1)); + } + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + this.topBlock = Blocks.grass.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + + if ((noiseVal < -1.0D || noiseVal > 2.0D) && this.field_150638_aH == this.field_150637_aG) + { + this.topBlock = Blocks.gravel.getDefaultState(); + this.fillerBlock = Blocks.gravel.getDefaultState(); + } + else if (noiseVal > 1.0D && this.field_150638_aH != this.field_150636_aF) + { + this.topBlock = Blocks.stone.getDefaultState(); + this.fillerBlock = Blocks.stone.getDefaultState(); + } + + this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); + } + + private BiomeGenHills mutateHills(BiomeGenBase p_150633_1_) + { + this.field_150638_aH = this.field_150637_aG; + this.func_150557_a(p_150633_1_.color, true); + this.setBiomeName(p_150633_1_.biomeName + " M"); + this.setHeight(new BiomeGenBase.Height(p_150633_1_.minHeight, p_150633_1_.maxHeight)); + this.setTemperatureRainfall(p_150633_1_.temperature, p_150633_1_.rainfall); + return this; + } + + protected BiomeGenBase createMutatedBiome(int p_180277_1_) + { + return (new BiomeGenHills(p_180277_1_, false)).mutateHills(this); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java new file mode 100644 index 0000000..8457386 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java @@ -0,0 +1,83 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMelon; +import net.minecraft.world.gen.feature.WorldGenShrub; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenVines; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenJungle extends BiomeGenBase +{ + private boolean field_150614_aC; + private static final IBlockState field_181620_aE = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE); + private static final IBlockState field_181621_aF = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + private static final IBlockState field_181622_aG = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public BiomeGenJungle(int id, boolean p_i45379_2_) + { + super(id); + this.field_150614_aC = p_i45379_2_; + + if (p_i45379_2_) + { + this.theBiomeDecorator.treesPerChunk = 2; + } + else + { + this.theBiomeDecorator.treesPerChunk = 50; + } + + this.theBiomeDecorator.grassPerChunk = 25; + this.theBiomeDecorator.flowersPerChunk = 4; + + if (!p_i45379_2_) + { + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1)); + } + + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return (WorldGenAbstractTree)(rand.nextInt(10) == 0 ? this.worldGeneratorBigTree : (rand.nextInt(2) == 0 ? new WorldGenShrub(field_181620_aE, field_181622_aG) : (!this.field_150614_aC && rand.nextInt(3) == 0 ? new WorldGenMegaJungle(false, 10, 20, field_181620_aE, field_181621_aF) : new WorldGenTrees(false, 4 + rand.nextInt(7), field_181620_aE, field_181621_aF, true)))); + } + + public WorldGenerator getRandomWorldGenForGrass(Random rand) + { + return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + super.decorate(worldIn, rand, pos); + int i = rand.nextInt(16) + 8; + int j = rand.nextInt(16) + 8; + int k = rand.nextInt(worldIn.getHeight(pos.add(i, 0, j)).getY() * 2); + (new WorldGenMelon()).generate(worldIn, rand, pos.add(i, k, j)); + WorldGenVines worldgenvines = new WorldGenVines(); + + for (j = 0; j < 50; ++j) + { + k = rand.nextInt(16) + 8; + int l = 128; + int i1 = rand.nextInt(16) + 8; + worldgenvines.generate(worldIn, rand, pos.add(k, 128, i1)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java new file mode 100644 index 0000000..39f0766 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java @@ -0,0 +1,335 @@ +package net.minecraft.world.biome; + +import java.util.Arrays; +import java.util.Random; +import net.minecraft.block.BlockColored; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockSand; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenMesa extends BiomeGenBase +{ + private IBlockState[] field_150621_aC; + private long field_150622_aD; + private NoiseGeneratorPerlin field_150623_aE; + private NoiseGeneratorPerlin field_150624_aF; + private NoiseGeneratorPerlin field_150625_aG; + private boolean field_150626_aH; + private boolean field_150620_aI; + + public BiomeGenMesa(int id, boolean p_i45380_2_, boolean p_i45380_3_) + { + super(id); + this.field_150626_aH = p_i45380_2_; + this.field_150620_aI = p_i45380_3_; + this.setDisableRain(); + this.setTemperatureRainfall(2.0F, 0.0F); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); + this.fillerBlock = Blocks.stained_hardened_clay.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 20; + this.theBiomeDecorator.reedsPerChunk = 3; + this.theBiomeDecorator.cactiPerChunk = 5; + this.theBiomeDecorator.flowersPerChunk = 0; + this.spawnableCreatureList.clear(); + + if (p_i45380_3_) + { + this.theBiomeDecorator.treesPerChunk = 5; + } + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return this.worldGeneratorTrees; + } + + public int getFoliageColorAtPos(BlockPos pos) + { + return 10387789; + } + + public int getGrassColorAtPos(BlockPos pos) + { + return 9470285; + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + super.decorate(worldIn, rand, pos); + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + if (this.field_150621_aC == null || this.field_150622_aD != worldIn.getSeed()) + { + this.func_150619_a(worldIn.getSeed()); + } + + if (this.field_150623_aE == null || this.field_150624_aF == null || this.field_150622_aD != worldIn.getSeed()) + { + Random random = new Random(this.field_150622_aD); + this.field_150623_aE = new NoiseGeneratorPerlin(random, 4); + this.field_150624_aF = new NoiseGeneratorPerlin(random, 1); + } + + this.field_150622_aD = worldIn.getSeed(); + double d4 = 0.0D; + + if (this.field_150626_aH) + { + int i = (x & -16) + (z & 15); + int j = (z & -16) + (x & 15); + double d0 = Math.min(Math.abs(noiseVal), this.field_150623_aE.func_151601_a((double)i * 0.25D, (double)j * 0.25D)); + + if (d0 > 0.0D) + { + double d1 = 0.001953125D; + double d2 = Math.abs(this.field_150624_aF.func_151601_a((double)i * d1, (double)j * d1)); + d4 = d0 * d0 * 2.5D; + double d3 = Math.ceil(d2 * 50.0D) + 14.0D; + + if (d4 > d3) + { + d4 = d3; + } + + d4 = d4 + 64.0D; + } + } + + int j1 = x & 15; + int k1 = z & 15; + int l1 = worldIn.getSeaLevel(); + IBlockState iblockstate = Blocks.stained_hardened_clay.getDefaultState(); + IBlockState iblockstate3 = this.fillerBlock; + int k = (int)(noiseVal / 3.0D + 3.0D + rand.nextDouble() * 0.25D); + boolean flag = Math.cos(noiseVal / 3.0D * Math.PI) > 0.0D; + int l = -1; + boolean flag1 = false; + + for (int i1 = 255; i1 >= 0; --i1) + { + if (chunkPrimerIn.getBlockState(k1, i1, j1).getBlock().getMaterial() == Material.air && i1 < (int)d4) + { + chunkPrimerIn.setBlockState(k1, i1, j1, Blocks.stone.getDefaultState()); + } + + if (i1 <= rand.nextInt(5)) + { + chunkPrimerIn.setBlockState(k1, i1, j1, Blocks.bedrock.getDefaultState()); + } + else + { + IBlockState iblockstate1 = chunkPrimerIn.getBlockState(k1, i1, j1); + + if (iblockstate1.getBlock().getMaterial() == Material.air) + { + l = -1; + } + else if (iblockstate1.getBlock() == Blocks.stone) + { + if (l == -1) + { + flag1 = false; + + if (k <= 0) + { + iblockstate = null; + iblockstate3 = Blocks.stone.getDefaultState(); + } + else if (i1 >= l1 - 4 && i1 <= l1 + 1) + { + iblockstate = Blocks.stained_hardened_clay.getDefaultState(); + iblockstate3 = this.fillerBlock; + } + + if (i1 < l1 && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air)) + { + iblockstate = Blocks.water.getDefaultState(); + } + + l = k + Math.max(0, i1 - l1); + + if (i1 < l1 - 1) + { + chunkPrimerIn.setBlockState(k1, i1, j1, iblockstate3); + + if (iblockstate3.getBlock() == Blocks.stained_hardened_clay) + { + chunkPrimerIn.setBlockState(k1, i1, j1, iblockstate3.getBlock().getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE)); + } + } + else if (this.field_150620_aI && i1 > 86 + k * 2) + { + if (flag) + { + chunkPrimerIn.setBlockState(k1, i1, j1, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT)); + } + else + { + chunkPrimerIn.setBlockState(k1, i1, j1, Blocks.grass.getDefaultState()); + } + } + else if (i1 <= l1 + 3 + k) + { + chunkPrimerIn.setBlockState(k1, i1, j1, this.topBlock); + flag1 = true; + } + else + { + IBlockState iblockstate4; + + if (i1 >= 64 && i1 <= 127) + { + if (flag) + { + iblockstate4 = Blocks.hardened_clay.getDefaultState(); + } + else + { + iblockstate4 = this.func_180629_a(x, i1, z); + } + } + else + { + iblockstate4 = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE); + } + + chunkPrimerIn.setBlockState(k1, i1, j1, iblockstate4); + } + } + else if (l > 0) + { + --l; + + if (flag1) + { + chunkPrimerIn.setBlockState(k1, i1, j1, Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE)); + } + else + { + IBlockState iblockstate2 = this.func_180629_a(x, i1, z); + chunkPrimerIn.setBlockState(k1, i1, j1, iblockstate2); + } + } + } + } + } + } + + private void func_150619_a(long p_150619_1_) + { + this.field_150621_aC = new IBlockState[64]; + Arrays.fill(this.field_150621_aC, Blocks.hardened_clay.getDefaultState()); + Random random = new Random(p_150619_1_); + this.field_150625_aG = new NoiseGeneratorPerlin(random, 1); + + for (int l1 = 0; l1 < 64; ++l1) + { + l1 += random.nextInt(5) + 1; + + if (l1 < 64) + { + this.field_150621_aC[l1] = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.ORANGE); + } + } + + int i2 = random.nextInt(4) + 2; + + for (int i = 0; i < i2; ++i) + { + int j = random.nextInt(3) + 1; + int k = random.nextInt(64); + + for (int l = 0; k + l < 64 && l < j; ++l) + { + this.field_150621_aC[k + l] = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.YELLOW); + } + } + + int j2 = random.nextInt(4) + 2; + + for (int k2 = 0; k2 < j2; ++k2) + { + int i3 = random.nextInt(3) + 2; + int l3 = random.nextInt(64); + + for (int i1 = 0; l3 + i1 < 64 && i1 < i3; ++i1) + { + this.field_150621_aC[l3 + i1] = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.BROWN); + } + } + + int l2 = random.nextInt(4) + 2; + + for (int j3 = 0; j3 < l2; ++j3) + { + int i4 = random.nextInt(3) + 1; + int k4 = random.nextInt(64); + + for (int j1 = 0; k4 + j1 < 64 && j1 < i4; ++j1) + { + this.field_150621_aC[k4 + j1] = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.RED); + } + } + + int k3 = random.nextInt(3) + 3; + int j4 = 0; + + for (int l4 = 0; l4 < k3; ++l4) + { + int i5 = 1; + j4 += random.nextInt(16) + 4; + + for (int k1 = 0; j4 + k1 < 64 && k1 < i5; ++k1) + { + this.field_150621_aC[j4 + k1] = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.WHITE); + + if (j4 + k1 > 1 && random.nextBoolean()) + { + this.field_150621_aC[j4 + k1 - 1] = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.SILVER); + } + + if (j4 + k1 < 63 && random.nextBoolean()) + { + this.field_150621_aC[j4 + k1 + 1] = Blocks.stained_hardened_clay.getDefaultState().withProperty(BlockColored.COLOR, EnumDyeColor.SILVER); + } + } + } + } + + private IBlockState func_180629_a(int p_180629_1_, int p_180629_2_, int p_180629_3_) + { + int i = (int)Math.round(this.field_150625_aG.func_151601_a((double)p_180629_1_ * 1.0D / 512.0D, (double)p_180629_1_ * 1.0D / 512.0D) * 2.0D); + return this.field_150621_aC[(p_180629_2_ + i + 64) % 64]; + } + + protected BiomeGenBase createMutatedBiome(int p_180277_1_) + { + boolean flag = this.biomeID == BiomeGenBase.mesa.biomeID; + BiomeGenMesa biomegenmesa = new BiomeGenMesa(p_180277_1_, flag, this.field_150620_aI); + + if (!flag) + { + biomegenmesa.setHeight(height_LowHills); + biomegenmesa.setBiomeName(this.biomeName + " M"); + } + else + { + biomegenmesa.setBiomeName(this.biomeName + " (Bryce)"); + } + + biomegenmesa.func_150557_a(this.color, true); + return biomegenmesa; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java new file mode 100644 index 0000000..9289e3d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java @@ -0,0 +1,22 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.init.Blocks; + +public class BiomeGenMushroomIsland extends BiomeGenBase +{ + public BiomeGenMushroomIsland(int id) + { + super(id); + this.theBiomeDecorator.treesPerChunk = -100; + this.theBiomeDecorator.flowersPerChunk = -100; + this.theBiomeDecorator.grassPerChunk = -100; + this.theBiomeDecorator.mushroomsPerChunk = 1; + this.theBiomeDecorator.bigMushroomsPerChunk = 1; + this.topBlock = Blocks.mycelium.getDefaultState(); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java new file mode 100644 index 0000000..1f7e2c0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java @@ -0,0 +1,84 @@ +package net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import java.util.Random; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenMutated extends BiomeGenBase +{ + protected BiomeGenBase baseBiome; + + public BiomeGenMutated(int id, BiomeGenBase biome) + { + super(id); + this.baseBiome = biome; + this.func_150557_a(biome.color, true); + this.biomeName = biome.biomeName + " M"; + this.topBlock = biome.topBlock; + this.fillerBlock = biome.fillerBlock; + this.fillerBlockMetadata = biome.fillerBlockMetadata; + this.minHeight = biome.minHeight; + this.maxHeight = biome.maxHeight; + this.temperature = biome.temperature; + this.rainfall = biome.rainfall; + this.waterColorMultiplier = biome.waterColorMultiplier; + this.enableSnow = biome.enableSnow; + this.enableRain = biome.enableRain; + this.spawnableCreatureList = Lists.newArrayList(biome.spawnableCreatureList); + this.spawnableMonsterList = Lists.newArrayList(biome.spawnableMonsterList); + this.spawnableCaveCreatureList = Lists.newArrayList(biome.spawnableCaveCreatureList); + this.spawnableWaterCreatureList = Lists.newArrayList(biome.spawnableWaterCreatureList); + this.temperature = biome.temperature; + this.rainfall = biome.rainfall; + this.minHeight = biome.minHeight + 0.1F; + this.maxHeight = biome.maxHeight + 0.2F; + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + this.baseBiome.theBiomeDecorator.decorate(worldIn, rand, this, pos); + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + this.baseBiome.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal); + } + + public float getSpawningChance() + { + return this.baseBiome.getSpawningChance(); + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return this.baseBiome.genBigTreeChance(rand); + } + + public int getFoliageColorAtPos(BlockPos pos) + { + return this.baseBiome.getFoliageColorAtPos(pos); + } + + public int getGrassColorAtPos(BlockPos pos) + { + return this.baseBiome.getGrassColorAtPos(pos); + } + + public Class getBiomeClass() + { + return this.baseBiome.getBiomeClass(); + } + + public boolean isEqualTo(BiomeGenBase biome) + { + return this.baseBiome.isEqualTo(biome); + } + + public BiomeGenBase.TempCategory getTempCategory() + { + return this.baseBiome.getTempCategory(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java new file mode 100644 index 0000000..7137455 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java @@ -0,0 +1,24 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; + +public class BiomeGenOcean extends BiomeGenBase +{ + public BiomeGenOcean(int id) + { + super(id); + this.spawnableCreatureList.clear(); + } + + public BiomeGenBase.TempCategory getTempCategory() + { + return BiomeGenBase.TempCategory.OCEAN; + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + super.genTerrainBlocks(worldIn, rand, chunkPrimerIn, x, z, noiseVal); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java new file mode 100644 index 0000000..cab0ba2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java @@ -0,0 +1,109 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class BiomeGenPlains extends BiomeGenBase +{ + protected boolean field_150628_aC; + + protected BiomeGenPlains(int id) + { + super(id); + this.setTemperatureRainfall(0.8F, 0.4F); + this.setHeight(height_LowPlains); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 2, 6)); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + } + + public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) + { + double d0 = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() / 200.0D, (double)pos.getZ() / 200.0D); + + if (d0 < -0.8D) + { + int j = rand.nextInt(4); + + switch (j) + { + case 0: + return BlockFlower.EnumFlowerType.ORANGE_TULIP; + + case 1: + return BlockFlower.EnumFlowerType.RED_TULIP; + + case 2: + return BlockFlower.EnumFlowerType.PINK_TULIP; + + case 3: + default: + return BlockFlower.EnumFlowerType.WHITE_TULIP; + } + } + else if (rand.nextInt(3) > 0) + { + int i = rand.nextInt(3); + return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); + } + else + { + return BlockFlower.EnumFlowerType.DANDELION; + } + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + double d0 = GRASS_COLOR_NOISE.func_151601_a((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D); + + if (d0 < -0.8D) + { + this.theBiomeDecorator.flowersPerChunk = 15; + this.theBiomeDecorator.grassPerChunk = 5; + } + else + { + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS); + + for (int i = 0; i < 7; ++i) + { + int j = rand.nextInt(16) + 8; + int k = rand.nextInt(16) + 8; + int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k)); + } + } + + if (this.field_150628_aC) + { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER); + + for (int i1 = 0; i1 < 10; ++i1) + { + int j1 = rand.nextInt(16) + 8; + int k1 = rand.nextInt(16) + 8; + int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1)); + } + } + + super.decorate(worldIn, rand, pos); + } + + protected BiomeGenBase createMutatedBiome(int p_180277_1_) + { + BiomeGenPlains biomegenplains = new BiomeGenPlains(p_180277_1_); + biomegenplains.setBiomeName("Sunflower Plains"); + biomegenplains.field_150628_aC = true; + biomegenplains.setColor(9286496); + biomegenplains.field_150609_ah = 14273354; + return biomegenplains; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java new file mode 100644 index 0000000..da2d3b6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java @@ -0,0 +1,10 @@ +package net.minecraft.world.biome; + +public class BiomeGenRiver extends BiomeGenBase +{ + public BiomeGenRiver(int id) + { + super(id); + this.spawnableCreatureList.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java new file mode 100644 index 0000000..9d84783 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java @@ -0,0 +1,89 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; + +public class BiomeGenSavanna extends BiomeGenBase +{ + private static final WorldGenSavannaTree field_150627_aC = new WorldGenSavannaTree(false); + + protected BiomeGenSavanna(int id) + { + super(id); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 1, 2, 6)); + this.theBiomeDecorator.treesPerChunk = 1; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 20; + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return (WorldGenAbstractTree)(rand.nextInt(5) > 0 ? field_150627_aC : this.worldGeneratorTrees); + } + + protected BiomeGenBase createMutatedBiome(int p_180277_1_) + { + BiomeGenBase biomegenbase = new BiomeGenSavanna.Mutated(p_180277_1_, this); + biomegenbase.temperature = (this.temperature + 1.0F) * 0.5F; + biomegenbase.minHeight = this.minHeight * 0.5F + 0.3F; + biomegenbase.maxHeight = this.maxHeight * 0.5F + 1.2F; + return biomegenbase; + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS); + + for (int i = 0; i < 7; ++i) + { + int j = rand.nextInt(16) + 8; + int k = rand.nextInt(16) + 8; + int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k)); + } + + super.decorate(worldIn, rand, pos); + } + + public static class Mutated extends BiomeGenMutated + { + public Mutated(int p_i45382_1_, BiomeGenBase p_i45382_2_) + { + super(p_i45382_1_, p_i45382_2_); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 2; + this.theBiomeDecorator.grassPerChunk = 5; + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + this.topBlock = Blocks.grass.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + + if (noiseVal > 1.75D) + { + this.topBlock = Blocks.stone.getDefaultState(); + this.fillerBlock = Blocks.stone.getDefaultState(); + } + else if (noiseVal > -0.5D) + { + this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT); + } + + this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + this.theBiomeDecorator.decorate(worldIn, rand, this, pos); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java new file mode 100644 index 0000000..be266ce --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java @@ -0,0 +1,65 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenIcePath; +import net.minecraft.world.gen.feature.WorldGenIceSpike; +import net.minecraft.world.gen.feature.WorldGenTaiga2; + +public class BiomeGenSnow extends BiomeGenBase +{ + private boolean field_150615_aC; + private WorldGenIceSpike field_150616_aD = new WorldGenIceSpike(); + private WorldGenIcePath field_150617_aE = new WorldGenIcePath(4); + + public BiomeGenSnow(int id, boolean p_i45378_2_) + { + super(id); + this.field_150615_aC = p_i45378_2_; + + if (p_i45378_2_) + { + this.topBlock = Blocks.snow.getDefaultState(); + } + + this.spawnableCreatureList.clear(); + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + if (this.field_150615_aC) + { + for (int i = 0; i < 3; ++i) + { + int j = rand.nextInt(16) + 8; + int k = rand.nextInt(16) + 8; + this.field_150616_aD.generate(worldIn, rand, worldIn.getHeight(pos.add(j, 0, k))); + } + + for (int l = 0; l < 2; ++l) + { + int i1 = rand.nextInt(16) + 8; + int j1 = rand.nextInt(16) + 8; + this.field_150617_aE.generate(worldIn, rand, worldIn.getHeight(pos.add(i1, 0, j1))); + } + } + + super.decorate(worldIn, rand, pos); + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return new WorldGenTaiga2(false); + } + + protected BiomeGenBase createMutatedBiome(int p_180277_1_) + { + BiomeGenBase biomegenbase = (new BiomeGenSnow(p_180277_1_, true)).func_150557_a(13828095, true).setBiomeName(this.biomeName + " Spikes").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setHeight(new BiomeGenBase.Height(this.minHeight + 0.1F, this.maxHeight + 0.1F)); + biomegenbase.minHeight = this.minHeight + 0.3F; + biomegenbase.maxHeight = this.maxHeight + 0.4F; + return biomegenbase; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java new file mode 100644 index 0000000..0012aac --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java @@ -0,0 +1,18 @@ +package net.minecraft.world.biome; + +import net.minecraft.init.Blocks; + +public class BiomeGenStoneBeach extends BiomeGenBase +{ + public BiomeGenStoneBeach(int id) + { + super(id); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.stone.getDefaultState(); + this.fillerBlock = Blocks.stone.getDefaultState(); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java new file mode 100644 index 0000000..c1d52c0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java @@ -0,0 +1,83 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenSwamp extends BiomeGenBase +{ + protected BiomeGenSwamp(int id) + { + super(id); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 1; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 8; + this.theBiomeDecorator.reedsPerChunk = 10; + this.theBiomeDecorator.clayPerChunk = 1; + this.theBiomeDecorator.waterlilyPerChunk = 4; + this.theBiomeDecorator.sandPerChunk2 = 0; + this.theBiomeDecorator.sandPerChunk = 0; + this.theBiomeDecorator.grassPerChunk = 5; + this.waterColorMultiplier = 14745518; + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1)); + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return this.worldGeneratorSwamp; + } + + public int getGrassColorAtPos(BlockPos pos) + { + double d0 = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return d0 < -0.1D ? 5011004 : 6975545; + } + + public int getFoliageColorAtPos(BlockPos pos) + { + return 6975545; + } + + public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) + { + return BlockFlower.EnumFlowerType.BLUE_ORCHID; + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + double d0 = GRASS_COLOR_NOISE.func_151601_a((double)x * 0.25D, (double)z * 0.25D); + + if (d0 > 0.0D) + { + int i = x & 15; + int j = z & 15; + + for (int k = 255; k >= 0; --k) + { + if (chunkPrimerIn.getBlockState(j, k, i).getBlock().getMaterial() != Material.air) + { + if (k == 62 && chunkPrimerIn.getBlockState(j, k, i).getBlock() != Blocks.water) + { + chunkPrimerIn.setBlockState(j, k, i, Blocks.water.getDefaultState()); + + if (d0 < 0.12D) + { + chunkPrimerIn.setBlockState(j, k + 1, i, Blocks.waterlily.getDefaultState()); + } + } + + break; + } + } + } + + this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java new file mode 100644 index 0000000..4701164 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java @@ -0,0 +1,111 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBlockBlob; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenTaiga1; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenTaiga extends BiomeGenBase +{ + private static final WorldGenTaiga1 field_150639_aC = new WorldGenTaiga1(); + private static final WorldGenTaiga2 field_150640_aD = new WorldGenTaiga2(false); + private static final WorldGenMegaPineTree field_150641_aE = new WorldGenMegaPineTree(false, false); + private static final WorldGenMegaPineTree field_150642_aF = new WorldGenMegaPineTree(false, true); + private static final WorldGenBlockBlob field_150643_aG = new WorldGenBlockBlob(Blocks.mossy_cobblestone, 0); + private int field_150644_aH; + + public BiomeGenTaiga(int id, int p_i45385_2_) + { + super(id); + this.field_150644_aH = p_i45385_2_; + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4)); + this.theBiomeDecorator.treesPerChunk = 10; + + if (p_i45385_2_ != 1 && p_i45385_2_ != 2) + { + this.theBiomeDecorator.grassPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 1; + } + else + { + this.theBiomeDecorator.grassPerChunk = 7; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 3; + } + } + + public WorldGenAbstractTree genBigTreeChance(Random rand) + { + return (WorldGenAbstractTree)((this.field_150644_aH == 1 || this.field_150644_aH == 2) && rand.nextInt(3) == 0 ? (this.field_150644_aH != 2 && rand.nextInt(13) != 0 ? field_150641_aE : field_150642_aF) : (rand.nextInt(3) == 0 ? field_150639_aC : field_150640_aD)); + } + + public WorldGenerator getRandomWorldGenForGrass(Random rand) + { + return rand.nextInt(5) > 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS); + } + + public void decorate(World worldIn, Random rand, BlockPos pos) + { + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) + { + int i = rand.nextInt(3); + + for (int j = 0; j < i; ++j) + { + int k = rand.nextInt(16) + 8; + int l = rand.nextInt(16) + 8; + BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l)); + field_150643_aG.generate(worldIn, rand, blockpos); + } + } + + DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN); + + for (int i1 = 0; i1 < 7; ++i1) + { + int j1 = rand.nextInt(16) + 8; + int k1 = rand.nextInt(16) + 8; + int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32); + DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1)); + } + + super.decorate(worldIn, rand, pos); + } + + public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) + { + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) + { + this.topBlock = Blocks.grass.getDefaultState(); + this.fillerBlock = Blocks.dirt.getDefaultState(); + + if (noiseVal > 1.75D) + { + this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT); + } + else if (noiseVal > -0.95D) + { + this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL); + } + } + + this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal); + } + + protected BiomeGenBase createMutatedBiome(int p_180277_1_) + { + return this.biomeID == BiomeGenBase.megaTaiga.biomeID ? (new BiomeGenTaiga(p_180277_1_, 2)).func_150557_a(5858897, true).setBiomeName("Mega Spruce Taiga").setFillerBlockMetadata(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(new BiomeGenBase.Height(this.minHeight, this.maxHeight)) : super.createMutatedBiome(p_180277_1_); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/WorldChunkManager.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/WorldChunkManager.java new file mode 100644 index 0000000..2607dd3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/WorldChunkManager.java @@ -0,0 +1,249 @@ +package net.minecraft.world.biome; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ReportedException; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; + +public class WorldChunkManager +{ + private GenLayer genBiomes; + private GenLayer biomeIndexLayer; + private BiomeCache biomeCache; + private List biomesToSpawnIn; + private String generatorOptions; + + protected WorldChunkManager() + { + this.biomeCache = new BiomeCache(this); + this.generatorOptions = ""; + this.biomesToSpawnIn = Lists.newArrayList(); + this.biomesToSpawnIn.add(BiomeGenBase.forest); + this.biomesToSpawnIn.add(BiomeGenBase.plains); + this.biomesToSpawnIn.add(BiomeGenBase.taiga); + this.biomesToSpawnIn.add(BiomeGenBase.taigaHills); + this.biomesToSpawnIn.add(BiomeGenBase.forestHills); + this.biomesToSpawnIn.add(BiomeGenBase.jungle); + this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); + } + + public WorldChunkManager(long seed, WorldType worldTypeIn, String options) + { + this(); + this.generatorOptions = options; + GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, worldTypeIn, options); + this.genBiomes = agenlayer[0]; + this.biomeIndexLayer = agenlayer[1]; + } + + public WorldChunkManager(World worldIn) + { + this(worldIn.getSeed(), worldIn.getWorldInfo().getTerrainType(), worldIn.getWorldInfo().getGeneratorOptions()); + } + + public List getBiomesToSpawnIn() + { + return this.biomesToSpawnIn; + } + + public BiomeGenBase getBiomeGenerator(BlockPos pos) + { + return this.getBiomeGenerator(pos, (BiomeGenBase)null); + } + + public BiomeGenBase getBiomeGenerator(BlockPos pos, BiomeGenBase biomeGenBaseIn) + { + return this.biomeCache.func_180284_a(pos.getX(), pos.getZ(), biomeGenBaseIn); + } + + public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) + { + IntCache.resetIntCache(); + + if (listToReuse == null || listToReuse.length < width * length) + { + listToReuse = new float[width * length]; + } + + int[] aint = this.biomeIndexLayer.getInts(x, z, width, length); + + for (int i = 0; i < width * length; ++i) + { + try + { + float f = (float)BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad).getIntRainfall() / 65536.0F; + + if (f > 1.0F) + { + f = 1.0F; + } + + listToReuse[i] = f; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock"); + crashreportcategory.addCrashSection("biome id", Integer.valueOf(i)); + crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length)); + crashreportcategory.addCrashSection("x", Integer.valueOf(x)); + crashreportcategory.addCrashSection("z", Integer.valueOf(z)); + crashreportcategory.addCrashSection("w", Integer.valueOf(width)); + crashreportcategory.addCrashSection("h", Integer.valueOf(length)); + throw new ReportedException(crashreport); + } + } + + return listToReuse; + } + + public float getTemperatureAtHeight(float p_76939_1_, int p_76939_2_) + { + return p_76939_1_; + } + + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int x, int z, int width, int height) + { + IntCache.resetIntCache(); + + if (biomes == null || biomes.length < width * height) + { + biomes = new BiomeGenBase[width * height]; + } + + int[] aint = this.genBiomes.getInts(x, z, width, height); + + try + { + for (int i = 0; i < width * height; ++i) + { + biomes[i] = BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad); + } + + return biomes; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock"); + crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(biomes.length)); + crashreportcategory.addCrashSection("x", Integer.valueOf(x)); + crashreportcategory.addCrashSection("z", Integer.valueOf(z)); + crashreportcategory.addCrashSection("w", Integer.valueOf(width)); + crashreportcategory.addCrashSection("h", Integer.valueOf(height)); + throw new ReportedException(crashreport); + } + } + + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) + { + return this.getBiomeGenAt(oldBiomeList, x, z, width, depth, true); + } + + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int z, int width, int length, boolean cacheFlag) + { + IntCache.resetIntCache(); + + if (listToReuse == null || listToReuse.length < width * length) + { + listToReuse = new BiomeGenBase[width * length]; + } + + if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (z & 15) == 0) + { + BiomeGenBase[] abiomegenbase = this.biomeCache.getCachedBiomes(x, z); + System.arraycopy(abiomegenbase, 0, listToReuse, 0, width * length); + return listToReuse; + } + else + { + int[] aint = this.biomeIndexLayer.getInts(x, z, width, length); + + for (int i = 0; i < width * length; ++i) + { + listToReuse[i] = BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad); + } + + return listToReuse; + } + } + + public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List p_76940_4_) + { + IntCache.resetIntCache(); + int i = p_76940_1_ - p_76940_3_ >> 2; + int j = p_76940_2_ - p_76940_3_ >> 2; + int k = p_76940_1_ + p_76940_3_ >> 2; + int l = p_76940_2_ + p_76940_3_ >> 2; + int i1 = k - i + 1; + int j1 = l - j + 1; + int[] aint = this.genBiomes.getInts(i, j, i1, j1); + + try + { + for (int k1 = 0; k1 < i1 * j1; ++k1) + { + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k1]); + + if (!p_76940_4_.contains(biomegenbase)) + { + return false; + } + } + + return true; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer"); + crashreportcategory.addCrashSection("Layer", this.genBiomes.toString()); + crashreportcategory.addCrashSection("x", Integer.valueOf(p_76940_1_)); + crashreportcategory.addCrashSection("z", Integer.valueOf(p_76940_2_)); + crashreportcategory.addCrashSection("radius", Integer.valueOf(p_76940_3_)); + crashreportcategory.addCrashSection("allowed", p_76940_4_); + throw new ReportedException(crashreport); + } + } + + public BlockPos findBiomePosition(int x, int z, int range, List biomes, Random random) + { + IntCache.resetIntCache(); + int i = x - range >> 2; + int j = z - range >> 2; + int k = x + range >> 2; + int l = z + range >> 2; + int i1 = k - i + 1; + int j1 = l - j + 1; + int[] aint = this.genBiomes.getInts(i, j, i1, j1); + BlockPos blockpos = null; + int k1 = 0; + + for (int l1 = 0; l1 < i1 * j1; ++l1) + { + int i2 = i + l1 % i1 << 2; + int j2 = j + l1 / i1 << 2; + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[l1]); + + if (biomes.contains(biomegenbase) && (blockpos == null || random.nextInt(k1 + 1) == 0)) + { + blockpos = new BlockPos(i2, 0, j2); + ++k1; + } + } + + return blockpos; + } + + public void cleanupCache() + { + this.biomeCache.cleanupCache(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java b/Client-1.8.9/src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java new file mode 100644 index 0000000..dab9d9b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java @@ -0,0 +1,71 @@ +package net.minecraft.world.biome; + +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import net.minecraft.util.BlockPos; + +public class WorldChunkManagerHell extends WorldChunkManager +{ + private BiomeGenBase biomeGenerator; + private float rainfall; + + public WorldChunkManagerHell(BiomeGenBase p_i45374_1_, float p_i45374_2_) + { + this.biomeGenerator = p_i45374_1_; + this.rainfall = p_i45374_2_; + } + + public BiomeGenBase getBiomeGenerator(BlockPos pos) + { + return this.biomeGenerator; + } + + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int x, int z, int width, int height) + { + if (biomes == null || biomes.length < width * height) + { + biomes = new BiomeGenBase[width * height]; + } + + Arrays.fill(biomes, 0, width * height, this.biomeGenerator); + return biomes; + } + + public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length) + { + if (listToReuse == null || listToReuse.length < width * length) + { + listToReuse = new float[width * length]; + } + + Arrays.fill(listToReuse, 0, width * length, this.rainfall); + return listToReuse; + } + + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] oldBiomeList, int x, int z, int width, int depth) + { + if (oldBiomeList == null || oldBiomeList.length < width * depth) + { + oldBiomeList = new BiomeGenBase[width * depth]; + } + + Arrays.fill(oldBiomeList, 0, width * depth, this.biomeGenerator); + return oldBiomeList; + } + + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] listToReuse, int x, int z, int width, int length, boolean cacheFlag) + { + return this.loadBlockGeneratorData(listToReuse, x, z, width, length); + } + + public BlockPos findBiomePosition(int x, int z, int range, List biomes, Random random) + { + return biomes.contains(this.biomeGenerator) ? new BlockPos(x - range + random.nextInt(range * 2 + 1), 0, z - range + random.nextInt(range * 2 + 1)) : null; + } + + public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List p_76940_4_) + { + return p_76940_4_.contains(this.biomeGenerator); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/border/EnumBorderStatus.java b/Client-1.8.9/src/main/java/net/minecraft/world/border/EnumBorderStatus.java new file mode 100644 index 0000000..6b141a2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/border/EnumBorderStatus.java @@ -0,0 +1,20 @@ +package net.minecraft.world.border; + +public enum EnumBorderStatus +{ + GROWING(4259712), + SHRINKING(16724016), + STATIONARY(2138367); + + private final int id; + + private EnumBorderStatus(int id) + { + this.id = id; + } + + public int getID() + { + return this.id; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/border/IBorderListener.java b/Client-1.8.9/src/main/java/net/minecraft/world/border/IBorderListener.java new file mode 100644 index 0000000..15e5aff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/border/IBorderListener.java @@ -0,0 +1,18 @@ +package net.minecraft.world.border; + +public interface IBorderListener +{ + void onSizeChanged(WorldBorder border, double newSize); + + void onTransitionStarted(WorldBorder border, double oldSize, double newSize, long time); + + void onCenterChanged(WorldBorder border, double x, double z); + + void onWarningTimeChanged(WorldBorder border, int newTime); + + void onWarningDistanceChanged(WorldBorder border, int newDistance); + + void onDamageAmountChanged(WorldBorder border, double newAmount); + + void onDamageBufferChanged(WorldBorder border, double newSize); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/border/WorldBorder.java b/Client-1.8.9/src/main/java/net/minecraft/world/border/WorldBorder.java new file mode 100644 index 0000000..82d7900 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/border/WorldBorder.java @@ -0,0 +1,277 @@ +package net.minecraft.world.border; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.ChunkCoordIntPair; + +public class WorldBorder +{ + private final List listeners = Lists.newArrayList(); + private double centerX = 0.0D; + private double centerZ = 0.0D; + private double startDiameter = 6.0E7D; + private double endDiameter; + private long endTime; + private long startTime; + private int worldSize; + private double damageAmount; + private double damageBuffer; + private int warningTime; + private int warningDistance; + + public WorldBorder() + { + this.endDiameter = this.startDiameter; + this.worldSize = 29999984; + this.damageAmount = 0.2D; + this.damageBuffer = 5.0D; + this.warningTime = 15; + this.warningDistance = 5; + } + + public boolean contains(BlockPos pos) + { + return (double)(pos.getX() + 1) > this.minX() && (double)pos.getX() < this.maxX() && (double)(pos.getZ() + 1) > this.minZ() && (double)pos.getZ() < this.maxZ(); + } + + public boolean contains(ChunkCoordIntPair range) + { + return (double)range.getXEnd() > this.minX() && (double)range.getXStart() < this.maxX() && (double)range.getZEnd() > this.minZ() && (double)range.getZStart() < this.maxZ(); + } + + public boolean contains(AxisAlignedBB bb) + { + return bb.maxX > this.minX() && bb.minX < this.maxX() && bb.maxZ > this.minZ() && bb.minZ < this.maxZ(); + } + + public double getClosestDistance(Entity entityIn) + { + return this.getClosestDistance(entityIn.posX, entityIn.posZ); + } + + public double getClosestDistance(double x, double z) + { + double d0 = z - this.minZ(); + double d1 = this.maxZ() - z; + double d2 = x - this.minX(); + double d3 = this.maxX() - x; + double d4 = Math.min(d2, d3); + d4 = Math.min(d4, d0); + return Math.min(d4, d1); + } + + public EnumBorderStatus getStatus() + { + return this.endDiameter < this.startDiameter ? EnumBorderStatus.SHRINKING : (this.endDiameter > this.startDiameter ? EnumBorderStatus.GROWING : EnumBorderStatus.STATIONARY); + } + + public double minX() + { + double d0 = this.getCenterX() - this.getDiameter() / 2.0D; + + if (d0 < (double)(-this.worldSize)) + { + d0 = (double)(-this.worldSize); + } + + return d0; + } + + public double minZ() + { + double d0 = this.getCenterZ() - this.getDiameter() / 2.0D; + + if (d0 < (double)(-this.worldSize)) + { + d0 = (double)(-this.worldSize); + } + + return d0; + } + + public double maxX() + { + double d0 = this.getCenterX() + this.getDiameter() / 2.0D; + + if (d0 > (double)this.worldSize) + { + d0 = (double)this.worldSize; + } + + return d0; + } + + public double maxZ() + { + double d0 = this.getCenterZ() + this.getDiameter() / 2.0D; + + if (d0 > (double)this.worldSize) + { + d0 = (double)this.worldSize; + } + + return d0; + } + + public double getCenterX() + { + return this.centerX; + } + + public double getCenterZ() + { + return this.centerZ; + } + + public void setCenter(double x, double z) + { + this.centerX = x; + this.centerZ = z; + + for (IBorderListener iborderlistener : this.getListeners()) + { + iborderlistener.onCenterChanged(this, x, z); + } + } + + public double getDiameter() + { + if (this.getStatus() != EnumBorderStatus.STATIONARY) + { + double d0 = (double)((float)(System.currentTimeMillis() - this.startTime) / (float)(this.endTime - this.startTime)); + + if (d0 < 1.0D) + { + return this.startDiameter + (this.endDiameter - this.startDiameter) * d0; + } + + this.setTransition(this.endDiameter); + } + + return this.startDiameter; + } + + public long getTimeUntilTarget() + { + return this.getStatus() != EnumBorderStatus.STATIONARY ? this.endTime - System.currentTimeMillis() : 0L; + } + + public double getTargetSize() + { + return this.endDiameter; + } + + public void setTransition(double newSize) + { + this.startDiameter = newSize; + this.endDiameter = newSize; + this.endTime = System.currentTimeMillis(); + this.startTime = this.endTime; + + for (IBorderListener iborderlistener : this.getListeners()) + { + iborderlistener.onSizeChanged(this, newSize); + } + } + + public void setTransition(double oldSize, double newSize, long time) + { + this.startDiameter = oldSize; + this.endDiameter = newSize; + this.startTime = System.currentTimeMillis(); + this.endTime = this.startTime + time; + + for (IBorderListener iborderlistener : this.getListeners()) + { + iborderlistener.onTransitionStarted(this, oldSize, newSize, time); + } + } + + protected List getListeners() + { + return Lists.newArrayList(this.listeners); + } + + public void addListener(IBorderListener listener) + { + this.listeners.add(listener); + } + + public void setSize(int size) + { + this.worldSize = size; + } + + public int getSize() + { + return this.worldSize; + } + + public double getDamageBuffer() + { + return this.damageBuffer; + } + + public void setDamageBuffer(double bufferSize) + { + this.damageBuffer = bufferSize; + + for (IBorderListener iborderlistener : this.getListeners()) + { + iborderlistener.onDamageBufferChanged(this, bufferSize); + } + } + + public double getDamageAmount() + { + return this.damageAmount; + } + + public void setDamageAmount(double newAmount) + { + this.damageAmount = newAmount; + + for (IBorderListener iborderlistener : this.getListeners()) + { + iborderlistener.onDamageAmountChanged(this, newAmount); + } + } + + public double getResizeSpeed() + { + return this.endTime == this.startTime ? 0.0D : Math.abs(this.startDiameter - this.endDiameter) / (double)(this.endTime - this.startTime); + } + + public int getWarningTime() + { + return this.warningTime; + } + + public void setWarningTime(int warningTime) + { + this.warningTime = warningTime; + + for (IBorderListener iborderlistener : this.getListeners()) + { + iborderlistener.onWarningTimeChanged(this, warningTime); + } + } + + public int getWarningDistance() + { + return this.warningDistance; + } + + public void setWarningDistance(int warningDistance) + { + this.warningDistance = warningDistance; + + for (IBorderListener iborderlistener : this.getListeners()) + { + iborderlistener.onWarningDistanceChanged(this, warningDistance); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/Chunk.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/Chunk.java new file mode 100644 index 0000000..52eaa2e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/Chunk.java @@ -0,0 +1,1581 @@ +package net.minecraft.world.chunk; + +import com.google.common.base.Predicate; +import com.google.common.collect.Maps; +import com.google.common.collect.Queues; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentLinkedQueue; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ClassInheritanceMultiMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.gen.ChunkProviderDebug; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Chunk +{ + private static final Logger logger = LogManager.getLogger(); + private final ExtendedBlockStorage[] storageArrays; + private final byte[] blockBiomeArray; + private final int[] precipitationHeightMap; + private final boolean[] updateSkylightColumns; + private boolean isChunkLoaded; + private final World worldObj; + private final int[] heightMap; + public final int xPosition; + public final int zPosition; + private boolean isGapLightingUpdated; + private final Map chunkTileEntityMap; + private final ClassInheritanceMultiMap[] entityLists; + private boolean isTerrainPopulated; + private boolean isLightPopulated; + private boolean field_150815_m; + private boolean isModified; + private boolean hasEntities; + private long lastSaveTime; + private int heightMapMinimum; + private long inhabitedTime; + private int queuedLightChecks; + private ConcurrentLinkedQueue tileEntityPosQueue; + + public Chunk(World worldIn, int x, int z) + { + this.storageArrays = new ExtendedBlockStorage[16]; + this.blockBiomeArray = new byte[256]; + this.precipitationHeightMap = new int[256]; + this.updateSkylightColumns = new boolean[256]; + this.chunkTileEntityMap = Maps.newHashMap(); + this.queuedLightChecks = 4096; + this.tileEntityPosQueue = Queues.newConcurrentLinkedQueue(); + this.entityLists = (ClassInheritanceMultiMap[])(new ClassInheritanceMultiMap[16]); + this.worldObj = worldIn; + this.xPosition = x; + this.zPosition = z; + this.heightMap = new int[256]; + + for (int i = 0; i < this.entityLists.length; ++i) + { + this.entityLists[i] = new ClassInheritanceMultiMap(Entity.class); + } + + Arrays.fill((int[])this.precipitationHeightMap, (int) - 999); + Arrays.fill(this.blockBiomeArray, (byte) - 1); + } + + public Chunk(World worldIn, ChunkPrimer primer, int x, int z) + { + this(worldIn, x, z); + int i = 256; + boolean flag = !worldIn.provider.getHasNoSky(); + + for (int j = 0; j < 16; ++j) + { + for (int k = 0; k < 16; ++k) + { + for (int l = 0; l < i; ++l) + { + int i1 = j * i * 16 | k * i | l; + IBlockState iblockstate = primer.getBlockState(i1); + + if (iblockstate.getBlock().getMaterial() != Material.air) + { + int j1 = l >> 4; + + if (this.storageArrays[j1] == null) + { + this.storageArrays[j1] = new ExtendedBlockStorage(j1 << 4, flag); + } + + this.storageArrays[j1].set(j, l & 15, k, iblockstate); + } + } + } + } + } + + public boolean isAtLocation(int x, int z) + { + return x == this.xPosition && z == this.zPosition; + } + + public int getHeight(BlockPos pos) + { + return this.getHeightValue(pos.getX() & 15, pos.getZ() & 15); + } + + public int getHeightValue(int x, int z) + { + return this.heightMap[z << 4 | x]; + } + + public int getTopFilledSegment() + { + for (int i = this.storageArrays.length - 1; i >= 0; --i) + { + if (this.storageArrays[i] != null) + { + return this.storageArrays[i].getYLocation(); + } + } + + return 0; + } + + public ExtendedBlockStorage[] getBlockStorageArray() + { + return this.storageArrays; + } + + protected void generateHeightMap() + { + int i = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int j = 0; j < 16; ++j) + { + for (int k = 0; k < 16; ++k) + { + this.precipitationHeightMap[j + (k << 4)] = -999; + + for (int l = i + 16; l > 0; --l) + { + Block block = this.getBlock0(j, l - 1, k); + + if (block.getLightOpacity() != 0) + { + this.heightMap[k << 4 | j] = l; + + if (l < this.heightMapMinimum) + { + this.heightMapMinimum = l; + } + + break; + } + } + } + } + + this.isModified = true; + } + + public void generateSkylightMap() + { + int i = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int j = 0; j < 16; ++j) + { + for (int k = 0; k < 16; ++k) + { + this.precipitationHeightMap[j + (k << 4)] = -999; + + for (int l = i + 16; l > 0; --l) + { + if (this.getBlockLightOpacity(j, l - 1, k) != 0) + { + this.heightMap[k << 4 | j] = l; + + if (l < this.heightMapMinimum) + { + this.heightMapMinimum = l; + } + + break; + } + } + + if (!this.worldObj.provider.getHasNoSky()) + { + int k1 = 15; + int i1 = i + 16 - 1; + + while (true) + { + int j1 = this.getBlockLightOpacity(j, i1, k); + + if (j1 == 0 && k1 != 15) + { + j1 = 1; + } + + k1 -= j1; + + if (k1 > 0) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[i1 >> 4]; + + if (extendedblockstorage != null) + { + extendedblockstorage.setExtSkylightValue(j, i1 & 15, k, k1); + this.worldObj.notifyLightSet(new BlockPos((this.xPosition << 4) + j, i1, (this.zPosition << 4) + k)); + } + } + + --i1; + + if (i1 <= 0 || k1 <= 0) + { + break; + } + } + } + } + } + + this.isModified = true; + } + + private void propagateSkylightOcclusion(int x, int z) + { + this.updateSkylightColumns[x + z * 16] = true; + this.isGapLightingUpdated = true; + } + + private void recheckGaps(boolean p_150803_1_) + { + this.worldObj.theProfiler.startSection("recheckGaps"); + + if (this.worldObj.isAreaLoaded(new BlockPos(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8), 16)) + { + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + if (this.updateSkylightColumns[i + j * 16]) + { + this.updateSkylightColumns[i + j * 16] = false; + int k = this.getHeightValue(i, j); + int l = this.xPosition * 16 + i; + int i1 = this.zPosition * 16 + j; + int j1 = Integer.MAX_VALUE; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + j1 = Math.min(j1, this.worldObj.getChunksLowestHorizon(l + enumfacing.getFrontOffsetX(), i1 + enumfacing.getFrontOffsetZ())); + } + + this.checkSkylightNeighborHeight(l, i1, j1); + + for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) + { + this.checkSkylightNeighborHeight(l + enumfacing1.getFrontOffsetX(), i1 + enumfacing1.getFrontOffsetZ(), k); + } + + if (p_150803_1_) + { + this.worldObj.theProfiler.endSection(); + return; + } + } + } + } + + this.isGapLightingUpdated = false; + } + + this.worldObj.theProfiler.endSection(); + } + + private void checkSkylightNeighborHeight(int x, int z, int maxValue) + { + int i = this.worldObj.getHeight(new BlockPos(x, 0, z)).getY(); + + if (i > maxValue) + { + this.updateSkylightNeighborHeight(x, z, maxValue, i + 1); + } + else if (i < maxValue) + { + this.updateSkylightNeighborHeight(x, z, i, maxValue + 1); + } + } + + private void updateSkylightNeighborHeight(int x, int z, int startY, int endY) + { + if (endY > startY && this.worldObj.isAreaLoaded(new BlockPos(x, 0, z), 16)) + { + for (int i = startY; i < endY; ++i) + { + this.worldObj.checkLightFor(EnumSkyBlock.SKY, new BlockPos(x, i, z)); + } + + this.isModified = true; + } + } + + private void relightBlock(int x, int y, int z) + { + int i = this.heightMap[z << 4 | x] & 255; + int j = i; + + if (y > i) + { + j = y; + } + + while (j > 0 && this.getBlockLightOpacity(x, j - 1, z) == 0) + { + --j; + } + + if (j != i) + { + this.worldObj.markBlocksDirtyVertical(x + this.xPosition * 16, z + this.zPosition * 16, j, i); + this.heightMap[z << 4 | x] = j; + int k = this.xPosition * 16 + x; + int l = this.zPosition * 16 + z; + + if (!this.worldObj.provider.getHasNoSky()) + { + if (j < i) + { + for (int j1 = j; j1 < i; ++j1) + { + ExtendedBlockStorage extendedblockstorage2 = this.storageArrays[j1 >> 4]; + + if (extendedblockstorage2 != null) + { + extendedblockstorage2.setExtSkylightValue(x, j1 & 15, z, 15); + this.worldObj.notifyLightSet(new BlockPos((this.xPosition << 4) + x, j1, (this.zPosition << 4) + z)); + } + } + } + else + { + for (int i1 = i; i1 < j; ++i1) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[i1 >> 4]; + + if (extendedblockstorage != null) + { + extendedblockstorage.setExtSkylightValue(x, i1 & 15, z, 0); + this.worldObj.notifyLightSet(new BlockPos((this.xPosition << 4) + x, i1, (this.zPosition << 4) + z)); + } + } + } + + int k1 = 15; + + while (j > 0 && k1 > 0) + { + --j; + int i2 = this.getBlockLightOpacity(x, j, z); + + if (i2 == 0) + { + i2 = 1; + } + + k1 -= i2; + + if (k1 < 0) + { + k1 = 0; + } + + ExtendedBlockStorage extendedblockstorage1 = this.storageArrays[j >> 4]; + + if (extendedblockstorage1 != null) + { + extendedblockstorage1.setExtSkylightValue(x, j & 15, z, k1); + } + } + } + + int l1 = this.heightMap[z << 4 | x]; + int j2 = i; + int k2 = l1; + + if (l1 < i) + { + j2 = l1; + k2 = i; + } + + if (l1 < this.heightMapMinimum) + { + this.heightMapMinimum = l1; + } + + if (!this.worldObj.provider.getHasNoSky()) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + this.updateSkylightNeighborHeight(k + enumfacing.getFrontOffsetX(), l + enumfacing.getFrontOffsetZ(), j2, k2); + } + + this.updateSkylightNeighborHeight(k, l, j2, k2); + } + + this.isModified = true; + } + } + + public int getBlockLightOpacity(BlockPos pos) + { + return this.getBlock(pos).getLightOpacity(); + } + + private int getBlockLightOpacity(int x, int y, int z) + { + return this.getBlock0(x, y, z).getLightOpacity(); + } + + private Block getBlock0(int x, int y, int z) + { + Block block = Blocks.air; + + if (y >= 0 && y >> 4 < this.storageArrays.length) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4]; + + if (extendedblockstorage != null) + { + try + { + block = extendedblockstorage.getBlockByExtId(x, y & 15, z); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block"); + throw new ReportedException(crashreport); + } + } + } + + return block; + } + + public Block getBlock(final int x, final int y, final int z) + { + try + { + return this.getBlock0(x & 15, y, z & 15); + } + catch (ReportedException reportedexception) + { + CrashReportCategory crashreportcategory = reportedexception.getCrashReport().makeCategory("Block being got"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() + { + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo(new BlockPos(Chunk.this.xPosition * 16 + x, y, Chunk.this.zPosition * 16 + z)); + } + }); + throw reportedexception; + } + } + + public Block getBlock(final BlockPos pos) + { + try + { + return this.getBlock0(pos.getX() & 15, pos.getY(), pos.getZ() & 15); + } + catch (ReportedException reportedexception) + { + CrashReportCategory crashreportcategory = reportedexception.getCrashReport().makeCategory("Block being got"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() + { + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo(pos); + } + }); + throw reportedexception; + } + } + + public IBlockState getBlockState(final BlockPos pos) + { + if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD) + { + IBlockState iblockstate = null; + + if (pos.getY() == 60) + { + iblockstate = Blocks.barrier.getDefaultState(); + } + + if (pos.getY() == 70) + { + iblockstate = ChunkProviderDebug.func_177461_b(pos.getX(), pos.getZ()); + } + + return iblockstate == null ? Blocks.air.getDefaultState() : iblockstate; + } + else + { + try + { + if (pos.getY() >= 0 && pos.getY() >> 4 < this.storageArrays.length) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[pos.getY() >> 4]; + + if (extendedblockstorage != null) + { + int j = pos.getX() & 15; + int k = pos.getY() & 15; + int i = pos.getZ() & 15; + return extendedblockstorage.get(j, k, i); + } + } + + return Blocks.air.getDefaultState(); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() + { + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo(pos); + } + }); + throw new ReportedException(crashreport); + } + } + } + + private int getBlockMetadata(int x, int y, int z) + { + if (y >> 4 >= this.storageArrays.length) + { + return 0; + } + else + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4]; + return extendedblockstorage != null ? extendedblockstorage.getExtBlockMetadata(x, y & 15, z) : 0; + } + } + + public int getBlockMetadata(BlockPos pos) + { + return this.getBlockMetadata(pos.getX() & 15, pos.getY(), pos.getZ() & 15); + } + + public IBlockState setBlockState(BlockPos pos, IBlockState state) + { + int i = pos.getX() & 15; + int j = pos.getY(); + int k = pos.getZ() & 15; + int l = k << 4 | i; + + if (j >= this.precipitationHeightMap[l] - 1) + { + this.precipitationHeightMap[l] = -999; + } + + int i1 = this.heightMap[l]; + IBlockState iblockstate = this.getBlockState(pos); + + if (iblockstate == state) + { + return null; + } + else + { + Block block = state.getBlock(); + Block block1 = iblockstate.getBlock(); + ExtendedBlockStorage extendedblockstorage = this.storageArrays[j >> 4]; + boolean flag = false; + + if (extendedblockstorage == null) + { + if (block == Blocks.air) + { + return null; + } + + extendedblockstorage = this.storageArrays[j >> 4] = new ExtendedBlockStorage(j >> 4 << 4, !this.worldObj.provider.getHasNoSky()); + flag = j >= i1; + } + + extendedblockstorage.set(i, j & 15, k, state); + + if (block1 != block) + { + if (!this.worldObj.isRemote) + { + block1.breakBlock(this.worldObj, pos, iblockstate); + } + else if (block1 instanceof ITileEntityProvider) + { + this.worldObj.removeTileEntity(pos); + } + } + + if (extendedblockstorage.getBlockByExtId(i, j & 15, k) != block) + { + return null; + } + else + { + if (flag) + { + this.generateSkylightMap(); + } + else + { + int j1 = block.getLightOpacity(); + int k1 = block1.getLightOpacity(); + + if (j1 > 0) + { + if (j >= i1) + { + this.relightBlock(i, j + 1, k); + } + } + else if (j == i1 - 1) + { + this.relightBlock(i, j, k); + } + + if (j1 != k1 && (j1 < k1 || this.getLightFor(EnumSkyBlock.SKY, pos) > 0 || this.getLightFor(EnumSkyBlock.BLOCK, pos) > 0)) + { + this.propagateSkylightOcclusion(i, k); + } + } + + if (block1 instanceof ITileEntityProvider) + { + TileEntity tileentity = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); + + if (tileentity != null) + { + tileentity.updateContainingBlockInfo(); + } + } + + if (!this.worldObj.isRemote && block1 != block) + { + block.onBlockAdded(this.worldObj, pos, state); + } + + if (block instanceof ITileEntityProvider) + { + TileEntity tileentity1 = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); + + if (tileentity1 == null) + { + tileentity1 = ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, block.getMetaFromState(state)); + this.worldObj.setTileEntity(pos, tileentity1); + } + + if (tileentity1 != null) + { + tileentity1.updateContainingBlockInfo(); + } + } + + this.isModified = true; + return iblockstate; + } + } + } + + public int getLightFor(EnumSkyBlock p_177413_1_, BlockPos pos) + { + int i = pos.getX() & 15; + int j = pos.getY(); + int k = pos.getZ() & 15; + ExtendedBlockStorage extendedblockstorage = this.storageArrays[j >> 4]; + return extendedblockstorage == null ? (this.canSeeSky(pos) ? p_177413_1_.defaultLightValue : 0) : (p_177413_1_ == EnumSkyBlock.SKY ? (this.worldObj.provider.getHasNoSky() ? 0 : extendedblockstorage.getExtSkylightValue(i, j & 15, k)) : (p_177413_1_ == EnumSkyBlock.BLOCK ? extendedblockstorage.getExtBlocklightValue(i, j & 15, k) : p_177413_1_.defaultLightValue)); + } + + public void setLightFor(EnumSkyBlock p_177431_1_, BlockPos pos, int value) + { + int i = pos.getX() & 15; + int j = pos.getY(); + int k = pos.getZ() & 15; + ExtendedBlockStorage extendedblockstorage = this.storageArrays[j >> 4]; + + if (extendedblockstorage == null) + { + extendedblockstorage = this.storageArrays[j >> 4] = new ExtendedBlockStorage(j >> 4 << 4, !this.worldObj.provider.getHasNoSky()); + this.generateSkylightMap(); + } + + this.isModified = true; + + if (p_177431_1_ == EnumSkyBlock.SKY) + { + if (!this.worldObj.provider.getHasNoSky()) + { + extendedblockstorage.setExtSkylightValue(i, j & 15, k, value); + } + } + else if (p_177431_1_ == EnumSkyBlock.BLOCK) + { + extendedblockstorage.setExtBlocklightValue(i, j & 15, k, value); + } + } + + public int getLightSubtracted(BlockPos pos, int amount) + { + int i = pos.getX() & 15; + int j = pos.getY(); + int k = pos.getZ() & 15; + ExtendedBlockStorage extendedblockstorage = this.storageArrays[j >> 4]; + + if (extendedblockstorage == null) + { + return !this.worldObj.provider.getHasNoSky() && amount < EnumSkyBlock.SKY.defaultLightValue ? EnumSkyBlock.SKY.defaultLightValue - amount : 0; + } + else + { + int l = this.worldObj.provider.getHasNoSky() ? 0 : extendedblockstorage.getExtSkylightValue(i, j & 15, k); + l = l - amount; + int i1 = extendedblockstorage.getExtBlocklightValue(i, j & 15, k); + + if (i1 > l) + { + l = i1; + } + + return l; + } + } + + public void addEntity(Entity entityIn) + { + this.hasEntities = true; + int i = MathHelper.floor_double(entityIn.posX / 16.0D); + int j = MathHelper.floor_double(entityIn.posZ / 16.0D); + + if (i != this.xPosition || j != this.zPosition) + { + logger.warn("Wrong location! (" + i + ", " + j + ") should be (" + this.xPosition + ", " + this.zPosition + "), " + entityIn, new Object[] {entityIn}); + entityIn.setDead(); + } + + int k = MathHelper.floor_double(entityIn.posY / 16.0D); + + if (k < 0) + { + k = 0; + } + + if (k >= this.entityLists.length) + { + k = this.entityLists.length - 1; + } + + entityIn.addedToChunk = true; + entityIn.chunkCoordX = this.xPosition; + entityIn.chunkCoordY = k; + entityIn.chunkCoordZ = this.zPosition; + this.entityLists[k].add(entityIn); + } + + public void removeEntity(Entity entityIn) + { + this.removeEntityAtIndex(entityIn, entityIn.chunkCoordY); + } + + public void removeEntityAtIndex(Entity entityIn, int p_76608_2_) + { + if (p_76608_2_ < 0) + { + p_76608_2_ = 0; + } + + if (p_76608_2_ >= this.entityLists.length) + { + p_76608_2_ = this.entityLists.length - 1; + } + + this.entityLists[p_76608_2_].remove(entityIn); + } + + public boolean canSeeSky(BlockPos pos) + { + int i = pos.getX() & 15; + int j = pos.getY(); + int k = pos.getZ() & 15; + return j >= this.heightMap[k << 4 | i]; + } + + private TileEntity createNewTileEntity(BlockPos pos) + { + Block block = this.getBlock(pos); + return !block.hasTileEntity() ? null : ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, this.getBlockMetadata(pos)); + } + + public TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType p_177424_2_) + { + TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(pos); + + if (tileentity == null) + { + if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE) + { + tileentity = this.createNewTileEntity(pos); + this.worldObj.setTileEntity(pos, tileentity); + } + else if (p_177424_2_ == Chunk.EnumCreateEntityType.QUEUED) + { + this.tileEntityPosQueue.add(pos); + } + } + else if (tileentity.isInvalid()) + { + this.chunkTileEntityMap.remove(pos); + return null; + } + + return tileentity; + } + + public void addTileEntity(TileEntity tileEntityIn) + { + this.addTileEntity(tileEntityIn.getPos(), tileEntityIn); + + if (this.isChunkLoaded) + { + this.worldObj.addTileEntity(tileEntityIn); + } + } + + public void addTileEntity(BlockPos pos, TileEntity tileEntityIn) + { + tileEntityIn.setWorldObj(this.worldObj); + tileEntityIn.setPos(pos); + + if (this.getBlock(pos) instanceof ITileEntityProvider) + { + if (this.chunkTileEntityMap.containsKey(pos)) + { + ((TileEntity)this.chunkTileEntityMap.get(pos)).invalidate(); + } + + tileEntityIn.validate(); + this.chunkTileEntityMap.put(pos, tileEntityIn); + } + } + + public void removeTileEntity(BlockPos pos) + { + if (this.isChunkLoaded) + { + TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.remove(pos); + + if (tileentity != null) + { + tileentity.invalidate(); + } + } + } + + public void onChunkLoad() + { + this.isChunkLoaded = true; + this.worldObj.addTileEntities(this.chunkTileEntityMap.values()); + + for (int i = 0; i < this.entityLists.length; ++i) + { + for (Entity entity : this.entityLists[i]) + { + entity.onChunkLoad(); + } + + this.worldObj.loadEntities(this.entityLists[i]); + } + } + + public void onChunkUnload() + { + this.isChunkLoaded = false; + + for (TileEntity tileentity : this.chunkTileEntityMap.values()) + { + this.worldObj.markTileEntityForRemoval(tileentity); + } + + for (int i = 0; i < this.entityLists.length; ++i) + { + this.worldObj.unloadEntities(this.entityLists[i]); + } + } + + public void setChunkModified() + { + this.isModified = true; + } + + public void getEntitiesWithinAABBForEntity(Entity entityIn, AxisAlignedBB aabb, List listToFill, Predicate p_177414_4_) + { + int i = MathHelper.floor_double((aabb.minY - 2.0D) / 16.0D); + int j = MathHelper.floor_double((aabb.maxY + 2.0D) / 16.0D); + i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); + j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); + + for (int k = i; k <= j; ++k) + { + if (!this.entityLists[k].isEmpty()) + { + for (Entity entity : this.entityLists[k]) + { + if (entity.getEntityBoundingBox().intersectsWith(aabb) && entity != entityIn) + { + if (p_177414_4_ == null || p_177414_4_.apply(entity)) + { + listToFill.add(entity); + } + + Entity[] aentity = entity.getParts(); + + if (aentity != null) + { + for (int l = 0; l < aentity.length; ++l) + { + entity = aentity[l]; + + if (entity != entityIn && entity.getEntityBoundingBox().intersectsWith(aabb) && (p_177414_4_ == null || p_177414_4_.apply(entity))) + { + listToFill.add(entity); + } + } + } + } + } + } + } + } + + public void getEntitiesOfTypeWithinAAAB(Class entityClass, AxisAlignedBB aabb, List listToFill, Predicate p_177430_4_) + { + int i = MathHelper.floor_double((aabb.minY - 2.0D) / 16.0D); + int j = MathHelper.floor_double((aabb.maxY + 2.0D) / 16.0D); + i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); + j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); + + for (int k = i; k <= j; ++k) + { + for (T t : this.entityLists[k].getByClass(entityClass)) + { + if (t.getEntityBoundingBox().intersectsWith(aabb) && (p_177430_4_ == null || p_177430_4_.apply(t))) + { + listToFill.add(t); + } + } + } + } + + public boolean needsSaving(boolean p_76601_1_) + { + if (p_76601_1_) + { + if (this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) + { + return true; + } + } + else if (this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) + { + return true; + } + + return this.isModified; + } + + public Random getRandomWithSeed(long seed) + { + return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ seed); + } + + public boolean isEmpty() + { + return false; + } + + public void populateChunk(IChunkProvider p_76624_1_, IChunkProvider p_76624_2_, int x, int z) + { + boolean flag = p_76624_1_.chunkExists(x, z - 1); + boolean flag1 = p_76624_1_.chunkExists(x + 1, z); + boolean flag2 = p_76624_1_.chunkExists(x, z + 1); + boolean flag3 = p_76624_1_.chunkExists(x - 1, z); + boolean flag4 = p_76624_1_.chunkExists(x - 1, z - 1); + boolean flag5 = p_76624_1_.chunkExists(x + 1, z + 1); + boolean flag6 = p_76624_1_.chunkExists(x - 1, z + 1); + boolean flag7 = p_76624_1_.chunkExists(x + 1, z - 1); + + if (flag1 && flag2 && flag5) + { + if (!this.isTerrainPopulated) + { + p_76624_1_.populate(p_76624_2_, x, z); + } + else + { + p_76624_1_.populateChunk(p_76624_2_, this, x, z); + } + } + + if (flag3 && flag2 && flag6) + { + Chunk chunk = p_76624_1_.provideChunk(x - 1, z); + + if (!chunk.isTerrainPopulated) + { + p_76624_1_.populate(p_76624_2_, x - 1, z); + } + else + { + p_76624_1_.populateChunk(p_76624_2_, chunk, x - 1, z); + } + } + + if (flag && flag1 && flag7) + { + Chunk chunk1 = p_76624_1_.provideChunk(x, z - 1); + + if (!chunk1.isTerrainPopulated) + { + p_76624_1_.populate(p_76624_2_, x, z - 1); + } + else + { + p_76624_1_.populateChunk(p_76624_2_, chunk1, x, z - 1); + } + } + + if (flag4 && flag && flag3) + { + Chunk chunk2 = p_76624_1_.provideChunk(x - 1, z - 1); + + if (!chunk2.isTerrainPopulated) + { + p_76624_1_.populate(p_76624_2_, x - 1, z - 1); + } + else + { + p_76624_1_.populateChunk(p_76624_2_, chunk2, x - 1, z - 1); + } + } + } + + public BlockPos getPrecipitationHeight(BlockPos pos) + { + int i = pos.getX() & 15; + int j = pos.getZ() & 15; + int k = i | j << 4; + BlockPos blockpos = new BlockPos(pos.getX(), this.precipitationHeightMap[k], pos.getZ()); + + if (blockpos.getY() == -999) + { + int l = this.getTopFilledSegment() + 15; + blockpos = new BlockPos(pos.getX(), l, pos.getZ()); + int i1 = -1; + + while (blockpos.getY() > 0 && i1 == -1) + { + Block block = this.getBlock(blockpos); + Material material = block.getMaterial(); + + if (!material.blocksMovement() && !material.isLiquid()) + { + blockpos = blockpos.down(); + } + else + { + i1 = blockpos.getY() + 1; + } + } + + this.precipitationHeightMap[k] = i1; + } + + return new BlockPos(pos.getX(), this.precipitationHeightMap[k], pos.getZ()); + } + + public void func_150804_b(boolean p_150804_1_) + { + if (this.isGapLightingUpdated && !this.worldObj.provider.getHasNoSky() && !p_150804_1_) + { + this.recheckGaps(this.worldObj.isRemote); + } + + this.field_150815_m = true; + + if (!this.isLightPopulated && this.isTerrainPopulated) + { + this.func_150809_p(); + } + + while (!this.tileEntityPosQueue.isEmpty()) + { + BlockPos blockpos = (BlockPos)this.tileEntityPosQueue.poll(); + + if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.getBlock(blockpos).hasTileEntity()) + { + TileEntity tileentity = this.createNewTileEntity(blockpos); + this.worldObj.setTileEntity(blockpos, tileentity); + this.worldObj.markBlockRangeForRenderUpdate(blockpos, blockpos); + } + } + } + + public boolean isPopulated() + { + return this.field_150815_m && this.isTerrainPopulated && this.isLightPopulated; + } + + public ChunkCoordIntPair getChunkCoordIntPair() + { + return new ChunkCoordIntPair(this.xPosition, this.zPosition); + } + + public boolean getAreLevelsEmpty(int startY, int endY) + { + if (startY < 0) + { + startY = 0; + } + + if (endY >= 256) + { + endY = 255; + } + + for (int i = startY; i <= endY; i += 16) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[i >> 4]; + + if (extendedblockstorage != null && !extendedblockstorage.isEmpty()) + { + return false; + } + } + + return true; + } + + public void setStorageArrays(ExtendedBlockStorage[] newStorageArrays) + { + if (this.storageArrays.length != newStorageArrays.length) + { + logger.warn("Could not set level chunk sections, array length is " + newStorageArrays.length + " instead of " + this.storageArrays.length); + } + else + { + for (int i = 0; i < this.storageArrays.length; ++i) + { + this.storageArrays[i] = newStorageArrays[i]; + } + } + } + + public void fillChunk(byte[] p_177439_1_, int p_177439_2_, boolean p_177439_3_) + { + int i = 0; + boolean flag = !this.worldObj.provider.getHasNoSky(); + + for (int j = 0; j < this.storageArrays.length; ++j) + { + if ((p_177439_2_ & 1 << j) != 0) + { + if (this.storageArrays[j] == null) + { + this.storageArrays[j] = new ExtendedBlockStorage(j << 4, flag); + } + + char[] achar = this.storageArrays[j].getData(); + + for (int k = 0; k < achar.length; ++k) + { + achar[k] = (char)((p_177439_1_[i + 1] & 255) << 8 | p_177439_1_[i] & 255); + i += 2; + } + } + else if (p_177439_3_ && this.storageArrays[j] != null) + { + this.storageArrays[j] = null; + } + } + + for (int l = 0; l < this.storageArrays.length; ++l) + { + if ((p_177439_2_ & 1 << l) != 0 && this.storageArrays[l] != null) + { + NibbleArray nibblearray = this.storageArrays[l].getBlocklightArray(); + System.arraycopy(p_177439_1_, i, nibblearray.getData(), 0, nibblearray.getData().length); + i += nibblearray.getData().length; + } + } + + if (flag) + { + for (int i1 = 0; i1 < this.storageArrays.length; ++i1) + { + if ((p_177439_2_ & 1 << i1) != 0 && this.storageArrays[i1] != null) + { + NibbleArray nibblearray1 = this.storageArrays[i1].getSkylightArray(); + System.arraycopy(p_177439_1_, i, nibblearray1.getData(), 0, nibblearray1.getData().length); + i += nibblearray1.getData().length; + } + } + } + + if (p_177439_3_) + { + System.arraycopy(p_177439_1_, i, this.blockBiomeArray, 0, this.blockBiomeArray.length); + int k1 = i + this.blockBiomeArray.length; + } + + for (int j1 = 0; j1 < this.storageArrays.length; ++j1) + { + if (this.storageArrays[j1] != null && (p_177439_2_ & 1 << j1) != 0) + { + this.storageArrays[j1].removeInvalidBlocks(); + } + } + + this.isLightPopulated = true; + this.isTerrainPopulated = true; + this.generateHeightMap(); + + for (TileEntity tileentity : this.chunkTileEntityMap.values()) + { + tileentity.updateContainingBlockInfo(); + } + } + + public BiomeGenBase getBiome(BlockPos pos, WorldChunkManager chunkManager) + { + int i = pos.getX() & 15; + int j = pos.getZ() & 15; + int k = this.blockBiomeArray[j << 4 | i] & 255; + + if (k == 255) + { + BiomeGenBase biomegenbase = chunkManager.getBiomeGenerator(pos, BiomeGenBase.plains); + k = biomegenbase.biomeID; + this.blockBiomeArray[j << 4 | i] = (byte)(k & 255); + } + + BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(k); + return biomegenbase1 == null ? BiomeGenBase.plains : biomegenbase1; + } + + public byte[] getBiomeArray() + { + return this.blockBiomeArray; + } + + public void setBiomeArray(byte[] biomeArray) + { + if (this.blockBiomeArray.length != biomeArray.length) + { + logger.warn("Could not set level chunk biomes, array length is " + biomeArray.length + " instead of " + this.blockBiomeArray.length); + } + else + { + for (int i = 0; i < this.blockBiomeArray.length; ++i) + { + this.blockBiomeArray[i] = biomeArray[i]; + } + } + } + + public void resetRelightChecks() + { + this.queuedLightChecks = 0; + } + + public void enqueueRelightChecks() + { + BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4); + + for (int i = 0; i < 8; ++i) + { + if (this.queuedLightChecks >= 4096) + { + return; + } + + int j = this.queuedLightChecks % 16; + int k = this.queuedLightChecks / 16 % 16; + int l = this.queuedLightChecks / 256; + ++this.queuedLightChecks; + + for (int i1 = 0; i1 < 16; ++i1) + { + BlockPos blockpos1 = blockpos.add(k, (j << 4) + i1, l); + boolean flag = i1 == 0 || i1 == 15 || k == 0 || k == 15 || l == 0 || l == 15; + + if (this.storageArrays[j] == null && flag || this.storageArrays[j] != null && this.storageArrays[j].getBlockByExtId(k, i1, l).getMaterial() == Material.air) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + BlockPos blockpos2 = blockpos1.offset(enumfacing); + + if (this.worldObj.getBlockState(blockpos2).getBlock().getLightValue() > 0) + { + this.worldObj.checkLight(blockpos2); + } + } + + this.worldObj.checkLight(blockpos1); + } + } + } + } + + public void func_150809_p() + { + this.isTerrainPopulated = true; + this.isLightPopulated = true; + BlockPos blockpos = new BlockPos(this.xPosition << 4, 0, this.zPosition << 4); + + if (!this.worldObj.provider.getHasNoSky()) + { + if (this.worldObj.isAreaLoaded(blockpos.add(-1, 0, -1), blockpos.add(16, this.worldObj.getSeaLevel(), 16))) + { + label92: + + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + if (!this.func_150811_f(i, j)) + { + this.isLightPopulated = false; + break label92; + } + } + } + + if (this.isLightPopulated) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + int k = enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE ? 16 : 1; + this.worldObj.getChunkFromBlockCoords(blockpos.offset(enumfacing, k)).func_180700_a(enumfacing.getOpposite()); + } + + this.func_177441_y(); + } + } + else + { + this.isLightPopulated = false; + } + } + } + + private void func_177441_y() + { + for (int i = 0; i < this.updateSkylightColumns.length; ++i) + { + this.updateSkylightColumns[i] = true; + } + + this.recheckGaps(false); + } + + private void func_180700_a(EnumFacing facing) + { + if (this.isTerrainPopulated) + { + if (facing == EnumFacing.EAST) + { + for (int i = 0; i < 16; ++i) + { + this.func_150811_f(15, i); + } + } + else if (facing == EnumFacing.WEST) + { + for (int j = 0; j < 16; ++j) + { + this.func_150811_f(0, j); + } + } + else if (facing == EnumFacing.SOUTH) + { + for (int k = 0; k < 16; ++k) + { + this.func_150811_f(k, 15); + } + } + else if (facing == EnumFacing.NORTH) + { + for (int l = 0; l < 16; ++l) + { + this.func_150811_f(l, 0); + } + } + } + } + + private boolean func_150811_f(int x, int z) + { + int i = this.getTopFilledSegment(); + boolean flag = false; + boolean flag1 = false; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos((this.xPosition << 4) + x, 0, (this.zPosition << 4) + z); + + for (int j = i + 16 - 1; j > this.worldObj.getSeaLevel() || j > 0 && !flag1; --j) + { + blockpos$mutableblockpos.set(blockpos$mutableblockpos.getX(), j, blockpos$mutableblockpos.getZ()); + int k = this.getBlockLightOpacity(blockpos$mutableblockpos); + + if (k == 255 && blockpos$mutableblockpos.getY() < this.worldObj.getSeaLevel()) + { + flag1 = true; + } + + if (!flag && k > 0) + { + flag = true; + } + else if (flag && k == 0 && !this.worldObj.checkLight(blockpos$mutableblockpos)) + { + return false; + } + } + + for (int l = blockpos$mutableblockpos.getY(); l > 0; --l) + { + blockpos$mutableblockpos.set(blockpos$mutableblockpos.getX(), l, blockpos$mutableblockpos.getZ()); + + if (this.getBlock(blockpos$mutableblockpos).getLightValue() > 0) + { + this.worldObj.checkLight(blockpos$mutableblockpos); + } + } + + return true; + } + + public boolean isLoaded() + { + return this.isChunkLoaded; + } + + public void setChunkLoaded(boolean loaded) + { + this.isChunkLoaded = loaded; + } + + public World getWorld() + { + return this.worldObj; + } + + public int[] getHeightMap() + { + return this.heightMap; + } + + public void setHeightMap(int[] newHeightMap) + { + if (this.heightMap.length != newHeightMap.length) + { + logger.warn("Could not set level chunk heightmap, array length is " + newHeightMap.length + " instead of " + this.heightMap.length); + } + else + { + for (int i = 0; i < this.heightMap.length; ++i) + { + this.heightMap[i] = newHeightMap[i]; + } + } + } + + public Map getTileEntityMap() + { + return this.chunkTileEntityMap; + } + + public ClassInheritanceMultiMap[] getEntityLists() + { + return this.entityLists; + } + + public boolean isTerrainPopulated() + { + return this.isTerrainPopulated; + } + + public void setTerrainPopulated(boolean terrainPopulated) + { + this.isTerrainPopulated = terrainPopulated; + } + + public boolean isLightPopulated() + { + return this.isLightPopulated; + } + + public void setLightPopulated(boolean lightPopulated) + { + this.isLightPopulated = lightPopulated; + } + + public void setModified(boolean modified) + { + this.isModified = modified; + } + + public void setHasEntities(boolean hasEntitiesIn) + { + this.hasEntities = hasEntitiesIn; + } + + public void setLastSaveTime(long saveTime) + { + this.lastSaveTime = saveTime; + } + + public int getLowestHeight() + { + return this.heightMapMinimum; + } + + public long getInhabitedTime() + { + return this.inhabitedTime; + } + + public void setInhabitedTime(long newInhabitedTime) + { + this.inhabitedTime = newInhabitedTime; + } + + public static enum EnumCreateEntityType + { + IMMEDIATE, + QUEUED, + CHECK; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/ChunkPrimer.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/ChunkPrimer.java new file mode 100644 index 0000000..11bded9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/ChunkPrimer.java @@ -0,0 +1,48 @@ +package net.minecraft.world.chunk; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; + +public class ChunkPrimer +{ + private final short[] data = new short[65536]; + private final IBlockState defaultState = Blocks.air.getDefaultState(); + + public IBlockState getBlockState(int x, int y, int z) + { + int i = x << 12 | z << 8 | y; + return this.getBlockState(i); + } + + public IBlockState getBlockState(int index) + { + if (index >= 0 && index < this.data.length) + { + IBlockState iblockstate = (IBlockState)Block.BLOCK_STATE_IDS.getByValue(this.data[index]); + return iblockstate != null ? iblockstate : this.defaultState; + } + else + { + throw new IndexOutOfBoundsException("The coordinate is out of range"); + } + } + + public void setBlockState(int x, int y, int z, IBlockState state) + { + int i = x << 12 | z << 8 | y; + this.setBlockState(i, state); + } + + public void setBlockState(int index, IBlockState state) + { + if (index >= 0 && index < this.data.length) + { + this.data[index] = (short)Block.BLOCK_STATE_IDS.get(state); + } + else + { + throw new IndexOutOfBoundsException("The coordinate is out of range"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/EmptyChunk.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/EmptyChunk.java new file mode 100644 index 0000000..dacaaaa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/EmptyChunk.java @@ -0,0 +1,142 @@ +package net.minecraft.world.chunk; + +import com.google.common.base.Predicate; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public class EmptyChunk extends Chunk +{ + public EmptyChunk(World worldIn, int x, int z) + { + super(worldIn, x, z); + } + + public boolean isAtLocation(int x, int z) + { + return x == this.xPosition && z == this.zPosition; + } + + public int getHeightValue(int x, int z) + { + return 0; + } + + public void generateHeightMap() + { + } + + public void generateSkylightMap() + { + } + + public Block getBlock(BlockPos pos) + { + return Blocks.air; + } + + public int getBlockLightOpacity(BlockPos pos) + { + return 255; + } + + public int getBlockMetadata(BlockPos pos) + { + return 0; + } + + public int getLightFor(EnumSkyBlock p_177413_1_, BlockPos pos) + { + return p_177413_1_.defaultLightValue; + } + + public void setLightFor(EnumSkyBlock p_177431_1_, BlockPos pos, int value) + { + } + + public int getLightSubtracted(BlockPos pos, int amount) + { + return 0; + } + + public void addEntity(Entity entityIn) + { + } + + public void removeEntity(Entity entityIn) + { + } + + public void removeEntityAtIndex(Entity entityIn, int p_76608_2_) + { + } + + public boolean canSeeSky(BlockPos pos) + { + return false; + } + + public TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType p_177424_2_) + { + return null; + } + + public void addTileEntity(TileEntity tileEntityIn) + { + } + + public void addTileEntity(BlockPos pos, TileEntity tileEntityIn) + { + } + + public void removeTileEntity(BlockPos pos) + { + } + + public void onChunkLoad() + { + } + + public void onChunkUnload() + { + } + + public void setChunkModified() + { + } + + public void getEntitiesWithinAABBForEntity(Entity entityIn, AxisAlignedBB aabb, List listToFill, Predicate p_177414_4_) + { + } + + public void getEntitiesOfTypeWithinAAAB(Class entityClass, AxisAlignedBB aabb, List listToFill, Predicate p_177430_4_) + { + } + + public boolean needsSaving(boolean p_76601_1_) + { + return false; + } + + public Random getRandomWithSeed(long seed) + { + return new Random(this.getWorld().getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ seed); + } + + public boolean isEmpty() + { + return true; + } + + public boolean getAreLevelsEmpty(int startY, int endY) + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/IChunkProvider.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/IChunkProvider.java new file mode 100644 index 0000000..3185549 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/IChunkProvider.java @@ -0,0 +1,39 @@ +package net.minecraft.world.chunk; + +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public interface IChunkProvider +{ + boolean chunkExists(int x, int z); + + Chunk provideChunk(int x, int z); + + Chunk provideChunk(BlockPos blockPosIn); + + void populate(IChunkProvider chunkProvider, int x, int z); + + boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z); + + boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback); + + boolean unloadQueuedChunks(); + + boolean canSave(); + + String makeString(); + + List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos); + + BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position); + + int getLoadedChunkCount(); + + void recreateStructures(Chunk chunkIn, int x, int z); + + void saveExtraData(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/NibbleArray.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/NibbleArray.java new file mode 100644 index 0000000..8a12d2c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/NibbleArray.java @@ -0,0 +1,71 @@ +package net.minecraft.world.chunk; + +public class NibbleArray +{ + private final byte[] data; + + public NibbleArray() + { + this.data = new byte[2048]; + } + + public NibbleArray(byte[] storageArray) + { + this.data = storageArray; + + if (storageArray.length != 2048) + { + throw new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + storageArray.length); + } + } + + public int get(int x, int y, int z) + { + return this.getFromIndex(this.getCoordinateIndex(x, y, z)); + } + + public void set(int x, int y, int z, int value) + { + this.setIndex(this.getCoordinateIndex(x, y, z), value); + } + + private int getCoordinateIndex(int x, int y, int z) + { + return y << 8 | z << 4 | x; + } + + public int getFromIndex(int index) + { + int i = this.getNibbleIndex(index); + return this.isLowerNibble(index) ? this.data[i] & 15 : this.data[i] >> 4 & 15; + } + + public void setIndex(int index, int value) + { + int i = this.getNibbleIndex(index); + + if (this.isLowerNibble(index)) + { + this.data[i] = (byte)(this.data[i] & 240 | value & 15); + } + else + { + this.data[i] = (byte)(this.data[i] & 15 | (value & 15) << 4); + } + } + + private boolean isLowerNibble(int index) + { + return (index & 1) == 0; + } + + private int getNibbleIndex(int index) + { + return index >> 1; + } + + public byte[] getData() + { + return this.data; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java new file mode 100644 index 0000000..10c2aa3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -0,0 +1,453 @@ +package net.minecraft.world.chunk.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.NibbleArray; +import net.minecraft.world.storage.IThreadedFileIO; +import net.minecraft.world.storage.ThreadedFileIOBase; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO +{ + private static final Logger logger = LogManager.getLogger(); + private Map chunksToRemove = new ConcurrentHashMap(); + private Set pendingAnvilChunksCoordinates = Collections.newSetFromMap(new ConcurrentHashMap()); + private final File chunkSaveLocation; + private boolean field_183014_e = false; + + public AnvilChunkLoader(File chunkSaveLocationIn) + { + this.chunkSaveLocation = chunkSaveLocationIn; + } + + public Chunk loadChunk(World worldIn, int x, int z) throws IOException + { + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); + NBTTagCompound nbttagcompound = (NBTTagCompound)this.chunksToRemove.get(chunkcoordintpair); + + if (nbttagcompound == null) + { + DataInputStream datainputstream = RegionFileCache.getChunkInputStream(this.chunkSaveLocation, x, z); + + if (datainputstream == null) + { + return null; + } + + nbttagcompound = CompressedStreamTools.read(datainputstream); + } + + return this.checkedReadChunkFromNBT(worldIn, x, z, nbttagcompound); + } + + protected Chunk checkedReadChunkFromNBT(World worldIn, int x, int z, NBTTagCompound p_75822_4_) + { + if (!p_75822_4_.hasKey("Level", 10)) + { + logger.error("Chunk file at " + x + "," + z + " is missing level data, skipping"); + return null; + } + else + { + NBTTagCompound nbttagcompound = p_75822_4_.getCompoundTag("Level"); + + if (!nbttagcompound.hasKey("Sections", 9)) + { + logger.error("Chunk file at " + x + "," + z + " is missing block data, skipping"); + return null; + } + else + { + Chunk chunk = this.readChunkFromNBT(worldIn, nbttagcompound); + + if (!chunk.isAtLocation(x, z)) + { + logger.error("Chunk file at " + x + "," + z + " is in the wrong location; relocating. (Expected " + x + ", " + z + ", got " + chunk.xPosition + ", " + chunk.zPosition + ")"); + nbttagcompound.setInteger("xPos", x); + nbttagcompound.setInteger("zPos", z); + chunk = this.readChunkFromNBT(worldIn, nbttagcompound); + } + + return chunk; + } + } + } + + public void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException + { + worldIn.checkSessionLock(); + + try + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound.setTag("Level", nbttagcompound1); + this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1); + this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound); + } + catch (Exception exception) + { + logger.error((String)"Failed to save chunk", (Throwable)exception); + } + } + + protected void addChunkToPending(ChunkCoordIntPair p_75824_1_, NBTTagCompound p_75824_2_) + { + if (!this.pendingAnvilChunksCoordinates.contains(p_75824_1_)) + { + this.chunksToRemove.put(p_75824_1_, p_75824_2_); + } + + ThreadedFileIOBase.getThreadedIOInstance().queueIO(this); + } + + public boolean writeNextIO() + { + if (this.chunksToRemove.isEmpty()) + { + if (this.field_183014_e) + { + logger.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", new Object[] {this.chunkSaveLocation.getName()}); + } + + return false; + } + else + { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)this.chunksToRemove.keySet().iterator().next(); + boolean lvt_3_1_; + + try + { + this.pendingAnvilChunksCoordinates.add(chunkcoordintpair); + NBTTagCompound nbttagcompound = (NBTTagCompound)this.chunksToRemove.remove(chunkcoordintpair); + + if (nbttagcompound != null) + { + try + { + this.func_183013_b(chunkcoordintpair, nbttagcompound); + } + catch (Exception exception) + { + logger.error((String)"Failed to save chunk", (Throwable)exception); + } + } + + lvt_3_1_ = true; + } + finally + { + this.pendingAnvilChunksCoordinates.remove(chunkcoordintpair); + } + + return lvt_3_1_; + } + } + + private void func_183013_b(ChunkCoordIntPair p_183013_1_, NBTTagCompound p_183013_2_) throws IOException + { + DataOutputStream dataoutputstream = RegionFileCache.getChunkOutputStream(this.chunkSaveLocation, p_183013_1_.chunkXPos, p_183013_1_.chunkZPos); + CompressedStreamTools.write(p_183013_2_, dataoutputstream); + dataoutputstream.close(); + } + + public void saveExtraChunkData(World worldIn, Chunk chunkIn) throws IOException + { + } + + public void chunkTick() + { + } + + public void saveExtraData() + { + try + { + this.field_183014_e = true; + + while (true) + { + if (this.writeNextIO()) + { + continue; + } + } + } + finally + { + this.field_183014_e = false; + } + } + + private void writeChunkToNBT(Chunk chunkIn, World worldIn, NBTTagCompound p_75820_3_) + { + p_75820_3_.setByte("V", (byte)1); + p_75820_3_.setInteger("xPos", chunkIn.xPosition); + p_75820_3_.setInteger("zPos", chunkIn.zPosition); + p_75820_3_.setLong("LastUpdate", worldIn.getTotalWorldTime()); + p_75820_3_.setIntArray("HeightMap", chunkIn.getHeightMap()); + p_75820_3_.setBoolean("TerrainPopulated", chunkIn.isTerrainPopulated()); + p_75820_3_.setBoolean("LightPopulated", chunkIn.isLightPopulated()); + p_75820_3_.setLong("InhabitedTime", chunkIn.getInhabitedTime()); + ExtendedBlockStorage[] aextendedblockstorage = chunkIn.getBlockStorageArray(); + NBTTagList nbttaglist = new NBTTagList(); + boolean flag = !worldIn.provider.getHasNoSky(); + + for (ExtendedBlockStorage extendedblockstorage : aextendedblockstorage) + { + if (extendedblockstorage != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Y", (byte)(extendedblockstorage.getYLocation() >> 4 & 255)); + byte[] abyte = new byte[extendedblockstorage.getData().length]; + NibbleArray nibblearray = new NibbleArray(); + NibbleArray nibblearray1 = null; + + for (int i = 0; i < extendedblockstorage.getData().length; ++i) + { + char c0 = extendedblockstorage.getData()[i]; + int j = i & 15; + int k = i >> 8 & 15; + int l = i >> 4 & 15; + + if (c0 >> 12 != 0) + { + if (nibblearray1 == null) + { + nibblearray1 = new NibbleArray(); + } + + nibblearray1.set(j, k, l, c0 >> 12); + } + + abyte[i] = (byte)(c0 >> 4 & 255); + nibblearray.set(j, k, l, c0 & 15); + } + + nbttagcompound.setByteArray("Blocks", abyte); + nbttagcompound.setByteArray("Data", nibblearray.getData()); + + if (nibblearray1 != null) + { + nbttagcompound.setByteArray("Add", nibblearray1.getData()); + } + + nbttagcompound.setByteArray("BlockLight", extendedblockstorage.getBlocklightArray().getData()); + + if (flag) + { + nbttagcompound.setByteArray("SkyLight", extendedblockstorage.getSkylightArray().getData()); + } + else + { + nbttagcompound.setByteArray("SkyLight", new byte[extendedblockstorage.getBlocklightArray().getData().length]); + } + + nbttaglist.appendTag(nbttagcompound); + } + } + + p_75820_3_.setTag("Sections", nbttaglist); + p_75820_3_.setByteArray("Biomes", chunkIn.getBiomeArray()); + chunkIn.setHasEntities(false); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (int i1 = 0; i1 < chunkIn.getEntityLists().length; ++i1) + { + for (Entity entity : chunkIn.getEntityLists()[i1]) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + + if (entity.writeToNBTOptional(nbttagcompound1)) + { + chunkIn.setHasEntities(true); + nbttaglist1.appendTag(nbttagcompound1); + } + } + } + + p_75820_3_.setTag("Entities", nbttaglist1); + NBTTagList nbttaglist2 = new NBTTagList(); + + for (TileEntity tileentity : chunkIn.getTileEntityMap().values()) + { + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound2); + nbttaglist2.appendTag(nbttagcompound2); + } + + p_75820_3_.setTag("TileEntities", nbttaglist2); + List list = worldIn.getPendingBlockUpdates(chunkIn, false); + + if (list != null) + { + long j1 = worldIn.getTotalWorldTime(); + NBTTagList nbttaglist3 = new NBTTagList(); + + for (NextTickListEntry nextticklistentry : list) + { + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(nextticklistentry.getBlock()); + nbttagcompound3.setString("i", resourcelocation == null ? "" : resourcelocation.toString()); + nbttagcompound3.setInteger("x", nextticklistentry.position.getX()); + nbttagcompound3.setInteger("y", nextticklistentry.position.getY()); + nbttagcompound3.setInteger("z", nextticklistentry.position.getZ()); + nbttagcompound3.setInteger("t", (int)(nextticklistentry.scheduledTime - j1)); + nbttagcompound3.setInteger("p", nextticklistentry.priority); + nbttaglist3.appendTag(nbttagcompound3); + } + + p_75820_3_.setTag("TileTicks", nbttaglist3); + } + } + + private Chunk readChunkFromNBT(World worldIn, NBTTagCompound p_75823_2_) + { + int i = p_75823_2_.getInteger("xPos"); + int j = p_75823_2_.getInteger("zPos"); + Chunk chunk = new Chunk(worldIn, i, j); + chunk.setHeightMap(p_75823_2_.getIntArray("HeightMap")); + chunk.setTerrainPopulated(p_75823_2_.getBoolean("TerrainPopulated")); + chunk.setLightPopulated(p_75823_2_.getBoolean("LightPopulated")); + chunk.setInhabitedTime(p_75823_2_.getLong("InhabitedTime")); + NBTTagList nbttaglist = p_75823_2_.getTagList("Sections", 10); + int k = 16; + ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[k]; + boolean flag = !worldIn.provider.getHasNoSky(); + + for (int l = 0; l < nbttaglist.tagCount(); ++l) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(l); + int i1 = nbttagcompound.getByte("Y"); + ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(i1 << 4, flag); + byte[] abyte = nbttagcompound.getByteArray("Blocks"); + NibbleArray nibblearray = new NibbleArray(nbttagcompound.getByteArray("Data")); + NibbleArray nibblearray1 = nbttagcompound.hasKey("Add", 7) ? new NibbleArray(nbttagcompound.getByteArray("Add")) : null; + char[] achar = new char[abyte.length]; + + for (int j1 = 0; j1 < achar.length; ++j1) + { + int k1 = j1 & 15; + int l1 = j1 >> 8 & 15; + int i2 = j1 >> 4 & 15; + int j2 = nibblearray1 != null ? nibblearray1.get(k1, l1, i2) : 0; + achar[j1] = (char)(j2 << 12 | (abyte[j1] & 255) << 4 | nibblearray.get(k1, l1, i2)); + } + + extendedblockstorage.setData(achar); + extendedblockstorage.setBlocklightArray(new NibbleArray(nbttagcompound.getByteArray("BlockLight"))); + + if (flag) + { + extendedblockstorage.setSkylightArray(new NibbleArray(nbttagcompound.getByteArray("SkyLight"))); + } + + extendedblockstorage.removeInvalidBlocks(); + aextendedblockstorage[i1] = extendedblockstorage; + } + + chunk.setStorageArrays(aextendedblockstorage); + + if (p_75823_2_.hasKey("Biomes", 7)) + { + chunk.setBiomeArray(p_75823_2_.getByteArray("Biomes")); + } + + NBTTagList nbttaglist1 = p_75823_2_.getTagList("Entities", 10); + + if (nbttaglist1 != null) + { + for (int k2 = 0; k2 < nbttaglist1.tagCount(); ++k2) + { + NBTTagCompound nbttagcompound1 = nbttaglist1.getCompoundTagAt(k2); + Entity entity = EntityList.createEntityFromNBT(nbttagcompound1, worldIn); + chunk.setHasEntities(true); + + if (entity != null) + { + chunk.addEntity(entity); + Entity entity1 = entity; + + for (NBTTagCompound nbttagcompound4 = nbttagcompound1; nbttagcompound4.hasKey("Riding", 10); nbttagcompound4 = nbttagcompound4.getCompoundTag("Riding")) + { + Entity entity2 = EntityList.createEntityFromNBT(nbttagcompound4.getCompoundTag("Riding"), worldIn); + + if (entity2 != null) + { + chunk.addEntity(entity2); + entity1.mountEntity(entity2); + } + + entity1 = entity2; + } + } + } + } + + NBTTagList nbttaglist2 = p_75823_2_.getTagList("TileEntities", 10); + + if (nbttaglist2 != null) + { + for (int l2 = 0; l2 < nbttaglist2.tagCount(); ++l2) + { + NBTTagCompound nbttagcompound2 = nbttaglist2.getCompoundTagAt(l2); + TileEntity tileentity = TileEntity.createAndLoadEntity(nbttagcompound2); + + if (tileentity != null) + { + chunk.addTileEntity(tileentity); + } + } + } + + if (p_75823_2_.hasKey("TileTicks", 9)) + { + NBTTagList nbttaglist3 = p_75823_2_.getTagList("TileTicks", 10); + + if (nbttaglist3 != null) + { + for (int i3 = 0; i3 < nbttaglist3.tagCount(); ++i3) + { + NBTTagCompound nbttagcompound3 = nbttaglist3.getCompoundTagAt(i3); + Block block; + + if (nbttagcompound3.hasKey("i", 8)) + { + block = Block.getBlockFromName(nbttagcompound3.getString("i")); + } + else + { + block = Block.getBlockById(nbttagcompound3.getInteger("i")); + } + + worldIn.scheduleBlockUpdate(new BlockPos(nbttagcompound3.getInteger("x"), nbttagcompound3.getInteger("y"), nbttagcompound3.getInteger("z")), block, nbttagcompound3.getInteger("t"), nbttagcompound3.getInteger("p")); + } + } + } + + return chunk; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java new file mode 100644 index 0000000..37b00e1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java @@ -0,0 +1,269 @@ +package net.minecraft.world.chunk.storage; + +import com.google.common.collect.Lists; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.SaveFormatOld; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class AnvilSaveConverter extends SaveFormatOld +{ + private static final Logger logger = LogManager.getLogger(); + + public AnvilSaveConverter(File savesDirectoryIn) + { + super(savesDirectoryIn); + } + + public String getName() + { + return "Anvil"; + } + + public List getSaveList() throws AnvilConverterException + { + if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory()) + { + List list = Lists.newArrayList(); + File[] afile = this.savesDirectory.listFiles(); + + for (File file1 : afile) + { + if (file1.isDirectory()) + { + String s = file1.getName(); + WorldInfo worldinfo = this.getWorldInfo(s); + + if (worldinfo != null && (worldinfo.getSaveVersion() == 19132 || worldinfo.getSaveVersion() == 19133)) + { + boolean flag = worldinfo.getSaveVersion() != this.getSaveVersion(); + String s1 = worldinfo.getWorldName(); + + if (StringUtils.isEmpty(s1)) + { + s1 = s; + } + + long i = 0L; + list.add(new SaveFormatComparator(s, s1, worldinfo.getLastTimePlayed(), i, worldinfo.getGameType(), flag, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed())); + } + } + } + + return list; + } + else + { + throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!"); + } + } + + protected int getSaveVersion() + { + return 19133; + } + + public void flushCache() + { + RegionFileCache.clearRegionFileReferences(); + } + + public ISaveHandler getSaveLoader(String saveName, boolean storePlayerdata) + { + return new AnvilSaveHandler(this.savesDirectory, saveName, storePlayerdata); + } + + public boolean isConvertible(String saveName) + { + WorldInfo worldinfo = this.getWorldInfo(saveName); + return worldinfo != null && worldinfo.getSaveVersion() == 19132; + } + + public boolean isOldMapFormat(String saveName) + { + WorldInfo worldinfo = this.getWorldInfo(saveName); + return worldinfo != null && worldinfo.getSaveVersion() != this.getSaveVersion(); + } + + public boolean convertMapFormat(String filename, IProgressUpdate progressCallback) + { + progressCallback.setLoadingProgress(0); + List list = Lists.newArrayList(); + List list1 = Lists.newArrayList(); + List list2 = Lists.newArrayList(); + File file1 = new File(this.savesDirectory, filename); + File file2 = new File(file1, "DIM-1"); + File file3 = new File(file1, "DIM1"); + logger.info("Scanning folders..."); + this.addRegionFilesToCollection(file1, list); + + if (file2.exists()) + { + this.addRegionFilesToCollection(file2, list1); + } + + if (file3.exists()) + { + this.addRegionFilesToCollection(file3, list2); + } + + int i = list.size() + list1.size() + list2.size(); + logger.info("Total conversion count is " + i); + WorldInfo worldinfo = this.getWorldInfo(filename); + WorldChunkManager worldchunkmanager = null; + + if (worldinfo.getTerrainType() == WorldType.FLAT) + { + worldchunkmanager = new WorldChunkManagerHell(BiomeGenBase.plains, 0.5F); + } + else + { + worldchunkmanager = new WorldChunkManager(worldinfo.getSeed(), worldinfo.getTerrainType(), worldinfo.getGeneratorOptions()); + } + + this.convertFile(new File(file1, "region"), list, worldchunkmanager, 0, i, progressCallback); + this.convertFile(new File(file2, "region"), list1, new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F), list.size(), i, progressCallback); + this.convertFile(new File(file3, "region"), list2, new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F), list.size() + list1.size(), i, progressCallback); + worldinfo.setSaveVersion(19133); + + if (worldinfo.getTerrainType() == WorldType.DEFAULT_1_1) + { + worldinfo.setTerrainType(WorldType.DEFAULT); + } + + this.createFile(filename); + ISaveHandler isavehandler = this.getSaveLoader(filename, false); + isavehandler.saveWorldInfo(worldinfo); + return true; + } + + private void createFile(String filename) + { + File file1 = new File(this.savesDirectory, filename); + + if (!file1.exists()) + { + logger.warn("Unable to create level.dat_mcr backup"); + } + else + { + File file2 = new File(file1, "level.dat"); + + if (!file2.exists()) + { + logger.warn("Unable to create level.dat_mcr backup"); + } + else + { + File file3 = new File(file1, "level.dat_mcr"); + + if (!file2.renameTo(file3)) + { + logger.warn("Unable to create level.dat_mcr backup"); + } + } + } + } + + private void convertFile(File p_75813_1_, Iterable p_75813_2_, WorldChunkManager p_75813_3_, int p_75813_4_, int p_75813_5_, IProgressUpdate p_75813_6_) + { + for (File file1 : p_75813_2_) + { + this.convertChunks(p_75813_1_, file1, p_75813_3_, p_75813_4_, p_75813_5_, p_75813_6_); + ++p_75813_4_; + int i = (int)Math.round(100.0D * (double)p_75813_4_ / (double)p_75813_5_); + p_75813_6_.setLoadingProgress(i); + } + } + + private void convertChunks(File p_75811_1_, File p_75811_2_, WorldChunkManager p_75811_3_, int p_75811_4_, int p_75811_5_, IProgressUpdate progressCallback) + { + try + { + String s = p_75811_2_.getName(); + RegionFile regionfile = new RegionFile(p_75811_2_); + RegionFile regionfile1 = new RegionFile(new File(p_75811_1_, s.substring(0, s.length() - ".mcr".length()) + ".mca")); + + for (int i = 0; i < 32; ++i) + { + for (int j = 0; j < 32; ++j) + { + if (regionfile.isChunkSaved(i, j) && !regionfile1.isChunkSaved(i, j)) + { + DataInputStream datainputstream = regionfile.getChunkDataInputStream(i, j); + + if (datainputstream == null) + { + logger.warn("Failed to fetch input stream"); + } + else + { + NBTTagCompound nbttagcompound = CompressedStreamTools.read(datainputstream); + datainputstream.close(); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Level"); + ChunkLoader.AnvilConverterData chunkloader$anvilconverterdata = ChunkLoader.load(nbttagcompound1); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + nbttagcompound2.setTag("Level", nbttagcompound3); + ChunkLoader.convertToAnvilFormat(chunkloader$anvilconverterdata, nbttagcompound3, p_75811_3_); + DataOutputStream dataoutputstream = regionfile1.getChunkDataOutputStream(i, j); + CompressedStreamTools.write(nbttagcompound2, dataoutputstream); + dataoutputstream.close(); + } + } + } + + int k = (int)Math.round(100.0D * (double)(p_75811_4_ * 1024) / (double)(p_75811_5_ * 1024)); + int l = (int)Math.round(100.0D * (double)((i + 1) * 32 + p_75811_4_ * 1024) / (double)(p_75811_5_ * 1024)); + + if (l > k) + { + progressCallback.setLoadingProgress(l); + } + } + + regionfile.close(); + regionfile1.close(); + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + private void addRegionFilesToCollection(File worldDir, Collection collection) + { + File file1 = new File(worldDir, "region"); + File[] afile = file1.listFiles(new FilenameFilter() + { + public boolean accept(File p_accept_1_, String p_accept_2_) + { + return p_accept_2_.endsWith(".mcr"); + } + }); + + if (afile != null) + { + Collections.addAll(collection, afile); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java new file mode 100644 index 0000000..01f8ae8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java @@ -0,0 +1,60 @@ +package net.minecraft.world.chunk.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldProviderEnd; +import net.minecraft.world.WorldProviderHell; +import net.minecraft.world.storage.SaveHandler; +import net.minecraft.world.storage.ThreadedFileIOBase; +import net.minecraft.world.storage.WorldInfo; + +public class AnvilSaveHandler extends SaveHandler +{ + public AnvilSaveHandler(File savesDirectory, String directoryName, boolean storePlayerdata) + { + super(savesDirectory, directoryName, storePlayerdata); + } + + public IChunkLoader getChunkLoader(WorldProvider provider) + { + File file1 = this.getWorldDirectory(); + + if (provider instanceof WorldProviderHell) + { + File file3 = new File(file1, "DIM-1"); + file3.mkdirs(); + return new AnvilChunkLoader(file3); + } + else if (provider instanceof WorldProviderEnd) + { + File file2 = new File(file1, "DIM1"); + file2.mkdirs(); + return new AnvilChunkLoader(file2); + } + else + { + return new AnvilChunkLoader(file1); + } + } + + public void saveWorldInfoWithPlayer(WorldInfo worldInformation, NBTTagCompound tagCompound) + { + worldInformation.setSaveVersion(19133); + super.saveWorldInfoWithPlayer(worldInformation, tagCompound); + } + + public void flush() + { + try + { + ThreadedFileIOBase.getThreadedIOInstance().waitForFinish(); + } + catch (InterruptedException interruptedexception) + { + interruptedexception.printStackTrace(); + } + + RegionFileCache.clearRegionFileReferences(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java new file mode 100644 index 0000000..a56b9f0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java @@ -0,0 +1,154 @@ +package net.minecraft.world.chunk.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.NibbleArray; + +public class ChunkLoader +{ + public static ChunkLoader.AnvilConverterData load(NBTTagCompound nbt) + { + int i = nbt.getInteger("xPos"); + int j = nbt.getInteger("zPos"); + ChunkLoader.AnvilConverterData chunkloader$anvilconverterdata = new ChunkLoader.AnvilConverterData(i, j); + chunkloader$anvilconverterdata.blocks = nbt.getByteArray("Blocks"); + chunkloader$anvilconverterdata.data = new NibbleArrayReader(nbt.getByteArray("Data"), 7); + chunkloader$anvilconverterdata.skyLight = new NibbleArrayReader(nbt.getByteArray("SkyLight"), 7); + chunkloader$anvilconverterdata.blockLight = new NibbleArrayReader(nbt.getByteArray("BlockLight"), 7); + chunkloader$anvilconverterdata.heightmap = nbt.getByteArray("HeightMap"); + chunkloader$anvilconverterdata.terrainPopulated = nbt.getBoolean("TerrainPopulated"); + chunkloader$anvilconverterdata.entities = nbt.getTagList("Entities", 10); + chunkloader$anvilconverterdata.tileEntities = nbt.getTagList("TileEntities", 10); + chunkloader$anvilconverterdata.tileTicks = nbt.getTagList("TileTicks", 10); + + try + { + chunkloader$anvilconverterdata.lastUpdated = nbt.getLong("LastUpdate"); + } + catch (ClassCastException var5) + { + chunkloader$anvilconverterdata.lastUpdated = (long)nbt.getInteger("LastUpdate"); + } + + return chunkloader$anvilconverterdata; + } + + public static void convertToAnvilFormat(ChunkLoader.AnvilConverterData p_76690_0_, NBTTagCompound compound, WorldChunkManager p_76690_2_) + { + compound.setInteger("xPos", p_76690_0_.x); + compound.setInteger("zPos", p_76690_0_.z); + compound.setLong("LastUpdate", p_76690_0_.lastUpdated); + int[] aint = new int[p_76690_0_.heightmap.length]; + + for (int i = 0; i < p_76690_0_.heightmap.length; ++i) + { + aint[i] = p_76690_0_.heightmap[i]; + } + + compound.setIntArray("HeightMap", aint); + compound.setBoolean("TerrainPopulated", p_76690_0_.terrainPopulated); + NBTTagList nbttaglist = new NBTTagList(); + + for (int j = 0; j < 8; ++j) + { + boolean flag = true; + + for (int k = 0; k < 16 && flag; ++k) + { + for (int l = 0; l < 16 && flag; ++l) + { + for (int i1 = 0; i1 < 16; ++i1) + { + int j1 = k << 11 | i1 << 7 | l + (j << 4); + int k1 = p_76690_0_.blocks[j1]; + + if (k1 != 0) + { + flag = false; + break; + } + } + } + } + + if (!flag) + { + byte[] abyte1 = new byte[4096]; + NibbleArray nibblearray = new NibbleArray(); + NibbleArray nibblearray1 = new NibbleArray(); + NibbleArray nibblearray2 = new NibbleArray(); + + for (int j3 = 0; j3 < 16; ++j3) + { + for (int l1 = 0; l1 < 16; ++l1) + { + for (int i2 = 0; i2 < 16; ++i2) + { + int j2 = j3 << 11 | i2 << 7 | l1 + (j << 4); + int k2 = p_76690_0_.blocks[j2]; + abyte1[l1 << 8 | i2 << 4 | j3] = (byte)(k2 & 255); + nibblearray.set(j3, l1, i2, p_76690_0_.data.get(j3, l1 + (j << 4), i2)); + nibblearray1.set(j3, l1, i2, p_76690_0_.skyLight.get(j3, l1 + (j << 4), i2)); + nibblearray2.set(j3, l1, i2, p_76690_0_.blockLight.get(j3, l1 + (j << 4), i2)); + } + } + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Y", (byte)(j & 255)); + nbttagcompound.setByteArray("Blocks", abyte1); + nbttagcompound.setByteArray("Data", nibblearray.getData()); + nbttagcompound.setByteArray("SkyLight", nibblearray1.getData()); + nbttagcompound.setByteArray("BlockLight", nibblearray2.getData()); + nbttaglist.appendTag(nbttagcompound); + } + } + + compound.setTag("Sections", nbttaglist); + byte[] abyte = new byte[256]; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l2 = 0; l2 < 16; ++l2) + { + for (int i3 = 0; i3 < 16; ++i3) + { + blockpos$mutableblockpos.set(p_76690_0_.x << 4 | l2, 0, p_76690_0_.z << 4 | i3); + abyte[i3 << 4 | l2] = (byte)(p_76690_2_.getBiomeGenerator(blockpos$mutableblockpos, BiomeGenBase.field_180279_ad).biomeID & 255); + } + } + + compound.setByteArray("Biomes", abyte); + compound.setTag("Entities", p_76690_0_.entities); + compound.setTag("TileEntities", p_76690_0_.tileEntities); + + if (p_76690_0_.tileTicks != null) + { + compound.setTag("TileTicks", p_76690_0_.tileTicks); + } + } + + public static class AnvilConverterData + { + public long lastUpdated; + public boolean terrainPopulated; + public byte[] heightmap; + public NibbleArrayReader blockLight; + public NibbleArrayReader skyLight; + public NibbleArrayReader data; + public byte[] blocks; + public NBTTagList entities; + public NBTTagList tileEntities; + public NBTTagList tileTicks; + public final int x; + public final int z; + + public AnvilConverterData(int xIn, int zIn) + { + this.x = xIn; + this.z = zIn; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java new file mode 100644 index 0000000..04f4672 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java @@ -0,0 +1,181 @@ +package net.minecraft.world.chunk.storage; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.chunk.NibbleArray; +import net.optifine.reflect.Reflector; + +public class ExtendedBlockStorage +{ + private int yBase; + private int blockRefCount; + private int tickRefCount; + private char[] data; + private NibbleArray blocklightArray; + private NibbleArray skylightArray; + + public ExtendedBlockStorage(int y, boolean storeSkylight) + { + this.yBase = y; + this.data = new char[4096]; + this.blocklightArray = new NibbleArray(); + + if (storeSkylight) + { + this.skylightArray = new NibbleArray(); + } + } + + public IBlockState get(int x, int y, int z) + { + IBlockState iblockstate = (IBlockState)Block.BLOCK_STATE_IDS.getByValue(this.data[y << 8 | z << 4 | x]); + return iblockstate != null ? iblockstate : Blocks.air.getDefaultState(); + } + + public void set(int x, int y, int z, IBlockState state) + { + if (Reflector.IExtendedBlockState.isInstance(state)) + { + state = (IBlockState)Reflector.call(state, Reflector.IExtendedBlockState_getClean, new Object[0]); + } + + IBlockState iblockstate = this.get(x, y, z); + Block block = iblockstate.getBlock(); + Block block1 = state.getBlock(); + + if (block != Blocks.air) + { + --this.blockRefCount; + + if (block.getTickRandomly()) + { + --this.tickRefCount; + } + } + + if (block1 != Blocks.air) + { + ++this.blockRefCount; + + if (block1.getTickRandomly()) + { + ++this.tickRefCount; + } + } + + this.data[y << 8 | z << 4 | x] = (char)Block.BLOCK_STATE_IDS.get(state); + } + + public Block getBlockByExtId(int x, int y, int z) + { + return this.get(x, y, z).getBlock(); + } + + public int getExtBlockMetadata(int x, int y, int z) + { + IBlockState iblockstate = this.get(x, y, z); + return iblockstate.getBlock().getMetaFromState(iblockstate); + } + + public boolean isEmpty() + { + return this.blockRefCount == 0; + } + + public boolean getNeedsRandomTick() + { + return this.tickRefCount > 0; + } + + public int getYLocation() + { + return this.yBase; + } + + public void setExtSkylightValue(int x, int y, int z, int value) + { + this.skylightArray.set(x, y, z, value); + } + + public int getExtSkylightValue(int x, int y, int z) + { + return this.skylightArray.get(x, y, z); + } + + public void setExtBlocklightValue(int x, int y, int z, int value) + { + this.blocklightArray.set(x, y, z, value); + } + + public int getExtBlocklightValue(int x, int y, int z) + { + return this.blocklightArray.get(x, y, z); + } + + public void removeInvalidBlocks() + { + IBlockState iblockstate = Blocks.air.getDefaultState(); + int i = 0; + int j = 0; + + for (int k = 0; k < 16; ++k) + { + for (int l = 0; l < 16; ++l) + { + for (int i1 = 0; i1 < 16; ++i1) + { + Block block = this.getBlockByExtId(i1, k, l); + + if (block != Blocks.air) + { + ++i; + + if (block.getTickRandomly()) + { + ++j; + } + } + } + } + } + + this.blockRefCount = i; + this.tickRefCount = j; + } + + public char[] getData() + { + return this.data; + } + + public void setData(char[] dataArray) + { + this.data = dataArray; + } + + public NibbleArray getBlocklightArray() + { + return this.blocklightArray; + } + + public NibbleArray getSkylightArray() + { + return this.skylightArray; + } + + public void setBlocklightArray(NibbleArray newBlocklightArray) + { + this.blocklightArray = newBlocklightArray; + } + + public void setSkylightArray(NibbleArray newSkylightArray) + { + this.skylightArray = newSkylightArray; + } + + public int getBlockRefCount() + { + return this.blockRefCount; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java new file mode 100644 index 0000000..cdca780 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java @@ -0,0 +1,19 @@ +package net.minecraft.world.chunk.storage; + +import java.io.IOException; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public interface IChunkLoader +{ + Chunk loadChunk(World worldIn, int x, int z) throws IOException; + + void saveChunk(World worldIn, Chunk chunkIn) throws MinecraftException, IOException; + + void saveExtraChunkData(World worldIn, Chunk chunkIn) throws IOException; + + void chunkTick(); + + void saveExtraData(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java new file mode 100644 index 0000000..4c78de0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java @@ -0,0 +1,23 @@ +package net.minecraft.world.chunk.storage; + +public class NibbleArrayReader +{ + public final byte[] data; + private final int depthBits; + private final int depthBitsPlusFour; + + public NibbleArrayReader(byte[] dataIn, int depthBitsIn) + { + this.data = dataIn; + this.depthBits = depthBitsIn; + this.depthBitsPlusFour = depthBitsIn + 4; + } + + public int get(int p_76686_1_, int p_76686_2_, int p_76686_3_) + { + int i = p_76686_1_ << this.depthBitsPlusFour | p_76686_3_ << this.depthBits | p_76686_2_; + int j = i >> 1; + int k = i & 1; + return k == 0 ? this.data[j] & 15 : this.data[j] >> 4 & 15; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/RegionFile.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/RegionFile.java new file mode 100644 index 0000000..39320a2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/RegionFile.java @@ -0,0 +1,333 @@ +package net.minecraft.world.chunk.storage; + +import com.google.common.collect.Lists; +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.List; +import java.util.zip.DeflaterOutputStream; +import java.util.zip.GZIPInputStream; +import java.util.zip.InflaterInputStream; +import net.minecraft.server.MinecraftServer; + +public class RegionFile +{ + private static final byte[] emptySector = new byte[4096]; + private final File fileName; + private RandomAccessFile dataFile; + private final int[] offsets = new int[1024]; + private final int[] chunkTimestamps = new int[1024]; + private List sectorFree; + private int sizeDelta; + private long lastModified; + + public RegionFile(File fileNameIn) + { + this.fileName = fileNameIn; + this.sizeDelta = 0; + + try + { + if (fileNameIn.exists()) + { + this.lastModified = fileNameIn.lastModified(); + } + + this.dataFile = new RandomAccessFile(fileNameIn, "rw"); + + if (this.dataFile.length() < 4096L) + { + for (int i = 0; i < 1024; ++i) + { + this.dataFile.writeInt(0); + } + + for (int i1 = 0; i1 < 1024; ++i1) + { + this.dataFile.writeInt(0); + } + + this.sizeDelta += 8192; + } + + if ((this.dataFile.length() & 4095L) != 0L) + { + for (int j1 = 0; (long)j1 < (this.dataFile.length() & 4095L); ++j1) + { + this.dataFile.write(0); + } + } + + int k1 = (int)this.dataFile.length() / 4096; + this.sectorFree = Lists.newArrayListWithCapacity(k1); + + for (int j = 0; j < k1; ++j) + { + this.sectorFree.add(Boolean.valueOf(true)); + } + + this.sectorFree.set(0, Boolean.valueOf(false)); + this.sectorFree.set(1, Boolean.valueOf(false)); + this.dataFile.seek(0L); + + for (int l1 = 0; l1 < 1024; ++l1) + { + int k = this.dataFile.readInt(); + this.offsets[l1] = k; + + if (k != 0 && (k >> 8) + (k & 255) <= this.sectorFree.size()) + { + for (int l = 0; l < (k & 255); ++l) + { + this.sectorFree.set((k >> 8) + l, Boolean.valueOf(false)); + } + } + } + + for (int i2 = 0; i2 < 1024; ++i2) + { + int j2 = this.dataFile.readInt(); + this.chunkTimestamps[i2] = j2; + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + public synchronized DataInputStream getChunkDataInputStream(int x, int z) + { + if (this.outOfBounds(x, z)) + { + return null; + } + else + { + try + { + int i = this.getOffset(x, z); + + if (i == 0) + { + return null; + } + else + { + int j = i >> 8; + int k = i & 255; + + if (j + k > this.sectorFree.size()) + { + return null; + } + else + { + this.dataFile.seek((long)(j * 4096)); + int l = this.dataFile.readInt(); + + if (l > 4096 * k) + { + return null; + } + else if (l <= 0) + { + return null; + } + else + { + byte b0 = this.dataFile.readByte(); + + if (b0 == 1) + { + byte[] abyte1 = new byte[l - 1]; + this.dataFile.read(abyte1); + return new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(abyte1)))); + } + else if (b0 == 2) + { + byte[] abyte = new byte[l - 1]; + this.dataFile.read(abyte); + return new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(abyte)))); + } + else + { + return null; + } + } + } + } + } + catch (IOException var9) + { + return null; + } + } + } + + public DataOutputStream getChunkDataOutputStream(int x, int z) + { + return this.outOfBounds(x, z) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFile.ChunkBuffer(x, z))); + } + + protected synchronized void write(int x, int z, byte[] data, int length) + { + try + { + int i = this.getOffset(x, z); + int j = i >> 8; + int k = i & 255; + int l = (length + 5) / 4096 + 1; + + if (l >= 256) + { + return; + } + + if (j != 0 && k == l) + { + this.write(j, data, length); + } + else + { + for (int i1 = 0; i1 < k; ++i1) + { + this.sectorFree.set(j + i1, Boolean.valueOf(true)); + } + + int l1 = this.sectorFree.indexOf(Boolean.valueOf(true)); + int j1 = 0; + + if (l1 != -1) + { + for (int k1 = l1; k1 < this.sectorFree.size(); ++k1) + { + if (j1 != 0) + { + if (((Boolean)this.sectorFree.get(k1)).booleanValue()) + { + ++j1; + } + else + { + j1 = 0; + } + } + else if (((Boolean)this.sectorFree.get(k1)).booleanValue()) + { + l1 = k1; + j1 = 1; + } + + if (j1 >= l) + { + break; + } + } + } + + if (j1 >= l) + { + j = l1; + this.setOffset(x, z, l1 << 8 | l); + + for (int j2 = 0; j2 < l; ++j2) + { + this.sectorFree.set(j + j2, Boolean.valueOf(false)); + } + + this.write(j, data, length); + } + else + { + this.dataFile.seek(this.dataFile.length()); + j = this.sectorFree.size(); + + for (int i2 = 0; i2 < l; ++i2) + { + this.dataFile.write(emptySector); + this.sectorFree.add(Boolean.valueOf(false)); + } + + this.sizeDelta += 4096 * l; + this.write(j, data, length); + this.setOffset(x, z, j << 8 | l); + } + } + + this.setChunkTimestamp(x, z, (int)(MinecraftServer.getCurrentTimeMillis() / 1000L)); + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + private void write(int sectorNumber, byte[] data, int length) throws IOException + { + this.dataFile.seek((long)(sectorNumber * 4096)); + this.dataFile.writeInt(length + 1); + this.dataFile.writeByte(2); + this.dataFile.write(data, 0, length); + } + + private boolean outOfBounds(int x, int z) + { + return x < 0 || x >= 32 || z < 0 || z >= 32; + } + + private int getOffset(int x, int z) + { + return this.offsets[x + z * 32]; + } + + public boolean isChunkSaved(int x, int z) + { + return this.getOffset(x, z) != 0; + } + + private void setOffset(int x, int z, int offset) throws IOException + { + this.offsets[x + z * 32] = offset; + this.dataFile.seek((long)((x + z * 32) * 4)); + this.dataFile.writeInt(offset); + } + + private void setChunkTimestamp(int x, int z, int timestamp) throws IOException + { + this.chunkTimestamps[x + z * 32] = timestamp; + this.dataFile.seek((long)(4096 + (x + z * 32) * 4)); + this.dataFile.writeInt(timestamp); + } + + public void close() throws IOException + { + if (this.dataFile != null) + { + this.dataFile.close(); + } + } + + class ChunkBuffer extends ByteArrayOutputStream + { + private int chunkX; + private int chunkZ; + + public ChunkBuffer(int x, int z) + { + super(8096); + this.chunkX = x; + this.chunkZ = z; + } + + public void close() throws IOException + { + RegionFile.this.write(this.chunkX, this.chunkZ, this.buf, this.count); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/RegionFileCache.java b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/RegionFileCache.java new file mode 100644 index 0000000..2c756ce --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/chunk/storage/RegionFileCache.java @@ -0,0 +1,73 @@ +package net.minecraft.world.chunk.storage; + +import com.google.common.collect.Maps; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.Map; + +public class RegionFileCache +{ + private static final Map regionsByFilename = Maps.newHashMap(); + + public static synchronized RegionFile createOrLoadRegionFile(File worldDir, int chunkX, int chunkZ) + { + File file1 = new File(worldDir, "region"); + File file2 = new File(file1, "r." + (chunkX >> 5) + "." + (chunkZ >> 5) + ".mca"); + RegionFile regionfile = (RegionFile)regionsByFilename.get(file2); + + if (regionfile != null) + { + return regionfile; + } + else + { + if (!file1.exists()) + { + file1.mkdirs(); + } + + if (regionsByFilename.size() >= 256) + { + clearRegionFileReferences(); + } + + RegionFile regionfile1 = new RegionFile(file2); + regionsByFilename.put(file2, regionfile1); + return regionfile1; + } + } + + public static synchronized void clearRegionFileReferences() + { + for (RegionFile regionfile : regionsByFilename.values()) + { + try + { + if (regionfile != null) + { + regionfile.close(); + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + regionsByFilename.clear(); + } + + public static DataInputStream getChunkInputStream(File worldDir, int chunkX, int chunkZ) + { + RegionFile regionfile = createOrLoadRegionFile(worldDir, chunkX, chunkZ); + return regionfile.getChunkDataInputStream(chunkX & 31, chunkZ & 31); + } + + public static DataOutputStream getChunkOutputStream(File worldDir, int chunkX, int chunkZ) + { + RegionFile regionfile = createOrLoadRegionFile(worldDir, chunkX, chunkZ); + return regionfile.getChunkDataOutputStream(chunkX & 31, chunkZ & 31); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/demo/DemoWorldManager.java b/Client-1.8.9/src/main/java/net/minecraft/world/demo/DemoWorldManager.java new file mode 100644 index 0000000..a8c209c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/demo/DemoWorldManager.java @@ -0,0 +1,131 @@ +package net.minecraft.world.demo; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class DemoWorldManager extends ItemInWorldManager +{ + private boolean field_73105_c; + private boolean demoTimeExpired; + private int field_73104_e; + private int field_73102_f; + + public DemoWorldManager(World worldIn) + { + super(worldIn); + } + + public void updateBlockRemoving() + { + super.updateBlockRemoving(); + ++this.field_73102_f; + long i = this.theWorld.getTotalWorldTime(); + long j = i / 24000L + 1L; + + if (!this.field_73105_c && this.field_73102_f > 20) + { + this.field_73105_c = true; + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 0.0F)); + } + + this.demoTimeExpired = i > 120500L; + + if (this.demoTimeExpired) + { + ++this.field_73104_e; + } + + if (i % 24000L == 500L) + { + if (j <= 6L) + { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day." + j, new Object[0])); + } + } + else if (j == 1L) + { + if (i == 100L) + { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 101.0F)); + } + else if (i == 175L) + { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 102.0F)); + } + else if (i == 250L) + { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 103.0F)); + } + } + else if (j == 5L && i % 24000L == 22000L) + { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day.warning", new Object[0])); + } + } + + private void sendDemoReminder() + { + if (this.field_73104_e > 100) + { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.reminder", new Object[0])); + this.field_73104_e = 0; + } + } + + public void onBlockClicked(BlockPos pos, EnumFacing side) + { + if (this.demoTimeExpired) + { + this.sendDemoReminder(); + } + else + { + super.onBlockClicked(pos, side); + } + } + + public void blockRemoving(BlockPos pos) + { + if (!this.demoTimeExpired) + { + super.blockRemoving(pos); + } + } + + public boolean tryHarvestBlock(BlockPos pos) + { + return this.demoTimeExpired ? false : super.tryHarvestBlock(pos); + } + + public boolean tryUseItem(EntityPlayer player, World worldIn, ItemStack stack) + { + if (this.demoTimeExpired) + { + this.sendDemoReminder(); + return false; + } + else + { + return super.tryUseItem(player, worldIn, stack); + } + } + + public boolean activateBlockOrUseItem(EntityPlayer player, World worldIn, ItemStack stack, BlockPos pos, EnumFacing side, float offsetX, float offsetY, float offsetZ) + { + if (this.demoTimeExpired) + { + this.sendDemoReminder(); + return false; + } + else + { + return super.activateBlockOrUseItem(player, worldIn, stack, pos, side, offsetX, offsetY, offsetZ); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/demo/DemoWorldServer.java b/Client-1.8.9/src/main/java/net/minecraft/world/demo/DemoWorldServer.java new file mode 100644 index 0000000..6f09475 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/demo/DemoWorldServer.java @@ -0,0 +1,21 @@ +package net.minecraft.world.demo; + +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; + +public class DemoWorldServer extends WorldServer +{ + private static final long demoWorldSeed = (long)"North Carolina".hashCode(); + public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, WorldSettings.GameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest(); + + public DemoWorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo worldInfoIn, int dimensionId, Profiler profilerIn) + { + super(server, saveHandlerIn, worldInfoIn, dimensionId, profilerIn); + this.worldInfo.populateFromWorldSettings(demoWorldSettings); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderDebug.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderDebug.java new file mode 100644 index 0000000..08bca6f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderDebug.java @@ -0,0 +1,160 @@ +package net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; + +public class ChunkProviderDebug implements IChunkProvider +{ + private static final List field_177464_a = Lists.newArrayList(); + private static final int field_177462_b; + private static final int field_181039_c; + private final World world; + + public ChunkProviderDebug(World worldIn) + { + this.world = worldIn; + } + + public Chunk provideChunk(int x, int z) + { + ChunkPrimer chunkprimer = new ChunkPrimer(); + + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + int k = x * 16 + i; + int l = z * 16 + j; + chunkprimer.setBlockState(i, 60, j, Blocks.barrier.getDefaultState()); + IBlockState iblockstate = func_177461_b(k, l); + + if (iblockstate != null) + { + chunkprimer.setBlockState(i, 70, j, iblockstate); + } + } + } + + Chunk chunk = new Chunk(this.world, chunkprimer, x, z); + chunk.generateSkylightMap(); + BiomeGenBase[] abiomegenbase = this.world.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, x * 16, z * 16, 16, 16); + byte[] abyte = chunk.getBiomeArray(); + + for (int i1 = 0; i1 < abyte.length; ++i1) + { + abyte[i1] = (byte)abiomegenbase[i1].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + public static IBlockState func_177461_b(int p_177461_0_, int p_177461_1_) + { + IBlockState iblockstate = null; + + if (p_177461_0_ > 0 && p_177461_1_ > 0 && p_177461_0_ % 2 != 0 && p_177461_1_ % 2 != 0) + { + p_177461_0_ = p_177461_0_ / 2; + p_177461_1_ = p_177461_1_ / 2; + + if (p_177461_0_ <= field_177462_b && p_177461_1_ <= field_181039_c) + { + int i = MathHelper.abs_int(p_177461_0_ * field_177462_b + p_177461_1_); + + if (i < field_177464_a.size()) + { + iblockstate = (IBlockState)field_177464_a.get(i); + } + } + } + + return iblockstate; + } + + public boolean chunkExists(int x, int z) + { + return true; + } + + public void populate(IChunkProvider chunkProvider, int x, int z) + { + } + + public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z) + { + return false; + } + + public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback) + { + return true; + } + + public void saveExtraData() + { + } + + public boolean unloadQueuedChunks() + { + return false; + } + + public boolean canSave() + { + return true; + } + + public String makeString() + { + return "DebugLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) + { + BiomeGenBase biomegenbase = this.world.getBiomeGenForCoords(pos); + return biomegenbase.getSpawnableList(creatureType); + } + + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + { + return null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(Chunk chunkIn, int x, int z) + { + } + + public Chunk provideChunk(BlockPos blockPosIn) + { + return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); + } + + static + { + for (Block block : Block.blockRegistry) + { + field_177464_a.addAll(block.getBlockState().getValidStates()); + } + + field_177462_b = MathHelper.ceiling_float_int(MathHelper.sqrt_float((float)field_177464_a.size())); + field_181039_c = MathHelper.ceiling_float_int((float)field_177464_a.size() / (float)field_177462_b); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java new file mode 100644 index 0000000..af87526 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java @@ -0,0 +1,333 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; + +public class ChunkProviderEnd implements IChunkProvider +{ + private Random endRNG; + private NoiseGeneratorOctaves noiseGen1; + private NoiseGeneratorOctaves noiseGen2; + private NoiseGeneratorOctaves noiseGen3; + public NoiseGeneratorOctaves noiseGen4; + public NoiseGeneratorOctaves noiseGen5; + private World endWorld; + private double[] densities; + private BiomeGenBase[] biomesForGeneration; + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + + public ChunkProviderEnd(World worldIn, long seed) + { + this.endWorld = worldIn; + this.endRNG = new Random(seed); + this.noiseGen1 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen2 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); + this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); + this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); + } + + public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer p_180520_3_) + { + int i = 2; + int j = i + 1; + int k = 33; + int l = i + 1; + this.densities = this.initializeNoiseField(this.densities, p_180520_1_ * i, 0, p_180520_2_ * i, j, k, l); + + for (int i1 = 0; i1 < i; ++i1) + { + for (int j1 = 0; j1 < i; ++j1) + { + for (int k1 = 0; k1 < 32; ++k1) + { + double d0 = 0.25D; + double d1 = this.densities[((i1 + 0) * l + j1 + 0) * k + k1 + 0]; + double d2 = this.densities[((i1 + 0) * l + j1 + 1) * k + k1 + 0]; + double d3 = this.densities[((i1 + 1) * l + j1 + 0) * k + k1 + 0]; + double d4 = this.densities[((i1 + 1) * l + j1 + 1) * k + k1 + 0]; + double d5 = (this.densities[((i1 + 0) * l + j1 + 0) * k + k1 + 1] - d1) * d0; + double d6 = (this.densities[((i1 + 0) * l + j1 + 1) * k + k1 + 1] - d2) * d0; + double d7 = (this.densities[((i1 + 1) * l + j1 + 0) * k + k1 + 1] - d3) * d0; + double d8 = (this.densities[((i1 + 1) * l + j1 + 1) * k + k1 + 1] - d4) * d0; + + for (int l1 = 0; l1 < 4; ++l1) + { + double d9 = 0.125D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int i2 = 0; i2 < 8; ++i2) + { + double d14 = 0.125D; + double d15 = d10; + double d16 = (d11 - d10) * d14; + + for (int j2 = 0; j2 < 8; ++j2) + { + IBlockState iblockstate = null; + + if (d15 > 0.0D) + { + iblockstate = Blocks.end_stone.getDefaultState(); + } + + int k2 = i2 + i1 * 8; + int l2 = l1 + k1 * 4; + int i3 = j2 + j1 * 8; + p_180520_3_.setBlockState(k2, l2, i3, iblockstate); + d15 += d16; + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } + + public void func_180519_a(ChunkPrimer p_180519_1_) + { + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + int k = 1; + int l = -1; + IBlockState iblockstate = Blocks.end_stone.getDefaultState(); + IBlockState iblockstate1 = Blocks.end_stone.getDefaultState(); + + for (int i1 = 127; i1 >= 0; --i1) + { + IBlockState iblockstate2 = p_180519_1_.getBlockState(i, i1, j); + + if (iblockstate2.getBlock().getMaterial() == Material.air) + { + l = -1; + } + else if (iblockstate2.getBlock() == Blocks.stone) + { + if (l == -1) + { + if (k <= 0) + { + iblockstate = Blocks.air.getDefaultState(); + iblockstate1 = Blocks.end_stone.getDefaultState(); + } + + l = k; + + if (i1 >= 0) + { + p_180519_1_.setBlockState(i, i1, j, iblockstate); + } + else + { + p_180519_1_.setBlockState(i, i1, j, iblockstate1); + } + } + else if (l > 0) + { + --l; + p_180519_1_.setBlockState(i, i1, j, iblockstate1); + } + } + } + } + } + } + + public Chunk provideChunk(int x, int z) + { + this.endRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16); + this.func_180520_a(x, z, chunkprimer); + this.func_180519_a(chunkprimer); + Chunk chunk = new Chunk(this.endWorld, chunkprimer, x, z); + byte[] abyte = chunk.getBiomeArray(); + + for (int i = 0; i < abyte.length; ++i) + { + abyte[i] = (byte)this.biomesForGeneration[i].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + private double[] initializeNoiseField(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) + { + if (p_73187_1_ == null) + { + p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; + } + + double d0 = 684.412D; + double d1 = 684.412D; + this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, p_73187_2_, p_73187_4_, p_73187_5_, p_73187_7_, 1.121D, 1.121D, 0.5D); + this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, p_73187_2_, p_73187_4_, p_73187_5_, p_73187_7_, 200.0D, 200.0D, 0.5D); + d0 = d0 * 2.0D; + this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, d0 / 80.0D, d1 / 160.0D, d0 / 80.0D); + this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, d0, d1, d0); + this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, d0, d1, d0); + int i = 0; + + for (int j = 0; j < p_73187_5_; ++j) + { + for (int k = 0; k < p_73187_7_; ++k) + { + float f = (float)(j + p_73187_2_) / 1.0F; + float f1 = (float)(k + p_73187_4_) / 1.0F; + float f2 = 100.0F - MathHelper.sqrt_float(f * f + f1 * f1) * 8.0F; + + if (f2 > 80.0F) + { + f2 = 80.0F; + } + + if (f2 < -100.0F) + { + f2 = -100.0F; + } + + for (int l = 0; l < p_73187_6_; ++l) + { + double d2 = 0.0D; + double d3 = this.noiseData2[i] / 512.0D; + double d4 = this.noiseData3[i] / 512.0D; + double d5 = (this.noiseData1[i] / 10.0D + 1.0D) / 2.0D; + + if (d5 < 0.0D) + { + d2 = d3; + } + else if (d5 > 1.0D) + { + d2 = d4; + } + else + { + d2 = d3 + (d4 - d3) * d5; + } + + d2 = d2 - 8.0D; + d2 = d2 + (double)f2; + int i1 = 2; + + if (l > p_73187_6_ / 2 - i1) + { + double d6 = (double)((float)(l - (p_73187_6_ / 2 - i1)) / 64.0F); + d6 = MathHelper.clamp_double(d6, 0.0D, 1.0D); + d2 = d2 * (1.0D - d6) + -3000.0D * d6; + } + + i1 = 8; + + if (l < i1) + { + double d7 = (double)((float)(i1 - l) / ((float)i1 - 1.0F)); + d2 = d2 * (1.0D - d7) + -30.0D * d7; + } + + p_73187_1_[i] = d2; + ++i; + } + } + } + + return p_73187_1_; + } + + public boolean chunkExists(int x, int z) + { + return true; + } + + public void populate(IChunkProvider chunkProvider, int x, int z) + { + BlockFalling.fallInstantly = true; + BlockPos blockpos = new BlockPos(x * 16, 0, z * 16); + this.endWorld.getBiomeGenForCoords(blockpos.add(16, 0, 16)).decorate(this.endWorld, this.endWorld.rand, blockpos); + BlockFalling.fallInstantly = false; + } + + public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z) + { + return false; + } + + public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback) + { + return true; + } + + public void saveExtraData() + { + } + + public boolean unloadQueuedChunks() + { + return false; + } + + public boolean canSave() + { + return true; + } + + public String makeString() + { + return "RandomLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) + { + return this.endWorld.getBiomeGenForCoords(pos).getSpawnableList(creatureType); + } + + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + { + return null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(Chunk chunkIn, int x, int z) + { + } + + public Chunk provideChunk(BlockPos blockPosIn) + { + return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java new file mode 100644 index 0000000..841648c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java @@ -0,0 +1,288 @@ +package net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.gen.structure.StructureOceanMonument; + +public class ChunkProviderFlat implements IChunkProvider +{ + private World worldObj; + private Random random; + private final IBlockState[] cachedBlockIDs = new IBlockState[256]; + private final FlatGeneratorInfo flatWorldGenInfo; + private final List structureGenerators = Lists.newArrayList(); + private final boolean hasDecoration; + private final boolean hasDungeons; + private WorldGenLakes waterLakeGenerator; + private WorldGenLakes lavaLakeGenerator; + + public ChunkProviderFlat(World worldIn, long seed, boolean generateStructures, String flatGeneratorSettings) + { + this.worldObj = worldIn; + this.random = new Random(seed); + this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(flatGeneratorSettings); + + if (generateStructures) + { + Map> map = this.flatWorldGenInfo.getWorldFeatures(); + + if (map.containsKey("village")) + { + Map map1 = (Map)map.get("village"); + + if (!map1.containsKey("size")) + { + map1.put("size", "1"); + } + + this.structureGenerators.add(new MapGenVillage(map1)); + } + + if (map.containsKey("biome_1")) + { + this.structureGenerators.add(new MapGenScatteredFeature((Map)map.get("biome_1"))); + } + + if (map.containsKey("mineshaft")) + { + this.structureGenerators.add(new MapGenMineshaft((Map)map.get("mineshaft"))); + } + + if (map.containsKey("stronghold")) + { + this.structureGenerators.add(new MapGenStronghold((Map)map.get("stronghold"))); + } + + if (map.containsKey("oceanmonument")) + { + this.structureGenerators.add(new StructureOceanMonument((Map)map.get("oceanmonument"))); + } + } + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) + { + this.waterLakeGenerator = new WorldGenLakes(Blocks.water); + } + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) + { + this.lavaLakeGenerator = new WorldGenLakes(Blocks.lava); + } + + this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon"); + int j = 0; + int k = 0; + boolean flag = true; + + for (FlatLayerInfo flatlayerinfo : this.flatWorldGenInfo.getFlatLayers()) + { + for (int i = flatlayerinfo.getMinY(); i < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++i) + { + IBlockState iblockstate = flatlayerinfo.getLayerMaterial(); + + if (iblockstate.getBlock() != Blocks.air) + { + flag = false; + this.cachedBlockIDs[i] = iblockstate; + } + } + + if (flatlayerinfo.getLayerMaterial().getBlock() == Blocks.air) + { + k += flatlayerinfo.getLayerCount(); + } + else + { + j += flatlayerinfo.getLayerCount() + k; + k = 0; + } + } + + worldIn.setSeaLevel(j); + this.hasDecoration = flag ? false : this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration"); + } + + public Chunk provideChunk(int x, int z) + { + ChunkPrimer chunkprimer = new ChunkPrimer(); + + for (int i = 0; i < this.cachedBlockIDs.length; ++i) + { + IBlockState iblockstate = this.cachedBlockIDs[i]; + + if (iblockstate != null) + { + for (int j = 0; j < 16; ++j) + { + for (int k = 0; k < 16; ++k) + { + chunkprimer.setBlockState(j, i, k, iblockstate); + } + } + } + } + + for (MapGenBase mapgenbase : this.structureGenerators) + { + mapgenbase.generate(this, this.worldObj, x, z, chunkprimer); + } + + Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z); + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, x * 16, z * 16, 16, 16); + byte[] abyte = chunk.getBiomeArray(); + + for (int l = 0; l < abyte.length; ++l) + { + abyte[l] = (byte)abiomegenbase[l].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + public boolean chunkExists(int x, int z) + { + return true; + } + + public void populate(IChunkProvider chunkProvider, int x, int z) + { + int i = x * 16; + int j = z * 16; + BlockPos blockpos = new BlockPos(i, 0, j); + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(i + 16, 0, j + 16)); + boolean flag = false; + this.random.setSeed(this.worldObj.getSeed()); + long k = this.random.nextLong() / 2L * 2L + 1L; + long l = this.random.nextLong() / 2L * 2L + 1L; + this.random.setSeed((long)x * k + (long)z * l ^ this.worldObj.getSeed()); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); + + for (MapGenStructure mapgenstructure : this.structureGenerators) + { + boolean flag1 = mapgenstructure.generateStructure(this.worldObj, this.random, chunkcoordintpair); + + if (mapgenstructure instanceof MapGenVillage) + { + flag |= flag1; + } + } + + if (this.waterLakeGenerator != null && !flag && this.random.nextInt(4) == 0) + { + this.waterLakeGenerator.generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8)); + } + + if (this.lavaLakeGenerator != null && !flag && this.random.nextInt(8) == 0) + { + BlockPos blockpos1 = blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(this.random.nextInt(248) + 8), this.random.nextInt(16) + 8); + + if (blockpos1.getY() < this.worldObj.getSeaLevel() || this.random.nextInt(10) == 0) + { + this.lavaLakeGenerator.generate(this.worldObj, this.random, blockpos1); + } + } + + if (this.hasDungeons) + { + for (int i1 = 0; i1 < 8; ++i1) + { + (new WorldGenDungeons()).generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8)); + } + } + + if (this.hasDecoration) + { + biomegenbase.decorate(this.worldObj, this.random, blockpos); + } + } + + public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z) + { + return false; + } + + public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback) + { + return true; + } + + public void saveExtraData() + { + } + + public boolean unloadQueuedChunks() + { + return false; + } + + public boolean canSave() + { + return true; + } + + public String makeString() + { + return "FlatLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos); + return biomegenbase.getSpawnableList(creatureType); + } + + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + { + if ("Stronghold".equals(structureName)) + { + for (MapGenStructure mapgenstructure : this.structureGenerators) + { + if (mapgenstructure instanceof MapGenStronghold) + { + return mapgenstructure.getClosestStrongholdPos(worldIn, position); + } + } + } + + return null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(Chunk chunkIn, int x, int z) + { + for (MapGenStructure mapgenstructure : this.structureGenerators) + { + mapgenstructure.generate(this, this.worldObj, x, z, (ChunkPrimer)null); + } + } + + public Chunk provideChunk(BlockPos blockPosIn) + { + return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java new file mode 100644 index 0000000..aa591a2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -0,0 +1,549 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.gen.structure.StructureOceanMonument; + +public class ChunkProviderGenerate implements IChunkProvider +{ + private Random rand; + private NoiseGeneratorOctaves field_147431_j; + private NoiseGeneratorOctaves field_147432_k; + private NoiseGeneratorOctaves field_147429_l; + private NoiseGeneratorPerlin field_147430_m; + public NoiseGeneratorOctaves noiseGen5; + public NoiseGeneratorOctaves noiseGen6; + public NoiseGeneratorOctaves mobSpawnerNoise; + private World worldObj; + private final boolean mapFeaturesEnabled; + private WorldType field_177475_o; + private final double[] field_147434_q; + private final float[] parabolicField; + private ChunkProviderSettings settings; + private Block oceanBlockTmpl = Blocks.water; + private double[] stoneNoise = new double[256]; + private MapGenBase caveGenerator = new MapGenCaves(); + private MapGenStronghold strongholdGenerator = new MapGenStronghold(); + private MapGenVillage villageGenerator = new MapGenVillage(); + private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); + private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); + private MapGenBase ravineGenerator = new MapGenRavine(); + private StructureOceanMonument oceanMonumentGenerator = new StructureOceanMonument(); + private BiomeGenBase[] biomesForGeneration; + double[] mainNoiseArray; + double[] lowerLimitNoiseArray; + double[] upperLimitNoiseArray; + double[] depthNoiseArray; + + public ChunkProviderGenerate(World worldIn, long seed, boolean generateStructures, String structuresJson) + { + this.worldObj = worldIn; + this.mapFeaturesEnabled = generateStructures; + this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); + this.rand = new Random(seed); + this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); + this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); + this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); + this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147434_q = new double[825]; + this.parabolicField = new float[25]; + + for (int i = -2; i <= 2; ++i) + { + for (int j = -2; j <= 2; ++j) + { + float f = 10.0F / MathHelper.sqrt_float((float)(i * i + j * j) + 0.2F); + this.parabolicField[i + 2 + (j + 2) * 5] = f; + } + } + + if (structuresJson != null) + { + this.settings = ChunkProviderSettings.Factory.jsonToFactory(structuresJson).func_177864_b(); + this.oceanBlockTmpl = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; + worldIn.setSeaLevel(this.settings.seaLevel); + } + } + + public void setBlocksInChunk(int x, int z, ChunkPrimer primer) + { + this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, x * 4 - 2, z * 4 - 2, 10, 10); + this.func_147423_a(x * 4, 0, z * 4); + + for (int i = 0; i < 4; ++i) + { + int j = i * 5; + int k = (i + 1) * 5; + + for (int l = 0; l < 4; ++l) + { + int i1 = (j + l) * 33; + int j1 = (j + l + 1) * 33; + int k1 = (k + l) * 33; + int l1 = (k + l + 1) * 33; + + for (int i2 = 0; i2 < 32; ++i2) + { + double d0 = 0.125D; + double d1 = this.field_147434_q[i1 + i2]; + double d2 = this.field_147434_q[j1 + i2]; + double d3 = this.field_147434_q[k1 + i2]; + double d4 = this.field_147434_q[l1 + i2]; + double d5 = (this.field_147434_q[i1 + i2 + 1] - d1) * d0; + double d6 = (this.field_147434_q[j1 + i2 + 1] - d2) * d0; + double d7 = (this.field_147434_q[k1 + i2 + 1] - d3) * d0; + double d8 = (this.field_147434_q[l1 + i2 + 1] - d4) * d0; + + for (int j2 = 0; j2 < 8; ++j2) + { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int k2 = 0; k2 < 4; ++k2) + { + double d14 = 0.25D; + double d16 = (d11 - d10) * d14; + double lvt_45_1_ = d10 - d16; + + for (int l2 = 0; l2 < 4; ++l2) + { + if ((lvt_45_1_ += d16) > 0.0D) + { + primer.setBlockState(i * 4 + k2, i2 * 8 + j2, l * 4 + l2, Blocks.stone.getDefaultState()); + } + else if (i2 * 8 + j2 < this.settings.seaLevel) + { + primer.setBlockState(i * 4 + k2, i2 * 8 + j2, l * 4 + l2, this.oceanBlockTmpl.getDefaultState()); + } + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } + + public void replaceBlocksForBiome(int x, int z, ChunkPrimer primer, BiomeGenBase[] biomeGens) + { + double d0 = 0.03125D; + this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(x * 16), (double)(z * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + BiomeGenBase biomegenbase = biomeGens[j + i * 16]; + biomegenbase.genTerrainBlocks(this.worldObj, this.rand, primer, x * 16 + i, z * 16 + j, this.stoneNoise[j + i * 16]); + } + } + } + + public Chunk provideChunk(int x, int z) + { + this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.setBlocksInChunk(x, z, chunkprimer); + this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16); + this.replaceBlocksForBiome(x, z, chunkprimer, this.biomesForGeneration); + + if (this.settings.useCaves) + { + this.caveGenerator.generate(this, this.worldObj, x, z, chunkprimer); + } + + if (this.settings.useRavines) + { + this.ravineGenerator.generate(this, this.worldObj, x, z, chunkprimer); + } + + if (this.settings.useMineShafts && this.mapFeaturesEnabled) + { + this.mineshaftGenerator.generate(this, this.worldObj, x, z, chunkprimer); + } + + if (this.settings.useVillages && this.mapFeaturesEnabled) + { + this.villageGenerator.generate(this, this.worldObj, x, z, chunkprimer); + } + + if (this.settings.useStrongholds && this.mapFeaturesEnabled) + { + this.strongholdGenerator.generate(this, this.worldObj, x, z, chunkprimer); + } + + if (this.settings.useTemples && this.mapFeaturesEnabled) + { + this.scatteredFeatureGenerator.generate(this, this.worldObj, x, z, chunkprimer); + } + + if (this.settings.useMonuments && this.mapFeaturesEnabled) + { + this.oceanMonumentGenerator.generate(this, this.worldObj, x, z, chunkprimer); + } + + Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z); + byte[] abyte = chunk.getBiomeArray(); + + for (int i = 0; i < abyte.length; ++i) + { + abyte[i] = (byte)this.biomesForGeneration[i].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + private void func_147423_a(int x, int y, int z) + { + this.depthNoiseArray = this.noiseGen6.generateNoiseOctaves(this.depthNoiseArray, x, z, 5, 5, (double)this.settings.depthNoiseScaleX, (double)this.settings.depthNoiseScaleZ, (double)this.settings.depthNoiseScaleExponent); + float f = this.settings.coordinateScale; + float f1 = this.settings.heightScale; + this.mainNoiseArray = this.field_147429_l.generateNoiseOctaves(this.mainNoiseArray, x, y, z, 5, 33, 5, (double)(f / this.settings.mainNoiseScaleX), (double)(f1 / this.settings.mainNoiseScaleY), (double)(f / this.settings.mainNoiseScaleZ)); + this.lowerLimitNoiseArray = this.field_147431_j.generateNoiseOctaves(this.lowerLimitNoiseArray, x, y, z, 5, 33, 5, (double)f, (double)f1, (double)f); + this.upperLimitNoiseArray = this.field_147432_k.generateNoiseOctaves(this.upperLimitNoiseArray, x, y, z, 5, 33, 5, (double)f, (double)f1, (double)f); + z = 0; + x = 0; + int i = 0; + int j = 0; + + for (int k = 0; k < 5; ++k) + { + for (int l = 0; l < 5; ++l) + { + float f2 = 0.0F; + float f3 = 0.0F; + float f4 = 0.0F; + int i1 = 2; + BiomeGenBase biomegenbase = this.biomesForGeneration[k + 2 + (l + 2) * 10]; + + for (int j1 = -i1; j1 <= i1; ++j1) + { + for (int k1 = -i1; k1 <= i1; ++k1) + { + BiomeGenBase biomegenbase1 = this.biomesForGeneration[k + j1 + 2 + (l + k1 + 2) * 10]; + float f5 = this.settings.biomeDepthOffSet + biomegenbase1.minHeight * this.settings.biomeDepthWeight; + float f6 = this.settings.biomeScaleOffset + biomegenbase1.maxHeight * this.settings.biomeScaleWeight; + + if (this.field_177475_o == WorldType.AMPLIFIED && f5 > 0.0F) + { + f5 = 1.0F + f5 * 2.0F; + f6 = 1.0F + f6 * 4.0F; + } + + float f7 = this.parabolicField[j1 + 2 + (k1 + 2) * 5] / (f5 + 2.0F); + + if (biomegenbase1.minHeight > biomegenbase.minHeight) + { + f7 /= 2.0F; + } + + f2 += f6 * f7; + f3 += f5 * f7; + f4 += f7; + } + } + + f2 = f2 / f4; + f3 = f3 / f4; + f2 = f2 * 0.9F + 0.1F; + f3 = (f3 * 4.0F - 1.0F) / 8.0F; + double d7 = this.depthNoiseArray[j] / 8000.0D; + + if (d7 < 0.0D) + { + d7 = -d7 * 0.3D; + } + + d7 = d7 * 3.0D - 2.0D; + + if (d7 < 0.0D) + { + d7 = d7 / 2.0D; + + if (d7 < -1.0D) + { + d7 = -1.0D; + } + + d7 = d7 / 1.4D; + d7 = d7 / 2.0D; + } + else + { + if (d7 > 1.0D) + { + d7 = 1.0D; + } + + d7 = d7 / 8.0D; + } + + ++j; + double d8 = (double)f3; + double d9 = (double)f2; + d8 = d8 + d7 * 0.2D; + d8 = d8 * (double)this.settings.baseSize / 8.0D; + double d0 = (double)this.settings.baseSize + d8 * 4.0D; + + for (int l1 = 0; l1 < 33; ++l1) + { + double d1 = ((double)l1 - d0) * (double)this.settings.stretchY * 128.0D / 256.0D / d9; + + if (d1 < 0.0D) + { + d1 *= 4.0D; + } + + double d2 = this.lowerLimitNoiseArray[i] / (double)this.settings.lowerLimitScale; + double d3 = this.upperLimitNoiseArray[i] / (double)this.settings.upperLimitScale; + double d4 = (this.mainNoiseArray[i] / 10.0D + 1.0D) / 2.0D; + double d5 = MathHelper.denormalizeClamp(d2, d3, d4) - d1; + + if (l1 > 29) + { + double d6 = (double)((float)(l1 - 29) / 3.0F); + d5 = d5 * (1.0D - d6) + -10.0D * d6; + } + + this.field_147434_q[i] = d5; + ++i; + } + } + } + } + + public boolean chunkExists(int x, int z) + { + return true; + } + + public void populate(IChunkProvider chunkProvider, int x, int z) + { + BlockFalling.fallInstantly = true; + int i = x * 16; + int j = z * 16; + BlockPos blockpos = new BlockPos(i, 0, j); + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(blockpos.add(16, 0, 16)); + this.rand.setSeed(this.worldObj.getSeed()); + long k = this.rand.nextLong() / 2L * 2L + 1L; + long l = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed((long)x * k + (long)z * l ^ this.worldObj.getSeed()); + boolean flag = false; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); + + if (this.settings.useMineShafts && this.mapFeaturesEnabled) + { + this.mineshaftGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useVillages && this.mapFeaturesEnabled) + { + flag = this.villageGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useStrongholds && this.mapFeaturesEnabled) + { + this.strongholdGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useTemples && this.mapFeaturesEnabled) + { + this.scatteredFeatureGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (this.settings.useMonuments && this.mapFeaturesEnabled) + { + this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); + } + + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.settings.useWaterLakes && !flag && this.rand.nextInt(this.settings.waterLakeChance) == 0) + { + int i1 = this.rand.nextInt(16) + 8; + int j1 = this.rand.nextInt(256); + int k1 = this.rand.nextInt(16) + 8; + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, blockpos.add(i1, j1, k1)); + } + + if (!flag && this.rand.nextInt(this.settings.lavaLakeChance / 10) == 0 && this.settings.useLavaLakes) + { + int i2 = this.rand.nextInt(16) + 8; + int l2 = this.rand.nextInt(this.rand.nextInt(248) + 8); + int k3 = this.rand.nextInt(16) + 8; + + if (l2 < this.worldObj.getSeaLevel() || this.rand.nextInt(this.settings.lavaLakeChance / 8) == 0) + { + (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, blockpos.add(i2, l2, k3)); + } + } + + if (this.settings.useDungeons) + { + for (int j2 = 0; j2 < this.settings.dungeonChance; ++j2) + { + int i3 = this.rand.nextInt(16) + 8; + int l3 = this.rand.nextInt(256); + int l1 = this.rand.nextInt(16) + 8; + (new WorldGenDungeons()).generate(this.worldObj, this.rand, blockpos.add(i3, l3, l1)); + } + } + + biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(i, 0, j)); + SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, i + 8, j + 8, 16, 16, this.rand); + blockpos = blockpos.add(8, 0, 8); + + for (int k2 = 0; k2 < 16; ++k2) + { + for (int j3 = 0; j3 < 16; ++j3) + { + BlockPos blockpos1 = this.worldObj.getPrecipitationHeight(blockpos.add(k2, 0, j3)); + BlockPos blockpos2 = blockpos1.down(); + + if (this.worldObj.canBlockFreezeWater(blockpos2)) + { + this.worldObj.setBlockState(blockpos2, Blocks.ice.getDefaultState(), 2); + } + + if (this.worldObj.canSnowAt(blockpos1, true)) + { + this.worldObj.setBlockState(blockpos1, Blocks.snow_layer.getDefaultState(), 2); + } + } + } + + BlockFalling.fallInstantly = false; + } + + public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z) + { + boolean flag = false; + + if (this.settings.useMonuments && this.mapFeaturesEnabled && chunkIn.getInhabitedTime() < 3600L) + { + flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(x, z)); + } + + return flag; + } + + public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback) + { + return true; + } + + public void saveExtraData() + { + } + + public boolean unloadQueuedChunks() + { + return false; + } + + public boolean canSave() + { + return true; + } + + public String makeString() + { + return "RandomLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos); + + if (this.mapFeaturesEnabled) + { + if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.func_175798_a(pos)) + { + return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList(); + } + + if (creatureType == EnumCreatureType.MONSTER && this.settings.useMonuments && this.oceanMonumentGenerator.isPositionInStructure(this.worldObj, pos)) + { + return this.oceanMonumentGenerator.getScatteredFeatureSpawnList(); + } + } + + return biomegenbase.getSpawnableList(creatureType); + } + + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + { + return "Stronghold".equals(structureName) && this.strongholdGenerator != null ? this.strongholdGenerator.getClosestStrongholdPos(worldIn, position) : null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(Chunk chunkIn, int x, int z) + { + if (this.settings.useMineShafts && this.mapFeaturesEnabled) + { + this.mineshaftGenerator.generate(this, this.worldObj, x, z, (ChunkPrimer)null); + } + + if (this.settings.useVillages && this.mapFeaturesEnabled) + { + this.villageGenerator.generate(this, this.worldObj, x, z, (ChunkPrimer)null); + } + + if (this.settings.useStrongholds && this.mapFeaturesEnabled) + { + this.strongholdGenerator.generate(this, this.worldObj, x, z, (ChunkPrimer)null); + } + + if (this.settings.useTemples && this.mapFeaturesEnabled) + { + this.scatteredFeatureGenerator.generate(this, this.worldObj, x, z, (ChunkPrimer)null); + } + + if (this.settings.useMonuments && this.mapFeaturesEnabled) + { + this.oceanMonumentGenerator.generate(this, this.worldObj, x, z, (ChunkPrimer)null); + } + } + + public Chunk provideChunk(BlockPos blockPosIn) + { + return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java new file mode 100644 index 0000000..6447f45 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java @@ -0,0 +1,473 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockHelper; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenFire; +import net.minecraft.world.gen.feature.WorldGenGlowStone1; +import net.minecraft.world.gen.feature.WorldGenGlowStone2; +import net.minecraft.world.gen.feature.WorldGenHellLava; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraft.world.gen.structure.MapGenNetherBridge; + +public class ChunkProviderHell implements IChunkProvider +{ + private final World worldObj; + private final boolean field_177466_i; + private final Random hellRNG; + private double[] slowsandNoise = new double[256]; + private double[] gravelNoise = new double[256]; + private double[] netherrackExclusivityNoise = new double[256]; + private double[] noiseField; + private final NoiseGeneratorOctaves netherNoiseGen1; + private final NoiseGeneratorOctaves netherNoiseGen2; + private final NoiseGeneratorOctaves netherNoiseGen3; + private final NoiseGeneratorOctaves slowsandGravelNoiseGen; + private final NoiseGeneratorOctaves netherrackExculsivityNoiseGen; + public final NoiseGeneratorOctaves netherNoiseGen6; + public final NoiseGeneratorOctaves netherNoiseGen7; + private final WorldGenFire field_177470_t = new WorldGenFire(); + private final WorldGenGlowStone1 field_177469_u = new WorldGenGlowStone1(); + private final WorldGenGlowStone2 field_177468_v = new WorldGenGlowStone2(); + private final WorldGenerator field_177467_w = new WorldGenMinable(Blocks.quartz_ore.getDefaultState(), 14, BlockHelper.forBlock(Blocks.netherrack)); + private final WorldGenHellLava field_177473_x = new WorldGenHellLava(Blocks.flowing_lava, true); + private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.flowing_lava, false); + private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.brown_mushroom); + private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.red_mushroom); + private final MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); + private final MapGenBase netherCaveGenerator = new MapGenCavesHell(); + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + + public ChunkProviderHell(World worldIn, boolean p_i45637_2_, long seed) + { + this.worldObj = worldIn; + this.field_177466_i = p_i45637_2_; + this.hellRNG = new Random(seed); + this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); + this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); + this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); + worldIn.setSeaLevel(63); + } + + public void func_180515_a(int p_180515_1_, int p_180515_2_, ChunkPrimer p_180515_3_) + { + int i = 4; + int j = this.worldObj.getSeaLevel() / 2 + 1; + int k = i + 1; + int l = 17; + int i1 = i + 1; + this.noiseField = this.initializeNoiseField(this.noiseField, p_180515_1_ * i, 0, p_180515_2_ * i, k, l, i1); + + for (int j1 = 0; j1 < i; ++j1) + { + for (int k1 = 0; k1 < i; ++k1) + { + for (int l1 = 0; l1 < 16; ++l1) + { + double d0 = 0.125D; + double d1 = this.noiseField[((j1 + 0) * i1 + k1 + 0) * l + l1 + 0]; + double d2 = this.noiseField[((j1 + 0) * i1 + k1 + 1) * l + l1 + 0]; + double d3 = this.noiseField[((j1 + 1) * i1 + k1 + 0) * l + l1 + 0]; + double d4 = this.noiseField[((j1 + 1) * i1 + k1 + 1) * l + l1 + 0]; + double d5 = (this.noiseField[((j1 + 0) * i1 + k1 + 0) * l + l1 + 1] - d1) * d0; + double d6 = (this.noiseField[((j1 + 0) * i1 + k1 + 1) * l + l1 + 1] - d2) * d0; + double d7 = (this.noiseField[((j1 + 1) * i1 + k1 + 0) * l + l1 + 1] - d3) * d0; + double d8 = (this.noiseField[((j1 + 1) * i1 + k1 + 1) * l + l1 + 1] - d4) * d0; + + for (int i2 = 0; i2 < 8; ++i2) + { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int j2 = 0; j2 < 4; ++j2) + { + double d14 = 0.25D; + double d15 = d10; + double d16 = (d11 - d10) * d14; + + for (int k2 = 0; k2 < 4; ++k2) + { + IBlockState iblockstate = null; + + if (l1 * 8 + i2 < j) + { + iblockstate = Blocks.lava.getDefaultState(); + } + + if (d15 > 0.0D) + { + iblockstate = Blocks.netherrack.getDefaultState(); + } + + int l2 = j2 + j1 * 4; + int i3 = i2 + l1 * 8; + int j3 = k2 + k1 * 4; + p_180515_3_.setBlockState(l2, i3, j3, iblockstate); + d15 += d16; + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } + + public void func_180516_b(int p_180516_1_, int p_180516_2_, ChunkPrimer p_180516_3_) + { + int i = this.worldObj.getSeaLevel() + 1; + double d0 = 0.03125D; + this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); + this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, p_180516_1_ * 16, 109, p_180516_2_ * 16, 16, 1, 16, d0, 1.0D, d0); + this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0 * 2.0D, d0 * 2.0D, d0 * 2.0D); + + for (int j = 0; j < 16; ++j) + { + for (int k = 0; k < 16; ++k) + { + boolean flag = this.slowsandNoise[j + k * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + boolean flag1 = this.gravelNoise[j + k * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + int l = (int)(this.netherrackExclusivityNoise[j + k * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D); + int i1 = -1; + IBlockState iblockstate = Blocks.netherrack.getDefaultState(); + IBlockState iblockstate1 = Blocks.netherrack.getDefaultState(); + + for (int j1 = 127; j1 >= 0; --j1) + { + if (j1 < 127 - this.hellRNG.nextInt(5) && j1 > this.hellRNG.nextInt(5)) + { + IBlockState iblockstate2 = p_180516_3_.getBlockState(k, j1, j); + + if (iblockstate2.getBlock() != null && iblockstate2.getBlock().getMaterial() != Material.air) + { + if (iblockstate2.getBlock() == Blocks.netherrack) + { + if (i1 == -1) + { + if (l <= 0) + { + iblockstate = null; + iblockstate1 = Blocks.netherrack.getDefaultState(); + } + else if (j1 >= i - 4 && j1 <= i + 1) + { + iblockstate = Blocks.netherrack.getDefaultState(); + iblockstate1 = Blocks.netherrack.getDefaultState(); + + if (flag1) + { + iblockstate = Blocks.gravel.getDefaultState(); + iblockstate1 = Blocks.netherrack.getDefaultState(); + } + + if (flag) + { + iblockstate = Blocks.soul_sand.getDefaultState(); + iblockstate1 = Blocks.soul_sand.getDefaultState(); + } + } + + if (j1 < i && (iblockstate == null || iblockstate.getBlock().getMaterial() == Material.air)) + { + iblockstate = Blocks.lava.getDefaultState(); + } + + i1 = l; + + if (j1 >= i - 1) + { + p_180516_3_.setBlockState(k, j1, j, iblockstate); + } + else + { + p_180516_3_.setBlockState(k, j1, j, iblockstate1); + } + } + else if (i1 > 0) + { + --i1; + p_180516_3_.setBlockState(k, j1, j, iblockstate1); + } + } + } + else + { + i1 = -1; + } + } + else + { + p_180516_3_.setBlockState(k, j1, j, Blocks.bedrock.getDefaultState()); + } + } + } + } + } + + public Chunk provideChunk(int x, int z) + { + this.hellRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.func_180515_a(x, z, chunkprimer); + this.func_180516_b(x, z, chunkprimer); + this.netherCaveGenerator.generate(this, this.worldObj, x, z, chunkprimer); + + if (this.field_177466_i) + { + this.genNetherBridge.generate(this, this.worldObj, x, z, chunkprimer); + } + + Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z); + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, x * 16, z * 16, 16, 16); + byte[] abyte = chunk.getBiomeArray(); + + for (int i = 0; i < abyte.length; ++i) + { + abyte[i] = (byte)abiomegenbase[i].biomeID; + } + + chunk.resetRelightChecks(); + return chunk; + } + + private double[] initializeNoiseField(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) + { + if (p_73164_1_ == null) + { + p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; + } + + double d0 = 684.412D; + double d1 = 2053.236D; + this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 1.0D, 0.0D, 1.0D); + this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 100.0D, 0.0D, 100.0D); + this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0 / 80.0D, d1 / 60.0D, d0 / 80.0D); + this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0, d1, d0); + this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0, d1, d0); + int i = 0; + double[] adouble = new double[p_73164_6_]; + + for (int j = 0; j < p_73164_6_; ++j) + { + adouble[j] = Math.cos((double)j * Math.PI * 6.0D / (double)p_73164_6_) * 2.0D; + double d2 = (double)j; + + if (j > p_73164_6_ / 2) + { + d2 = (double)(p_73164_6_ - 1 - j); + } + + if (d2 < 4.0D) + { + d2 = 4.0D - d2; + adouble[j] -= d2 * d2 * d2 * 10.0D; + } + } + + for (int l = 0; l < p_73164_5_; ++l) + { + for (int i1 = 0; i1 < p_73164_7_; ++i1) + { + double d3 = 0.0D; + + for (int k = 0; k < p_73164_6_; ++k) + { + double d4 = 0.0D; + double d5 = adouble[k]; + double d6 = this.noiseData2[i] / 512.0D; + double d7 = this.noiseData3[i] / 512.0D; + double d8 = (this.noiseData1[i] / 10.0D + 1.0D) / 2.0D; + + if (d8 < 0.0D) + { + d4 = d6; + } + else if (d8 > 1.0D) + { + d4 = d7; + } + else + { + d4 = d6 + (d7 - d6) * d8; + } + + d4 = d4 - d5; + + if (k > p_73164_6_ - 4) + { + double d9 = (double)((float)(k - (p_73164_6_ - 4)) / 3.0F); + d4 = d4 * (1.0D - d9) + -10.0D * d9; + } + + if ((double)k < d3) + { + double d10 = (d3 - (double)k) / 4.0D; + d10 = MathHelper.clamp_double(d10, 0.0D, 1.0D); + d4 = d4 * (1.0D - d10) + -10.0D * d10; + } + + p_73164_1_[i] = d4; + ++i; + } + } + } + + return p_73164_1_; + } + + public boolean chunkExists(int x, int z) + { + return true; + } + + public void populate(IChunkProvider chunkProvider, int x, int z) + { + BlockFalling.fallInstantly = true; + BlockPos blockpos = new BlockPos(x * 16, 0, z * 16); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); + this.genNetherBridge.generateStructure(this.worldObj, this.hellRNG, chunkcoordintpair); + + for (int i = 0; i < 8; ++i) + { + this.field_177472_y.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + } + + for (int j = 0; j < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; ++j) + { + this.field_177470_t.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + } + + for (int k = 0; k < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++k) + { + this.field_177469_u.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + } + + for (int l = 0; l < 10; ++l) + { + this.field_177468_v.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + } + + if (this.hellRNG.nextBoolean()) + { + this.field_177471_z.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + } + + if (this.hellRNG.nextBoolean()) + { + this.field_177465_A.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + } + + for (int i1 = 0; i1 < 16; ++i1) + { + this.field_177467_w.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); + } + + for (int j1 = 0; j1 < 16; ++j1) + { + this.field_177473_x.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); + } + + BlockFalling.fallInstantly = false; + } + + public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z) + { + return false; + } + + public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback) + { + return true; + } + + public void saveExtraData() + { + } + + public boolean unloadQueuedChunks() + { + return false; + } + + public boolean canSave() + { + return true; + } + + public String makeString() + { + return "HellRandomLevelSource"; + } + + public List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) + { + if (creatureType == EnumCreatureType.MONSTER) + { + if (this.genNetherBridge.func_175795_b(pos)) + { + return this.genNetherBridge.getSpawnList(); + } + + if (this.genNetherBridge.isPositionInStructure(this.worldObj, pos) && this.worldObj.getBlockState(pos.down()).getBlock() == Blocks.nether_brick) + { + return this.genNetherBridge.getSpawnList(); + } + } + + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(pos); + return biomegenbase.getSpawnableList(creatureType); + } + + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + { + return null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(Chunk chunkIn, int x, int z) + { + this.genNetherBridge.generate(this, this.worldObj, x, z, (ChunkPrimer)null); + } + + public Chunk provideChunk(BlockPos blockPosIn) + { + return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderServer.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderServer.java new file mode 100644 index 0000000..50a9059 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderServer.java @@ -0,0 +1,331 @@ +package net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ChunkProviderServer implements IChunkProvider +{ + private static final Logger logger = LogManager.getLogger(); + private Set droppedChunksSet = Collections.newSetFromMap(new ConcurrentHashMap()); + private Chunk dummyChunk; + private IChunkProvider serverChunkGenerator; + private IChunkLoader chunkLoader; + public boolean chunkLoadOverride = true; + private LongHashMap id2ChunkMap = new LongHashMap(); + private List loadedChunks = Lists.newArrayList(); + private WorldServer worldObj; + + public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_) + { + this.dummyChunk = new EmptyChunk(p_i1520_1_, 0, 0); + this.worldObj = p_i1520_1_; + this.chunkLoader = p_i1520_2_; + this.serverChunkGenerator = p_i1520_3_; + } + + public boolean chunkExists(int x, int z) + { + return this.id2ChunkMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(x, z)); + } + + public List func_152380_a() + { + return this.loadedChunks; + } + + public void dropChunk(int x, int z) + { + if (this.worldObj.provider.canRespawnHere()) + { + if (!this.worldObj.isSpawnChunk(x, z)) + { + this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(x, z))); + } + } + else + { + this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(x, z))); + } + } + + public void unloadAllChunks() + { + for (Chunk chunk : this.loadedChunks) + { + this.dropChunk(chunk.xPosition, chunk.zPosition); + } + } + + public Chunk loadChunk(int chunkX, int chunkZ) + { + long i = ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ); + this.droppedChunksSet.remove(Long.valueOf(i)); + Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(i); + + if (chunk == null) + { + chunk = this.loadChunkFromFile(chunkX, chunkZ); + + if (chunk == null) + { + if (this.serverChunkGenerator == null) + { + chunk = this.dummyChunk; + } + else + { + try + { + chunk = this.serverChunkGenerator.provideChunk(chunkX, chunkZ); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception generating new chunk"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Chunk to be generated"); + crashreportcategory.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(chunkX), Integer.valueOf(chunkZ)})); + crashreportcategory.addCrashSection("Position hash", Long.valueOf(i)); + crashreportcategory.addCrashSection("Generator", this.serverChunkGenerator.makeString()); + throw new ReportedException(crashreport); + } + } + } + + this.id2ChunkMap.add(i, chunk); + this.loadedChunks.add(chunk); + chunk.onChunkLoad(); + chunk.populateChunk(this, this, chunkX, chunkZ); + } + + return chunk; + } + + public Chunk provideChunk(int x, int z) + { + Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(x, z)); + return chunk == null ? (!this.worldObj.isFindingSpawnPoint() && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(x, z)) : chunk; + } + + private Chunk loadChunkFromFile(int x, int z) + { + if (this.chunkLoader == null) + { + return null; + } + else + { + try + { + Chunk chunk = this.chunkLoader.loadChunk(this.worldObj, x, z); + + if (chunk != null) + { + chunk.setLastSaveTime(this.worldObj.getTotalWorldTime()); + + if (this.serverChunkGenerator != null) + { + this.serverChunkGenerator.recreateStructures(chunk, x, z); + } + } + + return chunk; + } + catch (Exception exception) + { + logger.error((String)"Couldn\'t load chunk", (Throwable)exception); + return null; + } + } + } + + private void saveChunkExtraData(Chunk chunkIn) + { + if (this.chunkLoader != null) + { + try + { + this.chunkLoader.saveExtraChunkData(this.worldObj, chunkIn); + } + catch (Exception exception) + { + logger.error((String)"Couldn\'t save entities", (Throwable)exception); + } + } + } + + private void saveChunkData(Chunk chunkIn) + { + if (this.chunkLoader != null) + { + try + { + chunkIn.setLastSaveTime(this.worldObj.getTotalWorldTime()); + this.chunkLoader.saveChunk(this.worldObj, chunkIn); + } + catch (IOException ioexception) + { + logger.error((String)"Couldn\'t save chunk", (Throwable)ioexception); + } + catch (MinecraftException minecraftexception) + { + logger.error((String)"Couldn\'t save chunk; already in use by another instance of Minecraft?", (Throwable)minecraftexception); + } + } + } + + public void populate(IChunkProvider chunkProvider, int x, int z) + { + Chunk chunk = this.provideChunk(x, z); + + if (!chunk.isTerrainPopulated()) + { + chunk.func_150809_p(); + + if (this.serverChunkGenerator != null) + { + this.serverChunkGenerator.populate(chunkProvider, x, z); + chunk.setChunkModified(); + } + } + } + + public boolean populateChunk(IChunkProvider chunkProvider, Chunk chunkIn, int x, int z) + { + if (this.serverChunkGenerator != null && this.serverChunkGenerator.populateChunk(chunkProvider, chunkIn, x, z)) + { + Chunk chunk = this.provideChunk(x, z); + chunk.setChunkModified(); + return true; + } + else + { + return false; + } + } + + public boolean saveChunks(boolean saveAllChunks, IProgressUpdate progressCallback) + { + int i = 0; + List list = Lists.newArrayList(this.loadedChunks); + + for (int j = 0; j < ((List)list).size(); ++j) + { + Chunk chunk = (Chunk)list.get(j); + + if (saveAllChunks) + { + this.saveChunkExtraData(chunk); + } + + if (chunk.needsSaving(saveAllChunks)) + { + this.saveChunkData(chunk); + chunk.setModified(false); + ++i; + + if (i == 24 && !saveAllChunks) + { + return false; + } + } + } + + return true; + } + + public void saveExtraData() + { + if (this.chunkLoader != null) + { + this.chunkLoader.saveExtraData(); + } + } + + public boolean unloadQueuedChunks() + { + if (!this.worldObj.disableLevelSaving) + { + for (int i = 0; i < 100; ++i) + { + if (!this.droppedChunksSet.isEmpty()) + { + Long olong = (Long)this.droppedChunksSet.iterator().next(); + Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(olong.longValue()); + + if (chunk != null) + { + chunk.onChunkUnload(); + this.saveChunkData(chunk); + this.saveChunkExtraData(chunk); + this.id2ChunkMap.remove(olong.longValue()); + this.loadedChunks.remove(chunk); + } + + this.droppedChunksSet.remove(olong); + } + } + + if (this.chunkLoader != null) + { + this.chunkLoader.chunkTick(); + } + } + + return this.serverChunkGenerator.unloadQueuedChunks(); + } + + public boolean canSave() + { + return !this.worldObj.disableLevelSaving; + } + + public String makeString() + { + return "ServerChunkCache: " + this.id2ChunkMap.getNumHashElements() + " Drop: " + this.droppedChunksSet.size(); + } + + public List getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) + { + return this.serverChunkGenerator.getPossibleCreatures(creatureType, pos); + } + + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + { + return this.serverChunkGenerator.getStrongholdGen(worldIn, structureName, position); + } + + public int getLoadedChunkCount() + { + return this.id2ChunkMap.getNumHashElements(); + } + + public void recreateStructures(Chunk chunkIn, int x, int z) + { + } + + public Chunk provideChunk(BlockPos blockPosIn) + { + return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderSettings.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderSettings.java new file mode 100644 index 0000000..d55e5ba --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/ChunkProviderSettings.java @@ -0,0 +1,671 @@ +package net.minecraft.world.gen; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import net.minecraft.world.biome.BiomeGenBase; + +public class ChunkProviderSettings +{ + public final float coordinateScale; + public final float heightScale; + public final float upperLimitScale; + public final float lowerLimitScale; + public final float depthNoiseScaleX; + public final float depthNoiseScaleZ; + public final float depthNoiseScaleExponent; + public final float mainNoiseScaleX; + public final float mainNoiseScaleY; + public final float mainNoiseScaleZ; + public final float baseSize; + public final float stretchY; + public final float biomeDepthWeight; + public final float biomeDepthOffSet; + public final float biomeScaleWeight; + public final float biomeScaleOffset; + public final int seaLevel; + public final boolean useCaves; + public final boolean useDungeons; + public final int dungeonChance; + public final boolean useStrongholds; + public final boolean useVillages; + public final boolean useMineShafts; + public final boolean useTemples; + public final boolean useMonuments; + public final boolean useRavines; + public final boolean useWaterLakes; + public final int waterLakeChance; + public final boolean useLavaLakes; + public final int lavaLakeChance; + public final boolean useLavaOceans; + public final int fixedBiome; + public final int biomeSize; + public final int riverSize; + public final int dirtSize; + public final int dirtCount; + public final int dirtMinHeight; + public final int dirtMaxHeight; + public final int gravelSize; + public final int gravelCount; + public final int gravelMinHeight; + public final int gravelMaxHeight; + public final int graniteSize; + public final int graniteCount; + public final int graniteMinHeight; + public final int graniteMaxHeight; + public final int dioriteSize; + public final int dioriteCount; + public final int dioriteMinHeight; + public final int dioriteMaxHeight; + public final int andesiteSize; + public final int andesiteCount; + public final int andesiteMinHeight; + public final int andesiteMaxHeight; + public final int coalSize; + public final int coalCount; + public final int coalMinHeight; + public final int coalMaxHeight; + public final int ironSize; + public final int ironCount; + public final int ironMinHeight; + public final int ironMaxHeight; + public final int goldSize; + public final int goldCount; + public final int goldMinHeight; + public final int goldMaxHeight; + public final int redstoneSize; + public final int redstoneCount; + public final int redstoneMinHeight; + public final int redstoneMaxHeight; + public final int diamondSize; + public final int diamondCount; + public final int diamondMinHeight; + public final int diamondMaxHeight; + public final int lapisSize; + public final int lapisCount; + public final int lapisCenterHeight; + public final int lapisSpread; + + private ChunkProviderSettings(ChunkProviderSettings.Factory settingsFactory) + { + this.coordinateScale = settingsFactory.coordinateScale; + this.heightScale = settingsFactory.heightScale; + this.upperLimitScale = settingsFactory.upperLimitScale; + this.lowerLimitScale = settingsFactory.lowerLimitScale; + this.depthNoiseScaleX = settingsFactory.depthNoiseScaleX; + this.depthNoiseScaleZ = settingsFactory.depthNoiseScaleZ; + this.depthNoiseScaleExponent = settingsFactory.depthNoiseScaleExponent; + this.mainNoiseScaleX = settingsFactory.mainNoiseScaleX; + this.mainNoiseScaleY = settingsFactory.mainNoiseScaleY; + this.mainNoiseScaleZ = settingsFactory.mainNoiseScaleZ; + this.baseSize = settingsFactory.baseSize; + this.stretchY = settingsFactory.stretchY; + this.biomeDepthWeight = settingsFactory.biomeDepthWeight; + this.biomeDepthOffSet = settingsFactory.biomeDepthOffset; + this.biomeScaleWeight = settingsFactory.biomeScaleWeight; + this.biomeScaleOffset = settingsFactory.biomeScaleOffset; + this.seaLevel = settingsFactory.seaLevel; + this.useCaves = settingsFactory.useCaves; + this.useDungeons = settingsFactory.useDungeons; + this.dungeonChance = settingsFactory.dungeonChance; + this.useStrongholds = settingsFactory.useStrongholds; + this.useVillages = settingsFactory.useVillages; + this.useMineShafts = settingsFactory.useMineShafts; + this.useTemples = settingsFactory.useTemples; + this.useMonuments = settingsFactory.useMonuments; + this.useRavines = settingsFactory.useRavines; + this.useWaterLakes = settingsFactory.useWaterLakes; + this.waterLakeChance = settingsFactory.waterLakeChance; + this.useLavaLakes = settingsFactory.useLavaLakes; + this.lavaLakeChance = settingsFactory.lavaLakeChance; + this.useLavaOceans = settingsFactory.useLavaOceans; + this.fixedBiome = settingsFactory.fixedBiome; + this.biomeSize = settingsFactory.biomeSize; + this.riverSize = settingsFactory.riverSize; + this.dirtSize = settingsFactory.dirtSize; + this.dirtCount = settingsFactory.dirtCount; + this.dirtMinHeight = settingsFactory.dirtMinHeight; + this.dirtMaxHeight = settingsFactory.dirtMaxHeight; + this.gravelSize = settingsFactory.gravelSize; + this.gravelCount = settingsFactory.gravelCount; + this.gravelMinHeight = settingsFactory.gravelMinHeight; + this.gravelMaxHeight = settingsFactory.gravelMaxHeight; + this.graniteSize = settingsFactory.graniteSize; + this.graniteCount = settingsFactory.graniteCount; + this.graniteMinHeight = settingsFactory.graniteMinHeight; + this.graniteMaxHeight = settingsFactory.graniteMaxHeight; + this.dioriteSize = settingsFactory.dioriteSize; + this.dioriteCount = settingsFactory.dioriteCount; + this.dioriteMinHeight = settingsFactory.dioriteMinHeight; + this.dioriteMaxHeight = settingsFactory.dioriteMaxHeight; + this.andesiteSize = settingsFactory.andesiteSize; + this.andesiteCount = settingsFactory.andesiteCount; + this.andesiteMinHeight = settingsFactory.andesiteMinHeight; + this.andesiteMaxHeight = settingsFactory.andesiteMaxHeight; + this.coalSize = settingsFactory.coalSize; + this.coalCount = settingsFactory.coalCount; + this.coalMinHeight = settingsFactory.coalMinHeight; + this.coalMaxHeight = settingsFactory.coalMaxHeight; + this.ironSize = settingsFactory.ironSize; + this.ironCount = settingsFactory.ironCount; + this.ironMinHeight = settingsFactory.ironMinHeight; + this.ironMaxHeight = settingsFactory.ironMaxHeight; + this.goldSize = settingsFactory.goldSize; + this.goldCount = settingsFactory.goldCount; + this.goldMinHeight = settingsFactory.goldMinHeight; + this.goldMaxHeight = settingsFactory.goldMaxHeight; + this.redstoneSize = settingsFactory.redstoneSize; + this.redstoneCount = settingsFactory.redstoneCount; + this.redstoneMinHeight = settingsFactory.redstoneMinHeight; + this.redstoneMaxHeight = settingsFactory.redstoneMaxHeight; + this.diamondSize = settingsFactory.diamondSize; + this.diamondCount = settingsFactory.diamondCount; + this.diamondMinHeight = settingsFactory.diamondMinHeight; + this.diamondMaxHeight = settingsFactory.diamondMaxHeight; + this.lapisSize = settingsFactory.lapisSize; + this.lapisCount = settingsFactory.lapisCount; + this.lapisCenterHeight = settingsFactory.lapisCenterHeight; + this.lapisSpread = settingsFactory.lapisSpread; + } + + public static class Factory + { + static final Gson JSON_ADAPTER = (new GsonBuilder()).registerTypeAdapter(ChunkProviderSettings.Factory.class, new ChunkProviderSettings.Serializer()).create(); + public float coordinateScale = 684.412F; + public float heightScale = 684.412F; + public float upperLimitScale = 512.0F; + public float lowerLimitScale = 512.0F; + public float depthNoiseScaleX = 200.0F; + public float depthNoiseScaleZ = 200.0F; + public float depthNoiseScaleExponent = 0.5F; + public float mainNoiseScaleX = 80.0F; + public float mainNoiseScaleY = 160.0F; + public float mainNoiseScaleZ = 80.0F; + public float baseSize = 8.5F; + public float stretchY = 12.0F; + public float biomeDepthWeight = 1.0F; + public float biomeDepthOffset = 0.0F; + public float biomeScaleWeight = 1.0F; + public float biomeScaleOffset = 0.0F; + public int seaLevel = 63; + public boolean useCaves = true; + public boolean useDungeons = true; + public int dungeonChance = 8; + public boolean useStrongholds = true; + public boolean useVillages = true; + public boolean useMineShafts = true; + public boolean useTemples = true; + public boolean useMonuments = true; + public boolean useRavines = true; + public boolean useWaterLakes = true; + public int waterLakeChance = 4; + public boolean useLavaLakes = true; + public int lavaLakeChance = 80; + public boolean useLavaOceans = false; + public int fixedBiome = -1; + public int biomeSize = 4; + public int riverSize = 4; + public int dirtSize = 33; + public int dirtCount = 10; + public int dirtMinHeight = 0; + public int dirtMaxHeight = 256; + public int gravelSize = 33; + public int gravelCount = 8; + public int gravelMinHeight = 0; + public int gravelMaxHeight = 256; + public int graniteSize = 33; + public int graniteCount = 10; + public int graniteMinHeight = 0; + public int graniteMaxHeight = 80; + public int dioriteSize = 33; + public int dioriteCount = 10; + public int dioriteMinHeight = 0; + public int dioriteMaxHeight = 80; + public int andesiteSize = 33; + public int andesiteCount = 10; + public int andesiteMinHeight = 0; + public int andesiteMaxHeight = 80; + public int coalSize = 17; + public int coalCount = 20; + public int coalMinHeight = 0; + public int coalMaxHeight = 128; + public int ironSize = 9; + public int ironCount = 20; + public int ironMinHeight = 0; + public int ironMaxHeight = 64; + public int goldSize = 9; + public int goldCount = 2; + public int goldMinHeight = 0; + public int goldMaxHeight = 32; + public int redstoneSize = 8; + public int redstoneCount = 8; + public int redstoneMinHeight = 0; + public int redstoneMaxHeight = 16; + public int diamondSize = 8; + public int diamondCount = 1; + public int diamondMinHeight = 0; + public int diamondMaxHeight = 16; + public int lapisSize = 7; + public int lapisCount = 1; + public int lapisCenterHeight = 16; + public int lapisSpread = 16; + + public static ChunkProviderSettings.Factory jsonToFactory(String p_177865_0_) + { + if (p_177865_0_.length() == 0) + { + return new ChunkProviderSettings.Factory(); + } + else + { + try + { + return (ChunkProviderSettings.Factory)JSON_ADAPTER.fromJson(p_177865_0_, ChunkProviderSettings.Factory.class); + } + catch (Exception var2) + { + return new ChunkProviderSettings.Factory(); + } + } + } + + public String toString() + { + return JSON_ADAPTER.toJson((Object)this); + } + + public Factory() + { + this.func_177863_a(); + } + + public void func_177863_a() + { + this.coordinateScale = 684.412F; + this.heightScale = 684.412F; + this.upperLimitScale = 512.0F; + this.lowerLimitScale = 512.0F; + this.depthNoiseScaleX = 200.0F; + this.depthNoiseScaleZ = 200.0F; + this.depthNoiseScaleExponent = 0.5F; + this.mainNoiseScaleX = 80.0F; + this.mainNoiseScaleY = 160.0F; + this.mainNoiseScaleZ = 80.0F; + this.baseSize = 8.5F; + this.stretchY = 12.0F; + this.biomeDepthWeight = 1.0F; + this.biomeDepthOffset = 0.0F; + this.biomeScaleWeight = 1.0F; + this.biomeScaleOffset = 0.0F; + this.seaLevel = 63; + this.useCaves = true; + this.useDungeons = true; + this.dungeonChance = 8; + this.useStrongholds = true; + this.useVillages = true; + this.useMineShafts = true; + this.useTemples = true; + this.useMonuments = true; + this.useRavines = true; + this.useWaterLakes = true; + this.waterLakeChance = 4; + this.useLavaLakes = true; + this.lavaLakeChance = 80; + this.useLavaOceans = false; + this.fixedBiome = -1; + this.biomeSize = 4; + this.riverSize = 4; + this.dirtSize = 33; + this.dirtCount = 10; + this.dirtMinHeight = 0; + this.dirtMaxHeight = 256; + this.gravelSize = 33; + this.gravelCount = 8; + this.gravelMinHeight = 0; + this.gravelMaxHeight = 256; + this.graniteSize = 33; + this.graniteCount = 10; + this.graniteMinHeight = 0; + this.graniteMaxHeight = 80; + this.dioriteSize = 33; + this.dioriteCount = 10; + this.dioriteMinHeight = 0; + this.dioriteMaxHeight = 80; + this.andesiteSize = 33; + this.andesiteCount = 10; + this.andesiteMinHeight = 0; + this.andesiteMaxHeight = 80; + this.coalSize = 17; + this.coalCount = 20; + this.coalMinHeight = 0; + this.coalMaxHeight = 128; + this.ironSize = 9; + this.ironCount = 20; + this.ironMinHeight = 0; + this.ironMaxHeight = 64; + this.goldSize = 9; + this.goldCount = 2; + this.goldMinHeight = 0; + this.goldMaxHeight = 32; + this.redstoneSize = 8; + this.redstoneCount = 8; + this.redstoneMinHeight = 0; + this.redstoneMaxHeight = 16; + this.diamondSize = 8; + this.diamondCount = 1; + this.diamondMinHeight = 0; + this.diamondMaxHeight = 16; + this.lapisSize = 7; + this.lapisCount = 1; + this.lapisCenterHeight = 16; + this.lapisSpread = 16; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + ChunkProviderSettings.Factory chunkprovidersettings$factory = (ChunkProviderSettings.Factory)p_equals_1_; + return this.andesiteCount != chunkprovidersettings$factory.andesiteCount ? false : (this.andesiteMaxHeight != chunkprovidersettings$factory.andesiteMaxHeight ? false : (this.andesiteMinHeight != chunkprovidersettings$factory.andesiteMinHeight ? false : (this.andesiteSize != chunkprovidersettings$factory.andesiteSize ? false : (Float.compare(chunkprovidersettings$factory.baseSize, this.baseSize) != 0 ? false : (Float.compare(chunkprovidersettings$factory.biomeDepthOffset, this.biomeDepthOffset) != 0 ? false : (Float.compare(chunkprovidersettings$factory.biomeDepthWeight, this.biomeDepthWeight) != 0 ? false : (Float.compare(chunkprovidersettings$factory.biomeScaleOffset, this.biomeScaleOffset) != 0 ? false : (Float.compare(chunkprovidersettings$factory.biomeScaleWeight, this.biomeScaleWeight) != 0 ? false : (this.biomeSize != chunkprovidersettings$factory.biomeSize ? false : (this.coalCount != chunkprovidersettings$factory.coalCount ? false : (this.coalMaxHeight != chunkprovidersettings$factory.coalMaxHeight ? false : (this.coalMinHeight != chunkprovidersettings$factory.coalMinHeight ? false : (this.coalSize != chunkprovidersettings$factory.coalSize ? false : (Float.compare(chunkprovidersettings$factory.coordinateScale, this.coordinateScale) != 0 ? false : (Float.compare(chunkprovidersettings$factory.depthNoiseScaleExponent, this.depthNoiseScaleExponent) != 0 ? false : (Float.compare(chunkprovidersettings$factory.depthNoiseScaleX, this.depthNoiseScaleX) != 0 ? false : (Float.compare(chunkprovidersettings$factory.depthNoiseScaleZ, this.depthNoiseScaleZ) != 0 ? false : (this.diamondCount != chunkprovidersettings$factory.diamondCount ? false : (this.diamondMaxHeight != chunkprovidersettings$factory.diamondMaxHeight ? false : (this.diamondMinHeight != chunkprovidersettings$factory.diamondMinHeight ? false : (this.diamondSize != chunkprovidersettings$factory.diamondSize ? false : (this.dioriteCount != chunkprovidersettings$factory.dioriteCount ? false : (this.dioriteMaxHeight != chunkprovidersettings$factory.dioriteMaxHeight ? false : (this.dioriteMinHeight != chunkprovidersettings$factory.dioriteMinHeight ? false : (this.dioriteSize != chunkprovidersettings$factory.dioriteSize ? false : (this.dirtCount != chunkprovidersettings$factory.dirtCount ? false : (this.dirtMaxHeight != chunkprovidersettings$factory.dirtMaxHeight ? false : (this.dirtMinHeight != chunkprovidersettings$factory.dirtMinHeight ? false : (this.dirtSize != chunkprovidersettings$factory.dirtSize ? false : (this.dungeonChance != chunkprovidersettings$factory.dungeonChance ? false : (this.fixedBiome != chunkprovidersettings$factory.fixedBiome ? false : (this.goldCount != chunkprovidersettings$factory.goldCount ? false : (this.goldMaxHeight != chunkprovidersettings$factory.goldMaxHeight ? false : (this.goldMinHeight != chunkprovidersettings$factory.goldMinHeight ? false : (this.goldSize != chunkprovidersettings$factory.goldSize ? false : (this.graniteCount != chunkprovidersettings$factory.graniteCount ? false : (this.graniteMaxHeight != chunkprovidersettings$factory.graniteMaxHeight ? false : (this.graniteMinHeight != chunkprovidersettings$factory.graniteMinHeight ? false : (this.graniteSize != chunkprovidersettings$factory.graniteSize ? false : (this.gravelCount != chunkprovidersettings$factory.gravelCount ? false : (this.gravelMaxHeight != chunkprovidersettings$factory.gravelMaxHeight ? false : (this.gravelMinHeight != chunkprovidersettings$factory.gravelMinHeight ? false : (this.gravelSize != chunkprovidersettings$factory.gravelSize ? false : (Float.compare(chunkprovidersettings$factory.heightScale, this.heightScale) != 0 ? false : (this.ironCount != chunkprovidersettings$factory.ironCount ? false : (this.ironMaxHeight != chunkprovidersettings$factory.ironMaxHeight ? false : (this.ironMinHeight != chunkprovidersettings$factory.ironMinHeight ? false : (this.ironSize != chunkprovidersettings$factory.ironSize ? false : (this.lapisCenterHeight != chunkprovidersettings$factory.lapisCenterHeight ? false : (this.lapisCount != chunkprovidersettings$factory.lapisCount ? false : (this.lapisSize != chunkprovidersettings$factory.lapisSize ? false : (this.lapisSpread != chunkprovidersettings$factory.lapisSpread ? false : (this.lavaLakeChance != chunkprovidersettings$factory.lavaLakeChance ? false : (Float.compare(chunkprovidersettings$factory.lowerLimitScale, this.lowerLimitScale) != 0 ? false : (Float.compare(chunkprovidersettings$factory.mainNoiseScaleX, this.mainNoiseScaleX) != 0 ? false : (Float.compare(chunkprovidersettings$factory.mainNoiseScaleY, this.mainNoiseScaleY) != 0 ? false : (Float.compare(chunkprovidersettings$factory.mainNoiseScaleZ, this.mainNoiseScaleZ) != 0 ? false : (this.redstoneCount != chunkprovidersettings$factory.redstoneCount ? false : (this.redstoneMaxHeight != chunkprovidersettings$factory.redstoneMaxHeight ? false : (this.redstoneMinHeight != chunkprovidersettings$factory.redstoneMinHeight ? false : (this.redstoneSize != chunkprovidersettings$factory.redstoneSize ? false : (this.riverSize != chunkprovidersettings$factory.riverSize ? false : (this.seaLevel != chunkprovidersettings$factory.seaLevel ? false : (Float.compare(chunkprovidersettings$factory.stretchY, this.stretchY) != 0 ? false : (Float.compare(chunkprovidersettings$factory.upperLimitScale, this.upperLimitScale) != 0 ? false : (this.useCaves != chunkprovidersettings$factory.useCaves ? false : (this.useDungeons != chunkprovidersettings$factory.useDungeons ? false : (this.useLavaLakes != chunkprovidersettings$factory.useLavaLakes ? false : (this.useLavaOceans != chunkprovidersettings$factory.useLavaOceans ? false : (this.useMineShafts != chunkprovidersettings$factory.useMineShafts ? false : (this.useRavines != chunkprovidersettings$factory.useRavines ? false : (this.useStrongholds != chunkprovidersettings$factory.useStrongholds ? false : (this.useTemples != chunkprovidersettings$factory.useTemples ? false : (this.useMonuments != chunkprovidersettings$factory.useMonuments ? false : (this.useVillages != chunkprovidersettings$factory.useVillages ? false : (this.useWaterLakes != chunkprovidersettings$factory.useWaterLakes ? false : this.waterLakeChance == chunkprovidersettings$factory.waterLakeChance)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))); + } + else + { + return false; + } + } + + public int hashCode() + { + int i = this.coordinateScale != 0.0F ? Float.floatToIntBits(this.coordinateScale) : 0; + i = 31 * i + (this.heightScale != 0.0F ? Float.floatToIntBits(this.heightScale) : 0); + i = 31 * i + (this.upperLimitScale != 0.0F ? Float.floatToIntBits(this.upperLimitScale) : 0); + i = 31 * i + (this.lowerLimitScale != 0.0F ? Float.floatToIntBits(this.lowerLimitScale) : 0); + i = 31 * i + (this.depthNoiseScaleX != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleX) : 0); + i = 31 * i + (this.depthNoiseScaleZ != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleZ) : 0); + i = 31 * i + (this.depthNoiseScaleExponent != 0.0F ? Float.floatToIntBits(this.depthNoiseScaleExponent) : 0); + i = 31 * i + (this.mainNoiseScaleX != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleX) : 0); + i = 31 * i + (this.mainNoiseScaleY != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleY) : 0); + i = 31 * i + (this.mainNoiseScaleZ != 0.0F ? Float.floatToIntBits(this.mainNoiseScaleZ) : 0); + i = 31 * i + (this.baseSize != 0.0F ? Float.floatToIntBits(this.baseSize) : 0); + i = 31 * i + (this.stretchY != 0.0F ? Float.floatToIntBits(this.stretchY) : 0); + i = 31 * i + (this.biomeDepthWeight != 0.0F ? Float.floatToIntBits(this.biomeDepthWeight) : 0); + i = 31 * i + (this.biomeDepthOffset != 0.0F ? Float.floatToIntBits(this.biomeDepthOffset) : 0); + i = 31 * i + (this.biomeScaleWeight != 0.0F ? Float.floatToIntBits(this.biomeScaleWeight) : 0); + i = 31 * i + (this.biomeScaleOffset != 0.0F ? Float.floatToIntBits(this.biomeScaleOffset) : 0); + i = 31 * i + this.seaLevel; + i = 31 * i + (this.useCaves ? 1 : 0); + i = 31 * i + (this.useDungeons ? 1 : 0); + i = 31 * i + this.dungeonChance; + i = 31 * i + (this.useStrongholds ? 1 : 0); + i = 31 * i + (this.useVillages ? 1 : 0); + i = 31 * i + (this.useMineShafts ? 1 : 0); + i = 31 * i + (this.useTemples ? 1 : 0); + i = 31 * i + (this.useMonuments ? 1 : 0); + i = 31 * i + (this.useRavines ? 1 : 0); + i = 31 * i + (this.useWaterLakes ? 1 : 0); + i = 31 * i + this.waterLakeChance; + i = 31 * i + (this.useLavaLakes ? 1 : 0); + i = 31 * i + this.lavaLakeChance; + i = 31 * i + (this.useLavaOceans ? 1 : 0); + i = 31 * i + this.fixedBiome; + i = 31 * i + this.biomeSize; + i = 31 * i + this.riverSize; + i = 31 * i + this.dirtSize; + i = 31 * i + this.dirtCount; + i = 31 * i + this.dirtMinHeight; + i = 31 * i + this.dirtMaxHeight; + i = 31 * i + this.gravelSize; + i = 31 * i + this.gravelCount; + i = 31 * i + this.gravelMinHeight; + i = 31 * i + this.gravelMaxHeight; + i = 31 * i + this.graniteSize; + i = 31 * i + this.graniteCount; + i = 31 * i + this.graniteMinHeight; + i = 31 * i + this.graniteMaxHeight; + i = 31 * i + this.dioriteSize; + i = 31 * i + this.dioriteCount; + i = 31 * i + this.dioriteMinHeight; + i = 31 * i + this.dioriteMaxHeight; + i = 31 * i + this.andesiteSize; + i = 31 * i + this.andesiteCount; + i = 31 * i + this.andesiteMinHeight; + i = 31 * i + this.andesiteMaxHeight; + i = 31 * i + this.coalSize; + i = 31 * i + this.coalCount; + i = 31 * i + this.coalMinHeight; + i = 31 * i + this.coalMaxHeight; + i = 31 * i + this.ironSize; + i = 31 * i + this.ironCount; + i = 31 * i + this.ironMinHeight; + i = 31 * i + this.ironMaxHeight; + i = 31 * i + this.goldSize; + i = 31 * i + this.goldCount; + i = 31 * i + this.goldMinHeight; + i = 31 * i + this.goldMaxHeight; + i = 31 * i + this.redstoneSize; + i = 31 * i + this.redstoneCount; + i = 31 * i + this.redstoneMinHeight; + i = 31 * i + this.redstoneMaxHeight; + i = 31 * i + this.diamondSize; + i = 31 * i + this.diamondCount; + i = 31 * i + this.diamondMinHeight; + i = 31 * i + this.diamondMaxHeight; + i = 31 * i + this.lapisSize; + i = 31 * i + this.lapisCount; + i = 31 * i + this.lapisCenterHeight; + i = 31 * i + this.lapisSpread; + return i; + } + + public ChunkProviderSettings func_177864_b() + { + return new ChunkProviderSettings(this); + } + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + public ChunkProviderSettings.Factory deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) throws JsonParseException + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + ChunkProviderSettings.Factory chunkprovidersettings$factory = new ChunkProviderSettings.Factory(); + + try + { + chunkprovidersettings$factory.coordinateScale = JsonUtils.getFloat(jsonobject, "coordinateScale", chunkprovidersettings$factory.coordinateScale); + chunkprovidersettings$factory.heightScale = JsonUtils.getFloat(jsonobject, "heightScale", chunkprovidersettings$factory.heightScale); + chunkprovidersettings$factory.lowerLimitScale = JsonUtils.getFloat(jsonobject, "lowerLimitScale", chunkprovidersettings$factory.lowerLimitScale); + chunkprovidersettings$factory.upperLimitScale = JsonUtils.getFloat(jsonobject, "upperLimitScale", chunkprovidersettings$factory.upperLimitScale); + chunkprovidersettings$factory.depthNoiseScaleX = JsonUtils.getFloat(jsonobject, "depthNoiseScaleX", chunkprovidersettings$factory.depthNoiseScaleX); + chunkprovidersettings$factory.depthNoiseScaleZ = JsonUtils.getFloat(jsonobject, "depthNoiseScaleZ", chunkprovidersettings$factory.depthNoiseScaleZ); + chunkprovidersettings$factory.depthNoiseScaleExponent = JsonUtils.getFloat(jsonobject, "depthNoiseScaleExponent", chunkprovidersettings$factory.depthNoiseScaleExponent); + chunkprovidersettings$factory.mainNoiseScaleX = JsonUtils.getFloat(jsonobject, "mainNoiseScaleX", chunkprovidersettings$factory.mainNoiseScaleX); + chunkprovidersettings$factory.mainNoiseScaleY = JsonUtils.getFloat(jsonobject, "mainNoiseScaleY", chunkprovidersettings$factory.mainNoiseScaleY); + chunkprovidersettings$factory.mainNoiseScaleZ = JsonUtils.getFloat(jsonobject, "mainNoiseScaleZ", chunkprovidersettings$factory.mainNoiseScaleZ); + chunkprovidersettings$factory.baseSize = JsonUtils.getFloat(jsonobject, "baseSize", chunkprovidersettings$factory.baseSize); + chunkprovidersettings$factory.stretchY = JsonUtils.getFloat(jsonobject, "stretchY", chunkprovidersettings$factory.stretchY); + chunkprovidersettings$factory.biomeDepthWeight = JsonUtils.getFloat(jsonobject, "biomeDepthWeight", chunkprovidersettings$factory.biomeDepthWeight); + chunkprovidersettings$factory.biomeDepthOffset = JsonUtils.getFloat(jsonobject, "biomeDepthOffset", chunkprovidersettings$factory.biomeDepthOffset); + chunkprovidersettings$factory.biomeScaleWeight = JsonUtils.getFloat(jsonobject, "biomeScaleWeight", chunkprovidersettings$factory.biomeScaleWeight); + chunkprovidersettings$factory.biomeScaleOffset = JsonUtils.getFloat(jsonobject, "biomeScaleOffset", chunkprovidersettings$factory.biomeScaleOffset); + chunkprovidersettings$factory.seaLevel = JsonUtils.getInt(jsonobject, "seaLevel", chunkprovidersettings$factory.seaLevel); + chunkprovidersettings$factory.useCaves = JsonUtils.getBoolean(jsonobject, "useCaves", chunkprovidersettings$factory.useCaves); + chunkprovidersettings$factory.useDungeons = JsonUtils.getBoolean(jsonobject, "useDungeons", chunkprovidersettings$factory.useDungeons); + chunkprovidersettings$factory.dungeonChance = JsonUtils.getInt(jsonobject, "dungeonChance", chunkprovidersettings$factory.dungeonChance); + chunkprovidersettings$factory.useStrongholds = JsonUtils.getBoolean(jsonobject, "useStrongholds", chunkprovidersettings$factory.useStrongholds); + chunkprovidersettings$factory.useVillages = JsonUtils.getBoolean(jsonobject, "useVillages", chunkprovidersettings$factory.useVillages); + chunkprovidersettings$factory.useMineShafts = JsonUtils.getBoolean(jsonobject, "useMineShafts", chunkprovidersettings$factory.useMineShafts); + chunkprovidersettings$factory.useTemples = JsonUtils.getBoolean(jsonobject, "useTemples", chunkprovidersettings$factory.useTemples); + chunkprovidersettings$factory.useMonuments = JsonUtils.getBoolean(jsonobject, "useMonuments", chunkprovidersettings$factory.useMonuments); + chunkprovidersettings$factory.useRavines = JsonUtils.getBoolean(jsonobject, "useRavines", chunkprovidersettings$factory.useRavines); + chunkprovidersettings$factory.useWaterLakes = JsonUtils.getBoolean(jsonobject, "useWaterLakes", chunkprovidersettings$factory.useWaterLakes); + chunkprovidersettings$factory.waterLakeChance = JsonUtils.getInt(jsonobject, "waterLakeChance", chunkprovidersettings$factory.waterLakeChance); + chunkprovidersettings$factory.useLavaLakes = JsonUtils.getBoolean(jsonobject, "useLavaLakes", chunkprovidersettings$factory.useLavaLakes); + chunkprovidersettings$factory.lavaLakeChance = JsonUtils.getInt(jsonobject, "lavaLakeChance", chunkprovidersettings$factory.lavaLakeChance); + chunkprovidersettings$factory.useLavaOceans = JsonUtils.getBoolean(jsonobject, "useLavaOceans", chunkprovidersettings$factory.useLavaOceans); + chunkprovidersettings$factory.fixedBiome = JsonUtils.getInt(jsonobject, "fixedBiome", chunkprovidersettings$factory.fixedBiome); + + if (chunkprovidersettings$factory.fixedBiome < 38 && chunkprovidersettings$factory.fixedBiome >= -1) + { + if (chunkprovidersettings$factory.fixedBiome >= BiomeGenBase.hell.biomeID) + { + chunkprovidersettings$factory.fixedBiome += 2; + } + } + else + { + chunkprovidersettings$factory.fixedBiome = -1; + } + + chunkprovidersettings$factory.biomeSize = JsonUtils.getInt(jsonobject, "biomeSize", chunkprovidersettings$factory.biomeSize); + chunkprovidersettings$factory.riverSize = JsonUtils.getInt(jsonobject, "riverSize", chunkprovidersettings$factory.riverSize); + chunkprovidersettings$factory.dirtSize = JsonUtils.getInt(jsonobject, "dirtSize", chunkprovidersettings$factory.dirtSize); + chunkprovidersettings$factory.dirtCount = JsonUtils.getInt(jsonobject, "dirtCount", chunkprovidersettings$factory.dirtCount); + chunkprovidersettings$factory.dirtMinHeight = JsonUtils.getInt(jsonobject, "dirtMinHeight", chunkprovidersettings$factory.dirtMinHeight); + chunkprovidersettings$factory.dirtMaxHeight = JsonUtils.getInt(jsonobject, "dirtMaxHeight", chunkprovidersettings$factory.dirtMaxHeight); + chunkprovidersettings$factory.gravelSize = JsonUtils.getInt(jsonobject, "gravelSize", chunkprovidersettings$factory.gravelSize); + chunkprovidersettings$factory.gravelCount = JsonUtils.getInt(jsonobject, "gravelCount", chunkprovidersettings$factory.gravelCount); + chunkprovidersettings$factory.gravelMinHeight = JsonUtils.getInt(jsonobject, "gravelMinHeight", chunkprovidersettings$factory.gravelMinHeight); + chunkprovidersettings$factory.gravelMaxHeight = JsonUtils.getInt(jsonobject, "gravelMaxHeight", chunkprovidersettings$factory.gravelMaxHeight); + chunkprovidersettings$factory.graniteSize = JsonUtils.getInt(jsonobject, "graniteSize", chunkprovidersettings$factory.graniteSize); + chunkprovidersettings$factory.graniteCount = JsonUtils.getInt(jsonobject, "graniteCount", chunkprovidersettings$factory.graniteCount); + chunkprovidersettings$factory.graniteMinHeight = JsonUtils.getInt(jsonobject, "graniteMinHeight", chunkprovidersettings$factory.graniteMinHeight); + chunkprovidersettings$factory.graniteMaxHeight = JsonUtils.getInt(jsonobject, "graniteMaxHeight", chunkprovidersettings$factory.graniteMaxHeight); + chunkprovidersettings$factory.dioriteSize = JsonUtils.getInt(jsonobject, "dioriteSize", chunkprovidersettings$factory.dioriteSize); + chunkprovidersettings$factory.dioriteCount = JsonUtils.getInt(jsonobject, "dioriteCount", chunkprovidersettings$factory.dioriteCount); + chunkprovidersettings$factory.dioriteMinHeight = JsonUtils.getInt(jsonobject, "dioriteMinHeight", chunkprovidersettings$factory.dioriteMinHeight); + chunkprovidersettings$factory.dioriteMaxHeight = JsonUtils.getInt(jsonobject, "dioriteMaxHeight", chunkprovidersettings$factory.dioriteMaxHeight); + chunkprovidersettings$factory.andesiteSize = JsonUtils.getInt(jsonobject, "andesiteSize", chunkprovidersettings$factory.andesiteSize); + chunkprovidersettings$factory.andesiteCount = JsonUtils.getInt(jsonobject, "andesiteCount", chunkprovidersettings$factory.andesiteCount); + chunkprovidersettings$factory.andesiteMinHeight = JsonUtils.getInt(jsonobject, "andesiteMinHeight", chunkprovidersettings$factory.andesiteMinHeight); + chunkprovidersettings$factory.andesiteMaxHeight = JsonUtils.getInt(jsonobject, "andesiteMaxHeight", chunkprovidersettings$factory.andesiteMaxHeight); + chunkprovidersettings$factory.coalSize = JsonUtils.getInt(jsonobject, "coalSize", chunkprovidersettings$factory.coalSize); + chunkprovidersettings$factory.coalCount = JsonUtils.getInt(jsonobject, "coalCount", chunkprovidersettings$factory.coalCount); + chunkprovidersettings$factory.coalMinHeight = JsonUtils.getInt(jsonobject, "coalMinHeight", chunkprovidersettings$factory.coalMinHeight); + chunkprovidersettings$factory.coalMaxHeight = JsonUtils.getInt(jsonobject, "coalMaxHeight", chunkprovidersettings$factory.coalMaxHeight); + chunkprovidersettings$factory.ironSize = JsonUtils.getInt(jsonobject, "ironSize", chunkprovidersettings$factory.ironSize); + chunkprovidersettings$factory.ironCount = JsonUtils.getInt(jsonobject, "ironCount", chunkprovidersettings$factory.ironCount); + chunkprovidersettings$factory.ironMinHeight = JsonUtils.getInt(jsonobject, "ironMinHeight", chunkprovidersettings$factory.ironMinHeight); + chunkprovidersettings$factory.ironMaxHeight = JsonUtils.getInt(jsonobject, "ironMaxHeight", chunkprovidersettings$factory.ironMaxHeight); + chunkprovidersettings$factory.goldSize = JsonUtils.getInt(jsonobject, "goldSize", chunkprovidersettings$factory.goldSize); + chunkprovidersettings$factory.goldCount = JsonUtils.getInt(jsonobject, "goldCount", chunkprovidersettings$factory.goldCount); + chunkprovidersettings$factory.goldMinHeight = JsonUtils.getInt(jsonobject, "goldMinHeight", chunkprovidersettings$factory.goldMinHeight); + chunkprovidersettings$factory.goldMaxHeight = JsonUtils.getInt(jsonobject, "goldMaxHeight", chunkprovidersettings$factory.goldMaxHeight); + chunkprovidersettings$factory.redstoneSize = JsonUtils.getInt(jsonobject, "redstoneSize", chunkprovidersettings$factory.redstoneSize); + chunkprovidersettings$factory.redstoneCount = JsonUtils.getInt(jsonobject, "redstoneCount", chunkprovidersettings$factory.redstoneCount); + chunkprovidersettings$factory.redstoneMinHeight = JsonUtils.getInt(jsonobject, "redstoneMinHeight", chunkprovidersettings$factory.redstoneMinHeight); + chunkprovidersettings$factory.redstoneMaxHeight = JsonUtils.getInt(jsonobject, "redstoneMaxHeight", chunkprovidersettings$factory.redstoneMaxHeight); + chunkprovidersettings$factory.diamondSize = JsonUtils.getInt(jsonobject, "diamondSize", chunkprovidersettings$factory.diamondSize); + chunkprovidersettings$factory.diamondCount = JsonUtils.getInt(jsonobject, "diamondCount", chunkprovidersettings$factory.diamondCount); + chunkprovidersettings$factory.diamondMinHeight = JsonUtils.getInt(jsonobject, "diamondMinHeight", chunkprovidersettings$factory.diamondMinHeight); + chunkprovidersettings$factory.diamondMaxHeight = JsonUtils.getInt(jsonobject, "diamondMaxHeight", chunkprovidersettings$factory.diamondMaxHeight); + chunkprovidersettings$factory.lapisSize = JsonUtils.getInt(jsonobject, "lapisSize", chunkprovidersettings$factory.lapisSize); + chunkprovidersettings$factory.lapisCount = JsonUtils.getInt(jsonobject, "lapisCount", chunkprovidersettings$factory.lapisCount); + chunkprovidersettings$factory.lapisCenterHeight = JsonUtils.getInt(jsonobject, "lapisCenterHeight", chunkprovidersettings$factory.lapisCenterHeight); + chunkprovidersettings$factory.lapisSpread = JsonUtils.getInt(jsonobject, "lapisSpread", chunkprovidersettings$factory.lapisSpread); + } + catch (Exception var7) + { + ; + } + + return chunkprovidersettings$factory; + } + + public JsonElement serialize(ChunkProviderSettings.Factory p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("coordinateScale", (Number)Float.valueOf(p_serialize_1_.coordinateScale)); + jsonobject.addProperty("heightScale", (Number)Float.valueOf(p_serialize_1_.heightScale)); + jsonobject.addProperty("lowerLimitScale", (Number)Float.valueOf(p_serialize_1_.lowerLimitScale)); + jsonobject.addProperty("upperLimitScale", (Number)Float.valueOf(p_serialize_1_.upperLimitScale)); + jsonobject.addProperty("depthNoiseScaleX", (Number)Float.valueOf(p_serialize_1_.depthNoiseScaleX)); + jsonobject.addProperty("depthNoiseScaleZ", (Number)Float.valueOf(p_serialize_1_.depthNoiseScaleZ)); + jsonobject.addProperty("depthNoiseScaleExponent", (Number)Float.valueOf(p_serialize_1_.depthNoiseScaleExponent)); + jsonobject.addProperty("mainNoiseScaleX", (Number)Float.valueOf(p_serialize_1_.mainNoiseScaleX)); + jsonobject.addProperty("mainNoiseScaleY", (Number)Float.valueOf(p_serialize_1_.mainNoiseScaleY)); + jsonobject.addProperty("mainNoiseScaleZ", (Number)Float.valueOf(p_serialize_1_.mainNoiseScaleZ)); + jsonobject.addProperty("baseSize", (Number)Float.valueOf(p_serialize_1_.baseSize)); + jsonobject.addProperty("stretchY", (Number)Float.valueOf(p_serialize_1_.stretchY)); + jsonobject.addProperty("biomeDepthWeight", (Number)Float.valueOf(p_serialize_1_.biomeDepthWeight)); + jsonobject.addProperty("biomeDepthOffset", (Number)Float.valueOf(p_serialize_1_.biomeDepthOffset)); + jsonobject.addProperty("biomeScaleWeight", (Number)Float.valueOf(p_serialize_1_.biomeScaleWeight)); + jsonobject.addProperty("biomeScaleOffset", (Number)Float.valueOf(p_serialize_1_.biomeScaleOffset)); + jsonobject.addProperty("seaLevel", (Number)Integer.valueOf(p_serialize_1_.seaLevel)); + jsonobject.addProperty("useCaves", Boolean.valueOf(p_serialize_1_.useCaves)); + jsonobject.addProperty("useDungeons", Boolean.valueOf(p_serialize_1_.useDungeons)); + jsonobject.addProperty("dungeonChance", (Number)Integer.valueOf(p_serialize_1_.dungeonChance)); + jsonobject.addProperty("useStrongholds", Boolean.valueOf(p_serialize_1_.useStrongholds)); + jsonobject.addProperty("useVillages", Boolean.valueOf(p_serialize_1_.useVillages)); + jsonobject.addProperty("useMineShafts", Boolean.valueOf(p_serialize_1_.useMineShafts)); + jsonobject.addProperty("useTemples", Boolean.valueOf(p_serialize_1_.useTemples)); + jsonobject.addProperty("useMonuments", Boolean.valueOf(p_serialize_1_.useMonuments)); + jsonobject.addProperty("useRavines", Boolean.valueOf(p_serialize_1_.useRavines)); + jsonobject.addProperty("useWaterLakes", Boolean.valueOf(p_serialize_1_.useWaterLakes)); + jsonobject.addProperty("waterLakeChance", (Number)Integer.valueOf(p_serialize_1_.waterLakeChance)); + jsonobject.addProperty("useLavaLakes", Boolean.valueOf(p_serialize_1_.useLavaLakes)); + jsonobject.addProperty("lavaLakeChance", (Number)Integer.valueOf(p_serialize_1_.lavaLakeChance)); + jsonobject.addProperty("useLavaOceans", Boolean.valueOf(p_serialize_1_.useLavaOceans)); + jsonobject.addProperty("fixedBiome", (Number)Integer.valueOf(p_serialize_1_.fixedBiome)); + jsonobject.addProperty("biomeSize", (Number)Integer.valueOf(p_serialize_1_.biomeSize)); + jsonobject.addProperty("riverSize", (Number)Integer.valueOf(p_serialize_1_.riverSize)); + jsonobject.addProperty("dirtSize", (Number)Integer.valueOf(p_serialize_1_.dirtSize)); + jsonobject.addProperty("dirtCount", (Number)Integer.valueOf(p_serialize_1_.dirtCount)); + jsonobject.addProperty("dirtMinHeight", (Number)Integer.valueOf(p_serialize_1_.dirtMinHeight)); + jsonobject.addProperty("dirtMaxHeight", (Number)Integer.valueOf(p_serialize_1_.dirtMaxHeight)); + jsonobject.addProperty("gravelSize", (Number)Integer.valueOf(p_serialize_1_.gravelSize)); + jsonobject.addProperty("gravelCount", (Number)Integer.valueOf(p_serialize_1_.gravelCount)); + jsonobject.addProperty("gravelMinHeight", (Number)Integer.valueOf(p_serialize_1_.gravelMinHeight)); + jsonobject.addProperty("gravelMaxHeight", (Number)Integer.valueOf(p_serialize_1_.gravelMaxHeight)); + jsonobject.addProperty("graniteSize", (Number)Integer.valueOf(p_serialize_1_.graniteSize)); + jsonobject.addProperty("graniteCount", (Number)Integer.valueOf(p_serialize_1_.graniteCount)); + jsonobject.addProperty("graniteMinHeight", (Number)Integer.valueOf(p_serialize_1_.graniteMinHeight)); + jsonobject.addProperty("graniteMaxHeight", (Number)Integer.valueOf(p_serialize_1_.graniteMaxHeight)); + jsonobject.addProperty("dioriteSize", (Number)Integer.valueOf(p_serialize_1_.dioriteSize)); + jsonobject.addProperty("dioriteCount", (Number)Integer.valueOf(p_serialize_1_.dioriteCount)); + jsonobject.addProperty("dioriteMinHeight", (Number)Integer.valueOf(p_serialize_1_.dioriteMinHeight)); + jsonobject.addProperty("dioriteMaxHeight", (Number)Integer.valueOf(p_serialize_1_.dioriteMaxHeight)); + jsonobject.addProperty("andesiteSize", (Number)Integer.valueOf(p_serialize_1_.andesiteSize)); + jsonobject.addProperty("andesiteCount", (Number)Integer.valueOf(p_serialize_1_.andesiteCount)); + jsonobject.addProperty("andesiteMinHeight", (Number)Integer.valueOf(p_serialize_1_.andesiteMinHeight)); + jsonobject.addProperty("andesiteMaxHeight", (Number)Integer.valueOf(p_serialize_1_.andesiteMaxHeight)); + jsonobject.addProperty("coalSize", (Number)Integer.valueOf(p_serialize_1_.coalSize)); + jsonobject.addProperty("coalCount", (Number)Integer.valueOf(p_serialize_1_.coalCount)); + jsonobject.addProperty("coalMinHeight", (Number)Integer.valueOf(p_serialize_1_.coalMinHeight)); + jsonobject.addProperty("coalMaxHeight", (Number)Integer.valueOf(p_serialize_1_.coalMaxHeight)); + jsonobject.addProperty("ironSize", (Number)Integer.valueOf(p_serialize_1_.ironSize)); + jsonobject.addProperty("ironCount", (Number)Integer.valueOf(p_serialize_1_.ironCount)); + jsonobject.addProperty("ironMinHeight", (Number)Integer.valueOf(p_serialize_1_.ironMinHeight)); + jsonobject.addProperty("ironMaxHeight", (Number)Integer.valueOf(p_serialize_1_.ironMaxHeight)); + jsonobject.addProperty("goldSize", (Number)Integer.valueOf(p_serialize_1_.goldSize)); + jsonobject.addProperty("goldCount", (Number)Integer.valueOf(p_serialize_1_.goldCount)); + jsonobject.addProperty("goldMinHeight", (Number)Integer.valueOf(p_serialize_1_.goldMinHeight)); + jsonobject.addProperty("goldMaxHeight", (Number)Integer.valueOf(p_serialize_1_.goldMaxHeight)); + jsonobject.addProperty("redstoneSize", (Number)Integer.valueOf(p_serialize_1_.redstoneSize)); + jsonobject.addProperty("redstoneCount", (Number)Integer.valueOf(p_serialize_1_.redstoneCount)); + jsonobject.addProperty("redstoneMinHeight", (Number)Integer.valueOf(p_serialize_1_.redstoneMinHeight)); + jsonobject.addProperty("redstoneMaxHeight", (Number)Integer.valueOf(p_serialize_1_.redstoneMaxHeight)); + jsonobject.addProperty("diamondSize", (Number)Integer.valueOf(p_serialize_1_.diamondSize)); + jsonobject.addProperty("diamondCount", (Number)Integer.valueOf(p_serialize_1_.diamondCount)); + jsonobject.addProperty("diamondMinHeight", (Number)Integer.valueOf(p_serialize_1_.diamondMinHeight)); + jsonobject.addProperty("diamondMaxHeight", (Number)Integer.valueOf(p_serialize_1_.diamondMaxHeight)); + jsonobject.addProperty("lapisSize", (Number)Integer.valueOf(p_serialize_1_.lapisSize)); + jsonobject.addProperty("lapisCount", (Number)Integer.valueOf(p_serialize_1_.lapisCount)); + jsonobject.addProperty("lapisCenterHeight", (Number)Integer.valueOf(p_serialize_1_.lapisCenterHeight)); + jsonobject.addProperty("lapisSpread", (Number)Integer.valueOf(p_serialize_1_.lapisSpread)); + return jsonobject; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java new file mode 100644 index 0000000..f4fc2e9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java @@ -0,0 +1,322 @@ +package net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.biome.BiomeGenBase; + +public class FlatGeneratorInfo +{ + private final List flatLayers = Lists.newArrayList(); + private final Map> worldFeatures = Maps.>newHashMap(); + private int biomeToUse; + + public int getBiome() + { + return this.biomeToUse; + } + + public void setBiome(int biome) + { + this.biomeToUse = biome; + } + + public Map> getWorldFeatures() + { + return this.worldFeatures; + } + + public List getFlatLayers() + { + return this.flatLayers; + } + + public void func_82645_d() + { + int i = 0; + + for (FlatLayerInfo flatlayerinfo : this.flatLayers) + { + flatlayerinfo.setMinY(i); + i += flatlayerinfo.getLayerCount(); + } + } + + public String toString() + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append((int)3); + stringbuilder.append(";"); + + for (int i = 0; i < this.flatLayers.size(); ++i) + { + if (i > 0) + { + stringbuilder.append(","); + } + + stringbuilder.append(((FlatLayerInfo)this.flatLayers.get(i)).toString()); + } + + stringbuilder.append(";"); + stringbuilder.append(this.biomeToUse); + + if (!this.worldFeatures.isEmpty()) + { + stringbuilder.append(";"); + int k = 0; + + for (Entry> entry : this.worldFeatures.entrySet()) + { + if (k++ > 0) + { + stringbuilder.append(","); + } + + stringbuilder.append(((String)entry.getKey()).toLowerCase()); + Map map = (Map)entry.getValue(); + + if (!map.isEmpty()) + { + stringbuilder.append("("); + int j = 0; + + for (Entry entry1 : map.entrySet()) + { + if (j++ > 0) + { + stringbuilder.append(" "); + } + + stringbuilder.append((String)entry1.getKey()); + stringbuilder.append("="); + stringbuilder.append((String)entry1.getValue()); + } + + stringbuilder.append(")"); + } + } + } + else + { + stringbuilder.append(";"); + } + + return stringbuilder.toString(); + } + + private static FlatLayerInfo func_180715_a(int p_180715_0_, String p_180715_1_, int p_180715_2_) + { + String[] astring = p_180715_0_ >= 3 ? p_180715_1_.split("\\*", 2) : p_180715_1_.split("x", 2); + int i = 1; + int j = 0; + + if (astring.length == 2) + { + try + { + i = Integer.parseInt(astring[0]); + + if (p_180715_2_ + i >= 256) + { + i = 256 - p_180715_2_; + } + + if (i < 0) + { + i = 0; + } + } + catch (Throwable var8) + { + return null; + } + } + + Block block = null; + + try + { + String s = astring[astring.length - 1]; + + if (p_180715_0_ < 3) + { + astring = s.split(":", 2); + + if (astring.length > 1) + { + j = Integer.parseInt(astring[1]); + } + + block = Block.getBlockById(Integer.parseInt(astring[0])); + } + else + { + astring = s.split(":", 3); + block = astring.length > 1 ? Block.getBlockFromName(astring[0] + ":" + astring[1]) : null; + + if (block != null) + { + j = astring.length > 2 ? Integer.parseInt(astring[2]) : 0; + } + else + { + block = Block.getBlockFromName(astring[0]); + + if (block != null) + { + j = astring.length > 1 ? Integer.parseInt(astring[1]) : 0; + } + } + + if (block == null) + { + return null; + } + } + + if (block == Blocks.air) + { + j = 0; + } + + if (j < 0 || j > 15) + { + j = 0; + } + } + catch (Throwable var9) + { + return null; + } + + FlatLayerInfo flatlayerinfo = new FlatLayerInfo(p_180715_0_, i, block, j); + flatlayerinfo.setMinY(p_180715_2_); + return flatlayerinfo; + } + + private static List func_180716_a(int p_180716_0_, String p_180716_1_) + { + if (p_180716_1_ != null && p_180716_1_.length() >= 1) + { + List list = Lists.newArrayList(); + String[] astring = p_180716_1_.split(","); + int i = 0; + + for (String s : astring) + { + FlatLayerInfo flatlayerinfo = func_180715_a(p_180716_0_, s, i); + + if (flatlayerinfo == null) + { + return null; + } + + list.add(flatlayerinfo); + i += flatlayerinfo.getLayerCount(); + } + + return list; + } + else + { + return null; + } + } + + public static FlatGeneratorInfo createFlatGeneratorFromString(String flatGeneratorSettings) + { + if (flatGeneratorSettings == null) + { + return getDefaultFlatGenerator(); + } + else + { + String[] astring = flatGeneratorSettings.split(";", -1); + int i = astring.length == 1 ? 0 : MathHelper.parseIntWithDefault(astring[0], 0); + + if (i >= 0 && i <= 3) + { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + int j = astring.length == 1 ? 0 : 1; + List list = func_180716_a(i, astring[j++]); + + if (list != null && !list.isEmpty()) + { + flatgeneratorinfo.getFlatLayers().addAll(list); + flatgeneratorinfo.func_82645_d(); + int k = BiomeGenBase.plains.biomeID; + + if (i > 0 && astring.length > j) + { + k = MathHelper.parseIntWithDefault(astring[j++], k); + } + + flatgeneratorinfo.setBiome(k); + + if (i > 0 && astring.length > j) + { + String[] astring1 = astring[j++].toLowerCase().split(","); + + for (String s : astring1) + { + String[] astring2 = s.split("\\(", 2); + Map map = Maps.newHashMap(); + + if (astring2[0].length() > 0) + { + flatgeneratorinfo.getWorldFeatures().put(astring2[0], map); + + if (astring2.length > 1 && astring2[1].endsWith(")") && astring2[1].length() > 1) + { + String[] astring3 = astring2[1].substring(0, astring2[1].length() - 1).split(" "); + + for (int l = 0; l < astring3.length; ++l) + { + String[] astring4 = astring3[l].split("=", 2); + + if (astring4.length == 2) + { + map.put(astring4[0], astring4[1]); + } + } + } + } + } + } + else + { + flatgeneratorinfo.getWorldFeatures().put("village", Maps.newHashMap()); + } + + return flatgeneratorinfo; + } + else + { + return getDefaultFlatGenerator(); + } + } + else + { + return getDefaultFlatGenerator(); + } + } + } + + public static FlatGeneratorInfo getDefaultFlatGenerator() + { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + flatgeneratorinfo.setBiome(BiomeGenBase.plains.biomeID); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.bedrock)); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(2, Blocks.dirt)); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.grass)); + flatgeneratorinfo.func_82645_d(); + flatgeneratorinfo.getWorldFeatures().put("village", Maps.newHashMap()); + return flatgeneratorinfo; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java new file mode 100644 index 0000000..a3121fd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java @@ -0,0 +1,96 @@ +package net.minecraft.world.gen; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.ResourceLocation; + +public class FlatLayerInfo +{ + private final int field_175902_a; + private IBlockState layerMaterial; + private int layerCount; + private int layerMinimumY; + + public FlatLayerInfo(int p_i45467_1_, Block p_i45467_2_) + { + this(3, p_i45467_1_, p_i45467_2_); + } + + public FlatLayerInfo(int p_i45627_1_, int height, Block layerMaterialIn) + { + this.layerCount = 1; + this.field_175902_a = p_i45627_1_; + this.layerCount = height; + this.layerMaterial = layerMaterialIn.getDefaultState(); + } + + public FlatLayerInfo(int p_i45628_1_, int p_i45628_2_, Block p_i45628_3_, int p_i45628_4_) + { + this(p_i45628_1_, p_i45628_2_, p_i45628_3_); + this.layerMaterial = p_i45628_3_.getStateFromMeta(p_i45628_4_); + } + + public int getLayerCount() + { + return this.layerCount; + } + + public IBlockState getLayerMaterial() + { + return this.layerMaterial; + } + + private Block getLayerMaterialBlock() + { + return this.layerMaterial.getBlock(); + } + + private int getFillBlockMeta() + { + return this.layerMaterial.getBlock().getMetaFromState(this.layerMaterial); + } + + public int getMinY() + { + return this.layerMinimumY; + } + + public void setMinY(int minY) + { + this.layerMinimumY = minY; + } + + public String toString() + { + String s; + + if (this.field_175902_a >= 3) + { + ResourceLocation resourcelocation = (ResourceLocation)Block.blockRegistry.getNameForObject(this.getLayerMaterialBlock()); + s = resourcelocation == null ? "null" : resourcelocation.toString(); + + if (this.layerCount > 1) + { + s = this.layerCount + "*" + s; + } + } + else + { + s = Integer.toString(Block.getIdFromBlock(this.getLayerMaterialBlock())); + + if (this.layerCount > 1) + { + s = this.layerCount + "x" + s; + } + } + + int i = this.getFillBlockMeta(); + + if (i > 0) + { + s = s + ":" + i; + } + + return s; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/GeneratorBushFeature.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/GeneratorBushFeature.java new file mode 100644 index 0000000..07e0bc2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/GeneratorBushFeature.java @@ -0,0 +1,32 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.BlockBush; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class GeneratorBushFeature extends WorldGenerator +{ + private BlockBush field_175908_a; + + public GeneratorBushFeature(BlockBush p_i45633_1_) + { + this.field_175908_a = p_i45633_1_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 64; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.getHasNoSky() || blockpos.getY() < 255) && this.field_175908_a.canBlockStay(worldIn, blockpos, this.field_175908_a.getDefaultState())) + { + worldIn.setBlockState(blockpos, this.field_175908_a.getDefaultState(), 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenBase.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenBase.java new file mode 100644 index 0000000..26a27da --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenBase.java @@ -0,0 +1,37 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; + +public class MapGenBase +{ + protected int range = 8; + protected Random rand = new Random(); + protected World worldObj; + + public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn) + { + int i = this.range; + this.worldObj = worldIn; + this.rand.setSeed(worldIn.getSeed()); + long j = this.rand.nextLong(); + long k = this.rand.nextLong(); + + for (int l = x - i; l <= x + i; ++l) + { + for (int i1 = z - i; i1 <= z + i; ++i1) + { + long j1 = (long)l * j; + long k1 = (long)i1 * k; + this.rand.setSeed(j1 ^ k1 ^ worldIn.getSeed()); + this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn); + } + } + } + + protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenCaves.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenCaves.java new file mode 100644 index 0000000..5625384 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenCaves.java @@ -0,0 +1,264 @@ +package net.minecraft.world.gen; + +import com.google.common.base.Objects; +import java.util.Random; +import net.minecraft.block.BlockSand; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; + +public class MapGenCaves extends MapGenBase +{ + protected void func_180703_a(long p_180703_1_, int p_180703_3_, int p_180703_4_, ChunkPrimer p_180703_5_, double p_180703_6_, double p_180703_8_, double p_180703_10_) + { + this.func_180702_a(p_180703_1_, p_180703_3_, p_180703_4_, p_180703_5_, p_180703_6_, p_180703_8_, p_180703_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_180702_a(long p_180702_1_, int p_180702_3_, int p_180702_4_, ChunkPrimer p_180702_5_, double p_180702_6_, double p_180702_8_, double p_180702_10_, float p_180702_12_, float p_180702_13_, float p_180702_14_, int p_180702_15_, int p_180702_16_, double p_180702_17_) + { + double d0 = (double)(p_180702_3_ * 16 + 8); + double d1 = (double)(p_180702_4_ * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + Random random = new Random(p_180702_1_); + + if (p_180702_16_ <= 0) + { + int i = this.range * 16 - 16; + p_180702_16_ = i - random.nextInt(i / 4); + } + + boolean flag2 = false; + + if (p_180702_15_ == -1) + { + p_180702_15_ = p_180702_16_ / 2; + flag2 = true; + } + + int j = random.nextInt(p_180702_16_ / 2) + p_180702_16_ / 4; + + for (boolean flag = random.nextInt(6) == 0; p_180702_15_ < p_180702_16_; ++p_180702_15_) + { + double d2 = 1.5D + (double)(MathHelper.sin((float)p_180702_15_ * (float)Math.PI / (float)p_180702_16_) * p_180702_12_ * 1.0F); + double d3 = d2 * p_180702_17_; + float f2 = MathHelper.cos(p_180702_14_); + float f3 = MathHelper.sin(p_180702_14_); + p_180702_6_ += (double)(MathHelper.cos(p_180702_13_) * f2); + p_180702_8_ += (double)f3; + p_180702_10_ += (double)(MathHelper.sin(p_180702_13_) * f2); + + if (flag) + { + p_180702_14_ = p_180702_14_ * 0.92F; + } + else + { + p_180702_14_ = p_180702_14_ * 0.7F; + } + + p_180702_14_ = p_180702_14_ + f1 * 0.1F; + p_180702_13_ += f * 0.1F; + f1 = f1 * 0.9F; + f = f * 0.75F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (!flag2 && p_180702_15_ == j && p_180702_12_ > 1.0F && p_180702_16_ > 0) + { + this.func_180702_a(random.nextLong(), p_180702_3_, p_180702_4_, p_180702_5_, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ - ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D); + this.func_180702_a(random.nextLong(), p_180702_3_, p_180702_4_, p_180702_5_, p_180702_6_, p_180702_8_, p_180702_10_, random.nextFloat() * 0.5F + 0.5F, p_180702_13_ + ((float)Math.PI / 2F), p_180702_14_ / 3.0F, p_180702_15_, p_180702_16_, 1.0D); + return; + } + + if (flag2 || random.nextInt(4) != 0) + { + double d4 = p_180702_6_ - d0; + double d5 = p_180702_10_ - d1; + double d6 = (double)(p_180702_16_ - p_180702_15_); + double d7 = (double)(p_180702_12_ + 2.0F + 16.0F); + + if (d4 * d4 + d5 * d5 - d6 * d6 > d7 * d7) + { + return; + } + + if (p_180702_6_ >= d0 - 16.0D - d2 * 2.0D && p_180702_10_ >= d1 - 16.0D - d2 * 2.0D && p_180702_6_ <= d0 + 16.0D + d2 * 2.0D && p_180702_10_ <= d1 + 16.0D + d2 * 2.0D) + { + int k2 = MathHelper.floor_double(p_180702_6_ - d2) - p_180702_3_ * 16 - 1; + int k = MathHelper.floor_double(p_180702_6_ + d2) - p_180702_3_ * 16 + 1; + int l2 = MathHelper.floor_double(p_180702_8_ - d3) - 1; + int l = MathHelper.floor_double(p_180702_8_ + d3) + 1; + int i3 = MathHelper.floor_double(p_180702_10_ - d2) - p_180702_4_ * 16 - 1; + int i1 = MathHelper.floor_double(p_180702_10_ + d2) - p_180702_4_ * 16 + 1; + + if (k2 < 0) + { + k2 = 0; + } + + if (k > 16) + { + k = 16; + } + + if (l2 < 1) + { + l2 = 1; + } + + if (l > 248) + { + l = 248; + } + + if (i3 < 0) + { + i3 = 0; + } + + if (i1 > 16) + { + i1 = 16; + } + + boolean flag3 = false; + + for (int j1 = k2; !flag3 && j1 < k; ++j1) + { + for (int k1 = i3; !flag3 && k1 < i1; ++k1) + { + for (int l1 = l + 1; !flag3 && l1 >= l2 - 1; --l1) + { + if (l1 >= 0 && l1 < 256) + { + IBlockState iblockstate = p_180702_5_.getBlockState(j1, l1, k1); + + if (iblockstate.getBlock() == Blocks.flowing_water || iblockstate.getBlock() == Blocks.water) + { + flag3 = true; + } + + if (l1 != l2 - 1 && j1 != k2 && j1 != k - 1 && k1 != i3 && k1 != i1 - 1) + { + l1 = l2; + } + } + } + } + } + + if (!flag3) + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j3 = k2; j3 < k; ++j3) + { + double d10 = ((double)(j3 + p_180702_3_ * 16) + 0.5D - p_180702_6_) / d2; + + for (int i2 = i3; i2 < i1; ++i2) + { + double d8 = ((double)(i2 + p_180702_4_ * 16) + 0.5D - p_180702_10_) / d2; + boolean flag1 = false; + + if (d10 * d10 + d8 * d8 < 1.0D) + { + for (int j2 = l; j2 > l2; --j2) + { + double d9 = ((double)(j2 - 1) + 0.5D - p_180702_8_) / d3; + + if (d9 > -0.7D && d10 * d10 + d9 * d9 + d8 * d8 < 1.0D) + { + IBlockState iblockstate1 = p_180702_5_.getBlockState(j3, j2, i2); + IBlockState iblockstate2 = (IBlockState)Objects.firstNonNull(p_180702_5_.getBlockState(j3, j2 + 1, i2), Blocks.air.getDefaultState()); + + if (iblockstate1.getBlock() == Blocks.grass || iblockstate1.getBlock() == Blocks.mycelium) + { + flag1 = true; + } + + if (this.func_175793_a(iblockstate1, iblockstate2)) + { + if (j2 - 1 < 10) + { + p_180702_5_.setBlockState(j3, j2, i2, Blocks.lava.getDefaultState()); + } + else + { + p_180702_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); + + if (iblockstate2.getBlock() == Blocks.sand) + { + p_180702_5_.setBlockState(j3, j2 + 1, i2, iblockstate2.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.red_sandstone.getDefaultState() : Blocks.sandstone.getDefaultState()); + } + + if (flag1 && p_180702_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) + { + blockpos$mutableblockpos.set(j3 + p_180702_3_ * 16, 0, i2 + p_180702_4_ * 16); + p_180702_5_.setBlockState(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock.getBlock().getDefaultState()); + } + } + } + } + } + } + } + } + + if (flag2) + { + break; + } + } + } + } + } + } + + protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_) + { + return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water)))))))); + } + + protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + { + int i = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(15) + 1) + 1); + + if (this.rand.nextInt(7) != 0) + { + i = 0; + } + + for (int j = 0; j < i; ++j) + { + double d0 = (double)(chunkX * 16 + this.rand.nextInt(16)); + double d1 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8); + double d2 = (double)(chunkZ * 16 + this.rand.nextInt(16)); + int k = 1; + + if (this.rand.nextInt(4) == 0) + { + this.func_180703_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2); + k += this.rand.nextInt(4); + } + + for (int l = 0; l < k; ++l) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + + if (this.rand.nextInt(10) == 0) + { + f2 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; + } + + this.func_180702_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2, f, f1, 0, 0, 1.0D); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenCavesHell.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenCavesHell.java new file mode 100644 index 0000000..1fec05c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenCavesHell.java @@ -0,0 +1,219 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; + +public class MapGenCavesHell extends MapGenBase +{ + protected void func_180705_a(long p_180705_1_, int p_180705_3_, int p_180705_4_, ChunkPrimer p_180705_5_, double p_180705_6_, double p_180705_8_, double p_180705_10_) + { + this.func_180704_a(p_180705_1_, p_180705_3_, p_180705_4_, p_180705_5_, p_180705_6_, p_180705_8_, p_180705_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_180704_a(long p_180704_1_, int p_180704_3_, int p_180704_4_, ChunkPrimer p_180704_5_, double p_180704_6_, double p_180704_8_, double p_180704_10_, float p_180704_12_, float p_180704_13_, float p_180704_14_, int p_180704_15_, int p_180704_16_, double p_180704_17_) + { + double d0 = (double)(p_180704_3_ * 16 + 8); + double d1 = (double)(p_180704_4_ * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + Random random = new Random(p_180704_1_); + + if (p_180704_16_ <= 0) + { + int i = this.range * 16 - 16; + p_180704_16_ = i - random.nextInt(i / 4); + } + + boolean flag1 = false; + + if (p_180704_15_ == -1) + { + p_180704_15_ = p_180704_16_ / 2; + flag1 = true; + } + + int j = random.nextInt(p_180704_16_ / 2) + p_180704_16_ / 4; + + for (boolean flag = random.nextInt(6) == 0; p_180704_15_ < p_180704_16_; ++p_180704_15_) + { + double d2 = 1.5D + (double)(MathHelper.sin((float)p_180704_15_ * (float)Math.PI / (float)p_180704_16_) * p_180704_12_ * 1.0F); + double d3 = d2 * p_180704_17_; + float f2 = MathHelper.cos(p_180704_14_); + float f3 = MathHelper.sin(p_180704_14_); + p_180704_6_ += (double)(MathHelper.cos(p_180704_13_) * f2); + p_180704_8_ += (double)f3; + p_180704_10_ += (double)(MathHelper.sin(p_180704_13_) * f2); + + if (flag) + { + p_180704_14_ = p_180704_14_ * 0.92F; + } + else + { + p_180704_14_ = p_180704_14_ * 0.7F; + } + + p_180704_14_ = p_180704_14_ + f1 * 0.1F; + p_180704_13_ += f * 0.1F; + f1 = f1 * 0.9F; + f = f * 0.75F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (!flag1 && p_180704_15_ == j && p_180704_12_ > 1.0F) + { + this.func_180704_a(random.nextLong(), p_180704_3_, p_180704_4_, p_180704_5_, p_180704_6_, p_180704_8_, p_180704_10_, random.nextFloat() * 0.5F + 0.5F, p_180704_13_ - ((float)Math.PI / 2F), p_180704_14_ / 3.0F, p_180704_15_, p_180704_16_, 1.0D); + this.func_180704_a(random.nextLong(), p_180704_3_, p_180704_4_, p_180704_5_, p_180704_6_, p_180704_8_, p_180704_10_, random.nextFloat() * 0.5F + 0.5F, p_180704_13_ + ((float)Math.PI / 2F), p_180704_14_ / 3.0F, p_180704_15_, p_180704_16_, 1.0D); + return; + } + + if (flag1 || random.nextInt(4) != 0) + { + double d4 = p_180704_6_ - d0; + double d5 = p_180704_10_ - d1; + double d6 = (double)(p_180704_16_ - p_180704_15_); + double d7 = (double)(p_180704_12_ + 2.0F + 16.0F); + + if (d4 * d4 + d5 * d5 - d6 * d6 > d7 * d7) + { + return; + } + + if (p_180704_6_ >= d0 - 16.0D - d2 * 2.0D && p_180704_10_ >= d1 - 16.0D - d2 * 2.0D && p_180704_6_ <= d0 + 16.0D + d2 * 2.0D && p_180704_10_ <= d1 + 16.0D + d2 * 2.0D) + { + int j2 = MathHelper.floor_double(p_180704_6_ - d2) - p_180704_3_ * 16 - 1; + int k = MathHelper.floor_double(p_180704_6_ + d2) - p_180704_3_ * 16 + 1; + int k2 = MathHelper.floor_double(p_180704_8_ - d3) - 1; + int l = MathHelper.floor_double(p_180704_8_ + d3) + 1; + int l2 = MathHelper.floor_double(p_180704_10_ - d2) - p_180704_4_ * 16 - 1; + int i1 = MathHelper.floor_double(p_180704_10_ + d2) - p_180704_4_ * 16 + 1; + + if (j2 < 0) + { + j2 = 0; + } + + if (k > 16) + { + k = 16; + } + + if (k2 < 1) + { + k2 = 1; + } + + if (l > 120) + { + l = 120; + } + + if (l2 < 0) + { + l2 = 0; + } + + if (i1 > 16) + { + i1 = 16; + } + + boolean flag2 = false; + + for (int j1 = j2; !flag2 && j1 < k; ++j1) + { + for (int k1 = l2; !flag2 && k1 < i1; ++k1) + { + for (int l1 = l + 1; !flag2 && l1 >= k2 - 1; --l1) + { + if (l1 >= 0 && l1 < 128) + { + IBlockState iblockstate = p_180704_5_.getBlockState(j1, l1, k1); + + if (iblockstate.getBlock() == Blocks.flowing_lava || iblockstate.getBlock() == Blocks.lava) + { + flag2 = true; + } + + if (l1 != k2 - 1 && j1 != j2 && j1 != k - 1 && k1 != l2 && k1 != i1 - 1) + { + l1 = k2; + } + } + } + } + } + + if (!flag2) + { + for (int i3 = j2; i3 < k; ++i3) + { + double d10 = ((double)(i3 + p_180704_3_ * 16) + 0.5D - p_180704_6_) / d2; + + for (int j3 = l2; j3 < i1; ++j3) + { + double d8 = ((double)(j3 + p_180704_4_ * 16) + 0.5D - p_180704_10_) / d2; + + for (int i2 = l; i2 > k2; --i2) + { + double d9 = ((double)(i2 - 1) + 0.5D - p_180704_8_) / d3; + + if (d9 > -0.7D && d10 * d10 + d9 * d9 + d8 * d8 < 1.0D) + { + IBlockState iblockstate1 = p_180704_5_.getBlockState(i3, i2, j3); + + if (iblockstate1.getBlock() == Blocks.netherrack || iblockstate1.getBlock() == Blocks.dirt || iblockstate1.getBlock() == Blocks.grass) + { + p_180704_5_.setBlockState(i3, i2, j3, Blocks.air.getDefaultState()); + } + } + } + } + } + + if (flag1) + { + break; + } + } + } + } + } + } + + protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + { + int i = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(10) + 1) + 1); + + if (this.rand.nextInt(5) != 0) + { + i = 0; + } + + for (int j = 0; j < i; ++j) + { + double d0 = (double)(chunkX * 16 + this.rand.nextInt(16)); + double d1 = (double)this.rand.nextInt(128); + double d2 = (double)(chunkZ * 16 + this.rand.nextInt(16)); + int k = 1; + + if (this.rand.nextInt(4) == 0) + { + this.func_180705_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2); + k += this.rand.nextInt(4); + } + + for (int l = 0; l < k; ++l) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + this.func_180704_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2 * 2.0F, f, f1, 0, 0, 0.5D); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenRavine.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenRavine.java new file mode 100644 index 0000000..decc612 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/MapGenRavine.java @@ -0,0 +1,224 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; + +public class MapGenRavine extends MapGenBase +{ + private float[] field_75046_d = new float[1024]; + + protected void func_180707_a(long p_180707_1_, int p_180707_3_, int p_180707_4_, ChunkPrimer p_180707_5_, double p_180707_6_, double p_180707_8_, double p_180707_10_, float p_180707_12_, float p_180707_13_, float p_180707_14_, int p_180707_15_, int p_180707_16_, double p_180707_17_) + { + Random random = new Random(p_180707_1_); + double d0 = (double)(p_180707_3_ * 16 + 8); + double d1 = (double)(p_180707_4_ * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + + if (p_180707_16_ <= 0) + { + int i = this.range * 16 - 16; + p_180707_16_ = i - random.nextInt(i / 4); + } + + boolean flag1 = false; + + if (p_180707_15_ == -1) + { + p_180707_15_ = p_180707_16_ / 2; + flag1 = true; + } + + float f2 = 1.0F; + + for (int j = 0; j < 256; ++j) + { + if (j == 0 || random.nextInt(3) == 0) + { + f2 = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F; + } + + this.field_75046_d[j] = f2 * f2; + } + + for (; p_180707_15_ < p_180707_16_; ++p_180707_15_) + { + double d9 = 1.5D + (double)(MathHelper.sin((float)p_180707_15_ * (float)Math.PI / (float)p_180707_16_) * p_180707_12_ * 1.0F); + double d2 = d9 * p_180707_17_; + d9 = d9 * ((double)random.nextFloat() * 0.25D + 0.75D); + d2 = d2 * ((double)random.nextFloat() * 0.25D + 0.75D); + float f3 = MathHelper.cos(p_180707_14_); + float f4 = MathHelper.sin(p_180707_14_); + p_180707_6_ += (double)(MathHelper.cos(p_180707_13_) * f3); + p_180707_8_ += (double)f4; + p_180707_10_ += (double)(MathHelper.sin(p_180707_13_) * f3); + p_180707_14_ = p_180707_14_ * 0.7F; + p_180707_14_ = p_180707_14_ + f1 * 0.05F; + p_180707_13_ += f * 0.05F; + f1 = f1 * 0.8F; + f = f * 0.5F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (flag1 || random.nextInt(4) != 0) + { + double d3 = p_180707_6_ - d0; + double d4 = p_180707_10_ - d1; + double d5 = (double)(p_180707_16_ - p_180707_15_); + double d6 = (double)(p_180707_12_ + 2.0F + 16.0F); + + if (d3 * d3 + d4 * d4 - d5 * d5 > d6 * d6) + { + return; + } + + if (p_180707_6_ >= d0 - 16.0D - d9 * 2.0D && p_180707_10_ >= d1 - 16.0D - d9 * 2.0D && p_180707_6_ <= d0 + 16.0D + d9 * 2.0D && p_180707_10_ <= d1 + 16.0D + d9 * 2.0D) + { + int k2 = MathHelper.floor_double(p_180707_6_ - d9) - p_180707_3_ * 16 - 1; + int k = MathHelper.floor_double(p_180707_6_ + d9) - p_180707_3_ * 16 + 1; + int l2 = MathHelper.floor_double(p_180707_8_ - d2) - 1; + int l = MathHelper.floor_double(p_180707_8_ + d2) + 1; + int i3 = MathHelper.floor_double(p_180707_10_ - d9) - p_180707_4_ * 16 - 1; + int i1 = MathHelper.floor_double(p_180707_10_ + d9) - p_180707_4_ * 16 + 1; + + if (k2 < 0) + { + k2 = 0; + } + + if (k > 16) + { + k = 16; + } + + if (l2 < 1) + { + l2 = 1; + } + + if (l > 248) + { + l = 248; + } + + if (i3 < 0) + { + i3 = 0; + } + + if (i1 > 16) + { + i1 = 16; + } + + boolean flag2 = false; + + for (int j1 = k2; !flag2 && j1 < k; ++j1) + { + for (int k1 = i3; !flag2 && k1 < i1; ++k1) + { + for (int l1 = l + 1; !flag2 && l1 >= l2 - 1; --l1) + { + if (l1 >= 0 && l1 < 256) + { + IBlockState iblockstate = p_180707_5_.getBlockState(j1, l1, k1); + + if (iblockstate.getBlock() == Blocks.flowing_water || iblockstate.getBlock() == Blocks.water) + { + flag2 = true; + } + + if (l1 != l2 - 1 && j1 != k2 && j1 != k - 1 && k1 != i3 && k1 != i1 - 1) + { + l1 = l2; + } + } + } + } + } + + if (!flag2) + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j3 = k2; j3 < k; ++j3) + { + double d10 = ((double)(j3 + p_180707_3_ * 16) + 0.5D - p_180707_6_) / d9; + + for (int i2 = i3; i2 < i1; ++i2) + { + double d7 = ((double)(i2 + p_180707_4_ * 16) + 0.5D - p_180707_10_) / d9; + boolean flag = false; + + if (d10 * d10 + d7 * d7 < 1.0D) + { + for (int j2 = l; j2 > l2; --j2) + { + double d8 = ((double)(j2 - 1) + 0.5D - p_180707_8_) / d2; + + if ((d10 * d10 + d7 * d7) * (double)this.field_75046_d[j2 - 1] + d8 * d8 / 6.0D < 1.0D) + { + IBlockState iblockstate1 = p_180707_5_.getBlockState(j3, j2, i2); + + if (iblockstate1.getBlock() == Blocks.grass) + { + flag = true; + } + + if (iblockstate1.getBlock() == Blocks.stone || iblockstate1.getBlock() == Blocks.dirt || iblockstate1.getBlock() == Blocks.grass) + { + if (j2 - 1 < 10) + { + p_180707_5_.setBlockState(j3, j2, i2, Blocks.flowing_lava.getDefaultState()); + } + else + { + p_180707_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); + + if (flag && p_180707_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) + { + blockpos$mutableblockpos.set(j3 + p_180707_3_ * 16, 0, i2 + p_180707_4_ * 16); + p_180707_5_.setBlockState(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock); + } + } + } + } + } + } + } + } + + if (flag1) + { + break; + } + } + } + } + } + } + + protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + { + if (this.rand.nextInt(50) == 0) + { + double d0 = (double)(chunkX * 16 + this.rand.nextInt(16)); + double d1 = (double)(this.rand.nextInt(this.rand.nextInt(40) + 8) + 20); + double d2 = (double)(chunkZ * 16 + this.rand.nextInt(16)); + int i = 1; + + for (int j = 0; j < i; ++j) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F; + this.func_180707_a(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2, f, f1, 0, 0, 3.0D); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGenerator.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGenerator.java new file mode 100644 index 0000000..7eaa0d6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGenerator.java @@ -0,0 +1,5 @@ +package net.minecraft.world.gen; + +public abstract class NoiseGenerator +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java new file mode 100644 index 0000000..68ef146 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java @@ -0,0 +1,196 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorImproved extends NoiseGenerator +{ + private int[] permutations; + public double xCoord; + public double yCoord; + public double zCoord; + private static final double[] field_152381_e = new double[] {1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D}; + private static final double[] field_152382_f = new double[] {1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D}; + private static final double[] field_152383_g = new double[] {0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D}; + private static final double[] field_152384_h = new double[] {1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D}; + private static final double[] field_152385_i = new double[] {0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D}; + + public NoiseGeneratorImproved() + { + this(new Random()); + } + + public NoiseGeneratorImproved(Random p_i45469_1_) + { + this.permutations = new int[512]; + this.xCoord = p_i45469_1_.nextDouble() * 256.0D; + this.yCoord = p_i45469_1_.nextDouble() * 256.0D; + this.zCoord = p_i45469_1_.nextDouble() * 256.0D; + + for (int i = 0; i < 256; this.permutations[i] = i++) + { + ; + } + + for (int l = 0; l < 256; ++l) + { + int j = p_i45469_1_.nextInt(256 - l) + l; + int k = this.permutations[l]; + this.permutations[l] = this.permutations[j]; + this.permutations[j] = k; + this.permutations[l + 256] = this.permutations[l]; + } + } + + public final double lerp(double p_76311_1_, double p_76311_3_, double p_76311_5_) + { + return p_76311_3_ + p_76311_1_ * (p_76311_5_ - p_76311_3_); + } + + public final double func_76309_a(int p_76309_1_, double p_76309_2_, double p_76309_4_) + { + int i = p_76309_1_ & 15; + return field_152384_h[i] * p_76309_2_ + field_152385_i[i] * p_76309_4_; + } + + public final double grad(int p_76310_1_, double p_76310_2_, double p_76310_4_, double p_76310_6_) + { + int i = p_76310_1_ & 15; + return field_152381_e[i] * p_76310_2_ + field_152382_f[i] * p_76310_4_ + field_152383_g[i] * p_76310_6_; + } + + public void populateNoiseArray(double[] noiseArray, double xOffset, double yOffset, double zOffset, int xSize, int ySize, int zSize, double xScale, double yScale, double zScale, double noiseScale) + { + if (ySize == 1) + { + int i5 = 0; + int j5 = 0; + int j = 0; + int k5 = 0; + double d14 = 0.0D; + double d15 = 0.0D; + int l5 = 0; + double d16 = 1.0D / noiseScale; + + for (int j2 = 0; j2 < xSize; ++j2) + { + double d17 = xOffset + (double)j2 * xScale + this.xCoord; + int i6 = (int)d17; + + if (d17 < (double)i6) + { + --i6; + } + + int k2 = i6 & 255; + d17 = d17 - (double)i6; + double d18 = d17 * d17 * d17 * (d17 * (d17 * 6.0D - 15.0D) + 10.0D); + + for (int j6 = 0; j6 < zSize; ++j6) + { + double d19 = zOffset + (double)j6 * zScale + this.zCoord; + int k6 = (int)d19; + + if (d19 < (double)k6) + { + --k6; + } + + int l6 = k6 & 255; + d19 = d19 - (double)k6; + double d20 = d19 * d19 * d19 * (d19 * (d19 * 6.0D - 15.0D) + 10.0D); + i5 = this.permutations[k2] + 0; + j5 = this.permutations[i5] + l6; + j = this.permutations[k2 + 1] + 0; + k5 = this.permutations[j] + l6; + d14 = this.lerp(d18, this.func_76309_a(this.permutations[j5], d17, d19), this.grad(this.permutations[k5], d17 - 1.0D, 0.0D, d19)); + d15 = this.lerp(d18, this.grad(this.permutations[j5 + 1], d17, 0.0D, d19 - 1.0D), this.grad(this.permutations[k5 + 1], d17 - 1.0D, 0.0D, d19 - 1.0D)); + double d21 = this.lerp(d20, d14, d15); + int i7 = l5++; + noiseArray[i7] += d21 * d16; + } + } + } + else + { + int i = 0; + double d0 = 1.0D / noiseScale; + int k = -1; + int l = 0; + int i1 = 0; + int j1 = 0; + int k1 = 0; + int l1 = 0; + int i2 = 0; + double d1 = 0.0D; + double d2 = 0.0D; + double d3 = 0.0D; + double d4 = 0.0D; + + for (int l2 = 0; l2 < xSize; ++l2) + { + double d5 = xOffset + (double)l2 * xScale + this.xCoord; + int i3 = (int)d5; + + if (d5 < (double)i3) + { + --i3; + } + + int j3 = i3 & 255; + d5 = d5 - (double)i3; + double d6 = d5 * d5 * d5 * (d5 * (d5 * 6.0D - 15.0D) + 10.0D); + + for (int k3 = 0; k3 < zSize; ++k3) + { + double d7 = zOffset + (double)k3 * zScale + this.zCoord; + int l3 = (int)d7; + + if (d7 < (double)l3) + { + --l3; + } + + int i4 = l3 & 255; + d7 = d7 - (double)l3; + double d8 = d7 * d7 * d7 * (d7 * (d7 * 6.0D - 15.0D) + 10.0D); + + for (int j4 = 0; j4 < ySize; ++j4) + { + double d9 = yOffset + (double)j4 * yScale + this.yCoord; + int k4 = (int)d9; + + if (d9 < (double)k4) + { + --k4; + } + + int l4 = k4 & 255; + d9 = d9 - (double)k4; + double d10 = d9 * d9 * d9 * (d9 * (d9 * 6.0D - 15.0D) + 10.0D); + + if (j4 == 0 || l4 != k) + { + k = l4; + l = this.permutations[j3] + l4; + i1 = this.permutations[l] + i4; + j1 = this.permutations[l + 1] + i4; + k1 = this.permutations[j3 + 1] + l4; + l1 = this.permutations[k1] + i4; + i2 = this.permutations[k1 + 1] + i4; + d1 = this.lerp(d6, this.grad(this.permutations[i1], d5, d9, d7), this.grad(this.permutations[l1], d5 - 1.0D, d9, d7)); + d2 = this.lerp(d6, this.grad(this.permutations[j1], d5, d9 - 1.0D, d7), this.grad(this.permutations[i2], d5 - 1.0D, d9 - 1.0D, d7)); + d3 = this.lerp(d6, this.grad(this.permutations[i1 + 1], d5, d9, d7 - 1.0D), this.grad(this.permutations[l1 + 1], d5 - 1.0D, d9, d7 - 1.0D)); + d4 = this.lerp(d6, this.grad(this.permutations[j1 + 1], d5, d9 - 1.0D, d7 - 1.0D), this.grad(this.permutations[i2 + 1], d5 - 1.0D, d9 - 1.0D, d7 - 1.0D)); + } + + double d11 = this.lerp(d10, d1, d2); + double d12 = this.lerp(d10, d3, d4); + double d13 = this.lerp(d8, d11, d12); + int j7 = i++; + noiseArray[j7] += d13 * d0; + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java new file mode 100644 index 0000000..5646d69 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java @@ -0,0 +1,62 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.util.MathHelper; + +public class NoiseGeneratorOctaves extends NoiseGenerator +{ + private NoiseGeneratorImproved[] generatorCollection; + private int octaves; + + public NoiseGeneratorOctaves(Random seed, int octavesIn) + { + this.octaves = octavesIn; + this.generatorCollection = new NoiseGeneratorImproved[octavesIn]; + + for (int i = 0; i < octavesIn; ++i) + { + this.generatorCollection[i] = new NoiseGeneratorImproved(seed); + } + } + + public double[] generateNoiseOctaves(double[] noiseArray, int xOffset, int yOffset, int zOffset, int xSize, int ySize, int zSize, double xScale, double yScale, double zScale) + { + if (noiseArray == null) + { + noiseArray = new double[xSize * ySize * zSize]; + } + else + { + for (int i = 0; i < noiseArray.length; ++i) + { + noiseArray[i] = 0.0D; + } + } + + double d3 = 1.0D; + + for (int j = 0; j < this.octaves; ++j) + { + double d0 = (double)xOffset * d3 * xScale; + double d1 = (double)yOffset * d3 * yScale; + double d2 = (double)zOffset * d3 * zScale; + long k = MathHelper.floor_double_long(d0); + long l = MathHelper.floor_double_long(d2); + d0 = d0 - (double)k; + d2 = d2 - (double)l; + k = k % 16777216L; + l = l % 16777216L; + d0 = d0 + (double)k; + d2 = d2 + (double)l; + this.generatorCollection[j].populateNoiseArray(noiseArray, d0, d1, d2, xSize, ySize, zSize, xScale * d3, yScale * d3, zScale * d3, d3); + d3 /= 2.0D; + } + + return noiseArray; + } + + public double[] generateNoiseOctaves(double[] noiseArray, int xOffset, int zOffset, int xSize, int zSize, double xScale, double zScale, double p_76305_10_) + { + return this.generateNoiseOctaves(noiseArray, xOffset, 10, zOffset, xSize, 1, zSize, xScale, 1.0D, zScale); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java new file mode 100644 index 0000000..1743647 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java @@ -0,0 +1,66 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorPerlin extends NoiseGenerator +{ + private NoiseGeneratorSimplex[] field_151603_a; + private int field_151602_b; + + public NoiseGeneratorPerlin(Random p_i45470_1_, int p_i45470_2_) + { + this.field_151602_b = p_i45470_2_; + this.field_151603_a = new NoiseGeneratorSimplex[p_i45470_2_]; + + for (int i = 0; i < p_i45470_2_; ++i) + { + this.field_151603_a[i] = new NoiseGeneratorSimplex(p_i45470_1_); + } + } + + public double func_151601_a(double p_151601_1_, double p_151601_3_) + { + double d0 = 0.0D; + double d1 = 1.0D; + + for (int i = 0; i < this.field_151602_b; ++i) + { + d0 += this.field_151603_a[i].func_151605_a(p_151601_1_ * d1, p_151601_3_ * d1) / d1; + d1 /= 2.0D; + } + + return d0; + } + + public double[] func_151599_a(double[] p_151599_1_, double p_151599_2_, double p_151599_4_, int p_151599_6_, int p_151599_7_, double p_151599_8_, double p_151599_10_, double p_151599_12_) + { + return this.func_151600_a(p_151599_1_, p_151599_2_, p_151599_4_, p_151599_6_, p_151599_7_, p_151599_8_, p_151599_10_, p_151599_12_, 0.5D); + } + + public double[] func_151600_a(double[] p_151600_1_, double p_151600_2_, double p_151600_4_, int p_151600_6_, int p_151600_7_, double p_151600_8_, double p_151600_10_, double p_151600_12_, double p_151600_14_) + { + if (p_151600_1_ != null && p_151600_1_.length >= p_151600_6_ * p_151600_7_) + { + for (int i = 0; i < p_151600_1_.length; ++i) + { + p_151600_1_[i] = 0.0D; + } + } + else + { + p_151600_1_ = new double[p_151600_6_ * p_151600_7_]; + } + + double d1 = 1.0D; + double d0 = 1.0D; + + for (int j = 0; j < this.field_151602_b; ++j) + { + this.field_151603_a[j].func_151606_a(p_151600_1_, p_151600_2_, p_151600_4_, p_151600_6_, p_151600_7_, p_151600_8_ * d0 * d1, p_151600_10_ * d0 * d1, 0.55D / d1); + d0 *= p_151600_12_; + d1 *= p_151600_14_; + } + + return p_151600_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java new file mode 100644 index 0000000..741069e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java @@ -0,0 +1,216 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorSimplex +{ + private static int[][] field_151611_e = new int[][] {{1, 1, 0}, { -1, 1, 0}, {1, -1, 0}, { -1, -1, 0}, {1, 0, 1}, { -1, 0, 1}, {1, 0, -1}, { -1, 0, -1}, {0, 1, 1}, {0, -1, 1}, {0, 1, -1}, {0, -1, -1}}; + public static final double field_151614_a = Math.sqrt(3.0D); + private int[] field_151608_f; + public double field_151612_b; + public double field_151613_c; + public double field_151610_d; + private static final double field_151609_g = 0.5D * (field_151614_a - 1.0D); + private static final double field_151615_h = (3.0D - field_151614_a) / 6.0D; + + public NoiseGeneratorSimplex() + { + this(new Random()); + } + + public NoiseGeneratorSimplex(Random p_i45471_1_) + { + this.field_151608_f = new int[512]; + this.field_151612_b = p_i45471_1_.nextDouble() * 256.0D; + this.field_151613_c = p_i45471_1_.nextDouble() * 256.0D; + this.field_151610_d = p_i45471_1_.nextDouble() * 256.0D; + + for (int i = 0; i < 256; this.field_151608_f[i] = i++) + { + ; + } + + for (int l = 0; l < 256; ++l) + { + int j = p_i45471_1_.nextInt(256 - l) + l; + int k = this.field_151608_f[l]; + this.field_151608_f[l] = this.field_151608_f[j]; + this.field_151608_f[j] = k; + this.field_151608_f[l + 256] = this.field_151608_f[l]; + } + } + + private static int func_151607_a(double p_151607_0_) + { + return p_151607_0_ > 0.0D ? (int)p_151607_0_ : (int)p_151607_0_ - 1; + } + + private static double func_151604_a(int[] p_151604_0_, double p_151604_1_, double p_151604_3_) + { + return (double)p_151604_0_[0] * p_151604_1_ + (double)p_151604_0_[1] * p_151604_3_; + } + + public double func_151605_a(double p_151605_1_, double p_151605_3_) + { + double d3 = 0.5D * (field_151614_a - 1.0D); + double d4 = (p_151605_1_ + p_151605_3_) * d3; + int i = func_151607_a(p_151605_1_ + d4); + int j = func_151607_a(p_151605_3_ + d4); + double d5 = (3.0D - field_151614_a) / 6.0D; + double d6 = (double)(i + j) * d5; + double d7 = (double)i - d6; + double d8 = (double)j - d6; + double d9 = p_151605_1_ - d7; + double d10 = p_151605_3_ - d8; + int k; + int l; + + if (d9 > d10) + { + k = 1; + l = 0; + } + else + { + k = 0; + l = 1; + } + + double d11 = d9 - (double)k + d5; + double d12 = d10 - (double)l + d5; + double d13 = d9 - 1.0D + 2.0D * d5; + double d14 = d10 - 1.0D + 2.0D * d5; + int i1 = i & 255; + int j1 = j & 255; + int k1 = this.field_151608_f[i1 + this.field_151608_f[j1]] % 12; + int l1 = this.field_151608_f[i1 + k + this.field_151608_f[j1 + l]] % 12; + int i2 = this.field_151608_f[i1 + 1 + this.field_151608_f[j1 + 1]] % 12; + double d15 = 0.5D - d9 * d9 - d10 * d10; + double d0; + + if (d15 < 0.0D) + { + d0 = 0.0D; + } + else + { + d15 = d15 * d15; + d0 = d15 * d15 * func_151604_a(field_151611_e[k1], d9, d10); + } + + double d16 = 0.5D - d11 * d11 - d12 * d12; + double d1; + + if (d16 < 0.0D) + { + d1 = 0.0D; + } + else + { + d16 = d16 * d16; + d1 = d16 * d16 * func_151604_a(field_151611_e[l1], d11, d12); + } + + double d17 = 0.5D - d13 * d13 - d14 * d14; + double d2; + + if (d17 < 0.0D) + { + d2 = 0.0D; + } + else + { + d17 = d17 * d17; + d2 = d17 * d17 * func_151604_a(field_151611_e[i2], d13, d14); + } + + return 70.0D * (d0 + d1 + d2); + } + + public void func_151606_a(double[] p_151606_1_, double p_151606_2_, double p_151606_4_, int p_151606_6_, int p_151606_7_, double p_151606_8_, double p_151606_10_, double p_151606_12_) + { + int i = 0; + + for (int j = 0; j < p_151606_7_; ++j) + { + double d0 = (p_151606_4_ + (double)j) * p_151606_10_ + this.field_151613_c; + + for (int k = 0; k < p_151606_6_; ++k) + { + double d1 = (p_151606_2_ + (double)k) * p_151606_8_ + this.field_151612_b; + double d5 = (d1 + d0) * field_151609_g; + int l = func_151607_a(d1 + d5); + int i1 = func_151607_a(d0 + d5); + double d6 = (double)(l + i1) * field_151615_h; + double d7 = (double)l - d6; + double d8 = (double)i1 - d6; + double d9 = d1 - d7; + double d10 = d0 - d8; + int j1; + int k1; + + if (d9 > d10) + { + j1 = 1; + k1 = 0; + } + else + { + j1 = 0; + k1 = 1; + } + + double d11 = d9 - (double)j1 + field_151615_h; + double d12 = d10 - (double)k1 + field_151615_h; + double d13 = d9 - 1.0D + 2.0D * field_151615_h; + double d14 = d10 - 1.0D + 2.0D * field_151615_h; + int l1 = l & 255; + int i2 = i1 & 255; + int j2 = this.field_151608_f[l1 + this.field_151608_f[i2]] % 12; + int k2 = this.field_151608_f[l1 + j1 + this.field_151608_f[i2 + k1]] % 12; + int l2 = this.field_151608_f[l1 + 1 + this.field_151608_f[i2 + 1]] % 12; + double d15 = 0.5D - d9 * d9 - d10 * d10; + double d2; + + if (d15 < 0.0D) + { + d2 = 0.0D; + } + else + { + d15 = d15 * d15; + d2 = d15 * d15 * func_151604_a(field_151611_e[j2], d9, d10); + } + + double d16 = 0.5D - d11 * d11 - d12 * d12; + double d3; + + if (d16 < 0.0D) + { + d3 = 0.0D; + } + else + { + d16 = d16 * d16; + d3 = d16 * d16 * func_151604_a(field_151611_e[k2], d11, d12); + } + + double d17 = 0.5D - d13 * d13 - d14 * d14; + double d4; + + if (d17 < 0.0D) + { + d4 = 0.0D; + } + else + { + d17 = d17 * d17; + d4 = d17 * d17 * func_151604_a(field_151611_e[l2], d13, d14); + } + + int i3 = i++; + p_151606_1_[i3] += 70.0D * (d2 + d3 + d4) * p_151606_12_; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java new file mode 100644 index 0000000..f6a8d08 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java @@ -0,0 +1,34 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public abstract class WorldGenAbstractTree extends WorldGenerator +{ + public WorldGenAbstractTree(boolean notify) + { + super(notify); + } + + protected boolean func_150523_a(Block p_150523_1_) + { + Material material = p_150523_1_.getMaterial(); + return material == Material.air || material == Material.leaves || p_150523_1_ == Blocks.grass || p_150523_1_ == Blocks.dirt || p_150523_1_ == Blocks.log || p_150523_1_ == Blocks.log2 || p_150523_1_ == Blocks.sapling || p_150523_1_ == Blocks.vine; + } + + public void func_180711_a(World worldIn, Random p_180711_2_, BlockPos p_180711_3_) + { + } + + protected void func_175921_a(World worldIn, BlockPos pos) + { + if (worldIn.getBlockState(pos).getBlock() != Blocks.dirt) + { + this.setBlockAndNotifyAdequately(worldIn, pos, Blocks.dirt.getDefaultState()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java new file mode 100644 index 0000000..ed62c86 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -0,0 +1,221 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockHugeMushroom; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenBigMushroom extends WorldGenerator +{ + private Block mushroomType; + + public WorldGenBigMushroom(Block p_i46449_1_) + { + super(true); + this.mushroomType = p_i46449_1_; + } + + public WorldGenBigMushroom() + { + super(false); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (this.mushroomType == null) + { + this.mushroomType = rand.nextBoolean() ? Blocks.brown_mushroom_block : Blocks.red_mushroom_block; + } + + int i = rand.nextInt(3) + 4; + boolean flag = true; + + if (position.getY() >= 1 && position.getY() + i + 1 < 256) + { + for (int j = position.getY(); j <= position.getY() + 1 + i; ++j) + { + int k = 3; + + if (j <= position.getY() + 3) + { + k = 0; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l = position.getX() - k; l <= position.getX() + k && flag; ++l) + { + for (int i1 = position.getZ() - k; i1 <= position.getZ() + k && flag; ++i1) + { + if (j >= 0 && j < 256) + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock(); + + if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = worldIn.getBlockState(position.down()).getBlock(); + + if (block1 != Blocks.dirt && block1 != Blocks.grass && block1 != Blocks.mycelium) + { + return false; + } + else + { + int k2 = position.getY() + i; + + if (this.mushroomType == Blocks.red_mushroom_block) + { + k2 = position.getY() + i - 3; + } + + for (int l2 = k2; l2 <= position.getY() + i; ++l2) + { + int j3 = 1; + + if (l2 < position.getY() + i) + { + ++j3; + } + + if (this.mushroomType == Blocks.brown_mushroom_block) + { + j3 = 3; + } + + int k3 = position.getX() - j3; + int l3 = position.getX() + j3; + int j1 = position.getZ() - j3; + int k1 = position.getZ() + j3; + + for (int l1 = k3; l1 <= l3; ++l1) + { + for (int i2 = j1; i2 <= k1; ++i2) + { + int j2 = 5; + + if (l1 == k3) + { + --j2; + } + else if (l1 == l3) + { + ++j2; + } + + if (i2 == j1) + { + j2 -= 3; + } + else if (i2 == k1) + { + j2 += 3; + } + + BlockHugeMushroom.EnumType blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.byMetadata(j2); + + if (this.mushroomType == Blocks.brown_mushroom_block || l2 < position.getY() + i) + { + if ((l1 == k3 || l1 == l3) && (i2 == j1 || i2 == k1)) + { + continue; + } + + if (l1 == position.getX() - (j3 - 1) && i2 == j1) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_WEST; + } + + if (l1 == k3 && i2 == position.getZ() - (j3 - 1)) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_WEST; + } + + if (l1 == position.getX() + (j3 - 1) && i2 == j1) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_EAST; + } + + if (l1 == l3 && i2 == position.getZ() - (j3 - 1)) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.NORTH_EAST; + } + + if (l1 == position.getX() - (j3 - 1) && i2 == k1) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_WEST; + } + + if (l1 == k3 && i2 == position.getZ() + (j3 - 1)) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_WEST; + } + + if (l1 == position.getX() + (j3 - 1) && i2 == k1) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_EAST; + } + + if (l1 == l3 && i2 == position.getZ() + (j3 - 1)) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.SOUTH_EAST; + } + } + + if (blockhugemushroom$enumtype == BlockHugeMushroom.EnumType.CENTER && l2 < position.getY() + i) + { + blockhugemushroom$enumtype = BlockHugeMushroom.EnumType.ALL_INSIDE; + } + + if (position.getY() >= position.getY() + i - 1 || blockhugemushroom$enumtype != BlockHugeMushroom.EnumType.ALL_INSIDE) + { + BlockPos blockpos = new BlockPos(l1, l2, i2); + + if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, blockhugemushroom$enumtype)); + } + } + } + } + } + + for (int i3 = 0; i3 < i; ++i3) + { + Block block2 = worldIn.getBlockState(position.up(i3)).getBlock(); + + if (!block2.isFullBlock()) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(i3), this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM)); + } + } + + return true; + } + } + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java new file mode 100644 index 0000000..bd62e01 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java @@ -0,0 +1,340 @@ +package net.minecraft.world.gen.feature; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLog; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenBigTree extends WorldGenAbstractTree +{ + private Random rand; + private World world; + private BlockPos basePos = BlockPos.ORIGIN; + int heightLimit; + int height; + double heightAttenuation = 0.618D; + double branchSlope = 0.381D; + double scaleWidth = 1.0D; + double leafDensity = 1.0D; + int trunkSize = 1; + int heightLimitLimit = 12; + int leafDistanceLimit = 4; + List field_175948_j; + + public WorldGenBigTree(boolean p_i2008_1_) + { + super(p_i2008_1_); + } + + void generateLeafNodeList() + { + this.height = (int)((double)this.heightLimit * this.heightAttenuation); + + if (this.height >= this.heightLimit) + { + this.height = this.heightLimit - 1; + } + + int i = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D)); + + if (i < 1) + { + i = 1; + } + + int j = this.basePos.getY() + this.height; + int k = this.heightLimit - this.leafDistanceLimit; + this.field_175948_j = Lists.newArrayList(); + this.field_175948_j.add(new WorldGenBigTree.FoliageCoordinates(this.basePos.up(k), j)); + + for (; k >= 0; --k) + { + float f = this.layerSize(k); + + if (f >= 0.0F) + { + for (int l = 0; l < i; ++l) + { + double d0 = this.scaleWidth * (double)f * ((double)this.rand.nextFloat() + 0.328D); + double d1 = (double)(this.rand.nextFloat() * 2.0F) * Math.PI; + double d2 = d0 * Math.sin(d1) + 0.5D; + double d3 = d0 * Math.cos(d1) + 0.5D; + BlockPos blockpos = this.basePos.add(d2, (double)(k - 1), d3); + BlockPos blockpos1 = blockpos.up(this.leafDistanceLimit); + + if (this.checkBlockLine(blockpos, blockpos1) == -1) + { + int i1 = this.basePos.getX() - blockpos.getX(); + int j1 = this.basePos.getZ() - blockpos.getZ(); + double d4 = (double)blockpos.getY() - Math.sqrt((double)(i1 * i1 + j1 * j1)) * this.branchSlope; + int k1 = d4 > (double)j ? j : (int)d4; + BlockPos blockpos2 = new BlockPos(this.basePos.getX(), k1, this.basePos.getZ()); + + if (this.checkBlockLine(blockpos2, blockpos) == -1) + { + this.field_175948_j.add(new WorldGenBigTree.FoliageCoordinates(blockpos, blockpos2.getY())); + } + } + } + } + } + } + + void func_181631_a(BlockPos p_181631_1_, float p_181631_2_, IBlockState p_181631_3_) + { + int i = (int)((double)p_181631_2_ + 0.618D); + + for (int j = -i; j <= i; ++j) + { + for (int k = -i; k <= i; ++k) + { + if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_181631_2_ * p_181631_2_)) + { + BlockPos blockpos = p_181631_1_.add(j, 0, k); + Material material = this.world.getBlockState(blockpos).getBlock().getMaterial(); + + if (material == Material.air || material == Material.leaves) + { + this.setBlockAndNotifyAdequately(this.world, blockpos, p_181631_3_); + } + } + } + } + } + + float layerSize(int p_76490_1_) + { + if ((float)p_76490_1_ < (float)this.heightLimit * 0.3F) + { + return -1.0F; + } + else + { + float f = (float)this.heightLimit / 2.0F; + float f1 = f - (float)p_76490_1_; + float f2 = MathHelper.sqrt_float(f * f - f1 * f1); + + if (f1 == 0.0F) + { + f2 = f; + } + else if (Math.abs(f1) >= f) + { + return 0.0F; + } + + return f2 * 0.5F; + } + } + + float leafSize(int p_76495_1_) + { + return p_76495_1_ >= 0 && p_76495_1_ < this.leafDistanceLimit ? (p_76495_1_ != 0 && p_76495_1_ != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; + } + + void generateLeafNode(BlockPos pos) + { + for (int i = 0; i < this.leafDistanceLimit; ++i) + { + this.func_181631_a(pos.up(i), this.leafSize(i), Blocks.leaves.getDefaultState().withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false))); + } + } + + void func_175937_a(BlockPos p_175937_1_, BlockPos p_175937_2_, Block p_175937_3_) + { + BlockPos blockpos = p_175937_2_.add(-p_175937_1_.getX(), -p_175937_1_.getY(), -p_175937_1_.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float)blockpos.getX() / (float)i; + float f1 = (float)blockpos.getY() / (float)i; + float f2 = (float)blockpos.getZ() / (float)i; + + for (int j = 0; j <= i; ++j) + { + BlockPos blockpos1 = p_175937_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); + BlockLog.EnumAxis blocklog$enumaxis = this.func_175938_b(p_175937_1_, blockpos1); + this.setBlockAndNotifyAdequately(this.world, blockpos1, p_175937_3_.getDefaultState().withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis)); + } + } + + private int getGreatestDistance(BlockPos posIn) + { + int i = MathHelper.abs_int(posIn.getX()); + int j = MathHelper.abs_int(posIn.getY()); + int k = MathHelper.abs_int(posIn.getZ()); + return k > i && k > j ? k : (j > i ? j : i); + } + + private BlockLog.EnumAxis func_175938_b(BlockPos p_175938_1_, BlockPos p_175938_2_) + { + BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y; + int i = Math.abs(p_175938_2_.getX() - p_175938_1_.getX()); + int j = Math.abs(p_175938_2_.getZ() - p_175938_1_.getZ()); + int k = Math.max(i, j); + + if (k > 0) + { + if (i == k) + { + blocklog$enumaxis = BlockLog.EnumAxis.X; + } + else if (j == k) + { + blocklog$enumaxis = BlockLog.EnumAxis.Z; + } + } + + return blocklog$enumaxis; + } + + void generateLeaves() + { + for (WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.field_175948_j) + { + this.generateLeafNode(worldgenbigtree$foliagecoordinates); + } + } + + boolean leafNodeNeedsBase(int p_76493_1_) + { + return (double)p_76493_1_ >= (double)this.heightLimit * 0.2D; + } + + void generateTrunk() + { + BlockPos blockpos = this.basePos; + BlockPos blockpos1 = this.basePos.up(this.height); + Block block = Blocks.log; + this.func_175937_a(blockpos, blockpos1, block); + + if (this.trunkSize == 2) + { + this.func_175937_a(blockpos.east(), blockpos1.east(), block); + this.func_175937_a(blockpos.east().south(), blockpos1.east().south(), block); + this.func_175937_a(blockpos.south(), blockpos1.south(), block); + } + } + + void generateLeafNodeBases() + { + for (WorldGenBigTree.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.field_175948_j) + { + int i = worldgenbigtree$foliagecoordinates.func_177999_q(); + BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ()); + + if (!blockpos.equals(worldgenbigtree$foliagecoordinates) && this.leafNodeNeedsBase(i - this.basePos.getY())) + { + this.func_175937_a(blockpos, worldgenbigtree$foliagecoordinates, Blocks.log); + } + } + } + + int checkBlockLine(BlockPos posOne, BlockPos posTwo) + { + BlockPos blockpos = posTwo.add(-posOne.getX(), -posOne.getY(), -posOne.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float)blockpos.getX() / (float)i; + float f1 = (float)blockpos.getY() / (float)i; + float f2 = (float)blockpos.getZ() / (float)i; + + if (i == 0) + { + return -1; + } + else + { + for (int j = 0; j <= i; ++j) + { + BlockPos blockpos1 = posOne.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); + + if (!this.func_150523_a(this.world.getBlockState(blockpos1).getBlock())) + { + return j; + } + } + + return -1; + } + } + + public void func_175904_e() + { + this.leafDistanceLimit = 5; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + this.world = worldIn; + this.basePos = position; + this.rand = new Random(rand.nextLong()); + + if (this.heightLimit == 0) + { + this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); + } + + if (!this.validTreeLocation()) + { + return false; + } + else + { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + return true; + } + } + + private boolean validTreeLocation() + { + Block block = this.world.getBlockState(this.basePos.down()).getBlock(); + + if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland) + { + return false; + } + else + { + int i = this.checkBlockLine(this.basePos, this.basePos.up(this.heightLimit - 1)); + + if (i == -1) + { + return true; + } + else if (i < 6) + { + return false; + } + else + { + this.heightLimit = i; + return true; + } + } + } + + static class FoliageCoordinates extends BlockPos + { + private final int field_178000_b; + + public FoliageCoordinates(BlockPos p_i45635_1_, int p_i45635_2_) + { + super(p_i45635_1_.getX(), p_i45635_1_.getY(), p_i45635_1_.getZ()); + this.field_178000_b = p_i45635_2_; + } + + public int func_177999_q() + { + return this.field_178000_b; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java new file mode 100644 index 0000000..06bff0f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java @@ -0,0 +1,72 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenBlockBlob extends WorldGenerator +{ + private final Block field_150545_a; + private final int field_150544_b; + + public WorldGenBlockBlob(Block p_i45450_1_, int p_i45450_2_) + { + super(false); + this.field_150545_a = p_i45450_1_; + this.field_150544_b = p_i45450_2_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + while (true) + { + label0: + { + if (position.getY() > 3) + { + if (worldIn.isAirBlock(position.down())) + { + break label0; + } + + Block block = worldIn.getBlockState(position.down()).getBlock(); + + if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.stone) + { + break label0; + } + } + + if (position.getY() <= 3) + { + return false; + } + + int i1 = this.field_150544_b; + + for (int i = 0; i1 >= 0 && i < 3; ++i) + { + int j = i1 + rand.nextInt(2); + int k = i1 + rand.nextInt(2); + int l = i1 + rand.nextInt(2); + float f = (float)(j + k + l) * 0.333F + 0.5F; + + for (BlockPos blockpos : BlockPos.getAllInBox(position.add(-j, -k, -l), position.add(j, k, l))) + { + if (blockpos.distanceSq(position) <= (double)(f * f)) + { + worldIn.setBlockState(blockpos, this.field_150545_a.getDefaultState(), 4); + } + } + + position = position.add(-(i1 + 1) + rand.nextInt(2 + i1 * 2), 0 - rand.nextInt(2), -(i1 + 1) + rand.nextInt(2 + i1 * 2)); + } + + return true; + } + position = position.down(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java new file mode 100644 index 0000000..9a4112e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java @@ -0,0 +1,32 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenCactus extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 10; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos)) + { + int j = 1 + rand.nextInt(rand.nextInt(3) + 1); + + for (int k = 0; k < j; ++k) + { + if (Blocks.cactus.canBlockStay(worldIn, blockpos)) + { + worldIn.setBlockState(blockpos.up(k), Blocks.cactus.getDefaultState(), 2); + } + } + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java new file mode 100644 index 0000000..3f02510 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java @@ -0,0 +1,219 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockNewLeaf; +import net.minecraft.block.BlockNewLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenCanopyTree extends WorldGenAbstractTree +{ + private static final IBlockState field_181640_a = Blocks.log2.getDefaultState().withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.DARK_OAK); + private static final IBlockState field_181641_b = Blocks.leaves2.getDefaultState().withProperty(BlockNewLeaf.VARIANT, BlockPlanks.EnumType.DARK_OAK).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenCanopyTree(boolean p_i45461_1_) + { + super(p_i45461_1_); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = rand.nextInt(3) + rand.nextInt(2) + 6; + int j = position.getX(); + int k = position.getY(); + int l = position.getZ(); + + if (k >= 1 && k + i + 1 < 256) + { + BlockPos blockpos = position.down(); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block != Blocks.grass && block != Blocks.dirt) + { + return false; + } + else if (!this.func_181638_a(worldIn, position, i)) + { + return false; + } + else + { + this.func_175921_a(worldIn, blockpos); + this.func_175921_a(worldIn, blockpos.east()); + this.func_175921_a(worldIn, blockpos.south()); + this.func_175921_a(worldIn, blockpos.south().east()); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(rand); + int i1 = i - rand.nextInt(4); + int j1 = 2 - rand.nextInt(3); + int k1 = j; + int l1 = l; + int i2 = k + i - 1; + + for (int j2 = 0; j2 < i; ++j2) + { + if (j2 >= i1 && j1 > 0) + { + k1 += enumfacing.getFrontOffsetX(); + l1 += enumfacing.getFrontOffsetZ(); + --j1; + } + + int k2 = k + j2; + BlockPos blockpos1 = new BlockPos(k1, k2, l1); + Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); + + if (material == Material.air || material == Material.leaves) + { + this.func_181639_b(worldIn, blockpos1); + this.func_181639_b(worldIn, blockpos1.east()); + this.func_181639_b(worldIn, blockpos1.south()); + this.func_181639_b(worldIn, blockpos1.east().south()); + } + } + + for (int i3 = -2; i3 <= 0; ++i3) + { + for (int l3 = -2; l3 <= 0; ++l3) + { + int k4 = -1; + this.func_150526_a(worldIn, k1 + i3, i2 + k4, l1 + l3); + this.func_150526_a(worldIn, 1 + k1 - i3, i2 + k4, l1 + l3); + this.func_150526_a(worldIn, k1 + i3, i2 + k4, 1 + l1 - l3); + this.func_150526_a(worldIn, 1 + k1 - i3, i2 + k4, 1 + l1 - l3); + + if ((i3 > -2 || l3 > -1) && (i3 != -1 || l3 != -2)) + { + k4 = 1; + this.func_150526_a(worldIn, k1 + i3, i2 + k4, l1 + l3); + this.func_150526_a(worldIn, 1 + k1 - i3, i2 + k4, l1 + l3); + this.func_150526_a(worldIn, k1 + i3, i2 + k4, 1 + l1 - l3); + this.func_150526_a(worldIn, 1 + k1 - i3, i2 + k4, 1 + l1 - l3); + } + } + } + + if (rand.nextBoolean()) + { + this.func_150526_a(worldIn, k1, i2 + 2, l1); + this.func_150526_a(worldIn, k1 + 1, i2 + 2, l1); + this.func_150526_a(worldIn, k1 + 1, i2 + 2, l1 + 1); + this.func_150526_a(worldIn, k1, i2 + 2, l1 + 1); + } + + for (int j3 = -3; j3 <= 4; ++j3) + { + for (int i4 = -3; i4 <= 4; ++i4) + { + if ((j3 != -3 || i4 != -3) && (j3 != -3 || i4 != 4) && (j3 != 4 || i4 != -3) && (j3 != 4 || i4 != 4) && (Math.abs(j3) < 3 || Math.abs(i4) < 3)) + { + this.func_150526_a(worldIn, k1 + j3, i2, l1 + i4); + } + } + } + + for (int k3 = -1; k3 <= 2; ++k3) + { + for (int j4 = -1; j4 <= 2; ++j4) + { + if ((k3 < 0 || k3 > 1 || j4 < 0 || j4 > 1) && rand.nextInt(3) <= 0) + { + int l4 = rand.nextInt(3) + 2; + + for (int i5 = 0; i5 < l4; ++i5) + { + this.func_181639_b(worldIn, new BlockPos(j + k3, i2 - i5 - 1, l + j4)); + } + + for (int j5 = -1; j5 <= 1; ++j5) + { + for (int l2 = -1; l2 <= 1; ++l2) + { + this.func_150526_a(worldIn, k1 + k3 + j5, i2, l1 + j4 + l2); + } + } + + for (int k5 = -2; k5 <= 2; ++k5) + { + for (int l5 = -2; l5 <= 2; ++l5) + { + if (Math.abs(k5) != 2 || Math.abs(l5) != 2) + { + this.func_150526_a(worldIn, k1 + k3 + k5, i2 - 1, l1 + j4 + l5); + } + } + } + } + } + } + + return true; + } + } + else + { + return false; + } + } + + private boolean func_181638_a(World p_181638_1_, BlockPos p_181638_2_, int p_181638_3_) + { + int i = p_181638_2_.getX(); + int j = p_181638_2_.getY(); + int k = p_181638_2_.getZ(); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l = 0; l <= p_181638_3_ + 1; ++l) + { + int i1 = 1; + + if (l == 0) + { + i1 = 0; + } + + if (l >= p_181638_3_ - 1) + { + i1 = 2; + } + + for (int j1 = -i1; j1 <= i1; ++j1) + { + for (int k1 = -i1; k1 <= i1; ++k1) + { + if (!this.func_150523_a(p_181638_1_.getBlockState(blockpos$mutableblockpos.set(i + j1, j + l, k + k1)).getBlock())) + { + return false; + } + } + } + } + + return true; + } + + private void func_181639_b(World p_181639_1_, BlockPos p_181639_2_) + { + if (this.func_150523_a(p_181639_1_.getBlockState(p_181639_2_).getBlock())) + { + this.setBlockAndNotifyAdequately(p_181639_1_, p_181639_2_, field_181640_a); + } + } + + private void func_150526_a(World worldIn, int p_150526_2_, int p_150526_3_, int p_150526_4_) + { + BlockPos blockpos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() == Material.air) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181641_b); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java new file mode 100644 index 0000000..f13d269 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java @@ -0,0 +1,57 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenClay extends WorldGenerator +{ + private Block field_150546_a = Blocks.clay; + private int numberOfBlocks; + + public WorldGenClay(int p_i2011_1_) + { + this.numberOfBlocks = p_i2011_1_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.water) + { + return false; + } + else + { + int i = rand.nextInt(this.numberOfBlocks - 2) + 2; + int j = 1; + + for (int k = position.getX() - i; k <= position.getX() + i; ++k) + { + for (int l = position.getZ() - i; l <= position.getZ() + i; ++l) + { + int i1 = k - position.getX(); + int j1 = l - position.getZ(); + + if (i1 * i1 + j1 * j1 <= i * i) + { + for (int k1 = position.getY() - j; k1 <= position.getY() + j; ++k1) + { + BlockPos blockpos = new BlockPos(k, k1, l); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block == Blocks.dirt || block == Blocks.clay) + { + worldIn.setBlockState(blockpos, this.field_150546_a.getDefaultState(), 2); + } + } + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java new file mode 100644 index 0000000..0440d43 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java @@ -0,0 +1,33 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenDeadBush extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + Block block; + + while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) + { + position = position.down(); + } + + for (int i = 0; i < 4; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos) && Blocks.deadbush.canBlockStay(worldIn, blockpos, Blocks.deadbush.getDefaultState())) + { + worldIn.setBlockState(blockpos, Blocks.deadbush.getDefaultState(), 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java new file mode 100644 index 0000000..3dd54ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java @@ -0,0 +1,106 @@ +package net.minecraft.world.gen.feature; + +import com.google.common.base.Predicates; +import java.util.Random; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockStateHelper; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenDesertWells extends WorldGenerator +{ + private static final BlockStateHelper field_175913_a = BlockStateHelper.forBlock(Blocks.sand).where(BlockSand.VARIANT, Predicates.equalTo(BlockSand.EnumType.SAND)); + private final IBlockState field_175911_b = Blocks.stone_slab.getDefaultState().withProperty(BlockStoneSlab.VARIANT, BlockStoneSlab.EnumType.SAND).withProperty(BlockSlab.HALF, BlockSlab.EnumBlockHalf.BOTTOM); + private final IBlockState field_175912_c = Blocks.sandstone.getDefaultState(); + private final IBlockState field_175910_d = Blocks.flowing_water.getDefaultState(); + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + while (worldIn.isAirBlock(position) && position.getY() > 2) + { + position = position.down(); + } + + if (!field_175913_a.apply(worldIn.getBlockState(position))) + { + return false; + } + else + { + for (int i = -2; i <= 2; ++i) + { + for (int j = -2; j <= 2; ++j) + { + if (worldIn.isAirBlock(position.add(i, -1, j)) && worldIn.isAirBlock(position.add(i, -2, j))) + { + return false; + } + } + } + + for (int l = -1; l <= 0; ++l) + { + for (int l1 = -2; l1 <= 2; ++l1) + { + for (int k = -2; k <= 2; ++k) + { + worldIn.setBlockState(position.add(l1, l, k), this.field_175912_c, 2); + } + } + } + + worldIn.setBlockState(position, this.field_175910_d, 2); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + worldIn.setBlockState(position.offset(enumfacing), this.field_175910_d, 2); + } + + for (int i1 = -2; i1 <= 2; ++i1) + { + for (int i2 = -2; i2 <= 2; ++i2) + { + if (i1 == -2 || i1 == 2 || i2 == -2 || i2 == 2) + { + worldIn.setBlockState(position.add(i1, 1, i2), this.field_175912_c, 2); + } + } + } + + worldIn.setBlockState(position.add(2, 1, 0), this.field_175911_b, 2); + worldIn.setBlockState(position.add(-2, 1, 0), this.field_175911_b, 2); + worldIn.setBlockState(position.add(0, 1, 2), this.field_175911_b, 2); + worldIn.setBlockState(position.add(0, 1, -2), this.field_175911_b, 2); + + for (int j1 = -1; j1 <= 1; ++j1) + { + for (int j2 = -1; j2 <= 1; ++j2) + { + if (j1 == 0 && j2 == 0) + { + worldIn.setBlockState(position.add(j1, 4, j2), this.field_175912_c, 2); + } + else + { + worldIn.setBlockState(position.add(j1, 4, j2), this.field_175911_b, 2); + } + } + } + + for (int k1 = 1; k1 <= 3; ++k1) + { + worldIn.setBlockState(position.add(-1, k1, -1), this.field_175912_c, 2); + worldIn.setBlockState(position.add(-1, k1, 1), this.field_175912_c, 2); + worldIn.setBlockState(position.add(1, k1, -1), this.field_175912_c, 2); + worldIn.setBlockState(position.add(1, k1, 1), this.field_175912_c, 2); + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java new file mode 100644 index 0000000..7880a2b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java @@ -0,0 +1,35 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenDoublePlant extends WorldGenerator +{ + private BlockDoublePlant.EnumPlantType field_150549_a; + + public void setPlantType(BlockDoublePlant.EnumPlantType p_180710_1_) + { + this.field_150549_a = p_180710_1_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + boolean flag = false; + + for (int i = 0; i < 64; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.getHasNoSky() || blockpos.getY() < 254) && Blocks.double_plant.canPlaceBlockAt(worldIn, blockpos)) + { + Blocks.double_plant.placeAt(worldIn, blockpos, this.field_150549_a, 2); + flag = true; + } + } + + return flag; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java new file mode 100644 index 0000000..1c3a4e0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java @@ -0,0 +1,164 @@ +package net.minecraft.world.gen.feature; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class WorldGenDungeons extends WorldGenerator +{ + private static final Logger field_175918_a = LogManager.getLogger(); + private static final String[] SPAWNERTYPES = new String[] {"Skeleton", "Zombie", "Zombie", "Spider"}; + private static final List CHESTCONTENT = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 4, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 1, 10), new WeightedRandomChestContent(Items.wheat, 0, 1, 4, 10), new WeightedRandomChestContent(Items.gunpowder, 0, 1, 4, 10), new WeightedRandomChestContent(Items.string, 0, 1, 4, 10), new WeightedRandomChestContent(Items.bucket, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), new WeightedRandomChestContent(Items.redstone, 0, 1, 4, 10), new WeightedRandomChestContent(Items.record_13, 0, 1, 1, 4), new WeightedRandomChestContent(Items.record_cat, 0, 1, 1, 4), new WeightedRandomChestContent(Items.name_tag, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 2), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}); + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = 3; + int j = rand.nextInt(2) + 2; + int k = -j - 1; + int l = j + 1; + int i1 = -1; + int j1 = 4; + int k1 = rand.nextInt(2) + 2; + int l1 = -k1 - 1; + int i2 = k1 + 1; + int j2 = 0; + + for (int k2 = k; k2 <= l; ++k2) + { + for (int l2 = -1; l2 <= 4; ++l2) + { + for (int i3 = l1; i3 <= i2; ++i3) + { + BlockPos blockpos = position.add(k2, l2, i3); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + boolean flag = material.isSolid(); + + if (l2 == -1 && !flag) + { + return false; + } + + if (l2 == 4 && !flag) + { + return false; + } + + if ((k2 == k || k2 == l || i3 == l1 || i3 == i2) && l2 == 0 && worldIn.isAirBlock(blockpos) && worldIn.isAirBlock(blockpos.up())) + { + ++j2; + } + } + } + } + + if (j2 >= 1 && j2 <= 5) + { + for (int k3 = k; k3 <= l; ++k3) + { + for (int i4 = 3; i4 >= -1; --i4) + { + for (int k4 = l1; k4 <= i2; ++k4) + { + BlockPos blockpos1 = position.add(k3, i4, k4); + + if (k3 != k && i4 != -1 && k4 != l1 && k3 != l && i4 != 4 && k4 != i2) + { + if (worldIn.getBlockState(blockpos1).getBlock() != Blocks.chest) + { + worldIn.setBlockToAir(blockpos1); + } + } + else if (blockpos1.getY() >= 0 && !worldIn.getBlockState(blockpos1.down()).getBlock().getMaterial().isSolid()) + { + worldIn.setBlockToAir(blockpos1); + } + else if (worldIn.getBlockState(blockpos1).getBlock().getMaterial().isSolid() && worldIn.getBlockState(blockpos1).getBlock() != Blocks.chest) + { + if (i4 == -1 && rand.nextInt(4) != 0) + { + worldIn.setBlockState(blockpos1, Blocks.mossy_cobblestone.getDefaultState(), 2); + } + else + { + worldIn.setBlockState(blockpos1, Blocks.cobblestone.getDefaultState(), 2); + } + } + } + } + } + + for (int l3 = 0; l3 < 2; ++l3) + { + for (int j4 = 0; j4 < 3; ++j4) + { + int l4 = position.getX() + rand.nextInt(j * 2 + 1) - j; + int i5 = position.getY(); + int j5 = position.getZ() + rand.nextInt(k1 * 2 + 1) - k1; + BlockPos blockpos2 = new BlockPos(l4, i5, j5); + + if (worldIn.isAirBlock(blockpos2)) + { + int j3 = 0; + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (worldIn.getBlockState(blockpos2.offset(enumfacing)).getBlock().getMaterial().isSolid()) + { + ++j3; + } + } + + if (j3 == 1) + { + worldIn.setBlockState(blockpos2, Blocks.chest.correctFacing(worldIn, blockpos2, Blocks.chest.getDefaultState()), 2); + List list = WeightedRandomChestContent.func_177629_a(CHESTCONTENT, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(rand)}); + TileEntity tileentity1 = worldIn.getTileEntity(blockpos2); + + if (tileentity1 instanceof TileEntityChest) + { + WeightedRandomChestContent.generateChestContents(rand, list, (TileEntityChest)tileentity1, 8); + } + + break; + } + } + } + } + + worldIn.setBlockState(position, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = worldIn.getTileEntity(position); + + if (tileentity instanceof TileEntityMobSpawner) + { + ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic().setEntityName(this.pickMobSpawner(rand)); + } + else + { + field_175918_a.error("Failed to fetch mob spawner entity at (" + position.getX() + ", " + position.getY() + ", " + position.getZ() + ")"); + } + + return true; + } + else + { + return false; + } + } + + private String pickMobSpawner(Random p_76543_1_) + { + return SPAWNERTYPES[p_76543_1_.nextInt(SPAWNERTYPES.length)]; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java new file mode 100644 index 0000000..0cb3c3d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java @@ -0,0 +1,24 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenFire extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 64; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos) && worldIn.getBlockState(blockpos.down()).getBlock() == Blocks.netherrack) + { + worldIn.setBlockState(blockpos, Blocks.fire.getDefaultState(), 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java new file mode 100644 index 0000000..bbe8e77 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java @@ -0,0 +1,39 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenFlowers extends WorldGenerator +{ + private BlockFlower flower; + private IBlockState field_175915_b; + + public WorldGenFlowers(BlockFlower p_i45632_1_, BlockFlower.EnumFlowerType p_i45632_2_) + { + this.setGeneratedBlock(p_i45632_1_, p_i45632_2_); + } + + public void setGeneratedBlock(BlockFlower p_175914_1_, BlockFlower.EnumFlowerType p_175914_2_) + { + this.flower = p_175914_1_; + this.field_175915_b = p_175914_1_.getDefaultState().withProperty(p_175914_1_.getTypeProperty(), p_175914_2_); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 64; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.getHasNoSky() || blockpos.getY() < 255) && this.flower.canBlockStay(worldIn, blockpos, this.field_175915_b)) + { + worldIn.setBlockState(blockpos, this.field_175915_b, 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java new file mode 100644 index 0000000..c89228a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java @@ -0,0 +1,136 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenForest extends WorldGenAbstractTree +{ + private static final IBlockState field_181629_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.BIRCH); + private static final IBlockState field_181630_b = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.BIRCH).withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false)); + private boolean useExtraRandomHeight; + + public WorldGenForest(boolean p_i45449_1_, boolean p_i45449_2_) + { + super(p_i45449_1_); + this.useExtraRandomHeight = p_i45449_2_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = rand.nextInt(3) + 5; + + if (this.useExtraRandomHeight) + { + i += rand.nextInt(7); + } + + boolean flag = true; + + if (position.getY() >= 1 && position.getY() + i + 1 <= 256) + { + for (int j = position.getY(); j <= position.getY() + 1 + i; ++j) + { + int k = 1; + + if (j == position.getY()) + { + k = 0; + } + + if (j >= position.getY() + 1 + i - 2) + { + k = 2; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l = position.getX() - k; l <= position.getX() + k && flag; ++l) + { + for (int i1 = position.getZ() - k; i1 <= position.getZ() + k && flag; ++i1) + { + if (j >= 0 && j < 256) + { + if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock())) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = worldIn.getBlockState(position.down()).getBlock(); + + if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) + { + this.func_175921_a(worldIn, position.down()); + + for (int i2 = position.getY() - 3 + i; i2 <= position.getY() + i; ++i2) + { + int k2 = i2 - (position.getY() + i); + int l2 = 1 - k2 / 2; + + for (int i3 = position.getX() - l2; i3 <= position.getX() + l2; ++i3) + { + int j1 = i3 - position.getX(); + + for (int k1 = position.getZ() - l2; k1 <= position.getZ() + l2; ++k1) + { + int l1 = k1 - position.getZ(); + + if (Math.abs(j1) != l2 || Math.abs(l1) != l2 || rand.nextInt(2) != 0 && k2 != 0) + { + BlockPos blockpos = new BlockPos(i3, i2, k1); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181630_b); + } + } + } + } + } + + for (int j2 = 0; j2 < i; ++j2) + { + Block block2 = worldIn.getBlockState(position.up(j2)).getBlock(); + + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(j2), field_181629_a); + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java new file mode 100644 index 0000000..27bc39e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java @@ -0,0 +1,57 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenGlowStone1 extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (!worldIn.isAirBlock(position)) + { + return false; + } + else if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack) + { + return false; + } + else + { + worldIn.setBlockState(position, Blocks.glowstone.getDefaultState(), 2); + + for (int i = 0; i < 1500; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), -rand.nextInt(12), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.air) + { + int j = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (worldIn.getBlockState(blockpos.offset(enumfacing)).getBlock() == Blocks.glowstone) + { + ++j; + } + + if (j > 1) + { + break; + } + } + + if (j == 1) + { + worldIn.setBlockState(blockpos, Blocks.glowstone.getDefaultState(), 2); + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java new file mode 100644 index 0000000..49d36b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java @@ -0,0 +1,57 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenGlowStone2 extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (!worldIn.isAirBlock(position)) + { + return false; + } + else if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack) + { + return false; + } + else + { + worldIn.setBlockState(position, Blocks.glowstone.getDefaultState(), 2); + + for (int i = 0; i < 1500; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), -rand.nextInt(12), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.air) + { + int j = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + if (worldIn.getBlockState(blockpos.offset(enumfacing)).getBlock() == Blocks.glowstone) + { + ++j; + } + + if (j > 1) + { + break; + } + } + + if (j == 1) + { + worldIn.setBlockState(blockpos, Blocks.glowstone.getDefaultState(), 2); + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java new file mode 100644 index 0000000..aa6698a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java @@ -0,0 +1,96 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenHellLava extends WorldGenerator +{ + private final Block field_150553_a; + private final boolean field_94524_b; + + public WorldGenHellLava(Block p_i45453_1_, boolean p_i45453_2_) + { + this.field_150553_a = p_i45453_1_; + this.field_94524_b = p_i45453_2_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack) + { + return false; + } + else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.netherrack) + { + return false; + } + else + { + int i = 0; + + if (worldIn.getBlockState(position.west()).getBlock() == Blocks.netherrack) + { + ++i; + } + + if (worldIn.getBlockState(position.east()).getBlock() == Blocks.netherrack) + { + ++i; + } + + if (worldIn.getBlockState(position.north()).getBlock() == Blocks.netherrack) + { + ++i; + } + + if (worldIn.getBlockState(position.south()).getBlock() == Blocks.netherrack) + { + ++i; + } + + if (worldIn.getBlockState(position.down()).getBlock() == Blocks.netherrack) + { + ++i; + } + + int j = 0; + + if (worldIn.isAirBlock(position.west())) + { + ++j; + } + + if (worldIn.isAirBlock(position.east())) + { + ++j; + } + + if (worldIn.isAirBlock(position.north())) + { + ++j; + } + + if (worldIn.isAirBlock(position.south())) + { + ++j; + } + + if (worldIn.isAirBlock(position.down())) + { + ++j; + } + + if (!this.field_94524_b && i == 4 && j == 1 || i == 5) + { + worldIn.setBlockState(position, this.field_150553_a.getDefaultState(), 2); + worldIn.forceBlockUpdateTick(this.field_150553_a, position, rand); + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java new file mode 100644 index 0000000..3f4ba9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java @@ -0,0 +1,148 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public abstract class WorldGenHugeTrees extends WorldGenAbstractTree +{ + protected final int baseHeight; + protected final IBlockState woodMetadata; + protected final IBlockState leavesMetadata; + protected int extraRandomHeight; + + public WorldGenHugeTrees(boolean p_i46447_1_, int p_i46447_2_, int p_i46447_3_, IBlockState p_i46447_4_, IBlockState p_i46447_5_) + { + super(p_i46447_1_); + this.baseHeight = p_i46447_2_; + this.extraRandomHeight = p_i46447_3_; + this.woodMetadata = p_i46447_4_; + this.leavesMetadata = p_i46447_5_; + } + + protected int func_150533_a(Random p_150533_1_) + { + int i = p_150533_1_.nextInt(3) + this.baseHeight; + + if (this.extraRandomHeight > 1) + { + i += p_150533_1_.nextInt(this.extraRandomHeight); + } + + return i; + } + + private boolean func_175926_c(World worldIn, BlockPos p_175926_2_, int p_175926_3_) + { + boolean flag = true; + + if (p_175926_2_.getY() >= 1 && p_175926_2_.getY() + p_175926_3_ + 1 <= 256) + { + for (int i = 0; i <= 1 + p_175926_3_; ++i) + { + int j = 2; + + if (i == 0) + { + j = 1; + } + else if (i >= 1 + p_175926_3_ - 2) + { + j = 2; + } + + for (int k = -j; k <= j && flag; ++k) + { + for (int l = -j; l <= j && flag; ++l) + { + if (p_175926_2_.getY() + i < 0 || p_175926_2_.getY() + i >= 256 || !this.func_150523_a(worldIn.getBlockState(p_175926_2_.add(k, i, l)).getBlock())) + { + flag = false; + } + } + } + } + + return flag; + } + else + { + return false; + } + } + + private boolean func_175927_a(BlockPos p_175927_1_, World worldIn) + { + BlockPos blockpos = p_175927_1_.down(); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if ((block == Blocks.grass || block == Blocks.dirt) && p_175927_1_.getY() >= 2) + { + this.func_175921_a(worldIn, blockpos); + this.func_175921_a(worldIn, blockpos.east()); + this.func_175921_a(worldIn, blockpos.south()); + this.func_175921_a(worldIn, blockpos.south().east()); + return true; + } + else + { + return false; + } + } + + protected boolean func_175929_a(World worldIn, Random p_175929_2_, BlockPos p_175929_3_, int p_175929_4_) + { + return this.func_175926_c(worldIn, p_175929_3_, p_175929_4_) && this.func_175927_a(p_175929_3_, worldIn); + } + + protected void func_175925_a(World worldIn, BlockPos p_175925_2_, int p_175925_3_) + { + int i = p_175925_3_ * p_175925_3_; + + for (int j = -p_175925_3_; j <= p_175925_3_ + 1; ++j) + { + for (int k = -p_175925_3_; k <= p_175925_3_ + 1; ++k) + { + int l = j - 1; + int i1 = k - 1; + + if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i) + { + BlockPos blockpos = p_175925_2_.add(j, 0, k); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + + if (material == Material.air || material == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } + } + } + } + } + + protected void func_175928_b(World worldIn, BlockPos p_175928_2_, int p_175928_3_) + { + int i = p_175928_3_ * p_175928_3_; + + for (int j = -p_175928_3_; j <= p_175928_3_; ++j) + { + for (int k = -p_175928_3_; k <= p_175928_3_; ++k) + { + if (j * j + k * k <= i) + { + BlockPos blockpos = p_175928_2_.add(j, 0, k); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + + if (material == Material.air || material == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java new file mode 100644 index 0000000..0cde8b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java @@ -0,0 +1,61 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenIcePath extends WorldGenerator +{ + private Block block = Blocks.packed_ice; + private int basePathWidth; + + public WorldGenIcePath(int p_i45454_1_) + { + this.basePathWidth = p_i45454_1_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + while (worldIn.isAirBlock(position) && position.getY() > 2) + { + position = position.down(); + } + + if (worldIn.getBlockState(position).getBlock() != Blocks.snow) + { + return false; + } + else + { + int i = rand.nextInt(this.basePathWidth - 2) + 2; + int j = 1; + + for (int k = position.getX() - i; k <= position.getX() + i; ++k) + { + for (int l = position.getZ() - i; l <= position.getZ() + i; ++l) + { + int i1 = k - position.getX(); + int j1 = l - position.getZ(); + + if (i1 * i1 + j1 * j1 <= i * i) + { + for (int k1 = position.getY() - j; k1 <= position.getY() + j; ++k1) + { + BlockPos blockpos = new BlockPos(k, k1, l); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice) + { + worldIn.setBlockState(blockpos, this.block.getDefaultState(), 2); + } + } + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java new file mode 100644 index 0000000..cf6cd88 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java @@ -0,0 +1,119 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenIceSpike extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + while (worldIn.isAirBlock(position) && position.getY() > 2) + { + position = position.down(); + } + + if (worldIn.getBlockState(position).getBlock() != Blocks.snow) + { + return false; + } + else + { + position = position.up(rand.nextInt(4)); + int i = rand.nextInt(4) + 7; + int j = i / 4 + rand.nextInt(2); + + if (j > 1 && rand.nextInt(60) == 0) + { + position = position.up(10 + rand.nextInt(30)); + } + + for (int k = 0; k < i; ++k) + { + float f = (1.0F - (float)k / (float)i) * (float)j; + int l = MathHelper.ceiling_float_int(f); + + for (int i1 = -l; i1 <= l; ++i1) + { + float f1 = (float)MathHelper.abs_int(i1) - 0.25F; + + for (int j1 = -l; j1 <= l; ++j1) + { + float f2 = (float)MathHelper.abs_int(j1) - 0.25F; + + if ((i1 == 0 && j1 == 0 || f1 * f1 + f2 * f2 <= f * f) && (i1 != -l && i1 != l && j1 != -l && j1 != l || rand.nextFloat() <= 0.75F)) + { + Block block = worldIn.getBlockState(position.add(i1, k, j1)).getBlock(); + + if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(i1, k, j1), Blocks.packed_ice.getDefaultState()); + } + + if (k != 0 && l > 1) + { + block = worldIn.getBlockState(position.add(i1, -k, j1)).getBlock(); + + if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(i1, -k, j1), Blocks.packed_ice.getDefaultState()); + } + } + } + } + } + } + + int k1 = j - 1; + + if (k1 < 0) + { + k1 = 0; + } + else if (k1 > 1) + { + k1 = 1; + } + + for (int l1 = -k1; l1 <= k1; ++l1) + { + for (int i2 = -k1; i2 <= k1; ++i2) + { + BlockPos blockpos = position.add(l1, -1, i2); + int j2 = 50; + + if (Math.abs(l1) == 1 && Math.abs(i2) == 1) + { + j2 = rand.nextInt(5); + } + + while (blockpos.getY() > 50) + { + Block block1 = worldIn.getBlockState(blockpos).getBlock(); + + if (block1.getMaterial() != Material.air && block1 != Blocks.dirt && block1 != Blocks.snow && block1 != Blocks.ice && block1 != Blocks.packed_ice) + { + break; + } + + this.setBlockAndNotifyAdequately(worldIn, blockpos, Blocks.packed_ice.getDefaultState()); + blockpos = blockpos.down(); + --j2; + + if (j2 <= 0) + { + blockpos = blockpos.down(rand.nextInt(5) + 1); + j2 = rand.nextInt(5); + } + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java new file mode 100644 index 0000000..54c1d3b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java @@ -0,0 +1,173 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class WorldGenLakes extends WorldGenerator +{ + private Block block; + + public WorldGenLakes(Block blockIn) + { + this.block = blockIn; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (position = position.add(-8, 0, -8); position.getY() > 5 && worldIn.isAirBlock(position); position = position.down()) + { + ; + } + + if (position.getY() <= 4) + { + return false; + } + else + { + position = position.down(4); + boolean[] aboolean = new boolean[2048]; + int i = rand.nextInt(4) + 4; + + for (int j = 0; j < i; ++j) + { + double d0 = rand.nextDouble() * 6.0D + 3.0D; + double d1 = rand.nextDouble() * 4.0D + 2.0D; + double d2 = rand.nextDouble() * 6.0D + 3.0D; + double d3 = rand.nextDouble() * (16.0D - d0 - 2.0D) + 1.0D + d0 / 2.0D; + double d4 = rand.nextDouble() * (8.0D - d1 - 4.0D) + 2.0D + d1 / 2.0D; + double d5 = rand.nextDouble() * (16.0D - d2 - 2.0D) + 1.0D + d2 / 2.0D; + + for (int l = 1; l < 15; ++l) + { + for (int i1 = 1; i1 < 15; ++i1) + { + for (int j1 = 1; j1 < 7; ++j1) + { + double d6 = ((double)l - d3) / (d0 / 2.0D); + double d7 = ((double)j1 - d4) / (d1 / 2.0D); + double d8 = ((double)i1 - d5) / (d2 / 2.0D); + double d9 = d6 * d6 + d7 * d7 + d8 * d8; + + if (d9 < 1.0D) + { + aboolean[(l * 16 + i1) * 8 + j1] = true; + } + } + } + } + } + + for (int k1 = 0; k1 < 16; ++k1) + { + for (int l2 = 0; l2 < 16; ++l2) + { + for (int k = 0; k < 8; ++k) + { + boolean flag = !aboolean[(k1 * 16 + l2) * 8 + k] && (k1 < 15 && aboolean[((k1 + 1) * 16 + l2) * 8 + k] || k1 > 0 && aboolean[((k1 - 1) * 16 + l2) * 8 + k] || l2 < 15 && aboolean[(k1 * 16 + l2 + 1) * 8 + k] || l2 > 0 && aboolean[(k1 * 16 + (l2 - 1)) * 8 + k] || k < 7 && aboolean[(k1 * 16 + l2) * 8 + k + 1] || k > 0 && aboolean[(k1 * 16 + l2) * 8 + (k - 1)]); + + if (flag) + { + Material material = worldIn.getBlockState(position.add(k1, k, l2)).getBlock().getMaterial(); + + if (k >= 4 && material.isLiquid()) + { + return false; + } + + if (k < 4 && !material.isSolid() && worldIn.getBlockState(position.add(k1, k, l2)).getBlock() != this.block) + { + return false; + } + } + } + } + } + + for (int l1 = 0; l1 < 16; ++l1) + { + for (int i3 = 0; i3 < 16; ++i3) + { + for (int i4 = 0; i4 < 8; ++i4) + { + if (aboolean[(l1 * 16 + i3) * 8 + i4]) + { + worldIn.setBlockState(position.add(l1, i4, i3), i4 >= 4 ? Blocks.air.getDefaultState() : this.block.getDefaultState(), 2); + } + } + } + } + + for (int i2 = 0; i2 < 16; ++i2) + { + for (int j3 = 0; j3 < 16; ++j3) + { + for (int j4 = 4; j4 < 8; ++j4) + { + if (aboolean[(i2 * 16 + j3) * 8 + j4]) + { + BlockPos blockpos = position.add(i2, j4 - 1, j3); + + if (worldIn.getBlockState(blockpos).getBlock() == Blocks.dirt && worldIn.getLightFor(EnumSkyBlock.SKY, position.add(i2, j4, j3)) > 0) + { + BiomeGenBase biomegenbase = worldIn.getBiomeGenForCoords(blockpos); + + if (biomegenbase.topBlock.getBlock() == Blocks.mycelium) + { + worldIn.setBlockState(blockpos, Blocks.mycelium.getDefaultState(), 2); + } + else + { + worldIn.setBlockState(blockpos, Blocks.grass.getDefaultState(), 2); + } + } + } + } + } + } + + if (this.block.getMaterial() == Material.lava) + { + for (int j2 = 0; j2 < 16; ++j2) + { + for (int k3 = 0; k3 < 16; ++k3) + { + for (int k4 = 0; k4 < 8; ++k4) + { + boolean flag1 = !aboolean[(j2 * 16 + k3) * 8 + k4] && (j2 < 15 && aboolean[((j2 + 1) * 16 + k3) * 8 + k4] || j2 > 0 && aboolean[((j2 - 1) * 16 + k3) * 8 + k4] || k3 < 15 && aboolean[(j2 * 16 + k3 + 1) * 8 + k4] || k3 > 0 && aboolean[(j2 * 16 + (k3 - 1)) * 8 + k4] || k4 < 7 && aboolean[(j2 * 16 + k3) * 8 + k4 + 1] || k4 > 0 && aboolean[(j2 * 16 + k3) * 8 + (k4 - 1)]); + + if (flag1 && (k4 < 4 || rand.nextInt(2) != 0) && worldIn.getBlockState(position.add(j2, k4, k3)).getBlock().getMaterial().isSolid()) + { + worldIn.setBlockState(position.add(j2, k4, k3), Blocks.stone.getDefaultState(), 2); + } + } + } + } + } + + if (this.block.getMaterial() == Material.water) + { + for (int k2 = 0; k2 < 16; ++k2) + { + for (int l3 = 0; l3 < 16; ++l3) + { + int l4 = 4; + + if (worldIn.canBlockFreezeWater(position.add(k2, l4, l3))) + { + worldIn.setBlockState(position.add(k2, l4, l3), Blocks.ice.getDefaultState(), 2); + } + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java new file mode 100644 index 0000000..4fa2be6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java @@ -0,0 +1,88 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenLiquids extends WorldGenerator +{ + private Block block; + + public WorldGenLiquids(Block p_i45465_1_) + { + this.block = p_i45465_1_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (worldIn.getBlockState(position.up()).getBlock() != Blocks.stone) + { + return false; + } + else if (worldIn.getBlockState(position.down()).getBlock() != Blocks.stone) + { + return false; + } + else if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.air && worldIn.getBlockState(position).getBlock() != Blocks.stone) + { + return false; + } + else + { + int i = 0; + + if (worldIn.getBlockState(position.west()).getBlock() == Blocks.stone) + { + ++i; + } + + if (worldIn.getBlockState(position.east()).getBlock() == Blocks.stone) + { + ++i; + } + + if (worldIn.getBlockState(position.north()).getBlock() == Blocks.stone) + { + ++i; + } + + if (worldIn.getBlockState(position.south()).getBlock() == Blocks.stone) + { + ++i; + } + + int j = 0; + + if (worldIn.isAirBlock(position.west())) + { + ++j; + } + + if (worldIn.isAirBlock(position.east())) + { + ++j; + } + + if (worldIn.isAirBlock(position.north())) + { + ++j; + } + + if (worldIn.isAirBlock(position.south())) + { + ++j; + } + + if (i == 3 && j == 1) + { + worldIn.setBlockState(position, this.block.getDefaultState(), 2); + worldIn.forceBlockUpdateTick(this.block, position, rand); + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java new file mode 100644 index 0000000..3c63bb8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -0,0 +1,133 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.BlockVine; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMegaJungle extends WorldGenHugeTrees +{ + public WorldGenMegaJungle(boolean p_i46448_1_, int p_i46448_2_, int p_i46448_3_, IBlockState p_i46448_4_, IBlockState p_i46448_5_) + { + super(p_i46448_1_, p_i46448_2_, p_i46448_3_, p_i46448_4_, p_i46448_5_); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = this.func_150533_a(rand); + + if (!this.func_175929_a(worldIn, rand, position, i)) + { + return false; + } + else + { + this.func_175930_c(worldIn, position.up(i), 2); + + for (int j = position.getY() + i - 2 - rand.nextInt(4); j > position.getY() + i / 2; j -= 2 + rand.nextInt(4)) + { + float f = rand.nextFloat() * (float)Math.PI * 2.0F; + int k = position.getX() + (int)(0.5F + MathHelper.cos(f) * 4.0F); + int l = position.getZ() + (int)(0.5F + MathHelper.sin(f) * 4.0F); + + for (int i1 = 0; i1 < 5; ++i1) + { + k = position.getX() + (int)(1.5F + MathHelper.cos(f) * (float)i1); + l = position.getZ() + (int)(1.5F + MathHelper.sin(f) * (float)i1); + this.setBlockAndNotifyAdequately(worldIn, new BlockPos(k, j - 3 + i1 / 2, l), this.woodMetadata); + } + + int j2 = 1 + rand.nextInt(2); + int j1 = j; + + for (int k1 = j - j2; k1 <= j1; ++k1) + { + int l1 = k1 - j1; + this.func_175928_b(worldIn, new BlockPos(k, k1, l), 1 - l1); + } + } + + for (int i2 = 0; i2 < i; ++i2) + { + BlockPos blockpos = position.up(i2); + + if (this.func_150523_a(worldIn.getBlockState(blockpos).getBlock())) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.woodMetadata); + + if (i2 > 0) + { + this.func_181632_a(worldIn, rand, blockpos.west(), BlockVine.EAST); + this.func_181632_a(worldIn, rand, blockpos.north(), BlockVine.SOUTH); + } + } + + if (i2 < i - 1) + { + BlockPos blockpos1 = blockpos.east(); + + if (this.func_150523_a(worldIn.getBlockState(blockpos1).getBlock())) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos1, this.woodMetadata); + + if (i2 > 0) + { + this.func_181632_a(worldIn, rand, blockpos1.east(), BlockVine.WEST); + this.func_181632_a(worldIn, rand, blockpos1.north(), BlockVine.SOUTH); + } + } + + BlockPos blockpos2 = blockpos.south().east(); + + if (this.func_150523_a(worldIn.getBlockState(blockpos2).getBlock())) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos2, this.woodMetadata); + + if (i2 > 0) + { + this.func_181632_a(worldIn, rand, blockpos2.east(), BlockVine.WEST); + this.func_181632_a(worldIn, rand, blockpos2.south(), BlockVine.NORTH); + } + } + + BlockPos blockpos3 = blockpos.south(); + + if (this.func_150523_a(worldIn.getBlockState(blockpos3).getBlock())) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos3, this.woodMetadata); + + if (i2 > 0) + { + this.func_181632_a(worldIn, rand, blockpos3.west(), BlockVine.EAST); + this.func_181632_a(worldIn, rand, blockpos3.south(), BlockVine.NORTH); + } + } + } + } + + return true; + } + } + + private void func_181632_a(World p_181632_1_, Random p_181632_2_, BlockPos p_181632_3_, PropertyBool p_181632_4_) + { + if (p_181632_2_.nextInt(3) > 0 && p_181632_1_.isAirBlock(p_181632_3_)) + { + this.setBlockAndNotifyAdequately(p_181632_1_, p_181632_3_, Blocks.vine.getDefaultState().withProperty(p_181632_4_, Boolean.valueOf(true))); + } + } + + private void func_175930_c(World worldIn, BlockPos p_175930_2_, int p_175930_3_) + { + int i = 2; + + for (int j = -i; j <= 0; ++j) + { + this.func_175925_a(worldIn, p_175930_2_.up(j), p_175930_3_ + 1 - j); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java new file mode 100644 index 0000000..cf88708 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java @@ -0,0 +1,147 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMegaPineTree extends WorldGenHugeTrees +{ + private static final IBlockState field_181633_e = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE); + private static final IBlockState field_181634_f = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + private static final IBlockState field_181635_g = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL); + private boolean useBaseHeight; + + public WorldGenMegaPineTree(boolean p_i45457_1_, boolean p_i45457_2_) + { + super(p_i45457_1_, 13, 15, field_181633_e, field_181634_f); + this.useBaseHeight = p_i45457_2_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = this.func_150533_a(rand); + + if (!this.func_175929_a(worldIn, rand, position, i)) + { + return false; + } + else + { + this.func_150541_c(worldIn, position.getX(), position.getZ(), position.getY() + i, 0, rand); + + for (int j = 0; j < i; ++j) + { + Block block = worldIn.getBlockState(position.up(j)).getBlock(); + + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(j), this.woodMetadata); + } + + if (j < i - 1) + { + block = worldIn.getBlockState(position.add(1, j, 0)).getBlock(); + + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 0), this.woodMetadata); + } + + block = worldIn.getBlockState(position.add(1, j, 1)).getBlock(); + + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 1), this.woodMetadata); + } + + block = worldIn.getBlockState(position.add(0, j, 1)).getBlock(); + + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(0, j, 1), this.woodMetadata); + } + } + } + + return true; + } + } + + private void func_150541_c(World worldIn, int p_150541_2_, int p_150541_3_, int p_150541_4_, int p_150541_5_, Random p_150541_6_) + { + int i = p_150541_6_.nextInt(5) + (this.useBaseHeight ? this.baseHeight : 3); + int j = 0; + + for (int k = p_150541_4_ - i; k <= p_150541_4_; ++k) + { + int l = p_150541_4_ - k; + int i1 = p_150541_5_ + MathHelper.floor_float((float)l / (float)i * 3.5F); + this.func_175925_a(worldIn, new BlockPos(p_150541_2_, k, p_150541_3_), i1 + (l > 0 && i1 == j && (k & 1) == 0 ? 1 : 0)); + j = i1; + } + } + + public void func_180711_a(World worldIn, Random p_180711_2_, BlockPos p_180711_3_) + { + this.func_175933_b(worldIn, p_180711_3_.west().north()); + this.func_175933_b(worldIn, p_180711_3_.east(2).north()); + this.func_175933_b(worldIn, p_180711_3_.west().south(2)); + this.func_175933_b(worldIn, p_180711_3_.east(2).south(2)); + + for (int i = 0; i < 5; ++i) + { + int j = p_180711_2_.nextInt(64); + int k = j % 8; + int l = j / 8; + + if (k == 0 || k == 7 || l == 0 || l == 7) + { + this.func_175933_b(worldIn, p_180711_3_.add(-3 + k, 0, -3 + l)); + } + } + } + + private void func_175933_b(World worldIn, BlockPos p_175933_2_) + { + for (int i = -2; i <= 2; ++i) + { + for (int j = -2; j <= 2; ++j) + { + if (Math.abs(i) != 2 || Math.abs(j) != 2) + { + this.func_175934_c(worldIn, p_175933_2_.add(i, 0, j)); + } + } + } + } + + private void func_175934_c(World worldIn, BlockPos p_175934_2_) + { + for (int i = 2; i >= -3; --i) + { + BlockPos blockpos = p_175934_2_.up(i); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block == Blocks.grass || block == Blocks.dirt) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181635_g); + break; + } + + if (block.getMaterial() != Material.air && i < 0) + { + break; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java new file mode 100644 index 0000000..9b46a55 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java @@ -0,0 +1,24 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenMelon extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 64; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (Blocks.melon_block.canPlaceBlockAt(worldIn, blockpos) && worldIn.getBlockState(blockpos.down()).getBlock() == Blocks.grass) + { + worldIn.setBlockState(blockpos, Blocks.melon_block.getDefaultState(), 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java new file mode 100644 index 0000000..7e751c4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java @@ -0,0 +1,90 @@ +package net.minecraft.world.gen.feature; + +import com.google.common.base.Predicate; +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockHelper; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMinable extends WorldGenerator +{ + private final IBlockState oreBlock; + private final int numberOfBlocks; + private final Predicate predicate; + + public WorldGenMinable(IBlockState state, int blockCount) + { + this(state, blockCount, BlockHelper.forBlock(Blocks.stone)); + } + + public WorldGenMinable(IBlockState state, int blockCount, Predicate p_i45631_3_) + { + this.oreBlock = state; + this.numberOfBlocks = blockCount; + this.predicate = p_i45631_3_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + float f = rand.nextFloat() * (float)Math.PI; + double d0 = (double)((float)(position.getX() + 8) + MathHelper.sin(f) * (float)this.numberOfBlocks / 8.0F); + double d1 = (double)((float)(position.getX() + 8) - MathHelper.sin(f) * (float)this.numberOfBlocks / 8.0F); + double d2 = (double)((float)(position.getZ() + 8) + MathHelper.cos(f) * (float)this.numberOfBlocks / 8.0F); + double d3 = (double)((float)(position.getZ() + 8) - MathHelper.cos(f) * (float)this.numberOfBlocks / 8.0F); + double d4 = (double)(position.getY() + rand.nextInt(3) - 2); + double d5 = (double)(position.getY() + rand.nextInt(3) - 2); + + for (int i = 0; i < this.numberOfBlocks; ++i) + { + float f1 = (float)i / (float)this.numberOfBlocks; + double d6 = d0 + (d1 - d0) * (double)f1; + double d7 = d4 + (d5 - d4) * (double)f1; + double d8 = d2 + (d3 - d2) * (double)f1; + double d9 = rand.nextDouble() * (double)this.numberOfBlocks / 16.0D; + double d10 = (double)(MathHelper.sin((float)Math.PI * f1) + 1.0F) * d9 + 1.0D; + double d11 = (double)(MathHelper.sin((float)Math.PI * f1) + 1.0F) * d9 + 1.0D; + int j = MathHelper.floor_double(d6 - d10 / 2.0D); + int k = MathHelper.floor_double(d7 - d11 / 2.0D); + int l = MathHelper.floor_double(d8 - d10 / 2.0D); + int i1 = MathHelper.floor_double(d6 + d10 / 2.0D); + int j1 = MathHelper.floor_double(d7 + d11 / 2.0D); + int k1 = MathHelper.floor_double(d8 + d10 / 2.0D); + + for (int l1 = j; l1 <= i1; ++l1) + { + double d12 = ((double)l1 + 0.5D - d6) / (d10 / 2.0D); + + if (d12 * d12 < 1.0D) + { + for (int i2 = k; i2 <= j1; ++i2) + { + double d13 = ((double)i2 + 0.5D - d7) / (d11 / 2.0D); + + if (d12 * d12 + d13 * d13 < 1.0D) + { + for (int j2 = l; j2 <= k1; ++j2) + { + double d14 = ((double)j2 + 0.5D - d8) / (d10 / 2.0D); + + if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D) + { + BlockPos blockpos = new BlockPos(l1, i2, j2); + + if (this.predicate.apply(worldIn.getBlockState(blockpos))) + { + worldIn.setBlockState(blockpos, this.oreBlock, 2); + } + } + } + } + } + } + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java new file mode 100644 index 0000000..e6602a4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java @@ -0,0 +1,26 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.BlockPumpkin; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenPumpkin extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 64; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos) && worldIn.getBlockState(blockpos.down()).getBlock() == Blocks.grass && Blocks.pumpkin.canPlaceBlockAt(worldIn, blockpos)) + { + worldIn.setBlockState(blockpos, Blocks.pumpkin.getDefaultState().withProperty(BlockPumpkin.FACING, EnumFacing.Plane.HORIZONTAL.random(rand)), 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java new file mode 100644 index 0000000..fb05db5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java @@ -0,0 +1,38 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenReed extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 20; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(4) - rand.nextInt(4), 0, rand.nextInt(4) - rand.nextInt(4)); + + if (worldIn.isAirBlock(blockpos)) + { + BlockPos blockpos1 = blockpos.down(); + + if (worldIn.getBlockState(blockpos1.west()).getBlock().getMaterial() == Material.water || worldIn.getBlockState(blockpos1.east()).getBlock().getMaterial() == Material.water || worldIn.getBlockState(blockpos1.north()).getBlock().getMaterial() == Material.water || worldIn.getBlockState(blockpos1.south()).getBlock().getMaterial() == Material.water) + { + int j = 2 + rand.nextInt(rand.nextInt(3) + 1); + + for (int k = 0; k < j; ++k) + { + if (Blocks.reeds.canBlockStay(worldIn, blockpos)) + { + worldIn.setBlockState(blockpos.up(k), Blocks.reeds.getDefaultState(), 2); + } + } + } + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java new file mode 100644 index 0000000..c832df3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java @@ -0,0 +1,58 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenSand extends WorldGenerator +{ + private Block block; + private int radius; + + public WorldGenSand(Block p_i45462_1_, int p_i45462_2_) + { + this.block = p_i45462_1_; + this.radius = p_i45462_2_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (worldIn.getBlockState(position).getBlock().getMaterial() != Material.water) + { + return false; + } + else + { + int i = rand.nextInt(this.radius - 2) + 2; + int j = 2; + + for (int k = position.getX() - i; k <= position.getX() + i; ++k) + { + for (int l = position.getZ() - i; l <= position.getZ() + i; ++l) + { + int i1 = k - position.getX(); + int j1 = l - position.getZ(); + + if (i1 * i1 + j1 * j1 <= i * i) + { + for (int k1 = position.getY() - j; k1 <= position.getY() + j; ++k1) + { + BlockPos blockpos = new BlockPos(k, k1, l); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block == Blocks.dirt || block == Blocks.grass) + { + worldIn.setBlockState(blockpos, this.block.getDefaultState(), 2); + } + } + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java new file mode 100644 index 0000000..46cfa30 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java @@ -0,0 +1,219 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockNewLeaf; +import net.minecraft.block.BlockNewLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenSavannaTree extends WorldGenAbstractTree +{ + private static final IBlockState field_181643_a = Blocks.log2.getDefaultState().withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.ACACIA); + private static final IBlockState field_181644_b = Blocks.leaves2.getDefaultState().withProperty(BlockNewLeaf.VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenSavannaTree(boolean p_i45463_1_) + { + super(p_i45463_1_); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = rand.nextInt(3) + rand.nextInt(3) + 5; + boolean flag = true; + + if (position.getY() >= 1 && position.getY() + i + 1 <= 256) + { + for (int j = position.getY(); j <= position.getY() + 1 + i; ++j) + { + int k = 1; + + if (j == position.getY()) + { + k = 0; + } + + if (j >= position.getY() + 1 + i - 2) + { + k = 2; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l = position.getX() - k; l <= position.getX() + k && flag; ++l) + { + for (int i1 = position.getZ() - k; i1 <= position.getZ() + k && flag; ++i1) + { + if (j >= 0 && j < 256) + { + if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock())) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block = worldIn.getBlockState(position.down()).getBlock(); + + if ((block == Blocks.grass || block == Blocks.dirt) && position.getY() < 256 - i - 1) + { + this.func_175921_a(worldIn, position.down()); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(rand); + int k2 = i - rand.nextInt(4) - 1; + int l2 = 3 - rand.nextInt(3); + int i3 = position.getX(); + int j1 = position.getZ(); + int k1 = 0; + + for (int l1 = 0; l1 < i; ++l1) + { + int i2 = position.getY() + l1; + + if (l1 >= k2 && l2 > 0) + { + i3 += enumfacing.getFrontOffsetX(); + j1 += enumfacing.getFrontOffsetZ(); + --l2; + } + + BlockPos blockpos = new BlockPos(i3, i2, j1); + Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); + + if (material == Material.air || material == Material.leaves) + { + this.func_181642_b(worldIn, blockpos); + k1 = i2; + } + } + + BlockPos blockpos2 = new BlockPos(i3, k1, j1); + + for (int j3 = -3; j3 <= 3; ++j3) + { + for (int i4 = -3; i4 <= 3; ++i4) + { + if (Math.abs(j3) != 3 || Math.abs(i4) != 3) + { + this.func_175924_b(worldIn, blockpos2.add(j3, 0, i4)); + } + } + } + + blockpos2 = blockpos2.up(); + + for (int k3 = -1; k3 <= 1; ++k3) + { + for (int j4 = -1; j4 <= 1; ++j4) + { + this.func_175924_b(worldIn, blockpos2.add(k3, 0, j4)); + } + } + + this.func_175924_b(worldIn, blockpos2.east(2)); + this.func_175924_b(worldIn, blockpos2.west(2)); + this.func_175924_b(worldIn, blockpos2.south(2)); + this.func_175924_b(worldIn, blockpos2.north(2)); + i3 = position.getX(); + j1 = position.getZ(); + EnumFacing enumfacing1 = EnumFacing.Plane.HORIZONTAL.random(rand); + + if (enumfacing1 != enumfacing) + { + int l3 = k2 - rand.nextInt(2) - 1; + int k4 = 1 + rand.nextInt(3); + k1 = 0; + + for (int l4 = l3; l4 < i && k4 > 0; --k4) + { + if (l4 >= 1) + { + int j2 = position.getY() + l4; + i3 += enumfacing1.getFrontOffsetX(); + j1 += enumfacing1.getFrontOffsetZ(); + BlockPos blockpos1 = new BlockPos(i3, j2, j1); + Material material1 = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); + + if (material1 == Material.air || material1 == Material.leaves) + { + this.func_181642_b(worldIn, blockpos1); + k1 = j2; + } + } + + ++l4; + } + + if (k1 > 0) + { + BlockPos blockpos3 = new BlockPos(i3, k1, j1); + + for (int i5 = -2; i5 <= 2; ++i5) + { + for (int k5 = -2; k5 <= 2; ++k5) + { + if (Math.abs(i5) != 2 || Math.abs(k5) != 2) + { + this.func_175924_b(worldIn, blockpos3.add(i5, 0, k5)); + } + } + } + + blockpos3 = blockpos3.up(); + + for (int j5 = -1; j5 <= 1; ++j5) + { + for (int l5 = -1; l5 <= 1; ++l5) + { + this.func_175924_b(worldIn, blockpos3.add(j5, 0, l5)); + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + private void func_181642_b(World p_181642_1_, BlockPos p_181642_2_) + { + this.setBlockAndNotifyAdequately(p_181642_1_, p_181642_2_, field_181643_a); + } + + private void func_175924_b(World worldIn, BlockPos p_175924_2_) + { + Material material = worldIn.getBlockState(p_175924_2_).getBlock().getMaterial(); + + if (material == Material.air || material == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, p_175924_2_, field_181644_b); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java new file mode 100644 index 0000000..d7c1272 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java @@ -0,0 +1,68 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenShrub extends WorldGenTrees +{ + private final IBlockState leavesMetadata; + private final IBlockState woodMetadata; + + public WorldGenShrub(IBlockState p_i46450_1_, IBlockState p_i46450_2_) + { + super(false); + this.woodMetadata = p_i46450_1_; + this.leavesMetadata = p_i46450_2_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + Block block; + + while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) + { + position = position.down(); + } + + Block block1 = worldIn.getBlockState(position).getBlock(); + + if (block1 == Blocks.dirt || block1 == Blocks.grass) + { + position = position.up(); + this.setBlockAndNotifyAdequately(worldIn, position, this.woodMetadata); + + for (int i = position.getY(); i <= position.getY() + 2; ++i) + { + int j = i - position.getY(); + int k = 2 - j; + + for (int l = position.getX() - k; l <= position.getX() + k; ++l) + { + int i1 = l - position.getX(); + + for (int j1 = position.getZ() - k; j1 <= position.getZ() + k; ++j1) + { + int k1 = j1 - position.getZ(); + + if (Math.abs(i1) != k || Math.abs(k1) != k || rand.nextInt(2) != 0) + { + BlockPos blockpos = new BlockPos(l, i, j1); + + if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } + } + } + } + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java new file mode 100644 index 0000000..4fd7bb7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java @@ -0,0 +1,70 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenSpikes extends WorldGenerator +{ + private Block baseBlockRequired; + + public WorldGenSpikes(Block p_i45464_1_) + { + this.baseBlockRequired = p_i45464_1_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + if (worldIn.isAirBlock(position) && worldIn.getBlockState(position.down()).getBlock() == this.baseBlockRequired) + { + int i = rand.nextInt(32) + 6; + int j = rand.nextInt(4) + 1; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = position.getX() - j; k <= position.getX() + j; ++k) + { + for (int l = position.getZ() - j; l <= position.getZ() + j; ++l) + { + int i1 = k - position.getX(); + int j1 = l - position.getZ(); + + if (i1 * i1 + j1 * j1 <= j * j + 1 && worldIn.getBlockState(blockpos$mutableblockpos.set(k, position.getY() - 1, l)).getBlock() != this.baseBlockRequired) + { + return false; + } + } + } + + for (int l1 = position.getY(); l1 < position.getY() + i && l1 < 256; ++l1) + { + for (int i2 = position.getX() - j; i2 <= position.getX() + j; ++i2) + { + for (int j2 = position.getZ() - j; j2 <= position.getZ() + j; ++j2) + { + int k2 = i2 - position.getX(); + int k1 = j2 - position.getZ(); + + if (k2 * k2 + k1 * k1 <= j * j + 1) + { + worldIn.setBlockState(new BlockPos(i2, l1, j2), Blocks.obsidian.getDefaultState(), 2); + } + } + } + } + + Entity entity = new EntityEnderCrystal(worldIn); + entity.setLocationAndAngles((double)((float)position.getX() + 0.5F), (double)(position.getY() + i), (double)((float)position.getZ() + 0.5F), rand.nextFloat() * 360.0F, 0.0F); + worldIn.spawnEntityInWorld(entity); + worldIn.setBlockState(position.up(i), Blocks.bedrock.getDefaultState(), 2); + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java new file mode 100644 index 0000000..f0faaae --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java @@ -0,0 +1,200 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockVine; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenSwamp extends WorldGenAbstractTree +{ + private static final IBlockState field_181648_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.OAK); + private static final IBlockState field_181649_b = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK).withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenSwamp() + { + super(false); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i; + + for (i = rand.nextInt(4) + 5; worldIn.getBlockState(position.down()).getBlock().getMaterial() == Material.water; position = position.down()) + { + ; + } + + boolean flag = true; + + if (position.getY() >= 1 && position.getY() + i + 1 <= 256) + { + for (int j = position.getY(); j <= position.getY() + 1 + i; ++j) + { + int k = 1; + + if (j == position.getY()) + { + k = 0; + } + + if (j >= position.getY() + 1 + i - 2) + { + k = 3; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l = position.getX() - k; l <= position.getX() + k && flag; ++l) + { + for (int i1 = position.getZ() - k; i1 <= position.getZ() + k && flag; ++i1) + { + if (j >= 0 && j < 256) + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock(); + + if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) + { + if (block != Blocks.water && block != Blocks.flowing_water) + { + flag = false; + } + else if (j > position.getY()) + { + flag = false; + } + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = worldIn.getBlockState(position.down()).getBlock(); + + if ((block1 == Blocks.grass || block1 == Blocks.dirt) && position.getY() < 256 - i - 1) + { + this.func_175921_a(worldIn, position.down()); + + for (int l1 = position.getY() - 3 + i; l1 <= position.getY() + i; ++l1) + { + int k2 = l1 - (position.getY() + i); + int i3 = 2 - k2 / 2; + + for (int k3 = position.getX() - i3; k3 <= position.getX() + i3; ++k3) + { + int l3 = k3 - position.getX(); + + for (int j1 = position.getZ() - i3; j1 <= position.getZ() + i3; ++j1) + { + int k1 = j1 - position.getZ(); + + if (Math.abs(l3) != i3 || Math.abs(k1) != i3 || rand.nextInt(2) != 0 && k2 != 0) + { + BlockPos blockpos = new BlockPos(k3, l1, j1); + + if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181649_b); + } + } + } + } + } + + for (int i2 = 0; i2 < i; ++i2) + { + Block block2 = worldIn.getBlockState(position.up(i2)).getBlock(); + + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(i2), field_181648_a); + } + } + + for (int j2 = position.getY() - 3 + i; j2 <= position.getY() + i; ++j2) + { + int l2 = j2 - (position.getY() + i); + int j3 = 2 - l2 / 2; + BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos(); + + for (int i4 = position.getX() - j3; i4 <= position.getX() + j3; ++i4) + { + for (int j4 = position.getZ() - j3; j4 <= position.getZ() + j3; ++j4) + { + blockpos$mutableblockpos1.set(i4, j2, j4); + + if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) + { + BlockPos blockpos3 = blockpos$mutableblockpos1.west(); + BlockPos blockpos4 = blockpos$mutableblockpos1.east(); + BlockPos blockpos1 = blockpos$mutableblockpos1.north(); + BlockPos blockpos2 = blockpos$mutableblockpos1.south(); + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) + { + this.func_181647_a(worldIn, blockpos3, BlockVine.EAST); + } + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) + { + this.func_181647_a(worldIn, blockpos4, BlockVine.WEST); + } + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) + { + this.func_181647_a(worldIn, blockpos1, BlockVine.SOUTH); + } + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) + { + this.func_181647_a(worldIn, blockpos2, BlockVine.NORTH); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + private void func_181647_a(World p_181647_1_, BlockPos p_181647_2_, PropertyBool p_181647_3_) + { + IBlockState iblockstate = Blocks.vine.getDefaultState().withProperty(p_181647_3_, Boolean.valueOf(true)); + this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate); + int i = 4; + + for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().getMaterial() == Material.air && i > 0; --i) + { + this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate); + p_181647_2_ = p_181647_2_.down(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java new file mode 100644 index 0000000..c31c97c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java @@ -0,0 +1,137 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenTaiga1 extends WorldGenAbstractTree +{ + private static final IBlockState field_181636_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE); + private static final IBlockState field_181637_b = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenTaiga1() + { + super(false); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = rand.nextInt(5) + 7; + int j = i - rand.nextInt(2) - 3; + int k = i - j; + int l = 1 + rand.nextInt(k + 1); + boolean flag = true; + + if (position.getY() >= 1 && position.getY() + i + 1 <= 256) + { + for (int i1 = position.getY(); i1 <= position.getY() + 1 + i && flag; ++i1) + { + int j1 = 1; + + if (i1 - position.getY() < j) + { + j1 = 0; + } + else + { + j1 = l; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = position.getX() - j1; k1 <= position.getX() + j1 && flag; ++k1) + { + for (int l1 = position.getZ() - j1; l1 <= position.getZ() + j1 && flag; ++l1) + { + if (i1 >= 0 && i1 < 256) + { + if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.set(k1, i1, l1)).getBlock())) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block = worldIn.getBlockState(position.down()).getBlock(); + + if ((block == Blocks.grass || block == Blocks.dirt) && position.getY() < 256 - i - 1) + { + this.func_175921_a(worldIn, position.down()); + int k2 = 0; + + for (int l2 = position.getY() + i; l2 >= position.getY() + j; --l2) + { + for (int j3 = position.getX() - k2; j3 <= position.getX() + k2; ++j3) + { + int k3 = j3 - position.getX(); + + for (int i2 = position.getZ() - k2; i2 <= position.getZ() + k2; ++i2) + { + int j2 = i2 - position.getZ(); + + if (Math.abs(k3) != k2 || Math.abs(j2) != k2 || k2 <= 0) + { + BlockPos blockpos = new BlockPos(j3, l2, i2); + + if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181637_b); + } + } + } + } + + if (k2 >= 1 && l2 == position.getY() + j + 1) + { + --k2; + } + else if (k2 < l) + { + ++k2; + } + } + + for (int i3 = 0; i3 < i - 1; ++i3) + { + Block block1 = worldIn.getBlockState(position.up(i3)).getBlock(); + + if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(i3), field_181636_a); + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java new file mode 100644 index 0000000..7bbeec1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java @@ -0,0 +1,152 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenTaiga2 extends WorldGenAbstractTree +{ + private static final IBlockState field_181645_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE); + private static final IBlockState field_181646_b = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + + public WorldGenTaiga2(boolean p_i2025_1_) + { + super(p_i2025_1_); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = rand.nextInt(4) + 6; + int j = 1 + rand.nextInt(2); + int k = i - j; + int l = 2 + rand.nextInt(2); + boolean flag = true; + + if (position.getY() >= 1 && position.getY() + i + 1 <= 256) + { + for (int i1 = position.getY(); i1 <= position.getY() + 1 + i && flag; ++i1) + { + int j1 = 1; + + if (i1 - position.getY() < j) + { + j1 = 0; + } + else + { + j1 = l; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = position.getX() - j1; k1 <= position.getX() + j1 && flag; ++k1) + { + for (int l1 = position.getZ() - j1; l1 <= position.getZ() + j1 && flag; ++l1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(k1, i1, l1)).getBlock(); + + if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = worldIn.getBlockState(position.down()).getBlock(); + + if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) + { + this.func_175921_a(worldIn, position.down()); + int i3 = rand.nextInt(2); + int j3 = 1; + int k3 = 0; + + for (int l3 = 0; l3 <= k; ++l3) + { + int j4 = position.getY() + i - l3; + + for (int i2 = position.getX() - i3; i2 <= position.getX() + i3; ++i2) + { + int j2 = i2 - position.getX(); + + for (int k2 = position.getZ() - i3; k2 <= position.getZ() + i3; ++k2) + { + int l2 = k2 - position.getZ(); + + if (Math.abs(j2) != i3 || Math.abs(l2) != i3 || i3 <= 0) + { + BlockPos blockpos = new BlockPos(i2, j4, k2); + + if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181646_b); + } + } + } + } + + if (i3 >= j3) + { + i3 = k3; + k3 = 1; + ++j3; + + if (j3 > l) + { + j3 = l; + } + } + else + { + ++i3; + } + } + + int i4 = rand.nextInt(3); + + for (int k4 = 0; k4 < i - i4; ++k4) + { + Block block2 = worldIn.getBlockState(position.up(k4)).getBlock(); + + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(k4), field_181645_a); + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java new file mode 100644 index 0000000..e1872ec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java @@ -0,0 +1,42 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenTallGrass extends WorldGenerator +{ + private final IBlockState tallGrassState; + + public WorldGenTallGrass(BlockTallGrass.EnumType p_i45629_1_) + { + this.tallGrassState = Blocks.tallgrass.getDefaultState().withProperty(BlockTallGrass.TYPE, p_i45629_1_); + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + Block block; + + while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) + { + position = position.down(); + } + + for (int i = 0; i < 128; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8)); + + if (worldIn.isAirBlock(blockpos) && Blocks.tallgrass.canBlockStay(worldIn, blockpos, this.tallGrassState)) + { + worldIn.setBlockState(blockpos, this.tallGrassState, 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java new file mode 100644 index 0000000..8bbaf4e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java @@ -0,0 +1,254 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockCocoa; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockVine; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenTrees extends WorldGenAbstractTree +{ + private static final IBlockState field_181653_a = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.OAK); + private static final IBlockState field_181654_b = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); + private final int minTreeHeight; + private final boolean vinesGrow; + private final IBlockState metaWood; + private final IBlockState metaLeaves; + + public WorldGenTrees(boolean p_i2027_1_) + { + this(p_i2027_1_, 4, field_181653_a, field_181654_b, false); + } + + public WorldGenTrees(boolean p_i46446_1_, int p_i46446_2_, IBlockState p_i46446_3_, IBlockState p_i46446_4_, boolean p_i46446_5_) + { + super(p_i46446_1_); + this.minTreeHeight = p_i46446_2_; + this.metaWood = p_i46446_3_; + this.metaLeaves = p_i46446_4_; + this.vinesGrow = p_i46446_5_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int i = rand.nextInt(3) + this.minTreeHeight; + boolean flag = true; + + if (position.getY() >= 1 && position.getY() + i + 1 <= 256) + { + for (int j = position.getY(); j <= position.getY() + 1 + i; ++j) + { + int k = 1; + + if (j == position.getY()) + { + k = 0; + } + + if (j >= position.getY() + 1 + i - 2) + { + k = 2; + } + + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int l = position.getX() - k; l <= position.getX() + k && flag; ++l) + { + for (int i1 = position.getZ() - k; i1 <= position.getZ() + k && flag; ++i1) + { + if (j >= 0 && j < 256) + { + if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock())) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = worldIn.getBlockState(position.down()).getBlock(); + + if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) + { + this.func_175921_a(worldIn, position.down()); + int k2 = 3; + int l2 = 0; + + for (int i3 = position.getY() - k2 + i; i3 <= position.getY() + i; ++i3) + { + int i4 = i3 - (position.getY() + i); + int j1 = l2 + 1 - i4 / 2; + + for (int k1 = position.getX() - j1; k1 <= position.getX() + j1; ++k1) + { + int l1 = k1 - position.getX(); + + for (int i2 = position.getZ() - j1; i2 <= position.getZ() + j1; ++i2) + { + int j2 = i2 - position.getZ(); + + if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || rand.nextInt(2) != 0 && i4 != 0) + { + BlockPos blockpos = new BlockPos(k1, i3, i2); + Block block = worldIn.getBlockState(blockpos).getBlock(); + + if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves); + } + } + } + } + } + + for (int j3 = 0; j3 < i; ++j3) + { + Block block2 = worldIn.getBlockState(position.up(j3)).getBlock(); + + if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2.getMaterial() == Material.vine) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood); + + if (this.vinesGrow && j3 > 0) + { + if (rand.nextInt(3) > 0 && worldIn.isAirBlock(position.add(-1, j3, 0))) + { + this.func_181651_a(worldIn, position.add(-1, j3, 0), BlockVine.EAST); + } + + if (rand.nextInt(3) > 0 && worldIn.isAirBlock(position.add(1, j3, 0))) + { + this.func_181651_a(worldIn, position.add(1, j3, 0), BlockVine.WEST); + } + + if (rand.nextInt(3) > 0 && worldIn.isAirBlock(position.add(0, j3, -1))) + { + this.func_181651_a(worldIn, position.add(0, j3, -1), BlockVine.SOUTH); + } + + if (rand.nextInt(3) > 0 && worldIn.isAirBlock(position.add(0, j3, 1))) + { + this.func_181651_a(worldIn, position.add(0, j3, 1), BlockVine.NORTH); + } + } + } + } + + if (this.vinesGrow) + { + for (int k3 = position.getY() - 3 + i; k3 <= position.getY() + i; ++k3) + { + int j4 = k3 - (position.getY() + i); + int k4 = 2 - j4 / 2; + BlockPos.MutableBlockPos blockpos$mutableblockpos1 = new BlockPos.MutableBlockPos(); + + for (int l4 = position.getX() - k4; l4 <= position.getX() + k4; ++l4) + { + for (int i5 = position.getZ() - k4; i5 <= position.getZ() + k4; ++i5) + { + blockpos$mutableblockpos1.set(l4, k3, i5); + + if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) + { + BlockPos blockpos2 = blockpos$mutableblockpos1.west(); + BlockPos blockpos3 = blockpos$mutableblockpos1.east(); + BlockPos blockpos4 = blockpos$mutableblockpos1.north(); + BlockPos blockpos1 = blockpos$mutableblockpos1.south(); + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) + { + this.func_181650_b(worldIn, blockpos2, BlockVine.EAST); + } + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) + { + this.func_181650_b(worldIn, blockpos3, BlockVine.WEST); + } + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) + { + this.func_181650_b(worldIn, blockpos4, BlockVine.SOUTH); + } + + if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) + { + this.func_181650_b(worldIn, blockpos1, BlockVine.NORTH); + } + } + } + } + } + + if (rand.nextInt(5) == 0 && i > 5) + { + for (int l3 = 0; l3 < 2; ++l3) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (rand.nextInt(4 - l3) == 0) + { + EnumFacing enumfacing1 = enumfacing.getOpposite(); + this.func_181652_a(worldIn, rand.nextInt(3), position.add(enumfacing1.getFrontOffsetX(), i - 5 + l3, enumfacing1.getFrontOffsetZ()), enumfacing); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + private void func_181652_a(World p_181652_1_, int p_181652_2_, BlockPos p_181652_3_, EnumFacing p_181652_4_) + { + this.setBlockAndNotifyAdequately(p_181652_1_, p_181652_3_, Blocks.cocoa.getDefaultState().withProperty(BlockCocoa.AGE, Integer.valueOf(p_181652_2_)).withProperty(BlockCocoa.FACING, p_181652_4_)); + } + + private void func_181651_a(World p_181651_1_, BlockPos p_181651_2_, PropertyBool p_181651_3_) + { + this.setBlockAndNotifyAdequately(p_181651_1_, p_181651_2_, Blocks.vine.getDefaultState().withProperty(p_181651_3_, Boolean.valueOf(true))); + } + + private void func_181650_b(World p_181650_1_, BlockPos p_181650_2_, PropertyBool p_181650_3_) + { + this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); + int i = 4; + + for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().getMaterial() == Material.air && i > 0; --i) + { + this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); + p_181650_2_ = p_181650_2_.down(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java new file mode 100644 index 0000000..f8aa294 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java @@ -0,0 +1,37 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.BlockVine; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class WorldGenVines extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (; position.getY() < 128; position = position.up()) + { + if (worldIn.isAirBlock(position)) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL.facings()) + { + if (Blocks.vine.canPlaceBlockOnSide(worldIn, position, enumfacing)) + { + IBlockState iblockstate = Blocks.vine.getDefaultState().withProperty(BlockVine.NORTH, Boolean.valueOf(enumfacing == EnumFacing.NORTH)).withProperty(BlockVine.EAST, Boolean.valueOf(enumfacing == EnumFacing.EAST)).withProperty(BlockVine.SOUTH, Boolean.valueOf(enumfacing == EnumFacing.SOUTH)).withProperty(BlockVine.WEST, Boolean.valueOf(enumfacing == EnumFacing.WEST)); + worldIn.setBlockState(position, iblockstate, 2); + break; + } + } + } + else + { + position = position.add(rand.nextInt(4) - rand.nextInt(4), 0, rand.nextInt(4) - rand.nextInt(4)); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java new file mode 100644 index 0000000..b0a43ee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java @@ -0,0 +1,26 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public class WorldGenWaterlily extends WorldGenerator +{ + public boolean generate(World worldIn, Random rand, BlockPos position) + { + for (int i = 0; i < 10; ++i) + { + int j = position.getX() + rand.nextInt(8) - rand.nextInt(8); + int k = position.getY() + rand.nextInt(4) - rand.nextInt(4); + int l = position.getZ() + rand.nextInt(8) - rand.nextInt(8); + + if (worldIn.isAirBlock(new BlockPos(j, k, l)) && Blocks.waterlily.canPlaceBlockAt(worldIn, new BlockPos(j, k, l))) + { + worldIn.setBlockState(new BlockPos(j, k, l), Blocks.waterlily.getDefaultState(), 2); + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java new file mode 100644 index 0000000..ec9b14e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java @@ -0,0 +1,39 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; + +public abstract class WorldGenerator +{ + private final boolean doBlockNotify; + + public WorldGenerator() + { + this(false); + } + + public WorldGenerator(boolean notify) + { + this.doBlockNotify = notify; + } + + public abstract boolean generate(World worldIn, Random rand, BlockPos position); + + public void func_175904_e() + { + } + + protected void setBlockAndNotifyAdequately(World worldIn, BlockPos pos, IBlockState state) + { + if (this.doBlockNotify) + { + worldIn.setBlockState(pos, state, 3); + } + else + { + worldIn.setBlockState(pos, state, 2); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java new file mode 100644 index 0000000..b5c4d5e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java @@ -0,0 +1,88 @@ +package net.minecraft.world.gen.feature; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockPos; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class WorldGeneratorBonusChest extends WorldGenerator +{ + private final List chestItems; + private final int itemsToGenerateInBonusChest; + + public WorldGeneratorBonusChest(List p_i45634_1_, int p_i45634_2_) + { + this.chestItems = p_i45634_1_; + this.itemsToGenerateInBonusChest = p_i45634_2_; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) + { + Block block; + + while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 1) + { + position = position.down(); + } + + if (position.getY() < 1) + { + return false; + } + else + { + position = position.up(); + + for (int i = 0; i < 4; ++i) + { + BlockPos blockpos = position.add(rand.nextInt(4) - rand.nextInt(4), rand.nextInt(3) - rand.nextInt(3), rand.nextInt(4) - rand.nextInt(4)); + + if (worldIn.isAirBlock(blockpos) && World.doesBlockHaveSolidTopSurface(worldIn, blockpos.down())) + { + worldIn.setBlockState(blockpos, Blocks.chest.getDefaultState(), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityChest) + { + WeightedRandomChestContent.generateChestContents(rand, this.chestItems, (TileEntityChest)tileentity, this.itemsToGenerateInBonusChest); + } + + BlockPos blockpos1 = blockpos.east(); + BlockPos blockpos2 = blockpos.west(); + BlockPos blockpos3 = blockpos.north(); + BlockPos blockpos4 = blockpos.south(); + + if (worldIn.isAirBlock(blockpos2) && World.doesBlockHaveSolidTopSurface(worldIn, blockpos2.down())) + { + worldIn.setBlockState(blockpos2, Blocks.torch.getDefaultState(), 2); + } + + if (worldIn.isAirBlock(blockpos1) && World.doesBlockHaveSolidTopSurface(worldIn, blockpos1.down())) + { + worldIn.setBlockState(blockpos1, Blocks.torch.getDefaultState(), 2); + } + + if (worldIn.isAirBlock(blockpos3) && World.doesBlockHaveSolidTopSurface(worldIn, blockpos3.down())) + { + worldIn.setBlockState(blockpos3, Blocks.torch.getDefaultState(), 2); + } + + if (worldIn.isAirBlock(blockpos4) && World.doesBlockHaveSolidTopSurface(worldIn, blockpos4.down())) + { + worldIn.setBlockState(blockpos4, Blocks.torch.getDefaultState(), 2); + } + + return true; + } + } + + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayer.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayer.java new file mode 100644 index 0000000..a2d9ce4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayer.java @@ -0,0 +1,206 @@ +package net.minecraft.world.gen.layer; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.ChunkProviderSettings; + +public abstract class GenLayer +{ + private long worldGenSeed; + protected GenLayer parent; + private long chunkSeed; + protected long baseSeed; + + public static GenLayer[] initializeAllBiomeGenerators(long seed, WorldType p_180781_2_, String p_180781_3_) + { + GenLayer genlayer = new GenLayerIsland(1L); + genlayer = new GenLayerFuzzyZoom(2000L, genlayer); + GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayer); + GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland); + GenLayerAddIsland genlayeraddisland1 = new GenLayerAddIsland(2L, genlayerzoom); + genlayeraddisland1 = new GenLayerAddIsland(50L, genlayeraddisland1); + genlayeraddisland1 = new GenLayerAddIsland(70L, genlayeraddisland1); + GenLayerRemoveTooMuchOcean genlayerremovetoomuchocean = new GenLayerRemoveTooMuchOcean(2L, genlayeraddisland1); + GenLayerAddSnow genlayeraddsnow = new GenLayerAddSnow(2L, genlayerremovetoomuchocean); + GenLayerAddIsland genlayeraddisland2 = new GenLayerAddIsland(3L, genlayeraddsnow); + GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland2, GenLayerEdge.Mode.COOL_WARM); + genlayeredge = new GenLayerEdge(2L, genlayeredge, GenLayerEdge.Mode.HEAT_ICE); + genlayeredge = new GenLayerEdge(3L, genlayeredge, GenLayerEdge.Mode.SPECIAL); + GenLayerZoom genlayerzoom1 = new GenLayerZoom(2002L, genlayeredge); + genlayerzoom1 = new GenLayerZoom(2003L, genlayerzoom1); + GenLayerAddIsland genlayeraddisland3 = new GenLayerAddIsland(4L, genlayerzoom1); + GenLayerAddMushroomIsland genlayeraddmushroomisland = new GenLayerAddMushroomIsland(5L, genlayeraddisland3); + GenLayerDeepOcean genlayerdeepocean = new GenLayerDeepOcean(4L, genlayeraddmushroomisland); + GenLayer genlayer4 = GenLayerZoom.magnify(1000L, genlayerdeepocean, 0); + ChunkProviderSettings chunkprovidersettings = null; + int i = 4; + int j = i; + + if (p_180781_2_ == WorldType.CUSTOMIZED && p_180781_3_.length() > 0) + { + chunkprovidersettings = ChunkProviderSettings.Factory.jsonToFactory(p_180781_3_).func_177864_b(); + i = chunkprovidersettings.biomeSize; + j = chunkprovidersettings.riverSize; + } + + if (p_180781_2_ == WorldType.LARGE_BIOMES) + { + i = 6; + } + + GenLayer lvt_8_1_ = GenLayerZoom.magnify(1000L, genlayer4, 0); + GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, lvt_8_1_); + GenLayerBiome lvt_9_1_ = new GenLayerBiome(200L, genlayer4, p_180781_2_, p_180781_3_); + GenLayer genlayer6 = GenLayerZoom.magnify(1000L, lvt_9_1_, 2); + GenLayerBiomeEdge genlayerbiomeedge = new GenLayerBiomeEdge(1000L, genlayer6); + GenLayer lvt_10_1_ = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + GenLayer genlayerhills = new GenLayerHills(1000L, genlayerbiomeedge, lvt_10_1_); + GenLayer genlayer5 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + genlayer5 = GenLayerZoom.magnify(1000L, genlayer5, j); + GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer5); + GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver); + genlayerhills = new GenLayerRareBiome(1001L, genlayerhills); + + for (int k = 0; k < i; ++k) + { + genlayerhills = new GenLayerZoom((long)(1000 + k), genlayerhills); + + if (k == 0) + { + genlayerhills = new GenLayerAddIsland(3L, genlayerhills); + } + + if (k == 1 || i == 1) + { + genlayerhills = new GenLayerShore(1000L, genlayerhills); + } + } + + GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, genlayerhills); + GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth); + GenLayer genlayer3 = new GenLayerVoronoiZoom(10L, genlayerrivermix); + genlayerrivermix.initWorldGenSeed(seed); + genlayer3.initWorldGenSeed(seed); + return new GenLayer[] {genlayerrivermix, genlayer3, genlayerrivermix}; + } + + public GenLayer(long p_i2125_1_) + { + this.baseSeed = p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + } + + public void initWorldGenSeed(long seed) + { + this.worldGenSeed = seed; + + if (this.parent != null) + { + this.parent.initWorldGenSeed(seed); + } + + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + } + + public void initChunkSeed(long p_75903_1_, long p_75903_3_) + { + this.chunkSeed = this.worldGenSeed; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_1_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_3_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_1_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_3_; + } + + protected int nextInt(int p_75902_1_) + { + int i = (int)((this.chunkSeed >> 24) % (long)p_75902_1_); + + if (i < 0) + { + i += p_75902_1_; + } + + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += this.worldGenSeed; + return i; + } + + public abstract int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight); + + protected static boolean biomesEqualOrMesaPlateau(int biomeIDA, int biomeIDB) + { + if (biomeIDA == biomeIDB) + { + return true; + } + else if (biomeIDA != BiomeGenBase.mesaPlateau_F.biomeID && biomeIDA != BiomeGenBase.mesaPlateau.biomeID) + { + final BiomeGenBase biomegenbase = BiomeGenBase.getBiome(biomeIDA); + final BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(biomeIDB); + + try + { + return biomegenbase != null && biomegenbase1 != null ? biomegenbase.isEqualTo(biomegenbase1) : false; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Comparing biomes"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Biomes being compared"); + crashreportcategory.addCrashSection("Biome A ID", Integer.valueOf(biomeIDA)); + crashreportcategory.addCrashSection("Biome B ID", Integer.valueOf(biomeIDB)); + crashreportcategory.addCrashSectionCallable("Biome A", new Callable() + { + public String call() throws Exception + { + return String.valueOf((Object)biomegenbase); + } + }); + crashreportcategory.addCrashSectionCallable("Biome B", new Callable() + { + public String call() throws Exception + { + return String.valueOf((Object)biomegenbase1); + } + }); + throw new ReportedException(crashreport); + } + } + else + { + return biomeIDB == BiomeGenBase.mesaPlateau_F.biomeID || biomeIDB == BiomeGenBase.mesaPlateau.biomeID; + } + } + + protected static boolean isBiomeOceanic(int p_151618_0_) + { + return p_151618_0_ == BiomeGenBase.ocean.biomeID || p_151618_0_ == BiomeGenBase.deepOcean.biomeID || p_151618_0_ == BiomeGenBase.frozenOcean.biomeID; + } + + protected int selectRandom(int... p_151619_1_) + { + return p_151619_1_[this.nextInt(p_151619_1_.length)]; + } + + protected int selectModeOrRandom(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) + { + return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java new file mode 100644 index 0000000..d4897b2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java @@ -0,0 +1,99 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerAddIsland extends GenLayer +{ + public GenLayerAddIsland(long p_i2119_1_, GenLayer p_i2119_3_) + { + super(p_i2119_1_); + this.parent = p_i2119_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + int k1 = aint[j1 + 0 + (i1 + 0) * k]; + int l1 = aint[j1 + 2 + (i1 + 0) * k]; + int i2 = aint[j1 + 0 + (i1 + 2) * k]; + int j2 = aint[j1 + 2 + (i1 + 2) * k]; + int k2 = aint[j1 + 1 + (i1 + 1) * k]; + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + + if (k2 != 0 || k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0) + { + if (k2 > 0 && (k1 == 0 || l1 == 0 || i2 == 0 || j2 == 0)) + { + if (this.nextInt(5) == 0) + { + if (k2 == 4) + { + aint1[j1 + i1 * areaWidth] = 4; + } + else + { + aint1[j1 + i1 * areaWidth] = 0; + } + } + else + { + aint1[j1 + i1 * areaWidth] = k2; + } + } + else + { + aint1[j1 + i1 * areaWidth] = k2; + } + } + else + { + int l2 = 1; + int i3 = 1; + + if (k1 != 0 && this.nextInt(l2++) == 0) + { + i3 = k1; + } + + if (l1 != 0 && this.nextInt(l2++) == 0) + { + i3 = l1; + } + + if (i2 != 0 && this.nextInt(l2++) == 0) + { + i3 = i2; + } + + if (j2 != 0 && this.nextInt(l2++) == 0) + { + i3 = j2; + } + + if (this.nextInt(3) == 0) + { + aint1[j1 + i1 * areaWidth] = i3; + } + else if (i3 == 4) + { + aint1[j1 + i1 * areaWidth] = 4; + } + else + { + aint1[j1 + i1 * areaWidth] = 0; + } + } + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java new file mode 100644 index 0000000..da4cc2d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java @@ -0,0 +1,46 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerAddMushroomIsland extends GenLayer +{ + public GenLayerAddMushroomIsland(long p_i2120_1_, GenLayer p_i2120_3_) + { + super(p_i2120_1_); + this.parent = p_i2120_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + int k1 = aint[j1 + 0 + (i1 + 0) * k]; + int l1 = aint[j1 + 2 + (i1 + 0) * k]; + int i2 = aint[j1 + 0 + (i1 + 2) * k]; + int j2 = aint[j1 + 2 + (i1 + 2) * k]; + int k2 = aint[j1 + 1 + (i1 + 1) * k]; + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + + if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && this.nextInt(100) == 0) + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.mushroomIsland.biomeID; + } + else + { + aint1[j1 + i1 * areaWidth] = k2; + } + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java new file mode 100644 index 0000000..8e2ea49 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java @@ -0,0 +1,55 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerAddSnow extends GenLayer +{ + public GenLayerAddSnow(long p_i2121_1_, GenLayer p_i2121_3_) + { + super(p_i2121_1_); + this.parent = p_i2121_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + int k1 = aint[j1 + 1 + (i1 + 1) * k]; + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + + if (k1 == 0) + { + aint1[j1 + i1 * areaWidth] = 0; + } + else + { + int l1 = this.nextInt(6); + + if (l1 == 0) + { + l1 = 4; + } + else if (l1 <= 1) + { + l1 = 3; + } + else + { + l1 = 1; + } + + aint1[j1 + i1 * areaWidth] = l1; + } + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java new file mode 100644 index 0000000..9d404fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java @@ -0,0 +1,114 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.ChunkProviderSettings; + +public class GenLayerBiome extends GenLayer +{ + private BiomeGenBase[] field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.savanna, BiomeGenBase.savanna, BiomeGenBase.plains}; + private BiomeGenBase[] field_151621_d = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.roofedForest, BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.birchForest, BiomeGenBase.swampland}; + private BiomeGenBase[] field_151622_e = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.taiga, BiomeGenBase.plains}; + private BiomeGenBase[] field_151620_f = new BiomeGenBase[] {BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.coldTaiga}; + private final ChunkProviderSettings field_175973_g; + + public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_) + { + super(p_i45560_1_); + this.parent = p_i45560_3_; + + if (p_i45560_4_ == WorldType.DEFAULT_1_1) + { + this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; + this.field_175973_g = null; + } + else if (p_i45560_4_ == WorldType.CUSTOMIZED) + { + this.field_175973_g = ChunkProviderSettings.Factory.jsonToFactory(p_i45560_5_).func_177864_b(); + } + else + { + this.field_175973_g = null; + } + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaHeight; ++i) + { + for (int j = 0; j < areaWidth; ++j) + { + this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); + int k = aint[j + i * areaWidth]; + int l = (k & 3840) >> 8; + k = k & -3841; + + if (this.field_175973_g != null && this.field_175973_g.fixedBiome >= 0) + { + aint1[j + i * areaWidth] = this.field_175973_g.fixedBiome; + } + else if (isBiomeOceanic(k)) + { + aint1[j + i * areaWidth] = k; + } + else if (k == BiomeGenBase.mushroomIsland.biomeID) + { + aint1[j + i * areaWidth] = k; + } + else if (k == 1) + { + if (l > 0) + { + if (this.nextInt(3) == 0) + { + aint1[j + i * areaWidth] = BiomeGenBase.mesaPlateau.biomeID; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.mesaPlateau_F.biomeID; + } + } + else + { + aint1[j + i * areaWidth] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID; + } + } + else if (k == 2) + { + if (l > 0) + { + aint1[j + i * areaWidth] = BiomeGenBase.jungle.biomeID; + } + else + { + aint1[j + i * areaWidth] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID; + } + } + else if (k == 3) + { + if (l > 0) + { + aint1[j + i * areaWidth] = BiomeGenBase.megaTaiga.biomeID; + } + else + { + aint1[j + i * areaWidth] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID; + } + } + else if (k == 4) + { + aint1[j + i * areaWidth] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.mushroomIsland.biomeID; + } + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java new file mode 100644 index 0000000..c584a79 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java @@ -0,0 +1,152 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerBiomeEdge extends GenLayer +{ + public GenLayerBiomeEdge(long p_i45475_1_, GenLayer p_i45475_3_) + { + super(p_i45475_1_); + this.parent = p_i45475_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaHeight; ++i) + { + for (int j = 0; j < areaWidth; ++j) + { + this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); + int k = aint[j + 1 + (i + 1) * (areaWidth + 2)]; + + if (!this.replaceBiomeEdgeIfNecessary(aint, aint1, j, i, areaWidth, k, BiomeGenBase.extremeHills.biomeID, BiomeGenBase.extremeHillsEdge.biomeID) && !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, BiomeGenBase.mesaPlateau_F.biomeID, BiomeGenBase.mesa.biomeID) && !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, BiomeGenBase.mesaPlateau.biomeID, BiomeGenBase.mesa.biomeID) && !this.replaceBiomeEdge(aint, aint1, j, i, areaWidth, k, BiomeGenBase.megaTaiga.biomeID, BiomeGenBase.taiga.biomeID)) + { + if (k == BiomeGenBase.desert.biomeID) + { + int l1 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; + int i2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; + int j2 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; + int k2 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; + + if (l1 != BiomeGenBase.icePlains.biomeID && i2 != BiomeGenBase.icePlains.biomeID && j2 != BiomeGenBase.icePlains.biomeID && k2 != BiomeGenBase.icePlains.biomeID) + { + aint1[j + i * areaWidth] = k; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.extremeHillsPlus.biomeID; + } + } + else if (k == BiomeGenBase.swampland.biomeID) + { + int l = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; + int i1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; + int j1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; + int k1 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; + + if (l != BiomeGenBase.desert.biomeID && i1 != BiomeGenBase.desert.biomeID && j1 != BiomeGenBase.desert.biomeID && k1 != BiomeGenBase.desert.biomeID && l != BiomeGenBase.coldTaiga.biomeID && i1 != BiomeGenBase.coldTaiga.biomeID && j1 != BiomeGenBase.coldTaiga.biomeID && k1 != BiomeGenBase.coldTaiga.biomeID && l != BiomeGenBase.icePlains.biomeID && i1 != BiomeGenBase.icePlains.biomeID && j1 != BiomeGenBase.icePlains.biomeID && k1 != BiomeGenBase.icePlains.biomeID) + { + if (l != BiomeGenBase.jungle.biomeID && k1 != BiomeGenBase.jungle.biomeID && i1 != BiomeGenBase.jungle.biomeID && j1 != BiomeGenBase.jungle.biomeID) + { + aint1[j + i * areaWidth] = k; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.jungleEdge.biomeID; + } + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.plains.biomeID; + } + } + else + { + aint1[j + i * areaWidth] = k; + } + } + } + } + + return aint1; + } + + private boolean replaceBiomeEdgeIfNecessary(int[] p_151636_1_, int[] p_151636_2_, int p_151636_3_, int p_151636_4_, int p_151636_5_, int p_151636_6_, int p_151636_7_, int p_151636_8_) + { + if (!biomesEqualOrMesaPlateau(p_151636_6_, p_151636_7_)) + { + return false; + } + else + { + int i = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 - 1) * (p_151636_5_ + 2)]; + int j = p_151636_1_[p_151636_3_ + 1 + 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; + int k = p_151636_1_[p_151636_3_ + 1 - 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; + int l = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 + 1) * (p_151636_5_ + 2)]; + + if (this.canBiomesBeNeighbors(i, p_151636_7_) && this.canBiomesBeNeighbors(j, p_151636_7_) && this.canBiomesBeNeighbors(k, p_151636_7_) && this.canBiomesBeNeighbors(l, p_151636_7_)) + { + p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_6_; + } + else + { + p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_8_; + } + + return true; + } + } + + private boolean replaceBiomeEdge(int[] p_151635_1_, int[] p_151635_2_, int p_151635_3_, int p_151635_4_, int p_151635_5_, int p_151635_6_, int p_151635_7_, int p_151635_8_) + { + if (p_151635_6_ != p_151635_7_) + { + return false; + } + else + { + int i = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 - 1) * (p_151635_5_ + 2)]; + int j = p_151635_1_[p_151635_3_ + 1 + 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; + int k = p_151635_1_[p_151635_3_ + 1 - 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; + int l = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 + 1) * (p_151635_5_ + 2)]; + + if (biomesEqualOrMesaPlateau(i, p_151635_7_) && biomesEqualOrMesaPlateau(j, p_151635_7_) && biomesEqualOrMesaPlateau(k, p_151635_7_) && biomesEqualOrMesaPlateau(l, p_151635_7_)) + { + p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_6_; + } + else + { + p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_8_; + } + + return true; + } + } + + private boolean canBiomesBeNeighbors(int p_151634_1_, int p_151634_2_) + { + if (biomesEqualOrMesaPlateau(p_151634_1_, p_151634_2_)) + { + return true; + } + else + { + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(p_151634_1_); + BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(p_151634_2_); + + if (biomegenbase != null && biomegenbase1 != null) + { + BiomeGenBase.TempCategory biomegenbase$tempcategory = biomegenbase.getTempCategory(); + BiomeGenBase.TempCategory biomegenbase$tempcategory1 = biomegenbase1.getTempCategory(); + return biomegenbase$tempcategory == biomegenbase$tempcategory1 || biomegenbase$tempcategory == BiomeGenBase.TempCategory.MEDIUM || biomegenbase$tempcategory1 == BiomeGenBase.TempCategory.MEDIUM; + } + else + { + return false; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java new file mode 100644 index 0000000..f6136ca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java @@ -0,0 +1,66 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerDeepOcean extends GenLayer +{ + public GenLayerDeepOcean(long p_i45472_1_, GenLayer p_i45472_3_) + { + super(p_i45472_1_); + this.parent = p_i45472_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + int k1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + int l1 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + int i2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + int j2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + int k2 = aint[j1 + 1 + (i1 + 1) * k]; + int l2 = 0; + + if (k1 == 0) + { + ++l2; + } + + if (l1 == 0) + { + ++l2; + } + + if (i2 == 0) + { + ++l2; + } + + if (j2 == 0) + { + ++l2; + } + + if (k2 == 0 && l2 > 3) + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.deepOcean.biomeID; + } + else + { + aint1[j1 + i1 * areaWidth] = k2; + } + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java new file mode 100644 index 0000000..f49c157 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java @@ -0,0 +1,135 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerEdge extends GenLayer +{ + private final GenLayerEdge.Mode field_151627_c; + + public GenLayerEdge(long p_i45474_1_, GenLayer p_i45474_3_, GenLayerEdge.Mode p_i45474_4_) + { + super(p_i45474_1_); + this.parent = p_i45474_3_; + this.field_151627_c = p_i45474_4_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + switch (this.field_151627_c) + { + case COOL_WARM: + default: + return this.getIntsCoolWarm(areaX, areaY, areaWidth, areaHeight); + + case HEAT_ICE: + return this.getIntsHeatIce(areaX, areaY, areaWidth, areaHeight); + + case SPECIAL: + return this.getIntsSpecial(areaX, areaY, areaWidth, areaHeight); + } + } + + private int[] getIntsCoolWarm(int p_151626_1_, int p_151626_2_, int p_151626_3_, int p_151626_4_) + { + int i = p_151626_1_ - 1; + int j = p_151626_2_ - 1; + int k = 1 + p_151626_3_ + 1; + int l = 1 + p_151626_4_ + 1; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(p_151626_3_ * p_151626_4_); + + for (int i1 = 0; i1 < p_151626_4_; ++i1) + { + for (int j1 = 0; j1 < p_151626_3_; ++j1) + { + this.initChunkSeed((long)(j1 + p_151626_1_), (long)(i1 + p_151626_2_)); + int k1 = aint[j1 + 1 + (i1 + 1) * k]; + + if (k1 == 1) + { + int l1 = aint[j1 + 1 + (i1 + 1 - 1) * k]; + int i2 = aint[j1 + 1 + 1 + (i1 + 1) * k]; + int j2 = aint[j1 + 1 - 1 + (i1 + 1) * k]; + int k2 = aint[j1 + 1 + (i1 + 1 + 1) * k]; + boolean flag = l1 == 3 || i2 == 3 || j2 == 3 || k2 == 3; + boolean flag1 = l1 == 4 || i2 == 4 || j2 == 4 || k2 == 4; + + if (flag || flag1) + { + k1 = 2; + } + } + + aint1[j1 + i1 * p_151626_3_] = k1; + } + } + + return aint1; + } + + private int[] getIntsHeatIce(int p_151624_1_, int p_151624_2_, int p_151624_3_, int p_151624_4_) + { + int i = p_151624_1_ - 1; + int j = p_151624_2_ - 1; + int k = 1 + p_151624_3_ + 1; + int l = 1 + p_151624_4_ + 1; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(p_151624_3_ * p_151624_4_); + + for (int i1 = 0; i1 < p_151624_4_; ++i1) + { + for (int j1 = 0; j1 < p_151624_3_; ++j1) + { + int k1 = aint[j1 + 1 + (i1 + 1) * k]; + + if (k1 == 4) + { + int l1 = aint[j1 + 1 + (i1 + 1 - 1) * k]; + int i2 = aint[j1 + 1 + 1 + (i1 + 1) * k]; + int j2 = aint[j1 + 1 - 1 + (i1 + 1) * k]; + int k2 = aint[j1 + 1 + (i1 + 1 + 1) * k]; + boolean flag = l1 == 2 || i2 == 2 || j2 == 2 || k2 == 2; + boolean flag1 = l1 == 1 || i2 == 1 || j2 == 1 || k2 == 1; + + if (flag1 || flag) + { + k1 = 3; + } + } + + aint1[j1 + i1 * p_151624_3_] = k1; + } + } + + return aint1; + } + + private int[] getIntsSpecial(int p_151625_1_, int p_151625_2_, int p_151625_3_, int p_151625_4_) + { + int[] aint = this.parent.getInts(p_151625_1_, p_151625_2_, p_151625_3_, p_151625_4_); + int[] aint1 = IntCache.getIntCache(p_151625_3_ * p_151625_4_); + + for (int i = 0; i < p_151625_4_; ++i) + { + for (int j = 0; j < p_151625_3_; ++j) + { + this.initChunkSeed((long)(j + p_151625_1_), (long)(i + p_151625_2_)); + int k = aint[j + i * p_151625_3_]; + + if (k != 0 && this.nextInt(13) == 0) + { + k |= 1 + this.nextInt(15) << 8 & 3840; + } + + aint1[j + i * p_151625_3_] = k; + } + } + + return aint1; + } + + public static enum Mode + { + COOL_WARM, + HEAT_ICE, + SPECIAL; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java new file mode 100644 index 0000000..bf3de45 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java @@ -0,0 +1,14 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerFuzzyZoom extends GenLayerZoom +{ + public GenLayerFuzzyZoom(long p_i2123_1_, GenLayer p_i2123_3_) + { + super(p_i2123_1_, p_i2123_3_); + } + + protected int selectModeOrRandom(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) + { + return this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java new file mode 100644 index 0000000..7e714ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java @@ -0,0 +1,194 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GenLayerHills extends GenLayer +{ + private static final Logger logger = LogManager.getLogger(); + private GenLayer field_151628_d; + + public GenLayerHills(long p_i45479_1_, GenLayer p_i45479_3_, GenLayer p_i45479_4_) + { + super(p_i45479_1_); + this.parent = p_i45479_3_; + this.field_151628_d = p_i45479_4_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = this.field_151628_d.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaHeight; ++i) + { + for (int j = 0; j < areaWidth; ++j) + { + this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); + int k = aint[j + 1 + (i + 1) * (areaWidth + 2)]; + int l = aint1[j + 1 + (i + 1) * (areaWidth + 2)]; + boolean flag = (l - 2) % 29 == 0; + + if (k > 255) + { + logger.debug("old! " + k); + } + + if (k != 0 && l >= 2 && (l - 2) % 29 == 1 && k < 128) + { + if (BiomeGenBase.getBiome(k + 128) != null) + { + aint2[j + i * areaWidth] = k + 128; + } + else + { + aint2[j + i * areaWidth] = k; + } + } + else if (this.nextInt(3) != 0 && !flag) + { + aint2[j + i * areaWidth] = k; + } + else + { + int i1 = k; + + if (k == BiomeGenBase.desert.biomeID) + { + i1 = BiomeGenBase.desertHills.biomeID; + } + else if (k == BiomeGenBase.forest.biomeID) + { + i1 = BiomeGenBase.forestHills.biomeID; + } + else if (k == BiomeGenBase.birchForest.biomeID) + { + i1 = BiomeGenBase.birchForestHills.biomeID; + } + else if (k == BiomeGenBase.roofedForest.biomeID) + { + i1 = BiomeGenBase.plains.biomeID; + } + else if (k == BiomeGenBase.taiga.biomeID) + { + i1 = BiomeGenBase.taigaHills.biomeID; + } + else if (k == BiomeGenBase.megaTaiga.biomeID) + { + i1 = BiomeGenBase.megaTaigaHills.biomeID; + } + else if (k == BiomeGenBase.coldTaiga.biomeID) + { + i1 = BiomeGenBase.coldTaigaHills.biomeID; + } + else if (k == BiomeGenBase.plains.biomeID) + { + if (this.nextInt(3) == 0) + { + i1 = BiomeGenBase.forestHills.biomeID; + } + else + { + i1 = BiomeGenBase.forest.biomeID; + } + } + else if (k == BiomeGenBase.icePlains.biomeID) + { + i1 = BiomeGenBase.iceMountains.biomeID; + } + else if (k == BiomeGenBase.jungle.biomeID) + { + i1 = BiomeGenBase.jungleHills.biomeID; + } + else if (k == BiomeGenBase.ocean.biomeID) + { + i1 = BiomeGenBase.deepOcean.biomeID; + } + else if (k == BiomeGenBase.extremeHills.biomeID) + { + i1 = BiomeGenBase.extremeHillsPlus.biomeID; + } + else if (k == BiomeGenBase.savanna.biomeID) + { + i1 = BiomeGenBase.savannaPlateau.biomeID; + } + else if (biomesEqualOrMesaPlateau(k, BiomeGenBase.mesaPlateau_F.biomeID)) + { + i1 = BiomeGenBase.mesa.biomeID; + } + else if (k == BiomeGenBase.deepOcean.biomeID && this.nextInt(3) == 0) + { + int j1 = this.nextInt(2); + + if (j1 == 0) + { + i1 = BiomeGenBase.plains.biomeID; + } + else + { + i1 = BiomeGenBase.forest.biomeID; + } + } + + if (flag && i1 != k) + { + if (BiomeGenBase.getBiome(i1 + 128) != null) + { + i1 += 128; + } + else + { + i1 = k; + } + } + + if (i1 == k) + { + aint2[j + i * areaWidth] = k; + } + else + { + int k2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; + int k1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; + int l1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; + int i2 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; + int j2 = 0; + + if (biomesEqualOrMesaPlateau(k2, k)) + { + ++j2; + } + + if (biomesEqualOrMesaPlateau(k1, k)) + { + ++j2; + } + + if (biomesEqualOrMesaPlateau(l1, k)) + { + ++j2; + } + + if (biomesEqualOrMesaPlateau(i2, k)) + { + ++j2; + } + + if (j2 >= 3) + { + aint2[j + i * areaWidth] = i1; + } + else + { + aint2[j + i * areaWidth] = k; + } + } + } + } + } + + return aint2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java new file mode 100644 index 0000000..8089604 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java @@ -0,0 +1,30 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerIsland extends GenLayer +{ + public GenLayerIsland(long p_i2124_1_) + { + super(p_i2124_1_); + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaHeight; ++i) + { + for (int j = 0; j < areaWidth; ++j) + { + this.initChunkSeed((long)(areaX + j), (long)(areaY + i)); + aint[j + i * areaWidth] = this.nextInt(10) == 0 ? 1 : 0; + } + } + + if (areaX > -areaWidth && areaX <= 0 && areaY > -areaHeight && areaY <= 0) + { + aint[-areaX + -areaY * areaWidth] = 1; + } + + return aint; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java new file mode 100644 index 0000000..707fa34 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java @@ -0,0 +1,45 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRareBiome extends GenLayer +{ + public GenLayerRareBiome(long p_i45478_1_, GenLayer p_i45478_3_) + { + super(p_i45478_1_); + this.parent = p_i45478_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaHeight; ++i) + { + for (int j = 0; j < areaWidth; ++j) + { + this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); + int k = aint[j + 1 + (i + 1) * (areaWidth + 2)]; + + if (this.nextInt(57) == 0) + { + if (k == BiomeGenBase.plains.biomeID) + { + aint1[j + i * areaWidth] = BiomeGenBase.plains.biomeID + 128; + } + else + { + aint1[j + i * areaWidth] = k; + } + } + else + { + aint1[j + i * areaWidth] = k; + } + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java new file mode 100644 index 0000000..4880ed8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java @@ -0,0 +1,41 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerRemoveTooMuchOcean extends GenLayer +{ + public GenLayerRemoveTooMuchOcean(long p_i45480_1_, GenLayer p_i45480_3_) + { + super(p_i45480_1_); + this.parent = p_i45480_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + int k1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + int l1 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + int i2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + int j2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + int k2 = aint[j1 + 1 + (i1 + 1) * k]; + aint1[j1 + i1 * areaWidth] = k2; + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + + if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && this.nextInt(2) == 0) + { + aint1[j1 + i1 * areaWidth] = 1; + } + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java new file mode 100644 index 0000000..1914b30 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java @@ -0,0 +1,50 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRiver extends GenLayer +{ + public GenLayerRiver(long p_i2128_1_, GenLayer p_i2128_3_) + { + super(p_i2128_1_); + super.parent = p_i2128_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + int k1 = this.func_151630_c(aint[j1 + 0 + (i1 + 1) * k]); + int l1 = this.func_151630_c(aint[j1 + 2 + (i1 + 1) * k]); + int i2 = this.func_151630_c(aint[j1 + 1 + (i1 + 0) * k]); + int j2 = this.func_151630_c(aint[j1 + 1 + (i1 + 2) * k]); + int k2 = this.func_151630_c(aint[j1 + 1 + (i1 + 1) * k]); + + if (k2 == k1 && k2 == i2 && k2 == l1 && k2 == j2) + { + aint1[j1 + i1 * areaWidth] = -1; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.river.biomeID; + } + } + } + + return aint1; + } + + private int func_151630_c(int p_151630_1_) + { + return p_151630_1_ >= 2 ? 2 + (p_151630_1_ & 1) : p_151630_1_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java new file mode 100644 index 0000000..79d4bdc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java @@ -0,0 +1,27 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerRiverInit extends GenLayer +{ + public GenLayerRiverInit(long p_i2127_1_, GenLayer p_i2127_3_) + { + super(p_i2127_1_); + this.parent = p_i2127_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaHeight; ++i) + { + for (int j = 0; j < areaWidth; ++j) + { + this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); + aint1[j + i * areaWidth] = aint[j + i * areaWidth] > 0 ? this.nextInt(299999) + 2 : 0; + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java new file mode 100644 index 0000000..cf54321 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java @@ -0,0 +1,62 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRiverMix extends GenLayer +{ + private GenLayer biomePatternGeneratorChain; + private GenLayer riverPatternGeneratorChain; + + public GenLayerRiverMix(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_) + { + super(p_i2129_1_); + this.biomePatternGeneratorChain = p_i2129_3_; + this.riverPatternGeneratorChain = p_i2129_4_; + } + + public void initWorldGenSeed(long seed) + { + this.biomePatternGeneratorChain.initWorldGenSeed(seed); + this.riverPatternGeneratorChain.initWorldGenSeed(seed); + super.initWorldGenSeed(seed); + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.biomePatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint1 = this.riverPatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaWidth * areaHeight; ++i) + { + if (aint[i] != BiomeGenBase.ocean.biomeID && aint[i] != BiomeGenBase.deepOcean.biomeID) + { + if (aint1[i] == BiomeGenBase.river.biomeID) + { + if (aint[i] == BiomeGenBase.icePlains.biomeID) + { + aint2[i] = BiomeGenBase.frozenRiver.biomeID; + } + else if (aint[i] != BiomeGenBase.mushroomIsland.biomeID && aint[i] != BiomeGenBase.mushroomIslandShore.biomeID) + { + aint2[i] = aint1[i] & 255; + } + else + { + aint2[i] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } + else + { + aint2[i] = aint[i]; + } + } + else + { + aint2[i] = aint[i]; + } + } + + return aint2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java new file mode 100644 index 0000000..9d8c7b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java @@ -0,0 +1,163 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenJungle; +import net.minecraft.world.biome.BiomeGenMesa; + +public class GenLayerShore extends GenLayer +{ + public GenLayerShore(long p_i2130_1_, GenLayer p_i2130_3_) + { + super(p_i2130_1_); + this.parent = p_i2130_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i = 0; i < areaHeight; ++i) + { + for (int j = 0; j < areaWidth; ++j) + { + this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); + int k = aint[j + 1 + (i + 1) * (areaWidth + 2)]; + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(k); + + if (k == BiomeGenBase.mushroomIsland.biomeID) + { + int j2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; + int i3 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; + int l3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; + int k4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; + + if (j2 != BiomeGenBase.ocean.biomeID && i3 != BiomeGenBase.ocean.biomeID && l3 != BiomeGenBase.ocean.biomeID && k4 != BiomeGenBase.ocean.biomeID) + { + aint1[j + i * areaWidth] = k; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } + else if (biomegenbase != null && biomegenbase.getBiomeClass() == BiomeGenJungle.class) + { + int i2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; + int l2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; + int k3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; + int j4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; + + if (this.func_151631_c(i2) && this.func_151631_c(l2) && this.func_151631_c(k3) && this.func_151631_c(j4)) + { + if (!isBiomeOceanic(i2) && !isBiomeOceanic(l2) && !isBiomeOceanic(k3) && !isBiomeOceanic(j4)) + { + aint1[j + i * areaWidth] = k; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID; + } + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.jungleEdge.biomeID; + } + } + else if (k != BiomeGenBase.extremeHills.biomeID && k != BiomeGenBase.extremeHillsPlus.biomeID && k != BiomeGenBase.extremeHillsEdge.biomeID) + { + if (biomegenbase != null && biomegenbase.isSnowyBiome()) + { + this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.coldBeach.biomeID); + } + else if (k != BiomeGenBase.mesa.biomeID && k != BiomeGenBase.mesaPlateau_F.biomeID) + { + if (k != BiomeGenBase.ocean.biomeID && k != BiomeGenBase.deepOcean.biomeID && k != BiomeGenBase.river.biomeID && k != BiomeGenBase.swampland.biomeID) + { + int l1 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; + int k2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; + int j3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; + int i4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; + + if (!isBiomeOceanic(l1) && !isBiomeOceanic(k2) && !isBiomeOceanic(j3) && !isBiomeOceanic(i4)) + { + aint1[j + i * areaWidth] = k; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID; + } + } + else + { + aint1[j + i * areaWidth] = k; + } + } + else + { + int l = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)]; + int i1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)]; + int j1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)]; + int k1 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)]; + + if (!isBiomeOceanic(l) && !isBiomeOceanic(i1) && !isBiomeOceanic(j1) && !isBiomeOceanic(k1)) + { + if (this.func_151633_d(l) && this.func_151633_d(i1) && this.func_151633_d(j1) && this.func_151633_d(k1)) + { + aint1[j + i * areaWidth] = k; + } + else + { + aint1[j + i * areaWidth] = BiomeGenBase.desert.biomeID; + } + } + else + { + aint1[j + i * areaWidth] = k; + } + } + } + else + { + this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.stoneBeach.biomeID); + } + } + } + + return aint1; + } + + private void func_151632_a(int[] p_151632_1_, int[] p_151632_2_, int p_151632_3_, int p_151632_4_, int p_151632_5_, int p_151632_6_, int p_151632_7_) + { + if (isBiomeOceanic(p_151632_6_)) + { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; + } + else + { + int i = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 - 1) * (p_151632_5_ + 2)]; + int j = p_151632_1_[p_151632_3_ + 1 + 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; + int k = p_151632_1_[p_151632_3_ + 1 - 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; + int l = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 + 1) * (p_151632_5_ + 2)]; + + if (!isBiomeOceanic(i) && !isBiomeOceanic(j) && !isBiomeOceanic(k) && !isBiomeOceanic(l)) + { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; + } + else + { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_7_; + } + } + } + + private boolean func_151631_c(int p_151631_1_) + { + return BiomeGenBase.getBiome(p_151631_1_) != null && BiomeGenBase.getBiome(p_151631_1_).getBiomeClass() == BiomeGenJungle.class ? true : p_151631_1_ == BiomeGenBase.jungleEdge.biomeID || p_151631_1_ == BiomeGenBase.jungle.biomeID || p_151631_1_ == BiomeGenBase.jungleHills.biomeID || p_151631_1_ == BiomeGenBase.forest.biomeID || p_151631_1_ == BiomeGenBase.taiga.biomeID || isBiomeOceanic(p_151631_1_); + } + + private boolean func_151633_d(int p_151633_1_) + { + return BiomeGenBase.getBiome(p_151633_1_) instanceof BiomeGenMesa; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java new file mode 100644 index 0000000..02c9aed --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java @@ -0,0 +1,62 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerSmooth extends GenLayer +{ + public GenLayerSmooth(long p_i2131_1_, GenLayer p_i2131_3_) + { + super(p_i2131_1_); + super.parent = p_i2131_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX - 1; + int j = areaY - 1; + int k = areaWidth + 2; + int l = areaHeight + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + int k1 = aint[j1 + 0 + (i1 + 1) * k]; + int l1 = aint[j1 + 2 + (i1 + 1) * k]; + int i2 = aint[j1 + 1 + (i1 + 0) * k]; + int j2 = aint[j1 + 1 + (i1 + 2) * k]; + int k2 = aint[j1 + 1 + (i1 + 1) * k]; + + if (k1 == l1 && i2 == j2) + { + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + + if (this.nextInt(2) == 0) + { + k2 = k1; + } + else + { + k2 = i2; + } + } + else + { + if (k1 == l1) + { + k2 = k1; + } + + if (i2 == j2) + { + k2 = i2; + } + } + + aint1[j1 + i1 * areaWidth] = k2; + } + } + + return aint1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java new file mode 100644 index 0000000..0301bc2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java @@ -0,0 +1,91 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerVoronoiZoom extends GenLayer +{ + public GenLayerVoronoiZoom(long p_i2133_1_, GenLayer p_i2133_3_) + { + super(p_i2133_1_); + super.parent = p_i2133_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + areaX = areaX - 2; + areaY = areaY - 2; + int i = areaX >> 2; + int j = areaY >> 2; + int k = (areaWidth >> 2) + 2; + int l = (areaHeight >> 2) + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int i1 = k - 1 << 2; + int j1 = l - 1 << 2; + int[] aint1 = IntCache.getIntCache(i1 * j1); + + for (int k1 = 0; k1 < l - 1; ++k1) + { + int l1 = 0; + int i2 = aint[l1 + 0 + (k1 + 0) * k]; + + for (int j2 = aint[l1 + 0 + (k1 + 1) * k]; l1 < k - 1; ++l1) + { + double d0 = 3.6D; + this.initChunkSeed((long)(l1 + i << 2), (long)(k1 + j << 2)); + double d1 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double d2 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed((long)(l1 + i + 1 << 2), (long)(k1 + j << 2)); + double d3 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double d4 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed((long)(l1 + i << 2), (long)(k1 + j + 1 << 2)); + double d5 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double d6 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + this.initChunkSeed((long)(l1 + i + 1 << 2), (long)(k1 + j + 1 << 2)); + double d7 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double d8 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + int k2 = aint[l1 + 1 + (k1 + 0) * k] & 255; + int l2 = aint[l1 + 1 + (k1 + 1) * k] & 255; + + for (int i3 = 0; i3 < 4; ++i3) + { + int j3 = ((k1 << 2) + i3) * i1 + (l1 << 2); + + for (int k3 = 0; k3 < 4; ++k3) + { + double d9 = ((double)i3 - d2) * ((double)i3 - d2) + ((double)k3 - d1) * ((double)k3 - d1); + double d10 = ((double)i3 - d4) * ((double)i3 - d4) + ((double)k3 - d3) * ((double)k3 - d3); + double d11 = ((double)i3 - d6) * ((double)i3 - d6) + ((double)k3 - d5) * ((double)k3 - d5); + double d12 = ((double)i3 - d8) * ((double)i3 - d8) + ((double)k3 - d7) * ((double)k3 - d7); + + if (d9 < d10 && d9 < d11 && d9 < d12) + { + aint1[j3++] = i2; + } + else if (d10 < d9 && d10 < d11 && d10 < d12) + { + aint1[j3++] = k2; + } + else if (d11 < d9 && d11 < d10 && d11 < d12) + { + aint1[j3++] = j2; + } + else + { + aint1[j3++] = l2; + } + } + } + + i2 = k2; + j2 = l2; + } + } + + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int l3 = 0; l3 < areaHeight; ++l3) + { + System.arraycopy(aint1, (l3 + (areaY & 3)) * i1 + (areaX & 3), aint2, l3 * areaWidth, areaWidth); + } + + return aint2; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java new file mode 100644 index 0000000..6a21b3d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java @@ -0,0 +1,69 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerZoom extends GenLayer +{ + public GenLayerZoom(long p_i2134_1_, GenLayer p_i2134_3_) + { + super(p_i2134_1_); + super.parent = p_i2134_3_; + } + + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i = areaX >> 1; + int j = areaY >> 1; + int k = (areaWidth >> 1) + 2; + int l = (areaHeight >> 1) + 2; + int[] aint = this.parent.getInts(i, j, k, l); + int i1 = k - 1 << 1; + int j1 = l - 1 << 1; + int[] aint1 = IntCache.getIntCache(i1 * j1); + + for (int k1 = 0; k1 < l - 1; ++k1) + { + int l1 = (k1 << 1) * i1; + int i2 = 0; + int j2 = aint[i2 + 0 + (k1 + 0) * k]; + + for (int k2 = aint[i2 + 0 + (k1 + 1) * k]; i2 < k - 1; ++i2) + { + this.initChunkSeed((long)(i2 + i << 1), (long)(k1 + j << 1)); + int l2 = aint[i2 + 1 + (k1 + 0) * k]; + int i3 = aint[i2 + 1 + (k1 + 1) * k]; + aint1[l1] = j2; + aint1[l1++ + i1] = this.selectRandom2(j2, k2); + aint1[l1] = this.selectRandom2(j2, l2); + aint1[l1++ + i1] = this.selectModeOrRandom(j2, l2, k2, i3); + j2 = l2; + k2 = i3; + } + } + + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int j3 = 0; j3 < areaHeight; ++j3) + { + System.arraycopy(aint1, (j3 + (areaY & 1)) * i1 + (areaX & 1), aint2, j3 * areaWidth, areaWidth); + } + + return aint2; + } + + public static GenLayer magnify(long p_75915_0_, GenLayer p_75915_2_, int p_75915_3_) + { + GenLayer genlayer = p_75915_2_; + + for (int i = 0; i < p_75915_3_; ++i) + { + genlayer = new GenLayerZoom(p_75915_0_ + (long)i, genlayer); + } + + return genlayer; + } + + protected int selectRandom2(int p_selectRandom2_1_, int p_selectRandom2_2_) + { + int i = this.nextInt(2); + return i == 0 ? p_selectRandom2_1_ : p_selectRandom2_2_; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/IntCache.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/IntCache.java new file mode 100644 index 0000000..d4e85b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/layer/IntCache.java @@ -0,0 +1,76 @@ +package net.minecraft.world.gen.layer; + +import com.google.common.collect.Lists; +import java.util.List; + +public class IntCache +{ + private static int intCacheSize = 256; + private static List freeSmallArrays = Lists.newArrayList(); + private static List inUseSmallArrays = Lists.newArrayList(); + private static List freeLargeArrays = Lists.newArrayList(); + private static List inUseLargeArrays = Lists.newArrayList(); + + public static synchronized int[] getIntCache(int p_76445_0_) + { + if (p_76445_0_ <= 256) + { + if (freeSmallArrays.isEmpty()) + { + int[] aint4 = new int[256]; + inUseSmallArrays.add(aint4); + return aint4; + } + else + { + int[] aint3 = (int[])freeSmallArrays.remove(freeSmallArrays.size() - 1); + inUseSmallArrays.add(aint3); + return aint3; + } + } + else if (p_76445_0_ > intCacheSize) + { + intCacheSize = p_76445_0_; + freeLargeArrays.clear(); + inUseLargeArrays.clear(); + int[] aint2 = new int[intCacheSize]; + inUseLargeArrays.add(aint2); + return aint2; + } + else if (freeLargeArrays.isEmpty()) + { + int[] aint1 = new int[intCacheSize]; + inUseLargeArrays.add(aint1); + return aint1; + } + else + { + int[] aint = (int[])freeLargeArrays.remove(freeLargeArrays.size() - 1); + inUseLargeArrays.add(aint); + return aint; + } + } + + public static synchronized void resetIntCache() + { + if (!freeLargeArrays.isEmpty()) + { + freeLargeArrays.remove(freeLargeArrays.size() - 1); + } + + if (!freeSmallArrays.isEmpty()) + { + freeSmallArrays.remove(freeSmallArrays.size() - 1); + } + + freeLargeArrays.addAll(inUseLargeArrays); + freeSmallArrays.addAll(inUseSmallArrays); + inUseLargeArrays.clear(); + inUseSmallArrays.clear(); + } + + public static synchronized String getCacheSizes() + { + return "cache: " + freeLargeArrays.size() + ", tcache: " + freeSmallArrays.size() + ", allocated: " + inUseLargeArrays.size() + ", tallocated: " + inUseSmallArrays.size(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java new file mode 100644 index 0000000..5ac080d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java @@ -0,0 +1,700 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.block.BlockFlowerPot; +import net.minecraft.block.BlockLever; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.block.BlockTripWire; +import net.minecraft.block.BlockTripWireHook; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class ComponentScatteredFeaturePieces +{ + public static void registerScatteredFeaturePieces() + { + MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.DesertPyramid.class, "TeDP"); + MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.JunglePyramid.class, "TeJP"); + MapGenStructureIO.registerStructureComponent(ComponentScatteredFeaturePieces.SwampHut.class, "TeSH"); + } + + public static class DesertPyramid extends ComponentScatteredFeaturePieces.Feature + { + private boolean[] hasPlacedChest = new boolean[4]; + private static final List itemsToGenerateInTemple = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}); + + public DesertPyramid() + { + } + + public DesertPyramid(Random p_i2062_1_, int p_i2062_2_, int p_i2062_3_) + { + super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("hasPlacedChest0", this.hasPlacedChest[0]); + tagCompound.setBoolean("hasPlacedChest1", this.hasPlacedChest[1]); + tagCompound.setBoolean("hasPlacedChest2", this.hasPlacedChest[2]); + tagCompound.setBoolean("hasPlacedChest3", this.hasPlacedChest[3]); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.hasPlacedChest[0] = tagCompound.getBoolean("hasPlacedChest0"); + this.hasPlacedChest[1] = tagCompound.getBoolean("hasPlacedChest1"); + this.hasPlacedChest[2] = tagCompound.getBoolean("hasPlacedChest2"); + this.hasPlacedChest[3] = tagCompound.getBoolean("hasPlacedChest3"); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + + for (int i = 1; i <= 9; ++i) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, i, i, this.scatteredFeatureSizeX - 1 - i, i, this.scatteredFeatureSizeZ - 1 - i, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i + 1, i, i + 1, this.scatteredFeatureSizeX - 2 - i, i, this.scatteredFeatureSizeZ - 2 - i, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + for (int j2 = 0; j2 < this.scatteredFeatureSizeX; ++j2) + { + for (int j = 0; j < this.scatteredFeatureSizeZ; ++j) + { + int k = -5; + this.replaceAirAndLiquidDownwards(worldIn, Blocks.sandstone.getDefaultState(), j2, k, j, structureBoundingBoxIn); + } + } + + int k2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 3); + int l2 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 2); + int i3 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 0); + int l = this.getMetadataWithOffset(Blocks.sandstone_stairs, 1); + int i1 = ~EnumDyeColor.ORANGE.getDyeDamage() & 15; + int j1 = ~EnumDyeColor.BLUE.getDyeDamage() & 15; + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 9, 4, Blocks.sandstone.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 10, 1, 3, 10, 3, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 10, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l2), 2, 10, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(i3), 0, 10, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l), 4, 10, 2, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Blocks.sandstone.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), this.scatteredFeatureSizeX - 3, 10, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l2), this.scatteredFeatureSizeX - 3, 10, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(i3), this.scatteredFeatureSizeX - 5, 10, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l), this.scatteredFeatureSizeX - 1, 10, 2, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 0, 0, 12, 4, 4, Blocks.sandstone.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 0, 11, 3, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 9, 1, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 9, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 9, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 10, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 11, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 11, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 11, 1, 1, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 8, 3, 3, Blocks.sandstone.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 2, 8, 2, 2, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 1, 16, 3, 3, Blocks.sandstone.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 2, 16, 2, 2, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 4, 9, 11, 4, 11, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 1, 8, 8, 3, 8, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 8, 12, 3, 8, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 1, 12, 8, 3, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 12, 12, 3, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 5, 4, 4, 11, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 7, 9, 6, 7, 11, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 9, 5, 7, 11, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 5, 5, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 5, 6, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 6, 6, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), this.scatteredFeatureSizeX - 6, 5, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), this.scatteredFeatureSizeX - 6, 6, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), this.scatteredFeatureSizeX - 7, 6, 10, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 4, 4, 2, 6, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 4, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), 2, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), this.scatteredFeatureSizeX - 3, 4, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(k2), this.scatteredFeatureSizeX - 3, 3, 4, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 3, 2, 2, 3, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getDefaultState(), 1, 1, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getDefaultState(), this.scatteredFeatureSizeX - 2, 1, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SAND.getMetadata()), 1, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SAND.getMetadata()), this.scatteredFeatureSizeX - 2, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(l), 2, 1, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone_stairs.getStateFromMeta(i3), this.scatteredFeatureSizeX - 3, 1, 2, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 5, 4, 3, 18, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 5, 4, 2, 16, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + for (int k1 = 5; k1 <= 17; k1 += 2) + { + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 4, 1, k1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 4, 2, k1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), this.scatteredFeatureSizeX - 5, 1, k1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), this.scatteredFeatureSizeX - 5, 2, k1, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 9, 0, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 11, 0, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 8, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 12, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 7, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 13, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 9, 0, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 11, 0, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 10, 0, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(j1), 10, 0, 10, structureBoundingBoxIn); + + for (int j3 = 0; j3 <= this.scatteredFeatureSizeX - 1; j3 += this.scatteredFeatureSizeX - 1) + { + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 4, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), j3, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 5, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 5, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 5, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 6, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), j3, 6, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 6, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 7, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 7, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), j3, 7, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 8, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 8, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), j3, 8, 3, structureBoundingBoxIn); + } + + for (int k3 = 2; k3 <= this.scatteredFeatureSizeX - 3; k3 += this.scatteredFeatureSizeX - 3 - 2) + { + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 - 1, 4, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), k3, 4, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 + 1, 4, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 - 1, 6, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), k3, 6, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 + 1, 6, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 - 1, 7, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3, 7, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), k3 + 1, 7, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 - 1, 8, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3, 8, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), k3 + 1, 8, 0, structureBoundingBoxIn); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 4, 0, 12, 6, 0, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 8, 6, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 12, 6, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 9, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 10, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stained_hardened_clay.getStateFromMeta(i1), 11, 5, 0, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -14, 8, 12, -11, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -10, 8, 12, -10, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -9, 8, 12, -9, 12, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, -8, 8, 12, -1, 12, Blocks.sandstone.getDefaultState(), Blocks.sandstone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, -11, 9, 11, -1, 11, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.stone_pressure_plate.getDefaultState(), 10, -11, 10, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, -13, 9, 11, -13, 11, Blocks.tnt.getDefaultState(), Blocks.air.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 8, -11, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 8, -10, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 7, -10, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 7, -11, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 12, -11, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 12, -10, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 13, -10, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 13, -11, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 10, -11, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 10, -10, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 10, -10, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 10, -11, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 10, -11, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 10, -10, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.CHISELED.getMetadata()), 10, -10, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()), 10, -11, 13, structureBoundingBoxIn); + + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + if (!this.hasPlacedChest[enumfacing.getHorizontalIndex()]) + { + int l1 = enumfacing.getFrontOffsetX() * 2; + int i2 = enumfacing.getFrontOffsetZ() * 2; + this.hasPlacedChest[enumfacing.getHorizontalIndex()] = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 10 + l1, -11, 10 + i2, WeightedRandomChestContent.func_177629_a(itemsToGenerateInTemple, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); + } + } + + return true; + } + } + + abstract static class Feature extends StructureComponent + { + protected int scatteredFeatureSizeX; + protected int scatteredFeatureSizeY; + protected int scatteredFeatureSizeZ; + protected int field_74936_d = -1; + + public Feature() + { + } + + protected Feature(Random p_i2065_1_, int p_i2065_2_, int p_i2065_3_, int p_i2065_4_, int p_i2065_5_, int p_i2065_6_, int p_i2065_7_) + { + super(0); + this.scatteredFeatureSizeX = p_i2065_5_; + this.scatteredFeatureSizeY = p_i2065_6_; + this.scatteredFeatureSizeZ = p_i2065_7_; + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(p_i2065_1_); + + switch (this.coordBaseMode) + { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_5_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_7_ - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_7_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_5_ - 1); + } + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + tagCompound.setInteger("Width", this.scatteredFeatureSizeX); + tagCompound.setInteger("Height", this.scatteredFeatureSizeY); + tagCompound.setInteger("Depth", this.scatteredFeatureSizeZ); + tagCompound.setInteger("HPos", this.field_74936_d); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + this.scatteredFeatureSizeX = tagCompound.getInteger("Width"); + this.scatteredFeatureSizeY = tagCompound.getInteger("Height"); + this.scatteredFeatureSizeZ = tagCompound.getInteger("Depth"); + this.field_74936_d = tagCompound.getInteger("HPos"); + } + + protected boolean func_74935_a(World worldIn, StructureBoundingBox p_74935_2_, int p_74935_3_) + { + if (this.field_74936_d >= 0) + { + return true; + } + else + { + int i = 0; + int j = 0; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k) + { + for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l) + { + blockpos$mutableblockpos.set(l, 64, k); + + if (p_74935_2_.isVecInside(blockpos$mutableblockpos)) + { + i += Math.max(worldIn.getTopSolidOrLiquidBlock(blockpos$mutableblockpos).getY(), worldIn.provider.getAverageGroundLevel()); + ++j; + } + } + } + + if (j == 0) + { + return false; + } + else + { + this.field_74936_d = i / j; + this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + p_74935_3_, 0); + return true; + } + } + } + } + + public static class JunglePyramid extends ComponentScatteredFeaturePieces.Feature + { + private boolean placedMainChest; + private boolean placedHiddenChest; + private boolean placedTrap1; + private boolean placedTrap2; + private static final List field_175816_i = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}); + private static final List field_175815_j = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.arrow, 0, 2, 7, 30)}); + private static ComponentScatteredFeaturePieces.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(); + + public JunglePyramid() + { + } + + public JunglePyramid(Random p_i2064_1_, int p_i2064_2_, int p_i2064_3_) + { + super(p_i2064_1_, p_i2064_2_, 64, p_i2064_3_, 12, 10, 15); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("placedMainChest", this.placedMainChest); + tagCompound.setBoolean("placedHiddenChest", this.placedHiddenChest); + tagCompound.setBoolean("placedTrap1", this.placedTrap1); + tagCompound.setBoolean("placedTrap2", this.placedTrap2); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.placedMainChest = tagCompound.getBoolean("placedMainChest"); + this.placedHiddenChest = tagCompound.getBoolean("placedHiddenChest"); + this.placedTrap1 = tagCompound.getBoolean("placedTrap1"); + this.placedTrap2 = tagCompound.getBoolean("placedTrap2"); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (!this.func_74935_a(worldIn, structureBoundingBoxIn, 0)) + { + return false; + } + else + { + int i = this.getMetadataWithOffset(Blocks.stone_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.stone_stairs, 2); + int k = this.getMetadataWithOffset(Blocks.stone_stairs, 0); + int l = this.getMetadataWithOffset(Blocks.stone_stairs, 1); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 9, 2, 2, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 12, 9, 2, 12, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 3, 2, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 1, 3, 9, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 1, 10, 6, 1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 13, 10, 6, 13, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 2, 1, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, 3, 2, 10, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 3, 2, 9, 3, 12, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 6, 2, 9, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 7, 3, 8, 7, 11, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 8, 4, 7, 8, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithAir(worldIn, structureBoundingBoxIn, 3, 1, 3, 8, 2, 11); + this.fillWithAir(worldIn, structureBoundingBoxIn, 4, 3, 6, 7, 3, 9); + this.fillWithAir(worldIn, structureBoundingBoxIn, 2, 4, 2, 9, 5, 12); + this.fillWithAir(worldIn, structureBoundingBoxIn, 4, 6, 5, 7, 6, 9); + this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 7, 6, 6, 7, 8); + this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 1, 2, 6, 2, 2); + this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 2, 12, 6, 2, 12); + this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 5, 1, 6, 5, 1); + this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 5, 13, 6, 5, 13); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, 5, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 10, 5, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, 5, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 10, 5, 9, structureBoundingBoxIn); + + for (int i1 = 0; i1 <= 14; i1 += 14) + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 4, i1, 2, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 4, i1, 4, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 4, i1, 7, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 4, i1, 9, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 6, 0, 6, 6, 0, false, randomIn, junglePyramidsRandomScatteredStones); + + for (int k1 = 0; k1 <= 11; k1 += 11) + { + for (int j1 = 2; j1 <= 12; j1 += 2) + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 4, j1, k1, 5, j1, false, randomIn, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 5, k1, 6, 5, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 9, k1, 6, 9, false, randomIn, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 2, 2, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 2, 9, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 12, 2, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 12, 9, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 4, 4, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 4, 7, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 10, 4, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 10, 7, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 9, 7, 6, 9, 7, false, randomIn, junglePyramidsRandomScatteredStones); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 5, 9, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 6, 9, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(j), 5, 9, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(j), 6, 9, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 4, 0, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 5, 0, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 6, 0, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 7, 0, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 4, 1, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 4, 2, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 4, 3, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 7, 1, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 7, 2, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 7, 3, 10, structureBoundingBoxIn); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 1, 9, 7, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 7, 2, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, 6, 4, 5, false, randomIn, junglePyramidsRandomScatteredStones); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(k), 4, 4, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(l), 7, 4, 5, structureBoundingBoxIn); + + for (int l1 = 0; l1 < 4; ++l1) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(j), 5, 0 - l1, 6 + l1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(j), 6, 0 - l1, 6 + l1, structureBoundingBoxIn); + this.fillWithAir(worldIn, structureBoundingBoxIn, 5, 0 - l1, 7 + l1, 6, 0 - l1, 9 + l1); + } + + this.fillWithAir(worldIn, structureBoundingBoxIn, 1, -3, 12, 10, -1, 13); + this.fillWithAir(worldIn, structureBoundingBoxIn, 1, -3, 1, 3, -1, 13); + this.fillWithAir(worldIn, structureBoundingBoxIn, 1, -3, 1, 9, -1, 5); + + for (int i2 = 1; i2 <= 13; i2 += 2) + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -3, i2, 1, -2, i2, false, randomIn, junglePyramidsRandomScatteredStones); + } + + for (int j2 = 2; j2 <= 12; j2 += 2) + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -1, j2, 3, -1, j2, false, randomIn, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, -2, 1, 5, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, -2, 1, 9, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -3, 1, 6, -3, 1, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -1, 1, 6, -1, 1, false, randomIn, junglePyramidsRandomScatteredStones); + this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.EAST.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 1, -3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.WEST.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 4, -3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 2, -3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 3, -3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 5, -3, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 5, -3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 5, -3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 5, -3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 5, -3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 5, -3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 5, -3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 4, -3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 3, -3, 1, structureBoundingBoxIn); + + if (!this.placedTrap1) + { + this.placedTrap1 = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 3, -2, 1, EnumFacing.NORTH.getIndex(), field_175815_j, 2); + } + + this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 3, -2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.NORTH.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 7, -3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire_hook.getStateFromMeta(this.getMetadataWithOffset(Blocks.tripwire_hook, EnumFacing.SOUTH.getHorizontalIndex())).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true)), 7, -3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.tripwire.getDefaultState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 8, -3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 9, -3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 9, -3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 9, -3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 9, -2, 4, structureBoundingBoxIn); + + if (!this.placedTrap2) + { + this.placedTrap2 = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 9, -2, 3, EnumFacing.WEST.getIndex(), field_175815_j, 2); + } + + this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 8, -1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 8, -2, 3, structureBoundingBoxIn); + + if (!this.placedMainChest) + { + this.placedMainChest = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 8, -3, 3, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); + } + + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 9, -3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 8, -3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 4, -3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 5, -2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 5, -1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 6, -3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 7, -2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 7, -1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 8, -3, 5, structureBoundingBoxIn); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, -1, 1, 9, -1, 5, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithAir(worldIn, structureBoundingBoxIn, 8, -3, 8, 10, -1, 10); + this.setBlockState(worldIn, Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CHISELED_META), 8, -2, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CHISELED_META), 9, -2, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CHISELED_META), 10, -2, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(EnumFacing.getFront(this.getMetadataWithOffset(Blocks.lever, EnumFacing.NORTH.getIndex())))), 8, -2, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(EnumFacing.getFront(this.getMetadataWithOffset(Blocks.lever, EnumFacing.NORTH.getIndex())))), 9, -2, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.lever.getStateFromMeta(BlockLever.getMetadataForFacing(EnumFacing.getFront(this.getMetadataWithOffset(Blocks.lever, EnumFacing.NORTH.getIndex())))), 10, -2, 12, structureBoundingBoxIn); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, -3, 8, 8, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, -3, 8, 10, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 10, -2, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 8, -2, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 8, -2, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 10, -1, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sticky_piston.getStateFromMeta(EnumFacing.UP.getIndex()), 9, -2, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sticky_piston.getStateFromMeta(this.getMetadataWithOffset(Blocks.sticky_piston, EnumFacing.WEST.getIndex())), 10, -2, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.sticky_piston.getStateFromMeta(this.getMetadataWithOffset(Blocks.sticky_piston, EnumFacing.WEST.getIndex())), 10, -1, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.unpowered_repeater.getStateFromMeta(this.getMetadataWithOffset(Blocks.unpowered_repeater, EnumFacing.NORTH.getHorizontalIndex())), 10, -2, 10, structureBoundingBoxIn); + + if (!this.placedHiddenChest) + { + this.placedHiddenChest = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 9, -3, 10, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); + } + + return true; + } + } + + static class Stones extends StructureComponent.BlockSelector + { + private Stones() + { + } + + public void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_) + { + if (rand.nextFloat() < 0.4F) + { + this.blockstate = Blocks.cobblestone.getDefaultState(); + } + else + { + this.blockstate = Blocks.mossy_cobblestone.getDefaultState(); + } + } + } + } + + public static class SwampHut extends ComponentScatteredFeaturePieces.Feature + { + private boolean hasWitch; + + public SwampHut() + { + } + + public SwampHut(Random p_i2066_1_, int p_i2066_2_, int p_i2066_3_) + { + super(p_i2066_1_, p_i2066_2_, 64, p_i2066_3_, 7, 7, 9); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Witch", this.hasWitch); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.hasWitch = tagCompound.getBoolean("Witch"); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (!this.func_74935_a(worldIn, structureBoundingBoxIn, 0)) + { + return false; + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 5, 1, 7, Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 2, 5, 4, 7, Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 0, 4, 1, 0, Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, 2, 3, 3, 2, Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 3, 1, 3, 6, Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 3, 5, 3, 6, Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, 7, 4, 3, 7, Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), Blocks.planks.getStateFromMeta(BlockPlanks.EnumType.SPRUCE.getMetadata()), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 2, 1, 3, 2, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 0, 2, 5, 3, 2, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 7, 1, 3, 7, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 0, 7, 5, 3, 7, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 2, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 3, 3, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 5, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 5, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.flower_pot.getDefaultState().withProperty(BlockFlowerPot.CONTENTS, BlockFlowerPot.EnumFlowerType.MUSHROOM_RED), 1, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.crafting_table.getDefaultState(), 3, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cauldron.getDefaultState(), 4, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 5, 2, 1, structureBoundingBoxIn); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 1); + int k = this.getMetadataWithOffset(Blocks.oak_stairs, 0); + int l = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 1, 6, 4, 1, Blocks.spruce_stairs.getStateFromMeta(i), Blocks.spruce_stairs.getStateFromMeta(i), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 2, 0, 4, 7, Blocks.spruce_stairs.getStateFromMeta(k), Blocks.spruce_stairs.getStateFromMeta(k), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 4, 2, 6, 4, 7, Blocks.spruce_stairs.getStateFromMeta(j), Blocks.spruce_stairs.getStateFromMeta(j), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 8, 6, 4, 8, Blocks.spruce_stairs.getStateFromMeta(l), Blocks.spruce_stairs.getStateFromMeta(l), false); + + for (int i1 = 2; i1 <= 7; i1 += 5) + { + for (int j1 = 1; j1 <= 5; j1 += 4) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.log.getDefaultState(), j1, -1, i1, structureBoundingBoxIn); + } + } + + if (!this.hasWitch) + { + int l1 = this.getXWithOffset(2, 5); + int i2 = this.getYWithOffset(2); + int k1 = this.getZWithOffset(2, 5); + + if (structureBoundingBoxIn.isVecInside(new BlockPos(l1, i2, k1))) + { + this.hasWitch = true; + EntityWitch entitywitch = new EntityWitch(worldIn); + entitywitch.setLocationAndAngles((double)l1 + 0.5D, (double)i2, (double)k1 + 0.5D, 0.0F, 0.0F); + entitywitch.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(l1, i2, k1)), (IEntityLivingData)null); + worldIn.spawnEntityInWorld(entitywitch); + } + } + + return true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java new file mode 100644 index 0000000..f6f38e0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java @@ -0,0 +1,40 @@ +package net.minecraft.world.gen.structure; + +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.MathHelper; + +public class MapGenMineshaft extends MapGenStructure +{ + private double field_82673_e = 0.004D; + + public MapGenMineshaft() + { + } + + public String getStructureName() + { + return "Mineshaft"; + } + + public MapGenMineshaft(Map p_i2034_1_) + { + for (Entry entry : p_i2034_1_.entrySet()) + { + if (((String)entry.getKey()).equals("chance")) + { + this.field_82673_e = MathHelper.parseDoubleWithDefault((String)entry.getValue(), this.field_82673_e); + } + } + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + return this.rand.nextDouble() < this.field_82673_e && this.rand.nextInt(80) < Math.max(Math.abs(chunkX), Math.abs(chunkZ)); + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + return new StructureMineshaftStart(this.worldObj, this.rand, chunkX, chunkZ); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java new file mode 100644 index 0000000..e306a61 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java @@ -0,0 +1,74 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenNetherBridge extends MapGenStructure +{ + private List spawnList = Lists.newArrayList(); + + public MapGenNetherBridge() + { + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityBlaze.class, 10, 2, 3)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); + } + + public String getStructureName() + { + return "Fortress"; + } + + public List getSpawnList() + { + return this.spawnList; + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + int i = chunkX >> 4; + int j = chunkZ >> 4; + this.rand.setSeed((long)(i ^ j << 4) ^ this.worldObj.getSeed()); + this.rand.nextInt(); + return this.rand.nextInt(3) != 0 ? false : (chunkX != (i << 4) + 4 + this.rand.nextInt(8) ? false : chunkZ == (j << 4) + 4 + this.rand.nextInt(8)); + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + return new MapGenNetherBridge.Start(this.worldObj, this.rand, chunkX, chunkZ); + } + + public static class Start extends StructureStart + { + public Start() + { + } + + public Start(World worldIn, Random p_i2040_2_, int p_i2040_3_, int p_i2040_4_) + { + super(p_i2040_3_, p_i2040_4_); + StructureNetherBridgePieces.Start structurenetherbridgepieces$start = new StructureNetherBridgePieces.Start(p_i2040_2_, (p_i2040_3_ << 4) + 2, (p_i2040_4_ << 4) + 2); + this.components.add(structurenetherbridgepieces$start); + structurenetherbridgepieces$start.buildComponent(structurenetherbridgepieces$start, this.components, p_i2040_2_); + List list = structurenetherbridgepieces$start.field_74967_d; + + while (!list.isEmpty()) + { + int i = p_i2040_2_.nextInt(list.size()); + StructureComponent structurecomponent = (StructureComponent)list.remove(i); + structurecomponent.buildComponent(structurenetherbridgepieces$start, this.components, p_i2040_2_); + } + + this.updateBoundingBox(); + this.setRandomHeight(worldIn, p_i2040_2_, 48, 70); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java new file mode 100644 index 0000000..b88bfa9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java @@ -0,0 +1,150 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenScatteredFeature extends MapGenStructure +{ + private static final List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland}); + private List scatteredFeatureSpawnList; + private int maxDistanceBetweenScatteredFeatures; + private int minDistanceBetweenScatteredFeatures; + + public MapGenScatteredFeature() + { + this.scatteredFeatureSpawnList = Lists.newArrayList(); + this.maxDistanceBetweenScatteredFeatures = 32; + this.minDistanceBetweenScatteredFeatures = 8; + this.scatteredFeatureSpawnList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 1, 1, 1)); + } + + public MapGenScatteredFeature(Map p_i2061_1_) + { + this(); + + for (Entry entry : p_i2061_1_.entrySet()) + { + if (((String)entry.getKey()).equals("distance")) + { + this.maxDistanceBetweenScatteredFeatures = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, this.minDistanceBetweenScatteredFeatures + 1); + } + } + } + + public String getStructureName() + { + return "Temple"; + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + int i = chunkX; + int j = chunkZ; + + if (chunkX < 0) + { + chunkX -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + if (chunkZ < 0) + { + chunkZ -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + int k = chunkX / this.maxDistanceBetweenScatteredFeatures; + int l = chunkZ / this.maxDistanceBetweenScatteredFeatures; + Random random = this.worldObj.setRandomSeed(k, l, 14357617); + k = k * this.maxDistanceBetweenScatteredFeatures; + l = l * this.maxDistanceBetweenScatteredFeatures; + k = k + random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + l = l + random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + + if (i == k && j == l) + { + BiomeGenBase biomegenbase = this.worldObj.getWorldChunkManager().getBiomeGenerator(new BlockPos(i * 16 + 8, 0, j * 16 + 8)); + + if (biomegenbase == null) + { + return false; + } + + for (BiomeGenBase biomegenbase1 : biomelist) + { + if (biomegenbase == biomegenbase1) + { + return true; + } + } + } + + return false; + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + return new MapGenScatteredFeature.Start(this.worldObj, this.rand, chunkX, chunkZ); + } + + public boolean func_175798_a(BlockPos p_175798_1_) + { + StructureStart structurestart = this.func_175797_c(p_175798_1_); + + if (structurestart != null && structurestart instanceof MapGenScatteredFeature.Start && !structurestart.components.isEmpty()) + { + StructureComponent structurecomponent = (StructureComponent)structurestart.components.getFirst(); + return structurecomponent instanceof ComponentScatteredFeaturePieces.SwampHut; + } + else + { + return false; + } + } + + public List getScatteredFeatureSpawnList() + { + return this.scatteredFeatureSpawnList; + } + + public static class Start extends StructureStart + { + public Start() + { + } + + public Start(World worldIn, Random p_i2060_2_, int p_i2060_3_, int p_i2060_4_) + { + super(p_i2060_3_, p_i2060_4_); + BiomeGenBase biomegenbase = worldIn.getBiomeGenForCoords(new BlockPos(p_i2060_3_ * 16 + 8, 0, p_i2060_4_ * 16 + 8)); + + if (biomegenbase != BiomeGenBase.jungle && biomegenbase != BiomeGenBase.jungleHills) + { + if (biomegenbase == BiomeGenBase.swampland) + { + ComponentScatteredFeaturePieces.SwampHut componentscatteredfeaturepieces$swamphut = new ComponentScatteredFeaturePieces.SwampHut(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(componentscatteredfeaturepieces$swamphut); + } + else if (biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills) + { + ComponentScatteredFeaturePieces.DesertPyramid componentscatteredfeaturepieces$desertpyramid = new ComponentScatteredFeaturePieces.DesertPyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(componentscatteredfeaturepieces$desertpyramid); + } + } + else + { + ComponentScatteredFeaturePieces.JunglePyramid componentscatteredfeaturepieces$junglepyramid = new ComponentScatteredFeaturePieces.JunglePyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(componentscatteredfeaturepieces$junglepyramid); + } + + this.updateBoundingBox(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java new file mode 100644 index 0000000..dd2ff33 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java @@ -0,0 +1,163 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenStronghold extends MapGenStructure +{ + private List field_151546_e; + private boolean ranBiomeCheck; + private ChunkCoordIntPair[] structureCoords; + private double field_82671_h; + private int field_82672_i; + + public MapGenStronghold() + { + this.structureCoords = new ChunkCoordIntPair[3]; + this.field_82671_h = 32.0D; + this.field_82672_i = 3; + this.field_151546_e = Lists.newArrayList(); + + for (BiomeGenBase biomegenbase : BiomeGenBase.getBiomeGenArray()) + { + if (biomegenbase != null && biomegenbase.minHeight > 0.0F) + { + this.field_151546_e.add(biomegenbase); + } + } + } + + public MapGenStronghold(Map p_i2068_1_) + { + this(); + + for (Entry entry : p_i2068_1_.entrySet()) + { + if (((String)entry.getKey()).equals("distance")) + { + this.field_82671_h = MathHelper.parseDoubleWithDefaultAndMax((String)entry.getValue(), this.field_82671_h, 1.0D); + } + else if (((String)entry.getKey()).equals("count")) + { + this.structureCoords = new ChunkCoordIntPair[MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.structureCoords.length, 1)]; + } + else if (((String)entry.getKey()).equals("spread")) + { + this.field_82672_i = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_82672_i, 1); + } + } + } + + public String getStructureName() + { + return "Stronghold"; + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + if (!this.ranBiomeCheck) + { + Random random = new Random(); + random.setSeed(this.worldObj.getSeed()); + double d0 = random.nextDouble() * Math.PI * 2.0D; + int i = 1; + + for (int j = 0; j < this.structureCoords.length; ++j) + { + double d1 = (1.25D * (double)i + random.nextDouble()) * this.field_82671_h * (double)i; + int k = (int)Math.round(Math.cos(d0) * d1); + int l = (int)Math.round(Math.sin(d0) * d1); + BlockPos blockpos = this.worldObj.getWorldChunkManager().findBiomePosition((k << 4) + 8, (l << 4) + 8, 112, this.field_151546_e, random); + + if (blockpos != null) + { + k = blockpos.getX() >> 4; + l = blockpos.getZ() >> 4; + } + + this.structureCoords[j] = new ChunkCoordIntPair(k, l); + d0 += (Math.PI * 2D) * (double)i / (double)this.field_82672_i; + + if (j == this.field_82672_i) + { + i += 2 + random.nextInt(5); + this.field_82672_i += 1 + random.nextInt(2); + } + } + + this.ranBiomeCheck = true; + } + + for (ChunkCoordIntPair chunkcoordintpair : this.structureCoords) + { + if (chunkX == chunkcoordintpair.chunkXPos && chunkZ == chunkcoordintpair.chunkZPos) + { + return true; + } + } + + return false; + } + + protected List getCoordList() + { + List list = Lists.newArrayList(); + + for (ChunkCoordIntPair chunkcoordintpair : this.structureCoords) + { + if (chunkcoordintpair != null) + { + list.add(chunkcoordintpair.getCenterBlock(64)); + } + } + + return list; + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + MapGenStronghold.Start mapgenstronghold$start; + + for (mapgenstronghold$start = new MapGenStronghold.Start(this.worldObj, this.rand, chunkX, chunkZ); mapgenstronghold$start.getComponents().isEmpty() || ((StructureStrongholdPieces.Stairs2)mapgenstronghold$start.getComponents().get(0)).strongholdPortalRoom == null; mapgenstronghold$start = new MapGenStronghold.Start(this.worldObj, this.rand, chunkX, chunkZ)) + { + ; + } + + return mapgenstronghold$start; + } + + public static class Start extends StructureStart + { + public Start() + { + } + + public Start(World worldIn, Random p_i2067_2_, int p_i2067_3_, int p_i2067_4_) + { + super(p_i2067_3_, p_i2067_4_); + StructureStrongholdPieces.prepareStructurePieces(); + StructureStrongholdPieces.Stairs2 structurestrongholdpieces$stairs2 = new StructureStrongholdPieces.Stairs2(0, p_i2067_2_, (p_i2067_3_ << 4) + 2, (p_i2067_4_ << 4) + 2); + this.components.add(structurestrongholdpieces$stairs2); + structurestrongholdpieces$stairs2.buildComponent(structurestrongholdpieces$stairs2, this.components, p_i2067_2_); + List list = structurestrongholdpieces$stairs2.field_75026_c; + + while (!list.isEmpty()) + { + int i = p_i2067_2_.nextInt(list.size()); + StructureComponent structurecomponent = (StructureComponent)list.remove(i); + structurecomponent.buildComponent(structurestrongholdpieces$stairs2, this.components, p_i2067_2_); + } + + this.updateBoundingBox(); + this.markAvailableHeight(worldIn, p_i2067_2_, 10); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java new file mode 100644 index 0000000..45cd050 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java @@ -0,0 +1,265 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.MapGenBase; + +public abstract class MapGenStructure extends MapGenBase +{ + private MapGenStructureData structureData; + protected Map structureMap = Maps.newHashMap(); + + public abstract String getStructureName(); + + protected final void recursiveGenerate(World worldIn, final int chunkX, final int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + { + this.initializeStructureData(worldIn); + + if (!this.structureMap.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ)))) + { + this.rand.nextInt(); + + try + { + if (this.canSpawnStructureAtCoords(chunkX, chunkZ)) + { + StructureStart structurestart = this.getStructureStart(chunkX, chunkZ); + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ)), structurestart); + this.setStructureStart(chunkX, chunkZ, structurestart); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception preparing structure feature"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Feature being prepared"); + crashreportcategory.addCrashSectionCallable("Is feature chunk", new Callable() + { + public String call() throws Exception + { + return MapGenStructure.this.canSpawnStructureAtCoords(chunkX, chunkZ) ? "True" : "False"; + } + }); + crashreportcategory.addCrashSection("Chunk location", String.format("%d,%d", new Object[] {Integer.valueOf(chunkX), Integer.valueOf(chunkZ)})); + crashreportcategory.addCrashSectionCallable("Chunk pos hash", new Callable() + { + public String call() throws Exception + { + return String.valueOf(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ)); + } + }); + crashreportcategory.addCrashSectionCallable("Structure type", new Callable() + { + public String call() throws Exception + { + return MapGenStructure.this.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + } + } + + public boolean generateStructure(World worldIn, Random randomIn, ChunkCoordIntPair chunkCoord) + { + this.initializeStructureData(worldIn); + int i = (chunkCoord.chunkXPos << 4) + 8; + int j = (chunkCoord.chunkZPos << 4) + 8; + boolean flag = false; + + for (StructureStart structurestart : this.structureMap.values()) + { + if (structurestart.isSizeableStructure() && structurestart.func_175788_a(chunkCoord) && structurestart.getBoundingBox().intersectsWith(i, j, i + 15, j + 15)) + { + structurestart.generateStructure(worldIn, randomIn, new StructureBoundingBox(i, j, i + 15, j + 15)); + structurestart.func_175787_b(chunkCoord); + flag = true; + this.setStructureStart(structurestart.getChunkPosX(), structurestart.getChunkPosZ(), structurestart); + } + } + + return flag; + } + + public boolean func_175795_b(BlockPos pos) + { + this.initializeStructureData(this.worldObj); + return this.func_175797_c(pos) != null; + } + + protected StructureStart func_175797_c(BlockPos pos) + { + label24: + + for (StructureStart structurestart : this.structureMap.values()) + { + if (structurestart.isSizeableStructure() && structurestart.getBoundingBox().isVecInside(pos)) + { + Iterator iterator = structurestart.getComponents().iterator(); + + while (true) + { + if (!iterator.hasNext()) + { + continue label24; + } + + StructureComponent structurecomponent = (StructureComponent)iterator.next(); + + if (structurecomponent.getBoundingBox().isVecInside(pos)) + { + break; + } + } + + return structurestart; + } + } + + return null; + } + + public boolean isPositionInStructure(World worldIn, BlockPos pos) + { + this.initializeStructureData(worldIn); + + for (StructureStart structurestart : this.structureMap.values()) + { + if (structurestart.isSizeableStructure() && structurestart.getBoundingBox().isVecInside(pos)) + { + return true; + } + } + + return false; + } + + public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos) + { + this.worldObj = worldIn; + this.initializeStructureData(worldIn); + this.rand.setSeed(worldIn.getSeed()); + long i = this.rand.nextLong(); + long j = this.rand.nextLong(); + long k = (long)(pos.getX() >> 4) * i; + long l = (long)(pos.getZ() >> 4) * j; + this.rand.setSeed(k ^ l ^ worldIn.getSeed()); + this.recursiveGenerate(worldIn, pos.getX() >> 4, pos.getZ() >> 4, 0, 0, (ChunkPrimer)null); + double d0 = Double.MAX_VALUE; + BlockPos blockpos = null; + + for (StructureStart structurestart : this.structureMap.values()) + { + if (structurestart.isSizeableStructure()) + { + StructureComponent structurecomponent = (StructureComponent)structurestart.getComponents().get(0); + BlockPos blockpos1 = structurecomponent.getBoundingBoxCenter(); + double d1 = blockpos1.distanceSq(pos); + + if (d1 < d0) + { + d0 = d1; + blockpos = blockpos1; + } + } + } + + if (blockpos != null) + { + return blockpos; + } + else + { + List list = this.getCoordList(); + + if (list != null) + { + BlockPos blockpos2 = null; + + for (BlockPos blockpos3 : list) + { + double d2 = blockpos3.distanceSq(pos); + + if (d2 < d0) + { + d0 = d2; + blockpos2 = blockpos3; + } + } + + return blockpos2; + } + else + { + return null; + } + } + } + + protected List getCoordList() + { + return null; + } + + private void initializeStructureData(World worldIn) + { + if (this.structureData == null) + { + this.structureData = (MapGenStructureData)worldIn.loadItemData(MapGenStructureData.class, this.getStructureName()); + + if (this.structureData == null) + { + this.structureData = new MapGenStructureData(this.getStructureName()); + worldIn.setItemData(this.getStructureName(), this.structureData); + } + else + { + NBTTagCompound nbttagcompound = this.structureData.getTagCompound(); + + for (String s : nbttagcompound.getKeySet()) + { + NBTBase nbtbase = nbttagcompound.getTag(s); + + if (nbtbase.getId() == 10) + { + NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbtbase; + + if (nbttagcompound1.hasKey("ChunkX") && nbttagcompound1.hasKey("ChunkZ")) + { + int i = nbttagcompound1.getInteger("ChunkX"); + int j = nbttagcompound1.getInteger("ChunkZ"); + StructureStart structurestart = MapGenStructureIO.getStructureStart(nbttagcompound1, worldIn); + + if (structurestart != null) + { + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)), structurestart); + } + } + } + } + } + } + } + + private void setStructureStart(int chunkX, int chunkZ, StructureStart start) + { + this.structureData.writeInstance(start.writeStructureComponentsToNBT(chunkX, chunkZ), chunkX, chunkZ); + this.structureData.markDirty(); + } + + protected abstract boolean canSpawnStructureAtCoords(int chunkX, int chunkZ); + + protected abstract StructureStart getStructureStart(int chunkX, int chunkZ); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java new file mode 100644 index 0000000..8854eb2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java @@ -0,0 +1,39 @@ +package net.minecraft.world.gen.structure; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldSavedData; + +public class MapGenStructureData extends WorldSavedData +{ + private NBTTagCompound tagCompound = new NBTTagCompound(); + + public MapGenStructureData(String name) + { + super(name); + } + + public void readFromNBT(NBTTagCompound nbt) + { + this.tagCompound = nbt.getCompoundTag("Features"); + } + + public void writeToNBT(NBTTagCompound nbt) + { + nbt.setTag("Features", this.tagCompound); + } + + public void writeInstance(NBTTagCompound tagCompoundIn, int chunkX, int chunkZ) + { + this.tagCompound.setTag(formatChunkCoords(chunkX, chunkZ), tagCompoundIn); + } + + public static String formatChunkCoords(int chunkX, int chunkZ) + { + return "[" + chunkX + "," + chunkZ + "]"; + } + + public NBTTagCompound getTagCompound() + { + return this.tagCompound; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java new file mode 100644 index 0000000..ef14dab --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java @@ -0,0 +1,117 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class MapGenStructureIO +{ + private static final Logger logger = LogManager.getLogger(); + private static Map < String, Class > startNameToClassMap = Maps. < String, Class > newHashMap(); + private static Map < Class , String > startClassToNameMap = Maps. < Class , String > newHashMap(); + private static Map < String, Class > componentNameToClassMap = Maps. < String, Class > newHashMap(); + private static Map < Class , String > componentClassToNameMap = Maps. < Class , String > newHashMap(); + + private static void registerStructure(Class startClass, String structureName) + { + startNameToClassMap.put(structureName, startClass); + startClassToNameMap.put(startClass, structureName); + } + + static void registerStructureComponent(Class componentClass, String componentName) + { + componentNameToClassMap.put(componentName, componentClass); + componentClassToNameMap.put(componentClass, componentName); + } + + public static String getStructureStartName(StructureStart start) + { + return (String)startClassToNameMap.get(start.getClass()); + } + + public static String getStructureComponentName(StructureComponent component) + { + return (String)componentClassToNameMap.get(component.getClass()); + } + + public static StructureStart getStructureStart(NBTTagCompound tagCompound, World worldIn) + { + StructureStart structurestart = null; + + try + { + Class oclass = (Class)startNameToClassMap.get(tagCompound.getString("id")); + + if (oclass != null) + { + structurestart = (StructureStart)oclass.newInstance(); + } + } + catch (Exception exception) + { + logger.warn("Failed Start with id " + tagCompound.getString("id")); + exception.printStackTrace(); + } + + if (structurestart != null) + { + structurestart.readStructureComponentsFromNBT(worldIn, tagCompound); + } + else + { + logger.warn("Skipping Structure with id " + tagCompound.getString("id")); + } + + return structurestart; + } + + public static StructureComponent getStructureComponent(NBTTagCompound tagCompound, World worldIn) + { + StructureComponent structurecomponent = null; + + try + { + Class oclass = (Class)componentNameToClassMap.get(tagCompound.getString("id")); + + if (oclass != null) + { + structurecomponent = (StructureComponent)oclass.newInstance(); + } + } + catch (Exception exception) + { + logger.warn("Failed Piece with id " + tagCompound.getString("id")); + exception.printStackTrace(); + } + + if (structurecomponent != null) + { + structurecomponent.readStructureBaseNBT(worldIn, tagCompound); + } + else + { + logger.warn("Skipping Piece with id " + tagCompound.getString("id")); + } + + return structurecomponent; + } + + static + { + registerStructure(StructureMineshaftStart.class, "Mineshaft"); + registerStructure(MapGenVillage.Start.class, "Village"); + registerStructure(MapGenNetherBridge.Start.class, "Fortress"); + registerStructure(MapGenStronghold.Start.class, "Stronghold"); + registerStructure(MapGenScatteredFeature.Start.class, "Temple"); + registerStructure(StructureOceanMonument.StartMonument.class, "Monument"); + StructureMineshaftPieces.registerStructurePieces(); + StructureVillagePieces.registerVillagePieces(); + StructureNetherBridgePieces.registerNetherFortressPieces(); + StructureStrongholdPieces.registerStrongholdPieces(); + ComponentScatteredFeaturePieces.registerScatteredFeaturePieces(); + StructureOceanMonumentPieces.registerOceanMonumentPieces(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java new file mode 100644 index 0000000..6a422b6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java @@ -0,0 +1,154 @@ +package net.minecraft.world.gen.structure; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenVillage extends MapGenStructure +{ + public static final List villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.savanna}); + private int terrainType; + private int field_82665_g; + private int field_82666_h; + + public MapGenVillage() + { + this.field_82665_g = 32; + this.field_82666_h = 8; + } + + public MapGenVillage(Map p_i2093_1_) + { + this(); + + for (Entry entry : p_i2093_1_.entrySet()) + { + if (((String)entry.getKey()).equals("size")) + { + this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.terrainType, 0); + } + else if (((String)entry.getKey()).equals("distance")) + { + this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_82665_g, this.field_82666_h + 1); + } + } + } + + public String getStructureName() + { + return "Village"; + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + int i = chunkX; + int j = chunkZ; + + if (chunkX < 0) + { + chunkX -= this.field_82665_g - 1; + } + + if (chunkZ < 0) + { + chunkZ -= this.field_82665_g - 1; + } + + int k = chunkX / this.field_82665_g; + int l = chunkZ / this.field_82665_g; + Random random = this.worldObj.setRandomSeed(k, l, 10387312); + k = k * this.field_82665_g; + l = l * this.field_82665_g; + k = k + random.nextInt(this.field_82665_g - this.field_82666_h); + l = l + random.nextInt(this.field_82665_g - this.field_82666_h); + + if (i == k && j == l) + { + boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(i * 16 + 8, j * 16 + 8, 0, villageSpawnBiomes); + + if (flag) + { + return true; + } + } + + return false; + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + return new MapGenVillage.Start(this.worldObj, this.rand, chunkX, chunkZ, this.terrainType); + } + + public static class Start extends StructureStart + { + private boolean hasMoreThanTwoComponents; + + public Start() + { + } + + public Start(World worldIn, Random rand, int x, int z, int size) + { + super(x, z); + List list = StructureVillagePieces.getStructureVillageWeightedPieceList(rand, size); + StructureVillagePieces.Start structurevillagepieces$start = new StructureVillagePieces.Start(worldIn.getWorldChunkManager(), 0, rand, (x << 4) + 2, (z << 4) + 2, list, size); + this.components.add(structurevillagepieces$start); + structurevillagepieces$start.buildComponent(structurevillagepieces$start, this.components, rand); + List list1 = structurevillagepieces$start.field_74930_j; + List list2 = structurevillagepieces$start.field_74932_i; + + while (!list1.isEmpty() || !list2.isEmpty()) + { + if (list1.isEmpty()) + { + int i = rand.nextInt(list2.size()); + StructureComponent structurecomponent = (StructureComponent)list2.remove(i); + structurecomponent.buildComponent(structurevillagepieces$start, this.components, rand); + } + else + { + int j = rand.nextInt(list1.size()); + StructureComponent structurecomponent2 = (StructureComponent)list1.remove(j); + structurecomponent2.buildComponent(structurevillagepieces$start, this.components, rand); + } + } + + this.updateBoundingBox(); + int k = 0; + + for (StructureComponent structurecomponent1 : this.components) + { + if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) + { + ++k; + } + } + + this.hasMoreThanTwoComponents = k > 2; + } + + public boolean isSizeableStructure() + { + return this.hasMoreThanTwoComponents; + } + + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + tagCompound.setBoolean("Valid", this.hasMoreThanTwoComponents); + } + + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + this.hasMoreThanTwoComponents = tagCompound.getBoolean("Valid"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java new file mode 100644 index 0000000..e464aeb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java @@ -0,0 +1,175 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.base.Objects; +import net.minecraft.nbt.NBTTagIntArray; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3i; + +public class StructureBoundingBox +{ + public int minX; + public int minY; + public int minZ; + public int maxX; + public int maxY; + public int maxZ; + + public StructureBoundingBox() + { + } + + public StructureBoundingBox(int[] coords) + { + if (coords.length == 6) + { + this.minX = coords[0]; + this.minY = coords[1]; + this.minZ = coords[2]; + this.maxX = coords[3]; + this.maxY = coords[4]; + this.maxZ = coords[5]; + } + } + + public static StructureBoundingBox getNewBoundingBox() + { + return new StructureBoundingBox(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); + } + + public static StructureBoundingBox getComponentToAddBoundingBox(int p_175897_0_, int p_175897_1_, int p_175897_2_, int p_175897_3_, int p_175897_4_, int p_175897_5_, int p_175897_6_, int p_175897_7_, int p_175897_8_, EnumFacing p_175897_9_) + { + switch (p_175897_9_) + { + case NORTH: + return new StructureBoundingBox(p_175897_0_ + p_175897_3_, p_175897_1_ + p_175897_4_, p_175897_2_ - p_175897_8_ + 1 + p_175897_5_, p_175897_0_ + p_175897_6_ - 1 + p_175897_3_, p_175897_1_ + p_175897_7_ - 1 + p_175897_4_, p_175897_2_ + p_175897_5_); + + case SOUTH: + return new StructureBoundingBox(p_175897_0_ + p_175897_3_, p_175897_1_ + p_175897_4_, p_175897_2_ + p_175897_5_, p_175897_0_ + p_175897_6_ - 1 + p_175897_3_, p_175897_1_ + p_175897_7_ - 1 + p_175897_4_, p_175897_2_ + p_175897_8_ - 1 + p_175897_5_); + + case WEST: + return new StructureBoundingBox(p_175897_0_ - p_175897_8_ + 1 + p_175897_5_, p_175897_1_ + p_175897_4_, p_175897_2_ + p_175897_3_, p_175897_0_ + p_175897_5_, p_175897_1_ + p_175897_7_ - 1 + p_175897_4_, p_175897_2_ + p_175897_6_ - 1 + p_175897_3_); + + case EAST: + return new StructureBoundingBox(p_175897_0_ + p_175897_5_, p_175897_1_ + p_175897_4_, p_175897_2_ + p_175897_3_, p_175897_0_ + p_175897_8_ - 1 + p_175897_5_, p_175897_1_ + p_175897_7_ - 1 + p_175897_4_, p_175897_2_ + p_175897_6_ - 1 + p_175897_3_); + + default: + return new StructureBoundingBox(p_175897_0_ + p_175897_3_, p_175897_1_ + p_175897_4_, p_175897_2_ + p_175897_5_, p_175897_0_ + p_175897_6_ - 1 + p_175897_3_, p_175897_1_ + p_175897_7_ - 1 + p_175897_4_, p_175897_2_ + p_175897_8_ - 1 + p_175897_5_); + } + } + + public static StructureBoundingBox func_175899_a(int p_175899_0_, int p_175899_1_, int p_175899_2_, int p_175899_3_, int p_175899_4_, int p_175899_5_) + { + return new StructureBoundingBox(Math.min(p_175899_0_, p_175899_3_), Math.min(p_175899_1_, p_175899_4_), Math.min(p_175899_2_, p_175899_5_), Math.max(p_175899_0_, p_175899_3_), Math.max(p_175899_1_, p_175899_4_), Math.max(p_175899_2_, p_175899_5_)); + } + + public StructureBoundingBox(StructureBoundingBox structurebb) + { + this.minX = structurebb.minX; + this.minY = structurebb.minY; + this.minZ = structurebb.minZ; + this.maxX = structurebb.maxX; + this.maxY = structurebb.maxY; + this.maxZ = structurebb.maxZ; + } + + public StructureBoundingBox(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax) + { + this.minX = xMin; + this.minY = yMin; + this.minZ = zMin; + this.maxX = xMax; + this.maxY = yMax; + this.maxZ = zMax; + } + + public StructureBoundingBox(Vec3i vec1, Vec3i vec2) + { + this.minX = Math.min(vec1.getX(), vec2.getX()); + this.minY = Math.min(vec1.getY(), vec2.getY()); + this.minZ = Math.min(vec1.getZ(), vec2.getZ()); + this.maxX = Math.max(vec1.getX(), vec2.getX()); + this.maxY = Math.max(vec1.getY(), vec2.getY()); + this.maxZ = Math.max(vec1.getZ(), vec2.getZ()); + } + + public StructureBoundingBox(int xMin, int zMin, int xMax, int zMax) + { + this.minX = xMin; + this.minZ = zMin; + this.maxX = xMax; + this.maxZ = zMax; + this.minY = 1; + this.maxY = 512; + } + + public boolean intersectsWith(StructureBoundingBox structurebb) + { + return this.maxX >= structurebb.minX && this.minX <= structurebb.maxX && this.maxZ >= structurebb.minZ && this.minZ <= structurebb.maxZ && this.maxY >= structurebb.minY && this.minY <= structurebb.maxY; + } + + public boolean intersectsWith(int minXIn, int minZIn, int maxXIn, int maxZIn) + { + return this.maxX >= minXIn && this.minX <= maxXIn && this.maxZ >= minZIn && this.minZ <= maxZIn; + } + + public void expandTo(StructureBoundingBox sbb) + { + this.minX = Math.min(this.minX, sbb.minX); + this.minY = Math.min(this.minY, sbb.minY); + this.minZ = Math.min(this.minZ, sbb.minZ); + this.maxX = Math.max(this.maxX, sbb.maxX); + this.maxY = Math.max(this.maxY, sbb.maxY); + this.maxZ = Math.max(this.maxZ, sbb.maxZ); + } + + public void offset(int x, int y, int z) + { + this.minX += x; + this.minY += y; + this.minZ += z; + this.maxX += x; + this.maxY += y; + this.maxZ += z; + } + + public boolean isVecInside(Vec3i vec) + { + return vec.getX() >= this.minX && vec.getX() <= this.maxX && vec.getZ() >= this.minZ && vec.getZ() <= this.maxZ && vec.getY() >= this.minY && vec.getY() <= this.maxY; + } + + public Vec3i func_175896_b() + { + return new Vec3i(this.maxX - this.minX, this.maxY - this.minY, this.maxZ - this.minZ); + } + + public int getXSize() + { + return this.maxX - this.minX + 1; + } + + public int getYSize() + { + return this.maxY - this.minY + 1; + } + + public int getZSize() + { + return this.maxZ - this.minZ + 1; + } + + public Vec3i getCenter() + { + return new BlockPos(this.minX + (this.maxX - this.minX + 1) / 2, this.minY + (this.maxY - this.minY + 1) / 2, this.minZ + (this.maxZ - this.minZ + 1) / 2); + } + + public String toString() + { + return Objects.toStringHelper(this).add("x0", this.minX).add("y0", this.minY).add("z0", this.minZ).add("x1", this.maxX).add("y1", this.maxY).add("z1", this.maxZ).toString(); + } + + public NBTTagIntArray toNBTTagIntArray() + { + return new NBTTagIntArray(new int[] {this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ}); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureComponent.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureComponent.java new file mode 100644 index 0000000..0d8186e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureComponent.java @@ -0,0 +1,793 @@ +package net.minecraft.world.gen.structure; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDoor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public abstract class StructureComponent +{ + protected StructureBoundingBox boundingBox; + protected EnumFacing coordBaseMode; + protected int componentType; + + public StructureComponent() + { + } + + protected StructureComponent(int type) + { + this.componentType = type; + } + + public NBTTagCompound createStructureBaseNBT() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("id", MapGenStructureIO.getStructureComponentName(this)); + nbttagcompound.setTag("BB", this.boundingBox.toNBTTagIntArray()); + nbttagcompound.setInteger("O", this.coordBaseMode == null ? -1 : this.coordBaseMode.getHorizontalIndex()); + nbttagcompound.setInteger("GD", this.componentType); + this.writeStructureToNBT(nbttagcompound); + return nbttagcompound; + } + + protected abstract void writeStructureToNBT(NBTTagCompound tagCompound); + + public void readStructureBaseNBT(World worldIn, NBTTagCompound tagCompound) + { + if (tagCompound.hasKey("BB")) + { + this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB")); + } + + int i = tagCompound.getInteger("O"); + this.coordBaseMode = i == -1 ? null : EnumFacing.getHorizontal(i); + this.componentType = tagCompound.getInteger("GD"); + this.readStructureFromNBT(tagCompound); + } + + protected abstract void readStructureFromNBT(NBTTagCompound tagCompound); + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + } + + public abstract boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn); + + public StructureBoundingBox getBoundingBox() + { + return this.boundingBox; + } + + public int getComponentType() + { + return this.componentType; + } + + public static StructureComponent findIntersecting(List listIn, StructureBoundingBox boundingboxIn) + { + for (StructureComponent structurecomponent : listIn) + { + if (structurecomponent.getBoundingBox() != null && structurecomponent.getBoundingBox().intersectsWith(boundingboxIn)) + { + return structurecomponent; + } + } + + return null; + } + + public BlockPos getBoundingBoxCenter() + { + return new BlockPos(this.boundingBox.getCenter()); + } + + protected boolean isLiquidInStructureBoundingBox(World worldIn, StructureBoundingBox boundingboxIn) + { + int i = Math.max(this.boundingBox.minX - 1, boundingboxIn.minX); + int j = Math.max(this.boundingBox.minY - 1, boundingboxIn.minY); + int k = Math.max(this.boundingBox.minZ - 1, boundingboxIn.minZ); + int l = Math.min(this.boundingBox.maxX + 1, boundingboxIn.maxX); + int i1 = Math.min(this.boundingBox.maxY + 1, boundingboxIn.maxY); + int j1 = Math.min(this.boundingBox.maxZ + 1, boundingboxIn.maxZ); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k1 = i; k1 <= l; ++k1) + { + for (int l1 = k; l1 <= j1; ++l1) + { + if (worldIn.getBlockState(blockpos$mutableblockpos.set(k1, j, l1)).getBlock().getMaterial().isLiquid()) + { + return true; + } + + if (worldIn.getBlockState(blockpos$mutableblockpos.set(k1, i1, l1)).getBlock().getMaterial().isLiquid()) + { + return true; + } + } + } + + for (int i2 = i; i2 <= l; ++i2) + { + for (int k2 = j; k2 <= i1; ++k2) + { + if (worldIn.getBlockState(blockpos$mutableblockpos.set(i2, k2, k)).getBlock().getMaterial().isLiquid()) + { + return true; + } + + if (worldIn.getBlockState(blockpos$mutableblockpos.set(i2, k2, j1)).getBlock().getMaterial().isLiquid()) + { + return true; + } + } + } + + for (int j2 = k; j2 <= j1; ++j2) + { + for (int l2 = j; l2 <= i1; ++l2) + { + if (worldIn.getBlockState(blockpos$mutableblockpos.set(i, l2, j2)).getBlock().getMaterial().isLiquid()) + { + return true; + } + + if (worldIn.getBlockState(blockpos$mutableblockpos.set(l, l2, j2)).getBlock().getMaterial().isLiquid()) + { + return true; + } + } + } + + return false; + } + + protected int getXWithOffset(int x, int z) + { + if (this.coordBaseMode == null) + { + return x; + } + else + { + switch (this.coordBaseMode) + { + case NORTH: + case SOUTH: + return this.boundingBox.minX + x; + + case WEST: + return this.boundingBox.maxX - z; + + case EAST: + return this.boundingBox.minX + z; + + default: + return x; + } + } + } + + protected int getYWithOffset(int y) + { + return this.coordBaseMode == null ? y : y + this.boundingBox.minY; + } + + protected int getZWithOffset(int x, int z) + { + if (this.coordBaseMode == null) + { + return z; + } + else + { + switch (this.coordBaseMode) + { + case NORTH: + return this.boundingBox.maxZ - z; + + case SOUTH: + return this.boundingBox.minZ + z; + + case WEST: + case EAST: + return this.boundingBox.minZ + x; + + default: + return z; + } + } + } + + protected int getMetadataWithOffset(Block blockIn, int meta) + { + if (blockIn == Blocks.rail) + { + if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.EAST) + { + if (meta == 1) + { + return 0; + } + + return 1; + } + } + else if (blockIn instanceof BlockDoor) + { + if (this.coordBaseMode == EnumFacing.SOUTH) + { + if (meta == 0) + { + return 2; + } + + if (meta == 2) + { + return 0; + } + } + else + { + if (this.coordBaseMode == EnumFacing.WEST) + { + return meta + 1 & 3; + } + + if (this.coordBaseMode == EnumFacing.EAST) + { + return meta + 3 & 3; + } + } + } + else if (blockIn != Blocks.stone_stairs && blockIn != Blocks.oak_stairs && blockIn != Blocks.nether_brick_stairs && blockIn != Blocks.stone_brick_stairs && blockIn != Blocks.sandstone_stairs) + { + if (blockIn == Blocks.ladder) + { + if (this.coordBaseMode == EnumFacing.SOUTH) + { + if (meta == EnumFacing.NORTH.getIndex()) + { + return EnumFacing.SOUTH.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) + { + return EnumFacing.NORTH.getIndex(); + } + } + else if (this.coordBaseMode == EnumFacing.WEST) + { + if (meta == EnumFacing.NORTH.getIndex()) + { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) + { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) + { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) + { + return EnumFacing.SOUTH.getIndex(); + } + } + else if (this.coordBaseMode == EnumFacing.EAST) + { + if (meta == EnumFacing.NORTH.getIndex()) + { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) + { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) + { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) + { + return EnumFacing.SOUTH.getIndex(); + } + } + } + else if (blockIn == Blocks.stone_button) + { + if (this.coordBaseMode == EnumFacing.SOUTH) + { + if (meta == 3) + { + return 4; + } + + if (meta == 4) + { + return 3; + } + } + else if (this.coordBaseMode == EnumFacing.WEST) + { + if (meta == 3) + { + return 1; + } + + if (meta == 4) + { + return 2; + } + + if (meta == 2) + { + return 3; + } + + if (meta == 1) + { + return 4; + } + } + else if (this.coordBaseMode == EnumFacing.EAST) + { + if (meta == 3) + { + return 2; + } + + if (meta == 4) + { + return 1; + } + + if (meta == 2) + { + return 3; + } + + if (meta == 1) + { + return 4; + } + } + } + else if (blockIn != Blocks.tripwire_hook && !(blockIn instanceof BlockDirectional)) + { + if (blockIn == Blocks.piston || blockIn == Blocks.sticky_piston || blockIn == Blocks.lever || blockIn == Blocks.dispenser) + { + if (this.coordBaseMode == EnumFacing.SOUTH) + { + if (meta == EnumFacing.NORTH.getIndex() || meta == EnumFacing.SOUTH.getIndex()) + { + return EnumFacing.getFront(meta).getOpposite().getIndex(); + } + } + else if (this.coordBaseMode == EnumFacing.WEST) + { + if (meta == EnumFacing.NORTH.getIndex()) + { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) + { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) + { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) + { + return EnumFacing.SOUTH.getIndex(); + } + } + else if (this.coordBaseMode == EnumFacing.EAST) + { + if (meta == EnumFacing.NORTH.getIndex()) + { + return EnumFacing.EAST.getIndex(); + } + + if (meta == EnumFacing.SOUTH.getIndex()) + { + return EnumFacing.WEST.getIndex(); + } + + if (meta == EnumFacing.WEST.getIndex()) + { + return EnumFacing.NORTH.getIndex(); + } + + if (meta == EnumFacing.EAST.getIndex()) + { + return EnumFacing.SOUTH.getIndex(); + } + } + } + } + else + { + EnumFacing enumfacing = EnumFacing.getHorizontal(meta); + + if (this.coordBaseMode == EnumFacing.SOUTH) + { + if (enumfacing == EnumFacing.SOUTH || enumfacing == EnumFacing.NORTH) + { + return enumfacing.getOpposite().getHorizontalIndex(); + } + } + else if (this.coordBaseMode == EnumFacing.WEST) + { + if (enumfacing == EnumFacing.NORTH) + { + return EnumFacing.WEST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.SOUTH) + { + return EnumFacing.EAST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.WEST) + { + return EnumFacing.NORTH.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.EAST) + { + return EnumFacing.SOUTH.getHorizontalIndex(); + } + } + else if (this.coordBaseMode == EnumFacing.EAST) + { + if (enumfacing == EnumFacing.NORTH) + { + return EnumFacing.EAST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.SOUTH) + { + return EnumFacing.WEST.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.WEST) + { + return EnumFacing.NORTH.getHorizontalIndex(); + } + + if (enumfacing == EnumFacing.EAST) + { + return EnumFacing.SOUTH.getHorizontalIndex(); + } + } + } + } + else if (this.coordBaseMode == EnumFacing.SOUTH) + { + if (meta == 2) + { + return 3; + } + + if (meta == 3) + { + return 2; + } + } + else if (this.coordBaseMode == EnumFacing.WEST) + { + if (meta == 0) + { + return 2; + } + + if (meta == 1) + { + return 3; + } + + if (meta == 2) + { + return 0; + } + + if (meta == 3) + { + return 1; + } + } + else if (this.coordBaseMode == EnumFacing.EAST) + { + if (meta == 0) + { + return 2; + } + + if (meta == 1) + { + return 3; + } + + if (meta == 2) + { + return 1; + } + + if (meta == 3) + { + return 0; + } + } + + return meta; + } + + protected void setBlockState(World worldIn, IBlockState blockstateIn, int x, int y, int z, StructureBoundingBox boundingboxIn) + { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + + if (boundingboxIn.isVecInside(blockpos)) + { + worldIn.setBlockState(blockpos, blockstateIn, 2); + } + } + + protected IBlockState getBlockStateFromPos(World worldIn, int x, int y, int z, StructureBoundingBox boundingboxIn) + { + int i = this.getXWithOffset(x, z); + int j = this.getYWithOffset(y); + int k = this.getZWithOffset(x, z); + BlockPos blockpos = new BlockPos(i, j, k); + return !boundingboxIn.isVecInside(blockpos) ? Blocks.air.getDefaultState() : worldIn.getBlockState(blockpos); + } + + protected void fillWithAir(World worldIn, StructureBoundingBox structurebb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) + { + for (int i = minY; i <= maxY; ++i) + { + for (int j = minX; j <= maxX; ++j) + { + for (int k = minZ; k <= maxZ; ++k) + { + this.setBlockState(worldIn, Blocks.air.getDefaultState(), j, i, k, structurebb); + } + } + } + } + + protected void fillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, IBlockState boundaryBlockState, IBlockState insideBlockState, boolean existingOnly) + { + for (int i = yMin; i <= yMax; ++i) + { + for (int j = xMin; j <= xMax; ++j) + { + for (int k = zMin; k <= zMax; ++k) + { + if (!existingOnly || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air) + { + if (i != yMin && i != yMax && j != xMin && j != xMax && k != zMin && k != zMax) + { + this.setBlockState(worldIn, insideBlockState, j, i, k, boundingboxIn); + } + else + { + this.setBlockState(worldIn, boundaryBlockState, j, i, k, boundingboxIn); + } + } + } + } + } + } + + protected void fillWithRandomizedBlocks(World worldIn, StructureBoundingBox boundingboxIn, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean alwaysReplace, Random rand, StructureComponent.BlockSelector blockselector) + { + for (int i = minY; i <= maxY; ++i) + { + for (int j = minX; j <= maxX; ++j) + { + for (int k = minZ; k <= maxZ; ++k) + { + if (!alwaysReplace || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air) + { + blockselector.selectBlocks(rand, j, i, k, i == minY || i == maxY || j == minX || j == maxX || k == minZ || k == maxZ); + this.setBlockState(worldIn, blockselector.getBlockState(), j, i, k, boundingboxIn); + } + } + } + } + } + + protected void func_175805_a(World worldIn, StructureBoundingBox boundingboxIn, Random rand, float chance, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, IBlockState blockstate1, IBlockState blockstate2, boolean p_175805_13_) + { + for (int i = minY; i <= maxY; ++i) + { + for (int j = minX; j <= maxX; ++j) + { + for (int k = minZ; k <= maxZ; ++k) + { + if (rand.nextFloat() <= chance && (!p_175805_13_ || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air)) + { + if (i != minY && i != maxY && j != minX && j != maxX && k != minZ && k != maxZ) + { + this.setBlockState(worldIn, blockstate2, j, i, k, boundingboxIn); + } + else + { + this.setBlockState(worldIn, blockstate1, j, i, k, boundingboxIn); + } + } + } + } + } + } + + protected void randomlyPlaceBlock(World worldIn, StructureBoundingBox boundingboxIn, Random rand, float chance, int x, int y, int z, IBlockState blockstateIn) + { + if (rand.nextFloat() < chance) + { + this.setBlockState(worldIn, blockstateIn, x, y, z, boundingboxIn); + } + } + + protected void randomlyRareFillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, IBlockState blockstateIn, boolean p_180777_10_) + { + float f = (float)(maxX - minX + 1); + float f1 = (float)(maxY - minY + 1); + float f2 = (float)(maxZ - minZ + 1); + float f3 = (float)minX + f / 2.0F; + float f4 = (float)minZ + f2 / 2.0F; + + for (int i = minY; i <= maxY; ++i) + { + float f5 = (float)(i - minY) / f1; + + for (int j = minX; j <= maxX; ++j) + { + float f6 = ((float)j - f3) / (f * 0.5F); + + for (int k = minZ; k <= maxZ; ++k) + { + float f7 = ((float)k - f4) / (f2 * 0.5F); + + if (!p_180777_10_ || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getBlock().getMaterial() != Material.air) + { + float f8 = f6 * f6 + f5 * f5 + f7 * f7; + + if (f8 <= 1.05F) + { + this.setBlockState(worldIn, blockstateIn, j, i, k, boundingboxIn); + } + } + } + } + } + } + + protected void clearCurrentPositionBlocksUpwards(World worldIn, int x, int y, int z, StructureBoundingBox structurebb) + { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + + if (structurebb.isVecInside(blockpos)) + { + while (!worldIn.isAirBlock(blockpos) && blockpos.getY() < 255) + { + worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2); + blockpos = blockpos.up(); + } + } + } + + protected void replaceAirAndLiquidDownwards(World worldIn, IBlockState blockstateIn, int x, int y, int z, StructureBoundingBox boundingboxIn) + { + int i = this.getXWithOffset(x, z); + int j = this.getYWithOffset(y); + int k = this.getZWithOffset(x, z); + + if (boundingboxIn.isVecInside(new BlockPos(i, j, k))) + { + while ((worldIn.isAirBlock(new BlockPos(i, j, k)) || worldIn.getBlockState(new BlockPos(i, j, k)).getBlock().getMaterial().isLiquid()) && j > 1) + { + worldIn.setBlockState(new BlockPos(i, j, k), blockstateIn, 2); + --j; + } + } + } + + protected boolean generateChestContents(World worldIn, StructureBoundingBox boundingBoxIn, Random rand, int x, int y, int z, List listIn, int max) + { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + + if (boundingBoxIn.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getBlock() != Blocks.chest) + { + IBlockState iblockstate = Blocks.chest.getDefaultState(); + worldIn.setBlockState(blockpos, Blocks.chest.correctFacing(worldIn, blockpos, iblockstate), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityChest) + { + WeightedRandomChestContent.generateChestContents(rand, listIn, (TileEntityChest)tileentity, max); + } + + return true; + } + else + { + return false; + } + } + + protected boolean generateDispenserContents(World worldIn, StructureBoundingBox boundingBoxIn, Random rand, int x, int y, int z, int meta, List listIn, int max) + { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + + if (boundingBoxIn.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getBlock() != Blocks.dispenser) + { + worldIn.setBlockState(blockpos, Blocks.dispenser.getStateFromMeta(this.getMetadataWithOffset(Blocks.dispenser, meta)), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityDispenser) + { + WeightedRandomChestContent.generateDispenserContents(rand, listIn, (TileEntityDispenser)tileentity, max); + } + + return true; + } + else + { + return false; + } + } + + protected void placeDoorCurrentPosition(World worldIn, StructureBoundingBox boundingBoxIn, Random rand, int x, int y, int z, EnumFacing facing) + { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + + if (boundingBoxIn.isVecInside(blockpos)) + { + ItemDoor.placeDoor(worldIn, blockpos, facing.rotateYCCW(), Blocks.oak_door); + } + } + + public void func_181138_a(int p_181138_1_, int p_181138_2_, int p_181138_3_) + { + this.boundingBox.offset(p_181138_1_, p_181138_2_, p_181138_3_); + } + + public abstract static class BlockSelector + { + protected IBlockState blockstate = Blocks.air.getDefaultState(); + + public abstract void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_); + + public IBlockState getBlockState() + { + return this.blockstate; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java new file mode 100644 index 0000000..6ef7cd1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java @@ -0,0 +1,832 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +@SuppressWarnings("incomplete-switch") +public class StructureMineshaftPieces +{ + private static final List CHEST_CONTENT_WEIGHT_LIST = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.dye, EnumDyeColor.BLUE.getDyeDamage(), 4, 9, 5), new WeightedRandomChestContent(Items.diamond, 0, 1, 2, 3), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.rail), 0, 4, 8, 1), new WeightedRandomChestContent(Items.melon_seeds, 0, 2, 4, 10), new WeightedRandomChestContent(Items.pumpkin_seeds, 0, 2, 4, 10), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1)}); + + public static void registerStructurePieces() + { + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Corridor.class, "MSCorridor"); + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Cross.class, "MSCrossing"); + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Room.class, "MSRoom"); + MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Stairs.class, "MSStairs"); + } + + private static StructureComponent func_175892_a(List listIn, Random rand, int x, int y, int z, EnumFacing facing, int type) + { + int i = rand.nextInt(100); + + if (i >= 80) + { + StructureBoundingBox structureboundingbox = StructureMineshaftPieces.Cross.func_175813_a(listIn, rand, x, y, z, facing); + + if (structureboundingbox != null) + { + return new StructureMineshaftPieces.Cross(type, rand, structureboundingbox, facing); + } + } + else if (i >= 70) + { + StructureBoundingBox structureboundingbox1 = StructureMineshaftPieces.Stairs.func_175812_a(listIn, rand, x, y, z, facing); + + if (structureboundingbox1 != null) + { + return new StructureMineshaftPieces.Stairs(type, rand, structureboundingbox1, facing); + } + } + else + { + StructureBoundingBox structureboundingbox2 = StructureMineshaftPieces.Corridor.func_175814_a(listIn, rand, x, y, z, facing); + + if (structureboundingbox2 != null) + { + return new StructureMineshaftPieces.Corridor(type, rand, structureboundingbox2, facing); + } + } + + return null; + } + + private static StructureComponent func_175890_b(StructureComponent componentIn, List listIn, Random rand, int x, int y, int z, EnumFacing facing, int type) + { + if (type > 8) + { + return null; + } + else if (Math.abs(x - componentIn.getBoundingBox().minX) <= 80 && Math.abs(z - componentIn.getBoundingBox().minZ) <= 80) + { + StructureComponent structurecomponent = func_175892_a(listIn, rand, x, y, z, facing, type + 1); + + if (structurecomponent != null) + { + listIn.add(structurecomponent); + structurecomponent.buildComponent(componentIn, listIn, rand); + } + + return structurecomponent; + } + else + { + return null; + } + } + + public static class Corridor extends StructureComponent + { + private boolean hasRails; + private boolean hasSpiders; + private boolean spawnerPlaced; + private int sectionCount; + + public Corridor() + { + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + tagCompound.setBoolean("hr", this.hasRails); + tagCompound.setBoolean("sc", this.hasSpiders); + tagCompound.setBoolean("hps", this.spawnerPlaced); + tagCompound.setInteger("Num", this.sectionCount); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + this.hasRails = tagCompound.getBoolean("hr"); + this.hasSpiders = tagCompound.getBoolean("sc"); + this.spawnerPlaced = tagCompound.getBoolean("hps"); + this.sectionCount = tagCompound.getInteger("Num"); + } + + public Corridor(int type, Random rand, StructureBoundingBox structurebb, EnumFacing facing) + { + super(type); + this.coordBaseMode = facing; + this.boundingBox = structurebb; + this.hasRails = rand.nextInt(3) == 0; + this.hasSpiders = !this.hasRails && rand.nextInt(23) == 0; + + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.SOUTH) + { + this.sectionCount = structurebb.getXSize() / 5; + } + else + { + this.sectionCount = structurebb.getZSize() / 5; + } + } + + public static StructureBoundingBox func_175814_a(List p_175814_0_, Random rand, int x, int y, int z, EnumFacing facing) + { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(x, y, z, x, y + 2, z); + int i; + + for (i = rand.nextInt(3) + 2; i > 0; --i) + { + int j = i * 5; + + switch (facing) + { + case NORTH: + structureboundingbox.maxX = x + 2; + structureboundingbox.minZ = z - (j - 1); + break; + + case SOUTH: + structureboundingbox.maxX = x + 2; + structureboundingbox.maxZ = z + (j - 1); + break; + + case WEST: + structureboundingbox.minX = x - (j - 1); + structureboundingbox.maxZ = z + 2; + break; + + case EAST: + structureboundingbox.maxX = x + (j - 1); + structureboundingbox.maxZ = z + 2; + } + + if (StructureComponent.findIntersecting(p_175814_0_, structureboundingbox) == null) + { + break; + } + } + + return i > 0 ? structureboundingbox : null; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + int i = this.getComponentType(); + int j = rand.nextInt(4); + + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + if (j <= 1) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ - 1, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, EnumFacing.WEST, i); + } + else + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, EnumFacing.EAST, i); + } + + break; + + case SOUTH: + if (j <= 1) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ + 1, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ - 3, EnumFacing.WEST, i); + } + else + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ - 3, EnumFacing.EAST, i); + } + + break; + + case WEST: + if (j <= 1) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + } + else + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + } + + break; + + case EAST: + if (j <= 1) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + } + else + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + rand.nextInt(3), this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + } + } + } + + if (i < 8) + { + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.SOUTH) + { + for (int i1 = this.boundingBox.minX + 3; i1 + 3 <= this.boundingBox.maxX; i1 += 5) + { + int j1 = rand.nextInt(5); + + if (j1 == 0) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, i1, this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i + 1); + } + else if (j1 == 1) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, i1, this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i + 1); + } + } + } + else + { + for (int k = this.boundingBox.minZ + 3; k + 3 <= this.boundingBox.maxZ; k += 5) + { + int l = rand.nextInt(5); + + if (l == 0) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY, k, EnumFacing.WEST, i + 1); + } + else if (l == 1) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY, k, EnumFacing.EAST, i + 1); + } + } + } + } + } + + protected boolean generateChestContents(World worldIn, StructureBoundingBox boundingBoxIn, Random rand, int x, int y, int z, List listIn, int max) + { + BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z)); + + if (boundingBoxIn.isVecInside(blockpos) && worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.air) + { + int i = rand.nextBoolean() ? 1 : 0; + worldIn.setBlockState(blockpos, Blocks.rail.getStateFromMeta(this.getMetadataWithOffset(Blocks.rail, i)), 2); + EntityMinecartChest entityminecartchest = new EntityMinecartChest(worldIn, (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F)); + WeightedRandomChestContent.generateChestContents(rand, listIn, entityminecartchest, max); + worldIn.spawnEntityInWorld(entityminecartchest); + return true; + } + else + { + return false; + } + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + int i = 0; + int j = 2; + int k = 0; + int l = 2; + int i1 = this.sectionCount * 5 - 1; + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 2, 1, i1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.func_175805_a(worldIn, structureBoundingBoxIn, randomIn, 0.8F, 0, 2, 0, 2, 2, i1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + if (this.hasSpiders) + { + this.func_175805_a(worldIn, structureBoundingBoxIn, randomIn, 0.6F, 0, 0, 0, 2, 1, i1, Blocks.web.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + for (int j1 = 0; j1 < this.sectionCount; ++j1) + { + int k1 = 2 + j1 * 5; + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, k1, 0, 1, k1, Blocks.oak_fence.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 0, k1, 2, 1, k1, Blocks.oak_fence.getDefaultState(), Blocks.air.getDefaultState(), false); + + if (randomIn.nextInt(4) == 0) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, k1, 0, 2, k1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, k1, 2, 2, k1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, k1, 2, 2, k1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 0, 2, k1 - 1, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 2, 2, k1 - 1, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 0, 2, k1 + 1, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 2, 2, k1 + 1, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 0, 2, k1 - 2, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 - 2, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 0, 2, k1 + 2, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 + 2, Blocks.web.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 - 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 + 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); + + if (randomIn.nextInt(100) == 0) + { + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 2, 0, k1 - 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 3 + randomIn.nextInt(4)); + } + + if (randomIn.nextInt(100) == 0) + { + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 0, 0, k1 + 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 3 + randomIn.nextInt(4)); + } + + if (this.hasSpiders && !this.spawnerPlaced) + { + int l1 = this.getYWithOffset(0); + int i2 = k1 - 1 + randomIn.nextInt(3); + int j2 = this.getXWithOffset(1, i2); + i2 = this.getZWithOffset(1, i2); + BlockPos blockpos = new BlockPos(j2, l1, i2); + + if (structureBoundingBoxIn.isVecInside(blockpos)) + { + this.spawnerPlaced = true; + worldIn.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityMobSpawner) + { + ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic().setEntityName("CaveSpider"); + } + } + } + } + + for (int k2 = 0; k2 <= 2; ++k2) + { + for (int i3 = 0; i3 <= i1; ++i3) + { + int j3 = -1; + IBlockState iblockstate1 = this.getBlockStateFromPos(worldIn, k2, j3, i3, structureBoundingBoxIn); + + if (iblockstate1.getBlock().getMaterial() == Material.air) + { + int k3 = -1; + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), k2, k3, i3, structureBoundingBoxIn); + } + } + } + + if (this.hasRails) + { + for (int l2 = 0; l2 <= i1; ++l2) + { + IBlockState iblockstate = this.getBlockStateFromPos(worldIn, 1, -1, l2, structureBoundingBoxIn); + + if (iblockstate.getBlock().getMaterial() != Material.air && iblockstate.getBlock().isFullBlock()) + { + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.7F, 1, 0, l2, Blocks.rail.getStateFromMeta(this.getMetadataWithOffset(Blocks.rail, 0))); + } + } + } + + return true; + } + } + } + + public static class Cross extends StructureComponent + { + private EnumFacing corridorDirection; + private boolean isMultipleFloors; + + public Cross() + { + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + tagCompound.setBoolean("tf", this.isMultipleFloors); + tagCompound.setInteger("D", this.corridorDirection.getHorizontalIndex()); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + this.isMultipleFloors = tagCompound.getBoolean("tf"); + this.corridorDirection = EnumFacing.getHorizontal(tagCompound.getInteger("D")); + } + + public Cross(int type, Random rand, StructureBoundingBox structurebb, EnumFacing facing) + { + super(type); + this.corridorDirection = facing; + this.boundingBox = structurebb; + this.isMultipleFloors = structurebb.getYSize() > 3; + } + + public static StructureBoundingBox func_175813_a(List listIn, Random rand, int x, int y, int z, EnumFacing facing) + { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(x, y, z, x, y + 2, z); + + if (rand.nextInt(4) == 0) + { + structureboundingbox.maxY += 4; + } + + switch (facing) + { + case NORTH: + structureboundingbox.minX = x - 1; + structureboundingbox.maxX = x + 3; + structureboundingbox.minZ = z - 4; + break; + + case SOUTH: + structureboundingbox.minX = x - 1; + structureboundingbox.maxX = x + 3; + structureboundingbox.maxZ = z + 4; + break; + + case WEST: + structureboundingbox.minX = x - 4; + structureboundingbox.minZ = z - 1; + structureboundingbox.maxZ = z + 3; + break; + + case EAST: + structureboundingbox.maxX = x + 4; + structureboundingbox.minZ = z - 1; + structureboundingbox.maxZ = z + 3; + } + + return StructureComponent.findIntersecting(listIn, structureboundingbox) != null ? null : structureboundingbox; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + int i = this.getComponentType(); + + switch (this.corridorDirection) + { + case NORTH: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + break; + + case SOUTH: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + break; + + case WEST: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + break; + + case EAST: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + } + + if (this.isMultipleFloors) + { + if (rand.nextBoolean()) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + } + + if (rand.nextBoolean()) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, EnumFacing.WEST, i); + } + + if (rand.nextBoolean()) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, EnumFacing.EAST, i); + } + + if (rand.nextBoolean()) + { + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + } + } + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + if (this.isMultipleFloors) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX + 1, this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX, this.boundingBox.maxY - 2, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX + 1, this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.planks.getDefaultState(), Blocks.air.getDefaultState(), false); + + for (int i = this.boundingBox.minX; i <= this.boundingBox.maxX; ++i) + { + for (int j = this.boundingBox.minZ; j <= this.boundingBox.maxZ; ++j) + { + if (this.getBlockStateFromPos(worldIn, i, this.boundingBox.minY - 1, j, structureBoundingBoxIn).getBlock().getMaterial() == Material.air) + { + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), i, this.boundingBox.minY - 1, j, structureBoundingBoxIn); + } + } + } + + return true; + } + } + } + + public static class Room extends StructureComponent + { + private List roomsLinkedToTheRoom = Lists.newLinkedList(); + + public Room() + { + } + + public Room(int type, Random rand, int x, int z) + { + super(type); + this.boundingBox = new StructureBoundingBox(x, 50, z, x + 7 + rand.nextInt(6), 54 + rand.nextInt(6), z + 7 + rand.nextInt(6)); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + int i = this.getComponentType(); + int j = this.boundingBox.getYSize() - 3 - 1; + + if (j <= 0) + { + j = 1; + } + + for (int k = 0; k < this.boundingBox.getXSize(); k = k + 4) + { + k = k + rand.nextInt(this.boundingBox.getXSize()); + + if (k + 3 > this.boundingBox.getXSize()) + { + break; + } + + StructureComponent structurecomponent = StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + k, this.boundingBox.minY + rand.nextInt(j) + 1, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + + if (structurecomponent != null) + { + StructureBoundingBox structureboundingbox = structurecomponent.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox.minX, structureboundingbox.minY, this.boundingBox.minZ, structureboundingbox.maxX, structureboundingbox.maxY, this.boundingBox.minZ + 1)); + } + } + + for (int k = 0; k < this.boundingBox.getXSize(); k = k + 4) + { + k = k + rand.nextInt(this.boundingBox.getXSize()); + + if (k + 3 > this.boundingBox.getXSize()) + { + break; + } + + StructureComponent structurecomponent1 = StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX + k, this.boundingBox.minY + rand.nextInt(j) + 1, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + + if (structurecomponent1 != null) + { + StructureBoundingBox structureboundingbox1 = structurecomponent1.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox1.minX, structureboundingbox1.minY, this.boundingBox.maxZ - 1, structureboundingbox1.maxX, structureboundingbox1.maxY, this.boundingBox.maxZ)); + } + } + + for (int k = 0; k < this.boundingBox.getZSize(); k = k + 4) + { + k = k + rand.nextInt(this.boundingBox.getZSize()); + + if (k + 3 > this.boundingBox.getZSize()) + { + break; + } + + StructureComponent structurecomponent2 = StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY + rand.nextInt(j) + 1, this.boundingBox.minZ + k, EnumFacing.WEST, i); + + if (structurecomponent2 != null) + { + StructureBoundingBox structureboundingbox2 = structurecomponent2.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.minX, structureboundingbox2.minY, structureboundingbox2.minZ, this.boundingBox.minX + 1, structureboundingbox2.maxY, structureboundingbox2.maxZ)); + } + } + + for (int k = 0; k < this.boundingBox.getZSize(); k = k + 4) + { + k = k + rand.nextInt(this.boundingBox.getZSize()); + + if (k + 3 > this.boundingBox.getZSize()) + { + break; + } + + StructureComponent structurecomponent3 = StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + rand.nextInt(j) + 1, this.boundingBox.minZ + k, EnumFacing.EAST, i); + + if (structurecomponent3 != null) + { + StructureBoundingBox structureboundingbox3 = structurecomponent3.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.maxX - 1, structureboundingbox3.minY, structureboundingbox3.minZ, this.boundingBox.maxX, structureboundingbox3.maxY, structureboundingbox3.maxZ)); + } + } + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, Blocks.dirt.getDefaultState(), Blocks.air.getDefaultState(), true); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX, this.boundingBox.minY + 1, this.boundingBox.minZ, this.boundingBox.maxX, Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + for (StructureBoundingBox structureboundingbox : this.roomsLinkedToTheRoom) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, structureboundingbox.minX, structureboundingbox.maxY - 2, structureboundingbox.minZ, structureboundingbox.maxX, structureboundingbox.maxY, structureboundingbox.maxZ, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + this.randomlyRareFillWithBlocks(worldIn, structureBoundingBoxIn, this.boundingBox.minX, this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air.getDefaultState(), false); + return true; + } + } + + public void func_181138_a(int p_181138_1_, int p_181138_2_, int p_181138_3_) + { + super.func_181138_a(p_181138_1_, p_181138_2_, p_181138_3_); + + for (StructureBoundingBox structureboundingbox : this.roomsLinkedToTheRoom) + { + structureboundingbox.offset(p_181138_1_, p_181138_2_, p_181138_3_); + } + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (StructureBoundingBox structureboundingbox : this.roomsLinkedToTheRoom) + { + nbttaglist.appendTag(structureboundingbox.toNBTTagIntArray()); + } + + tagCompound.setTag("Entrances", nbttaglist); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + NBTTagList nbttaglist = tagCompound.getTagList("Entrances", 11); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(nbttaglist.getIntArrayAt(i))); + } + } + } + + public static class Stairs extends StructureComponent + { + public Stairs() + { + } + + public Stairs(int type, Random rand, StructureBoundingBox structurebb, EnumFacing facing) + { + super(type); + this.coordBaseMode = facing; + this.boundingBox = structurebb; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + } + + public static StructureBoundingBox func_175812_a(List listIn, Random rand, int x, int y, int z, EnumFacing facing) + { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(x, y - 5, z, x, y + 2, z); + + switch (facing) + { + case NORTH: + structureboundingbox.maxX = x + 2; + structureboundingbox.minZ = z - 8; + break; + + case SOUTH: + structureboundingbox.maxX = x + 2; + structureboundingbox.maxZ = z + 8; + break; + + case WEST: + structureboundingbox.minX = x - 8; + structureboundingbox.maxZ = z + 2; + break; + + case EAST: + structureboundingbox.maxX = x + 8; + structureboundingbox.maxZ = z + 2; + } + + return StructureComponent.findIntersecting(listIn, structureboundingbox) != null ? null : structureboundingbox; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + int i = this.getComponentType(); + + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, i); + break; + + case SOUTH: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, i); + break; + + case WEST: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, EnumFacing.WEST, i); + break; + + case EAST: + StructureMineshaftPieces.func_175890_b(componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, EnumFacing.EAST, i); + } + } + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 2, 7, 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 7, 2, 2, 8, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + for (int i = 0; i < 5; ++i) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5 - i - (i < 4 ? 1 : 0), 2 + i, 2, 7 - i, 2 + i, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java new file mode 100644 index 0000000..37b2c47 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java @@ -0,0 +1,21 @@ +package net.minecraft.world.gen.structure; + +import java.util.Random; +import net.minecraft.world.World; + +public class StructureMineshaftStart extends StructureStart +{ + public StructureMineshaftStart() + { + } + + public StructureMineshaftStart(World worldIn, Random rand, int chunkX, int chunkZ) + { + super(chunkX, chunkZ); + StructureMineshaftPieces.Room structuremineshaftpieces$room = new StructureMineshaftPieces.Room(0, rand, (chunkX << 4) + 2, (chunkZ << 4) + 2); + this.components.add(structuremineshaftpieces$room); + structuremineshaftpieces$room.buildComponent(structuremineshaftpieces$room, this.components, rand); + this.updateBoundingBox(); + this.markAvailableHeight(worldIn, rand, 10); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java new file mode 100644 index 0000000..23f1ac8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java @@ -0,0 +1,1398 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +@SuppressWarnings("incomplete-switch") +public class StructureNetherBridgePieces +{ + private static final StructureNetherBridgePieces.PieceWeight[] primaryComponents = new StructureNetherBridgePieces.PieceWeight[] {new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Straight.class, 30, 0, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing3.class, 10, 4), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing.class, 10, 4), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Stairs.class, 10, 3), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Throne.class, 5, 2), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Entrance.class, 5, 1)}; + private static final StructureNetherBridgePieces.PieceWeight[] secondaryComponents = new StructureNetherBridgePieces.PieceWeight[] {new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor5.class, 25, 0, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing2.class, 15, 5), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor2.class, 5, 10), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor.class, 5, 10), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor3.class, 10, 3, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor4.class, 7, 2), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.NetherStalkRoom.class, 5, 2)}; + + public static void registerNetherFortressPieces() + { + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing3.class, "NeBCr"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.End.class, "NeBEF"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Straight.class, "NeBS"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor3.class, "NeCCS"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor4.class, "NeCTB"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Entrance.class, "NeCE"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing2.class, "NeSCSC"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor.class, "NeSCLT"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor5.class, "NeSC"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Corridor2.class, "NeSCRT"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.NetherStalkRoom.class, "NeCSR"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Throne.class, "NeMT"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Crossing.class, "NeRC"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Stairs.class, "NeSR"); + MapGenStructureIO.registerStructureComponent(StructureNetherBridgePieces.Start.class, "NeStart"); + } + + private static StructureNetherBridgePieces.Piece func_175887_b(StructureNetherBridgePieces.PieceWeight p_175887_0_, List p_175887_1_, Random p_175887_2_, int p_175887_3_, int p_175887_4_, int p_175887_5_, EnumFacing p_175887_6_, int p_175887_7_) + { + Class oclass = p_175887_0_.weightClass; + StructureNetherBridgePieces.Piece structurenetherbridgepieces$piece = null; + + if (oclass == StructureNetherBridgePieces.Straight.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Straight.func_175882_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Crossing3.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Crossing3.func_175885_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Crossing.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Crossing.func_175873_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Stairs.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Stairs.func_175872_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_7_, p_175887_6_); + } + else if (oclass == StructureNetherBridgePieces.Throne.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Throne.func_175874_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_7_, p_175887_6_); + } + else if (oclass == StructureNetherBridgePieces.Entrance.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Entrance.func_175881_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor5.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Corridor5.func_175877_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor2.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Corridor2.func_175876_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Corridor.func_175879_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor3.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Corridor3.func_175883_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor4.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Corridor4.func_175880_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.Crossing2.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.Crossing2.func_175878_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + else if (oclass == StructureNetherBridgePieces.NetherStalkRoom.class) + { + structurenetherbridgepieces$piece = StructureNetherBridgePieces.NetherStalkRoom.func_175875_a(p_175887_1_, p_175887_2_, p_175887_3_, p_175887_4_, p_175887_5_, p_175887_6_, p_175887_7_); + } + + return structurenetherbridgepieces$piece; + } + + public static class Corridor extends StructureNetherBridgePieces.Piece + { + private boolean field_111021_b; + + public Corridor() + { + } + + public Corridor(int p_i45615_1_, Random p_i45615_2_, StructureBoundingBox p_i45615_3_, EnumFacing p_i45615_4_) + { + super(p_i45615_1_); + this.coordBaseMode = p_i45615_4_; + this.boundingBox = p_i45615_3_; + this.field_111021_b = p_i45615_2_.nextInt(3) == 0; + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.field_111021_b = tagCompound.getBoolean("Chest"); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Chest", this.field_111021_b); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentX((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, 1, true); + } + + public static StructureNetherBridgePieces.Corridor func_175879_a(List p_175879_0_, Random p_175879_1_, int p_175879_2_, int p_175879_3_, int p_175879_4_, EnumFacing p_175879_5_, int p_175879_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175879_2_, p_175879_3_, p_175879_4_, -1, 0, 0, 5, 7, 5, p_175879_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175879_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor(p_175879_6_, p_175879_1_, structureboundingbox, p_175879_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 1, 4, 4, 1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 3, 4, 4, 3, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 3, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 1, 4, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 4, 3, 4, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + if (this.field_111021_b && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) + { + this.field_111021_b = false; + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, field_111019_a, 2 + randomIn.nextInt(4)); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 4; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Corridor2 extends StructureNetherBridgePieces.Piece + { + private boolean field_111020_b; + + public Corridor2() + { + } + + public Corridor2(int p_i45613_1_, Random p_i45613_2_, StructureBoundingBox p_i45613_3_, EnumFacing p_i45613_4_) + { + super(p_i45613_1_); + this.coordBaseMode = p_i45613_4_; + this.boundingBox = p_i45613_3_; + this.field_111020_b = p_i45613_2_.nextInt(3) == 0; + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.field_111020_b = tagCompound.getBoolean("Chest"); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Chest", this.field_111020_b); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, 1, true); + } + + public static StructureNetherBridgePieces.Corridor2 func_175876_a(List p_175876_0_, Random p_175876_1_, int p_175876_2_, int p_175876_3_, int p_175876_4_, EnumFacing p_175876_5_, int p_175876_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175876_2_, p_175876_3_, p_175876_4_, -1, 0, 0, 5, 7, 5, p_175876_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175876_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor2(p_175876_6_, p_175876_1_, structureboundingbox, p_175876_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 1, 0, 4, 1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 3, 0, 4, 3, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 4, 4, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 1, 4, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 4, 3, 4, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + if (this.field_111020_b && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(1, 3), this.getYWithOffset(2), this.getZWithOffset(1, 3)))) + { + this.field_111020_b = false; + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 1, 2, 3, field_111019_a, 2 + randomIn.nextInt(4)); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 4; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Corridor3 extends StructureNetherBridgePieces.Piece + { + public Corridor3() + { + } + + public Corridor3(int p_i45619_1_, Random p_i45619_2_, StructureBoundingBox p_i45619_3_, EnumFacing p_i45619_4_) + { + super(p_i45619_1_); + this.coordBaseMode = p_i45619_4_; + this.boundingBox = p_i45619_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 1, 0, true); + } + + public static StructureNetherBridgePieces.Corridor3 func_175883_a(List p_175883_0_, Random p_175883_1_, int p_175883_2_, int p_175883_3_, int p_175883_4_, EnumFacing p_175883_5_, int p_175883_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175883_2_, p_175883_3_, p_175883_4_, -1, -7, 0, 5, 14, 10, p_175883_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175883_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor3(p_175883_6_, p_175883_1_, structureboundingbox, p_175883_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + int i = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 2); + + for (int j = 0; j <= 9; ++j) + { + int k = Math.max(1, 7 - j); + int l = Math.min(Math.max(k + 5, 14 - j), 13); + int i1 = j; + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, j, 4, k, j, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, k + 1, j, 3, l - 1, j, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + if (j <= 6) + { + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(i), 1, k + 1, j, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(i), 2, k + 1, j, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(i), 3, k + 1, j, structureBoundingBoxIn); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, l, j, 4, l, j, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, k + 1, j, 0, l - 1, j, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, k + 1, j, 4, l - 1, j, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + if ((j & 1) == 0) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, k + 2, j, 0, k + 3, j, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, k + 2, j, 4, k + 3, j, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + } + + for (int j1 = 0; j1 <= 4; ++j1) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), j1, -1, i1, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Corridor4 extends StructureNetherBridgePieces.Piece + { + public Corridor4() + { + } + + public Corridor4(int p_i45618_1_, Random p_i45618_2_, StructureBoundingBox p_i45618_3_, EnumFacing p_i45618_4_) + { + super(p_i45618_1_); + this.coordBaseMode = p_i45618_4_; + this.boundingBox = p_i45618_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + int i = 1; + + if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.NORTH) + { + i = 5; + } + + this.getNextComponentX((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, i, rand.nextInt(8) > 0); + this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, i, rand.nextInt(8) > 0); + } + + public static StructureNetherBridgePieces.Corridor4 func_175880_a(List p_175880_0_, Random p_175880_1_, int p_175880_2_, int p_175880_3_, int p_175880_4_, EnumFacing p_175880_5_, int p_175880_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175880_2_, p_175880_3_, p_175880_4_, -3, 0, 0, 9, 7, 9, p_175880_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175880_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor4(p_175880_6_, p_175880_1_, structureboundingbox, p_175880_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 8, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 8, 5, 8, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 8, 6, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 2, 5, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 2, 0, 8, 5, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 0, 1, 4, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 0, 7, 4, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 8, 2, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 4, 2, 2, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 4, 7, 2, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 8, 8, 3, 8, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 6, 0, 3, 7, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 3, 6, 8, 3, 7, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 4, 0, 5, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 3, 4, 8, 5, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 5, 2, 5, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 5, 7, 5, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 5, 1, 5, 5, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 4, 5, 7, 5, 5, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 0; i <= 5; ++i) + { + for (int j = 0; j <= 8; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), j, -1, i, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Corridor5 extends StructureNetherBridgePieces.Piece + { + public Corridor5() + { + } + + public Corridor5(int p_i45614_1_, Random p_i45614_2_, StructureBoundingBox p_i45614_3_, EnumFacing p_i45614_4_) + { + super(p_i45614_1_); + this.coordBaseMode = p_i45614_4_; + this.boundingBox = p_i45614_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 1, 0, true); + } + + public static StructureNetherBridgePieces.Corridor5 func_175877_a(List p_175877_0_, Random p_175877_1_, int p_175877_2_, int p_175877_3_, int p_175877_4_, EnumFacing p_175877_5_, int p_175877_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175877_2_, p_175877_3_, p_175877_4_, -1, 0, 0, 5, 7, 5, p_175877_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175877_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor5(p_175877_6_, p_175877_1_, structureboundingbox, p_175877_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 1, 0, 4, 1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 3, 0, 4, 3, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 1, 4, 4, 1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 3, 4, 4, 3, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 4; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Crossing extends StructureNetherBridgePieces.Piece + { + public Crossing() + { + } + + public Crossing(int p_i45610_1_, Random p_i45610_2_, StructureBoundingBox p_i45610_3_, EnumFacing p_i45610_4_) + { + super(p_i45610_1_); + this.coordBaseMode = p_i45610_4_; + this.boundingBox = p_i45610_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 2, 0, false); + this.getNextComponentX((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, 2, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, 2, false); + } + + public static StructureNetherBridgePieces.Crossing func_175873_a(List p_175873_0_, Random p_175873_1_, int p_175873_2_, int p_175873_3_, int p_175873_4_, EnumFacing p_175873_5_, int p_175873_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175873_2_, p_175873_3_, p_175873_4_, -2, 0, 0, 7, 9, 7, p_175873_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175873_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Crossing(p_175873_6_, p_175873_1_, structureboundingbox, p_175873_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 6, 1, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 6, 7, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 1, 6, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 6, 1, 6, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 0, 6, 6, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 6, 6, 6, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 6, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 5, 0, 6, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 2, 0, 6, 6, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 2, 5, 6, 6, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 6, 0, 4, 6, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 5, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 6, 6, 4, 6, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 6, 4, 5, 6, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 2, 0, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 2, 0, 5, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 6, 2, 6, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 5, 2, 6, 5, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 0; i <= 6; ++i) + { + for (int j = 0; j <= 6; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Crossing2 extends StructureNetherBridgePieces.Piece + { + public Crossing2() + { + } + + public Crossing2(int p_i45616_1_, Random p_i45616_2_, StructureBoundingBox p_i45616_3_, EnumFacing p_i45616_4_) + { + super(p_i45616_1_); + this.coordBaseMode = p_i45616_4_; + this.boundingBox = p_i45616_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 1, 0, true); + this.getNextComponentX((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, 1, true); + this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 0, 1, true); + } + + public static StructureNetherBridgePieces.Crossing2 func_175878_a(List p_175878_0_, Random p_175878_1_, int p_175878_2_, int p_175878_3_, int p_175878_4_, EnumFacing p_175878_5_, int p_175878_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175878_2_, p_175878_3_, p_175878_4_, -1, 0, 0, 5, 7, 5, p_175878_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175878_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Crossing2(p_175878_6_, p_175878_1_, structureboundingbox, p_175878_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 0, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 4, 4, 5, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 4; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Crossing3 extends StructureNetherBridgePieces.Piece + { + public Crossing3() + { + } + + public Crossing3(int p_i45622_1_, Random p_i45622_2_, StructureBoundingBox p_i45622_3_, EnumFacing p_i45622_4_) + { + super(p_i45622_1_); + this.coordBaseMode = p_i45622_4_; + this.boundingBox = p_i45622_3_; + } + + protected Crossing3(Random p_i2042_1_, int p_i2042_2_, int p_i2042_3_) + { + super(0); + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(p_i2042_1_); + + switch (this.coordBaseMode) + { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(p_i2042_2_, 64, p_i2042_3_, p_i2042_2_ + 19 - 1, 73, p_i2042_3_ + 19 - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2042_2_, 64, p_i2042_3_, p_i2042_2_ + 19 - 1, 73, p_i2042_3_ + 19 - 1); + } + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 8, 3, false); + this.getNextComponentX((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 3, 8, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 3, 8, false); + } + + public static StructureNetherBridgePieces.Crossing3 func_175885_a(List p_175885_0_, Random p_175885_1_, int p_175885_2_, int p_175885_3_, int p_175885_4_, EnumFacing p_175885_5_, int p_175885_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175885_2_, p_175885_3_, p_175885_4_, -8, -3, 0, 19, 10, 19, p_175885_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175885_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Crossing3(p_175885_6_, p_175885_1_, structureboundingbox, p_175885_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 0, 11, 4, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 7, 18, 4, 11, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 7, 18, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 8, 18, 7, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 5, 0, 7, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 5, 11, 7, 5, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 11, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 11, 11, 5, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 7, 7, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 7, 18, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 11, 7, 5, 11, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 11, 18, 5, 11, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 0, 11, 2, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 13, 11, 2, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 0, 0, 11, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 0, 15, 11, 1, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 7; i <= 11; ++i) + { + for (int j = 0; j <= 2; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, 18 - j, structureBoundingBoxIn); + } + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 7, 5, 2, 11, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 2, 7, 18, 2, 11, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 7, 3, 1, 11, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, 0, 7, 18, 1, 11, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int k = 0; k <= 2; ++k) + { + for (int l = 7; l <= 11; ++l) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), k, -1, l, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), 18 - k, -1, l, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class End extends StructureNetherBridgePieces.Piece + { + private int fillSeed; + + public End() + { + } + + public End(int p_i45621_1_, Random p_i45621_2_, StructureBoundingBox p_i45621_3_, EnumFacing p_i45621_4_) + { + super(p_i45621_1_); + this.coordBaseMode = p_i45621_4_; + this.boundingBox = p_i45621_3_; + this.fillSeed = p_i45621_2_.nextInt(); + } + + public static StructureNetherBridgePieces.End func_175884_a(List p_175884_0_, Random p_175884_1_, int p_175884_2_, int p_175884_3_, int p_175884_4_, EnumFacing p_175884_5_, int p_175884_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175884_2_, p_175884_3_, p_175884_4_, -1, -3, 0, 5, 10, 8, p_175884_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175884_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.End(p_175884_6_, p_175884_1_, structureboundingbox, p_175884_5_) : null; + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.fillSeed = tagCompound.getInteger("Seed"); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setInteger("Seed", this.fillSeed); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + Random random = new Random((long)this.fillSeed); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 3; j <= 4; ++j) + { + int k = random.nextInt(8); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, j, 0, i, j, k, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + } + + int l = random.nextInt(8); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 0, 5, l, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + l = random.nextInt(8); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 0, 4, 5, l, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (l = 0; l <= 4; ++l) + { + int i1 = random.nextInt(5); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, l, 2, 0, l, 2, i1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + + for (l = 0; l <= 4; ++l) + { + for (int j1 = 0; j1 <= 1; ++j1) + { + int k1 = random.nextInt(3); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, l, j1, 0, l, j1, k1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + } + + return true; + } + } + + public static class Entrance extends StructureNetherBridgePieces.Piece + { + public Entrance() + { + } + + public Entrance(int p_i45617_1_, Random p_i45617_2_, StructureBoundingBox p_i45617_3_, EnumFacing p_i45617_4_) + { + super(p_i45617_1_); + this.coordBaseMode = p_i45617_4_; + this.boundingBox = p_i45617_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 5, 3, true); + } + + public static StructureNetherBridgePieces.Entrance func_175881_a(List p_175881_0_, Random p_175881_1_, int p_175881_2_, int p_175881_3_, int p_175881_4_, EnumFacing p_175881_5_, int p_175881_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175881_2_, p_175881_3_, p_175881_4_, -5, -3, 0, 13, 14, 13, p_175881_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175881_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Entrance(p_175881_6_, p_175881_1_, structureboundingbox, p_175881_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 11, 10, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 11, 2, 10, 12, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 8, 0, 7, 8, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 1; i <= 11; i += 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureBoundingBoxIn); + + for (int k = 3; k <= 9; k += 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, k, 1, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 7, k, 11, 8, k, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int l = 4; l <= 8; ++l) + { + for (int j = 0; j <= 2; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, j, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l, -1, 12 - j, structureBoundingBoxIn); + } + } + + for (int i1 = 0; i1 <= 2; ++i1) + { + for (int j1 = 4; j1 <= 8; ++j1) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i1, -1, j1, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), 12 - i1, -1, j1, structureBoundingBoxIn); + } + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 5, 7, 5, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 6, 6, 4, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 6, 0, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.flowing_lava.getDefaultState(), 6, 5, 6, structureBoundingBoxIn); + BlockPos blockpos = new BlockPos(this.getXWithOffset(6, 6), this.getYWithOffset(5), this.getZWithOffset(6, 6)); + + if (structureBoundingBoxIn.isVecInside(blockpos)) + { + worldIn.forceBlockUpdateTick(Blocks.flowing_lava, blockpos, randomIn); + } + + return true; + } + } + + public static class NetherStalkRoom extends StructureNetherBridgePieces.Piece + { + public NetherStalkRoom() + { + } + + public NetherStalkRoom(int p_i45612_1_, Random p_i45612_2_, StructureBoundingBox p_i45612_3_, EnumFacing p_i45612_4_) + { + super(p_i45612_1_); + this.coordBaseMode = p_i45612_4_; + this.boundingBox = p_i45612_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 5, 3, true); + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 5, 11, true); + } + + public static StructureNetherBridgePieces.NetherStalkRoom func_175875_a(List p_175875_0_, Random p_175875_1_, int p_175875_2_, int p_175875_3_, int p_175875_4_, EnumFacing p_175875_5_, int p_175875_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175875_2_, p_175875_3_, p_175875_4_, -5, -3, 0, 13, 14, 13, p_175875_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175875_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.NetherStalkRoom(p_175875_6_, p_175875_1_, structureboundingbox, p_175875_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 12, 4, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 12, 13, 12, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 1, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 11, 4, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 11, 10, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 11, 7, 12, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 0, 10, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 9, 0, 7, 12, 1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 11, 2, 10, 12, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 1; i <= 11; i += 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), i, 13, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 0, 13, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 12, 13, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), i + 1, 13, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, i + 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, i + 1, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 0, 13, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 12, 13, 0, structureBoundingBoxIn); + + for (int j1 = 3; j1 <= 9; j1 += 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, j1, 1, 8, j1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 7, j1, 11, 8, j1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + } + + int k1 = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 3); + + for (int j = 0; j <= 6; ++j) + { + int k = j + 4; + + for (int l = 5; l <= 7; ++l) + { + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(k1), l, 5 + j, k, structureBoundingBoxIn); + } + + if (k >= 5 && k <= 8) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, k, 7, j + 4, k, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + else if (k >= 9 && k <= 10) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 8, k, 7, j + 4, k, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + } + + if (j >= 1) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 6 + j, k, 7, 9 + j, k, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + } + + for (int l1 = 5; l1 <= 7; ++l1) + { + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(k1), l1, 12, 11, structureBoundingBoxIn); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 6, 7, 5, 7, 7, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 6, 7, 7, 7, 7, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 13, 12, 7, 13, 12, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 2, 3, 5, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 9, 3, 5, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 4, 2, 5, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 5, 2, 10, 5, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 5, 9, 10, 5, 10, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 5, 4, 10, 5, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + int i2 = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 0); + int j2 = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 1); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(j2), 4, 5, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_stairs.getStateFromMeta(i2), 8, 5, 10, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 4, 4, 4, 4, 8, Blocks.soul_sand.getDefaultState(), Blocks.soul_sand.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 4, 4, 9, 4, 8, Blocks.soul_sand.getDefaultState(), Blocks.soul_sand.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 5, 4, 4, 5, 8, Blocks.nether_wart.getDefaultState(), Blocks.nether_wart.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 4, 9, 5, 8, Blocks.nether_wart.getDefaultState(), Blocks.nether_wart.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 8, 2, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 12, 2, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 0, 8, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 8, 1, 12, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 3, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 4, 12, 1, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int k2 = 4; k2 <= 8; ++k2) + { + for (int i1 = 0; i1 <= 2; ++i1) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), k2, -1, i1, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), k2, -1, 12 - i1, structureBoundingBoxIn); + } + } + + for (int l2 = 0; l2 <= 2; ++l2) + { + for (int i3 = 4; i3 <= 8; ++i3) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), l2, -1, i3, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), 12 - l2, -1, i3, structureBoundingBoxIn); + } + } + + return true; + } + } + + abstract static class Piece extends StructureComponent + { + protected static final List field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 2, 4, 2)}); + + public Piece() + { + } + + protected Piece(int p_i2054_1_) + { + super(p_i2054_1_); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + } + + private int getTotalWeight(List p_74960_1_) + { + boolean flag = false; + int i = 0; + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight : p_74960_1_) + { + if (structurenetherbridgepieces$pieceweight.field_78824_d > 0 && structurenetherbridgepieces$pieceweight.field_78827_c < structurenetherbridgepieces$pieceweight.field_78824_d) + { + flag = true; + } + + i += structurenetherbridgepieces$pieceweight.field_78826_b; + } + + return flag ? i : -1; + } + + private StructureNetherBridgePieces.Piece func_175871_a(StructureNetherBridgePieces.Start p_175871_1_, List p_175871_2_, List p_175871_3_, Random p_175871_4_, int p_175871_5_, int p_175871_6_, int p_175871_7_, EnumFacing p_175871_8_, int p_175871_9_) + { + int i = this.getTotalWeight(p_175871_2_); + boolean flag = i > 0 && p_175871_9_ <= 30; + int j = 0; + + while (j < 5 && flag) + { + ++j; + int k = p_175871_4_.nextInt(i); + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight : p_175871_2_) + { + k -= structurenetherbridgepieces$pieceweight.field_78826_b; + + if (k < 0) + { + if (!structurenetherbridgepieces$pieceweight.func_78822_a(p_175871_9_) || structurenetherbridgepieces$pieceweight == p_175871_1_.theNetherBridgePieceWeight && !structurenetherbridgepieces$pieceweight.field_78825_e) + { + break; + } + + StructureNetherBridgePieces.Piece structurenetherbridgepieces$piece = StructureNetherBridgePieces.func_175887_b(structurenetherbridgepieces$pieceweight, p_175871_3_, p_175871_4_, p_175871_5_, p_175871_6_, p_175871_7_, p_175871_8_, p_175871_9_); + + if (structurenetherbridgepieces$piece != null) + { + ++structurenetherbridgepieces$pieceweight.field_78827_c; + p_175871_1_.theNetherBridgePieceWeight = structurenetherbridgepieces$pieceweight; + + if (!structurenetherbridgepieces$pieceweight.func_78823_a()) + { + p_175871_2_.remove(structurenetherbridgepieces$pieceweight); + } + + return structurenetherbridgepieces$piece; + } + } + } + } + + return StructureNetherBridgePieces.End.func_175884_a(p_175871_3_, p_175871_4_, p_175871_5_, p_175871_6_, p_175871_7_, p_175871_8_, p_175871_9_); + } + + private StructureComponent func_175870_a(StructureNetherBridgePieces.Start p_175870_1_, List p_175870_2_, Random p_175870_3_, int p_175870_4_, int p_175870_5_, int p_175870_6_, EnumFacing p_175870_7_, int p_175870_8_, boolean p_175870_9_) + { + if (Math.abs(p_175870_4_ - p_175870_1_.getBoundingBox().minX) <= 112 && Math.abs(p_175870_6_ - p_175870_1_.getBoundingBox().minZ) <= 112) + { + List list = p_175870_1_.primaryWeights; + + if (p_175870_9_) + { + list = p_175870_1_.secondaryWeights; + } + + StructureComponent structurecomponent = this.func_175871_a(p_175870_1_, list, p_175870_2_, p_175870_3_, p_175870_4_, p_175870_5_, p_175870_6_, p_175870_7_, p_175870_8_ + 1); + + if (structurecomponent != null) + { + p_175870_2_.add(structurecomponent); + p_175870_1_.field_74967_d.add(structurecomponent); + } + + return structurecomponent; + } + else + { + return StructureNetherBridgePieces.End.func_175884_a(p_175870_2_, p_175870_3_, p_175870_4_, p_175870_5_, p_175870_6_, p_175870_7_, p_175870_8_); + } + } + + protected StructureComponent getNextComponentNormal(StructureNetherBridgePieces.Start p_74963_1_, List p_74963_2_, Random p_74963_3_, int p_74963_4_, int p_74963_5_, boolean p_74963_6_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return this.func_175870_a(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX + p_74963_4_, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), p_74963_6_); + + case SOUTH: + return this.func_175870_a(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX + p_74963_4_, this.boundingBox.minY + p_74963_5_, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), p_74963_6_); + + case WEST: + return this.func_175870_a(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ + p_74963_4_, this.coordBaseMode, this.getComponentType(), p_74963_6_); + + case EAST: + return this.func_175870_a(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ + p_74963_4_, this.coordBaseMode, this.getComponentType(), p_74963_6_); + } + } + + return null; + } + + protected StructureComponent getNextComponentX(StructureNetherBridgePieces.Start p_74961_1_, List p_74961_2_, Random p_74961_3_, int p_74961_4_, int p_74961_5_, boolean p_74961_6_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return this.func_175870_a(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ + p_74961_5_, EnumFacing.WEST, this.getComponentType(), p_74961_6_); + + case SOUTH: + return this.func_175870_a(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ + p_74961_5_, EnumFacing.WEST, this.getComponentType(), p_74961_6_); + + case WEST: + return this.func_175870_a(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX + p_74961_5_, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType(), p_74961_6_); + + case EAST: + return this.func_175870_a(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX + p_74961_5_, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType(), p_74961_6_); + } + } + + return null; + } + + protected StructureComponent getNextComponentZ(StructureNetherBridgePieces.Start p_74965_1_, List p_74965_2_, Random p_74965_3_, int p_74965_4_, int p_74965_5_, boolean p_74965_6_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return this.func_175870_a(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74965_4_, this.boundingBox.minZ + p_74965_5_, EnumFacing.EAST, this.getComponentType(), p_74965_6_); + + case SOUTH: + return this.func_175870_a(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74965_4_, this.boundingBox.minZ + p_74965_5_, EnumFacing.EAST, this.getComponentType(), p_74965_6_); + + case WEST: + return this.func_175870_a(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.minX + p_74965_5_, this.boundingBox.minY + p_74965_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType(), p_74965_6_); + + case EAST: + return this.func_175870_a(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.minX + p_74965_5_, this.boundingBox.minY + p_74965_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType(), p_74965_6_); + } + } + + return null; + } + + protected static boolean isAboveGround(StructureBoundingBox p_74964_0_) + { + return p_74964_0_ != null && p_74964_0_.minY > 10; + } + } + + static class PieceWeight + { + public Class weightClass; + public final int field_78826_b; + public int field_78827_c; + public int field_78824_d; + public boolean field_78825_e; + + public PieceWeight(Class p_i2055_1_, int p_i2055_2_, int p_i2055_3_, boolean p_i2055_4_) + { + this.weightClass = p_i2055_1_; + this.field_78826_b = p_i2055_2_; + this.field_78824_d = p_i2055_3_; + this.field_78825_e = p_i2055_4_; + } + + public PieceWeight(Class p_i2056_1_, int p_i2056_2_, int p_i2056_3_) + { + this(p_i2056_1_, p_i2056_2_, p_i2056_3_, false); + } + + public boolean func_78822_a(int p_78822_1_) + { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + + public boolean func_78823_a() + { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + } + + public static class Stairs extends StructureNetherBridgePieces.Piece + { + public Stairs() + { + } + + public Stairs(int p_i45609_1_, Random p_i45609_2_, StructureBoundingBox p_i45609_3_, EnumFacing p_i45609_4_) + { + super(p_i45609_1_); + this.coordBaseMode = p_i45609_4_; + this.boundingBox = p_i45609_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentZ((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 6, 2, false); + } + + public static StructureNetherBridgePieces.Stairs func_175872_a(List p_175872_0_, Random p_175872_1_, int p_175872_2_, int p_175872_3_, int p_175872_4_, int p_175872_5_, EnumFacing p_175872_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175872_2_, p_175872_3_, p_175872_4_, -2, 0, 0, 7, 11, 7, p_175872_6_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175872_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Stairs(p_175872_5_, p_175872_1_, structureboundingbox, p_175872_6_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 6, 1, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 6, 10, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 1, 8, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 0, 6, 8, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 1, 0, 8, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 2, 1, 6, 8, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 6, 5, 8, 6, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 2, 0, 5, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 2, 6, 5, 2, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 4, 6, 5, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.nether_brick.getDefaultState(), 5, 2, 5, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 5, 4, 3, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 2, 5, 3, 4, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, 5, 2, 5, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 5, 1, 6, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, 1, 5, 7, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 8, 2, 6, 8, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 6, 0, 4, 8, 0, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 5, 0, 4, 5, 0, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + for (int i = 0; i <= 6; ++i) + { + for (int j = 0; j <= 6; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Start extends StructureNetherBridgePieces.Crossing3 + { + public StructureNetherBridgePieces.PieceWeight theNetherBridgePieceWeight; + public List primaryWeights; + public List secondaryWeights; + public List field_74967_d = Lists.newArrayList(); + + public Start() + { + } + + public Start(Random p_i2059_1_, int p_i2059_2_, int p_i2059_3_) + { + super(p_i2059_1_, p_i2059_2_, p_i2059_3_); + this.primaryWeights = Lists.newArrayList(); + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight : StructureNetherBridgePieces.primaryComponents) + { + structurenetherbridgepieces$pieceweight.field_78827_c = 0; + this.primaryWeights.add(structurenetherbridgepieces$pieceweight); + } + + this.secondaryWeights = Lists.newArrayList(); + + for (StructureNetherBridgePieces.PieceWeight structurenetherbridgepieces$pieceweight1 : StructureNetherBridgePieces.secondaryComponents) + { + structurenetherbridgepieces$pieceweight1.field_78827_c = 0; + this.secondaryWeights.add(structurenetherbridgepieces$pieceweight1); + } + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + } + } + + public static class Straight extends StructureNetherBridgePieces.Piece + { + public Straight() + { + } + + public Straight(int p_i45620_1_, Random p_i45620_2_, StructureBoundingBox p_i45620_3_, EnumFacing p_i45620_4_) + { + super(p_i45620_1_); + this.coordBaseMode = p_i45620_4_; + this.boundingBox = p_i45620_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)componentIn, listIn, rand, 1, 3, false); + } + + public static StructureNetherBridgePieces.Straight func_175882_a(List p_175882_0_, Random p_175882_1_, int p_175882_2_, int p_175882_3_, int p_175882_4_, EnumFacing p_175882_5_, int p_175882_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175882_2_, p_175882_3_, p_175882_4_, -1, -3, 0, 5, 10, 19, p_175882_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175882_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Straight(p_175882_6_, p_175882_1_, structureboundingbox, p_175882_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 4, 4, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 0, 3, 7, 18, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 0, 5, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 0, 4, 5, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 2, 5, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 13, 4, 2, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 15, 4, 1, 18, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 2; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, 18 - j, structureBoundingBoxIn); + } + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 4, 1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 4, 0, 4, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 14, 0, 4, 14, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 17, 0, 4, 17, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 4, 1, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 4, 4, 4, 4, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 14, 4, 4, 14, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 17, 4, 4, 17, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + return true; + } + } + + public static class Throne extends StructureNetherBridgePieces.Piece + { + private boolean hasSpawner; + + public Throne() + { + } + + public Throne(int p_i45611_1_, Random p_i45611_2_, StructureBoundingBox p_i45611_3_, EnumFacing p_i45611_4_) + { + super(p_i45611_1_); + this.coordBaseMode = p_i45611_4_; + this.boundingBox = p_i45611_3_; + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.hasSpawner = tagCompound.getBoolean("Mob"); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Mob", this.hasSpawner); + } + + public static StructureNetherBridgePieces.Throne func_175874_a(List p_175874_0_, Random p_175874_1_, int p_175874_2_, int p_175874_3_, int p_175874_4_, int p_175874_5_, EnumFacing p_175874_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175874_2_, p_175874_3_, p_175874_4_, -2, 0, 0, 7, 8, 9, p_175874_6_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175874_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Throne(p_175874_5_, p_175874_1_, structureboundingbox, p_175874_6_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 6, 7, 7, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 0, 5, 1, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 1, 5, 2, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 2, 5, 3, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 3, 5, 4, 7, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 1, 4, 2, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 0, 5, 4, 2, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 2, 1, 5, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 2, 5, 5, 3, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 3, 0, 5, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 5, 3, 6, 5, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 8, 5, 5, 8, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 1, 6, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.nether_brick_fence.getDefaultState(), 5, 6, 3, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 3, 0, 6, 8, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 6, 3, 6, 6, 8, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 6, 8, 5, 7, 8, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 8, 8, 4, 8, 8, Blocks.nether_brick_fence.getDefaultState(), Blocks.nether_brick_fence.getDefaultState(), false); + + if (!this.hasSpawner) + { + BlockPos blockpos = new BlockPos(this.getXWithOffset(3, 5), this.getYWithOffset(5), this.getZWithOffset(3, 5)); + + if (structureBoundingBoxIn.isVecInside(blockpos)) + { + this.hasSpawner = true; + worldIn.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityMobSpawner) + { + ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic().setEntityName("Blaze"); + } + } + } + + for (int i = 0; i <= 6; ++i) + { + for (int j = 0; j <= 6; ++j) + { + this.replaceAirAndLiquidDownwards(worldIn, Blocks.nether_brick.getDefaultState(), i, -1, j, structureBoundingBoxIn); + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonument.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonument.java new file mode 100644 index 0000000..74629e2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonument.java @@ -0,0 +1,197 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class StructureOceanMonument extends MapGenStructure +{ + private int field_175800_f; + private int field_175801_g; + public static final List field_175802_d = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.deepOcean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver}); + private static final List field_175803_h = Lists.newArrayList(); + + public StructureOceanMonument() + { + this.field_175800_f = 32; + this.field_175801_g = 5; + } + + public StructureOceanMonument(Map p_i45608_1_) + { + this(); + + for (Entry entry : p_i45608_1_.entrySet()) + { + if (((String)entry.getKey()).equals("spacing")) + { + this.field_175800_f = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_175800_f, 1); + } + else if (((String)entry.getKey()).equals("separation")) + { + this.field_175801_g = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_175801_g, 1); + } + } + } + + public String getStructureName() + { + return "Monument"; + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + int i = chunkX; + int j = chunkZ; + + if (chunkX < 0) + { + chunkX -= this.field_175800_f - 1; + } + + if (chunkZ < 0) + { + chunkZ -= this.field_175800_f - 1; + } + + int k = chunkX / this.field_175800_f; + int l = chunkZ / this.field_175800_f; + Random random = this.worldObj.setRandomSeed(k, l, 10387313); + k = k * this.field_175800_f; + l = l * this.field_175800_f; + k = k + (random.nextInt(this.field_175800_f - this.field_175801_g) + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2; + l = l + (random.nextInt(this.field_175800_f - this.field_175801_g) + random.nextInt(this.field_175800_f - this.field_175801_g)) / 2; + + if (i == k && j == l) + { + if (this.worldObj.getWorldChunkManager().getBiomeGenerator(new BlockPos(i * 16 + 8, 64, j * 16 + 8), (BiomeGenBase)null) != BiomeGenBase.deepOcean) + { + return false; + } + + boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(i * 16 + 8, j * 16 + 8, 29, field_175802_d); + + if (flag) + { + return true; + } + } + + return false; + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + return new StructureOceanMonument.StartMonument(this.worldObj, this.rand, chunkX, chunkZ); + } + + public List getScatteredFeatureSpawnList() + { + return field_175803_h; + } + + static + { + field_175803_h.add(new BiomeGenBase.SpawnListEntry(EntityGuardian.class, 1, 2, 4)); + } + + public static class StartMonument extends StructureStart + { + private Set field_175791_c = Sets.newHashSet(); + private boolean field_175790_d; + + public StartMonument() + { + } + + public StartMonument(World worldIn, Random p_i45607_2_, int p_i45607_3_, int p_i45607_4_) + { + super(p_i45607_3_, p_i45607_4_); + this.func_175789_b(worldIn, p_i45607_2_, p_i45607_3_, p_i45607_4_); + } + + private void func_175789_b(World worldIn, Random p_175789_2_, int p_175789_3_, int p_175789_4_) + { + p_175789_2_.setSeed(worldIn.getSeed()); + long i = p_175789_2_.nextLong(); + long j = p_175789_2_.nextLong(); + long k = (long)p_175789_3_ * i; + long l = (long)p_175789_4_ * j; + p_175789_2_.setSeed(k ^ l ^ worldIn.getSeed()); + int i1 = p_175789_3_ * 16 + 8 - 29; + int j1 = p_175789_4_ * 16 + 8 - 29; + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(p_175789_2_); + this.components.add(new StructureOceanMonumentPieces.MonumentBuilding(p_175789_2_, i1, j1, enumfacing)); + this.updateBoundingBox(); + this.field_175790_d = true; + } + + public void generateStructure(World worldIn, Random rand, StructureBoundingBox structurebb) + { + if (!this.field_175790_d) + { + this.components.clear(); + this.func_175789_b(worldIn, rand, this.getChunkPosX(), this.getChunkPosZ()); + } + + super.generateStructure(worldIn, rand, structurebb); + } + + public boolean func_175788_a(ChunkCoordIntPair pair) + { + return this.field_175791_c.contains(pair) ? false : super.func_175788_a(pair); + } + + public void func_175787_b(ChunkCoordIntPair pair) + { + super.func_175787_b(pair); + this.field_175791_c.add(pair); + } + + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (ChunkCoordIntPair chunkcoordintpair : this.field_175791_c) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setInteger("X", chunkcoordintpair.chunkXPos); + nbttagcompound.setInteger("Z", chunkcoordintpair.chunkZPos); + nbttaglist.appendTag(nbttagcompound); + } + + tagCompound.setTag("Processed", nbttaglist); + } + + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + + if (tagCompound.hasKey("Processed", 9)) + { + NBTTagList nbttaglist = tagCompound.getTagList("Processed", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + this.field_175791_c.add(new ChunkCoordIntPair(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Z"))); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java new file mode 100644 index 0000000..9542388 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java @@ -0,0 +1,2238 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.BlockPrismarine; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class StructureOceanMonumentPieces +{ + public static void registerOceanMonumentPieces() + { + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.MonumentBuilding.class, "OMB"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.MonumentCoreRoom.class, "OMCR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleXRoom.class, "OMDXR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleXYRoom.class, "OMDXYR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleYRoom.class, "OMDYR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleYZRoom.class, "OMDYZR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.DoubleZRoom.class, "OMDZR"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.EntryRoom.class, "OMEntry"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.Penthouse.class, "OMPenthouse"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.SimpleRoom.class, "OMSimple"); + MapGenStructureIO.registerStructureComponent(StructureOceanMonumentPieces.SimpleTopRoom.class, "OMSimpleT"); + } + + public static class DoubleXRoom extends StructureOceanMonumentPieces.Piece + { + public DoubleXRoom() + { + } + + public DoubleXRoom(EnumFacing p_i45597_1_, StructureOceanMonumentPieces.RoomDefinition p_i45597_2_, Random p_i45597_3_) + { + super(1, p_i45597_1_, p_i45597_2_, 2, 1, 1); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.EAST.getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + + if (this.field_175830_k.field_175967_a / 25 > 0) + { + this.func_175821_a(worldIn, structureBoundingBoxIn, 8, 0, structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 0, structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 4, 1, 7, 4, 6, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 8, 4, 1, 14, 4, 6, field_175828_a); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 0, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, 3, 0, 15, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 0, 15, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 7, 14, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, 2, 0, 15, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 15, 2, 0, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 7, 14, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, 1, 0, 15, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 15, 1, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 7, 14, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 0, 10, 1, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 2, 0, 9, 2, 3, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 3, 0, 10, 3, 4, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175825_e, 6, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 9, 2, 3, structureBoundingBoxIn); + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 7, 4, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 11, 1, 0, 12, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 11, 1, 7, 12, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 15, 1, 3, 15, 2, 4, false); + } + + return true; + } + } + + public static class DoubleXYRoom extends StructureOceanMonumentPieces.Piece + { + public DoubleXYRoom() + { + } + + public DoubleXYRoom(EnumFacing p_i45596_1_, StructureOceanMonumentPieces.RoomDefinition p_i45596_2_, Random p_i45596_3_) + { + super(1, p_i45596_1_, p_i45596_2_, 2, 2, 1); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.EAST.getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition2 = structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP.getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition3 = structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()]; + + if (this.field_175830_k.field_175967_a / 25 > 0) + { + this.func_175821_a(worldIn, structureBoundingBoxIn, 8, 0, structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 0, structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 8, 1, 7, 8, 6, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 8, 8, 1, 14, 8, 6, field_175828_a); + } + + for (int i = 1; i <= 7; ++i) + { + IBlockState iblockstate = field_175826_b; + + if (i == 2 || i == 6) + { + iblockstate = field_175828_a; + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, i, 0, 0, i, 7, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, i, 0, 15, i, 7, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 0, 15, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 7, 14, i, 7, iblockstate, iblockstate, false); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 3, 2, 7, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 4, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 5, 4, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 1, 3, 13, 7, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 1, 2, 12, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 11, 1, 5, 12, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 3, 5, 3, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 1, 3, 10, 3, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 7, 2, 10, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 2, 5, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 5, 2, 10, 7, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 5, 5, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 5, 5, 10, 7, 5, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 6, 6, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 9, 6, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 6, 6, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 9, 6, 5, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 4, 3, 6, 4, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 4, 3, 10, 4, 4, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175825_e, 5, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 5, 4, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 10, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 10, 4, 5, structureBoundingBoxIn); + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 7, 4, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 11, 1, 0, 12, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 11, 1, 7, 12, 2, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 15, 1, 3, 15, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 5, 0, 4, 6, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 5, 7, 4, 6, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 5, 3, 0, 6, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 11, 5, 0, 12, 6, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 11, 5, 7, 12, 6, 7, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 15, 5, 3, 15, 6, 4, false); + } + + return true; + } + } + + public static class DoubleYRoom extends StructureOceanMonumentPieces.Piece + { + public DoubleYRoom() + { + } + + public DoubleYRoom(EnumFacing p_i45595_1_, StructureOceanMonumentPieces.RoomDefinition p_i45595_2_, Random p_i45595_3_) + { + super(1, p_i45595_1_, p_i45595_2_, 1, 2, 1); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_175830_k.field_175967_a / 25 > 0) + { + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 0, this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.UP.getIndex()]; + + if (structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 8, 1, 6, 8, 6, field_175828_a); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 0, 0, 4, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 4, 0, 7, 4, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 0, 6, 4, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 7, 6, 4, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 4, 1, 2, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 2, 1, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 4, 1, 5, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 4, 2, 6, 4, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 4, 5, 2, 4, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 5, 1, 4, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, 5, 4, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 4, 5, 6, 4, 5, field_175826_b, field_175826_b, false); + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + + for (int i = 1; i <= 5; i += 4) + { + int j = 0; + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, i, j, 2, i + 2, j, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, i, j, 5, i + 2, j, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, i + 2, j, 4, i + 2, j, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, i, j, 7, i + 2, j, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, i + 1, j, 7, i + 1, j, field_175828_a, field_175828_a, false); + } + + j = 7; + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, i, j, 2, i + 2, j, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, i, j, 5, i + 2, j, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, i + 2, j, 4, i + 2, j, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, i, j, 7, i + 2, j, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, i + 1, j, 7, i + 1, j, field_175828_a, field_175828_a, false); + } + + int k = 0; + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i, 2, k, i + 2, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i, 5, k, i + 2, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i + 2, 3, k, i + 2, 4, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i, 0, k, i + 2, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i + 1, 0, k, i + 1, 7, field_175828_a, field_175828_a, false); + } + + k = 7; + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i, 2, k, i + 2, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i, 5, k, i + 2, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i + 2, 3, k, i + 2, 4, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i, 0, k, i + 2, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k, i + 1, 0, k, i + 1, 7, field_175828_a, field_175828_a, false); + } + + structureoceanmonumentpieces$roomdefinition1 = structureoceanmonumentpieces$roomdefinition; + } + + return true; + } + } + + public static class DoubleYZRoom extends StructureOceanMonumentPieces.Piece + { + public DoubleYZRoom() + { + } + + public DoubleYZRoom(EnumFacing p_i45594_1_, StructureOceanMonumentPieces.RoomDefinition p_i45594_2_, Random p_i45594_3_) + { + super(1, p_i45594_1_, p_i45594_2_, 1, 2, 2); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.NORTH.getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition2 = structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition3 = structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP.getIndex()]; + + if (this.field_175830_k.field_175967_a / 25 > 0) + { + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 8, structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 0, structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 8, 1, 6, 8, 7, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 8, 8, 6, 8, 14, field_175828_a); + } + + for (int i = 1; i <= 7; ++i) + { + IBlockState iblockstate = field_175826_b; + + if (i == 2 || i == 6) + { + iblockstate = field_175828_a; + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, i, 0, 0, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, i, 0, 7, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 0, 6, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 15, 6, i, 15, iblockstate, iblockstate, false); + } + + for (int j = 1; j <= 7; ++j) + { + IBlockState iblockstate1 = field_175827_c; + + if (j == 2 || j == 6) + { + iblockstate1 = field_175825_e; + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, j, 7, 4, j, 8, iblockstate1, iblockstate1, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 7, 1, 3, 7, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 15, 4, 2, 15, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 11, 0, 2, 12, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 7, 1, 11, 7, 2, 12, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 5, 0, 4, 6, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 7, 5, 3, 7, 6, 4, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 4, 2, 6, 4, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 2, 6, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 5, 6, 3, 5, field_175826_b, field_175826_b, false); + } + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 5, 3, 0, 6, 4, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 2, 2, 4, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 2, 1, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 5, 1, 3, 5, field_175826_b, field_175826_b, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 5, 15, 4, 6, 15, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 5, 11, 0, 6, 12, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 10, 2, 4, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 10, 1, 3, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 13, 1, 3, 13, field_175826_b, field_175826_b, false); + } + + if (structureoceanmonumentpieces$roomdefinition2.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 7, 5, 11, 7, 6, 12, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 4, 10, 6, 4, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 10, 6, 3, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 13, 6, 3, 13, field_175826_b, field_175826_b, false); + } + + return true; + } + } + + public static class DoubleZRoom extends StructureOceanMonumentPieces.Piece + { + public DoubleZRoom() + { + } + + public DoubleZRoom(EnumFacing p_i45593_1_, StructureOceanMonumentPieces.RoomDefinition p_i45593_2_, Random p_i45593_3_) + { + super(1, p_i45593_1_, p_i45593_2_, 1, 1, 2); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = this.field_175830_k.field_175965_b[EnumFacing.NORTH.getIndex()]; + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1 = this.field_175830_k; + + if (this.field_175830_k.field_175967_a / 25 > 0) + { + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 8, structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.DOWN.getIndex()]); + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 0, structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 4, 1, 6, 4, 7, field_175828_a); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 4, 8, 6, 4, 14, field_175828_a); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 0, 3, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 0, 7, 3, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 0, 7, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 15, 6, 3, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 2, 15, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 0, 7, 2, 15, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 7, 2, 0, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 15, 6, 2, 15, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 1, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 0, 7, 1, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 7, 1, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 15, 6, 1, 15, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 1, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 1, 6, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 1, 1, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 1, 6, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 13, 1, 1, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 13, 6, 1, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 13, 1, 3, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 13, 6, 3, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 6, 2, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 6, 5, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 9, 2, 3, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 9, 5, 3, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 2, 6, 4, 2, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 2, 9, 4, 2, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 2, 7, 2, 2, 8, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 7, 5, 2, 8, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175825_e, 2, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 5, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 2, 2, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 5, 2, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 2, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 5, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 2, 3, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 5, 3, 10, structureBoundingBoxIn); + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 7, 1, 3, 7, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition1.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 3, 0, 2, 4, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 15, 4, 2, 15, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 11, 0, 2, 12, false); + } + + if (structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 7, 1, 11, 7, 2, 12, false); + } + + return true; + } + } + + public static class EntryRoom extends StructureOceanMonumentPieces.Piece + { + public EntryRoom() + { + } + + public EntryRoom(EnumFacing p_i45592_1_, StructureOceanMonumentPieces.RoomDefinition p_i45592_2_) + { + super(1, p_i45592_1_, p_i45592_2_, 1, 1, 1); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 2, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 3, 0, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 1, 2, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 2, 0, 7, 2, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 0, 7, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 7, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 2, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 0, 6, 3, 0, field_175826_b, field_175826_b, false); + + if (this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 7, 4, 2, 7, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 3, 1, 2, 4, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 6, 1, 3, 7, 2, 4, false); + } + + return true; + } + } + + static class FitSimpleRoomHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper + { + private FitSimpleRoomHelper() + { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_) + { + return true; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_) + { + p_175968_2_.field_175963_d = true; + return new StructureOceanMonumentPieces.SimpleRoom(p_175968_1_, p_175968_2_, p_175968_3_); + } + } + + static class FitSimpleRoomTopHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper + { + private FitSimpleRoomTopHelper() + { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_) + { + return !p_175969_1_.field_175966_c[EnumFacing.WEST.getIndex()] && !p_175969_1_.field_175966_c[EnumFacing.EAST.getIndex()] && !p_175969_1_.field_175966_c[EnumFacing.NORTH.getIndex()] && !p_175969_1_.field_175966_c[EnumFacing.SOUTH.getIndex()] && !p_175969_1_.field_175966_c[EnumFacing.UP.getIndex()]; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_) + { + p_175968_2_.field_175963_d = true; + return new StructureOceanMonumentPieces.SimpleTopRoom(p_175968_1_, p_175968_2_, p_175968_3_); + } + } + + public static class MonumentBuilding extends StructureOceanMonumentPieces.Piece + { + private StructureOceanMonumentPieces.RoomDefinition field_175845_o; + private StructureOceanMonumentPieces.RoomDefinition field_175844_p; + private List field_175843_q = Lists.newArrayList(); + + public MonumentBuilding() + { + } + + public MonumentBuilding(Random p_i45599_1_, int p_i45599_2_, int p_i45599_3_, EnumFacing p_i45599_4_) + { + super(0); + this.coordBaseMode = p_i45599_4_; + + switch (this.coordBaseMode) + { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(p_i45599_2_, 39, p_i45599_3_, p_i45599_2_ + 58 - 1, 61, p_i45599_3_ + 58 - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i45599_2_, 39, p_i45599_3_, p_i45599_2_ + 58 - 1, 61, p_i45599_3_ + 58 - 1); + } + + List list = this.func_175836_a(p_i45599_1_); + this.field_175845_o.field_175963_d = true; + this.field_175843_q.add(new StructureOceanMonumentPieces.EntryRoom(this.coordBaseMode, this.field_175845_o)); + this.field_175843_q.add(new StructureOceanMonumentPieces.MonumentCoreRoom(this.coordBaseMode, this.field_175844_p, p_i45599_1_)); + List list1 = Lists.newArrayList(); + list1.add(new StructureOceanMonumentPieces.XYDoubleRoomFitHelper()); + list1.add(new StructureOceanMonumentPieces.YZDoubleRoomFitHelper()); + list1.add(new StructureOceanMonumentPieces.ZDoubleRoomFitHelper()); + list1.add(new StructureOceanMonumentPieces.XDoubleRoomFitHelper()); + list1.add(new StructureOceanMonumentPieces.YDoubleRoomFitHelper()); + list1.add(new StructureOceanMonumentPieces.FitSimpleRoomTopHelper()); + list1.add(new StructureOceanMonumentPieces.FitSimpleRoomHelper()); + label319: + + for (StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition : list) + { + if (!structureoceanmonumentpieces$roomdefinition.field_175963_d && !structureoceanmonumentpieces$roomdefinition.func_175961_b()) + { + Iterator iterator = list1.iterator(); + StructureOceanMonumentPieces.MonumentRoomFitHelper structureoceanmonumentpieces$monumentroomfithelper; + + while (true) + { + if (!iterator.hasNext()) + { + continue label319; + } + + structureoceanmonumentpieces$monumentroomfithelper = (StructureOceanMonumentPieces.MonumentRoomFitHelper)iterator.next(); + + if (structureoceanmonumentpieces$monumentroomfithelper.func_175969_a(structureoceanmonumentpieces$roomdefinition)) + { + break; + } + } + + this.field_175843_q.add(structureoceanmonumentpieces$monumentroomfithelper.func_175968_a(this.coordBaseMode, structureoceanmonumentpieces$roomdefinition, p_i45599_1_)); + } + } + + int j = this.boundingBox.minY; + int k = this.getXWithOffset(9, 22); + int l = this.getZWithOffset(9, 22); + + for (StructureOceanMonumentPieces.Piece structureoceanmonumentpieces$piece : this.field_175843_q) + { + structureoceanmonumentpieces$piece.getBoundingBox().offset(k, j, l); + } + + StructureBoundingBox structureboundingbox1 = StructureBoundingBox.func_175899_a(this.getXWithOffset(1, 1), this.getYWithOffset(1), this.getZWithOffset(1, 1), this.getXWithOffset(23, 21), this.getYWithOffset(8), this.getZWithOffset(23, 21)); + StructureBoundingBox structureboundingbox2 = StructureBoundingBox.func_175899_a(this.getXWithOffset(34, 1), this.getYWithOffset(1), this.getZWithOffset(34, 1), this.getXWithOffset(56, 21), this.getYWithOffset(8), this.getZWithOffset(56, 21)); + StructureBoundingBox structureboundingbox = StructureBoundingBox.func_175899_a(this.getXWithOffset(22, 22), this.getYWithOffset(13), this.getZWithOffset(22, 22), this.getXWithOffset(35, 35), this.getYWithOffset(17), this.getZWithOffset(35, 35)); + int i = p_i45599_1_.nextInt(); + this.field_175843_q.add(new StructureOceanMonumentPieces.WingRoom(this.coordBaseMode, structureboundingbox1, i++)); + this.field_175843_q.add(new StructureOceanMonumentPieces.WingRoom(this.coordBaseMode, structureboundingbox2, i++)); + this.field_175843_q.add(new StructureOceanMonumentPieces.Penthouse(this.coordBaseMode, structureboundingbox)); + } + + private List func_175836_a(Random p_175836_1_) + { + StructureOceanMonumentPieces.RoomDefinition[] astructureoceanmonumentpieces$roomdefinition = new StructureOceanMonumentPieces.RoomDefinition[75]; + + for (int i = 0; i < 5; ++i) + { + for (int j = 0; j < 4; ++j) + { + int k = 0; + int l = func_175820_a(i, k, j); + astructureoceanmonumentpieces$roomdefinition[l] = new StructureOceanMonumentPieces.RoomDefinition(l); + } + } + + for (int i2 = 0; i2 < 5; ++i2) + { + for (int l2 = 0; l2 < 4; ++l2) + { + int k3 = 1; + int j4 = func_175820_a(i2, k3, l2); + astructureoceanmonumentpieces$roomdefinition[j4] = new StructureOceanMonumentPieces.RoomDefinition(j4); + } + } + + for (int j2 = 1; j2 < 4; ++j2) + { + for (int i3 = 0; i3 < 2; ++i3) + { + int l3 = 2; + int k4 = func_175820_a(j2, l3, i3); + astructureoceanmonumentpieces$roomdefinition[k4] = new StructureOceanMonumentPieces.RoomDefinition(k4); + } + } + + this.field_175845_o = astructureoceanmonumentpieces$roomdefinition[field_175823_g]; + + for (int k2 = 0; k2 < 5; ++k2) + { + for (int j3 = 0; j3 < 5; ++j3) + { + for (int i4 = 0; i4 < 3; ++i4) + { + int l4 = func_175820_a(k2, i4, j3); + + if (astructureoceanmonumentpieces$roomdefinition[l4] != null) + { + for (EnumFacing enumfacing : EnumFacing.values()) + { + int i1 = k2 + enumfacing.getFrontOffsetX(); + int j1 = i4 + enumfacing.getFrontOffsetY(); + int k1 = j3 + enumfacing.getFrontOffsetZ(); + + if (i1 >= 0 && i1 < 5 && k1 >= 0 && k1 < 5 && j1 >= 0 && j1 < 3) + { + int l1 = func_175820_a(i1, j1, k1); + + if (astructureoceanmonumentpieces$roomdefinition[l1] != null) + { + if (k1 != j3) + { + astructureoceanmonumentpieces$roomdefinition[l4].func_175957_a(enumfacing.getOpposite(), astructureoceanmonumentpieces$roomdefinition[l1]); + } + else + { + astructureoceanmonumentpieces$roomdefinition[l4].func_175957_a(enumfacing, astructureoceanmonumentpieces$roomdefinition[l1]); + } + } + } + } + } + } + } + } + + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition; + astructureoceanmonumentpieces$roomdefinition[field_175831_h].func_175957_a(EnumFacing.UP, structureoceanmonumentpieces$roomdefinition = new StructureOceanMonumentPieces.RoomDefinition(1003)); + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition1; + astructureoceanmonumentpieces$roomdefinition[field_175832_i].func_175957_a(EnumFacing.SOUTH, structureoceanmonumentpieces$roomdefinition1 = new StructureOceanMonumentPieces.RoomDefinition(1001)); + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition2; + astructureoceanmonumentpieces$roomdefinition[field_175829_j].func_175957_a(EnumFacing.SOUTH, structureoceanmonumentpieces$roomdefinition2 = new StructureOceanMonumentPieces.RoomDefinition(1002)); + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition1.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition2.field_175963_d = true; + this.field_175845_o.field_175964_e = true; + this.field_175844_p = astructureoceanmonumentpieces$roomdefinition[func_175820_a(p_175836_1_.nextInt(4), 0, 2)]; + this.field_175844_p.field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.NORTH.getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + this.field_175844_p.field_175965_b[EnumFacing.EAST.getIndex()].field_175965_b[EnumFacing.NORTH.getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + List list = Lists.newArrayList(); + + for (StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition4 : astructureoceanmonumentpieces$roomdefinition) + { + if (structureoceanmonumentpieces$roomdefinition4 != null) + { + structureoceanmonumentpieces$roomdefinition4.func_175958_a(); + list.add(structureoceanmonumentpieces$roomdefinition4); + } + } + + structureoceanmonumentpieces$roomdefinition.func_175958_a(); + Collections.shuffle(list, p_175836_1_); + int i5 = 1; + + for (StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition3 : list) + { + int j5 = 0; + int k5 = 0; + + while (j5 < 2 && k5 < 5) + { + ++k5; + int l5 = p_175836_1_.nextInt(6); + + if (structureoceanmonumentpieces$roomdefinition3.field_175966_c[l5]) + { + int i6 = EnumFacing.getFront(l5).getOpposite().getIndex(); + structureoceanmonumentpieces$roomdefinition3.field_175966_c[l5] = false; + structureoceanmonumentpieces$roomdefinition3.field_175965_b[l5].field_175966_c[i6] = false; + + if (structureoceanmonumentpieces$roomdefinition3.func_175959_a(i5++) && structureoceanmonumentpieces$roomdefinition3.field_175965_b[l5].func_175959_a(i5++)) + { + ++j5; + } + else + { + structureoceanmonumentpieces$roomdefinition3.field_175966_c[l5] = true; + structureoceanmonumentpieces$roomdefinition3.field_175965_b[l5].field_175966_c[i6] = true; + } + } + } + } + + list.add(structureoceanmonumentpieces$roomdefinition); + list.add(structureoceanmonumentpieces$roomdefinition1); + list.add(structureoceanmonumentpieces$roomdefinition2); + return list; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + int i = Math.max(worldIn.getSeaLevel(), 64) - this.boundingBox.minY; + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 0, 0, 58, i, 58, false); + this.func_175840_a(false, 0, worldIn, randomIn, structureBoundingBoxIn); + this.func_175840_a(true, 33, worldIn, randomIn, structureBoundingBoxIn); + this.func_175839_b(worldIn, randomIn, structureBoundingBoxIn); + this.func_175837_c(worldIn, randomIn, structureBoundingBoxIn); + this.func_175841_d(worldIn, randomIn, structureBoundingBoxIn); + this.func_175835_e(worldIn, randomIn, structureBoundingBoxIn); + this.func_175842_f(worldIn, randomIn, structureBoundingBoxIn); + this.func_175838_g(worldIn, randomIn, structureBoundingBoxIn); + + for (int j = 0; j < 7; ++j) + { + int k = 0; + + while (k < 7) + { + if (k == 0 && j == 3) + { + k = 6; + } + + int l = j * 9; + int i1 = k * 9; + + for (int j1 = 0; j1 < 4; ++j1) + { + for (int k1 = 0; k1 < 4; ++k1) + { + this.setBlockState(worldIn, field_175826_b, l + j1, 0, i1 + k1, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, field_175826_b, l + j1, -1, i1 + k1, structureBoundingBoxIn); + } + } + + if (j != 0 && j != 6) + { + k += 6; + } + else + { + ++k; + } + } + } + + for (int l1 = 0; l1 < 5; ++l1) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, -1 - l1, 0 + l1 * 2, -1 - l1, -1 - l1, 23, 58 + l1, false); + this.func_181655_a(worldIn, structureBoundingBoxIn, 58 + l1, 0 + l1 * 2, -1 - l1, 58 + l1, 23, 58 + l1, false); + this.func_181655_a(worldIn, structureBoundingBoxIn, 0 - l1, 0 + l1 * 2, -1 - l1, 57 + l1, 23, -1 - l1, false); + this.func_181655_a(worldIn, structureBoundingBoxIn, 0 - l1, 0 + l1 * 2, 58 + l1, 57 + l1, 23, 58 + l1, false); + } + + for (StructureOceanMonumentPieces.Piece structureoceanmonumentpieces$piece : this.field_175843_q) + { + if (structureoceanmonumentpieces$piece.getBoundingBox().intersectsWith(structureBoundingBoxIn)) + { + structureoceanmonumentpieces$piece.addComponentParts(worldIn, randomIn, structureBoundingBoxIn); + } + } + + return true; + } + + private void func_175840_a(boolean p_175840_1_, int p_175840_2_, World worldIn, Random p_175840_4_, StructureBoundingBox p_175840_5_) + { + int i = 24; + + if (this.func_175818_a(p_175840_5_, p_175840_2_, 0, p_175840_2_ + 23, 20)) + { + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 0, 0, 0, p_175840_2_ + 24, 0, 20, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175840_5_, p_175840_2_ + 0, 1, 0, p_175840_2_ + 24, 10, 20, false); + + for (int j = 0; j < 4; ++j) + { + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + j, j + 1, j, p_175840_2_ + j, j + 1, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + j + 7, j + 5, j + 7, p_175840_2_ + j + 7, j + 5, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 17 - j, j + 5, j + 7, p_175840_2_ + 17 - j, j + 5, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 24 - j, j + 1, j, p_175840_2_ + 24 - j, j + 1, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + j + 1, j + 1, j, p_175840_2_ + 23 - j, j + 1, j, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + j + 8, j + 5, j + 7, p_175840_2_ + 16 - j, j + 5, j + 7, field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 4, 4, 4, p_175840_2_ + 6, 4, 20, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 7, 4, 4, p_175840_2_ + 17, 4, 6, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 18, 4, 4, p_175840_2_ + 20, 4, 20, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 11, 8, 11, p_175840_2_ + 13, 8, 20, field_175828_a, field_175828_a, false); + this.setBlockState(worldIn, field_175824_d, p_175840_2_ + 12, 9, 12, p_175840_5_); + this.setBlockState(worldIn, field_175824_d, p_175840_2_ + 12, 9, 15, p_175840_5_); + this.setBlockState(worldIn, field_175824_d, p_175840_2_ + 12, 9, 18, p_175840_5_); + int j1 = p_175840_1_ ? p_175840_2_ + 19 : p_175840_2_ + 5; + int k = p_175840_1_ ? p_175840_2_ + 5 : p_175840_2_ + 19; + + for (int l = 20; l >= 5; l -= 3) + { + this.setBlockState(worldIn, field_175824_d, j1, 5, l, p_175840_5_); + } + + for (int k1 = 19; k1 >= 7; k1 -= 3) + { + this.setBlockState(worldIn, field_175824_d, k, 5, k1, p_175840_5_); + } + + for (int l1 = 0; l1 < 4; ++l1) + { + int i1 = p_175840_1_ ? p_175840_2_ + (24 - (17 - l1 * 3)) : p_175840_2_ + 17 - l1 * 3; + this.setBlockState(worldIn, field_175824_d, i1, 5, 5, p_175840_5_); + } + + this.setBlockState(worldIn, field_175824_d, k, 5, 5, p_175840_5_); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 11, 1, 12, p_175840_2_ + 13, 7, 12, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175840_5_, p_175840_2_ + 12, 1, 11, p_175840_2_ + 12, 7, 13, field_175828_a, field_175828_a, false); + } + } + + private void func_175839_b(World worldIn, Random p_175839_2_, StructureBoundingBox p_175839_3_) + { + if (this.func_175818_a(p_175839_3_, 22, 5, 35, 17)) + { + this.func_181655_a(worldIn, p_175839_3_, 25, 0, 0, 32, 8, 20, false); + + for (int i = 0; i < 4; ++i) + { + this.fillWithBlocks(worldIn, p_175839_3_, 24, 2, 5 + i * 4, 24, 4, 5 + i * 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175839_3_, 22, 4, 5 + i * 4, 23, 4, 5 + i * 4, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 25, 5, 5 + i * 4, p_175839_3_); + this.setBlockState(worldIn, field_175826_b, 26, 6, 5 + i * 4, p_175839_3_); + this.setBlockState(worldIn, field_175825_e, 26, 5, 5 + i * 4, p_175839_3_); + this.fillWithBlocks(worldIn, p_175839_3_, 33, 2, 5 + i * 4, 33, 4, 5 + i * 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175839_3_, 34, 4, 5 + i * 4, 35, 4, 5 + i * 4, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 32, 5, 5 + i * 4, p_175839_3_); + this.setBlockState(worldIn, field_175826_b, 31, 6, 5 + i * 4, p_175839_3_); + this.setBlockState(worldIn, field_175825_e, 31, 5, 5 + i * 4, p_175839_3_); + this.fillWithBlocks(worldIn, p_175839_3_, 27, 6, 5 + i * 4, 30, 6, 5 + i * 4, field_175828_a, field_175828_a, false); + } + } + } + + private void func_175837_c(World worldIn, Random p_175837_2_, StructureBoundingBox p_175837_3_) + { + if (this.func_175818_a(p_175837_3_, 15, 20, 42, 21)) + { + this.fillWithBlocks(worldIn, p_175837_3_, 15, 0, 21, 42, 0, 21, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175837_3_, 26, 1, 21, 31, 3, 21, false); + this.fillWithBlocks(worldIn, p_175837_3_, 21, 12, 21, 36, 12, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 17, 11, 21, 40, 11, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 16, 10, 21, 41, 10, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 15, 7, 21, 42, 9, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 16, 6, 21, 41, 6, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 17, 5, 21, 40, 5, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 21, 4, 21, 36, 4, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 22, 3, 21, 26, 3, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 31, 3, 21, 35, 3, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 23, 2, 21, 25, 2, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 32, 2, 21, 34, 2, 21, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175837_3_, 28, 4, 20, 29, 4, 21, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 27, 3, 21, p_175837_3_); + this.setBlockState(worldIn, field_175826_b, 30, 3, 21, p_175837_3_); + this.setBlockState(worldIn, field_175826_b, 26, 2, 21, p_175837_3_); + this.setBlockState(worldIn, field_175826_b, 31, 2, 21, p_175837_3_); + this.setBlockState(worldIn, field_175826_b, 25, 1, 21, p_175837_3_); + this.setBlockState(worldIn, field_175826_b, 32, 1, 21, p_175837_3_); + + for (int i = 0; i < 7; ++i) + { + this.setBlockState(worldIn, field_175827_c, 28 - i, 6 + i, 21, p_175837_3_); + this.setBlockState(worldIn, field_175827_c, 29 + i, 6 + i, 21, p_175837_3_); + } + + for (int j = 0; j < 4; ++j) + { + this.setBlockState(worldIn, field_175827_c, 28 - j, 9 + j, 21, p_175837_3_); + this.setBlockState(worldIn, field_175827_c, 29 + j, 9 + j, 21, p_175837_3_); + } + + this.setBlockState(worldIn, field_175827_c, 28, 12, 21, p_175837_3_); + this.setBlockState(worldIn, field_175827_c, 29, 12, 21, p_175837_3_); + + for (int k = 0; k < 3; ++k) + { + this.setBlockState(worldIn, field_175827_c, 22 - k * 2, 8, 21, p_175837_3_); + this.setBlockState(worldIn, field_175827_c, 22 - k * 2, 9, 21, p_175837_3_); + this.setBlockState(worldIn, field_175827_c, 35 + k * 2, 8, 21, p_175837_3_); + this.setBlockState(worldIn, field_175827_c, 35 + k * 2, 9, 21, p_175837_3_); + } + + this.func_181655_a(worldIn, p_175837_3_, 15, 13, 21, 42, 15, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 15, 1, 21, 15, 6, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 16, 1, 21, 16, 5, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 17, 1, 21, 20, 4, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 21, 1, 21, 21, 3, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 22, 1, 21, 22, 2, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 23, 1, 21, 24, 1, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 42, 1, 21, 42, 6, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 41, 1, 21, 41, 5, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 37, 1, 21, 40, 4, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 36, 1, 21, 36, 3, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 33, 1, 21, 34, 1, 21, false); + this.func_181655_a(worldIn, p_175837_3_, 35, 1, 21, 35, 2, 21, false); + } + } + + private void func_175841_d(World worldIn, Random p_175841_2_, StructureBoundingBox p_175841_3_) + { + if (this.func_175818_a(p_175841_3_, 21, 21, 36, 36)) + { + this.fillWithBlocks(worldIn, p_175841_3_, 21, 0, 22, 36, 0, 36, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175841_3_, 21, 1, 22, 36, 23, 36, false); + + for (int i = 0; i < 4; ++i) + { + this.fillWithBlocks(worldIn, p_175841_3_, 21 + i, 13 + i, 21 + i, 36 - i, 13 + i, 21 + i, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175841_3_, 21 + i, 13 + i, 36 - i, 36 - i, 13 + i, 36 - i, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175841_3_, 21 + i, 13 + i, 22 + i, 21 + i, 13 + i, 35 - i, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175841_3_, 36 - i, 13 + i, 22 + i, 36 - i, 13 + i, 35 - i, field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(worldIn, p_175841_3_, 25, 16, 25, 32, 16, 32, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175841_3_, 25, 17, 25, 25, 19, 25, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175841_3_, 32, 17, 25, 32, 19, 25, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175841_3_, 25, 17, 32, 25, 19, 32, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175841_3_, 32, 17, 32, 32, 19, 32, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 26, 20, 26, p_175841_3_); + this.setBlockState(worldIn, field_175826_b, 27, 21, 27, p_175841_3_); + this.setBlockState(worldIn, field_175825_e, 27, 20, 27, p_175841_3_); + this.setBlockState(worldIn, field_175826_b, 26, 20, 31, p_175841_3_); + this.setBlockState(worldIn, field_175826_b, 27, 21, 30, p_175841_3_); + this.setBlockState(worldIn, field_175825_e, 27, 20, 30, p_175841_3_); + this.setBlockState(worldIn, field_175826_b, 31, 20, 31, p_175841_3_); + this.setBlockState(worldIn, field_175826_b, 30, 21, 30, p_175841_3_); + this.setBlockState(worldIn, field_175825_e, 30, 20, 30, p_175841_3_); + this.setBlockState(worldIn, field_175826_b, 31, 20, 26, p_175841_3_); + this.setBlockState(worldIn, field_175826_b, 30, 21, 27, p_175841_3_); + this.setBlockState(worldIn, field_175825_e, 30, 20, 27, p_175841_3_); + this.fillWithBlocks(worldIn, p_175841_3_, 28, 21, 27, 29, 21, 27, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175841_3_, 27, 21, 28, 27, 21, 29, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175841_3_, 28, 21, 30, 29, 21, 30, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175841_3_, 30, 21, 28, 30, 21, 29, field_175828_a, field_175828_a, false); + } + } + + private void func_175835_e(World worldIn, Random p_175835_2_, StructureBoundingBox p_175835_3_) + { + if (this.func_175818_a(p_175835_3_, 0, 21, 6, 58)) + { + this.fillWithBlocks(worldIn, p_175835_3_, 0, 0, 21, 6, 0, 57, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175835_3_, 0, 1, 21, 6, 7, 57, false); + this.fillWithBlocks(worldIn, p_175835_3_, 4, 4, 21, 6, 4, 53, field_175828_a, field_175828_a, false); + + for (int i = 0; i < 4; ++i) + { + this.fillWithBlocks(worldIn, p_175835_3_, i, i + 1, 21, i, i + 1, 57 - i, field_175826_b, field_175826_b, false); + } + + for (int j = 23; j < 53; j += 3) + { + this.setBlockState(worldIn, field_175824_d, 5, 5, j, p_175835_3_); + } + + this.setBlockState(worldIn, field_175824_d, 5, 5, 52, p_175835_3_); + + for (int k = 0; k < 4; ++k) + { + this.fillWithBlocks(worldIn, p_175835_3_, k, k + 1, 21, k, k + 1, 57 - k, field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(worldIn, p_175835_3_, 4, 1, 52, 6, 3, 52, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175835_3_, 5, 1, 51, 5, 3, 53, field_175828_a, field_175828_a, false); + } + + if (this.func_175818_a(p_175835_3_, 51, 21, 58, 58)) + { + this.fillWithBlocks(worldIn, p_175835_3_, 51, 0, 21, 57, 0, 57, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175835_3_, 51, 1, 21, 57, 7, 57, false); + this.fillWithBlocks(worldIn, p_175835_3_, 51, 4, 21, 53, 4, 53, field_175828_a, field_175828_a, false); + + for (int l = 0; l < 4; ++l) + { + this.fillWithBlocks(worldIn, p_175835_3_, 57 - l, l + 1, 21, 57 - l, l + 1, 57 - l, field_175826_b, field_175826_b, false); + } + + for (int i1 = 23; i1 < 53; i1 += 3) + { + this.setBlockState(worldIn, field_175824_d, 52, 5, i1, p_175835_3_); + } + + this.setBlockState(worldIn, field_175824_d, 52, 5, 52, p_175835_3_); + this.fillWithBlocks(worldIn, p_175835_3_, 51, 1, 52, 53, 3, 52, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175835_3_, 52, 1, 51, 52, 3, 53, field_175828_a, field_175828_a, false); + } + + if (this.func_175818_a(p_175835_3_, 0, 51, 57, 57)) + { + this.fillWithBlocks(worldIn, p_175835_3_, 7, 0, 51, 50, 0, 57, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175835_3_, 7, 1, 51, 50, 10, 57, false); + + for (int j1 = 0; j1 < 4; ++j1) + { + this.fillWithBlocks(worldIn, p_175835_3_, j1 + 1, j1 + 1, 57 - j1, 56 - j1, j1 + 1, 57 - j1, field_175826_b, field_175826_b, false); + } + } + } + + private void func_175842_f(World worldIn, Random p_175842_2_, StructureBoundingBox p_175842_3_) + { + if (this.func_175818_a(p_175842_3_, 7, 21, 13, 50)) + { + this.fillWithBlocks(worldIn, p_175842_3_, 7, 0, 21, 13, 0, 50, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175842_3_, 7, 1, 21, 13, 10, 50, false); + this.fillWithBlocks(worldIn, p_175842_3_, 11, 8, 21, 13, 8, 53, field_175828_a, field_175828_a, false); + + for (int i = 0; i < 4; ++i) + { + this.fillWithBlocks(worldIn, p_175842_3_, i + 7, i + 5, 21, i + 7, i + 5, 54, field_175826_b, field_175826_b, false); + } + + for (int j = 21; j <= 45; j += 3) + { + this.setBlockState(worldIn, field_175824_d, 12, 9, j, p_175842_3_); + } + } + + if (this.func_175818_a(p_175842_3_, 44, 21, 50, 54)) + { + this.fillWithBlocks(worldIn, p_175842_3_, 44, 0, 21, 50, 0, 50, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175842_3_, 44, 1, 21, 50, 10, 50, false); + this.fillWithBlocks(worldIn, p_175842_3_, 44, 8, 21, 46, 8, 53, field_175828_a, field_175828_a, false); + + for (int k = 0; k < 4; ++k) + { + this.fillWithBlocks(worldIn, p_175842_3_, 50 - k, k + 5, 21, 50 - k, k + 5, 54, field_175826_b, field_175826_b, false); + } + + for (int l = 21; l <= 45; l += 3) + { + this.setBlockState(worldIn, field_175824_d, 45, 9, l, p_175842_3_); + } + } + + if (this.func_175818_a(p_175842_3_, 8, 44, 49, 54)) + { + this.fillWithBlocks(worldIn, p_175842_3_, 14, 0, 44, 43, 0, 50, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175842_3_, 14, 1, 44, 43, 10, 50, false); + + for (int i1 = 12; i1 <= 45; i1 += 3) + { + this.setBlockState(worldIn, field_175824_d, i1, 9, 45, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 9, 52, p_175842_3_); + + if (i1 == 12 || i1 == 18 || i1 == 24 || i1 == 33 || i1 == 39 || i1 == 45) + { + this.setBlockState(worldIn, field_175824_d, i1, 9, 47, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 9, 50, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 10, 45, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 10, 46, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 10, 51, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 10, 52, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 11, 47, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 11, 50, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 12, 48, p_175842_3_); + this.setBlockState(worldIn, field_175824_d, i1, 12, 49, p_175842_3_); + } + } + + for (int j1 = 0; j1 < 3; ++j1) + { + this.fillWithBlocks(worldIn, p_175842_3_, 8 + j1, 5 + j1, 54, 49 - j1, 5 + j1, 54, field_175828_a, field_175828_a, false); + } + + this.fillWithBlocks(worldIn, p_175842_3_, 11, 8, 54, 46, 8, 54, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175842_3_, 14, 8, 44, 43, 8, 53, field_175828_a, field_175828_a, false); + } + } + + private void func_175838_g(World worldIn, Random p_175838_2_, StructureBoundingBox p_175838_3_) + { + if (this.func_175818_a(p_175838_3_, 14, 21, 20, 43)) + { + this.fillWithBlocks(worldIn, p_175838_3_, 14, 0, 21, 20, 0, 43, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175838_3_, 14, 1, 22, 20, 14, 43, false); + this.fillWithBlocks(worldIn, p_175838_3_, 18, 12, 22, 20, 12, 39, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175838_3_, 18, 12, 21, 20, 12, 21, field_175826_b, field_175826_b, false); + + for (int i = 0; i < 4; ++i) + { + this.fillWithBlocks(worldIn, p_175838_3_, i + 14, i + 9, 21, i + 14, i + 9, 43 - i, field_175826_b, field_175826_b, false); + } + + for (int j = 23; j <= 39; j += 3) + { + this.setBlockState(worldIn, field_175824_d, 19, 13, j, p_175838_3_); + } + } + + if (this.func_175818_a(p_175838_3_, 37, 21, 43, 43)) + { + this.fillWithBlocks(worldIn, p_175838_3_, 37, 0, 21, 43, 0, 43, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175838_3_, 37, 1, 22, 43, 14, 43, false); + this.fillWithBlocks(worldIn, p_175838_3_, 37, 12, 22, 39, 12, 39, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175838_3_, 37, 12, 21, 39, 12, 21, field_175826_b, field_175826_b, false); + + for (int k = 0; k < 4; ++k) + { + this.fillWithBlocks(worldIn, p_175838_3_, 43 - k, k + 9, 21, 43 - k, k + 9, 43 - k, field_175826_b, field_175826_b, false); + } + + for (int l = 23; l <= 39; l += 3) + { + this.setBlockState(worldIn, field_175824_d, 38, 13, l, p_175838_3_); + } + } + + if (this.func_175818_a(p_175838_3_, 15, 37, 42, 43)) + { + this.fillWithBlocks(worldIn, p_175838_3_, 21, 0, 37, 36, 0, 43, field_175828_a, field_175828_a, false); + this.func_181655_a(worldIn, p_175838_3_, 21, 1, 37, 36, 14, 43, false); + this.fillWithBlocks(worldIn, p_175838_3_, 21, 12, 37, 36, 12, 39, field_175828_a, field_175828_a, false); + + for (int i1 = 0; i1 < 4; ++i1) + { + this.fillWithBlocks(worldIn, p_175838_3_, 15 + i1, i1 + 9, 43 - i1, 42 - i1, i1 + 9, 43 - i1, field_175826_b, field_175826_b, false); + } + + for (int j1 = 21; j1 <= 36; j1 += 3) + { + this.setBlockState(worldIn, field_175824_d, j1, 13, 38, p_175838_3_); + } + } + } + } + + public static class MonumentCoreRoom extends StructureOceanMonumentPieces.Piece + { + public MonumentCoreRoom() + { + } + + public MonumentCoreRoom(EnumFacing p_i45598_1_, StructureOceanMonumentPieces.RoomDefinition p_i45598_2_, Random p_i45598_3_) + { + super(1, p_i45598_1_, p_i45598_2_, 2, 2, 2); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 8, 0, 14, 8, 14, field_175828_a); + int i = 7; + IBlockState iblockstate = field_175826_b; + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, i, 0, 0, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, i, 0, 15, i, 15, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 0, 15, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 15, 14, i, 15, iblockstate, iblockstate, false); + + for (i = 1; i <= 6; ++i) + { + iblockstate = field_175826_b; + + if (i == 2 || i == 6) + { + iblockstate = field_175828_a; + } + + for (int j = 0; j <= 15; j += 15) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, j, i, 0, j, i, 1, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, j, i, 6, j, i, 9, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, j, i, 14, j, i, 15, iblockstate, iblockstate, false); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 0, 1, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, i, 0, 9, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 14, i, 0, 14, i, 0, iblockstate, iblockstate, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, i, 15, 14, i, 15, iblockstate, iblockstate, false); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 6, 9, 6, 9, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 4, 7, 8, 5, 8, Blocks.gold_block.getDefaultState(), Blocks.gold_block.getDefaultState(), false); + + for (i = 3; i <= 6; i += 3) + { + for (int k = 6; k <= 9; k += 3) + { + this.setBlockState(worldIn, field_175825_e, k, i, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, k, i, 9, structureBoundingBoxIn); + } + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 6, 5, 2, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 9, 5, 2, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 1, 6, 10, 2, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 1, 9, 10, 2, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 5, 6, 2, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 5, 9, 2, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 10, 6, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 10, 9, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 5, 5, 6, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 10, 5, 6, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 2, 5, 10, 6, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 2, 10, 10, 6, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 7, 1, 5, 7, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 7, 1, 10, 7, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 7, 9, 5, 7, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 7, 9, 10, 7, 14, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, 5, 6, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 7, 10, 6, 7, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 7, 5, 14, 7, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 7, 10, 14, 7, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 2, 1, 3, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 3, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 1, 2, 13, 1, 3, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 2, 12, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 12, 2, 1, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 13, 3, 1, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 1, 12, 13, 1, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, 13, 12, 1, 13, field_175826_b, field_175826_b, false); + return true; + } + } + + interface MonumentRoomFitHelper + { + boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_); + + StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_); + } + + public static class Penthouse extends StructureOceanMonumentPieces.Piece + { + public Penthouse() + { + } + + public Penthouse(EnumFacing p_i45591_1_, StructureBoundingBox p_i45591_2_) + { + super(p_i45591_1_, p_i45591_2_); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, -1, 2, 11, -1, 11, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, -1, 0, 1, -1, 11, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, -1, 0, 13, -1, 11, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, -1, 0, 11, -1, 1, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, -1, 12, 11, -1, 13, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 0, 0, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 0, 0, 13, 0, 13, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 0, 12, 0, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 13, 12, 0, 13, field_175826_b, field_175826_b, false); + + for (int i = 2; i <= 11; i += 3) + { + this.setBlockState(worldIn, field_175825_e, 0, 0, i, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 13, 0, i, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, i, 0, 0, structureBoundingBoxIn); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 0, 3, 4, 0, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 3, 11, 0, 9, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 9, 9, 0, 11, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175826_b, 5, 0, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 8, 0, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 10, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 3, 0, 10, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 0, 3, 3, 0, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 0, 3, 10, 0, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 0, 10, 7, 0, 10, field_175827_c, field_175827_c, false); + int l = 3; + + for (int j = 0; j < 2; ++j) + { + for (int k = 2; k <= 8; k += 3) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, l, 0, k, l, 2, k, field_175826_b, field_175826_b, false); + } + + l = 10; + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 0, 10, 5, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 0, 10, 8, 2, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, -1, 7, 7, -1, 8, field_175827_c, field_175827_c, false); + this.func_181655_a(worldIn, structureBoundingBoxIn, 6, -1, 3, 7, -1, 4, false); + this.func_175817_a(worldIn, structureBoundingBoxIn, 6, 1, 6); + return true; + } + } + + public abstract static class Piece extends StructureComponent + { + protected static final IBlockState field_175828_a = Blocks.prismarine.getStateFromMeta(BlockPrismarine.ROUGH_META); + protected static final IBlockState field_175826_b = Blocks.prismarine.getStateFromMeta(BlockPrismarine.BRICKS_META); + protected static final IBlockState field_175827_c = Blocks.prismarine.getStateFromMeta(BlockPrismarine.DARK_META); + protected static final IBlockState field_175824_d = field_175826_b; + protected static final IBlockState field_175825_e = Blocks.sea_lantern.getDefaultState(); + protected static final IBlockState field_175822_f = Blocks.water.getDefaultState(); + protected static final int field_175823_g = func_175820_a(2, 0, 0); + protected static final int field_175831_h = func_175820_a(2, 2, 0); + protected static final int field_175832_i = func_175820_a(0, 1, 0); + protected static final int field_175829_j = func_175820_a(4, 1, 0); + protected StructureOceanMonumentPieces.RoomDefinition field_175830_k; + + protected static final int func_175820_a(int p_175820_0_, int p_175820_1_, int p_175820_2_) + { + return p_175820_1_ * 25 + p_175820_2_ * 5 + p_175820_0_; + } + + public Piece() + { + super(0); + } + + public Piece(int p_i45588_1_) + { + super(p_i45588_1_); + } + + public Piece(EnumFacing p_i45589_1_, StructureBoundingBox p_i45589_2_) + { + super(1); + this.coordBaseMode = p_i45589_1_; + this.boundingBox = p_i45589_2_; + } + + protected Piece(int p_i45590_1_, EnumFacing p_i45590_2_, StructureOceanMonumentPieces.RoomDefinition p_i45590_3_, int p_i45590_4_, int p_i45590_5_, int p_i45590_6_) + { + super(p_i45590_1_); + this.coordBaseMode = p_i45590_2_; + this.field_175830_k = p_i45590_3_; + int i = p_i45590_3_.field_175967_a; + int j = i % 5; + int k = i / 5 % 5; + int l = i / 25; + + if (p_i45590_2_ != EnumFacing.NORTH && p_i45590_2_ != EnumFacing.SOUTH) + { + this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_6_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_4_ * 8 - 1); + } + else + { + this.boundingBox = new StructureBoundingBox(0, 0, 0, p_i45590_4_ * 8 - 1, p_i45590_5_ * 4 - 1, p_i45590_6_ * 8 - 1); + } + + switch (p_i45590_2_) + { + case NORTH: + this.boundingBox.offset(j * 8, l * 4, -(k + p_i45590_6_) * 8 + 1); + break; + + case SOUTH: + this.boundingBox.offset(j * 8, l * 4, k * 8); + break; + + case WEST: + this.boundingBox.offset(-(k + p_i45590_6_) * 8 + 1, l * 4, j * 8); + break; + + default: + this.boundingBox.offset(k * 8, l * 4, j * 8); + } + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + } + + protected void func_181655_a(World p_181655_1_, StructureBoundingBox p_181655_2_, int p_181655_3_, int p_181655_4_, int p_181655_5_, int p_181655_6_, int p_181655_7_, int p_181655_8_, boolean p_181655_9_) + { + for (int i = p_181655_4_; i <= p_181655_7_; ++i) + { + for (int j = p_181655_3_; j <= p_181655_6_; ++j) + { + for (int k = p_181655_5_; k <= p_181655_8_; ++k) + { + if (!p_181655_9_ || this.getBlockStateFromPos(p_181655_1_, j, i, k, p_181655_2_).getBlock().getMaterial() != Material.air) + { + if (this.getYWithOffset(i) >= p_181655_1_.getSeaLevel()) + { + this.setBlockState(p_181655_1_, Blocks.air.getDefaultState(), j, i, k, p_181655_2_); + } + else + { + this.setBlockState(p_181655_1_, field_175822_f, j, i, k, p_181655_2_); + } + } + } + } + } + } + + protected void func_175821_a(World worldIn, StructureBoundingBox p_175821_2_, int p_175821_3_, int p_175821_4_, boolean p_175821_5_) + { + if (p_175821_5_) + { + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 0, 0, p_175821_4_ + 0, p_175821_3_ + 2, 0, p_175821_4_ + 8 - 1, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 5, 0, p_175821_4_ + 0, p_175821_3_ + 8 - 1, 0, p_175821_4_ + 8 - 1, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 3, 0, p_175821_4_ + 0, p_175821_3_ + 4, 0, p_175821_4_ + 2, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 3, 0, p_175821_4_ + 5, p_175821_3_ + 4, 0, p_175821_4_ + 8 - 1, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 3, 0, p_175821_4_ + 2, p_175821_3_ + 4, 0, p_175821_4_ + 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 3, 0, p_175821_4_ + 5, p_175821_3_ + 4, 0, p_175821_4_ + 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 2, 0, p_175821_4_ + 3, p_175821_3_ + 2, 0, p_175821_4_ + 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 5, 0, p_175821_4_ + 3, p_175821_3_ + 5, 0, p_175821_4_ + 4, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, p_175821_2_, p_175821_3_ + 0, 0, p_175821_4_ + 0, p_175821_3_ + 8 - 1, 0, p_175821_4_ + 8 - 1, field_175828_a, field_175828_a, false); + } + } + + protected void func_175819_a(World worldIn, StructureBoundingBox p_175819_2_, int p_175819_3_, int p_175819_4_, int p_175819_5_, int p_175819_6_, int p_175819_7_, int p_175819_8_, IBlockState p_175819_9_) + { + for (int i = p_175819_4_; i <= p_175819_7_; ++i) + { + for (int j = p_175819_3_; j <= p_175819_6_; ++j) + { + for (int k = p_175819_5_; k <= p_175819_8_; ++k) + { + if (this.getBlockStateFromPos(worldIn, j, i, k, p_175819_2_) == field_175822_f) + { + this.setBlockState(worldIn, p_175819_9_, j, i, k, p_175819_2_); + } + } + } + } + } + + protected boolean func_175818_a(StructureBoundingBox p_175818_1_, int p_175818_2_, int p_175818_3_, int p_175818_4_, int p_175818_5_) + { + int i = this.getXWithOffset(p_175818_2_, p_175818_3_); + int j = this.getZWithOffset(p_175818_2_, p_175818_3_); + int k = this.getXWithOffset(p_175818_4_, p_175818_5_); + int l = this.getZWithOffset(p_175818_4_, p_175818_5_); + return p_175818_1_.intersectsWith(Math.min(i, k), Math.min(j, l), Math.max(i, k), Math.max(j, l)); + } + + protected boolean func_175817_a(World worldIn, StructureBoundingBox p_175817_2_, int p_175817_3_, int p_175817_4_, int p_175817_5_) + { + int i = this.getXWithOffset(p_175817_3_, p_175817_5_); + int j = this.getYWithOffset(p_175817_4_); + int k = this.getZWithOffset(p_175817_3_, p_175817_5_); + + if (p_175817_2_.isVecInside(new BlockPos(i, j, k))) + { + EntityGuardian entityguardian = new EntityGuardian(worldIn); + entityguardian.setElder(true); + entityguardian.heal(entityguardian.getMaxHealth()); + entityguardian.setLocationAndAngles((double)i + 0.5D, (double)j, (double)k + 0.5D, 0.0F, 0.0F); + entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), (IEntityLivingData)null); + worldIn.spawnEntityInWorld(entityguardian); + return true; + } + else + { + return false; + } + } + } + + static class RoomDefinition + { + int field_175967_a; + StructureOceanMonumentPieces.RoomDefinition[] field_175965_b = new StructureOceanMonumentPieces.RoomDefinition[6]; + boolean[] field_175966_c = new boolean[6]; + boolean field_175963_d; + boolean field_175964_e; + int field_175962_f; + + public RoomDefinition(int p_i45584_1_) + { + this.field_175967_a = p_i45584_1_; + } + + public void func_175957_a(EnumFacing p_175957_1_, StructureOceanMonumentPieces.RoomDefinition p_175957_2_) + { + this.field_175965_b[p_175957_1_.getIndex()] = p_175957_2_; + p_175957_2_.field_175965_b[p_175957_1_.getOpposite().getIndex()] = this; + } + + public void func_175958_a() + { + for (int i = 0; i < 6; ++i) + { + this.field_175966_c[i] = this.field_175965_b[i] != null; + } + } + + public boolean func_175959_a(int p_175959_1_) + { + if (this.field_175964_e) + { + return true; + } + else + { + this.field_175962_f = p_175959_1_; + + for (int i = 0; i < 6; ++i) + { + if (this.field_175965_b[i] != null && this.field_175966_c[i] && this.field_175965_b[i].field_175962_f != p_175959_1_ && this.field_175965_b[i].func_175959_a(p_175959_1_)) + { + return true; + } + } + + return false; + } + } + + public boolean func_175961_b() + { + return this.field_175967_a >= 75; + } + + public int func_175960_c() + { + int i = 0; + + for (int j = 0; j < 6; ++j) + { + if (this.field_175966_c[j]) + { + ++i; + } + } + + return i; + } + } + + public static class SimpleRoom extends StructureOceanMonumentPieces.Piece + { + private int field_175833_o; + + public SimpleRoom() + { + } + + public SimpleRoom(EnumFacing p_i45587_1_, StructureOceanMonumentPieces.RoomDefinition p_i45587_2_, Random p_i45587_3_) + { + super(1, p_i45587_1_, p_i45587_2_, 1, 1, 1); + this.field_175833_o = p_i45587_3_.nextInt(3); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_175830_k.field_175967_a / 25 > 0) + { + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 0, this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (this.field_175830_k.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 4, 1, 6, 4, 6, field_175828_a); + } + + boolean flag = this.field_175833_o != 0 && randomIn.nextBoolean() && !this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()] && !this.field_175830_k.field_175966_c[EnumFacing.UP.getIndex()] && this.field_175830_k.func_175960_c() > 1; + + if (this.field_175833_o == 0) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 2, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 2, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 2, 2, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 2, 2, 0, field_175828_a, field_175828_a, false); + this.setBlockState(worldIn, field_175825_e, 1, 2, 1, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 0, 7, 1, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 3, 0, 7, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 0, 7, 2, 2, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 0, 6, 2, 0, field_175828_a, field_175828_a, false); + this.setBlockState(worldIn, field_175825_e, 6, 2, 1, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 5, 2, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 5, 2, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 5, 0, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 7, 2, 2, 7, field_175828_a, field_175828_a, false); + this.setBlockState(worldIn, field_175825_e, 1, 2, 6, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 5, 7, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 3, 5, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 5, 7, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 7, 6, 2, 7, field_175828_a, field_175828_a, false); + this.setBlockState(worldIn, field_175825_e, 6, 2, 6, structureBoundingBoxIn); + + if (this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 0, 4, 3, 0, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 0, 4, 3, 1, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 2, 0, 4, 2, 0, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 1, 1, field_175826_b, field_175826_b, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 7, 4, 3, 7, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 6, 4, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 2, 7, 4, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 6, 4, 1, 7, field_175826_b, field_175826_b, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 3, 0, 3, 4, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 3, 1, 3, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 3, 0, 2, 4, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 3, 1, 1, 4, field_175826_b, field_175826_b, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 3, 7, 3, 4, field_175826_b, field_175826_b, false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 3, 3, 7, 3, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 3, 7, 2, 4, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 3, 7, 1, 4, field_175826_b, field_175826_b, false); + } + } + else if (this.field_175833_o == 1) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 2, 3, 2, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 5, 2, 3, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 5, 5, 3, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 2, 5, 3, 2, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175825_e, 2, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 2, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 5, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 5, 2, 2, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 1, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 1, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 7, 1, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 6, 0, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 7, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 6, 7, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 0, 7, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 1, 7, 3, 1, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175828_a, 1, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175828_a, 0, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175828_a, 1, 2, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175828_a, 0, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175828_a, 6, 2, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175828_a, 7, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175828_a, 6, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175828_a, 7, 2, 1, structureBoundingBoxIn); + + if (!this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 0, 6, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 6, 2, 0, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 6, 1, 0, field_175826_b, field_175826_b, false); + } + + if (!this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 7, 6, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 7, 6, 2, 7, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 7, 6, 1, 7, field_175826_b, field_175826_b, false); + } + + if (!this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 1, 0, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 1, 0, 2, 6, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 1, 6, field_175826_b, field_175826_b, false); + } + + if (!this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 1, 7, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 1, 7, 2, 6, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 1, 7, 1, 6, field_175826_b, field_175826_b, false); + } + } + else if (this.field_175833_o == 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 0, 7, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 6, 1, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 7, 6, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 0, 7, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 6, 2, 0, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 7, 6, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 0, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 0, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 0, 6, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 7, 6, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 3, 0, 2, 4, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 3, 7, 2, 4, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 7, 4, 2, 7, field_175827_c, field_175827_c, false); + + if (this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.NORTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 7, 4, 2, 7, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.WEST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 0, 1, 3, 0, 2, 4, false); + } + + if (this.field_175830_k.field_175966_c[EnumFacing.EAST.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 7, 1, 3, 7, 2, 4, false); + } + } + + if (flag) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 3, 4, 1, 4, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 2, 3, 4, 2, 4, field_175828_a, field_175828_a, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 3, 4, 3, 4, field_175826_b, field_175826_b, false); + } + + return true; + } + } + + public static class SimpleTopRoom extends StructureOceanMonumentPieces.Piece + { + public SimpleTopRoom() + { + } + + public SimpleTopRoom(EnumFacing p_i45586_1_, StructureOceanMonumentPieces.RoomDefinition p_i45586_2_, Random p_i45586_3_) + { + super(1, p_i45586_1_, p_i45586_2_, 1, 1, 1); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_175830_k.field_175967_a / 25 > 0) + { + this.func_175821_a(worldIn, structureBoundingBoxIn, 0, 0, this.field_175830_k.field_175966_c[EnumFacing.DOWN.getIndex()]); + } + + if (this.field_175830_k.field_175965_b[EnumFacing.UP.getIndex()] == null) + { + this.func_175819_a(worldIn, structureBoundingBoxIn, 1, 4, 1, 6, 4, 6, field_175828_a); + } + + for (int i = 1; i <= 6; ++i) + { + for (int j = 1; j <= 6; ++j) + { + if (randomIn.nextInt(3) != 0) + { + int k = 2 + (randomIn.nextInt(4) == 0 ? 0 : 1); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, k, j, i, 3, j, Blocks.sponge.getStateFromMeta(1), Blocks.sponge.getStateFromMeta(1), false); + } + } + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 0, 7, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 6, 1, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 7, 6, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 0, 7, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 6, 2, 0, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 7, 6, 2, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 0, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 0, 7, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 0, 6, 3, 0, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 7, 6, 3, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 3, 0, 2, 4, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 3, 7, 2, 4, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 7, 4, 2, 7, field_175827_c, field_175827_c, false); + + if (this.field_175830_k.field_175966_c[EnumFacing.SOUTH.getIndex()]) + { + this.func_181655_a(worldIn, structureBoundingBoxIn, 3, 1, 0, 4, 2, 0, false); + } + + return true; + } + } + + public static class WingRoom extends StructureOceanMonumentPieces.Piece + { + private int field_175834_o; + + public WingRoom() + { + } + + public WingRoom(EnumFacing p_i45585_1_, StructureBoundingBox p_i45585_2_, int p_i45585_3_) + { + super(p_i45585_1_, p_i45585_2_); + this.field_175834_o = p_i45585_3_ & 1; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_175834_o == 0) + { + for (int i = 0; i < 4; ++i) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10 - i, 3 - i, 20 - i, 12 + i, 3 - i, 20, field_175826_b, field_175826_b, false); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 0, 6, 15, 0, 16, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 0, 6, 6, 3, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 16, 0, 6, 16, 3, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 7, 7, 1, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, 1, 7, 15, 1, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 1, 6, 9, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 1, 6, 15, 3, 6, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 1, 7, 9, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 1, 7, 14, 1, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 5, 13, 0, 5, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 0, 7, 12, 0, 7, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 0, 10, 8, 0, 12, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 14, 0, 10, 14, 0, 12, field_175827_c, field_175827_c, false); + + for (int i1 = 18; i1 >= 7; i1 -= 3) + { + this.setBlockState(worldIn, field_175825_e, 6, 3, i1, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 16, 3, i1, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, field_175825_e, 10, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 12, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 10, 0, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 12, 0, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 8, 3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 14, 3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 4, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 4, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 4, 0, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 18, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 18, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 18, 0, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 4, 2, 18, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 4, 1, 18, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 4, 0, 18, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 18, 2, 18, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, 18, 1, 18, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 18, 0, 18, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 9, 7, 20, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, 13, 7, 20, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 0, 21, 7, 4, 21, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 15, 0, 21, 16, 4, 21, field_175826_b, field_175826_b, false); + this.func_175817_a(worldIn, structureBoundingBoxIn, 11, 2, 16); + } + else if (this.field_175834_o == 1) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 3, 18, 13, 3, 20, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 18, 9, 2, 18, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 13, 0, 18, 13, 2, 18, field_175826_b, field_175826_b, false); + int j1 = 9; + int j = 20; + int k = 5; + + for (int l = 0; l < 2; ++l) + { + this.setBlockState(worldIn, field_175826_b, j1, k + 1, j, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, j1, k, j, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175826_b, j1, k - 1, j, structureBoundingBoxIn); + j1 = 13; + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 3, 7, 15, 3, 14, field_175826_b, field_175826_b, false); + j1 = 10; + + for (int k1 = 0; k1 < 2; ++k1) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, j1, 0, 10, j1, 6, 10, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, j1, 0, 12, j1, 6, 12, field_175826_b, field_175826_b, false); + this.setBlockState(worldIn, field_175825_e, j1, 0, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, j1, 0, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, j1, 4, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, field_175825_e, j1, 4, 12, structureBoundingBoxIn); + j1 = 12; + } + + j1 = 8; + + for (int l1 = 0; l1 < 2; ++l1) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, j1, 0, 7, j1, 2, 7, field_175826_b, field_175826_b, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, j1, 0, 14, j1, 2, 14, field_175826_b, field_175826_b, false); + j1 = 14; + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 3, 8, 8, 3, 13, field_175827_c, field_175827_c, false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 14, 3, 8, 14, 3, 13, field_175827_c, field_175827_c, false); + this.func_175817_a(worldIn, structureBoundingBoxIn, 11, 5, 13); + } + + return true; + } + } + + static class XDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper + { + private XDoubleRoomFitHelper() + { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_) + { + return p_175969_1_.field_175966_c[EnumFacing.EAST.getIndex()] && !p_175969_1_.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_) + { + p_175968_2_.field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleXRoom(p_175968_1_, p_175968_2_, p_175968_3_); + } + } + + static class XYDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper + { + private XYDoubleRoomFitHelper() + { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_) + { + if (p_175969_1_.field_175966_c[EnumFacing.EAST.getIndex()] && !p_175969_1_.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d && p_175969_1_.field_175966_c[EnumFacing.UP.getIndex()] && !p_175969_1_.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d) + { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = p_175969_1_.field_175965_b[EnumFacing.EAST.getIndex()]; + return structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.UP.getIndex()] && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d; + } + else + { + return false; + } + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_) + { + p_175968_2_.field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.EAST.getIndex()].field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.EAST.getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleXYRoom(p_175968_1_, p_175968_2_, p_175968_3_); + } + } + + static class YDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper + { + private YDoubleRoomFitHelper() + { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_) + { + return p_175969_1_.field_175966_c[EnumFacing.UP.getIndex()] && !p_175969_1_.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_) + { + p_175968_2_.field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleYRoom(p_175968_1_, p_175968_2_, p_175968_3_); + } + } + + static class YZDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper + { + private YZDoubleRoomFitHelper() + { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_) + { + if (p_175969_1_.field_175966_c[EnumFacing.NORTH.getIndex()] && !p_175969_1_.field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d && p_175969_1_.field_175966_c[EnumFacing.UP.getIndex()] && !p_175969_1_.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d) + { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = p_175969_1_.field_175965_b[EnumFacing.NORTH.getIndex()]; + return structureoceanmonumentpieces$roomdefinition.field_175966_c[EnumFacing.UP.getIndex()] && !structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d; + } + else + { + return false; + } + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_) + { + p_175968_2_.field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + p_175968_2_.field_175965_b[EnumFacing.NORTH.getIndex()].field_175965_b[EnumFacing.UP.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleYZRoom(p_175968_1_, p_175968_2_, p_175968_3_); + } + } + + static class ZDoubleRoomFitHelper implements StructureOceanMonumentPieces.MonumentRoomFitHelper + { + private ZDoubleRoomFitHelper() + { + } + + public boolean func_175969_a(StructureOceanMonumentPieces.RoomDefinition p_175969_1_) + { + return p_175969_1_.field_175966_c[EnumFacing.NORTH.getIndex()] && !p_175969_1_.field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d; + } + + public StructureOceanMonumentPieces.Piece func_175968_a(EnumFacing p_175968_1_, StructureOceanMonumentPieces.RoomDefinition p_175968_2_, Random p_175968_3_) + { + StructureOceanMonumentPieces.RoomDefinition structureoceanmonumentpieces$roomdefinition = p_175968_2_; + + if (!p_175968_2_.field_175966_c[EnumFacing.NORTH.getIndex()] || p_175968_2_.field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d) + { + structureoceanmonumentpieces$roomdefinition = p_175968_2_.field_175965_b[EnumFacing.SOUTH.getIndex()]; + } + + structureoceanmonumentpieces$roomdefinition.field_175963_d = true; + structureoceanmonumentpieces$roomdefinition.field_175965_b[EnumFacing.NORTH.getIndex()].field_175963_d = true; + return new StructureOceanMonumentPieces.DoubleZRoom(p_175968_1_, structureoceanmonumentpieces$roomdefinition, p_175968_3_); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureStart.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureStart.java new file mode 100644 index 0000000..f4de095 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureStart.java @@ -0,0 +1,175 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Random; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; + +public abstract class StructureStart +{ + protected LinkedList components = new LinkedList(); + protected StructureBoundingBox boundingBox; + private int chunkPosX; + private int chunkPosZ; + + public StructureStart() + { + } + + public StructureStart(int chunkX, int chunkZ) + { + this.chunkPosX = chunkX; + this.chunkPosZ = chunkZ; + } + + public StructureBoundingBox getBoundingBox() + { + return this.boundingBox; + } + + public LinkedList getComponents() + { + return this.components; + } + + public void generateStructure(World worldIn, Random rand, StructureBoundingBox structurebb) + { + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + StructureComponent structurecomponent = (StructureComponent)iterator.next(); + + if (structurecomponent.getBoundingBox().intersectsWith(structurebb) && !structurecomponent.addComponentParts(worldIn, rand, structurebb)) + { + iterator.remove(); + } + } + } + + protected void updateBoundingBox() + { + this.boundingBox = StructureBoundingBox.getNewBoundingBox(); + + for (StructureComponent structurecomponent : this.components) + { + this.boundingBox.expandTo(structurecomponent.getBoundingBox()); + } + } + + public NBTTagCompound writeStructureComponentsToNBT(int chunkX, int chunkZ) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("id", MapGenStructureIO.getStructureStartName(this)); + nbttagcompound.setInteger("ChunkX", chunkX); + nbttagcompound.setInteger("ChunkZ", chunkZ); + nbttagcompound.setTag("BB", this.boundingBox.toNBTTagIntArray()); + NBTTagList nbttaglist = new NBTTagList(); + + for (StructureComponent structurecomponent : this.components) + { + nbttaglist.appendTag(structurecomponent.createStructureBaseNBT()); + } + + nbttagcompound.setTag("Children", nbttaglist); + this.writeToNBT(nbttagcompound); + return nbttagcompound; + } + + public void writeToNBT(NBTTagCompound tagCompound) + { + } + + public void readStructureComponentsFromNBT(World worldIn, NBTTagCompound tagCompound) + { + this.chunkPosX = tagCompound.getInteger("ChunkX"); + this.chunkPosZ = tagCompound.getInteger("ChunkZ"); + + if (tagCompound.hasKey("BB")) + { + this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB")); + } + + NBTTagList nbttaglist = tagCompound.getTagList("Children", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + this.components.add(MapGenStructureIO.getStructureComponent(nbttaglist.getCompoundTagAt(i), worldIn)); + } + + this.readFromNBT(tagCompound); + } + + public void readFromNBT(NBTTagCompound tagCompound) + { + } + + protected void markAvailableHeight(World worldIn, Random rand, int p_75067_3_) + { + int i = worldIn.getSeaLevel() - p_75067_3_; + int j = this.boundingBox.getYSize() + 1; + + if (j < i) + { + j += rand.nextInt(i - j); + } + + int k = j - this.boundingBox.maxY; + this.boundingBox.offset(0, k, 0); + + for (StructureComponent structurecomponent : this.components) + { + structurecomponent.func_181138_a(0, k, 0); + } + } + + protected void setRandomHeight(World worldIn, Random rand, int p_75070_3_, int p_75070_4_) + { + int i = p_75070_4_ - p_75070_3_ + 1 - this.boundingBox.getYSize(); + int j = 1; + + if (i > 1) + { + j = p_75070_3_ + rand.nextInt(i); + } + else + { + j = p_75070_3_; + } + + int k = j - this.boundingBox.minY; + this.boundingBox.offset(0, k, 0); + + for (StructureComponent structurecomponent : this.components) + { + structurecomponent.func_181138_a(0, k, 0); + } + } + + public boolean isSizeableStructure() + { + return true; + } + + public boolean func_175788_a(ChunkCoordIntPair pair) + { + return true; + } + + public void func_175787_b(ChunkCoordIntPair pair) + { + } + + public int getChunkPosX() + { + return this.chunkPosX; + } + + public int getChunkPosZ() + { + return this.chunkPosZ; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java new file mode 100644 index 0000000..1403178 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java @@ -0,0 +1,1635 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Random; +import net.minecraft.block.BlockEndPortalFrame; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +@SuppressWarnings("incomplete-switch") +public class StructureStrongholdPieces +{ + private static final StructureStrongholdPieces.PieceWeight[] pieceWeightArray = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) + { + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) + { + return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 4; + } + }, new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.PortalRoom.class, 20, 1) + { + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) + { + return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 5; + } + } + }; + private static List structurePieceList; + private static Class strongComponentType; + static int totalWeight; + private static final StructureStrongholdPieces.Stones strongholdStones = new StructureStrongholdPieces.Stones(); + + public static void registerStrongholdPieces() + { + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.ChestCorridor.class, "SHCC"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Corridor.class, "SHFC"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Crossing.class, "SH5C"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.LeftTurn.class, "SHLT"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Library.class, "SHLi"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.PortalRoom.class, "SHPR"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Prison.class, "SHPH"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RightTurn.class, "SHRT"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.RoomCrossing.class, "SHRC"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs.class, "SHSD"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Stairs2.class, "SHStart"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.Straight.class, "SHS"); + MapGenStructureIO.registerStructureComponent(StructureStrongholdPieces.StairsStraight.class, "SHSSD"); + } + + public static void prepareStructurePieces() + { + structurePieceList = Lists.newArrayList(); + + for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : pieceWeightArray) + { + structurestrongholdpieces$pieceweight.instancesSpawned = 0; + structurePieceList.add(structurestrongholdpieces$pieceweight); + } + + strongComponentType = null; + } + + private static boolean canAddStructurePieces() + { + boolean flag = false; + totalWeight = 0; + + for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : structurePieceList) + { + if (structurestrongholdpieces$pieceweight.instancesLimit > 0 && structurestrongholdpieces$pieceweight.instancesSpawned < structurestrongholdpieces$pieceweight.instancesLimit) + { + flag = true; + } + + totalWeight += structurestrongholdpieces$pieceweight.pieceWeight; + } + + return flag; + } + + private static StructureStrongholdPieces.Stronghold func_175954_a(Class p_175954_0_, List p_175954_1_, Random p_175954_2_, int p_175954_3_, int p_175954_4_, int p_175954_5_, EnumFacing p_175954_6_, int p_175954_7_) + { + StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold = null; + + if (p_175954_0_ == StructureStrongholdPieces.Straight.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.Straight.func_175862_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.Prison.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.Prison.func_175860_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.LeftTurn.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.LeftTurn.func_175867_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.RightTurn.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.RightTurn.func_175867_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.RoomCrossing.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.RoomCrossing.func_175859_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.StairsStraight.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.StairsStraight.func_175861_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.Stairs.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.Stairs.func_175863_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.Crossing.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.Crossing.func_175866_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.ChestCorridor.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.ChestCorridor.func_175868_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.Library.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.Library.func_175864_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + else if (p_175954_0_ == StructureStrongholdPieces.PortalRoom.class) + { + structurestrongholdpieces$stronghold = StructureStrongholdPieces.PortalRoom.func_175865_a(p_175954_1_, p_175954_2_, p_175954_3_, p_175954_4_, p_175954_5_, p_175954_6_, p_175954_7_); + } + + return structurestrongholdpieces$stronghold; + } + + private static StructureStrongholdPieces.Stronghold func_175955_b(StructureStrongholdPieces.Stairs2 p_175955_0_, List p_175955_1_, Random p_175955_2_, int p_175955_3_, int p_175955_4_, int p_175955_5_, EnumFacing p_175955_6_, int p_175955_7_) + { + if (!canAddStructurePieces()) + { + return null; + } + else + { + if (strongComponentType != null) + { + StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold = func_175954_a(strongComponentType, p_175955_1_, p_175955_2_, p_175955_3_, p_175955_4_, p_175955_5_, p_175955_6_, p_175955_7_); + strongComponentType = null; + + if (structurestrongholdpieces$stronghold != null) + { + return structurestrongholdpieces$stronghold; + } + } + + int j = 0; + + while (j < 5) + { + ++j; + int i = p_175955_2_.nextInt(totalWeight); + + for (StructureStrongholdPieces.PieceWeight structurestrongholdpieces$pieceweight : structurePieceList) + { + i -= structurestrongholdpieces$pieceweight.pieceWeight; + + if (i < 0) + { + if (!structurestrongholdpieces$pieceweight.canSpawnMoreStructuresOfType(p_175955_7_) || structurestrongholdpieces$pieceweight == p_175955_0_.strongholdPieceWeight) + { + break; + } + + StructureStrongholdPieces.Stronghold structurestrongholdpieces$stronghold1 = func_175954_a(structurestrongholdpieces$pieceweight.pieceClass, p_175955_1_, p_175955_2_, p_175955_3_, p_175955_4_, p_175955_5_, p_175955_6_, p_175955_7_); + + if (structurestrongholdpieces$stronghold1 != null) + { + ++structurestrongholdpieces$pieceweight.instancesSpawned; + p_175955_0_.strongholdPieceWeight = structurestrongholdpieces$pieceweight; + + if (!structurestrongholdpieces$pieceweight.canSpawnMoreStructures()) + { + structurePieceList.remove(structurestrongholdpieces$pieceweight); + } + + return structurestrongholdpieces$stronghold1; + } + } + } + } + + StructureBoundingBox structureboundingbox = StructureStrongholdPieces.Corridor.func_175869_a(p_175955_1_, p_175955_2_, p_175955_3_, p_175955_4_, p_175955_5_, p_175955_6_); + + if (structureboundingbox != null && structureboundingbox.minY > 1) + { + return new StructureStrongholdPieces.Corridor(p_175955_7_, p_175955_2_, structureboundingbox, p_175955_6_); + } + else + { + return null; + } + } + } + + private static StructureComponent func_175953_c(StructureStrongholdPieces.Stairs2 p_175953_0_, List p_175953_1_, Random p_175953_2_, int p_175953_3_, int p_175953_4_, int p_175953_5_, EnumFacing p_175953_6_, int p_175953_7_) + { + if (p_175953_7_ > 50) + { + return null; + } + else if (Math.abs(p_175953_3_ - p_175953_0_.getBoundingBox().minX) <= 112 && Math.abs(p_175953_5_ - p_175953_0_.getBoundingBox().minZ) <= 112) + { + StructureComponent structurecomponent = func_175955_b(p_175953_0_, p_175953_1_, p_175953_2_, p_175953_3_, p_175953_4_, p_175953_5_, p_175953_6_, p_175953_7_ + 1); + + if (structurecomponent != null) + { + p_175953_1_.add(structurecomponent); + p_175953_0_.field_75026_c.add(structurecomponent); + } + + return structurecomponent; + } + else + { + return null; + } + } + + public static class ChestCorridor extends StructureStrongholdPieces.Stronghold + { + private static final List strongholdChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.ender_pearl, 0, 1, 1, 10), new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 1), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}); + private boolean hasMadeChest; + + public ChestCorridor() + { + } + + public ChestCorridor(int p_i45582_1_, Random p_i45582_2_, StructureBoundingBox p_i45582_3_, EnumFacing p_i45582_4_) + { + super(p_i45582_1_); + this.coordBaseMode = p_i45582_4_; + this.field_143013_d = this.getRandomDoor(p_i45582_2_); + this.boundingBox = p_i45582_3_; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Chest", this.hasMadeChest); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.hasMadeChest = tagCompound.getBoolean("Chest"); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + + public static StructureStrongholdPieces.ChestCorridor func_175868_a(List p_175868_0_, Random p_175868_1_, int p_175868_2_, int p_175868_3_, int p_175868_4_, EnumFacing p_175868_5_, int p_175868_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175868_2_, p_175868_3_, p_175868_4_, -1, -1, 0, 5, 5, 7, p_175868_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175868_0_, structureboundingbox) == null ? new StructureStrongholdPieces.ChestCorridor(p_175868_6_, p_175868_1_, structureboundingbox, p_175868_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 3, 1, 4, Blocks.stonebrick.getDefaultState(), Blocks.stonebrick.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 4, structureBoundingBoxIn); + + for (int i = 2; i <= 4; ++i) + { + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 2, 1, i, structureBoundingBoxIn); + } + + if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) + { + this.hasMadeChest = true; + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, WeightedRandomChestContent.func_177629_a(strongholdChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(2)); + } + + return true; + } + } + } + + public static class Corridor extends StructureStrongholdPieces.Stronghold + { + private int field_74993_a; + + public Corridor() + { + } + + public Corridor(int p_i45581_1_, Random p_i45581_2_, StructureBoundingBox p_i45581_3_, EnumFacing p_i45581_4_) + { + super(p_i45581_1_); + this.coordBaseMode = p_i45581_4_; + this.boundingBox = p_i45581_3_; + this.field_74993_a = p_i45581_4_ != EnumFacing.NORTH && p_i45581_4_ != EnumFacing.SOUTH ? p_i45581_3_.getXSize() : p_i45581_3_.getZSize(); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setInteger("Steps", this.field_74993_a); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.field_74993_a = tagCompound.getInteger("Steps"); + } + + public static StructureBoundingBox func_175869_a(List p_175869_0_, Random p_175869_1_, int p_175869_2_, int p_175869_3_, int p_175869_4_, EnumFacing p_175869_5_) + { + int i = 3; + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175869_2_, p_175869_3_, p_175869_4_, -1, -1, 0, 5, 5, 4, p_175869_5_); + StructureComponent structurecomponent = StructureComponent.findIntersecting(p_175869_0_, structureboundingbox); + + if (structurecomponent == null) + { + return null; + } + else + { + if (structurecomponent.getBoundingBox().minY == structureboundingbox.minY) + { + for (int j = 3; j >= 1; --j) + { + structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175869_2_, p_175869_3_, p_175869_4_, -1, -1, 0, 5, 5, j - 1, p_175869_5_); + + if (!structurecomponent.getBoundingBox().intersectsWith(structureboundingbox)) + { + return StructureBoundingBox.getComponentToAddBoundingBox(p_175869_2_, p_175869_3_, p_175869_4_, -1, -1, 0, 5, 5, j, p_175869_5_); + } + } + } + + return null; + } + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + for (int i = 0; i < this.field_74993_a; ++i) + { + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 0, 0, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 0, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 0, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 0, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 4, 0, i, structureBoundingBoxIn); + + for (int j = 1; j <= 3; ++j) + { + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 0, j, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, j, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, j, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 3, j, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 4, j, i, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 0, 4, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 4, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 4, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 4, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 4, 4, i, structureBoundingBoxIn); + } + + return true; + } + } + } + + public static class Crossing extends StructureStrongholdPieces.Stronghold + { + private boolean field_74996_b; + private boolean field_74997_c; + private boolean field_74995_d; + private boolean field_74999_h; + + public Crossing() + { + } + + public Crossing(int p_i45580_1_, Random p_i45580_2_, StructureBoundingBox p_i45580_3_, EnumFacing p_i45580_4_) + { + super(p_i45580_1_); + this.coordBaseMode = p_i45580_4_; + this.field_143013_d = this.getRandomDoor(p_i45580_2_); + this.boundingBox = p_i45580_3_; + this.field_74996_b = p_i45580_2_.nextBoolean(); + this.field_74997_c = p_i45580_2_.nextBoolean(); + this.field_74995_d = p_i45580_2_.nextBoolean(); + this.field_74999_h = p_i45580_2_.nextInt(3) > 0; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("leftLow", this.field_74996_b); + tagCompound.setBoolean("leftHigh", this.field_74997_c); + tagCompound.setBoolean("rightLow", this.field_74995_d); + tagCompound.setBoolean("rightHigh", this.field_74999_h); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.field_74996_b = tagCompound.getBoolean("leftLow"); + this.field_74997_c = tagCompound.getBoolean("leftHigh"); + this.field_74995_d = tagCompound.getBoolean("rightLow"); + this.field_74999_h = tagCompound.getBoolean("rightHigh"); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + int i = 3; + int j = 5; + + if (this.coordBaseMode == EnumFacing.WEST || this.coordBaseMode == EnumFacing.NORTH) + { + i = 8 - i; + j = 8 - j; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 5, 1); + + if (this.field_74996_b) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, i, 1); + } + + if (this.field_74997_c) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, j, 7); + } + + if (this.field_74995_d) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, i, 1); + } + + if (this.field_74999_h) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, j, 7); + } + } + + public static StructureStrongholdPieces.Crossing func_175866_a(List p_175866_0_, Random p_175866_1_, int p_175866_2_, int p_175866_3_, int p_175866_4_, EnumFacing p_175866_5_, int p_175866_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175866_2_, p_175866_3_, p_175866_4_, -4, -3, 0, 10, 9, 11, p_175866_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175866_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Crossing(p_175866_6_, p_175866_1_, structureboundingbox, p_175866_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 9, 8, 10, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 4, 3, 0); + + if (this.field_74996_b) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 1, 0, 5, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + if (this.field_74995_d) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 3, 1, 9, 5, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + if (this.field_74997_c) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 7, 0, 7, 9, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + if (this.field_74999_h) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 5, 7, 9, 7, 9, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 10, 7, 3, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 2, 1, 8, 2, 6, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 5, 4, 4, 9, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, 1, 5, 8, 4, 9, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 4, 7, 3, 4, 9, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 5, 3, 3, 6, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 3, 3, 4, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 6, 3, 4, 6, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 1, 7, 7, 1, 8, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 9, 7, 1, 9, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 2, 7, 7, 2, 7, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 7, 4, 5, 9, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 7, 8, 5, 9, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 7, 7, 5, 9, Blocks.double_stone_slab.getDefaultState(), Blocks.double_stone_slab.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 6, 5, 6, structureBoundingBoxIn); + return true; + } + } + } + + public static class LeftTurn extends StructureStrongholdPieces.Stronghold + { + public LeftTurn() + { + } + + public LeftTurn(int p_i45579_1_, Random p_i45579_2_, StructureBoundingBox p_i45579_3_, EnumFacing p_i45579_4_) + { + super(p_i45579_1_); + this.coordBaseMode = p_i45579_4_; + this.field_143013_d = this.getRandomDoor(p_i45579_2_); + this.boundingBox = p_i45579_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + else + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + } + + public static StructureStrongholdPieces.LeftTurn func_175867_a(List p_175867_0_, Random p_175867_1_, int p_175867_2_, int p_175867_3_, int p_175867_4_, EnumFacing p_175867_5_, int p_175867_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175867_2_, p_175867_3_, p_175867_4_, -1, -1, 0, 5, 5, 5, p_175867_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175867_0_, structureboundingbox) == null ? new StructureStrongholdPieces.LeftTurn(p_175867_6_, p_175867_1_, structureboundingbox, p_175867_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 4, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0); + + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } + + public static class Library extends StructureStrongholdPieces.Stronghold + { + private static final List strongholdLibraryChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.book, 0, 1, 3, 20), new WeightedRandomChestContent(Items.paper, 0, 2, 7, 20), new WeightedRandomChestContent(Items.map, 0, 1, 1, 1), new WeightedRandomChestContent(Items.compass, 0, 1, 1, 1)}); + private boolean isLargeRoom; + + public Library() + { + } + + public Library(int p_i45578_1_, Random p_i45578_2_, StructureBoundingBox p_i45578_3_, EnumFacing p_i45578_4_) + { + super(p_i45578_1_); + this.coordBaseMode = p_i45578_4_; + this.field_143013_d = this.getRandomDoor(p_i45578_2_); + this.boundingBox = p_i45578_3_; + this.isLargeRoom = p_i45578_3_.getYSize() > 6; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Tall", this.isLargeRoom); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.isLargeRoom = tagCompound.getBoolean("Tall"); + } + + public static StructureStrongholdPieces.Library func_175864_a(List p_175864_0_, Random p_175864_1_, int p_175864_2_, int p_175864_3_, int p_175864_4_, EnumFacing p_175864_5_, int p_175864_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175864_2_, p_175864_3_, p_175864_4_, -4, -1, 0, 14, 11, 15, p_175864_5_); + + if (!canStrongholdGoDeeper(structureboundingbox) || StructureComponent.findIntersecting(p_175864_0_, structureboundingbox) != null) + { + structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175864_2_, p_175864_3_, p_175864_4_, -4, -1, 0, 14, 6, 15, p_175864_5_); + + if (!canStrongholdGoDeeper(structureboundingbox) || StructureComponent.findIntersecting(p_175864_0_, structureboundingbox) != null) + { + return null; + } + } + + return new StructureStrongholdPieces.Library(p_175864_6_, p_175864_1_, structureboundingbox, p_175864_5_); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + int i = 11; + + if (!this.isLargeRoom) + { + i = 6; + } + + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 13, i - 1, 14, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 4, 1, 0); + this.func_175805_a(worldIn, structureBoundingBoxIn, randomIn, 0.07F, 2, 1, 1, 11, 4, 13, Blocks.web.getDefaultState(), Blocks.web.getDefaultState(), false); + int j = 1; + int k = 12; + + for (int l = 1; l <= 13; ++l) + { + if ((l - 1) % 4 == 0) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, l, 1, 4, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, l, 12, 4, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 2, 3, l, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 11, 3, l, structureBoundingBoxIn); + + if (this.isLargeRoom) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 6, l, 1, 9, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 6, l, 12, 9, l, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + } + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, l, 1, 4, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, l, 12, 4, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + + if (this.isLargeRoom) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 6, l, 1, 9, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 6, l, 12, 9, l, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + } + } + } + + for (int k1 = 3; k1 < 12; k1 += 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, k1, 4, 3, k1, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, k1, 7, 3, k1, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, k1, 10, 3, k1, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + } + + if (this.isLargeRoom) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 1, 3, 5, 13, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 5, 1, 12, 5, 13, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 1, 9, 5, 2, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 12, 9, 5, 13, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 9, 5, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 5, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 9, 5, 10, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 6, 2, 3, 6, 12, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 6, 2, 10, 6, 10, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 6, 2, 9, 6, 2, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 6, 12, 8, 6, 12, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 9, 6, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 8, 6, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 9, 6, 10, structureBoundingBoxIn); + int l1 = this.getMetadataWithOffset(Blocks.ladder, 3); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 1, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 2, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 3, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 4, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 5, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 6, 13, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(l1), 10, 7, 13, structureBoundingBoxIn); + int i1 = 7; + int j1 = 7; + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 9, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 9, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 8, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 8, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 7, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 7, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 2, 7, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 + 1, 7, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 7, j1 - 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1 - 1, 7, j1 + 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 7, j1 - 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), i1, 7, j1 + 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 - 2, 8, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 + 1, 8, j1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 - 1, 8, j1 - 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1 - 1, 8, j1 + 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1, 8, j1 - 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1, 8, j1 + 1, structureBoundingBoxIn); + } + + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4)); + + if (this.isLargeRoom) + { + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 12, 9, 1, structureBoundingBoxIn); + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 12, 8, 1, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4)); + } + + return true; + } + } + } + + static class PieceWeight + { + public Class pieceClass; + public final int pieceWeight; + public int instancesSpawned; + public int instancesLimit; + + public PieceWeight(Class p_i2076_1_, int p_i2076_2_, int p_i2076_3_) + { + this.pieceClass = p_i2076_1_; + this.pieceWeight = p_i2076_2_; + this.instancesLimit = p_i2076_3_; + } + + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) + { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + + public boolean canSpawnMoreStructures() + { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + } + + public static class PortalRoom extends StructureStrongholdPieces.Stronghold + { + private boolean hasSpawner; + + public PortalRoom() + { + } + + public PortalRoom(int p_i45577_1_, Random p_i45577_2_, StructureBoundingBox p_i45577_3_, EnumFacing p_i45577_4_) + { + super(p_i45577_1_); + this.coordBaseMode = p_i45577_4_; + this.boundingBox = p_i45577_3_; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Mob", this.hasSpawner); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.hasSpawner = tagCompound.getBoolean("Mob"); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + if (componentIn != null) + { + ((StructureStrongholdPieces.Stairs2)componentIn).strongholdPortalRoom = this; + } + } + + public static StructureStrongholdPieces.PortalRoom func_175865_a(List p_175865_0_, Random p_175865_1_, int p_175865_2_, int p_175865_3_, int p_175865_4_, EnumFacing p_175865_5_, int p_175865_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175865_2_, p_175865_3_, p_175865_4_, -4, -1, 0, 11, 8, 16, p_175865_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175865_0_, structureboundingbox) == null ? new StructureStrongholdPieces.PortalRoom(p_175865_6_, p_175865_1_, structureboundingbox, p_175865_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 10, 7, 15, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.GRATES, 4, 1, 0); + int i = 6; + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, i, 1, 1, i, 14, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, i, 1, 9, i, 14, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, i, 1, 8, i, 2, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, i, 14, 8, i, 14, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 2, 1, 4, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, 1, 1, 9, 1, 4, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 1, 1, 3, Blocks.flowing_lava.getDefaultState(), Blocks.flowing_lava.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 1, 9, 1, 3, Blocks.flowing_lava.getDefaultState(), Blocks.flowing_lava.getDefaultState(), false); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 1, 8, 7, 1, 12, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 6, 1, 11, Blocks.flowing_lava.getDefaultState(), Blocks.flowing_lava.getDefaultState(), false); + + for (int j = 3; j < 14; j += 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, j, 0, 4, j, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 3, j, 10, 4, j, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false); + } + + for (int k1 = 2; k1 < 9; k1 += 2) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, k1, 3, 15, k1, 4, 15, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false); + } + + int l1 = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 3); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 5, 6, 1, 7, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 2, 6, 6, 2, 7, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 3, 7, 6, 3, 7, false, randomIn, StructureStrongholdPieces.strongholdStones); + + for (int k = 4; k <= 6; ++k) + { + this.setBlockState(worldIn, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_brick_stairs.getStateFromMeta(l1), k, 3, 6, structureBoundingBoxIn); + } + + int i2 = EnumFacing.NORTH.getHorizontalIndex(); + int l = EnumFacing.SOUTH.getHorizontalIndex(); + int i1 = EnumFacing.EAST.getHorizontalIndex(); + int j1 = EnumFacing.WEST.getHorizontalIndex(); + + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case SOUTH: + i2 = EnumFacing.SOUTH.getHorizontalIndex(); + l = EnumFacing.NORTH.getHorizontalIndex(); + break; + + case WEST: + i2 = EnumFacing.WEST.getHorizontalIndex(); + l = EnumFacing.EAST.getHorizontalIndex(); + i1 = EnumFacing.SOUTH.getHorizontalIndex(); + j1 = EnumFacing.NORTH.getHorizontalIndex(); + break; + + case EAST: + i2 = EnumFacing.EAST.getHorizontalIndex(); + l = EnumFacing.WEST.getHorizontalIndex(); + i1 = EnumFacing.SOUTH.getHorizontalIndex(); + j1 = EnumFacing.NORTH.getHorizontalIndex(); + } + } + + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 4, 3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 5, 3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i2).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 6, 3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 4, 3, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 5, 3, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(l).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 6, 3, 12, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 3, 3, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 3, 3, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(i1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 3, 3, 11, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 7, 3, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 7, 3, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.end_portal_frame.getStateFromMeta(j1).withProperty(BlockEndPortalFrame.EYE, Boolean.valueOf(randomIn.nextFloat() > 0.9F)), 7, 3, 11, structureBoundingBoxIn); + + if (!this.hasSpawner) + { + i = this.getYWithOffset(3); + BlockPos blockpos = new BlockPos(this.getXWithOffset(5, 6), i, this.getZWithOffset(5, 6)); + + if (structureBoundingBoxIn.isVecInside(blockpos)) + { + this.hasSpawner = true; + worldIn.setBlockState(blockpos, Blocks.mob_spawner.getDefaultState(), 2); + TileEntity tileentity = worldIn.getTileEntity(blockpos); + + if (tileentity instanceof TileEntityMobSpawner) + { + ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic().setEntityName("Silverfish"); + } + } + } + + return true; + } + } + + public static class Prison extends StructureStrongholdPieces.Stronghold + { + public Prison() + { + } + + public Prison(int p_i45576_1_, Random p_i45576_2_, StructureBoundingBox p_i45576_3_, EnumFacing p_i45576_4_) + { + super(p_i45576_1_); + this.coordBaseMode = p_i45576_4_; + this.field_143013_d = this.getRandomDoor(p_i45576_2_); + this.boundingBox = p_i45576_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + + public static StructureStrongholdPieces.Prison func_175860_a(List p_175860_0_, Random p_175860_1_, int p_175860_2_, int p_175860_3_, int p_175860_4_, EnumFacing p_175860_5_, int p_175860_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175860_2_, p_175860_3_, p_175860_4_, -1, -1, 0, 9, 5, 11, p_175860_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175860_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Prison(p_175860_6_, p_175860_1_, structureboundingbox, p_175860_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 8, 4, 10, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 10, 3, 3, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 1, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 3, 4, 3, 3, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 7, 4, 3, 7, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 3, 9, false, randomIn, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 4, 4, 3, 6, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 5, 7, 3, 5, Blocks.iron_bars.getDefaultState(), Blocks.iron_bars.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), 4, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), 4, 3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3)), 4, 1, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3) + 8), 4, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3)), 4, 1, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(this.getMetadataWithOffset(Blocks.iron_door, 3) + 8), 4, 2, 8, structureBoundingBoxIn); + return true; + } + } + } + + public static class RightTurn extends StructureStrongholdPieces.LeftTurn + { + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + else + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 4, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0); + + if (this.coordBaseMode != EnumFacing.NORTH && this.coordBaseMode != EnumFacing.EAST) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } + + public static class RoomCrossing extends StructureStrongholdPieces.Stronghold + { + private static final List strongholdRoomCrossingChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1)}); + protected int roomType; + + public RoomCrossing() + { + } + + public RoomCrossing(int p_i45575_1_, Random p_i45575_2_, StructureBoundingBox p_i45575_3_, EnumFacing p_i45575_4_) + { + super(p_i45575_1_); + this.coordBaseMode = p_i45575_4_; + this.field_143013_d = this.getRandomDoor(p_i45575_2_); + this.boundingBox = p_i45575_3_; + this.roomType = p_i45575_2_.nextInt(5); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setInteger("Type", this.roomType); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.roomType = tagCompound.getInteger("Type"); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 4, 1); + this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 4); + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 4); + } + + public static StructureStrongholdPieces.RoomCrossing func_175859_a(List p_175859_0_, Random p_175859_1_, int p_175859_2_, int p_175859_3_, int p_175859_4_, EnumFacing p_175859_5_, int p_175859_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175859_2_, p_175859_3_, p_175859_4_, -4, -1, 0, 11, 7, 11, p_175859_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175859_0_, structureboundingbox) == null ? new StructureStrongholdPieces.RoomCrossing(p_175859_6_, p_175859_1_, structureboundingbox, p_175859_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 10, 6, 10, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 4, 1, 0); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 6, 3, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 4, 0, 3, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 1, 4, 10, 3, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + switch (this.roomType) + { + case 0: + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 4, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 6, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 5, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 5, 3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 4, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 4, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 4, 1, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 6, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 6, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 6, 1, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 5, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getDefaultState(), 5, 1, 6, structureBoundingBoxIn); + break; + + case 1: + for (int i1 = 0; i1 < 5; ++i1) + { + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 1, 3 + i1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 7, 1, 3 + i1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3 + i1, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3 + i1, 1, 7, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 5, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.flowing_water.getDefaultState(), 5, 4, 5, structureBoundingBoxIn); + break; + + case 2: + for (int i = 1; i <= 9; ++i) + { + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 1, 3, i, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 9, 3, i, structureBoundingBoxIn); + } + + for (int j = 1; j <= 9; ++j) + { + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), j, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), j, 3, 9, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 1, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 5, 3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 3, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, 3, 5, structureBoundingBoxIn); + + for (int k = 1; k <= 3; ++k) + { + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, k, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, k, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, k, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, k, 6, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), 5, 3, 5, structureBoundingBoxIn); + + for (int l = 2; l <= 8; ++l) + { + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 2, 3, l, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 3, 3, l, structureBoundingBoxIn); + + if (l <= 3 || l >= 7) + { + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 4, 3, l, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 5, 3, l, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 6, 3, l, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 7, 3, l, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 3, l, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 3, 3, structureBoundingBoxIn); + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 4, 8, WeightedRandomChestContent.func_177629_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 1 + randomIn.nextInt(4)); + } + + return true; + } + } + } + + public static class Stairs extends StructureStrongholdPieces.Stronghold + { + private boolean field_75024_a; + + public Stairs() + { + } + + public Stairs(int p_i2081_1_, Random p_i2081_2_, int p_i2081_3_, int p_i2081_4_) + { + super(p_i2081_1_); + this.field_75024_a = true; + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(p_i2081_2_); + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + + switch (this.coordBaseMode) + { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1); + } + } + + public Stairs(int p_i45574_1_, Random p_i45574_2_, StructureBoundingBox p_i45574_3_, EnumFacing p_i45574_4_) + { + super(p_i45574_1_); + this.field_75024_a = false; + this.coordBaseMode = p_i45574_4_; + this.field_143013_d = this.getRandomDoor(p_i45574_2_); + this.boundingBox = p_i45574_3_; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Source", this.field_75024_a); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.field_75024_a = tagCompound.getBoolean("Source"); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + if (this.field_75024_a) + { + StructureStrongholdPieces.strongComponentType = StructureStrongholdPieces.Crossing.class; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + + public static StructureStrongholdPieces.Stairs func_175863_a(List p_175863_0_, Random p_175863_1_, int p_175863_2_, int p_175863_3_, int p_175863_4_, EnumFacing p_175863_5_, int p_175863_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175863_2_, p_175863_3_, p_175863_4_, -1, -7, 0, 5, 11, 5, p_175863_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175863_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Stairs(p_175863_6_, p_175863_1_, structureboundingbox, p_175863_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 10, 4, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 7, 0); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 4); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 6, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 5, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 6, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 5, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 5, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 1, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 1, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_slab.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 1, 3, structureBoundingBoxIn); + return true; + } + } + } + + public static class Stairs2 extends StructureStrongholdPieces.Stairs + { + public StructureStrongholdPieces.PieceWeight strongholdPieceWeight; + public StructureStrongholdPieces.PortalRoom strongholdPortalRoom; + public List field_75026_c = Lists.newArrayList(); + + public Stairs2() + { + } + + public Stairs2(int p_i2083_1_, Random p_i2083_2_, int p_i2083_3_, int p_i2083_4_) + { + super(0, p_i2083_2_, p_i2083_3_, p_i2083_4_); + } + + public BlockPos getBoundingBoxCenter() + { + return this.strongholdPortalRoom != null ? this.strongholdPortalRoom.getBoundingBoxCenter() : super.getBoundingBoxCenter(); + } + } + + public static class StairsStraight extends StructureStrongholdPieces.Stronghold + { + public StairsStraight() + { + } + + public StairsStraight(int p_i45572_1_, Random p_i45572_2_, StructureBoundingBox p_i45572_3_, EnumFacing p_i45572_4_) + { + super(p_i45572_1_); + this.coordBaseMode = p_i45572_4_; + this.field_143013_d = this.getRandomDoor(p_i45572_2_); + this.boundingBox = p_i45572_3_; + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + } + + public static StructureStrongholdPieces.StairsStraight func_175861_a(List p_175861_0_, Random p_175861_1_, int p_175861_2_, int p_175861_3_, int p_175861_4_, EnumFacing p_175861_5_, int p_175861_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175861_2_, p_175861_3_, p_175861_4_, -1, -7, 0, 5, 11, 8, p_175861_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175861_0_, structureboundingbox) == null ? new StructureStrongholdPieces.StairsStraight(p_175861_6_, p_175861_1_, structureboundingbox, p_175861_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 10, 7, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 7, 0); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 7); + int i = this.getMetadataWithOffset(Blocks.stone_stairs, 2); + + for (int j = 0; j < 6; ++j) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 1, 6 - j, 1 + j, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 2, 6 - j, 1 + j, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(i), 3, 6 - j, 1 + j, structureBoundingBoxIn); + + if (j < 5) + { + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 1, 5 - j, 1 + j, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 2, 5 - j, 1 + j, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), 3, 5 - j, 1 + j, structureBoundingBoxIn); + } + } + + return true; + } + } + } + + static class Stones extends StructureComponent.BlockSelector + { + private Stones() + { + } + + public void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_) + { + if (p_75062_5_) + { + float f = rand.nextFloat(); + + if (f < 0.2F) + { + this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CRACKED_META); + } + else if (f < 0.5F) + { + this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.MOSSY_META); + } + else if (f < 0.55F) + { + this.blockstate = Blocks.monster_egg.getStateFromMeta(BlockSilverfish.EnumType.STONEBRICK.getMetadata()); + } + else + { + this.blockstate = Blocks.stonebrick.getDefaultState(); + } + } + else + { + this.blockstate = Blocks.air.getDefaultState(); + } + } + } + + public static class Straight extends StructureStrongholdPieces.Stronghold + { + private boolean expandsX; + private boolean expandsZ; + + public Straight() + { + } + + public Straight(int p_i45573_1_, Random p_i45573_2_, StructureBoundingBox p_i45573_3_, EnumFacing p_i45573_4_) + { + super(p_i45573_1_); + this.coordBaseMode = p_i45573_4_; + this.field_143013_d = this.getRandomDoor(p_i45573_2_); + this.boundingBox = p_i45573_3_; + this.expandsX = p_i45573_2_.nextInt(2) == 0; + this.expandsZ = p_i45573_2_.nextInt(2) == 0; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Left", this.expandsX); + tagCompound.setBoolean("Right", this.expandsZ); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.expandsX = tagCompound.getBoolean("Left"); + this.expandsZ = tagCompound.getBoolean("Right"); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 1); + + if (this.expandsX) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 2); + } + + if (this.expandsZ) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)componentIn, listIn, rand, 1, 2); + } + } + + public static StructureStrongholdPieces.Straight func_175862_a(List p_175862_0_, Random p_175862_1_, int p_175862_2_, int p_175862_3_, int p_175862_4_, EnumFacing p_175862_5_, int p_175862_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175862_2_, p_175862_3_, p_175862_4_, -1, -1, 0, 5, 5, 7, p_175862_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175862_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Straight(p_175862_6_, p_175862_1_, structureboundingbox, p_175862_5_) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStrongholdPieces.strongholdStones); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0); + this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 1, Blocks.torch.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 1, Blocks.torch.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 5, Blocks.torch.getDefaultState()); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 5, Blocks.torch.getDefaultState()); + + if (this.expandsX) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 2, 0, 3, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + if (this.expandsZ) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 2, 4, 3, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + } + + return true; + } + } + } + + abstract static class Stronghold extends StructureComponent + { + protected StructureStrongholdPieces.Stronghold.Door field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + + public Stronghold() + { + } + + protected Stronghold(int p_i2087_1_) + { + super(p_i2087_1_); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + tagCompound.setString("EntryDoor", this.field_143013_d.name()); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.valueOf(tagCompound.getString("EntryDoor")); + } + + protected void placeDoor(World worldIn, Random p_74990_2_, StructureBoundingBox p_74990_3_, StructureStrongholdPieces.Stronghold.Door p_74990_4_, int p_74990_5_, int p_74990_6_, int p_74990_7_) + { + switch (p_74990_4_) + { + case OPENING: + default: + this.fillWithBlocks(worldIn, p_74990_3_, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_5_ + 3 - 1, p_74990_6_ + 3 - 1, p_74990_7_, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + break; + + case WOOD_DOOR: + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.oak_door.getDefaultState(), p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.oak_door.getStateFromMeta(8), p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + break; + + case GRATES: + this.setBlockState(worldIn, Blocks.air.getDefaultState(), p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + break; + + case IRON_DOOR: + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stonebrick.getDefaultState(), p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_door.getDefaultState(), p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.iron_door.getStateFromMeta(8), p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.setBlockState(worldIn, Blocks.stone_button.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_button, 4)), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ + 1, p_74990_3_); + this.setBlockState(worldIn, Blocks.stone_button.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_button, 3)), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ - 1, p_74990_3_); + } + } + + protected StructureStrongholdPieces.Stronghold.Door getRandomDoor(Random p_74988_1_) + { + int i = p_74988_1_.nextInt(5); + + switch (i) + { + case 0: + case 1: + default: + return StructureStrongholdPieces.Stronghold.Door.OPENING; + + case 2: + return StructureStrongholdPieces.Stronghold.Door.WOOD_DOOR; + + case 3: + return StructureStrongholdPieces.Stronghold.Door.GRATES; + + case 4: + return StructureStrongholdPieces.Stronghold.Door.IRON_DOOR; + } + } + + protected StructureComponent getNextComponentNormal(StructureStrongholdPieces.Stairs2 p_74986_1_, List p_74986_2_, Random p_74986_3_, int p_74986_4_, int p_74986_5_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); + + case SOUTH: + return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); + + case WEST: + return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType()); + + case EAST: + return StructureStrongholdPieces.func_175953_c(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType()); + } + } + + return null; + } + + protected StructureComponent getNextComponentX(StructureStrongholdPieces.Stairs2 p_74989_1_, List p_74989_2_, Random p_74989_3_, int p_74989_4_, int p_74989_5_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, EnumFacing.WEST, this.getComponentType()); + + case SOUTH: + return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, EnumFacing.WEST, this.getComponentType()); + + case WEST: + return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType()); + + case EAST: + return StructureStrongholdPieces.func_175953_c(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType()); + } + } + + return null; + } + + protected StructureComponent getNextComponentZ(StructureStrongholdPieces.Stairs2 p_74987_1_, List p_74987_2_, Random p_74987_3_, int p_74987_4_, int p_74987_5_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, EnumFacing.EAST, this.getComponentType()); + + case SOUTH: + return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, EnumFacing.EAST, this.getComponentType()); + + case WEST: + return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType()); + + case EAST: + return StructureStrongholdPieces.func_175953_c(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType()); + } + } + + return null; + } + + protected static boolean canStrongholdGoDeeper(StructureBoundingBox p_74991_0_) + { + return p_74991_0_ != null && p_74991_0_.minY > 10; + } + + public static enum Door + { + OPENING, + WOOD_DOOR, + GRATES, + IRON_DOOR; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java new file mode 100644 index 0000000..cc22b86 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java @@ -0,0 +1,1883 @@ +package net.minecraft.world.gen.structure; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.BlockTorch; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; + +@SuppressWarnings("incomplete-switch") +public class StructureVillagePieces +{ + public static void registerVillagePieces() + { + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House1.class, "ViBH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Field1.class, "ViDF"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Field2.class, "ViF"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Torch.class, "ViL"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Hall.class, "ViPH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House4Garden.class, "ViSH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.WoodHut.class, "ViSmH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Church.class, "ViST"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House2.class, "ViS"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Start.class, "ViStart"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Path.class, "ViSR"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.House3.class, "ViTRH"); + MapGenStructureIO.registerStructureComponent(StructureVillagePieces.Well.class, "ViW"); + } + + public static List getStructureVillageWeightedPieceList(Random random, int size) + { + List list = Lists.newArrayList(); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House4Garden.class, 4, MathHelper.getRandomIntegerInRange(random, 2 + size, 4 + size * 2))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Church.class, 20, MathHelper.getRandomIntegerInRange(random, 0 + size, 1 + size))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House1.class, 20, MathHelper.getRandomIntegerInRange(random, 0 + size, 2 + size))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.WoodHut.class, 3, MathHelper.getRandomIntegerInRange(random, 2 + size, 5 + size * 3))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Hall.class, 15, MathHelper.getRandomIntegerInRange(random, 0 + size, 2 + size))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field1.class, 3, MathHelper.getRandomIntegerInRange(random, 1 + size, 4 + size))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.getRandomIntegerInRange(random, 2 + size, 4 + size * 2))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.getRandomIntegerInRange(random, 0, 1 + size))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.getRandomIntegerInRange(random, 0 + size, 3 + size * 2))); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + if (((StructureVillagePieces.PieceWeight)iterator.next()).villagePiecesLimit == 0) + { + iterator.remove(); + } + } + + return list; + } + + private static int func_75079_a(List p_75079_0_) + { + boolean flag = false; + int i = 0; + + for (StructureVillagePieces.PieceWeight structurevillagepieces$pieceweight : p_75079_0_) + { + if (structurevillagepieces$pieceweight.villagePiecesLimit > 0 && structurevillagepieces$pieceweight.villagePiecesSpawned < structurevillagepieces$pieceweight.villagePiecesLimit) + { + flag = true; + } + + i += structurevillagepieces$pieceweight.villagePieceWeight; + } + + return flag ? i : -1; + } + + private static StructureVillagePieces.Village func_176065_a(StructureVillagePieces.Start start, StructureVillagePieces.PieceWeight weight, List p_176065_2_, Random rand, int p_176065_4_, int p_176065_5_, int p_176065_6_, EnumFacing facing, int p_176065_8_) + { + Class oclass = weight.villagePieceClass; + StructureVillagePieces.Village structurevillagepieces$village = null; + + if (oclass == StructureVillagePieces.House4Garden.class) + { + structurevillagepieces$village = StructureVillagePieces.House4Garden.func_175858_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.Church.class) + { + structurevillagepieces$village = StructureVillagePieces.Church.func_175854_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.House1.class) + { + structurevillagepieces$village = StructureVillagePieces.House1.func_175850_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.WoodHut.class) + { + structurevillagepieces$village = StructureVillagePieces.WoodHut.func_175853_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.Hall.class) + { + structurevillagepieces$village = StructureVillagePieces.Hall.func_175857_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.Field1.class) + { + structurevillagepieces$village = StructureVillagePieces.Field1.func_175851_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.Field2.class) + { + structurevillagepieces$village = StructureVillagePieces.Field2.func_175852_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.House2.class) + { + structurevillagepieces$village = StructureVillagePieces.House2.func_175855_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + else if (oclass == StructureVillagePieces.House3.class) + { + structurevillagepieces$village = StructureVillagePieces.House3.func_175849_a(start, p_176065_2_, rand, p_176065_4_, p_176065_5_, p_176065_6_, facing, p_176065_8_); + } + + return structurevillagepieces$village; + } + + private static StructureVillagePieces.Village func_176067_c(StructureVillagePieces.Start start, List p_176067_1_, Random rand, int p_176067_3_, int p_176067_4_, int p_176067_5_, EnumFacing facing, int p_176067_7_) + { + int i = func_75079_a(start.structureVillageWeightedPieceList); + + if (i <= 0) + { + return null; + } + else + { + int j = 0; + + while (j < 5) + { + ++j; + int k = rand.nextInt(i); + + for (StructureVillagePieces.PieceWeight structurevillagepieces$pieceweight : start.structureVillageWeightedPieceList) + { + k -= structurevillagepieces$pieceweight.villagePieceWeight; + + if (k < 0) + { + if (!structurevillagepieces$pieceweight.canSpawnMoreVillagePiecesOfType(p_176067_7_) || structurevillagepieces$pieceweight == start.structVillagePieceWeight && start.structureVillageWeightedPieceList.size() > 1) + { + break; + } + + StructureVillagePieces.Village structurevillagepieces$village = func_176065_a(start, structurevillagepieces$pieceweight, p_176067_1_, rand, p_176067_3_, p_176067_4_, p_176067_5_, facing, p_176067_7_); + + if (structurevillagepieces$village != null) + { + ++structurevillagepieces$pieceweight.villagePiecesSpawned; + start.structVillagePieceWeight = structurevillagepieces$pieceweight; + + if (!structurevillagepieces$pieceweight.canSpawnMoreVillagePieces()) + { + start.structureVillageWeightedPieceList.remove(structurevillagepieces$pieceweight); + } + + return structurevillagepieces$village; + } + } + } + } + + StructureBoundingBox structureboundingbox = StructureVillagePieces.Torch.func_175856_a(start, p_176067_1_, rand, p_176067_3_, p_176067_4_, p_176067_5_, facing); + + if (structureboundingbox != null) + { + return new StructureVillagePieces.Torch(start, p_176067_7_, rand, structureboundingbox, facing); + } + else + { + return null; + } + } + } + + private static StructureComponent func_176066_d(StructureVillagePieces.Start start, List p_176066_1_, Random rand, int p_176066_3_, int p_176066_4_, int p_176066_5_, EnumFacing facing, int p_176066_7_) + { + if (p_176066_7_ > 50) + { + return null; + } + else if (Math.abs(p_176066_3_ - start.getBoundingBox().minX) <= 112 && Math.abs(p_176066_5_ - start.getBoundingBox().minZ) <= 112) + { + StructureComponent structurecomponent = func_176067_c(start, p_176066_1_, rand, p_176066_3_, p_176066_4_, p_176066_5_, facing, p_176066_7_ + 1); + + if (structurecomponent != null) + { + int i = (structurecomponent.boundingBox.minX + structurecomponent.boundingBox.maxX) / 2; + int j = (structurecomponent.boundingBox.minZ + structurecomponent.boundingBox.maxZ) / 2; + int k = structurecomponent.boundingBox.maxX - structurecomponent.boundingBox.minX; + int l = structurecomponent.boundingBox.maxZ - structurecomponent.boundingBox.minZ; + int i1 = k > l ? k : l; + + if (start.getWorldChunkManager().areBiomesViable(i, j, i1 / 2 + 4, MapGenVillage.villageSpawnBiomes)) + { + p_176066_1_.add(structurecomponent); + start.field_74932_i.add(structurecomponent); + return structurecomponent; + } + } + + return null; + } + else + { + return null; + } + } + + private static StructureComponent func_176069_e(StructureVillagePieces.Start start, List p_176069_1_, Random rand, int p_176069_3_, int p_176069_4_, int p_176069_5_, EnumFacing facing, int p_176069_7_) + { + if (p_176069_7_ > 3 + start.terrainType) + { + return null; + } + else if (Math.abs(p_176069_3_ - start.getBoundingBox().minX) <= 112 && Math.abs(p_176069_5_ - start.getBoundingBox().minZ) <= 112) + { + StructureBoundingBox structureboundingbox = StructureVillagePieces.Path.func_175848_a(start, p_176069_1_, rand, p_176069_3_, p_176069_4_, p_176069_5_, facing); + + if (structureboundingbox != null && structureboundingbox.minY > 10) + { + StructureComponent structurecomponent = new StructureVillagePieces.Path(start, p_176069_7_, rand, structureboundingbox, facing); + int i = (structurecomponent.boundingBox.minX + structurecomponent.boundingBox.maxX) / 2; + int j = (structurecomponent.boundingBox.minZ + structurecomponent.boundingBox.maxZ) / 2; + int k = structurecomponent.boundingBox.maxX - structurecomponent.boundingBox.minX; + int l = structurecomponent.boundingBox.maxZ - structurecomponent.boundingBox.minZ; + int i1 = k > l ? k : l; + + if (start.getWorldChunkManager().areBiomesViable(i, j, i1 / 2 + 4, MapGenVillage.villageSpawnBiomes)) + { + p_176069_1_.add(structurecomponent); + start.field_74930_j.add(structurecomponent); + return structurecomponent; + } + } + + return null; + } + else + { + return null; + } + } + + public static class Church extends StructureVillagePieces.Village + { + public Church() + { + } + + public Church(StructureVillagePieces.Start start, int p_i45564_2_, Random rand, StructureBoundingBox p_i45564_4_, EnumFacing facing) + { + super(start, p_i45564_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45564_4_; + } + + public static StructureVillagePieces.Church func_175854_a(StructureVillagePieces.Start start, List p_175854_1_, Random rand, int p_175854_3_, int p_175854_4_, int p_175854_5_, EnumFacing facing, int p_175854_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175854_3_, p_175854_4_, p_175854_5_, 0, 0, 0, 5, 12, 9, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175854_1_, structureboundingbox) == null ? new StructureVillagePieces.Church(start, p_175854_7_, rand, structureboundingbox, facing) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 12 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 3, 3, 7, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 1, 3, 9, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 0, 3, 0, 8, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 3, 10, 0, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 10, 3, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 10, 3, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 4, 0, 4, 7, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 4, 4, 4, 7, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 8, 3, 4, 8, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 4, 3, 10, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 5, 3, 5, 7, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 9, 0, 4, 9, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 0, 4, 4, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 0, 11, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 11, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 2, 11, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 2, 11, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 1, 1, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 1, 1, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 2, 1, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 3, 1, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 3, 1, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 1, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 1, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 3, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 1)), 1, 2, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 0)), 3, 2, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 6, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 7, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 6, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 7, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 6, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 7, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 6, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 7, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 3, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 3, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 2, 4, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), 1, 4, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), 3, 4, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 4, 5, structureBoundingBoxIn); + int i = this.getMetadataWithOffset(Blocks.ladder, 4); + + for (int j = 1; j <= 9; ++j) + { + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(i), 3, j, 3, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 2, 0, structureBoundingBoxIn); + this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + + if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn); + } + + for (int l = 0; l < 9; ++l) + { + for (int k = 0; k < 5; ++k) + { + this.clearCurrentPositionBlocksUpwards(worldIn, k, 12, l, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), k, -1, l, structureBoundingBoxIn); + } + } + + this.spawnVillagers(worldIn, structureBoundingBoxIn, 2, 1, 2, 1); + return true; + } + + protected int func_180779_c(int p_180779_1_, int p_180779_2_) + { + return 2; + } + } + + public static class Field1 extends StructureVillagePieces.Village + { + private Block cropTypeA; + private Block cropTypeB; + private Block cropTypeC; + private Block cropTypeD; + + public Field1() + { + } + + public Field1(StructureVillagePieces.Start start, int p_i45570_2_, Random rand, StructureBoundingBox p_i45570_4_, EnumFacing facing) + { + super(start, p_i45570_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45570_4_; + this.cropTypeA = this.func_151559_a(rand); + this.cropTypeB = this.func_151559_a(rand); + this.cropTypeC = this.func_151559_a(rand); + this.cropTypeD = this.func_151559_a(rand); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + tagCompound.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + tagCompound.setInteger("CC", Block.blockRegistry.getIDForObject(this.cropTypeC)); + tagCompound.setInteger("CD", Block.blockRegistry.getIDForObject(this.cropTypeD)); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.cropTypeA = Block.getBlockById(tagCompound.getInteger("CA")); + this.cropTypeB = Block.getBlockById(tagCompound.getInteger("CB")); + this.cropTypeC = Block.getBlockById(tagCompound.getInteger("CC")); + this.cropTypeD = Block.getBlockById(tagCompound.getInteger("CD")); + } + + private Block func_151559_a(Random rand) + { + switch (rand.nextInt(5)) + { + case 0: + return Blocks.carrots; + + case 1: + return Blocks.potatoes; + + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field1 func_175851_a(StructureVillagePieces.Start start, List p_175851_1_, Random rand, int p_175851_3_, int p_175851_4_, int p_175851_5_, EnumFacing facing, int p_175851_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175851_3_, p_175851_4_, p_175851_5_, 0, 0, 0, 13, 4, 9, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175851_1_, structureboundingbox) == null ? new StructureVillagePieces.Field1(start, p_175851_7_, rand, structureboundingbox, facing) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 12, 4, 8, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 2, 0, 7, Blocks.farmland.getDefaultState(), Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 1, 5, 0, 7, Blocks.farmland.getDefaultState(), Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 0, 1, 8, 0, 7, Blocks.farmland.getDefaultState(), Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 10, 0, 1, 11, 0, 7, Blocks.farmland.getDefaultState(), Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 0, 0, 8, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 0, 0, 6, 0, 8, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 0, 0, 12, 0, 8, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 0, 11, 0, 0, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 8, 11, 0, 8, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 0, 1, 3, 0, 7, Blocks.water.getDefaultState(), Blocks.water.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 0, 1, 9, 0, 7, Blocks.water.getDefaultState(), Blocks.water.getDefaultState(), false); + + for (int i = 1; i <= 7; ++i) + { + this.setBlockState(worldIn, this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 1, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 2, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 4, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 5, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeC.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 7, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeC.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 8, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeD.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 10, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeD.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 11, 1, i, structureBoundingBoxIn); + } + + for (int k = 0; k < 9; ++k) + { + for (int j = 0; j < 13; ++j) + { + this.clearCurrentPositionBlocksUpwards(worldIn, j, 4, k, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.dirt.getDefaultState(), j, -1, k, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Field2 extends StructureVillagePieces.Village + { + private Block cropTypeA; + private Block cropTypeB; + + public Field2() + { + } + + public Field2(StructureVillagePieces.Start start, int p_i45569_2_, Random rand, StructureBoundingBox p_i45569_4_, EnumFacing facing) + { + super(start, p_i45569_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45569_4_; + this.cropTypeA = this.func_151560_a(rand); + this.cropTypeB = this.func_151560_a(rand); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + tagCompound.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.cropTypeA = Block.getBlockById(tagCompound.getInteger("CA")); + this.cropTypeB = Block.getBlockById(tagCompound.getInteger("CB")); + } + + private Block func_151560_a(Random rand) + { + switch (rand.nextInt(5)) + { + case 0: + return Blocks.carrots; + + case 1: + return Blocks.potatoes; + + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field2 func_175852_a(StructureVillagePieces.Start start, List p_175852_1_, Random rand, int p_175852_3_, int p_175852_4_, int p_175852_5_, EnumFacing facing, int p_175852_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175852_3_, p_175852_4_, p_175852_5_, 0, 0, 0, 7, 4, 9, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175852_1_, structureboundingbox) == null ? new StructureVillagePieces.Field2(start, p_175852_7_, rand, structureboundingbox, facing) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 6, 4, 8, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 2, 0, 7, Blocks.farmland.getDefaultState(), Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 0, 1, 5, 0, 7, Blocks.farmland.getDefaultState(), Blocks.farmland.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 0, 0, 8, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 0, 0, 6, 0, 8, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 0, 5, 0, 0, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 8, 5, 0, 8, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 0, 1, 3, 0, 7, Blocks.water.getDefaultState(), Blocks.water.getDefaultState(), false); + + for (int i = 1; i <= 7; ++i) + { + this.setBlockState(worldIn, this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 1, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeA.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 2, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 4, 1, i, structureBoundingBoxIn); + this.setBlockState(worldIn, this.cropTypeB.getStateFromMeta(MathHelper.getRandomIntegerInRange(randomIn, 2, 7)), 5, 1, i, structureBoundingBoxIn); + } + + for (int k = 0; k < 9; ++k) + { + for (int j = 0; j < 7; ++j) + { + this.clearCurrentPositionBlocksUpwards(worldIn, j, 4, k, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.dirt.getDefaultState(), j, -1, k, structureBoundingBoxIn); + } + } + + return true; + } + } + + public static class Hall extends StructureVillagePieces.Village + { + public Hall() + { + } + + public Hall(StructureVillagePieces.Start start, int p_i45567_2_, Random rand, StructureBoundingBox p_i45567_4_, EnumFacing facing) + { + super(start, p_i45567_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45567_4_; + } + + public static StructureVillagePieces.Hall func_175857_a(StructureVillagePieces.Start start, List p_175857_1_, Random rand, int p_175857_3_, int p_175857_4_, int p_175857_5_, EnumFacing facing, int p_175857_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175857_3_, p_175857_4_, p_175857_5_, 0, 0, 0, 9, 7, 11, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175857_1_, structureboundingbox) == null ? new StructureVillagePieces.Hall(start, p_175857_7_, rand, structureboundingbox, facing) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 7, 4, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 6, 8, 4, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 0, 6, 8, 0, 10, Blocks.dirt.getDefaultState(), Blocks.dirt.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, 0, 6, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 6, 2, 1, 10, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 1, 6, 8, 1, 10, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 10, 7, 1, 10, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 7, 0, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 0, 3, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 0, 0, 8, 3, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 0, 7, 1, 0, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 5, 7, 1, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 7, 3, 0, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 5, 7, 3, 5, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 1, 8, 4, 1, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 4, 8, 4, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 2, 8, 5, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 0, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 0, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 4, 3, structureBoundingBoxIn); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + + for (int k = -1; k <= 2; ++k) + { + for (int l = 0; l <= 8; ++l) + { + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(i), l, 4 + k, k, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(j), l, 4 + k, 5 - k, structureBoundingBoxIn); + } + } + + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 0, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 0, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 8, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 8, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 3, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 5, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 6, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 2, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.wooden_pressure_plate.getDefaultState(), 2, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 1, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 3)), 2, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 1)), 1, 1, 3, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 0, 1, 7, 0, 3, Blocks.double_stone_slab.getDefaultState(), Blocks.double_stone_slab.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.double_stone_slab.getDefaultState(), 6, 1, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.double_stone_slab.getDefaultState(), 6, 1, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); + this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + + if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 6, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 6, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 6, 3, 4, structureBoundingBoxIn); + this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 6, 1, 5, EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + + for (int i1 = 0; i1 < 5; ++i1) + { + for (int j1 = 0; j1 < 9; ++j1) + { + this.clearCurrentPositionBlocksUpwards(worldIn, j1, 7, i1, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), j1, -1, i1, structureBoundingBoxIn); + } + } + + this.spawnVillagers(worldIn, structureBoundingBoxIn, 4, 1, 2, 2); + return true; + } + + protected int func_180779_c(int p_180779_1_, int p_180779_2_) + { + return p_180779_1_ == 0 ? 4 : super.func_180779_c(p_180779_1_, p_180779_2_); + } + } + + public static class House1 extends StructureVillagePieces.Village + { + public House1() + { + } + + public House1(StructureVillagePieces.Start start, int p_i45571_2_, Random rand, StructureBoundingBox p_i45571_4_, EnumFacing facing) + { + super(start, p_i45571_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45571_4_; + } + + public static StructureVillagePieces.House1 func_175850_a(StructureVillagePieces.Start start, List p_175850_1_, Random rand, int p_175850_3_, int p_175850_4_, int p_175850_5_, EnumFacing facing, int p_175850_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175850_3_, p_175850_4_, p_175850_5_, 0, 0, 0, 9, 9, 6, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175850_1_, structureboundingbox) == null ? new StructureVillagePieces.House1(start, p_175850_7_, rand, structureboundingbox, facing) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 9 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 7, 5, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 8, 0, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 8, 5, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 1, 8, 6, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 7, 2, 8, 7, 3, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + + for (int k = -1; k <= 2; ++k) + { + for (int l = 0; l <= 8; ++l) + { + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(i), l, 6 + k, k, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(j), l, 6 + k, 5 - k, structureBoundingBoxIn); + } + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 1, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 5, 8, 1, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 1, 0, 8, 1, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 0, 7, 1, 0, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 4, 0, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 5, 0, 4, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 2, 5, 8, 4, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 2, 0, 8, 4, 0, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 1, 0, 4, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 5, 7, 4, 5, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 2, 1, 8, 4, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 7, 4, 0, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 5, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 6, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 5, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 6, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 3, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 3, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 5, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 6, 2, 5, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 1, 7, 4, 1, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 4, 7, 4, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 7, 3, 4, Blocks.bookshelf.getDefaultState(), Blocks.bookshelf.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 7, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 0)), 7, 1, 3, structureBoundingBoxIn); + int j1 = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(j1), 6, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(j1), 5, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(j1), 4, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(j1), 3, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 6, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.wooden_pressure_plate.getDefaultState(), 6, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.wooden_pressure_plate.getDefaultState(), 4, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.crafting_table.getDefaultState(), 7, 1, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, 2, 0, structureBoundingBoxIn); + this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 1, 1, 0, EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + + if (this.getBlockStateFromPos(worldIn, 1, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 1, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 1, 0, -1, structureBoundingBoxIn); + } + + for (int k1 = 0; k1 < 6; ++k1) + { + for (int i1 = 0; i1 < 9; ++i1) + { + this.clearCurrentPositionBlocksUpwards(worldIn, i1, 9, k1, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), i1, -1, k1, structureBoundingBoxIn); + } + } + + this.spawnVillagers(worldIn, structureBoundingBoxIn, 2, 1, 2, 1); + return true; + } + + protected int func_180779_c(int p_180779_1_, int p_180779_2_) + { + return 1; + } + } + + public static class House2 extends StructureVillagePieces.Village + { + private static final List villageBlacksmithChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 3, 7, 5), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}); + private boolean hasMadeChest; + + public House2() + { + } + + public House2(StructureVillagePieces.Start start, int p_i45563_2_, Random rand, StructureBoundingBox p_i45563_4_, EnumFacing facing) + { + super(start, p_i45563_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45563_4_; + } + + public static StructureVillagePieces.House2 func_175855_a(StructureVillagePieces.Start start, List p_175855_1_, Random rand, int p_175855_3_, int p_175855_4_, int p_175855_5_, EnumFacing facing, int p_175855_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175855_3_, p_175855_4_, p_175855_5_, 0, 0, 0, 10, 6, 7, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175855_1_, structureboundingbox) == null ? new StructureVillagePieces.House2(start, p_175855_7_, rand, structureboundingbox, facing) : null; + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Chest", this.hasMadeChest); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.hasMadeChest = tagCompound.getBoolean("Chest"); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 9, 4, 6, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 9, 0, 6, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 0, 9, 4, 6, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 9, 5, 6, Blocks.stone_slab.getDefaultState(), Blocks.stone_slab.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 1, 8, 5, 5, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 2, 3, 0, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 4, 0, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 0, 3, 4, 0, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 6, 0, 4, 6, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 3, 3, 1, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 3, 3, 2, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 3, 5, 3, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 5, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 6, 5, 3, 6, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 1, 0, 5, 3, 0, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 9, 1, 0, 9, 3, 0, Blocks.oak_fence.getDefaultState(), Blocks.oak_fence.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 1, 4, 9, 4, 6, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.flowing_lava.getDefaultState(), 7, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.flowing_lava.getDefaultState(), 8, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), 9, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.iron_bars.getDefaultState(), 9, 2, 4, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 2, 4, 8, 2, 5, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 6, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.furnace.getDefaultState(), 6, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.furnace.getDefaultState(), 6, 3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.double_stone_slab.getDefaultState(), 8, 1, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 2, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.wooden_pressure_plate.getDefaultState(), 2, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 1, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 3)), 2, 1, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.oak_stairs, 1)), 1, 1, 4, structureBoundingBoxIn); + + if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(5, 5), this.getYWithOffset(1), this.getZWithOffset(5, 5)))) + { + this.hasMadeChest = true; + this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 5, 1, 5, villageBlacksmithChestContents, 3 + randomIn.nextInt(6)); + } + + for (int i = 6; i <= 8; ++i) + { + if (this.getBlockStateFromPos(worldIn, i, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, i, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), i, 0, -1, structureBoundingBoxIn); + } + } + + for (int k = 0; k < 7; ++k) + { + for (int j = 0; j < 10; ++j) + { + this.clearCurrentPositionBlocksUpwards(worldIn, j, 6, k, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), j, -1, k, structureBoundingBoxIn); + } + } + + this.spawnVillagers(worldIn, structureBoundingBoxIn, 7, 1, 1, 1); + return true; + } + + protected int func_180779_c(int p_180779_1_, int p_180779_2_) + { + return 3; + } + } + + public static class House3 extends StructureVillagePieces.Village + { + public House3() + { + } + + public House3(StructureVillagePieces.Start start, int p_i45561_2_, Random rand, StructureBoundingBox p_i45561_4_, EnumFacing facing) + { + super(start, p_i45561_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45561_4_; + } + + public static StructureVillagePieces.House3 func_175849_a(StructureVillagePieces.Start start, List p_175849_1_, Random rand, int p_175849_3_, int p_175849_4_, int p_175849_5_, EnumFacing facing, int p_175849_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175849_3_, p_175849_4_, p_175849_5_, 0, 0, 0, 9, 7, 12, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175849_1_, structureboundingbox) == null ? new StructureVillagePieces.House3(start, p_175849_7_, rand, structureboundingbox, facing) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 7, 4, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 1, 6, 8, 4, 10, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 0, 5, 8, 0, 10, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 7, 0, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 0, 3, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 0, 0, 8, 3, 10, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 0, 7, 2, 0, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 5, 2, 1, 5, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 2, 0, 6, 2, 3, 10, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 0, 10, 7, 3, 10, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 0, 7, 3, 0, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 5, 2, 3, 5, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 1, 8, 4, 1, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 4, 3, 4, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 2, 8, 5, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 0, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 0, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 4, 4, structureBoundingBoxIn); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + + for (int k = -1; k <= 2; ++k) + { + for (int l = 0; l <= 8; ++l) + { + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(i), l, 4 + k, k, structureBoundingBoxIn); + + if ((k > -1 || l <= 1) && (k > 0 || l <= 3) && (k > 1 || l <= 4 || l >= 6)) + { + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(j), l, 4 + k, 5 - k, structureBoundingBoxIn); + } + } + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 4, 5, 3, 4, 10, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 7, 4, 2, 7, 4, 10, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 4, 4, 5, 10, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 6, 5, 4, 6, 5, 10, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 6, 3, 5, 6, 10, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + int k1 = this.getMetadataWithOffset(Blocks.oak_stairs, 0); + + for (int l1 = 4; l1 >= 1; --l1) + { + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), l1, 2 + l1, 7 - l1, structureBoundingBoxIn); + + for (int i1 = 8 - l1; i1 <= 10; ++i1) + { + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(k1), l1, 2 + l1, i1, structureBoundingBoxIn); + } + } + + int i2 = this.getMetadataWithOffset(Blocks.oak_stairs, 1); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 6, 6, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 7, 5, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(i2), 6, 6, 4, structureBoundingBoxIn); + + for (int j2 = 6; j2 <= 8; ++j2) + { + for (int j1 = 5; j1 <= 10; ++j1) + { + this.setBlockState(worldIn, Blocks.oak_stairs.getStateFromMeta(i2), j2, 12 - j2, j1, structureBoundingBoxIn); + } + } + + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 0, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 0, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 4, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 5, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 6, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 8, 2, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 8, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 8, 2, 5, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 8, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 8, 2, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 8, 2, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 2, 2, 6, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 2, 7, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 2, 8, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 2, 2, 9, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 4, 4, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 5, 4, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 6, 4, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 5, 5, 10, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); + this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, -1, 3, 2, -1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn); + } + + for (int k2 = 0; k2 < 5; ++k2) + { + for (int i3 = 0; i3 < 9; ++i3) + { + this.clearCurrentPositionBlocksUpwards(worldIn, i3, 7, k2, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), i3, -1, k2, structureBoundingBoxIn); + } + } + + for (int l2 = 5; l2 < 11; ++l2) + { + for (int j3 = 2; j3 < 9; ++j3) + { + this.clearCurrentPositionBlocksUpwards(worldIn, j3, 7, l2, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), j3, -1, l2, structureBoundingBoxIn); + } + } + + this.spawnVillagers(worldIn, structureBoundingBoxIn, 4, 1, 2, 2); + return true; + } + } + + public static class House4Garden extends StructureVillagePieces.Village + { + private boolean isRoofAccessible; + + public House4Garden() + { + } + + public House4Garden(StructureVillagePieces.Start start, int p_i45566_2_, Random rand, StructureBoundingBox p_i45566_4_, EnumFacing facing) + { + super(start, p_i45566_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45566_4_; + this.isRoofAccessible = rand.nextBoolean(); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setBoolean("Terrace", this.isRoofAccessible); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.isRoofAccessible = tagCompound.getBoolean("Terrace"); + } + + public static StructureVillagePieces.House4Garden func_175858_a(StructureVillagePieces.Start start, List p_175858_1_, Random rand, int p_175858_3_, int p_175858_4_, int p_175858_5_, EnumFacing facing, int p_175858_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175858_3_, p_175858_4_, p_175858_5_, 0, 0, 0, 5, 6, 5, facing); + return StructureComponent.findIntersecting(p_175858_1_, structureboundingbox) != null ? null : new StructureVillagePieces.House4Garden(start, p_175858_7_, rand, structureboundingbox, facing); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 0, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 4, 0, 4, 4, 4, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 1, 3, 4, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 0, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 0, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 0, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 0, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 0, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 0, 3, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 1, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.cobblestone.getDefaultState(), 4, 3, 4, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 3, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 4, 3, 3, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 2, 2, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 4, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 1, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 1, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 1, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 2, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 3, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 3, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.planks.getDefaultState(), 3, 1, 0, structureBoundingBoxIn); + + if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 2, 0, -1, structureBoundingBoxIn); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 3, 3, 3, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + + if (this.isRoofAccessible) + { + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 0, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 2, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 3, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 5, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 0, 5, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 5, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 2, 5, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 3, 5, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 5, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 5, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 5, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 5, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 0, 5, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 0, 5, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 0, 5, 3, structureBoundingBoxIn); + } + + if (this.isRoofAccessible) + { + int i = this.getMetadataWithOffset(Blocks.ladder, 3); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(i), 3, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(i), 3, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(i), 3, 3, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(i), 3, 4, 3, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); + + for (int k = 0; k < 5; ++k) + { + for (int j = 0; j < 5; ++j) + { + this.clearCurrentPositionBlocksUpwards(worldIn, j, 6, k, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), j, -1, k, structureBoundingBoxIn); + } + } + + this.spawnVillagers(worldIn, structureBoundingBoxIn, 1, 1, 2, 1); + return true; + } + } + + public static class Path extends StructureVillagePieces.Road + { + private int length; + + public Path() + { + } + + public Path(StructureVillagePieces.Start start, int p_i45562_2_, Random rand, StructureBoundingBox p_i45562_4_, EnumFacing facing) + { + super(start, p_i45562_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45562_4_; + this.length = Math.max(p_i45562_4_.getXSize(), p_i45562_4_.getZSize()); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setInteger("Length", this.length); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.length = tagCompound.getInteger("Length"); + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + boolean flag = false; + + for (int i = rand.nextInt(5); i < this.length - 8; i += 2 + rand.nextInt(5)) + { + StructureComponent structurecomponent = this.getNextComponentNN((StructureVillagePieces.Start)componentIn, listIn, rand, 0, i); + + if (structurecomponent != null) + { + i += Math.max(structurecomponent.boundingBox.getXSize(), structurecomponent.boundingBox.getZSize()); + flag = true; + } + } + + for (int j = rand.nextInt(5); j < this.length - 8; j += 2 + rand.nextInt(5)) + { + StructureComponent structurecomponent1 = this.getNextComponentPP((StructureVillagePieces.Start)componentIn, listIn, rand, 0, j); + + if (structurecomponent1 != null) + { + j += Math.max(structurecomponent1.boundingBox.getXSize(), structurecomponent1.boundingBox.getZSize()); + flag = true; + } + } + + if (flag && rand.nextInt(3) > 0 && this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, EnumFacing.WEST, this.getComponentType()); + break; + + case SOUTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, EnumFacing.WEST, this.getComponentType()); + break; + + case WEST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType()); + break; + + case EAST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType()); + } + } + + if (flag && rand.nextInt(3) > 0 && this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, EnumFacing.EAST, this.getComponentType()); + break; + + case SOUTH: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, EnumFacing.EAST, this.getComponentType()); + break; + + case WEST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType()); + break; + + case EAST: + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType()); + } + } + } + + public static StructureBoundingBox func_175848_a(StructureVillagePieces.Start start, List p_175848_1_, Random rand, int p_175848_3_, int p_175848_4_, int p_175848_5_, EnumFacing facing) + { + for (int i = 7 * MathHelper.getRandomIntegerInRange(rand, 3, 5); i >= 7; i -= 7) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175848_3_, p_175848_4_, p_175848_5_, 0, 0, 0, 3, 3, i, facing); + + if (StructureComponent.findIntersecting(p_175848_1_, structureboundingbox) == null) + { + return structureboundingbox; + } + } + + return null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + IBlockState iblockstate = this.func_175847_a(Blocks.gravel.getDefaultState()); + IBlockState iblockstate1 = this.func_175847_a(Blocks.cobblestone.getDefaultState()); + + for (int i = this.boundingBox.minX; i <= this.boundingBox.maxX; ++i) + { + for (int j = this.boundingBox.minZ; j <= this.boundingBox.maxZ; ++j) + { + BlockPos blockpos = new BlockPos(i, 64, j); + + if (structureBoundingBoxIn.isVecInside(blockpos)) + { + blockpos = worldIn.getTopSolidOrLiquidBlock(blockpos).down(); + worldIn.setBlockState(blockpos, iblockstate, 2); + worldIn.setBlockState(blockpos.down(), iblockstate1, 2); + } + } + } + + return true; + } + } + + public static class PieceWeight + { + public Class villagePieceClass; + public final int villagePieceWeight; + public int villagePiecesSpawned; + public int villagePiecesLimit; + + public PieceWeight(Class p_i2098_1_, int p_i2098_2_, int p_i2098_3_) + { + this.villagePieceClass = p_i2098_1_; + this.villagePieceWeight = p_i2098_2_; + this.villagePiecesLimit = p_i2098_3_; + } + + public boolean canSpawnMoreVillagePiecesOfType(int p_75085_1_) + { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + + public boolean canSpawnMoreVillagePieces() + { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + } + + public abstract static class Road extends StructureVillagePieces.Village + { + public Road() + { + } + + protected Road(StructureVillagePieces.Start start, int type) + { + super(start, type); + } + } + + public static class Start extends StructureVillagePieces.Well + { + public WorldChunkManager worldChunkMngr; + public boolean inDesert; + public int terrainType; + public StructureVillagePieces.PieceWeight structVillagePieceWeight; + public List structureVillageWeightedPieceList; + public List field_74932_i = Lists.newArrayList(); + public List field_74930_j = Lists.newArrayList(); + + public Start() + { + } + + public Start(WorldChunkManager chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List p_i2104_6_, int p_i2104_7_) + { + super((StructureVillagePieces.Start)null, 0, rand, p_i2104_4_, p_i2104_5_); + this.worldChunkMngr = chunkManagerIn; + this.structureVillageWeightedPieceList = p_i2104_6_; + this.terrainType = p_i2104_7_; + BiomeGenBase biomegenbase = chunkManagerIn.getBiomeGenerator(new BlockPos(p_i2104_4_, 0, p_i2104_5_), BiomeGenBase.field_180279_ad); + this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; + this.func_175846_a(this.inDesert); + } + + public WorldChunkManager getWorldChunkManager() + { + return this.worldChunkMngr; + } + } + + public static class Torch extends StructureVillagePieces.Village + { + public Torch() + { + } + + public Torch(StructureVillagePieces.Start start, int p_i45568_2_, Random rand, StructureBoundingBox p_i45568_4_, EnumFacing facing) + { + super(start, p_i45568_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45568_4_; + } + + public static StructureBoundingBox func_175856_a(StructureVillagePieces.Start start, List p_175856_1_, Random rand, int p_175856_3_, int p_175856_4_, int p_175856_5_, EnumFacing facing) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175856_3_, p_175856_4_, p_175856_5_, 0, 0, 0, 3, 4, 2, facing); + return StructureComponent.findIntersecting(p_175856_1_, structureboundingbox) != null ? null : structureboundingbox; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 2, 3, 1, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 0, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 2, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.wool.getStateFromMeta(EnumDyeColor.WHITE.getDyeDamage()), 1, 3, 0, structureBoundingBoxIn); + boolean flag = this.coordBaseMode == EnumFacing.EAST || this.coordBaseMode == EnumFacing.NORTH; + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), flag ? 2 : 0, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), flag ? 0 : 2, 3, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.torch.getDefaultState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, 3, -1, structureBoundingBoxIn); + return true; + } + } + + abstract static class Village extends StructureComponent + { + protected int field_143015_k = -1; + private int villagersSpawned; + private boolean isDesertVillage; + + public Village() + { + } + + protected Village(StructureVillagePieces.Start start, int type) + { + super(type); + + if (start != null) + { + this.isDesertVillage = start.inDesert; + } + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + tagCompound.setInteger("HPos", this.field_143015_k); + tagCompound.setInteger("VCount", this.villagersSpawned); + tagCompound.setBoolean("Desert", this.isDesertVillage); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + this.field_143015_k = tagCompound.getInteger("HPos"); + this.villagersSpawned = tagCompound.getInteger("VCount"); + this.isDesertVillage = tagCompound.getBoolean("Desert"); + } + + protected StructureComponent getNextComponentNN(StructureVillagePieces.Start start, List p_74891_2_, Random rand, int p_74891_4_, int p_74891_5_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return StructureVillagePieces.func_176066_d(start, p_74891_2_, rand, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, EnumFacing.WEST, this.getComponentType()); + + case SOUTH: + return StructureVillagePieces.func_176066_d(start, p_74891_2_, rand, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, EnumFacing.WEST, this.getComponentType()); + + case WEST: + return StructureVillagePieces.func_176066_d(start, p_74891_2_, rand, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType()); + + case EAST: + return StructureVillagePieces.func_176066_d(start, p_74891_2_, rand, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType()); + } + } + + return null; + } + + protected StructureComponent getNextComponentPP(StructureVillagePieces.Start start, List p_74894_2_, Random rand, int p_74894_4_, int p_74894_5_) + { + if (this.coordBaseMode != null) + { + switch (this.coordBaseMode) + { + case NORTH: + return StructureVillagePieces.func_176066_d(start, p_74894_2_, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, EnumFacing.EAST, this.getComponentType()); + + case SOUTH: + return StructureVillagePieces.func_176066_d(start, p_74894_2_, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, EnumFacing.EAST, this.getComponentType()); + + case WEST: + return StructureVillagePieces.func_176066_d(start, p_74894_2_, rand, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType()); + + case EAST: + return StructureVillagePieces.func_176066_d(start, p_74894_2_, rand, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType()); + } + } + + return null; + } + + protected int getAverageGroundLevel(World worldIn, StructureBoundingBox p_74889_2_) + { + int i = 0; + int j = 0; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k) + { + for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l) + { + blockpos$mutableblockpos.set(l, 64, k); + + if (p_74889_2_.isVecInside(blockpos$mutableblockpos)) + { + i += Math.max(worldIn.getTopSolidOrLiquidBlock(blockpos$mutableblockpos).getY(), worldIn.provider.getAverageGroundLevel()); + ++j; + } + } + } + + if (j == 0) + { + return -1; + } + else + { + return i / j; + } + } + + protected static boolean canVillageGoDeeper(StructureBoundingBox p_74895_0_) + { + return p_74895_0_ != null && p_74895_0_.minY > 10; + } + + protected void spawnVillagers(World worldIn, StructureBoundingBox p_74893_2_, int p_74893_3_, int p_74893_4_, int p_74893_5_, int p_74893_6_) + { + if (this.villagersSpawned < p_74893_6_) + { + for (int i = this.villagersSpawned; i < p_74893_6_; ++i) + { + int j = this.getXWithOffset(p_74893_3_ + i, p_74893_5_); + int k = this.getYWithOffset(p_74893_4_); + int l = this.getZWithOffset(p_74893_3_ + i, p_74893_5_); + + if (!p_74893_2_.isVecInside(new BlockPos(j, k, l))) + { + break; + } + + ++this.villagersSpawned; + EntityVillager entityvillager = new EntityVillager(worldIn); + entityvillager.setLocationAndAngles((double)j + 0.5D, (double)k, (double)l + 0.5D, 0.0F, 0.0F); + entityvillager.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityvillager)), (IEntityLivingData)null); + entityvillager.setProfession(this.func_180779_c(i, entityvillager.getProfession())); + worldIn.spawnEntityInWorld(entityvillager); + } + } + } + + protected int func_180779_c(int p_180779_1_, int p_180779_2_) + { + return p_180779_2_; + } + + protected IBlockState func_175847_a(IBlockState p_175847_1_) + { + if (this.isDesertVillage) + { + if (p_175847_1_.getBlock() == Blocks.log || p_175847_1_.getBlock() == Blocks.log2) + { + return Blocks.sandstone.getDefaultState(); + } + + if (p_175847_1_.getBlock() == Blocks.cobblestone) + { + return Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.DEFAULT.getMetadata()); + } + + if (p_175847_1_.getBlock() == Blocks.planks) + { + return Blocks.sandstone.getStateFromMeta(BlockSandStone.EnumType.SMOOTH.getMetadata()); + } + + if (p_175847_1_.getBlock() == Blocks.oak_stairs) + { + return Blocks.sandstone_stairs.getDefaultState().withProperty(BlockStairs.FACING, p_175847_1_.getValue(BlockStairs.FACING)); + } + + if (p_175847_1_.getBlock() == Blocks.stone_stairs) + { + return Blocks.sandstone_stairs.getDefaultState().withProperty(BlockStairs.FACING, p_175847_1_.getValue(BlockStairs.FACING)); + } + + if (p_175847_1_.getBlock() == Blocks.gravel) + { + return Blocks.sandstone.getDefaultState(); + } + } + + return p_175847_1_; + } + + protected void setBlockState(World worldIn, IBlockState blockstateIn, int x, int y, int z, StructureBoundingBox boundingboxIn) + { + IBlockState iblockstate = this.func_175847_a(blockstateIn); + super.setBlockState(worldIn, iblockstate, x, y, z, boundingboxIn); + } + + protected void fillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, IBlockState boundaryBlockState, IBlockState insideBlockState, boolean existingOnly) + { + IBlockState iblockstate = this.func_175847_a(boundaryBlockState); + IBlockState iblockstate1 = this.func_175847_a(insideBlockState); + super.fillWithBlocks(worldIn, boundingboxIn, xMin, yMin, zMin, xMax, yMax, zMax, iblockstate, iblockstate1, existingOnly); + } + + protected void replaceAirAndLiquidDownwards(World worldIn, IBlockState blockstateIn, int x, int y, int z, StructureBoundingBox boundingboxIn) + { + IBlockState iblockstate = this.func_175847_a(blockstateIn); + super.replaceAirAndLiquidDownwards(worldIn, iblockstate, x, y, z, boundingboxIn); + } + + protected void func_175846_a(boolean p_175846_1_) + { + this.isDesertVillage = p_175846_1_; + } + } + + public static class Well extends StructureVillagePieces.Village + { + public Well() + { + } + + public Well(StructureVillagePieces.Start start, int p_i2109_2_, Random rand, int p_i2109_4_, int p_i2109_5_) + { + super(start, p_i2109_2_); + this.coordBaseMode = EnumFacing.Plane.HORIZONTAL.random(rand); + + switch (this.coordBaseMode) + { + case NORTH: + case SOUTH: + this.boundingBox = new StructureBoundingBox(p_i2109_4_, 64, p_i2109_5_, p_i2109_4_ + 6 - 1, 78, p_i2109_5_ + 6 - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2109_4_, 64, p_i2109_5_, p_i2109_4_ + 6 - 1, 78, p_i2109_5_ + 6 - 1); + } + } + + public void buildComponent(StructureComponent componentIn, List listIn, Random rand) + { + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, EnumFacing.WEST, this.getComponentType()); + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, EnumFacing.EAST, this.getComponentType()); + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, EnumFacing.NORTH, this.getComponentType()); + StructureVillagePieces.func_176069_e((StructureVillagePieces.Start)componentIn, listIn, rand, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, EnumFacing.SOUTH, this.getComponentType()); + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 3, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 4, 12, 4, Blocks.cobblestone.getDefaultState(), Blocks.flowing_water.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 12, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 3, 12, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 2, 12, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 3, 12, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 13, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 14, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 13, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 14, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 13, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 1, 14, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 13, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), 4, 14, 4, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 15, 1, 4, 15, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + + for (int i = 0; i <= 5; ++i) + { + for (int j = 0; j <= 5; ++j) + { + if (j == 0 || j == 5 || i == 0 || i == 5) + { + this.setBlockState(worldIn, Blocks.gravel.getDefaultState(), j, 11, i, structureBoundingBoxIn); + this.clearCurrentPositionBlocksUpwards(worldIn, j, 12, i, structureBoundingBoxIn); + } + } + } + + return true; + } + } + + public static class WoodHut extends StructureVillagePieces.Village + { + private boolean isTallHouse; + private int tablePosition; + + public WoodHut() + { + } + + public WoodHut(StructureVillagePieces.Start start, int p_i45565_2_, Random rand, StructureBoundingBox p_i45565_4_, EnumFacing facing) + { + super(start, p_i45565_2_); + this.coordBaseMode = facing; + this.boundingBox = p_i45565_4_; + this.isTallHouse = rand.nextBoolean(); + this.tablePosition = rand.nextInt(3); + } + + protected void writeStructureToNBT(NBTTagCompound tagCompound) + { + super.writeStructureToNBT(tagCompound); + tagCompound.setInteger("T", this.tablePosition); + tagCompound.setBoolean("C", this.isTallHouse); + } + + protected void readStructureFromNBT(NBTTagCompound tagCompound) + { + super.readStructureFromNBT(tagCompound); + this.tablePosition = tagCompound.getInteger("T"); + this.isTallHouse = tagCompound.getBoolean("C"); + } + + public static StructureVillagePieces.WoodHut func_175853_a(StructureVillagePieces.Start start, List p_175853_1_, Random rand, int p_175853_3_, int p_175853_4_, int p_175853_5_, EnumFacing facing, int p_175853_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_175853_3_, p_175853_4_, p_175853_5_, 0, 0, 0, 4, 6, 5, facing); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175853_1_, structureboundingbox) == null ? new StructureVillagePieces.WoodHut(start, p_175853_7_, rand, structureboundingbox, facing) : null; + } + + public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(worldIn, structureBoundingBoxIn); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 1, 3, 5, 4, Blocks.air.getDefaultState(), Blocks.air.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 3, 0, 4, Blocks.cobblestone.getDefaultState(), Blocks.cobblestone.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, 1, 2, 0, 3, Blocks.dirt.getDefaultState(), Blocks.dirt.getDefaultState(), false); + + if (this.isTallHouse) + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 4, 1, 2, 4, 3, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + } + else + { + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 1, 2, 5, 3, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + } + + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 1, 4, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 2, 4, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 1, 4, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 2, 4, 4, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 0, 4, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 0, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 0, 4, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 3, 4, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 3, 4, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.log.getDefaultState(), 3, 4, 3, structureBoundingBoxIn); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 0, 0, 3, 0, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 0, 3, 3, 0, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 4, 0, 3, 4, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 4, 3, 3, 4, Blocks.log.getDefaultState(), Blocks.log.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 3, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 1, 3, 3, 3, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 0, 2, 3, 0, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, 4, 2, 3, 4, Blocks.planks.getDefaultState(), Blocks.planks.getDefaultState(), false); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 0, 2, 2, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.glass_pane.getDefaultState(), 3, 2, 2, structureBoundingBoxIn); + + if (this.tablePosition > 0) + { + this.setBlockState(worldIn, Blocks.oak_fence.getDefaultState(), this.tablePosition, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.wooden_pressure_plate.getDefaultState(), this.tablePosition, 2, 3, structureBoundingBoxIn); + } + + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, 1, 0, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 1, 2, 0, structureBoundingBoxIn); + this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 1, 1, 0, EnumFacing.getHorizontal(this.getMetadataWithOffset(Blocks.oak_door, 1))); + + if (this.getBlockStateFromPos(worldIn, 1, 0, -1, structureBoundingBoxIn).getBlock().getMaterial() == Material.air && this.getBlockStateFromPos(worldIn, 1, -1, -1, structureBoundingBoxIn).getBlock().getMaterial() != Material.air) + { + this.setBlockState(worldIn, Blocks.stone_stairs.getStateFromMeta(this.getMetadataWithOffset(Blocks.stone_stairs, 3)), 1, 0, -1, structureBoundingBoxIn); + } + + for (int i = 0; i < 5; ++i) + { + for (int j = 0; j < 4; ++j) + { + this.clearCurrentPositionBlocksUpwards(worldIn, j, 6, i, structureBoundingBoxIn); + this.replaceAirAndLiquidDownwards(worldIn, Blocks.cobblestone.getDefaultState(), j, -1, i, structureBoundingBoxIn); + } + } + + this.spawnVillagers(worldIn, structureBoundingBoxIn, 1, 1, 2, 1); + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/NodeProcessor.java b/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/NodeProcessor.java new file mode 100644 index 0000000..dce6d38 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/NodeProcessor.java @@ -0,0 +1,49 @@ +package net.minecraft.world.pathfinder; + +import net.minecraft.entity.Entity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; + +public abstract class NodeProcessor +{ + protected IBlockAccess blockaccess; + protected IntHashMap pointMap = new IntHashMap(); + protected int entitySizeX; + protected int entitySizeY; + protected int entitySizeZ; + + public void initProcessor(IBlockAccess iblockaccessIn, Entity entityIn) + { + this.blockaccess = iblockaccessIn; + this.pointMap.clearMap(); + this.entitySizeX = MathHelper.floor_float(entityIn.width + 1.0F); + this.entitySizeY = MathHelper.floor_float(entityIn.height + 1.0F); + this.entitySizeZ = MathHelper.floor_float(entityIn.width + 1.0F); + } + + public void postProcess() + { + } + + protected PathPoint openPoint(int x, int y, int z) + { + int i = PathPoint.makeHash(x, y, z); + PathPoint pathpoint = (PathPoint)this.pointMap.lookup(i); + + if (pathpoint == null) + { + pathpoint = new PathPoint(x, y, z); + this.pointMap.addKey(i, pathpoint); + } + + return pathpoint; + } + + public abstract PathPoint getPathPointTo(Entity entityIn); + + public abstract PathPoint getPathPointToCoords(Entity entityIn, double x, double y, double target); + + public abstract int findPathOptions(PathPoint[] pathOptions, Entity entityIn, PathPoint currentPoint, PathPoint targetPoint, float maxDistance); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java b/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java new file mode 100644 index 0000000..3a57657 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java @@ -0,0 +1,79 @@ +package net.minecraft.world.pathfinder; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; + +public class SwimNodeProcessor extends NodeProcessor +{ + public void initProcessor(IBlockAccess iblockaccessIn, Entity entityIn) + { + super.initProcessor(iblockaccessIn, entityIn); + } + + public void postProcess() + { + super.postProcess(); + } + + public PathPoint getPathPointTo(Entity entityIn) + { + return this.openPoint(MathHelper.floor_double(entityIn.getEntityBoundingBox().minX), MathHelper.floor_double(entityIn.getEntityBoundingBox().minY + 0.5D), MathHelper.floor_double(entityIn.getEntityBoundingBox().minZ)); + } + + public PathPoint getPathPointToCoords(Entity entityIn, double x, double y, double target) + { + return this.openPoint(MathHelper.floor_double(x - (double)(entityIn.width / 2.0F)), MathHelper.floor_double(y + 0.5D), MathHelper.floor_double(target - (double)(entityIn.width / 2.0F))); + } + + public int findPathOptions(PathPoint[] pathOptions, Entity entityIn, PathPoint currentPoint, PathPoint targetPoint, float maxDistance) + { + int i = 0; + + for (EnumFacing enumfacing : EnumFacing.values()) + { + PathPoint pathpoint = this.getSafePoint(entityIn, currentPoint.xCoord + enumfacing.getFrontOffsetX(), currentPoint.yCoord + enumfacing.getFrontOffsetY(), currentPoint.zCoord + enumfacing.getFrontOffsetZ()); + + if (pathpoint != null && !pathpoint.visited && pathpoint.distanceTo(targetPoint) < maxDistance) + { + pathOptions[i++] = pathpoint; + } + } + + return i; + } + + private PathPoint getSafePoint(Entity entityIn, int x, int y, int z) + { + int i = this.func_176186_b(entityIn, x, y, z); + return i == -1 ? this.openPoint(x, y, z) : null; + } + + private int func_176186_b(Entity entityIn, int x, int y, int z) + { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i = x; i < x + this.entitySizeX; ++i) + { + for (int j = y; j < y + this.entitySizeY; ++j) + { + for (int k = z; k < z + this.entitySizeZ; ++k) + { + Block block = this.blockaccess.getBlockState(blockpos$mutableblockpos.set(i, j, k)).getBlock(); + + if (block.getMaterial() != Material.water) + { + return 0; + } + } + } + } + + return -1; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java b/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java new file mode 100644 index 0000000..c371eb3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java @@ -0,0 +1,288 @@ +package net.minecraft.world.pathfinder; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.BlockWall; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; + +public class WalkNodeProcessor extends NodeProcessor +{ + private boolean canEnterDoors; + private boolean canBreakDoors; + private boolean avoidsWater; + private boolean canSwim; + private boolean shouldAvoidWater; + + public void initProcessor(IBlockAccess iblockaccessIn, Entity entityIn) + { + super.initProcessor(iblockaccessIn, entityIn); + this.shouldAvoidWater = this.avoidsWater; + } + + public void postProcess() + { + super.postProcess(); + this.avoidsWater = this.shouldAvoidWater; + } + + public PathPoint getPathPointTo(Entity entityIn) + { + int i; + + if (this.canSwim && entityIn.isInWater()) + { + i = (int)entityIn.getEntityBoundingBox().minY; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(MathHelper.floor_double(entityIn.posX), i, MathHelper.floor_double(entityIn.posZ)); + + for (Block block = this.blockaccess.getBlockState(blockpos$mutableblockpos).getBlock(); block == Blocks.flowing_water || block == Blocks.water; block = this.blockaccess.getBlockState(blockpos$mutableblockpos).getBlock()) + { + ++i; + blockpos$mutableblockpos.set(MathHelper.floor_double(entityIn.posX), i, MathHelper.floor_double(entityIn.posZ)); + } + + this.avoidsWater = false; + } + else + { + i = MathHelper.floor_double(entityIn.getEntityBoundingBox().minY + 0.5D); + } + + return this.openPoint(MathHelper.floor_double(entityIn.getEntityBoundingBox().minX), i, MathHelper.floor_double(entityIn.getEntityBoundingBox().minZ)); + } + + public PathPoint getPathPointToCoords(Entity entityIn, double x, double y, double target) + { + return this.openPoint(MathHelper.floor_double(x - (double)(entityIn.width / 2.0F)), MathHelper.floor_double(y), MathHelper.floor_double(target - (double)(entityIn.width / 2.0F))); + } + + public int findPathOptions(PathPoint[] pathOptions, Entity entityIn, PathPoint currentPoint, PathPoint targetPoint, float maxDistance) + { + int i = 0; + int j = 0; + + if (this.getVerticalOffset(entityIn, currentPoint.xCoord, currentPoint.yCoord + 1, currentPoint.zCoord) == 1) + { + j = 1; + } + + PathPoint pathpoint = this.getSafePoint(entityIn, currentPoint.xCoord, currentPoint.yCoord, currentPoint.zCoord + 1, j); + PathPoint pathpoint1 = this.getSafePoint(entityIn, currentPoint.xCoord - 1, currentPoint.yCoord, currentPoint.zCoord, j); + PathPoint pathpoint2 = this.getSafePoint(entityIn, currentPoint.xCoord + 1, currentPoint.yCoord, currentPoint.zCoord, j); + PathPoint pathpoint3 = this.getSafePoint(entityIn, currentPoint.xCoord, currentPoint.yCoord, currentPoint.zCoord - 1, j); + + if (pathpoint != null && !pathpoint.visited && pathpoint.distanceTo(targetPoint) < maxDistance) + { + pathOptions[i++] = pathpoint; + } + + if (pathpoint1 != null && !pathpoint1.visited && pathpoint1.distanceTo(targetPoint) < maxDistance) + { + pathOptions[i++] = pathpoint1; + } + + if (pathpoint2 != null && !pathpoint2.visited && pathpoint2.distanceTo(targetPoint) < maxDistance) + { + pathOptions[i++] = pathpoint2; + } + + if (pathpoint3 != null && !pathpoint3.visited && pathpoint3.distanceTo(targetPoint) < maxDistance) + { + pathOptions[i++] = pathpoint3; + } + + return i; + } + + private PathPoint getSafePoint(Entity entityIn, int x, int y, int z, int p_176171_5_) + { + PathPoint pathpoint = null; + int i = this.getVerticalOffset(entityIn, x, y, z); + + if (i == 2) + { + return this.openPoint(x, y, z); + } + else + { + if (i == 1) + { + pathpoint = this.openPoint(x, y, z); + } + + if (pathpoint == null && p_176171_5_ > 0 && i != -3 && i != -4 && this.getVerticalOffset(entityIn, x, y + p_176171_5_, z) == 1) + { + pathpoint = this.openPoint(x, y + p_176171_5_, z); + y += p_176171_5_; + } + + if (pathpoint != null) + { + int j = 0; + int k; + + for (k = 0; y > 0; pathpoint = this.openPoint(x, y, z)) + { + k = this.getVerticalOffset(entityIn, x, y - 1, z); + + if (this.avoidsWater && k == -1) + { + return null; + } + + if (k != 1) + { + break; + } + + if (j++ >= entityIn.getMaxFallHeight()) + { + return null; + } + + --y; + + if (y <= 0) + { + return null; + } + } + + if (k == -2) + { + return null; + } + } + + return pathpoint; + } + } + + private int getVerticalOffset(Entity entityIn, int x, int y, int z) + { + return func_176170_a(this.blockaccess, entityIn, x, y, z, this.entitySizeX, this.entitySizeY, this.entitySizeZ, this.avoidsWater, this.canBreakDoors, this.canEnterDoors); + } + + public static int func_176170_a(IBlockAccess blockaccessIn, Entity entityIn, int x, int y, int z, int sizeX, int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors) + { + boolean flag = false; + BlockPos blockpos = new BlockPos(entityIn); + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int i = x; i < x + sizeX; ++i) + { + for (int j = y; j < y + sizeY; ++j) + { + for (int k = z; k < z + sizeZ; ++k) + { + blockpos$mutableblockpos.set(i, j, k); + Block block = blockaccessIn.getBlockState(blockpos$mutableblockpos).getBlock(); + + if (block.getMaterial() != Material.air) + { + if (block != Blocks.trapdoor && block != Blocks.iron_trapdoor) + { + if (block != Blocks.flowing_water && block != Blocks.water) + { + if (!enterDoors && block instanceof BlockDoor && block.getMaterial() == Material.wood) + { + return 0; + } + } + else + { + if (avoidWater) + { + return -1; + } + + flag = true; + } + } + else + { + flag = true; + } + + if (entityIn.worldObj.getBlockState(blockpos$mutableblockpos).getBlock() instanceof BlockRailBase) + { + if (!(entityIn.worldObj.getBlockState(blockpos).getBlock() instanceof BlockRailBase) && !(entityIn.worldObj.getBlockState(blockpos.down()).getBlock() instanceof BlockRailBase)) + { + return -3; + } + } + else if (!block.isPassable(blockaccessIn, blockpos$mutableblockpos) && (!breakDoors || !(block instanceof BlockDoor) || block.getMaterial() != Material.wood)) + { + if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof BlockWall) + { + return -3; + } + + if (block == Blocks.trapdoor || block == Blocks.iron_trapdoor) + { + return -4; + } + + Material material = block.getMaterial(); + + if (material != Material.lava) + { + return 0; + } + + if (!entityIn.isInLava()) + { + return -2; + } + } + } + } + } + } + + return flag ? 2 : 1; + } + + public void setEnterDoors(boolean canEnterDoorsIn) + { + this.canEnterDoors = canEnterDoorsIn; + } + + public void setBreakDoors(boolean canBreakDoorsIn) + { + this.canBreakDoors = canBreakDoorsIn; + } + + public void setAvoidsWater(boolean avoidsWaterIn) + { + this.avoidsWater = avoidsWaterIn; + } + + public void setCanSwim(boolean canSwimIn) + { + this.canSwim = canSwimIn; + } + + public boolean getEnterDoors() + { + return this.canEnterDoors; + } + + public boolean getCanSwim() + { + return this.canSwim; + } + + public boolean getAvoidsWater() + { + return this.avoidsWater; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java new file mode 100644 index 0000000..f593565 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java @@ -0,0 +1,216 @@ +package net.minecraft.world.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.GameRules; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class DerivedWorldInfo extends WorldInfo +{ + private final WorldInfo theWorldInfo; + + public DerivedWorldInfo(WorldInfo p_i2145_1_) + { + this.theWorldInfo = p_i2145_1_; + } + + public NBTTagCompound getNBTTagCompound() + { + return this.theWorldInfo.getNBTTagCompound(); + } + + public NBTTagCompound cloneNBTCompound(NBTTagCompound nbt) + { + return this.theWorldInfo.cloneNBTCompound(nbt); + } + + public long getSeed() + { + return this.theWorldInfo.getSeed(); + } + + public int getSpawnX() + { + return this.theWorldInfo.getSpawnX(); + } + + public int getSpawnY() + { + return this.theWorldInfo.getSpawnY(); + } + + public int getSpawnZ() + { + return this.theWorldInfo.getSpawnZ(); + } + + public long getWorldTotalTime() + { + return this.theWorldInfo.getWorldTotalTime(); + } + + public long getWorldTime() + { + return this.theWorldInfo.getWorldTime(); + } + + public long getSizeOnDisk() + { + return this.theWorldInfo.getSizeOnDisk(); + } + + public NBTTagCompound getPlayerNBTTagCompound() + { + return this.theWorldInfo.getPlayerNBTTagCompound(); + } + + public String getWorldName() + { + return this.theWorldInfo.getWorldName(); + } + + public int getSaveVersion() + { + return this.theWorldInfo.getSaveVersion(); + } + + public long getLastTimePlayed() + { + return this.theWorldInfo.getLastTimePlayed(); + } + + public boolean isThundering() + { + return this.theWorldInfo.isThundering(); + } + + public int getThunderTime() + { + return this.theWorldInfo.getThunderTime(); + } + + public boolean isRaining() + { + return this.theWorldInfo.isRaining(); + } + + public int getRainTime() + { + return this.theWorldInfo.getRainTime(); + } + + public WorldSettings.GameType getGameType() + { + return this.theWorldInfo.getGameType(); + } + + public void setSpawnX(int x) + { + } + + public void setSpawnY(int y) + { + } + + public void setSpawnZ(int z) + { + } + + public void setWorldTotalTime(long time) + { + } + + public void setWorldTime(long time) + { + } + + public void setSpawn(BlockPos spawnPoint) + { + } + + public void setWorldName(String worldName) + { + } + + public void setSaveVersion(int version) + { + } + + public void setThundering(boolean thunderingIn) + { + } + + public void setThunderTime(int time) + { + } + + public void setRaining(boolean isRaining) + { + } + + public void setRainTime(int time) + { + } + + public boolean isMapFeaturesEnabled() + { + return this.theWorldInfo.isMapFeaturesEnabled(); + } + + public boolean isHardcoreModeEnabled() + { + return this.theWorldInfo.isHardcoreModeEnabled(); + } + + public WorldType getTerrainType() + { + return this.theWorldInfo.getTerrainType(); + } + + public void setTerrainType(WorldType type) + { + } + + public boolean areCommandsAllowed() + { + return this.theWorldInfo.areCommandsAllowed(); + } + + public void setAllowCommands(boolean allow) + { + } + + public boolean isInitialized() + { + return this.theWorldInfo.isInitialized(); + } + + public void setServerInitialized(boolean initializedIn) + { + } + + public GameRules getGameRulesInstance() + { + return this.theWorldInfo.getGameRulesInstance(); + } + + public EnumDifficulty getDifficulty() + { + return this.theWorldInfo.getDifficulty(); + } + + public void setDifficulty(EnumDifficulty newDifficulty) + { + } + + public boolean isDifficultyLocked() + { + return this.theWorldInfo.isDifficultyLocked(); + } + + public void setDifficultyLocked(boolean locked) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/IPlayerFileData.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/IPlayerFileData.java new file mode 100644 index 0000000..2ff315e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/IPlayerFileData.java @@ -0,0 +1,13 @@ +package net.minecraft.world.storage; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public interface IPlayerFileData +{ + void writePlayerData(EntityPlayer player); + + NBTTagCompound readPlayerData(EntityPlayer player); + + String[] getAvailablePlayerDat(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/ISaveFormat.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/ISaveFormat.java new file mode 100644 index 0000000..7e77607 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/ISaveFormat.java @@ -0,0 +1,32 @@ +package net.minecraft.world.storage; + +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.util.IProgressUpdate; + +public interface ISaveFormat +{ + String getName(); + + ISaveHandler getSaveLoader(String saveName, boolean storePlayerdata); + + List getSaveList() throws AnvilConverterException; + + void flushCache(); + + WorldInfo getWorldInfo(String saveName); + + boolean isNewLevelIdAcceptable(String saveName); + + boolean deleteWorldDirectory(String saveName); + + void renameWorld(String dirName, String newName); + + boolean isConvertible(String saveName); + + boolean isOldMapFormat(String saveName); + + boolean convertMapFormat(String filename, IProgressUpdate progressCallback); + + boolean canLoadWorld(String saveName); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/ISaveHandler.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/ISaveHandler.java new file mode 100644 index 0000000..10c40d1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/ISaveHandler.java @@ -0,0 +1,30 @@ +package net.minecraft.world.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; + +public interface ISaveHandler +{ + WorldInfo loadWorldInfo(); + + void checkSessionLock() throws MinecraftException; + + IChunkLoader getChunkLoader(WorldProvider provider); + + void saveWorldInfoWithPlayer(WorldInfo worldInformation, NBTTagCompound tagCompound); + + void saveWorldInfo(WorldInfo worldInformation); + + IPlayerFileData getPlayerNBTManager(); + + void flush(); + + File getWorldDirectory(); + + File getMapFileFromName(String mapName); + + String getWorldDirectoryName(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java new file mode 100644 index 0000000..50d0d54 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java @@ -0,0 +1,6 @@ +package net.minecraft.world.storage; + +public interface IThreadedFileIO +{ + boolean writeNextIO(); +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/MapData.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/MapData.java new file mode 100644 index 0000000..6496030 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/MapData.java @@ -0,0 +1,286 @@ +package net.minecraft.world.storage; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec4b; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + +public class MapData extends WorldSavedData +{ + public int xCenter; + public int zCenter; + public byte dimension; + public byte scale; + public byte[] colors = new byte[16384]; + public List playersArrayList = Lists.newArrayList(); + private Map playersHashMap = Maps.newHashMap(); + public Map mapDecorations = Maps.newLinkedHashMap(); + + public MapData(String mapname) + { + super(mapname); + } + + public void calculateMapCenter(double x, double z, int mapScale) + { + int i = 128 * (1 << mapScale); + int j = MathHelper.floor_double((x + 64.0D) / (double)i); + int k = MathHelper.floor_double((z + 64.0D) / (double)i); + this.xCenter = j * i + i / 2 - 64; + this.zCenter = k * i + i / 2 - 64; + } + + public void readFromNBT(NBTTagCompound nbt) + { + this.dimension = nbt.getByte("dimension"); + this.xCenter = nbt.getInteger("xCenter"); + this.zCenter = nbt.getInteger("zCenter"); + this.scale = nbt.getByte("scale"); + this.scale = (byte)MathHelper.clamp_int(this.scale, 0, 4); + int i = nbt.getShort("width"); + int j = nbt.getShort("height"); + + if (i == 128 && j == 128) + { + this.colors = nbt.getByteArray("colors"); + } + else + { + byte[] abyte = nbt.getByteArray("colors"); + this.colors = new byte[16384]; + int k = (128 - i) / 2; + int l = (128 - j) / 2; + + for (int i1 = 0; i1 < j; ++i1) + { + int j1 = i1 + l; + + if (j1 >= 0 || j1 < 128) + { + for (int k1 = 0; k1 < i; ++k1) + { + int l1 = k1 + k; + + if (l1 >= 0 || l1 < 128) + { + this.colors[l1 + j1 * 128] = abyte[k1 + i1 * i]; + } + } + } + } + } + } + + public void writeToNBT(NBTTagCompound nbt) + { + nbt.setByte("dimension", this.dimension); + nbt.setInteger("xCenter", this.xCenter); + nbt.setInteger("zCenter", this.zCenter); + nbt.setByte("scale", this.scale); + nbt.setShort("width", (short)128); + nbt.setShort("height", (short)128); + nbt.setByteArray("colors", this.colors); + } + + public void updateVisiblePlayers(EntityPlayer player, ItemStack mapStack) + { + if (!this.playersHashMap.containsKey(player)) + { + MapData.MapInfo mapdata$mapinfo = new MapData.MapInfo(player); + this.playersHashMap.put(player, mapdata$mapinfo); + this.playersArrayList.add(mapdata$mapinfo); + } + + if (!player.inventory.hasItemStack(mapStack)) + { + this.mapDecorations.remove(player.getName()); + } + + for (int i = 0; i < this.playersArrayList.size(); ++i) + { + MapData.MapInfo mapdata$mapinfo1 = (MapData.MapInfo)this.playersArrayList.get(i); + + if (!mapdata$mapinfo1.entityplayerObj.isDead && (mapdata$mapinfo1.entityplayerObj.inventory.hasItemStack(mapStack) || mapStack.isOnItemFrame())) + { + if (!mapStack.isOnItemFrame() && mapdata$mapinfo1.entityplayerObj.dimension == this.dimension) + { + this.updateDecorations(0, mapdata$mapinfo1.entityplayerObj.worldObj, mapdata$mapinfo1.entityplayerObj.getName(), mapdata$mapinfo1.entityplayerObj.posX, mapdata$mapinfo1.entityplayerObj.posZ, (double)mapdata$mapinfo1.entityplayerObj.rotationYaw); + } + } + else + { + this.playersHashMap.remove(mapdata$mapinfo1.entityplayerObj); + this.playersArrayList.remove(mapdata$mapinfo1); + } + } + + if (mapStack.isOnItemFrame()) + { + EntityItemFrame entityitemframe = mapStack.getItemFrame(); + BlockPos blockpos = entityitemframe.getHangingPosition(); + this.updateDecorations(1, player.worldObj, "frame-" + entityitemframe.getEntityId(), (double)blockpos.getX(), (double)blockpos.getZ(), (double)(entityitemframe.facingDirection.getHorizontalIndex() * 90)); + } + + if (mapStack.hasTagCompound() && mapStack.getTagCompound().hasKey("Decorations", 9)) + { + NBTTagList nbttaglist = mapStack.getTagCompound().getTagList("Decorations", 10); + + for (int j = 0; j < nbttaglist.tagCount(); ++j) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(j); + + if (!this.mapDecorations.containsKey(nbttagcompound.getString("id"))) + { + this.updateDecorations(nbttagcompound.getByte("type"), player.worldObj, nbttagcompound.getString("id"), nbttagcompound.getDouble("x"), nbttagcompound.getDouble("z"), nbttagcompound.getDouble("rot")); + } + } + } + } + + private void updateDecorations(int type, World worldIn, String entityIdentifier, double worldX, double worldZ, double rotation) + { + int i = 1 << this.scale; + float f = (float)(worldX - (double)this.xCenter) / (float)i; + float f1 = (float)(worldZ - (double)this.zCenter) / (float)i; + byte b0 = (byte)((int)((double)(f * 2.0F) + 0.5D)); + byte b1 = (byte)((int)((double)(f1 * 2.0F) + 0.5D)); + int j = 63; + byte b2; + + if (f >= (float)(-j) && f1 >= (float)(-j) && f <= (float)j && f1 <= (float)j) + { + rotation = rotation + (rotation < 0.0D ? -8.0D : 8.0D); + b2 = (byte)((int)(rotation * 16.0D / 360.0D)); + + if (this.dimension < 0) + { + int k = (int)(worldIn.getWorldInfo().getWorldTime() / 10L); + b2 = (byte)(k * k * 34187121 + k * 121 >> 15 & 15); + } + } + else + { + if (Math.abs(f) >= 320.0F || Math.abs(f1) >= 320.0F) + { + this.mapDecorations.remove(entityIdentifier); + return; + } + + type = 6; + b2 = 0; + + if (f <= (float)(-j)) + { + b0 = (byte)((int)((double)(j * 2) + 2.5D)); + } + + if (f1 <= (float)(-j)) + { + b1 = (byte)((int)((double)(j * 2) + 2.5D)); + } + + if (f >= (float)j) + { + b0 = (byte)(j * 2 + 1); + } + + if (f1 >= (float)j) + { + b1 = (byte)(j * 2 + 1); + } + } + + this.mapDecorations.put(entityIdentifier, new Vec4b((byte)type, b0, b1, b2)); + } + + public Packet getMapPacket(ItemStack mapStack, World worldIn, EntityPlayer player) + { + MapData.MapInfo mapdata$mapinfo = (MapData.MapInfo)this.playersHashMap.get(player); + return mapdata$mapinfo == null ? null : mapdata$mapinfo.getPacket(mapStack); + } + + public void updateMapData(int x, int y) + { + super.markDirty(); + + for (MapData.MapInfo mapdata$mapinfo : this.playersArrayList) + { + mapdata$mapinfo.update(x, y); + } + } + + public MapData.MapInfo getMapInfo(EntityPlayer player) + { + MapData.MapInfo mapdata$mapinfo = (MapData.MapInfo)this.playersHashMap.get(player); + + if (mapdata$mapinfo == null) + { + mapdata$mapinfo = new MapData.MapInfo(player); + this.playersHashMap.put(player, mapdata$mapinfo); + this.playersArrayList.add(mapdata$mapinfo); + } + + return mapdata$mapinfo; + } + + public class MapInfo + { + public final EntityPlayer entityplayerObj; + private boolean field_176105_d = true; + private int minX = 0; + private int minY = 0; + private int maxX = 127; + private int maxY = 127; + private int field_176109_i; + public int field_82569_d; + + public MapInfo(EntityPlayer player) + { + this.entityplayerObj = player; + } + + public Packet getPacket(ItemStack stack) + { + if (this.field_176105_d) + { + this.field_176105_d = false; + return new S34PacketMaps(stack.getMetadata(), MapData.this.scale, MapData.this.mapDecorations.values(), MapData.this.colors, this.minX, this.minY, this.maxX + 1 - this.minX, this.maxY + 1 - this.minY); + } + else + { + return this.field_176109_i++ % 5 == 0 ? new S34PacketMaps(stack.getMetadata(), MapData.this.scale, MapData.this.mapDecorations.values(), MapData.this.colors, 0, 0, 0, 0) : null; + } + } + + public void update(int x, int y) + { + if (this.field_176105_d) + { + this.minX = Math.min(this.minX, x); + this.minY = Math.min(this.minY, y); + this.maxX = Math.max(this.maxX, x); + this.maxY = Math.max(this.maxY, y); + } + else + { + this.field_176105_d = true; + this.minX = x; + this.minY = y; + this.maxX = x; + this.maxY = y; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/MapStorage.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/MapStorage.java new file mode 100644 index 0000000..a49adb5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/MapStorage.java @@ -0,0 +1,217 @@ +package net.minecraft.world.storage; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.List; +import java.util.Map; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.world.WorldSavedData; + +public class MapStorage +{ + private ISaveHandler saveHandler; + protected Map loadedDataMap = Maps.newHashMap(); + private List loadedDataList = Lists.newArrayList(); + private Map idCounts = Maps.newHashMap(); + + public MapStorage(ISaveHandler saveHandlerIn) + { + this.saveHandler = saveHandlerIn; + this.loadIdCounts(); + } + + public WorldSavedData loadData(Class clazz, String dataIdentifier) + { + WorldSavedData worldsaveddata = (WorldSavedData)this.loadedDataMap.get(dataIdentifier); + + if (worldsaveddata != null) + { + return worldsaveddata; + } + else + { + if (this.saveHandler != null) + { + try + { + File file1 = this.saveHandler.getMapFileFromName(dataIdentifier); + + if (file1 != null && file1.exists()) + { + try + { + worldsaveddata = (WorldSavedData)clazz.getConstructor(new Class[] {String.class}).newInstance(new Object[] {dataIdentifier}); + } + catch (Exception exception) + { + throw new RuntimeException("Failed to instantiate " + clazz.toString(), exception); + } + + FileInputStream fileinputstream = new FileInputStream(file1); + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream); + fileinputstream.close(); + worldsaveddata.readFromNBT(nbttagcompound.getCompoundTag("data")); + } + } + catch (Exception exception1) + { + exception1.printStackTrace(); + } + } + + if (worldsaveddata != null) + { + this.loadedDataMap.put(dataIdentifier, worldsaveddata); + this.loadedDataList.add(worldsaveddata); + } + + return worldsaveddata; + } + } + + public void setData(String dataIdentifier, WorldSavedData data) + { + if (this.loadedDataMap.containsKey(dataIdentifier)) + { + this.loadedDataList.remove(this.loadedDataMap.remove(dataIdentifier)); + } + + this.loadedDataMap.put(dataIdentifier, data); + this.loadedDataList.add(data); + } + + public void saveAllData() + { + for (int i = 0; i < this.loadedDataList.size(); ++i) + { + WorldSavedData worldsaveddata = (WorldSavedData)this.loadedDataList.get(i); + + if (worldsaveddata.isDirty()) + { + this.saveData(worldsaveddata); + worldsaveddata.setDirty(false); + } + } + } + + private void saveData(WorldSavedData p_75747_1_) + { + if (this.saveHandler != null) + { + try + { + File file1 = this.saveHandler.getMapFileFromName(p_75747_1_.mapName); + + if (file1 != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + p_75747_1_.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("data", nbttagcompound); + FileOutputStream fileoutputstream = new FileOutputStream(file1); + CompressedStreamTools.writeCompressed(nbttagcompound1, fileoutputstream); + fileoutputstream.close(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } + + private void loadIdCounts() + { + try + { + this.idCounts.clear(); + + if (this.saveHandler == null) + { + return; + } + + File file1 = this.saveHandler.getMapFileFromName("idcounts"); + + if (file1 != null && file1.exists()) + { + DataInputStream datainputstream = new DataInputStream(new FileInputStream(file1)); + NBTTagCompound nbttagcompound = CompressedStreamTools.read(datainputstream); + datainputstream.close(); + + for (String s : nbttagcompound.getKeySet()) + { + NBTBase nbtbase = nbttagcompound.getTag(s); + + if (nbtbase instanceof NBTTagShort) + { + NBTTagShort nbttagshort = (NBTTagShort)nbtbase; + short short1 = nbttagshort.getShort(); + this.idCounts.put(s, Short.valueOf(short1)); + } + } + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + public int getUniqueDataId(String key) + { + Short oshort = (Short)this.idCounts.get(key); + + if (oshort == null) + { + oshort = Short.valueOf((short)0); + } + else + { + oshort = Short.valueOf((short)(oshort.shortValue() + 1)); + } + + this.idCounts.put(key, oshort); + + if (this.saveHandler == null) + { + return oshort.shortValue(); + } + else + { + try + { + File file1 = this.saveHandler.getMapFileFromName("idcounts"); + + if (file1 != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + for (String s : this.idCounts.keySet()) + { + short short1 = ((Short)this.idCounts.get(s)).shortValue(); + nbttagcompound.setShort(s, short1); + } + + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1)); + CompressedStreamTools.write(nbttagcompound, dataoutputstream); + dataoutputstream.close(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + return oshort.shortValue(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveDataMemoryStorage.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveDataMemoryStorage.java new file mode 100644 index 0000000..1dcea81 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveDataMemoryStorage.java @@ -0,0 +1,30 @@ +package net.minecraft.world.storage; + +import net.minecraft.world.WorldSavedData; + +public class SaveDataMemoryStorage extends MapStorage +{ + public SaveDataMemoryStorage() + { + super((ISaveHandler)null); + } + + public WorldSavedData loadData(Class clazz, String dataIdentifier) + { + return (WorldSavedData)this.loadedDataMap.get(dataIdentifier); + } + + public void setData(String dataIdentifier, WorldSavedData data) + { + this.loadedDataMap.put(dataIdentifier, data); + } + + public void saveAllData() + { + } + + public int getUniqueDataId(String key) + { + return 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java new file mode 100644 index 0000000..60e26e8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java @@ -0,0 +1,72 @@ +package net.minecraft.world.storage; + +import net.minecraft.world.WorldSettings; + +public class SaveFormatComparator implements Comparable +{ + private final String fileName; + private final String displayName; + private final long lastTimePlayed; + private final long sizeOnDisk; + private final boolean requiresConversion; + private final WorldSettings.GameType theEnumGameType; + private final boolean hardcore; + private final boolean cheatsEnabled; + + public SaveFormatComparator(String fileNameIn, String displayNameIn, long lastTimePlayedIn, long sizeOnDiskIn, WorldSettings.GameType theEnumGameTypeIn, boolean requiresConversionIn, boolean hardcoreIn, boolean cheatsEnabledIn) + { + this.fileName = fileNameIn; + this.displayName = displayNameIn; + this.lastTimePlayed = lastTimePlayedIn; + this.sizeOnDisk = sizeOnDiskIn; + this.theEnumGameType = theEnumGameTypeIn; + this.requiresConversion = requiresConversionIn; + this.hardcore = hardcoreIn; + this.cheatsEnabled = cheatsEnabledIn; + } + + public String getFileName() + { + return this.fileName; + } + + public String getDisplayName() + { + return this.displayName; + } + + public long getSizeOnDisk() + { + return this.sizeOnDisk; + } + + public boolean requiresConversion() + { + return this.requiresConversion; + } + + public long getLastTimePlayed() + { + return this.lastTimePlayed; + } + + public int compareTo(SaveFormatComparator p_compareTo_1_) + { + return this.lastTimePlayed < p_compareTo_1_.lastTimePlayed ? 1 : (this.lastTimePlayed > p_compareTo_1_.lastTimePlayed ? -1 : this.fileName.compareTo(p_compareTo_1_.fileName)); + } + + public WorldSettings.GameType getEnumGameType() + { + return this.theEnumGameType; + } + + public boolean isHardcoreModeEnabled() + { + return this.hardcore; + } + + public boolean getCheatsEnabled() + { + return this.cheatsEnabled; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveFormatOld.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveFormatOld.java new file mode 100644 index 0000000..8546f43 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveFormatOld.java @@ -0,0 +1,240 @@ +package net.minecraft.world.storage; + +import com.google.common.collect.Lists; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IProgressUpdate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SaveFormatOld implements ISaveFormat +{ + private static final Logger logger = LogManager.getLogger(); + protected final File savesDirectory; + + public SaveFormatOld(File savesDirectoryIn) + { + if (!savesDirectoryIn.exists()) + { + savesDirectoryIn.mkdirs(); + } + + this.savesDirectory = savesDirectoryIn; + } + + public String getName() + { + return "Old Format"; + } + + public List getSaveList() throws AnvilConverterException + { + List list = Lists.newArrayList(); + + for (int i = 0; i < 5; ++i) + { + String s = "World" + (i + 1); + WorldInfo worldinfo = this.getWorldInfo(s); + + if (worldinfo != null) + { + list.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed())); + } + } + + return list; + } + + public void flushCache() + { + } + + public WorldInfo getWorldInfo(String saveName) + { + File file1 = new File(this.savesDirectory, saveName); + + if (!file1.exists()) + { + return null; + } + else + { + File file2 = new File(file1, "level.dat"); + + if (file2.exists()) + { + try + { + NBTTagCompound nbttagcompound2 = CompressedStreamTools.readCompressed(new FileInputStream(file2)); + NBTTagCompound nbttagcompound3 = nbttagcompound2.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound3); + } + catch (Exception exception1) + { + logger.error((String)("Exception reading " + file2), (Throwable)exception1); + } + } + + file2 = new File(file1, "level.dat_old"); + + if (file2.exists()) + { + try + { + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file2)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound1); + } + catch (Exception exception) + { + logger.error((String)("Exception reading " + file2), (Throwable)exception); + } + } + + return null; + } + } + + public void renameWorld(String dirName, String newName) + { + File file1 = new File(this.savesDirectory, dirName); + + if (file1.exists()) + { + File file2 = new File(file1, "level.dat"); + + if (file2.exists()) + { + try + { + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file2)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + nbttagcompound1.setString("LevelName", newName); + CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(file2)); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } + } + + public boolean isNewLevelIdAcceptable(String saveName) + { + File file1 = new File(this.savesDirectory, saveName); + + if (file1.exists()) + { + return false; + } + else + { + try + { + file1.mkdir(); + file1.delete(); + return true; + } + catch (Throwable throwable) + { + logger.warn("Couldn\'t make new level", throwable); + return false; + } + } + } + + public boolean deleteWorldDirectory(String saveName) + { + File file1 = new File(this.savesDirectory, saveName); + + if (!file1.exists()) + { + return true; + } + else + { + logger.info("Deleting level " + saveName); + + for (int i = 1; i <= 5; ++i) + { + logger.info("Attempt " + i + "..."); + + if (deleteFiles(file1.listFiles())) + { + break; + } + + logger.warn("Unsuccessful in deleting contents."); + + if (i < 5) + { + try + { + Thread.sleep(500L); + } + catch (InterruptedException var5) + { + ; + } + } + } + + return file1.delete(); + } + } + + protected static boolean deleteFiles(File[] files) + { + for (int i = 0; i < files.length; ++i) + { + File file1 = files[i]; + logger.debug("Deleting " + file1); + + if (file1.isDirectory() && !deleteFiles(file1.listFiles())) + { + logger.warn("Couldn\'t delete directory " + file1); + return false; + } + + if (!file1.delete()) + { + logger.warn("Couldn\'t delete file " + file1); + return false; + } + } + + return true; + } + + public ISaveHandler getSaveLoader(String saveName, boolean storePlayerdata) + { + return new SaveHandler(this.savesDirectory, saveName, storePlayerdata); + } + + public boolean isConvertible(String saveName) + { + return false; + } + + public boolean isOldMapFormat(String saveName) + { + return false; + } + + public boolean convertMapFormat(String filename, IProgressUpdate progressCallback) + { + return false; + } + + public boolean canLoadWorld(String saveName) + { + File file1 = new File(this.savesDirectory, saveName); + return file1.isDirectory(); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveHandler.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveHandler.java new file mode 100644 index 0000000..2685dd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveHandler.java @@ -0,0 +1,303 @@ +package net.minecraft.world.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SaveHandler implements ISaveHandler, IPlayerFileData +{ + private static final Logger logger = LogManager.getLogger(); + private final File worldDirectory; + private final File playersDirectory; + private final File mapDataDir; + private final long initializationTime = MinecraftServer.getCurrentTimeMillis(); + private final String saveDirectoryName; + + public SaveHandler(File savesDirectory, String directoryName, boolean playersDirectoryIn) + { + this.worldDirectory = new File(savesDirectory, directoryName); + this.worldDirectory.mkdirs(); + this.playersDirectory = new File(this.worldDirectory, "playerdata"); + this.mapDataDir = new File(this.worldDirectory, "data"); + this.mapDataDir.mkdirs(); + this.saveDirectoryName = directoryName; + + if (playersDirectoryIn) + { + this.playersDirectory.mkdirs(); + } + + this.setSessionLock(); + } + + private void setSessionLock() + { + try + { + File file1 = new File(this.worldDirectory, "session.lock"); + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1)); + + try + { + dataoutputstream.writeLong(this.initializationTime); + } + finally + { + dataoutputstream.close(); + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + throw new RuntimeException("Failed to check session lock, aborting"); + } + } + + public File getWorldDirectory() + { + return this.worldDirectory; + } + + public void checkSessionLock() throws MinecraftException + { + try + { + File file1 = new File(this.worldDirectory, "session.lock"); + DataInputStream datainputstream = new DataInputStream(new FileInputStream(file1)); + + try + { + if (datainputstream.readLong() != this.initializationTime) + { + throw new MinecraftException("The save is being accessed from another location, aborting"); + } + } + finally + { + datainputstream.close(); + } + } + catch (IOException var7) + { + throw new MinecraftException("Failed to check session lock, aborting"); + } + } + + public IChunkLoader getChunkLoader(WorldProvider provider) + { + throw new RuntimeException("Old Chunk Storage is no longer supported."); + } + + public WorldInfo loadWorldInfo() + { + File file1 = new File(this.worldDirectory, "level.dat"); + + if (file1.exists()) + { + try + { + NBTTagCompound nbttagcompound2 = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + NBTTagCompound nbttagcompound3 = nbttagcompound2.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound3); + } + catch (Exception exception1) + { + exception1.printStackTrace(); + } + } + + file1 = new File(this.worldDirectory, "level.dat_old"); + + if (file1.exists()) + { + try + { + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound1); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + return null; + } + + public void saveWorldInfoWithPlayer(WorldInfo worldInformation, NBTTagCompound tagCompound) + { + NBTTagCompound nbttagcompound = worldInformation.cloneNBTCompound(tagCompound); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("Data", nbttagcompound); + + try + { + File file1 = new File(this.worldDirectory, "level.dat_new"); + File file2 = new File(this.worldDirectory, "level.dat_old"); + File file3 = new File(this.worldDirectory, "level.dat"); + CompressedStreamTools.writeCompressed(nbttagcompound1, new FileOutputStream(file1)); + + if (file2.exists()) + { + file2.delete(); + } + + file3.renameTo(file2); + + if (file3.exists()) + { + file3.delete(); + } + + file1.renameTo(file3); + + if (file1.exists()) + { + file1.delete(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + public void saveWorldInfo(WorldInfo worldInformation) + { + NBTTagCompound nbttagcompound = worldInformation.getNBTTagCompound(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("Data", nbttagcompound); + + try + { + File file1 = new File(this.worldDirectory, "level.dat_new"); + File file2 = new File(this.worldDirectory, "level.dat_old"); + File file3 = new File(this.worldDirectory, "level.dat"); + CompressedStreamTools.writeCompressed(nbttagcompound1, new FileOutputStream(file1)); + + if (file2.exists()) + { + file2.delete(); + } + + file3.renameTo(file2); + + if (file3.exists()) + { + file3.delete(); + } + + file1.renameTo(file3); + + if (file1.exists()) + { + file1.delete(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + public void writePlayerData(EntityPlayer player) + { + try + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + player.writeToNBT(nbttagcompound); + File file1 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat.tmp"); + File file2 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat"); + CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(file1)); + + if (file2.exists()) + { + file2.delete(); + } + + file1.renameTo(file2); + } + catch (Exception var5) + { + logger.warn("Failed to save player data for " + player.getName()); + } + } + + public NBTTagCompound readPlayerData(EntityPlayer player) + { + NBTTagCompound nbttagcompound = null; + + try + { + File file1 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat"); + + if (file1.exists() && file1.isFile()) + { + nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + } + } + catch (Exception var4) + { + logger.warn("Failed to load player data for " + player.getName()); + } + + if (nbttagcompound != null) + { + player.readFromNBT(nbttagcompound); + } + + return nbttagcompound; + } + + public IPlayerFileData getPlayerNBTManager() + { + return this; + } + + public String[] getAvailablePlayerDat() + { + String[] astring = this.playersDirectory.list(); + + if (astring == null) + { + astring = new String[0]; + } + + for (int i = 0; i < astring.length; ++i) + { + if (astring[i].endsWith(".dat")) + { + astring[i] = astring[i].substring(0, astring[i].length() - 4); + } + } + + return astring; + } + + public void flush() + { + } + + public File getMapFileFromName(String mapName) + { + return new File(this.mapDataDir, mapName + ".dat"); + } + + public String getWorldDirectoryName() + { + return this.saveDirectoryName; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java new file mode 100644 index 0000000..30df0fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java @@ -0,0 +1,56 @@ +package net.minecraft.world.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; + +public class SaveHandlerMP implements ISaveHandler +{ + public WorldInfo loadWorldInfo() + { + return null; + } + + public void checkSessionLock() throws MinecraftException + { + } + + public IChunkLoader getChunkLoader(WorldProvider provider) + { + return null; + } + + public void saveWorldInfoWithPlayer(WorldInfo worldInformation, NBTTagCompound tagCompound) + { + } + + public void saveWorldInfo(WorldInfo worldInformation) + { + } + + public IPlayerFileData getPlayerNBTManager() + { + return null; + } + + public void flush() + { + } + + public File getMapFileFromName(String mapName) + { + return null; + } + + public String getWorldDirectoryName() + { + return "none"; + } + + public File getWorldDirectory() + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/ThreadedFileIOBase.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/ThreadedFileIOBase.java new file mode 100644 index 0000000..4d506b6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/ThreadedFileIOBase.java @@ -0,0 +1,91 @@ +package net.minecraft.world.storage; + +import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.List; + +public class ThreadedFileIOBase implements Runnable +{ + private static final ThreadedFileIOBase threadedIOInstance = new ThreadedFileIOBase(); + private List threadedIOQueue = Collections.synchronizedList(Lists.newArrayList()); + private volatile long writeQueuedCounter; + private volatile long savedIOCounter; + private volatile boolean isThreadWaiting; + + private ThreadedFileIOBase() + { + Thread thread = new Thread(this, "File IO Thread"); + thread.setPriority(1); + thread.start(); + } + + public static ThreadedFileIOBase getThreadedIOInstance() + { + return threadedIOInstance; + } + + public void run() + { + while (true) + { + this.processQueue(); + } + } + + private void processQueue() + { + for (int i = 0; i < this.threadedIOQueue.size(); ++i) + { + IThreadedFileIO ithreadedfileio = (IThreadedFileIO)this.threadedIOQueue.get(i); + boolean flag = ithreadedfileio.writeNextIO(); + + if (!flag) + { + this.threadedIOQueue.remove(i--); + ++this.savedIOCounter; + } + + try + { + Thread.sleep(this.isThreadWaiting ? 0L : 10L); + } + catch (InterruptedException interruptedexception1) + { + interruptedexception1.printStackTrace(); + } + } + + if (this.threadedIOQueue.isEmpty()) + { + try + { + Thread.sleep(25L); + } + catch (InterruptedException interruptedexception) + { + interruptedexception.printStackTrace(); + } + } + } + + public void queueIO(IThreadedFileIO p_75735_1_) + { + if (!this.threadedIOQueue.contains(p_75735_1_)) + { + ++this.writeQueuedCounter; + this.threadedIOQueue.add(p_75735_1_); + } + } + + public void waitForFinish() throws InterruptedException + { + this.isThreadWaiting = true; + + while (this.writeQueuedCounter != this.savedIOCounter) + { + Thread.sleep(10L); + } + + this.isThreadWaiting = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraft/world/storage/WorldInfo.java b/Client-1.8.9/src/main/java/net/minecraft/world/storage/WorldInfo.java new file mode 100644 index 0000000..b82f05b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraft/world/storage/WorldInfo.java @@ -0,0 +1,742 @@ +package net.minecraft.world.storage; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.GameRules; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class WorldInfo +{ + public static final EnumDifficulty DEFAULT_DIFFICULTY = EnumDifficulty.NORMAL; + private long randomSeed; + private WorldType terrainType = WorldType.DEFAULT; + private String generatorOptions = ""; + private int spawnX; + private int spawnY; + private int spawnZ; + private long totalTime; + private long worldTime; + private long lastTimePlayed; + private long sizeOnDisk; + private NBTTagCompound playerTag; + private int dimension; + private String levelName; + private int saveVersion; + private int cleanWeatherTime; + private boolean raining; + private int rainTime; + private boolean thundering; + private int thunderTime; + private WorldSettings.GameType theGameType; + private boolean mapFeaturesEnabled; + private boolean hardcore; + private boolean allowCommands; + private boolean initialized; + private EnumDifficulty difficulty; + private boolean difficultyLocked; + private double borderCenterX = 0.0D; + private double borderCenterZ = 0.0D; + private double borderSize = 6.0E7D; + private long borderSizeLerpTime = 0L; + private double borderSizeLerpTarget = 0.0D; + private double borderSafeZone = 5.0D; + private double borderDamagePerBlock = 0.2D; + private int borderWarningDistance = 5; + private int borderWarningTime = 15; + private GameRules theGameRules = new GameRules(); + + protected WorldInfo() + { + } + + public WorldInfo(NBTTagCompound nbt) + { + this.randomSeed = nbt.getLong("RandomSeed"); + + if (nbt.hasKey("generatorName", 8)) + { + String s = nbt.getString("generatorName"); + this.terrainType = WorldType.parseWorldType(s); + + if (this.terrainType == null) + { + this.terrainType = WorldType.DEFAULT; + } + else if (this.terrainType.isVersioned()) + { + int i = 0; + + if (nbt.hasKey("generatorVersion", 99)) + { + i = nbt.getInteger("generatorVersion"); + } + + this.terrainType = this.terrainType.getWorldTypeForGeneratorVersion(i); + } + + if (nbt.hasKey("generatorOptions", 8)) + { + this.generatorOptions = nbt.getString("generatorOptions"); + } + } + + this.theGameType = WorldSettings.GameType.getByID(nbt.getInteger("GameType")); + + if (nbt.hasKey("MapFeatures", 99)) + { + this.mapFeaturesEnabled = nbt.getBoolean("MapFeatures"); + } + else + { + this.mapFeaturesEnabled = true; + } + + this.spawnX = nbt.getInteger("SpawnX"); + this.spawnY = nbt.getInteger("SpawnY"); + this.spawnZ = nbt.getInteger("SpawnZ"); + this.totalTime = nbt.getLong("Time"); + + if (nbt.hasKey("DayTime", 99)) + { + this.worldTime = nbt.getLong("DayTime"); + } + else + { + this.worldTime = this.totalTime; + } + + this.lastTimePlayed = nbt.getLong("LastPlayed"); + this.sizeOnDisk = nbt.getLong("SizeOnDisk"); + this.levelName = nbt.getString("LevelName"); + this.saveVersion = nbt.getInteger("version"); + this.cleanWeatherTime = nbt.getInteger("clearWeatherTime"); + this.rainTime = nbt.getInteger("rainTime"); + this.raining = nbt.getBoolean("raining"); + this.thunderTime = nbt.getInteger("thunderTime"); + this.thundering = nbt.getBoolean("thundering"); + this.hardcore = nbt.getBoolean("hardcore"); + + if (nbt.hasKey("initialized", 99)) + { + this.initialized = nbt.getBoolean("initialized"); + } + else + { + this.initialized = true; + } + + if (nbt.hasKey("allowCommands", 99)) + { + this.allowCommands = nbt.getBoolean("allowCommands"); + } + else + { + this.allowCommands = this.theGameType == WorldSettings.GameType.CREATIVE; + } + + if (nbt.hasKey("Player", 10)) + { + this.playerTag = nbt.getCompoundTag("Player"); + this.dimension = this.playerTag.getInteger("Dimension"); + } + + if (nbt.hasKey("GameRules", 10)) + { + this.theGameRules.readFromNBT(nbt.getCompoundTag("GameRules")); + } + + if (nbt.hasKey("Difficulty", 99)) + { + this.difficulty = EnumDifficulty.getDifficultyEnum(nbt.getByte("Difficulty")); + } + + if (nbt.hasKey("DifficultyLocked", 1)) + { + this.difficultyLocked = nbt.getBoolean("DifficultyLocked"); + } + + if (nbt.hasKey("BorderCenterX", 99)) + { + this.borderCenterX = nbt.getDouble("BorderCenterX"); + } + + if (nbt.hasKey("BorderCenterZ", 99)) + { + this.borderCenterZ = nbt.getDouble("BorderCenterZ"); + } + + if (nbt.hasKey("BorderSize", 99)) + { + this.borderSize = nbt.getDouble("BorderSize"); + } + + if (nbt.hasKey("BorderSizeLerpTime", 99)) + { + this.borderSizeLerpTime = nbt.getLong("BorderSizeLerpTime"); + } + + if (nbt.hasKey("BorderSizeLerpTarget", 99)) + { + this.borderSizeLerpTarget = nbt.getDouble("BorderSizeLerpTarget"); + } + + if (nbt.hasKey("BorderSafeZone", 99)) + { + this.borderSafeZone = nbt.getDouble("BorderSafeZone"); + } + + if (nbt.hasKey("BorderDamagePerBlock", 99)) + { + this.borderDamagePerBlock = nbt.getDouble("BorderDamagePerBlock"); + } + + if (nbt.hasKey("BorderWarningBlocks", 99)) + { + this.borderWarningDistance = nbt.getInteger("BorderWarningBlocks"); + } + + if (nbt.hasKey("BorderWarningTime", 99)) + { + this.borderWarningTime = nbt.getInteger("BorderWarningTime"); + } + } + + public WorldInfo(WorldSettings settings, String name) + { + this.populateFromWorldSettings(settings); + this.levelName = name; + this.difficulty = DEFAULT_DIFFICULTY; + this.initialized = false; + } + + public void populateFromWorldSettings(WorldSettings settings) + { + this.randomSeed = settings.getSeed(); + this.theGameType = settings.getGameType(); + this.mapFeaturesEnabled = settings.isMapFeaturesEnabled(); + this.hardcore = settings.getHardcoreEnabled(); + this.terrainType = settings.getTerrainType(); + this.generatorOptions = settings.getWorldName(); + this.allowCommands = settings.areCommandsAllowed(); + } + + public WorldInfo(WorldInfo worldInformation) + { + this.randomSeed = worldInformation.randomSeed; + this.terrainType = worldInformation.terrainType; + this.generatorOptions = worldInformation.generatorOptions; + this.theGameType = worldInformation.theGameType; + this.mapFeaturesEnabled = worldInformation.mapFeaturesEnabled; + this.spawnX = worldInformation.spawnX; + this.spawnY = worldInformation.spawnY; + this.spawnZ = worldInformation.spawnZ; + this.totalTime = worldInformation.totalTime; + this.worldTime = worldInformation.worldTime; + this.lastTimePlayed = worldInformation.lastTimePlayed; + this.sizeOnDisk = worldInformation.sizeOnDisk; + this.playerTag = worldInformation.playerTag; + this.dimension = worldInformation.dimension; + this.levelName = worldInformation.levelName; + this.saveVersion = worldInformation.saveVersion; + this.rainTime = worldInformation.rainTime; + this.raining = worldInformation.raining; + this.thunderTime = worldInformation.thunderTime; + this.thundering = worldInformation.thundering; + this.hardcore = worldInformation.hardcore; + this.allowCommands = worldInformation.allowCommands; + this.initialized = worldInformation.initialized; + this.theGameRules = worldInformation.theGameRules; + this.difficulty = worldInformation.difficulty; + this.difficultyLocked = worldInformation.difficultyLocked; + this.borderCenterX = worldInformation.borderCenterX; + this.borderCenterZ = worldInformation.borderCenterZ; + this.borderSize = worldInformation.borderSize; + this.borderSizeLerpTime = worldInformation.borderSizeLerpTime; + this.borderSizeLerpTarget = worldInformation.borderSizeLerpTarget; + this.borderSafeZone = worldInformation.borderSafeZone; + this.borderDamagePerBlock = worldInformation.borderDamagePerBlock; + this.borderWarningTime = worldInformation.borderWarningTime; + this.borderWarningDistance = worldInformation.borderWarningDistance; + } + + public NBTTagCompound getNBTTagCompound() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.updateTagCompound(nbttagcompound, this.playerTag); + return nbttagcompound; + } + + public NBTTagCompound cloneNBTCompound(NBTTagCompound nbt) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.updateTagCompound(nbttagcompound, nbt); + return nbttagcompound; + } + + private void updateTagCompound(NBTTagCompound nbt, NBTTagCompound playerNbt) + { + nbt.setLong("RandomSeed", this.randomSeed); + nbt.setString("generatorName", this.terrainType.getWorldTypeName()); + nbt.setInteger("generatorVersion", this.terrainType.getGeneratorVersion()); + nbt.setString("generatorOptions", this.generatorOptions); + nbt.setInteger("GameType", this.theGameType.getID()); + nbt.setBoolean("MapFeatures", this.mapFeaturesEnabled); + nbt.setInteger("SpawnX", this.spawnX); + nbt.setInteger("SpawnY", this.spawnY); + nbt.setInteger("SpawnZ", this.spawnZ); + nbt.setLong("Time", this.totalTime); + nbt.setLong("DayTime", this.worldTime); + nbt.setLong("SizeOnDisk", this.sizeOnDisk); + nbt.setLong("LastPlayed", MinecraftServer.getCurrentTimeMillis()); + nbt.setString("LevelName", this.levelName); + nbt.setInteger("version", this.saveVersion); + nbt.setInteger("clearWeatherTime", this.cleanWeatherTime); + nbt.setInteger("rainTime", this.rainTime); + nbt.setBoolean("raining", this.raining); + nbt.setInteger("thunderTime", this.thunderTime); + nbt.setBoolean("thundering", this.thundering); + nbt.setBoolean("hardcore", this.hardcore); + nbt.setBoolean("allowCommands", this.allowCommands); + nbt.setBoolean("initialized", this.initialized); + nbt.setDouble("BorderCenterX", this.borderCenterX); + nbt.setDouble("BorderCenterZ", this.borderCenterZ); + nbt.setDouble("BorderSize", this.borderSize); + nbt.setLong("BorderSizeLerpTime", this.borderSizeLerpTime); + nbt.setDouble("BorderSafeZone", this.borderSafeZone); + nbt.setDouble("BorderDamagePerBlock", this.borderDamagePerBlock); + nbt.setDouble("BorderSizeLerpTarget", this.borderSizeLerpTarget); + nbt.setDouble("BorderWarningBlocks", (double)this.borderWarningDistance); + nbt.setDouble("BorderWarningTime", (double)this.borderWarningTime); + + if (this.difficulty != null) + { + nbt.setByte("Difficulty", (byte)this.difficulty.getDifficultyId()); + } + + nbt.setBoolean("DifficultyLocked", this.difficultyLocked); + nbt.setTag("GameRules", this.theGameRules.writeToNBT()); + + if (playerNbt != null) + { + nbt.setTag("Player", playerNbt); + } + } + + public long getSeed() + { + return this.randomSeed; + } + + public int getSpawnX() + { + return this.spawnX; + } + + public int getSpawnY() + { + return this.spawnY; + } + + public int getSpawnZ() + { + return this.spawnZ; + } + + public long getWorldTotalTime() + { + return this.totalTime; + } + + public long getWorldTime() + { + return this.worldTime; + } + + public long getSizeOnDisk() + { + return this.sizeOnDisk; + } + + public NBTTagCompound getPlayerNBTTagCompound() + { + return this.playerTag; + } + + public void setSpawnX(int x) + { + this.spawnX = x; + } + + public void setSpawnY(int y) + { + this.spawnY = y; + } + + public void setSpawnZ(int z) + { + this.spawnZ = z; + } + + public void setWorldTotalTime(long time) + { + this.totalTime = time; + } + + public void setWorldTime(long time) + { + this.worldTime = time; + } + + public void setSpawn(BlockPos spawnPoint) + { + this.spawnX = spawnPoint.getX(); + this.spawnY = spawnPoint.getY(); + this.spawnZ = spawnPoint.getZ(); + } + + public String getWorldName() + { + return this.levelName; + } + + public void setWorldName(String worldName) + { + this.levelName = worldName; + } + + public int getSaveVersion() + { + return this.saveVersion; + } + + public void setSaveVersion(int version) + { + this.saveVersion = version; + } + + public long getLastTimePlayed() + { + return this.lastTimePlayed; + } + + public int getCleanWeatherTime() + { + return this.cleanWeatherTime; + } + + public void setCleanWeatherTime(int cleanWeatherTimeIn) + { + this.cleanWeatherTime = cleanWeatherTimeIn; + } + + public boolean isThundering() + { + return this.thundering; + } + + public void setThundering(boolean thunderingIn) + { + this.thundering = thunderingIn; + } + + public int getThunderTime() + { + return this.thunderTime; + } + + public void setThunderTime(int time) + { + this.thunderTime = time; + } + + public boolean isRaining() + { + return this.raining; + } + + public void setRaining(boolean isRaining) + { + this.raining = isRaining; + } + + public int getRainTime() + { + return this.rainTime; + } + + public void setRainTime(int time) + { + this.rainTime = time; + } + + public WorldSettings.GameType getGameType() + { + return this.theGameType; + } + + public boolean isMapFeaturesEnabled() + { + return this.mapFeaturesEnabled; + } + + public void setMapFeaturesEnabled(boolean enabled) + { + this.mapFeaturesEnabled = enabled; + } + + public void setGameType(WorldSettings.GameType type) + { + this.theGameType = type; + } + + public boolean isHardcoreModeEnabled() + { + return this.hardcore; + } + + public void setHardcore(boolean hardcoreIn) + { + this.hardcore = hardcoreIn; + } + + public WorldType getTerrainType() + { + return this.terrainType; + } + + public void setTerrainType(WorldType type) + { + this.terrainType = type; + } + + public String getGeneratorOptions() + { + return this.generatorOptions; + } + + public boolean areCommandsAllowed() + { + return this.allowCommands; + } + + public void setAllowCommands(boolean allow) + { + this.allowCommands = allow; + } + + public boolean isInitialized() + { + return this.initialized; + } + + public void setServerInitialized(boolean initializedIn) + { + this.initialized = initializedIn; + } + + public GameRules getGameRulesInstance() + { + return this.theGameRules; + } + + public double getBorderCenterX() + { + return this.borderCenterX; + } + + public double getBorderCenterZ() + { + return this.borderCenterZ; + } + + public double getBorderSize() + { + return this.borderSize; + } + + public void setBorderSize(double size) + { + this.borderSize = size; + } + + public long getBorderLerpTime() + { + return this.borderSizeLerpTime; + } + + public void setBorderLerpTime(long time) + { + this.borderSizeLerpTime = time; + } + + public double getBorderLerpTarget() + { + return this.borderSizeLerpTarget; + } + + public void setBorderLerpTarget(double lerpSize) + { + this.borderSizeLerpTarget = lerpSize; + } + + public void getBorderCenterZ(double posZ) + { + this.borderCenterZ = posZ; + } + + public void getBorderCenterX(double posX) + { + this.borderCenterX = posX; + } + + public double getBorderSafeZone() + { + return this.borderSafeZone; + } + + public void setBorderSafeZone(double amount) + { + this.borderSafeZone = amount; + } + + public double getBorderDamagePerBlock() + { + return this.borderDamagePerBlock; + } + + public void setBorderDamagePerBlock(double damage) + { + this.borderDamagePerBlock = damage; + } + + public int getBorderWarningDistance() + { + return this.borderWarningDistance; + } + + public int getBorderWarningTime() + { + return this.borderWarningTime; + } + + public void setBorderWarningDistance(int amountOfBlocks) + { + this.borderWarningDistance = amountOfBlocks; + } + + public void setBorderWarningTime(int ticks) + { + this.borderWarningTime = ticks; + } + + public EnumDifficulty getDifficulty() + { + return this.difficulty; + } + + public void setDifficulty(EnumDifficulty newDifficulty) + { + this.difficulty = newDifficulty; + } + + public boolean isDifficultyLocked() + { + return this.difficultyLocked; + } + + public void setDifficultyLocked(boolean locked) + { + this.difficultyLocked = locked; + } + + public void addToCrashReport(CrashReportCategory category) + { + category.addCrashSectionCallable("Level seed", new Callable() + { + public String call() throws Exception + { + return String.valueOf(WorldInfo.this.getSeed()); + } + }); + category.addCrashSectionCallable("Level generator", new Callable() + { + public String call() throws Exception + { + return String.format("ID %02d - %s, ver %d. Features enabled: %b", new Object[] {Integer.valueOf(WorldInfo.this.terrainType.getWorldTypeID()), WorldInfo.this.terrainType.getWorldTypeName(), Integer.valueOf(WorldInfo.this.terrainType.getGeneratorVersion()), Boolean.valueOf(WorldInfo.this.mapFeaturesEnabled)}); + } + }); + category.addCrashSectionCallable("Level generator options", new Callable() + { + public String call() throws Exception + { + return WorldInfo.this.generatorOptions; + } + }); + category.addCrashSectionCallable("Level spawn location", new Callable() + { + public String call() throws Exception + { + return CrashReportCategory.getCoordinateInfo((double)WorldInfo.this.spawnX, (double)WorldInfo.this.spawnY, (double)WorldInfo.this.spawnZ); + } + }); + category.addCrashSectionCallable("Level time", new Callable() + { + public String call() throws Exception + { + return String.format("%d game time, %d day time", new Object[] {Long.valueOf(WorldInfo.this.totalTime), Long.valueOf(WorldInfo.this.worldTime)}); + } + }); + category.addCrashSectionCallable("Level dimension", new Callable() + { + public String call() throws Exception + { + return String.valueOf(WorldInfo.this.dimension); + } + }); + category.addCrashSectionCallable("Level storage version", new Callable() + { + public String call() throws Exception + { + String s = "Unknown?"; + + try + { + switch (WorldInfo.this.saveVersion) + { + case 19132: + s = "McRegion"; + break; + + case 19133: + s = "Anvil"; + } + } + catch (Throwable var3) + { + ; + } + + return String.format("0x%05X - %s", new Object[] {Integer.valueOf(WorldInfo.this.saveVersion), s}); + } + }); + category.addCrashSectionCallable("Level weather", new Callable() + { + public String call() throws Exception + { + return String.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", new Object[] {Integer.valueOf(WorldInfo.this.rainTime), Boolean.valueOf(WorldInfo.this.raining), Integer.valueOf(WorldInfo.this.thunderTime), Boolean.valueOf(WorldInfo.this.thundering)}); + } + }); + category.addCrashSectionCallable("Level game mode", new Callable() + { + public String call() throws Exception + { + return String.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", new Object[] {WorldInfo.this.theGameType.getName(), Integer.valueOf(WorldInfo.this.theGameType.getID()), Boolean.valueOf(WorldInfo.this.hardcore), Boolean.valueOf(WorldInfo.this.allowCommands)}); + } + }); + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/client/model/IModelPart.java b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/IModelPart.java new file mode 100644 index 0000000..257cb22 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/IModelPart.java @@ -0,0 +1,5 @@ +package net.minecraftforge.client.model; + +public interface IModelPart +{ +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/client/model/IModelState.java b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/IModelState.java new file mode 100644 index 0000000..4f10b20 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/IModelState.java @@ -0,0 +1,8 @@ +package net.minecraftforge.client.model; + +import com.google.common.base.Optional; + +public interface IModelState +{ + Optional apply(Optional var1); +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/client/model/ISmartItemModel.java b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/ISmartItemModel.java new file mode 100644 index 0000000..d32c5be --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/ISmartItemModel.java @@ -0,0 +1,9 @@ +package net.minecraftforge.client.model; + +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.item.ItemStack; + +public interface ISmartItemModel extends IBakedModel +{ + IBakedModel handleItemState(ItemStack var1); +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/client/model/ITransformation.java b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/ITransformation.java new file mode 100644 index 0000000..196dd68 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/ITransformation.java @@ -0,0 +1,13 @@ +package net.minecraftforge.client.model; + +import javax.vecmath.Matrix4f; +import net.minecraft.util.EnumFacing; + +public interface ITransformation +{ + Matrix4f getMatrix(); + + EnumFacing rotate(EnumFacing var1); + + int rotate(EnumFacing var1, int var2); +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/client/model/TRSRTransformation.java b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/TRSRTransformation.java new file mode 100644 index 0000000..b42660e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/TRSRTransformation.java @@ -0,0 +1,17 @@ +package net.minecraftforge.client.model; + +import javax.vecmath.Matrix4f; +import org.apache.commons.lang3.NotImplementedException; + +public class TRSRTransformation +{ + public TRSRTransformation(Matrix4f matrix) + { + throw new NotImplementedException("Forge dummy class"); + } + + public static boolean isInteger(Matrix4f matrix) + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/client/model/pipeline/IVertexConsumer.java b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/pipeline/IVertexConsumer.java new file mode 100644 index 0000000..bd8f2ea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/pipeline/IVertexConsumer.java @@ -0,0 +1,17 @@ +package net.minecraftforge.client.model.pipeline; + +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.util.EnumFacing; + +public interface IVertexConsumer +{ + VertexFormat getVertexFormat(); + + void setQuadTint(int var1); + + void setQuadOrientation(EnumFacing var1); + + void setQuadColored(); + + void put(int var1, float... var2); +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/client/model/pipeline/IVertexProducer.java b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/pipeline/IVertexProducer.java new file mode 100644 index 0000000..6662ed8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/client/model/pipeline/IVertexProducer.java @@ -0,0 +1,6 @@ +package net.minecraftforge.client.model.pipeline; + +public interface IVertexProducer +{ + void pipe(IVertexConsumer var1); +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/common/property/IUnlistedProperty.java b/Client-1.8.9/src/main/java/net/minecraftforge/common/property/IUnlistedProperty.java new file mode 100644 index 0000000..fc14479 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/common/property/IUnlistedProperty.java @@ -0,0 +1,12 @@ +package net.minecraftforge.common.property; + +public interface IUnlistedProperty +{ + String getName(); + + boolean isValid(V var1); + + Class getType(); + + String valueToString(V var1); +} diff --git a/Client-1.8.9/src/main/java/net/minecraftforge/fml/common/registry/RegistryDelegate.java b/Client-1.8.9/src/main/java/net/minecraftforge/fml/common/registry/RegistryDelegate.java new file mode 100644 index 0000000..2d0a991 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/minecraftforge/fml/common/registry/RegistryDelegate.java @@ -0,0 +1,12 @@ +package net.minecraftforge.fml.common.registry; + +import net.minecraft.util.ResourceLocation; + +public interface RegistryDelegate +{ + T get(); + + ResourceLocation name(); + + Class type(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/BetterGrass.java b/Client-1.8.9/src/main/java/net/optifine/BetterGrass.java new file mode 100644 index 0000000..4939a36 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/BetterGrass.java @@ -0,0 +1,312 @@ +package net.optifine; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Properties; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockGrass; +import net.minecraft.block.BlockMycelium; +import net.minecraft.block.BlockDirt.DirtType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.optifine.model.BlockModelUtils; +import net.optifine.util.PropertiesOrdered; + +public class BetterGrass +{ + private static boolean betterGrass = true; + private static boolean betterMycelium = true; + private static boolean betterPodzol = true; + private static boolean betterGrassSnow = true; + private static boolean betterMyceliumSnow = true; + private static boolean betterPodzolSnow = true; + private static boolean grassMultilayer = false; + private static TextureAtlasSprite spriteGrass = null; + private static TextureAtlasSprite spriteGrassSide = null; + private static TextureAtlasSprite spriteMycelium = null; + private static TextureAtlasSprite spritePodzol = null; + private static TextureAtlasSprite spriteSnow = null; + private static boolean spritesLoaded = false; + private static IBakedModel modelCubeGrass = null; + private static IBakedModel modelCubeMycelium = null; + private static IBakedModel modelCubePodzol = null; + private static IBakedModel modelCubeSnow = null; + private static boolean modelsLoaded = false; + private static final String TEXTURE_GRASS_DEFAULT = "blocks/grass_top"; + private static final String TEXTURE_GRASS_SIDE_DEFAULT = "blocks/grass_side"; + private static final String TEXTURE_MYCELIUM_DEFAULT = "blocks/mycelium_top"; + private static final String TEXTURE_PODZOL_DEFAULT = "blocks/dirt_podzol_top"; + private static final String TEXTURE_SNOW_DEFAULT = "blocks/snow"; + + public static void updateIcons(TextureMap textureMap) + { + spritesLoaded = false; + modelsLoaded = false; + loadProperties(textureMap); + } + + public static void update() + { + if (spritesLoaded) + { + modelCubeGrass = BlockModelUtils.makeModelCube((TextureAtlasSprite)spriteGrass, 0); + + if (grassMultilayer) + { + IBakedModel ibakedmodel = BlockModelUtils.makeModelCube((TextureAtlasSprite)spriteGrassSide, -1); + modelCubeGrass = BlockModelUtils.joinModelsCube(ibakedmodel, modelCubeGrass); + } + + modelCubeMycelium = BlockModelUtils.makeModelCube((TextureAtlasSprite)spriteMycelium, -1); + modelCubePodzol = BlockModelUtils.makeModelCube((TextureAtlasSprite)spritePodzol, 0); + modelCubeSnow = BlockModelUtils.makeModelCube((TextureAtlasSprite)spriteSnow, -1); + modelsLoaded = true; + } + } + + private static void loadProperties(TextureMap textureMap) + { + betterGrass = true; + betterMycelium = true; + betterPodzol = true; + betterGrassSnow = true; + betterMyceliumSnow = true; + betterPodzolSnow = true; + spriteGrass = textureMap.registerSprite(new ResourceLocation("blocks/grass_top")); + spriteGrassSide = textureMap.registerSprite(new ResourceLocation("blocks/grass_side")); + spriteMycelium = textureMap.registerSprite(new ResourceLocation("blocks/mycelium_top")); + spritePodzol = textureMap.registerSprite(new ResourceLocation("blocks/dirt_podzol_top")); + spriteSnow = textureMap.registerSprite(new ResourceLocation("blocks/snow")); + spritesLoaded = true; + String s = "optifine/bettergrass.properties"; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s); + + if (!Config.hasResource(resourcelocation)) + { + return; + } + + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return; + } + + boolean flag = Config.isFromDefaultResourcePack(resourcelocation); + + if (flag) + { + Config.dbg("BetterGrass: Parsing default configuration " + s); + } + else + { + Config.dbg("BetterGrass: Parsing configuration " + s); + } + + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + betterGrass = getBoolean(properties, "grass", true); + betterMycelium = getBoolean(properties, "mycelium", true); + betterPodzol = getBoolean(properties, "podzol", true); + betterGrassSnow = getBoolean(properties, "grass.snow", true); + betterMyceliumSnow = getBoolean(properties, "mycelium.snow", true); + betterPodzolSnow = getBoolean(properties, "podzol.snow", true); + grassMultilayer = getBoolean(properties, "grass.multilayer", false); + spriteGrass = registerSprite(properties, "texture.grass", "blocks/grass_top", textureMap); + spriteGrassSide = registerSprite(properties, "texture.grass_side", "blocks/grass_side", textureMap); + spriteMycelium = registerSprite(properties, "texture.mycelium", "blocks/mycelium_top", textureMap); + spritePodzol = registerSprite(properties, "texture.podzol", "blocks/dirt_podzol_top", textureMap); + spriteSnow = registerSprite(properties, "texture.snow", "blocks/snow", textureMap); + } + catch (IOException ioexception) + { + Config.warn("Error reading: " + s + ", " + ioexception.getClass().getName() + ": " + ioexception.getMessage()); + } + } + + private static TextureAtlasSprite registerSprite(Properties props, String key, String textureDefault, TextureMap textureMap) + { + String s = props.getProperty(key); + + if (s == null) + { + s = textureDefault; + } + + ResourceLocation resourcelocation = new ResourceLocation("textures/" + s + ".png"); + + if (!Config.hasResource(resourcelocation)) + { + Config.warn("BetterGrass texture not found: " + resourcelocation); + s = textureDefault; + } + + ResourceLocation resourcelocation1 = new ResourceLocation(s); + TextureAtlasSprite textureatlassprite = textureMap.registerSprite(resourcelocation1); + return textureatlassprite; + } + + public static List getFaceQuads(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, EnumFacing facing, List quads) + { + if (facing != EnumFacing.UP && facing != EnumFacing.DOWN) + { + if (!modelsLoaded) + { + return quads; + } + else + { + Block block = blockState.getBlock(); + return block instanceof BlockMycelium ? getFaceQuadsMycelium(blockAccess, blockState, blockPos, facing, quads) : (block instanceof BlockDirt ? getFaceQuadsDirt(blockAccess, blockState, blockPos, facing, quads) : (block instanceof BlockGrass ? getFaceQuadsGrass(blockAccess, blockState, blockPos, facing, quads) : quads)); + } + } + else + { + return quads; + } + } + + private static List getFaceQuadsMycelium(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, EnumFacing facing, List quads) + { + Block block = blockAccess.getBlockState(blockPos.up()).getBlock(); + boolean flag = block == Blocks.snow || block == Blocks.snow_layer; + + if (Config.isBetterGrassFancy()) + { + if (flag) + { + if (betterMyceliumSnow && getBlockAt(blockPos, facing, blockAccess) == Blocks.snow_layer) + { + return modelCubeSnow.getFaceQuads(facing); + } + } + else if (betterMycelium && getBlockAt(blockPos.down(), facing, blockAccess) == Blocks.mycelium) + { + return modelCubeMycelium.getFaceQuads(facing); + } + } + else if (flag) + { + if (betterMyceliumSnow) + { + return modelCubeSnow.getFaceQuads(facing); + } + } + else if (betterMycelium) + { + return modelCubeMycelium.getFaceQuads(facing); + } + + return quads; + } + + private static List getFaceQuadsDirt(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, EnumFacing facing, List quads) + { + Block block = getBlockAt(blockPos, EnumFacing.UP, blockAccess); + + if (blockState.getValue(BlockDirt.VARIANT) != DirtType.PODZOL) + { + return quads; + } + else + { + boolean flag = block == Blocks.snow || block == Blocks.snow_layer; + + if (Config.isBetterGrassFancy()) + { + if (flag) + { + if (betterPodzolSnow && getBlockAt(blockPos, facing, blockAccess) == Blocks.snow_layer) + { + return modelCubeSnow.getFaceQuads(facing); + } + } + else if (betterPodzol) + { + BlockPos blockpos = blockPos.down().offset(facing); + IBlockState iblockstate = blockAccess.getBlockState(blockpos); + + if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == DirtType.PODZOL) + { + return modelCubePodzol.getFaceQuads(facing); + } + } + } + else if (flag) + { + if (betterPodzolSnow) + { + return modelCubeSnow.getFaceQuads(facing); + } + } + else if (betterPodzol) + { + return modelCubePodzol.getFaceQuads(facing); + } + + return quads; + } + } + + private static List getFaceQuadsGrass(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, EnumFacing facing, List quads) + { + Block block = blockAccess.getBlockState(blockPos.up()).getBlock(); + boolean flag = block == Blocks.snow || block == Blocks.snow_layer; + + if (Config.isBetterGrassFancy()) + { + if (flag) + { + if (betterGrassSnow && getBlockAt(blockPos, facing, blockAccess) == Blocks.snow_layer) + { + return modelCubeSnow.getFaceQuads(facing); + } + } + else if (betterGrass && getBlockAt(blockPos.down(), facing, blockAccess) == Blocks.grass) + { + return modelCubeGrass.getFaceQuads(facing); + } + } + else if (flag) + { + if (betterGrassSnow) + { + return modelCubeSnow.getFaceQuads(facing); + } + } + else if (betterGrass) + { + return modelCubeGrass.getFaceQuads(facing); + } + + return quads; + } + + private static Block getBlockAt(BlockPos blockPos, EnumFacing facing, IBlockAccess blockAccess) + { + BlockPos blockpos = blockPos.offset(facing); + Block block = blockAccess.getBlockState(blockpos).getBlock(); + return block; + } + + private static boolean getBoolean(Properties props, String key, boolean def) + { + String s = props.getProperty(key); + return s == null ? def : Boolean.parseBoolean(s); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/BetterSnow.java b/Client-1.8.9/src/main/java/net/optifine/BetterSnow.java new file mode 100644 index 0000000..354e68e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/BetterSnow.java @@ -0,0 +1,107 @@ +package net.optifine; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBush; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockFlowerPot; +import net.minecraft.block.BlockLever; +import net.minecraft.block.BlockMushroom; +import net.minecraft.block.BlockPane; +import net.minecraft.block.BlockRedstoneTorch; +import net.minecraft.block.BlockReed; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.BlockSnow; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.BlockTorch; +import net.minecraft.block.BlockWall; +import net.minecraft.block.BlockLever.EnumOrientation; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.IBlockAccess; + +public class BetterSnow +{ + private static IBakedModel modelSnowLayer = null; + + public static void update() + { + modelSnowLayer = Config.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(Blocks.snow_layer.getDefaultState()); + } + + public static IBakedModel getModelSnowLayer() + { + return modelSnowLayer; + } + + public static IBlockState getStateSnowLayer() + { + return Blocks.snow_layer.getDefaultState(); + } + + public static boolean shouldRender(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos) + { + Block block = blockState.getBlock(); + return !checkBlock(block, blockState) ? false : hasSnowNeighbours(blockAccess, blockPos); + } + + private static boolean hasSnowNeighbours(IBlockAccess blockAccess, BlockPos pos) + { + Block block = Blocks.snow_layer; + return blockAccess.getBlockState(pos.north()).getBlock() != block && blockAccess.getBlockState(pos.south()).getBlock() != block && blockAccess.getBlockState(pos.west()).getBlock() != block && blockAccess.getBlockState(pos.east()).getBlock() != block ? false : blockAccess.getBlockState(pos.down()).getBlock().isOpaqueCube(); + } + + private static boolean checkBlock(Block block, IBlockState blockState) + { + if (block.isFullCube()) + { + return false; + } + else if (block.isOpaqueCube()) + { + return false; + } + else if (block instanceof BlockSnow) + { + return false; + } + else if (!(block instanceof BlockBush) || !(block instanceof BlockDoublePlant) && !(block instanceof BlockFlower) && !(block instanceof BlockMushroom) && !(block instanceof BlockSapling) && !(block instanceof BlockTallGrass)) + { + if (!(block instanceof BlockFence) && !(block instanceof BlockFenceGate) && !(block instanceof BlockFlowerPot) && !(block instanceof BlockPane) && !(block instanceof BlockReed) && !(block instanceof BlockWall)) + { + if (block instanceof BlockRedstoneTorch && blockState.getValue(BlockTorch.FACING) == EnumFacing.UP) + { + return true; + } + else + { + if (block instanceof BlockLever) + { + Object object = blockState.getValue(BlockLever.FACING); + + if (object == EnumOrientation.UP_X || object == EnumOrientation.UP_Z) + { + return true; + } + } + + return false; + } + } + else + { + return true; + } + } + else + { + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/BlockDir.java b/Client-1.8.9/src/main/java/net/optifine/BlockDir.java new file mode 100644 index 0000000..b0561b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/BlockDir.java @@ -0,0 +1,103 @@ +package net.optifine; + +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; + +public enum BlockDir +{ + DOWN(EnumFacing.DOWN), + UP(EnumFacing.UP), + NORTH(EnumFacing.NORTH), + SOUTH(EnumFacing.SOUTH), + WEST(EnumFacing.WEST), + EAST(EnumFacing.EAST), + NORTH_WEST(EnumFacing.NORTH, EnumFacing.WEST), + NORTH_EAST(EnumFacing.NORTH, EnumFacing.EAST), + SOUTH_WEST(EnumFacing.SOUTH, EnumFacing.WEST), + SOUTH_EAST(EnumFacing.SOUTH, EnumFacing.EAST), + DOWN_NORTH(EnumFacing.DOWN, EnumFacing.NORTH), + DOWN_SOUTH(EnumFacing.DOWN, EnumFacing.SOUTH), + UP_NORTH(EnumFacing.UP, EnumFacing.NORTH), + UP_SOUTH(EnumFacing.UP, EnumFacing.SOUTH), + DOWN_WEST(EnumFacing.DOWN, EnumFacing.WEST), + DOWN_EAST(EnumFacing.DOWN, EnumFacing.EAST), + UP_WEST(EnumFacing.UP, EnumFacing.WEST), + UP_EAST(EnumFacing.UP, EnumFacing.EAST); + + private EnumFacing facing1; + private EnumFacing facing2; + + private BlockDir(EnumFacing facing1) + { + this.facing1 = facing1; + } + + private BlockDir(EnumFacing facing1, EnumFacing facing2) + { + this.facing1 = facing1; + this.facing2 = facing2; + } + + public EnumFacing getFacing1() + { + return this.facing1; + } + + public EnumFacing getFacing2() + { + return this.facing2; + } + + BlockPos offset(BlockPos pos) + { + pos = pos.offset(this.facing1, 1); + + if (this.facing2 != null) + { + pos = pos.offset(this.facing2, 1); + } + + return pos; + } + + public int getOffsetX() + { + int i = this.facing1.getFrontOffsetX(); + + if (this.facing2 != null) + { + i += this.facing2.getFrontOffsetX(); + } + + return i; + } + + public int getOffsetY() + { + int i = this.facing1.getFrontOffsetY(); + + if (this.facing2 != null) + { + i += this.facing2.getFrontOffsetY(); + } + + return i; + } + + public int getOffsetZ() + { + int i = this.facing1.getFrontOffsetZ(); + + if (this.facing2 != null) + { + i += this.facing2.getFrontOffsetZ(); + } + + return i; + } + + public boolean isDouble() + { + return this.facing2 != null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/BlockPosM.java b/Client-1.8.9/src/main/java/net/optifine/BlockPosM.java new file mode 100644 index 0000000..ce92915 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/BlockPosM.java @@ -0,0 +1,220 @@ +package net.optifine; + +import com.google.common.collect.AbstractIterator; +import java.util.Iterator; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3i; + +public class BlockPosM extends BlockPos +{ + private int mx; + private int my; + private int mz; + private int level; + private BlockPosM[] facings; + private boolean needsUpdate; + + public BlockPosM(int x, int y, int z) + { + this(x, y, z, 0); + } + + public BlockPosM(double xIn, double yIn, double zIn) + { + this(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn)); + } + + public BlockPosM(int x, int y, int z, int level) + { + super(0, 0, 0); + this.mx = x; + this.my = y; + this.mz = z; + this.level = level; + } + + /** + * Get the X coordinate + */ + public int getX() + { + return this.mx; + } + + /** + * Get the Y coordinate + */ + public int getY() + { + return this.my; + } + + /** + * Get the Z coordinate + */ + public int getZ() + { + return this.mz; + } + + public void setXyz(int x, int y, int z) + { + this.mx = x; + this.my = y; + this.mz = z; + this.needsUpdate = true; + } + + public void setXyz(double xIn, double yIn, double zIn) + { + this.setXyz(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn)); + } + + public BlockPosM set(Vec3i vec) + { + this.setXyz(vec.getX(), vec.getY(), vec.getZ()); + return this; + } + + public BlockPosM set(int xIn, int yIn, int zIn) + { + this.setXyz(xIn, yIn, zIn); + return this; + } + + public BlockPos offsetMutable(EnumFacing facing) + { + return this.offset(facing); + } + + /** + * Offset this BlockPos 1 block in the given direction + */ + public BlockPos offset(EnumFacing facing) + { + if (this.level <= 0) + { + return super.offset(facing, 1); + } + else + { + if (this.facings == null) + { + this.facings = new BlockPosM[EnumFacing.VALUES.length]; + } + + if (this.needsUpdate) + { + this.update(); + } + + int i = facing.getIndex(); + BlockPosM blockposm = this.facings[i]; + + if (blockposm == null) + { + int j = this.mx + facing.getFrontOffsetX(); + int k = this.my + facing.getFrontOffsetY(); + int l = this.mz + facing.getFrontOffsetZ(); + blockposm = new BlockPosM(j, k, l, this.level - 1); + this.facings[i] = blockposm; + } + + return blockposm; + } + } + + /** + * Offsets this BlockPos n blocks in the given direction + * + * @param facing The direction of the offset + * @param n The number of blocks to offset by + */ + public BlockPos offset(EnumFacing facing, int n) + { + return n == 1 ? this.offset(facing) : super.offset(facing, n); + } + + private void update() + { + for (int i = 0; i < 6; ++i) + { + BlockPosM blockposm = this.facings[i]; + + if (blockposm != null) + { + EnumFacing enumfacing = EnumFacing.VALUES[i]; + int j = this.mx + enumfacing.getFrontOffsetX(); + int k = this.my + enumfacing.getFrontOffsetY(); + int l = this.mz + enumfacing.getFrontOffsetZ(); + blockposm.setXyz(j, k, l); + } + } + + this.needsUpdate = false; + } + + public BlockPos toImmutable() + { + return new BlockPos(this.mx, this.my, this.mz); + } + + public static Iterable getAllInBoxMutable(BlockPos from, BlockPos to) + { + final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ())); + final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ())); + return new Iterable() + { + public Iterator iterator() + { + return new AbstractIterator() + { + private BlockPosM theBlockPosM = null; + protected BlockPosM computeNext0() + { + if (this.theBlockPosM == null) + { + this.theBlockPosM = new BlockPosM(blockpos.getX(), blockpos.getY(), blockpos.getZ(), 3); + return this.theBlockPosM; + } + else if (this.theBlockPosM.equals(blockpos1)) + { + return (BlockPosM)this.endOfData(); + } + else + { + int i = this.theBlockPosM.getX(); + int j = this.theBlockPosM.getY(); + int k = this.theBlockPosM.getZ(); + + if (i < blockpos1.getX()) + { + ++i; + } + else if (j < blockpos1.getY()) + { + i = blockpos.getX(); + ++j; + } + else if (k < blockpos1.getZ()) + { + i = blockpos.getX(); + j = blockpos.getY(); + ++k; + } + + this.theBlockPosM.setXyz(i, j, k); + return this.theBlockPosM; + } + } + protected Object computeNext() + { + return this.computeNext0(); + } + }; + } + }; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/ChunkPosComparator.java b/Client-1.8.9/src/main/java/net/optifine/ChunkPosComparator.java new file mode 100644 index 0000000..c863343 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/ChunkPosComparator.java @@ -0,0 +1,45 @@ +package net.optifine; + +import java.util.Comparator; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; + +public class ChunkPosComparator implements Comparator +{ + private int chunkPosX; + private int chunkPosZ; + private double yawRad; + private double pitchNorm; + + public ChunkPosComparator(int chunkPosX, int chunkPosZ, double yawRad, double pitchRad) + { + this.chunkPosX = chunkPosX; + this.chunkPosZ = chunkPosZ; + this.yawRad = yawRad; + this.pitchNorm = 1.0D - MathHelper.clamp_double(Math.abs(pitchRad) / (Math.PI / 2D), 0.0D, 1.0D); + } + + public int compare(ChunkCoordIntPair cp1, ChunkCoordIntPair cp2) + { + int i = this.getDistSq(cp1); + int j = this.getDistSq(cp2); + return i - j; + } + + private int getDistSq(ChunkCoordIntPair cp) + { + int i = cp.chunkXPos - this.chunkPosX; + int j = cp.chunkZPos - this.chunkPosZ; + int k = i * i + j * j; + double d0 = MathHelper.atan2((double)j, (double)i); + double d1 = Math.abs(d0 - this.yawRad); + + if (d1 > Math.PI) + { + d1 = (Math.PI * 2D) - d1; + } + + k = (int)((double)k * 1000.0D * this.pitchNorm * d1 * d1); + return k; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/ClearWater.java b/Client-1.8.9/src/main/java/net/optifine/ClearWater.java new file mode 100644 index 0000000..e7604c3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/ClearWater.java @@ -0,0 +1,109 @@ +package net.optifine; + +import net.minecraft.block.BlockAir; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; + +public class ClearWater +{ + public static void updateWaterOpacity(GameSettings settings, World world) + { + if (settings != null) + { + int i = 3; + + if (settings.ofClearWater) + { + i = 1; + } + + BlockAir.setLightOpacity(Blocks.water, i); + BlockAir.setLightOpacity(Blocks.flowing_water, i); + } + + if (world != null) + { + IChunkProvider ichunkprovider = world.getChunkProvider(); + + if (ichunkprovider != null) + { + Entity entity = Config.getMinecraft().getRenderViewEntity(); + + if (entity != null) + { + int j = (int)entity.posX / 16; + int k = (int)entity.posZ / 16; + int l = j - 512; + int i1 = j + 512; + int j1 = k - 512; + int k1 = k + 512; + int l1 = 0; + + for (int i2 = l; i2 < i1; ++i2) + { + for (int j2 = j1; j2 < k1; ++j2) + { + if (ichunkprovider.chunkExists(i2, j2)) + { + Chunk chunk = ichunkprovider.provideChunk(i2, j2); + + if (chunk != null && !(chunk instanceof EmptyChunk)) + { + int k2 = i2 << 4; + int l2 = j2 << 4; + int i3 = k2 + 16; + int j3 = l2 + 16; + BlockPosM blockposm = new BlockPosM(0, 0, 0); + BlockPosM blockposm1 = new BlockPosM(0, 0, 0); + + for (int k3 = k2; k3 < i3; ++k3) + { + for (int l3 = l2; l3 < j3; ++l3) + { + blockposm.setXyz(k3, 0, l3); + BlockPos blockpos = world.getPrecipitationHeight(blockposm); + + for (int i4 = 0; i4 < blockpos.getY(); ++i4) + { + blockposm1.setXyz(k3, i4, l3); + IBlockState iblockstate = world.getBlockState(blockposm1); + + if (iblockstate.getBlock().getMaterial() == Material.water) + { + world.markBlocksDirtyVertical(k3, l3, blockposm1.getY(), blockpos.getY()); + ++l1; + break; + } + } + } + } + } + } + } + } + + if (l1 > 0) + { + String s = "server"; + + if (Config.isMinecraftThread()) + { + s = "client"; + } + + Config.dbg("ClearWater (" + s + ") relighted " + l1 + " chunks"); + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/ConnectedProperties.java b/Client-1.8.9/src/main/java/net/optifine/ConnectedProperties.java new file mode 100644 index 0000000..e7199a7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/ConnectedProperties.java @@ -0,0 +1,1272 @@ +package net.optifine; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.config.ConnectedParser; +import net.optifine.config.MatchBlock; +import net.optifine.config.Matches; +import net.optifine.config.NbtTagValue; +import net.optifine.config.RangeInt; +import net.optifine.config.RangeListInt; +import net.optifine.util.MathUtils; +import net.optifine.util.TextureUtils; + +public class ConnectedProperties +{ + public String name = null; + public String basePath = null; + public MatchBlock[] matchBlocks = null; + public int[] metadatas = null; + public String[] matchTiles = null; + public int method = 0; + public String[] tiles = null; + public int connect = 0; + public int faces = 63; + public BiomeGenBase[] biomes = null; + public RangeListInt heights = null; + public int renderPass = 0; + public boolean innerSeams = false; + public int[] ctmTileIndexes = null; + public int width = 0; + public int height = 0; + public int[] weights = null; + public int randomLoops = 0; + public int symmetry = 1; + public boolean linked = false; + public NbtTagValue nbtName = null; + public int[] sumWeights = null; + public int sumAllWeights = 1; + public TextureAtlasSprite[] matchTileIcons = null; + public TextureAtlasSprite[] tileIcons = null; + public MatchBlock[] connectBlocks = null; + public String[] connectTiles = null; + public TextureAtlasSprite[] connectTileIcons = null; + public int tintIndex = -1; + public IBlockState tintBlockState = Blocks.air.getDefaultState(); + public EnumWorldBlockLayer layer = null; + public static final int METHOD_NONE = 0; + public static final int METHOD_CTM = 1; + public static final int METHOD_HORIZONTAL = 2; + public static final int METHOD_TOP = 3; + public static final int METHOD_RANDOM = 4; + public static final int METHOD_REPEAT = 5; + public static final int METHOD_VERTICAL = 6; + public static final int METHOD_FIXED = 7; + public static final int METHOD_HORIZONTAL_VERTICAL = 8; + public static final int METHOD_VERTICAL_HORIZONTAL = 9; + public static final int METHOD_CTM_COMPACT = 10; + public static final int METHOD_OVERLAY = 11; + public static final int METHOD_OVERLAY_FIXED = 12; + public static final int METHOD_OVERLAY_RANDOM = 13; + public static final int METHOD_OVERLAY_REPEAT = 14; + public static final int METHOD_OVERLAY_CTM = 15; + public static final int CONNECT_NONE = 0; + public static final int CONNECT_BLOCK = 1; + public static final int CONNECT_TILE = 2; + public static final int CONNECT_MATERIAL = 3; + public static final int CONNECT_UNKNOWN = 128; + public static final int FACE_BOTTOM = 1; + public static final int FACE_TOP = 2; + public static final int FACE_NORTH = 4; + public static final int FACE_SOUTH = 8; + public static final int FACE_WEST = 16; + public static final int FACE_EAST = 32; + public static final int FACE_SIDES = 60; + public static final int FACE_ALL = 63; + public static final int FACE_UNKNOWN = 128; + public static final int SYMMETRY_NONE = 1; + public static final int SYMMETRY_OPPOSITE = 2; + public static final int SYMMETRY_ALL = 6; + public static final int SYMMETRY_UNKNOWN = 128; + public static final String TILE_SKIP_PNG = ".png"; + public static final String TILE_DEFAULT_PNG = ".png"; + + public ConnectedProperties(Properties props, String path) + { + ConnectedParser connectedparser = new ConnectedParser("ConnectedTextures"); + this.name = connectedparser.parseName(path); + this.basePath = connectedparser.parseBasePath(path); + this.matchBlocks = connectedparser.parseMatchBlocks(props.getProperty("matchBlocks")); + this.metadatas = connectedparser.parseIntList(props.getProperty("metadata")); + this.matchTiles = this.parseMatchTiles(props.getProperty("matchTiles")); + this.method = parseMethod(props.getProperty("method")); + this.tiles = this.parseTileNames(props.getProperty("tiles")); + this.connect = parseConnect(props.getProperty("connect")); + this.faces = parseFaces(props.getProperty("faces")); + this.biomes = connectedparser.parseBiomes(props.getProperty("biomes")); + this.heights = connectedparser.parseRangeListInt(props.getProperty("heights")); + + if (this.heights == null) + { + int i = connectedparser.parseInt(props.getProperty("minHeight"), -1); + int j = connectedparser.parseInt(props.getProperty("maxHeight"), 1024); + + if (i != -1 || j != 1024) + { + this.heights = new RangeListInt(new RangeInt(i, j)); + } + } + + this.renderPass = connectedparser.parseInt(props.getProperty("renderPass"), -1); + this.innerSeams = connectedparser.parseBoolean(props.getProperty("innerSeams"), false); + this.ctmTileIndexes = this.parseCtmTileIndexes(props); + this.width = connectedparser.parseInt(props.getProperty("width"), -1); + this.height = connectedparser.parseInt(props.getProperty("height"), -1); + this.weights = connectedparser.parseIntList(props.getProperty("weights")); + this.randomLoops = connectedparser.parseInt(props.getProperty("randomLoops"), 0); + this.symmetry = parseSymmetry(props.getProperty("symmetry")); + this.linked = connectedparser.parseBoolean(props.getProperty("linked"), false); + this.nbtName = connectedparser.parseNbtTagValue("name", props.getProperty("name")); + this.connectBlocks = connectedparser.parseMatchBlocks(props.getProperty("connectBlocks")); + this.connectTiles = this.parseMatchTiles(props.getProperty("connectTiles")); + this.tintIndex = connectedparser.parseInt(props.getProperty("tintIndex"), -1); + this.tintBlockState = connectedparser.parseBlockState(props.getProperty("tintBlock"), Blocks.air.getDefaultState()); + this.layer = connectedparser.parseBlockRenderLayer(props.getProperty("layer"), EnumWorldBlockLayer.CUTOUT_MIPPED); + } + + private int[] parseCtmTileIndexes(Properties props) + { + if (this.tiles == null) + { + return null; + } + else + { + Map map = new HashMap(); + + for (Object object : props.keySet()) + { + if (object instanceof String) + { + String s = (String)object; + String s1 = "ctm."; + + if (s.startsWith(s1)) + { + String s2 = s.substring(s1.length()); + String s3 = props.getProperty(s); + + if (s3 != null) + { + s3 = s3.trim(); + int i = Config.parseInt(s2, -1); + + if (i >= 0 && i <= 46) + { + int j = Config.parseInt(s3, -1); + + if (j >= 0 && j < this.tiles.length) + { + map.put(Integer.valueOf(i), Integer.valueOf(j)); + } + else + { + Config.warn("Invalid CTM tile index: " + s3); + } + } + else + { + Config.warn("Invalid CTM index: " + s2); + } + } + } + } + } + + if (map.isEmpty()) + { + return null; + } + else + { + int[] aint = new int[47]; + + for (int k = 0; k < aint.length; ++k) + { + aint[k] = -1; + + if (map.containsKey(Integer.valueOf(k))) + { + aint[k] = ((Integer)map.get(Integer.valueOf(k))).intValue(); + } + } + + return aint; + } + } + } + + private String[] parseMatchTiles(String str) + { + if (str == null) + { + return null; + } + else + { + String[] astring = Config.tokenize(str, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + if (s.endsWith(".png")) + { + s = s.substring(0, s.length() - 4); + } + + s = TextureUtils.fixResourcePath(s, this.basePath); + astring[i] = s; + } + + return astring; + } + } + + private static String parseName(String path) + { + String s = path; + int i = path.lastIndexOf(47); + + if (i >= 0) + { + s = path.substring(i + 1); + } + + int j = s.lastIndexOf(46); + + if (j >= 0) + { + s = s.substring(0, j); + } + + return s; + } + + private static String parseBasePath(String path) + { + int i = path.lastIndexOf(47); + return i < 0 ? "" : path.substring(0, i); + } + + private String[] parseTileNames(String str) + { + if (str == null) + { + return null; + } + else + { + List list = new ArrayList(); + String[] astring = Config.tokenize(str, " ,"); + label32: + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + if (s.contains("-")) + { + String[] astring1 = Config.tokenize(s, "-"); + + if (astring1.length == 2) + { + int j = Config.parseInt(astring1[0], -1); + int k = Config.parseInt(astring1[1], -1); + + if (j >= 0 && k >= 0) + { + if (j > k) + { + Config.warn("Invalid interval: " + s + ", when parsing: " + str); + continue; + } + + int l = j; + + while (true) + { + if (l > k) + { + continue label32; + } + + list.add(String.valueOf(l)); + ++l; + } + } + } + } + + list.add(s); + } + + String[] astring2 = (String[])((String[])list.toArray(new String[list.size()])); + + for (int i1 = 0; i1 < astring2.length; ++i1) + { + String s1 = astring2[i1]; + s1 = TextureUtils.fixResourcePath(s1, this.basePath); + + if (!s1.startsWith(this.basePath) && !s1.startsWith("textures/") && !s1.startsWith("mcpatcher/")) + { + s1 = this.basePath + "/" + s1; + } + + if (s1.endsWith(".png")) + { + s1 = s1.substring(0, s1.length() - 4); + } + + if (s1.startsWith("/")) + { + s1 = s1.substring(1); + } + + astring2[i1] = s1; + } + + return astring2; + } + } + + private static int parseSymmetry(String str) + { + if (str == null) + { + return 1; + } + else + { + str = str.trim(); + + if (str.equals("opposite")) + { + return 2; + } + else if (str.equals("all")) + { + return 6; + } + else + { + Config.warn("Unknown symmetry: " + str); + return 1; + } + } + } + + private static int parseFaces(String str) + { + if (str == null) + { + return 63; + } + else + { + String[] astring = Config.tokenize(str, " ,"); + int i = 0; + + for (int j = 0; j < astring.length; ++j) + { + String s = astring[j]; + int k = parseFace(s); + i |= k; + } + + return i; + } + } + + private static int parseFace(String str) + { + str = str.toLowerCase(); + + if (!str.equals("bottom") && !str.equals("down")) + { + if (!str.equals("top") && !str.equals("up")) + { + if (str.equals("north")) + { + return 4; + } + else if (str.equals("south")) + { + return 8; + } + else if (str.equals("east")) + { + return 32; + } + else if (str.equals("west")) + { + return 16; + } + else if (str.equals("sides")) + { + return 60; + } + else if (str.equals("all")) + { + return 63; + } + else + { + Config.warn("Unknown face: " + str); + return 128; + } + } + else + { + return 2; + } + } + else + { + return 1; + } + } + + private static int parseConnect(String str) + { + if (str == null) + { + return 0; + } + else + { + str = str.trim(); + + if (str.equals("block")) + { + return 1; + } + else if (str.equals("tile")) + { + return 2; + } + else if (str.equals("material")) + { + return 3; + } + else + { + Config.warn("Unknown connect: " + str); + return 128; + } + } + } + + public static IProperty getProperty(String key, Collection properties) + { + for (Object iproperty0 : properties) + { + IProperty iproperty = (IProperty) iproperty0; + if (key.equals(iproperty.getName())) + { + return iproperty; + } + } + + return null; + } + + private static int parseMethod(String str) + { + if (str == null) + { + return 1; + } + else + { + str = str.trim(); + + if (!str.equals("ctm") && !str.equals("glass")) + { + if (str.equals("ctm_compact")) + { + return 10; + } + else if (!str.equals("horizontal") && !str.equals("bookshelf")) + { + if (str.equals("vertical")) + { + return 6; + } + else if (str.equals("top")) + { + return 3; + } + else if (str.equals("random")) + { + return 4; + } + else if (str.equals("repeat")) + { + return 5; + } + else if (str.equals("fixed")) + { + return 7; + } + else if (!str.equals("horizontal+vertical") && !str.equals("h+v")) + { + if (!str.equals("vertical+horizontal") && !str.equals("v+h")) + { + if (str.equals("overlay")) + { + return 11; + } + else if (str.equals("overlay_fixed")) + { + return 12; + } + else if (str.equals("overlay_random")) + { + return 13; + } + else if (str.equals("overlay_repeat")) + { + return 14; + } + else if (str.equals("overlay_ctm")) + { + return 15; + } + else + { + Config.warn("Unknown method: " + str); + return 0; + } + } + else + { + return 9; + } + } + else + { + return 8; + } + } + else + { + return 2; + } + } + else + { + return 1; + } + } + } + + public boolean isValid(String path) + { + if (this.name != null && this.name.length() > 0) + { + if (this.basePath == null) + { + Config.warn("No base path found: " + path); + return false; + } + else + { + if (this.matchBlocks == null) + { + this.matchBlocks = this.detectMatchBlocks(); + } + + if (this.matchTiles == null && this.matchBlocks == null) + { + this.matchTiles = this.detectMatchTiles(); + } + + if (this.matchBlocks == null && this.matchTiles == null) + { + Config.warn("No matchBlocks or matchTiles specified: " + path); + return false; + } + else if (this.method == 0) + { + Config.warn("No method: " + path); + return false; + } + else if (this.tiles != null && this.tiles.length > 0) + { + if (this.connect == 0) + { + this.connect = this.detectConnect(); + } + + if (this.connect == 128) + { + Config.warn("Invalid connect in: " + path); + return false; + } + else if (this.renderPass > 0) + { + Config.warn("Render pass not supported: " + this.renderPass); + return false; + } + else if ((this.faces & 128) != 0) + { + Config.warn("Invalid faces in: " + path); + return false; + } + else if ((this.symmetry & 128) != 0) + { + Config.warn("Invalid symmetry in: " + path); + return false; + } + else + { + switch (this.method) + { + case 1: + return this.isValidCtm(path); + + case 2: + return this.isValidHorizontal(path); + + case 3: + return this.isValidTop(path); + + case 4: + return this.isValidRandom(path); + + case 5: + return this.isValidRepeat(path); + + case 6: + return this.isValidVertical(path); + + case 7: + return this.isValidFixed(path); + + case 8: + return this.isValidHorizontalVertical(path); + + case 9: + return this.isValidVerticalHorizontal(path); + + case 10: + return this.isValidCtmCompact(path); + + case 11: + return this.isValidOverlay(path); + + case 12: + return this.isValidOverlayFixed(path); + + case 13: + return this.isValidOverlayRandom(path); + + case 14: + return this.isValidOverlayRepeat(path); + + case 15: + return this.isValidOverlayCtm(path); + + default: + Config.warn("Unknown method: " + path); + return false; + } + } + } + else + { + Config.warn("No tiles specified: " + path); + return false; + } + } + } + else + { + Config.warn("No name found: " + path); + return false; + } + } + + private int detectConnect() + { + return this.matchBlocks != null ? 1 : (this.matchTiles != null ? 2 : 128); + } + + private MatchBlock[] detectMatchBlocks() + { + int[] aint = this.detectMatchBlockIds(); + + if (aint == null) + { + return null; + } + else + { + MatchBlock[] amatchblock = new MatchBlock[aint.length]; + + for (int i = 0; i < amatchblock.length; ++i) + { + amatchblock[i] = new MatchBlock(aint[i]); + } + + return amatchblock; + } + } + + private int[] detectMatchBlockIds() + { + if (!this.name.startsWith("block")) + { + return null; + } + else + { + int i = "block".length(); + int j; + + for (j = i; j < this.name.length(); ++j) + { + char c0 = this.name.charAt(j); + + if (c0 < 48 || c0 > 57) + { + break; + } + } + + if (j == i) + { + return null; + } + else + { + String s = this.name.substring(i, j); + int k = Config.parseInt(s, -1); + return k < 0 ? null : new int[] {k}; + } + } + } + + private String[] detectMatchTiles() + { + TextureAtlasSprite textureatlassprite = getIcon(this.name); + return textureatlassprite == null ? null : new String[] {this.name}; + } + + private static TextureAtlasSprite getIcon(String iconName) + { + TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks(); + TextureAtlasSprite textureatlassprite = texturemap.getSpriteSafe(iconName); + + if (textureatlassprite != null) + { + return textureatlassprite; + } + else + { + textureatlassprite = texturemap.getSpriteSafe("blocks/" + iconName); + return textureatlassprite; + } + } + + private boolean isValidCtm(String path) + { + if (this.tiles == null) + { + this.tiles = this.parseTileNames("0-11 16-27 32-43 48-58"); + } + + if (this.tiles.length < 47) + { + Config.warn("Invalid tiles, must be at least 47: " + path); + return false; + } + else + { + return true; + } + } + + private boolean isValidCtmCompact(String path) + { + if (this.tiles == null) + { + this.tiles = this.parseTileNames("0-4"); + } + + if (this.tiles.length < 5) + { + Config.warn("Invalid tiles, must be at least 5: " + path); + return false; + } + else + { + return true; + } + } + + private boolean isValidOverlay(String path) + { + if (this.tiles == null) + { + this.tiles = this.parseTileNames("0-16"); + } + + if (this.tiles.length < 17) + { + Config.warn("Invalid tiles, must be at least 17: " + path); + return false; + } + else if (this.layer != null && this.layer != EnumWorldBlockLayer.SOLID) + { + return true; + } + else + { + Config.warn("Invalid overlay layer: " + this.layer); + return false; + } + } + + private boolean isValidOverlayFixed(String path) + { + if (!this.isValidFixed(path)) + { + return false; + } + else if (this.layer != null && this.layer != EnumWorldBlockLayer.SOLID) + { + return true; + } + else + { + Config.warn("Invalid overlay layer: " + this.layer); + return false; + } + } + + private boolean isValidOverlayRandom(String path) + { + if (!this.isValidRandom(path)) + { + return false; + } + else if (this.layer != null && this.layer != EnumWorldBlockLayer.SOLID) + { + return true; + } + else + { + Config.warn("Invalid overlay layer: " + this.layer); + return false; + } + } + + private boolean isValidOverlayRepeat(String path) + { + if (!this.isValidRepeat(path)) + { + return false; + } + else if (this.layer != null && this.layer != EnumWorldBlockLayer.SOLID) + { + return true; + } + else + { + Config.warn("Invalid overlay layer: " + this.layer); + return false; + } + } + + private boolean isValidOverlayCtm(String path) + { + if (!this.isValidCtm(path)) + { + return false; + } + else if (this.layer != null && this.layer != EnumWorldBlockLayer.SOLID) + { + return true; + } + else + { + Config.warn("Invalid overlay layer: " + this.layer); + return false; + } + } + + private boolean isValidHorizontal(String path) + { + if (this.tiles == null) + { + this.tiles = this.parseTileNames("12-15"); + } + + if (this.tiles.length != 4) + { + Config.warn("Invalid tiles, must be exactly 4: " + path); + return false; + } + else + { + return true; + } + } + + private boolean isValidVertical(String path) + { + if (this.tiles == null) + { + Config.warn("No tiles defined for vertical: " + path); + return false; + } + else if (this.tiles.length != 4) + { + Config.warn("Invalid tiles, must be exactly 4: " + path); + return false; + } + else + { + return true; + } + } + + private boolean isValidHorizontalVertical(String path) + { + if (this.tiles == null) + { + Config.warn("No tiles defined for horizontal+vertical: " + path); + return false; + } + else if (this.tiles.length != 7) + { + Config.warn("Invalid tiles, must be exactly 7: " + path); + return false; + } + else + { + return true; + } + } + + private boolean isValidVerticalHorizontal(String path) + { + if (this.tiles == null) + { + Config.warn("No tiles defined for vertical+horizontal: " + path); + return false; + } + else if (this.tiles.length != 7) + { + Config.warn("Invalid tiles, must be exactly 7: " + path); + return false; + } + else + { + return true; + } + } + + private boolean isValidRandom(String path) + { + if (this.tiles != null && this.tiles.length > 0) + { + if (this.weights != null) + { + if (this.weights.length > this.tiles.length) + { + Config.warn("More weights defined than tiles, trimming weights: " + path); + int[] aint = new int[this.tiles.length]; + System.arraycopy(this.weights, 0, aint, 0, aint.length); + this.weights = aint; + } + + if (this.weights.length < this.tiles.length) + { + Config.warn("Less weights defined than tiles, expanding weights: " + path); + int[] aint1 = new int[this.tiles.length]; + System.arraycopy(this.weights, 0, aint1, 0, this.weights.length); + int i = MathUtils.getAverage(this.weights); + + for (int j = this.weights.length; j < aint1.length; ++j) + { + aint1[j] = i; + } + + this.weights = aint1; + } + + this.sumWeights = new int[this.weights.length]; + int k = 0; + + for (int l = 0; l < this.weights.length; ++l) + { + k += this.weights[l]; + this.sumWeights[l] = k; + } + + this.sumAllWeights = k; + + if (this.sumAllWeights <= 0) + { + Config.warn("Invalid sum of all weights: " + k); + this.sumAllWeights = 1; + } + } + + if (this.randomLoops >= 0 && this.randomLoops <= 9) + { + return true; + } + else + { + Config.warn("Invalid randomLoops: " + this.randomLoops); + return false; + } + } + else + { + Config.warn("Tiles not defined: " + path); + return false; + } + } + + private boolean isValidRepeat(String path) + { + if (this.tiles == null) + { + Config.warn("Tiles not defined: " + path); + return false; + } + else if (this.width <= 0) + { + Config.warn("Invalid width: " + path); + return false; + } + else if (this.height <= 0) + { + Config.warn("Invalid height: " + path); + return false; + } + else if (this.tiles.length != this.width * this.height) + { + Config.warn("Number of tiles does not equal width x height: " + path); + return false; + } + else + { + return true; + } + } + + private boolean isValidFixed(String path) + { + if (this.tiles == null) + { + Config.warn("Tiles not defined: " + path); + return false; + } + else if (this.tiles.length != 1) + { + Config.warn("Number of tiles should be 1 for method: fixed."); + return false; + } + else + { + return true; + } + } + + private boolean isValidTop(String path) + { + if (this.tiles == null) + { + this.tiles = this.parseTileNames("66"); + } + + if (this.tiles.length != 1) + { + Config.warn("Invalid tiles, must be exactly 1: " + path); + return false; + } + else + { + return true; + } + } + + public void updateIcons(TextureMap textureMap) + { + if (this.matchTiles != null) + { + this.matchTileIcons = registerIcons(this.matchTiles, textureMap, false, false); + } + + if (this.connectTiles != null) + { + this.connectTileIcons = registerIcons(this.connectTiles, textureMap, false, false); + } + + if (this.tiles != null) + { + this.tileIcons = registerIcons(this.tiles, textureMap, true, !isMethodOverlay(this.method)); + } + } + + private static boolean isMethodOverlay(int method) + { + switch (method) + { + case 11: + case 12: + case 13: + case 14: + case 15: + return true; + + default: + return false; + } + } + + private static TextureAtlasSprite[] registerIcons(String[] tileNames, TextureMap textureMap, boolean skipTiles, boolean defaultTiles) + { + if (tileNames == null) + { + return null; + } + else + { + List list = new ArrayList(); + + for (int i = 0; i < tileNames.length; ++i) + { + String s = tileNames[i]; + ResourceLocation resourcelocation = new ResourceLocation(s); + String s1 = resourcelocation.getResourceDomain(); + String s2 = resourcelocation.getResourcePath(); + + if (!s2.contains("/")) + { + s2 = "textures/blocks/" + s2; + } + + String s3 = s2 + ".png"; + + if (skipTiles && s3.endsWith(".png")) + { + list.add(null); + } + else if (defaultTiles && s3.endsWith(".png")) + { + list.add(ConnectedTextures.SPRITE_DEFAULT); + } + else + { + ResourceLocation resourcelocation1 = new ResourceLocation(s1, s3); + boolean flag = Config.hasResource(resourcelocation1); + + if (!flag) + { + Config.warn("File not found: " + s3); + } + + String s4 = "textures/"; + String s5 = s2; + + if (s2.startsWith(s4)) + { + s5 = s2.substring(s4.length()); + } + + ResourceLocation resourcelocation2 = new ResourceLocation(s1, s5); + TextureAtlasSprite textureatlassprite = textureMap.registerSprite(resourcelocation2); + list.add(textureatlassprite); + } + } + + TextureAtlasSprite[] atextureatlassprite = (TextureAtlasSprite[])((TextureAtlasSprite[])list.toArray(new TextureAtlasSprite[list.size()])); + return atextureatlassprite; + } + } + + public boolean matchesBlockId(int blockId) + { + return Matches.blockId(blockId, this.matchBlocks); + } + + public boolean matchesBlock(int blockId, int metadata) + { + return !Matches.block(blockId, metadata, this.matchBlocks) ? false : Matches.metadata(metadata, this.metadatas); + } + + public boolean matchesIcon(TextureAtlasSprite icon) + { + return Matches.sprite(icon, this.matchTileIcons); + } + + public String toString() + { + return "CTM name: " + this.name + ", basePath: " + this.basePath + ", matchBlocks: " + Config.arrayToString((Object[])this.matchBlocks) + ", matchTiles: " + Config.arrayToString((Object[])this.matchTiles); + } + + public boolean matchesBiome(BiomeGenBase biome) + { + return Matches.biome(biome, this.biomes); + } + + public int getMetadataMax() + { + int i = -1; + i = this.getMax(this.metadatas, i); + + if (this.matchBlocks != null) + { + for (int j = 0; j < this.matchBlocks.length; ++j) + { + MatchBlock matchblock = this.matchBlocks[j]; + i = this.getMax(matchblock.getMetadatas(), i); + } + } + + return i; + } + + private int getMax(int[] mds, int max) + { + if (mds == null) + { + return max; + } + else + { + for (int i = 0; i < mds.length; ++i) + { + int j = mds[i]; + + if (j > max) + { + max = j; + } + } + + return max; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/ConnectedTextures.java b/Client-1.8.9/src/main/java/net/optifine/ConnectedTextures.java new file mode 100644 index 0000000..59840ec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/ConnectedTextures.java @@ -0,0 +1,2476 @@ +package net.optifine; + +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.BlockGlass; +import net.minecraft.block.BlockPane; +import net.minecraft.block.BlockQuartz; +import net.minecraft.block.BlockRotatedPillar; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.config.Matches; +import net.optifine.model.BlockModelUtils; +import net.optifine.model.ListQuadsOverlay; +import net.optifine.reflect.Reflector; +import net.optifine.render.RenderEnv; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.ResUtils; +import net.optifine.util.TileEntityUtils; + +public class ConnectedTextures +{ + private static Map[] spriteQuadMaps = null; + private static Map[] spriteQuadFullMaps = null; + private static Map[][] spriteQuadCompactMaps = (Map[][])null; + private static ConnectedProperties[][] blockProperties = (ConnectedProperties[][])null; + private static ConnectedProperties[][] tileProperties = (ConnectedProperties[][])null; + private static boolean multipass = false; + protected static final int UNKNOWN = -1; + protected static final int Y_NEG_DOWN = 0; + protected static final int Y_POS_UP = 1; + protected static final int Z_NEG_NORTH = 2; + protected static final int Z_POS_SOUTH = 3; + protected static final int X_NEG_WEST = 4; + protected static final int X_POS_EAST = 5; + private static final int Y_AXIS = 0; + private static final int Z_AXIS = 1; + private static final int X_AXIS = 2; + public static final IBlockState AIR_DEFAULT_STATE = Blocks.air.getDefaultState(); + private static TextureAtlasSprite emptySprite = null; + private static final BlockDir[] SIDES_Y_NEG_DOWN = new BlockDir[] {BlockDir.WEST, BlockDir.EAST, BlockDir.NORTH, BlockDir.SOUTH}; + private static final BlockDir[] SIDES_Y_POS_UP = new BlockDir[] {BlockDir.WEST, BlockDir.EAST, BlockDir.SOUTH, BlockDir.NORTH}; + private static final BlockDir[] SIDES_Z_NEG_NORTH = new BlockDir[] {BlockDir.EAST, BlockDir.WEST, BlockDir.DOWN, BlockDir.UP}; + private static final BlockDir[] SIDES_Z_POS_SOUTH = new BlockDir[] {BlockDir.WEST, BlockDir.EAST, BlockDir.DOWN, BlockDir.UP}; + private static final BlockDir[] SIDES_X_NEG_WEST = new BlockDir[] {BlockDir.NORTH, BlockDir.SOUTH, BlockDir.DOWN, BlockDir.UP}; + private static final BlockDir[] SIDES_X_POS_EAST = new BlockDir[] {BlockDir.SOUTH, BlockDir.NORTH, BlockDir.DOWN, BlockDir.UP}; + private static final BlockDir[] SIDES_Z_NEG_NORTH_Z_AXIS = new BlockDir[] {BlockDir.WEST, BlockDir.EAST, BlockDir.UP, BlockDir.DOWN}; + private static final BlockDir[] SIDES_X_POS_EAST_X_AXIS = new BlockDir[] {BlockDir.NORTH, BlockDir.SOUTH, BlockDir.UP, BlockDir.DOWN}; + private static final BlockDir[] EDGES_Y_NEG_DOWN = new BlockDir[] {BlockDir.NORTH_EAST, BlockDir.NORTH_WEST, BlockDir.SOUTH_EAST, BlockDir.SOUTH_WEST}; + private static final BlockDir[] EDGES_Y_POS_UP = new BlockDir[] {BlockDir.SOUTH_EAST, BlockDir.SOUTH_WEST, BlockDir.NORTH_EAST, BlockDir.NORTH_WEST}; + private static final BlockDir[] EDGES_Z_NEG_NORTH = new BlockDir[] {BlockDir.DOWN_WEST, BlockDir.DOWN_EAST, BlockDir.UP_WEST, BlockDir.UP_EAST}; + private static final BlockDir[] EDGES_Z_POS_SOUTH = new BlockDir[] {BlockDir.DOWN_EAST, BlockDir.DOWN_WEST, BlockDir.UP_EAST, BlockDir.UP_WEST}; + private static final BlockDir[] EDGES_X_NEG_WEST = new BlockDir[] {BlockDir.DOWN_SOUTH, BlockDir.DOWN_NORTH, BlockDir.UP_SOUTH, BlockDir.UP_NORTH}; + private static final BlockDir[] EDGES_X_POS_EAST = new BlockDir[] {BlockDir.DOWN_NORTH, BlockDir.DOWN_SOUTH, BlockDir.UP_NORTH, BlockDir.UP_SOUTH}; + private static final BlockDir[] EDGES_Z_NEG_NORTH_Z_AXIS = new BlockDir[] {BlockDir.UP_EAST, BlockDir.UP_WEST, BlockDir.DOWN_EAST, BlockDir.DOWN_WEST}; + private static final BlockDir[] EDGES_X_POS_EAST_X_AXIS = new BlockDir[] {BlockDir.UP_SOUTH, BlockDir.UP_NORTH, BlockDir.DOWN_SOUTH, BlockDir.DOWN_NORTH}; + public static final TextureAtlasSprite SPRITE_DEFAULT = new TextureAtlasSprite(""); + + public static BakedQuad[] getConnectedTexture(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, BakedQuad quad, RenderEnv renderEnv) + { + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + if (textureatlassprite == null) + { + return renderEnv.getArrayQuadsCtm(quad); + } + else + { + Block block = blockState.getBlock(); + + if (skipConnectedTexture(blockAccess, blockState, blockPos, quad, renderEnv)) + { + quad = getQuad(emptySprite, quad); + return renderEnv.getArrayQuadsCtm(quad); + } + else + { + EnumFacing enumfacing = quad.getFace(); + BakedQuad[] abakedquad = getConnectedTextureMultiPass(blockAccess, blockState, blockPos, enumfacing, quad, renderEnv); + return abakedquad; + } + } + } + + private static boolean skipConnectedTexture(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, BakedQuad quad, RenderEnv renderEnv) + { + Block block = blockState.getBlock(); + + if (block instanceof BlockPane) + { + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + if (textureatlassprite.getIconName().startsWith("minecraft:blocks/glass_pane_top")) + { + IBlockState iblockstate1 = blockAccess.getBlockState(blockPos.offset(quad.getFace())); + return iblockstate1 == blockState; + } + } + + if (block instanceof BlockPane) + { + EnumFacing enumfacing = quad.getFace(); + + if (enumfacing != EnumFacing.UP && enumfacing != EnumFacing.DOWN) + { + return false; + } + + if (!quad.isFaceQuad()) + { + return false; + } + + BlockPos blockpos = blockPos.offset(quad.getFace()); + IBlockState iblockstate = blockAccess.getBlockState(blockpos); + + if (iblockstate.getBlock() != block) + { + return false; + } + + if (block == Blocks.stained_glass_pane && iblockstate.getValue(BlockStainedGlassPane.COLOR) != blockState.getValue(BlockStainedGlassPane.COLOR)) + { + return false; + } + + iblockstate = iblockstate.getBlock().getActualState(iblockstate, blockAccess, blockpos); + double d0 = (double)quad.getMidX(); + + if (d0 < 0.4D) + { + if (((Boolean)iblockstate.getValue(BlockPane.WEST)).booleanValue()) + { + return true; + } + } + else if (d0 > 0.6D) + { + if (((Boolean)iblockstate.getValue(BlockPane.EAST)).booleanValue()) + { + return true; + } + } + else + { + double d1 = quad.getMidZ(); + + if (d1 < 0.4D) + { + if (((Boolean)iblockstate.getValue(BlockPane.NORTH)).booleanValue()) + { + return true; + } + } + else + { + if (d1 <= 0.6D) + { + return true; + } + + if (((Boolean)iblockstate.getValue(BlockPane.SOUTH)).booleanValue()) + { + return true; + } + } + } + } + + return false; + } + + protected static BakedQuad[] getQuads(TextureAtlasSprite sprite, BakedQuad quadIn, RenderEnv renderEnv) + { + if (sprite == null) + { + return null; + } + else if (sprite == SPRITE_DEFAULT) + { + return renderEnv.getArrayQuadsCtm(quadIn); + } + else + { + BakedQuad bakedquad = getQuad(sprite, quadIn); + BakedQuad[] abakedquad = renderEnv.getArrayQuadsCtm(bakedquad); + return abakedquad; + } + } + + private static synchronized BakedQuad getQuad(TextureAtlasSprite sprite, BakedQuad quadIn) + { + if (spriteQuadMaps == null) + { + return quadIn; + } + else + { + int i = sprite.getIndexInMap(); + + if (i >= 0 && i < spriteQuadMaps.length) + { + Map map = spriteQuadMaps[i]; + + if (map == null) + { + map = new IdentityHashMap(1); + spriteQuadMaps[i] = map; + } + + BakedQuad bakedquad = (BakedQuad)map.get(quadIn); + + if (bakedquad == null) + { + bakedquad = makeSpriteQuad(quadIn, sprite); + map.put(quadIn, bakedquad); + } + + return bakedquad; + } + else + { + return quadIn; + } + } + } + + private static synchronized BakedQuad getQuadFull(TextureAtlasSprite sprite, BakedQuad quadIn, int tintIndex) + { + if (spriteQuadFullMaps == null) + { + return null; + } + else if (sprite == null) + { + return null; + } + else + { + int i = sprite.getIndexInMap(); + + if (i >= 0 && i < spriteQuadFullMaps.length) + { + Map map = spriteQuadFullMaps[i]; + + if (map == null) + { + map = new EnumMap(EnumFacing.class); + spriteQuadFullMaps[i] = map; + } + + EnumFacing enumfacing = quadIn.getFace(); + BakedQuad bakedquad = (BakedQuad)map.get(enumfacing); + + if (bakedquad == null) + { + bakedquad = BlockModelUtils.makeBakedQuad(enumfacing, sprite, tintIndex); + map.put(enumfacing, bakedquad); + } + + return bakedquad; + } + else + { + return null; + } + } + } + + private static BakedQuad makeSpriteQuad(BakedQuad quad, TextureAtlasSprite sprite) + { + int[] aint = (int[])quad.getVertexData().clone(); + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + for (int i = 0; i < 4; ++i) + { + fixVertex(aint, i, textureatlassprite, sprite); + } + + BakedQuad bakedquad = new BakedQuad(aint, quad.getTintIndex(), quad.getFace(), sprite); + return bakedquad; + } + + private static void fixVertex(int[] data, int vertex, TextureAtlasSprite spriteFrom, TextureAtlasSprite spriteTo) + { + int i = data.length / 4; + int j = i * vertex; + float f = Float.intBitsToFloat(data[j + 4]); + float f1 = Float.intBitsToFloat(data[j + 4 + 1]); + double d0 = spriteFrom.getSpriteU16(f); + double d1 = spriteFrom.getSpriteV16(f1); + data[j + 4] = Float.floatToRawIntBits(spriteTo.getInterpolatedU(d0)); + data[j + 4 + 1] = Float.floatToRawIntBits(spriteTo.getInterpolatedV(d1)); + } + + private static BakedQuad[] getConnectedTextureMultiPass(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, EnumFacing side, BakedQuad quad, RenderEnv renderEnv) + { + BakedQuad[] abakedquad = getConnectedTextureSingle(blockAccess, blockState, blockPos, side, quad, true, 0, renderEnv); + + if (!multipass) + { + return abakedquad; + } + else if (abakedquad.length == 1 && abakedquad[0] == quad) + { + return abakedquad; + } + else + { + List list = renderEnv.getListQuadsCtmMultipass(abakedquad); + + for (int i = 0; i < list.size(); ++i) + { + BakedQuad bakedquad = (BakedQuad)list.get(i); + BakedQuad bakedquad1 = bakedquad; + + for (int j = 0; j < 3; ++j) + { + BakedQuad[] abakedquad1 = getConnectedTextureSingle(blockAccess, blockState, blockPos, side, bakedquad1, false, j + 1, renderEnv); + + if (abakedquad1.length != 1 || abakedquad1[0] == bakedquad1) + { + break; + } + + bakedquad1 = abakedquad1[0]; + } + + list.set(i, bakedquad1); + } + + for (int k = 0; k < abakedquad.length; ++k) + { + abakedquad[k] = (BakedQuad)list.get(k); + } + + return abakedquad; + } + } + + public static BakedQuad[] getConnectedTextureSingle(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, EnumFacing facing, BakedQuad quad, boolean checkBlocks, int pass, RenderEnv renderEnv) + { + Block block = blockState.getBlock(); + + if (!(blockState instanceof BlockStateBase)) + { + return renderEnv.getArrayQuadsCtm(quad); + } + else + { + BlockStateBase blockstatebase = (BlockStateBase)blockState; + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + if (tileProperties != null) + { + int i = textureatlassprite.getIndexInMap(); + + if (i >= 0 && i < tileProperties.length) + { + ConnectedProperties[] aconnectedproperties = tileProperties[i]; + + if (aconnectedproperties != null) + { + int j = getSide(facing); + + for (int k = 0; k < aconnectedproperties.length; ++k) + { + ConnectedProperties connectedproperties = aconnectedproperties[k]; + + if (connectedproperties != null && connectedproperties.matchesBlockId(blockstatebase.getBlockId())) + { + BakedQuad[] abakedquad = getConnectedTexture(connectedproperties, blockAccess, blockstatebase, blockPos, j, quad, pass, renderEnv); + + if (abakedquad != null) + { + return abakedquad; + } + } + } + } + } + } + + if (blockProperties != null && checkBlocks) + { + int l = renderEnv.getBlockId(); + + if (l >= 0 && l < blockProperties.length) + { + ConnectedProperties[] aconnectedproperties1 = blockProperties[l]; + + if (aconnectedproperties1 != null) + { + int i1 = getSide(facing); + + for (int j1 = 0; j1 < aconnectedproperties1.length; ++j1) + { + ConnectedProperties connectedproperties1 = aconnectedproperties1[j1]; + + if (connectedproperties1 != null && connectedproperties1.matchesIcon(textureatlassprite)) + { + BakedQuad[] abakedquad1 = getConnectedTexture(connectedproperties1, blockAccess, blockstatebase, blockPos, i1, quad, pass, renderEnv); + + if (abakedquad1 != null) + { + return abakedquad1; + } + } + } + } + } + } + + return renderEnv.getArrayQuadsCtm(quad); + } + } + + public static int getSide(EnumFacing facing) + { + if (facing == null) + { + return -1; + } + else + { + switch (facing) + { + case DOWN: + return 0; + + case UP: + return 1; + + case EAST: + return 5; + + case WEST: + return 4; + + case NORTH: + return 2; + + case SOUTH: + return 3; + + default: + return -1; + } + } + } + + private static EnumFacing getFacing(int side) + { + switch (side) + { + case 0: + return EnumFacing.DOWN; + + case 1: + return EnumFacing.UP; + + case 2: + return EnumFacing.NORTH; + + case 3: + return EnumFacing.SOUTH; + + case 4: + return EnumFacing.WEST; + + case 5: + return EnumFacing.EAST; + + default: + return EnumFacing.UP; + } + } + + private static BakedQuad[] getConnectedTexture(ConnectedProperties cp, IBlockAccess blockAccess, BlockStateBase blockState, BlockPos blockPos, int side, BakedQuad quad, int pass, RenderEnv renderEnv) + { + int i = 0; + int j = blockState.getMetadata(); + int k = j; + Block block = blockState.getBlock(); + + if (block instanceof BlockRotatedPillar) + { + i = getWoodAxis(side, j); + + if (cp.getMetadataMax() <= 3) + { + k = j & 3; + } + } + + if (block instanceof BlockQuartz) + { + i = getQuartzAxis(side, j); + + if (cp.getMetadataMax() <= 2 && k > 2) + { + k = 2; + } + } + + if (!cp.matchesBlock(blockState.getBlockId(), k)) + { + return null; + } + else + { + if (side >= 0 && cp.faces != 63) + { + int l = side; + + if (i != 0) + { + l = fixSideByAxis(side, i); + } + + if ((1 << l & cp.faces) == 0) + { + return null; + } + } + + int i1 = blockPos.getY(); + + if (cp.heights != null && !cp.heights.isInRange(i1)) + { + return null; + } + else + { + if (cp.biomes != null) + { + BiomeGenBase biomegenbase = blockAccess.getBiomeGenForCoords(blockPos); + + if (!cp.matchesBiome(biomegenbase)) + { + return null; + } + } + + if (cp.nbtName != null) + { + String s = TileEntityUtils.getTileEntityName(blockAccess, blockPos); + + if (!cp.nbtName.matchesValue(s)) + { + return null; + } + } + + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + switch (cp.method) + { + case 1: + return getQuads(getConnectedTextureCtm(cp, blockAccess, blockState, blockPos, i, side, textureatlassprite, j, renderEnv), quad, renderEnv); + + case 2: + return getQuads(getConnectedTextureHorizontal(cp, blockAccess, blockState, blockPos, i, side, textureatlassprite, j), quad, renderEnv); + + case 3: + return getQuads(getConnectedTextureTop(cp, blockAccess, blockState, blockPos, i, side, textureatlassprite, j), quad, renderEnv); + + case 4: + return getQuads(getConnectedTextureRandom(cp, blockAccess, blockState, blockPos, side), quad, renderEnv); + + case 5: + return getQuads(getConnectedTextureRepeat(cp, blockPos, side), quad, renderEnv); + + case 6: + return getQuads(getConnectedTextureVertical(cp, blockAccess, blockState, blockPos, i, side, textureatlassprite, j), quad, renderEnv); + + case 7: + return getQuads(getConnectedTextureFixed(cp), quad, renderEnv); + + case 8: + return getQuads(getConnectedTextureHorizontalVertical(cp, blockAccess, blockState, blockPos, i, side, textureatlassprite, j), quad, renderEnv); + + case 9: + return getQuads(getConnectedTextureVerticalHorizontal(cp, blockAccess, blockState, blockPos, i, side, textureatlassprite, j), quad, renderEnv); + + case 10: + if (pass == 0) + { + return getConnectedTextureCtmCompact(cp, blockAccess, blockState, blockPos, i, side, quad, j, renderEnv); + } + + default: + return null; + + case 11: + return getConnectedTextureOverlay(cp, blockAccess, blockState, blockPos, i, side, quad, j, renderEnv); + + case 12: + return getConnectedTextureOverlayFixed(cp, quad, renderEnv); + + case 13: + return getConnectedTextureOverlayRandom(cp, blockAccess, blockState, blockPos, side, quad, renderEnv); + + case 14: + return getConnectedTextureOverlayRepeat(cp, blockPos, side, quad, renderEnv); + + case 15: + return getConnectedTextureOverlayCtm(cp, blockAccess, blockState, blockPos, i, side, quad, j, renderEnv); + } + } + } + } + + private static int fixSideByAxis(int side, int vertAxis) + { + switch (vertAxis) + { + case 0: + return side; + + case 1: + switch (side) + { + case 0: + return 2; + + case 1: + return 3; + + case 2: + return 1; + + case 3: + return 0; + + default: + return side; + } + + case 2: + switch (side) + { + case 0: + return 4; + + case 1: + return 5; + + case 2: + case 3: + default: + return side; + + case 4: + return 1; + + case 5: + return 0; + } + + default: + return side; + } + } + + private static int getWoodAxis(int side, int metadata) + { + int i = (metadata & 12) >> 2; + + switch (i) + { + case 1: + return 2; + + case 2: + return 1; + + default: + return 0; + } + } + + private static int getQuartzAxis(int side, int metadata) + { + switch (metadata) + { + case 3: + return 2; + + case 4: + return 1; + + default: + return 0; + } + } + + private static TextureAtlasSprite getConnectedTextureRandom(ConnectedProperties cp, IBlockAccess blockAccess, BlockStateBase blockState, BlockPos blockPos, int side) + { + if (cp.tileIcons.length == 1) + { + return cp.tileIcons[0]; + } + else + { + int i = side / cp.symmetry * cp.symmetry; + + if (cp.linked) + { + BlockPos blockpos = blockPos.down(); + + for (IBlockState iblockstate = blockAccess.getBlockState(blockpos); iblockstate.getBlock() == blockState.getBlock(); iblockstate = blockAccess.getBlockState(blockpos)) + { + blockPos = blockpos; + blockpos = blockpos.down(); + + if (blockpos.getY() < 0) + { + break; + } + } + } + + int l = Config.getRandom(blockPos, i) & Integer.MAX_VALUE; + + for (int i1 = 0; i1 < cp.randomLoops; ++i1) + { + l = Config.intHash(l); + } + + int j1 = 0; + + if (cp.weights == null) + { + j1 = l % cp.tileIcons.length; + } + else + { + int j = l % cp.sumAllWeights; + int[] aint = cp.sumWeights; + + for (int k = 0; k < aint.length; ++k) + { + if (j < aint[k]) + { + j1 = k; + break; + } + } + } + + return cp.tileIcons[j1]; + } + } + + private static TextureAtlasSprite getConnectedTextureFixed(ConnectedProperties cp) + { + return cp.tileIcons[0]; + } + + private static TextureAtlasSprite getConnectedTextureRepeat(ConnectedProperties cp, BlockPos blockPos, int side) + { + if (cp.tileIcons.length == 1) + { + return cp.tileIcons[0]; + } + else + { + int i = blockPos.getX(); + int j = blockPos.getY(); + int k = blockPos.getZ(); + int l = 0; + int i1 = 0; + + switch (side) + { + case 0: + l = i; + i1 = -k - 1; + break; + + case 1: + l = i; + i1 = k; + break; + + case 2: + l = -i - 1; + i1 = -j; + break; + + case 3: + l = i; + i1 = -j; + break; + + case 4: + l = k; + i1 = -j; + break; + + case 5: + l = -k - 1; + i1 = -j; + } + + l = l % cp.width; + i1 = i1 % cp.height; + + if (l < 0) + { + l += cp.width; + } + + if (i1 < 0) + { + i1 += cp.height; + } + + int j1 = i1 * cp.width + l; + return cp.tileIcons[j1]; + } + } + + private static TextureAtlasSprite getConnectedTextureCtm(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, TextureAtlasSprite icon, int metadata, RenderEnv renderEnv) + { + int i = getConnectedTextureCtmIndex(cp, blockAccess, blockState, blockPos, vertAxis, side, icon, metadata, renderEnv); + return cp.tileIcons[i]; + } + + private static synchronized BakedQuad[] getConnectedTextureCtmCompact(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, BakedQuad quad, int metadata, RenderEnv renderEnv) + { + TextureAtlasSprite textureatlassprite = quad.getSprite(); + int i = getConnectedTextureCtmIndex(cp, blockAccess, blockState, blockPos, vertAxis, side, textureatlassprite, metadata, renderEnv); + return ConnectedTexturesCompact.getConnectedTextureCtmCompact(i, cp, side, quad, renderEnv); + } + + private static BakedQuad[] getConnectedTextureOverlay(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, BakedQuad quad, int metadata, RenderEnv renderEnv) + { + if (!quad.isFullQuad()) + { + return null; + } + else + { + TextureAtlasSprite textureatlassprite = quad.getSprite(); + BlockDir[] ablockdir = getSideDirections(side, vertAxis); + boolean[] aboolean = renderEnv.getBorderFlags(); + + for (int i = 0; i < 4; ++i) + { + aboolean[i] = isNeighbourOverlay(cp, blockAccess, blockState, ablockdir[i].offset(blockPos), side, textureatlassprite, metadata); + } + + ListQuadsOverlay listquadsoverlay = renderEnv.getListQuadsOverlay(cp.layer); + Object dirEdges; + + try + { + if (!aboolean[0] || !aboolean[1] || !aboolean[2] || !aboolean[3]) + { + if (aboolean[0] && aboolean[1] && aboolean[2]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[5], quad, cp.tintIndex), cp.tintBlockState); + dirEdges = null; + return (BakedQuad[])dirEdges; + } + + if (aboolean[0] && aboolean[2] && aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[6], quad, cp.tintIndex), cp.tintBlockState); + dirEdges = null; + return (BakedQuad[])dirEdges; + } + + if (aboolean[1] && aboolean[2] && aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[12], quad, cp.tintIndex), cp.tintBlockState); + dirEdges = null; + return (BakedQuad[])dirEdges; + } + + if (aboolean[0] && aboolean[1] && aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[13], quad, cp.tintIndex), cp.tintBlockState); + dirEdges = null; + return (BakedQuad[])dirEdges; + } + + BlockDir[] ablockdir1 = getEdgeDirections(side, vertAxis); + boolean[] aboolean1 = renderEnv.getBorderFlags2(); + + for (int j = 0; j < 4; ++j) + { + aboolean1[j] = isNeighbourOverlay(cp, blockAccess, blockState, ablockdir1[j].offset(blockPos), side, textureatlassprite, metadata); + } + + if (aboolean[1] && aboolean[2]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[3], quad, cp.tintIndex), cp.tintBlockState); + + if (aboolean1[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[16], quad, cp.tintIndex), cp.tintBlockState); + } + + Object object4 = null; + return (BakedQuad[])object4; + } + + if (aboolean[0] && aboolean[2]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[4], quad, cp.tintIndex), cp.tintBlockState); + + if (aboolean1[2]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[14], quad, cp.tintIndex), cp.tintBlockState); + } + + Object object3 = null; + return (BakedQuad[])object3; + } + + if (aboolean[1] && aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[10], quad, cp.tintIndex), cp.tintBlockState); + + if (aboolean1[1]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[2], quad, cp.tintIndex), cp.tintBlockState); + } + + Object object2 = null; + return (BakedQuad[])object2; + } + + if (aboolean[0] && aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[11], quad, cp.tintIndex), cp.tintBlockState); + + if (aboolean1[0]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[0], quad, cp.tintIndex), cp.tintBlockState); + } + + Object object1 = null; + return (BakedQuad[])object1; + } + + boolean[] aboolean2 = renderEnv.getBorderFlags3(); + + for (int k = 0; k < 4; ++k) + { + aboolean2[k] = isNeighbourMatching(cp, blockAccess, blockState, ablockdir[k].offset(blockPos), side, textureatlassprite, metadata); + } + + if (aboolean[0]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[9], quad, cp.tintIndex), cp.tintBlockState); + } + + if (aboolean[1]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[7], quad, cp.tintIndex), cp.tintBlockState); + } + + if (aboolean[2]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[1], quad, cp.tintIndex), cp.tintBlockState); + } + + if (aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[15], quad, cp.tintIndex), cp.tintBlockState); + } + + if (aboolean1[0] && (aboolean2[1] || aboolean2[2]) && !aboolean[1] && !aboolean[2]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[0], quad, cp.tintIndex), cp.tintBlockState); + } + + if (aboolean1[1] && (aboolean2[0] || aboolean2[2]) && !aboolean[0] && !aboolean[2]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[2], quad, cp.tintIndex), cp.tintBlockState); + } + + if (aboolean1[2] && (aboolean2[1] || aboolean2[3]) && !aboolean[1] && !aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[14], quad, cp.tintIndex), cp.tintBlockState); + } + + if (aboolean1[3] && (aboolean2[0] || aboolean2[3]) && !aboolean[0] && !aboolean[3]) + { + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[16], quad, cp.tintIndex), cp.tintBlockState); + } + + Object object5 = null; + return (BakedQuad[])object5; + } + + listquadsoverlay.addQuad(getQuadFull(cp.tileIcons[8], quad, cp.tintIndex), cp.tintBlockState); + dirEdges = null; + } + finally + { + if (listquadsoverlay.size() > 0) + { + renderEnv.setOverlaysRendered(true); + } + } + + return (BakedQuad[])dirEdges; + } + } + + private static BakedQuad[] getConnectedTextureOverlayFixed(ConnectedProperties cp, BakedQuad quad, RenderEnv renderEnv) + { + if (!quad.isFullQuad()) + { + return null; + } + else + { + ListQuadsOverlay listquadsoverlay = renderEnv.getListQuadsOverlay(cp.layer); + Object object; + + try + { + TextureAtlasSprite textureatlassprite = getConnectedTextureFixed(cp); + + if (textureatlassprite != null) + { + listquadsoverlay.addQuad(getQuadFull(textureatlassprite, quad, cp.tintIndex), cp.tintBlockState); + } + + object = null; + } + finally + { + if (listquadsoverlay.size() > 0) + { + renderEnv.setOverlaysRendered(true); + } + } + + return (BakedQuad[])object; + } + } + + private static BakedQuad[] getConnectedTextureOverlayRandom(ConnectedProperties cp, IBlockAccess blockAccess, BlockStateBase blockState, BlockPos blockPos, int side, BakedQuad quad, RenderEnv renderEnv) + { + if (!quad.isFullQuad()) + { + return null; + } + else + { + ListQuadsOverlay listquadsoverlay = renderEnv.getListQuadsOverlay(cp.layer); + Object object; + + try + { + TextureAtlasSprite textureatlassprite = getConnectedTextureRandom(cp, blockAccess, blockState, blockPos, side); + + if (textureatlassprite != null) + { + listquadsoverlay.addQuad(getQuadFull(textureatlassprite, quad, cp.tintIndex), cp.tintBlockState); + } + + object = null; + } + finally + { + if (listquadsoverlay.size() > 0) + { + renderEnv.setOverlaysRendered(true); + } + } + + return (BakedQuad[])object; + } + } + + private static BakedQuad[] getConnectedTextureOverlayRepeat(ConnectedProperties cp, BlockPos blockPos, int side, BakedQuad quad, RenderEnv renderEnv) + { + if (!quad.isFullQuad()) + { + return null; + } + else + { + ListQuadsOverlay listquadsoverlay = renderEnv.getListQuadsOverlay(cp.layer); + Object object; + + try + { + TextureAtlasSprite textureatlassprite = getConnectedTextureRepeat(cp, blockPos, side); + + if (textureatlassprite != null) + { + listquadsoverlay.addQuad(getQuadFull(textureatlassprite, quad, cp.tintIndex), cp.tintBlockState); + } + + object = null; + } + finally + { + if (listquadsoverlay.size() > 0) + { + renderEnv.setOverlaysRendered(true); + } + } + + return (BakedQuad[])object; + } + } + + private static BakedQuad[] getConnectedTextureOverlayCtm(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, BakedQuad quad, int metadata, RenderEnv renderEnv) + { + if (!quad.isFullQuad()) + { + return null; + } + else + { + ListQuadsOverlay listquadsoverlay = renderEnv.getListQuadsOverlay(cp.layer); + Object object; + + try + { + TextureAtlasSprite textureatlassprite = getConnectedTextureCtm(cp, blockAccess, blockState, blockPos, vertAxis, side, quad.getSprite(), metadata, renderEnv); + + if (textureatlassprite != null) + { + listquadsoverlay.addQuad(getQuadFull(textureatlassprite, quad, cp.tintIndex), cp.tintBlockState); + } + + object = null; + } + finally + { + if (listquadsoverlay.size() > 0) + { + renderEnv.setOverlaysRendered(true); + } + } + + return (BakedQuad[])object; + } + } + + private static BlockDir[] getSideDirections(int side, int vertAxis) + { + switch (side) + { + case 0: + return SIDES_Y_NEG_DOWN; + + case 1: + return SIDES_Y_POS_UP; + + case 2: + if (vertAxis == 1) + { + return SIDES_Z_NEG_NORTH_Z_AXIS; + } + + return SIDES_Z_NEG_NORTH; + + case 3: + return SIDES_Z_POS_SOUTH; + + case 4: + return SIDES_X_NEG_WEST; + + case 5: + if (vertAxis == 2) + { + return SIDES_X_POS_EAST_X_AXIS; + } + + return SIDES_X_POS_EAST; + + default: + throw new IllegalArgumentException("Unknown side: " + side); + } + } + + private static BlockDir[] getEdgeDirections(int side, int vertAxis) + { + switch (side) + { + case 0: + return EDGES_Y_NEG_DOWN; + + case 1: + return EDGES_Y_POS_UP; + + case 2: + if (vertAxis == 1) + { + return EDGES_Z_NEG_NORTH_Z_AXIS; + } + + return EDGES_Z_NEG_NORTH; + + case 3: + return EDGES_Z_POS_SOUTH; + + case 4: + return EDGES_X_NEG_WEST; + + case 5: + if (vertAxis == 2) + { + return EDGES_X_POS_EAST_X_AXIS; + } + + return EDGES_X_POS_EAST; + + default: + throw new IllegalArgumentException("Unknown side: " + side); + } + } + + protected static Map[][] getSpriteQuadCompactMaps() + { + return spriteQuadCompactMaps; + } + + private static int getConnectedTextureCtmIndex(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, TextureAtlasSprite icon, int metadata, RenderEnv renderEnv) + { + boolean[] aboolean = renderEnv.getBorderFlags(); + + switch (side) + { + case 0: + aboolean[0] = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + aboolean[1] = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + aboolean[2] = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + aboolean[3] = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos6 = blockPos.down(); + aboolean[0] = aboolean[0] && !isNeighbour(cp, blockAccess, blockState, blockpos6.west(), side, icon, metadata); + aboolean[1] = aboolean[1] && !isNeighbour(cp, blockAccess, blockState, blockpos6.east(), side, icon, metadata); + aboolean[2] = aboolean[2] && !isNeighbour(cp, blockAccess, blockState, blockpos6.north(), side, icon, metadata); + aboolean[3] = aboolean[3] && !isNeighbour(cp, blockAccess, blockState, blockpos6.south(), side, icon, metadata); + } + + break; + + case 1: + aboolean[0] = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + aboolean[1] = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + aboolean[2] = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + aboolean[3] = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos5 = blockPos.up(); + aboolean[0] = aboolean[0] && !isNeighbour(cp, blockAccess, blockState, blockpos5.west(), side, icon, metadata); + aboolean[1] = aboolean[1] && !isNeighbour(cp, blockAccess, blockState, blockpos5.east(), side, icon, metadata); + aboolean[2] = aboolean[2] && !isNeighbour(cp, blockAccess, blockState, blockpos5.south(), side, icon, metadata); + aboolean[3] = aboolean[3] && !isNeighbour(cp, blockAccess, blockState, blockpos5.north(), side, icon, metadata); + } + + break; + + case 2: + aboolean[0] = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + aboolean[1] = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + aboolean[2] = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + aboolean[3] = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos4 = blockPos.north(); + aboolean[0] = aboolean[0] && !isNeighbour(cp, blockAccess, blockState, blockpos4.east(), side, icon, metadata); + aboolean[1] = aboolean[1] && !isNeighbour(cp, blockAccess, blockState, blockpos4.west(), side, icon, metadata); + aboolean[2] = aboolean[2] && !isNeighbour(cp, blockAccess, blockState, blockpos4.down(), side, icon, metadata); + aboolean[3] = aboolean[3] && !isNeighbour(cp, blockAccess, blockState, blockpos4.up(), side, icon, metadata); + } + + if (vertAxis == 1) + { + switchValues(0, 1, aboolean); + switchValues(2, 3, aboolean); + } + + break; + + case 3: + aboolean[0] = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + aboolean[1] = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + aboolean[2] = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + aboolean[3] = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos3 = blockPos.south(); + aboolean[0] = aboolean[0] && !isNeighbour(cp, blockAccess, blockState, blockpos3.west(), side, icon, metadata); + aboolean[1] = aboolean[1] && !isNeighbour(cp, blockAccess, blockState, blockpos3.east(), side, icon, metadata); + aboolean[2] = aboolean[2] && !isNeighbour(cp, blockAccess, blockState, blockpos3.down(), side, icon, metadata); + aboolean[3] = aboolean[3] && !isNeighbour(cp, blockAccess, blockState, blockpos3.up(), side, icon, metadata); + } + + break; + + case 4: + aboolean[0] = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + aboolean[1] = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + aboolean[2] = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + aboolean[3] = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos2 = blockPos.west(); + aboolean[0] = aboolean[0] && !isNeighbour(cp, blockAccess, blockState, blockpos2.north(), side, icon, metadata); + aboolean[1] = aboolean[1] && !isNeighbour(cp, blockAccess, blockState, blockpos2.south(), side, icon, metadata); + aboolean[2] = aboolean[2] && !isNeighbour(cp, blockAccess, blockState, blockpos2.down(), side, icon, metadata); + aboolean[3] = aboolean[3] && !isNeighbour(cp, blockAccess, blockState, blockpos2.up(), side, icon, metadata); + } + + break; + + case 5: + aboolean[0] = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + aboolean[1] = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + aboolean[2] = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + aboolean[3] = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos = blockPos.east(); + aboolean[0] = aboolean[0] && !isNeighbour(cp, blockAccess, blockState, blockpos.south(), side, icon, metadata); + aboolean[1] = aboolean[1] && !isNeighbour(cp, blockAccess, blockState, blockpos.north(), side, icon, metadata); + aboolean[2] = aboolean[2] && !isNeighbour(cp, blockAccess, blockState, blockpos.down(), side, icon, metadata); + aboolean[3] = aboolean[3] && !isNeighbour(cp, blockAccess, blockState, blockpos.up(), side, icon, metadata); + } + + if (vertAxis == 2) + { + switchValues(0, 1, aboolean); + switchValues(2, 3, aboolean); + } + } + + int i = 0; + + if (aboolean[0] & !aboolean[1] & !aboolean[2] & !aboolean[3]) + { + i = 3; + } + else if (!aboolean[0] & aboolean[1] & !aboolean[2] & !aboolean[3]) + { + i = 1; + } + else if (!aboolean[0] & !aboolean[1] & aboolean[2] & !aboolean[3]) + { + i = 12; + } + else if (!aboolean[0] & !aboolean[1] & !aboolean[2] & aboolean[3]) + { + i = 36; + } + else if (aboolean[0] & aboolean[1] & !aboolean[2] & !aboolean[3]) + { + i = 2; + } + else if (!aboolean[0] & !aboolean[1] & aboolean[2] & aboolean[3]) + { + i = 24; + } + else if (aboolean[0] & !aboolean[1] & aboolean[2] & !aboolean[3]) + { + i = 15; + } + else if (aboolean[0] & !aboolean[1] & !aboolean[2] & aboolean[3]) + { + i = 39; + } + else if (!aboolean[0] & aboolean[1] & aboolean[2] & !aboolean[3]) + { + i = 13; + } + else if (!aboolean[0] & aboolean[1] & !aboolean[2] & aboolean[3]) + { + i = 37; + } + else if (!aboolean[0] & aboolean[1] & aboolean[2] & aboolean[3]) + { + i = 25; + } + else if (aboolean[0] & !aboolean[1] & aboolean[2] & aboolean[3]) + { + i = 27; + } + else if (aboolean[0] & aboolean[1] & !aboolean[2] & aboolean[3]) + { + i = 38; + } + else if (aboolean[0] & aboolean[1] & aboolean[2] & !aboolean[3]) + { + i = 14; + } + else if (aboolean[0] & aboolean[1] & aboolean[2] & aboolean[3]) + { + i = 26; + } + + if (i == 0) + { + return i; + } + else if (!Config.isConnectedTexturesFancy()) + { + return i; + } + else + { + switch (side) + { + case 0: + aboolean[0] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().north(), side, icon, metadata); + aboolean[1] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().north(), side, icon, metadata); + aboolean[2] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().south(), side, icon, metadata); + aboolean[3] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().south(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos11 = blockPos.down(); + aboolean[0] = aboolean[0] || isNeighbour(cp, blockAccess, blockState, blockpos11.east().north(), side, icon, metadata); + aboolean[1] = aboolean[1] || isNeighbour(cp, blockAccess, blockState, blockpos11.west().north(), side, icon, metadata); + aboolean[2] = aboolean[2] || isNeighbour(cp, blockAccess, blockState, blockpos11.east().south(), side, icon, metadata); + aboolean[3] = aboolean[3] || isNeighbour(cp, blockAccess, blockState, blockpos11.west().south(), side, icon, metadata); + } + + break; + + case 1: + aboolean[0] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().south(), side, icon, metadata); + aboolean[1] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().south(), side, icon, metadata); + aboolean[2] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().north(), side, icon, metadata); + aboolean[3] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().north(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos10 = blockPos.up(); + aboolean[0] = aboolean[0] || isNeighbour(cp, blockAccess, blockState, blockpos10.east().south(), side, icon, metadata); + aboolean[1] = aboolean[1] || isNeighbour(cp, blockAccess, blockState, blockpos10.west().south(), side, icon, metadata); + aboolean[2] = aboolean[2] || isNeighbour(cp, blockAccess, blockState, blockpos10.east().north(), side, icon, metadata); + aboolean[3] = aboolean[3] || isNeighbour(cp, blockAccess, blockState, blockpos10.west().north(), side, icon, metadata); + } + + break; + + case 2: + aboolean[0] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().down(), side, icon, metadata); + aboolean[1] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().down(), side, icon, metadata); + aboolean[2] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().up(), side, icon, metadata); + aboolean[3] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().up(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos9 = blockPos.north(); + aboolean[0] = aboolean[0] || isNeighbour(cp, blockAccess, blockState, blockpos9.west().down(), side, icon, metadata); + aboolean[1] = aboolean[1] || isNeighbour(cp, blockAccess, blockState, blockpos9.east().down(), side, icon, metadata); + aboolean[2] = aboolean[2] || isNeighbour(cp, blockAccess, blockState, blockpos9.west().up(), side, icon, metadata); + aboolean[3] = aboolean[3] || isNeighbour(cp, blockAccess, blockState, blockpos9.east().up(), side, icon, metadata); + } + + if (vertAxis == 1) + { + switchValues(0, 3, aboolean); + switchValues(1, 2, aboolean); + } + + break; + + case 3: + aboolean[0] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().down(), side, icon, metadata); + aboolean[1] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().down(), side, icon, metadata); + aboolean[2] = !isNeighbour(cp, blockAccess, blockState, blockPos.east().up(), side, icon, metadata); + aboolean[3] = !isNeighbour(cp, blockAccess, blockState, blockPos.west().up(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos8 = blockPos.south(); + aboolean[0] = aboolean[0] || isNeighbour(cp, blockAccess, blockState, blockpos8.east().down(), side, icon, metadata); + aboolean[1] = aboolean[1] || isNeighbour(cp, blockAccess, blockState, blockpos8.west().down(), side, icon, metadata); + aboolean[2] = aboolean[2] || isNeighbour(cp, blockAccess, blockState, blockpos8.east().up(), side, icon, metadata); + aboolean[3] = aboolean[3] || isNeighbour(cp, blockAccess, blockState, blockpos8.west().up(), side, icon, metadata); + } + + break; + + case 4: + aboolean[0] = !isNeighbour(cp, blockAccess, blockState, blockPos.down().south(), side, icon, metadata); + aboolean[1] = !isNeighbour(cp, blockAccess, blockState, blockPos.down().north(), side, icon, metadata); + aboolean[2] = !isNeighbour(cp, blockAccess, blockState, blockPos.up().south(), side, icon, metadata); + aboolean[3] = !isNeighbour(cp, blockAccess, blockState, blockPos.up().north(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos7 = blockPos.west(); + aboolean[0] = aboolean[0] || isNeighbour(cp, blockAccess, blockState, blockpos7.down().south(), side, icon, metadata); + aboolean[1] = aboolean[1] || isNeighbour(cp, blockAccess, blockState, blockpos7.down().north(), side, icon, metadata); + aboolean[2] = aboolean[2] || isNeighbour(cp, blockAccess, blockState, blockpos7.up().south(), side, icon, metadata); + aboolean[3] = aboolean[3] || isNeighbour(cp, blockAccess, blockState, blockpos7.up().north(), side, icon, metadata); + } + + break; + + case 5: + aboolean[0] = !isNeighbour(cp, blockAccess, blockState, blockPos.down().north(), side, icon, metadata); + aboolean[1] = !isNeighbour(cp, blockAccess, blockState, blockPos.down().south(), side, icon, metadata); + aboolean[2] = !isNeighbour(cp, blockAccess, blockState, blockPos.up().north(), side, icon, metadata); + aboolean[3] = !isNeighbour(cp, blockAccess, blockState, blockPos.up().south(), side, icon, metadata); + + if (cp.innerSeams) + { + BlockPos blockpos1 = blockPos.east(); + aboolean[0] = aboolean[0] || isNeighbour(cp, blockAccess, blockState, blockpos1.down().north(), side, icon, metadata); + aboolean[1] = aboolean[1] || isNeighbour(cp, blockAccess, blockState, blockpos1.down().south(), side, icon, metadata); + aboolean[2] = aboolean[2] || isNeighbour(cp, blockAccess, blockState, blockpos1.up().north(), side, icon, metadata); + aboolean[3] = aboolean[3] || isNeighbour(cp, blockAccess, blockState, blockpos1.up().south(), side, icon, metadata); + } + + if (vertAxis == 2) + { + switchValues(0, 3, aboolean); + switchValues(1, 2, aboolean); + } + } + + if (i == 13 && aboolean[0]) + { + i = 4; + } + else if (i == 15 && aboolean[1]) + { + i = 5; + } + else if (i == 37 && aboolean[2]) + { + i = 16; + } + else if (i == 39 && aboolean[3]) + { + i = 17; + } + else if (i == 14 && aboolean[0] && aboolean[1]) + { + i = 7; + } + else if (i == 25 && aboolean[0] && aboolean[2]) + { + i = 6; + } + else if (i == 27 && aboolean[3] && aboolean[1]) + { + i = 19; + } + else if (i == 38 && aboolean[3] && aboolean[2]) + { + i = 18; + } + else if (i == 14 && !aboolean[0] && aboolean[1]) + { + i = 31; + } + else if (i == 25 && aboolean[0] && !aboolean[2]) + { + i = 30; + } + else if (i == 27 && !aboolean[3] && aboolean[1]) + { + i = 41; + } + else if (i == 38 && aboolean[3] && !aboolean[2]) + { + i = 40; + } + else if (i == 14 && aboolean[0] && !aboolean[1]) + { + i = 29; + } + else if (i == 25 && !aboolean[0] && aboolean[2]) + { + i = 28; + } + else if (i == 27 && aboolean[3] && !aboolean[1]) + { + i = 43; + } + else if (i == 38 && !aboolean[3] && aboolean[2]) + { + i = 42; + } + else if (i == 26 && aboolean[0] && aboolean[1] && aboolean[2] && aboolean[3]) + { + i = 46; + } + else if (i == 26 && !aboolean[0] && aboolean[1] && aboolean[2] && aboolean[3]) + { + i = 9; + } + else if (i == 26 && aboolean[0] && !aboolean[1] && aboolean[2] && aboolean[3]) + { + i = 21; + } + else if (i == 26 && aboolean[0] && aboolean[1] && !aboolean[2] && aboolean[3]) + { + i = 8; + } + else if (i == 26 && aboolean[0] && aboolean[1] && aboolean[2] && !aboolean[3]) + { + i = 20; + } + else if (i == 26 && aboolean[0] && aboolean[1] && !aboolean[2] && !aboolean[3]) + { + i = 11; + } + else if (i == 26 && !aboolean[0] && !aboolean[1] && aboolean[2] && aboolean[3]) + { + i = 22; + } + else if (i == 26 && !aboolean[0] && aboolean[1] && !aboolean[2] && aboolean[3]) + { + i = 23; + } + else if (i == 26 && aboolean[0] && !aboolean[1] && aboolean[2] && !aboolean[3]) + { + i = 10; + } + else if (i == 26 && aboolean[0] && !aboolean[1] && !aboolean[2] && aboolean[3]) + { + i = 34; + } + else if (i == 26 && !aboolean[0] && aboolean[1] && aboolean[2] && !aboolean[3]) + { + i = 35; + } + else if (i == 26 && aboolean[0] && !aboolean[1] && !aboolean[2] && !aboolean[3]) + { + i = 32; + } + else if (i == 26 && !aboolean[0] && aboolean[1] && !aboolean[2] && !aboolean[3]) + { + i = 33; + } + else if (i == 26 && !aboolean[0] && !aboolean[1] && aboolean[2] && !aboolean[3]) + { + i = 44; + } + else if (i == 26 && !aboolean[0] && !aboolean[1] && !aboolean[2] && aboolean[3]) + { + i = 45; + } + + return i; + } + } + + private static void switchValues(int ix1, int ix2, boolean[] arr) + { + boolean flag = arr[ix1]; + arr[ix1] = arr[ix2]; + arr[ix2] = flag; + } + + private static boolean isNeighbourOverlay(ConnectedProperties cp, IBlockAccess iblockaccess, IBlockState blockState, BlockPos blockPos, int side, TextureAtlasSprite icon, int metadata) + { + IBlockState iblockstate = iblockaccess.getBlockState(blockPos); + + if (!isFullCubeModel(iblockstate)) + { + return false; + } + else + { + if (cp.connectBlocks != null) + { + BlockStateBase blockstatebase = (BlockStateBase)iblockstate; + + if (!Matches.block(blockstatebase.getBlockId(), blockstatebase.getMetadata(), cp.connectBlocks)) + { + return false; + } + } + + if (cp.connectTileIcons != null) + { + TextureAtlasSprite textureatlassprite = getNeighbourIcon(iblockaccess, blockState, blockPos, iblockstate, side); + + if (!Config.isSameOne(textureatlassprite, cp.connectTileIcons)) + { + return false; + } + } + + IBlockState iblockstate1 = iblockaccess.getBlockState(blockPos.offset(getFacing(side))); + return iblockstate1.getBlock().isOpaqueCube() ? false : (side == 1 && iblockstate1.getBlock() == Blocks.snow_layer ? false : !isNeighbour(cp, iblockaccess, blockState, blockPos, iblockstate, side, icon, metadata)); + } + } + + private static boolean isFullCubeModel(IBlockState state) + { + if (state.getBlock().isFullCube()) + { + return true; + } + else + { + Block block = state.getBlock(); + return block instanceof BlockGlass ? true : block instanceof BlockStainedGlass; + } + } + + private static boolean isNeighbourMatching(ConnectedProperties cp, IBlockAccess iblockaccess, IBlockState blockState, BlockPos blockPos, int side, TextureAtlasSprite icon, int metadata) + { + IBlockState iblockstate = iblockaccess.getBlockState(blockPos); + + if (iblockstate == AIR_DEFAULT_STATE) + { + return false; + } + else + { + if (cp.matchBlocks != null && iblockstate instanceof BlockStateBase) + { + BlockStateBase blockstatebase = (BlockStateBase)iblockstate; + + if (!cp.matchesBlock(blockstatebase.getBlockId(), blockstatebase.getMetadata())) + { + return false; + } + } + + if (cp.matchTileIcons != null) + { + TextureAtlasSprite textureatlassprite = getNeighbourIcon(iblockaccess, blockState, blockPos, iblockstate, side); + + if (textureatlassprite != icon) + { + return false; + } + } + + IBlockState iblockstate1 = iblockaccess.getBlockState(blockPos.offset(getFacing(side))); + return iblockstate1.getBlock().isOpaqueCube() ? false : side != 1 || iblockstate1.getBlock() != Blocks.snow_layer; + } + } + + private static boolean isNeighbour(ConnectedProperties cp, IBlockAccess iblockaccess, IBlockState blockState, BlockPos blockPos, int side, TextureAtlasSprite icon, int metadata) + { + IBlockState iblockstate = iblockaccess.getBlockState(blockPos); + return isNeighbour(cp, iblockaccess, blockState, blockPos, iblockstate, side, icon, metadata); + } + + private static boolean isNeighbour(ConnectedProperties cp, IBlockAccess iblockaccess, IBlockState blockState, BlockPos blockPos, IBlockState neighbourState, int side, TextureAtlasSprite icon, int metadata) + { + if (blockState == neighbourState) + { + return true; + } + else if (cp.connect == 2) + { + if (neighbourState == null) + { + return false; + } + else if (neighbourState == AIR_DEFAULT_STATE) + { + return false; + } + else + { + TextureAtlasSprite textureatlassprite = getNeighbourIcon(iblockaccess, blockState, blockPos, neighbourState, side); + return textureatlassprite == icon; + } + } + else if (cp.connect == 3) + { + return neighbourState == null ? false : (neighbourState == AIR_DEFAULT_STATE ? false : neighbourState.getBlock().getMaterial() == blockState.getBlock().getMaterial()); + } + else if (!(neighbourState instanceof BlockStateBase)) + { + return false; + } + else + { + BlockStateBase blockstatebase = (BlockStateBase)neighbourState; + Block block = blockstatebase.getBlock(); + int i = blockstatebase.getMetadata(); + return block == blockState.getBlock() && i == metadata; + } + } + + private static TextureAtlasSprite getNeighbourIcon(IBlockAccess iblockaccess, IBlockState blockState, BlockPos blockPos, IBlockState neighbourState, int side) + { + neighbourState = neighbourState.getBlock().getActualState(neighbourState, iblockaccess, blockPos); + IBakedModel ibakedmodel = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(neighbourState); + + if (ibakedmodel == null) + { + return null; + } + else + { + if (Reflector.ForgeBlock_getExtendedState.exists()) + { + neighbourState = (IBlockState)Reflector.call(neighbourState.getBlock(), Reflector.ForgeBlock_getExtendedState, new Object[] {neighbourState, iblockaccess, blockPos}); + } + + EnumFacing enumfacing = getFacing(side); + List list = ibakedmodel.getFaceQuads(enumfacing); + + if (list == null) + { + return null; + } + else + { + if (Config.isBetterGrass()) + { + list = BetterGrass.getFaceQuads(iblockaccess, neighbourState, blockPos, enumfacing, list); + } + + if (list.size() > 0) + { + BakedQuad bakedquad1 = (BakedQuad)list.get(0); + return bakedquad1.getSprite(); + } + else + { + List list1 = ibakedmodel.getGeneralQuads(); + + if (list1 == null) + { + return null; + } + else + { + for (int i = 0; i < list1.size(); ++i) + { + BakedQuad bakedquad = (BakedQuad)list1.get(i); + + if (bakedquad.getFace() == enumfacing) + { + return bakedquad.getSprite(); + } + } + + return null; + } + } + } + } + } + + private static TextureAtlasSprite getConnectedTextureHorizontal(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, TextureAtlasSprite icon, int metadata) + { + boolean flag; + boolean flag1; + flag = false; + flag1 = false; + label0: + + switch (vertAxis) + { + case 0: + switch (side) + { + case 0: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + break label0; + + case 1: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + break label0; + + case 2: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + break label0; + + case 3: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + break label0; + + case 4: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + break label0; + + case 5: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + + default: + break label0; + } + + case 1: + switch (side) + { + case 0: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + break label0; + + case 1: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + break label0; + + case 2: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + break label0; + + case 3: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + break label0; + + case 4: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + break label0; + + case 5: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + + default: + break label0; + } + + case 2: + switch (side) + { + case 0: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + break; + + case 1: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + break; + + case 2: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + break; + + case 3: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + break; + + case 4: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + break; + + case 5: + flag = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + } + } + + int i = 3; + + if (flag) + { + if (flag1) + { + i = 1; + } + else + { + i = 2; + } + } + else if (flag1) + { + i = 0; + } + else + { + i = 3; + } + + return cp.tileIcons[i]; + } + + private static TextureAtlasSprite getConnectedTextureVertical(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, TextureAtlasSprite icon, int metadata) + { + boolean flag = false; + boolean flag1 = false; + + switch (vertAxis) + { + case 0: + if (side == 1) + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + } + else if (side == 0) + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + } + else + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + } + + break; + + case 1: + if (side == 3) + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + } + else if (side == 2) + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + } + else + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.north(), side, icon, metadata); + } + + break; + + case 2: + if (side == 5) + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + } + else if (side == 4) + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.down(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + } + else + { + flag = isNeighbour(cp, blockAccess, blockState, blockPos.west(), side, icon, metadata); + flag1 = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + } + } + + int i = 3; + + if (flag) + { + if (flag1) + { + i = 1; + } + else + { + i = 2; + } + } + else if (flag1) + { + i = 0; + } + else + { + i = 3; + } + + return cp.tileIcons[i]; + } + + private static TextureAtlasSprite getConnectedTextureHorizontalVertical(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, TextureAtlasSprite icon, int metadata) + { + TextureAtlasSprite[] atextureatlassprite = cp.tileIcons; + TextureAtlasSprite textureatlassprite = getConnectedTextureHorizontal(cp, blockAccess, blockState, blockPos, vertAxis, side, icon, metadata); + + if (textureatlassprite != null && textureatlassprite != icon && textureatlassprite != atextureatlassprite[3]) + { + return textureatlassprite; + } + else + { + TextureAtlasSprite textureatlassprite1 = getConnectedTextureVertical(cp, blockAccess, blockState, blockPos, vertAxis, side, icon, metadata); + return textureatlassprite1 == atextureatlassprite[0] ? atextureatlassprite[4] : (textureatlassprite1 == atextureatlassprite[1] ? atextureatlassprite[5] : (textureatlassprite1 == atextureatlassprite[2] ? atextureatlassprite[6] : textureatlassprite1)); + } + } + + private static TextureAtlasSprite getConnectedTextureVerticalHorizontal(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, TextureAtlasSprite icon, int metadata) + { + TextureAtlasSprite[] atextureatlassprite = cp.tileIcons; + TextureAtlasSprite textureatlassprite = getConnectedTextureVertical(cp, blockAccess, blockState, blockPos, vertAxis, side, icon, metadata); + + if (textureatlassprite != null && textureatlassprite != icon && textureatlassprite != atextureatlassprite[3]) + { + return textureatlassprite; + } + else + { + TextureAtlasSprite textureatlassprite1 = getConnectedTextureHorizontal(cp, blockAccess, blockState, blockPos, vertAxis, side, icon, metadata); + return textureatlassprite1 == atextureatlassprite[0] ? atextureatlassprite[4] : (textureatlassprite1 == atextureatlassprite[1] ? atextureatlassprite[5] : (textureatlassprite1 == atextureatlassprite[2] ? atextureatlassprite[6] : textureatlassprite1)); + } + } + + private static TextureAtlasSprite getConnectedTextureTop(ConnectedProperties cp, IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, int vertAxis, int side, TextureAtlasSprite icon, int metadata) + { + boolean flag = false; + + switch (vertAxis) + { + case 0: + if (side == 1 || side == 0) + { + return null; + } + + flag = isNeighbour(cp, blockAccess, blockState, blockPos.up(), side, icon, metadata); + break; + + case 1: + if (side == 3 || side == 2) + { + return null; + } + + flag = isNeighbour(cp, blockAccess, blockState, blockPos.south(), side, icon, metadata); + break; + + case 2: + if (side == 5 || side == 4) + { + return null; + } + + flag = isNeighbour(cp, blockAccess, blockState, blockPos.east(), side, icon, metadata); + } + + if (flag) + { + return cp.tileIcons[0]; + } + else + { + return null; + } + } + + public static void updateIcons(TextureMap textureMap) + { + blockProperties = (ConnectedProperties[][])null; + tileProperties = (ConnectedProperties[][])null; + spriteQuadMaps = null; + spriteQuadCompactMaps = (Map[][])null; + + if (Config.isConnectedTextures()) + { + IResourcePack[] airesourcepack = Config.getResourcePacks(); + + for (int i = airesourcepack.length - 1; i >= 0; --i) + { + IResourcePack iresourcepack = airesourcepack[i]; + updateIcons(textureMap, iresourcepack); + } + + updateIcons(textureMap, Config.getDefaultResourcePack()); + ResourceLocation resourcelocation = new ResourceLocation("mcpatcher/ctm/default/empty"); + emptySprite = textureMap.registerSprite(resourcelocation); + spriteQuadMaps = new Map[textureMap.getCountRegisteredSprites() + 1]; + spriteQuadFullMaps = new Map[textureMap.getCountRegisteredSprites() + 1]; + spriteQuadCompactMaps = new Map[textureMap.getCountRegisteredSprites() + 1][]; + + if (blockProperties.length <= 0) + { + blockProperties = (ConnectedProperties[][])null; + } + + if (tileProperties.length <= 0) + { + tileProperties = (ConnectedProperties[][])null; + } + } + } + + private static void updateIconEmpty(TextureMap textureMap) + { + } + + public static void updateIcons(TextureMap textureMap, IResourcePack rp) + { + String[] astring = ResUtils.collectFiles(rp, "mcpatcher/ctm/", ".properties", getDefaultCtmPaths()); + Arrays.sort((Object[])astring); + List list = makePropertyList(tileProperties); + List list1 = makePropertyList(blockProperties); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + Config.dbg("ConnectedTextures: " + s); + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s); + InputStream inputstream = rp.getInputStream(resourcelocation); + + if (inputstream == null) + { + Config.warn("ConnectedTextures file not found: " + s); + } + else + { + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + ConnectedProperties connectedproperties = new ConnectedProperties(properties, s); + + if (connectedproperties.isValid(s)) + { + connectedproperties.updateIcons(textureMap); + addToTileList(connectedproperties, list); + addToBlockList(connectedproperties, list1); + } + } + } + catch (FileNotFoundException var11) + { + Config.warn("ConnectedTextures file not found: " + s); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + blockProperties = propertyListToArray(list1); + tileProperties = propertyListToArray(list); + multipass = detectMultipass(); + Config.dbg("Multipass connected textures: " + multipass); + } + + private static List makePropertyList(ConnectedProperties[][] propsArr) + { + List list = new ArrayList(); + + if (propsArr != null) + { + for (int i = 0; i < propsArr.length; ++i) + { + ConnectedProperties[] aconnectedproperties = propsArr[i]; + List list1 = null; + + if (aconnectedproperties != null) + { + list1 = new ArrayList(Arrays.asList(aconnectedproperties)); + } + + list.add(list1); + } + } + + return list; + } + + private static boolean detectMultipass() + { + List list = new ArrayList(); + + for (int i = 0; i < tileProperties.length; ++i) + { + ConnectedProperties[] aconnectedproperties = tileProperties[i]; + + if (aconnectedproperties != null) + { + list.addAll(Arrays.asList(aconnectedproperties)); + } + } + + for (int k = 0; k < blockProperties.length; ++k) + { + ConnectedProperties[] aconnectedproperties2 = blockProperties[k]; + + if (aconnectedproperties2 != null) + { + list.addAll(Arrays.asList(aconnectedproperties2)); + } + } + + ConnectedProperties[] aconnectedproperties1 = (ConnectedProperties[])((ConnectedProperties[])list.toArray(new ConnectedProperties[list.size()])); + Set set1 = new HashSet(); + Set set = new HashSet(); + + for (int j = 0; j < aconnectedproperties1.length; ++j) + { + ConnectedProperties connectedproperties = aconnectedproperties1[j]; + + if (connectedproperties.matchTileIcons != null) + { + set1.addAll(Arrays.asList(connectedproperties.matchTileIcons)); + } + + if (connectedproperties.tileIcons != null) + { + set.addAll(Arrays.asList(connectedproperties.tileIcons)); + } + } + + set1.retainAll(set); + return !set1.isEmpty(); + } + + private static ConnectedProperties[][] propertyListToArray(List list) + { + ConnectedProperties[][] aconnectedproperties = new ConnectedProperties[list.size()][]; + + for (int i = 0; i < list.size(); ++i) + { + List list2 = (List)list.get(i); + + if (list2 != null) + { + ConnectedProperties[] aconnectedproperties1 = (ConnectedProperties[])((ConnectedProperties[])list2.toArray(new ConnectedProperties[list2.size()])); + aconnectedproperties[i] = aconnectedproperties1; + } + } + + return aconnectedproperties; + } + + private static void addToTileList(ConnectedProperties cp, List tileList) + { + if (cp.matchTileIcons != null) + { + for (int i = 0; i < cp.matchTileIcons.length; ++i) + { + TextureAtlasSprite textureatlassprite = cp.matchTileIcons[i]; + + if (!(textureatlassprite instanceof TextureAtlasSprite)) + { + Config.warn("TextureAtlasSprite is not TextureAtlasSprite: " + textureatlassprite + ", name: " + textureatlassprite.getIconName()); + } + else + { + int j = textureatlassprite.getIndexInMap(); + + if (j < 0) + { + Config.warn("Invalid tile ID: " + j + ", icon: " + textureatlassprite.getIconName()); + } + else + { + addToList(cp, tileList, j); + } + } + } + } + } + + private static void addToBlockList(ConnectedProperties cp, List blockList) + { + if (cp.matchBlocks != null) + { + for (int i = 0; i < cp.matchBlocks.length; ++i) + { + int j = cp.matchBlocks[i].getBlockId(); + + if (j < 0) + { + Config.warn("Invalid block ID: " + j); + } + else + { + addToList(cp, blockList, j); + } + } + } + } + + private static void addToList(ConnectedProperties cp, List list, int id) + { + while (id >= list.size()) + { + list.add(null); + } + + List list1 = (List)list.get(id); + + if (list1 == null) + { + list1 = new ArrayList(); + list.set(id, list1); + } + + list1.add(cp); + } + + private static String[] getDefaultCtmPaths() + { + List list = new ArrayList(); + String s = "mcpatcher/ctm/default/"; + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/glass.png"))) + { + list.add(s + "glass.properties"); + list.add(s + "glasspane.properties"); + } + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/bookshelf.png"))) + { + list.add(s + "bookshelf.properties"); + } + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/sandstone_normal.png"))) + { + list.add(s + "sandstone.properties"); + } + + String[] astring = new String[] {"white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "silver", "cyan", "purple", "blue", "brown", "green", "red", "black"}; + + for (int i = 0; i < astring.length; ++i) + { + String s1 = astring[i]; + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/glass_" + s1 + ".png"))) + { + list.add(s + i + "_glass_" + s1 + "/glass_" + s1 + ".properties"); + list.add(s + i + "_glass_" + s1 + "/glass_pane_" + s1 + ".properties"); + } + } + + String[] astring1 = (String[])((String[])list.toArray(new String[list.size()])); + return astring1; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/ConnectedTexturesCompact.java b/Client-1.8.9/src/main/java/net/optifine/ConnectedTexturesCompact.java new file mode 100644 index 0000000..5b87c31 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/ConnectedTexturesCompact.java @@ -0,0 +1,446 @@ +package net.optifine; + +import java.util.IdentityHashMap; +import java.util.Map; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.optifine.render.RenderEnv; + +public class ConnectedTexturesCompact +{ + private static final int COMPACT_NONE = 0; + private static final int COMPACT_ALL = 1; + private static final int COMPACT_V = 2; + private static final int COMPACT_H = 3; + private static final int COMPACT_HV = 4; + + public static BakedQuad[] getConnectedTextureCtmCompact(int ctmIndex, ConnectedProperties cp, int side, BakedQuad quad, RenderEnv renderEnv) + { + if (cp.ctmTileIndexes != null && ctmIndex >= 0 && ctmIndex < cp.ctmTileIndexes.length) + { + int i = cp.ctmTileIndexes[ctmIndex]; + + if (i >= 0 && i <= cp.tileIcons.length) + { + return getQuadsCompact(i, cp.tileIcons, quad, renderEnv); + } + } + + switch (ctmIndex) + { + case 1: + return getQuadsCompactH(0, 3, cp.tileIcons, side, quad, renderEnv); + + case 2: + return getQuadsCompact(3, cp.tileIcons, quad, renderEnv); + + case 3: + return getQuadsCompactH(3, 0, cp.tileIcons, side, quad, renderEnv); + + case 4: + return getQuadsCompact4(0, 3, 2, 4, cp.tileIcons, side, quad, renderEnv); + + case 5: + return getQuadsCompact4(3, 0, 4, 2, cp.tileIcons, side, quad, renderEnv); + + case 6: + return getQuadsCompact4(2, 4, 2, 4, cp.tileIcons, side, quad, renderEnv); + + case 7: + return getQuadsCompact4(3, 3, 4, 4, cp.tileIcons, side, quad, renderEnv); + + case 8: + return getQuadsCompact4(4, 1, 4, 4, cp.tileIcons, side, quad, renderEnv); + + case 9: + return getQuadsCompact4(4, 4, 4, 1, cp.tileIcons, side, quad, renderEnv); + + case 10: + return getQuadsCompact4(1, 4, 1, 4, cp.tileIcons, side, quad, renderEnv); + + case 11: + return getQuadsCompact4(1, 1, 4, 4, cp.tileIcons, side, quad, renderEnv); + + case 12: + return getQuadsCompactV(0, 2, cp.tileIcons, side, quad, renderEnv); + + case 13: + return getQuadsCompact4(0, 3, 2, 1, cp.tileIcons, side, quad, renderEnv); + + case 14: + return getQuadsCompactV(3, 1, cp.tileIcons, side, quad, renderEnv); + + case 15: + return getQuadsCompact4(3, 0, 1, 2, cp.tileIcons, side, quad, renderEnv); + + case 16: + return getQuadsCompact4(2, 4, 0, 3, cp.tileIcons, side, quad, renderEnv); + + case 17: + return getQuadsCompact4(4, 2, 3, 0, cp.tileIcons, side, quad, renderEnv); + + case 18: + return getQuadsCompact4(4, 4, 3, 3, cp.tileIcons, side, quad, renderEnv); + + case 19: + return getQuadsCompact4(4, 2, 4, 2, cp.tileIcons, side, quad, renderEnv); + + case 20: + return getQuadsCompact4(1, 4, 4, 4, cp.tileIcons, side, quad, renderEnv); + + case 21: + return getQuadsCompact4(4, 4, 1, 4, cp.tileIcons, side, quad, renderEnv); + + case 22: + return getQuadsCompact4(4, 4, 1, 1, cp.tileIcons, side, quad, renderEnv); + + case 23: + return getQuadsCompact4(4, 1, 4, 1, cp.tileIcons, side, quad, renderEnv); + + case 24: + return getQuadsCompact(2, cp.tileIcons, quad, renderEnv); + + case 25: + return getQuadsCompactH(2, 1, cp.tileIcons, side, quad, renderEnv); + + case 26: + return getQuadsCompact(1, cp.tileIcons, quad, renderEnv); + + case 27: + return getQuadsCompactH(1, 2, cp.tileIcons, side, quad, renderEnv); + + case 28: + return getQuadsCompact4(2, 4, 2, 1, cp.tileIcons, side, quad, renderEnv); + + case 29: + return getQuadsCompact4(3, 3, 1, 4, cp.tileIcons, side, quad, renderEnv); + + case 30: + return getQuadsCompact4(2, 1, 2, 4, cp.tileIcons, side, quad, renderEnv); + + case 31: + return getQuadsCompact4(3, 3, 4, 1, cp.tileIcons, side, quad, renderEnv); + + case 32: + return getQuadsCompact4(1, 1, 1, 4, cp.tileIcons, side, quad, renderEnv); + + case 33: + return getQuadsCompact4(1, 1, 4, 1, cp.tileIcons, side, quad, renderEnv); + + case 34: + return getQuadsCompact4(4, 1, 1, 4, cp.tileIcons, side, quad, renderEnv); + + case 35: + return getQuadsCompact4(1, 4, 4, 1, cp.tileIcons, side, quad, renderEnv); + + case 36: + return getQuadsCompactV(2, 0, cp.tileIcons, side, quad, renderEnv); + + case 37: + return getQuadsCompact4(2, 1, 0, 3, cp.tileIcons, side, quad, renderEnv); + + case 38: + return getQuadsCompactV(1, 3, cp.tileIcons, side, quad, renderEnv); + + case 39: + return getQuadsCompact4(1, 2, 3, 0, cp.tileIcons, side, quad, renderEnv); + + case 40: + return getQuadsCompact4(4, 1, 3, 3, cp.tileIcons, side, quad, renderEnv); + + case 41: + return getQuadsCompact4(1, 2, 4, 2, cp.tileIcons, side, quad, renderEnv); + + case 42: + return getQuadsCompact4(1, 4, 3, 3, cp.tileIcons, side, quad, renderEnv); + + case 43: + return getQuadsCompact4(4, 2, 1, 2, cp.tileIcons, side, quad, renderEnv); + + case 44: + return getQuadsCompact4(1, 4, 1, 1, cp.tileIcons, side, quad, renderEnv); + + case 45: + return getQuadsCompact4(4, 1, 1, 1, cp.tileIcons, side, quad, renderEnv); + + case 46: + return getQuadsCompact(4, cp.tileIcons, quad, renderEnv); + + default: + return getQuadsCompact(0, cp.tileIcons, quad, renderEnv); + } + } + + private static BakedQuad[] getQuadsCompactH(int indexLeft, int indexRight, TextureAtlasSprite[] sprites, int side, BakedQuad quad, RenderEnv renderEnv) + { + return getQuadsCompact(ConnectedTexturesCompact.Dir.LEFT, indexLeft, ConnectedTexturesCompact.Dir.RIGHT, indexRight, sprites, side, quad, renderEnv); + } + + private static BakedQuad[] getQuadsCompactV(int indexUp, int indexDown, TextureAtlasSprite[] sprites, int side, BakedQuad quad, RenderEnv renderEnv) + { + return getQuadsCompact(ConnectedTexturesCompact.Dir.UP, indexUp, ConnectedTexturesCompact.Dir.DOWN, indexDown, sprites, side, quad, renderEnv); + } + + private static BakedQuad[] getQuadsCompact4(int upLeft, int upRight, int downLeft, int downRight, TextureAtlasSprite[] sprites, int side, BakedQuad quad, RenderEnv renderEnv) + { + return upLeft == upRight ? (downLeft == downRight ? getQuadsCompact(ConnectedTexturesCompact.Dir.UP, upLeft, ConnectedTexturesCompact.Dir.DOWN, downLeft, sprites, side, quad, renderEnv) : getQuadsCompact(ConnectedTexturesCompact.Dir.UP, upLeft, ConnectedTexturesCompact.Dir.DOWN_LEFT, downLeft, ConnectedTexturesCompact.Dir.DOWN_RIGHT, downRight, sprites, side, quad, renderEnv)) : (downLeft == downRight ? getQuadsCompact(ConnectedTexturesCompact.Dir.UP_LEFT, upLeft, ConnectedTexturesCompact.Dir.UP_RIGHT, upRight, ConnectedTexturesCompact.Dir.DOWN, downLeft, sprites, side, quad, renderEnv) : (upLeft == downLeft ? (upRight == downRight ? getQuadsCompact(ConnectedTexturesCompact.Dir.LEFT, upLeft, ConnectedTexturesCompact.Dir.RIGHT, upRight, sprites, side, quad, renderEnv) : getQuadsCompact(ConnectedTexturesCompact.Dir.LEFT, upLeft, ConnectedTexturesCompact.Dir.UP_RIGHT, upRight, ConnectedTexturesCompact.Dir.DOWN_RIGHT, downRight, sprites, side, quad, renderEnv)) : (upRight == downRight ? getQuadsCompact(ConnectedTexturesCompact.Dir.UP_LEFT, upLeft, ConnectedTexturesCompact.Dir.DOWN_LEFT, downLeft, ConnectedTexturesCompact.Dir.RIGHT, upRight, sprites, side, quad, renderEnv) : getQuadsCompact(ConnectedTexturesCompact.Dir.UP_LEFT, upLeft, ConnectedTexturesCompact.Dir.UP_RIGHT, upRight, ConnectedTexturesCompact.Dir.DOWN_LEFT, downLeft, ConnectedTexturesCompact.Dir.DOWN_RIGHT, downRight, sprites, side, quad, renderEnv)))); + } + + private static BakedQuad[] getQuadsCompact(int index, TextureAtlasSprite[] sprites, BakedQuad quad, RenderEnv renderEnv) + { + TextureAtlasSprite textureatlassprite = sprites[index]; + return ConnectedTextures.getQuads(textureatlassprite, quad, renderEnv); + } + + private static BakedQuad[] getQuadsCompact(ConnectedTexturesCompact.Dir dir1, int index1, ConnectedTexturesCompact.Dir dir2, int index2, TextureAtlasSprite[] sprites, int side, BakedQuad quad, RenderEnv renderEnv) + { + BakedQuad bakedquad = getQuadCompact(sprites[index1], dir1, side, quad, renderEnv); + BakedQuad bakedquad1 = getQuadCompact(sprites[index2], dir2, side, quad, renderEnv); + return renderEnv.getArrayQuadsCtm(bakedquad, bakedquad1); + } + + private static BakedQuad[] getQuadsCompact(ConnectedTexturesCompact.Dir dir1, int index1, ConnectedTexturesCompact.Dir dir2, int index2, ConnectedTexturesCompact.Dir dir3, int index3, TextureAtlasSprite[] sprites, int side, BakedQuad quad, RenderEnv renderEnv) + { + BakedQuad bakedquad = getQuadCompact(sprites[index1], dir1, side, quad, renderEnv); + BakedQuad bakedquad1 = getQuadCompact(sprites[index2], dir2, side, quad, renderEnv); + BakedQuad bakedquad2 = getQuadCompact(sprites[index3], dir3, side, quad, renderEnv); + return renderEnv.getArrayQuadsCtm(bakedquad, bakedquad1, bakedquad2); + } + + private static BakedQuad[] getQuadsCompact(ConnectedTexturesCompact.Dir dir1, int index1, ConnectedTexturesCompact.Dir dir2, int index2, ConnectedTexturesCompact.Dir dir3, int index3, ConnectedTexturesCompact.Dir dir4, int index4, TextureAtlasSprite[] sprites, int side, BakedQuad quad, RenderEnv renderEnv) + { + BakedQuad bakedquad = getQuadCompact(sprites[index1], dir1, side, quad, renderEnv); + BakedQuad bakedquad1 = getQuadCompact(sprites[index2], dir2, side, quad, renderEnv); + BakedQuad bakedquad2 = getQuadCompact(sprites[index3], dir3, side, quad, renderEnv); + BakedQuad bakedquad3 = getQuadCompact(sprites[index4], dir4, side, quad, renderEnv); + return renderEnv.getArrayQuadsCtm(bakedquad, bakedquad1, bakedquad2, bakedquad3); + } + + private static BakedQuad getQuadCompact(TextureAtlasSprite sprite, ConnectedTexturesCompact.Dir dir, int side, BakedQuad quad, RenderEnv renderEnv) + { + switch (dir) + { + case UP: + return getQuadCompact(sprite, dir, 0, 0, 16, 8, side, quad, renderEnv); + + case UP_RIGHT: + return getQuadCompact(sprite, dir, 8, 0, 16, 8, side, quad, renderEnv); + + case RIGHT: + return getQuadCompact(sprite, dir, 8, 0, 16, 16, side, quad, renderEnv); + + case DOWN_RIGHT: + return getQuadCompact(sprite, dir, 8, 8, 16, 16, side, quad, renderEnv); + + case DOWN: + return getQuadCompact(sprite, dir, 0, 8, 16, 16, side, quad, renderEnv); + + case DOWN_LEFT: + return getQuadCompact(sprite, dir, 0, 8, 8, 16, side, quad, renderEnv); + + case LEFT: + return getQuadCompact(sprite, dir, 0, 0, 8, 16, side, quad, renderEnv); + + case UP_LEFT: + return getQuadCompact(sprite, dir, 0, 0, 8, 8, side, quad, renderEnv); + + default: + return quad; + } + } + + private static BakedQuad getQuadCompact(TextureAtlasSprite sprite, ConnectedTexturesCompact.Dir dir, int x1, int y1, int x2, int y2, int side, BakedQuad quadIn, RenderEnv renderEnv) + { + Map[][] amap = ConnectedTextures.getSpriteQuadCompactMaps(); + + if (amap == null) + { + return quadIn; + } + else + { + int i = sprite.getIndexInMap(); + + if (i >= 0 && i < amap.length) + { + Map[] amap1 = amap[i]; + + if (amap1 == null) + { + amap1 = new Map[ConnectedTexturesCompact.Dir.VALUES.length]; + amap[i] = amap1; + } + + Map map = amap1[dir.ordinal()]; + + if (map == null) + { + map = new IdentityHashMap(1); + amap1[dir.ordinal()] = map; + } + + BakedQuad bakedquad = (BakedQuad)map.get(quadIn); + + if (bakedquad == null) + { + bakedquad = makeSpriteQuadCompact(quadIn, sprite, side, x1, y1, x2, y2); + map.put(quadIn, bakedquad); + } + + return bakedquad; + } + else + { + return quadIn; + } + } + } + + private static BakedQuad makeSpriteQuadCompact(BakedQuad quad, TextureAtlasSprite sprite, int side, int x1, int y1, int x2, int y2) + { + int[] aint = (int[])quad.getVertexData().clone(); + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + for (int i = 0; i < 4; ++i) + { + fixVertexCompact(aint, i, textureatlassprite, sprite, side, x1, y1, x2, y2); + } + + BakedQuad bakedquad = new BakedQuad(aint, quad.getTintIndex(), quad.getFace(), sprite); + return bakedquad; + } + + private static void fixVertexCompact(int[] data, int vertex, TextureAtlasSprite spriteFrom, TextureAtlasSprite spriteTo, int side, int x1, int y1, int x2, int y2) + { + int i = data.length / 4; + int j = i * vertex; + float f = Float.intBitsToFloat(data[j + 4]); + float f1 = Float.intBitsToFloat(data[j + 4 + 1]); + double d0 = spriteFrom.getSpriteU16(f); + double d1 = spriteFrom.getSpriteV16(f1); + float f2 = Float.intBitsToFloat(data[j + 0]); + float f3 = Float.intBitsToFloat(data[j + 1]); + float f4 = Float.intBitsToFloat(data[j + 2]); + float f5; + float f6; + + switch (side) + { + case 0: + f5 = f2; + f6 = 1.0F - f4; + break; + + case 1: + f5 = f2; + f6 = f4; + break; + + case 2: + f5 = 1.0F - f2; + f6 = 1.0F - f3; + break; + + case 3: + f5 = f2; + f6 = 1.0F - f3; + break; + + case 4: + f5 = f4; + f6 = 1.0F - f3; + break; + + case 5: + f5 = 1.0F - f4; + f6 = 1.0F - f3; + break; + + default: + return; + } + + float f7 = 15.968F; + float f8 = 15.968F; + + if (d0 < (double)x1) + { + f5 = (float)((double)f5 + ((double)x1 - d0) / (double)f7); + d0 = (double)x1; + } + + if (d0 > (double)x2) + { + f5 = (float)((double)f5 - (d0 - (double)x2) / (double)f7); + d0 = (double)x2; + } + + if (d1 < (double)y1) + { + f6 = (float)((double)f6 + ((double)y1 - d1) / (double)f8); + d1 = (double)y1; + } + + if (d1 > (double)y2) + { + f6 = (float)((double)f6 - (d1 - (double)y2) / (double)f8); + d1 = (double)y2; + } + + switch (side) + { + case 0: + f2 = f5; + f4 = 1.0F - f6; + break; + + case 1: + f2 = f5; + f4 = f6; + break; + + case 2: + f2 = 1.0F - f5; + f3 = 1.0F - f6; + break; + + case 3: + f2 = f5; + f3 = 1.0F - f6; + break; + + case 4: + f4 = f5; + f3 = 1.0F - f6; + break; + + case 5: + f4 = 1.0F - f5; + f3 = 1.0F - f6; + break; + + default: + return; + } + + data[j + 4] = Float.floatToRawIntBits(spriteTo.getInterpolatedU(d0)); + data[j + 4 + 1] = Float.floatToRawIntBits(spriteTo.getInterpolatedV(d1)); + data[j + 0] = Float.floatToRawIntBits(f2); + data[j + 1] = Float.floatToRawIntBits(f3); + data[j + 2] = Float.floatToRawIntBits(f4); + } + + private static enum Dir + { + UP, + UP_RIGHT, + RIGHT, + DOWN_RIGHT, + DOWN, + DOWN_LEFT, + LEFT, + UP_LEFT; + + public static final ConnectedTexturesCompact.Dir[] VALUES = values(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CrashReporter.java b/Client-1.8.9/src/main/java/net/optifine/CrashReporter.java new file mode 100644 index 0000000..962a5c3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CrashReporter.java @@ -0,0 +1,126 @@ +package net.optifine; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.optifine.http.FileUploadThread; +import net.optifine.http.IFileUploadListener; +import net.optifine.shaders.Shaders; + +public class CrashReporter +{ + public static void onCrashReport(CrashReport crashReport, CrashReportCategory category) + { + try + { + Throwable throwable = crashReport.getCrashCause(); + + if (throwable == null) + { + return; + } + + if (throwable.getClass().getName().contains(".fml.client.SplashProgress")) + { + return; + } + + if (throwable.getClass() == Throwable.class) + { + return; + } + + extendCrashReport(category); + GameSettings gamesettings = Config.getGameSettings(); + + if (gamesettings == null) + { + return; + } + + if (!gamesettings.snooperEnabled) + { + return; + } + + String s = "http://optifine.net/crashReport"; + String s1 = makeReport(crashReport); + byte[] abyte = s1.getBytes("ASCII"); + IFileUploadListener ifileuploadlistener = new IFileUploadListener() + { + public void fileUploadFinished(String url, byte[] content, Throwable exception) + { + } + }; + Map map = new HashMap(); + map.put("OF-Version", Config.getVersion()); + map.put("OF-Summary", makeSummary(crashReport)); + FileUploadThread fileuploadthread = new FileUploadThread(s, map, abyte, ifileuploadlistener); + fileuploadthread.setPriority(10); + fileuploadthread.start(); + Thread.sleep(1000L); + } + catch (Exception exception) + { + Config.dbg(exception.getClass().getName() + ": " + exception.getMessage()); + } + } + + private static String makeReport(CrashReport crashReport) + { + StringBuffer stringbuffer = new StringBuffer(); + stringbuffer.append("OptiFineVersion: " + Config.getVersion() + "\n"); + stringbuffer.append("Summary: " + makeSummary(crashReport) + "\n"); + stringbuffer.append("\n"); + stringbuffer.append(crashReport.getCompleteReport()); + stringbuffer.append("\n"); + return stringbuffer.toString(); + } + + private static String makeSummary(CrashReport crashReport) + { + Throwable throwable = crashReport.getCrashCause(); + + if (throwable == null) + { + return "Unknown"; + } + else + { + StackTraceElement[] astacktraceelement = throwable.getStackTrace(); + String s = "unknown"; + + if (astacktraceelement.length > 0) + { + s = astacktraceelement[0].toString().trim(); + } + + String s1 = throwable.getClass().getName() + ": " + throwable.getMessage() + " (" + crashReport.getDescription() + ")" + " [" + s + "]"; + return s1; + } + } + + public static void extendCrashReport(CrashReportCategory cat) + { + cat.addCrashSection("OptiFine Version", Config.getVersion()); + cat.addCrashSection("OptiFine Build", Config.getBuild()); + + if (Config.getGameSettings() != null) + { + cat.addCrashSection("Render Distance Chunks", "" + Config.getChunkViewDistance()); + cat.addCrashSection("Mipmaps", "" + Config.getMipmapLevels()); + cat.addCrashSection("Anisotropic Filtering", "" + Config.getAnisotropicFilterLevel()); + cat.addCrashSection("Antialiasing", "" + Config.getAntialiasingLevel()); + cat.addCrashSection("Multitexture", "" + Config.isMultiTexture()); + } + + cat.addCrashSection("Shaders", "" + Shaders.getShaderPackName()); + cat.addCrashSection("OpenGlVersion", "" + Config.openGlVersion); + cat.addCrashSection("OpenGlRenderer", "" + Config.openGlRenderer); + cat.addCrashSection("OpenGlVendor", "" + Config.openGlVendor); + cat.addCrashSection("CpuCount", "" + Config.getAvailableProcessors()); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomBlockLayers.java b/Client-1.8.9/src/main/java/net/optifine/CustomBlockLayers.java new file mode 100644 index 0000000..9be3ebd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomBlockLayers.java @@ -0,0 +1,123 @@ +package net.optifine; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.block.state.IBlockState; +import net.minecraft.src.Config; +import net.minecraft.util.EnumWorldBlockLayer; +import net.optifine.config.ConnectedParser; +import net.optifine.config.MatchBlock; +import net.optifine.shaders.BlockAliases; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.ResUtils; + +public class CustomBlockLayers +{ + private static EnumWorldBlockLayer[] renderLayers = null; + public static boolean active = false; + + public static EnumWorldBlockLayer getRenderLayer(IBlockState blockState) + { + if (renderLayers == null) + { + return null; + } + else if (blockState.getBlock().isOpaqueCube()) + { + return null; + } + else if (!(blockState instanceof BlockStateBase)) + { + return null; + } + else + { + BlockStateBase blockstatebase = (BlockStateBase)blockState; + int i = blockstatebase.getBlockId(); + return i > 0 && i < renderLayers.length ? renderLayers[i] : null; + } + } + + public static void update() + { + renderLayers = null; + active = false; + List list = new ArrayList(); + String s = "optifine/block.properties"; + Properties properties = ResUtils.readProperties(s, "CustomBlockLayers"); + + if (properties != null) + { + readLayers(s, properties, list); + } + + if (Config.isShaders()) + { + PropertiesOrdered propertiesordered = BlockAliases.getBlockLayerPropertes(); + + if (propertiesordered != null) + { + String s1 = "shaders/block.properties"; + readLayers(s1, propertiesordered, list); + } + } + + if (!((List)list).isEmpty()) + { + renderLayers = (EnumWorldBlockLayer[])list.toArray(new EnumWorldBlockLayer[list.size()]); + active = true; + } + } + + private static void readLayers(String pathProps, Properties props, List list) + { + Config.dbg("CustomBlockLayers: " + pathProps); + readLayer("solid", EnumWorldBlockLayer.SOLID, props, list); + readLayer("cutout", EnumWorldBlockLayer.CUTOUT, props, list); + readLayer("cutout_mipped", EnumWorldBlockLayer.CUTOUT_MIPPED, props, list); + readLayer("translucent", EnumWorldBlockLayer.TRANSLUCENT, props, list); + } + + private static void readLayer(String name, EnumWorldBlockLayer layer, Properties props, List listLayers) + { + String s = "layer." + name; + String s1 = props.getProperty(s); + + if (s1 != null) + { + ConnectedParser connectedparser = new ConnectedParser("CustomBlockLayers"); + MatchBlock[] amatchblock = connectedparser.parseMatchBlocks(s1); + + if (amatchblock != null) + { + for (int i = 0; i < amatchblock.length; ++i) + { + MatchBlock matchblock = amatchblock[i]; + int j = matchblock.getBlockId(); + + if (j > 0) + { + while (listLayers.size() < j + 1) + { + listLayers.add(null); + } + + if (listLayers.get(j) != null) + { + Config.warn("CustomBlockLayers: Block layer is already set, block: " + j + ", layer: " + name); + } + + listLayers.set(j, layer); + } + } + } + } + } + + public static boolean isActive() + { + return active; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomColorFader.java b/Client-1.8.9/src/main/java/net/optifine/CustomColorFader.java new file mode 100644 index 0000000..77f74bf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomColorFader.java @@ -0,0 +1,51 @@ +package net.optifine; + +import net.minecraft.src.Config; +import net.minecraft.util.Vec3; + +public class CustomColorFader +{ + private Vec3 color = null; + private long timeUpdate = System.currentTimeMillis(); + + public Vec3 getColor(double x, double y, double z) + { + if (this.color == null) + { + this.color = new Vec3(x, y, z); + return this.color; + } + else + { + long i = System.currentTimeMillis(); + long j = i - this.timeUpdate; + + if (j == 0L) + { + return this.color; + } + else + { + this.timeUpdate = i; + + if (Math.abs(x - this.color.xCoord) < 0.004D && Math.abs(y - this.color.yCoord) < 0.004D && Math.abs(z - this.color.zCoord) < 0.004D) + { + return this.color; + } + else + { + double d0 = (double)j * 0.001D; + d0 = Config.limit(d0, 0.0D, 1.0D); + double d1 = x - this.color.xCoord; + double d2 = y - this.color.yCoord; + double d3 = z - this.color.zCoord; + double d4 = this.color.xCoord + d1 * d0; + double d5 = this.color.yCoord + d2 * d0; + double d6 = this.color.zCoord + d3 * d0; + this.color = new Vec3(d4, d5, d6); + return this.color; + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomColormap.java b/Client-1.8.9/src/main/java/net/optifine/CustomColormap.java new file mode 100644 index 0000000..95bbac4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomColormap.java @@ -0,0 +1,568 @@ +package net.optifine; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.block.Block; +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.config.ConnectedParser; +import net.optifine.config.MatchBlock; +import net.optifine.config.Matches; +import net.optifine.util.TextureUtils; + +public class CustomColormap implements CustomColors.IColorizer +{ + public String name = null; + public String basePath = null; + private int format = -1; + private MatchBlock[] matchBlocks = null; + private String source = null; + private int color = -1; + private int yVariance = 0; + private int yOffset = 0; + private int width = 0; + private int height = 0; + private int[] colors = null; + private float[][] colorsRgb = (float[][])null; + private static final int FORMAT_UNKNOWN = -1; + private static final int FORMAT_VANILLA = 0; + private static final int FORMAT_GRID = 1; + private static final int FORMAT_FIXED = 2; + public static final String FORMAT_VANILLA_STRING = "vanilla"; + public static final String FORMAT_GRID_STRING = "grid"; + public static final String FORMAT_FIXED_STRING = "fixed"; + public static final String[] FORMAT_STRINGS = new String[] {"vanilla", "grid", "fixed"}; + public static final String KEY_FORMAT = "format"; + public static final String KEY_BLOCKS = "blocks"; + public static final String KEY_SOURCE = "source"; + public static final String KEY_COLOR = "color"; + public static final String KEY_Y_VARIANCE = "yVariance"; + public static final String KEY_Y_OFFSET = "yOffset"; + + public CustomColormap(Properties props, String path, int width, int height, String formatDefault) + { + ConnectedParser connectedparser = new ConnectedParser("Colormap"); + this.name = connectedparser.parseName(path); + this.basePath = connectedparser.parseBasePath(path); + this.format = this.parseFormat(props.getProperty("format", formatDefault)); + this.matchBlocks = connectedparser.parseMatchBlocks(props.getProperty("blocks")); + this.source = parseTexture(props.getProperty("source"), path, this.basePath); + this.color = ConnectedParser.parseColor(props.getProperty("color"), -1); + this.yVariance = connectedparser.parseInt(props.getProperty("yVariance"), 0); + this.yOffset = connectedparser.parseInt(props.getProperty("yOffset"), 0); + this.width = width; + this.height = height; + } + + private int parseFormat(String str) + { + if (str == null) + { + return 0; + } + else + { + str = str.trim(); + + if (str.equals("vanilla")) + { + return 0; + } + else if (str.equals("grid")) + { + return 1; + } + else if (str.equals("fixed")) + { + return 2; + } + else + { + warn("Unknown format: " + str); + return -1; + } + } + } + + public boolean isValid(String path) + { + if (this.format != 0 && this.format != 1) + { + if (this.format != 2) + { + return false; + } + + if (this.color < 0) + { + this.color = 16777215; + } + } + else + { + if (this.source == null) + { + warn("Source not defined: " + path); + return false; + } + + this.readColors(); + + if (this.colors == null) + { + return false; + } + + if (this.color < 0) + { + if (this.format == 0) + { + this.color = this.getColor(127, 127); + } + + if (this.format == 1) + { + this.color = this.getColorGrid(BiomeGenBase.plains, new BlockPos(0, 64, 0)); + } + } + } + + return true; + } + + public boolean isValidMatchBlocks(String path) + { + if (this.matchBlocks == null) + { + this.matchBlocks = this.detectMatchBlocks(); + + if (this.matchBlocks == null) + { + warn("Match blocks not defined: " + path); + return false; + } + } + + return true; + } + + private MatchBlock[] detectMatchBlocks() + { + Block block = Block.getBlockFromName(this.name); + + if (block != null) + { + return new MatchBlock[] {new MatchBlock(Block.getIdFromBlock(block))}; + } + else + { + Pattern pattern = Pattern.compile("^block([0-9]+).*$"); + Matcher matcher = pattern.matcher(this.name); + + if (matcher.matches()) + { + String s = matcher.group(1); + int i = Config.parseInt(s, -1); + + if (i >= 0) + { + return new MatchBlock[] {new MatchBlock(i)}; + } + } + + ConnectedParser connectedparser = new ConnectedParser("Colormap"); + MatchBlock[] amatchblock = connectedparser.parseMatchBlock(this.name); + return amatchblock != null ? amatchblock : null; + } + } + + private void readColors() + { + try + { + this.colors = null; + + if (this.source == null) + { + return; + } + + String s = this.source + ".png"; + ResourceLocation resourcelocation = new ResourceLocation(s); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return; + } + + BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream); + + if (bufferedimage == null) + { + return; + } + + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + boolean flag = this.width < 0 || this.width == i; + boolean flag1 = this.height < 0 || this.height == j; + + if (!flag || !flag1) + { + dbg("Non-standard palette size: " + i + "x" + j + ", should be: " + this.width + "x" + this.height + ", path: " + s); + } + + this.width = i; + this.height = j; + + if (this.width <= 0 || this.height <= 0) + { + warn("Invalid palette size: " + i + "x" + j + ", path: " + s); + return; + } + + this.colors = new int[i * j]; + bufferedimage.getRGB(0, 0, i, j, this.colors, 0, i); + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + private static void dbg(String str) + { + Config.dbg("CustomColors: " + str); + } + + private static void warn(String str) + { + Config.warn("CustomColors: " + str); + } + + private static String parseTexture(String texStr, String path, String basePath) + { + if (texStr != null) + { + texStr = texStr.trim(); + String s1 = ".png"; + + if (texStr.endsWith(s1)) + { + texStr = texStr.substring(0, texStr.length() - s1.length()); + } + + texStr = fixTextureName(texStr, basePath); + return texStr; + } + else + { + String s = path; + int i = path.lastIndexOf(47); + + if (i >= 0) + { + s = path.substring(i + 1); + } + + int j = s.lastIndexOf(46); + + if (j >= 0) + { + s = s.substring(0, j); + } + + s = fixTextureName(s, basePath); + return s; + } + } + + private static String fixTextureName(String iconName, String basePath) + { + iconName = TextureUtils.fixResourcePath(iconName, basePath); + + if (!iconName.startsWith(basePath) && !iconName.startsWith("textures/") && !iconName.startsWith("mcpatcher/")) + { + iconName = basePath + "/" + iconName; + } + + if (iconName.endsWith(".png")) + { + iconName = iconName.substring(0, iconName.length() - 4); + } + + String s = "textures/blocks/"; + + if (iconName.startsWith(s)) + { + iconName = iconName.substring(s.length()); + } + + if (iconName.startsWith("/")) + { + iconName = iconName.substring(1); + } + + return iconName; + } + + public boolean matchesBlock(BlockStateBase blockState) + { + return Matches.block(blockState, this.matchBlocks); + } + + public int getColorRandom() + { + if (this.format == 2) + { + return this.color; + } + else + { + int i = CustomColors.random.nextInt(this.colors.length); + return this.colors[i]; + } + } + + public int getColor(int index) + { + index = Config.limit(index, 0, this.colors.length - 1); + return this.colors[index] & 16777215; + } + + public int getColor(int cx, int cy) + { + cx = Config.limit(cx, 0, this.width - 1); + cy = Config.limit(cy, 0, this.height - 1); + return this.colors[cy * this.width + cx] & 16777215; + } + + public float[][] getColorsRgb() + { + if (this.colorsRgb == null) + { + this.colorsRgb = toRgb(this.colors); + } + + return this.colorsRgb; + } + + public int getColor(IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos) + { + return this.getColor(blockAccess, blockPos); + } + + public int getColor(IBlockAccess blockAccess, BlockPos blockPos) + { + BiomeGenBase biomegenbase = CustomColors.getColorBiome(blockAccess, blockPos); + return this.getColor(biomegenbase, blockPos); + } + + public boolean isColorConstant() + { + return this.format == 2; + } + + public int getColor(BiomeGenBase biome, BlockPos blockPos) + { + return this.format == 0 ? this.getColorVanilla(biome, blockPos) : (this.format == 1 ? this.getColorGrid(biome, blockPos) : this.color); + } + + public int getColorSmooth(IBlockAccess blockAccess, double x, double y, double z, int radius) + { + if (this.format == 2) + { + return this.color; + } + else + { + int i = MathHelper.floor_double(x); + int j = MathHelper.floor_double(y); + int k = MathHelper.floor_double(z); + int l = 0; + int i1 = 0; + int j1 = 0; + int k1 = 0; + BlockPosM blockposm = new BlockPosM(0, 0, 0); + + for (int l1 = i - radius; l1 <= i + radius; ++l1) + { + for (int i2 = k - radius; i2 <= k + radius; ++i2) + { + blockposm.setXyz(l1, j, i2); + int j2 = this.getColor((IBlockAccess)blockAccess, blockposm); + l += j2 >> 16 & 255; + i1 += j2 >> 8 & 255; + j1 += j2 & 255; + ++k1; + } + } + + int k2 = l / k1; + int l2 = i1 / k1; + int i3 = j1 / k1; + return k2 << 16 | l2 << 8 | i3; + } + } + + private int getColorVanilla(BiomeGenBase biome, BlockPos blockPos) + { + double d0 = (double)MathHelper.clamp_float(biome.getFloatTemperature(blockPos), 0.0F, 1.0F); + double d1 = (double)MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F); + d1 = d1 * d0; + int i = (int)((1.0D - d0) * (double)(this.width - 1)); + int j = (int)((1.0D - d1) * (double)(this.height - 1)); + return this.getColor(i, j); + } + + private int getColorGrid(BiomeGenBase biome, BlockPos blockPos) + { + int i = biome.biomeID; + int j = blockPos.getY() - this.yOffset; + + if (this.yVariance > 0) + { + int k = blockPos.getX() << 16 + blockPos.getZ(); + int l = Config.intHash(k); + int i1 = this.yVariance * 2 + 1; + int j1 = (l & 255) % i1 - this.yVariance; + j += j1; + } + + return this.getColor(i, j); + } + + public int getLength() + { + return this.format == 2 ? 1 : this.colors.length; + } + + public int getWidth() + { + return this.width; + } + + public int getHeight() + { + return this.height; + } + + private static float[][] toRgb(int[] cols) + { + float[][] afloat = new float[cols.length][3]; + + for (int i = 0; i < cols.length; ++i) + { + int j = cols[i]; + float f = (float)(j >> 16 & 255) / 255.0F; + float f1 = (float)(j >> 8 & 255) / 255.0F; + float f2 = (float)(j & 255) / 255.0F; + float[] afloat1 = afloat[i]; + afloat1[0] = f; + afloat1[1] = f1; + afloat1[2] = f2; + } + + return afloat; + } + + public void addMatchBlock(MatchBlock mb) + { + if (this.matchBlocks == null) + { + this.matchBlocks = new MatchBlock[0]; + } + + this.matchBlocks = (MatchBlock[])((MatchBlock[])Config.addObjectToArray(this.matchBlocks, mb)); + } + + public void addMatchBlock(int blockId, int metadata) + { + MatchBlock matchblock = this.getMatchBlock(blockId); + + if (matchblock != null) + { + if (metadata >= 0) + { + matchblock.addMetadata(metadata); + } + } + else + { + this.addMatchBlock(new MatchBlock(blockId, metadata)); + } + } + + private MatchBlock getMatchBlock(int blockId) + { + if (this.matchBlocks == null) + { + return null; + } + else + { + for (int i = 0; i < this.matchBlocks.length; ++i) + { + MatchBlock matchblock = this.matchBlocks[i]; + + if (matchblock.getBlockId() == blockId) + { + return matchblock; + } + } + + return null; + } + } + + public int[] getMatchBlockIds() + { + if (this.matchBlocks == null) + { + return null; + } + else + { + Set set = new HashSet(); + + for (int i = 0; i < this.matchBlocks.length; ++i) + { + MatchBlock matchblock = this.matchBlocks[i]; + + if (matchblock.getBlockId() >= 0) + { + set.add(Integer.valueOf(matchblock.getBlockId())); + } + } + + Integer[] ainteger = (Integer[])((Integer[])set.toArray(new Integer[set.size()])); + int[] aint = new int[ainteger.length]; + + for (int j = 0; j < ainteger.length; ++j) + { + aint[j] = ainteger[j].intValue(); + } + + return aint; + } + } + + public String toString() + { + return "" + this.basePath + "/" + this.name + ", blocks: " + Config.arrayToString((Object[])this.matchBlocks) + ", source: " + this.source; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomColors.java b/Client-1.8.9/src/main/java/net/optifine/CustomColors.java new file mode 100644 index 0000000..ffad8f5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomColors.java @@ -0,0 +1,1787 @@ +package net.optifine; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.BlockStem; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMonsterPlacer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.config.ConnectedParser; +import net.optifine.config.MatchBlock; +import net.optifine.reflect.Reflector; +import net.optifine.render.RenderEnv; +import net.optifine.util.*; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; + +public class CustomColors +{ + private static String paletteFormatDefault = "vanilla"; + private static CustomColormap waterColors = null; + private static CustomColormap foliagePineColors = null; + private static CustomColormap foliageBirchColors = null; + private static CustomColormap swampFoliageColors = null; + private static CustomColormap swampGrassColors = null; + private static CustomColormap[] colorsBlockColormaps = null; + private static CustomColormap[][] blockColormaps = (CustomColormap[][])null; + private static CustomColormap skyColors = null; + private static CustomColorFader skyColorFader = new CustomColorFader(); + private static CustomColormap fogColors = null; + private static CustomColorFader fogColorFader = new CustomColorFader(); + private static CustomColormap underwaterColors = null; + private static CustomColorFader underwaterColorFader = new CustomColorFader(); + private static CustomColormap underlavaColors = null; + private static CustomColorFader underlavaColorFader = new CustomColorFader(); + private static LightMapPack[] lightMapPacks = null; + private static int lightmapMinDimensionId = 0; + private static CustomColormap redstoneColors = null; + private static CustomColormap xpOrbColors = null; + private static int xpOrbTime = -1; + private static CustomColormap durabilityColors = null; + private static CustomColormap stemColors = null; + private static CustomColormap stemMelonColors = null; + private static CustomColormap stemPumpkinColors = null; + private static CustomColormap myceliumParticleColors = null; + private static boolean useDefaultGrassFoliageColors = true; + private static int particleWaterColor = -1; + private static int particlePortalColor = -1; + private static int lilyPadColor = -1; + private static int expBarTextColor = -1; + private static int bossTextColor = -1; + private static int signTextColor = -1; + private static Vec3 fogColorNether = null; + private static Vec3 fogColorEnd = null; + private static Vec3 skyColorEnd = null; + private static int[] spawnEggPrimaryColors = null; + private static int[] spawnEggSecondaryColors = null; + private static float[][] wolfCollarColors = (float[][])null; + private static float[][] sheepColors = (float[][])null; + private static int[] textColors = null; + private static int[] mapColorsOriginal = null; + private static int[] potionColors = null; + private static final IBlockState BLOCK_STATE_DIRT = Blocks.dirt.getDefaultState(); + private static final IBlockState BLOCK_STATE_WATER = Blocks.water.getDefaultState(); + public static Random random = new Random(); + private static final CustomColors.IColorizer COLORIZER_GRASS = new CustomColors.IColorizer() + { + public int getColor(IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos) + { + BiomeGenBase biomegenbase = CustomColors.getColorBiome(blockAccess, blockPos); + return CustomColors.swampGrassColors != null && biomegenbase == BiomeGenBase.swampland ? CustomColors.swampGrassColors.getColor(biomegenbase, blockPos) : biomegenbase.getGrassColorAtPos(blockPos); + } + public boolean isColorConstant() + { + return false; + } + }; + private static final CustomColors.IColorizer COLORIZER_FOLIAGE = new CustomColors.IColorizer() + { + public int getColor(IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos) + { + BiomeGenBase biomegenbase = CustomColors.getColorBiome(blockAccess, blockPos); + return CustomColors.swampFoliageColors != null && biomegenbase == BiomeGenBase.swampland ? CustomColors.swampFoliageColors.getColor(biomegenbase, blockPos) : biomegenbase.getFoliageColorAtPos(blockPos); + } + public boolean isColorConstant() + { + return false; + } + }; + private static final CustomColors.IColorizer COLORIZER_FOLIAGE_PINE = new CustomColors.IColorizer() + { + public int getColor(IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos) + { + return CustomColors.foliagePineColors != null ? CustomColors.foliagePineColors.getColor(blockAccess, blockPos) : ColorizerFoliage.getFoliageColorPine(); + } + public boolean isColorConstant() + { + return CustomColors.foliagePineColors == null; + } + }; + private static final CustomColors.IColorizer COLORIZER_FOLIAGE_BIRCH = new CustomColors.IColorizer() + { + public int getColor(IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos) + { + return CustomColors.foliageBirchColors != null ? CustomColors.foliageBirchColors.getColor(blockAccess, blockPos) : ColorizerFoliage.getFoliageColorBirch(); + } + public boolean isColorConstant() + { + return CustomColors.foliageBirchColors == null; + } + }; + private static final CustomColors.IColorizer COLORIZER_WATER = new CustomColors.IColorizer() + { + public int getColor(IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos) + { + BiomeGenBase biomegenbase = CustomColors.getColorBiome(blockAccess, blockPos); + return CustomColors.waterColors != null ? CustomColors.waterColors.getColor(biomegenbase, blockPos) : (Reflector.ForgeBiome_getWaterColorMultiplier.exists() ? Reflector.callInt(biomegenbase, Reflector.ForgeBiome_getWaterColorMultiplier, new Object[0]) : biomegenbase.waterColorMultiplier); + } + public boolean isColorConstant() + { + return false; + } + }; + + public static void update() + { + paletteFormatDefault = "vanilla"; + waterColors = null; + foliageBirchColors = null; + foliagePineColors = null; + swampGrassColors = null; + swampFoliageColors = null; + skyColors = null; + fogColors = null; + underwaterColors = null; + underlavaColors = null; + redstoneColors = null; + xpOrbColors = null; + xpOrbTime = -1; + durabilityColors = null; + stemColors = null; + myceliumParticleColors = null; + lightMapPacks = null; + particleWaterColor = -1; + particlePortalColor = -1; + lilyPadColor = -1; + expBarTextColor = -1; + bossTextColor = -1; + signTextColor = -1; + fogColorNether = null; + fogColorEnd = null; + skyColorEnd = null; + colorsBlockColormaps = null; + blockColormaps = (CustomColormap[][])null; + useDefaultGrassFoliageColors = true; + spawnEggPrimaryColors = null; + spawnEggSecondaryColors = null; + wolfCollarColors = (float[][])null; + sheepColors = (float[][])null; + textColors = null; + setMapColors(mapColorsOriginal); + potionColors = null; + paletteFormatDefault = getValidProperty("mcpatcher/color.properties", "palette.format", CustomColormap.FORMAT_STRINGS, "vanilla"); + String s = "mcpatcher/colormap/"; + String[] astring = new String[] {"water.png", "watercolorX.png"}; + waterColors = getCustomColors(s, astring, 256, 256); + updateUseDefaultGrassFoliageColors(); + + if (Config.isCustomColors()) + { + String[] astring1 = new String[] {"pine.png", "pinecolor.png"}; + foliagePineColors = getCustomColors(s, astring1, 256, 256); + String[] astring2 = new String[] {"birch.png", "birchcolor.png"}; + foliageBirchColors = getCustomColors(s, astring2, 256, 256); + String[] astring3 = new String[] {"swampgrass.png", "swampgrasscolor.png"}; + swampGrassColors = getCustomColors(s, astring3, 256, 256); + String[] astring4 = new String[] {"swampfoliage.png", "swampfoliagecolor.png"}; + swampFoliageColors = getCustomColors(s, astring4, 256, 256); + String[] astring5 = new String[] {"sky0.png", "skycolor0.png"}; + skyColors = getCustomColors(s, astring5, 256, 256); + String[] astring6 = new String[] {"fog0.png", "fogcolor0.png"}; + fogColors = getCustomColors(s, astring6, 256, 256); + String[] astring7 = new String[] {"underwater.png", "underwatercolor.png"}; + underwaterColors = getCustomColors(s, astring7, 256, 256); + String[] astring8 = new String[] {"underlava.png", "underlavacolor.png"}; + underlavaColors = getCustomColors(s, astring8, 256, 256); + String[] astring9 = new String[] {"redstone.png", "redstonecolor.png"}; + redstoneColors = getCustomColors(s, astring9, 16, 1); + xpOrbColors = getCustomColors(s + "xporb.png", -1, -1); + durabilityColors = getCustomColors(s + "durability.png", -1, -1); + String[] astring10 = new String[] {"stem.png", "stemcolor.png"}; + stemColors = getCustomColors(s, astring10, 8, 1); + stemPumpkinColors = getCustomColors(s + "pumpkinstem.png", 8, 1); + stemMelonColors = getCustomColors(s + "melonstem.png", 8, 1); + String[] astring11 = new String[] {"myceliumparticle.png", "myceliumparticlecolor.png"}; + myceliumParticleColors = getCustomColors(s, astring11, -1, -1); + Pair pair = parseLightMapPacks(); + lightMapPacks = (LightMapPack[])pair.getLeft(); + lightmapMinDimensionId = ((Integer)pair.getRight()).intValue(); + readColorProperties("mcpatcher/color.properties"); + blockColormaps = readBlockColormaps(new String[] {s + "custom/", s + "blocks/"}, colorsBlockColormaps, 256, 256); + updateUseDefaultGrassFoliageColors(); + } + } + + private static String getValidProperty(String fileName, String key, String[] validValues, String valDef) + { + try + { + ResourceLocation resourcelocation = new ResourceLocation(fileName); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return valDef; + } + else + { + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + String s = properties.getProperty(key); + + if (s == null) + { + return valDef; + } + else + { + List list = Arrays.asList(validValues); + + if (!list.contains(s)) + { + warn("Invalid value: " + key + "=" + s); + warn("Expected values: " + Config.arrayToString((Object[])validValues)); + return valDef; + } + else + { + dbg("" + key + "=" + s); + return s; + } + } + } + } + catch (FileNotFoundException var9) + { + return valDef; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + return valDef; + } + } + + private static Pair parseLightMapPacks() + { + String s = "mcpatcher/lightmap/world"; + String s1 = ".png"; + String[] astring = ResUtils.collectFiles(s, s1); + Map map = new HashMap(); + + for (int i = 0; i < astring.length; ++i) + { + String s2 = astring[i]; + String s3 = StrUtils.removePrefixSuffix(s2, s, s1); + int j = Config.parseInt(s3, Integer.MIN_VALUE); + + if (j == Integer.MIN_VALUE) + { + warn("Invalid dimension ID: " + s3 + ", path: " + s2); + } + else + { + map.put(Integer.valueOf(j), s2); + } + } + + Set set = map.keySet(); + Integer[] ainteger = (Integer[])set.toArray(new Integer[set.size()]); + Arrays.sort((Object[])ainteger); + + if (ainteger.length <= 0) + { + return new ImmutablePair((Object)null, Integer.valueOf(0)); + } + else + { + int j1 = ainteger[0].intValue(); + int k1 = ainteger[ainteger.length - 1].intValue(); + int k = k1 - j1 + 1; + CustomColormap[] acustomcolormap = new CustomColormap[k]; + + for (int l = 0; l < ainteger.length; ++l) + { + Integer integer = ainteger[l]; + String s4 = (String)map.get(integer); + CustomColormap customcolormap = getCustomColors(s4, -1, -1); + + if (customcolormap != null) + { + if (customcolormap.getWidth() < 16) + { + warn("Invalid lightmap width: " + customcolormap.getWidth() + ", path: " + s4); + } + else + { + int i1 = integer.intValue() - j1; + acustomcolormap[i1] = customcolormap; + } + } + } + + LightMapPack[] alightmappack = new LightMapPack[acustomcolormap.length]; + + for (int l1 = 0; l1 < acustomcolormap.length; ++l1) + { + CustomColormap customcolormap3 = acustomcolormap[l1]; + + if (customcolormap3 != null) + { + String s5 = customcolormap3.name; + String s6 = customcolormap3.basePath; + CustomColormap customcolormap1 = getCustomColors(s6 + "/" + s5 + "_rain.png", -1, -1); + CustomColormap customcolormap2 = getCustomColors(s6 + "/" + s5 + "_thunder.png", -1, -1); + LightMap lightmap = new LightMap(customcolormap3); + LightMap lightmap1 = customcolormap1 != null ? new LightMap(customcolormap1) : null; + LightMap lightmap2 = customcolormap2 != null ? new LightMap(customcolormap2) : null; + LightMapPack lightmappack = new LightMapPack(lightmap, lightmap1, lightmap2); + alightmappack[l1] = lightmappack; + } + } + + return new ImmutablePair(alightmappack, Integer.valueOf(j1)); + } + } + + private static int getTextureHeight(String path, int defHeight) + { + try + { + InputStream inputstream = Config.getResourceStream(new ResourceLocation(path)); + + if (inputstream == null) + { + return defHeight; + } + else + { + BufferedImage bufferedimage = ImageIO.read(inputstream); + inputstream.close(); + return bufferedimage == null ? defHeight : bufferedimage.getHeight(); + } + } + catch (IOException var4) + { + return defHeight; + } + } + + private static void readColorProperties(String fileName) + { + try + { + ResourceLocation resourcelocation = new ResourceLocation(fileName); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return; + } + + dbg("Loading " + fileName); + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + particleWaterColor = readColor(properties, new String[] {"particle.water", "drop.water"}); + particlePortalColor = readColor(properties, "particle.portal"); + lilyPadColor = readColor(properties, "lilypad"); + expBarTextColor = readColor(properties, "text.xpbar"); + bossTextColor = readColor(properties, "text.boss"); + signTextColor = readColor(properties, "text.sign"); + fogColorNether = readColorVec3(properties, "fog.nether"); + fogColorEnd = readColorVec3(properties, "fog.end"); + skyColorEnd = readColorVec3(properties, "sky.end"); + colorsBlockColormaps = readCustomColormaps(properties, fileName); + spawnEggPrimaryColors = readSpawnEggColors(properties, fileName, "egg.shell.", "Spawn egg shell"); + spawnEggSecondaryColors = readSpawnEggColors(properties, fileName, "egg.spots.", "Spawn egg spot"); + wolfCollarColors = readDyeColors(properties, fileName, "collar.", "Wolf collar"); + sheepColors = readDyeColors(properties, fileName, "sheep.", "Sheep"); + textColors = readTextColors(properties, fileName, "text.code.", "Text"); + int[] aint = readMapColors(properties, fileName, "map.", "Map"); + + if (aint != null) + { + if (mapColorsOriginal == null) + { + mapColorsOriginal = getMapColors(); + } + + setMapColors(aint); + } + + potionColors = readPotionColors(properties, fileName, "potion.", "Potion"); + xpOrbTime = Config.parseInt(properties.getProperty("xporb.time"), -1); + } + catch (FileNotFoundException var5) + { + return; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + private static CustomColormap[] readCustomColormaps(Properties props, String fileName) + { + List list = new ArrayList(); + String s = "palette.block."; + Map map = new HashMap(); + + for (Object e : props.keySet()) + { + String s1 = (String) e; + String s2 = props.getProperty(s1); + + if (s1.startsWith(s)) + { + map.put(s1, s2); + } + } + + String[] astring = (String[])((String[])map.keySet().toArray(new String[map.size()])); + + for (int j = 0; j < astring.length; ++j) + { + String s6 = astring[j]; + String s3 = props.getProperty(s6); + dbg("Block palette: " + s6 + " = " + s3); + String s4 = s6.substring(s.length()); + String s5 = TextureUtils.getBasePath(fileName); + s4 = TextureUtils.fixResourcePath(s4, s5); + CustomColormap customcolormap = getCustomColors(s4, 256, 256); + + if (customcolormap == null) + { + warn("Colormap not found: " + s4); + } + else + { + ConnectedParser connectedparser = new ConnectedParser("CustomColors"); + MatchBlock[] amatchblock = connectedparser.parseMatchBlocks(s3); + + if (amatchblock != null && amatchblock.length > 0) + { + for (int i = 0; i < amatchblock.length; ++i) + { + MatchBlock matchblock = amatchblock[i]; + customcolormap.addMatchBlock(matchblock); + } + + list.add(customcolormap); + } + else + { + warn("Invalid match blocks: " + s3); + } + } + } + + if (list.size() <= 0) + { + return null; + } + else + { + CustomColormap[] acustomcolormap = (CustomColormap[])((CustomColormap[])list.toArray(new CustomColormap[list.size()])); + return acustomcolormap; + } + } + + private static CustomColormap[][] readBlockColormaps(String[] basePaths, CustomColormap[] basePalettes, int width, int height) + { + String[] astring = ResUtils.collectFiles(basePaths, new String[] {".properties"}); + Arrays.sort((Object[])astring); + List list = new ArrayList(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + dbg("Block colormap: " + s); + + try + { + ResourceLocation resourcelocation = new ResourceLocation("minecraft", s); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + warn("File not found: " + s); + } + else + { + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + CustomColormap customcolormap = new CustomColormap(properties, s, width, height, paletteFormatDefault); + + if (customcolormap.isValid(s) && customcolormap.isValidMatchBlocks(s)) + { + addToBlockList(customcolormap, list); + } + } + } + catch (FileNotFoundException var12) + { + warn("File not found: " + s); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + if (basePalettes != null) + { + for (int j = 0; j < basePalettes.length; ++j) + { + CustomColormap customcolormap1 = basePalettes[j]; + addToBlockList(customcolormap1, list); + } + } + + if (list.size() <= 0) + { + return (CustomColormap[][])null; + } + else + { + CustomColormap[][] acustomcolormap = blockListToArray(list); + return acustomcolormap; + } + } + + private static void addToBlockList(CustomColormap cm, List blockList) + { + int[] aint = cm.getMatchBlockIds(); + + if (aint != null && aint.length > 0) + { + for (int i = 0; i < aint.length; ++i) + { + int j = aint[i]; + + if (j < 0) + { + warn("Invalid block ID: " + j); + } + else + { + addToList(cm, blockList, j); + } + } + } + else + { + warn("No match blocks: " + Config.arrayToString(aint)); + } + } + + private static void addToList(CustomColormap cm, List list, int id) + { + while (id >= list.size()) + { + list.add(null); + } + + List list1 = (List)list.get(id); + + if (list1 == null) + { + list1 = new ArrayList(); + list.set(id, list1); + } + + list1.add(cm); + } + + private static CustomColormap[][] blockListToArray(List list) + { + CustomColormap[][] acustomcolormap = new CustomColormap[list.size()][]; + + for (int i = 0; i < list.size(); ++i) + { + List list1 = (List)list.get(i); + + if (list1 != null) + { + CustomColormap[] acustomcolormap1 = (CustomColormap[])((CustomColormap[])list1.toArray(new CustomColormap[list1.size()])); + acustomcolormap[i] = acustomcolormap1; + } + } + + return acustomcolormap; + } + + private static int readColor(Properties props, String[] names) + { + for (int i = 0; i < names.length; ++i) + { + String s = names[i]; + int j = readColor(props, s); + + if (j >= 0) + { + return j; + } + } + + return -1; + } + + private static int readColor(Properties props, String name) + { + String s = props.getProperty(name); + + if (s == null) + { + return -1; + } + else + { + s = s.trim(); + int i = parseColor(s); + + if (i < 0) + { + warn("Invalid color: " + name + " = " + s); + return i; + } + else + { + dbg(name + " = " + s); + return i; + } + } + } + + private static int parseColor(String str) + { + if (str == null) + { + return -1; + } + else + { + str = str.trim(); + + try + { + int i = Integer.parseInt(str, 16) & 16777215; + return i; + } + catch (NumberFormatException var2) + { + return -1; + } + } + } + + private static Vec3 readColorVec3(Properties props, String name) + { + int i = readColor(props, name); + + if (i < 0) + { + return null; + } + else + { + int j = i >> 16 & 255; + int k = i >> 8 & 255; + int l = i & 255; + float f = (float)j / 255.0F; + float f1 = (float)k / 255.0F; + float f2 = (float)l / 255.0F; + return new Vec3((double)f, (double)f1, (double)f2); + } + } + + private static CustomColormap getCustomColors(String basePath, String[] paths, int width, int height) + { + for (int i = 0; i < paths.length; ++i) + { + String s = paths[i]; + s = basePath + s; + CustomColormap customcolormap = getCustomColors(s, width, height); + + if (customcolormap != null) + { + return customcolormap; + } + } + + return null; + } + + public static CustomColormap getCustomColors(String pathImage, int width, int height) + { + try + { + ResourceLocation resourcelocation = new ResourceLocation(pathImage); + + if (!Config.hasResource(resourcelocation)) + { + return null; + } + else + { + dbg("Colormap " + pathImage); + Properties properties = new PropertiesOrdered(); + String s = StrUtils.replaceSuffix(pathImage, ".png", ".properties"); + ResourceLocation resourcelocation1 = new ResourceLocation(s); + + if (Config.hasResource(resourcelocation1)) + { + InputStream inputstream = Config.getResourceStream(resourcelocation1); + properties.load(inputstream); + inputstream.close(); + dbg("Colormap properties: " + s); + } + else + { + properties.put("format", paletteFormatDefault); + properties.put("source", pathImage); + s = pathImage; + } + + CustomColormap customcolormap = new CustomColormap(properties, s, width, height, paletteFormatDefault); + return !customcolormap.isValid(s) ? null : customcolormap; + } + } + catch (Exception exception) + { + exception.printStackTrace(); + return null; + } + } + + public static void updateUseDefaultGrassFoliageColors() + { + useDefaultGrassFoliageColors = foliageBirchColors == null && foliagePineColors == null && swampGrassColors == null && swampFoliageColors == null && Config.isSwampColors() && Config.isSmoothBiomes(); + } + + public static int getColorMultiplier(BakedQuad quad, IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos, RenderEnv renderEnv) + { + Block block = blockState.getBlock(); + IBlockState iblockstate = renderEnv.getBlockState(); + + if (blockColormaps != null) + { + if (!quad.hasTintIndex()) + { + if (block == Blocks.grass) + { + iblockstate = BLOCK_STATE_DIRT; + } + + if (block == Blocks.redstone_wire) + { + return -1; + } + } + + if (block == Blocks.double_plant && renderEnv.getMetadata() >= 8) + { + blockPos = blockPos.down(); + iblockstate = blockAccess.getBlockState(blockPos); + } + + CustomColormap customcolormap = getBlockColormap(iblockstate); + + if (customcolormap != null) + { + if (Config.isSmoothBiomes() && !customcolormap.isColorConstant()) + { + return getSmoothColorMultiplier(blockState, blockAccess, blockPos, customcolormap, renderEnv.getColorizerBlockPosM()); + } + + return customcolormap.getColor(blockAccess, blockPos); + } + } + + if (!quad.hasTintIndex()) + { + return -1; + } + else if (block == Blocks.waterlily) + { + return getLilypadColorMultiplier(blockAccess, blockPos); + } + else if (block == Blocks.redstone_wire) + { + return getRedstoneColor(renderEnv.getBlockState()); + } + else if (block instanceof BlockStem) + { + return getStemColorMultiplier(block, blockAccess, blockPos, renderEnv); + } + else if (useDefaultGrassFoliageColors) + { + return -1; + } + else + { + int i = renderEnv.getMetadata(); + CustomColors.IColorizer customcolors$icolorizer; + + if (block != Blocks.grass && block != Blocks.tallgrass && block != Blocks.double_plant) + { + if (block == Blocks.double_plant) + { + customcolors$icolorizer = COLORIZER_GRASS; + + if (i >= 8) + { + blockPos = blockPos.down(); + } + } + else if (block == Blocks.leaves) + { + switch (i & 3) + { + case 0: + customcolors$icolorizer = COLORIZER_FOLIAGE; + break; + + case 1: + customcolors$icolorizer = COLORIZER_FOLIAGE_PINE; + break; + + case 2: + customcolors$icolorizer = COLORIZER_FOLIAGE_BIRCH; + break; + + default: + customcolors$icolorizer = COLORIZER_FOLIAGE; + } + } + else if (block == Blocks.leaves2) + { + customcolors$icolorizer = COLORIZER_FOLIAGE; + } + else + { + if (block != Blocks.vine) + { + return -1; + } + + customcolors$icolorizer = COLORIZER_FOLIAGE; + } + } + else + { + customcolors$icolorizer = COLORIZER_GRASS; + } + + return Config.isSmoothBiomes() && !customcolors$icolorizer.isColorConstant() ? getSmoothColorMultiplier(blockState, blockAccess, blockPos, customcolors$icolorizer, renderEnv.getColorizerBlockPosM()) : customcolors$icolorizer.getColor(iblockstate, blockAccess, blockPos); + } + } + + protected static BiomeGenBase getColorBiome(IBlockAccess blockAccess, BlockPos blockPos) + { + BiomeGenBase biomegenbase = blockAccess.getBiomeGenForCoords(blockPos); + + if (biomegenbase == BiomeGenBase.swampland && !Config.isSwampColors()) + { + biomegenbase = BiomeGenBase.plains; + } + + return biomegenbase; + } + + private static CustomColormap getBlockColormap(IBlockState blockState) + { + if (blockColormaps == null) + { + return null; + } + else if (!(blockState instanceof BlockStateBase)) + { + return null; + } + else + { + BlockStateBase blockstatebase = (BlockStateBase)blockState; + int i = blockstatebase.getBlockId(); + + if (i >= 0 && i < blockColormaps.length) + { + CustomColormap[] acustomcolormap = blockColormaps[i]; + + if (acustomcolormap == null) + { + return null; + } + else + { + for (int j = 0; j < acustomcolormap.length; ++j) + { + CustomColormap customcolormap = acustomcolormap[j]; + + if (customcolormap.matchesBlock(blockstatebase)) + { + return customcolormap; + } + } + + return null; + } + } + else + { + return null; + } + } + } + + private static int getSmoothColorMultiplier(IBlockState blockState, IBlockAccess blockAccess, BlockPos blockPos, CustomColors.IColorizer colorizer, BlockPosM blockPosM) + { + int i = 0; + int j = 0; + int k = 0; + int l = blockPos.getX(); + int i1 = blockPos.getY(); + int j1 = blockPos.getZ(); + BlockPosM blockposm = blockPosM; + + for (int k1 = l - 1; k1 <= l + 1; ++k1) + { + for (int l1 = j1 - 1; l1 <= j1 + 1; ++l1) + { + blockposm.setXyz(k1, i1, l1); + int i2 = colorizer.getColor(blockState, blockAccess, blockposm); + i += i2 >> 16 & 255; + j += i2 >> 8 & 255; + k += i2 & 255; + } + } + + int j2 = i / 9; + int k2 = j / 9; + int l2 = k / 9; + return j2 << 16 | k2 << 8 | l2; + } + + public static int getFluidColor(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, RenderEnv renderEnv) + { + Block block = blockState.getBlock(); + CustomColors.IColorizer customcolors$icolorizer = getBlockColormap(blockState); + + if (customcolors$icolorizer == null && blockState.getBlock().getMaterial() == Material.water) + { + customcolors$icolorizer = COLORIZER_WATER; + } + + return customcolors$icolorizer == null ? block.colorMultiplier(blockAccess, blockPos, 0) : (Config.isSmoothBiomes() && !customcolors$icolorizer.isColorConstant() ? getSmoothColorMultiplier(blockState, blockAccess, blockPos, customcolors$icolorizer, renderEnv.getColorizerBlockPosM()) : customcolors$icolorizer.getColor(blockState, blockAccess, blockPos)); + } + + public static void updatePortalFX(EntityFX fx) + { + if (particlePortalColor >= 0) + { + int i = particlePortalColor; + int j = i >> 16 & 255; + int k = i >> 8 & 255; + int l = i & 255; + float f = (float)j / 255.0F; + float f1 = (float)k / 255.0F; + float f2 = (float)l / 255.0F; + fx.setRBGColorF(f, f1, f2); + } + } + + public static void updateMyceliumFX(EntityFX fx) + { + if (myceliumParticleColors != null) + { + int i = myceliumParticleColors.getColorRandom(); + int j = i >> 16 & 255; + int k = i >> 8 & 255; + int l = i & 255; + float f = (float)j / 255.0F; + float f1 = (float)k / 255.0F; + float f2 = (float)l / 255.0F; + fx.setRBGColorF(f, f1, f2); + } + } + + private static int getRedstoneColor(IBlockState blockState) + { + if (redstoneColors == null) + { + return -1; + } + else + { + int i = getRedstoneLevel(blockState, 15); + int j = redstoneColors.getColor(i); + return j; + } + } + + public static void updateReddustFX(EntityFX fx, IBlockAccess blockAccess, double x, double y, double z) + { + if (redstoneColors != null) + { + IBlockState iblockstate = blockAccess.getBlockState(new BlockPos(x, y, z)); + int i = getRedstoneLevel(iblockstate, 15); + int j = redstoneColors.getColor(i); + int k = j >> 16 & 255; + int l = j >> 8 & 255; + int i1 = j & 255; + float f = (float)k / 255.0F; + float f1 = (float)l / 255.0F; + float f2 = (float)i1 / 255.0F; + fx.setRBGColorF(f, f1, f2); + } + } + + private static int getRedstoneLevel(IBlockState state, int def) + { + Block block = state.getBlock(); + + if (!(block instanceof BlockRedstoneWire)) + { + return def; + } + else + { + Object object = state.getValue(BlockRedstoneWire.POWER); + + if (!(object instanceof Integer)) + { + return def; + } + else + { + Integer integer = (Integer)object; + return integer.intValue(); + } + } + } + + public static float getXpOrbTimer(float timer) + { + if (xpOrbTime <= 0) + { + return timer; + } + else + { + float f = 628.0F / (float)xpOrbTime; + return timer * f; + } + } + + public static int getXpOrbColor(float timer) + { + if (xpOrbColors == null) + { + return -1; + } + else + { + int i = (int)Math.round((double)((MathHelper.sin(timer) + 1.0F) * (float)(xpOrbColors.getLength() - 1)) / 2.0D); + int j = xpOrbColors.getColor(i); + return j; + } + } + + public static int getDurabilityColor(int dur255) + { + if (durabilityColors == null) + { + return -1; + } + else + { + int i = dur255 * durabilityColors.getLength() / 255; + int j = durabilityColors.getColor(i); + return j; + } + } + + public static void updateWaterFX(EntityFX fx, IBlockAccess blockAccess, double x, double y, double z, RenderEnv renderEnv) + { + if (waterColors != null || blockColormaps != null || particleWaterColor >= 0) + { + BlockPos blockpos = new BlockPos(x, y, z); + renderEnv.reset(BLOCK_STATE_WATER, blockpos); + int i = getFluidColor(blockAccess, BLOCK_STATE_WATER, blockpos, renderEnv); + int j = i >> 16 & 255; + int k = i >> 8 & 255; + int l = i & 255; + float f = (float)j / 255.0F; + float f1 = (float)k / 255.0F; + float f2 = (float)l / 255.0F; + + if (particleWaterColor >= 0) + { + int i1 = particleWaterColor >> 16 & 255; + int j1 = particleWaterColor >> 8 & 255; + int k1 = particleWaterColor & 255; + f *= (float)i1 / 255.0F; + f1 *= (float)j1 / 255.0F; + f2 *= (float)k1 / 255.0F; + } + + fx.setRBGColorF(f, f1, f2); + } + } + + private static int getLilypadColorMultiplier(IBlockAccess blockAccess, BlockPos blockPos) + { + return lilyPadColor < 0 ? Blocks.waterlily.colorMultiplier(blockAccess, blockPos) : lilyPadColor; + } + + private static Vec3 getFogColorNether(Vec3 col) + { + return fogColorNether == null ? col : fogColorNether; + } + + private static Vec3 getFogColorEnd(Vec3 col) + { + return fogColorEnd == null ? col : fogColorEnd; + } + + private static Vec3 getSkyColorEnd(Vec3 col) + { + return skyColorEnd == null ? col : skyColorEnd; + } + + public static Vec3 getSkyColor(Vec3 skyColor3d, IBlockAccess blockAccess, double x, double y, double z) + { + if (skyColors == null) + { + return skyColor3d; + } + else + { + int i = skyColors.getColorSmooth(blockAccess, x, y, z, 3); + int j = i >> 16 & 255; + int k = i >> 8 & 255; + int l = i & 255; + float f = (float)j / 255.0F; + float f1 = (float)k / 255.0F; + float f2 = (float)l / 255.0F; + float f3 = (float)skyColor3d.xCoord / 0.5F; + float f4 = (float)skyColor3d.yCoord / 0.66275F; + float f5 = (float)skyColor3d.zCoord; + f = f * f3; + f1 = f1 * f4; + f2 = f2 * f5; + Vec3 vec3 = skyColorFader.getColor((double)f, (double)f1, (double)f2); + return vec3; + } + } + + private static Vec3 getFogColor(Vec3 fogColor3d, IBlockAccess blockAccess, double x, double y, double z) + { + if (fogColors == null) + { + return fogColor3d; + } + else + { + int i = fogColors.getColorSmooth(blockAccess, x, y, z, 3); + int j = i >> 16 & 255; + int k = i >> 8 & 255; + int l = i & 255; + float f = (float)j / 255.0F; + float f1 = (float)k / 255.0F; + float f2 = (float)l / 255.0F; + float f3 = (float)fogColor3d.xCoord / 0.753F; + float f4 = (float)fogColor3d.yCoord / 0.8471F; + float f5 = (float)fogColor3d.zCoord; + f = f * f3; + f1 = f1 * f4; + f2 = f2 * f5; + Vec3 vec3 = fogColorFader.getColor((double)f, (double)f1, (double)f2); + return vec3; + } + } + + public static Vec3 getUnderwaterColor(IBlockAccess blockAccess, double x, double y, double z) + { + return getUnderFluidColor(blockAccess, x, y, z, underwaterColors, underwaterColorFader); + } + + public static Vec3 getUnderlavaColor(IBlockAccess blockAccess, double x, double y, double z) + { + return getUnderFluidColor(blockAccess, x, y, z, underlavaColors, underlavaColorFader); + } + + public static Vec3 getUnderFluidColor(IBlockAccess blockAccess, double x, double y, double z, CustomColormap underFluidColors, CustomColorFader underFluidColorFader) + { + if (underFluidColors == null) + { + return null; + } + else + { + int i = underFluidColors.getColorSmooth(blockAccess, x, y, z, 3); + int j = i >> 16 & 255; + int k = i >> 8 & 255; + int l = i & 255; + float f = (float)j / 255.0F; + float f1 = (float)k / 255.0F; + float f2 = (float)l / 255.0F; + Vec3 vec3 = underFluidColorFader.getColor((double)f, (double)f1, (double)f2); + return vec3; + } + } + + private static int getStemColorMultiplier(Block blockStem, IBlockAccess blockAccess, BlockPos blockPos, RenderEnv renderEnv) + { + CustomColormap customcolormap = stemColors; + + if (blockStem == Blocks.pumpkin_stem && stemPumpkinColors != null) + { + customcolormap = stemPumpkinColors; + } + + if (blockStem == Blocks.melon_stem && stemMelonColors != null) + { + customcolormap = stemMelonColors; + } + + if (customcolormap == null) + { + return -1; + } + else + { + int i = renderEnv.getMetadata(); + return customcolormap.getColor(i); + } + } + + public static boolean updateLightmap(World world, float torchFlickerX, int[] lmColors, boolean nightvision, float partialTicks) + { + if (world == null) + { + return false; + } + else if (lightMapPacks == null) + { + return false; + } else if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().enableFpsBoost.getValue() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().fullBright.getValue()) { + return false; + } + else + { + int i = world.provider.getDimensionId(); + int j = i - lightmapMinDimensionId; + + if (j >= 0 && j < lightMapPacks.length) + { + LightMapPack lightmappack = lightMapPacks[j]; + return lightmappack != null && lightmappack.updateLightmap(world, torchFlickerX, lmColors, nightvision, partialTicks); + } + else + { + return false; + } + } + } + + public static Vec3 getWorldFogColor(Vec3 fogVec, World world, Entity renderViewEntity, float partialTicks) + { + int i = world.provider.getDimensionId(); + + switch (i) + { + case -1: + fogVec = getFogColorNether(fogVec); + break; + + case 0: + Minecraft minecraft = Minecraft.getMinecraft(); + fogVec = getFogColor(fogVec, minecraft.theWorld, renderViewEntity.posX, renderViewEntity.posY + 1.0D, renderViewEntity.posZ); + break; + + case 1: + fogVec = getFogColorEnd(fogVec); + } + + return fogVec; + } + + public static Vec3 getWorldSkyColor(Vec3 skyVec, World world, Entity renderViewEntity, float partialTicks) + { + int i = world.provider.getDimensionId(); + + switch (i) + { + case 0: + Minecraft minecraft = Minecraft.getMinecraft(); + skyVec = getSkyColor(skyVec, minecraft.theWorld, renderViewEntity.posX, renderViewEntity.posY + 1.0D, renderViewEntity.posZ); + break; + + case 1: + skyVec = getSkyColorEnd(skyVec); + } + + return skyVec; + } + + private static int[] readSpawnEggColors(Properties props, String fileName, String prefix, String logName) + { + List list = new ArrayList(); + Set set = props.keySet(); + int i = 0; + + for (Object e : set) + { + String s = (String) e; + String s1 = props.getProperty(s); + + if (s.startsWith(prefix)) + { + String s2 = StrUtils.removePrefix(s, prefix); + int j = EntityUtils.getEntityIdByName(s2); + + if (j < 0) + { + warn("Invalid spawn egg name: " + s); + } + else + { + int k = parseColor(s1); + + if (k < 0) + { + warn("Invalid spawn egg color: " + s + " = " + s1); + } + else + { + while (((List)list).size() <= j) + { + list.add(Integer.valueOf(-1)); + } + + list.set(j, Integer.valueOf(k)); + ++i; + } + } + } + } + + if (i <= 0) + { + return null; + } + else + { + dbg(logName + " colors: " + i); + int[] aint = new int[list.size()]; + + for (int l = 0; l < aint.length; ++l) + { + aint[l] = ((Integer)list.get(l)).intValue(); + } + + return aint; + } + } + + private static int getSpawnEggColor(ItemMonsterPlacer item, ItemStack itemStack, int layer, int color) + { + int i = itemStack.getMetadata(); + int[] aint = layer == 0 ? spawnEggPrimaryColors : spawnEggSecondaryColors; + + if (aint == null) + { + return color; + } + else if (i >= 0 && i < aint.length) + { + int j = aint[i]; + return j < 0 ? color : j; + } + else + { + return color; + } + } + + public static int getColorFromItemStack(ItemStack itemStack, int layer, int color) + { + if (itemStack == null) + { + return color; + } + else + { + Item item = itemStack.getItem(); + return item == null ? color : (item instanceof ItemMonsterPlacer ? getSpawnEggColor((ItemMonsterPlacer)item, itemStack, layer, color) : color); + } + } + + private static float[][] readDyeColors(Properties props, String fileName, String prefix, String logName) + { + EnumDyeColor[] aenumdyecolor = EnumDyeColor.values(); + Map map = new HashMap(); + + for (int i = 0; i < aenumdyecolor.length; ++i) + { + EnumDyeColor enumdyecolor = aenumdyecolor[i]; + map.put(enumdyecolor.getName(), enumdyecolor); + } + + float[][] afloat1 = new float[aenumdyecolor.length][]; + int k = 0; + + for (Object e : props.keySet()) + { + String s = (String) e; + String s1 = props.getProperty(s); + + if (s.startsWith(prefix)) + { + String s2 = StrUtils.removePrefix(s, prefix); + + if (s2.equals("lightBlue")) + { + s2 = "light_blue"; + } + + EnumDyeColor enumdyecolor1 = (EnumDyeColor)map.get(s2); + int j = parseColor(s1); + + if (enumdyecolor1 != null && j >= 0) + { + float[] afloat = new float[] {(float)(j >> 16 & 255) / 255.0F, (float)(j >> 8 & 255) / 255.0F, (float)(j & 255) / 255.0F}; + afloat1[enumdyecolor1.ordinal()] = afloat; + ++k; + } + else + { + warn("Invalid color: " + s + " = " + s1); + } + } + } + + if (k <= 0) + { + return (float[][])null; + } + else + { + dbg(logName + " colors: " + k); + return afloat1; + } + } + + private static float[] getDyeColors(EnumDyeColor dye, float[][] dyeColors, float[] colors) + { + if (dyeColors == null) + { + return colors; + } + else if (dye == null) + { + return colors; + } + else + { + float[] afloat = dyeColors[dye.ordinal()]; + return afloat == null ? colors : afloat; + } + } + + public static float[] getWolfCollarColors(EnumDyeColor dye, float[] colors) + { + return getDyeColors(dye, wolfCollarColors, colors); + } + + public static float[] getSheepColors(EnumDyeColor dye, float[] colors) + { + return getDyeColors(dye, sheepColors, colors); + } + + private static int[] readTextColors(Properties props, String fileName, String prefix, String logName) + { + int[] aint = new int[32]; + Arrays.fill((int[])aint, (int) - 1); + int i = 0; + + for (Object e: props.keySet()) + { + String s = (String) e; + String s1 = props.getProperty(s); + + if (s.startsWith(prefix)) + { + String s2 = StrUtils.removePrefix(s, prefix); + int j = Config.parseInt(s2, -1); + int k = parseColor(s1); + + if (j >= 0 && j < aint.length && k >= 0) + { + aint[j] = k; + ++i; + } + else + { + warn("Invalid color: " + s + " = " + s1); + } + } + } + + if (i <= 0) + { + return null; + } + else + { + dbg(logName + " colors: " + i); + return aint; + } + } + + public static int getTextColor(int index, int color) + { + if (textColors == null) + { + return color; + } + else if (index >= 0 && index < textColors.length) + { + int i = textColors[index]; + return i < 0 ? color : i; + } + else + { + return color; + } + } + + private static int[] readMapColors(Properties props, String fileName, String prefix, String logName) + { + int[] aint = new int[MapColor.mapColorArray.length]; + Arrays.fill((int[])aint, (int) - 1); + int i = 0; + + for (Object o : props.keySet()) + { + String s = (String)o; + String s1 = props.getProperty(s); + + if (s.startsWith(prefix)) + { + String s2 = StrUtils.removePrefix(s, prefix); + int j = getMapColorIndex(s2); + int k = parseColor(s1); + + if (j >= 0 && j < aint.length && k >= 0) + { + aint[j] = k; + ++i; + } + else + { + warn("Invalid color: " + s + " = " + s1); + } + } + } + + if (i <= 0) + { + return null; + } + else + { + dbg(logName + " colors: " + i); + return aint; + } + } + + private static int[] readPotionColors(Properties props, String fileName, String prefix, String logName) + { + int[] aint = new int[Potion.potionTypes.length]; + Arrays.fill((int[])aint, (int) - 1); + int i = 0; + + for (Object e : props.keySet()) + { + String s = (String) e; + String s1 = props.getProperty(s); + + if (s.startsWith(prefix)) + { + int j = getPotionId(s); + int k = parseColor(s1); + + if (j >= 0 && j < aint.length && k >= 0) + { + aint[j] = k; + ++i; + } + else + { + warn("Invalid color: " + s + " = " + s1); + } + } + } + + if (i <= 0) + { + return null; + } + else + { + dbg(logName + " colors: " + i); + return aint; + } + } + + private static int getPotionId(String name) + { + if (name.equals("potion.water")) + { + return 0; + } + else + { + Potion[] apotion = Potion.potionTypes; + + for (int i = 0; i < apotion.length; ++i) + { + Potion potion = apotion[i]; + + if (potion != null && potion.getName().equals(name)) + { + return potion.getId(); + } + } + + return -1; + } + } + + public static int getPotionColor(int potionId, int color) + { + if (potionColors == null) + { + return color; + } + else if (potionId >= 0 && potionId < potionColors.length) + { + int i = potionColors[potionId]; + return i < 0 ? color : i; + } + else + { + return color; + } + } + + private static int getMapColorIndex(String name) + { + return name == null ? -1 : (name.equals("air") ? MapColor.airColor.colorIndex : (name.equals("grass") ? MapColor.grassColor.colorIndex : (name.equals("sand") ? MapColor.sandColor.colorIndex : (name.equals("cloth") ? MapColor.clothColor.colorIndex : (name.equals("tnt") ? MapColor.tntColor.colorIndex : (name.equals("ice") ? MapColor.iceColor.colorIndex : (name.equals("iron") ? MapColor.ironColor.colorIndex : (name.equals("foliage") ? MapColor.foliageColor.colorIndex : (name.equals("clay") ? MapColor.clayColor.colorIndex : (name.equals("dirt") ? MapColor.dirtColor.colorIndex : (name.equals("stone") ? MapColor.stoneColor.colorIndex : (name.equals("water") ? MapColor.waterColor.colorIndex : (name.equals("wood") ? MapColor.woodColor.colorIndex : (name.equals("quartz") ? MapColor.quartzColor.colorIndex : (name.equals("gold") ? MapColor.goldColor.colorIndex : (name.equals("diamond") ? MapColor.diamondColor.colorIndex : (name.equals("lapis") ? MapColor.lapisColor.colorIndex : (name.equals("emerald") ? MapColor.emeraldColor.colorIndex : (name.equals("podzol") ? MapColor.obsidianColor.colorIndex : (name.equals("netherrack") ? MapColor.netherrackColor.colorIndex : (!name.equals("snow") && !name.equals("white") ? (!name.equals("adobe") && !name.equals("orange") ? (name.equals("magenta") ? MapColor.magentaColor.colorIndex : (!name.equals("light_blue") && !name.equals("lightBlue") ? (name.equals("yellow") ? MapColor.yellowColor.colorIndex : (name.equals("lime") ? MapColor.limeColor.colorIndex : (name.equals("pink") ? MapColor.pinkColor.colorIndex : (name.equals("gray") ? MapColor.grayColor.colorIndex : (name.equals("silver") ? MapColor.silverColor.colorIndex : (name.equals("cyan") ? MapColor.cyanColor.colorIndex : (name.equals("purple") ? MapColor.purpleColor.colorIndex : (name.equals("blue") ? MapColor.blueColor.colorIndex : (name.equals("brown") ? MapColor.brownColor.colorIndex : (name.equals("green") ? MapColor.greenColor.colorIndex : (name.equals("red") ? MapColor.redColor.colorIndex : (name.equals("black") ? MapColor.blackColor.colorIndex : -1)))))))))))) : MapColor.lightBlueColor.colorIndex)) : MapColor.adobeColor.colorIndex) : MapColor.snowColor.colorIndex))))))))))))))))))))); + } + + private static int[] getMapColors() + { + MapColor[] amapcolor = MapColor.mapColorArray; + int[] aint = new int[amapcolor.length]; + Arrays.fill((int[])aint, (int) - 1); + + for (int i = 0; i < amapcolor.length && i < aint.length; ++i) + { + MapColor mapcolor = amapcolor[i]; + + if (mapcolor != null) + { + aint[i] = mapcolor.colorValue; + } + } + + return aint; + } + + private static void setMapColors(int[] colors) + { + if (colors != null) + { + MapColor[] amapcolor = MapColor.mapColorArray; + boolean flag = false; + + for (int i = 0; i < amapcolor.length && i < colors.length; ++i) + { + MapColor mapcolor = amapcolor[i]; + + if (mapcolor != null) + { + int j = colors[i]; + + if (j >= 0 && mapcolor.colorValue != j) + { + mapcolor.colorValue = j; + flag = true; + } + } + } + + if (flag) + { + Minecraft.getMinecraft().getTextureManager().reloadBannerTextures(); + } + } + } + + private static void dbg(String str) + { + Config.dbg("CustomColors: " + str); + } + + private static void warn(String str) + { + Config.warn("CustomColors: " + str); + } + + public static int getExpBarTextColor(int color) + { + return expBarTextColor < 0 ? color : expBarTextColor; + } + + public static int getBossTextColor(int color) + { + return bossTextColor < 0 ? color : bossTextColor; + } + + public static int getSignTextColor(int color) + { + return signTextColor < 0 ? color : signTextColor; + } + + public interface IColorizer + { + int getColor(IBlockState var1, IBlockAccess var2, BlockPos var3); + + boolean isColorConstant(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomGuiProperties.java b/Client-1.8.9/src/main/java/net/optifine/CustomGuiProperties.java new file mode 100644 index 0000000..d9ac1e5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomGuiProperties.java @@ -0,0 +1,663 @@ +package net.optifine; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import net.minecraft.client.gui.GuiEnchantment; +import net.minecraft.client.gui.GuiHopper; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.inventory.GuiBeacon; +import net.minecraft.client.gui.inventory.GuiBrewingStand; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.gui.inventory.GuiDispenser; +import net.minecraft.client.gui.inventory.GuiFurnace; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.IWorldNameable; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.config.ConnectedParser; +import net.optifine.config.Matches; +import net.optifine.config.NbtTagValue; +import net.optifine.config.RangeListInt; +import net.optifine.config.VillagerProfession; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorField; +import net.optifine.util.StrUtils; +import net.optifine.util.TextureUtils; + +public class CustomGuiProperties +{ + private String fileName = null; + private String basePath = null; + private CustomGuiProperties.EnumContainer container = null; + private Map textureLocations = null; + private NbtTagValue nbtName = null; + private BiomeGenBase[] biomes = null; + private RangeListInt heights = null; + private Boolean large = null; + private Boolean trapped = null; + private Boolean christmas = null; + private Boolean ender = null; + private RangeListInt levels = null; + private VillagerProfession[] professions = null; + private CustomGuiProperties.EnumVariant[] variants = null; + private EnumDyeColor[] colors = null; + private static final CustomGuiProperties.EnumVariant[] VARIANTS_HORSE = new CustomGuiProperties.EnumVariant[] {CustomGuiProperties.EnumVariant.HORSE, CustomGuiProperties.EnumVariant.DONKEY, CustomGuiProperties.EnumVariant.MULE, CustomGuiProperties.EnumVariant.LLAMA}; + private static final CustomGuiProperties.EnumVariant[] VARIANTS_DISPENSER = new CustomGuiProperties.EnumVariant[] {CustomGuiProperties.EnumVariant.DISPENSER, CustomGuiProperties.EnumVariant.DROPPER}; + private static final CustomGuiProperties.EnumVariant[] VARIANTS_INVALID = new CustomGuiProperties.EnumVariant[0]; + private static final EnumDyeColor[] COLORS_INVALID = new EnumDyeColor[0]; + private static final ResourceLocation ANVIL_GUI_TEXTURE = new ResourceLocation("textures/gui/container/anvil.png"); + private static final ResourceLocation BEACON_GUI_TEXTURE = new ResourceLocation("textures/gui/container/beacon.png"); + private static final ResourceLocation BREWING_STAND_GUI_TEXTURE = new ResourceLocation("textures/gui/container/brewing_stand.png"); + private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("textures/gui/container/generic_54.png"); + private static final ResourceLocation CRAFTING_TABLE_GUI_TEXTURE = new ResourceLocation("textures/gui/container/crafting_table.png"); + private static final ResourceLocation HORSE_GUI_TEXTURE = new ResourceLocation("textures/gui/container/horse.png"); + private static final ResourceLocation DISPENSER_GUI_TEXTURE = new ResourceLocation("textures/gui/container/dispenser.png"); + private static final ResourceLocation ENCHANTMENT_TABLE_GUI_TEXTURE = new ResourceLocation("textures/gui/container/enchanting_table.png"); + private static final ResourceLocation FURNACE_GUI_TEXTURE = new ResourceLocation("textures/gui/container/furnace.png"); + private static final ResourceLocation HOPPER_GUI_TEXTURE = new ResourceLocation("textures/gui/container/hopper.png"); + private static final ResourceLocation INVENTORY_GUI_TEXTURE = new ResourceLocation("textures/gui/container/inventory.png"); + private static final ResourceLocation SHULKER_BOX_GUI_TEXTURE = new ResourceLocation("textures/gui/container/shulker_box.png"); + private static final ResourceLocation VILLAGER_GUI_TEXTURE = new ResourceLocation("textures/gui/container/villager.png"); + + public CustomGuiProperties(Properties props, String path) + { + ConnectedParser connectedparser = new ConnectedParser("CustomGuis"); + this.fileName = connectedparser.parseName(path); + this.basePath = connectedparser.parseBasePath(path); + this.container = (CustomGuiProperties.EnumContainer)connectedparser.parseEnum(props.getProperty("container"), CustomGuiProperties.EnumContainer.values(), "container"); + this.textureLocations = parseTextureLocations(props, "texture", this.container, "textures/gui/", this.basePath); + this.nbtName = connectedparser.parseNbtTagValue("name", props.getProperty("name")); + this.biomes = connectedparser.parseBiomes(props.getProperty("biomes")); + this.heights = connectedparser.parseRangeListInt(props.getProperty("heights")); + this.large = connectedparser.parseBooleanObject(props.getProperty("large")); + this.trapped = connectedparser.parseBooleanObject(props.getProperty("trapped")); + this.christmas = connectedparser.parseBooleanObject(props.getProperty("christmas")); + this.ender = connectedparser.parseBooleanObject(props.getProperty("ender")); + this.levels = connectedparser.parseRangeListInt(props.getProperty("levels")); + this.professions = connectedparser.parseProfessions(props.getProperty("professions")); + CustomGuiProperties.EnumVariant[] acustomguiproperties$enumvariant = getContainerVariants(this.container); + this.variants = (CustomGuiProperties.EnumVariant[])((CustomGuiProperties.EnumVariant[])connectedparser.parseEnums(props.getProperty("variants"), acustomguiproperties$enumvariant, "variants", VARIANTS_INVALID)); + this.colors = parseEnumDyeColors(props.getProperty("colors")); + } + + private static CustomGuiProperties.EnumVariant[] getContainerVariants(CustomGuiProperties.EnumContainer cont) + { + return cont == CustomGuiProperties.EnumContainer.HORSE ? VARIANTS_HORSE : (cont == CustomGuiProperties.EnumContainer.DISPENSER ? VARIANTS_DISPENSER : new CustomGuiProperties.EnumVariant[0]); + } + + private static EnumDyeColor[] parseEnumDyeColors(String str) + { + if (str == null) + { + return null; + } + else + { + str = str.toLowerCase(); + String[] astring = Config.tokenize(str, " "); + EnumDyeColor[] aenumdyecolor = new EnumDyeColor[astring.length]; + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + EnumDyeColor enumdyecolor = parseEnumDyeColor(s); + + if (enumdyecolor == null) + { + warn("Invalid color: " + s); + return COLORS_INVALID; + } + + aenumdyecolor[i] = enumdyecolor; + } + + return aenumdyecolor; + } + } + + private static EnumDyeColor parseEnumDyeColor(String str) + { + if (str == null) + { + return null; + } + else + { + EnumDyeColor[] aenumdyecolor = EnumDyeColor.values(); + + for (int i = 0; i < aenumdyecolor.length; ++i) + { + EnumDyeColor enumdyecolor = aenumdyecolor[i]; + + if (enumdyecolor.getName().equals(str)) + { + return enumdyecolor; + } + + if (enumdyecolor.getUnlocalizedName().equals(str)) + { + return enumdyecolor; + } + } + + return null; + } + } + + private static ResourceLocation parseTextureLocation(String str, String basePath) + { + if (str == null) + { + return null; + } + else + { + str = str.trim(); + String s = TextureUtils.fixResourcePath(str, basePath); + + if (!s.endsWith(".png")) + { + s = s + ".png"; + } + + return new ResourceLocation(basePath + "/" + s); + } + } + + private static Map parseTextureLocations(Properties props, String property, CustomGuiProperties.EnumContainer container, String pathPrefix, String basePath) + { + Map map = new HashMap(); + String s = props.getProperty(property); + + if (s != null) + { + ResourceLocation resourcelocation = getGuiTextureLocation(container); + ResourceLocation resourcelocation1 = parseTextureLocation(s, basePath); + + if (resourcelocation != null && resourcelocation1 != null) + { + map.put(resourcelocation, resourcelocation1); + } + } + + String s5 = property + "."; + + for (Object s10 : props.keySet()) + { + String s1 = (String) s10; + if (s1.startsWith(s5)) + { + String s2 = s1.substring(s5.length()); + s2 = s2.replace('\\', '/'); + s2 = StrUtils.removePrefixSuffix(s2, "/", ".png"); + String s3 = pathPrefix + s2 + ".png"; + String s4 = props.getProperty(s1); + ResourceLocation resourcelocation2 = new ResourceLocation(s3); + ResourceLocation resourcelocation3 = parseTextureLocation(s4, basePath); + map.put(resourcelocation2, resourcelocation3); + } + } + + return map; + } + + private static ResourceLocation getGuiTextureLocation(CustomGuiProperties.EnumContainer container) + { + if (container == null) + { + return null; + } + else + { + switch (container) + { + case ANVIL: + return ANVIL_GUI_TEXTURE; + + case BEACON: + return BEACON_GUI_TEXTURE; + + case BREWING_STAND: + return BREWING_STAND_GUI_TEXTURE; + + case CHEST: + return CHEST_GUI_TEXTURE; + + case CRAFTING: + return CRAFTING_TABLE_GUI_TEXTURE; + + case CREATIVE: + return null; + + case DISPENSER: + return DISPENSER_GUI_TEXTURE; + + case ENCHANTMENT: + return ENCHANTMENT_TABLE_GUI_TEXTURE; + + case FURNACE: + return FURNACE_GUI_TEXTURE; + + case HOPPER: + return HOPPER_GUI_TEXTURE; + + case HORSE: + return HORSE_GUI_TEXTURE; + + case INVENTORY: + return INVENTORY_GUI_TEXTURE; + + case SHULKER_BOX: + return SHULKER_BOX_GUI_TEXTURE; + + case VILLAGER: + return VILLAGER_GUI_TEXTURE; + + default: + return null; + } + } + } + + public boolean isValid(String path) + { + if (this.fileName != null && this.fileName.length() > 0) + { + if (this.basePath == null) + { + warn("No base path found: " + path); + return false; + } + else if (this.container == null) + { + warn("No container found: " + path); + return false; + } + else if (this.textureLocations.isEmpty()) + { + warn("No texture found: " + path); + return false; + } + else if (this.professions == ConnectedParser.PROFESSIONS_INVALID) + { + warn("Invalid professions or careers: " + path); + return false; + } + else if (this.variants == VARIANTS_INVALID) + { + warn("Invalid variants: " + path); + return false; + } + else if (this.colors == COLORS_INVALID) + { + warn("Invalid colors: " + path); + return false; + } + else + { + return true; + } + } + else + { + warn("No name found: " + path); + return false; + } + } + + private static void warn(String str) + { + Config.warn("[CustomGuis] " + str); + } + + private boolean matchesGeneral(CustomGuiProperties.EnumContainer ec, BlockPos pos, IBlockAccess blockAccess) + { + if (this.container != ec) + { + return false; + } + else + { + if (this.biomes != null) + { + BiomeGenBase biomegenbase = blockAccess.getBiomeGenForCoords(pos); + + if (!Matches.biome(biomegenbase, this.biomes)) + { + return false; + } + } + + return this.heights == null || this.heights.isInRange(pos.getY()); + } + } + + public boolean matchesPos(CustomGuiProperties.EnumContainer ec, BlockPos pos, IBlockAccess blockAccess, GuiScreen screen) + { + if (!this.matchesGeneral(ec, pos, blockAccess)) + { + return false; + } + else + { + if (this.nbtName != null) + { + String s = getName(screen); + + if (!this.nbtName.matchesValue(s)) + { + return false; + } + } + + switch (ec) + { + case BEACON: + return this.matchesBeacon(pos, blockAccess); + + case CHEST: + return this.matchesChest(pos, blockAccess); + + case DISPENSER: + return this.matchesDispenser(pos, blockAccess); + + default: + return true; + } + } + } + + public static String getName(GuiScreen screen) + { + IWorldNameable iworldnameable = getWorldNameable(screen); + return iworldnameable == null ? null : iworldnameable.getDisplayName().getUnformattedText(); + } + + private static IWorldNameable getWorldNameable(GuiScreen screen) + { + return (IWorldNameable)(screen instanceof GuiBeacon ? getWorldNameable(screen, Reflector.GuiBeacon_tileBeacon) : (screen instanceof GuiBrewingStand ? getWorldNameable(screen, Reflector.GuiBrewingStand_tileBrewingStand) : (screen instanceof GuiChest ? getWorldNameable(screen, Reflector.GuiChest_lowerChestInventory) : (screen instanceof GuiDispenser ? ((GuiDispenser)screen).dispenserInventory : (screen instanceof GuiEnchantment ? getWorldNameable(screen, Reflector.GuiEnchantment_nameable) : (screen instanceof GuiFurnace ? getWorldNameable(screen, Reflector.GuiFurnace_tileFurnace) : (screen instanceof GuiHopper ? getWorldNameable(screen, Reflector.GuiHopper_hopperInventory) : null))))))); + } + + private static IWorldNameable getWorldNameable(GuiScreen screen, ReflectorField fieldInventory) + { + Object object = Reflector.getFieldValue(screen, fieldInventory); + return !(object instanceof IWorldNameable) ? null : (IWorldNameable)object; + } + + private boolean matchesBeacon(BlockPos pos, IBlockAccess blockAccess) + { + TileEntity tileentity = blockAccess.getTileEntity(pos); + + if (!(tileentity instanceof TileEntityBeacon)) + { + return false; + } + else + { + TileEntityBeacon tileentitybeacon = (TileEntityBeacon)tileentity; + + if (this.levels != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentitybeacon.writeToNBT(nbttagcompound); + int i = nbttagcompound.getInteger("Levels"); + + if (!this.levels.isInRange(i)) + { + return false; + } + } + + return true; + } + } + + private boolean matchesChest(BlockPos pos, IBlockAccess blockAccess) + { + TileEntity tileentity = blockAccess.getTileEntity(pos); + + if (tileentity instanceof TileEntityChest) + { + TileEntityChest tileentitychest = (TileEntityChest)tileentity; + return this.matchesChest(tileentitychest, pos, blockAccess); + } + else if (tileentity instanceof TileEntityEnderChest) + { + TileEntityEnderChest tileentityenderchest = (TileEntityEnderChest)tileentity; + return this.matchesEnderChest(tileentityenderchest, pos, blockAccess); + } + else + { + return false; + } + } + + private boolean matchesChest(TileEntityChest tec, BlockPos pos, IBlockAccess blockAccess) + { + boolean flag = tec.adjacentChestXNeg != null || tec.adjacentChestXPos != null || tec.adjacentChestZNeg != null || tec.adjacentChestZPos != null; + boolean flag1 = tec.getChestType() == 1; + boolean flag2 = CustomGuis.isChristmas; + boolean flag3 = false; + return this.matchesChest(flag, flag1, flag2, flag3); + } + + private boolean matchesEnderChest(TileEntityEnderChest teec, BlockPos pos, IBlockAccess blockAccess) + { + return this.matchesChest(false, false, false, true); + } + + private boolean matchesChest(boolean isLarge, boolean isTrapped, boolean isChristmas, boolean isEnder) + { + return this.large != null && this.large.booleanValue() != isLarge ? false : (this.trapped != null && this.trapped.booleanValue() != isTrapped ? false : (this.christmas != null && this.christmas.booleanValue() != isChristmas ? false : this.ender == null || this.ender.booleanValue() == isEnder)); + } + + private boolean matchesDispenser(BlockPos pos, IBlockAccess blockAccess) + { + TileEntity tileentity = blockAccess.getTileEntity(pos); + + if (!(tileentity instanceof TileEntityDispenser)) + { + return false; + } + else + { + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)tileentity; + + if (this.variants != null) + { + CustomGuiProperties.EnumVariant customguiproperties$enumvariant = this.getDispenserVariant(tileentitydispenser); + + if (!Config.equalsOne(customguiproperties$enumvariant, this.variants)) + { + return false; + } + } + + return true; + } + } + + private CustomGuiProperties.EnumVariant getDispenserVariant(TileEntityDispenser ted) + { + return ted instanceof TileEntityDropper ? CustomGuiProperties.EnumVariant.DROPPER : CustomGuiProperties.EnumVariant.DISPENSER; + } + + public boolean matchesEntity(CustomGuiProperties.EnumContainer ec, Entity entity, IBlockAccess blockAccess) + { + if (!this.matchesGeneral(ec, entity.getPosition(), blockAccess)) + { + return false; + } + else + { + if (this.nbtName != null) + { + String s = entity.getName(); + + if (!this.nbtName.matchesValue(s)) + { + return false; + } + } + + switch (ec) + { + case HORSE: + return this.matchesHorse(entity, blockAccess); + + case VILLAGER: + return this.matchesVillager(entity, blockAccess); + + default: + return true; + } + } + } + + private boolean matchesVillager(Entity entity, IBlockAccess blockAccess) + { + if (!(entity instanceof EntityVillager)) + { + return false; + } + else + { + EntityVillager entityvillager = (EntityVillager)entity; + + if (this.professions != null) + { + int i = entityvillager.getProfession(); + int j = Reflector.getFieldValueInt(entityvillager, Reflector.EntityVillager_careerId, -1); + + if (j < 0) + { + return false; + } + + boolean flag = false; + + for (int k = 0; k < this.professions.length; ++k) + { + VillagerProfession villagerprofession = this.professions[k]; + + if (villagerprofession.matches(i, j)) + { + flag = true; + break; + } + } + + if (!flag) + { + return false; + } + } + + return true; + } + } + + private boolean matchesHorse(Entity entity, IBlockAccess blockAccess) + { + if (!(entity instanceof EntityHorse)) + { + return false; + } + else + { + EntityHorse entityhorse = (EntityHorse)entity; + + if (this.variants != null) + { + CustomGuiProperties.EnumVariant customguiproperties$enumvariant = this.getHorseVariant(entityhorse); + + if (!Config.equalsOne(customguiproperties$enumvariant, this.variants)) + { + return false; + } + } + + return true; + } + } + + private CustomGuiProperties.EnumVariant getHorseVariant(EntityHorse entity) + { + int i = entity.getHorseType(); + + switch (i) + { + case 0: + return CustomGuiProperties.EnumVariant.HORSE; + + case 1: + return CustomGuiProperties.EnumVariant.DONKEY; + + case 2: + return CustomGuiProperties.EnumVariant.MULE; + + default: + return null; + } + } + + public CustomGuiProperties.EnumContainer getContainer() + { + return this.container; + } + + public ResourceLocation getTextureLocation(ResourceLocation loc) + { + ResourceLocation resourcelocation = (ResourceLocation)this.textureLocations.get(loc); + return resourcelocation == null ? loc : resourcelocation; + } + + public String toString() + { + return "name: " + this.fileName + ", container: " + this.container + ", textures: " + this.textureLocations; + } + + public static enum EnumContainer + { + ANVIL, + BEACON, + BREWING_STAND, + CHEST, + CRAFTING, + DISPENSER, + ENCHANTMENT, + FURNACE, + HOPPER, + HORSE, + VILLAGER, + SHULKER_BOX, + CREATIVE, + INVENTORY; + + public static final CustomGuiProperties.EnumContainer[] VALUES = values(); + } + + private static enum EnumVariant + { + HORSE, + DONKEY, + MULE, + LLAMA, + DISPENSER, + DROPPER; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomGuis.java b/Client-1.8.9/src/main/java/net/optifine/CustomGuis.java new file mode 100644 index 0000000..0a7e0b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomGuis.java @@ -0,0 +1,342 @@ +package net.optifine; + +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.List; +import java.util.Properties; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiEnchantment; +import net.minecraft.client.gui.GuiHopper; +import net.minecraft.client.gui.GuiMerchant; +import net.minecraft.client.gui.GuiRepair; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.inventory.GuiBeacon; +import net.minecraft.client.gui.inventory.GuiBrewingStand; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiContainerCreative; +import net.minecraft.client.gui.inventory.GuiCrafting; +import net.minecraft.client.gui.inventory.GuiDispenser; +import net.minecraft.client.gui.inventory.GuiFurnace; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.entity.Entity; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.optifine.override.PlayerControllerOF; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.ResUtils; + +public class CustomGuis +{ + private static Minecraft mc = Config.getMinecraft(); + private static PlayerControllerOF playerControllerOF = null; + private static CustomGuiProperties[][] guiProperties = (CustomGuiProperties[][])null; + public static boolean isChristmas = isChristmas(); + + public static ResourceLocation getTextureLocation(ResourceLocation loc) + { + if (guiProperties == null) + { + return loc; + } + else + { + GuiScreen guiscreen = mc.currentScreen; + + if (!(guiscreen instanceof GuiContainer)) + { + return loc; + } + else if (loc.getResourceDomain().equals("minecraft") && loc.getResourcePath().startsWith("textures/gui/")) + { + if (playerControllerOF == null) + { + return loc; + } + else + { + IBlockAccess iblockaccess = mc.theWorld; + + if (iblockaccess == null) + { + return loc; + } + else if (guiscreen instanceof GuiContainerCreative) + { + return getTexturePos(CustomGuiProperties.EnumContainer.CREATIVE, mc.thePlayer.getPosition(), iblockaccess, loc, guiscreen); + } + else if (guiscreen instanceof GuiInventory) + { + return getTexturePos(CustomGuiProperties.EnumContainer.INVENTORY, mc.thePlayer.getPosition(), iblockaccess, loc, guiscreen); + } + else + { + BlockPos blockpos = playerControllerOF.getLastClickBlockPos(); + + if (blockpos != null) + { + if (guiscreen instanceof GuiRepair) + { + return getTexturePos(CustomGuiProperties.EnumContainer.ANVIL, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiBeacon) + { + return getTexturePos(CustomGuiProperties.EnumContainer.BEACON, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiBrewingStand) + { + return getTexturePos(CustomGuiProperties.EnumContainer.BREWING_STAND, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiChest) + { + return getTexturePos(CustomGuiProperties.EnumContainer.CHEST, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiCrafting) + { + return getTexturePos(CustomGuiProperties.EnumContainer.CRAFTING, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiDispenser) + { + return getTexturePos(CustomGuiProperties.EnumContainer.DISPENSER, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiEnchantment) + { + return getTexturePos(CustomGuiProperties.EnumContainer.ENCHANTMENT, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiFurnace) + { + return getTexturePos(CustomGuiProperties.EnumContainer.FURNACE, blockpos, iblockaccess, loc, guiscreen); + } + + if (guiscreen instanceof GuiHopper) + { + return getTexturePos(CustomGuiProperties.EnumContainer.HOPPER, blockpos, iblockaccess, loc, guiscreen); + } + } + + Entity entity = playerControllerOF.getLastClickEntity(); + + if (entity != null) + { + if (guiscreen instanceof GuiScreenHorseInventory) + { + return getTextureEntity(CustomGuiProperties.EnumContainer.HORSE, entity, iblockaccess, loc); + } + + if (guiscreen instanceof GuiMerchant) + { + return getTextureEntity(CustomGuiProperties.EnumContainer.VILLAGER, entity, iblockaccess, loc); + } + } + + return loc; + } + } + } + else + { + return loc; + } + } + } + + private static ResourceLocation getTexturePos(CustomGuiProperties.EnumContainer container, BlockPos pos, IBlockAccess blockAccess, ResourceLocation loc, GuiScreen screen) + { + CustomGuiProperties[] acustomguiproperties = guiProperties[container.ordinal()]; + + if (acustomguiproperties == null) + { + return loc; + } + else + { + for (int i = 0; i < acustomguiproperties.length; ++i) + { + CustomGuiProperties customguiproperties = acustomguiproperties[i]; + + if (customguiproperties.matchesPos(container, pos, blockAccess, screen)) + { + return customguiproperties.getTextureLocation(loc); + } + } + + return loc; + } + } + + private static ResourceLocation getTextureEntity(CustomGuiProperties.EnumContainer container, Entity entity, IBlockAccess blockAccess, ResourceLocation loc) + { + CustomGuiProperties[] acustomguiproperties = guiProperties[container.ordinal()]; + + if (acustomguiproperties == null) + { + return loc; + } + else + { + for (int i = 0; i < acustomguiproperties.length; ++i) + { + CustomGuiProperties customguiproperties = acustomguiproperties[i]; + + if (customguiproperties.matchesEntity(container, entity, blockAccess)) + { + return customguiproperties.getTextureLocation(loc); + } + } + + return loc; + } + } + + public static void update() + { + guiProperties = (CustomGuiProperties[][])null; + + if (Config.isCustomGuis()) + { + List> list = new ArrayList(); + IResourcePack[] airesourcepack = Config.getResourcePacks(); + + for (int i = airesourcepack.length - 1; i >= 0; --i) + { + IResourcePack iresourcepack = airesourcepack[i]; + update(iresourcepack, list); + } + + guiProperties = propertyListToArray(list); + } + } + + private static CustomGuiProperties[][] propertyListToArray(List> listProps) + { + if (listProps.isEmpty()) + { + return (CustomGuiProperties[][])null; + } + else + { + CustomGuiProperties[][] acustomguiproperties = new CustomGuiProperties[CustomGuiProperties.EnumContainer.VALUES.length][]; + + for (int i = 0; i < acustomguiproperties.length; ++i) + { + if (listProps.size() > i) + { + List list = (List)listProps.get(i); + + if (list != null) + { + CustomGuiProperties[] acustomguiproperties1 = (CustomGuiProperties[])((CustomGuiProperties[])list.toArray(new CustomGuiProperties[list.size()])); + acustomguiproperties[i] = acustomguiproperties1; + } + } + } + + return acustomguiproperties; + } + } + + private static void update(IResourcePack rp, List> listProps) + { + String[] astring = ResUtils.collectFiles(rp, (String)"optifine/gui/container/", (String)".properties", (String[])null); + Arrays.sort((Object[])astring); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + Config.dbg("CustomGuis: " + s); + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s); + InputStream inputstream = rp.getInputStream(resourcelocation); + + if (inputstream == null) + { + Config.warn("CustomGuis file not found: " + s); + } + else + { + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + CustomGuiProperties customguiproperties = new CustomGuiProperties(properties, s); + + if (customguiproperties.isValid(s)) + { + addToList(customguiproperties, listProps); + } + } + } + catch (FileNotFoundException var9) + { + Config.warn("CustomGuis file not found: " + s); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } + + private static void addToList(CustomGuiProperties cgp, List> listProps) + { + if (cgp.getContainer() == null) + { + warn("Invalid container: " + cgp.getContainer()); + } + else + { + int i = cgp.getContainer().ordinal(); + + while (listProps.size() <= i) + { + listProps.add(null); + } + + List list = (List)listProps.get(i); + + if (list == null) + { + list = new ArrayList(); + listProps.set(i, list); + } + + list.add(cgp); + } + } + + public static PlayerControllerOF getPlayerControllerOF() + { + return playerControllerOF; + } + + public static void setPlayerControllerOF(PlayerControllerOF playerControllerOF) + { + playerControllerOF = playerControllerOF; + } + + private static boolean isChristmas() + { + Calendar calendar = Calendar.getInstance(); + return calendar.get(2) + 1 == 12 && calendar.get(5) >= 24 && calendar.get(5) <= 26; + } + + private static void warn(String str) + { + Config.warn("[CustomGuis] " + str); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomItemProperties.java b/Client-1.8.9/src/main/java/net/optifine/CustomItemProperties.java new file mode 100644 index 0000000..56a3ee2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomItemProperties.java @@ -0,0 +1,1237 @@ +package net.optifine; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.BlockPart; +import net.minecraft.client.renderer.block.model.BlockPartFace; +import net.minecraft.client.renderer.block.model.FaceBakery; +import net.minecraft.client.renderer.block.model.ItemModelGenerator; +import net.minecraft.client.renderer.block.model.ModelBlock; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.resources.model.ModelRotation; +import net.minecraft.client.resources.model.SimpleBakedModel.Builder; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.src.Config; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.IParserInt; +import net.optifine.config.NbtTagValue; +import net.optifine.config.ParserEnchantmentId; +import net.optifine.config.RangeInt; +import net.optifine.config.RangeListInt; +import net.optifine.reflect.Reflector; +import net.optifine.render.Blender; +import net.optifine.util.StrUtils; +import net.optifine.util.TextureUtils; +import org.lwjgl.opengl.GL11; + +public class CustomItemProperties +{ + public String name = null; + public String basePath = null; + public int type = 1; + public int[] items = null; + public String texture = null; + public Map mapTextures = null; + public String model = null; + public Map mapModels = null; + public RangeListInt damage = null; + public boolean damagePercent = false; + public int damageMask = 0; + public RangeListInt stackSize = null; + public RangeListInt enchantmentIds = null; + public RangeListInt enchantmentLevels = null; + public NbtTagValue[] nbtTagValues = null; + public int hand = 0; + public int blend = 1; + public float speed = 0.0F; + public float rotation = 0.0F; + public int layer = 0; + public float duration = 1.0F; + public int weight = 0; + public ResourceLocation textureLocation = null; + public Map mapTextureLocations = null; + public TextureAtlasSprite sprite = null; + public Map mapSprites = null; + public IBakedModel bakedModelTexture = null; + public Map mapBakedModelsTexture = null; + public IBakedModel bakedModelFull = null; + public Map mapBakedModelsFull = null; + private int textureWidth = 0; + private int textureHeight = 0; + public static final int TYPE_UNKNOWN = 0; + public static final int TYPE_ITEM = 1; + public static final int TYPE_ENCHANTMENT = 2; + public static final int TYPE_ARMOR = 3; + public static final int HAND_ANY = 0; + public static final int HAND_MAIN = 1; + public static final int HAND_OFF = 2; + public static final String INVENTORY = "inventory"; + + public CustomItemProperties(Properties props, String path) + { + this.name = parseName(path); + this.basePath = parseBasePath(path); + this.type = this.parseType(props.getProperty("type")); + this.items = this.parseItems(props.getProperty("items"), props.getProperty("matchItems")); + this.mapModels = parseModels(props, this.basePath); + this.model = parseModel(props.getProperty("model"), path, this.basePath, this.type, this.mapModels); + this.mapTextures = parseTextures(props, this.basePath); + boolean flag = this.mapModels == null && this.model == null; + this.texture = parseTexture(props.getProperty("texture"), props.getProperty("tile"), props.getProperty("source"), path, this.basePath, this.type, this.mapTextures, flag); + String s = props.getProperty("damage"); + + if (s != null) + { + this.damagePercent = s.contains("%"); + s = s.replace("%", ""); + this.damage = this.parseRangeListInt(s); + this.damageMask = this.parseInt(props.getProperty("damageMask"), 0); + } + + this.stackSize = this.parseRangeListInt(props.getProperty("stackSize")); + this.enchantmentIds = this.parseRangeListInt(props.getProperty("enchantmentIDs"), new ParserEnchantmentId()); + this.enchantmentLevels = this.parseRangeListInt(props.getProperty("enchantmentLevels")); + this.nbtTagValues = this.parseNbtTagValues(props); + this.hand = this.parseHand(props.getProperty("hand")); + this.blend = Blender.parseBlend(props.getProperty("blend")); + this.speed = this.parseFloat(props.getProperty("speed"), 0.0F); + this.rotation = this.parseFloat(props.getProperty("rotation"), 0.0F); + this.layer = this.parseInt(props.getProperty("layer"), 0); + this.weight = this.parseInt(props.getProperty("weight"), 0); + this.duration = this.parseFloat(props.getProperty("duration"), 1.0F); + } + + private static String parseName(String path) + { + String s = path; + int i = path.lastIndexOf(47); + + if (i >= 0) + { + s = path.substring(i + 1); + } + + int j = s.lastIndexOf(46); + + if (j >= 0) + { + s = s.substring(0, j); + } + + return s; + } + + private static String parseBasePath(String path) + { + int i = path.lastIndexOf(47); + return i < 0 ? "" : path.substring(0, i); + } + + private int parseType(String str) + { + if (str == null) + { + return 1; + } + else if (str.equals("item")) + { + return 1; + } + else if (str.equals("enchantment")) + { + return 2; + } + else if (str.equals("armor")) + { + return 3; + } + else + { + Config.warn("Unknown method: " + str); + return 0; + } + } + + private int[] parseItems(String str, String str2) + { + if (str == null) + { + str = str2; + } + + if (str == null) + { + return null; + } + else + { + str = str.trim(); + Set set = new TreeSet(); + String[] astring = Config.tokenize(str, " "); + label45: + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + int j = Config.parseInt(s, -1); + + if (j >= 0) + { + set.add(new Integer(j)); + } + else + { + if (s.contains("-")) + { + String[] astring1 = Config.tokenize(s, "-"); + + if (astring1.length == 2) + { + int k = Config.parseInt(astring1[0], -1); + int l = Config.parseInt(astring1[1], -1); + + if (k >= 0 && l >= 0) + { + int i1 = Math.min(k, l); + int j1 = Math.max(k, l); + int k1 = i1; + + while (true) + { + if (k1 > j1) + { + continue label45; + } + + set.add(new Integer(k1)); + ++k1; + } + } + } + } + + Item item = Item.getByNameOrId(s); + + if (item == null) + { + Config.warn("Item not found: " + s); + } + else + { + int i2 = Item.getIdFromItem(item); + + if (i2 <= 0) + { + Config.warn("Item not found: " + s); + } + else + { + set.add(new Integer(i2)); + } + } + } + } + + Integer[] ainteger = (Integer[])((Integer[])set.toArray(new Integer[set.size()])); + int[] aint = new int[ainteger.length]; + + for (int l1 = 0; l1 < aint.length; ++l1) + { + aint[l1] = ainteger[l1].intValue(); + } + + return aint; + } + } + + private static String parseTexture(String texStr, String texStr2, String texStr3, String path, String basePath, int type, Map mapTexs, boolean textureFromPath) + { + if (texStr == null) + { + texStr = texStr2; + } + + if (texStr == null) + { + texStr = texStr3; + } + + if (texStr != null) + { + String s2 = ".png"; + + if (texStr.endsWith(s2)) + { + texStr = texStr.substring(0, texStr.length() - s2.length()); + } + + texStr = fixTextureName(texStr, basePath); + return texStr; + } + else if (type == 3) + { + return null; + } + else + { + if (mapTexs != null) + { + String s = (String)mapTexs.get("texture.bow_standby"); + + if (s != null) + { + return s; + } + } + + if (!textureFromPath) + { + return null; + } + else + { + String s1 = path; + int i = path.lastIndexOf(47); + + if (i >= 0) + { + s1 = path.substring(i + 1); + } + + int j = s1.lastIndexOf(46); + + if (j >= 0) + { + s1 = s1.substring(0, j); + } + + s1 = fixTextureName(s1, basePath); + return s1; + } + } + } + + private static Map parseTextures(Properties props, String basePath) + { + String s = "texture."; + Map map = getMatchingProperties(props, s); + + if (map.size() <= 0) + { + return null; + } + else + { + Set set = map.keySet(); + Map map1 = new LinkedHashMap(); + + for (Object e : set) + { + String s1 = (String) e; + String s2 = (String)map.get(s1); + s2 = fixTextureName(s2, basePath); + map1.put(s1, s2); + } + + return map1; + } + } + + private static String fixTextureName(String iconName, String basePath) + { + iconName = TextureUtils.fixResourcePath(iconName, basePath); + + if (!iconName.startsWith(basePath) && !iconName.startsWith("textures/") && !iconName.startsWith("mcpatcher/")) + { + iconName = basePath + "/" + iconName; + } + + if (iconName.endsWith(".png")) + { + iconName = iconName.substring(0, iconName.length() - 4); + } + + if (iconName.startsWith("/")) + { + iconName = iconName.substring(1); + } + + return iconName; + } + + private static String parseModel(String modelStr, String path, String basePath, int type, Map mapModelNames) + { + if (modelStr != null) + { + String s1 = ".json"; + + if (modelStr.endsWith(s1)) + { + modelStr = modelStr.substring(0, modelStr.length() - s1.length()); + } + + modelStr = fixModelName(modelStr, basePath); + return modelStr; + } + else if (type == 3) + { + return null; + } + else + { + if (mapModelNames != null) + { + String s = (String)mapModelNames.get("model.bow_standby"); + + if (s != null) + { + return s; + } + } + + return modelStr; + } + } + + private static Map parseModels(Properties props, String basePath) + { + String s = "model."; + Map map = getMatchingProperties(props, s); + + if (map.size() <= 0) + { + return null; + } + else + { + Set set = map.keySet(); + Map map1 = new LinkedHashMap(); + + for (Object e : set) + { + String s1 = (String) e; + String s2 = (String)map.get(s1); + s2 = fixModelName(s2, basePath); + map1.put(s1, s2); + } + + return map1; + } + } + + private static String fixModelName(String modelName, String basePath) + { + modelName = TextureUtils.fixResourcePath(modelName, basePath); + boolean flag = modelName.startsWith("block/") || modelName.startsWith("item/"); + + if (!modelName.startsWith(basePath) && !flag && !modelName.startsWith("mcpatcher/")) + { + modelName = basePath + "/" + modelName; + } + + String s = ".json"; + + if (modelName.endsWith(s)) + { + modelName = modelName.substring(0, modelName.length() - s.length()); + } + + if (modelName.startsWith("/")) + { + modelName = modelName.substring(1); + } + + return modelName; + } + + private int parseInt(String str, int defVal) + { + if (str == null) + { + return defVal; + } + else + { + str = str.trim(); + int i = Config.parseInt(str, Integer.MIN_VALUE); + + if (i == Integer.MIN_VALUE) + { + Config.warn("Invalid integer: " + str); + return defVal; + } + else + { + return i; + } + } + } + + private float parseFloat(String str, float defVal) + { + if (str == null) + { + return defVal; + } + else + { + str = str.trim(); + float f = Config.parseFloat(str, Float.MIN_VALUE); + + if (f == Float.MIN_VALUE) + { + Config.warn("Invalid float: " + str); + return defVal; + } + else + { + return f; + } + } + } + + private RangeListInt parseRangeListInt(String str) + { + return this.parseRangeListInt(str, (IParserInt)null); + } + + private RangeListInt parseRangeListInt(String str, IParserInt parser) + { + if (str == null) + { + return null; + } + else + { + String[] astring = Config.tokenize(str, " "); + RangeListInt rangelistint = new RangeListInt(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + if (parser != null) + { + int j = parser.parse(s, Integer.MIN_VALUE); + + if (j != Integer.MIN_VALUE) + { + rangelistint.addRange(new RangeInt(j, j)); + continue; + } + } + + RangeInt rangeint = this.parseRangeInt(s); + + if (rangeint == null) + { + Config.warn("Invalid range list: " + str); + return null; + } + + rangelistint.addRange(rangeint); + } + + return rangelistint; + } + } + + private RangeInt parseRangeInt(String str) + { + if (str == null) + { + return null; + } + else + { + str = str.trim(); + int i = str.length() - str.replace("-", "").length(); + + if (i > 1) + { + Config.warn("Invalid range: " + str); + return null; + } + else + { + String[] astring = Config.tokenize(str, "- "); + int[] aint = new int[astring.length]; + + for (int j = 0; j < astring.length; ++j) + { + String s = astring[j]; + int k = Config.parseInt(s, -1); + + if (k < 0) + { + Config.warn("Invalid range: " + str); + return null; + } + + aint[j] = k; + } + + if (aint.length == 1) + { + int i1 = aint[0]; + + if (str.startsWith("-")) + { + return new RangeInt(0, i1); + } + else if (str.endsWith("-")) + { + return new RangeInt(i1, 65535); + } + else + { + return new RangeInt(i1, i1); + } + } + else if (aint.length == 2) + { + int l = Math.min(aint[0], aint[1]); + int j1 = Math.max(aint[0], aint[1]); + return new RangeInt(l, j1); + } + else + { + Config.warn("Invalid range: " + str); + return null; + } + } + } + } + + private NbtTagValue[] parseNbtTagValues(Properties props) + { + String s = "nbt."; + Map map = getMatchingProperties(props, s); + + if (map.size() <= 0) + { + return null; + } + else + { + List list = new ArrayList(); + + for (Object e : map.keySet()) + { + String s1 = (String) e; + String s2 = (String)map.get(s1); + String s3 = s1.substring(s.length()); + NbtTagValue nbttagvalue = new NbtTagValue(s3, s2); + list.add(nbttagvalue); + } + + NbtTagValue[] anbttagvalue = (NbtTagValue[])((NbtTagValue[])list.toArray(new NbtTagValue[list.size()])); + return anbttagvalue; + } + } + + private static Map getMatchingProperties(Properties props, String keyPrefix) + { + Map map = new LinkedHashMap(); + + for (Object e: props.keySet()) + { + String s = (String) e; + String s1 = props.getProperty(s); + + if (s.startsWith(keyPrefix)) + { + map.put(s, s1); + } + } + + return map; + } + + private int parseHand(String str) + { + if (str == null) + { + return 0; + } + else + { + str = str.toLowerCase(); + + if (str.equals("any")) + { + return 0; + } + else if (str.equals("main")) + { + return 1; + } + else if (str.equals("off")) + { + return 2; + } + else + { + Config.warn("Invalid hand: " + str); + return 0; + } + } + } + + public boolean isValid(String path) + { + if (this.name != null && this.name.length() > 0) + { + if (this.basePath == null) + { + Config.warn("No base path found: " + path); + return false; + } + else if (this.type == 0) + { + Config.warn("No type defined: " + path); + return false; + } + else + { + if (this.type == 1 || this.type == 3) + { + if (this.items == null) + { + this.items = this.detectItems(); + } + + if (this.items == null) + { + Config.warn("No items defined: " + path); + return false; + } + } + + if (this.texture == null && this.mapTextures == null && this.model == null && this.mapModels == null) + { + Config.warn("No texture or model specified: " + path); + return false; + } + else if (this.type == 2 && this.enchantmentIds == null) + { + Config.warn("No enchantmentIDs specified: " + path); + return false; + } + else + { + return true; + } + } + } + else + { + Config.warn("No name found: " + path); + return false; + } + } + + private int[] detectItems() + { + Item item = Item.getByNameOrId(this.name); + + if (item == null) + { + return null; + } + else + { + int i = Item.getIdFromItem(item); + return i <= 0 ? null : new int[] {i}; + } + } + + public void updateIcons(TextureMap textureMap) + { + if (this.texture != null) + { + this.textureLocation = this.getTextureLocation(this.texture); + + if (this.type == 1) + { + ResourceLocation resourcelocation = this.getSpriteLocation(this.textureLocation); + this.sprite = textureMap.registerSprite(resourcelocation); + } + } + + if (this.mapTextures != null) + { + this.mapTextureLocations = new HashMap(); + this.mapSprites = new HashMap(); + + for (String s : this.mapTextures.keySet()) + { + String s1 = (String)this.mapTextures.get(s); + ResourceLocation resourcelocation1 = this.getTextureLocation(s1); + this.mapTextureLocations.put(s, resourcelocation1); + + if (this.type == 1) + { + ResourceLocation resourcelocation2 = this.getSpriteLocation(resourcelocation1); + TextureAtlasSprite textureatlassprite = textureMap.registerSprite(resourcelocation2); + this.mapSprites.put(s, textureatlassprite); + } + } + } + } + + private ResourceLocation getTextureLocation(String texName) + { + if (texName == null) + { + return null; + } + else + { + ResourceLocation resourcelocation = new ResourceLocation(texName); + String s = resourcelocation.getResourceDomain(); + String s1 = resourcelocation.getResourcePath(); + + if (!s1.contains("/")) + { + s1 = "textures/items/" + s1; + } + + String s2 = s1 + ".png"; + ResourceLocation resourcelocation1 = new ResourceLocation(s, s2); + boolean flag = Config.hasResource(resourcelocation1); + + if (!flag) + { + Config.warn("File not found: " + s2); + } + + return resourcelocation1; + } + } + + private ResourceLocation getSpriteLocation(ResourceLocation resLoc) + { + String s = resLoc.getResourcePath(); + s = StrUtils.removePrefix(s, "textures/"); + s = StrUtils.removeSuffix(s, ".png"); + ResourceLocation resourcelocation = new ResourceLocation(resLoc.getResourceDomain(), s); + return resourcelocation; + } + + public void updateModelTexture(TextureMap textureMap, ItemModelGenerator itemModelGenerator) + { + if (this.texture != null || this.mapTextures != null) + { + String[] astring = this.getModelTextures(); + boolean flag = this.isUseTint(); + this.bakedModelTexture = makeBakedModel(textureMap, itemModelGenerator, astring, flag); + + if (this.type == 1 && this.mapTextures != null) + { + for (String s : this.mapTextures.keySet()) + { + String s1 = (String)this.mapTextures.get(s); + String s2 = StrUtils.removePrefix(s, "texture."); + + if (s2.startsWith("bow") || s2.startsWith("fishing_rod") || s2.startsWith("shield")) + { + String[] astring1 = new String[] {s1}; + IBakedModel ibakedmodel = makeBakedModel(textureMap, itemModelGenerator, astring1, flag); + + if (this.mapBakedModelsTexture == null) + { + this.mapBakedModelsTexture = new HashMap(); + } + + this.mapBakedModelsTexture.put(s2, ibakedmodel); + } + } + } + } + } + + private boolean isUseTint() + { + return true; + } + + private static IBakedModel makeBakedModel(TextureMap textureMap, ItemModelGenerator itemModelGenerator, String[] textures, boolean useTint) + { + String[] astring = new String[textures.length]; + + for (int i = 0; i < astring.length; ++i) + { + String s = textures[i]; + astring[i] = StrUtils.removePrefix(s, "textures/"); + } + + ModelBlock modelblock = makeModelBlock(astring); + ModelBlock modelblock1 = itemModelGenerator.makeItemModel(textureMap, modelblock); + IBakedModel ibakedmodel = bakeModel(textureMap, modelblock1, useTint); + return ibakedmodel; + } + + private String[] getModelTextures() + { + if (this.type == 1 && this.items.length == 1) + { + Item item = Item.getItemById(this.items[0]); + + if (item == Items.potionitem && this.damage != null && this.damage.getCountRanges() > 0) + { + RangeInt rangeint = this.damage.getRange(0); + int i = rangeint.getMin(); + boolean flag = (i & 16384) != 0; + String s5 = this.getMapTexture(this.mapTextures, "texture.potion_overlay", "items/potion_overlay"); + String s6 = null; + + if (flag) + { + s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_splash", "items/potion_bottle_splash"); + } + else + { + s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_drinkable", "items/potion_bottle_drinkable"); + } + + return new String[] {s5, s6}; + } + + if (item instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)item; + + if (itemarmor.getArmorMaterial() == ArmorMaterial.LEATHER) + { + String s = "leather"; + String s1 = "helmet"; + + if (itemarmor.armorType == 0) + { + s1 = "helmet"; + } + + if (itemarmor.armorType == 1) + { + s1 = "chestplate"; + } + + if (itemarmor.armorType == 2) + { + s1 = "leggings"; + } + + if (itemarmor.armorType == 3) + { + s1 = "boots"; + } + + String s2 = s + "_" + s1; + String s3 = this.getMapTexture(this.mapTextures, "texture." + s2, "items/" + s2); + String s4 = this.getMapTexture(this.mapTextures, "texture." + s2 + "_overlay", "items/" + s2 + "_overlay"); + return new String[] {s3, s4}; + } + } + } + + return new String[] {this.texture}; + } + + private String getMapTexture(Map map, String key, String def) + { + if (map == null) + { + return def; + } + else + { + String s = (String)map.get(key); + return s == null ? def : s; + } + } + + private static ModelBlock makeModelBlock(String[] modelTextures) + { + StringBuffer stringbuffer = new StringBuffer(); + stringbuffer.append("{\"parent\": \"builtin/generated\",\"textures\": {"); + + for (int i = 0; i < modelTextures.length; ++i) + { + String s = modelTextures[i]; + + if (i > 0) + { + stringbuffer.append(", "); + } + + stringbuffer.append("\"layer" + i + "\": \"" + s + "\""); + } + + stringbuffer.append("}}"); + String s1 = stringbuffer.toString(); + ModelBlock modelblock = ModelBlock.deserialize(s1); + return modelblock; + } + + private static IBakedModel bakeModel(TextureMap textureMap, ModelBlock modelBlockIn, boolean useTint) + { + ModelRotation modelrotation = ModelRotation.X0_Y0; + boolean flag = false; + String s = modelBlockIn.resolveTextureName("particle"); + TextureAtlasSprite textureatlassprite = textureMap.getAtlasSprite((new ResourceLocation(s)).toString()); + Builder builder = (new Builder(modelBlockIn)).setTexture(textureatlassprite); + + for (BlockPart blockpart : modelBlockIn.getElements()) + { + for (EnumFacing enumfacing : blockpart.mapFaces.keySet()) + { + BlockPartFace blockpartface = (BlockPartFace)blockpart.mapFaces.get(enumfacing); + + if (!useTint) + { + blockpartface = new BlockPartFace(blockpartface.cullFace, -1, blockpartface.texture, blockpartface.blockFaceUV); + } + + String s1 = modelBlockIn.resolveTextureName(blockpartface.texture); + TextureAtlasSprite textureatlassprite1 = textureMap.getAtlasSprite((new ResourceLocation(s1)).toString()); + BakedQuad bakedquad = makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelrotation, flag); + + if (blockpartface.cullFace == null) + { + builder.addGeneralQuad(bakedquad); + } + else + { + builder.addFaceQuad(modelrotation.rotateFace(blockpartface.cullFace), bakedquad); + } + } + } + + return builder.makeBakedModel(); + } + + private static BakedQuad makeBakedQuad(BlockPart blockPart, BlockPartFace blockPartFace, TextureAtlasSprite textureAtlasSprite, EnumFacing enumFacing, ModelRotation modelRotation, boolean uvLocked) + { + FaceBakery facebakery = new FaceBakery(); + return facebakery.makeBakedQuad(blockPart.positionFrom, blockPart.positionTo, blockPartFace, textureAtlasSprite, enumFacing, modelRotation, blockPart.partRotation, uvLocked, blockPart.shade); + } + + public String toString() + { + return "" + this.basePath + "/" + this.name + ", type: " + this.type + ", items: [" + Config.arrayToString(this.items) + "], textture: " + this.texture; + } + + public float getTextureWidth(TextureManager textureManager) + { + if (this.textureWidth <= 0) + { + if (this.textureLocation != null) + { + ITextureObject itextureobject = textureManager.getTexture(this.textureLocation); + int i = itextureobject.getGlTextureId(); + int j = GlStateManager.getBoundTexture(); + GlStateManager.bindTexture(i); + this.textureWidth = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); + GlStateManager.bindTexture(j); + } + + if (this.textureWidth <= 0) + { + this.textureWidth = 16; + } + } + + return (float)this.textureWidth; + } + + public float getTextureHeight(TextureManager textureManager) + { + if (this.textureHeight <= 0) + { + if (this.textureLocation != null) + { + ITextureObject itextureobject = textureManager.getTexture(this.textureLocation); + int i = itextureobject.getGlTextureId(); + int j = GlStateManager.getBoundTexture(); + GlStateManager.bindTexture(i); + this.textureHeight = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT); + GlStateManager.bindTexture(j); + } + + if (this.textureHeight <= 0) + { + this.textureHeight = 16; + } + } + + return (float)this.textureHeight; + } + + public IBakedModel getBakedModel(ResourceLocation modelLocation, boolean fullModel) + { + IBakedModel ibakedmodel; + Map map; + + if (fullModel) + { + ibakedmodel = this.bakedModelFull; + map = this.mapBakedModelsFull; + } + else + { + ibakedmodel = this.bakedModelTexture; + map = this.mapBakedModelsTexture; + } + + if (modelLocation != null && map != null) + { + String s = modelLocation.getResourcePath(); + IBakedModel ibakedmodel1 = (IBakedModel)map.get(s); + + if (ibakedmodel1 != null) + { + return ibakedmodel1; + } + } + + return ibakedmodel; + } + + public void loadModels(ModelBakery modelBakery) + { + if (this.model != null) + { + loadItemModel(modelBakery, this.model); + } + + if (this.type == 1 && this.mapModels != null) + { + for (String s : this.mapModels.keySet()) + { + String s1 = (String)this.mapModels.get(s); + String s2 = StrUtils.removePrefix(s, "model."); + + if (s2.startsWith("bow") || s2.startsWith("fishing_rod") || s2.startsWith("shield")) + { + loadItemModel(modelBakery, s1); + } + } + } + } + + public void updateModelsFull() + { + ModelManager modelmanager = Config.getModelManager(); + IBakedModel ibakedmodel = modelmanager.getMissingModel(); + + if (this.model != null) + { + ResourceLocation resourcelocation = getModelLocation(this.model); + ModelResourceLocation modelresourcelocation = new ModelResourceLocation(resourcelocation, "inventory"); + this.bakedModelFull = modelmanager.getModel(modelresourcelocation); + + if (this.bakedModelFull == ibakedmodel) + { + Config.warn("Custom Items: Model not found " + modelresourcelocation.getResourcePath()); + this.bakedModelFull = null; + } + } + + if (this.type == 1 && this.mapModels != null) + { + for (String s : this.mapModels.keySet()) + { + String s1 = (String)this.mapModels.get(s); + String s2 = StrUtils.removePrefix(s, "model."); + + if (s2.startsWith("bow") || s2.startsWith("fishing_rod") || s2.startsWith("shield")) + { + ResourceLocation resourcelocation1 = getModelLocation(s1); + ModelResourceLocation modelresourcelocation1 = new ModelResourceLocation(resourcelocation1, "inventory"); + IBakedModel ibakedmodel1 = modelmanager.getModel(modelresourcelocation1); + + if (ibakedmodel1 == ibakedmodel) + { + Config.warn("Custom Items: Model not found " + modelresourcelocation1.getResourcePath()); + } + else + { + if (this.mapBakedModelsFull == null) + { + this.mapBakedModelsFull = new HashMap(); + } + + this.mapBakedModelsFull.put(s2, ibakedmodel1); + } + } + } + } + } + + private static void loadItemModel(ModelBakery modelBakery, String model) + { + ResourceLocation resourcelocation = getModelLocation(model); + ModelResourceLocation modelresourcelocation = new ModelResourceLocation(resourcelocation, "inventory"); + + if (Reflector.ModelLoader.exists()) + { + try + { + Object object = Reflector.ModelLoader_VanillaLoader_INSTANCE.getValue(); + checkNull(object, "vanillaLoader is null"); + Object object1 = Reflector.call(object, Reflector.ModelLoader_VanillaLoader_loadModel, new Object[] {modelresourcelocation}); + checkNull(object1, "iModel is null"); + Map map = (Map)Reflector.getFieldValue(modelBakery, Reflector.ModelLoader_stateModels); + checkNull(map, "stateModels is null"); + map.put(modelresourcelocation, object1); + Set set = (Set)Reflector.getFieldValue(modelBakery, Reflector.ModelLoader_textures); + checkNull(set, "registryTextures is null"); + Collection collection = (Collection)Reflector.call(object1, Reflector.IModel_getTextures, new Object[0]); + checkNull(collection, "modelTextures is null"); + set.addAll(collection); + } + catch (Exception exception) + { + Config.warn("Error registering model with ModelLoader: " + modelresourcelocation + ", " + exception.getClass().getName() + ": " + exception.getMessage()); + } + } + else + { + modelBakery.loadItemModel(resourcelocation.toString(), modelresourcelocation, resourcelocation); + } + } + + private static void checkNull(Object obj, String msg) throws NullPointerException + { + if (obj == null) + { + throw new NullPointerException(msg); + } + } + + private static ResourceLocation getModelLocation(String modelName) + { + return Reflector.ModelLoader.exists() && !modelName.startsWith("mcpatcher/") && !modelName.startsWith("optifine/") ? new ResourceLocation("models/" + modelName) : new ResourceLocation(modelName); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomItems.java b/Client-1.8.9/src/main/java/net/optifine/CustomItems.java new file mode 100644 index 0000000..d46d647 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomItems.java @@ -0,0 +1,1039 @@ +package net.optifine; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.block.model.ItemModelGenerator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelBakery; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.NbtTagValue; +import net.optifine.render.Blender; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersRender; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.ResUtils; +import net.optifine.util.StrUtils; + +public class CustomItems +{ + private static CustomItemProperties[][] itemProperties = (CustomItemProperties[][])null; + private static CustomItemProperties[][] enchantmentProperties = (CustomItemProperties[][])null; + private static Map mapPotionIds = null; + private static ItemModelGenerator itemModelGenerator = new ItemModelGenerator(); + private static boolean useGlint = true; + private static boolean renderOffHand = false; + public static final int MASK_POTION_SPLASH = 16384; + public static final int MASK_POTION_NAME = 63; + public static final int MASK_POTION_EXTENDED = 64; + public static final String KEY_TEXTURE_OVERLAY = "texture.potion_overlay"; + public static final String KEY_TEXTURE_SPLASH = "texture.potion_bottle_splash"; + public static final String KEY_TEXTURE_DRINKABLE = "texture.potion_bottle_drinkable"; + public static final String DEFAULT_TEXTURE_OVERLAY = "items/potion_overlay"; + public static final String DEFAULT_TEXTURE_SPLASH = "items/potion_bottle_splash"; + public static final String DEFAULT_TEXTURE_DRINKABLE = "items/potion_bottle_drinkable"; + private static final int[][] EMPTY_INT2_ARRAY = new int[0][]; + private static final String TYPE_POTION_NORMAL = "normal"; + private static final String TYPE_POTION_SPLASH = "splash"; + private static final String TYPE_POTION_LINGER = "linger"; + + public static void update() + { + itemProperties = (CustomItemProperties[][])null; + enchantmentProperties = (CustomItemProperties[][])null; + useGlint = true; + + if (Config.isCustomItems()) + { + readCitProperties("mcpatcher/cit.properties"); + IResourcePack[] airesourcepack = Config.getResourcePacks(); + + for (int i = airesourcepack.length - 1; i >= 0; --i) + { + IResourcePack iresourcepack = airesourcepack[i]; + update(iresourcepack); + } + + update(Config.getDefaultResourcePack()); + + if (itemProperties.length <= 0) + { + itemProperties = (CustomItemProperties[][])null; + } + + if (enchantmentProperties.length <= 0) + { + enchantmentProperties = (CustomItemProperties[][])null; + } + } + } + + private static void readCitProperties(String fileName) + { + try + { + ResourceLocation resourcelocation = new ResourceLocation(fileName); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return; + } + + Config.dbg("CustomItems: Loading " + fileName); + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + useGlint = Config.parseBoolean(properties.getProperty("useGlint"), true); + } + catch (FileNotFoundException var4) + { + return; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + private static void update(IResourcePack rp) + { + String[] astring = ResUtils.collectFiles(rp, (String)"mcpatcher/cit/", (String)".properties", (String[])null); + Map map = makeAutoImageProperties(rp); + + if (map.size() > 0) + { + Set set = map.keySet(); + String[] astring1 = (String[])((String[])set.toArray(new String[set.size()])); + astring = (String[])((String[])Config.addObjectsToArray(astring, astring1)); + } + + Arrays.sort((Object[])astring); + List list = makePropertyList(itemProperties); + List list1 = makePropertyList(enchantmentProperties); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + Config.dbg("CustomItems: " + s); + + try + { + CustomItemProperties customitemproperties = null; + + if (map.containsKey(s)) + { + customitemproperties = (CustomItemProperties)map.get(s); + } + + if (customitemproperties == null) + { + ResourceLocation resourcelocation = new ResourceLocation(s); + InputStream inputstream = rp.getInputStream(resourcelocation); + + if (inputstream == null) + { + Config.warn("CustomItems file not found: " + s); + continue; + } + + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + customitemproperties = new CustomItemProperties(properties, s); + } + + if (customitemproperties.isValid(s)) + { + addToItemList(customitemproperties, list); + addToEnchantmentList(customitemproperties, list1); + } + } + catch (FileNotFoundException var11) + { + Config.warn("CustomItems file not found: " + s); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + itemProperties = propertyListToArray(list); + enchantmentProperties = propertyListToArray(list1); + Comparator comparator = getPropertiesComparator(); + + for (int j = 0; j < itemProperties.length; ++j) + { + CustomItemProperties[] acustomitemproperties = itemProperties[j]; + + if (acustomitemproperties != null) + { + Arrays.sort(acustomitemproperties, comparator); + } + } + + for (int k = 0; k < enchantmentProperties.length; ++k) + { + CustomItemProperties[] acustomitemproperties1 = enchantmentProperties[k]; + + if (acustomitemproperties1 != null) + { + Arrays.sort(acustomitemproperties1, comparator); + } + } + } + + private static Comparator getPropertiesComparator() + { + Comparator comparator = new Comparator() + { + public int compare(Object o1, Object o2) + { + CustomItemProperties customitemproperties = (CustomItemProperties)o1; + CustomItemProperties customitemproperties1 = (CustomItemProperties)o2; + return customitemproperties.layer != customitemproperties1.layer ? customitemproperties.layer - customitemproperties1.layer : (customitemproperties.weight != customitemproperties1.weight ? customitemproperties1.weight - customitemproperties.weight : (!customitemproperties.basePath.equals(customitemproperties1.basePath) ? customitemproperties.basePath.compareTo(customitemproperties1.basePath) : customitemproperties.name.compareTo(customitemproperties1.name))); + } + }; + return comparator; + } + + public static void updateIcons(TextureMap textureMap) + { + for (CustomItemProperties customitemproperties : getAllProperties()) + { + customitemproperties.updateIcons(textureMap); + } + } + + public static void loadModels(ModelBakery modelBakery) + { + for (CustomItemProperties customitemproperties : getAllProperties()) + { + customitemproperties.loadModels(modelBakery); + } + } + + public static void updateModels() + { + for (CustomItemProperties customitemproperties : getAllProperties()) + { + if (customitemproperties.type == 1) + { + TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks(); + customitemproperties.updateModelTexture(texturemap, itemModelGenerator); + customitemproperties.updateModelsFull(); + } + } + } + + private static List getAllProperties() + { + List list = new ArrayList(); + addAll(itemProperties, list); + addAll(enchantmentProperties, list); + return list; + } + + private static void addAll(CustomItemProperties[][] cipsArr, List list) + { + if (cipsArr != null) + { + for (int i = 0; i < cipsArr.length; ++i) + { + CustomItemProperties[] acustomitemproperties = cipsArr[i]; + + if (acustomitemproperties != null) + { + for (int j = 0; j < acustomitemproperties.length; ++j) + { + CustomItemProperties customitemproperties = acustomitemproperties[j]; + + if (customitemproperties != null) + { + list.add(customitemproperties); + } + } + } + } + } + } + + private static Map makeAutoImageProperties(IResourcePack rp) + { + Map map = new HashMap(); + map.putAll(makePotionImageProperties(rp, "normal", Item.getIdFromItem(Items.potionitem))); + map.putAll(makePotionImageProperties(rp, "splash", Item.getIdFromItem(Items.potionitem))); + map.putAll(makePotionImageProperties(rp, "linger", Item.getIdFromItem(Items.potionitem))); + return map; + } + + private static Map makePotionImageProperties(IResourcePack rp, String type, int itemId) + { + Map map = new HashMap(); + String s = type + "/"; + String[] astring = new String[] {"mcpatcher/cit/potion/" + s, "mcpatcher/cit/Potion/" + s}; + String[] astring1 = new String[] {".png"}; + String[] astring2 = ResUtils.collectFiles(rp, astring, astring1); + + for (int i = 0; i < astring2.length; ++i) + { + String s1 = astring2[i]; + String name = StrUtils.removePrefixSuffix(s1, astring, astring1); + Properties properties = makePotionProperties(name, type, itemId, s1); + + if (properties != null) + { + String s3 = StrUtils.removeSuffix(s1, astring1) + ".properties"; + CustomItemProperties customitemproperties = new CustomItemProperties(properties, s3); + map.put(s3, customitemproperties); + } + } + + return map; + } + + private static Properties makePotionProperties(String name, String type, int itemId, String path) + { + if (StrUtils.endsWith(name, new String[] {"_n", "_s"})) + { + return null; + } + else if (name.equals("empty") && type.equals("normal")) + { + itemId = Item.getIdFromItem(Items.glass_bottle); + Properties properties = new PropertiesOrdered(); + properties.put("type", "item"); + properties.put("items", "" + itemId); + return properties; + } + else + { + int[] aint = (int[])((int[])getMapPotionIds().get(name)); + + if (aint == null) + { + Config.warn("Potion not found for image: " + path); + return null; + } + else + { + StringBuffer stringbuffer = new StringBuffer(); + + for (int i = 0; i < aint.length; ++i) + { + int j = aint[i]; + + if (type.equals("splash")) + { + j |= 16384; + } + + if (i > 0) + { + stringbuffer.append(" "); + } + + stringbuffer.append(j); + } + + int k = 16447; + + if (name.equals("water") || name.equals("mundane")) + { + k |= 64; + } + + Properties properties1 = new PropertiesOrdered(); + properties1.put("type", "item"); + properties1.put("items", "" + itemId); + properties1.put("damage", "" + stringbuffer.toString()); + properties1.put("damageMask", "" + k); + + if (type.equals("splash")) + { + properties1.put("texture.potion_bottle_splash", name); + } + else + { + properties1.put("texture.potion_bottle_drinkable", name); + } + + return properties1; + } + } + } + + private static Map getMapPotionIds() + { + if (mapPotionIds == null) + { + mapPotionIds = new LinkedHashMap(); + mapPotionIds.put("water", getPotionId(0, 0)); + mapPotionIds.put("awkward", getPotionId(0, 1)); + mapPotionIds.put("thick", getPotionId(0, 2)); + mapPotionIds.put("potent", getPotionId(0, 3)); + mapPotionIds.put("regeneration", getPotionIds(1)); + mapPotionIds.put("movespeed", getPotionIds(2)); + mapPotionIds.put("fireresistance", getPotionIds(3)); + mapPotionIds.put("poison", getPotionIds(4)); + mapPotionIds.put("heal", getPotionIds(5)); + mapPotionIds.put("nightvision", getPotionIds(6)); + mapPotionIds.put("clear", getPotionId(7, 0)); + mapPotionIds.put("bungling", getPotionId(7, 1)); + mapPotionIds.put("charming", getPotionId(7, 2)); + mapPotionIds.put("rank", getPotionId(7, 3)); + mapPotionIds.put("weakness", getPotionIds(8)); + mapPotionIds.put("damageboost", getPotionIds(9)); + mapPotionIds.put("moveslowdown", getPotionIds(10)); + mapPotionIds.put("leaping", getPotionIds(11)); + mapPotionIds.put("harm", getPotionIds(12)); + mapPotionIds.put("waterbreathing", getPotionIds(13)); + mapPotionIds.put("invisibility", getPotionIds(14)); + mapPotionIds.put("thin", getPotionId(15, 0)); + mapPotionIds.put("debonair", getPotionId(15, 1)); + mapPotionIds.put("sparkling", getPotionId(15, 2)); + mapPotionIds.put("stinky", getPotionId(15, 3)); + mapPotionIds.put("mundane", getPotionId(0, 4)); + mapPotionIds.put("speed", mapPotionIds.get("movespeed")); + mapPotionIds.put("fire_resistance", mapPotionIds.get("fireresistance")); + mapPotionIds.put("instant_health", mapPotionIds.get("heal")); + mapPotionIds.put("night_vision", mapPotionIds.get("nightvision")); + mapPotionIds.put("strength", mapPotionIds.get("damageboost")); + mapPotionIds.put("slowness", mapPotionIds.get("moveslowdown")); + mapPotionIds.put("instant_damage", mapPotionIds.get("harm")); + mapPotionIds.put("water_breathing", mapPotionIds.get("waterbreathing")); + } + + return mapPotionIds; + } + + private static int[] getPotionIds(int baseId) + { + return new int[] {baseId, baseId + 16, baseId + 32, baseId + 48}; + } + + private static int[] getPotionId(int baseId, int subId) + { + return new int[] {baseId + subId * 16}; + } + + private static int getPotionNameDamage(String name) + { + String s = "potion." + name; + Potion[] apotion = Potion.potionTypes; + + for (int i = 0; i < apotion.length; ++i) + { + Potion potion = apotion[i]; + + if (potion != null) + { + String s1 = potion.getName(); + + if (s.equals(s1)) + { + return potion.getId(); + } + } + } + + return -1; + } + + private static List makePropertyList(CustomItemProperties[][] propsArr) + { + List list = new ArrayList(); + + if (propsArr != null) + { + for (int i = 0; i < propsArr.length; ++i) + { + CustomItemProperties[] acustomitemproperties = propsArr[i]; + List list1 = null; + + if (acustomitemproperties != null) + { + list1 = new ArrayList(Arrays.asList(acustomitemproperties)); + } + + list.add(list1); + } + } + + return list; + } + + private static CustomItemProperties[][] propertyListToArray(List list) + { + CustomItemProperties[][] acustomitemproperties = new CustomItemProperties[list.size()][]; + + for (int i = 0; i < list.size(); ++i) + { + List list1 = (List)list.get(i); + + if (list1 != null) + { + CustomItemProperties[] acustomitemproperties1 = (CustomItemProperties[])((CustomItemProperties[])list1.toArray(new CustomItemProperties[list1.size()])); + Arrays.sort(acustomitemproperties1, new CustomItemsComparator()); + acustomitemproperties[i] = acustomitemproperties1; + } + } + + return acustomitemproperties; + } + + private static void addToItemList(CustomItemProperties cp, List itemList) + { + if (cp.items != null) + { + for (int i = 0; i < cp.items.length; ++i) + { + int j = cp.items[i]; + + if (j <= 0) + { + Config.warn("Invalid item ID: " + j); + } + else + { + addToList(cp, itemList, j); + } + } + } + } + + private static void addToEnchantmentList(CustomItemProperties cp, List enchantmentList) + { + if (cp.type == 2) + { + if (cp.enchantmentIds != null) + { + for (int i = 0; i < 256; ++i) + { + if (cp.enchantmentIds.isInRange(i)) + { + addToList(cp, enchantmentList, i); + } + } + } + } + } + + private static void addToList(CustomItemProperties cp, List list, int id) + { + while (id >= list.size()) + { + list.add(null); + } + + List list1 = (List)list.get(id); + + if (list1 == null) + { + list1 = new ArrayList(); + list.set(id, list1); + } + + list1.add(cp); + } + + public static IBakedModel getCustomItemModel(ItemStack itemStack, IBakedModel model, ResourceLocation modelLocation, boolean fullModel) + { + if (!fullModel && model.isGui3d()) + { + return model; + } + else if (itemProperties == null) + { + return model; + } + else + { + CustomItemProperties customitemproperties = getCustomItemProperties(itemStack, 1); + + if (customitemproperties == null) + { + return model; + } + else + { + IBakedModel ibakedmodel = customitemproperties.getBakedModel(modelLocation, fullModel); + return ibakedmodel != null ? ibakedmodel : model; + } + } + } + + public static boolean bindCustomArmorTexture(ItemStack itemStack, int layer, String overlay) + { + if (itemProperties == null) + { + return false; + } + else + { + ResourceLocation resourcelocation = getCustomArmorLocation(itemStack, layer, overlay); + + if (resourcelocation == null) + { + return false; + } + else + { + Config.getTextureManager().bindTexture(resourcelocation); + return true; + } + } + } + + private static ResourceLocation getCustomArmorLocation(ItemStack itemStack, int layer, String overlay) + { + CustomItemProperties customitemproperties = getCustomItemProperties(itemStack, 3); + + if (customitemproperties == null) + { + return null; + } + else if (customitemproperties.mapTextureLocations == null) + { + return customitemproperties.textureLocation; + } + else + { + Item item = itemStack.getItem(); + + if (!(item instanceof ItemArmor)) + { + return null; + } + else + { + ItemArmor itemarmor = (ItemArmor)item; + String s = itemarmor.getArmorMaterial().getName(); + StringBuffer stringbuffer = new StringBuffer(); + stringbuffer.append("texture."); + stringbuffer.append(s); + stringbuffer.append("_layer_"); + stringbuffer.append(layer); + + if (overlay != null) + { + stringbuffer.append("_"); + stringbuffer.append(overlay); + } + + String s1 = stringbuffer.toString(); + ResourceLocation resourcelocation = (ResourceLocation)customitemproperties.mapTextureLocations.get(s1); + return resourcelocation == null ? customitemproperties.textureLocation : resourcelocation; + } + } + } + + private static CustomItemProperties getCustomItemProperties(ItemStack itemStack, int type) + { + if (itemProperties == null) + { + return null; + } + else if (itemStack == null) + { + return null; + } + else + { + Item item = itemStack.getItem(); + int i = Item.getIdFromItem(item); + + if (i >= 0 && i < itemProperties.length) + { + CustomItemProperties[] acustomitemproperties = itemProperties[i]; + + if (acustomitemproperties != null) + { + for (int j = 0; j < acustomitemproperties.length; ++j) + { + CustomItemProperties customitemproperties = acustomitemproperties[j]; + + if (customitemproperties.type == type && matchesProperties(customitemproperties, itemStack, (int[][])null)) + { + return customitemproperties; + } + } + } + } + + return null; + } + } + + private static boolean matchesProperties(CustomItemProperties cip, ItemStack itemStack, int[][] enchantmentIdLevels) + { + Item item = itemStack.getItem(); + + if (cip.damage != null) + { + int i = itemStack.getItemDamage(); + + if (cip.damageMask != 0) + { + i &= cip.damageMask; + } + + if (cip.damagePercent) + { + int j = item.getMaxDamage(); + i = (int)((double)(i * 100) / (double)j); + } + + if (!cip.damage.isInRange(i)) + { + return false; + } + } + + if (cip.stackSize != null && !cip.stackSize.isInRange(itemStack.stackSize)) + { + return false; + } + else + { + int[][] aint = enchantmentIdLevels; + + if (cip.enchantmentIds != null) + { + if (enchantmentIdLevels == null) + { + aint = getEnchantmentIdLevels(itemStack); + } + + boolean flag = false; + + for (int k = 0; k < aint.length; ++k) + { + int l = aint[k][0]; + + if (cip.enchantmentIds.isInRange(l)) + { + flag = true; + break; + } + } + + if (!flag) + { + return false; + } + } + + if (cip.enchantmentLevels != null) + { + if (aint == null) + { + aint = getEnchantmentIdLevels(itemStack); + } + + boolean flag1 = false; + + for (int i1 = 0; i1 < aint.length; ++i1) + { + int k1 = aint[i1][1]; + + if (cip.enchantmentLevels.isInRange(k1)) + { + flag1 = true; + break; + } + } + + if (!flag1) + { + return false; + } + } + + if (cip.nbtTagValues != null) + { + NBTTagCompound nbttagcompound = itemStack.getTagCompound(); + + for (int j1 = 0; j1 < cip.nbtTagValues.length; ++j1) + { + NbtTagValue nbttagvalue = cip.nbtTagValues[j1]; + + if (!nbttagvalue.matches(nbttagcompound)) + { + return false; + } + } + } + + if (cip.hand != 0) + { + if (cip.hand == 1 && renderOffHand) + { + return false; + } + + if (cip.hand == 2 && !renderOffHand) + { + return false; + } + } + + return true; + } + } + + private static int[][] getEnchantmentIdLevels(ItemStack itemStack) + { + Item item = itemStack.getItem(); + NBTTagList nbttaglist = item == Items.enchanted_book ? Items.enchanted_book.getEnchantments(itemStack) : itemStack.getEnchantmentTagList(); + + if (nbttaglist != null && nbttaglist.tagCount() > 0) + { + int[][] aint = new int[nbttaglist.tagCount()][2]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound.getShort("id"); + int k = nbttagcompound.getShort("lvl"); + aint[i][0] = j; + aint[i][1] = k; + } + + return aint; + } + else + { + return EMPTY_INT2_ARRAY; + } + } + + public static boolean renderCustomEffect(RenderItem renderItem, ItemStack itemStack, IBakedModel model) + { + if (enchantmentProperties == null) + { + return false; + } + else if (itemStack == null) + { + return false; + } + else + { + int[][] aint = getEnchantmentIdLevels(itemStack); + + if (aint.length <= 0) + { + return false; + } + else + { + Set set = null; + boolean flag = false; + TextureManager texturemanager = Config.getTextureManager(); + + for (int i = 0; i < aint.length; ++i) + { + int j = aint[i][0]; + + if (j >= 0 && j < enchantmentProperties.length) + { + CustomItemProperties[] acustomitemproperties = enchantmentProperties[j]; + + if (acustomitemproperties != null) + { + for (int k = 0; k < acustomitemproperties.length; ++k) + { + CustomItemProperties customitemproperties = acustomitemproperties[k]; + + if (set == null) + { + set = new HashSet(); + } + + if (set.add(Integer.valueOf(j)) && matchesProperties(customitemproperties, itemStack, aint) && customitemproperties.textureLocation != null) + { + texturemanager.bindTexture(customitemproperties.textureLocation); + float f = customitemproperties.getTextureWidth(texturemanager); + + if (!flag) + { + flag = true; + GlStateManager.depthMask(false); + GlStateManager.depthFunc(514); + GlStateManager.disableLighting(); + GlStateManager.matrixMode(5890); + } + + Blender.setupBlend(customitemproperties.blend, 1.0F); + GlStateManager.pushMatrix(); + GlStateManager.scale(f / 2.0F, f / 2.0F, f / 2.0F); + float f1 = customitemproperties.speed * (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F; + GlStateManager.translate(f1, 0.0F, 0.0F); + GlStateManager.rotate(customitemproperties.rotation, 0.0F, 0.0F, 1.0F); + renderItem.renderModel(model, -1); + GlStateManager.popMatrix(); + } + } + } + } + } + + if (flag) + { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.matrixMode(5888); + GlStateManager.enableLighting(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + texturemanager.bindTexture(TextureMap.locationBlocksTexture); + } + + return flag; + } + } + } + + public static boolean renderCustomArmorEffect(EntityLivingBase entity, ItemStack itemStack, ModelBase model, float limbSwing, float prevLimbSwing, float partialTicks, float timeLimbSwing, float yaw, float pitch, float scale) + { + if (enchantmentProperties == null) + { + return false; + } + else if (Config.isShaders() && Shaders.isShadowPass) + { + return false; + } + else if (itemStack == null) + { + return false; + } + else + { + int[][] aint = getEnchantmentIdLevels(itemStack); + + if (aint.length <= 0) + { + return false; + } + else + { + Set set = null; + boolean flag = false; + TextureManager texturemanager = Config.getTextureManager(); + + for (int i = 0; i < aint.length; ++i) + { + int j = aint[i][0]; + + if (j >= 0 && j < enchantmentProperties.length) + { + CustomItemProperties[] acustomitemproperties = enchantmentProperties[j]; + + if (acustomitemproperties != null) + { + for (int k = 0; k < acustomitemproperties.length; ++k) + { + CustomItemProperties customitemproperties = acustomitemproperties[k]; + + if (set == null) + { + set = new HashSet(); + } + + if (set.add(Integer.valueOf(j)) && matchesProperties(customitemproperties, itemStack, aint) && customitemproperties.textureLocation != null) + { + texturemanager.bindTexture(customitemproperties.textureLocation); + float f = customitemproperties.getTextureWidth(texturemanager); + + if (!flag) + { + flag = true; + + if (Config.isShaders()) + { + ShadersRender.renderEnchantedGlintBegin(); + } + + GlStateManager.enableBlend(); + GlStateManager.depthFunc(514); + GlStateManager.depthMask(false); + } + + Blender.setupBlend(customitemproperties.blend, 1.0F); + GlStateManager.disableLighting(); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + GlStateManager.rotate(customitemproperties.rotation, 0.0F, 0.0F, 1.0F); + float f1 = f / 8.0F; + GlStateManager.scale(f1, f1 / 2.0F, f1); + float f2 = customitemproperties.speed * (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F; + GlStateManager.translate(0.0F, f2, 0.0F); + GlStateManager.matrixMode(5888); + model.render(entity, limbSwing, prevLimbSwing, timeLimbSwing, yaw, pitch, scale); + } + } + } + } + } + + if (flag) + { + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.matrixMode(5890); + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + GlStateManager.enableLighting(); + GlStateManager.depthMask(true); + GlStateManager.depthFunc(515); + GlStateManager.disableBlend(); + + if (Config.isShaders()) + { + ShadersRender.renderEnchantedGlintEnd(); + } + } + + return flag; + } + } + } + + public static boolean isUseGlint() + { + return useGlint; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomItemsComparator.java b/Client-1.8.9/src/main/java/net/optifine/CustomItemsComparator.java new file mode 100644 index 0000000..4765bad --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomItemsComparator.java @@ -0,0 +1,14 @@ +package net.optifine; + +import java.util.Comparator; +import net.minecraft.src.Config; + +public class CustomItemsComparator implements Comparator +{ + public int compare(Object o1, Object o2) + { + CustomItemProperties customitemproperties = (CustomItemProperties)o1; + CustomItemProperties customitemproperties1 = (CustomItemProperties)o2; + return customitemproperties.weight != customitemproperties1.weight ? customitemproperties1.weight - customitemproperties.weight : (!Config.equals(customitemproperties.basePath, customitemproperties1.basePath) ? customitemproperties.basePath.compareTo(customitemproperties1.basePath) : customitemproperties.name.compareTo(customitemproperties1.name)); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomLoadingScreen.java b/Client-1.8.9/src/main/java/net/optifine/CustomLoadingScreen.java new file mode 100644 index 0000000..1978d92 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomLoadingScreen.java @@ -0,0 +1,165 @@ +package net.optifine; + +import java.util.Properties; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class CustomLoadingScreen +{ + private ResourceLocation locationTexture; + private int scaleMode = 0; + private int scale = 2; + private boolean center; + private static final int SCALE_DEFAULT = 2; + private static final int SCALE_MODE_FIXED = 0; + private static final int SCALE_MODE_FULL = 1; + private static final int SCALE_MODE_STRETCH = 2; + + public CustomLoadingScreen(ResourceLocation locationTexture, int scaleMode, int scale, boolean center) + { + this.locationTexture = locationTexture; + this.scaleMode = scaleMode; + this.scale = scale; + this.center = center; + } + + public static CustomLoadingScreen parseScreen(String path, int dimId, Properties props) + { + ResourceLocation resourcelocation = new ResourceLocation(path); + int i = parseScaleMode(getProperty("scaleMode", dimId, props)); + int j = i == 0 ? 2 : 1; + int k = parseScale(getProperty("scale", dimId, props), j); + boolean flag = Config.parseBoolean(getProperty("center", dimId, props), false); + CustomLoadingScreen customloadingscreen = new CustomLoadingScreen(resourcelocation, i, k, flag); + return customloadingscreen; + } + + private static String getProperty(String key, int dim, Properties props) + { + if (props == null) + { + return null; + } + else + { + String s = props.getProperty("dim" + dim + "." + key); + + if (s != null) + { + return s; + } + else + { + s = props.getProperty(key); + return s; + } + } + } + + private static int parseScaleMode(String str) + { + if (str == null) + { + return 0; + } + else + { + str = str.toLowerCase().trim(); + + if (str.equals("fixed")) + { + return 0; + } + else if (str.equals("full")) + { + return 1; + } + else if (str.equals("stretch")) + { + return 2; + } + else + { + CustomLoadingScreens.warn("Invalid scale mode: " + str); + return 0; + } + } + } + + private static int parseScale(String str, int def) + { + if (str == null) + { + return def; + } + else + { + str = str.trim(); + int i = Config.parseInt(str, -1); + + if (i < 1) + { + CustomLoadingScreens.warn("Invalid scale: " + str); + return def; + } + else + { + return i; + } + } + } + + public void drawBackground(int width, int height) + { + GlStateManager.disableLighting(); + GlStateManager.disableFog(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + Config.getTextureManager().bindTexture(this.locationTexture); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + double d0 = (double)(16 * this.scale); + double d1 = (double)width / d0; + double d2 = (double)height / d0; + double d3 = 0.0D; + double d4 = 0.0D; + + if (this.center) + { + d3 = (d0 - (double)width) / (d0 * 2.0D); + d4 = (d0 - (double)height) / (d0 * 2.0D); + } + + switch (this.scaleMode) + { + case 1: + d0 = (double)Math.max(width, height); + d1 = (double)(this.scale * width) / d0; + d2 = (double)(this.scale * height) / d0; + + if (this.center) + { + d3 = (double)this.scale * (d0 - (double)width) / (d0 * 2.0D); + d4 = (double)this.scale * (d0 - (double)height) / (d0 * 2.0D); + } + + break; + + case 2: + d1 = (double)this.scale; + d2 = (double)this.scale; + d3 = 0.0D; + d4 = 0.0D; + } + + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(0.0D, (double)height, 0.0D).tex(d3, d4 + d2).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double)width, (double)height, 0.0D).tex(d3 + d1, d4 + d2).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((double)width, 0.0D, 0.0D).tex(d3 + d1, d4).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(d3, d4).color(255, 255, 255, 255).endVertex(); + tessellator.draw(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomLoadingScreens.java b/Client-1.8.9/src/main/java/net/optifine/CustomLoadingScreens.java new file mode 100644 index 0000000..04f3a46 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomLoadingScreens.java @@ -0,0 +1,110 @@ +package net.optifine; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import net.minecraft.network.PacketThreadUtil; +import net.minecraft.src.Config; +import net.optifine.util.ResUtils; +import net.optifine.util.StrUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; + +public class CustomLoadingScreens +{ + private static CustomLoadingScreen[] screens = null; + private static int screensMinDimensionId = 0; + + public static CustomLoadingScreen getCustomLoadingScreen() + { + if (screens == null) + { + return null; + } + else + { + int i = PacketThreadUtil.lastDimensionId; + int j = i - screensMinDimensionId; + CustomLoadingScreen customloadingscreen = null; + + if (j >= 0 && j < screens.length) + { + customloadingscreen = screens[j]; + } + + return customloadingscreen; + } + } + + public static void update() + { + screens = null; + screensMinDimensionId = 0; + Pair pair = parseScreens(); + screens = (CustomLoadingScreen[])pair.getLeft(); + screensMinDimensionId = ((Integer)pair.getRight()).intValue(); + } + + private static Pair parseScreens() + { + String s = "optifine/gui/loading/background"; + String s1 = ".png"; + String[] astring = ResUtils.collectFiles(s, s1); + Map map = new HashMap(); + + for (int i = 0; i < astring.length; ++i) + { + String s2 = astring[i]; + String s3 = StrUtils.removePrefixSuffix(s2, s, s1); + int j = Config.parseInt(s3, Integer.MIN_VALUE); + + if (j == Integer.MIN_VALUE) + { + warn("Invalid dimension ID: " + s3 + ", path: " + s2); + } + else + { + map.put(Integer.valueOf(j), s2); + } + } + + Set set = map.keySet(); + Integer[] ainteger = (Integer[])set.toArray(new Integer[set.size()]); + Arrays.sort((Object[])ainteger); + + if (ainteger.length <= 0) + { + return new ImmutablePair((Object)null, Integer.valueOf(0)); + } + else + { + String s5 = "optifine/gui/loading/loading.properties"; + Properties properties = ResUtils.readProperties(s5, "CustomLoadingScreens"); + int k = ainteger[0].intValue(); + int l = ainteger[ainteger.length - 1].intValue(); + int i1 = l - k + 1; + CustomLoadingScreen[] acustomloadingscreen = new CustomLoadingScreen[i1]; + + for (int j1 = 0; j1 < ainteger.length; ++j1) + { + Integer integer = ainteger[j1]; + String s4 = (String)map.get(integer); + acustomloadingscreen[integer.intValue() - k] = CustomLoadingScreen.parseScreen(s4, integer.intValue(), properties); + } + + return new ImmutablePair(acustomloadingscreen, Integer.valueOf(k)); + } + } + + public static void warn(String str) + { + Config.warn("CustomLoadingScreen: " + str); + } + + public static void dbg(String str) + { + Config.dbg("CustomLoadingScreen: " + str); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomPanorama.java b/Client-1.8.9/src/main/java/net/optifine/CustomPanorama.java new file mode 100644 index 0000000..b1fb2cd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomPanorama.java @@ -0,0 +1,159 @@ +package net.optifine; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import java.util.Random; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.util.MathUtils; +import net.optifine.util.PropertiesOrdered; + +public class CustomPanorama +{ + private static CustomPanoramaProperties customPanoramaProperties = null; + private static final Random random = new Random(); + + public static CustomPanoramaProperties getCustomPanoramaProperties() + { + return customPanoramaProperties; + } + + public static void update() + { + customPanoramaProperties = null; + String[] astring = getPanoramaFolders(); + + if (astring.length > 1) + { + Properties[] aproperties = getPanoramaProperties(astring); + int[] aint = getWeights(aproperties); + int i = getRandomIndex(aint); + String s = astring[i]; + Properties properties = aproperties[i]; + + if (properties == null) + { + properties = aproperties[0]; + } + + if (properties == null) + { + properties = new PropertiesOrdered(); + } + + CustomPanoramaProperties custompanoramaproperties = new CustomPanoramaProperties(s, properties); + customPanoramaProperties = custompanoramaproperties; + } + } + + private static String[] getPanoramaFolders() + { + List list = new ArrayList(); + list.add("textures/gui/title/background"); + + for (int i = 0; i < 100; ++i) + { + String s = "optifine/gui/background" + i; + String s1 = s + "/panorama_0.png"; + ResourceLocation resourcelocation = new ResourceLocation(s1); + + if (Config.hasResource(resourcelocation)) + { + list.add(s); + } + } + + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } + + private static Properties[] getPanoramaProperties(String[] folders) + { + Properties[] aproperties = new Properties[folders.length]; + + for (int i = 0; i < folders.length; ++i) + { + String s = folders[i]; + + if (i == 0) + { + s = "optifine/gui"; + } + else + { + Config.dbg("CustomPanorama: " + s); + } + + ResourceLocation resourcelocation = new ResourceLocation(s + "/background.properties"); + + try + { + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream != null) + { + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + Config.dbg("CustomPanorama: " + resourcelocation.getResourcePath()); + aproperties[i] = properties; + inputstream.close(); + } + } + catch (IOException var7) + { + ; + } + } + + return aproperties; + } + + private static int[] getWeights(Properties[] properties) + { + int[] aint = new int[properties.length]; + + for (int i = 0; i < aint.length; ++i) + { + Properties property = properties[i]; + + if (property == null) + { + property = properties[0]; + } + + if (property == null) + { + aint[i] = 1; + } + else + { + String s = property.getProperty("weight", (String)null); + aint[i] = Config.parseInt(s, 1); + } + } + + return aint; + } + + private static int getRandomIndex(int[] weights) + { + int i = MathUtils.getSum(weights); + int j = random.nextInt(i); + int k = 0; + + for (int l = 0; l < weights.length; ++l) + { + k += weights[l]; + + if (k > j) + { + return l; + } + } + + return weights.length - 1; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomPanoramaProperties.java b/Client-1.8.9/src/main/java/net/optifine/CustomPanoramaProperties.java new file mode 100644 index 0000000..a7ff1df --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomPanoramaProperties.java @@ -0,0 +1,90 @@ +package net.optifine; + +import java.util.Properties; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.ConnectedParser; + +public class CustomPanoramaProperties +{ + private String path; + private ResourceLocation[] panoramaLocations; + private int weight = 1; + private int blur1 = 64; + private int blur2 = 3; + private int blur3 = 3; + private int overlay1Top = -2130706433; + private int overlay1Bottom = 16777215; + private int overlay2Top = 0; + private int overlay2Bottom = Integer.MIN_VALUE; + + public CustomPanoramaProperties(String path, Properties props) + { + ConnectedParser connectedparser = new ConnectedParser("CustomPanorama"); + this.path = path; + this.panoramaLocations = new ResourceLocation[6]; + + for (int i = 0; i < this.panoramaLocations.length; ++i) + { + this.panoramaLocations[i] = new ResourceLocation(path + "/panorama_" + i + ".png"); + } + + this.weight = connectedparser.parseInt(props.getProperty("weight"), 1); + this.blur1 = connectedparser.parseInt(props.getProperty("blur1"), 64); + this.blur2 = connectedparser.parseInt(props.getProperty("blur2"), 3); + this.blur3 = connectedparser.parseInt(props.getProperty("blur3"), 3); + this.overlay1Top = ConnectedParser.parseColor4(props.getProperty("overlay1.top"), -2130706433); + this.overlay1Bottom = ConnectedParser.parseColor4(props.getProperty("overlay1.bottom"), 16777215); + this.overlay2Top = ConnectedParser.parseColor4(props.getProperty("overlay2.top"), 0); + this.overlay2Bottom = ConnectedParser.parseColor4(props.getProperty("overlay2.bottom"), Integer.MIN_VALUE); + } + + public ResourceLocation[] getPanoramaLocations() + { + return this.panoramaLocations; + } + + public int getWeight() + { + return this.weight; + } + + public int getBlur1() + { + return this.blur1; + } + + public int getBlur2() + { + return this.blur2; + } + + public int getBlur3() + { + return this.blur3; + } + + public int getOverlay1Top() + { + return this.overlay1Top; + } + + public int getOverlay1Bottom() + { + return this.overlay1Bottom; + } + + public int getOverlay2Top() + { + return this.overlay2Top; + } + + public int getOverlay2Bottom() + { + return this.overlay2Bottom; + } + + public String toString() + { + return "" + this.path + ", weight: " + this.weight + ", blur: " + this.blur1 + " " + this.blur2 + " " + this.blur3 + ", overlay: " + this.overlay1Top + " " + this.overlay1Bottom + " " + this.overlay2Top + " " + this.overlay2Bottom; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomSky.java b/Client-1.8.9/src/main/java/net/optifine/CustomSky.java new file mode 100644 index 0000000..aeaa430 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomSky.java @@ -0,0 +1,183 @@ +package net.optifine; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.optifine.render.Blender; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.TextureUtils; + +public class CustomSky +{ + private static CustomSkyLayer[][] worldSkyLayers = (CustomSkyLayer[][])null; + + public static void reset() + { + worldSkyLayers = (CustomSkyLayer[][])null; + } + + public static void update() + { + reset(); + + if (Config.isCustomSky()) + { + worldSkyLayers = readCustomSkies(); + } + } + + private static CustomSkyLayer[][] readCustomSkies() + { + CustomSkyLayer[][] acustomskylayer = new CustomSkyLayer[10][0]; + String s = "mcpatcher/sky/world"; + int i = -1; + + for (int j = 0; j < acustomskylayer.length; ++j) + { + String s1 = s + j + "/sky"; + List list = new ArrayList(); + + for (int k = 1; k < 1000; ++k) + { + String s2 = s1 + k + ".properties"; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s2); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + break; + } + + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + Config.dbg("CustomSky properties: " + s2); + String s3 = s1 + k + ".png"; + CustomSkyLayer customskylayer = new CustomSkyLayer(properties, s3); + + if (customskylayer.isValid(s2)) + { + ResourceLocation resourcelocation1 = new ResourceLocation(customskylayer.source); + ITextureObject itextureobject = TextureUtils.getTexture(resourcelocation1); + + if (itextureobject == null) + { + Config.log("CustomSky: Texture not found: " + resourcelocation1); + } + else + { + customskylayer.textureId = itextureobject.getGlTextureId(); + list.add(customskylayer); + inputstream.close(); + } + } + } + catch (FileNotFoundException var15) + { + break; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + if (list.size() > 0) + { + CustomSkyLayer[] acustomskylayer2 = (CustomSkyLayer[])((CustomSkyLayer[])list.toArray(new CustomSkyLayer[list.size()])); + acustomskylayer[j] = acustomskylayer2; + i = j; + } + } + + if (i < 0) + { + return (CustomSkyLayer[][])null; + } + else + { + int l = i + 1; + CustomSkyLayer[][] acustomskylayer1 = new CustomSkyLayer[l][0]; + + for (int i1 = 0; i1 < acustomskylayer1.length; ++i1) + { + acustomskylayer1[i1] = acustomskylayer[i1]; + } + + return acustomskylayer1; + } + } + + public static void renderSky(World world, TextureManager re, float partialTicks) + { + if (worldSkyLayers != null) + { + int i = world.provider.getDimensionId(); + + if (i >= 0 && i < worldSkyLayers.length) + { + CustomSkyLayer[] acustomskylayer = worldSkyLayers[i]; + + if (acustomskylayer != null) + { + long j = world.getWorldTime(); + int k = (int)(j % 24000L); + float f = world.getCelestialAngle(partialTicks); + float f1 = world.getRainStrength(partialTicks); + float f2 = world.getThunderStrength(partialTicks); + + if (f1 > 0.0F) + { + f2 /= f1; + } + + for (int l = 0; l < acustomskylayer.length; ++l) + { + CustomSkyLayer customskylayer = acustomskylayer[l]; + + if (customskylayer.isActive(world, k)) + { + customskylayer.render(world, k, f, f1, f2); + } + } + + float f3 = 1.0F - f1; + Blender.clearBlend(f3); + } + } + } + } + + public static boolean hasSkyLayers(World world) + { + if (worldSkyLayers == null) + { + return false; + } + else + { + int i = world.provider.getDimensionId(); + + if (i >= 0 && i < worldSkyLayers.length) + { + CustomSkyLayer[] acustomskylayer = worldSkyLayers[i]; + return acustomskylayer == null ? false : acustomskylayer.length > 0; + } + else + { + return false; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/CustomSkyLayer.java b/Client-1.8.9/src/main/java/net/optifine/CustomSkyLayer.java new file mode 100644 index 0000000..c5cc7a2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/CustomSkyLayer.java @@ -0,0 +1,533 @@ +package net.optifine; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.config.ConnectedParser; +import net.optifine.config.Matches; +import net.optifine.config.RangeListInt; +import net.optifine.render.Blender; +import net.optifine.util.NumUtils; +import net.optifine.util.SmoothFloat; +import net.optifine.util.TextureUtils; + +public class CustomSkyLayer +{ + public String source = null; + private int startFadeIn = -1; + private int endFadeIn = -1; + private int startFadeOut = -1; + private int endFadeOut = -1; + private int blend = 1; + private boolean rotate = false; + private float speed = 1.0F; + private float[] axis; + private RangeListInt days; + private int daysLoop; + private boolean weatherClear; + private boolean weatherRain; + private boolean weatherThunder; + public BiomeGenBase[] biomes; + public RangeListInt heights; + private float transition; + private SmoothFloat smoothPositionBrightness; + public int textureId; + private World lastWorld; + public static final float[] DEFAULT_AXIS = new float[] {1.0F, 0.0F, 0.0F}; + private static final String WEATHER_CLEAR = "clear"; + private static final String WEATHER_RAIN = "rain"; + private static final String WEATHER_THUNDER = "thunder"; + + public CustomSkyLayer(Properties props, String defSource) + { + this.axis = DEFAULT_AXIS; + this.days = null; + this.daysLoop = 8; + this.weatherClear = true; + this.weatherRain = false; + this.weatherThunder = false; + this.biomes = null; + this.heights = null; + this.transition = 1.0F; + this.smoothPositionBrightness = null; + this.textureId = -1; + this.lastWorld = null; + ConnectedParser connectedparser = new ConnectedParser("CustomSky"); + this.source = props.getProperty("source", defSource); + this.startFadeIn = this.parseTime(props.getProperty("startFadeIn")); + this.endFadeIn = this.parseTime(props.getProperty("endFadeIn")); + this.startFadeOut = this.parseTime(props.getProperty("startFadeOut")); + this.endFadeOut = this.parseTime(props.getProperty("endFadeOut")); + this.blend = Blender.parseBlend(props.getProperty("blend")); + this.rotate = this.parseBoolean(props.getProperty("rotate"), true); + this.speed = this.parseFloat(props.getProperty("speed"), 1.0F); + this.axis = this.parseAxis(props.getProperty("axis"), DEFAULT_AXIS); + this.days = connectedparser.parseRangeListInt(props.getProperty("days")); + this.daysLoop = connectedparser.parseInt(props.getProperty("daysLoop"), 8); + List list = this.parseWeatherList(props.getProperty("weather", "clear")); + this.weatherClear = list.contains("clear"); + this.weatherRain = list.contains("rain"); + this.weatherThunder = list.contains("thunder"); + this.biomes = connectedparser.parseBiomes(props.getProperty("biomes")); + this.heights = connectedparser.parseRangeListInt(props.getProperty("heights")); + this.transition = this.parseFloat(props.getProperty("transition"), 1.0F); + } + + private List parseWeatherList(String str) + { + List list = Arrays.asList(new String[] {"clear", "rain", "thunder"}); + List list1 = new ArrayList(); + String[] astring = Config.tokenize(str, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + if (!list.contains(s)) + { + Config.warn("Unknown weather: " + s); + } + else + { + list1.add(s); + } + } + + return list1; + } + + private int parseTime(String str) + { + if (str == null) + { + return -1; + } + else + { + String[] astring = Config.tokenize(str, ":"); + + if (astring.length != 2) + { + Config.warn("Invalid time: " + str); + return -1; + } + else + { + String s = astring[0]; + String s1 = astring[1]; + int i = Config.parseInt(s, -1); + int j = Config.parseInt(s1, -1); + + if (i >= 0 && i <= 23 && j >= 0 && j <= 59) + { + i = i - 6; + + if (i < 0) + { + i += 24; + } + + int k = i * 1000 + (int)((double)j / 60.0D * 1000.0D); + return k; + } + else + { + Config.warn("Invalid time: " + str); + return -1; + } + } + } + } + + private boolean parseBoolean(String str, boolean defVal) + { + if (str == null) + { + return defVal; + } + else if (str.toLowerCase().equals("true")) + { + return true; + } + else if (str.toLowerCase().equals("false")) + { + return false; + } + else + { + Config.warn("Unknown boolean: " + str); + return defVal; + } + } + + private float parseFloat(String str, float defVal) + { + if (str == null) + { + return defVal; + } + else + { + float f = Config.parseFloat(str, Float.MIN_VALUE); + + if (f == Float.MIN_VALUE) + { + Config.warn("Invalid value: " + str); + return defVal; + } + else + { + return f; + } + } + } + + private float[] parseAxis(String str, float[] defVal) + { + if (str == null) + { + return defVal; + } + else + { + String[] astring = Config.tokenize(str, " "); + + if (astring.length != 3) + { + Config.warn("Invalid axis: " + str); + return defVal; + } + else + { + float[] afloat = new float[3]; + + for (int i = 0; i < astring.length; ++i) + { + afloat[i] = Config.parseFloat(astring[i], Float.MIN_VALUE); + + if (afloat[i] == Float.MIN_VALUE) + { + Config.warn("Invalid axis: " + str); + return defVal; + } + + if (afloat[i] < -1.0F || afloat[i] > 1.0F) + { + Config.warn("Invalid axis values: " + str); + return defVal; + } + } + + float f2 = afloat[0]; + float f = afloat[1]; + float f1 = afloat[2]; + + if (f2 * f2 + f * f + f1 * f1 < 1.0E-5F) + { + Config.warn("Invalid axis values: " + str); + return defVal; + } + else + { + float[] afloat1 = new float[] {f1, f, -f2}; + return afloat1; + } + } + } + } + + public boolean isValid(String path) + { + if (this.source == null) + { + Config.warn("No source texture: " + path); + return false; + } + else + { + this.source = TextureUtils.fixResourcePath(this.source, TextureUtils.getBasePath(path)); + + if (this.startFadeIn >= 0 && this.endFadeIn >= 0 && this.endFadeOut >= 0) + { + int i = this.normalizeTime(this.endFadeIn - this.startFadeIn); + + if (this.startFadeOut < 0) + { + this.startFadeOut = this.normalizeTime(this.endFadeOut - i); + + if (this.timeBetween(this.startFadeOut, this.startFadeIn, this.endFadeIn)) + { + this.startFadeOut = this.endFadeIn; + } + } + + int j = this.normalizeTime(this.startFadeOut - this.endFadeIn); + int k = this.normalizeTime(this.endFadeOut - this.startFadeOut); + int l = this.normalizeTime(this.startFadeIn - this.endFadeOut); + int i1 = i + j + k + l; + + if (i1 != 24000) + { + Config.warn("Invalid fadeIn/fadeOut times, sum is not 24h: " + i1); + return false; + } + else if (this.speed < 0.0F) + { + Config.warn("Invalid speed: " + this.speed); + return false; + } + else if (this.daysLoop <= 0) + { + Config.warn("Invalid daysLoop: " + this.daysLoop); + return false; + } + else + { + return true; + } + } + else + { + Config.warn("Invalid times, required are: startFadeIn, endFadeIn and endFadeOut."); + return false; + } + } + } + + private int normalizeTime(int timeMc) + { + while (timeMc >= 24000) + { + timeMc -= 24000; + } + + while (timeMc < 0) + { + timeMc += 24000; + } + + return timeMc; + } + + public void render(World world, int timeOfDay, float celestialAngle, float rainStrength, float thunderStrength) + { + float f = this.getPositionBrightness(world); + float f1 = this.getWeatherBrightness(rainStrength, thunderStrength); + float f2 = this.getFadeBrightness(timeOfDay); + float f3 = f * f1 * f2; + f3 = Config.limit(f3, 0.0F, 1.0F); + + if (f3 >= 1.0E-4F) + { + GlStateManager.bindTexture(this.textureId); + Blender.setupBlend(this.blend, f3); + GlStateManager.pushMatrix(); + + if (this.rotate) + { + float f4 = 0.0F; + + if (this.speed != (float)Math.round(this.speed)) + { + long i = (world.getWorldTime() + 18000L) / 24000L; + double d0 = (double)(this.speed % 1.0F); + double d1 = (double)i * d0; + f4 = (float)(d1 % 1.0D); + } + + GlStateManager.rotate(360.0F * (f4 + celestialAngle * this.speed), this.axis[0], this.axis[1], this.axis[2]); + } + + Tessellator tessellator = Tessellator.getInstance(); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tessellator, 4); + GlStateManager.pushMatrix(); + GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); + this.renderSide(tessellator, 1); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); + this.renderSide(tessellator, 0); + GlStateManager.popMatrix(); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tessellator, 5); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tessellator, 2); + GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tessellator, 3); + GlStateManager.popMatrix(); + } + } + + private float getPositionBrightness(World world) + { + if (this.biomes == null && this.heights == null) + { + return 1.0F; + } + else + { + float f = this.getPositionBrightnessRaw(world); + + if (this.smoothPositionBrightness == null) + { + this.smoothPositionBrightness = new SmoothFloat(f, this.transition); + } + + f = this.smoothPositionBrightness.getSmoothValue(f); + return f; + } + } + + private float getPositionBrightnessRaw(World world) + { + Entity entity = Minecraft.getMinecraft().getRenderViewEntity(); + + if (entity == null) + { + return 0.0F; + } + else + { + BlockPos blockpos = entity.getPosition(); + + if (this.biomes != null) + { + BiomeGenBase biomegenbase = world.getBiomeGenForCoords(blockpos); + + if (biomegenbase == null) + { + return 0.0F; + } + + if (!Matches.biome(biomegenbase, this.biomes)) + { + return 0.0F; + } + } + + return this.heights != null && !this.heights.isInRange(blockpos.getY()) ? 0.0F : 1.0F; + } + } + + private float getWeatherBrightness(float rainStrength, float thunderStrength) + { + float f = 1.0F - rainStrength; + float f1 = rainStrength - thunderStrength; + float f2 = 0.0F; + + if (this.weatherClear) + { + f2 += f; + } + + if (this.weatherRain) + { + f2 += f1; + } + + if (this.weatherThunder) + { + f2 += thunderStrength; + } + + f2 = NumUtils.limit(f2, 0.0F, 1.0F); + return f2; + } + + private float getFadeBrightness(int timeOfDay) + { + if (this.timeBetween(timeOfDay, this.startFadeIn, this.endFadeIn)) + { + int k = this.normalizeTime(this.endFadeIn - this.startFadeIn); + int l = this.normalizeTime(timeOfDay - this.startFadeIn); + return (float)l / (float)k; + } + else if (this.timeBetween(timeOfDay, this.endFadeIn, this.startFadeOut)) + { + return 1.0F; + } + else if (this.timeBetween(timeOfDay, this.startFadeOut, this.endFadeOut)) + { + int i = this.normalizeTime(this.endFadeOut - this.startFadeOut); + int j = this.normalizeTime(timeOfDay - this.startFadeOut); + return 1.0F - (float)j / (float)i; + } + else + { + return 0.0F; + } + } + + private void renderSide(Tessellator tess, int side) + { + WorldRenderer worldrenderer = tess.getWorldRenderer(); + double d0 = (double)(side % 3) / 3.0D; + double d1 = (double)(side / 3) / 2.0D; + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(-100.0D, -100.0D, -100.0D).tex(d0, d1).endVertex(); + worldrenderer.pos(-100.0D, -100.0D, 100.0D).tex(d0, d1 + 0.5D).endVertex(); + worldrenderer.pos(100.0D, -100.0D, 100.0D).tex(d0 + 0.3333333333333333D, d1 + 0.5D).endVertex(); + worldrenderer.pos(100.0D, -100.0D, -100.0D).tex(d0 + 0.3333333333333333D, d1).endVertex(); + tess.draw(); + } + + public boolean isActive(World world, int timeOfDay) + { + if (world != this.lastWorld) + { + this.lastWorld = world; + this.smoothPositionBrightness = null; + } + + if (this.timeBetween(timeOfDay, this.endFadeOut, this.startFadeIn)) + { + return false; + } + else + { + if (this.days != null) + { + long i = world.getWorldTime(); + long j; + + for (j = i - (long)this.startFadeIn; j < 0L; j += (long)(24000 * this.daysLoop)) + { + ; + } + + int k = (int)(j / 24000L); + int l = k % this.daysLoop; + + if (!this.days.isInRange(l)) + { + return false; + } + } + + return true; + } + } + + private boolean timeBetween(int timeOfDay, int timeStart, int timeEnd) + { + return timeStart <= timeEnd ? timeOfDay >= timeStart && timeOfDay <= timeEnd : timeOfDay >= timeStart || timeOfDay <= timeEnd; + } + + public String toString() + { + return "" + this.source + ", " + this.startFadeIn + "-" + this.endFadeIn + " " + this.startFadeOut + "-" + this.endFadeOut; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/DynamicLight.java b/Client-1.8.9/src/main/java/net/optifine/DynamicLight.java new file mode 100644 index 0000000..9b5addf --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/DynamicLight.java @@ -0,0 +1,194 @@ +package net.optifine; + +import java.util.HashSet; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.chunk.CompiledChunk; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.BlockPos.MutableBlockPos; +import net.minecraft.world.World; + +public class DynamicLight +{ + private Entity entity = null; + private double offsetY = 0.0D; + private double lastPosX = -2.147483648E9D; + private double lastPosY = -2.147483648E9D; + private double lastPosZ = -2.147483648E9D; + private int lastLightLevel = 0; + private boolean underwater = false; + private long timeCheckMs = 0L; + private Set setLitChunkPos = new HashSet(); + private MutableBlockPos blockPosMutable = new MutableBlockPos(); + + public DynamicLight(Entity entity) + { + this.entity = entity; + this.offsetY = (double)entity.getEyeHeight(); + } + + public void update(RenderGlobal renderGlobal) + { + if (Config.isDynamicLightsFast()) + { + long i = System.currentTimeMillis(); + + if (i < this.timeCheckMs + 500L) + { + return; + } + + this.timeCheckMs = i; + } + + double d6 = this.entity.posX - 0.5D; + double d0 = this.entity.posY - 0.5D + this.offsetY; + double d1 = this.entity.posZ - 0.5D; + int j = DynamicLights.getLightLevel(this.entity); + double d2 = d6 - this.lastPosX; + double d3 = d0 - this.lastPosY; + double d4 = d1 - this.lastPosZ; + double d5 = 0.1D; + + if (Math.abs(d2) > d5 || Math.abs(d3) > d5 || Math.abs(d4) > d5 || this.lastLightLevel != j) + { + this.lastPosX = d6; + this.lastPosY = d0; + this.lastPosZ = d1; + this.lastLightLevel = j; + this.underwater = false; + World world = renderGlobal.getWorld(); + + if (world != null) + { + this.blockPosMutable.set(MathHelper.floor_double(d6), MathHelper.floor_double(d0), MathHelper.floor_double(d1)); + IBlockState iblockstate = world.getBlockState(this.blockPosMutable); + Block block = iblockstate.getBlock(); + this.underwater = block == Blocks.water; + } + + Set set = new HashSet(); + + if (j > 0) + { + EnumFacing enumfacing2 = (MathHelper.floor_double(d6) & 15) >= 8 ? EnumFacing.EAST : EnumFacing.WEST; + EnumFacing enumfacing = (MathHelper.floor_double(d0) & 15) >= 8 ? EnumFacing.UP : EnumFacing.DOWN; + EnumFacing enumfacing1 = (MathHelper.floor_double(d1) & 15) >= 8 ? EnumFacing.SOUTH : EnumFacing.NORTH; + BlockPos blockpos = new BlockPos(d6, d0, d1); + RenderChunk renderchunk = renderGlobal.getRenderChunk(blockpos); + BlockPos blockpos1 = this.getChunkPos(renderchunk, blockpos, enumfacing2); + RenderChunk renderchunk1 = renderGlobal.getRenderChunk(blockpos1); + BlockPos blockpos2 = this.getChunkPos(renderchunk, blockpos, enumfacing1); + RenderChunk renderchunk2 = renderGlobal.getRenderChunk(blockpos2); + BlockPos blockpos3 = this.getChunkPos(renderchunk1, blockpos1, enumfacing1); + RenderChunk renderchunk3 = renderGlobal.getRenderChunk(blockpos3); + BlockPos blockpos4 = this.getChunkPos(renderchunk, blockpos, enumfacing); + RenderChunk renderchunk4 = renderGlobal.getRenderChunk(blockpos4); + BlockPos blockpos5 = this.getChunkPos(renderchunk4, blockpos4, enumfacing2); + RenderChunk renderchunk5 = renderGlobal.getRenderChunk(blockpos5); + BlockPos blockpos6 = this.getChunkPos(renderchunk4, blockpos4, enumfacing1); + RenderChunk renderchunk6 = renderGlobal.getRenderChunk(blockpos6); + BlockPos blockpos7 = this.getChunkPos(renderchunk5, blockpos5, enumfacing1); + RenderChunk renderchunk7 = renderGlobal.getRenderChunk(blockpos7); + this.updateChunkLight(renderchunk, this.setLitChunkPos, set); + this.updateChunkLight(renderchunk1, this.setLitChunkPos, set); + this.updateChunkLight(renderchunk2, this.setLitChunkPos, set); + this.updateChunkLight(renderchunk3, this.setLitChunkPos, set); + this.updateChunkLight(renderchunk4, this.setLitChunkPos, set); + this.updateChunkLight(renderchunk5, this.setLitChunkPos, set); + this.updateChunkLight(renderchunk6, this.setLitChunkPos, set); + this.updateChunkLight(renderchunk7, this.setLitChunkPos, set); + } + + this.updateLitChunks(renderGlobal); + this.setLitChunkPos = set; + } + } + + private BlockPos getChunkPos(RenderChunk renderChunk, BlockPos pos, EnumFacing facing) + { + return renderChunk != null ? renderChunk.getBlockPosOffset16(facing) : pos.offset(facing, 16); + } + + private void updateChunkLight(RenderChunk renderChunk, Set setPrevPos, Set setNewPos) + { + if (renderChunk != null) + { + CompiledChunk compiledchunk = renderChunk.getCompiledChunk(); + + if (compiledchunk != null && !compiledchunk.isEmpty()) + { + renderChunk.setNeedsUpdate(true); + } + + BlockPos blockpos = renderChunk.getPosition(); + + if (setPrevPos != null) + { + setPrevPos.remove(blockpos); + } + + if (setNewPos != null) + { + setNewPos.add(blockpos); + } + } + } + + public void updateLitChunks(RenderGlobal renderGlobal) + { + for (BlockPos blockpos : this.setLitChunkPos) + { + RenderChunk renderchunk = renderGlobal.getRenderChunk(blockpos); + this.updateChunkLight(renderchunk, (Set)null, (Set)null); + } + } + + public Entity getEntity() + { + return this.entity; + } + + public double getLastPosX() + { + return this.lastPosX; + } + + public double getLastPosY() + { + return this.lastPosY; + } + + public double getLastPosZ() + { + return this.lastPosZ; + } + + public int getLastLightLevel() + { + return this.lastLightLevel; + } + + public boolean isUnderwater() + { + return this.underwater; + } + + public double getOffsetY() + { + return this.offsetY; + } + + public String toString() + { + return "Entity: " + this.entity + ", offsetY: " + this.offsetY; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/DynamicLights.java b/Client-1.8.9/src/main/java/net/optifine/DynamicLights.java new file mode 100644 index 0000000..f792dfa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/DynamicLights.java @@ -0,0 +1,506 @@ +package net.optifine; + +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.optifine.config.ConnectedParser; +import net.optifine.config.EntityClassLocator; +import net.optifine.config.IObjectLocator; +import net.optifine.config.ItemLocator; +import net.optifine.reflect.ReflectorForge; +import net.optifine.util.PropertiesOrdered; + +public class DynamicLights +{ + private static DynamicLightsMap mapDynamicLights = new DynamicLightsMap(); + private static Map mapEntityLightLevels = new HashMap(); + private static Map mapItemLightLevels = new HashMap(); + private static long timeUpdateMs = 0L; + private static final double MAX_DIST = 7.5D; + private static final double MAX_DIST_SQ = 56.25D; + private static final int LIGHT_LEVEL_MAX = 15; + private static final int LIGHT_LEVEL_FIRE = 15; + private static final int LIGHT_LEVEL_BLAZE = 10; + private static final int LIGHT_LEVEL_MAGMA_CUBE = 8; + private static final int LIGHT_LEVEL_MAGMA_CUBE_CORE = 13; + private static final int LIGHT_LEVEL_GLOWSTONE_DUST = 8; + private static final int LIGHT_LEVEL_PRISMARINE_CRYSTALS = 8; + private static boolean initialized; + + public static void entityAdded(Entity entityIn, RenderGlobal renderGlobal) + { + } + + public static void entityRemoved(Entity entityIn, RenderGlobal renderGlobal) + { + synchronized (mapDynamicLights) + { + DynamicLight dynamiclight = mapDynamicLights.remove(entityIn.getEntityId()); + + if (dynamiclight != null) + { + dynamiclight.updateLitChunks(renderGlobal); + } + } + } + + public static void update(RenderGlobal renderGlobal) + { + long i = System.currentTimeMillis(); + + if (i >= timeUpdateMs + 50L) + { + timeUpdateMs = i; + + if (!initialized) + { + initialize(); + } + + synchronized (mapDynamicLights) + { + updateMapDynamicLights(renderGlobal); + + if (mapDynamicLights.size() > 0) + { + List list = mapDynamicLights.valueList(); + + for (int j = 0; j < list.size(); ++j) + { + DynamicLight dynamiclight = (DynamicLight)list.get(j); + dynamiclight.update(renderGlobal); + } + } + } + } + } + + private static void initialize() + { + initialized = true; + mapEntityLightLevels.clear(); + mapItemLightLevels.clear(); + String[] astring = ReflectorForge.getForgeModIds(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s, "optifine/dynamic_lights.properties"); + InputStream inputstream = Config.getResourceStream(resourcelocation); + loadModConfiguration(inputstream, resourcelocation.toString(), s); + } + catch (IOException var5) + { + ; + } + } + + if (mapEntityLightLevels.size() > 0) + { + Config.dbg("DynamicLights entities: " + mapEntityLightLevels.size()); + } + + if (mapItemLightLevels.size() > 0) + { + Config.dbg("DynamicLights items: " + mapItemLightLevels.size()); + } + } + + private static void loadModConfiguration(InputStream in, String path, String modId) + { + if (in != null) + { + try + { + Properties properties = new PropertiesOrdered(); + properties.load(in); + in.close(); + Config.dbg("DynamicLights: Parsing " + path); + ConnectedParser connectedparser = new ConnectedParser("DynamicLights"); + loadModLightLevels(properties.getProperty("entities"), mapEntityLightLevels, new EntityClassLocator(), connectedparser, path, modId); + loadModLightLevels(properties.getProperty("items"), mapItemLightLevels, new ItemLocator(), connectedparser, path, modId); + } + catch (IOException var5) + { + Config.warn("DynamicLights: Error reading " + path); + } + } + } + + private static void loadModLightLevels(String prop, Map mapLightLevels, IObjectLocator ol, ConnectedParser cp, String path, String modId) + { + if (prop != null) + { + String[] astring = Config.tokenize(prop, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + String[] astring1 = Config.tokenize(s, ":"); + + if (astring1.length != 2) + { + cp.warn("Invalid entry: " + s + ", in:" + path); + } + else + { + String s1 = astring1[0]; + String s2 = astring1[1]; + String s3 = modId + ":" + s1; + ResourceLocation resourcelocation = new ResourceLocation(s3); + Object object = ol.getObject(resourcelocation); + + if (object == null) + { + cp.warn("Object not found: " + s3); + } + else + { + int j = cp.parseInt(s2, -1); + + if (j >= 0 && j <= 15) + { + mapLightLevels.put(object, new Integer(j)); + } + else + { + cp.warn("Invalid light level: " + s); + } + } + } + } + } + } + + private static void updateMapDynamicLights(RenderGlobal renderGlobal) + { + World world = renderGlobal.getWorld(); + + if (world != null) + { + for (Entity entity : world.getLoadedEntityList()) + { + int i = getLightLevel(entity); + + if (i > 0) + { + int j = entity.getEntityId(); + DynamicLight dynamiclight = mapDynamicLights.get(j); + + if (dynamiclight == null) + { + dynamiclight = new DynamicLight(entity); + mapDynamicLights.put(j, dynamiclight); + } + } + else + { + int k = entity.getEntityId(); + DynamicLight dynamiclight1 = mapDynamicLights.remove(k); + + if (dynamiclight1 != null) + { + dynamiclight1.updateLitChunks(renderGlobal); + } + } + } + } + } + + public static int getCombinedLight(BlockPos pos, int combinedLight) + { + double d0 = getLightLevel(pos); + combinedLight = getCombinedLight(d0, combinedLight); + return combinedLight; + } + + public static int getCombinedLight(Entity entity, int combinedLight) + { + double d0 = (double)getLightLevel(entity); + combinedLight = getCombinedLight(d0, combinedLight); + return combinedLight; + } + + public static int getCombinedLight(double lightPlayer, int combinedLight) + { + if (lightPlayer > 0.0D) + { + int i = (int)(lightPlayer * 16.0D); + int j = combinedLight & 255; + + if (i > j) + { + combinedLight = combinedLight & -256; + combinedLight = combinedLight | i; + } + } + + return combinedLight; + } + + public static double getLightLevel(BlockPos pos) + { + double d0 = 0.0D; + + synchronized (mapDynamicLights) + { + List list = mapDynamicLights.valueList(); + int i = list.size(); + + for (int j = 0; j < i; ++j) + { + DynamicLight dynamiclight = (DynamicLight)list.get(j); + int k = dynamiclight.getLastLightLevel(); + + if (k > 0) + { + double d1 = dynamiclight.getLastPosX(); + double d2 = dynamiclight.getLastPosY(); + double d3 = dynamiclight.getLastPosZ(); + double d4 = (double)pos.getX() - d1; + double d5 = (double)pos.getY() - d2; + double d6 = (double)pos.getZ() - d3; + double d7 = d4 * d4 + d5 * d5 + d6 * d6; + + if (dynamiclight.isUnderwater() && !Config.isClearWater()) + { + k = Config.limit(k - 2, 0, 15); + d7 *= 2.0D; + } + + if (d7 <= 56.25D) + { + double d8 = Math.sqrt(d7); + double d9 = 1.0D - d8 / 7.5D; + double d10 = d9 * (double)k; + + if (d10 > d0) + { + d0 = d10; + } + } + } + } + } + + double d11 = Config.limit(d0, 0.0D, 15.0D); + return d11; + } + + public static int getLightLevel(ItemStack itemStack) + { + if (itemStack == null) + { + return 0; + } + else + { + Item item = itemStack.getItem(); + + if (item instanceof ItemBlock) + { + ItemBlock itemblock = (ItemBlock)item; + Block block = itemblock.getBlock(); + + if (block != null) + { + return block.getLightValue(); + } + } + + if (item == Items.lava_bucket) + { + return Blocks.lava.getLightValue(); + } + else if (item != Items.blaze_rod && item != Items.blaze_powder) + { + if (item == Items.glowstone_dust) + { + return 8; + } + else if (item == Items.prismarine_crystals) + { + return 8; + } + else if (item == Items.magma_cream) + { + return 8; + } + else if (item == Items.nether_star) + { + return Blocks.beacon.getLightValue() / 2; + } + else + { + if (!mapItemLightLevels.isEmpty()) + { + Integer integer = (Integer)mapItemLightLevels.get(item); + + if (integer != null) + { + return integer.intValue(); + } + } + + return 0; + } + } + else + { + return 10; + } + } + } + + public static int getLightLevel(Entity entity) + { + if (entity == Config.getMinecraft().getRenderViewEntity() && !Config.isDynamicHandLight()) + { + return 0; + } + else + { + if (entity instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)entity; + + if (entityplayer.isSpectator()) + { + return 0; + } + } + + if (entity.isBurning()) + { + return 15; + } + else + { + if (!mapEntityLightLevels.isEmpty()) + { + Integer integer = (Integer)mapEntityLightLevels.get(entity.getClass()); + + if (integer != null) + { + return integer.intValue(); + } + } + + if (entity instanceof EntityFireball) + { + return 15; + } + else if (entity instanceof EntityTNTPrimed) + { + return 15; + } + else if (entity instanceof EntityBlaze) + { + EntityBlaze entityblaze = (EntityBlaze)entity; + return entityblaze.func_70845_n() ? 15 : 10; + } + else if (entity instanceof EntityMagmaCube) + { + EntityMagmaCube entitymagmacube = (EntityMagmaCube)entity; + return (double)entitymagmacube.squishFactor > 0.6D ? 13 : 8; + } + else + { + if (entity instanceof EntityCreeper) + { + EntityCreeper entitycreeper = (EntityCreeper)entity; + + if ((double)entitycreeper.getCreeperFlashIntensity(0.0F) > 0.001D) + { + return 15; + } + } + + if (entity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)entity; + ItemStack itemstack2 = entitylivingbase.getHeldItem(); + int i = getLightLevel(itemstack2); + ItemStack itemstack1 = entitylivingbase.getEquipmentInSlot(4); + int j = getLightLevel(itemstack1); + return Math.max(i, j); + } + else if (entity instanceof EntityItem) + { + EntityItem entityitem = (EntityItem)entity; + ItemStack itemstack = getItemStack(entityitem); + return getLightLevel(itemstack); + } + else + { + return 0; + } + } + } + } + } + + public static void removeLights(RenderGlobal renderGlobal) + { + synchronized (mapDynamicLights) + { + List list = mapDynamicLights.valueList(); + + for (int i = 0; i < list.size(); ++i) + { + DynamicLight dynamiclight = (DynamicLight)list.get(i); + dynamiclight.updateLitChunks(renderGlobal); + } + + mapDynamicLights.clear(); + } + } + + public static void clear() + { + synchronized (mapDynamicLights) + { + mapDynamicLights.clear(); + } + } + + public static int getCount() + { + synchronized (mapDynamicLights) + { + return mapDynamicLights.size(); + } + } + + public static ItemStack getItemStack(EntityItem entityItem) + { + ItemStack itemstack = entityItem.getDataWatcher().getWatchableObjectItemStack(10); + return itemstack; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/DynamicLightsMap.java b/Client-1.8.9/src/main/java/net/optifine/DynamicLightsMap.java new file mode 100644 index 0000000..3ea9bed --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/DynamicLightsMap.java @@ -0,0 +1,66 @@ +package net.optifine; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DynamicLightsMap +{ + private Map map = new HashMap(); + private List list = new ArrayList(); + private boolean dirty = false; + + public DynamicLight put(int id, DynamicLight dynamicLight) + { + DynamicLight dynamiclight = (DynamicLight)this.map.put(Integer.valueOf(id), dynamicLight); + this.setDirty(); + return dynamiclight; + } + + public DynamicLight get(int id) + { + return (DynamicLight)this.map.get(Integer.valueOf(id)); + } + + public int size() + { + return this.map.size(); + } + + public DynamicLight remove(int id) + { + DynamicLight dynamiclight = (DynamicLight)this.map.remove(Integer.valueOf(id)); + + if (dynamiclight != null) + { + this.setDirty(); + } + + return dynamiclight; + } + + public void clear() + { + this.map.clear(); + this.list.clear(); + this.setDirty(); + } + + private void setDirty() + { + this.dirty = true; + } + + public List valueList() + { + if (this.dirty) + { + this.list.clear(); + this.list.addAll(this.map.values()); + this.dirty = false; + } + + return this.list; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/EmissiveTextures.java b/Client-1.8.9/src/main/java/net/optifine/EmissiveTextures.java new file mode 100644 index 0000000..cdfa26d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/EmissiveTextures.java @@ -0,0 +1,204 @@ +package net.optifine; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.Properties; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.util.PropertiesOrdered; + +public class EmissiveTextures +{ + private static String suffixEmissive = null; + private static String suffixEmissivePng = null; + private static boolean active = false; + private static boolean render = false; + private static boolean hasEmissive = false; + private static boolean renderEmissive = false; + private static float lightMapX; + private static float lightMapY; + private static final String SUFFIX_PNG = ".png"; + private static final ResourceLocation LOCATION_EMPTY = new ResourceLocation("mcpatcher/ctm/default/empty.png"); + + public static boolean isActive() + { + return active; + } + + public static String getSuffixEmissive() + { + return suffixEmissive; + } + + public static void beginRender() + { + render = true; + hasEmissive = false; + } + + public static ITextureObject getEmissiveTexture(ITextureObject texture, Map mapTextures) + { + if (!render) + { + return texture; + } + else if (!(texture instanceof SimpleTexture)) + { + return texture; + } + else + { + SimpleTexture simpletexture = (SimpleTexture)texture; + ResourceLocation resourcelocation = simpletexture.locationEmissive; + + if (!renderEmissive) + { + if (resourcelocation != null) + { + hasEmissive = true; + } + + return texture; + } + else + { + if (resourcelocation == null) + { + resourcelocation = LOCATION_EMPTY; + } + + ITextureObject itextureobject = (ITextureObject)mapTextures.get(resourcelocation); + + if (itextureobject == null) + { + itextureobject = new SimpleTexture(resourcelocation); + TextureManager texturemanager = Config.getTextureManager(); + texturemanager.loadTexture(resourcelocation, itextureobject); + } + + return itextureobject; + } + } + } + + public static boolean hasEmissive() + { + return hasEmissive; + } + + public static void beginRenderEmissive() + { + lightMapX = OpenGlHelper.lastBrightnessX; + lightMapY = OpenGlHelper.lastBrightnessY; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, lightMapY); + renderEmissive = true; + } + + public static void endRenderEmissive() + { + renderEmissive = false; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightMapX, lightMapY); + } + + public static void endRender() + { + render = false; + hasEmissive = false; + } + + public static void update() + { + active = false; + suffixEmissive = null; + suffixEmissivePng = null; + + if (Config.isEmissiveTextures()) + { + try + { + String s = "optifine/emissive.properties"; + ResourceLocation resourcelocation = new ResourceLocation(s); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return; + } + + dbg("Loading " + s); + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + suffixEmissive = properties.getProperty("suffix.emissive"); + + if (suffixEmissive != null) + { + suffixEmissivePng = suffixEmissive + ".png"; + } + + active = suffixEmissive != null; + } + catch (FileNotFoundException var4) + { + return; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + } + + private static void dbg(String str) + { + Config.dbg("EmissiveTextures: " + str); + } + + private static void warn(String str) + { + Config.warn("EmissiveTextures: " + str); + } + + public static boolean isEmissive(ResourceLocation loc) + { + return suffixEmissivePng == null ? false : loc.getResourcePath().endsWith(suffixEmissivePng); + } + + public static void loadTexture(ResourceLocation loc, SimpleTexture tex) + { + if (loc != null && tex != null) + { + tex.isEmissive = false; + tex.locationEmissive = null; + + if (suffixEmissivePng != null) + { + String s = loc.getResourcePath(); + + if (s.endsWith(".png")) + { + if (s.endsWith(suffixEmissivePng)) + { + tex.isEmissive = true; + } + else + { + String s1 = s.substring(0, s.length() - ".png".length()) + suffixEmissivePng; + ResourceLocation resourcelocation = new ResourceLocation(loc.getResourceDomain(), s1); + + if (Config.hasResource(resourcelocation)) + { + tex.locationEmissive = resourcelocation; + } + } + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/GlDebugHandler.java b/Client-1.8.9/src/main/java/net/optifine/GlDebugHandler.java new file mode 100644 index 0000000..cd98368 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/GlDebugHandler.java @@ -0,0 +1,118 @@ +package net.optifine; + +import java.nio.IntBuffer; +import net.minecraft.src.Config; +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.ARBDebugOutput; +import org.lwjgl.opengl.ARBDebugOutputCallback; +import org.lwjgl.opengl.ContextAttribs; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.opengl.PixelFormat; +import org.lwjgl.opengl.ARBDebugOutputCallback.Handler; + +public class GlDebugHandler implements Handler +{ + public static void createDisplayDebug() throws LWJGLException + { + boolean flag = GLContext.getCapabilities().GL_ARB_debug_output; + ContextAttribs contextattribs = (new ContextAttribs()).withDebug(true); + Display.create((new PixelFormat()).withDepthBits(24), contextattribs); + ARBDebugOutput.glDebugMessageCallbackARB(new ARBDebugOutputCallback(new GlDebugHandler())); + ARBDebugOutput.glDebugMessageControlARB(4352, 4352, 4352, (IntBuffer)null, true); + GL11.glEnable(33346); + } + + public void handleMessage(int source, int type, int id, int severity, String message) + { + if (!message.contains("glBindFramebuffer")) + { + if (!message.contains("Wide lines")) + { + if (!message.contains("shader recompiled")) + { + Config.dbg("[LWJGL] source: " + this.getSource(source) + ", type: " + this.getType(type) + ", id: " + id + ", severity: " + this.getSeverity(severity) + ", message: " + message); + (new Throwable("StackTrace")).printStackTrace(); + } + } + } + } + + public String getSource(int source) + { + switch (source) + { + case 33350: + return "API"; + + case 33351: + return "WIN"; + + case 33352: + return "SHADER"; + + case 33353: + return "EXT"; + + case 33354: + return "APP"; + + case 33355: + return "OTHER"; + + default: + return this.getUnknown(source); + } + } + + public String getType(int type) + { + switch (type) + { + case 33356: + return "ERROR"; + + case 33357: + return "DEPRECATED"; + + case 33358: + return "UNDEFINED"; + + case 33359: + return "PORTABILITY"; + + case 33360: + return "PERFORMANCE"; + + case 33361: + return "OTHER"; + + default: + return this.getUnknown(type); + } + } + + public String getSeverity(int severity) + { + switch (severity) + { + case 37190: + return "HIGH"; + + case 37191: + return "MEDIUM"; + + case 37192: + return "LOW"; + + default: + return this.getUnknown(severity); + } + } + + private String getUnknown(int token) + { + return "Unknown (0x" + Integer.toHexString(token).toUpperCase() + ")"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/GlErrors.java b/Client-1.8.9/src/main/java/net/optifine/GlErrors.java new file mode 100644 index 0000000..9dd5adc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/GlErrors.java @@ -0,0 +1,66 @@ +package net.optifine; + +import net.minecraft.src.Config; + +public class GlErrors +{ + private static boolean frameStarted = false; + private static long timeCheckStartMs = -1L; + private static int countErrors = 0; + private static int countErrorsSuppressed = 0; + private static boolean suppressed = false; + private static boolean oneErrorEnabled = false; + private static final long CHECK_INTERVAL_MS = 3000L; + private static final int CHECK_ERROR_MAX = 10; + + public static void frameStart() + { + frameStarted = true; + + if (timeCheckStartMs < 0L) + { + timeCheckStartMs = System.currentTimeMillis(); + } + + if (System.currentTimeMillis() > timeCheckStartMs + 3000L) + { + if (countErrorsSuppressed > 0) + { + Config.error("Suppressed " + countErrors + " OpenGL errors"); + } + + suppressed = countErrors > 10; + timeCheckStartMs = System.currentTimeMillis(); + countErrors = 0; + countErrorsSuppressed = 0; + oneErrorEnabled = true; + } + } + + public static boolean isEnabled(int error) + { + if (!frameStarted) + { + return true; + } + else + { + ++countErrors; + + if (oneErrorEnabled) + { + oneErrorEnabled = false; + return true; + } + else + { + if (suppressed) + { + ++countErrorsSuppressed; + } + + return !suppressed; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/IRandomEntity.java b/Client-1.8.9/src/main/java/net/optifine/IRandomEntity.java new file mode 100644 index 0000000..e64b921 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/IRandomEntity.java @@ -0,0 +1,19 @@ +package net.optifine; + +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase; + +public interface IRandomEntity +{ + int getId(); + + BlockPos getSpawnPosition(); + + BiomeGenBase getSpawnBiome(); + + String getName(); + + int getHealth(); + + int getMaxHealth(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/Lagometer.java b/Client-1.8.9/src/main/java/net/optifine/Lagometer.java new file mode 100644 index 0000000..825bff4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/Lagometer.java @@ -0,0 +1,240 @@ +package net.optifine; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.profiler.Profiler; +import net.minecraft.src.Config; +import net.optifine.util.MemoryMonitor; +import org.lwjgl.opengl.GL11; + +public class Lagometer +{ + private static Minecraft mc; + private static GameSettings gameSettings; + private static Profiler profiler; + public static boolean active = false; + public static Lagometer.TimerNano timerTick = new Lagometer.TimerNano(); + public static Lagometer.TimerNano timerScheduledExecutables = new Lagometer.TimerNano(); + public static Lagometer.TimerNano timerChunkUpload = new Lagometer.TimerNano(); + public static Lagometer.TimerNano timerChunkUpdate = new Lagometer.TimerNano(); + public static Lagometer.TimerNano timerVisibility = new Lagometer.TimerNano(); + public static Lagometer.TimerNano timerTerrain = new Lagometer.TimerNano(); + public static Lagometer.TimerNano timerServer = new Lagometer.TimerNano(); + private static long[] timesFrame = new long[512]; + private static long[] timesTick = new long[512]; + private static long[] timesScheduledExecutables = new long[512]; + private static long[] timesChunkUpload = new long[512]; + private static long[] timesChunkUpdate = new long[512]; + private static long[] timesVisibility = new long[512]; + private static long[] timesTerrain = new long[512]; + private static long[] timesServer = new long[512]; + private static boolean[] gcs = new boolean[512]; + private static int numRecordedFrameTimes = 0; + private static long prevFrameTimeNano = -1L; + private static long renderTimeNano = 0L; + + public static void updateLagometer() + { + if (mc == null) + { + mc = Minecraft.getMinecraft(); + gameSettings = mc.gameSettings; + profiler = mc.mcProfiler; + } + + if (gameSettings.showDebugInfo && (gameSettings.ofLagometer || gameSettings.showLagometer)) + { + active = true; + long timeNowNano = System.nanoTime(); + + if (prevFrameTimeNano == -1L) + { + prevFrameTimeNano = timeNowNano; + } + else + { + int j = numRecordedFrameTimes & timesFrame.length - 1; + ++numRecordedFrameTimes; + boolean flag = MemoryMonitor.isGcEvent(); + timesFrame[j] = timeNowNano - prevFrameTimeNano - renderTimeNano; + timesTick[j] = timerTick.timeNano; + timesScheduledExecutables[j] = timerScheduledExecutables.timeNano; + timesChunkUpload[j] = timerChunkUpload.timeNano; + timesChunkUpdate[j] = timerChunkUpdate.timeNano; + timesVisibility[j] = timerVisibility.timeNano; + timesTerrain[j] = timerTerrain.timeNano; + timesServer[j] = timerServer.timeNano; + gcs[j] = flag; + timerTick.reset(); + timerScheduledExecutables.reset(); + timerVisibility.reset(); + timerChunkUpdate.reset(); + timerChunkUpload.reset(); + timerTerrain.reset(); + timerServer.reset(); + prevFrameTimeNano = System.nanoTime(); + } + } + else + { + active = false; + prevFrameTimeNano = -1L; + } + } + + public static void showLagometer(ScaledResolution scaledResolution) + { + if (gameSettings != null) + { + if (gameSettings.ofLagometer || gameSettings.showLagometer) + { + long i = System.nanoTime(); + GlStateManager.clear(256); + GlStateManager.matrixMode(5889); + GlStateManager.pushMatrix(); + GlStateManager.enableColorMaterial(); + GlStateManager.loadIdentity(); + GlStateManager.ortho(0.0D, (double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 1000.0D, 3000.0D); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.translate(0.0F, 0.0F, -2000.0F); + GL11.glLineWidth(1.0F); + GlStateManager.disableTexture2D(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(1, DefaultVertexFormats.POSITION_COLOR); + + for (int j = 0; j < timesFrame.length; ++j) + { + int k = (j - numRecordedFrameTimes & timesFrame.length - 1) * 100 / timesFrame.length; + k = k + 155; + float f = (float)mc.displayHeight; + long l = 0L; + + if (gcs[j]) + { + renderTime(j, timesFrame[j], k, k / 2, 0, f, worldrenderer); + } + else + { + renderTime(j, timesFrame[j], k, k, k, f, worldrenderer); + f = f - (float)renderTime(j, timesServer[j], k / 2, k / 2, k / 2, f, worldrenderer); + f = f - (float)renderTime(j, timesTerrain[j], 0, k, 0, f, worldrenderer); + f = f - (float)renderTime(j, timesVisibility[j], k, k, 0, f, worldrenderer); + f = f - (float)renderTime(j, timesChunkUpdate[j], k, 0, 0, f, worldrenderer); + f = f - (float)renderTime(j, timesChunkUpload[j], k, 0, k, f, worldrenderer); + f = f - (float)renderTime(j, timesScheduledExecutables[j], 0, 0, k, f, worldrenderer); + float f2 = f - (float)renderTime(j, timesTick[j], 0, k, k, f, worldrenderer); + } + } + + renderTimeDivider(0, timesFrame.length, 33333333L, 196, 196, 196, (float)mc.displayHeight, worldrenderer); + renderTimeDivider(0, timesFrame.length, 16666666L, 196, 196, 196, (float)mc.displayHeight, worldrenderer); + tessellator.draw(); + GlStateManager.enableTexture2D(); + int j2 = mc.displayHeight - 80; + int k2 = mc.displayHeight - 160; + mc.fontRendererObj.drawString("30", 2, k2 + 1, -8947849); + mc.fontRendererObj.drawString("30", 1, k2, -3881788); + mc.fontRendererObj.drawString("60", 2, j2 + 1, -8947849); + mc.fontRendererObj.drawString("60", 1, j2, -3881788); + GlStateManager.matrixMode(5889); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.enableTexture2D(); + float f1 = 1.0F - (float)((double)(System.currentTimeMillis() - MemoryMonitor.getStartTimeMs()) / 1000.0D); + f1 = Config.limit(f1, 0.0F, 1.0F); + int l2 = (int)(170.0F + f1 * 85.0F); + int i1 = (int)(100.0F + f1 * 55.0F); + int j1 = (int)(10.0F + f1 * 10.0F); + int k1 = l2 << 16 | i1 << 8 | j1; + int l1 = 512 / scaledResolution.getScaleFactor() + 2; + int i2 = mc.displayHeight / scaledResolution.getScaleFactor() - 8; + GuiIngame guiingame = mc.ingameGUI; + GuiIngame.drawRect(l1 - 1, i2 - 1, l1 + 50, i2 + 10, -1605349296); + mc.fontRendererObj.drawString(" " + MemoryMonitor.getAllocationRateMb() + " MB/s", l1, i2, k1); + renderTimeNano = System.nanoTime() - i; + } + } + } + + private static long renderTime(int frameNum, long time, int r, int g, int b, float baseHeight, WorldRenderer tessellator) + { + long i = time / 200000L; + + if (i < 3L) + { + return 0L; + } + else + { + tessellator.pos((double)((float)frameNum + 0.5F), (double)(baseHeight - (float)i + 0.5F), 0.0D).color(r, g, b, 255).endVertex(); + tessellator.pos((double)((float)frameNum + 0.5F), (double)(baseHeight + 0.5F), 0.0D).color(r, g, b, 255).endVertex(); + return i; + } + } + + private static long renderTimeDivider(int frameStart, int frameEnd, long time, int r, int g, int b, float baseHeight, WorldRenderer tessellator) + { + long i = time / 200000L; + + if (i < 3L) + { + return 0L; + } + else + { + tessellator.pos((double)((float)frameStart + 0.5F), (double)(baseHeight - (float)i + 0.5F), 0.0D).color(r, g, b, 255).endVertex(); + tessellator.pos((double)((float)frameEnd + 0.5F), (double)(baseHeight - (float)i + 0.5F), 0.0D).color(r, g, b, 255).endVertex(); + return i; + } + } + + public static boolean isActive() + { + return active; + } + + public static class TimerNano + { + public long timeStartNano = 0L; + public long timeNano = 0L; + + public void start() + { + if (Lagometer.active) + { + if (this.timeStartNano == 0L) + { + this.timeStartNano = System.nanoTime(); + } + } + } + + public void end() + { + if (Lagometer.active) + { + if (this.timeStartNano != 0L) + { + this.timeNano += System.nanoTime() - this.timeStartNano; + this.timeStartNano = 0L; + } + } + } + + private void reset() + { + this.timeNano = 0L; + this.timeStartNano = 0L; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/Lang.java b/Client-1.8.9/src/main/java/net/optifine/Lang.java new file mode 100644 index 0000000..1c8d989 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/Lang.java @@ -0,0 +1,133 @@ +package net.optifine; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +public class Lang +{ + private static final Splitter splitter = Splitter.on('=').limit(2); + private static final Pattern pattern = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + + public static void resourcesReloaded() + { + Map map = I18n.getLocaleProperties(); + List list = new ArrayList(); + String s = "optifine/lang/"; + String s1 = "en_US"; + String s2 = ".lang"; + list.add(s + s1 + s2); + + if (!Config.getGameSettings().language.equals(s1)) + { + list.add(s + Config.getGameSettings().language + s2); + } + + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + loadResources(Config.getDefaultResourcePack(), astring, map); + IResourcePack[] airesourcepack = Config.getResourcePacks(); + + for (int i = 0; i < airesourcepack.length; ++i) + { + IResourcePack iresourcepack = airesourcepack[i]; + loadResources(iresourcepack, astring, map); + } + } + + private static void loadResources(IResourcePack rp, String[] files, Map localeProperties) + { + try + { + for (int i = 0; i < files.length; ++i) + { + String s = files[i]; + ResourceLocation resourcelocation = new ResourceLocation(s); + + if (rp.resourceExists(resourcelocation)) + { + InputStream inputstream = rp.getInputStream(resourcelocation); + + if (inputstream != null) + { + loadLocaleData(inputstream, localeProperties); + } + } + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + public static void loadLocaleData(InputStream is, Map localeProperties) throws IOException + { + Iterator iterator = IOUtils.readLines(is, Charsets.UTF_8).iterator(); + is.close(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + if (!s.isEmpty() && s.charAt(0) != 35) + { + String[] astring = (String[])((String[])Iterables.toArray(splitter.split(s), String.class)); + + if (astring != null && astring.length == 2) + { + String s1 = astring[0]; + String s2 = pattern.matcher(astring[1]).replaceAll("%$1s"); + localeProperties.put(s1, s2); + } + } + } + } + + public static String get(String key) + { + return I18n.format(key, new Object[0]); + } + + public static String get(String key, String def) + { + String s = I18n.format(key, new Object[0]); + return s != null && !s.equals(key) ? s : def; + } + + public static String getOn() + { + return I18n.format("options.on", new Object[0]); + } + + public static String getOff() + { + return I18n.format("options.off", new Object[0]); + } + + public static String getFast() + { + return I18n.format("options.graphics.fast", new Object[0]); + } + + public static String getFancy() + { + return I18n.format("options.graphics.fancy", new Object[0]); + } + + public static String getDefault() + { + return I18n.format("generator.default", new Object[0]); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/LightMap.java b/Client-1.8.9/src/main/java/net/optifine/LightMap.java new file mode 100644 index 0000000..858f8d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/LightMap.java @@ -0,0 +1,149 @@ +package net.optifine; + +import net.minecraft.src.Config; +import net.minecraft.world.World; + +public class LightMap +{ + private CustomColormap lightMapRgb = null; + private float[][] sunRgbs = new float[16][3]; + private float[][] torchRgbs = new float[16][3]; + + public LightMap(CustomColormap lightMapRgb) + { + this.lightMapRgb = lightMapRgb; + } + + public CustomColormap getColormap() + { + return this.lightMapRgb; + } + + public boolean updateLightmap(World world, float torchFlickerX, int[] lmColors, boolean nightvision) + { + if (this.lightMapRgb == null) + { + return false; + } + else + { + int i = this.lightMapRgb.getHeight(); + + if (nightvision && i < 64) + { + return false; + } + else + { + int j = this.lightMapRgb.getWidth(); + + if (j < 16) + { + warn("Invalid lightmap width: " + j); + this.lightMapRgb = null; + return false; + } + else + { + int k = 0; + + if (nightvision) + { + k = j * 16 * 2; + } + + float f = 1.1666666F * (world.getSunBrightness(1.0F) - 0.2F); + + if (world.getLastLightningBolt() > 0) + { + f = 1.0F; + } + + f = Config.limitTo1(f); + float f1 = f * (float)(j - 1); + float f2 = Config.limitTo1(torchFlickerX + 0.5F) * (float)(j - 1); + float f3 = Config.limitTo1(Config.getGameSettings().gammaSetting); + boolean flag = f3 > 1.0E-4F; + float[][] afloat = this.lightMapRgb.getColorsRgb(); + this.getLightMapColumn(afloat, f1, k, j, this.sunRgbs); + this.getLightMapColumn(afloat, f2, k + 16 * j, j, this.torchRgbs); + float[] afloat1 = new float[3]; + + for (int l = 0; l < 16; ++l) + { + for (int i1 = 0; i1 < 16; ++i1) + { + for (int j1 = 0; j1 < 3; ++j1) + { + float f4 = Config.limitTo1(this.sunRgbs[l][j1] + this.torchRgbs[i1][j1]); + + if (flag) + { + float f5 = 1.0F - f4; + f5 = 1.0F - f5 * f5 * f5 * f5; + f4 = f3 * f5 + (1.0F - f3) * f4; + } + + afloat1[j1] = f4; + } + + int k1 = (int)(afloat1[0] * 255.0F); + int l1 = (int)(afloat1[1] * 255.0F); + int i2 = (int)(afloat1[2] * 255.0F); + lmColors[l * 16 + i1] = -16777216 | k1 << 16 | l1 << 8 | i2; + } + } + + return true; + } + } + } + } + + private void getLightMapColumn(float[][] origMap, float x, int offset, int width, float[][] colRgb) + { + int i = (int)Math.floor((double)x); + int j = (int)Math.ceil((double)x); + + if (i == j) + { + for (int i1 = 0; i1 < 16; ++i1) + { + float[] afloat3 = origMap[offset + i1 * width + i]; + float[] afloat4 = colRgb[i1]; + + for (int j1 = 0; j1 < 3; ++j1) + { + afloat4[j1] = afloat3[j1]; + } + } + } + else + { + float f = 1.0F - (x - (float)i); + float f1 = 1.0F - ((float)j - x); + + for (int k = 0; k < 16; ++k) + { + float[] afloat = origMap[offset + k * width + i]; + float[] afloat1 = origMap[offset + k * width + j]; + float[] afloat2 = colRgb[k]; + + for (int l = 0; l < 3; ++l) + { + afloat2[l] = afloat[l] * f + afloat1[l] * f1; + } + } + } + } + + private static void dbg(String str) + { + Config.dbg("CustomColors: " + str); + } + + private static void warn(String str) + { + Config.warn("CustomColors: " + str); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/LightMapPack.java b/Client-1.8.9/src/main/java/net/optifine/LightMapPack.java new file mode 100644 index 0000000..a57a3f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/LightMapPack.java @@ -0,0 +1,162 @@ +package net.optifine; + +import net.minecraft.world.World; + +public class LightMapPack +{ + private LightMap lightMap; + private LightMap lightMapRain; + private LightMap lightMapThunder; + private int[] colorBuffer1 = new int[0]; + private int[] colorBuffer2 = new int[0]; + + public LightMapPack(LightMap lightMap, LightMap lightMapRain, LightMap lightMapThunder) + { + if (lightMapRain != null || lightMapThunder != null) + { + if (lightMapRain == null) + { + lightMapRain = lightMap; + } + + if (lightMapThunder == null) + { + lightMapThunder = lightMapRain; + } + } + + this.lightMap = lightMap; + this.lightMapRain = lightMapRain; + this.lightMapThunder = lightMapThunder; + } + + public boolean updateLightmap(World world, float torchFlickerX, int[] lmColors, boolean nightvision, float partialTicks) + { + if (this.lightMapRain == null && this.lightMapThunder == null) + { + return this.lightMap.updateLightmap(world, torchFlickerX, lmColors, nightvision); + } + else + { + int i = world.provider.getDimensionId(); + + if (i != 1 && i != -1) + { + float f = world.getRainStrength(partialTicks); + float f1 = world.getThunderStrength(partialTicks); + float f2 = 1.0E-4F; + boolean flag = f > f2; + boolean flag1 = f1 > f2; + + if (!flag && !flag1) + { + return this.lightMap.updateLightmap(world, torchFlickerX, lmColors, nightvision); + } + else + { + if (f > 0.0F) + { + f1 /= f; + } + + float f3 = 1.0F - f; + float f4 = f - f1; + + if (this.colorBuffer1.length != lmColors.length) + { + this.colorBuffer1 = new int[lmColors.length]; + this.colorBuffer2 = new int[lmColors.length]; + } + + int j = 0; + int[][] aint = new int[][] {lmColors, this.colorBuffer1, this.colorBuffer2}; + float[] afloat = new float[3]; + + if (f3 > f2 && this.lightMap.updateLightmap(world, torchFlickerX, aint[j], nightvision)) + { + afloat[j] = f3; + ++j; + } + + if (f4 > f2 && this.lightMapRain != null && this.lightMapRain.updateLightmap(world, torchFlickerX, aint[j], nightvision)) + { + afloat[j] = f4; + ++j; + } + + if (f1 > f2 && this.lightMapThunder != null && this.lightMapThunder.updateLightmap(world, torchFlickerX, aint[j], nightvision)) + { + afloat[j] = f1; + ++j; + } + + return j == 2 ? this.blend(aint[0], afloat[0], aint[1], afloat[1]) : (j == 3 ? this.blend(aint[0], afloat[0], aint[1], afloat[1], aint[2], afloat[2]) : true); + } + } + else + { + return this.lightMap.updateLightmap(world, torchFlickerX, lmColors, nightvision); + } + } + } + + private boolean blend(int[] cols0, float br0, int[] cols1, float br1) + { + if (cols1.length != cols0.length) + { + return false; + } + else + { + for (int i = 0; i < cols0.length; ++i) + { + int j = cols0[i]; + int k = j >> 16 & 255; + int l = j >> 8 & 255; + int i1 = j & 255; + int j1 = cols1[i]; + int k1 = j1 >> 16 & 255; + int l1 = j1 >> 8 & 255; + int i2 = j1 & 255; + int j2 = (int)((float)k * br0 + (float)k1 * br1); + int k2 = (int)((float)l * br0 + (float)l1 * br1); + int l2 = (int)((float)i1 * br0 + (float)i2 * br1); + cols0[i] = -16777216 | j2 << 16 | k2 << 8 | l2; + } + + return true; + } + } + + private boolean blend(int[] cols0, float br0, int[] cols1, float br1, int[] cols2, float br2) + { + if (cols1.length == cols0.length && cols2.length == cols0.length) + { + for (int i = 0; i < cols0.length; ++i) + { + int j = cols0[i]; + int k = j >> 16 & 255; + int l = j >> 8 & 255; + int i1 = j & 255; + int j1 = cols1[i]; + int k1 = j1 >> 16 & 255; + int l1 = j1 >> 8 & 255; + int i2 = j1 & 255; + int j2 = cols2[i]; + int k2 = j2 >> 16 & 255; + int l2 = j2 >> 8 & 255; + int i3 = j2 & 255; + int j3 = (int)((float)k * br0 + (float)k1 * br1 + (float)k2 * br2); + int k3 = (int)((float)l * br0 + (float)l1 * br1 + (float)l2 * br2); + int l3 = (int)((float)i1 * br0 + (float)i2 * br1 + (float)i3 * br2); + cols0[i] = -16777216 | j3 << 16 | k3 << 8 | l3; + } + + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/Log.java b/Client-1.8.9/src/main/java/net/optifine/Log.java new file mode 100644 index 0000000..1a59514 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/Log.java @@ -0,0 +1,48 @@ +package net.optifine; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Log +{ + private static final Logger LOGGER = LogManager.getLogger(); + public static final boolean logDetail = System.getProperty("log.detail", "false").equals("true"); + + public static void detail(String s) + { + if (logDetail) + { + LOGGER.info("[OptiFine] " + s); + } + } + + public static void dbg(String s) + { + LOGGER.info("[OptiFine] " + s); + } + + public static void warn(String s) + { + LOGGER.warn("[OptiFine] " + s); + } + + public static void warn(String s, Throwable t) + { + LOGGER.warn("[OptiFine] " + s, t); + } + + public static void error(String s) + { + LOGGER.error("[OptiFine] " + s); + } + + public static void error(String s, Throwable t) + { + LOGGER.error("[OptiFine] " + s, t); + } + + public static void log(String s) + { + dbg(s); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/Mipmaps.java b/Client-1.8.9/src/main/java/net/optifine/Mipmaps.java new file mode 100644 index 0000000..4319920 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/Mipmaps.java @@ -0,0 +1,220 @@ +package net.optifine; + +import java.awt.Dimension; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.src.Config; +import net.optifine.util.TextureUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class Mipmaps +{ + private final String iconName; + private final int width; + private final int height; + private final int[] data; + private final boolean direct; + private int[][] mipmapDatas; + private IntBuffer[] mipmapBuffers; + private Dimension[] mipmapDimensions; + + public Mipmaps(String iconName, int width, int height, int[] data, boolean direct) + { + this.iconName = iconName; + this.width = width; + this.height = height; + this.data = data; + this.direct = direct; + this.mipmapDimensions = makeMipmapDimensions(width, height, iconName); + this.mipmapDatas = generateMipMapData(data, width, height, this.mipmapDimensions); + + if (direct) + { + this.mipmapBuffers = makeMipmapBuffers(this.mipmapDimensions, this.mipmapDatas); + } + } + + public static Dimension[] makeMipmapDimensions(int width, int height, String iconName) + { + int i = TextureUtils.ceilPowerOfTwo(width); + int j = TextureUtils.ceilPowerOfTwo(height); + + if (i == width && j == height) + { + List list = new ArrayList(); + int k = i; + int l = j; + + while (true) + { + k /= 2; + l /= 2; + + if (k <= 0 && l <= 0) + { + Dimension[] adimension = (Dimension[])((Dimension[])list.toArray(new Dimension[list.size()])); + return adimension; + } + + if (k <= 0) + { + k = 1; + } + + if (l <= 0) + { + l = 1; + } + + int i1 = k * l * 4; + Dimension dimension = new Dimension(k, l); + list.add(dimension); + } + } + else + { + Config.warn("Mipmaps not possible (power of 2 dimensions needed), texture: " + iconName + ", dim: " + width + "x" + height); + return new Dimension[0]; + } + } + + public static int[][] generateMipMapData(int[] data, int width, int height, Dimension[] mipmapDimensions) + { + int[] aint = data; + int i = width; + boolean flag = true; + int[][] aint1 = new int[mipmapDimensions.length][]; + + for (int j = 0; j < mipmapDimensions.length; ++j) + { + Dimension dimension = mipmapDimensions[j]; + int k = dimension.width; + int l = dimension.height; + int[] aint2 = new int[k * l]; + aint1[j] = aint2; + int i1 = j + 1; + + if (flag) + { + for (int j1 = 0; j1 < k; ++j1) + { + for (int k1 = 0; k1 < l; ++k1) + { + int l1 = aint[j1 * 2 + 0 + (k1 * 2 + 0) * i]; + int i2 = aint[j1 * 2 + 1 + (k1 * 2 + 0) * i]; + int j2 = aint[j1 * 2 + 1 + (k1 * 2 + 1) * i]; + int k2 = aint[j1 * 2 + 0 + (k1 * 2 + 1) * i]; + int l2 = alphaBlend(l1, i2, j2, k2); + aint2[j1 + k1 * k] = l2; + } + } + } + + aint = aint2; + i = k; + + if (k <= 1 || l <= 1) + { + flag = false; + } + } + + return aint1; + } + + public static int alphaBlend(int c1, int c2, int c3, int c4) + { + int i = alphaBlend(c1, c2); + int j = alphaBlend(c3, c4); + int k = alphaBlend(i, j); + return k; + } + + private static int alphaBlend(int c1, int c2) + { + int i = (c1 & -16777216) >> 24 & 255; + int j = (c2 & -16777216) >> 24 & 255; + int k = (i + j) / 2; + + if (i == 0 && j == 0) + { + i = 1; + j = 1; + } + else + { + if (i == 0) + { + c1 = c2; + k /= 2; + } + + if (j == 0) + { + c2 = c1; + k /= 2; + } + } + + int l = (c1 >> 16 & 255) * i; + int i1 = (c1 >> 8 & 255) * i; + int j1 = (c1 & 255) * i; + int k1 = (c2 >> 16 & 255) * j; + int l1 = (c2 >> 8 & 255) * j; + int i2 = (c2 & 255) * j; + int j2 = (l + k1) / (i + j); + int k2 = (i1 + l1) / (i + j); + int l2 = (j1 + i2) / (i + j); + return k << 24 | j2 << 16 | k2 << 8 | l2; + } + + private int averageColor(int i1, int j1) + { + int i = (i1 & -16777216) >> 24 & 255; + int j = (j1 & -16777216) >> 24 & 255; + return (i + j >> 1 << 24) + ((i1 & 16711422) + (j1 & 16711422) >> 1); + } + + public static IntBuffer[] makeMipmapBuffers(Dimension[] mipmapDimensions, int[][] mipmapDatas) + { + if (mipmapDimensions == null) + { + return null; + } + else + { + IntBuffer[] aintbuffer = new IntBuffer[mipmapDimensions.length]; + + for (int i = 0; i < mipmapDimensions.length; ++i) + { + Dimension dimension = mipmapDimensions[i]; + int j = dimension.width * dimension.height; + IntBuffer intbuffer = GLAllocation.createDirectIntBuffer(j); + int[] aint = mipmapDatas[i]; + intbuffer.clear(); + intbuffer.put(aint); + intbuffer.clear(); + aintbuffer[i] = intbuffer; + } + + return aintbuffer; + } + } + + public static void allocateMipmapTextures(int width, int height, String name) + { + Dimension[] adimension = makeMipmapDimensions(width, height, name); + + for (int i = 0; i < adimension.length; ++i) + { + Dimension dimension = adimension[i]; + int j = dimension.width; + int k = dimension.height; + int l = i + 1; + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, l, GL11.GL_RGBA, j, k, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)((IntBuffer)null)); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/NaturalProperties.java b/Client-1.8.9/src/main/java/net/optifine/NaturalProperties.java new file mode 100644 index 0000000..549aefe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/NaturalProperties.java @@ -0,0 +1,186 @@ +package net.optifine; + +import java.util.IdentityHashMap; +import java.util.Map; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.src.Config; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; + +public class NaturalProperties +{ + public int rotation = 1; + public boolean flip = false; + private Map[] quadMaps = new Map[8]; + + public NaturalProperties(String type) + { + if (type.equals("4")) + { + this.rotation = 4; + } + else if (type.equals("2")) + { + this.rotation = 2; + } + else if (type.equals("F")) + { + this.flip = true; + } + else if (type.equals("4F")) + { + this.rotation = 4; + this.flip = true; + } + else if (type.equals("2F")) + { + this.rotation = 2; + this.flip = true; + } + else + { + Config.warn("NaturalTextures: Unknown type: " + type); + } + } + + public boolean isValid() + { + return this.rotation != 2 && this.rotation != 4 ? this.flip : true; + } + + public synchronized BakedQuad getQuad(BakedQuad quadIn, int rotate, boolean flipU) + { + int i = rotate; + + if (flipU) + { + i = rotate | 4; + } + + if (i > 0 && i < this.quadMaps.length) + { + Map map = this.quadMaps[i]; + + if (map == null) + { + map = new IdentityHashMap(1); + this.quadMaps[i] = map; + } + + BakedQuad bakedquad = (BakedQuad)map.get(quadIn); + + if (bakedquad == null) + { + bakedquad = this.makeQuad(quadIn, rotate, flipU); + map.put(quadIn, bakedquad); + } + + return bakedquad; + } + else + { + return quadIn; + } + } + + private BakedQuad makeQuad(BakedQuad quad, int rotate, boolean flipU) + { + int[] aint = quad.getVertexData(); + int i = quad.getTintIndex(); + EnumFacing enumfacing = quad.getFace(); + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + if (!this.isFullSprite(quad)) + { + rotate = 0; + } + + aint = this.transformVertexData(aint, rotate, flipU); + BakedQuad bakedquad = new BakedQuad(aint, i, enumfacing, textureatlassprite); + return bakedquad; + } + + private int[] transformVertexData(int[] vertexData, int rotate, boolean flipU) + { + int[] aint = (int[])vertexData.clone(); + int i = 4 - rotate; + + if (flipU) + { + i += 3; + } + + i = i % 4; + int j = aint.length / 4; + + for (int k = 0; k < 4; ++k) + { + int l = k * j; + int i1 = i * j; + aint[i1 + 4] = vertexData[l + 4]; + aint[i1 + 4 + 1] = vertexData[l + 4 + 1]; + + if (flipU) + { + --i; + + if (i < 0) + { + i = 3; + } + } + else + { + ++i; + + if (i > 3) + { + i = 0; + } + } + } + + return aint; + } + + private boolean isFullSprite(BakedQuad quad) + { + TextureAtlasSprite textureatlassprite = quad.getSprite(); + float f = textureatlassprite.getMinU(); + float f1 = textureatlassprite.getMaxU(); + float f2 = f1 - f; + float f3 = f2 / 256.0F; + float f4 = textureatlassprite.getMinV(); + float f5 = textureatlassprite.getMaxV(); + float f6 = f5 - f4; + float f7 = f6 / 256.0F; + int[] aint = quad.getVertexData(); + int i = aint.length / 4; + + for (int j = 0; j < 4; ++j) + { + int k = j * i; + float f8 = Float.intBitsToFloat(aint[k + 4]); + float f9 = Float.intBitsToFloat(aint[k + 4 + 1]); + + if (!this.equalsDelta(f8, f, f3) && !this.equalsDelta(f8, f1, f3)) + { + return false; + } + + if (!this.equalsDelta(f9, f4, f7) && !this.equalsDelta(f9, f5, f7)) + { + return false; + } + } + + return true; + } + + private boolean equalsDelta(float x1, float x2, float deltaMax) + { + float f = MathHelper.abs(x1 - x2); + return f < deltaMax; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/NaturalTextures.java b/Client-1.8.9/src/main/java/net/optifine/NaturalTextures.java new file mode 100644 index 0000000..bc548df --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/NaturalTextures.java @@ -0,0 +1,188 @@ +package net.optifine; + +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.optifine.util.TextureUtils; + +public class NaturalTextures +{ + private static NaturalProperties[] propertiesByIndex = new NaturalProperties[0]; + + public static void update() + { + propertiesByIndex = new NaturalProperties[0]; + + if (Config.isNaturalTextures()) + { + String s = "optifine/natural.properties"; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s); + + if (!Config.hasResource(resourcelocation)) + { + Config.dbg("NaturalTextures: configuration \"" + s + "\" not found"); + return; + } + + boolean flag = Config.isFromDefaultResourcePack(resourcelocation); + InputStream inputstream = Config.getResourceStream(resourcelocation); + ArrayList arraylist = new ArrayList(256); + String s1 = Config.readInputStream(inputstream); + inputstream.close(); + String[] astring = Config.tokenize(s1, "\n\r"); + + if (flag) + { + Config.dbg("Natural Textures: Parsing default configuration \"" + s + "\""); + Config.dbg("Natural Textures: Valid only for textures from default resource pack"); + } + else + { + Config.dbg("Natural Textures: Parsing configuration \"" + s + "\""); + } + + TextureMap texturemap = TextureUtils.getTextureMapBlocks(); + + for (int i = 0; i < astring.length; ++i) + { + String s2 = astring[i].trim(); + + if (!s2.startsWith("#")) + { + String[] astring1 = Config.tokenize(s2, "="); + + if (astring1.length != 2) + { + Config.warn("Natural Textures: Invalid \"" + s + "\" line: " + s2); + } + else + { + String s3 = astring1[0].trim(); + String s4 = astring1[1].trim(); + TextureAtlasSprite textureatlassprite = texturemap.getSpriteSafe("minecraft:blocks/" + s3); + + if (textureatlassprite == null) + { + Config.warn("Natural Textures: Texture not found: \"" + s + "\" line: " + s2); + } + else + { + int j = textureatlassprite.getIndexInMap(); + + if (j < 0) + { + Config.warn("Natural Textures: Invalid \"" + s + "\" line: " + s2); + } + else + { + if (flag && !Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/" + s3 + ".png"))) + { + return; + } + + NaturalProperties naturalproperties = new NaturalProperties(s4); + + if (naturalproperties.isValid()) + { + while (arraylist.size() <= j) + { + arraylist.add(null); + } + + arraylist.set(j, naturalproperties); + Config.dbg("NaturalTextures: " + s3 + " = " + s4); + } + } + } + } + } + } + + propertiesByIndex = (NaturalProperties[])((NaturalProperties[])arraylist.toArray(new NaturalProperties[arraylist.size()])); + } + catch (FileNotFoundException var17) + { + Config.warn("NaturalTextures: configuration \"" + s + "\" not found"); + return; + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } + + public static BakedQuad getNaturalTexture(BlockPos blockPosIn, BakedQuad quad) + { + TextureAtlasSprite textureatlassprite = quad.getSprite(); + + if (textureatlassprite == null) + { + return quad; + } + else + { + NaturalProperties naturalproperties = getNaturalProperties(textureatlassprite); + + if (naturalproperties == null) + { + return quad; + } + else + { + int i = ConnectedTextures.getSide(quad.getFace()); + int j = Config.getRandom(blockPosIn, i); + int k = 0; + boolean flag = false; + + if (naturalproperties.rotation > 1) + { + k = j & 3; + } + + if (naturalproperties.rotation == 2) + { + k = k / 2 * 2; + } + + if (naturalproperties.flip) + { + flag = (j & 4) != 0; + } + + return naturalproperties.getQuad(quad, k, flag); + } + } + } + + public static NaturalProperties getNaturalProperties(TextureAtlasSprite icon) + { + if (!(icon instanceof TextureAtlasSprite)) + { + return null; + } + else + { + int i = icon.getIndexInMap(); + + if (i >= 0 && i < propertiesByIndex.length) + { + NaturalProperties naturalproperties = propertiesByIndex[i]; + return naturalproperties; + } + else + { + return null; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/NextTickHashSet.java b/Client-1.8.9/src/main/java/net/optifine/NextTickHashSet.java new file mode 100644 index 0000000..5b13a33 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/NextTickHashSet.java @@ -0,0 +1,200 @@ +package net.optifine; + +import com.google.common.collect.Iterators; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import net.minecraft.util.BlockPos; +import net.minecraft.util.LongHashMap; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.NextTickListEntry; + +public class NextTickHashSet extends TreeSet +{ + private LongHashMap longHashMap = new LongHashMap(); + private int minX = Integer.MIN_VALUE; + private int minZ = Integer.MIN_VALUE; + private int maxX = Integer.MIN_VALUE; + private int maxZ = Integer.MIN_VALUE; + private static final int UNDEFINED = Integer.MIN_VALUE; + + public NextTickHashSet(Set oldSet) + { + for (Object object : oldSet) + { + this.add(object); + } + } + + public boolean contains(Object obj) + { + if (!(obj instanceof NextTickListEntry)) + { + return false; + } + else + { + NextTickListEntry nextticklistentry = (NextTickListEntry)obj; + Set set = this.getSubSet(nextticklistentry, false); + return set == null ? false : set.contains(nextticklistentry); + } + } + + public boolean add(Object obj) + { + if (!(obj instanceof NextTickListEntry)) + { + return false; + } + else + { + NextTickListEntry nextticklistentry = (NextTickListEntry)obj; + + if (nextticklistentry == null) + { + return false; + } + else + { + Set set = this.getSubSet(nextticklistentry, true); + boolean flag = set.add(nextticklistentry); + boolean flag1 = super.add(obj); + + if (flag != flag1) + { + throw new IllegalStateException("Added: " + flag + ", addedParent: " + flag1); + } + else + { + return flag1; + } + } + } + } + + public boolean remove(Object obj) + { + if (!(obj instanceof NextTickListEntry)) + { + return false; + } + else + { + NextTickListEntry nextticklistentry = (NextTickListEntry)obj; + Set set = this.getSubSet(nextticklistentry, false); + + if (set == null) + { + return false; + } + else + { + boolean flag = set.remove(nextticklistentry); + boolean flag1 = super.remove(nextticklistentry); + + if (flag != flag1) + { + throw new IllegalStateException("Added: " + flag + ", addedParent: " + flag1); + } + else + { + return flag1; + } + } + } + } + + private Set getSubSet(NextTickListEntry entry, boolean autoCreate) + { + if (entry == null) + { + return null; + } + else + { + BlockPos blockpos = entry.position; + int i = blockpos.getX() >> 4; + int j = blockpos.getZ() >> 4; + return this.getSubSet(i, j, autoCreate); + } + } + + private Set getSubSet(int cx, int cz, boolean autoCreate) + { + long i = ChunkCoordIntPair.chunkXZ2Int(cx, cz); + HashSet hashset = (HashSet)this.longHashMap.getValueByKey(i); + + if (hashset == null && autoCreate) + { + hashset = new HashSet(); + this.longHashMap.add(i, hashset); + } + + return hashset; + } + + public Iterator iterator() + { + if (this.minX == Integer.MIN_VALUE) + { + return super.iterator(); + } + else if (this.size() <= 0) + { + return Iterators.emptyIterator(); + } + else + { + int i = this.minX >> 4; + int j = this.minZ >> 4; + int k = this.maxX >> 4; + int l = this.maxZ >> 4; + List list = new ArrayList(); + + for (int i1 = i; i1 <= k; ++i1) + { + for (int j1 = j; j1 <= l; ++j1) + { + Set set = this.getSubSet(i1, j1, false); + + if (set != null) + { + list.add(set.iterator()); + } + } + } + + if (list.size() <= 0) + { + return Iterators.emptyIterator(); + } + else if (list.size() == 1) + { + return (Iterator)list.get(0); + } + else + { + return Iterators.concat(list.iterator()); + } + } + } + + public void setIteratorLimits(int minX, int minZ, int maxX, int maxZ) + { + this.minX = Math.min(minX, maxX); + this.minZ = Math.min(minZ, maxZ); + this.maxX = Math.max(minX, maxX); + this.maxZ = Math.max(minZ, maxZ); + } + + public void clearIteratorLimits() + { + this.minX = Integer.MIN_VALUE; + this.minZ = Integer.MIN_VALUE; + this.maxX = Integer.MIN_VALUE; + this.maxZ = Integer.MIN_VALUE; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/RandomEntities.java b/Client-1.8.9/src/main/java/net/optifine/RandomEntities.java new file mode 100644 index 0000000..b224f62 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/RandomEntities.java @@ -0,0 +1,472 @@ +package net.optifine; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.UUID; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorRaw; +import net.optifine.util.IntegratedServerUtils; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.ResUtils; +import net.optifine.util.StrUtils; + +public class RandomEntities +{ + private static Map mapProperties = new HashMap(); + private static boolean active = false; + private static RenderGlobal renderGlobal; + private static RandomEntity randomEntity = new RandomEntity(); + private static TileEntityRendererDispatcher tileEntityRendererDispatcher; + private static RandomTileEntity randomTileEntity = new RandomTileEntity(); + private static boolean working = false; + public static final String SUFFIX_PNG = ".png"; + public static final String SUFFIX_PROPERTIES = ".properties"; + public static final String PREFIX_TEXTURES_ENTITY = "textures/entity/"; + public static final String PREFIX_TEXTURES_PAINTING = "textures/painting/"; + public static final String PREFIX_TEXTURES = "textures/"; + public static final String PREFIX_OPTIFINE_RANDOM = "optifine/random/"; + public static final String PREFIX_MCPATCHER_MOB = "mcpatcher/mob/"; + private static final String[] DEPENDANT_SUFFIXES = new String[] {"_armor", "_eyes", "_exploding", "_shooting", "_fur", "_eyes", "_invulnerable", "_angry", "_tame", "_collar"}; + private static final String PREFIX_DYNAMIC_TEXTURE_HORSE = "horse/"; + private static final String[] HORSE_TEXTURES = (String[])((String[])ReflectorRaw.getFieldValue((Object)null, EntityHorse.class, String[].class, 2)); + private static final String[] HORSE_TEXTURES_ABBR = (String[])((String[])ReflectorRaw.getFieldValue((Object)null, EntityHorse.class, String[].class, 3)); + + public static void entityLoaded(Entity entity, World world) + { + if (world != null) + { + DataWatcher datawatcher = entity.getDataWatcher(); + datawatcher.spawnPosition = entity.getPosition(); + datawatcher.spawnBiome = world.getBiomeGenForCoords(datawatcher.spawnPosition); + UUID uuid = entity.getUniqueID(); + + if (entity instanceof EntityVillager) + { + updateEntityVillager(uuid, (EntityVillager)entity); + } + } + } + + public static void entityUnloaded(Entity entity, World world) + { + } + + private static void updateEntityVillager(UUID uuid, EntityVillager ev) + { + Entity entity = IntegratedServerUtils.getEntity(uuid); + + if (entity instanceof EntityVillager) + { + EntityVillager entityvillager = (EntityVillager)entity; + int i = entityvillager.getProfession(); + ev.setProfession(i); + int j = Reflector.getFieldValueInt(entityvillager, Reflector.EntityVillager_careerId, 0); + Reflector.setFieldValueInt(ev, Reflector.EntityVillager_careerId, j); + int k = Reflector.getFieldValueInt(entityvillager, Reflector.EntityVillager_careerLevel, 0); + Reflector.setFieldValueInt(ev, Reflector.EntityVillager_careerLevel, k); + } + } + + public static void worldChanged(World oldWorld, World newWorld) + { + if (newWorld != null) + { + List list = newWorld.getLoadedEntityList(); + + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + entityLoaded(entity, newWorld); + } + } + + randomEntity.setEntity((Entity)null); + randomTileEntity.setTileEntity((TileEntity)null); + } + + public static ResourceLocation getTextureLocation(ResourceLocation loc) + { + if (!active) + { + return loc; + } + else if (working) + { + return loc; + } + else + { + ResourceLocation name; + + try + { + working = true; + IRandomEntity irandomentity = getRandomEntityRendered(); + + if (irandomentity != null) + { + String s = loc.getResourcePath(); + + if (s.startsWith("horse/")) + { + s = getHorseTexturePath(s, "horse/".length()); + } + + if (!s.startsWith("textures/entity/") && !s.startsWith("textures/painting/")) + { + ResourceLocation resourcelocation2 = loc; + return resourcelocation2; + } + + RandomEntityProperties randomentityproperties = (RandomEntityProperties)mapProperties.get(s); + + if (randomentityproperties == null) + { + ResourceLocation resourcelocation3 = loc; + return resourcelocation3; + } + + ResourceLocation resourcelocation1 = randomentityproperties.getTextureLocation(loc, irandomentity); + return resourcelocation1; + } + + name = loc; + } + finally + { + working = false; + } + + return name; + } + } + + private static String getHorseTexturePath(String path, int pos) + { + if (HORSE_TEXTURES != null && HORSE_TEXTURES_ABBR != null) + { + for (int i = 0; i < HORSE_TEXTURES_ABBR.length; ++i) + { + String s = HORSE_TEXTURES_ABBR[i]; + + if (path.startsWith(s, pos)) + { + return HORSE_TEXTURES[i]; + } + } + + return path; + } + else + { + return path; + } + } + + private static IRandomEntity getRandomEntityRendered() + { + if (renderGlobal.renderedEntity != null) + { + randomEntity.setEntity(renderGlobal.renderedEntity); + return randomEntity; + } + else + { + if (tileEntityRendererDispatcher.tileEntityRendered != null) + { + TileEntity tileentity = tileEntityRendererDispatcher.tileEntityRendered; + + if (tileentity.getWorld() != null) + { + randomTileEntity.setTileEntity(tileentity); + return randomTileEntity; + } + } + + return null; + } + } + + private static RandomEntityProperties makeProperties(ResourceLocation loc, boolean mcpatcher) + { + String s = loc.getResourcePath(); + ResourceLocation resourcelocation = getLocationProperties(loc, mcpatcher); + + if (resourcelocation != null) + { + RandomEntityProperties randomentityproperties = parseProperties(resourcelocation, loc); + + if (randomentityproperties != null) + { + return randomentityproperties; + } + } + + ResourceLocation[] aresourcelocation = getLocationsVariants(loc, mcpatcher); + return aresourcelocation == null ? null : new RandomEntityProperties(s, aresourcelocation); + } + + private static RandomEntityProperties parseProperties(ResourceLocation propLoc, ResourceLocation resLoc) + { + try + { + String s = propLoc.getResourcePath(); + dbg(resLoc.getResourcePath() + ", properties: " + s); + InputStream inputstream = Config.getResourceStream(propLoc); + + if (inputstream == null) + { + warn("Properties not found: " + s); + return null; + } + else + { + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + RandomEntityProperties randomentityproperties = new RandomEntityProperties(properties, s, resLoc); + return !randomentityproperties.isValid(s) ? null : randomentityproperties; + } + } + catch (FileNotFoundException var6) + { + warn("File not found: " + resLoc.getResourcePath()); + return null; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + return null; + } + } + + private static ResourceLocation getLocationProperties(ResourceLocation loc, boolean mcpatcher) + { + ResourceLocation resourcelocation = getLocationRandom(loc, mcpatcher); + + if (resourcelocation == null) + { + return null; + } + else + { + String s = resourcelocation.getResourceDomain(); + String s1 = resourcelocation.getResourcePath(); + String s2 = StrUtils.removeSuffix(s1, ".png"); + String s3 = s2 + ".properties"; + ResourceLocation resourcelocation1 = new ResourceLocation(s, s3); + + if (Config.hasResource(resourcelocation1)) + { + return resourcelocation1; + } + else + { + String s4 = getParentTexturePath(s2); + + if (s4 == null) + { + return null; + } + else + { + ResourceLocation resourcelocation2 = new ResourceLocation(s, s4 + ".properties"); + return Config.hasResource(resourcelocation2) ? resourcelocation2 : null; + } + } + } + } + + protected static ResourceLocation getLocationRandom(ResourceLocation loc, boolean mcpatcher) + { + String s = loc.getResourceDomain(); + String s1 = loc.getResourcePath(); + String s2 = "textures/"; + String s3 = "optifine/random/"; + + if (mcpatcher) + { + s2 = "textures/entity/"; + s3 = "mcpatcher/mob/"; + } + + if (!s1.startsWith(s2)) + { + return null; + } + else + { + String s4 = StrUtils.replacePrefix(s1, s2, s3); + return new ResourceLocation(s, s4); + } + } + + private static String getPathBase(String pathRandom) + { + return pathRandom.startsWith("optifine/random/") ? StrUtils.replacePrefix(pathRandom, "optifine/random/", "textures/") : (pathRandom.startsWith("mcpatcher/mob/") ? StrUtils.replacePrefix(pathRandom, "mcpatcher/mob/", "textures/entity/") : null); + } + + protected static ResourceLocation getLocationIndexed(ResourceLocation loc, int index) + { + if (loc == null) + { + return null; + } + else + { + String s = loc.getResourcePath(); + int i = s.lastIndexOf(46); + + if (i < 0) + { + return null; + } + else + { + String s1 = s.substring(0, i); + String s2 = s.substring(i); + String s3 = s1 + index + s2; + ResourceLocation resourcelocation = new ResourceLocation(loc.getResourceDomain(), s3); + return resourcelocation; + } + } + } + + private static String getParentTexturePath(String path) + { + for (int i = 0; i < DEPENDANT_SUFFIXES.length; ++i) + { + String s = DEPENDANT_SUFFIXES[i]; + + if (path.endsWith(s)) + { + String s1 = StrUtils.removeSuffix(path, s); + return s1; + } + } + + return null; + } + + private static ResourceLocation[] getLocationsVariants(ResourceLocation loc, boolean mcpatcher) + { + List list = new ArrayList(); + list.add(loc); + ResourceLocation resourcelocation = getLocationRandom(loc, mcpatcher); + + if (resourcelocation == null) + { + return null; + } + else + { + for (int i = 1; i < ((List)list).size() + 10; ++i) + { + int j = i + 1; + ResourceLocation resourcelocation1 = getLocationIndexed(resourcelocation, j); + + if (Config.hasResource(resourcelocation1)) + { + list.add(resourcelocation1); + } + } + + if (list.size() <= 1) + { + return null; + } + else + { + ResourceLocation[] aresourcelocation = (ResourceLocation[])((ResourceLocation[])list.toArray(new ResourceLocation[list.size()])); + dbg(loc.getResourcePath() + ", variants: " + aresourcelocation.length); + return aresourcelocation; + } + } + } + + public static void update() + { + mapProperties.clear(); + active = false; + + if (Config.isRandomEntities()) + { + initialize(); + } + } + + private static void initialize() + { + renderGlobal = Config.getRenderGlobal(); + tileEntityRendererDispatcher = TileEntityRendererDispatcher.instance; + String[] astring = new String[] {"optifine/random/", "mcpatcher/mob/"}; + String[] astring1 = new String[] {".png", ".properties"}; + String[] astring2 = ResUtils.collectFiles(astring, astring1); + Set set = new HashSet(); + + for (int i = 0; i < astring2.length; ++i) + { + String s = astring2[i]; + s = StrUtils.removeSuffix(s, astring1); + s = StrUtils.trimTrailing(s, "0123456789"); + s = s + ".png"; + String s1 = getPathBase(s); + + if (!set.contains(s1)) + { + set.add(s1); + ResourceLocation resourcelocation = new ResourceLocation(s1); + + if (Config.hasResource(resourcelocation)) + { + RandomEntityProperties randomentityproperties = (RandomEntityProperties)mapProperties.get(s1); + + if (randomentityproperties == null) + { + randomentityproperties = makeProperties(resourcelocation, false); + + if (randomentityproperties == null) + { + randomentityproperties = makeProperties(resourcelocation, true); + } + + if (randomentityproperties != null) + { + mapProperties.put(s1, randomentityproperties); + } + } + } + } + } + + active = !mapProperties.isEmpty(); + } + + public static void dbg(String str) + { + Config.dbg("RandomEntities: " + str); + } + + public static void warn(String str) + { + Config.warn("RandomEntities: " + str); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/RandomEntity.java b/Client-1.8.9/src/main/java/net/optifine/RandomEntity.java new file mode 100644 index 0000000..dc5a031 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/RandomEntity.java @@ -0,0 +1,71 @@ +package net.optifine; + +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase; + +public class RandomEntity implements IRandomEntity +{ + private Entity entity; + + public int getId() + { + UUID uuid = this.entity.getUniqueID(); + long i = uuid.getLeastSignificantBits(); + int j = (int)(i & 2147483647L); + return j; + } + + public BlockPos getSpawnPosition() + { + return this.entity.getDataWatcher().spawnPosition; + } + + public BiomeGenBase getSpawnBiome() + { + return this.entity.getDataWatcher().spawnBiome; + } + + public String getName() + { + return this.entity.hasCustomName() ? this.entity.getCustomNameTag() : null; + } + + public int getHealth() + { + if (!(this.entity instanceof EntityLiving)) + { + return 0; + } + else + { + EntityLiving entityliving = (EntityLiving)this.entity; + return (int)entityliving.getHealth(); + } + } + + public int getMaxHealth() + { + if (!(this.entity instanceof EntityLiving)) + { + return 0; + } + else + { + EntityLiving entityliving = (EntityLiving)this.entity; + return (int)entityliving.getMaxHealth(); + } + } + + public Entity getEntity() + { + return this.entity; + } + + public void setEntity(Entity entity) + { + this.entity = entity; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/RandomEntityProperties.java b/Client-1.8.9/src/main/java/net/optifine/RandomEntityProperties.java new file mode 100644 index 0000000..dd93513 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/RandomEntityProperties.java @@ -0,0 +1,134 @@ +package net.optifine; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.ConnectedParser; + +public class RandomEntityProperties +{ + public String name = null; + public String basePath = null; + public ResourceLocation[] resourceLocations = null; + public RandomEntityRule[] rules = null; + + public RandomEntityProperties(String path, ResourceLocation[] variants) + { + ConnectedParser connectedparser = new ConnectedParser("RandomEntities"); + this.name = connectedparser.parseName(path); + this.basePath = connectedparser.parseBasePath(path); + this.resourceLocations = variants; + } + + public RandomEntityProperties(Properties props, String path, ResourceLocation baseResLoc) + { + ConnectedParser connectedparser = new ConnectedParser("RandomEntities"); + this.name = connectedparser.parseName(path); + this.basePath = connectedparser.parseBasePath(path); + this.rules = this.parseRules(props, path, baseResLoc, connectedparser); + } + + public ResourceLocation getTextureLocation(ResourceLocation loc, IRandomEntity randomEntity) + { + if (this.rules != null) + { + for (int i = 0; i < this.rules.length; ++i) + { + RandomEntityRule randomentityrule = this.rules[i]; + + if (randomentityrule.matches(randomEntity)) + { + return randomentityrule.getTextureLocation(loc, randomEntity.getId()); + } + } + } + + if (this.resourceLocations != null) + { + int j = randomEntity.getId(); + int k = j % this.resourceLocations.length; + return this.resourceLocations[k]; + } + else + { + return loc; + } + } + + private RandomEntityRule[] parseRules(Properties props, String pathProps, ResourceLocation baseResLoc, ConnectedParser cp) + { + List list = new ArrayList(); + int i = props.size(); + + for (int j = 0; j < i; ++j) + { + int k = j + 1; + String s = props.getProperty("textures." + k); + + if (s == null) + { + s = props.getProperty("skins." + k); + } + + if (s != null) + { + RandomEntityRule randomentityrule = new RandomEntityRule(props, pathProps, baseResLoc, k, s, cp); + + if (randomentityrule.isValid(pathProps)) + { + list.add(randomentityrule); + } + } + } + + RandomEntityRule[] arandomentityrule = (RandomEntityRule[])((RandomEntityRule[])list.toArray(new RandomEntityRule[list.size()])); + return arandomentityrule; + } + + public boolean isValid(String path) + { + if (this.resourceLocations == null && this.rules == null) + { + Config.warn("No skins specified: " + path); + return false; + } + else + { + if (this.rules != null) + { + for (int i = 0; i < this.rules.length; ++i) + { + RandomEntityRule randomentityrule = this.rules[i]; + + if (!randomentityrule.isValid(path)) + { + return false; + } + } + } + + if (this.resourceLocations != null) + { + for (int j = 0; j < this.resourceLocations.length; ++j) + { + ResourceLocation resourcelocation = this.resourceLocations[j]; + + if (!Config.hasResource(resourcelocation)) + { + Config.warn("Texture not found: " + resourcelocation.getResourcePath()); + return false; + } + } + } + + return true; + } + } + + public boolean isDefault() + { + return this.rules != null ? false : this.resourceLocations == null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/RandomEntityRule.java b/Client-1.8.9/src/main/java/net/optifine/RandomEntityRule.java new file mode 100644 index 0000000..f5d1f2f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/RandomEntityRule.java @@ -0,0 +1,456 @@ +package net.optifine; + +import java.util.Properties; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.config.ConnectedParser; +import net.optifine.config.Matches; +import net.optifine.config.NbtTagValue; +import net.optifine.config.RangeInt; +import net.optifine.config.RangeListInt; +import net.optifine.config.VillagerProfession; +import net.optifine.config.Weather; +import net.optifine.reflect.Reflector; +import net.optifine.util.ArrayUtils; +import net.optifine.util.MathUtils; + +public class RandomEntityRule +{ + private String pathProps = null; + private ResourceLocation baseResLoc = null; + private int index; + private int[] textures = null; + private ResourceLocation[] resourceLocations = null; + private int[] weights = null; + private BiomeGenBase[] biomes = null; + private RangeListInt heights = null; + private RangeListInt healthRange = null; + private boolean healthPercent = false; + private NbtTagValue nbtName = null; + public int[] sumWeights = null; + public int sumAllWeights = 1; + private VillagerProfession[] professions = null; + private EnumDyeColor[] collarColors = null; + private Boolean baby = null; + private RangeListInt moonPhases = null; + private RangeListInt dayTimes = null; + private Weather[] weatherList = null; + + public RandomEntityRule(Properties props, String pathProps, ResourceLocation baseResLoc, int index, String valTextures, ConnectedParser cp) + { + this.pathProps = pathProps; + this.baseResLoc = baseResLoc; + this.index = index; + this.textures = cp.parseIntList(valTextures); + this.weights = cp.parseIntList(props.getProperty("weights." + index)); + this.biomes = cp.parseBiomes(props.getProperty("biomes." + index)); + this.heights = cp.parseRangeListInt(props.getProperty("heights." + index)); + + if (this.heights == null) + { + this.heights = this.parseMinMaxHeight(props, index); + } + + String s = props.getProperty("health." + index); + + if (s != null) + { + this.healthPercent = s.contains("%"); + s = s.replace("%", ""); + this.healthRange = cp.parseRangeListInt(s); + } + + this.nbtName = cp.parseNbtTagValue("name", props.getProperty("name." + index)); + this.professions = cp.parseProfessions(props.getProperty("professions." + index)); + this.collarColors = cp.parseDyeColors(props.getProperty("collarColors." + index), "collar color", ConnectedParser.DYE_COLORS_INVALID); + this.baby = cp.parseBooleanObject(props.getProperty("baby." + index)); + this.moonPhases = cp.parseRangeListInt(props.getProperty("moonPhase." + index)); + this.dayTimes = cp.parseRangeListInt(props.getProperty("dayTime." + index)); + this.weatherList = cp.parseWeather(props.getProperty("weather." + index), "weather." + index, (Weather[])null); + } + + private RangeListInt parseMinMaxHeight(Properties props, int index) + { + String s = props.getProperty("minHeight." + index); + String s1 = props.getProperty("maxHeight." + index); + + if (s == null && s1 == null) + { + return null; + } + else + { + int i = 0; + + if (s != null) + { + i = Config.parseInt(s, -1); + + if (i < 0) + { + Config.warn("Invalid minHeight: " + s); + return null; + } + } + + int j = 256; + + if (s1 != null) + { + j = Config.parseInt(s1, -1); + + if (j < 0) + { + Config.warn("Invalid maxHeight: " + s1); + return null; + } + } + + if (j < 0) + { + Config.warn("Invalid minHeight, maxHeight: " + s + ", " + s1); + return null; + } + else + { + RangeListInt rangelistint = new RangeListInt(); + rangelistint.addRange(new RangeInt(i, j)); + return rangelistint; + } + } + } + + public boolean isValid(String path) + { + if (this.textures != null && this.textures.length != 0) + { + if (this.resourceLocations != null) + { + return true; + } + else + { + this.resourceLocations = new ResourceLocation[this.textures.length]; + boolean flag = this.pathProps.startsWith("mcpatcher/mob/"); + ResourceLocation resourcelocation = RandomEntities.getLocationRandom(this.baseResLoc, flag); + + if (resourcelocation == null) + { + Config.warn("Invalid path: " + this.baseResLoc.getResourcePath()); + return false; + } + else + { + for (int i = 0; i < this.resourceLocations.length; ++i) + { + int j = this.textures[i]; + + if (j <= 1) + { + this.resourceLocations[i] = this.baseResLoc; + } + else + { + ResourceLocation resourcelocation1 = RandomEntities.getLocationIndexed(resourcelocation, j); + + if (resourcelocation1 == null) + { + Config.warn("Invalid path: " + this.baseResLoc.getResourcePath()); + return false; + } + + if (!Config.hasResource(resourcelocation1)) + { + Config.warn("Texture not found: " + resourcelocation1.getResourcePath()); + return false; + } + + this.resourceLocations[i] = resourcelocation1; + } + } + + if (this.weights != null) + { + if (this.weights.length > this.resourceLocations.length) + { + Config.warn("More weights defined than skins, trimming weights: " + path); + int[] aint = new int[this.resourceLocations.length]; + System.arraycopy(this.weights, 0, aint, 0, aint.length); + this.weights = aint; + } + + if (this.weights.length < this.resourceLocations.length) + { + Config.warn("Less weights defined than skins, expanding weights: " + path); + int[] aint1 = new int[this.resourceLocations.length]; + System.arraycopy(this.weights, 0, aint1, 0, this.weights.length); + int l = MathUtils.getAverage(this.weights); + + for (int j1 = this.weights.length; j1 < aint1.length; ++j1) + { + aint1[j1] = l; + } + + this.weights = aint1; + } + + this.sumWeights = new int[this.weights.length]; + int k = 0; + + for (int i1 = 0; i1 < this.weights.length; ++i1) + { + if (this.weights[i1] < 0) + { + Config.warn("Invalid weight: " + this.weights[i1]); + return false; + } + + k += this.weights[i1]; + this.sumWeights[i1] = k; + } + + this.sumAllWeights = k; + + if (this.sumAllWeights <= 0) + { + Config.warn("Invalid sum of all weights: " + k); + this.sumAllWeights = 1; + } + } + + if (this.professions == ConnectedParser.PROFESSIONS_INVALID) + { + Config.warn("Invalid professions or careers: " + path); + return false; + } + else if (this.collarColors == ConnectedParser.DYE_COLORS_INVALID) + { + Config.warn("Invalid collar colors: " + path); + return false; + } + else + { + return true; + } + } + } + } + else + { + Config.warn("Invalid skins for rule: " + this.index); + return false; + } + } + + public boolean matches(IRandomEntity randomEntity) + { + if (this.biomes != null && !Matches.biome(randomEntity.getSpawnBiome(), this.biomes)) + { + return false; + } + else + { + if (this.heights != null) + { + BlockPos blockpos = randomEntity.getSpawnPosition(); + + if (blockpos != null && !this.heights.isInRange(blockpos.getY())) + { + return false; + } + } + + if (this.healthRange != null) + { + int i1 = randomEntity.getHealth(); + + if (this.healthPercent) + { + int i = randomEntity.getMaxHealth(); + + if (i > 0) + { + i1 = (int)((double)(i1 * 100) / (double)i); + } + } + + if (!this.healthRange.isInRange(i1)) + { + return false; + } + } + + if (this.nbtName != null) + { + String s = randomEntity.getName(); + + if (!this.nbtName.matchesValue(s)) + { + return false; + } + } + + if (this.professions != null && randomEntity instanceof RandomEntity) + { + RandomEntity randomentity = (RandomEntity)randomEntity; + Entity entity = randomentity.getEntity(); + + if (entity instanceof EntityVillager) + { + EntityVillager entityvillager = (EntityVillager)entity; + int j = entityvillager.getProfession(); + int k = Reflector.getFieldValueInt(entityvillager, Reflector.EntityVillager_careerId, -1); + + if (j < 0 || k < 0) + { + return false; + } + + boolean flag = false; + + for (int l = 0; l < this.professions.length; ++l) + { + VillagerProfession villagerprofession = this.professions[l]; + + if (villagerprofession.matches(j, k)) + { + flag = true; + break; + } + } + + if (!flag) + { + return false; + } + } + } + + if (this.collarColors != null && randomEntity instanceof RandomEntity) + { + RandomEntity randomentity1 = (RandomEntity)randomEntity; + Entity entity1 = randomentity1.getEntity(); + + if (entity1 instanceof EntityWolf) + { + EntityWolf entitywolf = (EntityWolf)entity1; + + if (!entitywolf.isTamed()) + { + return false; + } + + EnumDyeColor enumdyecolor = entitywolf.getCollarColor(); + + if (!Config.equalsOne(enumdyecolor, this.collarColors)) + { + return false; + } + } + } + + if (this.baby != null && randomEntity instanceof RandomEntity) + { + RandomEntity randomentity2 = (RandomEntity)randomEntity; + Entity entity2 = randomentity2.getEntity(); + + if (entity2 instanceof EntityLiving) + { + EntityLiving entityliving = (EntityLiving)entity2; + + if (entityliving.isChild() != this.baby.booleanValue()) + { + return false; + } + } + } + + if (this.moonPhases != null) + { + World world = Config.getMinecraft().theWorld; + + if (world != null) + { + int j1 = world.getMoonPhase(); + + if (!this.moonPhases.isInRange(j1)) + { + return false; + } + } + } + + if (this.dayTimes != null) + { + World world1 = Config.getMinecraft().theWorld; + + if (world1 != null) + { + int k1 = (int)world1.getWorldInfo().getWorldTime(); + + if (!this.dayTimes.isInRange(k1)) + { + return false; + } + } + } + + if (this.weatherList != null) + { + World world2 = Config.getMinecraft().theWorld; + + if (world2 != null) + { + Weather weather = Weather.getWeather(world2, 0.0F); + + if (!ArrayUtils.contains(this.weatherList, weather)) + { + return false; + } + } + } + + return true; + } + } + + public ResourceLocation getTextureLocation(ResourceLocation loc, int randomId) + { + if (this.resourceLocations != null && this.resourceLocations.length != 0) + { + int i = 0; + + if (this.weights == null) + { + i = randomId % this.resourceLocations.length; + } + else + { + int j = randomId % this.sumAllWeights; + + for (int k = 0; k < this.sumWeights.length; ++k) + { + if (this.sumWeights[k] > j) + { + i = k; + break; + } + } + } + + return this.resourceLocations[i]; + } + else + { + return loc; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/RandomTileEntity.java b/Client-1.8.9/src/main/java/net/optifine/RandomTileEntity.java new file mode 100644 index 0000000..e48156b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/RandomTileEntity.java @@ -0,0 +1,53 @@ +package net.optifine; + +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.util.TileEntityUtils; + +public class RandomTileEntity implements IRandomEntity +{ + private TileEntity tileEntity; + + public int getId() + { + return Config.getRandom(this.tileEntity.getPos(), this.tileEntity.getBlockMetadata()); + } + + public BlockPos getSpawnPosition() + { + return this.tileEntity.getPos(); + } + + public String getName() + { + String s = TileEntityUtils.getTileEntityName(this.tileEntity); + return s; + } + + public BiomeGenBase getSpawnBiome() + { + return this.tileEntity.getWorld().getBiomeGenForCoords(this.tileEntity.getPos()); + } + + public int getHealth() + { + return -1; + } + + public int getMaxHealth() + { + return -1; + } + + public TileEntity getTileEntity() + { + return this.tileEntity; + } + + public void setTileEntity(TileEntity tileEntity) + { + this.tileEntity = tileEntity; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/SmartAnimations.java b/Client-1.8.9/src/main/java/net/optifine/SmartAnimations.java new file mode 100644 index 0000000..da0e73d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/SmartAnimations.java @@ -0,0 +1,66 @@ +package net.optifine; + +import java.util.BitSet; +import net.minecraft.src.Config; +import net.optifine.shaders.Shaders; + +public class SmartAnimations +{ + private static boolean active; + private static BitSet spritesRendered = new BitSet(); + private static BitSet texturesRendered = new BitSet(); + + public static boolean isActive() + { + return active && !Shaders.isShadowPass; + } + + public static void update() + { + active = Config.getGameSettings().ofSmartAnimations; + } + + public static void spriteRendered(int animationIndex) + { + if (animationIndex >= 0) + { + spritesRendered.set(animationIndex); + } + } + + public static void spritesRendered(BitSet animationIndexes) + { + if (animationIndexes != null) + { + spritesRendered.or(animationIndexes); + } + } + + public static boolean isSpriteRendered(int animationIndex) + { + return animationIndex < 0 ? false : spritesRendered.get(animationIndex); + } + + public static void resetSpritesRendered() + { + spritesRendered.clear(); + } + + public static void textureRendered(int textureId) + { + if (textureId >= 0) + { + texturesRendered.set(textureId); + } + } + + public static boolean isTextureRendered(int texId) + { + return texId < 0 ? false : texturesRendered.get(texId); + } + + public static void resetTexturesRendered() + { + texturesRendered.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/SmartLeaves.java b/Client-1.8.9/src/main/java/net/optifine/SmartLeaves.java new file mode 100644 index 0000000..41ca798 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/SmartLeaves.java @@ -0,0 +1,220 @@ +package net.optifine; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockNewLeaf; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockPlanks.EnumType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.src.Config; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; +import net.optifine.model.ModelUtils; + +public class SmartLeaves +{ + private static IBakedModel modelLeavesCullAcacia = null; + private static IBakedModel modelLeavesCullBirch = null; + private static IBakedModel modelLeavesCullDarkOak = null; + private static IBakedModel modelLeavesCullJungle = null; + private static IBakedModel modelLeavesCullOak = null; + private static IBakedModel modelLeavesCullSpruce = null; + private static List generalQuadsCullAcacia = null; + private static List generalQuadsCullBirch = null; + private static List generalQuadsCullDarkOak = null; + private static List generalQuadsCullJungle = null; + private static List generalQuadsCullOak = null; + private static List generalQuadsCullSpruce = null; + private static IBakedModel modelLeavesDoubleAcacia = null; + private static IBakedModel modelLeavesDoubleBirch = null; + private static IBakedModel modelLeavesDoubleDarkOak = null; + private static IBakedModel modelLeavesDoubleJungle = null; + private static IBakedModel modelLeavesDoubleOak = null; + private static IBakedModel modelLeavesDoubleSpruce = null; + + public static IBakedModel getLeavesModel(IBakedModel model, IBlockState stateIn) + { + if (!Config.isTreesSmart()) + { + return model; + } + else + { + List list = model.getGeneralQuads(); + return list == generalQuadsCullAcacia ? modelLeavesDoubleAcacia : (list == generalQuadsCullBirch ? modelLeavesDoubleBirch : (list == generalQuadsCullDarkOak ? modelLeavesDoubleDarkOak : (list == generalQuadsCullJungle ? modelLeavesDoubleJungle : (list == generalQuadsCullOak ? modelLeavesDoubleOak : (list == generalQuadsCullSpruce ? modelLeavesDoubleSpruce : model))))); + } + } + + public static boolean isSameLeaves(IBlockState state1, IBlockState state2) + { + if (state1 == state2) + { + return true; + } + else + { + Block block = state1.getBlock(); + Block block1 = state2.getBlock(); + return block != block1 ? false : (block instanceof BlockOldLeaf ? ((EnumType)state1.getValue(BlockOldLeaf.VARIANT)).equals(state2.getValue(BlockOldLeaf.VARIANT)) : (block instanceof BlockNewLeaf ? ((EnumType)state1.getValue(BlockNewLeaf.VARIANT)).equals(state2.getValue(BlockNewLeaf.VARIANT)) : false)); + } + } + + public static void updateLeavesModels() + { + List list = new ArrayList(); + modelLeavesCullAcacia = getModelCull("acacia", list); + modelLeavesCullBirch = getModelCull("birch", list); + modelLeavesCullDarkOak = getModelCull("dark_oak", list); + modelLeavesCullJungle = getModelCull("jungle", list); + modelLeavesCullOak = getModelCull("oak", list); + modelLeavesCullSpruce = getModelCull("spruce", list); + generalQuadsCullAcacia = getGeneralQuadsSafe(modelLeavesCullAcacia); + generalQuadsCullBirch = getGeneralQuadsSafe(modelLeavesCullBirch); + generalQuadsCullDarkOak = getGeneralQuadsSafe(modelLeavesCullDarkOak); + generalQuadsCullJungle = getGeneralQuadsSafe(modelLeavesCullJungle); + generalQuadsCullOak = getGeneralQuadsSafe(modelLeavesCullOak); + generalQuadsCullSpruce = getGeneralQuadsSafe(modelLeavesCullSpruce); + modelLeavesDoubleAcacia = getModelDoubleFace(modelLeavesCullAcacia); + modelLeavesDoubleBirch = getModelDoubleFace(modelLeavesCullBirch); + modelLeavesDoubleDarkOak = getModelDoubleFace(modelLeavesCullDarkOak); + modelLeavesDoubleJungle = getModelDoubleFace(modelLeavesCullJungle); + modelLeavesDoubleOak = getModelDoubleFace(modelLeavesCullOak); + modelLeavesDoubleSpruce = getModelDoubleFace(modelLeavesCullSpruce); + + if (list.size() > 0) + { + Config.dbg("Enable face culling: " + Config.arrayToString(list.toArray())); + } + } + + private static List getGeneralQuadsSafe(IBakedModel model) + { + return model == null ? null : model.getGeneralQuads(); + } + + static IBakedModel getModelCull(String type, List updatedTypes) + { + ModelManager modelmanager = Config.getModelManager(); + + if (modelmanager == null) + { + return null; + } + else + { + ResourceLocation resourcelocation = new ResourceLocation("blockstates/" + type + "_leaves.json"); + + if (Config.getDefiningResourcePack(resourcelocation) != Config.getDefaultResourcePack()) + { + return null; + } + else + { + ResourceLocation resourcelocation1 = new ResourceLocation("models/block/" + type + "_leaves.json"); + + if (Config.getDefiningResourcePack(resourcelocation1) != Config.getDefaultResourcePack()) + { + return null; + } + else + { + ModelResourceLocation modelresourcelocation = new ModelResourceLocation(type + "_leaves", "normal"); + IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation); + + if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel()) + { + List list = ibakedmodel.getGeneralQuads(); + + if (list.size() == 0) + { + return ibakedmodel; + } + else if (list.size() != 6) + { + return null; + } + else + { + for (Object bakedquad0 : list) + { + BakedQuad bakedquad = (BakedQuad) bakedquad0; + List list1 = ibakedmodel.getFaceQuads(bakedquad.getFace()); + + if (list1.size() > 0) + { + return null; + } + + list1.add(bakedquad); + } + + list.clear(); + updatedTypes.add(type + "_leaves"); + return ibakedmodel; + } + } + else + { + return null; + } + } + } + } + } + + private static IBakedModel getModelDoubleFace(IBakedModel model) + { + if (model == null) + { + return null; + } + else if (model.getGeneralQuads().size() > 0) + { + Config.warn("SmartLeaves: Model is not cube, general quads: " + model.getGeneralQuads().size() + ", model: " + model); + return model; + } + else + { + EnumFacing[] aenumfacing = EnumFacing.VALUES; + + for (int i = 0; i < aenumfacing.length; ++i) + { + EnumFacing enumfacing = aenumfacing[i]; + List list = model.getFaceQuads(enumfacing); + + if (list.size() != 1) + { + Config.warn("SmartLeaves: Model is not cube, side: " + enumfacing + ", quads: " + list.size() + ", model: " + model); + return model; + } + } + + IBakedModel ibakedmodel = ModelUtils.duplicateModel(model); + List[] alist = new List[aenumfacing.length]; + + for (int k = 0; k < aenumfacing.length; ++k) + { + EnumFacing enumfacing1 = aenumfacing[k]; + List list1 = ibakedmodel.getFaceQuads(enumfacing1); + BakedQuad bakedquad = (BakedQuad)list1.get(0); + BakedQuad bakedquad1 = new BakedQuad((int[])bakedquad.getVertexData().clone(), bakedquad.getTintIndex(), bakedquad.getFace(), bakedquad.getSprite()); + int[] aint = bakedquad1.getVertexData(); + int[] aint1 = (int[])aint.clone(); + int j = aint.length / 4; + System.arraycopy(aint, 0 * j, aint1, 3 * j, j); + System.arraycopy(aint, 1 * j, aint1, 2 * j, j); + System.arraycopy(aint, 2 * j, aint1, 1 * j, j); + System.arraycopy(aint, 3 * j, aint1, 0 * j, j); + System.arraycopy(aint1, 0, aint, 0, aint1.length); + list1.add(bakedquad1); + } + + return ibakedmodel; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/TextureAnimation.java b/Client-1.8.9/src/main/java/net/optifine/TextureAnimation.java new file mode 100644 index 0000000..5ba6b71 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/TextureAnimation.java @@ -0,0 +1,257 @@ +package net.optifine; + +import java.nio.ByteBuffer; +import java.util.Properties; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.util.TextureUtils; +import org.lwjgl.opengl.GL11; + +public class TextureAnimation +{ + private String srcTex = null; + private String dstTex = null; + ResourceLocation dstTexLoc = null; + private int dstTextId = -1; + private int dstX = 0; + private int dstY = 0; + private int frameWidth = 0; + private int frameHeight = 0; + private TextureAnimationFrame[] frames = null; + private int currentFrameIndex = 0; + private boolean interpolate = false; + private int interpolateSkip = 0; + private ByteBuffer interpolateData = null; + byte[] srcData = null; + private ByteBuffer imageData = null; + private boolean active = true; + private boolean valid = true; + + public TextureAnimation(String texFrom, byte[] srcData, String texTo, ResourceLocation locTexTo, int dstX, int dstY, int frameWidth, int frameHeight, Properties props) + { + this.srcTex = texFrom; + this.dstTex = texTo; + this.dstTexLoc = locTexTo; + this.dstX = dstX; + this.dstY = dstY; + this.frameWidth = frameWidth; + this.frameHeight = frameHeight; + int i = frameWidth * frameHeight * 4; + + if (srcData.length % i != 0) + { + Config.warn("Invalid animated texture length: " + srcData.length + ", frameWidth: " + frameWidth + ", frameHeight: " + frameHeight); + } + + this.srcData = srcData; + int j = srcData.length / i; + + if (props.get("tile.0") != null) + { + for (int k = 0; props.get("tile." + k) != null; ++k) + { + j = k + 1; + } + } + + String s2 = (String)props.get("duration"); + int l = Math.max(Config.parseInt(s2, 1), 1); + this.frames = new TextureAnimationFrame[j]; + + for (int i1 = 0; i1 < this.frames.length; ++i1) + { + String s = (String)props.get("tile." + i1); + int j1 = Config.parseInt(s, i1); + String s1 = (String)props.get("duration." + i1); + int k1 = Math.max(Config.parseInt(s1, l), 1); + TextureAnimationFrame textureanimationframe = new TextureAnimationFrame(j1, k1); + this.frames[i1] = textureanimationframe; + } + + this.interpolate = Config.parseBoolean(props.getProperty("interpolate"), false); + this.interpolateSkip = Config.parseInt(props.getProperty("skip"), 0); + + if (this.interpolate) + { + this.interpolateData = GLAllocation.createDirectByteBuffer(i); + } + } + + public boolean nextFrame() + { + TextureAnimationFrame textureanimationframe = this.getCurrentFrame(); + + if (textureanimationframe == null) + { + return false; + } + else + { + ++textureanimationframe.counter; + + if (textureanimationframe.counter < textureanimationframe.duration) + { + return this.interpolate; + } + else + { + textureanimationframe.counter = 0; + ++this.currentFrameIndex; + + if (this.currentFrameIndex >= this.frames.length) + { + this.currentFrameIndex = 0; + } + + return true; + } + } + } + + public TextureAnimationFrame getCurrentFrame() + { + return this.getFrame(this.currentFrameIndex); + } + + public TextureAnimationFrame getFrame(int index) + { + if (this.frames.length <= 0) + { + return null; + } + else + { + if (index < 0 || index >= this.frames.length) + { + index = 0; + } + + TextureAnimationFrame textureanimationframe = this.frames[index]; + return textureanimationframe; + } + } + + public int getFrameCount() + { + return this.frames.length; + } + + public void updateTexture() + { + if (this.valid) + { + if (this.dstTextId < 0) + { + ITextureObject itextureobject = TextureUtils.getTexture(this.dstTexLoc); + + if (itextureobject == null) + { + this.valid = false; + return; + } + + this.dstTextId = itextureobject.getGlTextureId(); + } + + if (this.imageData == null) + { + this.imageData = GLAllocation.createDirectByteBuffer(this.srcData.length); + this.imageData.put(this.srcData); + this.imageData.flip(); + this.srcData = null; + } + + this.active = SmartAnimations.isActive() ? SmartAnimations.isTextureRendered(this.dstTextId) : true; + + if (this.nextFrame()) + { + if (this.active) + { + int j = this.frameWidth * this.frameHeight * 4; + TextureAnimationFrame textureanimationframe = this.getCurrentFrame(); + + if (textureanimationframe != null) + { + int i = j * textureanimationframe.index; + + if (i + j <= this.imageData.limit()) + { + if (this.interpolate && textureanimationframe.counter > 0) + { + if (this.interpolateSkip <= 1 || textureanimationframe.counter % this.interpolateSkip == 0) + { + TextureAnimationFrame textureanimationframe1 = this.getFrame(this.currentFrameIndex + 1); + double d0 = 1.0D * (double)textureanimationframe.counter / (double)textureanimationframe.duration; + this.updateTextureInerpolate(textureanimationframe, textureanimationframe1, d0); + } + } + else + { + this.imageData.position(i); + GlStateManager.bindTexture(this.dstTextId); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, this.dstX, this.dstY, this.frameWidth, this.frameHeight, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData); + } + } + } + } + } + } + } + + private void updateTextureInerpolate(TextureAnimationFrame frame1, TextureAnimationFrame frame2, double k) + { + int i = this.frameWidth * this.frameHeight * 4; + int j = i * frame1.index; + + if (j + i <= this.imageData.limit()) + { + int k1 = i * frame2.index; + + if (k1 + i <= this.imageData.limit()) + { + this.interpolateData.clear(); + + for (int l = 0; l < i; ++l) + { + int i1 = this.imageData.get(j + l) & 255; + int j1 = this.imageData.get(k1 + l) & 255; + int k3 = this.mix(i1, j1, k); + byte b0 = (byte)k3; + this.interpolateData.put(b0); + } + + this.interpolateData.flip(); + GlStateManager.bindTexture(this.dstTextId); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, this.dstX, this.dstY, this.frameWidth, this.frameHeight, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.interpolateData); + } + } + } + + private int mix(int col1, int col2, double k) + { + return (int)((double)col1 * (1.0D - k) + (double)col2 * k); + } + + public String getSrcTex() + { + return this.srcTex; + } + + public String getDstTex() + { + return this.dstTex; + } + + public ResourceLocation getDstTexLoc() + { + return this.dstTexLoc; + } + + public boolean isActive() + { + return this.active; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/TextureAnimationFrame.java b/Client-1.8.9/src/main/java/net/optifine/TextureAnimationFrame.java new file mode 100644 index 0000000..720acf8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/TextureAnimationFrame.java @@ -0,0 +1,15 @@ +package net.optifine; + +public class TextureAnimationFrame +{ + public int index; + public int duration; + public int counter; + + public TextureAnimationFrame(int index, int duration) + { + this.index = index; + this.duration = duration; + this.counter = 0; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/TextureAnimations.java b/Client-1.8.9/src/main/java/net/optifine/TextureAnimations.java new file mode 100644 index 0000000..3d2b745 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/TextureAnimations.java @@ -0,0 +1,351 @@ +package net.optifine; + +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; +import javax.imageio.ImageIO; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.ResUtils; +import net.optifine.util.TextureUtils; + +public class TextureAnimations +{ + private static TextureAnimation[] textureAnimations = null; + private static int countAnimationsActive = 0; + private static int frameCountAnimations = 0; + + public static void reset() + { + textureAnimations = null; + } + + public static void update() + { + textureAnimations = null; + countAnimationsActive = 0; + IResourcePack[] airesourcepack = Config.getResourcePacks(); + textureAnimations = getTextureAnimations(airesourcepack); + updateAnimations(); + } + + public static void updateAnimations() + { + if (textureAnimations != null && Config.isAnimatedTextures()) + { + int i = 0; + + for (int j = 0; j < textureAnimations.length; ++j) + { + TextureAnimation textureanimation = textureAnimations[j]; + textureanimation.updateTexture(); + + if (textureanimation.isActive()) + { + ++i; + } + } + + int k = Config.getMinecraft().entityRenderer.frameCount; + + if (k != frameCountAnimations) + { + countAnimationsActive = i; + frameCountAnimations = k; + } + + if (SmartAnimations.isActive()) + { + SmartAnimations.resetTexturesRendered(); + } + } + else + { + countAnimationsActive = 0; + } + } + + private static TextureAnimation[] getTextureAnimations(IResourcePack[] rps) + { + List list = new ArrayList(); + + for (int i = 0; i < rps.length; ++i) + { + IResourcePack iresourcepack = rps[i]; + TextureAnimation[] atextureanimation = getTextureAnimations(iresourcepack); + + if (atextureanimation != null) + { + list.addAll(Arrays.asList(atextureanimation)); + } + } + + TextureAnimation[] atextureanimation1 = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()])); + return atextureanimation1; + } + + private static TextureAnimation[] getTextureAnimations(IResourcePack rp) + { + String[] astring = ResUtils.collectFiles(rp, (String)"mcpatcher/anim/", (String)".properties", (String[])null); + + if (astring.length <= 0) + { + return null; + } + else + { + List list = new ArrayList(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + Config.dbg("Texture animation: " + s); + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s); + InputStream inputstream = rp.getInputStream(resourcelocation); + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + TextureAnimation textureanimation = makeTextureAnimation(properties, resourcelocation); + + if (textureanimation != null) + { + ResourceLocation resourcelocation1 = new ResourceLocation(textureanimation.getDstTex()); + + if (Config.getDefiningResourcePack(resourcelocation1) != rp) + { + Config.dbg("Skipped: " + s + ", target texture not loaded from same resource pack"); + } + else + { + list.add(textureanimation); + } + } + } + catch (FileNotFoundException filenotfoundexception) + { + Config.warn("File not found: " + filenotfoundexception.getMessage()); + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + TextureAnimation[] atextureanimation = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()])); + return atextureanimation; + } + } + + private static TextureAnimation makeTextureAnimation(Properties props, ResourceLocation propLoc) + { + String s = props.getProperty("from"); + String s1 = props.getProperty("to"); + int i = Config.parseInt(props.getProperty("x"), -1); + int j = Config.parseInt(props.getProperty("y"), -1); + int k = Config.parseInt(props.getProperty("w"), -1); + int l = Config.parseInt(props.getProperty("h"), -1); + + if (s != null && s1 != null) + { + if (i >= 0 && j >= 0 && k >= 0 && l >= 0) + { + s = s.trim(); + s1 = s1.trim(); + String s2 = TextureUtils.getBasePath(propLoc.getResourcePath()); + s = TextureUtils.fixResourcePath(s, s2); + s1 = TextureUtils.fixResourcePath(s1, s2); + byte[] abyte = getCustomTextureData(s, k); + + if (abyte == null) + { + Config.warn("TextureAnimation: Source texture not found: " + s1); + return null; + } + else + { + int i1 = abyte.length / 4; + int j1 = i1 / (k * l); + int k1 = j1 * k * l; + + if (i1 != k1) + { + Config.warn("TextureAnimation: Source texture has invalid number of frames: " + s + ", frames: " + (float)i1 / (float)(k * l)); + return null; + } + else + { + ResourceLocation resourcelocation = new ResourceLocation(s1); + + try + { + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + Config.warn("TextureAnimation: Target texture not found: " + s1); + return null; + } + else + { + BufferedImage bufferedimage = readTextureImage(inputstream); + + if (i + k <= bufferedimage.getWidth() && j + l <= bufferedimage.getHeight()) + { + TextureAnimation textureanimation = new TextureAnimation(s, abyte, s1, resourcelocation, i, j, k, l, props); + return textureanimation; + } + else + { + Config.warn("TextureAnimation: Animation coordinates are outside the target texture: " + s1); + return null; + } + } + } + catch (IOException var17) + { + Config.warn("TextureAnimation: Target texture not found: " + s1); + return null; + } + } + } + } + else + { + Config.warn("TextureAnimation: Invalid coordinates"); + return null; + } + } + else + { + Config.warn("TextureAnimation: Source or target texture not specified"); + return null; + } + } + + private static byte[] getCustomTextureData(String imagePath, int tileWidth) + { + byte[] abyte = loadImage(imagePath, tileWidth); + + if (abyte == null) + { + abyte = loadImage("/anim" + imagePath, tileWidth); + } + + return abyte; + } + + private static byte[] loadImage(String name, int targetWidth) + { + GameSettings gamesettings = Config.getGameSettings(); + + try + { + ResourceLocation resourcelocation = new ResourceLocation(name); + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return null; + } + else + { + BufferedImage bufferedimage = readTextureImage(inputstream); + inputstream.close(); + + if (bufferedimage == null) + { + return null; + } + else + { + if (targetWidth > 0 && bufferedimage.getWidth() != targetWidth) + { + double d0 = (double)(bufferedimage.getHeight() / bufferedimage.getWidth()); + int j = (int)((double)targetWidth * d0); + bufferedimage = scaleBufferedImage(bufferedimage, targetWidth, j); + } + + int k2 = bufferedimage.getWidth(); + int i = bufferedimage.getHeight(); + int[] aint = new int[k2 * i]; + byte[] abyte = new byte[k2 * i * 4]; + bufferedimage.getRGB(0, 0, k2, i, aint, 0, k2); + + for (int k = 0; k < aint.length; ++k) + { + int l = aint[k] >> 24 & 255; + int i1 = aint[k] >> 16 & 255; + int j1 = aint[k] >> 8 & 255; + int k1 = aint[k] & 255; + + if (gamesettings != null && gamesettings.anaglyph) + { + int l1 = (i1 * 30 + j1 * 59 + k1 * 11) / 100; + int i2 = (i1 * 30 + j1 * 70) / 100; + int j2 = (i1 * 30 + k1 * 70) / 100; + i1 = l1; + j1 = i2; + k1 = j2; + } + + abyte[k * 4 + 0] = (byte)i1; + abyte[k * 4 + 1] = (byte)j1; + abyte[k * 4 + 2] = (byte)k1; + abyte[k * 4 + 3] = (byte)l; + } + + return abyte; + } + } + } + catch (FileNotFoundException var18) + { + return null; + } + catch (Exception exception) + { + exception.printStackTrace(); + return null; + } + } + + private static BufferedImage readTextureImage(InputStream par1InputStream) throws IOException + { + BufferedImage bufferedimage = ImageIO.read(par1InputStream); + par1InputStream.close(); + return bufferedimage; + } + + private static BufferedImage scaleBufferedImage(BufferedImage image, int width, int height) + { + BufferedImage bufferedimage = new BufferedImage(width, height, 2); + Graphics2D graphics2d = bufferedimage.createGraphics(); + graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); + graphics2d.drawImage(image, 0, 0, width, height, (ImageObserver)null); + return bufferedimage; + } + + public static int getCountAnimations() + { + return textureAnimations == null ? 0 : textureAnimations.length; + } + + public static int getCountAnimationsActive() + { + return countAnimationsActive; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/VersionCheckThread.java b/Client-1.8.9/src/main/java/net/optifine/VersionCheckThread.java new file mode 100644 index 0000000..051a93c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/VersionCheckThread.java @@ -0,0 +1,76 @@ +package net.optifine; + +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.src.Config; + +public class VersionCheckThread extends Thread +{ + public VersionCheckThread() + { + super("VersionCheck"); + } + + public void run() + { + HttpURLConnection httpurlconnection = null; + + try + { + Config.dbg("Checking for new version"); + URL url = new URL("http://optifine.net/version/1.8.9/HD_U.txt"); + httpurlconnection = (HttpURLConnection)url.openConnection(); + + if (Config.getGameSettings().snooperEnabled) + { + httpurlconnection.setRequestProperty("OF-MC-Version", "1.8.9"); + httpurlconnection.setRequestProperty("OF-MC-Brand", "" + ClientBrandRetriever.getClientModName()); + httpurlconnection.setRequestProperty("OF-Edition", "HD_U"); + httpurlconnection.setRequestProperty("OF-Release", "M6_pre2"); + httpurlconnection.setRequestProperty("OF-Java-Version", "" + System.getProperty("java.version")); + httpurlconnection.setRequestProperty("OF-CpuCount", "" + Config.getAvailableProcessors()); + httpurlconnection.setRequestProperty("OF-OpenGL-Version", "" + Config.openGlVersion); + httpurlconnection.setRequestProperty("OF-OpenGL-Vendor", "" + Config.openGlVendor); + } + + httpurlconnection.setDoInput(true); + httpurlconnection.setDoOutput(false); + httpurlconnection.connect(); + + try + { + InputStream inputstream = httpurlconnection.getInputStream(); + String s = Config.readInputStream(inputstream); + inputstream.close(); + String[] astring = Config.tokenize(s, "\n\r"); + + if (astring.length >= 1) + { + String s1 = astring[0].trim(); + Config.dbg("Version found: " + s1); + + if (Config.compareRelease(s1, "M6_pre2") <= 0) + { + return; + } + + Config.setNewRelease(s1); + return; + } + } + finally + { + if (httpurlconnection != null) + { + httpurlconnection.disconnect(); + } + } + } + catch (Exception exception) + { + Config.dbg(exception.getClass().getName() + ": " + exception.getMessage()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/ConnectedParser.java b/Client-1.8.9/src/main/java/net/optifine/config/ConnectedParser.java new file mode 100644 index 0000000..7176cc4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/ConnectedParser.java @@ -0,0 +1,1313 @@ +package net.optifine.config; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.Item; +import net.minecraft.src.Config; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.IStringSerializable; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.ConnectedProperties; +import net.optifine.util.EntityUtils; + +public class ConnectedParser +{ + private String context = null; + public static final VillagerProfession[] PROFESSIONS_INVALID = new VillagerProfession[0]; + public static final EnumDyeColor[] DYE_COLORS_INVALID = new EnumDyeColor[0]; + private static final INameGetter NAME_GETTER_ENUM = new INameGetter() + { + public String getName(Enum en) + { + return en.name(); + } + }; + private static final INameGetter NAME_GETTER_DYE_COLOR = new INameGetter() + { + public String getName(EnumDyeColor col) + { + return col.getName(); + } + }; + + public ConnectedParser(String context) + { + this.context = context; + } + + public String parseName(String path) + { + String s = path; + int i = path.lastIndexOf(47); + + if (i >= 0) + { + s = path.substring(i + 1); + } + + int j = s.lastIndexOf(46); + + if (j >= 0) + { + s = s.substring(0, j); + } + + return s; + } + + public String parseBasePath(String path) + { + int i = path.lastIndexOf(47); + return i < 0 ? "" : path.substring(0, i); + } + + public MatchBlock[] parseMatchBlocks(String propMatchBlocks) + { + if (propMatchBlocks == null) + { + return null; + } + else + { + List list = new ArrayList(); + String[] astring = Config.tokenize(propMatchBlocks, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + MatchBlock[] amatchblock = this.parseMatchBlock(s); + + if (amatchblock != null) + { + list.addAll(Arrays.asList(amatchblock)); + } + } + + MatchBlock[] amatchblock1 = (MatchBlock[])((MatchBlock[])list.toArray(new MatchBlock[list.size()])); + return amatchblock1; + } + } + + public IBlockState parseBlockState(String str, IBlockState def) + { + MatchBlock[] amatchblock = this.parseMatchBlock(str); + + if (amatchblock == null) + { + return def; + } + else if (amatchblock.length != 1) + { + return def; + } + else + { + MatchBlock matchblock = amatchblock[0]; + int i = matchblock.getBlockId(); + Block block = Block.getBlockById(i); + return block.getDefaultState(); + } + } + + public MatchBlock[] parseMatchBlock(String blockStr) + { + if (blockStr == null) + { + return null; + } + else + { + blockStr = blockStr.trim(); + + if (blockStr.length() <= 0) + { + return null; + } + else + { + String[] astring = Config.tokenize(blockStr, ":"); + String s = "minecraft"; + int i = 0; + + if (astring.length > 1 && this.isFullBlockName(astring)) + { + s = astring[0]; + i = 1; + } + else + { + s = "minecraft"; + i = 0; + } + + String s1 = astring[i]; + String[] astring1 = (String[])Arrays.copyOfRange(astring, i + 1, astring.length); + Block[] ablock = this.parseBlockPart(s, s1); + + if (ablock == null) + { + return null; + } + else + { + MatchBlock[] amatchblock = new MatchBlock[ablock.length]; + + for (int j = 0; j < ablock.length; ++j) + { + Block block = ablock[j]; + int k = Block.getIdFromBlock(block); + int[] aint = null; + + if (astring1.length > 0) + { + aint = this.parseBlockMetadatas(block, astring1); + + if (aint == null) + { + return null; + } + } + + MatchBlock matchblock = new MatchBlock(k, aint); + amatchblock[j] = matchblock; + } + + return amatchblock; + } + } + } + } + + public boolean isFullBlockName(String[] parts) + { + if (parts.length < 2) + { + return false; + } + else + { + String s = parts[1]; + return s.length() < 1 ? false : (this.startsWithDigit(s) ? false : !s.contains("=")); + } + } + + public boolean startsWithDigit(String str) + { + if (str == null) + { + return false; + } + else if (str.length() < 1) + { + return false; + } + else + { + char c0 = str.charAt(0); + return Character.isDigit(c0); + } + } + + public Block[] parseBlockPart(String domain, String blockPart) + { + if (this.startsWithDigit(blockPart)) + { + int[] aint = this.parseIntList(blockPart); + + if (aint == null) + { + return null; + } + else + { + Block[] ablock1 = new Block[aint.length]; + + for (int j = 0; j < aint.length; ++j) + { + int i = aint[j]; + Block block1 = Block.getBlockById(i); + + if (block1 == null) + { + this.warn("Block not found for id: " + i); + return null; + } + + ablock1[j] = block1; + } + + return ablock1; + } + } + else + { + String s = domain + ":" + blockPart; + Block block = Block.getBlockFromName(s); + + if (block == null) + { + this.warn("Block not found for name: " + s); + return null; + } + else + { + Block[] ablock = new Block[] {block}; + return ablock; + } + } + } + + public int[] parseBlockMetadatas(Block block, String[] params) + { + if (params.length <= 0) + { + return null; + } + else + { + String s = params[0]; + + if (this.startsWithDigit(s)) + { + int[] aint = this.parseIntList(s); + return aint; + } + else + { + IBlockState iblockstate = block.getDefaultState(); + Collection collection = iblockstate.getPropertyNames(); + Map> map = new HashMap(); + + for (int i = 0; i < params.length; ++i) + { + String s1 = params[i]; + + if (s1.length() > 0) + { + String[] astring = Config.tokenize(s1, "="); + + if (astring.length != 2) + { + this.warn("Invalid block property: " + s1); + return null; + } + + String s2 = astring[0]; + String s3 = astring[1]; + IProperty iproperty = ConnectedProperties.getProperty(s2, collection); + + if (iproperty == null) + { + this.warn("Property not found: " + s2 + ", block: " + block); + return null; + } + + List list = (List)map.get(s2); + + if (list == null) + { + list = new ArrayList(); + map.put(iproperty, list); + } + + String[] astring1 = Config.tokenize(s3, ","); + + for (int j = 0; j < astring1.length; ++j) + { + String s4 = astring1[j]; + Comparable comparable = parsePropertyValue(iproperty, s4); + + if (comparable == null) + { + this.warn("Property value not found: " + s4 + ", property: " + s2 + ", block: " + block); + return null; + } + + list.add(comparable); + } + } + } + + if (map.isEmpty()) + { + return null; + } + else + { + List list1 = new ArrayList(); + + for (int k = 0; k < 16; ++k) + { + int l = k; + + try + { + IBlockState iblockstate1 = this.getStateFromMeta(block, l); + + if (this.matchState(iblockstate1, map)) + { + list1.add(Integer.valueOf(l)); + } + } + catch (IllegalArgumentException var18) + { + ; + } + } + + if (list1.size() == 16) + { + return null; + } + else + { + int[] aint1 = new int[list1.size()]; + + for (int i1 = 0; i1 < aint1.length; ++i1) + { + aint1[i1] = ((Integer)list1.get(i1)).intValue(); + } + + return aint1; + } + } + } + } + } + + private IBlockState getStateFromMeta(Block block, int md) + { + try + { + IBlockState iblockstate = block.getStateFromMeta(md); + + if (block == Blocks.double_plant && md > 7) + { + IBlockState iblockstate1 = block.getStateFromMeta(md & 7); + iblockstate = iblockstate.withProperty(BlockDoublePlant.VARIANT, iblockstate1.getValue(BlockDoublePlant.VARIANT)); + } + + return iblockstate; + } + catch (IllegalArgumentException var5) + { + return block.getDefaultState(); + } + } + + public static Comparable parsePropertyValue(IProperty prop, String valStr) + { + Class oclass = prop.getValueClass(); + Comparable comparable = parseValue(valStr, oclass); + + if (comparable == null) + { + Collection collection = prop.getAllowedValues(); + comparable = getPropertyValue(valStr, collection); + } + + return comparable; + } + + public static Comparable getPropertyValue(String value, Collection propertyValues) + { + for (Object comparable0 : propertyValues) + { + Comparable comparable = (Comparable) comparable0; + if (getValueName(comparable).equals(value)) + { + return comparable; + } + } + + return null; + } + + private static Object getValueName(Comparable obj) + { + if (obj instanceof IStringSerializable) + { + IStringSerializable istringserializable = (IStringSerializable)obj; + return istringserializable.getName(); + } + else + { + return obj.toString(); + } + } + + public static Comparable parseValue(String str, Class cls) + { + if (cls == String.class) + { + return str; + } + else if (cls == Boolean.class) + { + return Boolean.valueOf(str); + } + else if (cls == Float.class) + { + return Float.valueOf(str); + } + else if (cls == Double.class) + { + return Double.valueOf(str); + } + else if (cls == Integer.class) + { + return Integer.valueOf(str); + } + else + { + return cls == Long.class ? Long.valueOf(str) : null; + } + } + + public boolean matchState(IBlockState bs, Map> mapPropValues) + { + for (IProperty iproperty : mapPropValues.keySet()) + { + List list = (List)mapPropValues.get(iproperty); + Comparable comparable = bs.getValue(iproperty); + + if (comparable == null) + { + return false; + } + + if (!list.contains(comparable)) + { + return false; + } + } + + return true; + } + + public BiomeGenBase[] parseBiomes(String str) + { + if (str == null) + { + return null; + } + else + { + str = str.trim(); + boolean flag = false; + + if (str.startsWith("!")) + { + flag = true; + str = str.substring(1); + } + + String[] astring = Config.tokenize(str, " "); + List list = new ArrayList(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + BiomeGenBase biomegenbase = this.findBiome(s); + + if (biomegenbase == null) + { + this.warn("Biome not found: " + s); + } + else + { + list.add(biomegenbase); + } + } + + if (flag) + { + List list1 = new ArrayList(Arrays.asList(BiomeGenBase.getBiomeGenArray())); + list1.removeAll(list); + list = list1; + } + + BiomeGenBase[] abiomegenbase = (BiomeGenBase[])((BiomeGenBase[])list.toArray(new BiomeGenBase[list.size()])); + return abiomegenbase; + } + } + + public BiomeGenBase findBiome(String biomeName) + { + biomeName = biomeName.toLowerCase(); + + if (biomeName.equals("nether")) + { + return BiomeGenBase.hell; + } + else + { + BiomeGenBase[] abiomegenbase = BiomeGenBase.getBiomeGenArray(); + + for (int i = 0; i < abiomegenbase.length; ++i) + { + BiomeGenBase biomegenbase = abiomegenbase[i]; + + if (biomegenbase != null) + { + String s = biomegenbase.biomeName.replace(" ", "").toLowerCase(); + + if (s.equals(biomeName)) + { + return biomegenbase; + } + } + } + + return null; + } + } + + public int parseInt(String str, int defVal) + { + if (str == null) + { + return defVal; + } + else + { + str = str.trim(); + int i = Config.parseInt(str, -1); + + if (i < 0) + { + this.warn("Invalid number: " + str); + return defVal; + } + else + { + return i; + } + } + } + + public int[] parseIntList(String str) + { + if (str == null) + { + return null; + } + else + { + List list = new ArrayList(); + String[] astring = Config.tokenize(str, " ,"); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + if (s.contains("-")) + { + String[] astring1 = Config.tokenize(s, "-"); + + if (astring1.length != 2) + { + this.warn("Invalid interval: " + s + ", when parsing: " + str); + } + else + { + int k = Config.parseInt(astring1[0], -1); + int l = Config.parseInt(astring1[1], -1); + + if (k >= 0 && l >= 0 && k <= l) + { + for (int i1 = k; i1 <= l; ++i1) + { + list.add(Integer.valueOf(i1)); + } + } + else + { + this.warn("Invalid interval: " + s + ", when parsing: " + str); + } + } + } + else + { + int j = Config.parseInt(s, -1); + + if (j < 0) + { + this.warn("Invalid number: " + s + ", when parsing: " + str); + } + else + { + list.add(Integer.valueOf(j)); + } + } + } + + int[] aint = new int[list.size()]; + + for (int j1 = 0; j1 < aint.length; ++j1) + { + aint[j1] = ((Integer)list.get(j1)).intValue(); + } + + return aint; + } + } + + public boolean[] parseFaces(String str, boolean[] defVal) + { + if (str == null) + { + return defVal; + } + else + { + EnumSet enumset = EnumSet.allOf(EnumFacing.class); + String[] astring = Config.tokenize(str, " ,"); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + if (s.equals("sides")) + { + enumset.add(EnumFacing.NORTH); + enumset.add(EnumFacing.SOUTH); + enumset.add(EnumFacing.WEST); + enumset.add(EnumFacing.EAST); + } + else if (s.equals("all")) + { + enumset.addAll(Arrays.asList(EnumFacing.VALUES)); + } + else + { + EnumFacing enumfacing = this.parseFace(s); + + if (enumfacing != null) + { + enumset.add(enumfacing); + } + } + } + + boolean[] aboolean = new boolean[EnumFacing.VALUES.length]; + + for (int j = 0; j < aboolean.length; ++j) + { + aboolean[j] = enumset.contains(EnumFacing.VALUES[j]); + } + + return aboolean; + } + } + + public EnumFacing parseFace(String str) + { + str = str.toLowerCase(); + + if (!str.equals("bottom") && !str.equals("down")) + { + if (!str.equals("top") && !str.equals("up")) + { + if (str.equals("north")) + { + return EnumFacing.NORTH; + } + else if (str.equals("south")) + { + return EnumFacing.SOUTH; + } + else if (str.equals("east")) + { + return EnumFacing.EAST; + } + else if (str.equals("west")) + { + return EnumFacing.WEST; + } + else + { + Config.warn("Unknown face: " + str); + return null; + } + } + else + { + return EnumFacing.UP; + } + } + else + { + return EnumFacing.DOWN; + } + } + + public void dbg(String str) + { + Config.dbg("" + this.context + ": " + str); + } + + public void warn(String str) + { + Config.warn("" + this.context + ": " + str); + } + + public RangeListInt parseRangeListInt(String str) + { + if (str == null) + { + return null; + } + else + { + RangeListInt rangelistint = new RangeListInt(); + String[] astring = Config.tokenize(str, " ,"); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + RangeInt rangeint = this.parseRangeInt(s); + + if (rangeint == null) + { + return null; + } + + rangelistint.addRange(rangeint); + } + + return rangelistint; + } + } + + private RangeInt parseRangeInt(String str) + { + if (str == null) + { + return null; + } + else if (str.indexOf(45) >= 0) + { + String[] astring = Config.tokenize(str, "-"); + + if (astring.length != 2) + { + this.warn("Invalid range: " + str); + return null; + } + else + { + int j = Config.parseInt(astring[0], -1); + int k = Config.parseInt(astring[1], -1); + + if (j >= 0 && k >= 0) + { + return new RangeInt(j, k); + } + else + { + this.warn("Invalid range: " + str); + return null; + } + } + } + else + { + int i = Config.parseInt(str, -1); + + if (i < 0) + { + this.warn("Invalid integer: " + str); + return null; + } + else + { + return new RangeInt(i, i); + } + } + } + + public boolean parseBoolean(String str, boolean defVal) + { + if (str == null) + { + return defVal; + } + else + { + String s = str.toLowerCase().trim(); + + if (s.equals("true")) + { + return true; + } + else if (s.equals("false")) + { + return false; + } + else + { + this.warn("Invalid boolean: " + str); + return defVal; + } + } + } + + public Boolean parseBooleanObject(String str) + { + if (str == null) + { + return null; + } + else + { + String s = str.toLowerCase().trim(); + + if (s.equals("true")) + { + return Boolean.TRUE; + } + else if (s.equals("false")) + { + return Boolean.FALSE; + } + else + { + this.warn("Invalid boolean: " + str); + return null; + } + } + } + + public static int parseColor(String str, int defVal) + { + if (str == null) + { + return defVal; + } + else + { + str = str.trim(); + + try + { + int i = Integer.parseInt(str, 16) & 16777215; + return i; + } + catch (NumberFormatException var3) + { + return defVal; + } + } + } + + public static int parseColor4(String str, int defVal) + { + if (str == null) + { + return defVal; + } + else + { + str = str.trim(); + + try + { + int i = (int)(Long.parseLong(str, 16) & -1L); + return i; + } + catch (NumberFormatException var3) + { + return defVal; + } + } + } + + public EnumWorldBlockLayer parseBlockRenderLayer(String str, EnumWorldBlockLayer def) + { + if (str == null) + { + return def; + } + else + { + str = str.toLowerCase().trim(); + EnumWorldBlockLayer[] aenumworldblocklayer = EnumWorldBlockLayer.values(); + + for (int i = 0; i < aenumworldblocklayer.length; ++i) + { + EnumWorldBlockLayer enumworldblocklayer = aenumworldblocklayer[i]; + + if (str.equals(enumworldblocklayer.name().toLowerCase())) + { + return enumworldblocklayer; + } + } + + return def; + } + } + + public T parseObject(String str, T[] objs, INameGetter nameGetter, String property) + { + if (str == null) + { + return (T)null; + } + else + { + String s = str.toLowerCase().trim(); + + for (int i = 0; i < objs.length; ++i) + { + T t = objs[i]; + String s1 = nameGetter.getName(t); + + if (s1 != null && s1.toLowerCase().equals(s)) + { + return t; + } + } + + this.warn("Invalid " + property + ": " + str); + return (T)null; + } + } + + public T[] parseObjects(String str, T[] objs, INameGetter nameGetter, String property, T[] errValue) + { + if (str == null) + { + return null; + } + else + { + str = str.toLowerCase().trim(); + String[] astring = Config.tokenize(str, " "); + T[] at = (T[]) Array.newInstance(objs.getClass().getComponentType(), astring.length); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + T t = this.parseObject(s, objs, nameGetter, property); + + if (t == null) + { + return (T[])errValue; + } + + at[i] = t; + } + + return at; + } + } + + public Enum parseEnum(String str, Enum[] enums, String property) + { + return (Enum)this.parseObject(str, enums, NAME_GETTER_ENUM, property); + } + + public Enum[] parseEnums(String str, Enum[] enums, String property, Enum[] errValue) + { + return (Enum[])this.parseObjects(str, enums, NAME_GETTER_ENUM, property, errValue); + } + + public EnumDyeColor[] parseDyeColors(String str, String property, EnumDyeColor[] errValue) + { + return (EnumDyeColor[])this.parseObjects(str, EnumDyeColor.values(), NAME_GETTER_DYE_COLOR, property, errValue); + } + + public Weather[] parseWeather(String str, String property, Weather[] errValue) + { + return (Weather[])this.parseObjects(str, Weather.values(), NAME_GETTER_ENUM, property, errValue); + } + + public NbtTagValue parseNbtTagValue(String path, String value) + { + return path != null && value != null ? new NbtTagValue(path, value) : null; + } + + public VillagerProfession[] parseProfessions(String profStr) + { + if (profStr == null) + { + return null; + } + else + { + List list = new ArrayList(); + String[] astring = Config.tokenize(profStr, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + VillagerProfession villagerprofession = this.parseProfession(s); + + if (villagerprofession == null) + { + this.warn("Invalid profession: " + s); + return PROFESSIONS_INVALID; + } + + list.add(villagerprofession); + } + + if (list.isEmpty()) + { + return null; + } + else + { + VillagerProfession[] avillagerprofession = (VillagerProfession[])((VillagerProfession[])list.toArray(new VillagerProfession[list.size()])); + return avillagerprofession; + } + } + } + + private VillagerProfession parseProfession(String str) + { + str = str.toLowerCase(); + String[] astring = Config.tokenize(str, ":"); + + if (astring.length > 2) + { + return null; + } + else + { + String s = astring[0]; + String s1 = null; + + if (astring.length > 1) + { + s1 = astring[1]; + } + + int i = parseProfessionId(s); + + if (i < 0) + { + return null; + } + else + { + int[] aint = null; + + if (s1 != null) + { + aint = parseCareerIds(i, s1); + + if (aint == null) + { + return null; + } + } + + return new VillagerProfession(i, aint); + } + } + } + + private static int parseProfessionId(String str) + { + int i = Config.parseInt(str, -1); + return i >= 0 ? i : (str.equals("farmer") ? 0 : (str.equals("librarian") ? 1 : (str.equals("priest") ? 2 : (str.equals("blacksmith") ? 3 : (str.equals("butcher") ? 4 : (str.equals("nitwit") ? 5 : -1)))))); + } + + private static int[] parseCareerIds(int prof, String str) + { + Set set = new HashSet(); + String[] astring = Config.tokenize(str, ","); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + int j = parseCareerId(prof, s); + + if (j < 0) + { + return null; + } + + set.add(Integer.valueOf(j)); + } + + Integer[] ainteger = (Integer[])((Integer[])set.toArray(new Integer[set.size()])); + int[] aint = new int[ainteger.length]; + + for (int k = 0; k < aint.length; ++k) + { + aint[k] = ainteger[k].intValue(); + } + + return aint; + } + + private static int parseCareerId(int prof, String str) + { + int i = Config.parseInt(str, -1); + + if (i >= 0) + { + return i; + } + else + { + if (prof == 0) + { + if (str.equals("farmer")) + { + return 1; + } + + if (str.equals("fisherman")) + { + return 2; + } + + if (str.equals("shepherd")) + { + return 3; + } + + if (str.equals("fletcher")) + { + return 4; + } + } + + if (prof == 1) + { + if (str.equals("librarian")) + { + return 1; + } + + if (str.equals("cartographer")) + { + return 2; + } + } + + if (prof == 2 && str.equals("cleric")) + { + return 1; + } + else + { + if (prof == 3) + { + if (str.equals("armor")) + { + return 1; + } + + if (str.equals("weapon")) + { + return 2; + } + + if (str.equals("tool")) + { + return 3; + } + } + + if (prof == 4) + { + if (str.equals("butcher")) + { + return 1; + } + + if (str.equals("leather")) + { + return 2; + } + } + + return prof == 5 && str.equals("nitwit") ? 1 : -1; + } + } + } + + public int[] parseItems(String str) + { + str = str.trim(); + Set set = new TreeSet(); + String[] astring = Config.tokenize(str, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + ResourceLocation resourcelocation = new ResourceLocation(s); + Item item = (Item)Item.itemRegistry.getObject(resourcelocation); + + if (item == null) + { + this.warn("Item not found: " + s); + } + else + { + int j = Item.getIdFromItem(item); + + if (j < 0) + { + this.warn("Item has no ID: " + item + ", name: " + s); + } + else + { + set.add(new Integer(j)); + } + } + } + + Integer[] ainteger = (Integer[])((Integer[])set.toArray(new Integer[set.size()])); + int[] aint = Config.toPrimitive(ainteger); + return aint; + } + + public int[] parseEntities(String str) + { + str = str.trim(); + Set set = new TreeSet(); + String[] astring = Config.tokenize(str, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + int j = EntityUtils.getEntityIdByName(s); + + if (j < 0) + { + this.warn("Entity not found: " + s); + } + else + { + set.add(new Integer(j)); + } + } + + Integer[] ainteger = (Integer[])((Integer[])set.toArray(new Integer[set.size()])); + int[] aint = Config.toPrimitive(ainteger); + return aint; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/EntityClassLocator.java b/Client-1.8.9/src/main/java/net/optifine/config/EntityClassLocator.java new file mode 100644 index 0000000..07a85f1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/EntityClassLocator.java @@ -0,0 +1,13 @@ +package net.optifine.config; + +import net.minecraft.util.ResourceLocation; +import net.optifine.util.EntityUtils; + +public class EntityClassLocator implements IObjectLocator +{ + public Object getObject(ResourceLocation loc) + { + Class oclass = EntityUtils.getEntityClassByName(loc.getResourcePath()); + return oclass; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/GlVersion.java b/Client-1.8.9/src/main/java/net/optifine/config/GlVersion.java new file mode 100644 index 0000000..547bab2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/GlVersion.java @@ -0,0 +1,52 @@ +package net.optifine.config; + +public class GlVersion +{ + private int major; + private int minor; + private int release; + private String suffix; + + public GlVersion(int major, int minor) + { + this(major, minor, 0); + } + + public GlVersion(int major, int minor, int release) + { + this(major, minor, release, (String)null); + } + + public GlVersion(int major, int minor, int release, String suffix) + { + this.major = major; + this.minor = minor; + this.release = release; + this.suffix = suffix; + } + + public int getMajor() + { + return this.major; + } + + public int getMinor() + { + return this.minor; + } + + public int getRelease() + { + return this.release; + } + + public int toInt() + { + return this.minor > 9 ? this.major * 100 + this.minor : (this.release > 9 ? this.major * 100 + this.minor * 10 + 9 : this.major * 100 + this.minor * 10 + this.release); + } + + public String toString() + { + return this.suffix == null ? "" + this.major + "." + this.minor + "." + this.release : "" + this.major + "." + this.minor + "." + this.release + this.suffix; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/INameGetter.java b/Client-1.8.9/src/main/java/net/optifine/config/INameGetter.java new file mode 100644 index 0000000..67bedfd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/INameGetter.java @@ -0,0 +1,6 @@ +package net.optifine.config; + +public interface INameGetter +{ + String getName(T var1); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/IObjectLocator.java b/Client-1.8.9/src/main/java/net/optifine/config/IObjectLocator.java new file mode 100644 index 0000000..1842690 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/IObjectLocator.java @@ -0,0 +1,8 @@ +package net.optifine.config; + +import net.minecraft.util.ResourceLocation; + +public interface IObjectLocator +{ + Object getObject(ResourceLocation var1); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/IParserInt.java b/Client-1.8.9/src/main/java/net/optifine/config/IParserInt.java new file mode 100644 index 0000000..c4e5ce5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/IParserInt.java @@ -0,0 +1,6 @@ +package net.optifine.config; + +public interface IParserInt +{ + int parse(String var1, int var2); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/ItemLocator.java b/Client-1.8.9/src/main/java/net/optifine/config/ItemLocator.java new file mode 100644 index 0000000..224f9c8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/ItemLocator.java @@ -0,0 +1,13 @@ +package net.optifine.config; + +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; + +public class ItemLocator implements IObjectLocator +{ + public Object getObject(ResourceLocation loc) + { + Item item = Item.getByNameOrId(loc.toString()); + return item; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/MatchBlock.java b/Client-1.8.9/src/main/java/net/optifine/config/MatchBlock.java new file mode 100644 index 0000000..ba344ca --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/MatchBlock.java @@ -0,0 +1,75 @@ +package net.optifine.config; + +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.src.Config; + +public class MatchBlock +{ + private int blockId = -1; + private int[] metadatas = null; + + public MatchBlock(int blockId) + { + this.blockId = blockId; + } + + public MatchBlock(int blockId, int metadata) + { + this.blockId = blockId; + + if (metadata >= 0 && metadata <= 15) + { + this.metadatas = new int[] {metadata}; + } + } + + public MatchBlock(int blockId, int[] metadatas) + { + this.blockId = blockId; + this.metadatas = metadatas; + } + + public int getBlockId() + { + return this.blockId; + } + + public int[] getMetadatas() + { + return this.metadatas; + } + + public boolean matches(BlockStateBase blockState) + { + return blockState.getBlockId() != this.blockId ? false : Matches.metadata(blockState.getMetadata(), this.metadatas); + } + + public boolean matches(int id, int metadata) + { + return id != this.blockId ? false : Matches.metadata(metadata, this.metadatas); + } + + public void addMetadata(int metadata) + { + if (this.metadatas != null) + { + if (metadata >= 0 && metadata <= 15) + { + for (int i = 0; i < this.metadatas.length; ++i) + { + if (this.metadatas[i] == metadata) + { + return; + } + } + + this.metadatas = Config.addIntToArray(this.metadatas, metadata); + } + } + } + + public String toString() + { + return "" + this.blockId + ":" + Config.arrayToString(this.metadatas); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/Matches.java b/Client-1.8.9/src/main/java/net/optifine/config/Matches.java new file mode 100644 index 0000000..5830604 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/Matches.java @@ -0,0 +1,134 @@ +package net.optifine.config; + +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.world.biome.BiomeGenBase; + +public class Matches +{ + public static boolean block(BlockStateBase blockStateBase, MatchBlock[] matchBlocks) + { + if (matchBlocks == null) + { + return true; + } + else + { + for (int i = 0; i < matchBlocks.length; ++i) + { + MatchBlock matchblock = matchBlocks[i]; + + if (matchblock.matches(blockStateBase)) + { + return true; + } + } + + return false; + } + } + + public static boolean block(int blockId, int metadata, MatchBlock[] matchBlocks) + { + if (matchBlocks == null) + { + return true; + } + else + { + for (int i = 0; i < matchBlocks.length; ++i) + { + MatchBlock matchblock = matchBlocks[i]; + + if (matchblock.matches(blockId, metadata)) + { + return true; + } + } + + return false; + } + } + + public static boolean blockId(int blockId, MatchBlock[] matchBlocks) + { + if (matchBlocks == null) + { + return true; + } + else + { + for (int i = 0; i < matchBlocks.length; ++i) + { + MatchBlock matchblock = matchBlocks[i]; + + if (matchblock.getBlockId() == blockId) + { + return true; + } + } + + return false; + } + } + + public static boolean metadata(int metadata, int[] metadatas) + { + if (metadatas == null) + { + return true; + } + else + { + for (int i = 0; i < metadatas.length; ++i) + { + if (metadatas[i] == metadata) + { + return true; + } + } + + return false; + } + } + + public static boolean sprite(TextureAtlasSprite sprite, TextureAtlasSprite[] sprites) + { + if (sprites == null) + { + return true; + } + else + { + for (int i = 0; i < sprites.length; ++i) + { + if (sprites[i] == sprite) + { + return true; + } + } + + return false; + } + } + + public static boolean biome(BiomeGenBase biome, BiomeGenBase[] biomes) + { + if (biomes == null) + { + return true; + } + else + { + for (int i = 0; i < biomes.length; ++i) + { + if (biomes[i] == biome) + { + return true; + } + } + + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/NbtTagValue.java b/Client-1.8.9/src/main/java/net/optifine/config/NbtTagValue.java new file mode 100644 index 0000000..3c90a2e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/NbtTagValue.java @@ -0,0 +1,328 @@ +package net.optifine.config; + +import java.util.Arrays; +import java.util.regex.Pattern; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagByte; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagLong; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.src.Config; +import net.optifine.util.StrUtils; +import org.apache.commons.lang3.StringEscapeUtils; + +public class NbtTagValue +{ + private String[] parents = null; + private String name = null; + private boolean negative = false; + private int type = 0; + private String value = null; + private int valueFormat = 0; + private static final int TYPE_TEXT = 0; + private static final int TYPE_PATTERN = 1; + private static final int TYPE_IPATTERN = 2; + private static final int TYPE_REGEX = 3; + private static final int TYPE_IREGEX = 4; + private static final String PREFIX_PATTERN = "pattern:"; + private static final String PREFIX_IPATTERN = "ipattern:"; + private static final String PREFIX_REGEX = "regex:"; + private static final String PREFIX_IREGEX = "iregex:"; + private static final int FORMAT_DEFAULT = 0; + private static final int FORMAT_HEX_COLOR = 1; + private static final String PREFIX_HEX_COLOR = "#"; + private static final Pattern PATTERN_HEX_COLOR = Pattern.compile("^#[0-9a-f]{6}+$"); + + public NbtTagValue(String tag, String value) + { + String[] astring = Config.tokenize(tag, "."); + this.parents = (String[])Arrays.copyOfRange(astring, 0, astring.length - 1); + this.name = astring[astring.length - 1]; + + if (value.startsWith("!")) + { + this.negative = true; + value = value.substring(1); + } + + if (value.startsWith("pattern:")) + { + this.type = 1; + value = value.substring("pattern:".length()); + } + else if (value.startsWith("ipattern:")) + { + this.type = 2; + value = value.substring("ipattern:".length()).toLowerCase(); + } + else if (value.startsWith("regex:")) + { + this.type = 3; + value = value.substring("regex:".length()); + } + else if (value.startsWith("iregex:")) + { + this.type = 4; + value = value.substring("iregex:".length()).toLowerCase(); + } + else + { + this.type = 0; + } + + value = StringEscapeUtils.unescapeJava(value); + + if (this.type == 0 && PATTERN_HEX_COLOR.matcher(value).matches()) + { + this.valueFormat = 1; + } + + this.value = value; + } + + public boolean matches(NBTTagCompound nbt) + { + return this.negative ? !this.matchesCompound(nbt) : this.matchesCompound(nbt); + } + + public boolean matchesCompound(NBTTagCompound nbt) + { + if (nbt == null) + { + return false; + } + else + { + NBTBase nbtbase = nbt; + + for (int i = 0; i < this.parents.length; ++i) + { + String s = this.parents[i]; + nbtbase = getChildTag(nbtbase, s); + + if (nbtbase == null) + { + return false; + } + } + + if (this.name.equals("*")) + { + return this.matchesAnyChild(nbtbase); + } + else + { + nbtbase = getChildTag(nbtbase, this.name); + + if (nbtbase == null) + { + return false; + } + else if (this.matchesBase(nbtbase)) + { + return true; + } + else + { + return false; + } + } + } + } + + private boolean matchesAnyChild(NBTBase tagBase) + { + if (tagBase instanceof NBTTagCompound) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)tagBase; + + for (String s : nbttagcompound.getKeySet()) + { + NBTBase nbtbase = nbttagcompound.getTag(s); + + if (this.matchesBase(nbtbase)) + { + return true; + } + } + } + + if (tagBase instanceof NBTTagList) + { + NBTTagList nbttaglist = (NBTTagList)tagBase; + int i = nbttaglist.tagCount(); + + for (int j = 0; j < i; ++j) + { + NBTBase nbtbase1 = nbttaglist.get(j); + + if (this.matchesBase(nbtbase1)) + { + return true; + } + } + } + + return false; + } + + private static NBTBase getChildTag(NBTBase tagBase, String tag) + { + if (tagBase instanceof NBTTagCompound) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)tagBase; + return nbttagcompound.getTag(tag); + } + else if (tagBase instanceof NBTTagList) + { + NBTTagList nbttaglist = (NBTTagList)tagBase; + + if (tag.equals("count")) + { + return new NBTTagInt(nbttaglist.tagCount()); + } + else + { + int i = Config.parseInt(tag, -1); + return i >= 0 && i < nbttaglist.tagCount() ? nbttaglist.get(i) : null; + } + } + else + { + return null; + } + } + + public boolean matchesBase(NBTBase nbtBase) + { + if (nbtBase == null) + { + return false; + } + else + { + String s = getNbtString(nbtBase, this.valueFormat); + return this.matchesValue(s); + } + } + + public boolean matchesValue(String nbtValue) + { + if (nbtValue == null) + { + return false; + } + else + { + switch (this.type) + { + case 0: + return nbtValue.equals(this.value); + + case 1: + return this.matchesPattern(nbtValue, this.value); + + case 2: + return this.matchesPattern(nbtValue.toLowerCase(), this.value); + + case 3: + return this.matchesRegex(nbtValue, this.value); + + case 4: + return this.matchesRegex(nbtValue.toLowerCase(), this.value); + + default: + throw new IllegalArgumentException("Unknown NbtTagValue type: " + this.type); + } + } + } + + private boolean matchesPattern(String str, String pattern) + { + return StrUtils.equalsMask(str, pattern, '*', '?'); + } + + private boolean matchesRegex(String str, String regex) + { + return str.matches(regex); + } + + private static String getNbtString(NBTBase nbtBase, int format) + { + if (nbtBase == null) + { + return null; + } + else if (nbtBase instanceof NBTTagString) + { + NBTTagString nbttagstring = (NBTTagString)nbtBase; + return nbttagstring.getString(); + } + else if (nbtBase instanceof NBTTagInt) + { + NBTTagInt nbttagint = (NBTTagInt)nbtBase; + return format == 1 ? "#" + StrUtils.fillLeft(Integer.toHexString(nbttagint.getInt()), 6, '0') : Integer.toString(nbttagint.getInt()); + } + else if (nbtBase instanceof NBTTagByte) + { + NBTTagByte nbttagbyte = (NBTTagByte)nbtBase; + return Byte.toString(nbttagbyte.getByte()); + } + else if (nbtBase instanceof NBTTagShort) + { + NBTTagShort nbttagshort = (NBTTagShort)nbtBase; + return Short.toString(nbttagshort.getShort()); + } + else if (nbtBase instanceof NBTTagLong) + { + NBTTagLong nbttaglong = (NBTTagLong)nbtBase; + return Long.toString(nbttaglong.getLong()); + } + else if (nbtBase instanceof NBTTagFloat) + { + NBTTagFloat nbttagfloat = (NBTTagFloat)nbtBase; + return Float.toString(nbttagfloat.getFloat()); + } + else if (nbtBase instanceof NBTTagDouble) + { + NBTTagDouble nbttagdouble = (NBTTagDouble)nbtBase; + return Double.toString(nbttagdouble.getDouble()); + } + else + { + return nbtBase.toString(); + } + } + + public String toString() + { + StringBuffer stringbuffer = new StringBuffer(); + + for (int i = 0; i < this.parents.length; ++i) + { + String s = this.parents[i]; + + if (i > 0) + { + stringbuffer.append("."); + } + + stringbuffer.append(s); + } + + if (stringbuffer.length() > 0) + { + stringbuffer.append("."); + } + + stringbuffer.append(this.name); + stringbuffer.append(" = "); + stringbuffer.append(this.value); + return stringbuffer.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/ParserEnchantmentId.java b/Client-1.8.9/src/main/java/net/optifine/config/ParserEnchantmentId.java new file mode 100644 index 0000000..1928aba --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/ParserEnchantmentId.java @@ -0,0 +1,12 @@ +package net.optifine.config; + +import net.minecraft.enchantment.Enchantment; + +public class ParserEnchantmentId implements IParserInt +{ + public int parse(String str, int defVal) + { + Enchantment enchantment = Enchantment.getEnchantmentByLocation(str); + return enchantment == null ? defVal : enchantment.effectId; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/RangeInt.java b/Client-1.8.9/src/main/java/net/optifine/config/RangeInt.java new file mode 100644 index 0000000..65a0df8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/RangeInt.java @@ -0,0 +1,33 @@ +package net.optifine.config; + +public class RangeInt +{ + private int min; + private int max; + + public RangeInt(int min, int max) + { + this.min = Math.min(min, max); + this.max = Math.max(min, max); + } + + public boolean isInRange(int val) + { + return val < this.min ? false : val <= this.max; + } + + public int getMin() + { + return this.min; + } + + public int getMax() + { + return this.max; + } + + public String toString() + { + return "min: " + this.min + ", max: " + this.max; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/RangeListInt.java b/Client-1.8.9/src/main/java/net/optifine/config/RangeListInt.java new file mode 100644 index 0000000..747881d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/RangeListInt.java @@ -0,0 +1,68 @@ +package net.optifine.config; + +import net.minecraft.src.Config; + +public class RangeListInt +{ + private RangeInt[] ranges = new RangeInt[0]; + + public RangeListInt() + { + } + + public RangeListInt(RangeInt ri) + { + this.addRange(ri); + } + + public void addRange(RangeInt ri) + { + this.ranges = (RangeInt[])((RangeInt[])Config.addObjectToArray(this.ranges, ri)); + } + + public boolean isInRange(int val) + { + for (int i = 0; i < this.ranges.length; ++i) + { + RangeInt rangeint = this.ranges[i]; + + if (rangeint.isInRange(val)) + { + return true; + } + } + + return false; + } + + public int getCountRanges() + { + return this.ranges.length; + } + + public RangeInt getRange(int i) + { + return this.ranges[i]; + } + + public String toString() + { + StringBuffer stringbuffer = new StringBuffer(); + stringbuffer.append("["); + + for (int i = 0; i < this.ranges.length; ++i) + { + RangeInt rangeint = this.ranges[i]; + + if (i > 0) + { + stringbuffer.append(", "); + } + + stringbuffer.append(rangeint.toString()); + } + + stringbuffer.append("]"); + return stringbuffer.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/VillagerProfession.java b/Client-1.8.9/src/main/java/net/optifine/config/VillagerProfession.java new file mode 100644 index 0000000..6f9dad8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/VillagerProfession.java @@ -0,0 +1,68 @@ +package net.optifine.config; + +import net.minecraft.src.Config; + +public class VillagerProfession +{ + private int profession; + private int[] careers; + + public VillagerProfession(int profession) + { + this(profession, (int[])null); + } + + public VillagerProfession(int profession, int career) + { + this(profession, new int[] {career}); + } + + public VillagerProfession(int profession, int[] careers) + { + this.profession = profession; + this.careers = careers; + } + + public boolean matches(int prof, int car) + { + return this.profession != prof ? false : this.careers == null || Config.equalsOne(car, this.careers); + } + + private boolean hasCareer(int car) + { + return this.careers == null ? false : Config.equalsOne(car, this.careers); + } + + public boolean addCareer(int car) + { + if (this.careers == null) + { + this.careers = new int[] {car}; + return true; + } + else if (this.hasCareer(car)) + { + return false; + } + else + { + this.careers = Config.addIntToArray(this.careers, car); + return true; + } + } + + public int getProfession() + { + return this.profession; + } + + public int[] getCareers() + { + return this.careers; + } + + public String toString() + { + return this.careers == null ? "" + this.profession : "" + this.profession + ":" + Config.arrayToString(this.careers); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/config/Weather.java b/Client-1.8.9/src/main/java/net/optifine/config/Weather.java new file mode 100644 index 0000000..e931334 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/config/Weather.java @@ -0,0 +1,25 @@ +package net.optifine.config; + +import net.minecraft.world.World; + +public enum Weather +{ + CLEAR, + RAIN, + THUNDER; + + public static Weather getWeather(World world, float partialTicks) + { + float f = world.getThunderStrength(partialTicks); + + if (f > 0.5F) + { + return THUNDER; + } + else + { + float f1 = world.getRainStrength(partialTicks); + return f1 > 0.5F ? RAIN : CLEAR; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModel.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModel.java new file mode 100644 index 0000000..37a1d5a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModel.java @@ -0,0 +1,7 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; + +public class CustomEntityModel extends ModelBase +{ +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModelParser.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModelParser.java new file mode 100644 index 0000000..10c5ad7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModelParser.java @@ -0,0 +1,274 @@ +package net.optifine.entity.model; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.ConnectedParser; +import net.optifine.entity.model.anim.ModelUpdater; +import net.optifine.entity.model.anim.ModelVariableUpdater; +import net.optifine.player.PlayerItemParser; +import net.optifine.util.Json; + +public class CustomEntityModelParser +{ + public static final String ENTITY = "entity"; + public static final String TEXTURE = "texture"; + public static final String SHADOW_SIZE = "shadowSize"; + public static final String ITEM_TYPE = "type"; + public static final String ITEM_TEXTURE_SIZE = "textureSize"; + public static final String ITEM_USE_PLAYER_TEXTURE = "usePlayerTexture"; + public static final String ITEM_MODELS = "models"; + public static final String ITEM_ANIMATIONS = "animations"; + public static final String MODEL_ID = "id"; + public static final String MODEL_BASE_ID = "baseId"; + public static final String MODEL_MODEL = "model"; + public static final String MODEL_TYPE = "type"; + public static final String MODEL_PART = "part"; + public static final String MODEL_ATTACH = "attach"; + public static final String MODEL_INVERT_AXIS = "invertAxis"; + public static final String MODEL_MIRROR_TEXTURE = "mirrorTexture"; + public static final String MODEL_TRANSLATE = "translate"; + public static final String MODEL_ROTATE = "rotate"; + public static final String MODEL_SCALE = "scale"; + public static final String MODEL_BOXES = "boxes"; + public static final String MODEL_SPRITES = "sprites"; + public static final String MODEL_SUBMODEL = "submodel"; + public static final String MODEL_SUBMODELS = "submodels"; + public static final String BOX_TEXTURE_OFFSET = "textureOffset"; + public static final String BOX_COORDINATES = "coordinates"; + public static final String BOX_SIZE_ADD = "sizeAdd"; + public static final String ENTITY_MODEL = "EntityModel"; + public static final String ENTITY_MODEL_PART = "EntityModelPart"; + + public static CustomEntityRenderer parseEntityRender(JsonObject obj, String path) + { + ConnectedParser connectedparser = new ConnectedParser("CustomEntityModels"); + String s = connectedparser.parseName(path); + String s1 = connectedparser.parseBasePath(path); + String s2 = Json.getString(obj, "texture"); + int[] aint = Json.parseIntArray(obj.get("textureSize"), 2); + float f = Json.getFloat(obj, "shadowSize", -1.0F); + JsonArray jsonarray = (JsonArray)obj.get("models"); + checkNull(jsonarray, "Missing models"); + Map map = new HashMap(); + List list = new ArrayList(); + + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonObject jsonobject = (JsonObject)jsonarray.get(i); + processBaseId(jsonobject, map); + processExternalModel(jsonobject, map, s1); + processId(jsonobject, map); + CustomModelRenderer custommodelrenderer = parseCustomModelRenderer(jsonobject, aint, s1); + + if (custommodelrenderer != null) + { + list.add(custommodelrenderer); + } + } + + CustomModelRenderer[] acustommodelrenderer = (CustomModelRenderer[])((CustomModelRenderer[])list.toArray(new CustomModelRenderer[list.size()])); + ResourceLocation resourcelocation = null; + + if (s2 != null) + { + resourcelocation = getResourceLocation(s1, s2, ".png"); + } + + CustomEntityRenderer customentityrenderer = new CustomEntityRenderer(s, s1, resourcelocation, acustommodelrenderer, f); + return customentityrenderer; + } + + private static void processBaseId(JsonObject elem, Map mapModelJsons) + { + String s = Json.getString(elem, "baseId"); + + if (s != null) + { + JsonObject jsonobject = (JsonObject)mapModelJsons.get(s); + + if (jsonobject == null) + { + Config.warn("BaseID not found: " + s); + } + else + { + copyJsonElements(jsonobject, elem); + } + } + } + + private static void processExternalModel(JsonObject elem, Map mapModelJsons, String basePath) + { + String s = Json.getString(elem, "model"); + + if (s != null) + { + ResourceLocation resourcelocation = getResourceLocation(basePath, s, ".jpm"); + + try + { + JsonObject jsonobject = loadJson(resourcelocation); + + if (jsonobject == null) + { + Config.warn("Model not found: " + resourcelocation); + return; + } + + copyJsonElements(jsonobject, elem); + } + catch (IOException ioexception) + { + Config.error("" + ioexception.getClass().getName() + ": " + ioexception.getMessage()); + } + catch (JsonParseException jsonparseexception) + { + Config.error("" + jsonparseexception.getClass().getName() + ": " + jsonparseexception.getMessage()); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } + + private static void copyJsonElements(JsonObject objFrom, JsonObject objTo) + { + for (Entry entry : objFrom.entrySet()) + { + if (!((String)entry.getKey()).equals("id") && !objTo.has((String)entry.getKey())) + { + objTo.add((String)entry.getKey(), (JsonElement)entry.getValue()); + } + } + } + + public static ResourceLocation getResourceLocation(String basePath, String path, String extension) + { + if (!path.endsWith(extension)) + { + path = path + extension; + } + + if (!path.contains("/")) + { + path = basePath + "/" + path; + } + else if (path.startsWith("./")) + { + path = basePath + "/" + path.substring(2); + } + else if (path.startsWith("~/")) + { + path = "optifine/" + path.substring(2); + } + + return new ResourceLocation(path); + } + + private static void processId(JsonObject elem, Map mapModelJsons) + { + String s = Json.getString(elem, "id"); + + if (s != null) + { + if (s.length() < 1) + { + Config.warn("Empty model ID: " + s); + } + else if (mapModelJsons.containsKey(s)) + { + Config.warn("Duplicate model ID: " + s); + } + else + { + mapModelJsons.put(s, elem); + } + } + } + + public static CustomModelRenderer parseCustomModelRenderer(JsonObject elem, int[] textureSize, String basePath) + { + String s = Json.getString(elem, "part"); + checkNull(s, "Model part not specified, missing \"replace\" or \"attachTo\"."); + boolean flag = Json.getBoolean(elem, "attach", false); + ModelBase modelbase = new CustomEntityModel(); + + if (textureSize != null) + { + modelbase.textureWidth = textureSize[0]; + modelbase.textureHeight = textureSize[1]; + } + + ModelUpdater modelupdater = null; + JsonArray jsonarray = (JsonArray)elem.get("animations"); + + if (jsonarray != null) + { + List list = new ArrayList(); + + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonObject jsonobject = (JsonObject)jsonarray.get(i); + + for (Entry entry : jsonobject.entrySet()) + { + String s1 = (String)entry.getKey(); + String s2 = ((JsonElement)entry.getValue()).getAsString(); + ModelVariableUpdater modelvariableupdater = new ModelVariableUpdater(s1, s2); + list.add(modelvariableupdater); + } + } + + if (list.size() > 0) + { + ModelVariableUpdater[] amodelvariableupdater = (ModelVariableUpdater[])((ModelVariableUpdater[])list.toArray(new ModelVariableUpdater[list.size()])); + modelupdater = new ModelUpdater(amodelvariableupdater); + } + } + + ModelRenderer modelrenderer = PlayerItemParser.parseModelRenderer(elem, modelbase, textureSize, basePath); + CustomModelRenderer custommodelrenderer = new CustomModelRenderer(s, flag, modelrenderer, modelupdater); + return custommodelrenderer; + } + + private static void checkNull(Object obj, String msg) + { + if (obj == null) + { + throw new JsonParseException(msg); + } + } + + public static JsonObject loadJson(ResourceLocation location) throws IOException, JsonParseException + { + InputStream inputstream = Config.getResourceStream(location); + + if (inputstream == null) + { + return null; + } + else + { + String s = Config.readInputStream(inputstream, "ASCII"); + inputstream.close(); + JsonParser jsonparser = new JsonParser(); + JsonObject jsonobject = (JsonObject)jsonparser.parse(s); + return jsonobject; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModels.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModels.java new file mode 100644 index 0000000..5d74687 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityModels.java @@ -0,0 +1,329 @@ +package net.optifine.entity.model; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.IdentityHashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.entity.model.anim.ModelResolver; +import net.optifine.entity.model.anim.ModelUpdater; + +public class CustomEntityModels +{ + private static boolean active = false; + private static Map originalEntityRenderMap = null; + private static Map originalTileEntityRenderMap = null; + + public static void update() + { + Map map = getEntityRenderMap(); + Map map1 = getTileEntityRenderMap(); + + if (map == null) + { + Config.warn("Entity render map not found, custom entity models are DISABLED."); + } + else if (map1 == null) + { + Config.warn("Tile entity render map not found, custom entity models are DISABLED."); + } + else + { + active = false; + map.clear(); + map1.clear(); + map.putAll(originalEntityRenderMap); + map1.putAll(originalTileEntityRenderMap); + + if (Config.isCustomEntityModels()) + { + ResourceLocation[] aresourcelocation = getModelLocations(); + + for (int i = 0; i < aresourcelocation.length; ++i) + { + ResourceLocation resourcelocation = aresourcelocation[i]; + Config.dbg("CustomEntityModel: " + resourcelocation.getResourcePath()); + IEntityRenderer ientityrenderer = parseEntityRender(resourcelocation); + + if (ientityrenderer != null) + { + Class oclass = ientityrenderer.getEntityClass(); + + if (oclass != null) + { + if (ientityrenderer instanceof Render) + { + map.put(oclass, (Render)ientityrenderer); + } + else if (ientityrenderer instanceof TileEntitySpecialRenderer) + { + map1.put(oclass, (TileEntitySpecialRenderer)ientityrenderer); + } + else + { + Config.warn("Unknown renderer type: " + ientityrenderer.getClass().getName()); + } + + active = true; + } + } + } + } + } + } + + private static Map getEntityRenderMap() + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + Map map = rendermanager.getEntityRenderMap(); + + if (map == null) + { + return null; + } + else + { + if (originalEntityRenderMap == null) + { + originalEntityRenderMap = new HashMap(map); + } + + return map; + } + } + + private static Map getTileEntityRenderMap() + { + Map map = TileEntityRendererDispatcher.instance.mapSpecialRenderers; + + if (originalTileEntityRenderMap == null) + { + originalTileEntityRenderMap = new HashMap(map); + } + + return map; + } + + private static ResourceLocation[] getModelLocations() + { + String s = "optifine/cem/"; + String s1 = ".jem"; + List list = new ArrayList(); + String[] astring = CustomModelRegistry.getModelNames(); + + for (int i = 0; i < astring.length; ++i) + { + String s2 = astring[i]; + String s3 = s + s2 + s1; + ResourceLocation resourcelocation = new ResourceLocation(s3); + + if (Config.hasResource(resourcelocation)) + { + list.add(resourcelocation); + } + } + + ResourceLocation[] aresourcelocation = (ResourceLocation[])((ResourceLocation[])list.toArray(new ResourceLocation[list.size()])); + return aresourcelocation; + } + + private static IEntityRenderer parseEntityRender(ResourceLocation location) + { + try + { + JsonObject jsonobject = CustomEntityModelParser.loadJson(location); + IEntityRenderer ientityrenderer = parseEntityRender(jsonobject, location.getResourcePath()); + return ientityrenderer; + } + catch (IOException ioexception) + { + Config.error("" + ioexception.getClass().getName() + ": " + ioexception.getMessage()); + return null; + } + catch (JsonParseException jsonparseexception) + { + Config.error("" + jsonparseexception.getClass().getName() + ": " + jsonparseexception.getMessage()); + return null; + } + catch (Exception exception) + { + exception.printStackTrace(); + return null; + } + } + + private static IEntityRenderer parseEntityRender(JsonObject obj, String path) + { + CustomEntityRenderer customentityrenderer = CustomEntityModelParser.parseEntityRender(obj, path); + String s = customentityrenderer.getName(); + ModelAdapter modeladapter = CustomModelRegistry.getModelAdapter(s); + checkNull(modeladapter, "Entity not found: " + s); + Class oclass = modeladapter.getEntityClass(); + checkNull(oclass, "Entity class not found: " + s); + IEntityRenderer ientityrenderer = makeEntityRender(modeladapter, customentityrenderer); + + if (ientityrenderer == null) + { + return null; + } + else + { + ientityrenderer.setEntityClass(oclass); + return ientityrenderer; + } + } + + private static IEntityRenderer makeEntityRender(ModelAdapter modelAdapter, CustomEntityRenderer cer) + { + ResourceLocation resourcelocation = cer.getTextureLocation(); + CustomModelRenderer[] acustommodelrenderer = cer.getCustomModelRenderers(); + float f = cer.getShadowSize(); + + if (f < 0.0F) + { + f = modelAdapter.getShadowSize(); + } + + ModelBase modelbase = modelAdapter.makeModel(); + + if (modelbase == null) + { + return null; + } + else + { + ModelResolver modelresolver = new ModelResolver(modelAdapter, modelbase, acustommodelrenderer); + + if (!modifyModel(modelAdapter, modelbase, acustommodelrenderer, modelresolver)) + { + return null; + } + else + { + IEntityRenderer ientityrenderer = modelAdapter.makeEntityRender(modelbase, f); + + if (ientityrenderer == null) + { + throw new JsonParseException("Entity renderer is null, model: " + modelAdapter.getName() + ", adapter: " + modelAdapter.getClass().getName()); + } + else + { + if (resourcelocation != null) + { + ientityrenderer.setLocationTextureCustom(resourcelocation); + } + + return ientityrenderer; + } + } + } + } + + private static boolean modifyModel(ModelAdapter modelAdapter, ModelBase model, CustomModelRenderer[] modelRenderers, ModelResolver mr) + { + for (int i = 0; i < modelRenderers.length; ++i) + { + CustomModelRenderer custommodelrenderer = modelRenderers[i]; + + if (!modifyModel(modelAdapter, model, custommodelrenderer, mr)) + { + return false; + } + } + + return true; + } + + private static boolean modifyModel(ModelAdapter modelAdapter, ModelBase model, CustomModelRenderer customModelRenderer, ModelResolver modelResolver) + { + String s = customModelRenderer.getModelPart(); + ModelRenderer modelrenderer = modelAdapter.getModelRenderer(model, s); + + if (modelrenderer == null) + { + Config.warn("Model part not found: " + s + ", model: " + model); + return false; + } + else + { + if (!customModelRenderer.isAttach()) + { + if (modelrenderer.cubeList != null) + { + modelrenderer.cubeList.clear(); + } + + if (modelrenderer.spriteList != null) + { + modelrenderer.spriteList.clear(); + } + + if (modelrenderer.childModels != null) + { + ModelRenderer[] amodelrenderer = modelAdapter.getModelRenderers(model); + Set set = Collections.newSetFromMap(new IdentityHashMap()); + set.addAll(Arrays.asList(amodelrenderer)); + List list = modelrenderer.childModels; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + ModelRenderer modelrenderer1 = (ModelRenderer)iterator.next(); + + if (!set.contains(modelrenderer1)) + { + iterator.remove(); + } + } + } + } + + modelrenderer.addChild(customModelRenderer.getModelRenderer()); + ModelUpdater modelupdater = customModelRenderer.getModelUpdater(); + + if (modelupdater != null) + { + modelResolver.setThisModelRenderer(customModelRenderer.getModelRenderer()); + modelResolver.setPartModelRenderer(modelrenderer); + + if (!modelupdater.initialize(modelResolver)) + { + return false; + } + + customModelRenderer.getModelRenderer().setModelUpdater(modelupdater); + } + + return true; + } + } + + private static void checkNull(Object obj, String msg) + { + if (obj == null) + { + throw new JsonParseException(msg); + } + } + + public static boolean isActive() + { + return active; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityRenderer.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityRenderer.java new file mode 100644 index 0000000..980b759 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomEntityRenderer.java @@ -0,0 +1,46 @@ +package net.optifine.entity.model; + +import net.minecraft.util.ResourceLocation; + +public class CustomEntityRenderer +{ + private String name = null; + private String basePath = null; + private ResourceLocation textureLocation = null; + private CustomModelRenderer[] customModelRenderers = null; + private float shadowSize = 0.0F; + + public CustomEntityRenderer(String name, String basePath, ResourceLocation textureLocation, CustomModelRenderer[] customModelRenderers, float shadowSize) + { + this.name = name; + this.basePath = basePath; + this.textureLocation = textureLocation; + this.customModelRenderers = customModelRenderers; + this.shadowSize = shadowSize; + } + + public String getName() + { + return this.name; + } + + public String getBasePath() + { + return this.basePath; + } + + public ResourceLocation getTextureLocation() + { + return this.textureLocation; + } + + public CustomModelRenderer[] getCustomModelRenderers() + { + return this.customModelRenderers; + } + + public float getShadowSize() + { + return this.shadowSize; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomModelRegistry.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomModelRegistry.java new file mode 100644 index 0000000..75c1679 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomModelRegistry.java @@ -0,0 +1,118 @@ +package net.optifine.entity.model; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.src.Config; + +public class CustomModelRegistry +{ + private static Map mapModelAdapters = makeMapModelAdapters(); + + private static Map makeMapModelAdapters() + { + Map map = new LinkedHashMap(); + addModelAdapter(map, new ModelAdapterArmorStand()); + addModelAdapter(map, new ModelAdapterBat()); + addModelAdapter(map, new ModelAdapterBlaze()); + addModelAdapter(map, new ModelAdapterBoat()); + addModelAdapter(map, new ModelAdapterCaveSpider()); + addModelAdapter(map, new ModelAdapterChicken()); + addModelAdapter(map, new ModelAdapterCow()); + addModelAdapter(map, new ModelAdapterCreeper()); + addModelAdapter(map, new ModelAdapterDragon()); + addModelAdapter(map, new ModelAdapterEnderCrystal()); + addModelAdapter(map, new ModelAdapterEnderman()); + addModelAdapter(map, new ModelAdapterEndermite()); + addModelAdapter(map, new ModelAdapterGhast()); + addModelAdapter(map, new ModelAdapterGuardian()); + addModelAdapter(map, new ModelAdapterHorse()); + addModelAdapter(map, new ModelAdapterIronGolem()); + addModelAdapter(map, new ModelAdapterLeadKnot()); + addModelAdapter(map, new ModelAdapterMagmaCube()); + addModelAdapter(map, new ModelAdapterMinecart()); + addModelAdapter(map, new ModelAdapterMinecartTnt()); + addModelAdapter(map, new ModelAdapterMinecartMobSpawner()); + addModelAdapter(map, new ModelAdapterMooshroom()); + addModelAdapter(map, new ModelAdapterOcelot()); + addModelAdapter(map, new ModelAdapterPig()); + addModelAdapter(map, new ModelAdapterPigZombie()); + addModelAdapter(map, new ModelAdapterRabbit()); + addModelAdapter(map, new ModelAdapterSheep()); + addModelAdapter(map, new ModelAdapterSilverfish()); + addModelAdapter(map, new ModelAdapterSkeleton()); + addModelAdapter(map, new ModelAdapterSlime()); + addModelAdapter(map, new ModelAdapterSnowman()); + addModelAdapter(map, new ModelAdapterSpider()); + addModelAdapter(map, new ModelAdapterSquid()); + addModelAdapter(map, new ModelAdapterVillager()); + addModelAdapter(map, new ModelAdapterWitch()); + addModelAdapter(map, new ModelAdapterWither()); + addModelAdapter(map, new ModelAdapterWitherSkull()); + addModelAdapter(map, new ModelAdapterWolf()); + addModelAdapter(map, new ModelAdapterZombie()); + addModelAdapter(map, new ModelAdapterSheepWool()); + addModelAdapter(map, new ModelAdapterBanner()); + addModelAdapter(map, new ModelAdapterBook()); + addModelAdapter(map, new ModelAdapterChest()); + addModelAdapter(map, new ModelAdapterChestLarge()); + addModelAdapter(map, new ModelAdapterEnderChest()); + addModelAdapter(map, new ModelAdapterHeadHumanoid()); + addModelAdapter(map, new ModelAdapterHeadSkeleton()); + addModelAdapter(map, new ModelAdapterSign()); + return map; + } + + private static void addModelAdapter(Map map, ModelAdapter modelAdapter) + { + addModelAdapter(map, modelAdapter, modelAdapter.getName()); + String[] astring = modelAdapter.getAliases(); + + if (astring != null) + { + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + addModelAdapter(map, modelAdapter, s); + } + } + + ModelBase modelbase = modelAdapter.makeModel(); + String[] astring1 = modelAdapter.getModelRendererNames(); + + for (int j = 0; j < astring1.length; ++j) + { + String s1 = astring1[j]; + ModelRenderer modelrenderer = modelAdapter.getModelRenderer(modelbase, s1); + + if (modelrenderer == null) + { + Config.warn("Model renderer not found, model: " + modelAdapter.getName() + ", name: " + s1); + } + } + } + + private static void addModelAdapter(Map map, ModelAdapter modelAdapter, String name) + { + if (map.containsKey(name)) + { + Config.warn("Model adapter already registered for id: " + name + ", class: " + modelAdapter.getEntityClass().getName()); + } + + map.put(name, modelAdapter); + } + + public static ModelAdapter getModelAdapter(String name) + { + return (ModelAdapter)mapModelAdapters.get(name); + } + + public static String[] getModelNames() + { + Set set = mapModelAdapters.keySet(); + String[] astring = (String[])((String[])set.toArray(new String[set.size()])); + return astring; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomModelRenderer.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomModelRenderer.java new file mode 100644 index 0000000..683bea6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/CustomModelRenderer.java @@ -0,0 +1,40 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelRenderer; +import net.optifine.entity.model.anim.ModelUpdater; + +public class CustomModelRenderer +{ + private String modelPart; + private boolean attach; + private ModelRenderer modelRenderer; + private ModelUpdater modelUpdater; + + public CustomModelRenderer(String modelPart, boolean attach, ModelRenderer modelRenderer, ModelUpdater modelUpdater) + { + this.modelPart = modelPart; + this.attach = attach; + this.modelRenderer = modelRenderer; + this.modelUpdater = modelUpdater; + } + + public ModelRenderer getModelRenderer() + { + return this.modelRenderer; + } + + public String getModelPart() + { + return this.modelPart; + } + + public boolean isAttach() + { + return this.attach; + } + + public ModelUpdater getModelUpdater() + { + return this.modelUpdater; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/IEntityRenderer.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/IEntityRenderer.java new file mode 100644 index 0000000..4152c61 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/IEntityRenderer.java @@ -0,0 +1,14 @@ +package net.optifine.entity.model; + +import net.minecraft.util.ResourceLocation; + +public interface IEntityRenderer +{ + Class getEntityClass(); + + void setEntityClass(Class var1); + + ResourceLocation getLocationTextureCustom(); + + void setLocationTextureCustom(ResourceLocation var1); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapter.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapter.java new file mode 100644 index 0000000..8f5e50e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapter.java @@ -0,0 +1,77 @@ +package net.optifine.entity.model; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; + +public abstract class ModelAdapter +{ + private Class entityClass; + private String name; + private float shadowSize; + private String[] aliases; + + public ModelAdapter(Class entityClass, String name, float shadowSize) + { + this.entityClass = entityClass; + this.name = name; + this.shadowSize = shadowSize; + } + + public ModelAdapter(Class entityClass, String name, float shadowSize, String[] aliases) + { + this.entityClass = entityClass; + this.name = name; + this.shadowSize = shadowSize; + this.aliases = aliases; + } + + public Class getEntityClass() + { + return this.entityClass; + } + + public String getName() + { + return this.name; + } + + public String[] getAliases() + { + return this.aliases; + } + + public float getShadowSize() + { + return this.shadowSize; + } + + public abstract ModelBase makeModel(); + + public abstract ModelRenderer getModelRenderer(ModelBase var1, String var2); + + public abstract String[] getModelRendererNames(); + + public abstract IEntityRenderer makeEntityRender(ModelBase var1, float var2); + + public ModelRenderer[] getModelRenderers(ModelBase model) + { + String[] astring = this.getModelRendererNames(); + List list = new ArrayList(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + ModelRenderer modelrenderer = this.getModelRenderer(model, s); + + if (modelrenderer != null) + { + list.add(modelrenderer); + } + } + + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])list.toArray(new ModelRenderer[list.size()])); + return amodelrenderer; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterArmorStand.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterArmorStand.java new file mode 100644 index 0000000..f1e43fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterArmorStand.java @@ -0,0 +1,52 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelArmorStand; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.ArmorStandRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.src.Config; + +public class ModelAdapterArmorStand extends ModelAdapterBiped +{ + public ModelAdapterArmorStand() + { + super(EntityArmorStand.class, "armor_stand", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelArmorStand(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelArmorStand)) + { + return null; + } + else + { + ModelArmorStand modelarmorstand = (ModelArmorStand)model; + return modelPart.equals("right") ? modelarmorstand.standRightSide : (modelPart.equals("left") ? modelarmorstand.standLeftSide : (modelPart.equals("waist") ? modelarmorstand.standWaist : (modelPart.equals("base") ? modelarmorstand.standBase : super.getModelRenderer(modelarmorstand, modelPart)))); + } + } + + public String[] getModelRendererNames() + { + String[] astring = super.getModelRendererNames(); + astring = (String[])((String[])Config.addObjectsToArray(astring, new String[] {"right", "left", "waist", "base"})); + return astring; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + ArmorStandRenderer armorstandrenderer = new ArmorStandRenderer(rendermanager); + armorstandrenderer.mainModel = modelBase; + armorstandrenderer.shadowSize = shadowSize; + return armorstandrenderer; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBanner.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBanner.java new file mode 100644 index 0000000..4912934 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBanner.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBanner; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityBanner; +import net.optifine.reflect.Reflector; + +public class ModelAdapterBanner extends ModelAdapter +{ + public ModelAdapterBanner() + { + super(TileEntityBanner.class, "banner", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelBanner(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelBanner)) + { + return null; + } + else + { + ModelBanner modelbanner = (ModelBanner)model; + return modelPart.equals("slate") ? modelbanner.bannerSlate : (modelPart.equals("stand") ? modelbanner.bannerStand : (modelPart.equals("top") ? modelbanner.bannerTop : null)); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"slate", "stand", "top"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityBanner.class); + + if (!(tileentityspecialrenderer instanceof TileEntityBannerRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntityBannerRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntityBannerRenderer_bannerModel.exists()) + { + Config.warn("Field not found: TileEntityBannerRenderer.bannerModel"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityBannerRenderer_bannerModel, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBat.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBat.java new file mode 100644 index 0000000..cf7bd00 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBat.java @@ -0,0 +1,50 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBat; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderBat; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.passive.EntityBat; +import net.optifine.reflect.Reflector; + +public class ModelAdapterBat extends ModelAdapter +{ + public ModelAdapterBat() + { + super(EntityBat.class, "bat", 0.25F); + } + + public ModelBase makeModel() + { + return new ModelBat(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelBat)) + { + return null; + } + else + { + ModelBat modelbat = (ModelBat)model; + return modelPart.equals("head") ? (ModelRenderer)Reflector.getFieldValue(modelbat, Reflector.ModelBat_ModelRenderers, 0) : (modelPart.equals("body") ? (ModelRenderer)Reflector.getFieldValue(modelbat, Reflector.ModelBat_ModelRenderers, 1) : (modelPart.equals("right_wing") ? (ModelRenderer)Reflector.getFieldValue(modelbat, Reflector.ModelBat_ModelRenderers, 2) : (modelPart.equals("left_wing") ? (ModelRenderer)Reflector.getFieldValue(modelbat, Reflector.ModelBat_ModelRenderers, 3) : (modelPart.equals("outer_right_wing") ? (ModelRenderer)Reflector.getFieldValue(modelbat, Reflector.ModelBat_ModelRenderers, 4) : (modelPart.equals("outer_left_wing") ? (ModelRenderer)Reflector.getFieldValue(modelbat, Reflector.ModelBat_ModelRenderers, 5) : null))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "body", "right_wing", "left_wing", "outer_right_wing", "outer_left_wing"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderBat renderbat = new RenderBat(rendermanager); + renderbat.mainModel = modelBase; + renderbat.shadowSize = shadowSize; + return renderbat; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBiped.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBiped.java new file mode 100644 index 0000000..395e152 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBiped.java @@ -0,0 +1,31 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; + +public abstract class ModelAdapterBiped extends ModelAdapter +{ + public ModelAdapterBiped(Class entityClass, String name, float shadowSize) + { + super(entityClass, name, shadowSize); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelBiped)) + { + return null; + } + else + { + ModelBiped modelbiped = (ModelBiped)model; + return modelPart.equals("head") ? modelbiped.bipedHead : (modelPart.equals("headwear") ? modelbiped.bipedHeadwear : (modelPart.equals("body") ? modelbiped.bipedBody : (modelPart.equals("left_arm") ? modelbiped.bipedLeftArm : (modelPart.equals("right_arm") ? modelbiped.bipedRightArm : (modelPart.equals("left_leg") ? modelbiped.bipedLeftLeg : (modelPart.equals("right_leg") ? modelbiped.bipedRightLeg : null)))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "headwear", "body", "left_arm", "right_arm", "left_leg", "right_leg"}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBlaze.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBlaze.java new file mode 100644 index 0000000..93b2fc8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBlaze.java @@ -0,0 +1,80 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBlaze; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderBlaze; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterBlaze extends ModelAdapter +{ + public ModelAdapterBlaze() + { + super(EntityBlaze.class, "blaze", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelBlaze(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelBlaze)) + { + return null; + } + else + { + ModelBlaze modelblaze = (ModelBlaze)model; + + if (modelPart.equals("head")) + { + return (ModelRenderer)Reflector.getFieldValue(modelblaze, Reflector.ModelBlaze_blazeHead); + } + else + { + String s = "stick"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelblaze, Reflector.ModelBlaze_blazeSticks)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s1 = modelPart.substring(s.length()); + int i = Config.parseInt(s1, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "stick1", "stick2", "stick3", "stick4", "stick5", "stick6", "stick7", "stick8", "stick9", "stick10", "stick11", "stick12"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderBlaze renderblaze = new RenderBlaze(rendermanager); + renderblaze.mainModel = modelBase; + renderblaze.shadowSize = shadowSize; + return renderblaze; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBoat.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBoat.java new file mode 100644 index 0000000..e61f9d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBoat.java @@ -0,0 +1,60 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBoat; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderBoat; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterBoat extends ModelAdapter +{ + public ModelAdapterBoat() + { + super(EntityBoat.class, "boat", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelBoat(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelBoat)) + { + return null; + } + else + { + ModelBoat modelboat = (ModelBoat)model; + return modelPart.equals("bottom") ? modelboat.boatSides[0] : (modelPart.equals("back") ? modelboat.boatSides[1] : (modelPart.equals("front") ? modelboat.boatSides[2] : (modelPart.equals("right") ? modelboat.boatSides[3] : (modelPart.equals("left") ? modelboat.boatSides[4] : null)))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"bottom", "back", "front", "right", "left"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderBoat renderboat = new RenderBoat(rendermanager); + + if (!Reflector.RenderBoat_modelBoat.exists()) + { + Config.warn("Field not found: RenderBoat.modelBoat"); + return null; + } + else + { + Reflector.setFieldValue(renderboat, Reflector.RenderBoat_modelBoat, modelBase); + renderboat.shadowSize = shadowSize; + return renderboat; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBook.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBook.java new file mode 100644 index 0000000..dd75839 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterBook.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.optifine.reflect.Reflector; + +public class ModelAdapterBook extends ModelAdapter +{ + public ModelAdapterBook() + { + super(TileEntityEnchantmentTable.class, "book", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelBook(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelBook)) + { + return null; + } + else + { + ModelBook modelbook = (ModelBook)model; + return modelPart.equals("cover_right") ? modelbook.coverRight : (modelPart.equals("cover_left") ? modelbook.coverLeft : (modelPart.equals("pages_right") ? modelbook.pagesRight : (modelPart.equals("pages_left") ? modelbook.pagesLeft : (modelPart.equals("flipping_page_right") ? modelbook.flippingPageRight : (modelPart.equals("flipping_page_left") ? modelbook.flippingPageLeft : (modelPart.equals("book_spine") ? modelbook.bookSpine : null)))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"cover_right", "cover_left", "pages_right", "pages_left", "flipping_page_right", "flipping_page_left", "book_spine"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityEnchantmentTable.class); + + if (!(tileentityspecialrenderer instanceof TileEntityEnchantmentTableRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntityEnchantmentTableRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntityEnchantmentTableRenderer_modelBook.exists()) + { + Config.warn("Field not found: TileEntityEnchantmentTableRenderer.modelBook"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityEnchantmentTableRenderer_modelBook, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCaveSpider.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCaveSpider.java new file mode 100644 index 0000000..a61e043 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCaveSpider.java @@ -0,0 +1,24 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderCaveSpider; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityCaveSpider; + +public class ModelAdapterCaveSpider extends ModelAdapterSpider +{ + public ModelAdapterCaveSpider() + { + super(EntityCaveSpider.class, "cave_spider", 0.7F); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderCaveSpider rendercavespider = new RenderCaveSpider(rendermanager); + rendercavespider.mainModel = modelBase; + rendercavespider.shadowSize = shadowSize; + return rendercavespider; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChest.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChest.java new file mode 100644 index 0000000..f68cffc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChest.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityChest; +import net.optifine.reflect.Reflector; + +public class ModelAdapterChest extends ModelAdapter +{ + public ModelAdapterChest() + { + super(TileEntityChest.class, "chest", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelChest(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelChest)) + { + return null; + } + else + { + ModelChest modelchest = (ModelChest)model; + return modelPart.equals("lid") ? modelchest.chestLid : (modelPart.equals("base") ? modelchest.chestBelow : (modelPart.equals("knob") ? modelchest.chestKnob : null)); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"lid", "base", "knob"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityChest.class); + + if (!(tileentityspecialrenderer instanceof TileEntityChestRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntityChestRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntityChestRenderer_simpleChest.exists()) + { + Config.warn("Field not found: TileEntityChestRenderer.simpleChest"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityChestRenderer_simpleChest, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChestLarge.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChestLarge.java new file mode 100644 index 0000000..78fd314 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChestLarge.java @@ -0,0 +1,73 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.model.ModelLargeChest; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityChest; +import net.optifine.reflect.Reflector; + +public class ModelAdapterChestLarge extends ModelAdapter +{ + public ModelAdapterChestLarge() + { + super(TileEntityChest.class, "chest_large", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelLargeChest(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelChest)) + { + return null; + } + else + { + ModelChest modelchest = (ModelChest)model; + return modelPart.equals("lid") ? modelchest.chestLid : (modelPart.equals("base") ? modelchest.chestBelow : (modelPart.equals("knob") ? modelchest.chestKnob : null)); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"lid", "base", "knob"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityChest.class); + + if (!(tileentityspecialrenderer instanceof TileEntityChestRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntityChestRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntityChestRenderer_largeChest.exists()) + { + Config.warn("Field not found: TileEntityChestRenderer.largeChest"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityChestRenderer_largeChest, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChicken.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChicken.java new file mode 100644 index 0000000..2b6b968 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterChicken.java @@ -0,0 +1,47 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelChicken; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderChicken; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.passive.EntityChicken; + +public class ModelAdapterChicken extends ModelAdapter +{ + public ModelAdapterChicken() + { + super(EntityChicken.class, "chicken", 0.3F); + } + + public ModelBase makeModel() + { + return new ModelChicken(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelChicken)) + { + return null; + } + else + { + ModelChicken modelchicken = (ModelChicken)model; + return modelPart.equals("head") ? modelchicken.head : (modelPart.equals("body") ? modelchicken.body : (modelPart.equals("right_leg") ? modelchicken.rightLeg : (modelPart.equals("left_leg") ? modelchicken.leftLeg : (modelPart.equals("right_wing") ? modelchicken.rightWing : (modelPart.equals("left_wing") ? modelchicken.leftWing : (modelPart.equals("bill") ? modelchicken.bill : (modelPart.equals("chin") ? modelchicken.chin : null))))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "body", "right_leg", "left_leg", "right_wing", "left_wing", "bill", "chin"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderChicken renderchicken = new RenderChicken(rendermanager, modelBase, shadowSize); + return renderchicken; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCow.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCow.java new file mode 100644 index 0000000..f7855a3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCow.java @@ -0,0 +1,27 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelCow; +import net.minecraft.client.renderer.entity.RenderCow; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.passive.EntityCow; + +public class ModelAdapterCow extends ModelAdapterQuadruped +{ + public ModelAdapterCow() + { + super(EntityCow.class, "cow", 0.7F); + } + + public ModelBase makeModel() + { + return new ModelCow(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + return new RenderCow(rendermanager, modelBase, shadowSize); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCreeper.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCreeper.java new file mode 100644 index 0000000..49742e0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterCreeper.java @@ -0,0 +1,49 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelCreeper; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderCreeper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityCreeper; + +public class ModelAdapterCreeper extends ModelAdapter +{ + public ModelAdapterCreeper() + { + super(EntityCreeper.class, "creeper", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelCreeper(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelCreeper)) + { + return null; + } + else + { + ModelCreeper modelcreeper = (ModelCreeper)model; + return modelPart.equals("head") ? modelcreeper.head : (modelPart.equals("armor") ? modelcreeper.creeperArmor : (modelPart.equals("body") ? modelcreeper.body : (modelPart.equals("leg1") ? modelcreeper.leg1 : (modelPart.equals("leg2") ? modelcreeper.leg2 : (modelPart.equals("leg3") ? modelcreeper.leg3 : (modelPart.equals("leg4") ? modelcreeper.leg4 : null)))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "armor", "body", "leg1", "leg2", "leg3", "leg4"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderCreeper rendercreeper = new RenderCreeper(rendermanager); + rendercreeper.mainModel = modelBase; + rendercreeper.shadowSize = shadowSize; + return rendercreeper; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterDragon.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterDragon.java new file mode 100644 index 0000000..3b7fc2d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterDragon.java @@ -0,0 +1,50 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelDragon; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderDragon; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.boss.EntityDragon; +import net.optifine.reflect.Reflector; + +public class ModelAdapterDragon extends ModelAdapter +{ + public ModelAdapterDragon() + { + super(EntityDragon.class, "dragon", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelDragon(0.0F); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelDragon)) + { + return null; + } + else + { + ModelDragon modeldragon = (ModelDragon)model; + return modelPart.equals("head") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 0) : (modelPart.equals("spine") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 1) : (modelPart.equals("jaw") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 2) : (modelPart.equals("body") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 3) : (modelPart.equals("rear_leg") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 4) : (modelPart.equals("front_leg") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 5) : (modelPart.equals("rear_leg_tip") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 6) : (modelPart.equals("front_leg_tip") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 7) : (modelPart.equals("rear_foot") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 8) : (modelPart.equals("front_foot") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 9) : (modelPart.equals("wing") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 10) : (modelPart.equals("wing_tip") ? (ModelRenderer)Reflector.getFieldValue(modeldragon, Reflector.ModelDragon_ModelRenderers, 11) : null))))))))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "spine", "jaw", "body", "rear_leg", "front_leg", "rear_leg_tip", "front_leg_tip", "rear_foot", "front_foot", "wing", "wing_tip"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderDragon renderdragon = new RenderDragon(rendermanager); + renderdragon.mainModel = modelBase; + renderdragon.shadowSize = shadowSize; + return renderdragon; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderChest.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderChest.java new file mode 100644 index 0000000..a090a6b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderChest.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityEnderChestRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.optifine.reflect.Reflector; + +public class ModelAdapterEnderChest extends ModelAdapter +{ + public ModelAdapterEnderChest() + { + super(TileEntityEnderChest.class, "ender_chest", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelChest(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelChest)) + { + return null; + } + else + { + ModelChest modelchest = (ModelChest)model; + return modelPart.equals("lid") ? modelchest.chestLid : (modelPart.equals("base") ? modelchest.chestBelow : (modelPart.equals("knob") ? modelchest.chestKnob : null)); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"lid", "base", "knob"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntityEnderChest.class); + + if (!(tileentityspecialrenderer instanceof TileEntityEnderChestRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntityEnderChestRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntityEnderChestRenderer_modelChest.exists()) + { + Config.warn("Field not found: TileEntityEnderChestRenderer.modelChest"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntityEnderChestRenderer_modelChest, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderCrystal.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderCrystal.java new file mode 100644 index 0000000..313325f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderCrystal.java @@ -0,0 +1,76 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelEnderCrystal; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.RenderEnderCrystal; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterEnderCrystal extends ModelAdapter +{ + public ModelAdapterEnderCrystal() + { + this("end_crystal"); + } + + protected ModelAdapterEnderCrystal(String name) + { + super(EntityEnderCrystal.class, name, 0.5F); + } + + public ModelBase makeModel() + { + return new ModelEnderCrystal(0.0F, true); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelEnderCrystal)) + { + return null; + } + else + { + ModelEnderCrystal modelendercrystal = (ModelEnderCrystal)model; + return modelPart.equals("cube") ? (ModelRenderer)Reflector.getFieldValue(modelendercrystal, Reflector.ModelEnderCrystal_ModelRenderers, 0) : (modelPart.equals("glass") ? (ModelRenderer)Reflector.getFieldValue(modelendercrystal, Reflector.ModelEnderCrystal_ModelRenderers, 1) : (modelPart.equals("base") ? (ModelRenderer)Reflector.getFieldValue(modelendercrystal, Reflector.ModelEnderCrystal_ModelRenderers, 2) : null)); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"cube", "glass", "base"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + Render render = (Render)rendermanager.getEntityRenderMap().get(EntityEnderCrystal.class); + + if (!(render instanceof RenderEnderCrystal)) + { + Config.warn("Not an instance of RenderEnderCrystal: " + render); + return null; + } + else + { + RenderEnderCrystal renderendercrystal = (RenderEnderCrystal)render; + + if (!Reflector.RenderEnderCrystal_modelEnderCrystal.exists()) + { + Config.warn("Field not found: RenderEnderCrystal.modelEnderCrystal"); + return null; + } + else + { + Reflector.setFieldValue(renderendercrystal, Reflector.RenderEnderCrystal_modelEnderCrystal, modelBase); + renderendercrystal.shadowSize = shadowSize; + return renderendercrystal; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderman.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderman.java new file mode 100644 index 0000000..5212d34 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEnderman.java @@ -0,0 +1,30 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelEnderman; +import net.minecraft.client.renderer.entity.RenderEnderman; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityEnderman; + +public class ModelAdapterEnderman extends ModelAdapterBiped +{ + public ModelAdapterEnderman() + { + super(EntityEnderman.class, "enderman", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelEnderman(0.0F); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderEnderman renderenderman = new RenderEnderman(rendermanager); + renderenderman.mainModel = modelBase; + renderenderman.shadowSize = shadowSize; + return renderenderman; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEndermite.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEndermite.java new file mode 100644 index 0000000..3e0c624 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterEndermite.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelEnderMite; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderEndermite; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityEndermite; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterEndermite extends ModelAdapter +{ + public ModelAdapterEndermite() + { + super(EntityEndermite.class, "endermite", 0.3F); + } + + public ModelBase makeModel() + { + return new ModelEnderMite(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelEnderMite)) + { + return null; + } + else + { + ModelEnderMite modelendermite = (ModelEnderMite)model; + String s = "body"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelendermite, Reflector.ModelEnderMite_bodyParts)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s1 = modelPart.substring(s.length()); + int i = Config.parseInt(s1, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body1", "body2", "body3", "body4"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderEndermite renderendermite = new RenderEndermite(rendermanager); + renderendermite.mainModel = modelBase; + renderendermite.shadowSize = shadowSize; + return renderendermite; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterGhast.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterGhast.java new file mode 100644 index 0000000..fa208db --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterGhast.java @@ -0,0 +1,80 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelGhast; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderGhast; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterGhast extends ModelAdapter +{ + public ModelAdapterGhast() + { + super(EntityGhast.class, "ghast", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelGhast(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelGhast)) + { + return null; + } + else + { + ModelGhast modelghast = (ModelGhast)model; + + if (modelPart.equals("body")) + { + return (ModelRenderer)Reflector.getFieldValue(modelghast, Reflector.ModelGhast_body); + } + else + { + String s = "tentacle"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelghast, Reflector.ModelGhast_tentacles)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s1 = modelPart.substring(s.length()); + int i = Config.parseInt(s1, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body", "tentacle1", "tentacle2", "tentacle3", "tentacle4", "tentacle5", "tentacle6", "tentacle7", "tentacle8", "tentacle9"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderGhast renderghast = new RenderGhast(rendermanager); + renderghast.mainModel = modelBase; + renderghast.shadowSize = shadowSize; + return renderghast; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterGuardian.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterGuardian.java new file mode 100644 index 0000000..09dbffb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterGuardian.java @@ -0,0 +1,105 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelGuardian; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderGuardian; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterGuardian extends ModelAdapter +{ + public ModelAdapterGuardian() + { + super(EntityGuardian.class, "guardian", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelGuardian(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelGuardian)) + { + return null; + } + else + { + ModelGuardian modelguardian = (ModelGuardian)model; + + if (modelPart.equals("body")) + { + return (ModelRenderer)Reflector.getFieldValue(modelguardian, Reflector.ModelGuardian_body); + } + else if (modelPart.equals("eye")) + { + return (ModelRenderer)Reflector.getFieldValue(modelguardian, Reflector.ModelGuardian_eye); + } + else + { + String s = "spine"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer1 = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelguardian, Reflector.ModelGuardian_spines)); + + if (amodelrenderer1 == null) + { + return null; + } + else + { + String s3 = modelPart.substring(s.length()); + int j = Config.parseInt(s3, -1); + --j; + return j >= 0 && j < amodelrenderer1.length ? amodelrenderer1[j] : null; + } + } + else + { + String s1 = "tail"; + + if (modelPart.startsWith(s1)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelguardian, Reflector.ModelGuardian_tail)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s2 = modelPart.substring(s1.length()); + int i = Config.parseInt(s2, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body", "eye", "spine1", "spine2", "spine3", "spine4", "spine5", "spine6", "spine7", "spine8", "spine9", "spine10", "spine11", "spine12", "tail1", "tail2", "tail3"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderGuardian renderguardian = new RenderGuardian(rendermanager); + renderguardian.mainModel = modelBase; + renderguardian.shadowSize = shadowSize; + return renderguardian; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHeadHumanoid.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHeadHumanoid.java new file mode 100644 index 0000000..93f4e93 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHeadHumanoid.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelHumanoidHead; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntitySkull; +import net.optifine.reflect.Reflector; + +public class ModelAdapterHeadHumanoid extends ModelAdapter +{ + public ModelAdapterHeadHumanoid() + { + super(TileEntitySkull.class, "head_humanoid", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelHumanoidHead(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelHumanoidHead)) + { + return null; + } + else + { + ModelHumanoidHead modelhumanoidhead = (ModelHumanoidHead)model; + return modelPart.equals("head") ? modelhumanoidhead.skeletonHead : (modelPart.equals("head2") ? (!Reflector.ModelHumanoidHead_head.exists() ? null : (ModelRenderer)Reflector.getFieldValue(modelhumanoidhead, Reflector.ModelHumanoidHead_head)) : null); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntitySkull.class); + + if (!(tileentityspecialrenderer instanceof TileEntitySkullRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntitySkullRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntitySkullRenderer_humanoidHead.exists()) + { + Config.warn("Field not found: TileEntitySkullRenderer.humanoidHead"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntitySkullRenderer_humanoidHead, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHeadSkeleton.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHeadSkeleton.java new file mode 100644 index 0000000..20a9048 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHeadSkeleton.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntitySkull; +import net.optifine.reflect.Reflector; + +public class ModelAdapterHeadSkeleton extends ModelAdapter +{ + public ModelAdapterHeadSkeleton() + { + super(TileEntitySkull.class, "head_skeleton", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelSkeletonHead(0, 0, 64, 32); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSkeletonHead)) + { + return null; + } + else + { + ModelSkeletonHead modelskeletonhead = (ModelSkeletonHead)model; + return modelPart.equals("head") ? modelskeletonhead.skeletonHead : null; + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntitySkull.class); + + if (!(tileentityspecialrenderer instanceof TileEntitySkullRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntitySkullRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntitySkullRenderer_humanoidHead.exists()) + { + Config.warn("Field not found: TileEntitySkullRenderer.humanoidHead"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntitySkullRenderer_humanoidHead, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHorse.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHorse.java new file mode 100644 index 0000000..dfd1344 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterHorse.java @@ -0,0 +1,119 @@ +package net.optifine.entity.model; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelHorse; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderHorse; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.passive.EntityHorse; +import net.optifine.reflect.Reflector; + +public class ModelAdapterHorse extends ModelAdapter +{ + private static Map mapPartFields = null; + + public ModelAdapterHorse() + { + super(EntityHorse.class, "horse", 0.75F); + } + + protected ModelAdapterHorse(Class entityClass, String name, float shadowSize) + { + super(entityClass, name, shadowSize); + } + + public ModelBase makeModel() + { + return new ModelHorse(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelHorse)) + { + return null; + } + else + { + ModelHorse modelhorse = (ModelHorse)model; + Map map = getMapPartFields(); + + if (map.containsKey(modelPart)) + { + int i = ((Integer)map.get(modelPart)).intValue(); + return (ModelRenderer)Reflector.getFieldValue(modelhorse, Reflector.ModelHorse_ModelRenderers, i); + } + else + { + return null; + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "upper_mouth", "lower_mouth", "horse_left_ear", "horse_right_ear", "mule_left_ear", "mule_right_ear", "neck", "horse_face_ropes", "mane", "body", "tail_base", "tail_middle", "tail_tip", "back_left_leg", "back_left_shin", "back_left_hoof", "back_right_leg", "back_right_shin", "back_right_hoof", "front_left_leg", "front_left_shin", "front_left_hoof", "front_right_leg", "front_right_shin", "front_right_hoof", "mule_left_chest", "mule_right_chest", "horse_saddle_bottom", "horse_saddle_front", "horse_saddle_back", "horse_left_saddle_rope", "horse_left_saddle_metal", "horse_right_saddle_rope", "horse_right_saddle_metal", "horse_left_face_metal", "horse_right_face_metal", "horse_left_rein", "horse_right_rein"}; + } + + private static Map getMapPartFields() + { + if (mapPartFields != null) + { + return mapPartFields; + } + else + { + mapPartFields = new HashMap(); + mapPartFields.put("head", Integer.valueOf(0)); + mapPartFields.put("upper_mouth", Integer.valueOf(1)); + mapPartFields.put("lower_mouth", Integer.valueOf(2)); + mapPartFields.put("horse_left_ear", Integer.valueOf(3)); + mapPartFields.put("horse_right_ear", Integer.valueOf(4)); + mapPartFields.put("mule_left_ear", Integer.valueOf(5)); + mapPartFields.put("mule_right_ear", Integer.valueOf(6)); + mapPartFields.put("neck", Integer.valueOf(7)); + mapPartFields.put("horse_face_ropes", Integer.valueOf(8)); + mapPartFields.put("mane", Integer.valueOf(9)); + mapPartFields.put("body", Integer.valueOf(10)); + mapPartFields.put("tail_base", Integer.valueOf(11)); + mapPartFields.put("tail_middle", Integer.valueOf(12)); + mapPartFields.put("tail_tip", Integer.valueOf(13)); + mapPartFields.put("back_left_leg", Integer.valueOf(14)); + mapPartFields.put("back_left_shin", Integer.valueOf(15)); + mapPartFields.put("back_left_hoof", Integer.valueOf(16)); + mapPartFields.put("back_right_leg", Integer.valueOf(17)); + mapPartFields.put("back_right_shin", Integer.valueOf(18)); + mapPartFields.put("back_right_hoof", Integer.valueOf(19)); + mapPartFields.put("front_left_leg", Integer.valueOf(20)); + mapPartFields.put("front_left_shin", Integer.valueOf(21)); + mapPartFields.put("front_left_hoof", Integer.valueOf(22)); + mapPartFields.put("front_right_leg", Integer.valueOf(23)); + mapPartFields.put("front_right_shin", Integer.valueOf(24)); + mapPartFields.put("front_right_hoof", Integer.valueOf(25)); + mapPartFields.put("mule_left_chest", Integer.valueOf(26)); + mapPartFields.put("mule_right_chest", Integer.valueOf(27)); + mapPartFields.put("horse_saddle_bottom", Integer.valueOf(28)); + mapPartFields.put("horse_saddle_front", Integer.valueOf(29)); + mapPartFields.put("horse_saddle_back", Integer.valueOf(30)); + mapPartFields.put("horse_left_saddle_rope", Integer.valueOf(31)); + mapPartFields.put("horse_left_saddle_metal", Integer.valueOf(32)); + mapPartFields.put("horse_right_saddle_rope", Integer.valueOf(33)); + mapPartFields.put("horse_right_saddle_metal", Integer.valueOf(34)); + mapPartFields.put("horse_left_face_metal", Integer.valueOf(35)); + mapPartFields.put("horse_right_face_metal", Integer.valueOf(36)); + mapPartFields.put("horse_left_rein", Integer.valueOf(37)); + mapPartFields.put("horse_right_rein", Integer.valueOf(38)); + return mapPartFields; + } + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderHorse renderhorse = new RenderHorse(rendermanager, (ModelHorse)modelBase, shadowSize); + return renderhorse; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterIronGolem.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterIronGolem.java new file mode 100644 index 0000000..eb2a4ff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterIronGolem.java @@ -0,0 +1,49 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelIronGolem; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderIronGolem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityIronGolem; + +public class ModelAdapterIronGolem extends ModelAdapter +{ + public ModelAdapterIronGolem() + { + super(EntityIronGolem.class, "iron_golem", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelIronGolem(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelIronGolem)) + { + return null; + } + else + { + ModelIronGolem modelirongolem = (ModelIronGolem)model; + return modelPart.equals("head") ? modelirongolem.ironGolemHead : (modelPart.equals("body") ? modelirongolem.ironGolemBody : (modelPart.equals("left_arm") ? modelirongolem.ironGolemLeftArm : (modelPart.equals("right_arm") ? modelirongolem.ironGolemRightArm : (modelPart.equals("left_leg") ? modelirongolem.ironGolemLeftLeg : (modelPart.equals("right_leg") ? modelirongolem.ironGolemRightLeg : null))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "body", "right_arm", "left_arm", "left_leg", "right_leg"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderIronGolem renderirongolem = new RenderIronGolem(rendermanager); + renderirongolem.mainModel = modelBase; + renderirongolem.shadowSize = shadowSize; + return renderirongolem; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterLeadKnot.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterLeadKnot.java new file mode 100644 index 0000000..d75d9b9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterLeadKnot.java @@ -0,0 +1,60 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelLeashKnot; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderLeashKnot; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterLeadKnot extends ModelAdapter +{ + public ModelAdapterLeadKnot() + { + super(EntityLeashKnot.class, "lead_knot", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelLeashKnot(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelLeashKnot)) + { + return null; + } + else + { + ModelLeashKnot modelleashknot = (ModelLeashKnot)model; + return modelPart.equals("knot") ? modelleashknot.field_110723_a : null; + } + } + + public String[] getModelRendererNames() + { + return new String[] {"knot"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderLeashKnot renderleashknot = new RenderLeashKnot(rendermanager); + + if (!Reflector.RenderLeashKnot_leashKnotModel.exists()) + { + Config.warn("Field not found: RenderLeashKnot.leashKnotModel"); + return null; + } + else + { + Reflector.setFieldValue(renderleashknot, Reflector.RenderLeashKnot_leashKnotModel, modelBase); + renderleashknot.shadowSize = shadowSize; + return renderleashknot; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMagmaCube.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMagmaCube.java new file mode 100644 index 0000000..4f92d35 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMagmaCube.java @@ -0,0 +1,80 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelMagmaCube; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderMagmaCube; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterMagmaCube extends ModelAdapter +{ + public ModelAdapterMagmaCube() + { + super(EntityMagmaCube.class, "magma_cube", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelMagmaCube(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelMagmaCube)) + { + return null; + } + else + { + ModelMagmaCube modelmagmacube = (ModelMagmaCube)model; + + if (modelPart.equals("core")) + { + return (ModelRenderer)Reflector.getFieldValue(modelmagmacube, Reflector.ModelMagmaCube_core); + } + else + { + String s = "segment"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelmagmacube, Reflector.ModelMagmaCube_segments)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s1 = modelPart.substring(s.length()); + int i = Config.parseInt(s1, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"core", "segment1", "segment2", "segment3", "segment4", "segment5", "segment6", "segment7", "segment8"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderMagmaCube rendermagmacube = new RenderMagmaCube(rendermanager); + rendermagmacube.mainModel = modelBase; + rendermagmacube.shadowSize = shadowSize; + return rendermagmacube; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecart.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecart.java new file mode 100644 index 0000000..3e02445 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecart.java @@ -0,0 +1,65 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelMinecart; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderMinecart; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterMinecart extends ModelAdapter +{ + public ModelAdapterMinecart() + { + super(EntityMinecart.class, "minecart", 0.5F); + } + + protected ModelAdapterMinecart(Class entityClass, String name, float shadow) + { + super(entityClass, name, shadow); + } + + public ModelBase makeModel() + { + return new ModelMinecart(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelMinecart)) + { + return null; + } + else + { + ModelMinecart modelminecart = (ModelMinecart)model; + return modelPart.equals("bottom") ? modelminecart.sideModels[0] : (modelPart.equals("back") ? modelminecart.sideModels[1] : (modelPart.equals("front") ? modelminecart.sideModels[2] : (modelPart.equals("right") ? modelminecart.sideModels[3] : (modelPart.equals("left") ? modelminecart.sideModels[4] : (modelPart.equals("dirt") ? modelminecart.sideModels[5] : null))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"bottom", "back", "front", "right", "left", "dirt"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderMinecart renderminecart = new RenderMinecart(rendermanager); + + if (!Reflector.RenderMinecart_modelMinecart.exists()) + { + Config.warn("Field not found: RenderMinecart.modelMinecart"); + return null; + } + else + { + Reflector.setFieldValue(renderminecart, Reflector.RenderMinecart_modelMinecart, modelBase); + renderminecart.shadowSize = shadowSize; + return renderminecart; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecartMobSpawner.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecartMobSpawner.java new file mode 100644 index 0000000..168aeff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecartMobSpawner.java @@ -0,0 +1,35 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderMinecartMobSpawner; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterMinecartMobSpawner extends ModelAdapterMinecart +{ + public ModelAdapterMinecartMobSpawner() + { + super(EntityMinecartMobSpawner.class, "spawner_minecart", 0.5F); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderMinecartMobSpawner renderminecartmobspawner = new RenderMinecartMobSpawner(rendermanager); + + if (!Reflector.RenderMinecart_modelMinecart.exists()) + { + Config.warn("Field not found: RenderMinecart.modelMinecart"); + return null; + } + else + { + Reflector.setFieldValue(renderminecartmobspawner, Reflector.RenderMinecart_modelMinecart, modelBase); + renderminecartmobspawner.shadowSize = shadowSize; + return renderminecartmobspawner; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecartTnt.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecartTnt.java new file mode 100644 index 0000000..6063b03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMinecartTnt.java @@ -0,0 +1,35 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderTntMinecart; +import net.minecraft.entity.item.EntityMinecartTNT; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterMinecartTnt extends ModelAdapterMinecart +{ + public ModelAdapterMinecartTnt() + { + super(EntityMinecartTNT.class, "tnt_minecart", 0.5F); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderTntMinecart rendertntminecart = new RenderTntMinecart(rendermanager); + + if (!Reflector.RenderMinecart_modelMinecart.exists()) + { + Config.warn("Field not found: RenderMinecart.modelMinecart"); + return null; + } + else + { + Reflector.setFieldValue(rendertntminecart, Reflector.RenderMinecart_modelMinecart, modelBase); + rendertntminecart.shadowSize = shadowSize; + return rendertntminecart; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMooshroom.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMooshroom.java new file mode 100644 index 0000000..c10e105 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterMooshroom.java @@ -0,0 +1,28 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelCow; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderMooshroom; +import net.minecraft.entity.passive.EntityMooshroom; + +public class ModelAdapterMooshroom extends ModelAdapterQuadruped +{ + public ModelAdapterMooshroom() + { + super(EntityMooshroom.class, "mooshroom", 0.7F); + } + + public ModelBase makeModel() + { + return new ModelCow(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderMooshroom rendermooshroom = new RenderMooshroom(rendermanager, modelBase, shadowSize); + return rendermooshroom; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterOcelot.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterOcelot.java new file mode 100644 index 0000000..b34d31c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterOcelot.java @@ -0,0 +1,83 @@ +package net.optifine.entity.model; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelOcelot; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderOcelot; +import net.minecraft.entity.passive.EntityOcelot; +import net.optifine.reflect.Reflector; + +public class ModelAdapterOcelot extends ModelAdapter +{ + private static Map mapPartFields = null; + + public ModelAdapterOcelot() + { + super(EntityOcelot.class, "ocelot", 0.4F); + } + + public ModelBase makeModel() + { + return new ModelOcelot(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelOcelot)) + { + return null; + } + else + { + ModelOcelot modelocelot = (ModelOcelot)model; + Map map = getMapPartFields(); + + if (map.containsKey(modelPart)) + { + int i = ((Integer)map.get(modelPart)).intValue(); + return (ModelRenderer)Reflector.getFieldValue(modelocelot, Reflector.ModelOcelot_ModelRenderers, i); + } + else + { + return null; + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"back_left_leg", "back_right_leg", "front_left_leg", "front_right_leg", "tail", "tail2", "head", "body"}; + } + + private static Map getMapPartFields() + { + if (mapPartFields != null) + { + return mapPartFields; + } + else + { + mapPartFields = new HashMap(); + mapPartFields.put("back_left_leg", Integer.valueOf(0)); + mapPartFields.put("back_right_leg", Integer.valueOf(1)); + mapPartFields.put("front_left_leg", Integer.valueOf(2)); + mapPartFields.put("front_right_leg", Integer.valueOf(3)); + mapPartFields.put("tail", Integer.valueOf(4)); + mapPartFields.put("tail2", Integer.valueOf(5)); + mapPartFields.put("head", Integer.valueOf(6)); + mapPartFields.put("body", Integer.valueOf(7)); + return mapPartFields; + } + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderOcelot renderocelot = new RenderOcelot(rendermanager, modelBase, shadowSize); + return renderocelot; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterPig.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterPig.java new file mode 100644 index 0000000..f9574f0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterPig.java @@ -0,0 +1,27 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelPig; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPig; +import net.minecraft.entity.passive.EntityPig; + +public class ModelAdapterPig extends ModelAdapterQuadruped +{ + public ModelAdapterPig() + { + super(EntityPig.class, "pig", 0.7F); + } + + public ModelBase makeModel() + { + return new ModelPig(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + return new RenderPig(rendermanager, modelBase, shadowSize); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterPigZombie.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterPigZombie.java new file mode 100644 index 0000000..5a5608c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterPigZombie.java @@ -0,0 +1,33 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelZombie; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPigZombie; +import net.minecraft.entity.monster.EntityPigZombie; + +public class ModelAdapterPigZombie extends ModelAdapterBiped +{ + public ModelAdapterPigZombie() + { + super(EntityPigZombie.class, "zombie_pigman", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelZombie(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderPigZombie renderpigzombie = new RenderPigZombie(rendermanager); + Render.setModelBipedMain(renderpigzombie, (ModelBiped)modelBase); + renderpigzombie.mainModel = modelBase; + renderpigzombie.shadowSize = shadowSize; + return renderpigzombie; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterQuadruped.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterQuadruped.java new file mode 100644 index 0000000..04ba88d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterQuadruped.java @@ -0,0 +1,31 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelQuadruped; +import net.minecraft.client.model.ModelRenderer; + +public abstract class ModelAdapterQuadruped extends ModelAdapter +{ + public ModelAdapterQuadruped(Class entityClass, String name, float shadowSize) + { + super(entityClass, name, shadowSize); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelQuadruped)) + { + return null; + } + else + { + ModelQuadruped modelquadruped = (ModelQuadruped)model; + return modelPart.equals("head") ? modelquadruped.head : (modelPart.equals("body") ? modelquadruped.body : (modelPart.equals("leg1") ? modelquadruped.leg1 : (modelPart.equals("leg2") ? modelquadruped.leg2 : (modelPart.equals("leg3") ? modelquadruped.leg3 : (modelPart.equals("leg4") ? modelquadruped.leg4 : null))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "body", "leg1", "leg2", "leg3", "leg4"}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterRabbit.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterRabbit.java new file mode 100644 index 0000000..fc6bb72 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterRabbit.java @@ -0,0 +1,87 @@ +package net.optifine.entity.model; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRabbit; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderRabbit; +import net.minecraft.entity.passive.EntityRabbit; +import net.optifine.reflect.Reflector; + +public class ModelAdapterRabbit extends ModelAdapter +{ + private static Map mapPartFields = null; + + public ModelAdapterRabbit() + { + super(EntityRabbit.class, "rabbit", 0.3F); + } + + public ModelBase makeModel() + { + return new ModelRabbit(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelRabbit)) + { + return null; + } + else + { + ModelRabbit modelrabbit = (ModelRabbit)model; + Map map = getMapPartFields(); + + if (map.containsKey(modelPart)) + { + int i = ((Integer)map.get(modelPart)).intValue(); + return (ModelRenderer)Reflector.getFieldValue(modelrabbit, Reflector.ModelRabbit_renderers, i); + } + else + { + return null; + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"left_foot", "right_foot", "left_thigh", "right_thigh", "body", "left_arm", "right_arm", "head", "right_ear", "left_ear", "tail", "nose"}; + } + + private static Map getMapPartFields() + { + if (mapPartFields != null) + { + return mapPartFields; + } + else + { + mapPartFields = new HashMap(); + mapPartFields.put("left_foot", Integer.valueOf(0)); + mapPartFields.put("right_foot", Integer.valueOf(1)); + mapPartFields.put("left_thigh", Integer.valueOf(2)); + mapPartFields.put("right_thigh", Integer.valueOf(3)); + mapPartFields.put("body", Integer.valueOf(4)); + mapPartFields.put("left_arm", Integer.valueOf(5)); + mapPartFields.put("right_arm", Integer.valueOf(6)); + mapPartFields.put("head", Integer.valueOf(7)); + mapPartFields.put("right_ear", Integer.valueOf(8)); + mapPartFields.put("left_ear", Integer.valueOf(9)); + mapPartFields.put("tail", Integer.valueOf(10)); + mapPartFields.put("nose", Integer.valueOf(11)); + return mapPartFields; + } + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderRabbit renderrabbit = new RenderRabbit(rendermanager, modelBase, shadowSize); + return renderrabbit; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSheep.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSheep.java new file mode 100644 index 0000000..94d47f6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSheep.java @@ -0,0 +1,27 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelSheep2; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSheep; +import net.minecraft.entity.passive.EntitySheep; + +public class ModelAdapterSheep extends ModelAdapterQuadruped +{ + public ModelAdapterSheep() + { + super(EntitySheep.class, "sheep", 0.7F); + } + + public ModelBase makeModel() + { + return new ModelSheep2(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + return new RenderSheep(rendermanager, modelBase, shadowSize); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSheepWool.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSheepWool.java new file mode 100644 index 0000000..69e2b8a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSheepWool.java @@ -0,0 +1,66 @@ +package net.optifine.entity.model; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelSheep1; +import net.minecraft.client.model.ModelSheep2; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSheep; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.client.renderer.entity.layers.LayerSheepWool; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.src.Config; + +public class ModelAdapterSheepWool extends ModelAdapterQuadruped +{ + public ModelAdapterSheepWool() + { + super(EntitySheep.class, "sheep_wool", 0.7F); + } + + public ModelBase makeModel() + { + return new ModelSheep1(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + Render render = (Render)rendermanager.getEntityRenderMap().get(EntitySheep.class); + + if (!(render instanceof RenderSheep)) + { + Config.warn("Not a RenderSheep: " + render); + return null; + } + else + { + if (render.getEntityClass() == null) + { + render = new RenderSheep(rendermanager, new ModelSheep2(), 0.7F); + } + + RenderSheep rendersheep = (RenderSheep)render; + List> list = rendersheep.getLayerRenderers(); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + LayerRenderer layerrenderer = (LayerRenderer)iterator.next(); + + if (layerrenderer instanceof LayerSheepWool) + { + iterator.remove(); + } + } + + LayerSheepWool layersheepwool = new LayerSheepWool(rendersheep); + layersheepwool.sheepModel = (ModelSheep1)modelBase; + rendersheep.addLayer(layersheepwool); + return rendersheep; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSign.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSign.java new file mode 100644 index 0000000..3f3a71f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSign.java @@ -0,0 +1,72 @@ +package net.optifine.entity.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSign; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySignRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntitySign; +import net.optifine.reflect.Reflector; + +public class ModelAdapterSign extends ModelAdapter +{ + public ModelAdapterSign() + { + super(TileEntitySign.class, "sign", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelSign(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSign)) + { + return null; + } + else + { + ModelSign modelsign = (ModelSign)model; + return modelPart.equals("board") ? modelsign.signBoard : (modelPart.equals("stick") ? modelsign.signStick : null); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"board", "stick"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + TileEntityRendererDispatcher tileentityrendererdispatcher = TileEntityRendererDispatcher.instance; + TileEntitySpecialRenderer tileentityspecialrenderer = tileentityrendererdispatcher.getSpecialRendererByClass(TileEntitySign.class); + + if (!(tileentityspecialrenderer instanceof TileEntitySignRenderer)) + { + return null; + } + else + { + if (tileentityspecialrenderer.getEntityClass() == null) + { + tileentityspecialrenderer = new TileEntitySignRenderer(); + tileentityspecialrenderer.setRendererDispatcher(tileentityrendererdispatcher); + } + + if (!Reflector.TileEntitySignRenderer_model.exists()) + { + Config.warn("Field not found: TileEntitySignRenderer.model"); + return null; + } + else + { + Reflector.setFieldValue(tileentityspecialrenderer, Reflector.TileEntitySignRenderer_model, modelBase); + return tileentityspecialrenderer; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSilverfish.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSilverfish.java new file mode 100644 index 0000000..dfe6942 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSilverfish.java @@ -0,0 +1,93 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSilverfish; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSilverfish; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterSilverfish extends ModelAdapter +{ + public ModelAdapterSilverfish() + { + super(EntitySilverfish.class, "silverfish", 0.3F); + } + + public ModelBase makeModel() + { + return new ModelSilverfish(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSilverfish)) + { + return null; + } + else + { + ModelSilverfish modelsilverfish = (ModelSilverfish)model; + String s = "body"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer1 = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelsilverfish, Reflector.ModelSilverfish_bodyParts)); + + if (amodelrenderer1 == null) + { + return null; + } + else + { + String s3 = modelPart.substring(s.length()); + int j = Config.parseInt(s3, -1); + --j; + return j >= 0 && j < amodelrenderer1.length ? amodelrenderer1[j] : null; + } + } + else + { + String s1 = "wing"; + + if (modelPart.startsWith(s1)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelsilverfish, Reflector.ModelSilverfish_wingParts)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s2 = modelPart.substring(s1.length()); + int i = Config.parseInt(s2, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body1", "body2", "body3", "body4", "body5", "body6", "body7", "wing1", "wing2", "wing3"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderSilverfish rendersilverfish = new RenderSilverfish(rendermanager); + rendersilverfish.mainModel = modelBase; + rendersilverfish.shadowSize = shadowSize; + return rendersilverfish; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSkeleton.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSkeleton.java new file mode 100644 index 0000000..c6149d4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSkeleton.java @@ -0,0 +1,33 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelSkeleton; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSkeleton; +import net.minecraft.entity.monster.EntitySkeleton; + +public class ModelAdapterSkeleton extends ModelAdapterBiped +{ + public ModelAdapterSkeleton() + { + super(EntitySkeleton.class, "skeleton", 0.7F); + } + + public ModelBase makeModel() + { + return new ModelSkeleton(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderSkeleton renderskeleton = new RenderSkeleton(rendermanager); + Render.setModelBipedMain(renderskeleton, (ModelBiped)modelBase); + renderskeleton.mainModel = modelBase; + renderskeleton.shadowSize = shadowSize; + return renderskeleton; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSlime.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSlime.java new file mode 100644 index 0000000..56f1aea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSlime.java @@ -0,0 +1,48 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSlime; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSlime; +import net.minecraft.entity.monster.EntitySlime; +import net.optifine.reflect.Reflector; + +public class ModelAdapterSlime extends ModelAdapter +{ + public ModelAdapterSlime() + { + super(EntitySlime.class, "slime", 0.25F); + } + + public ModelBase makeModel() + { + return new ModelSlime(16); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSlime)) + { + return null; + } + else + { + ModelSlime modelslime = (ModelSlime)model; + return modelPart.equals("body") ? (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 0) : (modelPart.equals("left_eye") ? (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 1) : (modelPart.equals("right_eye") ? (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 2) : (modelPart.equals("mouth") ? (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 3) : null))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body", "left_eye", "right_eye", "mouth"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderSlime renderslime = new RenderSlime(rendermanager, modelBase, shadowSize); + return renderslime; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSnowman.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSnowman.java new file mode 100644 index 0000000..2e9e3b3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSnowman.java @@ -0,0 +1,49 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSnowMan; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSnowMan; +import net.minecraft.entity.monster.EntitySnowman; + +public class ModelAdapterSnowman extends ModelAdapter +{ + public ModelAdapterSnowman() + { + super(EntitySnowman.class, "snow_golem", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelSnowMan(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSnowMan)) + { + return null; + } + else + { + ModelSnowMan modelsnowman = (ModelSnowMan)model; + return modelPart.equals("body") ? modelsnowman.body : (modelPart.equals("body_bottom") ? modelsnowman.bottomBody : (modelPart.equals("head") ? modelsnowman.head : (modelPart.equals("left_hand") ? modelsnowman.leftHand : (modelPart.equals("right_hand") ? modelsnowman.rightHand : null)))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body", "body_bottom", "head", "right_hand", "left_hand"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderSnowMan rendersnowman = new RenderSnowMan(rendermanager); + rendersnowman.mainModel = modelBase; + rendersnowman.shadowSize = shadowSize; + return rendersnowman; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSpider.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSpider.java new file mode 100644 index 0000000..f34a7b1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSpider.java @@ -0,0 +1,54 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSpider; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSpider; +import net.minecraft.entity.monster.EntitySpider; + +public class ModelAdapterSpider extends ModelAdapter +{ + public ModelAdapterSpider() + { + super(EntitySpider.class, "spider", 1.0F); + } + + protected ModelAdapterSpider(Class entityClass, String name, float shadowSize) + { + super(entityClass, name, shadowSize); + } + + public ModelBase makeModel() + { + return new ModelSpider(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSpider)) + { + return null; + } + else + { + ModelSpider modelspider = (ModelSpider)model; + return modelPart.equals("head") ? modelspider.spiderHead : (modelPart.equals("neck") ? modelspider.spiderNeck : (modelPart.equals("body") ? modelspider.spiderBody : (modelPart.equals("leg1") ? modelspider.spiderLeg1 : (modelPart.equals("leg2") ? modelspider.spiderLeg2 : (modelPart.equals("leg3") ? modelspider.spiderLeg3 : (modelPart.equals("leg4") ? modelspider.spiderLeg4 : (modelPart.equals("leg5") ? modelspider.spiderLeg5 : (modelPart.equals("leg6") ? modelspider.spiderLeg6 : (modelPart.equals("leg7") ? modelspider.spiderLeg7 : (modelPart.equals("leg8") ? modelspider.spiderLeg8 : null)))))))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "neck", "body", "leg1", "leg2", "leg3", "leg4", "leg5", "leg6", "leg7", "leg8"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderSpider renderspider = new RenderSpider(rendermanager); + renderspider.mainModel = modelBase; + renderspider.shadowSize = shadowSize; + return renderspider; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSquid.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSquid.java new file mode 100644 index 0000000..f4bcab5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterSquid.java @@ -0,0 +1,78 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSquid; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderSquid; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterSquid extends ModelAdapter +{ + public ModelAdapterSquid() + { + super(EntitySquid.class, "squid", 0.7F); + } + + public ModelBase makeModel() + { + return new ModelSquid(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSquid)) + { + return null; + } + else + { + ModelSquid modelsquid = (ModelSquid)model; + + if (modelPart.equals("body")) + { + return (ModelRenderer)Reflector.getFieldValue(modelsquid, Reflector.ModelSquid_body); + } + else + { + String s = "tentacle"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelsquid, Reflector.ModelSquid_tentacles)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s1 = modelPart.substring(s.length()); + int i = Config.parseInt(s1, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body", "tentacle1", "tentacle2", "tentacle3", "tentacle4", "tentacle5", "tentacle6", "tentacle7", "tentacle8"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderSquid rendersquid = new RenderSquid(rendermanager, modelBase, shadowSize); + return rendersquid; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterVillager.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterVillager.java new file mode 100644 index 0000000..c653c03 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterVillager.java @@ -0,0 +1,49 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelVillager; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderVillager; +import net.minecraft.entity.passive.EntityVillager; + +public class ModelAdapterVillager extends ModelAdapter +{ + public ModelAdapterVillager() + { + super(EntityVillager.class, "villager", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelVillager(0.0F); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelVillager)) + { + return null; + } + else + { + ModelVillager modelvillager = (ModelVillager)model; + return modelPart.equals("head") ? modelvillager.villagerHead : (modelPart.equals("body") ? modelvillager.villagerBody : (modelPart.equals("arms") ? modelvillager.villagerArms : (modelPart.equals("left_leg") ? modelvillager.leftVillagerLeg : (modelPart.equals("right_leg") ? modelvillager.rightVillagerLeg : (modelPart.equals("nose") ? modelvillager.villagerNose : null))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "body", "arms", "right_leg", "left_leg", "nose"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderVillager rendervillager = new RenderVillager(rendermanager); + rendervillager.mainModel = modelBase; + rendervillager.shadowSize = shadowSize; + return rendervillager; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWitch.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWitch.java new file mode 100644 index 0000000..1d4992c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWitch.java @@ -0,0 +1,50 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelWitch; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderWitch; +import net.minecraft.entity.monster.EntityWitch; +import net.optifine.reflect.Reflector; + +public class ModelAdapterWitch extends ModelAdapter +{ + public ModelAdapterWitch() + { + super(EntityWitch.class, "witch", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelWitch(0.0F); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelWitch)) + { + return null; + } + else + { + ModelWitch modelwitch = (ModelWitch)model; + return modelPart.equals("mole") ? (ModelRenderer)Reflector.getFieldValue(modelwitch, Reflector.ModelWitch_mole) : (modelPart.equals("hat") ? (ModelRenderer)Reflector.getFieldValue(modelwitch, Reflector.ModelWitch_hat) : (modelPart.equals("head") ? modelwitch.villagerHead : (modelPart.equals("body") ? modelwitch.villagerBody : (modelPart.equals("arms") ? modelwitch.villagerArms : (modelPart.equals("left_leg") ? modelwitch.leftVillagerLeg : (modelPart.equals("right_leg") ? modelwitch.rightVillagerLeg : (modelPart.equals("nose") ? modelwitch.villagerNose : null))))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"mole", "head", "body", "arms", "right_leg", "left_leg", "nose"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderWitch renderwitch = new RenderWitch(rendermanager); + renderwitch.mainModel = modelBase; + renderwitch.shadowSize = shadowSize; + return renderwitch; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWither.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWither.java new file mode 100644 index 0000000..64f8f15 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWither.java @@ -0,0 +1,93 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelWither; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderWither; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterWither extends ModelAdapter +{ + public ModelAdapterWither() + { + super(EntityWither.class, "wither", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelWither(0.0F); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelWither)) + { + return null; + } + else + { + ModelWither modelwither = (ModelWither)model; + String s = "body"; + + if (modelPart.startsWith(s)) + { + ModelRenderer[] amodelrenderer1 = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelwither, Reflector.ModelWither_bodyParts)); + + if (amodelrenderer1 == null) + { + return null; + } + else + { + String s3 = modelPart.substring(s.length()); + int j = Config.parseInt(s3, -1); + --j; + return j >= 0 && j < amodelrenderer1.length ? amodelrenderer1[j] : null; + } + } + else + { + String s1 = "head"; + + if (modelPart.startsWith(s1)) + { + ModelRenderer[] amodelrenderer = (ModelRenderer[])((ModelRenderer[])Reflector.getFieldValue(modelwither, Reflector.ModelWither_heads)); + + if (amodelrenderer == null) + { + return null; + } + else + { + String s2 = modelPart.substring(s1.length()); + int i = Config.parseInt(s2, -1); + --i; + return i >= 0 && i < amodelrenderer.length ? amodelrenderer[i] : null; + } + } + else + { + return null; + } + } + } + } + + public String[] getModelRendererNames() + { + return new String[] {"body1", "body2", "body3", "head1", "head2", "head3"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderWither renderwither = new RenderWither(rendermanager); + renderwither.mainModel = modelBase; + renderwither.shadowSize = shadowSize; + return renderwither; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWitherSkull.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWitherSkull.java new file mode 100644 index 0000000..753cd79 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWitherSkull.java @@ -0,0 +1,60 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.RenderWitherSkull; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.src.Config; +import net.optifine.reflect.Reflector; + +public class ModelAdapterWitherSkull extends ModelAdapter +{ + public ModelAdapterWitherSkull() + { + super(EntityWitherSkull.class, "wither_skull", 0.0F); + } + + public ModelBase makeModel() + { + return new ModelSkeletonHead(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelSkeletonHead)) + { + return null; + } + else + { + ModelSkeletonHead modelskeletonhead = (ModelSkeletonHead)model; + return modelPart.equals("head") ? modelskeletonhead.skeletonHead : null; + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderWitherSkull renderwitherskull = new RenderWitherSkull(rendermanager); + + if (!Reflector.RenderWitherSkull_model.exists()) + { + Config.warn("Field not found: RenderWitherSkull_model"); + return null; + } + else + { + Reflector.setFieldValue(renderwitherskull, Reflector.RenderWitherSkull_model, modelBase); + renderwitherskull.shadowSize = shadowSize; + return renderwitherskull; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWolf.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWolf.java new file mode 100644 index 0000000..ccd4da6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterWolf.java @@ -0,0 +1,48 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelWolf; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderWolf; +import net.minecraft.entity.passive.EntityWolf; +import net.optifine.reflect.Reflector; + +public class ModelAdapterWolf extends ModelAdapter +{ + public ModelAdapterWolf() + { + super(EntityWolf.class, "wolf", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelWolf(); + } + + public ModelRenderer getModelRenderer(ModelBase model, String modelPart) + { + if (!(model instanceof ModelWolf)) + { + return null; + } + else + { + ModelWolf modelwolf = (ModelWolf)model; + return modelPart.equals("head") ? modelwolf.wolfHeadMain : (modelPart.equals("body") ? modelwolf.wolfBody : (modelPart.equals("leg1") ? modelwolf.wolfLeg1 : (modelPart.equals("leg2") ? modelwolf.wolfLeg2 : (modelPart.equals("leg3") ? modelwolf.wolfLeg3 : (modelPart.equals("leg4") ? modelwolf.wolfLeg4 : (modelPart.equals("tail") ? (ModelRenderer)Reflector.getFieldValue(modelwolf, Reflector.ModelWolf_tail) : (modelPart.equals("mane") ? (ModelRenderer)Reflector.getFieldValue(modelwolf, Reflector.ModelWolf_mane) : null))))))); + } + } + + public String[] getModelRendererNames() + { + return new String[] {"head", "body", "leg1", "leg2", "leg3", "leg4", "tail", "mane"}; + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderWolf renderwolf = new RenderWolf(rendermanager, modelBase, shadowSize); + return renderwolf; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterZombie.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterZombie.java new file mode 100644 index 0000000..55ad842 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/ModelAdapterZombie.java @@ -0,0 +1,33 @@ +package net.optifine.entity.model; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelZombie; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderZombie; +import net.minecraft.entity.monster.EntityZombie; + +public class ModelAdapterZombie extends ModelAdapterBiped +{ + public ModelAdapterZombie() + { + super(EntityZombie.class, "zombie", 0.5F); + } + + public ModelBase makeModel() + { + return new ModelZombie(); + } + + public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) + { + RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); + RenderZombie renderzombie = new RenderZombie(rendermanager); + Render.setModelBipedMain(renderzombie, (ModelBiped)modelBase); + renderzombie.mainModel = modelBase; + renderzombie.shadowSize = shadowSize; + return renderzombie; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/IModelResolver.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/IModelResolver.java new file mode 100644 index 0000000..bac7c66 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/IModelResolver.java @@ -0,0 +1,11 @@ +package net.optifine.entity.model.anim; + +import net.minecraft.client.model.ModelRenderer; +import net.optifine.expr.IExpressionResolver; + +public interface IModelResolver extends IExpressionResolver +{ + ModelRenderer getModelRenderer(String var1); + + ModelVariableFloat getModelVariable(String var1); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/IRenderResolver.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/IRenderResolver.java new file mode 100644 index 0000000..f716f53 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/IRenderResolver.java @@ -0,0 +1,8 @@ +package net.optifine.entity.model.anim; + +import net.optifine.expr.IExpression; + +public interface IRenderResolver +{ + IExpression getParameter(String var1); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelResolver.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelResolver.java new file mode 100644 index 0000000..765ba1c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelResolver.java @@ -0,0 +1,154 @@ +package net.optifine.entity.model.anim; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.optifine.entity.model.CustomModelRenderer; +import net.optifine.entity.model.ModelAdapter; +import net.optifine.expr.IExpression; + +public class ModelResolver implements IModelResolver +{ + private ModelAdapter modelAdapter; + private ModelBase model; + private CustomModelRenderer[] customModelRenderers; + private ModelRenderer thisModelRenderer; + private ModelRenderer partModelRenderer; + private IRenderResolver renderResolver; + + public ModelResolver(ModelAdapter modelAdapter, ModelBase model, CustomModelRenderer[] customModelRenderers) + { + this.modelAdapter = modelAdapter; + this.model = model; + this.customModelRenderers = customModelRenderers; + Class oclass = modelAdapter.getEntityClass(); + + if (TileEntity.class.isAssignableFrom(oclass)) + { + this.renderResolver = new RenderResolverTileEntity(); + } + else + { + this.renderResolver = new RenderResolverEntity(); + } + } + + public IExpression getExpression(String name) + { + IExpression iexpression = this.getModelVariable(name); + + if (iexpression != null) + { + return iexpression; + } + else + { + IExpression iexpression1 = this.renderResolver.getParameter(name); + return iexpression1 != null ? iexpression1 : null; + } + } + + public ModelRenderer getModelRenderer(String name) + { + if (name == null) + { + return null; + } + else if (name.indexOf(":") >= 0) + { + String[] astring = Config.tokenize(name, ":"); + ModelRenderer modelrenderer3 = this.getModelRenderer(astring[0]); + + for (int j = 1; j < astring.length; ++j) + { + String s = astring[j]; + ModelRenderer modelrenderer4 = modelrenderer3.getChildDeep(s); + + if (modelrenderer4 == null) + { + return null; + } + + modelrenderer3 = modelrenderer4; + } + + return modelrenderer3; + } + else if (this.thisModelRenderer != null && name.equals("this")) + { + return this.thisModelRenderer; + } + else if (this.partModelRenderer != null && name.equals("part")) + { + return this.partModelRenderer; + } + else + { + ModelRenderer modelrenderer = this.modelAdapter.getModelRenderer(this.model, name); + + if (modelrenderer != null) + { + return modelrenderer; + } + else + { + for (int i = 0; i < this.customModelRenderers.length; ++i) + { + CustomModelRenderer custommodelrenderer = this.customModelRenderers[i]; + ModelRenderer modelrenderer1 = custommodelrenderer.getModelRenderer(); + + if (name.equals(modelrenderer1.getId())) + { + return modelrenderer1; + } + + ModelRenderer modelrenderer2 = modelrenderer1.getChildDeep(name); + + if (modelrenderer2 != null) + { + return modelrenderer2; + } + } + + return null; + } + } + } + + public ModelVariableFloat getModelVariable(String name) + { + String[] astring = Config.tokenize(name, "."); + + if (astring.length != 2) + { + return null; + } + else + { + String s = astring[0]; + String s1 = astring[1]; + ModelRenderer modelrenderer = this.getModelRenderer(s); + + if (modelrenderer == null) + { + return null; + } + else + { + ModelVariableType modelvariabletype = ModelVariableType.parse(s1); + return modelvariabletype == null ? null : new ModelVariableFloat(name, modelrenderer, modelvariabletype); + } + } + } + + public void setPartModelRenderer(ModelRenderer partModelRenderer) + { + this.partModelRenderer = partModelRenderer; + } + + public void setThisModelRenderer(ModelRenderer thisModelRenderer) + { + this.thisModelRenderer = thisModelRenderer; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelUpdater.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelUpdater.java new file mode 100644 index 0000000..fac30ef --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelUpdater.java @@ -0,0 +1,35 @@ +package net.optifine.entity.model.anim; + +public class ModelUpdater +{ + private ModelVariableUpdater[] modelVariableUpdaters; + + public ModelUpdater(ModelVariableUpdater[] modelVariableUpdaters) + { + this.modelVariableUpdaters = modelVariableUpdaters; + } + + public void update() + { + for (int i = 0; i < this.modelVariableUpdaters.length; ++i) + { + ModelVariableUpdater modelvariableupdater = this.modelVariableUpdaters[i]; + modelvariableupdater.update(); + } + } + + public boolean initialize(IModelResolver mr) + { + for (int i = 0; i < this.modelVariableUpdaters.length; ++i) + { + ModelVariableUpdater modelvariableupdater = this.modelVariableUpdaters[i]; + + if (!modelvariableupdater.initialize(mr)) + { + return false; + } + } + + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableFloat.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableFloat.java new file mode 100644 index 0000000..bda2f6b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableFloat.java @@ -0,0 +1,44 @@ +package net.optifine.entity.model.anim; + +import net.minecraft.client.model.ModelRenderer; +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpressionFloat; + +public class ModelVariableFloat implements IExpressionFloat +{ + private String name; + private ModelRenderer modelRenderer; + private ModelVariableType enumModelVariable; + + public ModelVariableFloat(String name, ModelRenderer modelRenderer, ModelVariableType enumModelVariable) + { + this.name = name; + this.modelRenderer = modelRenderer; + this.enumModelVariable = enumModelVariable; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT; + } + + public float eval() + { + return this.getValue(); + } + + public float getValue() + { + return this.enumModelVariable.getFloat(this.modelRenderer); + } + + public void setValue(float value) + { + this.enumModelVariable.setFloat(this.modelRenderer, value); + } + + public String toString() + { + return this.name; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableType.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableType.java new file mode 100644 index 0000000..1b80c32 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableType.java @@ -0,0 +1,151 @@ +package net.optifine.entity.model.anim; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.src.Config; + +public enum ModelVariableType +{ + POS_X("tx"), + POS_Y("ty"), + POS_Z("tz"), + ANGLE_X("rx"), + ANGLE_Y("ry"), + ANGLE_Z("rz"), + OFFSET_X("ox"), + OFFSET_Y("oy"), + OFFSET_Z("oz"), + SCALE_X("sx"), + SCALE_Y("sy"), + SCALE_Z("sz"); + + private String name; + public static ModelVariableType[] VALUES = values(); + + private ModelVariableType(String name) + { + this.name = name; + } + + public String getName() + { + return this.name; + } + + public float getFloat(ModelRenderer mr) + { + switch (this) + { + case POS_X: + return mr.rotationPointX; + + case POS_Y: + return mr.rotationPointY; + + case POS_Z: + return mr.rotationPointZ; + + case ANGLE_X: + return mr.rotateAngleX; + + case ANGLE_Y: + return mr.rotateAngleY; + + case ANGLE_Z: + return mr.rotateAngleZ; + + case OFFSET_X: + return mr.offsetX; + + case OFFSET_Y: + return mr.offsetY; + + case OFFSET_Z: + return mr.offsetZ; + + case SCALE_X: + return mr.scaleX; + + case SCALE_Y: + return mr.scaleY; + + case SCALE_Z: + return mr.scaleZ; + + default: + Config.warn("GetFloat not supported for: " + this); + return 0.0F; + } + } + + public void setFloat(ModelRenderer mr, float val) + { + switch (this) + { + case POS_X: + mr.rotationPointX = val; + return; + + case POS_Y: + mr.rotationPointY = val; + return; + + case POS_Z: + mr.rotationPointZ = val; + return; + + case ANGLE_X: + mr.rotateAngleX = val; + return; + + case ANGLE_Y: + mr.rotateAngleY = val; + return; + + case ANGLE_Z: + mr.rotateAngleZ = val; + return; + + case OFFSET_X: + mr.offsetX = val; + return; + + case OFFSET_Y: + mr.offsetY = val; + return; + + case OFFSET_Z: + mr.offsetZ = val; + return; + + case SCALE_X: + mr.scaleX = val; + return; + + case SCALE_Y: + mr.scaleY = val; + return; + + case SCALE_Z: + mr.scaleZ = val; + return; + + default: + Config.warn("SetFloat not supported for: " + this); + } + } + + public static ModelVariableType parse(String str) + { + for (int i = 0; i < VALUES.length; ++i) + { + ModelVariableType modelvariabletype = VALUES[i]; + + if (modelvariabletype.getName().equals(str)) + { + return modelvariabletype; + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableUpdater.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableUpdater.java new file mode 100644 index 0000000..465f6d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/ModelVariableUpdater.java @@ -0,0 +1,52 @@ +package net.optifine.entity.model.anim; + +import net.minecraft.src.Config; +import net.optifine.expr.ExpressionParser; +import net.optifine.expr.IExpressionFloat; +import net.optifine.expr.ParseException; + +public class ModelVariableUpdater +{ + private String modelVariableName; + private String expressionText; + private ModelVariableFloat modelVariable; + private IExpressionFloat expression; + + public boolean initialize(IModelResolver mr) + { + this.modelVariable = mr.getModelVariable(this.modelVariableName); + + if (this.modelVariable == null) + { + Config.warn("Model variable not found: " + this.modelVariableName); + return false; + } + else + { + try + { + ExpressionParser expressionparser = new ExpressionParser(mr); + this.expression = expressionparser.parseFloat(this.expressionText); + return true; + } + catch (ParseException parseexception) + { + Config.warn("Error parsing expression: " + this.expressionText); + Config.warn(parseexception.getClass().getName() + ": " + parseexception.getMessage()); + return false; + } + } + } + + public ModelVariableUpdater(String modelVariableName, String expressionText) + { + this.modelVariableName = modelVariableName; + this.expressionText = expressionText; + } + + public void update() + { + float f = this.expression.eval(); + this.modelVariable.setValue(f); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderEntityParameterBool.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderEntityParameterBool.java new file mode 100644 index 0000000..653a91c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderEntityParameterBool.java @@ -0,0 +1,136 @@ +package net.optifine.entity.model.anim; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpressionBool; + +public enum RenderEntityParameterBool implements IExpressionBool +{ + IS_ALIVE("is_alive"), + IS_BURNING("is_burning"), + IS_CHILD("is_child"), + IS_GLOWING("is_glowing"), + IS_HURT("is_hurt"), + IS_IN_LAVA("is_in_lava"), + IS_IN_WATER("is_in_water"), + IS_INVISIBLE("is_invisible"), + IS_ON_GROUND("is_on_ground"), + IS_RIDDEN("is_ridden"), + IS_RIDING("is_riding"), + IS_SNEAKING("is_sneaking"), + IS_SPRINTING("is_sprinting"), + IS_WET("is_wet"); + + private String name; + private RenderManager renderManager; + private static final RenderEntityParameterBool[] VALUES = values(); + + private RenderEntityParameterBool(String name) + { + this.name = name; + this.renderManager = Minecraft.getMinecraft().getRenderManager(); + } + + public String getName() + { + return this.name; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.BOOL; + } + + public boolean eval() + { + Render render = this.renderManager.renderRender; + + if (render == null) + { + return false; + } + else + { + if (render instanceof RendererLivingEntity) + { + RendererLivingEntity rendererlivingentity = (RendererLivingEntity)render; + EntityLivingBase entitylivingbase = rendererlivingentity.renderEntity; + + if (entitylivingbase == null) + { + return false; + } + + switch (this) + { + case IS_ALIVE: + return entitylivingbase.isEntityAlive(); + + case IS_BURNING: + return entitylivingbase.isBurning(); + + case IS_CHILD: + return entitylivingbase.isChild(); + + case IS_HURT: + return entitylivingbase.hurtTime > 0; + + case IS_IN_LAVA: + return entitylivingbase.isInLava(); + + case IS_IN_WATER: + return entitylivingbase.isInWater(); + + case IS_INVISIBLE: + return entitylivingbase.isInvisible(); + + case IS_ON_GROUND: + return entitylivingbase.onGround; + + case IS_RIDDEN: + return entitylivingbase.riddenByEntity != null; + + case IS_RIDING: + return entitylivingbase.isRiding(); + + case IS_SNEAKING: + return entitylivingbase.isSneaking(); + + case IS_SPRINTING: + return entitylivingbase.isSprinting(); + + case IS_WET: + return entitylivingbase.isWet(); + } + } + + return false; + } + } + + public static RenderEntityParameterBool parse(String str) + { + if (str == null) + { + return null; + } + else + { + for (int i = 0; i < VALUES.length; ++i) + { + RenderEntityParameterBool renderentityparameterbool = VALUES[i]; + + if (renderentityparameterbool.getName().equals(str)) + { + return renderentityparameterbool; + } + } + + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderEntityParameterFloat.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderEntityParameterFloat.java new file mode 100644 index 0000000..8cc03c5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderEntityParameterFloat.java @@ -0,0 +1,157 @@ +package net.optifine.entity.model.anim; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpressionFloat; + +public enum RenderEntityParameterFloat implements IExpressionFloat +{ + LIMB_SWING("limb_swing"), + LIMB_SWING_SPEED("limb_speed"), + AGE("age"), + HEAD_YAW("head_yaw"), + HEAD_PITCH("head_pitch"), + SCALE("scale"), + HEALTH("health"), + HURT_TIME("hurt_time"), + IDLE_TIME("idle_time"), + MAX_HEALTH("max_health"), + MOVE_FORWARD("move_forward"), + MOVE_STRAFING("move_strafing"), + PARTIAL_TICKS("partial_ticks"), + POS_X("pos_x"), + POS_Y("pos_y"), + POS_Z("pos_z"), + REVENGE_TIME("revenge_time"), + SWING_PROGRESS("swing_progress"); + + private String name; + private RenderManager renderManager; + private static final RenderEntityParameterFloat[] VALUES = values(); + + private RenderEntityParameterFloat(String name) + { + this.name = name; + this.renderManager = Minecraft.getMinecraft().getRenderManager(); + } + + public String getName() + { + return this.name; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT; + } + + public float eval() + { + Render render = this.renderManager.renderRender; + + if (render == null) + { + return 0.0F; + } + else + { + if (render instanceof RendererLivingEntity) + { + RendererLivingEntity rendererlivingentity = (RendererLivingEntity)render; + + switch (this) + { + case LIMB_SWING: + return rendererlivingentity.renderLimbSwing; + + case LIMB_SWING_SPEED: + return rendererlivingentity.renderLimbSwingAmount; + + case AGE: + return rendererlivingentity.renderAgeInTicks; + + case HEAD_YAW: + return rendererlivingentity.renderHeadYaw; + + case HEAD_PITCH: + return rendererlivingentity.renderHeadPitch; + + case SCALE: + return rendererlivingentity.renderScaleFactor; + + default: + EntityLivingBase entitylivingbase = rendererlivingentity.renderEntity; + + if (entitylivingbase == null) + { + return 0.0F; + } + + switch (this) + { + case HEALTH: + return entitylivingbase.getHealth(); + + case HURT_TIME: + return (float)entitylivingbase.hurtTime; + + case IDLE_TIME: + return (float)entitylivingbase.getAge(); + + case MAX_HEALTH: + return entitylivingbase.getMaxHealth(); + + case MOVE_FORWARD: + return entitylivingbase.moveForward; + + case MOVE_STRAFING: + return entitylivingbase.moveStrafing; + + case POS_X: + return (float)entitylivingbase.posX; + + case POS_Y: + return (float)entitylivingbase.posY; + + case POS_Z: + return (float)entitylivingbase.posZ; + + case REVENGE_TIME: + return (float)entitylivingbase.getRevengeTimer(); + + case SWING_PROGRESS: + return entitylivingbase.getSwingProgress(rendererlivingentity.renderPartialTicks); + } + } + } + + return 0.0F; + } + } + + public static RenderEntityParameterFloat parse(String str) + { + if (str == null) + { + return null; + } + else + { + for (int i = 0; i < VALUES.length; ++i) + { + RenderEntityParameterFloat renderentityparameterfloat = VALUES[i]; + + if (renderentityparameterfloat.getName().equals(str)) + { + return renderentityparameterfloat; + } + } + + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderResolverEntity.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderResolverEntity.java new file mode 100644 index 0000000..98c40fe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderResolverEntity.java @@ -0,0 +1,21 @@ +package net.optifine.entity.model.anim; + +import net.optifine.expr.IExpression; + +public class RenderResolverEntity implements IRenderResolver +{ + public IExpression getParameter(String name) + { + RenderEntityParameterBool renderentityparameterbool = RenderEntityParameterBool.parse(name); + + if (renderentityparameterbool != null) + { + return renderentityparameterbool; + } + else + { + RenderEntityParameterFloat renderentityparameterfloat = RenderEntityParameterFloat.parse(name); + return renderentityparameterfloat != null ? renderentityparameterfloat : null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderResolverTileEntity.java b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderResolverTileEntity.java new file mode 100644 index 0000000..d6a4832 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/entity/model/anim/RenderResolverTileEntity.java @@ -0,0 +1,11 @@ +package net.optifine.entity.model.anim; + +import net.optifine.expr.IExpression; + +public class RenderResolverTileEntity implements IRenderResolver +{ + public IExpression getParameter(String name) + { + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/ConstantFloat.java b/Client-1.8.9/src/main/java/net/optifine/expr/ConstantFloat.java new file mode 100644 index 0000000..0009c71 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/ConstantFloat.java @@ -0,0 +1,26 @@ +package net.optifine.expr; + +public class ConstantFloat implements IExpressionFloat +{ + private float value; + + public ConstantFloat(float value) + { + this.value = value; + } + + public float eval() + { + return this.value; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT; + } + + public String toString() + { + return "" + this.value; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionFloatArrayCached.java b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionFloatArrayCached.java new file mode 100644 index 0000000..b59e179 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionFloatArrayCached.java @@ -0,0 +1,39 @@ +package net.optifine.expr; + +public class ExpressionFloatArrayCached implements IExpressionFloatArray, IExpressionCached +{ + private IExpressionFloatArray expression; + private boolean cached; + private float[] value; + + public ExpressionFloatArrayCached(IExpressionFloatArray expression) + { + this.expression = expression; + } + + public float[] eval() + { + if (!this.cached) + { + this.value = this.expression.eval(); + this.cached = true; + } + + return this.value; + } + + public void reset() + { + this.cached = false; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT; + } + + public String toString() + { + return "cached(" + this.expression + ")"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionFloatCached.java b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionFloatCached.java new file mode 100644 index 0000000..37ef685 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionFloatCached.java @@ -0,0 +1,39 @@ +package net.optifine.expr; + +public class ExpressionFloatCached implements IExpressionFloat, IExpressionCached +{ + private IExpressionFloat expression; + private boolean cached; + private float value; + + public ExpressionFloatCached(IExpressionFloat expression) + { + this.expression = expression; + } + + public float eval() + { + if (!this.cached) + { + this.value = this.expression.eval(); + this.cached = true; + } + + return this.value; + } + + public void reset() + { + this.cached = false; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT; + } + + public String toString() + { + return "cached(" + this.expression + ")"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionParser.java b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionParser.java new file mode 100644 index 0000000..3e61d78 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionParser.java @@ -0,0 +1,425 @@ +package net.optifine.expr; + +import java.io.IOException; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Deque; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import net.minecraft.src.Config; + +public class ExpressionParser +{ + private IExpressionResolver expressionResolver; + + public ExpressionParser(IExpressionResolver expressionResolver) + { + this.expressionResolver = expressionResolver; + } + + public IExpressionFloat parseFloat(String str) throws ParseException + { + IExpression iexpression = this.parse(str); + + if (!(iexpression instanceof IExpressionFloat)) + { + throw new ParseException("Not a float expression: " + iexpression.getExpressionType()); + } + else + { + return (IExpressionFloat)iexpression; + } + } + + public IExpressionBool parseBool(String str) throws ParseException + { + IExpression iexpression = this.parse(str); + + if (!(iexpression instanceof IExpressionBool)) + { + throw new ParseException("Not a boolean expression: " + iexpression.getExpressionType()); + } + else + { + return (IExpressionBool)iexpression; + } + } + + public IExpression parse(String str) throws ParseException + { + try + { + Token[] atoken = TokenParser.parse(str); + + if (atoken == null) + { + return null; + } + else + { + Deque deque = new ArrayDeque(Arrays.asList(atoken)); + return this.parseInfix(deque); + } + } + catch (IOException ioexception) + { + throw new ParseException(ioexception.getMessage(), ioexception); + } + } + + private IExpression parseInfix(Deque deque) throws ParseException + { + if (deque.isEmpty()) + { + return null; + } + else + { + List list = new LinkedList(); + List list1 = new LinkedList(); + IExpression iexpression = this.parseExpression(deque); + checkNull(iexpression, "Missing expression"); + list.add(iexpression); + + while (true) + { + Token token = (Token)deque.poll(); + + if (token == null) + { + return this.makeInfix(list, list1); + } + + if (token.getType() != TokenType.OPERATOR) + { + throw new ParseException("Invalid operator: " + token); + } + + IExpression iexpression1 = this.parseExpression(deque); + checkNull(iexpression1, "Missing expression"); + list1.add(token); + list.add(iexpression1); + } + } + } + + private IExpression makeInfix(List listExpr, List listOper) throws ParseException + { + List list = new LinkedList(); + + for (Token token : listOper) + { + FunctionType functiontype = FunctionType.parse(token.getText()); + checkNull(functiontype, "Invalid operator: " + token); + list.add(functiontype); + } + + return this.makeInfixFunc(listExpr, list); + } + + private IExpression makeInfixFunc(List listExpr, List listFunc) throws ParseException + { + if (listExpr.size() != listFunc.size() + 1) + { + throw new ParseException("Invalid infix expression, expressions: " + listExpr.size() + ", operators: " + listFunc.size()); + } + else if (listExpr.size() == 1) + { + return (IExpression)listExpr.get(0); + } + else + { + int i = Integer.MAX_VALUE; + int j = Integer.MIN_VALUE; + + for (FunctionType functiontype : listFunc) + { + i = Math.min(functiontype.getPrecedence(), i); + j = Math.max(functiontype.getPrecedence(), j); + } + + if (j >= i && j - i <= 10) + { + for (int k = j; k >= i; --k) + { + this.mergeOperators(listExpr, listFunc, k); + } + + if (listExpr.size() == 1 && listFunc.size() == 0) + { + return (IExpression)listExpr.get(0); + } + else + { + throw new ParseException("Error merging operators, expressions: " + listExpr.size() + ", operators: " + listFunc.size()); + } + } + else + { + throw new ParseException("Invalid infix precedence, min: " + i + ", max: " + j); + } + } + } + + private void mergeOperators(List listExpr, List listFuncs, int precedence) throws ParseException + { + for (int i = 0; i < listFuncs.size(); ++i) + { + FunctionType functiontype = (FunctionType)listFuncs.get(i); + + if (functiontype.getPrecedence() == precedence) + { + listFuncs.remove(i); + IExpression iexpression = (IExpression)listExpr.remove(i); + IExpression iexpression1 = (IExpression)listExpr.remove(i); + IExpression iexpression2 = makeFunction(functiontype, new IExpression[] {iexpression, iexpression1}); + listExpr.add(i, iexpression2); + --i; + } + } + } + + private IExpression parseExpression(Deque deque) throws ParseException + { + Token token = (Token)deque.poll(); + checkNull(token, "Missing expression"); + + switch (token.getType()) + { + case NUMBER: + return makeConstantFloat(token); + + case IDENTIFIER: + FunctionType functiontype = this.getFunctionType(token, deque); + + if (functiontype != null) + { + return this.makeFunction(functiontype, deque); + } + + return this.makeVariable(token); + + case BRACKET_OPEN: + return this.makeBracketed(token, deque); + + case OPERATOR: + FunctionType functiontype1 = FunctionType.parse(token.getText()); + checkNull(functiontype1, "Invalid operator: " + token); + + if (functiontype1 == FunctionType.PLUS) + { + return this.parseExpression(deque); + } + else if (functiontype1 == FunctionType.MINUS) + { + IExpression iexpression1 = this.parseExpression(deque); + return makeFunction(FunctionType.NEG, new IExpression[] {iexpression1}); + } + else if (functiontype1 == FunctionType.NOT) + { + IExpression iexpression = this.parseExpression(deque); + return makeFunction(FunctionType.NOT, new IExpression[] {iexpression}); + } + + default: + throw new ParseException("Invalid expression: " + token); + } + } + + private static IExpression makeConstantFloat(Token token) throws ParseException + { + float f = Config.parseFloat(token.getText(), Float.NaN); + + if (f == Float.NaN) + { + throw new ParseException("Invalid float value: " + token); + } + else + { + return new ConstantFloat(f); + } + } + + private FunctionType getFunctionType(Token token, Deque deque) throws ParseException + { + Token tokenPeek = (Token)deque.peek(); + + if (tokenPeek != null && tokenPeek.getType() == TokenType.BRACKET_OPEN) + { + FunctionType functiontype1 = FunctionType.parse(token.getText()); + checkNull(functiontype1, "Unknown function: " + token); + return functiontype1; + } + else + { + FunctionType functiontype = FunctionType.parse(token.getText()); + + if (functiontype == null) + { + return null; + } + else if (functiontype.getParameterCount(new IExpression[0]) > 0) + { + throw new ParseException("Missing arguments: " + functiontype); + } + else + { + return functiontype; + } + } + } + + private IExpression makeFunction(FunctionType type, Deque deque) throws ParseException + { + if (type.getParameterCount(new IExpression[0]) == 0) + { + Token token = (Token)deque.peek(); + + if (token == null || token.getType() != TokenType.BRACKET_OPEN) + { + return makeFunction(type, new IExpression[0]); + } + } + + Token token1 = (Token)deque.poll(); + Deque deque1 = getGroup(deque, TokenType.BRACKET_CLOSE, true); + IExpression[] aiexpression = this.parseExpressions(deque1); + return makeFunction(type, aiexpression); + } + + private IExpression[] parseExpressions(Deque deque) throws ParseException + { + List list = new ArrayList(); + + while (true) + { + Deque deque1 = getGroup(deque, TokenType.COMMA, false); + IExpression iexpression = this.parseInfix(deque1); + + if (iexpression == null) + { + IExpression[] aiexpression = (IExpression[])((IExpression[])list.toArray(new IExpression[list.size()])); + return aiexpression; + } + + list.add(iexpression); + } + } + + private static IExpression makeFunction(FunctionType type, IExpression[] args) throws ParseException + { + ExpressionType[] aexpressiontype = type.getParameterTypes(args); + + if (args.length != aexpressiontype.length) + { + throw new ParseException("Invalid number of arguments, function: \"" + type.getName() + "\", count arguments: " + args.length + ", should be: " + aexpressiontype.length); + } + else + { + for (int i = 0; i < args.length; ++i) + { + IExpression iexpression = args[i]; + ExpressionType expressiontype = iexpression.getExpressionType(); + ExpressionType expressiontype1 = aexpressiontype[i]; + + if (expressiontype != expressiontype1) + { + throw new ParseException("Invalid argument type, function: \"" + type.getName() + "\", index: " + i + ", type: " + expressiontype + ", should be: " + expressiontype1); + } + } + + if (type.getExpressionType() == ExpressionType.FLOAT) + { + return new FunctionFloat(type, args); + } + else if (type.getExpressionType() == ExpressionType.BOOL) + { + return new FunctionBool(type, args); + } + else if (type.getExpressionType() == ExpressionType.FLOAT_ARRAY) + { + return new FunctionFloatArray(type, args); + } + else + { + throw new ParseException("Unknown function type: " + type.getExpressionType() + ", function: " + type.getName()); + } + } + } + + private IExpression makeVariable(Token token) throws ParseException + { + if (this.expressionResolver == null) + { + throw new ParseException("Model variable not found: " + token); + } + else + { + IExpression iexpression = this.expressionResolver.getExpression(token.getText()); + + if (iexpression == null) + { + throw new ParseException("Model variable not found: " + token); + } + else + { + return iexpression; + } + } + } + + private IExpression makeBracketed(Token token, Deque deque) throws ParseException + { + Deque deque1 = getGroup(deque, TokenType.BRACKET_CLOSE, true); + return this.parseInfix(deque1); + } + + private static Deque getGroup(Deque deque, TokenType tokenTypeEnd, boolean tokenEndRequired) throws ParseException + { + Deque deque2 = new ArrayDeque(); + int i = 0; + Iterator iterator = deque.iterator(); + + while (iterator.hasNext()) + { + Token token = (Token)iterator.next(); + iterator.remove(); + + if (i == 0 && token.getType() == tokenTypeEnd) + { + return deque2; + } + + deque2.add(token); + + if (token.getType() == TokenType.BRACKET_OPEN) + { + ++i; + } + + if (token.getType() == TokenType.BRACKET_CLOSE) + { + --i; + } + } + + if (tokenEndRequired) + { + throw new ParseException("Missing end token: " + tokenTypeEnd); + } + else + { + return deque2; + } + } + + private static void checkNull(Object obj, String message) throws ParseException + { + if (obj == null) + { + throw new ParseException(message); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionType.java b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionType.java new file mode 100644 index 0000000..4814356 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/ExpressionType.java @@ -0,0 +1,8 @@ +package net.optifine.expr; + +public enum ExpressionType +{ + FLOAT, + FLOAT_ARRAY, + BOOL; +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/FunctionBool.java b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionBool.java new file mode 100644 index 0000000..c9357d9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionBool.java @@ -0,0 +1,28 @@ +package net.optifine.expr; + +public class FunctionBool implements IExpressionBool +{ + private FunctionType type; + private IExpression[] arguments; + + public FunctionBool(FunctionType type, IExpression[] arguments) + { + this.type = type; + this.arguments = arguments; + } + + public boolean eval() + { + return this.type.evalBool(this.arguments); + } + + public ExpressionType getExpressionType() + { + return ExpressionType.BOOL; + } + + public String toString() + { + return "" + this.type + "()"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/FunctionFloat.java b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionFloat.java new file mode 100644 index 0000000..e7ab110 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionFloat.java @@ -0,0 +1,62 @@ +package net.optifine.expr; + +import net.optifine.shaders.uniform.Smoother; + +public class FunctionFloat implements IExpressionFloat +{ + private FunctionType type; + private IExpression[] arguments; + private int smoothId = -1; + + public FunctionFloat(FunctionType type, IExpression[] arguments) + { + this.type = type; + this.arguments = arguments; + } + + public float eval() + { + IExpression[] aiexpression = this.arguments; + + switch (this.type) + { + case SMOOTH: + IExpression iexpression = aiexpression[0]; + + if (!(iexpression instanceof ConstantFloat)) + { + float f = evalFloat(aiexpression, 0); + float f1 = aiexpression.length > 1 ? evalFloat(aiexpression, 1) : 1.0F; + float f2 = aiexpression.length > 2 ? evalFloat(aiexpression, 2) : f1; + + if (this.smoothId < 0) + { + this.smoothId = Smoother.getNextId(); + } + + float f3 = Smoother.getSmoothValue(this.smoothId, f, f1, f2); + return f3; + } + + default: + return this.type.evalFloat(this.arguments); + } + } + + private static float evalFloat(IExpression[] exprs, int index) + { + IExpressionFloat iexpressionfloat = (IExpressionFloat)exprs[index]; + float f = iexpressionfloat.eval(); + return f; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT; + } + + public String toString() + { + return "" + this.type + "()"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/FunctionFloatArray.java b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionFloatArray.java new file mode 100644 index 0000000..adaabe4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionFloatArray.java @@ -0,0 +1,28 @@ +package net.optifine.expr; + +public class FunctionFloatArray implements IExpressionFloatArray +{ + private FunctionType type; + private IExpression[] arguments; + + public FunctionFloatArray(FunctionType type, IExpression[] arguments) + { + this.type = type; + this.arguments = arguments; + } + + public float[] eval() + { + return this.type.evalFloatArray(this.arguments); + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT_ARRAY; + } + + public String toString() + { + return "" + this.type + "()"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/FunctionType.java b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionType.java new file mode 100644 index 0000000..e6f888e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/FunctionType.java @@ -0,0 +1,426 @@ +package net.optifine.expr; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.optifine.shaders.uniform.Smoother; +import net.optifine.util.MathUtils; + +public enum FunctionType +{ + PLUS(10, ExpressionType.FLOAT, "+", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + MINUS(10, ExpressionType.FLOAT, "-", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + MUL(11, ExpressionType.FLOAT, "*", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + DIV(11, ExpressionType.FLOAT, "/", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + MOD(11, ExpressionType.FLOAT, "%", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + NEG(12, ExpressionType.FLOAT, "neg", new ExpressionType[]{ExpressionType.FLOAT}), + PI(ExpressionType.FLOAT, "pi", new ExpressionType[0]), + SIN(ExpressionType.FLOAT, "sin", new ExpressionType[]{ExpressionType.FLOAT}), + COS(ExpressionType.FLOAT, "cos", new ExpressionType[]{ExpressionType.FLOAT}), + ASIN(ExpressionType.FLOAT, "asin", new ExpressionType[]{ExpressionType.FLOAT}), + ACOS(ExpressionType.FLOAT, "acos", new ExpressionType[]{ExpressionType.FLOAT}), + TAN(ExpressionType.FLOAT, "tan", new ExpressionType[]{ExpressionType.FLOAT}), + ATAN(ExpressionType.FLOAT, "atan", new ExpressionType[]{ExpressionType.FLOAT}), + ATAN2(ExpressionType.FLOAT, "atan2", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + TORAD(ExpressionType.FLOAT, "torad", new ExpressionType[]{ExpressionType.FLOAT}), + TODEG(ExpressionType.FLOAT, "todeg", new ExpressionType[]{ExpressionType.FLOAT}), + MIN(ExpressionType.FLOAT, "min", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT})), + MAX(ExpressionType.FLOAT, "max", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT})), + CLAMP(ExpressionType.FLOAT, "clamp", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}), + ABS(ExpressionType.FLOAT, "abs", new ExpressionType[]{ExpressionType.FLOAT}), + FLOOR(ExpressionType.FLOAT, "floor", new ExpressionType[]{ExpressionType.FLOAT}), + CEIL(ExpressionType.FLOAT, "ceil", new ExpressionType[]{ExpressionType.FLOAT}), + EXP(ExpressionType.FLOAT, "exp", new ExpressionType[]{ExpressionType.FLOAT}), + FRAC(ExpressionType.FLOAT, "frac", new ExpressionType[]{ExpressionType.FLOAT}), + LOG(ExpressionType.FLOAT, "log", new ExpressionType[]{ExpressionType.FLOAT}), + POW(ExpressionType.FLOAT, "pow", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + RANDOM(ExpressionType.FLOAT, "random", new ExpressionType[0]), + ROUND(ExpressionType.FLOAT, "round", new ExpressionType[]{ExpressionType.FLOAT}), + SIGNUM(ExpressionType.FLOAT, "signum", new ExpressionType[]{ExpressionType.FLOAT}), + SQRT(ExpressionType.FLOAT, "sqrt", new ExpressionType[]{ExpressionType.FLOAT}), + FMOD(ExpressionType.FLOAT, "fmod", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + TIME(ExpressionType.FLOAT, "time", new ExpressionType[0]), + IF(ExpressionType.FLOAT, "if", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.BOOL, ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.BOOL, ExpressionType.FLOAT}).last(new ExpressionType[]{ExpressionType.FLOAT})), + NOT(12, ExpressionType.BOOL, "!", new ExpressionType[]{ExpressionType.BOOL}), + AND(3, ExpressionType.BOOL, "&&", new ExpressionType[]{ExpressionType.BOOL, ExpressionType.BOOL}), + OR(2, ExpressionType.BOOL, "||", new ExpressionType[]{ExpressionType.BOOL, ExpressionType.BOOL}), + GREATER(8, ExpressionType.BOOL, ">", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + GREATER_OR_EQUAL(8, ExpressionType.BOOL, ">=", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + SMALLER(8, ExpressionType.BOOL, "<", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + SMALLER_OR_EQUAL(8, ExpressionType.BOOL, "<=", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + EQUAL(7, ExpressionType.BOOL, "==", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + NOT_EQUAL(7, ExpressionType.BOOL, "!=", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + BETWEEN(7, ExpressionType.BOOL, "between", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}), + EQUALS(7, ExpressionType.BOOL, "equals", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}), + IN(ExpressionType.BOOL, "in", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT}).last(new ExpressionType[]{ExpressionType.FLOAT})), + SMOOTH(ExpressionType.FLOAT, "smooth", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT}).maxCount(4)), + TRUE(ExpressionType.BOOL, "true", new ExpressionType[0]), + FALSE(ExpressionType.BOOL, "false", new ExpressionType[0]), + VEC2(ExpressionType.FLOAT_ARRAY, "vec2", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + VEC3(ExpressionType.FLOAT_ARRAY, "vec3", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}), + VEC4(ExpressionType.FLOAT_ARRAY, "vec4", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}); + + private int precedence; + private ExpressionType expressionType; + private String name; + private IParameters parameters; + public static FunctionType[] VALUES = values(); + private static final Map mapSmooth = new HashMap(); + + private FunctionType(ExpressionType expressionType, String name, ExpressionType[] parameterTypes) + { + this(0, expressionType, name, parameterTypes); + } + + private FunctionType(int precedence, ExpressionType expressionType, String name, ExpressionType[] parameterTypes) + { + this(precedence, expressionType, name, new Parameters(parameterTypes)); + } + + private FunctionType(ExpressionType expressionType, String name, IParameters parameters) + { + this(0, expressionType, name, parameters); + } + + private FunctionType(int precedence, ExpressionType expressionType, String name, IParameters parameters) + { + this.precedence = precedence; + this.expressionType = expressionType; + this.name = name; + this.parameters = parameters; + } + + public String getName() + { + return this.name; + } + + public int getPrecedence() + { + return this.precedence; + } + + public ExpressionType getExpressionType() + { + return this.expressionType; + } + + public IParameters getParameters() + { + return this.parameters; + } + + public int getParameterCount(IExpression[] arguments) + { + return this.parameters.getParameterTypes(arguments).length; + } + + public ExpressionType[] getParameterTypes(IExpression[] arguments) + { + return this.parameters.getParameterTypes(arguments); + } + + public float evalFloat(IExpression[] args) + { + switch (this) + { + case PLUS: + return evalFloat(args, 0) + evalFloat(args, 1); + + case MINUS: + return evalFloat(args, 0) - evalFloat(args, 1); + + case MUL: + return evalFloat(args, 0) * evalFloat(args, 1); + + case DIV: + return evalFloat(args, 0) / evalFloat(args, 1); + + case MOD: + float f = evalFloat(args, 0); + float f1 = evalFloat(args, 1); + return f - f1 * (float)((int)(f / f1)); + + case NEG: + return -evalFloat(args, 0); + + case PI: + return MathHelper.PI; + + case SIN: + return MathHelper.sin(evalFloat(args, 0)); + + case COS: + return MathHelper.cos(evalFloat(args, 0)); + + case ASIN: + return MathUtils.asin(evalFloat(args, 0)); + + case ACOS: + return MathUtils.acos(evalFloat(args, 0)); + + case TAN: + return (float)Math.tan((double)evalFloat(args, 0)); + + case ATAN: + return (float)Math.atan((double)evalFloat(args, 0)); + + case ATAN2: + return (float)MathHelper.atan2((double)evalFloat(args, 0), (double)evalFloat(args, 1)); + + case TORAD: + return MathUtils.toRad(evalFloat(args, 0)); + + case TODEG: + return MathUtils.toDeg(evalFloat(args, 0)); + + case MIN: + return this.getMin(args); + + case MAX: + return this.getMax(args); + + case CLAMP: + return MathHelper.clamp_float(evalFloat(args, 0), evalFloat(args, 1), evalFloat(args, 2)); + + case ABS: + return MathHelper.abs(evalFloat(args, 0)); + + case EXP: + return (float)Math.exp((double)evalFloat(args, 0)); + + case FLOOR: + return (float)MathHelper.floor_float(evalFloat(args, 0)); + + case CEIL: + return (float)MathHelper.ceiling_float_int(evalFloat(args, 0)); + + case FRAC: + return (float)MathHelper.func_181162_h((double)evalFloat(args, 0)); + + case LOG: + return (float)Math.log((double)evalFloat(args, 0)); + + case POW: + return (float)Math.pow((double)evalFloat(args, 0), (double)evalFloat(args, 1)); + + case RANDOM: + return (float)Math.random(); + + case ROUND: + return (float)Math.round(evalFloat(args, 0)); + + case SIGNUM: + return Math.signum(evalFloat(args, 0)); + + case SQRT: + return MathHelper.sqrt_float(evalFloat(args, 0)); + + case FMOD: + float f2 = evalFloat(args, 0); + float f3 = evalFloat(args, 1); + return f2 - f3 * (float)MathHelper.floor_float(f2 / f3); + + case TIME: + Minecraft minecraft = Minecraft.getMinecraft(); + World world = minecraft.theWorld; + + if (world == null) + { + return 0.0F; + } + + return (float)(world.getTotalWorldTime() % 24000L) + Config.renderPartialTicks; + + case IF: + int i = (args.length - 1) / 2; + + for (int k = 0; k < i; ++k) + { + int l = k * 2; + + if (evalBool(args, l)) + { + return evalFloat(args, l + 1); + } + } + + return evalFloat(args, i * 2); + + case SMOOTH: + int j = (int)evalFloat(args, 0); + float f4 = evalFloat(args, 1); + float f5 = args.length > 2 ? evalFloat(args, 2) : 1.0F; + float f6 = args.length > 3 ? evalFloat(args, 3) : f5; + float f7 = Smoother.getSmoothValue(j, f4, f5, f6); + return f7; + + default: + Config.warn("Unknown function type: " + this); + return 0.0F; + } + } + + private float getMin(IExpression[] exprs) + { + if (exprs.length == 2) + { + return Math.min(evalFloat(exprs, 0), evalFloat(exprs, 1)); + } + else + { + float f = evalFloat(exprs, 0); + + for (int i = 1; i < exprs.length; ++i) + { + float f1 = evalFloat(exprs, i); + + if (f1 < f) + { + f = f1; + } + } + + return f; + } + } + + private float getMax(IExpression[] exprs) + { + if (exprs.length == 2) + { + return Math.max(evalFloat(exprs, 0), evalFloat(exprs, 1)); + } + else + { + float f = evalFloat(exprs, 0); + + for (int i = 1; i < exprs.length; ++i) + { + float f1 = evalFloat(exprs, i); + + if (f1 > f) + { + f = f1; + } + } + + return f; + } + } + + private static float evalFloat(IExpression[] exprs, int index) + { + IExpressionFloat iexpressionfloat = (IExpressionFloat)exprs[index]; + float f = iexpressionfloat.eval(); + return f; + } + + public boolean evalBool(IExpression[] args) + { + switch (this) + { + case TRUE: + return true; + + case FALSE: + return false; + + case NOT: + return !evalBool(args, 0); + + case AND: + return evalBool(args, 0) && evalBool(args, 1); + + case OR: + return evalBool(args, 0) || evalBool(args, 1); + + case GREATER: + return evalFloat(args, 0) > evalFloat(args, 1); + + case GREATER_OR_EQUAL: + return evalFloat(args, 0) >= evalFloat(args, 1); + + case SMALLER: + return evalFloat(args, 0) < evalFloat(args, 1); + + case SMALLER_OR_EQUAL: + return evalFloat(args, 0) <= evalFloat(args, 1); + + case EQUAL: + return evalFloat(args, 0) == evalFloat(args, 1); + + case NOT_EQUAL: + return evalFloat(args, 0) != evalFloat(args, 1); + + case BETWEEN: + float f = evalFloat(args, 0); + return f >= evalFloat(args, 1) && f <= evalFloat(args, 2); + + case EQUALS: + float f1 = evalFloat(args, 0) - evalFloat(args, 1); + float f2 = evalFloat(args, 2); + return Math.abs(f1) <= f2; + + case IN: + float f3 = evalFloat(args, 0); + + for (int i = 1; i < args.length; ++i) + { + float f4 = evalFloat(args, i); + + if (f3 == f4) + { + return true; + } + } + + return false; + + default: + Config.warn("Unknown function type: " + this); + return false; + } + } + + private static boolean evalBool(IExpression[] exprs, int index) + { + IExpressionBool iexpressionbool = (IExpressionBool)exprs[index]; + boolean flag = iexpressionbool.eval(); + return flag; + } + + public float[] evalFloatArray(IExpression[] args) + { + switch (this) + { + case VEC2: + return new float[] {evalFloat(args, 0), evalFloat(args, 1)}; + case VEC3: + return new float[] {evalFloat(args, 0), evalFloat(args, 1), evalFloat(args, 2)}; + case VEC4: + return new float[] {evalFloat(args, 0), evalFloat(args, 1), evalFloat(args, 2), evalFloat(args, 3)}; + default: + Config.warn("Unknown function type: " + this); + return null; + } + } + + public static FunctionType parse(String str) + { + for (int i = 0; i < VALUES.length; ++i) + { + FunctionType functiontype = VALUES[i]; + + if (functiontype.getName().equals(str)) + { + return functiontype; + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/IExpression.java b/Client-1.8.9/src/main/java/net/optifine/expr/IExpression.java new file mode 100644 index 0000000..e0f650d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/IExpression.java @@ -0,0 +1,6 @@ +package net.optifine.expr; + +public interface IExpression +{ + ExpressionType getExpressionType(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionBool.java b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionBool.java new file mode 100644 index 0000000..c3dd17b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionBool.java @@ -0,0 +1,6 @@ +package net.optifine.expr; + +public interface IExpressionBool extends IExpression +{ + boolean eval(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionCached.java b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionCached.java new file mode 100644 index 0000000..dd1f9c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionCached.java @@ -0,0 +1,6 @@ +package net.optifine.expr; + +public interface IExpressionCached +{ + void reset(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionFloat.java b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionFloat.java new file mode 100644 index 0000000..d32bf79 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionFloat.java @@ -0,0 +1,6 @@ +package net.optifine.expr; + +public interface IExpressionFloat extends IExpression +{ + float eval(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionFloatArray.java b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionFloatArray.java new file mode 100644 index 0000000..7fdd7ac --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionFloatArray.java @@ -0,0 +1,6 @@ +package net.optifine.expr; + +public interface IExpressionFloatArray extends IExpression +{ + float[] eval(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionResolver.java b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionResolver.java new file mode 100644 index 0000000..0d724b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/IExpressionResolver.java @@ -0,0 +1,6 @@ +package net.optifine.expr; + +public interface IExpressionResolver +{ + IExpression getExpression(String var1); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/IParameters.java b/Client-1.8.9/src/main/java/net/optifine/expr/IParameters.java new file mode 100644 index 0000000..8a8395e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/IParameters.java @@ -0,0 +1,6 @@ +package net.optifine.expr; + +public interface IParameters +{ + ExpressionType[] getParameterTypes(IExpression[] var1); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/Parameters.java b/Client-1.8.9/src/main/java/net/optifine/expr/Parameters.java new file mode 100644 index 0000000..96b7978 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/Parameters.java @@ -0,0 +1,16 @@ +package net.optifine.expr; + +public class Parameters implements IParameters +{ + private ExpressionType[] parameterTypes; + + public Parameters(ExpressionType[] parameterTypes) + { + this.parameterTypes = parameterTypes; + } + + public ExpressionType[] getParameterTypes(IExpression[] params) + { + return this.parameterTypes; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/ParametersVariable.java b/Client-1.8.9/src/main/java/net/optifine/expr/ParametersVariable.java new file mode 100644 index 0000000..0787314 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/ParametersVariable.java @@ -0,0 +1,102 @@ +package net.optifine.expr; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ParametersVariable implements IParameters +{ + private ExpressionType[] first; + private ExpressionType[] repeat; + private ExpressionType[] last; + private int maxCount; + private static final ExpressionType[] EMPTY = new ExpressionType[0]; + + public ParametersVariable() + { + this((ExpressionType[])null, (ExpressionType[])null, (ExpressionType[])null); + } + + public ParametersVariable(ExpressionType[] first, ExpressionType[] repeat, ExpressionType[] last) + { + this(first, repeat, last, Integer.MAX_VALUE); + } + + public ParametersVariable(ExpressionType[] first, ExpressionType[] repeat, ExpressionType[] last, int maxCount) + { + this.maxCount = Integer.MAX_VALUE; + this.first = normalize(first); + this.repeat = normalize(repeat); + this.last = normalize(last); + this.maxCount = maxCount; + } + + private static ExpressionType[] normalize(ExpressionType[] exprs) + { + return exprs == null ? EMPTY : exprs; + } + + public ExpressionType[] getFirst() + { + return this.first; + } + + public ExpressionType[] getRepeat() + { + return this.repeat; + } + + public ExpressionType[] getLast() + { + return this.last; + } + + public int getCountRepeat() + { + return this.first == null ? 0 : this.first.length; + } + + public ExpressionType[] getParameterTypes(IExpression[] arguments) + { + int i = this.first.length + this.last.length; + int j = arguments.length - i; + int k = 0; + + for (int l = 0; l + this.repeat.length <= j && i + l + this.repeat.length <= this.maxCount; l += this.repeat.length) + { + ++k; + } + + List list = new ArrayList(); + list.addAll(Arrays.asList(this.first)); + + for (int i1 = 0; i1 < k; ++i1) + { + list.addAll(Arrays.asList(this.repeat)); + } + + list.addAll(Arrays.asList(this.last)); + ExpressionType[] aexpressiontype = (ExpressionType[])list.toArray(new ExpressionType[list.size()]); + return aexpressiontype; + } + + public ParametersVariable first(ExpressionType... first) + { + return new ParametersVariable(first, this.repeat, this.last); + } + + public ParametersVariable repeat(ExpressionType... repeat) + { + return new ParametersVariable(this.first, repeat, this.last); + } + + public ParametersVariable last(ExpressionType... last) + { + return new ParametersVariable(this.first, this.repeat, last); + } + + public ParametersVariable maxCount(int maxCount) + { + return new ParametersVariable(this.first, this.repeat, this.last, maxCount); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/ParseException.java b/Client-1.8.9/src/main/java/net/optifine/expr/ParseException.java new file mode 100644 index 0000000..c4bab5f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/ParseException.java @@ -0,0 +1,14 @@ +package net.optifine.expr; + +public class ParseException extends Exception +{ + public ParseException(String message, Throwable cause) + { + super(message, cause); + } + + public ParseException(String message) + { + super(message); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/TestExpressions.java b/Client-1.8.9/src/main/java/net/optifine/expr/TestExpressions.java new file mode 100644 index 0000000..83f8ad4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/TestExpressions.java @@ -0,0 +1,47 @@ +package net.optifine.expr; + +import java.io.BufferedReader; +import java.io.InputStreamReader; + +public class TestExpressions +{ + public static void main(String[] args) throws Exception + { + ExpressionParser expressionparser = new ExpressionParser((IExpressionResolver)null); + + while (true) + { + try + { + InputStreamReader inputstreamreader = new InputStreamReader(System.in); + BufferedReader bufferedreader = new BufferedReader(inputstreamreader); + String s = bufferedreader.readLine(); + + if (s.length() <= 0) + { + return; + } + + IExpression iexpression = expressionparser.parse(s); + + if (iexpression instanceof IExpressionFloat) + { + IExpressionFloat iexpressionfloat = (IExpressionFloat)iexpression; + float f = iexpressionfloat.eval(); + System.out.println("" + f); + } + + if (iexpression instanceof IExpressionBool) + { + IExpressionBool iexpressionbool = (IExpressionBool)iexpression; + boolean flag = iexpressionbool.eval(); + System.out.println("" + flag); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/Token.java b/Client-1.8.9/src/main/java/net/optifine/expr/Token.java new file mode 100644 index 0000000..dc77dd5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/Token.java @@ -0,0 +1,28 @@ +package net.optifine.expr; + +public class Token +{ + private TokenType type; + private String text; + + public Token(TokenType type, String text) + { + this.type = type; + this.text = text; + } + + public TokenType getType() + { + return this.type; + } + + public String getText() + { + return this.text; + } + + public String toString() + { + return this.text; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/TokenParser.java b/Client-1.8.9/src/main/java/net/optifine/expr/TokenParser.java new file mode 100644 index 0000000..d41217f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/TokenParser.java @@ -0,0 +1,72 @@ +package net.optifine.expr; + +import java.io.IOException; +import java.io.PushbackReader; +import java.io.Reader; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.List; + +public class TokenParser +{ + public static Token[] parse(String str) throws IOException, ParseException + { + Reader reader = new StringReader(str); + PushbackReader pushbackreader = new PushbackReader(reader); + List list = new ArrayList(); + + while (true) + { + int i = pushbackreader.read(); + + if (i < 0) + { + Token[] atoken = (Token[])((Token[])list.toArray(new Token[list.size()])); + return atoken; + } + + char c0 = (char)i; + + if (!Character.isWhitespace(c0)) + { + TokenType tokentype = TokenType.getTypeByFirstChar(c0); + + if (tokentype == null) + { + throw new ParseException("Invalid character: \'" + c0 + "\', in: " + str); + } + + Token token = readToken(c0, tokentype, pushbackreader); + list.add(token); + } + } + } + + private static Token readToken(char chFirst, TokenType type, PushbackReader pr) throws IOException + { + StringBuffer stringbuffer = new StringBuffer(); + stringbuffer.append(chFirst); + + while (true) + { + int i = pr.read(); + + if (i < 0) + { + break; + } + + char c0 = (char)i; + + if (!type.hasCharNext(c0)) + { + pr.unread(c0); + break; + } + + stringbuffer.append(c0); + } + + return new Token(type, stringbuffer.toString()); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/expr/TokenType.java b/Client-1.8.9/src/main/java/net/optifine/expr/TokenType.java new file mode 100644 index 0000000..da19fe2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/expr/TokenType.java @@ -0,0 +1,61 @@ +package net.optifine.expr; + +public enum TokenType +{ + IDENTIFIER("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_:."), + NUMBER("0123456789", "0123456789."), + OPERATOR("+-*/%!&|<>=", "&|="), + COMMA(","), + BRACKET_OPEN("("), + BRACKET_CLOSE(")"); + + private String charsFirst; + private String charsNext; + public static final TokenType[] VALUES = values(); + + private TokenType(String charsFirst) + { + this(charsFirst, ""); + } + + private TokenType(String charsFirst, String charsNext) + { + this.charsFirst = charsFirst; + this.charsNext = charsNext; + } + + public String getCharsFirst() + { + return this.charsFirst; + } + + public String getCharsNext() + { + return this.charsNext; + } + + public static TokenType getTypeByFirstChar(char ch) + { + for (int i = 0; i < VALUES.length; ++i) + { + TokenType tokentype = VALUES[i]; + + if (tokentype.getCharsFirst().indexOf(ch) >= 0) + { + return tokentype; + } + } + + return null; + } + + public boolean hasCharNext(char ch) + { + return this.charsNext.indexOf(ch) >= 0; + } + + private static class Const { + static final String ALPHAS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + static final String DIGITS = "0123456789"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiAnimationSettingsOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiAnimationSettingsOF.java new file mode 100644 index 0000000..ca51932 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiAnimationSettingsOF.java @@ -0,0 +1,87 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.optifine.Lang; + +public class GuiAnimationSettingsOF extends GuiScreen +{ + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.ANIMATED_WATER, GameSettings.Options.ANIMATED_LAVA, GameSettings.Options.ANIMATED_FIRE, GameSettings.Options.ANIMATED_PORTAL, GameSettings.Options.ANIMATED_REDSTONE, GameSettings.Options.ANIMATED_EXPLOSION, GameSettings.Options.ANIMATED_FLAME, GameSettings.Options.ANIMATED_SMOKE, GameSettings.Options.VOID_PARTICLES, GameSettings.Options.WATER_PARTICLES, GameSettings.Options.RAIN_SPLASH, GameSettings.Options.PORTAL_PARTICLES, GameSettings.Options.POTION_PARTICLES, GameSettings.Options.DRIPPING_WATER_LAVA, GameSettings.Options.ANIMATED_TERRAIN, GameSettings.Options.ANIMATED_TEXTURES, GameSettings.Options.FIREWORK_PARTICLES, GameSettings.Options.PARTICLES}; + + public GuiAnimationSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) + { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + public void initGui() + { + this.title = I18n.format("of.options.animationsTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) + { + GameSettings.Options gamesettings$options = enumOptions[i]; + int j = this.width / 2 - 155 + i % 2 * 160; + int k = this.height / 6 + 21 * (i / 2) - 12; + + if (!gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options))); + } + else + { + this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); + } + } + + this.buttonList.add(new GuiButton(210, this.width / 2 - 155, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOn"))); + this.buttonList.add(new GuiButton(211, this.width / 2 - 155 + 80, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOff"))); + this.buttonList.add(new GuiOptionButton(200, this.width / 2 + 5, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) + { + if (guibutton.enabled) + { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) + { + this.settings.setOptionValue(((GuiOptionButton)guibutton).returnEnumOptions(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + + if (guibutton.id == 210) + { + this.mc.gameSettings.setAllAnimations(true); + } + + if (guibutton.id == 211) + { + this.mc.gameSettings.setAllAnimations(false); + } + + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); + } + } + + public void drawScreen(int x, int y, float f) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiButtonOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiButtonOF.java new file mode 100644 index 0000000..4548703 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiButtonOF.java @@ -0,0 +1,16 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiButton; + +public class GuiButtonOF extends GuiButton +{ + public GuiButtonOF(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText) + { + super(buttonId, x, y, widthIn, heightIn, buttonText); + } + + public GuiButtonOF(int buttonId, int x, int y, String buttonText) + { + super(buttonId, x, y, buttonText); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiChatOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiChatOF.java new file mode 100644 index 0000000..31f18ee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiChatOF.java @@ -0,0 +1,61 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiVideoSettings; +import net.minecraft.src.Config; +import net.optifine.shaders.Shaders; + +public class GuiChatOF extends GuiChat +{ + private static final String CMD_RELOAD_SHADERS = "/reloadShaders"; + private static final String CMD_RELOAD_CHUNKS = "/reloadChunks"; + + public GuiChatOF(GuiChat guiChat) + { + super(GuiVideoSettings.getGuiChatText(guiChat)); + } + + public void sendChatMessage(String msg) + { + if (this.checkCustomCommand(msg)) + { + this.mc.ingameGUI.getChatGUI().addToSentMessages(msg); + } + else + { + super.sendChatMessage(msg); + } + } + + private boolean checkCustomCommand(String msg) + { + if (msg == null) + { + return false; + } + else + { + msg = msg.trim(); + + if (msg.equals("/reloadShaders")) + { + if (Config.isShaders()) + { + Shaders.uninit(); + Shaders.loadShaderPack(); + } + + return true; + } + else if (msg.equals("/reloadChunks")) + { + this.mc.renderGlobal.loadRenderers(); + return true; + } + else + { + return false; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiDetailSettingsOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiDetailSettingsOF.java new file mode 100644 index 0000000..1f2a538 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiDetailSettingsOF.java @@ -0,0 +1,72 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiDetailSettingsOF extends GuiScreen +{ + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.CLOUDS, GameSettings.Options.CLOUD_HEIGHT, GameSettings.Options.TREES, GameSettings.Options.RAIN, GameSettings.Options.SKY, GameSettings.Options.STARS, GameSettings.Options.SUN_MOON, GameSettings.Options.SHOW_CAPES, GameSettings.Options.FOG_FANCY, GameSettings.Options.FOG_START, GameSettings.Options.TRANSLUCENT_BLOCKS, GameSettings.Options.HELD_ITEM_TOOLTIPS, GameSettings.Options.DROPPED_ITEMS, GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.VIGNETTE, GameSettings.Options.ALTERNATE_BLOCKS, GameSettings.Options.SWAMP_COLORS, GameSettings.Options.SMOOTH_BIOMES}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiDetailSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) + { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + public void initGui() + { + this.title = I18n.format("of.options.detailsTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) + { + GameSettings.Options gamesettings$options = enumOptions[i]; + int j = this.width / 2 - 155 + i % 2 * 160; + int k = this.height / 6 + 21 * (i / 2) - 12; + + if (!gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options))); + } + else + { + this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) + { + if (guibutton.enabled) + { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) + { + this.settings.setOptionValue(((GuiOptionButton)guibutton).returnEnumOptions(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + } + } + + public void drawScreen(int x, int y, float f) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiMessage.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiMessage.java new file mode 100644 index 0000000..e138f49 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiMessage.java @@ -0,0 +1,79 @@ +package net.optifine.gui; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.src.Config; + +public class GuiMessage extends GuiScreen +{ + private GuiScreen parentScreen; + private String messageLine1; + private String messageLine2; + private final List listLines2 = Lists.newArrayList(); + protected String confirmButtonText; + private int ticksUntilEnable; + + public GuiMessage(GuiScreen parentScreen, String line1, String line2) + { + this.parentScreen = parentScreen; + this.messageLine1 = line1; + this.messageLine2 = line2; + this.confirmButtonText = I18n.format("gui.done", new Object[0]); + } + + public void initGui() + { + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 74, this.height / 6 + 96, this.confirmButtonText)); + this.listLines2.clear(); + this.listLines2.addAll(this.fontRendererObj.listFormattedStringToWidth(this.messageLine2, this.width - 50)); + } + + protected void actionPerformed(GuiButton button) throws IOException + { + Config.getMinecraft().displayGuiScreen(this.parentScreen); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.messageLine1, this.width / 2, 70, 16777215); + int i = 90; + + for (Object e : this.listLines2) + { + String s = (String) e; + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, i, 16777215); + i += this.fontRendererObj.FONT_HEIGHT; + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void setButtonDelay(int ticksUntilEnable) + { + this.ticksUntilEnable = ticksUntilEnable; + + for (GuiButton guibutton : this.buttonList) + { + guibutton.enabled = false; + } + } + + public void updateScreen() + { + super.updateScreen(); + + if (--this.ticksUntilEnable == 0) + { + for (GuiButton guibutton : this.buttonList) + { + guibutton.enabled = true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiOptionButtonOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiOptionButtonOF.java new file mode 100644 index 0000000..d4f3221 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiOptionButtonOF.java @@ -0,0 +1,20 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionButtonOF extends GuiOptionButton implements IOptionControl +{ + private GameSettings.Options option = null; + + public GuiOptionButtonOF(int id, int x, int y, GameSettings.Options option, String text) + { + super(id, x, y, option, text); + this.option = option; + } + + public GameSettings.Options getOption() + { + return this.option; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiOptionSliderOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiOptionSliderOF.java new file mode 100644 index 0000000..5a9aa76 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiOptionSliderOF.java @@ -0,0 +1,20 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiOptionSlider; +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionSliderOF extends GuiOptionSlider implements IOptionControl +{ + private GameSettings.Options option = null; + + public GuiOptionSliderOF(int id, int x, int y, GameSettings.Options option) + { + super(id, x, y, option); + this.option = option; + } + + public GameSettings.Options getOption() + { + return this.option; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiOtherSettingsOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiOtherSettingsOF.java new file mode 100644 index 0000000..4928de0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiOtherSettingsOF.java @@ -0,0 +1,92 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiOtherSettingsOF extends GuiScreen implements GuiYesNoCallback +{ + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.LAGOMETER, GameSettings.Options.PROFILER, GameSettings.Options.SHOW_FPS, GameSettings.Options.ADVANCED_TOOLTIPS, GameSettings.Options.WEATHER, GameSettings.Options.TIME, GameSettings.Options.USE_FULLSCREEN, GameSettings.Options.FULLSCREEN_MODE, GameSettings.Options.ANAGLYPH, GameSettings.Options.AUTOSAVE_TICKS, GameSettings.Options.SCREENSHOT_SIZE, GameSettings.Options.SHOW_GL_ERRORS}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiOtherSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) + { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + public void initGui() + { + this.title = I18n.format("of.options.otherTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) + { + GameSettings.Options gamesettings$options = enumOptions[i]; + int j = this.width / 2 - 155 + i % 2 * 160; + int k = this.height / 6 + 21 * (i / 2) - 12; + + if (!gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options))); + } + else + { + this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); + } + } + + this.buttonList.add(new GuiButton(210, this.width / 2 - 100, this.height / 6 + 168 + 11 - 44, I18n.format("of.options.other.reset", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) + { + if (guibutton.enabled) + { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) + { + this.settings.setOptionValue(((GuiOptionButton)guibutton).returnEnumOptions(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + + if (guibutton.id == 210) + { + this.mc.gameSettings.saveOptions(); + GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("of.message.other.reset", new Object[0]), "", 9999); + this.mc.displayGuiScreen(guiyesno); + } + } + } + + public void confirmClicked(boolean flag, int i) + { + if (flag) + { + this.mc.gameSettings.resetSettings(); + } + + this.mc.displayGuiScreen(this); + } + + public void drawScreen(int x, int y, float f) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiPerformanceSettingsOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiPerformanceSettingsOF.java new file mode 100644 index 0000000..0bef201 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiPerformanceSettingsOF.java @@ -0,0 +1,72 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiPerformanceSettingsOF extends GuiScreen +{ + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.SMOOTH_FPS, GameSettings.Options.SMOOTH_WORLD, GameSettings.Options.FAST_RENDER, GameSettings.Options.FAST_MATH, GameSettings.Options.CHUNK_UPDATES, GameSettings.Options.CHUNK_UPDATES_DYNAMIC, GameSettings.Options.RENDER_REGIONS, GameSettings.Options.LAZY_CHUNK_LOADING, GameSettings.Options.SMART_ANIMATIONS}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiPerformanceSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) + { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + public void initGui() + { + this.title = I18n.format("of.options.performanceTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) + { + GameSettings.Options gamesettings$options = enumOptions[i]; + int j = this.width / 2 - 155 + i % 2 * 160; + int k = this.height / 6 + 21 * (i / 2) - 12; + + if (!gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options))); + } + else + { + this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) + { + if (guibutton.enabled) + { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) + { + this.settings.setOptionValue(((GuiOptionButton)guibutton).returnEnumOptions(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + } + } + + public void drawScreen(int x, int y, float f) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiQualitySettingsOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiQualitySettingsOF.java new file mode 100644 index 0000000..26a3378 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiQualitySettingsOF.java @@ -0,0 +1,79 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiQualitySettingsOF extends GuiScreen +{ + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.MIPMAP_LEVELS, GameSettings.Options.MIPMAP_TYPE, GameSettings.Options.AF_LEVEL, GameSettings.Options.AA_LEVEL, GameSettings.Options.CLEAR_WATER, GameSettings.Options.RANDOM_ENTITIES, GameSettings.Options.BETTER_GRASS, GameSettings.Options.BETTER_SNOW, GameSettings.Options.CUSTOM_FONTS, GameSettings.Options.CUSTOM_COLORS, GameSettings.Options.CONNECTED_TEXTURES, GameSettings.Options.NATURAL_TEXTURES, GameSettings.Options.CUSTOM_SKY, GameSettings.Options.CUSTOM_ITEMS, GameSettings.Options.CUSTOM_ENTITY_MODELS, GameSettings.Options.CUSTOM_GUIS, GameSettings.Options.EMISSIVE_TEXTURES}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiQualitySettingsOF(GuiScreen guiscreen, GameSettings gamesettings) + { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + public void initGui() + { + this.title = I18n.format("of.options.qualityTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) + { + GameSettings.Options gamesettings$options = enumOptions[i]; + int j = this.width / 2 - 155 + i % 2 * 160; + int k = this.height / 6 + 21 * (i / 2) - 12; + + if (!gamesettings$options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options))); + } + else + { + this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options)); + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) + { + if (guibutton.enabled) + { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) + { + this.settings.setOptionValue(((GuiOptionButton)guibutton).returnEnumOptions(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + + if (guibutton.id != GameSettings.Options.AA_LEVEL.ordinal()) + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc); + this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight()); + } + } + } + + public void drawScreen(int x, int y, float f) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiScreenCapeOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiScreenCapeOF.java new file mode 100644 index 0000000..2baa225 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiScreenCapeOF.java @@ -0,0 +1,144 @@ +package net.optifine.gui; + +import com.mojang.authlib.exceptions.InvalidCredentialsException; +import java.math.BigInteger; +import java.net.URI; +import java.util.Random; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.src.Config; +import net.optifine.Lang; + +public class GuiScreenCapeOF extends GuiScreenOF +{ + private final GuiScreen parentScreen; + private String title; + private String message; + private long messageHideTimeMs; + private String linkUrl; + private GuiButtonOF buttonCopyLink; + private FontRenderer fontRenderer; + + public GuiScreenCapeOF(GuiScreen parentScreenIn) + { + this.fontRenderer = Config.getMinecraft().fontRendererObj; + this.parentScreen = parentScreenIn; + } + + public void initGui() + { + int i = 0; + this.title = I18n.format("of.options.capeOF.title", new Object[0]); + i = i + 2; + this.buttonList.add(new GuiButtonOF(210, this.width / 2 - 155, this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("of.options.capeOF.openEditor", new Object[0]))); + this.buttonList.add(new GuiButtonOF(220, this.width / 2 - 155 + 160, this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("of.options.capeOF.reloadCape", new Object[0]))); + i = i + 6; + this.buttonCopyLink = new GuiButtonOF(230, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), 200, 20, I18n.format("of.options.capeOF.copyEditorLink", new Object[0])); + this.buttonCopyLink.visible = this.linkUrl != null; + this.buttonList.add(this.buttonCopyLink); + i = i + 4; + this.buttonList.add(new GuiButtonOF(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1), I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 200) + { + this.mc.displayGuiScreen(this.parentScreen); + } + + if (button.id == 210) + { + try + { + String s = this.mc.getSession().getProfile().getName(); + String s1 = this.mc.getSession().getProfile().getId().toString().replace("-", ""); + String s2 = this.mc.getSession().getToken(); + Random random = new Random(); + Random random1 = new Random((long)System.identityHashCode(new Object())); + BigInteger biginteger = new BigInteger(128, random); + BigInteger biginteger1 = new BigInteger(128, random1); + BigInteger biginteger2 = biginteger.xor(biginteger1); + String s3 = biginteger2.toString(16); + this.mc.getSessionService().joinServer(this.mc.getSession().getProfile(), s2, s3); + String s4 = "https://optifine.net/capeChange?u=" + s1 + "&n=" + s + "&s=" + s3; + boolean flag = Config.openWebLink(new URI(s4)); + + if (flag) + { + this.showMessage(Lang.get("of.message.capeOF.openEditor"), 10000L); + } + else + { + this.showMessage(Lang.get("of.message.capeOF.openEditorError"), 10000L); + this.setLinkUrl(s4); + } + } + catch (InvalidCredentialsException invalidcredentialsexception) + { + Config.showGuiMessage(I18n.format("of.message.capeOF.error1", new Object[0]), I18n.format("of.message.capeOF.error2", new Object[] {invalidcredentialsexception.getMessage()})); + Config.warn("Mojang authentication failed"); + Config.warn(invalidcredentialsexception.getClass().getName() + ": " + invalidcredentialsexception.getMessage()); + } + catch (Exception exception) + { + Config.warn("Error opening OptiFine cape link"); + Config.warn(exception.getClass().getName() + ": " + exception.getMessage()); + } + } + + if (button.id == 220) + { + this.showMessage(Lang.get("of.message.capeOF.reloadCape"), 15000L); + + if (this.mc.thePlayer != null) + { + long i = 15000L; + long j = System.currentTimeMillis() + i; + this.mc.thePlayer.setReloadCapeTimeMs(j); + } + } + + if (button.id == 230 && this.linkUrl != null) + { + setClipboardString(this.linkUrl); + } + } + } + + private void showMessage(String msg, long timeMs) + { + this.message = msg; + this.messageHideTimeMs = System.currentTimeMillis() + timeMs; + this.setLinkUrl((String)null); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, this.title, this.width / 2, 20, 16777215); + + if (this.message != null) + { + this.drawCenteredString(this.fontRenderer, this.message, this.width / 2, this.height / 6 + 60, 16777215); + + if (System.currentTimeMillis() > this.messageHideTimeMs) + { + this.message = null; + this.setLinkUrl((String)null); + } + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void setLinkUrl(String linkUrl) + { + this.linkUrl = linkUrl; + this.buttonCopyLink.visible = linkUrl != null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/GuiScreenOF.java b/Client-1.8.9/src/main/java/net/optifine/gui/GuiScreenOF.java new file mode 100644 index 0000000..5d391c3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/GuiScreenOF.java @@ -0,0 +1,51 @@ +package net.optifine.gui; + +import java.io.IOException; +import java.util.List; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiVideoSettings; + +public class GuiScreenOF extends GuiScreen +{ + protected void actionPerformedRightClick(GuiButton button) throws IOException + { + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + + if (mouseButton == 1) + { + GuiButton guibutton = getSelectedButton(mouseX, mouseY, this.buttonList); + + if (guibutton != null && guibutton.enabled) + { + guibutton.playPressSound(this.mc.getSoundHandler()); + this.actionPerformedRightClick(guibutton); + } + } + } + + public static GuiButton getSelectedButton(int x, int y, List listButtons) + { + for (int i = 0; i < listButtons.size(); ++i) + { + GuiButton guibutton = (GuiButton)listButtons.get(i); + + if (guibutton.visible) + { + int j = GuiVideoSettings.getButtonWidth(guibutton); + int k = GuiVideoSettings.getButtonHeight(guibutton); + + if (x >= guibutton.xPosition && y >= guibutton.yPosition && x < guibutton.xPosition + j && y < guibutton.yPosition + k) + { + return guibutton; + } + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/IOptionControl.java b/Client-1.8.9/src/main/java/net/optifine/gui/IOptionControl.java new file mode 100644 index 0000000..7a04e8a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/IOptionControl.java @@ -0,0 +1,8 @@ +package net.optifine.gui; + +import net.minecraft.client.settings.GameSettings; + +public interface IOptionControl +{ + GameSettings.Options getOption(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/TooltipManager.java b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipManager.java new file mode 100644 index 0000000..c1ee739 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipManager.java @@ -0,0 +1,89 @@ +package net.optifine.gui; + +import java.awt.Rectangle; +import java.util.Arrays; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class TooltipManager +{ + private GuiScreen guiScreen; + private TooltipProvider tooltipProvider; + private int lastMouseX = 0; + private int lastMouseY = 0; + private long mouseStillTime = 0L; + + public TooltipManager(GuiScreen guiScreen, TooltipProvider tooltipProvider) + { + this.guiScreen = guiScreen; + this.tooltipProvider = tooltipProvider; + } + + public void drawTooltips(int x, int y, List buttonList) + { + if (Math.abs(x - this.lastMouseX) <= 5 && Math.abs(y - this.lastMouseY) <= 5) + { + int i = 700; + + if (System.currentTimeMillis() >= this.mouseStillTime + (long)i) + { + GuiButton guibutton = GuiScreenOF.getSelectedButton(x, y, buttonList); + + if (guibutton != null) + { + Rectangle rectangle = this.tooltipProvider.getTooltipBounds(this.guiScreen, x, y); + String[] astring = this.tooltipProvider.getTooltipLines(guibutton, rectangle.width); + + if (astring != null) + { + if (astring.length > 8) + { + astring = (String[])Arrays.copyOf(astring, 8); + astring[astring.length - 1] = astring[astring.length - 1] + " ..."; + } + + if (this.tooltipProvider.isRenderBorder()) + { + int j = -528449408; + this.drawRectBorder(rectangle.x, rectangle.y, rectangle.x + rectangle.width, rectangle.y + rectangle.height, j); + } + + Gui.drawRect(rectangle.x, rectangle.y, rectangle.x + rectangle.width, rectangle.y + rectangle.height, -536870912); + + for (int l = 0; l < astring.length; ++l) + { + String s = astring[l]; + int k = 14540253; + + if (s.endsWith("!")) + { + k = 16719904; + } + + FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj; + fontrenderer.drawStringWithShadow(s, (float)(rectangle.x + 5), (float)(rectangle.y + 5 + l * 11), k); + } + } + } + } + } + else + { + this.lastMouseX = x; + this.lastMouseY = y; + this.mouseStillTime = System.currentTimeMillis(); + } + } + + private void drawRectBorder(int x1, int y1, int x2, int y2, int col) + { + Gui.drawRect(x1, y1 - 1, x2, y1, col); + Gui.drawRect(x1, y2, x2, y2 + 1, col); + Gui.drawRect(x1 - 1, y1, x1, y2, col); + Gui.drawRect(x2, y1, x2 + 1, y2, col); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProvider.java b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProvider.java new file mode 100644 index 0000000..d315a8e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProvider.java @@ -0,0 +1,14 @@ +package net.optifine.gui; + +import java.awt.Rectangle; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public interface TooltipProvider +{ + Rectangle getTooltipBounds(GuiScreen var1, int var2, int var3); + + String[] getTooltipLines(GuiButton var1, int var2); + + boolean isRenderBorder(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderEnumShaderOptions.java b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderEnumShaderOptions.java new file mode 100644 index 0000000..f084fe0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderEnumShaderOptions.java @@ -0,0 +1,60 @@ +package net.optifine.gui; + +import java.awt.Rectangle; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.optifine.shaders.config.EnumShaderOption; +import net.optifine.shaders.gui.GuiButtonDownloadShaders; +import net.optifine.shaders.gui.GuiButtonEnumShaderOption; + +public class TooltipProviderEnumShaderOptions implements TooltipProvider +{ + public Rectangle getTooltipBounds(GuiScreen guiScreen, int x, int y) + { + int i = guiScreen.width - 450; + int j = 35; + + if (i < 10) + { + i = 10; + } + + if (y <= j + 94) + { + j += 100; + } + + int k = i + 150 + 150; + int l = j + 84 + 10; + return new Rectangle(i, j, k - i, l - j); + } + + public boolean isRenderBorder() + { + return true; + } + + public String[] getTooltipLines(GuiButton btn, int width) + { + if (btn instanceof GuiButtonDownloadShaders) + { + return TooltipProviderOptions.getTooltipLines("of.options.shaders.DOWNLOAD"); + } + else if (!(btn instanceof GuiButtonEnumShaderOption)) + { + return null; + } + else + { + GuiButtonEnumShaderOption guibuttonenumshaderoption = (GuiButtonEnumShaderOption)btn; + EnumShaderOption enumshaderoption = guibuttonenumshaderoption.getEnumShaderOption(); + String[] astring = this.getTooltipLines(enumshaderoption); + return astring; + } + } + + private String[] getTooltipLines(EnumShaderOption option) + { + return TooltipProviderOptions.getTooltipLines(option.getResourceKey()); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderOptions.java b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderOptions.java new file mode 100644 index 0000000..399ff23 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderOptions.java @@ -0,0 +1,75 @@ +package net.optifine.gui; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.settings.GameSettings; +import net.optifine.Lang; + +public class TooltipProviderOptions implements TooltipProvider +{ + public Rectangle getTooltipBounds(GuiScreen guiScreen, int x, int y) + { + int i = guiScreen.width / 2 - 150; + int j = guiScreen.height / 6 - 7; + + if (y <= j + 98) + { + j += 105; + } + + int k = i + 150 + 150; + int l = j + 84 + 10; + return new Rectangle(i, j, k - i, l - j); + } + + public boolean isRenderBorder() + { + return false; + } + + public String[] getTooltipLines(GuiButton btn, int width) + { + if (!(btn instanceof IOptionControl)) + { + return null; + } + else + { + IOptionControl ioptioncontrol = (IOptionControl)btn; + GameSettings.Options gamesettings$options = ioptioncontrol.getOption(); + String[] astring = getTooltipLines(gamesettings$options.getEnumString()); + return astring; + } + } + + public static String[] getTooltipLines(String key) + { + List list = new ArrayList(); + + for (int i = 0; i < 10; ++i) + { + String s = key + ".tooltip." + (i + 1); + String s1 = Lang.get(s, (String)null); + + if (s1 == null) + { + break; + } + + list.add(s1); + } + + if (list.size() <= 0) + { + return null; + } + else + { + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderShaderOptions.java b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderShaderOptions.java new file mode 100644 index 0000000..29ca3ee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/gui/TooltipProviderShaderOptions.java @@ -0,0 +1,126 @@ +package net.optifine.gui; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.optifine.Lang; +import net.optifine.shaders.config.ShaderOption; +import net.optifine.shaders.gui.GuiButtonShaderOption; +import net.optifine.util.StrUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class TooltipProviderShaderOptions extends TooltipProviderOptions +{ + public String[] getTooltipLines(GuiButton btn, int width) + { + if (!(btn instanceof GuiButtonShaderOption)) + { + return null; + } + else + { + GuiButtonShaderOption guibuttonshaderoption = (GuiButtonShaderOption)btn; + ShaderOption shaderoption = guibuttonshaderoption.getShaderOption(); + String[] astring = this.makeTooltipLines(shaderoption, width); + return astring; + } + } + + private String[] makeTooltipLines(ShaderOption so, int width) + { + String s = so.getNameText(); + String s1 = Config.normalize(so.getDescriptionText()).trim(); + String[] astring = this.splitDescription(s1); + GameSettings gamesettings = Config.getGameSettings(); + String s2 = null; + + if (!s.equals(so.getName()) && gamesettings.advancedItemTooltips) + { + s2 = "\u00a78" + Lang.get("of.general.id") + ": " + so.getName(); + } + + String s3 = null; + + if (so.getPaths() != null && gamesettings.advancedItemTooltips) + { + s3 = "\u00a78" + Lang.get("of.general.from") + ": " + Config.arrayToString((Object[])so.getPaths()); + } + + String s4 = null; + + if (so.getValueDefault() != null && gamesettings.advancedItemTooltips) + { + String s5 = so.isEnabled() ? so.getValueText(so.getValueDefault()) : Lang.get("of.general.ambiguous"); + s4 = "\u00a78" + Lang.getDefault() + ": " + s5; + } + + List list = new ArrayList(); + list.add(s); + list.addAll(Arrays.asList(astring)); + + if (s2 != null) + { + list.add(s2); + } + + if (s3 != null) + { + list.add(s3); + } + + if (s4 != null) + { + list.add(s4); + } + + String[] astring1 = this.makeTooltipLines(width, list); + return astring1; + } + + private String[] splitDescription(String desc) + { + if (desc.length() <= 0) + { + return new String[0]; + } + else + { + desc = StrUtils.removePrefix(desc, "//"); + String[] astring = desc.split("\\. "); + + for (int i = 0; i < astring.length; ++i) + { + astring[i] = "- " + astring[i].trim(); + astring[i] = StrUtils.removeSuffix(astring[i], "."); + } + + return astring; + } + } + + private String[] makeTooltipLines(int width, List args) + { + FontRenderer fontrenderer = Config.getMinecraft().fontRendererObj; + List list = new ArrayList(); + + for (int i = 0; i < args.size(); ++i) + { + String s = (String)args.get(i); + + if (s != null && s.length() > 0) + { + for (String s1 : fontrenderer.listFormattedStringToWidth(s, width)) + { + list.add(s1); + } + } + } + + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/FileDownloadThread.java b/Client-1.8.9/src/main/java/net/optifine/http/FileDownloadThread.java new file mode 100644 index 0000000..6876e9f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/FileDownloadThread.java @@ -0,0 +1,38 @@ +package net.optifine.http; + +import net.minecraft.client.Minecraft; + +public class FileDownloadThread extends Thread +{ + private String urlString = null; + private IFileDownloadListener listener = null; + + public FileDownloadThread(String urlString, IFileDownloadListener listener) + { + this.urlString = urlString; + this.listener = listener; + } + + public void run() + { + try + { + byte[] abyte = HttpPipeline.get(this.urlString, Minecraft.getMinecraft().getProxy()); + this.listener.fileDownloadFinished(this.urlString, abyte, (Throwable)null); + } + catch (Exception exception) + { + this.listener.fileDownloadFinished(this.urlString, (byte[])null, exception); + } + } + + public String getUrlString() + { + return this.urlString; + } + + public IFileDownloadListener getListener() + { + return this.listener; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/FileUploadThread.java b/Client-1.8.9/src/main/java/net/optifine/http/FileUploadThread.java new file mode 100644 index 0000000..b9742c7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/FileUploadThread.java @@ -0,0 +1,47 @@ +package net.optifine.http; + +import java.util.Map; + +public class FileUploadThread extends Thread +{ + private String urlString; + private Map headers; + private byte[] content; + private IFileUploadListener listener; + + public FileUploadThread(String urlString, Map headers, byte[] content, IFileUploadListener listener) + { + this.urlString = urlString; + this.headers = headers; + this.content = content; + this.listener = listener; + } + + public void run() + { + try + { + HttpUtils.post(this.urlString, this.headers, this.content); + this.listener.fileUploadFinished(this.urlString, this.content, (Throwable)null); + } + catch (Exception exception) + { + this.listener.fileUploadFinished(this.urlString, this.content, exception); + } + } + + public String getUrlString() + { + return this.urlString; + } + + public byte[] getContent() + { + return this.content; + } + + public IFileUploadListener getListener() + { + return this.listener; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpListener.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpListener.java new file mode 100644 index 0000000..0cb08f6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpListener.java @@ -0,0 +1,8 @@ +package net.optifine.http; + +public interface HttpListener +{ + void finished(HttpRequest var1, HttpResponse var2); + + void failed(HttpRequest var1, Exception var2); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpPipeline.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipeline.java new file mode 100644 index 0000000..6ce59e8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipeline.java @@ -0,0 +1,226 @@ +package net.optifine.http; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InterruptedIOException; +import java.net.Proxy; +import java.net.URL; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import net.minecraft.src.Config; + +public class HttpPipeline +{ + private static Map mapConnections = new HashMap(); + public static final String HEADER_USER_AGENT = "User-Agent"; + public static final String HEADER_HOST = "Host"; + public static final String HEADER_ACCEPT = "Accept"; + public static final String HEADER_LOCATION = "Location"; + public static final String HEADER_KEEP_ALIVE = "Keep-Alive"; + public static final String HEADER_CONNECTION = "Connection"; + public static final String HEADER_VALUE_KEEP_ALIVE = "keep-alive"; + public static final String HEADER_TRANSFER_ENCODING = "Transfer-Encoding"; + public static final String HEADER_VALUE_CHUNKED = "chunked"; + + public static void addRequest(String urlStr, HttpListener listener) throws IOException + { + addRequest(urlStr, listener, Proxy.NO_PROXY); + } + + public static void addRequest(String urlStr, HttpListener listener, Proxy proxy) throws IOException + { + HttpRequest httprequest = makeRequest(urlStr, proxy); + HttpPipelineRequest httppipelinerequest = new HttpPipelineRequest(httprequest, listener); + addRequest(httppipelinerequest); + } + + public static HttpRequest makeRequest(String urlStr, Proxy proxy) throws IOException + { + URL url = new URL(urlStr); + + if (!url.getProtocol().equals("http")) + { + throw new IOException("Only protocol http is supported: " + url); + } + else + { + String s = url.getFile(); + String s1 = url.getHost(); + int i = url.getPort(); + + if (i <= 0) + { + i = 80; + } + + String s2 = "GET"; + String s3 = "HTTP/1.1"; + Map map = new LinkedHashMap(); + map.put("User-Agent", "Java/" + System.getProperty("java.version")); + map.put("Host", s1); + map.put("Accept", "text/html, image/gif, image/png"); + map.put("Connection", "keep-alive"); + byte[] abyte = new byte[0]; + HttpRequest httprequest = new HttpRequest(s1, i, proxy, s2, s, s3, map, abyte); + return httprequest; + } + } + + public static void addRequest(HttpPipelineRequest pr) + { + HttpRequest httprequest = pr.getHttpRequest(); + + for (HttpPipelineConnection httppipelineconnection = getConnection(httprequest.getHost(), httprequest.getPort(), httprequest.getProxy()); !httppipelineconnection.addRequest(pr); httppipelineconnection = getConnection(httprequest.getHost(), httprequest.getPort(), httprequest.getProxy())) + { + removeConnection(httprequest.getHost(), httprequest.getPort(), httprequest.getProxy(), httppipelineconnection); + } + } + + private static synchronized HttpPipelineConnection getConnection(String host, int port, Proxy proxy) + { + String s = makeConnectionKey(host, port, proxy); + HttpPipelineConnection httppipelineconnection = (HttpPipelineConnection)mapConnections.get(s); + + if (httppipelineconnection == null) + { + httppipelineconnection = new HttpPipelineConnection(host, port, proxy); + mapConnections.put(s, httppipelineconnection); + } + + return httppipelineconnection; + } + + private static synchronized void removeConnection(String host, int port, Proxy proxy, HttpPipelineConnection hpc) + { + String s = makeConnectionKey(host, port, proxy); + HttpPipelineConnection httppipelineconnection = (HttpPipelineConnection)mapConnections.get(s); + + if (httppipelineconnection == hpc) + { + mapConnections.remove(s); + } + } + + private static String makeConnectionKey(String host, int port, Proxy proxy) + { + String s = host + ":" + port + "-" + proxy; + return s; + } + + public static byte[] get(String urlStr) throws IOException + { + return get(urlStr, Proxy.NO_PROXY); + } + + public static byte[] get(String urlStr, Proxy proxy) throws IOException + { + if (urlStr.startsWith("file:")) + { + URL url = new URL(urlStr); + InputStream inputstream = url.openStream(); + byte[] abyte = Config.readAll(inputstream); + return abyte; + } + else + { + HttpRequest httprequest = makeRequest(urlStr, proxy); + HttpResponse httpresponse = executeRequest(httprequest); + + if (httpresponse.getStatus() / 100 != 2) + { + throw new IOException("HTTP response: " + httpresponse.getStatus()); + } + else + { + return httpresponse.getBody(); + } + } + } + + public static HttpResponse executeRequest(HttpRequest req) throws IOException + { + final Map map = new HashMap(); + String s = "Response"; + String s1 = "Exception"; + HttpListener httplistener = new HttpListener() + { + public void finished(HttpRequest req, HttpResponse resp) + { + synchronized (map) + { + map.put("Response", resp); + map.notifyAll(); + } + } + public void failed(HttpRequest req, Exception e) + { + synchronized (map) + { + map.put("Exception", e); + map.notifyAll(); + } + } + }; + + synchronized (map) + { + HttpPipelineRequest httppipelinerequest = new HttpPipelineRequest(req, httplistener); + addRequest(httppipelinerequest); + + try + { + map.wait(); + } + catch (InterruptedException var10) + { + throw new InterruptedIOException("Interrupted"); + } + + Exception exception = (Exception)map.get("Exception"); + + if (exception != null) + { + if (exception instanceof IOException) + { + throw(IOException)exception; + } + else if (exception instanceof RuntimeException) + { + throw(RuntimeException)exception; + } + else + { + throw new RuntimeException(exception.getMessage(), exception); + } + } + else + { + HttpResponse httpresponse = (HttpResponse)map.get("Response"); + + if (httpresponse == null) + { + throw new IOException("Response is null"); + } + else + { + return httpresponse; + } + } + } + } + + public static boolean hasActiveRequests() + { + for (Object e: mapConnections.values()) + { + HttpPipelineConnection httppipelineconnection = (HttpPipelineConnection) e; + if (httppipelineconnection.hasActiveRequests()) + { + return true; + } + } + + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineConnection.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineConnection.java new file mode 100644 index 0000000..bbeecb9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineConnection.java @@ -0,0 +1,431 @@ +package net.optifine.http; + +import java.io.BufferedOutputStream; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Proxy; +import java.net.Socket; +import java.util.LinkedList; +import java.util.List; +import java.util.regex.Pattern; +import net.minecraft.src.Config; + +public class HttpPipelineConnection +{ + private String host; + private int port; + private Proxy proxy; + private List listRequests; + private List listRequestsSend; + private Socket socket; + private InputStream inputStream; + private OutputStream outputStream; + private HttpPipelineSender httpPipelineSender; + private HttpPipelineReceiver httpPipelineReceiver; + private int countRequests; + private boolean responseReceived; + private long keepaliveTimeoutMs; + private int keepaliveMaxCount; + private long timeLastActivityMs; + private boolean terminated; + private static final String LF = "\n"; + public static final int TIMEOUT_CONNECT_MS = 5000; + public static final int TIMEOUT_READ_MS = 5000; + private static final Pattern patternFullUrl = Pattern.compile("^[a-zA-Z]+://.*"); + + public HttpPipelineConnection(String host, int port) + { + this(host, port, Proxy.NO_PROXY); + } + + public HttpPipelineConnection(String host, int port, Proxy proxy) + { + this.host = null; + this.port = 0; + this.proxy = Proxy.NO_PROXY; + this.listRequests = new LinkedList(); + this.listRequestsSend = new LinkedList(); + this.socket = null; + this.inputStream = null; + this.outputStream = null; + this.httpPipelineSender = null; + this.httpPipelineReceiver = null; + this.countRequests = 0; + this.responseReceived = false; + this.keepaliveTimeoutMs = 5000L; + this.keepaliveMaxCount = 1000; + this.timeLastActivityMs = System.currentTimeMillis(); + this.terminated = false; + this.host = host; + this.port = port; + this.proxy = proxy; + this.httpPipelineSender = new HttpPipelineSender(this); + this.httpPipelineSender.start(); + this.httpPipelineReceiver = new HttpPipelineReceiver(this); + this.httpPipelineReceiver.start(); + } + + public synchronized boolean addRequest(HttpPipelineRequest pr) + { + if (this.isClosed()) + { + return false; + } + else + { + this.addRequest(pr, this.listRequests); + this.addRequest(pr, this.listRequestsSend); + ++this.countRequests; + return true; + } + } + + private void addRequest(HttpPipelineRequest pr, List list) + { + list.add(pr); + this.notifyAll(); + } + + public synchronized void setSocket(Socket s) throws IOException + { + if (!this.terminated) + { + if (this.socket != null) + { + throw new IllegalArgumentException("Already connected"); + } + else + { + this.socket = s; + this.socket.setTcpNoDelay(true); + this.inputStream = this.socket.getInputStream(); + this.outputStream = new BufferedOutputStream(this.socket.getOutputStream()); + this.onActivity(); + this.notifyAll(); + } + } + } + + public synchronized OutputStream getOutputStream() throws IOException, InterruptedException + { + while (this.outputStream == null) + { + this.checkTimeout(); + this.wait(1000L); + } + + return this.outputStream; + } + + public synchronized InputStream getInputStream() throws IOException, InterruptedException + { + while (this.inputStream == null) + { + this.checkTimeout(); + this.wait(1000L); + } + + return this.inputStream; + } + + public synchronized HttpPipelineRequest getNextRequestSend() throws InterruptedException, IOException + { + if (this.listRequestsSend.size() <= 0 && this.outputStream != null) + { + this.outputStream.flush(); + } + + return this.getNextRequest(this.listRequestsSend, true); + } + + public synchronized HttpPipelineRequest getNextRequestReceive() throws InterruptedException + { + return this.getNextRequest(this.listRequests, false); + } + + private HttpPipelineRequest getNextRequest(List list, boolean remove) throws InterruptedException + { + while (list.size() <= 0) + { + this.checkTimeout(); + this.wait(1000L); + } + + this.onActivity(); + + if (remove) + { + return (HttpPipelineRequest)list.remove(0); + } + else + { + return (HttpPipelineRequest)list.get(0); + } + } + + private void checkTimeout() + { + if (this.socket != null) + { + long i = this.keepaliveTimeoutMs; + + if (this.listRequests.size() > 0) + { + i = 5000L; + } + + long j = System.currentTimeMillis(); + + if (j > this.timeLastActivityMs + i) + { + this.terminate(new InterruptedException("Timeout " + i)); + } + } + } + + private void onActivity() + { + this.timeLastActivityMs = System.currentTimeMillis(); + } + + public synchronized void onRequestSent(HttpPipelineRequest pr) + { + if (!this.terminated) + { + this.onActivity(); + } + } + + public synchronized void onResponseReceived(HttpPipelineRequest pr, HttpResponse resp) + { + if (!this.terminated) + { + this.responseReceived = true; + this.onActivity(); + + if (this.listRequests.size() > 0 && this.listRequests.get(0) == pr) + { + this.listRequests.remove(0); + pr.setClosed(true); + String s = resp.getHeader("Location"); + + if (resp.getStatus() / 100 == 3 && s != null && pr.getHttpRequest().getRedirects() < 5) + { + try + { + s = this.normalizeUrl(s, pr.getHttpRequest()); + HttpRequest httprequest = HttpPipeline.makeRequest(s, pr.getHttpRequest().getProxy()); + httprequest.setRedirects(pr.getHttpRequest().getRedirects() + 1); + HttpPipelineRequest httppipelinerequest = new HttpPipelineRequest(httprequest, pr.getHttpListener()); + HttpPipeline.addRequest(httppipelinerequest); + } + catch (IOException ioexception) + { + pr.getHttpListener().failed(pr.getHttpRequest(), ioexception); + } + } + else + { + HttpListener httplistener = pr.getHttpListener(); + httplistener.finished(pr.getHttpRequest(), resp); + } + + this.checkResponseHeader(resp); + } + else + { + throw new IllegalArgumentException("Response out of order: " + pr); + } + } + } + + private String normalizeUrl(String url, HttpRequest hr) + { + if (patternFullUrl.matcher(url).matches()) + { + return url; + } + else if (url.startsWith("//")) + { + return "http:" + url; + } + else + { + String s = hr.getHost(); + + if (hr.getPort() != 80) + { + s = s + ":" + hr.getPort(); + } + + if (url.startsWith("/")) + { + return "http://" + s + url; + } + else + { + String s1 = hr.getFile(); + int i = s1.lastIndexOf("/"); + return i >= 0 ? "http://" + s + s1.substring(0, i + 1) + url : "http://" + s + "/" + url; + } + } + } + + private void checkResponseHeader(HttpResponse resp) + { + String s = resp.getHeader("Connection"); + + if (s != null && !s.toLowerCase().equals("keep-alive")) + { + this.terminate(new EOFException("Connection not keep-alive")); + } + + String s1 = resp.getHeader("Keep-Alive"); + + if (s1 != null) + { + String[] astring = Config.tokenize(s1, ",;"); + + for (int i = 0; i < astring.length; ++i) + { + String s2 = astring[i]; + String[] astring1 = this.split(s2, '='); + + if (astring1.length >= 2) + { + if (astring1[0].equals("timeout")) + { + int j = Config.parseInt(astring1[1], -1); + + if (j > 0) + { + this.keepaliveTimeoutMs = (long)(j * 1000); + } + } + + if (astring1[0].equals("max")) + { + int k = Config.parseInt(astring1[1], -1); + + if (k > 0) + { + this.keepaliveMaxCount = k; + } + } + } + } + } + } + + private String[] split(String str, char separator) + { + int i = str.indexOf(separator); + + if (i < 0) + { + return new String[] {str}; + } + else + { + String s = str.substring(0, i); + String s1 = str.substring(i + 1); + return new String[] {s, s1}; + } + } + + public synchronized void onExceptionSend(HttpPipelineRequest pr, Exception e) + { + this.terminate(e); + } + + public synchronized void onExceptionReceive(HttpPipelineRequest pr, Exception e) + { + this.terminate(e); + } + + private synchronized void terminate(Exception e) + { + if (!this.terminated) + { + this.terminated = true; + this.terminateRequests(e); + + if (this.httpPipelineSender != null) + { + this.httpPipelineSender.interrupt(); + } + + if (this.httpPipelineReceiver != null) + { + this.httpPipelineReceiver.interrupt(); + } + + try + { + if (this.socket != null) + { + this.socket.close(); + } + } + catch (IOException var3) + { + ; + } + + this.socket = null; + this.inputStream = null; + this.outputStream = null; + } + } + + private void terminateRequests(Exception e) + { + if (this.listRequests.size() > 0) + { + if (!this.responseReceived) + { + HttpPipelineRequest httppipelinerequest = (HttpPipelineRequest)this.listRequests.remove(0); + httppipelinerequest.getHttpListener().failed(httppipelinerequest.getHttpRequest(), e); + httppipelinerequest.setClosed(true); + } + + while (this.listRequests.size() > 0) + { + HttpPipelineRequest httppipelinerequest1 = (HttpPipelineRequest)this.listRequests.remove(0); + HttpPipeline.addRequest(httppipelinerequest1); + } + } + } + + public synchronized boolean isClosed() + { + return this.terminated ? true : this.countRequests >= this.keepaliveMaxCount; + } + + public int getCountRequests() + { + return this.countRequests; + } + + public synchronized boolean hasActiveRequests() + { + return this.listRequests.size() > 0; + } + + public String getHost() + { + return this.host; + } + + public int getPort() + { + return this.port; + } + + public Proxy getProxy() + { + return this.proxy; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineReceiver.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineReceiver.java new file mode 100644 index 0000000..61307f3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineReceiver.java @@ -0,0 +1,184 @@ +package net.optifine.http; + +import java.io.ByteArrayOutputStream; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.util.LinkedHashMap; +import java.util.Map; +import net.minecraft.src.Config; + +public class HttpPipelineReceiver extends Thread +{ + private HttpPipelineConnection httpPipelineConnection = null; + private static final Charset ASCII = Charset.forName("ASCII"); + private static final String HEADER_CONTENT_LENGTH = "Content-Length"; + private static final char CR = '\r'; + private static final char LF = '\n'; + + public HttpPipelineReceiver(HttpPipelineConnection httpPipelineConnection) + { + super("HttpPipelineReceiver"); + this.httpPipelineConnection = httpPipelineConnection; + } + + public void run() + { + while (!Thread.interrupted()) + { + HttpPipelineRequest httppipelinerequest = null; + + try + { + httppipelinerequest = this.httpPipelineConnection.getNextRequestReceive(); + InputStream inputstream = this.httpPipelineConnection.getInputStream(); + HttpResponse httpresponse = this.readResponse(inputstream); + this.httpPipelineConnection.onResponseReceived(httppipelinerequest, httpresponse); + } + catch (InterruptedException var4) + { + return; + } + catch (Exception exception) + { + this.httpPipelineConnection.onExceptionReceive(httppipelinerequest, exception); + } + } + } + + private HttpResponse readResponse(InputStream in) throws IOException + { + String s = this.readLine(in); + String[] astring = Config.tokenize(s, " "); + + if (astring.length < 3) + { + throw new IOException("Invalid status line: " + s); + } + else + { + String s1 = astring[0]; + int i = Config.parseInt(astring[1], 0); + String s2 = astring[2]; + Map map = new LinkedHashMap(); + + while (true) + { + String s3 = this.readLine(in); + + if (s3.length() <= 0) + { + byte[] abyte = null; + String s6 = (String)map.get("Content-Length"); + + if (s6 != null) + { + int k = Config.parseInt(s6, -1); + + if (k > 0) + { + abyte = new byte[k]; + this.readFull(abyte, in); + } + } + else + { + String s7 = (String)map.get("Transfer-Encoding"); + + if (Config.equals(s7, "chunked")) + { + abyte = this.readContentChunked(in); + } + } + + return new HttpResponse(i, s, map, abyte); + } + + int j = s3.indexOf(":"); + + if (j > 0) + { + String s4 = s3.substring(0, j).trim(); + String s5 = s3.substring(j + 1).trim(); + map.put(s4, s5); + } + } + } + } + + private byte[] readContentChunked(InputStream in) throws IOException + { + ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); + + while (true) + { + String s = this.readLine(in); + String[] astring = Config.tokenize(s, "; "); + int i = Integer.parseInt(astring[0], 16); + byte[] abyte = new byte[i]; + this.readFull(abyte, in); + bytearrayoutputstream.write(abyte); + this.readLine(in); + + if (i == 0) + { + break; + } + } + + return bytearrayoutputstream.toByteArray(); + } + + private void readFull(byte[] buf, InputStream in) throws IOException + { + int j; + + for (int i = 0; i < buf.length; i += j) + { + j = in.read(buf, i, buf.length - i); + + if (j < 0) + { + throw new EOFException(); + } + } + } + + private String readLine(InputStream in) throws IOException + { + ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); + int i = -1; + boolean flag = false; + + while (true) + { + int j = in.read(); + + if (j < 0) + { + break; + } + + bytearrayoutputstream.write(j); + + if (i == 13 && j == 10) + { + flag = true; + break; + } + + i = j; + } + + byte[] abyte = bytearrayoutputstream.toByteArray(); + String s = new String(abyte, ASCII); + + if (flag) + { + s = s.substring(0, s.length() - 2); + } + + return s; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineRequest.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineRequest.java new file mode 100644 index 0000000..41e4aee --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineRequest.java @@ -0,0 +1,34 @@ +package net.optifine.http; + +public class HttpPipelineRequest +{ + private HttpRequest httpRequest = null; + private HttpListener httpListener = null; + private boolean closed = false; + + public HttpPipelineRequest(HttpRequest httpRequest, HttpListener httpListener) + { + this.httpRequest = httpRequest; + this.httpListener = httpListener; + } + + public HttpRequest getHttpRequest() + { + return this.httpRequest; + } + + public HttpListener getHttpListener() + { + return this.httpListener; + } + + public boolean isClosed() + { + return this.closed; + } + + public void setClosed(boolean closed) + { + this.closed = closed; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineSender.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineSender.java new file mode 100644 index 0000000..7ddbf24 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpPipelineSender.java @@ -0,0 +1,79 @@ +package net.optifine.http; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.Socket; +import java.nio.charset.Charset; +import java.util.Map; + +public class HttpPipelineSender extends Thread +{ + private HttpPipelineConnection httpPipelineConnection = null; + private static final String CRLF = "\r\n"; + private static Charset ASCII = Charset.forName("ASCII"); + + public HttpPipelineSender(HttpPipelineConnection httpPipelineConnection) + { + super("HttpPipelineSender"); + this.httpPipelineConnection = httpPipelineConnection; + } + + public void run() + { + HttpPipelineRequest httppipelinerequest = null; + + try + { + this.connect(); + + while (!Thread.interrupted()) + { + httppipelinerequest = this.httpPipelineConnection.getNextRequestSend(); + HttpRequest httprequest = httppipelinerequest.getHttpRequest(); + OutputStream outputstream = this.httpPipelineConnection.getOutputStream(); + this.writeRequest(httprequest, outputstream); + this.httpPipelineConnection.onRequestSent(httppipelinerequest); + } + } + catch (InterruptedException var4) + { + return; + } + catch (Exception exception) + { + this.httpPipelineConnection.onExceptionSend(httppipelinerequest, exception); + } + } + + private void connect() throws IOException + { + String s = this.httpPipelineConnection.getHost(); + int i = this.httpPipelineConnection.getPort(); + Proxy proxy = this.httpPipelineConnection.getProxy(); + Socket socket = new Socket(proxy); + socket.connect(new InetSocketAddress(s, i), 5000); + this.httpPipelineConnection.setSocket(socket); + } + + private void writeRequest(HttpRequest req, OutputStream out) throws IOException + { + this.write(out, req.getMethod() + " " + req.getFile() + " " + req.getHttp() + "\r\n"); + Map map = req.getHeaders(); + + for (String s : map.keySet()) + { + String s1 = (String)req.getHeaders().get(s); + this.write(out, s + ": " + s1 + "\r\n"); + } + + this.write(out, "\r\n"); + } + + private void write(OutputStream out, String str) throws IOException + { + byte[] abyte = str.getBytes(ASCII); + out.write(abyte); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpRequest.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpRequest.java new file mode 100644 index 0000000..5e4d295 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpRequest.java @@ -0,0 +1,85 @@ +package net.optifine.http; + +import java.net.Proxy; +import java.util.LinkedHashMap; +import java.util.Map; + +public class HttpRequest +{ + private String host = null; + private int port = 0; + private Proxy proxy = Proxy.NO_PROXY; + private String method = null; + private String file = null; + private String http = null; + private Map headers = new LinkedHashMap(); + private byte[] body = null; + private int redirects = 0; + public static final String METHOD_GET = "GET"; + public static final String METHOD_HEAD = "HEAD"; + public static final String METHOD_POST = "POST"; + public static final String HTTP_1_0 = "HTTP/1.0"; + public static final String HTTP_1_1 = "HTTP/1.1"; + + public HttpRequest(String host, int port, Proxy proxy, String method, String file, String http, Map headers, byte[] body) + { + this.host = host; + this.port = port; + this.proxy = proxy; + this.method = method; + this.file = file; + this.http = http; + this.headers = headers; + this.body = body; + } + + public String getHost() + { + return this.host; + } + + public int getPort() + { + return this.port; + } + + public String getMethod() + { + return this.method; + } + + public String getFile() + { + return this.file; + } + + public String getHttp() + { + return this.http; + } + + public Map getHeaders() + { + return this.headers; + } + + public byte[] getBody() + { + return this.body; + } + + public int getRedirects() + { + return this.redirects; + } + + public void setRedirects(int redirects) + { + this.redirects = redirects; + } + + public Proxy getProxy() + { + return this.proxy; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpResponse.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpResponse.java new file mode 100644 index 0000000..0444d20 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpResponse.java @@ -0,0 +1,45 @@ +package net.optifine.http; + +import java.util.LinkedHashMap; +import java.util.Map; + +public class HttpResponse +{ + private int status = 0; + private String statusLine = null; + private Map headers = new LinkedHashMap(); + private byte[] body = null; + + public HttpResponse(int status, String statusLine, Map headers, byte[] body) + { + this.status = status; + this.statusLine = statusLine; + this.headers = headers; + this.body = body; + } + + public int getStatus() + { + return this.status; + } + + public String getStatusLine() + { + return this.statusLine; + } + + public Map getHeaders() + { + return this.headers; + } + + public String getHeader(String key) + { + return (String)this.headers.get(key); + } + + public byte[] getBody() + { + return this.body; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/HttpUtils.java b/Client-1.8.9/src/main/java/net/optifine/http/HttpUtils.java new file mode 100644 index 0000000..6f0bc6f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/HttpUtils.java @@ -0,0 +1,163 @@ +package net.optifine.http; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; + +public class HttpUtils +{ + private static String playerItemsUrl = null; + public static final String SERVER_URL = "http://s.optifine.net"; + public static final String POST_URL = "http://optifine.net"; + + public static byte[] get(String urlStr) throws IOException + { + HttpURLConnection httpurlconnection = null; + byte[] abyte1; + + try + { + URL url = new URL(urlStr); + httpurlconnection = (HttpURLConnection)url.openConnection(Minecraft.getMinecraft().getProxy()); + httpurlconnection.setDoInput(true); + httpurlconnection.setDoOutput(false); + httpurlconnection.connect(); + + if (httpurlconnection.getResponseCode() / 100 != 2) + { + if (httpurlconnection.getErrorStream() != null) + { + Config.readAll(httpurlconnection.getErrorStream()); + } + + throw new IOException("HTTP response: " + httpurlconnection.getResponseCode()); + } + + InputStream inputstream = httpurlconnection.getInputStream(); + byte[] abyte = new byte[httpurlconnection.getContentLength()]; + int i = 0; + + while (true) + { + int j = inputstream.read(abyte, i, abyte.length - i); + + if (j < 0) + { + throw new IOException("Input stream closed: " + urlStr); + } + + i += j; + + if (i >= abyte.length) + { + break; + } + } + + abyte1 = abyte; + } + finally + { + if (httpurlconnection != null) + { + httpurlconnection.disconnect(); + } + } + + return abyte1; + } + + public static String post(String urlStr, Map headers, byte[] content) throws IOException + { + HttpURLConnection httpurlconnection = null; + String s3; + + try + { + URL url = new URL(urlStr); + httpurlconnection = (HttpURLConnection)url.openConnection(Minecraft.getMinecraft().getProxy()); + httpurlconnection.setRequestMethod("POST"); + + if (headers != null) + { + for (Object e: headers.keySet()) + { + String s = (String) e; + String s1 = "" + headers.get(s); + httpurlconnection.setRequestProperty(s, s1); + } + } + + httpurlconnection.setRequestProperty("Content-Type", "text/plain"); + httpurlconnection.setRequestProperty("Content-Length", "" + content.length); + httpurlconnection.setRequestProperty("Content-Language", "en-US"); + httpurlconnection.setUseCaches(false); + httpurlconnection.setDoInput(true); + httpurlconnection.setDoOutput(true); + OutputStream outputstream = httpurlconnection.getOutputStream(); + outputstream.write(content); + outputstream.flush(); + outputstream.close(); + InputStream inputstream = httpurlconnection.getInputStream(); + InputStreamReader inputstreamreader = new InputStreamReader(inputstream, "ASCII"); + BufferedReader bufferedreader = new BufferedReader(inputstreamreader); + StringBuffer stringbuffer = new StringBuffer(); + String s2; + + while ((s2 = bufferedreader.readLine()) != null) + { + stringbuffer.append(s2); + stringbuffer.append('\r'); + } + + bufferedreader.close(); + s3 = stringbuffer.toString(); + } + finally + { + if (httpurlconnection != null) + { + httpurlconnection.disconnect(); + } + } + + return s3; + } + + public static synchronized String getPlayerItemsUrl() + { + if (playerItemsUrl == null) + { + try + { + boolean flag = Config.parseBoolean(System.getProperty("player.models.local"), false); + + if (flag) + { + File file1 = Minecraft.getMinecraft().mcDataDir; + File file2 = new File(file1, "playermodels"); + playerItemsUrl = file2.toURI().toURL().toExternalForm(); + } + } + catch (Exception exception) + { + Config.warn("" + exception.getClass().getName() + ": " + exception.getMessage()); + } + + if (playerItemsUrl == null) + { + playerItemsUrl = "http://s.optifine.net"; + } + } + + return playerItemsUrl; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/IFileDownloadListener.java b/Client-1.8.9/src/main/java/net/optifine/http/IFileDownloadListener.java new file mode 100644 index 0000000..b34039d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/IFileDownloadListener.java @@ -0,0 +1,6 @@ +package net.optifine.http; + +public interface IFileDownloadListener +{ + void fileDownloadFinished(String var1, byte[] var2, Throwable var3); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/http/IFileUploadListener.java b/Client-1.8.9/src/main/java/net/optifine/http/IFileUploadListener.java new file mode 100644 index 0000000..d28879b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/http/IFileUploadListener.java @@ -0,0 +1,6 @@ +package net.optifine.http; + +public interface IFileUploadListener +{ + void fileUploadFinished(String var1, byte[] var2, Throwable var3); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/model/BlockModelCustomizer.java b/Client-1.8.9/src/main/java/net/optifine/model/BlockModelCustomizer.java new file mode 100644 index 0000000..8160afa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/model/BlockModelCustomizer.java @@ -0,0 +1,115 @@ +package net.optifine.model; + +import com.google.common.collect.ImmutableList; +import java.util.List; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.world.IBlockAccess; +import net.optifine.BetterGrass; +import net.optifine.ConnectedTextures; +import net.optifine.NaturalTextures; +import net.optifine.SmartLeaves; +import net.optifine.render.RenderEnv; + +public class BlockModelCustomizer +{ + private static final List NO_QUADS = ImmutableList.of(); + + public static IBakedModel getRenderModel(IBakedModel modelIn, IBlockState stateIn, RenderEnv renderEnv) + { + if (renderEnv.isSmartLeaves()) + { + modelIn = SmartLeaves.getLeavesModel(modelIn, stateIn); + } + + return modelIn; + } + + public static List getRenderQuads(List quads, IBlockAccess worldIn, IBlockState stateIn, BlockPos posIn, EnumFacing enumfacing, EnumWorldBlockLayer layer, long rand, RenderEnv renderEnv) + { + if (enumfacing != null) + { + if (renderEnv.isSmartLeaves() && SmartLeaves.isSameLeaves(worldIn.getBlockState(posIn.offset(enumfacing)), stateIn)) + { + return NO_QUADS; + } + + if (!renderEnv.isBreakingAnimation(quads) && Config.isBetterGrass()) + { + quads = BetterGrass.getFaceQuads(worldIn, stateIn, posIn, enumfacing, quads); + } + } + + List list = renderEnv.getListQuadsCustomizer(); + list.clear(); + + for (int i = 0; i < quads.size(); ++i) + { + BakedQuad bakedquad = (BakedQuad)quads.get(i); + BakedQuad[] abakedquad = getRenderQuads(bakedquad, worldIn, stateIn, posIn, enumfacing, rand, renderEnv); + + if (i == 0 && quads.size() == 1 && abakedquad.length == 1 && abakedquad[0] == bakedquad && bakedquad.getQuadEmissive() == null) + { + return quads; + } + + for (int j = 0; j < abakedquad.length; ++j) + { + BakedQuad bakedquad1 = abakedquad[j]; + list.add(bakedquad1); + + if (bakedquad1.getQuadEmissive() != null) + { + renderEnv.getListQuadsOverlay(getEmissiveLayer(layer)).addQuad(bakedquad1.getQuadEmissive(), stateIn); + renderEnv.setOverlaysRendered(true); + } + } + } + + return list; + } + + private static EnumWorldBlockLayer getEmissiveLayer(EnumWorldBlockLayer layer) + { + return layer != null && layer != EnumWorldBlockLayer.SOLID ? layer : EnumWorldBlockLayer.CUTOUT_MIPPED; + } + + private static BakedQuad[] getRenderQuads(BakedQuad quad, IBlockAccess worldIn, IBlockState stateIn, BlockPos posIn, EnumFacing enumfacing, long rand, RenderEnv renderEnv) + { + if (renderEnv.isBreakingAnimation(quad)) + { + return renderEnv.getArrayQuadsCtm(quad); + } + else + { + BakedQuad bakedquad = quad; + + if (Config.isConnectedTextures()) + { + BakedQuad[] abakedquad = ConnectedTextures.getConnectedTexture(worldIn, stateIn, posIn, quad, renderEnv); + + if (abakedquad.length != 1 || abakedquad[0] != quad) + { + return abakedquad; + } + } + + if (Config.isNaturalTextures()) + { + quad = NaturalTextures.getNaturalTexture(posIn, quad); + + if (quad != bakedquad) + { + return renderEnv.getArrayQuadsCtm(quad); + } + } + + return renderEnv.getArrayQuadsCtm(quad); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/model/BlockModelUtils.java b/Client-1.8.9/src/main/java/net/optifine/model/BlockModelUtils.java new file mode 100644 index 0000000..4a51f37 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/model/BlockModelUtils.java @@ -0,0 +1,192 @@ +package net.optifine.model; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block.EnumOffsetType; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.BlockFaceUV; +import net.minecraft.client.renderer.block.model.BlockPartFace; +import net.minecraft.client.renderer.block.model.BlockPartRotation; +import net.minecraft.client.renderer.block.model.BreakingFour; +import net.minecraft.client.renderer.block.model.FaceBakery; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.resources.model.ModelRotation; +import net.minecraft.client.resources.model.SimpleBakedModel; +import net.minecraft.src.Config; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import org.lwjgl.util.vector.Vector3f; + +public class BlockModelUtils +{ + private static final float VERTEX_COORD_ACCURACY = 1.0E-6F; + + public static IBakedModel makeModelCube(String spriteName, int tintIndex) + { + TextureAtlasSprite textureatlassprite = Config.getMinecraft().getTextureMapBlocks().getAtlasSprite(spriteName); + return makeModelCube(textureatlassprite, tintIndex); + } + + public static IBakedModel makeModelCube(TextureAtlasSprite sprite, int tintIndex) + { + List list = new ArrayList(); + EnumFacing[] aenumfacing = EnumFacing.VALUES; + List> list1 = new ArrayList(); + + for (int i = 0; i < aenumfacing.length; ++i) + { + EnumFacing enumfacing = aenumfacing[i]; + List list2 = new ArrayList(); + list2.add(makeBakedQuad(enumfacing, sprite, tintIndex)); + list1.add(list2); + } + + IBakedModel ibakedmodel = new SimpleBakedModel(list, list1, true, true, sprite, ItemCameraTransforms.DEFAULT); + return ibakedmodel; + } + + public static IBakedModel joinModelsCube(IBakedModel modelBase, IBakedModel modelAdd) + { + List list = new ArrayList(); + list.addAll(modelBase.getGeneralQuads()); + list.addAll(modelAdd.getGeneralQuads()); + EnumFacing[] aenumfacing = EnumFacing.VALUES; + List list1 = new ArrayList(); + + for (int i = 0; i < aenumfacing.length; ++i) + { + EnumFacing enumfacing = aenumfacing[i]; + List list2 = new ArrayList(); + list2.addAll(modelBase.getFaceQuads(enumfacing)); + list2.addAll(modelAdd.getFaceQuads(enumfacing)); + list1.add(list2); + } + + boolean flag = modelBase.isAmbientOcclusion(); + boolean flag1 = modelBase.isBuiltInRenderer(); + TextureAtlasSprite textureatlassprite = modelBase.getParticleTexture(); + ItemCameraTransforms itemcameratransforms = modelBase.getItemCameraTransforms(); + IBakedModel ibakedmodel = new SimpleBakedModel(list, list1, flag, flag1, textureatlassprite, itemcameratransforms); + return ibakedmodel; + } + + public static BakedQuad makeBakedQuad(EnumFacing facing, TextureAtlasSprite sprite, int tintIndex) + { + Vector3f vector3f = new Vector3f(0.0F, 0.0F, 0.0F); + Vector3f vector3f1 = new Vector3f(16.0F, 16.0F, 16.0F); + BlockFaceUV blockfaceuv = new BlockFaceUV(new float[] {0.0F, 0.0F, 16.0F, 16.0F}, 0); + BlockPartFace blockpartface = new BlockPartFace(facing, tintIndex, "#" + facing.getName(), blockfaceuv); + ModelRotation modelrotation = ModelRotation.X0_Y0; + BlockPartRotation blockpartrotation = null; + boolean flag = false; + boolean flag1 = true; + FaceBakery facebakery = new FaceBakery(); + BakedQuad bakedquad = facebakery.makeBakedQuad(vector3f, vector3f1, blockpartface, sprite, facing, modelrotation, blockpartrotation, flag, flag1); + return bakedquad; + } + + public static IBakedModel makeModel(String modelName, String spriteOldName, String spriteNewName) + { + TextureMap texturemap = Config.getMinecraft().getTextureMapBlocks(); + TextureAtlasSprite textureatlassprite = texturemap.getSpriteSafe(spriteOldName); + TextureAtlasSprite textureatlassprite1 = texturemap.getSpriteSafe(spriteNewName); + return makeModel(modelName, textureatlassprite, textureatlassprite1); + } + + public static IBakedModel makeModel(String modelName, TextureAtlasSprite spriteOld, TextureAtlasSprite spriteNew) + { + if (spriteOld != null && spriteNew != null) + { + ModelManager modelmanager = Config.getModelManager(); + + if (modelmanager == null) + { + return null; + } + else + { + ModelResourceLocation modelresourcelocation = new ModelResourceLocation(modelName, "normal"); + IBakedModel ibakedmodel = modelmanager.getModel(modelresourcelocation); + + if (ibakedmodel != null && ibakedmodel != modelmanager.getMissingModel()) + { + IBakedModel ibakedmodel1 = ModelUtils.duplicateModel(ibakedmodel); + EnumFacing[] aenumfacing = EnumFacing.VALUES; + + for (int i = 0; i < aenumfacing.length; ++i) + { + EnumFacing enumfacing = aenumfacing[i]; + List list = ibakedmodel1.getFaceQuads(enumfacing); + replaceTexture(list, spriteOld, spriteNew); + } + + List list1 = ibakedmodel1.getGeneralQuads(); + replaceTexture(list1, spriteOld, spriteNew); + return ibakedmodel1; + } + else + { + return null; + } + } + } + else + { + return null; + } + } + + private static void replaceTexture(List quads, TextureAtlasSprite spriteOld, TextureAtlasSprite spriteNew) + { + List list = new ArrayList(); + + for (BakedQuad bakedquad : quads) + { + if (bakedquad.getSprite() == spriteOld) + { + bakedquad = new BreakingFour(bakedquad, spriteNew); + } + + list.add(bakedquad); + } + + quads.clear(); + quads.addAll(list); + } + + public static void snapVertexPosition(Vector3f pos) + { + pos.setX(snapVertexCoord(pos.getX())); + pos.setY(snapVertexCoord(pos.getY())); + pos.setZ(snapVertexCoord(pos.getZ())); + } + + private static float snapVertexCoord(float x) + { + return x > -1.0E-6F && x < 1.0E-6F ? 0.0F : (x > 0.999999F && x < 1.000001F ? 1.0F : x); + } + + public static AxisAlignedBB getOffsetBoundingBox(AxisAlignedBB aabb, EnumOffsetType offsetType, BlockPos pos) + { + int i = pos.getX(); + int j = pos.getZ(); + long k = (long)(i * 3129871) ^ (long)j * 116129781L; + k = k * k * 42317861L + k * 11L; + double d0 = ((double)((float)(k >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; + double d1 = ((double)((float)(k >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; + double d2 = 0.0D; + + if (offsetType == EnumOffsetType.XYZ) + { + d2 = ((double)((float)(k >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; + } + + return aabb.offset(d0, d2, d1); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/model/ListQuadsOverlay.java b/Client-1.8.9/src/main/java/net/optifine/model/ListQuadsOverlay.java new file mode 100644 index 0000000..fe3881b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/model/ListQuadsOverlay.java @@ -0,0 +1,51 @@ +package net.optifine.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.init.Blocks; + +public class ListQuadsOverlay +{ + private List listQuads = new ArrayList(); + private List listBlockStates = new ArrayList(); + private List listQuadsSingle = Arrays.asList(new BakedQuad[1]); + + public void addQuad(BakedQuad quad, IBlockState blockState) + { + if (quad != null) + { + this.listQuads.add(quad); + this.listBlockStates.add(blockState); + } + } + + public int size() + { + return this.listQuads.size(); + } + + public BakedQuad getQuad(int index) + { + return (BakedQuad)this.listQuads.get(index); + } + + public IBlockState getBlockState(int index) + { + return index >= 0 && index < this.listBlockStates.size() ? (IBlockState)this.listBlockStates.get(index) : Blocks.air.getDefaultState(); + } + + public List getListQuadsSingle(BakedQuad quad) + { + this.listQuadsSingle.set(0, quad); + return this.listQuadsSingle; + } + + public void clear() + { + this.listQuads.clear(); + this.listBlockStates.clear(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/model/ModelSprite.java b/Client-1.8.9/src/main/java/net/optifine/model/ModelSprite.java new file mode 100644 index 0000000..b341563 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/model/ModelSprite.java @@ -0,0 +1,157 @@ +package net.optifine.model; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelSprite +{ + private ModelRenderer modelRenderer = null; + private int textureOffsetX = 0; + private int textureOffsetY = 0; + private float posX = 0.0F; + private float posY = 0.0F; + private float posZ = 0.0F; + private int sizeX = 0; + private int sizeY = 0; + private int sizeZ = 0; + private float sizeAdd = 0.0F; + private float minU = 0.0F; + private float minV = 0.0F; + private float maxU = 0.0F; + private float maxV = 0.0F; + + public ModelSprite(ModelRenderer modelRenderer, int textureOffsetX, int textureOffsetY, float posX, float posY, float posZ, int sizeX, int sizeY, int sizeZ, float sizeAdd) + { + this.modelRenderer = modelRenderer; + this.textureOffsetX = textureOffsetX; + this.textureOffsetY = textureOffsetY; + this.posX = posX; + this.posY = posY; + this.posZ = posZ; + this.sizeX = sizeX; + this.sizeY = sizeY; + this.sizeZ = sizeZ; + this.sizeAdd = sizeAdd; + this.minU = (float)textureOffsetX / modelRenderer.textureWidth; + this.minV = (float)textureOffsetY / modelRenderer.textureHeight; + this.maxU = (float)(textureOffsetX + sizeX) / modelRenderer.textureWidth; + this.maxV = (float)(textureOffsetY + sizeY) / modelRenderer.textureHeight; + } + + public void render(Tessellator tessellator, float scale) + { + GlStateManager.translate(this.posX * scale, this.posY * scale, this.posZ * scale); + float f = this.minU; + float f1 = this.maxU; + float f2 = this.minV; + float f3 = this.maxV; + + if (this.modelRenderer.mirror) + { + f = this.maxU; + f1 = this.minU; + } + + if (this.modelRenderer.mirrorV) + { + f2 = this.maxV; + f3 = this.minV; + } + + renderItemIn2D(tessellator, f, f2, f1, f3, this.sizeX, this.sizeY, scale * (float)this.sizeZ, this.modelRenderer.textureWidth, this.modelRenderer.textureHeight); + GlStateManager.translate(-this.posX * scale, -this.posY * scale, -this.posZ * scale); + } + + public static void renderItemIn2D(Tessellator tess, float minU, float minV, float maxU, float maxV, int sizeX, int sizeY, float width, float texWidth, float texHeight) + { + if (width < 6.25E-4F) + { + width = 6.25E-4F; + } + + float f = maxU - minU; + float f1 = maxV - minV; + double d0 = (double)(MathHelper.abs(f) * (texWidth / 16.0F)); + double d1 = (double)(MathHelper.abs(f1) * (texHeight / 16.0F)); + WorldRenderer worldrenderer = tess.getWorldRenderer(); + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(0.0D, d1, 0.0D).tex((double)minU, (double)maxV).endVertex(); + worldrenderer.pos(d0, d1, 0.0D).tex((double)maxU, (double)maxV).endVertex(); + worldrenderer.pos(d0, 0.0D, 0.0D).tex((double)maxU, (double)minV).endVertex(); + worldrenderer.pos(0.0D, 0.0D, 0.0D).tex((double)minU, (double)minV).endVertex(); + tess.draw(); + GL11.glNormal3f(0.0F, 0.0F, 1.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(0.0D, 0.0D, (double)width).tex((double)minU, (double)minV).endVertex(); + worldrenderer.pos(d0, 0.0D, (double)width).tex((double)maxU, (double)minV).endVertex(); + worldrenderer.pos(d0, d1, (double)width).tex((double)maxU, (double)maxV).endVertex(); + worldrenderer.pos(0.0D, d1, (double)width).tex((double)minU, (double)maxV).endVertex(); + tess.draw(); + float f2 = 0.5F * f / (float)sizeX; + float f3 = 0.5F * f1 / (float)sizeY; + GL11.glNormal3f(-1.0F, 0.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + + for (int i = 0; i < sizeX; ++i) + { + float f4 = (float)i / (float)sizeX; + float f5 = minU + f * f4 + f2; + worldrenderer.pos((double)f4 * d0, d1, (double)width).tex((double)f5, (double)maxV).endVertex(); + worldrenderer.pos((double)f4 * d0, d1, 0.0D).tex((double)f5, (double)maxV).endVertex(); + worldrenderer.pos((double)f4 * d0, 0.0D, 0.0D).tex((double)f5, (double)minV).endVertex(); + worldrenderer.pos((double)f4 * d0, 0.0D, (double)width).tex((double)f5, (double)minV).endVertex(); + } + + tess.draw(); + GL11.glNormal3f(1.0F, 0.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + + for (int j = 0; j < sizeX; ++j) + { + float f7 = (float)j / (float)sizeX; + float f10 = minU + f * f7 + f2; + float f6 = f7 + 1.0F / (float)sizeX; + worldrenderer.pos((double)f6 * d0, 0.0D, (double)width).tex((double)f10, (double)minV).endVertex(); + worldrenderer.pos((double)f6 * d0, 0.0D, 0.0D).tex((double)f10, (double)minV).endVertex(); + worldrenderer.pos((double)f6 * d0, d1, 0.0D).tex((double)f10, (double)maxV).endVertex(); + worldrenderer.pos((double)f6 * d0, d1, (double)width).tex((double)f10, (double)maxV).endVertex(); + } + + tess.draw(); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + + for (int k = 0; k < sizeY; ++k) + { + float f8 = (float)k / (float)sizeY; + float f11 = minV + f1 * f8 + f3; + float f13 = f8 + 1.0F / (float)sizeY; + worldrenderer.pos(0.0D, (double)f13 * d1, (double)width).tex((double)minU, (double)f11).endVertex(); + worldrenderer.pos(d0, (double)f13 * d1, (double)width).tex((double)maxU, (double)f11).endVertex(); + worldrenderer.pos(d0, (double)f13 * d1, 0.0D).tex((double)maxU, (double)f11).endVertex(); + worldrenderer.pos(0.0D, (double)f13 * d1, 0.0D).tex((double)minU, (double)f11).endVertex(); + } + + tess.draw(); + GL11.glNormal3f(0.0F, -1.0F, 0.0F); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + + for (int l = 0; l < sizeY; ++l) + { + float f9 = (float)l / (float)sizeY; + float f12 = minV + f1 * f9 + f3; + worldrenderer.pos(d0, (double)f9 * d1, (double)width).tex((double)maxU, (double)f12).endVertex(); + worldrenderer.pos(0.0D, (double)f9 * d1, (double)width).tex((double)minU, (double)f12).endVertex(); + worldrenderer.pos(0.0D, (double)f9 * d1, 0.0D).tex((double)minU, (double)f12).endVertex(); + worldrenderer.pos(d0, (double)f9 * d1, 0.0D).tex((double)maxU, (double)f12).endVertex(); + } + + tess.draw(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/model/ModelUtils.java b/Client-1.8.9/src/main/java/net/optifine/model/ModelUtils.java new file mode 100644 index 0000000..ddc8679 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/model/ModelUtils.java @@ -0,0 +1,102 @@ +package net.optifine.model; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.resources.model.SimpleBakedModel; +import net.minecraft.src.Config; +import net.minecraft.util.EnumFacing; + +public class ModelUtils +{ + public static void dbgModel(IBakedModel model) + { + if (model != null) + { + Config.dbg("Model: " + model + ", ao: " + model.isAmbientOcclusion() + ", gui3d: " + model.isGui3d() + ", builtIn: " + model.isBuiltInRenderer() + ", particle: " + model.getParticleTexture()); + EnumFacing[] aenumfacing = EnumFacing.VALUES; + + for (int i = 0; i < aenumfacing.length; ++i) + { + EnumFacing enumfacing = aenumfacing[i]; + List list = model.getFaceQuads(enumfacing); + dbgQuads(enumfacing.getName(), list, " "); + } + + List list1 = model.getGeneralQuads(); + dbgQuads("General", list1, " "); + } + } + + private static void dbgQuads(String name, List quads, String prefix) + { + for (Object bakedquad0 : quads) + { + BakedQuad bakedQuad = (BakedQuad) bakedquad0; + dbgQuad(name, bakedQuad, prefix); + } + } + + public static void dbgQuad(String name, BakedQuad quad, String prefix) + { + Config.dbg(prefix + "Quad: " + quad.getClass().getName() + ", type: " + name + ", face: " + quad.getFace() + ", tint: " + quad.getTintIndex() + ", sprite: " + quad.getSprite()); + dbgVertexData(quad.getVertexData(), " " + prefix); + } + + public static void dbgVertexData(int[] vd, String prefix) + { + int i = vd.length / 4; + Config.dbg(prefix + "Length: " + vd.length + ", step: " + i); + + for (int j = 0; j < 4; ++j) + { + int k = j * i; + float f = Float.intBitsToFloat(vd[k + 0]); + float f1 = Float.intBitsToFloat(vd[k + 1]); + float f2 = Float.intBitsToFloat(vd[k + 2]); + int l = vd[k + 3]; + float f3 = Float.intBitsToFloat(vd[k + 4]); + float f4 = Float.intBitsToFloat(vd[k + 5]); + Config.dbg(prefix + j + " xyz: " + f + "," + f1 + "," + f2 + " col: " + l + " u,v: " + f3 + "," + f4); + } + } + + public static IBakedModel duplicateModel(IBakedModel model) + { + List list = duplicateQuadList(model.getGeneralQuads()); + EnumFacing[] aenumfacing = EnumFacing.VALUES; + List list1 = new ArrayList(); + + for (int i = 0; i < aenumfacing.length; ++i) + { + EnumFacing enumfacing = aenumfacing[i]; + List list2 = model.getFaceQuads(enumfacing); + List list3 = duplicateQuadList(list2); + list1.add(list3); + } + + SimpleBakedModel simplebakedmodel = new SimpleBakedModel(list, list1, model.isAmbientOcclusion(), model.isGui3d(), model.getParticleTexture(), model.getItemCameraTransforms()); + return simplebakedmodel; + } + + public static List duplicateQuadList(List lists) + { + List list = new ArrayList(); + + for (Object e : lists) + { + BakedQuad bakedquad = (BakedQuad) e; + BakedQuad bakedquad1 = duplicateQuad(bakedquad); + list.add(bakedquad1); + } + + return list; + } + + public static BakedQuad duplicateQuad(BakedQuad quad) + { + BakedQuad bakedquad = new BakedQuad((int[])quad.getVertexData().clone(), quad.getTintIndex(), quad.getFace(), quad.getSprite()); + return bakedquad; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/model/QuadBounds.java b/Client-1.8.9/src/main/java/net/optifine/model/QuadBounds.java new file mode 100644 index 0000000..a6335d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/model/QuadBounds.java @@ -0,0 +1,177 @@ +package net.optifine.model; + +import net.minecraft.util.EnumFacing; + +public class QuadBounds +{ + private float minX = Float.MAX_VALUE; + private float minY = Float.MAX_VALUE; + private float minZ = Float.MAX_VALUE; + private float maxX = -3.4028235E38F; + private float maxY = -3.4028235E38F; + private float maxZ = -3.4028235E38F; + + public QuadBounds(int[] vertexData) + { + int i = vertexData.length / 4; + + for (int j = 0; j < 4; ++j) + { + int k = j * i; + float f = Float.intBitsToFloat(vertexData[k + 0]); + float f1 = Float.intBitsToFloat(vertexData[k + 1]); + float f2 = Float.intBitsToFloat(vertexData[k + 2]); + + if (this.minX > f) + { + this.minX = f; + } + + if (this.minY > f1) + { + this.minY = f1; + } + + if (this.minZ > f2) + { + this.minZ = f2; + } + + if (this.maxX < f) + { + this.maxX = f; + } + + if (this.maxY < f1) + { + this.maxY = f1; + } + + if (this.maxZ < f2) + { + this.maxZ = f2; + } + } + } + + public float getMinX() + { + return this.minX; + } + + public float getMinY() + { + return this.minY; + } + + public float getMinZ() + { + return this.minZ; + } + + public float getMaxX() + { + return this.maxX; + } + + public float getMaxY() + { + return this.maxY; + } + + public float getMaxZ() + { + return this.maxZ; + } + + public boolean isFaceQuad(EnumFacing face) + { + float f; + float f1; + float f2; + + switch (face) + { + case DOWN: + f = this.getMinY(); + f1 = this.getMaxY(); + f2 = 0.0F; + break; + + case UP: + f = this.getMinY(); + f1 = this.getMaxY(); + f2 = 1.0F; + break; + + case NORTH: + f = this.getMinZ(); + f1 = this.getMaxZ(); + f2 = 0.0F; + break; + + case SOUTH: + f = this.getMinZ(); + f1 = this.getMaxZ(); + f2 = 1.0F; + break; + + case WEST: + f = this.getMinX(); + f1 = this.getMaxX(); + f2 = 0.0F; + break; + + case EAST: + f = this.getMinX(); + f1 = this.getMaxX(); + f2 = 1.0F; + break; + + default: + return false; + } + + return f == f2 && f1 == f2; + } + + public boolean isFullQuad(EnumFacing face) + { + float f; + float f1; + float f2; + float f3; + + switch (face) + { + case DOWN: + case UP: + f = this.getMinX(); + f1 = this.getMaxX(); + f2 = this.getMinZ(); + f3 = this.getMaxZ(); + break; + + case NORTH: + case SOUTH: + f = this.getMinX(); + f1 = this.getMaxX(); + f2 = this.getMinY(); + f3 = this.getMaxY(); + break; + + case WEST: + case EAST: + f = this.getMinY(); + f1 = this.getMaxY(); + f2 = this.getMinZ(); + f3 = this.getMaxZ(); + break; + + default: + return false; + } + + return f == 0.0F && f1 == 1.0F && f2 == 0.0F && f3 == 1.0F; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/override/ChunkCacheOF.java b/Client-1.8.9/src/main/java/net/optifine/override/ChunkCacheOF.java new file mode 100644 index 0000000..2f1a918 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/override/ChunkCacheOF.java @@ -0,0 +1,192 @@ +package net.optifine.override; + +import java.util.Arrays; +import net.minecraft.block.state.IBlockState; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.DynamicLights; +import net.optifine.reflect.Reflector; +import net.optifine.util.ArrayCache; + +public class ChunkCacheOF implements IBlockAccess +{ + private final ChunkCache chunkCache; + private final int posX; + private final int posY; + private final int posZ; + private final int sizeX; + private final int sizeY; + private final int sizeZ; + private final int sizeXY; + private int[] combinedLights; + private IBlockState[] blockStates; + private final int arraySize; + private final boolean dynamicLights = Config.isDynamicLights(); + private static final ArrayCache cacheCombinedLights = new ArrayCache(Integer.TYPE, 16); + private static final ArrayCache cacheBlockStates = new ArrayCache(IBlockState.class, 16); + + public ChunkCacheOF(ChunkCache chunkCache, BlockPos posFromIn, BlockPos posToIn, int subIn) + { + this.chunkCache = chunkCache; + int i = posFromIn.getX() - subIn >> 4; + int j = posFromIn.getY() - subIn >> 4; + int k = posFromIn.getZ() - subIn >> 4; + int l = posToIn.getX() + subIn >> 4; + int i1 = posToIn.getY() + subIn >> 4; + int j1 = posToIn.getZ() + subIn >> 4; + this.sizeX = l - i + 1 << 4; + this.sizeY = i1 - j + 1 << 4; + this.sizeZ = j1 - k + 1 << 4; + this.sizeXY = this.sizeX * this.sizeY; + this.arraySize = this.sizeX * this.sizeY * this.sizeZ; + this.posX = i << 4; + this.posY = j << 4; + this.posZ = k << 4; + } + + private int getPositionIndex(BlockPos pos) + { + int i = pos.getX() - this.posX; + + if (i >= 0 && i < this.sizeX) + { + int j = pos.getY() - this.posY; + + if (j >= 0 && j < this.sizeY) + { + int k = pos.getZ() - this.posZ; + return k >= 0 && k < this.sizeZ ? k * this.sizeXY + j * this.sizeX + i : -1; + } + else + { + return -1; + } + } + else + { + return -1; + } + } + + public int getCombinedLight(BlockPos pos, int lightValue) + { + int i = this.getPositionIndex(pos); + + if (i >= 0 && i < this.arraySize && this.combinedLights != null) + { + int j = this.combinedLights[i]; + + if (j == -1) + { + j = this.getCombinedLightRaw(pos, lightValue); + this.combinedLights[i] = j; + } + + return j; + } + else + { + return this.getCombinedLightRaw(pos, lightValue); + } + } + + private int getCombinedLightRaw(BlockPos pos, int lightValue) + { + int i = this.chunkCache.getCombinedLight(pos, lightValue); + + if (this.dynamicLights && !this.getBlockState(pos).getBlock().isOpaqueCube()) + { + i = DynamicLights.getCombinedLight(pos, i); + } + + return i; + } + + public IBlockState getBlockState(BlockPos pos) + { + int i = this.getPositionIndex(pos); + + if (i >= 0 && i < this.arraySize && this.blockStates != null) + { + IBlockState iblockstate = this.blockStates[i]; + + if (iblockstate == null) + { + iblockstate = this.chunkCache.getBlockState(pos); + this.blockStates[i] = iblockstate; + } + + return iblockstate; + } + else + { + return this.chunkCache.getBlockState(pos); + } + } + + public void renderStart() + { + if (this.combinedLights == null) + { + this.combinedLights = (int[])((int[])cacheCombinedLights.allocate(this.arraySize)); + } + + Arrays.fill((int[])this.combinedLights, (int) - 1); + + if (this.blockStates == null) + { + this.blockStates = (IBlockState[])((IBlockState[])cacheBlockStates.allocate(this.arraySize)); + } + + Arrays.fill(this.blockStates, (Object)null); + } + + public void renderFinish() + { + cacheCombinedLights.free(this.combinedLights); + this.combinedLights = null; + cacheBlockStates.free(this.blockStates); + this.blockStates = null; + } + + public boolean extendedLevelsInChunkCache() + { + return this.chunkCache.extendedLevelsInChunkCache(); + } + + public BiomeGenBase getBiomeGenForCoords(BlockPos pos) + { + return this.chunkCache.getBiomeGenForCoords(pos); + } + + public int getStrongPower(BlockPos pos, EnumFacing direction) + { + return this.chunkCache.getStrongPower(pos, direction); + } + + public TileEntity getTileEntity(BlockPos pos) + { + return this.chunkCache.getTileEntity(pos); + } + + public WorldType getWorldType() + { + return this.chunkCache.getWorldType(); + } + + public boolean isAirBlock(BlockPos pos) + { + return this.chunkCache.isAirBlock(pos); + } + + public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) + { + return Reflector.callBoolean(this.chunkCache, Reflector.ForgeChunkCache_isSideSolid, new Object[] {pos, side, Boolean.valueOf(_default)}); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/override/PlayerControllerOF.java b/Client-1.8.9/src/main/java/net/optifine/override/PlayerControllerOF.java new file mode 100644 index 0000000..2884fbb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/override/PlayerControllerOF.java @@ -0,0 +1,89 @@ +package net.optifine.override; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class PlayerControllerOF extends PlayerControllerMP +{ + private boolean acting = false; + private BlockPos lastClickBlockPos = null; + private Entity lastClickEntity = null; + + public PlayerControllerOF(Minecraft mcIn, NetHandlerPlayClient netHandler) + { + super(mcIn, netHandler); + } + + public boolean clickBlock(BlockPos loc, EnumFacing face) + { + this.acting = true; + this.lastClickBlockPos = loc; + boolean flag = super.clickBlock(loc, face); + this.acting = false; + return flag; + } + + public boolean onPlayerDamageBlock(BlockPos posBlock, EnumFacing directionFacing) + { + this.acting = true; + this.lastClickBlockPos = posBlock; + boolean flag = super.onPlayerDamageBlock(posBlock, directionFacing); + this.acting = false; + return flag; + } + + public boolean sendUseItem(EntityPlayer player, World worldIn, ItemStack stack) + { + this.acting = true; + boolean flag = super.sendUseItem(player, worldIn, stack); + this.acting = false; + return flag; + } + + public boolean onPlayerRightClick(EntityPlayerSP p_178890_1, WorldClient p_178890_2, ItemStack p_178890_3, BlockPos p_178890_4, EnumFacing p_178890_5, Vec3 p_178890_6) + { + this.acting = true; + this.lastClickBlockPos = p_178890_4; + boolean flag = super.onPlayerRightClick(p_178890_1, p_178890_2, p_178890_3, p_178890_4, p_178890_5, p_178890_6); + this.acting = false; + return flag; + } + + public boolean interactWithEntitySendPacket(EntityPlayer player, Entity target) + { + this.lastClickEntity = target; + return super.interactWithEntitySendPacket(player, target); + } + + public boolean isPlayerRightClickingOnEntity(EntityPlayer player, Entity target, MovingObjectPosition ray) + { + this.lastClickEntity = target; + return super.isPlayerRightClickingOnEntity(player, target, ray); + } + + public boolean isActing() + { + return this.acting; + } + + public BlockPos getLastClickBlockPos() + { + return this.lastClickBlockPos; + } + + public Entity getLastClickEntity() + { + return this.lastClickEntity; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/CapeImageBuffer.java b/Client-1.8.9/src/main/java/net/optifine/player/CapeImageBuffer.java new file mode 100644 index 0000000..56b2d70 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/CapeImageBuffer.java @@ -0,0 +1,47 @@ +package net.optifine.player; + +import java.awt.image.BufferedImage; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.util.ResourceLocation; + +public class CapeImageBuffer extends ImageBufferDownload +{ + private AbstractClientPlayer player; + private ResourceLocation resourceLocation; + private boolean elytraOfCape; + + public CapeImageBuffer(AbstractClientPlayer player, ResourceLocation resourceLocation) + { + this.player = player; + this.resourceLocation = resourceLocation; + } + + public BufferedImage parseUserSkin(BufferedImage imageRaw) + { + BufferedImage bufferedimage = CapeUtils.parseCape(imageRaw); + this.elytraOfCape = CapeUtils.isElytraCape(imageRaw, bufferedimage); + return bufferedimage; + } + + public void skinAvailable() + { + if (this.player != null) + { + this.player.setLocationOfCape(this.resourceLocation); + this.player.setElytraOfCape(this.elytraOfCape); + } + + this.cleanup(); + } + + public void cleanup() + { + this.player = null; + } + + public boolean isElytraOfCape() + { + return this.elytraOfCape; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/CapeUtils.java b/Client-1.8.9/src/main/java/net/optifine/player/CapeUtils.java new file mode 100644 index 0000000..e8f3731 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/CapeUtils.java @@ -0,0 +1,101 @@ +package net.optifine.player; + +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.File; +import java.util.regex.Pattern; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class CapeUtils +{ + private static final Pattern PATTERN_USERNAME = Pattern.compile("[a-zA-Z0-9_]+"); + + public static void downloadCape(AbstractClientPlayer player) + { + String s = player.getNameClear(); + + if (s != null && !s.isEmpty() && !s.contains("\u0000") && PATTERN_USERNAME.matcher(s).matches()) + { + String s1 = "http://s.optifine.net/capes/" + s + ".png"; + ResourceLocation resourcelocation = new ResourceLocation("capeof/" + s); + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + ITextureObject itextureobject = texturemanager.getTexture(resourcelocation); + + if (itextureobject != null && itextureobject instanceof ThreadDownloadImageData) + { + ThreadDownloadImageData threaddownloadimagedata = (ThreadDownloadImageData)itextureobject; + + if (threaddownloadimagedata.imageFound != null) + { + if (threaddownloadimagedata.imageFound.booleanValue()) + { + player.setLocationOfCape(resourcelocation); + + if (threaddownloadimagedata.getImageBuffer() instanceof CapeImageBuffer) + { + CapeImageBuffer capeimagebuffer1 = (CapeImageBuffer)threaddownloadimagedata.getImageBuffer(); + player.setElytraOfCape(capeimagebuffer1.isElytraOfCape()); + } + } + + return; + } + } + + CapeImageBuffer capeimagebuffer = new CapeImageBuffer(player, resourcelocation); + ThreadDownloadImageData threaddownloadimagedata1 = new ThreadDownloadImageData((File)null, s1, (ResourceLocation)null, capeimagebuffer); + threaddownloadimagedata1.pipeline = true; + texturemanager.loadTexture(resourcelocation, threaddownloadimagedata1); + } + } + + public static BufferedImage parseCape(BufferedImage img) + { + int i = 64; + int j = 32; + int k = img.getWidth(); + + for (int l = img.getHeight(); i < k || j < l; j *= 2) + { + i *= 2; + } + + BufferedImage bufferedimage = new BufferedImage(i, j, 2); + Graphics graphics = bufferedimage.getGraphics(); + graphics.drawImage(img, 0, 0, (ImageObserver)null); + graphics.dispose(); + return bufferedimage; + } + + public static boolean isElytraCape(BufferedImage imageRaw, BufferedImage imageFixed) + { + return imageRaw.getWidth() > imageFixed.getHeight(); + } + + public static void reloadCape(AbstractClientPlayer player) + { + String s = player.getNameClear(); + ResourceLocation resourcelocation = new ResourceLocation("capeof/" + s); + TextureManager texturemanager = Config.getTextureManager(); + ITextureObject itextureobject = texturemanager.getTexture(resourcelocation); + + if (itextureobject instanceof SimpleTexture) + { + SimpleTexture simpletexture = (SimpleTexture)itextureobject; + simpletexture.deleteGlTexture(); + texturemanager.deleteTexture(resourcelocation); + } + + player.setLocationOfCape((ResourceLocation)null); + player.setElytraOfCape(false); + downloadCape(player); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/ModelPlayerItem.java b/Client-1.8.9/src/main/java/net/optifine/player/ModelPlayerItem.java new file mode 100644 index 0000000..9191b11 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/ModelPlayerItem.java @@ -0,0 +1,11 @@ +package net.optifine.player; + +import net.minecraft.client.model.ModelBase; + +public class ModelPlayerItem extends ModelBase +{ + public ModelPlayerItem() + { + this.isChild = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfiguration.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfiguration.java new file mode 100644 index 0000000..b0f4e3a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfiguration.java @@ -0,0 +1,43 @@ +package net.optifine.player; + +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.src.Config; + +public class PlayerConfiguration +{ + private PlayerItemModel[] playerItemModels = new PlayerItemModel[0]; + private boolean initialized = false; + + public void renderPlayerItems(ModelBiped modelBiped, AbstractClientPlayer player, float scale, float partialTicks) + { + if (this.initialized) + { + for (int i = 0; i < this.playerItemModels.length; ++i) + { + PlayerItemModel playeritemmodel = this.playerItemModels[i]; + playeritemmodel.render(modelBiped, player, scale, partialTicks); + } + } + } + + public boolean isInitialized() + { + return this.initialized; + } + + public void setInitialized(boolean initialized) + { + this.initialized = initialized; + } + + public PlayerItemModel[] getPlayerItemModels() + { + return this.playerItemModels; + } + + public void addPlayerItemModel(PlayerItemModel playerItemModel) + { + this.playerItemModels = (PlayerItemModel[])((PlayerItemModel[])Config.addObjectToArray(this.playerItemModels, playerItemModel)); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurationParser.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurationParser.java new file mode 100644 index 0000000..5e00959 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurationParser.java @@ -0,0 +1,140 @@ +package net.optifine.player; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.http.HttpPipeline; +import net.optifine.http.HttpUtils; +import net.optifine.util.Json; + +public class PlayerConfigurationParser +{ + private String player = null; + public static final String CONFIG_ITEMS = "items"; + public static final String ITEM_TYPE = "type"; + public static final String ITEM_ACTIVE = "active"; + + public PlayerConfigurationParser(String player) + { + this.player = player; + } + + public PlayerConfiguration parsePlayerConfiguration(JsonElement je) + { + if (je == null) + { + throw new JsonParseException("JSON object is null, player: " + this.player); + } + else + { + JsonObject jsonobject = (JsonObject)je; + PlayerConfiguration playerconfiguration = new PlayerConfiguration(); + JsonArray jsonarray = (JsonArray)jsonobject.get("items"); + + if (jsonarray != null) + { + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonObject jsonobject1 = (JsonObject)jsonarray.get(i); + boolean flag = Json.getBoolean(jsonobject1, "active", true); + + if (flag) + { + String s = Json.getString(jsonobject1, "type"); + + if (s == null) + { + Config.warn("Item type is null, player: " + this.player); + } + else + { + String s1 = Json.getString(jsonobject1, "model"); + + if (s1 == null) + { + s1 = "items/" + s + "/model.cfg"; + } + + PlayerItemModel playeritemmodel = this.downloadModel(s1); + + if (playeritemmodel != null) + { + if (!playeritemmodel.isUsePlayerTexture()) + { + String s2 = Json.getString(jsonobject1, "texture"); + + if (s2 == null) + { + s2 = "items/" + s + "/users/" + this.player + ".png"; + } + + BufferedImage bufferedimage = this.downloadTextureImage(s2); + + if (bufferedimage == null) + { + continue; + } + + playeritemmodel.setTextureImage(bufferedimage); + ResourceLocation resourcelocation = new ResourceLocation("optifine.net", s2); + playeritemmodel.setTextureLocation(resourcelocation); + } + + playerconfiguration.addPlayerItemModel(playeritemmodel); + } + } + } + } + } + + return playerconfiguration; + } + } + + private BufferedImage downloadTextureImage(String texturePath) + { + String s = HttpUtils.getPlayerItemsUrl() + "/" + texturePath; + + try + { + byte[] abyte = HttpPipeline.get(s, Minecraft.getMinecraft().getProxy()); + BufferedImage bufferedimage = ImageIO.read((InputStream)(new ByteArrayInputStream(abyte))); + return bufferedimage; + } + catch (IOException ioexception) + { + Config.warn("Error loading item texture " + texturePath + ": " + ioexception.getClass().getName() + ": " + ioexception.getMessage()); + return null; + } + } + + private PlayerItemModel downloadModel(String modelPath) + { + String s = HttpUtils.getPlayerItemsUrl() + "/" + modelPath; + + try + { + byte[] abyte = HttpPipeline.get(s, Minecraft.getMinecraft().getProxy()); + String s1 = new String(abyte, "ASCII"); + JsonParser jsonparser = new JsonParser(); + JsonObject jsonobject = (JsonObject)jsonparser.parse(s1); + PlayerItemModel playeritemmodel = PlayerItemParser.parseItemModel(jsonobject); + return playeritemmodel; + } + catch (Exception exception) + { + Config.warn("Error loading item model " + modelPath + ": " + exception.getClass().getName() + ": " + exception.getMessage()); + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurationReceiver.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurationReceiver.java new file mode 100644 index 0000000..93a03b7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurationReceiver.java @@ -0,0 +1,41 @@ +package net.optifine.player; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.src.Config; +import net.optifine.http.IFileDownloadListener; + +public class PlayerConfigurationReceiver implements IFileDownloadListener +{ + private String player = null; + + public PlayerConfigurationReceiver(String player) + { + this.player = player; + } + + public void fileDownloadFinished(String url, byte[] bytes, Throwable exception) + { + if (bytes != null) + { + try + { + String s = new String(bytes, "ASCII"); + JsonParser jsonparser = new JsonParser(); + JsonElement jsonelement = jsonparser.parse(s); + PlayerConfigurationParser playerconfigurationparser = new PlayerConfigurationParser(this.player); + PlayerConfiguration playerconfiguration = playerconfigurationparser.parsePlayerConfiguration(jsonelement); + + if (playerconfiguration != null) + { + playerconfiguration.setInitialized(true); + PlayerConfigurations.setPlayerConfiguration(this.player, playerconfiguration); + } + } + catch (Exception exception1) + { + Config.dbg("Error parsing configuration: " + url + ", " + exception1.getClass().getName() + ": " + exception1.getMessage()); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurations.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurations.java new file mode 100644 index 0000000..c196e7b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerConfigurations.java @@ -0,0 +1,78 @@ +package net.optifine.player; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; +import net.optifine.http.FileDownloadThread; +import net.optifine.http.HttpUtils; + +public class PlayerConfigurations +{ + private static Map mapConfigurations = null; + private static boolean reloadPlayerItems = Boolean.getBoolean("player.models.reload"); + private static long timeReloadPlayerItemsMs = System.currentTimeMillis(); + + public static void renderPlayerItems(ModelBiped modelBiped, AbstractClientPlayer player, float scale, float partialTicks) + { + PlayerConfiguration playerconfiguration = getPlayerConfiguration(player); + + if (playerconfiguration != null) + { + playerconfiguration.renderPlayerItems(modelBiped, player, scale, partialTicks); + } + } + + public static synchronized PlayerConfiguration getPlayerConfiguration(AbstractClientPlayer player) + { + if (reloadPlayerItems && System.currentTimeMillis() > timeReloadPlayerItemsMs + 5000L) + { + AbstractClientPlayer abstractclientplayer = Minecraft.getMinecraft().thePlayer; + + if (abstractclientplayer != null) + { + setPlayerConfiguration(abstractclientplayer.getNameClear(), (PlayerConfiguration)null); + timeReloadPlayerItemsMs = System.currentTimeMillis(); + } + } + + String s1 = player.getNameClear(); + + if (s1 == null) + { + return null; + } + else + { + PlayerConfiguration playerconfiguration = (PlayerConfiguration)getMapConfigurations().get(s1); + + if (playerconfiguration == null) + { + playerconfiguration = new PlayerConfiguration(); + getMapConfigurations().put(s1, playerconfiguration); + PlayerConfigurationReceiver playerconfigurationreceiver = new PlayerConfigurationReceiver(s1); + String s = HttpUtils.getPlayerItemsUrl() + "/users/" + s1 + ".cfg"; + FileDownloadThread filedownloadthread = new FileDownloadThread(s, playerconfigurationreceiver); + filedownloadthread.start(); + } + + return playerconfiguration; + } + } + + public static synchronized void setPlayerConfiguration(String player, PlayerConfiguration pc) + { + getMapConfigurations().put(player, pc); + } + + private static Map getMapConfigurations() + { + if (mapConfigurations == null) + { + mapConfigurations = new HashMap(); + } + + return mapConfigurations; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemModel.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemModel.java new file mode 100644 index 0000000..9197aa8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemModel.java @@ -0,0 +1,133 @@ +package net.optifine.player; + +import java.awt.Dimension; +import java.awt.image.BufferedImage; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class PlayerItemModel +{ + private Dimension textureSize = null; + private boolean usePlayerTexture = false; + private PlayerItemRenderer[] modelRenderers = new PlayerItemRenderer[0]; + private ResourceLocation textureLocation = null; + private BufferedImage textureImage = null; + private DynamicTexture texture = null; + private ResourceLocation locationMissing = new ResourceLocation("textures/blocks/wool_colored_red.png"); + public static final int ATTACH_BODY = 0; + public static final int ATTACH_HEAD = 1; + public static final int ATTACH_LEFT_ARM = 2; + public static final int ATTACH_RIGHT_ARM = 3; + public static final int ATTACH_LEFT_LEG = 4; + public static final int ATTACH_RIGHT_LEG = 5; + public static final int ATTACH_CAPE = 6; + + public PlayerItemModel(Dimension textureSize, boolean usePlayerTexture, PlayerItemRenderer[] modelRenderers) + { + this.textureSize = textureSize; + this.usePlayerTexture = usePlayerTexture; + this.modelRenderers = modelRenderers; + } + + public void render(ModelBiped modelBiped, AbstractClientPlayer player, float scale, float partialTicks) + { + TextureManager texturemanager = Config.getTextureManager(); + + if (this.usePlayerTexture) + { + texturemanager.bindTexture(player.getLocationSkin()); + } + else if (this.textureLocation != null) + { + if (this.texture == null && this.textureImage != null) + { + this.texture = new DynamicTexture(this.textureImage); + Minecraft.getMinecraft().getTextureManager().loadTexture(this.textureLocation, this.texture); + } + + texturemanager.bindTexture(this.textureLocation); + } + else + { + texturemanager.bindTexture(this.locationMissing); + } + + for (int i = 0; i < this.modelRenderers.length; ++i) + { + PlayerItemRenderer playeritemrenderer = this.modelRenderers[i]; + GlStateManager.pushMatrix(); + + if (player.isSneaking()) + { + GlStateManager.translate(0.0F, 0.2F, 0.0F); + } + + playeritemrenderer.render(modelBiped, scale); + GlStateManager.popMatrix(); + } + } + + public static ModelRenderer getAttachModel(ModelBiped modelBiped, int attachTo) + { + switch (attachTo) + { + case 0: + return modelBiped.bipedBody; + + case 1: + return modelBiped.bipedHead; + + case 2: + return modelBiped.bipedLeftArm; + + case 3: + return modelBiped.bipedRightArm; + + case 4: + return modelBiped.bipedLeftLeg; + + case 5: + return modelBiped.bipedRightLeg; + + default: + return null; + } + } + + public BufferedImage getTextureImage() + { + return this.textureImage; + } + + public void setTextureImage(BufferedImage textureImage) + { + this.textureImage = textureImage; + } + + public DynamicTexture getTexture() + { + return this.texture; + } + + public ResourceLocation getTextureLocation() + { + return this.textureLocation; + } + + public void setTextureLocation(ResourceLocation textureLocation) + { + this.textureLocation = textureLocation; + } + + public boolean isUsePlayerTexture() + { + return this.usePlayerTexture; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemParser.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemParser.java new file mode 100644 index 0000000..09b0cf9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemParser.java @@ -0,0 +1,477 @@ +package net.optifine.player; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.awt.Dimension; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.optifine.entity.model.CustomEntityModelParser; +import net.optifine.util.Json; + +public class PlayerItemParser +{ + private static JsonParser jsonParser = new JsonParser(); + public static final String ITEM_TYPE = "type"; + public static final String ITEM_TEXTURE_SIZE = "textureSize"; + public static final String ITEM_USE_PLAYER_TEXTURE = "usePlayerTexture"; + public static final String ITEM_MODELS = "models"; + public static final String MODEL_ID = "id"; + public static final String MODEL_BASE_ID = "baseId"; + public static final String MODEL_TYPE = "type"; + public static final String MODEL_TEXTURE = "texture"; + public static final String MODEL_TEXTURE_SIZE = "textureSize"; + public static final String MODEL_ATTACH_TO = "attachTo"; + public static final String MODEL_INVERT_AXIS = "invertAxis"; + public static final String MODEL_MIRROR_TEXTURE = "mirrorTexture"; + public static final String MODEL_TRANSLATE = "translate"; + public static final String MODEL_ROTATE = "rotate"; + public static final String MODEL_SCALE = "scale"; + public static final String MODEL_BOXES = "boxes"; + public static final String MODEL_SPRITES = "sprites"; + public static final String MODEL_SUBMODEL = "submodel"; + public static final String MODEL_SUBMODELS = "submodels"; + public static final String BOX_TEXTURE_OFFSET = "textureOffset"; + public static final String BOX_COORDINATES = "coordinates"; + public static final String BOX_SIZE_ADD = "sizeAdd"; + public static final String BOX_UV_DOWN = "uvDown"; + public static final String BOX_UV_UP = "uvUp"; + public static final String BOX_UV_NORTH = "uvNorth"; + public static final String BOX_UV_SOUTH = "uvSouth"; + public static final String BOX_UV_WEST = "uvWest"; + public static final String BOX_UV_EAST = "uvEast"; + public static final String BOX_UV_FRONT = "uvFront"; + public static final String BOX_UV_BACK = "uvBack"; + public static final String BOX_UV_LEFT = "uvLeft"; + public static final String BOX_UV_RIGHT = "uvRight"; + public static final String ITEM_TYPE_MODEL = "PlayerItem"; + public static final String MODEL_TYPE_BOX = "ModelBox"; + + public static PlayerItemModel parseItemModel(JsonObject obj) + { + String s = Json.getString(obj, "type"); + + if (!Config.equals(s, "PlayerItem")) + { + throw new JsonParseException("Unknown model type: " + s); + } + else + { + int[] aint = Json.parseIntArray(obj.get("textureSize"), 2); + checkNull(aint, "Missing texture size"); + Dimension dimension = new Dimension(aint[0], aint[1]); + boolean flag = Json.getBoolean(obj, "usePlayerTexture", false); + JsonArray jsonarray = (JsonArray)obj.get("models"); + checkNull(jsonarray, "Missing elements"); + Map map = new HashMap(); + List list = new ArrayList(); + new ArrayList(); + + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonObject jsonobject = (JsonObject)jsonarray.get(i); + String s1 = Json.getString(jsonobject, "baseId"); + + if (s1 != null) + { + JsonObject jsonobject1 = (JsonObject)map.get(s1); + + if (jsonobject1 == null) + { + Config.warn("BaseID not found: " + s1); + continue; + } + + for (Entry entry : jsonobject1.entrySet()) + { + if (!jsonobject.has((String)entry.getKey())) + { + jsonobject.add((String)entry.getKey(), (JsonElement)entry.getValue()); + } + } + } + + String s2 = Json.getString(jsonobject, "id"); + + if (s2 != null) + { + if (!map.containsKey(s2)) + { + map.put(s2, jsonobject); + } + else + { + Config.warn("Duplicate model ID: " + s2); + } + } + + PlayerItemRenderer playeritemrenderer = parseItemRenderer(jsonobject, dimension); + + if (playeritemrenderer != null) + { + list.add(playeritemrenderer); + } + } + + PlayerItemRenderer[] aplayeritemrenderer = (PlayerItemRenderer[])((PlayerItemRenderer[])list.toArray(new PlayerItemRenderer[list.size()])); + return new PlayerItemModel(dimension, flag, aplayeritemrenderer); + } + } + + private static void checkNull(Object obj, String msg) + { + if (obj == null) + { + throw new JsonParseException(msg); + } + } + + private static ResourceLocation makeResourceLocation(String texture) + { + int i = texture.indexOf(58); + + if (i < 0) + { + return new ResourceLocation(texture); + } + else + { + String s = texture.substring(0, i); + String s1 = texture.substring(i + 1); + return new ResourceLocation(s, s1); + } + } + + private static int parseAttachModel(String attachModelStr) + { + if (attachModelStr == null) + { + return 0; + } + else if (attachModelStr.equals("body")) + { + return 0; + } + else if (attachModelStr.equals("head")) + { + return 1; + } + else if (attachModelStr.equals("leftArm")) + { + return 2; + } + else if (attachModelStr.equals("rightArm")) + { + return 3; + } + else if (attachModelStr.equals("leftLeg")) + { + return 4; + } + else if (attachModelStr.equals("rightLeg")) + { + return 5; + } + else if (attachModelStr.equals("cape")) + { + return 6; + } + else + { + Config.warn("Unknown attachModel: " + attachModelStr); + return 0; + } + } + + public static PlayerItemRenderer parseItemRenderer(JsonObject elem, Dimension textureDim) + { + String s = Json.getString(elem, "type"); + + if (!Config.equals(s, "ModelBox")) + { + Config.warn("Unknown model type: " + s); + return null; + } + else + { + String s1 = Json.getString(elem, "attachTo"); + int i = parseAttachModel(s1); + ModelBase modelbase = new ModelPlayerItem(); + modelbase.textureWidth = textureDim.width; + modelbase.textureHeight = textureDim.height; + ModelRenderer modelrenderer = parseModelRenderer(elem, modelbase, (int[])null, (String)null); + PlayerItemRenderer playeritemrenderer = new PlayerItemRenderer(i, modelrenderer); + return playeritemrenderer; + } + } + + public static ModelRenderer parseModelRenderer(JsonObject elem, ModelBase modelBase, int[] parentTextureSize, String basePath) + { + ModelRenderer modelrenderer = new ModelRenderer(modelBase); + String s = Json.getString(elem, "id"); + modelrenderer.setId(s); + float f = Json.getFloat(elem, "scale", 1.0F); + modelrenderer.scaleX = f; + modelrenderer.scaleY = f; + modelrenderer.scaleZ = f; + String s1 = Json.getString(elem, "texture"); + + if (s1 != null) + { + modelrenderer.setTextureLocation(CustomEntityModelParser.getResourceLocation(basePath, s1, ".png")); + } + + int[] aint = Json.parseIntArray(elem.get("textureSize"), 2); + + if (aint == null) + { + aint = parentTextureSize; + } + + if (aint != null) + { + modelrenderer.setTextureSize(aint[0], aint[1]); + } + + String s2 = Json.getString(elem, "invertAxis", "").toLowerCase(); + boolean flag = s2.contains("x"); + boolean flag1 = s2.contains("y"); + boolean flag2 = s2.contains("z"); + float[] afloat = Json.parseFloatArray(elem.get("translate"), 3, new float[3]); + + if (flag) + { + afloat[0] = -afloat[0]; + } + + if (flag1) + { + afloat[1] = -afloat[1]; + } + + if (flag2) + { + afloat[2] = -afloat[2]; + } + + float[] afloat1 = Json.parseFloatArray(elem.get("rotate"), 3, new float[3]); + + for (int i = 0; i < afloat1.length; ++i) + { + afloat1[i] = afloat1[i] / 180.0F * MathHelper.PI; + } + + if (flag) + { + afloat1[0] = -afloat1[0]; + } + + if (flag1) + { + afloat1[1] = -afloat1[1]; + } + + if (flag2) + { + afloat1[2] = -afloat1[2]; + } + + modelrenderer.setRotationPoint(afloat[0], afloat[1], afloat[2]); + modelrenderer.rotateAngleX = afloat1[0]; + modelrenderer.rotateAngleY = afloat1[1]; + modelrenderer.rotateAngleZ = afloat1[2]; + String s3 = Json.getString(elem, "mirrorTexture", "").toLowerCase(); + boolean flag3 = s3.contains("u"); + boolean flag4 = s3.contains("v"); + + if (flag3) + { + modelrenderer.mirror = true; + } + + if (flag4) + { + modelrenderer.mirrorV = true; + } + + JsonArray jsonarray = elem.getAsJsonArray("boxes"); + + if (jsonarray != null) + { + for (int j = 0; j < jsonarray.size(); ++j) + { + JsonObject jsonobject = jsonarray.get(j).getAsJsonObject(); + int[] aint1 = Json.parseIntArray(jsonobject.get("textureOffset"), 2); + int[][] aint2 = parseFaceUvs(jsonobject); + + if (aint1 == null && aint2 == null) + { + throw new JsonParseException("Texture offset not specified"); + } + + float[] afloat2 = Json.parseFloatArray(jsonobject.get("coordinates"), 6); + + if (afloat2 == null) + { + throw new JsonParseException("Coordinates not specified"); + } + + if (flag) + { + afloat2[0] = -afloat2[0] - afloat2[3]; + } + + if (flag1) + { + afloat2[1] = -afloat2[1] - afloat2[4]; + } + + if (flag2) + { + afloat2[2] = -afloat2[2] - afloat2[5]; + } + + float f1 = Json.getFloat(jsonobject, "sizeAdd", 0.0F); + + if (aint2 != null) + { + modelrenderer.addBox(aint2, afloat2[0], afloat2[1], afloat2[2], afloat2[3], afloat2[4], afloat2[5], f1); + } + else + { + modelrenderer.setTextureOffset(aint1[0], aint1[1]); + modelrenderer.addBox(afloat2[0], afloat2[1], afloat2[2], (int)afloat2[3], (int)afloat2[4], (int)afloat2[5], f1); + } + } + } + + JsonArray jsonarray1 = elem.getAsJsonArray("sprites"); + + if (jsonarray1 != null) + { + for (int k = 0; k < jsonarray1.size(); ++k) + { + JsonObject jsonobject2 = jsonarray1.get(k).getAsJsonObject(); + int[] aint3 = Json.parseIntArray(jsonobject2.get("textureOffset"), 2); + + if (aint3 == null) + { + throw new JsonParseException("Texture offset not specified"); + } + + float[] afloat3 = Json.parseFloatArray(jsonobject2.get("coordinates"), 6); + + if (afloat3 == null) + { + throw new JsonParseException("Coordinates not specified"); + } + + if (flag) + { + afloat3[0] = -afloat3[0] - afloat3[3]; + } + + if (flag1) + { + afloat3[1] = -afloat3[1] - afloat3[4]; + } + + if (flag2) + { + afloat3[2] = -afloat3[2] - afloat3[5]; + } + + float f2 = Json.getFloat(jsonobject2, "sizeAdd", 0.0F); + modelrenderer.setTextureOffset(aint3[0], aint3[1]); + modelrenderer.addSprite(afloat3[0], afloat3[1], afloat3[2], (int)afloat3[3], (int)afloat3[4], (int)afloat3[5], f2); + } + } + + JsonObject jsonobject1 = (JsonObject)elem.get("submodel"); + + if (jsonobject1 != null) + { + ModelRenderer modelrenderer2 = parseModelRenderer(jsonobject1, modelBase, aint, basePath); + modelrenderer.addChild(modelrenderer2); + } + + JsonArray jsonarray2 = (JsonArray)elem.get("submodels"); + + if (jsonarray2 != null) + { + for (int l = 0; l < jsonarray2.size(); ++l) + { + JsonObject jsonobject3 = (JsonObject)jsonarray2.get(l); + ModelRenderer modelrenderer3 = parseModelRenderer(jsonobject3, modelBase, aint, basePath); + + if (modelrenderer3.getId() != null) + { + ModelRenderer modelrenderer1 = modelrenderer.getChild(modelrenderer3.getId()); + + if (modelrenderer1 != null) + { + Config.warn("Duplicate model ID: " + modelrenderer3.getId()); + } + } + + modelrenderer.addChild(modelrenderer3); + } + } + + return modelrenderer; + } + + private static int[][] parseFaceUvs(JsonObject box) + { + int[][] aint = new int[][] {Json.parseIntArray(box.get("uvDown"), 4), Json.parseIntArray(box.get("uvUp"), 4), Json.parseIntArray(box.get("uvNorth"), 4), Json.parseIntArray(box.get("uvSouth"), 4), Json.parseIntArray(box.get("uvWest"), 4), Json.parseIntArray(box.get("uvEast"), 4)}; + + if (aint[2] == null) + { + aint[2] = Json.parseIntArray(box.get("uvFront"), 4); + } + + if (aint[3] == null) + { + aint[3] = Json.parseIntArray(box.get("uvBack"), 4); + } + + if (aint[4] == null) + { + aint[4] = Json.parseIntArray(box.get("uvLeft"), 4); + } + + if (aint[5] == null) + { + aint[5] = Json.parseIntArray(box.get("uvRight"), 4); + } + + boolean flag = false; + + for (int i = 0; i < aint.length; ++i) + { + if (aint[i] != null) + { + flag = true; + } + } + + if (!flag) + { + return (int[][])null; + } + else + { + return aint; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemRenderer.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemRenderer.java new file mode 100644 index 0000000..c77118e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemRenderer.java @@ -0,0 +1,33 @@ +package net.optifine.player; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; + +public class PlayerItemRenderer +{ + private int attachTo = 0; + private ModelRenderer modelRenderer = null; + + public PlayerItemRenderer(int attachTo, ModelRenderer modelRenderer) + { + this.attachTo = attachTo; + this.modelRenderer = modelRenderer; + } + + public ModelRenderer getModelRenderer() + { + return this.modelRenderer; + } + + public void render(ModelBiped modelBiped, float scale) + { + ModelRenderer modelrenderer = PlayerItemModel.getAttachModel(modelBiped, this.attachTo); + + if (modelrenderer != null) + { + modelrenderer.postRender(scale); + } + + this.modelRenderer.render(scale); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemsLayer.java b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemsLayer.java new file mode 100644 index 0000000..71d3274 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/player/PlayerItemsLayer.java @@ -0,0 +1,74 @@ +package net.optifine.player; + +import java.util.Map; +import java.util.Set; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.src.Config; + +public class PlayerItemsLayer implements LayerRenderer +{ + private RenderPlayer renderPlayer = null; + + public PlayerItemsLayer(RenderPlayer renderPlayer) + { + this.renderPlayer = renderPlayer; + } + + public void doRenderLayer(EntityLivingBase entityLiving, float limbSwing, float limbSwingAmount, float partialTicks, float ticksExisted, float headYaw, float rotationPitch, float scale) + { + this.renderEquippedItems(entityLiving, scale, partialTicks); + } + + protected void renderEquippedItems(EntityLivingBase entityLiving, float scale, float partialTicks) + { + if (Config.isShowCapes()) + { + if (!entityLiving.isInvisible()) + { + if (entityLiving instanceof AbstractClientPlayer) + { + AbstractClientPlayer abstractclientplayer = (AbstractClientPlayer)entityLiving; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableRescaleNormal(); + GlStateManager.enableCull(); + ModelBiped modelbiped = this.renderPlayer.getMainModel(); + PlayerConfigurations.renderPlayerItems(modelbiped, abstractclientplayer, scale, partialTicks); + GlStateManager.disableCull(); + } + } + } + } + + public boolean shouldCombineTextures() + { + return false; + } + + public static void register(Map renderPlayerMap) + { + Set set = renderPlayerMap.keySet(); + boolean flag = false; + + for (Object object : set) + { + Object object1 = renderPlayerMap.get(object); + + if (object1 instanceof RenderPlayer) + { + RenderPlayer renderplayer = (RenderPlayer)object1; + renderplayer.addLayer(new PlayerItemsLayer(renderplayer)); + flag = true; + } + } + + if (!flag) + { + Config.warn("PlayerItemsLayer not registered"); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorActionKeyF3.java b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorActionKeyF3.java new file mode 100644 index 0000000..c4c3869 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorActionKeyF3.java @@ -0,0 +1,53 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; + +public class FieldLocatorActionKeyF3 implements IFieldLocator +{ + public Field getField() + { + Class oclass = Minecraft.class; + Field field = this.getFieldRenderChunksMany(); + + if (field == null) + { + return null; + } + else + { + Field field1 = ReflectorRaw.getFieldAfter(Minecraft.class, field, Boolean.TYPE, 0); + + if (field1 == null) + { + return null; + } + else + { + return field1; + } + } + } + + private Field getFieldRenderChunksMany() + { + Minecraft minecraft = Minecraft.getMinecraft(); + boolean flag = minecraft.renderChunksMany; + Field[] afield = Minecraft.class.getDeclaredFields(); + minecraft.renderChunksMany = true; + Field[] afield1 = ReflectorRaw.getFields(minecraft, afield, Boolean.TYPE, Boolean.TRUE); + minecraft.renderChunksMany = false; + Field[] afield2 = ReflectorRaw.getFields(minecraft, afield, Boolean.TYPE, Boolean.FALSE); + minecraft.renderChunksMany = flag; + Set set = new HashSet(Arrays.asList(afield1)); + Set set1 = new HashSet(Arrays.asList(afield2)); + Set set2 = new HashSet(set); + set2.retainAll(set1); + Field[] afield3 = (Field[])((Field[])set2.toArray(new Field[set2.size()])); + return afield3.length != 1 ? null : afield3[0]; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorFixed.java b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorFixed.java new file mode 100644 index 0000000..b156c6a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorFixed.java @@ -0,0 +1,18 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; + +public class FieldLocatorFixed implements IFieldLocator +{ + private Field field; + + public FieldLocatorFixed(Field field) + { + this.field = field; + } + + public Field getField() + { + return this.field; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorName.java b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorName.java new file mode 100644 index 0000000..37997c3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorName.java @@ -0,0 +1,73 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; +import net.optifine.Log; + +public class FieldLocatorName implements IFieldLocator +{ + private ReflectorClass reflectorClass = null; + private String targetFieldName = null; + + public FieldLocatorName(ReflectorClass reflectorClass, String targetFieldName) + { + this.reflectorClass = reflectorClass; + this.targetFieldName = targetFieldName; + } + + public Field getField() + { + Class oclass = this.reflectorClass.getTargetClass(); + + if (oclass == null) + { + return null; + } + else + { + try + { + Field field = this.getDeclaredField(oclass, this.targetFieldName); + field.setAccessible(true); + return field; + } + catch (NoSuchFieldException var3) + { + return null; + } + catch (SecurityException securityexception) + { + securityexception.printStackTrace(); + return null; + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + return null; + } + } + } + + private Field getDeclaredField(Class cls, String name) throws NoSuchFieldException + { + Field[] afield = cls.getDeclaredFields(); + + for (int i = 0; i < afield.length; ++i) + { + Field field = afield[i]; + + if (field.getName().equals(name)) + { + return field; + } + } + + if (cls == Object.class) + { + throw new NoSuchFieldException(name); + } + else + { + return this.getDeclaredField(cls.getSuperclass(), name); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorType.java b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorType.java new file mode 100644 index 0000000..c173599 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorType.java @@ -0,0 +1,71 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; +import net.optifine.Log; + +public class FieldLocatorType implements IFieldLocator +{ + private ReflectorClass reflectorClass; + private Class targetFieldType; + private int targetFieldIndex; + + public FieldLocatorType(ReflectorClass reflectorClass, Class targetFieldType) + { + this(reflectorClass, targetFieldType, 0); + } + + public FieldLocatorType(ReflectorClass reflectorClass, Class targetFieldType, int targetFieldIndex) + { + this.reflectorClass = null; + this.targetFieldType = null; + this.reflectorClass = reflectorClass; + this.targetFieldType = targetFieldType; + this.targetFieldIndex = targetFieldIndex; + } + + public Field getField() + { + Class oclass = this.reflectorClass.getTargetClass(); + + if (oclass == null) + { + return null; + } + else + { + try + { + Field[] afield = oclass.getDeclaredFields(); + int i = 0; + + for (int j = 0; j < afield.length; ++j) + { + Field field = afield[j]; + + if (field.getType() == this.targetFieldType) + { + if (i == this.targetFieldIndex) + { + field.setAccessible(true); + return field; + } + + ++i; + } + } + + return null; + } + catch (SecurityException securityexception) + { + securityexception.printStackTrace(); + return null; + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + return null; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorTypes.java b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorTypes.java new file mode 100644 index 0000000..ac0c036 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/FieldLocatorTypes.java @@ -0,0 +1,55 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import net.optifine.Log; + +public class FieldLocatorTypes implements IFieldLocator +{ + private Field field = null; + + public FieldLocatorTypes(Class cls, Class[] preTypes, Class type, Class[] postTypes, String errorName) + { + Field[] afield = cls.getDeclaredFields(); + List list = new ArrayList(); + + for (int i = 0; i < afield.length; ++i) + { + Field field = afield[i]; + list.add(field.getType()); + } + + List list1 = new ArrayList(); + list1.addAll(Arrays.asList(preTypes)); + list1.add(type); + list1.addAll(Arrays.asList(postTypes)); + int l = Collections.indexOfSubList(list, list1); + + if (l < 0) + { + Log.log("(Reflector) Field not found: " + errorName); + } + else + { + int j = Collections.indexOfSubList(list.subList(l + 1, list.size()), list1); + + if (j >= 0) + { + Log.log("(Reflector) More than one match found for field: " + errorName); + } + else + { + int k = l + preTypes.length; + this.field = afield[k]; + } + } + } + + public Field getField() + { + return this.field; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/IFieldLocator.java b/Client-1.8.9/src/main/java/net/optifine/reflect/IFieldLocator.java new file mode 100644 index 0000000..1e87114 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/IFieldLocator.java @@ -0,0 +1,8 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; + +public interface IFieldLocator +{ + Field getField(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/IResolvable.java b/Client-1.8.9/src/main/java/net/optifine/reflect/IResolvable.java new file mode 100644 index 0000000..64f398e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/IResolvable.java @@ -0,0 +1,6 @@ +package net.optifine.reflect; + +public interface IResolvable +{ + void resolve(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/Reflector.java b/Client-1.8.9/src/main/java/net/optifine/reflect/Reflector.java new file mode 100644 index 0000000..569f0b0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/Reflector.java @@ -0,0 +1,1175 @@ +package net.optifine.reflect; + +import com.google.common.base.Optional; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Map; +import javax.vecmath.Matrix4f; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiEnchantment; +import net.minecraft.client.gui.GuiHopper; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.inventory.GuiBeacon; +import net.minecraft.client.gui.inventory.GuiBrewingStand; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.gui.inventory.GuiFurnace; +import net.minecraft.client.model.ModelBanner; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBat; +import net.minecraft.client.model.ModelBlaze; +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.model.ModelDragon; +import net.minecraft.client.model.ModelEnderCrystal; +import net.minecraft.client.model.ModelEnderMite; +import net.minecraft.client.model.ModelGhast; +import net.minecraft.client.model.ModelGuardian; +import net.minecraft.client.model.ModelHorse; +import net.minecraft.client.model.ModelHumanoidHead; +import net.minecraft.client.model.ModelLeashKnot; +import net.minecraft.client.model.ModelMagmaCube; +import net.minecraft.client.model.ModelOcelot; +import net.minecraft.client.model.ModelRabbit; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.ModelSign; +import net.minecraft.client.model.ModelSilverfish; +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.client.model.ModelSlime; +import net.minecraft.client.model.ModelSquid; +import net.minecraft.client.model.ModelWitch; +import net.minecraft.client.model.ModelWither; +import net.minecraft.client.model.ModelWolf; +import net.minecraft.client.multiplayer.ChunkProviderClient; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.block.model.ModelBlock; +import net.minecraft.client.renderer.entity.RenderBoat; +import net.minecraft.client.renderer.entity.RenderLeashKnot; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderMinecart; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.client.renderer.tileentity.RenderEnderCrystal; +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.client.renderer.tileentity.RenderWitherSkull; +import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer; +import net.minecraft.client.renderer.tileentity.TileEntityEnderChestRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySignRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.client.resources.model.ModelRotation; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.IWorldNameable; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.property.IUnlistedProperty; +import net.optifine.Log; +import net.optifine.util.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Reflector +{ + private static final Logger LOGGER = LogManager.getLogger(); + private static boolean logForge = logEntry("*** Reflector Forge ***"); + public static ReflectorClass BetterFoliageClient = new ReflectorClass("mods.betterfoliage.client.BetterFoliageClient"); + public static ReflectorClass BlamingTransformer = new ReflectorClass("net.minecraftforge.fml.common.asm.transformers.BlamingTransformer"); + public static ReflectorMethod BlamingTransformer_onCrash = new ReflectorMethod(BlamingTransformer, "onCrash"); + public static ReflectorClass ChunkWatchEvent_UnWatch = new ReflectorClass("net.minecraftforge.event.world.ChunkWatchEvent$UnWatch"); + public static ReflectorConstructor ChunkWatchEvent_UnWatch_Constructor = new ReflectorConstructor(ChunkWatchEvent_UnWatch, new Class[] {ChunkCoordIntPair.class, EntityPlayerMP.class}); + public static ReflectorClass CoreModManager = new ReflectorClass("net.minecraftforge.fml.relauncher.CoreModManager"); + public static ReflectorMethod CoreModManager_onCrash = new ReflectorMethod(CoreModManager, "onCrash"); + public static ReflectorClass DimensionManager = new ReflectorClass("net.minecraftforge.common.DimensionManager"); + public static ReflectorMethod DimensionManager_createProviderFor = new ReflectorMethod(DimensionManager, "createProviderFor"); + public static ReflectorMethod DimensionManager_getStaticDimensionIDs = new ReflectorMethod(DimensionManager, "getStaticDimensionIDs"); + public static ReflectorClass DrawScreenEvent_Pre = new ReflectorClass("net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Pre"); + public static ReflectorConstructor DrawScreenEvent_Pre_Constructor = new ReflectorConstructor(DrawScreenEvent_Pre, new Class[] {GuiScreen.class, Integer.TYPE, Integer.TYPE, Float.TYPE}); + public static ReflectorClass DrawScreenEvent_Post = new ReflectorClass("net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Post"); + public static ReflectorConstructor DrawScreenEvent_Post_Constructor = new ReflectorConstructor(DrawScreenEvent_Post, new Class[] {GuiScreen.class, Integer.TYPE, Integer.TYPE, Float.TYPE}); + public static ReflectorClass EntityViewRenderEvent_CameraSetup = new ReflectorClass("net.minecraftforge.client.event.EntityViewRenderEvent$CameraSetup"); + public static ReflectorConstructor EntityViewRenderEvent_CameraSetup_Constructor = new ReflectorConstructor(EntityViewRenderEvent_CameraSetup, new Class[] {EntityRenderer.class, Entity.class, Block.class, Double.TYPE, Float.TYPE, Float.TYPE, Float.TYPE}); + public static ReflectorField EntityViewRenderEvent_CameraSetup_yaw = new ReflectorField(EntityViewRenderEvent_CameraSetup, "yaw"); + public static ReflectorField EntityViewRenderEvent_CameraSetup_pitch = new ReflectorField(EntityViewRenderEvent_CameraSetup, "pitch"); + public static ReflectorField EntityViewRenderEvent_CameraSetup_roll = new ReflectorField(EntityViewRenderEvent_CameraSetup, "roll"); + public static ReflectorClass EntityViewRenderEvent_FogColors = new ReflectorClass("net.minecraftforge.client.event.EntityViewRenderEvent$FogColors"); + public static ReflectorConstructor EntityViewRenderEvent_FogColors_Constructor = new ReflectorConstructor(EntityViewRenderEvent_FogColors, new Class[] {EntityRenderer.class, Entity.class, Block.class, Double.TYPE, Float.TYPE, Float.TYPE, Float.TYPE}); + public static ReflectorField EntityViewRenderEvent_FogColors_red = new ReflectorField(EntityViewRenderEvent_FogColors, "red"); + public static ReflectorField EntityViewRenderEvent_FogColors_green = new ReflectorField(EntityViewRenderEvent_FogColors, "green"); + public static ReflectorField EntityViewRenderEvent_FogColors_blue = new ReflectorField(EntityViewRenderEvent_FogColors, "blue"); + public static ReflectorClass Event = new ReflectorClass("net.minecraftforge.fml.common.eventhandler.Event"); + public static ReflectorMethod Event_isCanceled = new ReflectorMethod(Event, "isCanceled"); + public static ReflectorClass EventBus = new ReflectorClass("net.minecraftforge.fml.common.eventhandler.EventBus"); + public static ReflectorMethod EventBus_post = new ReflectorMethod(EventBus, "post"); + public static ReflectorClass Event_Result = new ReflectorClass("net.minecraftforge.fml.common.eventhandler.Event$Result"); + public static ReflectorField Event_Result_DENY = new ReflectorField(Event_Result, "DENY"); + public static ReflectorField Event_Result_ALLOW = new ReflectorField(Event_Result, "ALLOW"); + public static ReflectorField Event_Result_DEFAULT = new ReflectorField(Event_Result, "DEFAULT"); + public static ReflectorClass ExtendedBlockState = new ReflectorClass("net.minecraftforge.common.property.ExtendedBlockState"); + public static ReflectorConstructor ExtendedBlockState_Constructor = new ReflectorConstructor(ExtendedBlockState, new Class[] {Block.class, IProperty[].class, IUnlistedProperty[].class}); + public static ReflectorClass FMLClientHandler = new ReflectorClass("net.minecraftforge.fml.client.FMLClientHandler"); + public static ReflectorMethod FMLClientHandler_instance = new ReflectorMethod(FMLClientHandler, "instance"); + public static ReflectorMethod FMLClientHandler_handleLoadingScreen = new ReflectorMethod(FMLClientHandler, "handleLoadingScreen"); + public static ReflectorMethod FMLClientHandler_isLoading = new ReflectorMethod(FMLClientHandler, "isLoading"); + public static ReflectorMethod FMLClientHandler_trackBrokenTexture = new ReflectorMethod(FMLClientHandler, "trackBrokenTexture"); + public static ReflectorMethod FMLClientHandler_trackMissingTexture = new ReflectorMethod(FMLClientHandler, "trackMissingTexture"); + public static ReflectorClass FMLCommonHandler = new ReflectorClass("net.minecraftforge.fml.common.FMLCommonHandler"); + public static ReflectorMethod FMLCommonHandler_callFuture = new ReflectorMethod(FMLCommonHandler, "callFuture"); + public static ReflectorMethod FMLCommonHandler_enhanceCrashReport = new ReflectorMethod(FMLCommonHandler, "enhanceCrashReport"); + public static ReflectorMethod FMLCommonHandler_getBrandings = new ReflectorMethod(FMLCommonHandler, "getBrandings"); + public static ReflectorMethod FMLCommonHandler_handleServerAboutToStart = new ReflectorMethod(FMLCommonHandler, "handleServerAboutToStart"); + public static ReflectorMethod FMLCommonHandler_handleServerStarting = new ReflectorMethod(FMLCommonHandler, "handleServerStarting"); + public static ReflectorMethod FMLCommonHandler_instance = new ReflectorMethod(FMLCommonHandler, "instance"); + public static ReflectorClass ForgeBiome = new ReflectorClass(BiomeGenBase.class); + public static ReflectorMethod ForgeBiome_getWaterColorMultiplier = new ReflectorMethod(ForgeBiome, "getWaterColorMultiplier"); + public static ReflectorClass ForgeBlock = new ReflectorClass(Block.class); + public static ReflectorMethod ForgeBlock_addDestroyEffects = new ReflectorMethod(ForgeBlock, "addDestroyEffects"); + public static ReflectorMethod ForgeBlock_addHitEffects = new ReflectorMethod(ForgeBlock, "addHitEffects"); + public static ReflectorMethod ForgeBlock_canCreatureSpawn = new ReflectorMethod(ForgeBlock, "canCreatureSpawn"); + public static ReflectorMethod ForgeBlock_canRenderInLayer = new ReflectorMethod(ForgeBlock, "canRenderInLayer", new Class[] {EnumWorldBlockLayer.class}); + public static ReflectorMethod ForgeBlock_doesSideBlockRendering = new ReflectorMethod(ForgeBlock, "doesSideBlockRendering"); + public static ReflectorMethod ForgeBlock_getBedDirection = new ReflectorMethod(ForgeBlock, "getBedDirection"); + public static ReflectorMethod ForgeBlock_getExtendedState = new ReflectorMethod(ForgeBlock, "getExtendedState"); + public static ReflectorMethod ForgeBlock_getLightOpacity = new ReflectorMethod(ForgeBlock, "getLightOpacity", new Class[] {IBlockAccess.class, BlockPos.class}); + public static ReflectorMethod ForgeBlock_getLightValue = new ReflectorMethod(ForgeBlock, "getLightValue", new Class[] {IBlockAccess.class, BlockPos.class}); + public static ReflectorMethod ForgeBlock_hasTileEntity = new ReflectorMethod(ForgeBlock, "hasTileEntity", new Class[] {IBlockState.class}); + public static ReflectorMethod ForgeBlock_isAir = new ReflectorMethod(ForgeBlock, "isAir"); + public static ReflectorMethod ForgeBlock_isBed = new ReflectorMethod(ForgeBlock, "isBed"); + public static ReflectorMethod ForgeBlock_isBedFoot = new ReflectorMethod(ForgeBlock, "isBedFoot"); + public static ReflectorMethod ForgeBlock_isSideSolid = new ReflectorMethod(ForgeBlock, "isSideSolid"); + public static ReflectorClass ForgeChunkCache = new ReflectorClass(ChunkCache.class); + public static ReflectorMethod ForgeChunkCache_isSideSolid = new ReflectorMethod(ForgeChunkCache, "isSideSolid"); + public static ReflectorClass ForgeEntity = new ReflectorClass(Entity.class); + public static ReflectorMethod ForgeEntity_canRiderInteract = new ReflectorMethod(ForgeEntity, "canRiderInteract"); + public static ReflectorField ForgeEntity_captureDrops = new ReflectorField(ForgeEntity, "captureDrops"); + public static ReflectorField ForgeEntity_capturedDrops = new ReflectorField(ForgeEntity, "capturedDrops"); + public static ReflectorMethod ForgeEntity_shouldRenderInPass = new ReflectorMethod(ForgeEntity, "shouldRenderInPass"); + public static ReflectorMethod ForgeEntity_shouldRiderSit = new ReflectorMethod(ForgeEntity, "shouldRiderSit"); + public static ReflectorClass ForgeEventFactory = new ReflectorClass("net.minecraftforge.event.ForgeEventFactory"); + public static ReflectorMethod ForgeEventFactory_canEntityDespawn = new ReflectorMethod(ForgeEventFactory, "canEntityDespawn"); + public static ReflectorMethod ForgeEventFactory_canEntitySpawn = new ReflectorMethod(ForgeEventFactory, "canEntitySpawn"); + public static ReflectorMethod ForgeEventFactory_doSpecialSpawn = new ReflectorMethod(ForgeEventFactory, "doSpecialSpawn", new Class[] {EntityLiving.class, World.class, Float.TYPE, Float.TYPE, Float.TYPE}); + public static ReflectorMethod ForgeEventFactory_getMaxSpawnPackSize = new ReflectorMethod(ForgeEventFactory, "getMaxSpawnPackSize"); + public static ReflectorMethod ForgeEventFactory_renderBlockOverlay = new ReflectorMethod(ForgeEventFactory, "renderBlockOverlay"); + public static ReflectorMethod ForgeEventFactory_renderFireOverlay = new ReflectorMethod(ForgeEventFactory, "renderFireOverlay"); + public static ReflectorMethod ForgeEventFactory_renderWaterOverlay = new ReflectorMethod(ForgeEventFactory, "renderWaterOverlay"); + public static ReflectorClass ForgeHooks = new ReflectorClass("net.minecraftforge.common.ForgeHooks"); + public static ReflectorMethod ForgeHooks_onLivingAttack = new ReflectorMethod(ForgeHooks, "onLivingAttack"); + public static ReflectorMethod ForgeHooks_onLivingDeath = new ReflectorMethod(ForgeHooks, "onLivingDeath"); + public static ReflectorMethod ForgeHooks_onLivingDrops = new ReflectorMethod(ForgeHooks, "onLivingDrops"); + public static ReflectorMethod ForgeHooks_onLivingFall = new ReflectorMethod(ForgeHooks, "onLivingFall"); + public static ReflectorMethod ForgeHooks_onLivingHurt = new ReflectorMethod(ForgeHooks, "onLivingHurt"); + public static ReflectorMethod ForgeHooks_onLivingJump = new ReflectorMethod(ForgeHooks, "onLivingJump"); + public static ReflectorMethod ForgeHooks_onLivingSetAttackTarget = new ReflectorMethod(ForgeHooks, "onLivingSetAttackTarget"); + public static ReflectorMethod ForgeHooks_onLivingUpdate = new ReflectorMethod(ForgeHooks, "onLivingUpdate"); + public static ReflectorClass ForgeHooksClient = new ReflectorClass("net.minecraftforge.client.ForgeHooksClient"); + public static ReflectorMethod ForgeHooksClient_applyTransform = new ReflectorMethod(ForgeHooksClient, "applyTransform", new Class[] {Matrix4f.class, Optional.class}); + public static ReflectorMethod ForgeHooksClient_dispatchRenderLast = new ReflectorMethod(ForgeHooksClient, "dispatchRenderLast"); + public static ReflectorMethod ForgeHooksClient_drawScreen = new ReflectorMethod(ForgeHooksClient, "drawScreen"); + public static ReflectorMethod ForgeHooksClient_fillNormal = new ReflectorMethod(ForgeHooksClient, "fillNormal"); + public static ReflectorMethod ForgeHooksClient_handleCameraTransforms = new ReflectorMethod(ForgeHooksClient, "handleCameraTransforms"); + public static ReflectorMethod ForgeHooksClient_getArmorModel = new ReflectorMethod(ForgeHooksClient, "getArmorModel"); + public static ReflectorMethod ForgeHooksClient_getArmorTexture = new ReflectorMethod(ForgeHooksClient, "getArmorTexture"); + public static ReflectorMethod ForgeHooksClient_getFogDensity = new ReflectorMethod(ForgeHooksClient, "getFogDensity"); + public static ReflectorMethod ForgeHooksClient_getFOVModifier = new ReflectorMethod(ForgeHooksClient, "getFOVModifier"); + public static ReflectorMethod ForgeHooksClient_getMatrix = new ReflectorMethod(ForgeHooksClient, "getMatrix", new Class[] {ModelRotation.class}); + public static ReflectorMethod ForgeHooksClient_getOffsetFOV = new ReflectorMethod(ForgeHooksClient, "getOffsetFOV"); + public static ReflectorMethod ForgeHooksClient_loadEntityShader = new ReflectorMethod(ForgeHooksClient, "loadEntityShader"); + public static ReflectorMethod ForgeHooksClient_onDrawBlockHighlight = new ReflectorMethod(ForgeHooksClient, "onDrawBlockHighlight"); + public static ReflectorMethod ForgeHooksClient_onFogRender = new ReflectorMethod(ForgeHooksClient, "onFogRender"); + public static ReflectorMethod ForgeHooksClient_onTextureStitchedPre = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPre"); + public static ReflectorMethod ForgeHooksClient_onTextureStitchedPost = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPost"); + public static ReflectorMethod ForgeHooksClient_orientBedCamera = new ReflectorMethod(ForgeHooksClient, "orientBedCamera"); + public static ReflectorMethod ForgeHooksClient_putQuadColor = new ReflectorMethod(ForgeHooksClient, "putQuadColor"); + public static ReflectorMethod ForgeHooksClient_renderFirstPersonHand = new ReflectorMethod(ForgeHooksClient, "renderFirstPersonHand"); + public static ReflectorMethod ForgeHooksClient_renderMainMenu = new ReflectorMethod(ForgeHooksClient, "renderMainMenu"); + public static ReflectorMethod ForgeHooksClient_setRenderLayer = new ReflectorMethod(ForgeHooksClient, "setRenderLayer"); + public static ReflectorMethod ForgeHooksClient_setRenderPass = new ReflectorMethod(ForgeHooksClient, "setRenderPass"); + public static ReflectorMethod ForgeHooksClient_transform = new ReflectorMethod(ForgeHooksClient, "transform"); + public static ReflectorClass ForgeItem = new ReflectorClass(Item.class); + public static ReflectorField ForgeItem_delegate = new ReflectorField(ForgeItem, "delegate"); + public static ReflectorMethod ForgeItem_getDurabilityForDisplay = new ReflectorMethod(ForgeItem, "getDurabilityForDisplay"); + public static ReflectorMethod ForgeItem_getModel = new ReflectorMethod(ForgeItem, "getModel"); + public static ReflectorMethod ForgeItem_onEntitySwing = new ReflectorMethod(ForgeItem, "onEntitySwing"); + public static ReflectorMethod ForgeItem_shouldCauseReequipAnimation = new ReflectorMethod(ForgeItem, "shouldCauseReequipAnimation"); + public static ReflectorMethod ForgeItem_showDurabilityBar = new ReflectorMethod(ForgeItem, "showDurabilityBar"); + public static ReflectorClass ForgeModContainer = new ReflectorClass("net.minecraftforge.common.ForgeModContainer"); + public static ReflectorField ForgeModContainer_forgeLightPipelineEnabled = new ReflectorField(ForgeModContainer, "forgeLightPipelineEnabled"); + public static ReflectorClass ForgePotionEffect = new ReflectorClass(PotionEffect.class); + public static ReflectorMethod ForgePotionEffect_isCurativeItem = new ReflectorMethod(ForgePotionEffect, "isCurativeItem"); + public static ReflectorClass ForgeTileEntity = new ReflectorClass(TileEntity.class); + public static ReflectorMethod ForgeTileEntity_canRenderBreaking = new ReflectorMethod(ForgeTileEntity, "canRenderBreaking"); + public static ReflectorMethod ForgeTileEntity_getRenderBoundingBox = new ReflectorMethod(ForgeTileEntity, "getRenderBoundingBox"); + public static ReflectorMethod ForgeTileEntity_hasFastRenderer = new ReflectorMethod(ForgeTileEntity, "hasFastRenderer"); + public static ReflectorMethod ForgeTileEntity_shouldRenderInPass = new ReflectorMethod(ForgeTileEntity, "shouldRenderInPass"); + public static ReflectorClass ForgeVertexFormatElementEnumUseage = new ReflectorClass(EnumUsage.class); + public static ReflectorMethod ForgeVertexFormatElementEnumUseage_preDraw = new ReflectorMethod(ForgeVertexFormatElementEnumUseage, "preDraw"); + public static ReflectorMethod ForgeVertexFormatElementEnumUseage_postDraw = new ReflectorMethod(ForgeVertexFormatElementEnumUseage, "postDraw"); + public static ReflectorClass ForgeWorld = new ReflectorClass(World.class); + public static ReflectorMethod ForgeWorld_countEntities = new ReflectorMethod(ForgeWorld, "countEntities", new Class[] {EnumCreatureType.class, Boolean.TYPE}); + public static ReflectorMethod ForgeWorld_getPerWorldStorage = new ReflectorMethod(ForgeWorld, "getPerWorldStorage"); + public static ReflectorClass ForgeWorldProvider = new ReflectorClass(WorldProvider.class); + public static ReflectorMethod ForgeWorldProvider_getCloudRenderer = new ReflectorMethod(ForgeWorldProvider, "getCloudRenderer"); + public static ReflectorMethod ForgeWorldProvider_getSkyRenderer = new ReflectorMethod(ForgeWorldProvider, "getSkyRenderer"); + public static ReflectorMethod ForgeWorldProvider_getWeatherRenderer = new ReflectorMethod(ForgeWorldProvider, "getWeatherRenderer"); + public static ReflectorMethod ForgeWorldProvider_getSaveFolder = new ReflectorMethod(ForgeWorldProvider, "getSaveFolder"); + public static ReflectorClass GuiModList = new ReflectorClass("net.minecraftforge.fml.client.GuiModList"); + public static ReflectorConstructor GuiModList_Constructor = new ReflectorConstructor(GuiModList, new Class[] {GuiScreen.class}); + public static ReflectorClass IColoredBakedQuad = new ReflectorClass("net.minecraftforge.client.model.IColoredBakedQuad"); + public static ReflectorClass IExtendedBlockState = new ReflectorClass("net.minecraftforge.common.property.IExtendedBlockState"); + public static ReflectorMethod IExtendedBlockState_getClean = new ReflectorMethod(IExtendedBlockState, "getClean"); + public static ReflectorClass IModel = new ReflectorClass("net.minecraftforge.client.model.IModel"); + public static ReflectorMethod IModel_getTextures = new ReflectorMethod(IModel, "getTextures"); + public static ReflectorClass IRenderHandler = new ReflectorClass("net.minecraftforge.client.IRenderHandler"); + public static ReflectorMethod IRenderHandler_render = new ReflectorMethod(IRenderHandler, "render"); + public static ReflectorClass ItemModelMesherForge = new ReflectorClass("net.minecraftforge.client.ItemModelMesherForge"); + public static ReflectorConstructor ItemModelMesherForge_Constructor = new ReflectorConstructor(ItemModelMesherForge, new Class[] {ModelManager.class}); + public static ReflectorClass Launch = new ReflectorClass("net.minecraft.launchwrapper.Launch"); + public static ReflectorField Launch_blackboard = new ReflectorField(Launch, "blackboard"); + public static ReflectorClass LightUtil = new ReflectorClass("net.minecraftforge.client.model.pipeline.LightUtil"); + public static ReflectorField LightUtil_itemConsumer = new ReflectorField(LightUtil, "itemConsumer"); + public static ReflectorMethod LightUtil_putBakedQuad = new ReflectorMethod(LightUtil, "putBakedQuad"); + public static ReflectorMethod LightUtil_renderQuadColor = new ReflectorMethod(LightUtil, "renderQuadColor"); + public static ReflectorField LightUtil_tessellator = new ReflectorField(LightUtil, "tessellator"); + public static ReflectorClass Loader = new ReflectorClass("net.minecraftforge.fml.common.Loader"); + public static ReflectorMethod Loader_getActiveModList = new ReflectorMethod(Loader, "getActiveModList"); + public static ReflectorMethod Loader_instance = new ReflectorMethod(Loader, "instance"); + public static ReflectorClass MinecraftForge = new ReflectorClass("net.minecraftforge.common.MinecraftForge"); + public static ReflectorField MinecraftForge_EVENT_BUS = new ReflectorField(MinecraftForge, "EVENT_BUS"); + public static ReflectorClass MinecraftForgeClient = new ReflectorClass("net.minecraftforge.client.MinecraftForgeClient"); + public static ReflectorMethod MinecraftForgeClient_getRenderPass = new ReflectorMethod(MinecraftForgeClient, "getRenderPass"); + public static ReflectorMethod MinecraftForgeClient_onRebuildChunk = new ReflectorMethod(MinecraftForgeClient, "onRebuildChunk"); + public static ReflectorClass ModContainer = new ReflectorClass("net.minecraftforge.fml.common.ModContainer"); + public static ReflectorMethod ModContainer_getModId = new ReflectorMethod(ModContainer, "getModId"); + public static ReflectorClass ModelLoader = new ReflectorClass("net.minecraftforge.client.model.ModelLoader"); + public static ReflectorField ModelLoader_stateModels = new ReflectorField(ModelLoader, "stateModels"); + public static ReflectorMethod ModelLoader_onRegisterItems = new ReflectorMethod(ModelLoader, "onRegisterItems"); + public static ReflectorMethod ModelLoader_getInventoryVariant = new ReflectorMethod(ModelLoader, "getInventoryVariant"); + public static ReflectorField ModelLoader_textures = new ReflectorField(ModelLoader, "textures"); + public static ReflectorClass ModelLoader_VanillaLoader = new ReflectorClass("net.minecraftforge.client.model.ModelLoader$VanillaLoader"); + public static ReflectorField ModelLoader_VanillaLoader_INSTANCE = new ReflectorField(ModelLoader_VanillaLoader, "instance"); + public static ReflectorMethod ModelLoader_VanillaLoader_loadModel = new ReflectorMethod(ModelLoader_VanillaLoader, "loadModel"); + public static ReflectorClass RenderBlockOverlayEvent_OverlayType = new ReflectorClass("net.minecraftforge.client.event.RenderBlockOverlayEvent$OverlayType"); + public static ReflectorField RenderBlockOverlayEvent_OverlayType_BLOCK = new ReflectorField(RenderBlockOverlayEvent_OverlayType, "BLOCK"); + public static ReflectorClass RenderingRegistry = new ReflectorClass("net.minecraftforge.fml.client.registry.RenderingRegistry"); + public static ReflectorMethod RenderingRegistry_loadEntityRenderers = new ReflectorMethod(RenderingRegistry, "loadEntityRenderers", new Class[] {RenderManager.class, Map.class}); + public static ReflectorClass RenderItemInFrameEvent = new ReflectorClass("net.minecraftforge.client.event.RenderItemInFrameEvent"); + public static ReflectorConstructor RenderItemInFrameEvent_Constructor = new ReflectorConstructor(RenderItemInFrameEvent, new Class[] {EntityItemFrame.class, RenderItemFrame.class}); + public static ReflectorClass RenderLivingEvent_Pre = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Pre"); + public static ReflectorConstructor RenderLivingEvent_Pre_Constructor = new ReflectorConstructor(RenderLivingEvent_Pre, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass RenderLivingEvent_Post = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Post"); + public static ReflectorConstructor RenderLivingEvent_Post_Constructor = new ReflectorConstructor(RenderLivingEvent_Post, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass RenderLivingEvent_Specials_Pre = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Specials$Pre"); + public static ReflectorConstructor RenderLivingEvent_Specials_Pre_Constructor = new ReflectorConstructor(RenderLivingEvent_Specials_Pre, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass RenderLivingEvent_Specials_Post = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Specials$Post"); + public static ReflectorConstructor RenderLivingEvent_Specials_Post_Constructor = new ReflectorConstructor(RenderLivingEvent_Specials_Post, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass SplashScreen = new ReflectorClass("net.minecraftforge.fml.client.SplashProgress"); + public static ReflectorClass WorldEvent_Load = new ReflectorClass("net.minecraftforge.event.world.WorldEvent$Load"); + public static ReflectorConstructor WorldEvent_Load_Constructor = new ReflectorConstructor(WorldEvent_Load, new Class[] {World.class}); + private static boolean logVanilla = logEntry("*** Reflector Vanilla ***"); + public static ReflectorClass ChunkProviderClient = new ReflectorClass(ChunkProviderClient.class); + public static ReflectorField ChunkProviderClient_chunkMapping = new ReflectorField(ChunkProviderClient, LongHashMap.class); + public static ReflectorClass EntityVillager = new ReflectorClass(EntityVillager.class); + public static ReflectorField EntityVillager_careerId = new ReflectorField(new FieldLocatorTypes(EntityVillager.class, new Class[0], Integer.TYPE, new Class[] {Integer.TYPE, Boolean.TYPE, Boolean.TYPE, InventoryBasic.class}, "EntityVillager.careerId")); + public static ReflectorField EntityVillager_careerLevel = new ReflectorField(new FieldLocatorTypes(EntityVillager.class, new Class[] {Integer.TYPE}, Integer.TYPE, new Class[] {Boolean.TYPE, Boolean.TYPE, InventoryBasic.class}, "EntityVillager.careerLevel")); + public static ReflectorClass GuiBeacon = new ReflectorClass(GuiBeacon.class); + public static ReflectorField GuiBeacon_tileBeacon = new ReflectorField(GuiBeacon, IInventory.class); + public static ReflectorClass GuiBrewingStand = new ReflectorClass(GuiBrewingStand.class); + public static ReflectorField GuiBrewingStand_tileBrewingStand = new ReflectorField(GuiBrewingStand, IInventory.class); + public static ReflectorClass GuiChest = new ReflectorClass(GuiChest.class); + public static ReflectorField GuiChest_lowerChestInventory = new ReflectorField(GuiChest, IInventory.class, 1); + public static ReflectorClass GuiEnchantment = new ReflectorClass(GuiEnchantment.class); + public static ReflectorField GuiEnchantment_nameable = new ReflectorField(GuiEnchantment, IWorldNameable.class); + public static ReflectorClass GuiFurnace = new ReflectorClass(GuiFurnace.class); + public static ReflectorField GuiFurnace_tileFurnace = new ReflectorField(GuiFurnace, IInventory.class); + public static ReflectorClass GuiHopper = new ReflectorClass(GuiHopper.class); + public static ReflectorField GuiHopper_hopperInventory = new ReflectorField(GuiHopper, IInventory.class, 1); + public static ReflectorClass GuiMainMenu = new ReflectorClass(GuiMainMenu.class); + public static ReflectorField GuiMainMenu_splashText = new ReflectorField(GuiMainMenu, String.class); + public static ReflectorClass Minecraft = new ReflectorClass(Minecraft.class); + public static ReflectorField Minecraft_defaultResourcePack = new ReflectorField(Minecraft, DefaultResourcePack.class); + public static ReflectorClass ModelHumanoidHead = new ReflectorClass(ModelHumanoidHead.class); + public static ReflectorField ModelHumanoidHead_head = new ReflectorField(ModelHumanoidHead, ModelRenderer.class); + public static ReflectorClass ModelBat = new ReflectorClass(ModelBat.class); + public static ReflectorFields ModelBat_ModelRenderers = new ReflectorFields(ModelBat, ModelRenderer.class, 6); + public static ReflectorClass ModelBlaze = new ReflectorClass(ModelBlaze.class); + public static ReflectorField ModelBlaze_blazeHead = new ReflectorField(ModelBlaze, ModelRenderer.class); + public static ReflectorField ModelBlaze_blazeSticks = new ReflectorField(ModelBlaze, ModelRenderer[].class); + public static ReflectorClass ModelBlock = new ReflectorClass(ModelBlock.class); + public static ReflectorField ModelBlock_parentLocation = new ReflectorField(ModelBlock, ResourceLocation.class); + public static ReflectorField ModelBlock_textures = new ReflectorField(ModelBlock, Map.class); + public static ReflectorClass ModelDragon = new ReflectorClass(ModelDragon.class); + public static ReflectorFields ModelDragon_ModelRenderers = new ReflectorFields(ModelDragon, ModelRenderer.class, 12); + public static ReflectorClass ModelEnderCrystal = new ReflectorClass(ModelEnderCrystal.class); + public static ReflectorFields ModelEnderCrystal_ModelRenderers = new ReflectorFields(ModelEnderCrystal, ModelRenderer.class, 3); + public static ReflectorClass RenderEnderCrystal = new ReflectorClass(RenderEnderCrystal.class); + public static ReflectorField RenderEnderCrystal_modelEnderCrystal = new ReflectorField(RenderEnderCrystal, ModelBase.class, 0); + public static ReflectorClass ModelEnderMite = new ReflectorClass(ModelEnderMite.class); + public static ReflectorField ModelEnderMite_bodyParts = new ReflectorField(ModelEnderMite, ModelRenderer[].class); + public static ReflectorClass ModelGhast = new ReflectorClass(ModelGhast.class); + public static ReflectorField ModelGhast_body = new ReflectorField(ModelGhast, ModelRenderer.class); + public static ReflectorField ModelGhast_tentacles = new ReflectorField(ModelGhast, ModelRenderer[].class); + public static ReflectorClass ModelGuardian = new ReflectorClass(ModelGuardian.class); + public static ReflectorField ModelGuardian_body = new ReflectorField(ModelGuardian, ModelRenderer.class, 0); + public static ReflectorField ModelGuardian_eye = new ReflectorField(ModelGuardian, ModelRenderer.class, 1); + public static ReflectorField ModelGuardian_spines = new ReflectorField(ModelGuardian, ModelRenderer[].class, 0); + public static ReflectorField ModelGuardian_tail = new ReflectorField(ModelGuardian, ModelRenderer[].class, 1); + public static ReflectorClass ModelHorse = new ReflectorClass(ModelHorse.class); + public static ReflectorFields ModelHorse_ModelRenderers = new ReflectorFields(ModelHorse, ModelRenderer.class, 39); + public static ReflectorClass RenderLeashKnot = new ReflectorClass(RenderLeashKnot.class); + public static ReflectorField RenderLeashKnot_leashKnotModel = new ReflectorField(RenderLeashKnot, ModelLeashKnot.class); + public static ReflectorClass ModelMagmaCube = new ReflectorClass(ModelMagmaCube.class); + public static ReflectorField ModelMagmaCube_core = new ReflectorField(ModelMagmaCube, ModelRenderer.class); + public static ReflectorField ModelMagmaCube_segments = new ReflectorField(ModelMagmaCube, ModelRenderer[].class); + public static ReflectorClass ModelOcelot = new ReflectorClass(ModelOcelot.class); + public static ReflectorFields ModelOcelot_ModelRenderers = new ReflectorFields(ModelOcelot, ModelRenderer.class, 8); + public static ReflectorClass ModelRabbit = new ReflectorClass(ModelRabbit.class); + public static ReflectorFields ModelRabbit_renderers = new ReflectorFields(ModelRabbit, ModelRenderer.class, 12); + public static ReflectorClass ModelSilverfish = new ReflectorClass(ModelSilverfish.class); + public static ReflectorField ModelSilverfish_bodyParts = new ReflectorField(ModelSilverfish, ModelRenderer[].class, 0); + public static ReflectorField ModelSilverfish_wingParts = new ReflectorField(ModelSilverfish, ModelRenderer[].class, 1); + public static ReflectorClass ModelSlime = new ReflectorClass(ModelSlime.class); + public static ReflectorFields ModelSlime_ModelRenderers = new ReflectorFields(ModelSlime, ModelRenderer.class, 4); + public static ReflectorClass ModelSquid = new ReflectorClass(ModelSquid.class); + public static ReflectorField ModelSquid_body = new ReflectorField(ModelSquid, ModelRenderer.class); + public static ReflectorField ModelSquid_tentacles = new ReflectorField(ModelSquid, ModelRenderer[].class); + public static ReflectorClass ModelWitch = new ReflectorClass(ModelWitch.class); + public static ReflectorField ModelWitch_mole = new ReflectorField(ModelWitch, ModelRenderer.class, 0); + public static ReflectorField ModelWitch_hat = new ReflectorField(ModelWitch, ModelRenderer.class, 1); + public static ReflectorClass ModelWither = new ReflectorClass(ModelWither.class); + public static ReflectorField ModelWither_bodyParts = new ReflectorField(ModelWither, ModelRenderer[].class, 0); + public static ReflectorField ModelWither_heads = new ReflectorField(ModelWither, ModelRenderer[].class, 1); + public static ReflectorClass ModelWolf = new ReflectorClass(ModelWolf.class); + public static ReflectorField ModelWolf_tail = new ReflectorField(ModelWolf, ModelRenderer.class, 6); + public static ReflectorField ModelWolf_mane = new ReflectorField(ModelWolf, ModelRenderer.class, 7); + public static ReflectorClass OptiFineClassTransformer = new ReflectorClass("optifine.OptiFineClassTransformer"); + public static ReflectorField OptiFineClassTransformer_instance = new ReflectorField(OptiFineClassTransformer, "instance"); + public static ReflectorMethod OptiFineClassTransformer_getOptiFineResource = new ReflectorMethod(OptiFineClassTransformer, "getOptiFineResource"); + public static ReflectorClass RenderBoat = new ReflectorClass(RenderBoat.class); + public static ReflectorField RenderBoat_modelBoat = new ReflectorField(RenderBoat, ModelBase.class); + public static ReflectorClass RenderMinecart = new ReflectorClass(RenderMinecart.class); + public static ReflectorField RenderMinecart_modelMinecart = new ReflectorField(RenderMinecart, ModelBase.class); + public static ReflectorClass RenderWitherSkull = new ReflectorClass(RenderWitherSkull.class); + public static ReflectorField RenderWitherSkull_model = new ReflectorField(RenderWitherSkull, ModelSkeletonHead.class); + public static ReflectorClass TileEntityBannerRenderer = new ReflectorClass(TileEntityBannerRenderer.class); + public static ReflectorField TileEntityBannerRenderer_bannerModel = new ReflectorField(TileEntityBannerRenderer, ModelBanner.class); + public static ReflectorClass TileEntityBeacon = new ReflectorClass(TileEntityBeacon.class); + public static ReflectorField TileEntityBeacon_customName = new ReflectorField(TileEntityBeacon, String.class); + public static ReflectorClass TileEntityBrewingStand = new ReflectorClass(TileEntityBrewingStand.class); + public static ReflectorField TileEntityBrewingStand_customName = new ReflectorField(TileEntityBrewingStand, String.class); + public static ReflectorClass TileEntityChestRenderer = new ReflectorClass(TileEntityChestRenderer.class); + public static ReflectorField TileEntityChestRenderer_simpleChest = new ReflectorField(TileEntityChestRenderer, ModelChest.class, 0); + public static ReflectorField TileEntityChestRenderer_largeChest = new ReflectorField(TileEntityChestRenderer, ModelChest.class, 1); + public static ReflectorClass TileEntityEnchantmentTable = new ReflectorClass(TileEntityEnchantmentTable.class); + public static ReflectorField TileEntityEnchantmentTable_customName = new ReflectorField(TileEntityEnchantmentTable, String.class); + public static ReflectorClass TileEntityEnchantmentTableRenderer = new ReflectorClass(TileEntityEnchantmentTableRenderer.class); + public static ReflectorField TileEntityEnchantmentTableRenderer_modelBook = new ReflectorField(TileEntityEnchantmentTableRenderer, ModelBook.class); + public static ReflectorClass TileEntityEnderChestRenderer = new ReflectorClass(TileEntityEnderChestRenderer.class); + public static ReflectorField TileEntityEnderChestRenderer_modelChest = new ReflectorField(TileEntityEnderChestRenderer, ModelChest.class); + public static ReflectorClass TileEntityFurnace = new ReflectorClass(TileEntityFurnace.class); + public static ReflectorField TileEntityFurnace_customName = new ReflectorField(TileEntityFurnace, String.class); + public static ReflectorClass TileEntitySignRenderer = new ReflectorClass(TileEntitySignRenderer.class); + public static ReflectorField TileEntitySignRenderer_model = new ReflectorField(TileEntitySignRenderer, ModelSign.class); + public static ReflectorClass TileEntitySkullRenderer = new ReflectorClass(TileEntitySkullRenderer.class); + public static ReflectorField TileEntitySkullRenderer_skeletonHead = new ReflectorField(TileEntitySkullRenderer, ModelSkeletonHead.class, 0); + public static ReflectorField TileEntitySkullRenderer_humanoidHead = new ReflectorField(TileEntitySkullRenderer, ModelSkeletonHead.class, 1); + + public static void callVoid(ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return; + } + + method.invoke((Object)null, params); + } + catch (Throwable throwable) + { + handleException(throwable, (Object)null, refMethod, params); + } + } + + public static boolean callBoolean(ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return false; + } + else + { + Boolean obool = (Boolean)method.invoke((Object)null, params); + return obool.booleanValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, (Object)null, refMethod, params); + return false; + } + } + + public static int callInt(ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return 0; + } + else + { + Integer integer = (Integer)method.invoke((Object)null, params); + return integer.intValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, (Object)null, refMethod, params); + return 0; + } + } + + public static float callFloat(ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return 0.0F; + } + else + { + Float f = (Float)method.invoke((Object)null, params); + return f.floatValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, (Object)null, refMethod, params); + return 0.0F; + } + } + + public static double callDouble(ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return 0.0D; + } + else + { + Double d0 = (Double)method.invoke((Object)null, params); + return d0.doubleValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, (Object)null, refMethod, params); + return 0.0D; + } + } + + public static String callString(ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return null; + } + else + { + String s = (String)method.invoke((Object)null, params); + return s; + } + } + catch (Throwable throwable) + { + handleException(throwable, (Object)null, refMethod, params); + return null; + } + } + + public static Object call(ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return null; + } + else + { + Object object = method.invoke((Object)null, params); + return object; + } + } + catch (Throwable throwable) + { + handleException(throwable, (Object)null, refMethod, params); + return null; + } + } + + public static void callVoid(Object obj, ReflectorMethod refMethod, Object... params) + { + try + { + if (obj == null) + { + return; + } + + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return; + } + + method.invoke(obj, params); + } + catch (Throwable throwable) + { + handleException(throwable, obj, refMethod, params); + } + } + + public static boolean callBoolean(Object obj, ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return false; + } + else + { + Boolean obool = (Boolean)method.invoke(obj, params); + return obool.booleanValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, obj, refMethod, params); + return false; + } + } + + public static int callInt(Object obj, ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return 0; + } + else + { + Integer integer = (Integer)method.invoke(obj, params); + return integer.intValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, obj, refMethod, params); + return 0; + } + } + + public static float callFloat(Object obj, ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return 0.0F; + } + else + { + Float f = (Float)method.invoke(obj, params); + return f.floatValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, obj, refMethod, params); + return 0.0F; + } + } + + public static double callDouble(Object obj, ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return 0.0D; + } + else + { + Double d0 = (Double)method.invoke(obj, params); + return d0.doubleValue(); + } + } + catch (Throwable throwable) + { + handleException(throwable, obj, refMethod, params); + return 0.0D; + } + } + + public static String callString(Object obj, ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return null; + } + else + { + String s = (String)method.invoke(obj, params); + return s; + } + } + catch (Throwable throwable) + { + handleException(throwable, obj, refMethod, params); + return null; + } + } + + public static Object call(Object obj, ReflectorMethod refMethod, Object... params) + { + try + { + Method method = refMethod.getTargetMethod(); + + if (method == null) + { + return null; + } + else + { + Object object = method.invoke(obj, params); + return object; + } + } + catch (Throwable throwable) + { + handleException(throwable, obj, refMethod, params); + return null; + } + } + + public static Object getFieldValue(ReflectorField refField) + { + return getFieldValue((Object)null, refField); + } + + public static Object getFieldValue(Object obj, ReflectorField refField) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return null; + } + else + { + Object object = field.get(obj); + return object; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return null; + } + } + + public static boolean getFieldValueBoolean(ReflectorField refField, boolean def) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return def; + } + else + { + boolean flag = field.getBoolean((Object)null); + return flag; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return def; + } + } + + public static boolean getFieldValueBoolean(Object obj, ReflectorField refField, boolean def) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return def; + } + else + { + boolean flag = field.getBoolean(obj); + return flag; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return def; + } + } + + public static Object getFieldValue(ReflectorFields refFields, int index) + { + ReflectorField reflectorfield = refFields.getReflectorField(index); + return reflectorfield == null ? null : getFieldValue(reflectorfield); + } + + public static Object getFieldValue(Object obj, ReflectorFields refFields, int index) + { + ReflectorField reflectorfield = refFields.getReflectorField(index); + return reflectorfield == null ? null : getFieldValue(obj, reflectorfield); + } + + public static float getFieldValueFloat(Object obj, ReflectorField refField, float def) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return def; + } + else + { + float f = field.getFloat(obj); + return f; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return def; + } + } + + public static int getFieldValueInt(Object obj, ReflectorField refField, int def) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return def; + } + else + { + int i = field.getInt(obj); + return i; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return def; + } + } + + public static long getFieldValueLong(Object obj, ReflectorField refField, long def) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return def; + } + else + { + long i = field.getLong(obj); + return i; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return def; + } + } + + public static boolean setFieldValue(ReflectorField refField, Object value) + { + return setFieldValue((Object)null, refField, value); + } + + public static boolean setFieldValue(Object obj, ReflectorField refField, Object value) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return false; + } + else + { + field.set(obj, value); + return true; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return false; + } + } + + public static boolean setFieldValueInt(ReflectorField refField, int value) + { + return setFieldValueInt((Object)null, refField, value); + } + + public static boolean setFieldValueInt(Object obj, ReflectorField refField, int value) + { + try + { + Field field = refField.getTargetField(); + + if (field == null) + { + return false; + } + else + { + field.setInt(obj, value); + return true; + } + } + catch (Throwable throwable) + { + Log.error("", throwable); + return false; + } + } + + public static boolean postForgeBusEvent(ReflectorConstructor constr, Object... params) + { + Object object = newInstance(constr, params); + return object == null ? false : postForgeBusEvent(object); + } + + public static boolean postForgeBusEvent(Object event) + { + if (event == null) + { + return false; + } + else + { + Object object = getFieldValue(MinecraftForge_EVENT_BUS); + + if (object == null) + { + return false; + } + else + { + Object object1 = call(object, EventBus_post, new Object[] {event}); + + if (!(object1 instanceof Boolean)) + { + return false; + } + else + { + Boolean obool = (Boolean)object1; + return obool.booleanValue(); + } + } + } + } + + public static Object newInstance(ReflectorConstructor constr, Object... params) + { + Constructor constructor = constr.getTargetConstructor(); + + if (constructor == null) + { + return null; + } + else + { + try + { + Object object = constructor.newInstance(params); + return object; + } + catch (Throwable throwable) + { + handleException(throwable, constr, params); + return null; + } + } + } + + public static boolean matchesTypes(Class[] pTypes, Class[] cTypes) + { + if (pTypes.length != cTypes.length) + { + return false; + } + else + { + for (int i = 0; i < cTypes.length; ++i) + { + Class oclass = pTypes[i]; + Class oclass1 = cTypes[i]; + + if (oclass != oclass1) + { + return false; + } + } + + return true; + } + } + + private static void dbgCall(boolean isStatic, String callType, ReflectorMethod refMethod, Object[] params, Object retVal) + { + String s = refMethod.getTargetMethod().getDeclaringClass().getName(); + String s1 = refMethod.getTargetMethod().getName(); + String s2 = ""; + + if (isStatic) + { + s2 = " static"; + } + + Log.dbg(callType + s2 + " " + s + "." + s1 + "(" + ArrayUtils.arrayToString(params) + ") => " + retVal); + } + + private static void dbgCallVoid(boolean isStatic, String callType, ReflectorMethod refMethod, Object[] params) + { + String s = refMethod.getTargetMethod().getDeclaringClass().getName(); + String s1 = refMethod.getTargetMethod().getName(); + String s2 = ""; + + if (isStatic) + { + s2 = " static"; + } + + Log.dbg(callType + s2 + " " + s + "." + s1 + "(" + ArrayUtils.arrayToString(params) + ")"); + } + + private static void dbgFieldValue(boolean isStatic, String accessType, ReflectorField refField, Object val) + { + String s = refField.getTargetField().getDeclaringClass().getName(); + String s1 = refField.getTargetField().getName(); + String s2 = ""; + + if (isStatic) + { + s2 = " static"; + } + + Log.dbg(accessType + s2 + " " + s + "." + s1 + " => " + val); + } + + private static void handleException(Throwable e, Object obj, ReflectorMethod refMethod, Object[] params) + { + if (e instanceof InvocationTargetException) + { + Throwable throwable = e.getCause(); + + if (throwable instanceof RuntimeException) + { + RuntimeException runtimeexception = (RuntimeException)throwable; + throw runtimeexception; + } + else + { + Log.error("", e); + } + } + else + { + Log.warn("*** Exception outside of method ***"); + Log.warn("Method deactivated: " + refMethod.getTargetMethod()); + refMethod.deactivate(); + + if (e instanceof IllegalArgumentException) + { + Log.warn("*** IllegalArgumentException ***"); + Log.warn("Method: " + refMethod.getTargetMethod()); + Log.warn("Object: " + obj); + Log.warn("Parameter classes: " + ArrayUtils.arrayToString(getClasses(params))); + Log.warn("Parameters: " + ArrayUtils.arrayToString(params)); + } + + Log.warn("", e); + } + } + + private static void handleException(Throwable e, ReflectorConstructor refConstr, Object[] params) + { + if (e instanceof InvocationTargetException) + { + Log.error("", e); + } + else + { + Log.warn("*** Exception outside of constructor ***"); + Log.warn("Constructor deactivated: " + refConstr.getTargetConstructor()); + refConstr.deactivate(); + + if (e instanceof IllegalArgumentException) + { + Log.warn("*** IllegalArgumentException ***"); + Log.warn("Constructor: " + refConstr.getTargetConstructor()); + Log.warn("Parameter classes: " + ArrayUtils.arrayToString(getClasses(params))); + Log.warn("Parameters: " + ArrayUtils.arrayToString(params)); + } + + Log.warn("", e); + } + } + + private static Object[] getClasses(Object[] objs) + { + if (objs == null) + { + return new Class[0]; + } + else + { + Class[] aclass = new Class[objs.length]; + + for (int i = 0; i < aclass.length; ++i) + { + Object object = objs[i]; + + if (object != null) + { + aclass[i] = object.getClass(); + } + } + + return aclass; + } + } + + private static ReflectorField[] getReflectorFields(ReflectorClass parentClass, Class fieldType, int count) + { + ReflectorField[] areflectorfield = new ReflectorField[count]; + + for (int i = 0; i < areflectorfield.length; ++i) + { + areflectorfield[i] = new ReflectorField(parentClass, fieldType, i); + } + + return areflectorfield; + } + + private static boolean logEntry(String str) + { + LOGGER.info("[OptiFine] " + str); + return true; + } + + private static boolean registerResolvable(final String str) + { + IResolvable iresolvable = new IResolvable() + { + public void resolve() + { + Reflector.LOGGER.info("[OptiFine] " + str); + } + }; + ReflectorResolver.register(iresolvable); + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorClass.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorClass.java new file mode 100644 index 0000000..bf65010 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorClass.java @@ -0,0 +1,84 @@ +package net.optifine.reflect; + +import net.optifine.Log; + +public class ReflectorClass implements IResolvable +{ + private String targetClassName = null; + private boolean checked = false; + private Class targetClass = null; + + public ReflectorClass(String targetClassName) + { + this.targetClassName = targetClassName; + ReflectorResolver.register(this); + } + + public ReflectorClass(Class targetClass) + { + this.targetClass = targetClass; + this.targetClassName = targetClass.getName(); + this.checked = true; + } + + public Class getTargetClass() + { + if (this.checked) + { + return this.targetClass; + } + else + { + this.checked = true; + + try + { + this.targetClass = Class.forName(this.targetClassName); + } + catch (ClassNotFoundException var2) + { + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + } + + return this.targetClass; + } + } + + public boolean exists() + { + return this.getTargetClass() != null; + } + + public String getTargetClassName() + { + return this.targetClassName; + } + + public boolean isInstance(Object obj) + { + return this.getTargetClass() == null ? false : this.getTargetClass().isInstance(obj); + } + + public ReflectorField makeField(String name) + { + return new ReflectorField(this, name); + } + + public ReflectorMethod makeMethod(String name) + { + return new ReflectorMethod(this, name); + } + + public ReflectorMethod makeMethod(String name, Class[] paramTypes) + { + return new ReflectorMethod(this, name, paramTypes); + } + + public void resolve() + { + Class oclass = this.getTargetClass(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorConstructor.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorConstructor.java new file mode 100644 index 0000000..1999582 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorConstructor.java @@ -0,0 +1,99 @@ +package net.optifine.reflect; + +import java.lang.reflect.Constructor; +import net.optifine.Log; +import net.optifine.util.ArrayUtils; + +public class ReflectorConstructor implements IResolvable +{ + private ReflectorClass reflectorClass = null; + private Class[] parameterTypes = null; + private boolean checked = false; + private Constructor targetConstructor = null; + + public ReflectorConstructor(ReflectorClass reflectorClass, Class[] parameterTypes) + { + this.reflectorClass = reflectorClass; + this.parameterTypes = parameterTypes; + ReflectorResolver.register(this); + } + + public Constructor getTargetConstructor() + { + if (this.checked) + { + return this.targetConstructor; + } + else + { + this.checked = true; + Class oclass = this.reflectorClass.getTargetClass(); + + if (oclass == null) + { + return null; + } + else + { + try + { + this.targetConstructor = findConstructor(oclass, this.parameterTypes); + + if (this.targetConstructor == null) + { + } + + if (this.targetConstructor != null) + { + this.targetConstructor.setAccessible(true); + } + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + } + + return this.targetConstructor; + } + } + } + + private static Constructor findConstructor(Class cls, Class[] paramTypes) + { + Constructor[] aconstructor = cls.getDeclaredConstructors(); + + for (int i = 0; i < aconstructor.length; ++i) + { + Constructor constructor = aconstructor[i]; + Class[] aclass = constructor.getParameterTypes(); + + if (Reflector.matchesTypes(paramTypes, aclass)) + { + return constructor; + } + } + + return null; + } + + public boolean exists() + { + return this.checked ? this.targetConstructor != null : this.getTargetConstructor() != null; + } + + public void deactivate() + { + this.checked = true; + this.targetConstructor = null; + } + + public Object newInstance(Object... params) + { + return Reflector.newInstance(this, params); + } + + public void resolve() + { + Constructor constructor = this.getTargetConstructor(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorField.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorField.java new file mode 100644 index 0000000..b53a99e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorField.java @@ -0,0 +1,84 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; + +public class ReflectorField implements IResolvable +{ + private IFieldLocator fieldLocator; + private boolean checked; + private Field targetField; + + public ReflectorField(ReflectorClass reflectorClass, String targetFieldName) + { + this((IFieldLocator)(new FieldLocatorName(reflectorClass, targetFieldName))); + } + + public ReflectorField(ReflectorClass reflectorClass, Class targetFieldType) + { + this(reflectorClass, targetFieldType, 0); + } + + public ReflectorField(ReflectorClass reflectorClass, Class targetFieldType, int targetFieldIndex) + { + this((IFieldLocator)(new FieldLocatorType(reflectorClass, targetFieldType, targetFieldIndex))); + } + + public ReflectorField(Field field) + { + this((IFieldLocator)(new FieldLocatorFixed(field))); + } + + public ReflectorField(IFieldLocator fieldLocator) + { + this.fieldLocator = null; + this.checked = false; + this.targetField = null; + this.fieldLocator = fieldLocator; + ReflectorResolver.register(this); + } + + public Field getTargetField() + { + if (this.checked) + { + return this.targetField; + } + else + { + this.checked = true; + this.targetField = this.fieldLocator.getField(); + + if (this.targetField != null) + { + this.targetField.setAccessible(true); + } + + return this.targetField; + } + } + + public Object getValue() + { + return Reflector.getFieldValue((Object)null, this); + } + + public void setValue(Object value) + { + Reflector.setFieldValue((Object)null, this, value); + } + + public void setValue(Object obj, Object value) + { + Reflector.setFieldValue(obj, this, value); + } + + public boolean exists() + { + return this.getTargetField() != null; + } + + public void resolve() + { + Field field = this.getTargetField(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorFields.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorFields.java new file mode 100644 index 0000000..a47c1c4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorFields.java @@ -0,0 +1,48 @@ +package net.optifine.reflect; + +public class ReflectorFields +{ + private ReflectorClass reflectorClass; + private Class fieldType; + private int fieldCount; + private ReflectorField[] reflectorFields; + + public ReflectorFields(ReflectorClass reflectorClass, Class fieldType, int fieldCount) + { + this.reflectorClass = reflectorClass; + this.fieldType = fieldType; + + if (reflectorClass.exists()) + { + if (fieldType != null) + { + this.reflectorFields = new ReflectorField[fieldCount]; + + for (int i = 0; i < this.reflectorFields.length; ++i) + { + this.reflectorFields[i] = new ReflectorField(reflectorClass, fieldType, i); + } + } + } + } + + public ReflectorClass getReflectorClass() + { + return this.reflectorClass; + } + + public Class getFieldType() + { + return this.fieldType; + } + + public int getFieldCount() + { + return this.fieldCount; + } + + public ReflectorField getReflectorField(int index) + { + return index >= 0 && index < this.reflectorFields.length ? this.reflectorFields[index] : null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorForge.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorForge.java new file mode 100644 index 0000000..b8de6cd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorForge.java @@ -0,0 +1,164 @@ +package net.optifine.reflect; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.EntityLiving; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class ReflectorForge +{ + public static Object EVENT_RESULT_ALLOW = Reflector.getFieldValue(Reflector.Event_Result_ALLOW); + public static Object EVENT_RESULT_DENY = Reflector.getFieldValue(Reflector.Event_Result_DENY); + public static Object EVENT_RESULT_DEFAULT = Reflector.getFieldValue(Reflector.Event_Result_DEFAULT); + + public static void FMLClientHandler_trackBrokenTexture(ResourceLocation loc, String message) + { + if (!Reflector.FMLClientHandler_trackBrokenTexture.exists()) + { + Object object = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); + Reflector.call(object, Reflector.FMLClientHandler_trackBrokenTexture, new Object[] {loc, message}); + } + } + + public static void FMLClientHandler_trackMissingTexture(ResourceLocation loc) + { + if (!Reflector.FMLClientHandler_trackMissingTexture.exists()) + { + Object object = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); + Reflector.call(object, Reflector.FMLClientHandler_trackMissingTexture, new Object[] {loc}); + } + } + + public static void putLaunchBlackboard(String key, Object value) + { + Map map = (Map)Reflector.getFieldValue(Reflector.Launch_blackboard); + + if (map != null) + { + map.put(key, value); + } + } + + public static boolean renderFirstPersonHand(RenderGlobal renderGlobal, float partialTicks, int pass) + { + return !Reflector.ForgeHooksClient_renderFirstPersonHand.exists() ? false : Reflector.callBoolean(Reflector.ForgeHooksClient_renderFirstPersonHand, new Object[] {renderGlobal, Float.valueOf(partialTicks), Integer.valueOf(pass)}); + } + + public static InputStream getOptiFineResourceStream(String path) + { + if (!Reflector.OptiFineClassTransformer_instance.exists()) + { + return null; + } + else + { + Object object = Reflector.getFieldValue(Reflector.OptiFineClassTransformer_instance); + + if (object == null) + { + return null; + } + else + { + if (path.startsWith("/")) + { + path = path.substring(1); + } + + byte[] abyte = (byte[])((byte[])Reflector.call(object, Reflector.OptiFineClassTransformer_getOptiFineResource, new Object[] {path})); + + if (abyte == null) + { + return null; + } + else + { + InputStream inputstream = new ByteArrayInputStream(abyte); + return inputstream; + } + } + } + } + + public static boolean blockHasTileEntity(IBlockState state) + { + Block block = state.getBlock(); + return !Reflector.ForgeBlock_hasTileEntity.exists() ? block.hasTileEntity() : Reflector.callBoolean(block, Reflector.ForgeBlock_hasTileEntity, new Object[] {state}); + } + + public static boolean isItemDamaged(ItemStack stack) + { + return !Reflector.ForgeItem_showDurabilityBar.exists() ? stack.isItemDamaged() : Reflector.callBoolean(stack.getItem(), Reflector.ForgeItem_showDurabilityBar, new Object[] {stack}); + } + + public static boolean armorHasOverlay(ItemArmor itemArmor, ItemStack itemStack) + { + int i = itemArmor.getColor(itemStack); + return i != -1; + } + + public static MapData getMapData(ItemMap itemMap, ItemStack stack, World world) + { + return Reflector.ForgeHooksClient.exists() ? ((ItemMap)stack.getItem()).getMapData(stack, world) : itemMap.getMapData(stack, world); + } + + public static String[] getForgeModIds() + { + if (!Reflector.Loader.exists()) + { + return new String[0]; + } + else + { + Object object = Reflector.call(Reflector.Loader_instance, new Object[0]); + List list = (List)Reflector.call(object, Reflector.Loader_getActiveModList, new Object[0]); + + if (list == null) + { + return new String[0]; + } + else + { + List list1 = new ArrayList(); + + for (Object object1 : list) + { + if (Reflector.ModContainer.isInstance(object1)) + { + String s = Reflector.callString(object1, Reflector.ModContainer_getModId, new Object[0]); + + if (s != null) + { + list1.add(s); + } + } + } + + String[] astring = (String[])((String[])list1.toArray(new String[list1.size()])); + return astring; + } + } + } + + public static boolean canEntitySpawn(EntityLiving entityliving, World world, float x, float y, float z) + { + Object object = Reflector.call(Reflector.ForgeEventFactory_canEntitySpawn, new Object[] {entityliving, world, Float.valueOf(x), Float.valueOf(y), Float.valueOf(z)}); + return object == EVENT_RESULT_ALLOW || object == EVENT_RESULT_DEFAULT && entityliving.getCanSpawnHere() && entityliving.isNotColliding(); + } + + public static boolean doSpecialSpawn(EntityLiving entityliving, World world, float x, int y, float z) + { + return Reflector.ForgeEventFactory_doSpecialSpawn.exists() ? Reflector.callBoolean(Reflector.ForgeEventFactory_doSpecialSpawn, new Object[] {entityliving, world, Float.valueOf(x), Integer.valueOf(y), Float.valueOf(z)}): false; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorMethod.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorMethod.java new file mode 100644 index 0000000..9d034fe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorMethod.java @@ -0,0 +1,228 @@ +package net.optifine.reflect; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import net.optifine.Log; + +public class ReflectorMethod implements IResolvable +{ + private ReflectorClass reflectorClass; + private String targetMethodName; + private Class[] targetMethodParameterTypes; + private boolean checked; + private Method targetMethod; + + public ReflectorMethod(ReflectorClass reflectorClass, String targetMethodName) + { + this(reflectorClass, targetMethodName, (Class[])null); + } + + public ReflectorMethod(ReflectorClass reflectorClass, String targetMethodName, Class[] targetMethodParameterTypes) + { + this.reflectorClass = null; + this.targetMethodName = null; + this.targetMethodParameterTypes = null; + this.checked = false; + this.targetMethod = null; + this.reflectorClass = reflectorClass; + this.targetMethodName = targetMethodName; + this.targetMethodParameterTypes = targetMethodParameterTypes; + ReflectorResolver.register(this); + } + + public Method getTargetMethod() + { + if (this.checked) + { + return this.targetMethod; + } + else + { + this.checked = true; + Class oclass = this.reflectorClass.getTargetClass(); + + if (oclass == null) + { + return null; + } + else + { + try + { + if (this.targetMethodParameterTypes == null) + { + Method[] amethod = getMethods(oclass, this.targetMethodName); + + if (amethod.length <= 0) + { + return null; + } + + if (amethod.length > 1) + { + Log.warn("(Reflector) More than one method found: " + oclass.getName() + "." + this.targetMethodName); + + for (int i = 0; i < amethod.length; ++i) + { + Method method = amethod[i]; + Log.warn("(Reflector) - " + method); + } + + return null; + } + + this.targetMethod = amethod[0]; + } + else + { + this.targetMethod = getMethod(oclass, this.targetMethodName, this.targetMethodParameterTypes); + } + + if (this.targetMethod == null) + { + return null; + } + else + { + this.targetMethod.setAccessible(true); + return this.targetMethod; + } + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + return null; + } + } + } + } + + public boolean exists() + { + return this.checked ? this.targetMethod != null : this.getTargetMethod() != null; + } + + public Class getReturnType() + { + Method method = this.getTargetMethod(); + return method == null ? null : method.getReturnType(); + } + + public void deactivate() + { + this.checked = true; + this.targetMethod = null; + } + + public Object call(Object... params) + { + return Reflector.call(this, params); + } + + public boolean callBoolean(Object... params) + { + return Reflector.callBoolean(this, params); + } + + public int callInt(Object... params) + { + return Reflector.callInt(this, params); + } + + public float callFloat(Object... params) + { + return Reflector.callFloat(this, params); + } + + public double callDouble(Object... params) + { + return Reflector.callDouble(this, params); + } + + public String callString(Object... params) + { + return Reflector.callString(this, params); + } + + public Object call(Object param) + { + return Reflector.call(this, new Object[] {param}); + } + + public boolean callBoolean(Object param) + { + return Reflector.callBoolean(this, new Object[] {param}); + } + + public int callInt(Object param) + { + return Reflector.callInt(this, new Object[] {param}); + } + + public float callFloat(Object param) + { + return Reflector.callFloat(this, new Object[] {param}); + } + + public double callDouble(Object param) + { + return Reflector.callDouble(this, new Object[] {param}); + } + + public String callString1(Object param) + { + return Reflector.callString(this, new Object[] {param}); + } + + public void callVoid(Object... params) + { + Reflector.callVoid(this, params); + } + + public static Method getMethod(Class cls, String methodName, Class[] paramTypes) + { + Method[] amethod = cls.getDeclaredMethods(); + + for (int i = 0; i < amethod.length; ++i) + { + Method method = amethod[i]; + + if (method.getName().equals(methodName)) + { + Class[] aclass = method.getParameterTypes(); + + if (Reflector.matchesTypes(paramTypes, aclass)) + { + return method; + } + } + } + + return null; + } + + public static Method[] getMethods(Class cls, String methodName) + { + List list = new ArrayList(); + Method[] amethod = cls.getDeclaredMethods(); + + for (int i = 0; i < amethod.length; ++i) + { + Method method = amethod[i]; + + if (method.getName().equals(methodName)) + { + list.add(method); + } + } + + Method[] amethod1 = (Method[])((Method[])list.toArray(new Method[list.size()])); + return amethod1; + } + + public void resolve() + { + Method method = this.getTargetMethod(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorRaw.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorRaw.java new file mode 100644 index 0000000..0341062 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorRaw.java @@ -0,0 +1,205 @@ +package net.optifine.reflect; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ReflectorRaw +{ + public static Field getField(Class cls, Class fieldType) + { + try + { + Field[] afield = cls.getDeclaredFields(); + + for (int i = 0; i < afield.length; ++i) + { + Field field = afield[i]; + + if (field.getType() == fieldType) + { + field.setAccessible(true); + return field; + } + } + + return null; + } + catch (Exception var5) + { + return null; + } + } + + public static Field[] getFields(Class cls, Class fieldType) + { + try + { + Field[] afield = cls.getDeclaredFields(); + return getFields(afield, fieldType); + } + catch (Exception var3) + { + return null; + } + } + + public static Field[] getFields(Field[] fields, Class fieldType) + { + try + { + List list = new ArrayList(); + + for (int i = 0; i < fields.length; ++i) + { + Field field = fields[i]; + + if (field.getType() == fieldType) + { + field.setAccessible(true); + list.add(field); + } + } + + Field[] afield = (Field[])((Field[])list.toArray(new Field[list.size()])); + return afield; + } + catch (Exception var5) + { + return null; + } + } + + public static Field[] getFieldsAfter(Class cls, Field field, Class fieldType) + { + try + { + Field[] afield = cls.getDeclaredFields(); + List list = Arrays.asList(afield); + int i = list.indexOf(field); + + if (i < 0) + { + return new Field[0]; + } + else + { + List list1 = list.subList(i + 1, list.size()); + Field[] afield1 = (Field[])((Field[])list1.toArray(new Field[list1.size()])); + return getFields(afield1, fieldType); + } + } + catch (Exception var8) + { + return null; + } + } + + public static Field[] getFields(Object obj, Field[] fields, Class fieldType, Object value) + { + try + { + List list = new ArrayList(); + + for (int i = 0; i < fields.length; ++i) + { + Field field = fields[i]; + + if (field.getType() == fieldType) + { + boolean flag = Modifier.isStatic(field.getModifiers()); + + if ((obj != null || flag) && (obj == null || !flag)) + { + field.setAccessible(true); + Object object = field.get(obj); + + if (object == value) + { + list.add(field); + } + else if (object != null && value != null && object.equals(value)) + { + list.add(field); + } + } + } + } + + Field[] afield = (Field[])((Field[])list.toArray(new Field[list.size()])); + return afield; + } + catch (Exception var9) + { + return null; + } + } + + public static Field getField(Class cls, Class fieldType, int index) + { + Field[] afield = getFields(cls, fieldType); + return index >= 0 && index < afield.length ? afield[index] : null; + } + + public static Field getFieldAfter(Class cls, Field field, Class fieldType, int index) + { + Field[] afield = getFieldsAfter(cls, field, fieldType); + return index >= 0 && index < afield.length ? afield[index] : null; + } + + public static Object getFieldValue(Object obj, Class cls, Class fieldType) + { + ReflectorField reflectorfield = getReflectorField(cls, fieldType); + return reflectorfield == null ? null : (!reflectorfield.exists() ? null : Reflector.getFieldValue(obj, reflectorfield)); + } + + public static Object getFieldValue(Object obj, Class cls, Class fieldType, int index) + { + ReflectorField reflectorfield = getReflectorField(cls, fieldType, index); + return reflectorfield == null ? null : (!reflectorfield.exists() ? null : Reflector.getFieldValue(obj, reflectorfield)); + } + + public static boolean setFieldValue(Object obj, Class cls, Class fieldType, Object value) + { + ReflectorField reflectorfield = getReflectorField(cls, fieldType); + return reflectorfield == null ? false : (!reflectorfield.exists() ? false : Reflector.setFieldValue(obj, reflectorfield, value)); + } + + public static boolean setFieldValue(Object obj, Class cls, Class fieldType, int index, Object value) + { + ReflectorField reflectorfield = getReflectorField(cls, fieldType, index); + return reflectorfield == null ? false : (!reflectorfield.exists() ? false : Reflector.setFieldValue(obj, reflectorfield, value)); + } + + public static ReflectorField getReflectorField(Class cls, Class fieldType) + { + Field field = getField(cls, fieldType); + + if (field == null) + { + return null; + } + else + { + ReflectorClass reflectorclass = new ReflectorClass(cls); + return new ReflectorField(reflectorclass, field.getName()); + } + } + + public static ReflectorField getReflectorField(Class cls, Class fieldType, int index) + { + Field field = getField(cls, fieldType, index); + + if (field == null) + { + return null; + } + else + { + ReflectorClass reflectorclass = new ReflectorClass(cls); + return new ReflectorField(reflectorclass, field.getName()); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorResolver.java b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorResolver.java new file mode 100644 index 0000000..05c8d58 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/reflect/ReflectorResolver.java @@ -0,0 +1,36 @@ +package net.optifine.reflect; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ReflectorResolver +{ + private static final List RESOLVABLES = Collections.synchronizedList(new ArrayList()); + private static boolean resolved = false; + + protected static void register(IResolvable resolvable) + { + if (!resolved) + { + RESOLVABLES.add(resolvable); + } + else + { + resolvable.resolve(); + } + } + + public static void resolve() + { + if (!resolved) + { + for (IResolvable iresolvable : RESOLVABLES) + { + iresolvable.resolve(); + } + + resolved = true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/AabbFrame.java b/Client-1.8.9/src/main/java/net/optifine/render/AabbFrame.java new file mode 100644 index 0000000..3061e18 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/AabbFrame.java @@ -0,0 +1,27 @@ +package net.optifine.render; + +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.util.AxisAlignedBB; + +public class AabbFrame extends AxisAlignedBB +{ + private int frameCount = -1; + private boolean inFrustumFully = false; + + public AabbFrame(double x1, double y1, double z1, double x2, double y2, double z2) + { + super(x1, y1, z1, x2, y2, z2); + } + + public boolean isBoundingBoxInFrustumFully(ICamera camera, int frameCount) + { + if (this.frameCount != frameCount) + { + this.inFrustumFully = camera instanceof Frustum ? ((Frustum)camera).isBoxInFrustumFully(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ) : false; + this.frameCount = frameCount; + } + + return this.inFrustumFully; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/Blender.java b/Client-1.8.9/src/main/java/net/optifine/render/Blender.java new file mode 100644 index 0000000..a78f55b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/Blender.java @@ -0,0 +1,149 @@ +package net.optifine.render; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.src.Config; + +public class Blender +{ + public static final int BLEND_ALPHA = 0; + public static final int BLEND_ADD = 1; + public static final int BLEND_SUBSTRACT = 2; + public static final int BLEND_MULTIPLY = 3; + public static final int BLEND_DODGE = 4; + public static final int BLEND_BURN = 5; + public static final int BLEND_SCREEN = 6; + public static final int BLEND_OVERLAY = 7; + public static final int BLEND_REPLACE = 8; + public static final int BLEND_DEFAULT = 1; + + public static int parseBlend(String str) + { + if (str == null) + { + return 1; + } + else + { + str = str.toLowerCase().trim(); + + if (str.equals("alpha")) + { + return 0; + } + else if (str.equals("add")) + { + return 1; + } + else if (str.equals("subtract")) + { + return 2; + } + else if (str.equals("multiply")) + { + return 3; + } + else if (str.equals("dodge")) + { + return 4; + } + else if (str.equals("burn")) + { + return 5; + } + else if (str.equals("screen")) + { + return 6; + } + else if (str.equals("overlay")) + { + return 7; + } + else if (str.equals("replace")) + { + return 8; + } + else + { + Config.warn("Unknown blend: " + str); + return 1; + } + } + } + + public static void setupBlend(int blend, float brightness) + { + switch (blend) + { + case 0: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.color(1.0F, 1.0F, 1.0F, brightness); + break; + + case 1: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 1); + GlStateManager.color(1.0F, 1.0F, 1.0F, brightness); + break; + + case 2: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(775, 0); + GlStateManager.color(brightness, brightness, brightness, 1.0F); + break; + + case 3: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(774, 771); + GlStateManager.color(brightness, brightness, brightness, brightness); + break; + + case 4: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(1, 1); + GlStateManager.color(brightness, brightness, brightness, 1.0F); + break; + + case 5: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(0, 769); + GlStateManager.color(brightness, brightness, brightness, 1.0F); + break; + + case 6: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(1, 769); + GlStateManager.color(brightness, brightness, brightness, 1.0F); + break; + + case 7: + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(774, 768); + GlStateManager.color(brightness, brightness, brightness, 1.0F); + break; + + case 8: + GlStateManager.enableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, brightness); + } + + GlStateManager.enableTexture2D(); + } + + public static void clearBlend(float rainBrightness) + { + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 1); + GlStateManager.color(1.0F, 1.0F, 1.0F, rainBrightness); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/ChunkVisibility.java b/Client-1.8.9/src/main/java/net/optifine/render/ChunkVisibility.java new file mode 100644 index 0000000..75e64d8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/ChunkVisibility.java @@ -0,0 +1,203 @@ +package net.optifine.render; + +import java.util.ArrayList; +import java.util.ConcurrentModificationException; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ClassInheritanceMultiMap; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +public class ChunkVisibility +{ + public static final int MASK_FACINGS = 63; + public static final EnumFacing[][] enumFacingArrays = makeEnumFacingArrays(false); + public static final EnumFacing[][] enumFacingOppositeArrays = makeEnumFacingArrays(true); + private static int counter = 0; + private static int iMaxStatic = -1; + private static int iMaxStaticFinal = 16; + private static World worldLast = null; + private static int pcxLast = Integer.MIN_VALUE; + private static int pczLast = Integer.MIN_VALUE; + + public static int getMaxChunkY(World world, Entity viewEntity, int renderDistanceChunks) + { + int i = MathHelper.floor_double(viewEntity.posX) >> 4; + int j = MathHelper.floor_double(viewEntity.posY) >> 4; + int k = MathHelper.floor_double(viewEntity.posZ) >> 4; + Chunk chunk = world.getChunkFromChunkCoords(i, k); + int l = i - renderDistanceChunks; + int i1 = i + renderDistanceChunks; + int j1 = k - renderDistanceChunks; + int k1 = k + renderDistanceChunks; + + if (world != worldLast || i != pcxLast || k != pczLast) + { + counter = 0; + iMaxStaticFinal = 16; + worldLast = world; + pcxLast = i; + pczLast = k; + } + + if (counter == 0) + { + iMaxStatic = -1; + } + + int l1 = iMaxStatic; + + switch (counter) + { + case 0: + i1 = i; + k1 = k; + break; + + case 1: + l = i; + k1 = k; + break; + + case 2: + i1 = i; + j1 = k; + break; + + case 3: + l = i; + j1 = k; + } + + for (int i2 = l; i2 < i1; ++i2) + { + for (int j2 = j1; j2 < k1; ++j2) + { + Chunk chunk1 = world.getChunkFromChunkCoords(i2, j2); + + if (!chunk1.isEmpty()) + { + ExtendedBlockStorage[] aextendedblockstorage = chunk1.getBlockStorageArray(); + + for (int k2 = aextendedblockstorage.length - 1; k2 > l1; --k2) + { + ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[k2]; + + if (extendedblockstorage != null && !extendedblockstorage.isEmpty()) + { + if (k2 > l1) + { + l1 = k2; + } + + break; + } + } + + try + { + Map map = chunk1.getTileEntityMap(); + + if (!map.isEmpty()) + { + for (BlockPos blockpos : map.keySet()) + { + int l2 = blockpos.getY() >> 4; + + if (l2 > l1) + { + l1 = l2; + } + } + } + } + catch (ConcurrentModificationException var21) + { + ; + } + + ClassInheritanceMultiMap[] classinheritancemultimap = chunk1.getEntityLists(); + + for (int i3 = classinheritancemultimap.length - 1; i3 > l1; --i3) + { + ClassInheritanceMultiMap classinheritancemultimap1 = classinheritancemultimap[i3]; + + if (!classinheritancemultimap1.isEmpty() && (chunk1 != chunk || i3 != j || classinheritancemultimap1.size() != 1)) + { + if (i3 > l1) + { + l1 = i3; + } + + break; + } + } + } + } + } + + if (counter < 3) + { + iMaxStatic = l1; + l1 = iMaxStaticFinal; + } + else + { + iMaxStaticFinal = l1; + iMaxStatic = -1; + } + + counter = (counter + 1) % 4; + return l1 << 4; + } + + public static boolean isFinished() + { + return counter == 0; + } + + private static EnumFacing[][] makeEnumFacingArrays(boolean opposite) + { + int i = 64; + EnumFacing[][] aenumfacing = new EnumFacing[i][]; + + for (int j = 0; j < i; ++j) + { + List list = new ArrayList(); + + for (int k = 0; k < EnumFacing.VALUES.length; ++k) + { + EnumFacing enumfacing = EnumFacing.VALUES[k]; + EnumFacing enumfacing1 = opposite ? enumfacing.getOpposite() : enumfacing; + int l = 1 << enumfacing1.ordinal(); + + if ((j & l) != 0) + { + list.add(enumfacing); + } + } + + EnumFacing[] aenumfacing1 = (EnumFacing[])list.toArray(new EnumFacing[list.size()]); + aenumfacing[j] = aenumfacing1; + } + + return aenumfacing; + } + + public static EnumFacing[] getFacingsNotOpposite(int setDisabled) + { + int i = ~setDisabled & 63; + return enumFacingOppositeArrays[i]; + } + + public static void reset() + { + worldLast = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/CloudRenderer.java b/Client-1.8.9/src/main/java/net/optifine/render/CloudRenderer.java new file mode 100644 index 0000000..be64059 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/CloudRenderer.java @@ -0,0 +1,123 @@ +package net.optifine.render; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +public class CloudRenderer +{ + private Minecraft mc; + private boolean updated = false; + private boolean renderFancy = false; + int cloudTickCounter; + private Vec3 cloudColor; + float partialTicks; + private boolean updateRenderFancy = false; + private int updateCloudTickCounter = 0; + private Vec3 updateCloudColor = new Vec3(-1.0D, -1.0D, -1.0D); + private double updatePlayerX = 0.0D; + private double updatePlayerY = 0.0D; + private double updatePlayerZ = 0.0D; + private int glListClouds = -1; + + public CloudRenderer(Minecraft mc) + { + this.mc = mc; + this.glListClouds = GLAllocation.generateDisplayLists(1); + } + + public void prepareToRender(boolean renderFancy, int cloudTickCounter, float partialTicks, Vec3 cloudColor) + { + this.renderFancy = renderFancy; + this.cloudTickCounter = cloudTickCounter; + this.partialTicks = partialTicks; + this.cloudColor = cloudColor; + } + + public boolean shouldUpdateGlList() + { + if (!this.updated) + { + return true; + } + else if (this.renderFancy != this.updateRenderFancy) + { + return true; + } + else if (this.cloudTickCounter >= this.updateCloudTickCounter + 20) + { + return true; + } + else if (Math.abs(this.cloudColor.xCoord - this.updateCloudColor.xCoord) > 0.003D) + { + return true; + } + else if (Math.abs(this.cloudColor.yCoord - this.updateCloudColor.yCoord) > 0.003D) + { + return true; + } + else if (Math.abs(this.cloudColor.zCoord - this.updateCloudColor.zCoord) > 0.003D) + { + return true; + } + else + { + Entity entity = this.mc.getRenderViewEntity(); + boolean flag = this.updatePlayerY + (double)entity.getEyeHeight() < 128.0D + (double)(this.mc.gameSettings.ofCloudsHeight * 128.0F); + boolean flag1 = entity.prevPosY + (double)entity.getEyeHeight() < 128.0D + (double)(this.mc.gameSettings.ofCloudsHeight * 128.0F); + return flag1 != flag; + } + } + + public void startUpdateGlList() + { + GL11.glNewList(this.glListClouds, GL11.GL_COMPILE); + } + + public void endUpdateGlList() + { + GL11.glEndList(); + this.updateRenderFancy = this.renderFancy; + this.updateCloudTickCounter = this.cloudTickCounter; + this.updateCloudColor = this.cloudColor; + this.updatePlayerX = this.mc.getRenderViewEntity().prevPosX; + this.updatePlayerY = this.mc.getRenderViewEntity().prevPosY; + this.updatePlayerZ = this.mc.getRenderViewEntity().prevPosZ; + this.updated = true; + GlStateManager.resetColor(); + } + + public void renderGlList() + { + Entity entity = this.mc.getRenderViewEntity(); + double d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double)this.partialTicks; + double d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double)this.partialTicks; + double d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double)this.partialTicks; + double d3 = (double)((float)(this.cloudTickCounter - this.updateCloudTickCounter) + this.partialTicks); + float f = (float)(d0 - this.updatePlayerX + d3 * 0.03D); + float f1 = (float)(d1 - this.updatePlayerY); + float f2 = (float)(d2 - this.updatePlayerZ); + GlStateManager.pushMatrix(); + + if (this.renderFancy) + { + GlStateManager.translate(-f / 12.0F, -f1, -f2 / 12.0F); + } + else + { + GlStateManager.translate(-f, -f1, -f2); + } + + GlStateManager.callList(this.glListClouds); + GlStateManager.popMatrix(); + GlStateManager.resetColor(); + } + + public void reset() + { + this.updated = false; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/GlAlphaState.java b/Client-1.8.9/src/main/java/net/optifine/render/GlAlphaState.java new file mode 100644 index 0000000..66d1f52 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/GlAlphaState.java @@ -0,0 +1,80 @@ +package net.optifine.render; + +public class GlAlphaState +{ + private boolean enabled; + private int func; + private float ref; + + public GlAlphaState() + { + this(false, 519, 0.0F); + } + + public GlAlphaState(boolean enabled) + { + this(enabled, 519, 0.0F); + } + + public GlAlphaState(boolean enabled, int func, float ref) + { + this.enabled = enabled; + this.func = func; + this.ref = ref; + } + + public void setState(boolean enabled, int func, float ref) + { + this.enabled = enabled; + this.func = func; + this.ref = ref; + } + + public void setState(GlAlphaState state) + { + this.enabled = state.enabled; + this.func = state.func; + this.ref = state.ref; + } + + public void setFuncRef(int func, float ref) + { + this.func = func; + this.ref = ref; + } + + public void setEnabled(boolean enabled) + { + this.enabled = enabled; + } + + public void setEnabled() + { + this.enabled = true; + } + + public void setDisabled() + { + this.enabled = false; + } + + public boolean isEnabled() + { + return this.enabled; + } + + public int getFunc() + { + return this.func; + } + + public float getRef() + { + return this.ref; + } + + public String toString() + { + return "enabled: " + this.enabled + ", func: " + this.func + ", ref: " + this.ref; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/GlBlendState.java b/Client-1.8.9/src/main/java/net/optifine/render/GlBlendState.java new file mode 100644 index 0000000..91676c9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/GlBlendState.java @@ -0,0 +1,118 @@ +package net.optifine.render; + +public class GlBlendState +{ + private boolean enabled; + private int srcFactor; + private int dstFactor; + private int srcFactorAlpha; + private int dstFactorAlpha; + + public GlBlendState() + { + this(false, 1, 0); + } + + public GlBlendState(boolean enabled) + { + this(enabled, 1, 0); + } + + public GlBlendState(boolean enabled, int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) + { + this.enabled = enabled; + this.srcFactor = srcFactor; + this.dstFactor = dstFactor; + this.srcFactorAlpha = srcFactorAlpha; + this.dstFactorAlpha = dstFactorAlpha; + } + + public GlBlendState(boolean enabled, int srcFactor, int dstFactor) + { + this(enabled, srcFactor, dstFactor, srcFactor, dstFactor); + } + + public void setState(boolean enabled, int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) + { + this.enabled = enabled; + this.srcFactor = srcFactor; + this.dstFactor = dstFactor; + this.srcFactorAlpha = srcFactorAlpha; + this.dstFactorAlpha = dstFactorAlpha; + } + + public void setState(GlBlendState state) + { + this.enabled = state.enabled; + this.srcFactor = state.srcFactor; + this.dstFactor = state.dstFactor; + this.srcFactorAlpha = state.srcFactorAlpha; + this.dstFactorAlpha = state.dstFactorAlpha; + } + + public void setEnabled(boolean enabled) + { + this.enabled = enabled; + } + + public void setEnabled() + { + this.enabled = true; + } + + public void setDisabled() + { + this.enabled = false; + } + + public void setFactors(int srcFactor, int dstFactor) + { + this.srcFactor = srcFactor; + this.dstFactor = dstFactor; + this.srcFactorAlpha = srcFactor; + this.dstFactorAlpha = dstFactor; + } + + public void setFactors(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) + { + this.srcFactor = srcFactor; + this.dstFactor = dstFactor; + this.srcFactorAlpha = srcFactorAlpha; + this.dstFactorAlpha = dstFactorAlpha; + } + + public boolean isEnabled() + { + return this.enabled; + } + + public int getSrcFactor() + { + return this.srcFactor; + } + + public int getDstFactor() + { + return this.dstFactor; + } + + public int getSrcFactorAlpha() + { + return this.srcFactorAlpha; + } + + public int getDstFactorAlpha() + { + return this.dstFactorAlpha; + } + + public boolean isSeparate() + { + return this.srcFactor != this.srcFactorAlpha || this.dstFactor != this.dstFactorAlpha; + } + + public String toString() + { + return "enabled: " + this.enabled + ", src: " + this.srcFactor + ", dst: " + this.dstFactor + ", srcAlpha: " + this.srcFactorAlpha + ", dstAlpha: " + this.dstFactorAlpha; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/RenderEnv.java b/Client-1.8.9/src/main/java/net/optifine/render/RenderEnv.java new file mode 100644 index 0000000..35a1b4f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/RenderEnv.java @@ -0,0 +1,325 @@ +package net.optifine.render; + +import java.util.ArrayList; +import java.util.BitSet; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.BlockModelRenderer; +import net.minecraft.client.renderer.RegionRenderCacheBuilder; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.block.model.BreakingFour; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumWorldBlockLayer; +import net.optifine.BlockPosM; +import net.optifine.model.ListQuadsOverlay; + +public class RenderEnv +{ + private IBlockState blockState; + private BlockPos blockPos; + private int blockId = -1; + private int metadata = -1; + private int breakingAnimation = -1; + private int smartLeaves = -1; + private float[] quadBounds = new float[EnumFacing.VALUES.length * 2]; + private BitSet boundsFlags = new BitSet(3); + private BlockModelRenderer.AmbientOcclusionFace aoFace = new BlockModelRenderer.AmbientOcclusionFace(); + private BlockPosM colorizerBlockPosM = null; + private boolean[] borderFlags = null; + private boolean[] borderFlags2 = null; + private boolean[] borderFlags3 = null; + private EnumFacing[] borderDirections = null; + private List listQuadsCustomizer = new ArrayList(); + private List listQuadsCtmMultipass = new ArrayList(); + private BakedQuad[] arrayQuadsCtm1 = new BakedQuad[1]; + private BakedQuad[] arrayQuadsCtm2 = new BakedQuad[2]; + private BakedQuad[] arrayQuadsCtm3 = new BakedQuad[3]; + private BakedQuad[] arrayQuadsCtm4 = new BakedQuad[4]; + private RegionRenderCacheBuilder regionRenderCacheBuilder = null; + private ListQuadsOverlay[] listsQuadsOverlay = new ListQuadsOverlay[EnumWorldBlockLayer.values().length]; + private boolean overlaysRendered = false; + private static final int UNKNOWN = -1; + private static final int FALSE = 0; + private static final int TRUE = 1; + + public RenderEnv(IBlockState blockState, BlockPos blockPos) + { + this.blockState = blockState; + this.blockPos = blockPos; + } + + public void reset(IBlockState blockStateIn, BlockPos blockPosIn) + { + if (this.blockState != blockStateIn || this.blockPos != blockPosIn) + { + this.blockState = blockStateIn; + this.blockPos = blockPosIn; + this.blockId = -1; + this.metadata = -1; + this.breakingAnimation = -1; + this.smartLeaves = -1; + this.boundsFlags.clear(); + } + } + + public int getBlockId() + { + if (this.blockId < 0) + { + if (this.blockState instanceof BlockStateBase) + { + BlockStateBase blockstatebase = (BlockStateBase)this.blockState; + this.blockId = blockstatebase.getBlockId(); + } + else + { + this.blockId = Block.getIdFromBlock(this.blockState.getBlock()); + } + } + + return this.blockId; + } + + public int getMetadata() + { + if (this.metadata < 0) + { + if (this.blockState instanceof BlockStateBase) + { + BlockStateBase blockstatebase = (BlockStateBase)this.blockState; + this.metadata = blockstatebase.getMetadata(); + } + else + { + this.metadata = this.blockState.getBlock().getMetaFromState(this.blockState); + } + } + + return this.metadata; + } + + public float[] getQuadBounds() + { + return this.quadBounds; + } + + public BitSet getBoundsFlags() + { + return this.boundsFlags; + } + + public BlockModelRenderer.AmbientOcclusionFace getAoFace() + { + return this.aoFace; + } + + public boolean isBreakingAnimation(List listQuads) + { + if (this.breakingAnimation == -1 && listQuads.size() > 0) + { + if (listQuads.get(0) instanceof BreakingFour) + { + this.breakingAnimation = 1; + } + else + { + this.breakingAnimation = 0; + } + } + + return this.breakingAnimation == 1; + } + + public boolean isBreakingAnimation(BakedQuad quad) + { + if (this.breakingAnimation < 0) + { + if (quad instanceof BreakingFour) + { + this.breakingAnimation = 1; + } + else + { + this.breakingAnimation = 0; + } + } + + return this.breakingAnimation == 1; + } + + public boolean isBreakingAnimation() + { + return this.breakingAnimation == 1; + } + + public IBlockState getBlockState() + { + return this.blockState; + } + + public BlockPosM getColorizerBlockPosM() + { + if (this.colorizerBlockPosM == null) + { + this.colorizerBlockPosM = new BlockPosM(0, 0, 0); + } + + return this.colorizerBlockPosM; + } + + public boolean[] getBorderFlags() + { + if (this.borderFlags == null) + { + this.borderFlags = new boolean[4]; + } + + return this.borderFlags; + } + + public boolean[] getBorderFlags2() + { + if (this.borderFlags2 == null) + { + this.borderFlags2 = new boolean[4]; + } + + return this.borderFlags2; + } + + public boolean[] getBorderFlags3() + { + if (this.borderFlags3 == null) + { + this.borderFlags3 = new boolean[4]; + } + + return this.borderFlags3; + } + + public EnumFacing[] getBorderDirections() + { + if (this.borderDirections == null) + { + this.borderDirections = new EnumFacing[4]; + } + + return this.borderDirections; + } + + public EnumFacing[] getBorderDirections(EnumFacing dir0, EnumFacing dir1, EnumFacing dir2, EnumFacing dir3) + { + EnumFacing[] aenumfacing = this.getBorderDirections(); + aenumfacing[0] = dir0; + aenumfacing[1] = dir1; + aenumfacing[2] = dir2; + aenumfacing[3] = dir3; + return aenumfacing; + } + + public boolean isSmartLeaves() + { + if (this.smartLeaves == -1) + { + if (Config.isTreesSmart() && this.blockState.getBlock() instanceof BlockLeaves) + { + this.smartLeaves = 1; + } + else + { + this.smartLeaves = 0; + } + } + + return this.smartLeaves == 1; + } + + public List getListQuadsCustomizer() + { + return this.listQuadsCustomizer; + } + + public BakedQuad[] getArrayQuadsCtm(BakedQuad quad) + { + this.arrayQuadsCtm1[0] = quad; + return this.arrayQuadsCtm1; + } + + public BakedQuad[] getArrayQuadsCtm(BakedQuad quad0, BakedQuad quad1) + { + this.arrayQuadsCtm2[0] = quad0; + this.arrayQuadsCtm2[1] = quad1; + return this.arrayQuadsCtm2; + } + + public BakedQuad[] getArrayQuadsCtm(BakedQuad quad0, BakedQuad quad1, BakedQuad quad2) + { + this.arrayQuadsCtm3[0] = quad0; + this.arrayQuadsCtm3[1] = quad1; + this.arrayQuadsCtm3[2] = quad2; + return this.arrayQuadsCtm3; + } + + public BakedQuad[] getArrayQuadsCtm(BakedQuad quad0, BakedQuad quad1, BakedQuad quad2, BakedQuad quad3) + { + this.arrayQuadsCtm4[0] = quad0; + this.arrayQuadsCtm4[1] = quad1; + this.arrayQuadsCtm4[2] = quad2; + this.arrayQuadsCtm4[3] = quad3; + return this.arrayQuadsCtm4; + } + + public List getListQuadsCtmMultipass(BakedQuad[] quads) + { + this.listQuadsCtmMultipass.clear(); + + if (quads != null) + { + for (int i = 0; i < quads.length; ++i) + { + BakedQuad bakedquad = quads[i]; + this.listQuadsCtmMultipass.add(bakedquad); + } + } + + return this.listQuadsCtmMultipass; + } + + public RegionRenderCacheBuilder getRegionRenderCacheBuilder() + { + return this.regionRenderCacheBuilder; + } + + public void setRegionRenderCacheBuilder(RegionRenderCacheBuilder regionRenderCacheBuilder) + { + this.regionRenderCacheBuilder = regionRenderCacheBuilder; + } + + public ListQuadsOverlay getListQuadsOverlay(EnumWorldBlockLayer layer) + { + ListQuadsOverlay listquadsoverlay = this.listsQuadsOverlay[layer.ordinal()]; + + if (listquadsoverlay == null) + { + listquadsoverlay = new ListQuadsOverlay(); + this.listsQuadsOverlay[layer.ordinal()] = listquadsoverlay; + } + + return listquadsoverlay; + } + + public boolean isOverlaysRendered() + { + return this.overlaysRendered; + } + + public void setOverlaysRendered(boolean overlaysRendered) + { + this.overlaysRendered = overlaysRendered; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/VboRange.java b/Client-1.8.9/src/main/java/net/optifine/render/VboRange.java new file mode 100644 index 0000000..f2dc959 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/VboRange.java @@ -0,0 +1,57 @@ +package net.optifine.render; + +import net.optifine.util.LinkedList; + +public class VboRange +{ + private int position = -1; + private int size = 0; + private LinkedList.Node node = new LinkedList.Node(this); + + public int getPosition() + { + return this.position; + } + + public int getSize() + { + return this.size; + } + + public int getPositionNext() + { + return this.position + this.size; + } + + public void setPosition(int position) + { + this.position = position; + } + + public void setSize(int size) + { + this.size = size; + } + + public LinkedList.Node getNode() + { + return this.node; + } + + public VboRange getPrev() + { + LinkedList.Node node = this.node.getPrev(); + return node == null ? null : (VboRange)node.getItem(); + } + + public VboRange getNext() + { + LinkedList.Node node = this.node.getNext(); + return node == null ? null : (VboRange)node.getItem(); + } + + public String toString() + { + return "" + this.position + "/" + this.size + "/" + (this.position + this.size); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/render/VboRegion.java b/Client-1.8.9/src/main/java/net/optifine/render/VboRegion.java new file mode 100644 index 0000000..ab6186a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/render/VboRegion.java @@ -0,0 +1,310 @@ +package net.optifine.render; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.VboRenderList; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.src.Config; +import net.minecraft.util.EnumWorldBlockLayer; +import net.optifine.util.LinkedList; + +public class VboRegion +{ + private EnumWorldBlockLayer layer = null; + private int glBufferId = OpenGlHelper.glGenBuffers(); + private int capacity = 4096; + private int positionTop = 0; + private int sizeUsed; + private LinkedList rangeList = new LinkedList(); + private VboRange compactRangeLast = null; + private IntBuffer bufferIndexVertex; + private IntBuffer bufferCountVertex; + private int drawMode; + private final int vertexBytes; + + public VboRegion(EnumWorldBlockLayer layer) + { + this.bufferIndexVertex = Config.createDirectIntBuffer(this.capacity); + this.bufferCountVertex = Config.createDirectIntBuffer(this.capacity); + this.drawMode = 7; + this.vertexBytes = DefaultVertexFormats.BLOCK.getNextOffset(); + this.layer = layer; + this.bindBuffer(); + long i = this.toBytes(this.capacity); + OpenGlHelper.glBufferData(OpenGlHelper.GL_ARRAY_BUFFER, i, OpenGlHelper.GL_STATIC_DRAW); + this.unbindBuffer(); + } + + public void bufferData(ByteBuffer data, VboRange range) + { + int i = range.getPosition(); + int j = range.getSize(); + int k = this.toVertex((long)data.limit()); + + if (k <= 0) + { + if (i >= 0) + { + range.setPosition(-1); + range.setSize(0); + this.rangeList.remove(range.getNode()); + this.sizeUsed -= j; + } + } + else + { + if (k > j) + { + range.setPosition(this.positionTop); + range.setSize(k); + this.positionTop += k; + + if (i >= 0) + { + this.rangeList.remove(range.getNode()); + } + + this.rangeList.addLast(range.getNode()); + } + + range.setSize(k); + this.sizeUsed += k - j; + this.checkVboSize(range.getPositionNext()); + long l = this.toBytes(range.getPosition()); + this.bindBuffer(); + OpenGlHelper.glBufferSubData(OpenGlHelper.GL_ARRAY_BUFFER, l, data); + this.unbindBuffer(); + + if (this.positionTop > this.sizeUsed * 11 / 10) + { + this.compactRanges(1); + } + } + } + + private void compactRanges(int countMax) + { + if (!this.rangeList.isEmpty()) + { + VboRange vborange = this.compactRangeLast; + + if (vborange == null || !this.rangeList.contains(vborange.getNode())) + { + vborange = (VboRange)this.rangeList.getFirst().getItem(); + } + + int i = vborange.getPosition(); + VboRange vborange1 = vborange.getPrev(); + + if (vborange1 == null) + { + i = 0; + } + else + { + i = vborange1.getPositionNext(); + } + + int j = 0; + + while (vborange != null && j < countMax) + { + ++j; + + if (vborange.getPosition() == i) + { + i += vborange.getSize(); + vborange = vborange.getNext(); + } + else + { + int k = vborange.getPosition() - i; + + if (vborange.getSize() <= k) + { + this.copyVboData(vborange.getPosition(), i, vborange.getSize()); + vborange.setPosition(i); + i += vborange.getSize(); + vborange = vborange.getNext(); + } + else + { + this.checkVboSize(this.positionTop + vborange.getSize()); + this.copyVboData(vborange.getPosition(), this.positionTop, vborange.getSize()); + vborange.setPosition(this.positionTop); + this.positionTop += vborange.getSize(); + VboRange vborange2 = vborange.getNext(); + this.rangeList.remove(vborange.getNode()); + this.rangeList.addLast(vborange.getNode()); + vborange = vborange2; + } + } + } + + if (vborange == null) + { + this.positionTop = ((VboRange)this.rangeList.getLast().getItem()).getPositionNext(); + } + + this.compactRangeLast = vborange; + } + } + + private void checkRanges() + { + int i = 0; + int j = 0; + + for (VboRange vborange = (VboRange)this.rangeList.getFirst().getItem(); vborange != null; vborange = vborange.getNext()) + { + ++i; + j += vborange.getSize(); + + if (vborange.getPosition() < 0 || vborange.getSize() <= 0 || vborange.getPositionNext() > this.positionTop) + { + throw new RuntimeException("Invalid range: " + vborange); + } + + VboRange vborange1 = vborange.getPrev(); + + if (vborange1 != null && vborange.getPosition() < vborange1.getPositionNext()) + { + throw new RuntimeException("Invalid range: " + vborange); + } + + VboRange vborange2 = vborange.getNext(); + + if (vborange2 != null && vborange.getPositionNext() > vborange2.getPosition()) + { + throw new RuntimeException("Invalid range: " + vborange); + } + } + + if (i != this.rangeList.getSize()) + { + throw new RuntimeException("Invalid count: " + i + " <> " + this.rangeList.getSize()); + } + else if (j != this.sizeUsed) + { + throw new RuntimeException("Invalid size: " + j + " <> " + this.sizeUsed); + } + } + + private void checkVboSize(int sizeMin) + { + if (this.capacity < sizeMin) + { + this.expandVbo(sizeMin); + } + } + + private void copyVboData(int posFrom, int posTo, int size) + { + long i = this.toBytes(posFrom); + long j = this.toBytes(posTo); + long k = this.toBytes(size); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_READ_BUFFER, this.glBufferId); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_WRITE_BUFFER, this.glBufferId); + OpenGlHelper.glCopyBufferSubData(OpenGlHelper.GL_COPY_READ_BUFFER, OpenGlHelper.GL_COPY_WRITE_BUFFER, i, j, k); + Config.checkGlError("Copy VBO range"); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_READ_BUFFER, 0); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_WRITE_BUFFER, 0); + } + + private void expandVbo(int sizeMin) + { + int i; + + for (i = this.capacity * 6 / 4; i < sizeMin; i = i * 6 / 4) + { + ; + } + + long j = this.toBytes(this.capacity); + long k = this.toBytes(i); + int l = OpenGlHelper.glGenBuffers(); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, l); + OpenGlHelper.glBufferData(OpenGlHelper.GL_ARRAY_BUFFER, k, OpenGlHelper.GL_STATIC_DRAW); + Config.checkGlError("Expand VBO"); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_READ_BUFFER, this.glBufferId); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_WRITE_BUFFER, l); + OpenGlHelper.glCopyBufferSubData(OpenGlHelper.GL_COPY_READ_BUFFER, OpenGlHelper.GL_COPY_WRITE_BUFFER, 0L, 0L, j); + Config.checkGlError("Copy VBO: " + k); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_READ_BUFFER, 0); + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_COPY_WRITE_BUFFER, 0); + OpenGlHelper.glDeleteBuffers(this.glBufferId); + this.bufferIndexVertex = Config.createDirectIntBuffer(i); + this.bufferCountVertex = Config.createDirectIntBuffer(i); + this.glBufferId = l; + this.capacity = i; + } + + public void bindBuffer() + { + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, this.glBufferId); + } + + public void drawArrays(int drawMode, VboRange range) + { + if (this.drawMode != drawMode) + { + if (this.bufferIndexVertex.position() > 0) + { + throw new IllegalArgumentException("Mixed region draw modes: " + this.drawMode + " != " + drawMode); + } + + this.drawMode = drawMode; + } + + this.bufferIndexVertex.put(range.getPosition()); + this.bufferCountVertex.put(range.getSize()); + } + + public void finishDraw(VboRenderList vboRenderList) + { + this.bindBuffer(); + vboRenderList.setupArrayPointers(); + this.bufferIndexVertex.flip(); + this.bufferCountVertex.flip(); + GlStateManager.glMultiDrawArrays(this.drawMode, this.bufferIndexVertex, this.bufferCountVertex); + this.bufferIndexVertex.limit(this.bufferIndexVertex.capacity()); + this.bufferCountVertex.limit(this.bufferCountVertex.capacity()); + + if (this.positionTop > this.sizeUsed * 11 / 10) + { + this.compactRanges(1); + } + } + + public void unbindBuffer() + { + OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0); + } + + public void deleteGlBuffers() + { + if (this.glBufferId >= 0) + { + OpenGlHelper.glDeleteBuffers(this.glBufferId); + this.glBufferId = -1; + } + } + + private long toBytes(int vertex) + { + return (long)vertex * (long)this.vertexBytes; + } + + private int toVertex(long bytes) + { + return (int)(bytes / (long)this.vertexBytes); + } + + public int getPositionTop() + { + return this.positionTop; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/BlockAlias.java b/Client-1.8.9/src/main/java/net/optifine/shaders/BlockAlias.java new file mode 100644 index 0000000..527522c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/BlockAlias.java @@ -0,0 +1,79 @@ +package net.optifine.shaders; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import net.minecraft.src.Config; +import net.optifine.config.MatchBlock; + +public class BlockAlias +{ + private int blockAliasId; + private MatchBlock[] matchBlocks; + + public BlockAlias(int blockAliasId, MatchBlock[] matchBlocks) + { + this.blockAliasId = blockAliasId; + this.matchBlocks = matchBlocks; + } + + public int getBlockAliasId() + { + return this.blockAliasId; + } + + public boolean matches(int id, int metadata) + { + for (int i = 0; i < this.matchBlocks.length; ++i) + { + MatchBlock matchblock = this.matchBlocks[i]; + + if (matchblock.matches(id, metadata)) + { + return true; + } + } + + return false; + } + + public int[] getMatchBlockIds() + { + Set set = new HashSet(); + + for (int i = 0; i < this.matchBlocks.length; ++i) + { + MatchBlock matchblock = this.matchBlocks[i]; + int j = matchblock.getBlockId(); + set.add(Integer.valueOf(j)); + } + + Integer[] ainteger = (Integer[])set.toArray(new Integer[set.size()]); + int[] aint = Config.toPrimitive(ainteger); + return aint; + } + + public MatchBlock[] getMatchBlocks(int matchBlockId) + { + List list = new ArrayList(); + + for (int i = 0; i < this.matchBlocks.length; ++i) + { + MatchBlock matchblock = this.matchBlocks[i]; + + if (matchblock.getBlockId() == matchBlockId) + { + list.add(matchblock); + } + } + + MatchBlock[] amatchblock = (MatchBlock[])((MatchBlock[])list.toArray(new MatchBlock[list.size()])); + return amatchblock; + } + + public String toString() + { + return "block." + this.blockAliasId + "=" + Config.arrayToString((Object[])this.matchBlocks); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/BlockAliases.java b/Client-1.8.9/src/main/java/net/optifine/shaders/BlockAliases.java new file mode 100644 index 0000000..fec0ed8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/BlockAliases.java @@ -0,0 +1,244 @@ +package net.optifine.shaders; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.ConnectedParser; +import net.optifine.config.MatchBlock; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.shaders.config.MacroProcessor; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.StrUtils; + +public class BlockAliases +{ + private static BlockAlias[][] blockAliases = (BlockAlias[][])null; + private static PropertiesOrdered blockLayerPropertes = null; + private static boolean updateOnResourcesReloaded; + + public static int getBlockAliasId(int blockId, int metadata) + { + if (blockAliases == null) + { + return blockId; + } + else if (blockId >= 0 && blockId < blockAliases.length) + { + BlockAlias[] ablockalias = blockAliases[blockId]; + + if (ablockalias == null) + { + return blockId; + } + else + { + for (int i = 0; i < ablockalias.length; ++i) + { + BlockAlias blockalias = ablockalias[i]; + + if (blockalias.matches(blockId, metadata)) + { + return blockalias.getBlockAliasId(); + } + } + + return blockId; + } + } + else + { + return blockId; + } + } + + public static void resourcesReloaded() + { + if (updateOnResourcesReloaded) + { + updateOnResourcesReloaded = false; + update(Shaders.getShaderPack()); + } + } + + public static void update(IShaderPack shaderPack) + { + reset(); + + if (shaderPack != null) + { + if (Reflector.Loader_getActiveModList.exists() && Minecraft.getMinecraft().getResourcePackRepository() == null) + { + Config.dbg("[Shaders] Delayed loading of block mappings after resources are loaded"); + updateOnResourcesReloaded = true; + } + else + { + List> list = new ArrayList(); + String s = "/shaders/block.properties"; + InputStream inputstream = shaderPack.getResourceAsStream(s); + + if (inputstream != null) + { + loadBlockAliases(inputstream, s, list); + } + + loadModBlockAliases(list); + + if (((List)list).size() > 0) + { + blockAliases = toArrays(list); + } + } + } + } + + private static void loadModBlockAliases(List> listBlockAliases) + { + String[] astring = ReflectorForge.getForgeModIds(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s, "shaders/block.properties"); + InputStream inputstream = Config.getResourceStream(resourcelocation); + loadBlockAliases(inputstream, resourcelocation.toString(), listBlockAliases); + } + catch (IOException var6) + { + ; + } + } + } + + private static void loadBlockAliases(InputStream in, String path, List> listBlockAliases) + { + if (in != null) + { + try + { + in = MacroProcessor.process(in, path); + Properties properties = new PropertiesOrdered(); + properties.load(in); + in.close(); + Config.dbg("[Shaders] Parsing block mappings: " + path); + ConnectedParser connectedparser = new ConnectedParser("Shaders"); + + for (Object e : properties.keySet()) + { + String s = (String) e; + String s1 = properties.getProperty(s); + + if (s.startsWith("layer.")) + { + if (blockLayerPropertes == null) + { + blockLayerPropertes = new PropertiesOrdered(); + } + + blockLayerPropertes.put(s, s1); + } + else + { + String s2 = "block."; + + if (!s.startsWith(s2)) + { + Config.warn("[Shaders] Invalid block ID: " + s); + } + else + { + String s3 = StrUtils.removePrefix(s, s2); + int i = Config.parseInt(s3, -1); + + if (i < 0) + { + Config.warn("[Shaders] Invalid block ID: " + s); + } + else + { + MatchBlock[] amatchblock = connectedparser.parseMatchBlocks(s1); + + if (amatchblock != null && amatchblock.length >= 1) + { + BlockAlias blockalias = new BlockAlias(i, amatchblock); + addToList(listBlockAliases, blockalias); + } + else + { + Config.warn("[Shaders] Invalid block ID mapping: " + s + "=" + s1); + } + } + } + } + } + } + catch (IOException var14) + { + Config.warn("[Shaders] Error reading: " + path); + } + } + } + + private static void addToList(List> blocksAliases, BlockAlias ba) + { + int[] aint = ba.getMatchBlockIds(); + + for (int i = 0; i < aint.length; ++i) + { + int j = aint[i]; + + while (j >= blocksAliases.size()) + { + blocksAliases.add(null); + } + + List list = (List)blocksAliases.get(j); + + if (list == null) + { + list = new ArrayList(); + blocksAliases.set(j, list); + } + + BlockAlias blockalias = new BlockAlias(ba.getBlockAliasId(), ba.getMatchBlocks(j)); + list.add(blockalias); + } + } + + private static BlockAlias[][] toArrays(List> listBlocksAliases) + { + BlockAlias[][] ablockalias = new BlockAlias[listBlocksAliases.size()][]; + + for (int i = 0; i < ablockalias.length; ++i) + { + List list = (List)listBlocksAliases.get(i); + + if (list != null) + { + ablockalias[i] = (BlockAlias[])((BlockAlias[])list.toArray(new BlockAlias[list.size()])); + } + } + + return ablockalias; + } + + public static PropertiesOrdered getBlockLayerPropertes() + { + return blockLayerPropertes; + } + + public static void reset() + { + blockAliases = (BlockAlias[][])null; + blockLayerPropertes = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ClippingHelperShadow.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ClippingHelperShadow.java new file mode 100644 index 0000000..54032f6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ClippingHelperShadow.java @@ -0,0 +1,316 @@ +package net.optifine.shaders; + +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.util.MathHelper; + +public class ClippingHelperShadow extends ClippingHelper +{ + private static ClippingHelperShadow instance = new ClippingHelperShadow(); + float[] frustumTest = new float[6]; + float[][] shadowClipPlanes = new float[10][4]; + int shadowClipPlaneCount; + float[] matInvMP = new float[16]; + float[] vecIntersection = new float[4]; + + public boolean isBoxInFrustum(double x1, double y1, double z1, double x2, double y2, double z2) + { + for (int i = 0; i < this.shadowClipPlaneCount; ++i) + { + float[] afloat = this.shadowClipPlanes[i]; + + if (this.dot4(afloat, x1, y1, z1) <= 0.0D && this.dot4(afloat, x2, y1, z1) <= 0.0D && this.dot4(afloat, x1, y2, z1) <= 0.0D && this.dot4(afloat, x2, y2, z1) <= 0.0D && this.dot4(afloat, x1, y1, z2) <= 0.0D && this.dot4(afloat, x2, y1, z2) <= 0.0D && this.dot4(afloat, x1, y2, z2) <= 0.0D && this.dot4(afloat, x2, y2, z2) <= 0.0D) + { + return false; + } + } + + return true; + } + + private double dot4(float[] plane, double x, double y, double z) + { + return (double)plane[0] * x + (double)plane[1] * y + (double)plane[2] * z + (double)plane[3]; + } + + private double dot3(float[] vecA, float[] vecB) + { + return (double)vecA[0] * (double)vecB[0] + (double)vecA[1] * (double)vecB[1] + (double)vecA[2] * (double)vecB[2]; + } + + public static ClippingHelper getInstance() + { + instance.init(); + return instance; + } + + private void normalizePlane(float[] plane) + { + float f = MathHelper.sqrt_float(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]); + plane[0] /= f; + plane[1] /= f; + plane[2] /= f; + plane[3] /= f; + } + + private void normalize3(float[] plane) + { + float f = MathHelper.sqrt_float(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]); + + if (f == 0.0F) + { + f = 1.0F; + } + + plane[0] /= f; + plane[1] /= f; + plane[2] /= f; + } + + private void assignPlane(float[] plane, float a, float b, float c, float d) + { + float f = (float)Math.sqrt((double)(a * a + b * b + c * c)); + plane[0] = a / f; + plane[1] = b / f; + plane[2] = c / f; + plane[3] = d / f; + } + + private void copyPlane(float[] dst, float[] src) + { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + } + + private void cross3(float[] out, float[] a, float[] b) + { + out[0] = a[1] * b[2] - a[2] * b[1]; + out[1] = a[2] * b[0] - a[0] * b[2]; + out[2] = a[0] * b[1] - a[1] * b[0]; + } + + private void addShadowClipPlane(float[] plane) + { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], plane); + } + + private float length(float x, float y, float z) + { + return (float)Math.sqrt((double)(x * x + y * y + z * z)); + } + + private float distance(float x1, float y1, float z1, float x2, float y2, float z2) + { + return this.length(x1 - x2, y1 - y2, z1 - z2); + } + + private void makeShadowPlane(float[] shadowPlane, float[] positivePlane, float[] negativePlane, float[] vecSun) + { + this.cross3(this.vecIntersection, positivePlane, negativePlane); + this.cross3(shadowPlane, this.vecIntersection, vecSun); + this.normalize3(shadowPlane); + float f = (float)this.dot3(positivePlane, negativePlane); + float f1 = (float)this.dot3(shadowPlane, negativePlane); + float f2 = this.distance(shadowPlane[0], shadowPlane[1], shadowPlane[2], negativePlane[0] * f1, negativePlane[1] * f1, negativePlane[2] * f1); + float f3 = this.distance(positivePlane[0], positivePlane[1], positivePlane[2], negativePlane[0] * f, negativePlane[1] * f, negativePlane[2] * f); + float f4 = f2 / f3; + float f5 = (float)this.dot3(shadowPlane, positivePlane); + float f6 = this.distance(shadowPlane[0], shadowPlane[1], shadowPlane[2], positivePlane[0] * f5, positivePlane[1] * f5, positivePlane[2] * f5); + float f7 = this.distance(negativePlane[0], negativePlane[1], negativePlane[2], positivePlane[0] * f, positivePlane[1] * f, positivePlane[2] * f); + float f8 = f6 / f7; + shadowPlane[3] = positivePlane[3] * f4 + negativePlane[3] * f8; + } + + public void init() + { + float[] afloat = this.projectionMatrix; + float[] afloat1 = this.modelviewMatrix; + float[] afloat2 = this.clippingMatrix; + System.arraycopy(Shaders.faProjection, 0, afloat, 0, 16); + System.arraycopy(Shaders.faModelView, 0, afloat1, 0, 16); + SMath.multiplyMat4xMat4(afloat2, afloat1, afloat); + this.assignPlane(this.frustum[0], afloat2[3] - afloat2[0], afloat2[7] - afloat2[4], afloat2[11] - afloat2[8], afloat2[15] - afloat2[12]); + this.assignPlane(this.frustum[1], afloat2[3] + afloat2[0], afloat2[7] + afloat2[4], afloat2[11] + afloat2[8], afloat2[15] + afloat2[12]); + this.assignPlane(this.frustum[2], afloat2[3] + afloat2[1], afloat2[7] + afloat2[5], afloat2[11] + afloat2[9], afloat2[15] + afloat2[13]); + this.assignPlane(this.frustum[3], afloat2[3] - afloat2[1], afloat2[7] - afloat2[5], afloat2[11] - afloat2[9], afloat2[15] - afloat2[13]); + this.assignPlane(this.frustum[4], afloat2[3] - afloat2[2], afloat2[7] - afloat2[6], afloat2[11] - afloat2[10], afloat2[15] - afloat2[14]); + this.assignPlane(this.frustum[5], afloat2[3] + afloat2[2], afloat2[7] + afloat2[6], afloat2[11] + afloat2[10], afloat2[15] + afloat2[14]); + float[] afloat3 = Shaders.shadowLightPositionVector; + float f = (float)this.dot3(this.frustum[0], afloat3); + float f1 = (float)this.dot3(this.frustum[1], afloat3); + float f2 = (float)this.dot3(this.frustum[2], afloat3); + float f3 = (float)this.dot3(this.frustum[3], afloat3); + float f4 = (float)this.dot3(this.frustum[4], afloat3); + float f5 = (float)this.dot3(this.frustum[5], afloat3); + this.shadowClipPlaneCount = 0; + + if (f >= 0.0F) + { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0]); + + if (f > 0.0F) + { + if (f2 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[2], afloat3); + } + + if (f3 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[3], afloat3); + } + + if (f4 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[4], afloat3); + } + + if (f5 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[5], afloat3); + } + } + } + + if (f1 >= 0.0F) + { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1]); + + if (f1 > 0.0F) + { + if (f2 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[2], afloat3); + } + + if (f3 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[3], afloat3); + } + + if (f4 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[4], afloat3); + } + + if (f5 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[5], afloat3); + } + } + } + + if (f2 >= 0.0F) + { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2]); + + if (f2 > 0.0F) + { + if (f < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[0], afloat3); + } + + if (f1 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[1], afloat3); + } + + if (f4 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[4], afloat3); + } + + if (f5 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[5], afloat3); + } + } + } + + if (f3 >= 0.0F) + { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3]); + + if (f3 > 0.0F) + { + if (f < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[0], afloat3); + } + + if (f1 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[1], afloat3); + } + + if (f4 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[4], afloat3); + } + + if (f5 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[5], afloat3); + } + } + } + + if (f4 >= 0.0F) + { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4]); + + if (f4 > 0.0F) + { + if (f < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[0], afloat3); + } + + if (f1 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[1], afloat3); + } + + if (f2 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[2], afloat3); + } + + if (f3 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[3], afloat3); + } + } + } + + if (f5 >= 0.0F) + { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5]); + + if (f5 > 0.0F) + { + if (f < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[0], afloat3); + } + + if (f1 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[1], afloat3); + } + + if (f2 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[2], afloat3); + } + + if (f3 < 0.0F) + { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[3], afloat3); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTexture.java b/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTexture.java new file mode 100644 index 0000000..5fa615f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTexture.java @@ -0,0 +1,53 @@ +package net.optifine.shaders; + +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureUtil; + +public class CustomTexture implements ICustomTexture +{ + private int textureUnit = -1; + private String path = null; + private ITextureObject texture = null; + + public CustomTexture(int textureUnit, String path, ITextureObject texture) + { + this.textureUnit = textureUnit; + this.path = path; + this.texture = texture; + } + + public int getTextureUnit() + { + return this.textureUnit; + } + + public String getPath() + { + return this.path; + } + + public ITextureObject getTexture() + { + return this.texture; + } + + public int getTextureId() + { + return this.texture.getGlTextureId(); + } + + public void deleteTexture() + { + TextureUtil.deleteTexture(this.texture.getGlTextureId()); + } + + public int getTarget() + { + return 3553; + } + + public String toString() + { + return "textureUnit: " + this.textureUnit + ", path: " + this.path + ", glTextureId: " + this.getTextureId(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTextureLocation.java b/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTextureLocation.java new file mode 100644 index 0000000..001e7aa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTextureLocation.java @@ -0,0 +1,89 @@ +package net.optifine.shaders; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +public class CustomTextureLocation implements ICustomTexture +{ + private int textureUnit = -1; + private ResourceLocation location; + private int variant = 0; + private ITextureObject texture; + public static final int VARIANT_BASE = 0; + public static final int VARIANT_NORMAL = 1; + public static final int VARIANT_SPECULAR = 2; + + public CustomTextureLocation(int textureUnit, ResourceLocation location, int variant) + { + this.textureUnit = textureUnit; + this.location = location; + this.variant = variant; + } + + public ITextureObject getTexture() + { + if (this.texture == null) + { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + this.texture = texturemanager.getTexture(this.location); + + if (this.texture == null) + { + this.texture = new SimpleTexture(this.location); + texturemanager.loadTexture(this.location, this.texture); + this.texture = texturemanager.getTexture(this.location); + } + } + + return this.texture; + } + + public int getTextureId() + { + ITextureObject itextureobject = this.getTexture(); + + if (this.variant != 0 && itextureobject instanceof AbstractTexture) + { + AbstractTexture abstracttexture = (AbstractTexture)itextureobject; + MultiTexID multitexid = abstracttexture.multiTex; + + if (multitexid != null) + { + if (this.variant == 1) + { + return multitexid.norm; + } + + if (this.variant == 2) + { + return multitexid.spec; + } + } + } + + return itextureobject.getGlTextureId(); + } + + public int getTextureUnit() + { + return this.textureUnit; + } + + public void deleteTexture() + { + } + + public int getTarget() + { + return 3553; + } + + public String toString() + { + return "textureUnit: " + this.textureUnit + ", location: " + this.location + ", glTextureId: " + (this.texture != null ? Integer.valueOf(this.texture.getGlTextureId()) : ""); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTextureRaw.java b/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTextureRaw.java new file mode 100644 index 0000000..07db7ea --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/CustomTextureRaw.java @@ -0,0 +1,86 @@ +package net.optifine.shaders; + +import java.nio.ByteBuffer; +import net.optifine.texture.InternalFormat; +import net.optifine.texture.PixelFormat; +import net.optifine.texture.PixelType; +import net.optifine.texture.TextureType; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class CustomTextureRaw implements ICustomTexture +{ + private TextureType type; + private int textureUnit; + private int textureId; + + public CustomTextureRaw(TextureType type, InternalFormat internalFormat, int width, int height, int depth, PixelFormat pixelFormat, PixelType pixelType, ByteBuffer data, int textureUnit, boolean blur, boolean clamp) + { + this.type = type; + this.textureUnit = textureUnit; + this.textureId = GL11.glGenTextures(); + GL11.glBindTexture(this.getTarget(), this.textureId); + int i = clamp ? 33071 : 10497; + int j = blur ? 9729 : 9728; + + switch (type) + { + case TEXTURE_1D: + GL11.glTexImage1D(GL11.GL_TEXTURE_1D, 0, internalFormat.getId(), width, 0, pixelFormat.getId(), pixelType.getId(), (ByteBuffer)data); + GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_WRAP_S, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_MAG_FILTER, j); + GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_MIN_FILTER, j); + break; + + case TEXTURE_2D: + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, internalFormat.getId(), width, height, 0, pixelFormat.getId(), pixelType.getId(), (ByteBuffer)data); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, j); + break; + + case TEXTURE_3D: + GL12.glTexImage3D(GL12.GL_TEXTURE_3D, 0, internalFormat.getId(), width, height, depth, 0, pixelFormat.getId(), pixelType.getId(), (ByteBuffer)data); + GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_WRAP_S, i); + GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_WRAP_T, i); + GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL12.GL_TEXTURE_WRAP_R, i); + GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_MAG_FILTER, j); + GL11.glTexParameteri(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_MIN_FILTER, j); + break; + + case TEXTURE_RECTANGLE: + GL11.glTexImage2D(34037, 0, internalFormat.getId(), width, height, 0, pixelFormat.getId(), pixelType.getId(), (ByteBuffer)data); + GL11.glTexParameteri(34037, GL11.GL_TEXTURE_WRAP_S, i); + GL11.glTexParameteri(34037, GL11.GL_TEXTURE_WRAP_T, i); + GL11.glTexParameteri(34037, GL11.GL_TEXTURE_MAG_FILTER, j); + GL11.glTexParameteri(34037, GL11.GL_TEXTURE_MIN_FILTER, j); + } + + GL11.glBindTexture(this.getTarget(), 0); + } + + public int getTarget() + { + return this.type.getId(); + } + + public int getTextureId() + { + return this.textureId; + } + + public int getTextureUnit() + { + return this.textureUnit; + } + + public void deleteTexture() + { + if (this.textureId > 0) + { + GL11.glDeleteTextures(this.textureId); + this.textureId = 0; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/DefaultTexture.java b/Client-1.8.9/src/main/java/net/optifine/shaders/DefaultTexture.java new file mode 100644 index 0000000..856b2df --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/DefaultTexture.java @@ -0,0 +1,18 @@ +package net.optifine.shaders; + +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.resources.IResourceManager; + +public class DefaultTexture extends AbstractTexture +{ + public DefaultTexture() + { + this.loadTexture((IResourceManager)null); + } + + public void loadTexture(IResourceManager resourcemanager) + { + int[] aint = ShadersTex.createAIntImage(1, -1); + ShadersTex.setupTexture(this.getMultiTexID(), aint, 1, 1, false, false); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/EntityAliases.java b/Client-1.8.9/src/main/java/net/optifine/shaders/EntityAliases.java new file mode 100644 index 0000000..88cf79c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/EntityAliases.java @@ -0,0 +1,186 @@ +package net.optifine.shaders; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.ConnectedParser; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.shaders.config.MacroProcessor; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.StrUtils; + +public class EntityAliases +{ + private static int[] entityAliases = null; + private static boolean updateOnResourcesReloaded; + + public static int getEntityAliasId(int entityId) + { + if (entityAliases == null) + { + return -1; + } + else if (entityId >= 0 && entityId < entityAliases.length) + { + int i = entityAliases[entityId]; + return i; + } + else + { + return -1; + } + } + + public static void resourcesReloaded() + { + if (updateOnResourcesReloaded) + { + updateOnResourcesReloaded = false; + update(Shaders.getShaderPack()); + } + } + + public static void update(IShaderPack shaderPack) + { + reset(); + + if (shaderPack != null) + { + if (Reflector.Loader_getActiveModList.exists() && Config.getResourceManager() == null) + { + Config.dbg("[Shaders] Delayed loading of entity mappings after resources are loaded"); + updateOnResourcesReloaded = true; + } + else + { + List list = new ArrayList(); + String s = "/shaders/entity.properties"; + InputStream inputstream = shaderPack.getResourceAsStream(s); + + if (inputstream != null) + { + loadEntityAliases(inputstream, s, list); + } + + loadModEntityAliases(list); + + if (((List)list).size() > 0) + { + entityAliases = toArray(list); + } + } + } + } + + private static void loadModEntityAliases(List listEntityAliases) + { + String[] astring = ReflectorForge.getForgeModIds(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s, "shaders/entity.properties"); + InputStream inputstream = Config.getResourceStream(resourcelocation); + loadEntityAliases(inputstream, resourcelocation.toString(), listEntityAliases); + } + catch (IOException var6) + { + ; + } + } + } + + private static void loadEntityAliases(InputStream in, String path, List listEntityAliases) + { + if (in != null) + { + try + { + in = MacroProcessor.process(in, path); + Properties properties = new PropertiesOrdered(); + properties.load(in); + in.close(); + Config.dbg("[Shaders] Parsing entity mappings: " + path); + ConnectedParser connectedparser = new ConnectedParser("Shaders"); + + for (Object e : properties.keySet()) + { + String s = (String) e; + String s1 = properties.getProperty(s); + String s2 = "entity."; + + if (!s.startsWith(s2)) + { + Config.warn("[Shaders] Invalid entity ID: " + s); + } + else + { + String s3 = StrUtils.removePrefix(s, s2); + int i = Config.parseInt(s3, -1); + + if (i < 0) + { + Config.warn("[Shaders] Invalid entity alias ID: " + i); + } + else + { + int[] aint = connectedparser.parseEntities(s1); + + if (aint != null && aint.length >= 1) + { + for (int j = 0; j < aint.length; ++j) + { + int k = aint[j]; + addToList(listEntityAliases, k, i); + } + } + else + { + Config.warn("[Shaders] Invalid entity ID mapping: " + s + "=" + s1); + } + } + } + } + } + catch (IOException var15) + { + Config.warn("[Shaders] Error reading: " + path); + } + } + } + + private static void addToList(List list, int index, int val) + { + while (list.size() <= index) + { + list.add(Integer.valueOf(-1)); + } + + list.set(index, Integer.valueOf(val)); + } + + private static int[] toArray(List list) + { + int[] aint = new int[list.size()]; + + for (int i = 0; i < aint.length; ++i) + { + aint[i] = ((Integer)list.get(i)).intValue(); + } + + return aint; + } + + public static void reset() + { + entityAliases = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/FlipTextures.java b/Client-1.8.9/src/main/java/net/optifine/shaders/FlipTextures.java new file mode 100644 index 0000000..7bdf5db --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/FlipTextures.java @@ -0,0 +1,53 @@ +package net.optifine.shaders; + +import java.nio.IntBuffer; +import java.util.Arrays; + +public class FlipTextures +{ + private IntBuffer textures; + private int indexFlipped; + private boolean[] flips; + private boolean[] changed; + + public FlipTextures(IntBuffer textures, int indexFlipped) + { + this.textures = textures; + this.indexFlipped = indexFlipped; + this.flips = new boolean[textures.capacity()]; + this.changed = new boolean[textures.capacity()]; + } + + public int getA(int index) + { + return this.get(index, this.flips[index]); + } + + public int getB(int index) + { + return this.get(index, !this.flips[index]); + } + + private int get(int index, boolean flipped) + { + int i = flipped ? this.indexFlipped : 0; + return this.textures.get(i + index); + } + + public void flip(int index) + { + this.flips[index] = !this.flips[index]; + this.changed[index] = true; + } + + public boolean isChanged(int index) + { + return this.changed[index]; + } + + public void reset() + { + Arrays.fill(this.flips, false); + Arrays.fill(this.changed, false); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/HFNoiseTexture.java b/Client-1.8.9/src/main/java/net/optifine/shaders/HFNoiseTexture.java new file mode 100644 index 0000000..2e8d27f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/HFNoiseTexture.java @@ -0,0 +1,86 @@ +package net.optifine.shaders; + +import java.nio.ByteBuffer; +import net.minecraft.client.renderer.GlStateManager; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; + +public class HFNoiseTexture implements ICustomTexture +{ + private int texID = GL11.glGenTextures(); + private int textureUnit = 15; + + public HFNoiseTexture(int width, int height) + { + byte[] abyte = this.genHFNoiseImage(width, height); + ByteBuffer bytebuffer = BufferUtils.createByteBuffer(abyte.length); + bytebuffer.put(abyte); + bytebuffer.flip(); + GlStateManager.bindTexture(this.texID); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, width, height, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)bytebuffer); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GlStateManager.bindTexture(0); + } + + public int getID() + { + return this.texID; + } + + public void deleteTexture() + { + GlStateManager.deleteTexture(this.texID); + this.texID = 0; + } + + private int random(int seed) + { + seed = seed ^ seed << 13; + seed = seed ^ seed >> 17; + seed = seed ^ seed << 5; + return seed; + } + + private byte random(int x, int y, int z) + { + int i = (this.random(x) + this.random(y * 19)) * this.random(z * 23) - z; + return (byte)(this.random(i) % 128); + } + + private byte[] genHFNoiseImage(int width, int height) + { + byte[] abyte = new byte[width * height * 3]; + int i = 0; + + for (int j = 0; j < height; ++j) + { + for (int k = 0; k < width; ++k) + { + for (int l = 1; l < 4; ++l) + { + abyte[i++] = this.random(k, j, l); + } + } + } + + return abyte; + } + + public int getTextureId() + { + return this.texID; + } + + public int getTextureUnit() + { + return this.textureUnit; + } + + public int getTarget() + { + return 3553; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ICustomTexture.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ICustomTexture.java new file mode 100644 index 0000000..e096bf1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ICustomTexture.java @@ -0,0 +1,12 @@ +package net.optifine.shaders; + +public interface ICustomTexture +{ + int getTextureId(); + + int getTextureUnit(); + + void deleteTexture(); + + int getTarget(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/IShaderPack.java b/Client-1.8.9/src/main/java/net/optifine/shaders/IShaderPack.java new file mode 100644 index 0000000..fa26ae1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/IShaderPack.java @@ -0,0 +1,14 @@ +package net.optifine.shaders; + +import java.io.InputStream; + +public interface IShaderPack +{ + String getName(); + + InputStream getResourceAsStream(String var1); + + boolean hasDirectory(String var1); + + void close(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ItemAliases.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ItemAliases.java new file mode 100644 index 0000000..d000768 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ItemAliases.java @@ -0,0 +1,187 @@ +package net.optifine.shaders; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.optifine.config.ConnectedParser; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorForge; +import net.optifine.shaders.config.MacroProcessor; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.StrUtils; + +public class ItemAliases +{ + private static int[] itemAliases = null; + private static boolean updateOnResourcesReloaded; + private static final int NO_ALIAS = Integer.MIN_VALUE; + + public static int getItemAliasId(int itemId) + { + if (itemAliases == null) + { + return itemId; + } + else if (itemId >= 0 && itemId < itemAliases.length) + { + int i = itemAliases[itemId]; + return i == Integer.MIN_VALUE ? itemId : i; + } + else + { + return itemId; + } + } + + public static void resourcesReloaded() + { + if (updateOnResourcesReloaded) + { + updateOnResourcesReloaded = false; + update(Shaders.getShaderPack()); + } + } + + public static void update(IShaderPack shaderPack) + { + reset(); + + if (shaderPack != null) + { + if (Reflector.Loader_getActiveModList.exists() && Config.getResourceManager() == null) + { + Config.dbg("[Shaders] Delayed loading of item mappings after resources are loaded"); + updateOnResourcesReloaded = true; + } + else + { + List list = new ArrayList(); + String s = "/shaders/item.properties"; + InputStream inputstream = shaderPack.getResourceAsStream(s); + + if (inputstream != null) + { + loadItemAliases(inputstream, s, list); + } + + loadModItemAliases(list); + + if (((List)list).size() > 0) + { + itemAliases = toArray(list); + } + } + } + } + + private static void loadModItemAliases(List listItemAliases) + { + String[] astring = ReflectorForge.getForgeModIds(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(s, "shaders/item.properties"); + InputStream inputstream = Config.getResourceStream(resourcelocation); + loadItemAliases(inputstream, resourcelocation.toString(), listItemAliases); + } + catch (IOException var6) + { + ; + } + } + } + + private static void loadItemAliases(InputStream in, String path, List listItemAliases) + { + if (in != null) + { + try + { + in = MacroProcessor.process(in, path); + Properties properties = new PropertiesOrdered(); + properties.load(in); + in.close(); + Config.dbg("[Shaders] Parsing item mappings: " + path); + ConnectedParser connectedparser = new ConnectedParser("Shaders"); + + for (Object e : properties.keySet()) + { + String s = (String) e; + String s1 = properties.getProperty(s); + String s2 = "item."; + + if (!s.startsWith(s2)) + { + Config.warn("[Shaders] Invalid item ID: " + s); + } + else + { + String s3 = StrUtils.removePrefix(s, s2); + int i = Config.parseInt(s3, -1); + + if (i < 0) + { + Config.warn("[Shaders] Invalid item alias ID: " + i); + } + else + { + int[] aint = connectedparser.parseItems(s1); + + if (aint != null && aint.length >= 1) + { + for (int j = 0; j < aint.length; ++j) + { + int k = aint[j]; + addToList(listItemAliases, k, i); + } + } + else + { + Config.warn("[Shaders] Invalid item ID mapping: " + s + "=" + s1); + } + } + } + } + } + catch (IOException var15) + { + Config.warn("[Shaders] Error reading: " + path); + } + } + } + + private static void addToList(List list, int index, int val) + { + while (list.size() <= index) + { + list.add(Integer.valueOf(Integer.MIN_VALUE)); + } + + list.set(index, Integer.valueOf(val)); + } + + private static int[] toArray(List list) + { + int[] aint = new int[list.size()]; + + for (int i = 0; i < aint.length; ++i) + { + aint[i] = ((Integer)list.get(i)).intValue(); + } + + return aint; + } + + public static void reset() + { + itemAliases = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/Iterator3d.java b/Client-1.8.9/src/main/java/net/optifine/shaders/Iterator3d.java new file mode 100644 index 0000000..420c005 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/Iterator3d.java @@ -0,0 +1,140 @@ +package net.optifine.shaders; + +import java.util.Iterator; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; +import net.optifine.BlockPosM; + +public class Iterator3d implements Iterator +{ + private IteratorAxis iteratorAxis; + private BlockPosM blockPos = new BlockPosM(0, 0, 0); + private int axis = 0; + private int kX; + private int kY; + private int kZ; + private static final int AXIS_X = 0; + private static final int AXIS_Y = 1; + private static final int AXIS_Z = 2; + + public Iterator3d(BlockPos posStart, BlockPos posEnd, int width, int height) + { + boolean flag = posStart.getX() > posEnd.getX(); + boolean flag1 = posStart.getY() > posEnd.getY(); + boolean flag2 = posStart.getZ() > posEnd.getZ(); + posStart = this.reverseCoord(posStart, flag, flag1, flag2); + posEnd = this.reverseCoord(posEnd, flag, flag1, flag2); + this.kX = flag ? -1 : 1; + this.kY = flag1 ? -1 : 1; + this.kZ = flag2 ? -1 : 1; + Vec3 vec3 = new Vec3((double)(posEnd.getX() - posStart.getX()), (double)(posEnd.getY() - posStart.getY()), (double)(posEnd.getZ() - posStart.getZ())); + Vec3 vec31 = vec3.normalize(); + Vec3 vec32 = new Vec3(1.0D, 0.0D, 0.0D); + double d0 = vec31.dotProduct(vec32); + double d1 = Math.abs(d0); + Vec3 vec33 = new Vec3(0.0D, 1.0D, 0.0D); + double d2 = vec31.dotProduct(vec33); + double d3 = Math.abs(d2); + Vec3 vec34 = new Vec3(0.0D, 0.0D, 1.0D); + double d4 = vec31.dotProduct(vec34); + double d5 = Math.abs(d4); + + if (d5 >= d3 && d5 >= d1) + { + this.axis = 2; + BlockPos blockpos3 = new BlockPos(posStart.getZ(), posStart.getY() - width, posStart.getX() - height); + BlockPos blockpos5 = new BlockPos(posEnd.getZ(), posStart.getY() + width + 1, posStart.getX() + height + 1); + int k = posEnd.getZ() - posStart.getZ(); + double d9 = (double)(posEnd.getY() - posStart.getY()) / (1.0D * (double)k); + double d11 = (double)(posEnd.getX() - posStart.getX()) / (1.0D * (double)k); + this.iteratorAxis = new IteratorAxis(blockpos3, blockpos5, d9, d11); + } + else if (d3 >= d1 && d3 >= d5) + { + this.axis = 1; + BlockPos blockpos2 = new BlockPos(posStart.getY(), posStart.getX() - width, posStart.getZ() - height); + BlockPos blockpos4 = new BlockPos(posEnd.getY(), posStart.getX() + width + 1, posStart.getZ() + height + 1); + int j = posEnd.getY() - posStart.getY(); + double d8 = (double)(posEnd.getX() - posStart.getX()) / (1.0D * (double)j); + double d10 = (double)(posEnd.getZ() - posStart.getZ()) / (1.0D * (double)j); + this.iteratorAxis = new IteratorAxis(blockpos2, blockpos4, d8, d10); + } + else + { + this.axis = 0; + BlockPos blockpos = new BlockPos(posStart.getX(), posStart.getY() - width, posStart.getZ() - height); + BlockPos blockpos1 = new BlockPos(posEnd.getX(), posStart.getY() + width + 1, posStart.getZ() + height + 1); + int i = posEnd.getX() - posStart.getX(); + double d6 = (double)(posEnd.getY() - posStart.getY()) / (1.0D * (double)i); + double d7 = (double)(posEnd.getZ() - posStart.getZ()) / (1.0D * (double)i); + this.iteratorAxis = new IteratorAxis(blockpos, blockpos1, d6, d7); + } + } + + private BlockPos reverseCoord(BlockPos pos, boolean revX, boolean revY, boolean revZ) + { + if (revX) + { + pos = new BlockPos(-pos.getX(), pos.getY(), pos.getZ()); + } + + if (revY) + { + pos = new BlockPos(pos.getX(), -pos.getY(), pos.getZ()); + } + + if (revZ) + { + pos = new BlockPos(pos.getX(), pos.getY(), -pos.getZ()); + } + + return pos; + } + + public boolean hasNext() + { + return this.iteratorAxis.hasNext(); + } + + public BlockPos next() + { + BlockPos blockpos = this.iteratorAxis.next(); + + switch (this.axis) + { + case 0: + this.blockPos.setXyz(blockpos.getX() * this.kX, blockpos.getY() * this.kY, blockpos.getZ() * this.kZ); + return this.blockPos; + + case 1: + this.blockPos.setXyz(blockpos.getY() * this.kX, blockpos.getX() * this.kY, blockpos.getZ() * this.kZ); + return this.blockPos; + + case 2: + this.blockPos.setXyz(blockpos.getZ() * this.kX, blockpos.getY() * this.kY, blockpos.getX() * this.kZ); + return this.blockPos; + + default: + this.blockPos.setXyz(blockpos.getX() * this.kX, blockpos.getY() * this.kY, blockpos.getZ() * this.kZ); + return this.blockPos; + } + } + + public void remove() + { + throw new RuntimeException("Not supported"); + } + + public static void main(String[] args) + { + BlockPos blockpos = new BlockPos(10, 20, 30); + BlockPos blockpos1 = new BlockPos(30, 40, 20); + Iterator3d iterator3d = new Iterator3d(blockpos, blockpos1, 1, 1); + + while (iterator3d.hasNext()) + { + BlockPos blockpos2 = iterator3d.next(); + System.out.println("" + blockpos2); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/IteratorAxis.java b/Client-1.8.9/src/main/java/net/optifine/shaders/IteratorAxis.java new file mode 100644 index 0000000..74ba82f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/IteratorAxis.java @@ -0,0 +1,108 @@ +package net.optifine.shaders; + +import java.util.Iterator; +import java.util.NoSuchElementException; +import net.minecraft.util.BlockPos; +import net.optifine.BlockPosM; + +public class IteratorAxis implements Iterator +{ + private double yDelta; + private double zDelta; + private int xStart; + private int xEnd; + private double yStart; + private double yEnd; + private double zStart; + private double zEnd; + private int xNext; + private double yNext; + private double zNext; + private BlockPosM pos = new BlockPosM(0, 0, 0); + private boolean hasNext = false; + + public IteratorAxis(BlockPos posStart, BlockPos posEnd, double yDelta, double zDelta) + { + this.yDelta = yDelta; + this.zDelta = zDelta; + this.xStart = posStart.getX(); + this.xEnd = posEnd.getX(); + this.yStart = (double)posStart.getY(); + this.yEnd = (double)posEnd.getY() - 0.5D; + this.zStart = (double)posStart.getZ(); + this.zEnd = (double)posEnd.getZ() - 0.5D; + this.xNext = this.xStart; + this.yNext = this.yStart; + this.zNext = this.zStart; + this.hasNext = this.xNext < this.xEnd && this.yNext < this.yEnd && this.zNext < this.zEnd; + } + + public boolean hasNext() + { + return this.hasNext; + } + + public BlockPos next() + { + if (!this.hasNext) + { + throw new NoSuchElementException(); + } + else + { + this.pos.setXyz((double)this.xNext, this.yNext, this.zNext); + this.nextPos(); + this.hasNext = this.xNext < this.xEnd && this.yNext < this.yEnd && this.zNext < this.zEnd; + return this.pos; + } + } + + private void nextPos() + { + ++this.zNext; + + if (this.zNext >= this.zEnd) + { + this.zNext = this.zStart; + ++this.yNext; + + if (this.yNext >= this.yEnd) + { + this.yNext = this.yStart; + this.yStart += this.yDelta; + this.yEnd += this.yDelta; + this.yNext = this.yStart; + this.zStart += this.zDelta; + this.zEnd += this.zDelta; + this.zNext = this.zStart; + ++this.xNext; + + if (this.xNext >= this.xEnd) + { + ; + } + } + } + } + + public void remove() + { + throw new RuntimeException("Not implemented"); + } + + public static void main(String[] args) throws Exception + { + BlockPos blockpos = new BlockPos(-2, 10, 20); + BlockPos blockpos1 = new BlockPos(2, 12, 22); + double d0 = -0.5D; + double d1 = 0.5D; + IteratorAxis iteratoraxis = new IteratorAxis(blockpos, blockpos1, d0, d1); + System.out.println("Start: " + blockpos + ", end: " + blockpos1 + ", yDelta: " + d0 + ", zDelta: " + d1); + + while (iteratoraxis.hasNext()) + { + BlockPos blockpos2 = iteratoraxis.next(); + System.out.println("" + blockpos2); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/IteratorRenderChunks.java b/Client-1.8.9/src/main/java/net/optifine/shaders/IteratorRenderChunks.java new file mode 100644 index 0000000..3982674 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/IteratorRenderChunks.java @@ -0,0 +1,38 @@ +package net.optifine.shaders; + +import java.util.Iterator; +import net.minecraft.client.renderer.ViewFrustum; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.util.BlockPos; +import net.optifine.BlockPosM; + +public class IteratorRenderChunks implements Iterator +{ + private ViewFrustum viewFrustum; + private Iterator3d Iterator3d; + private BlockPosM posBlock = new BlockPosM(0, 0, 0); + + public IteratorRenderChunks(ViewFrustum viewFrustum, BlockPos posStart, BlockPos posEnd, int width, int height) + { + this.viewFrustum = viewFrustum; + this.Iterator3d = new Iterator3d(posStart, posEnd, width, height); + } + + public boolean hasNext() + { + return this.Iterator3d.hasNext(); + } + + public RenderChunk next() + { + BlockPos blockpos = this.Iterator3d.next(); + this.posBlock.setXyz(blockpos.getX() << 4, blockpos.getY() << 4, blockpos.getZ() << 4); + RenderChunk renderchunk = this.viewFrustum.getRenderChunk(this.posBlock); + return renderchunk; + } + + public void remove() + { + throw new RuntimeException("Not implemented"); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/MultiTexID.java b/Client-1.8.9/src/main/java/net/optifine/shaders/MultiTexID.java new file mode 100644 index 0000000..4f2463e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/MultiTexID.java @@ -0,0 +1,15 @@ +package net.optifine.shaders; + +public class MultiTexID +{ + public int base; + public int norm; + public int spec; + + public MultiTexID(int baseTex, int normTex, int specTex) + { + this.base = baseTex; + this.norm = normTex; + this.spec = specTex; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/Program.java b/Client-1.8.9/src/main/java/net/optifine/shaders/Program.java new file mode 100644 index 0000000..4605421 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/Program.java @@ -0,0 +1,235 @@ +package net.optifine.shaders; + +import java.nio.IntBuffer; +import java.util.Arrays; +import net.optifine.render.GlAlphaState; +import net.optifine.render.GlBlendState; +import net.optifine.shaders.config.RenderScale; + +public class Program +{ + private final int index; + private final String name; + private final ProgramStage programStage; + private final Program programBackup; + private GlAlphaState alphaState; + private GlBlendState blendState; + private RenderScale renderScale; + private final Boolean[] buffersFlip = new Boolean[8]; + private int id; + private int ref; + private String drawBufSettings; + private IntBuffer drawBuffers; + private IntBuffer drawBuffersBuffer; + private int compositeMipmapSetting; + private int countInstances; + private final boolean[] toggleColorTextures = new boolean[8]; + + public Program(int index, String name, ProgramStage programStage, Program programBackup) + { + this.index = index; + this.name = name; + this.programStage = programStage; + this.programBackup = programBackup; + } + + public Program(int index, String name, ProgramStage programStage, boolean ownBackup) + { + this.index = index; + this.name = name; + this.programStage = programStage; + this.programBackup = ownBackup ? this : null; + } + + public void resetProperties() + { + this.alphaState = null; + this.blendState = null; + this.renderScale = null; + Arrays.fill(this.buffersFlip, (Object)null); + } + + public void resetId() + { + this.id = 0; + this.ref = 0; + } + + public void resetConfiguration() + { + this.drawBufSettings = null; + this.compositeMipmapSetting = 0; + this.countInstances = 0; + + if (this.drawBuffersBuffer == null) + { + this.drawBuffersBuffer = Shaders.nextIntBuffer(8); + } + } + + public void copyFrom(Program p) + { + this.id = p.getId(); + this.alphaState = p.getAlphaState(); + this.blendState = p.getBlendState(); + this.renderScale = p.getRenderScale(); + System.arraycopy(p.getBuffersFlip(), 0, this.buffersFlip, 0, this.buffersFlip.length); + this.drawBufSettings = p.getDrawBufSettings(); + this.drawBuffers = p.getDrawBuffers(); + this.compositeMipmapSetting = p.getCompositeMipmapSetting(); + this.countInstances = p.getCountInstances(); + System.arraycopy(p.getToggleColorTextures(), 0, this.toggleColorTextures, 0, this.toggleColorTextures.length); + } + + public int getIndex() + { + return this.index; + } + + public String getName() + { + return this.name; + } + + public ProgramStage getProgramStage() + { + return this.programStage; + } + + public Program getProgramBackup() + { + return this.programBackup; + } + + public int getId() + { + return this.id; + } + + public int getRef() + { + return this.ref; + } + + public String getDrawBufSettings() + { + return this.drawBufSettings; + } + + public IntBuffer getDrawBuffers() + { + return this.drawBuffers; + } + + public IntBuffer getDrawBuffersBuffer() + { + return this.drawBuffersBuffer; + } + + public int getCompositeMipmapSetting() + { + return this.compositeMipmapSetting; + } + + public int getCountInstances() + { + return this.countInstances; + } + + public GlAlphaState getAlphaState() + { + return this.alphaState; + } + + public GlBlendState getBlendState() + { + return this.blendState; + } + + public RenderScale getRenderScale() + { + return this.renderScale; + } + + public Boolean[] getBuffersFlip() + { + return this.buffersFlip; + } + + public boolean[] getToggleColorTextures() + { + return this.toggleColorTextures; + } + + public void setId(int id) + { + this.id = id; + } + + public void setRef(int ref) + { + this.ref = ref; + } + + public void setDrawBufSettings(String drawBufSettings) + { + this.drawBufSettings = drawBufSettings; + } + + public void setDrawBuffers(IntBuffer drawBuffers) + { + this.drawBuffers = drawBuffers; + } + + public void setCompositeMipmapSetting(int compositeMipmapSetting) + { + this.compositeMipmapSetting = compositeMipmapSetting; + } + + public void setCountInstances(int countInstances) + { + this.countInstances = countInstances; + } + + public void setAlphaState(GlAlphaState alphaState) + { + this.alphaState = alphaState; + } + + public void setBlendState(GlBlendState blendState) + { + this.blendState = blendState; + } + + public void setRenderScale(RenderScale renderScale) + { + this.renderScale = renderScale; + } + + public String getRealProgramName() + { + if (this.id == 0) + { + return "none"; + } + else + { + Program program; + + for (program = this; program.getRef() != this.id; program = program.getProgramBackup()) + { + if (program.getProgramBackup() == null || program.getProgramBackup() == program) + { + return "unknown"; + } + } + + return program.getName(); + } + } + + public String toString() + { + return "name: " + this.name + ", id: " + this.id + ", ref: " + this.ref + ", real: " + this.getRealProgramName(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ProgramStack.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ProgramStack.java new file mode 100644 index 0000000..08b9e0a --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ProgramStack.java @@ -0,0 +1,32 @@ +package net.optifine.shaders; + +import java.util.ArrayDeque; +import java.util.Deque; + +public class ProgramStack +{ + private Deque stack = new ArrayDeque(); + + public void push(Program p) + { + this.stack.addLast(p); + + if (this.stack.size() > 100) + { + throw new RuntimeException("Program stack overflow: " + this.stack.size()); + } + } + + public Program pop() + { + if (this.stack.isEmpty()) + { + throw new RuntimeException("Program stack empty"); + } + else + { + Program program = (Program)this.stack.pollLast(); + return program; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ProgramStage.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ProgramStage.java new file mode 100644 index 0000000..c9deeec --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ProgramStage.java @@ -0,0 +1,22 @@ +package net.optifine.shaders; + +public enum ProgramStage +{ + NONE(""), + SHADOW("shadow"), + GBUFFERS("gbuffers"), + DEFERRED("deferred"), + COMPOSITE("composite"); + + private String name; + + private ProgramStage(String name) + { + this.name = name; + } + + public String getName() + { + return this.name; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/Programs.java b/Client-1.8.9/src/main/java/net/optifine/shaders/Programs.java new file mode 100644 index 0000000..bf2312b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/Programs.java @@ -0,0 +1,155 @@ +package net.optifine.shaders; + +import java.util.ArrayList; +import java.util.List; + +public class Programs +{ + private List programs = new ArrayList(); + private Program programNone = this.make("", ProgramStage.NONE, true); + + public Program make(String name, ProgramStage programStage, Program backupProgram) + { + int i = this.programs.size(); + Program program = new Program(i, name, programStage, backupProgram); + this.programs.add(program); + return program; + } + + private Program make(String name, ProgramStage programStage, boolean ownBackup) + { + int i = this.programs.size(); + Program program = new Program(i, name, programStage, ownBackup); + this.programs.add(program); + return program; + } + + public Program makeGbuffers(String name, Program backupProgram) + { + return this.make(name, ProgramStage.GBUFFERS, backupProgram); + } + + public Program makeComposite(String name) + { + return this.make(name, ProgramStage.COMPOSITE, this.programNone); + } + + public Program makeDeferred(String name) + { + return this.make(name, ProgramStage.DEFERRED, this.programNone); + } + + public Program makeShadow(String name, Program backupProgram) + { + return this.make(name, ProgramStage.SHADOW, backupProgram); + } + + public Program makeVirtual(String name) + { + return this.make(name, ProgramStage.NONE, true); + } + + public Program[] makeComposites(String prefix, int count) + { + Program[] aprogram = new Program[count]; + + for (int i = 0; i < count; ++i) + { + String s = i == 0 ? prefix : prefix + i; + aprogram[i] = this.makeComposite(s); + } + + return aprogram; + } + + public Program[] makeDeferreds(String prefix, int count) + { + Program[] aprogram = new Program[count]; + + for (int i = 0; i < count; ++i) + { + String s = i == 0 ? prefix : prefix + i; + aprogram[i] = this.makeDeferred(s); + } + + return aprogram; + } + + public Program getProgramNone() + { + return this.programNone; + } + + public int getCount() + { + return this.programs.size(); + } + + public Program getProgram(String name) + { + if (name == null) + { + return null; + } + else + { + for (int i = 0; i < this.programs.size(); ++i) + { + Program program = (Program)this.programs.get(i); + String s = program.getName(); + + if (s.equals(name)) + { + return program; + } + } + + return null; + } + } + + public String[] getProgramNames() + { + String[] astring = new String[this.programs.size()]; + + for (int i = 0; i < astring.length; ++i) + { + astring[i] = ((Program)this.programs.get(i)).getName(); + } + + return astring; + } + + public Program[] getPrograms() + { + Program[] aprogram = (Program[])((Program[])this.programs.toArray(new Program[this.programs.size()])); + return aprogram; + } + + public Program[] getPrograms(Program programFrom, Program programTo) + { + int i = programFrom.getIndex(); + int j = programTo.getIndex(); + + if (i > j) + { + int k = i; + i = j; + j = k; + } + + Program[] aprogram = new Program[j - i + 1]; + + for (int l = 0; l < aprogram.length; ++l) + { + aprogram[l] = (Program)this.programs.get(i + l); + } + + return aprogram; + } + + public String toString() + { + return this.programs.toString(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/SMCLog.java b/Client-1.8.9/src/main/java/net/optifine/shaders/SMCLog.java new file mode 100644 index 0000000..5bc3224 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/SMCLog.java @@ -0,0 +1,54 @@ +package net.optifine.shaders; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class SMCLog +{ + private static final Logger LOGGER = LogManager.getLogger(); + private static final String PREFIX = "[Shaders] "; + + public static void severe(String message) + { + LOGGER.error("[Shaders] " + message); + } + + public static void warning(String message) + { + LOGGER.warn("[Shaders] " + message); + } + + public static void info(String message) + { + LOGGER.info("[Shaders] " + message); + } + + public static void fine(String message) + { + LOGGER.debug("[Shaders] " + message); + } + + public static void severe(String format, Object... args) + { + String s = String.format(format, args); + LOGGER.error("[Shaders] " + s); + } + + public static void warning(String format, Object... args) + { + String s = String.format(format, args); + LOGGER.warn("[Shaders] " + s); + } + + public static void info(String format, Object... args) + { + String s = String.format(format, args); + LOGGER.info("[Shaders] " + s); + } + + public static void fine(String format, Object... args) + { + String s = String.format(format, args); + LOGGER.debug("[Shaders] " + s); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/SMath.java b/Client-1.8.9/src/main/java/net/optifine/shaders/SMath.java new file mode 100644 index 0000000..0fa20be --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/SMath.java @@ -0,0 +1,66 @@ +package net.optifine.shaders; + +import java.nio.FloatBuffer; +import java.util.Arrays; + +public class SMath +{ + static void multiplyMat4xMat4(float[] matOut, float[] matA, float[] matB) + { + for (int i = 0; i < 4; ++i) + { + for (int j = 0; j < 4; ++j) + { + matOut[4 * i + j] = matA[4 * i + 0] * matB[0 + j] + matA[4 * i + 1] * matB[4 + j] + matA[4 * i + 2] * matB[8 + j] + matA[4 * i + 3] * matB[12 + j]; + } + } + } + + static void multiplyMat4xVec4(float[] vecOut, float[] matA, float[] vecB) + { + vecOut[0] = matA[0] * vecB[0] + matA[4] * vecB[1] + matA[8] * vecB[2] + matA[12] * vecB[3]; + vecOut[1] = matA[1] * vecB[0] + matA[5] * vecB[1] + matA[9] * vecB[2] + matA[13] * vecB[3]; + vecOut[2] = matA[2] * vecB[0] + matA[6] * vecB[1] + matA[10] * vecB[2] + matA[14] * vecB[3]; + vecOut[3] = matA[3] * vecB[0] + matA[7] * vecB[1] + matA[11] * vecB[2] + matA[15] * vecB[3]; + } + + static void invertMat4(float[] matOut, float[] m) + { + matOut[0] = m[5] * m[10] * m[15] - m[5] * m[11] * m[14] - m[9] * m[6] * m[15] + m[9] * m[7] * m[14] + m[13] * m[6] * m[11] - m[13] * m[7] * m[10]; + matOut[1] = -m[1] * m[10] * m[15] + m[1] * m[11] * m[14] + m[9] * m[2] * m[15] - m[9] * m[3] * m[14] - m[13] * m[2] * m[11] + m[13] * m[3] * m[10]; + matOut[2] = m[1] * m[6] * m[15] - m[1] * m[7] * m[14] - m[5] * m[2] * m[15] + m[5] * m[3] * m[14] + m[13] * m[2] * m[7] - m[13] * m[3] * m[6]; + matOut[3] = -m[1] * m[6] * m[11] + m[1] * m[7] * m[10] + m[5] * m[2] * m[11] - m[5] * m[3] * m[10] - m[9] * m[2] * m[7] + m[9] * m[3] * m[6]; + matOut[4] = -m[4] * m[10] * m[15] + m[4] * m[11] * m[14] + m[8] * m[6] * m[15] - m[8] * m[7] * m[14] - m[12] * m[6] * m[11] + m[12] * m[7] * m[10]; + matOut[5] = m[0] * m[10] * m[15] - m[0] * m[11] * m[14] - m[8] * m[2] * m[15] + m[8] * m[3] * m[14] + m[12] * m[2] * m[11] - m[12] * m[3] * m[10]; + matOut[6] = -m[0] * m[6] * m[15] + m[0] * m[7] * m[14] + m[4] * m[2] * m[15] - m[4] * m[3] * m[14] - m[12] * m[2] * m[7] + m[12] * m[3] * m[6]; + matOut[7] = m[0] * m[6] * m[11] - m[0] * m[7] * m[10] - m[4] * m[2] * m[11] + m[4] * m[3] * m[10] + m[8] * m[2] * m[7] - m[8] * m[3] * m[6]; + matOut[8] = m[4] * m[9] * m[15] - m[4] * m[11] * m[13] - m[8] * m[5] * m[15] + m[8] * m[7] * m[13] + m[12] * m[5] * m[11] - m[12] * m[7] * m[9]; + matOut[9] = -m[0] * m[9] * m[15] + m[0] * m[11] * m[13] + m[8] * m[1] * m[15] - m[8] * m[3] * m[13] - m[12] * m[1] * m[11] + m[12] * m[3] * m[9]; + matOut[10] = m[0] * m[5] * m[15] - m[0] * m[7] * m[13] - m[4] * m[1] * m[15] + m[4] * m[3] * m[13] + m[12] * m[1] * m[7] - m[12] * m[3] * m[5]; + matOut[11] = -m[0] * m[5] * m[11] + m[0] * m[7] * m[9] + m[4] * m[1] * m[11] - m[4] * m[3] * m[9] - m[8] * m[1] * m[7] + m[8] * m[3] * m[5]; + matOut[12] = -m[4] * m[9] * m[14] + m[4] * m[10] * m[13] + m[8] * m[5] * m[14] - m[8] * m[6] * m[13] - m[12] * m[5] * m[10] + m[12] * m[6] * m[9]; + matOut[13] = m[0] * m[9] * m[14] - m[0] * m[10] * m[13] - m[8] * m[1] * m[14] + m[8] * m[2] * m[13] + m[12] * m[1] * m[10] - m[12] * m[2] * m[9]; + matOut[14] = -m[0] * m[5] * m[14] + m[0] * m[6] * m[13] + m[4] * m[1] * m[14] - m[4] * m[2] * m[13] - m[12] * m[1] * m[6] + m[12] * m[2] * m[5]; + matOut[15] = m[0] * m[5] * m[10] - m[0] * m[6] * m[9] - m[4] * m[1] * m[10] + m[4] * m[2] * m[9] + m[8] * m[1] * m[6] - m[8] * m[2] * m[5]; + float f = m[0] * matOut[0] + m[1] * matOut[4] + m[2] * matOut[8] + m[3] * matOut[12]; + + if ((double)f != 0.0D) + { + for (int i = 0; i < 16; ++i) + { + matOut[i] /= f; + } + } + else + { + Arrays.fill(matOut, 0.0F); + } + } + + static void invertMat4FBFA(FloatBuffer fbInvOut, FloatBuffer fbMatIn, float[] faInv, float[] faMat) + { + fbMatIn.get(faMat); + invertMat4(faInv, faMat); + fbInvOut.put(faInv); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexAttrib.java b/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexAttrib.java new file mode 100644 index 0000000..296685f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexAttrib.java @@ -0,0 +1,18 @@ +package net.optifine.shaders; + +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumType; + +public class SVertexAttrib +{ + public int index; + public int count; + public EnumType type; + public int offset; + + public SVertexAttrib(int index, int count, EnumType type) + { + this.index = index; + this.count = count; + this.type = type; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexBuilder.java b/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexBuilder.java new file mode 100644 index 0000000..55b85b8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexBuilder.java @@ -0,0 +1,335 @@ +package net.optifine.shaders; + +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import net.minecraft.block.Block; +import net.minecraft.block.state.BlockStateBase; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.util.BlockPos; +import net.minecraft.world.IBlockAccess; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; + +public class SVertexBuilder +{ + int vertexSize; + int offsetNormal; + int offsetUV; + int offsetUVCenter; + boolean hasNormal; + boolean hasTangent; + boolean hasUV; + boolean hasUVCenter; + long[] entityData = new long[10]; + int entityDataIndex = 0; + + public SVertexBuilder() + { + this.entityData[this.entityDataIndex] = 0L; + } + + public static void initVertexBuilder(WorldRenderer wrr) + { + wrr.sVertexBuilder = new SVertexBuilder(); + } + + public void pushEntity(long data) + { + ++this.entityDataIndex; + this.entityData[this.entityDataIndex] = data; + } + + public void popEntity() + { + this.entityData[this.entityDataIndex] = 0L; + --this.entityDataIndex; + } + + public static void pushEntity(IBlockState blockState, BlockPos blockPos, IBlockAccess blockAccess, WorldRenderer wrr) + { + Block block = blockState.getBlock(); + int i; + int j; + + if (blockState instanceof BlockStateBase) + { + BlockStateBase blockstatebase = (BlockStateBase)blockState; + i = blockstatebase.getBlockId(); + j = blockstatebase.getMetadata(); + } + else + { + i = Block.getIdFromBlock(block); + j = block.getMetaFromState(blockState); + } + + int j1 = BlockAliases.getBlockAliasId(i, j); + + if (j1 >= 0) + { + i = j1; + } + + int k = block.getRenderType(); + int l = ((k & 65535) << 16) + (i & 65535); + int i1 = j & 65535; + wrr.sVertexBuilder.pushEntity(((long)i1 << 32) + (long)l); + } + + public static void popEntity(WorldRenderer wrr) + { + wrr.sVertexBuilder.popEntity(); + } + + public static boolean popEntity(boolean value, WorldRenderer wrr) + { + wrr.sVertexBuilder.popEntity(); + return value; + } + + public static void endSetVertexFormat(WorldRenderer wrr) + { + SVertexBuilder svertexbuilder = wrr.sVertexBuilder; + VertexFormat vertexformat = wrr.getVertexFormat(); + svertexbuilder.vertexSize = vertexformat.getNextOffset() / 4; + svertexbuilder.hasNormal = vertexformat.hasNormal(); + svertexbuilder.hasTangent = svertexbuilder.hasNormal; + svertexbuilder.hasUV = vertexformat.hasUvOffset(0); + svertexbuilder.offsetNormal = svertexbuilder.hasNormal ? vertexformat.getNormalOffset() / 4 : 0; + svertexbuilder.offsetUV = svertexbuilder.hasUV ? vertexformat.getUvOffsetById(0) / 4 : 0; + svertexbuilder.offsetUVCenter = 8; + } + + public static void beginAddVertex(WorldRenderer wrr) + { + if (wrr.vertexCount == 0) + { + endSetVertexFormat(wrr); + } + } + + public static void endAddVertex(WorldRenderer wrr) + { + SVertexBuilder svertexbuilder = wrr.sVertexBuilder; + + if (svertexbuilder.vertexSize == 14) + { + if (wrr.drawMode == 7 && wrr.vertexCount % 4 == 0) + { + svertexbuilder.calcNormal(wrr, wrr.getBufferSize() - 4 * svertexbuilder.vertexSize); + } + + long i = svertexbuilder.entityData[svertexbuilder.entityDataIndex]; + int j = wrr.getBufferSize() - 14 + 12; + wrr.rawIntBuffer.put(j, (int)i); + wrr.rawIntBuffer.put(j + 1, (int)(i >> 32)); + } + } + + public static void beginAddVertexData(WorldRenderer wrr, int[] data) + { + if (wrr.vertexCount == 0) + { + endSetVertexFormat(wrr); + } + + SVertexBuilder svertexbuilder = wrr.sVertexBuilder; + + if (svertexbuilder.vertexSize == 14) + { + long i = svertexbuilder.entityData[svertexbuilder.entityDataIndex]; + + for (int j = 12; j + 1 < data.length; j += 14) + { + data[j] = (int)i; + data[j + 1] = (int)(i >> 32); + } + } + } + + public static void beginAddVertexData(WorldRenderer wrr, ByteBuffer byteBuffer) + { + if (wrr.vertexCount == 0) + { + endSetVertexFormat(wrr); + } + + SVertexBuilder svertexbuilder = wrr.sVertexBuilder; + + if (svertexbuilder.vertexSize == 14) + { + long i = svertexbuilder.entityData[svertexbuilder.entityDataIndex]; + int j = byteBuffer.limit() / 4; + + for (int k = 12; k + 1 < j; k += 14) + { + int l = (int)i; + int i1 = (int)(i >> 32); + byteBuffer.putInt(k * 4, l); + byteBuffer.putInt((k + 1) * 4, i1); + } + } + } + + public static void endAddVertexData(WorldRenderer wrr) + { + SVertexBuilder svertexbuilder = wrr.sVertexBuilder; + + if (svertexbuilder.vertexSize == 14 && wrr.drawMode == 7 && wrr.vertexCount % 4 == 0) + { + svertexbuilder.calcNormal(wrr, wrr.getBufferSize() - 4 * svertexbuilder.vertexSize); + } + } + + public void calcNormal(WorldRenderer wrr, int baseIndex) + { + FloatBuffer floatbuffer = wrr.rawFloatBuffer; + IntBuffer intbuffer = wrr.rawIntBuffer; + int i = wrr.getBufferSize(); + float f = floatbuffer.get(baseIndex + 0 * this.vertexSize); + float f1 = floatbuffer.get(baseIndex + 0 * this.vertexSize + 1); + float f2 = floatbuffer.get(baseIndex + 0 * this.vertexSize + 2); + float f3 = floatbuffer.get(baseIndex + 0 * this.vertexSize + this.offsetUV); + float f4 = floatbuffer.get(baseIndex + 0 * this.vertexSize + this.offsetUV + 1); + float f5 = floatbuffer.get(baseIndex + 1 * this.vertexSize); + float f6 = floatbuffer.get(baseIndex + 1 * this.vertexSize + 1); + float f7 = floatbuffer.get(baseIndex + 1 * this.vertexSize + 2); + float f8 = floatbuffer.get(baseIndex + 1 * this.vertexSize + this.offsetUV); + float f9 = floatbuffer.get(baseIndex + 1 * this.vertexSize + this.offsetUV + 1); + float f10 = floatbuffer.get(baseIndex + 2 * this.vertexSize); + float f11 = floatbuffer.get(baseIndex + 2 * this.vertexSize + 1); + float f12 = floatbuffer.get(baseIndex + 2 * this.vertexSize + 2); + float f13 = floatbuffer.get(baseIndex + 2 * this.vertexSize + this.offsetUV); + float f14 = floatbuffer.get(baseIndex + 2 * this.vertexSize + this.offsetUV + 1); + float f15 = floatbuffer.get(baseIndex + 3 * this.vertexSize); + float f16 = floatbuffer.get(baseIndex + 3 * this.vertexSize + 1); + float f17 = floatbuffer.get(baseIndex + 3 * this.vertexSize + 2); + float f18 = floatbuffer.get(baseIndex + 3 * this.vertexSize + this.offsetUV); + float f19 = floatbuffer.get(baseIndex + 3 * this.vertexSize + this.offsetUV + 1); + float f20 = f10 - f; + float f21 = f11 - f1; + float f22 = f12 - f2; + float f23 = f15 - f5; + float f24 = f16 - f6; + float f25 = f17 - f7; + float f30 = f21 * f25 - f24 * f22; + float f31 = f22 * f23 - f25 * f20; + float f32 = f20 * f24 - f23 * f21; + float f33 = f30 * f30 + f31 * f31 + f32 * f32; + float f34 = (double)f33 != 0.0D ? (float)(1.0D / Math.sqrt((double)f33)) : 1.0F; + f30 = f30 * f34; + f31 = f31 * f34; + f32 = f32 * f34; + f20 = f5 - f; + f21 = f6 - f1; + f22 = f7 - f2; + float f26 = f8 - f3; + float f27 = f9 - f4; + f23 = f10 - f; + f24 = f11 - f1; + f25 = f12 - f2; + float f28 = f13 - f3; + float f29 = f14 - f4; + float f35 = f26 * f29 - f28 * f27; + float f36 = f35 != 0.0F ? 1.0F / f35 : 1.0F; + float f37 = (f29 * f20 - f27 * f23) * f36; + float f38 = (f29 * f21 - f27 * f24) * f36; + float f39 = (f29 * f22 - f27 * f25) * f36; + float f40 = (f26 * f23 - f28 * f20) * f36; + float f41 = (f26 * f24 - f28 * f21) * f36; + float f42 = (f26 * f25 - f28 * f22) * f36; + f33 = f37 * f37 + f38 * f38 + f39 * f39; + f34 = (double)f33 != 0.0D ? (float)(1.0D / Math.sqrt((double)f33)) : 1.0F; + f37 = f37 * f34; + f38 = f38 * f34; + f39 = f39 * f34; + f33 = f40 * f40 + f41 * f41 + f42 * f42; + f34 = (double)f33 != 0.0D ? (float)(1.0D / Math.sqrt((double)f33)) : 1.0F; + f40 = f40 * f34; + f41 = f41 * f34; + f42 = f42 * f34; + float f43 = f32 * f38 - f31 * f39; + float f44 = f30 * f39 - f32 * f37; + float f45 = f31 * f37 - f30 * f38; + float f46 = f40 * f43 + f41 * f44 + f42 * f45 < 0.0F ? -1.0F : 1.0F; + int j = (int)(f30 * 127.0F) & 255; + int k = (int)(f31 * 127.0F) & 255; + int l = (int)(f32 * 127.0F) & 255; + int i1 = (l << 16) + (k << 8) + j; + intbuffer.put(baseIndex + 0 * this.vertexSize + this.offsetNormal, i1); + intbuffer.put(baseIndex + 1 * this.vertexSize + this.offsetNormal, i1); + intbuffer.put(baseIndex + 2 * this.vertexSize + this.offsetNormal, i1); + intbuffer.put(baseIndex + 3 * this.vertexSize + this.offsetNormal, i1); + int j1 = ((int)(f37 * 32767.0F) & 65535) + (((int)(f38 * 32767.0F) & 65535) << 16); + int k1 = ((int)(f39 * 32767.0F) & 65535) + (((int)(f46 * 32767.0F) & 65535) << 16); + intbuffer.put(baseIndex + 0 * this.vertexSize + 10, j1); + intbuffer.put(baseIndex + 0 * this.vertexSize + 10 + 1, k1); + intbuffer.put(baseIndex + 1 * this.vertexSize + 10, j1); + intbuffer.put(baseIndex + 1 * this.vertexSize + 10 + 1, k1); + intbuffer.put(baseIndex + 2 * this.vertexSize + 10, j1); + intbuffer.put(baseIndex + 2 * this.vertexSize + 10 + 1, k1); + intbuffer.put(baseIndex + 3 * this.vertexSize + 10, j1); + intbuffer.put(baseIndex + 3 * this.vertexSize + 10 + 1, k1); + float f47 = (f3 + f8 + f13 + f18) / 4.0F; + float f48 = (f4 + f9 + f14 + f19) / 4.0F; + floatbuffer.put(baseIndex + 0 * this.vertexSize + 8, f47); + floatbuffer.put(baseIndex + 0 * this.vertexSize + 8 + 1, f48); + floatbuffer.put(baseIndex + 1 * this.vertexSize + 8, f47); + floatbuffer.put(baseIndex + 1 * this.vertexSize + 8 + 1, f48); + floatbuffer.put(baseIndex + 2 * this.vertexSize + 8, f47); + floatbuffer.put(baseIndex + 2 * this.vertexSize + 8 + 1, f48); + floatbuffer.put(baseIndex + 3 * this.vertexSize + 8, f47); + floatbuffer.put(baseIndex + 3 * this.vertexSize + 8 + 1, f48); + } + + public static void calcNormalChunkLayer(WorldRenderer wrr) + { + if (wrr.getVertexFormat().hasNormal() && wrr.drawMode == 7 && wrr.vertexCount % 4 == 0) + { + SVertexBuilder svertexbuilder = wrr.sVertexBuilder; + endSetVertexFormat(wrr); + int i = wrr.vertexCount * svertexbuilder.vertexSize; + + for (int j = 0; j < i; j += svertexbuilder.vertexSize * 4) + { + svertexbuilder.calcNormal(wrr, j); + } + } + } + + public static void drawArrays(int drawMode, int first, int count, WorldRenderer wrr) + { + if (count != 0) + { + VertexFormat vertexformat = wrr.getVertexFormat(); + int i = vertexformat.getNextOffset(); + + if (i == 56) + { + ByteBuffer bytebuffer = wrr.getByteBuffer(); + bytebuffer.position(32); + GL20.glVertexAttribPointer(Shaders.midTexCoordAttrib, 2, GL11.GL_FLOAT, false, i, bytebuffer); + bytebuffer.position(40); + GL20.glVertexAttribPointer(Shaders.tangentAttrib, 4, GL11.GL_SHORT, false, i, bytebuffer); + bytebuffer.position(48); + GL20.glVertexAttribPointer(Shaders.entityAttrib, 3, GL11.GL_SHORT, false, i, bytebuffer); + bytebuffer.position(0); + GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib); + GL20.glEnableVertexAttribArray(Shaders.tangentAttrib); + GL20.glEnableVertexAttribArray(Shaders.entityAttrib); + GlStateManager.glDrawArrays(drawMode, first, count); + GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib); + GL20.glDisableVertexAttribArray(Shaders.tangentAttrib); + GL20.glDisableVertexAttribArray(Shaders.entityAttrib); + } + else + { + GlStateManager.glDrawArrays(drawMode, first, count); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexFormat.java b/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexFormat.java new file mode 100644 index 0000000..186fea8 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/SVertexFormat.java @@ -0,0 +1,104 @@ +package net.optifine.shaders; + +import net.minecraft.client.renderer.vertex.VertexFormat; +import net.minecraft.client.renderer.vertex.VertexFormatElement; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumType; +import net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage; + +public class SVertexFormat +{ + public static final int vertexSizeBlock = 14; + public static final int offsetMidTexCoord = 8; + public static final int offsetTangent = 10; + public static final int offsetEntity = 12; + public static final VertexFormat defVertexFormatTextured = makeDefVertexFormatTextured(); + + public static VertexFormat makeDefVertexFormatBlock() + { + VertexFormat vertexformat = new VertexFormat(); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.POSITION, 3)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.UBYTE, EnumUsage.COLOR, 4)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.UV, 2)); + vertexformat.addElement(new VertexFormatElement(1, EnumType.SHORT, EnumUsage.UV, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.NORMAL, 3)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.PADDING, 1)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.PADDING, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + return vertexformat; + } + + public static VertexFormat makeDefVertexFormatItem() + { + VertexFormat vertexformat = new VertexFormat(); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.POSITION, 3)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.UBYTE, EnumUsage.COLOR, 4)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.UV, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.NORMAL, 3)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.PADDING, 1)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.PADDING, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + return vertexformat; + } + + public static VertexFormat makeDefVertexFormatTextured() + { + VertexFormat vertexformat = new VertexFormat(); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.POSITION, 3)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.UBYTE, EnumUsage.PADDING, 4)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.UV, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.NORMAL, 3)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.PADDING, 1)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.PADDING, 2)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + vertexformat.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + return vertexformat; + } + + public static void setDefBakedFormat(VertexFormat vf) + { + if (vf != null) + { + vf.clear(); + vf.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.POSITION, 3)); + vf.addElement(new VertexFormatElement(0, EnumType.UBYTE, EnumUsage.COLOR, 4)); + vf.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.UV, 2)); + vf.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 2)); + vf.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.NORMAL, 3)); + vf.addElement(new VertexFormatElement(0, EnumType.BYTE, EnumUsage.PADDING, 1)); + vf.addElement(new VertexFormatElement(0, EnumType.FLOAT, EnumUsage.PADDING, 2)); + vf.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + vf.addElement(new VertexFormatElement(0, EnumType.SHORT, EnumUsage.PADDING, 4)); + } + } + + public static VertexFormat duplicate(VertexFormat src) + { + if (src == null) + { + return null; + } + else + { + VertexFormat vertexformat = new VertexFormat(); + copy(src, vertexformat); + return vertexformat; + } + } + + public static void copy(VertexFormat src, VertexFormat dst) + { + if (src != null && dst != null) + { + dst.clear(); + + for (int i = 0; i < src.getElementCount(); ++i) + { + dst.addElement(src.getElement(i)); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackDefault.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackDefault.java new file mode 100644 index 0000000..4ad0dfb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackDefault.java @@ -0,0 +1,25 @@ +package net.optifine.shaders; + +import java.io.InputStream; + +public class ShaderPackDefault implements IShaderPack +{ + public void close() + { + } + + public InputStream getResourceAsStream(String resName) + { + return ShaderPackDefault.class.getResourceAsStream(resName); + } + + public String getName() + { + return "(internal)"; + } + + public boolean hasDirectory(String name) + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackFolder.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackFolder.java new file mode 100644 index 0000000..9de1466 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackFolder.java @@ -0,0 +1,46 @@ +package net.optifine.shaders; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import net.optifine.util.StrUtils; + +public class ShaderPackFolder implements IShaderPack +{ + protected File packFile; + + public ShaderPackFolder(String name, File file) + { + this.packFile = file; + } + + public void close() + { + } + + public InputStream getResourceAsStream(String resName) + { + try + { + String s = StrUtils.removePrefixSuffix(resName, "/", "/"); + File file1 = new File(this.packFile, s); + return !file1.exists() ? null : new BufferedInputStream(new FileInputStream(file1)); + } + catch (Exception var4) + { + return null; + } + } + + public boolean hasDirectory(String name) + { + File file1 = new File(this.packFile, name.substring(1)); + return !file1.exists() ? false : file1.isDirectory(); + } + + public String getName() + { + return this.packFile.getName(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackNone.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackNone.java new file mode 100644 index 0000000..e8ae566 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackNone.java @@ -0,0 +1,25 @@ +package net.optifine.shaders; + +import java.io.InputStream; + +public class ShaderPackNone implements IShaderPack +{ + public void close() + { + } + + public InputStream getResourceAsStream(String resName) + { + return null; + } + + public boolean hasDirectory(String name) + { + return false; + } + + public String getName() + { + return "OFF"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackZip.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackZip.java new file mode 100644 index 0000000..4fbffcd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderPackZip.java @@ -0,0 +1,164 @@ +package net.optifine.shaders; + +import com.google.common.base.Joiner; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.Enumeration; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import net.minecraft.src.Config; +import net.optifine.util.StrUtils; + +public class ShaderPackZip implements IShaderPack +{ + protected File packFile; + protected ZipFile packZipFile; + protected String baseFolder; + + public ShaderPackZip(String name, File file) + { + this.packFile = file; + this.packZipFile = null; + this.baseFolder = ""; + } + + public void close() + { + if (this.packZipFile != null) + { + try + { + this.packZipFile.close(); + } + catch (Exception var2) + { + ; + } + + this.packZipFile = null; + } + } + + public InputStream getResourceAsStream(String resName) + { + try + { + if (this.packZipFile == null) + { + this.packZipFile = new ZipFile(this.packFile); + this.baseFolder = this.detectBaseFolder(this.packZipFile); + } + + String s = StrUtils.removePrefix(resName, "/"); + + if (s.contains("..")) + { + s = this.resolveRelative(s); + } + + ZipEntry zipentry = this.packZipFile.getEntry(this.baseFolder + s); + return zipentry == null ? null : this.packZipFile.getInputStream(zipentry); + } + catch (Exception var4) + { + return null; + } + } + + private String resolveRelative(String name) + { + Deque deque = new ArrayDeque(); + String[] astring = Config.tokenize(name, "/"); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + + if (s.equals("..")) + { + if (deque.isEmpty()) + { + return ""; + } + + deque.removeLast(); + } + else + { + deque.add(s); + } + } + + String s1 = Joiner.on('/').join(deque); + return s1; + } + + private String detectBaseFolder(ZipFile zip) + { + ZipEntry zipentry = zip.getEntry("shaders/"); + + if (zipentry != null && zipentry.isDirectory()) + { + return ""; + } + else + { + Pattern pattern = Pattern.compile("([^/]+/)shaders/"); + Enumeration enumeration = zip.entries(); + + while (enumeration.hasMoreElements()) + { + ZipEntry zipentry1 = (ZipEntry)enumeration.nextElement(); + String s = zipentry1.getName(); + Matcher matcher = pattern.matcher(s); + + if (matcher.matches()) + { + String s1 = matcher.group(1); + + if (s1 != null) + { + if (s1.equals("shaders/")) + { + return ""; + } + + return s1; + } + } + } + + return ""; + } + } + + public boolean hasDirectory(String resName) + { + try + { + if (this.packZipFile == null) + { + this.packZipFile = new ZipFile(this.packFile); + this.baseFolder = this.detectBaseFolder(this.packZipFile); + } + + String s = StrUtils.removePrefix(resName, "/"); + ZipEntry zipentry = this.packZipFile.getEntry(this.baseFolder + s); + return zipentry != null; + } + catch (IOException var4) + { + return false; + } + } + + public String getName() + { + return this.packFile.getName(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderProgramData.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderProgramData.java new file mode 100644 index 0000000..851d487 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderProgramData.java @@ -0,0 +1,161 @@ +package net.optifine.shaders; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderProgramData +{ + public int programIDGL; + public int uniform_texture; + public int uniform_lightmap; + public int uniform_normals; + public int uniform_specular; + public int uniform_shadow; + public int uniform_watershadow; + public int uniform_shadowtex0; + public int uniform_shadowtex1; + public int uniform_depthtex0; + public int uniform_depthtex1; + public int uniform_shadowcolor; + public int uniform_shadowcolor0; + public int uniform_shadowcolor1; + public int uniform_noisetex; + public int uniform_gcolor; + public int uniform_gdepth; + public int uniform_gnormal; + public int uniform_composite; + public int uniform_gaux1; + public int uniform_gaux2; + public int uniform_gaux3; + public int uniform_gaux4; + public int uniform_colortex0; + public int uniform_colortex1; + public int uniform_colortex2; + public int uniform_colortex3; + public int uniform_colortex4; + public int uniform_colortex5; + public int uniform_colortex6; + public int uniform_colortex7; + public int uniform_gdepthtex; + public int uniform_depthtex2; + public int uniform_tex; + public int uniform_heldItemId; + public int uniform_heldBlockLightValue; + public int uniform_fogMode; + public int uniform_fogColor; + public int uniform_skyColor; + public int uniform_worldTime; + public int uniform_moonPhase; + public int uniform_frameTimeCounter; + public int uniform_sunAngle; + public int uniform_shadowAngle; + public int uniform_rainStrength; + public int uniform_aspectRatio; + public int uniform_viewWidth; + public int uniform_viewHeight; + public int uniform_near; + public int uniform_far; + public int uniform_sunPosition; + public int uniform_moonPosition; + public int uniform_upPosition; + public int uniform_previousCameraPosition; + public int uniform_cameraPosition; + public int uniform_gbufferModelView; + public int uniform_gbufferModelViewInverse; + public int uniform_gbufferPreviousProjection; + public int uniform_gbufferProjection; + public int uniform_gbufferProjectionInverse; + public int uniform_gbufferPreviousModelView; + public int uniform_shadowProjection; + public int uniform_shadowProjectionInverse; + public int uniform_shadowModelView; + public int uniform_shadowModelViewInverse; + public int uniform_wetness; + public int uniform_eyeAltitude; + public int uniform_eyeBrightness; + public int uniform_eyeBrightnessSmooth; + public int uniform_terrainTextureSize; + public int uniform_terrainIconSize; + public int uniform_isEyeInWater; + public int uniform_hideGUI; + public int uniform_centerDepthSmooth; + public int uniform_atlasSize; + + public ShaderProgramData(int programID) + { + this.programIDGL = programID; + this.uniform_texture = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"texture"); + this.uniform_lightmap = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"lightmap"); + this.uniform_normals = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"normals"); + this.uniform_specular = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"specular"); + this.uniform_shadow = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadow"); + this.uniform_watershadow = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"watershadow"); + this.uniform_shadowtex0 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowtex0"); + this.uniform_shadowtex1 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowtex1"); + this.uniform_depthtex0 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"depthtex0"); + this.uniform_depthtex1 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"depthtex1"); + this.uniform_shadowcolor = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowcolor"); + this.uniform_shadowcolor0 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowcolor0"); + this.uniform_shadowcolor1 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowcolor1"); + this.uniform_noisetex = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"noisetex"); + this.uniform_gcolor = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gcolor"); + this.uniform_gdepth = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gdepth"); + this.uniform_gnormal = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gnormal"); + this.uniform_composite = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"composite"); + this.uniform_gaux1 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gaux1"); + this.uniform_gaux2 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gaux2"); + this.uniform_gaux3 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gaux3"); + this.uniform_gaux4 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gaux4"); + this.uniform_colortex0 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex0"); + this.uniform_colortex1 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex1"); + this.uniform_colortex2 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex2"); + this.uniform_colortex3 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex3"); + this.uniform_colortex4 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex4"); + this.uniform_colortex5 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex5"); + this.uniform_colortex6 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex6"); + this.uniform_colortex7 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"colortex7"); + this.uniform_gdepthtex = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gdepthtex"); + this.uniform_depthtex2 = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"depthtex2"); + this.uniform_tex = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"tex"); + this.uniform_heldItemId = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"heldItemId"); + this.uniform_heldBlockLightValue = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"heldBlockLightValue"); + this.uniform_fogMode = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"fogMode"); + this.uniform_fogColor = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"fogColor"); + this.uniform_skyColor = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"skyColor"); + this.uniform_worldTime = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"worldTime"); + this.uniform_moonPhase = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"moonPhase"); + this.uniform_frameTimeCounter = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"frameTimeCounter"); + this.uniform_sunAngle = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"sunAngle"); + this.uniform_shadowAngle = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowAngle"); + this.uniform_rainStrength = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"rainStrength"); + this.uniform_aspectRatio = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"aspectRatio"); + this.uniform_viewWidth = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"viewWidth"); + this.uniform_viewHeight = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"viewHeight"); + this.uniform_near = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"near"); + this.uniform_far = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"far"); + this.uniform_sunPosition = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"sunPosition"); + this.uniform_moonPosition = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"moonPosition"); + this.uniform_upPosition = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"upPosition"); + this.uniform_previousCameraPosition = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"previousCameraPosition"); + this.uniform_cameraPosition = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"cameraPosition"); + this.uniform_gbufferModelView = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gbufferModelView"); + this.uniform_gbufferModelViewInverse = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gbufferModelViewInverse"); + this.uniform_gbufferPreviousProjection = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gbufferPreviousProjection"); + this.uniform_gbufferProjection = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gbufferProjection"); + this.uniform_gbufferProjectionInverse = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gbufferProjectionInverse"); + this.uniform_gbufferPreviousModelView = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"gbufferPreviousModelView"); + this.uniform_shadowProjection = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowProjection"); + this.uniform_shadowProjectionInverse = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowProjectionInverse"); + this.uniform_shadowModelView = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowModelView"); + this.uniform_shadowModelViewInverse = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"shadowModelViewInverse"); + this.uniform_wetness = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"wetness"); + this.uniform_eyeAltitude = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"eyeAltitude"); + this.uniform_eyeBrightness = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"eyeBrightness"); + this.uniform_eyeBrightnessSmooth = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"eyeBrightnessSmooth"); + this.uniform_terrainTextureSize = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"terrainTextureSize"); + this.uniform_terrainIconSize = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"terrainIconSize"); + this.uniform_isEyeInWater = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"isEyeInWater"); + this.uniform_hideGUI = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"hideGUI"); + this.uniform_centerDepthSmooth = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"centerDepthSmooth"); + this.uniform_atlasSize = ARBShaderObjects.glGetUniformLocationARB(programID, (CharSequence)"atlasSize"); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderUtils.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderUtils.java new file mode 100644 index 0000000..4e6467e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShaderUtils.java @@ -0,0 +1,87 @@ +package net.optifine.shaders; + +import net.minecraft.src.Config; +import net.optifine.shaders.config.ShaderOption; +import net.optifine.shaders.config.ShaderProfile; + +public class ShaderUtils +{ + public static ShaderOption getShaderOption(String name, ShaderOption[] opts) + { + if (opts == null) + { + return null; + } + else + { + for (int i = 0; i < opts.length; ++i) + { + ShaderOption shaderoption = opts[i]; + + if (shaderoption.getName().equals(name)) + { + return shaderoption; + } + } + + return null; + } + } + + public static ShaderProfile detectProfile(ShaderProfile[] profs, ShaderOption[] opts, boolean def) + { + if (profs == null) + { + return null; + } + else + { + for (int i = 0; i < profs.length; ++i) + { + ShaderProfile shaderprofile = profs[i]; + + if (matchProfile(shaderprofile, opts, def)) + { + return shaderprofile; + } + } + + return null; + } + } + + public static boolean matchProfile(ShaderProfile prof, ShaderOption[] opts, boolean def) + { + if (prof == null) + { + return false; + } + else if (opts == null) + { + return false; + } + else + { + String[] astring = prof.getOptions(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + ShaderOption shaderoption = getShaderOption(s, opts); + + if (shaderoption != null) + { + String s1 = def ? shaderoption.getValueDefault() : shaderoption.getValue(); + String s2 = prof.getValue(s); + + if (!Config.equals(s1, s2)) + { + return false; + } + } + } + + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/Shaders.java b/Client-1.8.9/src/main/java/net/optifine/shaders/Shaders.java new file mode 100644 index 0000000..776d8a3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/Shaders.java @@ -0,0 +1,5861 @@ +package net.optifine.shaders; + +import com.google.common.base.Charsets; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.optifine.CustomBlockLayers; +import net.optifine.CustomColors; +import net.optifine.GlErrors; +import net.optifine.Lang; +import net.optifine.config.ConnectedParser; +import net.optifine.expr.IExpressionBool; +import net.optifine.reflect.Reflector; +import net.optifine.render.GlAlphaState; +import net.optifine.render.GlBlendState; +import net.optifine.shaders.config.EnumShaderOption; +import net.optifine.shaders.config.MacroProcessor; +import net.optifine.shaders.config.MacroState; +import net.optifine.shaders.config.PropertyDefaultFastFancyOff; +import net.optifine.shaders.config.PropertyDefaultTrueFalse; +import net.optifine.shaders.config.RenderScale; +import net.optifine.shaders.config.ScreenShaderOptions; +import net.optifine.shaders.config.ShaderLine; +import net.optifine.shaders.config.ShaderOption; +import net.optifine.shaders.config.ShaderOptionProfile; +import net.optifine.shaders.config.ShaderOptionRest; +import net.optifine.shaders.config.ShaderPackParser; +import net.optifine.shaders.config.ShaderParser; +import net.optifine.shaders.config.ShaderProfile; +import net.optifine.shaders.uniform.CustomUniforms; +import net.optifine.shaders.uniform.ShaderUniform1f; +import net.optifine.shaders.uniform.ShaderUniform1i; +import net.optifine.shaders.uniform.ShaderUniform2i; +import net.optifine.shaders.uniform.ShaderUniform3f; +import net.optifine.shaders.uniform.ShaderUniform4f; +import net.optifine.shaders.uniform.ShaderUniform4i; +import net.optifine.shaders.uniform.ShaderUniformM4; +import net.optifine.shaders.uniform.ShaderUniforms; +import net.optifine.shaders.uniform.Smoother; +import net.optifine.texture.InternalFormat; +import net.optifine.texture.PixelFormat; +import net.optifine.texture.PixelType; +import net.optifine.texture.TextureType; +import net.optifine.util.EntityUtils; +import net.optifine.util.PropertiesOrdered; +import net.optifine.util.StrUtils; +import net.optifine.util.TimedEvent; +import org.apache.commons.io.IOUtils; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.*; +import org.lwjgl.util.glu.GLU; +import org.lwjgl.util.vector.Vector4f; + +public class Shaders +{ + static Minecraft mc; + static EntityRenderer entityRenderer; + public static boolean isInitializedOnce = false; + public static boolean isShaderPackInitialized = false; + public static ContextCapabilities capabilities; + public static String glVersionString; + public static String glVendorString; + public static String glRendererString; + public static boolean hasGlGenMipmap = false; + public static int countResetDisplayLists = 0; + private static int renderDisplayWidth = 0; + private static int renderDisplayHeight = 0; + public static int renderWidth = 0; + public static int renderHeight = 0; + public static boolean isRenderingWorld = false; + public static boolean isRenderingSky = false; + public static boolean isCompositeRendered = false; + public static boolean isRenderingDfb = false; + public static boolean isShadowPass = false; + public static boolean isEntitiesGlowing = false; + public static boolean isSleeping; + private static boolean isRenderingFirstPersonHand; + private static boolean isHandRenderedMain; + private static boolean isHandRenderedOff; + private static boolean skipRenderHandMain; + private static boolean skipRenderHandOff; + public static boolean renderItemKeepDepthMask = false; + public static boolean itemToRenderMainTranslucent = false; + public static boolean itemToRenderOffTranslucent = false; + static float[] sunPosition = new float[4]; + static float[] moonPosition = new float[4]; + static float[] shadowLightPosition = new float[4]; + static float[] upPosition = new float[4]; + static float[] shadowLightPositionVector = new float[4]; + static float[] upPosModelView = new float[] {0.0F, 100.0F, 0.0F, 0.0F}; + static float[] sunPosModelView = new float[] {0.0F, 100.0F, 0.0F, 0.0F}; + static float[] moonPosModelView = new float[] {0.0F, -100.0F, 0.0F, 0.0F}; + private static float[] tempMat = new float[16]; + static float clearColorR; + static float clearColorG; + static float clearColorB; + static float skyColorR; + static float skyColorG; + static float skyColorB; + static long worldTime = 0L; + static long lastWorldTime = 0L; + static long diffWorldTime = 0L; + static float celestialAngle = 0.0F; + static float sunAngle = 0.0F; + static float shadowAngle = 0.0F; + static int moonPhase = 0; + static long systemTime = 0L; + static long lastSystemTime = 0L; + static long diffSystemTime = 0L; + static int frameCounter = 0; + static float frameTime = 0.0F; + static float frameTimeCounter = 0.0F; + static int systemTimeInt32 = 0; + static float rainStrength = 0.0F; + static float wetness = 0.0F; + public static float wetnessHalfLife = 600.0F; + public static float drynessHalfLife = 200.0F; + public static float eyeBrightnessHalflife = 10.0F; + static boolean usewetness = false; + static int isEyeInWater = 0; + static int eyeBrightness = 0; + static float eyeBrightnessFadeX = 0.0F; + static float eyeBrightnessFadeY = 0.0F; + static float eyePosY = 0.0F; + static float centerDepth = 0.0F; + static float centerDepthSmooth = 0.0F; + static float centerDepthSmoothHalflife = 1.0F; + static boolean centerDepthSmoothEnabled = false; + static int superSamplingLevel = 1; + static float nightVision = 0.0F; + static float blindness = 0.0F; + static boolean lightmapEnabled = false; + static boolean fogEnabled = true; + public static int entityAttrib = 10; + public static int midTexCoordAttrib = 11; + public static int tangentAttrib = 12; + public static boolean useEntityAttrib = false; + public static boolean useMidTexCoordAttrib = false; + public static boolean useTangentAttrib = false; + public static boolean progUseEntityAttrib = false; + public static boolean progUseMidTexCoordAttrib = false; + public static boolean progUseTangentAttrib = false; + private static boolean progArbGeometryShader4 = false; + private static int progMaxVerticesOut = 3; + private static boolean hasGeometryShaders = false; + public static int atlasSizeX = 0; + public static int atlasSizeY = 0; + private static ShaderUniforms shaderUniforms = new ShaderUniforms(); + public static ShaderUniform4f uniform_entityColor = shaderUniforms.make4f("entityColor"); + public static ShaderUniform1i uniform_entityId = shaderUniforms.make1i("entityId"); + public static ShaderUniform1i uniform_blockEntityId = shaderUniforms.make1i("blockEntityId"); + public static ShaderUniform1i uniform_texture = shaderUniforms.make1i("texture"); + public static ShaderUniform1i uniform_lightmap = shaderUniforms.make1i("lightmap"); + public static ShaderUniform1i uniform_normals = shaderUniforms.make1i("normals"); + public static ShaderUniform1i uniform_specular = shaderUniforms.make1i("specular"); + public static ShaderUniform1i uniform_shadow = shaderUniforms.make1i("shadow"); + public static ShaderUniform1i uniform_watershadow = shaderUniforms.make1i("watershadow"); + public static ShaderUniform1i uniform_shadowtex0 = shaderUniforms.make1i("shadowtex0"); + public static ShaderUniform1i uniform_shadowtex1 = shaderUniforms.make1i("shadowtex1"); + public static ShaderUniform1i uniform_depthtex0 = shaderUniforms.make1i("depthtex0"); + public static ShaderUniform1i uniform_depthtex1 = shaderUniforms.make1i("depthtex1"); + public static ShaderUniform1i uniform_shadowcolor = shaderUniforms.make1i("shadowcolor"); + public static ShaderUniform1i uniform_shadowcolor0 = shaderUniforms.make1i("shadowcolor0"); + public static ShaderUniform1i uniform_shadowcolor1 = shaderUniforms.make1i("shadowcolor1"); + public static ShaderUniform1i uniform_noisetex = shaderUniforms.make1i("noisetex"); + public static ShaderUniform1i uniform_gcolor = shaderUniforms.make1i("gcolor"); + public static ShaderUniform1i uniform_gdepth = shaderUniforms.make1i("gdepth"); + public static ShaderUniform1i uniform_gnormal = shaderUniforms.make1i("gnormal"); + public static ShaderUniform1i uniform_composite = shaderUniforms.make1i("composite"); + public static ShaderUniform1i uniform_gaux1 = shaderUniforms.make1i("gaux1"); + public static ShaderUniform1i uniform_gaux2 = shaderUniforms.make1i("gaux2"); + public static ShaderUniform1i uniform_gaux3 = shaderUniforms.make1i("gaux3"); + public static ShaderUniform1i uniform_gaux4 = shaderUniforms.make1i("gaux4"); + public static ShaderUniform1i uniform_colortex0 = shaderUniforms.make1i("colortex0"); + public static ShaderUniform1i uniform_colortex1 = shaderUniforms.make1i("colortex1"); + public static ShaderUniform1i uniform_colortex2 = shaderUniforms.make1i("colortex2"); + public static ShaderUniform1i uniform_colortex3 = shaderUniforms.make1i("colortex3"); + public static ShaderUniform1i uniform_colortex4 = shaderUniforms.make1i("colortex4"); + public static ShaderUniform1i uniform_colortex5 = shaderUniforms.make1i("colortex5"); + public static ShaderUniform1i uniform_colortex6 = shaderUniforms.make1i("colortex6"); + public static ShaderUniform1i uniform_colortex7 = shaderUniforms.make1i("colortex7"); + public static ShaderUniform1i uniform_gdepthtex = shaderUniforms.make1i("gdepthtex"); + public static ShaderUniform1i uniform_depthtex2 = shaderUniforms.make1i("depthtex2"); + public static ShaderUniform1i uniform_tex = shaderUniforms.make1i("tex"); + public static ShaderUniform1i uniform_heldItemId = shaderUniforms.make1i("heldItemId"); + public static ShaderUniform1i uniform_heldBlockLightValue = shaderUniforms.make1i("heldBlockLightValue"); + public static ShaderUniform1i uniform_heldItemId2 = shaderUniforms.make1i("heldItemId2"); + public static ShaderUniform1i uniform_heldBlockLightValue2 = shaderUniforms.make1i("heldBlockLightValue2"); + public static ShaderUniform1i uniform_fogMode = shaderUniforms.make1i("fogMode"); + public static ShaderUniform1f uniform_fogDensity = shaderUniforms.make1f("fogDensity"); + public static ShaderUniform3f uniform_fogColor = shaderUniforms.make3f("fogColor"); + public static ShaderUniform3f uniform_skyColor = shaderUniforms.make3f("skyColor"); + public static ShaderUniform1i uniform_worldTime = shaderUniforms.make1i("worldTime"); + public static ShaderUniform1i uniform_worldDay = shaderUniforms.make1i("worldDay"); + public static ShaderUniform1i uniform_moonPhase = shaderUniforms.make1i("moonPhase"); + public static ShaderUniform1i uniform_frameCounter = shaderUniforms.make1i("frameCounter"); + public static ShaderUniform1f uniform_frameTime = shaderUniforms.make1f("frameTime"); + public static ShaderUniform1f uniform_frameTimeCounter = shaderUniforms.make1f("frameTimeCounter"); + public static ShaderUniform1f uniform_sunAngle = shaderUniforms.make1f("sunAngle"); + public static ShaderUniform1f uniform_shadowAngle = shaderUniforms.make1f("shadowAngle"); + public static ShaderUniform1f uniform_rainStrength = shaderUniforms.make1f("rainStrength"); + public static ShaderUniform1f uniform_aspectRatio = shaderUniforms.make1f("aspectRatio"); + public static ShaderUniform1f uniform_viewWidth = shaderUniforms.make1f("viewWidth"); + public static ShaderUniform1f uniform_viewHeight = shaderUniforms.make1f("viewHeight"); + public static ShaderUniform1f uniform_near = shaderUniforms.make1f("near"); + public static ShaderUniform1f uniform_far = shaderUniforms.make1f("far"); + public static ShaderUniform3f uniform_sunPosition = shaderUniforms.make3f("sunPosition"); + public static ShaderUniform3f uniform_moonPosition = shaderUniforms.make3f("moonPosition"); + public static ShaderUniform3f uniform_shadowLightPosition = shaderUniforms.make3f("shadowLightPosition"); + public static ShaderUniform3f uniform_upPosition = shaderUniforms.make3f("upPosition"); + public static ShaderUniform3f uniform_previousCameraPosition = shaderUniforms.make3f("previousCameraPosition"); + public static ShaderUniform3f uniform_cameraPosition = shaderUniforms.make3f("cameraPosition"); + public static ShaderUniformM4 uniform_gbufferModelView = shaderUniforms.makeM4("gbufferModelView"); + public static ShaderUniformM4 uniform_gbufferModelViewInverse = shaderUniforms.makeM4("gbufferModelViewInverse"); + public static ShaderUniformM4 uniform_gbufferPreviousProjection = shaderUniforms.makeM4("gbufferPreviousProjection"); + public static ShaderUniformM4 uniform_gbufferProjection = shaderUniforms.makeM4("gbufferProjection"); + public static ShaderUniformM4 uniform_gbufferProjectionInverse = shaderUniforms.makeM4("gbufferProjectionInverse"); + public static ShaderUniformM4 uniform_gbufferPreviousModelView = shaderUniforms.makeM4("gbufferPreviousModelView"); + public static ShaderUniformM4 uniform_shadowProjection = shaderUniforms.makeM4("shadowProjection"); + public static ShaderUniformM4 uniform_shadowProjectionInverse = shaderUniforms.makeM4("shadowProjectionInverse"); + public static ShaderUniformM4 uniform_shadowModelView = shaderUniforms.makeM4("shadowModelView"); + public static ShaderUniformM4 uniform_shadowModelViewInverse = shaderUniforms.makeM4("shadowModelViewInverse"); + public static ShaderUniform1f uniform_wetness = shaderUniforms.make1f("wetness"); + public static ShaderUniform1f uniform_eyeAltitude = shaderUniforms.make1f("eyeAltitude"); + public static ShaderUniform2i uniform_eyeBrightness = shaderUniforms.make2i("eyeBrightness"); + public static ShaderUniform2i uniform_eyeBrightnessSmooth = shaderUniforms.make2i("eyeBrightnessSmooth"); + public static ShaderUniform2i uniform_terrainTextureSize = shaderUniforms.make2i("terrainTextureSize"); + public static ShaderUniform1i uniform_terrainIconSize = shaderUniforms.make1i("terrainIconSize"); + public static ShaderUniform1i uniform_isEyeInWater = shaderUniforms.make1i("isEyeInWater"); + public static ShaderUniform1f uniform_nightVision = shaderUniforms.make1f("nightVision"); + public static ShaderUniform1f uniform_blindness = shaderUniforms.make1f("blindness"); + public static ShaderUniform1f uniform_screenBrightness = shaderUniforms.make1f("screenBrightness"); + public static ShaderUniform1i uniform_hideGUI = shaderUniforms.make1i("hideGUI"); + public static ShaderUniform1f uniform_centerDepthSmooth = shaderUniforms.make1f("centerDepthSmooth"); + public static ShaderUniform2i uniform_atlasSize = shaderUniforms.make2i("atlasSize"); + public static ShaderUniform4i uniform_blendFunc = shaderUniforms.make4i("blendFunc"); + public static ShaderUniform1i uniform_instanceId = shaderUniforms.make1i("instanceId"); + static double previousCameraPositionX; + static double previousCameraPositionY; + static double previousCameraPositionZ; + static double cameraPositionX; + static double cameraPositionY; + static double cameraPositionZ; + static int cameraOffsetX; + static int cameraOffsetZ; + static int shadowPassInterval = 0; + public static boolean needResizeShadow = false; + static int shadowMapWidth = 1024; + static int shadowMapHeight = 1024; + static int spShadowMapWidth = 1024; + static int spShadowMapHeight = 1024; + static float shadowMapFOV = 90.0F; + static float shadowMapHalfPlane = 160.0F; + static boolean shadowMapIsOrtho = true; + static float shadowDistanceRenderMul = -1.0F; + static int shadowPassCounter = 0; + static int preShadowPassThirdPersonView; + public static boolean shouldSkipDefaultShadow = false; + static boolean waterShadowEnabled = false; + static final int MaxDrawBuffers = 8; + static final int MaxColorBuffers = 8; + static final int MaxDepthBuffers = 3; + static final int MaxShadowColorBuffers = 8; + static final int MaxShadowDepthBuffers = 2; + static int usedColorBuffers = 0; + static int usedDepthBuffers = 0; + static int usedShadowColorBuffers = 0; + static int usedShadowDepthBuffers = 0; + static int usedColorAttachs = 0; + static int usedDrawBuffers = 0; + static int dfb = 0; + static int sfb = 0; + private static int[] gbuffersFormat = new int[8]; + public static boolean[] gbuffersClear = new boolean[8]; + public static Vector4f[] gbuffersClearColor = new Vector4f[8]; + private static Programs programs = new Programs(); + public static final Program ProgramNone = programs.getProgramNone(); + public static final Program ProgramShadow = programs.makeShadow("shadow", ProgramNone); + public static final Program ProgramShadowSolid = programs.makeShadow("shadow_solid", ProgramShadow); + public static final Program ProgramShadowCutout = programs.makeShadow("shadow_cutout", ProgramShadow); + public static final Program ProgramBasic = programs.makeGbuffers("gbuffers_basic", ProgramNone); + public static final Program ProgramTextured = programs.makeGbuffers("gbuffers_textured", ProgramBasic); + public static final Program ProgramTexturedLit = programs.makeGbuffers("gbuffers_textured_lit", ProgramTextured); + public static final Program ProgramSkyBasic = programs.makeGbuffers("gbuffers_skybasic", ProgramBasic); + public static final Program ProgramSkyTextured = programs.makeGbuffers("gbuffers_skytextured", ProgramTextured); + public static final Program ProgramClouds = programs.makeGbuffers("gbuffers_clouds", ProgramTextured); + public static final Program ProgramTerrain = programs.makeGbuffers("gbuffers_terrain", ProgramTexturedLit); + public static final Program ProgramTerrainSolid = programs.makeGbuffers("gbuffers_terrain_solid", ProgramTerrain); + public static final Program ProgramTerrainCutoutMip = programs.makeGbuffers("gbuffers_terrain_cutout_mip", ProgramTerrain); + public static final Program ProgramTerrainCutout = programs.makeGbuffers("gbuffers_terrain_cutout", ProgramTerrain); + public static final Program ProgramDamagedBlock = programs.makeGbuffers("gbuffers_damagedblock", ProgramTerrain); + public static final Program ProgramBlock = programs.makeGbuffers("gbuffers_block", ProgramTerrain); + public static final Program ProgramBeaconBeam = programs.makeGbuffers("gbuffers_beaconbeam", ProgramTextured); + public static final Program ProgramItem = programs.makeGbuffers("gbuffers_item", ProgramTexturedLit); + public static final Program ProgramEntities = programs.makeGbuffers("gbuffers_entities", ProgramTexturedLit); + public static final Program ProgramEntitiesGlowing = programs.makeGbuffers("gbuffers_entities_glowing", ProgramEntities); + public static final Program ProgramArmorGlint = programs.makeGbuffers("gbuffers_armor_glint", ProgramTextured); + public static final Program ProgramSpiderEyes = programs.makeGbuffers("gbuffers_spidereyes", ProgramTextured); + public static final Program ProgramHand = programs.makeGbuffers("gbuffers_hand", ProgramTexturedLit); + public static final Program ProgramWeather = programs.makeGbuffers("gbuffers_weather", ProgramTexturedLit); + public static final Program ProgramDeferredPre = programs.makeVirtual("deferred_pre"); + public static final Program[] ProgramsDeferred = programs.makeDeferreds("deferred", 16); + public static final Program ProgramDeferred = ProgramsDeferred[0]; + public static final Program ProgramWater = programs.makeGbuffers("gbuffers_water", ProgramTerrain); + public static final Program ProgramHandWater = programs.makeGbuffers("gbuffers_hand_water", ProgramHand); + public static final Program ProgramCompositePre = programs.makeVirtual("composite_pre"); + public static final Program[] ProgramsComposite = programs.makeComposites("composite", 16); + public static final Program ProgramComposite = ProgramsComposite[0]; + public static final Program ProgramFinal = programs.makeComposite("final"); + public static final int ProgramCount = programs.getCount(); + public static final Program[] ProgramsAll = programs.getPrograms(); + public static Program activeProgram = ProgramNone; + public static int activeProgramID = 0; + private static ProgramStack programStack = new ProgramStack(); + private static boolean hasDeferredPrograms = false; + static IntBuffer activeDrawBuffers = null; + private static int activeCompositeMipmapSetting = 0; + public static Properties loadedShaders = null; + public static Properties shadersConfig = null; + public static ITextureObject defaultTexture = null; + public static boolean[] shadowHardwareFilteringEnabled = new boolean[2]; + public static boolean[] shadowMipmapEnabled = new boolean[2]; + public static boolean[] shadowFilterNearest = new boolean[2]; + public static boolean[] shadowColorMipmapEnabled = new boolean[8]; + public static boolean[] shadowColorFilterNearest = new boolean[8]; + public static boolean configTweakBlockDamage = false; + public static boolean configCloudShadow = false; + public static float configHandDepthMul = 0.125F; + public static float configRenderResMul = 1.0F; + public static float configShadowResMul = 1.0F; + public static int configTexMinFilB = 0; + public static int configTexMinFilN = 0; + public static int configTexMinFilS = 0; + public static int configTexMagFilB = 0; + public static int configTexMagFilN = 0; + public static int configTexMagFilS = 0; + public static boolean configShadowClipFrustrum = true; + public static boolean configNormalMap = true; + public static boolean configSpecularMap = true; + public static PropertyDefaultTrueFalse configOldLighting = new PropertyDefaultTrueFalse("oldLighting", "Classic Lighting", 0); + public static PropertyDefaultTrueFalse configOldHandLight = new PropertyDefaultTrueFalse("oldHandLight", "Old Hand Light", 0); + public static int configAntialiasingLevel = 0; + public static final int texMinFilRange = 3; + public static final int texMagFilRange = 2; + public static final String[] texMinFilDesc = new String[] {"Nearest", "Nearest-Nearest", "Nearest-Linear"}; + public static final String[] texMagFilDesc = new String[] {"Nearest", "Linear"}; + public static final int[] texMinFilValue = new int[] {9728, 9984, 9986}; + public static final int[] texMagFilValue = new int[] {9728, 9729}; + private static IShaderPack shaderPack = null; + public static boolean shaderPackLoaded = false; + public static String currentShaderName; + public static final String SHADER_PACK_NAME_NONE = "OFF"; + public static final String SHADER_PACK_NAME_DEFAULT = "(internal)"; + public static final String SHADER_PACKS_DIR_NAME = "shaderpacks"; + public static final String OPTIONS_FILE_NAME = "optionsshaders.txt"; + public static final File shaderPacksDir; + static File configFile; + private static ShaderOption[] shaderPackOptions = null; + private static Set shaderPackOptionSliders = null; + static ShaderProfile[] shaderPackProfiles = null; + static Map shaderPackGuiScreens = null; + static Map shaderPackProgramConditions = new HashMap(); + public static final String PATH_SHADERS_PROPERTIES = "/shaders/shaders.properties"; + public static PropertyDefaultFastFancyOff shaderPackClouds = new PropertyDefaultFastFancyOff("clouds", "Clouds", 0); + public static PropertyDefaultTrueFalse shaderPackOldLighting = new PropertyDefaultTrueFalse("oldLighting", "Classic Lighting", 0); + public static PropertyDefaultTrueFalse shaderPackOldHandLight = new PropertyDefaultTrueFalse("oldHandLight", "Old Hand Light", 0); + public static PropertyDefaultTrueFalse shaderPackDynamicHandLight = new PropertyDefaultTrueFalse("dynamicHandLight", "Dynamic Hand Light", 0); + public static PropertyDefaultTrueFalse shaderPackShadowTranslucent = new PropertyDefaultTrueFalse("shadowTranslucent", "Shadow Translucent", 0); + public static PropertyDefaultTrueFalse shaderPackUnderwaterOverlay = new PropertyDefaultTrueFalse("underwaterOverlay", "Underwater Overlay", 0); + public static PropertyDefaultTrueFalse shaderPackSun = new PropertyDefaultTrueFalse("sun", "Sun", 0); + public static PropertyDefaultTrueFalse shaderPackMoon = new PropertyDefaultTrueFalse("moon", "Moon", 0); + public static PropertyDefaultTrueFalse shaderPackVignette = new PropertyDefaultTrueFalse("vignette", "Vignette", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceSolid = new PropertyDefaultTrueFalse("backFace.solid", "Back-face Solid", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceCutout = new PropertyDefaultTrueFalse("backFace.cutout", "Back-face Cutout", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceCutoutMipped = new PropertyDefaultTrueFalse("backFace.cutoutMipped", "Back-face Cutout Mipped", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceTranslucent = new PropertyDefaultTrueFalse("backFace.translucent", "Back-face Translucent", 0); + public static PropertyDefaultTrueFalse shaderPackRainDepth = new PropertyDefaultTrueFalse("rain.depth", "Rain Depth", 0); + public static PropertyDefaultTrueFalse shaderPackBeaconBeamDepth = new PropertyDefaultTrueFalse("beacon.beam.depth", "Rain Depth", 0); + public static PropertyDefaultTrueFalse shaderPackSeparateAo = new PropertyDefaultTrueFalse("separateAo", "Separate AO", 0); + public static PropertyDefaultTrueFalse shaderPackFrustumCulling = new PropertyDefaultTrueFalse("frustum.culling", "Frustum Culling", 0); + private static Map shaderPackResources = new HashMap(); + private static World currentWorld = null; + private static List shaderPackDimensions = new ArrayList(); + private static ICustomTexture[] customTexturesGbuffers = null; + private static ICustomTexture[] customTexturesComposite = null; + private static ICustomTexture[] customTexturesDeferred = null; + private static String noiseTexturePath = null; + private static CustomUniforms customUniforms = null; + private static final int STAGE_GBUFFERS = 0; + private static final int STAGE_COMPOSITE = 1; + private static final int STAGE_DEFERRED = 2; + private static final String[] STAGE_NAMES = new String[] {"gbuffers", "composite", "deferred"}; + public static final boolean enableShadersOption = true; + private static final boolean enableShadersDebug = true; + public static final boolean saveFinalShaders = System.getProperty("shaders.debug.save", "false").equals("true"); + public static float blockLightLevel05 = 0.5F; + public static float blockLightLevel06 = 0.6F; + public static float blockLightLevel08 = 0.8F; + public static float aoLevel = -1.0F; + public static float sunPathRotation = 0.0F; + public static float shadowAngleInterval = 0.0F; + public static int fogMode = 0; + public static float fogDensity = 0.0F; + public static float fogColorR; + public static float fogColorG; + public static float fogColorB; + public static float shadowIntervalSize = 2.0F; + public static int terrainIconSize = 16; + public static int[] terrainTextureSize = new int[2]; + private static ICustomTexture noiseTexture; + private static boolean noiseTextureEnabled = false; + private static int noiseTextureResolution = 256; + static final int[] colorTextureImageUnit = new int[] {0, 1, 2, 3, 7, 8, 9, 10}; + private static final int bigBufferSize = (285 + 8 * ProgramCount) * 4; + private static final ByteBuffer bigBuffer = (ByteBuffer)BufferUtils.createByteBuffer(bigBufferSize).limit(0); + static final float[] faProjection = new float[16]; + static final float[] faProjectionInverse = new float[16]; + static final float[] faModelView = new float[16]; + static final float[] faModelViewInverse = new float[16]; + static final float[] faShadowProjection = new float[16]; + static final float[] faShadowProjectionInverse = new float[16]; + static final float[] faShadowModelView = new float[16]; + static final float[] faShadowModelViewInverse = new float[16]; + static final FloatBuffer projection = nextFloatBuffer(16); + static final FloatBuffer projectionInverse = nextFloatBuffer(16); + static final FloatBuffer modelView = nextFloatBuffer(16); + static final FloatBuffer modelViewInverse = nextFloatBuffer(16); + static final FloatBuffer shadowProjection = nextFloatBuffer(16); + static final FloatBuffer shadowProjectionInverse = nextFloatBuffer(16); + static final FloatBuffer shadowModelView = nextFloatBuffer(16); + static final FloatBuffer shadowModelViewInverse = nextFloatBuffer(16); + static final FloatBuffer previousProjection = nextFloatBuffer(16); + static final FloatBuffer previousModelView = nextFloatBuffer(16); + static final FloatBuffer tempMatrixDirectBuffer = nextFloatBuffer(16); + static final FloatBuffer tempDirectFloatBuffer = nextFloatBuffer(16); + static final IntBuffer dfbColorTextures = nextIntBuffer(16); + static final IntBuffer dfbDepthTextures = nextIntBuffer(3); + static final IntBuffer sfbColorTextures = nextIntBuffer(8); + static final IntBuffer sfbDepthTextures = nextIntBuffer(2); + static final IntBuffer dfbDrawBuffers = nextIntBuffer(8); + static final IntBuffer sfbDrawBuffers = nextIntBuffer(8); + static final IntBuffer drawBuffersNone = (IntBuffer)nextIntBuffer(8).limit(0); + static final IntBuffer drawBuffersColorAtt0 = (IntBuffer)nextIntBuffer(8).put(36064).position(0).limit(1); + static final FlipTextures dfbColorTexturesFlip = new FlipTextures(dfbColorTextures, 8); + static Map mapBlockToEntityData; + private static final String[] formatNames = new String[] {"R8", "RG8", "RGB8", "RGBA8", "R8_SNORM", "RG8_SNORM", "RGB8_SNORM", "RGBA8_SNORM", "R16", "RG16", "RGB16", "RGBA16", "R16_SNORM", "RG16_SNORM", "RGB16_SNORM", "RGBA16_SNORM", "R16F", "RG16F", "RGB16F", "RGBA16F", "R32F", "RG32F", "RGB32F", "RGBA32F", "R32I", "RG32I", "RGB32I", "RGBA32I", "R32UI", "RG32UI", "RGB32UI", "RGBA32UI", "R3_G3_B2", "RGB5_A1", "RGB10_A2", "R11F_G11F_B10F", "RGB9_E5"}; + private static final int[] formatIds = new int[] {33321, 33323, 32849, 32856, 36756, 36757, 36758, 36759, 33322, 33324, 32852, 32859, 36760, 36761, 36762, 36763, 33325, 33327, 34843, 34842, 33326, 33328, 34837, 34836, 33333, 33339, 36227, 36226, 33334, 33340, 36209, 36208, 10768, 32855, 32857, 35898, 35901}; + private static final Pattern patternLoadEntityDataMap = Pattern.compile("\\s*([\\w:]+)\\s*=\\s*([-]?\\d+)\\s*"); + public static int[] entityData = new int[32]; + public static int entityDataIndex = 0; + + private static ByteBuffer nextByteBuffer(int size) + { + ByteBuffer bytebuffer = bigBuffer; + int i = bytebuffer.limit(); + bytebuffer.position(i).limit(i + size); + return bytebuffer.slice(); + } + + public static IntBuffer nextIntBuffer(int size) + { + ByteBuffer bytebuffer = bigBuffer; + int i = bytebuffer.limit(); + bytebuffer.position(i).limit(i + size * 4); + return bytebuffer.asIntBuffer(); + } + + private static FloatBuffer nextFloatBuffer(int size) + { + ByteBuffer bytebuffer = bigBuffer; + int i = bytebuffer.limit(); + bytebuffer.position(i).limit(i + size * 4); + return bytebuffer.asFloatBuffer(); + } + + private static IntBuffer[] nextIntBufferArray(int count, int size) + { + IntBuffer[] aintbuffer = new IntBuffer[count]; + + for (int i = 0; i < count; ++i) + { + aintbuffer[i] = nextIntBuffer(size); + } + + return aintbuffer; + } + + public static void loadConfig() + { + SMCLog.info("Load shaders configuration."); + + try + { + if (!shaderPacksDir.exists()) + { + shaderPacksDir.mkdir(); + } + } + catch (Exception var8) + { + SMCLog.severe("Failed to open the shaderpacks directory: " + shaderPacksDir); + } + + shadersConfig = new PropertiesOrdered(); + shadersConfig.setProperty(EnumShaderOption.SHADER_PACK.getPropertyKey(), ""); + + if (configFile.exists()) + { + try + { + FileReader filereader = new FileReader(configFile); + shadersConfig.load((Reader)filereader); + filereader.close(); + } + catch (Exception var7) + { + ; + } + } + + if (!configFile.exists()) + { + try + { + storeConfig(); + } + catch (Exception var6) + { + ; + } + } + + EnumShaderOption[] aenumshaderoption = EnumShaderOption.values(); + + for (int i = 0; i < aenumshaderoption.length; ++i) + { + EnumShaderOption enumshaderoption = aenumshaderoption[i]; + String s = enumshaderoption.getPropertyKey(); + String s1 = enumshaderoption.getValueDefault(); + String s2 = shadersConfig.getProperty(s, s1); + setEnumShaderOption(enumshaderoption, s2); + } + + loadShaderPack(); + } + + private static void setEnumShaderOption(EnumShaderOption eso, String str) + { + if (str == null) + { + str = eso.getValueDefault(); + } + + switch (eso) + { + case ANTIALIASING: + configAntialiasingLevel = Config.parseInt(str, 0); + break; + + case NORMAL_MAP: + configNormalMap = Config.parseBoolean(str, true); + break; + + case SPECULAR_MAP: + configSpecularMap = Config.parseBoolean(str, true); + break; + + case RENDER_RES_MUL: + configRenderResMul = Config.parseFloat(str, 1.0F); + break; + + case SHADOW_RES_MUL: + configShadowResMul = Config.parseFloat(str, 1.0F); + break; + + case HAND_DEPTH_MUL: + configHandDepthMul = Config.parseFloat(str, 0.125F); + break; + + case CLOUD_SHADOW: + configCloudShadow = Config.parseBoolean(str, true); + break; + + case OLD_HAND_LIGHT: + configOldHandLight.setPropertyValue(str); + break; + + case OLD_LIGHTING: + configOldLighting.setPropertyValue(str); + break; + + case SHADER_PACK: + currentShaderName = str; + break; + + case TWEAK_BLOCK_DAMAGE: + configTweakBlockDamage = Config.parseBoolean(str, true); + break; + + case SHADOW_CLIP_FRUSTRUM: + configShadowClipFrustrum = Config.parseBoolean(str, true); + break; + + case TEX_MIN_FIL_B: + configTexMinFilB = Config.parseInt(str, 0); + break; + + case TEX_MIN_FIL_N: + configTexMinFilN = Config.parseInt(str, 0); + break; + + case TEX_MIN_FIL_S: + configTexMinFilS = Config.parseInt(str, 0); + break; + + case TEX_MAG_FIL_B: + configTexMagFilB = Config.parseInt(str, 0); + break; + + case TEX_MAG_FIL_N: + configTexMagFilB = Config.parseInt(str, 0); + break; + + case TEX_MAG_FIL_S: + configTexMagFilB = Config.parseInt(str, 0); + break; + + default: + throw new IllegalArgumentException("Unknown option: " + eso); + } + } + + public static void storeConfig() + { + SMCLog.info("Save shaders configuration."); + + if (shadersConfig == null) + { + shadersConfig = new PropertiesOrdered(); + } + + EnumShaderOption[] aenumshaderoption = EnumShaderOption.values(); + + for (int i = 0; i < aenumshaderoption.length; ++i) + { + EnumShaderOption enumshaderoption = aenumshaderoption[i]; + String s = enumshaderoption.getPropertyKey(); + String s1 = getEnumShaderOption(enumshaderoption); + shadersConfig.setProperty(s, s1); + } + + try + { + FileWriter filewriter = new FileWriter(configFile); + shadersConfig.store((Writer)filewriter, (String)null); + filewriter.close(); + } + catch (Exception exception) + { + SMCLog.severe("Error saving configuration: " + exception.getClass().getName() + ": " + exception.getMessage()); + } + } + + public static String getEnumShaderOption(EnumShaderOption eso) + { + switch (eso) + { + case ANTIALIASING: + return Integer.toString(configAntialiasingLevel); + + case NORMAL_MAP: + return Boolean.toString(configNormalMap); + + case SPECULAR_MAP: + return Boolean.toString(configSpecularMap); + + case RENDER_RES_MUL: + return Float.toString(configRenderResMul); + + case SHADOW_RES_MUL: + return Float.toString(configShadowResMul); + + case HAND_DEPTH_MUL: + return Float.toString(configHandDepthMul); + + case CLOUD_SHADOW: + return Boolean.toString(configCloudShadow); + + case OLD_HAND_LIGHT: + return configOldHandLight.getPropertyValue(); + + case OLD_LIGHTING: + return configOldLighting.getPropertyValue(); + + case SHADER_PACK: + return currentShaderName; + + case TWEAK_BLOCK_DAMAGE: + return Boolean.toString(configTweakBlockDamage); + + case SHADOW_CLIP_FRUSTRUM: + return Boolean.toString(configShadowClipFrustrum); + + case TEX_MIN_FIL_B: + return Integer.toString(configTexMinFilB); + + case TEX_MIN_FIL_N: + return Integer.toString(configTexMinFilN); + + case TEX_MIN_FIL_S: + return Integer.toString(configTexMinFilS); + + case TEX_MAG_FIL_B: + return Integer.toString(configTexMagFilB); + + case TEX_MAG_FIL_N: + return Integer.toString(configTexMagFilB); + + case TEX_MAG_FIL_S: + return Integer.toString(configTexMagFilB); + + default: + throw new IllegalArgumentException("Unknown option: " + eso); + } + } + + public static void setShaderPack(String par1name) + { + currentShaderName = par1name; + shadersConfig.setProperty(EnumShaderOption.SHADER_PACK.getPropertyKey(), par1name); + loadShaderPack(); + } + + public static void loadShaderPack() + { + boolean flag = shaderPackLoaded; + boolean flag1 = isOldLighting(); + + if (mc.renderGlobal != null) + { + mc.renderGlobal.pauseChunkUpdates(); + } + + shaderPackLoaded = false; + + if (shaderPack != null) + { + shaderPack.close(); + shaderPack = null; + shaderPackResources.clear(); + shaderPackDimensions.clear(); + shaderPackOptions = null; + shaderPackOptionSliders = null; + shaderPackProfiles = null; + shaderPackGuiScreens = null; + shaderPackProgramConditions.clear(); + shaderPackClouds.resetValue(); + shaderPackOldHandLight.resetValue(); + shaderPackDynamicHandLight.resetValue(); + shaderPackOldLighting.resetValue(); + resetCustomTextures(); + noiseTexturePath = null; + } + + boolean flag2 = false; + + if (Config.isAntialiasing()) + { + SMCLog.info("Shaders can not be loaded, Antialiasing is enabled: " + Config.getAntialiasingLevel() + "x"); + flag2 = true; + } + + if (Config.isAnisotropicFiltering()) + { + SMCLog.info("Shaders can not be loaded, Anisotropic Filtering is enabled: " + Config.getAnisotropicFilterLevel() + "x"); + flag2 = true; + } + + if (Config.isFastRender()) + { + SMCLog.info("Shaders can not be loaded, Fast Render is enabled."); + flag2 = true; + } + + String s = shadersConfig.getProperty(EnumShaderOption.SHADER_PACK.getPropertyKey(), "(internal)"); + + if (!flag2) + { + shaderPack = getShaderPack(s); + shaderPackLoaded = shaderPack != null; + } + + if (shaderPackLoaded) + { + SMCLog.info("Loaded shaderpack: " + getShaderPackName()); + } + else + { + SMCLog.info("No shaderpack loaded."); + shaderPack = new ShaderPackNone(); + } + + if (saveFinalShaders) + { + clearDirectory(new File(shaderPacksDir, "debug")); + } + + loadShaderPackResources(); + loadShaderPackDimensions(); + shaderPackOptions = loadShaderPackOptions(); + loadShaderPackProperties(); + boolean flag3 = shaderPackLoaded != flag; + boolean flag4 = isOldLighting() != flag1; + + if (flag3 || flag4) + { + DefaultVertexFormats.updateVertexFormats(); + + if (Reflector.LightUtil.exists()) + { + Reflector.LightUtil_itemConsumer.setValue((Object)null); + Reflector.LightUtil_tessellator.setValue((Object)null); + } + + updateBlockLightLevel(); + } + + if (mc.getResourcePackRepository() != null) + { + CustomBlockLayers.update(); + } + + if (mc.renderGlobal != null) + { + mc.renderGlobal.resumeChunkUpdates(); + } + + if ((flag3 || flag4) && mc.getResourceManager() != null) + { + mc.scheduleResourcesRefresh(); + } + } + + public static IShaderPack getShaderPack(String name) + { + if (name == null) + { + return null; + } + else + { + name = name.trim(); + + if (!name.isEmpty() && !name.equals("OFF")) + { + if (name.equals("(internal)")) + { + return new ShaderPackDefault(); + } + else + { + try + { + File file1 = new File(shaderPacksDir, name); + return (IShaderPack)(file1.isDirectory() ? new ShaderPackFolder(name, file1) : (file1.isFile() && name.toLowerCase().endsWith(".zip") ? new ShaderPackZip(name, file1) : null)); + } + catch (Exception exception) + { + exception.printStackTrace(); + return null; + } + } + } + else + { + return null; + } + } + } + + public static IShaderPack getShaderPack() + { + return shaderPack; + } + + private static void loadShaderPackDimensions() + { + shaderPackDimensions.clear(); + + for (int i = -128; i <= 128; ++i) + { + String s = "/shaders/world" + i; + + if (shaderPack.hasDirectory(s)) + { + shaderPackDimensions.add(Integer.valueOf(i)); + } + } + + if (shaderPackDimensions.size() > 0) + { + Integer[] ainteger = (Integer[])((Integer[])shaderPackDimensions.toArray(new Integer[shaderPackDimensions.size()])); + Config.dbg("[Shaders] Worlds: " + Config.arrayToString((Object[])ainteger)); + } + } + + private static void loadShaderPackProperties() + { + shaderPackClouds.resetValue(); + shaderPackOldHandLight.resetValue(); + shaderPackDynamicHandLight.resetValue(); + shaderPackOldLighting.resetValue(); + shaderPackShadowTranslucent.resetValue(); + shaderPackUnderwaterOverlay.resetValue(); + shaderPackSun.resetValue(); + shaderPackMoon.resetValue(); + shaderPackVignette.resetValue(); + shaderPackBackFaceSolid.resetValue(); + shaderPackBackFaceCutout.resetValue(); + shaderPackBackFaceCutoutMipped.resetValue(); + shaderPackBackFaceTranslucent.resetValue(); + shaderPackRainDepth.resetValue(); + shaderPackBeaconBeamDepth.resetValue(); + shaderPackSeparateAo.resetValue(); + shaderPackFrustumCulling.resetValue(); + BlockAliases.reset(); + ItemAliases.reset(); + EntityAliases.reset(); + customUniforms = null; + + for (int i = 0; i < ProgramsAll.length; ++i) + { + Program program = ProgramsAll[i]; + program.resetProperties(); + } + + if (shaderPack != null) + { + BlockAliases.update(shaderPack); + ItemAliases.update(shaderPack); + EntityAliases.update(shaderPack); + String s = "/shaders/shaders.properties"; + + try + { + InputStream inputstream = shaderPack.getResourceAsStream(s); + + if (inputstream == null) + { + return; + } + + inputstream = MacroProcessor.process(inputstream, s); + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + shaderPackClouds.loadFrom(properties); + shaderPackOldHandLight.loadFrom(properties); + shaderPackDynamicHandLight.loadFrom(properties); + shaderPackOldLighting.loadFrom(properties); + shaderPackShadowTranslucent.loadFrom(properties); + shaderPackUnderwaterOverlay.loadFrom(properties); + shaderPackSun.loadFrom(properties); + shaderPackVignette.loadFrom(properties); + shaderPackMoon.loadFrom(properties); + shaderPackBackFaceSolid.loadFrom(properties); + shaderPackBackFaceCutout.loadFrom(properties); + shaderPackBackFaceCutoutMipped.loadFrom(properties); + shaderPackBackFaceTranslucent.loadFrom(properties); + shaderPackRainDepth.loadFrom(properties); + shaderPackBeaconBeamDepth.loadFrom(properties); + shaderPackSeparateAo.loadFrom(properties); + shaderPackFrustumCulling.loadFrom(properties); + shaderPackOptionSliders = ShaderPackParser.parseOptionSliders(properties, shaderPackOptions); + shaderPackProfiles = ShaderPackParser.parseProfiles(properties, shaderPackOptions); + shaderPackGuiScreens = ShaderPackParser.parseGuiScreens(properties, shaderPackProfiles, shaderPackOptions); + shaderPackProgramConditions = ShaderPackParser.parseProgramConditions(properties, shaderPackOptions); + customTexturesGbuffers = loadCustomTextures(properties, 0); + customTexturesComposite = loadCustomTextures(properties, 1); + customTexturesDeferred = loadCustomTextures(properties, 2); + noiseTexturePath = properties.getProperty("texture.noise"); + + if (noiseTexturePath != null) + { + noiseTextureEnabled = true; + } + + customUniforms = ShaderPackParser.parseCustomUniforms(properties); + ShaderPackParser.parseAlphaStates(properties); + ShaderPackParser.parseBlendStates(properties); + ShaderPackParser.parseRenderScales(properties); + ShaderPackParser.parseBuffersFlip(properties); + } + catch (IOException var3) + { + Config.warn("[Shaders] Error reading: " + s); + } + } + } + + private static ICustomTexture[] loadCustomTextures(Properties props, int stage) + { + String s = "texture." + STAGE_NAMES[stage] + "."; + Set set = props.keySet(); + List list = new ArrayList(); + + for (Object e: set) + { + String s1 = (String) e; + if (s1.startsWith(s)) + { + String s2 = StrUtils.removePrefix(s1, s); + s2 = StrUtils.removeSuffix(s2, new String[] {".0", ".1", ".2", ".3", ".4", ".5", ".6", ".7", ".8", ".9"}); + String s3 = props.getProperty(s1).trim(); + int i = getTextureIndex(stage, s2); + + if (i < 0) + { + SMCLog.warning("Invalid texture name: " + s1); + } + else + { + ICustomTexture icustomtexture = loadCustomTexture(i, s3); + + if (icustomtexture != null) + { + SMCLog.info("Custom texture: " + s1 + " = " + s3); + list.add(icustomtexture); + } + } + } + } + + if (list.size() <= 0) + { + return null; + } + else + { + ICustomTexture[] aicustomtexture = (ICustomTexture[])((ICustomTexture[])list.toArray(new ICustomTexture[list.size()])); + return aicustomtexture; + } + } + + private static ICustomTexture loadCustomTexture(int textureUnit, String path) + { + if (path == null) + { + return null; + } + else + { + path = path.trim(); + return path.indexOf(58) >= 0 ? loadCustomTextureLocation(textureUnit, path) : (path.indexOf(32) >= 0 ? loadCustomTextureRaw(textureUnit, path) : loadCustomTextureShaders(textureUnit, path)); + } + } + + private static ICustomTexture loadCustomTextureLocation(int textureUnit, String path) + { + String s = path.trim(); + int i = 0; + + if (s.startsWith("minecraft:textures/")) + { + s = StrUtils.addSuffixCheck(s, ".png"); + + if (s.endsWith("_n.png")) + { + s = StrUtils.replaceSuffix(s, "_n.png", ".png"); + i = 1; + } + else if (s.endsWith("_s.png")) + { + s = StrUtils.replaceSuffix(s, "_s.png", ".png"); + i = 2; + } + } + + ResourceLocation resourcelocation = new ResourceLocation(s); + CustomTextureLocation customtexturelocation = new CustomTextureLocation(textureUnit, resourcelocation, i); + return customtexturelocation; + } + + private static ICustomTexture loadCustomTextureRaw(int textureUnit, String line) + { + ConnectedParser connectedparser = new ConnectedParser("Shaders"); + String[] astring = Config.tokenize(line, " "); + Deque deque = new ArrayDeque(Arrays.asList(astring)); + String s = (String)deque.poll(); + TextureType texturetype = (TextureType)connectedparser.parseEnum((String)deque.poll(), TextureType.values(), "texture type"); + + if (texturetype == null) + { + SMCLog.warning("Invalid raw texture type: " + line); + return null; + } + else + { + InternalFormat internalformat = (InternalFormat)connectedparser.parseEnum((String)deque.poll(), InternalFormat.values(), "internal format"); + + if (internalformat == null) + { + SMCLog.warning("Invalid raw texture internal format: " + line); + return null; + } + else + { + int i = 0; + int j = 0; + int k = 0; + + switch (texturetype) + { + case TEXTURE_1D: + i = connectedparser.parseInt((String)deque.poll(), -1); + break; + + case TEXTURE_2D: + i = connectedparser.parseInt((String)deque.poll(), -1); + j = connectedparser.parseInt((String)deque.poll(), -1); + break; + + case TEXTURE_3D: + i = connectedparser.parseInt((String)deque.poll(), -1); + j = connectedparser.parseInt((String)deque.poll(), -1); + k = connectedparser.parseInt((String)deque.poll(), -1); + break; + + case TEXTURE_RECTANGLE: + i = connectedparser.parseInt((String)deque.poll(), -1); + j = connectedparser.parseInt((String)deque.poll(), -1); + break; + + default: + SMCLog.warning("Invalid raw texture type: " + texturetype); + return null; + } + + if (i >= 0 && j >= 0 && k >= 0) + { + PixelFormat pixelformat = (PixelFormat)connectedparser.parseEnum((String)deque.poll(), PixelFormat.values(), "pixel format"); + + if (pixelformat == null) + { + SMCLog.warning("Invalid raw texture pixel format: " + line); + return null; + } + else + { + PixelType pixeltype = (PixelType)connectedparser.parseEnum((String)deque.poll(), PixelType.values(), "pixel type"); + + if (pixeltype == null) + { + SMCLog.warning("Invalid raw texture pixel type: " + line); + return null; + } + else if (!deque.isEmpty()) + { + SMCLog.warning("Invalid raw texture, too many parameters: " + line); + return null; + } + else + { + return loadCustomTextureRaw(textureUnit, line, s, texturetype, internalformat, i, j, k, pixelformat, pixeltype); + } + } + } + else + { + SMCLog.warning("Invalid raw texture size: " + line); + return null; + } + } + } + } + + private static ICustomTexture loadCustomTextureRaw(int textureUnit, String line, String path, TextureType type, InternalFormat internalFormat, int width, int height, int depth, PixelFormat pixelFormat, PixelType pixelType) + { + try + { + String s = "shaders/" + StrUtils.removePrefix(path, "/"); + InputStream inputstream = shaderPack.getResourceAsStream(s); + + if (inputstream == null) + { + SMCLog.warning("Raw texture not found: " + path); + return null; + } + else + { + byte[] abyte = Config.readAll(inputstream); + IOUtils.closeQuietly(inputstream); + ByteBuffer bytebuffer = GLAllocation.createDirectByteBuffer(abyte.length); + bytebuffer.put(abyte); + bytebuffer.flip(); + TextureMetadataSection texturemetadatasection = SimpleShaderTexture.loadTextureMetadataSection(s, new TextureMetadataSection(true, true, new ArrayList())); + CustomTextureRaw customtextureraw = new CustomTextureRaw(type, internalFormat, width, height, depth, pixelFormat, pixelType, bytebuffer, textureUnit, texturemetadatasection.getTextureBlur(), texturemetadatasection.getTextureClamp()); + return customtextureraw; + } + } + catch (IOException ioexception) + { + SMCLog.warning("Error loading raw texture: " + path); + SMCLog.warning("" + ioexception.getClass().getName() + ": " + ioexception.getMessage()); + return null; + } + } + + private static ICustomTexture loadCustomTextureShaders(int textureUnit, String path) + { + path = path.trim(); + + if (path.indexOf(46) < 0) + { + path = path + ".png"; + } + + try + { + String s = "shaders/" + StrUtils.removePrefix(path, "/"); + InputStream inputstream = shaderPack.getResourceAsStream(s); + + if (inputstream == null) + { + SMCLog.warning("Texture not found: " + path); + return null; + } + else + { + IOUtils.closeQuietly(inputstream); + SimpleShaderTexture simpleshadertexture = new SimpleShaderTexture(s); + simpleshadertexture.loadTexture(mc.getResourceManager()); + CustomTexture customtexture = new CustomTexture(textureUnit, s, simpleshadertexture); + return customtexture; + } + } + catch (IOException ioexception) + { + SMCLog.warning("Error loading texture: " + path); + SMCLog.warning("" + ioexception.getClass().getName() + ": " + ioexception.getMessage()); + return null; + } + } + + private static int getTextureIndex(int stage, String name) + { + if (stage == 0) + { + if (name.equals("texture")) + { + return 0; + } + + if (name.equals("lightmap")) + { + return 1; + } + + if (name.equals("normals")) + { + return 2; + } + + if (name.equals("specular")) + { + return 3; + } + + if (name.equals("shadowtex0") || name.equals("watershadow")) + { + return 4; + } + + if (name.equals("shadow")) + { + return waterShadowEnabled ? 5 : 4; + } + + if (name.equals("shadowtex1")) + { + return 5; + } + + if (name.equals("depthtex0")) + { + return 6; + } + + if (name.equals("gaux1")) + { + return 7; + } + + if (name.equals("gaux2")) + { + return 8; + } + + if (name.equals("gaux3")) + { + return 9; + } + + if (name.equals("gaux4")) + { + return 10; + } + + if (name.equals("depthtex1")) + { + return 12; + } + + if (name.equals("shadowcolor0") || name.equals("shadowcolor")) + { + return 13; + } + + if (name.equals("shadowcolor1")) + { + return 14; + } + + if (name.equals("noisetex")) + { + return 15; + } + } + + if (stage == 1 || stage == 2) + { + if (name.equals("colortex0") || name.equals("colortex0")) + { + return 0; + } + + if (name.equals("colortex1") || name.equals("gdepth")) + { + return 1; + } + + if (name.equals("colortex2") || name.equals("gnormal")) + { + return 2; + } + + if (name.equals("colortex3") || name.equals("composite")) + { + return 3; + } + + if (name.equals("shadowtex0") || name.equals("watershadow")) + { + return 4; + } + + if (name.equals("shadow")) + { + return waterShadowEnabled ? 5 : 4; + } + + if (name.equals("shadowtex1")) + { + return 5; + } + + if (name.equals("depthtex0") || name.equals("gdepthtex")) + { + return 6; + } + + if (name.equals("colortex4") || name.equals("gaux1")) + { + return 7; + } + + if (name.equals("colortex5") || name.equals("gaux2")) + { + return 8; + } + + if (name.equals("colortex6") || name.equals("gaux3")) + { + return 9; + } + + if (name.equals("colortex7") || name.equals("gaux4")) + { + return 10; + } + + if (name.equals("depthtex1")) + { + return 11; + } + + if (name.equals("depthtex2")) + { + return 12; + } + + if (name.equals("shadowcolor0") || name.equals("shadowcolor")) + { + return 13; + } + + if (name.equals("shadowcolor1")) + { + return 14; + } + + if (name.equals("noisetex")) + { + return 15; + } + } + + return -1; + } + + private static void bindCustomTextures(ICustomTexture[] cts) + { + if (cts != null) + { + for (int i = 0; i < cts.length; ++i) + { + ICustomTexture icustomtexture = cts[i]; + GlStateManager.setActiveTexture(33984 + icustomtexture.getTextureUnit()); + int j = icustomtexture.getTextureId(); + int k = icustomtexture.getTarget(); + + if (k == 3553) + { + GlStateManager.bindTexture(j); + } + else + { + GL11.glBindTexture(k, j); + } + } + } + } + + private static void resetCustomTextures() + { + deleteCustomTextures(customTexturesGbuffers); + deleteCustomTextures(customTexturesComposite); + deleteCustomTextures(customTexturesDeferred); + customTexturesGbuffers = null; + customTexturesComposite = null; + customTexturesDeferred = null; + } + + private static void deleteCustomTextures(ICustomTexture[] cts) + { + if (cts != null) + { + for (int i = 0; i < cts.length; ++i) + { + ICustomTexture icustomtexture = cts[i]; + icustomtexture.deleteTexture(); + } + } + } + + public static ShaderOption[] getShaderPackOptions(String screenName) + { + ShaderOption[] ashaderoption = (ShaderOption[])shaderPackOptions.clone(); + + if (shaderPackGuiScreens == null) + { + if (shaderPackProfiles != null) + { + ShaderOptionProfile shaderoptionprofile = new ShaderOptionProfile(shaderPackProfiles, ashaderoption); + ashaderoption = (ShaderOption[])((ShaderOption[])Config.addObjectToArray(ashaderoption, shaderoptionprofile, 0)); + } + + ashaderoption = getVisibleOptions(ashaderoption); + return ashaderoption; + } + else + { + String s = screenName != null ? "screen." + screenName : "screen"; + ScreenShaderOptions screenshaderoptions = (ScreenShaderOptions)shaderPackGuiScreens.get(s); + + if (screenshaderoptions == null) + { + return new ShaderOption[0]; + } + else + { + ShaderOption[] ashaderoption1 = screenshaderoptions.getShaderOptions(); + List list = new ArrayList(); + + for (int i = 0; i < ashaderoption1.length; ++i) + { + ShaderOption shaderoption = ashaderoption1[i]; + + if (shaderoption == null) + { + list.add((ShaderOption)null); + } + else if (shaderoption instanceof ShaderOptionRest) + { + ShaderOption[] ashaderoption2 = getShaderOptionsRest(shaderPackGuiScreens, ashaderoption); + list.addAll(Arrays.asList(ashaderoption2)); + } + else + { + list.add(shaderoption); + } + } + + ShaderOption[] ashaderoption3 = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + return ashaderoption3; + } + } + } + + public static int getShaderPackColumns(String screenName, int def) + { + String s = screenName != null ? "screen." + screenName : "screen"; + + if (shaderPackGuiScreens == null) + { + return def; + } + else + { + ScreenShaderOptions screenshaderoptions = (ScreenShaderOptions)shaderPackGuiScreens.get(s); + return screenshaderoptions == null ? def : screenshaderoptions.getColumns(); + } + } + + private static ShaderOption[] getShaderOptionsRest(Map mapScreens, ShaderOption[] ops) + { + Set set = new HashSet(); + + for (String s : mapScreens.keySet()) + { + ScreenShaderOptions screenshaderoptions = (ScreenShaderOptions)mapScreens.get(s); + ShaderOption[] ashaderoption = screenshaderoptions.getShaderOptions(); + + for (int i = 0; i < ashaderoption.length; ++i) + { + ShaderOption shaderoption = ashaderoption[i]; + + if (shaderoption != null) + { + set.add(shaderoption.getName()); + } + } + } + + List list = new ArrayList(); + + for (int j = 0; j < ops.length; ++j) + { + ShaderOption shaderoption1 = ops[j]; + + if (shaderoption1.isVisible()) + { + String s1 = shaderoption1.getName(); + + if (!set.contains(s1)) + { + list.add(shaderoption1); + } + } + } + + ShaderOption[] ashaderoption1 = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + return ashaderoption1; + } + + public static ShaderOption getShaderOption(String name) + { + return ShaderUtils.getShaderOption(name, shaderPackOptions); + } + + public static ShaderOption[] getShaderPackOptions() + { + return shaderPackOptions; + } + + public static boolean isShaderPackOptionSlider(String name) + { + return shaderPackOptionSliders == null ? false : shaderPackOptionSliders.contains(name); + } + + private static ShaderOption[] getVisibleOptions(ShaderOption[] ops) + { + List list = new ArrayList(); + + for (int i = 0; i < ops.length; ++i) + { + ShaderOption shaderoption = ops[i]; + + if (shaderoption.isVisible()) + { + list.add(shaderoption); + } + } + + ShaderOption[] ashaderoption = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + return ashaderoption; + } + + public static void saveShaderPackOptions() + { + saveShaderPackOptions(shaderPackOptions, shaderPack); + } + + private static void saveShaderPackOptions(ShaderOption[] sos, IShaderPack sp) + { + Properties properties = new PropertiesOrdered(); + + if (shaderPackOptions != null) + { + for (int i = 0; i < sos.length; ++i) + { + ShaderOption shaderoption = sos[i]; + + if (shaderoption.isChanged() && shaderoption.isEnabled()) + { + properties.setProperty(shaderoption.getName(), shaderoption.getValue()); + } + } + } + + try + { + saveOptionProperties(sp, properties); + } + catch (IOException ioexception) + { + Config.warn("[Shaders] Error saving configuration for " + shaderPack.getName()); + ioexception.printStackTrace(); + } + } + + private static void saveOptionProperties(IShaderPack sp, Properties props) throws IOException + { + String s = "shaderpacks/" + sp.getName() + ".txt"; + File file1 = new File(Minecraft.getMinecraft().mcDataDir, s); + + if (props.isEmpty()) + { + file1.delete(); + } + else + { + FileOutputStream fileoutputstream = new FileOutputStream(file1); + props.store((OutputStream)fileoutputstream, (String)null); + fileoutputstream.flush(); + fileoutputstream.close(); + } + } + + private static ShaderOption[] loadShaderPackOptions() + { + try + { + String[] astring = programs.getProgramNames(); + ShaderOption[] ashaderoption = ShaderPackParser.parseShaderPackOptions(shaderPack, astring, shaderPackDimensions); + Properties properties = loadOptionProperties(shaderPack); + + for (int i = 0; i < ashaderoption.length; ++i) + { + ShaderOption shaderoption = ashaderoption[i]; + String s = properties.getProperty(shaderoption.getName()); + + if (s != null) + { + shaderoption.resetValue(); + + if (!shaderoption.setValue(s)) + { + Config.warn("[Shaders] Invalid value, option: " + shaderoption.getName() + ", value: " + s); + } + } + } + + return ashaderoption; + } + catch (IOException ioexception) + { + Config.warn("[Shaders] Error reading configuration for " + shaderPack.getName()); + ioexception.printStackTrace(); + return null; + } + } + + private static Properties loadOptionProperties(IShaderPack sp) throws IOException + { + Properties properties = new PropertiesOrdered(); + String s = "shaderpacks/" + sp.getName() + ".txt"; + File file1 = new File(Minecraft.getMinecraft().mcDataDir, s); + + if (file1.exists() && file1.isFile() && file1.canRead()) + { + FileInputStream fileinputstream = new FileInputStream(file1); + properties.load((InputStream)fileinputstream); + fileinputstream.close(); + return properties; + } + else + { + return properties; + } + } + + public static ShaderOption[] getChangedOptions(ShaderOption[] ops) + { + List list = new ArrayList(); + + for (int i = 0; i < ops.length; ++i) + { + ShaderOption shaderoption = ops[i]; + + if (shaderoption.isEnabled() && shaderoption.isChanged()) + { + list.add(shaderoption); + } + } + + ShaderOption[] ashaderoption = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + return ashaderoption; + } + + private static String applyOptions(String line, ShaderOption[] ops) + { + if (ops != null && ops.length > 0) + { + for (int i = 0; i < ops.length; ++i) + { + ShaderOption shaderoption = ops[i]; + + if (shaderoption.matchesLine(line)) + { + line = shaderoption.getSourceLine(); + break; + } + } + + return line; + } + else + { + return line; + } + } + + public static ArrayList listOfShaders() + { + ArrayList arraylist = new ArrayList(); + arraylist.add("OFF"); + arraylist.add("(internal)"); + int i = arraylist.size(); + + try + { + if (!shaderPacksDir.exists()) + { + shaderPacksDir.mkdir(); + } + + File[] afile = shaderPacksDir.listFiles(); + + for (int j = 0; j < afile.length; ++j) + { + File file1 = afile[j]; + String s = file1.getName(); + + if (file1.isDirectory()) + { + if (!s.equals("debug")) + { + File file2 = new File(file1, "shaders"); + + if (file2.exists() && file2.isDirectory()) + { + arraylist.add(s); + } + } + } + else if (file1.isFile() && s.toLowerCase().endsWith(".zip")) + { + arraylist.add(s); + } + } + } + catch (Exception var7) + { + ; + } + + List list = arraylist.subList(i, arraylist.size()); + Collections.sort(list, String.CASE_INSENSITIVE_ORDER); + return arraylist; + } + + public static int checkFramebufferStatus(String location) + { + int i = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (i != 36053) + { + System.err.format("FramebufferStatus 0x%04X at %s\n", new Object[] {Integer.valueOf(i), location}); + } + + return i; + } + + public static int checkGLError(String location) + { + int i = GlStateManager.glGetError(); + + if (i != 0 && GlErrors.isEnabled(i)) + { + String s = Config.getGlErrorString(i); + String s1 = getErrorInfo(i, location); + String s2 = String.format("OpenGL error: %s (%s)%s, at: %s", new Object[] {Integer.valueOf(i), s, s1, location}); + SMCLog.severe(s2); + + if (Config.isShowGlErrors() && TimedEvent.isActive("ShowGlErrorShaders", 10000L)) + { + String s3 = I18n.format("of.message.openglError", new Object[] {Integer.valueOf(i), s}); + printChat(s3); + } + } + + return i; + } + + private static String getErrorInfo(int errorCode, String location) + { + StringBuilder stringbuilder = new StringBuilder(); + + if (errorCode == 1286) + { + int i = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + String s = getFramebufferStatusText(i); + String s1 = ", fbStatus: " + i + " (" + s + ")"; + stringbuilder.append(s1); + } + + String s2 = activeProgram.getName(); + + if (s2.isEmpty()) + { + s2 = "none"; + } + + stringbuilder.append(", program: " + s2); + Program program = getProgramById(activeProgramID); + + if (program != activeProgram) + { + String s3 = program.getName(); + + if (s3.isEmpty()) + { + s3 = "none"; + } + + stringbuilder.append(" (" + s3 + ")"); + } + + if (location.equals("setDrawBuffers")) + { + stringbuilder.append(", drawBuffers: " + activeProgram.getDrawBufSettings()); + } + + return stringbuilder.toString(); + } + + private static Program getProgramById(int programID) + { + for (int i = 0; i < ProgramsAll.length; ++i) + { + Program program = ProgramsAll[i]; + + if (program.getId() == programID) + { + return program; + } + } + + return ProgramNone; + } + + private static String getFramebufferStatusText(int fbStatusCode) + { + switch (fbStatusCode) + { + case 33305: + return "Undefined"; + + case 36053: + return "Complete"; + + case 36054: + return "Incomplete attachment"; + + case 36055: + return "Incomplete missing attachment"; + + case 36059: + return "Incomplete draw buffer"; + + case 36060: + return "Incomplete read buffer"; + + case 36061: + return "Unsupported"; + + case 36182: + return "Incomplete multisample"; + + case 36264: + return "Incomplete layer targets"; + + default: + return "Unknown"; + } + } + + private static void printChat(String str) + { + mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(str)); + } + + private static void printChatAndLogError(String str) + { + SMCLog.severe(str); + mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(str)); + } + + public static void printIntBuffer(String title, IntBuffer buf) + { + StringBuilder stringbuilder = new StringBuilder(128); + stringbuilder.append(title).append(" [pos ").append(buf.position()).append(" lim ").append(buf.limit()).append(" cap ").append(buf.capacity()).append(" :"); + int i = buf.limit(); + + for (int j = 0; j < i; ++j) + { + stringbuilder.append(" ").append(buf.get(j)); + } + + stringbuilder.append("]"); + SMCLog.info(stringbuilder.toString()); + } + + public static void startup(Minecraft mcIn) + { + checkShadersModInstalled(); + mc = mcIn; + mc = Minecraft.getMinecraft(); + capabilities = GLContext.getCapabilities(); + glVersionString = GL11.glGetString(GL11.GL_VERSION); + glVendorString = GL11.glGetString(GL11.GL_VENDOR); + glRendererString = GL11.glGetString(GL11.GL_RENDERER); + SMCLog.info("OpenGL Version: " + glVersionString); + SMCLog.info("Vendor: " + glVendorString); + SMCLog.info("Renderer: " + glRendererString); + SMCLog.info("Capabilities: " + (capabilities.OpenGL20 ? " 2.0 " : " - ") + (capabilities.OpenGL21 ? " 2.1 " : " - ") + (capabilities.OpenGL30 ? " 3.0 " : " - ") + (capabilities.OpenGL32 ? " 3.2 " : " - ") + (capabilities.OpenGL40 ? " 4.0 " : " - ")); + SMCLog.info("GL_MAX_DRAW_BUFFERS: " + GL11.glGetInteger(GL20.GL_MAX_DRAW_BUFFERS)); + SMCLog.info("GL_MAX_COLOR_ATTACHMENTS_EXT: " + GL11.glGetInteger(36063)); + SMCLog.info("GL_MAX_TEXTURE_IMAGE_UNITS: " + GL11.glGetInteger(GL20.GL_MAX_TEXTURE_IMAGE_UNITS)); + hasGlGenMipmap = capabilities.OpenGL30; + loadConfig(); + } + + public static void updateBlockLightLevel() + { + if (isOldLighting()) + { + blockLightLevel05 = 0.5F; + blockLightLevel06 = 0.6F; + blockLightLevel08 = 0.8F; + } + else + { + blockLightLevel05 = 1.0F; + blockLightLevel06 = 1.0F; + blockLightLevel08 = 1.0F; + } + } + + public static boolean isOldHandLight() + { + return !configOldHandLight.isDefault() ? configOldHandLight.isTrue() : (!shaderPackOldHandLight.isDefault() ? shaderPackOldHandLight.isTrue() : true); + } + + public static boolean isDynamicHandLight() + { + return !shaderPackDynamicHandLight.isDefault() ? shaderPackDynamicHandLight.isTrue() : true; + } + + public static boolean isOldLighting() + { + return !configOldLighting.isDefault() ? configOldLighting.isTrue() : (!shaderPackOldLighting.isDefault() ? shaderPackOldLighting.isTrue() : true); + } + + public static boolean isRenderShadowTranslucent() + { + return !shaderPackShadowTranslucent.isFalse(); + } + + public static boolean isUnderwaterOverlay() + { + return !shaderPackUnderwaterOverlay.isFalse(); + } + + public static boolean isSun() + { + return !shaderPackSun.isFalse(); + } + + public static boolean isMoon() + { + return !shaderPackMoon.isFalse(); + } + + public static boolean isVignette() + { + return !shaderPackVignette.isFalse(); + } + + public static boolean isRenderBackFace(EnumWorldBlockLayer blockLayerIn) + { + switch (blockLayerIn) + { + case SOLID: + return shaderPackBackFaceSolid.isTrue(); + + case CUTOUT: + return shaderPackBackFaceCutout.isTrue(); + + case CUTOUT_MIPPED: + return shaderPackBackFaceCutoutMipped.isTrue(); + + case TRANSLUCENT: + return shaderPackBackFaceTranslucent.isTrue(); + + default: + return false; + } + } + + public static boolean isRainDepth() + { + return shaderPackRainDepth.isTrue(); + } + + public static boolean isBeaconBeamDepth() + { + return shaderPackBeaconBeamDepth.isTrue(); + } + + public static boolean isSeparateAo() + { + return shaderPackSeparateAo.isTrue(); + } + + public static boolean isFrustumCulling() + { + return !shaderPackFrustumCulling.isFalse(); + } + + public static void init() + { + boolean flag; + + if (!isInitializedOnce) + { + isInitializedOnce = true; + flag = true; + } + else + { + flag = false; + } + + if (!isShaderPackInitialized) + { + checkGLError("Shaders.init pre"); + + if (getShaderPackName() != null) + { + ; + } + + if (!capabilities.OpenGL20) + { + printChatAndLogError("No OpenGL 2.0"); + } + + if (!capabilities.GL_EXT_framebuffer_object) + { + printChatAndLogError("No EXT_framebuffer_object"); + } + + dfbDrawBuffers.position(0).limit(8); + dfbColorTextures.position(0).limit(16); + dfbDepthTextures.position(0).limit(3); + sfbDrawBuffers.position(0).limit(8); + sfbDepthTextures.position(0).limit(2); + sfbColorTextures.position(0).limit(8); + usedColorBuffers = 4; + usedDepthBuffers = 1; + usedShadowColorBuffers = 0; + usedShadowDepthBuffers = 0; + usedColorAttachs = 1; + usedDrawBuffers = 1; + Arrays.fill((int[])gbuffersFormat, (int)6408); + Arrays.fill(gbuffersClear, true); + Arrays.fill(gbuffersClearColor, (Object)null); + Arrays.fill(shadowHardwareFilteringEnabled, false); + Arrays.fill(shadowMipmapEnabled, false); + Arrays.fill(shadowFilterNearest, false); + Arrays.fill(shadowColorMipmapEnabled, false); + Arrays.fill(shadowColorFilterNearest, false); + centerDepthSmoothEnabled = false; + noiseTextureEnabled = false; + sunPathRotation = 0.0F; + shadowIntervalSize = 2.0F; + shadowMapWidth = 1024; + shadowMapHeight = 1024; + spShadowMapWidth = 1024; + spShadowMapHeight = 1024; + shadowMapFOV = 90.0F; + shadowMapHalfPlane = 160.0F; + shadowMapIsOrtho = true; + shadowDistanceRenderMul = -1.0F; + aoLevel = -1.0F; + useEntityAttrib = false; + useMidTexCoordAttrib = false; + useTangentAttrib = false; + waterShadowEnabled = false; + hasGeometryShaders = false; + updateBlockLightLevel(); + Smoother.resetValues(); + shaderUniforms.reset(); + + if (customUniforms != null) + { + customUniforms.reset(); + } + + ShaderProfile shaderprofile = ShaderUtils.detectProfile(shaderPackProfiles, shaderPackOptions, false); + String s = ""; + + if (currentWorld != null) + { + int i = currentWorld.provider.getDimensionId(); + + if (shaderPackDimensions.contains(Integer.valueOf(i))) + { + s = "world" + i + "/"; + } + } + + for (int k = 0; k < ProgramsAll.length; ++k) + { + Program program = ProgramsAll[k]; + program.resetId(); + program.resetConfiguration(); + + if (program.getProgramStage() != ProgramStage.NONE) + { + String s1 = program.getName(); + String s2 = s + s1; + boolean flag1 = true; + + if (shaderPackProgramConditions.containsKey(s2)) + { + flag1 = flag1 && ((IExpressionBool)shaderPackProgramConditions.get(s2)).eval(); + } + + if (shaderprofile != null) + { + flag1 = flag1 && !shaderprofile.isProgramDisabled(s2); + } + + if (!flag1) + { + SMCLog.info("Program disabled: " + s2); + s1 = ""; + s2 = s + s1; + } + + String s3 = "/shaders/" + s2; + String s4 = s3 + ".vsh"; + String s5 = s3 + ".gsh"; + String s6 = s3 + ".fsh"; + setupProgram(program, s4, s5, s6); + int j = program.getId(); + + if (j > 0) + { + SMCLog.info("Program loaded: " + s2); + } + + initDrawBuffers(program); + updateToggleBuffers(program); + } + } + + hasDeferredPrograms = false; + + for (int l = 0; l < ProgramsDeferred.length; ++l) + { + if (ProgramsDeferred[l].getId() != 0) + { + hasDeferredPrograms = true; + break; + } + } + + usedColorAttachs = usedColorBuffers; + shadowPassInterval = usedShadowDepthBuffers > 0 ? 1 : 0; + shouldSkipDefaultShadow = usedShadowDepthBuffers > 0; + SMCLog.info("usedColorBuffers: " + usedColorBuffers); + SMCLog.info("usedDepthBuffers: " + usedDepthBuffers); + SMCLog.info("usedShadowColorBuffers: " + usedShadowColorBuffers); + SMCLog.info("usedShadowDepthBuffers: " + usedShadowDepthBuffers); + SMCLog.info("usedColorAttachs: " + usedColorAttachs); + SMCLog.info("usedDrawBuffers: " + usedDrawBuffers); + dfbDrawBuffers.position(0).limit(usedDrawBuffers); + dfbColorTextures.position(0).limit(usedColorBuffers * 2); + dfbColorTexturesFlip.reset(); + + for (int i1 = 0; i1 < usedDrawBuffers; ++i1) + { + dfbDrawBuffers.put(i1, 36064 + i1); + } + + int j1 = GL11.glGetInteger(GL20.GL_MAX_DRAW_BUFFERS); + + if (usedDrawBuffers > j1) + { + printChatAndLogError("[Shaders] Error: Not enough draw buffers, needed: " + usedDrawBuffers + ", available: " + j1); + } + + sfbDrawBuffers.position(0).limit(usedShadowColorBuffers); + + for (int k1 = 0; k1 < usedShadowColorBuffers; ++k1) + { + sfbDrawBuffers.put(k1, 36064 + k1); + } + + for (int l1 = 0; l1 < ProgramsAll.length; ++l1) + { + Program program1 = ProgramsAll[l1]; + Program program2; + + for (program2 = program1; program2.getId() == 0 && program2.getProgramBackup() != program2; program2 = program2.getProgramBackup()) + { + ; + } + + if (program2 != program1 && program1 != ProgramShadow) + { + program1.copyFrom(program2); + } + } + + resize(); + resizeShadow(); + + if (noiseTextureEnabled) + { + setupNoiseTexture(); + } + + if (defaultTexture == null) + { + defaultTexture = ShadersTex.createDefaultTexture(); + } + + GlStateManager.pushMatrix(); + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + preCelestialRotate(); + postCelestialRotate(); + GlStateManager.popMatrix(); + isShaderPackInitialized = true; + loadEntityDataMap(); + resetDisplayLists(); + + if (!flag) + { + ; + } + + checkGLError("Shaders.init"); + } + } + + private static void initDrawBuffers(Program p) + { + int i = GL11.glGetInteger(GL20.GL_MAX_DRAW_BUFFERS); + Arrays.fill(p.getToggleColorTextures(), false); + + if (p == ProgramFinal) + { + p.setDrawBuffers((IntBuffer)null); + } + else if (p.getId() == 0) + { + if (p == ProgramShadow) + { + p.setDrawBuffers(drawBuffersNone); + } + else + { + p.setDrawBuffers(drawBuffersColorAtt0); + } + } + else + { + String s = p.getDrawBufSettings(); + + if (s == null) + { + if (p != ProgramShadow && p != ProgramShadowSolid && p != ProgramShadowCutout) + { + p.setDrawBuffers(dfbDrawBuffers); + usedDrawBuffers = usedColorBuffers; + Arrays.fill(p.getToggleColorTextures(), 0, usedColorBuffers, true); + } + else + { + p.setDrawBuffers(sfbDrawBuffers); + } + } + else + { + IntBuffer intbuffer = p.getDrawBuffersBuffer(); + int j = s.length(); + usedDrawBuffers = Math.max(usedDrawBuffers, j); + j = Math.min(j, i); + p.setDrawBuffers(intbuffer); + intbuffer.limit(j); + + for (int k = 0; k < j; ++k) + { + int l = getDrawBuffer(p, s, k); + intbuffer.put(k, l); + } + } + } + } + + private static int getDrawBuffer(Program p, String str, int ic) + { + int i = 0; + + if (ic >= str.length()) + { + return i; + } + else + { + int j = str.charAt(ic) - 48; + + if (p == ProgramShadow) + { + if (j >= 0 && j <= 1) + { + i = j + 36064; + usedShadowColorBuffers = Math.max(usedShadowColorBuffers, j); + } + + return i; + } + else + { + if (j >= 0 && j <= 7) + { + p.getToggleColorTextures()[j] = true; + i = j + 36064; + usedColorAttachs = Math.max(usedColorAttachs, j); + usedColorBuffers = Math.max(usedColorBuffers, j); + } + + return i; + } + } + } + + private static void updateToggleBuffers(Program p) + { + boolean[] aboolean = p.getToggleColorTextures(); + Boolean[] aboolean1 = p.getBuffersFlip(); + + for (int i = 0; i < aboolean1.length; ++i) + { + Boolean obool = aboolean1[i]; + + if (obool != null) + { + aboolean[i] = obool.booleanValue(); + } + } + } + + public static void resetDisplayLists() + { + SMCLog.info("Reset model renderers"); + ++countResetDisplayLists; + SMCLog.info("Reset world renderers"); + mc.renderGlobal.loadRenderers(); + } + + private static void setupProgram(Program program, String vShaderPath, String gShaderPath, String fShaderPath) + { + checkGLError("pre setupProgram"); + int i = ARBShaderObjects.glCreateProgramObjectARB(); + checkGLError("create"); + + if (i != 0) + { + progUseEntityAttrib = false; + progUseMidTexCoordAttrib = false; + progUseTangentAttrib = false; + int j = createVertShader(program, vShaderPath); + int k = createGeomShader(program, gShaderPath); + int l = createFragShader(program, fShaderPath); + checkGLError("create"); + + if (j == 0 && k == 0 && l == 0) + { + ARBShaderObjects.glDeleteObjectARB(i); + i = 0; + program.resetId(); + } + else + { + if (j != 0) + { + ARBShaderObjects.glAttachObjectARB(i, j); + checkGLError("attach"); + } + + if (k != 0) + { + ARBShaderObjects.glAttachObjectARB(i, k); + checkGLError("attach"); + + if (progArbGeometryShader4) + { + ARBGeometryShader4.glProgramParameteriARB(i, 36315, 4); + ARBGeometryShader4.glProgramParameteriARB(i, 36316, 5); + ARBGeometryShader4.glProgramParameteriARB(i, 36314, progMaxVerticesOut); + checkGLError("arbGeometryShader4"); + } + + hasGeometryShaders = true; + } + + if (l != 0) + { + ARBShaderObjects.glAttachObjectARB(i, l); + checkGLError("attach"); + } + + if (progUseEntityAttrib) + { + ARBVertexShader.glBindAttribLocationARB(i, entityAttrib, (CharSequence)"mc_Entity"); + checkGLError("mc_Entity"); + } + + if (progUseMidTexCoordAttrib) + { + ARBVertexShader.glBindAttribLocationARB(i, midTexCoordAttrib, (CharSequence)"mc_midTexCoord"); + checkGLError("mc_midTexCoord"); + } + + if (progUseTangentAttrib) + { + ARBVertexShader.glBindAttribLocationARB(i, tangentAttrib, (CharSequence)"at_tangent"); + checkGLError("at_tangent"); + } + + ARBShaderObjects.glLinkProgramARB(i); + + if (GL20.glGetProgrami(i, 35714) != 1) + { + SMCLog.severe("Error linking program: " + i + " (" + program.getName() + ")"); + } + + printLogInfo(i, program.getName()); + + if (j != 0) + { + ARBShaderObjects.glDetachObjectARB(i, j); + ARBShaderObjects.glDeleteObjectARB(j); + } + + if (k != 0) + { + ARBShaderObjects.glDetachObjectARB(i, k); + ARBShaderObjects.glDeleteObjectARB(k); + } + + if (l != 0) + { + ARBShaderObjects.glDetachObjectARB(i, l); + ARBShaderObjects.glDeleteObjectARB(l); + } + + program.setId(i); + program.setRef(i); + useProgram(program); + ARBShaderObjects.glValidateProgramARB(i); + useProgram(ProgramNone); + printLogInfo(i, program.getName()); + int i1 = GL20.glGetProgrami(i, 35715); + + if (i1 != 1) + { + String s = "\""; + printChatAndLogError("[Shaders] Error: Invalid program " + s + program.getName() + s); + ARBShaderObjects.glDeleteObjectARB(i); + i = 0; + program.resetId(); + } + } + } + } + + private static int createVertShader(Program program, String filename) + { + int i = ARBShaderObjects.glCreateShaderObjectARB(ARBVertexShader.GL_VERTEX_SHADER_ARB); + + if (i == 0) + { + return 0; + } + else + { + StringBuilder stringbuilder = new StringBuilder(131072); + BufferedReader bufferedreader = null; + + try + { + bufferedreader = new BufferedReader(getShaderReader(filename)); + } + catch (Exception var10) + { + ARBShaderObjects.glDeleteObjectARB(i); + return 0; + } + + ShaderOption[] ashaderoption = getChangedOptions(shaderPackOptions); + List list = new ArrayList(); + + if (bufferedreader != null) + { + try + { + bufferedreader = ShaderPackParser.resolveIncludes(bufferedreader, filename, shaderPack, 0, list, 0); + MacroState macrostate = new MacroState(); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + bufferedreader.close(); + break; + } + + s = applyOptions(s, ashaderoption); + stringbuilder.append(s).append('\n'); + + if (macrostate.processLine(s)) + { + ShaderLine shaderline = ShaderParser.parseLine(s); + + if (shaderline != null) + { + if (shaderline.isAttribute("mc_Entity")) + { + useEntityAttrib = true; + progUseEntityAttrib = true; + } + else if (shaderline.isAttribute("mc_midTexCoord")) + { + useMidTexCoordAttrib = true; + progUseMidTexCoordAttrib = true; + } + else if (shaderline.isAttribute("at_tangent")) + { + useTangentAttrib = true; + progUseTangentAttrib = true; + } + + if (shaderline.isConstInt("countInstances")) + { + program.setCountInstances(shaderline.getValueInt()); + SMCLog.info("countInstances: " + program.getCountInstances()); + } + } + } + } + } + catch (Exception exception) + { + SMCLog.severe("Couldn\'t read " + filename + "!"); + exception.printStackTrace(); + ARBShaderObjects.glDeleteObjectARB(i); + return 0; + } + } + + if (saveFinalShaders) + { + saveShader(filename, stringbuilder.toString()); + } + + ARBShaderObjects.glShaderSourceARB(i, (CharSequence)stringbuilder); + ARBShaderObjects.glCompileShaderARB(i); + + if (GL20.glGetShaderi(i, 35713) != 1) + { + SMCLog.severe("Error compiling vertex shader: " + filename); + } + + printShaderLogInfo(i, filename, list); + return i; + } + } + + private static int createGeomShader(Program program, String filename) + { + int i = ARBShaderObjects.glCreateShaderObjectARB(36313); + + if (i == 0) + { + return 0; + } + else + { + StringBuilder stringbuilder = new StringBuilder(131072); + BufferedReader bufferedreader = null; + + try + { + bufferedreader = new BufferedReader(getShaderReader(filename)); + } + catch (Exception var11) + { + ARBShaderObjects.glDeleteObjectARB(i); + return 0; + } + + ShaderOption[] ashaderoption = getChangedOptions(shaderPackOptions); + List list = new ArrayList(); + progArbGeometryShader4 = false; + progMaxVerticesOut = 3; + + if (bufferedreader != null) + { + try + { + bufferedreader = ShaderPackParser.resolveIncludes(bufferedreader, filename, shaderPack, 0, list, 0); + MacroState macrostate = new MacroState(); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + bufferedreader.close(); + break; + } + + s = applyOptions(s, ashaderoption); + stringbuilder.append(s).append('\n'); + + if (macrostate.processLine(s)) + { + ShaderLine shaderline = ShaderParser.parseLine(s); + + if (shaderline != null) + { + if (shaderline.isExtension("GL_ARB_geometry_shader4")) + { + String s1 = Config.normalize(shaderline.getValue()); + + if (s1.equals("enable") || s1.equals("require") || s1.equals("warn")) + { + progArbGeometryShader4 = true; + } + } + + if (shaderline.isConstInt("maxVerticesOut")) + { + progMaxVerticesOut = shaderline.getValueInt(); + } + } + } + } + } + catch (Exception exception) + { + SMCLog.severe("Couldn\'t read " + filename + "!"); + exception.printStackTrace(); + ARBShaderObjects.glDeleteObjectARB(i); + return 0; + } + } + + if (saveFinalShaders) + { + saveShader(filename, stringbuilder.toString()); + } + + ARBShaderObjects.glShaderSourceARB(i, (CharSequence)stringbuilder); + ARBShaderObjects.glCompileShaderARB(i); + + if (GL20.glGetShaderi(i, 35713) != 1) + { + SMCLog.severe("Error compiling geometry shader: " + filename); + } + + printShaderLogInfo(i, filename, list); + return i; + } + } + + private static int createFragShader(Program program, String filename) + { + int i = ARBShaderObjects.glCreateShaderObjectARB(ARBFragmentShader.GL_FRAGMENT_SHADER_ARB); + + if (i == 0) + { + return 0; + } + else + { + StringBuilder stringbuilder = new StringBuilder(131072); + BufferedReader bufferedreader = null; + + try + { + bufferedreader = new BufferedReader(getShaderReader(filename)); + } + catch (Exception var14) + { + ARBShaderObjects.glDeleteObjectARB(i); + return 0; + } + + ShaderOption[] ashaderoption = getChangedOptions(shaderPackOptions); + List list = new ArrayList(); + + if (bufferedreader != null) + { + try + { + bufferedreader = ShaderPackParser.resolveIncludes(bufferedreader, filename, shaderPack, 0, list, 0); + MacroState macrostate = new MacroState(); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + bufferedreader.close(); + break; + } + + s = applyOptions(s, ashaderoption); + stringbuilder.append(s).append('\n'); + + if (macrostate.processLine(s)) + { + ShaderLine shaderline = ShaderParser.parseLine(s); + + if (shaderline != null) + { + if (shaderline.isUniform()) + { + String s6 = shaderline.getName(); + int l1; + + if ((l1 = ShaderParser.getShadowDepthIndex(s6)) >= 0) + { + usedShadowDepthBuffers = Math.max(usedShadowDepthBuffers, l1 + 1); + } + else if ((l1 = ShaderParser.getShadowColorIndex(s6)) >= 0) + { + usedShadowColorBuffers = Math.max(usedShadowColorBuffers, l1 + 1); + } + else if ((l1 = ShaderParser.getDepthIndex(s6)) >= 0) + { + usedDepthBuffers = Math.max(usedDepthBuffers, l1 + 1); + } + else if (s6.equals("gdepth") && gbuffersFormat[1] == 6408) + { + gbuffersFormat[1] = 34836; + } + else if ((l1 = ShaderParser.getColorIndex(s6)) >= 0) + { + usedColorBuffers = Math.max(usedColorBuffers, l1 + 1); + } + else if (s6.equals("centerDepthSmooth")) + { + centerDepthSmoothEnabled = true; + } + } + else if (!shaderline.isConstInt("shadowMapResolution") && !shaderline.isProperty("SHADOWRES")) + { + if (!shaderline.isConstFloat("shadowMapFov") && !shaderline.isProperty("SHADOWFOV")) + { + if (!shaderline.isConstFloat("shadowDistance") && !shaderline.isProperty("SHADOWHPL")) + { + if (shaderline.isConstFloat("shadowDistanceRenderMul")) + { + shadowDistanceRenderMul = shaderline.getValueFloat(); + SMCLog.info("Shadow distance render mul: " + shadowDistanceRenderMul); + } + else if (shaderline.isConstFloat("shadowIntervalSize")) + { + shadowIntervalSize = shaderline.getValueFloat(); + SMCLog.info("Shadow map interval size: " + shadowIntervalSize); + } + else if (shaderline.isConstBool("generateShadowMipmap", true)) + { + Arrays.fill(shadowMipmapEnabled, true); + SMCLog.info("Generate shadow mipmap"); + } + else if (shaderline.isConstBool("generateShadowColorMipmap", true)) + { + Arrays.fill(shadowColorMipmapEnabled, true); + SMCLog.info("Generate shadow color mipmap"); + } + else if (shaderline.isConstBool("shadowHardwareFiltering", true)) + { + Arrays.fill(shadowHardwareFilteringEnabled, true); + SMCLog.info("Hardware shadow filtering enabled."); + } + else if (shaderline.isConstBool("shadowHardwareFiltering0", true)) + { + shadowHardwareFilteringEnabled[0] = true; + SMCLog.info("shadowHardwareFiltering0"); + } + else if (shaderline.isConstBool("shadowHardwareFiltering1", true)) + { + shadowHardwareFilteringEnabled[1] = true; + SMCLog.info("shadowHardwareFiltering1"); + } + else if (shaderline.isConstBool("shadowtex0Mipmap", "shadowtexMipmap", true)) + { + shadowMipmapEnabled[0] = true; + SMCLog.info("shadowtex0Mipmap"); + } + else if (shaderline.isConstBool("shadowtex1Mipmap", true)) + { + shadowMipmapEnabled[1] = true; + SMCLog.info("shadowtex1Mipmap"); + } + else if (shaderline.isConstBool("shadowcolor0Mipmap", "shadowColor0Mipmap", true)) + { + shadowColorMipmapEnabled[0] = true; + SMCLog.info("shadowcolor0Mipmap"); + } + else if (shaderline.isConstBool("shadowcolor1Mipmap", "shadowColor1Mipmap", true)) + { + shadowColorMipmapEnabled[1] = true; + SMCLog.info("shadowcolor1Mipmap"); + } + else if (shaderline.isConstBool("shadowtex0Nearest", "shadowtexNearest", "shadow0MinMagNearest", true)) + { + shadowFilterNearest[0] = true; + SMCLog.info("shadowtex0Nearest"); + } + else if (shaderline.isConstBool("shadowtex1Nearest", "shadow1MinMagNearest", true)) + { + shadowFilterNearest[1] = true; + SMCLog.info("shadowtex1Nearest"); + } + else if (shaderline.isConstBool("shadowcolor0Nearest", "shadowColor0Nearest", "shadowColor0MinMagNearest", true)) + { + shadowColorFilterNearest[0] = true; + SMCLog.info("shadowcolor0Nearest"); + } + else if (shaderline.isConstBool("shadowcolor1Nearest", "shadowColor1Nearest", "shadowColor1MinMagNearest", true)) + { + shadowColorFilterNearest[1] = true; + SMCLog.info("shadowcolor1Nearest"); + } + else if (!shaderline.isConstFloat("wetnessHalflife") && !shaderline.isProperty("WETNESSHL")) + { + if (!shaderline.isConstFloat("drynessHalflife") && !shaderline.isProperty("DRYNESSHL")) + { + if (shaderline.isConstFloat("eyeBrightnessHalflife")) + { + eyeBrightnessHalflife = shaderline.getValueFloat(); + SMCLog.info("Eye brightness halflife: " + eyeBrightnessHalflife); + } + else if (shaderline.isConstFloat("centerDepthHalflife")) + { + centerDepthSmoothHalflife = shaderline.getValueFloat(); + SMCLog.info("Center depth halflife: " + centerDepthSmoothHalflife); + } + else if (shaderline.isConstFloat("sunPathRotation")) + { + sunPathRotation = shaderline.getValueFloat(); + SMCLog.info("Sun path rotation: " + sunPathRotation); + } + else if (shaderline.isConstFloat("ambientOcclusionLevel")) + { + aoLevel = Config.limit(shaderline.getValueFloat(), 0.0F, 1.0F); + SMCLog.info("AO Level: " + aoLevel); + } + else if (shaderline.isConstInt("superSamplingLevel")) + { + int i1 = shaderline.getValueInt(); + + if (i1 > 1) + { + SMCLog.info("Super sampling level: " + i1 + "x"); + superSamplingLevel = i1; + } + else + { + superSamplingLevel = 1; + } + } + else if (shaderline.isConstInt("noiseTextureResolution")) + { + noiseTextureResolution = shaderline.getValueInt(); + noiseTextureEnabled = true; + SMCLog.info("Noise texture enabled"); + SMCLog.info("Noise texture resolution: " + noiseTextureResolution); + } + else if (shaderline.isConstIntSuffix("Format")) + { + String s5 = StrUtils.removeSuffix(shaderline.getName(), "Format"); + String s7 = shaderline.getValue(); + int i2 = getBufferIndexFromString(s5); + int l = getTextureFormatFromString(s7); + + if (i2 >= 0 && l != 0) + { + gbuffersFormat[i2] = l; + SMCLog.info("%s format: %s", new Object[] {s5, s7}); + } + } + else if (shaderline.isConstBoolSuffix("Clear", false)) + { + if (ShaderParser.isComposite(filename) || ShaderParser.isDeferred(filename)) + { + String s4 = StrUtils.removeSuffix(shaderline.getName(), "Clear"); + int k1 = getBufferIndexFromString(s4); + + if (k1 >= 0) + { + gbuffersClear[k1] = false; + SMCLog.info("%s clear disabled", new Object[] {s4}); + } + } + } + else if (shaderline.isConstVec4Suffix("ClearColor")) + { + if (ShaderParser.isComposite(filename) || ShaderParser.isDeferred(filename)) + { + String s3 = StrUtils.removeSuffix(shaderline.getName(), "ClearColor"); + int j1 = getBufferIndexFromString(s3); + + if (j1 >= 0) + { + Vector4f vector4f = shaderline.getValueVec4(); + + if (vector4f != null) + { + gbuffersClearColor[j1] = vector4f; + SMCLog.info("%s clear color: %s %s %s %s", new Object[] {s3, Float.valueOf(vector4f.getX()), Float.valueOf(vector4f.getY()), Float.valueOf(vector4f.getZ()), Float.valueOf(vector4f.getW())}); + } + else + { + SMCLog.warning("Invalid color value: " + shaderline.getValue()); + } + } + } + } + else if (shaderline.isProperty("GAUX4FORMAT", "RGBA32F")) + { + gbuffersFormat[7] = 34836; + SMCLog.info("gaux4 format : RGB32AF"); + } + else if (shaderline.isProperty("GAUX4FORMAT", "RGB32F")) + { + gbuffersFormat[7] = 34837; + SMCLog.info("gaux4 format : RGB32F"); + } + else if (shaderline.isProperty("GAUX4FORMAT", "RGB16")) + { + gbuffersFormat[7] = 32852; + SMCLog.info("gaux4 format : RGB16"); + } + else if (shaderline.isConstBoolSuffix("MipmapEnabled", true)) + { + if (ShaderParser.isComposite(filename) || ShaderParser.isDeferred(filename) || ShaderParser.isFinal(filename)) + { + String s2 = StrUtils.removeSuffix(shaderline.getName(), "MipmapEnabled"); + int j = getBufferIndexFromString(s2); + + if (j >= 0) + { + int k = program.getCompositeMipmapSetting(); + k = k | 1 << j; + program.setCompositeMipmapSetting(k); + SMCLog.info("%s mipmap enabled", new Object[] {s2}); + } + } + } + else if (shaderline.isProperty("DRAWBUFFERS")) + { + String s1 = shaderline.getValue(); + + if (ShaderParser.isValidDrawBuffers(s1)) + { + program.setDrawBufSettings(s1); + } + else + { + SMCLog.warning("Invalid draw buffers: " + s1); + } + } + } + else + { + drynessHalfLife = shaderline.getValueFloat(); + SMCLog.info("Dryness halflife: " + drynessHalfLife); + } + } + else + { + wetnessHalfLife = shaderline.getValueFloat(); + SMCLog.info("Wetness halflife: " + wetnessHalfLife); + } + } + else + { + shadowMapHalfPlane = shaderline.getValueFloat(); + shadowMapIsOrtho = true; + SMCLog.info("Shadow map distance: " + shadowMapHalfPlane); + } + } + else + { + shadowMapFOV = shaderline.getValueFloat(); + shadowMapIsOrtho = false; + SMCLog.info("Shadow map field of view: " + shadowMapFOV); + } + } + else + { + spShadowMapWidth = spShadowMapHeight = shaderline.getValueInt(); + shadowMapWidth = shadowMapHeight = Math.round((float)spShadowMapWidth * configShadowResMul); + SMCLog.info("Shadow map resolution: " + spShadowMapWidth); + } + } + } + } + } + catch (Exception exception) + { + SMCLog.severe("Couldn\'t read " + filename + "!"); + exception.printStackTrace(); + ARBShaderObjects.glDeleteObjectARB(i); + return 0; + } + } + + if (saveFinalShaders) + { + saveShader(filename, stringbuilder.toString()); + } + + ARBShaderObjects.glShaderSourceARB(i, (CharSequence)stringbuilder); + ARBShaderObjects.glCompileShaderARB(i); + + if (GL20.glGetShaderi(i, 35713) != 1) + { + SMCLog.severe("Error compiling fragment shader: " + filename); + } + + printShaderLogInfo(i, filename, list); + return i; + } + } + + private static Reader getShaderReader(String filename) + { + return new InputStreamReader(shaderPack.getResourceAsStream(filename)); + } + + public static void saveShader(String filename, String code) + { + try + { + File file1 = new File(shaderPacksDir, "debug/" + filename); + file1.getParentFile().mkdirs(); + Config.writeFile(file1, code); + } + catch (IOException ioexception) + { + Config.warn("Error saving: " + filename); + ioexception.printStackTrace(); + } + } + + private static void clearDirectory(File dir) + { + if (dir.exists()) + { + if (dir.isDirectory()) + { + File[] afile = dir.listFiles(); + + if (afile != null) + { + for (int i = 0; i < afile.length; ++i) + { + File file1 = afile[i]; + + if (file1.isDirectory()) + { + clearDirectory(file1); + } + + file1.delete(); + } + } + } + } + } + + private static boolean printLogInfo(int obj, String name) + { + IntBuffer intbuffer = BufferUtils.createIntBuffer(1); + ARBShaderObjects.glGetObjectParameterARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB, (IntBuffer)intbuffer); + int i = intbuffer.get(); + + if (i > 1) + { + ByteBuffer bytebuffer = BufferUtils.createByteBuffer(i); + intbuffer.flip(); + ARBShaderObjects.glGetInfoLogARB(obj, intbuffer, bytebuffer); + byte[] abyte = new byte[i]; + bytebuffer.get(abyte); + + if (abyte[i - 1] == 0) + { + abyte[i - 1] = 10; + } + + String s = new String(abyte, Charsets.US_ASCII); + s = StrUtils.trim(s, " \n\r\t"); + SMCLog.info("Info log: " + name + "\n" + s); + return false; + } + else + { + return true; + } + } + + private static boolean printShaderLogInfo(int shader, String name, List listFiles) + { + IntBuffer intbuffer = BufferUtils.createIntBuffer(1); + int i = GL20.glGetShaderi(shader, 35716); + + if (i <= 1) + { + return true; + } + else + { + for (int j = 0; j < listFiles.size(); ++j) + { + String s = (String)listFiles.get(j); + SMCLog.info("File: " + (j + 1) + " = " + s); + } + + String s1 = GL20.glGetShaderInfoLog(shader, i); + s1 = StrUtils.trim(s1, " \n\r\t"); + SMCLog.info("Shader info log: " + name + "\n" + s1); + return false; + } + } + + public static void setDrawBuffers(IntBuffer drawBuffers) + { + if (drawBuffers == null) + { + drawBuffers = drawBuffersNone; + } + + if (activeDrawBuffers != drawBuffers) + { + activeDrawBuffers = drawBuffers; + GL20.glDrawBuffers(drawBuffers); + checkGLError("setDrawBuffers"); + } + } + + public static void useProgram(Program program) + { + checkGLError("pre-useProgram"); + + if (isShadowPass) + { + program = ProgramShadow; + } + else if (isEntitiesGlowing) + { + program = ProgramEntitiesGlowing; + } + + if (activeProgram != program) + { + updateAlphaBlend(activeProgram, program); + activeProgram = program; + int i = program.getId(); + activeProgramID = i; + ARBShaderObjects.glUseProgramObjectARB(i); + + if (checkGLError("useProgram") != 0) + { + program.setId(0); + i = program.getId(); + activeProgramID = i; + ARBShaderObjects.glUseProgramObjectARB(i); + } + + shaderUniforms.setProgram(i); + + if (customUniforms != null) + { + customUniforms.setProgram(i); + } + + if (i != 0) + { + IntBuffer intbuffer = program.getDrawBuffers(); + + if (isRenderingDfb) + { + setDrawBuffers(intbuffer); + } + + activeCompositeMipmapSetting = program.getCompositeMipmapSetting(); + + switch (program.getProgramStage()) + { + case GBUFFERS: + setProgramUniform1i(uniform_texture, 0); + setProgramUniform1i(uniform_lightmap, 1); + setProgramUniform1i(uniform_normals, 2); + setProgramUniform1i(uniform_specular, 3); + setProgramUniform1i(uniform_shadow, waterShadowEnabled ? 5 : 4); + setProgramUniform1i(uniform_watershadow, 4); + setProgramUniform1i(uniform_shadowtex0, 4); + setProgramUniform1i(uniform_shadowtex1, 5); + setProgramUniform1i(uniform_depthtex0, 6); + + if (customTexturesGbuffers != null || hasDeferredPrograms) + { + setProgramUniform1i(uniform_gaux1, 7); + setProgramUniform1i(uniform_gaux2, 8); + setProgramUniform1i(uniform_gaux3, 9); + setProgramUniform1i(uniform_gaux4, 10); + } + + setProgramUniform1i(uniform_depthtex1, 11); + setProgramUniform1i(uniform_shadowcolor, 13); + setProgramUniform1i(uniform_shadowcolor0, 13); + setProgramUniform1i(uniform_shadowcolor1, 14); + setProgramUniform1i(uniform_noisetex, 15); + break; + + case DEFERRED: + case COMPOSITE: + setProgramUniform1i(uniform_gcolor, 0); + setProgramUniform1i(uniform_gdepth, 1); + setProgramUniform1i(uniform_gnormal, 2); + setProgramUniform1i(uniform_composite, 3); + setProgramUniform1i(uniform_gaux1, 7); + setProgramUniform1i(uniform_gaux2, 8); + setProgramUniform1i(uniform_gaux3, 9); + setProgramUniform1i(uniform_gaux4, 10); + setProgramUniform1i(uniform_colortex0, 0); + setProgramUniform1i(uniform_colortex1, 1); + setProgramUniform1i(uniform_colortex2, 2); + setProgramUniform1i(uniform_colortex3, 3); + setProgramUniform1i(uniform_colortex4, 7); + setProgramUniform1i(uniform_colortex5, 8); + setProgramUniform1i(uniform_colortex6, 9); + setProgramUniform1i(uniform_colortex7, 10); + setProgramUniform1i(uniform_shadow, waterShadowEnabled ? 5 : 4); + setProgramUniform1i(uniform_watershadow, 4); + setProgramUniform1i(uniform_shadowtex0, 4); + setProgramUniform1i(uniform_shadowtex1, 5); + setProgramUniform1i(uniform_gdepthtex, 6); + setProgramUniform1i(uniform_depthtex0, 6); + setProgramUniform1i(uniform_depthtex1, 11); + setProgramUniform1i(uniform_depthtex2, 12); + setProgramUniform1i(uniform_shadowcolor, 13); + setProgramUniform1i(uniform_shadowcolor0, 13); + setProgramUniform1i(uniform_shadowcolor1, 14); + setProgramUniform1i(uniform_noisetex, 15); + break; + + case SHADOW: + setProgramUniform1i(uniform_tex, 0); + setProgramUniform1i(uniform_texture, 0); + setProgramUniform1i(uniform_lightmap, 1); + setProgramUniform1i(uniform_normals, 2); + setProgramUniform1i(uniform_specular, 3); + setProgramUniform1i(uniform_shadow, waterShadowEnabled ? 5 : 4); + setProgramUniform1i(uniform_watershadow, 4); + setProgramUniform1i(uniform_shadowtex0, 4); + setProgramUniform1i(uniform_shadowtex1, 5); + + if (customTexturesGbuffers != null) + { + setProgramUniform1i(uniform_gaux1, 7); + setProgramUniform1i(uniform_gaux2, 8); + setProgramUniform1i(uniform_gaux3, 9); + setProgramUniform1i(uniform_gaux4, 10); + } + + setProgramUniform1i(uniform_shadowcolor, 13); + setProgramUniform1i(uniform_shadowcolor0, 13); + setProgramUniform1i(uniform_shadowcolor1, 14); + setProgramUniform1i(uniform_noisetex, 15); + } + + ItemStack itemstack = mc.thePlayer != null ? mc.thePlayer.getHeldItem() : null; + Item item = itemstack != null ? itemstack.getItem() : null; + int j = -1; + Block block = null; + + if (item != null) + { + j = Item.itemRegistry.getIDForObject(item); + block = (Block)Block.blockRegistry.getObjectById(j); + j = ItemAliases.getItemAliasId(j); + } + + int k = block != null ? block.getLightValue() : 0; + setProgramUniform1i(uniform_heldItemId, j); + setProgramUniform1i(uniform_heldBlockLightValue, k); + setProgramUniform1i(uniform_fogMode, fogEnabled ? fogMode : 0); + setProgramUniform1f(uniform_fogDensity, fogEnabled ? fogDensity : 0.0F); + setProgramUniform3f(uniform_fogColor, fogColorR, fogColorG, fogColorB); + setProgramUniform3f(uniform_skyColor, skyColorR, skyColorG, skyColorB); + setProgramUniform1i(uniform_worldTime, (int)(worldTime % 24000L)); + setProgramUniform1i(uniform_worldDay, (int)(worldTime / 24000L)); + setProgramUniform1i(uniform_moonPhase, moonPhase); + setProgramUniform1i(uniform_frameCounter, frameCounter); + setProgramUniform1f(uniform_frameTime, frameTime); + setProgramUniform1f(uniform_frameTimeCounter, frameTimeCounter); + setProgramUniform1f(uniform_sunAngle, sunAngle); + setProgramUniform1f(uniform_shadowAngle, shadowAngle); + setProgramUniform1f(uniform_rainStrength, rainStrength); + setProgramUniform1f(uniform_aspectRatio, (float)renderWidth / (float)renderHeight); + setProgramUniform1f(uniform_viewWidth, (float)renderWidth); + setProgramUniform1f(uniform_viewHeight, (float)renderHeight); + setProgramUniform1f(uniform_near, 0.05F); + setProgramUniform1f(uniform_far, (float)(mc.gameSettings.renderDistanceChunks * 16)); + setProgramUniform3f(uniform_sunPosition, sunPosition[0], sunPosition[1], sunPosition[2]); + setProgramUniform3f(uniform_moonPosition, moonPosition[0], moonPosition[1], moonPosition[2]); + setProgramUniform3f(uniform_shadowLightPosition, shadowLightPosition[0], shadowLightPosition[1], shadowLightPosition[2]); + setProgramUniform3f(uniform_upPosition, upPosition[0], upPosition[1], upPosition[2]); + setProgramUniform3f(uniform_previousCameraPosition, (float)previousCameraPositionX, (float)previousCameraPositionY, (float)previousCameraPositionZ); + setProgramUniform3f(uniform_cameraPosition, (float)cameraPositionX, (float)cameraPositionY, (float)cameraPositionZ); + setProgramUniformMatrix4ARB(uniform_gbufferModelView, false, modelView); + setProgramUniformMatrix4ARB(uniform_gbufferModelViewInverse, false, modelViewInverse); + setProgramUniformMatrix4ARB(uniform_gbufferPreviousProjection, false, previousProjection); + setProgramUniformMatrix4ARB(uniform_gbufferProjection, false, projection); + setProgramUniformMatrix4ARB(uniform_gbufferProjectionInverse, false, projectionInverse); + setProgramUniformMatrix4ARB(uniform_gbufferPreviousModelView, false, previousModelView); + + if (usedShadowDepthBuffers > 0) + { + setProgramUniformMatrix4ARB(uniform_shadowProjection, false, shadowProjection); + setProgramUniformMatrix4ARB(uniform_shadowProjectionInverse, false, shadowProjectionInverse); + setProgramUniformMatrix4ARB(uniform_shadowModelView, false, shadowModelView); + setProgramUniformMatrix4ARB(uniform_shadowModelViewInverse, false, shadowModelViewInverse); + } + + setProgramUniform1f(uniform_wetness, wetness); + setProgramUniform1f(uniform_eyeAltitude, eyePosY); + setProgramUniform2i(uniform_eyeBrightness, eyeBrightness & 65535, eyeBrightness >> 16); + setProgramUniform2i(uniform_eyeBrightnessSmooth, Math.round(eyeBrightnessFadeX), Math.round(eyeBrightnessFadeY)); + setProgramUniform2i(uniform_terrainTextureSize, terrainTextureSize[0], terrainTextureSize[1]); + setProgramUniform1i(uniform_terrainIconSize, terrainIconSize); + setProgramUniform1i(uniform_isEyeInWater, isEyeInWater); + setProgramUniform1f(uniform_nightVision, nightVision); + setProgramUniform1f(uniform_blindness, blindness); + setProgramUniform1f(uniform_screenBrightness, mc.gameSettings.gammaSetting); + setProgramUniform1i(uniform_hideGUI, mc.gameSettings.hideGUI ? 1 : 0); + setProgramUniform1f(uniform_centerDepthSmooth, centerDepthSmooth); + setProgramUniform2i(uniform_atlasSize, atlasSizeX, atlasSizeY); + + if (customUniforms != null) + { + customUniforms.update(); + } + + checkGLError("end useProgram"); + } + } + } + + private static void updateAlphaBlend(Program programOld, Program programNew) + { + if (programOld.getAlphaState() != null) + { + GlStateManager.unlockAlpha(); + } + + if (programOld.getBlendState() != null) + { + GlStateManager.unlockBlend(); + } + + GlAlphaState glalphastate = programNew.getAlphaState(); + + if (glalphastate != null) + { + GlStateManager.lockAlpha(glalphastate); + } + + GlBlendState glblendstate = programNew.getBlendState(); + + if (glblendstate != null) + { + GlStateManager.lockBlend(glblendstate); + } + } + + private static void setProgramUniform1i(ShaderUniform1i su, int value) + { + su.setValue(value); + } + + private static void setProgramUniform2i(ShaderUniform2i su, int i0, int i1) + { + su.setValue(i0, i1); + } + + private static void setProgramUniform1f(ShaderUniform1f su, float value) + { + su.setValue(value); + } + + private static void setProgramUniform3f(ShaderUniform3f su, float f0, float f1, float f2) + { + su.setValue(f0, f1, f2); + } + + private static void setProgramUniformMatrix4ARB(ShaderUniformM4 su, boolean transpose, FloatBuffer matrix) + { + su.setValue(transpose, matrix); + } + + public static int getBufferIndexFromString(String name) + { + return !name.equals("colortex0") && !name.equals("gcolor") ? (!name.equals("colortex1") && !name.equals("gdepth") ? (!name.equals("colortex2") && !name.equals("gnormal") ? (!name.equals("colortex3") && !name.equals("composite") ? (!name.equals("colortex4") && !name.equals("gaux1") ? (!name.equals("colortex5") && !name.equals("gaux2") ? (!name.equals("colortex6") && !name.equals("gaux3") ? (!name.equals("colortex7") && !name.equals("gaux4") ? -1 : 7) : 6) : 5) : 4) : 3) : 2) : 1) : 0; + } + + private static int getTextureFormatFromString(String par) + { + par = par.trim(); + + for (int i = 0; i < formatNames.length; ++i) + { + String s = formatNames[i]; + + if (par.equals(s)) + { + return formatIds[i]; + } + } + + return 0; + } + + private static void setupNoiseTexture() + { + if (noiseTexture == null && noiseTexturePath != null) + { + noiseTexture = loadCustomTexture(15, noiseTexturePath); + } + + if (noiseTexture == null) + { + noiseTexture = new HFNoiseTexture(noiseTextureResolution, noiseTextureResolution); + } + } + + private static void loadEntityDataMap() + { + mapBlockToEntityData = new IdentityHashMap(300); + + if (mapBlockToEntityData.isEmpty()) + { + for (ResourceLocation resourcelocation : Block.blockRegistry.getKeys()) + { + Block block = (Block)Block.blockRegistry.getObject(resourcelocation); + int i = Block.blockRegistry.getIDForObject(block); + mapBlockToEntityData.put(block, Integer.valueOf(i)); + } + } + + BufferedReader bufferedreader = null; + + try + { + bufferedreader = new BufferedReader(new InputStreamReader(shaderPack.getResourceAsStream("/mc_Entity_x.txt"))); + } + catch (Exception var8) + { + ; + } + + if (bufferedreader != null) + { + String s1; + + try + { + while ((s1 = bufferedreader.readLine()) != null) + { + Matcher matcher = patternLoadEntityDataMap.matcher(s1); + + if (matcher.matches()) + { + String s2 = matcher.group(1); + String s = matcher.group(2); + int j = Integer.parseInt(s); + Block block1 = Block.getBlockFromName(s2); + + if (block1 != null) + { + mapBlockToEntityData.put(block1, Integer.valueOf(j)); + } + else + { + SMCLog.warning("Unknown block name %s", new Object[] {s2}); + } + } + else + { + SMCLog.warning("unmatched %s\n", new Object[] {s1}); + } + } + } + catch (Exception var9) + { + SMCLog.warning("Error parsing mc_Entity_x.txt"); + } + } + + if (bufferedreader != null) + { + try + { + bufferedreader.close(); + } + catch (Exception var7) + { + ; + } + } + } + + private static IntBuffer fillIntBufferZero(IntBuffer buf) + { + int i = buf.limit(); + + for (int j = buf.position(); j < i; ++j) + { + buf.put(j, 0); + } + + return buf; + } + + public static void uninit() + { + if (isShaderPackInitialized) + { + checkGLError("Shaders.uninit pre"); + + for (int i = 0; i < ProgramsAll.length; ++i) + { + Program program = ProgramsAll[i]; + + if (program.getRef() != 0) + { + ARBShaderObjects.glDeleteObjectARB(program.getRef()); + checkGLError("del programRef"); + } + + program.setRef(0); + program.setId(0); + program.setDrawBufSettings((String)null); + program.setDrawBuffers((IntBuffer)null); + program.setCompositeMipmapSetting(0); + } + + hasDeferredPrograms = false; + + if (dfb != 0) + { + EXTFramebufferObject.glDeleteFramebuffersEXT(dfb); + dfb = 0; + checkGLError("del dfb"); + } + + if (sfb != 0) + { + EXTFramebufferObject.glDeleteFramebuffersEXT(sfb); + sfb = 0; + checkGLError("del sfb"); + } + + if (dfbDepthTextures != null) + { + GlStateManager.deleteTextures(dfbDepthTextures); + fillIntBufferZero(dfbDepthTextures); + checkGLError("del dfbDepthTextures"); + } + + if (dfbColorTextures != null) + { + GlStateManager.deleteTextures(dfbColorTextures); + fillIntBufferZero(dfbColorTextures); + checkGLError("del dfbTextures"); + } + + if (sfbDepthTextures != null) + { + GlStateManager.deleteTextures(sfbDepthTextures); + fillIntBufferZero(sfbDepthTextures); + checkGLError("del shadow depth"); + } + + if (sfbColorTextures != null) + { + GlStateManager.deleteTextures(sfbColorTextures); + fillIntBufferZero(sfbColorTextures); + checkGLError("del shadow color"); + } + + if (dfbDrawBuffers != null) + { + fillIntBufferZero(dfbDrawBuffers); + } + + if (noiseTexture != null) + { + noiseTexture.deleteTexture(); + noiseTexture = null; + } + + SMCLog.info("Uninit"); + shadowPassInterval = 0; + shouldSkipDefaultShadow = false; + isShaderPackInitialized = false; + checkGLError("Shaders.uninit"); + } + } + + public static void scheduleResize() + { + renderDisplayHeight = 0; + } + + public static void scheduleResizeShadow() + { + needResizeShadow = true; + } + + private static void resize() + { + renderDisplayWidth = mc.displayWidth; + renderDisplayHeight = mc.displayHeight; + renderWidth = Math.round((float)renderDisplayWidth * configRenderResMul); + renderHeight = Math.round((float)renderDisplayHeight * configRenderResMul); + setupFrameBuffer(); + } + + private static void resizeShadow() + { + needResizeShadow = false; + shadowMapWidth = Math.round((float)spShadowMapWidth * configShadowResMul); + shadowMapHeight = Math.round((float)spShadowMapHeight * configShadowResMul); + setupShadowFrameBuffer(); + } + + private static void setupFrameBuffer() + { + if (dfb != 0) + { + EXTFramebufferObject.glDeleteFramebuffersEXT(dfb); + GlStateManager.deleteTextures(dfbDepthTextures); + GlStateManager.deleteTextures(dfbColorTextures); + } + + dfb = EXTFramebufferObject.glGenFramebuffersEXT(); + GL11.glGenTextures((IntBuffer)dfbDepthTextures.clear().limit(usedDepthBuffers)); + GL11.glGenTextures((IntBuffer)dfbColorTextures.clear().limit(16)); + dfbDepthTextures.position(0); + dfbColorTextures.position(0); + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + GL20.glDrawBuffers(0); + GL11.glReadBuffer(0); + + for (int i = 0; i < usedDepthBuffers; ++i) + { + GlStateManager.bindTexture(dfbDepthTextures.get(i)); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_DEPTH_TEXTURE_MODE, GL11.GL_LUMINANCE); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, renderWidth, renderHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)((FloatBuffer)null)); + } + + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, dfbDepthTextures.get(0), 0); + GL20.glDrawBuffers(dfbDrawBuffers); + GL11.glReadBuffer(0); + checkGLError("FT d"); + + for (int k = 0; k < usedColorBuffers; ++k) + { + GlStateManager.bindTexture(dfbColorTexturesFlip.getA(k)); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, gbuffersFormat[k], renderWidth, renderHeight, 0, getPixelFormat(gbuffersFormat[k]), GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null)); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + k, 3553, dfbColorTexturesFlip.getA(k), 0); + checkGLError("FT c"); + } + + for (int l = 0; l < usedColorBuffers; ++l) + { + GlStateManager.bindTexture(dfbColorTexturesFlip.getB(l)); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, gbuffersFormat[l], renderWidth, renderHeight, 0, getPixelFormat(gbuffersFormat[l]), GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null)); + checkGLError("FT ca"); + } + + int i1 = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (i1 == 36058) + { + printChatAndLogError("[Shaders] Error: Failed framebuffer incomplete formats"); + + for (int j = 0; j < usedColorBuffers; ++j) + { + GlStateManager.bindTexture(dfbColorTexturesFlip.getA(j)); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, renderWidth, renderHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null)); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + j, 3553, dfbColorTexturesFlip.getA(j), 0); + checkGLError("FT c"); + } + + i1 = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (i1 == 36053) + { + SMCLog.info("complete"); + } + } + + GlStateManager.bindTexture(0); + + if (i1 != 36053) + { + printChatAndLogError("[Shaders] Error: Failed creating framebuffer! (Status " + i1 + ")"); + } + else + { + SMCLog.info("Framebuffer created."); + } + } + + private static int getPixelFormat(int internalFormat) + { + switch (internalFormat) + { + case 33333: + case 33334: + case 33339: + case 33340: + case 36208: + case 36209: + case 36226: + case 36227: + return 36251; + + default: + return 32993; + } + } + + private static void setupShadowFrameBuffer() + { + if (usedShadowDepthBuffers != 0) + { + if (sfb != 0) + { + EXTFramebufferObject.glDeleteFramebuffersEXT(sfb); + GlStateManager.deleteTextures(sfbDepthTextures); + GlStateManager.deleteTextures(sfbColorTextures); + } + + sfb = EXTFramebufferObject.glGenFramebuffersEXT(); + EXTFramebufferObject.glBindFramebufferEXT(36160, sfb); + GL11.glDrawBuffer(0); + GL11.glReadBuffer(0); + GL11.glGenTextures((IntBuffer)sfbDepthTextures.clear().limit(usedShadowDepthBuffers)); + GL11.glGenTextures((IntBuffer)sfbColorTextures.clear().limit(usedShadowColorBuffers)); + sfbDepthTextures.position(0); + sfbColorTextures.position(0); + + for (int i = 0; i < usedShadowDepthBuffers; ++i) + { + GlStateManager.bindTexture(sfbDepthTextures.get(i)); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 33071.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 33071.0F); + int j = shadowFilterNearest[i] ? 9728 : 9729; + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, j); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j); + + if (shadowHardwareFilteringEnabled[i]) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_COMPARE_MODE, GL14.GL_COMPARE_R_TO_TEXTURE); + } + + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, shadowMapWidth, shadowMapHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)((FloatBuffer)null)); + } + + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0); + checkGLError("FT sd"); + + for (int k = 0; k < usedShadowColorBuffers; ++k) + { + GlStateManager.bindTexture(sfbColorTextures.get(k)); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 33071.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 33071.0F); + int i1 = shadowColorFilterNearest[k] ? 9728 : 9729; + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i1); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, i1); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, shadowMapWidth, shadowMapHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null)); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + k, 3553, sfbColorTextures.get(k), 0); + checkGLError("FT sc"); + } + + GlStateManager.bindTexture(0); + + if (usedShadowColorBuffers > 0) + { + GL20.glDrawBuffers(sfbDrawBuffers); + } + + int l = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (l != 36053) + { + printChatAndLogError("[Shaders] Error: Failed creating shadow framebuffer! (Status " + l + ")"); + } + else + { + SMCLog.info("Shadow framebuffer created."); + } + } + } + + public static void beginRender(Minecraft minecraft, float partialTicks, long finishTimeNano) + { + checkGLError("pre beginRender"); + checkWorldChanged(mc.theWorld); + mc = minecraft; + mc.mcProfiler.startSection("init"); + entityRenderer = mc.entityRenderer; + + if (!isShaderPackInitialized) + { + try + { + init(); + } + catch (IllegalStateException illegalstateexception) + { + if (Config.normalize(illegalstateexception.getMessage()).equals("Function is not supported")) + { + printChatAndLogError("[Shaders] Error: " + illegalstateexception.getMessage()); + illegalstateexception.printStackTrace(); + setShaderPack("OFF"); + return; + } + } + } + + if (mc.displayWidth != renderDisplayWidth || mc.displayHeight != renderDisplayHeight) + { + resize(); + } + + if (needResizeShadow) + { + resizeShadow(); + } + + worldTime = mc.theWorld.getWorldTime(); + diffWorldTime = (worldTime - lastWorldTime) % 24000L; + + if (diffWorldTime < 0L) + { + diffWorldTime += 24000L; + } + + lastWorldTime = worldTime; + moonPhase = mc.theWorld.getMoonPhase(); + ++frameCounter; + + if (frameCounter >= 720720) + { + frameCounter = 0; + } + + systemTime = System.currentTimeMillis(); + + if (lastSystemTime == 0L) + { + lastSystemTime = systemTime; + } + + diffSystemTime = systemTime - lastSystemTime; + lastSystemTime = systemTime; + frameTime = (float)diffSystemTime / 1000.0F; + frameTimeCounter += frameTime; + frameTimeCounter %= 3600.0F; + rainStrength = minecraft.theWorld.getRainStrength(partialTicks); + float f = (float)diffSystemTime * 0.01F; + float f1 = (float)Math.exp(Math.log(0.5D) * (double)f / (double)(wetness < rainStrength ? drynessHalfLife : wetnessHalfLife)); + wetness = wetness * f1 + rainStrength * (1.0F - f1); + Entity entity = mc.getRenderViewEntity(); + + if (entity != null) + { + isSleeping = entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPlayerSleeping(); + eyePosY = (float)entity.posY * partialTicks + (float)entity.lastTickPosY * (1.0F - partialTicks); + eyeBrightness = entity.getBrightnessForRender(partialTicks); + f1 = (float)diffSystemTime * 0.01F; + float f2 = (float)Math.exp(Math.log(0.5D) * (double)f1 / (double)eyeBrightnessHalflife); + eyeBrightnessFadeX = eyeBrightnessFadeX * f2 + (float)(eyeBrightness & 65535) * (1.0F - f2); + eyeBrightnessFadeY = eyeBrightnessFadeY * f2 + (float)(eyeBrightness >> 16) * (1.0F - f2); + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(mc.theWorld, entity, partialTicks); + Material material = block.getMaterial(); + + if (material == Material.water) + { + isEyeInWater = 1; + } + else if (material == Material.lava) + { + isEyeInWater = 2; + } + else + { + isEyeInWater = 0; + } + + if (mc.thePlayer != null) + { + nightVision = 0.0F; + + if (mc.thePlayer.isPotionActive(Potion.nightVision)) + { + nightVision = Config.getMinecraft().entityRenderer.getNightVisionBrightness(mc.thePlayer, partialTicks); + } + + blindness = 0.0F; + + if (mc.thePlayer.isPotionActive(Potion.blindness)) + { + int i = mc.thePlayer.getActivePotionEffect(Potion.blindness).getDuration(); + blindness = Config.limit((float)i / 20.0F, 0.0F, 1.0F); + } + } + + Vec3 vec3 = mc.theWorld.getSkyColor(entity, partialTicks); + vec3 = CustomColors.getWorldSkyColor(vec3, currentWorld, entity, partialTicks); + skyColorR = (float)vec3.xCoord; + skyColorG = (float)vec3.yCoord; + skyColorB = (float)vec3.zCoord; + } + + isRenderingWorld = true; + isCompositeRendered = false; + isShadowPass = false; + isHandRenderedMain = false; + isHandRenderedOff = false; + skipRenderHandMain = false; + skipRenderHandOff = false; + bindGbuffersTextures(); + previousCameraPositionX = cameraPositionX; + previousCameraPositionY = cameraPositionY; + previousCameraPositionZ = cameraPositionZ; + previousProjection.position(0); + projection.position(0); + previousProjection.put(projection); + previousProjection.position(0); + projection.position(0); + previousModelView.position(0); + modelView.position(0); + previousModelView.put(modelView); + previousModelView.position(0); + modelView.position(0); + checkGLError("beginRender"); + ShadersRender.renderShadowMap(entityRenderer, 0, partialTicks, finishTimeNano); + mc.mcProfiler.endSection(); + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + + for (int j = 0; j < usedColorBuffers; ++j) + { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + j, 3553, dfbColorTexturesFlip.getA(j), 0); + } + + checkGLError("end beginRender"); + } + + private static void bindGbuffersTextures() + { + if (usedShadowDepthBuffers >= 1) + { + GlStateManager.setActiveTexture(33988); + GlStateManager.bindTexture(sfbDepthTextures.get(0)); + + if (usedShadowDepthBuffers >= 2) + { + GlStateManager.setActiveTexture(33989); + GlStateManager.bindTexture(sfbDepthTextures.get(1)); + } + } + + GlStateManager.setActiveTexture(33984); + + for (int i = 0; i < usedColorBuffers; ++i) + { + GlStateManager.bindTexture(dfbColorTexturesFlip.getA(i)); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GlStateManager.bindTexture(dfbColorTexturesFlip.getB(i)); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + } + + GlStateManager.bindTexture(0); + + for (int j = 0; j < 4 && 4 + j < usedColorBuffers; ++j) + { + GlStateManager.setActiveTexture(33991 + j); + GlStateManager.bindTexture(dfbColorTexturesFlip.getA(4 + j)); + } + + GlStateManager.setActiveTexture(33990); + GlStateManager.bindTexture(dfbDepthTextures.get(0)); + + if (usedDepthBuffers >= 2) + { + GlStateManager.setActiveTexture(33995); + GlStateManager.bindTexture(dfbDepthTextures.get(1)); + + if (usedDepthBuffers >= 3) + { + GlStateManager.setActiveTexture(33996); + GlStateManager.bindTexture(dfbDepthTextures.get(2)); + } + } + + for (int k = 0; k < usedShadowColorBuffers; ++k) + { + GlStateManager.setActiveTexture(33997 + k); + GlStateManager.bindTexture(sfbColorTextures.get(k)); + } + + if (noiseTextureEnabled) + { + GlStateManager.setActiveTexture(33984 + noiseTexture.getTextureUnit()); + GlStateManager.bindTexture(noiseTexture.getTextureId()); + } + + bindCustomTextures(customTexturesGbuffers); + GlStateManager.setActiveTexture(33984); + } + + public static void checkWorldChanged(World world) + { + if (currentWorld != world) + { + World oldworld = currentWorld; + currentWorld = world; + setCameraOffset(mc.getRenderViewEntity()); + int i = getDimensionId(oldworld); + int j = getDimensionId(world); + + if (j != i) + { + boolean flag = shaderPackDimensions.contains(Integer.valueOf(i)); + boolean flag1 = shaderPackDimensions.contains(Integer.valueOf(j)); + + if (flag || flag1) + { + uninit(); + } + } + + Smoother.resetValues(); + } + } + + private static int getDimensionId(World world) + { + return world == null ? Integer.MIN_VALUE : world.provider.getDimensionId(); + } + + public static void beginRenderPass(int pass, float partialTicks, long finishTimeNano) + { + if (!isShadowPass) + { + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + GL11.glViewport(0, 0, renderWidth, renderHeight); + activeDrawBuffers = null; + ShadersTex.bindNSTextures(defaultTexture.getMultiTexID()); + useProgram(ProgramTextured); + checkGLError("end beginRenderPass"); + } + } + + public static void setViewport(int vx, int vy, int vw, int vh) + { + GlStateManager.colorMask(true, true, true, true); + + if (isShadowPass) + { + GL11.glViewport(0, 0, shadowMapWidth, shadowMapHeight); + } + else + { + GL11.glViewport(0, 0, renderWidth, renderHeight); + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + isRenderingDfb = true; + GlStateManager.enableCull(); + GlStateManager.enableDepth(); + setDrawBuffers(drawBuffersNone); + useProgram(ProgramTextured); + checkGLError("beginRenderPass"); + } + } + + public static void setFogMode(int value) + { + fogMode = value; + + if (fogEnabled) + { + setProgramUniform1i(uniform_fogMode, value); + } + } + + public static void setFogColor(float r, float g, float b) + { + fogColorR = r; + fogColorG = g; + fogColorB = b; + setProgramUniform3f(uniform_fogColor, fogColorR, fogColorG, fogColorB); + } + + public static void setClearColor(float red, float green, float blue, float alpha) + { + GlStateManager.clearColor(red, green, blue, alpha); + clearColorR = red; + clearColorG = green; + clearColorB = blue; + } + + public static void clearRenderBuffer() + { + if (isShadowPass) + { + checkGLError("shadow clear pre"); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0); + GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F); + GL20.glDrawBuffers(ProgramShadow.getDrawBuffers()); + checkFramebufferStatus("shadow clear"); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + checkGLError("shadow clear"); + } + else + { + checkGLError("clear pre"); + + if (gbuffersClear[0]) + { + Vector4f vector4f = gbuffersClearColor[0]; + + if (vector4f != null) + { + GL11.glClearColor(vector4f.getX(), vector4f.getY(), vector4f.getZ(), vector4f.getW()); + } + + if (dfbColorTexturesFlip.isChanged(0)) + { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064, 3553, dfbColorTexturesFlip.getB(0), 0); + GL20.glDrawBuffers(36064); + GL11.glClear(16384); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064, 3553, dfbColorTexturesFlip.getA(0), 0); + } + + GL20.glDrawBuffers(36064); + GL11.glClear(16384); + } + + if (gbuffersClear[1]) + { + GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F); + Vector4f vector4f2 = gbuffersClearColor[1]; + + if (vector4f2 != null) + { + GL11.glClearColor(vector4f2.getX(), vector4f2.getY(), vector4f2.getZ(), vector4f2.getW()); + } + + if (dfbColorTexturesFlip.isChanged(1)) + { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36065, 3553, dfbColorTexturesFlip.getB(1), 0); + GL20.glDrawBuffers(36065); + GL11.glClear(16384); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36065, 3553, dfbColorTexturesFlip.getA(1), 0); + } + + GL20.glDrawBuffers(36065); + GL11.glClear(16384); + } + + for (int i = 2; i < usedColorBuffers; ++i) + { + if (gbuffersClear[i]) + { + GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F); + Vector4f vector4f1 = gbuffersClearColor[i]; + + if (vector4f1 != null) + { + GL11.glClearColor(vector4f1.getX(), vector4f1.getY(), vector4f1.getZ(), vector4f1.getW()); + } + + if (dfbColorTexturesFlip.isChanged(i)) + { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + i, 3553, dfbColorTexturesFlip.getB(i), 0); + GL20.glDrawBuffers(36064 + i); + GL11.glClear(16384); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + i, 3553, dfbColorTexturesFlip.getA(i), 0); + } + + GL20.glDrawBuffers(36064 + i); + GL11.glClear(16384); + } + } + + setDrawBuffers(dfbDrawBuffers); + checkFramebufferStatus("clear"); + checkGLError("clear"); + } + } + + public static void setCamera(float partialTicks) + { + Entity entity = mc.getRenderViewEntity(); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks; + updateCameraOffset(entity); + cameraPositionX = d0 - (double)cameraOffsetX; + cameraPositionY = d1; + cameraPositionZ = d2 - (double)cameraOffsetZ; + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, (FloatBuffer)projection.position(0)); + SMath.invertMat4FBFA((FloatBuffer)projectionInverse.position(0), (FloatBuffer)projection.position(0), faProjectionInverse, faProjection); + projection.position(0); + projectionInverse.position(0); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)modelView.position(0)); + SMath.invertMat4FBFA((FloatBuffer)modelViewInverse.position(0), (FloatBuffer)modelView.position(0), faModelViewInverse, faModelView); + modelView.position(0); + modelViewInverse.position(0); + checkGLError("setCamera"); + } + + private static void updateCameraOffset(Entity viewEntity) + { + double d0 = Math.abs(cameraPositionX - previousCameraPositionX); + double d1 = Math.abs(cameraPositionZ - previousCameraPositionZ); + double d2 = Math.abs(cameraPositionX); + double d3 = Math.abs(cameraPositionZ); + + if (d0 > 1000.0D || d1 > 1000.0D || d2 > 1000000.0D || d3 > 1000000.0D) + { + setCameraOffset(viewEntity); + } + } + + private static void setCameraOffset(Entity viewEntity) + { + if (viewEntity == null) + { + cameraOffsetX = 0; + cameraOffsetZ = 0; + } + else + { + cameraOffsetX = (int)viewEntity.posX / 1000 * 1000; + cameraOffsetZ = (int)viewEntity.posZ / 1000 * 1000; + } + } + + public static void setCameraShadow(float partialTicks) + { + Entity entity = mc.getRenderViewEntity(); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks; + updateCameraOffset(entity); + cameraPositionX = d0 - (double)cameraOffsetX; + cameraPositionY = d1; + cameraPositionZ = d2 - (double)cameraOffsetZ; + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, (FloatBuffer)projection.position(0)); + SMath.invertMat4FBFA((FloatBuffer)projectionInverse.position(0), (FloatBuffer)projection.position(0), faProjectionInverse, faProjection); + projection.position(0); + projectionInverse.position(0); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)modelView.position(0)); + SMath.invertMat4FBFA((FloatBuffer)modelViewInverse.position(0), (FloatBuffer)modelView.position(0), faModelViewInverse, faModelView); + modelView.position(0); + modelViewInverse.position(0); + GL11.glViewport(0, 0, shadowMapWidth, shadowMapHeight); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + + if (shadowMapIsOrtho) + { + GL11.glOrtho((double)(-shadowMapHalfPlane), (double)shadowMapHalfPlane, (double)(-shadowMapHalfPlane), (double)shadowMapHalfPlane, 0.05000000074505806D, 256.0D); + } + else + { + GLU.gluPerspective(shadowMapFOV, (float)shadowMapWidth / (float)shadowMapHeight, 0.05F, 256.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -100.0F); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + celestialAngle = mc.theWorld.getCelestialAngle(partialTicks); + sunAngle = celestialAngle < 0.75F ? celestialAngle + 0.25F : celestialAngle - 0.75F; + float f = celestialAngle * -360.0F; + float f1 = shadowAngleInterval > 0.0F ? f % shadowAngleInterval - shadowAngleInterval * 0.5F : 0.0F; + + if ((double)sunAngle <= 0.5D) + { + GL11.glRotatef(f - f1, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(sunPathRotation, 1.0F, 0.0F, 0.0F); + shadowAngle = sunAngle; + } + else + { + GL11.glRotatef(f + 180.0F - f1, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(sunPathRotation, 1.0F, 0.0F, 0.0F); + shadowAngle = sunAngle - 0.5F; + } + + if (shadowMapIsOrtho) + { + float f2 = shadowIntervalSize; + float f3 = f2 / 2.0F; + GL11.glTranslatef((float)d0 % f2 - f3, (float)d1 % f2 - f3, (float)d2 % f2 - f3); + } + + float f9 = sunAngle * ((float)Math.PI * 2F); + float f10 = (float)Math.cos((double)f9); + float f4 = (float)Math.sin((double)f9); + float f5 = sunPathRotation * ((float)Math.PI * 2F); + float f6 = f10; + float f7 = f4 * (float)Math.cos((double)f5); + float f8 = f4 * (float)Math.sin((double)f5); + + if ((double)sunAngle > 0.5D) + { + f6 = -f10; + f7 = -f7; + f8 = -f8; + } + + shadowLightPositionVector[0] = f6; + shadowLightPositionVector[1] = f7; + shadowLightPositionVector[2] = f8; + shadowLightPositionVector[3] = 0.0F; + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, (FloatBuffer)shadowProjection.position(0)); + SMath.invertMat4FBFA((FloatBuffer)shadowProjectionInverse.position(0), (FloatBuffer)shadowProjection.position(0), faShadowProjectionInverse, faShadowProjection); + shadowProjection.position(0); + shadowProjectionInverse.position(0); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)shadowModelView.position(0)); + SMath.invertMat4FBFA((FloatBuffer)shadowModelViewInverse.position(0), (FloatBuffer)shadowModelView.position(0), faShadowModelViewInverse, faShadowModelView); + shadowModelView.position(0); + shadowModelViewInverse.position(0); + setProgramUniformMatrix4ARB(uniform_gbufferProjection, false, projection); + setProgramUniformMatrix4ARB(uniform_gbufferProjectionInverse, false, projectionInverse); + setProgramUniformMatrix4ARB(uniform_gbufferPreviousProjection, false, previousProjection); + setProgramUniformMatrix4ARB(uniform_gbufferModelView, false, modelView); + setProgramUniformMatrix4ARB(uniform_gbufferModelViewInverse, false, modelViewInverse); + setProgramUniformMatrix4ARB(uniform_gbufferPreviousModelView, false, previousModelView); + setProgramUniformMatrix4ARB(uniform_shadowProjection, false, shadowProjection); + setProgramUniformMatrix4ARB(uniform_shadowProjectionInverse, false, shadowProjectionInverse); + setProgramUniformMatrix4ARB(uniform_shadowModelView, false, shadowModelView); + setProgramUniformMatrix4ARB(uniform_shadowModelViewInverse, false, shadowModelViewInverse); + mc.gameSettings.thirdPersonView = 1; + checkGLError("setCamera"); + } + + public static void preCelestialRotate() + { + GL11.glRotatef(sunPathRotation * 1.0F, 0.0F, 0.0F, 1.0F); + checkGLError("preCelestialRotate"); + } + + public static void postCelestialRotate() + { + FloatBuffer floatbuffer = tempMatrixDirectBuffer; + floatbuffer.clear(); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, floatbuffer); + floatbuffer.get(tempMat, 0, 16); + SMath.multiplyMat4xVec4(sunPosition, tempMat, sunPosModelView); + SMath.multiplyMat4xVec4(moonPosition, tempMat, moonPosModelView); + System.arraycopy(shadowAngle == sunAngle ? sunPosition : moonPosition, 0, shadowLightPosition, 0, 3); + setProgramUniform3f(uniform_sunPosition, sunPosition[0], sunPosition[1], sunPosition[2]); + setProgramUniform3f(uniform_moonPosition, moonPosition[0], moonPosition[1], moonPosition[2]); + setProgramUniform3f(uniform_shadowLightPosition, shadowLightPosition[0], shadowLightPosition[1], shadowLightPosition[2]); + + if (customUniforms != null) + { + customUniforms.update(); + } + + checkGLError("postCelestialRotate"); + } + + public static void setUpPosition() + { + FloatBuffer floatbuffer = tempMatrixDirectBuffer; + floatbuffer.clear(); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, floatbuffer); + floatbuffer.get(tempMat, 0, 16); + SMath.multiplyMat4xVec4(upPosition, tempMat, upPosModelView); + setProgramUniform3f(uniform_upPosition, upPosition[0], upPosition[1], upPosition[2]); + + if (customUniforms != null) + { + customUniforms.update(); + } + } + + public static void genCompositeMipmap() + { + if (hasGlGenMipmap) + { + for (int i = 0; i < usedColorBuffers; ++i) + { + if ((activeCompositeMipmapSetting & 1 << i) != 0) + { + GlStateManager.setActiveTexture(33984 + colorTextureImageUnit[i]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR); + GL30.glGenerateMipmap(3553); + } + } + + GlStateManager.setActiveTexture(33984); + } + } + + public static void drawComposite() + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + drawCompositeQuad(); + int i = activeProgram.getCountInstances(); + + if (i > 1) + { + for (int j = 1; j < i; ++j) + { + uniform_instanceId.setValue(j); + drawCompositeQuad(); + } + + uniform_instanceId.setValue(0); + } + } + + private static void drawCompositeQuad() + { + if (!canRenderQuads()) + { + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f(0.0F, 0.0F); + GL11.glVertex3f(0.0F, 0.0F, 0.0F); + GL11.glTexCoord2f(1.0F, 0.0F); + GL11.glVertex3f(1.0F, 0.0F, 0.0F); + GL11.glTexCoord2f(0.0F, 1.0F); + GL11.glVertex3f(0.0F, 1.0F, 0.0F); + GL11.glTexCoord2f(1.0F, 1.0F); + GL11.glVertex3f(1.0F, 1.0F, 0.0F); + GL11.glEnd(); + } + else + { + GL11.glBegin(GL11.GL_QUADS); + GL11.glTexCoord2f(0.0F, 0.0F); + GL11.glVertex3f(0.0F, 0.0F, 0.0F); + GL11.glTexCoord2f(1.0F, 0.0F); + GL11.glVertex3f(1.0F, 0.0F, 0.0F); + GL11.glTexCoord2f(1.0F, 1.0F); + GL11.glVertex3f(1.0F, 1.0F, 0.0F); + GL11.glTexCoord2f(0.0F, 1.0F); + GL11.glVertex3f(0.0F, 1.0F, 0.0F); + GL11.glEnd(); + } + } + + public static void renderDeferred() + { + if (!isShadowPass) + { + boolean flag = checkBufferFlip(ProgramDeferredPre); + + if (hasDeferredPrograms) + { + checkGLError("pre-render Deferred"); + renderComposites(ProgramsDeferred, false); + flag = true; + } + + if (flag) + { + bindGbuffersTextures(); + + for (int i = 0; i < usedColorBuffers; ++i) + { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + i, 3553, dfbColorTexturesFlip.getA(i), 0); + } + + if (ProgramWater.getDrawBuffers() != null) + { + setDrawBuffers(ProgramWater.getDrawBuffers()); + } + else + { + setDrawBuffers(dfbDrawBuffers); + } + + GlStateManager.setActiveTexture(33984); + mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + } + } + } + + public static void renderCompositeFinal() + { + if (!isShadowPass) + { + checkBufferFlip(ProgramCompositePre); + checkGLError("pre-render CompositeFinal"); + renderComposites(ProgramsComposite, true); + } + } + + private static boolean checkBufferFlip(Program program) + { + boolean flag = false; + Boolean[] aboolean = program.getBuffersFlip(); + + for (int i = 0; i < usedColorBuffers; ++i) + { + if (Config.isTrue(aboolean[i])) + { + dfbColorTexturesFlip.flip(i); + flag = true; + } + } + + return flag; + } + + private static void renderComposites(Program[] ps, boolean renderFinal) + { + if (!isShadowPass) + { + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, 1.0D, 0.0D, 1.0D, 0.0D, 1.0D); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(519); + GlStateManager.depthMask(false); + GlStateManager.disableLighting(); + + if (usedShadowDepthBuffers >= 1) + { + GlStateManager.setActiveTexture(33988); + GlStateManager.bindTexture(sfbDepthTextures.get(0)); + + if (usedShadowDepthBuffers >= 2) + { + GlStateManager.setActiveTexture(33989); + GlStateManager.bindTexture(sfbDepthTextures.get(1)); + } + } + + for (int i = 0; i < usedColorBuffers; ++i) + { + GlStateManager.setActiveTexture(33984 + colorTextureImageUnit[i]); + GlStateManager.bindTexture(dfbColorTexturesFlip.getA(i)); + } + + GlStateManager.setActiveTexture(33990); + GlStateManager.bindTexture(dfbDepthTextures.get(0)); + + if (usedDepthBuffers >= 2) + { + GlStateManager.setActiveTexture(33995); + GlStateManager.bindTexture(dfbDepthTextures.get(1)); + + if (usedDepthBuffers >= 3) + { + GlStateManager.setActiveTexture(33996); + GlStateManager.bindTexture(dfbDepthTextures.get(2)); + } + } + + for (int k = 0; k < usedShadowColorBuffers; ++k) + { + GlStateManager.setActiveTexture(33997 + k); + GlStateManager.bindTexture(sfbColorTextures.get(k)); + } + + if (noiseTextureEnabled) + { + GlStateManager.setActiveTexture(33984 + noiseTexture.getTextureUnit()); + GlStateManager.bindTexture(noiseTexture.getTextureId()); + } + + if (renderFinal) + { + bindCustomTextures(customTexturesComposite); + } + else + { + bindCustomTextures(customTexturesDeferred); + } + + GlStateManager.setActiveTexture(33984); + + for (int l = 0; l < usedColorBuffers; ++l) + { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + l, 3553, dfbColorTexturesFlip.getB(l), 0); + } + + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, dfbDepthTextures.get(0), 0); + GL20.glDrawBuffers(dfbDrawBuffers); + checkGLError("pre-composite"); + + for (int i1 = 0; i1 < ps.length; ++i1) + { + Program program = ps[i1]; + + if (program.getId() != 0) + { + useProgram(program); + checkGLError(program.getName()); + + if (activeCompositeMipmapSetting != 0) + { + genCompositeMipmap(); + } + + preDrawComposite(); + drawComposite(); + postDrawComposite(); + + for (int j = 0; j < usedColorBuffers; ++j) + { + if (program.getToggleColorTextures()[j]) + { + dfbColorTexturesFlip.flip(j); + GlStateManager.setActiveTexture(33984 + colorTextureImageUnit[j]); + GlStateManager.bindTexture(dfbColorTexturesFlip.getA(j)); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + j, 3553, dfbColorTexturesFlip.getB(j), 0); + } + } + + GlStateManager.setActiveTexture(33984); + } + } + + checkGLError("composite"); + + if (renderFinal) + { + renderFinal(); + isCompositeRendered = true; + } + + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + useProgram(ProgramNone); + } + } + + private static void preDrawComposite() + { + RenderScale renderscale = activeProgram.getRenderScale(); + + if (renderscale != null) + { + int i = (int)((float)renderWidth * renderscale.getOffsetX()); + int j = (int)((float)renderHeight * renderscale.getOffsetY()); + int k = (int)((float)renderWidth * renderscale.getScale()); + int l = (int)((float)renderHeight * renderscale.getScale()); + GL11.glViewport(i, j, k, l); + } + } + + private static void postDrawComposite() + { + RenderScale renderscale = activeProgram.getRenderScale(); + + if (renderscale != null) + { + GL11.glViewport(0, 0, renderWidth, renderHeight); + } + } + + private static void renderFinal() + { + isRenderingDfb = false; + mc.getFramebuffer().bindFramebuffer(true); + OpenGlHelper.glFramebufferTexture2D(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_COLOR_ATTACHMENT0, 3553, mc.getFramebuffer().framebufferTexture, 0); + GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight); + + if (EntityRenderer.anaglyphEnable) + { + boolean flag = EntityRenderer.anaglyphField != 0; + GlStateManager.colorMask(flag, !flag, !flag, true); + } + + GlStateManager.depthMask(true); + GL11.glClearColor(clearColorR, clearColorG, clearColorB, 1.0F); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(519); + GlStateManager.depthMask(false); + checkGLError("pre-final"); + useProgram(ProgramFinal); + checkGLError("final"); + + if (activeCompositeMipmapSetting != 0) + { + genCompositeMipmap(); + } + + drawComposite(); + checkGLError("renderCompositeFinal"); + } + + public static void endRender() + { + if (isShadowPass) + { + checkGLError("shadow endRender"); + } + else + { + if (!isCompositeRendered) + { + renderCompositeFinal(); + } + + isRenderingWorld = false; + GlStateManager.colorMask(true, true, true, true); + useProgram(ProgramNone); + RenderHelper.disableStandardItemLighting(); + checkGLError("endRender end"); + } + } + + public static void beginSky() + { + isRenderingSky = true; + fogEnabled = true; + setDrawBuffers(dfbDrawBuffers); + useProgram(ProgramSkyTextured); + pushEntity(-2, 0); + } + + public static void setSkyColor(Vec3 v3color) + { + skyColorR = (float)v3color.xCoord; + skyColorG = (float)v3color.yCoord; + skyColorB = (float)v3color.zCoord; + setProgramUniform3f(uniform_skyColor, skyColorR, skyColorG, skyColorB); + } + + public static void drawHorizon() + { + WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); + float f = (float)(mc.gameSettings.renderDistanceChunks * 16); + double d0 = (double)f * 0.9238D; + double d1 = (double)f * 0.3826D; + double d2 = -d1; + double d3 = -d0; + double d4 = 16.0D; + double d5 = -cameraPositionY; + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(d2, d5, d3).endVertex(); + worldrenderer.pos(d2, d4, d3).endVertex(); + worldrenderer.pos(d3, d4, d2).endVertex(); + worldrenderer.pos(d3, d5, d2).endVertex(); + worldrenderer.pos(d3, d5, d2).endVertex(); + worldrenderer.pos(d3, d4, d2).endVertex(); + worldrenderer.pos(d3, d4, d1).endVertex(); + worldrenderer.pos(d3, d5, d1).endVertex(); + worldrenderer.pos(d3, d5, d1).endVertex(); + worldrenderer.pos(d3, d4, d1).endVertex(); + worldrenderer.pos(d2, d4, d0).endVertex(); + worldrenderer.pos(d2, d5, d0).endVertex(); + worldrenderer.pos(d2, d5, d0).endVertex(); + worldrenderer.pos(d2, d4, d0).endVertex(); + worldrenderer.pos(d1, d4, d0).endVertex(); + worldrenderer.pos(d1, d5, d0).endVertex(); + worldrenderer.pos(d1, d5, d0).endVertex(); + worldrenderer.pos(d1, d4, d0).endVertex(); + worldrenderer.pos(d0, d4, d1).endVertex(); + worldrenderer.pos(d0, d5, d1).endVertex(); + worldrenderer.pos(d0, d5, d1).endVertex(); + worldrenderer.pos(d0, d4, d1).endVertex(); + worldrenderer.pos(d0, d4, d2).endVertex(); + worldrenderer.pos(d0, d5, d2).endVertex(); + worldrenderer.pos(d0, d5, d2).endVertex(); + worldrenderer.pos(d0, d4, d2).endVertex(); + worldrenderer.pos(d1, d4, d3).endVertex(); + worldrenderer.pos(d1, d5, d3).endVertex(); + worldrenderer.pos(d1, d5, d3).endVertex(); + worldrenderer.pos(d1, d4, d3).endVertex(); + worldrenderer.pos(d2, d4, d3).endVertex(); + worldrenderer.pos(d2, d5, d3).endVertex(); + worldrenderer.pos(d3, d5, d3).endVertex(); + worldrenderer.pos(d3, d5, d0).endVertex(); + worldrenderer.pos(d0, d5, d0).endVertex(); + worldrenderer.pos(d0, d5, d3).endVertex(); + Tessellator.getInstance().draw(); + } + + public static void preSkyList() + { + setUpPosition(); + GL11.glColor3f(fogColorR, fogColorG, fogColorB); + drawHorizon(); + GL11.glColor3f(skyColorR, skyColorG, skyColorB); + } + + public static void endSky() + { + isRenderingSky = false; + setDrawBuffers(dfbDrawBuffers); + useProgram(lightmapEnabled ? ProgramTexturedLit : ProgramTextured); + popEntity(); + } + + public static void beginUpdateChunks() + { + checkGLError("beginUpdateChunks1"); + checkFramebufferStatus("beginUpdateChunks1"); + + if (!isShadowPass) + { + useProgram(ProgramTerrain); + } + + checkGLError("beginUpdateChunks2"); + checkFramebufferStatus("beginUpdateChunks2"); + } + + public static void endUpdateChunks() + { + checkGLError("endUpdateChunks1"); + checkFramebufferStatus("endUpdateChunks1"); + + if (!isShadowPass) + { + useProgram(ProgramTerrain); + } + + checkGLError("endUpdateChunks2"); + checkFramebufferStatus("endUpdateChunks2"); + } + + public static boolean shouldRenderClouds(GameSettings gs) + { + if (!shaderPackLoaded) + { + return true; + } + else + { + checkGLError("shouldRenderClouds"); + return isShadowPass ? configCloudShadow : gs.clouds > 0; + } + } + + public static void beginClouds() + { + fogEnabled = true; + pushEntity(-3, 0); + useProgram(ProgramClouds); + } + + public static void endClouds() + { + disableFog(); + popEntity(); + useProgram(lightmapEnabled ? ProgramTexturedLit : ProgramTextured); + } + + public static void beginEntities() + { + if (isRenderingWorld) + { + useProgram(ProgramEntities); + } + } + + public static void nextEntity(Entity entity) + { + if (isRenderingWorld) + { + useProgram(ProgramEntities); + setEntityId(entity); + } + } + + public static void setEntityId(Entity entity) + { + if (uniform_entityId.isDefined()) + { + int i = EntityUtils.getEntityIdByClass(entity); + int j = EntityAliases.getEntityAliasId(i); + + if (j >= 0) + { + i = j; + } + + uniform_entityId.setValue(i); + } + } + + public static void beginSpiderEyes() + { + if (isRenderingWorld && ProgramSpiderEyes.getId() != ProgramNone.getId()) + { + useProgram(ProgramSpiderEyes); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.0F); + GlStateManager.blendFunc(770, 771); + } + } + + public static void endSpiderEyes() + { + if (isRenderingWorld && ProgramSpiderEyes.getId() != ProgramNone.getId()) + { + useProgram(ProgramEntities); + GlStateManager.disableAlpha(); + } + } + + public static void endEntities() + { + if (isRenderingWorld) + { + setEntityId((Entity)null); + useProgram(lightmapEnabled ? ProgramTexturedLit : ProgramTextured); + } + } + + public static void beginEntitiesGlowing() + { + if (isRenderingWorld) + { + isEntitiesGlowing = true; + } + } + + public static void endEntitiesGlowing() + { + if (isRenderingWorld) + { + isEntitiesGlowing = false; + } + } + + public static void setEntityColor(float r, float g, float b, float a) + { + if (isRenderingWorld && !isShadowPass) + { + uniform_entityColor.setValue(r, g, b, a); + } + } + + public static void beginLivingDamage() + { + if (isRenderingWorld) + { + ShadersTex.bindTexture(defaultTexture); + + if (!isShadowPass) + { + setDrawBuffers(drawBuffersColorAtt0); + } + } + } + + public static void endLivingDamage() + { + if (isRenderingWorld && !isShadowPass) + { + setDrawBuffers(ProgramEntities.getDrawBuffers()); + } + } + + public static void beginBlockEntities() + { + if (isRenderingWorld) + { + checkGLError("beginBlockEntities"); + useProgram(ProgramBlock); + } + } + + public static void nextBlockEntity(TileEntity tileEntity) + { + if (isRenderingWorld) + { + checkGLError("nextBlockEntity"); + useProgram(ProgramBlock); + setBlockEntityId(tileEntity); + } + } + + public static void setBlockEntityId(TileEntity tileEntity) + { + if (uniform_blockEntityId.isDefined()) + { + int i = getBlockEntityId(tileEntity); + uniform_blockEntityId.setValue(i); + } + } + + private static int getBlockEntityId(TileEntity tileEntity) + { + if (tileEntity == null) + { + return -1; + } + else + { + Block block = tileEntity.getBlockType(); + + if (block == null) + { + return 0; + } + else + { + int i = Block.getIdFromBlock(block); + int j = tileEntity.getBlockMetadata(); + int k = BlockAliases.getBlockAliasId(i, j); + + if (k >= 0) + { + i = k; + } + + return i; + } + } + } + + public static void endBlockEntities() + { + if (isRenderingWorld) + { + checkGLError("endBlockEntities"); + setBlockEntityId((TileEntity)null); + useProgram(lightmapEnabled ? ProgramTexturedLit : ProgramTextured); + ShadersTex.bindNSTextures(defaultTexture.getMultiTexID()); + } + } + + public static void beginLitParticles() + { + useProgram(ProgramTexturedLit); + } + + public static void beginParticles() + { + useProgram(ProgramTextured); + } + + public static void endParticles() + { + useProgram(ProgramTexturedLit); + } + + public static void readCenterDepth() + { + if (!isShadowPass && centerDepthSmoothEnabled) + { + tempDirectFloatBuffer.clear(); + GL11.glReadPixels(renderWidth / 2, renderHeight / 2, 1, 1, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)tempDirectFloatBuffer); + centerDepth = tempDirectFloatBuffer.get(0); + float f = (float)diffSystemTime * 0.01F; + float f1 = (float)Math.exp(Math.log(0.5D) * (double)f / (double)centerDepthSmoothHalflife); + centerDepthSmooth = centerDepthSmooth * f1 + centerDepth * (1.0F - f1); + } + } + + public static void beginWeather() + { + if (!isShadowPass) + { + if (usedDepthBuffers >= 3) + { + GlStateManager.setActiveTexture(33996); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, renderWidth, renderHeight); + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.enableDepth(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.enableAlpha(); + useProgram(ProgramWeather); + } + } + + public static void endWeather() + { + GlStateManager.disableBlend(); + useProgram(ProgramTexturedLit); + } + + public static void preWater() + { + if (usedDepthBuffers >= 2) + { + GlStateManager.setActiveTexture(33995); + checkGLError("pre copy depth"); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, renderWidth, renderHeight); + checkGLError("copy depth"); + GlStateManager.setActiveTexture(33984); + } + + ShadersTex.bindNSTextures(defaultTexture.getMultiTexID()); + } + + public static void beginWater() + { + if (isRenderingWorld) + { + if (!isShadowPass) + { + renderDeferred(); + useProgram(ProgramWater); + GlStateManager.enableBlend(); + GlStateManager.depthMask(true); + } + else + { + GlStateManager.depthMask(true); + } + } + } + + public static void endWater() + { + if (isRenderingWorld) + { + if (isShadowPass) + { + ; + } + + useProgram(lightmapEnabled ? ProgramTexturedLit : ProgramTextured); + } + } + + public static void applyHandDepth() + { + if ((double)configHandDepthMul != 1.0D) + { + GL11.glScaled(1.0D, 1.0D, (double)configHandDepthMul); + } + } + + public static void beginHand(boolean translucent) + { + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + + if (translucent) + { + useProgram(ProgramHandWater); + } + else + { + useProgram(ProgramHand); + } + + checkGLError("beginHand"); + checkFramebufferStatus("beginHand"); + } + + public static void endHand() + { + checkGLError("pre endHand"); + checkFramebufferStatus("pre endHand"); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GlStateManager.blendFunc(770, 771); + checkGLError("endHand"); + } + + public static void beginFPOverlay() + { + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); + } + + public static void endFPOverlay() + { + } + + public static void glEnableWrapper(int cap) + { + GL11.glEnable(cap); + + if (cap == 3553) + { + enableTexture2D(); + } + else if (cap == 2912) + { + enableFog(); + } + } + + public static void glDisableWrapper(int cap) + { + GL11.glDisable(cap); + + if (cap == 3553) + { + disableTexture2D(); + } + else if (cap == 2912) + { + disableFog(); + } + } + + public static void sglEnableT2D(int cap) + { + GL11.glEnable(cap); + enableTexture2D(); + } + + public static void sglDisableT2D(int cap) + { + GL11.glDisable(cap); + disableTexture2D(); + } + + public static void sglEnableFog(int cap) + { + GL11.glEnable(cap); + enableFog(); + } + + public static void sglDisableFog(int cap) + { + GL11.glDisable(cap); + disableFog(); + } + + public static void enableTexture2D() + { + if (isRenderingSky) + { + useProgram(ProgramSkyTextured); + } + else if (activeProgram == ProgramBasic) + { + useProgram(lightmapEnabled ? ProgramTexturedLit : ProgramTextured); + } + } + + public static void disableTexture2D() + { + if (isRenderingSky) + { + useProgram(ProgramSkyBasic); + } + else if (activeProgram == ProgramTextured || activeProgram == ProgramTexturedLit) + { + useProgram(ProgramBasic); + } + } + + public static void pushProgram() + { + programStack.push(activeProgram); + } + + public static void popProgram() + { + Program program = programStack.pop(); + useProgram(program); + } + + public static void beginLeash() + { + pushProgram(); + useProgram(ProgramBasic); + } + + public static void endLeash() + { + popProgram(); + } + + public static void enableFog() + { + fogEnabled = true; + setProgramUniform1i(uniform_fogMode, fogMode); + setProgramUniform1f(uniform_fogDensity, fogDensity); + } + + public static void disableFog() + { + fogEnabled = false; + setProgramUniform1i(uniform_fogMode, 0); + } + + public static void setFogDensity(float value) + { + fogDensity = value; + + if (fogEnabled) + { + setProgramUniform1f(uniform_fogDensity, value); + } + } + + public static void sglFogi(int pname, int param) + { + GL11.glFogi(pname, param); + + if (pname == 2917) + { + fogMode = param; + + if (fogEnabled) + { + setProgramUniform1i(uniform_fogMode, fogMode); + } + } + } + + public static void enableLightmap() + { + lightmapEnabled = true; + + if (activeProgram == ProgramTextured) + { + useProgram(ProgramTexturedLit); + } + } + + public static void disableLightmap() + { + lightmapEnabled = false; + + if (activeProgram == ProgramTexturedLit) + { + useProgram(ProgramTextured); + } + } + + public static int getEntityData() + { + return entityData[entityDataIndex * 2]; + } + + public static int getEntityData2() + { + return entityData[entityDataIndex * 2 + 1]; + } + + public static int setEntityData1(int data1) + { + entityData[entityDataIndex * 2] = entityData[entityDataIndex * 2] & 65535 | data1 << 16; + return data1; + } + + public static int setEntityData2(int data2) + { + entityData[entityDataIndex * 2 + 1] = entityData[entityDataIndex * 2 + 1] & -65536 | data2 & 65535; + return data2; + } + + public static void pushEntity(int data0, int data1) + { + ++entityDataIndex; + entityData[entityDataIndex * 2] = data0 & 65535 | data1 << 16; + entityData[entityDataIndex * 2 + 1] = 0; + } + + public static void pushEntity(int data0) + { + ++entityDataIndex; + entityData[entityDataIndex * 2] = data0 & 65535; + entityData[entityDataIndex * 2 + 1] = 0; + } + + public static void pushEntity(Block block) + { + ++entityDataIndex; + int i = block.getRenderType(); + entityData[entityDataIndex * 2] = Block.blockRegistry.getIDForObject(block) & 65535 | i << 16; + entityData[entityDataIndex * 2 + 1] = 0; + } + + public static void popEntity() + { + entityData[entityDataIndex * 2] = 0; + entityData[entityDataIndex * 2 + 1] = 0; + --entityDataIndex; + } + + public static void mcProfilerEndSection() + { + mc.mcProfiler.endSection(); + } + + public static String getShaderPackName() + { + return shaderPack == null ? null : (shaderPack instanceof ShaderPackNone ? null : shaderPack.getName()); + } + + public static InputStream getShaderPackResourceStream(String path) + { + return shaderPack == null ? null : shaderPack.getResourceAsStream(path); + } + + public static void nextAntialiasingLevel(boolean forward) + { + if (forward) + { + configAntialiasingLevel += 2; + + if (configAntialiasingLevel > 4) + { + configAntialiasingLevel = 0; + } + } + else + { + configAntialiasingLevel -= 2; + + if (configAntialiasingLevel < 0) + { + configAntialiasingLevel = 4; + } + } + + configAntialiasingLevel = configAntialiasingLevel / 2 * 2; + configAntialiasingLevel = Config.limit(configAntialiasingLevel, 0, 4); + } + + public static void checkShadersModInstalled() + { + try + { + Class oclass = Class.forName("shadersmod.transform.SMCClassTransformer"); + } + catch (Throwable var1) + { + return; + } + + throw new RuntimeException("Shaders Mod detected. Please remove it, OptiFine has built-in support for shaders."); + } + + public static void resourcesReloaded() + { + loadShaderPackResources(); + + if (shaderPackLoaded) + { + BlockAliases.resourcesReloaded(); + ItemAliases.resourcesReloaded(); + EntityAliases.resourcesReloaded(); + } + } + + private static void loadShaderPackResources() + { + shaderPackResources = new HashMap(); + + if (shaderPackLoaded) + { + List list = new ArrayList(); + String s = "/shaders/lang/"; + String s1 = "en_US"; + String s2 = ".lang"; + list.add(s + s1 + s2); + + if (!Config.getGameSettings().language.equals(s1)) + { + list.add(s + Config.getGameSettings().language + s2); + } + + try + { + for (String s3 : list) + { + InputStream inputstream = shaderPack.getResourceAsStream(s3); + + if (inputstream != null) + { + Properties properties = new PropertiesOrdered(); + Lang.loadLocaleData(inputstream, properties); + inputstream.close(); + + for (Object o : properties.keySet()) + { + String s4 = (String)o; + String s5 = properties.getProperty(s4); + shaderPackResources.put(s4, s5); + } + } + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + } + + public static String translate(String key, String def) + { + String s = (String)shaderPackResources.get(key); + return s == null ? def : s; + } + + public static boolean isProgramPath(String path) + { + if (path == null) + { + return false; + } + else if (path.length() <= 0) + { + return false; + } + else + { + int i = path.lastIndexOf("/"); + + if (i >= 0) + { + path = path.substring(i + 1); + } + + Program program = getProgram(path); + return program != null; + } + } + + public static Program getProgram(String name) + { + return programs.getProgram(name); + } + + public static void setItemToRenderMain(ItemStack itemToRenderMain) + { + itemToRenderMainTranslucent = isTranslucentBlock(itemToRenderMain); + } + + public static void setItemToRenderOff(ItemStack itemToRenderOff) + { + itemToRenderOffTranslucent = isTranslucentBlock(itemToRenderOff); + } + + public static boolean isItemToRenderMainTranslucent() + { + return itemToRenderMainTranslucent; + } + + public static boolean isItemToRenderOffTranslucent() + { + return itemToRenderOffTranslucent; + } + + public static boolean isBothHandsRendered() + { + return isHandRenderedMain && isHandRenderedOff; + } + + private static boolean isTranslucentBlock(ItemStack stack) + { + if (stack == null) + { + return false; + } + else + { + Item item = stack.getItem(); + + if (item == null) + { + return false; + } + else if (!(item instanceof ItemBlock)) + { + return false; + } + else + { + ItemBlock itemblock = (ItemBlock)item; + Block block = itemblock.getBlock(); + + if (block == null) + { + return false; + } + else + { + EnumWorldBlockLayer enumworldblocklayer = block.getBlockLayer(); + return enumworldblocklayer == EnumWorldBlockLayer.TRANSLUCENT; + } + } + } + } + + public static boolean isSkipRenderHand() + { + return skipRenderHandMain; + } + + public static boolean isRenderBothHands() + { + return !skipRenderHandMain && !skipRenderHandOff; + } + + public static void setSkipRenderHands(boolean skipMain, boolean skipOff) + { + skipRenderHandMain = skipMain; + skipRenderHandOff = skipOff; + } + + public static void setHandsRendered(boolean handMain, boolean handOff) + { + isHandRenderedMain = handMain; + isHandRenderedOff = handOff; + } + + public static boolean isHandRenderedMain() + { + return isHandRenderedMain; + } + + public static boolean isHandRenderedOff() + { + return isHandRenderedOff; + } + + public static float getShadowRenderDistance() + { + return shadowDistanceRenderMul < 0.0F ? -1.0F : shadowMapHalfPlane * shadowDistanceRenderMul; + } + + public static void setRenderingFirstPersonHand(boolean flag) + { + isRenderingFirstPersonHand = flag; + } + + public static boolean isRenderingFirstPersonHand() + { + return isRenderingFirstPersonHand; + } + + public static void beginBeacon() + { + if (isRenderingWorld) + { + useProgram(ProgramBeaconBeam); + } + } + + public static void endBeacon() + { + if (isRenderingWorld) + { + useProgram(ProgramBlock); + } + } + + public static World getCurrentWorld() + { + return currentWorld; + } + + public static BlockPos getCameraPosition() + { + return new BlockPos(cameraPositionX, cameraPositionY, cameraPositionZ); + } + + public static boolean isCustomUniforms() + { + return customUniforms != null; + } + + public static boolean canRenderQuads() + { + return hasGeometryShaders ? capabilities.GL_NV_geometry_shader4 : true; + } + + static + { + shaderPacksDir = new File(Minecraft.getMinecraft().mcDataDir, "shaderpacks"); + configFile = new File(Minecraft.getMinecraft().mcDataDir, "optionsshaders.txt"); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShadersRender.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShadersRender.java new file mode 100644 index 0000000..39e094e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShadersRender.java @@ -0,0 +1,515 @@ +package net.optifine.shaders; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.ResourceLocation; +import net.optifine.reflect.Reflector; +import org.lwjgl.opengl.EXTFramebufferObject; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; +import org.lwjgl.opengl.GL30; + +import java.nio.IntBuffer; + +public class ShadersRender +{ + private static final ResourceLocation END_PORTAL_TEXTURE = new ResourceLocation("textures/entity/end_portal.png"); + + public static void setFrustrumPosition(ICamera frustum, double x, double y, double z) + { + frustum.setPosition(x, y, z); + } + + public static void setupTerrain(RenderGlobal renderGlobal, Entity viewEntity, double partialTicks, ICamera camera, int frameCount, boolean playerSpectator) + { + renderGlobal.setupTerrain(viewEntity, partialTicks, camera, frameCount, playerSpectator); + } + + public static void beginTerrainSolid() + { + if (Shaders.isRenderingWorld) + { + Shaders.fogEnabled = true; + Shaders.useProgram(Shaders.ProgramTerrain); + } + } + + public static void beginTerrainCutoutMipped() + { + if (Shaders.isRenderingWorld) + { + Shaders.useProgram(Shaders.ProgramTerrain); + } + } + + public static void beginTerrainCutout() + { + if (Shaders.isRenderingWorld) + { + Shaders.useProgram(Shaders.ProgramTerrain); + } + } + + public static void endTerrain() + { + if (Shaders.isRenderingWorld) + { + Shaders.useProgram(Shaders.ProgramTexturedLit); + } + } + + public static void beginTranslucent() + { + if (Shaders.isRenderingWorld) + { + if (Shaders.usedDepthBuffers >= 2) + { + GlStateManager.setActiveTexture(33995); + Shaders.checkGLError("pre copy depth"); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, Shaders.renderWidth, Shaders.renderHeight); + Shaders.checkGLError("copy depth"); + GlStateManager.setActiveTexture(33984); + } + + Shaders.useProgram(Shaders.ProgramWater); + } + } + + public static void endTranslucent() + { + if (Shaders.isRenderingWorld) + { + Shaders.useProgram(Shaders.ProgramTexturedLit); + } + } + + public static void renderHand0(EntityRenderer er, float par1, int par2) + { + if (!Shaders.isShadowPass) + { + boolean flag = Shaders.isItemToRenderMainTranslucent(); + boolean flag1 = Shaders.isItemToRenderOffTranslucent(); + + if (!flag || !flag1) + { + Shaders.readCenterDepth(); + Shaders.beginHand(false); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Shaders.setSkipRenderHands(flag, flag1); + er.renderHand(par1, par2, true, false, false); + Shaders.endHand(); + Shaders.setHandsRendered(!flag, !flag1); + Shaders.setSkipRenderHands(false, false); + } + } + } + + public static void renderHand1(EntityRenderer er, float par1, int par2) + { + if (!Shaders.isShadowPass && !Shaders.isBothHandsRendered()) + { + Shaders.readCenterDepth(); + GlStateManager.enableBlend(); + Shaders.beginHand(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Shaders.setSkipRenderHands(Shaders.isHandRenderedMain(), Shaders.isHandRenderedOff()); + er.renderHand(par1, par2, true, false, true); + Shaders.endHand(); + Shaders.setHandsRendered(true, true); + Shaders.setSkipRenderHands(false, false); + } + } + + public static void renderItemFP(ItemRenderer itemRenderer, float par1, boolean renderTranslucent) + { + Shaders.setRenderingFirstPersonHand(true); + GlStateManager.depthMask(true); + + if (renderTranslucent) + { + GlStateManager.depthFunc(519); + GL11.glPushMatrix(); + IntBuffer intbuffer = Shaders.activeDrawBuffers; + Shaders.setDrawBuffers(Shaders.drawBuffersNone); + Shaders.renderItemKeepDepthMask = true; + itemRenderer.renderItemInFirstPerson(par1); + Shaders.renderItemKeepDepthMask = false; + Shaders.setDrawBuffers(intbuffer); + GL11.glPopMatrix(); + } + + GlStateManager.depthFunc(515); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + itemRenderer.renderItemInFirstPerson(par1); + Shaders.setRenderingFirstPersonHand(false); + } + + public static void renderFPOverlay(EntityRenderer er, float par1, int par2) + { + if (!Shaders.isShadowPass) + { + Shaders.beginFPOverlay(); + er.renderHand(par1, par2, false, true, false); + Shaders.endFPOverlay(); + } + } + + public static void beginBlockDamage() + { + if (Shaders.isRenderingWorld) + { + Shaders.useProgram(Shaders.ProgramDamagedBlock); + + if (Shaders.ProgramDamagedBlock.getId() == Shaders.ProgramTerrain.getId()) + { + Shaders.setDrawBuffers(Shaders.drawBuffersColorAtt0); + GlStateManager.depthMask(false); + } + } + } + + public static void endBlockDamage() + { + if (Shaders.isRenderingWorld) + { + GlStateManager.depthMask(true); + Shaders.useProgram(Shaders.ProgramTexturedLit); + } + } + + public static void renderShadowMap(EntityRenderer entityRenderer, int pass, float partialTicks, long finishTimeNano) + { + if (Shaders.usedShadowDepthBuffers > 0 && --Shaders.shadowPassCounter <= 0) + { + Minecraft minecraft = Minecraft.getMinecraft(); + minecraft.mcProfiler.endStartSection("shadow pass"); + RenderGlobal renderglobal = minecraft.renderGlobal; + Shaders.isShadowPass = true; + Shaders.shadowPassCounter = Shaders.shadowPassInterval; + Shaders.preShadowPassThirdPersonView = minecraft.gameSettings.thirdPersonView; + minecraft.gameSettings.thirdPersonView = 1; + Shaders.checkGLError("pre shadow"); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + minecraft.mcProfiler.endStartSection("shadow clear"); + EXTFramebufferObject.glBindFramebufferEXT(36160, Shaders.sfb); + Shaders.checkGLError("shadow bind sfb"); + minecraft.mcProfiler.endStartSection("shadow camera"); + entityRenderer.setupCameraTransform(partialTicks, 2); + Shaders.setCameraShadow(partialTicks); + Shaders.checkGLError("shadow camera"); + Shaders.useProgram(Shaders.ProgramShadow); + GL20.glDrawBuffers(Shaders.sfbDrawBuffers); + Shaders.checkGLError("shadow drawbuffers"); + GL11.glReadBuffer(0); + Shaders.checkGLError("shadow readbuffer"); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, Shaders.sfbDepthTextures.get(0), 0); + + if (Shaders.usedShadowColorBuffers != 0) + { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064, 3553, Shaders.sfbColorTextures.get(0), 0); + } + + Shaders.checkFramebufferStatus("shadow fb"); + GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glClear(Shaders.usedShadowColorBuffers != 0 ? GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT : GL11.GL_DEPTH_BUFFER_BIT); + Shaders.checkGLError("shadow clear"); + minecraft.mcProfiler.endStartSection("shadow frustum"); + ClippingHelper clippinghelper = ClippingHelperShadow.getInstance(); + minecraft.mcProfiler.endStartSection("shadow culling"); + Frustum frustum = new Frustum(clippinghelper); + Entity entity = minecraft.getRenderViewEntity(); + double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; + double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; + double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks; + frustum.setPosition(d0, d1, d2); + GlStateManager.shadeModel(7425); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.disableCull(); + minecraft.mcProfiler.endStartSection("shadow prepareterrain"); + minecraft.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + minecraft.mcProfiler.endStartSection("shadow setupterrain"); + int i = 0; + i = entityRenderer.frameCount; + entityRenderer.frameCount = i + 1; + renderglobal.setupTerrain(entity, (double)partialTicks, frustum, i, minecraft.thePlayer.isSpectator()); + minecraft.mcProfiler.endStartSection("shadow updatechunks"); + minecraft.mcProfiler.endStartSection("shadow terrain"); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.disableAlpha(); + renderglobal.renderBlockLayer(EnumWorldBlockLayer.SOLID, (double)partialTicks, 2, entity); + Shaders.checkGLError("shadow terrain solid"); + GlStateManager.enableAlpha(); + renderglobal.renderBlockLayer(EnumWorldBlockLayer.CUTOUT_MIPPED, (double)partialTicks, 2, entity); + Shaders.checkGLError("shadow terrain cutoutmipped"); + minecraft.getTextureManager().getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false); + renderglobal.renderBlockLayer(EnumWorldBlockLayer.CUTOUT, (double)partialTicks, 2, entity); + Shaders.checkGLError("shadow terrain cutout"); + minecraft.getTextureManager().getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap(); + GlStateManager.shadeModel(7424); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + minecraft.mcProfiler.endStartSection("shadow entities"); + + if (Reflector.ForgeHooksClient_setRenderPass.exists()) + { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(0)}); + } + + renderglobal.renderEntities(entity, frustum, partialTicks); + Shaders.checkGLError("shadow entities"); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.alphaFunc(516, 0.1F); + + if (Shaders.usedShadowDepthBuffers >= 2) + { + GlStateManager.setActiveTexture(33989); + Shaders.checkGLError("pre copy shadow depth"); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, Shaders.shadowMapWidth, Shaders.shadowMapHeight); + Shaders.checkGLError("copy shadow depth"); + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + minecraft.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + GlStateManager.shadeModel(7425); + Shaders.checkGLError("shadow pre-translucent"); + GL20.glDrawBuffers(Shaders.sfbDrawBuffers); + Shaders.checkGLError("shadow drawbuffers pre-translucent"); + Shaders.checkFramebufferStatus("shadow pre-translucent"); + + if (Shaders.isRenderShadowTranslucent()) + { + minecraft.mcProfiler.endStartSection("shadow translucent"); + renderglobal.renderBlockLayer(EnumWorldBlockLayer.TRANSLUCENT, (double)partialTicks, 2, entity); + Shaders.checkGLError("shadow translucent"); + } + + if (Reflector.ForgeHooksClient_setRenderPass.exists()) + { + RenderHelper.enableStandardItemLighting(); + Reflector.call(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(1)}); + renderglobal.renderEntities(entity, frustum, partialTicks); + Reflector.call(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(-1)}); + RenderHelper.disableStandardItemLighting(); + Shaders.checkGLError("shadow entities 1"); + } + + GlStateManager.shadeModel(7424); + GlStateManager.depthMask(true); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GL11.glFlush(); + Shaders.checkGLError("shadow flush"); + Shaders.isShadowPass = false; + minecraft.gameSettings.thirdPersonView = Shaders.preShadowPassThirdPersonView; + minecraft.mcProfiler.endStartSection("shadow postprocess"); + + if (Shaders.hasGlGenMipmap) + { + if (Shaders.usedShadowDepthBuffers >= 1) + { + if (Shaders.shadowMipmapEnabled[0]) + { + GlStateManager.setActiveTexture(33988); + GlStateManager.bindTexture(Shaders.sfbDepthTextures.get(0)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowFilterNearest[0] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + if (Shaders.usedShadowDepthBuffers >= 2 && Shaders.shadowMipmapEnabled[1]) + { + GlStateManager.setActiveTexture(33989); + GlStateManager.bindTexture(Shaders.sfbDepthTextures.get(1)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowFilterNearest[1] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + GlStateManager.setActiveTexture(33984); + } + + if (Shaders.usedShadowColorBuffers >= 1) + { + if (Shaders.shadowColorMipmapEnabled[0]) + { + GlStateManager.setActiveTexture(33997); + GlStateManager.bindTexture(Shaders.sfbColorTextures.get(0)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowColorFilterNearest[0] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + if (Shaders.usedShadowColorBuffers >= 2 && Shaders.shadowColorMipmapEnabled[1]) + { + GlStateManager.setActiveTexture(33998); + GlStateManager.bindTexture(Shaders.sfbColorTextures.get(1)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowColorFilterNearest[1] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + GlStateManager.setActiveTexture(33984); + } + } + + Shaders.checkGLError("shadow postprocess"); + EXTFramebufferObject.glBindFramebufferEXT(36160, Shaders.dfb); + GL11.glViewport(0, 0, Shaders.renderWidth, Shaders.renderHeight); + Shaders.activeDrawBuffers = null; + minecraft.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + Shaders.useProgram(Shaders.ProgramTerrain); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + Shaders.checkGLError("shadow end"); + } + } + + public static void preRenderChunkLayer(EnumWorldBlockLayer blockLayerIn) + { + if (Shaders.isRenderBackFace(blockLayerIn)) + { + GlStateManager.disableCull(); + } + + if (OpenGlHelper.useVbo()) + { + GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib); + GL20.glEnableVertexAttribArray(Shaders.tangentAttrib); + GL20.glEnableVertexAttribArray(Shaders.entityAttrib); + } + } + + public static void postRenderChunkLayer(EnumWorldBlockLayer blockLayerIn) + { + if (OpenGlHelper.useVbo()) + { + GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib); + GL20.glDisableVertexAttribArray(Shaders.tangentAttrib); + GL20.glDisableVertexAttribArray(Shaders.entityAttrib); + } + + if (Shaders.isRenderBackFace(blockLayerIn)) + { + GlStateManager.enableCull(); + } + } + + public static void setupArrayPointersVbo() + { + int i = 14; + GL11.glVertexPointer(3, GL11.GL_FLOAT, 56, 0L); + GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 56, 12L); + GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 56, 16L); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glTexCoordPointer(2, GL11.GL_SHORT, 56, 24L); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + GL11.glNormalPointer(GL11.GL_BYTE, 56, 28L); + GL20.glVertexAttribPointer(Shaders.midTexCoordAttrib, 2, GL11.GL_FLOAT, false, 56, 32L); + GL20.glVertexAttribPointer(Shaders.tangentAttrib, 4, GL11.GL_SHORT, false, 56, 40L); + GL20.glVertexAttribPointer(Shaders.entityAttrib, 3, GL11.GL_SHORT, false, 56, 48L); + } + + public static void beaconBeamBegin() + { + Shaders.useProgram(Shaders.ProgramBeaconBeam); + } + + public static void beaconBeamStartQuad1() + { + } + + public static void beaconBeamStartQuad2() + { + } + + public static void beaconBeamDraw1() + { + } + + public static void beaconBeamDraw2() + { + GlStateManager.disableBlend(); + } + + public static void renderEnchantedGlintBegin() + { + Shaders.useProgram(Shaders.ProgramArmorGlint); + } + + public static void renderEnchantedGlintEnd() + { + if (Shaders.isRenderingWorld) + { + if (Shaders.isRenderingFirstPersonHand() && Shaders.isRenderBothHands()) + { + Shaders.useProgram(Shaders.ProgramHand); + } + else + { + Shaders.useProgram(Shaders.ProgramEntities); + } + } + else + { + Shaders.useProgram(Shaders.ProgramNone); + } + } + + public static boolean renderEndPortal(TileEntityEndPortal te, double x, double y, double z, float partialTicks, int destroyStage, float offset) + { + if (!Shaders.isShadowPass && Shaders.activeProgram.getId() == 0) + { + return false; + } + else + { + GlStateManager.disableLighting(); + Config.getTextureManager().bindTexture(END_PORTAL_TEXTURE); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.BLOCK); + float f = 0.5F; + float f1 = f * 0.15F; + float f2 = f * 0.3F; + float f3 = f * 0.4F; + float f4 = 0.0F; + float f5 = 0.2F; + float f6 = (float)(System.currentTimeMillis() % 100000L) / 100000.0F; + int i = 240; + worldrenderer.pos(x, y + (double)offset, z + 1.0D).color(f1, f2, f3, 1.0F).tex((double)(f4 + f6), (double)(f4 + f6)).lightmap(i, i).endVertex(); + worldrenderer.pos(x + 1.0D, y + (double)offset, z + 1.0D).color(f1, f2, f3, 1.0F).tex((double)(f4 + f6), (double)(f5 + f6)).lightmap(i, i).endVertex(); + worldrenderer.pos(x + 1.0D, y + (double)offset, z).color(f1, f2, f3, 1.0F).tex((double)(f5 + f6), (double)(f5 + f6)).lightmap(i, i).endVertex(); + worldrenderer.pos(x, y + (double)offset, z).color(f1, f2, f3, 1.0F).tex((double)(f5 + f6), (double)(f4 + f6)).lightmap(i, i).endVertex(); + tessellator.draw(); + GlStateManager.enableLighting(); + return true; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShadersTex.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShadersTex.java new file mode 100644 index 0000000..09a10ad --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShadersTex.java @@ -0,0 +1,953 @@ +package net.optifine.shaders; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.LayeredTexture; +import net.minecraft.client.renderer.texture.Stitcher; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class ShadersTex +{ + public static final int initialBufferSize = 1048576; + public static ByteBuffer byteBuffer = BufferUtils.createByteBuffer(4194304); + public static IntBuffer intBuffer = byteBuffer.asIntBuffer(); + public static int[] intArray = new int[1048576]; + public static final int defBaseTexColor = 0; + public static final int defNormTexColor = -8421377; + public static final int defSpecTexColor = 0; + public static Map multiTexMap = new HashMap(); + + public static IntBuffer getIntBuffer(int size) + { + if (intBuffer.capacity() < size) + { + int i = roundUpPOT(size); + byteBuffer = BufferUtils.createByteBuffer(i * 4); + intBuffer = byteBuffer.asIntBuffer(); + } + + return intBuffer; + } + + public static int[] getIntArray(int size) + { + if (intArray == null) + { + intArray = new int[1048576]; + } + + if (intArray.length < size) + { + intArray = new int[roundUpPOT(size)]; + } + + return intArray; + } + + public static int roundUpPOT(int x) + { + int i = x - 1; + i = i | i >> 1; + i = i | i >> 2; + i = i | i >> 4; + i = i | i >> 8; + i = i | i >> 16; + return i + 1; + } + + public static int log2(int x) + { + int i = 0; + + if ((x & -65536) != 0) + { + i += 16; + x >>= 16; + } + + if ((x & 65280) != 0) + { + i += 8; + x >>= 8; + } + + if ((x & 240) != 0) + { + i += 4; + x >>= 4; + } + + if ((x & 6) != 0) + { + i += 2; + x >>= 2; + } + + if ((x & 2) != 0) + { + ++i; + } + + return i; + } + + public static IntBuffer fillIntBuffer(int size, int value) + { + int[] aint = getIntArray(size); + IntBuffer intbuffer = getIntBuffer(size); + Arrays.fill((int[])intArray, 0, size, (int)value); + intBuffer.put(intArray, 0, size); + return intBuffer; + } + + public static int[] createAIntImage(int size) + { + int[] aint = new int[size * 3]; + Arrays.fill((int[])aint, 0, size, (int)0); + Arrays.fill(aint, size, size * 2, -8421377); + Arrays.fill((int[])aint, size * 2, size * 3, (int)0); + return aint; + } + + public static int[] createAIntImage(int size, int color) + { + int[] aint = new int[size * 3]; + Arrays.fill((int[])aint, 0, size, (int)color); + Arrays.fill(aint, size, size * 2, -8421377); + Arrays.fill((int[])aint, size * 2, size * 3, (int)0); + return aint; + } + + public static MultiTexID getMultiTexID(AbstractTexture tex) + { + MultiTexID multitexid = tex.multiTex; + + if (multitexid == null) + { + int i = tex.getGlTextureId(); + multitexid = (MultiTexID)multiTexMap.get(Integer.valueOf(i)); + + if (multitexid == null) + { + multitexid = new MultiTexID(i, GL11.glGenTextures(), GL11.glGenTextures()); + multiTexMap.put(Integer.valueOf(i), multitexid); + } + + tex.multiTex = multitexid; + } + + return multitexid; + } + + public static void deleteTextures(AbstractTexture atex, int texid) + { + MultiTexID multitexid = atex.multiTex; + + if (multitexid != null) + { + atex.multiTex = null; + multiTexMap.remove(Integer.valueOf(multitexid.base)); + GlStateManager.deleteTexture(multitexid.norm); + GlStateManager.deleteTexture(multitexid.spec); + + if (multitexid.base != texid) + { + SMCLog.warning("Error : MultiTexID.base mismatch: " + multitexid.base + ", texid: " + texid); + GlStateManager.deleteTexture(multitexid.base); + } + } + } + + public static void bindNSTextures(int normTex, int specTex) + { + if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984) + { + GlStateManager.setActiveTexture(33986); + GlStateManager.bindTexture(normTex); + GlStateManager.setActiveTexture(33987); + GlStateManager.bindTexture(specTex); + GlStateManager.setActiveTexture(33984); + } + } + + public static void bindNSTextures(MultiTexID multiTex) + { + bindNSTextures(multiTex.norm, multiTex.spec); + } + + public static void bindTextures(int baseTex, int normTex, int specTex) + { + if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984) + { + GlStateManager.setActiveTexture(33986); + GlStateManager.bindTexture(normTex); + GlStateManager.setActiveTexture(33987); + GlStateManager.bindTexture(specTex); + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.bindTexture(baseTex); + } + + public static void bindTextures(MultiTexID multiTex) + { + if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984) + { + if (Shaders.configNormalMap) + { + GlStateManager.setActiveTexture(33986); + GlStateManager.bindTexture(multiTex.norm); + } + + if (Shaders.configSpecularMap) + { + GlStateManager.setActiveTexture(33987); + GlStateManager.bindTexture(multiTex.spec); + } + + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.bindTexture(multiTex.base); + } + + public static void bindTexture(ITextureObject tex) + { + int i = tex.getGlTextureId(); + bindTextures(tex.getMultiTexID()); + + if (GlStateManager.getActiveTextureUnit() == 33984) + { + int j = Shaders.atlasSizeX; + int k = Shaders.atlasSizeY; + + if (tex instanceof TextureMap) + { + Shaders.atlasSizeX = ((TextureMap)tex).atlasWidth; + Shaders.atlasSizeY = ((TextureMap)tex).atlasHeight; + } + else + { + Shaders.atlasSizeX = 0; + Shaders.atlasSizeY = 0; + } + + if (Shaders.atlasSizeX != j || Shaders.atlasSizeY != k) + { + Shaders.uniform_atlasSize.setValue(Shaders.atlasSizeX, Shaders.atlasSizeY); + } + } + } + + public static void bindTextures(int baseTex) + { + MultiTexID multitexid = (MultiTexID)multiTexMap.get(Integer.valueOf(baseTex)); + bindTextures(multitexid); + } + + public static void initDynamicTexture(int texID, int width, int height, DynamicTexture tex) + { + MultiTexID multitexid = tex.getMultiTexID(); + int[] aint = tex.getTextureData(); + int i = width * height; + Arrays.fill(aint, i, i * 2, -8421377); + Arrays.fill((int[])aint, i * 2, i * 3, (int)0); + TextureUtil.allocateTexture(multitexid.base, width, height); + TextureUtil.setTextureBlurMipmap(false, false); + TextureUtil.setTextureClamped(false); + TextureUtil.allocateTexture(multitexid.norm, width, height); + TextureUtil.setTextureBlurMipmap(false, false); + TextureUtil.setTextureClamped(false); + TextureUtil.allocateTexture(multitexid.spec, width, height); + TextureUtil.setTextureBlurMipmap(false, false); + TextureUtil.setTextureClamped(false); + GlStateManager.bindTexture(multitexid.base); + } + + public static void updateDynamicTexture(int texID, int[] src, int width, int height, DynamicTexture tex) + { + MultiTexID multitexid = tex.getMultiTexID(); + GlStateManager.bindTexture(multitexid.base); + updateDynTexSubImage1(src, width, height, 0, 0, 0); + GlStateManager.bindTexture(multitexid.norm); + updateDynTexSubImage1(src, width, height, 0, 0, 1); + GlStateManager.bindTexture(multitexid.spec); + updateDynTexSubImage1(src, width, height, 0, 0, 2); + GlStateManager.bindTexture(multitexid.base); + } + + public static void updateDynTexSubImage1(int[] src, int width, int height, int posX, int posY, int page) + { + int i = width * height; + IntBuffer intbuffer = getIntBuffer(i); + intbuffer.clear(); + int j = page * i; + + if (src.length >= j + i) + { + intbuffer.put(src, j, i).position(0).limit(i); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + intbuffer.clear(); + } + } + + public static ITextureObject createDefaultTexture() + { + DynamicTexture dynamictexture = new DynamicTexture(1, 1); + dynamictexture.getTextureData()[0] = -1; + dynamictexture.updateDynamicTexture(); + return dynamictexture; + } + + public static void allocateTextureMap(int texID, int mipmapLevels, int width, int height, Stitcher stitcher, TextureMap tex) + { + SMCLog.info("allocateTextureMap " + mipmapLevels + " " + width + " " + height + " "); + tex.atlasWidth = width; + tex.atlasHeight = height; + MultiTexID multitexid = getMultiTexID(tex); + TextureUtil.allocateTextureImpl(multitexid.base, mipmapLevels, width, height); + + if (Shaders.configNormalMap) + { + TextureUtil.allocateTextureImpl(multitexid.norm, mipmapLevels, width, height); + } + + if (Shaders.configSpecularMap) + { + TextureUtil.allocateTextureImpl(multitexid.spec, mipmapLevels, width, height); + } + + GlStateManager.bindTexture(texID); + } + + public static void uploadTexSubForLoadAtlas(TextureMap textureMap, String iconName, int[][] data, int width, int height, int xoffset, int yoffset, boolean linear, boolean clamp) + { + MultiTexID multitexid = textureMap.multiTex; + TextureUtil.uploadTextureMipmap(data, width, height, xoffset, yoffset, linear, clamp); + boolean flag = false; + + if (Shaders.configNormalMap) + { + int[][] aint = readImageAndMipmaps(textureMap, iconName + "_n", width, height, data.length, flag, -8421377); + GlStateManager.bindTexture(multitexid.norm); + TextureUtil.uploadTextureMipmap(aint, width, height, xoffset, yoffset, linear, clamp); + } + + if (Shaders.configSpecularMap) + { + int[][] aint1 = readImageAndMipmaps(textureMap, iconName + "_s", width, height, data.length, flag, 0); + GlStateManager.bindTexture(multitexid.spec); + TextureUtil.uploadTextureMipmap(aint1, width, height, xoffset, yoffset, linear, clamp); + } + + GlStateManager.bindTexture(multitexid.base); + } + + public static int[][] readImageAndMipmaps(TextureMap updatingTextureMap, String name, int width, int height, int numLevels, boolean border, int defColor) + { + MultiTexID multitexid = updatingTextureMap.multiTex; + int[][] aint = new int[numLevels][]; + int[] aint1; + aint[0] = aint1 = new int[width * height]; + boolean flag = false; + BufferedImage bufferedimage = readImage(updatingTextureMap.completeResourceLocation(new ResourceLocation(name))); + + if (bufferedimage != null) + { + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + + if (i + (border ? 16 : 0) == width) + { + flag = true; + bufferedimage.getRGB(0, 0, i, i, aint1, 0, i); + } + } + + if (!flag) + { + Arrays.fill(aint1, defColor); + } + + GlStateManager.bindTexture(multitexid.spec); + aint = genMipmapsSimple(aint.length - 1, width, aint); + return aint; + } + + public static BufferedImage readImage(ResourceLocation resLoc) + { + try + { + if (!Config.hasResource(resLoc)) + { + return null; + } + else + { + InputStream inputstream = Config.getResourceStream(resLoc); + + if (inputstream == null) + { + return null; + } + else + { + BufferedImage bufferedimage = ImageIO.read(inputstream); + inputstream.close(); + return bufferedimage; + } + } + } + catch (IOException var3) + { + return null; + } + } + + public static int[][] genMipmapsSimple(int maxLevel, int width, int[][] data) + { + for (int i = 1; i <= maxLevel; ++i) + { + if (data[i] == null) + { + int j = width >> i; + int k = j * 2; + int[] aint = data[i - 1]; + int[] aint1 = data[i] = new int[j * j]; + + for (int i1 = 0; i1 < j; ++i1) + { + for (int l = 0; l < j; ++l) + { + int j1 = i1 * 2 * k + l * 2; + aint1[i1 * j + l] = blend4Simple(aint[j1], aint[j1 + 1], aint[j1 + k], aint[j1 + k + 1]); + } + } + } + } + + return data; + } + + public static void uploadTexSub1(int[][] src, int width, int height, int posX, int posY, int page) + { + int i = width * height; + IntBuffer intbuffer = getIntBuffer(i); + int j = src.length; + int k = 0; + int l = width; + int i1 = height; + int j1 = posX; + + for (int k1 = posY; l > 0 && i1 > 0 && k < j; ++k) + { + int l1 = l * i1; + int[] aint = src[k]; + intbuffer.clear(); + + if (aint.length >= l1 * (page + 1)) + { + intbuffer.put(aint, l1 * page, l1).position(0).limit(l1); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, k, j1, k1, l, i1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + } + + l >>= 1; + i1 >>= 1; + j1 >>= 1; + k1 >>= 1; + } + + intbuffer.clear(); + } + + public static int blend4Alpha(int c0, int c1, int c2, int c3) + { + int i = c0 >>> 24 & 255; + int j = c1 >>> 24 & 255; + int k = c2 >>> 24 & 255; + int l = c3 >>> 24 & 255; + int i1 = i + j + k + l; + int j1 = (i1 + 2) / 4; + int k1; + + if (i1 != 0) + { + k1 = i1; + } + else + { + k1 = 4; + i = 1; + j = 1; + k = 1; + l = 1; + } + + int l1 = (k1 + 1) / 2; + int i2 = j1 << 24 | ((c0 >>> 16 & 255) * i + (c1 >>> 16 & 255) * j + (c2 >>> 16 & 255) * k + (c3 >>> 16 & 255) * l + l1) / k1 << 16 | ((c0 >>> 8 & 255) * i + (c1 >>> 8 & 255) * j + (c2 >>> 8 & 255) * k + (c3 >>> 8 & 255) * l + l1) / k1 << 8 | ((c0 >>> 0 & 255) * i + (c1 >>> 0 & 255) * j + (c2 >>> 0 & 255) * k + (c3 >>> 0 & 255) * l + l1) / k1 << 0; + return i2; + } + + public static int blend4Simple(int c0, int c1, int c2, int c3) + { + int i = ((c0 >>> 24 & 255) + (c1 >>> 24 & 255) + (c2 >>> 24 & 255) + (c3 >>> 24 & 255) + 2) / 4 << 24 | ((c0 >>> 16 & 255) + (c1 >>> 16 & 255) + (c2 >>> 16 & 255) + (c3 >>> 16 & 255) + 2) / 4 << 16 | ((c0 >>> 8 & 255) + (c1 >>> 8 & 255) + (c2 >>> 8 & 255) + (c3 >>> 8 & 255) + 2) / 4 << 8 | ((c0 >>> 0 & 255) + (c1 >>> 0 & 255) + (c2 >>> 0 & 255) + (c3 >>> 0 & 255) + 2) / 4 << 0; + return i; + } + + public static void genMipmapAlpha(int[] aint, int offset, int width, int height) + { + Math.min(width, height); + int o2 = offset; + int w2 = width; + int h2 = height; + int o1 = 0; + int w1 = 0; + int h1 = 0; + int i; + + for (i = 0; w2 > 1 && h2 > 1; o2 = o1) + { + o1 = o2 + w2 * h2; + w1 = w2 / 2; + h1 = h2 / 2; + + for (int l1 = 0; l1 < h1; ++l1) + { + int i2 = o1 + l1 * w1; + int j2 = o2 + l1 * 2 * w2; + + for (int k2 = 0; k2 < w1; ++k2) + { + aint[i2 + k2] = blend4Alpha(aint[j2 + k2 * 2], aint[j2 + k2 * 2 + 1], aint[j2 + w2 + k2 * 2], aint[j2 + w2 + k2 * 2 + 1]); + } + } + + ++i; + w2 = w1; + h2 = h1; + } + + while (i > 0) + { + --i; + w2 = width >> i; + h2 = height >> i; + o2 = o1 - w2 * h2; + int l2 = o2; + + for (int i3 = 0; i3 < h2; ++i3) + { + for (int j3 = 0; j3 < w2; ++j3) + { + if (aint[l2] == 0) + { + aint[l2] = aint[o1 + i3 / 2 * w1 + j3 / 2] & 16777215; + } + + ++l2; + } + } + + o1 = o2; + w1 = w2; + } + } + + public static void genMipmapSimple(int[] aint, int offset, int width, int height) + { + Math.min(width, height); + int o2 = offset; + int w2 = width; + int h2 = height; + int o1 = 0; + int w1 = 0; + int h1 = 0; + int i; + + for (i = 0; w2 > 1 && h2 > 1; o2 = o1) + { + o1 = o2 + w2 * h2; + w1 = w2 / 2; + h1 = h2 / 2; + + for (int l1 = 0; l1 < h1; ++l1) + { + int i2 = o1 + l1 * w1; + int j2 = o2 + l1 * 2 * w2; + + for (int k2 = 0; k2 < w1; ++k2) + { + aint[i2 + k2] = blend4Simple(aint[j2 + k2 * 2], aint[j2 + k2 * 2 + 1], aint[j2 + w2 + k2 * 2], aint[j2 + w2 + k2 * 2 + 1]); + } + } + + ++i; + w2 = w1; + h2 = h1; + } + + while (i > 0) + { + --i; + w2 = width >> i; + h2 = height >> i; + o2 = o1 - w2 * h2; + int l2 = o2; + + for (int i3 = 0; i3 < h2; ++i3) + { + for (int j3 = 0; j3 < w2; ++j3) + { + if (aint[l2] == 0) + { + aint[l2] = aint[o1 + i3 / 2 * w1 + j3 / 2] & 16777215; + } + + ++l2; + } + } + + o1 = o2; + w1 = w2; + } + } + + public static boolean isSemiTransparent(int[] aint, int width, int height) + { + int i = width * height; + + if (aint[0] >>> 24 == 255 && aint[i - 1] == 0) + { + return true; + } + else + { + for (int j = 0; j < i; ++j) + { + int k = aint[j] >>> 24; + + if (k != 0 && k != 255) + { + return true; + } + } + + return false; + } + } + + public static void updateSubTex1(int[] src, int width, int height, int posX, int posY) + { + int i = 0; + int j = width; + int k = height; + int l = posX; + + for (int i1 = posY; j > 0 && k > 0; i1 /= 2) + { + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, i, l, i1, 0, 0, j, k); + ++i; + j /= 2; + k /= 2; + l /= 2; + } + } + + public static void setupTexture(MultiTexID multiTex, int[] src, int width, int height, boolean linear, boolean clamp) + { + int i = linear ? 9729 : 9728; + int j = clamp ? 33071 : 10497; + int k = width * height; + IntBuffer intbuffer = getIntBuffer(k); + intbuffer.clear(); + intbuffer.put(src, 0, k).position(0).limit(k); + GlStateManager.bindTexture(multiTex.base); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, j); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, j); + intbuffer.put(src, k, k).position(0).limit(k); + GlStateManager.bindTexture(multiTex.norm); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, j); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, j); + intbuffer.put(src, k * 2, k).position(0).limit(k); + GlStateManager.bindTexture(multiTex.spec); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, i); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, j); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, j); + GlStateManager.bindTexture(multiTex.base); + } + + public static void updateSubImage(MultiTexID multiTex, int[] src, int width, int height, int posX, int posY, boolean linear, boolean clamp) + { + int i = width * height; + IntBuffer intbuffer = getIntBuffer(i); + intbuffer.clear(); + intbuffer.put(src, 0, i); + intbuffer.position(0).limit(i); + GlStateManager.bindTexture(multiTex.base); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + + if (src.length == i * 3) + { + intbuffer.clear(); + intbuffer.put(src, i, i).position(0); + intbuffer.position(0).limit(i); + } + + GlStateManager.bindTexture(multiTex.norm); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + + if (src.length == i * 3) + { + intbuffer.clear(); + intbuffer.put(src, i * 2, i); + intbuffer.position(0).limit(i); + } + + GlStateManager.bindTexture(multiTex.spec); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + GlStateManager.setActiveTexture(33984); + } + + public static ResourceLocation getNSMapLocation(ResourceLocation location, String mapName) + { + if (location == null) + { + return null; + } + else + { + String s = location.getResourcePath(); + String[] astring = s.split(".png"); + String s1 = astring[0]; + return new ResourceLocation(location.getResourceDomain(), s1 + "_" + mapName + ".png"); + } + } + + public static void loadNSMap(IResourceManager manager, ResourceLocation location, int width, int height, int[] aint) + { + if (Shaders.configNormalMap) + { + loadNSMap1(manager, getNSMapLocation(location, "n"), width, height, aint, width * height, -8421377); + } + + if (Shaders.configSpecularMap) + { + loadNSMap1(manager, getNSMapLocation(location, "s"), width, height, aint, width * height * 2, 0); + } + } + + private static void loadNSMap1(IResourceManager manager, ResourceLocation location, int width, int height, int[] aint, int offset, int defaultColor) + { + if (!loadNSMapFile(manager, location, width, height, aint, offset)) + { + Arrays.fill(aint, offset, offset + width * height, defaultColor); + } + } + + private static boolean loadNSMapFile(IResourceManager manager, ResourceLocation location, int width, int height, int[] aint, int offset) + { + if (location == null) + { + return false; + } + else + { + try + { + IResource iresource = manager.getResource(location); + BufferedImage bufferedimage = ImageIO.read(iresource.getInputStream()); + + if (bufferedimage == null) + { + return false; + } + else if (bufferedimage.getWidth() == width && bufferedimage.getHeight() == height) + { + bufferedimage.getRGB(0, 0, width, height, aint, offset, width); + return true; + } + else + { + return false; + } + } + catch (IOException var8) + { + return false; + } + } + } + + public static int loadSimpleTexture(int textureID, BufferedImage bufferedimage, boolean linear, boolean clamp, IResourceManager resourceManager, ResourceLocation location, MultiTexID multiTex) + { + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + int k = i * j; + int[] aint = getIntArray(k * 3); + bufferedimage.getRGB(0, 0, i, j, aint, 0, i); + loadNSMap(resourceManager, location, i, j, aint); + setupTexture(multiTex, aint, i, j, linear, clamp); + return textureID; + } + + public static void mergeImage(int[] aint, int dstoff, int srcoff, int size) + { + } + + public static int blendColor(int color1, int color2, int factor1) + { + int i = 255 - factor1; + return ((color1 >>> 24 & 255) * factor1 + (color2 >>> 24 & 255) * i) / 255 << 24 | ((color1 >>> 16 & 255) * factor1 + (color2 >>> 16 & 255) * i) / 255 << 16 | ((color1 >>> 8 & 255) * factor1 + (color2 >>> 8 & 255) * i) / 255 << 8 | ((color1 >>> 0 & 255) * factor1 + (color2 >>> 0 & 255) * i) / 255 << 0; + } + + public static void loadLayeredTexture(LayeredTexture tex, IResourceManager manager, List list) + { + int i = 0; + int j = 0; + int k = 0; + int[] aint = null; + + for (Object s : list) + { + if (s != null) + { + try + { + ResourceLocation resourcelocation = new ResourceLocation((String) s); + InputStream inputstream = manager.getResource(resourcelocation).getInputStream(); + BufferedImage bufferedimage = ImageIO.read(inputstream); + + if (k == 0) + { + i = bufferedimage.getWidth(); + j = bufferedimage.getHeight(); + k = i * j; + aint = createAIntImage(k, 0); + } + + int[] aint1 = getIntArray(k * 3); + bufferedimage.getRGB(0, 0, i, j, aint1, 0, i); + loadNSMap(manager, resourcelocation, i, j, aint1); + + for (int l = 0; l < k; ++l) + { + int i1 = aint1[l] >>> 24 & 255; + aint[k * 0 + l] = blendColor(aint1[k * 0 + l], aint[k * 0 + l], i1); + aint[k * 1 + l] = blendColor(aint1[k * 1 + l], aint[k * 1 + l], i1); + aint[k * 2 + l] = blendColor(aint1[k * 2 + l], aint[k * 2 + l], i1); + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + } + + setupTexture(tex.getMultiTexID(), aint, i, j, false, false); + } + + public static void updateTextureMinMagFilter() + { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + ITextureObject itextureobject = texturemanager.getTexture(TextureMap.locationBlocksTexture); + + if (itextureobject != null) + { + MultiTexID multitexid = itextureobject.getMultiTexID(); + GlStateManager.bindTexture(multitexid.base); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilB]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilB]); + GlStateManager.bindTexture(multitexid.norm); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilN]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilN]); + GlStateManager.bindTexture(multitexid.spec); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilS]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilS]); + GlStateManager.bindTexture(0); + } + } + + public static int[][] getFrameTexData(int[][] src, int width, int height, int frameIndex) + { + int i = src.length; + int[][] aint = new int[i][]; + + for (int j = 0; j < i; ++j) + { + int[] aint1 = src[j]; + + if (aint1 != null) + { + int k = (width >> j) * (height >> j); + int[] aint2 = new int[k * 3]; + aint[j] = aint2; + int l = aint1.length / 3; + int i1 = k * frameIndex; + int j1 = 0; + System.arraycopy(aint1, i1, aint2, j1, k); + i1 = i1 + l; + j1 = j1 + k; + System.arraycopy(aint1, i1, aint2, j1, k); + i1 = i1 + l; + j1 = j1 + k; + System.arraycopy(aint1, i1, aint2, j1, k); + } + } + + return aint; + } + + public static int[][] prepareAF(TextureAtlasSprite tas, int[][] src, int width, int height) + { + boolean flag = true; + return src; + } + + public static void fixTransparentColor(TextureAtlasSprite tas, int[] aint) + { + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/ShadowUtils.java b/Client-1.8.9/src/main/java/net/optifine/shaders/ShadowUtils.java new file mode 100644 index 0000000..3595a65 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/ShadowUtils.java @@ -0,0 +1,41 @@ +package net.optifine.shaders; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.ViewFrustum; +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; + +public class ShadowUtils +{ + public static Iterator makeShadowChunkIterator(WorldClient world, double partialTicks, Entity viewEntity, int renderDistanceChunks, ViewFrustum viewFrustum) + { + float f = Shaders.getShadowRenderDistance(); + + if (f > 0.0F && f < (float)((renderDistanceChunks - 1) * 16)) + { + int i = MathHelper.ceiling_float_int(f / 16.0F) + 1; + float f6 = world.getCelestialAngleRadians((float)partialTicks); + float f1 = Shaders.sunPathRotation * MathHelper.deg2Rad; + float f2 = f6 > MathHelper.PId2 && f6 < 3.0F * MathHelper.PId2 ? f6 + MathHelper.PI : f6; + float f3 = -MathHelper.sin(f2); + float f4 = MathHelper.cos(f2) * MathHelper.cos(f1); + float f5 = -MathHelper.cos(f2) * MathHelper.sin(f1); + BlockPos blockpos = new BlockPos(MathHelper.floor_double(viewEntity.posX) >> 4, MathHelper.floor_double(viewEntity.posY) >> 4, MathHelper.floor_double(viewEntity.posZ) >> 4); + BlockPos blockpos1 = blockpos.add((double)(-f3 * (float)i), (double)(-f4 * (float)i), (double)(-f5 * (float)i)); + BlockPos blockpos2 = blockpos.add((double)(f3 * (float)renderDistanceChunks), (double)(f4 * (float)renderDistanceChunks), (double)(f5 * (float)renderDistanceChunks)); + IteratorRenderChunks iteratorrenderchunks = new IteratorRenderChunks(viewFrustum, blockpos1, blockpos2, i, i); + return iteratorrenderchunks; + } + else + { + List list = Arrays.asList(viewFrustum.renderChunks); + Iterator iterator = list.iterator(); + return iterator; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/SimpleShaderTexture.java b/Client-1.8.9/src/main/java/net/optifine/shaders/SimpleShaderTexture.java new file mode 100644 index 0000000..c60b686 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/SimpleShaderTexture.java @@ -0,0 +1,117 @@ +package net.optifine.shaders; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.ArrayList; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.client.resources.data.AnimationMetadataSectionSerializer; +import net.minecraft.client.resources.data.FontMetadataSection; +import net.minecraft.client.resources.data.FontMetadataSectionSerializer; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.LanguageMetadataSection; +import net.minecraft.client.resources.data.LanguageMetadataSectionSerializer; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.client.resources.data.PackMetadataSectionSerializer; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.client.resources.data.TextureMetadataSectionSerializer; +import org.apache.commons.io.IOUtils; + +public class SimpleShaderTexture extends AbstractTexture +{ + private String texturePath; + private static final IMetadataSerializer METADATA_SERIALIZER = makeMetadataSerializer(); + + public SimpleShaderTexture(String texturePath) + { + this.texturePath = texturePath; + } + + public void loadTexture(IResourceManager resourceManager) throws IOException + { + this.deleteGlTexture(); + InputStream inputstream = Shaders.getShaderPackResourceStream(this.texturePath); + + if (inputstream == null) + { + throw new FileNotFoundException("Shader texture not found: " + this.texturePath); + } + else + { + try + { + BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream); + TextureMetadataSection texturemetadatasection = loadTextureMetadataSection(this.texturePath, new TextureMetadataSection(false, false, new ArrayList())); + TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, texturemetadatasection.getTextureBlur(), texturemetadatasection.getTextureClamp()); + } + finally + { + IOUtils.closeQuietly(inputstream); + } + } + } + + public static TextureMetadataSection loadTextureMetadataSection(String texturePath, TextureMetadataSection def) + { + String s = texturePath + ".mcmeta"; + String s1 = "texture"; + InputStream inputstream = Shaders.getShaderPackResourceStream(s); + + if (inputstream != null) + { + IMetadataSerializer imetadataserializer = METADATA_SERIALIZER; + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream)); + TextureMetadataSection texturemetadatasection1; + + try + { + JsonObject jsonobject = (new JsonParser()).parse((Reader)bufferedreader).getAsJsonObject(); + TextureMetadataSection texturemetadatasection = (TextureMetadataSection)imetadataserializer.parseMetadataSection(s1, jsonobject); + + if (texturemetadatasection == null) + { + return def; + } + + texturemetadatasection1 = texturemetadatasection; + } + catch (RuntimeException runtimeexception) + { + SMCLog.warning("Error reading metadata: " + s); + SMCLog.warning("" + runtimeexception.getClass().getName() + ": " + runtimeexception.getMessage()); + return def; + } + finally + { + IOUtils.closeQuietly((Reader)bufferedreader); + IOUtils.closeQuietly(inputstream); + } + + return texturemetadatasection1; + } + else + { + return def; + } + } + + private static IMetadataSerializer makeMetadataSerializer() + { + IMetadataSerializer imetadataserializer = new IMetadataSerializer(); + imetadataserializer.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); + imetadataserializer.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); + imetadataserializer.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); + imetadataserializer.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); + imetadataserializer.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); + return imetadataserializer; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/EnumShaderOption.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/EnumShaderOption.java new file mode 100644 index 0000000..0cdff2e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/EnumShaderOption.java @@ -0,0 +1,49 @@ +package net.optifine.shaders.config; + +public enum EnumShaderOption +{ + ANTIALIASING("of.options.shaders.ANTIALIASING", "antialiasingLevel", "0"), + NORMAL_MAP("of.options.shaders.NORMAL_MAP", "normalMapEnabled", "true"), + SPECULAR_MAP("of.options.shaders.SPECULAR_MAP", "specularMapEnabled", "true"), + RENDER_RES_MUL("of.options.shaders.RENDER_RES_MUL", "renderResMul", "1.0"), + SHADOW_RES_MUL("of.options.shaders.SHADOW_RES_MUL", "shadowResMul", "1.0"), + HAND_DEPTH_MUL("of.options.shaders.HAND_DEPTH_MUL", "handDepthMul", "0.125"), + CLOUD_SHADOW("of.options.shaders.CLOUD_SHADOW", "cloudShadow", "true"), + OLD_HAND_LIGHT("of.options.shaders.OLD_HAND_LIGHT", "oldHandLight", "default"), + OLD_LIGHTING("of.options.shaders.OLD_LIGHTING", "oldLighting", "default"), + SHADER_PACK("of.options.shaders.SHADER_PACK", "shaderPack", ""), + TWEAK_BLOCK_DAMAGE("of.options.shaders.TWEAK_BLOCK_DAMAGE", "tweakBlockDamage", "false"), + SHADOW_CLIP_FRUSTRUM("of.options.shaders.SHADOW_CLIP_FRUSTRUM", "shadowClipFrustrum", "true"), + TEX_MIN_FIL_B("of.options.shaders.TEX_MIN_FIL_B", "TexMinFilB", "0"), + TEX_MIN_FIL_N("of.options.shaders.TEX_MIN_FIL_N", "TexMinFilN", "0"), + TEX_MIN_FIL_S("of.options.shaders.TEX_MIN_FIL_S", "TexMinFilS", "0"), + TEX_MAG_FIL_B("of.options.shaders.TEX_MAG_FIL_B", "TexMagFilB", "0"), + TEX_MAG_FIL_N("of.options.shaders.TEX_MAG_FIL_N", "TexMagFilN", "0"), + TEX_MAG_FIL_S("of.options.shaders.TEX_MAG_FIL_S", "TexMagFilS", "0"); + + private String resourceKey = null; + private String propertyKey = null; + private String valueDefault = null; + + private EnumShaderOption(String resourceKey, String propertyKey, String valueDefault) + { + this.resourceKey = resourceKey; + this.propertyKey = propertyKey; + this.valueDefault = valueDefault; + } + + public String getResourceKey() + { + return this.resourceKey; + } + + public String getPropertyKey() + { + return this.propertyKey; + } + + public String getValueDefault() + { + return this.valueDefault; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ExpressionShaderOptionSwitch.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ExpressionShaderOptionSwitch.java new file mode 100644 index 0000000..6408038 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ExpressionShaderOptionSwitch.java @@ -0,0 +1,29 @@ +package net.optifine.shaders.config; + +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpressionBool; + +public class ExpressionShaderOptionSwitch implements IExpressionBool +{ + private ShaderOptionSwitch shaderOption; + + public ExpressionShaderOptionSwitch(ShaderOptionSwitch shaderOption) + { + this.shaderOption = shaderOption; + } + + public boolean eval() + { + return ShaderOptionSwitch.isTrue(this.shaderOption.getValue()); + } + + public ExpressionType getExpressionType() + { + return ExpressionType.BOOL; + } + + public String toString() + { + return "" + this.shaderOption; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroExpressionResolver.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroExpressionResolver.java new file mode 100644 index 0000000..eb225ff --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroExpressionResolver.java @@ -0,0 +1,56 @@ +package net.optifine.shaders.config; + +import java.util.Map; +import net.minecraft.src.Config; +import net.optifine.expr.ConstantFloat; +import net.optifine.expr.FunctionBool; +import net.optifine.expr.FunctionType; +import net.optifine.expr.IExpression; +import net.optifine.expr.IExpressionResolver; + +public class MacroExpressionResolver implements IExpressionResolver +{ + private Map mapMacroValues = null; + + public MacroExpressionResolver(Map mapMacroValues) + { + this.mapMacroValues = mapMacroValues; + } + + public IExpression getExpression(String name) + { + String s = "defined_"; + + if (name.startsWith(s)) + { + String s2 = name.substring(s.length()); + return this.mapMacroValues.containsKey(s2) ? new FunctionBool(FunctionType.TRUE, (IExpression[])null) : new FunctionBool(FunctionType.FALSE, (IExpression[])null); + } + else + { + while (this.mapMacroValues.containsKey(name)) + { + String s1 = (String)this.mapMacroValues.get(name); + + if (s1 == null || s1.equals(name)) + { + break; + } + + name = s1; + } + + int i = Config.parseInt(name, Integer.MIN_VALUE); + + if (i == Integer.MIN_VALUE) + { + Config.warn("Unknown macro value: " + name); + return new ConstantFloat(0.0F); + } + else + { + return new ConstantFloat((float)i); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroProcessor.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroProcessor.java new file mode 100644 index 0000000..46e252d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroProcessor.java @@ -0,0 +1,135 @@ +package net.optifine.shaders.config; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import net.minecraft.src.Config; +import net.optifine.shaders.Shaders; + +public class MacroProcessor +{ + public static InputStream process(InputStream in, String path) throws IOException + { + String s = Config.readInputStream(in, "ASCII"); + String s1 = getMacroHeader(s); + + if (!s1.isEmpty()) + { + s = s1 + s; + + if (Shaders.saveFinalShaders) + { + String s2 = path.replace(':', '/') + ".pre"; + Shaders.saveShader(s2, s); + } + + s = process(s); + } + + if (Shaders.saveFinalShaders) + { + String s3 = path.replace(':', '/'); + Shaders.saveShader(s3, s); + } + + byte[] abyte = s.getBytes("ASCII"); + ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(abyte); + return bytearrayinputstream; + } + + public static String process(String strIn) throws IOException + { + StringReader stringreader = new StringReader(strIn); + BufferedReader bufferedreader = new BufferedReader(stringreader); + MacroState macrostate = new MacroState(); + StringBuilder stringbuilder = new StringBuilder(); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + s = stringbuilder.toString(); + return s; + } + + if (macrostate.processLine(s) && !MacroState.isMacroLine(s)) + { + stringbuilder.append(s); + stringbuilder.append("\n"); + } + } + } + + private static String getMacroHeader(String str) throws IOException + { + StringBuilder stringbuilder = new StringBuilder(); + List list = null; + List list1 = null; + StringReader stringreader = new StringReader(str); + BufferedReader bufferedreader = new BufferedReader(stringreader); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + return stringbuilder.toString(); + } + + if (MacroState.isMacroLine(s)) + { + if (stringbuilder.length() == 0) + { + stringbuilder.append(ShaderMacros.getFixedMacroLines()); + } + + if (list1 == null) + { + list1 = new ArrayList(Arrays.asList(ShaderMacros.getExtensions())); + } + + Iterator iterator = list1.iterator(); + + while (iterator.hasNext()) + { + ShaderMacro shadermacro = (ShaderMacro)iterator.next(); + + if (s.contains(shadermacro.getName())) + { + stringbuilder.append(shadermacro.getSourceLine()); + stringbuilder.append("\n"); + iterator.remove(); + } + } + } + } + } + + private static List getMacroOptions() + { + List list = new ArrayList(); + ShaderOption[] ashaderoption = Shaders.getShaderPackOptions(); + + for (int i = 0; i < ashaderoption.length; ++i) + { + ShaderOption shaderoption = ashaderoption[i]; + String s = shaderoption.getSourceLine(); + + if (s != null && s.startsWith("#")) + { + list.add(shaderoption); + } + } + + return list; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroState.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroState.java new file mode 100644 index 0000000..b1534cc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/MacroState.java @@ -0,0 +1,235 @@ +package net.optifine.shaders.config; + +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Deque; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.Config; +import net.optifine.expr.ExpressionParser; +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpression; +import net.optifine.expr.IExpressionBool; +import net.optifine.expr.IExpressionFloat; +import net.optifine.expr.IExpressionResolver; +import net.optifine.expr.ParseException; + +public class MacroState +{ + private boolean active = true; + private Deque dequeState = new ArrayDeque(); + private Deque dequeResolved = new ArrayDeque(); + private Map mapMacroValues = new HashMap(); + private static final Pattern PATTERN_DIRECTIVE = Pattern.compile("\\s*#\\s*(\\w+)\\s*(.*)"); + private static final Pattern PATTERN_DEFINED = Pattern.compile("defined\\s+(\\w+)"); + private static final Pattern PATTERN_DEFINED_FUNC = Pattern.compile("defined\\s*\\(\\s*(\\w+)\\s*\\)"); + private static final Pattern PATTERN_MACRO = Pattern.compile("(\\w+)"); + private static final String DEFINE = "define"; + private static final String UNDEF = "undef"; + private static final String IFDEF = "ifdef"; + private static final String IFNDEF = "ifndef"; + private static final String IF = "if"; + private static final String ELSE = "else"; + private static final String ELIF = "elif"; + private static final String ENDIF = "endif"; + private static final List MACRO_NAMES = Arrays.asList(new String[] {"define", "undef", "ifdef", "ifndef", "if", "else", "elif", "endif"}); + + public boolean processLine(String line) + { + Matcher matcher = PATTERN_DIRECTIVE.matcher(line); + + if (!matcher.matches()) + { + return this.active; + } + else + { + String s = matcher.group(1); + String s1 = matcher.group(2); + int i = s1.indexOf("//"); + + if (i >= 0) + { + s1 = s1.substring(0, i); + } + + boolean flag = this.active; + this.processMacro(s, s1); + this.active = !this.dequeState.contains(Boolean.FALSE); + return this.active || flag; + } + } + + public static boolean isMacroLine(String line) + { + Matcher matcher = PATTERN_DIRECTIVE.matcher(line); + + if (!matcher.matches()) + { + return false; + } + else + { + String s = matcher.group(1); + return MACRO_NAMES.contains(s); + } + } + + private void processMacro(String name, String param) + { + StringTokenizer stringtokenizer = new StringTokenizer(param, " \t"); + String s = stringtokenizer.hasMoreTokens() ? stringtokenizer.nextToken() : ""; + String s1 = stringtokenizer.hasMoreTokens() ? stringtokenizer.nextToken("").trim() : ""; + + if (name.equals("define")) + { + this.mapMacroValues.put(s, s1); + } + else if (name.equals("undef")) + { + this.mapMacroValues.remove(s); + } + else if (name.equals("ifdef")) + { + boolean flag6 = this.mapMacroValues.containsKey(s); + this.dequeState.add(Boolean.valueOf(flag6)); + this.dequeResolved.add(Boolean.valueOf(flag6)); + } + else if (name.equals("ifndef")) + { + boolean flag5 = !this.mapMacroValues.containsKey(s); + this.dequeState.add(Boolean.valueOf(flag5)); + this.dequeResolved.add(Boolean.valueOf(flag5)); + } + else if (name.equals("if")) + { + boolean flag4 = this.eval(param); + this.dequeState.add(Boolean.valueOf(flag4)); + this.dequeResolved.add(Boolean.valueOf(flag4)); + } + else if (!this.dequeState.isEmpty()) + { + if (name.equals("elif")) + { + boolean flag3 = ((Boolean)this.dequeState.removeLast()).booleanValue(); + boolean flag7 = ((Boolean)this.dequeResolved.removeLast()).booleanValue(); + + if (flag7) + { + this.dequeState.add(Boolean.valueOf(false)); + this.dequeResolved.add(Boolean.valueOf(flag7)); + } + else + { + boolean flag8 = this.eval(param); + this.dequeState.add(Boolean.valueOf(flag8)); + this.dequeResolved.add(Boolean.valueOf(flag8)); + } + } + else if (name.equals("else")) + { + boolean flag = ((Boolean)this.dequeState.removeLast()).booleanValue(); + boolean flag1 = ((Boolean)this.dequeResolved.removeLast()).booleanValue(); + boolean flag2 = !flag1; + this.dequeState.add(Boolean.valueOf(flag2)); + this.dequeResolved.add(Boolean.valueOf(true)); + } + else if (name.equals("endif")) + { + this.dequeState.removeLast(); + this.dequeResolved.removeLast(); + } + } + } + + private boolean eval(String str) + { + Matcher matcher = PATTERN_DEFINED.matcher(str); + str = matcher.replaceAll("defined_$1"); + Matcher matcher1 = PATTERN_DEFINED_FUNC.matcher(str); + str = matcher1.replaceAll("defined_$1"); + boolean flag = false; + int i = 0; + + while (true) + { + flag = false; + Matcher matcher2 = PATTERN_MACRO.matcher(str); + + while (matcher2.find()) + { + String s = matcher2.group(); + + if (s.length() > 0) + { + char c0 = s.charAt(0); + + if ((Character.isLetter(c0) || c0 == 95) && this.mapMacroValues.containsKey(s)) + { + String s1 = (String)this.mapMacroValues.get(s); + + if (s1 == null) + { + s1 = "1"; + } + + int j = matcher2.start(); + int k = matcher2.end(); + str = str.substring(0, j) + " " + s1 + " " + str.substring(k); + flag = true; + ++i; + break; + } + } + } + + if (!flag || i >= 100) + { + break; + } + } + + if (i >= 100) + { + Config.warn("Too many iterations: " + i + ", when resolving: " + str); + return true; + } + else + { + try + { + IExpressionResolver iexpressionresolver = new MacroExpressionResolver(this.mapMacroValues); + ExpressionParser expressionparser = new ExpressionParser(iexpressionresolver); + IExpression iexpression = expressionparser.parse(str); + + if (iexpression.getExpressionType() == ExpressionType.BOOL) + { + IExpressionBool iexpressionbool = (IExpressionBool)iexpression; + boolean flag1 = iexpressionbool.eval(); + return flag1; + } + else if (iexpression.getExpressionType() == ExpressionType.FLOAT) + { + IExpressionFloat iexpressionfloat = (IExpressionFloat)iexpression; + float f = iexpressionfloat.eval(); + boolean flag2 = f != 0.0F; + return flag2; + } + else + { + throw new ParseException("Not a boolean or float expression: " + iexpression.getExpressionType()); + } + } + catch (ParseException parseexception) + { + Config.warn("Invalid macro expression: " + str); + Config.warn("Error: " + parseexception.getMessage()); + return false; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/Property.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/Property.java new file mode 100644 index 0000000..affc445 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/Property.java @@ -0,0 +1,154 @@ +package net.optifine.shaders.config; + +import java.util.Properties; +import net.minecraft.src.Config; +import org.apache.commons.lang3.ArrayUtils; + +public class Property +{ + private int defaultValue = 0; + private String propertyName = null; + private String[] propertyValues = null; + private String userName = null; + private String[] userValues = null; + private int value = 0; + + public Property(String propertyName, String[] propertyValues, String userName, String[] userValues, int defaultValue) + { + this.propertyName = propertyName; + this.propertyValues = propertyValues; + this.userName = userName; + this.userValues = userValues; + this.defaultValue = defaultValue; + + if (propertyValues.length != userValues.length) + { + throw new IllegalArgumentException("Property and user values have different lengths: " + propertyValues.length + " != " + userValues.length); + } + else if (defaultValue >= 0 && defaultValue < propertyValues.length) + { + this.value = defaultValue; + } + else + { + throw new IllegalArgumentException("Invalid default value: " + defaultValue); + } + } + + public boolean setPropertyValue(String propVal) + { + if (propVal == null) + { + this.value = this.defaultValue; + return false; + } + else + { + this.value = ArrayUtils.indexOf(this.propertyValues, propVal); + + if (this.value >= 0 && this.value < this.propertyValues.length) + { + return true; + } + else + { + this.value = this.defaultValue; + return false; + } + } + } + + public void nextValue(boolean forward) + { + int i = 0; + int j = this.propertyValues.length - 1; + this.value = Config.limit(this.value, i, j); + + if (forward) + { + ++this.value; + + if (this.value > j) + { + this.value = i; + } + } + else + { + --this.value; + + if (this.value < i) + { + this.value = j; + } + } + } + + public void setValue(int val) + { + this.value = val; + + if (this.value < 0 || this.value >= this.propertyValues.length) + { + this.value = this.defaultValue; + } + } + + public int getValue() + { + return this.value; + } + + public String getUserValue() + { + return this.userValues[this.value]; + } + + public String getPropertyValue() + { + return this.propertyValues[this.value]; + } + + public String getUserName() + { + return this.userName; + } + + public String getPropertyName() + { + return this.propertyName; + } + + public void resetValue() + { + this.value = this.defaultValue; + } + + public boolean loadFrom(Properties props) + { + this.resetValue(); + + if (props == null) + { + return false; + } + else + { + String s = props.getProperty(this.propertyName); + return s == null ? false : this.setPropertyValue(s); + } + } + + public void saveTo(Properties props) + { + if (props != null) + { + props.setProperty(this.getPropertyName(), this.getPropertyValue()); + } + } + + public String toString() + { + return "" + this.propertyName + "=" + this.getPropertyValue() + " [" + Config.arrayToString((Object[])this.propertyValues) + "], value: " + this.value; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/PropertyDefaultFastFancyOff.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/PropertyDefaultFastFancyOff.java new file mode 100644 index 0000000..4eebcf1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/PropertyDefaultFastFancyOff.java @@ -0,0 +1,44 @@ +package net.optifine.shaders.config; + +import net.minecraft.src.Config; + +public class PropertyDefaultFastFancyOff extends Property +{ + public static final String[] PROPERTY_VALUES = new String[] {"default", "fast", "fancy", "off"}; + public static final String[] USER_VALUES = new String[] {"Default", "Fast", "Fancy", "OFF"}; + + public PropertyDefaultFastFancyOff(String propertyName, String userName, int defaultValue) + { + super(propertyName, PROPERTY_VALUES, userName, USER_VALUES, defaultValue); + } + + public boolean isDefault() + { + return this.getValue() == 0; + } + + public boolean isFast() + { + return this.getValue() == 1; + } + + public boolean isFancy() + { + return this.getValue() == 2; + } + + public boolean isOff() + { + return this.getValue() == 3; + } + + public boolean setPropertyValue(String propVal) + { + if (Config.equals(propVal, "none")) + { + propVal = "off"; + } + + return super.setPropertyValue(propVal); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/PropertyDefaultTrueFalse.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/PropertyDefaultTrueFalse.java new file mode 100644 index 0000000..cf70f0d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/PropertyDefaultTrueFalse.java @@ -0,0 +1,34 @@ +package net.optifine.shaders.config; + +import net.optifine.Lang; + +public class PropertyDefaultTrueFalse extends Property +{ + public static final String[] PROPERTY_VALUES = new String[] {"default", "true", "false"}; + public static final String[] USER_VALUES = new String[] {"Default", "ON", "OFF"}; + + public PropertyDefaultTrueFalse(String propertyName, String userName, int defaultValue) + { + super(propertyName, PROPERTY_VALUES, userName, USER_VALUES, defaultValue); + } + + public String getUserValue() + { + return this.isDefault() ? Lang.getDefault() : (this.isTrue() ? Lang.getOn() : (this.isFalse() ? Lang.getOff() : super.getUserValue())); + } + + public boolean isDefault() + { + return this.getValue() == 0; + } + + public boolean isTrue() + { + return this.getValue() == 1; + } + + public boolean isFalse() + { + return this.getValue() == 2; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/RenderScale.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/RenderScale.java new file mode 100644 index 0000000..f082173 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/RenderScale.java @@ -0,0 +1,35 @@ +package net.optifine.shaders.config; + +public class RenderScale +{ + private float scale = 1.0F; + private float offsetX = 0.0F; + private float offsetY = 0.0F; + + public RenderScale(float scale, float offsetX, float offsetY) + { + this.scale = scale; + this.offsetX = offsetX; + this.offsetY = offsetY; + } + + public float getScale() + { + return this.scale; + } + + public float getOffsetX() + { + return this.offsetX; + } + + public float getOffsetY() + { + return this.offsetY; + } + + public String toString() + { + return "" + this.scale + ", " + this.offsetX + ", " + this.offsetY; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ScreenShaderOptions.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ScreenShaderOptions.java new file mode 100644 index 0000000..a878346 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ScreenShaderOptions.java @@ -0,0 +1,30 @@ +package net.optifine.shaders.config; + +public class ScreenShaderOptions +{ + private String name; + private ShaderOption[] shaderOptions; + private int columns; + + public ScreenShaderOptions(String name, ShaderOption[] shaderOptions, int columns) + { + this.name = name; + this.shaderOptions = shaderOptions; + this.columns = columns; + } + + public String getName() + { + return this.name; + } + + public ShaderOption[] getShaderOptions() + { + return this.shaderOptions; + } + + public int getColumns() + { + return this.columns; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderLine.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderLine.java new file mode 100644 index 0000000..e1a33c3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderLine.java @@ -0,0 +1,247 @@ +package net.optifine.shaders.config; + +import net.minecraft.src.Config; +import net.optifine.util.StrUtils; +import org.lwjgl.util.vector.Vector4f; + +public class ShaderLine +{ + private int type; + private String name; + private String value; + private String line; + public static final int TYPE_UNIFORM = 1; + public static final int TYPE_ATTRIBUTE = 2; + public static final int TYPE_CONST_INT = 3; + public static final int TYPE_CONST_FLOAT = 4; + public static final int TYPE_CONST_BOOL = 5; + public static final int TYPE_PROPERTY = 6; + public static final int TYPE_EXTENSION = 7; + public static final int TYPE_CONST_VEC4 = 8; + + public ShaderLine(int type, String name, String value, String line) + { + this.type = type; + this.name = name; + this.value = value; + this.line = line; + } + + public int getType() + { + return this.type; + } + + public String getName() + { + return this.name; + } + + public String getValue() + { + return this.value; + } + + public boolean isUniform() + { + return this.type == 1; + } + + public boolean isUniform(String name) + { + return this.isUniform() && name.equals(this.name); + } + + public boolean isAttribute() + { + return this.type == 2; + } + + public boolean isAttribute(String name) + { + return this.isAttribute() && name.equals(this.name); + } + + public boolean isProperty() + { + return this.type == 6; + } + + public boolean isConstInt() + { + return this.type == 3; + } + + public boolean isConstFloat() + { + return this.type == 4; + } + + public boolean isConstBool() + { + return this.type == 5; + } + + public boolean isExtension() + { + return this.type == 7; + } + + public boolean isConstVec4() + { + return this.type == 8; + } + + public boolean isProperty(String name) + { + return this.isProperty() && name.equals(this.name); + } + + public boolean isProperty(String name, String value) + { + return this.isProperty(name) && value.equals(this.value); + } + + public boolean isConstInt(String name) + { + return this.isConstInt() && name.equals(this.name); + } + + public boolean isConstIntSuffix(String suffix) + { + return this.isConstInt() && this.name.endsWith(suffix); + } + + public boolean isConstFloat(String name) + { + return this.isConstFloat() && name.equals(this.name); + } + + public boolean isConstBool(String name) + { + return this.isConstBool() && name.equals(this.name); + } + + public boolean isExtension(String name) + { + return this.isExtension() && name.equals(this.name); + } + + public boolean isConstBoolSuffix(String suffix) + { + return this.isConstBool() && this.name.endsWith(suffix); + } + + public boolean isConstBoolSuffix(String suffix, boolean val) + { + return this.isConstBoolSuffix(suffix) && this.getValueBool() == val; + } + + public boolean isConstBool(String name1, String name2) + { + return this.isConstBool(name1) || this.isConstBool(name2); + } + + public boolean isConstBool(String name1, String name2, String name3) + { + return this.isConstBool(name1) || this.isConstBool(name2) || this.isConstBool(name3); + } + + public boolean isConstBool(String name, boolean val) + { + return this.isConstBool(name) && this.getValueBool() == val; + } + + public boolean isConstBool(String name1, String name2, boolean val) + { + return this.isConstBool(name1, name2) && this.getValueBool() == val; + } + + public boolean isConstBool(String name1, String name2, String name3, boolean val) + { + return this.isConstBool(name1, name2, name3) && this.getValueBool() == val; + } + + public boolean isConstVec4Suffix(String suffix) + { + return this.isConstVec4() && this.name.endsWith(suffix); + } + + public int getValueInt() + { + try + { + return Integer.parseInt(this.value); + } + catch (NumberFormatException var2) + { + throw new NumberFormatException("Invalid integer: " + this.value + ", line: " + this.line); + } + } + + public float getValueFloat() + { + try + { + return Float.parseFloat(this.value); + } + catch (NumberFormatException var2) + { + throw new NumberFormatException("Invalid float: " + this.value + ", line: " + this.line); + } + } + + public Vector4f getValueVec4() + { + if (this.value == null) + { + return null; + } + else + { + String s = this.value.trim(); + s = StrUtils.removePrefix(s, "vec4"); + s = StrUtils.trim(s, " ()"); + String[] astring = Config.tokenize(s, ", "); + + if (astring.length != 4) + { + return null; + } + else + { + float[] afloat = new float[4]; + + for (int i = 0; i < astring.length; ++i) + { + String s1 = astring[i]; + s1 = StrUtils.removeSuffix(s1, new String[] {"F", "f"}); + float f = Config.parseFloat(s1, Float.MAX_VALUE); + + if (f == Float.MAX_VALUE) + { + return null; + } + + afloat[i] = f; + } + + return new Vector4f(afloat[0], afloat[1], afloat[2], afloat[3]); + } + } + } + + public boolean getValueBool() + { + String s = this.value.toLowerCase(); + + if (!s.equals("true") && !s.equals("false")) + { + throw new RuntimeException("Invalid boolean: " + this.value + ", line: " + this.line); + } + else + { + return Boolean.valueOf(this.value).booleanValue(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderMacro.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderMacro.java new file mode 100644 index 0000000..88ef2fa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderMacro.java @@ -0,0 +1,33 @@ +package net.optifine.shaders.config; + +public class ShaderMacro +{ + private String name; + private String value; + + public ShaderMacro(String name, String value) + { + this.name = name; + this.value = value; + } + + public String getName() + { + return this.name; + } + + public String getValue() + { + return this.value; + } + + public String getSourceLine() + { + return "#define " + this.name + " " + this.value; + } + + public String toString() + { + return this.getSourceLine(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderMacros.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderMacros.java new file mode 100644 index 0000000..f4e5e55 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderMacros.java @@ -0,0 +1,184 @@ +package net.optifine.shaders.config; + +import net.minecraft.src.Config; +import net.minecraft.util.Util; +import net.optifine.shaders.Shaders; + +public class ShaderMacros +{ + private static String PREFIX_MACRO = "MC_"; + public static final String MC_VERSION = "MC_VERSION"; + public static final String MC_GL_VERSION = "MC_GL_VERSION"; + public static final String MC_GLSL_VERSION = "MC_GLSL_VERSION"; + public static final String MC_OS_WINDOWS = "MC_OS_WINDOWS"; + public static final String MC_OS_MAC = "MC_OS_MAC"; + public static final String MC_OS_LINUX = "MC_OS_LINUX"; + public static final String MC_OS_OTHER = "MC_OS_OTHER"; + public static final String MC_GL_VENDOR_ATI = "MC_GL_VENDOR_ATI"; + public static final String MC_GL_VENDOR_INTEL = "MC_GL_VENDOR_INTEL"; + public static final String MC_GL_VENDOR_NVIDIA = "MC_GL_VENDOR_NVIDIA"; + public static final String MC_GL_VENDOR_XORG = "MC_GL_VENDOR_XORG"; + public static final String MC_GL_VENDOR_OTHER = "MC_GL_VENDOR_OTHER"; + public static final String MC_GL_RENDERER_RADEON = "MC_GL_RENDERER_RADEON"; + public static final String MC_GL_RENDERER_GEFORCE = "MC_GL_RENDERER_GEFORCE"; + public static final String MC_GL_RENDERER_QUADRO = "MC_GL_RENDERER_QUADRO"; + public static final String MC_GL_RENDERER_INTEL = "MC_GL_RENDERER_INTEL"; + public static final String MC_GL_RENDERER_GALLIUM = "MC_GL_RENDERER_GALLIUM"; + public static final String MC_GL_RENDERER_MESA = "MC_GL_RENDERER_MESA"; + public static final String MC_GL_RENDERER_OTHER = "MC_GL_RENDERER_OTHER"; + public static final String MC_FXAA_LEVEL = "MC_FXAA_LEVEL"; + public static final String MC_NORMAL_MAP = "MC_NORMAL_MAP"; + public static final String MC_SPECULAR_MAP = "MC_SPECULAR_MAP"; + public static final String MC_RENDER_QUALITY = "MC_RENDER_QUALITY"; + public static final String MC_SHADOW_QUALITY = "MC_SHADOW_QUALITY"; + public static final String MC_HAND_DEPTH = "MC_HAND_DEPTH"; + public static final String MC_OLD_HAND_LIGHT = "MC_OLD_HAND_LIGHT"; + public static final String MC_OLD_LIGHTING = "MC_OLD_LIGHTING"; + private static ShaderMacro[] extensionMacros; + + public static String getOs() + { + Util.EnumOS util$enumos = Util.getOSType(); + + switch (util$enumos) + { + case WINDOWS: + return "MC_OS_WINDOWS"; + + case OSX: + return "MC_OS_MAC"; + + case LINUX: + return "MC_OS_LINUX"; + + default: + return "MC_OS_OTHER"; + } + } + + public static String getVendor() + { + String s = Config.openGlVendor; + + if (s == null) + { + return "MC_GL_VENDOR_OTHER"; + } + else + { + s = s.toLowerCase(); + return s.startsWith("ati") ? "MC_GL_VENDOR_ATI" : (s.startsWith("intel") ? "MC_GL_VENDOR_INTEL" : (s.startsWith("nvidia") ? "MC_GL_VENDOR_NVIDIA" : (s.startsWith("x.org") ? "MC_GL_VENDOR_XORG" : "MC_GL_VENDOR_OTHER"))); + } + } + + public static String getRenderer() + { + String s = Config.openGlRenderer; + + if (s == null) + { + return "MC_GL_RENDERER_OTHER"; + } + else + { + s = s.toLowerCase(); + return s.startsWith("amd") ? "MC_GL_RENDERER_RADEON" : (s.startsWith("ati") ? "MC_GL_RENDERER_RADEON" : (s.startsWith("radeon") ? "MC_GL_RENDERER_RADEON" : (s.startsWith("gallium") ? "MC_GL_RENDERER_GALLIUM" : (s.startsWith("intel") ? "MC_GL_RENDERER_INTEL" : (s.startsWith("geforce") ? "MC_GL_RENDERER_GEFORCE" : (s.startsWith("nvidia") ? "MC_GL_RENDERER_GEFORCE" : (s.startsWith("quadro") ? "MC_GL_RENDERER_QUADRO" : (s.startsWith("nvs") ? "MC_GL_RENDERER_QUADRO" : (s.startsWith("mesa") ? "MC_GL_RENDERER_MESA" : "MC_GL_RENDERER_OTHER"))))))))); + } + } + + public static String getPrefixMacro() + { + return PREFIX_MACRO; + } + + public static ShaderMacro[] getExtensions() + { + if (extensionMacros == null) + { + String[] astring = Config.getOpenGlExtensions(); + ShaderMacro[] ashadermacro = new ShaderMacro[astring.length]; + + for (int i = 0; i < astring.length; ++i) + { + ashadermacro[i] = new ShaderMacro(PREFIX_MACRO + astring[i], ""); + } + + extensionMacros = ashadermacro; + } + + return extensionMacros; + } + + public static String getFixedMacroLines() + { + StringBuilder stringbuilder = new StringBuilder(); + addMacroLine(stringbuilder, "MC_VERSION", Config.getMinecraftVersionInt()); + addMacroLine(stringbuilder, "MC_GL_VERSION " + Config.getGlVersion().toInt()); + addMacroLine(stringbuilder, "MC_GLSL_VERSION " + Config.getGlslVersion().toInt()); + addMacroLine(stringbuilder, getOs()); + addMacroLine(stringbuilder, getVendor()); + addMacroLine(stringbuilder, getRenderer()); + return stringbuilder.toString(); + } + + public static String getOptionMacroLines() + { + StringBuilder stringbuilder = new StringBuilder(); + + if (Shaders.configAntialiasingLevel > 0) + { + addMacroLine(stringbuilder, "MC_FXAA_LEVEL", Shaders.configAntialiasingLevel); + } + + if (Shaders.configNormalMap) + { + addMacroLine(stringbuilder, "MC_NORMAL_MAP"); + } + + if (Shaders.configSpecularMap) + { + addMacroLine(stringbuilder, "MC_SPECULAR_MAP"); + } + + addMacroLine(stringbuilder, "MC_RENDER_QUALITY", Shaders.configRenderResMul); + addMacroLine(stringbuilder, "MC_SHADOW_QUALITY", Shaders.configShadowResMul); + addMacroLine(stringbuilder, "MC_HAND_DEPTH", Shaders.configHandDepthMul); + + if (Shaders.isOldHandLight()) + { + addMacroLine(stringbuilder, "MC_OLD_HAND_LIGHT"); + } + + if (Shaders.isOldLighting()) + { + addMacroLine(stringbuilder, "MC_OLD_LIGHTING"); + } + + return stringbuilder.toString(); + } + + private static void addMacroLine(StringBuilder sb, String name, int value) + { + sb.append("#define "); + sb.append(name); + sb.append(" "); + sb.append(value); + sb.append("\n"); + } + + private static void addMacroLine(StringBuilder sb, String name, float value) + { + sb.append("#define "); + sb.append(name); + sb.append(" "); + sb.append(value); + sb.append("\n"); + } + + private static void addMacroLine(StringBuilder sb, String name) + { + sb.append("#define "); + sb.append(name); + sb.append("\n"); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOption.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOption.java new file mode 100644 index 0000000..8c97752 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOption.java @@ -0,0 +1,253 @@ +package net.optifine.shaders.config; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.src.Config; +import net.optifine.shaders.Shaders; +import net.optifine.util.StrUtils; + +public abstract class ShaderOption +{ + private String name = null; + private String description = null; + private String value = null; + private String[] values = null; + private String valueDefault = null; + private String[] paths = null; + private boolean enabled = true; + private boolean visible = true; + public static final String COLOR_GREEN = "\u00a7a"; + public static final String COLOR_RED = "\u00a7c"; + public static final String COLOR_BLUE = "\u00a79"; + + public ShaderOption(String name, String description, String value, String[] values, String valueDefault, String path) + { + this.name = name; + this.description = description; + this.value = value; + this.values = values; + this.valueDefault = valueDefault; + + if (path != null) + { + this.paths = new String[] {path}; + } + } + + public String getName() + { + return this.name; + } + + public String getDescription() + { + return this.description; + } + + public String getDescriptionText() + { + String s = Config.normalize(this.description); + s = StrUtils.removePrefix(s, "//"); + s = Shaders.translate("option." + this.getName() + ".comment", s); + return s; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getValue() + { + return this.value; + } + + public boolean setValue(String value) + { + int i = getIndex(value, this.values); + + if (i < 0) + { + return false; + } + else + { + this.value = value; + return true; + } + } + + public String getValueDefault() + { + return this.valueDefault; + } + + public void resetValue() + { + this.value = this.valueDefault; + } + + public void nextValue() + { + int i = getIndex(this.value, this.values); + + if (i >= 0) + { + i = (i + 1) % this.values.length; + this.value = this.values[i]; + } + } + + public void prevValue() + { + int i = getIndex(this.value, this.values); + + if (i >= 0) + { + i = (i - 1 + this.values.length) % this.values.length; + this.value = this.values[i]; + } + } + + private static int getIndex(String str, String[] strs) + { + for (int i = 0; i < strs.length; ++i) + { + String s = strs[i]; + + if (s.equals(str)) + { + return i; + } + } + + return -1; + } + + public String[] getPaths() + { + return this.paths; + } + + public void addPaths(String[] newPaths) + { + List list = Arrays.asList(this.paths); + + for (int i = 0; i < newPaths.length; ++i) + { + String s = newPaths[i]; + + if (!list.contains(s)) + { + this.paths = (String[])((String[])Config.addObjectToArray(this.paths, s)); + } + } + } + + public boolean isEnabled() + { + return this.enabled; + } + + public void setEnabled(boolean enabled) + { + this.enabled = enabled; + } + + public boolean isChanged() + { + return !Config.equals(this.value, this.valueDefault); + } + + public boolean isVisible() + { + return this.visible; + } + + public void setVisible(boolean visible) + { + this.visible = visible; + } + + public boolean isValidValue(String val) + { + return getIndex(val, this.values) >= 0; + } + + public String getNameText() + { + return Shaders.translate("option." + this.name, this.name); + } + + public String getValueText(String val) + { + return Shaders.translate("value." + this.name + "." + val, val); + } + + public String getValueColor(String val) + { + return ""; + } + + public boolean matchesLine(String line) + { + return false; + } + + public boolean checkUsed() + { + return false; + } + + public boolean isUsedInLine(String line) + { + return false; + } + + public String getSourceLine() + { + return null; + } + + public String[] getValues() + { + return (String[])this.values.clone(); + } + + public float getIndexNormalized() + { + if (this.values.length <= 1) + { + return 0.0F; + } + else + { + int i = getIndex(this.value, this.values); + + if (i < 0) + { + return 0.0F; + } + else + { + float f = 1.0F * (float)i / ((float)this.values.length - 1.0F); + return f; + } + } + } + + public void setIndexNormalized(float f) + { + if (this.values.length > 1) + { + f = Config.limit(f, 0.0F, 1.0F); + int i = Math.round(f * (float)(this.values.length - 1)); + this.value = this.values[i]; + } + } + + public String toString() + { + return "" + this.name + ", value: " + this.value + ", valueDefault: " + this.valueDefault + ", paths: " + Config.arrayToString((Object[])this.paths); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionProfile.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionProfile.java new file mode 100644 index 0000000..b40897f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionProfile.java @@ -0,0 +1,174 @@ +package net.optifine.shaders.config; + +import java.util.ArrayList; +import java.util.List; +import net.optifine.Lang; +import net.optifine.shaders.ShaderUtils; +import net.optifine.shaders.Shaders; + +public class ShaderOptionProfile extends ShaderOption +{ + private ShaderProfile[] profiles = null; + private ShaderOption[] options = null; + private static final String NAME_PROFILE = ""; + private static final String VALUE_CUSTOM = ""; + + public ShaderOptionProfile(ShaderProfile[] profiles, ShaderOption[] options) + { + super("", "", detectProfileName(profiles, options), getProfileNames(profiles), detectProfileName(profiles, options, true), (String)null); + this.profiles = profiles; + this.options = options; + } + + public void nextValue() + { + super.nextValue(); + + if (this.getValue().equals("")) + { + super.nextValue(); + } + + this.applyProfileOptions(); + } + + public void updateProfile() + { + ShaderProfile shaderprofile = this.getProfile(this.getValue()); + + if (shaderprofile == null || !ShaderUtils.matchProfile(shaderprofile, this.options, false)) + { + String s = detectProfileName(this.profiles, this.options); + this.setValue(s); + } + } + + private void applyProfileOptions() + { + ShaderProfile shaderprofile = this.getProfile(this.getValue()); + + if (shaderprofile != null) + { + String[] astring = shaderprofile.getOptions(); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + ShaderOption shaderoption = this.getOption(s); + + if (shaderoption != null) + { + String s1 = shaderprofile.getValue(s); + shaderoption.setValue(s1); + } + } + } + } + + private ShaderOption getOption(String name) + { + for (int i = 0; i < this.options.length; ++i) + { + ShaderOption shaderoption = this.options[i]; + + if (shaderoption.getName().equals(name)) + { + return shaderoption; + } + } + + return null; + } + + private ShaderProfile getProfile(String name) + { + for (int i = 0; i < this.profiles.length; ++i) + { + ShaderProfile shaderprofile = this.profiles[i]; + + if (shaderprofile.getName().equals(name)) + { + return shaderprofile; + } + } + + return null; + } + + public String getNameText() + { + return Lang.get("of.shaders.profile"); + } + + public String getValueText(String val) + { + return val.equals("") ? Lang.get("of.general.custom", "") : Shaders.translate("profile." + val, val); + } + + public String getValueColor(String val) + { + return val.equals("") ? "\u00a7c" : "\u00a7a"; + } + + public String getDescriptionText() + { + String s = Shaders.translate("profile.comment", (String)null); + + if (s != null) + { + return s; + } + else + { + StringBuffer stringbuffer = new StringBuffer(); + + for (int i = 0; i < this.profiles.length; ++i) + { + String s1 = this.profiles[i].getName(); + + if (s1 != null) + { + String s2 = Shaders.translate("profile." + s1 + ".comment", (String)null); + + if (s2 != null) + { + stringbuffer.append(s2); + + if (!s2.endsWith(". ")) + { + stringbuffer.append(". "); + } + } + } + } + + return stringbuffer.toString(); + } + } + + private static String detectProfileName(ShaderProfile[] profs, ShaderOption[] opts) + { + return detectProfileName(profs, opts, false); + } + + private static String detectProfileName(ShaderProfile[] profs, ShaderOption[] opts, boolean def) + { + ShaderProfile shaderprofile = ShaderUtils.detectProfile(profs, opts, def); + return shaderprofile == null ? "" : shaderprofile.getName(); + } + + private static String[] getProfileNames(ShaderProfile[] profs) + { + List list = new ArrayList(); + + for (int i = 0; i < profs.length; ++i) + { + ShaderProfile shaderprofile = profs[i]; + list.add(shaderprofile.getName()); + } + + list.add(""); + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionResolver.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionResolver.java new file mode 100644 index 0000000..aa38320 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionResolver.java @@ -0,0 +1,32 @@ +package net.optifine.shaders.config; + +import java.util.HashMap; +import java.util.Map; +import net.optifine.expr.IExpression; +import net.optifine.expr.IExpressionResolver; + +public class ShaderOptionResolver implements IExpressionResolver +{ + private Map mapOptions = new HashMap(); + + public ShaderOptionResolver(ShaderOption[] options) + { + for (int i = 0; i < options.length; ++i) + { + ShaderOption shaderoption = options[i]; + + if (shaderoption instanceof ShaderOptionSwitch) + { + ShaderOptionSwitch shaderoptionswitch = (ShaderOptionSwitch)shaderoption; + ExpressionShaderOptionSwitch expressionshaderoptionswitch = new ExpressionShaderOptionSwitch(shaderoptionswitch); + this.mapOptions.put(shaderoption.getName(), expressionshaderoptionswitch); + } + } + } + + public IExpression getExpression(String name) + { + ExpressionShaderOptionSwitch expressionshaderoptionswitch = (ExpressionShaderOptionSwitch)this.mapOptions.get(name); + return expressionshaderoptionswitch; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionRest.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionRest.java new file mode 100644 index 0000000..0726497 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionRest.java @@ -0,0 +1,9 @@ +package net.optifine.shaders.config; + +public class ShaderOptionRest extends ShaderOption +{ + public ShaderOptionRest(String name) + { + super(name, name, (String)null, new String[] {null}, (String)null, (String)null); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionScreen.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionScreen.java new file mode 100644 index 0000000..01fb889 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionScreen.java @@ -0,0 +1,21 @@ +package net.optifine.shaders.config; + +import net.optifine.shaders.Shaders; + +public class ShaderOptionScreen extends ShaderOption +{ + public ShaderOptionScreen(String name) + { + super(name, (String)null, (String)null, new String[0], (String)null, (String)null); + } + + public String getNameText() + { + return Shaders.translate("screen." + this.getName(), this.getName()); + } + + public String getDescriptionText() + { + return Shaders.translate("screen." + this.getName() + ".comment", (String)null); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionSwitch.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionSwitch.java new file mode 100644 index 0000000..4ee9a2e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionSwitch.java @@ -0,0 +1,105 @@ +package net.optifine.shaders.config; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.Config; +import net.optifine.Lang; +import net.optifine.util.StrUtils; + +public class ShaderOptionSwitch extends ShaderOption +{ + private static final Pattern PATTERN_DEFINE = Pattern.compile("^\\s*(//)?\\s*#define\\s+([A-Za-z0-9_]+)\\s*(//.*)?$"); + private static final Pattern PATTERN_IFDEF = Pattern.compile("^\\s*#if(n)?def\\s+([A-Za-z0-9_]+)(\\s*)?$"); + + public ShaderOptionSwitch(String name, String description, String value, String path) + { + super(name, description, value, new String[] {"false", "true"}, value, path); + } + + public String getSourceLine() + { + return isTrue(this.getValue()) ? "#define " + this.getName() + " // Shader option ON" : "//#define " + this.getName() + " // Shader option OFF"; + } + + public String getValueText(String val) + { + String s = super.getValueText(val); + return s != val ? s : (isTrue(val) ? Lang.getOn() : Lang.getOff()); + } + + public String getValueColor(String val) + { + return isTrue(val) ? "\u00a7a" : "\u00a7c"; + } + + public static ShaderOption parseOption(String line, String path) + { + Matcher matcher = PATTERN_DEFINE.matcher(line); + + if (!matcher.matches()) + { + return null; + } + else + { + String s = matcher.group(1); + String s1 = matcher.group(2); + String s2 = matcher.group(3); + + if (s1 != null && s1.length() > 0) + { + boolean flag = Config.equals(s, "//"); + boolean flag1 = !flag; + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOption shaderoption = new ShaderOptionSwitch(s1, s2, String.valueOf(flag1), path); + return shaderoption; + } + else + { + return null; + } + } + } + + public boolean matchesLine(String line) + { + Matcher matcher = PATTERN_DEFINE.matcher(line); + + if (!matcher.matches()) + { + return false; + } + else + { + String s = matcher.group(2); + return s.matches(this.getName()); + } + } + + public boolean checkUsed() + { + return true; + } + + public boolean isUsedInLine(String line) + { + Matcher matcher = PATTERN_IFDEF.matcher(line); + + if (matcher.matches()) + { + String s = matcher.group(2); + + if (s.equals(this.getName())) + { + return true; + } + } + + return false; + } + + public static boolean isTrue(String val) + { + return Boolean.valueOf(val).booleanValue(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionSwitchConst.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionSwitchConst.java new file mode 100644 index 0000000..41147fc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionSwitchConst.java @@ -0,0 +1,68 @@ +package net.optifine.shaders.config; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.optifine.util.StrUtils; + +public class ShaderOptionSwitchConst extends ShaderOptionSwitch +{ + private static final Pattern PATTERN_CONST = Pattern.compile("^\\s*const\\s*bool\\s*([A-Za-z0-9_]+)\\s*=\\s*(true|false)\\s*;\\s*(//.*)?$"); + + public ShaderOptionSwitchConst(String name, String description, String value, String path) + { + super(name, description, value, path); + } + + public String getSourceLine() + { + return "const bool " + this.getName() + " = " + this.getValue() + "; // Shader option " + this.getValue(); + } + + public static ShaderOption parseOption(String line, String path) + { + Matcher matcher = PATTERN_CONST.matcher(line); + + if (!matcher.matches()) + { + return null; + } + else + { + String s = matcher.group(1); + String s1 = matcher.group(2); + String s2 = matcher.group(3); + + if (s != null && s.length() > 0) + { + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOption shaderoption = new ShaderOptionSwitchConst(s, s2, s1, path); + shaderoption.setVisible(false); + return shaderoption; + } + else + { + return null; + } + } + } + + public boolean matchesLine(String line) + { + Matcher matcher = PATTERN_CONST.matcher(line); + + if (!matcher.matches()) + { + return false; + } + else + { + String s = matcher.group(1); + return s.matches(this.getName()); + } + } + + public boolean checkUsed() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionVariable.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionVariable.java new file mode 100644 index 0000000..5162a4c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionVariable.java @@ -0,0 +1,129 @@ +package net.optifine.shaders.config; + +import java.util.Arrays; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.Config; +import net.optifine.shaders.Shaders; +import net.optifine.util.StrUtils; + +public class ShaderOptionVariable extends ShaderOption +{ + private static final Pattern PATTERN_VARIABLE = Pattern.compile("^\\s*#define\\s+(\\w+)\\s+(-?[0-9\\.Ff]+|\\w+)\\s*(//.*)?$"); + + public ShaderOptionVariable(String name, String description, String value, String[] values, String path) + { + super(name, description, value, values, value, path); + this.setVisible(this.getValues().length > 1); + } + + public String getSourceLine() + { + return "#define " + this.getName() + " " + this.getValue() + " // Shader option " + this.getValue(); + } + + public String getValueText(String val) + { + String s = Shaders.translate("prefix." + this.getName(), ""); + String s1 = super.getValueText(val); + String s2 = Shaders.translate("suffix." + this.getName(), ""); + String s3 = s + s1 + s2; + return s3; + } + + public String getValueColor(String val) + { + String s = val.toLowerCase(); + return !s.equals("false") && !s.equals("off") ? "\u00a7a" : "\u00a7c"; + } + + public boolean matchesLine(String line) + { + Matcher matcher = PATTERN_VARIABLE.matcher(line); + + if (!matcher.matches()) + { + return false; + } + else + { + String s = matcher.group(1); + return s.matches(this.getName()); + } + } + + public static ShaderOption parseOption(String line, String path) + { + Matcher matcher = PATTERN_VARIABLE.matcher(line); + + if (!matcher.matches()) + { + return null; + } + else + { + String s = matcher.group(1); + String s1 = matcher.group(2); + String s2 = matcher.group(3); + String s3 = StrUtils.getSegment(s2, "[", "]"); + + if (s3 != null && s3.length() > 0) + { + s2 = s2.replace(s3, "").trim(); + } + + String[] astring = parseValues(s1, s3); + + if (s != null && s.length() > 0) + { + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOption shaderoption = new ShaderOptionVariable(s, s2, s1, astring, path); + return shaderoption; + } + else + { + return null; + } + } + } + + public static String[] parseValues(String value, String valuesStr) + { + String[] astring = new String[] {value}; + + if (valuesStr == null) + { + return astring; + } + else + { + valuesStr = valuesStr.trim(); + valuesStr = StrUtils.removePrefix(valuesStr, "["); + valuesStr = StrUtils.removeSuffix(valuesStr, "]"); + valuesStr = valuesStr.trim(); + + if (valuesStr.length() <= 0) + { + return astring; + } + else + { + String[] astring1 = Config.tokenize(valuesStr, " "); + + if (astring1.length <= 0) + { + return astring; + } + else + { + if (!Arrays.asList(astring1).contains(value)) + { + astring1 = (String[])((String[])Config.addObjectToArray(astring1, value, 0)); + } + + return astring1; + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionVariableConst.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionVariableConst.java new file mode 100644 index 0000000..3f4ae5d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderOptionVariableConst.java @@ -0,0 +1,73 @@ +package net.optifine.shaders.config; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.optifine.util.StrUtils; + +public class ShaderOptionVariableConst extends ShaderOptionVariable +{ + private String type = null; + private static final Pattern PATTERN_CONST = Pattern.compile("^\\s*const\\s*(float|int)\\s*([A-Za-z0-9_]+)\\s*=\\s*(-?[0-9\\.]+f?F?)\\s*;\\s*(//.*)?$"); + + public ShaderOptionVariableConst(String name, String type, String description, String value, String[] values, String path) + { + super(name, description, value, values, path); + this.type = type; + } + + public String getSourceLine() + { + return "const " + this.type + " " + this.getName() + " = " + this.getValue() + "; // Shader option " + this.getValue(); + } + + public boolean matchesLine(String line) + { + Matcher matcher = PATTERN_CONST.matcher(line); + + if (!matcher.matches()) + { + return false; + } + else + { + String s = matcher.group(2); + return s.matches(this.getName()); + } + } + + public static ShaderOption parseOption(String line, String path) + { + Matcher matcher = PATTERN_CONST.matcher(line); + + if (!matcher.matches()) + { + return null; + } + else + { + String s = matcher.group(1); + String s1 = matcher.group(2); + String s2 = matcher.group(3); + String s3 = matcher.group(4); + String s4 = StrUtils.getSegment(s3, "[", "]"); + + if (s4 != null && s4.length() > 0) + { + s3 = s3.replace(s4, "").trim(); + } + + String[] astring = parseValues(s2, s4); + + if (s1 != null && s1.length() > 0) + { + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOption shaderoption = new ShaderOptionVariableConst(s1, s, s3, s2, astring, path); + return shaderoption; + } + else + { + return null; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderPackParser.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderPackParser.java new file mode 100644 index 0000000..28119d6 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderPackParser.java @@ -0,0 +1,1141 @@ +package net.optifine.shaders.config; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.CharArrayReader; +import java.io.CharArrayWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.Config; +import net.optifine.expr.ExpressionFloatArrayCached; +import net.optifine.expr.ExpressionFloatCached; +import net.optifine.expr.ExpressionParser; +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpression; +import net.optifine.expr.IExpressionBool; +import net.optifine.expr.IExpressionFloat; +import net.optifine.expr.IExpressionFloatArray; +import net.optifine.expr.ParseException; +import net.optifine.render.GlAlphaState; +import net.optifine.render.GlBlendState; +import net.optifine.shaders.IShaderPack; +import net.optifine.shaders.Program; +import net.optifine.shaders.SMCLog; +import net.optifine.shaders.ShaderUtils; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.uniform.CustomUniform; +import net.optifine.shaders.uniform.CustomUniforms; +import net.optifine.shaders.uniform.ShaderExpressionResolver; +import net.optifine.shaders.uniform.UniformType; +import net.optifine.util.StrUtils; + +public class ShaderPackParser +{ + private static final Pattern PATTERN_VERSION = Pattern.compile("^\\s*#version\\s+.*$"); + private static final Pattern PATTERN_INCLUDE = Pattern.compile("^\\s*#include\\s+\"([A-Za-z0-9_/\\.]+)\".*$"); + private static final Set setConstNames = makeSetConstNames(); + private static final Map mapAlphaFuncs = makeMapAlphaFuncs(); + private static final Map mapBlendFactors = makeMapBlendFactors(); + + public static ShaderOption[] parseShaderPackOptions(IShaderPack shaderPack, String[] programNames, List listDimensions) + { + if (shaderPack == null) + { + return new ShaderOption[0]; + } + else + { + Map map = new HashMap(); + collectShaderOptions(shaderPack, "/shaders", programNames, map); + Iterator iterator = listDimensions.iterator(); + + while (iterator.hasNext()) + { + int i = ((Integer)iterator.next()).intValue(); + String s = "/shaders/world" + i; + collectShaderOptions(shaderPack, s, programNames, map); + } + + Collection collection = map.values(); + ShaderOption[] ashaderoption = (ShaderOption[])((ShaderOption[])collection.toArray(new ShaderOption[collection.size()])); + Comparator comparator = new Comparator() + { + public int compare(ShaderOption o1, ShaderOption o2) + { + return o1.getName().compareToIgnoreCase(o2.getName()); + } + }; + Arrays.sort(ashaderoption, comparator); + return ashaderoption; + } + } + + private static void collectShaderOptions(IShaderPack shaderPack, String dir, String[] programNames, Map mapOptions) + { + for (int i = 0; i < programNames.length; ++i) + { + String s = programNames[i]; + + if (!s.equals("")) + { + String s1 = dir + "/" + s + ".vsh"; + String s2 = dir + "/" + s + ".fsh"; + collectShaderOptions(shaderPack, s1, mapOptions); + collectShaderOptions(shaderPack, s2, mapOptions); + } + } + } + + private static void collectShaderOptions(IShaderPack sp, String path, Map mapOptions) + { + String[] astring = getLines(sp, path); + + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + ShaderOption shaderoption = getShaderOption(s, path); + + if (shaderoption != null && !shaderoption.getName().startsWith(ShaderMacros.getPrefixMacro()) && (!shaderoption.checkUsed() || isOptionUsed(shaderoption, astring))) + { + String s1 = shaderoption.getName(); + ShaderOption shaderoption1 = (ShaderOption)mapOptions.get(s1); + + if (shaderoption1 != null) + { + if (!Config.equals(shaderoption1.getValueDefault(), shaderoption.getValueDefault())) + { + Config.warn("Ambiguous shader option: " + shaderoption.getName()); + Config.warn(" - in " + Config.arrayToString((Object[])shaderoption1.getPaths()) + ": " + shaderoption1.getValueDefault()); + Config.warn(" - in " + Config.arrayToString((Object[])shaderoption.getPaths()) + ": " + shaderoption.getValueDefault()); + shaderoption1.setEnabled(false); + } + + if (shaderoption1.getDescription() == null || shaderoption1.getDescription().length() <= 0) + { + shaderoption1.setDescription(shaderoption.getDescription()); + } + + shaderoption1.addPaths(shaderoption.getPaths()); + } + else + { + mapOptions.put(s1, shaderoption); + } + } + } + } + + private static boolean isOptionUsed(ShaderOption so, String[] lines) + { + for (int i = 0; i < lines.length; ++i) + { + String s = lines[i]; + + if (so.isUsedInLine(s)) + { + return true; + } + } + + return false; + } + + private static String[] getLines(IShaderPack sp, String path) + { + try + { + List list = new ArrayList(); + String s = loadFile(path, sp, 0, list, 0); + + if (s == null) + { + return new String[0]; + } + else + { + ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(s.getBytes()); + String[] astring = Config.readLines((InputStream)bytearrayinputstream); + return astring; + } + } + catch (IOException ioexception) + { + Config.dbg(ioexception.getClass().getName() + ": " + ioexception.getMessage()); + return new String[0]; + } + } + + private static ShaderOption getShaderOption(String line, String path) + { + ShaderOption shaderoption = null; + + if (shaderoption == null) + { + shaderoption = ShaderOptionSwitch.parseOption(line, path); + } + + if (shaderoption == null) + { + shaderoption = ShaderOptionVariable.parseOption(line, path); + } + + if (shaderoption != null) + { + return shaderoption; + } + else + { + if (shaderoption == null) + { + shaderoption = ShaderOptionSwitchConst.parseOption(line, path); + } + + if (shaderoption == null) + { + shaderoption = ShaderOptionVariableConst.parseOption(line, path); + } + + return shaderoption != null && setConstNames.contains(shaderoption.getName()) ? shaderoption : null; + } + } + + private static Set makeSetConstNames() + { + Set set = new HashSet(); + set.add("shadowMapResolution"); + set.add("shadowMapFov"); + set.add("shadowDistance"); + set.add("shadowDistanceRenderMul"); + set.add("shadowIntervalSize"); + set.add("generateShadowMipmap"); + set.add("generateShadowColorMipmap"); + set.add("shadowHardwareFiltering"); + set.add("shadowHardwareFiltering0"); + set.add("shadowHardwareFiltering1"); + set.add("shadowtex0Mipmap"); + set.add("shadowtexMipmap"); + set.add("shadowtex1Mipmap"); + set.add("shadowcolor0Mipmap"); + set.add("shadowColor0Mipmap"); + set.add("shadowcolor1Mipmap"); + set.add("shadowColor1Mipmap"); + set.add("shadowtex0Nearest"); + set.add("shadowtexNearest"); + set.add("shadow0MinMagNearest"); + set.add("shadowtex1Nearest"); + set.add("shadow1MinMagNearest"); + set.add("shadowcolor0Nearest"); + set.add("shadowColor0Nearest"); + set.add("shadowColor0MinMagNearest"); + set.add("shadowcolor1Nearest"); + set.add("shadowColor1Nearest"); + set.add("shadowColor1MinMagNearest"); + set.add("wetnessHalflife"); + set.add("drynessHalflife"); + set.add("eyeBrightnessHalflife"); + set.add("centerDepthHalflife"); + set.add("sunPathRotation"); + set.add("ambientOcclusionLevel"); + set.add("superSamplingLevel"); + set.add("noiseTextureResolution"); + return set; + } + + public static ShaderProfile[] parseProfiles(Properties props, ShaderOption[] shaderOptions) + { + String s = "profile."; + List list = new ArrayList(); + + for (Object e : props.keySet()) + { + String s1 = (String) e; + if (s1.startsWith(s)) + { + String s2 = s1.substring(s.length()); + props.getProperty(s1); + Set set = new HashSet(); + ShaderProfile shaderprofile = parseProfile(s2, props, set, shaderOptions); + + if (shaderprofile != null) + { + list.add(shaderprofile); + } + } + } + + if (list.size() <= 0) + { + return null; + } + else + { + ShaderProfile[] ashaderprofile = (ShaderProfile[])((ShaderProfile[])list.toArray(new ShaderProfile[list.size()])); + return ashaderprofile; + } + } + + public static Map parseProgramConditions(Properties props, ShaderOption[] shaderOptions) + { + String s = "program."; + Pattern pattern = Pattern.compile("program\\.([^.]+)\\.enabled"); + Map map = new HashMap(); + + for (Object e : props.keySet()) + { + String s1 = (String) e; + Matcher matcher = pattern.matcher(s1); + + if (matcher.matches()) + { + String s2 = matcher.group(1); + String s3 = props.getProperty(s1).trim(); + IExpressionBool iexpressionbool = parseOptionExpression(s3, shaderOptions); + + if (iexpressionbool == null) + { + SMCLog.severe("Error parsing program condition: " + s1); + } + else + { + map.put(s2, iexpressionbool); + } + } + } + + return map; + } + + private static IExpressionBool parseOptionExpression(String val, ShaderOption[] shaderOptions) + { + try + { + ShaderOptionResolver shaderoptionresolver = new ShaderOptionResolver(shaderOptions); + ExpressionParser expressionparser = new ExpressionParser(shaderoptionresolver); + IExpressionBool iexpressionbool = expressionparser.parseBool(val); + return iexpressionbool; + } + catch (ParseException parseexception) + { + SMCLog.warning(parseexception.getClass().getName() + ": " + parseexception.getMessage()); + return null; + } + } + + public static Set parseOptionSliders(Properties props, ShaderOption[] shaderOptions) + { + Set set = new HashSet(); + String s = props.getProperty("sliders"); + + if (s == null) + { + return set; + } + else + { + String[] astring = Config.tokenize(s, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s1 = astring[i]; + ShaderOption shaderoption = ShaderUtils.getShaderOption(s1, shaderOptions); + + if (shaderoption == null) + { + Config.warn("Invalid shader option: " + s1); + } + else + { + set.add(s1); + } + } + + return set; + } + } + + private static ShaderProfile parseProfile(String name, Properties props, Set parsedProfiles, ShaderOption[] shaderOptions) + { + String s = "profile."; + String s1 = s + name; + + if (parsedProfiles.contains(s1)) + { + Config.warn("[Shaders] Profile already parsed: " + name); + return null; + } + else + { + parsedProfiles.add(name); + ShaderProfile shaderprofile = new ShaderProfile(name); + String s2 = props.getProperty(s1); + String[] astring = Config.tokenize(s2, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s3 = astring[i]; + + if (s3.startsWith(s)) + { + String s4 = s3.substring(s.length()); + ShaderProfile shaderprofile1 = parseProfile(s4, props, parsedProfiles, shaderOptions); + + if (shaderprofile != null) + { + shaderprofile.addOptionValues(shaderprofile1); + shaderprofile.addDisabledPrograms(shaderprofile1.getDisabledPrograms()); + } + } + else + { + String[] astring1 = Config.tokenize(s3, ":="); + + if (astring1.length == 1) + { + String s7 = astring1[0]; + boolean flag = true; + + if (s7.startsWith("!")) + { + flag = false; + s7 = s7.substring(1); + } + + String s5 = "program."; + + if (s7.startsWith(s5)) + { + String s6 = s7.substring(s5.length()); + + if (!Shaders.isProgramPath(s6)) + { + Config.warn("Invalid program: " + s6 + " in profile: " + shaderprofile.getName()); + } + else if (flag) + { + shaderprofile.removeDisabledProgram(s6); + } + else + { + shaderprofile.addDisabledProgram(s6); + } + } + else + { + ShaderOption shaderoption1 = ShaderUtils.getShaderOption(s7, shaderOptions); + + if (!(shaderoption1 instanceof ShaderOptionSwitch)) + { + Config.warn("[Shaders] Invalid option: " + s7); + } + else + { + shaderprofile.addOptionValue(s7, String.valueOf(flag)); + shaderoption1.setVisible(true); + } + } + } + else if (astring1.length != 2) + { + Config.warn("[Shaders] Invalid option value: " + s3); + } + else + { + String s8 = astring1[0]; + String s9 = astring1[1]; + ShaderOption shaderoption = ShaderUtils.getShaderOption(s8, shaderOptions); + + if (shaderoption == null) + { + Config.warn("[Shaders] Invalid option: " + s3); + } + else if (!shaderoption.isValidValue(s9)) + { + Config.warn("[Shaders] Invalid value: " + s3); + } + else + { + shaderoption.setVisible(true); + shaderprofile.addOptionValue(s8, s9); + } + } + } + } + + return shaderprofile; + } + } + + public static Map parseGuiScreens(Properties props, ShaderProfile[] shaderProfiles, ShaderOption[] shaderOptions) + { + Map map = new HashMap(); + parseGuiScreen("screen", props, map, shaderProfiles, shaderOptions); + return map.isEmpty() ? null : map; + } + + private static boolean parseGuiScreen(String key, Properties props, Map map, ShaderProfile[] shaderProfiles, ShaderOption[] shaderOptions) + { + String s = props.getProperty(key); + + if (s == null) + { + return false; + } + else + { + List list = new ArrayList(); + Set set = new HashSet(); + String[] astring = Config.tokenize(s, " "); + + for (int i = 0; i < astring.length; ++i) + { + String s1 = astring[i]; + + if (s1.equals("")) + { + list.add((ShaderOption)null); + } + else if (set.contains(s1)) + { + Config.warn("[Shaders] Duplicate option: " + s1 + ", key: " + key); + } + else + { + set.add(s1); + + if (s1.equals("")) + { + if (shaderProfiles == null) + { + Config.warn("[Shaders] Option profile can not be used, no profiles defined: " + s1 + ", key: " + key); + } + else + { + ShaderOptionProfile shaderoptionprofile = new ShaderOptionProfile(shaderProfiles, shaderOptions); + list.add(shaderoptionprofile); + } + } + else if (s1.equals("*")) + { + ShaderOption shaderoption1 = new ShaderOptionRest(""); + list.add(shaderoption1); + } + else if (s1.startsWith("[") && s1.endsWith("]")) + { + String s3 = StrUtils.removePrefixSuffix(s1, "[", "]"); + + if (!s3.matches("^[a-zA-Z0-9_]+$")) + { + Config.warn("[Shaders] Invalid screen: " + s1 + ", key: " + key); + } + else if (!parseGuiScreen("screen." + s3, props, map, shaderProfiles, shaderOptions)) + { + Config.warn("[Shaders] Invalid screen: " + s1 + ", key: " + key); + } + else + { + ShaderOptionScreen shaderoptionscreen = new ShaderOptionScreen(s3); + list.add(shaderoptionscreen); + } + } + else + { + ShaderOption shaderoption = ShaderUtils.getShaderOption(s1, shaderOptions); + + if (shaderoption == null) + { + Config.warn("[Shaders] Invalid option: " + s1 + ", key: " + key); + list.add((ShaderOption)null); + } + else + { + shaderoption.setVisible(true); + list.add(shaderoption); + } + } + } + } + + ShaderOption[] ashaderoption = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + String s2 = props.getProperty(key + ".columns"); + int j = Config.parseInt(s2, 2); + ScreenShaderOptions screenshaderoptions = new ScreenShaderOptions(key, ashaderoption, j); + map.put(key, screenshaderoptions); + return true; + } + } + + public static BufferedReader resolveIncludes(BufferedReader reader, String filePath, IShaderPack shaderPack, int fileIndex, List listFiles, int includeLevel) throws IOException + { + String s = "/"; + int i = filePath.lastIndexOf("/"); + + if (i >= 0) + { + s = filePath.substring(0, i); + } + + CharArrayWriter chararraywriter = new CharArrayWriter(); + int j = -1; + Set set = new LinkedHashSet(); + int k = 1; + + while (true) + { + String s1 = reader.readLine(); + + if (s1 == null) + { + char[] achar = chararraywriter.toCharArray(); + + if (j >= 0 && set.size() > 0) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (ShaderMacro shadermacro : set) + { + stringbuilder.append("#define "); + stringbuilder.append(shadermacro.getName()); + stringbuilder.append(" "); + stringbuilder.append(shadermacro.getValue()); + stringbuilder.append("\n"); + } + + String s7 = stringbuilder.toString(); + StringBuilder stringbuilder1 = new StringBuilder(new String(achar)); + stringbuilder1.insert(j, s7); + String s9 = stringbuilder1.toString(); + achar = s9.toCharArray(); + } + + CharArrayReader chararrayreader = new CharArrayReader(achar); + return new BufferedReader(chararrayreader); + } + + if (j < 0) + { + Matcher matcher = PATTERN_VERSION.matcher(s1); + + if (matcher.matches()) + { + String s2 = ShaderMacros.getFixedMacroLines() + ShaderMacros.getOptionMacroLines(); + String s3 = s1 + "\n" + s2; + String s4 = "#line " + (k + 1) + " " + fileIndex; + s1 = s3 + s4; + j = chararraywriter.size() + s3.length(); + } + } + + Matcher matcher1 = PATTERN_INCLUDE.matcher(s1); + + if (matcher1.matches()) + { + String s6 = matcher1.group(1); + boolean flag = s6.startsWith("/"); + String s8 = flag ? "/shaders" + s6 : s + "/" + s6; + + if (!listFiles.contains(s8)) + { + listFiles.add(s8); + } + + int l = listFiles.indexOf(s8) + 1; + s1 = loadFile(s8, shaderPack, l, listFiles, includeLevel); + + if (s1 == null) + { + throw new IOException("Included file not found: " + filePath); + } + + if (s1.endsWith("\n")) + { + s1 = s1.substring(0, s1.length() - 1); + } + + String s5 = "#line 1 " + l + "\n"; + + if (s1.startsWith("#version ")) + { + s5 = ""; + } + + s1 = s5 + s1 + "\n" + "#line " + (k + 1) + " " + fileIndex; + } + + if (j >= 0 && s1.contains(ShaderMacros.getPrefixMacro())) + { + ShaderMacro[] ashadermacro = findMacros(s1, ShaderMacros.getExtensions()); + + for (int i1 = 0; i1 < ashadermacro.length; ++i1) + { + ShaderMacro shadermacro1 = ashadermacro[i1]; + set.add(shadermacro1); + } + } + + chararraywriter.write(s1); + chararraywriter.write("\n"); + ++k; + } + } + + private static ShaderMacro[] findMacros(String line, ShaderMacro[] macros) + { + List list = new ArrayList(); + + for (int i = 0; i < macros.length; ++i) + { + ShaderMacro shadermacro = macros[i]; + + if (line.contains(shadermacro.getName())) + { + list.add(shadermacro); + } + } + + ShaderMacro[] ashadermacro = (ShaderMacro[])list.toArray(new ShaderMacro[list.size()]); + return ashadermacro; + } + + private static String loadFile(String filePath, IShaderPack shaderPack, int fileIndex, List listFiles, int includeLevel) throws IOException + { + if (includeLevel >= 10) + { + throw new IOException("#include depth exceeded: " + includeLevel + ", file: " + filePath); + } + else + { + ++includeLevel; + InputStream inputstream = shaderPack.getResourceAsStream(filePath); + + if (inputstream == null) + { + return null; + } + else + { + InputStreamReader inputstreamreader = new InputStreamReader(inputstream, "ASCII"); + BufferedReader bufferedreader = new BufferedReader(inputstreamreader); + bufferedreader = resolveIncludes(bufferedreader, filePath, shaderPack, fileIndex, listFiles, includeLevel); + CharArrayWriter chararraywriter = new CharArrayWriter(); + + while (true) + { + String s = bufferedreader.readLine(); + + if (s == null) + { + return chararraywriter.toString(); + } + + chararraywriter.write(s); + chararraywriter.write("\n"); + } + } + } + } + + public static CustomUniforms parseCustomUniforms(Properties props) + { + String s = "uniform"; + String s1 = "variable"; + String s2 = s + "."; + String s3 = s1 + "."; + Map map = new HashMap(); + List list = new ArrayList(); + + for (Object e : props.keySet()) + { + String s4 = (String) e; + String[] astring = Config.tokenize(s4, "."); + + if (astring.length == 3) + { + String s5 = astring[0]; + String s6 = astring[1]; + String s7 = astring[2]; + String s8 = props.getProperty(s4).trim(); + + if (map.containsKey(s7)) + { + SMCLog.warning("Expression already defined: " + s7); + } + else if (s5.equals(s) || s5.equals(s1)) + { + SMCLog.info("Custom " + s5 + ": " + s7); + CustomUniform customuniform = parseCustomUniform(s5, s7, s6, s8, map); + + if (customuniform != null) + { + map.put(s7, customuniform.getExpression()); + + if (!s5.equals(s1)) + { + list.add(customuniform); + } + } + } + } + } + + if (list.size() <= 0) + { + return null; + } + else + { + CustomUniform[] acustomuniform = (CustomUniform[])((CustomUniform[])list.toArray(new CustomUniform[list.size()])); + CustomUniforms customuniforms = new CustomUniforms(acustomuniform, map); + return customuniforms; + } + } + + private static CustomUniform parseCustomUniform(String kind, String name, String type, String src, Map mapExpressions) + { + try + { + UniformType uniformtype = UniformType.parse(type); + + if (uniformtype == null) + { + SMCLog.warning("Unknown " + kind + " type: " + uniformtype); + return null; + } + else + { + ShaderExpressionResolver shaderexpressionresolver = new ShaderExpressionResolver(mapExpressions); + ExpressionParser expressionparser = new ExpressionParser(shaderexpressionresolver); + IExpression iexpression = expressionparser.parse(src); + ExpressionType expressiontype = iexpression.getExpressionType(); + + if (!uniformtype.matchesExpressionType(expressiontype)) + { + SMCLog.warning("Expression type does not match " + kind + " type, expression: " + expressiontype + ", " + kind + ": " + uniformtype + " " + name); + return null; + } + else + { + iexpression = makeExpressionCached(iexpression); + CustomUniform customuniform = new CustomUniform(name, uniformtype, iexpression); + return customuniform; + } + } + } + catch (ParseException parseexception) + { + SMCLog.warning(parseexception.getClass().getName() + ": " + parseexception.getMessage()); + return null; + } + } + + private static IExpression makeExpressionCached(IExpression expr) + { + return (IExpression)(expr instanceof IExpressionFloat ? new ExpressionFloatCached((IExpressionFloat)expr) : (expr instanceof IExpressionFloatArray ? new ExpressionFloatArrayCached((IExpressionFloatArray)expr) : expr)); + } + + public static void parseAlphaStates(Properties props) + { + for (Object e : props.keySet()) + { + String s = (String) e; + String[] astring = Config.tokenize(s, "."); + + if (astring.length == 2) + { + String s1 = astring[0]; + String s2 = astring[1]; + + if (s1.equals("alphaTest")) + { + Program program = Shaders.getProgram(s2); + + if (program == null) + { + SMCLog.severe("Invalid program name: " + s2); + } + else + { + String s3 = props.getProperty(s).trim(); + GlAlphaState glalphastate = parseAlphaState(s3); + + if (glalphastate != null) + { + program.setAlphaState(glalphastate); + } + } + } + } + } + } + + private static GlAlphaState parseAlphaState(String str) + { + String[] astring = Config.tokenize(str, " "); + + if (astring.length == 1) + { + String s = astring[0]; + + if (s.equals("off") || s.equals("false")) + { + return new GlAlphaState(false); + } + } + else if (astring.length == 2) + { + String s2 = astring[0]; + String s1 = astring[1]; + Integer integer = (Integer)mapAlphaFuncs.get(s2); + float f = Config.parseFloat(s1, -1.0F); + + if (integer != null && f >= 0.0F) + { + return new GlAlphaState(true, integer.intValue(), f); + } + } + + SMCLog.severe("Invalid alpha test: " + str); + return null; + } + + public static void parseBlendStates(Properties props) + { + for (Object e : props.keySet()) + { + String s = (String) e; + String[] astring = Config.tokenize(s, "."); + + if (astring.length == 2) + { + String s1 = astring[0]; + String s2 = astring[1]; + + if (s1.equals("blend")) + { + Program program = Shaders.getProgram(s2); + + if (program == null) + { + SMCLog.severe("Invalid program name: " + s2); + } + else + { + String s3 = props.getProperty(s).trim(); + GlBlendState glblendstate = parseBlendState(s3); + + if (glblendstate != null) + { + program.setBlendState(glblendstate); + } + } + } + } + } + } + + private static GlBlendState parseBlendState(String str) + { + String[] astring = Config.tokenize(str, " "); + + if (astring.length == 1) + { + String s = astring[0]; + + if (s.equals("off") || s.equals("false")) + { + return new GlBlendState(false); + } + } + else if (astring.length == 2 || astring.length == 4) + { + String s4 = astring[0]; + String s1 = astring[1]; + String s2 = s4; + String s3 = s1; + + if (astring.length == 4) + { + s2 = astring[2]; + s3 = astring[3]; + } + + Integer integer = (Integer)mapBlendFactors.get(s4); + Integer integer1 = (Integer)mapBlendFactors.get(s1); + Integer integer2 = (Integer)mapBlendFactors.get(s2); + Integer integer3 = (Integer)mapBlendFactors.get(s3); + + if (integer != null && integer1 != null && integer2 != null && integer3 != null) + { + return new GlBlendState(true, integer.intValue(), integer1.intValue(), integer2.intValue(), integer3.intValue()); + } + } + + SMCLog.severe("Invalid blend mode: " + str); + return null; + } + + public static void parseRenderScales(Properties props) + { + for (Object e : props.keySet()) + { + String s = (String) e; + String[] astring = Config.tokenize(s, "."); + + if (astring.length == 2) + { + String s1 = astring[0]; + String s2 = astring[1]; + + if (s1.equals("scale")) + { + Program program = Shaders.getProgram(s2); + + if (program == null) + { + SMCLog.severe("Invalid program name: " + s2); + } + else + { + String s3 = props.getProperty(s).trim(); + RenderScale renderscale = parseRenderScale(s3); + + if (renderscale != null) + { + program.setRenderScale(renderscale); + } + } + } + } + } + } + + private static RenderScale parseRenderScale(String str) + { + String[] astring = Config.tokenize(str, " "); + float f = Config.parseFloat(astring[0], -1.0F); + float f1 = 0.0F; + float f2 = 0.0F; + + if (astring.length > 1) + { + if (astring.length != 3) + { + SMCLog.severe("Invalid render scale: " + str); + return null; + } + + f1 = Config.parseFloat(astring[1], -1.0F); + f2 = Config.parseFloat(astring[2], -1.0F); + } + + if (Config.between(f, 0.0F, 1.0F) && Config.between(f1, 0.0F, 1.0F) && Config.between(f2, 0.0F, 1.0F)) + { + return new RenderScale(f, f1, f2); + } + else + { + SMCLog.severe("Invalid render scale: " + str); + return null; + } + } + + public static void parseBuffersFlip(Properties props) + { + for (Object e : props.keySet()) + { + String s = (String) e; + String[] astring = Config.tokenize(s, "."); + + if (astring.length == 3) + { + String s1 = astring[0]; + String s2 = astring[1]; + String s3 = astring[2]; + + if (s1.equals("flip")) + { + Program program = Shaders.getProgram(s2); + + if (program == null) + { + SMCLog.severe("Invalid program name: " + s2); + } + else + { + Boolean[] aboolean = program.getBuffersFlip(); + int i = Shaders.getBufferIndexFromString(s3); + + if (i >= 0 && i < aboolean.length) + { + String s4 = props.getProperty(s).trim(); + Boolean obool = Config.parseBoolean(s4, (Boolean)null); + + if (obool == null) + { + SMCLog.severe("Invalid boolean value: " + s4); + } + else + { + aboolean[i] = obool; + } + } + else + { + SMCLog.severe("Invalid buffer name: " + s3); + } + } + } + } + } + } + + private static Map makeMapAlphaFuncs() + { + Map map = new HashMap(); + map.put("NEVER", new Integer(512)); + map.put("LESS", new Integer(513)); + map.put("EQUAL", new Integer(514)); + map.put("LEQUAL", new Integer(515)); + map.put("GREATER", new Integer(516)); + map.put("NOTEQUAL", new Integer(517)); + map.put("GEQUAL", new Integer(518)); + map.put("ALWAYS", new Integer(519)); + return Collections.unmodifiableMap(map); + } + + private static Map makeMapBlendFactors() + { + Map map = new HashMap(); + map.put("ZERO", new Integer(0)); + map.put("ONE", new Integer(1)); + map.put("SRC_COLOR", new Integer(768)); + map.put("ONE_MINUS_SRC_COLOR", new Integer(769)); + map.put("DST_COLOR", new Integer(774)); + map.put("ONE_MINUS_DST_COLOR", new Integer(775)); + map.put("SRC_ALPHA", new Integer(770)); + map.put("ONE_MINUS_SRC_ALPHA", new Integer(771)); + map.put("DST_ALPHA", new Integer(772)); + map.put("ONE_MINUS_DST_ALPHA", new Integer(773)); + map.put("CONSTANT_COLOR", new Integer(32769)); + map.put("ONE_MINUS_CONSTANT_COLOR", new Integer(32770)); + map.put("CONSTANT_ALPHA", new Integer(32771)); + map.put("ONE_MINUS_CONSTANT_ALPHA", new Integer(32772)); + map.put("SRC_ALPHA_SATURATE", new Integer(776)); + return Collections.unmodifiableMap(map); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderParser.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderParser.java new file mode 100644 index 0000000..d65070c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderParser.java @@ -0,0 +1,147 @@ +package net.optifine.shaders.config; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ShaderParser +{ + public static Pattern PATTERN_UNIFORM = Pattern.compile("\\s*uniform\\s+\\w+\\s+(\\w+).*"); + public static Pattern PATTERN_ATTRIBUTE = Pattern.compile("\\s*attribute\\s+\\w+\\s+(\\w+).*"); + public static Pattern PATTERN_CONST_INT = Pattern.compile("\\s*const\\s+int\\s+(\\w+)\\s*=\\s*([-+.\\w]+)\\s*;.*"); + public static Pattern PATTERN_CONST_FLOAT = Pattern.compile("\\s*const\\s+float\\s+(\\w+)\\s*=\\s*([-+.\\w]+)\\s*;.*"); + public static Pattern PATTERN_CONST_VEC4 = Pattern.compile("\\s*const\\s+vec4\\s+(\\w+)\\s*=\\s*(.+)\\s*;.*"); + public static Pattern PATTERN_CONST_BOOL = Pattern.compile("\\s*const\\s+bool\\s+(\\w+)\\s*=\\s*(\\w+)\\s*;.*"); + public static Pattern PATTERN_PROPERTY = Pattern.compile("\\s*(/\\*|//)?\\s*([A-Z]+):\\s*(\\w+)\\s*(\\*/.*|\\s*)"); + public static Pattern PATTERN_EXTENSION = Pattern.compile("\\s*#\\s*extension\\s+(\\w+)\\s*:\\s*(\\w+).*"); + public static Pattern PATTERN_DEFERRED_FSH = Pattern.compile(".*deferred[0-9]*\\.fsh"); + public static Pattern PATTERN_COMPOSITE_FSH = Pattern.compile(".*composite[0-9]*\\.fsh"); + public static Pattern PATTERN_FINAL_FSH = Pattern.compile(".*final\\.fsh"); + public static Pattern PATTERN_DRAW_BUFFERS = Pattern.compile("[0-7N]*"); + + public static ShaderLine parseLine(String line) + { + Matcher matcher = PATTERN_UNIFORM.matcher(line); + + if (matcher.matches()) + { + return new ShaderLine(1, matcher.group(1), "", line); + } + else + { + Matcher matcher1 = PATTERN_ATTRIBUTE.matcher(line); + + if (matcher1.matches()) + { + return new ShaderLine(2, matcher1.group(1), "", line); + } + else + { + Matcher matcher2 = PATTERN_PROPERTY.matcher(line); + + if (matcher2.matches()) + { + return new ShaderLine(6, matcher2.group(2), matcher2.group(3), line); + } + else + { + Matcher matcher3 = PATTERN_CONST_INT.matcher(line); + + if (matcher3.matches()) + { + return new ShaderLine(3, matcher3.group(1), matcher3.group(2), line); + } + else + { + Matcher matcher4 = PATTERN_CONST_FLOAT.matcher(line); + + if (matcher4.matches()) + { + return new ShaderLine(4, matcher4.group(1), matcher4.group(2), line); + } + else + { + Matcher matcher5 = PATTERN_CONST_BOOL.matcher(line); + + if (matcher5.matches()) + { + return new ShaderLine(5, matcher5.group(1), matcher5.group(2), line); + } + else + { + Matcher matcher6 = PATTERN_EXTENSION.matcher(line); + + if (matcher6.matches()) + { + return new ShaderLine(7, matcher6.group(1), matcher6.group(2), line); + } + else + { + Matcher matcher7 = PATTERN_CONST_VEC4.matcher(line); + return matcher7.matches() ? new ShaderLine(8, matcher7.group(1), matcher7.group(2), line) : null; + } + } + } + } + } + } + } + } + + public static int getIndex(String uniform, String prefix, int minIndex, int maxIndex) + { + if (uniform.length() != prefix.length() + 1) + { + return -1; + } + else if (!uniform.startsWith(prefix)) + { + return -1; + } + else + { + int i = uniform.charAt(prefix.length()) - 48; + return i >= minIndex && i <= maxIndex ? i : -1; + } + } + + public static int getShadowDepthIndex(String uniform) + { + return uniform.equals("shadow") ? 0 : (uniform.equals("watershadow") ? 1 : getIndex(uniform, "shadowtex", 0, 1)); + } + + public static int getShadowColorIndex(String uniform) + { + return uniform.equals("shadowcolor") ? 0 : getIndex(uniform, "shadowcolor", 0, 1); + } + + public static int getDepthIndex(String uniform) + { + return getIndex(uniform, "depthtex", 0, 2); + } + + public static int getColorIndex(String uniform) + { + int i = getIndex(uniform, "gaux", 1, 4); + return i > 0 ? i + 3 : getIndex(uniform, "colortex", 4, 7); + } + + public static boolean isDeferred(String filename) + { + return PATTERN_DEFERRED_FSH.matcher(filename).matches(); + } + + public static boolean isComposite(String filename) + { + return PATTERN_COMPOSITE_FSH.matcher(filename).matches(); + } + + public static boolean isFinal(String filename) + { + return PATTERN_FINAL_FSH.matcher(filename).matches(); + } + + public static boolean isValidDrawBuffers(String str) + { + return PATTERN_DRAW_BUFFERS.matcher(str).matches(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderProfile.java b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderProfile.java new file mode 100644 index 0000000..cbf9b7f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/config/ShaderProfile.java @@ -0,0 +1,89 @@ +package net.optifine.shaders.config; + +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +public class ShaderProfile +{ + private String name = null; + private Map mapOptionValues = new LinkedHashMap(); + private Set disabledPrograms = new LinkedHashSet(); + + public ShaderProfile(String name) + { + this.name = name; + } + + public String getName() + { + return this.name; + } + + public void addOptionValue(String option, String value) + { + this.mapOptionValues.put(option, value); + } + + public void addOptionValues(ShaderProfile prof) + { + if (prof != null) + { + this.mapOptionValues.putAll(prof.mapOptionValues); + } + } + + public void applyOptionValues(ShaderOption[] options) + { + for (int i = 0; i < options.length; ++i) + { + ShaderOption shaderoption = options[i]; + String s = shaderoption.getName(); + String s1 = (String)this.mapOptionValues.get(s); + + if (s1 != null) + { + shaderoption.setValue(s1); + } + } + } + + public String[] getOptions() + { + Set set = this.mapOptionValues.keySet(); + String[] astring = (String[])((String[])set.toArray(new String[set.size()])); + return astring; + } + + public String getValue(String key) + { + return (String)this.mapOptionValues.get(key); + } + + public void addDisabledProgram(String program) + { + this.disabledPrograms.add(program); + } + + public void removeDisabledProgram(String program) + { + this.disabledPrograms.remove(program); + } + + public Collection getDisabledPrograms() + { + return new LinkedHashSet(this.disabledPrograms); + } + + public void addDisabledPrograms(Collection programs) + { + this.disabledPrograms.addAll(programs); + } + + public boolean isProgramDisabled(String program) + { + return this.disabledPrograms.contains(program); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonDownloadShaders.java b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonDownloadShaders.java new file mode 100644 index 0000000..9482eb1 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonDownloadShaders.java @@ -0,0 +1,26 @@ +package net.optifine.shaders.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; + +public class GuiButtonDownloadShaders extends GuiButton +{ + public GuiButtonDownloadShaders(int buttonID, int xPos, int yPos) + { + super(buttonID, xPos, yPos, 22, 20, ""); + } + + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + super.drawButton(mc, mouseX, mouseY); + ResourceLocation resourcelocation = new ResourceLocation("optifine/textures/icons.png"); + mc.getTextureManager().bindTexture(resourcelocation); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + 3, this.yPosition + 2, 0, 0, 16, 16); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonEnumShaderOption.java b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonEnumShaderOption.java new file mode 100644 index 0000000..64eb186 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonEnumShaderOption.java @@ -0,0 +1,71 @@ +package net.optifine.shaders.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.resources.I18n; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.config.EnumShaderOption; + +public class GuiButtonEnumShaderOption extends GuiButton +{ + private EnumShaderOption enumShaderOption = null; + + public GuiButtonEnumShaderOption(EnumShaderOption enumShaderOption, int x, int y, int widthIn, int heightIn) + { + super(enumShaderOption.ordinal(), x, y, widthIn, heightIn, getButtonText(enumShaderOption)); + this.enumShaderOption = enumShaderOption; + } + + public EnumShaderOption getEnumShaderOption() + { + return this.enumShaderOption; + } + + private static String getButtonText(EnumShaderOption eso) + { + String s = I18n.format(eso.getResourceKey(), new Object[0]) + ": "; + + switch (eso) + { + case ANTIALIASING: + return s + GuiShaders.toStringAa(Shaders.configAntialiasingLevel); + + case NORMAL_MAP: + return s + GuiShaders.toStringOnOff(Shaders.configNormalMap); + + case SPECULAR_MAP: + return s + GuiShaders.toStringOnOff(Shaders.configSpecularMap); + + case RENDER_RES_MUL: + return s + GuiShaders.toStringQuality(Shaders.configRenderResMul); + + case SHADOW_RES_MUL: + return s + GuiShaders.toStringQuality(Shaders.configShadowResMul); + + case HAND_DEPTH_MUL: + return s + GuiShaders.toStringHandDepth(Shaders.configHandDepthMul); + + case CLOUD_SHADOW: + return s + GuiShaders.toStringOnOff(Shaders.configCloudShadow); + + case OLD_HAND_LIGHT: + return s + Shaders.configOldHandLight.getUserValue(); + + case OLD_LIGHTING: + return s + Shaders.configOldLighting.getUserValue(); + + case SHADOW_CLIP_FRUSTRUM: + return s + GuiShaders.toStringOnOff(Shaders.configShadowClipFrustrum); + + case TWEAK_BLOCK_DAMAGE: + return s + GuiShaders.toStringOnOff(Shaders.configTweakBlockDamage); + + default: + return s + Shaders.getEnumShaderOption(eso); + } + } + + public void updateButtonText() + { + this.displayString = getButtonText(this.enumShaderOption); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonShaderOption.java b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonShaderOption.java new file mode 100644 index 0000000..5d3eb94 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiButtonShaderOption.java @@ -0,0 +1,29 @@ +package net.optifine.shaders.gui; + +import net.minecraft.client.gui.GuiButton; +import net.optifine.shaders.config.ShaderOption; + +public class GuiButtonShaderOption extends GuiButton +{ + private ShaderOption shaderOption = null; + + public GuiButtonShaderOption(int buttonId, int x, int y, int widthIn, int heightIn, ShaderOption shaderOption, String text) + { + super(buttonId, x, y, widthIn, heightIn, text); + this.shaderOption = shaderOption; + } + + public ShaderOption getShaderOption() + { + return this.shaderOption; + } + + public void valueChanged() + { + } + + public boolean isSwitchable() + { + return true; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiShaderOptions.java b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiShaderOptions.java new file mode 100644 index 0000000..a71cf5c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiShaderOptions.java @@ -0,0 +1,262 @@ +package net.optifine.shaders.gui; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.optifine.Lang; +import net.optifine.gui.GuiScreenOF; +import net.optifine.gui.TooltipManager; +import net.optifine.gui.TooltipProviderShaderOptions; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.config.ShaderOption; +import net.optifine.shaders.config.ShaderOptionProfile; +import net.optifine.shaders.config.ShaderOptionScreen; + +public class GuiShaderOptions extends GuiScreenOF +{ + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private TooltipManager tooltipManager; + private String screenName; + private String screenText; + private boolean changed; + public static final String OPTION_PROFILE = ""; + public static final String OPTION_EMPTY = ""; + public static final String OPTION_REST = "*"; + + public GuiShaderOptions(GuiScreen guiscreen, GameSettings gamesettings) + { + this.tooltipManager = new TooltipManager(this, new TooltipProviderShaderOptions()); + this.screenName = null; + this.screenText = null; + this.changed = false; + this.title = "Shader Options"; + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + public GuiShaderOptions(GuiScreen guiscreen, GameSettings gamesettings, String screenName) + { + this(guiscreen, gamesettings); + this.screenName = screenName; + + if (screenName != null) + { + this.screenText = Shaders.translate("screen." + screenName, screenName); + } + } + + public void initGui() + { + this.title = I18n.format("of.options.shaderOptionsTitle", new Object[0]); + int i = 100; + int j = 0; + int k = 30; + int l = 20; + int i1 = 120; + int j1 = 20; + int k1 = Shaders.getShaderPackColumns(this.screenName, 2); + ShaderOption[] ashaderoption = Shaders.getShaderPackOptions(this.screenName); + + if (ashaderoption != null) + { + int l1 = MathHelper.ceiling_double_int((double)ashaderoption.length / 9.0D); + + if (k1 < l1) + { + k1 = l1; + } + + for (int i2 = 0; i2 < ashaderoption.length; ++i2) + { + ShaderOption shaderoption = ashaderoption[i2]; + + if (shaderoption != null && shaderoption.isVisible()) + { + int j2 = i2 % k1; + int k2 = i2 / k1; + int l2 = Math.min(this.width / k1, 200); + j = (this.width - l2 * k1) / 2; + int i3 = j2 * l2 + 5 + j; + int j3 = k + k2 * l; + int k3 = l2 - 10; + String s = getButtonText(shaderoption, k3); + GuiButtonShaderOption guibuttonshaderoption; + + if (Shaders.isShaderPackOptionSlider(shaderoption.getName())) + { + guibuttonshaderoption = new GuiSliderShaderOption(i + i2, i3, j3, k3, j1, shaderoption, s); + } + else + { + guibuttonshaderoption = new GuiButtonShaderOption(i + i2, i3, j3, k3, j1, shaderoption, s); + } + + guibuttonshaderoption.enabled = shaderoption.isEnabled(); + this.buttonList.add(guibuttonshaderoption); + } + } + } + + this.buttonList.add(new GuiButton(201, this.width / 2 - i1 - 20, this.height / 6 + 168 + 11, i1, j1, I18n.format("controls.reset", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 + 20, this.height / 6 + 168 + 11, i1, j1, I18n.format("gui.done", new Object[0]))); + } + + public static String getButtonText(ShaderOption so, int btnWidth) + { + String s = so.getNameText(); + + if (so instanceof ShaderOptionScreen) + { + ShaderOptionScreen shaderoptionscreen = (ShaderOptionScreen)so; + return s + "..."; + } + else + { + FontRenderer fontrenderer = Config.getMinecraft().fontRendererObj; + + for (int i = fontrenderer.getStringWidth(": " + Lang.getOff()) + 5; fontrenderer.getStringWidth(s) + i >= btnWidth && s.length() > 0; s = s.substring(0, s.length() - 1)) + { + ; + } + + String s1 = so.isChanged() ? so.getValueColor(so.getValue()) : ""; + String s2 = so.getValueText(so.getValue()); + return s + ": " + s1 + s2; + } + } + + protected void actionPerformed(GuiButton guibutton) + { + if (guibutton.enabled) + { + if (guibutton.id < 200 && guibutton instanceof GuiButtonShaderOption) + { + GuiButtonShaderOption guibuttonshaderoption = (GuiButtonShaderOption)guibutton; + ShaderOption shaderoption = guibuttonshaderoption.getShaderOption(); + + if (shaderoption instanceof ShaderOptionScreen) + { + String s = shaderoption.getName(); + GuiShaderOptions guishaderoptions = new GuiShaderOptions(this, this.settings, s); + this.mc.displayGuiScreen(guishaderoptions); + return; + } + + if (isShiftKeyDown()) + { + shaderoption.resetValue(); + } + else if (guibuttonshaderoption.isSwitchable()) + { + shaderoption.nextValue(); + } + + this.updateAllButtons(); + this.changed = true; + } + + if (guibutton.id == 201) + { + ShaderOption[] ashaderoption = Shaders.getChangedOptions(Shaders.getShaderPackOptions()); + + for (int i = 0; i < ashaderoption.length; ++i) + { + ShaderOption shaderoption1 = ashaderoption[i]; + shaderoption1.resetValue(); + this.changed = true; + } + + this.updateAllButtons(); + } + + if (guibutton.id == 200) + { + if (this.changed) + { + Shaders.saveShaderPackOptions(); + this.changed = false; + Shaders.uninit(); + } + + this.mc.displayGuiScreen(this.prevScreen); + } + } + } + + protected void actionPerformedRightClick(GuiButton btn) + { + if (btn instanceof GuiButtonShaderOption) + { + GuiButtonShaderOption guibuttonshaderoption = (GuiButtonShaderOption)btn; + ShaderOption shaderoption = guibuttonshaderoption.getShaderOption(); + + if (isShiftKeyDown()) + { + shaderoption.resetValue(); + } + else if (guibuttonshaderoption.isSwitchable()) + { + shaderoption.prevValue(); + } + + this.updateAllButtons(); + this.changed = true; + } + } + + public void onGuiClosed() + { + super.onGuiClosed(); + + if (this.changed) + { + Shaders.saveShaderPackOptions(); + this.changed = false; + Shaders.uninit(); + } + } + + private void updateAllButtons() + { + for (GuiButton guibutton : this.buttonList) + { + if (guibutton instanceof GuiButtonShaderOption) + { + GuiButtonShaderOption guibuttonshaderoption = (GuiButtonShaderOption)guibutton; + ShaderOption shaderoption = guibuttonshaderoption.getShaderOption(); + + if (shaderoption instanceof ShaderOptionProfile) + { + ShaderOptionProfile shaderoptionprofile = (ShaderOptionProfile)shaderoption; + shaderoptionprofile.updateProfile(); + } + + guibuttonshaderoption.displayString = getButtonText(shaderoption, guibuttonshaderoption.getButtonWidth()); + guibuttonshaderoption.valueChanged(); + } + } + } + + public void drawScreen(int x, int y, float f) + { + this.drawDefaultBackground(); + + if (this.screenText != null) + { + this.drawCenteredString(this.fontRendererObj, this.screenText, this.width / 2, 15, 16777215); + } + else + { + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + } + + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiShaders.java b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiShaders.java new file mode 100644 index 0000000..8c2779c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiShaders.java @@ -0,0 +1,465 @@ +package net.optifine.shaders.gui; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.optifine.Lang; +import net.optifine.gui.GuiScreenOF; +import net.optifine.gui.TooltipManager; +import net.optifine.gui.TooltipProviderEnumShaderOptions; +import net.optifine.shaders.Shaders; +import net.optifine.shaders.ShadersTex; +import net.optifine.shaders.config.EnumShaderOption; +import org.lwjgl.Sys; + +public class GuiShaders extends GuiScreenOF +{ + protected GuiScreen parentGui; + protected String screenTitle = "Shaders"; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderEnumShaderOptions()); + private int updateTimer = -1; + private GuiSlotShaders shaderList; + private boolean saved = false; + private static float[] QUALITY_MULTIPLIERS = new float[] {0.5F, 0.6F, 0.6666667F, 0.75F, 0.8333333F, 0.9F, 1.0F, 1.1666666F, 1.3333334F, 1.5F, 1.6666666F, 1.8F, 2.0F}; + private static String[] QUALITY_MULTIPLIER_NAMES = new String[] {"0.5x", "0.6x", "0.66x", "0.75x", "0.83x", "0.9x", "1x", "1.16x", "1.33x", "1.5x", "1.66x", "1.8x", "2x"}; + private static float QUALITY_MULTIPLIER_DEFAULT = 1.0F; + private static float[] HAND_DEPTH_VALUES = new float[] {0.0625F, 0.125F, 0.25F}; + private static String[] HAND_DEPTH_NAMES = new String[] {"0.5x", "1x", "2x"}; + private static float HAND_DEPTH_DEFAULT = 0.125F; + public static final int EnumOS_UNKNOWN = 0; + public static final int EnumOS_WINDOWS = 1; + public static final int EnumOS_OSX = 2; + public static final int EnumOS_SOLARIS = 3; + public static final int EnumOS_LINUX = 4; + + public GuiShaders(GuiScreen par1GuiScreen, GameSettings par2GameSettings) + { + this.parentGui = par1GuiScreen; + } + + public void initGui() + { + this.screenTitle = I18n.format("of.options.shadersTitle", new Object[0]); + + if (Shaders.shadersConfig == null) + { + Shaders.loadConfig(); + } + + int i = 120; + int j = 20; + int k = this.width - i - 10; + int l = 30; + int i1 = 20; + int j1 = this.width - i - 20; + this.shaderList = new GuiSlotShaders(this, j1, this.height, l, this.height - 50, 16); + this.shaderList.registerScrollButtons(7, 8); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.ANTIALIASING, k, 0 * i1 + l, i, j)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.NORMAL_MAP, k, 1 * i1 + l, i, j)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.SPECULAR_MAP, k, 2 * i1 + l, i, j)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.RENDER_RES_MUL, k, 3 * i1 + l, i, j)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.SHADOW_RES_MUL, k, 4 * i1 + l, i, j)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.HAND_DEPTH_MUL, k, 5 * i1 + l, i, j)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.OLD_HAND_LIGHT, k, 6 * i1 + l, i, j)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.OLD_LIGHTING, k, 7 * i1 + l, i, j)); + int k1 = Math.min(150, j1 / 2 - 10); + int l1 = j1 / 4 - k1 / 2; + int i2 = this.height - 25; + this.buttonList.add(new GuiButton(201, l1, i2, k1 - 22 + 1, j, Lang.get("of.options.shaders.shadersFolder"))); + this.buttonList.add(new GuiButtonDownloadShaders(210, l1 + k1 - 22 - 1, i2)); + this.buttonList.add(new GuiButton(202, j1 / 4 * 3 - k1 / 2, this.height - 25, k1, j, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(203, k, this.height - 25, i, j, Lang.get("of.options.shaders.shaderOptions"))); + this.updateButtons(); + } + + public void updateButtons() + { + boolean flag = Config.isShaders(); + + for (GuiButton guibutton : this.buttonList) + { + if (guibutton.id != 201 && guibutton.id != 202 && guibutton.id != 210 && guibutton.id != EnumShaderOption.ANTIALIASING.ordinal()) + { + guibutton.enabled = flag; + } + } + } + + public void handleMouseInput() throws IOException + { + super.handleMouseInput(); + this.shaderList.handleMouseInput(); + } + + protected void actionPerformed(GuiButton button) + { + this.actionPerformed(button, false); + } + + protected void actionPerformedRightClick(GuiButton button) + { + this.actionPerformed(button, true); + } + + private void actionPerformed(GuiButton button, boolean rightClick) + { + if (button.enabled) + { + if (!(button instanceof GuiButtonEnumShaderOption)) + { + if (!rightClick) + { + switch (button.id) + { + case 201: + switch (getOSType()) + { + case 1: + String s = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {Shaders.shaderPacksDir.getAbsolutePath()}); + + try + { + Runtime.getRuntime().exec(s); + return; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + break; + } + + case 2: + try + { + Runtime.getRuntime().exec(new String[] {"/usr/bin/open", Shaders.shaderPacksDir.getAbsolutePath()}); + return; + } + catch (IOException ioexception1) + { + ioexception1.printStackTrace(); + } + } + + boolean flag = false; + + try + { + Class oclass1 = Class.forName("java.awt.Desktop"); + Object object1 = oclass1.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass1.getMethod("browse", new Class[] {URI.class}).invoke(object1, new Object[] {(new File(this.mc.mcDataDir, "shaderpacks")).toURI()}); + } + catch (Throwable throwable1) + { + throwable1.printStackTrace(); + flag = true; + } + + if (flag) + { + Config.dbg("Opening via system class!"); + Sys.openURL("file://" + Shaders.shaderPacksDir.getAbsolutePath()); + } + + break; + + case 202: + Shaders.storeConfig(); + this.saved = true; + this.mc.displayGuiScreen(this.parentGui); + break; + + case 203: + GuiShaderOptions guishaderoptions = new GuiShaderOptions(this, Config.getGameSettings()); + Config.getMinecraft().displayGuiScreen(guishaderoptions); + break; + + case 210: + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://optifine.net/shaderPacks")}); + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + } + + case 204: + case 205: + case 206: + case 207: + case 208: + case 209: + default: + this.shaderList.actionPerformed(button); + } + } + } + else + { + GuiButtonEnumShaderOption guibuttonenumshaderoption = (GuiButtonEnumShaderOption)button; + + switch (guibuttonenumshaderoption.getEnumShaderOption()) + { + case ANTIALIASING: + Shaders.nextAntialiasingLevel(!rightClick); + + if (this.hasShiftDown()) + { + Shaders.configAntialiasingLevel = 0; + } + + Shaders.uninit(); + break; + + case NORMAL_MAP: + Shaders.configNormalMap = !Shaders.configNormalMap; + + if (this.hasShiftDown()) + { + Shaders.configNormalMap = true; + } + + Shaders.uninit(); + this.mc.scheduleResourcesRefresh(); + break; + + case SPECULAR_MAP: + Shaders.configSpecularMap = !Shaders.configSpecularMap; + + if (this.hasShiftDown()) + { + Shaders.configSpecularMap = true; + } + + Shaders.uninit(); + this.mc.scheduleResourcesRefresh(); + break; + + case RENDER_RES_MUL: + Shaders.configRenderResMul = this.getNextValue(Shaders.configRenderResMul, QUALITY_MULTIPLIERS, QUALITY_MULTIPLIER_DEFAULT, !rightClick, this.hasShiftDown()); + Shaders.uninit(); + Shaders.scheduleResize(); + break; + + case SHADOW_RES_MUL: + Shaders.configShadowResMul = this.getNextValue(Shaders.configShadowResMul, QUALITY_MULTIPLIERS, QUALITY_MULTIPLIER_DEFAULT, !rightClick, this.hasShiftDown()); + Shaders.uninit(); + Shaders.scheduleResizeShadow(); + break; + + case HAND_DEPTH_MUL: + Shaders.configHandDepthMul = this.getNextValue(Shaders.configHandDepthMul, HAND_DEPTH_VALUES, HAND_DEPTH_DEFAULT, !rightClick, this.hasShiftDown()); + Shaders.uninit(); + break; + + case OLD_HAND_LIGHT: + Shaders.configOldHandLight.nextValue(!rightClick); + + if (this.hasShiftDown()) + { + Shaders.configOldHandLight.resetValue(); + } + + Shaders.uninit(); + break; + + case OLD_LIGHTING: + Shaders.configOldLighting.nextValue(!rightClick); + + if (this.hasShiftDown()) + { + Shaders.configOldLighting.resetValue(); + } + + Shaders.updateBlockLightLevel(); + Shaders.uninit(); + this.mc.scheduleResourcesRefresh(); + break; + + case TWEAK_BLOCK_DAMAGE: + Shaders.configTweakBlockDamage = !Shaders.configTweakBlockDamage; + break; + + case CLOUD_SHADOW: + Shaders.configCloudShadow = !Shaders.configCloudShadow; + break; + + case TEX_MIN_FIL_B: + Shaders.configTexMinFilB = (Shaders.configTexMinFilB + 1) % 3; + Shaders.configTexMinFilN = Shaders.configTexMinFilS = Shaders.configTexMinFilB; + button.displayString = "Tex Min: " + Shaders.texMinFilDesc[Shaders.configTexMinFilB]; + ShadersTex.updateTextureMinMagFilter(); + break; + + case TEX_MAG_FIL_N: + Shaders.configTexMagFilN = (Shaders.configTexMagFilN + 1) % 2; + button.displayString = "Tex_n Mag: " + Shaders.texMagFilDesc[Shaders.configTexMagFilN]; + ShadersTex.updateTextureMinMagFilter(); + break; + + case TEX_MAG_FIL_S: + Shaders.configTexMagFilS = (Shaders.configTexMagFilS + 1) % 2; + button.displayString = "Tex_s Mag: " + Shaders.texMagFilDesc[Shaders.configTexMagFilS]; + ShadersTex.updateTextureMinMagFilter(); + break; + + case SHADOW_CLIP_FRUSTRUM: + Shaders.configShadowClipFrustrum = !Shaders.configShadowClipFrustrum; + button.displayString = "ShadowClipFrustrum: " + toStringOnOff(Shaders.configShadowClipFrustrum); + ShadersTex.updateTextureMinMagFilter(); + } + + guibuttonenumshaderoption.updateButtonText(); + } + } + } + + public void onGuiClosed() + { + super.onGuiClosed(); + + if (!this.saved) + { + Shaders.storeConfig(); + } + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.shaderList.drawScreen(mouseX, mouseY, partialTicks); + + if (this.updateTimer <= 0) + { + this.shaderList.updateList(); + this.updateTimer += 20; + } + + this.drawCenteredString(this.fontRendererObj, this.screenTitle + " ", this.width / 2, 15, 16777215); + String s = "OpenGL: " + Shaders.glVersionString + ", " + Shaders.glVendorString + ", " + Shaders.glRendererString; + int i = this.fontRendererObj.getStringWidth(s); + + if (i < this.width - 5) + { + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, this.height - 40, 8421504); + } + else + { + this.drawString(this.fontRendererObj, s, 5, this.height - 40, 8421504); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + this.tooltipManager.drawTooltips(mouseX, mouseY, this.buttonList); + } + + public void updateScreen() + { + super.updateScreen(); + --this.updateTimer; + } + + public Minecraft getMc() + { + return this.mc; + } + + public void drawCenteredString(String text, int x, int y, int color) + { + this.drawCenteredString(this.fontRendererObj, text, x, y, color); + } + + public static String toStringOnOff(boolean value) + { + String s = Lang.getOn(); + String s1 = Lang.getOff(); + return value ? s : s1; + } + + public static String toStringAa(int value) + { + return value == 2 ? "FXAA 2x" : (value == 4 ? "FXAA 4x" : Lang.getOff()); + } + + public static String toStringValue(float val, float[] values, String[] names) + { + int i = getValueIndex(val, values); + return names[i]; + } + + private float getNextValue(float val, float[] values, float valDef, boolean forward, boolean reset) + { + if (reset) + { + return valDef; + } + else + { + int i = getValueIndex(val, values); + + if (forward) + { + ++i; + + if (i >= values.length) + { + i = 0; + } + } + else + { + --i; + + if (i < 0) + { + i = values.length - 1; + } + } + + return values[i]; + } + } + + public static int getValueIndex(float val, float[] values) + { + for (int i = 0; i < values.length; ++i) + { + float f = values[i]; + + if (f >= val) + { + return i; + } + } + + return values.length - 1; + } + + public static String toStringQuality(float val) + { + return toStringValue(val, QUALITY_MULTIPLIERS, QUALITY_MULTIPLIER_NAMES); + } + + public static String toStringHandDepth(float val) + { + return toStringValue(val, HAND_DEPTH_VALUES, HAND_DEPTH_NAMES); + } + + public static int getOSType() + { + String s = System.getProperty("os.name").toLowerCase(); + return s.contains("win") ? 1 : (s.contains("mac") ? 2 : (s.contains("solaris") ? 3 : (s.contains("sunos") ? 3 : (s.contains("linux") ? 4 : (s.contains("unix") ? 4 : 0))))); + } + + public boolean hasShiftDown() + { + return isShiftKeyDown(); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiSliderShaderOption.java b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiSliderShaderOption.java new file mode 100644 index 0000000..b8d6d58 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiSliderShaderOption.java @@ -0,0 +1,79 @@ +package net.optifine.shaders.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.optifine.shaders.config.ShaderOption; + +public class GuiSliderShaderOption extends GuiButtonShaderOption +{ + private float sliderValue = 1.0F; + public boolean dragging; + private ShaderOption shaderOption = null; + + public GuiSliderShaderOption(int buttonId, int x, int y, int w, int h, ShaderOption shaderOption, String text) + { + super(buttonId, x, y, w, h, shaderOption, text); + this.shaderOption = shaderOption; + this.sliderValue = shaderOption.getIndexNormalized(); + this.displayString = GuiShaderOptions.getButtonText(shaderOption, this.width); + } + + protected int getHoverState(boolean mouseOver) + { + return 0; + } + + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + if (this.dragging && !GuiScreen.isShiftKeyDown()) + { + this.sliderValue = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + this.sliderValue = MathHelper.clamp_float(this.sliderValue, 0.0F, 1.0F); + this.shaderOption.setIndexNormalized(this.sliderValue); + this.sliderValue = this.shaderOption.getIndexNormalized(); + this.displayString = GuiShaderOptions.getButtonText(this.shaderOption, this.width); + } + + mc.getTextureManager().bindTexture(buttonTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.sliderValue = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + this.sliderValue = MathHelper.clamp_float(this.sliderValue, 0.0F, 1.0F); + this.shaderOption.setIndexNormalized(this.sliderValue); + this.displayString = GuiShaderOptions.getButtonText(this.shaderOption, this.width); + this.dragging = true; + return true; + } + else + { + return false; + } + } + + public void mouseReleased(int mouseX, int mouseY) + { + this.dragging = false; + } + + public void valueChanged() + { + this.sliderValue = this.shaderOption.getIndexNormalized(); + } + + public boolean isSwitchable() + { + return false; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiSlotShaders.java b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiSlotShaders.java new file mode 100644 index 0000000..faebd1c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/gui/GuiSlotShaders.java @@ -0,0 +1,186 @@ +package net.optifine.shaders.gui; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Properties; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.resources.I18n; +import net.minecraft.src.Config; +import net.optifine.Lang; +import net.optifine.shaders.IShaderPack; +import net.optifine.shaders.Shaders; +import net.optifine.util.ResUtils; + +class GuiSlotShaders extends GuiSlot +{ + private ArrayList shaderslist; + private int selectedIndex; + private long lastClickedCached = 0L; + final GuiShaders shadersGui; + + public GuiSlotShaders(GuiShaders par1GuiShaders, int width, int height, int top, int bottom, int slotHeight) + { + super(par1GuiShaders.getMc(), width, height, top, bottom, slotHeight); + this.shadersGui = par1GuiShaders; + this.updateList(); + this.amountScrolled = 0.0F; + int i = this.selectedIndex * slotHeight; + int j = (bottom - top) / 2; + + if (i > j) + { + this.scrollBy(i - j); + } + } + + public int getListWidth() + { + return this.width - 20; + } + + public void updateList() + { + this.shaderslist = Shaders.listOfShaders(); + this.selectedIndex = 0; + int i = 0; + + for (int j = this.shaderslist.size(); i < j; ++i) + { + if (((String)this.shaderslist.get(i)).equals(Shaders.currentShaderName)) + { + this.selectedIndex = i; + break; + } + } + } + + protected int getSize() + { + return this.shaderslist.size(); + } + + protected void elementClicked(int index, boolean doubleClicked, int mouseX, int mouseY) + { + if (index != this.selectedIndex || this.lastClicked != this.lastClickedCached) + { + String s = (String)this.shaderslist.get(index); + IShaderPack ishaderpack = Shaders.getShaderPack(s); + + if (this.checkCompatible(ishaderpack, index)) + { + this.selectIndex(index); + } + } + } + + private void selectIndex(int index) + { + this.selectedIndex = index; + this.lastClickedCached = this.lastClicked; + Shaders.setShaderPack((String)this.shaderslist.get(index)); + Shaders.uninit(); + this.shadersGui.updateButtons(); + } + + private boolean checkCompatible(IShaderPack sp, final int index) + { + if (sp == null) + { + return true; + } + else + { + InputStream inputstream = sp.getResourceAsStream("/shaders/shaders.properties"); + Properties properties = ResUtils.readProperties(inputstream, "Shaders"); + + if (properties == null) + { + return true; + } + else + { + String s = "version.1.8.9"; + String s1 = properties.getProperty(s); + + if (s1 == null) + { + return true; + } + else + { + s1 = s1.trim(); + String s2 = "M6_pre2"; + int i = Config.compareRelease(s2, s1); + + if (i >= 0) + { + return true; + } + else + { + String s3 = ("HD_U_" + s1).replace('_', ' '); + String s4 = I18n.format("of.message.shaders.nv1", new Object[] {s3}); + String s5 = I18n.format("of.message.shaders.nv2", new Object[0]); + GuiYesNoCallback guiyesnocallback = new GuiYesNoCallback() + { + public void confirmClicked(boolean result, int id) + { + if (result) + { + GuiSlotShaders.this.selectIndex(index); + } + + GuiSlotShaders.this.mc.displayGuiScreen(GuiSlotShaders.this.shadersGui); + } + }; + GuiYesNo guiyesno = new GuiYesNo(guiyesnocallback, s4, s5, 0); + this.mc.displayGuiScreen(guiyesno); + return false; + } + } + } + } + } + + protected boolean isSelected(int index) + { + return index == this.selectedIndex; + } + + protected int getScrollBarX() + { + return this.width - 6; + } + + protected int getContentHeight() + { + return this.getSize() * 18; + } + + protected void drawBackground() + { + } + + protected void drawSlot(int index, int posX, int posY, int contentY, int mouseX, int mouseY) + { + String s = (String)this.shaderslist.get(index); + + if (s.equals("OFF")) + { + s = Lang.get("of.options.shaders.packNone"); + } + else if (s.equals("(internal)")) + { + s = Lang.get("of.options.shaders.packDefault"); + } + + this.shadersGui.drawCenteredString(s, this.width / 2, posY + 1, 14737632); + } + + public int getSelectedIndex() + { + return this.selectedIndex; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/CustomUniform.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/CustomUniform.java new file mode 100644 index 0000000..55be99e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/CustomUniform.java @@ -0,0 +1,73 @@ +package net.optifine.shaders.uniform; + +import net.optifine.expr.IExpression; +import net.optifine.shaders.SMCLog; + +public class CustomUniform +{ + private String name; + private UniformType type; + private IExpression expression; + private ShaderUniformBase shaderUniform; + + public CustomUniform(String name, UniformType type, IExpression expression) + { + this.name = name; + this.type = type; + this.expression = expression; + this.shaderUniform = type.makeShaderUniform(name); + } + + public void setProgram(int program) + { + this.shaderUniform.setProgram(program); + } + + public void update() + { + if (this.shaderUniform.isDefined()) + { + try + { + this.type.updateUniform(this.expression, this.shaderUniform); + } + catch (RuntimeException runtimeexception) + { + SMCLog.severe("Error updating custom uniform: " + this.shaderUniform.getName()); + SMCLog.severe(runtimeexception.getClass().getName() + ": " + runtimeexception.getMessage()); + this.shaderUniform.disable(); + SMCLog.severe("Custom uniform disabled: " + this.shaderUniform.getName()); + } + } + } + + public void reset() + { + this.shaderUniform.reset(); + } + + public String getName() + { + return this.name; + } + + public UniformType getType() + { + return this.type; + } + + public IExpression getExpression() + { + return this.expression; + } + + public ShaderUniformBase getShaderUniform() + { + return this.shaderUniform; + } + + public String toString() + { + return this.type.name().toLowerCase() + " " + this.name; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/CustomUniforms.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/CustomUniforms.java new file mode 100644 index 0000000..9d61383 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/CustomUniforms.java @@ -0,0 +1,70 @@ +package net.optifine.shaders.uniform; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import net.optifine.expr.IExpression; +import net.optifine.expr.IExpressionCached; + +public class CustomUniforms +{ + private CustomUniform[] uniforms; + private IExpressionCached[] expressionsCached; + + public CustomUniforms(CustomUniform[] uniforms, Map mapExpressions) + { + this.uniforms = uniforms; + List list = new ArrayList(); + + for (String s : mapExpressions.keySet()) + { + IExpression iexpression = (IExpression)mapExpressions.get(s); + + if (iexpression instanceof IExpressionCached) + { + IExpressionCached iexpressioncached = (IExpressionCached)iexpression; + list.add(iexpressioncached); + } + } + + this.expressionsCached = (IExpressionCached[])((IExpressionCached[])list.toArray(new IExpressionCached[list.size()])); + } + + public void setProgram(int program) + { + for (int i = 0; i < this.uniforms.length; ++i) + { + CustomUniform customuniform = this.uniforms[i]; + customuniform.setProgram(program); + } + } + + public void update() + { + this.resetCache(); + + for (int i = 0; i < this.uniforms.length; ++i) + { + CustomUniform customuniform = this.uniforms[i]; + customuniform.update(); + } + } + + private void resetCache() + { + for (int i = 0; i < this.expressionsCached.length; ++i) + { + IExpressionCached iexpressioncached = this.expressionsCached[i]; + iexpressioncached.reset(); + } + } + + public void reset() + { + for (int i = 0; i < this.uniforms.length; ++i) + { + CustomUniform customuniform = this.uniforms[i]; + customuniform.reset(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderExpressionResolver.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderExpressionResolver.java new file mode 100644 index 0000000..93a7971 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderExpressionResolver.java @@ -0,0 +1,108 @@ +package net.optifine.shaders.uniform; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.expr.ConstantFloat; +import net.optifine.expr.IExpression; +import net.optifine.expr.IExpressionResolver; +import net.optifine.shaders.SMCLog; + +public class ShaderExpressionResolver implements IExpressionResolver +{ + private Map mapExpressions = new HashMap(); + + public ShaderExpressionResolver(Map map) + { + this.registerExpressions(); + + for (String s : map.keySet()) + { + IExpression iexpression = (IExpression)map.get(s); + this.registerExpression(s, iexpression); + } + } + + private void registerExpressions() + { + ShaderParameterFloat[] ashaderparameterfloat = ShaderParameterFloat.values(); + + for (int i = 0; i < ashaderparameterfloat.length; ++i) + { + ShaderParameterFloat shaderparameterfloat = ashaderparameterfloat[i]; + this.addParameterFloat(this.mapExpressions, shaderparameterfloat); + } + + ShaderParameterBool[] ashaderparameterbool = ShaderParameterBool.values(); + + for (int k = 0; k < ashaderparameterbool.length; ++k) + { + ShaderParameterBool shaderparameterbool = ashaderparameterbool[k]; + this.mapExpressions.put(shaderparameterbool.getName(), shaderparameterbool); + } + + for (BiomeGenBase biomegenbase : BiomeGenBase.BIOME_ID_MAP.values()) + { + String s = biomegenbase.biomeName.trim(); + s = "BIOME_" + s.toUpperCase().replace(' ', '_'); + int j = biomegenbase.biomeID; + IExpression iexpression = new ConstantFloat((float)j); + this.registerExpression(s, iexpression); + } + } + + private void addParameterFloat(Map map, ShaderParameterFloat spf) + { + String[] astring = spf.getIndexNames1(); + + if (astring == null) + { + map.put(spf.getName(), new ShaderParameterIndexed(spf)); + } + else + { + for (int i = 0; i < astring.length; ++i) + { + String s = astring[i]; + String[] astring1 = spf.getIndexNames2(); + + if (astring1 == null) + { + map.put(spf.getName() + "." + s, new ShaderParameterIndexed(spf, i)); + } + else + { + for (int j = 0; j < astring1.length; ++j) + { + String s1 = astring1[j]; + map.put(spf.getName() + "." + s + "." + s1, new ShaderParameterIndexed(spf, i, j)); + } + } + } + } + } + + public boolean registerExpression(String name, IExpression expr) + { + if (this.mapExpressions.containsKey(name)) + { + SMCLog.warning("Expression already defined: " + name); + return false; + } + else + { + this.mapExpressions.put(name, expr); + return true; + } + } + + public IExpression getExpression(String name) + { + return (IExpression)this.mapExpressions.get(name); + } + + public boolean hasExpression(String name) + { + return this.mapExpressions.containsKey(name); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterBool.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterBool.java new file mode 100644 index 0000000..a88e2d3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterBool.java @@ -0,0 +1,122 @@ +package net.optifine.shaders.uniform; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpressionBool; + +public enum ShaderParameterBool implements IExpressionBool +{ + IS_ALIVE("is_alive"), + IS_BURNING("is_burning"), + IS_CHILD("is_child"), + IS_GLOWING("is_glowing"), + IS_HURT("is_hurt"), + IS_IN_LAVA("is_in_lava"), + IS_IN_WATER("is_in_water"), + IS_INVISIBLE("is_invisible"), + IS_ON_GROUND("is_on_ground"), + IS_RIDDEN("is_ridden"), + IS_RIDING("is_riding"), + IS_SNEAKING("is_sneaking"), + IS_SPRINTING("is_sprinting"), + IS_WET("is_wet"); + + private String name; + private RenderManager renderManager; + private static final ShaderParameterBool[] VALUES = values(); + + private ShaderParameterBool(String name) + { + this.name = name; + this.renderManager = Minecraft.getMinecraft().getRenderManager(); + } + + public String getName() + { + return this.name; + } + + public ExpressionType getExpressionType() + { + return ExpressionType.BOOL; + } + + public boolean eval() + { + Entity entity = Minecraft.getMinecraft().getRenderViewEntity(); + + if (entity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)entity; + + switch (this) + { + case IS_ALIVE: + return entitylivingbase.isEntityAlive(); + + case IS_BURNING: + return entitylivingbase.isBurning(); + + case IS_CHILD: + return entitylivingbase.isChild(); + + case IS_HURT: + return entitylivingbase.hurtTime > 0; + + case IS_IN_LAVA: + return entitylivingbase.isInLava(); + + case IS_IN_WATER: + return entitylivingbase.isInWater(); + + case IS_INVISIBLE: + return entitylivingbase.isInvisible(); + + case IS_ON_GROUND: + return entitylivingbase.onGround; + + case IS_RIDDEN: + return entitylivingbase.riddenByEntity != null; + + case IS_RIDING: + return entitylivingbase.isRiding(); + + case IS_SNEAKING: + return entitylivingbase.isSneaking(); + + case IS_SPRINTING: + return entitylivingbase.isSprinting(); + + case IS_WET: + return entitylivingbase.isWet(); + } + } + + return false; + } + + public static ShaderParameterBool parse(String str) + { + if (str == null) + { + return null; + } + else + { + for (int i = 0; i < VALUES.length; ++i) + { + ShaderParameterBool shaderparameterbool = VALUES[i]; + + if (shaderparameterbool.getName().equals(str)) + { + return shaderparameterbool; + } + } + + return null; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterFloat.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterFloat.java new file mode 100644 index 0000000..8a44b51 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterFloat.java @@ -0,0 +1,221 @@ +package net.optifine.shaders.uniform; + +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.shaders.Shaders; + +public enum ShaderParameterFloat +{ + BIOME("biome"), + TEMPERATURE("temperature"), + RAINFALL("rainfall"), + HELD_ITEM_ID(Shaders.uniform_heldItemId), + HELD_BLOCK_LIGHT_VALUE(Shaders.uniform_heldBlockLightValue), + HELD_ITEM_ID2(Shaders.uniform_heldItemId2), + HELD_BLOCK_LIGHT_VALUE2(Shaders.uniform_heldBlockLightValue2), + WORLD_TIME(Shaders.uniform_worldTime), + WORLD_DAY(Shaders.uniform_worldDay), + MOON_PHASE(Shaders.uniform_moonPhase), + FRAME_COUNTER(Shaders.uniform_frameCounter), + FRAME_TIME(Shaders.uniform_frameTime), + FRAME_TIME_COUNTER(Shaders.uniform_frameTimeCounter), + SUN_ANGLE(Shaders.uniform_sunAngle), + SHADOW_ANGLE(Shaders.uniform_shadowAngle), + RAIN_STRENGTH(Shaders.uniform_rainStrength), + ASPECT_RATIO(Shaders.uniform_aspectRatio), + VIEW_WIDTH(Shaders.uniform_viewWidth), + VIEW_HEIGHT(Shaders.uniform_viewHeight), + NEAR(Shaders.uniform_near), + FAR(Shaders.uniform_far), + WETNESS(Shaders.uniform_wetness), + EYE_ALTITUDE(Shaders.uniform_eyeAltitude), + EYE_BRIGHTNESS(Shaders.uniform_eyeBrightness, new String[]{"x", "y"}), + TERRAIN_TEXTURE_SIZE(Shaders.uniform_terrainTextureSize, new String[]{"x", "y"}), + TERRRAIN_ICON_SIZE(Shaders.uniform_terrainIconSize), + IS_EYE_IN_WATER(Shaders.uniform_isEyeInWater), + NIGHT_VISION(Shaders.uniform_nightVision), + BLINDNESS(Shaders.uniform_blindness), + SCREEN_BRIGHTNESS(Shaders.uniform_screenBrightness), + HIDE_GUI(Shaders.uniform_hideGUI), + CENTER_DEPT_SMOOTH(Shaders.uniform_centerDepthSmooth), + ATLAS_SIZE(Shaders.uniform_atlasSize, new String[]{"x", "y"}), + CAMERA_POSITION(Shaders.uniform_cameraPosition, new String[]{"x", "y", "z"}), + PREVIOUS_CAMERA_POSITION(Shaders.uniform_previousCameraPosition, new String[]{"x", "y", "z"}), + SUN_POSITION(Shaders.uniform_sunPosition, new String[]{"x", "y", "z"}), + MOON_POSITION(Shaders.uniform_moonPosition, new String[]{"x", "y", "z"}), + SHADOW_LIGHT_POSITION(Shaders.uniform_shadowLightPosition, new String[]{"x", "y", "z"}), + UP_POSITION(Shaders.uniform_upPosition, new String[]{"x", "y", "z"}), + SKY_COLOR(Shaders.uniform_skyColor, new String[]{"r", "g", "b"}), + GBUFFER_PROJECTION(Shaders.uniform_gbufferProjection, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + GBUFFER_PROJECTION_INVERSE(Shaders.uniform_gbufferProjectionInverse, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + GBUFFER_PREVIOUS_PROJECTION(Shaders.uniform_gbufferPreviousProjection, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + GBUFFER_MODEL_VIEW(Shaders.uniform_gbufferModelView, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + GBUFFER_MODEL_VIEW_INVERSE(Shaders.uniform_gbufferModelViewInverse, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + GBUFFER_PREVIOUS_MODEL_VIEW(Shaders.uniform_gbufferPreviousModelView, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + SHADOW_PROJECTION(Shaders.uniform_shadowProjection, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + SHADOW_PROJECTION_INVERSE(Shaders.uniform_shadowProjectionInverse, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + SHADOW_MODEL_VIEW(Shaders.uniform_shadowModelView, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}), + SHADOW_MODEL_VIEW_INVERSE(Shaders.uniform_shadowModelViewInverse, new String[]{"0", "1", "2", "3"}, new String[]{"0", "1", "2", "3"}); + + private String name; + private ShaderUniformBase uniform; + private String[] indexNames1; + private String[] indexNames2; + + private ShaderParameterFloat(String name) + { + this.name = name; + } + + private ShaderParameterFloat(ShaderUniformBase uniform) + { + this.name = uniform.getName(); + this.uniform = uniform; + + if (!instanceOf(uniform, new Class[] {ShaderUniform1f.class, ShaderUniform1i.class})) + { + throw new IllegalArgumentException("Invalid uniform type for enum: " + this + ", uniform: " + uniform.getClass().getName()); + } + } + + private ShaderParameterFloat(ShaderUniformBase uniform, String[] indexNames1) + { + this.name = uniform.getName(); + this.uniform = uniform; + this.indexNames1 = indexNames1; + + if (!instanceOf(uniform, new Class[] {ShaderUniform2i.class, ShaderUniform2f.class, ShaderUniform3f.class, ShaderUniform4f.class})) + { + throw new IllegalArgumentException("Invalid uniform type for enum: " + this + ", uniform: " + uniform.getClass().getName()); + } + } + + private ShaderParameterFloat(ShaderUniformBase uniform, String[] indexNames1, String[] indexNames2) + { + this.name = uniform.getName(); + this.uniform = uniform; + this.indexNames1 = indexNames1; + this.indexNames2 = indexNames2; + + if (!instanceOf(uniform, new Class[] {ShaderUniformM4.class})) + { + throw new IllegalArgumentException("Invalid uniform type for enum: " + this + ", uniform: " + uniform.getClass().getName()); + } + } + + public String getName() + { + return this.name; + } + + public ShaderUniformBase getUniform() + { + return this.uniform; + } + + public String[] getIndexNames1() + { + return this.indexNames1; + } + + public String[] getIndexNames2() + { + return this.indexNames2; + } + + public float eval(int index1, int index2) + { + if (this.indexNames1 == null || index1 >= 0 && index1 <= this.indexNames1.length) + { + if (this.indexNames2 == null || index2 >= 0 && index2 <= this.indexNames2.length) + { + switch (this) + { + case BIOME: + BlockPos blockpos2 = Shaders.getCameraPosition(); + BiomeGenBase biomegenbase2 = Shaders.getCurrentWorld().getBiomeGenForCoords(blockpos2); + return (float)biomegenbase2.biomeID; + + case TEMPERATURE: + BlockPos blockpos1 = Shaders.getCameraPosition(); + BiomeGenBase biomegenbase1 = Shaders.getCurrentWorld().getBiomeGenForCoords(blockpos1); + return biomegenbase1 != null ? biomegenbase1.getFloatTemperature(blockpos1) : 0.0F; + + case RAINFALL: + BlockPos pos = Shaders.getCameraPosition(); + BiomeGenBase biome = Shaders.getCurrentWorld().getBiomeGenForCoords(pos); + return biome != null ? biome.getFloatRainfall() : 0.0F; + + default: + if (this.uniform instanceof ShaderUniform1f) + { + return ((ShaderUniform1f)this.uniform).getValue(); + } + else if (this.uniform instanceof ShaderUniform1i) + { + return (float)((ShaderUniform1i)this.uniform).getValue(); + } + else if (this.uniform instanceof ShaderUniform2i) + { + return (float)((ShaderUniform2i)this.uniform).getValue()[index1]; + } + else if (this.uniform instanceof ShaderUniform2f) + { + return ((ShaderUniform2f)this.uniform).getValue()[index1]; + } + else if (this.uniform instanceof ShaderUniform3f) + { + return ((ShaderUniform3f)this.uniform).getValue()[index1]; + } + else if (this.uniform instanceof ShaderUniform4f) + { + return ((ShaderUniform4f)this.uniform).getValue()[index1]; + } + else if (this.uniform instanceof ShaderUniformM4) + { + return ((ShaderUniformM4)this.uniform).getValue(index1, index2); + } + else + { + throw new IllegalArgumentException("Unknown uniform type: " + this); + } + } + } + else + { + Config.warn("Invalid index2, parameter: " + this + ", index: " + index2); + return 0.0F; + } + } + else + { + Config.warn("Invalid index1, parameter: " + this + ", index: " + index1); + return 0.0F; + } + } + + private static boolean instanceOf(Object obj, Class... classes) + { + if (obj == null) + { + return false; + } + else + { + Class oclass = obj.getClass(); + + for (int i = 0; i < classes.length; ++i) + { + Class oclass1 = classes[i]; + + if (oclass1.isAssignableFrom(oclass)) + { + return true; + } + } + + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterIndexed.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterIndexed.java new file mode 100644 index 0000000..a494fd0 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderParameterIndexed.java @@ -0,0 +1,43 @@ +package net.optifine.shaders.uniform; + +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpressionFloat; + +public class ShaderParameterIndexed implements IExpressionFloat +{ + private ShaderParameterFloat type; + private int index1; + private int index2; + + public ShaderParameterIndexed(ShaderParameterFloat type) + { + this(type, 0, 0); + } + + public ShaderParameterIndexed(ShaderParameterFloat type, int index1) + { + this(type, index1, 0); + } + + public ShaderParameterIndexed(ShaderParameterFloat type, int index1, int index2) + { + this.type = type; + this.index1 = index1; + this.index2 = index2; + } + + public float eval() + { + return this.type.eval(this.index1, this.index2); + } + + public ExpressionType getExpressionType() + { + return ExpressionType.FLOAT; + } + + public String toString() + { + return this.type.getIndexNames1() == null ? "" + this.type : (this.type.getIndexNames2() == null ? "" + this.type + "." + this.type.getIndexNames1()[this.index1] : "" + this.type + "." + this.type.getIndexNames1()[this.index1] + "." + this.type.getIndexNames2()[this.index2]); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform1f.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform1f.java new file mode 100644 index 0000000..7777ec2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform1f.java @@ -0,0 +1,62 @@ +package net.optifine.shaders.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniform1f extends ShaderUniformBase +{ + private float[] programValues; + private static final float VALUE_UNKNOWN = -3.4028235E38F; + + public ShaderUniform1f(String name) + { + super(name); + this.resetValue(); + } + + public void setValue(float valueNew) + { + int i = this.getProgram(); + float f = this.programValues[i]; + + if (valueNew != f) + { + this.programValues[i] = valueNew; + int j = this.getLocation(); + + if (j >= 0) + { + ARBShaderObjects.glUniform1fARB(j, valueNew); + this.checkGLError(); + } + } + } + + public float getValue() + { + int i = this.getProgram(); + float f = this.programValues[i]; + return f; + } + + protected void onProgramSet(int program) + { + if (program >= this.programValues.length) + { + float[] afloat = this.programValues; + float[] afloat1 = new float[program + 10]; + System.arraycopy(afloat, 0, afloat1, 0, afloat.length); + + for (int i = afloat.length; i < afloat1.length; ++i) + { + afloat1[i] = -3.4028235E38F; + } + + this.programValues = afloat1; + } + } + + protected void resetValue() + { + this.programValues = new float[] { -3.4028235E38F}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform1i.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform1i.java new file mode 100644 index 0000000..cfa0a94 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform1i.java @@ -0,0 +1,62 @@ +package net.optifine.shaders.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniform1i extends ShaderUniformBase +{ + private int[] programValues; + private static final int VALUE_UNKNOWN = Integer.MIN_VALUE; + + public ShaderUniform1i(String name) + { + super(name); + this.resetValue(); + } + + public void setValue(int valueNew) + { + int i = this.getProgram(); + int j = this.programValues[i]; + + if (valueNew != j) + { + this.programValues[i] = valueNew; + int k = this.getLocation(); + + if (k >= 0) + { + ARBShaderObjects.glUniform1iARB(k, valueNew); + this.checkGLError(); + } + } + } + + public int getValue() + { + int i = this.getProgram(); + int j = this.programValues[i]; + return j; + } + + protected void onProgramSet(int program) + { + if (program >= this.programValues.length) + { + int[] aint = this.programValues; + int[] aint1 = new int[program + 10]; + System.arraycopy(aint, 0, aint1, 0, aint.length); + + for (int i = aint.length; i < aint1.length; ++i) + { + aint1[i] = Integer.MIN_VALUE; + } + + this.programValues = aint1; + } + } + + protected void resetValue() + { + this.programValues = new int[] {Integer.MIN_VALUE}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform2f.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform2f.java new file mode 100644 index 0000000..e347163 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform2f.java @@ -0,0 +1,62 @@ +package net.optifine.shaders.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniform2f extends ShaderUniformBase +{ + private float[][] programValues; + private static final float VALUE_UNKNOWN = -3.4028235E38F; + + public ShaderUniform2f(String name) + { + super(name); + this.resetValue(); + } + + public void setValue(float v0, float v1) + { + int i = this.getProgram(); + float[] afloat = this.programValues[i]; + + if (afloat[0] != v0 || afloat[1] != v1) + { + afloat[0] = v0; + afloat[1] = v1; + int j = this.getLocation(); + + if (j >= 0) + { + ARBShaderObjects.glUniform2fARB(j, v0, v1); + this.checkGLError(); + } + } + } + + public float[] getValue() + { + int i = this.getProgram(); + float[] afloat = this.programValues[i]; + return afloat; + } + + protected void onProgramSet(int program) + { + if (program >= this.programValues.length) + { + float[][] afloat = this.programValues; + float[][] afloat1 = new float[program + 10][]; + System.arraycopy(afloat, 0, afloat1, 0, afloat.length); + this.programValues = afloat1; + } + + if (this.programValues[program] == null) + { + this.programValues[program] = new float[] { -3.4028235E38F, -3.4028235E38F}; + } + } + + protected void resetValue() + { + this.programValues = new float[][] {{ -3.4028235E38F, -3.4028235E38F}}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform2i.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform2i.java new file mode 100644 index 0000000..b6eabe4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform2i.java @@ -0,0 +1,62 @@ +package net.optifine.shaders.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniform2i extends ShaderUniformBase +{ + private int[][] programValues; + private static final int VALUE_UNKNOWN = Integer.MIN_VALUE; + + public ShaderUniform2i(String name) + { + super(name); + this.resetValue(); + } + + public void setValue(int v0, int v1) + { + int i = this.getProgram(); + int[] aint = this.programValues[i]; + + if (aint[0] != v0 || aint[1] != v1) + { + aint[0] = v0; + aint[1] = v1; + int j = this.getLocation(); + + if (j >= 0) + { + ARBShaderObjects.glUniform2iARB(j, v0, v1); + this.checkGLError(); + } + } + } + + public int[] getValue() + { + int i = this.getProgram(); + int[] aint = this.programValues[i]; + return aint; + } + + protected void onProgramSet(int program) + { + if (program >= this.programValues.length) + { + int[][] aint = this.programValues; + int[][] aint1 = new int[program + 10][]; + System.arraycopy(aint, 0, aint1, 0, aint.length); + this.programValues = aint1; + } + + if (this.programValues[program] == null) + { + this.programValues[program] = new int[] {Integer.MIN_VALUE, Integer.MIN_VALUE}; + } + } + + protected void resetValue() + { + this.programValues = new int[][] {{Integer.MIN_VALUE, Integer.MIN_VALUE}}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform3f.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform3f.java new file mode 100644 index 0000000..28865f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform3f.java @@ -0,0 +1,63 @@ +package net.optifine.shaders.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniform3f extends ShaderUniformBase +{ + private float[][] programValues; + private static final float VALUE_UNKNOWN = -3.4028235E38F; + + public ShaderUniform3f(String name) + { + super(name); + this.resetValue(); + } + + public void setValue(float v0, float v1, float v2) + { + int i = this.getProgram(); + float[] afloat = this.programValues[i]; + + if (afloat[0] != v0 || afloat[1] != v1 || afloat[2] != v2) + { + afloat[0] = v0; + afloat[1] = v1; + afloat[2] = v2; + int j = this.getLocation(); + + if (j >= 0) + { + ARBShaderObjects.glUniform3fARB(j, v0, v1, v2); + this.checkGLError(); + } + } + } + + public float[] getValue() + { + int i = this.getProgram(); + float[] afloat = this.programValues[i]; + return afloat; + } + + protected void onProgramSet(int program) + { + if (program >= this.programValues.length) + { + float[][] afloat = this.programValues; + float[][] afloat1 = new float[program + 10][]; + System.arraycopy(afloat, 0, afloat1, 0, afloat.length); + this.programValues = afloat1; + } + + if (this.programValues[program] == null) + { + this.programValues[program] = new float[] { -3.4028235E38F, -3.4028235E38F, -3.4028235E38F}; + } + } + + protected void resetValue() + { + this.programValues = new float[][] {{ -3.4028235E38F, -3.4028235E38F, -3.4028235E38F}}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform4f.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform4f.java new file mode 100644 index 0000000..a68de92 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform4f.java @@ -0,0 +1,64 @@ +package net.optifine.shaders.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniform4f extends ShaderUniformBase +{ + private float[][] programValues; + private static final float VALUE_UNKNOWN = -3.4028235E38F; + + public ShaderUniform4f(String name) + { + super(name); + this.resetValue(); + } + + public void setValue(float v0, float v1, float v2, float v3) + { + int i = this.getProgram(); + float[] afloat = this.programValues[i]; + + if (afloat[0] != v0 || afloat[1] != v1 || afloat[2] != v2 || afloat[3] != v3) + { + afloat[0] = v0; + afloat[1] = v1; + afloat[2] = v2; + afloat[3] = v3; + int j = this.getLocation(); + + if (j >= 0) + { + ARBShaderObjects.glUniform4fARB(j, v0, v1, v2, v3); + this.checkGLError(); + } + } + } + + public float[] getValue() + { + int i = this.getProgram(); + float[] afloat = this.programValues[i]; + return afloat; + } + + protected void onProgramSet(int program) + { + if (program >= this.programValues.length) + { + float[][] afloat = this.programValues; + float[][] afloat1 = new float[program + 10][]; + System.arraycopy(afloat, 0, afloat1, 0, afloat.length); + this.programValues = afloat1; + } + + if (this.programValues[program] == null) + { + this.programValues[program] = new float[] { -3.4028235E38F, -3.4028235E38F, -3.4028235E38F, -3.4028235E38F}; + } + } + + protected void resetValue() + { + this.programValues = new float[][] {{ -3.4028235E38F, -3.4028235E38F, -3.4028235E38F, -3.4028235E38F}}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform4i.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform4i.java new file mode 100644 index 0000000..34d8361 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniform4i.java @@ -0,0 +1,64 @@ +package net.optifine.shaders.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniform4i extends ShaderUniformBase +{ + private int[][] programValues; + private static final int VALUE_UNKNOWN = Integer.MIN_VALUE; + + public ShaderUniform4i(String name) + { + super(name); + this.resetValue(); + } + + public void setValue(int v0, int v1, int v2, int v3) + { + int i = this.getProgram(); + int[] aint = this.programValues[i]; + + if (aint[0] != v0 || aint[1] != v1 || aint[2] != v2 || aint[3] != v3) + { + aint[0] = v0; + aint[1] = v1; + aint[2] = v2; + aint[3] = v3; + int j = this.getLocation(); + + if (j >= 0) + { + ARBShaderObjects.glUniform4iARB(j, v0, v1, v2, v3); + this.checkGLError(); + } + } + } + + public int[] getValue() + { + int i = this.getProgram(); + int[] aint = this.programValues[i]; + return aint; + } + + protected void onProgramSet(int program) + { + if (program >= this.programValues.length) + { + int[][] aint = this.programValues; + int[][] aint1 = new int[program + 10][]; + System.arraycopy(aint, 0, aint1, 0, aint.length); + this.programValues = aint1; + } + + if (this.programValues[program] == null) + { + this.programValues[program] = new int[] {Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE}; + } + } + + protected void resetValue() + { + this.programValues = new int[][] {{Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE}}; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniformBase.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniformBase.java new file mode 100644 index 0000000..1a7bd7c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniformBase.java @@ -0,0 +1,104 @@ +package net.optifine.shaders.uniform; + +import java.util.Arrays; +import net.optifine.shaders.Shaders; +import org.lwjgl.opengl.ARBShaderObjects; + +public abstract class ShaderUniformBase +{ + private String name; + private int program = 0; + private int[] locations = new int[] { -1}; + private static final int LOCATION_UNDEFINED = -1; + private static final int LOCATION_UNKNOWN = Integer.MIN_VALUE; + + public ShaderUniformBase(String name) + { + this.name = name; + } + + public void setProgram(int program) + { + if (this.program != program) + { + this.program = program; + this.expandLocations(); + this.onProgramSet(program); + } + } + + private void expandLocations() + { + if (this.program >= this.locations.length) + { + int[] aint = new int[this.program * 2]; + Arrays.fill(aint, Integer.MIN_VALUE); + System.arraycopy(this.locations, 0, aint, 0, this.locations.length); + this.locations = aint; + } + } + + protected abstract void onProgramSet(int var1); + + public String getName() + { + return this.name; + } + + public int getProgram() + { + return this.program; + } + + public int getLocation() + { + if (this.program <= 0) + { + return -1; + } + else + { + int i = this.locations[this.program]; + + if (i == Integer.MIN_VALUE) + { + i = ARBShaderObjects.glGetUniformLocationARB(this.program, (CharSequence)this.name); + this.locations[this.program] = i; + } + + return i; + } + } + + public boolean isDefined() + { + return this.getLocation() >= 0; + } + + public void disable() + { + this.locations[this.program] = -1; + } + + public void reset() + { + this.program = 0; + this.locations = new int[] { -1}; + this.resetValue(); + } + + protected abstract void resetValue(); + + protected void checkGLError() + { + if (Shaders.checkGLError(this.name) != 0) + { + this.disable(); + } + } + + public String toString() + { + return this.name; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniformM4.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniformM4.java new file mode 100644 index 0000000..58f1e17 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniformM4.java @@ -0,0 +1,51 @@ +package net.optifine.shaders.uniform; + +import java.nio.FloatBuffer; +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderUniformM4 extends ShaderUniformBase +{ + private boolean transpose; + private FloatBuffer matrix; + + public ShaderUniformM4(String name) + { + super(name); + } + + public void setValue(boolean transpose, FloatBuffer matrix) + { + this.transpose = transpose; + this.matrix = matrix; + int i = this.getLocation(); + + if (i >= 0) + { + ARBShaderObjects.glUniformMatrix4ARB(i, transpose, matrix); + this.checkGLError(); + } + } + + public float getValue(int row, int col) + { + if (this.matrix == null) + { + return 0.0F; + } + else + { + int i = this.transpose ? col * 4 + row : row * 4 + col; + float f = this.matrix.get(i); + return f; + } + } + + protected void onProgramSet(int program) + { + } + + protected void resetValue() + { + this.matrix = null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniforms.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniforms.java new file mode 100644 index 0000000..2af59d5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/ShaderUniforms.java @@ -0,0 +1,76 @@ +package net.optifine.shaders.uniform; + +import java.util.ArrayList; +import java.util.List; + +public class ShaderUniforms +{ + private final List listUniforms = new ArrayList(); + + public void setProgram(int program) + { + for (int i = 0; i < this.listUniforms.size(); ++i) + { + ShaderUniformBase shaderuniformbase = (ShaderUniformBase)this.listUniforms.get(i); + shaderuniformbase.setProgram(program); + } + } + + public void reset() + { + for (int i = 0; i < this.listUniforms.size(); ++i) + { + ShaderUniformBase shaderuniformbase = (ShaderUniformBase)this.listUniforms.get(i); + shaderuniformbase.reset(); + } + } + + public ShaderUniform1i make1i(String name) + { + ShaderUniform1i shaderuniform1i = new ShaderUniform1i(name); + this.listUniforms.add(shaderuniform1i); + return shaderuniform1i; + } + + public ShaderUniform2i make2i(String name) + { + ShaderUniform2i shaderuniform2i = new ShaderUniform2i(name); + this.listUniforms.add(shaderuniform2i); + return shaderuniform2i; + } + + public ShaderUniform4i make4i(String name) + { + ShaderUniform4i shaderuniform4i = new ShaderUniform4i(name); + this.listUniforms.add(shaderuniform4i); + return shaderuniform4i; + } + + public ShaderUniform1f make1f(String name) + { + ShaderUniform1f shaderuniform1f = new ShaderUniform1f(name); + this.listUniforms.add(shaderuniform1f); + return shaderuniform1f; + } + + public ShaderUniform3f make3f(String name) + { + ShaderUniform3f shaderuniform3f = new ShaderUniform3f(name); + this.listUniforms.add(shaderuniform3f); + return shaderuniform3f; + } + + public ShaderUniform4f make4f(String name) + { + ShaderUniform4f shaderuniform4f = new ShaderUniform4f(name); + this.listUniforms.add(shaderuniform4f); + return shaderuniform4f; + } + + public ShaderUniformM4 makeM4(String name) + { + ShaderUniformM4 shaderuniformm4 = new ShaderUniformM4(name); + this.listUniforms.add(shaderuniformm4); + return shaderuniformm4; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/Smoother.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/Smoother.java new file mode 100644 index 0000000..41b0e38 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/Smoother.java @@ -0,0 +1,46 @@ +package net.optifine.shaders.uniform; + +import java.util.HashMap; +import java.util.Map; +import net.optifine.util.CounterInt; +import net.optifine.util.SmoothFloat; + +public class Smoother +{ + private static Map mapSmoothValues = new HashMap(); + private static CounterInt counterIds = new CounterInt(1); + + public static float getSmoothValue(int id, float value, float timeFadeUpSec, float timeFadeDownSec) + { + synchronized (mapSmoothValues) + { + Integer integer = Integer.valueOf(id); + SmoothFloat smoothfloat = (SmoothFloat)mapSmoothValues.get(integer); + + if (smoothfloat == null) + { + smoothfloat = new SmoothFloat(value, timeFadeUpSec, timeFadeDownSec); + mapSmoothValues.put(integer, smoothfloat); + } + + float f = smoothfloat.getSmoothValue(value, timeFadeUpSec, timeFadeDownSec); + return f; + } + } + + public static int getNextId() + { + synchronized (counterIds) + { + return counterIds.nextValue(); + } + } + + public static void resetValues() + { + synchronized (mapSmoothValues) + { + mapSmoothValues.clear(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/UniformType.java b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/UniformType.java new file mode 100644 index 0000000..5f99daa --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/shaders/uniform/UniformType.java @@ -0,0 +1,178 @@ +package net.optifine.shaders.uniform; + +import net.optifine.expr.ExpressionType; +import net.optifine.expr.IExpression; +import net.optifine.expr.IExpressionBool; +import net.optifine.expr.IExpressionFloat; +import net.optifine.expr.IExpressionFloatArray; + +public enum UniformType +{ + BOOL, + INT, + FLOAT, + VEC2, + VEC3, + VEC4; + + public ShaderUniformBase makeShaderUniform(String name) + { + switch (this) + { + case BOOL: + return new ShaderUniform1i(name); + + case INT: + return new ShaderUniform1i(name); + + case FLOAT: + return new ShaderUniform1f(name); + + case VEC2: + return new ShaderUniform2f(name); + + case VEC3: + return new ShaderUniform3f(name); + + case VEC4: + return new ShaderUniform4f(name); + + default: + throw new RuntimeException("Unknown uniform type: " + this); + } + } + + public void updateUniform(IExpression expression, ShaderUniformBase uniform) + { + switch (this) + { + case BOOL: + this.updateUniformBool((IExpressionBool)expression, (ShaderUniform1i)uniform); + return; + + case INT: + this.updateUniformInt((IExpressionFloat)expression, (ShaderUniform1i)uniform); + return; + + case FLOAT: + this.updateUniformFloat((IExpressionFloat)expression, (ShaderUniform1f)uniform); + return; + + case VEC2: + this.updateUniformFloat2((IExpressionFloatArray)expression, (ShaderUniform2f)uniform); + return; + + case VEC3: + this.updateUniformFloat3((IExpressionFloatArray)expression, (ShaderUniform3f)uniform); + return; + + case VEC4: + this.updateUniformFloat4((IExpressionFloatArray)expression, (ShaderUniform4f)uniform); + return; + + default: + throw new RuntimeException("Unknown uniform type: " + this); + } + } + + private void updateUniformBool(IExpressionBool expression, ShaderUniform1i uniform) + { + boolean flag = expression.eval(); + int i = flag ? 1 : 0; + uniform.setValue(i); + } + + private void updateUniformInt(IExpressionFloat expression, ShaderUniform1i uniform) + { + int i = (int)expression.eval(); + uniform.setValue(i); + } + + private void updateUniformFloat(IExpressionFloat expression, ShaderUniform1f uniform) + { + float f = expression.eval(); + uniform.setValue(f); + } + + private void updateUniformFloat2(IExpressionFloatArray expression, ShaderUniform2f uniform) + { + float[] afloat = expression.eval(); + + if (afloat.length != 2) + { + throw new RuntimeException("Value length is not 2, length: " + afloat.length); + } + else + { + uniform.setValue(afloat[0], afloat[1]); + } + } + + private void updateUniformFloat3(IExpressionFloatArray expression, ShaderUniform3f uniform) + { + float[] afloat = expression.eval(); + + if (afloat.length != 3) + { + throw new RuntimeException("Value length is not 3, length: " + afloat.length); + } + else + { + uniform.setValue(afloat[0], afloat[1], afloat[2]); + } + } + + private void updateUniformFloat4(IExpressionFloatArray expression, ShaderUniform4f uniform) + { + float[] afloat = expression.eval(); + + if (afloat.length != 4) + { + throw new RuntimeException("Value length is not 4, length: " + afloat.length); + } + else + { + uniform.setValue(afloat[0], afloat[1], afloat[2], afloat[3]); + } + } + + public boolean matchesExpressionType(ExpressionType expressionType) + { + switch (this) + { + case BOOL: + return expressionType == ExpressionType.BOOL; + + case INT: + return expressionType == ExpressionType.FLOAT; + + case FLOAT: + return expressionType == ExpressionType.FLOAT; + + case VEC2: + case VEC3: + case VEC4: + return expressionType == ExpressionType.FLOAT_ARRAY; + + default: + throw new RuntimeException("Unknown uniform type: " + this); + } + } + + public static UniformType parse(String type) + { + UniformType[] auniformtype = values(); + + for (int i = 0; i < auniformtype.length; ++i) + { + UniformType uniformtype = auniformtype[i]; + + if (uniformtype.name().toLowerCase().equals(type)) + { + return uniformtype; + } + } + + return null; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/texture/InternalFormat.java b/Client-1.8.9/src/main/java/net/optifine/texture/InternalFormat.java new file mode 100644 index 0000000..cc35663 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/texture/InternalFormat.java @@ -0,0 +1,54 @@ +package net.optifine.texture; + +public enum InternalFormat +{ + R8(33321), + RG8(33323), + RGB8(32849), + RGBA8(32856), + R8_SNORM(36756), + RG8_SNORM(36757), + RGB8_SNORM(36758), + RGBA8_SNORM(36759), + R16(33322), + RG16(33324), + RGB16(32852), + RGBA16(32859), + R16_SNORM(36760), + RG16_SNORM(36761), + RGB16_SNORM(36762), + RGBA16_SNORM(36763), + R16F(33325), + RG16F(33327), + RGB16F(34843), + RGBA16F(34842), + R32F(33326), + RG32F(33328), + RGB32F(34837), + RGBA32F(34836), + R32I(33333), + RG32I(33339), + RGB32I(36227), + RGBA32I(36226), + R32UI(33334), + RG32UI(33340), + RGB32UI(36209), + RGBA32UI(36208), + R3_G3_B2(10768), + RGB5_A1(32855), + RGB10_A2(32857), + R11F_G11F_B10F(35898), + RGB9_E5(35901); + + private int id; + + private InternalFormat(int id) + { + this.id = id; + } + + public int getId() + { + return this.id; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/texture/PixelFormat.java b/Client-1.8.9/src/main/java/net/optifine/texture/PixelFormat.java new file mode 100644 index 0000000..ddc1285 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/texture/PixelFormat.java @@ -0,0 +1,29 @@ +package net.optifine.texture; + +public enum PixelFormat +{ + RED(6403), + RG(33319), + RGB(6407), + BGR(32992), + RGBA(6408), + BGRA(32993), + RED_INTEGER(36244), + RG_INTEGER(33320), + RGB_INTEGER(36248), + BGR_INTEGER(36250), + RGBA_INTEGER(36249), + BGRA_INTEGER(36251); + + private int id; + + private PixelFormat(int id) + { + this.id = id; + } + + public int getId() + { + return this.id; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/texture/PixelType.java b/Client-1.8.9/src/main/java/net/optifine/texture/PixelType.java new file mode 100644 index 0000000..2b0da02 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/texture/PixelType.java @@ -0,0 +1,37 @@ +package net.optifine.texture; + +public enum PixelType +{ + BYTE(5120), + SHORT(5122), + INT(5124), + HALF_FLOAT(5131), + FLOAT(5126), + UNSIGNED_BYTE(5121), + UNSIGNED_BYTE_3_3_2(32818), + UNSIGNED_BYTE_2_3_3_REV(33634), + UNSIGNED_SHORT(5123), + UNSIGNED_SHORT_5_6_5(33635), + UNSIGNED_SHORT_5_6_5_REV(33636), + UNSIGNED_SHORT_4_4_4_4(32819), + UNSIGNED_SHORT_4_4_4_4_REV(33637), + UNSIGNED_SHORT_5_5_5_1(32820), + UNSIGNED_SHORT_1_5_5_5_REV(33638), + UNSIGNED_INT(5125), + UNSIGNED_INT_8_8_8_8(32821), + UNSIGNED_INT_8_8_8_8_REV(33639), + UNSIGNED_INT_10_10_10_2(32822), + UNSIGNED_INT_2_10_10_10_REV(33640); + + private int id; + + private PixelType(int id) + { + this.id = id; + } + + public int getId() + { + return this.id; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/texture/TextureType.java b/Client-1.8.9/src/main/java/net/optifine/texture/TextureType.java new file mode 100644 index 0000000..59657dd --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/texture/TextureType.java @@ -0,0 +1,21 @@ +package net.optifine.texture; + +public enum TextureType +{ + TEXTURE_1D(3552), + TEXTURE_2D(3553), + TEXTURE_3D(32879), + TEXTURE_RECTANGLE(34037); + + private int id; + + private TextureType(int id) + { + this.id = id; + } + + public int getId() + { + return this.id; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/ArrayCache.java b/Client-1.8.9/src/main/java/net/optifine/util/ArrayCache.java new file mode 100644 index 0000000..cab1a91 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/ArrayCache.java @@ -0,0 +1,46 @@ +package net.optifine.util; + +import java.lang.reflect.Array; +import java.util.ArrayDeque; + +public class ArrayCache +{ + private Class elementClass = null; + private int maxCacheSize = 0; + private ArrayDeque cache = new ArrayDeque(); + + public ArrayCache(Class elementClass, int maxCacheSize) + { + this.elementClass = elementClass; + this.maxCacheSize = maxCacheSize; + } + + public synchronized Object allocate(int size) + { + Object object = this.cache.pollLast(); + + if (object == null || Array.getLength(object) < size) + { + object = Array.newInstance(this.elementClass, size); + } + + return object; + } + + public synchronized void free(Object arr) + { + if (arr != null) + { + Class oclass = arr.getClass(); + + if (oclass.getComponentType() != this.elementClass) + { + throw new IllegalArgumentException("Wrong component type"); + } + else if (this.cache.size() < this.maxCacheSize) + { + this.cache.add(arr); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/ArrayUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/ArrayUtils.java new file mode 100644 index 0000000..c949a5f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/ArrayUtils.java @@ -0,0 +1,391 @@ +package net.optifine.util; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +public class ArrayUtils +{ + public static boolean contains(Object[] arr, Object val) + { + if (arr == null) + { + return false; + } + else + { + for (int i = 0; i < arr.length; ++i) + { + Object object = arr[i]; + + if (object == val) + { + return true; + } + } + + return false; + } + } + + public static int[] addIntsToArray(int[] intArray, int[] copyFrom) + { + if (intArray != null && copyFrom != null) + { + int i = intArray.length; + int j = i + copyFrom.length; + int[] aint = new int[j]; + System.arraycopy(intArray, 0, aint, 0, i); + + for (int k = 0; k < copyFrom.length; ++k) + { + aint[k + i] = copyFrom[k]; + } + + return aint; + } + else + { + throw new NullPointerException("The given array is NULL"); + } + } + + public static int[] addIntToArray(int[] intArray, int intValue) + { + return addIntsToArray(intArray, new int[] {intValue}); + } + + public static Object[] addObjectsToArray(Object[] arr, Object[] objs) + { + if (arr == null) + { + throw new NullPointerException("The given array is NULL"); + } + else if (objs.length == 0) + { + return arr; + } + else + { + int i = arr.length; + int j = i + objs.length; + Object[] aobject = (Object[])((Object[])Array.newInstance(arr.getClass().getComponentType(), j)); + System.arraycopy(arr, 0, aobject, 0, i); + System.arraycopy(objs, 0, aobject, i, objs.length); + return aobject; + } + } + + public static Object[] addObjectToArray(Object[] arr, Object obj) + { + if (arr == null) + { + throw new NullPointerException("The given array is NULL"); + } + else + { + int i = arr.length; + int j = i + 1; + Object[] aobject = (Object[])((Object[])Array.newInstance(arr.getClass().getComponentType(), j)); + System.arraycopy(arr, 0, aobject, 0, i); + aobject[i] = obj; + return aobject; + } + } + + public static Object[] addObjectToArray(Object[] arr, Object obj, int index) + { + List list = new ArrayList(Arrays.asList(arr)); + list.add(index, obj); + Object[] aobject = (Object[])((Object[])Array.newInstance(arr.getClass().getComponentType(), list.size())); + return list.toArray(aobject); + } + + public static String arrayToString(boolean[] arr, String separator) + { + if (arr == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) + { + boolean flag = arr[i]; + + if (i > 0) + { + stringbuffer.append(separator); + } + + stringbuffer.append(String.valueOf(flag)); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToString(float[] arr) + { + return arrayToString(arr, ", "); + } + + public static String arrayToString(float[] arr, String separator) + { + if (arr == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) + { + float f = arr[i]; + + if (i > 0) + { + stringbuffer.append(separator); + } + + stringbuffer.append(String.valueOf(f)); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToString(float[] arr, String separator, String format) + { + if (arr == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) + { + float f = arr[i]; + + if (i > 0) + { + stringbuffer.append(separator); + } + + stringbuffer.append(String.format(format, new Object[] {Float.valueOf(f)})); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToString(int[] arr) + { + return arrayToString(arr, ", "); + } + + public static String arrayToString(int[] arr, String separator) + { + if (arr == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) + { + int j = arr[i]; + + if (i > 0) + { + stringbuffer.append(separator); + } + + stringbuffer.append(String.valueOf(j)); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToHexString(int[] arr, String separator) + { + if (arr == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) + { + int j = arr[i]; + + if (i > 0) + { + stringbuffer.append(separator); + } + + stringbuffer.append("0x"); + stringbuffer.append(Integer.toHexString(j)); + } + + return stringbuffer.toString(); + } + } + + public static String arrayToString(Object[] arr) + { + return arrayToString(arr, ", "); + } + + public static String arrayToString(Object[] arr, String separator) + { + if (arr == null) + { + return ""; + } + else + { + StringBuffer stringbuffer = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) + { + Object object = arr[i]; + + if (i > 0) + { + stringbuffer.append(separator); + } + + stringbuffer.append(String.valueOf(object)); + } + + return stringbuffer.toString(); + } + } + + public static Object[] collectionToArray(Collection coll, Class elementClass) + { + if (coll == null) + { + return null; + } + else if (elementClass == null) + { + return null; + } + else if (elementClass.isPrimitive()) + { + throw new IllegalArgumentException("Can not make arrays with primitive elements (int, double), element class: " + elementClass); + } + else + { + Object[] aobject = (Object[])((Object[])Array.newInstance(elementClass, coll.size())); + return coll.toArray(aobject); + } + } + + public static boolean equalsOne(int val, int[] vals) + { + for (int i = 0; i < vals.length; ++i) + { + if (vals[i] == val) + { + return true; + } + } + + return false; + } + + public static boolean equalsOne(Object a, Object[] bs) + { + if (bs == null) + { + return false; + } + else + { + for (int i = 0; i < bs.length; ++i) + { + Object object = bs[i]; + + if (equals(a, object)) + { + return true; + } + } + + return false; + } + } + + public static boolean equals(Object o1, Object o2) + { + return o1 == o2 ? true : (o1 == null ? false : o1.equals(o2)); + } + + public static boolean isSameOne(Object a, Object[] bs) + { + if (bs == null) + { + return false; + } + else + { + for (int i = 0; i < bs.length; ++i) + { + Object object = bs[i]; + + if (a == object) + { + return true; + } + } + + return false; + } + } + + public static Object[] removeObjectFromArray(Object[] arr, Object obj) + { + List list = new ArrayList(Arrays.asList(arr)); + list.remove(obj); + Object[] aobject = collectionToArray(list, arr.getClass().getComponentType()); + return aobject; + } + + public static int[] toPrimitive(Integer[] arr) + { + if (arr == null) + { + return null; + } + else if (arr.length == 0) + { + return new int[0]; + } + else + { + int[] aint = new int[arr.length]; + + for (int i = 0; i < aint.length; ++i) + { + aint[i] = arr[i].intValue(); + } + + return aint; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/CacheLocal.java b/Client-1.8.9/src/main/java/net/optifine/util/CacheLocal.java new file mode 100644 index 0000000..5fcb101 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/CacheLocal.java @@ -0,0 +1,76 @@ +package net.optifine.util; + +public class CacheLocal +{ + private int maxX = 18; + private int maxY = 128; + private int maxZ = 18; + private int offsetX = 0; + private int offsetY = 0; + private int offsetZ = 0; + private int[][][] cache = (int[][][])null; + private int[] lastZs = null; + private int lastDz = 0; + + public CacheLocal(int maxX, int maxY, int maxZ) + { + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; + this.cache = new int[maxX][maxY][maxZ]; + this.resetCache(); + } + + public void resetCache() + { + for (int i = 0; i < this.maxX; ++i) + { + int[][] aint = this.cache[i]; + + for (int j = 0; j < this.maxY; ++j) + { + int[] aint1 = aint[j]; + + for (int k = 0; k < this.maxZ; ++k) + { + aint1[k] = -1; + } + } + } + } + + public void setOffset(int x, int y, int z) + { + this.offsetX = x; + this.offsetY = y; + this.offsetZ = z; + this.resetCache(); + } + + public int get(int x, int y, int z) + { + try + { + this.lastZs = this.cache[x - this.offsetX][y - this.offsetY]; + this.lastDz = z - this.offsetZ; + return this.lastZs[this.lastDz]; + } + catch (ArrayIndexOutOfBoundsException arrayindexoutofboundsexception) + { + arrayindexoutofboundsexception.printStackTrace(); + return -1; + } + } + + public void setLast(int val) + { + try + { + this.lastZs[this.lastDz] = val; + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/CacheLocalByte.java b/Client-1.8.9/src/main/java/net/optifine/util/CacheLocalByte.java new file mode 100644 index 0000000..247b8e5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/CacheLocalByte.java @@ -0,0 +1,76 @@ +package net.optifine.util; + +public class CacheLocalByte +{ + private int maxX = 18; + private int maxY = 128; + private int maxZ = 18; + private int offsetX = 0; + private int offsetY = 0; + private int offsetZ = 0; + private byte[][][] cache = (byte[][][])null; + private byte[] lastZs = null; + private int lastDz = 0; + + public CacheLocalByte(int maxX, int maxY, int maxZ) + { + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; + this.cache = new byte[maxX][maxY][maxZ]; + this.resetCache(); + } + + public void resetCache() + { + for (int i = 0; i < this.maxX; ++i) + { + byte[][] abyte = this.cache[i]; + + for (int j = 0; j < this.maxY; ++j) + { + byte[] abyte1 = abyte[j]; + + for (int k = 0; k < this.maxZ; ++k) + { + abyte1[k] = -1; + } + } + } + } + + public void setOffset(int x, int y, int z) + { + this.offsetX = x; + this.offsetY = y; + this.offsetZ = z; + this.resetCache(); + } + + public byte get(int x, int y, int z) + { + try + { + this.lastZs = this.cache[x - this.offsetX][y - this.offsetY]; + this.lastDz = z - this.offsetZ; + return this.lastZs[this.lastDz]; + } + catch (ArrayIndexOutOfBoundsException arrayindexoutofboundsexception) + { + arrayindexoutofboundsexception.printStackTrace(); + return (byte) - 1; + } + } + + public void setLast(byte val) + { + try + { + this.lastZs[this.lastDz] = val; + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/CacheObjectArray.java b/Client-1.8.9/src/main/java/net/optifine/util/CacheObjectArray.java new file mode 100644 index 0000000..8bb2bb3 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/CacheObjectArray.java @@ -0,0 +1,120 @@ +package net.optifine.util; + +import java.lang.reflect.Array; +import java.util.ArrayDeque; +import net.minecraft.block.state.IBlockState; +import net.minecraft.src.Config; + +public class CacheObjectArray +{ + private static ArrayDeque arrays = new ArrayDeque(); + private static int maxCacheSize = 10; + + private static synchronized int[] allocateArray(int size) + { + int[] aint = (int[])arrays.pollLast(); + + if (aint == null || aint.length < size) + { + aint = new int[size]; + } + + return aint; + } + + public static synchronized void freeArray(int[] ints) + { + if (arrays.size() < maxCacheSize) + { + arrays.add(ints); + } + } + + public static void main(String[] args) throws Exception + { + int i = 4096; + int j = 500000; + testNew(i, j); + testClone(i, j); + testNewObj(i, j); + testCloneObj(i, j); + testNewObjDyn(IBlockState.class, i, j); + long k = testNew(i, j); + long l = testClone(i, j); + long i1 = testNewObj(i, j); + long j1 = testCloneObj(i, j); + long k1 = testNewObjDyn(IBlockState.class, i, j); + Config.dbg("New: " + k); + Config.dbg("Clone: " + l); + Config.dbg("NewObj: " + i1); + Config.dbg("CloneObj: " + j1); + Config.dbg("NewObjDyn: " + k1); + } + + private static long testClone(int size, int count) + { + long i = System.currentTimeMillis(); + int[] aint = new int[size]; + + for (int j = 0; j < count; ++j) + { + int[] aint1 = (int[])aint.clone(); + } + + long k = System.currentTimeMillis(); + return k - i; + } + + private static long testNew(int size, int count) + { + long i = System.currentTimeMillis(); + + for (int j = 0; j < count; ++j) + { + int[] aint = (int[])((int[])Array.newInstance(Integer.TYPE, size)); + } + + long k = System.currentTimeMillis(); + return k - i; + } + + private static long testCloneObj(int size, int count) + { + long i = System.currentTimeMillis(); + IBlockState[] aiblockstate = new IBlockState[size]; + + for (int j = 0; j < count; ++j) + { + IBlockState[] aiblockstate1 = (IBlockState[])aiblockstate.clone(); + } + + long k = System.currentTimeMillis(); + return k - i; + } + + private static long testNewObj(int size, int count) + { + long i = System.currentTimeMillis(); + + for (int j = 0; j < count; ++j) + { + IBlockState[] aiblockstate = new IBlockState[size]; + } + + long k = System.currentTimeMillis(); + return k - i; + } + + private static long testNewObjDyn(Class cls, int size, int count) + { + long i = System.currentTimeMillis(); + + for (int j = 0; j < count; ++j) + { + Object[] aobject = (Object[])((Object[])Array.newInstance(cls, size)); + } + + long k = System.currentTimeMillis(); + return k - i; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/ChunkUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/ChunkUtils.java new file mode 100644 index 0000000..33e81c4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/ChunkUtils.java @@ -0,0 +1,121 @@ +package net.optifine.util; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.src.Config; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.optifine.reflect.Reflector; +import net.optifine.reflect.ReflectorClass; +import net.optifine.reflect.ReflectorField; + +public class ChunkUtils +{ + private static ReflectorClass chunkClass = new ReflectorClass(Chunk.class); + private static ReflectorField fieldHasEntities = findFieldHasEntities(); + private static ReflectorField fieldPrecipitationHeightMap = new ReflectorField(chunkClass, int[].class, 0); + + public static boolean hasEntities(Chunk chunk) + { + return Reflector.getFieldValueBoolean(chunk, fieldHasEntities, true); + } + + public static int getPrecipitationHeight(Chunk chunk, BlockPos pos) + { + int[] aint = (int[])((int[])Reflector.getFieldValue(chunk, fieldPrecipitationHeightMap)); + + if (aint != null && aint.length == 256) + { + int i = pos.getX() & 15; + int j = pos.getZ() & 15; + int k = i | j << 4; + int l = aint[k]; + + if (l >= 0) + { + return l; + } + else + { + BlockPos blockpos = chunk.getPrecipitationHeight(pos); + return blockpos.getY(); + } + } + else + { + return -1; + } + } + + private static ReflectorField findFieldHasEntities() + { + try + { + Chunk chunk = new Chunk((World)null, 0, 0); + List list = new ArrayList(); + List list1 = new ArrayList(); + Field[] afield = Chunk.class.getDeclaredFields(); + + for (int i = 0; i < afield.length; ++i) + { + Field field = afield[i]; + + if (field.getType() == Boolean.TYPE) + { + field.setAccessible(true); + list.add(field); + list1.add(field.get(chunk)); + } + } + + chunk.setHasEntities(false); + List list2 = new ArrayList(); + + for (Object field10 : list) + { + Field field1 = (Field) field10; + list2.add(field1.get(chunk)); + } + + chunk.setHasEntities(true); + List list3 = new ArrayList(); + + for (Object field20 : list) + { + Field field2 = (Field) field20; + list3.add(field2.get(chunk)); + } + + List list4 = new ArrayList(); + + for (int j = 0; j < ((List)list).size(); ++j) + { + Field field3 = (Field)list.get(j); + Boolean obool = (Boolean)list2.get(j); + Boolean obool1 = (Boolean)list3.get(j); + + if (!obool.booleanValue() && obool1.booleanValue()) + { + list4.add(field3); + Boolean obool2 = (Boolean)list1.get(j); + field3.set(chunk, obool2); + } + } + + if (list4.size() == 1) + { + Field field4 = (Field)list4.get(0); + return new ReflectorField(field4); + } + } + catch (Exception exception) + { + Config.warn(exception.getClass().getName() + " " + exception.getMessage()); + } + + Config.warn("Error finding Chunk.hasEntities"); + return new ReflectorField(new ReflectorClass(Chunk.class), "hasEntities"); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/CompactArrayList.java b/Client-1.8.9/src/main/java/net/optifine/util/CompactArrayList.java new file mode 100644 index 0000000..cdd35dc --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/CompactArrayList.java @@ -0,0 +1,152 @@ +package net.optifine.util; + +import java.util.ArrayList; + +public class CompactArrayList +{ + private ArrayList list; + private int initialCapacity; + private float loadFactor; + private int countValid; + + public CompactArrayList() + { + this(10, 0.75F); + } + + public CompactArrayList(int initialCapacity) + { + this(initialCapacity, 0.75F); + } + + public CompactArrayList(int initialCapacity, float loadFactor) + { + this.list = null; + this.initialCapacity = 0; + this.loadFactor = 1.0F; + this.countValid = 0; + this.list = new ArrayList(initialCapacity); + this.initialCapacity = initialCapacity; + this.loadFactor = loadFactor; + } + + public void add(int index, Object element) + { + if (element != null) + { + ++this.countValid; + } + + this.list.add(index, element); + } + + public boolean add(Object element) + { + if (element != null) + { + ++this.countValid; + } + + return this.list.add(element); + } + + public Object set(int index, Object element) + { + Object object = this.list.set(index, element); + + if (element != object) + { + if (object == null) + { + ++this.countValid; + } + + if (element == null) + { + --this.countValid; + } + } + + return object; + } + + public Object remove(int index) + { + Object object = this.list.remove(index); + + if (object != null) + { + --this.countValid; + } + + return object; + } + + public void clear() + { + this.list.clear(); + this.countValid = 0; + } + + public void compact() + { + if (this.countValid <= 0 && this.list.size() <= 0) + { + this.clear(); + } + else if (this.list.size() > this.initialCapacity) + { + float f = (float)this.countValid * 1.0F / (float)this.list.size(); + + if (f <= this.loadFactor) + { + int i = 0; + + for (int j = 0; j < this.list.size(); ++j) + { + Object object = this.list.get(j); + + if (object != null) + { + if (j != i) + { + this.list.set(i, object); + } + + ++i; + } + } + + for (int k = this.list.size() - 1; k >= i; --k) + { + this.list.remove(k); + } + } + } + } + + public boolean contains(Object elem) + { + return this.list.contains(elem); + } + + public Object get(int index) + { + return this.list.get(index); + } + + public boolean isEmpty() + { + return this.list.isEmpty(); + } + + public int size() + { + return this.list.size(); + } + + public int getCountValid() + { + return this.countValid; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/CompoundKey.java b/Client-1.8.9/src/main/java/net/optifine/util/CompoundKey.java new file mode 100644 index 0000000..7a17274 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/CompoundKey.java @@ -0,0 +1,103 @@ +package net.optifine.util; + +import net.minecraft.src.Config; + +public class CompoundKey +{ + private Object[] keys; + private int hashcode; + + public CompoundKey(Object[] keys) + { + this.hashcode = 0; + this.keys = (Object[])((Object[])keys.clone()); + } + + public CompoundKey(Object k1, Object k2) + { + this(new Object[] {k1, k2}); + } + + public CompoundKey(Object k1, Object k2, Object k3) + { + this(new Object[] {k1, k2, k3}); + } + + public int hashCode() + { + if (this.hashcode == 0) + { + this.hashcode = 7; + + for (int i = 0; i < this.keys.length; ++i) + { + Object object = this.keys[i]; + + if (object != null) + { + this.hashcode = 31 * this.hashcode + object.hashCode(); + } + } + } + + return this.hashcode; + } + + public boolean equals(Object obj) + { + if (obj == null) + { + return false; + } + else if (obj == this) + { + return true; + } + else if (!(obj instanceof CompoundKey)) + { + return false; + } + else + { + CompoundKey compoundkey = (CompoundKey)obj; + Object[] aobject = compoundkey.getKeys(); + + if (aobject.length != this.keys.length) + { + return false; + } + else + { + for (int i = 0; i < this.keys.length; ++i) + { + if (!compareKeys(this.keys[i], aobject[i])) + { + return false; + } + } + + return true; + } + } + } + + private static boolean compareKeys(Object key1, Object key2) + { + return key1 == key2 ? true : (key1 == null ? false : (key2 == null ? false : key1.equals(key2))); + } + + private Object[] getKeys() + { + return this.keys; + } + + public Object[] getKeysCopy() + { + return (Object[])((Object[])this.keys.clone()); + } + + public String toString() + { + return "[" + Config.arrayToString(this.keys) + "]"; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/CounterInt.java b/Client-1.8.9/src/main/java/net/optifine/util/CounterInt.java new file mode 100644 index 0000000..ae76283 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/CounterInt.java @@ -0,0 +1,29 @@ +package net.optifine.util; + +public class CounterInt +{ + private int startValue; + private int value; + + public CounterInt(int startValue) + { + this.startValue = startValue; + this.value = startValue; + } + + public synchronized int nextValue() + { + int i = this.value++; + return i; + } + + public synchronized void reset() + { + this.value = this.startValue; + } + + public int getValue() + { + return this.value; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/DisplayModeComparator.java b/Client-1.8.9/src/main/java/net/optifine/util/DisplayModeComparator.java new file mode 100644 index 0000000..65f60eb --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/DisplayModeComparator.java @@ -0,0 +1,14 @@ +package net.optifine.util; + +import java.util.Comparator; +import org.lwjgl.opengl.DisplayMode; + +public class DisplayModeComparator implements Comparator +{ + public int compare(Object o1, Object o2) + { + DisplayMode displaymode = (DisplayMode)o1; + DisplayMode displaymode1 = (DisplayMode)o2; + return displaymode.getWidth() != displaymode1.getWidth() ? displaymode.getWidth() - displaymode1.getWidth() : (displaymode.getHeight() != displaymode1.getHeight() ? displaymode.getHeight() - displaymode1.getHeight() : (displaymode.getBitsPerPixel() != displaymode1.getBitsPerPixel() ? displaymode.getBitsPerPixel() - displaymode1.getBitsPerPixel() : (displaymode.getFrequency() != displaymode1.getFrequency() ? displaymode.getFrequency() - displaymode1.getFrequency() : 0))); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/EntityUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/EntityUtils.java new file mode 100644 index 0000000..865b7e7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/EntityUtils.java @@ -0,0 +1,72 @@ +package net.optifine.util; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.src.Config; + +public class EntityUtils +{ + private static final Map mapIdByClass = new HashMap(); + private static final Map mapIdByName = new HashMap(); + private static final Map mapClassByName = new HashMap(); + + public static int getEntityIdByClass(Entity entity) + { + return entity == null ? -1 : getEntityIdByClass(entity.getClass()); + } + + public static int getEntityIdByClass(Class cls) + { + Integer integer = (Integer)mapIdByClass.get(cls); + return integer == null ? -1 : integer.intValue(); + } + + public static int getEntityIdByName(String name) + { + Integer integer = (Integer)mapIdByName.get(name); + return integer == null ? -1 : integer.intValue(); + } + + public static Class getEntityClassByName(String name) + { + Class oclass = (Class)mapClassByName.get(name); + return oclass; + } + + static + { + for (int i = 0; i < 1000; ++i) + { + Class oclass = EntityList.getClassFromID(i); + + if (oclass != null) + { + String s = EntityList.getStringFromID(i); + + if (s != null) + { + if (mapIdByClass.containsKey(oclass)) + { + Config.warn("Duplicate entity class: " + oclass + ", id1: " + mapIdByClass.get(oclass) + ", id2: " + i); + } + + if (mapIdByName.containsKey(s)) + { + Config.warn("Duplicate entity name: " + s + ", id1: " + mapIdByName.get(s) + ", id2: " + i); + } + + if (mapClassByName.containsKey(s)) + { + Config.warn("Duplicate entity name: " + s + ", class1: " + mapClassByName.get(s) + ", class2: " + oclass); + } + + mapIdByClass.put(oclass, Integer.valueOf(i)); + mapIdByName.put(s, Integer.valueOf(i)); + mapClassByName.put(s, oclass); + } + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/FontUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/FontUtils.java new file mode 100644 index 0000000..2b26c60 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/FontUtils.java @@ -0,0 +1,167 @@ +package net.optifine.util; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class FontUtils +{ + public static Properties readFontProperties(ResourceLocation locationFontTexture) + { + String s = locationFontTexture.getResourcePath(); + Properties properties = new PropertiesOrdered(); + String s1 = ".png"; + + if (!s.endsWith(s1)) + { + return properties; + } + else + { + String s2 = s.substring(0, s.length() - s1.length()) + ".properties"; + + try + { + ResourceLocation resourcelocation = new ResourceLocation(locationFontTexture.getResourceDomain(), s2); + InputStream inputstream = Config.getResourceStream(Config.getResourceManager(), resourcelocation); + + if (inputstream == null) + { + return properties; + } + + Config.log("Loading " + s2); + properties.load(inputstream); + inputstream.close(); + } + catch (FileNotFoundException var7) + { + ; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + + return properties; + } + } + + public static void readCustomCharWidths(Properties props, float[] charWidth) + { + for (Object s0 : props.keySet()) + { + String s = (String) s0; + String s1 = "width."; + + if (s.startsWith(s1)) + { + String s2 = s.substring(s1.length()); + int i = Config.parseInt(s2, -1); + + if (i >= 0 && i < charWidth.length) + { + String s3 = props.getProperty(s); + float f = Config.parseFloat(s3, -1.0F); + + if (f >= 0.0F) + { + charWidth[i] = f; + } + } + } + } + } + + public static float readFloat(Properties props, String key, float defOffset) + { + String s = props.getProperty(key); + + if (s == null) + { + return defOffset; + } + else + { + float f = Config.parseFloat(s, Float.MIN_VALUE); + + if (f == Float.MIN_VALUE) + { + Config.warn("Invalid value for " + key + ": " + s); + return defOffset; + } + else + { + return f; + } + } + } + + public static boolean readBoolean(Properties props, String key, boolean defVal) + { + String s = props.getProperty(key); + + if (s == null) + { + return defVal; + } + else + { + String s1 = s.toLowerCase().trim(); + + if (!s1.equals("true") && !s1.equals("on")) + { + if (!s1.equals("false") && !s1.equals("off")) + { + Config.warn("Invalid value for " + key + ": " + s); + return defVal; + } + else + { + return false; + } + } + else + { + return true; + } + } + } + + public static ResourceLocation getHdFontLocation(ResourceLocation fontLoc) + { + if (!Config.isCustomFonts()) + { + return fontLoc; + } + else if (fontLoc == null) + { + return fontLoc; + } + else if (!Config.isMinecraftThread()) + { + return fontLoc; + } + else + { + String s = fontLoc.getResourcePath(); + String s1 = "textures/"; + String s2 = "mcpatcher/"; + + if (!s.startsWith(s1)) + { + return fontLoc; + } + else + { + s = s.substring(s1.length()); + s = s2 + s; + ResourceLocation resourcelocation = new ResourceLocation(fontLoc.getResourceDomain(), s); + return Config.hasResource(Config.getResourceManager(), resourcelocation) ? resourcelocation : fontLoc; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/FrameEvent.java b/Client-1.8.9/src/main/java/net/optifine/util/FrameEvent.java new file mode 100644 index 0000000..4afcfc9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/FrameEvent.java @@ -0,0 +1,37 @@ +package net.optifine.util; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; + +public class FrameEvent +{ + private static Map mapEventFrames = new HashMap(); + + public static boolean isActive(String name, int frameInterval) + { + synchronized (mapEventFrames) + { + int i = Minecraft.getMinecraft().entityRenderer.frameCount; + Integer integer = (Integer)mapEventFrames.get(name); + + if (integer == null) + { + integer = new Integer(i); + mapEventFrames.put(name, integer); + } + + int j = integer.intValue(); + + if (i > j && i < j + frameInterval) + { + return false; + } + else + { + mapEventFrames.put(name, new Integer(i)); + return true; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/IntArray.java b/Client-1.8.9/src/main/java/net/optifine/util/IntArray.java new file mode 100644 index 0000000..2900024 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/IntArray.java @@ -0,0 +1,81 @@ +package net.optifine.util; + +public class IntArray +{ + private int[] array = null; + private int position = 0; + private int limit = 0; + + public IntArray(int size) + { + this.array = new int[size]; + } + + public void put(int x) + { + this.array[this.position] = x; + ++this.position; + + if (this.limit < this.position) + { + this.limit = this.position; + } + } + + public void put(int pos, int x) + { + this.array[pos] = x; + + if (this.limit < pos) + { + this.limit = pos; + } + } + + public void position(int pos) + { + this.position = pos; + } + + public void put(int[] ints) + { + int i = ints.length; + + for (int j = 0; j < i; ++j) + { + this.array[this.position] = ints[j]; + ++this.position; + } + + if (this.limit < this.position) + { + this.limit = this.position; + } + } + + public int get(int pos) + { + return this.array[pos]; + } + + public int[] getArray() + { + return this.array; + } + + public void clear() + { + this.position = 0; + this.limit = 0; + } + + public int getLimit() + { + return this.limit; + } + + public int getPosition() + { + return this.position; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/IntegratedServerUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/IntegratedServerUtils.java new file mode 100644 index 0000000..c2ef059 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/IntegratedServerUtils.java @@ -0,0 +1,103 @@ +package net.optifine.util; + +import java.util.UUID; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.Chunk.EnumCreateEntityType; + +public class IntegratedServerUtils +{ + public static WorldServer getWorldServer() + { + Minecraft minecraft = Config.getMinecraft(); + World world = minecraft.theWorld; + + if (world == null) + { + return null; + } + else if (!minecraft.isIntegratedServerRunning()) + { + return null; + } + else + { + IntegratedServer integratedserver = minecraft.getIntegratedServer(); + + if (integratedserver == null) + { + return null; + } + else + { + WorldProvider worldprovider = world.provider; + + if (worldprovider == null) + { + return null; + } + else + { + int i = worldprovider.getDimensionId(); + + try + { + WorldServer worldserver = integratedserver.worldServerForDimension(i); + return worldserver; + } + catch (NullPointerException var6) + { + return null; + } + } + } + } + } + + public static Entity getEntity(UUID uuid) + { + WorldServer worldserver = getWorldServer(); + + if (worldserver == null) + { + return null; + } + else + { + Entity entity = worldserver.getEntityFromUuid(uuid); + return entity; + } + } + + public static TileEntity getTileEntity(BlockPos pos) + { + WorldServer worldserver = getWorldServer(); + + if (worldserver == null) + { + return null; + } + else + { + Chunk chunk = worldserver.getChunkProvider().provideChunk(pos.getX() >> 4, pos.getZ() >> 4); + + if (chunk == null) + { + return null; + } + else + { + TileEntity tileentity = chunk.getTileEntity(pos, EnumCreateEntityType.CHECK); + return tileentity; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/IteratorCache.java b/Client-1.8.9/src/main/java/net/optifine/util/IteratorCache.java new file mode 100644 index 0000000..ece8521 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/IteratorCache.java @@ -0,0 +1,107 @@ +package net.optifine.util; + +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.Iterator; +import java.util.List; + +public class IteratorCache +{ + private static Deque> dequeIterators = new ArrayDeque(); + + public static Iterator getReadOnly(List list) + { + synchronized (dequeIterators) + { + IteratorCache.IteratorReusable iteratorreusable = (IteratorCache.IteratorReusable)dequeIterators.pollFirst(); + + if (iteratorreusable == null) + { + iteratorreusable = new IteratorCache.IteratorReadOnly(); + } + + iteratorreusable.setList(list); + return iteratorreusable; + } + } + + private static void finished(IteratorCache.IteratorReusable iterator) + { + synchronized (dequeIterators) + { + if (dequeIterators.size() <= 1000) + { + iterator.setList(null); + dequeIterators.addLast(iterator); + } + } + } + + static + { + for (int i = 0; i < 1000; ++i) + { + IteratorCache.IteratorReadOnly iteratorcache$iteratorreadonly = new IteratorCache.IteratorReadOnly(); + dequeIterators.add(iteratorcache$iteratorreadonly); + } + } + + public static class IteratorReadOnly implements IteratorCache.IteratorReusable + { + private List list; + private int index; + private boolean hasNext; + + public void setList(List list) + { + if (this.hasNext) + { + throw new RuntimeException("Iterator still used, oldList: " + this.list + ", newList: " + list); + } + else + { + this.list = list; + this.index = 0; + this.hasNext = list != null && this.index < list.size(); + } + } + + public Object next() + { + if (!this.hasNext) + { + return null; + } + else + { + Object object = this.list.get(this.index); + ++this.index; + this.hasNext = this.index < this.list.size(); + return object; + } + } + + public boolean hasNext() + { + if (!this.hasNext) + { + IteratorCache.finished(this); + return false; + } + else + { + return this.hasNext; + } + } + + public void remove() + { + throw new UnsupportedOperationException("remove"); + } + } + + public interface IteratorReusable extends Iterator + { + void setList(List var1); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/Json.java b/Client-1.8.9/src/main/java/net/optifine/util/Json.java new file mode 100644 index 0000000..746ef97 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/Json.java @@ -0,0 +1,98 @@ +package net.optifine.util; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +public class Json +{ + public static float getFloat(JsonObject obj, String field, float def) + { + JsonElement jsonelement = obj.get(field); + return jsonelement == null ? def : jsonelement.getAsFloat(); + } + + public static boolean getBoolean(JsonObject obj, String field, boolean def) + { + JsonElement jsonelement = obj.get(field); + return jsonelement == null ? def : jsonelement.getAsBoolean(); + } + + public static String getString(JsonObject jsonObj, String field) + { + return getString(jsonObj, field, (String)null); + } + + public static String getString(JsonObject jsonObj, String field, String def) + { + JsonElement jsonelement = jsonObj.get(field); + return jsonelement == null ? def : jsonelement.getAsString(); + } + + public static float[] parseFloatArray(JsonElement jsonElement, int len) + { + return parseFloatArray(jsonElement, len, (float[])null); + } + + public static float[] parseFloatArray(JsonElement jsonElement, int len, float[] def) + { + if (jsonElement == null) + { + return def; + } + else + { + JsonArray jsonarray = jsonElement.getAsJsonArray(); + + if (jsonarray.size() != len) + { + throw new JsonParseException("Wrong array length: " + jsonarray.size() + ", should be: " + len + ", array: " + jsonarray); + } + else + { + float[] afloat = new float[jsonarray.size()]; + + for (int i = 0; i < afloat.length; ++i) + { + afloat[i] = jsonarray.get(i).getAsFloat(); + } + + return afloat; + } + } + } + + public static int[] parseIntArray(JsonElement jsonElement, int len) + { + return parseIntArray(jsonElement, len, (int[])null); + } + + public static int[] parseIntArray(JsonElement jsonElement, int len, int[] def) + { + if (jsonElement == null) + { + return def; + } + else + { + JsonArray jsonarray = jsonElement.getAsJsonArray(); + + if (jsonarray.size() != len) + { + throw new JsonParseException("Wrong array length: " + jsonarray.size() + ", should be: " + len + ", array: " + jsonarray); + } + else + { + int[] aint = new int[jsonarray.size()]; + + for (int i = 0; i < aint.length; ++i) + { + aint[i] = jsonarray.get(i).getAsInt(); + } + + return aint; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/KeyUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/KeyUtils.java new file mode 100644 index 0000000..b51c79c --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/KeyUtils.java @@ -0,0 +1,33 @@ +package net.optifine.util; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import net.minecraft.client.settings.KeyBinding; + +public class KeyUtils +{ + public static void fixKeyConflicts(KeyBinding[] keys, KeyBinding[] keysPrio) + { + Set set = new HashSet(); + + for (int i = 0; i < keysPrio.length; ++i) + { + KeyBinding keybinding = keysPrio[i]; + set.add(Integer.valueOf(keybinding.getKeyCode())); + } + + Set set1 = new HashSet(Arrays.asList(keys)); + set1.removeAll(Arrays.asList(keysPrio)); + + for (KeyBinding keybinding1 : set1) + { + Integer integer = Integer.valueOf(keybinding1.getKeyCode()); + + if (set.contains(integer)) + { + keybinding1.setKeyCode(0); + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/LinkedList.java b/Client-1.8.9/src/main/java/net/optifine/util/LinkedList.java new file mode 100644 index 0000000..f3963e4 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/LinkedList.java @@ -0,0 +1,224 @@ +package net.optifine.util; + +import java.util.Iterator; + +public class LinkedList { + + private LinkedList.Node first; + private LinkedList.Node last; + private int size; + + public void addFirst(LinkedList.Node tNode) { + this.checkNoParent(tNode); + + if (this.isEmpty()) { + this.first = tNode; + this.last = tNode; + } else { + LinkedList.Node node = this.first; + tNode.setNext(node); + node.setPrev(tNode); + this.first = tNode; + } + + tNode.setParent(this); + ++this.size; + } + + public void addLast(LinkedList.Node tNode) { + this.checkNoParent(tNode); + + if (this.isEmpty()) { + this.first = tNode; + this.last = tNode; + } else { + LinkedList.Node node = this.last; + tNode.setPrev(node); + node.setNext(tNode); + this.last = tNode; + } + + tNode.setParent(this); + ++this.size; + } + + public void addAfter(LinkedList.Node nodePrev, LinkedList.Node tNode) { + if (nodePrev == null) { + this.addFirst(tNode); + } else if (nodePrev == this.last) { + this.addLast(tNode); + } else { + this.checkParent(nodePrev); + this.checkNoParent(tNode); + LinkedList.Node nodeNext = nodePrev.getNext(); + nodePrev.setNext(tNode); + tNode.setPrev(nodePrev); + nodeNext.setPrev(tNode); + tNode.setNext(nodeNext); + tNode.setParent(this); + ++this.size; + } + } + + public LinkedList.Node remove(LinkedList.Node tNode) { + this.checkParent(tNode); + LinkedList.Node prev = tNode.getPrev(); + LinkedList.Node next = tNode.getNext(); + + if (prev != null) { + prev.setNext(next); + } else { + this.first = next; + } + + if (next != null) { + next.setPrev(prev); + } else { + this.last = prev; + } + + tNode.setPrev(null); + tNode.setNext(null); + tNode.setParent(null); + --this.size; + return tNode; + } + + public void moveAfter(LinkedList.Node nodePrev, LinkedList.Node node) { + this.remove(node); + this.addAfter(nodePrev, node); + } + + public boolean find(LinkedList.Node nodeFind, LinkedList.Node nodeFrom, LinkedList.Node nodeTo) { + this.checkParent(nodeFrom); + + if (nodeTo != null) { + this.checkParent(nodeTo); + } + + LinkedList.Node node; + + for (node = nodeFrom; node != null && node != nodeTo; node = node.getNext()) { + if (node == nodeFind) { + return true; + } + } + + if (node != nodeTo) { + throw new IllegalArgumentException("Sublist is not linked, from: " + nodeFrom + ", to: " + nodeTo); + } else { + return false; + } + } + + private void checkParent(LinkedList.Node node) { + if (node.parent != this) { + throw new IllegalArgumentException("Node has different parent, node: " + node + ", parent: " + node.parent + ", this: " + this); + } + } + + private void checkNoParent(LinkedList.Node node) { + if (node.parent != null) { + throw new IllegalArgumentException("Node has different parent, node: " + node + ", parent: " + node.parent + ", this: " + this); + } + } + + public boolean contains(LinkedList.Node node) { + return node.parent == this; + } + + public Iterator> iterator() { + Iterator> iterator = new Iterator>() { + LinkedList.Node node = LinkedList.this.getFirst(); + + public boolean hasNext() { + return this.node != null; + } + + public LinkedList.Node next() { + LinkedList.Node node = this.node; + + if (this.node != null) { + this.node = this.node.next; + } + + return node; + } + + public void remove() { + throw new UnsupportedOperationException("remove"); + } + }; + return iterator; + } + + public LinkedList.Node getFirst() { + return this.first; + } + + public LinkedList.Node getLast() { + return this.last; + } + + public int getSize() { + return this.size; + } + + public boolean isEmpty() { + return this.size <= 0; + } + + public String toString() { + StringBuffer stringbuffer = new StringBuffer(); + + for (Iterator> it = iterator(); it.hasNext(); ) { + Node node = it.next(); + if (stringbuffer.length() > 0) { + stringbuffer.append(", "); + } + stringbuffer.append(node.getItem()); + } + + return "" + this.size + " [" + stringbuffer.toString() + "]"; + } + + public static class Node { + + private final T item; + private LinkedList.Node prev; + private LinkedList.Node next; + private LinkedList parent; + + public Node(T item) { + this.item = item; + } + + public T getItem() { + return this.item; + } + + public LinkedList.Node getPrev() { + return this.prev; + } + + public LinkedList.Node getNext() { + return this.next; + } + + private void setPrev(LinkedList.Node prev) { + this.prev = prev; + } + + private void setNext(LinkedList.Node next) { + this.next = next; + } + + private void setParent(LinkedList parent) { + this.parent = parent; + } + + public String toString() { + return "" + this.item; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/LinkedListTest.java b/Client-1.8.9/src/main/java/net/optifine/util/LinkedListTest.java new file mode 100644 index 0000000..58938f7 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/LinkedListTest.java @@ -0,0 +1,149 @@ +package net.optifine.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.optifine.render.VboRange; + +public class LinkedListTest +{ + public static void main(String[] args) throws Exception + { + LinkedList linkedlist = new LinkedList(); + List list = new ArrayList(); + List list1 = new ArrayList(); + Random random = new Random(); + int i = 100; + + for (int j = 0; j < i; ++j) + { + VboRange vborange = new VboRange(); + vborange.setPosition(j); + list.add(vborange); + } + + for (int k = 0; k < 100000; ++k) + { + checkLists(list, list1, i); + checkLinkedList(linkedlist, list1.size()); + + if (k % 5 == 0) + { + dbgLinkedList(linkedlist); + } + + if (random.nextBoolean()) + { + if (!list.isEmpty()) + { + VboRange vborange3 = (VboRange)list.get(random.nextInt(list.size())); + LinkedList.Node node2 = vborange3.getNode(); + + if (random.nextBoolean()) + { + linkedlist.addFirst(node2); + dbg("Add first: " + vborange3.getPosition()); + } + else if (random.nextBoolean()) + { + linkedlist.addLast(node2); + dbg("Add last: " + vborange3.getPosition()); + } + else + { + if (list1.isEmpty()) + { + continue; + } + + VboRange vborange1 = (VboRange)list1.get(random.nextInt(list1.size())); + LinkedList.Node node1 = vborange1.getNode(); + linkedlist.addAfter(node1, node2); + dbg("Add after: " + vborange1.getPosition() + ", " + vborange3.getPosition()); + } + + list.remove(vborange3); + list1.add(vborange3); + } + } + else if (!list1.isEmpty()) + { + VboRange vborange2 = (VboRange)list1.get(random.nextInt(list1.size())); + LinkedList.Node node = vborange2.getNode(); + linkedlist.remove(node); + dbg("Remove: " + vborange2.getPosition()); + list1.remove(vborange2); + list.add(vborange2); + } + } + } + + private static void dbgLinkedList(LinkedList linkedList) + { + StringBuffer stringbuffer = new StringBuffer(); + + linkedList.iterator().forEachRemaining(vboRangeNode -> { + VboRange vborange = vboRangeNode.getItem(); + + if (stringbuffer.length() > 0) + { + stringbuffer.append(", "); + } + + stringbuffer.append(vborange.getPosition()); + }); + + dbg("List: " + stringbuffer); + } + + private static void checkLinkedList(LinkedList linkedList, int used) + { + if (linkedList.getSize() != used) + { + throw new RuntimeException("Wrong size, linked: " + linkedList.getSize() + ", used: " + used); + } + else + { + int i = 0; + + for (LinkedList.Node node = linkedList.getFirst(); node != null; node = node.getNext()) + { + ++i; + } + + if (linkedList.getSize() != i) + { + throw new RuntimeException("Wrong count, linked: " + linkedList.getSize() + ", count: " + i); + } + else + { + int j = 0; + + for (LinkedList.Node node1 = linkedList.getLast(); node1 != null; node1 = node1.getPrev()) + { + ++j; + } + + if (linkedList.getSize() != j) + { + throw new RuntimeException("Wrong count back, linked: " + linkedList.getSize() + ", count: " + j); + } + } + } + } + + private static void checkLists(List listFree, List listUsed, int count) + { + int i = listFree.size() + listUsed.size(); + + if (i != count) + { + throw new RuntimeException("Total size: " + i); + } + } + + private static void dbg(String str) + { + System.out.println(str); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/LockCounter.java b/Client-1.8.9/src/main/java/net/optifine/util/LockCounter.java new file mode 100644 index 0000000..84512b5 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/LockCounter.java @@ -0,0 +1,40 @@ +package net.optifine.util; + +public class LockCounter +{ + private int lockCount; + + public boolean lock() + { + ++this.lockCount; + return this.lockCount == 1; + } + + public boolean unlock() + { + if (this.lockCount <= 0) + { + return false; + } + else + { + --this.lockCount; + return this.lockCount == 0; + } + } + + public boolean isLocked() + { + return this.lockCount > 0; + } + + public int getLockCount() + { + return this.lockCount; + } + + public String toString() + { + return "lockCount: " + this.lockCount; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/LongSupplier.java b/Client-1.8.9/src/main/java/net/optifine/util/LongSupplier.java new file mode 100644 index 0000000..8390305 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/LongSupplier.java @@ -0,0 +1,6 @@ +package net.optifine.util; + +public interface LongSupplier +{ + long getAsLong(); +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/MathUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/MathUtils.java new file mode 100644 index 0000000..aad7ea9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/MathUtils.java @@ -0,0 +1,94 @@ +package net.optifine.util; + +import net.minecraft.util.MathHelper; + +public class MathUtils +{ + public static final float PI = (float)Math.PI; + public static final float PI2 = ((float)Math.PI * 2F); + public static final float PId2 = ((float)Math.PI / 2F); + private static final float[] ASIN_TABLE = new float[65536]; + + public static float asin(float value) + { + return ASIN_TABLE[(int)((double)(value + 1.0F) * 32767.5D) & 65535]; + } + + public static float acos(float value) + { + return ((float)Math.PI / 2F) - ASIN_TABLE[(int)((double)(value + 1.0F) * 32767.5D) & 65535]; + } + + public static int getAverage(int[] vals) + { + if (vals.length <= 0) + { + return 0; + } + else + { + int i = getSum(vals); + int j = i / vals.length; + return j; + } + } + + public static int getSum(int[] vals) + { + if (vals.length <= 0) + { + return 0; + } + else + { + int i = 0; + + for (int j = 0; j < vals.length; ++j) + { + int k = vals[j]; + i += k; + } + + return i; + } + } + + public static int roundDownToPowerOfTwo(int val) + { + int i = MathHelper.roundUpToPowerOfTwo(val); + return val == i ? i : i / 2; + } + + public static boolean equalsDelta(float f1, float f2, float delta) + { + return Math.abs(f1 - f2) <= delta; + } + + public static float toDeg(float angle) + { + return angle * 180.0F / MathHelper.PI; + } + + public static float toRad(float angle) + { + return angle / 180.0F * MathHelper.PI; + } + + public static float roundToFloat(double d) + { + return (float)((double)Math.round(d * 1.0E8D) / 1.0E8D); + } + + static + { + for (int i = 0; i < 65536; ++i) + { + ASIN_TABLE[i] = (float)Math.asin((double)i / 32767.5D - 1.0D); + } + + for (int j = -1; j < 2; ++j) + { + ASIN_TABLE[(int)(((double)j + 1.0D) * 32767.5D) & 65535] = (float)Math.asin((double)j); + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/MathUtilsTest.java b/Client-1.8.9/src/main/java/net/optifine/util/MathUtilsTest.java new file mode 100644 index 0000000..f619521 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/MathUtilsTest.java @@ -0,0 +1,93 @@ +package net.optifine.util; + +import net.minecraft.util.MathHelper; + +public class MathUtilsTest +{ + public static void main(String[] args) throws Exception + { + MathUtilsTest.OPER[] amathutilstest$oper = MathUtilsTest.OPER.values(); + + for (int i = 0; i < amathutilstest$oper.length; ++i) + { + MathUtilsTest.OPER mathutilstest$oper = amathutilstest$oper[i]; + dbg("******** " + mathutilstest$oper + " ***********"); + test(mathutilstest$oper, false); + } + } + + private static void test(MathUtilsTest.OPER oper, boolean fast) + { + MathHelper.fastMath = fast; + double d0; + double d1; + + switch (oper) + { + case SIN: + case COS: + d0 = (double)(-MathHelper.PI); + d1 = (double)MathHelper.PI; + break; + + case ASIN: + case ACOS: + d0 = -1.0D; + d1 = 1.0D; + break; + + default: + return; + } + + int i = 10; + + for (int j = 0; j <= i; ++j) + { + double d2 = d0 + (double)j * (d1 - d0) / (double)i; + float f; + float f1; + + switch (oper) + { + case SIN: + f = (float)Math.sin(d2); + f1 = MathHelper.sin((float)d2); + break; + + case COS: + f = (float)Math.cos(d2); + f1 = MathHelper.cos((float)d2); + break; + + case ASIN: + f = (float)Math.asin(d2); + f1 = MathUtils.asin((float)d2); + break; + + case ACOS: + f = (float)Math.acos(d2); + f1 = MathUtils.acos((float)d2); + break; + + default: + return; + } + + dbg(String.format("%.2f, Math: %f, Helper: %f, diff: %f", new Object[] {Double.valueOf(d2), Float.valueOf(f), Float.valueOf(f1), Float.valueOf(Math.abs(f - f1))})); + } + } + + public static void dbg(String str) + { + System.out.println(str); + } + + private static enum OPER + { + SIN, + COS, + ASIN, + ACOS; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/MemoryMonitor.java b/Client-1.8.9/src/main/java/net/optifine/util/MemoryMonitor.java new file mode 100644 index 0000000..ab1e76d --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/MemoryMonitor.java @@ -0,0 +1,64 @@ +package net.optifine.util; + +public class MemoryMonitor +{ + private static long startTimeMs = System.currentTimeMillis(); + private static long startMemory = getMemoryUsed(); + private static long lastTimeMs = startTimeMs; + private static long lastMemory = startMemory; + private static boolean gcEvent = false; + private static int memBytesSec = 0; + private static long MB = 1048576L; + + public static void update() + { + long i = System.currentTimeMillis(); + long j = getMemoryUsed(); + gcEvent = j < lastMemory; + + if (gcEvent) + { + long k = lastTimeMs - startTimeMs; + long l = lastMemory - startMemory; + double d0 = (double)k / 1000.0D; + int i1 = (int)((double)l / d0); + + if (i1 > 0) + { + memBytesSec = i1; + } + + startTimeMs = i; + startMemory = j; + } + + lastTimeMs = i; + lastMemory = j; + } + + private static long getMemoryUsed() + { + Runtime runtime = Runtime.getRuntime(); + return runtime.totalMemory() - runtime.freeMemory(); + } + + public static long getStartTimeMs() + { + return startTimeMs; + } + + public static long getStartMemoryMb() + { + return startMemory / MB; + } + + public static boolean isGcEvent() + { + return gcEvent; + } + + public static long getAllocationRateMb() + { + return (long)memBytesSec / MB; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/NativeMemory.java b/Client-1.8.9/src/main/java/net/optifine/util/NativeMemory.java new file mode 100644 index 0000000..a1ad9f2 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/NativeMemory.java @@ -0,0 +1,100 @@ +package net.optifine.util; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.src.Config; + +public class NativeMemory +{ + private static LongSupplier bufferAllocatedSupplier = makeLongSupplier(new String[][] {{"sun.misc.SharedSecrets", "getJavaNioAccess", "getDirectBufferPool", "getMemoryUsed"}, {"jdk.internal.misc.SharedSecrets", "getJavaNioAccess", "getDirectBufferPool", "getMemoryUsed"}}); + private static LongSupplier bufferMaximumSupplier = makeLongSupplier(new String[][] {{"sun.misc.VM", "maxDirectMemory"}, {"jdk.internal.misc.VM", "maxDirectMemory"}}); + + public static long getBufferAllocated() + { + return bufferAllocatedSupplier == null ? -1L : bufferAllocatedSupplier.getAsLong(); + } + + public static long getBufferMaximum() + { + return bufferMaximumSupplier == null ? -1L : bufferMaximumSupplier.getAsLong(); + } + + private static LongSupplier makeLongSupplier(String[][] paths) + { + List list = new ArrayList(); + + for (int i = 0; i < paths.length; ++i) + { + String[] astring = paths[i]; + + try + { + LongSupplier longsupplier = makeLongSupplier(astring); + return longsupplier; + } + catch (Throwable throwable) + { + list.add(throwable); + } + } + + for (Throwable throwable1 : list) + { + Config.warn("" + throwable1.getClass().getName() + ": " + throwable1.getMessage()); + } + + return null; + } + + private static LongSupplier makeLongSupplier(String[] path) throws Exception + { + if (path.length < 2) + { + return null; + } + else + { + Class oclass = Class.forName(path[0]); + Method method = oclass.getMethod(path[1]); + method.setAccessible(true); + Object object = null; + + for (int i = 2; i < path.length; ++i) + { + String s = path[i]; + object = method.invoke(object); + method = object.getClass().getMethod(s); + method.setAccessible(true); + } + + final Method method1 = method; + final Object o= object; + LongSupplier longsupplier = new LongSupplier() + { + private boolean disabled = false; + public long getAsLong() + { + if (this.disabled) + { + return -1L; + } + else + { + try + { + return (long) method1.invoke(o); + } + catch (Throwable throwable) + { + Config.warn("" + throwable.getClass().getName() + ": " + throwable.getMessage()); + this.disabled = true; + return -1L; + } + } + } + }; + return longsupplier; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/NumUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/NumUtils.java new file mode 100644 index 0000000..11e3b2e --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/NumUtils.java @@ -0,0 +1,21 @@ +package net.optifine.util; + +public class NumUtils +{ + public static float limit(float val, float min, float max) + { + return val < min ? min : (val > max ? max : val); + } + + public static int mod(int x, int y) + { + int i = x % y; + + if (i < 0) + { + i += y; + } + + return i; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/PropertiesOrdered.java b/Client-1.8.9/src/main/java/net/optifine/util/PropertiesOrdered.java new file mode 100644 index 0000000..c5a887f --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/PropertiesOrdered.java @@ -0,0 +1,30 @@ +package net.optifine.util; + +import java.util.Collections; +import java.util.Enumeration; +import java.util.LinkedHashSet; +import java.util.Properties; +import java.util.Set; + +public class PropertiesOrdered extends Properties +{ + private Set keysOrdered = new LinkedHashSet(); + + public synchronized Object put(Object key, Object value) + { + this.keysOrdered.add(key); + return super.put(key, value); + } + + public Set keySet() + { + Set set = super.keySet(); + this.keysOrdered.retainAll(set); + return Collections.unmodifiableSet(this.keysOrdered); + } + + public synchronized Enumeration keys() + { + return Collections.enumeration(this.keySet()); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/RenderChunkUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/RenderChunkUtils.java new file mode 100644 index 0000000..1bce179 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/RenderChunkUtils.java @@ -0,0 +1,40 @@ +package net.optifine.util; + +import net.minecraft.client.renderer.chunk.RenderChunk; +import net.minecraft.util.MathHelper; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +public class RenderChunkUtils +{ + public static int getCountBlocks(RenderChunk renderChunk) + { + ExtendedBlockStorage[] aextendedblockstorage = renderChunk.getChunk().getBlockStorageArray(); + + if (aextendedblockstorage == null) + { + return 0; + } + else + { + int i = renderChunk.getPosition().getY() >> 4; + ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[i]; + return extendedblockstorage == null ? 0 : extendedblockstorage.getBlockRefCount(); + } + } + + public static double getRelativeBufferSize(RenderChunk renderChunk) + { + int i = getCountBlocks(renderChunk); + double d0 = getRelativeBufferSize(i); + return d0; + } + + public static double getRelativeBufferSize(int blockCount) + { + double d0 = (double)blockCount / 4096.0D; + d0 = d0 * 0.995D; + double d1 = d0 * 2.0D - 1.0D; + d1 = MathHelper.clamp_double(d1, -1.0D, 1.0D); + return (double)MathHelper.sqrt_double(1.0D - d1 * d1); + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/ResUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/ResUtils.java new file mode 100644 index 0000000..4529b90 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/ResUtils.java @@ -0,0 +1,265 @@ +package net.optifine.util; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Properties; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import net.minecraft.client.resources.AbstractResourcePack; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class ResUtils +{ + public static String[] collectFiles(String prefix, String suffix) + { + return collectFiles(new String[] {prefix}, new String[] {suffix}); + } + + public static String[] collectFiles(String[] prefixes, String[] suffixes) + { + Set set = new LinkedHashSet(); + IResourcePack[] airesourcepack = Config.getResourcePacks(); + + for (int i = 0; i < airesourcepack.length; ++i) + { + IResourcePack iresourcepack = airesourcepack[i]; + String[] astring = collectFiles(iresourcepack, (String[])prefixes, (String[])suffixes, (String[])null); + set.addAll(Arrays.asList(astring)); + } + + String[] astring1 = (String[])set.toArray(new String[set.size()]); + return astring1; + } + + public static String[] collectFiles(IResourcePack rp, String prefix, String suffix, String[] defaultPaths) + { + return collectFiles(rp, new String[] {prefix}, new String[] {suffix}, defaultPaths); + } + + public static String[] collectFiles(IResourcePack rp, String[] prefixes, String[] suffixes) + { + return collectFiles(rp, (String[])prefixes, (String[])suffixes, (String[])null); + } + + public static String[] collectFiles(IResourcePack rp, String[] prefixes, String[] suffixes, String[] defaultPaths) + { + if (rp instanceof DefaultResourcePack) + { + return collectFilesFixed(rp, defaultPaths); + } + else if (!(rp instanceof AbstractResourcePack)) + { + Config.warn("Unknown resource pack type: " + rp); + return new String[0]; + } + else + { + AbstractResourcePack abstractresourcepack = (AbstractResourcePack)rp; + File file1 = abstractresourcepack.resourcePackFile; + + if (file1 == null) + { + return new String[0]; + } + else if (file1.isDirectory()) + { + return collectFilesFolder(file1, "", prefixes, suffixes); + } + else if (file1.isFile()) + { + return collectFilesZIP(file1, prefixes, suffixes); + } + else + { + Config.warn("Unknown resource pack file: " + file1); + return new String[0]; + } + } + } + + private static String[] collectFilesFixed(IResourcePack rp, String[] paths) + { + if (paths == null) + { + return new String[0]; + } + else + { + List list = new ArrayList(); + + for (int i = 0; i < paths.length; ++i) + { + String s = paths[i]; + ResourceLocation resourcelocation = new ResourceLocation(s); + + if (rp.resourceExists(resourcelocation)) + { + list.add(s); + } + } + + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } + } + + private static String[] collectFilesFolder(File tpFile, String basePath, String[] prefixes, String[] suffixes) + { + List list = new ArrayList(); + String s = "assets/minecraft/"; + File[] afile = tpFile.listFiles(); + + if (afile == null) + { + return new String[0]; + } + else + { + for (int i = 0; i < afile.length; ++i) + { + File file1 = afile[i]; + + if (file1.isFile()) + { + String s3 = basePath + file1.getName(); + + if (s3.startsWith(s)) + { + s3 = s3.substring(s.length()); + + if (StrUtils.startsWith(s3, prefixes) && StrUtils.endsWith(s3, suffixes)) + { + list.add(s3); + } + } + } + else if (file1.isDirectory()) + { + String s1 = basePath + file1.getName() + "/"; + String[] astring = collectFilesFolder(file1, s1, prefixes, suffixes); + + for (int j = 0; j < astring.length; ++j) + { + String s2 = astring[j]; + list.add(s2); + } + } + } + + String[] astring1 = (String[])((String[])list.toArray(new String[list.size()])); + return astring1; + } + } + + private static String[] collectFilesZIP(File tpFile, String[] prefixes, String[] suffixes) + { + List list = new ArrayList(); + String s = "assets/minecraft/"; + + try + { + ZipFile zipfile = new ZipFile(tpFile); + Enumeration enumeration = zipfile.entries(); + + while (enumeration.hasMoreElements()) + { + ZipEntry zipentry = (ZipEntry)enumeration.nextElement(); + String s1 = zipentry.getName(); + + if (s1.startsWith(s)) + { + s1 = s1.substring(s.length()); + + if (StrUtils.startsWith(s1, prefixes) && StrUtils.endsWith(s1, suffixes)) + { + list.add(s1); + } + } + } + + zipfile.close(); + String[] astring = (String[])((String[])list.toArray(new String[list.size()])); + return astring; + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + return new String[0]; + } + } + + private static boolean isLowercase(String str) + { + return str.equals(str.toLowerCase(Locale.ROOT)); + } + + public static Properties readProperties(String path, String module) + { + ResourceLocation resourcelocation = new ResourceLocation(path); + + try + { + InputStream inputstream = Config.getResourceStream(resourcelocation); + + if (inputstream == null) + { + return null; + } + else + { + Properties properties = new PropertiesOrdered(); + properties.load(inputstream); + inputstream.close(); + Config.dbg("" + module + ": Loading " + path); + return properties; + } + } + catch (FileNotFoundException var5) + { + return null; + } + catch (IOException var6) + { + Config.warn("" + module + ": Error reading " + path); + return null; + } + } + + public static Properties readProperties(InputStream in, String module) + { + if (in == null) + { + return null; + } + else + { + try + { + Properties properties = new PropertiesOrdered(); + properties.load(in); + in.close(); + return properties; + } + catch (FileNotFoundException var3) + { + return null; + } + catch (IOException var4) + { + return null; + } + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/SmoothFloat.java b/Client-1.8.9/src/main/java/net/optifine/util/SmoothFloat.java new file mode 100644 index 0000000..96f944b --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/SmoothFloat.java @@ -0,0 +1,93 @@ +package net.optifine.util; + +public class SmoothFloat +{ + private float valueLast; + private float timeFadeUpSec; + private float timeFadeDownSec; + private long timeLastMs; + + public SmoothFloat(float valueLast, float timeFadeSec) + { + this(valueLast, timeFadeSec, timeFadeSec); + } + + public SmoothFloat(float valueLast, float timeFadeUpSec, float timeFadeDownSec) + { + this.valueLast = valueLast; + this.timeFadeUpSec = timeFadeUpSec; + this.timeFadeDownSec = timeFadeDownSec; + this.timeLastMs = System.currentTimeMillis(); + } + + public float getValueLast() + { + return this.valueLast; + } + + public float getTimeFadeUpSec() + { + return this.timeFadeUpSec; + } + + public float getTimeFadeDownSec() + { + return this.timeFadeDownSec; + } + + public long getTimeLastMs() + { + return this.timeLastMs; + } + + public float getSmoothValue(float value, float timeFadeUpSec, float timeFadeDownSec) + { + this.timeFadeUpSec = timeFadeUpSec; + this.timeFadeDownSec = timeFadeDownSec; + return this.getSmoothValue(value); + } + + public float getSmoothValue(float value) + { + long i = System.currentTimeMillis(); + float f = this.valueLast; + long j = this.timeLastMs; + float f1 = (float)(i - j) / 1000.0F; + float f2 = value >= f ? this.timeFadeUpSec : this.timeFadeDownSec; + float f3 = getSmoothValue(f, value, f1, f2); + this.valueLast = f3; + this.timeLastMs = i; + return f3; + } + + public static float getSmoothValue(float valPrev, float value, float timeDeltaSec, float timeFadeSec) + { + if (timeDeltaSec <= 0.0F) + { + return valPrev; + } + else + { + float f = value - valPrev; + float f1; + + if (timeFadeSec > 0.0F && timeDeltaSec < timeFadeSec && Math.abs(f) > 1.0E-6F) + { + float f2 = timeFadeSec / timeDeltaSec; + float f3 = 4.61F; + float f4 = 0.13F; + float f5 = 10.0F; + float f6 = f3 - 1.0F / (f4 + f2 / f5); + float f7 = timeDeltaSec / timeFadeSec * f6; + f7 = NumUtils.limit(f7, 0.0F, 1.0F); + f1 = valPrev + f * f7; + } + else + { + f1 = value; + } + + return f1; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/StrUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/StrUtils.java new file mode 100644 index 0000000..1fcbdd9 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/StrUtils.java @@ -0,0 +1,827 @@ +package net.optifine.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +public class StrUtils +{ + public static boolean equalsMask(String str, String mask, char wildChar, char wildCharSingle) + { + if (mask != null && str != null) + { + if (mask.indexOf(wildChar) < 0) + { + return mask.indexOf(wildCharSingle) < 0 ? mask.equals(str) : equalsMaskSingle(str, mask, wildCharSingle); + } + else + { + List list = new ArrayList(); + String s = "" + wildChar; + + if (mask.startsWith(s)) + { + list.add(""); + } + + StringTokenizer stringtokenizer = new StringTokenizer(mask, s); + + while (stringtokenizer.hasMoreElements()) + { + list.add(stringtokenizer.nextToken()); + } + + if (mask.endsWith(s)) + { + list.add(""); + } + + String s1 = (String)list.get(0); + + if (!startsWithMaskSingle(str, s1, wildCharSingle)) + { + return false; + } + else + { + String s2 = (String)list.get(list.size() - 1); + + if (!endsWithMaskSingle(str, s2, wildCharSingle)) + { + return false; + } + else + { + int i = 0; + + for (int j = 0; j < ((List)list).size(); ++j) + { + String s3 = (String)list.get(j); + + if (s3.length() > 0) + { + int k = indexOfMaskSingle(str, s3, i, wildCharSingle); + + if (k < 0) + { + return false; + } + + i = k + s3.length(); + } + } + + return true; + } + } + } + } + else + { + return mask == str; + } + } + + private static boolean equalsMaskSingle(String str, String mask, char wildCharSingle) + { + if (str != null && mask != null) + { + if (str.length() != mask.length()) + { + return false; + } + else + { + for (int i = 0; i < mask.length(); ++i) + { + char c0 = mask.charAt(i); + + if (c0 != wildCharSingle && str.charAt(i) != c0) + { + return false; + } + } + + return true; + } + } + else + { + return str == mask; + } + } + + private static int indexOfMaskSingle(String str, String mask, int startPos, char wildCharSingle) + { + if (str != null && mask != null) + { + if (startPos >= 0 && startPos <= str.length()) + { + if (str.length() < startPos + mask.length()) + { + return -1; + } + else + { + for (int i = startPos; i + mask.length() <= str.length(); ++i) + { + String s = str.substring(i, i + mask.length()); + + if (equalsMaskSingle(s, mask, wildCharSingle)) + { + return i; + } + } + + return -1; + } + } + else + { + return -1; + } + } + else + { + return -1; + } + } + + private static boolean endsWithMaskSingle(String str, String mask, char wildCharSingle) + { + if (str != null && mask != null) + { + if (str.length() < mask.length()) + { + return false; + } + else + { + String s = str.substring(str.length() - mask.length(), str.length()); + return equalsMaskSingle(s, mask, wildCharSingle); + } + } + else + { + return str == mask; + } + } + + private static boolean startsWithMaskSingle(String str, String mask, char wildCharSingle) + { + if (str != null && mask != null) + { + if (str.length() < mask.length()) + { + return false; + } + else + { + String s = str.substring(0, mask.length()); + return equalsMaskSingle(s, mask, wildCharSingle); + } + } + else + { + return str == mask; + } + } + + public static boolean equalsMask(String str, String[] masks, char wildChar) + { + for (int i = 0; i < masks.length; ++i) + { + String s = masks[i]; + + if (equalsMask(str, s, wildChar)) + { + return true; + } + } + + return false; + } + + public static boolean equalsMask(String str, String mask, char wildChar) + { + if (mask != null && str != null) + { + if (mask.indexOf(wildChar) < 0) + { + return mask.equals(str); + } + else + { + List list = new ArrayList(); + String s = "" + wildChar; + + if (mask.startsWith(s)) + { + list.add(""); + } + + StringTokenizer stringtokenizer = new StringTokenizer(mask, s); + + while (stringtokenizer.hasMoreElements()) + { + list.add(stringtokenizer.nextToken()); + } + + if (mask.endsWith(s)) + { + list.add(""); + } + + String s1 = (String)list.get(0); + + if (!str.startsWith(s1)) + { + return false; + } + else + { + String s2 = (String)list.get(list.size() - 1); + + if (!str.endsWith(s2)) + { + return false; + } + else + { + int i = 0; + + for (int j = 0; j < ((List)list).size(); ++j) + { + String s3 = (String)list.get(j); + + if (s3.length() > 0) + { + int k = str.indexOf(s3, i); + + if (k < 0) + { + return false; + } + + i = k + s3.length(); + } + } + + return true; + } + } + } + } + else + { + return mask == str; + } + } + + public static String[] split(String str, String separators) + { + if (str != null && str.length() > 0) + { + if (separators == null) + { + return new String[] {str}; + } + else + { + List list = new ArrayList(); + int i = 0; + + for (int j = 0; j < str.length(); ++j) + { + char c0 = str.charAt(j); + + if (equals(c0, separators)) + { + list.add(str.substring(i, j)); + i = j + 1; + } + } + + list.add(str.substring(i, str.length())); + return (String[])((String[])list.toArray(new String[list.size()])); + } + } + else + { + return new String[0]; + } + } + + private static boolean equals(char ch, String matches) + { + for (int i = 0; i < matches.length(); ++i) + { + if (matches.charAt(i) == ch) + { + return true; + } + } + + return false; + } + + public static boolean equalsTrim(String a, String b) + { + if (a != null) + { + a = a.trim(); + } + + if (b != null) + { + b = b.trim(); + } + + return equals(a, b); + } + + public static boolean isEmpty(String string) + { + return string == null ? true : string.trim().length() <= 0; + } + + public static String stringInc(String str) + { + int i = parseInt(str, -1); + + if (i == -1) + { + return ""; + } + else + { + ++i; + String s = "" + i; + return s.length() > str.length() ? "" : fillLeft("" + i, str.length(), '0'); + } + } + + public static int parseInt(String s, int defVal) + { + if (s == null) + { + return defVal; + } + else + { + try + { + return Integer.parseInt(s); + } + catch (NumberFormatException var3) + { + return defVal; + } + } + } + + public static boolean isFilled(String string) + { + return !isEmpty(string); + } + + public static String addIfNotContains(String target, String source) + { + for (int i = 0; i < source.length(); ++i) + { + if (target.indexOf(source.charAt(i)) < 0) + { + target = target + source.charAt(i); + } + } + + return target; + } + + public static String fillLeft(String s, int len, char fillChar) + { + if (s == null) + { + s = ""; + } + + if (s.length() >= len) + { + return s; + } + else + { + StringBuffer stringbuffer = new StringBuffer(); + int i = len - s.length(); + + while (stringbuffer.length() < i) + { + stringbuffer.append(fillChar); + } + + return stringbuffer.toString() + s; + } + } + + public static String fillRight(String s, int len, char fillChar) + { + if (s == null) + { + s = ""; + } + + if (s.length() >= len) + { + return s; + } + else + { + StringBuffer stringbuffer = new StringBuffer(s); + + while (stringbuffer.length() < len) + { + stringbuffer.append(fillChar); + } + + return stringbuffer.toString(); + } + } + + public static boolean equals(Object a, Object b) + { + return a == b ? true : (a != null && a.equals(b) ? true : b != null && b.equals(a)); + } + + public static boolean startsWith(String str, String[] prefixes) + { + if (str == null) + { + return false; + } + else if (prefixes == null) + { + return false; + } + else + { + for (int i = 0; i < prefixes.length; ++i) + { + String s = prefixes[i]; + + if (str.startsWith(s)) + { + return true; + } + } + + return false; + } + } + + public static boolean endsWith(String str, String[] suffixes) + { + if (str == null) + { + return false; + } + else if (suffixes == null) + { + return false; + } + else + { + for (int i = 0; i < suffixes.length; ++i) + { + String s = suffixes[i]; + + if (str.endsWith(s)) + { + return true; + } + } + + return false; + } + } + + public static String removePrefix(String str, String prefix) + { + if (str != null && prefix != null) + { + if (str.startsWith(prefix)) + { + str = str.substring(prefix.length()); + } + + return str; + } + else + { + return str; + } + } + + public static String removeSuffix(String str, String suffix) + { + if (str != null && suffix != null) + { + if (str.endsWith(suffix)) + { + str = str.substring(0, str.length() - suffix.length()); + } + + return str; + } + else + { + return str; + } + } + + public static String replaceSuffix(String str, String suffix, String suffixNew) + { + if (str != null && suffix != null) + { + if (!str.endsWith(suffix)) + { + return str; + } + else + { + if (suffixNew == null) + { + suffixNew = ""; + } + + str = str.substring(0, str.length() - suffix.length()); + return str + suffixNew; + } + } + else + { + return str; + } + } + + public static String replacePrefix(String str, String prefix, String prefixNew) + { + if (str != null && prefix != null) + { + if (!str.startsWith(prefix)) + { + return str; + } + else + { + if (prefixNew == null) + { + prefixNew = ""; + } + + str = str.substring(prefix.length()); + return prefixNew + str; + } + } + else + { + return str; + } + } + + public static int findPrefix(String[] strs, String prefix) + { + if (strs != null && prefix != null) + { + for (int i = 0; i < strs.length; ++i) + { + String s = strs[i]; + + if (s.startsWith(prefix)) + { + return i; + } + } + + return -1; + } + else + { + return -1; + } + } + + public static int findSuffix(String[] strs, String suffix) + { + if (strs != null && suffix != null) + { + for (int i = 0; i < strs.length; ++i) + { + String s = strs[i]; + + if (s.endsWith(suffix)) + { + return i; + } + } + + return -1; + } + else + { + return -1; + } + } + + public static String[] remove(String[] strs, int start, int end) + { + if (strs == null) + { + return strs; + } + else if (end > 0 && start < strs.length) + { + if (start >= end) + { + return strs; + } + else + { + List list = new ArrayList(strs.length); + + for (int i = 0; i < strs.length; ++i) + { + String s = strs[i]; + + if (i < start || i >= end) + { + list.add(s); + } + } + + String[] astring = (String[])list.toArray(new String[list.size()]); + return astring; + } + } + else + { + return strs; + } + } + + public static String removeSuffix(String str, String[] suffixes) + { + if (str != null && suffixes != null) + { + int i = str.length(); + + for (int j = 0; j < suffixes.length; ++j) + { + String s = suffixes[j]; + str = removeSuffix(str, s); + + if (str.length() != i) + { + break; + } + } + + return str; + } + else + { + return str; + } + } + + public static String removePrefix(String str, String[] prefixes) + { + if (str != null && prefixes != null) + { + int i = str.length(); + + for (int j = 0; j < prefixes.length; ++j) + { + String s = prefixes[j]; + str = removePrefix(str, s); + + if (str.length() != i) + { + break; + } + } + + return str; + } + else + { + return str; + } + } + + public static String removePrefixSuffix(String str, String[] prefixes, String[] suffixes) + { + str = removePrefix(str, prefixes); + str = removeSuffix(str, suffixes); + return str; + } + + public static String removePrefixSuffix(String str, String prefix, String suffix) + { + return removePrefixSuffix(str, new String[] {prefix}, new String[] {suffix}); + } + + public static String getSegment(String str, String start, String end) + { + if (str != null && start != null && end != null) + { + int i = str.indexOf(start); + + if (i < 0) + { + return null; + } + else + { + int j = str.indexOf(end, i); + return j < 0 ? null : str.substring(i, j + end.length()); + } + } + else + { + return null; + } + } + + public static String addSuffixCheck(String str, String suffix) + { + return str != null && suffix != null ? (str.endsWith(suffix) ? str : str + suffix) : str; + } + + public static String addPrefixCheck(String str, String prefix) + { + return str != null && prefix != null ? (str.endsWith(prefix) ? str : prefix + str) : str; + } + + public static String trim(String str, String chars) + { + if (str != null && chars != null) + { + str = trimLeading(str, chars); + str = trimTrailing(str, chars); + return str; + } + else + { + return str; + } + } + + public static String trimLeading(String str, String chars) + { + if (str != null && chars != null) + { + int i = str.length(); + + for (int j = 0; j < i; ++j) + { + char c0 = str.charAt(j); + + if (chars.indexOf(c0) < 0) + { + return str.substring(j); + } + } + + return ""; + } + else + { + return str; + } + } + + public static String trimTrailing(String str, String chars) + { + if (str != null && chars != null) + { + int i = str.length(); + int j; + + for (j = i; j > 0; --j) + { + char c0 = str.charAt(j - 1); + + if (chars.indexOf(c0) < 0) + { + break; + } + } + + return j == i ? str : str.substring(0, j); + } + else + { + return str; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/TextureUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/TextureUtils.java new file mode 100644 index 0000000..d9f1d66 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/TextureUtils.java @@ -0,0 +1,676 @@ +package net.optifine.util; + +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.layers.LayerMooshroomMushroom; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.ITickableTextureObject; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IReloadableResourceManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.optifine.BetterGrass; +import net.optifine.BetterSnow; +import net.optifine.CustomBlockLayers; +import net.optifine.CustomColors; +import net.optifine.CustomGuis; +import net.optifine.CustomItems; +import net.optifine.CustomLoadingScreens; +import net.optifine.CustomPanorama; +import net.optifine.CustomSky; +import net.optifine.Lang; +import net.optifine.NaturalTextures; +import net.optifine.RandomEntities; +import net.optifine.SmartLeaves; +import net.optifine.TextureAnimations; +import net.optifine.entity.model.CustomEntityModels; +import net.optifine.shaders.MultiTexID; +import net.optifine.shaders.Shaders; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.lwjgl.opengl.GLContext; + +public class TextureUtils +{ + public static final String texGrassTop = "grass_top"; + public static final String texStone = "stone"; + public static final String texDirt = "dirt"; + public static final String texCoarseDirt = "coarse_dirt"; + public static final String texGrassSide = "grass_side"; + public static final String texStoneslabSide = "stone_slab_side"; + public static final String texStoneslabTop = "stone_slab_top"; + public static final String texBedrock = "bedrock"; + public static final String texSand = "sand"; + public static final String texGravel = "gravel"; + public static final String texLogOak = "log_oak"; + public static final String texLogBigOak = "log_big_oak"; + public static final String texLogAcacia = "log_acacia"; + public static final String texLogSpruce = "log_spruce"; + public static final String texLogBirch = "log_birch"; + public static final String texLogJungle = "log_jungle"; + public static final String texLogOakTop = "log_oak_top"; + public static final String texLogBigOakTop = "log_big_oak_top"; + public static final String texLogAcaciaTop = "log_acacia_top"; + public static final String texLogSpruceTop = "log_spruce_top"; + public static final String texLogBirchTop = "log_birch_top"; + public static final String texLogJungleTop = "log_jungle_top"; + public static final String texLeavesOak = "leaves_oak"; + public static final String texLeavesBigOak = "leaves_big_oak"; + public static final String texLeavesAcacia = "leaves_acacia"; + public static final String texLeavesBirch = "leaves_birch"; + public static final String texLeavesSpuce = "leaves_spruce"; + public static final String texLeavesJungle = "leaves_jungle"; + public static final String texGoldOre = "gold_ore"; + public static final String texIronOre = "iron_ore"; + public static final String texCoalOre = "coal_ore"; + public static final String texObsidian = "obsidian"; + public static final String texGrassSideOverlay = "grass_side_overlay"; + public static final String texSnow = "snow"; + public static final String texGrassSideSnowed = "grass_side_snowed"; + public static final String texMyceliumSide = "mycelium_side"; + public static final String texMyceliumTop = "mycelium_top"; + public static final String texDiamondOre = "diamond_ore"; + public static final String texRedstoneOre = "redstone_ore"; + public static final String texLapisOre = "lapis_ore"; + public static final String texCactusSide = "cactus_side"; + public static final String texClay = "clay"; + public static final String texFarmlandWet = "farmland_wet"; + public static final String texFarmlandDry = "farmland_dry"; + public static final String texNetherrack = "netherrack"; + public static final String texSoulSand = "soul_sand"; + public static final String texGlowstone = "glowstone"; + public static final String texLeavesSpruce = "leaves_spruce"; + public static final String texLeavesSpruceOpaque = "leaves_spruce_opaque"; + public static final String texEndStone = "end_stone"; + public static final String texSandstoneTop = "sandstone_top"; + public static final String texSandstoneBottom = "sandstone_bottom"; + public static final String texRedstoneLampOff = "redstone_lamp_off"; + public static final String texRedstoneLampOn = "redstone_lamp_on"; + public static final String texWaterStill = "water_still"; + public static final String texWaterFlow = "water_flow"; + public static final String texLavaStill = "lava_still"; + public static final String texLavaFlow = "lava_flow"; + public static final String texFireLayer0 = "fire_layer_0"; + public static final String texFireLayer1 = "fire_layer_1"; + public static final String texPortal = "portal"; + public static final String texGlass = "glass"; + public static final String texGlassPaneTop = "glass_pane_top"; + public static final String texCompass = "compass"; + public static final String texClock = "clock"; + public static TextureAtlasSprite iconGrassTop; + public static TextureAtlasSprite iconGrassSide; + public static TextureAtlasSprite iconGrassSideOverlay; + public static TextureAtlasSprite iconSnow; + public static TextureAtlasSprite iconGrassSideSnowed; + public static TextureAtlasSprite iconMyceliumSide; + public static TextureAtlasSprite iconMyceliumTop; + public static TextureAtlasSprite iconWaterStill; + public static TextureAtlasSprite iconWaterFlow; + public static TextureAtlasSprite iconLavaStill; + public static TextureAtlasSprite iconLavaFlow; + public static TextureAtlasSprite iconPortal; + public static TextureAtlasSprite iconFireLayer0; + public static TextureAtlasSprite iconFireLayer1; + public static TextureAtlasSprite iconGlass; + public static TextureAtlasSprite iconGlassPaneTop; + public static TextureAtlasSprite iconCompass; + public static TextureAtlasSprite iconClock; + public static final String SPRITE_PREFIX_BLOCKS = "minecraft:blocks/"; + public static final String SPRITE_PREFIX_ITEMS = "minecraft:items/"; + private static IntBuffer staticBuffer = GLAllocation.createDirectIntBuffer(256); + + public static void update() + { + TextureMap texturemap = getTextureMapBlocks(); + + if (texturemap != null) + { + String s = "minecraft:blocks/"; + iconGrassTop = texturemap.getSpriteSafe(s + "grass_top"); + iconGrassSide = texturemap.getSpriteSafe(s + "grass_side"); + iconGrassSideOverlay = texturemap.getSpriteSafe(s + "grass_side_overlay"); + iconSnow = texturemap.getSpriteSafe(s + "snow"); + iconGrassSideSnowed = texturemap.getSpriteSafe(s + "grass_side_snowed"); + iconMyceliumSide = texturemap.getSpriteSafe(s + "mycelium_side"); + iconMyceliumTop = texturemap.getSpriteSafe(s + "mycelium_top"); + iconWaterStill = texturemap.getSpriteSafe(s + "water_still"); + iconWaterFlow = texturemap.getSpriteSafe(s + "water_flow"); + iconLavaStill = texturemap.getSpriteSafe(s + "lava_still"); + iconLavaFlow = texturemap.getSpriteSafe(s + "lava_flow"); + iconFireLayer0 = texturemap.getSpriteSafe(s + "fire_layer_0"); + iconFireLayer1 = texturemap.getSpriteSafe(s + "fire_layer_1"); + iconPortal = texturemap.getSpriteSafe(s + "portal"); + iconGlass = texturemap.getSpriteSafe(s + "glass"); + iconGlassPaneTop = texturemap.getSpriteSafe(s + "glass_pane_top"); + String s1 = "minecraft:items/"; + iconCompass = texturemap.getSpriteSafe(s1 + "compass"); + iconClock = texturemap.getSpriteSafe(s1 + "clock"); + } + } + + public static BufferedImage fixTextureDimensions(String name, BufferedImage bi) + { + if (name.startsWith("/mob/zombie") || name.startsWith("/mob/pigzombie")) + { + int i = bi.getWidth(); + int j = bi.getHeight(); + + if (i == j * 2) + { + BufferedImage bufferedimage = new BufferedImage(i, j * 2, 2); + Graphics2D graphics2d = bufferedimage.createGraphics(); + graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); + graphics2d.drawImage(bi, 0, 0, i, j, (ImageObserver)null); + return bufferedimage; + } + } + + return bi; + } + + public static int ceilPowerOfTwo(int val) + { + int i; + + for (i = 1; i < val; i *= 2) + { + ; + } + + return i; + } + + public static int getPowerOfTwo(int val) + { + int i = 1; + int j; + + for (j = 0; i < val; ++j) + { + i *= 2; + } + + return j; + } + + public static int twoToPower(int power) + { + int i = 1; + + for (int j = 0; j < power; ++j) + { + i *= 2; + } + + return i; + } + + public static ITextureObject getTexture(ResourceLocation loc) + { + ITextureObject itextureobject = Config.getTextureManager().getTexture(loc); + + if (itextureobject != null) + { + return itextureobject; + } + else if (!Config.hasResource(loc)) + { + return null; + } + else + { + SimpleTexture simpletexture = new SimpleTexture(loc); + Config.getTextureManager().loadTexture(loc, simpletexture); + return simpletexture; + } + } + + public static void resourcesReloaded(IResourceManager rm) + { + if (getTextureMapBlocks() != null) + { + Config.dbg("*** Reloading custom textures ***"); + CustomSky.reset(); + TextureAnimations.reset(); + update(); + NaturalTextures.update(); + BetterGrass.update(); + BetterSnow.update(); + TextureAnimations.update(); + CustomColors.update(); + CustomSky.update(); + RandomEntities.update(); + CustomItems.updateModels(); + CustomEntityModels.update(); + Shaders.resourcesReloaded(); + Lang.resourcesReloaded(); + Config.updateTexturePackClouds(); + SmartLeaves.updateLeavesModels(); + CustomPanorama.update(); + CustomGuis.update(); + LayerMooshroomMushroom.update(); + CustomLoadingScreens.update(); + CustomBlockLayers.update(); + Config.getTextureManager().tick(); + } + } + + public static TextureMap getTextureMapBlocks() + { + return Minecraft.getMinecraft().getTextureMapBlocks(); + } + + public static void registerResourceListener() + { + IResourceManager iresourcemanager = Config.getResourceManager(); + + if (iresourcemanager instanceof IReloadableResourceManager) + { + IReloadableResourceManager ireloadableresourcemanager = (IReloadableResourceManager)iresourcemanager; + IResourceManagerReloadListener iresourcemanagerreloadlistener = new IResourceManagerReloadListener() + { + public void onResourceManagerReload(IResourceManager var1) + { + TextureUtils.resourcesReloaded(var1); + } + }; + ireloadableresourcemanager.registerReloadListener(iresourcemanagerreloadlistener); + } + + ITickableTextureObject itickabletextureobject = new ITickableTextureObject() + { + public void tick() + { + TextureAnimations.updateAnimations(); + } + public void loadTexture(IResourceManager var1) throws IOException + { + } + public int getGlTextureId() + { + return 0; + } + public void setBlurMipmap(boolean p_174936_1, boolean p_174936_2) + { + } + public void restoreLastBlurMipmap() + { + } + public MultiTexID getMultiTexID() + { + return null; + } + }; + ResourceLocation resourcelocation = new ResourceLocation("optifine/TickableTextures"); + Config.getTextureManager().loadTickableTexture(resourcelocation, itickabletextureobject); + } + + public static ResourceLocation fixResourceLocation(ResourceLocation loc, String basePath) + { + if (!loc.getResourceDomain().equals("minecraft")) + { + return loc; + } + else + { + String s = loc.getResourcePath(); + String s1 = fixResourcePath(s, basePath); + + if (s1 != s) + { + loc = new ResourceLocation(loc.getResourceDomain(), s1); + } + + return loc; + } + } + + public static String fixResourcePath(String path, String basePath) + { + String s = "assets/minecraft/"; + + if (path.startsWith(s)) + { + path = path.substring(s.length()); + return path; + } + else if (path.startsWith("./")) + { + path = path.substring(2); + + if (!basePath.endsWith("/")) + { + basePath = basePath + "/"; + } + + path = basePath + path; + return path; + } + else + { + if (path.startsWith("/~")) + { + path = path.substring(1); + } + + String s1 = "mcpatcher/"; + + if (path.startsWith("~/")) + { + path = path.substring(2); + path = s1 + path; + return path; + } + else if (path.startsWith("/")) + { + path = s1 + path.substring(1); + return path; + } + else + { + return path; + } + } + } + + public static String getBasePath(String path) + { + int i = path.lastIndexOf(47); + return i < 0 ? "" : path.substring(0, i); + } + + public static void applyAnisotropicLevel() + { + if (GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic) + { + float f = GL11.glGetFloat(34047); + float f1 = (float)Config.getAnisotropicFilterLevel(); + f1 = Math.min(f1, f); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, f1); + } + } + + public static void bindTexture(int glTexId) + { + GlStateManager.bindTexture(glTexId); + } + + public static boolean isPowerOfTwo(int x) + { + int i = MathHelper.roundUpToPowerOfTwo(x); + return i == x; + } + + public static BufferedImage scaleImage(BufferedImage bi, int w2) + { + int i = bi.getWidth(); + int j = bi.getHeight(); + int k = j * w2 / i; + BufferedImage bufferedimage = new BufferedImage(w2, k, 2); + Graphics2D graphics2d = bufferedimage.createGraphics(); + Object object = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR; + + if (w2 < i || w2 % i != 0) + { + object = RenderingHints.VALUE_INTERPOLATION_BILINEAR; + } + + graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, object); + graphics2d.drawImage(bi, 0, 0, w2, k, (ImageObserver)null); + return bufferedimage; + } + + public static int scaleToGrid(int size, int sizeGrid) + { + if (size == sizeGrid) + { + return size; + } + else + { + int i; + + for (i = size / sizeGrid * sizeGrid; i < size; i += sizeGrid) + { + ; + } + + return i; + } + } + + public static int scaleToMin(int size, int sizeMin) + { + if (size >= sizeMin) + { + return size; + } + else + { + int i; + + for (i = sizeMin / size * size; i < sizeMin; i += size) + { + ; + } + + return i; + } + } + + public static Dimension getImageSize(InputStream in, String suffix) + { + Iterator iterator = ImageIO.getImageReadersBySuffix(suffix); + + while (true) + { + if (iterator.hasNext()) + { + ImageReader imagereader = (ImageReader)iterator.next(); + Dimension dimension; + + try + { + ImageInputStream imageinputstream = ImageIO.createImageInputStream(in); + imagereader.setInput(imageinputstream); + int i = imagereader.getWidth(imagereader.getMinIndex()); + int j = imagereader.getHeight(imagereader.getMinIndex()); + dimension = new Dimension(i, j); + } + catch (IOException var11) + { + continue; + } + finally + { + imagereader.dispose(); + } + + return dimension; + } + + return null; + } + } + + public static void dbgMipmaps(TextureAtlasSprite textureatlassprite) + { + int[][] aint = textureatlassprite.getFrameTextureData(0); + + for (int i = 0; i < aint.length; ++i) + { + int[] aint1 = aint[i]; + + if (aint1 == null) + { + Config.dbg("" + i + ": " + aint1); + } + else + { + Config.dbg("" + i + ": " + aint1.length); + } + } + } + + public static void saveGlTexture(String name, int textureId, int mipmapLevels, int width, int height) + { + bindTexture(textureId); + GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); + GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); + File file1 = new File(name); + File file2 = file1.getParentFile(); + + if (file2 != null) + { + file2.mkdirs(); + } + + for (int i = 0; i < 16; ++i) + { + File file3 = new File(name + "_" + i + ".png"); + file3.delete(); + } + + for (int i1 = 0; i1 <= mipmapLevels; ++i1) + { + File file4 = new File(name + "_" + i1 + ".png"); + int j = width >> i1; + int k = height >> i1; + int l = j * k; + IntBuffer intbuffer = BufferUtils.createIntBuffer(l); + int[] aint = new int[l]; + GL11.glGetTexImage(GL11.GL_TEXTURE_2D, i1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer); + intbuffer.get(aint); + BufferedImage bufferedimage = new BufferedImage(j, k, 2); + bufferedimage.setRGB(0, 0, j, k, aint, 0, j); + + try + { + ImageIO.write(bufferedimage, "png", (File)file4); + Config.dbg("Exported: " + file4); + } + catch (Exception exception) + { + Config.warn("Error writing: " + file4); + Config.warn("" + exception.getClass().getName() + ": " + exception.getMessage()); + } + } + } + + public static void generateCustomMipmaps(TextureAtlasSprite tas, int mipmaps) + { + int i = tas.getIconWidth(); + int j = tas.getIconHeight(); + + if (tas.getFrameCount() < 1) + { + List list = new ArrayList(); + int[][] aint = new int[mipmaps + 1][]; + int[] aint1 = new int[i * j]; + aint[0] = aint1; + list.add(aint); + tas.setFramesTextureData(list); + } + + List list1 = new ArrayList(); + int l = tas.getFrameCount(); + + for (int i1 = 0; i1 < l; ++i1) + { + int[] aint2 = getFrameData(tas, i1, 0); + + if (aint2 == null || aint2.length < 1) + { + aint2 = new int[i * j]; + } + + if (aint2.length != i * j) + { + int k = (int)Math.round(Math.sqrt((double)aint2.length)); + + if (k * k != aint2.length) + { + aint2 = new int[1]; + k = 1; + } + + BufferedImage bufferedimage = new BufferedImage(k, k, 2); + bufferedimage.setRGB(0, 0, k, k, aint2, 0, k); + BufferedImage bufferedimage1 = scaleImage(bufferedimage, i); + int[] aint3 = new int[i * j]; + bufferedimage1.getRGB(0, 0, i, j, aint3, 0, i); + aint2 = aint3; + } + + int[][] aint4 = new int[mipmaps + 1][]; + aint4[0] = aint2; + list1.add(aint4); + } + + tas.setFramesTextureData(list1); + tas.generateMipmaps(mipmaps); + } + + public static int[] getFrameData(TextureAtlasSprite tas, int frame, int level) + { + List list = tas.getFramesTextureData(); + + if (list.size() <= frame) + { + return null; + } + else + { + int[][] aint = (int[][])list.get(frame); + + if (aint != null && aint.length > level) + { + int[] aint1 = aint[level]; + return aint1; + } + else + { + return null; + } + } + } + + public static int getGLMaximumTextureSize() + { + for (int i = 65536; i > 0; i >>= 1) + { + GlStateManager.glTexImage2D(32868, 0, 6408, i, i, 0, 6408, 5121, (IntBuffer)null); + int j = GL11.glGetError(); + int k = GlStateManager.glGetTexLevelParameteri(32868, 0, 4096); + + if (k != 0) + { + return i; + } + } + + return -1; + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/TileEntityUtils.java b/Client-1.8.9/src/main/java/net/optifine/util/TileEntityUtils.java new file mode 100644 index 0000000..a31dabe --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/TileEntityUtils.java @@ -0,0 +1,130 @@ +package net.optifine.util; + +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.IWorldNameable; +import net.optifine.reflect.Reflector; + +public class TileEntityUtils +{ + public static String getTileEntityName(IBlockAccess blockAccess, BlockPos blockPos) + { + TileEntity tileentity = blockAccess.getTileEntity(blockPos); + return getTileEntityName(tileentity); + } + + public static String getTileEntityName(TileEntity te) + { + if (!(te instanceof IWorldNameable)) + { + return null; + } + else + { + IWorldNameable iworldnameable = (IWorldNameable)te; + updateTileEntityName(te); + return !iworldnameable.hasCustomName() ? null : iworldnameable.getName(); + } + } + + public static void updateTileEntityName(TileEntity te) + { + BlockPos blockpos = te.getPos(); + String s = getTileEntityRawName(te); + + if (s == null) + { + String s1 = getServerTileEntityRawName(blockpos); + s1 = Config.normalize(s1); + setTileEntityRawName(te, s1); + } + } + + public static String getServerTileEntityRawName(BlockPos blockPos) + { + TileEntity tileentity = IntegratedServerUtils.getTileEntity(blockPos); + return tileentity == null ? null : getTileEntityRawName(tileentity); + } + + public static String getTileEntityRawName(TileEntity te) + { + if (te instanceof TileEntityBeacon) + { + return (String)Reflector.getFieldValue(te, Reflector.TileEntityBeacon_customName); + } + else if (te instanceof TileEntityBrewingStand) + { + return (String)Reflector.getFieldValue(te, Reflector.TileEntityBrewingStand_customName); + } + else if (te instanceof TileEntityEnchantmentTable) + { + return (String)Reflector.getFieldValue(te, Reflector.TileEntityEnchantmentTable_customName); + } + else if (te instanceof TileEntityFurnace) + { + return (String)Reflector.getFieldValue(te, Reflector.TileEntityFurnace_customName); + } + else + { + if (te instanceof IWorldNameable) + { + IWorldNameable iworldnameable = (IWorldNameable)te; + + if (iworldnameable.hasCustomName()) + { + return iworldnameable.getName(); + } + } + + return null; + } + } + + public static boolean setTileEntityRawName(TileEntity te, String name) + { + if (te instanceof TileEntityBeacon) + { + return Reflector.setFieldValue(te, Reflector.TileEntityBeacon_customName, name); + } + else if (te instanceof TileEntityBrewingStand) + { + return Reflector.setFieldValue(te, Reflector.TileEntityBrewingStand_customName, name); + } + else if (te instanceof TileEntityEnchantmentTable) + { + return Reflector.setFieldValue(te, Reflector.TileEntityEnchantmentTable_customName, name); + } + else if (te instanceof TileEntityFurnace) + { + return Reflector.setFieldValue(te, Reflector.TileEntityFurnace_customName, name); + } + else if (te instanceof TileEntityChest) + { + ((TileEntityChest)te).setCustomName(name); + return true; + } + else if (te instanceof TileEntityDispenser) + { + ((TileEntityDispenser)te).setCustomName(name); + return true; + } + else if (te instanceof TileEntityHopper) + { + ((TileEntityHopper)te).setCustomName(name); + return true; + } + else + { + return false; + } + } +} diff --git a/Client-1.8.9/src/main/java/net/optifine/util/TimedEvent.java b/Client-1.8.9/src/main/java/net/optifine/util/TimedEvent.java new file mode 100644 index 0000000..7f35a00 --- /dev/null +++ b/Client-1.8.9/src/main/java/net/optifine/util/TimedEvent.java @@ -0,0 +1,36 @@ +package net.optifine.util; + +import java.util.HashMap; +import java.util.Map; + +public class TimedEvent +{ + private static Map mapEventTimes = new HashMap(); + + public static boolean isActive(String name, long timeIntervalMs) + { + synchronized (mapEventTimes) + { + long i = System.currentTimeMillis(); + Long olong = (Long)mapEventTimes.get(name); + + if (olong == null) + { + olong = new Long(i); + mapEventTimes.put(name, olong); + } + + long j = olong.longValue(); + + if (i < j + timeIntervalMs) + { + return false; + } + else + { + mapEventTimes.put(name, new Long(i)); + return true; + } + } + } +} diff --git a/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.AudioFileReader b/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.AudioFileReader new file mode 100644 index 0000000..950ea56 --- /dev/null +++ b/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.AudioFileReader @@ -0,0 +1,2 @@ +# Providers of Speex sound file-reading services +org.xiph.speex.spi.SpeexAudioFileReader diff --git a/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.AudioFileWriter b/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.AudioFileWriter new file mode 100644 index 0000000..eee55b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.AudioFileWriter @@ -0,0 +1,2 @@ +# Providers of Speex sound file-writing services +org.xiph.speex.spi.SpeexAudioFileWriter diff --git a/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider b/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider new file mode 100644 index 0000000..bf27905 --- /dev/null +++ b/Client-1.8.9/src/main/resources/META-INF/services/javax.sound.sampled.spi.FormatConversionProvider @@ -0,0 +1,2 @@ +# Providers of Speex sound conversion services +org.xiph.speex.spi.SpeexFormatConvertionProvider diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_door.json new file mode 100644 index 0000000..6ef5a57 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_door.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "acacia_door_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "acacia_door_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "acacia_door_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "acacia_door_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "acacia_door_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "acacia_door_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "acacia_door_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "acacia_door_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "acacia_door_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "acacia_door_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "acacia_door_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "acacia_door_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "acacia_door_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "acacia_door_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "acacia_door_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "acacia_door_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "acacia_door_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "acacia_door_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "acacia_door_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "acacia_door_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "acacia_door_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "acacia_door_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "acacia_door_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "acacia_door_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "acacia_door_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "acacia_door_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "acacia_door_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "acacia_door_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "acacia_door_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "acacia_door_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "acacia_door_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "acacia_door_top", "y": 180 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_double_slab.json new file mode 100644 index 0000000..8394a73 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_double_slab.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "acacia_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_fence.json new file mode 100644 index 0000000..fe9887b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_fence.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "acacia_fence_post" }, + "east=false,north=true,south=false,west=false": { "model": "acacia_fence_n", "uvlock": true }, + "east=true,north=false,south=false,west=false": { "model": "acacia_fence_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=false": { "model": "acacia_fence_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,west=true": { "model": "acacia_fence_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,west=false": { "model": "acacia_fence_ne", "uvlock": true }, + "east=true,north=false,south=true,west=false": { "model": "acacia_fence_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=true": { "model": "acacia_fence_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,west=true": { "model": "acacia_fence_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,west=false": { "model": "acacia_fence_ns", "uvlock": true }, + "east=true,north=false,south=false,west=true": { "model": "acacia_fence_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,west=false": { "model": "acacia_fence_nse", "uvlock": true }, + "east=true,north=false,south=true,west=true": { "model": "acacia_fence_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,west=true": { "model": "acacia_fence_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,west=true": { "model": "acacia_fence_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,west=true": { "model": "acacia_fence_nsew", "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_fence_gate.json new file mode 100644 index 0000000..c18d825 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_fence_gate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "acacia_fence_gate_closed" }, + "facing=west,in_wall=false,open=false": { "model": "acacia_fence_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "acacia_fence_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "acacia_fence_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "acacia_fence_gate_open" }, + "facing=west,in_wall=false,open=true": { "model": "acacia_fence_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "acacia_fence_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "acacia_fence_gate_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "acacia_wall_gate_closed" }, + "facing=west,in_wall=true,open=false": { "model": "acacia_wall_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "acacia_wall_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "acacia_wall_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "acacia_wall_gate_open" }, + "facing=west,in_wall=true,open=true": { "model": "acacia_wall_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "acacia_wall_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "acacia_wall_gate_open", "y": 270, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_leaves.json new file mode 100644 index 0000000..2ea28dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_leaves.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "acacia_leaves" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_log.json new file mode 100644 index 0000000..bba37a7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_log.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "acacia_log" }, + "axis=z": { "model": "acacia_log_side" }, + "axis=x": { "model": "acacia_log_side", "y": 90 }, + "axis=none": { "model": "acacia_bark" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_planks.json new file mode 100644 index 0000000..8394a73 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_planks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "acacia_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_sapling.json new file mode 100644 index 0000000..a2c961f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_sapling.json @@ -0,0 +1,6 @@ +{ + "variants": { + "stage=0": { "model": "acacia_sapling" }, + "stage=1": { "model": "acacia_sapling" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_slab.json new file mode 100644 index 0000000..b0640a9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_acacia" }, + "half=top": { "model": "upper_slab_acacia" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_stairs.json new file mode 100644 index 0000000..13c597f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/acacia_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "acacia_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "acacia_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "acacia_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "acacia_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "acacia_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "acacia_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "acacia_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "acacia_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "acacia_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "acacia_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "acacia_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "acacia_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "acacia_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "acacia_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "acacia_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "acacia_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "acacia_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "acacia_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "acacia_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "acacia_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "acacia_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "acacia_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "acacia_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "acacia_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "acacia_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "acacia_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "acacia_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "acacia_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "acacia_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "acacia_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "acacia_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "acacia_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "acacia_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "acacia_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "acacia_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "acacia_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "acacia_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "acacia_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "acacia_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "acacia_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/activator_rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/activator_rail.json new file mode 100644 index 0000000..a86fd69 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/activator_rail.json @@ -0,0 +1,16 @@ +{ + "variants": { + "powered=false,shape=north_south": { "model": "activator_rail_flat" }, + "powered=false,shape=east_west": { "model": "activator_rail_flat", "y": 90 }, + "powered=false,shape=ascending_east": { "model": "activator_rail_raised_ne", "y": 90 }, + "powered=false,shape=ascending_west": { "model": "activator_rail_raised_sw", "y": 90 }, + "powered=false,shape=ascending_north": { "model": "activator_rail_raised_ne" }, + "powered=false,shape=ascending_south": { "model": "activator_rail_raised_sw" }, + "powered=true,shape=north_south": { "model": "activator_rail_active_flat" }, + "powered=true,shape=east_west": { "model": "activator_rail_active_flat", "y": 90 }, + "powered=true,shape=ascending_east": { "model": "activator_rail_active_raised_ne", "y": 90 }, + "powered=true,shape=ascending_west": { "model": "activator_rail_active_raised_sw", "y": 90 }, + "powered=true,shape=ascending_north": { "model": "activator_rail_active_raised_ne" }, + "powered=true,shape=ascending_south": { "model": "activator_rail_active_raised_sw" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/allium.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/allium.json new file mode 100644 index 0000000..88521a6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/allium.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "allium" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/andesite.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/andesite.json new file mode 100644 index 0000000..15b6b38 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/andesite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "andesite" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/anvil.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/anvil.json new file mode 100644 index 0000000..c592bac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/anvil.json @@ -0,0 +1,16 @@ +{ + "variants": { + "damage=0,facing=south": { "model": "anvil_undamaged" }, + "damage=0,facing=west": { "model": "anvil_undamaged", "y": 90 }, + "damage=0,facing=north": { "model": "anvil_undamaged", "y": 180 }, + "damage=0,facing=east": { "model": "anvil_undamaged", "y": 270 }, + "damage=1,facing=south": { "model": "anvil_slightly_damaged" }, + "damage=1,facing=west": { "model": "anvil_slightly_damaged", "y": 90 }, + "damage=1,facing=north": { "model": "anvil_slightly_damaged", "y": 180 }, + "damage=1,facing=east": { "model": "anvil_slightly_damaged", "y": 270 }, + "damage=2,facing=south": { "model": "anvil_very_damaged" }, + "damage=2,facing=west": { "model": "anvil_very_damaged", "y": 90 }, + "damage=2,facing=north": { "model": "anvil_very_damaged", "y": 180 }, + "damage=2,facing=east": { "model": "anvil_very_damaged", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/beacon.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/beacon.json new file mode 100644 index 0000000..b97af99 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/beacon.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "beacon" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bed.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bed.json new file mode 100644 index 0000000..0695774 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bed.json @@ -0,0 +1,12 @@ +{ + "variants": { + "facing=north,part=foot": { "model": "bed_foot", "y": 180 }, + "facing=east,part=foot": { "model": "bed_foot", "y": 270 }, + "facing=south,part=foot": { "model": "bed_foot" }, + "facing=west,part=foot": { "model": "bed_foot", "y": 90 }, + "facing=north,part=head": { "model": "bed_head", "y": 180 }, + "facing=east,part=head": { "model": "bed_head", "y": 270 }, + "facing=south,part=head": { "model": "bed_head" }, + "facing=west,part=head": { "model": "bed_head", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bedrock.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bedrock.json new file mode 100644 index 0000000..4070fc5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bedrock.json @@ -0,0 +1,10 @@ +{ + "variants": { + "normal": [ + { "model": "bedrock" }, + { "model": "bedrock_mirrored" }, + { "model": "bedrock", "y": 180 }, + { "model": "bedrock_mirrored", "y": 180 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_door.json new file mode 100644 index 0000000..58de25c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_door.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "birch_door_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "birch_door_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "birch_door_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "birch_door_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "birch_door_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "birch_door_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "birch_door_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "birch_door_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "birch_door_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "birch_door_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "birch_door_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "birch_door_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "birch_door_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "birch_door_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "birch_door_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "birch_door_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "birch_door_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "birch_door_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "birch_door_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "birch_door_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "birch_door_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "birch_door_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "birch_door_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "birch_door_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "birch_door_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "birch_door_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "birch_door_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "birch_door_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "birch_door_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "birch_door_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "birch_door_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "birch_door_top", "y": 180 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_double_slab.json new file mode 100644 index 0000000..7c7d4f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_double_slab.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "birch_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_fence.json new file mode 100644 index 0000000..d21d31c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_fence.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "birch_fence_post" }, + "east=false,north=true,south=false,west=false": { "model": "birch_fence_n", "uvlock": true }, + "east=true,north=false,south=false,west=false": { "model": "birch_fence_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=false": { "model": "birch_fence_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,west=true": { "model": "birch_fence_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,west=false": { "model": "birch_fence_ne", "uvlock": true }, + "east=true,north=false,south=true,west=false": { "model": "birch_fence_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=true": { "model": "birch_fence_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,west=true": { "model": "birch_fence_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,west=false": { "model": "birch_fence_ns", "uvlock": true }, + "east=true,north=false,south=false,west=true": { "model": "birch_fence_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,west=false": { "model": "birch_fence_nse", "uvlock": true }, + "east=true,north=false,south=true,west=true": { "model": "birch_fence_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,west=true": { "model": "birch_fence_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,west=true": { "model": "birch_fence_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,west=true": { "model": "birch_fence_nsew", "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_fence_gate.json new file mode 100644 index 0000000..21f5f49 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_fence_gate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "birch_fence_gate_closed" }, + "facing=west,in_wall=false,open=false": { "model": "birch_fence_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "birch_fence_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "birch_fence_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "birch_fence_gate_open" }, + "facing=west,in_wall=false,open=true": { "model": "birch_fence_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "birch_fence_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "birch_fence_gate_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "birch_wall_gate_closed" }, + "facing=west,in_wall=true,open=false": { "model": "birch_wall_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "birch_wall_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "birch_wall_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "birch_wall_gate_open" }, + "facing=west,in_wall=true,open=true": { "model": "birch_wall_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "birch_wall_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "birch_wall_gate_open", "y": 270, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_leaves.json new file mode 100644 index 0000000..c3fcb28 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_leaves.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "birch_leaves" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_log.json new file mode 100644 index 0000000..8ebb352 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_log.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "birch_log" }, + "axis=z": { "model": "birch_log_side" }, + "axis=x": { "model": "birch_log_side", "y": 90 }, + "axis=none": { "model": "birch_bark" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_planks.json new file mode 100644 index 0000000..7c7d4f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_planks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "birch_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_sapling.json new file mode 100644 index 0000000..3a65405 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_sapling.json @@ -0,0 +1,6 @@ +{ + "variants": { + "stage=0": { "model": "birch_sapling" }, + "stage=1": { "model": "birch_sapling" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_slab.json new file mode 100644 index 0000000..967ddcb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_birch" }, + "half=top": { "model": "upper_slab_birch" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_stairs.json new file mode 100644 index 0000000..68bbf3e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/birch_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "birch_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "birch_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "birch_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "birch_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "birch_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "birch_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "birch_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "birch_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "birch_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "birch_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "birch_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "birch_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "birch_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "birch_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "birch_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "birch_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "birch_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "birch_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "birch_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "birch_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "birch_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "birch_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "birch_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "birch_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "birch_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "birch_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "birch_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "birch_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "birch_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "birch_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "birch_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "birch_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "birch_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "birch_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "birch_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "birch_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "birch_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "birch_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "birch_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "birch_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_carpet.json new file mode 100644 index 0000000..61e62f1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_black" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_glass.json new file mode 100644 index 0000000..6ffc12a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_black" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_glass_pane.json new file mode 100644 index 0000000..a12e9a2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "black_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "black_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "black_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "black_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "black_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "black_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "black_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "black_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "black_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "black_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "black_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "black_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "black_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "black_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "black_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "black_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_hardened_clay.json new file mode 100644 index 0000000..4bde9c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_black" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_wool.json new file mode 100644 index 0000000..728ba54 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/black_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "black_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_carpet.json new file mode 100644 index 0000000..d93906b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_blue" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_orchid.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_orchid.json new file mode 100644 index 0000000..a2e9806 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_orchid.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "orchid" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_glass.json new file mode 100644 index 0000000..ad618dd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_blue" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_glass_pane.json new file mode 100644 index 0000000..881d355 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "blue_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "blue_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "blue_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "blue_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "blue_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "blue_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "blue_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "blue_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "blue_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "blue_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "blue_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "blue_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "blue_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "blue_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "blue_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "blue_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_hardened_clay.json new file mode 100644 index 0000000..aadb0f6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_blue" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_wool.json new file mode 100644 index 0000000..3cfcf7f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/blue_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "blue_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bookshelf.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bookshelf.json new file mode 100644 index 0000000..175c626 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/bookshelf.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "bookshelf" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brewing_stand.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brewing_stand.json new file mode 100644 index 0000000..0f1c7eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brewing_stand.json @@ -0,0 +1,12 @@ +{ + "variants": { + "has_bottle_0=false,has_bottle_1=false,has_bottle_2=false": { "model": "brewing_stand_empty" }, + "has_bottle_0=true,has_bottle_1=false,has_bottle_2=false": { "model": "brewing_stand_bottles_1" }, + "has_bottle_0=false,has_bottle_1=true,has_bottle_2=false": { "model": "brewing_stand_bottles_2" }, + "has_bottle_0=false,has_bottle_1=false,has_bottle_2=true": { "model": "brewing_stand_bottles_3" }, + "has_bottle_0=true,has_bottle_1=true,has_bottle_2=false": { "model": "brewing_stand_bottles_12" }, + "has_bottle_0=true,has_bottle_1=false,has_bottle_2=true": { "model": "brewing_stand_bottles_13" }, + "has_bottle_0=false,has_bottle_1=true,has_bottle_2=true": { "model": "brewing_stand_bottles_23" }, + "has_bottle_0=true,has_bottle_1=true,has_bottle_2=true": { "model": "brewing_stand_bottles_123" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_block.json new file mode 100644 index 0000000..8afbf8f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "brick" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_double_slab.json new file mode 100644 index 0000000..ceb2e14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "brick" }, + "all": { "model": "brick" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_slab.json new file mode 100644 index 0000000..7bdc95e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_brick" }, + "half=top": { "model": "upper_slab_brick" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_stairs.json new file mode 100644 index 0000000..1b39369 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brick_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "brick_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "brick_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "brick_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "brick_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "brick_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "brick_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "brick_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "brick_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "brick_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "brick_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "brick_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "brick_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "brick_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "brick_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_carpet.json new file mode 100644 index 0000000..e5fd2d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_brown" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_mushroom.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_mushroom.json new file mode 100644 index 0000000..ef1d42f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_mushroom.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "brown_mushroom" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_mushroom_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_mushroom_block.json new file mode 100644 index 0000000..7b1cb8c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_mushroom_block.json @@ -0,0 +1,17 @@ +{ + "variants": { + "variant=north_west": { "model": "brown_mushroom_block_nw" }, + "variant=north": { "model": "brown_mushroom_block_n" }, + "variant=north_east": { "model": "brown_mushroom_block_ne" }, + "variant=west": { "model": "brown_mushroom_block_w" }, + "variant=center": { "model": "brown_mushroom_block_c" }, + "variant=east": { "model": "brown_mushroom_block_e" }, + "variant=south_west": { "model": "brown_mushroom_block_sw" }, + "variant=south": { "model": "brown_mushroom_block_s" }, + "variant=south_east": { "model": "brown_mushroom_block_se" }, + "variant=stem": { "model": "brown_mushroom_block_stem" }, + "variant=all_stem": { "model": "brown_mushroom_block_stem_all" }, + "variant=all_outside": { "model": "brown_mushroom_block_cap_all" }, + "variant=all_inside": { "model": "brown_mushroom_block_inside_all" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_glass.json new file mode 100644 index 0000000..81d4846 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_brown" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_glass_pane.json new file mode 100644 index 0000000..9cf6b3f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "brown_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "brown_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "brown_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "brown_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "brown_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "brown_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "brown_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "brown_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "brown_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "brown_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "brown_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "brown_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "brown_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "brown_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "brown_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "brown_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_hardened_clay.json new file mode 100644 index 0000000..31e344e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_brown" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_wool.json new file mode 100644 index 0000000..112805f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/brown_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "brown_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cactus.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cactus.json new file mode 100644 index 0000000..3212cd1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cactus.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "cactus" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cake.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cake.json new file mode 100644 index 0000000..c0c4af2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cake.json @@ -0,0 +1,11 @@ +{ + "variants": { + "bites=0": { "model": "cake_uneaten" }, + "bites=1": { "model": "cake_slice1" }, + "bites=2": { "model": "cake_slice2" }, + "bites=3": { "model": "cake_slice3" }, + "bites=4": { "model": "cake_slice4" }, + "bites=5": { "model": "cake_slice5" }, + "bites=6": { "model": "cake_slice6" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/carrots.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/carrots.json new file mode 100644 index 0000000..96a5347 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/carrots.json @@ -0,0 +1,12 @@ +{ + "variants": { + "age=0": { "model": "carrots_stage0" }, + "age=1": { "model": "carrots_stage0" }, + "age=2": { "model": "carrots_stage1" }, + "age=3": { "model": "carrots_stage1" }, + "age=4": { "model": "carrots_stage2" }, + "age=5": { "model": "carrots_stage2" }, + "age=6": { "model": "carrots_stage2" }, + "age=7": { "model": "carrots_stage3" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cauldron.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cauldron.json new file mode 100644 index 0000000..885af8f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cauldron.json @@ -0,0 +1,8 @@ +{ + "variants": { + "level=0": { "model": "cauldron_empty" }, + "level=1": { "model": "cauldron_level1" }, + "level=2": { "model": "cauldron_level2" }, + "level=3": { "model": "cauldron_level3" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_brick_monster_egg.json new file mode 100644 index 0000000..ea2566b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_brick_monster_egg.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_chiseled" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_quartz_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_quartz_block.json new file mode 100644 index 0000000..46748b1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_quartz_block.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "quartz_chiseled" } + } +} + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_red_sandstone.json new file mode 100644 index 0000000..f947ad8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_red_sandstone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "red_sandstone_chiseled" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_sandstone.json new file mode 100644 index 0000000..96fbad3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_sandstone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "sandstone_chiseled" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_stonebrick.json new file mode 100644 index 0000000..ea2566b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/chiseled_stonebrick.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_chiseled" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/clay.json new file mode 100644 index 0000000..3fcd74f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "clay" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coal_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coal_block.json new file mode 100644 index 0000000..7ac479e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coal_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "coal_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coal_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coal_ore.json new file mode 100644 index 0000000..cc2ca2d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coal_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "coal_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coarse_dirt.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coarse_dirt.json new file mode 100644 index 0000000..25e19be --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/coarse_dirt.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "coarse_dirt" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone.json new file mode 100644 index 0000000..57bc457 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "cobblestone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_double_slab.json new file mode 100644 index 0000000..0e4e165 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "cobblestone" }, + "all": { "model": "cobblestone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_monster_egg.json new file mode 100644 index 0000000..57bc457 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_monster_egg.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "cobblestone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_slab.json new file mode 100644 index 0000000..a55a4f3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_cobblestone" }, + "half=top": { "model": "upper_slab_cobblestone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_wall.json new file mode 100644 index 0000000..aa0b9f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cobblestone_wall.json @@ -0,0 +1,36 @@ +{ + "variants": { + "east=false,north=false,south=false,up=false,west=false": { "model": "cobblestone_wall_post" }, + "east=false,north=true,south=false,up=false,west=false": { "model": "cobblestone_wall_n" }, + "east=true,north=false,south=false,up=false,west=false": { "model": "cobblestone_wall_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=false,west=false": { "model": "cobblestone_wall_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,up=false,west=true": { "model": "cobblestone_wall_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,up=false,west=false": { "model": "cobblestone_wall_ne" }, + "east=true,north=false,south=true,up=false,west=false": { "model": "cobblestone_wall_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=false,west=true": { "model": "cobblestone_wall_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,up=false,west=true": { "model": "cobblestone_wall_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,up=false,west=false": { "model": "cobblestone_wall_ns" }, + "east=true,north=false,south=false,up=false,west=true": { "model": "cobblestone_wall_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,up=false,west=false": { "model": "cobblestone_wall_nse" }, + "east=true,north=false,south=true,up=false,west=true": { "model": "cobblestone_wall_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,up=false,west=true": { "model": "cobblestone_wall_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,up=false,west=true": { "model": "cobblestone_wall_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,up=false,west=true": { "model": "cobblestone_wall_nsew" }, + "east=false,north=false,south=false,up=true,west=false": { "model": "cobblestone_wall_post" }, + "east=false,north=true,south=false,up=true,west=false": { "model": "cobblestone_wall_n" }, + "east=true,north=false,south=false,up=true,west=false": { "model": "cobblestone_wall_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=true,west=false": { "model": "cobblestone_wall_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,up=true,west=true": { "model": "cobblestone_wall_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,up=true,west=false": { "model": "cobblestone_wall_ne" }, + "east=true,north=false,south=true,up=true,west=false": { "model": "cobblestone_wall_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=true,west=true": { "model": "cobblestone_wall_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,up=true,west=true": { "model": "cobblestone_wall_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,up=true,west=false": { "model": "cobblestone_wall_ns_above" }, + "east=true,north=false,south=false,up=true,west=true": { "model": "cobblestone_wall_ns_above", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,up=true,west=false": { "model": "cobblestone_wall_nse" }, + "east=true,north=false,south=true,up=true,west=true": { "model": "cobblestone_wall_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,up=true,west=true": { "model": "cobblestone_wall_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,up=true,west=true": { "model": "cobblestone_wall_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,up=true,west=true": { "model": "cobblestone_wall_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cocoa.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cocoa.json new file mode 100644 index 0000000..9eda2fd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cocoa.json @@ -0,0 +1,16 @@ +{ + "variants": { + "age=0,facing=south": { "model": "cocoa_age0_s" }, + "age=0,facing=west": { "model": "cocoa_age0_s", "y": 90 }, + "age=0,facing=north": { "model": "cocoa_age0_s", "y": 180 }, + "age=0,facing=east": { "model": "cocoa_age0_s", "y": 270 }, + "age=1,facing=south": { "model": "cocoa_age1_s" }, + "age=1,facing=west": { "model": "cocoa_age1_s", "y": 90 }, + "age=1,facing=north": { "model": "cocoa_age1_s", "y": 180 }, + "age=1,facing=east": { "model": "cocoa_age1_s", "y": 270 }, + "age=2,facing=south": { "model": "cocoa_age2_s" }, + "age=2,facing=west": { "model": "cocoa_age2_s", "y": 90 }, + "age=2,facing=north": { "model": "cocoa_age2_s", "y": 180 }, + "age=2,facing=east": { "model": "cocoa_age2_s", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/command_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/command_block.json new file mode 100644 index 0000000..3becb01 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/command_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "command_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cracked_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cracked_brick_monster_egg.json new file mode 100644 index 0000000..58adbf2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cracked_brick_monster_egg.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_cracked" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cracked_stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cracked_stonebrick.json new file mode 100644 index 0000000..58adbf2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cracked_stonebrick.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_cracked" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/crafting_table.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/crafting_table.json new file mode 100644 index 0000000..ef1590a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/crafting_table.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "crafting_table" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_carpet.json new file mode 100644 index 0000000..dd9fc91 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_cyan" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_glass.json new file mode 100644 index 0000000..388279f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_cyan" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_glass_pane.json new file mode 100644 index 0000000..7d5b059 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "cyan_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "cyan_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "cyan_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "cyan_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "cyan_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "cyan_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "cyan_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "cyan_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "cyan_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "cyan_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "cyan_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "cyan_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "cyan_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "cyan_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "cyan_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "cyan_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_hardened_clay.json new file mode 100644 index 0000000..c67b33b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_cyan" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_wool.json new file mode 100644 index 0000000..db589f3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/cyan_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "cyan_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dandelion.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dandelion.json new file mode 100644 index 0000000..6d49256 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dandelion.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "dandelion" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_door.json new file mode 100644 index 0000000..4681e94 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_door.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "dark_oak_door_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "dark_oak_door_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "dark_oak_door_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "dark_oak_door_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "dark_oak_door_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "dark_oak_door_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "dark_oak_door_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "dark_oak_door_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "dark_oak_door_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "dark_oak_door_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "dark_oak_door_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "dark_oak_door_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "dark_oak_door_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "dark_oak_door_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "dark_oak_door_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "dark_oak_door_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "dark_oak_door_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "dark_oak_door_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "dark_oak_door_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "dark_oak_door_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "dark_oak_door_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "dark_oak_door_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "dark_oak_door_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "dark_oak_door_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "dark_oak_door_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "dark_oak_door_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "dark_oak_door_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "dark_oak_door_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "dark_oak_door_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "dark_oak_door_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "dark_oak_door_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "dark_oak_door_top", "y": 180 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_double_slab.json new file mode 100644 index 0000000..0dd3e06 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_double_slab.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "dark_oak_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_fence.json new file mode 100644 index 0000000..266580a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_fence.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "dark_oak_fence_post" }, + "east=false,north=true,south=false,west=false": { "model": "dark_oak_fence_n", "uvlock": true }, + "east=true,north=false,south=false,west=false": { "model": "dark_oak_fence_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=false": { "model": "dark_oak_fence_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,west=true": { "model": "dark_oak_fence_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,west=false": { "model": "dark_oak_fence_ne", "uvlock": true }, + "east=true,north=false,south=true,west=false": { "model": "dark_oak_fence_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=true": { "model": "dark_oak_fence_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,west=true": { "model": "dark_oak_fence_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,west=false": { "model": "dark_oak_fence_ns", "uvlock": true }, + "east=true,north=false,south=false,west=true": { "model": "dark_oak_fence_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,west=false": { "model": "dark_oak_fence_nse", "uvlock": true }, + "east=true,north=false,south=true,west=true": { "model": "dark_oak_fence_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,west=true": { "model": "dark_oak_fence_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,west=true": { "model": "dark_oak_fence_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,west=true": { "model": "dark_oak_fence_nsew", "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_fence_gate.json new file mode 100644 index 0000000..011e1f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_fence_gate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "dark_oak_fence_gate_closed" }, + "facing=west,in_wall=false,open=false": { "model": "dark_oak_fence_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "dark_oak_fence_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "dark_oak_fence_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "dark_oak_fence_gate_open" }, + "facing=west,in_wall=false,open=true": { "model": "dark_oak_fence_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "dark_oak_fence_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "dark_oak_fence_gate_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "dark_oak_wall_gate_closed" }, + "facing=west,in_wall=true,open=false": { "model": "dark_oak_wall_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "dark_oak_wall_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "dark_oak_wall_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "dark_oak_wall_gate_open" }, + "facing=west,in_wall=true,open=true": { "model": "dark_oak_wall_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "dark_oak_wall_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "dark_oak_wall_gate_open", "y": 270, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_leaves.json new file mode 100644 index 0000000..bb68195 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_leaves.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "dark_oak_leaves" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_log.json new file mode 100644 index 0000000..ff01aec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_log.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "dark_oak_log" }, + "axis=z": { "model": "dark_oak_log_side" }, + "axis=x": { "model": "dark_oak_log_side", "y": 90 }, + "axis=none": { "model": "dark_oak_bark" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_planks.json new file mode 100644 index 0000000..0dd3e06 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_planks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "dark_oak_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_sapling.json new file mode 100644 index 0000000..6d1d2e9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_sapling.json @@ -0,0 +1,6 @@ +{ + "variants": { + "stage=0": { "model": "dark_oak_sapling" }, + "stage=1": { "model": "dark_oak_sapling" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_slab.json new file mode 100644 index 0000000..9b0ed64 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_dark_oak" }, + "half=top": { "model": "upper_slab_dark_oak" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_stairs.json new file mode 100644 index 0000000..e920d6d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_oak_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "dark_oak_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "dark_oak_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "dark_oak_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "dark_oak_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "dark_oak_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "dark_oak_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "dark_oak_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "dark_oak_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "dark_oak_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "dark_oak_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "dark_oak_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "dark_oak_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "dark_oak_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "dark_oak_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "dark_oak_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "dark_oak_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "dark_oak_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "dark_oak_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "dark_oak_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "dark_oak_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "dark_oak_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "dark_oak_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "dark_oak_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "dark_oak_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "dark_oak_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "dark_oak_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "dark_oak_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "dark_oak_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "dark_oak_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "dark_oak_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "dark_oak_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "dark_oak_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "dark_oak_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "dark_oak_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "dark_oak_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "dark_oak_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "dark_oak_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "dark_oak_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "dark_oak_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "dark_oak_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_prismarine.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_prismarine.json new file mode 100644 index 0000000..7f87a8d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dark_prismarine.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "prismarine_dark" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/daylight_detector.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/daylight_detector.json new file mode 100644 index 0000000..862d7a9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/daylight_detector.json @@ -0,0 +1,20 @@ +{ + "variants": { + "power=0": { "model": "daylight_detector" }, + "power=1": { "model": "daylight_detector" }, + "power=2": { "model": "daylight_detector" }, + "power=3": { "model": "daylight_detector" }, + "power=4": { "model": "daylight_detector" }, + "power=5": { "model": "daylight_detector" }, + "power=6": { "model": "daylight_detector" }, + "power=7": { "model": "daylight_detector" }, + "power=8": { "model": "daylight_detector" }, + "power=9": { "model": "daylight_detector" }, + "power=10": { "model": "daylight_detector" }, + "power=11": { "model": "daylight_detector" }, + "power=12": { "model": "daylight_detector" }, + "power=13": { "model": "daylight_detector" }, + "power=14": { "model": "daylight_detector" }, + "power=15": { "model": "daylight_detector" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/daylight_detector_inverted.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/daylight_detector_inverted.json new file mode 100644 index 0000000..55de23b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/daylight_detector_inverted.json @@ -0,0 +1,20 @@ +{ + "variants": { + "power=0": { "model": "daylight_detector_inverted" }, + "power=1": { "model": "daylight_detector_inverted" }, + "power=2": { "model": "daylight_detector_inverted" }, + "power=3": { "model": "daylight_detector_inverted" }, + "power=4": { "model": "daylight_detector_inverted" }, + "power=5": { "model": "daylight_detector_inverted" }, + "power=6": { "model": "daylight_detector_inverted" }, + "power=7": { "model": "daylight_detector_inverted" }, + "power=8": { "model": "daylight_detector_inverted" }, + "power=9": { "model": "daylight_detector_inverted" }, + "power=10": { "model": "daylight_detector_inverted" }, + "power=11": { "model": "daylight_detector_inverted" }, + "power=12": { "model": "daylight_detector_inverted" }, + "power=13": { "model": "daylight_detector_inverted" }, + "power=14": { "model": "daylight_detector_inverted" }, + "power=15": { "model": "daylight_detector_inverted" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dead_bush.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dead_bush.json new file mode 100644 index 0000000..faa7eae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dead_bush.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "dead_bush" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/detector_rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/detector_rail.json new file mode 100644 index 0000000..d5146b1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/detector_rail.json @@ -0,0 +1,16 @@ +{ + "variants": { + "powered=false,shape=north_south": { "model": "detector_rail_flat" }, + "powered=false,shape=east_west": { "model": "detector_rail_flat", "y": 90 }, + "powered=false,shape=ascending_east": { "model": "detector_rail_raised_ne", "y": 90 }, + "powered=false,shape=ascending_west": { "model": "detector_rail_raised_sw", "y": 90 }, + "powered=false,shape=ascending_north": { "model": "detector_rail_raised_ne" }, + "powered=false,shape=ascending_south": { "model": "detector_rail_raised_sw" }, + "powered=true,shape=north_south": { "model": "detector_rail_powered_flat" }, + "powered=true,shape=east_west": { "model": "detector_rail_powered_flat", "y": 90 }, + "powered=true,shape=ascending_east": { "model": "detector_rail_powered_raised_ne", "y": 90 }, + "powered=true,shape=ascending_west": { "model": "detector_rail_powered_raised_sw", "y": 90 }, + "powered=true,shape=ascending_north": { "model": "detector_rail_powered_raised_ne" }, + "powered=true,shape=ascending_south": { "model": "detector_rail_powered_raised_sw" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diamond_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diamond_block.json new file mode 100644 index 0000000..d8db9e5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diamond_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "diamond_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diamond_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diamond_ore.json new file mode 100644 index 0000000..ba58d55 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diamond_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "diamond_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diorite.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diorite.json new file mode 100644 index 0000000..5c6f010 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/diorite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "diorite" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dirt.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dirt.json new file mode 100644 index 0000000..16816dd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dirt.json @@ -0,0 +1,10 @@ +{ + "variants": { + "normal": [ + { "model": "dirt" }, + { "model": "dirt", "y": 90 }, + { "model": "dirt", "y": 180 }, + { "model": "dirt", "y": 270 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dispenser.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dispenser.json new file mode 100644 index 0000000..fb58738 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dispenser.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=down": { "model": "dispenser_vertical", "x": 180 }, + "facing=up": { "model": "dispenser_vertical" }, + "facing=north": { "model": "dispenser" }, + "facing=south": { "model": "dispenser", "y": 180 }, + "facing=west": { "model": "dispenser", "y": 270 }, + "facing=east": { "model": "dispenser", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_fern.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_fern.json new file mode 100644 index 0000000..9b2ad6a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_fern.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=lower": { "model": "double_fern_bottom" }, + "half=upper": { "model": "double_fern_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_grass.json new file mode 100644 index 0000000..d0971c6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_grass.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=lower": { "model": "double_grass_bottom" }, + "half=upper": { "model": "double_grass_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_rose.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_rose.json new file mode 100644 index 0000000..cf008d0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/double_rose.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=lower": { "model": "double_rose_bottom" }, + "half=upper": { "model": "double_rose_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dragon_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dragon_egg.json new file mode 100644 index 0000000..16fdcfd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dragon_egg.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "dragon_egg" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dropper.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dropper.json new file mode 100644 index 0000000..41cc1d4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/dropper.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=down": { "model": "dropper_vertical", "x": 180 }, + "facing=up": { "model": "dropper_vertical" }, + "facing=north": { "model": "dropper" }, + "facing=south": { "model": "dropper", "y": 180 }, + "facing=west": { "model": "dropper", "y": 270 }, + "facing=east": { "model": "dropper", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/emerald_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/emerald_block.json new file mode 100644 index 0000000..325f828 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/emerald_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "emerald_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/emerald_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/emerald_ore.json new file mode 100644 index 0000000..816e2b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/emerald_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "emerald_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/enchanting_table.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/enchanting_table.json new file mode 100644 index 0000000..3389236 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/enchanting_table.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "enchanting_table_base" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/end_portal_frame.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/end_portal_frame.json new file mode 100644 index 0000000..e44bada --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/end_portal_frame.json @@ -0,0 +1,12 @@ +{ + "variants": { + "eye=false,facing=south": { "model": "end_portal_frame_empty" }, + "eye=false,facing=west": { "model": "end_portal_frame_empty", "y": 90 }, + "eye=false,facing=north": { "model": "end_portal_frame_empty", "y": 180 }, + "eye=false,facing=east": { "model": "end_portal_frame_empty", "y": 270 }, + "eye=true,facing=south": { "model": "end_portal_frame_filled" }, + "eye=true,facing=west": { "model": "end_portal_frame_filled", "y": 90 }, + "eye=true,facing=north": { "model": "end_portal_frame_filled", "y": 180 }, + "eye=true,facing=east": { "model": "end_portal_frame_filled", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/end_stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/end_stone.json new file mode 100644 index 0000000..cdaef3b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/end_stone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "end_stone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/farmland.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/farmland.json new file mode 100644 index 0000000..7897855 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/farmland.json @@ -0,0 +1,12 @@ +{ + "variants": { + "moisture=0": { "model": "farmland_dry" }, + "moisture=1": { "model": "farmland_dry" }, + "moisture=2": { "model": "farmland_dry" }, + "moisture=3": { "model": "farmland_dry" }, + "moisture=4": { "model": "farmland_dry" }, + "moisture=5": { "model": "farmland_dry" }, + "moisture=6": { "model": "farmland_dry" }, + "moisture=7": { "model": "farmland_moist" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fence.json new file mode 100644 index 0000000..fc69adf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fence.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "oak_fence_post" }, + "east=false,north=true,south=false,west=false": { "model": "oak_fence_n", "uvlock": true }, + "east=true,north=false,south=false,west=false": { "model": "oak_fence_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=false": { "model": "oak_fence_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,west=true": { "model": "oak_fence_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,west=false": { "model": "oak_fence_ne", "uvlock": true }, + "east=true,north=false,south=true,west=false": { "model": "oak_fence_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=true": { "model": "oak_fence_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,west=true": { "model": "oak_fence_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,west=false": { "model": "oak_fence_ns", "uvlock": true }, + "east=true,north=false,south=false,west=true": { "model": "oak_fence_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,west=false": { "model": "oak_fence_nse", "uvlock": true }, + "east=true,north=false,south=true,west=true": { "model": "oak_fence_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,west=true": { "model": "oak_fence_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,west=true": { "model": "oak_fence_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,west=true": { "model": "oak_fence_nsew", "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fence_gate.json new file mode 100644 index 0000000..043d21e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fence_gate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "oak_fence_gate_closed" }, + "facing=west,in_wall=false,open=false": { "model": "oak_fence_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "oak_fence_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "oak_fence_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "oak_fence_gate_open" }, + "facing=west,in_wall=false,open=true": { "model": "oak_fence_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "oak_fence_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "oak_fence_gate_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "oak_wall_gate_closed" }, + "facing=west,in_wall=true,open=false": { "model": "oak_wall_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "oak_wall_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "oak_wall_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "oak_wall_gate_open" }, + "facing=west,in_wall=true,open=true": { "model": "oak_wall_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "oak_wall_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "oak_wall_gate_open", "y": 270, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fern.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fern.json new file mode 100644 index 0000000..bac4186 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fern.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "fern" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fire.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fire.json new file mode 100644 index 0000000..79fd5fe --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/fire.json @@ -0,0 +1,196 @@ +{ + "variants": { + "alt=false,east=false,flip=false,north=false,south=false,upper=0,west=false": { "model": "fire_floor_main" }, + "alt=false,east=false,flip=false,north=false,south=true,upper=0,west=false": { "model": "fire_n_main", "y": 180 }, + "alt=false,east=false,flip=false,north=false,south=false,upper=0,west=true": { "model": "fire_n_main", "y": 270 }, + "alt=false,east=false,flip=false,north=true,south=false,upper=0,west=false": { "model": "fire_n_main" }, + "alt=false,east=true,flip=false,north=false,south=false,upper=0,west=false": { "model": "fire_n_main", "y": 90 }, + "alt=false,east=true,flip=false,north=true,south=false,upper=0,west=false": { "model": "fire_ne_main" }, + "alt=false,east=true,flip=false,north=false,south=true,upper=0,west=false": { "model": "fire_ne_main", "y": 90 }, + "alt=false,east=false,flip=false,north=false,south=true,upper=0,west=true": { "model": "fire_ne_main", "y": 180 }, + "alt=false,east=false,flip=false,north=true,south=false,upper=0,west=true": { "model": "fire_ne_main", "y": 270 }, + "alt=false,east=false,flip=false,north=true,south=true,upper=0,west=false": { "model": "fire_ns_main" }, + "alt=false,east=true,flip=false,north=false,south=false,upper=0,west=true": { "model": "fire_ns_main", "y": 90 }, + "alt=false,east=true,flip=false,north=true,south=true,upper=0,west=false": { "model": "fire_nse_main" }, + "alt=false,east=true,flip=false,north=false,south=true,upper=0,west=true": { "model": "fire_nse_main", "y": 90 }, + "alt=false,east=false,flip=false,north=true,south=true,upper=0,west=true": { "model": "fire_nse_main", "y": 180 }, + "alt=false,east=true,flip=false,north=true,south=false,upper=0,west=true": { "model": "fire_nse_main", "y": 270 }, + "alt=false,east=true,flip=false,north=true,south=true,upper=0,west=true": { "model": "fire_nsew_main" }, + "alt=false,east=false,flip=false,north=false,south=false,upper=1,west=false": { "model": "fire_u1_main" }, + "alt=false,east=false,flip=false,north=false,south=true,upper=1,west=false": { "model": "fire_nu1_main", "y": 180 }, + "alt=false,east=false,flip=false,north=false,south=false,upper=1,west=true": { "model": "fire_nu1_main", "y": 270 }, + "alt=false,east=false,flip=false,north=true,south=false,upper=1,west=false": { "model": "fire_nu1_main" }, + "alt=false,east=true,flip=false,north=false,south=false,upper=1,west=false": { "model": "fire_nu1_main", "y": 90 }, + "alt=false,east=true,flip=false,north=true,south=false,upper=1,west=false": { "model": "fire_neu1_main" }, + "alt=false,east=true,flip=false,north=false,south=true,upper=1,west=false": { "model": "fire_neu1_main", "y": 90 }, + "alt=false,east=false,flip=false,north=false,south=true,upper=1,west=true": { "model": "fire_neu1_main", "y": 180 }, + "alt=false,east=false,flip=false,north=true,south=false,upper=1,west=true": { "model": "fire_neu1_main", "y": 270 }, + "alt=false,east=false,flip=false,north=true,south=true,upper=1,west=false": { "model": "fire_nsu1_main" }, + "alt=false,east=true,flip=false,north=false,south=false,upper=1,west=true": { "model": "fire_nsu1_main", "y": 90 }, + "alt=false,east=true,flip=false,north=true,south=true,upper=1,west=false": { "model": "fire_nseu1_main" }, + "alt=false,east=true,flip=false,north=false,south=true,upper=1,west=true": { "model": "fire_nseu1_main", "y": 90 }, + "alt=false,east=false,flip=false,north=true,south=true,upper=1,west=true": { "model": "fire_nseu1_main", "y": 180 }, + "alt=false,east=true,flip=false,north=true,south=false,upper=1,west=true": { "model": "fire_nseu1_main", "y": 270 }, + "alt=false,east=true,flip=false,north=true,south=true,upper=1,west=true": { "model": "fire_nsewu1_main" }, + "alt=false,east=false,flip=false,north=false,south=false,upper=2,west=false": { "model": "fire_u2_main" }, + "alt=false,east=false,flip=false,north=false,south=true,upper=2,west=false": { "model": "fire_nu2_main", "y": 180 }, + "alt=false,east=false,flip=false,north=false,south=false,upper=2,west=true": { "model": "fire_nu2_main", "y": 270 }, + "alt=false,east=false,flip=false,north=true,south=false,upper=2,west=false": { "model": "fire_nu2_main" }, + "alt=false,east=true,flip=false,north=false,south=false,upper=2,west=false": { "model": "fire_nu2_main", "y": 90 }, + "alt=false,east=true,flip=false,north=true,south=false,upper=2,west=false": { "model": "fire_neu2_main" }, + "alt=false,east=true,flip=false,north=false,south=true,upper=2,west=false": { "model": "fire_neu2_main", "y": 90 }, + "alt=false,east=false,flip=false,north=false,south=true,upper=2,west=true": { "model": "fire_neu2_main", "y": 180 }, + "alt=false,east=false,flip=false,north=true,south=false,upper=2,west=true": { "model": "fire_neu2_main", "y": 270 }, + "alt=false,east=false,flip=false,north=true,south=true,upper=2,west=false": { "model": "fire_nsu2_main" }, + "alt=false,east=true,flip=false,north=false,south=false,upper=2,west=true": { "model": "fire_nsu2_main", "y": 90 }, + "alt=false,east=true,flip=false,north=true,south=true,upper=2,west=false": { "model": "fire_nseu2_main" }, + "alt=false,east=true,flip=false,north=false,south=true,upper=2,west=true": { "model": "fire_nseu2_main", "y": 90 }, + "alt=false,east=false,flip=false,north=true,south=true,upper=2,west=true": { "model": "fire_nseu2_main", "y": 180 }, + "alt=false,east=true,flip=false,north=true,south=false,upper=2,west=true": { "model": "fire_nseu2_main", "y": 270 }, + "alt=false,east=true,flip=false,north=true,south=true,upper=2,west=true": { "model": "fire_nsewu2_main" }, + "alt=true,east=false,flip=false,north=false,south=false,upper=0,west=false": { "model": "fire_floor_main" }, + "alt=true,east=false,flip=false,north=false,south=true,upper=0,west=false": { "model": "fire_n_alt", "y": 180 }, + "alt=true,east=false,flip=false,north=false,south=false,upper=0,west=true": { "model": "fire_n_alt", "y": 270 }, + "alt=true,east=false,flip=false,north=true,south=false,upper=0,west=false": { "model": "fire_n_alt" }, + "alt=true,east=true,flip=false,north=false,south=false,upper=0,west=false": { "model": "fire_n_alt", "y": 90 }, + "alt=true,east=true,flip=false,north=true,south=false,upper=0,west=false": { "model": "fire_ne_alt" }, + "alt=true,east=true,flip=false,north=false,south=true,upper=0,west=false": { "model": "fire_ne_alt", "y": 90 }, + "alt=true,east=false,flip=false,north=false,south=true,upper=0,west=true": { "model": "fire_ne_alt", "y": 180 }, + "alt=true,east=false,flip=false,north=true,south=false,upper=0,west=true": { "model": "fire_ne_alt", "y": 270 }, + "alt=true,east=false,flip=false,north=true,south=true,upper=0,west=false": { "model": "fire_ns_alt" }, + "alt=true,east=true,flip=false,north=false,south=false,upper=0,west=true": { "model": "fire_ns_alt", "y": 90 }, + "alt=true,east=true,flip=false,north=true,south=true,upper=0,west=false": { "model": "fire_nse_alt" }, + "alt=true,east=true,flip=false,north=false,south=true,upper=0,west=true": { "model": "fire_nse_alt", "y": 90 }, + "alt=true,east=false,flip=false,north=true,south=true,upper=0,west=true": { "model": "fire_nse_alt", "y": 180 }, + "alt=true,east=true,flip=false,north=true,south=false,upper=0,west=true": { "model": "fire_nse_alt", "y": 270 }, + "alt=true,east=true,flip=false,north=true,south=true,upper=0,west=true": { "model": "fire_nsew_alt" }, + "alt=true,east=false,flip=false,north=false,south=false,upper=1,west=false": { "model": "fire_u1_main" }, + "alt=true,east=false,flip=false,north=false,south=true,upper=1,west=false": { "model": "fire_nu1_alt", "y": 180 }, + "alt=true,east=false,flip=false,north=false,south=false,upper=1,west=true": { "model": "fire_nu1_alt", "y": 270 }, + "alt=true,east=false,flip=false,north=true,south=false,upper=1,west=false": { "model": "fire_nu1_alt" }, + "alt=true,east=true,flip=false,north=false,south=false,upper=1,west=false": { "model": "fire_nu1_alt", "y": 90 }, + "alt=true,east=true,flip=false,north=true,south=false,upper=1,west=false": { "model": "fire_neu1_alt" }, + "alt=true,east=true,flip=false,north=false,south=true,upper=1,west=false": { "model": "fire_neu1_alt", "y": 90 }, + "alt=true,east=false,flip=false,north=false,south=true,upper=1,west=true": { "model": "fire_neu1_alt", "y": 180 }, + "alt=true,east=false,flip=false,north=true,south=false,upper=1,west=true": { "model": "fire_neu1_alt", "y": 270 }, + "alt=true,east=false,flip=false,north=true,south=true,upper=1,west=false": { "model": "fire_nsu1_alt" }, + "alt=true,east=true,flip=false,north=false,south=false,upper=1,west=true": { "model": "fire_nsu1_alt", "y": 90 }, + "alt=true,east=true,flip=false,north=true,south=true,upper=1,west=false": { "model": "fire_nseu1_alt" }, + "alt=true,east=true,flip=false,north=false,south=true,upper=1,west=true": { "model": "fire_nseu1_alt", "y": 90 }, + "alt=true,east=false,flip=false,north=true,south=true,upper=1,west=true": { "model": "fire_nseu1_alt", "y": 180 }, + "alt=true,east=true,flip=false,north=true,south=false,upper=1,west=true": { "model": "fire_nseu1_alt", "y": 270 }, + "alt=true,east=true,flip=false,north=true,south=true,upper=1,west=true": { "model": "fire_nsewu1_alt" }, + "alt=true,east=false,flip=false,north=false,south=false,upper=2,west=false": { "model": "fire_u2_main" }, + "alt=true,east=false,flip=false,north=false,south=true,upper=2,west=false": { "model": "fire_nu2_alt", "y": 180 }, + "alt=true,east=false,flip=false,north=false,south=false,upper=2,west=true": { "model": "fire_nu2_alt", "y": 270 }, + "alt=true,east=false,flip=false,north=true,south=false,upper=2,west=false": { "model": "fire_nu2_alt" }, + "alt=true,east=true,flip=false,north=false,south=false,upper=2,west=false": { "model": "fire_nu2_alt", "y": 90 }, + "alt=true,east=true,flip=false,north=true,south=false,upper=2,west=false": { "model": "fire_neu2_alt" }, + "alt=true,east=true,flip=false,north=false,south=true,upper=2,west=false": { "model": "fire_neu2_alt", "y": 90 }, + "alt=true,east=false,flip=false,north=false,south=true,upper=2,west=true": { "model": "fire_neu2_alt", "y": 180 }, + "alt=true,east=false,flip=false,north=true,south=false,upper=2,west=true": { "model": "fire_neu2_alt", "y": 270 }, + "alt=true,east=false,flip=false,north=true,south=true,upper=2,west=false": { "model": "fire_nsu2_alt" }, + "alt=true,east=true,flip=false,north=false,south=false,upper=2,west=true": { "model": "fire_nsu2_alt", "y": 90 }, + "alt=true,east=true,flip=false,north=true,south=true,upper=2,west=false": { "model": "fire_nseu2_alt" }, + "alt=true,east=true,flip=false,north=false,south=true,upper=2,west=true": { "model": "fire_nseu2_alt", "y": 90 }, + "alt=true,east=false,flip=false,north=true,south=true,upper=2,west=true": { "model": "fire_nseu2_alt", "y": 180 }, + "alt=true,east=true,flip=false,north=true,south=false,upper=2,west=true": { "model": "fire_nseu2_alt", "y": 270 }, + "alt=true,east=true,flip=false,north=true,south=true,upper=2,west=true": { "model": "fire_nsewu2_alt" }, + "alt=false,east=false,flip=true,north=false,south=false,upper=0,west=false": { "model": "fire_floor_main" }, + "alt=false,east=false,flip=true,north=false,south=true,upper=0,west=false": { "model": "fire_n_flip_main", "y": 180 }, + "alt=false,east=false,flip=true,north=false,south=false,upper=0,west=true": { "model": "fire_n_flip_main", "y": 270 }, + "alt=false,east=false,flip=true,north=true,south=false,upper=0,west=false": { "model": "fire_n_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=false,upper=0,west=false": { "model": "fire_n_flip_main", "y": 90 }, + "alt=false,east=true,flip=true,north=true,south=false,upper=0,west=false": { "model": "fire_ne_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=true,upper=0,west=false": { "model": "fire_ne_flip_main", "y": 90 }, + "alt=false,east=false,flip=true,north=false,south=true,upper=0,west=true": { "model": "fire_ne_flip_main", "y": 180 }, + "alt=false,east=false,flip=true,north=true,south=false,upper=0,west=true": { "model": "fire_ne_flip_main", "y": 270 }, + "alt=false,east=false,flip=true,north=true,south=true,upper=0,west=false": { "model": "fire_ns_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=false,upper=0,west=true": { "model": "fire_ns_flip_main", "y": 90 }, + "alt=false,east=true,flip=true,north=true,south=true,upper=0,west=false": { "model": "fire_nse_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=true,upper=0,west=true": { "model": "fire_nse_flip_main", "y": 90 }, + "alt=false,east=false,flip=true,north=true,south=true,upper=0,west=true": { "model": "fire_nse_flip_main", "y": 180 }, + "alt=false,east=true,flip=true,north=true,south=false,upper=0,west=true": { "model": "fire_nse_flip_main", "y": 270 }, + "alt=false,east=true,flip=true,north=true,south=true,upper=0,west=true": { "model": "fire_nsew_flip_main" }, + "alt=false,east=false,flip=true,north=false,south=false,upper=1,west=false": { "model": "fire_u1_main" }, + "alt=false,east=false,flip=true,north=false,south=true,upper=1,west=false": { "model": "fire_nu1_flip_main", "y": 180 }, + "alt=false,east=false,flip=true,north=false,south=false,upper=1,west=true": { "model": "fire_nu1_flip_main", "y": 270 }, + "alt=false,east=false,flip=true,north=true,south=false,upper=1,west=false": { "model": "fire_nu1_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=false,upper=1,west=false": { "model": "fire_nu1_flip_main", "y": 90 }, + "alt=false,east=true,flip=true,north=true,south=false,upper=1,west=false": { "model": "fire_neu1_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=true,upper=1,west=false": { "model": "fire_neu1_flip_main", "y": 90 }, + "alt=false,east=false,flip=true,north=false,south=true,upper=1,west=true": { "model": "fire_neu1_flip_main", "y": 180 }, + "alt=false,east=false,flip=true,north=true,south=false,upper=1,west=true": { "model": "fire_neu1_flip_main", "y": 270 }, + "alt=false,east=false,flip=true,north=true,south=true,upper=1,west=false": { "model": "fire_nsu1_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=false,upper=1,west=true": { "model": "fire_nsu1_flip_main", "y": 90 }, + "alt=false,east=true,flip=true,north=true,south=true,upper=1,west=false": { "model": "fire_nseu1_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=true,upper=1,west=true": { "model": "fire_nseu1_flip_main", "y": 90 }, + "alt=false,east=false,flip=true,north=true,south=true,upper=1,west=true": { "model": "fire_nseu1_flip_main", "y": 180 }, + "alt=false,east=true,flip=true,north=true,south=false,upper=1,west=true": { "model": "fire_nseu1_flip_main", "y": 270 }, + "alt=false,east=true,flip=true,north=true,south=true,upper=1,west=true": { "model": "fire_nsewu1_flip_main" }, + "alt=false,east=false,flip=true,north=false,south=false,upper=2,west=false": { "model": "fire_u2_main" }, + "alt=false,east=false,flip=true,north=false,south=true,upper=2,west=false": { "model": "fire_nu2_flip_main", "y": 180 }, + "alt=false,east=false,flip=true,north=false,south=false,upper=2,west=true": { "model": "fire_nu2_flip_main", "y": 270 }, + "alt=false,east=false,flip=true,north=true,south=false,upper=2,west=false": { "model": "fire_nu2_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=false,upper=2,west=false": { "model": "fire_nu2_flip_main", "y": 90 }, + "alt=false,east=true,flip=true,north=true,south=false,upper=2,west=false": { "model": "fire_neu2_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=true,upper=2,west=false": { "model": "fire_neu2_flip_main", "y": 90 }, + "alt=false,east=false,flip=true,north=false,south=true,upper=2,west=true": { "model": "fire_neu2_flip_main", "y": 180 }, + "alt=false,east=false,flip=true,north=true,south=false,upper=2,west=true": { "model": "fire_neu2_flip_main", "y": 270 }, + "alt=false,east=false,flip=true,north=true,south=true,upper=2,west=false": { "model": "fire_nsu2_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=false,upper=2,west=true": { "model": "fire_nsu2_flip_main", "y": 90 }, + "alt=false,east=true,flip=true,north=true,south=true,upper=2,west=false": { "model": "fire_nseu2_flip_main" }, + "alt=false,east=true,flip=true,north=false,south=true,upper=2,west=true": { "model": "fire_nseu2_flip_main", "y": 90 }, + "alt=false,east=false,flip=true,north=true,south=true,upper=2,west=true": { "model": "fire_nseu2_flip_main", "y": 180 }, + "alt=false,east=true,flip=true,north=true,south=false,upper=2,west=true": { "model": "fire_nseu2_flip_main", "y": 270 }, + "alt=false,east=true,flip=true,north=true,south=true,upper=2,west=true": { "model": "fire_nsewu2_flip_main" }, + "alt=true,east=false,flip=true,north=false,south=false,upper=0,west=false": { "model": "fire_floor_main" }, + "alt=true,east=false,flip=true,north=false,south=true,upper=0,west=false": { "model": "fire_n_alt_flip", "y": 180 }, + "alt=true,east=false,flip=true,north=false,south=false,upper=0,west=true": { "model": "fire_n_alt_flip", "y": 270 }, + "alt=true,east=false,flip=true,north=true,south=false,upper=0,west=false": { "model": "fire_n_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=false,upper=0,west=false": { "model": "fire_n_alt_flip", "y": 90 }, + "alt=true,east=true,flip=true,north=true,south=false,upper=0,west=false": { "model": "fire_ne_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=true,upper=0,west=false": { "model": "fire_ne_alt_flip", "y": 90 }, + "alt=true,east=false,flip=true,north=false,south=true,upper=0,west=true": { "model": "fire_ne_alt_flip", "y": 180 }, + "alt=true,east=false,flip=true,north=true,south=false,upper=0,west=true": { "model": "fire_ne_alt_flip", "y": 270 }, + "alt=true,east=false,flip=true,north=true,south=true,upper=0,west=false": { "model": "fire_ns_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=false,upper=0,west=true": { "model": "fire_ns_alt_flip", "y": 90 }, + "alt=true,east=true,flip=true,north=true,south=true,upper=0,west=false": { "model": "fire_nse_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=true,upper=0,west=true": { "model": "fire_nse_alt_flip", "y": 90 }, + "alt=true,east=false,flip=true,north=true,south=true,upper=0,west=true": { "model": "fire_nse_alt_flip", "y": 180 }, + "alt=true,east=true,flip=true,north=true,south=false,upper=0,west=true": { "model": "fire_nse_alt_flip", "y": 270 }, + "alt=true,east=true,flip=true,north=true,south=true,upper=0,west=true": { "model": "fire_nsew_alt_flip" }, + "alt=true,east=false,flip=true,north=false,south=false,upper=1,west=false": { "model": "fire_u1_main" }, + "alt=true,east=false,flip=true,north=false,south=true,upper=1,west=false": { "model": "fire_nu1_alt_flip", "y": 180 }, + "alt=true,east=false,flip=true,north=false,south=false,upper=1,west=true": { "model": "fire_nu1_alt_flip", "y": 270 }, + "alt=true,east=false,flip=true,north=true,south=false,upper=1,west=false": { "model": "fire_nu1_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=false,upper=1,west=false": { "model": "fire_nu1_alt_flip", "y": 90 }, + "alt=true,east=true,flip=true,north=true,south=false,upper=1,west=false": { "model": "fire_neu1_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=true,upper=1,west=false": { "model": "fire_neu1_alt_flip", "y": 90 }, + "alt=true,east=false,flip=true,north=false,south=true,upper=1,west=true": { "model": "fire_neu1_alt_flip", "y": 180 }, + "alt=true,east=false,flip=true,north=true,south=false,upper=1,west=true": { "model": "fire_neu1_alt_flip", "y": 270 }, + "alt=true,east=false,flip=true,north=true,south=true,upper=1,west=false": { "model": "fire_nsu1_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=false,upper=1,west=true": { "model": "fire_nsu1_alt_flip", "y": 90 }, + "alt=true,east=true,flip=true,north=true,south=true,upper=1,west=false": { "model": "fire_nseu1_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=true,upper=1,west=true": { "model": "fire_nseu1_alt_flip", "y": 90 }, + "alt=true,east=false,flip=true,north=true,south=true,upper=1,west=true": { "model": "fire_nseu1_alt_flip", "y": 180 }, + "alt=true,east=true,flip=true,north=true,south=false,upper=1,west=true": { "model": "fire_nseu1_alt_flip", "y": 270 }, + "alt=true,east=true,flip=true,north=true,south=true,upper=1,west=true": { "model": "fire_nsewu1_alt_flip" }, + "alt=true,east=false,flip=true,north=false,south=false,upper=2,west=false": { "model": "fire_u2_main" }, + "alt=true,east=false,flip=true,north=false,south=true,upper=2,west=false": { "model": "fire_nu2_alt_flip", "y": 180 }, + "alt=true,east=false,flip=true,north=false,south=false,upper=2,west=true": { "model": "fire_nu2_alt_flip", "y": 270 }, + "alt=true,east=false,flip=true,north=true,south=false,upper=2,west=false": { "model": "fire_nu2_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=false,upper=2,west=false": { "model": "fire_nu2_alt_flip", "y": 90 }, + "alt=true,east=true,flip=true,north=true,south=false,upper=2,west=false": { "model": "fire_neu2_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=true,upper=2,west=false": { "model": "fire_neu2_alt_flip", "y": 90 }, + "alt=true,east=false,flip=true,north=false,south=true,upper=2,west=true": { "model": "fire_neu2_alt_flip", "y": 180 }, + "alt=true,east=false,flip=true,north=true,south=false,upper=2,west=true": { "model": "fire_neu2_alt_flip", "y": 270 }, + "alt=true,east=false,flip=true,north=true,south=true,upper=2,west=false": { "model": "fire_nsu2_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=false,upper=2,west=true": { "model": "fire_nsu2_alt_flip", "y": 90 }, + "alt=true,east=true,flip=true,north=true,south=true,upper=2,west=false": { "model": "fire_nseu2_alt_flip" }, + "alt=true,east=true,flip=true,north=false,south=true,upper=2,west=true": { "model": "fire_nseu2_alt_flip", "y": 90 }, + "alt=true,east=false,flip=true,north=true,south=true,upper=2,west=true": { "model": "fire_nseu2_alt_flip", "y": 180 }, + "alt=true,east=true,flip=true,north=true,south=false,upper=2,west=true": { "model": "fire_nseu2_alt_flip", "y": 270 }, + "alt=true,east=true,flip=true,north=true,south=true,upper=2,west=true": { "model": "fire_nsewu2_alt_flip" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/flower_pot.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/flower_pot.json new file mode 100644 index 0000000..0658f2e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/flower_pot.json @@ -0,0 +1,26 @@ +{ + "variants": { + "contents=empty": { "model": "flower_pot" }, + "contents=rose": { "model": "flower_pot_rose" }, + "contents=blue_orchid": { "model": "flower_pot_orchid" }, + "contents=allium": { "model": "flower_pot_allium" }, + "contents=houstonia": { "model": "flower_pot_houstonia" }, + "contents=red_tulip": { "model": "flower_pot_tulip_red" }, + "contents=orange_tulip": { "model": "flower_pot_tulip_orange" }, + "contents=white_tulip": { "model": "flower_pot_tulip_white" }, + "contents=pink_tulip": { "model": "flower_pot_tulip_pink" }, + "contents=oxeye_daisy": { "model": "flower_pot_daisy" }, + "contents=dandelion": { "model": "flower_pot_dandelion" }, + "contents=oak_sapling": { "model": "flower_pot_oak" }, + "contents=spruce_sapling": { "model": "flower_pot_spruce" }, + "contents=birch_sapling": { "model": "flower_pot_birch" }, + "contents=jungle_sapling": { "model": "flower_pot_jungle" }, + "contents=acacia_sapling": { "model": "flower_pot_acacia" }, + "contents=dark_oak_sapling": { "model": "flower_pot_dark_oak" }, + "contents=mushroom_red": { "model": "flower_pot_mushroom_red" }, + "contents=mushroom_brown": { "model": "flower_pot_mushroom_brown" }, + "contents=dead_bush": { "model": "flower_pot_dead_bush" }, + "contents=fern": { "model": "flower_pot_fern" }, + "contents=cactus": { "model": "flower_pot_cactus" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/furnace.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/furnace.json new file mode 100644 index 0000000..7d68539 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/furnace.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "furnace" }, + "facing=south": { "model": "furnace", "y": 180 }, + "facing=west": { "model": "furnace", "y": 270 }, + "facing=east": { "model": "furnace", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glass.json new file mode 100644 index 0000000..21f793e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glass_pane.json new file mode 100644 index 0000000..c5abaf3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "glass_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "glass_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "glass_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "glass_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "glass_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "glass_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "glass_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "glass_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "glass_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "glass_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "glass_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "glass_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "glass_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "glass_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "glass_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "glass_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glowstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glowstone.json new file mode 100644 index 0000000..bb47454 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/glowstone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glowstone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gold_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gold_block.json new file mode 100644 index 0000000..3845d23 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gold_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "gold_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gold_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gold_ore.json new file mode 100644 index 0000000..ce4930d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gold_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "gold_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/golden_rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/golden_rail.json new file mode 100644 index 0000000..ca4cb41 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/golden_rail.json @@ -0,0 +1,16 @@ +{ + "variants": { + "powered=false,shape=north_south": { "model": "golden_rail_flat" }, + "powered=false,shape=east_west": { "model": "golden_rail_flat", "y": 90 }, + "powered=false,shape=ascending_east": { "model": "golden_rail_raised_ne", "y": 90 }, + "powered=false,shape=ascending_west": { "model": "golden_rail_raised_sw", "y": 90 }, + "powered=false,shape=ascending_north": { "model": "golden_rail_raised_ne" }, + "powered=false,shape=ascending_south": { "model": "golden_rail_raised_sw" }, + "powered=true,shape=north_south": { "model": "golden_rail_active_flat" }, + "powered=true,shape=east_west": { "model": "golden_rail_active_flat", "y": 90 }, + "powered=true,shape=ascending_east": { "model": "golden_rail_active_raised_ne", "y": 90 }, + "powered=true,shape=ascending_west": { "model": "golden_rail_active_raised_sw", "y": 90 }, + "powered=true,shape=ascending_north": { "model": "golden_rail_active_raised_ne" }, + "powered=true,shape=ascending_south": { "model": "golden_rail_active_raised_sw" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/granite.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/granite.json new file mode 100644 index 0000000..d1cb8c1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/granite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "granite" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/grass.json new file mode 100644 index 0000000..e9576b4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/grass.json @@ -0,0 +1,11 @@ +{ + "variants": { + "snowy=false": [ + { "model": "grass_normal" }, + { "model": "grass_normal", "y": 90 }, + { "model": "grass_normal", "y": 180 }, + { "model": "grass_normal", "y": 270 } + ], + "snowy=true": { "model": "grass_snowed" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gravel.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gravel.json new file mode 100644 index 0000000..6cbcc83 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gravel.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "gravel" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_carpet.json new file mode 100644 index 0000000..fb48eae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_gray" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_glass.json new file mode 100644 index 0000000..9163453 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_gray" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_glass_pane.json new file mode 100644 index 0000000..44b34c0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "gray_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "gray_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "gray_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "gray_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "gray_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "gray_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "gray_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "gray_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "gray_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "gray_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "gray_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "gray_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "gray_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "gray_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "gray_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "gray_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_hardened_clay.json new file mode 100644 index 0000000..272d95b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_gray" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_wool.json new file mode 100644 index 0000000..7c90870 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/gray_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "gray_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_carpet.json new file mode 100644 index 0000000..265b564 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_green" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_glass.json new file mode 100644 index 0000000..e7bc0f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_green" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_glass_pane.json new file mode 100644 index 0000000..ab26b0b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "green_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "green_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "green_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "green_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "green_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "green_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "green_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "green_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "green_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "green_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "green_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "green_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "green_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "green_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "green_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "green_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_hardened_clay.json new file mode 100644 index 0000000..6fb1f6c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_green" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_wool.json new file mode 100644 index 0000000..34d84e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/green_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "green_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hardened_clay.json new file mode 100644 index 0000000..cb38687 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hay_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hay_block.json new file mode 100644 index 0000000..a9d77c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hay_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "axis=y": { "model": "hay" }, + "axis=z": { "model": "hay_side" }, + "axis=x": { "model": "hay_side", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/heavy_weighted_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/heavy_weighted_pressure_plate.json new file mode 100644 index 0000000..11e524c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/heavy_weighted_pressure_plate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "power=0": { "model": "heavy_pressure_plate_up" }, + "power=1": { "model": "heavy_pressure_plate_down" }, + "power=2": { "model": "heavy_pressure_plate_down" }, + "power=3": { "model": "heavy_pressure_plate_down" }, + "power=4": { "model": "heavy_pressure_plate_down" }, + "power=5": { "model": "heavy_pressure_plate_down" }, + "power=6": { "model": "heavy_pressure_plate_down" }, + "power=7": { "model": "heavy_pressure_plate_down" }, + "power=8": { "model": "heavy_pressure_plate_down" }, + "power=9": { "model": "heavy_pressure_plate_down" }, + "power=10": { "model": "heavy_pressure_plate_down" }, + "power=11": { "model": "heavy_pressure_plate_down" }, + "power=12": { "model": "heavy_pressure_plate_down" }, + "power=13": { "model": "heavy_pressure_plate_down" }, + "power=14": { "model": "heavy_pressure_plate_down" }, + "power=15": { "model": "heavy_pressure_plate_down" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hopper.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hopper.json new file mode 100644 index 0000000..24f5305 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/hopper.json @@ -0,0 +1,9 @@ +{ + "variants": { + "facing=down": { "model": "hopper_down" }, + "facing=north": { "model": "hopper_side" }, + "facing=south": { "model": "hopper_side", "y": 180 }, + "facing=west": { "model": "hopper_side", "y": 270 }, + "facing=east": { "model": "hopper_side", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/houstonia.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/houstonia.json new file mode 100644 index 0000000..655ba02 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/houstonia.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "houstonia" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/ice.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/ice.json new file mode 100644 index 0000000..8012231 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/ice.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "ice" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_bars.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_bars.json new file mode 100644 index 0000000..38751df --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_bars.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "bars_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "bars_n" }, + "east=true,north=false,south=false,west=false": { "model": "bars_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "bars_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "bars_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "bars_ne" }, + "east=true,north=false,south=true,west=false": { "model": "bars_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "bars_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "bars_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "bars_ns" }, + "east=true,north=false,south=false,west=true": { "model": "bars_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "bars_nse" }, + "east=true,north=false,south=true,west=true": { "model": "bars_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "bars_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "bars_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "bars_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_block.json new file mode 100644 index 0000000..eca5c0d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "iron_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_door.json new file mode 100644 index 0000000..ceb809e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_door.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "iron_door_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "iron_door_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "iron_door_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "iron_door_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "iron_door_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "iron_door_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "iron_door_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "iron_door_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "iron_door_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "iron_door_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "iron_door_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "iron_door_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "iron_door_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "iron_door_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "iron_door_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "iron_door_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "iron_door_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "iron_door_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "iron_door_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "iron_door_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "iron_door_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "iron_door_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "iron_door_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "iron_door_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "iron_door_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "iron_door_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "iron_door_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "iron_door_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "iron_door_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "iron_door_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "iron_door_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "iron_door_top", "y": 180 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_ore.json new file mode 100644 index 0000000..3365f5e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "iron_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_trapdoor.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_trapdoor.json new file mode 100644 index 0000000..13c116e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/iron_trapdoor.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=north,half=bottom,open=false": { "model": "iron_trapdoor_bottom" }, + "facing=south,half=bottom,open=false": { "model": "iron_trapdoor_bottom" }, + "facing=east,half=bottom,open=false": { "model": "iron_trapdoor_bottom" }, + "facing=west,half=bottom,open=false": { "model": "iron_trapdoor_bottom" }, + "facing=north,half=top,open=false": { "model": "iron_trapdoor_top" }, + "facing=south,half=top,open=false": { "model": "iron_trapdoor_top" }, + "facing=east,half=top,open=false": { "model": "iron_trapdoor_top" }, + "facing=west,half=top,open=false": { "model": "iron_trapdoor_top" }, + "facing=north,half=bottom,open=true": { "model": "iron_trapdoor_open" }, + "facing=south,half=bottom,open=true": { "model": "iron_trapdoor_open", "y": 180 }, + "facing=east,half=bottom,open=true": { "model": "iron_trapdoor_open", "y": 90 }, + "facing=west,half=bottom,open=true": { "model": "iron_trapdoor_open", "y": 270 }, + "facing=north,half=top,open=true": { "model": "iron_trapdoor_open" }, + "facing=south,half=top,open=true": { "model": "iron_trapdoor_open", "y": 180 }, + "facing=east,half=top,open=true": { "model": "iron_trapdoor_open", "y": 90 }, + "facing=west,half=top,open=true": { "model": "iron_trapdoor_open", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/item_frame.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/item_frame.json new file mode 100644 index 0000000..b7bbebb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/item_frame.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "item_frame" }, + "map": { "model": "item_frame_map" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jukebox.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jukebox.json new file mode 100644 index 0000000..6e6d0da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jukebox.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "jukebox" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_door.json new file mode 100644 index 0000000..5988133 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_door.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "jungle_door_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "jungle_door_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "jungle_door_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "jungle_door_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "jungle_door_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "jungle_door_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "jungle_door_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "jungle_door_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "jungle_door_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "jungle_door_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "jungle_door_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "jungle_door_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "jungle_door_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "jungle_door_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "jungle_door_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "jungle_door_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "jungle_door_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "jungle_door_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "jungle_door_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "jungle_door_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "jungle_door_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "jungle_door_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "jungle_door_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "jungle_door_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "jungle_door_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "jungle_door_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "jungle_door_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "jungle_door_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "jungle_door_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "jungle_door_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "jungle_door_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "jungle_door_top", "y": 180 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_double_slab.json new file mode 100644 index 0000000..5c863ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_double_slab.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "jungle_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_fence.json new file mode 100644 index 0000000..6709e58 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_fence.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "jungle_fence_post" }, + "east=false,north=true,south=false,west=false": { "model": "jungle_fence_n", "uvlock": true }, + "east=true,north=false,south=false,west=false": { "model": "jungle_fence_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=false": { "model": "jungle_fence_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,west=true": { "model": "jungle_fence_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,west=false": { "model": "jungle_fence_ne", "uvlock": true }, + "east=true,north=false,south=true,west=false": { "model": "jungle_fence_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=true": { "model": "jungle_fence_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,west=true": { "model": "jungle_fence_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,west=false": { "model": "jungle_fence_ns", "uvlock": true }, + "east=true,north=false,south=false,west=true": { "model": "jungle_fence_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,west=false": { "model": "jungle_fence_nse", "uvlock": true }, + "east=true,north=false,south=true,west=true": { "model": "jungle_fence_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,west=true": { "model": "jungle_fence_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,west=true": { "model": "jungle_fence_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,west=true": { "model": "jungle_fence_nsew", "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_fence_gate.json new file mode 100644 index 0000000..c82ebd1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_fence_gate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "jungle_fence_gate_closed" }, + "facing=west,in_wall=false,open=false": { "model": "jungle_fence_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "jungle_fence_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "jungle_fence_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "jungle_fence_gate_open" }, + "facing=west,in_wall=false,open=true": { "model": "jungle_fence_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "jungle_fence_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "jungle_fence_gate_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "jungle_wall_gate_closed" }, + "facing=west,in_wall=true,open=false": { "model": "jungle_wall_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "jungle_wall_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "jungle_wall_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "jungle_wall_gate_open" }, + "facing=west,in_wall=true,open=true": { "model": "jungle_wall_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "jungle_wall_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "jungle_wall_gate_open", "y": 270, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_leaves.json new file mode 100644 index 0000000..e1f30d9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_leaves.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "jungle_leaves" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_log.json new file mode 100644 index 0000000..e710e2f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_log.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "jungle_log" }, + "axis=z": { "model": "jungle_log_side" }, + "axis=x": { "model": "jungle_log_side", "y": 90 }, + "axis=none": { "model": "jungle_bark" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_planks.json new file mode 100644 index 0000000..5c863ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_planks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "jungle_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_sapling.json new file mode 100644 index 0000000..5439171 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_sapling.json @@ -0,0 +1,6 @@ +{ + "variants": { + "stage=0": { "model": "jungle_sapling" }, + "stage=1": { "model": "jungle_sapling" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_slab.json new file mode 100644 index 0000000..07b026f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_jungle" }, + "half=top": { "model": "upper_slab_jungle" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_stairs.json new file mode 100644 index 0000000..18f8c10 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/jungle_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "jungle_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "jungle_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "jungle_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "jungle_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "jungle_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "jungle_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "jungle_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "jungle_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "jungle_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "jungle_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "jungle_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "jungle_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "jungle_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "jungle_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "jungle_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "jungle_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "jungle_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "jungle_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "jungle_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "jungle_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "jungle_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "jungle_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "jungle_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "jungle_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "jungle_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "jungle_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "jungle_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "jungle_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "jungle_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "jungle_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "jungle_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "jungle_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "jungle_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "jungle_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "jungle_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "jungle_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "jungle_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "jungle_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "jungle_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "jungle_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/ladder.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/ladder.json new file mode 100644 index 0000000..8e6c6d6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/ladder.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "ladder" }, + "facing=east": { "model": "ladder", "y": 90 }, + "facing=south": { "model": "ladder", "y": 180 }, + "facing=west": { "model": "ladder", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lapis_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lapis_block.json new file mode 100644 index 0000000..1421db7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lapis_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "lapis_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lapis_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lapis_ore.json new file mode 100644 index 0000000..2ab096e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lapis_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "lapis_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lever.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lever.json new file mode 100644 index 0000000..5678f68 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lever.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=down_z,powered=false": { "model": "lever_off", "x": 180, "y": 180 }, + "facing=down_x,powered=false": { "model": "lever_off", "x": 180, "y": 90 }, + "facing=up_z,powered=false": { "model": "lever_off" }, + "facing=up_x,powered=false": { "model": "lever_off", "y": 270 }, + "facing=east,powered=false": { "model": "lever_off", "x": 90, "y": 90 }, + "facing=west,powered=false": { "model": "lever_off", "x": 90, "y": 270 }, + "facing=south,powered=false" : { "model": "lever_off", "x": 90, "y": 180 }, + "facing=north,powered=false" : { "model": "lever_off", "x": 90 }, + "facing=down_z,powered=true" : { "model": "lever", "x": 180, "y": 180 }, + "facing=down_x,powered=true" : { "model": "lever", "x": 180, "y": 90 }, + "facing=up_z,powered=true": { "model": "lever" }, + "facing=up_x,powered=true": { "model": "lever", "y": 270 }, + "facing=east,powered=true": { "model": "lever", "x": 90, "y": 90 }, + "facing=west,powered=true": { "model": "lever", "x": 90, "y": 270 }, + "facing=south,powered=true": { "model": "lever", "x": 90, "y": 180 }, + "facing=north,powered=true": { "model": "lever", "x": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_carpet.json new file mode 100644 index 0000000..4337685 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_light_blue" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_glass.json new file mode 100644 index 0000000..ddea4a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_light_blue" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_glass_pane.json new file mode 100644 index 0000000..db0f43e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "light_blue_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "light_blue_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "light_blue_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "light_blue_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "light_blue_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "light_blue_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "light_blue_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "light_blue_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "light_blue_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "light_blue_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "light_blue_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "light_blue_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "light_blue_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "light_blue_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "light_blue_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "light_blue_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_hardened_clay.json new file mode 100644 index 0000000..f579a42 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_light_blue" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_wool.json new file mode 100644 index 0000000..018e28f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_blue_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "light_blue_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_weighted_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_weighted_pressure_plate.json new file mode 100644 index 0000000..0d07c34 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/light_weighted_pressure_plate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "power=0": { "model": "light_pressure_plate_up" }, + "power=1": { "model": "light_pressure_plate_down" }, + "power=2": { "model": "light_pressure_plate_down" }, + "power=3": { "model": "light_pressure_plate_down" }, + "power=4": { "model": "light_pressure_plate_down" }, + "power=5": { "model": "light_pressure_plate_down" }, + "power=6": { "model": "light_pressure_plate_down" }, + "power=7": { "model": "light_pressure_plate_down" }, + "power=8": { "model": "light_pressure_plate_down" }, + "power=9": { "model": "light_pressure_plate_down" }, + "power=10": { "model": "light_pressure_plate_down" }, + "power=11": { "model": "light_pressure_plate_down" }, + "power=12": { "model": "light_pressure_plate_down" }, + "power=13": { "model": "light_pressure_plate_down" }, + "power=14": { "model": "light_pressure_plate_down" }, + "power=15": { "model": "light_pressure_plate_down" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_carpet.json new file mode 100644 index 0000000..f9ac304 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_lime" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_glass.json new file mode 100644 index 0000000..8f747f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_lime" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_glass_pane.json new file mode 100644 index 0000000..27fc677 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "lime_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "lime_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "lime_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "lime_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "lime_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "lime_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "lime_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "lime_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "lime_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "lime_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "lime_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "lime_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "lime_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "lime_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "lime_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "lime_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_hardened_clay.json new file mode 100644 index 0000000..1fcba4b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_lime" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_wool.json new file mode 100644 index 0000000..31849a6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lime_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "lime_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_furnace.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_furnace.json new file mode 100644 index 0000000..42aaa48 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_furnace.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "lit_furnace" }, + "facing=south": { "model": "lit_furnace", "y": 180 }, + "facing=west": { "model": "lit_furnace", "y": 270 }, + "facing=east": { "model": "lit_furnace", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_pumpkin.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_pumpkin.json new file mode 100644 index 0000000..bf1c4c4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_pumpkin.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "lit_pumpkin" }, + "facing=south": { "model": "lit_pumpkin", "y": 180 }, + "facing=west": { "model": "lit_pumpkin", "y": 270 }, + "facing=east": { "model": "lit_pumpkin", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_redstone_lamp.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_redstone_lamp.json new file mode 100644 index 0000000..bf419c9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_redstone_lamp.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "lit_redstone_lamp" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_redstone_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_redstone_ore.json new file mode 100644 index 0000000..c324279 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/lit_redstone_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "lit_redstone_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_carpet.json new file mode 100644 index 0000000..859951c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_magenta" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_glass.json new file mode 100644 index 0000000..173e017 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_magenta" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_glass_pane.json new file mode 100644 index 0000000..15d017c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "magenta_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "magenta_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "magenta_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "magenta_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "magenta_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "magenta_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "magenta_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "magenta_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "magenta_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "magenta_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "magenta_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "magenta_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "magenta_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "magenta_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "magenta_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "magenta_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_hardened_clay.json new file mode 100644 index 0000000..f380de6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_magenta" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_wool.json new file mode 100644 index 0000000..86d8c5f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/magenta_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "magenta_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/melon_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/melon_block.json new file mode 100644 index 0000000..68909f1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/melon_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "melon" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/melon_stem.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/melon_stem.json new file mode 100644 index 0000000..44519d6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/melon_stem.json @@ -0,0 +1,16 @@ +{ + "variants": { + "age=0,facing=up": { "model": "melon_stem_growth0" }, + "age=1,facing=up": { "model": "melon_stem_growth1" }, + "age=2,facing=up": { "model": "melon_stem_growth2" }, + "age=3,facing=up": { "model": "melon_stem_growth3" }, + "age=4,facing=up": { "model": "melon_stem_growth4" }, + "age=5,facing=up": { "model": "melon_stem_growth5" }, + "age=6,facing=up": { "model": "melon_stem_growth6" }, + "age=7,facing=up": { "model": "melon_stem_growth7" }, + "facing=west": { "model": "melon_stem_fruit" }, + "facing=east": { "model": "melon_stem_fruit", "y": 180 }, + "facing=north": { "model": "melon_stem_fruit", "y": 90 }, + "facing=south": { "model": "melon_stem_fruit", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mob_spawner.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mob_spawner.json new file mode 100644 index 0000000..a90c112 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mob_spawner.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "mob_spawner_cage" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_brick_monster_egg.json new file mode 100644 index 0000000..5a220cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_brick_monster_egg.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_mossy" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_cobblestone.json new file mode 100644 index 0000000..8c2387a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_cobblestone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "mossy_cobblestone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_cobblestone_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_cobblestone_wall.json new file mode 100644 index 0000000..063a33a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_cobblestone_wall.json @@ -0,0 +1,36 @@ +{ + "variants": { + "east=false,north=false,south=false,up=false,west=false": { "model": "mossy_wall_post" }, + "east=false,north=true,south=false,up=false,west=false": { "model": "mossy_wall_n" }, + "east=true,north=false,south=false,up=false,west=false": { "model": "mossy_wall_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=false,west=false": { "model": "mossy_wall_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,up=false,west=true": { "model": "mossy_wall_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,up=false,west=false": { "model": "mossy_wall_ne" }, + "east=true,north=false,south=true,up=false,west=false": { "model": "mossy_wall_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=false,west=true": { "model": "mossy_wall_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,up=false,west=true": { "model": "mossy_wall_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,up=false,west=false": { "model": "mossy_wall_ns" }, + "east=true,north=false,south=false,up=false,west=true": { "model": "mossy_wall_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,up=false,west=false": { "model": "mossy_wall_nse" }, + "east=true,north=false,south=true,up=false,west=true": { "model": "mossy_wall_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,up=false,west=true": { "model": "mossy_wall_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,up=false,west=true": { "model": "mossy_wall_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,up=false,west=true": { "model": "mossy_wall_nsew" }, + "east=false,north=false,south=false,up=true,west=false": { "model": "mossy_wall_post" }, + "east=false,north=true,south=false,up=true,west=false": { "model": "mossy_wall_n" }, + "east=true,north=false,south=false,up=true,west=false": { "model": "mossy_wall_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=true,west=false": { "model": "mossy_wall_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,up=true,west=true": { "model": "mossy_wall_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,up=true,west=false": { "model": "mossy_wall_ne" }, + "east=true,north=false,south=true,up=true,west=false": { "model": "mossy_wall_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,up=true,west=true": { "model": "mossy_wall_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,up=true,west=true": { "model": "mossy_wall_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,up=true,west=false": { "model": "mossy_wall_ns_above" }, + "east=true,north=false,south=false,up=true,west=true": { "model": "mossy_wall_ns_above", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,up=true,west=false": { "model": "mossy_wall_nse" }, + "east=true,north=false,south=true,up=true,west=true": { "model": "mossy_wall_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,up=true,west=true": { "model": "mossy_wall_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,up=true,west=true": { "model": "mossy_wall_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,up=true,west=true": { "model": "mossy_wall_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_stonebrick.json new file mode 100644 index 0000000..5a220cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mossy_stonebrick.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_mossy" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mycelium.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mycelium.json new file mode 100644 index 0000000..015296d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/mycelium.json @@ -0,0 +1,6 @@ +{ + "variants": { + "snowy=false": { "model": "mycelium" }, + "snowy=true": { "model": "grass_snowed" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick.json new file mode 100644 index 0000000..c43139d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "nether_brick" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_double_slab.json new file mode 100644 index 0000000..245f834 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "nether_brick" }, + "all": { "model": "nether_brick" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_fence.json new file mode 100644 index 0000000..59d5ddd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_fence.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "nether_brick_fence_post" }, + "east=false,north=true,south=false,west=false": { "model": "nether_brick_fence_n" }, + "east=true,north=false,south=false,west=false": { "model": "nether_brick_fence_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=false": { "model": "nether_brick_fence_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,west=true": { "model": "nether_brick_fence_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,west=false": { "model": "nether_brick_fence_ne" }, + "east=true,north=false,south=true,west=false": { "model": "nether_brick_fence_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=true": { "model": "nether_brick_fence_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,west=true": { "model": "nether_brick_fence_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,west=false": { "model": "nether_brick_fence_ns" }, + "east=true,north=false,south=false,west=true": { "model": "nether_brick_fence_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,west=false": { "model": "nether_brick_fence_nse" }, + "east=true,north=false,south=true,west=true": { "model": "nether_brick_fence_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,west=true": { "model": "nether_brick_fence_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,west=true": { "model": "nether_brick_fence_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,west=true": { "model": "nether_brick_fence_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_slab.json new file mode 100644 index 0000000..f240d08 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_nether_brick" }, + "half=top": { "model": "upper_slab_nether_brick" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_stairs.json new file mode 100644 index 0000000..178446a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_brick_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "nether_brick_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "nether_brick_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "nether_brick_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "nether_brick_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "nether_brick_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "nether_brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "nether_brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "nether_brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "nether_brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "nether_brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "nether_brick_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "nether_brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "nether_brick_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "nether_brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "nether_brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "nether_brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "nether_brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "nether_brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "nether_brick_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "nether_brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "nether_brick_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "nether_brick_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "nether_brick_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "nether_brick_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "nether_brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "nether_brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "nether_brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "nether_brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "nether_brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "nether_brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "nether_brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "nether_brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "nether_brick_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "nether_brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "nether_brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "nether_brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "nether_brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "nether_brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "nether_brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "nether_brick_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_wart.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_wart.json new file mode 100644 index 0000000..64c5d34 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/nether_wart.json @@ -0,0 +1,8 @@ +{ + "variants": { + "age=0": { "model": "nether_wart_stage0" }, + "age=1": { "model": "nether_wart_stage1" }, + "age=2": { "model": "nether_wart_stage1" }, + "age=3": { "model": "nether_wart_stage2" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/netherrack.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/netherrack.json new file mode 100644 index 0000000..2c1f936 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/netherrack.json @@ -0,0 +1,22 @@ +{ + "variants": { + "normal": [ + { "model": "netherrack" }, + { "model": "netherrack", "x": 90 }, + { "model": "netherrack", "x": 180 }, + { "model": "netherrack", "x": 270 }, + { "model": "netherrack", "y": 90 }, + { "model": "netherrack", "y": 90, "x": 90 }, + { "model": "netherrack", "y": 90, "x": 180 }, + { "model": "netherrack", "y": 90, "x": 270 }, + { "model": "netherrack", "y": 180 }, + { "model": "netherrack", "y": 180, "x": 90 }, + { "model": "netherrack", "y": 180, "x": 180 }, + { "model": "netherrack", "y": 180, "x": 270 }, + { "model": "netherrack", "y": 270 }, + { "model": "netherrack", "y": 270, "x": 90 }, + { "model": "netherrack", "y": 270, "x": 180 }, + { "model": "netherrack", "y": 270, "x": 270 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/noteblock.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/noteblock.json new file mode 100644 index 0000000..e7bc8e6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/noteblock.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "noteblock" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_double_slab.json new file mode 100644 index 0000000..1af29d1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_double_slab.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "oak_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_leaves.json new file mode 100644 index 0000000..fb78614 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_leaves.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "oak_leaves" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_log.json new file mode 100644 index 0000000..583f957 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_log.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "oak_log" }, + "axis=z": { "model": "oak_log_side" }, + "axis=x": { "model": "oak_log_side", "y": 90 }, + "axis=none": { "model": "oak_bark" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_planks.json new file mode 100644 index 0000000..1af29d1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_planks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "oak_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_sapling.json new file mode 100644 index 0000000..177b4bb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_sapling.json @@ -0,0 +1,6 @@ +{ + "variants": { + "stage=0": { "model": "oak_sapling" }, + "stage=1": { "model": "oak_sapling" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_slab.json new file mode 100644 index 0000000..80d06ee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_oak" }, + "half=top": { "model": "upper_slab_oak" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_stairs.json new file mode 100644 index 0000000..a51a893 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oak_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "oak_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "oak_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "oak_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "oak_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "oak_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "oak_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "oak_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "oak_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "oak_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "oak_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "oak_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "oak_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "oak_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "oak_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "oak_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "oak_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "oak_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "oak_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "oak_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "oak_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "oak_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "oak_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "oak_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "oak_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "oak_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "oak_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "oak_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "oak_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "oak_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "oak_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "oak_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "oak_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "oak_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "oak_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "oak_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "oak_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "oak_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "oak_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "oak_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "oak_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/obsidian.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/obsidian.json new file mode 100644 index 0000000..0221843 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/obsidian.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "obsidian" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_carpet.json new file mode 100644 index 0000000..36716cb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_orange" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_glass.json new file mode 100644 index 0000000..57cf8d4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_orange" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_glass_pane.json new file mode 100644 index 0000000..8fd585d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "orange_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "orange_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "orange_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "orange_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "orange_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "orange_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "orange_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "orange_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "orange_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "orange_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "orange_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "orange_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "orange_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "orange_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "orange_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "orange_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_hardened_clay.json new file mode 100644 index 0000000..c242910 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_orange" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_tulip.json new file mode 100644 index 0000000..7c9ba20 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_tulip.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "orange_tulip" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_wool.json new file mode 100644 index 0000000..6aeda3a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/orange_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "orange_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oxeye_daisy.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oxeye_daisy.json new file mode 100644 index 0000000..178c10a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/oxeye_daisy.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "daisy" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/packed_ice.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/packed_ice.json new file mode 100644 index 0000000..c0de5b2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/packed_ice.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "packed_ice" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/paeonia.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/paeonia.json new file mode 100644 index 0000000..f96923b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/paeonia.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=lower": { "model": "double_paeonia_bottom" }, + "half=upper": { "model": "double_paeonia_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_carpet.json new file mode 100644 index 0000000..d040f3d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_pink" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_glass.json new file mode 100644 index 0000000..14d9fcf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_pink" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_glass_pane.json new file mode 100644 index 0000000..23a77c1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "pink_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "pink_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "pink_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "pink_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "pink_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "pink_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "pink_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "pink_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "pink_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "pink_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "pink_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "pink_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "pink_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "pink_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "pink_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "pink_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_hardened_clay.json new file mode 100644 index 0000000..d9ca1c6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_pink" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_tulip.json new file mode 100644 index 0000000..5902262 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_tulip.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "pink_tulip" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_wool.json new file mode 100644 index 0000000..fcdaa96 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pink_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "pink_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/piston.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/piston.json new file mode 100644 index 0000000..7c40cc7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/piston.json @@ -0,0 +1,16 @@ +{ + "variants": { + "extended=false,facing=down": { "model": "piston_normal", "x": 90 }, + "extended=false,facing=up": { "model": "piston_normal", "x": 270 }, + "extended=false,facing=north": { "model": "piston_normal" }, + "extended=false,facing=south": { "model": "piston_normal", "y": 180 }, + "extended=false,facing=west": { "model": "piston_normal", "y": 270 }, + "extended=false,facing=east": { "model": "piston_normal", "y": 90 }, + "extended=true,facing=down": { "model": "piston_extended_normal", "x": 90 }, + "extended=true,facing=up": { "model": "piston_extended_normal", "x": 270 }, + "extended=true,facing=north": { "model": "piston_extended_normal" }, + "extended=true,facing=south": { "model": "piston_extended_normal", "y": 180 }, + "extended=true,facing=west": { "model": "piston_extended_normal", "y": 270 }, + "extended=true,facing=east": { "model": "piston_extended_normal", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/piston_head.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/piston_head.json new file mode 100644 index 0000000..e3014a0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/piston_head.json @@ -0,0 +1,28 @@ +{ + "variants": { + "facing=down,short=false,type=normal": { "model": "piston_head_normal", "x": 90 }, + "facing=up,short=false,type=normal": { "model": "piston_head_normal", "x": 270 }, + "facing=north,short=false,type=normal": { "model": "piston_head_normal" }, + "facing=south,short=false,type=normal": { "model": "piston_head_normal", "y": 180 }, + "facing=west,short=false,type=normal": { "model": "piston_head_normal", "y": 270 }, + "facing=east,short=false,type=normal": { "model": "piston_head_normal", "y": 90 }, + "facing=down,short=false,type=sticky": { "model": "piston_head_sticky", "x": 90 }, + "facing=up,short=false,type=sticky": { "model": "piston_head_sticky", "x": 270 }, + "facing=north,short=false,type=sticky": { "model": "piston_head_sticky" }, + "facing=south,short=false,type=sticky": { "model": "piston_head_sticky", "y": 180 }, + "facing=west,short=false,type=sticky": { "model": "piston_head_sticky", "y": 270 }, + "facing=east,short=false,type=sticky": { "model": "piston_head_sticky", "y": 90 }, + "facing=down,short=true,type=normal": { "model": "piston_head_short_normal", "x": 90 }, + "facing=up,short=true,type=normal": { "model": "piston_head_short_normal", "x": 270 }, + "facing=north,short=true,type=normal": { "model": "piston_head_short_normal" }, + "facing=south,short=true,type=normal": { "model": "piston_head_short_normal", "y": 180 }, + "facing=west,short=true,type=normal": { "model": "piston_head_short_normal", "y": 270 }, + "facing=east,short=true,type=normal": { "model": "piston_head_short_normal", "y": 90 }, + "facing=down,short=true,type=sticky": { "model": "piston_head_short_sticky", "x": 90 }, + "facing=up,short=true,type=sticky": { "model": "piston_head_short_sticky", "x": 270 }, + "facing=north,short=true,type=sticky": { "model": "piston_head_short_sticky" }, + "facing=south,short=true,type=sticky": { "model": "piston_head_short_sticky", "y": 180 }, + "facing=west,short=true,type=sticky": { "model": "piston_head_short_sticky", "y": 270 }, + "facing=east,short=true,type=sticky": { "model": "piston_head_short_sticky", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/podzol.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/podzol.json new file mode 100644 index 0000000..464924a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/podzol.json @@ -0,0 +1,6 @@ +{ + "variants": { + "snowy=false": { "model": "podzol" }, + "snowy=true": { "model": "grass_snowed" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/poppy.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/poppy.json new file mode 100644 index 0000000..fce0638 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/poppy.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "poppy" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/portal.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/portal.json new file mode 100644 index 0000000..7fe9eb0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/portal.json @@ -0,0 +1,6 @@ +{ + "variants": { + "axis=z": { "model": "portal_ew" }, + "axis=x": { "model": "portal_ns" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/potatoes.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/potatoes.json new file mode 100644 index 0000000..de8f92d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/potatoes.json @@ -0,0 +1,12 @@ +{ + "variants": { + "age=0": { "model": "potatoes_stage0" }, + "age=1": { "model": "potatoes_stage0" }, + "age=2": { "model": "potatoes_stage1" }, + "age=3": { "model": "potatoes_stage1" }, + "age=4": { "model": "potatoes_stage2" }, + "age=5": { "model": "potatoes_stage2" }, + "age=6": { "model": "potatoes_stage2" }, + "age=7": { "model": "potatoes_stage3" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/powered_comparator.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/powered_comparator.json new file mode 100644 index 0000000..9f753e6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/powered_comparator.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=north,mode=compare,powered=false": { "model": "comparator_unlit" }, + "facing=east,mode=compare,powered=false": { "model": "comparator_unlit", "y": 90 }, + "facing=south,mode=compare,powered=false": { "model": "comparator_unlit", "y": 180 }, + "facing=west,mode=compare,powered=false": { "model": "comparator_unlit", "y": 270 }, + "facing=north,mode=subtract,powered=false": { "model": "comparator_unlit_subtract" }, + "facing=east,mode=subtract,powered=false": { "model": "comparator_unlit_subtract", "y": 90 }, + "facing=south,mode=subtract,powered=false": { "model": "comparator_unlit_subtract", "y": 180 }, + "facing=west,mode=subtract,powered=false": { "model": "comparator_unlit_subtract", "y": 270 }, + "facing=north,mode=compare,powered=true": { "model": "comparator_lit" }, + "facing=east,mode=compare,powered=true": { "model": "comparator_lit", "y": 90 }, + "facing=south,mode=compare,powered=true": { "model": "comparator_lit", "y": 180 }, + "facing=west,mode=compare,powered=true": { "model": "comparator_lit", "y": 270 }, + "facing=north,mode=subtract,powered=true": { "model": "comparator_lit_subtract" }, + "facing=east,mode=subtract,powered=true": { "model": "comparator_lit_subtract", "y": 90 }, + "facing=south,mode=subtract,powered=true": { "model": "comparator_lit_subtract", "y": 180 }, + "facing=west,mode=subtract,powered=true": { "model": "comparator_lit_subtract", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/powered_repeater.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/powered_repeater.json new file mode 100644 index 0000000..deff0c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/powered_repeater.json @@ -0,0 +1,36 @@ +{ + "variants": { + "delay=1,facing=south,locked=false": { "model": "repeater_on_1tick" }, + "delay=1,facing=west,locked=false": { "model": "repeater_on_1tick", "y": 90 }, + "delay=1,facing=north,locked=false": { "model": "repeater_on_1tick", "y": 180 }, + "delay=1,facing=east,locked=false": { "model": "repeater_on_1tick", "y": 270 }, + "delay=2,facing=south,locked=false": { "model": "repeater_on_2tick" }, + "delay=2,facing=west,locked=false": { "model": "repeater_on_2tick", "y": 90 }, + "delay=2,facing=north,locked=false": { "model": "repeater_on_2tick", "y": 180 }, + "delay=2,facing=east,locked=false": { "model": "repeater_on_2tick", "y": 270 }, + "delay=3,facing=south,locked=false": { "model": "repeater_on_3tick" }, + "delay=3,facing=west,locked=false": { "model": "repeater_on_3tick", "y": 90 }, + "delay=3,facing=north,locked=false": { "model": "repeater_on_3tick", "y": 180 }, + "delay=3,facing=east,locked=false": { "model": "repeater_on_3tick", "y": 270 }, + "delay=4,facing=south,locked=false": { "model": "repeater_on_4tick" }, + "delay=4,facing=west,locked=false": { "model": "repeater_on_4tick", "y": 90 }, + "delay=4,facing=north,locked=false": { "model": "repeater_on_4tick", "y": 180 }, + "delay=4,facing=east,locked=false": { "model": "repeater_on_4tick", "y": 270 }, + "delay=1,facing=south,locked=true": { "model": "repeater_on_locked_1tick" }, + "delay=1,facing=west,locked=true": { "model": "repeater_on_locked_1tick", "y": 90 }, + "delay=1,facing=north,locked=true": { "model": "repeater_on_locked_1tick", "y": 180 }, + "delay=1,facing=east,locked=true": { "model": "repeater_on_locked_1tick", "y": 270 }, + "delay=2,facing=south,locked=true": { "model": "repeater_on_locked_2tick" }, + "delay=2,facing=west,locked=true": { "model": "repeater_on_locked_2tick", "y": 90 }, + "delay=2,facing=north,locked=true": { "model": "repeater_on_locked_2tick", "y": 180 }, + "delay=2,facing=east,locked=true": { "model": "repeater_on_locked_2tick", "y": 270 }, + "delay=3,facing=south,locked=true": { "model": "repeater_on_locked_3tick" }, + "delay=3,facing=west,locked=true": { "model": "repeater_on_locked_3tick", "y": 90 }, + "delay=3,facing=north,locked=true": { "model": "repeater_on_locked_3tick", "y": 180 }, + "delay=3,facing=east,locked=true": { "model": "repeater_on_locked_3tick", "y": 270 }, + "delay=4,facing=south,locked=true": { "model": "repeater_on_locked_4tick" }, + "delay=4,facing=west,locked=true": { "model": "repeater_on_locked_4tick", "y": 90 }, + "delay=4,facing=north,locked=true": { "model": "repeater_on_locked_4tick", "y": 180 }, + "delay=4,facing=east,locked=true": { "model": "repeater_on_locked_4tick", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/prismarine.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/prismarine.json new file mode 100644 index 0000000..9de572d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/prismarine.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "prismarine_rough" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/prismarine_bricks.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/prismarine_bricks.json new file mode 100644 index 0000000..1d588d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/prismarine_bricks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "prismarine_bricks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pumpkin.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pumpkin.json new file mode 100644 index 0000000..f3454bf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pumpkin.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "pumpkin" }, + "facing=south": { "model": "pumpkin", "y": 180 }, + "facing=west": { "model": "pumpkin", "y": 270 }, + "facing=east": { "model": "pumpkin", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pumpkin_stem.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pumpkin_stem.json new file mode 100644 index 0000000..90b9d69 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/pumpkin_stem.json @@ -0,0 +1,16 @@ +{ + "variants": { + "age=0,facing=up": { "model": "pumpkin_stem_growth0" }, + "age=1,facing=up": { "model": "pumpkin_stem_growth1" }, + "age=2,facing=up": { "model": "pumpkin_stem_growth2" }, + "age=3,facing=up": { "model": "pumpkin_stem_growth3" }, + "age=4,facing=up": { "model": "pumpkin_stem_growth4" }, + "age=5,facing=up": { "model": "pumpkin_stem_growth5" }, + "age=6,facing=up": { "model": "pumpkin_stem_growth6" }, + "age=7,facing=up": { "model": "pumpkin_stem_growth7" }, + "facing=west": { "model": "pumpkin_stem_fruit" }, + "facing=east": { "model": "pumpkin_stem_fruit", "y": 180 }, + "facing=north": { "model": "pumpkin_stem_fruit", "y": 90 }, + "facing=south": { "model": "pumpkin_stem_fruit", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_carpet.json new file mode 100644 index 0000000..7179f25 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_purple" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_glass.json new file mode 100644 index 0000000..a55b6ef --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_purple" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_glass_pane.json new file mode 100644 index 0000000..0e24ffe --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "purple_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "purple_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "purple_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "purple_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "purple_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "purple_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "purple_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "purple_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "purple_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "purple_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "purple_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "purple_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "purple_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "purple_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "purple_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "purple_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_hardened_clay.json new file mode 100644 index 0000000..b595cb6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_purple" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_wool.json new file mode 100644 index 0000000..8f4b000 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/purple_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "purple_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_block.json new file mode 100644 index 0000000..821966c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "quartz_normal" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_column.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_column.json new file mode 100644 index 0000000..015e0f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_column.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "quartz_lines" }, + "axis=z": { "model": "quartz_lines", "x": 90 }, + "axis=x": { "model": "quartz_lines", "x": 90, "y": 90 } + } +} + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_double_slab.json new file mode 100644 index 0000000..c744e7b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "quartz_normal" }, + "all": { "model": "quartz_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_ore.json new file mode 100644 index 0000000..759fb79 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "quartz_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_slab.json new file mode 100644 index 0000000..566f0e2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_quartz" }, + "half=top": { "model": "upper_slab_quartz" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_stairs.json new file mode 100644 index 0000000..e127773 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/quartz_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "quartz_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "quartz_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "quartz_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "quartz_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "quartz_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "quartz_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "quartz_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "quartz_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "quartz_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "quartz_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "quartz_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "quartz_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "quartz_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "quartz_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "quartz_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "quartz_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "quartz_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "quartz_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "quartz_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "quartz_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "quartz_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "quartz_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "quartz_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "quartz_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "quartz_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "quartz_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "quartz_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "quartz_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "quartz_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "quartz_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "quartz_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "quartz_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "quartz_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "quartz_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "quartz_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "quartz_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "quartz_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "quartz_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "quartz_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "quartz_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/rail.json new file mode 100644 index 0000000..7d8b5b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/rail.json @@ -0,0 +1,14 @@ +{ + "variants": { + "shape=north_south": { "model": "normal_rail_flat" }, + "shape=east_west": { "model": "normal_rail_flat", "y": 90 }, + "shape=ascending_east": { "model": "normal_rail_raised_ne", "y": 90 }, + "shape=ascending_west": { "model": "normal_rail_raised_sw", "y": 90 }, + "shape=ascending_north": { "model": "normal_rail_raised_ne" }, + "shape=ascending_south": { "model": "normal_rail_raised_sw" }, + "shape=south_east": { "model": "normal_rail_curved" }, + "shape=south_west": { "model": "normal_rail_curved", "y": 90 }, + "shape=north_west": { "model": "normal_rail_curved", "y": 180 }, + "shape=north_east": { "model": "normal_rail_curved", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_carpet.json new file mode 100644 index 0000000..9c02d56 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_red" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_mushroom.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_mushroom.json new file mode 100644 index 0000000..2e43aa3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_mushroom.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "red_mushroom" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_mushroom_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_mushroom_block.json new file mode 100644 index 0000000..5ff4c87 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_mushroom_block.json @@ -0,0 +1,18 @@ +{ + "variants": { + "variant=north_west": { "model": "red_mushroom_block_nw" }, + "variant=north": { "model": "red_mushroom_block_n" }, + "variant=north_east": { "model": "red_mushroom_block_ne" }, + "variant=west": { "model": "red_mushroom_block_w" }, + "variant=center": { "model": "red_mushroom_block_c" }, + "variant=east": { "model": "red_mushroom_block_e" }, + "variant=south_west": { "model": "red_mushroom_block_sw" }, + "variant=south": { "model": "red_mushroom_block_s" }, + "variant=south_east": { "model": "red_mushroom_block_se" }, + "variant=stem": { "model": "red_mushroom_block_stem" }, + "variant=all_stem": { "model": "red_mushroom_block_stem_all" }, + "variant=all_outside": { "model": "red_mushroom_block_cap_all" }, + "variant=all_inside": { "model": "red_mushroom_block_inside_all" } + } +} + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sand.json new file mode 100644 index 0000000..a82f518 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sand.json @@ -0,0 +1,10 @@ +{ + "variants": { + "normal": [ + { "model": "red_sand" }, + { "model": "red_sand", "y": 90 }, + { "model": "red_sand", "y": 180 }, + { "model": "red_sand", "y": 270 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone.json new file mode 100644 index 0000000..4ba4ec5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "red_sandstone_normal" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_double_slab.json new file mode 100644 index 0000000..9f5247d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "red_sandstone_normal" }, + "all": { "model": "red_sandstone_all" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_slab.json new file mode 100644 index 0000000..aa74a59 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_red_sandstone" }, + "half=top": { "model": "upper_slab_red_sandstone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_stairs.json new file mode 100644 index 0000000..2862714 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_sandstone_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "red_sandstone_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "red_sandstone_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "red_sandstone_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "red_sandstone_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "red_sandstone_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "red_sandstone_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "red_sandstone_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "red_sandstone_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "red_sandstone_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "red_sandstone_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "red_sandstone_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "red_sandstone_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "red_sandstone_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "red_sandstone_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "red_sandstone_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "red_sandstone_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "red_sandstone_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "red_sandstone_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "red_sandstone_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "red_sandstone_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "red_sandstone_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "red_sandstone_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "red_sandstone_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "red_sandstone_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "red_sandstone_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "red_sandstone_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "red_sandstone_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "red_sandstone_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "red_sandstone_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "red_sandstone_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "red_sandstone_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "red_sandstone_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "red_sandstone_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "red_sandstone_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "red_sandstone_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "red_sandstone_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "red_sandstone_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "red_sandstone_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "red_sandstone_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "red_sandstone_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_glass.json new file mode 100644 index 0000000..7b33fa3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_red" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_glass_pane.json new file mode 100644 index 0000000..e78eea0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "red_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "red_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "red_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "red_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "red_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "red_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "red_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "red_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "red_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "red_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "red_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "red_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "red_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "red_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "red_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "red_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_hardened_clay.json new file mode 100644 index 0000000..727c74c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_red" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_tulip.json new file mode 100644 index 0000000..fb1cdab --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_tulip.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "red_tulip" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_wool.json new file mode 100644 index 0000000..cfb8ed2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/red_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "red_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_block.json new file mode 100644 index 0000000..e22811f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_block.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "redstone_block" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_lamp.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_lamp.json new file mode 100644 index 0000000..195cc9b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_lamp.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "unlit_redstone_lamp" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_ore.json new file mode 100644 index 0000000..f11fd3b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_ore.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "redstone_ore" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_torch.json new file mode 100644 index 0000000..0b960a8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_torch.json @@ -0,0 +1,9 @@ +{ + "variants": { + "facing=up": { "model": "lit_redstone_torch" }, + "facing=east": { "model": "lit_redstone_torch_wall" }, + "facing=south": { "model": "lit_redstone_torch_wall", "y": 90 }, + "facing=west": { "model": "lit_redstone_torch_wall", "y": 180 }, + "facing=north": { "model": "lit_redstone_torch_wall", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_wire.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_wire.json new file mode 100644 index 0000000..a933b3e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/redstone_wire.json @@ -0,0 +1,103 @@ +{ + "variants": { + "east=none,north=none,south=none,west=none": { "model": "redstone_none" }, + + "east=none,north=side,south=none,west=none": { "model": "redstone_n" }, + "east=none,north=none,south=side,west=none": { "model": "redstone_n" }, + "east=side,north=none,south=none,west=none": { "model": "redstone_n", "y": 90 }, + "east=none,north=none,south=none,west=side": { "model": "redstone_n", "y": 90 }, + + "east=none,north=up,south=none,west=none": { "model": "redstone_uns" }, + "east=none,north=none,south=up,west=none": { "model": "redstone_uns", "y": 180, "uvlock": true }, + "east=up,north=none,south=none,west=none": { "model": "redstone_uew" }, + "east=none,north=none,south=none,west=up": { "model": "redstone_uew", "y": 180, "uvlock": true }, + + "east=side,north=side,south=none,west=none": { "model": "redstone_ne", "uvlock": true }, + "east=side,north=up,south=none,west=none": { "model": "redstone_une", "uvlock": true }, + "east=up,north=side,south=none,west=none": { "model": "redstone_nue", "uvlock": true }, + "east=up,north=up,south=none,west=none": { "model": "redstone_unue", "uvlock": true }, + + "east=side,north=none,south=side,west=none": { "model": "redstone_ne", "y": 90, "uvlock": true }, + "east=up,north=none,south=side,west=none": { "model": "redstone_une", "y": 90, "uvlock": true }, + "east=side,north=none,south=up,west=none": { "model": "redstone_nue", "y": 90, "uvlock": true }, + "east=up,north=none,south=up,west=none": { "model": "redstone_unue", "y": 90, "uvlock": true }, + + "east=none,north=none,south=side,west=side": { "model": "redstone_ne", "y": 180, "uvlock": true }, + "east=none,north=none,south=up,west=side": { "model": "redstone_une", "y": 180, "uvlock": true }, + "east=none,north=none,south=side,west=up": { "model": "redstone_nue", "y": 180, "uvlock": true }, + "east=none,north=none,south=up,west=up": { "model": "redstone_unue", "y": 180, "uvlock": true }, + + "east=none,north=side,south=none,west=side": { "model": "redstone_ne", "y": 270, "uvlock": true }, + "east=none,north=side,south=none,west=up": { "model": "redstone_une", "y": 270, "uvlock": true }, + "east=none,north=up,south=none,west=side": { "model": "redstone_nue", "y": 270, "uvlock": true }, + "east=none,north=up,south=none,west=up": { "model": "redstone_unue", "y": 270, "uvlock": true }, + + "east=none,north=side,south=side,west=none": { "model": "redstone_n" }, + "east=none,north=up,south=side,west=none": { "model": "redstone_uns" }, + "east=none,north=side,south=up,west=none": { "model": "redstone_uns", "y": 180 }, + "east=none,north=up,south=up,west=none": { "model": "redstone_unus" }, + + "east=side,north=none,south=none,west=side": { "model": "redstone_n", "y": 90 }, + "east=up,north=none,south=none,west=side": { "model": "redstone_uns", "y": 90 }, + "east=side,north=none,south=none,west=up": { "model": "redstone_uns", "y": 270 }, + "east=up,north=none,south=none,west=up": { "model": "redstone_ueuw" }, + + "east=side,north=side,south=side,west=none": { "model": "redstone_nse", "uvlock": true }, + "east=side,north=up,south=side,west=none": { "model": "redstone_unse", "uvlock": true }, + "east=side,north=side,south=up,west=none": { "model": "redstone_nuse", "uvlock": true }, + "east=up,north=side,south=side,west=none": { "model": "redstone_nsue", "uvlock": true }, + "east=up,north=side,south=up,west=none": { "model": "redstone_nusue", "uvlock": true }, + "east=side,north=up,south=up,west=none": { "model": "redstone_unuse", "uvlock": true }, + "east=up,north=up,south=side,west=none": { "model": "redstone_unsue", "uvlock": true }, + "east=up,north=up,south=up,west=none": { "model": "redstone_unusue", "uvlock": true }, + + "east=side,north=none,south=side,west=side": { "model": "redstone_nse", "y": 90, "uvlock": true }, + "east=up,north=none,south=side,west=side": { "model": "redstone_unse", "y": 90, "uvlock": true }, + "east=side,north=none,south=side,west=up": { "model": "redstone_nuse", "y": 90, "uvlock": true }, + "east=side,north=none,south=up,west=side": { "model": "redstone_nsue", "y": 90, "uvlock": true }, + "east=side,north=none,south=up,west=up": { "model": "redstone_nusue", "y": 90, "uvlock": true }, + "east=up,north=none,south=side,west=up": { "model": "redstone_unuse", "y": 90, "uvlock": true }, + "east=up,north=none,south=up,west=side": { "model": "redstone_unsue", "y": 90, "uvlock": true }, + "east=up,north=none,south=up,west=up": { "model": "redstone_unusue", "y": 90, "uvlock": true }, + + "east=none,north=side,south=side,west=side": { "model": "redstone_nse", "y": 180, "uvlock": true }, + "east=none,north=side,south=up,west=side": { "model": "redstone_unse", "y": 180, "uvlock": true }, + "east=none,north=up,south=side,west=side": { "model": "redstone_nuse", "y": 180, "uvlock": true }, + "east=none,north=side,south=side,west=up": { "model": "redstone_nsue", "y": 180, "uvlock": true }, + "east=none,north=up,south=side,west=up": { "model": "redstone_nusue", "y": 180, "uvlock": true }, + "east=none,north=up,south=up,west=side": { "model": "redstone_unuse", "y": 180, "uvlock": true }, + "east=none,north=side,south=up,west=up": { "model": "redstone_unsue", "y": 180, "uvlock": true }, + "east=none,north=up,south=up,west=up": { "model": "redstone_unusue", "y": 180, "uvlock": true }, + + "east=side,north=side,south=none,west=side": { "model": "redstone_nse", "y": 270, "uvlock": true }, + "east=side,north=side,south=none,west=up": { "model": "redstone_unse", "y": 270, "uvlock": true }, + "east=up,north=side,south=none,west=side": { "model": "redstone_nuse", "y": 270, "uvlock": true }, + "east=side,north=up,south=none,west=side": { "model": "redstone_nsue", "y": 270, "uvlock": true }, + "east=up,north=up,south=none,west=side": { "model": "redstone_nusue", "y": 270, "uvlock": true }, + "east=up,north=side,south=none,west=up": { "model": "redstone_unuse", "y": 270, "uvlock": true }, + "east=side,north=up,south=none,west=up": { "model": "redstone_unsue", "y": 270, "uvlock": true }, + "east=up,north=up,south=none,west=up": { "model": "redstone_unusue", "y": 270, "uvlock": true }, + + "east=side,north=side,south=side,west=side": { "model": "redstone_nsew", "uvlock": true }, + + "east=side,north=up,south=side,west=side": { "model": "redstone_unsew", "uvlock": true }, + "east=side,north=side,south=up,west=side": { "model": "redstone_unsew", "y": 180, "uvlock": true }, + "east=up,north=side,south=side,west=side": { "model": "redstone_unsew", "y": 90, "uvlock": true }, + "east=side,north=side,south=side,west=up": { "model": "redstone_unsew", "y": 270, "uvlock": true }, + + "east=side,north=up,south=up,west=side": { "model": "redstone_unusew", "uvlock": true }, + "east=up,north=side,south=side,west=up": { "model": "redstone_unusew", "y": 90, "uvlock": true }, + + "east=up,north=up,south=side,west=side": { "model": "redstone_unsuew", "uvlock": true }, + "east=up,north=side,south=up,west=side": { "model": "redstone_unsuew", "y": 90, "uvlock": true }, + "east=side,north=side,south=up,west=up": { "model": "redstone_unsuew", "y": 180, "uvlock": true }, + "east=side,north=up,south=side,west=up": { "model": "redstone_unsuew", "y": 270, "uvlock": true }, + + "east=up,north=up,south=up,west=side": { "model": "redstone_unusuew", "uvlock": true }, + "east=up,north=side,south=up,west=up": { "model": "redstone_unusuew", "y": 90, "uvlock": true }, + "east=side,north=up,south=up,west=up": { "model": "redstone_unusuew", "y": 180, "uvlock": true }, + "east=up,north=up,south=side,west=up": { "model": "redstone_unusuew", "y": 270, "uvlock": true }, + + "east=up,north=up,south=up,west=up": { "model": "redstone_unusueuw", "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/reeds.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/reeds.json new file mode 100644 index 0000000..93ceec8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/reeds.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "reeds" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sand.json new file mode 100644 index 0000000..f4be92b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sand.json @@ -0,0 +1,10 @@ +{ + "variants": { + "normal": [ + { "model": "sand" }, + { "model": "sand", "y": 90 }, + { "model": "sand", "y": 180 }, + { "model": "sand", "y": 270 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone.json new file mode 100644 index 0000000..eca6919 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "sandstone_normal" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_double_slab.json new file mode 100644 index 0000000..bed0dfc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "sandstone_normal" }, + "all": { "model": "sandstone_all" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_slab.json new file mode 100644 index 0000000..e5ff1c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_sandstone" }, + "half=top": { "model": "upper_slab_sandstone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_stairs.json new file mode 100644 index 0000000..8248b86 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sandstone_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "sandstone_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "sandstone_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "sandstone_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "sandstone_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "sandstone_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "sandstone_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "sandstone_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "sandstone_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "sandstone_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "sandstone_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "sandstone_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "sandstone_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "sandstone_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "sandstone_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "sandstone_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "sandstone_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "sandstone_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "sandstone_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "sandstone_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "sandstone_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "sandstone_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "sandstone_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "sandstone_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "sandstone_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "sandstone_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "sandstone_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "sandstone_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "sandstone_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "sandstone_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "sandstone_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "sandstone_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "sandstone_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "sandstone_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "sandstone_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "sandstone_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "sandstone_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "sandstone_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "sandstone_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "sandstone_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "sandstone_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sea_lantern.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sea_lantern.json new file mode 100644 index 0000000..f1d4b9e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sea_lantern.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "sea_lantern" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_carpet.json new file mode 100644 index 0000000..6f58883 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_silver" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_glass.json new file mode 100644 index 0000000..26061de --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_silver" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_glass_pane.json new file mode 100644 index 0000000..2ed0dda --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "silver_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "silver_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "silver_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "silver_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "silver_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "silver_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "silver_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "silver_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "silver_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "silver_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "silver_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "silver_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "silver_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "silver_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "silver_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "silver_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_hardened_clay.json new file mode 100644 index 0000000..069acc4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_silver" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_wool.json new file mode 100644 index 0000000..09da066 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/silver_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "silver_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/slime.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/slime.json new file mode 100644 index 0000000..7c2bbd6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/slime.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "slime" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_andesite.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_andesite.json new file mode 100644 index 0000000..a48e205 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_andesite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "andesite_smooth" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_diorite.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_diorite.json new file mode 100644 index 0000000..213183e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_diorite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "diorite_smooth" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_granite.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_granite.json new file mode 100644 index 0000000..bc6bda0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_granite.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "granite_smooth" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_red_sandstone.json new file mode 100644 index 0000000..199c137 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_red_sandstone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "red_sandstone_smooth" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_sandstone.json new file mode 100644 index 0000000..9d65c5d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/smooth_sandstone.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "sandstone_smooth" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/snow.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/snow.json new file mode 100644 index 0000000..e188504 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/snow.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "snow" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/snow_layer.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/snow_layer.json new file mode 100644 index 0000000..95cd5b1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/snow_layer.json @@ -0,0 +1,12 @@ +{ + "variants": { + "layers=1": { "model": "snow_height2" }, + "layers=2": { "model": "snow_height4" }, + "layers=3": { "model": "snow_height6" }, + "layers=4": { "model": "snow_height8" }, + "layers=5": { "model": "snow_height10" }, + "layers=6": { "model": "snow_height12" }, + "layers=7": { "model": "snow_height14" }, + "layers=8": { "model": "snow" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/soul_sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/soul_sand.json new file mode 100644 index 0000000..b62b807 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/soul_sand.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "soul_sand" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sponge.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sponge.json new file mode 100644 index 0000000..dacbb14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sponge.json @@ -0,0 +1,6 @@ +{ + "variants": { + "wet=false": { "model": "sponge" }, + "wet=true": { "model": "sponge_wet" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_door.json new file mode 100644 index 0000000..202313d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_door.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "spruce_door_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "spruce_door_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "spruce_door_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "spruce_door_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "spruce_door_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "spruce_door_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "spruce_door_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "spruce_door_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "spruce_door_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "spruce_door_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "spruce_door_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "spruce_door_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "spruce_door_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "spruce_door_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "spruce_door_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "spruce_door_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "spruce_door_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "spruce_door_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "spruce_door_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "spruce_door_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "spruce_door_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "spruce_door_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "spruce_door_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "spruce_door_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "spruce_door_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "spruce_door_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "spruce_door_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "spruce_door_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "spruce_door_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "spruce_door_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "spruce_door_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "spruce_door_top", "y": 180 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_double_slab.json new file mode 100644 index 0000000..e2d11da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_double_slab.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "spruce_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_fence.json new file mode 100644 index 0000000..0dd96a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_fence.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "spruce_fence_post" }, + "east=false,north=true,south=false,west=false": { "model": "spruce_fence_n", "uvlock": true }, + "east=true,north=false,south=false,west=false": { "model": "spruce_fence_n", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=false": { "model": "spruce_fence_n", "y": 180, "uvlock": true }, + "east=false,north=false,south=false,west=true": { "model": "spruce_fence_n", "y": 270, "uvlock": true }, + "east=true,north=true,south=false,west=false": { "model": "spruce_fence_ne", "uvlock": true }, + "east=true,north=false,south=true,west=false": { "model": "spruce_fence_ne", "y": 90, "uvlock": true }, + "east=false,north=false,south=true,west=true": { "model": "spruce_fence_ne", "y": 180, "uvlock": true }, + "east=false,north=true,south=false,west=true": { "model": "spruce_fence_ne", "y": 270, "uvlock": true }, + "east=false,north=true,south=true,west=false": { "model": "spruce_fence_ns", "uvlock": true }, + "east=true,north=false,south=false,west=true": { "model": "spruce_fence_ns", "y": 90, "uvlock": true }, + "east=true,north=true,south=true,west=false": { "model": "spruce_fence_nse", "uvlock": true }, + "east=true,north=false,south=true,west=true": { "model": "spruce_fence_nse", "y": 90, "uvlock": true }, + "east=false,north=true,south=true,west=true": { "model": "spruce_fence_nse", "y": 180, "uvlock": true }, + "east=true,north=true,south=false,west=true": { "model": "spruce_fence_nse", "y": 270, "uvlock": true }, + "east=true,north=true,south=true,west=true": { "model": "spruce_fence_nsew", "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_fence_gate.json new file mode 100644 index 0000000..ba44f44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_fence_gate.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "spruce_fence_gate_closed" }, + "facing=west,in_wall=false,open=false": { "model": "spruce_fence_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "spruce_fence_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "spruce_fence_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "spruce_fence_gate_open" }, + "facing=west,in_wall=false,open=true": { "model": "spruce_fence_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "spruce_fence_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "spruce_fence_gate_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "spruce_wall_gate_closed" }, + "facing=west,in_wall=true,open=false": { "model": "spruce_wall_gate_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "spruce_wall_gate_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "spruce_wall_gate_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "spruce_wall_gate_open" }, + "facing=west,in_wall=true,open=true": { "model": "spruce_wall_gate_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "spruce_wall_gate_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "spruce_wall_gate_open", "y": 270, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_leaves.json new file mode 100644 index 0000000..7f03d7d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_leaves.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "spruce_leaves" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_log.json new file mode 100644 index 0000000..f944c58 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_log.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "spruce_log" }, + "axis=z": { "model": "spruce_log_side" }, + "axis=x": { "model": "spruce_log_side", "y": 90 }, + "axis=none": { "model": "spruce_bark" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_planks.json new file mode 100644 index 0000000..e2d11da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_planks.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "spruce_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_sapling.json new file mode 100644 index 0000000..45a85c5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_sapling.json @@ -0,0 +1,6 @@ +{ + "variants": { + "stage=0": { "model": "spruce_sapling" }, + "stage=1": { "model": "spruce_sapling" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_slab.json new file mode 100644 index 0000000..c4df009 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_spruce" }, + "half=top": { "model": "upper_slab_spruce" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_stairs.json new file mode 100644 index 0000000..daaf7eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/spruce_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "spruce_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "spruce_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "spruce_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "spruce_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "spruce_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "spruce_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "spruce_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "spruce_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "spruce_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "spruce_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "spruce_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "spruce_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "spruce_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "spruce_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "spruce_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "spruce_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "spruce_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "spruce_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "spruce_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "spruce_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "spruce_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "spruce_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "spruce_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "spruce_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "spruce_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "spruce_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "spruce_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "spruce_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "spruce_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "spruce_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "spruce_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "spruce_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "spruce_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "spruce_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "spruce_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "spruce_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "spruce_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "spruce_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "spruce_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "spruce_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sticky_piston.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sticky_piston.json new file mode 100644 index 0000000..276b4da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sticky_piston.json @@ -0,0 +1,16 @@ +{ + "variants": { + "extended=false,facing=down": { "model": "sticky_piston", "x": 90 }, + "extended=false,facing=up": { "model": "sticky_piston", "x": 270 }, + "extended=false,facing=north": { "model": "sticky_piston" }, + "extended=false,facing=south": { "model": "sticky_piston", "y": 180 }, + "extended=false,facing=west": { "model": "sticky_piston", "y": 270 }, + "extended=false,facing=east": { "model": "sticky_piston", "y": 90 }, + "extended=true,facing=down": { "model": "piston_extended_normal", "x": 90 }, + "extended=true,facing=up": { "model": "piston_extended_normal", "x": 270 }, + "extended=true,facing=north": { "model": "piston_extended_normal" }, + "extended=true,facing=south": { "model": "piston_extended_normal", "y": 180 }, + "extended=true,facing=west": { "model": "piston_extended_normal", "y": 270 }, + "extended=true,facing=east": { "model": "piston_extended_normal", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone.json new file mode 100644 index 0000000..481b29a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone.json @@ -0,0 +1,10 @@ +{ + "variants": { + "normal": [ + { "model": "stone" }, + { "model": "stone_mirrored" }, + { "model": "stone", "y": 180 }, + { "model": "stone_mirrored", "y": 180 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_double_slab.json new file mode 100644 index 0000000..7acc6c6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "stonebrick_normal" }, + "all": { "model": "stonebrick_normal" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_monster_egg.json new file mode 100644 index 0000000..34fa81a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_monster_egg.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_normal" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_slab.json new file mode 100644 index 0000000..921ec8c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_stone_brick" }, + "half=top": { "model": "upper_slab_stone_brick" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_stairs.json new file mode 100644 index 0000000..a8ed4ca --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_brick_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "stone_brick_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "stone_brick_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "stone_brick_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "stone_brick_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "stone_brick_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "stone_brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "stone_brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "stone_brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "stone_brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "stone_brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "stone_brick_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "stone_brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "stone_brick_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "stone_brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "stone_brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "stone_brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "stone_brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "stone_brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "stone_brick_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "stone_brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "stone_brick_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "stone_brick_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "stone_brick_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "stone_brick_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "stone_brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "stone_brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "stone_brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "stone_brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "stone_brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "stone_brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "stone_brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "stone_brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "stone_brick_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "stone_brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "stone_brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "stone_brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "stone_brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "stone_brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "stone_brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "stone_brick_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_button.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_button.json new file mode 100644 index 0000000..0e03643 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_button.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=up,powered=false": { "model": "stone_button" }, + "facing=down,powered=false": { "model": "stone_button", "x": 180 }, + "facing=east,powered=false": { "model": "stone_button", "x": 90, "y": 90 }, + "facing=west,powered=false": { "model": "stone_button", "x": 90, "y": 270 }, + "facing=south,powered=false": { "model": "stone_button", "x": 90, "y": 180 }, + "facing=north,powered=false": { "model": "stone_button", "x": 90 }, + "facing=up,powered=true": { "model": "stone_button_pressed" }, + "facing=down,powered=true": { "model": "stone_button_pressed", "x": 180 }, + "facing=east,powered=true": { "model": "stone_button_pressed", "x": 90, "y": 90 }, + "facing=west,powered=true": { "model": "stone_button_pressed", "x": 90, "y": 270 }, + "facing=south,powered=true": { "model": "stone_button_pressed", "x": 90, "y": 180 }, + "facing=north,powered=true": { "model": "stone_button_pressed", "x": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_double_slab.json new file mode 100644 index 0000000..b14642f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "double_stone" }, + "all": { "model": "double_stone_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_monster_egg.json new file mode 100644 index 0000000..720da4e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_monster_egg.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_pressure_plate.json new file mode 100644 index 0000000..6d014bf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_pressure_plate.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=false": { "model": "stone_pressure_plate_up" }, + "powered=true": { "model": "stone_pressure_plate_down" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_slab.json new file mode 100644 index 0000000..4931695 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_stone" }, + "half=top": { "model": "upper_slab_stone" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_stairs.json new file mode 100644 index 0000000..df1c462 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stone_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "stone_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "stone_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "stone_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "stone_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "stone_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "stone_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "stone_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "stone_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "stone_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "stone_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "stone_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "stone_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "stone_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "stone_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "stone_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "stone_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "stone_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "stone_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "stone_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "stone_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "stone_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "stone_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "stone_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "stone_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "stone_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "stone_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "stone_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "stone_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "stone_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "stone_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "stone_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "stone_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "stone_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "stone_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "stone_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "stone_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "stone_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "stone_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "stone_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "stone_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stonebrick.json new file mode 100644 index 0000000..34fa81a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/stonebrick.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "stonebrick_normal" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sunflower.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sunflower.json new file mode 100644 index 0000000..1eab20d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/sunflower.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=lower": { "model": "double_sunflower_bottom" }, + "half=upper": { "model": "double_sunflower_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/syringa.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/syringa.json new file mode 100644 index 0000000..04cacc2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/syringa.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=lower": { "model": "double_syringa_bottom" }, + "half=upper": { "model": "double_syringa_top" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tall_grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tall_grass.json new file mode 100644 index 0000000..f58d568 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tall_grass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "tall_grass" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tnt.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tnt.json new file mode 100644 index 0000000..55afd63 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tnt.json @@ -0,0 +1,10 @@ +{ + "variants": { + "normal": [ + { "model": "tnt" }, + { "model": "tnt", "y": 90 }, + { "model": "tnt", "y": 180 }, + { "model": "tnt", "y": 270 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/torch.json new file mode 100644 index 0000000..d3d704e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/torch.json @@ -0,0 +1,9 @@ +{ + "variants": { + "facing=up": { "model": "normal_torch" }, + "facing=east": { "model": "normal_torch_wall" }, + "facing=south": { "model": "normal_torch_wall", "y": 90 }, + "facing=west": { "model": "normal_torch_wall", "y": 180 }, + "facing=north": { "model": "normal_torch_wall", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/trapdoor.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/trapdoor.json new file mode 100644 index 0000000..2918632 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/trapdoor.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=north,half=bottom,open=false": { "model": "wooden_trapdoor_bottom" }, + "facing=south,half=bottom,open=false": { "model": "wooden_trapdoor_bottom" }, + "facing=east,half=bottom,open=false": { "model": "wooden_trapdoor_bottom" }, + "facing=west,half=bottom,open=false": { "model": "wooden_trapdoor_bottom" }, + "facing=north,half=top,open=false": { "model": "wooden_trapdoor_top" }, + "facing=south,half=top,open=false": { "model": "wooden_trapdoor_top" }, + "facing=east,half=top,open=false": { "model": "wooden_trapdoor_top" }, + "facing=west,half=top,open=false": { "model": "wooden_trapdoor_top" }, + "facing=north,half=bottom,open=true": { "model": "wooden_trapdoor_open" }, + "facing=south,half=bottom,open=true": { "model": "wooden_trapdoor_open", "y": 180 }, + "facing=east,half=bottom,open=true": { "model": "wooden_trapdoor_open", "y": 90 }, + "facing=west,half=bottom,open=true": { "model": "wooden_trapdoor_open", "y": 270 }, + "facing=north,half=top,open=true": { "model": "wooden_trapdoor_open" }, + "facing=south,half=top,open=true": { "model": "wooden_trapdoor_open", "y": 180 }, + "facing=east,half=top,open=true": { "model": "wooden_trapdoor_open", "y": 90 }, + "facing=west,half=top,open=true": { "model": "wooden_trapdoor_open", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tripwire.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tripwire.json new file mode 100644 index 0000000..eeecb46 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tripwire.json @@ -0,0 +1,68 @@ +{ + "variants": { + "attached=false,east=false,north=false,south=false,suspended=false,west=false": { "model": "tripwire_ns" }, + "attached=false,east=false,north=true,south=false,suspended=false,west=false": { "model": "tripwire_n" }, + "attached=false,east=false,north=false,south=true,suspended=false,west=false": { "model": "tripwire_n", "y": 180 }, + "attached=false,east=true,north=false,south=false,suspended=false,west=false": { "model": "tripwire_n", "y": 90 }, + "attached=false,east=false,north=false,south=false,suspended=false,west=true": { "model": "tripwire_n", "y": 270 }, + "attached=false,east=true,north=true,south=false,suspended=false,west=false": { "model": "tripwire_ne" }, + "attached=false,east=true,north=false,south=true,suspended=false,west=false": { "model": "tripwire_ne", "y": 90 }, + "attached=false,east=false,north=false,south=true,suspended=false,west=true": { "model": "tripwire_ne", "y": 180 }, + "attached=false,east=false,north=true,south=false,suspended=false,west=true": { "model": "tripwire_ne", "y": 270 }, + "attached=false,east=false,north=true,south=true,suspended=false,west=false": { "model": "tripwire_ns" }, + "attached=false,east=true,north=false,south=false,suspended=false,west=true": { "model": "tripwire_ns", "y": 90 }, + "attached=false,east=true,north=true,south=true,suspended=false,west=false": { "model": "tripwire_nse" }, + "attached=false,east=true,north=false,south=true,suspended=false,west=true": { "model": "tripwire_nse", "y": 90 }, + "attached=false,east=false,north=true,south=true,suspended=false,west=true": { "model": "tripwire_nse", "y": 180 }, + "attached=false,east=true,north=true,south=false,suspended=false,west=true": { "model": "tripwire_nse", "y": 270 }, + "attached=false,east=true,north=true,south=true,suspended=false,west=true": { "model": "tripwire_nsew" }, + "attached=false,east=false,north=false,south=false,suspended=true,west=false": { "model": "tripwire_suspended_ns" }, + "attached=false,east=false,north=true,south=false,suspended=true,west=false": { "model": "tripwire_suspended_n" }, + "attached=false,east=false,north=false,south=true,suspended=true,west=false": { "model": "tripwire_suspended_n", "y": 180 }, + "attached=false,east=true,north=false,south=false,suspended=true,west=false": { "model": "tripwire_suspended_n", "y": 90 }, + "attached=false,east=false,north=false,south=false,suspended=true,west=true": { "model": "tripwire_suspended_n", "y": 270 }, + "attached=false,east=true,north=true,south=false,suspended=true,west=false": { "model": "tripwire_suspended_ne" }, + "attached=false,east=true,north=false,south=true,suspended=true,west=false": { "model": "tripwire_suspended_ne", "y": 90 }, + "attached=false,east=false,north=false,south=true,suspended=true,west=true": { "model": "tripwire_suspended_ne", "y": 180 }, + "attached=false,east=false,north=true,south=false,suspended=true,west=true": { "model": "tripwire_suspended_ne", "y": 270 }, + "attached=false,east=false,north=true,south=true,suspended=true,west=false": { "model": "tripwire_suspended_ns" }, + "attached=false,east=true,north=false,south=false,suspended=true,west=true": { "model": "tripwire_suspended_ns", "y": 90 }, + "attached=false,east=true,north=true,south=true,suspended=true,west=false": { "model": "tripwire_suspended_nse" }, + "attached=false,east=true,north=false,south=true,suspended=true,west=true": { "model": "tripwire_suspended_nse", "y": 90 }, + "attached=false,east=false,north=true,south=true,suspended=true,west=true": { "model": "tripwire_suspended_nse", "y": 180 }, + "attached=false,east=true,north=true,south=false,suspended=true,west=true": { "model": "tripwire_suspended_nse", "y": 270 }, + "attached=false,east=true,north=true,south=true,suspended=true,west=true": { "model": "tripwire_suspended_nsew" }, + "attached=true,east=false,north=false,south=false,suspended=false,west=false": { "model": "tripwire_attached_ns" }, + "attached=true,east=false,north=true,south=false,suspended=false,west=false": { "model": "tripwire_attached_n" }, + "attached=true,east=false,north=false,south=true,suspended=false,west=false": { "model": "tripwire_attached_n", "y": 180 }, + "attached=true,east=true,north=false,south=false,suspended=false,west=false": { "model": "tripwire_attached_n", "y": 90 }, + "attached=true,east=false,north=false,south=false,suspended=false,west=true": { "model": "tripwire_attached_n", "y": 270 }, + "attached=true,east=true,north=true,south=false,suspended=false,west=false": { "model": "tripwire_attached_ne" }, + "attached=true,east=true,north=false,south=true,suspended=false,west=false": { "model": "tripwire_attached_ne", "y": 90 }, + "attached=true,east=false,north=false,south=true,suspended=false,west=true": { "model": "tripwire_attached_ne", "y": 180 }, + "attached=true,east=false,north=true,south=false,suspended=false,west=true": { "model": "tripwire_attached_ne", "y": 270 }, + "attached=true,east=false,north=true,south=true,suspended=false,west=false": { "model": "tripwire_attached_ns" }, + "attached=true,east=true,north=false,south=false,suspended=false,west=true": { "model": "tripwire_attached_ns", "y": 90 }, + "attached=true,east=true,north=true,south=true,suspended=false,west=false": { "model": "tripwire_attached_nse" }, + "attached=true,east=true,north=false,south=true,suspended=false,west=true": { "model": "tripwire_attached_nse", "y": 90 }, + "attached=true,east=false,north=true,south=true,suspended=false,west=true": { "model": "tripwire_attached_nse", "y": 180 }, + "attached=true,east=true,north=true,south=false,suspended=false,west=true": { "model": "tripwire_attached_nse", "y": 270 }, + "attached=true,east=true,north=true,south=true,suspended=false,west=true": { "model": "tripwire_attached_nsew" }, + "attached=true,east=false,north=false,south=false,suspended=true,west=false": { "model": "tripwire_attached_suspended_ns" }, + "attached=true,east=false,north=true,south=false,suspended=true,west=false": { "model": "tripwire_attached_suspended_n" }, + "attached=true,east=false,north=false,south=true,suspended=true,west=false": { "model": "tripwire_attached_suspended_n", "y": 180 }, + "attached=true,east=true,north=false,south=false,suspended=true,west=false": { "model": "tripwire_attached_suspended_n", "y": 90 }, + "attached=true,east=false,north=false,south=false,suspended=true,west=true": { "model": "tripwire_attached_suspended_n", "y": 270 }, + "attached=true,east=true,north=true,south=false,suspended=true,west=false": { "model": "tripwire_attached_suspended_ne" }, + "attached=true,east=true,north=false,south=true,suspended=true,west=false": { "model": "tripwire_attached_suspended_ne", "y": 90 }, + "attached=true,east=false,north=false,south=true,suspended=true,west=true": { "model": "tripwire_attached_suspended_ne", "y": 180 }, + "attached=true,east=false,north=true,south=false,suspended=true,west=true": { "model": "tripwire_attached_suspended_ne", "y": 270 }, + "attached=true,east=false,north=true,south=true,suspended=true,west=false": { "model": "tripwire_attached_suspended_ns" }, + "attached=true,east=true,north=false,south=false,suspended=true,west=true": { "model": "tripwire_attached_suspended_ns", "y": 90 }, + "attached=true,east=true,north=true,south=true,suspended=true,west=false": { "model": "tripwire_attached_suspended_nse" }, + "attached=true,east=true,north=false,south=true,suspended=true,west=true": { "model": "tripwire_attached_suspended_nse", "y": 90 }, + "attached=true,east=false,north=true,south=true,suspended=true,west=true": { "model": "tripwire_attached_suspended_nse", "y": 180 }, + "attached=true,east=true,north=true,south=false,suspended=true,west=true": { "model": "tripwire_attached_suspended_nse", "y": 270 }, + "attached=true,east=true,north=true,south=true,suspended=true,west=true": { "model": "tripwire_attached_suspended_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tripwire_hook.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tripwire_hook.json new file mode 100644 index 0000000..ca09850 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/tripwire_hook.json @@ -0,0 +1,36 @@ +{ + "variants": { + "attached=false,facing=north,powered=false,suspended=false": { "model": "tripwire_hook" }, + "attached=false,facing=south,powered=false,suspended=false": { "model": "tripwire_hook", "y": 180 }, + "attached=false,facing=west,powered=false,suspended=false": { "model": "tripwire_hook", "y": 270 }, + "attached=false,facing=east,powered=false,suspended=false": { "model": "tripwire_hook", "y": 90 }, + "attached=false,facing=north,powered=false,suspended=true": { "model": "tripwire_hook" }, + "attached=false,facing=south,powered=false,suspended=true": { "model": "tripwire_hook", "y": 180 }, + "attached=false,facing=west,powered=false,suspended=true": { "model": "tripwire_hook", "y": 270 }, + "attached=false,facing=east,powered=false,suspended=true": { "model": "tripwire_hook", "y": 90 }, + "attached=true,facing=north,powered=false,suspended=false": { "model": "tripwire_hook_attached" }, + "attached=true,facing=south,powered=false,suspended=false": { "model": "tripwire_hook_attached", "y": 180 }, + "attached=true,facing=west,powered=false,suspended=false": { "model": "tripwire_hook_attached", "y": 270 }, + "attached=true,facing=east,powered=false,suspended=false": { "model": "tripwire_hook_attached", "y": 90 }, + "attached=true,facing=north,powered=false,suspended=true": { "model": "tripwire_hook_attached_suspended" }, + "attached=true,facing=south,powered=false,suspended=true": { "model": "tripwire_hook_attached_suspended", "y": 180 }, + "attached=true,facing=west,powered=false,suspended=true": { "model": "tripwire_hook_attached_suspended", "y": 270 }, + "attached=true,facing=east,powered=false,suspended=true": { "model": "tripwire_hook_attached_suspended", "y": 90 }, + "attached=false,facing=north,powered=true,suspended=false": { "model": "tripwire_hook_powered" }, + "attached=false,facing=south,powered=true,suspended=false": { "model": "tripwire_hook_powered", "y": 180 }, + "attached=false,facing=west,powered=true,suspended=false": { "model": "tripwire_hook_powered", "y": 270 }, + "attached=false,facing=east,powered=true,suspended=false": { "model": "tripwire_hook_powered", "y": 90 }, + "attached=false,facing=north,powered=true,suspended=true": { "model": "tripwire_hook_powered" }, + "attached=false,facing=south,powered=true,suspended=true": { "model": "tripwire_hook_powered", "y": 180 }, + "attached=false,facing=west,powered=true,suspended=true": { "model": "tripwire_hook_powered", "y": 270 }, + "attached=false,facing=east,powered=true,suspended=true": { "model": "tripwire_hook_powered", "y": 90 }, + "attached=true,facing=north,powered=true,suspended=false": { "model": "tripwire_hook_attached_powered" }, + "attached=true,facing=south,powered=true,suspended=false": { "model": "tripwire_hook_attached_powered", "y": 180 }, + "attached=true,facing=west,powered=true,suspended=false": { "model": "tripwire_hook_attached_powered", "y": 270 }, + "attached=true,facing=east,powered=true,suspended=false": { "model": "tripwire_hook_attached_powered", "y": 90 }, + "attached=true,facing=north,powered=true,suspended=true": { "model": "tripwire_hook_attached_suspended_powered" }, + "attached=true,facing=south,powered=true,suspended=true": { "model": "tripwire_hook_attached_suspended_powered", "y": 180 }, + "attached=true,facing=west,powered=true,suspended=true": { "model": "tripwire_hook_attached_suspended_powered", "y": 270 }, + "attached=true,facing=east,powered=true,suspended=true": { "model": "tripwire_hook_attached_suspended_powered", "y": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unlit_redstone_torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unlit_redstone_torch.json new file mode 100644 index 0000000..247565b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unlit_redstone_torch.json @@ -0,0 +1,9 @@ +{ + "variants": { + "facing=up": { "model": "unlit_redstone_torch" }, + "facing=east": { "model": "unlit_redstone_torch_wall" }, + "facing=south": { "model": "unlit_redstone_torch_wall", "y": 90 }, + "facing=west": { "model": "unlit_redstone_torch_wall", "y": 180 }, + "facing=north": { "model": "unlit_redstone_torch_wall", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unpowered_comparator.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unpowered_comparator.json new file mode 100644 index 0000000..afc9988 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unpowered_comparator.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,mode=compare,powered=false": { "model": "comparator_unlit" }, + "facing=west,mode=compare,powered=false": { "model": "comparator_unlit", "y": 90 }, + "facing=north,mode=compare,powered=false": { "model": "comparator_unlit", "y": 180 }, + "facing=east,mode=compare,powered=false": { "model": "comparator_unlit", "y": 270 }, + "facing=south,mode=subtract,powered=false": { "model": "comparator_unlit_subtract" }, + "facing=west,mode=subtract,powered=false": { "model": "comparator_unlit_subtract", "y": 90 }, + "facing=north,mode=subtract,powered=false": { "model": "comparator_unlit_subtract", "y": 180 }, + "facing=east,mode=subtract,powered=false": { "model": "comparator_unlit_subtract", "y": 270 }, + "facing=south,mode=compare,powered=true": { "model": "comparator_lit" }, + "facing=west,mode=compare,powered=true": { "model": "comparator_lit", "y": 90 }, + "facing=north,mode=compare,powered=true": { "model": "comparator_lit", "y": 180 }, + "facing=east,mode=compare,powered=true": { "model": "comparator_lit", "y": 270 }, + "facing=south,mode=subtract,powered=true": { "model": "comparator_lit_subtract" }, + "facing=west,mode=subtract,powered=true": { "model": "comparator_lit_subtract", "y": 90 }, + "facing=north,mode=subtract,powered=true": { "model": "comparator_lit_subtract", "y": 180 }, + "facing=east,mode=subtract,powered=true": { "model": "comparator_lit_subtract", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unpowered_repeater.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unpowered_repeater.json new file mode 100644 index 0000000..e56d79b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/unpowered_repeater.json @@ -0,0 +1,36 @@ +{ + "variants": { + "delay=1,facing=south,locked=false": { "model": "repeater_1tick" }, + "delay=1,facing=west,locked=false": { "model": "repeater_1tick", "y": 90 }, + "delay=1,facing=north,locked=false": { "model": "repeater_1tick", "y": 180 }, + "delay=1,facing=east,locked=false": { "model": "repeater_1tick", "y": 270 }, + "delay=2,facing=south,locked=false": { "model": "repeater_2tick" }, + "delay=2,facing=west,locked=false": { "model": "repeater_2tick", "y": 90 }, + "delay=2,facing=north,locked=false": { "model": "repeater_2tick", "y": 180 }, + "delay=2,facing=east,locked=false": { "model": "repeater_2tick", "y": 270 }, + "delay=3,facing=south,locked=false": { "model": "repeater_3tick" }, + "delay=3,facing=west,locked=false": { "model": "repeater_3tick", "y": 90 }, + "delay=3,facing=north,locked=false": { "model": "repeater_3tick", "y": 180 }, + "delay=3,facing=east,locked=false": { "model": "repeater_3tick", "y": 270 }, + "delay=4,facing=south,locked=false": { "model": "repeater_4tick" }, + "delay=4,facing=west,locked=false": { "model": "repeater_4tick", "y": 90 }, + "delay=4,facing=north,locked=false": { "model": "repeater_4tick", "y": 180 }, + "delay=4,facing=east,locked=false": { "model": "repeater_4tick", "y": 270 }, + "delay=1,facing=south,locked=true": { "model": "repeater_locked_1tick" }, + "delay=1,facing=west,locked=true": { "model": "repeater_locked_1tick", "y": 90 }, + "delay=1,facing=north,locked=true": { "model": "repeater_locked_1tick", "y": 180 }, + "delay=1,facing=east,locked=true": { "model": "repeater_locked_1tick", "y": 270 }, + "delay=2,facing=south,locked=true": { "model": "repeater_locked_2tick" }, + "delay=2,facing=west,locked=true": { "model": "repeater_locked_2tick", "y": 90 }, + "delay=2,facing=north,locked=true": { "model": "repeater_locked_2tick", "y": 180 }, + "delay=2,facing=east,locked=true": { "model": "repeater_locked_2tick", "y": 270 }, + "delay=3,facing=south,locked=true": { "model": "repeater_locked_3tick" }, + "delay=3,facing=west,locked=true": { "model": "repeater_locked_3tick", "y": 90 }, + "delay=3,facing=north,locked=true": { "model": "repeater_locked_3tick", "y": 180 }, + "delay=3,facing=east,locked=true": { "model": "repeater_locked_3tick", "y": 270 }, + "delay=4,facing=south,locked=true": { "model": "repeater_locked_4tick" }, + "delay=4,facing=west,locked=true": { "model": "repeater_locked_4tick", "y": 90 }, + "delay=4,facing=north,locked=true": { "model": "repeater_locked_4tick", "y": 180 }, + "delay=4,facing=east,locked=true": { "model": "repeater_locked_4tick", "y": 270 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/vine.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/vine.json new file mode 100644 index 0000000..db33cdb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/vine.json @@ -0,0 +1,36 @@ +{ + "variants": { + "east=false,north=false,south=false,up=false,west=false": { "model": "vine_1" }, + "east=false,north=false,south=true,up=false,west=false": { "model": "vine_1" }, + "east=false,north=false,south=false,up=false,west=true": { "model": "vine_1", "y": 90 }, + "east=false,north=true,south=false,up=false,west=false": { "model": "vine_1", "y": 180 }, + "east=true,north=false,south=false,up=false,west=false": { "model": "vine_1", "y": 270 }, + "east=true,north=true,south=false,up=false,west=false": { "model": "vine_2" }, + "east=true,north=false,south=true,up=false,west=false": { "model": "vine_2", "y": 90 }, + "east=false,north=false,south=true,up=false,west=true": { "model": "vine_2", "y": 180 }, + "east=false,north=true,south=false,up=false,west=true": { "model": "vine_2", "y": 270 }, + "east=true,north=false,south=false,up=false,west=true": { "model": "vine_2_opposite" }, + "east=false,north=true,south=true,up=false,west=false": { "model": "vine_2_opposite", "y": 90 }, + "east=true,north=true,south=true,up=false,west=false": { "model": "vine_3" }, + "east=true,north=false,south=true,up=false,west=true": { "model": "vine_3", "y": 90 }, + "east=false,north=true,south=true,up=false,west=true": { "model": "vine_3", "y": 180 }, + "east=true,north=true,south=false,up=false,west=true": { "model": "vine_3", "y": 270 }, + "east=true,north=true,south=true,up=false,west=true": { "model": "vine_4" }, + "east=false,north=false,south=false,up=true,west=false": { "model": "vine_u" }, + "east=false,north=false,south=true,up=true,west=false": { "model": "vine_1u" }, + "east=false,north=false,south=false,up=true,west=true": { "model": "vine_1u", "y": 90 }, + "east=false,north=true,south=false,up=true,west=false": { "model": "vine_1u", "y": 180 }, + "east=true,north=false,south=false,up=true,west=false": { "model": "vine_1u", "y": 270 }, + "east=true,north=true,south=false,up=true,west=false": { "model": "vine_2u" }, + "east=true,north=false,south=true,up=true,west=false": { "model": "vine_2u", "y": 90 }, + "east=false,north=false,south=true,up=true,west=true": { "model": "vine_2u", "y": 180 }, + "east=false,north=true,south=false,up=true,west=true": { "model": "vine_2u", "y": 270 }, + "east=true,north=false,south=false,up=true,west=true": { "model": "vine_2u_opposite" }, + "east=false,north=true,south=true,up=true,west=false": { "model": "vine_2u_opposite", "y": 90 }, + "east=true,north=true,south=true,up=true,west=false": { "model": "vine_3u" }, + "east=true,north=false,south=true,up=true,west=true": { "model": "vine_3u", "y": 90 }, + "east=false,north=true,south=true,up=true,west=true": { "model": "vine_3u", "y": 180 }, + "east=true,north=true,south=false,up=true,west=true": { "model": "vine_3u", "y": 270 }, + "east=true,north=true,south=true,up=true,west=true": { "model": "vine_4u" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/waterlily.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/waterlily.json new file mode 100644 index 0000000..f2561bc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/waterlily.json @@ -0,0 +1,10 @@ +{ + "variants": { + "normal": [ + { "model": "waterlily" }, + { "model": "waterlily", "y": 90 }, + { "model": "waterlily", "y": 180 }, + { "model": "waterlily", "y": 270 } + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/web.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/web.json new file mode 100644 index 0000000..1e87e7a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/web.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "web" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wheat.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wheat.json new file mode 100644 index 0000000..4bfe6ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wheat.json @@ -0,0 +1,12 @@ +{ + "variants": { + "age=0": { "model": "wheat_stage0" }, + "age=1": { "model": "wheat_stage1" }, + "age=2": { "model": "wheat_stage2" }, + "age=3": { "model": "wheat_stage3" }, + "age=4": { "model": "wheat_stage4" }, + "age=5": { "model": "wheat_stage5" }, + "age=6": { "model": "wheat_stage6" }, + "age=7": { "model": "wheat_stage7" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_carpet.json new file mode 100644 index 0000000..a3c906d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_white" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_glass.json new file mode 100644 index 0000000..1b8ca76 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_white" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_glass_pane.json new file mode 100644 index 0000000..cf31098 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "white_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "white_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "white_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "white_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "white_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "white_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "white_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "white_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "white_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "white_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "white_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "white_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "white_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "white_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "white_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "white_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_hardened_clay.json new file mode 100644 index 0000000..6a8c647 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_white" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_tulip.json new file mode 100644 index 0000000..96b9b8b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_tulip.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "white_tulip" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_wool.json new file mode 100644 index 0000000..1176a0b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/white_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "white_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wood_old_double_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wood_old_double_slab.json new file mode 100644 index 0000000..538db7e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wood_old_double_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "normal": { "model": "oak_planks" }, + "all": { "model": "oak_planks" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wood_old_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wood_old_slab.json new file mode 100644 index 0000000..80d06ee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wood_old_slab.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "half_slab_oak" }, + "half=top": { "model": "upper_slab_oak" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_button.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_button.json new file mode 100644 index 0000000..b1ba947 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_button.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=up,powered=false": { "model": "wooden_button" }, + "facing=down,powered=false": { "model": "wooden_button", "x": 180 }, + "facing=east,powered=false": { "model": "wooden_button", "x": 90, "y": 90 }, + "facing=west,powered=false": { "model": "wooden_button", "x": 90, "y": 270 }, + "facing=south,powered=false": { "model": "wooden_button", "x": 90, "y": 180 }, + "facing=north,powered=false": { "model": "wooden_button", "x": 90 }, + "facing=up,powered=true": { "model": "wooden_button_pressed" }, + "facing=down,powered=true": { "model": "wooden_button_pressed", "x": 180 }, + "facing=east,powered=true": { "model": "wooden_button_pressed", "x": 90, "y": 90 }, + "facing=west,powered=true": { "model": "wooden_button_pressed", "x": 90, "y": 270 }, + "facing=south,powered=true": { "model": "wooden_button_pressed", "x": 90, "y": 180 }, + "facing=north,powered=true": { "model": "wooden_button_pressed", "x": 90 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_door.json new file mode 100644 index 0000000..d91869b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_door.json @@ -0,0 +1,36 @@ +{ + "variants": { + "facing=east,half=lower,hinge=left,open=false": { "model": "wooden_door_bottom" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "wooden_door_bottom", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "wooden_door_bottom", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "wooden_door_bottom", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "wooden_door_bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "wooden_door_bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "wooden_door_bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "wooden_door_bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "wooden_door_bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "wooden_door_bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "wooden_door_bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "wooden_door_bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "wooden_door_bottom", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "wooden_door_bottom" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "wooden_door_bottom", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "wooden_door_bottom", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "wooden_door_top" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "wooden_door_top", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "wooden_door_top", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "wooden_door_top", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "wooden_door_top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "wooden_door_top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "wooden_door_top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "wooden_door_top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "wooden_door_top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "wooden_door_top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "wooden_door_top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "wooden_door_top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "wooden_door_top", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "wooden_door_top" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "wooden_door_top", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "wooden_door_top", "y": 180 } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_pressure_plate.json new file mode 100644 index 0000000..e34ab2e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/wooden_pressure_plate.json @@ -0,0 +1,6 @@ +{ + "variants": { + "powered=false": { "model": "wooden_pressure_plate_up" }, + "powered=true": { "model": "wooden_pressure_plate_down" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_carpet.json new file mode 100644 index 0000000..075fbfb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_carpet.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "carpet_yellow" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_glass.json new file mode 100644 index 0000000..5396738 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_glass.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "glass_yellow" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_glass_pane.json new file mode 100644 index 0000000..52a6ea4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_glass_pane.json @@ -0,0 +1,20 @@ +{ + "variants": { + "east=false,north=false,south=false,west=false": { "model": "yellow_pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "yellow_pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "yellow_pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "yellow_pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "yellow_pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "yellow_pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "yellow_pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "yellow_pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "yellow_pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "yellow_pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "yellow_pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "yellow_pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "yellow_pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "yellow_pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "yellow_pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "yellow_pane_nsew" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_hardened_clay.json new file mode 100644 index 0000000..3c46d24 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_stained_hardened_clay.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "hardened_clay_yellow" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_wool.json new file mode 100644 index 0000000..24ddf68 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/blockstates/yellow_wool.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "yellow_wool" } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_no_stars.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_no_stars.png new file mode 100644 index 0000000..db806ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_no_stars.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_1.png new file mode 100644 index 0000000..012b18b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_2.png new file mode 100644 index 0000000..572ba45 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_3.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_3.png new file mode 100644 index 0000000..089efaf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_4.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_4.png new file mode 100644 index 0000000..4b3b102 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_5.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_5.png new file mode 100644 index 0000000..d15b1d0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_6.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_6.png new file mode 100644 index 0000000..57bd14c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_7.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_7.png new file mode 100644 index 0000000..612bb49 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_8.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_8.png new file mode 100644 index 0000000..e294dab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_no_stars.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_no_stars.png new file mode 100644 index 0000000..1d22080 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_no_stars.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_1.png new file mode 100644 index 0000000..2757c37 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_2.png new file mode 100644 index 0000000..8833ece Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_3.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_3.png new file mode 100644 index 0000000..ab0c98c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_4.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_4.png new file mode 100644 index 0000000..eaaaaa2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_5.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_5.png new file mode 100644 index 0000000..75ee1be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_6.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_6.png new file mode 100644 index 0000000..14ca58f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_7.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_7.png new file mode 100644 index 0000000..40ca7d7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_8.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_8.png new file mode 100644 index 0000000..7124738 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb.png new file mode 100644 index 0000000..a9553c5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb2.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb2.png new file mode 100644 index 0000000..d3958a5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb_gold.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb_gold.png new file mode 100644 index 0000000..4a2f62f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb_gold.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb_test.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb_test.png new file mode 100644 index 0000000..9bf1247 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/cb_test.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/classic/cb_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/classic/cb_black.png new file mode 100644 index 0000000..4a6fa34 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/classic/cb_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/classic/cb_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/classic/cb_white.png new file mode 100644 index 0000000..7cf80ab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/classic/cb_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/ass.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/ass.png new file mode 100644 index 0000000..54feb11 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/ass.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/dack.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/dack.png new file mode 100644 index 0000000..e095dc7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/dack.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/qiir.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/qiir.png new file mode 100644 index 0000000..1887480 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/qiir.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/roses.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/roses.png new file mode 100644 index 0000000..829b7c2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/roses.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/turbine.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/turbine.png new file mode 100644 index 0000000..097d0f0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/turbine.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/waterfall.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/waterfall.png new file mode 100644 index 0000000..52435bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/custom/waterfall.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/blue.png new file mode 100644 index 0000000..74cc079 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/green.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/green.png new file mode 100644 index 0000000..a1ddc02 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/orange.png new file mode 100644 index 0000000..3653b85 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/pink.png new file mode 100644 index 0000000..b60aa72 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/purple.png new file mode 100644 index 0000000..90f334b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/red.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/red.png new file mode 100644 index 0000000..22703e8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/teal.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/teal.png new file mode 100644 index 0000000..93e0f47 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/teal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/yellow.png new file mode 100644 index 0000000..3c2ac6f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark/yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/blue.png new file mode 100644 index 0000000..782955b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/green.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/green.png new file mode 100644 index 0000000..80f08b7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/light_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/light_blue.png new file mode 100644 index 0000000..22d0525 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/light_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/orange.png new file mode 100644 index 0000000..7afbf00 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/pink.png new file mode 100644 index 0000000..4d2f03d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/purple.png new file mode 100644 index 0000000..4ce3b0e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/red.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/red.png new file mode 100644 index 0000000..758942b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/yellow.png new file mode 100644 index 0000000..5ab10b5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/dark_gradient/yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/gapple.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/gapple.png new file mode 100644 index 0000000..9c3f870 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/gapple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/golden_carrot.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/golden_carrot.png new file mode 100644 index 0000000..ad42cae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/golden_carrot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/potion.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/potion.png new file mode 100644 index 0000000..99f13ce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/potion.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/steak.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/steak.png new file mode 100644 index 0000000..bd505e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/steak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/sword.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/sword.png new file mode 100644 index 0000000..d5ae299 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/items/sword.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/tiktok.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/tiktok.png new file mode 100644 index 0000000..ce5ec7d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/tiktok.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/twitch.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/twitch.png new file mode 100644 index 0000000..33020c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/twitch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/twitch_purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/twitch_purple.png new file mode 100644 index 0000000..691d860 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/twitch_purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube.png new file mode 100644 index 0000000..30d7146 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube_black.png new file mode 100644 index 0000000..ad8860e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube_red.png new file mode 100644 index 0000000..3ac32fc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/media/youtube_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/trailer/black.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/trailer/black.png new file mode 100644 index 0000000..17ed1d3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/trailer/black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/trailer/white.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/trailer/white.png new file mode 100644 index 0000000..b2c4648 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/capes/trailer/white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/dash-logo-54.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/dash-logo-54.png new file mode 100644 index 0000000..af8399c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/dash-logo-54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair.png new file mode 100644 index 0000000..25336bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_birch.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_birch.png new file mode 100644 index 0000000..25336bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_birch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_desert.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_desert.png new file mode 100644 index 0000000..3dc877d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_desert.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_hills.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_hills.png new file mode 100644 index 0000000..0c03ca4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_hills.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_mesa.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_mesa.png new file mode 100644 index 0000000..aa59a44 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_mesa.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_nether.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_nether.png new file mode 100644 index 0000000..20a88ea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_nether.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_roofed.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_roofed.png new file mode 100644 index 0000000..299deff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_roofed.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_sky.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_sky.png new file mode 100644 index 0000000..8d7294a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_sky.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_swamp.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_swamp.png new file mode 100644 index 0000000..55c1aec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/crosshair_swamp.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/steve.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/steve.png new file mode 100644 index 0000000..3ea14f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/defaults/steve.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/dab.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/dab.png new file mode 100644 index 0000000..2fab5df Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/dab.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/facepalm.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/facepalm.png new file mode 100644 index 0000000..4a62ba4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/facepalm.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/floss.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/floss.png new file mode 100644 index 0000000..fb4891e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/floss.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/handsup.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/handsup.png new file mode 100644 index 0000000..e0e3f9c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/handsup.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/narutorun.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/narutorun.png new file mode 100644 index 0000000..dd9893a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/narutorun.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/shrug.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/shrug.png new file mode 100644 index 0000000..354fb54 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/shrug.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/superfacepalm.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/superfacepalm.png new file mode 100644 index 0000000..93e51e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/superfacepalm.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/tpose.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/tpose.png new file mode 100644 index 0000000..81cc96a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/tpose.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/wave.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/wave.png new file mode 100644 index 0000000..d34117b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/emote/wave.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Play-Bold.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Play-Bold.ttf new file mode 100644 index 0000000..7b9d5bf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Play-Bold.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Play-Regular.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Play-Regular.ttf new file mode 100644 index 0000000..57ab4b1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Play-Regular.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-Black.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-Black.ttf new file mode 100644 index 0000000..6805f4f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-Black.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-ExtraBold.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-ExtraBold.ttf new file mode 100644 index 0000000..502ff86 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-ExtraBold.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-ExtraLight.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-ExtraLight.ttf new file mode 100644 index 0000000..7611e96 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-ExtraLight.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-Light.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-Light.ttf new file mode 100644 index 0000000..91aa0c7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-Light.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-SemiBold.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-SemiBold.ttf new file mode 100644 index 0000000..ed0a8b9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Raleway-SemiBold.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Bold.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Bold.ttf new file mode 100644 index 0000000..d3f01ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Bold.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Light.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Light.ttf new file mode 100644 index 0000000..219063a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Light.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Medium.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Medium.ttf new file mode 100644 index 0000000..1a7f3b0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Medium.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Regular.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Regular.ttf new file mode 100644 index 0000000..2c97eea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Roboto-Regular.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-B.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-B.ttf new file mode 100644 index 0000000..b173da2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-B.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-M.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-M.ttf new file mode 100644 index 0000000..ca9c03a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-M.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-R.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-R.ttf new file mode 100644 index 0000000..d748728 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/Ubuntu-R.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/font/minecraft-reg.ttf b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/minecraft-reg.ttf new file mode 100644 index 0000000..c1be72b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/font/minecraft-reg.ttf differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icon-1.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icon-1.png new file mode 100644 index 0000000..be74ee1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icon-1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icon-2.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icon-2.png new file mode 100644 index 0000000..625e25f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icon-2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/arrow-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/arrow-64.png new file mode 100644 index 0000000..aa21af7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/arrow-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/bossbar/blurred.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/bossbar/blurred.png new file mode 100644 index 0000000..7c3b218 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/bossbar/blurred.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/bossbar/default.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/bossbar/default.png new file mode 100644 index 0000000..1d212ed Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/bossbar/default.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/cb.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/cb.png new file mode 100644 index 0000000..18c774d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/cb.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/checkmark-32.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/checkmark-32.png new file mode 100644 index 0000000..4520ba1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/checkmark-32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/checkmark-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/checkmark-64.png new file mode 100644 index 0000000..7d3a829 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/checkmark-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/circle-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/circle-64.png new file mode 100644 index 0000000..949bf1e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/circle-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/circle-hollow-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/circle-hollow-64.png new file mode 100644 index 0000000..62905c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/circle-hollow-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/cog-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/cog-64.png new file mode 100644 index 0000000..ad627d4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/cog-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/compact-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/compact-64.png new file mode 100644 index 0000000..5754c09 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/compact-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/delete-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/delete-64.png new file mode 100644 index 0000000..192b33d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/delete-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/error-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/error-64.png new file mode 100644 index 0000000..55194fa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/error-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/exit-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/exit-64.png new file mode 100644 index 0000000..38f2f02 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/exit-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/eye-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/eye-64.png new file mode 100644 index 0000000..99d7aa4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/eye-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/folder.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/folder.png new file mode 100644 index 0000000..e1683d9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/folder.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/fps-52.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/fps-52.png new file mode 100644 index 0000000..29cfa21 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/fps-52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/fps-inverse-52.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/fps-inverse-52.png new file mode 100644 index 0000000..74c637b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/fps-inverse-52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/garbage-26.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/garbage-26.png new file mode 100644 index 0000000..b2735ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/garbage-26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/garbage-32.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/garbage-32.png new file mode 100644 index 0000000..e34f168 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/garbage-32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/globe-24.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/globe-24.png new file mode 100644 index 0000000..d0c9a88 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/globe-24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/headphones.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/headphones.png new file mode 100644 index 0000000..0333749 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/headphones.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/info-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/info-64.png new file mode 100644 index 0000000..cdc57fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/info-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/left.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/left.png new file mode 100644 index 0000000..252d54a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/left.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/letter-t-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/letter-t-64.png new file mode 100644 index 0000000..b0e83ca Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/letter-t-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/microphone-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/microphone-64.png new file mode 100644 index 0000000..262f871 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/microphone-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/bossbar.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/bossbar.png new file mode 100644 index 0000000..5c0c027 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/bossbar.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/cooldowns.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/cooldowns.png new file mode 100644 index 0000000..4c15042 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/cooldowns.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/diamond_chestplate.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/diamond_chestplate.png new file mode 100644 index 0000000..0dab078 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/diamond_chestplate.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/dirhud.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/dirhud.png new file mode 100644 index 0000000..3c7fd3c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/dirhud.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/ench_sword.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/ench_sword.png new file mode 100644 index 0000000..f9e987b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/ench_sword.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/env-changer.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/env-changer.png new file mode 100644 index 0000000..444b7b2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/env-changer.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/hittint.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/hittint.png new file mode 100644 index 0000000..605f670 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/hittint.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/hypixel.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/hypixel.png new file mode 100644 index 0000000..d8ee251 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/hypixel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/overlay.png new file mode 100644 index 0000000..c3189c0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/packtweaks.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/packtweaks.png new file mode 100644 index 0000000..b9a9cf7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/packtweaks.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/scoreb.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/scoreb.png new file mode 100644 index 0000000..5348544 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/scoreb.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/speed_icon.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/speed_icon.png new file mode 100644 index 0000000..4771092 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/speed_icon.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/swordblur.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/swordblur.png new file mode 100644 index 0000000..60f5854 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/swordblur.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/tnt.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/tnt.png new file mode 100644 index 0000000..77550ee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/tnt.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/wasd.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/wasd.png new file mode 100644 index 0000000..acd0971 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/wasd.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/zans.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/zans.png new file mode 100644 index 0000000..29c8dea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mods/zans.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/moon-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/moon-64.png new file mode 100644 index 0000000..42793ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/moon-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mute.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mute.png new file mode 100644 index 0000000..9351e8b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/mute.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/pencil-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/pencil-64.png new file mode 100644 index 0000000..114ac16 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/pencil-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/play-24.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/play-24.png new file mode 100644 index 0000000..f0809f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/play-24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/play-32.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/play-32.png new file mode 100644 index 0000000..9106c07 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/play-32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/plus-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/plus-64.png new file mode 100644 index 0000000..2c54d73 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/plus-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/profiles-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/profiles-64.png new file mode 100644 index 0000000..c9bd7f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/profiles-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/reset-cog-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/reset-cog-64.png new file mode 100644 index 0000000..2ee37e8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/reset-cog-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/right.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/right.png new file mode 100644 index 0000000..f063123 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/right.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/servers/minehq.com.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/servers/minehq.com.png new file mode 100644 index 0000000..5690f05 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/servers/minehq.com.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/speaker-mute.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/speaker-mute.png new file mode 100644 index 0000000..2901004 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/speaker-mute.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/speaker.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/speaker.png new file mode 100644 index 0000000..9d4c8d0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/speaker.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-21.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-21.png new file mode 100644 index 0000000..3dde9c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-64.png new file mode 100644 index 0000000..6b5ce1c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-filled-21.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-filled-21.png new file mode 100644 index 0000000..02849ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/star-filled-21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/sun-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/sun-64.png new file mode 100644 index 0000000..9ddc42a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/sun-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/theme-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/theme-64.png new file mode 100644 index 0000000..0a79014 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/theme-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/volume-mute-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/volume-mute-64.png new file mode 100644 index 0000000..7659a2c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/volume-mute-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/volume-up-64.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/volume-up-64.png new file mode 100644 index 0000000..5352fff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/icons/volume-up-64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_108.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_108.png new file mode 100644 index 0000000..d8f31ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_108.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_108_inner.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_108_inner.png new file mode 100644 index 0000000..22392dd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_108_inner.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_160.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_160.png new file mode 100644 index 0000000..b90235b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_160.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_255_outer.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_255_outer.png new file mode 100644 index 0000000..8e723c6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_255_outer.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_26.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_26.png new file mode 100644 index 0000000..a9442f1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_32.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_32.png new file mode 100644 index 0000000..886e153 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_42.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_42.png new file mode 100644 index 0000000..79d4239 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_inner.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_inner.png new file mode 100644 index 0000000..dec2a5e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_inner.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_outer.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_outer.png new file mode 100644 index 0000000..09c0263 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_outer.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_red.png new file mode 100644 index 0000000..c0a651f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_red_circle.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_red_circle.png new file mode 100644 index 0000000..e83cfd8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_red_circle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_redblack_circle.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_redblack_circle.png new file mode 100644 index 0000000..9d86a43 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_redblack_circle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white.png new file mode 100644 index 0000000..9de1037 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white_1.png new file mode 100644 index 0000000..90f1404 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white_2.png new file mode 100644 index 0000000..b2c7dc6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/logo_white_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/0.png new file mode 100644 index 0000000..74780a7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/1.png new file mode 100644 index 0000000..a8dd000 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/2.png new file mode 100644 index 0000000..2da42f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/3.png new file mode 100644 index 0000000..76b74f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/4.png new file mode 100644 index 0000000..2daf050 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/5.png new file mode 100644 index 0000000..bf0df02 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/0.png new file mode 100644 index 0000000..e399d2a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/1.png new file mode 100644 index 0000000..04760a1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/2.png new file mode 100644 index 0000000..3aa7a4c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/3.png new file mode 100644 index 0000000..51c9066 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/4.png new file mode 100644 index 0000000..33e5c6c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/5.png new file mode 100644 index 0000000..0047236 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/splash.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/splash.png new file mode 100644 index 0000000..ff512a8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/panorama/christmas/splash.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/presets/Preset 1.cfg b/Client-1.8.9/src/main/resources/assets/minecraft/client/presets/Preset 1.cfg new file mode 100644 index 0000000..67c3c69 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/client/presets/Preset 1.cfg @@ -0,0 +1,113 @@ +################################ +# MC_Client: MODULE SETTINGS +################################ + +[HUD Info] +-State=true +-Position=LEFT_TOP +-xTranslation=0 +-yTranslation=1 +Show While Typing=true +Coordinates=true +Direction=true +FPS=false +Coords Color=f +Direction Color=a +FPS Color=7 + +[Zans Minimap] +-State=false +-Position=RIGHT_TOP +-xTranslation=0 +-yTranslation=0 + +[ToggleSprint] +-State=true +-Position=LEFT_TOP +-xTranslation=1 +-yTranslation=12 +Toggle Sprint=true +Toggle Sneak=false +Show HUD Text=true +Text Color=f +Double Tap=false +Show While Typing=true +Fly Boost=true +Fly Boost Amount=4 + +[Potion Effects] +-State=true +-Position=LEFT_MIDDLE +-xTranslation=0 +-yTranslation=-2 +Show While Typing=true +Effect Name=true +Blink=true +Blink Duration=10 +Name Color=f +Duration Color=f + +[Armor Status] +-State=true +-Position=RIGHT_BOTTOM +-xTranslation=-3 +-yTranslation=-4 +List Mode=vertical +Item Name=false +Item Count=true +Equipped Item=true +Show While Typing=false +Damage Overlay=true +Show Item Damage=true +Show Armor Damage=true +Show Max Damage=false +Damage Display Type=value +Damage Threshold Type=percent + +[Key Strokes] +-State=false +-Position=RIGHT_TOP +-xTranslation=-8 +-yTranslation=5 +Show clicks=true +Show movement keys=true +Show spacebar=true + +[Scoreboard] +-State=false +-Position=RIGHT_MIDDLE +-xTranslation=0 +-yTranslation=0 +Scale=1.0 +Remove Scoreboard numbers=true + +[Cooldowns] +-State=false +-Position=MIDDLE_TOP +-xTranslation=0 +-yTranslation=5 +Color Theme=Bright +List Mode=horizontal + +[Notification] +-State=false +-Position=MIDDLE_MIDDLE +-xTranslation=0 +-yTranslation=-50 + +[Direction HUD] +-State=false +-Position=MIDDLE_BOTTOM_RIGHT +-xTranslation=25 +-yTranslation=-31 +Show While Typing=true +Marker Color=c + +[CPS] +-State=true +-Position=MIDDLE_TOP +-xTranslation=440 +-yTranslation=0 +Show Background=true +Text Color=f + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/black.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/black.png new file mode 100644 index 0000000..1b07006 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/blue.png new file mode 100644 index 0000000..2133e48 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/bone.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/bone.png new file mode 100644 index 0000000..f76e12e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/bone.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/darkblue.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/darkblue.png new file mode 100644 index 0000000..f08902b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/darkblue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/gold.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/gold.png new file mode 100644 index 0000000..f7e53c4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/gold.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/green.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/green.png new file mode 100644 index 0000000..bf20f35 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/indigo.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/indigo.png new file mode 100644 index 0000000..0c96559 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/indigo.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/orange.png new file mode 100644 index 0000000..4e61a05 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/pink.png new file mode 100644 index 0000000..43ce4b4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/purple.png new file mode 100644 index 0000000..1a106c9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/red.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/red.png new file mode 100644 index 0000000..895fbe4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/turquoise.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/turquoise.png new file mode 100644 index 0000000..260e9e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/turquoise.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/yellow.png new file mode 100644 index 0000000..ab92163 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/preview/wings/yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/message.ogg b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/message.ogg new file mode 100644 index 0000000..dc1ff71 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/message.ogg differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/short_whoosh1.ogg b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/short_whoosh1.ogg new file mode 100644 index 0000000..0358b94 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/short_whoosh1.ogg differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/shutter.ogg b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/shutter.ogg new file mode 100644 index 0000000..5c4a98b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/shutter.ogg differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/voice_down.ogg b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/voice_down.ogg new file mode 100644 index 0000000..58f8661 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/voice_down.ogg differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/voice_up.ogg b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/voice_up.ogg new file mode 100644 index 0000000..073cad2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/sound/voice_up.ogg differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/black.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/black.png new file mode 100644 index 0000000..b8a680c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/blue.png new file mode 100644 index 0000000..e83a36a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/dark_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/dark_blue.png new file mode 100644 index 0000000..4699a91 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/dark_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/green.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/green.png new file mode 100644 index 0000000..ff0ea2a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/purple.png new file mode 100644 index 0000000..bd45328 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/red.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/red.png new file mode 100644 index 0000000..3ee1706 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/turquoise.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/turquoise.png new file mode 100644 index 0000000..d31b639 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/turquoise.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/yellow.png new file mode 100644 index 0000000..687562d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/client/wings/yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/font/glyph_sizes.bin b/Client-1.8.9/src/main/resources/assets/minecraft/font/glyph_sizes.bin new file mode 100644 index 0000000..69c857e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/font/glyph_sizes.bin differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/lang/en_US.lang b/Client-1.8.9/src/main/resources/assets/minecraft/lang/en_US.lang new file mode 100644 index 0000000..c38ac44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/lang/en_US.lang @@ -0,0 +1,2679 @@ + +language.name=English +language.region=US +language.code=en_US + +gui.done=Done +gui.cancel=Cancel +gui.back=Back +gui.toTitle=Back to title screen +gui.toMenu=Back to server list +gui.up=Up +gui.down=Down +gui.yes=Yes +gui.no=No +gui.none=None +gui.all=All + +translation.test.none=Hello, world! +translation.test.complex=Prefix, %s%2$s again %s and %1$s lastly %s and also %1$s again! +translation.test.escape=%%s %%%s %%%%s %%%%%s +translation.test.invalid=hi % +translation.test.invalid2=hi % s +translation.test.args=%s %s +translation.test.world=world + +menu.game=Game menu +menu.singleplayer=Singleplayer +menu.multiplayer=Multiplayer +menu.online=Minecraft Realms +menu.options=Options... +menu.quit=Quit Game +menu.returnToMenu=Save and Quit to Title +menu.disconnect=Disconnect +menu.returnToGame=Back to Game +menu.switchingLevel=Switching worlds +menu.generatingLevel=Generating world +menu.loadingLevel=Loading world +menu.generatingTerrain=Building terrain +menu.convertingLevel=Converting world +menu.simulating=Simulating the world for a bit +menu.respawning=Respawning +menu.shareToLan=Open to LAN + +selectWorld.title=Select World +selectWorld.empty=empty +selectWorld.world=World +selectWorld.select=Play Selected World +selectWorld.create=Create New World +selectWorld.recreate=Re-Create +selectWorld.createDemo=Play New Demo World +selectWorld.delete=Delete +selectWorld.rename=Rename +selectWorld.deleteQuestion=Are you sure you want to delete this world? +selectWorld.deleteWarning=will be lost forever! (A long time!) +selectWorld.deleteButton=Delete +selectWorld.renameButton=Rename +selectWorld.renameTitle=Rename World +selectWorld.conversion=Must be converted! +selectWorld.newWorld=New World +selectWorld.newWorld.copyOf=Copy of %s +selectWorld.enterName=World Name +selectWorld.resultFolder=Will be saved in: +selectWorld.enterSeed=Seed for the World Generator +selectWorld.seedInfo=Leave blank for a random seed +selectWorld.cheats=Cheats +selectWorld.customizeType=Customize + +createWorld.customize.presets=Presets +createWorld.customize.presets.title=Select a Preset +createWorld.customize.presets.select=Use Preset +createWorld.customize.presets.share=Want to share your preset with someone? Use the below box! +createWorld.customize.presets.list=Alternatively, here's some we made earlier! +createWorld.customize.flat.title=Superflat Customization +createWorld.customize.flat.tile=Layer Material +createWorld.customize.flat.height=Height +createWorld.customize.flat.addLayer=Add Layer +createWorld.customize.flat.editLayer=Edit Layer +createWorld.customize.flat.removeLayer=Remove Layer +createWorld.customize.flat.layer.top=Top - %d +createWorld.customize.flat.layer=%d +createWorld.customize.flat.layer.bottom=Bottom - %d + +createWorld.customize.custom.page0=Basic Settings +createWorld.customize.custom.page1=Ore Settings +createWorld.customize.custom.page2=Advanced Settings (Expert Users Only!) +createWorld.customize.custom.page3=Extra Advanced Settings (Expert Users Only!) +createWorld.customize.custom.randomize=Randomize +createWorld.customize.custom.prev=Previous Page +createWorld.customize.custom.next=Next Page +createWorld.customize.custom.defaults=Defaults +createWorld.customize.custom.confirm1=This will overwrite your current +createWorld.customize.custom.confirm2=settings and cannot be undone. +createWorld.customize.custom.confirmTitle=Warning! +createWorld.customize.custom.mainNoiseScaleX=Main Noise Scale X +createWorld.customize.custom.mainNoiseScaleY=Main Noise Scale Y +createWorld.customize.custom.mainNoiseScaleZ=Main Noise Scale Z +createWorld.customize.custom.depthNoiseScaleX=Depth Noise Scale X +createWorld.customize.custom.depthNoiseScaleZ=Depth Noise Scale Z +createWorld.customize.custom.depthNoiseScaleExponent=Depth Noise Exponent +createWorld.customize.custom.baseSize=Depth Base Size +createWorld.customize.custom.coordinateScale=Coordinate Scale +createWorld.customize.custom.heightScale=Height Scale +createWorld.customize.custom.stretchY=Height Stretch +createWorld.customize.custom.upperLimitScale=Upper Limit Scale +createWorld.customize.custom.lowerLimitScale=Lower Limit Scale +createWorld.customize.custom.biomeDepthWeight=Biome Depth Weight +createWorld.customize.custom.biomeDepthOffset=Biome Depth Offset +createWorld.customize.custom.biomeScaleWeight=Biome Scale Weight +createWorld.customize.custom.biomeScaleOffset=Biome Scale Offset +createWorld.customize.custom.seaLevel=Sea Level +createWorld.customize.custom.useCaves=Caves +createWorld.customize.custom.useStrongholds=Strongholds +createWorld.customize.custom.useVillages=Villages +createWorld.customize.custom.useMineShafts=Mineshafts +createWorld.customize.custom.useTemples=Temples +createWorld.customize.custom.useMonuments=Ocean Monuments +createWorld.customize.custom.useRavines=Ravines +createWorld.customize.custom.useDungeons=Dungeons +createWorld.customize.custom.dungeonChance=Dungeon Count +createWorld.customize.custom.useWaterLakes=Water Lakes +createWorld.customize.custom.waterLakeChance=Water Lake Rarity +createWorld.customize.custom.useLavaLakes=Lava Lakes +createWorld.customize.custom.lavaLakeChance=Lava Lake Rarity +createWorld.customize.custom.useLavaOceans=Lava Oceans +createWorld.customize.custom.fixedBiome=Biome +createWorld.customize.custom.biomeSize=Biome Size +createWorld.customize.custom.riverSize=River Size + +createWorld.customize.custom.size= Spawn Size +createWorld.customize.custom.count= Spawn Tries +createWorld.customize.custom.minHeight= Min. Height +createWorld.customize.custom.maxHeight= Max. Height +createWorld.customize.custom.center= Center Height +createWorld.customize.custom.spread= Spread Height + +createWorld.customize.custom.presets.title=Customize World Presets +createWorld.customize.custom.presets=Presets +createWorld.customize.custom.preset.waterWorld=Water World +createWorld.customize.custom.preset.isleLand=Isle Land +createWorld.customize.custom.preset.caveDelight=Caver's Delight +createWorld.customize.custom.preset.mountains=Mountain Madness +createWorld.customize.custom.preset.drought=Drought +createWorld.customize.custom.preset.caveChaos=Caves of Chaos +createWorld.customize.custom.preset.goodLuck=Good Luck + +gameMode.survival=Survival Mode +gameMode.creative=Creative Mode +gameMode.adventure=Adventure Mode +gameMode.spectator=Spectator Mode +gameMode.hardcore=Hardcore Mode! +gameMode.changed=Your game mode has been updated + +selectWorld.gameMode=Game Mode +selectWorld.gameMode.survival=Survival +selectWorld.gameMode.survival.line1=Search for resources, crafting, gain +selectWorld.gameMode.survival.line2=levels, health and hunger +selectWorld.gameMode.creative=Creative +selectWorld.gameMode.creative.line1=Unlimited resources, free flying and +selectWorld.gameMode.creative.line2=destroy blocks instantly +selectWorld.gameMode.spectator=Spectator +selectWorld.gameMode.spectator.line1=You can look but don't touch +selectWorld.gameMode.spectator.line2= +selectWorld.gameMode.hardcore=Hardcore +selectWorld.gameMode.hardcore.line1=Same as survival mode, locked at hardest +selectWorld.gameMode.hardcore.line2=difficulty, and one life only +selectWorld.gameMode.adventure=Adventure +selectWorld.gameMode.adventure.line1=Same as survival mode, but blocks can't +selectWorld.gameMode.adventure.line2=be added or removed +selectWorld.moreWorldOptions=More World Options... +selectWorld.mapFeatures=Generate Structures: +selectWorld.mapFeatures.info=Villages, dungeons etc +selectWorld.mapType=World Type: +selectWorld.mapType.normal=Normal +selectWorld.allowCommands=Allow Cheats: +selectWorld.allowCommands.info=Commands like /gamemode, /xp +selectWorld.hardcoreMode=Hardcore: +selectWorld.hardcoreMode.info=World is deleted upon death +selectWorld.bonusItems=Bonus Chest: + +generator.default=Default +generator.flat=Superflat +generator.largeBiomes=Large Biomes +generator.amplified=AMPLIFIED +generator.customized=Customized +generator.debug_all_block_states=Debug Mode + +generator.amplified.info=Notice: Just for fun, requires beefy computer + +selectServer.title=Select Server +selectServer.empty=empty +selectServer.select=Join Server +selectServer.direct=Direct Connect +selectServer.edit=Edit +selectServer.delete=Delete +selectServer.add=Add server +selectServer.defaultName=Minecraft Server +selectServer.deleteQuestion=Are you sure you want to remove this server? +selectServer.deleteWarning=will be lost forever! (A long time!) +selectServer.deleteButton=Delete +selectServer.refresh=Refresh +selectServer.hiddenAddress=(Hidden) +addServer.title=Edit Server Info +addServer.enterName=Server Name +addServer.enterIp=Server Address +addServer.add=Done +addServer.hideAddress=Hide Address +addServer.resourcePack=Server Resource Packs +addServer.resourcePack.enabled=Enabled +addServer.resourcePack.disabled=Disabled +addServer.resourcePack.prompt=Prompt +lanServer.title=LAN World +lanServer.scanning=Scanning for games on your local network +lanServer.start=Start LAN World +lanServer.otherPlayers=Settings for Other Players +mcoServer.title=Minecraft Online World + +multiplayer.title=Play Multiplayer +multiplayer.connect=Connect +multiplayer.info1=Minecraft Multiplayer is currently not finished, but there +multiplayer.info2=is some buggy early testing going on. +multiplayer.ipinfo=Enter the IP of a server to connect to it: +multiplayer.texturePrompt.line1=This server recommends the use of a custom resource pack. +multiplayer.texturePrompt.line2=Would you like to download and install it automagically? +multiplayer.downloadingTerrain=Downloading terrain +multiplayer.downloadingStats=Downloading statistics & achievements... +multiplayer.stopSleeping=Leave Bed +multiplayer.player.joined=%s joined the game +multiplayer.player.joined.renamed=%s (formerly known as %s) joined the game +multiplayer.player.left=%s left the game + +chat.cannotSend=Cannot send chat message +chat.type.text=<%s> %s +chat.type.emote=* %s %s +chat.type.announcement=[%s] %s +chat.type.admin=[%s: %s] +chat.type.achievement=%s has just earned the achievement %s +chat.type.achievement.taken=%s has lost the achievement %s +chat.link.confirm=Are you sure you want to open the following website? +chat.link.warning=Never open links from people that you don't trust! +chat.copy=Copy to Clipboard +chat.link.confirmTrusted=Do you want to open this link or copy it to your clipboard? +chat.link.open=Open in browser + +chat.stream.text=(%s) <%s> %s +chat.stream.emote=(%s) * %s %s + +menu.playdemo=Play Demo World +menu.resetdemo=Reset Demo World + +demo.day.1=This demo will last five game days, do your best! +demo.day.2=Day Two +demo.day.3=Day Three +demo.day.4=Day Four +demo.day.5=This is your last day! +demo.day.warning=Your time is almost up! +demo.day.6=You have passed your fifth day, use F2 to save a screenshot of your creation +demo.reminder=The demo time has expired, buy the game to continue or start a new world! +demo.remainingTime=Remaining time: %s +demo.demoExpired=Demo time's up! +demo.help.movement=Use %1$s, %2$s, %3$s, %4$s and the mouse to move around +demo.help.movementShort=Move by pressing %1$s, %2$s, %3$s, %4$s +demo.help.movementMouse=Look around using the mouse +demo.help.jump=Jump by pressing %1$s +demo.help.inventory=Use %1$s to open your inventory +demo.help.title=Minecraft Demo Mode +demo.help.fullWrapped=This demo will last 5 ingame days (about 1 hour and 40 minutes of real time). Check the achievements for hints! Have fun! +demo.help.buy=Purchase Now! +demo.help.later=Continue Playing! + +connect.connecting=Connecting to the server... +connect.authorizing=Logging in... +connect.failed=Failed to connect to the server + +disconnect.genericReason=%s +disconnect.disconnected=Disconnected by Server +disconnect.lost=Connection Lost +disconnect.kicked=Was kicked from the game +disconnect.timeout=Timed out +disconnect.closed=Connection closed +disconnect.loginFailed=Failed to login +disconnect.loginFailedInfo=Failed to login: %s +disconnect.loginFailedInfo.serversUnavailable=The authentication servers are currently down for maintenance. +disconnect.loginFailedInfo.invalidSession=Invalid session (Try restarting your game) +disconnect.quitting=Quitting +disconnect.endOfStream=End of stream +disconnect.overflow=Buffer overflow +disconnect.spam=Kicked for spamming + +soundCategory.master=Master Volume +soundCategory.music=Music +soundCategory.record=Jukebox/Noteblocks +soundCategory.weather=Weather +soundCategory.hostile=Hostile Creatures +soundCategory.neutral=Friendly Creatures +soundCategory.player=Players +soundCategory.block=Blocks +soundCategory.ambient=Ambient/Environment + +record.nowPlaying=Now playing: %s + +options.off=OFF +options.on=ON +options.visible=Shown +options.hidden=Hidden +options.title=Options +options.controls=Controls... +options.video=Video Settings... +options.language=Language... +options.stream=Broadcast Settings... +options.sounds=Music & Sounds... +options.sounds.title=Music & Sound Options +options.languageWarning=Language translations may not be 100%% accurate +options.videoTitle=Video Settings +options.customizeTitle=Customize World Settings +options.music=Music +options.sound=Sound +options.invertMouse=Invert Mouse +options.fov=FOV +options.fov.min=Normal +options.fov.max=Quake Pro +options.saturation=Saturation +options.gamma=Brightness +options.gamma.min=Moody +options.gamma.max=Bright +options.sensitivity=Sensitivity +options.sensitivity.min=*yawn* +options.sensitivity.max=HYPERSPEED!!! +options.renderDistance=Render Distance +options.renderDistance.tiny=Tiny +options.renderDistance.short=Short +options.renderDistance.normal=Normal +options.renderDistance.far=Far +options.viewBobbing=View Bobbing +options.ao=Smooth Lighting +options.ao.off=OFF +options.ao.min=Minimum +options.ao.max=Maximum +options.anaglyph=3D Anaglyph +options.framerateLimit=Max Framerate +options.framerateLimit.max=Unlimited +options.difficulty=Difficulty +options.difficulty.peaceful=Peaceful +options.difficulty.easy=Easy +options.difficulty.normal=Normal +options.difficulty.hard=Hard +options.difficulty.hardcore=Hardcore +options.graphics=Graphics +options.graphics.fancy=Fancy +options.graphics.fast=Fast +options.guiScale=GUI Scale +options.guiScale.auto=Auto +options.guiScale.small=Small +options.guiScale.normal=Normal +options.guiScale.large=Large +options.advancedOpengl=Advanced OpenGL +options.fboEnable=Enable FBOs +options.postProcessEnable=Enable Post-Processing +options.renderClouds=Clouds +options.qualityButton=Video Quality Settings... +options.qualityVideoTitle=Video Quality Settings +options.performanceButton=Video Performance Settings... +options.performanceVideoTitle=Video Performance Settings +options.advancedButton=Advanced Video Settings... +options.advancedVideoTitle=Advanced Video Settings +options.postButton=Post-Processing Settings... +options.postVideoTitle=Post-Processing Settings +options.farWarning1=A 64 bit Java installation is recommended +options.farWarning2=for 'Far' render distance (you have 32 bit) +options.particles=Particles +options.particles.all=All +options.particles.decreased=Decreased +options.particles.minimal=Minimal +options.multiplayer.title=Multiplayer Settings... +options.chat.title=Chat Settings... +options.chat.visibility=Chat +options.chat.visibility.full=Shown +options.chat.visibility.system=Commands Only +options.chat.visibility.hidden=Hidden +options.chat.color=Colors +options.chat.opacity=Opacity +options.chat.links=Web Links +options.chat.links.prompt=Prompt on Links +options.chat.scale=Scale +options.chat.width=Width +options.chat.height.focused=Focused Height +options.chat.height.unfocused=Unfocused Height +options.skinCustomisation=Skin Customization... +options.skinCustomisation.title=Skin Customization +options.modelPart.cape=Cape +options.modelPart.hat=Hat +options.modelPart.jacket=Jacket +options.modelPart.left_sleeve=Left Sleeve +options.modelPart.right_sleeve=Right Sleeve +options.modelPart.left_pants_leg=Left Pants Leg +options.modelPart.right_pants_leg=Right Pants Leg +options.snooper=Allow Snooper +options.snooper.view=Snooper Settings... +options.snooper.title=Machine Specs Collection +options.snooper.desc=We want to collect information about your machine to help improve Minecraft by knowing what we can support and where the biggest problems are. All of this information is completely anonymous and viewable below. We promise we won't do anything bad with this data, but if you want to opt out then feel free to toggle it off! +options.resourcepack=Resource Packs... +options.fullscreen=Fullscreen +options.vsync=Use VSync +options.vbo=Use VBOs +options.touchscreen=Touchscreen Mode +options.blockAlternatives=Alternate Blocks +options.reducedDebugInfo=Reduced Debug Info +options.entityShadows=Entity Shadows +options.realmsNotifications=Realms Notifications + +options.mipmapLevels=Mipmap Levels +options.forceUnicodeFont=Force Unicode Font + +options.stream.title=Twitch Broadcast Settings +options.stream.bytesPerPixel=Quality +options.stream.micVolumne=Mic Volume +options.stream.micToggleBehavior=Push To +options.stream.mic_toggle.mute=Mute +options.stream.mic_toggle.talk=Talk +options.stream.systemVolume=System Volume +options.stream.kbps=Bandwidth +options.stream.fps=Framerate +options.stream.sendMetadata=Send Metadata +options.stream.compression=Compression +options.stream.compression.low=Low +options.stream.compression.medium=Medium +options.stream.compression.high=High +options.stream.estimation=Estimated resolution: %dx%d +options.stream.changes=You may need to restart your stream for these changes to take place. +options.stream.ingestSelection=Broadcast Server List +options.stream.ingest.title=Twitch Broadcast Servers +options.stream.ingest.reset=Reset Preference +options.stream.chat.title=Twitch Chat Settings +options.stream.chat.enabled=Enable +options.stream.chat.enabled.streaming=Whilst Streaming +options.stream.chat.enabled.always=Always +options.stream.chat.enabled.never=Never +options.stream.chat.userFilter=User Filter +options.stream.chat.userFilter.all=All Viewers +options.stream.chat.userFilter.subs=Subscribers +options.stream.chat.userFilter.mods=Moderators + +difficulty.lock.title=Lock World Difficulty +difficulty.lock.question=Are you sure you want to lock the difficulty of this world? This will set this world to always be %1$s, and you will never be able to change that again. + +title.oldgl1=Old graphics card detected; this may prevent you from +title.oldgl2=playing in the future as OpenGL 2.0 will be required. + +controls.title=Controls +controls.reset=Reset +controls.resetAll=Reset Keys + +key.sprint=Sprint +key.forward=Walk Forwards +key.left=Strafe Left +key.back=Walk Backwards +key.right=Strafe Right +key.jump=Jump +key.inventory=Inventory +key.drop=Drop Item +key.chat=Open Chat +key.sneak=Sneak +key.playerlist=List Players +key.attack=Attack/Destroy +key.use=Use Item/Place Block +key.pickItem=Pick Block +key.mouseButton=Button %1$s +key.command=Open Command +key.screenshot=Take Screenshot +key.togglePerspective=Toggle Perspective +key.smoothCamera=Toggle Cinematic Camera +key.fullscreen=Toggle Fullscreen +key.spectatorOutlines=Highlight Players (Spectators) +key.hotbar.1=Hotbar Slot 1 +key.hotbar.2=Hotbar Slot 2 +key.hotbar.3=Hotbar Slot 3 +key.hotbar.4=Hotbar Slot 4 +key.hotbar.5=Hotbar Slot 5 +key.hotbar.6=Hotbar Slot 6 +key.hotbar.7=Hotbar Slot 7 +key.hotbar.8=Hotbar Slot 8 +key.hotbar.9=Hotbar Slot 9 +key.streamStartStop=Start/Stop Stream +key.streamPauseUnpause=Pause/Unpause Stream +key.streamCommercial=Show Stream Commercials +key.streamToggleMic=Push To Talk/Mute + +key.categories.movement=Movement +key.categories.misc=Miscellaneous +key.categories.multiplayer=Multiplayer +key.categories.gameplay=Gameplay +key.categories.ui=Game Interface +key.categories.inventory=Inventory +key.categories.stream=Streaming + +resourcePack.openFolder=Open resource pack folder +resourcePack.title=Select Resource Packs +resourcePack.available.title=Available Resource Packs +resourcePack.selected.title=Selected Resource Packs +resourcePack.folderInfo=(Place resource pack files here) +resourcePack.incompatible=Incompatible +resourcePack.incompatible.old=(Made for an older version of Minecraft) +resourcePack.incompatible.new=(Made for a newer version of Minecraft) +resourcePack.incompatible.confirm.title=Are you sure you want to load this resource pack? +resourcePack.incompatible.confirm.old=This resource pack was made for an older version of Minecraft and may no longer work correctly. +resourcePack.incompatible.confirm.new=This resource pack was made for a newer version of Minecraft and may no longer work correctly. + +sign.edit=Edit sign message + +book.pageIndicator=Page %1$s of %2$s +book.byAuthor=by %1$s +book.signButton=Sign +book.editTitle=Enter Book Title: +book.finalizeButton=Sign and Close +book.finalizeWarning=Note! When you sign the book, it will no longer be editable. +book.generation.0=Original +book.generation.1=Copy of original +book.generation.2=Copy of a copy +book.generation.3=Tattered + +merchant.deprecated=Trade something else to unlock! + +tile.barrier.name=Barrier +tile.stone.stone.name=Stone +tile.stone.granite.name=Granite +tile.stone.graniteSmooth.name=Polished Granite +tile.stone.diorite.name=Diorite +tile.stone.dioriteSmooth.name=Polished Diorite +tile.stone.andesite.name=Andesite +tile.stone.andesiteSmooth.name=Polished Andesite +tile.hayBlock.name=Hay Bale +tile.grass.name=Grass Block +tile.dirt.name=Dirt +tile.dirt.default.name=Dirt +tile.dirt.coarse.name=Coarse Dirt +tile.dirt.podzol.name=Podzol +tile.stonebrick.name=Cobblestone +tile.wood.name=Wooden Planks +tile.wood.oak.name=Oak Wood Planks +tile.wood.spruce.name=Spruce Wood Planks +tile.wood.birch.name=Birch Wood Planks +tile.wood.jungle.name=Jungle Wood Planks +tile.wood.acacia.name=Acacia Wood Planks +tile.wood.big_oak.name=Dark Oak Wood Planks +tile.sapling.oak.name=Oak Sapling +tile.sapling.spruce.name=Spruce Sapling +tile.sapling.birch.name=Birch Sapling +tile.sapling.jungle.name=Jungle Sapling +tile.sapling.acacia.name=Acacia Sapling +tile.sapling.big_oak.name=Dark Oak Sapling +tile.deadbush.name=Dead Bush +tile.bedrock.name=Bedrock +tile.water.name=Water +tile.lava.name=Lava +tile.sand.name=Sand +tile.sand.default.name=Sand +tile.sand.red.name=Red Sand +tile.sandStone.name=Sandstone +tile.sandStone.default.name=Sandstone +tile.sandStone.chiseled.name=Chiseled Sandstone +tile.sandStone.smooth.name=Smooth Sandstone +tile.redSandStone.name=Red Sandstone +tile.redSandStone.default.name=Red Sandstone +tile.redSandStone.chiseled.name=Chiseled Red Sandstone +tile.redSandStone.smooth.name=Smooth Red Sandstone +tile.gravel.name=Gravel +tile.oreGold.name=Gold Ore +tile.oreIron.name=Iron Ore +tile.oreCoal.name=Coal Ore +tile.log.name=Wood +tile.log.oak.name=Oak Wood +tile.log.spruce.name=Spruce Wood +tile.log.birch.name=Birch Wood +tile.log.jungle.name=Jungle Wood +tile.log.acacia.name=Acacia Wood +tile.log.big_oak.name=Dark Oak Wood +tile.leaves.name=Leaves +tile.leaves.oak.name=Oak Leaves +tile.leaves.spruce.name=Spruce Leaves +tile.leaves.birch.name=Birch Leaves +tile.leaves.jungle.name=Jungle Leaves +tile.leaves.acacia.name=Acacia Leaves +tile.leaves.big_oak.name=Dark Oak Leaves +tile.tallgrass.name=Grass +tile.tallgrass.shrub.name=Shrub +tile.tallgrass.grass.name=Grass +tile.tallgrass.fern.name=Fern +tile.sponge.dry.name=Sponge +tile.sponge.wet.name=Wet Sponge +tile.glass.name=Glass +tile.stainedGlass.name=Stained Glass +tile.stainedGlass.black.name=Black Stained Glass +tile.stainedGlass.red.name=Red Stained Glass +tile.stainedGlass.green.name=Green Stained Glass +tile.stainedGlass.brown.name=Brown Stained Glass +tile.stainedGlass.blue.name=Blue Stained Glass +tile.stainedGlass.purple.name=Purple Stained Glass +tile.stainedGlass.cyan.name=Cyan Stained Glass +tile.stainedGlass.silver.name=Light Gray Stained Glass +tile.stainedGlass.gray.name=Gray Stained Glass +tile.stainedGlass.pink.name=Pink Stained Glass +tile.stainedGlass.lime.name=Lime Stained Glass +tile.stainedGlass.yellow.name=Yellow Stained Glass +tile.stainedGlass.lightBlue.name=Light Blue Stained Glass +tile.stainedGlass.magenta.name=Magenta Stained Glass +tile.stainedGlass.orange.name=Orange Stained Glass +tile.stainedGlass.white.name=White Stained Glass +tile.thinStainedGlass.name=Stained Glass Pane +tile.thinStainedGlass.black.name=Black Stained Glass Pane +tile.thinStainedGlass.red.name=Red Stained Glass Pane +tile.thinStainedGlass.green.name=Green Stained Glass Pane +tile.thinStainedGlass.brown.name=Brown Stained Glass Pane +tile.thinStainedGlass.blue.name=Blue Stained Glass Pane +tile.thinStainedGlass.purple.name=Purple Stained Glass Pane +tile.thinStainedGlass.cyan.name=Cyan Stained Glass Pane +tile.thinStainedGlass.silver.name=Light Gray Stained Glass Pane +tile.thinStainedGlass.gray.name=Gray Stained Glass Pane +tile.thinStainedGlass.pink.name=Pink Stained Glass Pane +tile.thinStainedGlass.lime.name=Lime Stained Glass Pane +tile.thinStainedGlass.yellow.name=Yellow Stained Glass Pane +tile.thinStainedGlass.lightBlue.name=Light Blue Stained Glass Pane +tile.thinStainedGlass.magenta.name=Magenta Stained Glass Pane +tile.thinStainedGlass.orange.name=Orange Stained Glass Pane +tile.thinStainedGlass.white.name=White Stained Glass Pane +tile.thinGlass.name=Glass Pane +tile.cloth.name=Wool +tile.flower1.name=Flower +tile.flower1.dandelion.name=Dandelion +tile.flower2.name=Flower +tile.flower2.poppy.name=Poppy +tile.flower2.blueOrchid.name=Blue Orchid +tile.flower2.allium.name=Allium +tile.flower2.houstonia.name=Azure Bluet +tile.flower2.tulipRed.name=Red Tulip +tile.flower2.tulipOrange.name=Orange Tulip +tile.flower2.tulipWhite.name=White Tulip +tile.flower2.tulipPink.name=Pink Tulip +tile.flower2.oxeyeDaisy.name=Oxeye Daisy +tile.doublePlant.name=Plant +tile.doublePlant.sunflower.name=Sunflower +tile.doublePlant.syringa.name=Lilac +tile.doublePlant.grass.name=Double Tallgrass +tile.doublePlant.fern.name=Large Fern +tile.doublePlant.rose.name=Rose Bush +tile.doublePlant.paeonia.name=Peony +tile.mushroom.name=Mushroom +tile.blockGold.name=Block of Gold +tile.blockIron.name=Block of Iron +tile.stoneSlab.name=Stone Slab +tile.stoneSlab.stone.name=Stone Slab +tile.stoneSlab.sand.name=Sandstone Slab +tile.stoneSlab.wood.name=Wooden Slab +tile.stoneSlab.cobble.name=Cobblestone Slab +tile.stoneSlab.brick.name=Bricks Slab +tile.stoneSlab.smoothStoneBrick.name=Stone Bricks Slab +tile.stoneSlab.netherBrick.name=Nether Brick Slab +tile.stoneSlab.quartz.name=Quartz Slab +tile.stoneSlab2.red_sandstone.name=Red Sandstone Slab +tile.woodSlab.name=Wood Slab +tile.woodSlab.oak.name=Oak Wood Slab +tile.woodSlab.spruce.name=Spruce Wood Slab +tile.woodSlab.birch.name=Birch Wood Slab +tile.woodSlab.jungle.name=Jungle Wood Slab +tile.woodSlab.acacia.name=Acacia Wood Slab +tile.woodSlab.big_oak.name=Dark Oak Wood Slab +tile.brick.name=Bricks +tile.tnt.name=TNT +tile.bookshelf.name=Bookshelf +tile.stoneMoss.name=Moss Stone +tile.obsidian.name=Obsidian +tile.torch.name=Torch +tile.fire.name=Fire +tile.mobSpawner.name=Monster Spawner +tile.stairsWood.name=Oak Wood Stairs +tile.stairsWoodSpruce.name=Spruce Wood Stairs +tile.stairsWoodBirch.name=Birch Wood Stairs +tile.stairsWoodJungle.name=Jungle Wood Stairs +tile.stairsWoodAcacia.name=Acacia Wood Stairs +tile.stairsWoodDarkOak.name=Dark Oak Wood Stairs +tile.chest.name=Chest +tile.chestTrap.name=Trapped Chest +tile.redstoneDust.name=Redstone Dust +tile.oreDiamond.name=Diamond Ore +tile.blockCoal.name=Block of Coal +tile.blockDiamond.name=Block of Diamond +tile.workbench.name=Crafting Table +tile.crops.name=Crops +tile.farmland.name=Farmland +tile.furnace.name=Furnace +tile.sign.name=Sign +tile.doorWood.name=Wooden Door +tile.ladder.name=Ladder +tile.rail.name=Rail +tile.goldenRail.name=Powered Rail +tile.activatorRail.name=Activator Rail +tile.detectorRail.name=Detector Rail +tile.stairsStone.name=Cobblestone Stairs +tile.stairsSandStone.name=Sandstone Stairs +tile.stairsRedSandStone.name=Red Sandstone Stairs +tile.lever.name=Lever +tile.pressurePlateStone.name=Stone Pressure Plate +tile.pressurePlateWood.name=Wooden Pressure Plate +tile.weightedPlate_light.name=Weighted Pressure Plate (Light) +tile.weightedPlate_heavy.name=Weighted Pressure Plate (Heavy) +tile.doorIron.name=Iron Door +tile.oreRedstone.name=Redstone Ore +tile.notGate.name=Redstone Torch +tile.button.name=Button +tile.snow.name=Snow +tile.woolCarpet.name=Carpet +tile.woolCarpet.black.name=Black Carpet +tile.woolCarpet.red.name=Red Carpet +tile.woolCarpet.green.name=Green Carpet +tile.woolCarpet.brown.name=Brown Carpet +tile.woolCarpet.blue.name=Blue Carpet +tile.woolCarpet.purple.name=Purple Carpet +tile.woolCarpet.cyan.name=Cyan Carpet +tile.woolCarpet.silver.name=Light Gray Carpet +tile.woolCarpet.gray.name=Gray Carpet +tile.woolCarpet.pink.name=Pink Carpet +tile.woolCarpet.lime.name=Lime Carpet +tile.woolCarpet.yellow.name=Yellow Carpet +tile.woolCarpet.lightBlue.name=Light Blue Carpet +tile.woolCarpet.magenta.name=Magenta Carpet +tile.woolCarpet.orange.name=Orange Carpet +tile.woolCarpet.white.name=Carpet +tile.ice.name=Ice +tile.icePacked.name=Packed Ice +tile.cactus.name=Cactus +tile.clay.name=Clay +tile.clayHardenedStained.name=Stained Clay +tile.clayHardenedStained.black.name=Black Stained Clay +tile.clayHardenedStained.red.name=Red Stained Clay +tile.clayHardenedStained.green.name=Green Stained Clay +tile.clayHardenedStained.brown.name=Brown Stained Clay +tile.clayHardenedStained.blue.name=Blue Stained Clay +tile.clayHardenedStained.purple.name=Purple Stained Clay +tile.clayHardenedStained.cyan.name=Cyan Stained Clay +tile.clayHardenedStained.silver.name=Light Gray Stained Clay +tile.clayHardenedStained.gray.name=Gray Stained Clay +tile.clayHardenedStained.pink.name=Pink Stained Clay +tile.clayHardenedStained.lime.name=Lime Stained Clay +tile.clayHardenedStained.yellow.name=Yellow Stained Clay +tile.clayHardenedStained.lightBlue.name=Light Blue Stained Clay +tile.clayHardenedStained.magenta.name=Magenta Stained Clay +tile.clayHardenedStained.orange.name=Orange Stained Clay +tile.clayHardenedStained.white.name=White Stained Clay +tile.clayHardened.name=Hardened Clay +tile.reeds.name=Sugar cane +tile.jukebox.name=Jukebox +tile.fence.name=Oak Fence +tile.spruceFence.name=Spruce Fence +tile.birchFence.name=Birch Fence +tile.jungleFence.name=Jungle Fence +tile.darkOakFence.name=Dark Oak Fence +tile.acaciaFence.name=Acacia Fence +tile.fenceGate.name=Oak Fence Gate +tile.spruceFenceGate.name=Spruce Fence Gate +tile.birchFenceGate.name=Birch Fence Gate +tile.jungleFenceGate.name=Jungle Fence Gate +tile.darkOakFenceGate.name=Dark Oak Fence Gate +tile.acaciaFenceGate.name=Acacia Fence Gate +tile.pumpkinStem.name=Pumpkin Stem +tile.pumpkin.name=Pumpkin +tile.litpumpkin.name=Jack o'Lantern +tile.hellrock.name=Netherrack +tile.hellsand.name=Soul Sand +tile.lightgem.name=Glowstone +tile.portal.name=Portal +tile.cloth.black.name=Black Wool +tile.cloth.red.name=Red Wool +tile.cloth.green.name=Green Wool +tile.cloth.brown.name=Brown Wool +tile.cloth.blue.name=Blue Wool +tile.cloth.purple.name=Purple Wool +tile.cloth.cyan.name=Cyan Wool +tile.cloth.silver.name=Light Gray Wool +tile.cloth.gray.name=Gray Wool +tile.cloth.pink.name=Pink Wool +tile.cloth.lime.name=Lime Wool +tile.cloth.yellow.name=Yellow Wool +tile.cloth.lightBlue.name=Light Blue Wool +tile.cloth.magenta.name=Magenta Wool +tile.cloth.orange.name=Orange Wool +tile.cloth.white.name=Wool +tile.oreLapis.name=Lapis Lazuli Ore +tile.blockLapis.name=Lapis Lazuli Block +tile.dispenser.name=Dispenser +tile.dropper.name=Dropper +tile.musicBlock.name=Note Block +tile.cake.name=Cake +tile.bed.name=Bed +tile.bed.occupied=This bed is occupied +tile.bed.noSleep=You can only sleep at night +tile.bed.notSafe=You may not rest now, there are monsters nearby +tile.bed.notValid=Your home bed was missing or obstructed +tile.lockedchest.name=Locked chest +tile.trapdoor.name=Wooden Trapdoor +tile.ironTrapdoor.name=Iron Trapdoor +tile.web.name=Cobweb +tile.stonebricksmooth.name=Stone Bricks +tile.stonebricksmooth.default.name=Stone Bricks +tile.stonebricksmooth.mossy.name=Mossy Stone Bricks +tile.stonebricksmooth.cracked.name=Cracked Stone Bricks +tile.stonebricksmooth.chiseled.name=Chiseled Stone Bricks +tile.monsterStoneEgg.name=Stone Monster Egg +tile.monsterStoneEgg.stone.name=Stone Monster Egg +tile.monsterStoneEgg.cobble.name=Cobblestone Monster Egg +tile.monsterStoneEgg.brick.name=Stone Brick Monster Egg +tile.monsterStoneEgg.mossybrick.name=Mossy Stone Brick Monster Egg +tile.monsterStoneEgg.crackedbrick.name=Cracked Stone Brick Monster Egg +tile.monsterStoneEgg.chiseledbrick.name=Chiseled Stone Brick Monster Egg +tile.pistonBase.name=Piston +tile.pistonStickyBase.name=Sticky Piston +tile.fenceIron.name=Iron Bars +tile.melon.name=Melon +tile.stairsBrick.name=Brick Stairs +tile.stairsStoneBrickSmooth.name=Stone Brick Stairs +tile.vine.name=Vines +tile.netherBrick.name=Nether Brick +tile.netherFence.name=Nether Brick Fence +tile.stairsNetherBrick.name=Nether Brick Stairs +tile.netherStalk.name=Nether Wart +tile.cauldron.name=Cauldron +tile.enchantmentTable.name=Enchantment Table +tile.anvil.name=Anvil +tile.anvil.intact.name=Anvil +tile.anvil.slightlyDamaged.name=Slightly Damaged Anvil +tile.anvil.veryDamaged.name=Very Damaged Anvil +tile.whiteStone.name=End Stone +tile.endPortalFrame.name=End Portal +tile.mycel.name=Mycelium +tile.waterlily.name=Lily Pad +tile.dragonEgg.name=Dragon Egg +tile.redstoneLight.name=Redstone Lamp +tile.cocoa.name=Cocoa +tile.enderChest.name=Ender Chest +tile.oreRuby.name=Ruby Ore +tile.oreEmerald.name=Emerald Ore +tile.blockEmerald.name=Block of Emerald +tile.blockRedstone.name=Block of Redstone +tile.tripWire.name=Tripwire +tile.tripWireSource.name=Tripwire Hook +tile.commandBlock.name=Command Block +tile.beacon.name=Beacon +tile.beacon.primary=Primary Power +tile.beacon.secondary=Secondary Power +tile.cobbleWall.normal.name=Cobblestone Wall +tile.cobbleWall.mossy.name=Mossy Cobblestone Wall +tile.carrots.name=Carrots +tile.potatoes.name=Potatoes +tile.daylightDetector.name=Daylight Sensor +tile.netherquartz.name=Nether Quartz Ore +tile.hopper.name=Hopper +tile.quartzBlock.name=Block of Quartz +tile.quartzBlock.default.name=Block of Quartz +tile.quartzBlock.chiseled.name=Chiseled Quartz Block +tile.quartzBlock.lines.name=Pillar Quartz Block +tile.stairsQuartz.name=Quartz Stairs +tile.slime.name=Slime Block +tile.prismarine.rough.name=Prismarine +tile.prismarine.bricks.name=Prismarine Bricks +tile.prismarine.dark.name=Dark Prismarine +tile.seaLantern.name=Sea Lantern + +item.nameTag.name=Name Tag +item.leash.name=Lead +item.shovelIron.name=Iron Shovel +item.pickaxeIron.name=Iron Pickaxe +item.hatchetIron.name=Iron Axe +item.flintAndSteel.name=Flint and Steel +item.apple.name=Apple +item.cookie.name=Cookie +item.bow.name=Bow +item.arrow.name=Arrow +item.coal.name=Coal +item.charcoal.name=Charcoal +item.diamond.name=Diamond +item.emerald.name=Emerald +item.ingotIron.name=Iron Ingot +item.ingotGold.name=Gold Ingot +item.swordIron.name=Iron Sword +item.swordWood.name=Wooden Sword +item.shovelWood.name=Wooden Shovel +item.pickaxeWood.name=Wooden Pickaxe +item.hatchetWood.name=Wooden Axe +item.swordStone.name=Stone Sword +item.shovelStone.name=Stone Shovel +item.pickaxeStone.name=Stone Pickaxe +item.hatchetStone.name=Stone Axe +item.swordDiamond.name=Diamond Sword +item.shovelDiamond.name=Diamond Shovel +item.pickaxeDiamond.name=Diamond Pickaxe +item.hatchetDiamond.name=Diamond Axe +item.stick.name=Stick +item.bowl.name=Bowl +item.mushroomStew.name=Mushroom Stew +item.swordGold.name=Golden Sword +item.shovelGold.name=Golden Shovel +item.pickaxeGold.name=Golden Pickaxe +item.hatchetGold.name=Golden Axe +item.string.name=String +item.feather.name=Feather +item.sulphur.name=Gunpowder +item.hoeWood.name=Wooden Hoe +item.hoeStone.name=Stone Hoe +item.hoeIron.name=Iron Hoe +item.hoeDiamond.name=Diamond Hoe +item.hoeGold.name=Golden Hoe +item.seeds.name=Seeds +item.seeds_pumpkin.name=Pumpkin Seeds +item.seeds_melon.name=Melon Seeds +item.melon.name=Melon +item.wheat.name=Wheat +item.bread.name=Bread +item.helmetCloth.name=Leather Cap +item.chestplateCloth.name=Leather Tunic +item.leggingsCloth.name=Leather Pants +item.bootsCloth.name=Leather Boots +item.helmetChain.name=Chain Helmet +item.chestplateChain.name=Chain Chestplate +item.leggingsChain.name=Chain Leggings +item.bootsChain.name=Chain Boots +item.helmetIron.name=Iron Helmet +item.chestplateIron.name=Iron Chestplate +item.leggingsIron.name=Iron Leggings +item.bootsIron.name=Iron Boots +item.helmetDiamond.name=Diamond Helmet +item.chestplateDiamond.name=Diamond Chestplate +item.leggingsDiamond.name=Diamond Leggings +item.bootsDiamond.name=Diamond Boots +item.helmetGold.name=Golden Helmet +item.chestplateGold.name=Golden Chestplate +item.leggingsGold.name=Golden Leggings +item.bootsGold.name=Golden Boots +item.flint.name=Flint +item.porkchopRaw.name=Raw Porkchop +item.porkchopCooked.name=Cooked Porkchop +item.chickenRaw.name=Raw Chicken +item.chickenCooked.name=Cooked Chicken +item.muttonRaw.name=Raw Mutton +item.muttonCooked.name=Cooked Mutton +item.rabbitRaw.name=Raw Rabbit +item.rabbitCooked.name=Cooked Rabbit +item.rabbitStew.name=Rabbit Stew +item.rabbitFoot.name=Rabbit's Foot +item.rabbitHide.name=Rabbit Hide +item.beefRaw.name=Raw Beef +item.beefCooked.name=Steak +item.painting.name=Painting +item.frame.name=Item Frame +item.appleGold.name=Golden Apple +item.sign.name=Sign +item.doorOak.name=Oak Door +item.doorSpruce.name=Spruce Door +item.doorBirch.name=Birch Door +item.doorJungle.name=Jungle Door +item.doorAcacia.name=Acacia Door +item.doorDarkOak.name=Dark Oak Door +item.bucket.name=Bucket +item.bucketWater.name=Water Bucket +item.bucketLava.name=Lava Bucket +item.minecart.name=Minecart +item.saddle.name=Saddle +item.doorIron.name=Iron Door +item.redstone.name=Redstone +item.snowball.name=Snowball +item.boat.name=Boat +item.leather.name=Leather +item.milk.name=Milk +item.brick.name=Brick +item.clay.name=Clay +item.reeds.name=Sugar Canes +item.paper.name=Paper +item.book.name=Book +item.slimeball.name=Slimeball +item.minecartChest.name=Minecart with Chest +item.minecartFurnace.name=Minecart with Furnace +item.minecartTnt.name=Minecart with TNT +item.minecartHopper.name=Minecart with Hopper +item.minecartCommandBlock.name=Minecart with Command Block +item.egg.name=Egg +item.compass.name=Compass +item.fishingRod.name=Fishing Rod +item.clock.name=Clock +item.yellowDust.name=Glowstone Dust +item.fish.cod.raw.name=Raw Fish +item.fish.salmon.raw.name=Raw Salmon +item.fish.pufferfish.raw.name=Pufferfish +item.fish.clownfish.raw.name=Clownfish +item.fish.cod.cooked.name=Cooked Fish +item.fish.salmon.cooked.name=Cooked Salmon +item.record.name=Music Disc +item.record.13.desc=C418 - 13 +item.record.cat.desc=C418 - cat +item.record.blocks.desc=C418 - blocks +item.record.chirp.desc=C418 - chirp +item.record.far.desc=C418 - far +item.record.mall.desc=C418 - mall +item.record.mellohi.desc=C418 - mellohi +item.record.stal.desc=C418 - stal +item.record.strad.desc=C418 - strad +item.record.ward.desc=C418 - ward +item.record.11.desc=C418 - 11 +item.record.wait.desc=C418 - wait +item.bone.name=Bone +item.dyePowder.black.name=Ink Sac +item.dyePowder.red.name=Rose Red +item.dyePowder.green.name=Cactus Green +item.dyePowder.brown.name=Cocoa Beans +item.dyePowder.blue.name=Lapis Lazuli +item.dyePowder.purple.name=Purple Dye +item.dyePowder.cyan.name=Cyan Dye +item.dyePowder.silver.name=Light Gray Dye +item.dyePowder.gray.name=Gray Dye +item.dyePowder.pink.name=Pink Dye +item.dyePowder.lime.name=Lime Dye +item.dyePowder.yellow.name=Dandelion Yellow +item.dyePowder.lightBlue.name=Light Blue Dye +item.dyePowder.magenta.name=Magenta Dye +item.dyePowder.orange.name=Orange Dye +item.dyePowder.white.name=Bone Meal +item.sugar.name=Sugar +item.cake.name=Cake +item.bed.name=Bed +item.diode.name=Redstone Repeater +item.comparator.name=Redstone Comparator +item.map.name=Map +item.leaves.name=Leaves +item.shears.name=Shears +item.rottenFlesh.name=Rotten Flesh +item.enderPearl.name=Ender Pearl +item.blazeRod.name=Blaze Rod +item.ghastTear.name=Ghast Tear +item.netherStalkSeeds.name=Nether Wart +item.potion.name=Potion +item.emptyPotion.name=Water Bottle +item.goldNugget.name=Gold Nugget +item.glassBottle.name=Glass Bottle +item.spiderEye.name=Spider Eye +item.fermentedSpiderEye.name=Fermented Spider Eye +item.blazePowder.name=Blaze Powder +item.magmaCream.name=Magma Cream +item.cauldron.name=Cauldron +item.brewingStand.name=Brewing Stand +item.eyeOfEnder.name=Eye of Ender +item.speckledMelon.name=Glistering Melon +item.monsterPlacer.name=Spawn +item.expBottle.name=Bottle o' Enchanting +item.fireball.name=Fire Charge +item.writingBook.name=Book and Quill +item.writtenBook.name=Written Book +item.ruby.name=Ruby +item.flowerPot.name=Flower Pot +item.emptyMap.name=Empty Map +item.carrots.name=Carrot +item.carrotGolden.name=Golden Carrot +item.potato.name=Potato +item.potatoBaked.name=Baked Potato +item.potatoPoisonous.name=Poisonous Potato +item.skull.skeleton.name=Skeleton Skull +item.skull.wither.name=Wither Skeleton Skull +item.skull.zombie.name=Zombie Head +item.skull.char.name=Head +item.skull.player.name=%s's Head +item.skull.creeper.name=Creeper Head +item.carrotOnAStick.name=Carrot on a Stick +item.netherStar.name=Nether Star +item.pumpkinPie.name=Pumpkin Pie +item.enchantedBook.name=Enchanted Book +item.fireworks.name=Firework Rocket +item.fireworks.flight=Flight Duration: +item.fireworksCharge.name=Firework Star +item.fireworksCharge.black=Black +item.fireworksCharge.red=Red +item.fireworksCharge.green=Green +item.fireworksCharge.brown=Brown +item.fireworksCharge.blue=Blue +item.fireworksCharge.purple=Purple +item.fireworksCharge.cyan=Cyan +item.fireworksCharge.silver=Light Gray +item.fireworksCharge.gray=Gray +item.fireworksCharge.pink=Pink +item.fireworksCharge.lime=Lime +item.fireworksCharge.yellow=Yellow +item.fireworksCharge.lightBlue=Light Blue +item.fireworksCharge.magenta=Magenta +item.fireworksCharge.orange=Orange +item.fireworksCharge.white=White +item.fireworksCharge.customColor=Custom +item.fireworksCharge.fadeTo=Fade to +item.fireworksCharge.flicker=Twinkle +item.fireworksCharge.trail=Trail +item.fireworksCharge.type.0=Small Ball +item.fireworksCharge.type.1=Large Ball +item.fireworksCharge.type.2=Star-shaped +item.fireworksCharge.type.3=Creeper-shaped +item.fireworksCharge.type.4=Burst +item.fireworksCharge.type=Unknown Shape +item.netherbrick.name=Nether Brick +item.netherquartz.name=Nether Quartz +item.armorStand.name=Armor Stand +item.horsearmormetal.name=Iron Horse Armor +item.horsearmorgold.name=Gold Horse Armor +item.horsearmordiamond.name=Diamond Horse Armor +item.prismarineShard.name=Prismarine Shard +item.prismarineCrystals.name=Prismarine Crystals + +container.inventory=Inventory +container.hopper=Item Hopper +container.crafting=Crafting +container.dispenser=Dispenser +container.dropper=Dropper +container.furnace=Furnace +container.enchant=Enchant +container.enchant.lapis.one=1 Lapis Lazuli +container.enchant.lapis.many=%d Lapis Lazuli +container.enchant.level.one=1 Enchantment Level +container.enchant.level.many=%d Enchantment Levels +container.enchant.clue=%s . . . ? +container.repair=Repair & Name +container.repair.cost=Enchantment Cost: %1$d +container.repair.expensive=Too Expensive! +container.creative=Item Selection +container.brewing=Brewing Stand +container.chest=Chest +container.chestDouble=Large Chest +container.minecart=Minecart +container.enderchest=Ender Chest +container.beacon=Beacon + +container.isLocked=%s is locked! + +item.dyed=Dyed +item.unbreakable=Unbreakable +item.canBreak=Can break: +item.canPlace=Can be placed on: + +entity.Item.name=Item +entity.XPOrb.name=Experience Orb +entity.SmallFireball.name=Small Fireball +entity.Fireball.name=Fireball +entity.ThrownPotion.name=Potion + +entity.Arrow.name=Arrow +entity.Snowball.name=Snowball +entity.Painting.name=Painting +entity.ArmorStand.name=Armor Stand + +entity.Mob.name=Mob +entity.Monster.name=Monster + +entity.Creeper.name=Creeper +entity.Skeleton.name=Skeleton +entity.Spider.name=Spider +entity.Giant.name=Giant +entity.Zombie.name=Zombie +entity.Slime.name=Slime +entity.Ghast.name=Ghast +entity.PigZombie.name=Zombie Pigman +entity.Enderman.name=Enderman +entity.Endermite.name=Endermite +entity.Silverfish.name=Silverfish +entity.CaveSpider.name=Cave Spider +entity.Blaze.name=Blaze +entity.LavaSlime.name=Magma Cube +entity.MushroomCow.name=Mooshroom +entity.Villager.name=Villager +entity.VillagerGolem.name=Iron Golem +entity.SnowMan.name=Snow Golem +entity.EnderDragon.name=Ender Dragon +entity.WitherBoss.name=Wither +entity.Witch.name=Witch +entity.Guardian.name=Guardian + +entity.Villager.farmer=Farmer +entity.Villager.fisherman=Fisherman +entity.Villager.shepherd=Shepherd +entity.Villager.fletcher=Fletcher +entity.Villager.librarian=Librarian +entity.Villager.cleric=Cleric +entity.Villager.armor=Armorer +entity.Villager.weapon=Weapon Smith +entity.Villager.tool=Tool Smith +entity.Villager.butcher=Butcher +entity.Villager.leather=Leatherworker + +entity.Pig.name=Pig +entity.Sheep.name=Sheep +entity.Cow.name=Cow +entity.Chicken.name=Chicken +entity.Squid.name=Squid +entity.Wolf.name=Wolf +entity.Ozelot.name=Ocelot +entity.Cat.name=Cat +entity.Bat.name=Bat +entity.EntityHorse.name=Horse +entity.horse.name=Horse +entity.donkey.name=Donkey +entity.mule.name=Mule +entity.skeletonhorse.name=Skeleton Horse +entity.zombiehorse.name=Zombie Horse +entity.Rabbit.name=Rabbit +entity.KillerBunny.name=The Killer Bunny + +entity.PrimedTnt.name=Block of TNT +entity.FallingSand.name=Falling Block + +entity.Minecart.name=Minecart +entity.Boat.name=Boat + +entity.generic.name=unknown + +death.fell.accident.ladder=%1$s fell off a ladder +death.fell.accident.vines=%1$s fell off some vines +death.fell.accident.water=%1$s fell out of the water +death.fell.accident.generic=%1$s fell from a high place +death.fell.killer=%1$s was doomed to fall +death.fell.assist=%1$s was doomed to fall by %2$s +death.fell.assist.item=%1$s was doomed to fall by %2$s using %3$s +death.fell.finish=%1$s fell too far and was finished by %2$s +death.fell.finish.item=%1$s fell too far and was finished by %2$s using %3$s + +death.attack.lightningBolt=%1$s was struck by lightning +death.attack.inFire=%1$s went up in flames +death.attack.inFire.player=%1$s walked into fire whilst fighting %2$s +death.attack.onFire=%1$s burned to death +death.attack.onFire.player=%1$s was burnt to a crisp whilst fighting %2$s +death.attack.lava=%1$s tried to swim in lava +death.attack.lava.player=%1$s tried to swim in lava to escape %2$s +death.attack.inWall=%1$s suffocated in a wall +death.attack.drown=%1$s drowned +death.attack.drown.player=%1$s drowned whilst trying to escape %2$s +death.attack.starve=%1$s starved to death +death.attack.cactus=%1$s was pricked to death +death.attack.cactus.player=%1$s walked into a cactus whilst trying to escape %2$s +death.attack.generic=%1$s died +death.attack.explosion=%1$s blew up +death.attack.explosion.player=%1$s was blown up by %2$s +death.attack.magic=%1$s was killed by magic +death.attack.wither=%1$s withered away +death.attack.anvil=%1$s was squashed by a falling anvil +death.attack.fallingBlock=%1$s was squashed by a falling block +death.attack.mob=%1$s was slain by %2$s +death.attack.player=%1$s was slain by %2$s +death.attack.player.item=%1$s was slain by %2$s using %3$s +death.attack.arrow=%1$s was shot by %2$s +death.attack.arrow.item=%1$s was shot by %2$s using %3$s +death.attack.fireball=%1$s was fireballed by %2$s +death.attack.fireball.item=%1$s was fireballed by %2$s using %3$s +death.attack.thrown=%1$s was pummeled by %2$s +death.attack.thrown.item=%1$s was pummeled by %2$s using %3$s +death.attack.indirectMagic=%1$s was killed by %2$s using magic +death.attack.indirectMagic.item=%1$s was killed by %2$s using %3$s +death.attack.thorns=%1$s was killed trying to hurt %2$s +death.attack.fall=%1$s hit the ground too hard +death.attack.outOfWorld=%1$s fell out of the world + +deathScreen.respawn=Respawn +deathScreen.deleteWorld=Delete world +deathScreen.titleScreen=Title screen +deathScreen.score=Score +deathScreen.title.hardcore=Game over! +deathScreen.hardcoreInfo=You cannot respawn in hardcore mode! +deathScreen.title=You died! +deathScreen.leaveServer=Leave server +deathScreen.quit.confirm=Are you sure you want to quit? + +potion.effects.whenDrank=When Applied: +potion.empty=No Effects +potion.moveSpeed=Speed +potion.moveSlowdown=Slowness +potion.digSpeed=Haste +potion.digSlowDown=Mining Fatigue +potion.damageBoost=Strength +potion.heal=Instant Health +potion.harm=Instant Damage +potion.jump=Jump Boost +potion.confusion=Nausea +potion.regeneration=Regeneration +potion.resistance=Resistance +potion.fireResistance=Fire Resistance +potion.waterBreathing=Water Breathing +potion.invisibility=Invisibility +potion.blindness=Blindness +potion.nightVision=Night Vision +potion.hunger=Hunger +potion.weakness=Weakness +potion.poison=Poison +potion.wither=Wither +potion.healthBoost=Health Boost +potion.absorption=Absorption +potion.saturation=Saturation + +potion.moveSpeed.postfix=Potion of Swiftness +potion.moveSlowdown.postfix=Potion of Slowness +potion.digSpeed.postfix=Potion of Haste +potion.digSlowDown.postfix=Potion of Dullness +potion.damageBoost.postfix=Potion of Strength +potion.weakness.postfix=Potion of Weakness +potion.heal.postfix=Potion of Healing +potion.harm.postfix=Potion of Harming +potion.jump.postfix=Potion of Leaping +potion.confusion.postfix=Potion of Nausea +potion.regeneration.postfix=Potion of Regeneration +potion.resistance.postfix=Potion of Resistance +potion.fireResistance.postfix=Potion of Fire Resistance +potion.waterBreathing.postfix=Potion of Water Breathing +potion.invisibility.postfix=Potion of Invisibility +potion.blindness.postfix=Potion of Blindness +potion.nightVision.postfix=Potion of Night Vision +potion.hunger.postfix=Potion of Hunger +potion.poison.postfix=Potion of Poison +potion.wither.postfix=Potion of Decay +potion.healthBoost.postfix=Potion of Health Boost +potion.absorption.postfix=Potion of Absorption +potion.saturation.postfix=Potion of Saturation + +potion.potency.0= +potion.potency.1=II +potion.potency.2=III +potion.potency.3=IV + +potion.prefix.grenade=Splash +potion.prefix.mundane=Mundane +potion.prefix.uninteresting=Uninteresting +potion.prefix.bland=Bland +potion.prefix.clear=Clear +potion.prefix.milky=Milky +potion.prefix.diffuse=Diffuse +potion.prefix.artless=Artless +potion.prefix.thin=Thin +potion.prefix.awkward=Awkward +potion.prefix.flat=Flat +potion.prefix.bulky=Bulky +potion.prefix.bungling=Bungling +potion.prefix.buttered=Buttered +potion.prefix.smooth=Smooth +potion.prefix.suave=Suave +potion.prefix.debonair=Debonair +potion.prefix.thick=Thick +potion.prefix.elegant=Elegant +potion.prefix.fancy=Fancy +potion.prefix.charming=Charming +potion.prefix.dashing=Dashing +potion.prefix.refined=Refined +potion.prefix.cordial=Cordial +potion.prefix.sparkling=Sparkling +potion.prefix.potent=Potent +potion.prefix.foul=Foul +potion.prefix.odorless=Odorless +potion.prefix.rank=Rank +potion.prefix.harsh=Harsh +potion.prefix.acrid=Acrid +potion.prefix.gross=Gross +potion.prefix.stinky=Stinky + +enchantment.damage.all=Sharpness +enchantment.damage.undead=Smite +enchantment.damage.arthropods=Bane of Arthropods +enchantment.knockback=Knockback +enchantment.fire=Fire Aspect +enchantment.protect.all=Protection +enchantment.protect.fire=Fire Protection +enchantment.protect.fall=Feather Falling +enchantment.protect.explosion=Blast Protection +enchantment.protect.projectile=Projectile Protection +enchantment.oxygen=Respiration +enchantment.waterWorker=Aqua Affinity +enchantment.waterWalker=Depth Strider +enchantment.digging=Efficiency +enchantment.untouching=Silk Touch +enchantment.durability=Unbreaking +enchantment.lootBonus=Looting +enchantment.lootBonusDigger=Fortune +enchantment.lootBonusFishing=Luck of the Sea +enchantment.fishingSpeed=Lure +enchantment.arrowDamage=Power +enchantment.arrowFire=Flame +enchantment.arrowKnockback=Punch +enchantment.arrowInfinite=Infinity +enchantment.thorns=Thorns + +enchantment.level.1=I +enchantment.level.2=II +enchantment.level.3=III +enchantment.level.4=IV +enchantment.level.5=V +enchantment.level.6=VI +enchantment.level.7=VII +enchantment.level.8=VIII +enchantment.level.9=IX +enchantment.level.10=X + +gui.achievements=Achievements +gui.stats=Statistics + +stats.tooltip.type.achievement=Achievement +stats.tooltip.type.statistic=Statistic +stat.generalButton=General +stat.blocksButton=Blocks +stat.itemsButton=Items +stat.mobsButton=Mobs + +stat.used=Times Used +stat.mined=Times Mined +stat.depleted=Times Depleted +stat.crafted=Times Crafted +stat.entityKills=You killed %d %s +stat.entityKilledBy=%s killed you %d time(s) +stat.entityKills.none=You have never killed %s +stat.entityKilledBy.none=You have never been killed by %s + +stat.startGame=Times played +stat.createWorld=Worlds created +stat.loadWorld=Saves loaded +stat.joinMultiplayer=Multiplayer joins +stat.leaveGame=Games quit + +stat.playOneMinute=Minutes Played +stat.timeSinceDeath=Since Last Death + +stat.walkOneCm=Distance Walked +stat.crouchOneCm=Distance Crouched +stat.sprintOneCm=Distance Sprinted +stat.fallOneCm=Distance Fallen +stat.swimOneCm=Distance Swum +stat.flyOneCm=Distance Flown +stat.climbOneCm=Distance Climbed +stat.diveOneCm=Distance Dove +stat.minecartOneCm=Distance by Minecart +stat.boatOneCm=Distance by Boat +stat.pigOneCm=Distance by Pig +stat.horseOneCm=Distance by Horse +stat.jump=Jumps +stat.drop=Items Dropped + +stat.damageDealt=Damage Dealt +stat.damageTaken=Damage Taken +stat.deaths=Number of Deaths +stat.mobKills=Mob Kills +stat.animalsBred=Animals Bred +stat.playerKills=Player Kills +stat.fishCaught=Fish Caught +stat.treasureFished=Treasure Fished +stat.junkFished=Junk Fished +stat.talkedToVillager=Talked to Villagers +stat.tradedWithVillager=Traded with Villagers + +stat.cakeSlicesEaten=Cake Slices Eaten +stat.cauldronFilled=Cauldrons Filled +stat.cauldronUsed=Water Taken from Cauldron +stat.armorCleaned=Armor Pieces Cleaned +stat.bannerCleaned=Banners Cleaned +stat.brewingstandInteraction=Interactions with Brewing Stand +stat.beaconInteraction=Interactions with Beacon +stat.dropperInspected=Droppers Searched +stat.hopperInspected=Hoppers Searched +stat.dispenserInspected=Dispensers Searched +stat.noteblockPlayed=Noteblocks played +stat.noteblockTuned=Noteblocks tuned +stat.flowerPotted=Plants potted +stat.trappedChestTriggered=Trapped Chests Triggered +stat.enderchestOpened=Ender Chests Opened +stat.itemEnchanted=Items Enchanted +stat.recordPlayed=Records Played +stat.furnaceInteraction=Interactions with Furnace +stat.workbenchInteraction=Interactions with Crafting Table +stat.chestOpened=Chests Opened + +stat.mineBlock=%1$s Mined +stat.craftItem=%1$s Crafted +stat.useItem=%1$s Used +stat.breakItem=%1$s Depleted + +achievement.get=Achievement get! + +achievement.taken=Taken! +achievement.unknown=??? + +achievement.requires=Requires '%1$s' +achievement.openInventory=Taking Inventory +achievement.openInventory.desc=Press '%1$s' to open your inventory. +achievement.mineWood=Getting Wood +achievement.mineWood.desc=Attack a tree until a block of wood pops out +achievement.buildWorkBench=Benchmarking +achievement.buildWorkBench.desc=Craft a workbench with four blocks of planks +achievement.buildPickaxe=Time to Mine! +achievement.buildPickaxe.desc=Use planks and sticks to make a pickaxe +achievement.buildFurnace=Hot Topic +achievement.buildFurnace.desc=Construct a furnace out of eight stone blocks +achievement.acquireIron=Acquire Hardware +achievement.acquireIron.desc=Smelt an iron ingot +achievement.buildHoe=Time to Farm! +achievement.buildHoe.desc=Use planks and sticks to make a hoe +achievement.makeBread=Bake Bread +achievement.makeBread.desc=Turn wheat into bread +achievement.bakeCake=The Lie +achievement.bakeCake.desc=Wheat, sugar, milk and eggs! +achievement.buildBetterPickaxe=Getting an Upgrade +achievement.buildBetterPickaxe.desc=Construct a better pickaxe +achievement.overpowered=Overpowered +achievement.overpowered.desc=Build a Notch apple +achievement.cookFish=Delicious Fish +achievement.cookFish.desc=Catch and cook fish! +achievement.onARail=On A Rail +achievement.onARail.desc=Travel by minecart at least 1 km from where you started +achievement.buildSword=Time to Strike! +achievement.buildSword.desc=Use planks and sticks to make a sword +achievement.killEnemy=Monster Hunter +achievement.killEnemy.desc=Attack and destroy a monster +achievement.killCow=Cow Tipper +achievement.killCow.desc=Harvest some leather +achievement.breedCow=Repopulation +achievement.breedCow.desc=Breed two cows with wheat +achievement.flyPig=When Pigs Fly +achievement.flyPig.desc=Fly a pig off a cliff +achievement.snipeSkeleton=Sniper Duel +achievement.snipeSkeleton.desc=Kill a skeleton with an arrow from more than 50 meters +achievement.diamonds=DIAMONDS! +achievement.diamonds.desc=Acquire diamonds with your iron tools +achievement.diamondsToYou=Diamonds to you! +achievement.diamondsToYou.desc=Throw diamonds at another player. +achievement.portal=We Need to Go Deeper +achievement.portal.desc=Build a portal to the Nether +achievement.ghast=Return to Sender +achievement.ghast.desc=Destroy a Ghast with a fireball +achievement.blazeRod=Into Fire +achievement.blazeRod.desc=Relieve a Blaze of its rod +achievement.potion=Local Brewery +achievement.potion.desc=Brew a potion +achievement.theEnd=The End? +achievement.theEnd.desc=Locate the End +achievement.theEnd2=The End. +achievement.theEnd2.desc=Defeat the Ender Dragon +achievement.spawnWither=The Beginning? +achievement.spawnWither.desc=Spawn the Wither +achievement.killWither=The Beginning. +achievement.killWither.desc=Kill the Wither +achievement.fullBeacon=Beaconator +achievement.fullBeacon.desc=Create a full beacon +achievement.exploreAllBiomes=Adventuring Time +achievement.exploreAllBiomes.desc=Discover all biomes +achievement.enchantments=Enchanter +achievement.enchantments.desc=Use a book, obsidian and diamonds to construct an enchantment table +achievement.overkill=Overkill +achievement.overkill.desc=Deal nine hearts of damage in a single hit +achievement.bookcase=Librarian +achievement.bookcase.desc=Build some bookshelves to improve your enchantment table + +commands.generic.exception=An unknown error occurred while attempting to perform this command +commands.generic.permission=You do not have permission to use this command +commands.generic.syntax=Invalid command syntax +commands.generic.player.notFound=That player cannot be found +commands.generic.entity.notFound=That entity cannot be found +commands.generic.entity.invalidUuid=The entity UUID provided is in an invalid format +commands.generic.entity.invalidType=Entity type '%s' is invalid +commands.generic.notFound=Unknown command. Try /help for a list of commands +commands.generic.parameter.invalid='%s' is not a valid parameter +commands.generic.num.invalid='%s' is not a valid number +commands.generic.boolean.invalid='%s' is not true or false +commands.generic.num.tooSmall=The number you have entered (%d) is too small, it must be at least %d +commands.generic.num.tooBig=The number you have entered (%d) is too big, it must be at most %d +commands.generic.double.tooSmall=The number you have entered (%.2f) is too small, it must be at least %.2f +commands.generic.double.tooBig=The number you have entered (%.2f) is too big, it must be at most %.2f +commands.generic.usage=Usage: %s + +commands.setidletimeout.usage=/setidletimeout +commands.setidletimeout.success=Successfully set the idle timeout to %d minutes. +commands.xp.failure.widthdrawXp=Cannot give player negative experience points +commands.xp.success=Given %d experience to %s +commands.xp.success.levels=Given %d levels to %s +commands.xp.success.negative.levels=Taken %d levels from %s +commands.xp.usage=/xp [player] OR /xp L [player] +commands.playsound.usage=/playsound [x] [y] [z] [volume] [pitch] [minimumVolume] +commands.playsound.success=Played sound '%s' to %s +commands.playsound.playerTooFar=Player %s is too far away to hear the sound +commands.give.usage=/give [amount] [data] [dataTag] +commands.give.item.notFound=There is no such item with name %d +commands.give.block.notFound=There is no such block with name %d +commands.give.success=Given %s * %d to %s +commands.give.tagError=Data tag parsing failed: %s +commands.replaceitem.usage=/replaceitem ... +commands.replaceitem.entity.usage=/replaceitem entity [amount] [data] [dataTag] +commands.replaceitem.block.usage=/replaceitem block [amount] [data] [dataTag] +commands.replaceitem.tagError=Data tag parsing failed: %s +commands.replaceitem.noContainer=Block at %d, %d, %d is not a container +commands.replaceitem.failed=Could not replace slot %d with %d * %s +commands.replaceitem.success=Replaced slot %d with %d * %s +commands.stats.usage=/stats ... +commands.stats.entity.usage=/stats entity +commands.stats.entity.set.usage=/stats entity set +commands.stats.entity.clear.usage=/stats entity clear +commands.stats.block.usage=/stats block ... +commands.stats.block.set.usage=/stats block set +commands.stats.block.clear.usage=/stats block clear +commands.stats.noCompatibleBlock=Block at %d, %d, %d can not track stats +commands.stats.failed=Invalid parameters +commands.stats.cleared=Cleared %s stats +commands.stats.success=Storing %s stats in %s on %s +commands.summon.usage=/summon [x] [y] [z] [dataTag] +commands.summon.success=Object successfully summoned +commands.summon.failed=Unable to summon object +commands.summon.tagError=Data tag parsing failed: %s +commands.summon.outOfWorld=Cannot summon the object out of the world +commands.testforblock.usage=/testforblock [dataValue] [dataTag] +commands.testforblock.failed.tile=The block at %d,%d,%d is %s (expected: %s). +commands.testforblock.failed.data=The block at %d,%d,%d had the data value of %s (expected: %s). +commands.testforblock.failed.nbt=The block at %d,%d,%d did not have the required NBT keys. +commands.testforblock.failed.tileEntity=The block at %d,%d,%d is not a tile entity and cannot support tag matching. +commands.testforblock.success=Successfully found the block at %d,%d,%d. +commands.testforblock.outOfWorld=Cannot test for block outside of the world +commands.setblock.usage=/setblock [dataValue] [oldBlockHandling] [dataTag] +commands.setblock.success=Block placed +commands.setblock.failed=Unable to place block +commands.setblock.tagError=Data tag parsing failed: %s +commands.setblock.outOfWorld=Cannot place block outside of the world +commands.setblock.notFound=There is no such block with ID/name %s +commands.setblock.noChange=The block couldn't be placed +commands.fill.usage=/fill [dataValue] [oldBlockHandling] [dataTag] +commands.fill.outOfWorld=Cannot place blocks outside of the world +commands.fill.tagError=Data tag parsing failed: %s +commands.fill.success=%d blocks filled +commands.fill.failed=No blocks filled +commands.fill.tooManyBlocks=Too many blocks in the specified area (%d > %d) +commands.clone.usage=/clone [maskMode] [cloneMode] +commands.clone.outOfWorld=Cannot access blocks outside of the world +commands.clone.noOverlap=Source and destination can not overlap +commands.clone.success=%d blocks cloned +commands.clone.failed=No blocks cloned +commands.clone.tooManyBlocks=Too many blocks in the specified area (%d > %d) +commands.compare.usage=/testforblocks [mode] +commands.compare.outOfWorld=Cannot access blocks outside of the world +commands.compare.failed=Source and destination are not identical +commands.compare.success=%d blocks compared +commands.compare.tooManyBlocks=Too many blocks in the specified area (%d > %d) +commands.blockdata.usage=/blockdata +commands.blockdata.success=Block data updated to: %s +commands.blockdata.tagError=Data tag parsing failed: %s +commands.blockdata.outOfWorld=Cannot change block outside of the world +commands.blockdata.notValid=The target block is not a data holder block +commands.blockdata.failed=The data tag did not change: %s +commands.entitydata.usage=/entitydata +commands.entitydata.success=Entity data updated to: %s +commands.entitydata.tagError=Data tag parsing failed: %s +commands.entitydata.noPlayers=%s is a player and cannot be changed +commands.entitydata.failed=The data tag did not change: %s +commands.effect.usage=/effect [seconds] [amplifier] [hideParticles] OR /effect clear +commands.effect.notFound=There is no such mob effect with ID %d +commands.effect.success=Given %1$s (ID %2$d) * %3$d to %4$s for %5$d seconds +commands.effect.success.removed=Took %1$s from %2$s +commands.effect.success.removed.all=Took all effects from %s +commands.effect.failure.notActive=Couldn't take %1$s from %2$s as they do not have the effect +commands.effect.failure.notActive.all=Couldn't take any effects from %s as they do not have any +commands.enchant.usage=/enchant [level] +commands.enchant.notFound=There is no such enchantment with ID %d +commands.enchant.noItem=The target doesn't hold an item +commands.enchant.cantEnchant=The selected enchantment can't be added to the target item +commands.enchant.cantCombine=%1$s can't be combined with %2$s +commands.enchant.success=Enchanting succeeded +commands.particle.usage=/particle [count] [mode] +commands.particle.success=Playing effect %s for %d times +commands.particle.notFound=Unknown effect name (%s) +commands.clear.usage=/clear [player] [item] [data] [maxCount] [dataTag] +commands.clear.success=Cleared the inventory of %s, removing %d items +commands.clear.testing=%s has %d items that match the criteria +commands.clear.failure=Could not clear the inventory of %s, no items to remove +commands.clear.tagError=Data tag parsing failed: %s +commands.downfall.usage=/toggledownfall +commands.downfall.success=Toggled downfall +commands.time.usage=/time +commands.time.added=Added %d to the time +commands.time.set=Set the time to %d +commands.time.query=Time is %d +commands.players.usage=/list +commands.players.list=There are %d/%d players online: +commands.banlist.ips=There are %d total banned IP addresses: +commands.banlist.players=There are %d total banned players: +commands.banlist.usage=/banlist [ips|players] +commands.kill.usage=/kill [player|entity] +commands.kill.successful=Killed %s +commands.kick.success=Kicked %s from the game +commands.kick.success.reason=Kicked %s from the game: '%s' +commands.kick.usage=/kick [reason ...] +commands.op.success=Opped %s +commands.op.failed=Could not op %s +commands.op.usage=/op +commands.deop.success=De-opped %s +commands.deop.failed=Could not de-op %s +commands.deop.usage=/deop +commands.say.usage=/say +commands.ban.success=Banned player %s +commands.ban.failed=Could not ban player %s +commands.ban.usage=/ban [reason ...] +commands.unban.success=Unbanned player %s +commands.unban.failed=Could not unban player %s +commands.unban.usage=/pardon +commands.banip.invalid=You have entered an invalid IP address or a player that is not online +commands.banip.success=Banned IP address %s +commands.banip.success.players=Banned IP address %s belonging to %s +commands.banip.usage=/ban-ip [reason ...] +commands.unbanip.invalid=You have entered an invalid IP address +commands.unbanip.success=Unbanned IP address %s +commands.unbanip.usage=/pardon-ip
+commands.save.usage=/save-all +commands.save-on.alreadyOn=Saving is already turned on. +commands.save-on.usage=/save-on +commands.save-off.alreadyOff=Saving is already turned off. +commands.save-off.usage=/save-off +commands.save.enabled=Turned on world auto-saving +commands.save.disabled=Turned off world auto-saving +commands.save.start=Saving... +commands.save.success=Saved the world +commands.save.failed=Saving failed: %s +commands.stop.usage=/stop +commands.stop.start=Stopping the server +commands.tp.success=Teleported %s to %s +commands.tp.success.coordinates=Teleported %s to %s, %s, %s +commands.tp.usage=/tp [target player] OR /tp [target player] [ ] +commands.tp.notSameDimension=Unable to teleport because players are not in the same dimension +commands.whitelist.list=There are %d (out of %d seen) whitelisted players: +commands.whitelist.enabled=Turned on the whitelist +commands.whitelist.disabled=Turned off the whitelist +commands.whitelist.reloaded=Reloaded the whitelist +commands.whitelist.add.success=Added %s to the whitelist +commands.whitelist.add.failed=Could not add %s to the whitelist +commands.whitelist.add.usage=/whitelist add +commands.whitelist.remove.success=Removed %s from the whitelist +commands.whitelist.remove.failed=Could not remove %s from the whitelist +commands.whitelist.remove.usage=/whitelist remove +commands.whitelist.usage=/whitelist +commands.scoreboard.usage=/scoreboard ... +commands.scoreboard.noMultiWildcard=Only one user wildcard allowed +commands.scoreboard.allMatchesFailed=All matches failed +commands.scoreboard.teamNotFound=No team was found by the name '%s' +commands.scoreboard.objectiveNotFound=No objective was found by the name '%s' +commands.scoreboard.objectiveReadOnly=The objective '%s' is read-only and cannot be set +commands.scoreboard.objectives.usage=/scoreboard objectives ... +commands.scoreboard.objectives.setdisplay.usage=/scoreboard objectives setdisplay [objective] +commands.scoreboard.objectives.setdisplay.invalidSlot=No such display slot '%s' +commands.scoreboard.objectives.setdisplay.successCleared=Cleared objective display slot '%s' +commands.scoreboard.objectives.setdisplay.successSet=Set the display objective in slot '%s' to '%s' +commands.scoreboard.objectives.add.usage=/scoreboard objectives add [display name ...] +commands.scoreboard.objectives.add.wrongType=Invalid objective criteria type '%s' +commands.scoreboard.objectives.add.alreadyExists=An objective with the name '%s' already exists +commands.scoreboard.objectives.add.tooLong=The name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.displayTooLong=The display name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.success=Added new objective '%s' successfully +commands.scoreboard.objectives.remove.usage=/scoreboard objectives remove +commands.scoreboard.objectives.remove.success=Removed objective '%s' successfully +commands.scoreboard.objectives.list.count=Showing %d objective(s) on scoreboard: +commands.scoreboard.objectives.list.entry=- %s: displays as '%s' and is type '%s' +commands.scoreboard.objectives.list.empty=There are no objectives on the scoreboard +commands.scoreboard.players.usage=/scoreboard players ... +commands.scoreboard.players.name.tooLong=The name '%s' is too long for a player, it can be at most %d characters long +commands.scoreboard.players.set.success=Set score of %s for player %s to %d +commands.scoreboard.players.set.tagMismatch=The dataTag does not match for %s +commands.scoreboard.players.set.tagError=Could not parse dataTag, reason: %s +commands.scoreboard.players.set.usage=/scoreboard players set [dataTag] +commands.scoreboard.players.add.usage=/scoreboard players add [dataTag] +commands.scoreboard.players.remove.usage=/scoreboard players remove [dataTag] +commands.scoreboard.players.reset.usage=/scoreboard players reset [objective] +commands.scoreboard.players.reset.success=Reset scores of player %s +commands.scoreboard.players.resetscore.success=Reset score %s of player %s +commands.scoreboard.players.list.usage=/scoreboard players list [name] +commands.scoreboard.players.list.count=Showing %d tracked players on the scoreboard: +commands.scoreboard.players.list.empty=There are no tracked players on the scoreboard +commands.scoreboard.players.list.player.count=Showing %d tracked objective(s) for %s: +commands.scoreboard.players.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.players.list.player.empty=Player %s has no scores recorded +commands.scoreboard.players.enable.usage=/scoreboard players enable +commands.scoreboard.players.enable.success=Enabled trigger %s for %s +commands.scoreboard.players.enable.noTrigger=Objective %s is not a trigger +commands.scoreboard.players.test.usage=/scoreboard players test +commands.scoreboard.players.test.notFound=No %s score for %s found +commands.scoreboard.players.test.failed=Score %d is NOT in range %d to %d +commands.scoreboard.players.test.success=Score %d is in range %d to %d +commands.scoreboard.players.operation.usage=/scoreboard players operation +commands.scoreboard.players.operation.notFound=No %s score for %s found +commands.scoreboard.players.operation.invalidOperation=Invalid operation %s +commands.scoreboard.players.operation.success=Operation applied successfully +commands.scoreboard.teams.usage=/scoreboard teams ... +commands.scoreboard.teams.add.usage=/scoreboard teams add [display name ...] +commands.scoreboard.teams.add.alreadyExists=A team with the name '%s' already exists +commands.scoreboard.teams.add.tooLong=The name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.displayTooLong=The display name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.success=Added new team '%s' successfully +commands.scoreboard.teams.list.usage=/scoreboard teams list [name] +commands.scoreboard.teams.list.count=Showing %d teams on the scoreboard: +commands.scoreboard.teams.list.entry=- %1$s: '%2$s' has %3$d players +commands.scoreboard.teams.list.empty=There are no teams registered on the scoreboard +commands.scoreboard.teams.list.player.count=Showing %d player(s) in team %s: +commands.scoreboard.teams.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.teams.list.player.empty=Team %s has no players +commands.scoreboard.teams.empty.usage=/scoreboard teams empty +commands.scoreboard.teams.empty.alreadyEmpty=Team %s is already empty, cannot remove nonexistant players +commands.scoreboard.teams.empty.success=Removed all %d player(s) from team %s +commands.scoreboard.teams.remove.usage=/scoreboard teams remove +commands.scoreboard.teams.remove.success=Removed team %s +commands.scoreboard.teams.join.usage=/scoreboard teams join [player] +commands.scoreboard.teams.join.success=Added %d player(s) to team %s: %s +commands.scoreboard.teams.join.failure=Could not add %d player(s) to team %s: %s +commands.scoreboard.teams.leave.usage=/scoreboard teams leave [player] +commands.scoreboard.teams.leave.success=Removed %d player(s) from their teams: %s +commands.scoreboard.teams.leave.failure=Could not remove %d player(s) from their teams: %s +commands.scoreboard.teams.leave.noTeam=You are not in a team +commands.scoreboard.teams.option.usage=/scoreboard teams option +commands.scoreboard.teams.option.noValue=Valid values for option %s are: %s +commands.scoreboard.teams.option.success=Set option %s for team %s to %s +commands.execute.usage=/execute OR /execute detect +commands.execute.allInvocationsFailed=All invocations failed: '%s' +commands.execute.failed=Failed to execute '%s' as %s +commands.gamemode.success.self=Set own game mode to %s +commands.gamemode.success.other=Set %s's game mode to %s +commands.gamemode.usage=/gamemode [player] +commands.defaultgamemode.usage=/defaultgamemode +commands.defaultgamemode.success=The world's default game mode is now %s +commands.me.usage=/me +commands.help.header=--- Showing help page %d of %d (/help ) --- +commands.help.footer=Tip: Use the key while typing a command to auto-complete the command or its arguments +commands.help.usage=/help [page|command name] +commands.trigger.usage=/trigger +commands.trigger.invalidObjective=Invalid trigger name %s +commands.trigger.invalidMode=Invalid trigger mode %s +commands.trigger.disabled=Trigger %s is not enabled +commands.trigger.invalidPlayer=Only players can use the /trigger command +commands.trigger.success=Trigger %s changed with %s %s +commands.publish.usage=/publish +commands.publish.started=Local game hosted on port %s +commands.publish.failed=Unable to host local game +commands.debug.start=Started debug profiling +commands.debug.stop=Stopped debug profiling after %.2f seconds (%d ticks) +commands.debug.notStarted=Can't stop profiling when we haven't started yet! +commands.debug.usage=/debug +commands.chunkinfo.usage=/chunkinfo [ ] +commands.chunkinfo.location=Chunk location: (%d, %d, %d) +commands.chunkinfo.noChunk=No chunk found at chunk position %d, %d, %d +commands.chunkinfo.notEmpty=Chunk is not empty. +commands.chunkinfo.empty=Chunk is empty. +commands.chunkinfo.notCompiled=Chunk is not compiled. +commands.chunkinfo.compiled=Chunk is compiled. +commands.chunkinfo.hasNoRenderableLayers=Chunk has no renderable layers. +commands.chunkinfo.hasLayers=Chunk has layers: %s +commands.chunkinfo.isEmpty=Chunk has empty layers: %s +commands.chunkinfo.vertices=%s layer's buffer contains %d vertices +commands.chunkinfo.data=First 64 vertices are: %s +commands.tellraw.usage=/tellraw +commands.tellraw.jsonException=Invalid json: %s +commands.message.usage=/tell +commands.message.sameTarget=You can't send a private message to yourself! +commands.message.display.outgoing=You whisper to %s: %s +commands.message.display.incoming=%s whispers to you: %s +commands.difficulty.usage=/difficulty +commands.difficulty.success=Set game difficulty to %s +commands.spawnpoint.usage=/spawnpoint [player] [ ] +commands.spawnpoint.success=Set %s's spawn point to (%d, %d, %d) +commands.setworldspawn.usage=/setworldspawn [ ] +commands.setworldspawn.success=Set the world spawn point to (%d, %d, %d) +commands.gamerule.usage=/gamerule [value] +commands.gamerule.success=Game rule has been updated +commands.gamerule.norule=No game rule called '%s' is available +commands.gamerule.nopermission=Only server owners can change '%s' +commands.weather.usage=/weather [duration in seconds] +commands.weather.clear=Changing to clear weather +commands.weather.rain=Changing to rainy weather +commands.weather.thunder=Changing to rain and thunder +commands.testfor.usage=/testfor [dataTag] +commands.testfor.failure=%s did not match the required data structure +commands.testfor.success=Found %s +commands.testfor.tagError=Data tag parsing failed: %s +commands.seed.usage=/seed +commands.seed.success=Seed: %s +commands.spreadplayers.usage=/spreadplayers +commands.spreadplayers.spreading.teams=Spreading %s teams %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.spreading.players=Spreading %s players %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.success.teams=Successfully spread %s teams around %s,%s +commands.spreadplayers.success.players=Successfully spread %s players around %s,%s +commands.spreadplayers.info.teams=(Average distance between teams is %s blocks apart after %s iterations) +commands.spreadplayers.info.players=(Average distance between players is %s blocks apart after %s iterations) +commands.spreadplayers.failure.teams=Could not spread %s teams around %s,%s (too many players for space - try using spread of at most %s) +commands.spreadplayers.failure.players=Could not spread %s players around %s,%s (too many players for space - try using spread of at most %s) +commands.achievement.usage=/achievement [player] +commands.achievement.unknownAchievement=Unknown achievement or statistic '%s' +commands.achievement.alreadyHave=Player %s already has achievement %s +commands.achievement.dontHave=Player %s doesn't have achievement %s +commands.achievement.give.success.all=Successfully given all achievements to %s +commands.achievement.give.success.one=Successfully given %s the stat %s +commands.achievement.take.success.all=Successfully taken all achievements from %s +commands.achievement.take.success.one=Successfully taken the stat %s from %s +commands.achievement.statTooLow=Player %s does not have the stat %s +commands.worldborder.usage=/worldborder ... +commands.worldborder.add.usage=/worldborder add [timeInSeconds] +commands.worldborder.set.usage=/worldborder set [timeInSeconds] +commands.worldborder.set.success=Set world border to %s blocks wide (from %s blocks) +commands.worldborder.get.success=World border is currently %s blocks wide +commands.worldborder.setSlowly.shrink.success=Shrinking world border to %s blocks wide (down from %s blocks) over %s seconds +commands.worldborder.setSlowly.grow.success=Growing world border to %s blocks wide (up from %s blocks) over %s seconds +commands.worldborder.center.usage=/worldborder center +commands.worldborder.center.success=Set world border center to %s,%s +commands.worldborder.damage.usage=/worldborder damage +commands.worldborder.damage.buffer.usage=/worldborder damage buffer +commands.worldborder.damage.buffer.success=Set world border damage buffer to %s blocks (from %s blocks) +commands.worldborder.damage.amount.usage=/worldborder damage amount +commands.worldborder.damage.amount.success=Set world border damage amount to %s per block (from %s per block) +commands.worldborder.warning.usage=/worldborder warning +commands.worldborder.warning.time.usage=/worldborder warning time +commands.worldborder.warning.time.success=Set world border warning to %s seconds away (from %s seconds) +commands.worldborder.warning.distance.usage=/worldborder warning distance +commands.worldborder.warning.distance.success=Set world border warning to %s blocks away (from %s blocks) +commands.title.usage=/title ... +commands.title.usage.title=/title title|subtitle +commands.title.usage.clear=/title clear|reset +commands.title.usage.times=/title times +commands.title.success=Title command successfully executed + +itemGroup.buildingBlocks=Building Blocks +itemGroup.decorations=Decoration Blocks +itemGroup.redstone=Redstone +itemGroup.transportation=Transportation +itemGroup.misc=Miscellaneous +itemGroup.search=Search Items +itemGroup.food=Foodstuffs +itemGroup.tools=Tools +itemGroup.combat=Combat +itemGroup.brewing=Brewing +itemGroup.materials=Materials +itemGroup.inventory=Survival Inventory + +inventory.binSlot=Destroy Item + +advMode.setCommand=Set Console Command for Block +advMode.setCommand.success=Command set: %s +advMode.command=Console Command +advMode.nearestPlayer=Use "@p" to target nearest player +advMode.randomPlayer=Use "@r" to target random player +advMode.allPlayers=Use "@a" to target all players +advMode.allEntities=Use "@e" to target all entities +advMode.previousOutput=Previous Output + +advMode.notEnabled=Command blocks are not enabled on this server +advMode.notAllowed=Must be an opped player in creative mode + +mount.onboard=Press %1$s to dismount + +build.tooHigh=Height limit for building is %s blocks + +attribute.modifier.plus.0=+%d %s +attribute.modifier.plus.1=+%d%% %s +attribute.modifier.plus.2=+%d%% %s +attribute.modifier.take.0=-%d %s +attribute.modifier.take.1=-%d%% %s +attribute.modifier.take.2=-%d%% %s + +attribute.name.horse.jumpStrength=Horse Jump Strength +attribute.name.zombie.spawnReinforcements=Zombie Reinforcements +attribute.name.generic.maxHealth=Max Health +attribute.name.generic.followRange=Mob Follow Range +attribute.name.generic.knockbackResistance=Knockback Resistance +attribute.name.generic.movementSpeed=Speed +attribute.name.generic.attackDamage=Attack Damage + +screenshot.success=Saved screenshot as %s +screenshot.failure=Couldn't save screenshot: %s + +stream.user.mode.moderator=Moderator +stream.user.mode.moderator.self=Moderator on your channel +stream.user.mode.moderator.other=Moderator on %s's channel +stream.user.mode.broadcaster=Broadcaster +stream.user.mode.broadcaster.self=Broadcaster (You!) +stream.user.mode.broadcaster.other=Broadcaster +stream.user.mode.administrator=Twitch Administrator +stream.user.mode.staff=Twitch Staff +stream.user.mode.banned=Banned +stream.user.mode.banned.self=Banned on your channel +stream.user.mode.banned.other=Banned on %s's channel +stream.user.subscription.subscriber=Subscriber +stream.user.subscription.subscriber.self=Subscriber to your channel +stream.user.subscription.subscriber.other=Subscriber to %s's channel +stream.user.subscription.turbo=Twitch Turbo + +stream.unavailable.title=Twitch Broadcasting Unavailable +stream.unavailable.report_to_mojang=Report to Mojang + +stream.confirm_start=Are you sure you want to start broadcasting? + +stream.unavailable.account_not_bound=Before you can broadcast Minecraft through Twitch, you will need to link your Twitch account on mojang.com. Would you like to do that now? +stream.unavailable.account_not_bound.okay=Link Accounts +stream.unavailable.account_not_migrated=Before you can broadcast Minecraft through Twitch, you will need to migrate your Minecraft account to a Mojang account. Would you like to do that now? +stream.unavailable.account_not_migrated.okay=Migrate Account +stream.unavailable.failed_auth=Authentication to Twitch failed. Please go to mojang.com and rebind your Twitch account. +stream.unavailable.failed_auth.okay=Rebind Accounts +stream.unavailable.failed_auth_error=Unable to authenticate to Twitch. Please try again later. +stream.unavailable.initialization_failure=Unable to initialize the Twitch SDK. +stream.unavailable.initialization_failure.extra=(Reason: %s) +stream.unavailable.library_arch_mismatch=The custom java version used to launch Minecraft has a different architecture than the one used to run the launcher. Please make sure these are the same, either 32-bit or 64-bit for both. +stream.unavailable.library_failure=Unable to load the libraries needed for the integrated Twitch broadcasting service. +stream.unavailable.no_fbo=Your video card needs to support at least OpenGL version 3.0 or support Framebuffer Objects via an extension to use the integrated Twitch broadcasting. +stream.unavailable.no_fbo.version=You are currently using: %s +stream.unavailable.no_fbo.blend=Separate blending support via EXT is: %s +stream.unavailable.no_fbo.arb=Framebuffer object support via ARB is: %s +stream.unavailable.no_fbo.ext=Framebuffer object support via EXT is: %s +stream.unavailable.not_supported.windows=Unfortunately the integrated Twitch broadcasting requires a newer version of Windows than you are on. You must have at least Windows Vista or newer. +stream.unavailable.not_supported.mac=Unfortunately the integrated Twitch broadcasting on Mac requires a version of OSX newer than the one you are on. You must use 10.7 (Mac OS X Lion) or newer to be able to use this service. Would you like to visit apple.com to learn about upgrading? +stream.unavailable.not_supported.mac.okay=Upgrade +stream.unavailable.not_supported.other=Unfortunately the integrated Twitch broadcasting service requires Windows (Vista or newer) or Mac OS X (10.7/Lion or newer) +stream.unavailable.unknown=Unfortunately you cannot broadcast to Twitch at this time. And we don't know why :'( +stream.unavailable.unknown.chat=Could not start stream: %s + +stream.unavailable.soundflower.chat=Soundflower is required to be able to stream on Mac. %s +stream.unavailable.soundflower.chat.link=Please click here to install it. + +stream.userinfo.chatTooltip=Click to manage user +stream.userinfo.timeout=Timeout +stream.userinfo.ban=Ban +stream.userinfo.unban=Unban +stream.userinfo.mod=Promote to Moderator +stream.userinfo.unmod=Demote from Moderator + +item.banner.black.name=Black Banner +item.banner.red.name=Red Banner +item.banner.green.name=Green Banner +item.banner.brown.name=Brown Banner +item.banner.blue.name=Blue Banner +item.banner.purple.name=Purple Banner +item.banner.cyan.name=Cyan Banner +item.banner.silver.name=Light Gray Banner +item.banner.gray.name=Gray Banner +item.banner.pink.name=Pink Banner +item.banner.lime.name=Lime Banner +item.banner.yellow.name=Yellow Banner +item.banner.lightBlue.name=Light Blue Banner +item.banner.magenta.name=Magenta Banner +item.banner.orange.name=Orange Banner +item.banner.white.name=White Banner + +item.banner.square_bottom_left.black=Black Base Dexter Canton +item.banner.square_bottom_left.red=Red Base Dexter Canton +item.banner.square_bottom_left.green=Green Base Dexter Canton +item.banner.square_bottom_left.brown=Brown Base Dexter Canton +item.banner.square_bottom_left.blue=Blue Base Dexter Canton +item.banner.square_bottom_left.purple=Purple Base Dexter Canton +item.banner.square_bottom_left.cyan=Cyan Base Dexter Canton +item.banner.square_bottom_left.silver=Light Gray Base Dexter Canton +item.banner.square_bottom_left.gray=Gray Base Dexter Canton +item.banner.square_bottom_left.pink=Pink Base Dexter Canton +item.banner.square_bottom_left.lime=Lime Base Dexter Canton +item.banner.square_bottom_left.yellow=Yellow Base Dexter Canton +item.banner.square_bottom_left.lightBlue=Light Blue Base Dexter Canton +item.banner.square_bottom_left.magenta=Magenta Base Dexter Canton +item.banner.square_bottom_left.orange=Orange Base Dexter Canton +item.banner.square_bottom_left.white=White Base Dexter Canton + +item.banner.square_bottom_right.black=Black Base Sinister Canton +item.banner.square_bottom_right.red=Red Base Sinister Canton +item.banner.square_bottom_right.green=Green Base Sinister Canton +item.banner.square_bottom_right.brown=Brown Base Sinister Canton +item.banner.square_bottom_right.blue=Blue Base Sinister Canton +item.banner.square_bottom_right.purple=Purple Base Sinister Canton +item.banner.square_bottom_right.cyan=Cyan Base Sinister Canton +item.banner.square_bottom_right.silver=Light Gray Base Sinister Canton +item.banner.square_bottom_right.gray=Gray Base Sinister Canton +item.banner.square_bottom_right.pink=Pink Base Sinister Canton +item.banner.square_bottom_right.lime=Lime Base Sinister Canton +item.banner.square_bottom_right.yellow=Yellow Base Sinister Canton +item.banner.square_bottom_right.lightBlue=Light Blue Base Sinister Canton +item.banner.square_bottom_right.magenta=Magenta Base Sinister Canton +item.banner.square_bottom_right.orange=Orange Base Sinister Canton +item.banner.square_bottom_right.white=White Base Sinister Canton + +item.banner.square_top_left.black=Black Chief Dexter Canton +item.banner.square_top_left.red=Red Chief Dexter Canton +item.banner.square_top_left.green=Green Chief Dexter Canton +item.banner.square_top_left.brown=Brown Chief Dexter Canton +item.banner.square_top_left.blue=Blue Chief Dexter Canton +item.banner.square_top_left.purple=Purple Chief Dexter Canton +item.banner.square_top_left.cyan=Cyan Chief Dexter Canton +item.banner.square_top_left.silver=Light Gray Chief Dexter Canton +item.banner.square_top_left.gray=Gray Chief Dexter Canton +item.banner.square_top_left.pink=Pink Chief Dexter Canton +item.banner.square_top_left.lime=Lime Chief Dexter Canton +item.banner.square_top_left.yellow=Yellow Chief Dexter Canton +item.banner.square_top_left.lightBlue=Light Blue Chief Dexter Canton +item.banner.square_top_left.magenta=Magenta Chief Dexter Canton +item.banner.square_top_left.orange=Orange Chief Dexter Canton +item.banner.square_top_left.white=White Chief Dexter Canton + +item.banner.square_top_right.black=Black Chief Sinister Canton +item.banner.square_top_right.red=Red Chief Sinister Canton +item.banner.square_top_right.green=Green Chief Sinister Canton +item.banner.square_top_right.brown=Brown Chief Sinister Canton +item.banner.square_top_right.blue=Blue Chief Sinister Canton +item.banner.square_top_right.purple=Purple Chief Sinister Canton +item.banner.square_top_right.cyan=Cyan Chief Sinister Canton +item.banner.square_top_right.silver=Light Gray Chief Sinister Canton +item.banner.square_top_right.gray=Gray Chief Sinister Canton +item.banner.square_top_right.pink=Pink Chief Sinister Canton +item.banner.square_top_right.lime=Lime Chief Sinister Canton +item.banner.square_top_right.yellow=Yellow Chief Sinister Canton +item.banner.square_top_right.lightBlue=Light Blue Chief Sinister Canton +item.banner.square_top_right.magenta=Magenta Chief Sinister Canton +item.banner.square_top_right.orange=Orange Chief Sinister Canton +item.banner.square_top_right.white=White Chief Sinister Canton + +item.banner.stripe_bottom.black=Black Base Fess +item.banner.stripe_bottom.red=Red Base Fess +item.banner.stripe_bottom.green=Green Base Fess +item.banner.stripe_bottom.brown=Brown Base Fess +item.banner.stripe_bottom.blue=Blue Base Fess +item.banner.stripe_bottom.purple=Purple Base Fess +item.banner.stripe_bottom.cyan=Cyan Base Fess +item.banner.stripe_bottom.silver=Light Gray Base Fess +item.banner.stripe_bottom.gray=Gray Base Fess +item.banner.stripe_bottom.pink=Pink Base Fess +item.banner.stripe_bottom.lime=Lime Base Fess +item.banner.stripe_bottom.yellow=Yellow Base Fess +item.banner.stripe_bottom.lightBlue=Light Blue Base Fess +item.banner.stripe_bottom.magenta=Magenta Base Fess +item.banner.stripe_bottom.orange=Orange Base Fess +item.banner.stripe_bottom.white=White Base Fess + +item.banner.stripe_top.black=Black Chief Fess +item.banner.stripe_top.red=Red Chief Fess +item.banner.stripe_top.green=Green Chief Fess +item.banner.stripe_top.brown=Brown Chief Fess +item.banner.stripe_top.blue=Blue Chief Fess +item.banner.stripe_top.purple=Purple Chief Fess +item.banner.stripe_top.cyan=Cyan Chief Fess +item.banner.stripe_top.silver=Light Gray Chief Fess +item.banner.stripe_top.gray=Gray Chief Fess +item.banner.stripe_top.pink=Pink Chief Fess +item.banner.stripe_top.lime=Lime Chief Fess +item.banner.stripe_top.yellow=Yellow Chief Fess +item.banner.stripe_top.lightBlue=Light Blue Chief Fess +item.banner.stripe_top.magenta=Magenta Chief Fess +item.banner.stripe_top.orange=Orange Chief Fess +item.banner.stripe_top.white=White Chief Fess + +item.banner.stripe_left.black=Black Pale Dexter +item.banner.stripe_left.red=Red Pale Dexter +item.banner.stripe_left.green=Green Pale Dexter +item.banner.stripe_left.brown=Brown Pale Dexter +item.banner.stripe_left.blue=Blue Pale Dexter +item.banner.stripe_left.purple=Purple Pale Dexter +item.banner.stripe_left.cyan=Cyan Pale Dexter +item.banner.stripe_left.silver=Light Gray Pale Dexter +item.banner.stripe_left.gray=Gray Pale Dexter +item.banner.stripe_left.pink=Pink Pale Dexter +item.banner.stripe_left.lime=Lime Pale Dexter +item.banner.stripe_left.yellow=Yellow Pale Dexter +item.banner.stripe_left.lightBlue=Light Blue Pale Dexter +item.banner.stripe_left.magenta=Magenta Pale Dexter +item.banner.stripe_left.orange=Orange Pale Dexter +item.banner.stripe_left.white=White Pale Dexter + +item.banner.stripe_right.black=Black Pale Sinister +item.banner.stripe_right.red=Red Pale Sinister +item.banner.stripe_right.green=Green Pale Sinister +item.banner.stripe_right.brown=Brown Pale Sinister +item.banner.stripe_right.blue=Blue Pale Sinister +item.banner.stripe_right.purple=Purple Pale Sinister +item.banner.stripe_right.cyan=Cyan Pale Sinister +item.banner.stripe_right.silver=Light Gray Pale Sinister +item.banner.stripe_right.gray=Gray Pale Sinister +item.banner.stripe_right.pink=Pink Pale Sinister +item.banner.stripe_right.lime=Lime Pale Sinister +item.banner.stripe_right.yellow=Yellow Pale Sinister +item.banner.stripe_right.lightBlue=Light Blue Pale Sinister +item.banner.stripe_right.magenta=Magenta Pale Sinister +item.banner.stripe_right.orange=Orange Pale Sinister +item.banner.stripe_right.white=White Pale Sinister + +item.banner.stripe_center.black=Black Pale +item.banner.stripe_center.red=Red Pale +item.banner.stripe_center.green=Green Pale +item.banner.stripe_center.brown=Brown Pale +item.banner.stripe_center.blue=Blue Pale +item.banner.stripe_center.purple=Purple Pale +item.banner.stripe_center.cyan=Cyan Pale +item.banner.stripe_center.silver=Light Gray Pale +item.banner.stripe_center.gray=Gray Pale +item.banner.stripe_center.pink=Pink Pale +item.banner.stripe_center.lime=Lime Pale +item.banner.stripe_center.yellow=Yellow Pale +item.banner.stripe_center.lightBlue=Light Blue Pale +item.banner.stripe_center.magenta=Magenta Pale +item.banner.stripe_center.orange=Orange Pale +item.banner.stripe_center.white=White Pale + +item.banner.stripe_middle.black=Black Fess +item.banner.stripe_middle.red=Red Fess +item.banner.stripe_middle.green=Green Fess +item.banner.stripe_middle.brown=Brown Fess +item.banner.stripe_middle.blue=Blue Fess +item.banner.stripe_middle.purple=Purple Fess +item.banner.stripe_middle.cyan=Cyan Fess +item.banner.stripe_middle.silver=Light Gray Fess +item.banner.stripe_middle.gray=Gray Fess +item.banner.stripe_middle.pink=Pink Fess +item.banner.stripe_middle.lime=Lime Fess +item.banner.stripe_middle.yellow=Yellow Fess +item.banner.stripe_middle.lightBlue=Light Blue Fess +item.banner.stripe_middle.magenta=Magenta Fess +item.banner.stripe_middle.orange=Orange Fess +item.banner.stripe_middle.white=White Fess + +item.banner.stripe_downright.black=Black Bend +item.banner.stripe_downright.red=Red Bend +item.banner.stripe_downright.green=Green Bend +item.banner.stripe_downright.brown=Brown Bend +item.banner.stripe_downright.blue=Blue Bend +item.banner.stripe_downright.purple=Purple Bend +item.banner.stripe_downright.cyan=Cyan Bend +item.banner.stripe_downright.silver=Light Gray Bend +item.banner.stripe_downright.gray=Gray Bend +item.banner.stripe_downright.pink=Pink Bend +item.banner.stripe_downright.lime=Lime Bend +item.banner.stripe_downright.yellow=Yellow Bend +item.banner.stripe_downright.lightBlue=Light Blue Bend +item.banner.stripe_downright.magenta=Magenta Bend +item.banner.stripe_downright.orange=Orange Bend +item.banner.stripe_downright.white=White Bend + +item.banner.stripe_downleft.black=Black Bend Sinister +item.banner.stripe_downleft.red=Red Bend Sinister +item.banner.stripe_downleft.green=Green Bend Sinister +item.banner.stripe_downleft.brown=Brown Bend Sinister +item.banner.stripe_downleft.blue=Blue Bend Sinister +item.banner.stripe_downleft.purple=Purple Bend Sinister +item.banner.stripe_downleft.cyan=Cyan Bend Sinister +item.banner.stripe_downleft.silver=Light Gray Bend Sinister +item.banner.stripe_downleft.gray=Gray Bend Sinister +item.banner.stripe_downleft.pink=Pink Bend Sinister +item.banner.stripe_downleft.lime=Lime Bend Sinister +item.banner.stripe_downleft.yellow=Yellow Bend Sinister +item.banner.stripe_downleft.lightBlue=Light Blue Bend Sinister +item.banner.stripe_downleft.magenta=Magenta Bend Sinister +item.banner.stripe_downleft.orange=Orange Bend Sinister +item.banner.stripe_downleft.white=White Bend Sinister + +item.banner.small_stripes.black=Black Paly +item.banner.small_stripes.red=Red Paly +item.banner.small_stripes.green=Green Paly +item.banner.small_stripes.brown=Brown Paly +item.banner.small_stripes.blue=Blue Paly +item.banner.small_stripes.purple=Purple Paly +item.banner.small_stripes.cyan=Cyan Paly +item.banner.small_stripes.silver=Light Gray Paly +item.banner.small_stripes.gray=Gray Paly +item.banner.small_stripes.pink=Pink Paly +item.banner.small_stripes.lime=Lime Paly +item.banner.small_stripes.yellow=Yellow Paly +item.banner.small_stripes.lightBlue=Light Blue Paly +item.banner.small_stripes.magenta=Magenta Paly +item.banner.small_stripes.orange=Orange Paly +item.banner.small_stripes.white=White Paly + +item.banner.cross.black=Black Saltire +item.banner.cross.red=Red Saltire +item.banner.cross.green=Green Saltire +item.banner.cross.brown=Brown Saltire +item.banner.cross.blue=Blue Saltire +item.banner.cross.purple=Purple Saltire +item.banner.cross.cyan=Cyan Saltire +item.banner.cross.silver=Light Gray Saltire +item.banner.cross.gray=Gray Saltire +item.banner.cross.pink=Pink Saltire +item.banner.cross.lime=Lime Saltire +item.banner.cross.yellow=Yellow Saltire +item.banner.cross.lightBlue=Light Blue Saltire +item.banner.cross.magenta=Magenta Saltire +item.banner.cross.orange=Orange Saltire +item.banner.cross.white=White Saltire + +item.banner.triangle_bottom.black=Black Chevron +item.banner.triangle_bottom.red=Red Chevron +item.banner.triangle_bottom.green=Green Chevron +item.banner.triangle_bottom.brown=Brown Chevron +item.banner.triangle_bottom.blue=Blue Chevron +item.banner.triangle_bottom.purple=Purple Chevron +item.banner.triangle_bottom.cyan=Cyan Chevron +item.banner.triangle_bottom.silver=Light Gray Chevron +item.banner.triangle_bottom.gray=Gray Chevron +item.banner.triangle_bottom.pink=Pink Chevron +item.banner.triangle_bottom.lime=Lime Chevron +item.banner.triangle_bottom.yellow=Yellow Chevron +item.banner.triangle_bottom.lightBlue=Light Blue Chevron +item.banner.triangle_bottom.magenta=Magenta Chevron +item.banner.triangle_bottom.orange=Orange Chevron +item.banner.triangle_bottom.white=White Chevron + +item.banner.triangle_top.black=Black Inverted Chevron +item.banner.triangle_top.red=Red Inverted Chevron +item.banner.triangle_top.green=Green Inverted Chevron +item.banner.triangle_top.brown=Brown Inverted Chevron +item.banner.triangle_top.blue=Blue Inverted Chevron +item.banner.triangle_top.purple=Purple Inverted Chevron +item.banner.triangle_top.cyan=Cyan Inverted Chevron +item.banner.triangle_top.silver=Light Gray Inverted Chevron +item.banner.triangle_top.gray=Gray Inverted Chevron +item.banner.triangle_top.pink=Pink Inverted Chevron +item.banner.triangle_top.lime=Lime Inverted Chevron +item.banner.triangle_top.yellow=Yellow Inverted Chevron +item.banner.triangle_top.lightBlue=Light Blue Inverted Chevron +item.banner.triangle_top.magenta=Magenta Inverted Chevron +item.banner.triangle_top.orange=Orange Inverted Chevron +item.banner.triangle_top.white=White Inverted Chevron + +item.banner.triangles_bottom.black=Black Base Indented +item.banner.triangles_bottom.red=Red Base Indented +item.banner.triangles_bottom.green=Green Base Indented +item.banner.triangles_bottom.brown=Brown Base Indented +item.banner.triangles_bottom.blue=Blue Base Indented +item.banner.triangles_bottom.purple=Purple Base Indented +item.banner.triangles_bottom.cyan=Cyan Base Indented +item.banner.triangles_bottom.silver=Light Gray Base Indented +item.banner.triangles_bottom.gray=Gray Base Indented +item.banner.triangles_bottom.pink=Pink Base Indented +item.banner.triangles_bottom.lime=Lime Base Indented +item.banner.triangles_bottom.yellow=Yellow Base Indented +item.banner.triangles_bottom.lightBlue=Light Blue Base Indented +item.banner.triangles_bottom.magenta=Magenta Base Indented +item.banner.triangles_bottom.orange=Orange Base Indented +item.banner.triangles_bottom.white=White Base Indented + +item.banner.triangles_top.black=Black Chief Indented +item.banner.triangles_top.red=Red Chief Indented +item.banner.triangles_top.green=Green Chief Indented +item.banner.triangles_top.brown=Brown Chief Indented +item.banner.triangles_top.blue=Blue Chief Indented +item.banner.triangles_top.purple=Purple Chief Indented +item.banner.triangles_top.cyan=Cyan Chief Indented +item.banner.triangles_top.silver=Light Gray Chief Indented +item.banner.triangles_top.gray=Gray Chief Indented +item.banner.triangles_top.pink=Pink Chief Indented +item.banner.triangles_top.lime=Lime Chief Indented +item.banner.triangles_top.yellow=Yellow Chief Indented +item.banner.triangles_top.lightBlue=Light Blue Chief Indented +item.banner.triangles_top.magenta=Magenta Chief Indented +item.banner.triangles_top.orange=Orange Chief Indented +item.banner.triangles_top.white=White Chief Indented + +item.banner.diagonal_left.black=Black Per Bend Sinister +item.banner.diagonal_left.red=Red Per Bend Sinister +item.banner.diagonal_left.green=Green Per Bend Sinister +item.banner.diagonal_left.brown=Brown Per Bend Sinister +item.banner.diagonal_left.blue=Blue Per Bend Sinister +item.banner.diagonal_left.purple=Purple Per Bend Sinister +item.banner.diagonal_left.cyan=Cyan Per Bend Sinister +item.banner.diagonal_left.silver=Light Gray Per Bend Sinister +item.banner.diagonal_left.gray=Gray Per Bend Sinister +item.banner.diagonal_left.pink=Pink Per Bend Sinister +item.banner.diagonal_left.lime=Lime Per Bend Sinister +item.banner.diagonal_left.yellow=Yellow Per Bend Sinister +item.banner.diagonal_left.lightBlue=Light Blue Per Bend Sinister +item.banner.diagonal_left.magenta=Magenta Per Bend Sinister +item.banner.diagonal_left.orange=Orange Per Bend Sinister +item.banner.diagonal_left.white=White Per Bend Sinister + +item.banner.diagonal_right.black=Black Per Bend +item.banner.diagonal_right.red=Red Per Bend +item.banner.diagonal_right.green=Green Per Bend +item.banner.diagonal_right.brown=Brown Per Bend +item.banner.diagonal_right.blue=Blue Per Bend +item.banner.diagonal_right.purple=Purple Per Bend +item.banner.diagonal_right.cyan=Cyan Per Bend +item.banner.diagonal_right.silver=Light Gray Per Bend +item.banner.diagonal_right.gray=Gray Per Bend +item.banner.diagonal_right.pink=Pink Per Bend +item.banner.diagonal_right.lime=Lime Per Bend +item.banner.diagonal_right.yellow=Yellow Per Bend +item.banner.diagonal_right.lightBlue=Light Blue Per Bend +item.banner.diagonal_right.magenta=Magenta Per Bend +item.banner.diagonal_right.orange=Orange Per Bend +item.banner.diagonal_right.white=White Per Bend + +item.banner.diagonal_up_left.black=Black Per Bend Inverted +item.banner.diagonal_up_left.red=Red Per Bend Inverted +item.banner.diagonal_up_left.green=Green Per Bend Inverted +item.banner.diagonal_up_left.brown=Brown Per Bend Inverted +item.banner.diagonal_up_left.blue=Blue Per Bend Inverted +item.banner.diagonal_up_left.purple=Purple Per Bend Inverted +item.banner.diagonal_up_left.cyan=Cyan Per Bend Inverted +item.banner.diagonal_up_left.silver=Light Gray Per Bend Inverted +item.banner.diagonal_up_left.gray=Gray Per Bend Inverted +item.banner.diagonal_up_left.pink=Pink Per Bend Inverted +item.banner.diagonal_up_left.lime=Lime Per Bend Inverted +item.banner.diagonal_up_left.yellow=Yellow Per Bend Inverted +item.banner.diagonal_up_left.lightBlue=Light Blue Per Bend Inverted +item.banner.diagonal_up_left.magenta=Magenta Per Bend Inverted +item.banner.diagonal_up_left.orange=Orange Per Bend Inverted +item.banner.diagonal_up_left.white=White Per Bend Inverted + +item.banner.diagonal_up_right.black=Black Per Bend Sinister Inverted +item.banner.diagonal_up_right.red=Red Per Bend Sinister Inverted +item.banner.diagonal_up_right.green=Green Per Bend Sinister Inverted +item.banner.diagonal_up_right.brown=Brown Per Bend Sinister Inverted +item.banner.diagonal_up_right.blue=Blue Per Bend Sinister Inverted +item.banner.diagonal_up_right.purple=Purple Per Bend Sinister Inverted +item.banner.diagonal_up_right.cyan=Cyan Per Bend Sinister Inverted +item.banner.diagonal_up_right.silver=Light Gray Per Bend Sinister Inverted +item.banner.diagonal_up_right.gray=Gray Per Bend Sinister Inverted +item.banner.diagonal_up_right.pink=Pink Per Bend Sinister Inverted +item.banner.diagonal_up_right.lime=Lime Per Bend Sinister Inverted +item.banner.diagonal_up_right.yellow=Yellow Per Bend Sinister Inverted +item.banner.diagonal_up_right.lightBlue=Light Blue Per Bend Sinister Inverted +item.banner.diagonal_up_right.magenta=Magenta Per Bend Sinister Inverted +item.banner.diagonal_up_right.orange=Orange Per Bend Sinister Inverted +item.banner.diagonal_up_right.white=White Per Bend Sinister Inverted + +item.banner.circle.black=Black Roundel +item.banner.circle.red=Red Roundel +item.banner.circle.green=Green Roundel +item.banner.circle.brown=Brown Roundel +item.banner.circle.blue=Blue Roundel +item.banner.circle.purple=Purple Roundel +item.banner.circle.cyan=Cyan Roundel +item.banner.circle.silver=Light Gray Roundel +item.banner.circle.gray=Gray Roundel +item.banner.circle.pink=Pink Roundel +item.banner.circle.lime=Lime Roundel +item.banner.circle.yellow=Yellow Roundel +item.banner.circle.lightBlue=Light Blue Roundel +item.banner.circle.magenta=Magenta Roundel +item.banner.circle.orange=Orange Roundel +item.banner.circle.white=White Roundel + +item.banner.rhombus.black=Black Lozenge +item.banner.rhombus.red=Red Lozenge +item.banner.rhombus.green=Green Lozenge +item.banner.rhombus.brown=Brown Lozenge +item.banner.rhombus.blue=Blue Lozenge +item.banner.rhombus.purple=Purple Lozenge +item.banner.rhombus.cyan=Cyan Lozenge +item.banner.rhombus.silver=Light Gray Lozenge +item.banner.rhombus.gray=Gray Lozenge +item.banner.rhombus.pink=Pink Lozenge +item.banner.rhombus.lime=Lime Lozenge +item.banner.rhombus.yellow=Yellow Lozenge +item.banner.rhombus.lightBlue=Light Blue Lozenge +item.banner.rhombus.magenta=Magenta Lozenge +item.banner.rhombus.orange=Orange Lozenge +item.banner.rhombus.white=White Lozenge + +item.banner.half_vertical.black=Black Per Pale +item.banner.half_vertical.red=Red Per Pale +item.banner.half_vertical.green=Green Per Pale +item.banner.half_vertical.brown=Brown Per Pale +item.banner.half_vertical.blue=Blue Per Pale +item.banner.half_vertical.purple=Purple Per Pale +item.banner.half_vertical.cyan=Cyan Per Pale +item.banner.half_vertical.silver=Light Gray Per Pale +item.banner.half_vertical.gray=Gray Per Pale +item.banner.half_vertical.pink=Pink Per Pale +item.banner.half_vertical.lime=Lime Per Pale +item.banner.half_vertical.yellow=Yellow Per Pale +item.banner.half_vertical.lightBlue=Light Blue Per Pale +item.banner.half_vertical.magenta=Magenta Per Pale +item.banner.half_vertical.orange=Orange Per Pale +item.banner.half_vertical.white=White Per Pale + +item.banner.half_horizontal.black=Black Per Fess +item.banner.half_horizontal.red=Red Per Fess +item.banner.half_horizontal.green=Green Per Fess +item.banner.half_horizontal.brown=Brown Per Fess +item.banner.half_horizontal.blue=Blue Per Fess +item.banner.half_horizontal.purple=Purple Per Fess +item.banner.half_horizontal.cyan=Cyan Per Fess +item.banner.half_horizontal.silver=Light Gray Per Fess +item.banner.half_horizontal.gray=Gray Per Fess +item.banner.half_horizontal.pink=Pink Per Fess +item.banner.half_horizontal.lime=Lime Per Fess +item.banner.half_horizontal.yellow=Yellow Per Fess +item.banner.half_horizontal.lightBlue=Light Blue Per Fess +item.banner.half_horizontal.magenta=Magenta Per Fess +item.banner.half_horizontal.orange=Orange Per Fess +item.banner.half_horizontal.white=White Per Fess + +item.banner.half_vertical_right.black=Black Per Pale Inverted +item.banner.half_vertical_right.red=Red Per Pale Inverted +item.banner.half_vertical_right.green=Green Per Pale Inverted +item.banner.half_vertical_right.brown=Brown Per Pale Inverted +item.banner.half_vertical_right.blue=Blue Per Pale Inverted +item.banner.half_vertical_right.purple=Purple Per Pale Inverted +item.banner.half_vertical_right.cyan=Cyan Per Pale Inverted +item.banner.half_vertical_right.silver=Light Gray Per Pale Inverted +item.banner.half_vertical_right.gray=Gray Per Pale Inverted +item.banner.half_vertical_right.pink=Pink Per Pale Inverted +item.banner.half_vertical_right.lime=Lime Per Pale Inverted +item.banner.half_vertical_right.yellow=Yellow Per Pale Inverted +item.banner.half_vertical_right.lightBlue=Light Blue Per Pale Inverted +item.banner.half_vertical_right.magenta=Magenta Per Pale Inverted +item.banner.half_vertical_right.orange=Orange Per Pale Inverted +item.banner.half_vertical_right.white=White Per Pale Inverted + +item.banner.half_horizontal_bottom.black=Black Per Fess Inverted +item.banner.half_horizontal_bottom.red=Red Per Fess Inverted +item.banner.half_horizontal_bottom.green=Green Per Fess Inverted +item.banner.half_horizontal_bottom.brown=Brown Per Fess Inverted +item.banner.half_horizontal_bottom.blue=Blue Per Fess Inverted +item.banner.half_horizontal_bottom.purple=Purple Per Fess Inverted +item.banner.half_horizontal_bottom.cyan=Cyan Per Fess Inverted +item.banner.half_horizontal_bottom.silver=Light Gray Per Fess Inverted +item.banner.half_horizontal_bottom.gray=Gray Per Fess Inverted +item.banner.half_horizontal_bottom.pink=Pink Per Fess Inverted +item.banner.half_horizontal_bottom.lime=Lime Per Fess Inverted +item.banner.half_horizontal_bottom.yellow=Yellow Per Fess Inverted +item.banner.half_horizontal_bottom.lightBlue=Light Blue Per Fess Inverted +item.banner.half_horizontal_bottom.magenta=Magenta Per Fess Inverted +item.banner.half_horizontal_bottom.orange=Orange Per Fess Inverted +item.banner.half_horizontal_bottom.white=White Per Fess Inverted + +item.banner.creeper.black=Black Creeper Charge +item.banner.creeper.red=Red Creeper Charge +item.banner.creeper.green=Green Creeper Charge +item.banner.creeper.brown=Brown Creeper Charge +item.banner.creeper.blue=Blue Creeper Charge +item.banner.creeper.purple=Purple Creeper Charge +item.banner.creeper.cyan=Cyan Creeper Charge +item.banner.creeper.silver=Light Gray Creeper Charge +item.banner.creeper.gray=Gray Creeper Charge +item.banner.creeper.pink=Pink Creeper Charge +item.banner.creeper.lime=Lime Creeper Charge +item.banner.creeper.yellow=Yellow Creeper Charge +item.banner.creeper.lightBlue=Light Blue Creeper Charge +item.banner.creeper.magenta=Magenta Creeper Charge +item.banner.creeper.orange=Orange Creeper Charge +item.banner.creeper.white=White Creeper Charge + +item.banner.bricks.black=Black Field Masoned +item.banner.bricks.red=Red Field Masoned +item.banner.bricks.green=Green Field Masoned +item.banner.bricks.brown=Brown Field Masoned +item.banner.bricks.blue=Blue Field Masoned +item.banner.bricks.purple=Purple Field Masoned +item.banner.bricks.cyan=Cyan Field Masoned +item.banner.bricks.silver=Light Gray Field Masoned +item.banner.bricks.gray=Gray Field Masoned +item.banner.bricks.pink=Pink Field Masoned +item.banner.bricks.lime=Lime Field Masoned +item.banner.bricks.yellow=Yellow Field Masoned +item.banner.bricks.lightBlue=Light Blue Field Masoned +item.banner.bricks.magenta=Magenta Field Masoned +item.banner.bricks.orange=Orange Field Masoned +item.banner.bricks.white=White Field Masoned + +item.banner.gradient.black=Black Gradient +item.banner.gradient.red=Red Gradient +item.banner.gradient.green=Green Gradient +item.banner.gradient.brown=Brown Gradient +item.banner.gradient.blue=Blue Gradient +item.banner.gradient.purple=Purple Gradient +item.banner.gradient.cyan=Cyan Gradient +item.banner.gradient.silver=Light Gray Gradient +item.banner.gradient.gray=Gray Gradient +item.banner.gradient.pink=Pink Gradient +item.banner.gradient.lime=Lime Gradient +item.banner.gradient.yellow=Yellow Gradient +item.banner.gradient.lightBlue=Light Blue Gradient +item.banner.gradient.magenta=Magenta Gradient +item.banner.gradient.orange=Orange Gradient +item.banner.gradient.white=White Gradient + +item.banner.gradient_up.black=Black Base Gradient +item.banner.gradient_up.red=Red Base Gradient +item.banner.gradient_up.green=Green Base Gradient +item.banner.gradient_up.brown=Brown Base Gradient +item.banner.gradient_up.blue=Blue Base Gradient +item.banner.gradient_up.purple=Purple Base Gradient +item.banner.gradient_up.cyan=Cyan Base Gradient +item.banner.gradient_up.silver=Light Gray Base Gradient +item.banner.gradient_up.gray=Gray Base Gradient +item.banner.gradient_up.pink=Pink Base Gradient +item.banner.gradient_up.lime=Lime Base Gradient +item.banner.gradient_up.yellow=Yellow Base Gradient +item.banner.gradient_up.lightBlue=Light Blue Base Gradient +item.banner.gradient_up.magenta=Magenta Base Gradient +item.banner.gradient_up.orange=Orange Base Gradient +item.banner.gradient_up.white=White Base Gradient + +item.banner.skull.black=Black Skull Charge +item.banner.skull.red=Red Skull Charge +item.banner.skull.green=Green Skull Charge +item.banner.skull.brown=Brown Skull Charge +item.banner.skull.blue=Blue Skull Charge +item.banner.skull.purple=Purple Skull Charge +item.banner.skull.cyan=Cyan Skull Charge +item.banner.skull.silver=Light Gray Skull Charge +item.banner.skull.gray=Gray Skull Charge +item.banner.skull.pink=Pink Skull Charge +item.banner.skull.lime=Lime Skull Charge +item.banner.skull.yellow=Yellow Skull Charge +item.banner.skull.lightBlue=Light Blue Skull Charge +item.banner.skull.magenta=Magenta Skull Charge +item.banner.skull.orange=Orange Skull Charge +item.banner.skull.white=White Skull Charge + +item.banner.flower.black=Black Flower Charge +item.banner.flower.red=Red Flower Charge +item.banner.flower.green=Green Flower Charge +item.banner.flower.brown=Brown Flower Charge +item.banner.flower.blue=Blue Flower Charge +item.banner.flower.purple=Purple Flower Charge +item.banner.flower.cyan=Cyan Flower Charge +item.banner.flower.silver=Light Gray Flower Charge +item.banner.flower.gray=Gray Flower Charge +item.banner.flower.pink=Pink Flower Charge +item.banner.flower.lime=Lime Flower Charge +item.banner.flower.yellow=Yellow Flower Charge +item.banner.flower.lightBlue=Light Blue Flower Charge +item.banner.flower.magenta=Magenta Flower Charge +item.banner.flower.orange=Orange Flower Charge +item.banner.flower.white=White Flower Charge + +item.banner.border.black=Black Bordure +item.banner.border.red=Red Bordure +item.banner.border.green=Green Bordure +item.banner.border.brown=Brown Bordure +item.banner.border.blue=Blue Bordure +item.banner.border.purple=Purple Bordure +item.banner.border.cyan=Cyan Bordure +item.banner.border.silver=Light Gray Bordure +item.banner.border.gray=Gray Bordure +item.banner.border.pink=Pink Bordure +item.banner.border.lime=Lime Bordure +item.banner.border.yellow=Yellow Bordure +item.banner.border.lightBlue=Light Blue Bordure +item.banner.border.magenta=Magenta Bordure +item.banner.border.orange=Orange Bordure +item.banner.border.white=White Bordure + +item.banner.curly_border.black=Black Bordure Indented +item.banner.curly_border.red=Red Bordure Indented +item.banner.curly_border.green=Green Bordure Indented +item.banner.curly_border.brown=Brown Bordure Indented +item.banner.curly_border.blue=Blue Bordure Indented +item.banner.curly_border.purple=Purple Bordure Indented +item.banner.curly_border.cyan=Cyan Bordure Indented +item.banner.curly_border.silver=Light Gray Bordure Indented +item.banner.curly_border.gray=Gray Bordure Indented +item.banner.curly_border.pink=Pink Bordure Indented +item.banner.curly_border.lime=Lime Bordure Indented +item.banner.curly_border.yellow=Yellow Bordure Indented +item.banner.curly_border.lightBlue=Light Blue Bordure Indented +item.banner.curly_border.magenta=Magenta Bordure Indented +item.banner.curly_border.orange=Orange Bordure Indented +item.banner.curly_border.white=White Bordure Indented + +item.banner.mojang.black=Black Thing +item.banner.mojang.red=Red Thing +item.banner.mojang.green=Green Thing +item.banner.mojang.brown=Brown Thing +item.banner.mojang.blue=Blue Thing +item.banner.mojang.purple=Purple Thing +item.banner.mojang.cyan=Cyan Thing +item.banner.mojang.silver=Light Gray Thing +item.banner.mojang.gray=Gray Thing +item.banner.mojang.pink=Pink Thing +item.banner.mojang.lime=Lime Thing +item.banner.mojang.yellow=Yellow Thing +item.banner.mojang.lightBlue=Light Blue Thing +item.banner.mojang.magenta=Magenta Thing +item.banner.mojang.orange=Orange Thing +item.banner.mojang.white=White Thing + +item.banner.straight_cross.black=Black Cross +item.banner.straight_cross.red=Red Cross +item.banner.straight_cross.green=Green Cross +item.banner.straight_cross.brown=Brown Cross +item.banner.straight_cross.blue=Blue Cross +item.banner.straight_cross.purple=Purple Cross +item.banner.straight_cross.cyan=Cyan Cross +item.banner.straight_cross.silver=Light Gray Cross +item.banner.straight_cross.gray=Gray Cross +item.banner.straight_cross.pink=Pink Cross +item.banner.straight_cross.lime=Lime Cross +item.banner.straight_cross.yellow=Yellow Cross +item.banner.straight_cross.lightBlue=Light Blue Cross +item.banner.straight_cross.magenta=Magenta Cross +item.banner.straight_cross.orange=Orange Cross +item.banner.straight_cross.white=White Cross diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0.png new file mode 100644 index 0000000..acadb01 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/0.png new file mode 100644 index 0000000..482314c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/1.png new file mode 100644 index 0000000..e2a575c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/10.png new file mode 100644 index 0000000..aa7bea6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/11.png new file mode 100644 index 0000000..74f57a3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/16.png new file mode 100644 index 0000000..d8bf7d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/17.png new file mode 100644 index 0000000..0f82cfc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/18.png new file mode 100644 index 0000000..19290f4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/19.png new file mode 100644 index 0000000..ed7f623 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/2.png new file mode 100644 index 0000000..fb205fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/20.png new file mode 100644 index 0000000..4ddd184 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/21.png new file mode 100644 index 0000000..c033321 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/22.png new file mode 100644 index 0000000..551d863 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/23.png new file mode 100644 index 0000000..b51bed4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/24.png new file mode 100644 index 0000000..52ee206 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/25.png new file mode 100644 index 0000000..cc5fd49 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/26.png new file mode 100644 index 0000000..443b5b9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/27.png new file mode 100644 index 0000000..b7e1e8b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/3.png new file mode 100644 index 0000000..ab11024 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/32.png new file mode 100644 index 0000000..8a89dbb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/33.png new file mode 100644 index 0000000..f426e72 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/34.png new file mode 100644 index 0000000..8d51784 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/35.png new file mode 100644 index 0000000..201decc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/36.png new file mode 100644 index 0000000..97341db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/37.png new file mode 100644 index 0000000..0c091e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/38.png new file mode 100644 index 0000000..19589ae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/39.png new file mode 100644 index 0000000..3f24f73 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/4.png new file mode 100644 index 0000000..89313f3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/40.png new file mode 100644 index 0000000..684b05b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/41.png new file mode 100644 index 0000000..68935ec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/42.png new file mode 100644 index 0000000..02146e6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/43.png new file mode 100644 index 0000000..eb033a0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/48.png new file mode 100644 index 0000000..b9f9e15 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/49.png new file mode 100644 index 0000000..d8d43f3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/5.png new file mode 100644 index 0000000..dc8a5a2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/50.png new file mode 100644 index 0000000..34dfd51 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/51.png new file mode 100644 index 0000000..adce730 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/52.png new file mode 100644 index 0000000..b2642ee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/53.png new file mode 100644 index 0000000..b986b35 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/54.png new file mode 100644 index 0000000..51d3ace Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/55.png new file mode 100644 index 0000000..44c38f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/56.png new file mode 100644 index 0000000..8323d93 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/57.png new file mode 100644 index 0000000..5a8a105 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/58.png new file mode 100644 index 0000000..8581ae8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/6.png new file mode 100644 index 0000000..80d0dba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/7.png new file mode 100644 index 0000000..128f2ce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/8.png new file mode 100644 index 0000000..05db2b1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/9.png new file mode 100644 index 0000000..9f12d4f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_pane_white.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_pane_white.properties new file mode 100644 index 0000000..bd738f4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_pane_white.properties @@ -0,0 +1,7 @@ +# Stained glass white +matchBlocks=160 +metadata=0 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_white.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_white.properties new file mode 100644 index 0000000..d762a6d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_white.properties @@ -0,0 +1,6 @@ +# Stained glass white +matchBlocks=95 +metadata=0 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1.png new file mode 100644 index 0000000..291d775 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10.png new file mode 100644 index 0000000..602786b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/0.png new file mode 100644 index 0000000..fcae3d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/1.png new file mode 100644 index 0000000..c6388c7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/10.png new file mode 100644 index 0000000..025cc5d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/11.png new file mode 100644 index 0000000..63222ea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/16.png new file mode 100644 index 0000000..71a93f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/17.png new file mode 100644 index 0000000..453b868 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/18.png new file mode 100644 index 0000000..c88f7b7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/19.png new file mode 100644 index 0000000..41de663 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/2.png new file mode 100644 index 0000000..3f58b21 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/20.png new file mode 100644 index 0000000..52c0ada Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/21.png new file mode 100644 index 0000000..623d894 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/22.png new file mode 100644 index 0000000..2b1cbaa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/23.png new file mode 100644 index 0000000..9cffa1b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/24.png new file mode 100644 index 0000000..bc6aa71 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/25.png new file mode 100644 index 0000000..eaef4e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/26.png new file mode 100644 index 0000000..f4633b2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/27.png new file mode 100644 index 0000000..85f4fea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/3.png new file mode 100644 index 0000000..6a12c18 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/32.png new file mode 100644 index 0000000..6161cf2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/33.png new file mode 100644 index 0000000..e17b7b3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/34.png new file mode 100644 index 0000000..99d1a53 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/35.png new file mode 100644 index 0000000..3543bc4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/36.png new file mode 100644 index 0000000..35986d9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/37.png new file mode 100644 index 0000000..f328c50 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/38.png new file mode 100644 index 0000000..219ab34 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/39.png new file mode 100644 index 0000000..5b7580a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/4.png new file mode 100644 index 0000000..4e202ca Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/40.png new file mode 100644 index 0000000..811321b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/41.png new file mode 100644 index 0000000..6f0e33f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/42.png new file mode 100644 index 0000000..1f6854a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/43.png new file mode 100644 index 0000000..f0a1fcc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/48.png new file mode 100644 index 0000000..9561168 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/49.png new file mode 100644 index 0000000..a32e9ae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/5.png new file mode 100644 index 0000000..35ae121 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/50.png new file mode 100644 index 0000000..532325c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/51.png new file mode 100644 index 0000000..f900cfa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/52.png new file mode 100644 index 0000000..b0de565 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/53.png new file mode 100644 index 0000000..3764a55 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/54.png new file mode 100644 index 0000000..5ab97a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/55.png new file mode 100644 index 0000000..ba3bc7c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/56.png new file mode 100644 index 0000000..5500739 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/57.png new file mode 100644 index 0000000..ff82291 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/58.png new file mode 100644 index 0000000..e8389d7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/6.png new file mode 100644 index 0000000..b81516b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/7.png new file mode 100644 index 0000000..0efca44 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/8.png new file mode 100644 index 0000000..fa3ab6b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/9.png new file mode 100644 index 0000000..b2d3050 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_pane_purple.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_pane_purple.properties new file mode 100644 index 0000000..59d80f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_pane_purple.properties @@ -0,0 +1,7 @@ +# Stained glass purple +matchBlocks=160 +metadata=10 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_purple.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_purple.properties new file mode 100644 index 0000000..27d4480 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_purple.properties @@ -0,0 +1,6 @@ +# Stained glass purple +matchBlocks=95 +metadata=10 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11.png new file mode 100644 index 0000000..a179881 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/0.png new file mode 100644 index 0000000..38885de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/1.png new file mode 100644 index 0000000..78b8685 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/10.png new file mode 100644 index 0000000..f111abb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/11.png new file mode 100644 index 0000000..1682741 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/16.png new file mode 100644 index 0000000..b69e09e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/17.png new file mode 100644 index 0000000..696d771 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/18.png new file mode 100644 index 0000000..39676be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/19.png new file mode 100644 index 0000000..dfa2b62 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/2.png new file mode 100644 index 0000000..85232a5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/20.png new file mode 100644 index 0000000..4ffc019 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/21.png new file mode 100644 index 0000000..58eb303 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/22.png new file mode 100644 index 0000000..5f88c04 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/23.png new file mode 100644 index 0000000..c52be72 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/24.png new file mode 100644 index 0000000..c60f717 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/25.png new file mode 100644 index 0000000..1f2b02c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/26.png new file mode 100644 index 0000000..e67b915 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/27.png new file mode 100644 index 0000000..e496c97 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/3.png new file mode 100644 index 0000000..274c3d4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/32.png new file mode 100644 index 0000000..28aef71 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/33.png new file mode 100644 index 0000000..aa469a2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/34.png new file mode 100644 index 0000000..b9e05b2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/35.png new file mode 100644 index 0000000..2e81675 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/36.png new file mode 100644 index 0000000..95efd6a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/37.png new file mode 100644 index 0000000..8052ce7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/38.png new file mode 100644 index 0000000..b022639 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/39.png new file mode 100644 index 0000000..9a6bf54 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/4.png new file mode 100644 index 0000000..c0a62e1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/40.png new file mode 100644 index 0000000..ad63f29 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/41.png new file mode 100644 index 0000000..efb34d8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/42.png new file mode 100644 index 0000000..d6a19d5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/43.png new file mode 100644 index 0000000..a6cf4c9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/48.png new file mode 100644 index 0000000..3fcc4b5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/49.png new file mode 100644 index 0000000..8f7ee1d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/5.png new file mode 100644 index 0000000..3882007 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/50.png new file mode 100644 index 0000000..6383a5e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/51.png new file mode 100644 index 0000000..5bbff6e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/52.png new file mode 100644 index 0000000..cc9ba7e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/53.png new file mode 100644 index 0000000..7752599 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/54.png new file mode 100644 index 0000000..fe34801 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/55.png new file mode 100644 index 0000000..cb2fce7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/56.png new file mode 100644 index 0000000..7e6c682 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/57.png new file mode 100644 index 0000000..3d261ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/58.png new file mode 100644 index 0000000..17de9bc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/6.png new file mode 100644 index 0000000..66f6fc8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/7.png new file mode 100644 index 0000000..70eaea5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/8.png new file mode 100644 index 0000000..4c13eea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/9.png new file mode 100644 index 0000000..16a4c83 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_blue.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_blue.properties new file mode 100644 index 0000000..b9441ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_blue.properties @@ -0,0 +1,6 @@ +# Stained glass blue +matchBlocks=95 +metadata=11 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_pane_blue.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_pane_blue.properties new file mode 100644 index 0000000..61c68c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_pane_blue.properties @@ -0,0 +1,7 @@ +# Stained glass blue +matchBlocks=160 +metadata=11 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12.png new file mode 100644 index 0000000..93a1003 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/0.png new file mode 100644 index 0000000..259b61c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/1.png new file mode 100644 index 0000000..2268ce6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/10.png new file mode 100644 index 0000000..7ac2776 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/11.png new file mode 100644 index 0000000..6dcaeac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/16.png new file mode 100644 index 0000000..d1d3741 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/17.png new file mode 100644 index 0000000..b94809b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/18.png new file mode 100644 index 0000000..5459fac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/19.png new file mode 100644 index 0000000..afb4bc8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/2.png new file mode 100644 index 0000000..c07848c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/20.png new file mode 100644 index 0000000..2f381e2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/21.png new file mode 100644 index 0000000..abaa5cd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/22.png new file mode 100644 index 0000000..666c8e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/23.png new file mode 100644 index 0000000..2447f12 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/24.png new file mode 100644 index 0000000..b017b2e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/25.png new file mode 100644 index 0000000..acaaf58 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/26.png new file mode 100644 index 0000000..70ec772 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/27.png new file mode 100644 index 0000000..c5e69d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/3.png new file mode 100644 index 0000000..b7f2e56 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/32.png new file mode 100644 index 0000000..e175b98 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/33.png new file mode 100644 index 0000000..799c6a1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/34.png new file mode 100644 index 0000000..ff9667f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/35.png new file mode 100644 index 0000000..f890940 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/36.png new file mode 100644 index 0000000..26d3a7a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/37.png new file mode 100644 index 0000000..5e2cd71 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/38.png new file mode 100644 index 0000000..ee987d8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/39.png new file mode 100644 index 0000000..940b86c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/4.png new file mode 100644 index 0000000..167feab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/40.png new file mode 100644 index 0000000..4610850 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/41.png new file mode 100644 index 0000000..e87f9cb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/42.png new file mode 100644 index 0000000..a007319 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/43.png new file mode 100644 index 0000000..62a6c95 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/48.png new file mode 100644 index 0000000..3003b36 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/49.png new file mode 100644 index 0000000..0c87b12 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/5.png new file mode 100644 index 0000000..363d09b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/50.png new file mode 100644 index 0000000..bff4e7a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/51.png new file mode 100644 index 0000000..85f2aba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/52.png new file mode 100644 index 0000000..1422a56 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/53.png new file mode 100644 index 0000000..4a08413 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/54.png new file mode 100644 index 0000000..43bcdb8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/55.png new file mode 100644 index 0000000..21487fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/56.png new file mode 100644 index 0000000..aaece81 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/57.png new file mode 100644 index 0000000..d4ba78d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/58.png new file mode 100644 index 0000000..746ae6a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/6.png new file mode 100644 index 0000000..ac145b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/7.png new file mode 100644 index 0000000..b9ad6b6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/8.png new file mode 100644 index 0000000..f9febbc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/9.png new file mode 100644 index 0000000..1a00286 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_brown.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_brown.properties new file mode 100644 index 0000000..0b33e3c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_brown.properties @@ -0,0 +1,6 @@ +# Stained glass brown +matchBlocks=95 +metadata=12 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_pane_brown.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_pane_brown.properties new file mode 100644 index 0000000..8da13ce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_pane_brown.properties @@ -0,0 +1,7 @@ +# Stained glass brown +matchBlocks=160 +metadata=12 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13.png new file mode 100644 index 0000000..d7f8277 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/0.png new file mode 100644 index 0000000..7c1f4e6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/1.png new file mode 100644 index 0000000..2040368 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/10.png new file mode 100644 index 0000000..3c9fdef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/11.png new file mode 100644 index 0000000..4bfcc6d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/16.png new file mode 100644 index 0000000..edc28eb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/17.png new file mode 100644 index 0000000..3b29a9e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/18.png new file mode 100644 index 0000000..f9513cb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/19.png new file mode 100644 index 0000000..83d1cd4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/2.png new file mode 100644 index 0000000..62f1d66 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/20.png new file mode 100644 index 0000000..f5d223a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/21.png new file mode 100644 index 0000000..001eba0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/22.png new file mode 100644 index 0000000..b1e8274 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/23.png new file mode 100644 index 0000000..a4d6cc3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/24.png new file mode 100644 index 0000000..d470857 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/25.png new file mode 100644 index 0000000..1c52d05 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/26.png new file mode 100644 index 0000000..e1a22b6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/27.png new file mode 100644 index 0000000..92eddbc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/3.png new file mode 100644 index 0000000..9efad31 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/32.png new file mode 100644 index 0000000..2d4ab46 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/33.png new file mode 100644 index 0000000..8d28289 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/34.png new file mode 100644 index 0000000..b2aa6f9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/35.png new file mode 100644 index 0000000..120a9bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/36.png new file mode 100644 index 0000000..19ca5f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/37.png new file mode 100644 index 0000000..8a8c17e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/38.png new file mode 100644 index 0000000..8e6f98a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/39.png new file mode 100644 index 0000000..cb61692 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/4.png new file mode 100644 index 0000000..f3003ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/40.png new file mode 100644 index 0000000..ccb2dc6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/41.png new file mode 100644 index 0000000..6373bf1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/42.png new file mode 100644 index 0000000..ccebff1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/43.png new file mode 100644 index 0000000..ae5e948 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/48.png new file mode 100644 index 0000000..a818c9f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/49.png new file mode 100644 index 0000000..7705c14 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/5.png new file mode 100644 index 0000000..c637517 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/50.png new file mode 100644 index 0000000..2c3c4b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/51.png new file mode 100644 index 0000000..ec24732 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/52.png new file mode 100644 index 0000000..dd1ae3b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/53.png new file mode 100644 index 0000000..50f722c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/54.png new file mode 100644 index 0000000..8cc645a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/55.png new file mode 100644 index 0000000..3a8aa9b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/56.png new file mode 100644 index 0000000..8298ffd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/57.png new file mode 100644 index 0000000..f81edbc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/58.png new file mode 100644 index 0000000..a3ff7e6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/6.png new file mode 100644 index 0000000..89bf889 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/7.png new file mode 100644 index 0000000..7d264a9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/8.png new file mode 100644 index 0000000..9a9725f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/9.png new file mode 100644 index 0000000..9645de2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_green.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_green.properties new file mode 100644 index 0000000..0e2e5b3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_green.properties @@ -0,0 +1,6 @@ +# Stained glass green +matchBlocks=95 +metadata=13 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_pane_green.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_pane_green.properties new file mode 100644 index 0000000..4082f19 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_pane_green.properties @@ -0,0 +1,7 @@ +# Stained glass green +matchBlocks=160 +metadata=13 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14.png new file mode 100644 index 0000000..ea6408b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/0.png new file mode 100644 index 0000000..db4c5eb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/1.png new file mode 100644 index 0000000..3e8c769 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/10.png new file mode 100644 index 0000000..247b815 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/11.png new file mode 100644 index 0000000..e4497bf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/16.png new file mode 100644 index 0000000..3d567be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/17.png new file mode 100644 index 0000000..b593cb8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/18.png new file mode 100644 index 0000000..42924ab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/19.png new file mode 100644 index 0000000..db7d4e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/2.png new file mode 100644 index 0000000..72f461b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/20.png new file mode 100644 index 0000000..619b2e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/21.png new file mode 100644 index 0000000..363c81e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/22.png new file mode 100644 index 0000000..e60f627 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/23.png new file mode 100644 index 0000000..f439b47 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/24.png new file mode 100644 index 0000000..b62e65b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/25.png new file mode 100644 index 0000000..ae1c143 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/26.png new file mode 100644 index 0000000..cc952b3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/27.png new file mode 100644 index 0000000..32ad0f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/3.png new file mode 100644 index 0000000..69b8bb3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/32.png new file mode 100644 index 0000000..6f31642 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/33.png new file mode 100644 index 0000000..3bae303 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/34.png new file mode 100644 index 0000000..074a527 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/35.png new file mode 100644 index 0000000..336f054 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/36.png new file mode 100644 index 0000000..6aea777 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/37.png new file mode 100644 index 0000000..382bf64 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/38.png new file mode 100644 index 0000000..88faee4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/39.png new file mode 100644 index 0000000..c452b15 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/4.png new file mode 100644 index 0000000..de22d1e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/40.png new file mode 100644 index 0000000..da6f876 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/41.png new file mode 100644 index 0000000..a25b3af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/42.png new file mode 100644 index 0000000..c437e2c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/43.png new file mode 100644 index 0000000..dbff65d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/48.png new file mode 100644 index 0000000..c2aa088 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/49.png new file mode 100644 index 0000000..64f2e3c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/5.png new file mode 100644 index 0000000..64c2d64 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/50.png new file mode 100644 index 0000000..3903aab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/51.png new file mode 100644 index 0000000..5491189 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/52.png new file mode 100644 index 0000000..61a217d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/53.png new file mode 100644 index 0000000..de9db5e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/54.png new file mode 100644 index 0000000..3c3f5bb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/55.png new file mode 100644 index 0000000..b221b3d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/56.png new file mode 100644 index 0000000..b4799e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/57.png new file mode 100644 index 0000000..c0b5370 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/58.png new file mode 100644 index 0000000..fec4f8f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/6.png new file mode 100644 index 0000000..3d59656 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/7.png new file mode 100644 index 0000000..c83cac5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/8.png new file mode 100644 index 0000000..59e1bc3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/9.png new file mode 100644 index 0000000..eecb4a7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_pane_red.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_pane_red.properties new file mode 100644 index 0000000..b488d99 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_pane_red.properties @@ -0,0 +1,7 @@ +# Stained glass red +matchBlocks=160 +metadata=14 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_red.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_red.properties new file mode 100644 index 0000000..cf43547 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_red.properties @@ -0,0 +1,6 @@ +# Stained glass red +matchBlocks=95 +metadata=14 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15.png new file mode 100644 index 0000000..4c87f0f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/0.png new file mode 100644 index 0000000..06f3427 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/1.png new file mode 100644 index 0000000..7e63ee7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/10.png new file mode 100644 index 0000000..9142b6f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/11.png new file mode 100644 index 0000000..f031f1c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/16.png new file mode 100644 index 0000000..273dc8c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/17.png new file mode 100644 index 0000000..0c36799 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/18.png new file mode 100644 index 0000000..6275d95 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/19.png new file mode 100644 index 0000000..8ba895b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/2.png new file mode 100644 index 0000000..32c6872 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/20.png new file mode 100644 index 0000000..bc2543e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/21.png new file mode 100644 index 0000000..2f7fe8e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/22.png new file mode 100644 index 0000000..0d5f9f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/23.png new file mode 100644 index 0000000..3aa27e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/24.png new file mode 100644 index 0000000..f0ded67 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/25.png new file mode 100644 index 0000000..dbb6121 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/26.png new file mode 100644 index 0000000..69bfbc0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/27.png new file mode 100644 index 0000000..07f46ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/3.png new file mode 100644 index 0000000..011ca1e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/32.png new file mode 100644 index 0000000..5512cbb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/33.png new file mode 100644 index 0000000..239fd78 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/34.png new file mode 100644 index 0000000..defc068 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/35.png new file mode 100644 index 0000000..73dd6df Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/36.png new file mode 100644 index 0000000..8185b75 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/37.png new file mode 100644 index 0000000..f55e960 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/38.png new file mode 100644 index 0000000..6a12574 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/39.png new file mode 100644 index 0000000..f7dadbb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/4.png new file mode 100644 index 0000000..21e9e9e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/40.png new file mode 100644 index 0000000..a0f9b0a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/41.png new file mode 100644 index 0000000..a191e23 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/42.png new file mode 100644 index 0000000..d12d6b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/43.png new file mode 100644 index 0000000..8d55d97 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/48.png new file mode 100644 index 0000000..bf8fe4a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/49.png new file mode 100644 index 0000000..833a3e2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/5.png new file mode 100644 index 0000000..0b09c25 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/50.png new file mode 100644 index 0000000..5814d06 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/51.png new file mode 100644 index 0000000..c2decd5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/52.png new file mode 100644 index 0000000..b87f6e4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/53.png new file mode 100644 index 0000000..99fd221 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/54.png new file mode 100644 index 0000000..7b5e630 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/55.png new file mode 100644 index 0000000..10be40b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/56.png new file mode 100644 index 0000000..96c8041 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/57.png new file mode 100644 index 0000000..5d2638a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/58.png new file mode 100644 index 0000000..9360f4a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/6.png new file mode 100644 index 0000000..143555f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/7.png new file mode 100644 index 0000000..443fa69 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/8.png new file mode 100644 index 0000000..6888680 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/9.png new file mode 100644 index 0000000..41b217d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_black.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_black.properties new file mode 100644 index 0000000..4566909 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_black.properties @@ -0,0 +1,6 @@ +# Stained glass black +matchBlocks=95 +metadata=15 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_pane_black.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_pane_black.properties new file mode 100644 index 0000000..97e092d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_pane_black.properties @@ -0,0 +1,7 @@ +# Stained glass black +matchBlocks=160 +metadata=15 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/16.png new file mode 100644 index 0000000..316522f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/17.png new file mode 100644 index 0000000..b3c3165 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/18.png new file mode 100644 index 0000000..70de401 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/19.png new file mode 100644 index 0000000..c8704a1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/0.png new file mode 100644 index 0000000..3a29e31 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/1.png new file mode 100644 index 0000000..ac20892 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/10.png new file mode 100644 index 0000000..5107903 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/11.png new file mode 100644 index 0000000..76a4ecb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/16.png new file mode 100644 index 0000000..34b4e01 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/17.png new file mode 100644 index 0000000..d5ba7a0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/18.png new file mode 100644 index 0000000..31ea8b5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/19.png new file mode 100644 index 0000000..3fa6a20 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/2.png new file mode 100644 index 0000000..da2c361 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/20.png new file mode 100644 index 0000000..2eb2915 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/21.png new file mode 100644 index 0000000..09652b3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/22.png new file mode 100644 index 0000000..92e199c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/23.png new file mode 100644 index 0000000..9068d19 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/24.png new file mode 100644 index 0000000..f07d979 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/25.png new file mode 100644 index 0000000..520102c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/26.png new file mode 100644 index 0000000..be490ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/27.png new file mode 100644 index 0000000..3eac57f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/3.png new file mode 100644 index 0000000..0cb6300 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/32.png new file mode 100644 index 0000000..38fe9f4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/33.png new file mode 100644 index 0000000..ad6398d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/34.png new file mode 100644 index 0000000..53d76db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/35.png new file mode 100644 index 0000000..c7adaab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/36.png new file mode 100644 index 0000000..de55e7b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/37.png new file mode 100644 index 0000000..1202c0d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/38.png new file mode 100644 index 0000000..8977b0f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/39.png new file mode 100644 index 0000000..c091f83 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/4.png new file mode 100644 index 0000000..595ce65 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/40.png new file mode 100644 index 0000000..f51e589 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/41.png new file mode 100644 index 0000000..663b197 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/42.png new file mode 100644 index 0000000..f6a65d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/43.png new file mode 100644 index 0000000..4b6a0d5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/48.png new file mode 100644 index 0000000..4e6c92a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/49.png new file mode 100644 index 0000000..1a5751d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/5.png new file mode 100644 index 0000000..c9353d4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/50.png new file mode 100644 index 0000000..b73c34f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/51.png new file mode 100644 index 0000000..ab60c8e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/52.png new file mode 100644 index 0000000..282c59d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/53.png new file mode 100644 index 0000000..3df68a2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/54.png new file mode 100644 index 0000000..36a6ae1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/55.png new file mode 100644 index 0000000..73ff42d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/56.png new file mode 100644 index 0000000..4bc7b52 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/57.png new file mode 100644 index 0000000..3df9c2a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/58.png new file mode 100644 index 0000000..067054d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/6.png new file mode 100644 index 0000000..f310397 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/7.png new file mode 100644 index 0000000..6d06d7b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/8.png new file mode 100644 index 0000000..ac561ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/9.png new file mode 100644 index 0000000..42034d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_orange.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_orange.properties new file mode 100644 index 0000000..41553be --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_orange.properties @@ -0,0 +1,6 @@ +# Stained glass orange +matchBlocks=95 +metadata=1 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_pane_orange.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_pane_orange.properties new file mode 100644 index 0000000..84b6f02 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_pane_orange.properties @@ -0,0 +1,7 @@ +# Stained glass orange +matchBlocks=160 +metadata=1 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2.png new file mode 100644 index 0000000..dc088c6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/20.png new file mode 100644 index 0000000..8b54006 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/21.png new file mode 100644 index 0000000..193abdc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/22.png new file mode 100644 index 0000000..13940d4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/23.png new file mode 100644 index 0000000..a64d95f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/24.png new file mode 100644 index 0000000..0291a2e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/25.png new file mode 100644 index 0000000..ea459b6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/26.png new file mode 100644 index 0000000..683cfe1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/27.png new file mode 100644 index 0000000..45a0af6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/0.png new file mode 100644 index 0000000..5cd9945 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/1.png new file mode 100644 index 0000000..73799d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/10.png new file mode 100644 index 0000000..f307b82 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/11.png new file mode 100644 index 0000000..612745d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/16.png new file mode 100644 index 0000000..5eaccfc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/17.png new file mode 100644 index 0000000..1e206b4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/18.png new file mode 100644 index 0000000..30e55de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/19.png new file mode 100644 index 0000000..7fa751c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/2.png new file mode 100644 index 0000000..dd37796 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/20.png new file mode 100644 index 0000000..145d9a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/21.png new file mode 100644 index 0000000..a389d82 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/22.png new file mode 100644 index 0000000..e1379a8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/23.png new file mode 100644 index 0000000..b9ba5b9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/24.png new file mode 100644 index 0000000..c80687a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/25.png new file mode 100644 index 0000000..39f403c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/26.png new file mode 100644 index 0000000..638b3da Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/27.png new file mode 100644 index 0000000..e88b2e6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/3.png new file mode 100644 index 0000000..12f1aa9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/32.png new file mode 100644 index 0000000..e4621f3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/33.png new file mode 100644 index 0000000..a64a170 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/34.png new file mode 100644 index 0000000..e642e14 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/35.png new file mode 100644 index 0000000..7ee2dba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/36.png new file mode 100644 index 0000000..c7e553e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/37.png new file mode 100644 index 0000000..5d91ebf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/38.png new file mode 100644 index 0000000..3a167e8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/39.png new file mode 100644 index 0000000..19fe7f1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/4.png new file mode 100644 index 0000000..b1ff09c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/40.png new file mode 100644 index 0000000..999f9c7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/41.png new file mode 100644 index 0000000..27a39e1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/42.png new file mode 100644 index 0000000..495859f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/43.png new file mode 100644 index 0000000..0de323b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/48.png new file mode 100644 index 0000000..c0cda90 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/49.png new file mode 100644 index 0000000..0acb361 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/5.png new file mode 100644 index 0000000..5f09b94 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/50.png new file mode 100644 index 0000000..8e138e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/51.png new file mode 100644 index 0000000..1b0d1ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/52.png new file mode 100644 index 0000000..3bc00be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/53.png new file mode 100644 index 0000000..f81704e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/54.png new file mode 100644 index 0000000..5520a91 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/55.png new file mode 100644 index 0000000..d83d0da Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/56.png new file mode 100644 index 0000000..3b2f2d6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/57.png new file mode 100644 index 0000000..492142e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/58.png new file mode 100644 index 0000000..30fc4c9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/6.png new file mode 100644 index 0000000..bce21a5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/7.png new file mode 100644 index 0000000..659eb3a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/8.png new file mode 100644 index 0000000..0763cb6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/9.png new file mode 100644 index 0000000..6628eb8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_magenta.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_magenta.properties new file mode 100644 index 0000000..ddf78f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_magenta.properties @@ -0,0 +1,6 @@ +# Stained glass magenta +matchBlocks=95 +metadata=2 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_pane_magenta.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_pane_magenta.properties new file mode 100644 index 0000000..3647ad5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_pane_magenta.properties @@ -0,0 +1,7 @@ +# Stained glass magenta +matchBlocks=160 +metadata=2 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3.png new file mode 100644 index 0000000..6611ddc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/32.png new file mode 100644 index 0000000..6f2391c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/33.png new file mode 100644 index 0000000..9572123 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/34.png new file mode 100644 index 0000000..a620f44 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/35.png new file mode 100644 index 0000000..af69add Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/36.png new file mode 100644 index 0000000..5c7effd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/37.png new file mode 100644 index 0000000..663c27d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/38.png new file mode 100644 index 0000000..21b4b1b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/39.png new file mode 100644 index 0000000..8ded4a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/0.png new file mode 100644 index 0000000..b62703d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/1.png new file mode 100644 index 0000000..b54d3e0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/10.png new file mode 100644 index 0000000..61a2de6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/11.png new file mode 100644 index 0000000..0d65d44 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/16.png new file mode 100644 index 0000000..3e2154f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/17.png new file mode 100644 index 0000000..5bfc9b9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/18.png new file mode 100644 index 0000000..0eaf5fc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/19.png new file mode 100644 index 0000000..899033b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/2.png new file mode 100644 index 0000000..5ff1e34 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/20.png new file mode 100644 index 0000000..1053015 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/21.png new file mode 100644 index 0000000..2ca7ba6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/22.png new file mode 100644 index 0000000..972314f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/23.png new file mode 100644 index 0000000..471b0a1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/24.png new file mode 100644 index 0000000..60fc60d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/25.png new file mode 100644 index 0000000..c7a6d9b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/26.png new file mode 100644 index 0000000..881c659 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/27.png new file mode 100644 index 0000000..b7dfaa3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/3.png new file mode 100644 index 0000000..abd672d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/32.png new file mode 100644 index 0000000..63a1c25 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/33.png new file mode 100644 index 0000000..d0c743f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/34.png new file mode 100644 index 0000000..98555c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/35.png new file mode 100644 index 0000000..f2c50a2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/36.png new file mode 100644 index 0000000..21d6813 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/37.png new file mode 100644 index 0000000..cb54313 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/38.png new file mode 100644 index 0000000..a148c54 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/39.png new file mode 100644 index 0000000..6328228 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/4.png new file mode 100644 index 0000000..a996a89 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/40.png new file mode 100644 index 0000000..520b483 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/41.png new file mode 100644 index 0000000..6b68671 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/42.png new file mode 100644 index 0000000..84aaf0d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/43.png new file mode 100644 index 0000000..585fe05 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/48.png new file mode 100644 index 0000000..4734b0a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/49.png new file mode 100644 index 0000000..1b47e77 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/5.png new file mode 100644 index 0000000..40927d6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/50.png new file mode 100644 index 0000000..a806848 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/51.png new file mode 100644 index 0000000..b521d2f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/52.png new file mode 100644 index 0000000..eb9e2f6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/53.png new file mode 100644 index 0000000..dba86fd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/54.png new file mode 100644 index 0000000..58e9d74 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/55.png new file mode 100644 index 0000000..49f8af3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/56.png new file mode 100644 index 0000000..4729ae0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/57.png new file mode 100644 index 0000000..de1a51f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/58.png new file mode 100644 index 0000000..d7f7c6e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/6.png new file mode 100644 index 0000000..3005d8c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/7.png new file mode 100644 index 0000000..70c377b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/8.png new file mode 100644 index 0000000..4eeb2f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/9.png new file mode 100644 index 0000000..f6bb6ab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_light_blue.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_light_blue.properties new file mode 100644 index 0000000..7f84e32 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_light_blue.properties @@ -0,0 +1,6 @@ +# Stained glass light_blue +matchBlocks=95 +metadata=3 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_pane_light_blue.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_pane_light_blue.properties new file mode 100644 index 0000000..326c950 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_pane_light_blue.properties @@ -0,0 +1,7 @@ +# Stained glass light_blue +matchBlocks=160 +metadata=3 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4.png new file mode 100644 index 0000000..ba09a5e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/40.png new file mode 100644 index 0000000..1fb540b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/41.png new file mode 100644 index 0000000..1ae5be7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/42.png new file mode 100644 index 0000000..bd95188 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/43.png new file mode 100644 index 0000000..00e2097 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/48.png new file mode 100644 index 0000000..bdbb21c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/49.png new file mode 100644 index 0000000..72b55b5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/0.png new file mode 100644 index 0000000..8e48e12 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/1.png new file mode 100644 index 0000000..7ee50cf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/10.png new file mode 100644 index 0000000..d5e9266 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/11.png new file mode 100644 index 0000000..11561fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/16.png new file mode 100644 index 0000000..e1e7e8a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/17.png new file mode 100644 index 0000000..5c6b658 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/18.png new file mode 100644 index 0000000..f053791 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/19.png new file mode 100644 index 0000000..9d2c4d6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/2.png new file mode 100644 index 0000000..d7899b5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/20.png new file mode 100644 index 0000000..97ab9ab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/21.png new file mode 100644 index 0000000..31a4fea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/22.png new file mode 100644 index 0000000..0e4844f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/23.png new file mode 100644 index 0000000..d3ba750 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/24.png new file mode 100644 index 0000000..5b54d6a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/25.png new file mode 100644 index 0000000..acd47fd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/26.png new file mode 100644 index 0000000..d975f89 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/27.png new file mode 100644 index 0000000..b544aba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/3.png new file mode 100644 index 0000000..c6cd55e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/32.png new file mode 100644 index 0000000..0500954 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/33.png new file mode 100644 index 0000000..92ec338 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/34.png new file mode 100644 index 0000000..499f061 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/35.png new file mode 100644 index 0000000..e0a0567 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/36.png new file mode 100644 index 0000000..a3f7fce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/37.png new file mode 100644 index 0000000..faf281b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/38.png new file mode 100644 index 0000000..77aa437 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/39.png new file mode 100644 index 0000000..ee7d8fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/4.png new file mode 100644 index 0000000..e19d2eb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/40.png new file mode 100644 index 0000000..fb1f1ae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/41.png new file mode 100644 index 0000000..7974f3c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/42.png new file mode 100644 index 0000000..6d999ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/43.png new file mode 100644 index 0000000..c85d599 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/48.png new file mode 100644 index 0000000..bf1e5f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/49.png new file mode 100644 index 0000000..63ffd31 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/5.png new file mode 100644 index 0000000..bc4916a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/50.png new file mode 100644 index 0000000..fd296c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/51.png new file mode 100644 index 0000000..5989037 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/52.png new file mode 100644 index 0000000..849b498 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/53.png new file mode 100644 index 0000000..149ed0c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/54.png new file mode 100644 index 0000000..ff41948 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/55.png new file mode 100644 index 0000000..25ef075 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/56.png new file mode 100644 index 0000000..ac21fe8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/57.png new file mode 100644 index 0000000..82e59f9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/58.png new file mode 100644 index 0000000..e9ec17d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/6.png new file mode 100644 index 0000000..9038f0c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/7.png new file mode 100644 index 0000000..55bbba6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/8.png new file mode 100644 index 0000000..7c65826 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/9.png new file mode 100644 index 0000000..f18633e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_pane_yellow.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_pane_yellow.properties new file mode 100644 index 0000000..6b3655e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_pane_yellow.properties @@ -0,0 +1,7 @@ +# Stained glass yellow +matchBlocks=160 +metadata=4 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_yellow.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_yellow.properties new file mode 100644 index 0000000..064de85 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_yellow.properties @@ -0,0 +1,6 @@ +# Stained glass yellow +matchBlocks=95 +metadata=4 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5.png new file mode 100644 index 0000000..3f475db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/50.png new file mode 100644 index 0000000..9de42fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/51.png new file mode 100644 index 0000000..3eb78ec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/52.png new file mode 100644 index 0000000..c6deb56 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/53.png new file mode 100644 index 0000000..ccb3ad4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/54.png new file mode 100644 index 0000000..db2b9cc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/55.png new file mode 100644 index 0000000..c4ba83b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/56.png new file mode 100644 index 0000000..896a612 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/57.png new file mode 100644 index 0000000..40c7712 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/58.png new file mode 100644 index 0000000..66cf887 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/0.png new file mode 100644 index 0000000..f1d3c46 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/1.png new file mode 100644 index 0000000..28ff5aa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/10.png new file mode 100644 index 0000000..52548e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/11.png new file mode 100644 index 0000000..3fc29f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/16.png new file mode 100644 index 0000000..bef180c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/17.png new file mode 100644 index 0000000..365032b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/18.png new file mode 100644 index 0000000..99006ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/19.png new file mode 100644 index 0000000..3daa953 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/2.png new file mode 100644 index 0000000..2a5941b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/20.png new file mode 100644 index 0000000..da36e37 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/21.png new file mode 100644 index 0000000..158596d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/22.png new file mode 100644 index 0000000..68383dd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/23.png new file mode 100644 index 0000000..2d60be0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/24.png new file mode 100644 index 0000000..5a41ebe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/25.png new file mode 100644 index 0000000..4512b61 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/26.png new file mode 100644 index 0000000..6a34f7a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/27.png new file mode 100644 index 0000000..d50f751 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/3.png new file mode 100644 index 0000000..4ad6261 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/32.png new file mode 100644 index 0000000..4a477d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/33.png new file mode 100644 index 0000000..b3d3c4c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/34.png new file mode 100644 index 0000000..cdbf635 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/35.png new file mode 100644 index 0000000..8d04801 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/36.png new file mode 100644 index 0000000..96fe6bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/37.png new file mode 100644 index 0000000..7c6557a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/38.png new file mode 100644 index 0000000..d0f480b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/39.png new file mode 100644 index 0000000..6a84d7c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/4.png new file mode 100644 index 0000000..045109c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/40.png new file mode 100644 index 0000000..11542e1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/41.png new file mode 100644 index 0000000..99fd347 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/42.png new file mode 100644 index 0000000..a4dc944 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/43.png new file mode 100644 index 0000000..5d1eef1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/48.png new file mode 100644 index 0000000..cf228f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/49.png new file mode 100644 index 0000000..4256865 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/5.png new file mode 100644 index 0000000..ba16e32 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/50.png new file mode 100644 index 0000000..3b23cb5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/51.png new file mode 100644 index 0000000..c29337a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/52.png new file mode 100644 index 0000000..0f33f4d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/53.png new file mode 100644 index 0000000..b4887a3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/54.png new file mode 100644 index 0000000..797aaa1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/55.png new file mode 100644 index 0000000..9817194 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/56.png new file mode 100644 index 0000000..8e3eba1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/57.png new file mode 100644 index 0000000..b7454e1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/58.png new file mode 100644 index 0000000..f578645 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/6.png new file mode 100644 index 0000000..d2e9ade Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/7.png new file mode 100644 index 0000000..9f26f1b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/8.png new file mode 100644 index 0000000..6e44ca1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/9.png new file mode 100644 index 0000000..3a61657 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_lime.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_lime.properties new file mode 100644 index 0000000..968e822 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_lime.properties @@ -0,0 +1,6 @@ +# Stained glass lime +matchBlocks=95 +metadata=5 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_pane_lime.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_pane_lime.properties new file mode 100644 index 0000000..108acbc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_pane_lime.properties @@ -0,0 +1,7 @@ +# Stained glass lime +matchBlocks=160 +metadata=5 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6.png new file mode 100644 index 0000000..ffd366d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/66.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/66.png new file mode 100644 index 0000000..13d68d0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/66.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/0.png new file mode 100644 index 0000000..42d8739 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/1.png new file mode 100644 index 0000000..7744913 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/10.png new file mode 100644 index 0000000..a87f362 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/11.png new file mode 100644 index 0000000..9f572a8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/16.png new file mode 100644 index 0000000..9cc8ef9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/17.png new file mode 100644 index 0000000..947f4ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/18.png new file mode 100644 index 0000000..fea9bca Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/19.png new file mode 100644 index 0000000..fd0ee45 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/2.png new file mode 100644 index 0000000..50ef16b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/20.png new file mode 100644 index 0000000..378e5ef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/21.png new file mode 100644 index 0000000..557d38d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/22.png new file mode 100644 index 0000000..a9f4eb0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/23.png new file mode 100644 index 0000000..6b74afc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/24.png new file mode 100644 index 0000000..d6bb643 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/25.png new file mode 100644 index 0000000..be3c1a2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/26.png new file mode 100644 index 0000000..7f87f51 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/27.png new file mode 100644 index 0000000..ac497a7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/3.png new file mode 100644 index 0000000..078a36a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/32.png new file mode 100644 index 0000000..2bb9b0d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/33.png new file mode 100644 index 0000000..88a776d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/34.png new file mode 100644 index 0000000..35c3098 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/35.png new file mode 100644 index 0000000..0ad4c4e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/36.png new file mode 100644 index 0000000..1360eea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/37.png new file mode 100644 index 0000000..3ba09fc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/38.png new file mode 100644 index 0000000..734a7cf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/39.png new file mode 100644 index 0000000..fd3329f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/4.png new file mode 100644 index 0000000..02d6d03 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/40.png new file mode 100644 index 0000000..2c41cc1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/41.png new file mode 100644 index 0000000..113d0c2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/42.png new file mode 100644 index 0000000..c1ab110 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/43.png new file mode 100644 index 0000000..600cfe2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/48.png new file mode 100644 index 0000000..80182e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/49.png new file mode 100644 index 0000000..f655fb9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/5.png new file mode 100644 index 0000000..b94667c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/50.png new file mode 100644 index 0000000..2314156 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/51.png new file mode 100644 index 0000000..bfda4f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/52.png new file mode 100644 index 0000000..3e16767 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/53.png new file mode 100644 index 0000000..37c84ec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/54.png new file mode 100644 index 0000000..c971dfc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/55.png new file mode 100644 index 0000000..c0f4df8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/56.png new file mode 100644 index 0000000..16374c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/57.png new file mode 100644 index 0000000..68155ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/58.png new file mode 100644 index 0000000..016889e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/6.png new file mode 100644 index 0000000..5b0cb15 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/7.png new file mode 100644 index 0000000..4e3885e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/8.png new file mode 100644 index 0000000..a2c6f48 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/9.png new file mode 100644 index 0000000..0051d1d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pane_pink.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pane_pink.properties new file mode 100644 index 0000000..28dff1a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pane_pink.properties @@ -0,0 +1,7 @@ +# Stained glass pink +matchBlocks=160 +metadata=6 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pink.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pink.properties new file mode 100644 index 0000000..1bbca38 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pink.properties @@ -0,0 +1,6 @@ +# Stained glass pink +matchBlocks=95 +metadata=6 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7.png new file mode 100644 index 0000000..7d0ffb2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/0.png new file mode 100644 index 0000000..3f07a5d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/1.png new file mode 100644 index 0000000..64fffa3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/10.png new file mode 100644 index 0000000..b0c0d27 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/11.png new file mode 100644 index 0000000..112c6ce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/16.png new file mode 100644 index 0000000..5a5d27f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/17.png new file mode 100644 index 0000000..9479f0e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/18.png new file mode 100644 index 0000000..d5f2a66 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/19.png new file mode 100644 index 0000000..5c6b9e1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/2.png new file mode 100644 index 0000000..131366f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/20.png new file mode 100644 index 0000000..e4ffc2f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/21.png new file mode 100644 index 0000000..14cc29c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/22.png new file mode 100644 index 0000000..3b41dac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/23.png new file mode 100644 index 0000000..58a5125 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/24.png new file mode 100644 index 0000000..e1a4030 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/25.png new file mode 100644 index 0000000..736d80c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/26.png new file mode 100644 index 0000000..b2b0aa8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/27.png new file mode 100644 index 0000000..87549c4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/3.png new file mode 100644 index 0000000..f37a2c8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/32.png new file mode 100644 index 0000000..09c3d65 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/33.png new file mode 100644 index 0000000..fa44bdb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/34.png new file mode 100644 index 0000000..542b9f9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/35.png new file mode 100644 index 0000000..5b157bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/36.png new file mode 100644 index 0000000..6d485e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/37.png new file mode 100644 index 0000000..1b5d8ec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/38.png new file mode 100644 index 0000000..a0fe8a1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/39.png new file mode 100644 index 0000000..92091b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/4.png new file mode 100644 index 0000000..6d822a4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/40.png new file mode 100644 index 0000000..5172ef3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/41.png new file mode 100644 index 0000000..a281ced Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/42.png new file mode 100644 index 0000000..62a50e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/43.png new file mode 100644 index 0000000..8fc8b05 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/48.png new file mode 100644 index 0000000..a40bbcd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/49.png new file mode 100644 index 0000000..5b337fb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/5.png new file mode 100644 index 0000000..82fcfc3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/50.png new file mode 100644 index 0000000..278e7eb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/51.png new file mode 100644 index 0000000..b6f30cc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/52.png new file mode 100644 index 0000000..f0ca09d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/53.png new file mode 100644 index 0000000..7396d2c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/54.png new file mode 100644 index 0000000..7958f25 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/55.png new file mode 100644 index 0000000..8dcc4de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/56.png new file mode 100644 index 0000000..b5f7d16 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/57.png new file mode 100644 index 0000000..82acb63 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/58.png new file mode 100644 index 0000000..c6bfce6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/6.png new file mode 100644 index 0000000..ccb1f6a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/7.png new file mode 100644 index 0000000..bf67595 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/8.png new file mode 100644 index 0000000..01acf18 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/9.png new file mode 100644 index 0000000..d237ab9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_gray.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_gray.properties new file mode 100644 index 0000000..5284f51 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_gray.properties @@ -0,0 +1,6 @@ +# Stained glass gray +matchBlocks=95 +metadata=7 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_pane_gray.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_pane_gray.properties new file mode 100644 index 0000000..1743e87 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_pane_gray.properties @@ -0,0 +1,7 @@ +# Stained glass gray +matchBlocks=160 +metadata=7 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8.png new file mode 100644 index 0000000..f9bf0fb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/0.png new file mode 100644 index 0000000..8461664 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/1.png new file mode 100644 index 0000000..12a88d0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/10.png new file mode 100644 index 0000000..e2c2673 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/11.png new file mode 100644 index 0000000..076bdbe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/16.png new file mode 100644 index 0000000..f1ce496 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/17.png new file mode 100644 index 0000000..ab39de7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/18.png new file mode 100644 index 0000000..23231db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/19.png new file mode 100644 index 0000000..5034a66 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/2.png new file mode 100644 index 0000000..fc9e60e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/20.png new file mode 100644 index 0000000..c885d28 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/21.png new file mode 100644 index 0000000..7db45f0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/22.png new file mode 100644 index 0000000..fefa27c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/23.png new file mode 100644 index 0000000..875306d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/24.png new file mode 100644 index 0000000..ba8e1ce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/25.png new file mode 100644 index 0000000..c244eee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/26.png new file mode 100644 index 0000000..5789108 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/27.png new file mode 100644 index 0000000..13cd6f9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/3.png new file mode 100644 index 0000000..9f22722 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/32.png new file mode 100644 index 0000000..f9f64d6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/33.png new file mode 100644 index 0000000..ab006a3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/34.png new file mode 100644 index 0000000..08dd059 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/35.png new file mode 100644 index 0000000..78ccad0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/36.png new file mode 100644 index 0000000..4606e7a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/37.png new file mode 100644 index 0000000..a6f7531 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/38.png new file mode 100644 index 0000000..bce4bcb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/39.png new file mode 100644 index 0000000..3f3b0ec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/4.png new file mode 100644 index 0000000..b93f9cd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/40.png new file mode 100644 index 0000000..662e200 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/41.png new file mode 100644 index 0000000..8fe077a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/42.png new file mode 100644 index 0000000..007d225 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/43.png new file mode 100644 index 0000000..9521d9d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/48.png new file mode 100644 index 0000000..3a492b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/49.png new file mode 100644 index 0000000..f81553a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/5.png new file mode 100644 index 0000000..b99c20e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/50.png new file mode 100644 index 0000000..3749f75 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/51.png new file mode 100644 index 0000000..a40c84f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/52.png new file mode 100644 index 0000000..99d2700 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/53.png new file mode 100644 index 0000000..1c5770d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/54.png new file mode 100644 index 0000000..7f80e64 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/55.png new file mode 100644 index 0000000..c003c7f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/56.png new file mode 100644 index 0000000..c28a131 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/57.png new file mode 100644 index 0000000..84540bc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/58.png new file mode 100644 index 0000000..5544bc9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/6.png new file mode 100644 index 0000000..1447715 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/7.png new file mode 100644 index 0000000..0e5a7a7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/8.png new file mode 100644 index 0000000..fe3a46f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/9.png new file mode 100644 index 0000000..267f2ae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_pane_silver.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_pane_silver.properties new file mode 100644 index 0000000..aa47028 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_pane_silver.properties @@ -0,0 +1,7 @@ +# Stained glass silver +matchBlocks=160 +metadata=8 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_silver.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_silver.properties new file mode 100644 index 0000000..d2696f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_silver.properties @@ -0,0 +1,6 @@ +# Stained glass silver +matchBlocks=95 +metadata=8 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9.png new file mode 100644 index 0000000..d4f7c4e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/0.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/0.png new file mode 100644 index 0000000..d30caa4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/1.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/1.png new file mode 100644 index 0000000..941354d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/10.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/10.png new file mode 100644 index 0000000..e6e23b0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/11.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/11.png new file mode 100644 index 0000000..f0eddb7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/16.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/16.png new file mode 100644 index 0000000..fa7272e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/17.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/17.png new file mode 100644 index 0000000..beebe55 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/18.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/18.png new file mode 100644 index 0000000..59dd8a8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/19.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/19.png new file mode 100644 index 0000000..4961e39 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/2.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/2.png new file mode 100644 index 0000000..771ff3b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/20.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/20.png new file mode 100644 index 0000000..e8c3134 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/21.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/21.png new file mode 100644 index 0000000..bd9b84a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/22.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/22.png new file mode 100644 index 0000000..98f227d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/23.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/23.png new file mode 100644 index 0000000..dc7929e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/24.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/24.png new file mode 100644 index 0000000..c6c02d9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/25.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/25.png new file mode 100644 index 0000000..7c5e5ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/26.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/26.png new file mode 100644 index 0000000..b45b386 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/27.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/27.png new file mode 100644 index 0000000..ba47110 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/3.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/3.png new file mode 100644 index 0000000..81db31f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/32.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/32.png new file mode 100644 index 0000000..9cc6fda Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/33.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/33.png new file mode 100644 index 0000000..97c6860 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/34.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/34.png new file mode 100644 index 0000000..8790bd3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/35.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/35.png new file mode 100644 index 0000000..36aafff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/36.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/36.png new file mode 100644 index 0000000..533ce59 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/37.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/37.png new file mode 100644 index 0000000..21ea0a1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/38.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/38.png new file mode 100644 index 0000000..c804c82 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/39.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/39.png new file mode 100644 index 0000000..497a1ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/4.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/4.png new file mode 100644 index 0000000..b1a0f02 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/40.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/40.png new file mode 100644 index 0000000..ab09ebd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/41.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/41.png new file mode 100644 index 0000000..d65c5de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/42.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/42.png new file mode 100644 index 0000000..92184c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/43.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/43.png new file mode 100644 index 0000000..fb3587a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/48.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/48.png new file mode 100644 index 0000000..f6d84b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/49.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/49.png new file mode 100644 index 0000000..9016a5f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/5.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/5.png new file mode 100644 index 0000000..4469277 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/50.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/50.png new file mode 100644 index 0000000..bba832b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/51.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/51.png new file mode 100644 index 0000000..706c0bc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/52.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/52.png new file mode 100644 index 0000000..6dc0362 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/53.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/53.png new file mode 100644 index 0000000..1fcc91a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/54.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/54.png new file mode 100644 index 0000000..f1cfbd9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/55.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/55.png new file mode 100644 index 0000000..aec8126 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/56.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/56.png new file mode 100644 index 0000000..0ddd669 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/57.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/57.png new file mode 100644 index 0000000..7c7bc74 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/58.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/58.png new file mode 100644 index 0000000..6495fef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/6.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/6.png new file mode 100644 index 0000000..663a5d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/7.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/7.png new file mode 100644 index 0000000..9a120cb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/8.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/8.png new file mode 100644 index 0000000..39755b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/9.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/9.png new file mode 100644 index 0000000..74bddb4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_cyan.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_cyan.properties new file mode 100644 index 0000000..807c2d4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_cyan.properties @@ -0,0 +1,6 @@ +# Stained glass cyan +matchBlocks=95 +metadata=9 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_pane_cyan.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_pane_cyan.properties new file mode 100644 index 0000000..99df893 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_pane_cyan.properties @@ -0,0 +1,7 @@ +# Stained glass cyan +matchBlocks=160 +metadata=9 +connect=block +method=ctm +faces=sides +tiles=0-11 16-27 32-43 48-58 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/bookshelf.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/bookshelf.properties new file mode 100644 index 0000000..fd7167c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/bookshelf.properties @@ -0,0 +1,7 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchBlocks=47 +method=horizontal +tiles=12-15 +connect=block +faces=sides \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/empty.png b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/empty.png new file mode 100644 index 0000000..dbaa21c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/empty.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glass.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glass.properties new file mode 100644 index 0000000..8064c63 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glass.properties @@ -0,0 +1,6 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchBlocks=20 +method=ctm +tiles=0-11 16-27 32-43 48-58 +connect=block diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glasspane.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glasspane.properties new file mode 100644 index 0000000..64b0657 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glasspane.properties @@ -0,0 +1,7 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchBlocks=102 +method=ctm +tiles=0-11 16-27 32-43 48-58 +connect=block +faces=sides \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/sandstone.properties b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/sandstone.properties new file mode 100644 index 0000000..9176eb9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/mcpatcher/ctm/default/sandstone.properties @@ -0,0 +1,7 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchTiles=sandstone_normal +metadata=0 +method=top +tiles=66 +connect=tile diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_bark.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_bark.json new file mode 100644 index 0000000..2ae3fc4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/log_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_bottom.json new file mode 100644 index 0000000..0c5951e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_acacia_lower", + "top": "blocks/door_acacia_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_bottom_rh.json new file mode 100644 index 0000000..f918660 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_acacia_lower", + "top": "blocks/door_acacia_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_top.json new file mode 100644 index 0000000..1214f3b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_acacia_lower", + "top": "blocks/door_acacia_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_top_rh.json new file mode 100644 index 0000000..d706f36 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_door_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_acacia_lower", + "top": "blocks/door_acacia_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_gate_closed.json new file mode 100644 index 0000000..8e317cc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_gate_open.json new file mode 100644 index 0000000..16234a2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_inventory.json new file mode 100644 index 0000000..e390a8a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_n.json new file mode 100644 index 0000000..54a17dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_n", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_ne.json new file mode 100644 index 0000000..0f1c10d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ne", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_ns.json new file mode 100644 index 0000000..4098444 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ns", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_nse.json new file mode 100644 index 0000000..67fe693 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nse", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_nsew.json new file mode 100644 index 0000000..8e11585 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nsew", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_post.json new file mode 100644 index 0000000..bc78d2f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_inner_stairs.json new file mode 100644 index 0000000..727e10e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/planks_acacia", + "top": "blocks/planks_acacia", + "side": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_leaves.json new file mode 100644 index 0000000..8f7f654 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "blocks/leaves_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_log.json new file mode 100644 index 0000000..9ca2062 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_log.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/log_acacia_top", + "side": "blocks/log_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_log_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_log_side.json new file mode 100644 index 0000000..7547c14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_log_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "blocks/log_acacia_top", + "side": "blocks/log_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_outer_stairs.json new file mode 100644 index 0000000..689009b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/planks_acacia", + "top": "blocks/planks_acacia", + "side": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_planks.json new file mode 100644 index 0000000..514b5df --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_sapling.json new file mode 100644 index 0000000..0ac2f33 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/sapling_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_stairs.json new file mode 100644 index 0000000..9496b30 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/planks_acacia", + "top": "blocks/planks_acacia", + "side": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_wall_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_wall_gate_closed.json new file mode 100644 index 0000000..663ff1a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_wall_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_wall_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_wall_gate_open.json new file mode 100644 index 0000000..21706f6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/acacia_wall_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_flat.json new file mode 100644 index 0000000..c35d708 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_flat.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "blocks/rail_activator_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_raised_ne.json new file mode 100644 index 0000000..dc90395 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_ne", + "textures": { + "rail": "blocks/rail_activator_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_raised_sw.json new file mode 100644 index 0000000..e70658d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_active_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_sw", + "textures": { + "rail": "blocks/rail_activator_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_flat.json new file mode 100644 index 0000000..61a8f21 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_flat.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "blocks/rail_activator" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_raised_ne.json new file mode 100644 index 0000000..721d80d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_ne", + "textures": { + "rail": "blocks/rail_activator" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_raised_sw.json new file mode 100644 index 0000000..32f04b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/activator_rail_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_sw", + "textures": { + "rail": "blocks/rail_activator" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/allium.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/allium.json new file mode 100644 index 0000000..e7485ac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/allium.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "particle": "blocks/flower_allium", + "cross": "blocks/flower_allium" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/andesite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/andesite.json new file mode 100644 index 0000000..25adfc7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/andesite.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone_andesite" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/andesite_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/andesite_smooth.json new file mode 100644 index 0000000..8f815be --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/andesite_smooth.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone_andesite_smooth" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil.json new file mode 100644 index 0000000..b590f63 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil.json @@ -0,0 +1,52 @@ +{ + "elements": [ + { "__comment": "Anvil base", + "from": [ 2, 0, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#body", "rotation": 180, "cullface": "down" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#body", "rotation": 180 }, + "north": { "uv": [ 2, 12, 14, 16 ], "texture": "#body" }, + "south": { "uv": [ 2, 12, 14, 16 ], "texture": "#body" }, + "west": { "uv": [ 0, 2, 4, 14 ], "texture": "#body", "rotation": 90 }, + "east": { "uv": [ 4, 2, 0, 14 ], "texture": "#body", "rotation": 270 } + } + }, + { "__comment": "Lower narrow portion", + "from": [ 4, 4, 3 ], + "to": [ 12, 5, 13 ], + "faces": { + "down": { "uv": [ 4, 3, 12, 13 ], "texture": "#body", "rotation": 180 }, + "up": { "uv": [ 4, 3, 12, 13 ], "texture": "#body", "rotation": 180 }, + "north": { "uv": [ 4, 11, 12, 12 ], "texture": "#body" }, + "south": { "uv": [ 4, 11, 12, 12 ], "texture": "#body" }, + "west": { "uv": [ 4, 3, 5, 13 ], "texture": "#body", "rotation": 90 }, + "east": { "uv": [ 5, 3, 4, 13 ], "texture": "#body", "rotation": 270 } + } + }, + { "__comment": "Wider section beneath top portion", + "from": [ 6, 5, 4 ], + "to": [ 10, 10, 12 ], + "faces": { + "down": { "uv": [ 10, 12, 6, 4 ], "texture": "#body", "rotation": 180 }, + "up": { "uv": [ 10, 12, 6, 4 ], "texture": "#body", "rotation": 180 }, + "north": { "uv": [ 6, 6, 10, 11 ], "texture": "#body" }, + "south": { "uv": [ 6, 6, 10, 11 ], "texture": "#body" }, + "west": { "uv": [ 5, 4, 10, 12 ], "texture": "#body", "rotation": 90 }, + "east": { "uv": [ 10, 4, 5, 12 ], "texture": "#body", "rotation": 270 } + } + }, + { "__comment": "Anvil top", + "from": [ 3, 10, 0 ], + "to": [ 13, 16, 16 ], + "faces": { + "down": { "uv": [ 3, 0, 13, 16 ], "texture": "#body", "rotation": 180 }, + "up": { "uv": [ 3, 0, 13, 16 ], "texture": "#top", "rotation": 180 }, + "north": { "uv": [ 3, 0, 13, 6 ], "texture": "#body" }, + "south": { "uv": [ 3, 0, 13, 6 ], "texture": "#body" }, + "west": { "uv": [ 10, 0, 16, 16 ], "texture": "#body", "rotation": 90 }, + "east": { "uv": [ 16, 0, 10, 16 ], "texture": "#body", "rotation": 270 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_slightly_damaged.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_slightly_damaged.json new file mode 100644 index 0000000..09f541c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_slightly_damaged.json @@ -0,0 +1,8 @@ +{ + "parent": "block/anvil", + "textures": { + "particle": "blocks/anvil_base", + "body": "blocks/anvil_base", + "top": "blocks/anvil_top_damaged_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_undamaged.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_undamaged.json new file mode 100644 index 0000000..1e1ad44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_undamaged.json @@ -0,0 +1,8 @@ +{ + "parent": "block/anvil", + "textures": { + "particle": "blocks/anvil_base", + "body": "blocks/anvil_base", + "top": "blocks/anvil_top_damaged_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_very_damaged.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_very_damaged.json new file mode 100644 index 0000000..4623b97 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/anvil_very_damaged.json @@ -0,0 +1,8 @@ +{ + "parent": "block/anvil", + "textures": { + "particle": "blocks/anvil_base", + "body": "blocks/anvil_base", + "top": "blocks/anvil_top_damaged_2" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_n.json new file mode 100644 index 0000000..02f371b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_n.json @@ -0,0 +1,31 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/iron_bars", + "bars": "blocks/iron_bars", + "edge": "blocks/iron_bars" + }, + "elements": [ + { "from": [ 8, 0, 0 ], + "to": [ 8, 16, 8 ], + "faces": { + "west": { "uv": [ 8, 0, 16, 16 ], "texture": "#bars" }, + "east": { "uv": [ 8, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 9 ], + "faces": { + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" } + } + }, + { "from": [ 7, 0.005, 0 ], + "to": [ 9, 15.995, 9 ], + "faces": { + "down": { "uv": [ 9, 0, 7, 9 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_ne.json new file mode 100644 index 0000000..9697aec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_ne.json @@ -0,0 +1,50 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/iron_bars", + "bars": "blocks/iron_bars", + "edge": "blocks/iron_bars" + }, + "elements": [ + { "from": [ 8, 0, 0 ], + "to": [ 8, 16, 8 ], + "faces": { + "west": { "uv": [ 0, 0, 8, 16 ], "texture": "#bars" }, + "east": { "uv": [ 8, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 0 ], + "faces": { + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" } + } + }, + { "from": [ 7, 0.005, 0 ], + "to": [ 9, 15.995, 9 ], + "faces": { + "down": { "uv": [ 9, 0, 7, 9 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 0, 0, 8, 16 ], "texture": "#bars" }, + "south": { "uv": [ 8, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + }, + { "from": [ 9, 0.005, 7 ], + "to": [ 16, 15.995, 9 ], + "faces": { + "down": { "uv": [ 9, 0, 7, 7 ], "texture": "#edge", "rotation": 90 }, + "up": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_ns.json new file mode 100644 index 0000000..425b554 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_ns.json @@ -0,0 +1,31 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/iron_bars", + "bars": "blocks/iron_bars", + "edge": "blocks/iron_bars" + }, + "elements": [ + { "from": [ 8, 0, 0 ], + "to": [ 8, 16, 16 ], + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "faces": { + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" } + } + }, + { "from": [ 7, 0.005, 0 ], + "to": [ 9, 15.995, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 9, 0, 7, 16 ], "texture": "#edge" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_nse.json new file mode 100644 index 0000000..c43bab9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_nse.json @@ -0,0 +1,51 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/iron_bars", + "bars": "blocks/iron_bars", + "edge": "blocks/iron_bars" + }, + "elements": [ + { "from": [ 8, 0, 0 ], + "to": [ 8, 16, 16 ], + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "faces": { + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" } + } + }, + { "from": [ 7, 0.005, 0 ], + "to": [ 9, 15.995, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 9, 0, 7, 16 ], "texture": "#edge" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 0, 0, 8, 16 ], "texture": "#bars" }, + "south": { "uv": [ 8, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + }, + { "from": [ 9, 0.005, 7 ], + "to": [ 16, 15.995, 9 ], + "faces": { + "down": { "uv": [ 9, 0, 7, 7 ], "texture": "#edge", "rotation": 90 }, + "up": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_nsew.json new file mode 100644 index 0000000..6d6c701 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bars_nsew.json @@ -0,0 +1,59 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/iron_bars", + "bars": "blocks/iron_bars", + "edge": "blocks/iron_bars" + }, + "elements": [ + { "from": [ 8, 0, 0 ], + "to": [ 8, 16, 16 ], + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "faces": { + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" } + } + }, + { "from": [ 7, 0.005, 0 ], + "to": [ 9, 15.995, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 9, 0, 7, 16 ], "texture": "#edge" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#bars" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + }, + { "from": [ 0, 0.005, 7 ], + "to": [ 7, 15.995, 9 ], + "faces": { + "down": { "uv": [ 9, 9, 7, 16 ], "texture": "#edge", "rotation": 90 }, + "up": { "uv": [ 7, 9, 9, 16 ], "texture": "#edge", "rotation": 90 } + } + }, + { "from": [ 9, 0.005, 7 ], + "to": [ 16, 15.995, 9 ], + "faces": { + "down": { "uv": [ 9, 0, 7, 7 ], "texture": "#edge", "rotation": 90 }, + "up": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/beacon.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/beacon.json new file mode 100644 index 0000000..747d42b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/beacon.json @@ -0,0 +1,47 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/glass", + "glass": "blocks/glass", + "obsidian": "blocks/obsidian", + "beacon": "blocks/beacon" + }, + "elements": [ + { "__comment": "Glass shell", + "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" } + } + }, + { "__comment": "Obsidian base", + "from": [ 2, 0.1, 2 ], + "to": [ 14, 3, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#obsidian" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#obsidian" }, + "north": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" }, + "south": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" }, + "west": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" }, + "east": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" } + } + }, + { "__comment": "Inner beacon texture", + "from": [ 3, 3, 3 ], + "to": [ 13, 14, 13 ], + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#beacon" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#beacon" }, + "north": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" }, + "south": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" }, + "west": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" }, + "east": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bed_foot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bed_foot.json new file mode 100644 index 0000000..5486445 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bed_foot.json @@ -0,0 +1,26 @@ +{ + "textures": { + "particle": "blocks/bed_feet_top", + "top": "blocks/bed_feet_top", + "bottom": "blocks/planks_oak", + "end": "blocks/bed_feet_end", + "side": "blocks/bed_feet_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 9, 16 ], + "faces": { + "up": { "uv": [ 0, 16, 16, 0 ], "texture": "#top", "rotation": 90 }, + "north": { "uv": [ 0, 7, 16, 16 ], "texture": "#end" }, + "west": { "uv": [ 0, 7, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 16, 7, 0, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 3, 0 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bed_head.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bed_head.json new file mode 100644 index 0000000..c53aded --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bed_head.json @@ -0,0 +1,26 @@ +{ + "textures": { + "particle": "blocks/bed_head_top", + "top": "blocks/bed_head_top", + "bottom": "blocks/planks_oak", + "end": "blocks/bed_head_end", + "side": "blocks/bed_head_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 9, 16 ], + "faces": { + "up": { "uv": [ 0, 16, 16, 0 ], "texture": "#top", "rotation": 90 }, + "south": { "uv": [ 0, 7, 16, 16 ], "texture": "#end" }, + "west": { "uv": [ 0, 7, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 16, 7, 0, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 3, 0 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bedrock.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bedrock.json new file mode 100644 index 0000000..c635270 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bedrock.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/bedrock" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bedrock_mirrored.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bedrock_mirrored.json new file mode 100644 index 0000000..e63c643 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bedrock_mirrored.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_mirrored_all", + "textures": { + "all": "blocks/bedrock" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_bark.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_bark.json new file mode 100644 index 0000000..cd5ba86 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/log_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_bottom.json new file mode 100644 index 0000000..b1aee11 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_birch_lower", + "top": "blocks/door_birch_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_bottom_rh.json new file mode 100644 index 0000000..1cd3271 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_birch_lower", + "top": "blocks/door_birch_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_top.json new file mode 100644 index 0000000..82c321f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_birch_lower", + "top": "blocks/door_birch_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_top_rh.json new file mode 100644 index 0000000..28c754c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_door_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_birch_lower", + "top": "blocks/door_birch_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_gate_closed.json new file mode 100644 index 0000000..9125e47 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_gate_open.json new file mode 100644 index 0000000..ba95ded --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_inventory.json new file mode 100644 index 0000000..b17fc3a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_n.json new file mode 100644 index 0000000..009c707 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_n", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_ne.json new file mode 100644 index 0000000..8744122 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ne", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_ns.json new file mode 100644 index 0000000..884f686 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ns", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_nse.json new file mode 100644 index 0000000..c6e3b55 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nse", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_nsew.json new file mode 100644 index 0000000..ff83f60 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nsew", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_post.json new file mode 100644 index 0000000..e593ace --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_inner_stairs.json new file mode 100644 index 0000000..bb52f30 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/planks_birch", + "top": "blocks/planks_birch", + "side": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_leaves.json new file mode 100644 index 0000000..95fe59b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "blocks/leaves_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_log.json new file mode 100644 index 0000000..4f40977 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_log.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/log_birch_top", + "side": "blocks/log_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_log_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_log_side.json new file mode 100644 index 0000000..384487d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_log_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "blocks/log_birch_top", + "side": "blocks/log_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_outer_stairs.json new file mode 100644 index 0000000..8f94932 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/planks_birch", + "top": "blocks/planks_birch", + "side": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_planks.json new file mode 100644 index 0000000..cd3e708 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_sapling.json new file mode 100644 index 0000000..c2f31f6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/sapling_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_stairs.json new file mode 100644 index 0000000..aca0c6e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/planks_birch", + "top": "blocks/planks_birch", + "side": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_wall_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_wall_gate_closed.json new file mode 100644 index 0000000..0d50e58 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_wall_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_wall_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_wall_gate_open.json new file mode 100644 index 0000000..040947a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/birch_wall_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_n.json new file mode 100644 index 0000000..45b0296 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_ne.json new file mode 100644 index 0000000..d845145 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_new.json new file mode 100644 index 0000000..4bb2e8c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_ns.json new file mode 100644 index 0000000..dfd85a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nse.json new file mode 100644 index 0000000..db9beb7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nsew.json new file mode 100644 index 0000000..2f51743 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nsw.json new file mode 100644 index 0000000..7301142 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nw.json new file mode 100644 index 0000000..6d7f488 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_s.json new file mode 100644 index 0000000..ad6b830 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_se.json new file mode 100644 index 0000000..955fc44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_sew.json new file mode 100644 index 0000000..ae78059 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_sw.json new file mode 100644 index 0000000..035b4c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_black", + "pane": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_wool.json new file mode 100644 index 0000000..74797fb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/black_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_n.json new file mode 100644 index 0000000..1ee4a6d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_ne.json new file mode 100644 index 0000000..9c9cc06 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_new.json new file mode 100644 index 0000000..9e6f5f1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_ns.json new file mode 100644 index 0000000..948f016 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nse.json new file mode 100644 index 0000000..59afc3d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nsew.json new file mode 100644 index 0000000..1611003 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nsw.json new file mode 100644 index 0000000..38b7492 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nw.json new file mode 100644 index 0000000..ab9f875 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_s.json new file mode 100644 index 0000000..87b5bad --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_se.json new file mode 100644 index 0000000..0c085f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_sew.json new file mode 100644 index 0000000..b1f0d1e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_sw.json new file mode 100644 index 0000000..d79300b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_blue", + "pane": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_wool.json new file mode 100644 index 0000000..1292e85 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/blue_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bookshelf.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bookshelf.json new file mode 100644 index 0000000..b46b6f0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/bookshelf.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/planks_oak", + "side": "blocks/bookshelf" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_1.json new file mode 100644 index 0000000..526a210 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_1.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_12.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_12.json new file mode 100644 index 0000000..f198d1b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_12.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_123.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_123.json new file mode 100644 index 0000000..51f2a35 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_123.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_13.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_13.json new file mode 100644 index 0000000..b580905 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_13.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_2.json new file mode 100644 index 0000000..ae2b177 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_2.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_23.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_23.json new file mode 100644 index 0000000..2b27b86 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_23.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_3.json new file mode 100644 index 0000000..47b3ed1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_bottles_3.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 0, 16 ], "texture": "#stand" }, + "south": { "uv": [ 0, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_empty.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_empty.json new file mode 100644 index 0000000..26dd126 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brewing_stand_empty.json @@ -0,0 +1,86 @@ +{ + "textures": { + "particle": "blocks/brewing_stand", + "base": "blocks/brewing_stand_base", + "stand": "blocks/brewing_stand" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 14, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stand" }, + "north": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "south": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "west": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" }, + "east": { "uv": [ 7, 2, 9, 16 ], "texture": "#stand" } + } + }, + { "from": [ 9, 0, 5 ], + "to": [ 15, 2, 11 ], + "faces": { + "down": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "up": { "uv": [ 9, 5, 15, 11 ], "texture": "#base" }, + "north": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" }, + "east": { "uv": [ 5, 14, 11, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 1 ], + "to": [ 8, 2, 7 ], + "faces": { + "down": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "up": { "uv": [ 2, 1, 8, 7 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 7, 16 ], "texture": "#base" } + } + }, + { "from": [ 2, 0, 9 ], + "to": [ 8, 2, 15 ], + "faces": { + "down": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "up": { "uv": [ 2, 9, 8, 15 ], "texture": "#base" }, + "north": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "south": { "uv": [ 2, 14, 8, 16 ], "texture": "#base" }, + "west": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 9, 14, 15, 16 ], "texture": "#base" } + } + }, + { "from": [ 8, 0, 8 ], + "to": [ 16, 16, 8 ], + "faces": { + "north": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" }, + "south": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 8, 16, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": -45, + "rescale": true + }, + "faces": { + "north": { "uv": [ 8, 0, 16, 16 ], "texture": "#stand" }, + "south": { "uv": [ 16, 0, 8, 16 ], "texture": "#stand" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick.json new file mode 100644 index 0000000..82f388b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_inner_stairs.json new file mode 100644 index 0000000..90c3b47 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/brick", + "top": "blocks/brick", + "side": "blocks/brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_outer_stairs.json new file mode 100644 index 0000000..3c28d04 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/brick", + "top": "blocks/brick", + "side": "blocks/brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_stairs.json new file mode 100644 index 0000000..1bf8b2a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brick_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/brick", + "top": "blocks/brick", + "side": "blocks/brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom.json new file mode 100644 index 0000000..e06fae4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/mushroom_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_c.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_c.json new file mode 100644 index 0000000..18e866b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_c.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_cap_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_cap_all.json new file mode 100644 index 0000000..8a75431 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_cap_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/mushroom_block_skin_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_e.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_e.json new file mode 100644 index 0000000..780e055 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_e.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_skin_brown", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_inside_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_inside_all.json new file mode 100644 index 0000000..472dc8a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_inside_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_n.json new file mode 100644 index 0000000..fb5c593 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_n.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_skin_brown", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_ne.json new file mode 100644 index 0000000..51080d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_ne.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_skin_brown", + "east": "blocks/mushroom_block_skin_brown", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_nw.json new file mode 100644 index 0000000..b8fbdf9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_nw.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_skin_brown", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_skin_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_s.json new file mode 100644 index 0000000..5cc9752 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_s.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_skin_brown", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_se.json new file mode 100644 index 0000000..5881c62 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_se.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_skin_brown", + "south": "blocks/mushroom_block_skin_brown", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_stem.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_stem.json new file mode 100644 index 0000000..b839c9a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_stem.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "side": "blocks/mushroom_block_skin_stem", + "end": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_stem_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_stem_all.json new file mode 100644 index 0000000..73434e4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_stem_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/mushroom_block_skin_stem" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_sw.json new file mode 100644 index 0000000..7936308 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_sw.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_skin_brown", + "west": "blocks/mushroom_block_skin_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_w.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_w.json new file mode 100644 index 0000000..3f8fe8a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_mushroom_block_w.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_brown", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_skin_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_n.json new file mode 100644 index 0000000..968a8de --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_ne.json new file mode 100644 index 0000000..4a0e525 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_new.json new file mode 100644 index 0000000..70cdce8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_ns.json new file mode 100644 index 0000000..a4db56a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nse.json new file mode 100644 index 0000000..6036951 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nsew.json new file mode 100644 index 0000000..b3f5f52 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nsw.json new file mode 100644 index 0000000..8047043 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nw.json new file mode 100644 index 0000000..7edbeb1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_s.json new file mode 100644 index 0000000..3459412 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_se.json new file mode 100644 index 0000000..29dc758 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_sew.json new file mode 100644 index 0000000..85b0dc9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_sw.json new file mode 100644 index 0000000..87abb4b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_brown", + "pane": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_wool.json new file mode 100644 index 0000000..f14b513 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/brown_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button.json new file mode 100644 index 0000000..8b5c506 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 5, 0, 6 ], + "to": [ 11, 2, 10 ], + "faces": { + "down": { "uv": [ 5, 6, 11, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 5, 10, 11, 6 ], "texture": "#texture" }, + "north": { "uv": [ 5, 14, 11, 16 ], "texture": "#texture" }, + "south": { "uv": [ 5, 14, 11, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 14, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 14, 10, 16 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button_inventory.json new file mode 100644 index 0000000..54e3429 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button_inventory.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 5, 6, 6 ], + "to": [ 11, 10, 10 ], + "faces": { + "down": { "uv": [ 5, 6, 11, 10 ], "texture": "#texture" }, + "up": { "uv": [ 5, 10, 11, 6 ], "texture": "#texture" }, + "north": { "uv": [ 5, 12, 11, 16 ], "texture": "#texture" }, + "south": { "uv": [ 5, 12, 11, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 12, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 12, 10, 16 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button_pressed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button_pressed.json new file mode 100644 index 0000000..40fe996 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/button_pressed.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 5, 0, 6 ], + "to": [ 11, 1, 10 ], + "faces": { + "down": { "uv": [ 5, 6, 11, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 5, 10, 11, 6 ], "texture": "#texture" }, + "north": { "uv": [ 5, 15, 11, 16 ], "texture": "#texture" }, + "south": { "uv": [ 5, 15, 11, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 15, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 15, 10, 16 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cactus.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cactus.json new file mode 100644 index 0000000..02c69f0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cactus.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cactus_side", + "bottom": "blocks/cactus_bottom", + "top": "blocks/cactus_top", + "side": "blocks/cactus_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "up" } + } + }, + { "from": [ 0, 0, 1 ], + "to": [ 16, 16, 15 ], + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 1, 0, 0 ], + "to": [ 15, 16, 16 ], + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice1.json new file mode 100644 index 0000000..9be0a85 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice1.json @@ -0,0 +1,22 @@ +{ + "textures": { + "particle": "blocks/cake_side", + "bottom": "blocks/cake_bottom", + "top": "blocks/cake_top", + "side": "blocks/cake_side", + "inside": "blocks/cake_inner" + }, + "elements": [ + { "from": [ 3, 0, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 3, 1, 15, 15 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 3, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 13, 16 ], "texture": "#side" }, + "south": { "uv": [ 1, 8, 13, 16 ], "texture": "#side" }, + "west": { "uv": [ 1, 8, 15, 16 ], "texture": "#inside" }, + "east": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice2.json new file mode 100644 index 0000000..07559eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice2.json @@ -0,0 +1,22 @@ +{ + "textures": { + "particle": "blocks/cake_side", + "bottom": "blocks/cake_bottom", + "top": "blocks/cake_top", + "side": "blocks/cake_side", + "inside": "blocks/cake_inner" + }, + "elements": [ + { "from": [ 5, 0, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 5, 1, 15, 15 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 5, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 11, 16 ], "texture": "#side" }, + "south": { "uv": [ 1, 8, 11, 16 ], "texture": "#side" }, + "west": { "uv": [ 1, 8, 15, 16 ], "texture": "#inside" }, + "east": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice3.json new file mode 100644 index 0000000..d097df5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice3.json @@ -0,0 +1,22 @@ +{ + "textures": { + "particle": "blocks/cake_side", + "bottom": "blocks/cake_bottom", + "top": "blocks/cake_top", + "side": "blocks/cake_side", + "inside": "blocks/cake_inner" + }, + "elements": [ + { "from": [ 7, 0, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 7, 1, 15, 15 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 7, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 9, 16 ], "texture": "#side" }, + "south": { "uv": [ 1, 8, 9, 16 ], "texture": "#side" }, + "west": { "uv": [ 1, 8, 15, 16 ], "texture": "#inside" }, + "east": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice4.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice4.json new file mode 100644 index 0000000..d8dff74 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice4.json @@ -0,0 +1,22 @@ +{ + "textures": { + "particle": "blocks/cake_side", + "bottom": "blocks/cake_bottom", + "top": "blocks/cake_top", + "side": "blocks/cake_side", + "inside": "blocks/cake_inner" + }, + "elements": [ + { "from": [ 9, 0, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 9, 1, 15, 15 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 9, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 7, 16 ], "texture": "#side" }, + "south": { "uv": [ 1, 8, 7, 16 ], "texture": "#side" }, + "west": { "uv": [ 1, 8, 15, 16 ], "texture": "#inside" }, + "east": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice5.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice5.json new file mode 100644 index 0000000..0f6e8af --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice5.json @@ -0,0 +1,22 @@ +{ + "textures": { + "particle": "blocks/cake_side", + "bottom": "blocks/cake_bottom", + "top": "blocks/cake_top", + "side": "blocks/cake_side", + "inside": "blocks/cake_inner" + }, + "elements": [ + { "from": [ 11, 0, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 11, 1, 15, 15 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 11, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 5, 16 ], "texture": "#side" }, + "south": { "uv": [ 1, 8, 5, 16 ], "texture": "#side" }, + "west": { "uv": [ 1, 8, 15, 16 ], "texture": "#inside" }, + "east": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice6.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice6.json new file mode 100644 index 0000000..c75940f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_slice6.json @@ -0,0 +1,22 @@ +{ + "textures": { + "particle": "blocks/cake_side", + "bottom": "blocks/cake_bottom", + "top": "blocks/cake_top", + "side": "blocks/cake_side", + "inside": "blocks/cake_inner" + }, + "elements": [ + { "from": [ 13, 0, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 13, 1, 15, 15 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 13, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 3, 16 ], "texture": "#side" }, + "south": { "uv": [ 1, 8, 3, 16 ], "texture": "#side" }, + "west": { "uv": [ 1, 8, 15, 16 ], "texture": "#inside" }, + "east": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_uneaten.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_uneaten.json new file mode 100644 index 0000000..c5b9de9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cake_uneaten.json @@ -0,0 +1,21 @@ +{ + "textures": { + "particle": "blocks/cake_side", + "bottom": "blocks/cake_bottom", + "top": "blocks/cake_top", + "side": "blocks/cake_side" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" }, + "south": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" }, + "west": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" }, + "east": { "uv": [ 1, 8, 15, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet.json new file mode 100644 index 0000000..67710a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet.json @@ -0,0 +1,15 @@ +{ + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 1, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#wool", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#wool" }, + "north": { "uv": [ 0, 15, 16, 16 ], "texture": "#wool", "cullface": "north" }, + "south": { "uv": [ 0, 15, 16, 16 ], "texture": "#wool", "cullface": "south" }, + "west": { "uv": [ 0, 15, 16, 16 ], "texture": "#wool", "cullface": "west" }, + "east": { "uv": [ 0, 15, 16, 16 ], "texture": "#wool", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_black.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_black.json new file mode 100644 index 0000000..32b0388 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_black.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_black", + "wool": "blocks/wool_colored_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_blue.json new file mode 100644 index 0000000..1b53f1b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_blue.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_blue", + "wool": "blocks/wool_colored_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_brown.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_brown.json new file mode 100644 index 0000000..7b1c74a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_brown.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_brown", + "wool": "blocks/wool_colored_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_cyan.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_cyan.json new file mode 100644 index 0000000..d5bcffc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_cyan.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_cyan", + "wool": "blocks/wool_colored_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_gray.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_gray.json new file mode 100644 index 0000000..426544f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_gray.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_gray", + "wool": "blocks/wool_colored_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_green.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_green.json new file mode 100644 index 0000000..84e8280 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_green.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_green", + "wool": "blocks/wool_colored_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_light_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_light_blue.json new file mode 100644 index 0000000..e87d04b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_light_blue.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_light_blue", + "wool": "blocks/wool_colored_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_lime.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_lime.json new file mode 100644 index 0000000..7a70b81 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_lime.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_lime", + "wool": "blocks/wool_colored_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_magenta.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_magenta.json new file mode 100644 index 0000000..25ae7f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_magenta.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_magenta", + "wool": "blocks/wool_colored_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_orange.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_orange.json new file mode 100644 index 0000000..1e01b88 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_orange.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_orange", + "wool": "blocks/wool_colored_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_pink.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_pink.json new file mode 100644 index 0000000..f7aefe7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_pink.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_pink", + "wool": "blocks/wool_colored_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_purple.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_purple.json new file mode 100644 index 0000000..01c2d6b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_purple.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_purple", + "wool": "blocks/wool_colored_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_red.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_red.json new file mode 100644 index 0000000..3a45c71 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_red.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_red", + "wool": "blocks/wool_colored_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_silver.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_silver.json new file mode 100644 index 0000000..35287d9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_silver.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_silver", + "wool": "blocks/wool_colored_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_white.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_white.json new file mode 100644 index 0000000..5b38ca7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_white.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_white", + "wool": "blocks/wool_colored_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_yellow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_yellow.json new file mode 100644 index 0000000..bf328a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carpet_yellow.json @@ -0,0 +1,7 @@ +{ + "parent": "block/carpet", + "textures": { + "particle": "blocks/wool_colored_yellow", + "wool": "blocks/wool_colored_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage0.json new file mode 100644 index 0000000..63596d4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage0.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/carrots_stage_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage1.json new file mode 100644 index 0000000..84f9742 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/carrots_stage_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage2.json new file mode 100644 index 0000000..eb17687 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/carrots_stage_2" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage3.json new file mode 100644 index 0000000..5d7dcbc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/carrots_stage3.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/carrots_stage_3" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_empty.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_empty.json new file mode 100644 index 0000000..8b084f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_empty.json @@ -0,0 +1,155 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cauldron_side", + "top": "blocks/cauldron_top", + "bottom": "blocks/cauldron_bottom", + "side": "blocks/cauldron_side", + "inside": "blocks/cauldron_inner" + }, + "elements": [ + { "from": [ 0, 3, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 2, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" } + } + }, + { "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 3, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 2 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 0, 14, 2 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "uv": [ 2, 14, 14, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 14, 14, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 0 ], + "to": [ 4, 3, 2 ], + "faces": { + "down": { "uv": [ 0, 0, 4, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 2 ], + "to": [ 2, 3, 4 ], + "faces": { + "down": { "uv": [ 0, 2, 2, 4 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 12, 0, 0 ], + "to": [ 16, 3, 2 ], + "faces": { + "down": { "uv": [ 12, 0, 16, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 2 ], + "to": [ 16, 3, 4 ], + "faces": { + "down": { "uv": [ 14, 2, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" }, + "east": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 14 ], + "to": [ 4, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 12 ], + "to": [ 2, 3, 14 ], + "faces": { + "down": { "uv": [ 12, 0, 14, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side" }, + "west": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" }, + "east": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" } + } + }, + { "from": [ 12, 0, 14 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 14, 0, 12 ], + "to": [ 16, 3, 14 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 14 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level1.json new file mode 100644 index 0000000..c929bb3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level1.json @@ -0,0 +1,162 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cauldron_side", + "top": "blocks/cauldron_top", + "bottom": "blocks/cauldron_bottom", + "side": "blocks/cauldron_side", + "inside": "blocks/cauldron_inner", + "water": "blocks/water_still" + }, + "elements": [ + { "from": [ 0, 3, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 2, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" } + } + }, + { "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 3, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 2 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 0, 14, 2 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "uv": [ 2, 14, 14, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 14, 14, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 0 ], + "to": [ 4, 3, 2 ], + "faces": { + "down": { "uv": [ 0, 0, 4, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 2 ], + "to": [ 2, 3, 4 ], + "faces": { + "down": { "uv": [ 0, 2, 2, 4 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 12, 0, 0 ], + "to": [ 16, 3, 2 ], + "faces": { + "down": { "uv": [ 12, 0, 16, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 2 ], + "to": [ 16, 3, 4 ], + "faces": { + "down": { "uv": [ 14, 2, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" }, + "east": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 14 ], + "to": [ 4, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 12 ], + "to": [ 2, 3, 14 ], + "faces": { + "down": { "uv": [ 12, 0, 14, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side" }, + "west": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" }, + "east": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" } + } + }, + { "from": [ 12, 0, 14 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 14, 0, 12 ], + "to": [ 16, 3, 14 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 14 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" } + } + }, + { "from": [ 2, 9, 2 ], + "to": [ 14, 9, 14 ], + "faces": { + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#water" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level2.json new file mode 100644 index 0000000..b486310 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level2.json @@ -0,0 +1,162 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cauldron_side", + "top": "blocks/cauldron_top", + "bottom": "blocks/cauldron_bottom", + "side": "blocks/cauldron_side", + "inside": "blocks/cauldron_inner", + "water": "blocks/water_still" + }, + "elements": [ + { "from": [ 0, 3, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 2, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" } + } + }, + { "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 3, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 2 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 0, 14, 2 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "uv": [ 2, 14, 14, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 14, 14, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 0 ], + "to": [ 4, 3, 2 ], + "faces": { + "down": { "uv": [ 0, 0, 4, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 2 ], + "to": [ 2, 3, 4 ], + "faces": { + "down": { "uv": [ 0, 2, 2, 4 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 12, 0, 0 ], + "to": [ 16, 3, 2 ], + "faces": { + "down": { "uv": [ 12, 0, 16, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 2 ], + "to": [ 16, 3, 4 ], + "faces": { + "down": { "uv": [ 14, 2, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" }, + "east": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 14 ], + "to": [ 4, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 12 ], + "to": [ 2, 3, 14 ], + "faces": { + "down": { "uv": [ 12, 0, 14, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side" }, + "west": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" }, + "east": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" } + } + }, + { "from": [ 12, 0, 14 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 14, 0, 12 ], + "to": [ 16, 3, 14 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 14 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" } + } + }, + { "from": [ 2, 12, 2 ], + "to": [ 14, 12, 14 ], + "faces": { + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#water" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level3.json new file mode 100644 index 0000000..841621b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cauldron_level3.json @@ -0,0 +1,162 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cauldron_side", + "top": "blocks/cauldron_top", + "bottom": "blocks/cauldron_bottom", + "side": "blocks/cauldron_side", + "inside": "blocks/cauldron_inner", + "water": "blocks/water_still" + }, + "elements": [ + { "from": [ 0, 3, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 2, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" } + } + }, + { "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#inside", "cullface": "up" }, + "north": { "uv": [ 2, 0, 0, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 3, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 13 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 2 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 0, 14, 2 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 2, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 2, 3, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "uv": [ 2, 14, 14, 16 ], "texture": "#inside", "cullface": "down" }, + "up": { "uv": [ 2, 14, 14, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 0, 14, 13 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 13 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 14, 0, 16, 13 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 0 ], + "to": [ 4, 3, 2 ], + "faces": { + "down": { "uv": [ 0, 0, 4, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 2 ], + "to": [ 2, 3, 4 ], + "faces": { + "down": { "uv": [ 0, 2, 2, 4 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 2, 13, 4, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 12, 0, 0 ], + "to": [ 16, 3, 2 ], + "faces": { + "down": { "uv": [ 12, 0, 16, 2 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 13, 2, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 14, 0, 2 ], + "to": [ 16, 3, 4 ], + "faces": { + "down": { "uv": [ 14, 2, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" }, + "east": { "uv": [ 4, 13, 2, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 14 ], + "to": [ 4, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 4, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 4, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 0, 0, 12 ], + "to": [ 2, 3, 14 ], + "faces": { + "down": { "uv": [ 12, 0, 14, 4 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 2, 13, 0, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 13, 2, 16 ], "texture": "#side" }, + "west": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" }, + "east": { "uv": [ 12, 13, 14, 16 ], "texture": "#side" } + } + }, + { "from": [ 12, 0, 14 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 12, 16 ], "texture": "#side" }, + "south": { "uv": [ 12, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 14, 0, 12 ], + "to": [ 16, 3, 14 ], + "faces": { + "down": { "uv": [ 14, 12, 16, 14 ], "texture": "#bottom" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 16, 13, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 14, 13, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" }, + "east": { "uv": [ 14, 13, 12, 16 ], "texture": "#side" } + } + }, + { "from": [ 2, 15, 2 ], + "to": [ 14, 15, 14 ], + "faces": { + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#water" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/clay.json new file mode 100644 index 0000000..a1d68d5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/clay.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/clay" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coal_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coal_block.json new file mode 100644 index 0000000..4760fd9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coal_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/coal_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coal_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coal_ore.json new file mode 100644 index 0000000..a475352 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coal_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/coal_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coarse_dirt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coarse_dirt.json new file mode 100644 index 0000000..8badd3f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/coarse_dirt.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/coarse_dirt" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone.json new file mode 100644 index 0000000..5b3a489 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_inventory.json new file mode 100644 index 0000000..079cb13 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_inventory", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_mossy_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_mossy_inventory.json new file mode 100644 index 0000000..f5f126f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_mossy_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_inventory", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_n.json new file mode 100644 index 0000000..2b04bb1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_n", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ne.json new file mode 100644 index 0000000..56ae774 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_ne", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ns.json new file mode 100644 index 0000000..ba0495e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_ns", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ns_above.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ns_above.json new file mode 100644 index 0000000..c320ef8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_ns_above.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_ns_above", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_nse.json new file mode 100644 index 0000000..d2baeff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_nse", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_nsew.json new file mode 100644 index 0000000..d09ac04 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_nsew", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_post.json new file mode 100644 index 0000000..6b3069b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cobblestone_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_post", + "textures": { + "wall": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age0_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age0_s.json new file mode 100644 index 0000000..2e8804e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age0_s.json @@ -0,0 +1,27 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cocoa_stage_0", + "cocoa": "blocks/cocoa_stage_0" + }, + "elements": [ + { "from": [ 6, 7, 11 ], + "to": [ 10, 12, 15 ], + "faces": { + "down": { "uv": [ 0, 0, 4, 4 ], "texture": "#cocoa" }, + "up": { "uv": [ 0, 0, 4, 4 ], "texture": "#cocoa" }, + "north": { "uv": [ 11, 4, 15, 9 ], "texture": "#cocoa" }, + "south": { "uv": [ 11, 4, 15, 9 ], "texture": "#cocoa" }, + "west": { "uv": [ 11, 4, 15, 9 ], "texture": "#cocoa" }, + "east": { "uv": [ 11, 4, 15, 9 ], "texture": "#cocoa" } + } + }, + { "from": [ 8, 12, 12 ], + "to": [ 8, 16, 16 ], + "faces": { + "west": { "uv": [ 12, 0, 16, 4 ], "texture": "#cocoa" }, + "east": { "uv": [ 16, 0, 12, 4 ], "texture": "#cocoa" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age1_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age1_s.json new file mode 100644 index 0000000..05e8c8e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age1_s.json @@ -0,0 +1,27 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cocoa_stage_1", + "cocoa": "blocks/cocoa_stage_1" + }, + "elements": [ + { "from": [ 5, 5, 9 ], + "to": [ 11, 12, 15 ], + "faces": { + "down": { "uv": [ 0, 0, 6, 6 ], "texture": "#cocoa" }, + "up": { "uv": [ 0, 0, 6, 6 ], "texture": "#cocoa" }, + "north": { "uv": [ 9, 4, 15, 11 ], "texture": "#cocoa" }, + "south": { "uv": [ 9, 4, 15, 11 ], "texture": "#cocoa" }, + "west": { "uv": [ 9, 4, 15, 11 ], "texture": "#cocoa" }, + "east": { "uv": [ 9, 4, 15, 11 ], "texture": "#cocoa" } + } + }, + { "from": [ 8, 12, 12 ], + "to": [ 8, 16, 16 ], + "faces": { + "west": { "uv": [ 12, 0, 16, 4 ], "texture": "#cocoa" }, + "east": { "uv": [ 16, 0, 12, 4 ], "texture": "#cocoa" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age2_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age2_s.json new file mode 100644 index 0000000..d9b70ce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cocoa_age2_s.json @@ -0,0 +1,27 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cocoa_stage_2", + "cocoa": "blocks/cocoa_stage_2" + }, + "elements": [ + { "from": [ 4, 3, 7 ], + "to": [ 12, 12, 15 ], + "faces": { + "down": { "uv": [ 0, 0, 7, 7 ], "texture": "#cocoa" }, + "up": { "uv": [ 0, 0, 7, 7 ], "texture": "#cocoa" }, + "north": { "uv": [ 7, 4, 15, 13 ], "texture": "#cocoa" }, + "south": { "uv": [ 7, 4, 15, 13 ], "texture": "#cocoa" }, + "west": { "uv": [ 7, 4, 15, 13 ], "texture": "#cocoa" }, + "east": { "uv": [ 7, 4, 15, 13 ], "texture": "#cocoa" } + } + }, + { "from": [ 8, 12, 12 ], + "to": [ 8, 16, 16 ], + "faces": { + "west": { "uv": [ 12, 0, 16, 4 ], "texture": "#cocoa" }, + "east": { "uv": [ 16, 0, 12, 4 ], "texture": "#cocoa" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/column_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/column_side.json new file mode 100644 index 0000000..1a7f9e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/column_side.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#end", "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#end", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "west", "rotation": 270 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "east", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/command_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/command_block.json new file mode 100644 index 0000000..7eae209 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/command_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/command_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_lit.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_lit.json new file mode 100644 index 0000000..bc1ed81 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_lit.json @@ -0,0 +1,74 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/comparator_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/comparator_on", + "unlit": "blocks/redstone_torch_off", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 4, 7, 11 ], + "to": [ 6, 7, 13 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 4, 2, 10 ], + "to": [ 6, 8, 14 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 3, 2, 11 ], + "to": [ 7, 8, 13 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 10, 7, 11 ], + "to": [ 12, 7, 13 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 10, 2, 10 ], + "to": [ 12, 8, 14 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 9, 2, 11 ], + "to": [ 13, 8, 13 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 4, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_lit_subtract.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_lit_subtract.json new file mode 100644 index 0000000..e55921f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_lit_subtract.json @@ -0,0 +1,83 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/comparator_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/comparator_on", + "unlit": "blocks/redstone_torch_off", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 4, 7, 11 ], + "to": [ 6, 7, 13 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 4, 2, 10 ], + "to": [ 6, 8, 14 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 3, 2, 11 ], + "to": [ 7, 8, 13 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 10, 7, 11 ], + "to": [ 12, 7, 13 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 10, 2, 10 ], + "to": [ 12, 8, 14 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 9, 2, 11 ], + "to": [ 13, 8, 13 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 7, 5, 2 ], + "to": [ 9, 5, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 6, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 6, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_unlit.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_unlit.json new file mode 100644 index 0000000..7da6397 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_unlit.json @@ -0,0 +1,56 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/comparator_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/comparator_off", + "unlit": "blocks/redstone_torch_off", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 4, 2, 11 ], + "to": [ 6, 7, 13 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 10, 2, 11 ], + "to": [ 12, 7, 13 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 4, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_unlit_subtract.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_unlit_subtract.json new file mode 100644 index 0000000..bb0c4ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/comparator_unlit_subtract.json @@ -0,0 +1,65 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/comparator_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/comparator_off", + "unlit": "blocks/redstone_torch_off", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 4, 2, 11 ], + "to": [ 6, 7, 13 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 10, 2, 11 ], + "to": [ 12, 7, 13 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 7, 5, 2 ], + "to": [ 9, 5, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 6, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 6, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 9 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/crafting_table.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/crafting_table.json new file mode 100644 index 0000000..2ec0068 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/crafting_table.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/crafting_table_front", + "down": "blocks/planks_oak", + "up": "blocks/crafting_table_top", + "north": "blocks/crafting_table_front", + "east": "blocks/crafting_table_side", + "south": "blocks/crafting_table_side", + "west": "blocks/crafting_table_front" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/crop.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/crop.json new file mode 100644 index 0000000..9cc479e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/crop.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#crop" + }, + "elements": [ + { "from": [ 4, -1, 0 ], + "to": [ 4, 15, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" } + } + }, + { "from": [ 12, -1, 0 ], + "to": [ 12, 15, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" } + } + }, + { "from": [ 0, -1, 4 ], + "to": [ 16, 15, 4 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" } + } + }, + { "from": [ 0, -1, 12 ], + "to": [ 16, 15, 12 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cross.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cross.json new file mode 100644 index 0000000..37c8b09 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cross.json @@ -0,0 +1,26 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#cross" + }, + "elements": [ + { "from": [ 0.8, 0, 8 ], + "to": [ 15.2, 16, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" } + } + }, + { "from": [ 8, 0, 0.8 ], + "to": [ 8, 16, 15.2 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube.json new file mode 100644 index 0000000..e44c18e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube.json @@ -0,0 +1,15 @@ +{ + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#down", "cullface": "down" }, + "up": { "texture": "#up", "cullface": "up" }, + "north": { "texture": "#north", "cullface": "north" }, + "south": { "texture": "#south", "cullface": "south" }, + "west": { "texture": "#west", "cullface": "west" }, + "east": { "texture": "#east", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_all.json new file mode 100644 index 0000000..fa2f9e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_all.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "#all", + "down": "#all", + "up": "#all", + "north": "#all", + "east": "#all", + "south": "#all", + "west": "#all" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_bottom_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_bottom_top.json new file mode 100644 index 0000000..4c61059 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_bottom_top.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "#side", + "down": "#bottom", + "up": "#top", + "north": "#side", + "east": "#side", + "south": "#side", + "west": "#side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_column.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_column.json new file mode 100644 index 0000000..358b984 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_column.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "#side", + "down": "#end", + "up": "#end", + "north": "#side", + "east": "#side", + "south": "#side", + "west": "#side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_mirrored.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_mirrored.json new file mode 100644 index 0000000..38f44bd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_mirrored.json @@ -0,0 +1,15 @@ +{ + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [16, 0, 0, 16], "texture": "#down", "cullface": "down" }, + "up": { "uv": [16, 0, 0, 16], "texture": "#up", "cullface": "up" }, + "north": { "uv": [16, 0, 0, 16], "texture": "#north", "cullface": "north" }, + "south": { "uv": [16, 0, 0, 16], "texture": "#south", "cullface": "south" }, + "west": { "uv": [16, 0, 0, 16], "texture": "#west", "cullface": "west" }, + "east": { "uv": [16, 0, 0, 16], "texture": "#east", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_mirrored_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_mirrored_all.json new file mode 100644 index 0000000..75743f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_mirrored_all.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube_mirrored", + "textures": { + "particle": "#all", + "down": "#all", + "up": "#all", + "north": "#all", + "east": "#all", + "south": "#all", + "west": "#all" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_top.json new file mode 100644 index 0000000..a0c1d56 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cube_top.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "#side", + "down": "#side", + "up": "#top", + "north": "#side", + "east": "#side", + "south": "#side", + "west": "#side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_n.json new file mode 100644 index 0000000..7dae5c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_ne.json new file mode 100644 index 0000000..90e59ce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_new.json new file mode 100644 index 0000000..58660f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_ns.json new file mode 100644 index 0000000..28dfa29 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nse.json new file mode 100644 index 0000000..8d7ba7c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nsew.json new file mode 100644 index 0000000..f9b53ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nsw.json new file mode 100644 index 0000000..40e4f03 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nw.json new file mode 100644 index 0000000..d318598 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_s.json new file mode 100644 index 0000000..e1c2c6b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_se.json new file mode 100644 index 0000000..c47ba25 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_sew.json new file mode 100644 index 0000000..8d936dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_sw.json new file mode 100644 index 0000000..2855ff5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_cyan", + "pane": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_wool.json new file mode 100644 index 0000000..c1ac12d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/cyan_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daisy.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daisy.json new file mode 100644 index 0000000..47700f1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daisy.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_oxeye_daisy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dandelion.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dandelion.json new file mode 100644 index 0000000..8ffa73a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dandelion.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_dandelion" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_bark.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_bark.json new file mode 100644 index 0000000..e846895 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/log_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_bottom.json new file mode 100644 index 0000000..04d487d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_dark_oak_lower", + "top": "blocks/door_dark_oak_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_bottom_rh.json new file mode 100644 index 0000000..ea602e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_dark_oak_lower", + "top": "blocks/door_dark_oak_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_top.json new file mode 100644 index 0000000..2b45279 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_dark_oak_lower", + "top": "blocks/door_dark_oak_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_top_rh.json new file mode 100644 index 0000000..5e84e95 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_door_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_dark_oak_lower", + "top": "blocks/door_dark_oak_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_gate_closed.json new file mode 100644 index 0000000..ab54a5f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_gate_open.json new file mode 100644 index 0000000..4ac9881 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_inventory.json new file mode 100644 index 0000000..072aaf1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_n.json new file mode 100644 index 0000000..61c6ac6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_n", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_ne.json new file mode 100644 index 0000000..2c328c9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ne", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_ns.json new file mode 100644 index 0000000..a3b2149 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ns", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_nse.json new file mode 100644 index 0000000..b2172fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nse", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_nsew.json new file mode 100644 index 0000000..f927c64 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nsew", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_post.json new file mode 100644 index 0000000..71a7090 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_inner_stairs.json new file mode 100644 index 0000000..0abd3b6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/planks_big_oak", + "top": "blocks/planks_big_oak", + "side": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_leaves.json new file mode 100644 index 0000000..d92b1ac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "blocks/leaves_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_log.json new file mode 100644 index 0000000..c7e3cf3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_log.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/log_big_oak_top", + "side": "blocks/log_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_log_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_log_side.json new file mode 100644 index 0000000..2bd469f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_log_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "blocks/log_big_oak_top", + "side": "blocks/log_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_outer_stairs.json new file mode 100644 index 0000000..94bf157 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/planks_big_oak", + "top": "blocks/planks_big_oak", + "side": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_planks.json new file mode 100644 index 0000000..b04a1a5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_sapling.json new file mode 100644 index 0000000..e9b70d5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/sapling_roofed_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_stairs.json new file mode 100644 index 0000000..2d7a286 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/planks_big_oak", + "top": "blocks/planks_big_oak", + "side": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_wall_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_wall_gate_closed.json new file mode 100644 index 0000000..479bb4b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_wall_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_wall_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_wall_gate_open.json new file mode 100644 index 0000000..a04668b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dark_oak_wall_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daylight_detector.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daylight_detector.json new file mode 100644 index 0000000..1d29482 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daylight_detector.json @@ -0,0 +1,20 @@ +{ + "textures": { + "particle": "blocks/daylight_detector_top", + "top": "blocks/daylight_detector_top", + "side": "blocks/daylight_detector_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daylight_detector_inverted.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daylight_detector_inverted.json new file mode 100644 index 0000000..769d9d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/daylight_detector_inverted.json @@ -0,0 +1,20 @@ +{ + "textures": { + "particle": "blocks/daylight_detector_inverted_top", + "top": "blocks/daylight_detector_inverted_top", + "side": "blocks/daylight_detector_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dead_bush.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dead_bush.json new file mode 100644 index 0000000..5aee4f4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dead_bush.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/deadbush" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_flat.json new file mode 100644 index 0000000..363009d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_flat.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "blocks/rail_detector" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_flat.json new file mode 100644 index 0000000..d1c4414 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_flat.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "blocks/rail_detector_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_raised_ne.json new file mode 100644 index 0000000..b6dd186 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_ne", + "textures": { + "rail": "blocks/rail_detector_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_raised_sw.json new file mode 100644 index 0000000..077566e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_powered_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_sw", + "textures": { + "rail": "blocks/rail_detector_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_raised_ne.json new file mode 100644 index 0000000..1f8b457 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_ne", + "textures": { + "rail": "blocks/rail_detector" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_raised_sw.json new file mode 100644 index 0000000..9d520eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/detector_rail_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_sw", + "textures": { + "rail": "blocks/rail_detector" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diamond_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diamond_block.json new file mode 100644 index 0000000..5234ebd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diamond_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/diamond_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diamond_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diamond_ore.json new file mode 100644 index 0000000..d1c996f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diamond_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/diamond_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diorite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diorite.json new file mode 100644 index 0000000..4c0d48b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diorite.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone_diorite" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diorite_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diorite_smooth.json new file mode 100644 index 0000000..7bb78d5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/diorite_smooth.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone_diorite_smooth" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dirt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dirt.json new file mode 100644 index 0000000..5d1c7b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dirt.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/dirt" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dispenser.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dispenser.json new file mode 100644 index 0000000..453c6ce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dispenser.json @@ -0,0 +1,8 @@ +{ + "parent": "block/orientable", + "textures": { + "top": "blocks/furnace_top", + "front": "blocks/dispenser_front_horizontal", + "side": "blocks/furnace_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dispenser_vertical.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dispenser_vertical.json new file mode 100644 index 0000000..978f660 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dispenser_vertical.json @@ -0,0 +1,7 @@ +{ + "parent": "block/orientable_vertical", + "textures": { + "front": "blocks/dispenser_front_vertical", + "side": "blocks/furnace_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_bottom.json new file mode 100644 index 0000000..905758f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_bottom.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#bottom" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "down": { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#bottom", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#bottom", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "west" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#bottom" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_bottom_rh.json new file mode 100644 index 0000000..26acf4c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_bottom_rh.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#bottom" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "down": { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#bottom", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#bottom", "cullface": "south" }, + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#bottom", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_top.json new file mode 100644 index 0000000..809fa44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_top.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#top" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "up": { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "up" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#top", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#top", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "west" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#top" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_top_rh.json new file mode 100644 index 0000000..e7d2f93 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/door_top_rh.json @@ -0,0 +1,18 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#top" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 3, 16, 16 ], + "faces": { + "up": { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "up" }, + "north": { "uv": [ 3, 0, 0, 16 ], "texture": "#top", "cullface": "north" }, + "south": { "uv": [ 0, 0, 3, 16 ], "texture": "#top", "cullface": "south" }, + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#top", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_fern_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_fern_bottom.json new file mode 100644 index 0000000..c560b72 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_fern_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/tallgrass", + "textures": { + "cross": "blocks/double_plant_fern_bottom" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_fern_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_fern_top.json new file mode 100644 index 0000000..babcfce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_fern_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/tallgrass", + "textures": { + "cross": "blocks/double_plant_fern_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_grass_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_grass_bottom.json new file mode 100644 index 0000000..fad54d6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_grass_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/tallgrass", + "textures": { + "cross": "blocks/double_plant_grass_bottom" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_grass_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_grass_top.json new file mode 100644 index 0000000..7bbee32 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_grass_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/tallgrass", + "textures": { + "cross": "blocks/double_plant_grass_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_paeonia_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_paeonia_bottom.json new file mode 100644 index 0000000..01e35b3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_paeonia_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/double_plant_paeonia_bottom" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_paeonia_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_paeonia_top.json new file mode 100644 index 0000000..8023494 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_paeonia_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/double_plant_paeonia_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_rose_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_rose_bottom.json new file mode 100644 index 0000000..8407de0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_rose_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/double_plant_rose_bottom" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_rose_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_rose_top.json new file mode 100644 index 0000000..1601c3b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_rose_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/double_plant_rose_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_stone.json new file mode 100644 index 0000000..ce3fd92 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_stone.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/stone_slab_top", + "side": "blocks/stone_slab_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_stone_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_stone_top.json new file mode 100644 index 0000000..0cb25a8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_stone_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone_slab_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_sunflower_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_sunflower_bottom.json new file mode 100644 index 0000000..0caa997 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_sunflower_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/double_plant_sunflower_bottom" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_sunflower_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_sunflower_top.json new file mode 100644 index 0000000..a0df09c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_sunflower_top.json @@ -0,0 +1,53 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/double_plant_sunflower_front", + "cross": "blocks/double_plant_sunflower_top", + "back": "blocks/double_plant_sunflower_back", + "front": "blocks/double_plant_sunflower_front" + }, + "elements": [ + { "from": [ 0.8, 0, 8 ], + "to": [ 15.2, 8, 8 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#cross" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#cross" } + } + }, + { "from": [ 8, 0, 0.8 ], + "to": [ 8, 8, 15.2 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "y", + "angle": 45, + "rescale": true + }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#cross" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#cross" } + } + }, + { "from": [ 9.6, -1, 1 ], + "to": [ 9.6, 15, 15 ], + "rotation": { + "origin": [ 8, 8, 8 ], + "axis": "z", + "angle": 22.5, + "rescale": true + }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#back" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#front" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_syringa_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_syringa_bottom.json new file mode 100644 index 0000000..aa72e58 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_syringa_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/double_plant_syringa_bottom" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_syringa_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_syringa_top.json new file mode 100644 index 0000000..d173954 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/double_syringa_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/double_plant_syringa_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dragon_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dragon_egg.json new file mode 100644 index 0000000..15eb225 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dragon_egg.json @@ -0,0 +1,97 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/dragon_egg", + "all": "blocks/dragon_egg" + }, + "elements": [ + { "from": [ 6, 15, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#all" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#all" }, + "north": { "uv": [ 6, 15, 10, 16 ], "texture": "#all" }, + "south": { "uv": [ 6, 15, 10, 16 ], "texture": "#all" }, + "west": { "uv": [ 6, 15, 10, 16 ], "texture": "#all" }, + "east": { "uv": [ 6, 15, 10, 16 ], "texture": "#all" } + } + }, + { "from": [ 5, 14, 5 ], + "to": [ 11, 15, 11 ], + "faces": { + "down": { "uv": [ 5, 5, 11, 11 ], "texture": "#all" }, + "up": { "uv": [ 5, 5, 11, 11 ], "texture": "#all" }, + "north": { "uv": [ 5, 14, 11, 15 ], "texture": "#all" }, + "south": { "uv": [ 5, 14, 11, 15 ], "texture": "#all" }, + "west": { "uv": [ 5, 14, 11, 15 ], "texture": "#all" }, + "east": { "uv": [ 5, 14, 11, 15 ], "texture": "#all" } + } + }, + { "from": [ 5, 13, 5 ], + "to": [ 11, 14, 11 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#all" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#all" }, + "north": { "uv": [ 4, 13, 12, 14 ], "texture": "#all" }, + "south": { "uv": [ 4, 13, 12, 14 ], "texture": "#all" }, + "west": { "uv": [ 4, 13, 12, 14 ], "texture": "#all" }, + "east": { "uv": [ 4, 13, 12, 14 ], "texture": "#all" } + } + }, + { "from": [ 3, 11, 3 ], + "to": [ 13, 13, 13 ], + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#all" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#all" }, + "north": { "uv": [ 3, 11, 13, 13 ], "texture": "#all" }, + "south": { "uv": [ 3, 11, 13, 13 ], "texture": "#all" }, + "west": { "uv": [ 3, 11, 13, 13 ], "texture": "#all" }, + "east": { "uv": [ 3, 11, 13, 13 ], "texture": "#all" } + } + }, + { "from": [ 2, 8, 2 ], + "to": [ 14, 11, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#all" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#all" }, + "north": { "uv": [ 2, 8, 14, 11 ], "texture": "#all" }, + "south": { "uv": [ 2, 8, 14, 11 ], "texture": "#all" }, + "west": { "uv": [ 2, 8, 14, 11 ], "texture": "#all" }, + "east": { "uv": [ 2, 8, 14, 11 ], "texture": "#all" } + } + }, + { "from": [ 1, 3, 1 ], + "to": [ 15, 8, 15 ], + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#all" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#all" }, + "north": { "uv": [ 1, 3, 15, 8 ], "texture": "#all" }, + "south": { "uv": [ 1, 3, 15, 8 ], "texture": "#all" }, + "west": { "uv": [ 1, 3, 15, 8 ], "texture": "#all" }, + "east": { "uv": [ 1, 3, 15, 8 ], "texture": "#all" } + } + }, + { "from": [ 2, 1, 2 ], + "to": [ 14, 3, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#all" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#all" }, + "north": { "uv": [ 2, 1, 14, 3 ], "texture": "#all" }, + "south": { "uv": [ 2, 1, 14, 3 ], "texture": "#all" }, + "west": { "uv": [ 2, 1, 14, 3 ], "texture": "#all" }, + "east": { "uv": [ 2, 1, 14, 3 ], "texture": "#all" } + } + }, + { "from": [ 3, 0, 3 ], + "to": [ 13, 1, 13 ], + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#all" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#all" }, + "north": { "uv": [ 3, 0, 13, 1 ], "texture": "#all" }, + "south": { "uv": [ 3, 0, 13, 1 ], "texture": "#all" }, + "west": { "uv": [ 3, 0, 13, 1 ], "texture": "#all" }, + "east": { "uv": [ 3, 0, 13, 1 ], "texture": "#all" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dropper.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dropper.json new file mode 100644 index 0000000..3b6e09e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dropper.json @@ -0,0 +1,8 @@ +{ + "parent": "block/orientable", + "textures": { + "top": "blocks/furnace_top", + "front": "blocks/dropper_front_horizontal", + "side": "blocks/furnace_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dropper_vertical.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dropper_vertical.json new file mode 100644 index 0000000..bf763e0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/dropper_vertical.json @@ -0,0 +1,7 @@ +{ + "parent": "block/orientable_vertical", + "textures": { + "front": "blocks/dropper_front_vertical", + "side": "blocks/furnace_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/emerald_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/emerald_block.json new file mode 100644 index 0000000..b58a988 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/emerald_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/emerald_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/emerald_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/emerald_ore.json new file mode 100644 index 0000000..32347f3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/emerald_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/emerald_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/enchanting_table_base.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/enchanting_table_base.json new file mode 100644 index 0000000..f355f4b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/enchanting_table_base.json @@ -0,0 +1,21 @@ +{ + "textures": { + "particle": "blocks/enchanting_table_bottom", + "bottom": "blocks/enchanting_table_bottom", + "top": "blocks/enchanting_table_top", + "side": "blocks/enchanting_table_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 12, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_portal_frame_empty.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_portal_frame_empty.json new file mode 100644 index 0000000..b7130c6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_portal_frame_empty.json @@ -0,0 +1,21 @@ +{ + "textures": { + "particle": "blocks/endframe_side", + "bottom": "blocks/end_stone", + "top": "blocks/endframe_top", + "side": "blocks/endframe_side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 13, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_portal_frame_filled.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_portal_frame_filled.json new file mode 100644 index 0000000..778afa3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_portal_frame_filled.json @@ -0,0 +1,33 @@ +{ + "textures": { + "particle": "blocks/endframe_side", + "bottom": "blocks/end_stone", + "top": "blocks/endframe_top", + "side": "blocks/endframe_side", + "eye": "blocks/endframe_eye" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 13, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 0, 3, 16, 16 ], "texture": "#side" } + } + }, + { "from": [ 4, 13, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#eye" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#eye" }, + "north": { "uv": [ 4, 0, 12, 3 ], "texture": "#eye" }, + "south": { "uv": [ 4, 0, 12, 3 ], "texture": "#eye" }, + "west": { "uv": [ 4, 0, 12, 3 ], "texture": "#eye" }, + "east": { "uv": [ 4, 0, 12, 3 ], "texture": "#eye" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_stone.json new file mode 100644 index 0000000..a66a632 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/end_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/end_stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland.json new file mode 100644 index 0000000..1033809 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland.json @@ -0,0 +1,15 @@ +{ + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 15, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#dirt", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 1, 16, 16 ], "texture": "#dirt", "cullface": "north" }, + "south": { "uv": [ 0, 1, 16, 16 ], "texture": "#dirt", "cullface": "south" }, + "west": { "uv": [ 0, 1, 16, 16 ], "texture": "#dirt", "cullface": "west" }, + "east": { "uv": [ 0, 1, 16, 16 ], "texture": "#dirt", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland_dry.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland_dry.json new file mode 100644 index 0000000..94e31eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland_dry.json @@ -0,0 +1,8 @@ +{ + "parent": "block/farmland", + "textures": { + "particle": "blocks/dirt", + "dirt": "blocks/dirt", + "top": "blocks/farmland_dry" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland_moist.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland_moist.json new file mode 100644 index 0000000..a1cda53 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/farmland_moist.json @@ -0,0 +1,8 @@ +{ + "parent": "block/farmland", + "textures": { + "particle": "blocks/dirt", + "dirt": "blocks/dirt", + "top": "blocks/farmland_wet" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_gate_closed.json new file mode 100644 index 0000000..73c4d00 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_gate_closed.json @@ -0,0 +1,95 @@ +{ + "textures": { + "particle" : "#texture" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 5, 7 ], + "to": [ 2, 16, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 5, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 6, 6, 7 ], + "to": [ 8, 15, 9 ], + "faces": { + "down": { "uv": [ 6, 7, 8, 9 ], "texture": "#texture" }, + "up": { "uv": [ 6, 7, 8, 9 ], "texture": "#texture" }, + "north": { "uv": [ 6, 1, 8, 10 ], "texture": "#texture" }, + "south": { "uv": [ 6, 1, 8, 10 ], "texture": "#texture" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 8, 6, 7 ], + "to": [ 10, 15, 9 ], + "faces": { + "down": { "uv": [ 8, 7, 10, 9 ], "texture": "#texture" }, + "up": { "uv": [ 8, 7, 10, 9 ], "texture": "#texture" }, + "north": { "uv": [ 8, 1, 10, 10 ], "texture": "#texture" }, + "south": { "uv": [ 8, 1, 10, 10 ], "texture": "#texture" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 2, 6, 7 ], + "to": [ 6, 9, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "north": { "uv": [ 2, 7, 6, 10 ], "texture": "#texture" }, + "south": { "uv": [ 2, 7, 6, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 2, 12, 7 ], + "to": [ 6, 15, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "north": { "uv": [ 2, 1, 6, 4 ], "texture": "#texture" }, + "south": { "uv": [ 2, 1, 6, 4 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of right-hand gate door", + "from": [ 10, 6, 7 ], + "to": [ 14, 9, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "north": { "uv": [ 10, 7, 14, 10 ], "texture": "#texture" }, + "south": { "uv": [ 10, 7, 14, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of right-hand gate door", + "from": [ 10, 12, 7 ], + "to": [ 14, 15, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "north": { "uv": [ 10, 1, 14, 4 ], "texture": "#texture" }, + "south": { "uv": [ 10, 1, 14, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_gate_open.json new file mode 100644 index 0000000..9e7baf9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_gate_open.json @@ -0,0 +1,95 @@ +{ + "textures": { + "particle" : "#texture" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 5, 7 ], + "to": [ 2, 16, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 5, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 0, 6, 13 ], + "to": [ 2, 15, 15 ], + "faces": { + "down": { "uv": [ 0, 13, 2, 15 ], "texture": "#texture" }, + "up": { "uv": [ 0, 13, 2, 15 ], "texture": "#texture" }, + "north": { "uv": [ 0, 1, 2, 10 ], "texture": "#texture" }, + "south": { "uv": [ 0, 1, 2, 10 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 14, 6, 13 ], + "to": [ 16, 15, 15 ], + "faces": { + "down": { "uv": [ 14, 13, 16, 15 ], "texture": "#texture" }, + "up": { "uv": [ 14, 13, 16, 15 ], "texture": "#texture" }, + "north": { "uv": [ 14, 1, 16, 10 ], "texture": "#texture" }, + "south": { "uv": [ 14, 1, 16, 10 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 0, 6, 9 ], + "to": [ 2, 9, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 0, 12, 9 ], + "to": [ 2, 15, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 14, 6, 9 ], + "to": [ 16, 9, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 14, 12, 9 ], + "to": [ 16, 15, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_inventory.json new file mode 100644 index 0000000..18943d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_inventory.json @@ -0,0 +1,56 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 6, 0, 0 ], + "to": [ 10, 16, 4 ], + "faces": { + "down": { "uv": [ 6, 0, 10, 4 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 0, 10, 4 ], "texture": "#texture" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 4, 16 ], "texture": "#texture" } + }, + "__comment": "Left post" + }, + { "from": [ 6, 0, 12 ], + "to": [ 10, 16, 16 ], + "faces": { + "down": { "uv": [ 6, 12, 10, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 12, 10, 16 ], "texture": "#texture" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 12, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 12, 0, 16, 16 ], "texture": "#texture" } + }, + "__comment": "Right post" + }, + { "from": [ 7, 13, -2 ], + "to": [ 9, 15, 18 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 9, 3 ], "texture": "#texture" }, + "south": { "uv": [ 7, 1, 9, 3 ], "texture": "#texture" }, + "west": { "uv": [ 0, 1, 16, 3 ], "texture": "#texture" }, + "east": { "uv": [ 0, 1, 16, 3 ], "texture": "#texture" } + }, + "__comment": "Top bar" + }, + { "from": [ 7, 5, -2 ], + "to": [ 9, 7, 18 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 9, 9, 11 ], "texture": "#texture" }, + "south": { "uv": [ 7, 9, 9, 11 ], "texture": "#texture" }, + "west": { "uv": [ 0, 9, 16, 11 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 11 ], "texture": "#texture" } + }, + "__comment": "Lower bar" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_n.json new file mode 100644 index 0000000..f03a6a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_n.json @@ -0,0 +1,41 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 6, 0, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" } + }, + "__comment": "Center post" + }, + { "from": [ 7, 12, 0 ], + "to": [ 9, 15, 9 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "north" }, + "west": { "uv": [ 0, 1, 9, 4 ], "texture": "#texture" }, + "east": { "uv": [ 0, 1, 9, 4 ], "texture": "#texture" } + }, + "__comment": "North top bar" + }, + { "from": [ 7, 6, 0 ], + "to": [ 9, 9, 9 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "north" }, + "west": { "uv": [ 0, 7, 9, 10 ], "texture": "#texture" }, + "east": { "uv": [ 0, 7, 9, 10 ], "texture": "#texture" } + }, + "__comment": "North lower bar" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_ne.json new file mode 100644 index 0000000..299df23 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_ne.json @@ -0,0 +1,63 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 6, 0, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" } + }, + "__comment": "Center post" + }, + { "from": [ 7, 12, 0 ], + "to": [ 9, 15, 9 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "north" }, + "west": { "uv": [ 0, 1, 9, 4 ], "texture": "#texture" }, + "east": { "uv": [ 0, 1, 9, 4 ], "texture": "#texture" } + }, + "__comment": "North top bar" + }, + { "from": [ 7, 6, 0 ], + "to": [ 9, 9, 9 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "north" }, + "west": { "uv": [ 0, 7, 9, 10 ], "texture": "#texture" }, + "east": { "uv": [ 0, 7, 9, 10 ], "texture": "#texture" } + }, + "__comment": "North lower bar" + }, + { "from": [ 7, 12, 7 ], + "to": [ 16, 15, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 16, 4 ], "texture": "#texture" }, + "south": { "uv": [ 7, 1, 16, 4 ], "texture": "#texture" }, + "east": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "east" } + }, + "__comment": "East top bar" + }, + { "from": [ 7, 6, 7 ], + "to": [ 16, 9, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 7, 16, 10 ], "texture": "#texture" }, + "south": { "uv": [ 7, 7, 16, 10 ], "texture": "#texture" }, + "east": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "east" } + }, + "__comment": "East lower bar" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_ns.json new file mode 100644 index 0000000..7392eac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_ns.json @@ -0,0 +1,43 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 6, 0, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" } + }, + "__comment": "Center post" + }, + { "from": [ 7, 12, 0 ], + "to": [ 9, 15, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" }, + "east": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" } + }, + "__comment": "North-south top bar" + }, + { "from": [ 7, 6, 0 ], + "to": [ 9, 9, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" }, + "east": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" } + }, + "__comment": "North-south lower bar" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_nse.json new file mode 100644 index 0000000..b80b1e3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_nse.json @@ -0,0 +1,65 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 6, 0, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" } + }, + "__comment": "Center post" + }, + { "from": [ 7, 12, 0 ], + "to": [ 9, 15, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" }, + "east": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" } + }, + "__comment": "North-south top bar" + }, + { "from": [ 7, 6, 0 ], + "to": [ 9, 9, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" }, + "east": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" } + }, + "__comment": "North-south lower bar" + }, + { "from": [ 7, 12, 7 ], + "to": [ 16, 15, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 16, 4 ], "texture": "#texture" }, + "south": { "uv": [ 7, 1, 16, 4 ], "texture": "#texture" }, + "east": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "east" } + }, + "__comment": "East top bar" + }, + { "from": [ 7, 6, 7 ], + "to": [ 16, 9, 9 ], + "faces": { + "down": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 7, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 7, 7, 16, 10 ], "texture": "#texture" }, + "south": { "uv": [ 7, 7, 16, 10 ], "texture": "#texture" }, + "east": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "east" } + }, + "__comment": "East lower bar" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_nsew.json new file mode 100644 index 0000000..c5a5c81 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_nsew.json @@ -0,0 +1,67 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 6, 0, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" } + }, + "__comment": "Center post" + }, + { "from": [ 7, 12, 0 ], + "to": [ 9, 15, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" }, + "east": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" } + }, + "__comment": "North-south top bar" + }, + { "from": [ 7, 6, 0 ], + "to": [ 9, 9, 16 ], + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#texture" }, + "north": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" }, + "east": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" } + }, + "__comment": "North-south lower bar" + }, + { "from": [ 0, 12, 7 ], + "to": [ 16, 15, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 0, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" }, + "south": { "uv": [ 0, 1, 16, 4 ], "texture": "#texture" }, + "west": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 7, 1, 9, 4 ], "texture": "#texture", "cullface": "east" } + }, + "__comment": "East-west top bar" + }, + { "from": [ 0, 6, 7 ], + "to": [ 16, 9, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 0, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" }, + "south": { "uv": [ 0, 7, 16, 10 ], "texture": "#texture" }, + "west": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 7, 7, 9, 10 ], "texture": "#texture", "cullface": "east" } + }, + "__comment": "East-west lower bar" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_post.json new file mode 100644 index 0000000..d472ce6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fence_post.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 6, 0, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "south": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "west": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 0, 10, 16 ], "texture": "#texture" } + }, + "__comment": "Center post" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fern.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fern.json new file mode 100644 index 0000000..9d1947a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fern.json @@ -0,0 +1,6 @@ +{ + "parent": "block/tallgrass", + "textures": { + "cross": "blocks/fern" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_floor.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_floor.json new file mode 100644 index 0000000..6df2567 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_floor.json @@ -0,0 +1,49 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 0, 8.8 ], + "to": [ 16, 22.4, 8.8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 0, 7.2 ], + "to": [ 16, 22.4, 7.2 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 8.8, 0, 0 ], + "to": [ 8.8, 22.4, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 7.2, 0, 0 ], + "to": [ 7.2, 22.4, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 0, 15.99 ], + "to": [ 16, 22.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 0, 0.01 ], + "to": [ 16, 22.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0.01, 0, 0 ], + "to": [ 0.01, 22.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 0, 0 ], + "to": [ 15.99, 22.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_floor_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_floor_main.json new file mode 100644 index 0000000..230630e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_floor_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_floor", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n.json new file mode 100644 index 0000000..b94fc74 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n.json @@ -0,0 +1,15 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_alt.json new file mode 100644 index 0000000..a2e3853 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_n", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_alt_flip.json new file mode 100644 index 0000000..a876474 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_n_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_flip.json new file mode 100644 index 0000000..117225d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_flip.json @@ -0,0 +1,15 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_flip_main.json new file mode 100644 index 0000000..903d351 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_n_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_main.json new file mode 100644 index 0000000..90c064f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_n_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_n", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne.json new file mode 100644 index 0000000..85f4cd6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_alt.json new file mode 100644 index 0000000..03bf39b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ne", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_alt_flip.json new file mode 100644 index 0000000..d1675d2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ne_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_flip.json new file mode 100644 index 0000000..4b87db9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_flip.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_flip_main.json new file mode 100644 index 0000000..4401221 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ne_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_main.json new file mode 100644 index 0000000..d84423f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ne_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ne", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1.json new file mode 100644 index 0000000..afa6532 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_alt.json new file mode 100644 index 0000000..08b46b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu1", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_alt_flip.json new file mode 100644 index 0000000..6349a54 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu1_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_flip.json new file mode 100644 index 0000000..70cb16e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_flip.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_flip_main.json new file mode 100644 index 0000000..7254e12 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu1_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_main.json new file mode 100644 index 0000000..66966da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu1_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu1", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2.json new file mode 100644 index 0000000..237fc2a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_alt.json new file mode 100644 index 0000000..2760d6e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu2", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_alt_flip.json new file mode 100644 index 0000000..84c5f98 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu2_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_flip.json new file mode 100644 index 0000000..4c332da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_flip.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_flip_main.json new file mode 100644 index 0000000..cbcb88a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu2_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_main.json new file mode 100644 index 0000000..5dab175 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_neu2_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_neu2", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns.json new file mode 100644 index 0000000..9b97a72 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_alt.json new file mode 100644 index 0000000..ee9d7ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ns", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_alt_flip.json new file mode 100644 index 0000000..b620cdc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ns_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_flip.json new file mode 100644 index 0000000..6c9203e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_flip.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_flip_main.json new file mode 100644 index 0000000..c7080fd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ns_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_main.json new file mode 100644 index 0000000..8f04917 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_ns_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_ns", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse.json new file mode 100644 index 0000000..1c77aa4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse.json @@ -0,0 +1,35 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_alt.json new file mode 100644 index 0000000..2787d36 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nse", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_alt_flip.json new file mode 100644 index 0000000..dbb8b54 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nse_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_flip.json new file mode 100644 index 0000000..3069fba --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_flip.json @@ -0,0 +1,35 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_flip_main.json new file mode 100644 index 0000000..24c02a6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nse_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_main.json new file mode 100644 index 0000000..4a45223 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nse_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nse", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1.json new file mode 100644 index 0000000..18def16 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1.json @@ -0,0 +1,47 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_alt.json new file mode 100644 index 0000000..65d9c10 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu1", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_alt_flip.json new file mode 100644 index 0000000..260eba1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu1_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_flip.json new file mode 100644 index 0000000..ce2735e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_flip.json @@ -0,0 +1,47 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_flip_main.json new file mode 100644 index 0000000..3f29a80 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu1_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_main.json new file mode 100644 index 0000000..49d8a00 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu1_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu1", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2.json new file mode 100644 index 0000000..41e6aaa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2.json @@ -0,0 +1,47 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_alt.json new file mode 100644 index 0000000..f6c903c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu2", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_alt_flip.json new file mode 100644 index 0000000..da41494 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu2_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_flip.json new file mode 100644 index 0000000..78c3e11 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_flip.json @@ -0,0 +1,47 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_flip_main.json new file mode 100644 index 0000000..3ab90d2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu2_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_main.json new file mode 100644 index 0000000..7ba2bfc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nseu2_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nseu2", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew.json new file mode 100644 index 0000000..47eb000 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew.json @@ -0,0 +1,45 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0.01, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_alt.json new file mode 100644 index 0000000..a9f740e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsew", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_alt_flip.json new file mode 100644 index 0000000..0b54534 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsew_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_flip.json new file mode 100644 index 0000000..3b8a601 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_flip.json @@ -0,0 +1,45 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0.01, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_flip_main.json new file mode 100644 index 0000000..93ad78d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsew_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_main.json new file mode 100644 index 0000000..d00d8de --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsew_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsew", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1.json new file mode 100644 index 0000000..0169002 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0.01, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_alt.json new file mode 100644 index 0000000..fea1b08 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu1", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_alt_flip.json new file mode 100644 index 0000000..d81a7ba --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu1_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_flip.json new file mode 100644 index 0000000..5676585 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_flip.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0.01, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_flip_main.json new file mode 100644 index 0000000..1b46d1b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu1_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_main.json new file mode 100644 index 0000000..aff44aa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu1_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu1", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2.json new file mode 100644 index 0000000..546a3a2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0.01, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_alt.json new file mode 100644 index 0000000..76ce652 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu2", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_alt_flip.json new file mode 100644 index 0000000..8ee747c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu2_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_flip.json new file mode 100644 index 0000000..c61b898 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_flip.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 15.99, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0.01, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 15.99, 1, 0 ], + "to": [ 0.01, 23.4, 16 ], + "shade": false, + "faces": { "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_flip_main.json new file mode 100644 index 0000000..6f80972 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu2_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_main.json new file mode 100644 index 0000000..6e212b4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsewu2_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsewu2", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1.json new file mode 100644 index 0000000..6f8c8f0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_alt.json new file mode 100644 index 0000000..dfd3600 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu1", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_alt_flip.json new file mode 100644 index 0000000..00c8553 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu1_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_flip.json new file mode 100644 index 0000000..a978462 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_flip.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_flip_main.json new file mode 100644 index 0000000..b7359d8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu1_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_main.json new file mode 100644 index 0000000..d2db70e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu1_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu1", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2.json new file mode 100644 index 0000000..443b097 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_alt.json new file mode 100644 index 0000000..27c7196 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu2", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_alt_flip.json new file mode 100644 index 0000000..f88ce30 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu2_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_flip.json new file mode 100644 index 0000000..1f3cfab --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_flip.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 15.99 ], + "to": [ 16, 23.4, 15.99 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_flip_main.json new file mode 100644 index 0000000..f703e31 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu2_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_main.json new file mode 100644 index 0000000..ff6e5cf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nsu2_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nsu2", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1.json new file mode 100644 index 0000000..656af53 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1.json @@ -0,0 +1,27 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_alt.json new file mode 100644 index 0000000..6090265 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nu1", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_alt_flip.json new file mode 100644 index 0000000..e7ea7b0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_u2", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_flip_main.json new file mode 100644 index 0000000..73a340f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_u2", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_main.json new file mode 100644 index 0000000..e10f89f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu1_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nu1", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2.json new file mode 100644 index 0000000..12855a7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2.json @@ -0,0 +1,27 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_alt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_alt.json new file mode 100644 index 0000000..61c2660 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_alt.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nu2", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_alt_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_alt_flip.json new file mode 100644 index 0000000..13d7507 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_alt_flip.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nu2_flip", + "textures": { + "particle": "blocks/fire_layer_1", + "fire": "blocks/fire_layer_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_flip.json new file mode 100644 index 0000000..a6db426 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_flip.json @@ -0,0 +1,27 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 1, 0.01 ], + "to": [ 16, 23.4, 0.01 ], + "shade": false, + "faces": { "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#fire" }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_flip_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_flip_main.json new file mode 100644 index 0000000..68e6671 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_flip_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nu2_flip", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_main.json new file mode 100644 index 0000000..4d3797a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_nu2_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_nu2", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u1.json new file mode 100644 index 0000000..e0f391d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u1.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 8 ], "axis": "z", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 270 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 0, 16, 8 ], "axis": "z", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 90 }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u1_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u1_main.json new file mode 100644 index 0000000..6ab3fb3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u1_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_u1", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u2.json new file mode 100644 index 0000000..9bfab62 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u2.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "elements": [ + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 16 ], "axis": "x", "angle": -22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire", "rotation": 180 }} + }, + { "from": [ 0, 16, 0 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 8, 16, 0 ], "axis": "x", "angle": 22.5, "rescale": true }, + "shade": false, + "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#fire" }} + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u2_main.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u2_main.json new file mode 100644 index 0000000..73a340f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/fire_u2_main.json @@ -0,0 +1,7 @@ +{ + "parent": "block/fire_u2", + "textures": { + "particle": "blocks/fire_layer_0", + "fire": "blocks/fire_layer_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot.json new file mode 100644 index 0000000..b5f1c29 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/flower_pot", + "flowerpot": "blocks/flower_pot", + "dirt": "blocks/dirt" + }, + "elements": [ + { "from": [ 5, 0, 5 ], + "to": [ 6, 6, 11 ], + "faces": { + "down": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 10, 0, 5 ], + "to": [ 11, 6, 11 ], + "faces": { + "down": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 5 ], + "to": [ 10, 6, 6 ], + "faces": { + "down": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 10 ], + "to": [ 10, 6, 11 ], + "faces": { + "down": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 6 ], + "to": [ 10, 4, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#dirt" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_acacia.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_acacia.json new file mode 100644 index 0000000..21f6dcd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_acacia.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/sapling_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_allium.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_allium.json new file mode 100644 index 0000000..2a0e686 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_allium.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_allium" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_birch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_birch.json new file mode 100644 index 0000000..90c04a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_birch.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/sapling_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_cactus.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_cactus.json new file mode 100644 index 0000000..669e3f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_cactus.json @@ -0,0 +1,86 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/flower_pot", + "flowerpot": "blocks/flower_pot", + "dirt": "blocks/dirt", + "cactus": "blocks/cactus_side" + }, + "elements": [ + { "from": [ 5, 0, 5 ], + "to": [ 6, 6, 11 ], + "faces": { + "down": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 10, 0, 5 ], + "to": [ 11, 6, 11 ], + "faces": { + "down": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 5 ], + "to": [ 10, 6, 6 ], + "faces": { + "down": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 10 ], + "to": [ 10, 6, 11 ], + "faces": { + "down": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 6 ], + "to": [ 10, 4, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#dirt" } + } + }, + { "from": [ 6, 4, 6 ], + "to": [ 10, 8, 10 ], + "faces": { + "north": { "uv": [ 6, 8, 10, 12 ], "texture": "#cactus" }, + "south": { "uv": [ 6, 8, 10, 12 ], "texture": "#cactus" }, + "west": { "uv": [ 6, 8, 10, 12 ], "texture": "#cactus" }, + "east": { "uv": [ 6, 8, 10, 12 ], "texture": "#cactus" } + } + }, + { "from": [ 6, 8, 6 ], + "to": [ 10, 12, 10 ], + "faces": { + "north": { "uv": [ 6, 4, 10, 8 ], "texture": "#cactus" }, + "south": { "uv": [ 6, 4, 10, 8 ], "texture": "#cactus" }, + "west": { "uv": [ 6, 4, 10, 8 ], "texture": "#cactus" }, + "east": { "uv": [ 6, 4, 10, 8 ], "texture": "#cactus" } + } + }, + { "from": [ 6, 12, 6 ], + "to": [ 10, 16, 10 ], + "faces": { + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#cactus" }, + "north": { "uv": [ 6, 0, 10, 4 ], "texture": "#cactus" }, + "south": { "uv": [ 6, 0, 10, 4 ], "texture": "#cactus" }, + "west": { "uv": [ 6, 0, 10, 4 ], "texture": "#cactus" }, + "east": { "uv": [ 6, 0, 10, 4 ], "texture": "#cactus" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_cross.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_cross.json new file mode 100644 index 0000000..7af477b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_cross.json @@ -0,0 +1,73 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/flower_pot", + "flowerpot": "blocks/flower_pot", + "dirt": "blocks/dirt" + }, + "elements": [ + { "from": [ 5, 0, 5 ], + "to": [ 6, 6, 11 ], + "faces": { + "down": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 10, 0, 5 ], + "to": [ 11, 6, 11 ], + "faces": { + "down": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 5 ], + "to": [ 10, 6, 6 ], + "faces": { + "down": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 10 ], + "to": [ 10, 6, 11 ], + "faces": { + "down": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 6 ], + "to": [ 10, 4, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#dirt" } + } + }, + { "from": [ 2.6, 4, 8 ], + "to": [ 13.4, 16, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant" } + } + }, + { "from": [ 8, 4, 2.6 ], + "to": [ 8, 16, 13.4 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_daisy.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_daisy.json new file mode 100644 index 0000000..d065044 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_daisy.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_oxeye_daisy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dandelion.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dandelion.json new file mode 100644 index 0000000..353eb5e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dandelion.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_dandelion" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dark_oak.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dark_oak.json new file mode 100644 index 0000000..f0c714e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dark_oak.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/sapling_roofed_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dead_bush.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dead_bush.json new file mode 100644 index 0000000..b792169 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_dead_bush.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/deadbush" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_fern.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_fern.json new file mode 100644 index 0000000..e12f90d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_fern.json @@ -0,0 +1,74 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/flower_pot", + "flowerpot": "blocks/flower_pot", + "dirt": "blocks/dirt", + "plant": "blocks/fern" + }, + "elements": [ + { "from": [ 5, 0, 5 ], + "to": [ 6, 6, 11 ], + "faces": { + "down": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 5, 5, 6, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 10, 0, 5 ], + "to": [ 11, 6, 11 ], + "faces": { + "down": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 10, 5, 11, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 5, 10, 6, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 10, 10, 11, 16 ], "texture": "#flowerpot" }, + "west": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" }, + "east": { "uv": [ 5, 10, 11, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 5 ], + "to": [ 10, 6, 6 ], + "faces": { + "down": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 10 ], + "to": [ 10, 6, 11 ], + "faces": { + "down": { "uv": [ 6, 5, 10, 6 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 10, 10, 11 ], "texture": "#flowerpot" }, + "north": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" }, + "south": { "uv": [ 6, 10, 10, 16 ], "texture": "#flowerpot" } + } + }, + { "from": [ 6, 0, 6 ], + "to": [ 10, 4, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#flowerpot", "cullface": "down" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#dirt" } + } + }, + { "from": [ 2.6, 4, 8 ], + "to": [ 13.4, 16, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant", "tintindex": 0 } + } + }, + { "from": [ 8, 4, 2.6 ], + "to": [ 8, 16, 13.4 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_houstonia.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_houstonia.json new file mode 100644 index 0000000..a270ed8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_houstonia.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_houstonia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_jungle.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_jungle.json new file mode 100644 index 0000000..c8c854c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_jungle.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/sapling_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_mushroom_brown.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_mushroom_brown.json new file mode 100644 index 0000000..531c564 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_mushroom_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/mushroom_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_mushroom_red.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_mushroom_red.json new file mode 100644 index 0000000..2e339ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_mushroom_red.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/mushroom_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_oak.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_oak.json new file mode 100644 index 0000000..8a90b8c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_oak.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/sapling_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_orchid.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_orchid.json new file mode 100644 index 0000000..a5f29ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_orchid.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_blue_orchid" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_rose.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_rose.json new file mode 100644 index 0000000..ffd38bf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_rose.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_rose" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_spruce.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_spruce.json new file mode 100644 index 0000000..752a0a9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_spruce.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/sapling_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_orange.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_orange.json new file mode 100644 index 0000000..c397ab4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_tulip_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_pink.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_pink.json new file mode 100644 index 0000000..74db107 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_tulip_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_red.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_red.json new file mode 100644 index 0000000..8285aea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_red.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_tulip_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_white.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_white.json new file mode 100644 index 0000000..adc4ed9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/flower_pot_tulip_white.json @@ -0,0 +1,6 @@ +{ + "parent": "block/flower_pot_cross", + "textures": { + "plant": "blocks/flower_tulip_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/furnace.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/furnace.json new file mode 100644 index 0000000..9d88a5e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/furnace.json @@ -0,0 +1,8 @@ +{ + "parent": "block/orientable", + "textures": { + "top": "blocks/furnace_top", + "front": "blocks/furnace_front_off", + "side": "blocks/furnace_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass.json new file mode 100644 index 0000000..aa796b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_black.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_black.json new file mode 100644 index 0000000..b9008a0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_black.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_blue.json new file mode 100644 index 0000000..3f8fb9b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_brown.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_brown.json new file mode 100644 index 0000000..b916aa9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_cyan.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_cyan.json new file mode 100644 index 0000000..83e6c58 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_gray.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_gray.json new file mode 100644 index 0000000..f37201d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_green.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_green.json new file mode 100644 index 0000000..c313268 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_green.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_light_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_light_blue.json new file mode 100644 index 0000000..2faeffa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_lime.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_lime.json new file mode 100644 index 0000000..f6ba9c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_magenta.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_magenta.json new file mode 100644 index 0000000..fda210f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_orange.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_orange.json new file mode 100644 index 0000000..d2d7204 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_n.json new file mode 100644 index 0000000..ad71fc3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_ne.json new file mode 100644 index 0000000..44cada4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_new.json new file mode 100644 index 0000000..85de1ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_ns.json new file mode 100644 index 0000000..5e6ecfe --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nse.json new file mode 100644 index 0000000..c8fa2d1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nsew.json new file mode 100644 index 0000000..226f690 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nsw.json new file mode 100644 index 0000000..489076b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nw.json new file mode 100644 index 0000000..cc616f9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_s.json new file mode 100644 index 0000000..7db345f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_se.json new file mode 100644 index 0000000..015428f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_sew.json new file mode 100644 index 0000000..bd2270b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_sw.json new file mode 100644 index 0000000..813ac36 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top", + "pane": "blocks/glass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pink.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pink.json new file mode 100644 index 0000000..b557e8b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_purple.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_purple.json new file mode 100644 index 0000000..ac12904 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_red.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_red.json new file mode 100644 index 0000000..939f58d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_red.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_silver.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_silver.json new file mode 100644 index 0000000..afeeeaa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_white.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_white.json new file mode 100644 index 0000000..c7df9fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_white.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_yellow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_yellow.json new file mode 100644 index 0000000..3ba5a6c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glass_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glowstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glowstone.json new file mode 100644 index 0000000..9ffe5db --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/glowstone.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/glowstone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gold_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gold_block.json new file mode 100644 index 0000000..1c227f0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gold_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/gold_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gold_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gold_ore.json new file mode 100644 index 0000000..ce4e035 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gold_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/gold_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_flat.json new file mode 100644 index 0000000..a2f49b1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_flat.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "blocks/rail_golden_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_raised_ne.json new file mode 100644 index 0000000..4ab8f64 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_ne", + "textures": { + "rail": "blocks/rail_golden_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_raised_sw.json new file mode 100644 index 0000000..8fef059 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_active_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_sw", + "textures": { + "rail": "blocks/rail_golden_powered" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_flat.json new file mode 100644 index 0000000..87a08fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_flat.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "blocks/rail_golden" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_raised_ne.json new file mode 100644 index 0000000..ff3856d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_ne", + "textures": { + "rail": "blocks/rail_golden" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_raised_sw.json new file mode 100644 index 0000000..520414d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/golden_rail_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_sw", + "textures": { + "rail": "blocks/rail_golden" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/granite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/granite.json new file mode 100644 index 0000000..eee4fae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/granite.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone_granite" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/granite_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/granite_smooth.json new file mode 100644 index 0000000..31fc9f1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/granite_smooth.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone_granite_smooth" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass.json new file mode 100644 index 0000000..2f23537 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass.json @@ -0,0 +1,24 @@ +{ + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "up", "tintindex": 0 }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass_normal.json new file mode 100644 index 0000000..b6201eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass_normal.json @@ -0,0 +1,10 @@ +{ + "parent": "block/grass", + "textures": { + "particle": "blocks/dirt", + "bottom": "blocks/dirt", + "top": "blocks/grass_top", + "side": "blocks/grass_side", + "overlay": "blocks/grass_side_overlay" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass_snowed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass_snowed.json new file mode 100644 index 0000000..c33ffc5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/grass_snowed.json @@ -0,0 +1,9 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "particle": "blocks/dirt", + "bottom": "blocks/dirt", + "top": "blocks/grass_top", + "side": "blocks/grass_side_snowed" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gravel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gravel.json new file mode 100644 index 0000000..e2cf665 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gravel.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/gravel" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_n.json new file mode 100644 index 0000000..6258ea6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_ne.json new file mode 100644 index 0000000..d9625fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_new.json new file mode 100644 index 0000000..9104c90 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_ns.json new file mode 100644 index 0000000..2c2eaec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nse.json new file mode 100644 index 0000000..0c1dbaa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nsew.json new file mode 100644 index 0000000..46bb9cf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nsw.json new file mode 100644 index 0000000..614f304 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nw.json new file mode 100644 index 0000000..70dba64 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_s.json new file mode 100644 index 0000000..70af4f0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_se.json new file mode 100644 index 0000000..a0ab99f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_sew.json new file mode 100644 index 0000000..9ee1e0b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_sw.json new file mode 100644 index 0000000..490172b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_gray", + "pane": "blocks/glass_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_wool.json new file mode 100644 index 0000000..f88eb1d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/gray_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_n.json new file mode 100644 index 0000000..67c1ce9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_ne.json new file mode 100644 index 0000000..82ca8c9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_new.json new file mode 100644 index 0000000..2d55f3b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_ns.json new file mode 100644 index 0000000..d90e681 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nse.json new file mode 100644 index 0000000..4cc015f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nsew.json new file mode 100644 index 0000000..69ee99e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nsw.json new file mode 100644 index 0000000..aef8ec9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nw.json new file mode 100644 index 0000000..30b1cb5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_s.json new file mode 100644 index 0000000..471301a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_se.json new file mode 100644 index 0000000..2df0a1c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_sew.json new file mode 100644 index 0000000..0ce17dd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_sw.json new file mode 100644 index 0000000..ad82c52 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_green", + "pane": "blocks/glass_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_wool.json new file mode 100644 index 0000000..44c65a5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/green_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab.json new file mode 100644 index 0000000..1b3cee1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_acacia.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_acacia.json new file mode 100644 index 0000000..25e7353 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_acacia.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/planks_acacia", + "top": "blocks/planks_acacia", + "side": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_birch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_birch.json new file mode 100644 index 0000000..1dc753c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_birch.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/planks_birch", + "top": "blocks/planks_birch", + "side": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_brick.json new file mode 100644 index 0000000..1fd4a27 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_brick.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/brick", + "top": "blocks/brick", + "side": "blocks/brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_cobblestone.json new file mode 100644 index 0000000..7520794 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_cobblestone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/cobblestone", + "top": "blocks/cobblestone", + "side": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_dark_oak.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_dark_oak.json new file mode 100644 index 0000000..f4d89ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_dark_oak.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/planks_big_oak", + "top": "blocks/planks_big_oak", + "side": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_jungle.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_jungle.json new file mode 100644 index 0000000..5d3d271 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_jungle.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/planks_jungle", + "top": "blocks/planks_jungle", + "side": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_nether_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_nether_brick.json new file mode 100644 index 0000000..2e30c56 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_nether_brick.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/nether_brick", + "top": "blocks/nether_brick", + "side": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_oak.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_oak.json new file mode 100644 index 0000000..15b2612 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_oak.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/planks_oak", + "top": "blocks/planks_oak", + "side": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_quartz.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_quartz.json new file mode 100644 index 0000000..1066da7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/quartz_block_bottom", + "top": "blocks/quartz_block_top", + "side": "blocks/quartz_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_red_sandstone.json new file mode 100644 index 0000000..08dc64c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_red_sandstone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/red_sandstone_bottom", + "top": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_sandstone.json new file mode 100644 index 0000000..5d08ff4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_sandstone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/sandstone_bottom", + "top": "blocks/sandstone_top", + "side": "blocks/sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_spruce.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_spruce.json new file mode 100644 index 0000000..9e28d9f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_spruce.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/planks_spruce", + "top": "blocks/planks_spruce", + "side": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_stone.json new file mode 100644 index 0000000..b09be3e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_stone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/stone_slab_top", + "top": "blocks/stone_slab_top", + "side": "blocks/stone_slab_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_stone_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_stone_brick.json new file mode 100644 index 0000000..9bb3abc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/half_slab_stone_brick.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "blocks/stonebrick", + "top": "blocks/stonebrick", + "side": "blocks/stonebrick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay.json new file mode 100644 index 0000000..5f29119 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_black.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_black.json new file mode 100644 index 0000000..cab25b2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_black.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_black" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_blue.json new file mode 100644 index 0000000..01eed45 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_brown.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_brown.json new file mode 100644 index 0000000..646946d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_brown.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_brown" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_cyan.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_cyan.json new file mode 100644 index 0000000..fd4243a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_cyan" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_gray.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_gray.json new file mode 100644 index 0000000..4fd29f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_gray" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_green.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_green.json new file mode 100644 index 0000000..b04b096 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_green.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_green" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_light_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_light_blue.json new file mode 100644 index 0000000..a601f95 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_lime.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_lime.json new file mode 100644 index 0000000..34f4474 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_lime.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_magenta.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_magenta.json new file mode 100644 index 0000000..69e0944 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_orange.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_orange.json new file mode 100644 index 0000000..6feb867 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_pink.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_pink.json new file mode 100644 index 0000000..20afb21 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_pink.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_purple.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_purple.json new file mode 100644 index 0000000..a5865ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_purple.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_red.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_red.json new file mode 100644 index 0000000..77c34eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_red.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_silver.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_silver.json new file mode 100644 index 0000000..88e0d8b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_silver.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_white.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_white.json new file mode 100644 index 0000000..5af1046 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_white.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_yellow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_yellow.json new file mode 100644 index 0000000..f156453 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hardened_clay_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/hardened_clay_stained_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hay.json new file mode 100644 index 0000000..542ffc0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hay.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/hay_block_top", + "side": "blocks/hay_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hay_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hay_side.json new file mode 100644 index 0000000..8d24c81 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hay_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "blocks/hay_block_top", + "side": "blocks/hay_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_down.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_down.json new file mode 100644 index 0000000..ce66309 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_down.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_down", + "textures": { + "texture": "blocks/iron_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_inventory.json new file mode 100644 index 0000000..2c7557a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_inventory", + "textures": { + "texture": "blocks/iron_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_up.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_up.json new file mode 100644 index 0000000..308eb16 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/heavy_pressure_plate_up.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_up", + "textures": { + "texture": "blocks/iron_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hopper_down.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hopper_down.json new file mode 100644 index 0000000..2f89a89 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hopper_down.json @@ -0,0 +1,88 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/hopper_outside", + "top": "blocks/hopper_top", + "side": "blocks/hopper_outside", + "inside": "blocks/hopper_inside" + }, + "elements": [ + { "from": [ 0, 10, 0 ], + "to": [ 16, 11, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#inside" }, + "north": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" }, + "south": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" }, + "west": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" }, + "east": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" } + } + }, + { "from": [ 0, 11, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 2, 16 ], "texture": "#side" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" }, + "south": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" } + } + }, + { "from": [ 14, 11, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 16 ], "texture": "#side" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" }, + "south": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" } + } + }, + { "from": [ 2, 11, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 2 ], "texture": "#side" }, + "up": { "uv": [ 2, 0, 14, 2 ], "texture": "#top" }, + "north": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" } + } + }, + { "from": [ 2, 11, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "uv": [ 2, 14, 14, 16 ], "texture": "#side" }, + "up": { "uv": [ 2, 14, 14, 16 ], "texture": "#top" }, + "north": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "west": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" }, + "east": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" } + } + }, + { "from": [ 4, 4, 4 ], + "to": [ 12, 10, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#side" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#side" }, + "north": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" }, + "south": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" }, + "west": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" }, + "east": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" } + } + }, + { "from": [ 6, 0, 6 ], + "to": [ 10, 4, 10 ], + "faces": { + "down": { "uv": [ 6, 6, 10, 10 ], "texture": "#side" }, + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#side" }, + "north": { "uv": [ 6, 12, 10, 16 ], "texture": "#side" }, + "south": { "uv": [ 6, 12, 10, 16 ], "texture": "#side" }, + "west": { "uv": [ 6, 12, 10, 16 ], "texture": "#side" }, + "east": { "uv": [ 6, 12, 10, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hopper_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hopper_side.json new file mode 100644 index 0000000..c53a737 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/hopper_side.json @@ -0,0 +1,88 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/hopper_outside", + "top": "blocks/hopper_top", + "side": "blocks/hopper_outside", + "inside": "blocks/hopper_inside" + }, + "elements": [ + { "from": [ 0, 10, 0 ], + "to": [ 16, 11, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#inside" }, + "north": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" }, + "south": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" }, + "west": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" }, + "east": { "uv": [ 0, 5, 16, 6 ], "texture": "#side" } + } + }, + { "from": [ 0, 11, 0 ], + "to": [ 2, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 2, 16 ], "texture": "#side" }, + "up": { "uv": [ 0, 0, 2, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" }, + "south": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" } + } + }, + { "from": [ 14, 11, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 14, 0, 16, 16 ], "texture": "#side" }, + "up": { "uv": [ 14, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" }, + "south": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 5 ], "texture": "#side" } + } + }, + { "from": [ 2, 11, 0 ], + "to": [ 14, 16, 2 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 2 ], "texture": "#side" }, + "up": { "uv": [ 2, 0, 14, 2 ], "texture": "#top" }, + "north": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 2, 5 ], "texture": "#side" } + } + }, + { "from": [ 2, 11, 14 ], + "to": [ 14, 16, 16 ], + "faces": { + "down": { "uv": [ 2, 14, 14, 16 ], "texture": "#side" }, + "up": { "uv": [ 2, 14, 14, 16 ], "texture": "#top" }, + "north": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 5 ], "texture": "#side" }, + "west": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" }, + "east": { "uv": [ 14, 0, 16, 5 ], "texture": "#side" } + } + }, + { "from": [ 4, 4, 4 ], + "to": [ 12, 10, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#side" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#side" }, + "north": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" }, + "south": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" }, + "west": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" }, + "east": { "uv": [ 4, 6, 12, 12 ], "texture": "#side" } + } + }, + { "from": [ 6, 4, 0 ], + "to": [ 10, 8, 4 ], + "faces": { + "down": { "uv": [ 6, 0, 10, 4 ], "texture": "#side" }, + "up": { "uv": [ 6, 0, 10, 4 ], "texture": "#side" }, + "north": { "uv": [ 6, 8, 10, 12 ], "texture": "#side" }, + "south": { "uv": [ 6, 8, 10, 12 ], "texture": "#side" }, + "west": { "uv": [ 0, 8, 4, 12 ], "texture": "#side" }, + "east": { "uv": [ 0, 8, 4, 12 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/houstonia.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/houstonia.json new file mode 100644 index 0000000..ca9b344 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/houstonia.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_houstonia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/ice.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/ice.json new file mode 100644 index 0000000..2b94ada --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/ice.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/ice" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/inner_stairs.json new file mode 100644 index 0000000..51c02e2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/inner_stairs.json @@ -0,0 +1,40 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 8, 8, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 8, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 8, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 0, 8, 8 ], + "to": [ 8, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 8, 8 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 8, 8, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 8, 0, 16, 8 ], "texture": "#side" }, + "south": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_block.json new file mode 100644 index 0000000..3ed6c88 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/iron_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_bottom.json new file mode 100644 index 0000000..013cf58 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/door_iron_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_bottom_rh.json new file mode 100644 index 0000000..2cf3325 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/door_iron_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_top.json new file mode 100644 index 0000000..1e4acbd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/door_iron_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_top_rh.json new file mode 100644 index 0000000..a42460c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_door_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_iron_lower", + "top": "blocks/door_iron_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_ore.json new file mode 100644 index 0000000..a6d9f1f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/iron_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_bottom.json new file mode 100644 index 0000000..548d030 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/trapdoor_bottom", + "textures": { + "texture": "blocks/iron_trapdoor" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_open.json new file mode 100644 index 0000000..eca9e15 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/trapdoor_open", + "textures": { + "texture": "blocks/iron_trapdoor" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_top.json new file mode 100644 index 0000000..04deb33 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/iron_trapdoor_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/trapdoor_top", + "textures": { + "texture": "blocks/iron_trapdoor" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/item_frame.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/item_frame.json new file mode 100644 index 0000000..cc12c8d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/item_frame.json @@ -0,0 +1,56 @@ +{ + "textures": { + "particle": "blocks/planks_birch", + "wood": "blocks/planks_birch", + "back": "blocks/itemframe_background" + }, + "elements": [ + { "from": [ 3, 3, 15.5 ], + "to": [ 13, 13, 16 ], + "faces": { + "north": { "uv": [ 3, 3, 13, 13 ], "texture": "#back" }, + "south": { "uv": [ 3, 3, 13, 13 ], "texture": "#back" } + } + }, + { "from": [ 2, 2, 15 ], + "to": [ 14, 3, 16 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 1 ], "texture": "#wood" }, + "up": { "uv": [ 2, 15, 14, 16 ], "texture": "#wood" }, + "north": { "uv": [ 2, 13, 14, 14 ], "texture": "#wood" }, + "south": { "uv": [ 2, 13, 14, 14 ], "texture": "#wood" }, + "west": { "uv": [ 15, 13, 16, 14 ], "texture": "#wood" }, + "east": { "uv": [ 0, 13, 1, 14 ], "texture": "#wood" } + } + }, + { "from": [ 2, 13, 15 ], + "to": [ 14, 14, 16 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 1 ], "texture": "#wood" }, + "up": { "uv": [ 2, 15, 14, 16 ], "texture": "#wood" }, + "north": { "uv": [ 2, 2, 14, 3 ], "texture": "#wood" }, + "south": { "uv": [ 2, 2, 14, 3 ], "texture": "#wood" }, + "west": { "uv": [ 15, 2, 16, 3 ], "texture": "#wood" }, + "east": { "uv": [ 0, 2, 1, 3 ], "texture": "#wood" } + } + }, + { "from": [ 2, 3, 15 ], + "to": [ 3, 13, 16 ], + "faces": { + "north": { "uv": [ 13, 3, 14, 13 ], "texture": "#wood" }, + "south": { "uv": [ 2, 3, 3, 13 ], "texture": "#wood" }, + "west": { "uv": [ 15, 3, 16, 13 ], "texture": "#wood" }, + "east": { "uv": [ 0, 3, 1, 13 ], "texture": "#wood" } + } + }, + { "from": [ 13, 3, 15 ], + "to": [ 14, 13, 16 ], + "faces": { + "north": { "uv": [ 2, 3, 3, 13 ], "texture": "#wood" }, + "south": { "uv": [ 13, 3, 14, 13 ], "texture": "#wood" }, + "west": { "uv": [ 15, 3, 16, 13 ], "texture": "#wood" }, + "east": { "uv": [ 0, 3, 1, 13 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/item_frame_map.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/item_frame_map.json new file mode 100644 index 0000000..9d02563 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/item_frame_map.json @@ -0,0 +1,56 @@ +{ + "textures": { + "particle": "blocks/planks_birch", + "wood": "blocks/planks_birch", + "back": "blocks/itemframe_background" + }, + "elements": [ + { "from": [ 1, 1, 15.001 ], + "to": [ 15, 15, 16 ], + "faces": { + "north": { "uv": [ 1, 1, 15, 15 ], "texture": "#back" }, + "south": { "uv": [ 1, 1, 15, 15 ], "texture": "#back" } + } + }, + { "from": [ 0, 0, 15.001 ], + "to": [ 16, 1, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 1 ], "texture": "#wood" }, + "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#wood" }, + "north": { "uv": [ 0, 15, 16, 16 ], "texture": "#wood" }, + "south": { "uv": [ 0, 15, 16, 16 ], "texture": "#wood" }, + "west": { "uv": [ 15, 15, 16, 16 ], "texture": "#wood" }, + "east": { "uv": [ 0, 15, 1, 16 ], "texture": "#wood" } + } + }, + { "from": [ 0, 15, 15.001 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 1 ], "texture": "#wood" }, + "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#wood" }, + "north": { "uv": [ 0, 0, 16, 1 ], "texture": "#wood" }, + "south": { "uv": [ 0, 0, 16, 1 ], "texture": "#wood" }, + "west": { "uv": [ 15, 0, 16, 1 ], "texture": "#wood" }, + "east": { "uv": [ 0, 0, 1, 1 ], "texture": "#wood" } + } + }, + { "from": [ 0, 1, 15.001 ], + "to": [ 1, 15, 16 ], + "faces": { + "north": { "uv": [ 15, 1, 16, 15 ], "texture": "#wood" }, + "south": { "uv": [ 0, 1, 1, 15 ], "texture": "#wood" }, + "west": { "uv": [ 15, 1, 16, 15 ], "texture": "#wood" }, + "east": { "uv": [ 0, 1, 1, 15 ], "texture": "#wood" } + } + }, + { "from": [ 15, 1, 15.001 ], + "to": [ 16, 15, 16 ], + "faces": { + "north": { "uv": [ 0, 1, 1, 15 ], "texture": "#wood" }, + "south": { "uv": [ 15, 1, 16, 15 ], "texture": "#wood" }, + "west": { "uv": [ 15, 1, 16, 15 ], "texture": "#wood" }, + "east": { "uv": [ 0, 1, 1, 15 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jukebox.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jukebox.json new file mode 100644 index 0000000..d03e64a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jukebox.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_top", + "textures": { + "top": "blocks/jukebox_top", + "side": "blocks/jukebox_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_bark.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_bark.json new file mode 100644 index 0000000..a9e95ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/log_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_bottom.json new file mode 100644 index 0000000..ae05da1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_jungle_lower", + "top": "blocks/door_jungle_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_bottom_rh.json new file mode 100644 index 0000000..0aefd36 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_jungle_lower", + "top": "blocks/door_jungle_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_top.json new file mode 100644 index 0000000..5c19f88 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_jungle_lower", + "top": "blocks/door_jungle_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_top_rh.json new file mode 100644 index 0000000..df0dd9e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_door_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_jungle_lower", + "top": "blocks/door_jungle_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_gate_closed.json new file mode 100644 index 0000000..675a209 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_gate_open.json new file mode 100644 index 0000000..aaa0c23 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_inventory.json new file mode 100644 index 0000000..2ca9ac2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_n.json new file mode 100644 index 0000000..78525c8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_n", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_ne.json new file mode 100644 index 0000000..987aa55 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ne", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_ns.json new file mode 100644 index 0000000..92d762e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ns", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_nse.json new file mode 100644 index 0000000..4fef405 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nse", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_nsew.json new file mode 100644 index 0000000..8969cd6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nsew", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_post.json new file mode 100644 index 0000000..d7afc33 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_inner_stairs.json new file mode 100644 index 0000000..754bea0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/planks_jungle", + "top": "blocks/planks_jungle", + "side": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_leaves.json new file mode 100644 index 0000000..c50a077 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "blocks/leaves_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_log.json new file mode 100644 index 0000000..5be31e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_log.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/log_jungle_top", + "side": "blocks/log_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_log_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_log_side.json new file mode 100644 index 0000000..a2009f0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_log_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "blocks/log_jungle_top", + "side": "blocks/log_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_outer_stairs.json new file mode 100644 index 0000000..012678c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/planks_jungle", + "top": "blocks/planks_jungle", + "side": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_planks.json new file mode 100644 index 0000000..cd0cf69 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_sapling.json new file mode 100644 index 0000000..c100003 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/sapling_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_stairs.json new file mode 100644 index 0000000..78a5d04 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/planks_jungle", + "top": "blocks/planks_jungle", + "side": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_wall_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_wall_gate_closed.json new file mode 100644 index 0000000..5ce2679 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_wall_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_wall_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_wall_gate_open.json new file mode 100644 index 0000000..807d2cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/jungle_wall_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/ladder.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/ladder.json new file mode 100644 index 0000000..cc3e470 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/ladder.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/ladder", + "texture": "blocks/ladder" + }, + "elements": [ + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lapis_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lapis_block.json new file mode 100644 index 0000000..7eae7bd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lapis_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/lapis_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lapis_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lapis_ore.json new file mode 100644 index 0000000..ddc9a0a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lapis_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/lapis_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/leaves.json new file mode 100644 index 0000000..9d6af5a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/leaves.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#all" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lever.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lever.json new file mode 100644 index 0000000..03719ac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lever.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cobblestone", + "base": "blocks/cobblestone", + "lever": "blocks/lever" + }, + "elements": [ + { "from": [ 5, 0, 4 ], + "to": [ 11, 3, 12 ], + "faces": { + "down": { "uv": [ 5, 4, 11, 12 ], "texture": "#base" }, + "up": { "uv": [ 5, 4, 11, 12 ], "texture": "#base" }, + "north": { "uv": [ 5, 0, 11, 3 ], "texture": "#base" }, + "south": { "uv": [ 5, 0, 11, 3 ], "texture": "#base" }, + "west": { "uv": [ 4, 0, 12, 3 ], "texture": "#base" }, + "east": { "uv": [ 4, 0, 12, 3 ], "texture": "#base" } + } + }, + { "from": [ 7, 1, 7 ], + "to": [ 9, 11, 9 ], + "rotation": { "origin": [ 8, 1, 8 ], "axis": "x", "angle": -45 }, + "faces": { + "down": { "uv": [ 7, 6, 9, 8 ], "texture": "#lever" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lever" }, + "north": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }, + "south": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }, + "west": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }, + "east": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lever_off.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lever_off.json new file mode 100644 index 0000000..d5684f3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lever_off.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/cobblestone", + "base": "blocks/cobblestone", + "lever": "blocks/lever" + }, + "elements": [ + { "from": [ 5, 0, 4 ], + "to": [ 11, 3, 12 ], + "faces": { + "down": { "uv": [ 5, 4, 11, 12 ], "texture": "#base" }, + "up": { "uv": [ 5, 4, 11, 12 ], "texture": "#base" }, + "north": { "uv": [ 5, 0, 11, 3 ], "texture": "#base" }, + "south": { "uv": [ 5, 0, 11, 3 ], "texture": "#base" }, + "west": { "uv": [ 4, 0, 12, 3 ], "texture": "#base" }, + "east": { "uv": [ 4, 0, 12, 3 ], "texture": "#base" } + } + }, + { "from": [ 7, 1, 7 ], + "to": [ 9, 11, 9 ], + "rotation": { "origin": [ 8, 1, 8 ], "axis": "x", "angle": 45 }, + "faces": { + "down": { "uv": [ 7, 6, 9, 8 ], "texture": "#lever" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lever" }, + "north": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }, + "south": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }, + "west": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" }, + "east": { "uv": [ 7, 6, 9, 16 ], "texture": "#lever" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_n.json new file mode 100644 index 0000000..30d3dee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_ne.json new file mode 100644 index 0000000..7b77dec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_new.json new file mode 100644 index 0000000..63943e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_ns.json new file mode 100644 index 0000000..2b66d1f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nse.json new file mode 100644 index 0000000..d220fe3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nsew.json new file mode 100644 index 0000000..8692b77 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nsw.json new file mode 100644 index 0000000..c62196f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nw.json new file mode 100644 index 0000000..f403cc4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_s.json new file mode 100644 index 0000000..e1e5472 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_se.json new file mode 100644 index 0000000..146394a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_sew.json new file mode 100644 index 0000000..ed12eaf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_sw.json new file mode 100644 index 0000000..08191e9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_light_blue", + "pane": "blocks/glass_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_wool.json new file mode 100644 index 0000000..f8dedf1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_blue_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_light_blue" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_down.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_down.json new file mode 100644 index 0000000..4d34cb7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_down.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_down", + "textures": { + "texture": "blocks/gold_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_inventory.json new file mode 100644 index 0000000..7b4d113 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_inventory", + "textures": { + "texture": "blocks/gold_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_up.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_up.json new file mode 100644 index 0000000..3552757 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/light_pressure_plate_up.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_up", + "textures": { + "texture": "blocks/gold_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_n.json new file mode 100644 index 0000000..241fe99 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_ne.json new file mode 100644 index 0000000..0765f56 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_new.json new file mode 100644 index 0000000..7306df1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_ns.json new file mode 100644 index 0000000..e517ca9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nse.json new file mode 100644 index 0000000..644d26e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nsew.json new file mode 100644 index 0000000..6e31722 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nsw.json new file mode 100644 index 0000000..89076a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nw.json new file mode 100644 index 0000000..676e141 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_s.json new file mode 100644 index 0000000..1131f33 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_se.json new file mode 100644 index 0000000..9df61a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_sew.json new file mode 100644 index 0000000..46caa05 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_sw.json new file mode 100644 index 0000000..911776e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_lime", + "pane": "blocks/glass_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_wool.json new file mode 100644 index 0000000..6cc935c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lime_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_lime" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_furnace.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_furnace.json new file mode 100644 index 0000000..7617cb7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_furnace.json @@ -0,0 +1,8 @@ +{ + "parent": "block/orientable", + "textures": { + "top": "blocks/furnace_top", + "front": "blocks/furnace_front_on", + "side": "blocks/furnace_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_pumpkin.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_pumpkin.json new file mode 100644 index 0000000..1f52c2a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_pumpkin.json @@ -0,0 +1,8 @@ +{ + "parent": "block/orientable", + "textures": { + "top": "blocks/pumpkin_top", + "front": "blocks/pumpkin_face_on", + "side": "blocks/pumpkin_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_lamp.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_lamp.json new file mode 100644 index 0000000..922a722 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_lamp.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/redstone_lamp_on" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_ore.json new file mode 100644 index 0000000..8285da6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/redstone_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_torch.json new file mode 100644 index 0000000..2e658bc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_torch.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch", + "textures": { + "torch": "blocks/redstone_torch_on" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_torch_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_torch_wall.json new file mode 100644 index 0000000..42417e0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/lit_redstone_torch_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch_wall", + "textures": { + "torch": "blocks/redstone_torch_on" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_n.json new file mode 100644 index 0000000..51f0e84 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_ne.json new file mode 100644 index 0000000..a7e5784 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_new.json new file mode 100644 index 0000000..566d713 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_ns.json new file mode 100644 index 0000000..2137a0e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nse.json new file mode 100644 index 0000000..5e95561 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nsew.json new file mode 100644 index 0000000..c8e3635 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nsw.json new file mode 100644 index 0000000..c0547e1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nw.json new file mode 100644 index 0000000..2fb5c5c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_s.json new file mode 100644 index 0000000..5a7a9f8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_se.json new file mode 100644 index 0000000..c25efa3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_sew.json new file mode 100644 index 0000000..e579c36 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_sw.json new file mode 100644 index 0000000..3fe84b8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_magenta", + "pane": "blocks/glass_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_wool.json new file mode 100644 index 0000000..310faa6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/magenta_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_magenta" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon.json new file mode 100644 index 0000000..5ddc9bb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/melon_top", + "side": "blocks/melon_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_fruit.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_fruit.json new file mode 100644 index 0000000..4a9805b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_fruit.json @@ -0,0 +1,7 @@ +{ + "parent": "block/stem_fruit", + "textures": { + "stem": "blocks/melon_stem_disconnected", + "upperstem": "blocks/melon_stem_connected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth0.json new file mode 100644 index 0000000..d6737d0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth0.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth0", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth1.json new file mode 100644 index 0000000..f194f08 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth1", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth2.json new file mode 100644 index 0000000..868e1fa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth2", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth3.json new file mode 100644 index 0000000..af65a4f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth3.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth3", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth4.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth4.json new file mode 100644 index 0000000..b36e899 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth4.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth4", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth5.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth5.json new file mode 100644 index 0000000..91b5ace --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth5.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth5", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth6.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth6.json new file mode 100644 index 0000000..a21d49b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth6.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth6", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth7.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth7.json new file mode 100644 index 0000000..5dd35ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/melon_stem_growth7.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth7", + "textures": { + "stem": "blocks/melon_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mob_spawner_cage.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mob_spawner_cage.json new file mode 100644 index 0000000..39db5d5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mob_spawner_cage.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/mob_spawner" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_cobblestone.json new file mode 100644 index 0000000..fe56fa5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_cobblestone.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_n.json new file mode 100644 index 0000000..b196830 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_n", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ne.json new file mode 100644 index 0000000..136528f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_ne", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ns.json new file mode 100644 index 0000000..73f25ad --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_ns", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ns_above.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ns_above.json new file mode 100644 index 0000000..073875a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_ns_above.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_ns_above", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_nse.json new file mode 100644 index 0000000..33d6e82 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_nse", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_nsew.json new file mode 100644 index 0000000..4f9f9af --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_nsew", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_post.json new file mode 100644 index 0000000..e3e00d0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mossy_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_post", + "textures": { + "wall": "blocks/cobblestone_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mycelium.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mycelium.json new file mode 100644 index 0000000..de2246f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/mycelium.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/dirt", + "top": "blocks/mycelium_top", + "side": "blocks/mycelium_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick.json new file mode 100644 index 0000000..dd1b296 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_inventory.json new file mode 100644 index 0000000..a9ed5c6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_n.json new file mode 100644 index 0000000..8512b63 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_n", + "textures": { + "texture": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_ne.json new file mode 100644 index 0000000..4deb36d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ne", + "textures": { + "texture": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_ns.json new file mode 100644 index 0000000..7fc2238 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ns", + "textures": { + "texture": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_nse.json new file mode 100644 index 0000000..3074da5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nse", + "textures": { + "texture": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_nsew.json new file mode 100644 index 0000000..409e897 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nsew", + "textures": { + "texture": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_post.json new file mode 100644 index 0000000..111c1ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_inner_stairs.json new file mode 100644 index 0000000..5b1471a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/nether_brick", + "top": "blocks/nether_brick", + "side": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_outer_stairs.json new file mode 100644 index 0000000..a9f5b98 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/nether_brick", + "top": "blocks/nether_brick", + "side": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_stairs.json new file mode 100644 index 0000000..3e59a44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_brick_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/nether_brick", + "top": "blocks/nether_brick", + "side": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage0.json new file mode 100644 index 0000000..d155e2b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage0.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/nether_wart_stage_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage1.json new file mode 100644 index 0000000..80be162 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/nether_wart_stage_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage2.json new file mode 100644 index 0000000..2ddadef --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/nether_wart_stage2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/nether_wart_stage_2" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/netherrack.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/netherrack.json new file mode 100644 index 0000000..9210846 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/netherrack.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/netherrack" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_curved.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_curved.json new file mode 100644 index 0000000..c850107 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_curved.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_curved", + "textures": { + "rail": "blocks/rail_normal_turned" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_flat.json new file mode 100644 index 0000000..3731790 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_flat.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_flat", + "textures": { + "rail": "blocks/rail_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_raised_ne.json new file mode 100644 index 0000000..7f137e6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_raised_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_ne", + "textures": { + "rail": "blocks/rail_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_raised_sw.json new file mode 100644 index 0000000..cdbd10c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_rail_raised_sw.json @@ -0,0 +1,6 @@ +{ + "parent": "block/rail_raised_sw", + "textures": { + "rail": "blocks/rail_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_torch.json new file mode 100644 index 0000000..6759646 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_torch.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch", + "textures": { + "torch": "blocks/torch_on" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_torch_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_torch_wall.json new file mode 100644 index 0000000..beec30e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/normal_torch_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch_wall", + "textures": { + "torch": "blocks/torch_on" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/noteblock.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/noteblock.json new file mode 100644 index 0000000..deffbc8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/noteblock.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/noteblock" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_bark.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_bark.json new file mode 100644 index 0000000..6c1c1cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/log_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_gate_closed.json new file mode 100644 index 0000000..2978a79 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_gate_open.json new file mode 100644 index 0000000..a9d1544 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_inventory.json new file mode 100644 index 0000000..7375ac3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_n.json new file mode 100644 index 0000000..08a517a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_n", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_ne.json new file mode 100644 index 0000000..d983712 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ne", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_ns.json new file mode 100644 index 0000000..c3e4467 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ns", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_nse.json new file mode 100644 index 0000000..88ab35c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nse", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_nsew.json new file mode 100644 index 0000000..d27fe1e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nsew", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_post.json new file mode 100644 index 0000000..f513324 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_inner_stairs.json new file mode 100644 index 0000000..09c7960 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/planks_oak", + "top": "blocks/planks_oak", + "side": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_leaves.json new file mode 100644 index 0000000..3c0a1a7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "blocks/leaves_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_log.json new file mode 100644 index 0000000..f58239c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_log.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/log_oak_top", + "side": "blocks/log_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_log_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_log_side.json new file mode 100644 index 0000000..a814627 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_log_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "blocks/log_oak_top", + "side": "blocks/log_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_outer_stairs.json new file mode 100644 index 0000000..b5672ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/planks_oak", + "top": "blocks/planks_oak", + "side": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_planks.json new file mode 100644 index 0000000..28d32ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_sapling.json new file mode 100644 index 0000000..c0ab14a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/sapling_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_stairs.json new file mode 100644 index 0000000..d883c85 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/planks_oak", + "top": "blocks/planks_oak", + "side": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_wall_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_wall_gate_closed.json new file mode 100644 index 0000000..e06923d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_wall_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_wall_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_wall_gate_open.json new file mode 100644 index 0000000..d8bcd0c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/oak_wall_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/obsidian.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/obsidian.json new file mode 100644 index 0000000..47dee09 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/obsidian.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/obsidian" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_n.json new file mode 100644 index 0000000..8b3dabc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_ne.json new file mode 100644 index 0000000..64c7ea1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_new.json new file mode 100644 index 0000000..059f81e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_ns.json new file mode 100644 index 0000000..b11b793 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nse.json new file mode 100644 index 0000000..8d4b145 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nsew.json new file mode 100644 index 0000000..a934382 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nsw.json new file mode 100644 index 0000000..4803747 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nw.json new file mode 100644 index 0000000..fe86a4d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_s.json new file mode 100644 index 0000000..e906b51 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_se.json new file mode 100644 index 0000000..5e684c9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_sew.json new file mode 100644 index 0000000..fc0f01b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_sw.json new file mode 100644 index 0000000..9a213a8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_orange", + "pane": "blocks/glass_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_tulip.json new file mode 100644 index 0000000..d7d3466 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_tulip.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_tulip_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_wool.json new file mode 100644 index 0000000..aa8dc14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orange_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_orange" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orchid.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orchid.json new file mode 100644 index 0000000..031880b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orchid.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_blue_orchid" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orientable.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orientable.json new file mode 100644 index 0000000..2efc9ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orientable.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "#front", + "down": "#top", + "up": "#top", + "north": "#front", + "east": "#side", + "south": "#side", + "west": "#side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orientable_vertical.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orientable_vertical.json new file mode 100644 index 0000000..5fb2223 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/orientable_vertical.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "#side", + "down": "#side", + "up": "#front", + "north": "#side", + "east": "#side", + "south": "#side", + "west": "#side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/outer_stairs.json new file mode 100644 index 0000000..26fb37f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/outer_stairs.json @@ -0,0 +1,29 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 8, 8, 8 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 8, 0, 16, 8 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 8, 8, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 0, 0, 8, 8 ], "texture": "#side" }, + "south": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 8, 0, 16, 8 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/packed_ice.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/packed_ice.json new file mode 100644 index 0000000..3cc22a2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/packed_ice.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/ice_packed" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_n.json new file mode 100644 index 0000000..01a2320 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_n.json @@ -0,0 +1,20 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 0, 0, 9, 16 ], "texture": "#pane" }, + "east": { "uv": [ 7, 0, 16, 16 ], "texture": "#pane" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_ne.json new file mode 100644 index 0000000..55b30c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_ne.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 0, 0, 9, 16 ], "texture": "#pane" }, + "east": { "uv": [ 7, 0, 16, 16 ], "texture": "#pane" } + } + }, + { "from": [ 9, 0, 7 ], + "to": [ 16, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 9, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 9, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 0, 0, 7, 16 ], "texture": "#pane" }, + "south": { "uv": [ 9, 0, 16, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#pane" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_new.json new file mode 100644 index 0000000..0e849f6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_new.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 7 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 7 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 16, 0, 9, 16 ], "texture": "#pane" }, + "east": { "uv": [ 9, 0, 16, 16 ], "texture": "#pane" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 16, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#pane" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_ns.json new file mode 100644 index 0000000..28fb606 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_ns.json @@ -0,0 +1,20 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cull": false }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cull": false }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane", "cull": false }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane", "cull": false } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nse.json new file mode 100644 index 0000000..cc996c5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nse.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" } + } + }, + { "from": [ 9, 0, 7 ], + "to": [ 16, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 9, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 9, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 0, 0, 7, 16 ], "texture": "#pane" }, + "south": { "uv": [ 9, 0, 16, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nsew.json new file mode 100644 index 0000000..0bf9def --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nsew.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 16, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nsw.json new file mode 100644 index 0000000..8dc14fb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nsw.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" }, + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#pane" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 7, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 7 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 7 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 7, 0, 0, 16 ], "texture": "#pane" }, + "south": { "uv": [ 0, 0, 7, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nw.json new file mode 100644 index 0000000..f24d1bd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_nw.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 9 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 16, 0, 7, 16 ], "texture": "#pane" }, + "east": { "uv": [ 7, 0, 16, 16 ], "texture": "#pane" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 7, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 7 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 7 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 7, 0, 0, 16 ], "texture": "#pane" }, + "south": { "uv": [ 0, 0, 7, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#pane" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_s.json new file mode 100644 index 0000000..53605fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_s.json @@ -0,0 +1,20 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 7, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 7, 7, 9, 16 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 9, 0, 0, 16 ], "texture": "#pane" }, + "east": { "uv": [ 0, 0, 9, 16 ], "texture": "#pane" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_se.json new file mode 100644 index 0000000..75d9d23 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_se.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 7, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 7, 7, 9, 16 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 9, 0, 0, 16 ], "texture": "#pane" }, + "east": { "uv": [ 0, 0, 9, 16 ], "texture": "#pane" } + } + }, + { "from": [ 9, 0, 7 ], + "to": [ 16, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 9, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 9, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 16, 0, 9, 16 ], "texture": "#pane" }, + "south": { "uv": [ 9, 0, 16, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#pane" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_sew.json new file mode 100644 index 0000000..8dc5afa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_sew.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 9 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 9, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 7, 9, 9, 16 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "south" }, + "west": { "uv": [ 7, 0, 0, 16 ], "texture": "#pane" }, + "east": { "uv": [ 0, 0, 7, 16 ], "texture": "#pane" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 16, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 16 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#pane" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_sw.json new file mode 100644 index 0000000..7a3f167 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pane_sw.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#pane" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 7, 9, 16 ], "texture": "#edge" }, + "up": { "uv": [ 7, 7, 9, 16 ], "texture": "#edge" }, + "north": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "north" }, + "south": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge" }, + "west": { "uv": [ 9, 0, 0, 16 ], "texture": "#pane" }, + "east": { "uv": [ 0, 0, 9, 16 ], "texture": "#pane" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 7, 16, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 0, 9, 7 ], "rotation": 90, "texture": "#edge" }, + "up": { "uv": [ 7, 0, 9, 7 ], "rotation": 90, "texture": "#edge" }, + "north": { "uv": [ 7, 0, 0, 16 ], "texture": "#pane" }, + "south": { "uv": [ 0, 0, 7, 16 ], "texture": "#pane" }, + "west": { "uv": [ 7, 0, 9, 16 ], "texture": "#edge", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 16 ], "texture": "#pane" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_n.json new file mode 100644 index 0000000..9fb4bb3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_ne.json new file mode 100644 index 0000000..bd53200 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_new.json new file mode 100644 index 0000000..1f76f05 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_ns.json new file mode 100644 index 0000000..db7a1cb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nse.json new file mode 100644 index 0000000..21e257c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nsew.json new file mode 100644 index 0000000..848ba80 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nsw.json new file mode 100644 index 0000000..10245b1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nw.json new file mode 100644 index 0000000..b3c4e78 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_s.json new file mode 100644 index 0000000..1d82212 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_se.json new file mode 100644 index 0000000..c6e68f8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_sew.json new file mode 100644 index 0000000..b61f4c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_sw.json new file mode 100644 index 0000000..523385c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_pink", + "pane": "blocks/glass_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_tulip.json new file mode 100644 index 0000000..9cef0d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_tulip.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_tulip_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_wool.json new file mode 100644 index 0000000..4aadbad --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pink_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_pink" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston.json new file mode 100644 index 0000000..83b4e18 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "rotation": 180, "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#platform", "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "rotation": 270, "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "rotation": 90, "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_extended.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_extended.json new file mode 100644 index 0000000..45e04a3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_extended.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 4 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "down", "rotation": 180 }, + "up": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#inside" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "south" }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "west", "rotation": 270 }, + "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "east", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_extended_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_extended_normal.json new file mode 100644 index 0000000..28420b9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_extended_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/piston_extended", + "textures": { + "bottom": "blocks/piston_bottom", + "side": "blocks/piston_side", + "inside": "blocks/piston_inner" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head.json new file mode 100644 index 0000000..5c61107 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head.json @@ -0,0 +1,36 @@ +{ + "textures": { + "particle": "#platform" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 4 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "cullface": "down", "rotation": 180 }, + "up": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#platform", "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#unsticky" }, + "west": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "rotation": 270, "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "rotation": 90, "cullface": "east" } + } + }, + { "from": [ 6, 6, 4 ], + "to": [ 10, 10, 16 ], + "faces": { + "down": { "uv": [ 4, 0, 16, 4 ], "texture": "#side", "rotation": 90 }, + "up": { "uv": [ 4, 0, 16, 4 ], "texture": "#side", "rotation": 270 }, + "west": { "uv": [ 16, 4, 4, 0 ], "texture": "#side" }, + "east": { "uv": [ 4, 0, 16, 4 ], "texture": "#side" } + } + }, + { "from": [ 6, 6, 16 ], + "to": [ 10, 10, 20 ], + "faces": { + "down": { "uv": [ 0, 0, 4, 4 ], "texture": "#side", "rotation": 90 }, + "up": { "uv": [ 0, 0, 4, 4 ], "texture": "#side", "rotation": 270 }, + "west": { "uv": [ 4, 4, 0, 0 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 4, 4 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_normal.json new file mode 100644 index 0000000..330c848 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/piston_head", + "textures": { + "unsticky": "blocks/piston_top_normal", + "side": "blocks/piston_side", + "platform": "blocks/piston_top_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short.json new file mode 100644 index 0000000..cdbe9e1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short.json @@ -0,0 +1,27 @@ +{ + "textures": { + "particle": "#platform" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 4 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "cullface": "down", "rotation": 180 }, + "up": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#platform", "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#unsticky" }, + "west": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "rotation": 270, "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 4 ], "texture": "#side", "rotation": 90, "cullface": "east" } + } + }, + { "from": [ 6, 6, 4 ], + "to": [ 10, 10, 16 ], + "faces": { + "down": { "uv": [ 4, 0, 16, 4 ], "texture": "#side", "rotation": 90 }, + "up": { "uv": [ 4, 0, 16, 4 ], "texture": "#side", "rotation": 270 }, + "west": { "uv": [ 16, 4, 4, 0 ], "texture": "#side" }, + "east": { "uv": [ 4, 0, 16, 4 ], "texture": "#side" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short_normal.json new file mode 100644 index 0000000..0601320 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/piston_head_short", + "textures": { + "unsticky": "blocks/piston_top_normal", + "side": "blocks/piston_side", + "platform": "blocks/piston_top_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short_sticky.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short_sticky.json new file mode 100644 index 0000000..c4fe4d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_short_sticky.json @@ -0,0 +1,8 @@ +{ + "parent": "block/piston_head_short", + "textures": { + "unsticky": "blocks/piston_top_normal", + "side": "blocks/piston_side", + "platform": "blocks/piston_top_sticky" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_sticky.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_sticky.json new file mode 100644 index 0000000..fc6bb20 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_head_sticky.json @@ -0,0 +1,8 @@ +{ + "parent": "block/piston_head", + "textures": { + "unsticky": "blocks/piston_top_normal", + "side": "blocks/piston_side", + "platform": "blocks/piston_top_sticky" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_inventory_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_inventory_normal.json new file mode 100644 index 0000000..c094e00 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_inventory_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/piston_bottom", + "side": "blocks/piston_side", + "top": "blocks/piston_top_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_inventory_sticky.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_inventory_sticky.json new file mode 100644 index 0000000..f9eeb7e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_inventory_sticky.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/piston_bottom", + "side": "blocks/piston_side", + "top": "blocks/piston_top_sticky" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_normal.json new file mode 100644 index 0000000..9f0c65e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/piston_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/piston", + "textures": { + "bottom": "blocks/piston_bottom", + "side": "blocks/piston_side", + "platform": "blocks/piston_top_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/podzol.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/podzol.json new file mode 100644 index 0000000..90b9369 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/podzol.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/dirt", + "top": "blocks/dirt_podzol_top", + "side": "blocks/dirt_podzol_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/poppy.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/poppy.json new file mode 100644 index 0000000..b79edb6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/poppy.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_rose" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/portal_ew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/portal_ew.json new file mode 100644 index 0000000..8148488 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/portal_ew.json @@ -0,0 +1,15 @@ +{ + "textures": { + "particle": "blocks/portal", + "portal": "blocks/portal" + }, + "elements": [ + { "from": [ 6, 0, 0 ], + "to": [ 10, 16, 16 ], + "faces": { + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#portal" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#portal" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/portal_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/portal_ns.json new file mode 100644 index 0000000..8af9808 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/portal_ns.json @@ -0,0 +1,15 @@ +{ + "textures": { + "particle": "blocks/portal", + "portal": "blocks/portal" + }, + "elements": [ + { "from": [ 0, 0, 6 ], + "to": [ 16, 16, 10 ], + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#portal" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#portal" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage0.json new file mode 100644 index 0000000..26a54f0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage0.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/potatoes_stage_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage1.json new file mode 100644 index 0000000..8eb64e6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/potatoes_stage_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage2.json new file mode 100644 index 0000000..0cc9c87 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/potatoes_stage_2" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage3.json new file mode 100644 index 0000000..5aca639 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/potatoes_stage3.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/potatoes_stage_3" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_down.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_down.json new file mode 100644 index 0000000..5911d94 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_down.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 0.5, 15 ], + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#texture" }, + "north": { "uv": [ 1, 15.5, 15, 16 ], "texture": "#texture" }, + "south": { "uv": [ 1, 15.5, 15, 16 ], "texture": "#texture" }, + "west": { "uv": [ 1, 15.5, 15, 16 ], "texture": "#texture" }, + "east": { "uv": [ 1, 15.5, 15, 16 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_inventory.json new file mode 100644 index 0000000..7465856 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_inventory.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 1, 6, 1 ], + "to": [ 15, 10, 15 ], + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#texture" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#texture" }, + "north": { "uv": [ 1, 6, 15, 10 ], "texture": "#texture" }, + "south": { "uv": [ 1, 6, 15, 10 ], "texture": "#texture" }, + "west": { "uv": [ 1, 6, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 1, 6, 15, 10 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_up.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_up.json new file mode 100644 index 0000000..179ee9b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pressure_plate_up.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 1, 0, 1 ], + "to": [ 15, 1, 15 ], + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#texture" }, + "north": { "uv": [ 1, 15, 15, 16 ], "texture": "#texture" }, + "south": { "uv": [ 1, 15, 15, 16 ], "texture": "#texture" }, + "west": { "uv": [ 1, 15, 15, 16 ], "texture": "#texture" }, + "east": { "uv": [ 1, 15, 15, 16 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_bricks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_bricks.json new file mode 100644 index 0000000..572b27b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_bricks.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/prismarine_bricks" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_dark.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_dark.json new file mode 100644 index 0000000..611d9a8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_dark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/prismarine_dark" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_rough.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_rough.json new file mode 100644 index 0000000..5be6300 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/prismarine_rough.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/prismarine_rough" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin.json new file mode 100644 index 0000000..8ac2d79 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin.json @@ -0,0 +1,8 @@ +{ + "parent": "block/orientable", + "textures": { + "top": "blocks/pumpkin_top", + "front": "blocks/pumpkin_face_off", + "side": "blocks/pumpkin_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_fruit.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_fruit.json new file mode 100644 index 0000000..ea00b65 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_fruit.json @@ -0,0 +1,7 @@ +{ + "parent": "block/stem_fruit", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected", + "upperstem": "blocks/pumpkin_stem_connected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth0.json new file mode 100644 index 0000000..34758d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth0.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth0", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth1.json new file mode 100644 index 0000000..21f87cc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth1", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth2.json new file mode 100644 index 0000000..f021a6d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth2", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth3.json new file mode 100644 index 0000000..ad04547 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth3.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth3", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth4.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth4.json new file mode 100644 index 0000000..5daa859 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth4.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth4", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth5.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth5.json new file mode 100644 index 0000000..8fde351 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth5.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth5", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth6.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth6.json new file mode 100644 index 0000000..e428d4c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth6.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth6", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth7.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth7.json new file mode 100644 index 0000000..43c721a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/pumpkin_stem_growth7.json @@ -0,0 +1,6 @@ +{ + "parent": "block/stem_growth7", + "textures": { + "stem": "blocks/pumpkin_stem_disconnected" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_n.json new file mode 100644 index 0000000..69e1962 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_ne.json new file mode 100644 index 0000000..7efb723 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_new.json new file mode 100644 index 0000000..714aa54 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_ns.json new file mode 100644 index 0000000..bf049cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nse.json new file mode 100644 index 0000000..f37ddea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nsew.json new file mode 100644 index 0000000..5f7fd23 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nsw.json new file mode 100644 index 0000000..2872467 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nw.json new file mode 100644 index 0000000..d7214a9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_s.json new file mode 100644 index 0000000..0aa0016 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_se.json new file mode 100644 index 0000000..1f7b610 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_sew.json new file mode 100644 index 0000000..8414e69 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_sw.json new file mode 100644 index 0000000..47d224a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_purple", + "pane": "blocks/glass_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_wool.json new file mode 100644 index 0000000..2c50318 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/purple_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_purple" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_chiseled.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_chiseled.json new file mode 100644 index 0000000..25819d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "side": "blocks/quartz_block_chiseled", + "end": "blocks/quartz_block_chiseled_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_inner_stairs.json new file mode 100644 index 0000000..5b6903a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/quartz_block_bottom", + "top": "blocks/quartz_block_top", + "side": "blocks/quartz_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_lines.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_lines.json new file mode 100644 index 0000000..fa2de86 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_lines.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/quartz_block_lines_top", + "side": "blocks/quartz_block_lines" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_normal.json new file mode 100644 index 0000000..de04c92 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/quartz_block_bottom", + "top": "blocks/quartz_block_top", + "side": "blocks/quartz_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_ore.json new file mode 100644 index 0000000..b9c850b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/quartz_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_outer_stairs.json new file mode 100644 index 0000000..975ae92 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/quartz_block_bottom", + "top": "blocks/quartz_block_top", + "side": "blocks/quartz_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_stairs.json new file mode 100644 index 0000000..448e4d5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/quartz_block_bottom", + "top": "blocks/quartz_block_top", + "side": "blocks/quartz_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_top.json new file mode 100644 index 0000000..e5ddc31 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/quartz_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/quartz_block_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_curved.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_curved.json new file mode 100644 index 0000000..299a44b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_curved.json @@ -0,0 +1,15 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#rail" + }, + "elements": [ + { "from": [ 0, 1, 0 ], + "to": [ 16, 1, 16 ], + "faces": { + "down": { "uv": [ 0, 16, 16, 0 ], "texture": "#rail" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#rail" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_flat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_flat.json new file mode 100644 index 0000000..299a44b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_flat.json @@ -0,0 +1,15 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#rail" + }, + "elements": [ + { "from": [ 0, 1, 0 ], + "to": [ 16, 1, 16 ], + "faces": { + "down": { "uv": [ 0, 16, 16, 0 ], "texture": "#rail" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#rail" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_raised_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_raised_ne.json new file mode 100644 index 0000000..a92e460 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_raised_ne.json @@ -0,0 +1,21 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#rail" + }, + "elements": [ + { "from": [ 0, 9, 0 ], + "to": [ 16, 9, 16 ], + "rotation": { + "origin": [ 8, 9, 8 ], + "axis": "x", + "angle": 45, + "rescale": true + }, + "faces": { + "down": { "uv": [ 0, 16, 16, 0 ], "texture": "#rail" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#rail" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_raised_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_raised_sw.json new file mode 100644 index 0000000..dddc356 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/rail_raised_sw.json @@ -0,0 +1,21 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#rail" + }, + "elements": [ + { "from": [ 0, 9, 0 ], + "to": [ 16, 9, 16 ], + "rotation": { + "origin": [ 8, 9, 8 ], + "axis": "x", + "angle": -45, + "rescale": true + }, + "faces": { + "down": { "uv": [ 0, 16, 16, 0 ], "texture": "#rail" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#rail" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom.json new file mode 100644 index 0000000..53a7ab1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/mushroom_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_c.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_c.json new file mode 100644 index 0000000..8d5dbc5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_c.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_cap_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_cap_all.json new file mode 100644 index 0000000..63e222b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_cap_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/mushroom_block_skin_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_e.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_e.json new file mode 100644 index 0000000..e81f611 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_e.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_skin_red", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_inside_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_inside_all.json new file mode 100644 index 0000000..472dc8a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_inside_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_n.json new file mode 100644 index 0000000..57d8a3f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_n.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_skin_red", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_ne.json new file mode 100644 index 0000000..ea6ad86 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_ne.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_skin_red", + "east": "blocks/mushroom_block_skin_red", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_nw.json new file mode 100644 index 0000000..84ff71e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_nw.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_skin_red", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_skin_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_s.json new file mode 100644 index 0000000..c73f739 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_s.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_skin_red", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_se.json new file mode 100644 index 0000000..2c151d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_se.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_skin_red", + "south": "blocks/mushroom_block_skin_red", + "west": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_stem.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_stem.json new file mode 100644 index 0000000..b839c9a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_stem.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "side": "blocks/mushroom_block_skin_stem", + "end": "blocks/mushroom_block_inside" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_stem_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_stem_all.json new file mode 100644 index 0000000..73434e4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_stem_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/mushroom_block_skin_stem" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_sw.json new file mode 100644 index 0000000..9ee1f30 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_sw.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_skin_red", + "west": "blocks/mushroom_block_skin_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_w.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_w.json new file mode 100644 index 0000000..c4aaa2c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_mushroom_block_w.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "particle": "blocks/mushroom_block_inside", + "down": "blocks/mushroom_block_inside", + "up": "blocks/mushroom_block_skin_red", + "north": "blocks/mushroom_block_inside", + "east": "blocks/mushroom_block_inside", + "south": "blocks/mushroom_block_inside", + "west": "blocks/mushroom_block_skin_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_n.json new file mode 100644 index 0000000..82b5059 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_ne.json new file mode 100644 index 0000000..502b7e4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_new.json new file mode 100644 index 0000000..34ab569 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_ns.json new file mode 100644 index 0000000..0cd670a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nse.json new file mode 100644 index 0000000..901ea34 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nsew.json new file mode 100644 index 0000000..f6f31c0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nsw.json new file mode 100644 index 0000000..0200f39 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nw.json new file mode 100644 index 0000000..cef0587 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_s.json new file mode 100644 index 0000000..15d3944 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_se.json new file mode 100644 index 0000000..0af592c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_sew.json new file mode 100644 index 0000000..f3ef6c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_sw.json new file mode 100644 index 0000000..8a55dd6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_red", + "pane": "blocks/glass_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sand.json new file mode 100644 index 0000000..7c72d64 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sand.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/red_sand" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_all.json new file mode 100644 index 0000000..49631ce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/red_sandstone_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_chiseled.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_chiseled.json new file mode 100644 index 0000000..cf0a1fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_carved" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_inner_stairs.json new file mode 100644 index 0000000..11da043 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/red_sandstone_bottom", + "top": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_normal.json new file mode 100644 index 0000000..36e5008 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/red_sandstone_bottom", + "top": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_outer_stairs.json new file mode 100644 index 0000000..a43de10 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/red_sandstone_bottom", + "top": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_smooth.json new file mode 100644 index 0000000..2ec015d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_smooth.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_smooth" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_stairs.json new file mode 100644 index 0000000..dcc9496 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_sandstone_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/red_sandstone_bottom", + "top": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_tulip.json new file mode 100644 index 0000000..56b41be --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_tulip.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_tulip_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_wool.json new file mode 100644 index 0000000..da67b18 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/red_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_red" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_block.json new file mode 100644 index 0000000..313e6bd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/redstone_block" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_n.json new file mode 100644 index 0000000..5e4f139 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_n.json @@ -0,0 +1,26 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ne.json new file mode 100644 index 0000000..03fe2ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ne.json @@ -0,0 +1,26 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#crossoverlay" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_none.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_none.json new file mode 100644 index 0000000..57dc7c5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_none.json @@ -0,0 +1,26 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 5 ], + "to": [ 11, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 5, 11, 11 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 5 ], + "to": [ 11, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 5, 11, 11 ], "texture": "#crossoverlay" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nse.json new file mode 100644 index 0000000..6bc7eda --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nse.json @@ -0,0 +1,26 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nsew.json new file mode 100644 index 0000000..453e4df --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nsew.json @@ -0,0 +1,26 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#crossoverlay" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nsue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nsue.json new file mode 100644 index 0000000..2dd5d01 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nsue.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 270, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 270 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nue.json new file mode 100644 index 0000000..fc5c15e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nue.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 270, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 270 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nuse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nuse.json new file mode 100644 index 0000000..ee9f443 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nuse.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nusue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nusue.json new file mode 100644 index 0000000..ae01264 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_nusue.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ore.json new file mode 100644 index 0000000..8285da6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/redstone_ore" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ueuw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ueuw.json new file mode 100644 index 0000000..409d4dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_ueuw.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay" } + } + }, + { "from": [ 0.25, 0, 0 ], + "to": [ 0.25, 16, 16 ], + "shade": false, + "faces": { + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0.25, 0, 0 ], + "to": [ 0.25, 16, 16 ], + "shade": false, + "faces": { + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_uew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_uew.json new file mode 100644 index 0000000..4f142fa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_uew.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay" } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_une.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_une.json new file mode 100644 index 0000000..9822d82 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_une.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_uns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_uns.json new file mode 100644 index 0000000..e2a9e56 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_uns.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unse.json new file mode 100644 index 0000000..188da39 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unse.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsew.json new file mode 100644 index 0000000..83d96c9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsew.json @@ -0,0 +1,40 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsue.json new file mode 100644 index 0000000..afceb39 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsue.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsuew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsuew.json new file mode 100644 index 0000000..5c694c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unsuew.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unue.json new file mode 100644 index 0000000..835303d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unue.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 11 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 11 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unus.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unus.json new file mode 100644 index 0000000..25c8897 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unus.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unuse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unuse.json new file mode 100644 index 0000000..5e0d29a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unuse.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusew.json new file mode 100644 index 0000000..eff9b65 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusew.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusue.json new file mode 100644 index 0000000..1eca773 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusue.json @@ -0,0 +1,68 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 5, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 5, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusueuw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusueuw.json new file mode 100644 index 0000000..76c9767 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusueuw.json @@ -0,0 +1,82 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0.25, 0, 0 ], + "to": [ 0.25, 16, 16 ], + "shade": false, + "faces": { + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0.25, 0, 0 ], + "to": [ 0.25, 16, 16 ], + "shade": false, + "faces": { + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusuew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusuew.json new file mode 100644 index 0000000..530af4b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/redstone_unusuew.json @@ -0,0 +1,68 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/redstone_dust_cross", + "cross": "blocks/redstone_dust_cross", + "crossoverlay": "blocks/redstone_dust_cross_overlay", + "line": "blocks/redstone_dust_line", + "lineoverlay": "blocks/redstone_dust_line_overlay" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#crossoverlay" } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.25 ], + "to": [ 16, 16, 0.25 ], + "shade": false, + "faces": { + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.75 ], + "to": [ 16, 16, 15.75 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#line", "rotation": 90, "tintindex": 0 } + } + }, + { "from": [ 15.75, 0, 0 ], + "to": [ 15.75, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#lineoverlay", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/reeds.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/reeds.json new file mode 100644 index 0000000..ac5a38d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/reeds.json @@ -0,0 +1,6 @@ +{ + "parent": "block/tallgrass", + "textures": { + "cross": "blocks/reeds" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_1tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_1tick.json new file mode 100644 index 0000000..d49a67b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_1tick.json @@ -0,0 +1,44 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 2, 6 ], + "to": [ 9, 7, 8 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_2tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_2tick.json new file mode 100644 index 0000000..98c94ef --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_2tick.json @@ -0,0 +1,44 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 2, 8 ], + "to": [ 9, 7, 10 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_3tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_3tick.json new file mode 100644 index 0000000..3a3a11f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_3tick.json @@ -0,0 +1,44 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 2, 10 ], + "to": [ 9, 7, 12 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_4tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_4tick.json new file mode 100644 index 0000000..cbcf0b6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_4tick.json @@ -0,0 +1,44 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 2, 12 ], + "to": [ 9, 7, 14 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_1tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_1tick.json new file mode 100644 index 0000000..e62956f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_1tick.json @@ -0,0 +1,45 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "lock": "blocks/bedrock", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 6 ], + "to": [ 14, 4, 8 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_2tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_2tick.json new file mode 100644 index 0000000..f9a1455 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_2tick.json @@ -0,0 +1,45 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "lock": "blocks/bedrock", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 8 ], + "to": [ 14, 4, 10 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_3tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_3tick.json new file mode 100644 index 0000000..ff850a6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_3tick.json @@ -0,0 +1,45 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "lock": "blocks/bedrock", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 10 ], + "to": [ 14, 4, 12 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_4tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_4tick.json new file mode 100644 index 0000000..d0ed026 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_locked_4tick.json @@ -0,0 +1,45 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_off", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_off", + "lock": "blocks/bedrock", + "unlit": "blocks/redstone_torch_off" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 12 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 2, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#unlit" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#unlit" }, + "north": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "south": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "west": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" }, + "east": { "uv": [ 7, 6, 9, 11 ], "texture": "#unlit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_1tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_1tick.json new file mode 100644 index 0000000..8034f6d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_1tick.json @@ -0,0 +1,62 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 7, 6 ], + "to": [ 9, 7, 8 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 5 ], + "to": [ 9, 8, 9 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 6 ], + "to": [ 10, 8, 8 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_2tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_2tick.json new file mode 100644 index 0000000..4a077fa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_2tick.json @@ -0,0 +1,62 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 7, 8 ], + "to": [ 9, 7, 10 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 7 ], + "to": [ 9, 8, 11 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 8 ], + "to": [ 10, 8, 10 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_3tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_3tick.json new file mode 100644 index 0000000..75edf5f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_3tick.json @@ -0,0 +1,62 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 7, 10 ], + "to": [ 9, 7, 12 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 9 ], + "to": [ 9, 8, 13 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 10 ], + "to": [ 10, 8, 12 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_4tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_4tick.json new file mode 100644 index 0000000..f67ff94 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_4tick.json @@ -0,0 +1,62 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 7, 7, 12 ], + "to": [ 9, 7, 14 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 11 ], + "to": [ 9, 8, 15 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 12 ], + "to": [ 10, 8, 14 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_1tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_1tick.json new file mode 100644 index 0000000..8e01a79 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_1tick.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on", + "lock": "blocks/bedrock" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 6 ], + "to": [ 14, 4, 8 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_2tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_2tick.json new file mode 100644 index 0000000..31556f3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_2tick.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on", + "lock": "blocks/bedrock" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 8 ], + "to": [ 14, 4, 10 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_3tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_3tick.json new file mode 100644 index 0000000..b8352e5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_3tick.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on", + "lock": "blocks/bedrock" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 10 ], + "to": [ 14, 4, 12 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_4tick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_4tick.json new file mode 100644 index 0000000..f7664ee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/repeater_on_locked_4tick.json @@ -0,0 +1,54 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/repeater_on", + "slab": "blocks/stone_slab_top", + "top": "blocks/repeater_on", + "lit": "blocks/redstone_torch_on", + "lock": "blocks/bedrock" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" } + } + }, + { "from": [ 2, 2, 12 ], + "to": [ 14, 4, 14 ], + "faces": { + "down": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "up": { "uv": [ 7, 2, 9, 14 ], "texture": "#lock", "rotation": 90 }, + "north": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "south": { "uv": [ 2, 7, 14, 9 ], "texture": "#lock" }, + "west": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" }, + "east": { "uv": [ 6, 7, 8, 9 ], "texture": "#lock" } + } + }, + { "from": [ 7, 7, 2 ], + "to": [ 9, 7, 4 ], + "faces": { + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" } + } + }, + { "from": [ 7, 2, 1 ], + "to": [ 9, 8, 5 ], + "faces": { + "west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + }, + { "from": [ 6, 2, 2 ], + "to": [ 10, 8, 4 ], + "faces": { + "north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }, + "south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sand.json new file mode 100644 index 0000000..96c7982 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sand.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/sand" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_all.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_all.json new file mode 100644 index 0000000..834be32 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_all.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/sandstone_top" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_chiseled.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_chiseled.json new file mode 100644 index 0000000..a89f4d2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_chiseled.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/sandstone_top", + "side": "blocks/sandstone_carved" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_inner_stairs.json new file mode 100644 index 0000000..9ef52b0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/sandstone_bottom", + "top": "blocks/sandstone_top", + "side": "blocks/sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_normal.json new file mode 100644 index 0000000..5651d6f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_normal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/sandstone_bottom", + "top": "blocks/sandstone_top", + "side": "blocks/sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_outer_stairs.json new file mode 100644 index 0000000..4a93915 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/sandstone_bottom", + "top": "blocks/sandstone_top", + "side": "blocks/sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_smooth.json new file mode 100644 index 0000000..dace295 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_smooth.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/sandstone_top", + "side": "blocks/sandstone_smooth" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_stairs.json new file mode 100644 index 0000000..b14026a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sandstone_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/sandstone_bottom", + "top": "blocks/sandstone_top", + "side": "blocks/sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sea_lantern.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sea_lantern.json new file mode 100644 index 0000000..45f8859 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sea_lantern.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/sea_lantern" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_n.json new file mode 100644 index 0000000..b3016dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_ne.json new file mode 100644 index 0000000..d5ad644 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_new.json new file mode 100644 index 0000000..7d62fe5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_ns.json new file mode 100644 index 0000000..fe656df --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nse.json new file mode 100644 index 0000000..fb9c6da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nsew.json new file mode 100644 index 0000000..af3b319 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nsw.json new file mode 100644 index 0000000..5eb1c4b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nw.json new file mode 100644 index 0000000..b09e7ce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_s.json new file mode 100644 index 0000000..c4dc543 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_se.json new file mode 100644 index 0000000..4414b7f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_sew.json new file mode 100644 index 0000000..c6e1907 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_sw.json new file mode 100644 index 0000000..f430eff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_silver", + "pane": "blocks/glass_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_wool.json new file mode 100644 index 0000000..04d6d55 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/silver_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_silver" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/slime.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/slime.json new file mode 100644 index 0000000..665f688 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/slime.json @@ -0,0 +1,30 @@ +{ + "textures": { + "particle": "blocks/slime", + "texture": "blocks/slime" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { "from": [ 3, 3, 3 ], + "to": [ 13, 13, 13 ], + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "north": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "south": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "west": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "east": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow.json new file mode 100644 index 0000000..328a45e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/snow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height10.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height10.json new file mode 100644 index 0000000..b3fa4ac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height10.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/snow", + "texture": "blocks/snow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 10, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height12.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height12.json new file mode 100644 index 0000000..3d70635 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height12.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/snow", + "texture": "blocks/snow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 12, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height14.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height14.json new file mode 100644 index 0000000..b25587f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height14.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/snow", + "texture": "blocks/snow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 14, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height2.json new file mode 100644 index 0000000..eed1264 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height2.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/snow", + "texture": "blocks/snow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height4.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height4.json new file mode 100644 index 0000000..350d561 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height4.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/snow", + "texture": "blocks/snow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 4, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height6.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height6.json new file mode 100644 index 0000000..ef3f511 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height6.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/snow", + "texture": "blocks/snow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height8.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height8.json new file mode 100644 index 0000000..e827362 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/snow_height8.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/snow", + "texture": "blocks/snow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/soul_sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/soul_sand.json new file mode 100644 index 0000000..157c438 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/soul_sand.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/soul_sand" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sponge.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sponge.json new file mode 100644 index 0000000..c26f2b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sponge.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/sponge" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sponge_wet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sponge_wet.json new file mode 100644 index 0000000..91c4641 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sponge_wet.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/sponge_wet" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_bark.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_bark.json new file mode 100644 index 0000000..9ce86b6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/log_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_bottom.json new file mode 100644 index 0000000..1b4e50b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_spruce_lower", + "top": "blocks/door_spruce_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_bottom_rh.json new file mode 100644 index 0000000..1c1e4a3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_spruce_lower", + "top": "blocks/door_spruce_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_top.json new file mode 100644 index 0000000..fcd396d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_spruce_lower", + "top": "blocks/door_spruce_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_top_rh.json new file mode 100644 index 0000000..e386f9a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_door_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_spruce_lower", + "top": "blocks/door_spruce_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_gate_closed.json new file mode 100644 index 0000000..54eea65 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_gate_open.json new file mode 100644 index 0000000..8f09c6a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_inventory.json new file mode 100644 index 0000000..a778f2e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_n.json new file mode 100644 index 0000000..231e79d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_n.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_n", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_ne.json new file mode 100644 index 0000000..b8bf814 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_ne.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ne", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_ns.json new file mode 100644 index 0000000..e2d45ce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_ns.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_ns", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_nse.json new file mode 100644 index 0000000..f10415f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_nse.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nse", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_nsew.json new file mode 100644 index 0000000..166e558 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_nsew.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_nsew", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_post.json new file mode 100644 index 0000000..0830993 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_fence_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_inner_stairs.json new file mode 100644 index 0000000..ea0c084 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/planks_spruce", + "top": "blocks/planks_spruce", + "side": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_leaves.json new file mode 100644 index 0000000..15332cb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "blocks/leaves_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_log.json new file mode 100644 index 0000000..e021f2b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_log.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "blocks/log_spruce_top", + "side": "blocks/log_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_log_side.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_log_side.json new file mode 100644 index 0000000..ad69e4b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_log_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "blocks/log_spruce_top", + "side": "blocks/log_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_outer_stairs.json new file mode 100644 index 0000000..a50338c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/planks_spruce", + "top": "blocks/planks_spruce", + "side": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_planks.json new file mode 100644 index 0000000..f5c9c84 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_planks.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_sapling.json new file mode 100644 index 0000000..d2defbf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/sapling_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_stairs.json new file mode 100644 index 0000000..1781208 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/planks_spruce", + "top": "blocks/planks_spruce", + "side": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_wall_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_wall_gate_closed.json new file mode 100644 index 0000000..4f911e3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_wall_gate_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_wall_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_wall_gate_open.json new file mode 100644 index 0000000..ea94990 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/spruce_wall_gate_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stairs.json new file mode 100644 index 0000000..c13f02b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stairs.json @@ -0,0 +1,29 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { "from": [ 8, 8, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 8, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 8, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_fruit.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_fruit.json new file mode 100644 index 0000000..86d59c6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_fruit.json @@ -0,0 +1,31 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 7, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 8 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 8 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 7, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 8 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 8 ], + "to": [ 9, 16, 8 ], + "faces": { + "north": { "uv": [ 9, 0, 0, 16 ], "texture": "#upperstem", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 9, 16 ], "texture": "#upperstem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth0.json new file mode 100644 index 0000000..6e97731 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth0.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 1, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 2 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 2 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 1, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 2 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 2 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth1.json new file mode 100644 index 0000000..ea97f75 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth1.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 3, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 4 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 4 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 3, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 4 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 4 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth2.json new file mode 100644 index 0000000..4ab6f4c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth2.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 5, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 6 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 6 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 5, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 6 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 6 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth3.json new file mode 100644 index 0000000..542a820 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth3.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 7, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 8 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 8 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 7, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 8 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth4.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth4.json new file mode 100644 index 0000000..77befce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth4.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 9, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 10 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 10 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 9, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 10 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 10 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth5.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth5.json new file mode 100644 index 0000000..678450e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth5.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 11, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 12 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 12 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 11, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 12 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 12 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth6.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth6.json new file mode 100644 index 0000000..523974e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth6.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 13, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 14 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 14 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 13, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 14 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 14 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth7.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth7.json new file mode 100644 index 0000000..bd4f9d1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stem_growth7.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#stem" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 15, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#stem", "tintindex": 0 }, + "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#stem", "tintindex": 0 } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 15, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#stem", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#stem", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sticky_piston.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sticky_piston.json new file mode 100644 index 0000000..7edfddc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/sticky_piston.json @@ -0,0 +1,8 @@ +{ + "parent": "block/piston", + "textures": { + "bottom": "blocks/piston_bottom", + "side": "blocks/piston_side", + "platform": "blocks/piston_top_sticky" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone.json new file mode 100644 index 0000000..8e85b9a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_inner_stairs.json new file mode 100644 index 0000000..6be865a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/stonebrick", + "top": "blocks/stonebrick", + "side": "blocks/stonebrick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_outer_stairs.json new file mode 100644 index 0000000..cffe696 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/stonebrick", + "top": "blocks/stonebrick", + "side": "blocks/stonebrick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_stairs.json new file mode 100644 index 0000000..0101de4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_brick_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/stonebrick", + "top": "blocks/stonebrick", + "side": "blocks/stonebrick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button.json new file mode 100644 index 0000000..e72a869 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button", + "textures": { + "texture": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button_inventory.json new file mode 100644 index 0000000..ad62f2f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button_inventory", + "textures": { + "texture": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button_pressed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button_pressed.json new file mode 100644 index 0000000..3dfa680 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_button_pressed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button_pressed", + "textures": { + "texture": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_inner_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_inner_stairs.json new file mode 100644 index 0000000..22bb23b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "blocks/cobblestone", + "top": "blocks/cobblestone", + "side": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_mirrored.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_mirrored.json new file mode 100644 index 0000000..5d3d2ad --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_mirrored.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_mirrored_all", + "textures": { + "all": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_outer_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_outer_stairs.json new file mode 100644 index 0000000..effcad2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "blocks/cobblestone", + "top": "blocks/cobblestone", + "side": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_down.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_down.json new file mode 100644 index 0000000..36259c7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_down.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_down", + "textures": { + "texture": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_inventory.json new file mode 100644 index 0000000..34454c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_inventory", + "textures": { + "texture": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_up.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_up.json new file mode 100644 index 0000000..40973b2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_pressure_plate_up.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_up", + "textures": { + "texture": "blocks/stone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_stairs.json new file mode 100644 index 0000000..e20cd88 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stone_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "blocks/cobblestone", + "top": "blocks/cobblestone", + "side": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_chiseled.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_chiseled.json new file mode 100644 index 0000000..c3e94d5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_chiseled.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stonebrick_carved" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_cracked.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_cracked.json new file mode 100644 index 0000000..38ce12f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_cracked.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stonebrick_cracked" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_mossy.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_mossy.json new file mode 100644 index 0000000..3c2ad21 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_mossy.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stonebrick_mossy" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_normal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_normal.json new file mode 100644 index 0000000..baf191d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/stonebrick_normal.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/stonebrick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tall_grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tall_grass.json new file mode 100644 index 0000000..e6bed7d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tall_grass.json @@ -0,0 +1,6 @@ +{ + "parent": "block/tallgrass", + "textures": { + "cross": "blocks/tallgrass" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tallgrass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tallgrass.json new file mode 100644 index 0000000..d3b5474 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tallgrass.json @@ -0,0 +1,26 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#cross" + }, + "elements": [ + { "from": [ 0.8, 0, 8 ], + "to": [ 15.2, 16, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + }, + { "from": [ 8, 0, 0.8 ], + "to": [ 8, 16, 15.2 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#cross", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tnt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tnt.json new file mode 100644 index 0000000..e4aa777 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tnt.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "blocks/tnt_bottom", + "top": "blocks/tnt_top", + "side": "blocks/tnt_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/torch.json new file mode 100644 index 0000000..aef12fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/torch.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#torch" + }, + "elements": [ + { "from": [ 7, 0, 7 ], + "to": [ 9, 10, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#torch" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#torch" } + } + }, + { "from": [ 7, 0, 0 ], + "to": [ 9, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" } + } + }, + { "from": [ 0, 0, 7 ], + "to": [ 16, 16, 9 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/torch_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/torch_wall.json new file mode 100644 index 0000000..1a6d297 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/torch_wall.json @@ -0,0 +1,35 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#torch" + }, + "elements": [ + { "from": [ -1, 3.5, 7 ], + "to": [ 1, 13.5, 9 ], + "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 7, 13, 9, 15 ], "texture": "#torch" }, + "up": { "uv": [ 7, 6, 9, 8 ], "texture": "#torch" } + } + }, + { "from": [ -1, 3.5, 0 ], + "to": [ 1, 19.5, 16 ], + "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" } + } + }, + { "from": [ -8, 3.5, 7 ], + "to": [ 8, 19.5, 9 ], + "rotation": { "origin": [ 0, 3.5, 8 ], "axis": "z", "angle": -22.5 }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#torch" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_bottom.json new file mode 100644 index 0000000..4d2113d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_bottom.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 3, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "north": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_open.json new file mode 100644 index 0000000..b301619 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_open.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 0, 0, 13 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 13, 16, 16 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 16, 0, 13, 16 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 13, 0, 16, 16 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_top.json new file mode 100644 index 0000000..036aeb7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/trapdoor_top.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { "from": [ 0, 13, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "up" }, + "north": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 16, 16, 13 ], "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_n.json new file mode 100644 index 0000000..da0b811 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_n.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_ne.json new file mode 100644 index 0000000..43dee4d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_ne.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 1.5, 7.75 ], + "to": [ 12, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 12, 1.5, 7.75 ], + "to": [ 16, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_ns.json new file mode 100644 index 0000000..aceecb7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_ns.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 12 ], + "to": [ 8.25, 1.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_nse.json new file mode 100644 index 0000000..a79a0c4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_nse.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 12 ], + "to": [ 8.25, 1.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 1.5, 7.75 ], + "to": [ 12, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 12, 1.5, 7.75 ], + "to": [ 16, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_nsew.json new file mode 100644 index 0000000..567b5c9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_nsew.json @@ -0,0 +1,73 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 12 ], + "to": [ 8.25, 1.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 0, 1.5, 7.75 ], + "to": [ 4, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 4, 1.5, 7.75 ], + "to": [ 8, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 8, 1.5, 7.75 ], + "to": [ 12, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 12, 1.5, 7.75 ], + "to": [ 16, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_n.json new file mode 100644 index 0000000..a75dc73 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_n.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_ne.json new file mode 100644 index 0000000..fd3cb9a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_ne.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 3.5, 7.75 ], + "to": [ 12, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 12, 3.5, 7.75 ], + "to": [ 16, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_ns.json new file mode 100644 index 0000000..f62ce39 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_ns.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 12 ], + "to": [ 8.25, 3.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_nse.json new file mode 100644 index 0000000..74d03db --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_nse.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 12 ], + "to": [ 8.25, 3.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 3.5, 7.75 ], + "to": [ 12, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 12, 3.5, 7.75 ], + "to": [ 16, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_nsew.json new file mode 100644 index 0000000..4dbf018 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_attached_suspended_nsew.json @@ -0,0 +1,73 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 12 ], + "to": [ 8.25, 3.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 0, 3.5, 7.75 ], + "to": [ 4, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 4, 3.5, 7.75 ], + "to": [ 8, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 8, 3.5, 7.75 ], + "to": [ 12, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + }, + { "from": [ 12, 3.5, 7.75 ], + "to": [ 16, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 4, 16, 2 ], "texture": "#texture" }, + "up": { "uv": [ 0, 2, 16, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook.json new file mode 100644 index 0000000..6a316fa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook.json @@ -0,0 +1,72 @@ +{ + "textures": { + "particle": "blocks/planks_oak", + "hook": "blocks/trip_wire_source", + "wood": "blocks/planks_oak" + }, + "elements": [ + { "from": [ 6.2, 3.8, 7.9 ], + "to": [ 9.8, 4.6, 11.5 ], + "rotation": { "origin": [ 8, 6, 5.2 ], "axis": "x", "angle": -45 }, + "faces": { + "down": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "up": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "north": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" }, + "south": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "west": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "east": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 3.8, 10.3 ], + "to": [ 8.6, 4.6, 10.3 ], + "rotation": { "origin": [ 8, 6, 5.2 ], "axis": "x", "angle": -45 }, + "faces": { + "north": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 3.8, 9.1 ], + "to": [ 8.6, 4.6, 9.1 ], + "rotation": { "origin": [ 8, 6, 5.2 ], "axis": "x", "angle": -45 }, + "faces": { + "south": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 3.8, 9.1 ], + "to": [ 7.4, 4.6, 10.3 ], + "rotation": { "origin": [ 8, 6, 5.2 ], "axis": "x", "angle": -45 }, + "faces": { + "east": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 8.6, 3.8, 9.1 ], + "to": [ 8.6, 4.6, 10.3 ], + "rotation": { "origin": [ 8, 6, 5.2 ], "axis": "x", "angle": -45 }, + "faces": { + "west": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 5.2, 10 ], + "to": [ 8.8, 6.8, 14 ], + "rotation": { "origin": [ 8, 6, 14 ], "axis": "x", "angle": 45 }, + "faces": { + "down": { "uv": [ 7, 9, 9, 14 ], "texture": "#wood" }, + "up": { "uv": [ 7, 2, 9, 7 ], "texture": "#wood" }, + "north": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "south": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "west": { "uv": [ 2, 9, 7, 11 ], "texture": "#wood" }, + "east": { "uv": [ 9, 9, 14, 11 ], "texture": "#wood" } + } + }, + { "from": [ 6, 1, 14 ], + "to": [ 10, 9, 16 ], + "faces": { + "down": { "uv": [ 6, 14, 10, 16 ], "texture": "#wood" }, + "up": { "uv": [ 6, 0, 10, 2 ], "texture": "#wood" }, + "north": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood", "cullface": "north" }, + "south": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood" }, + "west": { "uv": [ 0, 7, 2, 15 ], "texture": "#wood" }, + "east": { "uv": [ 14, 7, 16, 15 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached.json new file mode 100644 index 0000000..0e43ea9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached.json @@ -0,0 +1,75 @@ +{ + "textures": { + "particle": "blocks/planks_oak", + "hook": "blocks/trip_wire_source", + "wood": "blocks/planks_oak", + "tripwire": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 6.7 ], + "rotation": { "origin": [ 8, 0, 0 ], "axis": "x", "angle": -22.5, "rescale": true }, + "faces": { + "down": { "uv": [ 0, 8, 16, 6 ], "texture": "#tripwire", "rotation": 90 }, + "up": { "uv": [ 0, 6, 16, 8 ], "texture": "#tripwire", "rotation": 90 } + } + }, + { "from": [ 6.2, 4.2, 6.7 ], + "to": [ 9.8, 5, 10.3 ], + "faces": { + "down": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "up": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "north": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" }, + "south": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "west": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "east": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 9.1 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "north": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 8.6, 5, 7.9 ], + "faces": { + "south": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 7.4, 5, 9.1 ], + "faces": { + "east": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 8.6, 4.2, 7.9 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "west": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 5.2, 10 ], + "to": [ 8.8, 6.8, 14 ], + "faces": { + "down": { "uv": [ 7, 9, 9, 14 ], "texture": "#wood" }, + "up": { "uv": [ 7, 2, 9, 7 ], "texture": "#wood" }, + "north": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "south": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "west": { "uv": [ 2, 9, 7, 11 ], "texture": "#wood" }, + "east": { "uv": [ 9, 9, 14, 11 ], "texture": "#wood" } + } + }, + { "from": [ 6, 1, 14 ], + "to": [ 10, 9, 16 ], + "faces": { + "down": { "uv": [ 6, 14, 10, 16 ], "texture": "#wood" }, + "up": { "uv": [ 6, 0, 10, 2 ], "texture": "#wood" }, + "north": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood", "cullface": "north" }, + "south": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood" }, + "west": { "uv": [ 0, 7, 2, 15 ], "texture": "#wood" }, + "east": { "uv": [ 14, 7, 16, 15 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_powered.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_powered.json new file mode 100644 index 0000000..51020aa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_powered.json @@ -0,0 +1,76 @@ +{ + "textures": { + "particle": "blocks/planks_oak", + "hook": "blocks/trip_wire_source", + "wood": "blocks/planks_oak", + "tripwire": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 0.5, 0 ], + "to": [ 8.25, 0.5, 6.7 ], + "rotation": { "origin": [ 8, 0, 0 ], "axis": "x", "angle": -22.5, "rescale": true }, + "faces": { + "down": { "uv": [ 0, 8, 16, 6 ], "texture": "#tripwire", "rotation": 90 }, + "up": { "uv": [ 0, 6, 16, 8 ], "texture": "#tripwire", "rotation": 90 } + } + }, + { "from": [ 6.2, 4.2, 6.7 ], + "to": [ 9.8, 5, 10.3 ], + "faces": { + "down": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "up": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "north": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" }, + "south": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "west": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "east": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 9.1 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "north": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 8.6, 5, 7.9 ], + "faces": { + "south": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 7.4, 5, 9.1 ], + "faces": { + "east": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 8.6, 4.2, 7.9 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "west": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 5.2, 10 ], + "to": [ 8.8, 6.8, 14 ], + "rotation": { "origin": [ 8, 6, 14 ], "axis": "x", "angle": -22.5 }, + "faces": { + "down": { "uv": [ 7, 9, 9, 14 ], "texture": "#wood" }, + "up": { "uv": [ 7, 2, 9, 7 ], "texture": "#wood" }, + "north": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "south": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "west": { "uv": [ 2, 9, 7, 11 ], "texture": "#wood" }, + "east": { "uv": [ 9, 9, 14, 11 ], "texture": "#wood" } + } + }, + { "from": [ 6, 1, 14 ], + "to": [ 10, 9, 16 ], + "faces": { + "down": { "uv": [ 6, 14, 10, 16 ], "texture": "#wood" }, + "up": { "uv": [ 6, 0, 10, 2 ], "texture": "#wood" }, + "north": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood", "cullface": "north" }, + "south": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood" }, + "west": { "uv": [ 0, 7, 2, 15 ], "texture": "#wood" }, + "east": { "uv": [ 14, 7, 16, 15 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_suspended.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_suspended.json new file mode 100644 index 0000000..d9c43ee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_suspended.json @@ -0,0 +1,76 @@ +{ + "textures": { + "particle": "blocks/planks_oak", + "hook": "blocks/trip_wire_source", + "wood": "blocks/planks_oak", + "tripwire": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 6.7 ], + "rotation": { "origin": [ 8, 0, 0 ], "axis": "x", "angle": -22.5, "rescale": true }, + "faces": { + "down": { "uv": [ 0, 8, 16, 6 ], "texture": "#tripwire", "rotation": 90 }, + "up": { "uv": [ 0, 6, 16, 8 ], "texture": "#tripwire", "rotation": 90 } + } + }, + { "from": [ 6.2, 4.2, 6.7 ], + "to": [ 9.8, 5, 10.3 ], + "faces": { + "down": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "up": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "north": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" }, + "south": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "west": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "east": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 9.1 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "north": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 8.6, 5, 7.9 ], + "faces": { + "south": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 7.4, 5, 9.1 ], + "faces": { + "east": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 8.6, 4.2, 7.9 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "west": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 5.2, 10 ], + "to": [ 8.8, 6.8, 14 ], + "rotation": { "origin": [ 8, 6, 14 ], "axis": "x", "angle": -22.5 }, + "faces": { + "down": { "uv": [ 7, 9, 9, 14 ], "texture": "#wood" }, + "up": { "uv": [ 7, 2, 9, 7 ], "texture": "#wood" }, + "north": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "south": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "west": { "uv": [ 2, 9, 7, 11 ], "texture": "#wood" }, + "east": { "uv": [ 9, 9, 14, 11 ], "texture": "#wood" } + } + }, + { "from": [ 6, 1, 14 ], + "to": [ 10, 9, 16 ], + "faces": { + "down": { "uv": [ 6, 14, 10, 16 ], "texture": "#wood" }, + "up": { "uv": [ 6, 0, 10, 2 ], "texture": "#wood" }, + "north": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood", "cullface": "north" }, + "south": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood" }, + "west": { "uv": [ 0, 7, 2, 15 ], "texture": "#wood" }, + "east": { "uv": [ 14, 7, 16, 15 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_suspended_powered.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_suspended_powered.json new file mode 100644 index 0000000..723c8bc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_attached_suspended_powered.json @@ -0,0 +1,76 @@ +{ + "textures": { + "particle": "blocks/planks_oak", + "hook": "blocks/trip_wire_source", + "wood": "blocks/planks_oak", + "tripwire": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 2.5, 0 ], + "to": [ 8.25, 2.5, 6.7 ], + "rotation": { "origin": [ 8, 0, 0 ], "axis": "x", "angle": -22.5, "rescale": true }, + "faces": { + "down": { "uv": [ 0, 8, 16, 6 ], "texture": "#tripwire", "rotation": 90 }, + "up": { "uv": [ 0, 6, 16, 8 ], "texture": "#tripwire", "rotation": 90 } + } + }, + { "from": [ 6.2, 4.2, 6.7 ], + "to": [ 9.8, 5, 10.3 ], + "faces": { + "down": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "up": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "north": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" }, + "south": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "west": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "east": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 9.1 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "north": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 8.6, 5, 7.9 ], + "faces": { + "south": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 7.4, 5, 9.1 ], + "faces": { + "east": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 8.6, 4.2, 7.9 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "west": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 5.2, 10 ], + "to": [ 8.8, 6.8, 14 ], + "rotation": { "origin": [ 8, 6, 14 ], "axis": "x", "angle": -22.5 }, + "faces": { + "down": { "uv": [ 7, 9, 9, 14 ], "texture": "#wood" }, + "up": { "uv": [ 7, 2, 9, 7 ], "texture": "#wood" }, + "north": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "south": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "west": { "uv": [ 2, 9, 7, 11 ], "texture": "#wood" }, + "east": { "uv": [ 9, 9, 14, 11 ], "texture": "#wood" } + } + }, + { "from": [ 6, 1, 14 ], + "to": [ 10, 9, 16 ], + "faces": { + "down": { "uv": [ 6, 14, 10, 16 ], "texture": "#wood" }, + "up": { "uv": [ 6, 0, 10, 2 ], "texture": "#wood" }, + "north": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood", "cullface": "north" }, + "south": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood" }, + "west": { "uv": [ 0, 7, 2, 15 ], "texture": "#wood" }, + "east": { "uv": [ 14, 7, 16, 15 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_powered.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_powered.json new file mode 100644 index 0000000..521cb53 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_hook_powered.json @@ -0,0 +1,67 @@ +{ + "textures": { + "particle": "blocks/planks_oak", + "hook": "blocks/trip_wire_source", + "wood": "blocks/planks_oak" + }, + "elements": [ + { "from": [ 6.2, 4.2, 6.7 ], + "to": [ 9.8, 5, 10.3 ], + "faces": { + "down": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "up": { "uv": [ 5, 3, 11, 9 ], "texture": "#hook" }, + "north": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" }, + "south": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "west": { "uv": [ 5, 8, 11, 9 ], "texture": "#hook" }, + "east": { "uv": [ 5, 3, 11, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 9.1 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "north": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 8.6, 5, 7.9 ], + "faces": { + "south": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 4.2, 7.9 ], + "to": [ 7.4, 5, 9.1 ], + "faces": { + "east": { "uv": [ 7, 8, 9, 9 ], "texture": "#hook" } + } + }, + { "from": [ 8.6, 4.2, 7.9 ], + "to": [ 8.6, 5, 9.1 ], + "faces": { + "west": { "uv": [ 7, 3, 9, 4 ], "texture": "#hook" } + } + }, + { "from": [ 7.4, 5.2, 10 ], + "to": [ 8.8, 6.8, 14 ], + "rotation": { "origin": [ 8, 6, 14 ], "axis": "x", "angle": -22.5 }, + "faces": { + "down": { "uv": [ 7, 9, 9, 14 ], "texture": "#wood" }, + "up": { "uv": [ 7, 2, 9, 7 ], "texture": "#wood" }, + "north": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "south": { "uv": [ 7, 9, 9, 11 ], "texture": "#wood" }, + "west": { "uv": [ 2, 9, 7, 11 ], "texture": "#wood" }, + "east": { "uv": [ 9, 9, 14, 11 ], "texture": "#wood" } + } + }, + { "from": [ 6, 1, 14 ], + "to": [ 10, 9, 16 ], + "faces": { + "down": { "uv": [ 6, 14, 10, 16 ], "texture": "#wood" }, + "up": { "uv": [ 6, 0, 10, 2 ], "texture": "#wood" }, + "north": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood", "cullface": "north" }, + "south": { "uv": [ 6, 7, 10, 15 ], "texture": "#wood" }, + "west": { "uv": [ 0, 7, 2, 15 ], "texture": "#wood" }, + "east": { "uv": [ 14, 7, 16, 15 ], "texture": "#wood" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_n.json new file mode 100644 index 0000000..00da316 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_n.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_ne.json new file mode 100644 index 0000000..bcc3f42 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_ne.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 1.5, 7.75 ], + "to": [ 12, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 12, 1.5, 7.75 ], + "to": [ 16, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_ns.json new file mode 100644 index 0000000..1500d10 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_ns.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 12 ], + "to": [ 8.25, 1.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_nse.json new file mode 100644 index 0000000..10374eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_nse.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 12 ], + "to": [ 8.25, 1.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 1.5, 7.75 ], + "to": [ 12, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 12, 1.5, 7.75 ], + "to": [ 16, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_nsew.json new file mode 100644 index 0000000..f9f1f64 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_nsew.json @@ -0,0 +1,73 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 1.5, 0 ], + "to": [ 8.25, 1.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 4 ], + "to": [ 8.25, 1.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 8 ], + "to": [ 8.25, 1.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 1.5, 12 ], + "to": [ 8.25, 1.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 0, 1.5, 7.75 ], + "to": [ 4, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 4, 1.5, 7.75 ], + "to": [ 8, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 8, 1.5, 7.75 ], + "to": [ 12, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 12, 1.5, 7.75 ], + "to": [ 16, 1.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_n.json new file mode 100644 index 0000000..cd7ade4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_n.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_ne.json new file mode 100644 index 0000000..ed1fbdf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_ne.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 3.5, 7.75 ], + "to": [ 12, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 12, 3.5, 7.75 ], + "to": [ 16, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_ns.json new file mode 100644 index 0000000..baf9924 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_ns.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 12 ], + "to": [ 8.25, 3.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_nse.json new file mode 100644 index 0000000..102e8ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_nse.json @@ -0,0 +1,57 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 12 ], + "to": [ 8.25, 3.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 8, 3.5, 7.75 ], + "to": [ 12, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 12, 3.5, 7.75 ], + "to": [ 16, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_nsew.json new file mode 100644 index 0000000..9ee73c8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/tripwire_suspended_nsew.json @@ -0,0 +1,73 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/trip_wire", + "texture": "blocks/trip_wire" + }, + "elements": [ + { "from": [ 7.75, 3.5, 0 ], + "to": [ 8.25, 3.5, 4 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 4 ], + "to": [ 8.25, 3.5, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 8 ], + "to": [ 8.25, 3.5, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 7.75, 3.5, 12 ], + "to": [ 8.25, 3.5, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture", "rotation": 90 } + } + }, + { "from": [ 0, 3.5, 7.75 ], + "to": [ 4, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 4, 3.5, 7.75 ], + "to": [ 8, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 8, 3.5, 7.75 ], + "to": [ 12, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + }, + { "from": [ 12, 3.5, 7.75 ], + "to": [ 16, 3.5, 8.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 2, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_lamp.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_lamp.json new file mode 100644 index 0000000..363526b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_lamp.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/redstone_lamp_off" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_torch.json new file mode 100644 index 0000000..706ef0a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_torch.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch", + "textures": { + "torch": "blocks/redstone_torch_off" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_torch_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_torch_wall.json new file mode 100644 index 0000000..8b114ac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/unlit_redstone_torch_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "block/torch_wall", + "textures": { + "torch": "blocks/redstone_torch_off" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab.json new file mode 100644 index 0000000..e21eb93 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 8, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_acacia.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_acacia.json new file mode 100644 index 0000000..adb0ee0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_acacia.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/planks_acacia", + "top": "blocks/planks_acacia", + "side": "blocks/planks_acacia" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_birch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_birch.json new file mode 100644 index 0000000..131f1c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_birch.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/planks_birch", + "top": "blocks/planks_birch", + "side": "blocks/planks_birch" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_brick.json new file mode 100644 index 0000000..0205245 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_brick.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/brick", + "top": "blocks/brick", + "side": "blocks/brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_cobblestone.json new file mode 100644 index 0000000..ac72e44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_cobblestone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/cobblestone", + "top": "blocks/cobblestone", + "side": "blocks/cobblestone" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_dark_oak.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_dark_oak.json new file mode 100644 index 0000000..b4424fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_dark_oak.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/planks_big_oak", + "top": "blocks/planks_big_oak", + "side": "blocks/planks_big_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_jungle.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_jungle.json new file mode 100644 index 0000000..80b5eb6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_jungle.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/planks_jungle", + "top": "blocks/planks_jungle", + "side": "blocks/planks_jungle" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_nether_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_nether_brick.json new file mode 100644 index 0000000..dabf97b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_nether_brick.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/nether_brick", + "top": "blocks/nether_brick", + "side": "blocks/nether_brick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_oak.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_oak.json new file mode 100644 index 0000000..4c1f3a5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_oak.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/planks_oak", + "top": "blocks/planks_oak", + "side": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_quartz.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_quartz.json new file mode 100644 index 0000000..fd75a45 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_quartz.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/quartz_block_bottom", + "top": "blocks/quartz_block_top", + "side": "blocks/quartz_block_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_red_sandstone.json new file mode 100644 index 0000000..2539bdf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_red_sandstone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/red_sandstone_bottom", + "top": "blocks/red_sandstone_top", + "side": "blocks/red_sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_sandstone.json new file mode 100644 index 0000000..476b45d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_sandstone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/sandstone_bottom", + "top": "blocks/sandstone_top", + "side": "blocks/sandstone_normal" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_spruce.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_spruce.json new file mode 100644 index 0000000..e2fd599 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_spruce.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/planks_spruce", + "top": "blocks/planks_spruce", + "side": "blocks/planks_spruce" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_stone.json new file mode 100644 index 0000000..dff9915 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_stone.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/stone_slab_top", + "top": "blocks/stone_slab_top", + "side": "blocks/stone_slab_side" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_stone_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_stone_brick.json new file mode 100644 index 0000000..4b952e0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/upper_slab_stone_brick.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "blocks/stonebrick", + "top": "blocks/stonebrick", + "side": "blocks/stonebrick" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_1.json new file mode 100644 index 0000000..f5df4da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_1.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_1u.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_1u.json new file mode 100644 index 0000000..9542007 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_1u.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 15.2, 0 ], + "to": [ 16, 15.2, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2.json new file mode 100644 index 0000000..76d80df --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 0, 0.8 ], + "to": [ 16, 16, 0.8 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2_opposite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2_opposite.json new file mode 100644 index 0000000..826f5b7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2_opposite.json @@ -0,0 +1,25 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0.8, 0, 0 ], + "to": [ 0.8, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2u.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2u.json new file mode 100644 index 0000000..8d2ccd4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2u.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 15.2, 0 ], + "to": [ 16, 15.2, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.8 ], + "to": [ 16, 16, 0.8 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2u_opposite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2u_opposite.json new file mode 100644 index 0000000..ca9221c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_2u_opposite.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 15.2, 0 ], + "to": [ 16, 15.2, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0.8, 0, 0 ], + "to": [ 0.8, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_3.json new file mode 100644 index 0000000..4188a5c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_3.json @@ -0,0 +1,33 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.8 ], + "to": [ 16, 16, 0.8 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_3u.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_3u.json new file mode 100644 index 0000000..a5e9477 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_3u.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 15.2, 0 ], + "to": [ 16, 15.2, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.8 ], + "to": [ 16, 16, 0.8 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_4.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_4.json new file mode 100644 index 0000000..781fa27 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_4.json @@ -0,0 +1,41 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0.8, 0, 0 ], + "to": [ 0.8, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.8 ], + "to": [ 16, 16, 0.8 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_4u.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_4u.json new file mode 100644 index 0000000..6511e6d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_4u.json @@ -0,0 +1,49 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 15.2, 0 ], + "to": [ 16, 15.2, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0.8, 0, 0 ], + "to": [ 0.8, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 15.2, 0, 0 ], + "to": [ 15.2, 16, 16 ], + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 15.2 ], + "to": [ 16, 16, 15.2 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + }, + { "from": [ 0, 0, 0.8 ], + "to": [ 16, 16, 0.8 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_u.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_u.json new file mode 100644 index 0000000..6826525 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/vine_u.json @@ -0,0 +1,17 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/vine", + "vine": "blocks/vine" + }, + "elements": [ + { "from": [ 0, 15.2, 0 ], + "to": [ 16, 15.2, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#vine", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_gate_closed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_gate_closed.json new file mode 100644 index 0000000..0304ae9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_gate_closed.json @@ -0,0 +1,96 @@ +{ + "ambientocclusion": false, + "textures": { + "particle" : "#texture" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 2, 7 ], + "to": [ 2, 13, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 2, 7 ], + "to": [ 16, 13, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 6, 3, 7 ], + "to": [ 8, 12, 9 ], + "faces": { + "down": { "uv": [ 6, 7, 8, 9 ], "texture": "#texture" }, + "up": { "uv": [ 6, 7, 8, 9 ], "texture": "#texture" }, + "north": { "uv": [ 6, 1, 8, 10 ], "texture": "#texture" }, + "south": { "uv": [ 6, 1, 8, 10 ], "texture": "#texture" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 8, 3, 7 ], + "to": [ 10, 12, 9 ], + "faces": { + "down": { "uv": [ 8, 7, 10, 9 ], "texture": "#texture" }, + "up": { "uv": [ 8, 7, 10, 9 ], "texture": "#texture" }, + "north": { "uv": [ 8, 1, 10, 10 ], "texture": "#texture" }, + "south": { "uv": [ 8, 1, 10, 10 ], "texture": "#texture" }, + "west": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" }, + "east": { "uv": [ 7, 1, 9, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 2, 3, 7 ], + "to": [ 6, 6, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "north": { "uv": [ 2, 7, 6, 10 ], "texture": "#texture" }, + "south": { "uv": [ 2, 7, 6, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 2, 9, 7 ], + "to": [ 6, 12, 9 ], + "faces": { + "down": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "up": { "uv": [ 2, 7, 6, 9 ], "texture": "#texture" }, + "north": { "uv": [ 2, 1, 6, 4 ], "texture": "#texture" }, + "south": { "uv": [ 2, 1, 6, 4 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of right-hand gate door", + "from": [ 10, 3, 7 ], + "to": [ 14, 6, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "north": { "uv": [ 10, 7, 14, 10 ], "texture": "#texture" }, + "south": { "uv": [ 10, 7, 14, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of right-hand gate door", + "from": [ 10, 9, 7 ], + "to": [ 14, 12, 9 ], + "faces": { + "down": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "up": { "uv": [ 10, 7, 14, 9 ], "texture": "#texture" }, + "north": { "uv": [ 10, 1, 14, 4 ], "texture": "#texture" }, + "south": { "uv": [ 10, 1, 14, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_gate_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_gate_open.json new file mode 100644 index 0000000..9929015 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_gate_open.json @@ -0,0 +1,96 @@ +{ + "ambientocclusion": false, + "textures": { + "particle" : "#texture" + }, + "elements": [ + { "__comment": "Left-hand post", + "from": [ 0, 2, 7 ], + "to": [ 2, 13, 9 ], + "faces": { + "down": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "up": { "uv": [ 0, 7, 2, 9 ], "texture": "#texture" }, + "north": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 2, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" } + } + }, + { "__comment": "Right-hand post", + "from": [ 14, 2, 7 ], + "to": [ 16, 13, 9 ], + "faces": { + "down": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 14, 7, 16, 9 ], "texture": "#texture" }, + "north": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "south": { "uv": [ 14, 0, 16, 11 ], "texture": "#texture" }, + "west": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture" }, + "east": { "uv": [ 7, 0, 9, 11 ], "texture": "#texture", "cullface": "east" } + } + }, + { "__comment": "Inner vertical post of left-hand gate door", + "from": [ 0, 3, 13 ], + "to": [ 2, 12, 15 ], + "faces": { + "down": { "uv": [ 0, 13, 2, 15 ], "texture": "#texture" }, + "up": { "uv": [ 0, 13, 2, 15 ], "texture": "#texture" }, + "north": { "uv": [ 0, 1, 2, 10 ], "texture": "#texture" }, + "south": { "uv": [ 0, 1, 2, 10 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Inner vertical post of right-hand gate door", + "from": [ 14, 3, 13 ], + "to": [ 16, 12, 15 ], + "faces": { + "down": { "uv": [ 14, 13, 16, 15 ], "texture": "#texture" }, + "up": { "uv": [ 14, 13, 16, 15 ], "texture": "#texture" }, + "north": { "uv": [ 14, 1, 16, 10 ], "texture": "#texture" }, + "south": { "uv": [ 14, 1, 16, 10 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 0, 3, 9 ], + "to": [ 2, 6, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 0, 9, 9 ], + "to": [ 2, 12, 13 ], + "faces": { + "down": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "up": { "uv": [ 0, 9, 2, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" } + } + }, + { "__comment": "Lower horizontal bar of left-hand gate door", + "from": [ 14, 3, 9 ], + "to": [ 16, 6, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" }, + "east": { "uv": [ 13, 7, 15, 10 ], "texture": "#texture" } + } + }, + { "__comment": "Upper horizontal bar of left-hand gate door", + "from": [ 14, 9, 9 ], + "to": [ 16, 12, 13 ], + "faces": { + "down": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "up": { "uv": [ 14, 9, 16, 13 ], "texture": "#texture" }, + "west": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" }, + "east": { "uv": [ 13, 1, 15, 4 ], "texture": "#texture" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_inventory.json new file mode 100644 index 0000000..293edce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_inventory.json @@ -0,0 +1,32 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" } + }, + "__comment": "Center post" + }, + { "from": [ 5, 0, 0 ], + "to": [ 11, 13, 16 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 16 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 16 ], "texture": "#wall" }, + "north": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "north" }, + "south": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "south" }, + "west": { "uv": [ 0, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 0, 3, 16, 16 ], "texture": "#wall" } + }, + "__comment": "Full wall" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_n.json new file mode 100644 index 0000000..3c47fce --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_n.json @@ -0,0 +1,30 @@ +{ + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "up" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" } + }, + "__comment": "Center post" + }, + { "from": [ 5, 0, 0 ], + "to": [ 11, 13, 4 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall" }, + "north": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "north" }, + "west": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" }, + "east": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" } + }, + "__comment": "North wall" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ne.json new file mode 100644 index 0000000..eacffb8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ne.json @@ -0,0 +1,41 @@ +{ + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "up" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" } + }, + "__comment": "Center post" + }, + { "from": [ 5, 0, 0 ], + "to": [ 11, 13, 4 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall" }, + "north": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "north" }, + "west": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" }, + "east": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" } + }, + "__comment": "North wall" + }, + { "from": [ 12, 0, 5 ], + "to": [ 16, 13, 11 ], + "faces": { + "down": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "rotation": 90, "cullface": "down" }, + "up": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "rotation": 90 }, + "north": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "south": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "east" } + }, + "__comment": "East wall" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ns.json new file mode 100644 index 0000000..48725d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ns.json @@ -0,0 +1,18 @@ +{ + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 5, 0, 0 ], + "to": [ 11, 13, 16 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 16 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 16 ], "texture": "#wall" }, + "north": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "north" }, + "south": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "south" }, + "west": { "uv": [ 0, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 0, 3, 16, 16 ], "texture": "#wall" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ns_above.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ns_above.json new file mode 100644 index 0000000..77de4f8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_ns_above.json @@ -0,0 +1,30 @@ +{ + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "up" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" } + }, + "__comment": "Center post" + }, + { "from": [ 5, 0, 0 ], + "to": [ 11, 13, 16 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 16 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 16 ], "texture": "#wall" }, + "north": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "north" }, + "south": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "south" }, + "west": { "uv": [ 0, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 0, 3, 16, 16 ], "texture": "#wall" } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_nse.json new file mode 100644 index 0000000..cc1998b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_nse.json @@ -0,0 +1,52 @@ +{ + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "up" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" } + }, + "__comment": "Center post" + }, + { "from": [ 5, 0, 0 ], + "to": [ 11, 13, 4 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall" }, + "north": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "north" }, + "west": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" }, + "east": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" } + }, + "__comment": "North wall" + }, + { "from": [ 5, 0, 12 ], + "to": [ 11, 13, 16 ], + "faces": { + "down": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall" }, + "south": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "south" }, + "west": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" } + }, + "__comment": "South wall" + }, + { "from": [ 12, 0, 5 ], + "to": [ 16, 13, 11 ], + "faces": { + "down": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "rotation": 90, "cullface": "down" }, + "up": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "rotation": 90 }, + "north": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "south": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "east" } + }, + "__comment": "East wall" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_nsew.json new file mode 100644 index 0000000..e81dee1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_nsew.json @@ -0,0 +1,63 @@ +{ + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "up" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" } + }, + "__comment": "Center post" + }, + { "from": [ 5, 0, 0 ], + "to": [ 11, 13, 4 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall" }, + "north": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "north" }, + "west": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" }, + "east": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" } + }, + "__comment": "North wall" + }, + { "from": [ 5, 0, 12 ], + "to": [ 11, 13, 16 ], + "faces": { + "down": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall" }, + "south": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "south" }, + "west": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" } + }, + "__comment": "South wall" + }, + { "from": [ 12, 0, 5 ], + "to": [ 16, 13, 11 ], + "faces": { + "down": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "rotation": 90, "cullface": "down" }, + "up": { "uv": [ 5, 12, 11, 16 ], "texture": "#wall", "rotation": 90 }, + "north": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "south": { "uv": [ 12, 3, 16, 16 ], "texture": "#wall" }, + "east": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "east" } + }, + "__comment": "East wall" + }, + { "from": [ 0, 0, 5 ], + "to": [ 4, 13, 11 ], + "faces": { + "down": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall", "rotation": 90, "cullface": "down" }, + "up": { "uv": [ 5, 0, 11, 4 ], "texture": "#wall", "rotation": 90 }, + "north": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" }, + "south": { "uv": [ 0, 3, 4, 16 ], "texture": "#wall" }, + "west": { "uv": [ 5, 3, 11, 16 ], "texture": "#wall", "cullface": "west" } + }, + "__comment": "West wall" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_post.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_post.json new file mode 100644 index 0000000..7011432 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wall_post.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#wall", "cullface": "up" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#wall" } + }, + "__comment": "Center post" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/waterlily.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/waterlily.json new file mode 100644 index 0000000..05ab3ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/waterlily.json @@ -0,0 +1,16 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "blocks/waterlily", + "texture": "blocks/waterlily" + }, + "elements": [ + { "from": [ 0, 0.25, 0 ], + "to": [ 16, 0.25, 16 ], + "faces": { + "down": { "uv": [ 16, 16, 0, 0 ], "texture": "#texture", "tintindex": 0 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 } + } + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/web.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/web.json new file mode 100644 index 0000000..f8865a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/web.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/web" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage0.json new file mode 100644 index 0000000..ce87881 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage0.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_0" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage1.json new file mode 100644 index 0000000..de91d6e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage1.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_1" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage2.json new file mode 100644 index 0000000..02fd59d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_2" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage3.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage3.json new file mode 100644 index 0000000..dfe64db --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage3.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_3" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage4.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage4.json new file mode 100644 index 0000000..5ae3af4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage4.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_4" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage5.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage5.json new file mode 100644 index 0000000..3ceb724 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage5.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_5" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage6.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage6.json new file mode 100644 index 0000000..dff51c3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage6.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_6" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage7.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage7.json new file mode 100644 index 0000000..71dccdc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wheat_stage7.json @@ -0,0 +1,6 @@ +{ + "parent": "block/crop", + "textures": { + "crop": "blocks/wheat_stage_7" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_n.json new file mode 100644 index 0000000..2957003 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_ne.json new file mode 100644 index 0000000..bf04bee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_new.json new file mode 100644 index 0000000..202b1fd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_ns.json new file mode 100644 index 0000000..f241ea9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nse.json new file mode 100644 index 0000000..a9cb2e4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nsew.json new file mode 100644 index 0000000..4fbdb7a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nsw.json new file mode 100644 index 0000000..60f1201 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nw.json new file mode 100644 index 0000000..fedb399 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_s.json new file mode 100644 index 0000000..eafb711 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_se.json new file mode 100644 index 0000000..69fa87c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_sew.json new file mode 100644 index 0000000..7edfba8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_sw.json new file mode 100644 index 0000000..cf0d8fd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_white", + "pane": "blocks/glass_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_tulip.json new file mode 100644 index 0000000..a756684 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_tulip.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "blocks/flower_tulip_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_wool.json new file mode 100644 index 0000000..8d65e42 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/white_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_white" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button.json new file mode 100644 index 0000000..71de151 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button_inventory.json new file mode 100644 index 0000000..2dbeee4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button_inventory", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button_pressed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button_pressed.json new file mode 100644 index 0000000..6e87f53 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_button_pressed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/button_pressed", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_bottom.json new file mode 100644 index 0000000..32c6740 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom", + "textures": { + "bottom": "blocks/door_wood_lower", + "top": "blocks/door_wood_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_bottom_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_bottom_rh.json new file mode 100644 index 0000000..7ec8d01 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_bottom_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "blocks/door_wood_lower", + "top": "blocks/door_wood_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_top.json new file mode 100644 index 0000000..4d38b09 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_top.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top", + "textures": { + "bottom": "blocks/door_wood_lower", + "top": "blocks/door_wood_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_top_rh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_top_rh.json new file mode 100644 index 0000000..642d4fd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_door_top_rh.json @@ -0,0 +1,7 @@ +{ + "parent": "block/door_top_rh", + "textures": { + "bottom": "blocks/door_wood_lower", + "top": "blocks/door_wood_upper" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_down.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_down.json new file mode 100644 index 0000000..c14ba2f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_down.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_down", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_inventory.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_inventory.json new file mode 100644 index 0000000..2985272 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_inventory", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_up.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_up.json new file mode 100644 index 0000000..5438a15 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_pressure_plate_up.json @@ -0,0 +1,6 @@ +{ + "parent": "block/pressure_plate_up", + "textures": { + "texture": "blocks/planks_oak" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_bottom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_bottom.json new file mode 100644 index 0000000..6491516 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "block/trapdoor_bottom", + "textures": { + "texture": "blocks/trapdoor" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_open.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_open.json new file mode 100644 index 0000000..bf0fb3f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/trapdoor_open", + "textures": { + "texture": "blocks/trapdoor" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_top.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_top.json new file mode 100644 index 0000000..6d032e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/wooden_trapdoor_top.json @@ -0,0 +1,6 @@ +{ + "parent": "block/trapdoor_top", + "textures": { + "texture": "blocks/trapdoor" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_n.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_n.json new file mode 100644 index 0000000..b80ee45 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_n.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_n", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_ne.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_ne.json new file mode 100644 index 0000000..4c5d128 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_ne.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ne", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_new.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_new.json new file mode 100644 index 0000000..5a4a214 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_new.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_new", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_ns.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_ns.json new file mode 100644 index 0000000..40c1eac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_ns.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_ns", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nse.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nse.json new file mode 100644 index 0000000..6870fe1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nse", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nsew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nsew.json new file mode 100644 index 0000000..4f9ebb6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nsew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsew", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nsw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nsw.json new file mode 100644 index 0000000..37a9269 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nsw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nsw", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nw.json new file mode 100644 index 0000000..c9b495a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_nw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_nw", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_s.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_s.json new file mode 100644 index 0000000..5599e6c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_s.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_s", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_se.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_se.json new file mode 100644 index 0000000..cb0688a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_se.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_se", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_sew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_sew.json new file mode 100644 index 0000000..814ff01 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_sew.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sew", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_sw.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_sw.json new file mode 100644 index 0000000..0d99b96 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_pane_sw.json @@ -0,0 +1,7 @@ +{ + "parent": "block/pane_sw", + "textures": { + "edge": "blocks/glass_pane_top_yellow", + "pane": "blocks/glass_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_wool.json new file mode 100644 index 0000000..2f778dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/block/yellow_wool.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "blocks/wool_colored_yellow" + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_door.json new file mode 100644 index 0000000..1bb86ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_door.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/door_acacia" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_fence.json new file mode 100644 index 0000000..c312891 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_fence.json @@ -0,0 +1,13 @@ +{ + "parent": "block/acacia_fence_inventory", + "display": { + "thirdperson": { + "rotation": [ 0, 0, 180 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 90, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_fence_gate.json new file mode 100644 index 0000000..8001de6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_fence_gate.json @@ -0,0 +1,15 @@ +{ + "parent": "block/acacia_fence_gate_closed", + "display": { + "thirdperson": { + "rotation": [ 0, -90, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_leaves.json new file mode 100644 index 0000000..d79009e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_leaves.json @@ -0,0 +1,10 @@ +{ + "parent": "block/acacia_leaves", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_log.json new file mode 100644 index 0000000..9e9eeae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_log.json @@ -0,0 +1,10 @@ +{ + "parent": "block/acacia_log", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_planks.json new file mode 100644 index 0000000..286b8da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_planks.json @@ -0,0 +1,10 @@ +{ + "parent": "block/acacia_planks", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_sapling.json new file mode 100644 index 0000000..ef96e55 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_sapling.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/sapling_acacia" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_slab.json new file mode 100644 index 0000000..5aa544c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_acacia", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_stairs.json new file mode 100644 index 0000000..b1ca6ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/acacia_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/acacia_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/activator_rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/activator_rail.json new file mode 100644 index 0000000..2339f36 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/activator_rail.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/rail_activator" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/allium.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/allium.json new file mode 100644 index 0000000..607c448 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/allium.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_allium" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/andesite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/andesite.json new file mode 100644 index 0000000..42227ca --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/andesite.json @@ -0,0 +1,10 @@ +{ + "parent": "block/andesite", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/andesite_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/andesite_smooth.json new file mode 100644 index 0000000..24b0711 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/andesite_smooth.json @@ -0,0 +1,10 @@ +{ + "parent": "block/andesite_smooth", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_intact.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_intact.json new file mode 100644 index 0000000..a879c37 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_intact.json @@ -0,0 +1,10 @@ +{ + "parent": "block/anvil_undamaged", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0.25, 1.5, -2.5 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_slightly_damaged.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_slightly_damaged.json new file mode 100644 index 0000000..c35bd95 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_slightly_damaged.json @@ -0,0 +1,10 @@ +{ + "parent": "block/anvil_slightly_damaged", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0.25, 1.5, -2.5 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_very_damaged.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_very_damaged.json new file mode 100644 index 0000000..88c34ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/anvil_very_damaged.json @@ -0,0 +1,10 @@ +{ + "parent": "block/anvil_very_damaged", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0.25, 1.5, -2.5 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/apple.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/apple.json new file mode 100644 index 0000000..6c39e31 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/apple.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/apple" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/armor_stand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/armor_stand.json new file mode 100644 index 0000000..62c14b8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/armor_stand.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/wooden_armorstand" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/arrow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/arrow.json new file mode 100644 index 0000000..c2237f3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/arrow.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/arrow" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/baked_potato.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/baked_potato.json new file mode 100644 index 0000000..e2c8ddc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/baked_potato.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/potato_baked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/banner.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/banner.json new file mode 100644 index 0000000..ed4cbd4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/banner.json @@ -0,0 +1,22 @@ +{ + "parent": "builtin/entity", + "display": { + "thirdperson": { + "rotation": [ 0, 90, -90 ], + "translation": [ 0, 0, -4 ], + "scale": [ 0.5, 0.5, 0.5 ] + }, + "firstperson": { + "rotation": [ 0, 225, 0 ] + }, + "gui": { + "rotation": [ 0, -65, 0 ], + "translation": [ 0, -3, 0 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "head": { + "translation": [ 0, 8, 3.5 ], + "scale": [ 1.5, 1.5, 1.5 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/barrier.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/barrier.json new file mode 100644 index 0000000..f5dc51e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/barrier.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/barrier" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/beacon.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/beacon.json new file mode 100644 index 0000000..1a8ce48 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/beacon.json @@ -0,0 +1,10 @@ +{ + "parent": "block/beacon", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bed.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bed.json new file mode 100644 index 0000000..c156918 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bed.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bed" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bedrock.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bedrock.json new file mode 100644 index 0000000..b7821e0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bedrock.json @@ -0,0 +1,10 @@ +{ + "parent": "block/bedrock", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/beef.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/beef.json new file mode 100644 index 0000000..3bcfde2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/beef.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/beef_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_door.json new file mode 100644 index 0000000..1673e29 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_door.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/door_birch" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_fence.json new file mode 100644 index 0000000..fa67609 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_fence.json @@ -0,0 +1,13 @@ +{ + "parent": "block/birch_fence_inventory", + "display": { + "thirdperson": { + "rotation": [ 0, 0, 180 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 90, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_fence_gate.json new file mode 100644 index 0000000..417d296 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_fence_gate.json @@ -0,0 +1,15 @@ +{ + "parent": "block/birch_fence_gate_closed", + "display": { + "thirdperson": { + "rotation": [ 0, -90, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_leaves.json new file mode 100644 index 0000000..7e7b628 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_leaves.json @@ -0,0 +1,10 @@ +{ + "parent": "block/birch_leaves", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_log.json new file mode 100644 index 0000000..6dacb2c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_log.json @@ -0,0 +1,10 @@ +{ + "parent": "block/birch_log", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_planks.json new file mode 100644 index 0000000..36932f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_planks.json @@ -0,0 +1,10 @@ +{ + "parent": "block/birch_planks", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_sapling.json new file mode 100644 index 0000000..7c9d538 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_sapling.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/sapling_birch" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_slab.json new file mode 100644 index 0000000..430bb02 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_birch", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_stairs.json new file mode 100644 index 0000000..371d911 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/birch_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/birch_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_carpet.json new file mode 100644 index 0000000..3dd6fc8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_black", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_glass.json new file mode 100644 index 0000000..86ad1af --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_black", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_glass_pane.json new file mode 100644 index 0000000..45f6e50 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_black" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_hardened_clay.json new file mode 100644 index 0000000..77880a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_black", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_wool.json new file mode 100644 index 0000000..34ae186 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/black_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/black_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blaze_powder.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blaze_powder.json new file mode 100644 index 0000000..a392e08 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blaze_powder.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/blaze_powder" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blaze_rod.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blaze_rod.json new file mode 100644 index 0000000..cedc4fb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blaze_rod.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/blaze_rod" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 0.75, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_carpet.json new file mode 100644 index 0000000..e1298a7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_blue", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_orchid.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_orchid.json new file mode 100644 index 0000000..0dd2e78 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_orchid.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_blue_orchid" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_glass.json new file mode 100644 index 0000000..851c934 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_blue", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_glass_pane.json new file mode 100644 index 0000000..4c580a5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_blue" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_hardened_clay.json new file mode 100644 index 0000000..86595e8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_blue", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_wool.json new file mode 100644 index 0000000..bf87579 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/blue_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/blue_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/boat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/boat.json new file mode 100644 index 0000000..b85e5fb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/boat.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/boat" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bone.json new file mode 100644 index 0000000..08a6116 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bone" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/book.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/book.json new file mode 100644 index 0000000..5a8bad3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/book.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/book_normal" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bookshelf.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bookshelf.json new file mode 100644 index 0000000..42d5aeb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bookshelf.json @@ -0,0 +1,10 @@ +{ + "parent": "block/bookshelf", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bottle_drinkable.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bottle_drinkable.json new file mode 100644 index 0000000..ada5901 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bottle_drinkable.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/potion_overlay", + "layer1": "items/potion_bottle_drinkable" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bottle_splash.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bottle_splash.json new file mode 100644 index 0000000..28efe5e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bottle_splash.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/potion_overlay", + "layer1": "items/potion_bottle_splash" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow.json new file mode 100644 index 0000000..706bdf3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bow_standby" + }, + "display": { + "thirdperson": { + "rotation": [ 5, 80, -45 ], + "translation": [ 0.75, 0, 0.25 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_0.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_0.json new file mode 100644 index 0000000..8c965fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_0.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bow_pulling_0" + }, + "display": { + "thirdperson": { + "rotation": [ 5, 80, -45 ], + "translation": [ 0.75, 0, 0.25 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_1.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_1.json new file mode 100644 index 0000000..84548f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_1.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bow_pulling_1" + }, + "display": { + "thirdperson": { + "rotation": [ 5, 80, -45 ], + "translation": [ 0.75, 0, 0.25 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_2.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_2.json new file mode 100644 index 0000000..c8faa90 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bow_pulling_2.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bow_pulling_2" + }, + "display": { + "thirdperson": { + "rotation": [ 5, 80, -45 ], + "translation": [ 0.75, 0, 0.25 ], + "scale": [ 1, 1, 1 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bowl.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bowl.json new file mode 100644 index 0000000..65816ef --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bowl.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bowl" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bread.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bread.json new file mode 100644 index 0000000..ef2249a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bread.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bread" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brewing_stand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brewing_stand.json new file mode 100644 index 0000000..41b5ec4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brewing_stand.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/brewing_stand" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick.json new file mode 100644 index 0000000..4b49d59 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/brick" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_block.json new file mode 100644 index 0000000..2313dbb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/brick", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_slab.json new file mode 100644 index 0000000..fd2750a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_brick", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_stairs.json new file mode 100644 index 0000000..bd18689 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brick_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/brick_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_carpet.json new file mode 100644 index 0000000..9a2859e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_brown", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_mushroom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_mushroom.json new file mode 100644 index 0000000..306bba7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_mushroom.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/mushroom_brown" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_mushroom_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_mushroom_block.json new file mode 100644 index 0000000..e5cf1f1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_mushroom_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/brown_mushroom_block_cap_all", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_glass.json new file mode 100644 index 0000000..e0e1a48 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_brown", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_glass_pane.json new file mode 100644 index 0000000..147a761 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_brown" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_hardened_clay.json new file mode 100644 index 0000000..9dab5c0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_brown", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_wool.json new file mode 100644 index 0000000..582f20f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/brown_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/brown_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bucket.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bucket.json new file mode 100644 index 0000000..463698a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/bucket.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bucket_empty" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cactus.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cactus.json new file mode 100644 index 0000000..9931c32 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cactus.json @@ -0,0 +1,10 @@ +{ + "parent": "block/cactus", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cake.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cake.json new file mode 100644 index 0000000..be7bcfb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cake.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/cake" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/carrot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/carrot.json new file mode 100644 index 0000000..8f88b4d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/carrot.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/carrot" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/carrot_on_a_stick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/carrot_on_a_stick.json new file mode 100644 index 0000000..94592f4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/carrot_on_a_stick.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/carrot_on_a_stick" + }, + "display": { + "thirdperson": { + "rotation": [ 180, 90, -35 ], + "translation": [ 0, 0, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, 45, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cauldron.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cauldron.json new file mode 100644 index 0000000..4c46a66 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cauldron.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/cauldron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_boots.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_boots.json new file mode 100644 index 0000000..71e0a60 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_boots.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/chainmail_boots" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_chestplate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_chestplate.json new file mode 100644 index 0000000..78ec3fa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_chestplate.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/chainmail_chestplate" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_helmet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_helmet.json new file mode 100644 index 0000000..56a5473 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_helmet.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/chainmail_helmet" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.25 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_leggings.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_leggings.json new file mode 100644 index 0000000..1e4b2ee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chainmail_leggings.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/chainmail_leggings" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/charcoal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/charcoal.json new file mode 100644 index 0000000..6c2ab45 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/charcoal.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/charcoal" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chest.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chest.json new file mode 100644 index 0000000..43a272a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chest.json @@ -0,0 +1,3 @@ +{ + "parent": "builtin/entity" +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chest_minecart.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chest_minecart.json new file mode 100644 index 0000000..a2fbf33 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chest_minecart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/minecart_chest" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chicken.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chicken.json new file mode 100644 index 0000000..83d3c8c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chicken.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/chicken_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_brick_monster_egg.json new file mode 100644 index 0000000..5fddd10 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_brick_monster_egg.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_chiseled", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_quartz_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_quartz_block.json new file mode 100644 index 0000000..2c4eed6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_quartz_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/quartz_chiseled", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_red_sandstone.json new file mode 100644 index 0000000..23d270b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_red_sandstone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/red_sandstone_chiseled", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_sandstone.json new file mode 100644 index 0000000..ec0b0b7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_sandstone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/sandstone_chiseled", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_stonebrick.json new file mode 100644 index 0000000..5fddd10 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/chiseled_stonebrick.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_chiseled", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clay.json new file mode 100644 index 0000000..5ed8b1d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/clay", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clay_ball.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clay_ball.json new file mode 100644 index 0000000..3981075 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clay_ball.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/clay_ball" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clock.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clock.json new file mode 100644 index 0000000..59cbd12 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clock.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/clock", + "textures": { + "layer0": "items/clock" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clownfish.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clownfish.json new file mode 100644 index 0000000..ed7c2a3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/clownfish.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fish_clownfish_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal.json new file mode 100644 index 0000000..34bcb90 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/coal" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal_block.json new file mode 100644 index 0000000..ffa8618 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/coal_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal_ore.json new file mode 100644 index 0000000..6708ee5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coal_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/coal_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coarse_dirt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coarse_dirt.json new file mode 100644 index 0000000..111e62a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/coarse_dirt.json @@ -0,0 +1,10 @@ +{ + "parent": "block/coarse_dirt", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone.json new file mode 100644 index 0000000..bd8d900 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/cobblestone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_monster_egg.json new file mode 100644 index 0000000..bd8d900 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_monster_egg.json @@ -0,0 +1,10 @@ +{ + "parent": "block/cobblestone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_slab.json new file mode 100644 index 0000000..63d0aea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_cobblestone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_wall.json new file mode 100644 index 0000000..9a4f3ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cobblestone_wall.json @@ -0,0 +1,10 @@ +{ + "parent": "block/cobblestone_wall_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cod.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cod.json new file mode 100644 index 0000000..ec84486 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cod.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fish_cod_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/command_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/command_block.json new file mode 100644 index 0000000..be88927 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/command_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/command_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/command_block_minecart.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/command_block_minecart.json new file mode 100644 index 0000000..9c9c91b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/command_block_minecart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/minecart_command_block" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/comparator.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/comparator.json new file mode 100644 index 0000000..34aa78e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/comparator.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/comparator" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/compass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/compass.json new file mode 100644 index 0000000..6b1305f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/compass.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/compass", + "textures": { + "layer0": "items/compass" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_beef.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_beef.json new file mode 100644 index 0000000..2d4e94b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_beef.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/beef_cooked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_chicken.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_chicken.json new file mode 100644 index 0000000..9db6cbe --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_chicken.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/chicken_cooked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_cod.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_cod.json new file mode 100644 index 0000000..b795efb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_cod.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fish_cod_cooked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_mutton.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_mutton.json new file mode 100644 index 0000000..9ae2c08 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_mutton.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/mutton_cooked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_porkchop.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_porkchop.json new file mode 100644 index 0000000..6bbcc0f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_porkchop.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/porkchop_cooked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_rabbit.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_rabbit.json new file mode 100644 index 0000000..2526529 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_rabbit.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/rabbit_cooked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_salmon.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_salmon.json new file mode 100644 index 0000000..d2f0a83 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cooked_salmon.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fish_salmon_cooked" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cookie.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cookie.json new file mode 100644 index 0000000..93bc633 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cookie.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/cookie" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cracked_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cracked_brick_monster_egg.json new file mode 100644 index 0000000..2dcc5c8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cracked_brick_monster_egg.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_cracked", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cracked_stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cracked_stonebrick.json new file mode 100644 index 0000000..2dcc5c8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cracked_stonebrick.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_cracked", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/crafting_table.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/crafting_table.json new file mode 100644 index 0000000..b71c85f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/crafting_table.json @@ -0,0 +1,10 @@ +{ + "parent": "block/crafting_table", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_carpet.json new file mode 100644 index 0000000..3b45d9e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_cyan", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_glass.json new file mode 100644 index 0000000..6f14b80 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_cyan", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_glass_pane.json new file mode 100644 index 0000000..7dd095b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_cyan" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_hardened_clay.json new file mode 100644 index 0000000..acdaf40 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_cyan", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_wool.json new file mode 100644 index 0000000..a51d080 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/cyan_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/cyan_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dandelion.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dandelion.json new file mode 100644 index 0000000..a7f03a0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dandelion.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_dandelion" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_door.json new file mode 100644 index 0000000..8828a17 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_door.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/door_dark_oak" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_fence.json new file mode 100644 index 0000000..5d04118 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_fence.json @@ -0,0 +1,13 @@ +{ + "parent": "block/dark_oak_fence_inventory", + "display": { + "thirdperson": { + "rotation": [ 0, 0, 180 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 90, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_fence_gate.json new file mode 100644 index 0000000..826904c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_fence_gate.json @@ -0,0 +1,15 @@ +{ + "parent": "block/dark_oak_fence_gate_closed", + "display": { + "thirdperson": { + "rotation": [ 0, -90, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_leaves.json new file mode 100644 index 0000000..6283db7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_leaves.json @@ -0,0 +1,10 @@ +{ + "parent": "block/dark_oak_leaves", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_log.json new file mode 100644 index 0000000..0303426 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_log.json @@ -0,0 +1,10 @@ +{ + "parent": "block/dark_oak_log", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_planks.json new file mode 100644 index 0000000..b894f81 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_planks.json @@ -0,0 +1,10 @@ +{ + "parent": "block/dark_oak_planks", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_sapling.json new file mode 100644 index 0000000..349e84c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_sapling.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/sapling_roofed_oak" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_slab.json new file mode 100644 index 0000000..ee4afbb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_dark_oak", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_stairs.json new file mode 100644 index 0000000..105e7b9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_oak_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/dark_oak_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_prismarine.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_prismarine.json new file mode 100644 index 0000000..124831c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dark_prismarine.json @@ -0,0 +1,10 @@ +{ + "parent": "block/prismarine_dark", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/daylight_detector.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/daylight_detector.json new file mode 100644 index 0000000..b9734d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/daylight_detector.json @@ -0,0 +1,15 @@ +{ + "parent": "block/daylight_detector", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dead_bush.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dead_bush.json new file mode 100644 index 0000000..8839e0f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dead_bush.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/deadbush" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/detector_rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/detector_rail.json new file mode 100644 index 0000000..1eb33c5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/detector_rail.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/rail_detector" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond.json new file mode 100644 index 0000000..ce3100d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_axe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_axe.json new file mode 100644 index 0000000..948fd7c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_axe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_axe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_block.json new file mode 100644 index 0000000..7a587af --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/diamond_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_boots.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_boots.json new file mode 100644 index 0000000..35628bd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_boots.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_boots" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_chestplate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_chestplate.json new file mode 100644 index 0000000..3288b62 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_chestplate.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_chestplate" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_helmet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_helmet.json new file mode 100644 index 0000000..67e80ba --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_helmet.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_helmet" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.25 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_hoe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_hoe.json new file mode 100644 index 0000000..600c713 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_hoe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_hoe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_horse_armor.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_horse_armor.json new file mode 100644 index 0000000..3ba00c5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_horse_armor.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_horse_armor" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_leggings.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_leggings.json new file mode 100644 index 0000000..126bf38 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_leggings.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_leggings" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_ore.json new file mode 100644 index 0000000..ee09a1a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/diamond_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_pickaxe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_pickaxe.json new file mode 100644 index 0000000..5a9323c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_pickaxe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_pickaxe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_shovel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_shovel.json new file mode 100644 index 0000000..4038e82 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_shovel.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_shovel" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_sword.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_sword.json new file mode 100644 index 0000000..1da37e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diamond_sword.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/diamond_sword" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diorite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diorite.json new file mode 100644 index 0000000..8435fc4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diorite.json @@ -0,0 +1,10 @@ +{ + "parent": "block/diorite", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diorite_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diorite_smooth.json new file mode 100644 index 0000000..a01d373 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/diorite_smooth.json @@ -0,0 +1,10 @@ +{ + "parent": "block/diorite_smooth", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dirt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dirt.json new file mode 100644 index 0000000..db5f7b7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dirt.json @@ -0,0 +1,10 @@ +{ + "parent": "block/dirt", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dispenser.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dispenser.json new file mode 100644 index 0000000..5c5ff3c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dispenser.json @@ -0,0 +1,10 @@ +{ + "parent": "block/dispenser", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_fern.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_fern.json new file mode 100644 index 0000000..9e3b55d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_fern.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/double_plant_fern_top" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_grass.json new file mode 100644 index 0000000..b5afbfe --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_grass.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/double_plant_grass_top" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_rose.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_rose.json new file mode 100644 index 0000000..fac74a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/double_rose.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/double_plant_rose_top" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dragon_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dragon_egg.json new file mode 100644 index 0000000..3eb2a4d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dragon_egg.json @@ -0,0 +1,10 @@ +{ + "parent": "block/dragon_egg", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dropper.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dropper.json new file mode 100644 index 0000000..ae28465 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dropper.json @@ -0,0 +1,10 @@ +{ + "parent": "block/dropper", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_black.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_black.json new file mode 100644 index 0000000..617fc14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_black.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_black" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_blue.json new file mode 100644 index 0000000..ed95838 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_blue.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_blue" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_brown.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_brown.json new file mode 100644 index 0000000..8a03fc7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_brown.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_brown" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_cyan.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_cyan.json new file mode 100644 index 0000000..25bde60 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_cyan.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_cyan" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_gray.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_gray.json new file mode 100644 index 0000000..bf1b260 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_gray.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_gray" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_green.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_green.json new file mode 100644 index 0000000..dc4c4a6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_green.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_green" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_light_blue.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_light_blue.json new file mode 100644 index 0000000..7d02b5c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_light_blue.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_light_blue" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_lime.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_lime.json new file mode 100644 index 0000000..b1f0c90 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_lime.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_lime" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_magenta.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_magenta.json new file mode 100644 index 0000000..90209a7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_magenta.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_magenta" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_orange.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_orange.json new file mode 100644 index 0000000..1d0b42a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_orange.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_orange" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_pink.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_pink.json new file mode 100644 index 0000000..2bcc284 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_pink.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_pink" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_purple.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_purple.json new file mode 100644 index 0000000..0add051 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_purple.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_purple" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_red.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_red.json new file mode 100644 index 0000000..0ffe276 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_red.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_red" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_silver.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_silver.json new file mode 100644 index 0000000..3da0bb2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_silver.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_silver" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_white.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_white.json new file mode 100644 index 0000000..9be5c51 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_white.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_white" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_yellow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_yellow.json new file mode 100644 index 0000000..270e248 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/dye_yellow.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/dye_powder_yellow" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/egg.json new file mode 100644 index 0000000..dc91a70 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/egg.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/egg" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald.json new file mode 100644 index 0000000..3638648 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/emerald" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald_block.json new file mode 100644 index 0000000..f20662b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/emerald_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald_ore.json new file mode 100644 index 0000000..a150ce8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/emerald_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/emerald_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/enchanted_book.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/enchanted_book.json new file mode 100644 index 0000000..01ff149 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/enchanted_book.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/book_enchanted" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/enchanting_table.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/enchanting_table.json new file mode 100644 index 0000000..04d62bd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/enchanting_table.json @@ -0,0 +1,10 @@ +{ + "parent": "block/enchanting_table_base", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/end_portal_frame.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/end_portal_frame.json new file mode 100644 index 0000000..2f3eb79 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/end_portal_frame.json @@ -0,0 +1,10 @@ +{ + "parent": "block/end_portal_frame_empty", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/end_stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/end_stone.json new file mode 100644 index 0000000..f46b36b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/end_stone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/end_stone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_chest.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_chest.json new file mode 100644 index 0000000..43a272a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_chest.json @@ -0,0 +1,3 @@ +{ + "parent": "builtin/entity" +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_eye.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_eye.json new file mode 100644 index 0000000..79b34ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_eye.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/ender_eye" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_pearl.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_pearl.json new file mode 100644 index 0000000..5c5e020 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ender_pearl.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/ender_pearl" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/experience_bottle.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/experience_bottle.json new file mode 100644 index 0000000..4769bac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/experience_bottle.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/experience_bottle" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/farmland.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/farmland.json new file mode 100644 index 0000000..44fe3b1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/farmland.json @@ -0,0 +1,10 @@ +{ + "parent": "block/farmland_dry", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/feather.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/feather.json new file mode 100644 index 0000000..1d9d524 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/feather.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/feather" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fermented_spider_eye.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fermented_spider_eye.json new file mode 100644 index 0000000..c50e6b0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fermented_spider_eye.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/spider_eye_fermented" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fern.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fern.json new file mode 100644 index 0000000..9dc8f28 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fern.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/fern" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/filled_map.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/filled_map.json new file mode 100644 index 0000000..174e390 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/filled_map.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/map_filled" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fire_charge.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fire_charge.json new file mode 100644 index 0000000..4dce2b8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fire_charge.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fireball" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/firework_charge.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/firework_charge.json new file mode 100644 index 0000000..d6cf166 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/firework_charge.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fireworks_charge", + "layer1": "items/fireworks_charge_overlay" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fireworks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fireworks.json new file mode 100644 index 0000000..1c3fb51 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fireworks.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fireworks" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fishing_rod.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fishing_rod.json new file mode 100644 index 0000000..254ce9a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fishing_rod.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fishing_rod_uncast" + }, + "display": { + "thirdperson": { + "rotation": [ 180, 90, -35 ], + "translation": [ 0, 0, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, 45, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fishing_rod_cast.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fishing_rod_cast.json new file mode 100644 index 0000000..7a4db03 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/fishing_rod_cast.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fishing_rod_cast" + }, + "display": { + "thirdperson": { + "rotation": [ 180, 90, -35 ], + "translation": [ 0, 0, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, 45, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flint.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flint.json new file mode 100644 index 0000000..064a4a0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flint.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/flint" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flint_and_steel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flint_and_steel.json new file mode 100644 index 0000000..c77f9e8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flint_and_steel.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/flint_and_steel" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flower_pot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flower_pot.json new file mode 100644 index 0000000..61f7453 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/flower_pot.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/flower_pot" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/furnace.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/furnace.json new file mode 100644 index 0000000..1564183 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/furnace.json @@ -0,0 +1,10 @@ +{ + "parent": "block/furnace", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/furnace_minecart.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/furnace_minecart.json new file mode 100644 index 0000000..a9c1c74 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/furnace_minecart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/minecart_furnace" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ghast_tear.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ghast_tear.json new file mode 100644 index 0000000..5a8135b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ghast_tear.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/ghast_tear" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.25 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass.json new file mode 100644 index 0000000..a656a8b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass_bottle.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass_bottle.json new file mode 100644 index 0000000..bfff9f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass_bottle.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/potion_bottle_empty" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass_pane.json new file mode 100644 index 0000000..aaa414d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glowstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glowstone.json new file mode 100644 index 0000000..cd2e06b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glowstone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glowstone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glowstone_dust.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glowstone_dust.json new file mode 100644 index 0000000..5e9ddc6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/glowstone_dust.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/glowstone_dust" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_block.json new file mode 100644 index 0000000..913efb9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/gold_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_ingot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_ingot.json new file mode 100644 index 0000000..b7cf012 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_ingot.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_ingot" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_nugget.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_nugget.json new file mode 100644 index 0000000..0d0d1f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_nugget.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_nugget" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_ore.json new file mode 100644 index 0000000..8d64fbc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gold_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/gold_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_apple.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_apple.json new file mode 100644 index 0000000..09c431f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_apple.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/apple_golden" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_axe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_axe.json new file mode 100644 index 0000000..7572301 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_axe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_axe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_boots.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_boots.json new file mode 100644 index 0000000..9189da3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_boots.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_boots" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_carrot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_carrot.json new file mode 100644 index 0000000..a8a85ed --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_carrot.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/carrot_golden" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_chestplate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_chestplate.json new file mode 100644 index 0000000..b2c322f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_chestplate.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_chestplate" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_helmet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_helmet.json new file mode 100644 index 0000000..6197988 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_helmet.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_helmet" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.25 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_hoe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_hoe.json new file mode 100644 index 0000000..96a10d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_hoe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_hoe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_horse_armor.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_horse_armor.json new file mode 100644 index 0000000..d2a8cc0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_horse_armor.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_horse_armor" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_leggings.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_leggings.json new file mode 100644 index 0000000..d54edb7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_leggings.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_leggings" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_pickaxe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_pickaxe.json new file mode 100644 index 0000000..28d0705 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_pickaxe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_pickaxe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_rail.json new file mode 100644 index 0000000..d4ff719 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_rail.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/rail_golden" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_shovel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_shovel.json new file mode 100644 index 0000000..a08d5cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_shovel.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_shovel" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_sword.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_sword.json new file mode 100644 index 0000000..c9719b2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/golden_sword.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gold_sword" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/granite.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/granite.json new file mode 100644 index 0000000..e242d32 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/granite.json @@ -0,0 +1,10 @@ +{ + "parent": "block/granite", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/granite_smooth.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/granite_smooth.json new file mode 100644 index 0000000..36c14f7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/granite_smooth.json @@ -0,0 +1,10 @@ +{ + "parent": "block/granite_smooth", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/grass.json new file mode 100644 index 0000000..3edded3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/grass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/grass_normal", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gravel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gravel.json new file mode 100644 index 0000000..a1dc5c5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gravel.json @@ -0,0 +1,10 @@ +{ + "parent": "block/gravel", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_carpet.json new file mode 100644 index 0000000..8dbdcd4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_gray", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_glass.json new file mode 100644 index 0000000..2ea9308 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_gray", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_glass_pane.json new file mode 100644 index 0000000..f18ad1f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_gray" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_hardened_clay.json new file mode 100644 index 0000000..51a8aff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_gray", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_wool.json new file mode 100644 index 0000000..1540fc6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gray_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/gray_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_carpet.json new file mode 100644 index 0000000..4e7bc19 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_green", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_glass.json new file mode 100644 index 0000000..637b97c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_green", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_glass_pane.json new file mode 100644 index 0000000..e692acd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_green" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_hardened_clay.json new file mode 100644 index 0000000..2bcefe1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_green", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_wool.json new file mode 100644 index 0000000..64d5ddb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/green_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/green_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gunpowder.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gunpowder.json new file mode 100644 index 0000000..d77a460 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/gunpowder.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/gunpowder" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hardened_clay.json new file mode 100644 index 0000000..49330e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hay_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hay_block.json new file mode 100644 index 0000000..42cf4ad --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hay_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hay", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/heavy_weighted_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/heavy_weighted_pressure_plate.json new file mode 100644 index 0000000..c8c66db --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/heavy_weighted_pressure_plate.json @@ -0,0 +1,10 @@ +{ + "parent": "block/heavy_pressure_plate_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hopper.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hopper.json new file mode 100644 index 0000000..f6a268d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hopper.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/hopper" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hopper_minecart.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hopper_minecart.json new file mode 100644 index 0000000..d3eba36 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/hopper_minecart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/minecart_hopper" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/houstonia.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/houstonia.json new file mode 100644 index 0000000..c252a61 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/houstonia.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_houstonia" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ice.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ice.json new file mode 100644 index 0000000..44b1f4d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ice.json @@ -0,0 +1,10 @@ +{ + "parent": "block/ice", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_axe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_axe.json new file mode 100644 index 0000000..4ec082f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_axe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_axe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_bars.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_bars.json new file mode 100644 index 0000000..e706bee --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_bars.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/iron_bars" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_block.json new file mode 100644 index 0000000..62a281f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/iron_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_boots.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_boots.json new file mode 100644 index 0000000..def28c0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_boots.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_boots" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_chestplate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_chestplate.json new file mode 100644 index 0000000..f60f5cc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_chestplate.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_chestplate" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_door.json new file mode 100644 index 0000000..f956a54 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_door.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/door_iron" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_helmet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_helmet.json new file mode 100644 index 0000000..46b1585 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_helmet.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_helmet" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.25 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_hoe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_hoe.json new file mode 100644 index 0000000..6decc4a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_hoe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_hoe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_horse_armor.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_horse_armor.json new file mode 100644 index 0000000..41dc713 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_horse_armor.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_horse_armor" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_ingot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_ingot.json new file mode 100644 index 0000000..2e836cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_ingot.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_ingot" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_leggings.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_leggings.json new file mode 100644 index 0000000..14d0f27 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_leggings.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_leggings" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_ore.json new file mode 100644 index 0000000..f06f40a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/iron_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_pickaxe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_pickaxe.json new file mode 100644 index 0000000..37372d2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_pickaxe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_pickaxe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_shovel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_shovel.json new file mode 100644 index 0000000..509a761 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_shovel.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_shovel" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_sword.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_sword.json new file mode 100644 index 0000000..cf47c46 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_sword.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/iron_sword" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_trapdoor.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_trapdoor.json new file mode 100644 index 0000000..178823a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/iron_trapdoor.json @@ -0,0 +1,15 @@ +{ + "parent": "block/iron_trapdoor_bottom", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/item_frame.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/item_frame.json new file mode 100644 index 0000000..e6ff197 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/item_frame.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/item_frame" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jukebox.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jukebox.json new file mode 100644 index 0000000..04012d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jukebox.json @@ -0,0 +1,10 @@ +{ + "parent": "block/jukebox", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_door.json new file mode 100644 index 0000000..3f85dba --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_door.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/door_jungle" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_fence.json new file mode 100644 index 0000000..2d11611 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_fence.json @@ -0,0 +1,13 @@ +{ + "parent": "block/jungle_fence_inventory", + "display": { + "thirdperson": { + "rotation": [ 0, 0, 180 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 90, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_fence_gate.json new file mode 100644 index 0000000..54d4078 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_fence_gate.json @@ -0,0 +1,15 @@ +{ + "parent": "block/jungle_fence_gate_closed", + "display": { + "thirdperson": { + "rotation": [ 0, -90, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_leaves.json new file mode 100644 index 0000000..e481dac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_leaves.json @@ -0,0 +1,10 @@ +{ + "parent": "block/jungle_leaves", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_log.json new file mode 100644 index 0000000..6866eeb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_log.json @@ -0,0 +1,10 @@ +{ + "parent": "block/jungle_log", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_planks.json new file mode 100644 index 0000000..eec7c62 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_planks.json @@ -0,0 +1,10 @@ +{ + "parent": "block/jungle_planks", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_sapling.json new file mode 100644 index 0000000..f7eb37b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_sapling.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/sapling_jungle" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_slab.json new file mode 100644 index 0000000..7627563 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_jungle", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_stairs.json new file mode 100644 index 0000000..3ec3985 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/jungle_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/jungle_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ladder.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ladder.json new file mode 100644 index 0000000..5a8caf0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/ladder.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/ladder" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lapis_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lapis_block.json new file mode 100644 index 0000000..df99c82 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lapis_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/lapis_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lapis_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lapis_ore.json new file mode 100644 index 0000000..196b0c1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lapis_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/lapis_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lava_bucket.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lava_bucket.json new file mode 100644 index 0000000..25669aa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lava_bucket.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bucket_lava" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lead.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lead.json new file mode 100644 index 0000000..a2f8d14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lead.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/lead" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather.json new file mode 100644 index 0000000..4aaf7bc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/leather" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_boots.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_boots.json new file mode 100644 index 0000000..6c28346 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_boots.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/leather_boots", + "layer1": "items/leather_boots_overlay" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_chestplate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_chestplate.json new file mode 100644 index 0000000..7248c1e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_chestplate.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/leather_chestplate", + "layer1": "items/leather_chestplate_overlay" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_helmet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_helmet.json new file mode 100644 index 0000000..654dfe1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_helmet.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/leather_helmet", + "layer1": "items/leather_helmet_overlay" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.25 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_leggings.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_leggings.json new file mode 100644 index 0000000..25c58fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/leather_leggings.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/leather_leggings", + "layer1": "items/leather_leggings_overlay" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lever.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lever.json new file mode 100644 index 0000000..2824174 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lever.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/lever" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_carpet.json new file mode 100644 index 0000000..83d9231 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_light_blue", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_glass.json new file mode 100644 index 0000000..6479edc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_light_blue", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_glass_pane.json new file mode 100644 index 0000000..6a68e0a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_light_blue" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_hardened_clay.json new file mode 100644 index 0000000..802face --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_light_blue", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_wool.json new file mode 100644 index 0000000..f0d1c1a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_blue_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/light_blue_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_weighted_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_weighted_pressure_plate.json new file mode 100644 index 0000000..4b9a7f4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/light_weighted_pressure_plate.json @@ -0,0 +1,10 @@ +{ + "parent": "block/light_pressure_plate_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_carpet.json new file mode 100644 index 0000000..39393e4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_lime", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_glass.json new file mode 100644 index 0000000..acaf202 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_lime", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_glass_pane.json new file mode 100644 index 0000000..2afe3ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_lime" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_hardened_clay.json new file mode 100644 index 0000000..8079e15 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_lime", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_wool.json new file mode 100644 index 0000000..ed54005 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lime_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/lime_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lit_furnace.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lit_furnace.json new file mode 100644 index 0000000..528e067 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lit_furnace.json @@ -0,0 +1,10 @@ +{ + "parent": "block/lit_furnace", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lit_pumpkin.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lit_pumpkin.json new file mode 100644 index 0000000..3f91665 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/lit_pumpkin.json @@ -0,0 +1,10 @@ +{ + "parent": "block/lit_pumpkin", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_carpet.json new file mode 100644 index 0000000..0aaccb5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_magenta", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_glass.json new file mode 100644 index 0000000..984fcab --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_magenta", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_glass_pane.json new file mode 100644 index 0000000..80193d8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_magenta" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_hardened_clay.json new file mode 100644 index 0000000..69bd94a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_magenta", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_wool.json new file mode 100644 index 0000000..3c815f8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magenta_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/magenta_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magma_cream.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magma_cream.json new file mode 100644 index 0000000..17e54cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/magma_cream.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/magma_cream" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/map.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/map.json new file mode 100644 index 0000000..3052429 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/map.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/map_empty" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon.json new file mode 100644 index 0000000..5f26f0c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/melon" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon_block.json new file mode 100644 index 0000000..f5ddd8a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/melon", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon_seeds.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon_seeds.json new file mode 100644 index 0000000..86c0441 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/melon_seeds.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/seeds_melon" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/milk_bucket.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/milk_bucket.json new file mode 100644 index 0000000..3032818 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/milk_bucket.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bucket_milk" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/minecart.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/minecart.json new file mode 100644 index 0000000..e490d14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/minecart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/minecart_normal" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mob_spawner.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mob_spawner.json new file mode 100644 index 0000000..73a4880 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mob_spawner.json @@ -0,0 +1,10 @@ +{ + "parent": "block/mob_spawner_cage", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_brick_monster_egg.json new file mode 100644 index 0000000..7daf6a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_brick_monster_egg.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_mossy", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_cobblestone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_cobblestone.json new file mode 100644 index 0000000..9526aa6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_cobblestone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/mossy_cobblestone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_cobblestone_wall.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_cobblestone_wall.json new file mode 100644 index 0000000..a368f4a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_cobblestone_wall.json @@ -0,0 +1,10 @@ +{ + "parent": "block/cobblestone_wall_mossy_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_stonebrick.json new file mode 100644 index 0000000..7daf6a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mossy_stonebrick.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_mossy", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mushroom_stew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mushroom_stew.json new file mode 100644 index 0000000..d557e05 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mushroom_stew.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/mushroom_stew" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mutton.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mutton.json new file mode 100644 index 0000000..d8814f5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mutton.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/mutton_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mycelium.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mycelium.json new file mode 100644 index 0000000..c94894d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/mycelium.json @@ -0,0 +1,10 @@ +{ + "parent": "block/mycelium", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/name_tag.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/name_tag.json new file mode 100644 index 0000000..f299fac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/name_tag.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/name_tag" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick.json new file mode 100644 index 0000000..11dc45c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick.json @@ -0,0 +1,10 @@ +{ + "parent": "block/nether_brick", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_fence.json new file mode 100644 index 0000000..bc33fac --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_fence.json @@ -0,0 +1,13 @@ +{ + "parent": "block/nether_brick_fence_inventory", + "display": { + "thirdperson": { + "rotation": [ 0, 0, 180 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 90, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_slab.json new file mode 100644 index 0000000..9580320 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_nether_brick", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_stairs.json new file mode 100644 index 0000000..9bdf009 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_brick_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/nether_brick_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_star.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_star.json new file mode 100644 index 0000000..fb4747d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_star.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/nether_star" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_wart.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_wart.json new file mode 100644 index 0000000..0c80622 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/nether_wart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/nether_wart" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/netherbrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/netherbrick.json new file mode 100644 index 0000000..5678329 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/netherbrick.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/netherbrick" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/netherrack.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/netherrack.json new file mode 100644 index 0000000..3263ec0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/netherrack.json @@ -0,0 +1,10 @@ +{ + "parent": "block/netherrack", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/noteblock.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/noteblock.json new file mode 100644 index 0000000..0834aef --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/noteblock.json @@ -0,0 +1,10 @@ +{ + "parent": "block/noteblock", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_door.json new file mode 100644 index 0000000..af9c667 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_door.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/door_wood" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_fence.json new file mode 100644 index 0000000..9900a74 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_fence.json @@ -0,0 +1,13 @@ +{ + "parent": "block/oak_fence_inventory", + "display": { + "thirdperson": { + "rotation": [ 0, 0, 180 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 90, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_fence_gate.json new file mode 100644 index 0000000..673b537 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_fence_gate.json @@ -0,0 +1,15 @@ +{ + "parent": "block/oak_fence_gate_closed", + "display": { + "thirdperson": { + "rotation": [ 0, -90, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_leaves.json new file mode 100644 index 0000000..16ec9e4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_leaves.json @@ -0,0 +1,10 @@ +{ + "parent": "block/oak_leaves", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_log.json new file mode 100644 index 0000000..1de5a96 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_log.json @@ -0,0 +1,10 @@ +{ + "parent": "block/oak_log", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_planks.json new file mode 100644 index 0000000..b07f66e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_planks.json @@ -0,0 +1,10 @@ +{ + "parent": "block/oak_planks", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_sapling.json new file mode 100644 index 0000000..da94de1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_sapling.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/sapling_oak" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_slab.json new file mode 100644 index 0000000..6ce7924 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_oak", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_stairs.json new file mode 100644 index 0000000..258d9ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oak_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/oak_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/obsidian.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/obsidian.json new file mode 100644 index 0000000..2fefd75 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/obsidian.json @@ -0,0 +1,10 @@ +{ + "parent": "block/obsidian", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/old_wood_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/old_wood_slab.json new file mode 100644 index 0000000..6ce7924 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/old_wood_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_oak", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_carpet.json new file mode 100644 index 0000000..1a63048 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_orange", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_glass.json new file mode 100644 index 0000000..98781bc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_orange", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_glass_pane.json new file mode 100644 index 0000000..7be46bc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_orange" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_hardened_clay.json new file mode 100644 index 0000000..73204d0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_orange", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_tulip.json new file mode 100644 index 0000000..a0352d2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_tulip.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_tulip_orange" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_wool.json new file mode 100644 index 0000000..81f08bd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/orange_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/orange_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oxeye_daisy.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oxeye_daisy.json new file mode 100644 index 0000000..305f5e3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/oxeye_daisy.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_oxeye_daisy" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/packed_ice.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/packed_ice.json new file mode 100644 index 0000000..c6a44c9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/packed_ice.json @@ -0,0 +1,10 @@ +{ + "parent": "block/packed_ice", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/paeonia.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/paeonia.json new file mode 100644 index 0000000..e0bdca3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/paeonia.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/double_plant_paeonia_top" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/painting.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/painting.json new file mode 100644 index 0000000..c32e8e6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/painting.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/painting" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/paper.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/paper.json new file mode 100644 index 0000000..89bed78 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/paper.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/paper" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_carpet.json new file mode 100644 index 0000000..2bce717 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_pink", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_glass.json new file mode 100644 index 0000000..fb295f6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_pink", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_glass_pane.json new file mode 100644 index 0000000..167bda2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_pink" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_hardened_clay.json new file mode 100644 index 0000000..2fb45ad --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_pink", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_tulip.json new file mode 100644 index 0000000..4090435 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_tulip.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_tulip_pink" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_wool.json new file mode 100644 index 0000000..ec77f59 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pink_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/pink_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/piston.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/piston.json new file mode 100644 index 0000000..52ff989 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/piston.json @@ -0,0 +1,10 @@ +{ + "parent": "block/piston_inventory_normal", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/podzol.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/podzol.json new file mode 100644 index 0000000..50abda1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/podzol.json @@ -0,0 +1,10 @@ +{ + "parent": "block/podzol", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/poisonous_potato.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/poisonous_potato.json new file mode 100644 index 0000000..03cd066 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/poisonous_potato.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/potato_poisonous" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/poppy.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/poppy.json new file mode 100644 index 0000000..4385fcb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/poppy.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_rose" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/porkchop.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/porkchop.json new file mode 100644 index 0000000..4c3d9b0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/porkchop.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/porkchop_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/potato.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/potato.json new file mode 100644 index 0000000..8ff0ab5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/potato.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/potato" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine.json new file mode 100644 index 0000000..44e3563 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine.json @@ -0,0 +1,10 @@ +{ + "parent": "block/prismarine_rough", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_bricks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_bricks.json new file mode 100644 index 0000000..6315f58 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_bricks.json @@ -0,0 +1,10 @@ +{ + "parent": "block/prismarine_bricks", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_crystals.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_crystals.json new file mode 100644 index 0000000..34cf915 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_crystals.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/prismarine_crystals" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_shard.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_shard.json new file mode 100644 index 0000000..7bf0cea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/prismarine_shard.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/prismarine_shard" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pufferfish.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pufferfish.json new file mode 100644 index 0000000..9de87f8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pufferfish.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fish_pufferfish_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin.json new file mode 100644 index 0000000..7730517 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin.json @@ -0,0 +1,10 @@ +{ + "parent": "block/pumpkin", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin_pie.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin_pie.json new file mode 100644 index 0000000..1cfa47d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin_pie.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/pumpkin_pie" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin_seeds.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin_seeds.json new file mode 100644 index 0000000..289bce1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/pumpkin_seeds.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/seeds_pumpkin" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_carpet.json new file mode 100644 index 0000000..814c2fb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_purple", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_glass.json new file mode 100644 index 0000000..9fb9f44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_purple", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_glass_pane.json new file mode 100644 index 0000000..e89272f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_purple" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_hardened_clay.json new file mode 100644 index 0000000..b12e8a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_purple", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_wool.json new file mode 100644 index 0000000..a0b95dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/purple_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/purple_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz.json new file mode 100644 index 0000000..3f98c00 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/quartz" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_block.json new file mode 100644 index 0000000..007b0d6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/quartz_normal", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_column.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_column.json new file mode 100644 index 0000000..6ce7f5e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_column.json @@ -0,0 +1,10 @@ +{ + "parent": "block/quartz_lines", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_ore.json new file mode 100644 index 0000000..a081294 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/quartz_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_slab.json new file mode 100644 index 0000000..df320da --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_quartz", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_stairs.json new file mode 100644 index 0000000..cd3c370 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/quartz_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/quartz_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit.json new file mode 100644 index 0000000..f0eb737 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/rabbit_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_foot.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_foot.json new file mode 100644 index 0000000..800968f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_foot.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/rabbit_foot" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.25 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_hide.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_hide.json new file mode 100644 index 0000000..1c0f04e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_hide.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/rabbit_hide" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_stew.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_stew.json new file mode 100644 index 0000000..003506b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rabbit_stew.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/rabbit_stew" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rail.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rail.json new file mode 100644 index 0000000..c11f2a9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rail.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/rail_normal" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_11.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_11.json new file mode 100644 index 0000000..a27dfb5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_11.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_11" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_13.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_13.json new file mode 100644 index 0000000..d0b5a61 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_13.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_13" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_blocks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_blocks.json new file mode 100644 index 0000000..d3ffd49 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_blocks.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_blocks" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_cat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_cat.json new file mode 100644 index 0000000..c9f7bd7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_cat.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_cat" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_chirp.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_chirp.json new file mode 100644 index 0000000..53169c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_chirp.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_chirp" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_far.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_far.json new file mode 100644 index 0000000..9a6f35a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_far.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_far" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_mall.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_mall.json new file mode 100644 index 0000000..41cc466 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_mall.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_mall" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_mellohi.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_mellohi.json new file mode 100644 index 0000000..34ce6f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_mellohi.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_mellohi" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_stal.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_stal.json new file mode 100644 index 0000000..c403209 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_stal.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_stal" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_strad.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_strad.json new file mode 100644 index 0000000..8518d32 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_strad.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_strad" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_wait.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_wait.json new file mode 100644 index 0000000..1607500 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_wait.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_wait" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_ward.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_ward.json new file mode 100644 index 0000000..2812f44 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/record_ward.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/record_ward" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_carpet.json new file mode 100644 index 0000000..daa4bd0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_red", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_mushroom.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_mushroom.json new file mode 100644 index 0000000..e3dbd34 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_mushroom.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/mushroom_red" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_mushroom_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_mushroom_block.json new file mode 100644 index 0000000..f946a33 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_mushroom_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/red_mushroom_block_cap_all", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sand.json new file mode 100644 index 0000000..af83cb9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sand.json @@ -0,0 +1,10 @@ +{ + "parent": "block/red_sand", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone.json new file mode 100644 index 0000000..d47e925 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/red_sandstone_normal", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone_slab.json new file mode 100644 index 0000000..a25b976 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_red_sandstone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone_stairs.json new file mode 100644 index 0000000..68aa72d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_sandstone_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/red_sandstone_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_glass.json new file mode 100644 index 0000000..f952d29 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_red", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_glass_pane.json new file mode 100644 index 0000000..e094a71 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_red" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_hardened_clay.json new file mode 100644 index 0000000..7b3afca --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_red", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_tulip.json new file mode 100644 index 0000000..4edb91b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_tulip.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_tulip_red" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_wool.json new file mode 100644 index 0000000..387f171 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/red_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/red_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone.json new file mode 100644 index 0000000..5144e1a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/redstone_dust" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_block.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_block.json new file mode 100644 index 0000000..82516bf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_block.json @@ -0,0 +1,10 @@ +{ + "parent": "block/redstone_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_lamp.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_lamp.json new file mode 100644 index 0000000..2a8df04 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_lamp.json @@ -0,0 +1,10 @@ +{ + "parent": "block/unlit_redstone_lamp", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_ore.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_ore.json new file mode 100644 index 0000000..198fde2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_ore.json @@ -0,0 +1,10 @@ +{ + "parent": "block/redstone_ore", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_torch.json new file mode 100644 index 0000000..191b5d6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/redstone_torch.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/redstone_torch_on" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/reeds.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/reeds.json new file mode 100644 index 0000000..23f2903 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/reeds.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/reeds" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/repeater.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/repeater.json new file mode 100644 index 0000000..4e820e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/repeater.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/repeater" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rotten_flesh.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rotten_flesh.json new file mode 100644 index 0000000..8882261 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/rotten_flesh.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/rotten_flesh" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/saddle.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/saddle.json new file mode 100644 index 0000000..f84d543 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/saddle.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/saddle" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/salmon.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/salmon.json new file mode 100644 index 0000000..8e5c30b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/salmon.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/fish_salmon_raw" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sand.json new file mode 100644 index 0000000..03cb8b2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sand.json @@ -0,0 +1,10 @@ +{ + "parent": "block/sand", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone.json new file mode 100644 index 0000000..469d21e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/sandstone_normal", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone_slab.json new file mode 100644 index 0000000..2dd524f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_sandstone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone_stairs.json new file mode 100644 index 0000000..28e697a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sandstone_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/sandstone_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sea_lantern.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sea_lantern.json new file mode 100644 index 0000000..8873b6c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sea_lantern.json @@ -0,0 +1,10 @@ +{ + "parent": "block/sea_lantern", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/shears.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/shears.json new file mode 100644 index 0000000..86602a2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/shears.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/shears" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sign.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sign.json new file mode 100644 index 0000000..a3172aa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sign.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/sign" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_carpet.json new file mode 100644 index 0000000..3a2053a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_silver", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_glass.json new file mode 100644 index 0000000..d3c583e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_silver", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_glass_pane.json new file mode 100644 index 0000000..7f9cd68 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_silver" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_hardened_clay.json new file mode 100644 index 0000000..05c662a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_silver", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_wool.json new file mode 100644 index 0000000..31615f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/silver_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/silver_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_char.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_char.json new file mode 100644 index 0000000..26d1cde --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_char.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/entity", + "display": { + "thirdperson": { + "rotation": [ 180, -45, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.25, 0.25, 0.25 ] + }, + "firstperson": { + "rotation": [ 0, -180, 0 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ], + "scale": [ 0.7, 0.7, 0.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_creeper.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_creeper.json new file mode 100644 index 0000000..26d1cde --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_creeper.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/entity", + "display": { + "thirdperson": { + "rotation": [ 180, -45, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.25, 0.25, 0.25 ] + }, + "firstperson": { + "rotation": [ 0, -180, 0 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ], + "scale": [ 0.7, 0.7, 0.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_skeleton.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_skeleton.json new file mode 100644 index 0000000..26d1cde --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_skeleton.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/entity", + "display": { + "thirdperson": { + "rotation": [ 180, -45, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.25, 0.25, 0.25 ] + }, + "firstperson": { + "rotation": [ 0, -180, 0 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ], + "scale": [ 0.7, 0.7, 0.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_wither.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_wither.json new file mode 100644 index 0000000..26d1cde --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_wither.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/entity", + "display": { + "thirdperson": { + "rotation": [ 180, -45, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.25, 0.25, 0.25 ] + }, + "firstperson": { + "rotation": [ 0, -180, 0 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ], + "scale": [ 0.7, 0.7, 0.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_zombie.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_zombie.json new file mode 100644 index 0000000..26d1cde --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/skull_zombie.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/entity", + "display": { + "thirdperson": { + "rotation": [ 180, -45, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.25, 0.25, 0.25 ] + }, + "firstperson": { + "rotation": [ 0, -180, 0 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ], + "scale": [ 0.7, 0.7, 0.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/slime.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/slime.json new file mode 100644 index 0000000..bb965f6 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/slime.json @@ -0,0 +1,10 @@ +{ + "parent": "block/slime", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/slime_ball.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/slime_ball.json new file mode 100644 index 0000000..c7c6f32 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/slime_ball.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/slimeball" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/smooth_red_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/smooth_red_sandstone.json new file mode 100644 index 0000000..7b4dc94 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/smooth_red_sandstone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/red_sandstone_smooth", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/smooth_sandstone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/smooth_sandstone.json new file mode 100644 index 0000000..2525f30 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/smooth_sandstone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/sandstone_smooth", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snow.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snow.json new file mode 100644 index 0000000..7f34ed4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snow.json @@ -0,0 +1,10 @@ +{ + "parent": "block/snow", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snow_layer.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snow_layer.json new file mode 100644 index 0000000..fd0c34a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snow_layer.json @@ -0,0 +1,15 @@ +{ + "parent": "block/snow_height2", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snowball.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snowball.json new file mode 100644 index 0000000..cb4a57f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/snowball.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/snowball" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/soul_sand.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/soul_sand.json new file mode 100644 index 0000000..4985cb9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/soul_sand.json @@ -0,0 +1,10 @@ +{ + "parent": "block/soul_sand", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spawn_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spawn_egg.json new file mode 100644 index 0000000..1ddad18 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spawn_egg.json @@ -0,0 +1,19 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/spawn_egg", + "layer1": "items/spawn_egg_overlay" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/speckled_melon.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/speckled_melon.json new file mode 100644 index 0000000..23a0e18 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/speckled_melon.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/melon_speckled" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spider_eye.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spider_eye.json new file mode 100644 index 0000000..86a990c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spider_eye.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/spider_eye" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sponge.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sponge.json new file mode 100644 index 0000000..423a515 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sponge.json @@ -0,0 +1,10 @@ +{ + "parent": "block/sponge", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sponge_wet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sponge_wet.json new file mode 100644 index 0000000..5bd58af --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sponge_wet.json @@ -0,0 +1,10 @@ +{ + "parent": "block/sponge_wet", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_door.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_door.json new file mode 100644 index 0000000..c4cc070 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_door.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/door_spruce" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_fence.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_fence.json new file mode 100644 index 0000000..f14facd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_fence.json @@ -0,0 +1,13 @@ +{ + "parent": "block/spruce_fence_inventory", + "display": { + "thirdperson": { + "rotation": [ 0, 0, 180 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 90, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_fence_gate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_fence_gate.json new file mode 100644 index 0000000..8a4d6b9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_fence_gate.json @@ -0,0 +1,15 @@ +{ + "parent": "block/spruce_fence_gate_closed", + "display": { + "thirdperson": { + "rotation": [ 0, -90, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 90, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_leaves.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_leaves.json new file mode 100644 index 0000000..d8c7ab7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_leaves.json @@ -0,0 +1,10 @@ +{ + "parent": "block/spruce_leaves", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_log.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_log.json new file mode 100644 index 0000000..e13df2a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_log.json @@ -0,0 +1,10 @@ +{ + "parent": "block/spruce_log", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_planks.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_planks.json new file mode 100644 index 0000000..0bfbb1a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_planks.json @@ -0,0 +1,10 @@ +{ + "parent": "block/spruce_planks", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_sapling.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_sapling.json new file mode 100644 index 0000000..77a8b9d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_sapling.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/sapling_spruce" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_slab.json new file mode 100644 index 0000000..51cf2e8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_spruce", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_stairs.json new file mode 100644 index 0000000..9e263b0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/spruce_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/spruce_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stick.json new file mode 100644 index 0000000..daa1fbb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stick.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/stick" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sticky_piston.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sticky_piston.json new file mode 100644 index 0000000..385ca51 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sticky_piston.json @@ -0,0 +1,10 @@ +{ + "parent": "block/piston_inventory_sticky", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone.json new file mode 100644 index 0000000..028deea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_axe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_axe.json new file mode 100644 index 0000000..75d8d4c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_axe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/stone_axe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_monster_egg.json new file mode 100644 index 0000000..4047904 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_monster_egg.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_normal", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_slab.json new file mode 100644 index 0000000..203d76a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_stone_brick", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_stairs.json new file mode 100644 index 0000000..4fa2bc2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_brick_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/stone_brick_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_button.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_button.json new file mode 100644 index 0000000..a1f2154 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_button.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stone_button_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1, -1.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_hoe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_hoe.json new file mode 100644 index 0000000..8321d21 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_hoe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/stone_hoe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_monster_egg.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_monster_egg.json new file mode 100644 index 0000000..028deea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_monster_egg.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_pickaxe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_pickaxe.json new file mode 100644 index 0000000..dba4719 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_pickaxe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/stone_pickaxe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_pressure_plate.json new file mode 100644 index 0000000..b384ea0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_pressure_plate.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stone_pressure_plate_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_shovel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_shovel.json new file mode 100644 index 0000000..3df4798 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_shovel.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/stone_shovel" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_slab.json new file mode 100644 index 0000000..a8d04d1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_stone", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_stairs.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_stairs.json new file mode 100644 index 0000000..11d26ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "block/stone_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_sword.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_sword.json new file mode 100644 index 0000000..0382f48 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stone_sword.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/stone_sword" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stonebrick.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stonebrick.json new file mode 100644 index 0000000..4047904 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/stonebrick.json @@ -0,0 +1,10 @@ +{ + "parent": "block/stonebrick_normal", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/string.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/string.json new file mode 100644 index 0000000..08ae929 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/string.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/string" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sugar.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sugar.json new file mode 100644 index 0000000..55bba0c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sugar.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/sugar" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sunflower.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sunflower.json new file mode 100644 index 0000000..429226e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/sunflower.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/double_plant_sunflower_front" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/syringa.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/syringa.json new file mode 100644 index 0000000..2dd55ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/syringa.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/double_plant_syringa_top" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tall_grass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tall_grass.json new file mode 100644 index 0000000..c95e146 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tall_grass.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/tallgrass" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tnt.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tnt.json new file mode 100644 index 0000000..3712318 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tnt.json @@ -0,0 +1,10 @@ +{ + "parent": "block/tnt", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tnt_minecart.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tnt_minecart.json new file mode 100644 index 0000000..9e854ef --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tnt_minecart.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/minecart_tnt" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/torch.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/torch.json new file mode 100644 index 0000000..92f72f3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/torch.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/torch_on" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/trapdoor.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/trapdoor.json new file mode 100644 index 0000000..9ea194d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/trapdoor.json @@ -0,0 +1,15 @@ +{ + "parent": "block/wooden_trapdoor_bottom", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/trapped_chest.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/trapped_chest.json new file mode 100644 index 0000000..43a272a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/trapped_chest.json @@ -0,0 +1,3 @@ +{ + "parent": "builtin/entity" +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tripwire_hook.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tripwire_hook.json new file mode 100644 index 0000000..e14fa42 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/tripwire_hook.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/trip_wire_source" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/vine.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/vine.json new file mode 100644 index 0000000..60c30cd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/vine.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/vine" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/water_bucket.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/water_bucket.json new file mode 100644 index 0000000..0a20cf7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/water_bucket.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/bucket_water" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/waterlily.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/waterlily.json new file mode 100644 index 0000000..66fb79d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/waterlily.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/waterlily" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/web.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/web.json new file mode 100644 index 0000000..b345a5d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/web.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/web" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wheat.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wheat.json new file mode 100644 index 0000000..dd50fa5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wheat.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/wheat" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wheat_seeds.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wheat_seeds.json new file mode 100644 index 0000000..107bf47 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wheat_seeds.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/seeds_wheat" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -2.5 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_carpet.json new file mode 100644 index 0000000..eac5ac1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_white", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_glass.json new file mode 100644 index 0000000..af34ba8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_white", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_glass_pane.json new file mode 100644 index 0000000..b7b1372 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_white" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_hardened_clay.json new file mode 100644 index 0000000..6028733 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_white", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_tulip.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_tulip.json new file mode 100644 index 0000000..af91c3a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_tulip.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/flower_tulip_white" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_wool.json new file mode 100644 index 0000000..867cd01 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/white_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/white_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wood_old_slab.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wood_old_slab.json new file mode 100644 index 0000000..6ce7924 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wood_old_slab.json @@ -0,0 +1,10 @@ +{ + "parent": "block/half_slab_oak", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_axe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_axe.json new file mode 100644 index 0000000..07d818c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_axe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/wood_axe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_button.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_button.json new file mode 100644 index 0000000..ca81892 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_button.json @@ -0,0 +1,10 @@ +{ + "parent": "block/wooden_button_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1, -1.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_hoe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_hoe.json new file mode 100644 index 0000000..3411d0f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_hoe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/wood_hoe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_pickaxe.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_pickaxe.json new file mode 100644 index 0000000..d66d901 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_pickaxe.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/wood_pickaxe" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_pressure_plate.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_pressure_plate.json new file mode 100644 index 0000000..f36987f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_pressure_plate.json @@ -0,0 +1,10 @@ +{ + "parent": "block/wooden_pressure_plate_inventory", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_shovel.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_shovel.json new file mode 100644 index 0000000..6d621ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_shovel.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/wood_shovel" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_sword.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_sword.json new file mode 100644 index 0000000..4e760a8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/wooden_sword.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/wood_sword" + }, + "display": { + "thirdperson": { + "rotation": [ 0, 90, -35 ], + "translation": [ 0, 1.25, -3.5 ], + "scale": [ 0.85, 0.85, 0.85 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/writable_book.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/writable_book.json new file mode 100644 index 0000000..1b31f3c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/writable_book.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/book_writable" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/written_book.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/written_book.json new file mode 100644 index 0000000..444edef --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/written_book.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "items/book_written" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_carpet.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_carpet.json new file mode 100644 index 0000000..08593c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_carpet.json @@ -0,0 +1,15 @@ +{ + "parent": "block/carpet_yellow", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 0.25, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "firstperson": { + "rotation": [ 0, 0, 0 ], + "translation": [ 0, 5.25, 0 ], + "scale": [ 1, 1, 1 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_glass.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_glass.json new file mode 100644 index 0000000..7c68f57 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_glass.json @@ -0,0 +1,10 @@ +{ + "parent": "block/glass_yellow", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_glass_pane.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_glass_pane.json new file mode 100644 index 0000000..1b50852 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_glass_pane.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "blocks/glass_yellow" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_hardened_clay.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_hardened_clay.json new file mode 100644 index 0000000..2eaa2b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_stained_hardened_clay.json @@ -0,0 +1,10 @@ +{ + "parent": "block/hardened_clay_yellow", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_wool.json b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_wool.json new file mode 100644 index 0000000..d9d76fe --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/models/item/yellow_wool.json @@ -0,0 +1,10 @@ +{ + "parent": "block/yellow_wool", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/bettergrass.properties b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/bettergrass.properties new file mode 100644 index 0000000..6964b28 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/bettergrass.properties @@ -0,0 +1,33 @@ +# Configuration for OptiFine's Better Grass feature +# Location: /assets/minecraft/optifine/bettergrass.properties + +# Blocks +# Enable Better Grass for specific blocks +grass=true +mycelium=true +podzol=true + +# Snowy blocks +# Enable Better Grass for specific blocks which have snow on top +grass.snow=true +mycelium.snow=true +podzol.snow=true + +# Multilayer grass sides +# - layer 1 = grass_side +# - layer 2 = grass (colored by biome) +# Allows transparent grass texture to be used as overlay for the grass side +grass.multilayer=false + +# Textures +# Configure which textures to be used +# The "texture.grass" is colored by biome +texture.grass=blocks/grass_top +texture.grass_side=blocks/grass_side +texture.mycelium=blocks/mycelium_top +texture.podzol=blocks/dirt_podzol_top +texture.snow=blocks/snow + + + + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/cs_CZ.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/cs_CZ.lang new file mode 100644 index 0000000..dd28ccc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/cs_CZ.lang @@ -0,0 +1,759 @@ +# Hlavní +of.general.ambiguous=dvojznačný +of.general.compact=Kompaktní +of.general.custom=Vlastní +of.general.from=Z +of.general.id=Id +of.general.max=Maximální +of.general.restart=restart +of.general.smart=Chytrá + +# Klávesy +of.key.zoom=Přiblížení + +# Zprávy +of.message.aa.shaders1=Antialiasing není kompatibilní se stíny. +of.message.aa.shaders2=Prosím vypni stíny pro použití téhle možnosti. + +of.message.af.shaders1=Anizotropní filtrování není kompatibilní se stíny. +of.message.af.shaders2=Prosím vypni stíny pro použití téhle možnosti. + +of.message.fr.shaders1=Rychlý render není kompatibilní se stíny. +of.message.fr.shaders2=Prosím vypni stíny pro použití téhle možnosti. + +of.message.an.shaders1=3D zobrazení není kompatibilní se stíny. +of.message.an.shaders2=Prosím vypni stíny pro použití téhle možnosti. + +of.message.shaders.aa1=Stíny nejsou kompatibilní s antialiasingem. +of.message.shaders.aa2=Jdi do nastavení kvality -> antialiasing na NE a restartuj hru. + +of.message.shaders.af1=Stíny nejsou kompatibilní s anizotropním filtrováním. +of.message.shaders.af2=Jdi do nastavení kvality -> anizotropní filtrování na NE. + +of.message.shaders.fr1=Stíny nejsou komoatibilní s rychlým renderem. +of.message.shaders.fr2=Jdi do nastavení výkonu -> rychlý render na NE. + +of.message.shaders.an1=Stíny nejsou kompatibilní se 3D zobrazením. +of.message.shaders.an2=Jdi do nastavení ostatního -> 3D zobrazení na NE. + +of.message.shaders.nv1=Tento balíček stínů vyžaduje novější verzi OptiFine: %s +of.message.shaders.nv2=Jseš si jist, že chceš pokračovat? + +of.message.newVersion=Nová verze §eOptiFinu§f je k dispozici: §e%s§f +of.message.java64Bit=Můžeš si nainstalovat §e64-bitovou Javu§f pro zvýšení výkonu. +of.message.openglError=§eChyba OpenGL§f: %s (%s) + +of.message.shaders.loading=Načítám stíny: %s + +of.message.other.reset=Vyresetovat všechno nastavení videa (grafiky) na výchozí hodnoty? + +of.message.loadingVisibleChunks=Načítám vididetlné chunky + +# Úprava skinu + +of.options.skinCustomisation.ofCape=OptiFine kápě... + +of.options.capeOF.title=OptiFine kápě +of.options.capeOF.openEditor=Otevřít editor kápě +of.options.capeOF.reloadCape=Obnovit kápi + +of.message.capeOF.openEditor=Editor OptiFine kápě by se nyní měl otevřít ve webovém prohližeči. +of.message.capeOF.reloadCape=Kápě budu obnovena (znovu načtena) za 15 sekund. + +of.message.capeOF.error1=Chyba při oěření se servery Mojangu. +of.message.capeOF.error2=Chyba: %s + +# Nastavení Grafiky + +options.graphics.tooltip.1=Vizuální kvalita +options.graphics.tooltip.2= Rychlá - nižší kvalita, rychlejší +options.graphics.tooltip.3= Pěkná - vyšší kvalita, pomalejší +options.graphics.tooltip.4=Mění vzhled mraků, listí, vody, +options.graphics.tooltip.5=stínů a stran trávníků. + +of.options.renderDistance.tiny=Maličký +of.options.renderDistance.short=Malý +of.options.renderDistance.normal=Normální +of.options.renderDistance.far=Velký +of.options.renderDistance.extreme=Extrémní +of.options.renderDistance.insane=Šílený +of.options.renderDistance.ludicrous=Neuvěřitelný + +options.renderDistance.tooltip.1=Dohled +options.renderDistance.tooltip.2= 2 Maličký - 32m (nejrychlejší) +options.renderDistance.tooltip.3= 8 Normální - 128m (normální) +options.renderDistance.tooltip.4= 16 Velký - 256m (pomalejší) +options.renderDistance.tooltip.5= 32 Extrémní - 512m (nejpomalejší!) velmi výkonově náročné +options.renderDistance.tooltip.6= 48 Šílený - 768m, potřebuje 2 GB přidělené RAM +options.renderDistance.tooltip.7= 64 Neuvěřitelný - 1024m, potřebuje 3 GB přidělené RAM +options.renderDistance.tooltip.8=Hodnoty nad 16 Velká jsou pouze pro lokální světy. + +options.ao.tooltip.1=Vyhlazené stíny +options.ao.tooltip.2= NE - žádné vyhlazené osvětlení (rychlejší) +options.ao.tooltip.3= Minimální - jednoduše vyhlazené osvětlení (pomalejší) +options.ao.tooltip.4= Maximální - kompletně vyhlazené osvětlení (nejpomalejší) + +options.framerateLimit.tooltip.1=Limit FPS +options.framerateLimit.tooltip.2= VSync - limitované pro max počet FPS pro monitor (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - nastavitelné +options.framerateLimit.tooltip.4= Neomezené - bez limitu (nejrychlejší) +options.framerateLimit.tooltip.5=FPS limit sníží FPS, i když +options.framerateLimit.tooltip.6=stanovená hodnota není překročena. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Úroveň vyhlazených stínů +of.options.AO_LEVEL.tooltip.1=Úroveň vyhlazených stínů +of.options.AO_LEVEL.tooltip.2= NE - žádné stíny +of.options.AO_LEVEL.tooltip.3= 50%% - světlé stíny +of.options.AO_LEVEL.tooltip.4= 100%% - tmavé stíny + +options.viewBobbing.tooltip.1=Více realistický pohyb +options.viewBobbing.tooltip.2=Pokud používáš mipmapy, nastav na NE pro nejlepší výsledky. + +options.guiScale.tooltip.1=Velikost GUI +options.guiScale.tooltip.2= Automatická - maximální velikost +options.guiScale.tooltip.3= Malá, Normální, Velká - 1x až 3x +options.guiScale.tooltip.4= 4x do 10x - dostupné na 4K obrazovkách +options.guiScale.tooltip.5=Liché hodnoty (1x, 3x, 5x ...) nejsou kompatibilní s písmem Unicode. +options.guiScale.tooltip.6=Menší GUI mohou být rychlejší. + +options.vbo=Použít VBO +options.vbo.tooltip.1= Použít VBO +options.vbo.tooltip.2=Používá alternativní model renderování, který je +options.vbo.tooltip.3=rychlejší (5-10%%) oproti výchozímu renderování. + +options.gamma.tooltip.1=Zvýší jas tmavých objektů. +options.gamma.tooltip.2= Tmavý - standardní jas +options.gamma.tooltip.3= 1-99%% - nastavitelné +options.gamma.tooltip.4= Jasný - maximální jas tmavých objektů +options.gamma.tooltip.5=Tato možnost nezmění jas +options.gamma.tooltip.6=dokonale černých objektů. + +options.anaglyph.tooltip.1=3D Zobrazení +options.anaglyph.tooltip.2=Zapne stereoskopické 3D, které používá rozdílné barvy +options.anaglyph.tooltip.3=pro každé oko. +options.anaglyph.tooltip.4=Vyžaduje červeno-modré brýle pro správné vidění. + +options.attackIndicator.tooltip.1=Nastavuje pozici ukazatele útoku +options.attackIndicator.tooltip.2= Křížek - pod středovým křížkem +options.attackIndicator.tooltip.3= Lišta - nalevo od spodní lišty +options.attackIndicator.tooltip.4= NE - žádný ukazatel útoku +options.attackIndicator.tooltip.5=Ukazatel útoku zobrazuje sílu útoku +options.attackIndicator.tooltip.6=aktuálně vybaveného itemu. + +of.options.ALTERNATE_BLOCKS=Různé bloky +options.blockAlternatives.tooltip.1=Alternativní bloky +options.blockAlternatives.tooltip.2=Používá rozdílné modely bloku pro některé modely. +options.blockAlternatives.tooltip.3=Záleží na vybraném balíčku zdrojů. + +of.options.FOG_FANCY=Mlha +of.options.FOG_FANCY.tooltip.1=Typ mlhy +of.options.FOG_FANCY.tooltip.2= Rychlá - rychlejší mlha +of.options.FOG_FANCY.tooltip.3= Pěkná - pomalejší mlha, vypadá pěkněji +of.options.FOG_FANCY.tooltip.4= NE - žádná mlha, rychlejší +of.options.FOG_FANCY.tooltip.5=Pěkná mlha se aktivuje jen když je podporována +of.options.FOG_FANCY.tooltip.6=grafickými ovladači. + +of.options.FOG_START=Začátek mlhy +of.options.FOG_START.tooltip.1=Start mlhy +of.options.FOG_START.tooltip.2= 0.2 - mlha začne přímo u hráče +of.options.FOG_START.tooltip.3= 0.8 - mlha začne daleko od hráče +of.options.FOG_START.tooltip.4=Tato možnost většinou neovlivňuje výkon. + +of.options.CHUNK_LOADING=Načítaní chunků +of.options.CHUNK_LOADING.tooltip.1= Načítaní chunků +of.options.CHUNK_LOADING.tooltip.2= Výchozí - nestabilní FPS při načítání chunků +of.options.CHUNK_LOADING.tooltip.3= Plynulé - stabilní FPS +of.options.CHUNK_LOADING.tooltip.4= Více jader - stabilní FPS, 3x rychlejší načítání světa +of.options.CHUNK_LOADING.tooltip.5=Plynulé a Více jader - odstraní sekání a +of.options.CHUNK_LOADING.tooltip.6=zmrazování způsobené načítáním chunků. +of.options.CHUNK_LOADING.tooltip.7=Více jader může 3x zrychlit načítání světa a +of.options.CHUNK_LOADING.tooltip.8=zvýšit FPS používáním druhého (nebo jiného) jádra. +of.options.chunkLoading.smooth=Plynulé +of.options.chunkLoading.multiCore=Více jader + +of.options.shaders=Stíny... +of.options.shadersTitle=Stíny (shadery) + +of.options.shaders.packNone=ŽÁDNÉ +of.options.shaders.packDefault=(interní) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= NE - (výchozí) žádný antialiasing (rychlejší) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - vyhlazené hrany (pomalejší) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA je post-processing efekt, který vyhladí +of.options.shaders.ANTIALIASING.tooltip.5=pixelované hrany a přechody barev. +of.options.shaders.ANTIALIASING.tooltip.6=Je rychlejší jak tradiční antialiasing +of.options.shaders.ANTIALIASING.tooltip.7=a je kompatibilní se stíny a rychlým renderem. + +of.options.shaders.NORMAL_MAP=Normální mapa +of.options.shaders.NORMAL_MAP.tooltip.1=Normální mapa +of.options.shaders.NORMAL_MAP.tooltip.2= ANO - zapne normální mapy (výchozí) +of.options.shaders.NORMAL_MAP.tooltip.3= NE - vypne normální mapy +of.options.shaders.NORMAL_MAP.tooltip.4=Normální mapy mohou být použity balíčekem stínů +of.options.shaders.NORMAL_MAP.tooltip.5=na simulování 3D geometrie na rovných plochách. +of.options.shaders.NORMAL_MAP.tooltip.6=Textury normálních map záleži na aktuálním +of.options.shaders.NORMAL_MAP.tooltip.7=balíčku zdrojů. + +of.options.shaders.SPECULAR_MAP=Spekulární mapa +of.options.shaders.SPECULAR_MAP.tooltip.1=Spekulární mapa +of.options.shaders.SPECULAR_MAP.tooltip.2= ANO - zapne spekulární mapy (výchozí) +of.options.shaders.SPECULAR_MAP.tooltip.3= NE - vypne spekulární mapy +of.options.shaders.SPECULAR_MAP.tooltip.4=Spekulární mapy mohou být použity balíčkem stínů +of.options.shaders.SPECULAR_MAP.tooltip.5=pro simulování efektů reflekce. +of.options.shaders.SPECULAR_MAP.tooltip.6=Textury spekulárních map závisí +of.options.shaders.SPECULAR_MAP.tooltip.7=na aktuálním balíčku zdrojů. + +of.options.shaders.RENDER_RES_MUL=Kvalita renderu +of.options.shaders.RENDER_RES_MUL.tooltip.1=Kvalita renderu +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - malá (nejrychlehjší) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standardní (výchozí) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - vysoká (nejpomalejší) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Render kvalita ovládá velikost textury +of.options.shaders.RENDER_RES_MUL.tooltip.6=kterou balíček stínů renderuje. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Nižší hodnoty mohou být užitečné na 4K displejích. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Vyšší fungují jako antialiasing filtr. + +of.options.shaders.SHADOW_RES_MUL=Kvalita stínů +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Kvalita stínů +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - nízká (nejrychlejší) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standardní (výchozí) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - vysoká (nejpomalejší) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Kvalita stínů ovládá velikost textury mapy stínů +of.options.shaders.SHADOW_RES_MUL.tooltip.6=použitou balíčkem stínů. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Nižší hodnoty = nejasné, hrubší stíny. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Vyšší hodnoty = detailní, pěkné stíny. + +of.options.shaders.HAND_DEPTH_MUL=Hloubka ruky +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Hloubka ruky +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - ruka přímo u kamery +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (výchozí) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - ruka daleko od kamery +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Hloubka ruky ovládá, jak jsou objekty v ruce a ruka +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=samotná daleko od kamery. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Pro balíčky stínu, které používají rozmazání +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=by tohle mohlo zabránit rozmazání ruky. + +of.options.shaders.CLOUD_SHADOW=Stíny mraků + +of.options.shaders.OLD_HAND_LIGHT=Staré ruční osvětlení +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Staré osvětlení ruky +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Výchozí - ovládané balíčkem stínů +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= ANO - použít staré světlo +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= NE - použít nové světlo +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Staré ruční osvětlení umožní balíčkům stínů, které jen +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=rozeznávají itemy emitující světlo fungovat i s +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=itemy v druhé ruce. + +of.options.shaders.OLD_LIGHTING=Staré osvětlení +of.options.shaders.OLD_LIGHTING.tooltip.1=Staré osvětlení +of.options.shaders.OLD_LIGHTING.tooltip.2= Výchozí - ovládané balíčkem stínů +of.options.shaders.OLD_LIGHTING.tooltip.3= ANO - použít staré osvětlení +of.options.shaders.OLD_LIGHTING.tooltip.4= NE - nepoužívat staré osvětlení +of.options.shaders.OLD_LIGHTING.tooltip.5=Staré osvětlení ovládá světlo, které +of.options.shaders.OLD_LIGHTING.tooltip.6=Minecraft dává na strany bloků. +of.options.shaders.OLD_LIGHTING.tooltip.7=Balíčky stínů, které stíny používají často mají +of.options.shaders.OLD_LIGHTING.tooltip.8=mnohem lepší osvětlení závisející na pozici slunce. + +of.options.shaders.DOWNLOAD=Stáhnout stíny +of.options.shaders.DOWNLOAD.tooltip.1=Stáhnout stíny (shadery) +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Otevře stránku balíčků stínů v internetovém prohlížeči. +of.options.shaders.DOWNLOAD.tooltip.4=Dej stáhnuté balíčky do "složký stínů" +of.options.shaders.DOWNLOAD.tooltip.5=a ony se pak objeví v seznmu instalovaných stínů. + +of.options.shaders.SHADER_PACK=Balíček stínů (shader pack) + +of.options.shaders.shadersFolder=Složka stínů +of.options.shaders.shaderOptions=Možnosti stínů... + +of.options.shaderOptionsTitle=Možnosti stínů + +of.options.quality=Kvalita... +of.options.qualityTitle=Nastavení kvality + +of.options.details=Detaily... +of.options.detailsTitle=Nastavení detailů + +of.options.performance=Výkon... +of.options.performanceTitle=Nastavení výkonu + +of.options.animations=Animace... +of.options.animationsTitle=Nastavení animací + +of.options.other=Ostatní... +of.options.otherTitle=Zbytek nastavení + +of.options.other.reset=Vyresetovat Nastavení videa/grafiky ... + +of.shaders.profile=Profil + +# Kvalita + +of.options.mipmap.bilinear=Bilineání +of.options.mipmap.linear=Lineární +of.options.mipmap.nearest=Nejbližší +of.options.mipmap.trilinear=Trilineární + +options.mipmapLevels.tooltip.1=Vizuální efekt, který dělá vzdálené objekty lepší +options.mipmapLevels.tooltip.2=vyhlazením texturových detailů. +options.mipmapLevels.tooltip.3= NE - žádné vyhlazení +options.mipmapLevels.tooltip.4= 1 - minimální vyhlazení +options.mipmapLevels.tooltip.5= Maximální - maximální vyhlazení +options.mipmapLevels.tooltip.6=Tato možnost většinou neovlivňuje výkon. + +of.options.MIPMAP_TYPE=Typ Mipmapy +of.options.MIPMAP_TYPE.tooltip.1=Vizuální efekty mohou udělat vzdálenější objekty pěknější +of.options.MIPMAP_TYPE.tooltip.2=vyhlazováním a detailními texturami. +of.options.MIPMAP_TYPE.tooltip.3= Nejbližší - hrubé vyhlazování (nejrychlejší) +of.options.MIPMAP_TYPE.tooltip.4= Lineární - normální vyhlazování +of.options.MIPMAP_TYPE.tooltip.5= Bilineární - dobré vyhlazování +of.options.MIPMAP_TYPE.tooltip.6= Trilineární - nejlepší vyhlazování (nejpomalejší) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= NE - (výchozí) žádný Antialiasing (rychlé) +of.options.AA_LEVEL.tooltip.3= 2-16 - vyhlazené hrany a linie (pomalé) +of.options.AA_LEVEL.tooltip.4=Antialiasing vyhlazuje rozviklané hrany a +of.options.AA_LEVEL.tooltip.5=přechody ostrých barev. +of.options.AA_LEVEL.tooltip.6=Pokud je na ANO, může výrazně zmenší FPS. +of.options.AA_LEVEL.tooltip.7=Ne všechny úrovně jsou podporované všemi grafickými kartami. +of.options.AA_LEVEL.tooltip.8=Efektivní po RESTARTU! + +of.options.AF_LEVEL=Antizotropní filtrování +of.options.AF_LEVEL.tooltip.1= Antizotropní filtrování +of.options.AF_LEVEL.tooltip.2= NE - (výchozí) standartní detaily textur (rychlé) +of.options.AF_LEVEL.tooltip.3= 2-16 - lepší detaily v mipmapovaných texturách (pomalé) +of.options.AF_LEVEL.tooltip.4= Antizotropní Filtrování obnoví všechny detaily v +of.options.AF_LEVEL.tooltip.5=mipmapovaných texturách. +of.options.AF_LEVEL.tooltip.6=Pokud je na ANO, výrazně sníží FPS. + +of.options.CLEAR_WATER=Čistá voda +of.options.CLEAR_WATER.tooltip.1= Čistá voda +of.options.CLEAR_WATER.tooltip.2= ANO - čistá, průhledná voda +of.options.CLEAR_WATER.tooltip.3= NE - výchozí voda + +of.options.RANDOM_ENTITIES=Náhodné entity +of.options.RANDOM_ENTITIES.tooltip.1= Náhodné entity +of.options.RANDOM_ENTITIES.tooltip.2= NE - žádné náhodné entity, rychlejší +of.options.RANDOM_ENTITIES.tooltip.3= ANO - náhodné entity, pomalejší +of.options.RANDOM_ENTITIES.tooltip.4=Funkce náhodné entity používá náhodně textury pro entity ve hře. +of.options.RANDOM_ENTITIES.tooltip.5=Vyžaduje balíček textur, který má více textur entit. + +of.options.BETTER_GRASS=Lepší trávník +of.options.BETTER_GRASS.tooltip.1=Lepší trávník +of.options.BETTER_GRASS.tooltip.2= NE - výchozí strana trávníku, rychlejší +of.options.BETTER_GRASS.tooltip.3= Rychlá - plná strana trávníku, pomalejší +of.options.BETTER_GRASS.tooltip.4= Pěkná - dynamická strana trávníku, nejpomalejší + +of.options.BETTER_SNOW=Lepší sníh +of.options.BETTER_SNOW.tooltip.1=Lepší sníh +of.options.BETTER_SNOW.tooltip.2= NE - výchozí sníh, rychlejší +of.options.BETTER_SNOW.tooltip.3= ANO - lepší sníh, pomalejší +of.options.BETTER_SNOW.tooltip.4=Zobrazuje sníh pod průhlednými bloky (plot, vysoká tráva) +of.options.BETTER_SNOW.tooltip.5=když sousedí se sněhovými bloky. + +of.options.CUSTOM_FONTS=Vlastní písmo +of.options.CUSTOM_FONTS.tooltip.1= Vlastní písmo +of.options.CUSTOM_FONTS.tooltip.2= ANO - používá vlastní písmo (výchozí), pomalejší +of.options.CUSTOM_FONTS.tooltip.3= NE - používá výchozí písmo, rychlejší +of.options.CUSTOM_FONTS.tooltip.4=Vlastní písmo záleží na vybraném +of.options.CUSTOM_FONTS.tooltip.5=balíčku zdrojů. + +of.options.CUSTOM_COLORS=Vlastní barvy +of.options.CUSTOM_COLORS.tooltip.1= Vlastní barvy +of.options.CUSTOM_COLORS.tooltip.2= ANO - používá vlastní barvy (výchozí), pomalejší +of.options.CUSTOM_COLORS.tooltip.3= NE - používá výchozí barvy, rychlejší +of.options.CUSTOM_COLORS.tooltip.4=Vlastní barvy záleží na vybraném +of.options.CUSTOM_COLORS.tooltip.5=balíčku zdrojů. + +of.options.SWAMP_COLORS=Barvy v bažinách +of.options.SWAMP_COLORS.tooltip.1= Barvy v bažinách +of.options.SWAMP_COLORS.tooltip.2= ANO - používá barvy v bažinách (výchozí), pomalejší +of.options.SWAMP_COLORS.tooltip.3= NE - nepoužívá barvy v bažinách, rychlejší +of.options.SWAMP_COLORS.tooltip.4=Barvy v bažinách ovlivňují trávník, listy, lijány a vodu. + +of.options.SMOOTH_BIOMES=Vyhlazené biomy +of.options.SMOOTH_BIOMES.tooltip.1=Vyhlazené biomy +of.options.SMOOTH_BIOMES.tooltip.2= ANO - vyhlazování hranic biomů (výchozí), pomalejší +of.options.SMOOTH_BIOMES.tooltip.3= NE - žádné vyhlazování hranic biomů, rychlejší +of.options.SMOOTH_BIOMES.tooltip.4=Vyhlazování hranic biomů je uděláno vzorkováním +of.options.SMOOTH_BIOMES.tooltip.5=a průměrováním barev všech sousedících bloků. +of.options.SMOOTH_BIOMES.tooltip.6=Ovlivňuje trávník, listí, lijány a vodu. + +of.options.CONNECTED_TEXTURES=Spojené textury +of.options.CONNECTED_TEXTURES.tooltip.1=Spojené textury +of.options.CONNECTED_TEXTURES.tooltip.2= NE - žádné spojené textury (výchozí), rychlejší +of.options.CONNECTED_TEXTURES.tooltip.3= Rychlá - rychle spojené textury +of.options.CONNECTED_TEXTURES.tooltip.4= Pěkná - pěkně spojené textury +of.options.CONNECTED_TEXTURES.tooltip.5=Spojené textury spojují textury skla, +of.options.CONNECTED_TEXTURES.tooltip.6=pískovce a knihoven když jsou +of.options.CONNECTED_TEXTURES.tooltip.7=vedle sebe. Spojené textury záleží +of.options.CONNECTED_TEXTURES.tooltip.8=na vybraném balíčku zdrojů. + +of.options.NATURAL_TEXTURES=Naturální textury +of.options.NATURAL_TEXTURES.tooltip.1=Naturální textury +of.options.NATURAL_TEXTURES.tooltip.2= NE - žádné naturální textury, rychlejší +of.options.NATURAL_TEXTURES.tooltip.3= ANO - používá naturální textury +of.options.NATURAL_TEXTURES.tooltip.4=Naturální textury odstraňují vzor na hranách +of.options.NATURAL_TEXTURES.tooltip.5=vytvořen bloky stejných typů vedle sebe. +of.options.NATURAL_TEXTURES.tooltip.6=Používá otočené a převrácené základy +of.options.NATURAL_TEXTURES.tooltip.7=textury bloků. Nastavení pro naturální textury +of.options.NATURAL_TEXTURES.tooltip.8=je ovlivňováno vybraným balíčkem zdrojů. + +of.options.EMISSIVE_TEXTURES=Emisivní textury +of.options.EMISSIVE_TEXTURES.tooltip.1=Emisivní textury +of.options.EMISSIVE_TEXTURES.tooltip.2= NE - žádné emisivní textury (výchozí) +of.options.EMISSIVE_TEXTURES.tooltip.3= ANO - použít emisivní textury +of.options.EMISSIVE_TEXTURES.tooltip.4=Emisivní textury jsou renderovány jako překrytí +of.options.EMISSIVE_TEXTURES.tooltip.5=(s maximální září) textur. Mohou být použity na simulování +of.options.EMISSIVE_TEXTURES.tooltip.6=ploch, které mají zářit na textuře bez překrytí. +of.options.EMISSIVE_TEXTURES.tooltip.7=Emisivní textury záleží na vybraném +of.options.EMISSIVE_TEXTURES.tooltip.8=balíčku zdrojů. + +of.options.CUSTOM_SKY=Vlastní obloha +of.options.CUSTOM_SKY.tooltip.1=Vlastní obloha +of.options.CUSTOM_SKY.tooltip.2= ANO - používá vlastní textury oblohy (výchozí), pomalejší +of.options.CUSTOM_SKY.tooltip.3= NE - výchozí obloha, rychlejší +of.options.CUSTOM_SKY.tooltip.4=Vlastní textura oblohy je ovlivňována vybraným +of.options.CUSTOM_SKY.tooltip.5=balíčkem zdrojů. + +of.options.CUSTOM_ITEMS=Vlastní itemy +of.options.CUSTOM_ITEMS.tooltip.1=Vlastní itemy +of.options.CUSTOM_ITEMS.tooltip.2= ANO - vlastní textury itemů (výchozí), pomalejší +of.options.CUSTOM_ITEMS.tooltip.3= NE - výchozí textury itemů, rychlejší +of.options.CUSTOM_ITEMS.tooltip.4=Vlastní itemy záleží na vybraném +of.options.CUSTOM_ITEMS.tooltip.5=balíčku zdrojů. + +of.options.CUSTOM_ENTITY_MODELS=Vlastní modely entit +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Vlastní modely entit +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ANO - vlastní modely entit (výchozí), pomalé +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= NE - výchozí modely entit, rychlejší +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Vlastní modely entit záleží na vybraném +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=balíčku zdrojů. + +of.options.CUSTOM_GUIS=Vlastní GUI +of.options.CUSTOM_GUIS.tooltip.1=Vlastní uživatelské rozhraní +of.options.CUSTOM_GUIS.tooltip.2= ON - vlastní GUI (výchozí), pomalejší +of.options.CUSTOM_GUIS.tooltip.3= OFF - výchozí GUI, rychlejší +of.options.CUSTOM_GUIS.tooltip.4=Vlastní GUI záleží na vybraném resource packu. + +# Detaily + +of.options.CLOUDS=Mraky +of.options.CLOUDS.tooltip.1=Mraky +of.options.CLOUDS.tooltip.2= Výchozí - z nastavení grafiky +of.options.CLOUDS.tooltip.3= Rychlé - nižší kvalita, rychlejší +of.options.CLOUDS.tooltip.4= Pěkné - vyšší kvalita, pěknější +of.options.CLOUDS.tooltip.5= NE - žádné mraky, nejrychlejší +of.options.CLOUDS.tooltip.6=Rychlé mraky jsou 2D. +of.options.CLOUDS.tooltip.7=Pěkné mraky jsou 3D. + +of.options.CLOUD_HEIGHT=Výška mraků +of.options.CLOUD_HEIGHT.tooltip.1=Výška mraků +of.options.CLOUD_HEIGHT.tooltip.2= NE - výchozí výška +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - nad limitem stavění + +of.options.TREES=Stromy +of.options.TREES.tooltip.1=Stromy +of.options.TREES.tooltip.2= Výchozí - z nastavení grafiky +of.options.TREES.tooltip.3= Rychlá - nejnižší kvalita, nejrychlejší +of.options.TREES.tooltip.4= Chytrá - vyšší kvalita, rychlé +of.options.TREES.tooltip.5= Pěkná - nejvyšší kvalita, nejpomalejší +of.options.TREES.tooltip.6=Rychlé stromy nemají průhledné listí. +of.options.TREES.tooltip.7=Pěkné a Chytré stromy mají průhledné listí. + +of.options.RAIN=Sníh a déšť +of.options.RAIN.tooltip.1=Sníh a déšť +of.options.RAIN.tooltip.2= Výchozí - z nastavení grafiky +of.options.RAIN.tooltip.3= Rychlá - lehký sníh/déšť, rychlejší +of.options.RAIN.tooltip.4= Pěkná - velký sníh/déšť, pomalejší +of.options.RAIN.tooltip.5= NE - žádný sníh/déšť, nejrychlejší +of.options.RAIN.tooltip.6=Pokud je déšť vypnutý, jeho zvuky a částice dopadu +of.options.RAIN.tooltip.7=se stále objevují. + +of.options.SKY=Obloha +of.options.SKY.tooltip.1=Obloha +of.options.SKY.tooltip.2= ANO - obloha je viditelná, pomalejší +of.options.SKY.tooltip.3= NE - obloha nejde vidět, rychlejší +of.options.SKY.tooltip.4=Pokud je obloha vypnutá, měsíc a slunce půjdou stále vidět. + +of.options.STARS=Hvězdy +of.options.STARS.tooltip.1=Hvězdy +of.options.STARS.tooltip.2= ANO - hvězdy jsou viditelné, pomalejší +of.options.STARS.tooltip.3= NE - hvězdy nejdou vidět, rychlejší + +of.options.SUN_MOON=Slunce a měsíc +of.options.SUN_MOON.tooltip.1=Slunce a měsíc +of.options.SUN_MOON.tooltip.2= ANO - slunce a měsíc lze vidět (výchozí) +of.options.SUN_MOON.tooltip.3= NE - slunce a měsíc nelze vidět, rychlejší + +of.options.SHOW_CAPES=Zobrazovat kápě +of.options.SHOW_CAPES.tooltip.1=Zobrazovat kápě +of.options.SHOW_CAPES.tooltip.2= ANO - zobrazovat kápě hráčů (výchozí) +of.options.SHOW_CAPES.tooltip.3= NE - nezobrazovat kápě hráčů + +of.options.TRANSLUCENT_BLOCKS=Průsvitné bloky +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Průsvitné bloky +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Výchozí - určuje nastavení grafiky +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Pěkná - správné míchání barev (výchozí) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Rychlá - rychlé míchání barev (rychlejší) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Ovládá míchání barev průhledných bloků +of.options.TRANSLUCENT_BLOCKS.tooltip.6=s rozdílnou barvou (barevné sklo, voda, led) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=když jsou položeny za sebou s mezerou mezi nimi. + +of.options.HELD_ITEM_TOOLTIPS=Popisek k drženému itemu +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Popisek k drženému itemu +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ANO - zobrazovat popisky (výchozí) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= NE - nezobrazovat popisky + +of.options.ADVANCED_TOOLTIPS=Pokročilé popisky +of.options.ADVANCED_TOOLTIPS.tooltip.1=Pokročilé popisky +of.options.ADVANCED_TOOLTIPS.tooltip.2= ANO - zobrazit pokročilé popisky +of.options.ADVANCED_TOOLTIPS.tooltip.3= NE - nezobrazovat pokročilé popisky (výchozí) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Pokročilé popisky zobrazí pokročilé informace pro +of.options.ADVANCED_TOOLTIPS.tooltip.5=itemy (id, durabilita) a pro možnosti stínů +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, zdroj, výchozí hodnota). + +of.options.DROPPED_ITEMS=Vyhozené itemy +of.options.DROPPED_ITEMS.tooltip.1=Vyhozené itemy +of.options.DROPPED_ITEMS.tooltip.2= Výchozí - podle nastavení grafiky +of.options.DROPPED_ITEMS.tooltip.3= Rychlá - vyhozené itemy ve 2D (rychlejší) +of.options.DROPPED_ITEMS.tooltip.4= Pěkná - vyhozené itemy ve 3D (pomalejší) + +options.entityShadows.tooltip.1=Stíny entit +options.entityShadows.tooltip.2= ANO - zobrazovat stíny entit +options.entityShadows.tooltip.3= NE - nezobrazovat stíny entit + +of.options.VIGNETTE=Ztmavení +of.options.VIGNETTE.tooltip.1=Vizuální efekt, který trochu ztmaví okraje obrazovky. +of.options.VIGNETTE.tooltip.2= Výchozí - záleží na nastavení grafiky (výchozí) +of.options.VIGNETTE.tooltip.3= Rychlá - ztmavení vypnuto (rychlejší) +of.options.VIGNETTE.tooltip.4= Pěkná - ztmavení zapnuto (pomalejší) +of.options.VIGNETTE.tooltip.5=Ztmavení může mít veliký vliv na FPS, +of.options.VIGNETTE.tooltip.6=speciálně při hraní ve fullscreenu. +of.options.VIGNETTE.tooltip.7=Efekt ztmavení je velmi jemný a dá se bezpečně +of.options.VIGNETTE.tooltip.8=vypnout. + +of.options.DYNAMIC_FOV=Dynamické FOV +of.options.DYNAMIC_FOV.tooltip.1=Dynamické FOV +of.options.DYNAMIC_FOV.tooltip.2= ANO - zapne dynamické FOV (výchozí) +of.options.DYNAMIC_FOV.tooltip.3= NE - vypne dynamické FOV +of.options.DYNAMIC_FOV.tooltip.4=Mění pole pohledu (FOV) při létání, sprintování +of.options.DYNAMIC_FOV.tooltip.5=nebo při natahování luku. + +of.options.DYNAMIC_LIGHTS=Dynamické světla +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamické světla +of.options.DYNAMIC_LIGHTS.tooltip.2= NE - žádná dynamícká světla (výchozí) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rychlá - rychlá dynamická světla (aktualizace každých 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Pěkná - pěkná dynamická světla (aktualizováno vždy) +of.options.DYNAMIC_LIGHTS.tooltip.5=Pokud je ANO a v ruce, na zemi nebo v ruce +of.options.DYNAMIC_LIGHTS.tooltip.6=jiného hráče je držen svítící item (louč, světlit, atd.) +of.options.DYNAMIC_LIGHTS.tooltip.7=tak se osvětlí vše kolem. + +options.biomeBlendRadius.tooltip.1=Vyhlazuje přechody barev mezi biomy +options.biomeBlendRadius.tooltip.2= NE - žádné vyhlazení (nejrychlejší) +options.biomeBlendRadius.tooltip.3= 5x5 - normální vyhlazení (výchozí) +options.biomeBlendRadius.tooltip.4= 15x15 - maximální vyhlazení (nejpomalejší) +options.biomeBlendRadius.tooltip.5=Větší hodnoty mohou často generovat záseky +options.biomeBlendRadius.tooltip.6=a taky zpomalit generování světa. + +# Výkon + +of.options.SMOOTH_FPS=Vyhlazené FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizuje FPS čištěním vyrovnávací paměti grafického ovladače. +of.options.SMOOTH_FPS.tooltip.2= NE - žádná stabilizace, FPS mohou kolísat +of.options.SMOOTH_FPS.tooltip.3= ANO - stabilizace FPS +of.options.SMOOTH_FPS.tooltip.4=Tato možnost záleží na grafickém adaptéru a jeho efekt +of.options.SMOOTH_FPS.tooltip.5=není vždy vidět. + +of.options.SMOOTH_WORLD=Vyhlazený svět +of.options.SMOOTH_WORLD.tooltip.1=Odstraní lagy způsobené interním serverem. +of.options.SMOOTH_WORLD.tooltip.2= NE - žádná stabilizace, FPS mohou kolísat +of.options.SMOOTH_WORLD.tooltip.3= ANO - stabilizace FPS +of.options.SMOOTH_WORLD.tooltip.4=Stabilizuje FPS rozdělením načítání světa. +of.options.SMOOTH_WORLD.tooltip.5=Funguje jen na lokálních světech (hra pro jednoho hráče). + +of.options.FAST_RENDER=Rychlý render +of.options.FAST_RENDER.tooltip.1=Rychlý render +of.options.FAST_RENDER.tooltip.2= NE - standardní render +of.options.FAST_RENDER.tooltip.3= ANO - vyvážený render (rychlejší) +of.options.FAST_RENDER.tooltip.4=Používáním vyváženěho renderovacího algoritmu se může snížít +of.options.FAST_RENDER.tooltip.5=využití GPU, což může zvýšit FPS. +of.options.FAST_RENDER.tooltip.6=Toto nastavení může vytvořit konflikt s některými módy. + +of.options.FAST_MATH=Rychlá matematika +of.options.FAST_MATH.tooltip.1=Rychlá matematika +of.options.FAST_MATH.tooltip.2= NE - standardní matematika +of.options.FAST_MATH.tooltip.3= ANO - rychlá matematika +of.options.FAST_MATH.tooltip.4=Používá vyvážené sin() a cos() funkce, což může +of.options.FAST_MATH.tooltip.5=lépe uspořádat grafickou mezipaměť a zvýšit FPS. +of.options.FAST_MATH.tooltip.6=Toto nastavení může minimálně ovlivnit generování světa. + +of.options.CHUNK_UPDATES=Načítání chunků +of.options.CHUNK_UPDATES.tooltip.1=Načítání chunků +of.options.CHUNK_UPDATES.tooltip.2= 1 - pomalejší načítání světa, vyšší FPS (výchozí) +of.options.CHUNK_UPDATES.tooltip.3= 3 - rychlejší načítání světa, nižší FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - nejrychlejší načítání světa, nejnižší FPS +of.options.CHUNK_UPDATES.tooltip.5=Číslo chunků načtených za 1 FPS, +of.options.CHUNK_UPDATES.tooltip.6=Vyšší hodnoty mohou FPS snížit. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamické načítání +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamické načítání chunků +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= NE - standardní počet chunků na FPS (výchozí) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ANO - více chunků, když se hráč nehýbe +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamické načítání načte více chunků +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=když se hráč nehýbe, svět se načte rychleji. + +of.options.LAZY_CHUNK_LOADING=Líné načítání chunků +of.options.LAZY_CHUNK_LOADING.tooltip.1=Pomalé načítání chunků +of.options.LAZY_CHUNK_LOADING.tooltip.2= NE - výchozí načítání serverových chunků +of.options.LAZY_CHUNK_LOADING.tooltip.3= ANO - pomalé načítání serverových chunků (plynulejší) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Udělá plynulejší načítání chunků na integrovaném serveru +of.options.LAZY_CHUNK_LOADING.tooltip.5=jejich rozdělováním na několik tiků. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Vypni to, pokud se některé části světa nenačtou správně. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efektivní pouze pro lokální světy (single-player). + +of.options.RENDER_REGIONS=Render regiony +of.options.RENDER_REGIONS.tooltip.1=Render regiony +of.options.RENDER_REGIONS.tooltip.2= NE - nepoužívat render regiony (výchozí) +of.options.RENDER_REGIONS.tooltip.3= ANO - použít render regiony +of.options.RENDER_REGIONS.tooltip.4=Render regiony umožní rychlejší render terénu při vyšších +of.options.RENDER_REGIONS.tooltip.5=viditelných vzdálenostech. Efektivnějsí při zapnutém VBO. +of.options.RENDER_REGIONS.tooltip.6=Není doporučeno pro integrované grafické karty. + +of.options.SMART_ANIMATIONS=Chytré animace +of.options.SMART_ANIMATIONS.tooltip.1=Chytré animace +of.options.SMART_ANIMATIONS.tooltip.2= NE - nepoužívat chytré animace (výchozí) +of.options.SMART_ANIMATIONS.tooltip.3= ANO - používat chytré animace +of.options.SMART_ANIMATIONS.tooltip.4=Se zapnutými chytrými animacemi bude hra +of.options.SMART_ANIMATIONS.tooltip.5=animovat jen textury viditelné na obrazovce. +of.options.SMART_ANIMATIONS.tooltip.6=To sníží záseky a zvýší FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Velmi užitečné pro velké mod packy a HD balíčky zdrojů. + +# Animace + +of.options.animation.allOn=Vše ANO +of.options.animation.allOff=Vše NE +of.options.animation.dynamic=Dynamické + +of.options.ANIMATED_WATER=Animovaná voda +of.options.ANIMATED_LAVA=Animovaná láva +of.options.ANIMATED_FIRE=Animovaný oheň +of.options.ANIMATED_PORTAL=Animovaný portál +of.options.ANIMATED_REDSTONE=Animovaný redstone +of.options.ANIMATED_EXPLOSION=Animované exploze +of.options.ANIMATED_FLAME=Animovaný požár +of.options.ANIMATED_SMOKE=Animovaný kouř +of.options.VOID_PARTICLES=Částice voidu +of.options.WATER_PARTICLES=Částice vody +of.options.RAIN_SPLASH=Částice deště +of.options.PORTAL_PARTICLES=Částice portálu +of.options.POTION_PARTICLES=Částice lektvarů +of.options.DRIPPING_WATER_LAVA=Tekoucí voda/láva +of.options.ANIMATED_TERRAIN=Animovaný terén +of.options.ANIMATED_TEXTURES=Animované textury +of.options.FIREWORK_PARTICLES=Částice rachejtle + +# Ostatní + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Zobrazí lagometer na ladící obrazovce (F3). +of.options.LAGOMETER.tooltip.2=* Oranžová - Nasbíraný odpad v RAM (garbage collector) +of.options.LAGOMETER.tooltip.3=* Světle Modrá - Tik +of.options.LAGOMETER.tooltip.4=* Modrá - Plánované soubory +of.options.LAGOMETER.tooltip.5=* Fialová - Načítání chunků +of.options.LAGOMETER.tooltip.6=* Červená - Přednačtené chunky +of.options.LAGOMETER.tooltip.7=* Žlutá - Kontrola viditelnosti +of.options.LAGOMETER.tooltip.8=* Zelená - Načítání terénu + +of.options.PROFILER=Ladící profil +of.options.PROFILER.tooltip.1=Ladící profil +of.options.PROFILER.tooltip.2= ANO - ladící profil je aktivní, pomalejší +of.options.PROFILER.tooltip.3= NE - ladící profil je neaktivní, rychlejší +of.options.PROFILER.tooltip.4=Ladící profil sbírá a zobrazuje informace když +of.options.PROFILER.tooltip.5=je otevřena ladící obrazovka (F3). + +of.options.WEATHER=Počasí +of.options.WEATHER.tooltip.1=Počasí +of.options.WEATHER.tooltip.2= ANO - počasí je aktivní, pomalejší +of.options.WEATHER.tooltip.3= NE - počasí je neaktivní, rychlejší +of.options.WEATHER.tooltip.4=Počasí ovládá deště, sněžení a bouřky. +of.options.WEATHER.tooltip.5=Ovládání počasí je možné pouze pro lokální světy. + +of.options.time.dayOnly=Pouze den +of.options.time.nightOnly=Pouze noc + +of.options.TIME=Čas +of.options.TIME.tooltip.1=Čas +of.options.TIME.tooltip.2= Výchozí - normální denní/noční cyklus +of.options.TIME.tooltip.3= Pouze den - pouze den +of.options.TIME.tooltip.4= Pouze noc - pouze noc +of.options.TIME.tooltip.5=Nastavení času je efektivní jen v KREATIVNíM módu +of.options.TIME.tooltip.6=a pro lokální světy. + +options.fullscreen.tooltip.1=Fullscreen +options.fullscreen.tooltip.2= ANO - použít celoobrázkový mód +options.fullscreen.tooltip.3= NE - použít mód v okně +options.fullscreen.tooltip.4=Fullscreen mód může být rychlejší nebo pomalejší než +options.fullscreen.tooltip.5=mód v okně, záleží na GPU. + +of.options.fullscreen.resolution=Rozlišení fullscreenu +of.options.fullscreen.resolution.tooltip.1=Rozlišení režimu celé obrazovky +of.options.fullscreen.resolution.tooltip.2= Výchozí - používá hlavní rozlišení, pomalejší +of.options.fullscreen.resolution.tooltip.3= ŠxV - používá vlastní rozlišení, může být rychlejší +of.options.fullscreen.resolution.tooltip.4=Vybrané rozlišení je používáno ve fullscreenu (F11). +of.options.fullscreen.resolution.tooltip.5=Nižší rozlišení by měli být většinou rychlejší. + +of.options.SHOW_FPS=Zobrazit FPS +of.options.SHOW_FPS.tooltip.1=Kompaktně zobrazí informace o FPS a renderu. +of.options.SHOW_FPS.tooltip.2= FPS - průměr/minimum +of.options.SHOW_FPS.tooltip.3= C: - načítání chunků +of.options.SHOW_FPS.tooltip.4= E: - načtené entity + blokové entity +of.options.SHOW_FPS.tooltip.5= U: - přednačtené chunky +of.options.SHOW_FPS.tooltip.6=Informace o FPS se zobrazí jen, +of.options.SHOW_FPS.tooltip.7=když je ladící obrazovka (F3) zneviditelněná. + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3min +of.options.save.6min=6min +of.options.save.12min=12min +of.options.save.24min=24min + +of.options.AUTOSAVE_TICKS=Auto-ukládání +of.options.AUTOSAVE_TICKS.tooltip.1=Interval autosavu +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - výchozí +of.options.AUTOSAVE_TICKS.tooltip.3=Autosave může způsobovat trhnání záležijící na dohledu. +of.options.AUTOSAVE_TICKS.tooltip.4=Svět se rovněž ukládá, když je menu pauzy otevřené. + +of.options.SCREENSHOT_SIZE=Velikost screenshotu +of.options.SCREENSHOT_SIZE.tooltip.1=Velikost snímku obrazovky +of.options.SCREENSHOT_SIZE.tooltip.2= Výchozí - výchozí velikost screenshotu +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - vlastní velikost screenshotu +of.options.SCREENSHOT_SIZE.tooltip.4=Focení větších screenshotů může vyžadovat více RAM. +of.options.SCREENSHOT_SIZE.tooltip.5=Není kompatinilní s rychlým renderem a antialiasingem. +of.options.SCREENSHOT_SIZE.tooltip.6=Vyžaduje podporu GPU framebufferu. + +of.options.SHOW_GL_ERRORS=Zobrazit GL chyby +of.options.SHOW_GL_ERRORS.tooltip.1=Zobrazit OpenGL chyby +of.options.SHOW_GL_ERRORS.tooltip.2=Pokud nastaveno na ANO, OpenGL chyby se +of.options.SHOW_GL_ERRORS.tooltip.3=budou objevovat v chatu. Vypni jen když je +of.options.SHOW_GL_ERRORS.tooltip.4=chyba známa a víš, že se nedá opravit. +of.options.SHOW_GL_ERRORS.tooltip.5=Pokud NE, chyby jsou stále logovány v +of.options.SHOW_GL_ERRORS.tooltip.6=error logu a mohou způsobit značný drop v FPS. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Pozadí chatu +of.options.CHAT_BACKGROUND.tooltip.1=Pozadí chatu +of.options.CHAT_BACKGROUND.tooltip.2= Výchozí - stejná délka +of.options.CHAT_BACKGROUND.tooltip.3= Kompaktni - shoduje se z délkou textu +of.options.CHAT_BACKGROUND.tooltip.4= NE - bez pozadí + +of.options.CHAT_SHADOW=Stín v chatu +of.options.CHAT_SHADOW.tooltip.1=Stín písma v chatu +of.options.CHAT_SHADOW.tooltip.2= ANO - použít stín písma +of.options.CHAT_SHADOW.tooltip.3= NE - žádný stín písma diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/de_DE.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/de_DE.lang new file mode 100644 index 0000000..88e2430 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/de_DE.lang @@ -0,0 +1,778 @@ +# Contributors of German localization # +# ThexXTURBOXx (Collaborator of Reforged) 2016-2-29 ---- 2016-3-3 +# RoiEXLab 2016-3-8 +# violine1101 (German Minecraft Wiki admin) 2016-4-4 ---- 2017-6-7 +# TheHADILP 2016-5-20 ---- 2019-02-18 +# Nerdyyy 2018-1-6 +# OfficialCRUGG / CRUGG 2019-03-17 + +# General +of.general.ambiguous=Unklar +of.general.compact=Kompakt +of.general.custom=Benutzerdefiniert +of.general.from=Von +of.general.id=ID +of.general.max=Maximum +of.general.restart=Neustart +of.general.smart=Intelligent + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing ist nicht mit Shadern kompatibel. +of.message.aa.shaders2=Bitte deaktiviere Shader, um diese Einstellung zu aktivieren. + +of.message.af.shaders1=Anisotropische Filterung ist nicht mit Shadern kompatibel. +of.message.af.shaders2=Bitte deaktiviere Shader, um diese Einstellung zu aktivieren. + +of.message.fr.shaders1=Schnelles Rendern ist nicht mit Shadern kompatibel. +of.message.fr.shaders2=Bitte deaktiviere Shader, um diese Einstellung zu aktivieren. + +of.message.an.shaders1=3D-Effekt ist nicht mit Shadern kompatibel. +of.message.an.shaders2=Bitte deaktiviere Shader, um diese Einstellung zu aktivieren. + +of.message.shaders.aa1=Antialiasing ist nicht mit Shadern kompatibel. +of.message.shaders.aa2=Bitte deaktiviere Qualität -> Antialiasing und starte das Spiel neu. + +of.message.shaders.af1=Anisotropische Filterung ist nicht mit Shadern kompatibel. +of.message.shaders.af2=Bitte deaktiviere Qualität -> Anisotropische Filterung. + +of.message.shaders.fr1=Schnelles Rendern ist nicht mit Shadern kompatibel. +of.message.shaders.fr2=Bitte deaktiviere Leistung -> Schnelles Rendern. + +of.message.shaders.an1=Shader sind nicht mit dem 3D-Effekt kompatibel. +of.message.shaders.an2=Bitte deaktiviere Sonstiges -> 3D-Effekt. + +of.message.shaders.nv1=Dieses Shader-Paket erfordert eine neuere OptiFine Version: %s +of.message.shaders.nv2=Willst du wirklich fortfahren? + +of.message.newVersion=Eine neue Version von §eOptiFine§f ist verfügbar: §e%s§f +of.message.java64Bit=Du kannst die §e64-bit-Version von Java§f installieren, um die Leistung zu verbessern +of.message.openglError=§eOpenGL-Fehler§f: %s (%s) + +of.message.shaders.loading=Lade Shader: %s + +of.message.other.reset=Alle Grafikeinstellungen auf die Standardwerte zurücksetzen? + +of.message.loadingVisibleChunks=Lade sichtbare Chunks + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine Umhang... + +of.options.capeOF.title=OptiFine Umhang +of.options.capeOF.openEditor=Umhang-Editor öffnen +of.options.capeOF.reloadCape=Umhang neu laden + +of.message.capeOF.openEditor=Der OptiFine Umhang-Editor sollte sich in einem Web-Browser öffnen. +of.message.capeOF.reloadCape=Der Umhang wird in 15 Sekunden neu geladen. + +of.message.capeOF.error1=Mojang Authentifizierung fehlgeschlagen. +of.message.capeOF.error2=Fehler: %s + +# Video settings + +options.graphics.tooltip.1=Grafikmodus +options.graphics.tooltip.2= Schnell - Niedrigere Qualität (schneller) +options.graphics.tooltip.3= Schön - Höhere Qualität (langsamer) +options.graphics.tooltip.4=Verändert das Aussehen von Wolken, Blättern, Wasser, +options.graphics.tooltip.5=Schatten und Grasblöcken. + +of.options.renderDistance.tiny=Winzig +of.options.renderDistance.short=Klein +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Weit +of.options.renderDistance.extreme=Extrem +of.options.renderDistance.insane=Wahnsinnig +of.options.renderDistance.ludicrous=Absurd + +options.renderDistance.tooltip.1=Sichtweite +options.renderDistance.tooltip.2= 2 Winzig - 32m (am schnellsten) +options.renderDistance.tooltip.3= 8 Normal - 128m +options.renderDistance.tooltip.4= 16 Weit - 256m (langsam) +options.renderDistance.tooltip.5= 32 Extrem - 512m (am langsamsten!) ressourcenlastig +options.renderDistance.tooltip.6= 48 Wahnsinnig - 768m, braucht 2GB RAM zugeteilt +options.renderDistance.tooltip.7= 64 Absurd - 1024m, braucht 3GB RAM zugeteilt +options.renderDistance.tooltip.8=Werte über 16 funktionieren nur im Einzelspielermodus. + +options.ao.tooltip.1=Weiche Beleuchtung +options.ao.tooltip.2= Aus - Normale Beleuchtung (schnell) +options.ao.tooltip.3= Minimum - Einfache weiche Beleuchtung (langsam) +options.ao.tooltip.4= Maximum - Komplexe weiche Beleuchtung (am langsamsten) + +options.framerateLimit.tooltip.1=Maximale Bildrate +options.framerateLimit.tooltip.2= V-Sync - Auf Monitor-Bildrate begrenzen (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - Auf eingestellte Bildrate begrenzen +options.framerateLimit.tooltip.4= Unendlich - Keine Begrenzung (am schnellsten) +options.framerateLimit.tooltip.5=Die Bildrate grenzt die FPS ein, sogar wenn +options.framerateLimit.tooltip.6=die Begrenzung nicht erreicht ist. +of.options.framerateLimit.vsync=V-Sync + +of.options.AO_LEVEL=Schattenhelligkeit +of.options.AO_LEVEL.tooltip.1=Schattenhelligkeit +of.options.AO_LEVEL.tooltip.2= Aus - Keine Schatten +of.options.AO_LEVEL.tooltip.3= 50%% - Helle Schatten +of.options.AO_LEVEL.tooltip.4= 100%% - Dunkle Schatten + +options.viewBobbing.tooltip.1=Gehbewegung +options.viewBobbing.tooltip.2=Wenn Mipmaps verwendet werden, deaktiviere diese +options.viewBobbing.tooltip.3=Einstellung für bessere Leitung. + +options.guiScale.tooltip.1=GUI-Größe +options.guiScale.tooltip.2= Auto - Maximale Größe +options.guiScale.tooltip.3= Klein, Normal, Groß - 1x-3x +options.guiScale.tooltip.4= 4x-10x - Verfügbar auf 4K-Monitoren +options.guiScale.tooltip.5=Ungerade Werte (1x, 3x, 5x ...) sind nicht mit +options.guiScale.tooltip.6=Unicode-Schrift kompatibel. +options.guiScale.tooltip.7=Ein kleineres GUI ist eventuell schneller. + +options.vbo=VBOs verwenden +options.vbo.tooltip.1=Vertexbufferobjekte +options.vbo.tooltip.2=Benutzt ein alternatives Rendermodell, das normalerweise +options.vbo.tooltip.3=schneller (5-10%%) als das Standard-Rendermodell ist. + +options.gamma.tooltip.1=Ändert die Helligkeit dunkler Objekte +options.gamma.tooltip.2= Düster - Standardhelligkeit +options.gamma.tooltip.3= 1-99%% - veränderlich +options.gamma.tooltip.4= Hell - Maximale Helligkeit für dunkle Objekte +options.gamma.tooltip.5=Diese Einstellungen ändert nicht die Helligkeit von komplett +options.gamma.tooltip.6=schwarzen Objekten. + +options.anaglyph.tooltip.1=3D-Effekt +options.anaglyph.tooltip.2=Aktiviert einen stereoskopischen 3D-Effekt durch +options.anaglyph.tooltip.3=Verwendung unterschiedlicher Farben für jedes Auge. +options.anaglyph.tooltip.4=Kann nur mit einer 3D-Brille benutzt werden. + +of.options.ALTERNATE_BLOCKS=Blockvarianten +of.options.ALTERNATE_BLOCKS.tooltip.1=Blockvarianten +of.options.ALTERNATE_BLOCKS.tooltip.2=Benutzt alternative Blockmodelle für einige Blöcke. +of.options.ALTERNATE_BLOCKS.tooltip.3=Abhängig vom ausgewählten Ressourcenpaket. + +of.options.FOG_FANCY=Nebel +of.options.FOG_FANCY.tooltip.1=Nebel +of.options.FOG_FANCY.tooltip.2= Schnell - Schneller Nebel +of.options.FOG_FANCY.tooltip.3= Schön - Langsamer Nebel, sieht besser aus +of.options.FOG_FANCY.tooltip.4= Aus - Kein Nebel, am schnellsten +of.options.FOG_FANCY.tooltip.5=Der schöne Nebel ist nur verfügbar, wenn er von der +of.options.FOG_FANCY.tooltip.6=Grafikkarte unterstützt wird. + +of.options.FOG_START=Nebelstart +of.options.FOG_START.tooltip.1=Nebelstart +of.options.FOG_START.tooltip.2= 0.2 - Der Nebel startet nahe beim Spieler +of.options.FOG_START.tooltip.3= 0.8 - Der Nebel startet weit weg vom Spieler +of.options.FOG_START.tooltip.4=Diese Einstellung beeinflusst normalerweise nicht die +of.options.FOG_START.tooltip.5=Leistung. + +of.options.CHUNK_LOADING=Chunkladen +of.options.CHUNK_LOADING.tooltip.1=Chunkladen +of.options.CHUNK_LOADING.tooltip.2= Standard - Instabile FPS, wenn Chunks geladen werden +of.options.CHUNK_LOADING.tooltip.3= Weich - Stabile FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - Stabile FPS, 3x schnelleres Weltladen +of.options.CHUNK_LOADING.tooltip.5=Weich und Multi-Core entfernen Ruckler und +of.options.CHUNK_LOADING.tooltip.6=Standbilder, welche durch Chunkladen verursacht werden. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core kann das Weltladen 3x schneller machen und +of.options.CHUNK_LOADING.tooltip.8=die FPS erhöhen, indem es einen zweiten CPU-Kern benutzt. +of.options.chunkLoading.smooth=Weich +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shader... +of.options.shadersTitle=Shader + +of.options.shaders.packNone=Aus +of.options.shaders.packDefault=(Interner Shader) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= Aus - (Standard) kein Antialiasing (schneller) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - Geglättete Linien und Ränder (langsamer) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA ist ein Nachbearbeitungs-Effekt, der zackige +of.options.shaders.ANTIALIASING.tooltip.5=Linien und harte Farbübergänge glättet. +of.options.shaders.ANTIALIASING.tooltip.6=Dies ist schneller als herkömmliches Antialiasing +of.options.shaders.ANTIALIASING.tooltip.7=und kompatibel mit Shadern und schnellem Rendern. + +of.options.shaders.NORMAL_MAP=Normalkarten +of.options.shaders.NORMAL_MAP.tooltip.1=Normalkarten +of.options.shaders.NORMAL_MAP.tooltip.2= An - (Standard) Normalkarten aktiviert +of.options.shaders.NORMAL_MAP.tooltip.3= Aus - Normalkarten deaktiviert +of.options.shaders.NORMAL_MAP.tooltip.4=Normalkarten können von Shader-Paketen verwendet +of.options.shaders.NORMAL_MAP.tooltip.5=werden, um 3D-Geometrie auf flachen Oberflächen zu +of.options.shaders.NORMAL_MAP.tooltip.6=simulieren. +of.options.shaders.NORMAL_MAP.tooltip.7=Die Normalkarten werden vom aktivierten +of.options.shaders.NORMAL_MAP.tooltip.8=Ressourcenpaket zur Verfügung gestellt. + +of.options.shaders.SPECULAR_MAP=Reflexionskarten +of.options.shaders.SPECULAR_MAP.tooltip.1=Reflexionskarten +of.options.shaders.SPECULAR_MAP.tooltip.2= An - (Standard) Reflexionskarten aktiviert +of.options.shaders.SPECULAR_MAP.tooltip.3= Aus - Reflexionskarten deaktiviert +of.options.shaders.SPECULAR_MAP.tooltip.4=Reflexionskarten können von Shader-Paketen verwendet +of.options.shaders.SPECULAR_MAP.tooltip.5=werden, um spezielle Reflexionseffekte zu erzeugen. +of.options.shaders.SPECULAR_MAP.tooltip.6=Die Reflexionskarten werden vom aktivierten +of.options.shaders.SPECULAR_MAP.tooltip.7=Ressourcenpaket zur Verfügung gestellt. + +of.options.shaders.RENDER_RES_MUL=Renderqualität +of.options.shaders.RENDER_RES_MUL.tooltip.1=Renderqualität +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - Niedrig (am schnellsten) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - Standard +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - Hoch (am langsamsten) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Die Renderqualität regelt die Auflösung der Textur, +of.options.shaders.RENDER_RES_MUL.tooltip.6=auf welcher die Shader gerendert werden. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Niedrigere Werte können bei 4K-Monitoren nützlich sein. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Höhere Werte arbeiten wie ein Antialiasing-Filter. + +of.options.shaders.SHADOW_RES_MUL=Schattenqualität +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Schattenqualität +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - Niedrig (am schnellsten) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - Standard +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - Hoch (am langsamsten) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Die Schattenqualität regelt die Auflösung der Schatten- +of.options.shaders.SHADOW_RES_MUL.tooltip.6=Karten Textur des benutzten Shader-Pakets. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Niedrigere Werte = Ungenaue, grobe Schatten. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Höhere Werte = Detaillierte, feine Schatten. + +of.options.shaders.HAND_DEPTH_MUL=Handtiefe +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Handtiefe +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - Hand in Kamera-Nähe +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (Standard) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - Hand weiter von der Kamera entfernt +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Die Handtiefe steuert, wie weit Gegenstände von +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=der Kamera entfernt sind. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Für Shader-Pakete mit Tiefenunschärfe regelt dies +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=die Unschärfe der tragbaren Gegenstände. + +of.options.shaders.CLOUD_SHADOW=Wolkenschatten + +of.options.shaders.OLD_HAND_LIGHT=Alte Handbel. +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Alte Handbeleuchtung +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Standard - gesteuert vom Shader-Paket +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= An - Alte Handbeleuchtung aktiviert +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Aus - Alte Handbeleuchtung deaktiviert +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Die alte Handbeleuchtung sorgt dafür, dass leuchtende +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=Gegenstände bei alten Shader-Paketen sowohl in der +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=Haupt-, als auch der Nebenhand erkannt werden. + +of.options.shaders.OLD_LIGHTING=Alte Bel. +of.options.shaders.OLD_LIGHTING.tooltip.1=Alte Beleuchtung +of.options.shaders.OLD_LIGHTING.tooltip.2= Standard - gesteuert vom Shader-Paket +of.options.shaders.OLD_LIGHTING.tooltip.3= An - Alte Beleuchtung aktiviert +of.options.shaders.OLD_LIGHTING.tooltip.4= Aus - Alte Beleuchtung deaktiviert +of.options.shaders.OLD_LIGHTING.tooltip.5=Die alte Beleuchtung steuert die starre "Vanilla" +of.options.shaders.OLD_LIGHTING.tooltip.6=Beleuchtung der Block-Seiten. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shader-Pakete mit Schatten variierend nach Sonnenstand +of.options.shaders.OLD_LIGHTING.tooltip.8=stellen meistens eine bessere Beleuchtung zur Verfügung. + +of.options.shaders.DOWNLOAD=Shader von Website herunterladen +of.options.shaders.DOWNLOAD.tooltip.1=Shader von Website herunterladen +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Öffnet die Shader-Paket Website im Browser. +of.options.shaders.DOWNLOAD.tooltip.4=Lege das heruntergeladene Shader-Paket in den +of.options.shaders.DOWNLOAD.tooltip.5=Shader-Ordner, damit es in der Liste der +of.options.shaders.DOWNLOAD.tooltip.6=installierten Shader erscheint. + +of.options.shaders.SHADER_PACK=Shader + +of.options.shaders.shadersFolder=Shader-Ordner +of.options.shaders.shaderOptions=Shadereinstellungen ... + +of.options.shaderOptionsTitle=Shader + +of.options.quality=Qualität ... +of.options.qualityTitle=Qualitätseinstellungen + +of.options.details=Details ... +of.options.detailsTitle=Detaileinstellungen + +of.options.performance=Leistung ... +of.options.performanceTitle=Leistungseinstellungen + +of.options.animations=Animationen ... +of.options.animationsTitle=Animationseinstellungen + +of.options.other=Sonstiges ... +of.options.otherTitle=Andere Einstellungen + +of.options.other.reset=Grafikeinstellungen zurücksetzen ... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Am nächsten +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Visueller Effekt, der weit entfernte Objekte besser aus- +options.mipmapLevels.tooltip.2=sehen lässt, indem Texturdetails geglättet werden. +options.mipmapLevels.tooltip.3= Aus - Keine Glättung von Details +options.mipmapLevels.tooltip.4= 1 - Minimale Glättung von Details +options.mipmapLevels.tooltip.5= Maximum - Maximale Glättung von Details +options.mipmapLevels.tooltip.6=Diese Einstellung beeinflusst normalerweise nicht die +options.mipmapLevels.tooltip.7=Leistung. + +of.options.MIPMAP_TYPE=Mipmap-Typ +of.options.MIPMAP_TYPE.tooltip.1=Visueller Effekt, der weit entfernte Objekte besser aus- +of.options.MIPMAP_TYPE.tooltip.2=sehen lässt, indem Texturdetails geglättet werden. +of.options.MIPMAP_TYPE.tooltip.3= Am nächsten - Grobe Glättung (am schnellsten) +of.options.MIPMAP_TYPE.tooltip.4= Linear - Normale Glättung +of.options.MIPMAP_TYPE.tooltip.5= Bilinear - Feine Glättung +of.options.MIPMAP_TYPE.tooltip.6= Trilinear - Feinste Glättung (am langsamsten) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= Aus - (Standard) Kein Antialiasing (schneller) +of.options.AA_LEVEL.tooltip.3= 2-16 - Antialiasierte Linien und Ecken (langsamer) +of.options.AA_LEVEL.tooltip.4=Das Antialiasing weicht gezackte Linien ab und schärft +of.options.AA_LEVEL.tooltip.5=Farbübergänge. Wenn aktiviert, kann es die Bildrate +of.options.AA_LEVEL.tooltip.6=erheblich beeinträchtigen. +of.options.AA_LEVEL.tooltip.7=Nicht alle Stufen werden von allen Grafikkarten unterstützt. +of.options.AA_LEVEL.tooltip.8=Änderung wird erst nach einem Neustart effektiv! + +of.options.AF_LEVEL=Anisotropische Filterung +of.options.AF_LEVEL.tooltip.1=Anisotropische Filterung +of.options.AF_LEVEL.tooltip.2= Aus - (Standard) Standard-Texturdetails (schneller) +of.options.AF_LEVEL.tooltip.3= 2-16 - Feinere Details in Texturen (langsamer) +of.options.AF_LEVEL.tooltip.4=Die anisotropische Filterung stellt Details in Texturen, +of.options.AF_LEVEL.tooltip.5=die durch Mipmap ihre Details verloren haben, wieder her. +of.options.AF_LEVEL.tooltip.6=Wenn aktiviert, kann es die FPS erheblich verringern. + +of.options.CLEAR_WATER=Klares Wasser +of.options.CLEAR_WATER.tooltip.1=Klares Wasser +of.options.CLEAR_WATER.tooltip.2= An - Klares, transparentes Wasser +of.options.CLEAR_WATER.tooltip.3= Aus - Normales Wasser + +of.options.RANDOM_ENTITIES=Entitätsvarianten +of.options.RANDOM_ENTITIES.tooltip.1=Entitätsvarianten +of.options.RANDOM_ENTITIES.tooltip.2= Aus - Keine Entitätsvarianten (schneller) +of.options.RANDOM_ENTITIES.tooltip.3= An - Entitätsvarianten (langsamer) +of.options.RANDOM_ENTITIES.tooltip.4=Die gleichen Entitäten können unterschiedliche Texturen +of.options.RANDOM_ENTITIES.tooltip.5=haben. Dies benötigt ein Ressourcenpaket mit entspre- +of.options.RANDOM_ENTITIES.tooltip.6=chenden Texturen. + +of.options.BETTER_GRASS=Besseres Gras +of.options.BETTER_GRASS.tooltip.1=Besseres Gras +of.options.BETTER_GRASS.tooltip.2= Aus - Standard-Grasseitentextur, am schnellsten +of.options.BETTER_GRASS.tooltip.3= Schnell - Volle Grasseitentextur, langsamer +of.options.BETTER_GRASS.tooltip.4= Schön - Dynamische Grasseitentextur, am langsamsten + +of.options.BETTER_SNOW=Besserer Schnee +of.options.BETTER_SNOW.tooltip.1=Besserer Schnee +of.options.BETTER_SNOW.tooltip.2= Aus - Normaler Schnee (schneller) +of.options.BETTER_SNOW.tooltip.3= An - Besserer Schnee (langsamer) +of.options.BETTER_SNOW.tooltip.4=Setzt Schnee unter transparente Blöcke (wie Zäune +of.options.BETTER_SNOW.tooltip.5=oder hohes Gras), wenn sie an Schneeblöcke grenzen. + +of.options.CUSTOM_FONTS=Schriftartressourcen +of.options.CUSTOM_FONTS.tooltip.1=Schriftartressourcen +of.options.CUSTOM_FONTS.tooltip.2= An - Ressourcenpaket-Schriftart (Standard, langsamer) +of.options.CUSTOM_FONTS.tooltip.3= Aus - Standardschriftart (schneller) +of.options.CUSTOM_FONTS.tooltip.4=Die Schriftart wird aus den aktivierten +of.options.CUSTOM_FONTS.tooltip.5=Ressourcenpaketen geladen. + +of.options.CUSTOM_COLORS=Farbressourcen +of.options.CUSTOM_COLORS.tooltip.1=Farbressourcen +of.options.CUSTOM_COLORS.tooltip.2= An - Ressourcenpaket-Farben (Standard, langsamer) +of.options.CUSTOM_COLORS.tooltip.3= Aus - Standardfarben (schneller) +of.options.CUSTOM_COLORS.tooltip.4=Die Farben werden aus den aktivierten +of.options.CUSTOM_COLORS.tooltip.5=Ressourcenpaketen geladen. + +of.options.SWAMP_COLORS=Sumpffarben +of.options.SWAMP_COLORS.tooltip.1=Sumpffarben +of.options.SWAMP_COLORS.tooltip.2= An - Färbt den Sumpf dunkler (Standard, langsamer) +of.options.SWAMP_COLORS.tooltip.3= Aus - Färbt den Sumpf in normalen Farben (schneller) +of.options.SWAMP_COLORS.tooltip.4=Die Sumpffarben betreffen Gras, Laub, Ranken und +of.options.SWAMP_COLORS.tooltip.5=Wasser. + +of.options.SMOOTH_BIOMES=Biomübergänge +of.options.SMOOTH_BIOMES.tooltip.1=Biomübergänge +of.options.SMOOTH_BIOMES.tooltip.2= An - Flüssige Biomübergänge (Standard, langsamer) +of.options.SMOOTH_BIOMES.tooltip.3= Aus - Keine flüssigen Biomübergänge (schneller) +of.options.SMOOTH_BIOMES.tooltip.4=Die Farbübergänge werden durch Probennahme und +of.options.SMOOTH_BIOMES.tooltip.5=Durchschnittsberechnung der Farben der umliegenden +of.options.SMOOTH_BIOMES.tooltip.6=Blöcke berechnet. Betroffen sind Gras, Laub, Ranken und +of.options.SMOOTH_BIOMES.tooltip.7=Wasser. + +of.options.CONNECTED_TEXTURES=Verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.1=Verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.2= Aus - Keine verbundenen Texturen (Standard) +of.options.CONNECTED_TEXTURES.tooltip.3= Schnell - Schnelle verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.4= Schöne - Schöne verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.5=Verbundene Texturen verbinden die Texturen von Glas, +of.options.CONNECTED_TEXTURES.tooltip.6=Sandstein und Bücherregalen, wenn sie nebeneinander +of.options.CONNECTED_TEXTURES.tooltip.7=platziert werden. Die verbundenen Texturen werden aus +of.options.CONNECTED_TEXTURES.tooltip.8=den aktivierten Ressourcenpaketen geladen. + +of.options.NATURAL_TEXTURES=Natürliche Texturen +of.options.NATURAL_TEXTURES.tooltip.1=Natürliche Texturen +of.options.NATURAL_TEXTURES.tooltip.2= Aus - Keine natürlichen Texturen (Standard) +of.options.NATURAL_TEXTURES.tooltip.3= An - Benutzt natürliche Texturen +of.options.NATURAL_TEXTURES.tooltip.4=Natürliche Texturen entfernen die rasterartige +of.options.NATURAL_TEXTURES.tooltip.5=Anordnung beim Platzieren gleicher Blöcke +of.options.NATURAL_TEXTURES.tooltip.6=durch Variationen der Standard-Blocktextur. +of.options.NATURAL_TEXTURES.tooltip.7=Die Einstellungen für die natürlichen Texturen +of.options.NATURAL_TEXTURES.tooltip.8=werden aus den aktivierten Ressourcenpaketen geladen. + +of.options.EMISSIVE_TEXTURES=Leuchtende Texturen +of.options.EMISSIVE_TEXTURES.tooltip.1=Leuchtende Texturen +of.options.EMISSIVE_TEXTURES.tooltip.2= Aus - Keine lichtemittierenden Texturen (Standard) +of.options.EMISSIVE_TEXTURES.tooltip.3= An - Lichtemittierende Texturen +of.options.EMISSIVE_TEXTURES.tooltip.4=Die lichtemittierenden Texturen werden als Overlays mit +of.options.EMISSIVE_TEXTURES.tooltip.5=voller Helligkeit gerendert. Dadurch können leuchtende +of.options.EMISSIVE_TEXTURES.tooltip.6=Bereiche der Grund-Textur simuliert werden. +of.options.EMISSIVE_TEXTURES.tooltip.7=Die lichtemittierenden Texturen werden aus den +of.options.EMISSIVE_TEXTURES.tooltip.8=aktivierten Ressourcenpaketen geladen. + +of.options.CUSTOM_SKY=Himmelstexturen +of.options.CUSTOM_SKY.tooltip.1=Himmelstexturen +of.options.CUSTOM_SKY.tooltip.2= An - Ressourcenpaket-Himmel (Standard, langsam) +of.options.CUSTOM_SKY.tooltip.3= Aus - Standardhimmel (schneller) +of.options.CUSTOM_SKY.tooltip.4=Die Himmelstexturen werden aus den aktivierten +of.options.CUSTOM_SKY.tooltip.5=Ressourcenpaketen geladen. + +of.options.CUSTOM_ITEMS=Gegenstandstexturen +of.options.CUSTOM_ITEMS.tooltip.1=Gegenstandstexturen +of.options.CUSTOM_ITEMS.tooltip.2= An - Ressourcenpaket-G.texturen (Standard, langsam) +of.options.CUSTOM_ITEMS.tooltip.3= Aus - Standard-Gegenstandstexturen (schneller) +of.options.CUSTOM_ITEMS.tooltip.4=Die Gegenstandstexturen werden aus den aktivierten +of.options.CUSTOM_ITEMS.tooltip.5=Ressourcenpaketen geladen. + +of.options.CUSTOM_ENTITY_MODELS=Wesens- & Objektmodelle +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Wesens- und Objektmodelle +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= An - Ressourcenpaketmodelle (Standard, langsam) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Aus - Standardmodelle (schneller) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Die Wesens- und Objektmodelle werden aus den +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=aktivierten Ressourcenpaketen geladen. + +of.options.CUSTOM_GUIS=Ressourcenpaket-GUI +of.options.CUSTOM_GUIS.tooltip.1=Ressourcenpaket-GUI +of.options.CUSTOM_GUIS.tooltip.2= An - Ressourcenpaket-GUI (Standard, langsam) +of.options.CUSTOM_GUIS.tooltip.3= Aus - Standard GUI (schneller) +of.options.CUSTOM_GUIS.tooltip.4=Das GUI wird aus den aktivierten Ressourcenpaketen +of.options.CUSTOM_GUIS.tooltip.5=geladen. + +# Details + +of.options.CLOUDS=Wolken +of.options.CLOUDS.tooltip.1=Wolken +of.options.CLOUDS.tooltip.2= Standard - Wie Grafikmodus +of.options.CLOUDS.tooltip.3= Schnell - Schlechtere Qualität (schneller) +of.options.CLOUDS.tooltip.4= Schön - Höhere Qualität (langsamer) +of.options.CLOUDS.tooltip.5= Aus - Keine Wolken (am schnellsten) +of.options.CLOUDS.tooltip.6=Schnelle Wolken werden zweidimensional dargestellt. +of.options.CLOUDS.tooltip.7=Schöne Wolken werden dreidimensional dargestellt. + +of.options.CLOUD_HEIGHT=Wolkenhöhe +of.options.CLOUD_HEIGHT.tooltip.1=Wolkenhöhe +of.options.CLOUD_HEIGHT.tooltip.2= Aus - Standardhöhe +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - Über der maximalen Welthöhe + +of.options.TREES=Bäume +of.options.TREES.tooltip.1=Bäume +of.options.TREES.tooltip.2= Standard - Wie Grafikmodus +of.options.TREES.tooltip.3= Schnell - Schlechtere Qualität (schneller) +of.options.TREES.tooltip.4= Fein - Hohe Qualität (schnell) +of.options.TREES.tooltip.5= Schön - Höchste Qualität (langsamer) +of.options.TREES.tooltip.6=Schnelle Bäume haben solide Blätter. +of.options.TREES.tooltip.7=Schöne Bäume haben teilweise transparente Blätter. + +of.options.RAIN=Regen & Schnee +of.options.RAIN.tooltip.1=Regen & Schnee +of.options.RAIN.tooltip.2= Standard - Wie Grafikmodus +of.options.RAIN.tooltip.3= Schnell - Leichter Regen/Schnee (schneller) +of.options.RAIN.tooltip.4= Schön - Starker Regen/Schnee (langsamer) +of.options.RAIN.tooltip.5= Aus - Kein Regen/Schnee (am schnellsten) +of.options.RAIN.tooltip.6=Wenn diese Einstellung deaktiviert ist, sind die Regen- +of.options.RAIN.tooltip.7=geräusche und -partikel dennoch zu hören und zu sehen. + +of.options.SKY=Himmel +of.options.SKY.tooltip.1=Himmel +of.options.SKY.tooltip.2= An - Himmel ist sichtbar (langsamer) +of.options.SKY.tooltip.3= Aus - Himmel ist nicht sichtbar (schneller) +of.options.SKY.tooltip.4=Wenn dies deaktiviert ist, sind Mond und Sonne dennoch +of.options.SKY.tooltip.5=sichtbar. + +of.options.STARS=Sterne +of.options.STARS.tooltip.1=Sterne +of.options.STARS.tooltip.2= An - Sterne sind sichtbar (langsamer) +of.options.STARS.tooltip.3= Aus - Sterne sind nicht sichtbar (schneller) + +of.options.SUN_MOON=Sonne & Mond +of.options.SUN_MOON.tooltip.1=Sonne & Mond +of.options.SUN_MOON.tooltip.2= An - Sonne und Mond sind sichtbar (Standard) +of.options.SUN_MOON.tooltip.3= Aus - Sonne und Mond sind nicht sichtbar (schneller) + +of.options.SHOW_CAPES=Umhänge +of.options.SHOW_CAPES.tooltip.1=Umhänge +of.options.SHOW_CAPES.tooltip.2= An - Umhänge werden dargestellt (Standard) +of.options.SHOW_CAPES.tooltip.3= Aus - Umhänge werden nicht dargestellt +of.options.SHOW_CAPES.tooltip.4=Diese Einstellung beeinflusst normalerweise nicht die +of.options.SHOW_CAPES.tooltip.5=Leistung. + +of.options.TRANSLUCENT_BLOCKS=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Standard - Wie Grafikmodus +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Schön - Korrekte Farbmischung (langsamer) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Schnell - Schnelle Farbmischung (schneller) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Kontrolliert die Farbmischung von transparenten Blöcken +of.options.TRANSLUCENT_BLOCKS.tooltip.6=mit verschiedenen Farben (Gefärbtes Glas, Wasser, Eis), +of.options.TRANSLUCENT_BLOCKS.tooltip.7=wenn sie hintereinander mit Luft dazwischen platziert +of.options.TRANSLUCENT_BLOCKS.tooltip.8=werden. + +of.options.HELD_ITEM_TOOLTIPS=Gegenstandsbeschr. +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Gegenstandsbeschreibung +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= An - Zeige Gegenstandsbeschreibung (Standard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Aus - Zeige keine Gegenstandsbeschreibung +of.options.HELD_ITEM_TOOLTIPS.tooltip.4=Wird über der Schnellzugriffsleiste angezeigt. + +of.options.ADVANCED_TOOLTIPS=Erweiterte Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.1=Erweiterte Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.2= An - Zeige erweiterte Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.3= Aus - Keine erweiterte Schnellinfo (Standard) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Zeigt ausführliche Informationen über Gegenstände +of.options.ADVANCED_TOOLTIPS.tooltip.5=(ID, Haltbarkeit) und Shader Einstellungen (ID, Quelle, +of.options.ADVANCED_TOOLTIPS.tooltip.6=Standardwert) an. + +of.options.DROPPED_ITEMS=Gegenstände +of.options.DROPPED_ITEMS.tooltip.1=Liegende Gegenstände +of.options.DROPPED_ITEMS.tooltip.2= Standard - Wie Grafikmodus +of.options.DROPPED_ITEMS.tooltip.3= Schnell - Zweidimensionale Animation (schneller) +of.options.DROPPED_ITEMS.tooltip.4= Schön - Dreidimensionale Animation (langsamer) + +options.entityShadows.tooltip.1=Objektschatten +options.entityShadows.tooltip.2= An - Zeige Objektschatten +options.entityShadows.tooltip.3= Aus - Zeige keine Objektschatten + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Visueller Effekt, der die Bildschirmecken abdunkelt +of.options.VIGNETTE.tooltip.2= Standard - Wie Grafikmodus (Standard) +of.options.VIGNETTE.tooltip.3= Schnell - Vignette deaktiviert (schneller) +of.options.VIGNETTE.tooltip.4= Schön - Vignette aktiviert (langsamer) +of.options.VIGNETTE.tooltip.5=Die Vignette kann sich extrem auf die Leistung auswirken, +of.options.VIGNETTE.tooltip.6=besonders im Vollbildschirmmodus. +of.options.VIGNETTE.tooltip.7=Der Vignetteneffekt ist fast unmerklich und kann sicher +of.options.VIGNETTE.tooltip.8=deaktiviert werden. + +of.options.DYNAMIC_FOV=Dynamisches Sichtfeld +of.options.DYNAMIC_FOV.tooltip.1=Dynamisches Sichtfeld +of.options.DYNAMIC_FOV.tooltip.2= An - Dynamisches Sichtfeld aktivieren (Standard) +of.options.DYNAMIC_FOV.tooltip.3= Aus - Dynamisches Sichtfeld ausschalten +of.options.DYNAMIC_FOV.tooltip.4=Ändert das Sichtfeld beim Fliegen, Sprinten, Spannen +of.options.DYNAMIC_FOV.tooltip.5=eines Bogens oder wenn man einen Schnelligkeits-Effekt hat. + +of.options.DYNAMIC_LIGHTS=Dyn. Beleuchtung +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamische Beleuchtung +of.options.DYNAMIC_LIGHTS.tooltip.2= Aus - Keine dynamische Beleuchtung (Standard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Schnell - Schnelle dyn. Beleuchtung (alle 500ms aktual.) +of.options.DYNAMIC_LIGHTS.tooltip.4= Schön - Schöne dyn. Beleuchtung (Echtzeitaktual.) +of.options.DYNAMIC_LIGHTS.tooltip.5=Leuchtende Gegenstände (Fackel, Glowstone, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=beleuchten die Umgebung, wenn sie in der Hand gehalten, +of.options.DYNAMIC_LIGHTS.tooltip.7=von anderen Spielern ausgerüstet oder gedroppt werden. + +# Performance + +of.options.SMOOTH_FPS=Stabile Bildrate +of.options.SMOOTH_FPS.tooltip.1=Stabilisiert Bildrate durch Grafiktreiberpuffer +of.options.SMOOTH_FPS.tooltip.2= Aus - Keine Stabilisierung, Bildrate könnte schwanken +of.options.SMOOTH_FPS.tooltip.3= An - Stabilisierung der Bildrate +of.options.SMOOTH_FPS.tooltip.4=Diese Einstellung ist abhängig vom Grafikkartentreiber. +of.options.SMOOTH_FPS.tooltip.5=Eine Wirkung ist nicht immer spürbar. + +of.options.SMOOTH_WORLD=Weltstabilisierung +of.options.SMOOTH_WORLD.tooltip.1=Entfernt vom internen Server verursachte starke Lags +of.options.SMOOTH_WORLD.tooltip.2= Aus - Keine Stabilisierung, Bildrate könnte schwanken +of.options.SMOOTH_WORLD.tooltip.3= An - Weltstabilisierung aktiviert +of.options.SMOOTH_WORLD.tooltip.4=Stabilisiert die Bildrate, indem die interne Server- +of.options.SMOOTH_WORLD.tooltip.5=auslastung aufgeteilt wird. +of.options.SMOOTH_WORLD.tooltip=6=Funktioniert nur im Einzelspielermodus. + +of.options.FAST_RENDER=Schnelles Rendern +of.options.FAST_RENDER.tooltip.1=Schnelles Rendern +of.options.FAST_RENDER.tooltip.2= Aus - Standard-Rendern (Standard) +of.options.FAST_RENDER.tooltip.3= An - Optimiertes Rendern (schneller) +of.options.FAST_RENDER.tooltip.4=Benutzt optimierte Renderalgorithmen, die die GPU-Aus- +of.options.FAST_RENDER.tooltip.5=lastung verringern und die Leistung erheblich steigern. +of.options.FAST_RENDER.tooltip.6=Dies kann zu Konflikten mit einigen Mods führen. + +of.options.FAST_MATH=Schnelle Mathematik +of.options.FAST_MATH.tooltip.1=Schnelle Mathematik +of.options.FAST_MATH.tooltip.2= Aus - Standard-Mathematik (Standard) +of.options.FAST_MATH.tooltip.3= An - Schnellere Mathematik +of.options.FAST_MATH.tooltip.4=Benutzt optimierte Sinus- und Kosinusfunktionen, die den +of.options.FAST_MATH.tooltip.5=CPU-Zwischenspeicher besser nutzen und die Leistung +of.options.FAST_MATH.tooltip.6=steigern. +of.options.FAST_MATH.tooltip.7=Dies kann die Weltgeneration geringfügig beeinflussen. + +of.options.CHUNK_UPDATES=Chunk-Aktualisierungen +of.options.CHUNK_UPDATES.tooltip.1=Chunk-Aktualisierungen +of.options.CHUNK_UPDATES.tooltip.2= 1 - Langsameres Weltladen, höhere Bildrate (Standard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - Schnelleres Weltladen, niedrigere Bildrate +of.options.CHUNK_UPDATES.tooltip.4= 5 - Schnellstes Weltladen, niedrigste Bildrate +of.options.CHUNK_UPDATES.tooltip.5=Zahl an Chunk-Aktualisierungen pro gerendertem Bild. +of.options.CHUNK_UPDATES.tooltip.6=Höhere Werte könnten die Bildrate destabilisieren. + +of.options.CHUNK_UPDATES_DYNAMIC=Dyn. Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamische Chunk-Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Aus - (Standard) Normale Chunk-Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= An - Mehr Chunk-Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Wenn diese Einstellung aktiviert ist, werden mehr Chunk- +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=Aktualisierungen ausgeführt, während der Spieler still +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=steht, um die Welt schneller zu laden. + +of.options.LAZY_CHUNK_LOADING=Träges Chunkladen +of.options.LAZY_CHUNK_LOADING.tooltip.1=Träges Chunkladen +of.options.LAZY_CHUNK_LOADING.tooltip.2= Aus - Standard-Server-Chunkladen +of.options.LAZY_CHUNK_LOADING.tooltip.3= An - Träges Server-Chunkladen (flüssiger) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Server-Chunkladen wird flüssiger, indem die Chunks über +of.options.LAZY_CHUNK_LOADING.tooltip.5=ein paar Ticks hinweg geladen werden. Deaktiviere dies, +of.options.LAZY_CHUNK_LOADING.tooltip.6=wenn Teile der Welt nicht korrekt geladen werden. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Nur im Einzelspielermodus effektiv. + +of.options.RENDER_REGIONS=Render-Regionen +of.options.RENDER_REGIONS.tooltip.1=Render-Regionen +of.options.RENDER_REGIONS.tooltip.2= Aus - (Standard) Render-Regionen deaktiviert +of.options.RENDER_REGIONS.tooltip.3= An - Render-Regionen aktiviert +of.options.RENDER_REGIONS.tooltip.4=Render-Regionen ermöglichen ein schnelleres Rendern +of.options.RENDER_REGIONS.tooltip.5=des Geländes bei großen Render-Distanzen. +of.options.RENDER_REGIONS.tooltip.6=Effektiver, wenn VBOs aktiviert sind. +of.options.RENDER_REGIONS.tooltip.6=Nicht für integrierte Grafikkarten empfohlen. + +of.options.SMART_ANIMATIONS=Intelligente Animationen +of.options.SMART_ANIMATIONS.tooltip.1=Intelligente Animationen +of.options.SMART_ANIMATIONS.tooltip.2= Aus - Keine intelligenten Animationen (Standard) +of.options.SMART_ANIMATIONS.tooltip.3= An - Benutze intelligente Animationen +of.options.SMART_ANIMATIONS.tooltip.4=Es werden nur Texturen animiert, die gerade auf +of.options.SMART_ANIMATIONS.tooltip.5=dem Bildschirm sichtbar sind. +of.options.SMART_ANIMATIONS.tooltip.6=Dies reduziert Lag-Spitzen und erhöht die FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Besonders nützlich bei großen Mod-Packs und +of.options.SMART_ANIMATIONS.tooltip.8=Ressourcenpaketen mit HD-Texturen. + +# Animations + +of.options.animation.allOn=Alle an +of.options.animation.allOff=Alle aus +of.options.animation.dynamic=Dynamisch + +of.options.ANIMATED_WATER=Animiertes Wasser +of.options.ANIMATED_LAVA=Animierte Lava +of.options.ANIMATED_FIRE=Animiertes Feuer +of.options.ANIMATED_PORTAL=Animierte Portale +of.options.ANIMATED_REDSTONE=Animiertes Redstone +of.options.ANIMATED_EXPLOSION=Animierte Explosion +of.options.ANIMATED_FLAME=Animierte Flammen +of.options.ANIMATED_SMOKE=Animierter Rauch +of.options.VOID_PARTICLES=Leerepartikel +of.options.WATER_PARTICLES=Wasserpartikel +of.options.RAIN_SPLASH=Regengeplätscher +of.options.PORTAL_PARTICLES=Portalpartikel +of.options.POTION_PARTICLES=Trankpartikel +of.options.DRIPPING_WATER_LAVA=Wasser- & Lavatropfen +of.options.ANIMATED_TERRAIN=Animiertes Gelände +of.options.ANIMATED_TEXTURES=Animierte Texturen +of.options.FIREWORK_PARTICLES=Feuerwerkspartikel + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Zeigt das Lagometer auf dem Debugbildschirm (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Speichermüllsammlung +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Blau - Geplante Ausführungen +of.options.LAGOMETER.tooltip.5=* Lila - Chunks hochladen +of.options.LAGOMETER.tooltip.6=* Rot - Chunkaktualisierungen +of.options.LAGOMETER.tooltip.7=* Gelb - Sichtbarkeitstest +of.options.LAGOMETER.tooltip.8=* Grün - Gelände rendern + +of.options.PROFILER=Debug-Diagramm +of.options.PROFILER.tooltip.1=Debug-Diagramm +of.options.PROFILER.tooltip.2= An - Debug-Diagramm ist aktiviert, langsamer +of.options.PROFILER.tooltip.3= Aus - Debug-Diagramm ist nicht aktiviert, schneller +of.options.PROFILER.tooltip.4=Das Debug-Diagramm sammelt und stellt Debuginforma- +of.options.PROFILER.tooltip.5=tionen dar, wenn der Debugbildschirm geöffnet ist (F3). + +of.options.WEATHER=Wetter +of.options.WEATHER.tooltip.1=Wetter +of.options.WEATHER.tooltip.2= An - Wetter ist aktiv, langsamer +of.options.WEATHER.tooltip.3= Aus - Wetter ist nicht aktiv, schneller +of.options.WEATHER.tooltip.4=Das Wetter kontrolliert Regen, Schnee und Gewitter. +of.options.WEATHER.tooltip.5=Wetterkontrolle ist nur im Einzelspielermodus möglich. + +of.options.time.dayOnly=Nur Tag +of.options.time.nightOnly=Nur Nacht + +of.options.TIME=Zeit +of.options.TIME.tooltip.1=Zeit +of.options.TIME.tooltip.2= Standard - Normaler Tag-Nacht-Zyklus +of.options.TIME.tooltip.3= Nur Tag - Nur Tag +of.options.TIME.tooltip.4= Nur Nacht - Nur Nacht +of.options.TIME.tooltip.5=Diese Einstellung ist nur im Kreativmodus und +of.options.TIME.tooltip.6=im Einzelspielermodus wirksam. + +options.fullscreen.tooltip.1=Vollbildschirm +options.fullscreen.tooltip.2= An - Benutze Vollbildschirmmodus +options.fullscreen.tooltip.3= Aus - Benutze Fenstermodus +options.fullscreen.tooltip.4=Der Vollbildschirmmodus könnte schneller oder langsamer +options.fullscreen.tooltip.5=als der Fenstermodus sein, das kommt auf die Grafik- +options.fullscreen.tooltip.6=karte an. + +of.options.FULLSCREEN_MODE=Vollbild-Auflösung +of.options.FULLSCREEN_MODE.tooltip.1=Vollbild-Auflösung +of.options.FULLSCREEN_MODE.tooltip.2= Standard - Benutze Bildschirmauflösung, langsamer +of.options.FULLSCREEN_MODE.tooltip.3= BxH - Benutze andere Auflösung, könnte schneller sein +of.options.FULLSCREEN_MODE.tooltip.4=Die ausgewählte Auflösung wird im Vollbildschirmmodus +of.options.FULLSCREEN_MODE.tooltip.5=verwendet (F11). Kleinere Auflösungen sollten generell +of.options.FULLSCREEN_MODE.tooltip.6=schneller sein. + +of.options.SHOW_FPS=Bildrate anzeigen +of.options.SHOW_FPS.tooltip.1=Zeige kurze Bildrate- und Render-Informationen +of.options.SHOW_FPS.tooltip.2= Fps - durchschnittlich/minimum +of.options.SHOW_FPS.tooltip.3= C: - Chunkrenderer +of.options.SHOW_FPS.tooltip.4= E: - Objektrenderer + Blockrenderer +of.options.SHOW_FPS.tooltip.5= U: - Chunk-Aktualisierungen +of.options.SHOW_FPS.tooltip.6=Die Bildrate-Informationen werden nur gezeigt, wenn der +of.options.SHOW_FPS.tooltip.7=Debugbildschirm (F3) nicht sichtbar ist. + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3min +of.options.save.6min=6min +of.options.save.12min=12min +of.options.save.24min=24min + +of.options.AUTOSAVE_TICKS=Autospeichern +of.options.AUTOSAVE_TICKS.tooltip.1=Autospeicherintervall +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - Standard +of.options.AUTOSAVE_TICKS.tooltip.3=Autospeichern kann abhängig von der Render Distanz zu +of.options.AUTOSAVE_TICKS.tooltip.4=Lag-Spitzen führen. +of.options.AUTOSAVE_TICKS.tooltip.5=Die Welt wird auch gespeichert, wenn das Menü geöffnet ist. + +of.options.SCREENSHOT_SIZE=Screenshot-Größe +of.options.SCREENSHOT_SIZE.tooltip.1=Screenshot-Auflösung +of.options.SCREENSHOT_SIZE.tooltip.2= Standard - Standard-Screenshot-Auflösung +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - Benutzerdefinierte Screenshot-Auflösung +of.options.SCREENSHOT_SIZE.tooltip.4=Das Aufnehmen größerer Screenshots kann mehr +of.options.SCREENSHOT_SIZE.tooltip.5=Speicher benötigen. +of.options.SCREENSHOT_SIZE.tooltip.6=Nicht kompatibel mit Schnellem Rendern und Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.7=Erfordert Grafiktreiberpuffer-Unterstützung. + +of.options.SHOW_GL_ERRORS=Zeige OpenGL Fehler +of.options.SHOW_GL_ERRORS.tooltip.1=Zeige OpenGL Fehler +of.options.SHOW_GL_ERRORS.tooltip.2=OpenGL Fehler werden im Chat angezeigt. +of.options.SHOW_GL_ERRORS.tooltip.3=Deaktiviere dies nur, wenn ein bekannter Fehler +of.options.SHOW_GL_ERRORS.tooltip.4=vorliegt und dieser nicht behoben werden kann. +of.options.SHOW_GL_ERRORS.tooltip.5=Auch nach Deaktivierung werden Fehler in der Log Datei +of.options.SHOW_GL_ERRORS.tooltip.6=festgehalten und es kann zu erheblichen FPS Einbrüchen +of.options.SHOW_GL_ERRORS.tooltip.7=kommen. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Chat Hintergrund +of.options.CHAT_BACKGROUND.tooltip.1=Chat Hintergrund +of.options.CHAT_BACKGROUND.tooltip.2= Standard - Feste Breite +of.options.CHAT_BACKGROUND.tooltip.3= Kompakt - Entspricht Zeilenbreite +of.options.CHAT_BACKGROUND.tooltip.4= Aus - Versteckt + +of.options.CHAT_SHADOW=Chat Schatten +of.options.CHAT_SHADOW.tooltip.1=Chat Schatten +of.options.CHAT_SHADOW.tooltip.2= An - Zeige Textschatten +of.options.CHAT_SHADOW.tooltip.3= Aus - Kein Textschatten diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_GB.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_GB.lang new file mode 100644 index 0000000..9609da4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_GB.lang @@ -0,0 +1,57 @@ +# Translator = sp614x, Diego R. V. + +# Video Settings + +options.anaglyph.tooltip.2=Enables a stereoscopic 3D effect using different colours + +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=recognise light emitting items in the main hand + +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Lower values = inexact, coarser shadows + +# Quality + +of.options.AA_LEVEL.tooltip.5=sharp colour transitions. + +of.options.CUSTOM_COLORS=Custom Colours +of.options.CUSTOM_COLORS.tooltip.1=Custom Colours +of.options.CUSTOM_COLORS.tooltip.2= ON - uses custom colours (default), slower +of.options.CUSTOM_COLORS.tooltip.3= OFF - uses default colours, faster +of.options.CUSTOM_COLORS.tooltip.4=The custom colours are supplied by the current +of.options.CUSTOM_COLORS.tooltip.5=resource pack + +of.options.SWAMP_COLORS=Swamp Colours +of.options.SWAMP_COLORS.tooltip.1=Swamp Colours +of.options.SWAMP_COLORS.tooltip.2= ON - use swamp colours (default), slower +of.options.SWAMP_COLORS.tooltip.3= OFF - do not use swamp colours, faster +of.options.SWAMP_COLORS.tooltip.4=The swamp colours affect grass, leaves, vines and water. + +of.options.SMOOTH_BIOMES.tooltip.5=averaging the colour of all surrounding blocks. + +# Details + +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Fancy - correct colour blending (default) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Fast - fast colour blending (faster) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controls the colour blending of translucent blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.5=with different colour (stained glass, water, ice) + +# Performance + +of.options.SMOOTH_FPS.tooltip.1=Stabilises FPS by flushing the graphic driver buffers. +of.options.SMOOTH_FPS.tooltip.2= OFF - no stabilisation, FPS may fluctuate +of.options.SMOOTH_FPS.tooltip.3= ON - FPS stabilisation + +of.options.SMOOTH_WORLD.tooltip.2= OFF - no stabilisation, FPS may fluctuate +of.options.SMOOTH_WORLD.tooltip.3= ON - FPS stabilisation +of.options.SMOOTH_WORLD.tooltip.4=Stabilises FPS by distributing the internal server load. + +of.options.FAST_RENDER.tooltip.3= ON - optimised rendering (faster) +of.options.FAST_RENDER.tooltip.4=Uses optimised rendering algorithm which decreases + +of.options.FAST_MATH=Fast Maths +of.options.FAST_MATH.tooltip.1=Fast Maths +of.options.FAST_MATH.tooltip.2= OFF - standard maths (default) +of.options.FAST_MATH.tooltip.3= ON - faster maths +of.options.FAST_MATH.tooltip.4=Uses optimised sin() and cos() functions which can +of.options.FAST_MATH.tooltip.5=better utilise the CPU cache and increase the FPS. + +of.options.CHUNK_UPDATES.tooltip.6=higher values may destabilise the framerate. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_UD.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_UD.lang new file mode 100644 index 0000000..13baefa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_UD.lang @@ -0,0 +1,749 @@ +# Contributors of British English (upside down) # +# DaDodger and sp614x for creating en_gb.lang +# Regnander for converting and proofreading the result + +# General +of.general.ambiguous=snonƃᴉqɯɐ +of.general.compact=ʇɔɐdɯoƆ +of.general.custom=ɯoʇsnƆ +of.general.from=ɯoɹℲ +of.general.id=pI +of.general.max=ɯnɯᴉxɐW +of.general.restart=ʇɹɐʇsǝɹ +of.general.smart=ʇɹɐɯS + +# Keys +of.key.zoom=ɯooZ + +# Message +of.message.aa.shaders2=˙sɹǝpɐɥS ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou sᴉ ƃuᴉsɐᴉꞁɐᴉʇu∀ +of.message.aa.shaders1=˙uoᴉʇdo sᴉɥʇ ǝꞁqɐuǝ oʇ sɹǝpɐɥS ǝꞁqɐsᴉp ǝsɐǝꞁԀ + +of.message.af.shaders2=˙sɹǝpɐɥS ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou sᴉ ƃuᴉɹǝʇꞁᴉℲ ɔᴉdoɹʇosᴉu∀ +of.message.af.shaders1=˙uoᴉʇdo sᴉɥʇ ǝꞁqɐuǝ oʇ sɹǝpɐɥS ǝꞁqɐsᴉp ǝsɐǝꞁԀ + +of.message.fr.shaders2=˙sɹǝpɐɥS ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou sᴉ ɹǝpuǝɹ ʇsɐℲ +of.message.fr.shaders1=˙uoᴉʇdo sᴉɥʇ ǝꞁqɐuǝ oʇ sɹǝpɐɥS ǝꞁqɐsᴉp ǝsɐǝꞁԀ + +of.message.an.shaders2=˙sɹǝpɐɥS ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou sᴉ ɥdʎꞁƃɐu∀ pƐ +of.message.an.shaders1=˙uoᴉʇdo sᴉɥʇ ǝꞁqɐuǝ oʇ sɹǝpɐɥS ǝꞁqɐsᴉp ǝsɐǝꞁԀ + +of.message.shaders.aa2=˙ƃuᴉsɐᴉꞁɐᴉʇu∀ ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou ǝɹɐ sɹǝpɐɥS +of.message.shaders.aa1=˙ǝɯɐƃ ǝɥʇ ʇɹɐʇsǝɹ puɐ ℲℲO oʇ ƃuᴉsɐᴉꞁɐᴉʇu∀ <- ʎʇᴉꞁɐnQ ʇǝs ǝsɐǝꞁԀ + +of.message.shaders.af2=˙ƃuᴉɹǝʇꞁᴉℲ ɔᴉdoɹʇosᴉu∀ ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou ǝɹɐ sɹǝpɐɥS +of.message.shaders.af1=˙ℲℲO oʇ ƃuᴉɹǝʇꞁᴉℲ ɔᴉdoɹʇosᴉu∀ <- ʎʇᴉꞁɐnQ ʇǝs ǝsɐǝꞁԀ + +of.message.shaders.fr2=˙ɹǝpuǝɹ ʇsɐℲ ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou ǝɹɐ sɹǝpɐɥS +of.message.shaders.fr1=˙ℲℲO oʇ ɹǝpuǝɹ ʇsɐℲ <- ǝɔuɐɯɹoɟɹǝԀ ʇǝs ǝsɐǝꞁԀ + +of.message.shaders.an2=˙ɥdʎꞁƃɐu∀ pƐ ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou ǝɹɐ sɹǝpɐɥS +of.message.shaders.an1=˙ℲℲO oʇ ɥdʎꞁƃɐu∀ pƐ <- ɹǝɥʇo ʇǝs ǝsɐǝꞁԀ + +of.message.shaders.nv2=s% :uoᴉsɹǝʌ ǝuᴉℲᴉʇdO ɹǝʍǝu ɐ sǝɹᴉnbǝɹ ʞɔɐd ɹǝpɐɥs sᴉɥ⟘ +of.message.shaders.nv1=¿ǝnuᴉʇuoɔ oʇ ʇuɐʍ noʎ ǝɹns noʎ ǝɹ∀ + +of.message.newVersion=§e%s§f :ǝꞁqɐꞁᴉɐʌɐ sᴉ uoᴉsɹǝʌ §eǝuᴉℲᴉʇdO§f ʍǝu ∀ +of.message.java64Bit=˙ǝɔuɐɯɹoɟɹǝd ǝsɐǝɹɔuᴉ oʇ §eɐʌɐſ ʇᴉq-߈9§f ꞁꞁɐʇsuᴉ uɐɔ no⅄ +of.message.openglError=(s%) s% :§eɹoɹɹƎ ˥פuǝdO§f + +of.message.shaders.loading=s% :sɹǝpɐɥs ƃuᴉpɐo˥ + +of.message.other.reset=¿sǝnꞁɐʌ ʇꞁnɐɟǝp ɹᴉǝɥʇ oʇ sƃuᴉʇʇǝs oǝpᴉʌ ꞁꞁɐ ʇǝsǝᴚ + +of.message.loadingVisibleChunks=sʞunɥɔ ǝꞁqᴉsᴉʌ ƃuᴉpɐo˥ + +# Skin customization + +of.options.skinCustomisation.ofCape=˙˙˙ǝdɐƆ ǝuᴉℲᴉʇdO + +of.options.capeOF.title=ǝdɐƆ ǝuᴉℲᴉʇdO +of.options.capeOF.openEditor=ɹoʇᴉpƎ ǝdɐƆ uǝdO +of.options.capeOF.reloadCape=ǝdɐƆ pɐolǝᴚ + +of.message.capeOF.openEditor=˙ɹǝsʍoɹq qǝʍ ɐ uᴉ uǝdo pꞁnoɥs ɹoʇᴉpǝ ǝdɐɔ ǝuᴉℲᴉʇdO ǝɥ⟘ +of.message.capeOF.reloadCape=˙spuoɔǝs ϛ⥝ uᴉ pǝpɐoꞁǝɹ ǝq ꞁꞁᴉʍ ǝdɐɔ ǝɥ⟘ + +of.message.capeOF.error2=pǝꞁᴉɐɟ uoᴉʇɐɔᴉʇuǝɥʇnɐ ƃuɐɾoW. +of.message.capeOF.error1=%s: ɹoɹɹƎ + +# Video settings + +options.graphics.tooltip.5=ʎʇᴉꞁɐnb ꞁɐnsᴉΛ +options.graphics.tooltip.4=ɹǝʇsɐɟ 'ʎʇᴉꞁɐnb ɹǝʍoꞁ - ʇsɐℲ +options.graphics.tooltip.3=ɹǝʍoꞁs 'ʎʇᴉꞁɐnb ɹǝɥƃᴉɥ - ʎɔuɐℲ +options.graphics.tooltip.2='ɹǝʇɐʍ 'sǝʌɐǝꞁ 'spnoꞁɔ ɟo ǝɔuɐɹɐǝddɐ ǝɥʇ sǝƃuɐɥƆ +options.graphics.tooltip.1=˙sǝpᴉs ssɐɹƃ puɐ sʍopɐɥs + +of.options.renderDistance.tiny=ʎuᴉ⟘ +of.options.renderDistance.short=ʇɹoɥS +of.options.renderDistance.normal=ꞁɐɯɹoN +of.options.renderDistance.far=ɹɐℲ +of.options.renderDistance.extreme=ǝɯǝɹʇxƎ +of.options.renderDistance.insane=ǝuɐsuI +of.options.renderDistance.ludicrous=snoɹɔᴉpn˥ + +options.renderDistance.tooltip.8=ǝɔuɐʇsᴉp ǝꞁqᴉsᴉΛ +options.renderDistance.tooltip.7=(ʇsǝʇsɐɟ) ɯᘔƐ - ʎuᴉ⟘ ᘔ +options.renderDistance.tooltip.6=(ꞁɐɯɹou) ɯ8ᘔ⥝ - ꞁɐɯɹoN 8 +options.renderDistance.tooltip.5=(ɹǝʍoꞁs) ɯ9ϛᘔ - ɹɐℲ 9⥝ +options.renderDistance.tooltip.4=ƃuᴉpuɐɯǝp ǝɔɹnosǝɹ ʎɹǝʌ (¡ʇsǝʍoꞁs) ɯᘔ⥝ϛ - ǝɯǝɹʇxƎ ᘔƐ +options.renderDistance.tooltip.3=pǝʇɐɔoꞁꞁɐ W∀ɹ qפᘔ spǝǝu 'ɯ89ㄥ - ǝuɐsuI 8߈ +options.renderDistance.tooltip.2=pǝʇɐɔoꞁꞁɐ W∀ɹ qפƐ spǝǝu 'ɯ߈ᘔ0⥝ - snoɹɔᴉpn˥ ߈9 +options.renderDistance.tooltip.1=˙spꞁɹoʍ ꞁɐɔoꞁ uᴉ ǝʌᴉʇɔǝɟɟǝ ʎꞁuo ǝɹɐ ɹɐℲ 9⥝ ɹǝʌo sǝnꞁɐΛ + +options.ao.tooltip.4=ƃuᴉʇɥƃᴉꞁ ɥʇooɯS +options.ao.tooltip.3=(ɹǝʇsɐɟ) ƃuᴉʇɥƃᴉꞁ ɥʇooɯs ou - ℲℲO +options.ao.tooltip.2=(ɹǝʍoꞁs) ƃuᴉʇɥƃᴉꞁ ɥʇooɯs ǝꞁdɯᴉs - ɯnɯᴉuᴉW +options.ao.tooltip.1=(ʇsǝʍoꞁs) ƃuᴉʇɥƃᴉꞁ ɥʇooɯs xǝꞁdɯoɔ - ɯnɯᴉxɐW + +options.framerateLimit.tooltip.6=ǝʇɐɹǝɯɐɹɟ xɐW +options.framerateLimit.tooltip.5=(0ᘔ '0Ɛ '09) ǝʇɐɹǝɯɐɹɟ ɹoʇᴉuoɯ oʇ ʇᴉɯᴉꞁ - ɔuʎSΛ +options.framerateLimit.tooltip.4=ǝꞁqɐᴉɹɐʌ - ϛϛᘔ-ϛ +options.framerateLimit.tooltip.3=(ʇsǝʇsɐɟ) ʇᴉɯᴉꞁ ou - pǝʇᴉɯᴉꞁu∩ +options.framerateLimit.tooltip.2=ɟᴉ uǝʌǝ SԀℲ ǝɥʇ sǝsɐǝɹɔǝp ʇᴉɯᴉꞁ ǝʇɐɹǝɯɐɹɟ ǝɥ⟘ +options.framerateLimit.tooltip.1=˙pǝɥɔɐǝɹ ʇou sᴉ ǝnꞁɐʌ ʇᴉɯᴉꞁ ǝɥʇ +of.options.framerateLimit.vsync=ɔuʎSΛ + +of.options.AO_LEVEL=ꞁǝʌǝ˥ ƃuᴉʇɥƃᴉ˥ ɥʇooɯS +of.options.AO_LEVEL.tooltip.4=ꞁǝʌǝꞁ ƃuᴉʇɥƃᴉꞁ ɥʇooɯS +of.options.AO_LEVEL.tooltip.3=sʍopɐɥs ou - ℲℲO +of.options.AO_LEVEL.tooltip.2=sʍopɐɥs ʇɥƃᴉꞁ - %%0ϛ +of.options.AO_LEVEL.tooltip.1=sʍopɐɥs ʞɹɐp - %%00⥝ + +options.viewBobbing.tooltip.2=˙ʇuǝɯǝʌoɯ ɔᴉʇsᴉꞁɐǝɹ ǝɹoW +options.viewBobbing.tooltip.1=˙sʇꞁnsǝɹ ʇsǝq ɹoɟ ℲℲO oʇ ʇᴉ ʇǝs sdɐɯdᴉɯ ƃuᴉsn uǝɥM + +options.guiScale.tooltip.6=ǝꞁɐɔS I∩פ +options.guiScale.tooltip.5=ǝzᴉs ꞁɐɯᴉxɐɯ - oʇn∀ +options.guiScale.tooltip.4=xƐ oʇ x⥝ - ǝƃɹɐ˥ 'ꞁɐɯɹoN 'ꞁꞁɐɯS +options.guiScale.tooltip.3=sʎɐꞁdsᴉp ʞ߈ uo ǝꞁqɐꞁᴉɐʌɐ - x0⥝ oʇ x߈ +options.guiScale.tooltip.2=˙ǝpoɔᴉu∩ ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇou ǝɹɐ (˙˙˙ xϛ 'xƐ 'x⥝) sǝnꞁɐʌ ppO +options.guiScale.tooltip.1=˙ɹǝʇsɐɟ ǝq ʎɐɯ I∩פ ɹǝꞁꞁɐɯs ∀ + +options.vbo.tooltip.3=sʇɔǝɾqo ɹǝɟɟnq xǝʇɹǝΛ +options.vbo.tooltip.2=ʎꞁꞁɐnsn sᴉ ɥɔᴉɥʍ ꞁǝpoɯ ƃuᴉɹǝpuǝɹ ǝʌᴉʇɐuɹǝʇꞁɐ uɐ sǝs∩ +options.vbo.tooltip.1=˙ƃuᴉɹǝpuǝɹ ʇꞁnɐɟǝp ǝɥʇ uɐɥʇ (%%0⥝-ϛ) ɹǝʇsɐɟ +options.vbo=sOᗺΛ ǝs∩ + +options.gamma.tooltip.6=˙sʇɔǝɾqo ɹǝʞɹɐp ɟo ssǝuʇɥƃᴉɹq ǝɥʇ sǝƃuɐɥƆ +options.gamma.tooltip.5=ssǝuʇɥƃᴉɹq pɹɐpuɐʇs - ʎpooW +options.gamma.tooltip.4=ǝꞁqɐᴉɹɐʌ - %%66-⥝ +options.gamma.tooltip.3=sʇɔǝɾqo ɹǝʞɹɐp ɹoɟ ssǝuʇɥƃᴉɹq ɯnɯᴉxɐɯ - ʇɥƃᴉɹq +options.gamma.tooltip.2= ɟo ssǝuʇɥƃᴉɹq ǝɥʇ ǝƃuɐɥɔ ʇou sǝop uoᴉʇdo sᴉɥ⟘ +options.gamma.tooltip.1=˙sʇɔǝɾqo ʞɔɐꞁq ʎꞁꞁnɟ + +options.anaglyph.tooltip.4=ɥdʎꞁƃɐu∀ pƐ +options.anaglyph.tooltip.3=sɹnoꞁoɔ ʇuǝɹǝɟɟᴉp ƃuᴉsn ʇɔǝɟɟǝ pƐ ɔᴉdoɔsoǝɹǝʇs ɐ sǝꞁqɐuƎ +options.anaglyph.tooltip.2=˙ǝʎǝ ɥɔɐǝ ɹoɟ +options.anaglyph.tooltip.1=˙ƃuᴉʍǝᴉʌ ɹǝdoɹd ɹoɟ sǝssɐꞁƃ uɐʎɔ-pǝɹ sǝɹᴉnbǝᴚ + +of.options.ALTERNATE_BLOCKS=sʞɔoꞁq ǝʇɐuɹǝʇꞁ∀ +of.options.ALTERNATE_BLOCKS.tooltip.3=sʞɔoꞁq ǝʇɐuɹǝʇꞁ∀ +of.options.ALTERNATE_BLOCKS.tooltip.2=˙sʞɔoꞁq ǝɯos ɹoɟ sꞁǝpoɯ ʞɔoꞁq ǝʌᴉʇɐuɹǝʇꞁɐ sǝs∩ +of.options.ALTERNATE_BLOCKS.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ pǝʇɔǝꞁǝs ǝɥʇ uo spuǝdǝp + +of.options.FOG_FANCY=ƃoℲ +of.options.FOG_FANCY.tooltip.6=ǝdʎʇ ƃoℲ +of.options.FOG_FANCY.tooltip.5=ƃoɟ ɹǝʇsɐɟ - ʇsɐℲ +of.options.FOG_FANCY.tooltip.4=ɹǝʇʇǝq sʞooꞁ 'ƃoɟ ɹǝʍoꞁs - ʎɔuɐℲ +of.options.FOG_FANCY.tooltip.3=ʇsǝʇsɐɟ 'ƃoɟ ou - ℲℲO +of.options.FOG_FANCY.tooltip.2= ǝɥʇ ʎq pǝʇɹoddns sᴉ ʇᴉ ɟᴉ ʎꞁuo ǝꞁqɐꞁᴉɐʌɐ sᴉ ƃoɟ ʎɔuɐɟ ǝɥ⟘ +of.options.FOG_FANCY.tooltip.1=˙pɹɐɔ ɔᴉɥdɐɹƃ + +of.options.FOG_START=ʇɹɐʇS ƃoℲ +of.options.FOG_START.tooltip.4=ʇɹɐʇs ƃoℲ +of.options.FOG_START.tooltip.3=ɹǝʎɐꞁd ǝɥʇ ɹɐǝu sʇɹɐʇs ƃoɟ ǝɥʇ - ᘔ˙0 +of.options.FOG_START.tooltip.2=ɹǝʎɐꞁd ǝɥʇ ɯoɹɟ ɹɐɟ sʇɹɐʇs ƃoɟ ǝɥʇ - 8˙0 +of.options.FOG_START.tooltip.1=˙ǝɔuɐɯɹoɟɹǝd ǝɥʇ ʇɔǝɟɟɐ ʇou sǝop ʎꞁꞁɐnsn uoᴉʇdo sᴉɥ⟘ + +of.options.CHUNK_LOADING=ƃuᴉpɐo˥ ʞunɥƆ +of.options.CHUNK_LOADING.tooltip.8=ƃuᴉpɐo˥ ʞunɥƆ +of.options.CHUNK_LOADING.tooltip.7=sʞunɥɔ ƃuᴉpɐoꞁ uǝɥʍ SԀℲ ǝꞁqɐʇsun - ʇꞁnɐɟǝp +of.options.CHUNK_LOADING.tooltip.6=SԀℲ ǝꞁqɐʇs - ɥʇooɯS +of.options.CHUNK_LOADING.tooltip.5=ƃuᴉpɐoꞁ pꞁɹoʍ ɹǝʇsɐɟ xƐ 'SԀℲ ǝꞁqɐʇs - ǝɹoƆ-ᴉʇꞁnW +of.options.CHUNK_LOADING.tooltip.4= puɐ ƃuᴉɹǝʇʇnʇs ǝɥʇ ǝʌoɯǝɹ ǝɹoƆ-ᴉʇꞁnW puɐ ɥʇooɯS +of.options.CHUNK_LOADING.tooltip.3=˙ƃuᴉpɐoꞁ ʞunɥɔ ʎq pǝsnɐɔ sǝzǝǝɹɟ +of.options.CHUNK_LOADING.tooltip.2=puɐ ƃuᴉpɐoꞁ pꞁɹoʍ ǝɥʇ xƐ dn pǝǝds uɐɔ ǝɹoƆ-ᴉʇꞁnW +of.options.CHUNK_LOADING.tooltip.1=˙ǝɹoɔ ∩ԀƆ puoɔǝs ɐ ƃuᴉsn ʎq SԀℲ ǝsɐǝɹɔuᴉ +of.options.chunkLoading.smooth=ɥʇooɯS +of.options.chunkLoading.multiCore=ǝɹoƆ-ᴉʇꞁnW + +of.options.shaders=˙˙˙sɹǝpɐɥS +of.options.shadersTitle=sɹǝpɐɥS + +of.options.shaders.packNone=ℲℲO +of.options.shaders.packDefault=(ꞁɐuɹǝʇuᴉ) + +of.options.shaders.ANTIALIASING=ƃuᴉsɐᴉꞁɐᴉʇu∀ +of.options.shaders.ANTIALIASING.tooltip.7=ƃuᴉsɐᴉꞁɐᴉʇu∀ +of.options.shaders.ANTIALIASING.tooltip.6=(ɹǝʇsɐɟ) ƃuᴉsɐᴉꞁɐᴉʇuɐ ou (ʇꞁnɐɟǝp) - ℲℲO +of.options.shaders.ANTIALIASING.tooltip.5=(ɹǝʍoꞁs) sǝƃpǝ puɐ sǝuᴉꞁ pǝsɐᴉꞁɐᴉʇuɐ - x߈ 'xᘔ ∀∀XℲ +of.options.shaders.ANTIALIASING.tooltip.4=sɥʇooɯs ɥɔᴉɥʍ ʇɔǝɟɟǝ ƃuᴉssǝɔoɹd-ʇsod ɐ sᴉ ∀∀XℲ +of.options.shaders.ANTIALIASING.tooltip.3=˙suoᴉʇᴉsuɐɹʇ ɹoꞁoɔ dɹɐɥs puɐ sǝuᴉꞁ pǝƃƃɐɾ +of.options.shaders.ANTIALIASING.tooltip.2=ƃuᴉsɐᴉꞁɐᴉʇuɐ ꞁɐuoᴉʇᴉpɐɹʇ uɐɥʇ ɹǝʇsɐɟ sᴉ ʇI +of.options.shaders.ANTIALIASING.tooltip.1= ˙ɹǝpuǝɹ ʇsɐℲ puɐ sɹǝpɐɥs ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ sᴉ puɐ + +of.options.shaders.NORMAL_MAP=dɐW ꞁɐɯɹoN +of.options.shaders.NORMAL_MAP.tooltip.7=dɐW ꞁɐɯɹoN +of.options.shaders.NORMAL_MAP.tooltip.6= sdɐɯ ꞁɐɯɹou ǝꞁqɐuǝ (ʇꞁnɐɟǝp) - NO +of.options.shaders.NORMAL_MAP.tooltip.5=sdɐɯ ꞁɐɯɹou ǝꞁqɐsᴉp - ℲℲO +of.options.shaders.NORMAL_MAP.tooltip.4=ʞɔɐd ɹǝpɐɥs ǝɥʇ ʎq pǝsn ǝq uɐɔ sdɐɯ ꞁɐɯɹoN +of.options.shaders.NORMAL_MAP.tooltip.3=˙sǝɔɐɟɹns ꞁǝpoɯ ʇɐꞁɟ uo ʎɹʇǝɯoǝƃ pƐ ǝʇɐꞁnɯᴉs oʇ +of.options.shaders.NORMAL_MAP.tooltip.2=ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sǝɹnʇxǝʇ dɐɯ ꞁɐɯɹou ǝɥ⟘ +of.options.shaders.NORMAL_MAP.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ ʇuǝɹɹnɔ + +of.options.shaders.SPECULAR_MAP=dɐW ɹɐꞁnɔǝdS +of.options.shaders.SPECULAR_MAP.tooltip.7=dɐW ɹɐꞁnɔǝdS +of.options.shaders.SPECULAR_MAP.tooltip.6=sdɐɯ ɹɐꞁnɔǝds ǝꞁqɐuǝ (ʇꞁnɐɟǝp) - NO +of.options.shaders.SPECULAR_MAP.tooltip.5=sdɐɯ ɹɐꞁnɔǝds ǝꞁqɐsᴉp - ℲℲO +of.options.shaders.SPECULAR_MAP.tooltip.4=ʞɔɐd ɹǝpɐɥs ǝɥʇ ʎq pǝsn ǝq uɐɔ sdɐɯ ɹɐꞁnɔǝdS +of.options.shaders.SPECULAR_MAP.tooltip.3=˙sʇɔǝɟɟǝ uoᴉʇɔǝꞁɟǝɹ ꞁɐᴉɔǝds ǝʇɐꞁnɯᴉs oʇ +of.options.shaders.SPECULAR_MAP.tooltip.2=ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sǝɹnʇxǝʇ dɐɯ ɹɐꞁnɔǝds ǝɥ⟘ +of.options.shaders.SPECULAR_MAP.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ ʇuǝɹɹnɔ + +of.options.shaders.RENDER_RES_MUL=ʎʇᴉꞁɐnQ ɹǝpuǝᴚ +of.options.shaders.RENDER_RES_MUL.tooltip.8=ʎʇᴉꞁɐnQ ɹǝpuǝᴚ +of.options.shaders.RENDER_RES_MUL.tooltip.7=(ʇsǝʇsɐɟ) ʍoꞁ - xϛ˙0 +of.options.shaders.RENDER_RES_MUL.tooltip.6=(ʇꞁnɐɟǝp) pɹɐpuɐʇs - x⥝ +of.options.shaders.RENDER_RES_MUL.tooltip.5=(ʇsǝʍoꞁs) ɥƃᴉɥ - xᘔ +of.options.shaders.RENDER_RES_MUL.tooltip.4= ǝɹnʇxǝʇ ǝɥʇ ɟo ǝzᴉs ǝɥʇ sꞁoɹʇuoɔ ʎʇᴉꞁɐnb ɹǝpuǝᴚ +of.options.shaders.RENDER_RES_MUL.tooltip.3=˙oʇ ƃuᴉɹǝpuǝɹ sᴉ ʞɔɐd ɹǝpɐɥs ǝɥʇ ʇɐɥʇ +of.options.shaders.RENDER_RES_MUL.tooltip.2=˙sʎɐꞁdsᴉp ʞ߈ ɥʇᴉʍ ꞁnɟǝsn ǝq uɐɔ sǝnꞁɐʌ ɹǝʍo˥ +of.options.shaders.RENDER_RES_MUL.tooltip.1=˙ɹǝʇꞁᴉɟ ƃuᴉsɐᴉꞁɐᴉʇuɐ uɐ sɐ ʞɹoʍ sǝnꞁɐʌ ɹǝɥƃᴉH + +of.options.shaders.SHADOW_RES_MUL=ʎʇᴉꞁɐnQ ʍopɐɥS +of.options.shaders.SHADOW_RES_MUL.tooltip.8=ʎʇᴉꞁɐnQ ʍopɐɥS +of.options.shaders.SHADOW_RES_MUL.tooltip.7=(ʇsǝʇsɐɟ) ʍoꞁ - xϛ˙0 +of.options.shaders.SHADOW_RES_MUL.tooltip.6=(ʇꞁnɐɟǝp) pɹɐpuɐʇs - x⥝ +of.options.shaders.SHADOW_RES_MUL.tooltip.5=(ʇsǝʍoꞁs) ɥƃᴉɥ - xᘔ +of.options.shaders.SHADOW_RES_MUL.tooltip.4=dɐɯ ʍopɐɥs ǝɥʇ ɟo ǝzᴉs ǝɥʇ sꞁoɹʇuoɔ ʎʇᴉꞁɐnb ʍopɐɥS +of.options.shaders.SHADOW_RES_MUL.tooltip.3=˙ʞɔɐd ɹǝpɐɥs ǝɥʇ ʎq pǝsn ǝɹnʇxǝʇ +of.options.shaders.SHADOW_RES_MUL.tooltip.2= sǝnꞁɐʌ ɹǝʍo˥ +of.options.shaders.SHADOW_RES_MUL.tooltip.1= sǝnꞁɐʌ ɹǝɥƃᴉH + +of.options.shaders.HAND_DEPTH_MUL=ɥʇdǝp puɐH +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=ɥʇdǝp puɐH +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=ɐɹǝɯɐɔ ǝɥʇ oʇ ɹɐǝu puɐɥ - xϛ˙0 +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=(ʇꞁnɐɟǝp) - x⥝ +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=ɐɹǝɯɐɔ ǝɥʇ ɯoɹɟ ɹɐɟ puɐɥ - xᘔ +of.options.shaders.HAND_DEPTH_MUL.tooltip.4=ǝɹɐ sʇɔǝɾqo pꞁǝɥpuɐɥ ǝɥʇ ɹɐɟ ʍoɥ sꞁoɹʇuoɔ ɥʇdǝp puɐH +of.options.shaders.HAND_DEPTH_MUL.tooltip.3=˙ɐɹǝɯɐɔ ǝɥʇ ɯoɹɟ +of.options.shaders.HAND_DEPTH_MUL.tooltip.2=ǝƃuɐɥɔ pꞁnoɥs sᴉɥʇ ɹnꞁq ɥʇdǝp ƃuᴉsn sʞɔɐd ɹǝpɐɥs ɹoℲ +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=˙sʇɔǝɾqo pꞁǝɥpuɐɥ ɟo ƃuᴉɹɹnꞁq ǝɥʇ + +of.options.shaders.CLOUD_SHADOW=ʍopɐɥS pnoꞁƆ + +of.options.shaders.OLD_HAND_LIGHT=ʇɥƃᴉ˥ puɐH pꞁO +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=ʇɥƃᴉ˥ puɐH pꞁO +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=ʞɔɐd ɹǝpɐɥs ǝɥʇ ʎq pǝꞁꞁoɹʇuoɔ - ʇꞁnɐɟǝp +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=ʇɥƃᴉꞁpuɐɥ pꞁo ǝsn - NO +of.options.shaders.OLD_HAND_LIGHT.tooltip.4=ʇɥƃᴉꞁpuɐɥ ʍǝu ǝsn - ℲℲO +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= ʎꞁuo ɥɔᴉɥʍ sʞɔɐd ɹǝpɐɥs sʍoꞁꞁɐ ʇɥƃᴉꞁ puɐɥ pꞁO +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= puɐɥ uᴉɐɯ ǝɥʇ uᴉ sɯǝʇᴉ ƃuᴉʇʇᴉɯǝ ʇɥƃᴉꞁ ǝsᴉuƃoɔǝɹ +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=˙puɐɥ-ɟɟo ǝɥʇ uᴉ sɯǝʇᴉ ɥʇᴉʍ ʞɹoʍ osꞁɐ oʇ + +of.options.shaders.OLD_LIGHTING=ƃuᴉʇɥƃᴉ˥ pꞁO +of.options.shaders.OLD_LIGHTING.tooltip.8=ƃuᴉʇɥƃᴉ˥ pꞁO +of.options.shaders.OLD_LIGHTING.tooltip.7=ʞɔɐd ɹǝpɐɥs ǝɥʇ ʎq pǝꞁꞁoɹʇuoɔ - ʇꞁnɐɟǝp +of.options.shaders.OLD_LIGHTING.tooltip.6=ƃuᴉʇɥƃᴉꞁ pꞁo ǝsn - NO +of.options.shaders.OLD_LIGHTING.tooltip.5=ƃuᴉʇɥƃᴉꞁ pꞁo ǝsn ʇou op - ℲℲO +of.options.shaders.OLD_LIGHTING.tooltip.4= pǝᴉꞁddɐ ƃuᴉʇɥƃᴉꞁ pǝxᴉɟ ǝɥʇ sꞁoɹʇuoɔ ƃuᴉʇɥƃᴉꞁ pꞁO +of.options.shaders.OLD_LIGHTING.tooltip.3= ˙sǝpᴉs ʞɔoꞁq ǝɥʇ oʇ ɐꞁꞁᴉuɐʌ ʎq +of.options.shaders.OLD_LIGHTING.tooltip.2= ǝpᴉʌoɹd ʎꞁꞁɐnsn sʍopɐɥs ǝsn ɥɔᴉɥʍ sʞɔɐd ɹǝpɐɥS +of.options.shaders.OLD_LIGHTING.tooltip.1=˙uoᴉʇᴉsod uns ǝɥʇ uo ƃuᴉpuǝdǝp ƃuᴉʇɥƃᴉꞁ ɹǝʇʇǝq ɥɔnɯ + +of.options.shaders.DOWNLOAD=sɹǝpɐɥS pɐoꞁuʍop +of.options.shaders.DOWNLOAD.tooltip.5=sɹǝpɐɥS pɐoꞁuʍop +of.options.shaders.DOWNLOAD.tooltip.4= +of.options.shaders.DOWNLOAD.tooltip.3=˙ɹǝsʍoɹq ɐ uᴉ ǝƃɐd sʞɔɐd ɹǝpɐɥs ǝɥʇ suǝdO +of.options.shaders.DOWNLOAD.tooltip.2=,,ɹǝpꞁoℲ sɹǝpɐɥS,, ǝɥʇ uᴉ sʞɔɐd ɹǝpɐɥs pǝpɐoꞁuʍop ǝɥʇ ʇnԀ +of.options.shaders.DOWNLOAD.tooltip.1=˙sɹǝpɐɥs pǝꞁꞁɐʇsuᴉ ɟo ʇsᴉꞁ ǝɥʇ uᴉ ɹɐǝddɐ ꞁꞁᴉʍ ʎǝɥʇ puɐ + +of.options.shaders.SHADER_PACK=ʞɔɐԀ ɹǝpɐɥS + +of.options.shaders.shadersFolder=ɹǝpꞁoℲ sɹǝpɐɥS +of.options.shaders.shaderOptions=˙˙˙suoᴉʇdo ɹǝpɐɥS + +of.options.shaderOptionsTitle=suoᴉʇdo ɹǝpɐɥS + +of.options.quality=˙˙˙ʎʇᴉꞁɐnQ +of.options.qualityTitle=sƃuᴉʇʇǝS ʎʇᴉꞁɐnQ + +of.options.details=˙˙˙sꞁᴉɐʇǝp +of.options.detailsTitle=sƃuᴉʇʇǝS ꞁᴉɐʇǝp + +of.options.performance=˙˙˙ǝɔuɐɯɹoɟɹǝԀ +of.options.performanceTitle=sƃuᴉʇʇǝS ǝɔuɐɯɹoɟɹǝԀ + +of.options.animations=˙˙˙suoᴉʇɐɯᴉu∀ +of.options.animationsTitle=sƃuᴉʇʇǝS uoᴉʇɐɯᴉu∀ + +of.options.other=˙˙˙ɹǝɥʇO +of.options.otherTitle=sƃuᴉʇʇǝS ɹǝɥʇO + +of.options.other.reset=˙˙˙sƃuᴉʇʇǝS oǝpᴉΛ ʇǝsǝᴚ + +of.shaders.profile=ǝꞁᴉɟoɹԀ + +# Quality + +of.options.mipmap.bilinear=ɹɐǝuᴉꞁᴉᗺ +of.options.mipmap.linear=ɹɐǝuᴉ˥ +of.options.mipmap.nearest=ʇsǝɹɐǝN +of.options.mipmap.trilinear=ɹɐǝuᴉꞁᴉɹ⟘ + +options.mipmapLevels.tooltip.6=ɹǝʇʇǝq ʞooꞁ sʇɔǝɾqo ʇuɐʇsᴉp sǝʞɐɯ ɥɔᴉɥʍ ʇɔǝɟɟǝ ꞁɐnsᴉΛ +options.mipmapLevels.tooltip.5=sꞁᴉɐʇǝp ǝɹnʇxǝʇ ǝɥʇ ƃuᴉɥʇooɯs ʎq +options.mipmapLevels.tooltip.4=ƃuᴉɥʇooɯs ou - ℲℲO +options.mipmapLevels.tooltip.3=ƃuᴉɥʇooɯs ɯnɯᴉuᴉɯ - ⥝ +options.mipmapLevels.tooltip.2=ƃuᴉɥʇooɯs ɯnɯᴉxɐɯ - ɯnɯᴉxɐW +options.mipmapLevels.tooltip.1=˙ǝɔuɐɯɹoɟɹǝd ǝɥʇ ʇɔǝɟɟɐ ʇou sǝop ʎꞁꞁɐnsn uoᴉʇdo sᴉɥ⟘ + +of.options.MIPMAP_TYPE=ǝdʎ⟘ dɐɯdᴉW +of.options.MIPMAP_TYPE.tooltip.6=ɹǝʇʇǝq ʞooꞁ sʇɔǝɾqo ʇuɐʇsᴉp sǝʞɐɯ ɥɔᴉɥʍ ʇɔǝɟɟǝ ꞁɐnsᴉΛ +of.options.MIPMAP_TYPE.tooltip.5=sꞁᴉɐʇǝp ǝɹnʇxǝʇ ǝɥʇ ƃuᴉɥʇooɯs ʎq +of.options.MIPMAP_TYPE.tooltip.4=(ʇsǝʇsɐɟ) ƃuᴉɥʇooɯs ɥƃnoɹ - ʇsǝɹɐǝN +of.options.MIPMAP_TYPE.tooltip.3=ƃuᴉɥʇooɯs ꞁɐɯɹou - ɹɐǝuᴉ˥ +of.options.MIPMAP_TYPE.tooltip.2=ƃuᴉɥʇooɯs ǝuᴉɟ - ɹɐǝuᴉꞁᴉq +of.options.MIPMAP_TYPE.tooltip.1=(ʇsǝʍoꞁs) ƃuᴉɥʇooɯs ʇsǝuᴉɟ - ɹɐǝuᴉꞁᴉɹ⟘ + + +of.options.AA_LEVEL=ƃuᴉsɐᴉꞁɐᴉʇu∀ +of.options.AA_LEVEL.tooltip.8=ƃuᴉsɐᴉꞁɐᴉʇu∀ +of.options.AA_LEVEL.tooltip.7=(ɹǝʇsɐɟ) ƃuᴉsɐᴉꞁɐᴉʇuɐ ou (ʇꞁnɐɟǝp) - ℲℲO +of.options.AA_LEVEL.tooltip.6=(ɹǝʍoꞁs) sǝƃpǝ puɐ sǝuᴉꞁ pǝsɐᴉꞁɐᴉʇuɐ - 9⥝-ᘔ +of.options.AA_LEVEL.tooltip.5= puɐ sǝuᴉꞁ pǝƃƃɐɾ sɥʇooɯs ƃuᴉsɐᴉꞁɐᴉʇu∀ ǝɥ⟘ +of.options.AA_LEVEL.tooltip.4=˙suoᴉʇᴉsuɐɹʇ ɹnoꞁoɔ dɹɐɥs +of.options.AA_LEVEL.tooltip.3=˙SԀℲ ǝɥʇ ǝsɐǝɹɔǝp ʎꞁꞁɐᴉʇuɐʇsqns ʎɐɯ ʇᴉ pǝꞁqɐuǝ uǝɥM +of.options.AA_LEVEL.tooltip.2=˙spɹɐɔ sɔᴉɥdɐɹƃ ꞁꞁɐ ʎq pǝʇɹoddns ǝɹɐ sꞁǝʌǝꞁ ꞁꞁɐ ʇoN +of.options.AA_LEVEL.tooltip.1=¡⟘ɹ∀⟘SƎɹ ɐ ɹǝʇɟɐ ǝʌᴉʇɔǝɟɟƎ + +of.options.AF_LEVEL=ƃuᴉɹǝʇꞁᴉℲ ɔᴉdoɹʇosᴉu∀ +of.options.AF_LEVEL.tooltip.6=ƃuᴉɹǝʇꞁᴉℲ ɔᴉdoɹʇosᴉu∀ +of.options.AF_LEVEL.tooltip.5=(ɹǝʇsɐɟ) ꞁᴉɐʇǝp ǝɹnʇxǝʇ pɹɐpuɐʇs (ʇꞁnɐɟǝp) - ℲℲO +of.options.AF_LEVEL.tooltip.4=(ɹǝʍoꞁs) sǝɹnʇxǝʇ pǝddɐɯdᴉɯ uᴉ sꞁᴉɐʇǝp ɹǝuᴉɟ - 9⥝-ᘔ +of.options.AF_LEVEL.tooltip.3=uᴉ sꞁᴉɐʇǝp sǝɹoʇsǝɹ ƃuᴉɹǝʇꞁᴉℲ ɔᴉdoɹʇosᴉu∀ ǝɥ⟘ +of.options.AF_LEVEL.tooltip.2=˙sǝɹnʇxǝʇ pǝddɐɯdᴉɯ +of.options.AF_LEVEL.tooltip.1=˙SԀℲ ǝɥʇ ǝsɐǝɹɔǝp ʎꞁꞁɐᴉʇuɐʇsqns ʎɐɯ ʇᴉ pǝꞁqɐuǝ uǝɥM + +of.options.CLEAR_WATER=ɹǝʇɐM ɹɐǝꞁƆ +of.options.CLEAR_WATER.tooltip.3=ɹǝʇɐM ɹɐǝꞁƆ +of.options.CLEAR_WATER.tooltip.2=ɹǝʇɐʍ ʇuǝɹɐdsuɐɹʇ 'ɹɐǝꞁɔ - NO +of.options.CLEAR_WATER.tooltip.1=ɹǝʇɐʍ ʇꞁnɐɟǝp - ℲℲO + +of.options.RANDOM_ENTITIES=sǝᴉʇᴉʇuƎ ɯopuɐᴚ +of.options.RANDOM_ENTITIES.tooltip.5=sǝᴉʇᴉʇuƎ ɯopuɐᴚ +of.options.RANDOM_ENTITIES.tooltip.4=ɹǝʇsɐɟ 'sǝᴉʇᴉʇuǝ ɯopuɐɹ ou - ℲℲO +of.options.RANDOM_ENTITIES.tooltip.3=ɹǝʍoꞁs 'sǝᴉʇᴉʇuǝ ɯopuɐɹ - NO +of.options.RANDOM_ENTITIES.tooltip.2=˙sǝᴉʇᴉʇuǝ ǝɯɐƃ ǝɥʇ ɹoɟ sǝɹnʇxǝʇ ɯopuɐɹ sǝsn sǝᴉʇᴉʇuǝ ɯopuɐᴚ +of.options.RANDOM_ENTITIES.tooltip.1=˙sǝɹnʇxǝʇ ʎʇᴉʇuǝ ǝꞁdᴉʇꞁnɯ sɐɥ ɥɔᴉɥʍ ʞɔɐd ǝɔɹnosǝɹ ɐ spǝǝu ʇI + +of.options.BETTER_GRASS=ssɐɹפ ɹǝʇʇǝᗺ +of.options.BETTER_GRASS.tooltip.4=ssɐɹפ ɹǝʇʇǝᗺ +of.options.BETTER_GRASS.tooltip.3=ʇsǝʇsɐɟ 'ǝɹnʇxǝʇ ssɐɹƃ ǝpᴉs ʇꞁnɐɟǝp - ℲℲO +of.options.BETTER_GRASS.tooltip.2=ɹǝʍoꞁs 'ǝɹnʇxǝʇ ssɐɹƃ ǝpᴉs ꞁꞁnɟ - ʇsɐℲ +of.options.BETTER_GRASS.tooltip.1=ʇsǝʍoꞁs 'ǝɹnʇxǝʇ ssɐɹƃ ǝpᴉs ɔᴉɯɐuʎp - ʎɔuɐℲ + +of.options.BETTER_SNOW=ʍouS ɹǝʇʇǝᗺ +of.options.BETTER_SNOW.tooltip.5=ʍouS ɹǝʇʇǝᗺ +of.options.BETTER_SNOW.tooltip.4=ɹǝʇsɐɟ 'ʍous ʇꞁnɐɟǝp - ℲℲO +of.options.BETTER_SNOW.tooltip.3=ɹǝʍoꞁs 'ʍous ɹǝʇʇǝq - NO +of.options.BETTER_SNOW.tooltip.2=(ssɐɹƃ ꞁꞁɐʇ 'ǝɔuǝɟ) sʞɔoꞁq ʇuǝɹɐdsuɐɹʇ ɹǝpun ʍous sʍoɥS +of.options.BETTER_SNOW.tooltip.1=˙sʞɔoꞁq ʍous ɥʇᴉʍ ƃuᴉɹǝpɹoq uǝɥʍ + +of.options.CUSTOM_FONTS=sʇuoℲ ɯoʇsnƆ +of.options.CUSTOM_FONTS.tooltip.5=sʇuoℲ ɯoʇsnƆ +of.options.CUSTOM_FONTS.tooltip.4=ɹǝʍoꞁs '(ʇꞁnɐɟǝp) sʇuoɟ ɯoʇsnɔ sǝsn - NO +of.options.CUSTOM_FONTS.tooltip.3=ɹǝʇsɐɟ 'ʇuoɟ ʇꞁnɐɟǝp sǝsn - ℲℲO +of.options.CUSTOM_FONTS.tooltip.2=ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sʇuoɟ ɯoʇsnɔ ǝɥ⟘ +of.options.CUSTOM_FONTS.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ + +of.options.CUSTOM_COLORS=sɹnoꞁoƆ ɯoʇsnƆ +of.options.CUSTOM_COLORS.tooltip.5=sɹnoꞁoƆ ɯoʇsnƆ +of.options.CUSTOM_COLORS.tooltip.4=ɹǝʍoꞁs '(ʇꞁnɐɟǝp) sɹnoꞁoɔ ɯoʇsnɔ sǝsn - NO +of.options.CUSTOM_COLORS.tooltip.3=ɹǝʇsɐɟ ' sɹnoꞁoɔ ʇꞁnɐɟǝp sǝsn - ℲℲO +of.options.CUSTOM_COLORS.tooltip.2=ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sɹnoꞁoɔ ɯoʇsnɔ ǝɥ⟘ +of.options.CUSTOM_COLORS.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ + +of.options.SWAMP_COLORS=sɹnoꞁoƆ dɯɐʍS +of.options.SWAMP_COLORS.tooltip.4=sɹnoꞁoƆ dɯɐʍS +of.options.SWAMP_COLORS.tooltip.3=ɹǝʍoꞁs '(ʇꞁnɐɟǝp) sɹnoꞁoɔ dɯɐʍs ǝsn - NO +of.options.SWAMP_COLORS.tooltip.2=ɹǝʇsɐɟ 'sɹnoꞁoɔ dɯɐʍs ǝsn ʇou op - ℲℲO +of.options.SWAMP_COLORS.tooltip.1=˙ɹǝʇɐʍ puɐ sǝuᴉʌ 'sǝʌɐǝꞁ 'ssɐɹƃ ʇɔǝɟɟɐ sɹnoꞁoɔ dɯɐʍs ǝɥ⟘ + +of.options.SMOOTH_BIOMES=sǝɯoᴉq ɥʇooɯS +of.options.SMOOTH_BIOMES.tooltip.6=sǝɯoᴉq ɥʇooɯS +of.options.SMOOTH_BIOMES.tooltip.5=ɹǝʍoꞁs '(ʇꞁnɐɟǝp) sɹǝpɹoq ǝɯoᴉq ɟo ƃuᴉɥʇooɯs - NO +of.options.SMOOTH_BIOMES.tooltip.4=ɹǝʇsɐɟ 'sɹǝpɹoq ǝɯoᴉq ɟo ƃuᴉɥʇooɯs ou - ℲℲO +of.options.SMOOTH_BIOMES.tooltip.3=puɐ ƃuᴉꞁdɯɐs ʎq ǝuop sᴉ sɹǝpɹoq ǝɯoᴉq ɟo ƃuᴉɥʇooɯs ǝɥ⟘ +of.options.SMOOTH_BIOMES.tooltip.2=˙sʞɔoꞁq ƃuᴉpunoɹɹns ꞁꞁɐ ɟo ɹnoꞁoɔ ǝɥʇ ƃuᴉƃɐɹǝʌɐ +of.options.SMOOTH_BIOMES.tooltip.1=˙ɹǝʇɐʍ puɐ sǝuᴉʌ 'sǝʌɐǝꞁ 'ssɐɹƃ ǝɹɐ pǝʇɔǝɟɟ∀ + +of.options.CONNECTED_TEXTURES=sǝɹnʇxǝ⟘ pǝʇɔǝuuoƆ +of.options.CONNECTED_TEXTURES.tooltip.8=sǝɹnʇxǝ⟘ pǝʇɔǝuuoƆ +of.options.CONNECTED_TEXTURES.tooltip.7=(ʇꞁnɐɟǝp) sǝɹnʇxǝʇ pǝʇɔǝuuoɔ ou - ℲℲO +of.options.CONNECTED_TEXTURES.tooltip.6=sǝɹnʇxǝʇ pǝʇɔǝuuoɔ ʇsɐɟ - ʇsɐℲ +of.options.CONNECTED_TEXTURES.tooltip.5=sǝɹnʇxǝʇ pǝʇɔǝuuoɔ ʎɔuɐɟ - ʎɔuɐℲ +of.options.CONNECTED_TEXTURES.tooltip.4='ssɐꞁƃ ɟo sǝɹnʇxǝʇ ǝɥʇ suᴉoɾ sǝɹnʇxǝʇ pǝʇɔǝuuoƆ +of.options.CONNECTED_TEXTURES.tooltip.3=oʇ ʇxǝu pǝɔɐꞁd uǝɥʍ sǝʌꞁǝɥsʞooq puɐ ǝuoʇspuɐs +of.options.CONNECTED_TEXTURES.tooltip.2=pǝᴉꞁddns ǝɹɐ sǝɹnʇxǝʇ pǝʇɔǝuuoɔ ǝɥ⟘ ˙ɹǝɥʇo ɥɔɐǝ +of.options.CONNECTED_TEXTURES.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ ʇuǝɹɹnɔ ǝɥʇ ʎq + +of.options.NATURAL_TEXTURES=sǝɹnʇxǝ⟘ ꞁɐɹnʇɐN +of.options.NATURAL_TEXTURES.tooltip.8=sǝɹnʇxǝ⟘ ꞁɐɹnʇɐN +of.options.NATURAL_TEXTURES.tooltip.7=(ʇꞁnɐɟǝp) sǝɹnʇxǝʇ ꞁɐɹnʇɐu ou - ℲℲO +of.options.NATURAL_TEXTURES.tooltip.6=sǝɹnʇxǝʇ ꞁɐɹnʇɐu ǝsn - NO +of.options.NATURAL_TEXTURES.tooltip.5=uɹǝʇʇɐd ǝʞᴉꞁpᴉɹƃ ǝɥʇ ǝʌoɯǝɹ sǝɹnʇxǝʇ ꞁɐɹnʇɐN +of.options.NATURAL_TEXTURES.tooltip.4=˙ǝdʎʇ ǝɯɐs ǝɥʇ ɟo sʞɔoꞁq ƃuᴉʇɐǝdǝɹ ʎq pǝʇɐǝɹɔ +of.options.NATURAL_TEXTURES.tooltip.3=ǝsɐq ǝɥʇ ɟo sʇuɐᴉɹɐʌ pǝddᴉꞁɟ puɐ pǝʇɐʇoɹ sǝsn ʇI +of.options.NATURAL_TEXTURES.tooltip.2=ꞁɐɹnʇɐu ǝɥʇ ɹoɟ uoᴉʇɐɹnƃᴉɟuoɔ ǝɥ⟘ ˙ǝɹnʇxǝʇ ʞɔoꞁq +of.options.NATURAL_TEXTURES.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns sᴉ sǝɹnʇxǝʇ + +of.options.EMISSIVE_TEXTURES=sǝɹnʇxǝ⟘ ǝʌᴉssᴉɯƎ +of.options.EMISSIVE_TEXTURES.tooltip.8=sǝɹnʇxǝ⟘ ǝʌᴉssᴉɯƎ +of.options.EMISSIVE_TEXTURES.tooltip.7=(ʇꞁnɐɟǝp) sǝɹnʇxǝʇ ǝʌᴉssᴉɯǝ ou - ℲℲO +of.options.EMISSIVE_TEXTURES.tooltip.6=sǝɹnʇxǝʇ ǝʌᴉssᴉɯǝ ǝsn - NO +of.options.EMISSIVE_TEXTURES.tooltip.5=sʎɐꞁɹǝʌo sɐ pǝɹǝpuǝɹ ǝɹɐ sǝɹnʇxǝʇ ǝʌᴉssᴉɯǝ ǝɥ⟘ +of.options.EMISSIVE_TEXTURES.tooltip.4=ǝʇɐꞁnɯᴉs oʇ pǝsn ǝq uɐɔ ʎǝɥ⟘ ˙ssǝuʇɥƃᴉɹq ꞁꞁnɟ ɥʇᴉʍ +of.options.EMISSIVE_TEXTURES.tooltip.3=˙ǝɹnʇxǝʇ ǝsɐq ǝɥʇ ɟo sʇɹɐd ƃuᴉʇʇᴉɯǝ ʇɥƃᴉꞁ +of.options.EMISSIVE_TEXTURES.tooltip.2=ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sǝɹnʇxǝʇ ǝʌᴉssᴉɯǝ ǝɥ⟘ +of.options.EMISSIVE_TEXTURES.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ + +of.options.CUSTOM_SKY=ʎʞS ɯoʇsnƆ +of.options.CUSTOM_SKY.tooltip.5=ʎʞS ɯoʇsnƆ +of.options.CUSTOM_SKY.tooltip.4=ʍoꞁs '(ʇꞁnɐɟǝp) sǝɹnʇxǝʇ ʎʞs ɯoʇsnɔ - NO +of.options.CUSTOM_SKY.tooltip.3=ɹǝʇsɐɟ 'ʎʞs ʇꞁnɐɟǝp - ℲℲO +of.options.CUSTOM_SKY.tooltip.2=ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sǝɹnʇxǝʇ ʎʞs ɯoʇsnɔ ǝɥ⟘ +of.options.CUSTOM_SKY.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ + +of.options.CUSTOM_ITEMS=sɯǝʇI ɯoʇsnƆ +of.options.CUSTOM_ITEMS.tooltip.5=sɯǝʇI ɯoʇsnƆ +of.options.CUSTOM_ITEMS.tooltip.4=ʍoꞁs '(ʇꞁnɐɟǝp) sǝɹnʇxǝʇ ɯǝʇᴉ ɯoʇsnɔ - NO +of.options.CUSTOM_ITEMS.tooltip.3=ɹǝʇsɐɟ 'sǝɹnʇxǝʇ ɯǝʇᴉ ʇꞁnɐɟǝp - ℲℲO +of.options.CUSTOM_ITEMS.tooltip.2=ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sǝɹnʇxǝʇ ɯǝʇᴉ ɯoʇsnɔ ǝɥ⟘ +of.options.CUSTOM_ITEMS.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ + +of.options.CUSTOM_ENTITY_MODELS=sꞁǝpoW ʎʇᴉʇuƎ ɯoʇsnƆ +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=sꞁǝpoW ʎʇᴉʇuƎ ɯoʇsnƆ +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=ʍoꞁs '(ʇꞁnɐɟǝp) sꞁǝpoɯ ʎʇᴉʇuǝ ɯoʇsnɔ - NO +of.options.CUSTOM_ENTITY_MODELS.tooltip.3=ɹǝʇsɐɟ 'sꞁǝpoɯ ʎʇᴉʇuǝ ʇꞁnɐɟǝp - ℲℲO +of.options.CUSTOM_ENTITY_MODELS.tooltip.2=ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sꞁǝpoɯ ʎʇᴉʇuǝ ɯoʇsnɔ ǝɥ⟘ +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ + +of.options.CUSTOM_GUIS=sI∩פ ɯoʇsnƆ +of.options.CUSTOM_GUIS.tooltip.4=sI∩פ ɯoʇsnƆ +of.options.CUSTOM_GUIS.tooltip.3=ɹǝʍoꞁs '(ʇꞁnɐɟǝp) sI∩פ ɯoʇsnɔ - NO +of.options.CUSTOM_GUIS.tooltip.2=ɹǝʇsɐɟ 'sI∩פ ʇꞁnɐɟǝp - ℲℲO +of.options.CUSTOM_GUIS.tooltip.1=˙ʞɔɐd ǝɔɹnosǝɹ ʇuǝɹɹnɔ ǝɥʇ ʎq pǝᴉꞁddns ǝɹɐ sI∩פ ɯoʇsnɔ ǝɥ⟘ + +# Details + +of.options.CLOUDS=spnoꞁƆ +of.options.CLOUDS.tooltip.7=spnoꞁƆ +of.options.CLOUDS.tooltip.6=sɔᴉɥdɐɹפ ƃuᴉʇʇǝs ʎq ʇǝs sɐ - ʇꞁnɐɟǝp +of.options.CLOUDS.tooltip.5=ɹǝʇsɐɟ 'ʎʇᴉꞁɐnb ɹǝʍoꞁ - ʇsɐℲ +of.options.CLOUDS.tooltip.4=ɹǝʍoꞁs 'ʎʇᴉꞁɐnb ɹǝɥƃᴉɥ - ʎɔuɐℲ +of.options.CLOUDS.tooltip.3=ʇsǝʇsɐɟ 'spnoꞁɔ ou - ℲℲO +of.options.CLOUDS.tooltip.2=˙pᘔ pǝɹǝpuǝɹ ǝɹɐ spnoꞁɔ ʇsɐℲ +of.options.CLOUDS.tooltip.1=˙pƐ pǝɹǝpuǝɹ ǝɹɐ spnoꞁɔ ʎɔuɐℲ + +of.options.CLOUD_HEIGHT=ʇɥƃᴉǝH pnoꞁƆ +of.options.CLOUD_HEIGHT.tooltip.3=ʇɥƃᴉǝH pnoꞁƆ +of.options.CLOUD_HEIGHT.tooltip.2=ʇɥƃᴉǝɥ ʇꞁnɐɟǝp - ℲℲO +of.options.CLOUD_HEIGHT.tooltip.1=ʇᴉɯᴉꞁ ʇɥƃᴉǝɥ pꞁɹoʍ ǝʌoqɐ - %%00⥝ + +of.options.TREES=sǝǝɹ⟘ +of.options.TREES.tooltip.7=sǝǝɹ⟘ +of.options.TREES.tooltip.6=sɔᴉɥdɐɹפ ƃuᴉʇʇǝs ʎq ʇǝs sɐ - ʇꞁnɐɟǝp +of.options.TREES.tooltip.5=ɹǝʇsɐɟ 'ʎʇᴉꞁɐnb ɹǝʍoꞁ - ʇsɐℲ +of.options.TREES.tooltip.4=ʇsɐɟ 'ʎʇᴉꞁɐnb ɹǝɥƃᴉɥ - ʇɹɐɯS +of.options.TREES.tooltip.3=ɹǝʍoꞁs 'ʎʇᴉꞁɐnb ʇsǝɥƃᴉɥ - ʎɔuɐℲ +of.options.TREES.tooltip.2=˙sǝʌɐǝꞁ ǝnbɐdo ǝʌɐɥ sǝǝɹʇ ʇsɐℲ +of.options.TREES.tooltip.1=˙sǝʌɐǝꞁ ʇuǝɹɐdsuɐɹʇ ǝʌɐɥ sǝǝɹʇ ʇɹɐɯs puɐ ʎɔuɐℲ + +of.options.RAIN=ʍouS ⅋ uᴉɐᴚ +of.options.RAIN.tooltip.7=ʍouS ⅋ uᴉɐᴚ +of.options.RAIN.tooltip.6=sɔᴉɥdɐɹפ ƃuᴉʇʇǝs ʎq ʇǝs sɐ - ʇꞁnɐɟǝp +of.options.RAIN.tooltip.5=ɹǝʇsɐɟ 'ʍous/uᴉɐɹ ʇɥƃᴉꞁ - ʇsɐℲ +of.options.RAIN.tooltip.4=ɹǝʍoꞁs 'ʍous/uᴉɐɹ ʎʌɐǝɥ - ʎɔuɐℲ +of.options.RAIN.tooltip.3=ʇsǝʇsɐɟ 'ʍous/uᴉɐɹ ou - ℲℲO +of.options.RAIN.tooltip.2=spunos uᴉɐɹ puɐ sǝɥsɐꞁds ǝɥʇ ℲℲO sᴉ uᴉɐɹ uǝɥM +of.options.RAIN.tooltip.1=˙ǝʌᴉʇɔɐ ꞁꞁᴉʇs ǝɹɐ + +of.options.SKY=ʎʞS +of.options.SKY.tooltip.4=ʎʞS +of.options.SKY.tooltip.3=ɹǝʍoꞁs 'ǝꞁqᴉsᴉʌ sᴉ ʎʞs - NO +of.options.SKY.tooltip.2=ɹǝʇsɐɟ 'ǝꞁqᴉsᴉʌ ʇou sᴉ ʎʞs - ℲℲO +of.options.SKY.tooltip.1=˙ǝꞁqᴉsᴉʌ ꞁꞁᴉʇs ǝɹɐ uns puɐ uooɯ ǝɥʇ ℲℲO sᴉ ʎʞs uǝɥM + +of.options.STARS=sɹɐʇS +of.options.STARS.tooltip.3=sɹɐʇS +of.options.STARS.tooltip.2=ɹǝʍoꞁs 'ǝꞁqᴉsᴉʌ ǝɹɐ sɹɐʇs - NO +of.options.STARS.tooltip.1=ɹǝʇsɐɟ 'ǝꞁqᴉsᴉʌ ʇou ǝɹɐ sɹɐʇs - ℲℲO + +of.options.SUN_MOON=uooW ⅋ unS +of.options.SUN_MOON.tooltip.3=uooW ⅋ unS +of.options.SUN_MOON.tooltip.2=(ʇꞁnɐɟǝp) ǝꞁqᴉsᴉʌ ǝɹɐ uooɯ puɐ uns - NO +of.options.SUN_MOON.tooltip.1=(ɹǝʇsɐɟ) ǝꞁqᴉsᴉʌ ʇou ǝɹɐ uooɯ puɐ uns - ℲℲO + +of.options.SHOW_CAPES=sǝdɐƆ ʍoɥS +of.options.SHOW_CAPES.tooltip.3=sǝdɐƆ ʍoɥS +of.options.SHOW_CAPES.tooltip.2=(ʇꞁnɐɟǝp) sǝdɐɔ ɹǝʎɐꞁd ʍoɥs - NO +of.options.SHOW_CAPES.tooltip.1=sǝdɐɔ ɹǝʎɐꞁd ʍoɥs ʇou op - ℲℲO + +of.options.TRANSLUCENT_BLOCKS=sʞɔoꞁq ʇuǝɔnꞁsuɐɹ⟘ +of.options.TRANSLUCENT_BLOCKS.tooltip.7=sʞɔoꞁq ʇuǝɔnꞁsuɐɹ⟘ +of.options.TRANSLUCENT_BLOCKS.tooltip.6=sɔᴉɥdɐɹפ ƃuᴉʇʇǝs ʎq ʇǝs sɐ - ʇꞁnɐɟǝp +of.options.TRANSLUCENT_BLOCKS.tooltip.5=(ɹǝʍoꞁs) ƃuᴉpuǝꞁq ɹnoꞁoɔ ʇɔǝɹɹoɔ - ʎɔuɐℲ +of.options.TRANSLUCENT_BLOCKS.tooltip.4=(ɹǝʇsɐɟ) ƃuᴉpuǝꞁq ɹnoꞁoɔ ʇsɐɟ - ʇsɐℲ +of.options.TRANSLUCENT_BLOCKS.tooltip.3=sʞɔoꞁq ʇuǝɔnꞁsuɐɹʇ ɟo ƃuᴉpuǝꞁq ɹnoꞁoɔ ǝɥʇ sꞁoɹʇuoƆ +of.options.TRANSLUCENT_BLOCKS.tooltip.2=(ǝɔᴉ 'ɹǝʇɐʍ 'ssɐꞁƃ pǝuᴉɐʇs) sɹnoꞁoɔ ʇuǝɹǝɟɟᴉp ɥʇᴉʍ +of.options.TRANSLUCENT_BLOCKS.tooltip.1=˙ɯǝɥʇ uǝǝʍʇǝq ɹᴉɐ ɥʇᴉʍ ɹǝɥʇo ɥɔɐǝ puᴉɥǝq pǝɔɐꞁd uǝɥʍ + +of.options.HELD_ITEM_TOOLTIPS=sdᴉʇꞁoo⟘ ɯǝʇI pꞁǝH +of.options.HELD_ITEM_TOOLTIPS.tooltip.3=sdᴉʇꞁooʇ ɯǝʇᴉ pꞁǝH +of.options.HELD_ITEM_TOOLTIPS.tooltip.2=(ʇꞁnɐɟǝp) sɯǝʇᴉ pꞁǝɥ ɹoɟ sdᴉʇꞁooʇ ʍoɥs - NO +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=sɯǝʇᴉ pꞁǝɥ ɹoɟ sdᴉʇꞁooʇ ʍoɥs ʇou op - ℲℲO + +of.options.ADVANCED_TOOLTIPS=sdᴉʇꞁoo⟘ pǝɔuɐʌp∀ +of.options.ADVANCED_TOOLTIPS.tooltip.6=sdᴉʇꞁooʇ pǝɔuɐʌp∀ +of.options.ADVANCED_TOOLTIPS.tooltip.5= sdᴉʇꞁooʇ pǝɔuɐʌpɐ ʍoɥs - NO +of.options.ADVANCED_TOOLTIPS.tooltip.4=(ʇꞁnɐɟǝp) sdᴉʇꞁooʇ pǝɔuɐʌpɐ ʍoɥs ʇou op - ℲℲO +of.options.ADVANCED_TOOLTIPS.tooltip.3=ɹoɟ uoᴉʇɐɯɹoɟuᴉ pǝpuǝʇxǝ ʍoɥs sdᴉʇꞁooʇ pǝɔuɐʌp∀ +of.options.ADVANCED_TOOLTIPS.tooltip.2=suoᴉʇdo ɹǝpɐɥs ɹoɟ puɐ (ʎʇᴉꞁᴉqɐɹnp 'pᴉ) sɯǝʇᴉ +of.options.ADVANCED_TOOLTIPS.tooltip.1=˙(ǝnꞁɐʌ ʇꞁnɐɟǝp 'ǝɔɹnos 'pᴉ) + +of.options.DROPPED_ITEMS=sɯǝʇI pǝddoɹp +of.options.DROPPED_ITEMS.tooltip.4=sɯǝʇI pǝddoɹp +of.options.DROPPED_ITEMS.tooltip.3=sɔᴉɥdɐɹפ ƃuᴉʇʇǝs ʎq ʇǝs sɐ - ʇꞁnɐɟǝp +of.options.DROPPED_ITEMS.tooltip.2=(ɹǝʇsɐɟ) sɯǝʇᴉ pǝddoɹp pᘔ - ʇsɐℲ +of.options.DROPPED_ITEMS.tooltip.1=(ɹǝʍoꞁs) sɯǝʇᴉ pǝddoɹp pƐ - ʎɔuɐℲ + +options.entityShadows.tooltip.3=sʍopɐɥS ʎʇᴉʇuƎ +options.entityShadows.tooltip.2=sʍopɐɥs ʎʇᴉʇuǝ ʍoɥs - NO +options.entityShadows.tooltip.1=sʍopɐɥs ʎʇᴉʇuǝ ʍoɥs ʇou op - ℲℲO + +of.options.VIGNETTE=ǝʇʇǝuƃᴉΛ +of.options.VIGNETTE.tooltip.8=sɹǝuɹoɔ uǝǝɹɔs ǝɥʇ suǝʞɹɐp ʎꞁʇɥƃᴉꞁs ɥɔᴉɥʍ ʇɔǝɟɟǝ ꞁɐnsᴉΛ +of.options.VIGNETTE.tooltip.7=(ʇꞁnɐɟǝp) sɔᴉɥdɐɹפ ƃuᴉʇʇǝs ǝɥʇ ʎq ʇǝs sɐ - ʇꞁnɐɟǝp +of.options.VIGNETTE.tooltip.6=(ɹǝʇsɐɟ) pǝꞁqɐsᴉp ǝʇʇǝuƃᴉʌ - ʇsɐℲ +of.options.VIGNETTE.tooltip.5=(ɹǝʍoꞁs) pǝꞁqɐuǝ ǝʇʇǝuƃᴉʌ - ʎɔuɐℲ +of.options.VIGNETTE.tooltip.4='SԀℲ ǝɥʇ uo ʇɔǝɟɟǝ ʇuɐɔᴉɟᴉuƃᴉs ɐ ǝʌɐɥ ʎɐɯ ǝʇʇǝuƃᴉʌ ǝɥ⟘ +of.options.VIGNETTE.tooltip.3=˙uǝǝɹɔsꞁꞁnɟ ƃuᴉʎɐꞁd uǝɥʍ ʎꞁꞁɐᴉɔǝdsǝ +of.options.VIGNETTE.tooltip.2=ʎꞁǝɟɐs uɐɔ puɐ ǝꞁʇqns ʎɹǝʌ sᴉ ʇɔǝɟɟǝ ǝʇʇǝuƃᴉʌ ǝɥ⟘ +of.options.VIGNETTE.tooltip.1=˙pǝꞁqɐsᴉp ǝq + +of.options.DYNAMIC_FOV=ΛoℲ ɔᴉɯɐuʎp +of.options.DYNAMIC_FOV.tooltip.5=ΛoℲ ɔᴉɯɐuʎp +of.options.DYNAMIC_FOV.tooltip.4=(ʇꞁnɐɟǝp) ΛoℲ ɔᴉɯɐuʎp ǝꞁqɐuǝ - NO +of.options.DYNAMIC_FOV.tooltip.3=ΛoℲ ɔᴉɯɐuʎp ǝꞁqɐsᴉp - ℲℲO +of.options.DYNAMIC_FOV.tooltip.2= ƃuᴉʇuᴉɹds 'ƃuᴉʎꞁɟ uǝɥʍ (ΛoℲ) ʍǝᴉʌ ɟo pꞁǝᴉɟ ǝɥʇ sǝƃuɐɥƆ +of.options.DYNAMIC_FOV.tooltip.1=˙ʍoq ɐ ƃuᴉꞁꞁnd ɹo + +of.options.DYNAMIC_LIGHTS=sʇɥƃᴉ˥ ɔᴉɯɐuʎp +of.options.DYNAMIC_LIGHTS.tooltip.7=sʇɥƃᴉ˥ ɔᴉɯɐuʎp +of.options.DYNAMIC_LIGHTS.tooltip.6=(ʇꞁnɐɟǝp) sʇɥƃᴉꞁ ɔᴉɯɐuʎp ou - ℲℲO +of.options.DYNAMIC_LIGHTS.tooltip.5=(sɯ00ϛ ʎɹǝʌǝ pǝʇɐpdn) sʇɥƃᴉꞁ ɔᴉɯɐuʎp ʇsɐɟ - ʇsɐℲ +of.options.DYNAMIC_LIGHTS.tooltip.4=(ǝɯᴉʇ-ꞁɐǝɹ uᴉ pǝʇɐpdn) sʇɥƃᴉꞁ ɔᴉɯɐuʎp ʎɔuɐɟ - ʎɔuɐℲ +of.options.DYNAMIC_LIGHTS.tooltip.3=(˙ɔʇǝ 'ǝuoʇsʍoꞁƃ 'ɥɔɹoʇ) sɯǝʇᴉ ƃuᴉʇʇᴉɯǝ ʇɥƃᴉꞁ sǝꞁqɐuƎ +of.options.DYNAMIC_LIGHTS.tooltip.2='puɐɥ uᴉ pꞁǝɥ uǝɥʍ ɯǝɥʇ punoɹɐ ƃuᴉɥʇʎɹǝʌǝ ǝʇɐuᴉɯnꞁꞁᴉ oʇ +of.options.DYNAMIC_LIGHTS.tooltip.1=˙punoɹƃ ǝɥʇ uo pǝddoɹp ɹo ɹǝʎɐꞁd ɹǝɥʇo ʎq pǝddᴉnbǝ + +# Performance + +of.options.SMOOTH_FPS=SԀℲ ɥʇooɯS +of.options.SMOOTH_FPS.tooltip.5=˙sɹǝɟɟnq ɹǝʌᴉɹp ɔᴉɥdɐɹƃ ǝɥʇ ƃuᴉɥsnꞁɟ ʎq SԀℲ sǝsᴉꞁᴉqɐʇS +of.options.SMOOTH_FPS.tooltip.4=ǝʇɐnʇɔnꞁɟ ʎɐɯ SԀℲ 'uoᴉʇɐsᴉꞁᴉqɐʇs ou - ℲℲO +of.options.SMOOTH_FPS.tooltip.3=uoᴉʇɐsᴉꞁᴉqɐʇs SԀℲ - NO +of.options.SMOOTH_FPS.tooltip.2=ʇɔǝɟɟǝ sʇᴉ puɐ ʇuɐpuǝdǝp ɹǝʌᴉɹp sɔᴉɥdɐɹƃ sᴉ uoᴉʇdo sᴉɥ⟘ +of.options.SMOOTH_FPS.tooltip.1=˙ǝꞁqᴉsᴉʌ sʎɐʍꞁɐ ʇou sᴉ + +of.options.SMOOTH_WORLD=pꞁɹoM ɥʇooɯS +of.options.SMOOTH_WORLD.tooltip.5=˙ɹǝʌɹǝs ꞁɐuɹǝʇuᴉ ǝɥʇ ʎq pǝsnɐɔ sǝʞᴉds ƃɐꞁ sǝʌoɯǝᴚ +of.options.SMOOTH_WORLD.tooltip.4=ǝʇɐnʇɔnꞁɟ ʎɐɯ SԀℲ 'uoᴉʇɐsᴉꞁᴉqɐʇs ou - ℲℲO +of.options.SMOOTH_WORLD.tooltip.3=uoᴉʇɐsᴉꞁᴉqɐʇs SԀℲ - NO +of.options.SMOOTH_WORLD.tooltip.2=˙pɐoꞁ ɹǝʌɹǝs ꞁɐuɹǝʇuᴉ ǝɥʇ ƃuᴉʇnqᴉɹʇsᴉp ʎq SԀℲ sǝsᴉꞁᴉqɐʇS +of.options.SMOOTH_WORLD.tooltip.1=˙(ɹǝʎɐꞁd ǝꞁƃuᴉs) spꞁɹoʍ ꞁɐɔoꞁ ɹoɟ ʎꞁuo ǝʌᴉʇɔǝɟɟƎ + +of.options.FAST_RENDER=ɹǝpuǝɹ ʇsɐℲ +of.options.FAST_RENDER.tooltip.6=ɹǝpuǝɹ ʇsɐℲ +of.options.FAST_RENDER.tooltip.5=(ʇꞁnɐɟǝp) ƃuᴉɹǝpuǝɹ pɹɐpuɐʇs - ℲℲO +of.options.FAST_RENDER.tooltip.4=(ɹǝʇsɐɟ) ƃuᴉɹǝpuǝɹ pǝsᴉɯᴉʇdo - NO +of.options.FAST_RENDER.tooltip.3=sǝsɐǝɹɔǝp ɥɔᴉɥʍ ɯɥʇᴉɹoƃꞁɐ ƃuᴉɹǝpuǝɹ pǝsᴉɯᴉʇdo sǝs∩ +of.options.FAST_RENDER.tooltip.2=˙SԀℲ ǝɥʇ ǝsɐǝɹɔuᴉ ʎꞁꞁɐᴉʇuɐʇsqns ʎɐɯ puɐ pɐoꞁ ∩Ԁפ ǝɥʇ +of.options.FAST_RENDER.tooltip.1=˙spoɯ ǝɯos ɥʇᴉʍ ʇɔᴉꞁɟuoɔ uɐɔ uoᴉʇdo sᴉɥ⟘ + +of.options.FAST_MATH=sɥʇɐW ʇsɐℲ +of.options.FAST_MATH.tooltip.6=sɥʇɐW ʇsɐℲ +of.options.FAST_MATH.tooltip.5=(ʇꞁnɐɟǝp) sɥʇɐɯ pɹɐpuɐʇs - ℲℲO +of.options.FAST_MATH.tooltip.4=sɥʇɐɯ ɹǝʇsɐɟ - NO +of.options.FAST_MATH.tooltip.3=uɐɔ ɥɔᴉɥʍ suoᴉʇɔunɟ ()soɔ puɐ ()uᴉs pǝsᴉɯᴉʇdo sǝs∩ +of.options.FAST_MATH.tooltip.2=˙SԀℲ ǝɥʇ ǝsɐǝɹɔuᴉ puɐ ǝɥɔɐɔ ∩ԀƆ ǝɥʇ ǝsᴉꞁᴉʇn ɹǝʇʇǝq +of.options.FAST_MATH.tooltip.1=˙uoᴉʇɐɹǝuǝƃ pꞁɹoʍ ǝɥʇ ʇɔǝɟɟɐ ʎꞁꞁɐɯᴉuᴉɯ uɐɔ uoᴉʇdo sᴉɥ⟘ + +of.options.CHUNK_UPDATES=sǝʇɐpd∩ ʞunɥƆ +of.options.CHUNK_UPDATES.tooltip.6=sǝʇɐpdn ʞunɥƆ +of.options.CHUNK_UPDATES.tooltip.5=(ʇꞁnɐɟǝp) SԀℲ ɹǝɥƃᴉɥ 'ƃuᴉpɐoꞁ pꞁɹoʍ ɹǝʍoꞁs - ⥝ +of.options.CHUNK_UPDATES.tooltip.4=SԀℲ ɹǝʍoꞁ 'ƃuᴉpɐoꞁ pꞁɹoʍ ɹǝʇsɐɟ - Ɛ +of.options.CHUNK_UPDATES.tooltip.3=SԀℲ ʇsǝʍoꞁ 'ƃuᴉpɐoꞁ pꞁɹoʍ ʇsǝʇsɐɟ - ϛ +of.options.CHUNK_UPDATES.tooltip.2='ǝɯɐɹɟ pǝɹǝpuǝɹ ɹǝd sǝʇɐpdn ʞunɥɔ ɟo ɹǝqɯnN +of.options.CHUNK_UPDATES.tooltip.1=˙ǝʇɐɹǝɯɐɹɟ ǝɥʇ ǝzᴉꞁᴉqɐʇsǝp ʎɐɯ sǝnꞁɐʌ ɹǝɥƃᴉɥ + +of.options.CHUNK_UPDATES_DYNAMIC=sǝʇɐpd∩ ɔᴉɯɐuʎp +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=sǝʇɐpdn ʞunɥɔ ɔᴉɯɐuʎp +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=(ʇꞁnɐɟǝp) ǝɯɐɹɟ ɹǝd sǝʇɐpdn ʞunɥɔ pɹɐpuɐʇs - ℲℲO +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3=ꞁꞁᴉʇs ƃuᴉpuɐʇs sᴉ ɹǝʎɐꞁd ǝɥʇ ǝꞁᴉɥʍ sǝʇɐpdn ǝɹoɯ - NO +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2=ǝꞁᴉɥʍ sǝʇɐpdn ʞunɥɔ ǝɹoɯ ǝɔɹoɟ sǝʇɐpdn ɔᴉɯɐuʎp +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=˙ɹǝʇsɐɟ pꞁɹoʍ ǝɥʇ pɐoꞁ oʇ ꞁꞁᴉʇs ƃuᴉpuɐʇs sᴉ ɹǝʎɐꞁd ǝɥʇ + +of.options.LAZY_CHUNK_LOADING=ƃuᴉpɐo˥ ʞunɥƆ ʎzɐ˥ +of.options.LAZY_CHUNK_LOADING.tooltip.7=ƃuᴉpɐo˥ ʞunɥƆ ʎzɐ˥ +of.options.LAZY_CHUNK_LOADING.tooltip.6=ƃuᴉpɐoꞁ ʞunɥɔ ɹǝʌɹǝs ʇꞁnɐɟǝp - ℲℲO +of.options.LAZY_CHUNK_LOADING.tooltip.5=(ɹǝɥʇooɯs) ƃuᴉpɐoꞁ ʞunɥɔ ɹǝʌɹǝs ʎzɐꞁ - NO +of.options.LAZY_CHUNK_LOADING.tooltip.4=ʎq ƃuᴉpɐoꞁ ʞunɥɔ ɹǝʌɹǝs pǝʇɐɹƃǝʇuᴉ ǝɥʇ sɥʇooɯS +of.options.LAZY_CHUNK_LOADING.tooltip.3=˙sʞɔᴉʇ ꞁɐɹǝʌǝs ɹǝʌo sʞunɥɔ ǝɥʇ ƃuᴉʇnqᴉɹʇsᴉp +of.options.LAZY_CHUNK_LOADING.tooltip.2=˙ʎꞁʇɔǝɹɹoɔ pɐoꞁ ʇou op pꞁɹoʍ ǝɥʇ ɟo sʇɹɐd ɟᴉ ℲℲO ʇᴉ uɹn⟘ +of.options.LAZY_CHUNK_LOADING.tooltip.1=˙(ɹǝʎɐꞁd-ǝꞁƃuᴉs) spꞁɹoʍ ꞁɐɔoꞁ ɹoɟ ʎꞁuo ǝʌᴉʇɔǝɟɟƎ + +of.options.RENDER_REGIONS=suoᴉƃǝɹ ɹǝpuǝᴚ +of.options.RENDER_REGIONS.tooltip.6=suoᴉƃǝɹ ɹǝpuǝᴚ +of.options.RENDER_REGIONS.tooltip.5=(ʇꞁnɐɟǝp) suoᴉƃǝɹ ɹǝpuǝɹ ǝsn ʇou op - ℲℲO +of.options.RENDER_REGIONS.tooltip.4=suoᴉƃǝɹ ɹǝpuǝɹ ǝsn - NO +of.options.RENDER_REGIONS.tooltip.3=ɹǝɥƃᴉɥ ʇɐ ƃuᴉɹǝpuǝɹ uᴉɐɹɹǝʇ ɹǝʇsɐɟ ʍoꞁꞁɐ suoᴉƃǝɹ ɹǝpuǝᴚ +of.options.RENDER_REGIONS.tooltip.2=˙pǝꞁqɐuǝ ǝɹɐ soqΛ uǝɥʍ ǝʌᴉʇɔǝɟɟǝ ǝɹoW ˙sǝɔuɐʇsᴉp ɹǝpuǝɹ +of.options.RENDER_REGIONS.tooltip.1=˙spɹɐɔ sɔᴉɥdɐɹƃ pǝʇɐɹƃǝʇuᴉ ɹoɟ pǝpuǝɯɯoɔǝɹ ʇoN + +of.options.SMART_ANIMATIONS=suoᴉʇɐɯᴉu∀ ʇɹɐɯS +of.options.SMART_ANIMATIONS.tooltip.7=suoᴉʇɐɯᴉu∀ ʇɹɐɯS +of.options.SMART_ANIMATIONS.tooltip.6=(ʇꞁnɐɟǝp) suoᴉʇɐɯᴉuɐ ʇɹɐɯs ǝsn ʇou op - ℲℲO +of.options.SMART_ANIMATIONS.tooltip.5=suoᴉʇɐɯᴉuɐ ʇɹɐɯs ǝsn - NO +of.options.SMART_ANIMATIONS.tooltip.4= ǝɥʇ ǝʇɐɯᴉuɐ ʎꞁuo ꞁꞁᴉʍ ǝɯɐƃ ǝɥʇ suoᴉʇɐɯᴉuɐ ʇɹɐɯs ɥʇᴉM +of.options.SMART_ANIMATIONS.tooltip.3=˙uǝǝɹɔs ǝɥʇ uo ǝꞁqᴉsᴉʌ ʎꞁʇuǝɹɹnɔ ǝɹɐ ɥɔᴉɥʍ sǝɹnʇxǝʇ +of.options.SMART_ANIMATIONS.tooltip.2=˙SԀℲ ǝɥʇ sǝsɐǝɹɔuᴉ puɐ sǝʞᴉds ƃɐꞁ ʞɔᴉʇ ǝɥʇ sǝɔnpǝɹ sᴉɥ⟘ +of.options.SMART_ANIMATIONS.tooltip.1=˙sʞɔɐd ǝɔɹnosǝɹ pH puɐ sʞɔɐd poɯ ƃᴉq ɹoɟ ꞁnɟǝsn ʎꞁꞁɐᴉɔǝdsƎ + +# Animations + +of.options.animation.allOn=NO ꞁꞁ∀ +of.options.animation.allOff=ℲℲO ꞁꞁ∀ +of.options.animation.dynamic=ɔᴉɯɐuʎp + +of.options.ANIMATED_WATER=pǝʇɐɯᴉu∀ ɹǝʇɐM +of.options.ANIMATED_LAVA=pǝʇɐɯᴉu∀ ɐʌɐ˥ +of.options.ANIMATED_FIRE=pǝʇɐɯᴉu∀ ǝɹᴉℲ +of.options.ANIMATED_PORTAL=pǝʇɐɯᴉu∀ ꞁɐʇɹoԀ +of.options.ANIMATED_REDSTONE=pǝʇɐɯᴉu∀ ǝuoʇspǝᴚ +of.options.ANIMATED_EXPLOSION=pǝʇɐɯᴉu∀ uoᴉsoꞁdxƎ +of.options.ANIMATED_FLAME=pǝʇɐɯᴉu∀ ǝɯɐꞁℲ +of.options.ANIMATED_SMOKE=pǝʇɐɯᴉu∀ ǝʞoɯS +of.options.VOID_PARTICLES=sǝꞁɔᴉʇɹɐԀ pᴉoΛ +of.options.WATER_PARTICLES=sǝꞁɔᴉʇɹɐԀ ɹǝʇɐM +of.options.RAIN_SPLASH=ɥsɐꞁdS uᴉɐᴚ +of.options.PORTAL_PARTICLES=sǝꞁɔᴉʇɹɐԀ ꞁɐʇɹoԀ +of.options.POTION_PARTICLES=sǝꞁɔᴉʇɹɐԀ uoᴉʇoԀ +of.options.DRIPPING_WATER_LAVA=ɐʌɐ˥/ɹǝʇɐM ƃuᴉddᴉɹp +of.options.ANIMATED_TERRAIN=pǝʇɐɯᴉu∀ uᴉɐɹɹǝ⟘ +of.options.ANIMATED_TEXTURES=pǝʇɐɯᴉu∀ sǝɹnʇxǝ⟘ +of.options.FIREWORK_PARTICLES=sǝꞁɔᴉʇɹɐԀ ʞɹoʍǝɹᴉℲ + +# Other + +of.options.LAGOMETER=ɹǝʇǝɯoƃɐ˥ +of.options.LAGOMETER.tooltip.8=˙(ƐℲ) uǝǝɹɔs ƃnqǝp ǝɥʇ uo ɹǝʇǝɯoƃɐꞁ ǝɥʇ sʍoɥS +of.options.LAGOMETER.tooltip.7=uoᴉʇɔǝꞁꞁoɔ ǝƃɐqɹɐƃ ʎɹoɯǝW - ǝƃuɐɹO * +of.options.LAGOMETER.tooltip.6=ʞɔᴉ⟘ - uɐʎƆ * +of.options.LAGOMETER.tooltip.5=sǝꞁqɐʇnɔǝxǝ pǝꞁnpǝɥɔS - ǝnꞁᗺ * +of.options.LAGOMETER.tooltip.4=pɐoꞁdn ʞunɥƆ - ǝꞁdɹnԀ * +of.options.LAGOMETER.tooltip.3=sǝʇɐpdn ʞunɥƆ - pǝᴚ * +of.options.LAGOMETER.tooltip.2=ʞɔǝɥɔ ʎʇᴉꞁᴉqᴉsᴉΛ - ʍoꞁꞁǝ⅄ * +of.options.LAGOMETER.tooltip.1=uᴉɐɹɹǝʇ ɹǝpuǝᴚ - uǝǝɹפ * + +of.options.PROFILER=ɹǝꞁᴉɟoɹԀ ƃnqǝp +of.options.PROFILER.tooltip.5=ɹǝꞁᴉɟoɹԀ ƃnqǝp +of.options.PROFILER.tooltip.4=ɹǝʍoꞁs 'ǝʌᴉʇɔɐ sᴉ ɹǝꞁᴉɟoɹd ƃnqǝp - NO +of.options.PROFILER.tooltip.3=ɹǝʇsɐɟ 'ǝʌᴉʇɔɐ ʇou sᴉ ɹǝꞁᴉɟoɹd ƃnqǝp - ℲℲO +of.options.PROFILER.tooltip.2=uoᴉʇɐɯɹoɟuᴉ ƃnqǝp sʍoɥs puɐ sʇɔǝꞁꞁoɔ ɹǝꞁᴉɟoɹd ƃnqǝp ǝɥ⟘ +of.options.PROFILER.tooltip.1=˙(ƐℲ) uǝdo sᴉ uǝǝɹɔs ƃnqǝp ǝɥʇ uǝɥʍ + +of.options.WEATHER=ɹǝɥʇɐǝM +of.options.WEATHER.tooltip.5=ɹǝɥʇɐǝM +of.options.WEATHER.tooltip.4=ɹǝʍoꞁs 'ǝʌᴉʇɔɐ sᴉ ɹǝɥʇɐǝʍ - NO +of.options.WEATHER.tooltip.3=ɹǝʇsɐɟ 'ǝʌᴉʇɔɐ ʇou sᴉ ɹǝɥʇɐǝʍ - ℲℲO +of.options.WEATHER.tooltip.2=˙sɯɹoʇsɹǝpunɥʇ puɐ ʍous 'uᴉɐɹ sꞁoɹʇuoɔ ɹǝɥʇɐǝʍ ǝɥ⟘ +of.options.WEATHER.tooltip.1=˙spꞁɹoʍ ꞁɐɔoꞁ ɹoɟ ǝꞁqᴉssod ʎꞁuo sᴉ ꞁoɹʇuoɔ ɹǝɥʇɐǝM + +of.options.time.dayOnly=ʎꞁuo ʎɐᗡ +of.options.time.nightOnly=ʎꞁuo ʇɥƃᴉN + +of.options.TIME=ǝɯᴉ⟘ +of.options.TIME.tooltip.6=ǝɯᴉ⟘ +of.options.TIME.tooltip.5=sǝꞁɔʎɔ ʇɥƃᴉu/ʎɐp ꞁɐɯɹou - ʇꞁnɐɟǝp +of.options.TIME.tooltip.4=ʎꞁuo ʎɐp - ʎꞁuo ʎɐᗡ +of.options.TIME.tooltip.3=ʎꞁuo ʇɥƃᴉu - ʎꞁuo ʇɥƃᴉN +of.options.TIME.tooltip.2=ǝpoɯ ƎΛI⟘∀ƎɹƆ uᴉ ǝʌᴉʇɔǝɟɟǝ ʎꞁuo sᴉ ƃuᴉʇʇǝs ǝɯᴉʇ ǝɥ⟘ +of.options.TIME.tooltip.1=˙spꞁɹoʍ ꞁɐɔoꞁ ɹoɟ puɐ + +options.fullscreen.tooltip.5=uǝǝɹɔsꞁꞁnℲ +options.fullscreen.tooltip.4=ǝpoɯ uǝǝɹɔsꞁꞁnɟ ǝsn - NO +options.fullscreen.tooltip.3=ǝpoɯ ʍopuᴉʍ ǝsn - ℲℲO +options.fullscreen.tooltip.2=uɐɥʇ ɹǝʍoꞁs ɹo ɹǝʇsɐɟ ǝq ʎɐɯ ǝpoɯ uǝǝɹɔsꞁꞁnℲ +options.fullscreen.tooltip.1=˙pɹɐɔ sɔᴉɥdɐɹƃ ǝɥʇ uo ƃuᴉpuǝdǝp 'ǝpoɯ ʍopuᴉʍ + +of.options.FULLSCREEN_MODE=ǝpoW uǝǝɹɔsꞁꞁnℲ +of.options.FULLSCREEN_MODE.tooltip.5=ǝpoɯ uǝǝɹɔsꞁꞁnℲ +of.options.FULLSCREEN_MODE.tooltip.4=ɹǝʍoꞁs 'uoᴉʇnꞁosǝɹ uǝǝɹɔs doʇʞsǝp ǝsn - ʇꞁnɐɟǝp +of.options.FULLSCREEN_MODE.tooltip.3=ɹǝʇsɐɟ ǝq ʎɐɯ 'uoᴉʇnꞁosǝɹ uǝǝɹɔs ɯoʇsnɔ ǝsn - HxM +of.options.FULLSCREEN_MODE.tooltip.2=˙(⥝⥝Ⅎ) ǝpoɯ uǝǝɹɔsꞁꞁnɟ uᴉ pǝsn sᴉ uoᴉʇnꞁosǝɹ pǝʇɔǝꞁǝs ǝɥ⟘ +of.options.FULLSCREEN_MODE.tooltip.1=˙ɹǝʇsɐɟ ǝq ʎꞁꞁɐɹǝuǝƃ pꞁnoɥs suoᴉʇnꞁosǝɹ ɹǝʍo˥ + +of.options.SHOW_FPS=SԀℲ ʍoɥS +of.options.SHOW_FPS.tooltip.7=˙uoᴉʇɐɯɹoɟuᴉ ɹǝpuǝɹ puɐ SԀℲ ʇɔɐdɯoɔ sʍoɥS +of.options.SHOW_FPS.tooltip.6=ɯnɯᴉuᴉɯ/ǝƃɐɹǝʌɐ - sdℲ +of.options.SHOW_FPS.tooltip.5=sɹǝɹǝpuǝɹ ʞunɥɔ - :Ɔ +of.options.SHOW_FPS.tooltip.4=sǝᴉʇᴉʇuǝ ʞɔoꞁq + sǝᴉʇᴉʇuǝ pǝɹǝpuǝɹ - :Ǝ +of.options.SHOW_FPS.tooltip.3=sǝʇɐpdn ʞunɥɔ - :∩ +of.options.SHOW_FPS.tooltip.2=ǝɥʇ uǝɥʍ uʍoɥs ʎꞁuo sᴉ uoᴉʇɐɯɹoɟuᴉ SԀℲ ʇɔɐdɯoɔ ǝɥ⟘ +of.options.SHOW_FPS.tooltip.1=˙ǝꞁqᴉsᴉʌ ʇou sᴉ uǝǝɹɔs ƃnqǝp + +of.options.save.45s=sϛ߈ +of.options.save.90s=s06 +of.options.save.3min=uᴉɯƐ +of.options.save.6min=uᴉɯ9 +of.options.save.12min=uᴉɯᘔ⥝ +of.options.save.24min=uᴉɯ߈ᘔ + +of.options.AUTOSAVE_TICKS=ǝʌɐsoʇn∀ +of.options.AUTOSAVE_TICKS.tooltip.4=ꞁɐʌɹǝʇuI ǝʌɐsoʇn∀ +of.options.AUTOSAVE_TICKS.tooltip.3=ʇꞁnɐɟǝp - sϛ߈ +of.options.AUTOSAVE_TICKS.tooltip.2=˙ǝɔuɐʇsᴉp ɹǝpuǝɹ ǝɥʇ uo ƃuᴉpuǝdǝp sǝʞᴉds ƃɐꞁ ǝʇɐɹǝuǝƃ ʎɐɯ ǝʌɐsoʇn∀ +of.options.AUTOSAVE_TICKS.tooltip.1=˙pǝuǝdo sᴉ nuǝɯ ǝɯɐƃ ǝɥʇ uǝɥʍ pǝʌɐs osꞁɐ sᴉ pꞁɹoʍ ǝɥ⟘ + +of.options.SCREENSHOT_SIZE=ǝzᴉS ʇoɥsuǝǝɹɔS +of.options.SCREENSHOT_SIZE.tooltip.6=ǝzᴉS ʇoɥsuǝǝɹɔS +of.options.SCREENSHOT_SIZE.tooltip.5=ǝzᴉs ʇoɥsuǝǝɹɔs ʇꞁnɐɟǝp - ʇꞁnɐɟǝp +of.options.SCREENSHOT_SIZE.tooltip.4=ǝzᴉs ʇoɥsuǝǝɹɔs ɯoʇsnɔ - x߈-xᘔ +of.options.SCREENSHOT_SIZE.tooltip.3=˙ʎɹoɯǝɯ ǝɹoɯ pǝǝu ʎɐɯ sʇoɥsuǝǝɹɔs ɹǝƃƃᴉq ƃuᴉɹnʇdɐƆ +of.options.SCREENSHOT_SIZE.tooltip.2=˙ƃuᴉsɐᴉꞁɐᴉʇu∀ puɐ ɹǝpuǝɹ ʇsɐℲ ɥʇᴉʍ ǝꞁqᴉʇɐdɯoɔ ʇoN +of.options.SCREENSHOT_SIZE.tooltip.1=˙ʇɹoddns ɹǝɟɟnqǝɯɐɹɟ ∩Ԁפ sǝɹᴉnbǝᴚ + +of.options.SHOW_GL_ERRORS=sɹoɹɹƎ ˥פ ʍoɥS +of.options.SHOW_GL_ERRORS.tooltip.6=sɹoɹɹƎ ˥פuǝdo ʍoɥS +of.options.SHOW_GL_ERRORS.tooltip.5=˙ʇɐɥɔ ǝɥʇ uᴉ uʍoɥs ǝɹɐ sɹoɹɹǝ ˥פuǝdo pǝꞁqɐuǝ uǝɥM +of.options.SHOW_GL_ERRORS.tooltip.4=puɐ ʇɔᴉꞁɟuoɔ uʍouʞ ɐ sᴉ ǝɹǝɥʇ ɟᴉ ʎꞁuo ʇᴉ ǝꞁqɐsᴉp +of.options.SHOW_GL_ERRORS.tooltip.3=˙pǝxᴉɟ ǝq ʇ,uɐɔ sɹoɹɹǝ ǝɥʇ +of.options.SHOW_GL_ERRORS.tooltip.2= ǝɥʇ uᴉ pǝƃƃoꞁ ꞁꞁᴉʇs ǝɹɐ sɹoɹɹǝ ǝɥʇ pǝꞁqɐsᴉp uǝɥM +of.options.SHOW_GL_ERRORS.tooltip.1= ˙doɹp SԀℲ ʇuɐɔᴉɟᴉuƃᴉs ɐ ǝsnɐɔ ꞁꞁᴉʇs ʎɐɯ ʎǝɥʇ puɐ ƃoꞁ ɹoɹɹǝ + +# Chat Settings + +of.options.CHAT_BACKGROUND=punoɹƃʞɔɐq ʇɐɥƆ +of.options.CHAT_BACKGROUND.tooltip.4=punoɹƃʞɔɐq ʇɐɥƆ +of.options.CHAT_BACKGROUND.tooltip.3=ɥʇpᴉʍ pǝxᴉɟ - ʇꞁnɐɟǝp +of.options.CHAT_BACKGROUND.tooltip.2=ɥʇpᴉʍ ǝuᴉꞁ sǝɥɔʇɐɯ - ʇɔɐdɯoƆ +of.options.CHAT_BACKGROUND.tooltip.1=uǝppᴉɥ - ℲℲO + +of.options.CHAT_SHADOW=ʍopɐɥS ʇɐɥƆ +of.options.CHAT_SHADOW.tooltip.3=ʍopɐɥS ʇɐɥƆ +of.options.CHAT_SHADOW.tooltip.2=ʍopɐɥs ʇxǝʇ ǝsn - NO +of.options.CHAT_SHADOW.tooltip.1=ʍopɐɥs ʇxǝʇ ou - ℲℲO diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_US.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_US.lang new file mode 100644 index 0000000..6bd0c99 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/en_US.lang @@ -0,0 +1,757 @@ +# General +of.general.ambiguous=ambiguous +of.general.compact=Compact +of.general.custom=Custom +of.general.from=From +of.general.id=Id +of.general.max=Maximum +of.general.restart=restart +of.general.smart=Smart + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing is not compatible with Shaders. +of.message.aa.shaders2=Please disable Shaders to enable this option. + +of.message.af.shaders1=Anisotropic Filtering is not compatible with Shaders. +of.message.af.shaders2=Please disable Shaders to enable this option. + +of.message.fr.shaders1=Fast Render is not compatible with Shaders. +of.message.fr.shaders2=Please disable Shaders to enable this option. + +of.message.an.shaders1=3D Anaglyph is not compatible with Shaders. +of.message.an.shaders2=Please disable Shaders to enable this option. + +of.message.shaders.aa1=Shaders are not compatible with Antialiasing. +of.message.shaders.aa2=Please set Quality -> Antialiasing to OFF and restart the game. + +of.message.shaders.af1=Shaders are not compatible with Anisotropic Filtering. +of.message.shaders.af2=Please set Quality -> Anisotropic Filtering to OFF. + +of.message.shaders.fr1=Shaders are not compatible with Fast Render. +of.message.shaders.fr2=Please set Performance -> Fast Render to OFF. + +of.message.shaders.an1=Shaders are not compatible with 3D Anaglyph. +of.message.shaders.an2=Please set Other -> 3D Anaglyph to OFF. + +of.message.shaders.nv1=This shader pack requires a newer OptiFine version: %s +of.message.shaders.nv2=Are you sure you want to continue? + +of.message.newVersion=A new §eOptiFine§f version is available: §e%s§f +of.message.java64Bit=You can install §e64-bit Java§f to increase performance. +of.message.openglError=§eOpenGL Error§f: %s (%s) + +of.message.shaders.loading=Loading shaders: %s + +of.message.other.reset=Reset all video settings to their default values? + +of.message.loadingVisibleChunks=Loading visible chunks + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine Cape... + +of.options.capeOF.title=OptiFine Cape +of.options.capeOF.openEditor=Open Cape Editor +of.options.capeOF.reloadCape=Reload Cape +of.options.capeOF.copyEditorLink=Copy Link To Clipboard + +of.message.capeOF.openEditor=The OptiFine cape editor should open in a web browser. +of.message.capeOF.openEditorError=Error opening the editor link in a web browser. +of.message.capeOF.reloadCape=The cape will be reloaded in 15 seconds. + +of.message.capeOF.error1=Mojang authentication failed. +of.message.capeOF.error2=Error: %s + +# Video settings + +options.graphics.tooltip.1=Visual quality +options.graphics.tooltip.2= Fast - lower quality, faster +options.graphics.tooltip.3= Fancy - higher quality, slower +options.graphics.tooltip.4=Changes the appearance of clouds, leaves, water, +options.graphics.tooltip.5=shadows and grass sides. + +of.options.renderDistance.extreme=Extreme +of.options.renderDistance.insane=Insane +of.options.renderDistance.ludicrous=Ludicrous + +options.renderDistance.tooltip.1=Visible distance +options.renderDistance.tooltip.2= 2 Tiny - 32m (fastest) +options.renderDistance.tooltip.3= 8 Normal - 128m (normal) +options.renderDistance.tooltip.4= 16 Far - 256m (slower) +options.renderDistance.tooltip.5= 32 Extreme - 512m (slowest!) very resource demanding +options.renderDistance.tooltip.6= 48 Insane - 768m, needs 2GB RAM allocated +options.renderDistance.tooltip.7= 64 Ludicrous - 1024m, needs 3GB RAM allocated +options.renderDistance.tooltip.8=Values over 16 Far are only effective in local worlds. + +options.ao.tooltip.1=Smooth lighting +options.ao.tooltip.2= OFF - no smooth lighting (faster) +options.ao.tooltip.3= Minimum - simple smooth lighting (slower) +options.ao.tooltip.4= Maximum - complex smooth lighting (slowest) + +options.framerateLimit.tooltip.1=Max framerate +options.framerateLimit.tooltip.2= VSync - limit to monitor framerate (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variable +options.framerateLimit.tooltip.4= Unlimited - no limit (fastest) +options.framerateLimit.tooltip.5=The framerate limit decreases the FPS even if +options.framerateLimit.tooltip.6=the limit value is not reached. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Smooth Lighting Level +of.options.AO_LEVEL.tooltip.1=Smooth lighting level +of.options.AO_LEVEL.tooltip.2= OFF - no shadows +of.options.AO_LEVEL.tooltip.3= 50%% - light shadows +of.options.AO_LEVEL.tooltip.4= 100%% - dark shadows + +options.viewBobbing.tooltip.1=More realistic movement. +options.viewBobbing.tooltip.2=When using mipmaps set it to OFF for best results. + +options.guiScale.tooltip.1=GUI Scale +options.guiScale.tooltip.2= Auto - maximal size +options.guiScale.tooltip.3= Small, Normal, Large - 1x to 3x +options.guiScale.tooltip.4= 4x to 10x - available on 4K displays +options.guiScale.tooltip.5=Odd values (1x, 3x, 5x ...) are not compatible with Unicode. +options.guiScale.tooltip.6=A smaller GUI may be faster. + +options.vbo=Use VBOs +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Uses an alternative rendering model which is usually +options.vbo.tooltip.3=faster (5-10%%) than the default rendering. + +options.gamma.tooltip.1=Changes the brightness of darker objects. +options.gamma.tooltip.2= Moody - standard brightness +options.gamma.tooltip.3= 1-99%% - variable +options.gamma.tooltip.4= Bright - maximum brightness for darker objects +options.gamma.tooltip.5=This option does not change the brightness of +options.gamma.tooltip.6=fully black objects. + +options.anaglyph.tooltip.1=3D Anaglyph +options.anaglyph.tooltip.2=Enables a stereoscopic 3D effect using different colors +options.anaglyph.tooltip.3=for each eye. +options.anaglyph.tooltip.4=Requires red-cyan glasses for proper viewing. + +options.attackIndicator.tooltip.1=Configures the position of the attack indicator +options.attackIndicator.tooltip.2= Crosshair - under the crosshair +options.attackIndicator.tooltip.3= Hotbar - next to the hotbar +options.attackIndicator.tooltip.4= OFF - no attack indicator +options.attackIndicator.tooltip.5=The attack indicator shows the attack power of the +options.attackIndicator.tooltip.6=currently equipped item + +of.options.ALTERNATE_BLOCKS=Alternate Blocks +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternate Blocks +of.options.ALTERNATE_BLOCKS.tooltip.2=Uses alternative block models for some blocks. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depends on the selected resource pack. + +of.options.FOG_FANCY=Fog +of.options.FOG_FANCY.tooltip.1=Fog type +of.options.FOG_FANCY.tooltip.2= Fast - faster fog +of.options.FOG_FANCY.tooltip.3= Fancy - slower fog, looks better +of.options.FOG_FANCY.tooltip.4= OFF - no fog, fastest +of.options.FOG_FANCY.tooltip.5=The fancy fog is available only if it is supported by the +of.options.FOG_FANCY.tooltip.6=graphic card. + +of.options.FOG_START=Fog Start +of.options.FOG_START.tooltip.1=Fog start +of.options.FOG_START.tooltip.2= 0.2 - the fog starts near the player +of.options.FOG_START.tooltip.3= 0.8 - the fog starts far from the player +of.options.FOG_START.tooltip.4=This option usually does not affect the performance. + +of.options.CHUNK_LOADING=Chunk Loading +of.options.CHUNK_LOADING.tooltip.1=Chunk Loading +of.options.CHUNK_LOADING.tooltip.2= Default - unstable FPS when loading chunks +of.options.CHUNK_LOADING.tooltip.3= Smooth - stable FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - stable FPS, 3x faster world loading +of.options.CHUNK_LOADING.tooltip.5=Smooth and Multi-Core remove the stuttering and +of.options.CHUNK_LOADING.tooltip.6=freezes caused by chunk loading. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core can speed up 3x the world loading and +of.options.CHUNK_LOADING.tooltip.8=increase FPS by using a second CPU core. +of.options.chunkLoading.smooth=Smooth +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=OFF +of.options.shaders.packDefault=(internal) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= OFF - (default) no antialiasing (faster) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - antialiased lines and edges (slower) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA is a post-processing effect which smooths +of.options.shaders.ANTIALIASING.tooltip.5=jagged lines and sharp color transitions. +of.options.shaders.ANTIALIASING.tooltip.6=It is faster than traditional antialiasing +of.options.shaders.ANTIALIASING.tooltip.7=and is compatible with shaders and Fast Render. + +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.1=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.2= ON - (default) enable normal maps +of.options.shaders.NORMAL_MAP.tooltip.3= OFF - disable normal maps +of.options.shaders.NORMAL_MAP.tooltip.4=Normal maps can be used by the shader pack +of.options.shaders.NORMAL_MAP.tooltip.5=to simulate 3D geometry on flat model surfaces. +of.options.shaders.NORMAL_MAP.tooltip.6=The normal map textures are supplied by the +of.options.shaders.NORMAL_MAP.tooltip.7=current resource pack. + +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.1=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.2= ON - (default) enable specular maps +of.options.shaders.SPECULAR_MAP.tooltip.3= OFF - disable specular maps +of.options.shaders.SPECULAR_MAP.tooltip.4=Specular maps can be used by the shader pack +of.options.shaders.SPECULAR_MAP.tooltip.5=to simulate special reflection effects. +of.options.shaders.SPECULAR_MAP.tooltip.6=The specular map textures are supplied by the +of.options.shaders.SPECULAR_MAP.tooltip.7=current resource pack. + +of.options.shaders.RENDER_RES_MUL=Render Quality +of.options.shaders.RENDER_RES_MUL.tooltip.1=Render Quality +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - low (fastest) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (default) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - high (slowest) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Render quality controls the size of the texture +of.options.shaders.RENDER_RES_MUL.tooltip.6=that the shader pack is rendering to. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Lower values can be useful with 4K displays. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Higher values work as an antialiasing filter. + +of.options.shaders.SHADOW_RES_MUL=Shadow Quality +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Shadow Quality +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - low (fastest) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (default) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - high (slowest) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Shadow quality controls the size of the shadow map +of.options.shaders.SHADOW_RES_MUL.tooltip.6=texture used by the shader pack. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Lower values = unexact, coarser shadows. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Higher values = detailed, finer shadows. + +of.options.shaders.HAND_DEPTH_MUL=Hand Depth +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Hand Depth +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - hand near to the camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (default) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - hand far from the camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Hand depth controls how far the handheld objects are +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=from the camera. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=For shader packs using depth blur this should change +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=the blurring of handheld objects. + +of.options.shaders.CLOUD_SHADOW=Cloud Shadow + +of.options.shaders.OLD_HAND_LIGHT=Old Hand Light +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Old Hand Light +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Default - controlled by the shader pack +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= ON - use old handlight +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= OFF - use new handlight +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Old hand light allows shader packs which only +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=recognize light emitting items in the main hand +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=to also work with items in the off-hand. + +of.options.shaders.OLD_LIGHTING=Old Lighting +of.options.shaders.OLD_LIGHTING.tooltip.1=Old Lighting +of.options.shaders.OLD_LIGHTING.tooltip.2= Default - controlled by the shader pack +of.options.shaders.OLD_LIGHTING.tooltip.3= ON - use old lighting +of.options.shaders.OLD_LIGHTING.tooltip.4= OFF - do not use old lighting +of.options.shaders.OLD_LIGHTING.tooltip.5=Old lighting controls the fixed lighting applied +of.options.shaders.OLD_LIGHTING.tooltip.6=by vanilla to the block sides. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shader packs which use shadows usually provide +of.options.shaders.OLD_LIGHTING.tooltip.8=much better lighting depending on the sun position. + +of.options.shaders.DOWNLOAD=Download Shaders +of.options.shaders.DOWNLOAD.tooltip.1=Download Shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Opens the shader packs page in a browser. +of.options.shaders.DOWNLOAD.tooltip.4=Put the downloaded shader packs in the "Shaders Folder" +of.options.shaders.DOWNLOAD.tooltip.5=and they will appear in the list of installed shaders. + +of.options.shaders.SHADER_PACK=Shader Pack + +of.options.shaders.shadersFolder=Shaders Folder +of.options.shaders.shaderOptions=Shader Options... + +of.options.shaderOptionsTitle=Shader Options + +of.options.quality=Quality... +of.options.qualityTitle=Quality Settings + +of.options.details=Details... +of.options.detailsTitle=Detail Settings + +of.options.performance=Performance... +of.options.performanceTitle=Performance Settings + +of.options.animations=Animations... +of.options.animationsTitle=Animation Settings + +of.options.other=Other... +of.options.otherTitle=Other Settings + +of.options.other.reset=Reset Video Settings... + +of.shaders.profile=Profile + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Nearest +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Visual effect which makes distant objects look better +options.mipmapLevels.tooltip.2=by smoothing the texture details +options.mipmapLevels.tooltip.3= OFF - no smoothing +options.mipmapLevels.tooltip.4= 1 - minimum smoothing +options.mipmapLevels.tooltip.5= Maximum - maximum smoothing +options.mipmapLevels.tooltip.6=This option usually does not affect the performance. + +of.options.MIPMAP_TYPE=Mipmap Type +of.options.MIPMAP_TYPE.tooltip.1=Visual effect which makes distant objects look better +of.options.MIPMAP_TYPE.tooltip.2=by smoothing the texture details +of.options.MIPMAP_TYPE.tooltip.3= Nearest - rough smoothing (fastest) +of.options.MIPMAP_TYPE.tooltip.4= Linear - normal smoothing +of.options.MIPMAP_TYPE.tooltip.5= Bilinear - fine smoothing +of.options.MIPMAP_TYPE.tooltip.6= Trilinear - finest smoothing (slowest) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= OFF - (default) no antialiasing (faster) +of.options.AA_LEVEL.tooltip.3= 2-16 - antialiased lines and edges (slower) +of.options.AA_LEVEL.tooltip.4=The Antialiasing smooths jagged lines and +of.options.AA_LEVEL.tooltip.5=sharp color transitions. +of.options.AA_LEVEL.tooltip.6=When enabled it may substantially decrease the FPS. +of.options.AA_LEVEL.tooltip.7=Not all levels are supported by all graphics cards. +of.options.AA_LEVEL.tooltip.8=Effective after a RESTART! + +of.options.AF_LEVEL=Anisotropic Filtering +of.options.AF_LEVEL.tooltip.1=Anisotropic Filtering +of.options.AF_LEVEL.tooltip.2= OFF - (default) standard texture detail (faster) +of.options.AF_LEVEL.tooltip.3= 2-16 - finer details in mipmapped textures (slower) +of.options.AF_LEVEL.tooltip.4=The Anisotropic Filtering restores details in +of.options.AF_LEVEL.tooltip.5=mipmapped textures. +of.options.AF_LEVEL.tooltip.6=When enabled it may substantially decrease the FPS. + +of.options.CLEAR_WATER=Clear Water +of.options.CLEAR_WATER.tooltip.1=Clear Water +of.options.CLEAR_WATER.tooltip.2= ON - clear, transparent water +of.options.CLEAR_WATER.tooltip.3= OFF - default water + +of.options.RANDOM_ENTITIES=Random Entities +of.options.RANDOM_ENTITIES.tooltip.1=Random Entities +of.options.RANDOM_ENTITIES.tooltip.2= OFF - no random entities, faster +of.options.RANDOM_ENTITIES.tooltip.3= ON - random entities, slower +of.options.RANDOM_ENTITIES.tooltip.4=Random entities uses random textures for the game entities. +of.options.RANDOM_ENTITIES.tooltip.5=It needs a resource pack which has multiple entity textures. + +of.options.BETTER_GRASS=Better Grass +of.options.BETTER_GRASS.tooltip.1=Better Grass +of.options.BETTER_GRASS.tooltip.2= OFF - default side grass texture, fastest +of.options.BETTER_GRASS.tooltip.3= Fast - full side grass texture, slower +of.options.BETTER_GRASS.tooltip.4= Fancy - dynamic side grass texture, slowest + +of.options.BETTER_SNOW=Better Snow +of.options.BETTER_SNOW.tooltip.1=Better Snow +of.options.BETTER_SNOW.tooltip.2= OFF - default snow, faster +of.options.BETTER_SNOW.tooltip.3= ON - better snow, slower +of.options.BETTER_SNOW.tooltip.4=Shows snow under transparent blocks (fence, tall grass) +of.options.BETTER_SNOW.tooltip.5=when bordering with snow blocks. + +of.options.CUSTOM_FONTS=Custom Fonts +of.options.CUSTOM_FONTS.tooltip.1=Custom Fonts +of.options.CUSTOM_FONTS.tooltip.2= ON - uses custom fonts (default), slower +of.options.CUSTOM_FONTS.tooltip.3= OFF - uses default font, faster +of.options.CUSTOM_FONTS.tooltip.4=The custom fonts are supplied by the current +of.options.CUSTOM_FONTS.tooltip.5=resource pack. + +of.options.CUSTOM_COLORS=Custom Colors +of.options.CUSTOM_COLORS.tooltip.1=Custom Colors +of.options.CUSTOM_COLORS.tooltip.2= ON - uses custom colors (default), slower +of.options.CUSTOM_COLORS.tooltip.3= OFF - uses default colors, faster +of.options.CUSTOM_COLORS.tooltip.4=The custom colors are supplied by the current +of.options.CUSTOM_COLORS.tooltip.5=resource pack. + +of.options.SWAMP_COLORS=Swamp Colors +of.options.SWAMP_COLORS.tooltip.1=Swamp Colors +of.options.SWAMP_COLORS.tooltip.2= ON - use swamp colors (default), slower +of.options.SWAMP_COLORS.tooltip.3= OFF - do not use swamp colors, faster +of.options.SWAMP_COLORS.tooltip.4=The swamp colors affect grass, leaves, vines and water. + +of.options.SMOOTH_BIOMES=Smooth Biomes +of.options.SMOOTH_BIOMES.tooltip.1=Smooth Biomes +of.options.SMOOTH_BIOMES.tooltip.2= ON - smoothing of biome borders (default), slower +of.options.SMOOTH_BIOMES.tooltip.3= OFF - no smoothing of biome borders, faster +of.options.SMOOTH_BIOMES.tooltip.4=The smoothing of biome borders is done by sampling and +of.options.SMOOTH_BIOMES.tooltip.5=averaging the color of all surrounding blocks. +of.options.SMOOTH_BIOMES.tooltip.6=Affected are grass, leaves, vines and water. + +of.options.CONNECTED_TEXTURES=Connected Textures +of.options.CONNECTED_TEXTURES.tooltip.1=Connected Textures +of.options.CONNECTED_TEXTURES.tooltip.2= OFF - no connected textures (default) +of.options.CONNECTED_TEXTURES.tooltip.3= Fast - fast connected textures +of.options.CONNECTED_TEXTURES.tooltip.4= Fancy - fancy connected textures +of.options.CONNECTED_TEXTURES.tooltip.5=Connected textures joins the textures of glass, +of.options.CONNECTED_TEXTURES.tooltip.6=sandstone and bookshelves when placed next to +of.options.CONNECTED_TEXTURES.tooltip.7=each other. The connected textures are supplied +of.options.CONNECTED_TEXTURES.tooltip.8=by the current resource pack. + +of.options.NATURAL_TEXTURES=Natural Textures +of.options.NATURAL_TEXTURES.tooltip.1=Natural Textures +of.options.NATURAL_TEXTURES.tooltip.2= OFF - no natural textures (default) +of.options.NATURAL_TEXTURES.tooltip.3= ON - use natural textures +of.options.NATURAL_TEXTURES.tooltip.4=Natural textures remove the gridlike pattern +of.options.NATURAL_TEXTURES.tooltip.5=created by repeating blocks of the same type. +of.options.NATURAL_TEXTURES.tooltip.6=It uses rotated and flipped variants of the base +of.options.NATURAL_TEXTURES.tooltip.7=block texture. The configuration for the natural +of.options.NATURAL_TEXTURES.tooltip.8=textures is supplied by the current resource pack. + +of.options.EMISSIVE_TEXTURES=Emissive Textures +of.options.EMISSIVE_TEXTURES.tooltip.1=Emissive Textures +of.options.EMISSIVE_TEXTURES.tooltip.2= OFF - no emissive textures (default) +of.options.EMISSIVE_TEXTURES.tooltip.3= ON - use emissive textures +of.options.EMISSIVE_TEXTURES.tooltip.4=The emissive textures are rendered as overlays +of.options.EMISSIVE_TEXTURES.tooltip.5=with full brightness. They can be used to simulate +of.options.EMISSIVE_TEXTURES.tooltip.6=light emitting parts of the base texture. +of.options.EMISSIVE_TEXTURES.tooltip.7=The emissive textures are supplied by the current +of.options.EMISSIVE_TEXTURES.tooltip.8=resource pack. + +of.options.CUSTOM_SKY=Custom Sky +of.options.CUSTOM_SKY.tooltip.1=Custom Sky +of.options.CUSTOM_SKY.tooltip.2= ON - custom sky textures (default), slow +of.options.CUSTOM_SKY.tooltip.3= OFF - default sky, faster +of.options.CUSTOM_SKY.tooltip.4=The custom sky textures are supplied by the current +of.options.CUSTOM_SKY.tooltip.5=resource pack. + +of.options.CUSTOM_ITEMS=Custom Items +of.options.CUSTOM_ITEMS.tooltip.1=Custom Items +of.options.CUSTOM_ITEMS.tooltip.2= ON - custom item textures (default), slow +of.options.CUSTOM_ITEMS.tooltip.3= OFF - default item textures, faster +of.options.CUSTOM_ITEMS.tooltip.4=The custom item textures are supplied by the current +of.options.CUSTOM_ITEMS.tooltip.5=resource pack. + +of.options.CUSTOM_ENTITY_MODELS=Custom Entity Models +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Custom Entity Models +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ON - custom entity models (default), slow +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= OFF - default entity models, faster +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=The custom entity models are supplied by the current +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=resource pack. + +of.options.CUSTOM_GUIS=Custom GUIs +of.options.CUSTOM_GUIS.tooltip.1=Custom GUIs +of.options.CUSTOM_GUIS.tooltip.2= ON - custom GUIs (default), slower +of.options.CUSTOM_GUIS.tooltip.3= OFF - default GUIs, faster +of.options.CUSTOM_GUIS.tooltip.4=The custom GUIs are supplied by the current resource pack. + +# Details + +of.options.CLOUDS=Clouds +of.options.CLOUDS.tooltip.1=Clouds +of.options.CLOUDS.tooltip.2= Default - as set by setting Graphics +of.options.CLOUDS.tooltip.3= Fast - lower quality, faster +of.options.CLOUDS.tooltip.4= Fancy - higher quality, slower +of.options.CLOUDS.tooltip.5= OFF - no clouds, fastest +of.options.CLOUDS.tooltip.6=Fast clouds are rendered 2D. +of.options.CLOUDS.tooltip.7=Fancy clouds are rendered 3D. + +of.options.CLOUD_HEIGHT=Cloud Height +of.options.CLOUD_HEIGHT.tooltip.1=Cloud Height +of.options.CLOUD_HEIGHT.tooltip.2= OFF - default height +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - above world height limit + +of.options.TREES=Trees +of.options.TREES.tooltip.1=Trees +of.options.TREES.tooltip.2= Default - as set by setting Graphics +of.options.TREES.tooltip.3= Fast - lower quality, faster +of.options.TREES.tooltip.4= Smart - higher quality, fast +of.options.TREES.tooltip.5= Fancy - highest quality, slower +of.options.TREES.tooltip.6=Fast trees have opaque leaves. +of.options.TREES.tooltip.7=Fancy and smart trees have transparent leaves. + +of.options.RAIN=Rain & Snow +of.options.RAIN.tooltip.1=Rain & Snow +of.options.RAIN.tooltip.2= Default - as set by setting Graphics +of.options.RAIN.tooltip.3= Fast - light rain/snow, faster +of.options.RAIN.tooltip.4= Fancy - heavy rain/snow, slower +of.options.RAIN.tooltip.5= OFF - no rain/snow, fastest +of.options.RAIN.tooltip.6=When rain is OFF the splashes and rain sounds +of.options.RAIN.tooltip.7=are still active. + +of.options.SKY=Sky +of.options.SKY.tooltip.1=Sky +of.options.SKY.tooltip.2= ON - sky is visible, slower +of.options.SKY.tooltip.3= OFF - sky is not visible, faster +of.options.SKY.tooltip.4=When sky is OFF the moon and sun are still visible. + +of.options.STARS=Stars +of.options.STARS.tooltip.1=Stars +of.options.STARS.tooltip.2= ON - stars are visible, slower +of.options.STARS.tooltip.3= OFF - stars are not visible, faster + +of.options.SUN_MOON=Sun & Moon +of.options.SUN_MOON.tooltip.1=Sun & Moon +of.options.SUN_MOON.tooltip.2= ON - sun and moon are visible (default) +of.options.SUN_MOON.tooltip.3= OFF - sun and moon are not visible (faster) + +of.options.SHOW_CAPES=Show Capes +of.options.SHOW_CAPES.tooltip.1=Show Capes +of.options.SHOW_CAPES.tooltip.2= ON - show player capes (default) +of.options.SHOW_CAPES.tooltip.3= OFF - do not show player capes + +of.options.TRANSLUCENT_BLOCKS=Translucent Blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Translucent Blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Default - as set by setting Graphics +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Fancy - correct color blending (slower) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Fast - fast color blending (faster) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Controls the color blending of translucent blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.6=with different colors (stained glass, water, ice) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=when placed behind each other with air between them. + +of.options.HELD_ITEM_TOOLTIPS=Held Item Tooltips +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Held item tooltips +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ON - show tooltips for held items (default) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= OFF - do not show tooltips for held items + +of.options.ADVANCED_TOOLTIPS=Advanced Tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.1=Advanced tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.2= ON - show advanced tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.3= OFF - do not show advanced tooltips (default) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Advanced tooltips show extended information for +of.options.ADVANCED_TOOLTIPS.tooltip.5=items (id, durability) and for shader options +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, source, default value). + +of.options.DROPPED_ITEMS=Dropped Items +of.options.DROPPED_ITEMS.tooltip.1=Dropped Items +of.options.DROPPED_ITEMS.tooltip.2= Default - as set by setting Graphics +of.options.DROPPED_ITEMS.tooltip.3= Fast - 2D dropped items (faster) +of.options.DROPPED_ITEMS.tooltip.4= Fancy - 3D dropped items (slower) + +options.entityShadows.tooltip.1=Entity Shadows +options.entityShadows.tooltip.2= ON - show entity shadows +options.entityShadows.tooltip.3= OFF - do not show entity shadows + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Visual effect which slightly darkens the screen corners +of.options.VIGNETTE.tooltip.2= Default - as set by the setting Graphics (default) +of.options.VIGNETTE.tooltip.3= Fast - vignette disabled (faster) +of.options.VIGNETTE.tooltip.4= Fancy - vignette enabled (slower) +of.options.VIGNETTE.tooltip.5=The vignette may have a significant effect on the FPS, +of.options.VIGNETTE.tooltip.6=especially when playing fullscreen. +of.options.VIGNETTE.tooltip.7=The vignette effect is very subtle and can safely +of.options.VIGNETTE.tooltip.8=be disabled. + +of.options.DYNAMIC_FOV=Dynamic FOV +of.options.DYNAMIC_FOV.tooltip.1=Dynamic FOV +of.options.DYNAMIC_FOV.tooltip.2= ON - enable dynamic FOV (default) +of.options.DYNAMIC_FOV.tooltip.3= OFF - disable dynamic FOV +of.options.DYNAMIC_FOV.tooltip.4=Changes the field of view (FOV) when flying, sprinting +of.options.DYNAMIC_FOV.tooltip.5=or pulling a bow. + +of.options.DYNAMIC_LIGHTS=Dynamic Lights +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamic Lights +of.options.DYNAMIC_LIGHTS.tooltip.2= OFF - no dynamic lights (default) +of.options.DYNAMIC_LIGHTS.tooltip.3= Fast - fast dynamic lights (updated every 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Fancy - fancy dynamic lights (updated in real-time) +of.options.DYNAMIC_LIGHTS.tooltip.5=Enables light emitting items (torch, glowstone, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=to illuminate everything around them when held in hand, +of.options.DYNAMIC_LIGHTS.tooltip.7=equipped by other player or dropped on the ground. + +options.biomeBlendRadius.tooltip.1=Smooths the color transition between biomes +options.biomeBlendRadius.tooltip.2= OFF - no blending (fastest) +options.biomeBlendRadius.tooltip.3= 5x5 - normal blending (default) +options.biomeBlendRadius.tooltip.4= 15x15 - maximal blending (slowest) +options.biomeBlendRadius.tooltip.5=Higher values may generate significant lag spikes +options.biomeBlendRadius.tooltip.6=add slow down the chunk loading speed. + +# Performance + +of.options.SMOOTH_FPS=Smooth FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizes FPS by flushing the graphic driver buffers. +of.options.SMOOTH_FPS.tooltip.2= OFF - no stabilization, FPS may fluctuate +of.options.SMOOTH_FPS.tooltip.3= ON - FPS stabilization +of.options.SMOOTH_FPS.tooltip.4=This option is graphics driver dependant and its effect +of.options.SMOOTH_FPS.tooltip.5=is not always visible. + +of.options.SMOOTH_WORLD=Smooth World +of.options.SMOOTH_WORLD.tooltip.1=Removes lag spikes caused by the internal server. +of.options.SMOOTH_WORLD.tooltip.2= OFF - no stabilization, FPS may fluctuate +of.options.SMOOTH_WORLD.tooltip.3= ON - FPS stabilization +of.options.SMOOTH_WORLD.tooltip.4=Stabilizes FPS by distributing the internal server load. +of.options.SMOOTH_WORLD.tooltip.5=Effective only for local worlds (single player). + +of.options.FAST_RENDER=Fast Render +of.options.FAST_RENDER.tooltip.1=Fast Render +of.options.FAST_RENDER.tooltip.2= OFF - standard rendering (default) +of.options.FAST_RENDER.tooltip.3= ON - optimized rendering (faster) +of.options.FAST_RENDER.tooltip.4=Uses optimized rendering algorithm which decreases +of.options.FAST_RENDER.tooltip.5=the GPU load and may substantially increase the FPS. +of.options.FAST_RENDER.tooltip.6=This option can conflict with some mods. + +of.options.FAST_MATH=Fast Math +of.options.FAST_MATH.tooltip.1=Fast Math +of.options.FAST_MATH.tooltip.2= OFF - standard math (default) +of.options.FAST_MATH.tooltip.3= ON - faster math +of.options.FAST_MATH.tooltip.4=Uses optimized sin() and cos() functions which can +of.options.FAST_MATH.tooltip.5=better utilize the CPU cache and increase the FPS. +of.options.FAST_MATH.tooltip.6=This option can minimally affect the world generation. + +of.options.CHUNK_UPDATES=Chunk Updates +of.options.CHUNK_UPDATES.tooltip.1=Chunk updates +of.options.CHUNK_UPDATES.tooltip.2= 1 - slower world loading, higher FPS (default) +of.options.CHUNK_UPDATES.tooltip.3= 3 - faster world loading, lower FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - fastest world loading, lowest FPS +of.options.CHUNK_UPDATES.tooltip.5=Number of chunk updates per rendered frame, +of.options.CHUNK_UPDATES.tooltip.6=higher values may destabilize the framerate. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamic Updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamic chunk updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= OFF - standard chunk updates per frame (default) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ON - more updates while the player is standing still +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamic updates force more chunk updates while +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=the player is standing still to load the world faster. + +of.options.LAZY_CHUNK_LOADING=Lazy Chunk Loading +of.options.LAZY_CHUNK_LOADING.tooltip.1=Lazy Chunk Loading +of.options.LAZY_CHUNK_LOADING.tooltip.2= OFF - default server chunk loading +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - lazy server chunk loading (smoother) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Smooths the integrated server chunk loading by +of.options.LAZY_CHUNK_LOADING.tooltip.5=distributing the chunks over several ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Turn it OFF if parts of the world do not load correctly. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Effective only for local worlds (single-player). + +of.options.RENDER_REGIONS=Render Regions +of.options.RENDER_REGIONS.tooltip.1=Render Regions +of.options.RENDER_REGIONS.tooltip.2= OFF - do not use render regions (default) +of.options.RENDER_REGIONS.tooltip.3= ON - use render regions +of.options.RENDER_REGIONS.tooltip.4=Render regions allow faster terrain rendering at higher +of.options.RENDER_REGIONS.tooltip.5=render distances. More effective when VBOs are enabled. +of.options.RENDER_REGIONS.tooltip.6=Not recommended for integrated graphics cards. + +of.options.SMART_ANIMATIONS=Smart Animations +of.options.SMART_ANIMATIONS.tooltip.1=Smart Animations +of.options.SMART_ANIMATIONS.tooltip.2= OFF - do not use smart animations (default) +of.options.SMART_ANIMATIONS.tooltip.3= ON - use smart animations +of.options.SMART_ANIMATIONS.tooltip.4=With smart animations the game will only animate the +of.options.SMART_ANIMATIONS.tooltip.5=textures which are currently visible on the screen. +of.options.SMART_ANIMATIONS.tooltip.6=This reduces the tick lag spikes and increases the FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Especially useful for big mod packs and HD resource packs. + +# Animations + +of.options.animation.allOn=All ON +of.options.animation.allOff=All OFF +of.options.animation.dynamic=Dynamic + +of.options.ANIMATED_WATER=Water Animated +of.options.ANIMATED_LAVA=Lava Animated +of.options.ANIMATED_FIRE=Fire Animated +of.options.ANIMATED_PORTAL=Portal Animated +of.options.ANIMATED_REDSTONE=Redstone Animated +of.options.ANIMATED_EXPLOSION=Explosion Animated +of.options.ANIMATED_FLAME=Flame Animated +of.options.ANIMATED_SMOKE=Smoke Animated +of.options.VOID_PARTICLES=Void Particles +of.options.WATER_PARTICLES=Water Particles +of.options.RAIN_SPLASH=Rain Splash +of.options.PORTAL_PARTICLES=Portal Particles +of.options.POTION_PARTICLES=Potion Particles +of.options.DRIPPING_WATER_LAVA=Dripping Water/Lava +of.options.ANIMATED_TERRAIN=Terrain Animated +of.options.ANIMATED_TEXTURES=Textures Animated +of.options.FIREWORK_PARTICLES=Firework Particles + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Shows the lagometer on the debug screen (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Memory garbage collection +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Blue - Scheduled executables +of.options.LAGOMETER.tooltip.5=* Purple - Chunk upload +of.options.LAGOMETER.tooltip.6=* Red - Chunk updates +of.options.LAGOMETER.tooltip.7=* Yellow - Visibility check +of.options.LAGOMETER.tooltip.8=* Green - Render terrain + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= ON - debug profiler is active, slower +of.options.PROFILER.tooltip.3= OFF - debug profiler is not active, faster +of.options.PROFILER.tooltip.4=The debug profiler collects and shows debug information +of.options.PROFILER.tooltip.5=when the debug screen is open (F3). + +of.options.WEATHER=Weather +of.options.WEATHER.tooltip.1=Weather +of.options.WEATHER.tooltip.2= ON - weather is active, slower +of.options.WEATHER.tooltip.3= OFF - weather is not active, faster +of.options.WEATHER.tooltip.4=The weather controls rain, snow and thunderstorms. +of.options.WEATHER.tooltip.5=Weather control is only possible for local worlds. + +of.options.time.dayOnly=Day Only +of.options.time.nightOnly=Night Only + +of.options.TIME=Time +of.options.TIME.tooltip.1=Time +of.options.TIME.tooltip.2= Default - normal day/night cycles +of.options.TIME.tooltip.3= Day Only - day only +of.options.TIME.tooltip.4= Night Only - night only +of.options.TIME.tooltip.5=The time setting is only effective in CREATIVE mode +of.options.TIME.tooltip.6=and for local worlds. + +options.fullscreen.tooltip.1=Fullscreen +options.fullscreen.tooltip.2= ON - use fullscreen mode +options.fullscreen.tooltip.3= OFF - use window mode +options.fullscreen.tooltip.4=Fullscreen mode may be faster or slower than +options.fullscreen.tooltip.5=window mode, depending on the graphics card. + +of.options.FULLSCREEN_MODE=Fullscreen Mode +of.options.FULLSCREEN_MODE.tooltip.1=Fullscreen mode +of.options.FULLSCREEN_MODE.tooltip.2= Default - use desktop screen resolution, slower +of.options.FULLSCREEN_MODE.tooltip.3= WxH - use custom screen resolution, may be faster +of.options.FULLSCREEN_MODE.tooltip.4=The selected resolution is used in fullscreen mode (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Lower resolutions should generally be faster. + +of.options.SHOW_FPS=Show FPS +of.options.SHOW_FPS.tooltip.1=Shows compact FPS and render information. +of.options.SHOW_FPS.tooltip.2= Fps - average/minimum +of.options.SHOW_FPS.tooltip.3= C: - chunk renderers +of.options.SHOW_FPS.tooltip.4= E: - rendered entities + block entities +of.options.SHOW_FPS.tooltip.5= U: - chunk updates +of.options.SHOW_FPS.tooltip.6=The compact FPS information is only shown when the +of.options.SHOW_FPS.tooltip.7=debug screen is not visible. + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3min +of.options.save.6min=6min +of.options.save.12min=12min +of.options.save.24min=24min + +of.options.AUTOSAVE_TICKS=Autosave +of.options.AUTOSAVE_TICKS.tooltip.1=Autosave Interval +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - default +of.options.AUTOSAVE_TICKS.tooltip.3=Autosave may generate lag spikes depending on the render distance. +of.options.AUTOSAVE_TICKS.tooltip.4=The world is also saved when the game menu is opened. + +of.options.SCREENSHOT_SIZE=Screenshot Size +of.options.SCREENSHOT_SIZE.tooltip.1=Screenshot Size +of.options.SCREENSHOT_SIZE.tooltip.2= Default - default screenshot size +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - custom screenshot size +of.options.SCREENSHOT_SIZE.tooltip.4=Capturing bigger screenshots may need more memory. +of.options.SCREENSHOT_SIZE.tooltip.5=Not compatible with Fast Render and Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Requires GPU framebuffer support. + +of.options.SHOW_GL_ERRORS=Show GL Errors +of.options.SHOW_GL_ERRORS.tooltip.1=Show OpenGL Errors +of.options.SHOW_GL_ERRORS.tooltip.2=When enabled OpenGL errors are shown in the chat. +of.options.SHOW_GL_ERRORS.tooltip.3=Disable it only if there is a known conflict and +of.options.SHOW_GL_ERRORS.tooltip.4=the errors can't be fixed. +of.options.SHOW_GL_ERRORS.tooltip.5=When disabled the errors are still logged in the +of.options.SHOW_GL_ERRORS.tooltip.6=error log and they may still cause a significant FPS drop. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Chat Background +of.options.CHAT_BACKGROUND.tooltip.1=Chat Background +of.options.CHAT_BACKGROUND.tooltip.2= Default - fixed width +of.options.CHAT_BACKGROUND.tooltip.3= Compact - matches line width +of.options.CHAT_BACKGROUND.tooltip.4= OFF - hidden + +of.options.CHAT_SHADOW=Chat Shadow +of.options.CHAT_SHADOW.tooltip.1=Chat Shadow +of.options.CHAT_SHADOW.tooltip.2= ON - use text shadow +of.options.CHAT_SHADOW.tooltip.3= OFF - no text shadow diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/es_ES.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/es_ES.lang new file mode 100644 index 0000000..ec809f8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/es_ES.lang @@ -0,0 +1,795 @@ +# General +of.general.ambiguous=ambiguo +of.general.compact=Compacto +of.general.custom=Personalizado +of.general.from=De +of.general.id=ID +of.general.max=Máximo +of.general.restart=Reiniciar +of.general.smart=Inteligentes + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing no es compatible con shaders. +of.message.aa.shaders2=Desactívalas para usar esta función. + +of.message.af.shaders1=Anisotrópico no es compatible con shaders. +of.message.af.shaders2=Desactívalas para usar esta función. + +of.message.fr.shaders1=No es compatible con shaders. +of.message.fr.shaders2=Desactívalas para usar esta función. + +of.message.shaders.aa1=Las shaders no son compatibles con antialiasing. +of.message.shaders.aa2=Para desactivarlo, haz clic en Calidad -> Antialiasing. + +of.message.shaders.af1=Las shaders no son compatibles con anisotrópico. +of.message.shaders.af2=Para desactivarlo, haz clic en Calidad -> Anisotrópico. + +of.message.shaders.fr1=Las shaders no son compatibles con el renderizado rápido. +of.message.shaders.fr2=Para desactivarlo, haz clic en Rendimiento -> Renderizado rápido. + +of.message.an.shaders1=No es compatible con shaders. +of.message.an.shaders2=Desactívalas para usar esta función. + +of.message.shaders.aa1=No es compatible con Antialiasing. +of.message.shaders.aa2=Desactívalo en Calidad -> Antialiasing -> NO. + +of.message.shaders.af1=No es compatible con Anisotrópico. +of.message.shaders.af2=Desactívalo en Calidad -> Anisotrópico -> NO. + +of.message.shaders.fr1=No es compatible con Renderizado rápido. +of.message.shaders.fr2=Desactívalo en Calidad -> Renderizado rápido -> NO. + +of.message.shaders.an1=No es compatible con Visión en 3D. +of.message.shaders.an2=Desactívalo en Opciones varias -> Visión en 3D. + +of.message.shaders.nv1=Estas shaders requieren un Optifine más reciente: %s +of.message.shaders.nv2=¿Quieres continuar? + +of.message.newVersion=Hay una nueva versión de §eOptiFine§f disponible: §e%s§f +of.message.java64Bit=Instala §eJava de 64-bits§f para mejorar el rendimiento +of.message.openglError=§eError de OpenGL§f: %s (%s) + +of.message.shaders.loading=Cargando shader: %s + +of.message.other.reset=¿Restablecer toda la configuración gráfica? + +of.message.loadingVisibleChunks=Cargando chunks visibles + +# Skin customization + +of.options.skinCustomisation.ofCape=Capa de OptiFine... + +of.options.capeOF.title=Capa de OptiFine +of.options.capeOF.openEditor=Editor de capa de OptiFine +of.options.capeOF.reloadCape=Recargar capa + +of.message.capeOF.openEditor=El editor de capa debe abrirse en un navegador. +of.message.capeOF.reloadCape=La capa se recargará en 15 segundos. + +of.message.capeOF.error1=Error de autenticación con Mojang. +of.message.capeOF.error2=Error: %s + +# Video settings + +options.graphics.tooltip.1=Gráficos +options.graphics.tooltip.2= Rápidos - peor calidad, mejor rendimiento +options.graphics.tooltip.3= Detallados - mejor calidad, peor rendimiento +options.graphics.tooltip.4= +options.graphics.tooltip.5=Los cambios se aprecian en las nubes, en las hojas, +options.graphics.tooltip.6=en la lluvia, en los objetos tirados y en las +options.graphics.tooltip.7=esquinas (o bordes) de la pantalla del juego. + +of.options.renderDistance.tiny=Mínimo +of.options.renderDistance.short=Corto +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Lejano +of.options.renderDistance.extreme=Extremo +of.options.renderDistance.insane=Insano +of.options.renderDistance.ludicrous=A lo bestia + +options.renderDistance.tooltip.1= 2 Mínimo - 32m (increíblemente rápido) +options.renderDistance.tooltip.2= 4 Corto - 64m (rápido) +options.renderDistance.tooltip.3= 8 Normal - 128m (recomendado) +options.renderDistance.tooltip.4= 16 Lejano - 256m (puede ir lento) +options.renderDistance.tooltip.5= 32 Extremo - 512m (¡puede ir horrible!) +options.renderDistance.tooltip.6= 48 Insano - 768m, requiere usar 2GB de RAM +options.renderDistance.tooltip.7= 64 A lo bestia - 1024m, requiere usar 3GB de RAM +options.renderDistance.tooltip.8=A partir de 16 chunks será inútil en multijugador. + +options.ao.tooltip.1=Iluminación suave +options.ao.tooltip.2= NO - sin iluminación suave (rápido) +options.ao.tooltip.3= Mínimo - iluminación suave simple (lento) +options.ao.tooltip.4= Máximo - iluminación suave avanzada (más lento) + +options.framerateLimit.tooltip.1=Límite de FPS +options.framerateLimit.tooltip.2= VSync - limita los FPS según tu monitor (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - límite personalizado +options.framerateLimit.tooltip.4= Sin límite - todos los FPS posibles (recomendado) +options.framerateLimit.tooltip.5= +options.framerateLimit.tooltip.6=Al establecer un límite, los FPS pueden +options.framerateLimit.tooltip.7=disminuir si llegan a alcanzarlo. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Nivel de suavidad +of.options.AO_LEVEL.tooltip.1=Nivel de la iluminación suave +of.options.AO_LEVEL.tooltip.2= NO - sin sombras +of.options.AO_LEVEL.tooltip.3= 50%% - pocas sombras +of.options.AO_LEVEL.tooltip.4= 100%% - sombras oscuras + +options.viewBobbing.tooltip.1=Un movimiento más realista. +options.viewBobbing.tooltip.2=Desactívalo al usar mipmap para que sea mejor. + +options.guiScale.tooltip.1=Tamaño de interfaz (GUI) +options.guiScale.tooltip.2= Auto. - tamaño máximo +options.guiScale.tooltip.3= Pequeña, normal y grande - desde 1x hasta 3x +options.guiScale.tooltip.4= Desde 4x hasta 10x - disponible en pantallas 4K. +options.guiScale.tooltip.5= +options.guiScale.tooltip.6=Los valores impares (1x, 3x, 5x...) no son compatibles +options.guiScale.tooltip.7=con la fuente unicode. +options.guiScale.tooltip.8=Una interfaz pequeña puede mejorar el rendimiento. + +options.vbo=Usar VBOs +options.vbo.tooltip.1=Vertex Buffer Objects (abreviado como VBO) +options.vbo.tooltip.2= +options.vbo.tooltip.3=Es un tipo de renderizado alternativo que suele ser +options.vbo.tooltip.4=más rápido que el predeterminado (un 5-10%%). + +options.gamma.tooltip.1=Modificar el brillo +options.gamma.tooltip.2= Oscuro - brillo por defecto +options.gamma.tooltip.3= 1-99%% - brillo personalizado +options.gamma.tooltip.4= Claro - brillo al máximo +options.gamma.tooltip.5= +options.gamma.tooltip.6=Esta opción no cambia completamente +options.gamma.tooltip.7=el brillo de los objetos más oscuros. + +options.anaglyph.tooltip.1=Visión en 3D +options.anaglyph.tooltip.2=Activar un efecto estereoscópico usando un color +options.anaglyph.tooltip.3=diferente para cada ojo. +options.anaglyph.tooltip.4=NOTA: Requiere gafas anaglíficas (rojas y azules). + +of.options.ALTERNATE_BLOCKS=Bloques alternos +of.options.ALTERNATE_BLOCKS.tooltip.1=Bloques con texturas alternas +of.options.ALTERNATE_BLOCKS.tooltip.2=Usar texturas alternativas para un mismo bloque. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depende del paquete de recursos usado. + +of.options.FOG_FANCY=Niebla +of.options.FOG_FANCY.tooltip.1=Tipo de niebla +of.options.FOG_FANCY.tooltip.2= Rápidos - niebla más rápida, luce cutre +of.options.FOG_FANCY.tooltip.3= Detallados - niebla más lenta, luce mejor +of.options.FOG_FANCY.tooltip.4= NO - sin niebla, superrápido +of.options.FOG_FANCY.tooltip.5=La niebla detallada sólo está disponible si +of.options.FOG_FANCY.tooltip.6=tu tarjeta gráfica lo permite. + +of.options.FOG_START=Distancia de niebla +of.options.FOG_START.tooltip.1=Distancia a la que empieza la niebla +of.options.FOG_START.tooltip.2= 0.2 - la niebla estará cerca +of.options.FOG_START.tooltip.3= 0.8 - la niebla estará lejos +of.options.FOG_START.tooltip.4=Esta opción no suele afectar al rendimiento. + +of.options.CHUNK_LOADING=Carga de chunks +of.options.CHUNK_LOADING.tooltip.1=Velocidad de carga de chunks +of.options.CHUNK_LOADING.tooltip.2= Por defecto - FPS inestables al cargar chunks +of.options.CHUNK_LOADING.tooltip.3= Suave - FPS estables +of.options.CHUNK_LOADING.tooltip.4= Multinúcleo - FPS estables y una velocidad 3 veces superior +of.options.CHUNK_LOADING.tooltip.5=Las opciones "Suave" y "Multinúcleo" eliminan los tirones y +of.options.CHUNK_LOADING.tooltip.6=la lentitud causada por la carga de chunks. +of.options.CHUNK_LOADING.tooltip.7=Multinúcleo puede acelerar la carga hasta 3 veces más y +of.options.CHUNK_LOADING.tooltip.8=mejorar los FPS al usar un segundo núcleo del CPU. +of.options.chunkLoading.smooth=Suave +of.options.chunkLoading.multiCore=Multinúcleo + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=(SIN SHADERS) +of.options.shaders.packDefault=(SHADER INTERNA) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Nivel de antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= NO - por defecto (rápido) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - mejora líneas y esquinas (más lento) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA es un efecto de posprocesamiento que suaviza +of.options.shaders.ANTIALIASING.tooltip.5="dientes de sierra" y transiciones de color. +of.options.shaders.ANTIALIASING.tooltip.6=Funciona mejor que el antialiasing común, y +of.options.shaders.ANTIALIASING.tooltip.7=es compatible con Renderizado rápido y shaders. + +of.options.shaders.NORMAL_MAP=Mapeado normal +of.options.shaders.NORMAL_MAP.tooltip.1=También llamado Normal Map +of.options.shaders.NORMAL_MAP.tooltip.2= SÍ - (por defecto) +of.options.shaders.NORMAL_MAP.tooltip.3= NO +of.options.shaders.NORMAL_MAP.tooltip.4=Puede usarse por shaders para simular geometría 3D +of.options.shaders.NORMAL_MAP.tooltip.5=en superficies planas. +of.options.shaders.NORMAL_MAP.tooltip.6= +of.options.shaders.NORMAL_MAP.tooltip.7=No todas las shaders soportan esta opción. + +of.options.shaders.SPECULAR_MAP=Mapeado especular +of.options.shaders.SPECULAR_MAP.tooltip.1=También llamado Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.2= SÍ - (por defecto) +of.options.shaders.SPECULAR_MAP.tooltip.3= NO +of.options.shaders.SPECULAR_MAP.tooltip.4=Esta opción puede ser usada por shaders para simular +of.options.shaders.SPECULAR_MAP.tooltip.5=un efecto de reflejo especial. +of.options.shaders.SPECULAR_MAP.tooltip.6= +of.options.shaders.SPECULAR_MAP.tooltip.7=No todas las shaders soportan esta opción. + + +of.options.shaders.RENDER_RES_MUL=Calidad render. +of.options.shaders.RENDER_RES_MUL.tooltip.1=Calidad de renderizado del juego +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - bajo (más rápido, más borroso) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - normal (por defecto) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - alto (más lento, más calidad) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Controla la resolución interna a la que se renderiza. +of.options.shaders.RENDER_RES_MUL.tooltip.6= +of.options.shaders.RENDER_RES_MUL.tooltip.7=Valor bajo = aumenta el rendimiento. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Valor alto = sirve como antialiasing. + +of.options.shaders.SHADOW_RES_MUL=Calidad sombras +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Calidad de sombras +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - bajo (más rápido) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - normal (por defecto) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - alto (más lento) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Controla el mapeado de sombras de las shaders. +of.options.shaders.SHADOW_RES_MUL.tooltip.6= +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Valor bajo = borrosas, líneas gruesas. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Valor alto = detalladas, líneas definidas. + +of.options.shaders.HAND_DEPTH_MUL=Pr. de campo +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Profundidad de campo +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - mano cerca de la cámara +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (por defecto) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - mano lejos de la cámara +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Controla la distancia entre la mano y la cámara. +of.options.shaders.HAND_DEPTH_MUL.tooltip.6= +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Puede cambiar el desenfoque producido en la mano +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=por las shaders que usan blur. + +of.options.shaders.CLOUD_SHADOW=Sombras de nubes + +of.options.shaders.OLD_HAND_LIGHT=LC manos +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Luz clásica (LC) en la mano +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Por defecto - controlado por shaders +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= SÍ - usar el sistema clásico +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= NO - usar el sistema nuevo +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=La luz clásica permite que los objetos diseñados +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=para emitir luz en la mano principal, también +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=lo hagan en la mano secundaria. + +of.options.shaders.OLD_LIGHTING=LC +of.options.shaders.OLD_LIGHTING.tooltip.1=Luz clásica (LC) +of.options.shaders.OLD_LIGHTING.tooltip.2= Por defecto - controlado por shaders +of.options.shaders.OLD_LIGHTING.tooltip.3= SÍ - usar luz clásica +of.options.shaders.OLD_LIGHTING.tooltip.4= NO - no usar luz clásica +of.options.shaders.OLD_LIGHTING.tooltip.5=La luz clásica controla la iluminación estática de +of.options.shaders.OLD_LIGHTING.tooltip.6=Minecraft normal a los lados del bloque. +of.options.shaders.OLD_LIGHTING.tooltip.7=Algunas shaders suelen proporcionar una iluminación +of.options.shaders.OLD_LIGHTING.tooltip.8=mejorada que varía según la posición del sol. + +of.options.shaders.DOWNLOAD=Descargar shaders +of.options.shaders.DOWNLOAD.tooltip.1= +of.options.shaders.DOWNLOAD.tooltip.2=Para descargarte un paquete de shaders: +of.options.shaders.DOWNLOAD.tooltip.3=1. Abre la web de shaders en tu navegador. +of.options.shaders.DOWNLOAD.tooltip.4=2. Descárgate las shaders que te gusten. +of.options.shaders.DOWNLOAD.tooltip.5=3. Abre "Carpeta de shaders" y cópialas. +of.options.shaders.DOWNLOAD.tooltip.6= +of.options.shaders.DOWNLOAD.tooltip.7=Fácil, sencillo y para toda la familia. + +of.options.shaders.SHADER_PACK=Paquete de shader + +of.options.shaders.shadersFolder=Carpeta de shaders +of.options.shaders.shaderOptions=Opciones de shader... + +of.options.shaderOptionsTitle=Opciones de shader + +of.options.quality=Calidad... +of.options.qualityTitle=Opciones de calidad gráfica + +of.options.details=Detalles... +of.options.detailsTitle=Opciones de detalles gráficos + +of.options.performance=Rendimiento... +of.options.performanceTitle=Opciones de rendimiento + +of.options.animations=Animaciones... +of.options.animationsTitle=Activar o desactivar animaciones + +of.options.other=Opciones varias... +of.options.otherTitle=Opciones varias + +of.options.other.reset=Restablecer toda la configuración... + +of.shaders.profile=Perfil + +# Quality + +of.options.mipmap.bilinear=Bilineal +of.options.mipmap.linear=Lineal +of.options.mipmap.nearest=Cercano +of.options.mipmap.trilinear=Trilineal + +options.mipmapLevels.tooltip.1=Efecto visual que hace que los objetos lejanos luzcan +options.mipmapLevels.tooltip.2=mejor gracias a que suaviza los detalles de su textura +options.mipmapLevels.tooltip.3= +options.mipmapLevels.tooltip.4= NO - sin suavizado +options.mipmapLevels.tooltip.5= 1 - suavizado mínimo +options.mipmapLevels.tooltip.6= 4 - suavizado máximo +options.mipmapLevels.tooltip.7= +options.mipmapLevels.tooltip.8=Normalmente esta opción no afecta al rendimiento. + +of.options.MIPMAP_TYPE=Tipo de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Efecto visual que hace que los objetos lejanos luzcan +of.options.MIPMAP_TYPE.tooltip.2=mejor gracias a que suaviza los detalles de su textura +of.options.MIPMAP_TYPE.tooltip.3= +of.options.MIPMAP_TYPE.tooltip.4= Cercano - suavizado bruto (más rápido) +of.options.MIPMAP_TYPE.tooltip.5= Lineal - suavizado normal +of.options.MIPMAP_TYPE.tooltip.6= Bilineal - suavizado fino +of.options.MIPMAP_TYPE.tooltip.7= Trilineal - suavizado muy fino (más lento) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing suaviza líneas y bordes de los bloques +of.options.AA_LEVEL.tooltip.2= NO - (por defecto) sin antialiasing (más rápido) +of.options.AA_LEVEL.tooltip.3= 2-16 - nivel de suavizado del antialiasing (más lento) +of.options.AA_LEVEL.tooltip.4= +of.options.AA_LEVEL.tooltip.5= Suaviza los dientes de sierra y mejora la nitidez. +of.options.AA_LEVEL.tooltip.6=Los FPS pueden disminuir considerablemente al activarse. +of.options.AA_LEVEL.tooltip.7=Algunas tarjetas gráficas no soportan todos los niveles. +of.options.AA_LEVEL.tooltip.8= ¡El cambio será aplicado al REINICIAR el juego! + +of.options.AF_LEVEL=Anisotrópico +of.options.AF_LEVEL.tooltip.1=Filtro anisotrópico +of.options.AF_LEVEL.tooltip.2= NO - (por defecto) detalle normal de texturas (rápido) +of.options.AF_LEVEL.tooltip.3= 2-16 - refinar texturas al usar mipmap (más lento) +of.options.AF_LEVEL.tooltip.4= +of.options.AF_LEVEL.tooltip.5= +of.options.AF_LEVEL.tooltip.6=Este filtro recupera detalles al usar mipmap. +of.options.AF_LEVEL.tooltip.7=Los FPS pueden disminuir considerablemente al activarse. + +of.options.CLEAR_WATER=Aguas cristalinas +of.options.CLEAR_WATER.tooltip.1=Aguas cristalinas +of.options.CLEAR_WATER.tooltip.2= SÍ - agua limpia y transparente +of.options.CLEAR_WATER.tooltip.3= NO - agua predeterminada del juego + +of.options.RANDOM_ENTITIES=Entidades aleatorias +of.options.RANDOM_ENTITIES.tooltip.1=Si una entidad tiene más de una textura... +of.options.RANDOM_ENTITIES.tooltip.2= NO - una única textura, más rápido +of.options.RANDOM_ENTITIES.tooltip.3= SÍ - texturas aleatorias, más lento +of.options.RANDOM_ENTITIES.tooltip.4= +of.options.RANDOM_ENTITIES.tooltip.5=Requiere un paquete de recursos que tenga varias +of.options.RANDOM_ENTITIES.tooltip.6=texturas para una misma entidad. + +of.options.BETTER_GRASS=Césped mejorado +of.options.BETTER_GRASS.tooltip.1=Textura de los lados del bloque de césped mejorada +of.options.BETTER_GRASS.tooltip.2= NO - césped normal (por defecto), más rápido +of.options.BETTER_GRASS.tooltip.3= Rápidos - todo el bloque lleno de césped, más lento +of.options.BETTER_GRASS.tooltip.4= Detallados - textura dinámica, mucho más lento + +of.options.BETTER_SNOW=Nieve mejorada +of.options.BETTER_SNOW.tooltip.1=Nieve mejorada +of.options.BETTER_SNOW.tooltip.2= NO - nieve predeterminada, más rápido +of.options.BETTER_SNOW.tooltip.3= SÍ - nieve mejorada, más lento +of.options.BETTER_SNOW.tooltip.4= +of.options.BETTER_SNOW.tooltip.5=Mostrar nieve debajo de los bloques transparantes +of.options.BETTER_SNOW.tooltip.6=(vallas, hierbas) al bordearlos con nieve. + +of.options.CUSTOM_FONTS=Fuentes personalizadas +of.options.CUSTOM_FONTS.tooltip.1=Fuentes personalizadas +of.options.CUSTOM_FONTS.tooltip.2= SÍ - usar personalizadas (por defecto), más lento +of.options.CUSTOM_FONTS.tooltip.3= NO - usar la predeterminada, más rápido +of.options.CUSTOM_FONTS.tooltip.4= +of.options.CUSTOM_FONTS.tooltip.5=Algunos paquetes de recursos tienen fuentes +of.options.CUSTOM_FONTS.tooltip.6=personalizadas. + +of.options.CUSTOM_COLORS=Colores personalizados +of.options.CUSTOM_COLORS.tooltip.1=Colores personalizados +of.options.CUSTOM_COLORS.tooltip.2= SÍ - colores personalizados (por defecto), más lento +of.options.CUSTOM_COLORS.tooltip.3= NO - colores predeterminados, más rápido +of.options.CUSTOM_COLORS.tooltip.4= +of.options.CUSTOM_COLORS.tooltip.5=Algunos paquetes de recursos tienen colores +of.options.CUSTOM_COLORS.tooltip.6=personalizados. + +of.options.SWAMP_COLORS=Color de pantanos +of.options.SWAMP_COLORS.tooltip.1=Color de pantanos +of.options.SWAMP_COLORS.tooltip.2= SÍ - color en pantanos (por defecto), más lento +of.options.SWAMP_COLORS.tooltip.3= NO - sin color en los pantanos, más rápido +of.options.SWAMP_COLORS.tooltip.4=Afecta a: césped, agua, hojas y enredaderas. + +of.options.SMOOTH_BIOMES=Suavizar biomas +of.options.SMOOTH_BIOMES.tooltip.1=Suavizar transición entre biomas +of.options.SMOOTH_BIOMES.tooltip.2= SÍ - suavizar cambio entre biomas (por defecto), más lento +of.options.SMOOTH_BIOMES.tooltip.3= NO - no suavizar cambio entre biomas, más rápido +of.options.SMOOTH_BIOMES.tooltip.4= +of.options.SMOOTH_BIOMES.tooltip.5=El suavizado se realiza mediante un degradado de color +of.options.SMOOTH_BIOMES.tooltip.6=a los bloques cercanos al borde de cada bioma. +of.options.SMOOTH_BIOMES.tooltip.7=Afecta a: césped, agua, hojas y enredaderas. + +of.options.CONNECTED_TEXTURES=Bloques unidos +of.options.CONNECTED_TEXTURES.tooltip.1=Unir texturas de ciertos bloques +of.options.CONNECTED_TEXTURES.tooltip.2= NO - no unirlas (por defecto) +of.options.CONNECTED_TEXTURES.tooltip.3= Rápidos - unirlas de forma rápida +of.options.CONNECTED_TEXTURES.tooltip.4= Detallados - unirlas de forma mejorada +of.options.CONNECTED_TEXTURES.tooltip.5= +of.options.CONNECTED_TEXTURES.tooltip.6=Unir las texturas de los cristales, de la arenisca y de +of.options.CONNECTED_TEXTURES.tooltip.7=las librerías al juntar los bloques. +of.options.CONNECTED_TEXTURES.tooltip.8=No todos los paquetes de recursos soportan esta opción. + +of.options.NATURAL_TEXTURES=Texturas naturales +of.options.NATURAL_TEXTURES.tooltip.1=Texturas naturales +of.options.NATURAL_TEXTURES.tooltip.2= NO - sin texturas naturales (por defecto) +of.options.NATURAL_TEXTURES.tooltip.3= SÍ - con texturas naturales +of.options.NATURAL_TEXTURES.tooltip.4=Esta opción elimina el patrón de los bloques +of.options.NATURAL_TEXTURES.tooltip.5=que se crea al poner bloques del mismo tipo. +of.options.NATURAL_TEXTURES.tooltip.6=Se usan variantes rotadas y voleteadas de la textura +of.options.NATURAL_TEXTURES.tooltip.7=base del bloque. +of.options.NATURAL_TEXTURES.tooltip.8=No todos los paquetes de recursos soportan esta opción. + +of.options.EMISSIVE_TEXTURES=Texturas emisivas +of.options.EMISSIVE_TEXTURES.tooltip.1=Texturas emisivas +of.options.EMISSIVE_TEXTURES.tooltip.2= NO - sin texturas emisivas (por defecto) +of.options.EMISSIVE_TEXTURES.tooltip.3= SÍ - con texturas emisivas +of.options.EMISSIVE_TEXTURES.tooltip.4=Las texturas emisivas aparecen superpuestas con +of.options.EMISSIVE_TEXTURES.tooltip.5=el brillo al máximo. Pueden usarse para simular +of.options.EMISSIVE_TEXTURES.tooltip.6=emisión de luz en ciertas partes de una textura base. +of.options.EMISSIVE_TEXTURES.tooltip.7= +of.options.EMISSIVE_TEXTURES.tooltip.8=No todos los paquetes de recursos soportan esta opción. + +of.options.CUSTOM_SKY=Cielo personalizado +of.options.CUSTOM_SKY.tooltip.1=Textura personalizada del cielo +of.options.CUSTOM_SKY.tooltip.2= SÍ - cielo personalizado (por defecto), más lento +of.options.CUSTOM_SKY.tooltip.3= NO - cielo predeterminado, más rápido +of.options.CUSTOM_SKY.tooltip.4= +of.options.CUSTOM_SKY.tooltip.5=No todos los paquetes de recursos soportan esta opción. + +of.options.CUSTOM_ITEMS=Objetos personalizados +of.options.CUSTOM_ITEMS.tooltip.1=Textura personalizada de objetos (ítems) +of.options.CUSTOM_ITEMS.tooltip.2= SÍ - objetos personalizadas (por defecto), más lento +of.options.CUSTOM_ITEMS.tooltip.3= NO - objetos predeterminados, más rápido +of.options.CUSTOM_ITEMS.tooltip.4= +of.options.CUSTOM_ITEMS.tooltip.5=No todos los paquetes de recursos soportan esta opción. + +of.options.CUSTOM_ENTITY_MODELS=Entidades personalizadas +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Textura personalizada de las entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= SÍ - variar modelos de entidades (por defecto), más lento +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= NO - usar modelos predeterminados, más rápido +of.options.CUSTOM_ENTITY_MODELS.tooltip.4= +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=No todos los paquetes de recursos soportan esta opción. + +of.options.CUSTOM_GUIS=Interfaz personalizada +of.options.CUSTOM_GUIS.tooltip.1=Interfaz del juego (GUI) personalizada +of.options.CUSTOM_GUIS.tooltip.2= SÍ - interfaz personalizada (por defecto), más lento +of.options.CUSTOM_GUIS.tooltip.3= NO - interfaz original, más rápido +of.options.CUSTOM_GUIS.tooltip.4= +of.options.CUSTOM_GUIS.tooltip.5=No todos los paquetes de recursos soportan esta opción. + +# Details + +of.options.CLOUDS=Nubes +of.options.CLOUDS.tooltip.1=Calidad de las nubes +of.options.CLOUDS.tooltip.2= Por defecto - depende del ajuste de gráficos +of.options.CLOUDS.tooltip.3= Rápidas - peor calidad, mejor rendimiento +of.options.CLOUDS.tooltip.4= Detalladas - mayor calidad, peor rendimiento +of.options.CLOUDS.tooltip.5= NO - sin nubes, rendimiento superrápido +of.options.CLOUDS.tooltip.6= +of.options.CLOUDS.tooltip.7=Las nubes rápidas se renderizan en 2D. +of.options.CLOUDS.tooltip.8=Las nubes detalladas se renderizan en 3D. + +of.options.CLOUD_HEIGHT=Elevación de nubes +of.options.CLOUD_HEIGHT.tooltip.1=Editar altura a la que se muestran las nubes +of.options.CLOUD_HEIGHT.tooltip.2= NO - altura por defecto +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - encima del límite del mundo + +of.options.TREES=Árboles +of.options.TREES.tooltip.1=Calidad de hojas de árboles +of.options.TREES.tooltip.2= Por defecto - depende del ajuste de gráficos +of.options.TREES.tooltip.3= Rápidos - baja calidad, mejor rendimiento +of.options.TREES.tooltip.4= Inteligentes - más calidad, rendimiento medio +of.options.TREES.tooltip.5= Detallados - máxima calidad, peor rendimiento +of.options.TREES.tooltip.6= +of.options.TREES.tooltip.7=La calidad rápida dejará las hojas sin transparencia. +of.options.TREES.tooltip.8="Detallados" e "Inteligentes" sí mantienen la transparencia. + +of.options.RAIN=Lluvia/Nieve +of.options.RAIN.tooltip.1=Lluvia y nieve +of.options.RAIN.tooltip.2= Por defecto - depende del ajuste de gráficos +of.options.RAIN.tooltip.3= Rápidos - lluvia/nieve ligera, más rápido +of.options.RAIN.tooltip.4= Detallados - lluvia/nieve intensa, más lento +of.options.RAIN.tooltip.5= NO - sin lluvia/nieve, fastest +of.options.RAIN.tooltip.6= +of.options.RAIN.tooltip.7=Aunque se desactive la lluvia, el sonido +of.options.RAIN.tooltip.8=sigue estando activado. + +of.options.SKY=Cielo +of.options.SKY.tooltip.1=Cielo +of.options.SKY.tooltip.2= SÍ - cielo visible, más lento +of.options.SKY.tooltip.3= NO - cielo no visible, más lento +of.options.SKY.tooltip.4= +of.options.SKY.tooltip.5=Aunque se desactive, la Luna y el Sol se podrán +of.options.SKY.tooltip.6=seguir viendo. + +of.options.STARS=Cielo estrellado +of.options.STARS.tooltip.1=Visibilidad de estrellas en el cielo nocturno +of.options.STARS.tooltip.2= SÍ - estrellas, más lento +of.options.STARS.tooltip.3= NO - sin estrellas, más rápido + +of.options.SUN_MOON=Sol/Luna +of.options.SUN_MOON.tooltip.1=Visibilidad del Sol y la Luna +of.options.SUN_MOON.tooltip.2= SÍ - el Sol y la Luna SÍ son visibles (por defecto) +of.options.SUN_MOON.tooltip.3= NO - el Sol y la Luna NO son visibles (rápido) + +of.options.SHOW_CAPES=Capas +of.options.SHOW_CAPES.tooltip.1=Capas de jugadores +of.options.SHOW_CAPES.tooltip.2= SÍ - mostrar las capas de los jugadores (por defecto) +of.options.SHOW_CAPES.tooltip.3= NO - ocultar las capas de los jugadores + +of.options.TRANSLUCENT_BLOCKS=Bl. translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Bloques translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Detallados - mezcla de colores perfecta (por defecto) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rápidos - mezcla de colores cutre (más rápido) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Esta opción afecta a los bloques translúcidos que tienen +of.options.TRANSLUCENT_BLOCKS.tooltip.6=color pero sólo cuando se colocan uno detrás del otro +of.options.TRANSLUCENT_BLOCKS.tooltip.7=con un bloque vacío entre ambos. +of.options.TRANSLUCENT_BLOCKS.tooltip.8=Afecta a: cristal tintado, agua, hielo... + +of.options.HELD_ITEM_TOOLTIPS=Texto en barra inferior +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Nombre de objetos en la barra inferior +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= SÍ - mostrar nombres (por defecto) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= NO - no mostrar nombres (como antiguamente) + +of.options.DROPPED_ITEMS=Objetos +of.options.DROPPED_ITEMS.tooltip.1=Calidad de los objetos en el suelo sin recoger +of.options.DROPPED_ITEMS.tooltip.2= Por defecto - depende del ajuste de gráficos +of.options.DROPPED_ITEMS.tooltip.3= Rápidos - objetos en 2D, más rápido +of.options.DROPPED_ITEMS.tooltip.4= Detallados - objetos en 3D, más lento pero más bonito + +options.entityShadows.tooltip.1=Sombras de entidades +options.entityShadows.tooltip.2= SÍ - mostrar sombras en las entidades +options.entityShadows.tooltip.3= NO - no mostrar sombras en las entidades + +of.options.VIGNETTE=Bordes +of.options.VIGNETTE.tooltip.1=(Efecto viñeta) oscurece las esquinas de la pantalla +of.options.VIGNETTE.tooltip.2= Por defecto - depende del ajuste de gráficos +of.options.VIGNETTE.tooltip.3= Rápidos - efecto viñeta desactivado (más rápido) +of.options.VIGNETTE.tooltip.4= Detallados - efecto viñeta activado (más lento) +of.options.VIGNETTE.tooltip.5= +of.options.VIGNETTE.tooltip.6=Los FPS pueden disminuir considerablemente al activarse, +of.options.VIGNETTE.tooltip.7=sobretodo en pantalla completa. +of.options.VIGNETTE.tooltip.8=El efecto viñeta se puede deshabilitar sin ningún problema. + +of.options.DYNAMIC_FOV=Campo de visión dinámico +of.options.DYNAMIC_FOV.tooltip.1=Campo de visión dinámico +of.options.DYNAMIC_FOV.tooltip.2= SÍ - activarlo (por defecto) +of.options.DYNAMIC_FOV.tooltip.3= NO - desactivarlo +of.options.DYNAMIC_FOV.tooltip.4= +of.options.DYNAMIC_FOV.tooltip.5=Cambiar el campo de visión (FOV) al volar, correr o +of.options.DYNAMIC_FOV.tooltip.6=apuntar con un arco. + +of.options.DYNAMIC_LIGHTS=Ilum. dinámica +of.options.DYNAMIC_LIGHTS.tooltip.1=Iluminación dinámica +of.options.DYNAMIC_LIGHTS.tooltip.2= NO - sin. (por defecto) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rápidos - básica. (se actualiza cada 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Detallados - perfecta. (se actualiza en tiempo real) +of.options.DYNAMIC_LIGHTS.tooltip.5= +of.options.DYNAMIC_LIGHTS.tooltip.6=Permite a algunos objetos emitir luz sin estar colocados. +of.options.DYNAMIC_LIGHTS.tooltip.7=Al equipar uno de esos objetos en la mano, o al tirarlos, se +of.options.DYNAMIC_LIGHTS.tooltip.8=iluminará el entorno (afecta a: antorchas, piedra luminosa...). + +# Performance + +of.options.SMOOTH_FPS=Estabilizar FPS +of.options.SMOOTH_FPS.tooltip.1=Establizar FPS nivelando el búfer del controlador gráfico +of.options.SMOOTH_FPS.tooltip.2= NO - sin estabilización +of.options.SMOOTH_FPS.tooltip.3= SÍ - con estabilización +of.options.SMOOTH_FPS.tooltip.4= +of.options.SMOOTH_FPS.tooltip.5=Esta opción depende del controlador gráfico y su efecto +of.options.SMOOTH_FPS.tooltip.6=no siempre es notorio. + +of.options.SMOOTH_WORLD=Estabilizar mundos +of.options.SMOOTH_WORLD.tooltip.1=Eliminar los picos de lag causados por el servidor interno +of.options.SMOOTH_WORLD.tooltip.2= NO - sin estabilización +of.options.SMOOTH_WORLD.tooltip.3= SÍ - con estabilización +of.options.SMOOTH_WORLD.tooltip.4= +of.options.SMOOTH_WORLD.tooltip.5=Esta opción estabiliza los FPS distribuyendo la carga del +of.options.SMOOTH_WORLD.tooltip.6=servidor interno. +of.options.SMOOTH_WORLD.tooltip.7=No funciona en multijugador. + +of.options.FAST_RENDER=Renderizado rápido +of.options.FAST_RENDER.tooltip.1=Renderizar rápidamente +of.options.FAST_RENDER.tooltip.2= NO - renderizado estandar (por defecto) +of.options.FAST_RENDER.tooltip.3= SÍ - renderizado optimizado (rápido) +of.options.FAST_RENDER.tooltip.4= +of.options.FAST_RENDER.tooltip.5=Usa un algoritmo de renderizado mejorado que reduce el +of.options.FAST_RENDER.tooltip.6=consumo de GPU y aumenta los FPS. + +of.options.FAST_MATH=Matemática rápida +of.options.FAST_MATH.tooltip.1=Matemática rápida +of.options.FAST_MATH.tooltip.2= NO - estandar (por defecto) +of.options.FAST_MATH.tooltip.3= SÍ - sistema rápido +of.options.FAST_MATH.tooltip.4= +of.options.FAST_MATH.tooltip.5=Usar las funciones sin() y cos() de Java de forma +of.options.FAST_MATH.tooltip.6=optimizada para mejorar el uso de caché del CPU y +of.options.FAST_MATH.tooltip.7=aumentar los FPS. + +of.options.CHUNK_UPDATES=Actualizaciones de chunks +of.options.CHUNK_UPDATES.tooltip.1=Actualizaciones de chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - carga lenta, más FPS (por defecto) +of.options.CHUNK_UPDATES.tooltip.3= 3 - carga rápida, menos FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - carga superrápida, muchos menos FPS +of.options.CHUNK_UPDATES.tooltip.5= +of.options.CHUNK_UPDATES.tooltip.6=Número de chunks renderizados por cada fotograma. +of.options.CHUNK_UPDATES.tooltip.7=Los valores más altos pueden desestabilizar los FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Actualización dinámica +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Actualizaciones de chunks dinámicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= NO - (por defecto) carga normal por fotograma +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= SÍ - más actualizaciones mientras estés quieto +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4= +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=Esta opción fuerza la actualización de chunks mientras +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=estás quieto para cargar el mundo más rápidamente. + +of.options.LAZY_CHUNK_LOADING=Carga de chunks vaga +of.options.LAZY_CHUNK_LOADING.tooltip.1=Carga de chunks vaga +of.options.LAZY_CHUNK_LOADING.tooltip.2= NO - carga de chunks predeterminada +of.options.LAZY_CHUNK_LOADING.tooltip.3= SÍ - carga de chunks vaga (estabiliza la carga) +of.options.LAZY_CHUNK_LOADING.tooltip.4= +of.options.LAZY_CHUNK_LOADING.tooltip.5=Suaviza la carga interna de chunks distribuyéndola entre +of.options.LAZY_CHUNK_LOADING.tooltip.6=varios ticks. Desactívalo si algunas partes del mundo no +of.options.LAZY_CHUNK_LOADING.tooltip.7=se cargan correctamente. +of.options.LAZY_CHUNK_LOADING.tooltip.8=Sólo funciona en mundos locales con CPUs de un núcleo. + +of.options.RENDER_REGIONS=Render. por regiones +of.options.RENDER_REGIONS.tooltip.1=Renderizado por regiones +of.options.RENDER_REGIONS.tooltip.2= NO - no usar renderizado por regiones (por defecto) +of.options.RENDER_REGIONS.tooltip.3= SÍ - usar renderizado por regiones +of.options.RENDER_REGIONS.tooltip.4= +of.options.RENDER_REGIONS.tooltip.5=Permite renderizar el terreno muy rápidamente +of.options.RENDER_REGIONS.tooltip.6=cuando te encuentras a una gran altura. +of.options.RENDER_REGIONS.tooltip.7= +of.options.RENDER_REGIONS.tooltip.8=Es más efectivo si se activa "Usar VBOs" o "VBO". + +of.options.SMART_ANIMATIONS=Animaciones inteligentes +of.options.SMART_ANIMATIONS.tooltip.1=Animaciones inteligentes +of.options.SMART_ANIMATIONS.tooltip.2= NO - no usar animaciones inteligentes (por defecto) +of.options.SMART_ANIMATIONS.tooltip.3= SÍ - usar animaciones inteligentes +of.options.SMART_ANIMATIONS.tooltip.4= +of.options.SMART_ANIMATIONS.tooltip.5=Al activarse, sólo se animan las texturas visibles. +of.options.SMART_ANIMATIONS.tooltip.6=De esta forma se mejora mucho el rendimiento (más FPS). +of.options.SMART_ANIMATIONS.tooltip.7=Es muy útil cuando se usan grandes paquetes de mods +of.options.SMART_ANIMATIONS.tooltip.8=o paquetes de recursos de alta definición. + +# Animations + +of.options.animation.allOn=TODO SÍ +of.options.animation.allOff=TODO NO +of.options.animation.dynamic=Dinámicas + +of.options.ANIMATED_WATER=Agua +of.options.ANIMATED_LAVA=Lava +of.options.ANIMATED_FIRE=Fuego +of.options.ANIMATED_PORTAL=Portales +of.options.ANIMATED_REDSTONE=Redstone +of.options.ANIMATED_EXPLOSION=Explosiones +of.options.ANIMATED_FLAME=Llamaradas +of.options.ANIMATED_SMOKE=Humo +of.options.VOID_PARTICLES=Partículas del vacío +of.options.WATER_PARTICLES=Partículas del agua +of.options.RAIN_SPLASH=Salpicaduras de lluvia +of.options.PORTAL_PARTICLES=Partículas de portales +of.options.POTION_PARTICLES=Partículas de pociones +of.options.DRIPPING_WATER_LAVA=Goteo de agua/lava +of.options.ANIMATED_TERRAIN=Terreno animado +of.options.ANIMATED_TEXTURES=Texturas animadas +of.options.FIREWORK_PARTICLES=Partículas de cohetes + +# Other + +of.options.LAGOMETER=Medidor de lag +of.options.LAGOMETER.tooltip.1=Mostrar el medidor de lag al usar F3. +of.options.LAGOMETER.tooltip.2=* Naranja - Basura en la memoria +of.options.LAGOMETER.tooltip.3=* Cian - Ticks +of.options.LAGOMETER.tooltip.4=* Azul - Ejecutables programados +of.options.LAGOMETER.tooltip.5=* Morado - Carga de chunks +of.options.LAGOMETER.tooltip.6=* Rojo - Actualizaciones de chunks +of.options.LAGOMETER.tooltip.7=* Amarillo - Chequeo de visibilidad +of.options.LAGOMETER.tooltip.8=* Verde - Terreno renderizado + +of.options.PROFILER=Perfil debug +of.options.PROFILER.tooltip.1=Debug (también llamado depuración) +of.options.PROFILER.tooltip.2= SÍ - perfil debug activado, más lento +of.options.PROFILER.tooltip.3= NO - perfil debug desactivado, más rápido +of.options.PROFILER.tooltip.4=El perfil debug reúne y muestra más datos +of.options.PROFILER.tooltip.5=cuando se utiliza F3. + +of.options.WEATHER=Tiempo atmosférico +of.options.WEATHER.tooltip.1= +of.options.WEATHER.tooltip.2= SÍ - tiempo atmosférico, más lento +of.options.WEATHER.tooltip.3= NO - tiempo atmosférico, más rápido +of.options.WEATHER.tooltip.4= +of.options.WEATHER.tooltip.5=Afecta a: lluvia, nieve y tormentas. +of.options.WEATHER.tooltip.6=Esta opción no funciona en multijugador. + +of.options.time.dayOnly=Sólo día +of.options.time.nightOnly=Sólo noche + +of.options.TIME=Reloj +of.options.TIME.tooltip.1=Reloj (tiempo) +of.options.TIME.tooltip.2= Por defecto - ciclos normales de día/noche +of.options.TIME.tooltip.3= Sólo día - sólo es de día +of.options.TIME.tooltip.4= Sólo noche - sólo es de noche +of.options.TIME.tooltip.5=Esta opción sólo funciona en modo creativo y solamente +of.options.TIME.tooltip.6=en mundos locales (en multijugador NO). + +options.fullscreen.tooltip.1=Pantalla completa +options.fullscreen.tooltip.2= SÍ - jugar en pantalla completa +options.fullscreen.tooltip.3= NO - jugar en ventana +options.fullscreen.tooltip.4=Al jugar en pantalla completa el juego puede funcionar +options.fullscreen.tooltip.5=mejor o peor, depende de la tarjeta gráfica. + +of.options.FULLSCREEN_MODE=Resolución +of.options.FULLSCREEN_MODE.tooltip.1=Resolución de pantalla completa +of.options.FULLSCREEN_MODE.tooltip.2= Por defecto - resolución del monitor, más lento +of.options.FULLSCREEN_MODE.tooltip.3= Ancho x alto - otra resolución, puede ir más rápido +of.options.FULLSCREEN_MODE.tooltip.4=La resolución cambiará en la pantalla completa (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Normalmente las más bajas aumentan el rendimiento. + +of.options.SHOW_FPS=Mostrar FPS +of.options.SHOW_FPS.tooltip.1=Mostrar FPS y datos de renderizado +of.options.SHOW_FPS.tooltip.2= C: - chunks renderizados +of.options.SHOW_FPS.tooltip.3= E: - entidades renderizadas + "block entities" +of.options.SHOW_FPS.tooltip.4= U: - actualizaciones de chunks +of.options.SHOW_FPS.tooltip.5= +of.options.SHOW_FPS.tooltip.6=Estos reducidos datos sólo se muestran cuando no se +of.options.SHOW_FPS.tooltip.7=usa F3. + +of.options.save.default=Original (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autoguardado +of.options.AUTOSAVE_TICKS.tooltip.1=Intervalo del autoguardado +of.options.AUTOSAVE_TICKS.tooltip.2=El original del juego (cada 2 seg.) NO SE RECOMIENDA. +of.options.AUTOSAVE_TICKS.tooltip.3=Ponerlo cada poco tiempo puede causar mal rendimiento. + +options.anaglyph.tooltip.1=Visión en 3D + +of.options.SCREENSHOT_SIZE=Capturas +of.options.SCREENSHOT_SIZE.tooltip.1=Tamaño de las capturas de pantalla +of.options.SCREENSHOT_SIZE.tooltip.2= Por defecto - tamaño normal +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - tamaños personalizados +of.options.SCREENSHOT_SIZE.tooltip.4= +of.options.SCREENSHOT_SIZE.tooltip.5=Las capturas ocuparán más espacio al aumentar el tamaño. +of.options.SCREENSHOT_SIZE.tooltip.6=No es compatible con Renderizado rápido ni con Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.7=Requiere que tu tarjeta gráfica soporte Framebuffer. + +of.options.ADVANCED_TOOLTIPS=Descripciones de objetos +of.options.ADVANCED_TOOLTIPS.tooltip.1=Descripciones de objetos en el inventario +of.options.ADVANCED_TOOLTIPS.tooltip.2= SÍ - mostrar descripciones +of.options.ADVANCED_TOOLTIPS.tooltip.3= NO - no mostras descripciones (por defecto) +of.options.ADVANCED_TOOLTIPS.tooltip.4= +of.options.ADVANCED_TOOLTIPS.tooltip.5=Esta opción permite ver información más detallada sobre +of.options.ADVANCED_TOOLTIPS.tooltip.6=objetos (ID, durabilidad) y shaders (ID, fuente, +of.options.ADVANCED_TOOLTIPS.tooltip.7=valor predeterminado). + +of.options.SHOW_GL_ERRORS=Mostrar errores de GL +of.options.SHOW_GL_ERRORS.tooltip.1=Mostrar errores de OpenGL +of.options.SHOW_GL_ERRORS.tooltip.2=Al activarse, los errores se muestran en el chat. +of.options.SHOW_GL_ERRORS.tooltip.3=Desactívalo si hay un problema irresoluble para +of.options.SHOW_GL_ERRORS.tooltip.4=que los errores no te molesten. +of.options.SHOW_GL_ERRORS.tooltip.5= +of.options.SHOW_GL_ERRORS.tooltip.6=Aunque se desactive, los errores siguen apareciendo en +of.options.SHOW_GL_ERRORS.tooltip.7=el registro (log) y pueden seguir causando FPS inestables. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Fondo de chat +of.options.CHAT_BACKGROUND.tooltip.1=Fondo de chat +of.options.CHAT_BACKGROUND.tooltip.2= Por defecto - el fondo aparece con un tamaño estático +of.options.CHAT_BACKGROUND.tooltip.3= Compacto - el fondo aparece con un tamaño adaptado al texto +of.options.CHAT_BACKGROUND.tooltip.4= NO - sin fondo + +of.options.CHAT_SHADOW=Sombreado de chat +of.options.CHAT_SHADOW.tooltip.1=Añadir sombra al texto del chat +of.options.CHAT_SHADOW.tooltip.2= SÍ - sombrearlo +of.options.CHAT_SHADOW.tooltip.3= NO - sin sombrearlo diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/es_MX.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/es_MX.lang new file mode 100644 index 0000000..446c174 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/es_MX.lang @@ -0,0 +1,528 @@ +# General +of.general.ambiguous=ambiguo +of.general.custom=Personalizado +of.general.from=De +of.general.id=ID +of.general.restart=reiniciar +of.general.smart=Dinámico + +# Message +of.message.aa.shaders1=El anti-aliasing no es compatible con Shaders. +of.message.aa.shaders2=Desactiva Shaders para habilitar esta opción. + +of.message.af.shaders1=El filtrado anisotrópico no es compatible con Shaders. +of.message.af.shaders2=Desactiva Shaders para habilitar esta opción. + +of.message.fr.shaders1=El renderizado rápido no es compatible con Shaders. +of.message.fr.shaders2=Desactiva Shaders para habilitar esta opción. + +of.message.shaders.aa1=Shaders no es compatible con el anti-aliasing activo. +of.message.shaders.aa2=Desactiva la opción ‘anti-aliasing’ en el menú ‘calidad’ y reinicia el juego. + +of.message.shaders.af1=Shaders no es compatible con el filtrado anisótropico activo. +of.message.shaders.af2=Desactiva la opción ‘filtrado antisotrópico’ en el menú ‘calidad’. + +of.message.shaders.fr1=Shaders no es compatible con el renderizado rapido activo. +of.message.shaders.fr2=Desactiva la opción ‘renderizado rapido' en el menú ‘rendimiento’. + +of.message.newVersion=§fUna nueva versión de §eOptiFine §festá disponible: §e%s§f +of.message.java64Bit=§fPrueba instalar §eJava versión de 64bits §fpara incrementar el rendimiento. +of.message.openglError=§eError de OpenGL§f: %s (%s) + +of.message.shaders.loading=Cargando shaders: %s + +of.message.other.reset=¿Quieres reiniciar la configuración de video a los valores de inicio? + +# Video settings + +options.graphics.tooltip.1=Calidad visual. +options.graphics.tooltip.2= Rápida - Mayor velocidad. +options.graphics.tooltip.3= Detallada - Mejor apariencia. +options.graphics.tooltip.4=Cambia la apariencia de nubes, hojas, agua, +options.graphics.tooltip.5=sombras y bloques con pasto. + +of.options.renderDistance.extreme=Extremo + +options.renderDistance.tooltip.1=Distancia de renderizado. +options.renderDistance.tooltip.2= 2 Mínimo - 32 bloques. (más rápido) +options.renderDistance.tooltip.3= 4 Corto - 64 bloques. +options.renderDistance.tooltip.4= 8 Normal - 128 bloques. +options.renderDistance.tooltip.5= 16 Lejano - 256 bloques. +options.renderDistance.tooltip.6= 32 Extremo - 512 bloques. (más lento) +options.renderDistance.tooltip.7=La distancia de renderizado extrema demanda más recursos. +options.renderDistance.tooltip.8=Valores sobre de 16 solo son efectivos en mundos locales. + +options.ao.tooltip.1=Iluminación suave. +options.ao.tooltip.2= NO - Sin suavizado de iluminación. (rápido) +options.ao.tooltip.3= Mínima - Simple, rudo, inceirto. (lento) +options.ao.tooltip.4= Máxima - Agradable, uniforme, neto. (más lento) + +options.framerateLimit.tooltip.1=Restricción de FPS. +options.framerateLimit.tooltip.2= VSync - Reduce los FPS a 60, 30 o 20. +options.framerateLimit.tooltip.3= 5-255 - Cambiante. +options.framerateLimit.tooltip.4= Ilimitados - Excento, sin límites. +options.framerateLimit.tooltip.5=Los cuadros por segundo son reducidos aun si el +options.framerateLimit.tooltip.6=límite no es alcanzado. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Suavizado de iluminación +of.options.AO_LEVEL.tooltip.1=Nivel de iluminación suave. +of.options.AO_LEVEL.tooltip.2= NO - Sin sombras. +of.options.AO_LEVEL.tooltip.3= 50%% - Sombras claras. +of.options.AO_LEVEL.tooltip.4= 100%% - Sombras oscuras. + +options.viewBobbing.tooltip.1=Movimiento de la cámara al caminar. Más realista. +options.viewBobbing.tooltip.2=Para mejores resultados, desactivar cundo utilice mipmaps. + +options.guiScale.tooltip.1=Escala de interfaz. +options.guiScale.tooltip.2=Entre más pequeño podría ser más rápido. + +options.vbo=VBO +options.vbo.tooltip.1=Vertex Buffer Objects (OpenGL). +options.vbo.tooltip.2=Utiliza un modelo alternativo de renderizado que incrementa +options.vbo.tooltip.3=la velocidad de 5 a 10%% que el renderizado habitual. + +options.gamma.tooltip.1=Incrementa el brillo en objetos oscuros. +options.gamma.tooltip.2= Moderado - Brillo por defecto. +options.gamma.tooltip.3= Claro - Máximo brillo. +options.gamma.tooltip.4=Esta opción no afecta el brillo de objetos +options.gamma.tooltip.5=completamente oscurecidos. + +options.anaglyph.tooltip.1=Anaglifo 3D. +options.anaglyph.tooltip.2=Habilita un efecto estereoscópico 3D con diferente color +options.anaglyph.tooltip.3=para cada ojo. +options.anaglyph.tooltip.4=Requiere de lentes 3D rojo-azul para una vista apropiada. + +options.blockAlternatives.tooltip.1=Bloques alternativos. +options.blockAlternatives.tooltip.2=Usa modelos alternativos en algunos bloques. +options.blockAlternatives.tooltip.3=Depende del paquete de texturas seleccionado. + +of.options.FOG_FANCY=Neblina +of.options.FOG_FANCY.tooltip.1=Tipo de neblina. +of.options.FOG_FANCY.tooltip.2= NO - Sin neblina, rápido. +of.options.FOG_FANCY.tooltip.3= Rápida - Neblina ligera. +of.options.FOG_FANCY.tooltip.4= Detallada - Neblina lenta, se ve mejor. +of.options.FOG_FANCY.tooltip.5=La neblina detallada solo está disponible si su tarjeta +of.options.FOG_FANCY.tooltip.6=de video lo soporta. + +of.options.FOG_START=Distancia de neblina +of.options.FOG_START.tooltip.1=Donde empieza a verse la neblina. +of.options.FOG_START.tooltip.2= 0.2 - Desde cerca del jugador. +of.options.FOG_START.tooltip.3= 0.8 - Desde lejos del jugador. +of.options.FOG_START.tooltip.4=Esta opción normalmente no afecta el rendimiento. + +of.options.CHUNK_LOADING=Carga de Chunks +of.options.CHUNK_LOADING.tooltip.1=Opción de carga de los pedazos del mapa (chunks). +of.options.CHUNK_LOADING.tooltip.2= Normal - Cuadros por segundo (FPS) inestables al cargar chunks. +of.options.CHUNK_LOADING.tooltip.3= Agradable - FPS constantes. +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - FPS invariables y acelera la carga de los mapas. +of.options.CHUNK_LOADING.tooltip.5=Las opciónes de Agradable y Multi-Core estabilizan y evitan que el juego +of.options.CHUNK_LOADING.tooltip.6=se trabe al cargar chunks. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core aumenta hasta tres veces la velocidad de carga de los mapas +of.options.CHUNK_LOADING.tooltip.8=y también aumenta los FPS ocupando un segundo núcleo del procesador. +of.options.chunkLoading.smooth=Agradable +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=NINGUNO +of.options.shaders.packDefault=(interno) + +of.options.shaders.ANTIALIASING=Anti-aliasing +of.options.shaders.NORMAL_MAP=Mapa normal +of.options.shaders.SPECULAR_MAP=Mapa espectacular +of.options.shaders.RENDER_RES_MUL=Rendimiento +of.options.shaders.SHADOW_RES_MUL=Sombras +of.options.shaders.HAND_DEPTH_MUL=Profundidad +of.options.shaders.CLOUD_SHADOW=Sombra de nubes +of.options.shaders.OLD_LIGHTING=Iluminación vieja +of.options.shaders.SHADER_PACK=Paquete de shader + +of.options.shaders.shadersFolder=Folder de Shaders +of.options.shaders.shaderOptions=Opciones del Shader... + +of.options.shaderOptionsTitle=Opciones del Shader + +of.options.quality=Calidad... +of.options.qualityTitle=Configurar calidad. + +of.options.details=Detalles... +of.options.detailsTitle=Configurar detalles. + +of.options.performance=Rendimiento... +of.options.performanceTitle=Configuración del rendimiento. + +of.options.animations=Animaciones... +of.options.animationsTitle=Configuraciones de animaciones. + +of.options.other=Otro... +of.options.otherTitle=Otras configuraciones + +of.options.other.reset=Reiniciar la configuracion de video... + +of.shaders.profile=Perfil + +# Quality + +of.options.mipmap.bilinear=Bilinial +of.options.mipmap.linear=Lineal +of.options.mipmap.nearest=Más cercano +of.options.mipmap.trilinear=Trilineal + +options.mipmapLevels.tooltip.1=Efecto visual que mejora la apariencia de objetos lejanos +options.mipmapLevels.tooltip.2=suavizando los detalles de la textura al redimensionarla. +options.mipmapLevels.tooltip.3= NO - Sin suavizar. +options.mipmapLevels.tooltip.4= 1 – Suavizado mínimo. +options.mipmapLevels.tooltip.5= 4 – Suavizado máximo. +options.mipmapLevels.tooltip.6=Esta opción no suele afectar el rendimiento. + +of.options.MIPMAP_TYPE=Tipo de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Efecto visual que mejora la apariencia de objetos lejanos +of.options.MIPMAP_TYPE.tooltip.2=suavizando los detalles de la textura. +of.options.MIPMAP_TYPE.tooltip.3= Más cercano - Suavizado mínimo. (más rápido) +of.options.MIPMAP_TYPE.tooltip.4= Lineal – Suavizado bajo. +of.options.MIPMAP_TYPE.tooltip.5= Bilineal – Suavizado alto. +of.options.MIPMAP_TYPE.tooltip.6= Trilineal – Suavizado máximo. (más lento) + + +of.options.AA_LEVEL=Anti-aliasing +of.options.AA_LEVEL.tooltip.1=Anti-aliasing. +of.options.AA_LEVEL.tooltip.2= NO - Por defecto. (rápido) +of.options.AA_LEVEL.tooltip.3= 2-16 – Líneas y esquinas más definidas. (lento) +of.options.AA_LEVEL.tooltip.4=El antialiasing mejora y define los bordes de las líneas +of.options.AA_LEVEL.tooltip.5=y las profundas trancisiones de color. +of.options.AA_LEVEL.tooltip.6=Esta opción puede sustancialemnte disminuir los FPS. +of.options.AA_LEVEL.tooltip.7=No todos los niveles son soportados por todas las tarjetas de video. +of.options.AA_LEVEL.tooltip.8=Los cambios serán efectivos al reinicio. + +of.options.AF_LEVEL=Filtro anisotrópico +of.options.AF_LEVEL.tooltip.1=Filtrado anisotrópico. +of.options.AF_LEVEL.tooltip.2= NO - Por defecto. Sin efectos. (rápido) +of.options.AF_LEVEL.tooltip.3= 2-16 – Detalles más finos en texturas con mipmap. (lento) +of.options.AF_LEVEL.tooltip.4=El filtro anisotrópico reafirma detalles en texturas +of.options.AF_LEVEL.tooltip.5=que usan mipmap. +of.options.AF_LEVEL.tooltip.6=Esta opción puede disminuir los FPS. + +of.options.CLEAR_WATER=Claridad del agua +of.options.CLEAR_WATER.tooltip.1=Al sumergirse en ella. +of.options.CLEAR_WATER.tooltip.2= NO – Agua normal. +of.options.CLEAR_WATER.tooltip.3= SÍ – Agua más transparente. + +of.options.RANDOM_ENTITIES=Mobs aleatorios +of.options.RANDOM_ENTITIES.tooltip.1=Mobs aleaotrios. +of.options.RANDOM_ENTITIES.tooltip.2= NO – Sin skins aleatorios de mobs. (rápido) +of.options.RANDOM_ENTITIES.tooltip.3= SÍ – Skins de mobs aleatorios. (lento) +of.options.RANDOM_ENTITIES.tooltip.4=Esta opción habilita el uso de skins aleatorias para mobs por +of.options.RANDOM_ENTITIES.tooltip.5=lo que requiere de un paquete de texturas que los contenga. + +of.options.BETTER_GRASS=Pasto bonito +of.options.BETTER_GRASS.tooltip.1=Modifica como se ven los lados de los bloques de tierra con pasto. +of.options.BETTER_GRASS.tooltip.2= NO – Predeterminada. (rápido) +of.options.BETTER_GRASS.tooltip.3= Rápida – Todos los lados se ven de pasto. +of.options.BETTER_GRASS.tooltip.4= Detallada – Textura dinámica de pasto en los lados. (lento) + +of.options.BETTER_SNOW=Mejora de nieve +of.options.BETTER_SNOW.tooltip.1=Nieve especial. +of.options.BETTER_SNOW.tooltip.2= NO – Nieve por defecto. (rápido) +of.options.BETTER_SNOW.tooltip.3= SÍ – Mejora la nieve. (lento) +of.options.BETTER_SNOW.tooltip.4=Muestra nieve debajo de los bloques transparentes como vallas, +of.options.BETTER_SNOW.tooltip.5=pasto alto, cuando su base está rodeada por bloques de nieve. + +of.options.CUSTOM_FONTS=Fuentes personalizadas +of.options.CUSTOM_FONTS.tooltip.1=Cambia la tipografía del texto. +of.options.CUSTOM_FONTS.tooltip.2= NO – Utiliza la fuente de letra por defecto. (rápido) +of.options.CUSTOM_FONTS.tooltip.3= SÍ – Usar fuentes de letra personalizadas. (lento) +of.options.CUSTOM_FONTS.tooltip.4=Esta opción utiliza la fuente de letra que contenga el +of.options.CUSTOM_FONTS.tooltip.5=paquete de texturas seleccionado. + +of.options.CUSTOM_COLORS=Colores personalizadas +of.options.CUSTOM_COLORS.tooltip.1=Cambia los colores. +of.options.CUSTOM_COLORS.tooltip.2= NO - Por defecto. (rápido) +of.options.CUSTOM_COLORS.tooltip.3= SÍ – Utiliza otros colores. (lento) +of.options.CUSTOM_COLORS.tooltip.4=Esta opción emplea los colores que disponga del +of.options.CUSTOM_COLORS.tooltip.5=paquete de texturas seleccionado. + +of.options.SWAMP_COLORS=Colores pantanosos +of.options.SWAMP_COLORS.tooltip.1=Colores pantanosos. +of.options.SWAMP_COLORS.tooltip.2= NO – No usa colores pantanosos. (rápido) +of.options.SWAMP_COLORS.tooltip.3= SÍ - Usa colores pantanosos. (lento) +of.options.SWAMP_COLORS.tooltip.4=Esta opción afecta los colores del pasto, lianas, hojas y agua. + +of.options.SMOOTH_BIOMES=Biomas suavizados +of.options.SMOOTH_BIOMES.tooltip.1=Cambio entre biomas moderado y suavizado. +of.options.SMOOTH_BIOMES.tooltip.2= NO – Sin suavizado. (rápido) +of.options.SMOOTH_BIOMES.tooltip.3= SÍ – Suavizado. (lento) +of.options.SMOOTH_BIOMES.tooltip.4=El suavizado de las fronteras de los biomas colindantes se realiza +of.options.SMOOTH_BIOMES.tooltip.5=combinando y contemplando el color de los bloques de alrededor. +of.options.SMOOTH_BIOMES.tooltip.6=Solo afecta a hojas, pastos, lianas y agua. + +of.options.CONNECTED_TEXTURES=Texturas conectadas +of.options.CONNECTED_TEXTURES.tooltip.1=Textruas conectadas. +of.options.CONNECTED_TEXTURES.tooltip.2= NO – Sin texturas conectadas. Por defecto. +of.options.CONNECTED_TEXTURES.tooltip.3= Rápido – Texturas conectadas rápidas. +of.options.CONNECTED_TEXTURES.tooltip.4= Detallada – Texturas conectadas finas. +of.options.CONNECTED_TEXTURES.tooltip.5=Es la forma en la que la textura de los bloques de cristal, +of.options.CONNECTED_TEXTURES.tooltip.6=arena, librerías, se conectan entre sí cuando son puestas +of.options.CONNECTED_TEXTURES.tooltip.7=junto a otras del mismo. Las texturas como se unen +of.options.CONNECTED_TEXTURES.tooltip.8=depende del paquete de texturas seleccionado. + +of.options.NATURAL_TEXTURES=Texturas naturales +of.options.NATURAL_TEXTURES.tooltip.1=Apariencia normal y natural de la textura. +of.options.NATURAL_TEXTURES.tooltip.2= NO – Sin texturas mejoradas. Por defecto. +of.options.NATURAL_TEXTURES.tooltip.3= SÍ – Mejora la textura. +of.options.NATURAL_TEXTURES.tooltip.4=Esta opción evita que se tenga una visión repetitiva +of.options.NATURAL_TEXTURES.tooltip.5=de los bloques al juntar bloques del mismo tipo. +of.options.NATURAL_TEXTURES.tooltip.6=Usa variantes en el giro y la rotacón de la textura del +of.options.NATURAL_TEXTURES.tooltip.7=bloque. La configuración del ajuste depende del paquete +of.options.NATURAL_TEXTURES.tooltip.8=de texturas seleccionado. + +of.options.CUSTOM_SKY=Cielo personalizado +of.options.CUSTOM_SKY.tooltip.1=Cielo personalizado. +of.options.CUSTOM_SKY.tooltip.2= NO – Cielo predeterminado. (rápido) +of.options.CUSTOM_SKY.tooltip.3= SÍ – Texturas del cielo personalizadas. Por defecto. (lento) +of.options.CUSTOM_SKY.tooltip.4=La textura para el cielo personalizado es obtenida del +of.options.CUSTOM_SKY.tooltip.5=paquete de texturas seleccionado. + +of.options.CUSTOM_ITEMS=Obejetos personalizados +of.options.CUSTOM_ITEMS.tooltip.1=Usa texturas para los objetos. +of.options.CUSTOM_ITEMS.tooltip.2= NO – Texturas de objetos predeterminadas. (rápido) +of.options.CUSTOM_ITEMS.tooltip.3= SÍ – Texturas de objetos personalizadas. Por defecto. (lento) +of.options.CUSTOM_ITEMS.tooltip.4=Las texturas de los objetos personalizados se obtienen del +of.options.CUSTOM_ITEMS.tooltip.5=paquete de texturas seleccionado. + +# Details + +of.options.CLOUDS=Nube +of.options.CLOUDS.tooltip.1=Como se ven las nubes. +of.options.CLOUDS.tooltip.2= NO - Sin nubes. (más rápido) +of.options.CLOUDS.tooltip.3= Normal - Establecido en la configuración de calidad visual. +of.options.CLOUDS.tooltip.4= Rápida - Menor calidad. (rápido) +of.options.CLOUDS.tooltip.5= Detallada - Alta calidad. (lento) +of.options.CLOUDS.tooltip.6=Las nubes con menor calidad son renderizadas en 2D. +of.options.CLOUDS.tooltip.7=Las nubes con calidad alta son renderizadas en 3D. + +of.options.CLOUD_HEIGHT=Altitud de nube +of.options.CLOUD_HEIGHT.tooltip.1=Que tan arriba se muestran las nubes. +of.options.CLOUD_HEIGHT.tooltip.2= NO - Altitud por defecto. +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - Por encima del límite de altitud. + +of.options.TREES=Árboles +of.options.TREES.tooltip.1=Como se ven las hojas de los árboles. +of.options.TREES.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.TREES.tooltip.3= Rápida - Menor calidad. (más rápido) +of.options.TREES.tooltip.4= Dinámico - Mayor calidad. +of.options.TREES.tooltip.5= Detallada - Calidad alta. (más lento) +of.options.TREES.tooltip.6=Los árboles con menor calidad tienen las hojas opacas. +of.options.TREES.tooltip.7=Los árboles con mayor calidad o dinámicos tienen hojas transparentes. + +of.options.RAIN=Nieve y lluvia +of.options.RAIN.tooltip.1=Lluvia y nieve. +of.options.RAIN.tooltip.2= NO - Sin nieve o lluvia. (más rápido) +of.options.RAIN.tooltip.3= Normal - Establecido en la configuración de calidad visual. +of.options.RAIN.tooltip.4= Rápida - Lluvia y nive ligera. (rápido) +of.options.RAIN.tooltip.5= Detallada - Lluvia y nieve pesada. (lento) +of.options.RAIN.tooltip.6=Esta opción no afecta a las salpicaduras o al ruido de la +of.options.RAIN.tooltip.7=lluvia que se siguen mostrando. + +of.options.SKY=Cielo +of.options.SKY.tooltip.1=Cielo. +of.options.SKY.tooltip.2= NO - No se ve el cielo. (rápido) +of.options.SKY.tooltip.3= SÍ - Se ve el cielo. (lento) +of.options.SKY.tooltip.4=Si se desactiva, el sol y la luna aun pueden estar visibles. + +of.options.STARS=Estrellas +of.options.STARS.tooltip.1=Visibilidad de estrellas del cielo nocturno. +of.options.STARS.tooltip.2= NO - Las estrellas no son visibles. (rápido) +of.options.STARS.tooltip.3= SÍ - Las estrellas son visibles. (lento) + +of.options.SUN_MOON=Sol y luna +of.options.SUN_MOON.tooltip.1=Visibilidad de la luna y del sol. +of.options.SUN_MOON.tooltip.2= NO - El sol y la luna no son visibles. (más rápido) +of.options.SUN_MOON.tooltip.3= SÍ - El sol y la luna son visibles. Por defecto. + +of.options.SHOW_CAPES=Mostrar capas +of.options.SHOW_CAPES.tooltip.1=Muestra las capas en los jugadores. +of.options.SHOW_CAPES.tooltip.2= NO - No mostrar la capa de los jugadores. +of.options.SHOW_CAPES.tooltip.3= SÍ - Mostrar la capa de los jugadores. Por defecto. + +of.options.TRANSLUCENT_BLOCKS=Bloque translúcido +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Bloques con transparencia. +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rápida - Mezcla de colores ligera. (rápido) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Detallada - Corrección definida de colores. (lento) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Controla el cambio de color entre bloques translúcidos (cristal +of.options.TRANSLUCENT_BLOCKS.tooltip.6=teñido, agua, hielo) cuando son puestos separados por aire. + +of.options.HELD_ITEM_TOOLTIPS=Item en mano +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Muestra información encima del hotbar al cambiar de item en mano. +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= NO - No muestra información. +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= SÍ - Muestra información. Por defecto. + +of.options.DROPPED_ITEMS=Items caídos +of.options.DROPPED_ITEMS.tooltip.1=Afecta como se ven los items. +of.options.DROPPED_ITEMS.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.DROPPED_ITEMS.tooltip.3= Rápida - Los items caídos se ven en 2D. (rápido) +of.options.DROPPED_ITEMS.tooltip.4= Detallada - Los items caídos se ven en 3D. (lento) + +options.entityShadows.tooltip.1=Sombra de entidades (mobs, jugadores, etcétera). +options.entityShadows.tooltip.2= NO - No muestra sombras de entidades. +options.entityShadows.tooltip.3= SÍ - Muestra sombras de entidades. + +of.options.VIGNETTE=Viñeta +of.options.VIGNETTE.tooltip.1=Efecto visual, ligeramente oscurece las esquinas en la pantalla. +of.options.VIGNETTE.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.VIGNETTE.tooltip.3= Rápida - Efecto desactivado. (rápido) +of.options.VIGNETTE.tooltip.4= Detallda - Efecto activado. (lento) +of.options.VIGNETTE.tooltip.5=Esta opción puede tener un impacto significativo en los FPS, +of.options.VIGNETTE.tooltip.6=especialmente cuando juega en pantalla completa. +of.options.VIGNETTE.tooltip.7=Este efecto es liviano por lo que puede ser desactivado +of.options.VIGNETTE.tooltip.8=con seguridad en cualquier momento. + +# Performance + +of.options.SMOOTH_FPS=Estabilizar FPS +of.options.SMOOTH_FPS.tooltip.1=Fija los FPS nivelando el buffer del driver de video. +of.options.SMOOTH_FPS.tooltip.2= NO - Sin estabilización. FPS cambiantes. +of.options.SMOOTH_FPS.tooltip.3= SÍ - Estabilización de FPS. +of.options.SMOOTH_FPS.tooltip.4=Esta opción depende del controlador de la tarjeta de gráficos. +of.options.SMOOTH_FPS.tooltip.5=Su efecto podría no siempre ser notorio. + +of.options.SMOOTH_WORLD=Carga ágil +of.options.SMOOTH_WORLD.tooltip.1=Disminuye el lag repentino causado por el servidor interno. +of.options.SMOOTH_WORLD.tooltip.2= NO - Sin estabilización. FPS variantes. +of.options.SMOOTH_WORLD.tooltip.3= SÍ - Estabiliza los FPS. +of.options.SMOOTH_WORLD.tooltip.4=Estabiliza los FPS, dividiendo la carga del servidor interno. +of.options.SMOOTH_WORLD.tooltip.5=Efectivo solo en mundos locales. + +of.options.FAST_RENDER=Renderizado rápido +of.options.FAST_RENDER.tooltip.1=Renderizado rápido. +of.options.FAST_RENDER.tooltip.2= NO - Renderizado estandard. Por defecto. +of.options.FAST_RENDER.tooltip.3= SÍ - Renderizado optimizado. (rápido) +of.options.FAST_RENDER.tooltip.4=Utiliza un algoritmo de renderizado optimizado que reduce +of.options.FAST_RENDER.tooltip.5=la carga del GPU, aumentando sustancialmente los FPS. + +of.options.FAST_MATH=Matemática avanzada +of.options.FAST_MATH.tooltip.1=Matemática avanzada. +of.options.FAST_MATH.tooltip.2= NO - Matemática estandard. Por defecto. +of.options.FAST_MATH.tooltip.3= SÍ - Matemática rápida. +of.options.FAST_MATH.tooltip.4=Utiliza funciones sin() y cos() optimizadas usando +of.options.FAST_MATH.tooltip.5=el cache del CPU e incrementa los FPS. + +of.options.CHUNK_UPDATES=Actualizaciones de chunks +of.options.CHUNK_UPDATES.tooltip.1=Carga de chunks del mapa por FPS (cuadros por segundo). +of.options.CHUNK_UPDATES.tooltip.2= 1 - Carga del mundo lenta. Más FPS. Por defecto. +of.options.CHUNK_UPDATES.tooltip.3= 3 - Carga del mundo rápida. Menos FPS. +of.options.CHUNK_UPDATES.tooltip.4= 5 - Carga del mundo más rápida. Menos FPS. +of.options.CHUNK_UPDATES.tooltip.5=Es el número de actualizaciones de los pedazos del mapa renderizados +of.options.CHUNK_UPDATES.tooltip.6=por FPS, valores muy altos pueden desestabilizar los FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Actualizaciones dinámicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Actualizaciones dinámicas de chunks. +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= NO - Actualizaciones de chunks por FPS estandar. Por defecto. +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= SÍ - Actualizaciones incluso cuando el jugador no se mueve. +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Esta opción facilita actualizaciones de chunks incluso mientras el +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=jugador no se mueve, para cargar el mundo mucho más rápido. + +of.options.LAZY_CHUNK_LOADING=Carga retardada +of.options.LAZY_CHUNK_LOADING.tooltip.1=Carga de los pedazos del mapa con retardo. +of.options.LAZY_CHUNK_LOADING.tooltip.2= NO - Carga de chunks determinada por el servidor. +of.options.LAZY_CHUNK_LOADING.tooltip.3= SÍ - Carga de chunks lenta. Más atractiva. +of.options.LAZY_CHUNK_LOADING.tooltip.4=Retraza en varios ticks la carga de chunks integrada por el +of.options.LAZY_CHUNK_LOADING.tooltip.5=servidor. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Desactiva esta opción si el mapa no se carga correctamente. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efectivo solo en mundos locales y con procesadores de 1 solo núcleo. + +# Animations + +of.options.animation.allOn=Activar todo +of.options.animation.allOff=Desactivar todo +of.options.animation.dynamic=Dinámico + +of.options.ANIMATED_WATER=Animación de agua +of.options.ANIMATED_LAVA=Animación de lava +of.options.ANIMATED_FIRE=Animación de fuego +of.options.ANIMATED_PORTAL=Animación del portal +of.options.ANIMATED_REDSTONE=Animación del redstone +of.options.ANIMATED_EXPLOSION=Animación de explosiones +of.options.ANIMATED_FLAME=Animación de fuego +of.options.ANIMATED_SMOKE=Animación de humo +of.options.VOID_PARTICLES=Partículas del Fin +of.options.WATER_PARTICLES=Partículas de agua +of.options.RAIN_SPLASH=Salpicadura de lluvia +of.options.PORTAL_PARTICLES=Partículas de portal +of.options.POTION_PARTICLES=Partículas de pociones +of.options.DRIPPING_WATER_LAVA=Goteo de agua y lava +of.options.ANIMATED_TERRAIN=Animación del terreno +of.options.ANIMATED_TEXTURES=Animación de texturas +of.options.FIREWORK_PARTICLES=Partículas de cohetes + +# Other + +of.options.LAGOMETER=Medidor de lag +of.options.LAGOMETER.tooltip.1=Muestra una gráfica en la pantalla de depuración (F3). +of.options.LAGOMETER.tooltip.2=* Naranja - Memoria desperdiciada. +of.options.LAGOMETER.tooltip.3=* Cian - Tick. +of.options.LAGOMETER.tooltip.4=* Azul - Tareas programadas. +of.options.LAGOMETER.tooltip.5=* Purpura - Carga de chunks. +of.options.LAGOMETER.tooltip.6=* Rojo - Actualizaciones de chunks. +of.options.LAGOMETER.tooltip.7=* Amarillo - Visibilidad. +of.options.LAGOMETER.tooltip.8=* Verde - Terreno de renderizado. + +of.options.PROFILER=Debug +of.options.PROFILER.tooltip.1=Perfil de debug. +of.options.PROFILER.tooltip.2= NO - Debug desactivado. (rápido) +of.options.PROFILER.tooltip.3= SÍ - Debug activado. (lento) +of.options.PROFILER.tooltip.4=Recopila información de debug y la muestra en +of.options.PROFILER.tooltip.5=la pantalla de dupuración (F3). + +of.options.WEATHER=Clima +of.options.WEATHER.tooltip.1=Clima. +of.options.WEATHER.tooltip.2= NO - Desactiva el clima. (rápido) +of.options.WEATHER.tooltip.3= SÍ - Activa el clima. (lento) +of.options.WEATHER.tooltip.4=Esta opción afecta a las lluvias, la nieve y las tormentas. +of.options.WEATHER.tooltip.5=Solo funciona en mundos locales. + +of.options.time.dayOnly=Día +of.options.time.nightOnly=Noche + +of.options.TIME=Tiempo +of.options.TIME.tooltip.1=Establece el momento del día. +of.options.TIME.tooltip.2= Normal - Ciclo de dia y noche normal. +of.options.TIME.tooltip.3= Día - Siempre es de día. +of.options.TIME.tooltip.4= Noche - Siempre es de noche. +of.options.TIME.tooltip.5=Esta opción solo es efectiva estando en modo creativo +of.options.TIME.tooltip.6=y en mundos locales. + +options.fullscreen.tooltip.1=Pantalla completa. +options.fullscreen.tooltip.2= NO - Modo de ventana. +options.fullscreen.tooltip.3= SÍ - Modo de pantalla completa. +options.fullscreen.tooltip.4=En pantalla completa funciona más rapido que en modo +options.fullscreen.tooltip.5=de ventana, dependiendo de la tarjeta de video. + +of.options.FULLSCREEN_MODE=Resolución +of.options.FULLSCREEN_MODE.tooltip.1=Dimensiones al entrar en modo pantalla completa. +of.options.FULLSCREEN_MODE.tooltip.2= Default - Se ajusta a la pantalla. (lento) +of.options.FULLSCREEN_MODE.tooltip.3= Ancho por Altura - Utiliza la resolución personalizada. +of.options.FULLSCREEN_MODE.tooltip.4=La resoulución de pantalla seleccionada es usada al entrar en pantalla +of.options.FULLSCREEN_MODE.tooltip.5=completa. Resouluciónes pequeñas generalmente son más rápidas. + +of.options.SHOW_FPS=Medidor de FPS +of.options.SHOW_FPS.tooltip.1=Despliega los FPS, además de otra información, resumida. +of.options.SHOW_FPS.tooltip.2= C: - Renderizado de chunks. +of.options.SHOW_FPS.tooltip.3= E: - Entidades y de bloques renderizadas. +of.options.SHOW_FPS.tooltip.4= U: - Actualizaciones de chunks. +of.options.SHOW_FPS.tooltip.5=La información solo se muestra cuando la pantalla +of.options.SHOW_FPS.tooltip.6=de depuración (F3) no es visible. + +of.options.save.default=Predeterminado (2s) +of.options.save.20s=20 s +of.options.save.3min=3 min +of.options.save.30min=30 min + +of.options.AUTOSAVE_TICKS=Autoguardado +of.options.AUTOSAVE_TICKS.tooltip.1=Intervalo de autoguardado de mundos locales. +of.options.AUTOSAVE_TICKS.tooltip.2= Predeterminado - Intervalo por defecto. NO RECOMENDADO. +of.options.AUTOSAVE_TICKS.tooltip.3=Esta función causa el famoso lag de la muerte. + +options.anaglyph.tooltip.1=La función de anaglifo 3D requiere de lentes 3D rojo-azul. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/et_EE.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/et_EE.lang new file mode 100644 index 0000000..0f70aa8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/et_EE.lang @@ -0,0 +1,761 @@ +# General +of.general.ambiguous=ebamäärane +of.general.compact=kompaktne +of.general.custom=Kohandatud +of.general.from=Kohast +of.general.id=ID +of.general.max=maksimaalne +of.general.restart=taaskäivita +of.general.smart=tark + +# Keys +of.key.zoom=Suum + +# Message +of.message.aa.shaders1=Sakisilumine ei ühildu varjutajatega. +of.message.aa.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.af.shaders1=Anisotroopiline filtreerimine ei ühildu varjutajatega. +of.message.af.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.fr.shaders1=Kiire renderdus ei ühildu varjutajatega. +of.message.fr.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.an.shaders1=3D-anaglüüf ei ühildu varjutajatega. +of.message.an.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.shaders.aa1=Varjutajad ei ühildu sakisilumisega. +of.message.shaders.aa2=Palun lülita Kvaliteet -> Sakisilumine VÄLJA ja taaskäivita mäng. + +of.message.shaders.af1=Varjutajad ei ühildu anisotroopilise filtreerimisega. +of.message.shaders.af2=Palun lülita Kvaliteet -> Anisotroopiline filtr. VÄLJA. + +of.message.shaders.fr1=Varjutajad ei ühildu kiire renderdusega. +of.message.shaders.fr2=Palun lülita Jõudlus -> Kiire renderdus VÄLJA. + +of.message.shaders.an1=Varjutajad ei ühildu 3D-anaglüüfiga. +of.message.shaders.an2=Palun lülita Muu -> 3D-anaglüüf VÄLJA. + +of.message.shaders.nv1=See varjutajapakk vajab uuemat OptiFine'i versiooni: %s +of.message.shaders.nv2=Kas soovid kindlasti jätkata? + +of.message.newVersion=Uus §eOptiFine§f'i versioon on saadaval: §e%s§f +of.message.java64Bit=Sa võid jõudluse parandamiseks paigaldada §e64-bitise Java§f. +of.message.openglError=§eOpenGL'i viga§f: %s (%s) + +of.message.shaders.loading=Varjutajate laadimine: %s + +of.message.other.reset=Lähtestad kõik graafikaseaded vaikimisi väärtustele? + +of.message.loadingVisibleChunks=Laadin nähtavaid kamakaid + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine'i keep... + +of.options.capeOF.title=OptiFine'i keep +of.options.capeOF.openEditor=Ava keebimuutja +of.options.capeOF.reloadCape=Laadi keep uuesti + +of.message.capeOF.openEditor=OptiFine'i keebimuutja peaks veebibrauseris avanema. +of.message.capeOF.reloadCape=Keep laaditakse uuesti 15 sekundi pärast. + +of.message.capeOF.error1=Mojangiga autentimine ebaõnnestus. +of.message.capeOF.error2=Viga: %s + +# Video settings + +options.graphics.tooltip.1=Visuaalne kvaliteet +options.graphics.tooltip.2= Kiire - madalam kvaliteet, kiirem +options.graphics.tooltip.3= Uhke - kõrgem kvaliteet, aeglasem +options.graphics.tooltip.4=Muudab pilvede, lehtede, vee, varjude ja muru külgede +options.graphics.tooltip.5=välimust. + +of.options.renderDistance.tiny=pisike +of.options.renderDistance.short=lühike +of.options.renderDistance.normal=tavaline +of.options.renderDistance.far=kauge +of.options.renderDistance.extreme=ekstreemne +of.options.renderDistance.insane=hullumeelne +of.options.renderDistance.ludicrous=naeruväärne + +options.renderDistance.tooltip.1=Nähtav kaugus +options.renderDistance.tooltip.2= 2 pisike - 32m (kiireim) +options.renderDistance.tooltip.3= 8 tavaline - 128m (tavaline +options.renderDistance.tooltip.4= 16 kauge - 256m (aeglasem) +options.renderDistance.tooltip.5= 32 ekstreemne - 512m (aeglaseim!) väga ressursinõudlik +options.renderDistance.tooltip.6= 48 hullumeelne - 768m, vajab 2 GB RAMi allutamist +options.renderDistance.tooltip.7= 64 naeruväärne - 1024m, vajab 3 GB RAMi allutamist +options.renderDistance.tooltip.8=Väärtused üle "16 kauge" toimivad ainult kohalikes maailmades. + +options.ao.tooltip.1=Sujuv valgustus +options.ao.tooltip.2= VÄLJAS - sujuv valgustus puudub (kiirem) +options.ao.tooltip.3= Minimaalne - lihtne sujuv valgustus (aeglasem) +options.ao.tooltip.4= Maksimaalne - keeruline sujuv valgustus (aeglaseim) + +options.framerateLimit.tooltip.1=Maksimaalne kaadrisagedus +options.framerateLimit.tooltip.2= VSync - piira kuvari kaadrisagedusele (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - muutuja +options.framerateLimit.tooltip.4= Piiramatu - piirang puudub (kiireim) +options.framerateLimit.tooltip.5=Kaadrisageduse piirang alandab kaadrisagedust ka siis, +options.framerateLimit.tooltip.6=kui piirväärtuseni pole jõutud. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Sujuva valgustuse tase +of.options.AO_LEVEL.tooltip.1=Sujuva valgustuse tase +of.options.AO_LEVEL.tooltip.2= VÄLJAS - varjud puuduvad +of.options.AO_LEVEL.tooltip.3= 50%% - heledad varjud +of.options.AO_LEVEL.tooltip.4= 100%% - tumedad varjud + +options.viewBobbing.tooltip.1=Realistlikum liikumine. +options.viewBobbing.tooltip.2=Mipmappimist kasutades lülita see VÄLJA parimate tulemuste +options.viewBobbing.tooltip.3=saavutamiseks. +# Added extra row to tooltip + +options.guiScale.tooltip.1=Kasutajaliidese suurus +options.guiScale.tooltip.2= automaatne - maksimaalsuurus +options.guiScale.tooltip.3= väike, keskmine, suur - 1x kuni 3x +options.guiScale.tooltip.4= 4x kuni 10x - saadaval 4K ekraanidel +options.guiScale.tooltip.5=Paaritud arvud (1x, 3x, 5x, ...) ei ühildu Unicode'iga. +options.guiScale.tooltip.6=Väiksem kasutajaliides võib olla kiirem. + +options.vbo=VBO'd +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Kasutab alternatiivset renderdusmudelit, mis on tavaliselt +options.vbo.tooltip.3=vaikimisi renderdusest kiirem (5-10%%). + +options.gamma.tooltip.1=Muudab tumedamate objektide heledust. +options.gamma.tooltip.2= Tujukas - standardne heledus +options.gamma.tooltip.3= 1-99%% - muutuja +options.gamma.tooltip.4= Hele - maksimaalne heledus tumedamatele objektidele +options.gamma.tooltip.5=See valik ei muuda täiesti mustade objektide heledust. +options.gamma.tooltip.6= + +options.anaglyph.tooltip.1=3D-anaglüüf +options.anaglyph.tooltip.2=Lubab stereoskoopilise 3D-efekti, kasutades erinevaid +options.anaglyph.tooltip.3=värve eri silmadel. +options.anaglyph.tooltip.4=Vajab punasiniseid prille korralikuks vaatamiseks. + +options.attackIndicator.tooltip.1=Seadistab ründeindikaatori asukohta +options.attackIndicator.tooltip.2= Sihtimisristil - sihtimisristi all +options.attackIndicator.tooltip.3= Plokiribal - plokiriba kõrval +options.attackIndicator.tooltip.4= VÄLJAS - ründeindikaator puudub +options.attackIndicator.tooltip.5=Ründeindikaator kuvab käesoleva eseme ründevõimsust +options.attackIndicator.tooltip.6= + +of.options.ALTERNATE_BLOCKS=Alternatiivsed plokid +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternatiivsed plokid +of.options.ALTERNATE_BLOCKS.tooltip.2=Kasutab alternatiivseid plokimudeleid teatud plokkidel. +of.options.ALTERNATE_BLOCKS.tooltip.3=Sõltub valitud ressursipakist. + +of.options.FOG_FANCY=Udu +of.options.FOG_FANCY.tooltip.1=Udu tüüp +of.options.FOG_FANCY.tooltip.2= Kiire - kiirem udu +of.options.FOG_FANCY.tooltip.3= Uhke - aeglasem udu, näeb parem välja +of.options.FOG_FANCY.tooltip.4= VÄLJAS - udu puudub, kiireim +of.options.FOG_FANCY.tooltip.5=Uhke udu on saadaval vaid siis, kui see on toetatud +of.options.FOG_FANCY.tooltip.6=graafikakaardi poolt. + +of.options.FOG_START=Udu algus +of.options.FOG_START.tooltip.1=Udu algus +of.options.FOG_START.tooltip.2= 0.2 - udu algab mängija lähedalt +of.options.FOG_START.tooltip.3= 0.8 - udu algab mängijast kaugel +of.options.FOG_START.tooltip.4=See valik ei mõjuta tavaliselt jõudlust. + +of.options.CHUNK_LOADING=Kamakate laadimine +of.options.CHUNK_LOADING.tooltip.1=Kamakate laadimine +of.options.CHUNK_LOADING.tooltip.2= Vaikimisi - ebastabiilne kaadrisagedus kamakate laadimisel +of.options.CHUNK_LOADING.tooltip.3= Sujuv - stabiilne kaadrisagedus +of.options.CHUNK_LOADING.tooltip.4= Mitme tuumaga - stabiilne kaadrisagedus, 3x kiirem maailma laadimine +of.options.CHUNK_LOADING.tooltip.5=Sujuv ja mitme tuumaga eemaldavad kamakate laadimiselt +of.options.CHUNK_LOADING.tooltip.6=hakkimise ja külmumise. +of.options.CHUNK_LOADING.tooltip.7=Mitme tuuma režiim võib kiirendada maailma laadimist kuni 3x +of.options.CHUNK_LOADING.tooltip.8=ja suurendada kaadrisagedust, kasutades teist protsessori tuuma. +of.options.chunkLoading.smooth=sujuv +of.options.chunkLoading.multiCore=mitme tuumaga + +of.options.shaders=Varjutajad... +of.options.shadersTitle=Varjutajad + +of.options.shaders.packNone=VÄLJAS +of.options.shaders.packDefault=(sisemised) + +of.options.shaders.ANTIALIASING=Sakisilumine +of.options.shaders.ANTIALIASING.tooltip.1=Sakisilumine (anti-aliasing) +of.options.shaders.ANTIALIASING.tooltip.2= VÄLJAS - (vaikimisi) sakisilumine puudub (kiirem) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - silutud jooned ja ääred (aeglasem) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA on järeltöötluse efekt, mis silub +of.options.shaders.ANTIALIASING.tooltip.5=sakilised jooned ja teravad värviüleminekud. +of.options.shaders.ANTIALIASING.tooltip.6=See on traditsioonilisest sakisilumisest kiirem +of.options.shaders.ANTIALIASING.tooltip.7=ning ühildub nii varjutajate kui ka kiire renderdusega. + +of.options.shaders.NORMAL_MAP=Tavaline kaart +of.options.shaders.NORMAL_MAP.tooltip.1=Tavaline kaart +of.options.shaders.NORMAL_MAP.tooltip.2= SEES - (vaikimisi) luba tavalised kaardid +of.options.shaders.NORMAL_MAP.tooltip.3= VÄLJAS - keela tavalised kaardid +of.options.shaders.NORMAL_MAP.tooltip.4=Tavalisi kaarte saab varjutajatepakk kasutada, +of.options.shaders.NORMAL_MAP.tooltip.5=simuleerimaks 3D geomeetriat siledatel mudelipindadel. +of.options.shaders.NORMAL_MAP.tooltip.6=Tavalise kaardi tekstuure pakub kasutatav ressursipakk. +of.options.shaders.NORMAL_MAP.tooltip.7= + +of.options.shaders.SPECULAR_MAP=Peegelduv kaart +of.options.shaders.SPECULAR_MAP.tooltip.1=Peegelduv kaart +of.options.shaders.SPECULAR_MAP.tooltip.2= SEES - (vaikimisi) luba peegelduvad kaardid +of.options.shaders.SPECULAR_MAP.tooltip.3= VÄLJAS - keela peegelduvad kaardid +of.options.shaders.SPECULAR_MAP.tooltip.4=Peegelduvaid kaarte saab varjutajatepakk kasutada, +of.options.shaders.SPECULAR_MAP.tooltip.5=simuleerimaks erilisi peegeldusefekte. +of.options.shaders.SPECULAR_MAP.tooltip.6=Peegelduva kaardi tekstuure pakub kasutatav ressursipakk. +of.options.shaders.SPECULAR_MAP.tooltip.7= + +of.options.shaders.RENDER_RES_MUL=Renderduskvaliteet +of.options.shaders.RENDER_RES_MUL.tooltip.1=Renderduskvaliteet +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - madal (kiireim) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (vaikimisi) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - kõrge (aeglaseim) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Renderduskvaliteet juhib varjutajatepaki renderdavate +of.options.shaders.RENDER_RES_MUL.tooltip.6=tekstuuride suurust. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Madalamad väärtused on kasulikud 4K ekraanidel. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Kõrgemad väärtused töötavad sakisilumise filtrina. + +of.options.shaders.SHADOW_RES_MUL=Varjukvaliteet +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Varjukvaliteet +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - madal (kiireim) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (vaikimisi) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - kõrge (aeglaseim) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Varjukvaliteet juhib varjutajatepaki varjukaardi +of.options.shaders.SHADOW_RES_MUL.tooltip.6=tekstuuri suurust. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Madalamad väärtused = ebatäpsed, karedad varjud. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Kõrgemad väärtused = detailsed, peenemad varjud. + +of.options.shaders.HAND_DEPTH_MUL=Käesügavus +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Käesügavus +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - käsi kaamera lähedal +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (vaikimisi) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - käsi kaamerast kaugel +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Käesügavus juhib, kui kaugel kaamerast on +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=käeshoitavad esemed. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Varjutajapakkidel, mis kasutavad sügavusudu, peaks +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=see muutma käes hoitavate objektide hägusust. + +of.options.shaders.CLOUD_SHADOW=Pilvevari + +of.options.shaders.OLD_HAND_LIGHT=Vana käevalgustus +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Vana käevalgustus +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Vaikimisi - juhitud varjutajapaki poolt +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= SEES - kasuta vana käevalgustust +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= VÄLJAS - kasuta uut käevalgustust +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Vana käevalgustus lubab varjutajapakkidel, +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=mis tuvastavad valgust eritavaid esemeid ainult +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=peamisel käel töötada ka teisasel käel. + +of.options.shaders.OLD_LIGHTING=Vana valgustus +of.options.shaders.OLD_LIGHTING.tooltip.1=Vana valgustus +of.options.shaders.OLD_LIGHTING.tooltip.2= Vaikimisi - juhitud varjutajapaki poolt +of.options.shaders.OLD_LIGHTING.tooltip.3= SEES - kasuta vana valgustust +of.options.shaders.OLD_LIGHTING.tooltip.4= VÄLJAS - kasuta uut valgustust +of.options.shaders.OLD_LIGHTING.tooltip.5=Vana valgustus juhib fikseeritud valguse rakendamist +of.options.shaders.OLD_LIGHTING.tooltip.6=plokikülgedele tavamängu poolt. +of.options.shaders.OLD_LIGHTING.tooltip.7=Varjutajapakid, mis kasutavad varjusid pakuvad tavaliselt +of.options.shaders.OLD_LIGHTING.tooltip.8=palju paremat valgustust, sõltuvalt päikse asukohast. + +of.options.shaders.DOWNLOAD=Laadi varjutajaid alla +of.options.shaders.DOWNLOAD.tooltip.1=Laadi varjutajaid alla +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Avab brauseris varjutajapakkide lehe. +of.options.shaders.DOWNLOAD.tooltip.4=Aseta allalaaditud varjutajapakid kausta "Shaders" +of.options.shaders.DOWNLOAD.tooltip.5=ning need kuvatakse paigaldatud varjutajate nimekirjas. + +of.options.shaders.SHADER_PACK=Varjutajapakk + +of.options.shaders.shadersFolder=Varjutajate kaust +of.options.shaders.shaderOptions=Varjutajate valikud... + +of.options.shaderOptionsTitle=Varjutajate valikud + +of.options.quality=Kvaliteet... +of.options.qualityTitle=Kvaliteedi seaded + +of.options.details=Detailid... +of.options.detailsTitle=Detailiseaded + +of.options.performance=Jõudlus... +of.options.performanceTitle=Jõudluse seaded + +of.options.animations=Animatsioonid... +of.options.animationsTitle=Animatsiooniseaded + +of.options.other=Muu... +of.options.otherTitle=Muud seaded + +of.options.other.reset=Lähtesta graafikaseaded... + +of.shaders.profile=Profiil + +# Quality + +of.options.mipmap.bilinear=bilineaarne +of.options.mipmap.linear=lineaarne +of.options.mipmap.nearest=lähim +of.options.mipmap.trilinear=trilineaarne + +options.mipmapLevels.tooltip.1=Visuaalne efekt, mis muudab kauged objektid ilusamaks, +options.mipmapLevels.tooltip.2=siludes tekstuuridetaile. +options.mipmapLevels.tooltip.3= VÄLJAS - silumine puudub +options.mipmapLevels.tooltip.4= 1 - minimaalne silumine +options.mipmapLevels.tooltip.5= Maksimaalne - maksimaalne silumine +options.mipmapLevels.tooltip.6=See valik ei mõjuta tavaliselt jõudlust. + +of.options.MIPMAP_TYPE=Mipmappimistüüp +of.options.MIPMAP_TYPE.tooltip.1=Visuaalne efekt, mis muudab kauged objektid ilusamaks, +of.options.MIPMAP_TYPE.tooltip.2=siludes tekstuuridetaile. +of.options.MIPMAP_TYPE.tooltip.3= Lähim - jäme silumine (kiireim) +of.options.MIPMAP_TYPE.tooltip.4= Lineaarne - tavaline silumine +of.options.MIPMAP_TYPE.tooltip.5= Bilineaarne - peen silumine +of.options.MIPMAP_TYPE.tooltip.6= Trilineaarne - peeneim silumine (aeglaseim) + + +of.options.AA_LEVEL=Sakisilumine +of.options.AA_LEVEL.tooltip.1=Sakisilumise (anti-aliasing) filter +of.options.AA_LEVEL.tooltip.2= VÄLJAS - (vaikimisi) sakisilumine puudub (kiirem) +of.options.AA_LEVEL.tooltip.3= 2-16 - silutud jooned ja servad (aeglasem) +of.options.AA_LEVEL.tooltip.4=Sakisilumine silub sakilisi jooni ja teravaid värviüleminekuid. +of.options.AA_LEVEL.tooltip.5=Lubamisel võib see oluliselt alandada kaadrisagedust. +of.options.AA_LEVEL.tooltip.6=Kõik tasemed pole toetatud kõikidel graafikakaartidel. +of.options.AA_LEVEL.tooltip.7= +of.options.AA_LEVEL.tooltip.8=Jõustub peale TAASKÄIVITUST! + +of.options.AF_LEVEL=Anisotroopiline filtr. +of.options.AF_LEVEL.tooltip.1=Anisotroopiline filtreerimine +of.options.AF_LEVEL.tooltip.2= VÄLJAS - (vaikimisi) standardsed tekstuuridetailid (kiirem) +of.options.AF_LEVEL.tooltip.3= 2-16 - peenemad detailid mipmapitud tekstuurides (aeglasem) +of.options.AF_LEVEL.tooltip.4=Anisotroopiline filtreerimine taastab detailid mipmapitud +of.options.AF_LEVEL.tooltip.5=tekstuurides. +of.options.AF_LEVEL.tooltip.6=Lubamisel võib see oluliselt alandada kaadrisagedust. + +of.options.CLEAR_WATER=Selge vesi +of.options.CLEAR_WATER.tooltip.1=Selge vesi +of.options.CLEAR_WATER.tooltip.2= SEES - selge, läbipaistev vesi +of.options.CLEAR_WATER.tooltip.3= VÄLJAS - vaikimisi vesi + +of.options.RANDOM_ENTITIES=Juhuslikud olemid +of.options.RANDOM_ENTITIES.tooltip.1=Juhuslikud olemid +of.options.RANDOM_ENTITIES.tooltip.2= VÄLJAS - juhuslikud olemid puuduvad, kiirem +of.options.RANDOM_ENTITIES.tooltip.3= SEES - juhuslikud olemid, aeglasem +of.options.RANDOM_ENTITIES.tooltip.4=Juhuslikud olemid kasutab suvalisi tekstuure mängu olemitel. +of.options.RANDOM_ENTITIES.tooltip.5=Vajab ressursipakki, millel on mitu olemitekstuuri. + +of.options.BETTER_GRASS=Parem muru +of.options.BETTER_GRASS.tooltip.1=Parem muru +of.options.BETTER_GRASS.tooltip.2= VÄLJAS - vaikimisi muru küljetekstuur, kiireim +of.options.BETTER_GRASS.tooltip.3= Kiire - täielik muru küljetekstuur, aeglasem +of.options.BETTER_GRASS.tooltip.4= Uhke - dünaamiline muru küljetekstuur, aeglaseim + +of.options.BETTER_SNOW=Parem lumi +of.options.BETTER_SNOW.tooltip.1=Parem lumi +of.options.BETTER_SNOW.tooltip.2= VÄLJAS - vaikimisi lumi, kiirem +of.options.BETTER_SNOW.tooltip.3= SEES - parem lumi, aeglasem +of.options.BETTER_SNOW.tooltip.4=Näitab lund läbipaistvate plokkide all (aed, kõrge muru), +of.options.BETTER_SNOW.tooltip.5=kui ääristada lumeplokkidega. + +of.options.CUSTOM_FONTS=Kohandatud fondid +of.options.CUSTOM_FONTS.tooltip.1=Kohandatud fondid +of.options.CUSTOM_FONTS.tooltip.2= SEES - kasutab kohandatud fonte (vaikimisi), aeglasem +of.options.CUSTOM_FONTS.tooltip.3= VÄLJAS - kasutab vaikimisi fonte, kiirem +of.options.CUSTOM_FONTS.tooltip.4=Kohandatud fonte pakub kasutatav ressursipakk. +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Kohandatud värvid +of.options.CUSTOM_COLORS.tooltip.1=Kohandatud värvid +of.options.CUSTOM_COLORS.tooltip.2= SEES - kasutab kohandatud värve (vaikimisi), aeglasem +of.options.CUSTOM_COLORS.tooltip.3= VÄLJAS - kasutab vaikimisi värve, kiirem +of.options.CUSTOM_COLORS.tooltip.4=Kohandatud värve pakub kasutatav ressursipakk. +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Soo värvid +of.options.SWAMP_COLORS.tooltip.1=Soo värvid +of.options.SWAMP_COLORS.tooltip.2= SEES - kasuta soo värve (vaikimisi), aeglasem +of.options.SWAMP_COLORS.tooltip.3= VÄLJAS - ära kasuta soo värve, kiirem +of.options.SWAMP_COLORS.tooltip.4=Soo värvid mõjutavad muru, lehti, vääte ja vett. + +of.options.SMOOTH_BIOMES=Sujuvad bioomid +of.options.SMOOTH_BIOMES.tooltip.1=Sujuvad bioomid +of.options.SMOOTH_BIOMES.tooltip.2= SEES - bioomide äärte silumine (vaikimisi), aeglasem +of.options.SMOOTH_BIOMES.tooltip.3= VÄLJAS - bioomide äärte silumine puudub, kiirem +of.options.SMOOTH_BIOMES.tooltip.4=Bioomide äärte silumine toimub kõikide ümbritsevate plokkide +of.options.SMOOTH_BIOMES.tooltip.5=juhuslike värvide ja värvide keskmise leidmisega. +of.options.SMOOTH_BIOMES.tooltip.6=Mõjutab muru, lehti, vääte ja vett. + +of.options.CONNECTED_TEXTURES=Ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.1=Ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.2= VÄLJAS - ühendatud tekstuurid puuduvad (vaikimisi) +of.options.CONNECTED_TEXTURES.tooltip.3= Kiire - kiired ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.4= Uhke - uhked ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.5=Ühendatud tekstuurid ühendab klaasi, liivakivi ja +of.options.CONNECTED_TEXTURES.tooltip.6=raamaturiiulid, kui need on asetatud kõrvuti. +of.options.CONNECTED_TEXTURES.tooltip.7=Ühendatud tekstuure pakub kasutatav ressursipakk. +of.options.CONNECTED_TEXTURES.tooltip.8= + +of.options.NATURAL_TEXTURES=Naturaalsed tekstuurid +of.options.NATURAL_TEXTURES.tooltip.1=Naturaalsed tekstuurid +of.options.NATURAL_TEXTURES.tooltip.2= VÄLJAS - naturaalsed tekstuurid puuduvad (vaikimisi) +of.options.NATURAL_TEXTURES.tooltip.3= SEES - kasuta naturaalseid tekstuure +of.options.NATURAL_TEXTURES.tooltip.4=Naturaalsed tekstuurid eemaldavad võretaolise mustri, +of.options.NATURAL_TEXTURES.tooltip.5=mille loovad sama tüüpi korduvad plokid. See kasutab +of.options.NATURAL_TEXTURES.tooltip.6=pööratud ja peegeldatud variante põhiploki tekstuurist. +of.options.NATURAL_TEXTURES.tooltip.7=Naturaalsete tekstuuride konfiguratsiooni pakub +of.options.NATURAL_TEXTURES.tooltip.8=kasutatav ressursipakk. + +of.options.EMISSIVE_TEXTURES=Kiirgavad tekstuurid +of.options.EMISSIVE_TEXTURES.tooltip.1=Kiirgavad tekstuurid +of.options.EMISSIVE_TEXTURES.tooltip.2= OFF - kiirgavad tekstuurid puuduvad (vaikimisi) +of.options.EMISSIVE_TEXTURES.tooltip.3= ON - kasuta kiirgavaid tekstuure +of.options.EMISSIVE_TEXTURES.tooltip.4=Kiirgavad tekstuurid renderdatakse täisheledusega +of.options.EMISSIVE_TEXTURES.tooltip.5=kuvatud ülekatetena. Neid saab kasutada, et simuleerida +of.options.EMISSIVE_TEXTURES.tooltip.6=baastekstuuri valgust eritavaid osi. +of.options.EMISSIVE_TEXTURES.tooltip.7=Kiirgavaid teksuure pakub kasutatav ressursipakk. +of.options.EMISSIVE_TEXTURES.tooltip.8= + +of.options.CUSTOM_SKY=Kohandatud taevas +of.options.CUSTOM_SKY.tooltip.1=Kohandatud taevas +of.options.CUSTOM_SKY.tooltip.2= SEES - kohandatud taevatekstuurid (vaikimisi), aeglane +of.options.CUSTOM_SKY.tooltip.3= VÄLJAS - vaikimisi taevas, kiirem +of.options.CUSTOM_SKY.tooltip.4=Kohandatud taevatekstuure pakub kasutatav ressursipakk. +of.options.CUSTOM_SKY.tooltip.5= + +of.options.CUSTOM_ITEMS=Kohandatud esemed +of.options.CUSTOM_ITEMS.tooltip.1=Kohandatud esemed +of.options.CUSTOM_ITEMS.tooltip.2= SEES - kohandatud esemetekstuurid (vaikimisi), aeglane +of.options.CUSTOM_ITEMS.tooltip.3= VÄLJAS - vaikimisi esemetekstuurid, kiirem +of.options.CUSTOM_ITEMS.tooltip.4=Kohandatud esemetekstuure pakub kasutatav ressursipakk. +of.options.CUSTOM_ITEMS.tooltip.5= + +of.options.CUSTOM_ENTITY_MODELS=Kohandatud olemimudelid +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Kohandatud olemimudelid +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= SEES - kohandatud olemimudelid (vaikimisi), aeglane +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= VÄLJAS - vaikimisi olemimudelid, kiirem +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Kohandatud olemimudeleid pakub kasutatav ressursipakk. +of.options.CUSTOM_ENTITY_MODELS.tooltip.5= + +of.options.CUSTOM_GUIS=Kohandatud liidesed +of.options.CUSTOM_GUIS.tooltip.1=Kohandatud kasutajaliidesed +of.options.CUSTOM_GUIS.tooltip.2= SEES - kohandatud kasutajaliidesed (vaikimisi), aeglasem +of.options.CUSTOM_GUIS.tooltip.3= VÄLJAS - vaikimisi kasutajaliidesed, kiirem +of.options.CUSTOM_GUIS.tooltip.4=Kohandatud kasutajaliideseid pakub kasutatav ressursipakk. + +# Details + +of.options.CLOUDS=Pilved +of.options.CLOUDS.tooltip.1=Pilved +of.options.CLOUDS.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.CLOUDS.tooltip.3= Kiire - madalam kvaliteet, kiirem +of.options.CLOUDS.tooltip.4= Uhke - kõrgem kvaliteet, aeglasem +of.options.CLOUDS.tooltip.5= VÄLJAS - pilved puuduvad, kiireim +of.options.CLOUDS.tooltip.6=Kiired pilved renderdatakse 2Dna. +of.options.CLOUDS.tooltip.7=Uhked pilved renderdatakse 3Dna. + +of.options.CLOUD_HEIGHT=Pilvekõrgus +of.options.CLOUD_HEIGHT.tooltip.1=Pilvekõrgus +of.options.CLOUD_HEIGHT.tooltip.2= VÄLJAS - vaikimisi kõrgus +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - maailma kõrguspiirangust kõrgemal + +of.options.TREES=Puud +of.options.TREES.tooltip.1=Puud +of.options.TREES.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.TREES.tooltip.3= Kiire - madalam kvaliteet, kiirem +of.options.TREES.tooltip.4= Tark - kõrgem kvaliteet, kiire +of.options.TREES.tooltip.5= Uhke - kõrgeim kvaliteet, aeglasem +of.options.TREES.tooltip.6=Kiiretel puudel on läbipaistmatud lehed. +of.options.TREES.tooltip.7=Uhketel ja tarkadel puudel on läbipaistvad lehed. + +of.options.RAIN=Vihm ja lumi +of.options.RAIN.tooltip.1=Vihm ja lumi +of.options.RAIN.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.RAIN.tooltip.3= Kiire - kerge vihm/lumi, kiirem +of.options.RAIN.tooltip.4= Uhke - tugev vihm/lumi, aeglasem +of.options.RAIN.tooltip.5= VÄLJAS - vihm/lumi puuduvad, kiireim +of.options.RAIN.tooltip.6=Kui vihm on VÄLJAS, on vihma helid ja plärtsatused siiski +of.options.RAIN.tooltip.7=toimivad. + +of.options.SKY=Taevas +of.options.SKY.tooltip.1=Taevas +of.options.SKY.tooltip.2= SEES - taevas on nähtav, aeglasem +of.options.SKY.tooltip.3= VÄLJAS - taevas pole nähtav, kiirem +of.options.SKY.tooltip.4=Kui taevas on VÄLJAS, on kuu ja päike siiski nähtavad. + +of.options.STARS=Tähed +of.options.STARS.tooltip.1=Tähed +of.options.STARS.tooltip.2= SEES - tähed on nähtavad, aeglasem +of.options.STARS.tooltip.3= VÄLJAS - tähed pole nähtavad, kiirem + +of.options.SUN_MOON=Päike ja kuu +of.options.SUN_MOON.tooltip.1=Päike ja kuu +of.options.SUN_MOON.tooltip.2= SEES - päike ja kuu on nähtavad (vaikimisi) +of.options.SUN_MOON.tooltip.3= VÄLJAS - päike ja kuu pole nähtavad (kiirem) + +of.options.SHOW_CAPES=Keebid +of.options.SHOW_CAPES.tooltip.1=Keebid +of.options.SHOW_CAPES.tooltip.2= SEES - kuva mängijate keebid (vaikimisi) +of.options.SHOW_CAPES.tooltip.3= VÄLJAS - ära kuva mängijate keepe + +of.options.TRANSLUCENT_BLOCKS=Läbikumavad plokid +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Läbikumavad plokid +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Uhke - korrektne värvide üleminek (aeglasem) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Kiire - kiire värvide üleminek (kiirem) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Juhib erinevate värvidega poolläbipaistvate plokkide +of.options.TRANSLUCENT_BLOCKS.tooltip.6=(toonitud klaas, vesi, jää) värvide üleminekut, +of.options.TRANSLUCENT_BLOCKS.tooltip.7=kui need on asetatud õhuvahega üksteise taha. + +of.options.HELD_ITEM_TOOLTIPS=Esemete näpunäited +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Käeshoitavate esemete näpunäited +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= SEES - kuva näpunäiteid käeshoitavatel esemetel (vaikimisi) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= VÄLJAS - ära kuva näpunäiteid käeshoitavatel esemetel + +of.options.ADVANCED_TOOLTIPS=Täpsemad näpunäited +of.options.ADVANCED_TOOLTIPS.tooltip.1=Täpsemad näpunäited +of.options.ADVANCED_TOOLTIPS.tooltip.2= SEES - kuva täpsemad näpunäited +of.options.ADVANCED_TOOLTIPS.tooltip.3= VÄLJAS - peida täpsemad näpunäited (vaikimisi) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Täpsemad näpunäited kuvavad laiendatud infot +of.options.ADVANCED_TOOLTIPS.tooltip.5=esemete kohta (ID, vastupidavus) ja varjutajate +of.options.ADVANCED_TOOLTIPS.tooltip.6=valikute kohta (ID, allikas, vaikeväärtus). + +of.options.DROPPED_ITEMS=Visatud esemed +of.options.DROPPED_ITEMS.tooltip.1=Maha visatud esemed +of.options.DROPPED_ITEMS.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.DROPPED_ITEMS.tooltip.3= Kiire - visatud esemed 2Dna (kiirem) +of.options.DROPPED_ITEMS.tooltip.4= Uhke - visatud esemed 3Dna (aeglasem) + +options.entityShadows.tooltip.1=Olemite varjud +options.entityShadows.tooltip.2= SEES - kuva olemite varje +options.entityShadows.tooltip.3= VÄLJAS - ära kuva olemite varje + +of.options.VIGNETTE=Vinjett +of.options.VIGNETTE.tooltip.1=Visuaalne efekt, mis tumendab kergelt ekraani nurki. +of.options.VIGNETTE.tooltip.2= Vaikimisi - nagu määrab seade Graafika (vaikimisi) +of.options.VIGNETTE.tooltip.3= Kiire - vinjett keelatud (kiirem) +of.options.VIGNETTE.tooltip.4= Uhke - vinjett lubatud (aeglasem) +of.options.VIGNETTE.tooltip.5=Vinjett võib oluliselt mõjutada kaadrisagedust, +of.options.VIGNETTE.tooltip.6=eriti kui mängida täisekraanil. +of.options.VIGNETTE.tooltip.7=Vinjetiefekt on vaevu hoomatav, seda võib ohutult keelata. +of.options.VIGNETTE.tooltip.8= + +of.options.DYNAMIC_FOV=Dünaamiline vaateväli +of.options.DYNAMIC_FOV.tooltip.1=Dünaamiline vaateväli +of.options.DYNAMIC_FOV.tooltip.2= SEES - luba dünaamiline vaateväli (vaikimisi) +of.options.DYNAMIC_FOV.tooltip.3= VÄLJAS - keela dünaamiline vaateväli +of.options.DYNAMIC_FOV.tooltip.4=Muudab vaatevälja lennates, joostes või vibu tõmmates. +of.options.DYNAMIC_FOV.tooltip.5= + +of.options.DYNAMIC_LIGHTS=Dünaamiline valgustus +of.options.DYNAMIC_LIGHTS.tooltip.1=Dünaamiline valgustus +of.options.DYNAMIC_LIGHTS.tooltip.2= VÄLJAS - dünaamiline valgustus puudub (vaikimisi) +of.options.DYNAMIC_LIGHTS.tooltip.3= Kiire - kiire dünaamiline valgustus (uuendatud 500 ms järel) +of.options.DYNAMIC_LIGHTS.tooltip.4= Uhke - uhke dünaamiline valgustus (uuendatud reaalajas) +of.options.DYNAMIC_LIGHTS.tooltip.5=Lubab valgust kiirgavatel esemetel (tõrvik, hõõgkivi jne) +of.options.DYNAMIC_LIGHTS.tooltip.6=käes hoides või maha visates valgustada ümbritsevat ala. +of.options.DYNAMIC_LIGHTS.tooltip.7= + +options.biomeBlendRadius.tooltip.1=Silub bioomidevahelise värvide ülemineku +options.biomeBlendRadius.tooltip.2= VÄLJAS - üleminek puudub (kiireim) +options.biomeBlendRadius.tooltip.3= 5x5 - tavaline üleminek (vaikimisi) +options.biomeBlendRadius.tooltip.4= 15x15 - maksimaalne üleminek (aeglaseim) +options.biomeBlendRadius.tooltip.5=Kõrgemad väärtused võivad luua silmnähtavaid +options.biomeBlendRadius.tooltip.6="latentsusokkaid" ning aeglustada kamakalaadimist. + +# Performance + +of.options.SMOOTH_FPS=Sujuv kaadrisagedus +of.options.SMOOTH_FPS.tooltip.1=Stabiliseerib ks, tühjendades graafikadraiveri puhvrit. +of.options.SMOOTH_FPS.tooltip.2= VÄLJAS - stabiliseerimine puudub, ks võib kõikuda +of.options.SMOOTH_FPS.tooltip.3= SEES - kaadrisageduse stabiliseerimine +of.options.SMOOTH_FPS.tooltip.4=See valik sõltub graafikadraiveritest ning selle efekt +of.options.SMOOTH_FPS.tooltip.5=ei pruugi alati nähtav olla. + +of.options.SMOOTH_WORLD=Sujuv maailm +of.options.SMOOTH_WORLD.tooltip.1=Eemaldab siseserveri poolt põhjustatud "latentsusokkaid". +of.options.SMOOTH_WORLD.tooltip.2= VÄLJAS - stabiliseerimine puudub, ks võib kõikuda +of.options.SMOOTH_WORLD.tooltip.3= SEES - kaadrisageduse stabiliseerimine +of.options.SMOOTH_WORLD.tooltip.4=Stabiliseerib kaadrisagedust, jaotades sisemise serveri +of.options.SMOOTH_WORLD.tooltip.5=koormust. Toimib ainult kohalikes maailmades (üksikmäng). + +of.options.FAST_RENDER=Kiire renderdus +of.options.FAST_RENDER.tooltip.1=Kiire renderdus +of.options.FAST_RENDER.tooltip.2= VÄLJAS - standardne renderdus (vaikimisi) +of.options.FAST_RENDER.tooltip.3= SEES - optimeeritud renderdus (kiirem) +of.options.FAST_RENDER.tooltip.4=Kasutab optimeeritud renderduse algoritmi, mis vähendab +of.options.FAST_RENDER.tooltip.5=graafikaprotsessori koormust ja võib oluliselt tõsta ks. +of.options.FAST_RENDER.tooltip.6=See valik võib sattuda konflikti teatud modidega. + +of.options.FAST_MATH=Kiire matemaatika +of.options.FAST_MATH.tooltip.1=Kiire matemaatika +of.options.FAST_MATH.tooltip.2= VÄLJAS - standardne matemaatika (vaikimisi) +of.options.FAST_MATH.tooltip.3= SEES - kiirem matemaatika +of.options.FAST_MATH.tooltip.4=Kasutab optimeeritud sin() ja cos() funktsioone, mis võivad +of.options.FAST_MATH.tooltip.5=paremini rakendada protsessori vahemälu ja tõsta ks. +of.options.FAST_MATH.tooltip.6=See valik võib minimaalselt mõjutada maailma genereerimist. + +of.options.CHUNK_UPDATES=Kamakauuendused +of.options.CHUNK_UPDATES.tooltip.1=Kamakate uuendused +of.options.CHUNK_UPDATES.tooltip.2= 1 - aeglasem maailma laadimine, kõrgem ks (vaikimisi) +of.options.CHUNK_UPDATES.tooltip.3= 3 - kiirem maailma laadimine, madalam ks +of.options.CHUNK_UPDATES.tooltip.4= 5 - kiireim maailma laadimine, madalaim ks +of.options.CHUNK_UPDATES.tooltip.5=Kamakate uuenduste arv renderdatud kaadri kohta, +of.options.CHUNK_UPDATES.tooltip.6=kõrgemad väärtused võivad ks destabiliseerida. + +of.options.CHUNK_UPDATES_DYNAMIC=Dünaamilised uuendused +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dünaamilised kamakauuendused +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= VÄLJAS - standardsed uuendused kaadri kohta (vaikimisi) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= SEES - rohkem uuendusi, kuni mängija seisab paigal +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dünaamilised uuendused sunnivad rohkem kamakauuendusi, +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=kuni mängija seisab paigal, et laadida maailma kiiremini. + +of.options.LAZY_CHUNK_LOADING=Laisk kamakalaadimine +of.options.LAZY_CHUNK_LOADING.tooltip.1=Laisk kamakate laadimine +of.options.LAZY_CHUNK_LOADING.tooltip.2= VÄLJAS - vaikimisi serveri kamakalaadimine +of.options.LAZY_CHUNK_LOADING.tooltip.3= SEES - laisk serveri kamakalaadimine (sujuvam) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Silub integreeritud serveri kamakalaadimist, +of.options.LAZY_CHUNK_LOADING.tooltip.5=jaotades kamakad mitmele tiksule. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Lülita VÄLJA, kui osa maailmast ei laadi korralikult. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Töötab ainult kohalikes maailmades (üksikmäng). + +of.options.RENDER_REGIONS=Renderdusalad +of.options.RENDER_REGIONS.tooltip.1=Renderdusalad +of.options.RENDER_REGIONS.tooltip.2= VÄLJAS - ära kasuta renderdusalasid (vaikimisi) +of.options.RENDER_REGIONS.tooltip.3= SEES - kasuta renderdusalasid +of.options.RENDER_REGIONS.tooltip.4=Renderdusalad lubavad kiiremat maastiku renderdamist +of.options.RENDER_REGIONS.tooltip.5=kõrgematel nähtavuskaugustel. Efektiivsem, kui VBOd on lubatud. +of.options.RENDER_REGIONS.tooltip.6=Pole soovitatav integreeritud graafikakaartide puhul. + +of.options.SMART_ANIMATIONS=Targad animatsioonid +of.options.SMART_ANIMATIONS.tooltip.1=Targad animatsioonid +of.options.SMART_ANIMATIONS.tooltip.2= VÄLJAS - ära kasuta tarku animatsioone (vaikimisi) +of.options.SMART_ANIMATIONS.tooltip.3= SEES - kasuta tarku animatsioone +of.options.SMART_ANIMATIONS.tooltip.4=Tarkade animatsioonide puhul animeerib mäng ainult +of.options.SMART_ANIMATIONS.tooltip.5=neid tekstuure, mida on hetkel ekraanil näha. +of.options.SMART_ANIMATIONS.tooltip.6=See vähendab "latentsusokkaid" ja suurendab ks. +of.options.SMART_ANIMATIONS.tooltip.7=Eriti kasulik suurtel modi- ja ressursipakkidel. + +# Animations + +of.options.animation.allOn=Kõik SISSE +of.options.animation.allOff=Kõik VÄLJA +of.options.animation.dynamic=Dünaamiline + +of.options.ANIMATED_WATER=Veeanimatsioon +of.options.ANIMATED_LAVA=Laavaanimatsioon +of.options.ANIMATED_FIRE=Tuleanimatsioon +of.options.ANIMATED_PORTAL=Portaalianimatsioon +of.options.ANIMATED_REDSTONE=Redstone-animatsioon +of.options.ANIMATED_EXPLOSION=Plahvatuse animatsioon +of.options.ANIMATED_FLAME=Leegianimatsioon +of.options.ANIMATED_SMOKE=Suitsuanimatsioon +of.options.VOID_PARTICLES=Tühjuse osakesed +of.options.WATER_PARTICLES=Veeosakesed +of.options.RAIN_SPLASH=Vihmaplärtsatused +of.options.PORTAL_PARTICLES=Portaaliosakesed +of.options.POTION_PARTICLES=Võlujoogiosakesed +of.options.DRIPPING_WATER_LAVA=Tilkuv vesi/laava +of.options.ANIMATED_TERRAIN=Maastikuanimatsioon +of.options.ANIMATED_TEXTURES=Tekstuurianimatsioon +of.options.FIREWORK_PARTICLES=Ilutulestiku osakesed + +# Other + +of.options.LAGOMETER=Latentsusmõõdik +of.options.LAGOMETER.tooltip.1=Kuvab latentsusmõõdikut silumisvaatel (F3). +of.options.LAGOMETER.tooltip.2=* Oranž - mälu prahikogumine +of.options.LAGOMETER.tooltip.3=* Tsüaansinine - tiksud +of.options.LAGOMETER.tooltip.4=* Sinine - ajastatud käivitatavad +of.options.LAGOMETER.tooltip.5=* Lilla - kamaka üleslaadimine +of.options.LAGOMETER.tooltip.6=* Punane - kamakauuendused +of.options.LAGOMETER.tooltip.7=* Kollane - nähtavuskontroll +of.options.LAGOMETER.tooltip.8=* Roheline - maastiku renderdus + +of.options.PROFILER=Silumisprofiilija +of.options.PROFILER.tooltip.1=Silumisprofiilija +of.options.PROFILER.tooltip.2= SEES - silumisprofiilija on aktiivne, aeglasem +of.options.PROFILER.tooltip.3= VÄLJAS - silumisprofiilija pole aktiivne, kiirem +of.options.PROFILER.tooltip.4=Silumisprofiilija kogub ja kuvab silumisinfot, kui +of.options.PROFILER.tooltip.5=silumisvaade on avatud (F3). + +of.options.WEATHER=Ilm +of.options.WEATHER.tooltip.1=Ilm +of.options.WEATHER.tooltip.2= SEES - ilm on aktiivne, aeglasem +of.options.WEATHER.tooltip.3= VÄLJAS - ilm pole aktiivne, kiirem +of.options.WEATHER.tooltip.4=Ilm juhib vihma, lund ja äikest. +of.options.WEATHER.tooltip.5=Ilma juhtimine on võimalik ainult kohalikes maailmades. + +of.options.time.dayOnly=ainult päev +of.options.time.nightOnly=ainult öö + +of.options.TIME=Aeg +of.options.TIME.tooltip.1=Aeg +of.options.TIME.tooltip.2= Vaikimisi - tavaline ööpäevatsükkel +of.options.TIME.tooltip.3= Ainult päev - ainult päev +of.options.TIME.tooltip.4= Ainult öö - ainult öö +of.options.TIME.tooltip.5=Aja seadistus töötab ainult kohalikes maailmades +of.options.TIME.tooltip.6=LOOMINGUrežiimis. + +options.fullscreen.tooltip.1=Täisekraan +options.fullscreen.tooltip.2= SEES - kasuta täisekraanirežiimi +options.fullscreen.tooltip.3= VÄLJAS - kasuta aknarežiimi +options.fullscreen.tooltip.4=Täisekraanirežiim võib olenevalt graafikakaardist +options.fullscreen.tooltip.5=olla aknarežiimist kiirem või aeglasem. + +options.fullscreen.resolution=Täisekraanirežiim +options.fullscreen.resolution.tooltip.1=Täisekraanirežiim +options.fullscreen.resolution.tooltip.2= Vaikimisi - kasuta töölaua ekraaniresolutsiooni, aeglasem +options.fullscreen.resolution.tooltip.3= Laius x kõrgus - kasuta kohandatud resolutsiooni, võib olla kiirem +options.fullscreen.resolution.tooltip.4=Valitud resolutsiooni kasutatakse täisekraanirežiimis (F11). +options.fullscreen.resolution.tooltip.5=Madalamad resolutsioonid peaksid tavaliselt olema kiiremad. + +of.options.SHOW_FPS=Kaadrisageduse kuva +of.options.SHOW_FPS.tooltip.1=Kuvab kompaktselt kaadrisageduse ja renderduse infot. +of.options.SHOW_FPS.tooltip.2= Fps - keskmine/minimaalne kaadrisagedus +of.options.SHOW_FPS.tooltip.3= C: - kamaka renderdajad +of.options.SHOW_FPS.tooltip.4= E: - renderdatud olemid + plokiolemid +of.options.SHOW_FPS.tooltip.5= U: - kamakauuendused +of.options.SHOW_FPS.tooltip.6=Kompaktset kaadrisageduse infot kuvatakse vaid siis, +of.options.SHOW_FPS.tooltip.7=kui silumisvaade pole nähtav. + +of.options.save.45s=45 s +of.options.save.90s=90 s +of.options.save.3min=3 min +of.options.save.6min=6 min +of.options.save.12min=12 min +of.options.save.24min=24 min + +of.options.AUTOSAVE_TICKS=Automaatne salvestus +of.options.AUTOSAVE_TICKS.tooltip.1=Automaatse salvestuse intervall +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - vaikimisi +of.options.AUTOSAVE_TICKS.tooltip.3=Automaatne salvestus võib sõltuvalt nähtavuskaugusest põhjustada +of.options.AUTOSAVE_TICKS.tooltip.4=latentsusokkaid. Maailm salvestub ka mängumenüü avamisel. + +of.options.SCREENSHOT_SIZE=Kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.1=Kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.2= Vaikimisi - vaikimisi kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - kohandatud kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.4=Suurema kuvatõmmise loomine võib vajada rohkem mälu. +of.options.SCREENSHOT_SIZE.tooltip.5=Ei ühildu kiire renderduse ega sakisilumisega. +of.options.SCREENSHOT_SIZE.tooltip.6=Vajab graafikakaardil kaadripuhvri tuge. + +of.options.SHOW_GL_ERRORS=OpenGL'i vead +of.options.SHOW_GL_ERRORS.tooltip.1=OpenGL'i vigade kuvamine +of.options.SHOW_GL_ERRORS.tooltip.2=Lubamisel kuvatakse vestluses OpenGL'i vead. +of.options.SHOW_GL_ERRORS.tooltip.3=Keela see vaid siis, kui on teadaolev konflikt +of.options.SHOW_GL_ERRORS.tooltip.4=ning neid vigu ei saa parandada. +of.options.SHOW_GL_ERRORS.tooltip.5=Keelamisel logitakse vead siiski vealogisse ning +of.options.SHOW_GL_ERRORS.tooltip.6=need võivad siiski põhjustada silmnähtava ks languse. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Vestluse taust +of.options.CHAT_BACKGROUND.tooltip.1=Vestluse taust +of.options.CHAT_BACKGROUND.tooltip.2= Vaikimisi - fikseeritud laius +of.options.CHAT_BACKGROUND.tooltip.3= Kompaktne - vastab realaiusele +of.options.CHAT_BACKGROUND.tooltip.4= VÄLJAS - peidetud + +of.options.CHAT_SHADOW=Vestluse vari +of.options.CHAT_SHADOW.tooltip.1=Vestluse teksti vari +of.options.CHAT_SHADOW.tooltip.2= SEES - kasuta tekstil varje +of.options.CHAT_SHADOW.tooltip.3= VÄLJAS - teksti varjud puuduvad diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/fr_CA.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/fr_CA.lang new file mode 100644 index 0000000..ee5239a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/fr_CA.lang @@ -0,0 +1,593 @@ +#Traduit en français par Z0ul0u25 + +# General +of.general.ambiguous=Ambigue +of.general.custom=Personnalisé +of.general.from=De +of.general.id=ID +of.general.restart=Redémarer +of.general.smart=Intelligent + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=L'Anticrénelage n'est pas compatible avec les Shaders. +of.message.aa.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.af.shaders1=Le Filtrage Anisotropique n'est pas compatible avec les Shaders. +of.message.af.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.fr.shaders1=Le Rendu Rapide n'est pas compatible avec les Shaders. +of.message.fr.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.an.shaders1=L'Anaglyphe 3D n'est pas compatible avec les Shaders. +of.message.an.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.shaders.aa1=Les Shaders ne sont pas compatible avec l'Anticrénelage. +of.message.shaders.aa2=Veuillez fixé Qualité -> Anticrénelage à OFF puis redémarrer le jeu. + +of.message.shaders.af1=Les Shaders ne sont pas compatible avec le Filtrage Anisotropique. +of.message.shaders.af2=Veuillez fixé Qualité -> Filtrage Anisotropique à OFF. + +of.message.shaders.fr1=Les Shaders ne sont pas compatible avec le Rendu Rapide. +of.message.shaders.fr2=Veuillez fixé Performance -> Rendu Rapide à OFF. + +of.message.shaders.an1=Les Shaders ne sont pas compatible avec l'Anaglyphe 3D. +of.message.shaders.an2=Veuillez configurer Autre -> Anaglyphe 3D à OFF. + +of.message.newVersion=Une nouvelle version d'§eOptiFine§f est disponible: §e%s§f +of.message.java64Bit=Pour de meilleure performance, installer une version §e64-bit de Java§f +of.message.openglError=§eErreur OpenGL§f: %s (%s) + +of.message.shaders.loading=Chargement des Shaders: %s + +of.message.other.reset=Réinitialiser tous les réglages vidéos à leurs valeurs par défaut? + +of.message.loadingVisibleChunks=Chargement des Chunks visible + +# Video settings + +options.graphics.tooltip.1=Qualité visuel +options.graphics.tooltip.2= Rapide - Basse qualité (Rapide) +options.graphics.tooltip.3= Détaillée - Haute qualité (Lent) +options.graphics.tooltip.4=Change l'apparence des nuages, des feuilles, +options.graphics.tooltip.5=de l'eau, des ombres et du côté de l'herbe. + +of.options.renderDistance.tiny=Mini +of.options.renderDistance.short=Courte +of.options.renderDistance.normal=Normale +of.options.renderDistance.far=Loin +of.options.renderDistance.extreme=Extrême + +options.renderDistance.tooltip.1=Distance de Rendu +options.renderDistance.tooltip.2= 2 Mini - 32m (Très rapide) +options.renderDistance.tooltip.3= 4 courte - 64m (Rapide) +options.renderDistance.tooltip.4= 8 Normale - 128m +options.renderDistance.tooltip.5= 16 Loin - 256m (Lent) +options.renderDistance.tooltip.6= 32 Extrême - 512m (Très lent) +options.renderDistance.tooltip.7=La distance de rendu Extrême est très gourmande en ressources! +options.renderDistance.tooltip.8=Les valeurs au-dessus de 16 n'ont effet qu'en solo. + +options.ao.tooltip.1=Luminosité adoucie +options.ao.tooltip.2= OFF - aucun adoucissement (rapide) +options.ao.tooltip.3= Minimum - Adoucissement simple (Lent) +options.ao.tooltip.4= Maximum - Adoucissement complexe (Très lent) + +options.framerateLimit.tooltip.1=FPS Max +options.framerateLimit.tooltip.2= VSync - limite du moniteur (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variable +options.framerateLimit.tooltip.4= Illimitée - sans limite (Très rapide) +options.framerateLimit.tooltip.5=La limite de FPS diminue le taux d'image par seconde +options.framerateLimit.tooltip.6=même si la valeur limite n'est pas atteinte. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Ombres adoucies +of.options.AO_LEVEL.tooltip.1=Ombres adoucies +of.options.AO_LEVEL.tooltip.2= OFF - aucune ombre +of.options.AO_LEVEL.tooltip.3= 50%% - légères ombres +of.options.AO_LEVEL.tooltip.4= 100%% - fortes ombres + +options.viewBobbing.tooltip.1=Mouvements plus réalistes. +options.viewBobbing.tooltip.2=Lors de l'utilisation du mipmaps, configurer à OFF pour de meilleurs résultats. + +options.guiScale.tooltip.1=Taille du GUI +options.guiScale.tooltip.2= Auto - taille maximale +options.guiScale.tooltip.3= Petite, Normale, Grande - 1x à 3x +options.guiScale.tooltip.4= 4x à 10x - Disponible pour moniteur 4K +options.guiScale.tooltip.5=Les valeurs impaires (1x, 3x, 5x ...) ne sont pas compatible avec l'Unicode. +options.guiScale.tooltip.2=Un GUI petit serai plus rapide + +options.vbo=Utiliser les VBO +options.vbo.tooltip.1=Objets de Mémoire Tampon +options.vbo.tooltip.2=Utilises des modèles de rendu qui sont habituellement +options.vbo.tooltip.3=plus rapides (5-10%%) que le rendu par défaut. + +options.gamma.tooltip.1=Change la luminosité des endroits sombres +options.gamma.tooltip.2= Sombre - luminosité standard +options.gamma.tooltip.3= 1-99%% - variable +options.gamma.tooltip.4= Lumineux - luminosité maximale pour les objets sombres +options.gamma.tooltip.5=Cette option ne change pas la luminosité des +options.gamma.tooltip.6=objets complètement noirs + +options.anaglyph.tooltip.1=Anaglyphe 3D +options.anaglyph.tooltip.2=Active un effet stéréoscopique 3D utilisant différentes couleurs +options.anaglyph.tooltip.3=pour chaque œil. +options.anaglyph.tooltip.4=Nécessite des lunettes rouge-cyan pour une vue adéquate. + +of.options.ALTERNATE_BLOCKS=Blocs Alternatif +of.options.ALTERNATE_BLOCKS.tooltip.1=Alterne les Blocs +of.options.ALTERNATE_BLOCKS.tooltip.2=Utilises des modèles alternatifs pour certains blocs. +of.options.ALTERNATE_BLOCKS.tooltip.3=Dépend du pack de ressources sélectionné. + +of.options.FOG_FANCY=Brouillard +of.options.FOG_FANCY.tooltip.1=Type de Brouillard +of.options.FOG_FANCY.tooltip.2= Rapide - brouillard rapide +of.options.FOG_FANCY.tooltip.3= Détaillé - meilleure apparence (Plus lent) +of.options.FOG_FANCY.tooltip.4= OFF - Aucun Brouillard (très rapide) +of.options.FOG_FANCY.tooltip.5=Le brouillard détaillé n'est disponible que +of.options.FOG_FANCY.tooltip.6=si la carte graphique peut le supporter. + +of.options.FOG_START=Commencement de Brouillard +of.options.FOG_START.tooltip.1=Commencement de Brouillard +of.options.FOG_START.tooltip.2= 0.2 - commence proche du joueur +of.options.FOG_START.tooltip.3= 0.8 - commence loin du joueur +of.options.FOG_START.tooltip.4=Cette option n'affecte généralement pas les performances. + +of.options.CHUNK_LOADING=Chargement des Chunks +of.options.CHUNK_LOADING.tooltip.1=Chargement des Chunks +of.options.CHUNK_LOADING.tooltip.2= Défaut - FPS instable lors du chargement des chunks +of.options.CHUNK_LOADING.tooltip.3= Adoucie - FPS stable +of.options.CHUNK_LOADING.tooltip.4= Multi-Coeur - FPS stable, Chargement 3x plus rapide +of.options.CHUNK_LOADING.tooltip.5=Adoucie et Multi-Coeur évite le bégaiement et +of.options.CHUNK_LOADING.tooltip.6=les lags causés par le chargement des chunks. +of.options.CHUNK_LOADING.tooltip.7=Multi-Coeur peut augmenter de 3x la vitesse de chargement +of.options.CHUNK_LOADING.tooltip.8=et augmenter les FPS en utilisant un deuxième Coeur du CPU. +of.options.chunkLoading.smooth=Adoucie +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=OFF +of.options.shaders.packDefault=(interne) + +of.options.shaders.ANTIALIASING=Anticrénelage +of.options.shaders.NORMAL_MAP=Map Normale +of.options.shaders.SPECULAR_MAP=Map Spectaculaire +of.options.shaders.RENDER_RES_MUL=Qualité du Rendu +of.options.shaders.SHADOW_RES_MUL=Qualité des Ombres +of.options.shaders.HAND_DEPTH_MUL=Profondeur de la Main +of.options.shaders.CLOUD_SHADOW=Ombres des nuages +of.options.shaders.OLD_HAND_LIGHT=Ancien Éclairage de la Main +of.options.shaders.OLD_LIGHTING=Ancien Éclairage +of.options.shaders.SHADER_PACK=Pack de Shader + +of.options.shaders.shadersFolder=Dossier des Shaders +of.options.shaders.shaderOptions=Options du Shader... + +of.options.shaderOptionsTitle=Options du Shader + +of.options.quality=Qualité... +of.options.qualityTitle=Paramètre de la Qualité + +of.options.details=Détails... +of.options.detailsTitle=Paramètre des Détails + +of.options.performance=Performance... +of.options.performanceTitle=Paramètre des Performances + +of.options.animations=Animations... +of.options.animationsTitle=Paramètre des Animations + +of.options.other=Autre... +of.options.otherTitle=Autre Paramètre + +of.options.other.reset=Réinitialiser les réglages vidéos... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinéaire +of.options.mipmap.linear=Linéaire +of.options.mipmap.nearest=Rapproché +of.options.mipmap.trilinear=Trilinéaire + +options.mipmapLevels.tooltip.1=Effet visuelle qui rend les objets lointains plus beau +options.mipmapLevels.tooltip.2=en adoucissent les détails +options.mipmapLevels.tooltip.3= OFF - Aucun adoucissement +options.mipmapLevels.tooltip.4= 1 - adoucissement minimum +options.mipmapLevels.tooltip.5= 4 - adoucissement maximum +options.mipmapLevels.tooltip.6=Cette option n'affecte généralement pas les performances. + +of.options.MIPMAP_TYPE=Type de Mipmap +of.options.MIPMAP_TYPE.tooltip.1=Effet visuel qui rend les objets lointains plus beau +of.options.MIPMAP_TYPE.tooltip.2=en adoucissent les détails +of.options.MIPMAP_TYPE.tooltip.3= Rapproché - adoucissement esquissé (rapide) +of.options.MIPMAP_TYPE.tooltip.4= Linéaire - adoucissement normal +of.options.MIPMAP_TYPE.tooltip.5= Bilinéaire - adoucissement travaillé +of.options.MIPMAP_TYPE.tooltip.6= Trilinéaire - adoucissement magnifique (lent) + +of.options.AA_LEVEL=Anticrénelage +of.options.AA_LEVEL.tooltip.1=Anticrénelage +of.options.AA_LEVEL.tooltip.2= OFF - (défaut) sans anticrénelage (rapide) +of.options.AA_LEVEL.tooltip.3= 2-16 - anticrénelage les lignes et cotés (lent) +of.options.AA_LEVEL.tooltip.4=L'Anticrénelage adouci l'effet rugueux et +of.options.AA_LEVEL.tooltip.5=les transitions rapides de couleurs. +of.options.AA_LEVEL.tooltip.6=Lorsque activer, les FPS peuvent ralentir. +of.options.AA_LEVEL.tooltip.7=Tous les niveaux ne sont pas supportés par toutes les cartes graphiques. +of.options.AA_LEVEL.tooltip.8=N'a d'effets qu'après un REDÉMARRAGE! + +of.options.AF_LEVEL=Filtrage Anisotropique +of.options.AF_LEVEL.tooltip.1=Filtrage Anisotropique +of.options.AF_LEVEL.tooltip.2= OFF - (défaut) détail de texture standard (rapide) +of.options.AF_LEVEL.tooltip.3= 2-16 - détails plus fins dans les textures mipmappées (lent) +of.options.AF_LEVEL.tooltip.4=Le Filtrage Anisotropique rétablie les détails dans +of.options.AF_LEVEL.tooltip.5=les textures mipmappé. +of.options.AF_LEVEL.tooltip.6=Lorsque activer, les FPS peuvent ralentir. + +of.options.CLEAR_WATER=Eau Claire +of.options.CLEAR_WATER.tooltip.1=Eau Claire +of.options.CLEAR_WATER.tooltip.2= ON - claire, eau transparente +of.options.CLEAR_WATER.tooltip.3= OFF - eau par défaut + +of.options.RANDOM_ENTITIES=Mobs Aléatoires +of.options.RANDOM_ENTITIES.tooltip.1=Mobs Aléatoires +of.options.RANDOM_ENTITIES.tooltip.2= OFF - aucun mob aléatoire (rapide) +of.options.RANDOM_ENTITIES.tooltip.3= ON - avec mob aléatoire (lent) +of.options.RANDOM_ENTITIES.tooltip.4=Les Mobs utilisent des textures aléatoires +of.options.RANDOM_ENTITIES.tooltip.5=A besoin d'un pack de ressources avec plusieurs textures de mob + +of.options.BETTER_GRASS=Meilleur Gazon +of.options.BETTER_GRASS.tooltip.1=Meilleur Gazon +of.options.BETTER_GRASS.tooltip.2= OFF - texture par défaut (rapide) +of.options.BETTER_GRASS.tooltip.3= Rapide - bord de gazon complet (lent) +of.options.BETTER_GRASS.tooltip.4= Détaillé - bord de gazon détaillé (très lent) + +of.options.BETTER_SNOW=Meilleur Neige +of.options.BETTER_SNOW.tooltip.1=Meilleur Neige +of.options.BETTER_SNOW.tooltip.2= OFF - Neige par défaut (rapide) +of.options.BETTER_SNOW.tooltip.3= ON - Meilleure Neige (lent) +of.options.BETTER_SNOW.tooltip.4=Apparait en dessous des blocs transparents (clôture, haute herbe) +of.options.BETTER_SNOW.tooltip.5=lorsque qu'entouré de neige. + +of.options.CUSTOM_FONTS=Police Personnalisé +of.options.CUSTOM_FONTS.tooltip.1=Police Personnalisé +of.options.CUSTOM_FONTS.tooltip.2= ON - utilise la police personnalisée (défaut, lent) +of.options.CUSTOM_FONTS.tooltip.3= OFF - utilise la police par défaut (rapide) +of.options.CUSTOM_FONTS.tooltip.4=La Police Personnalisée est fournis par +of.options.CUSTOM_FONTS.tooltip.5=le pack de ressources utilisé. + +of.options.CUSTOM_COLORS=Couleurs Personnalisés +of.options.CUSTOM_COLORS.tooltip.1=Couleurs Personnalisés +of.options.CUSTOM_COLORS.tooltip.2= ON - utilise des couleurs personnalisées (défaut, lent) +of.options.CUSTOM_COLORS.tooltip.3= OFF - utilise les couleurs par défaut (rapide) +of.options.CUSTOM_COLORS.tooltip.4=Les Couleurs Personnalisées sont fournis par +of.options.CUSTOM_COLORS.tooltip.5=le pack de ressources utilisé. + +of.options.SWAMP_COLORS=Couleurs Marécageuses +of.options.SWAMP_COLORS.tooltip.1=Couleurs Marécageuses +of.options.SWAMP_COLORS.tooltip.2= ON - utilise les couleurs marécageuses (défaut, lent) +of.options.SWAMP_COLORS.tooltip.3= OFF - n'utilise pas les couleurs marécageuses (rapide) +of.options.SWAMP_COLORS.tooltip.4=La couleur marécageuse modifie le gazon, les feuilles, +of.options.SWAMP_COLORS.tooltip.5=les lianes et l'eau. + +of.options.SMOOTH_BIOMES=Biomes Adoucis +of.options.SMOOTH_BIOMES.tooltip.1=Biomes Adoucis +of.options.SMOOTH_BIOMES.tooltip.2= ON - adoucie la bordure des biomes (défaut, lent) +of.options.SMOOTH_BIOMES.tooltip.3= OFF - aucun adoucissement de bordure des biomes (rapide) +of.options.SMOOTH_BIOMES.tooltip.4=L'adoucissement des bordures de biomes est fait en échantillonnant et +of.options.SMOOTH_BIOMES.tooltip.5=moyenant la couleur des blocs aux frontières entre deux biomes. +of.options.SMOOTH_BIOMES.tooltip.6=N'affecte que le gazon, les feuilles, les lianes et l'eau. + +of.options.CONNECTED_TEXTURES=Textures Connectés +of.options.CONNECTED_TEXTURES.tooltip.1=Textures Connectés +of.options.CONNECTED_TEXTURES.tooltip.2= OFF - aucune connexion (défaut) +of.options.CONNECTED_TEXTURES.tooltip.3= Rapide - connexion rapide +of.options.CONNECTED_TEXTURES.tooltip.4= Fancy - connexion détaillée +of.options.CONNECTED_TEXTURES.tooltip.5=Les Textures Connectés connecte les textures de +of.options.CONNECTED_TEXTURES.tooltip.6=la vitre, le grès et les bibliothèques placés une +of.options.CONNECTED_TEXTURES.tooltip.7=à coté de l'autre. Les Textures Connectés sont +of.options.CONNECTED_TEXTURES.tooltip.8=fournis par le pack de ressources utilisé. + +of.options.NATURAL_TEXTURES=Textures Naturelles +of.options.NATURAL_TEXTURES.tooltip.1=Textures Naturelles +of.options.NATURAL_TEXTURES.tooltip.2= OFF - sans textures naturelles (défaut) +of.options.NATURAL_TEXTURES.tooltip.3= ON - avec textures naturelles +of.options.NATURAL_TEXTURES.tooltip.4=Les textures naturelles enlèvent le pattern grillagé +of.options.NATURAL_TEXTURES.tooltip.5=créé par la répétition de bloc identique. +of.options.NATURAL_TEXTURES.tooltip.6=L'utilisation de textures retournées et renversées +of.options.NATURAL_TEXTURES.tooltip.7=est utilisé. La configuration pour les textures naturelles +of.options.NATURAL_TEXTURES.tooltip.8=sont fournies par le pack de ressources utilisé. + +of.options.CUSTOM_SKY=Ciel Personnalisé +of.options.CUSTOM_SKY.tooltip.1=Ciel Personnalisé +of.options.CUSTOM_SKY.tooltip.2= ON - Texture personnalisée (défaut, lent) +of.options.CUSTOM_SKY.tooltip.3= OFF - ciel par défaut (rapide) +of.options.CUSTOM_SKY.tooltip.4=La texture du ciel personnalisé est +of.options.CUSTOM_SKY.tooltip.5=fourni par le pack de ressources utilisé. + +of.options.CUSTOM_ITEMS=Items Personnalisés +of.options.CUSTOM_ITEMS.tooltip.1=Items Personnalisés +of.options.CUSTOM_ITEMS.tooltip.2= ON - textures d'items personnalisés (défaut, lent) +of.options.CUSTOM_ITEMS.tooltip.3= OFF - textures d'items par défaut (rapide) +of.options.CUSTOM_ITEMS.tooltip.4=Les textures d'items personnalisés sont +of.options.CUSTOM_ITEMS.tooltip.5=fournis par le pack de ressources utilisé. + +of.options.CUSTOM_ENTITY_MODELS=Modèles d'Entités Personnalisées +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modèles d'Entités Personnalisées +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ON - modèles d'entités personnalisées (défaut, lent) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= OFF - modèles d'entités par défaut (rapide) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Les modèles d'entités personnalisées sont +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=fournis par le pack de ressources utilisé. + +# Details + +of.options.CLOUDS=Nuages +of.options.CLOUDS.tooltip.1=Nuages +of.options.CLOUDS.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.CLOUDS.tooltip.3= Rapides - basse qualité (rapde) +of.options.CLOUDS.tooltip.4= Détaillés - haute qualité (lent) +of.options.CLOUDS.tooltip.5= OFF - sans nuages (plus rapide) +of.options.CLOUDS.tooltip.6=Les nuages rapides sont rendus en 2D. +of.options.CLOUDS.tooltip.7=Les nuages détaillés sont rendus en 3D. + +of.options.CLOUD_HEIGHT=Hauteur des Nuages +of.options.CLOUD_HEIGHT.tooltip.1=Hauteur des Nuages +of.options.CLOUD_HEIGHT.tooltip.2= OFF - hauteur par défaut +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - au-dessus de la hauteur limite du monde + +of.options.TREES=Arbres +of.options.TREES.tooltip.1=Arbres +of.options.TREES.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.TREES.tooltip.3= Rapides - basse qualité (plus rapide) +of.options.TREES.tooltip.4= Intelligents - haute qualité (rapide) +of.options.TREES.tooltip.5= Détaillés - très haute qualité (lent) +of.options.TREES.tooltip.6=Les arbres rapides ont des feuilles opaques. +of.options.TREES.tooltip.7=Les arbres intelligents et détaillés +of.options.TREES.tooltip.8=ont des feuilles transparentes. + +of.options.RAIN=Pluie & Neige +of.options.RAIN.tooltip.1=Pluie & Neige +of.options.RAIN.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.RAIN.tooltip.3= Rapide - légère pluie/neige (rapide) +of.options.RAIN.tooltip.4= Détaillé - grosse pluie/neige (lent) +of.options.RAIN.tooltip.5= OFF - sans pluie/neige (plus rapide) +of.options.RAIN.tooltip.6=Même si la pluie & la neige est à OFF, +of.options.RAIN.tooltip.7=les éclaboussures et le son sont toujours actifs. + +of.options.SKY=Ciel +of.options.SKY.tooltip.1=Ciel +of.options.SKY.tooltip.2= ON - Le ciel est visible (lent) +of.options.SKY.tooltip.3= OFF - Le ciel n'est pas visible (rapide) +of.options.SKY.tooltip.4=Quand le ciel est à OFF, +of.options.SKY.tooltip.5=le soleil et la lune sont toujours visibles. + +of.options.STARS=Étoiles +of.options.STARS.tooltip.1=Étoiles +of.options.STARS.tooltip.2= ON - Les étoiles sont visible (lent) +of.options.STARS.tooltip.3= OFF - Les étoiles ne sont pas visibles (rapide) + +of.options.SUN_MOON=Soleil & lune +of.options.SUN_MOON.tooltip.1=Soleil & lune +of.options.SUN_MOON.tooltip.2= ON - le soleil et la lune sont visibles (défaut) +of.options.SUN_MOON.tooltip.3= OFF - le soleil et la lune ne sont pas visibles (rapide) + +of.options.SHOW_CAPES=Capes Visibles +of.options.SHOW_CAPES.tooltip.1=Capes visibles +of.options.SHOW_CAPES.tooltip.2= ON - voir la cape de joueurs (défaut) +of.options.SHOW_CAPES.tooltip.3= OFF - ne pas voir la cape des joueurs + +of.options.TRANSLUCENT_BLOCKS=Blocs Translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocs Translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Détaillés - mélange correct des couleurs (défaut) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rapides - mélange rapide ds couleurs (rapide) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controle le mélange des couleurs des blocs translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.5=avec différentes couleurs (verre teindu, eau, glace) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=lorsque placé un à côté de l'autre avec de l'air entre eux. + +of.options.HELD_ITEM_TOOLTIPS=Info-bulles d'Item +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Info-bulles d'Item +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ON - affiche des infos sur l'item en main (défaut) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= OFF - n'affiche pas d'info sur l'item en main + +of.options.ADVANCED_TOOLTIPS=Info-bulles Avancé +of.options.ADVANCED_TOOLTIPS.tooltip.1=Info-bulles Avancé +of.options.ADVANCED_TOOLTIPS.tooltip.2= ON - affiche les infobulles avancées +of.options.ADVANCED_TOOLTIPS.tooltip.3= OFF - n'affiche pas les infobulles avancées (défaut) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Les infobulles avancées affiche des informations détaillées +of.options.ADVANCED_TOOLTIPS.tooltip.5=sur l'item (id, durabilité) et les options des shaders +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, source, valeurs par défaut). + +of.options.DROPPED_ITEMS=Items Droppés +of.options.DROPPED_ITEMS.tooltip.1=Dropped Items +of.options.DROPPED_ITEMS.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.DROPPED_ITEMS.tooltip.3= Rapides - items 2D (rapide) +of.options.DROPPED_ITEMS.tooltip.4= Détaillés - items 3D (lent) + +options.entityShadows.tooltip.1=Ombres des Entités +options.entityShadows.tooltip.2= ON - affiche l'ombre des entités +options.entityShadows.tooltip.3= OFF - n'affiche pas l'ombre des entités + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Effet visuel qui assombrie les coins de l'écran +of.options.VIGNETTE.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.VIGNETTE.tooltip.3= Rapide - vignette désactivée (rapide) +of.options.VIGNETTE.tooltip.4= Détaillée - vignette activée (lent) +of.options.VIGNETTE.tooltip.5=La vignette à un effet significatif sur les FPS, +of.options.VIGNETTE.tooltip.6=surtout lorsque le jeu est en plein écran. +of.options.VIGNETTE.tooltip.7=L'effet de vignette est très subtile et +of.options.VIGNETTE.tooltip.8=peut être désactivé en toute sécurité. + +of.options.DYNAMIC_FOV=CV Dynamique +of.options.DYNAMIC_FOV.tooltip.1=CV Dynamique +of.options.DYNAMIC_FOV.tooltip.2= ON - activer le CV dynamique (défaut) +of.options.DYNAMIC_FOV.tooltip.3= OFF - désactiver le CV dynamique +of.options.DYNAMIC_FOV.tooltip.4=Changer le champ visuel (CV) lors du vol, du sprint +of.options.DYNAMIC_FOV.tooltip.5=de la nage et du bandage d'un arc. + +of.options.DYNAMIC_LIGHTS=Lumières Dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.1=Lumières Dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.2= OFF - aucune lumière dynamique (défaut) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapides - lumières dynamiques rapides (rafraichi à tous les 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Détaillées - Lumières dynamiques détaillées (rafraichi en temps réel) +of.options.DYNAMIC_LIGHTS.tooltip.5=Active la lumière des items (torche, pierre lumineuse, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=pour illuminer tout autour quand l'item et en main, +of.options.DYNAMIC_LIGHTS.tooltip.7=equipper par d'autres joueurs ou jeter au sol. + +# Performance + +of.options.SMOOTH_FPS=FPS Atténué +of.options.SMOOTH_FPS.tooltip.1=Stabilise les FPS en supprimant les tampons de mémoires graphiques. +of.options.SMOOTH_FPS.tooltip.2= OFF - aucune stabilisation, Les FPS peuvent varier +of.options.SMOOTH_FPS.tooltip.3= ON - stabilisation des FPS +of.options.SMOOTH_FPS.tooltip.4=Cette option dépend du gestionnaire graphique, les +of.options.SMOOTH_FPS.tooltip.5=effets ne sont pas toujours visibles. + +of.options.SMOOTH_WORLD=Monde Atténué +of.options.SMOOTH_WORLD.tooltip.1=Élimine les piques de lag causé par le serveur interne. +of.options.SMOOTH_WORLD.tooltip.2= OFF - aucune stabilisation, Les FPS peuvent varier +of.options.SMOOTH_WORLD.tooltip.3= ON - stabilisation des FPS +of.options.SMOOTH_WORLD.tooltip.4=Stabilises les FPS en distribuent les charges du serveur interne. +of.options.SMOOTH_WORLD.tooltip.5=Fonctionne seulement en local (monde solo). + +of.options.FAST_RENDER=Rendu Rapide +of.options.FAST_RENDER.tooltip.1=Rendu Rapide +of.options.FAST_RENDER.tooltip.2= OFF - rendu standard (défaut) +of.options.FAST_RENDER.tooltip.3= ON - rendu optimisé (rapide) +of.options.FAST_RENDER.tooltip.4=Utilise des algorithmes de rendu optimisé pour diminuer +of.options.FAST_RENDER.tooltip.5=la charge du GPU et peut augmenter les FPS. + +of.options.FAST_MATH=Maths Rapides +of.options.FAST_MATH.tooltip.1=Mats Rapides +of.options.FAST_MATH.tooltip.2= OFF - math standard (défaut) +of.options.FAST_MATH.tooltip.3= ON - math optimisé +of.options.FAST_MATH.tooltip.4=Utilise des fonctions optimisées de sin() et cos() qui peuvent +of.options.FAST_MATH.tooltip.5=mieu utilisé la cache du CPU et augmenter les FPS. + +of.options.CHUNK_UPDATES=Mise à Jour des Chunks +of.options.CHUNK_UPDATES.tooltip.1=Mise à Jour des Chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - chargement lent du monde, meilleur FPS (défaut) +of.options.CHUNK_UPDATES.tooltip.3= 3 - chargement rapide du monde, bas FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - chargement très rapide du monde, très bas FPS +of.options.CHUNK_UPDATES.tooltip.5=Nombre de Mise à jour par image de rendu (tick), +of.options.CHUNK_UPDATES.tooltip.6=Les valeurs élevées peut déstabilisé les FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Mises à Jour Dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Mises à Jours Dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= OFF - mise à jour standard (défaut) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ON - plus de mise à jour lorsque le joueur ne bouge pas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Les mises à jour dynamiques force plus de +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=chunks à ce mettre à jour quand le joueur +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=est inactif pour charger le monde plus vite. + +of.options.LAZY_CHUNK_LOADING=Chargement des Chunks Lâches +of.options.LAZY_CHUNK_LOADING.tooltip.1=Chargement Lâche des Chunks +of.options.LAZY_CHUNK_LOADING.tooltip.2= OFF - chargement des chunks serveurs par défaut +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - chargement des chunks serveur lâche (plus doux) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Adoucie le chargement des chunks serveurs intégrés +of.options.LAZY_CHUNK_LOADING.tooltip.5=en distribuant les chunks sur plusieurs ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Tourné à OFF si des parties du monde ne se charge pas correctement. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Fonctionne seulement en local (monde solo) et les CPU à un coeur. + +# Animations + +of.options.animation.allOn=Tous à ON +of.options.animation.allOff=Tous à OFF +of.options.animation.dynamic=Dynamique + +of.options.ANIMATED_WATER=Eau Animée +of.options.ANIMATED_LAVA=Lave Animée +of.options.ANIMATED_FIRE=Feux Animé +of.options.ANIMATED_PORTAL=Portail Animé +of.options.ANIMATED_REDSTONE=Redstone Animé +of.options.ANIMATED_EXPLOSION=Explosion Animée +of.options.ANIMATED_FLAME=Flamme Animé +of.options.ANIMATED_SMOKE=Fumée Animée +of.options.VOID_PARTICLES=Particules de Vide +of.options.WATER_PARTICLES=Particules d'Eau +of.options.RAIN_SPLASH=Particules de Pluie +of.options.PORTAL_PARTICLES=Particules de Portail +of.options.POTION_PARTICLES=Particules de Potion +of.options.DRIPPING_WATER_LAVA=Eau/Lave qui Coule +of.options.ANIMATED_TERRAIN=Terrain Animé +of.options.ANIMATED_TEXTURES=Textures Animées +of.options.FIREWORK_PARTICLES=Particules de Feux d'Artifice + +# Other + +of.options.LAGOMETER=Lagomèter +of.options.LAGOMETER.tooltip.1=Affiche le Lagomètre sur l'écran de débogage (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Récupérateur de mémoire +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Blue - Executables programmés +of.options.LAGOMETER.tooltip.5=* Purple - Chunk téléchargé +of.options.LAGOMETER.tooltip.6=* Red - Mises à jour de chunk +of.options.LAGOMETER.tooltip.7=* Yellow - Contrôle de visibilité +of.options.LAGOMETER.tooltip.8=* Green - Terrain rendu + +of.options.PROFILER=Profileur de Débogage +of.options.PROFILER.tooltip.1=Profileur de Débogage +of.options.PROFILER.tooltip.2= ON - profileur actif (lent) +of.options.PROFILER.tooltip.3= OFF - profileur non actif (rapide) +of.options.PROFILER.tooltip.4=Le profileur de débogage collecte et affiche des informations de +of.options.PROFILER.tooltip.5=débogage lorsque l'écran de débogage (F3) est ouvert. + +of.options.WEATHER=Météo +of.options.WEATHER.tooltip.1=Météo +of.options.WEATHER.tooltip.2= ON - Météo active (lent) +of.options.WEATHER.tooltip.3= OFF - Météo non active (rapide) +of.options.WEATHER.tooltip.4=La météo contrôle la pluie, la neige et l'orage. +of.options.WEATHER.tooltip.5=Le contrôle de la météo n'est possible qu'en local. + +of.options.time.dayOnly=Jour Seulement +of.options.time.nightOnly=Nuit Seulement + +of.options.TIME=temps +of.options.TIME.tooltip.1=Temps +of.options.TIME.tooltip.2= Défaut - Cycle jour/nuit normal +of.options.TIME.tooltip.3= Jour Seulement - jour seulement +of.options.TIME.tooltip.4= Nuit Seulement - nuit seulement +of.options.TIME.tooltip.5=La séléction du temps n'est possible qu'en CRÉATIF +of.options.TIME.tooltip.6=dans un monde local. + +options.fullscreen.tooltip.1=Plein Écran +options.fullscreen.tooltip.2= ON - jeu en plein écran +options.fullscreen.tooltip.3= OFF - jeu fenêtré +options.fullscreen.tooltip.4=Le mode plein écran peut être plus rapide ou plus lent +options.fullscreen.tooltip.5=que le mode fenêtré, cela dépend de la carte graphique. + +of.options.FULLSCREEN_MODE=Option Plein Écran +of.options.FULLSCREEN_MODE.tooltip.1=Option Plein Écran +of.options.FULLSCREEN_MODE.tooltip.2= Défaut - utilise la résolution du moniteur (lent) +of.options.FULLSCREEN_MODE.tooltip.3= LxH - utilise une résolution personnalisée (rapide) +of.options.FULLSCREEN_MODE.tooltip.4=La résolution sélectionnée est utilisé en mode plein écran (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Une résolution plus basse devrait être plus rapide. + +of.options.SHOW_FPS=Afficher les FPS +of.options.SHOW_FPS.tooltip.1=Affiche les FPS et informations de rendu. +of.options.SHOW_FPS.tooltip.2= C: - chunk rendu +of.options.SHOW_FPS.tooltip.3= E: - entités rendu + bloc entités +of.options.SHOW_FPS.tooltip.4= U: - mises à jour de chunk +of.options.SHOW_FPS.tooltip.5=Les informations sont présenté de manière compacte dans le coin +of.options.SHOW_FPS.tooltip.6=supérieur gauche lorsque l'écran de débogage n'est pas visible + +of.options.save.default=Défaut (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Sauvegarde Automatique +of.options.AUTOSAVE_TICKS.tooltip.1=Intervale entre les sauvegardes +of.options.AUTOSAVE_TICKS.tooltip.2=L'intervalle par défaut (2s) n'est PAS RECOMMENDER. +of.options.AUTOSAVE_TICKS.tooltip.3=Les sauvegardes automatiques sont la cause +of.options.AUTOSAVE_TICKS.tooltip.4=du Pique de Lag de la Mort qui Tue. + +of.options.SCREENSHOT_SIZE=Taille des Captures d'Écrans +of.options.SCREENSHOT_SIZE.tooltip.1=Taille des Captures d'Écrans +of.options.SCREENSHOT_SIZE.tooltip.2= Défaut - taille de la fenêtre +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - taille personnalisée +of.options.SCREENSHOT_SIZE.tooltip.4=Prendre une capture d'écran plus grande utilise plus de mémoire. +of.options.SCREENSHOT_SIZE.tooltip.5=Incompatible avec le Rendu Rapide et l'Anticrénelage. +of.options.SCREENSHOT_SIZE.tooltip.6=Nécessite un GPU avec un tampon d'image. \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/fr_FR.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/fr_FR.lang new file mode 100644 index 0000000..074da8a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/fr_FR.lang @@ -0,0 +1,778 @@ +# Traduit en français par Z0ul0u25, Koockies, SkytAsul, robot275 et Calinou + +# General +of.general.ambiguous=Ambiguë +of.general.custom=Personnalisé +of.general.from=De +of.general.id=ID +of.general.restart=Redémarrer +of.general.smart=Approfondis + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=L'anticrénelage n'est pas compatible avec les shaders. +of.message.aa.shaders2=Veuillez désactiver les shaders pour activer cette option. + +of.message.af.shaders1=Le filtrage anisotrope n'est pas compatible avec les shaders. +of.message.af.shaders2=Veuillez désactiver les shaders pour activer cette option. + +of.message.fr.shaders1=Le rendu rapide n'est pas compatible avec les shaders. +of.message.fr.shaders2=Veuillez désactiver les shaders pour activer cette option. + +of.message.an.shaders1=L'anaglyphe 3D n'est pas compatible avec les shaders. +of.message.an.shaders2=Veuillez désactiver les shaders pour activer cette option. + +of.message.shaders.aa1=Les shaders ne sont pas compatibles avec l'anticrénelage. +of.message.shaders.aa2=Veuillez définir Qualité -> Anticrénelage sur "Non" puis redémarrez le jeu. + +of.message.shaders.af1=Les shaders ne sont pas compatibles avec le filtrage anisotrope. +of.message.shaders.af2=Veuillez définir Qualité -> Filtrage anisotrope sur "Non". + +of.message.shaders.fr1=Les shaders ne sont pas compatibles avec le rendu rapide. +of.message.shaders.fr2=Veuillez définir Performance -> Rendu rapide sur "Non". + +of.message.shaders.an1=Les shaders ne sont pas compatibles avec la 3D anaglyphe. +of.message.shaders.an2=Veuillez définir Autre -> 3D anaglyphe sur "Non". + +of.message.shaders.nv1=Ce pack de shaders nécessite une version d'OptiFine plus récente : %s +of.message.shaders.nv2=Voulez-vous vraiment continuer ? + +of.message.newVersion=Une nouvelle version d'§eOptiFine§f est disponible : §e%s§f +of.message.java64Bit=Pour de meilleures performances, installez une version §e64 bits de Java§f +of.message.openglError=§eErreur OpenGL§f : %s (%s) + +of.message.shaders.loading=Chargement des shaders : %s + +of.message.other.reset=Réinitialiser tous les réglages vidéo à leurs valeurs par défaut ? + +of.message.loadingVisibleChunks=Chargement des tronçons visibles + +# Skin customization + +of.options.skinCustomisation.ofCape=Cape OptiFine... + +of.options.capeOF.title=Cape OptiFine +of.options.capeOF.openEditor=Ouvrir l'éditeur de cape +of.options.capeOF.reloadCape=Recharger la cape + +of.message.capeOF.openEditor=L'éditeur de cape OptiFine devrait s'ouvrir dans un navigateur internet. +of.message.capeOF.reloadCape=La cape sera rechargée dans 15 secondes. + +of.message.capeOF.error1=Échec de l'authentification Mojang. +of.message.capeOF.error2=Erreur : %s + +# Video settings + +options.graphics.tooltip.1=Graphismes +options.graphics.tooltip.2= Rapides - Basse qualité (rapide) +options.graphics.tooltip.3= Détaillés - Haute qualité (lent) +options.graphics.tooltip.4=Modifie l'apparence des nuages, des feuilles, de l'eau, des +options.graphics.tooltip.5=ombres et du côté de l'herbe. + +of.options.renderDistance.tiny=Minimale +of.options.renderDistance.short=Courte +of.options.renderDistance.normal=Normale +of.options.renderDistance.far=Lointaine +of.options.renderDistance.extreme=Extrême +of.options.renderDistance.insane=Insensée +of.options.renderDistance.ludicrous=Inimaginable + +options.renderDistance.tooltip.1=Distance d'affichage +options.renderDistance.tooltip.2= 2 Mini - 32m (très rapide) +options.renderDistance.tooltip.3= 8 Normale - 128m (normal) +options.renderDistance.tooltip.4= 16 Loin - 256m (lent) +options.renderDistance.tooltip.5= 32 Extrême - 512m (très lent) - Très gourmand en ressources +options.renderDistance.tooltip.6= 48 Insensée - 768m, nécessite 2 Go de RAM allouée +options.renderDistance.tooltip.7= 64 Inimaginable - 1024m, nécessite 3 Go de RAM allouée +options.renderDistance.tooltip.8=Les valeurs au-dessus de 16 n'ont effet qu'en solo. + +options.ao.tooltip.1=Luminosité adoucie +options.ao.tooltip.2= Non - aucun adoucissement (rapide) +options.ao.tooltip.3= Minimum - Adoucissement simple (lent) +options.ao.tooltip.4= Maximum - Adoucissement complexe (très lent) + +options.framerateLimit.tooltip.1=FPS max +options.framerateLimit.tooltip.2= VSync - limite de l'écran (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variable +options.framerateLimit.tooltip.4= Illimitée - sans limite (très rapide) +options.framerateLimit.tooltip.5=La limite de FPS diminue le taux d'images par seconde +options.framerateLimit.tooltip.6=même si la valeur limite n'est pas atteinte. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Ombres adoucies +of.options.AO_LEVEL.tooltip.1=Ombres adoucies +of.options.AO_LEVEL.tooltip.2= Non - aucune ombre +of.options.AO_LEVEL.tooltip.3= 50 %% - légères ombres +of.options.AO_LEVEL.tooltip.4= 100 %% - fortes ombres + +options.viewBobbing.tooltip.1=Mouvements plus réalistes. +options.viewBobbing.tooltip.2=Lors de l'utilisation du mipmap, définir sur "Non" pour de +options.viewBobbing.tooltip.3=meilleurs résultats. + +options.guiScale.tooltip.1=Taille de l'interface +options.guiScale.tooltip.2= Auto - taille maximale +options.guiScale.tooltip.3= Petite, Normale, Grande - 1x à 3x +options.guiScale.tooltip.4= 4x à 10x - Disponible pour les écrans 4K +options.guiScale.tooltip.5=Les valeurs impaires (1x, 3x, 5x ...) ne sont pas +options.guiScale.tooltip.6=compatibles avec l'Unicode. +options.guiScale.tooltip.7=Une petite interface peut rendre le jeu plus rapide. + +options.vbo=Utiliser les VBOs +options.vbo.tooltip.1=Utiliser les VBOs (objets en mémoire tampon) +options.vbo.tooltip.2=Utilise un autre modèle de rendu qui est habituellement +options.vbo.tooltip.3=plus rapide (5-10 %%) que le rendu par défaut. + +options.gamma.tooltip.1=Change la luminosité des endroits sombres +options.gamma.tooltip.2= Sombre - luminosité standard +options.gamma.tooltip.3= 1-99 %% - variable +options.gamma.tooltip.4= Vive - luminosité maximale pour les objets sombres +options.gamma.tooltip.5=Cette option ne change pas la luminosité des objets +options.gamma.tooltip.6=complètement noirs. + +options.anaglyph.tooltip.1=3D anaglyphe +options.anaglyph.tooltip.2=Active un effet stéréoscopique 3D utilisant +options.anaglyph.tooltip.3=différentes couleurs pour chaque œil. +options.anaglyph.tooltip.4=Nécessite des lunettes rouge-cyan pour une vue adaptée. + +options.attackIndicator.tooltip.1=Configure la position de l'indicateur d'attaque +options.attackIndicator.tooltip.2= Viseur - sous le viseur +options.attackIndicator.tooltip.3= Barre - à côté de la barre +options.attackIndicator.tooltip.4= Non - pas d'indicateur d'attaque +options.attackIndicator.tooltip.5=L'indicateur montre la force d'attaque de l'objet en +options.attackIndicator.tooltip.6=main. + +of.options.ALTERNATE_BLOCKS=Blocs alternatifs +of.options.ALTERNATE_BLOCKS.tooltip.1=Blocs alternatifs +of.options.ALTERNATE_BLOCKS.tooltip.2=Utilise des modèles alternatifs pour certains blocs. +of.options.ALTERNATE_BLOCKS.tooltip.3=Dépend du pack de ressources sélectionné. + +of.options.FOG_FANCY=Brouillard +of.options.FOG_FANCY.tooltip.1=Type de brouillard +of.options.FOG_FANCY.tooltip.2= Rapide - brouillard rapide +of.options.FOG_FANCY.tooltip.3= Détaillé - meilleure apparence (plus lent) +of.options.FOG_FANCY.tooltip.4= Non - Aucun brouillard (très rapide) +of.options.FOG_FANCY.tooltip.5=Le brouillard détaillé n'est disponible que si la carte +of.options.FOG_FANCY.tooltip.6=graphique le prend en charge. + +of.options.FOG_START=Début du brouillard +of.options.FOG_START.tooltip.1=Début du brouillard +of.options.FOG_START.tooltip.2= 0.2 - Le brouillard commence près du joueur +of.options.FOG_START.tooltip.3= 0.8 - Le brouillard commence loin du joueur +of.options.FOG_START.tooltip.4=Ceci n'affecte généralement pas les performances. + +of.options.CHUNK_LOADING=Chargement des tronçons +of.options.CHUNK_LOADING.tooltip.1=Chargement des tronçons +of.options.CHUNK_LOADING.tooltip.2= Défaut - FPS instable lors du chargement des tronçons +of.options.CHUNK_LOADING.tooltip.3= Adouci - FPS stable +of.options.CHUNK_LOADING.tooltip.4= Multi-coeur - FPS stable, chargement 3x plus rapide +of.options.CHUNK_LOADING.tooltip.5=Adouci et Multi-coeur permettent d'éviter le ralentissement +of.options.CHUNK_LOADING.tooltip.6=et les lags causés par le chargement des tronçons. +of.options.CHUNK_LOADING.tooltip.7=Multi-coeur peut augmenter de 3x la vitesse de chargement +of.options.CHUNK_LOADING.tooltip.8=et augmenter les FPS en utilisant un autre coeur du processeur. +of.options.chunkLoading.smooth=Adouci +of.options.chunkLoading.multiCore=Multi-coeur + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=DÉSACTIVÉS +of.options.shaders.packDefault=(interne) + +of.options.shaders.ANTIALIASING=Anticrénelage +of.options.shaders.ANTIALIASING.tooltip.1=Anticrénelage +of.options.shaders.ANTIALIASING.tooltip.2= Non - (par défaut) pas d'anticrénelage (rapide) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - anticrénelage des lignes et bords (lent) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA est un effet de post-traitement qui adoucit les +of.options.shaders.ANTIALIASING.tooltip.5=lignes rugueuses et transitions rapides de couleur. +of.options.shaders.ANTIALIASING.tooltip.6=Il est plus rapide que l'anticrénelage traditionnel +of.options.shaders.ANTIALIASING.tooltip.7=et est compatible avec les shaders et le rendu rapide. + +of.options.shaders.NORMAL_MAP=Carte normale +of.options.shaders.NORMAL_MAP.tooltip.1=Carte normale +of.options.shaders.NORMAL_MAP.tooltip.2= Oui - (par défaut) Active les cartes normales +of.options.shaders.NORMAL_MAP.tooltip.3= Non - Désactive les cartes normales +of.options.shaders.NORMAL_MAP.tooltip.4=Les cartes normales peuvent être utilisées par les shaders +of.options.shaders.NORMAL_MAP.tooltip.5=pour simuler la géométrie 3D sur des surfaces de modèles plats. +of.options.shaders.NORMAL_MAP.tooltip.6=Les textures de cartes normales sont fournies par +of.options.shaders.NORMAL_MAP.tooltip.7=le pack de ressources utilisé. + +of.options.shaders.SPECULAR_MAP=Carte spéculaire +of.options.shaders.SPECULAR_MAP.tooltip.1=Carte spéculaire +of.options.shaders.SPECULAR_MAP.tooltip.2= Oui - (par défaut) Active les cartes spéculaires +of.options.shaders.SPECULAR_MAP.tooltip.3= Non - Désactive les cartes spéculaires +of.options.shaders.SPECULAR_MAP.tooltip.4=Les cartes spéculaires peuvent être utilisées par les shaders +of.options.shaders.SPECULAR_MAP.tooltip.5=pour simuler des reflets de lumière sur les surfaces. +of.options.shaders.SPECULAR_MAP.tooltip.6=Les textures de cartes spéculaires sont fournies par +of.options.shaders.SPECULAR_MAP.tooltip.7=le pack de ressources utilisé. + +of.options.shaders.RENDER_RES_MUL=Qualité du rendu +of.options.shaders.RENDER_RES_MUL.tooltip.1=Qualité du rendu +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - faible (rapide) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (par défaut) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - haute (lent) +of.options.shaders.RENDER_RES_MUL.tooltip.5=La qualité du rendu contrôle la taille des textures +of.options.shaders.RENDER_RES_MUL.tooltip.6=dont les shaders vont faire le rendu. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Des valeurs faibles peuvent être utiles pour les écrans 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Des valeurs hautes servent de filtre d'anticrénelage. + +of.options.shaders.SHADOW_RES_MUL=Qualité des ombres +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Qualité des ombres +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - faible (rapide) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (par défaut) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - haute (lent) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=La qualité des ombres contrôle la taille de la texture +of.options.shaders.SHADOW_RES_MUL.tooltip.6=de la map des ombres utilisée par les shaders. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Valeurs faibles = ombres grossières, inexactes. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Valeurs hautes = ombres subtiles, détaillées. + +of.options.shaders.HAND_DEPTH_MUL=Profondeur de main +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Profondeur de la main +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - Main proche de la caméra +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (par défaut) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - Main éloignée de la caméra +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=La profondeur de la main contrôle l'éloignement des +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=objets tenus, par rapport à la caméra. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Cela devrait changer le flou des objets en main +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=pour les shaders avec un flou de profondeur de champ. + +of.options.shaders.CLOUD_SHADOW=Ombre des nuages + +of.options.shaders.OLD_HAND_LIGHT=Ancien éclairage de main +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Ancien éclairage de la main +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Par défaut - géré par le shader +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Oui - utilise l'ancien éclairage de la main +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Non - utilise le nouvel éclairage de la main +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Ce réglage permet aux shaders qui ne reconnaissent que +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=les objets émettant de la lumière depuis la main principale +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=de marcher avec les objets dans la seconde main. + +of.options.shaders.OLD_LIGHTING=Ancien éclairage +of.options.shaders.OLD_LIGHTING.tooltip.1=Ancien éclairage +of.options.shaders.OLD_LIGHTING.tooltip.2= Par défaut - géré par le shader +of.options.shaders.OLD_LIGHTING.tooltip.3= Oui - utilise l'ancien éclairage +of.options.shaders.OLD_LIGHTING.tooltip.4= Non - n'utilise pas l'ancien éclairage +of.options.shaders.OLD_LIGHTING.tooltip.5=L'ancien éclairage contrôle l'éclairage fixe imposé par +of.options.shaders.OLD_LIGHTING.tooltip.6=défaut aux côtés des blocs. +of.options.shaders.OLD_LIGHTING.tooltip.7=Les shaders avec des ombres apportent généralement +of.options.shaders.OLD_LIGHTING.tooltip.8=un éclairage bien meilleur, selon la position du soleil. + +of.options.shaders.DOWNLOAD=Télécharger les shaders +of.options.shaders.DOWNLOAD.tooltip.1=Télécharger les shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Ouvre la page des packs de shaders dans un navigateur. +of.options.shaders.DOWNLOAD.tooltip.4=Mettez les packs téléchargés dans le "Dossier des shaders" +of.options.shaders.DOWNLOAD.tooltip.5=et ils apparaîtront dans la liste des shaders installés. + +of.options.shaders.SHADER_PACK=Pack de shaders + +of.options.shaders.shadersFolder=Dossier des shaders +of.options.shaders.shaderOptions=Options du shader... + +of.options.shaderOptionsTitle=Options du shader + +of.options.quality=Qualité... +of.options.qualityTitle=Paramètres de la qualité + +of.options.details=Détails... +of.options.detailsTitle=Paramètres des détails + +of.options.performance=Performances... +of.options.performanceTitle=Paramètres des performances + +of.options.animations=Animations... +of.options.animationsTitle=Paramètres des animations + +of.options.other=Autres... +of.options.otherTitle=Autres paramètres + +of.options.other.reset=Réinitialiser les réglages vidéos... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinéaire +of.options.mipmap.linear=Linéaire +of.options.mipmap.nearest=Le plus proche +of.options.mipmap.trilinear=Trilinéaire + +options.mipmapLevels.tooltip.1=Effet visuel qui rend les objets lointains plus beaux +options.mipmapLevels.tooltip.2=en adoucissant les détails +options.mipmapLevels.tooltip.3= Non - aucun adoucissement +options.mipmapLevels.tooltip.4= 1 - adoucissement minimum +options.mipmapLevels.tooltip.5= 4 - adoucissement maximum +options.mipmapLevels.tooltip.6=Ceci n'affecte généralement pas les performances. + +of.options.MIPMAP_TYPE=Type de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Effet visuel qui rend les objets lointains plus beau +of.options.MIPMAP_TYPE.tooltip.2=en adoucissant les détails +of.options.MIPMAP_TYPE.tooltip.3= Rapproché - adoucissement esquissé (rapide) +of.options.MIPMAP_TYPE.tooltip.4= Linéaire - adoucissement normal +of.options.MIPMAP_TYPE.tooltip.5= Bilinéaire - adoucissement travaillé +of.options.MIPMAP_TYPE.tooltip.6= Trilinéaire - adoucissement magnifique (lent) + + +of.options.AA_LEVEL=Anticrénelage +of.options.AA_LEVEL.tooltip.1=Anticrénelage +of.options.AA_LEVEL.tooltip.2= Non - (par défaut) sans anticrénelage (rapide) +of.options.AA_LEVEL.tooltip.3= 2-16 - anticrénelage des lignes et bords (lent) +of.options.AA_LEVEL.tooltip.4=L'anticrénelage adoucit les lignes rugueuses et les +of.options.AA_LEVEL.tooltip.5=transitions rapides de couleurs. +of.options.AA_LEVEL.tooltip.6=Les FPS peuvent fortement chuter lorsque cette option est activée. +of.options.AA_LEVEL.tooltip.7=Tous les niveaux ne sont pas supportés par toutes les cartes graphiques. +of.options.AA_LEVEL.tooltip.8=Ne prend effet qu'après un REDÉMARRAGE ! + +of.options.AF_LEVEL=Filtrage anisotrope +of.options.AF_LEVEL.tooltip.1=Filtrage anisotrope +of.options.AF_LEVEL.tooltip.2= Non - (par défaut) détail de texture standard (rapide) +of.options.AF_LEVEL.tooltip.3= 2-16 - détails plus fins dans les textures mipmappées (lent) +of.options.AF_LEVEL.tooltip.4=Le filtrage anisotrope rétablit les détails dans les +of.options.AF_LEVEL.tooltip.5=textures mipmappées. +of.options.AF_LEVEL.tooltip.6=Les FPS peuvent fortement chuter lorsque cette option est +of.options.AF_LEVEL.tooltip.7=activée. + +of.options.CLEAR_WATER=Eau claire +of.options.CLEAR_WATER.tooltip.1=Eau claire +of.options.CLEAR_WATER.tooltip.2= Oui - eau transparente, claire +of.options.CLEAR_WATER.tooltip.3= Non - eau par défaut + +of.options.RANDOM_ENTITIES=Entités aléatoires +of.options.RANDOM_ENTITIES.tooltip.1=Entités aléatoires +of.options.RANDOM_ENTITIES.tooltip.2= Non - aucune entité aléatoire (rapide) +of.options.RANDOM_ENTITIES.tooltip.3= Oui - entités aléatoires activées (lent) +of.options.RANDOM_ENTITIES.tooltip.4=Utilise des textures aléatoires pour les entités du jeu. +of.options.RANDOM_ENTITIES.tooltip.5=Nécessite un pack de ressources avec plusieurs +of.options.RANDOM_ENTITIES.tooltip.6=textures par entité. + +of.options.BETTER_GRASS=Meilleurs blocs d'herbe +of.options.BETTER_GRASS.tooltip.1=Meilleurs blocs d'herbe +of.options.BETTER_GRASS.tooltip.2= Non - texture par défaut (rapide) +of.options.BETTER_GRASS.tooltip.3= Rapides - bords de bloc d'herbe complet (lent) +of.options.BETTER_GRASS.tooltip.4= Détaillés - bords de bloc d'herbe détaillés (très lent) + +of.options.BETTER_SNOW=Meilleure neige +of.options.BETTER_SNOW.tooltip.1=Meilleure neige +of.options.BETTER_SNOW.tooltip.2= Non - Neige par défaut (rapide) +of.options.BETTER_SNOW.tooltip.3= Oui - Meilleure neige (lent) +of.options.BETTER_SNOW.tooltip.4=Fait apparaître de la neige sous des blocs transparents +of.options.BETTER_SNOW.tooltip.5=(barrière, hautes herbes) lorsqu'ils sont entourés de +of.options.BETTER_SNOW.tooltip.6=neige. + +of.options.CUSTOM_FONTS=Police personnalisée +of.options.CUSTOM_FONTS.tooltip.1=Police personnalisée +of.options.CUSTOM_FONTS.tooltip.2= Oui - utilise la police personnalisée (par défaut, lent) +of.options.CUSTOM_FONTS.tooltip.3= Non - utilise la police par défaut (rapide) +of.options.CUSTOM_FONTS.tooltip.4=La police personnalisée est fournie par le pack de +of.options.CUSTOM_FONTS.tooltip.5=ressources utilisé. + +of.options.CUSTOM_COLORS=Couleurs personnalisées +of.options.CUSTOM_COLORS.tooltip.1=Couleurs personnalisées +of.options.CUSTOM_COLORS.tooltip.2= Oui - utilise des couleurs personnalisées (par défaut, lent) +of.options.CUSTOM_COLORS.tooltip.3= Non - utilise les couleurs par défaut (rapide) +of.options.CUSTOM_COLORS.tooltip.4=Les couleurs personnalisées sont fournies par le pack +of.options.CUSTOM_COLORS.tooltip.5=de ressources utilisé. + +of.options.SWAMP_COLORS=Couleurs marécageuses +of.options.SWAMP_COLORS.tooltip.1=Couleurs marécageuses +of.options.SWAMP_COLORS.tooltip.2= Oui - utilise des couleurs marécageuses (par défaut, lent) +of.options.SWAMP_COLORS.tooltip.3= Non - n'utilise pas de couleurs marécageuses (rapide) +of.options.SWAMP_COLORS.tooltip.4=Les couleurs marécageuses modifient la pelouse, les +of.options.SWAMP_COLORS.tooltip.5=feuilles, les lianes et l'eau. + +of.options.SMOOTH_BIOMES=Biomes adoucis +of.options.SMOOTH_BIOMES.tooltip.1=Biomes adoucis +of.options.SMOOTH_BIOMES.tooltip.2= Oui - adoucit la bordure des biomes (par défaut, lent) +of.options.SMOOTH_BIOMES.tooltip.3= Non - n'adoucit pas la bordure des biomes (rapide) +of.options.SMOOTH_BIOMES.tooltip.4=L'adoucissement des bordures est fait en échantillonnant et +of.options.SMOOTH_BIOMES.tooltip.5=moyennant la couleur des blocs aux frontières de biomes. +of.options.SMOOTH_BIOMES.tooltip.6=N'affecte que la pelouse, les feuilles, les lianes et l'eau. + +of.options.CONNECTED_TEXTURES=Textures connectées +of.options.CONNECTED_TEXTURES.tooltip.1=Textures connectées +of.options.CONNECTED_TEXTURES.tooltip.2= Non - aucune connexion (par défaut) +of.options.CONNECTED_TEXTURES.tooltip.3= Rapides - connexions rapides +of.options.CONNECTED_TEXTURES.tooltip.4= Détaillés - connexions détaillées +of.options.CONNECTED_TEXTURES.tooltip.5=Les textures connectées connecte les textures des +of.options.CONNECTED_TEXTURES.tooltip.6=vitres, du grès et des bibliothèques placés côte-à-côte. +of.options.CONNECTED_TEXTURES.tooltip.7=Les textures connectées sont fournies par le pack de +of.options.CONNECTED_TEXTURES.tooltip.8=ressources utilisé. + +of.options.NATURAL_TEXTURES=Textures naturelles +of.options.NATURAL_TEXTURES.tooltip.1=Textures naturelles +of.options.NATURAL_TEXTURES.tooltip.2= Non - sans textures naturelles (par défaut) +of.options.NATURAL_TEXTURES.tooltip.3= Oui - avec textures naturelles +of.options.NATURAL_TEXTURES.tooltip.4=Les textures naturelles enlèvent le motif grillagé créé +of.options.NATURAL_TEXTURES.tooltip.5=par la répétition de blocs identiques, en utilisant des +of.options.NATURAL_TEXTURES.tooltip.6=variations pivotées et retournées de la texture du bloc. +of.options.NATURAL_TEXTURES.tooltip.7=La configuration pour les textures naturelles est fournie +of.options.NATURAL_TEXTURES.tooltip.8=par le pack de ressources utilisé. + +of.options.EMISSIVE_TEXTURES=Textures émissives +of.options.EMISSIVE_TEXTURES.tooltip.1=Textures émissives +of.options.EMISSIVE_TEXTURES.tooltip.2= Non - pas de textures émissives (par défaut) +of.options.EMISSIVE_TEXTURES.tooltip.3= Oui - utilise des textures émissives +of.options.EMISSIVE_TEXTURES.tooltip.4=Les textures émissives sont rendues en tant que surcouche +of.options.EMISSIVE_TEXTURES.tooltip.5=avec luminosité maximale. Elles peuvent être utilisées pour +of.options.EMISSIVE_TEXTURES.tooltip.6=simuler des parties lumineuses dans les textures de base. +of.options.EMISSIVE_TEXTURES.tooltip.7=Les textures émissives sont fournies par le pack de +of.options.EMISSIVE_TEXTURES.tooltip.8=ressources utilisé. + +of.options.CUSTOM_SKY=Ciel personnalisé +of.options.CUSTOM_SKY.tooltip.1=Ciel personnalisé +of.options.CUSTOM_SKY.tooltip.2= Oui - texture de ciel personnalisée (par défaut, lent) +of.options.CUSTOM_SKY.tooltip.3= Non - ciel par défaut (rapide) +of.options.CUSTOM_SKY.tooltip.4=Les textures de ciel personnalisé sont fournies par le +of.options.CUSTOM_SKY.tooltip.5=pack de ressources utilisé. + +of.options.CUSTOM_ITEMS=Objets personnalisés +of.options.CUSTOM_ITEMS.tooltip.1=Objets personnalisés +of.options.CUSTOM_ITEMS.tooltip.2= Oui - textures d'objets personnalisés (par défaut, lent) +of.options.CUSTOM_ITEMS.tooltip.3= Non - textures d'objets par défaut (rapide) +of.options.CUSTOM_ITEMS.tooltip.4=Les textures d'objets personnalisés sont fournis par +of.options.CUSTOM_ITEMS.tooltip.5=le pack de ressources utilisé. + +of.options.CUSTOM_ENTITY_MODELS=Modèles d'entités perso. +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modèles d'entités personnalisées +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Oui - modèles d'entités personnalisées (par défaut, lent) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Non - modèles d'entités par défaut (rapide) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Les modèles d'entités personnalisées sont fournis par le +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=pack de ressources utilisé. + +of.options.CUSTOM_GUIS=Interfaces personnalisées +of.options.CUSTOM_GUIS.tooltip.1=Interfaces personnalisées +of.options.CUSTOM_GUIS.tooltip.2= Oui - interfaces personnalisées (par défaut, lent) +of.options.CUSTOM_GUIS.tooltip.3= Non - interfaces par défaut (rapide) +of.options.CUSTOM_GUIS.tooltip.4=Les interfaces personnalisées sont fournies par le pack +of.options.CUSTOM_GUIS.tooltip.5=de ressources utilisé. + +# Details + +of.options.CLOUDS=Nuages +of.options.CLOUDS.tooltip.1=Nuages +of.options.CLOUDS.tooltip.2= Par défaut - comme dans les options graphiques +of.options.CLOUDS.tooltip.3= Rapides - basse qualité (rapide) +of.options.CLOUDS.tooltip.4= Détaillés - haute qualité (lent) +of.options.CLOUDS.tooltip.5= Non - sans nuages (plus rapide) +of.options.CLOUDS.tooltip.6=Les nuages rapides sont rendus en 2D. +of.options.CLOUDS.tooltip.7=Les nuages détaillés sont rendus en 3D. + +of.options.CLOUD_HEIGHT=Hauteur des nuages +of.options.CLOUD_HEIGHT.tooltip.1=Hauteur des nuages +of.options.CLOUD_HEIGHT.tooltip.2= Non - hauteur par défaut +of.options.CLOUD_HEIGHT.tooltip.3= 100 %% - au-dessus de la limite de hauteur du monde + +of.options.TREES=Arbres +of.options.TREES.tooltip.1=Arbres +of.options.TREES.tooltip.2= Par défaut - comme dans les options graphiques +of.options.TREES.tooltip.3= Rapides - basse qualité (plus rapide) +of.options.TREES.tooltip.4= Approfondis - haute qualité (rapide) +of.options.TREES.tooltip.5= Détaillés - très haute qualité (lent) +of.options.TREES.tooltip.6=Les arbres rapides ont des feuilles opaques. +of.options.TREES.tooltip.7=Les arbres approfondis et détaillés ont des feuilles +of.options.TREES.tooltip.8=transparentes. + +of.options.RAIN=Pluie & neige +of.options.RAIN.tooltip.1=Pluie & neige +of.options.RAIN.tooltip.2= Par défaut - comme dans les options graphiques +of.options.RAIN.tooltip.3= Rapide - légère pluie/neige (rapide) +of.options.RAIN.tooltip.4= Détaillé - grosse pluie/neige (lent) +of.options.RAIN.tooltip.5= Non - sans pluie/neige (plus rapide) +of.options.RAIN.tooltip.6=Même si la pluie & la neige sont désactivées, les +of.options.RAIN.tooltip.7=éclaboussures et le son sont toujours présents. + +of.options.SKY=Ciel +of.options.SKY.tooltip.1=Ciel +of.options.SKY.tooltip.2= Oui - le ciel est visible (lent) +of.options.SKY.tooltip.3= Non - le ciel n'est pas visible (rapide) +of.options.SKY.tooltip.4=Quand le ciel est désactivé, le soleil et la lune sont +of.options.SKY.tooltip.5=toujours visibles. + +of.options.STARS=Étoiles +of.options.STARS.tooltip.1=Étoiles +of.options.STARS.tooltip.2= Oui - les étoiles sont visibles (lent) +of.options.STARS.tooltip.3= Non - les étoiles ne sont pas visibles (rapide) + +of.options.SUN_MOON=Soleil & Lune +of.options.SUN_MOON.tooltip.1=Soleil & Lune +of.options.SUN_MOON.tooltip.2= Oui - le Soleil et la Lune sont visibles (par défaut) +of.options.SUN_MOON.tooltip.3= Non - le Soleil et la Lune ne sont pas visibles (rapide) + +of.options.SHOW_CAPES=Capes visibles +of.options.SHOW_CAPES.tooltip.1=Capes visibles +of.options.SHOW_CAPES.tooltip.2= Oui - voir la cape des joueurs (par défaut) +of.options.SHOW_CAPES.tooltip.3= Non - ne pas voir la cape des joueurs + +of.options.TRANSLUCENT_BLOCKS=Blocs translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocs translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Par défaut - comme défini par l'option Graphismes +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Détaillés - mélange correct des couleurs (lent) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Rapides - mélange rapide des couleurs (rapide) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Contrôle le mélange des couleurs des blocs translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.6=avec différentes couleurs (verre teinté, eau, glace) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=lorsque placé un à côté de l'autre avec de l'air entre eux. + +of.options.HELD_ITEM_TOOLTIPS=Infobulles d'objets +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Infobulles d'objets +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Oui - affiche des infos sur l'objet en main (par défaut) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Non - n'affiche pas d'info sur l'objet en main + +of.options.ADVANCED_TOOLTIPS=Infobulles avancées +of.options.ADVANCED_TOOLTIPS.tooltip.1=Infobulles avancées +of.options.ADVANCED_TOOLTIPS.tooltip.2= Oui - affiche les infobulles avancées +of.options.ADVANCED_TOOLTIPS.tooltip.3= Non - n'affiche pas les infobulles avancées (par défaut) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Les infobulles avancées affiche des informations détaillées +of.options.ADVANCED_TOOLTIPS.tooltip.5=sur l'objet (ID, durabilité) et les options des shaders +of.options.ADVANCED_TOOLTIPS.tooltip.6=(ID, source, valeur par défaut). + +of.options.DROPPED_ITEMS=Objets lâchés +of.options.DROPPED_ITEMS.tooltip.1=Objets lâchés +of.options.DROPPED_ITEMS.tooltip.2= Par défaut - comme dans les options graphiques +of.options.DROPPED_ITEMS.tooltip.3= Rapides - objets 2D (rapide) +of.options.DROPPED_ITEMS.tooltip.4= Détaillés - objets 3D (lent) + +options.entityShadows.tooltip.1=Ombres des entités +options.entityShadows.tooltip.2= Oui - affiche l'ombre des entités +options.entityShadows.tooltip.3= Non - n'affiche pas l'ombre des entités + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Effet visuel qui assombrit les coins de l'écran +of.options.VIGNETTE.tooltip.2= Par défaut - comme dans les options graphiques +of.options.VIGNETTE.tooltip.3= Rapides - vignette désactivée (rapide) +of.options.VIGNETTE.tooltip.4= Détaillés - vignette activée (lent) +of.options.VIGNETTE.tooltip.5=La vignette peut avoir un effet significatif sur les FPS, +of.options.VIGNETTE.tooltip.6=notamment lorsque le jeu est en plein écran. +of.options.VIGNETTE.tooltip.7=L'effet de vignette est très subtil et peut être désactivé +of.options.VIGNETTE.tooltip.8=en toute sécurité. + +of.options.DYNAMIC_FOV=Champ visuel dynamique +of.options.DYNAMIC_FOV.tooltip.1=Champ de vision dynamique +of.options.DYNAMIC_FOV.tooltip.2= Oui - activer le champ de vision dynamique (par défaut) +of.options.DYNAMIC_FOV.tooltip.3= Non - désactiver le champ de vision dynamique +of.options.DYNAMIC_FOV.tooltip.4=Change le champ de vision lors du vol, du sprint, de la +of.options.DYNAMIC_FOV.tooltip.5=nage et du bandage d'un arc. + +of.options.DYNAMIC_LIGHTS=Lumières dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.1=Lumières dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.2= Non - aucune lumière dynamique (par défaut) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapides - lumières dynamiques rafraîchies tous les 500 ms +of.options.DYNAMIC_LIGHTS.tooltip.4= Détaillés - Lumières dynamiques rafraîchies en temps réel +of.options.DYNAMIC_LIGHTS.tooltip.5=Permet aux objets émetteurs de lumière (torche, pierre +of.options.DYNAMIC_LIGHTS.tooltip.6=lumineuse, etc.) d'illuminer tout autour du joueur quand +of.options.DYNAMIC_LIGHTS.tooltip.7=l'objet est en main, équipé par d'autres joueurs ou jeté +of.options.DYNAMIC_LIGHTS.tooltip.8=au sol. + +options.biomeBlendRadius.tooltip.1=Adoucit la transition de couleur entre les biomes +options.biomeBlendRadius.tooltip.2= Non - pas de transition (rapide) +options.biomeBlendRadius.tooltip.3= 5x5 - transition normale (par défaut) +options.biomeBlendRadius.tooltip.4= 15x15 - transition maximale (lent) +options.biomeBlendRadius.tooltip.5=Des valeurs hautes peuvent causer d'importants pics de lag +options.biomeBlendRadius.tooltip.6=et ralentir la vitesse de chargement des tronçons. + +# Performance + +of.options.SMOOTH_FPS=FPS atténué +of.options.SMOOTH_FPS.tooltip.1=Stabilise les FPS en supprimant les tampons de trame. +of.options.SMOOTH_FPS.tooltip.2= Non - aucune stabilisation, les FPS peuvent varier +of.options.SMOOTH_FPS.tooltip.3= Oui - stabilisation des FPS +of.options.SMOOTH_FPS.tooltip.4=Cette option dépend du pilote graphique, les effets ne +of.options.SMOOTH_FPS.tooltip.5=sont pas toujours visibles. + +of.options.SMOOTH_WORLD=Monde atténué +of.options.SMOOTH_WORLD.tooltip.1=Élimine les pics de lag causés par le serveur interne. +of.options.SMOOTH_WORLD.tooltip.2= Non - aucune stabilisation, les FPS peuvent varier +of.options.SMOOTH_WORLD.tooltip.3= Oui - stabilisation des FPS +of.options.SMOOTH_WORLD.tooltip.4=Stabilise les FPS en distribuant les charges du serveur +of.options.SMOOTH_WORLD.tooltip.5=interne. Fonctionne uniquement en local (monde solo). + +of.options.FAST_RENDER=Rendu rapide +of.options.FAST_RENDER.tooltip.1=Rendu rapide +of.options.FAST_RENDER.tooltip.2= Non - rendu standard (par défaut) +of.options.FAST_RENDER.tooltip.3= Oui - rendu optimisé (rapide) +of.options.FAST_RENDER.tooltip.4=Utilise des algorithmes de rendu optimisé pour diminuer la +of.options.FAST_RENDER.tooltip.5=charge du processeur graphique, ce qui peut augmenter les +of.options.FAST_RENDER.tooltip.6=FPS. +of.options.FAST_RENDER.tooltip.7=Cette option peut entrer en conflit avec certains mods. + +of.options.FAST_MATH=Calculs rapides +of.options.FAST_MATH.tooltip.1=Calculs rapides +of.options.FAST_MATH.tooltip.2= Non - calculs standards (par défaut) +of.options.FAST_MATH.tooltip.3= Oui - calculs optimisés +of.options.FAST_MATH.tooltip.4=Utilise des fonctions optimisées de sin() et cos() qui +of.options.FAST_MATH.tooltip.5=peuvent mieux utiliser le cache du processeur et augmenter +of.options.FAST_MATH.tooltip.6=les FPS. +of.options.FAST_MATH.tooltip.7=Cette option peut avoir un léger impact sur la génération +of.options.FAST_MATH.tooltip.8=du monde. + +of.options.CHUNK_UPDATES=Mises à jour des tronçons +of.options.CHUNK_UPDATES.tooltip.1=Mise à jour des tronçons +of.options.CHUNK_UPDATES.tooltip.2= 1 - chargement lent du monde, meilleur FPS (par défaut) +of.options.CHUNK_UPDATES.tooltip.3= 3 - chargement rapide du monde, bas FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - chargement très rapide du monde, très bas FPS +of.options.CHUNK_UPDATES.tooltip.5=Nombre de mises à jour de tronçons par image rendue +of.options.CHUNK_UPDATES.tooltip.6=(tick), les valeurs élevées peuvent déstabiliser les FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Mises à jour dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Mises à jours dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Non - nombre de mises à jour stantard (par défaut) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Oui - plus de mises à jour lorsque le joueur est inactif +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Les mises à jour dynamiques forcent plus de tronçons à +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=se mettre à jour quand le joueur est inactif, pour +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=charger le monde plus vite. + +of.options.LAZY_CHUNK_LOADING=Charg. de tronçons lent +of.options.LAZY_CHUNK_LOADING.tooltip.1=Chargement lent des tronçons +of.options.LAZY_CHUNK_LOADING.tooltip.2= Non - chargement des tronçons serveurs par défaut +of.options.LAZY_CHUNK_LOADING.tooltip.3= Oui - chargement lent des tronçons serveur (plus doux) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Adoucit le chargement des tronçons serveurs intégrés +of.options.LAZY_CHUNK_LOADING.tooltip.5=en distribuant les tronçons sur plusieurs ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Désactivez-le si des parties du monde ne se chargent +of.options.LAZY_CHUNK_LOADING.tooltip.7=pas correctement. Fonctionne uniquement en local (solo). + +of.options.RENDER_REGIONS=Rendu des régions +of.options.RENDER_REGIONS.tooltip.1=Rendu des régions +of.options.RENDER_REGIONS.tooltip.2= Non - rendu standard (par défaut) +of.options.RENDER_REGIONS.tooltip.3= Oui - rendu des régions +of.options.RENDER_REGIONS.tooltip.4=Permet un rendu du terrain plus rapide à des distances +of.options.RENDER_REGIONS.tooltip.5=d'affichage plus élevées. Plus efficace lorsque les VBOs +of.options.RENDER_REGIONS.tooltip.6=sont activés. Non recommandé pour les cartes graphiques +of.options.RENDER_REGIONS.tooltip.7=intégrées. + +of.options.SMART_ANIMATIONS=Animations intelligentes +of.options.SMART_ANIMATIONS.tooltip.1=Animations intelligentes +of.options.SMART_ANIMATIONS.tooltip.2= Non - animations standards (par défaut) +of.options.SMART_ANIMATIONS.tooltip.3= Oui - animations intelligentes +of.options.SMART_ANIMATIONS.tooltip.4=Permet au jeu d'animer uniquement les textures +of.options.SMART_ANIMATIONS.tooltip.5=actuellement visibles à l'écran. Cela réduit les pics +of.options.SMART_ANIMATIONS.tooltip.6=de lag et augmente les FPS. Surtout utile pour les gros +of.options.SMART_ANIMATIONS.tooltip.7=packs de mods et les packs de ressources HD. + +# Animations + +of.options.animation.allOn=Activer tous +of.options.animation.allOff=Désactiver tous +of.options.animation.dynamic=Dynamique + +of.options.ANIMATED_WATER=Animation de l'eau +of.options.ANIMATED_LAVA=Animation de la lave +of.options.ANIMATED_FIRE=Animation du feu +of.options.ANIMATED_PORTAL=Animation des portails +of.options.ANIMATED_REDSTONE=Animation de la redstone +of.options.ANIMATED_EXPLOSION=Animation des explosions +of.options.ANIMATED_FLAME=Animation des flammes +of.options.ANIMATED_SMOKE=Animation de fumées +of.options.VOID_PARTICLES=Particules de vide +of.options.WATER_PARTICLES=Particules d'eau +of.options.RAIN_SPLASH=Particules de pluie +of.options.PORTAL_PARTICLES=Particules de portail +of.options.POTION_PARTICLES=Particules de potion +of.options.DRIPPING_WATER_LAVA=Gouttes d'eau/lave +of.options.ANIMATED_TERRAIN=Animation du terrain +of.options.ANIMATED_TEXTURES=Animation des textures +of.options.FIREWORK_PARTICLES=Partic. de feux d'artifice + +# Other + +of.options.LAGOMETER=Lagomètre +of.options.LAGOMETER.tooltip.1=Affiche le lagomètre sur l'écran de débogage (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Récupérateur de mémoire +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Bleu - Exécutables programmés +of.options.LAGOMETER.tooltip.5=* Violet - Téléchargement de tronçons +of.options.LAGOMETER.tooltip.6=* Rouge - Mises à jour de tronçon +of.options.LAGOMETER.tooltip.7=* Jaune - Contrôle de visibilité +of.options.LAGOMETER.tooltip.8=* Vert - Terrain rendu + +of.options.PROFILER=Profileur de débogage +of.options.PROFILER.tooltip.1=Profileur de débogage +of.options.PROFILER.tooltip.2= Oui - profileur actif (lent) +of.options.PROFILER.tooltip.3= Non - profileur non actif (rapide) +of.options.PROFILER.tooltip.4=Le profileur de débogage collecte et affiche des +of.options.PROFILER.tooltip.5=informations de débogage lorsque l'écran de débogage +of.options.PROFILER.tooltip.6=(F3) est ouvert. + +of.options.WEATHER=Météo +of.options.WEATHER.tooltip.1=Météo +of.options.WEATHER.tooltip.2= Oui - Météo active (lent) +of.options.WEATHER.tooltip.3= Non - Météo non active (rapide) +of.options.WEATHER.tooltip.4=La météo contrôle la pluie, la neige et l'orage. +of.options.WEATHER.tooltip.5=Le contrôle de la météo n'est possible qu'en local. + +of.options.time.dayOnly=Jour seulement +of.options.time.nightOnly=Nuit seulement + +of.options.TIME=Temps +of.options.TIME.tooltip.1=Temps +of.options.TIME.tooltip.2= Par défaut - cycle jour/nuit normal +of.options.TIME.tooltip.3= Jour seulement - jour continu +of.options.TIME.tooltip.4= Nuit seulement - nuit continue +of.options.TIME.tooltip.5=La sélection du temps n'est possible qu'en MODE CRÉATIF +of.options.TIME.tooltip.6=dans un monde local. + +options.fullscreen.tooltip.1=Plein écran +options.fullscreen.tooltip.2= Oui - jeu en plein écran +options.fullscreen.tooltip.3= Non - jeu en mode fenêtré +options.fullscreen.tooltip.4=Le mode plein écran peut être plus rapide ou plus lent +options.fullscreen.tooltip.5=que le mode fenêtré selon la carte graphique. + +options.fullscreen.resolution=Mode plein écran +options.fullscreen.resolution.tooltip.1=Mode plein écran +options.fullscreen.resolution.tooltip.2= Par défaut - utilise la résolution du moniteur (lent) +options.fullscreen.resolution.tooltip.3= LxH - utilise une résolution personnalisée (parfois rapide) +options.fullscreen.resolution.tooltip.4=La résolution sélectionnée est utilisée en mode plein écran (F11). +options.fullscreen.resolution.tooltip.5=Une résolution plus basse devrait être plus rapide. + +of.options.SHOW_FPS=Afficher les FPS +of.options.SHOW_FPS.tooltip.1=Affiche les FPS et informations de rendu. +of.options.SHOW_FPS.tooltip.2= FPS - moyenne/minimum +of.options.SHOW_FPS.tooltip.3= C: - tronçons rendus +of.options.SHOW_FPS.tooltip.4= E: - entités et entités de blocs rendues +of.options.SHOW_FPS.tooltip.5= U: - mises à jour de tronçon +of.options.SHOW_FPS.tooltip.6=Les informations sont présentées dans le coin supérieur +of.options.SHOW_FPS.tooltip.7=gauche lorsque l'écran de débogage n'est pas visible. + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3min +of.options.save.6min=6min +of.options.save.12min=12min +of.options.save.24min=24min + +of.options.AUTOSAVE_TICKS=Sauvegarde auto. +of.options.AUTOSAVE_TICKS.tooltip.1=Intervalle entre les sauvegardes automatiques +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - par défaut +of.options.AUTOSAVE_TICKS.tooltip.3=Les sauvegardes automatiques peuvent causer des pics +of.options.AUTOSAVE_TICKS.tooltip.4=de lag en fonction de la distance d'affichage. Le monde est +of.options.AUTOSAVE_TICKS.tooltip.5=aussi sauvegardé lorsque le menu du jeu est ouvert. + +of.options.SCREENSHOT_SIZE=Captures d'écran +of.options.SCREENSHOT_SIZE.tooltip.1=Taille des captures d'écran +of.options.SCREENSHOT_SIZE.tooltip.2= Par défaut - taille de la fenêtre +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - taille personnalisée +of.options.SCREENSHOT_SIZE.tooltip.4=Prendre une capture d'écran plus grande peut +of.options.SCREENSHOT_SIZE.tooltip.5=nécessiter plus de mémoire. +of.options.SCREENSHOT_SIZE.tooltip.6=Incompatible avec le rendu rapide et l'anticrénelage. +of.options.SCREENSHOT_SIZE.tooltip.7=Nécessite un processeur graphique avec un tampon de trame. + +of.options.SHOW_GL_ERRORS=Afficher les erreurs GL +of.options.SHOW_GL_ERRORS.tooltip.1=Afficher les erreurs OpenGL +of.options.SHOW_GL_ERRORS.tooltip.2=Les erreurs OpenGL sont affichées dans le tchat lorsque +of.options.SHOW_GL_ERRORS.tooltip.3=cette option est activée. Ne la désactiver que s'il y a un +of.options.SHOW_GL_ERRORS.tooltip.4=conflit inconnu et que les erreurs ne peuvent être +of.options.SHOW_GL_ERRORS.tooltip.5=corrigées. Les erreurs sont toujours journalisées lorsque +of.options.SHOW_GL_ERRORS.tooltip.6=cette option est désactivée et peuvent toujours causer +of.options.SHOW_GL_ERRORS.tooltip.7=une chute importante de FPS. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Fond du tchat +of.options.CHAT_BACKGROUND.tooltip.1=Fond du tchat +of.options.CHAT_BACKGROUND.tooltip.2= Par défaut - largeur fixe +of.options.CHAT_BACKGROUND.tooltip.3= Compact - s'adapte à la largeur des lignes +of.options.CHAT_BACKGROUND.tooltip.4= Non - masqué + +of.options.CHAT_SHADOW=Ombre du tchat +of.options.CHAT_SHADOW.tooltip.1=Ombre du tchat +of.options.CHAT_SHADOW.tooltip.2= Oui - ombre du tchat (par défaut) +of.options.CHAT_SHADOW.tooltip.3= Non - pas d'ombre du tchat diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/hu_HU.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/hu_HU.lang new file mode 100644 index 0000000..ee5fadf --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/hu_HU.lang @@ -0,0 +1,560 @@ +# General +of.general.ambiguous=zavaros +of.general.custom=Egyéni +of.general.from=-ból +of.general.id=Id +of.general.restart=újraindítás +of.general.smart=Okos + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Az Élsimítás nem kompatibilis a shaderekkel. +of.message.aa.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.af.shaders1=Az Anizotróp Szűrés nem kompatibilis a shaderekkel. +of.message.af.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.fr.shaders1=A Gyors Renderelés nem kompatibilis a shaderekkel. +of.message.fr.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.an.shaders1=A Sztereoszkopikus 3D nem kompatibilis a shaderekkel. +of.message.an.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.shaders.aa1=A shaderek nem kompatibilisek az Élsimítással. +of.message.shaders.aa2=Kérlek kapcsold Minőség -> Élsimítás-t ki és indísd újra a játékot. + +of.message.shaders.af1=A shaderek nem kompatibilisek az Anizotróp Szűréssel. +of.message.shaders.af2=Kérlek kapcsold Minőség -> Anizotróp Szűrés-t ki. + +of.message.shaders.fr1=A shaderek nem kompatibilisek a Gyors Rendereléssel. +of.message.shaders.fr2=Kérlek kapcsold Teljesítmény -> Gyors Renderelés-t ki. + +of.message.shaders.an1=A shaderek nem kompatibilisek a sztereoszkopikus 3D-vel. +of.message.shaders.an2=Kérlek kapcsold Egyéb -> Sztereoszkopikus 3D-t ki. + +of.message.newVersion=Egy új §eOptiFine§f verzió elérhető: §e%s§f +of.message.java64Bit=Tudsz telepíteni §e64-bit Java§f -t a teljesítmény növeléséhez. +of.message.openglError=§eOpenGL Error§f: %s (%s) + +of.message.shaders.loading=Shader betöltése: %s + +of.message.other.reset=Törli az összes videóbeállítást az alapértelmezett értékekre? + +# Video settings + +options.graphics.tooltip.1=Vizuális minőség +options.graphics.tooltip.2= Gyors - alacsonyabb minőség, gyorsabb +options.graphics.tooltip.3= Szép - magasabb minőség, lassabb +options.graphics.tooltip.4=Megváltoztatja a megjelenését a felhőknek, leveleknek, víznek, +options.graphics.tooltip.5=árnyékoknak és a fű oldalainak. + +of.options.renderDistance.tiny=Apró +of.options.renderDistance.short=Rövid +of.options.renderDistance.normal=Normál +of.options.renderDistance.far=Messzi +of.options.renderDistance.extreme=Extrém + +options.renderDistance.tooltip.1=Látótávolság +options.renderDistance.tooltip.2= 2 Apró - 32m (leggyorsabb) +options.renderDistance.tooltip.3= 4 Rövid - 64m (gyorsabb) +options.renderDistance.tooltip.4= 8 Normál - 128m +options.renderDistance.tooltip.5= 16 Messzi - 256m (lassabb) +options.renderDistance.tooltip.6= 32 Extrém - 512m (leglassab!) +options.renderDistance.tooltip.7=Az Extrém látótávolság nagyon erőforrás igényes! +options.renderDistance.tooltip.8=Értékek 16 Messzi fölött csak helyi világokban effektív. + +options.ao.tooltip.1=Simított megvilágítás +options.ao.tooltip.2= KI - Nincs simított megvilágítás (gyorsabb) +options.ao.tooltip.3= Minimum - Egyszerű simított megvilágítás (lassabb) +options.ao.tooltip.4= Maximum - Bonyolult simított megvilágítás (leglassab) + +options.framerateLimit.tooltip.1=Maximum FPS +options.framerateLimit.tooltip.2= VSync - A monitor képkocka frissítéséhez szabott (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - változó +options.framerateLimit.tooltip.4= Korlátlan - nincs határ (leggyorsabb) +options.framerateLimit.tooltip.5=Az FPS korlátozás csökkenti az FPS-t akkor is, ha +options.framerateLimit.tooltip.6=a korlát érték nincs elérve. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Simított Megvilágítás Szintje +of.options.AO_LEVEL.tooltip.1=Simított megvilágítás szintje +of.options.AO_LEVEL.tooltip.2= KI - nincsenek árnyékok +of.options.AO_LEVEL.tooltip.3= 50%% - halvány árnyékok +of.options.AO_LEVEL.tooltip.4= 100%% - sötét árnyékok + +options.viewBobbing.tooltip.1=Valósághűbb mozgás. +options.viewBobbing.tooltip.2=Amikor MIP-leképzést használsz, kapcsold ki a legjobb eredményekért. + +options.guiScale.tooltip.1=GUI Mérete +options.guiScale.tooltip.2=Kisebb GUI gyorsabb lehet. + +options.vbo=VBO-k használata +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Egy alternatív renderelési mintát használ, ami általában +options.vbo.tooltip.3=gyorsabb (5-10%%) az alapértelmezett renderelésnél. + +options.gamma.tooltip.1=A sötétebb objektumok fényerejét változtatja +options.gamma.tooltip.2= Borongós - normál fényerő +options.gamma.tooltip.3= 1-99%% - változó +options.gamma.tooltip.4= Fényes - maximum fényerő a sötétebb objektumoknak +options.gamma.tooltip.5=Ez a beállítás nem változtatja a fényerejét a +options.gamma.tooltip.6=teljesen fekete objektumoknak. + +options.anaglyph.tooltip.1=Sztereoszkopikus 3D +options.anaglyph.tooltip.2=Bekapcsolja a sztereoszopikus 3D effektet különböző színek használatával +options.anaglyph.tooltip.3=szemenként. +options.anaglyph.tooltip.4=Vörös-cián szemüveget igényel a megfelelő látásért. + +of.options.ALTERNATE_BLOCKS=Váltakozó Blokkok +of.options.ALTERNATE_BLOCKS.tooltip.1=Váltakozó Blokkok +of.options.ALTERNATE_BLOCKS.tooltip.2=Alernatív blokk mintákat használ egyes blokkokhoz. +of.options.ALTERNATE_BLOCKS.tooltip.3=A kiválasztott forráscsomagtól függ. + +of.options.FOG_FANCY=Köd +of.options.FOG_FANCY.tooltip.1=Köd típusa +of.options.FOG_FANCY.tooltip.2= Gyors - gyorsabb köd +of.options.FOG_FANCY.tooltip.3= Szép - lassabb köd, jobban mutat +of.options.FOG_FANCY.tooltip.4= KI - nincs köd, leggyorsabb +of.options.FOG_FANCY.tooltip.5=A szép köd csak akkor elérhető, ha támogatja a +of.options.FOG_FANCY.tooltip.6=videókártya. + +of.options.FOG_START=Köd Kezdete +of.options.FOG_START.tooltip.1=Köd kezdete +of.options.FOG_START.tooltip.2= 0.2 - a köd a játékostól közel kezdődik +of.options.FOG_START.tooltip.3= 0.8 - a köd a játékostól messze kezdődik +of.options.FOG_START.tooltip.4=Ez a beállítás általában nem gyakorol hatást a teljesítményre. + +of.options.CHUNK_LOADING=Terület Betöltése +of.options.CHUNK_LOADING.tooltip.1=Terület Betöltése +of.options.CHUNK_LOADING.tooltip.2= Alapértelmezett - instabil FPS területek betöltésekor +of.options.CHUNK_LOADING.tooltip.3= Lágy - stabil FPS +of.options.CHUNK_LOADING.tooltip.4= Kétmagos - stabil FPS, 3x gyorsabb világbetöltés +of.options.CHUNK_LOADING.tooltip.5=A Lágy és Kétmagos eltávolítja az akadozásokat, és +of.options.CHUNK_LOADING.tooltip.6=a befagyásokat, amit a területbetöltés okoz. +of.options.CHUNK_LOADING.tooltip.7=A Kétmagos fel tudja gyorsítani a világbetöltést a 3x-osára, és +of.options.CHUNK_LOADING.tooltip.8=képes az FPS növelésére a 2. processzormag használatával. +of.options.chunkLoading.smooth=Lágy +of.options.chunkLoading.multiCore=Kétmagos + +of.options.shaders=Shaderek... +of.options.shadersTitle=Árnyékok és egyéb finomságok + +of.options.shaders.packNone=KI +of.options.shaders.packDefault=(belső) + +of.options.shaders.ANTIALIASING=Élsimítás +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.RENDER_RES_MUL=Render Minőség +of.options.shaders.SHADOW_RES_MUL=Árnyék Minőség +of.options.shaders.HAND_DEPTH_MUL=Kézmélység +of.options.shaders.CLOUD_SHADOW=Felhőárnyék +of.options.shaders.OLD_HAND_LIGHT=Régi Kézmegvilágítás +of.options.shaders.OLD_LIGHTING=Régi Megvilágítás +of.options.shaders.SHADER_PACK=Shader Csomag + +of.options.shaders.shadersFolder=Shaderek mappája +of.options.shaders.shaderOptions=Shader Beállítások... + +of.options.shaderOptionsTitle=Shader Beállítások + +of.options.quality=Minőség... +of.options.qualityTitle=Minőségi Beállítások + +of.options.details=Részletek... +of.options.detailsTitle=Részletbeállítások + +of.options.performance=Teljesítmény... +of.options.performanceTitle=Teljesítmény Beállítások + +of.options.animations=Animációk... +of.options.animationsTitle=Animáció Beállítások + +of.options.other=Egyéb... +of.options.otherTitle=Egyéb Beállítások + +of.options.other.reset=Videóbeállítások Törlése... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilineáris +of.options.mipmap.linear=Lineáris +of.options.mipmap.nearest=Legközelebbi +of.options.mipmap.trilinear=Trilineáris + +options.mipmapLevels.tooltip.1=Vizuális effekt, ami a távolabbi dolgokat szebbé teszi +options.mipmapLevels.tooltip.2=a textúrák részletességének simításával. +options.mipmapLevels.tooltip.3= KI - nincs simítás +options.mipmapLevels.tooltip.4= 1 - minimum simítás +options.mipmapLevels.tooltip.5= 4 - maximum simítás +options.mipmapLevels.tooltip.6=Ez a beállítás általában nem gyakorol hatást a teljesítményre. + +of.options.MIPMAP_TYPE=MIP-leképzés típusa +of.options.MIPMAP_TYPE.tooltip.1=Vizuális effekt, ami a távolabbi dolgokat szebbé teszi +of.options.MIPMAP_TYPE.tooltip.2=a textúrák részletességének simításával. +of.options.MIPMAP_TYPE.tooltip.3= Legközelebbi - durva simítás (leggyorsabb) +of.options.MIPMAP_TYPE.tooltip.4= Lineáris - normál simítás +of.options.MIPMAP_TYPE.tooltip.5= Bilineáris - finom simítás +of.options.MIPMAP_TYPE.tooltip.6= Trilineáris - legfinomabb simítás (leglassabb) + + +of.options.AA_LEVEL=Élsimítás +of.options.AA_LEVEL.tooltip.1=Élsimítás +of.options.AA_LEVEL.tooltip.2= KI - (alapértelmezett) nincs élsimítás (gyorsabb) +of.options.AA_LEVEL.tooltip.3= 2-16 - élsimított vonalak és élek (lassabb) +of.options.AA_LEVEL.tooltip.4=Az Élsimítás kisimítja az egyenletlen vonalakat, és +of.options.AA_LEVEL.tooltip.5=az éles színátmeneteket. +of.options.AA_LEVEL.tooltip.6=Bekapcsolás esetén lényegesen csökkentheti az FPS-t. +of.options.AA_LEVEL.tooltip.7=Nem minden szint támogatott egyes videókártyákon. +of.options.AA_LEVEL.tooltip.8=ÚJRAINDÍTÁS után effektív! + +of.options.AF_LEVEL=Aniszotróp Szűrés +of.options.AF_LEVEL.tooltip.1=Anizotróp Szűrés +of.options.AF_LEVEL.tooltip.2= KI - (alapértelmezett) alap textúra részletesség (gyorsabb) +of.options.AF_LEVEL.tooltip.3= 2-16 - finomabb részletek a MIP-leképzett textúrákon (lassabb) +of.options.AF_LEVEL.tooltip.4=Az Anizotróp Szűrés helyreállítja a részleteket a +of.options.AF_LEVEL.tooltip.5=MIP-leképzett textúrákon. +of.options.AF_LEVEL.tooltip.6=Bekapcsolás esetén lényegesen csökkentheti az FPS-t. + +of.options.CLEAR_WATER=Tiszta Víz +of.options.CLEAR_WATER.tooltip.1=Tiszta Víz +of.options.CLEAR_WATER.tooltip.2= BE - tiszta, átlátszó víz +of.options.CLEAR_WATER.tooltip.3= KI - alapértelmezett víz + +of.options.RANDOM_ENTITIES=Véletlenszerű Mobok +of.options.RANDOM_ENTITIES.tooltip.1=Véletlenszerű Mobok +of.options.RANDOM_ENTITIES.tooltip.2= KI - nincsenek véletlenszerű mobok, gyorsabb +of.options.RANDOM_ENTITIES.tooltip.3= BE - véletlenszerű mobok, lassabb +of.options.RANDOM_ENTITIES.tooltip.4=A véletlenszerű mobok véletlenszerű textúrákat használ a játék lényeinek. +of.options.RANDOM_ENTITIES.tooltip.5=Olyan erőforráscsomagot igényel, amiben vannak dupla mob textúrák . + +of.options.BETTER_GRASS=Jobb Fű +of.options.BETTER_GRASS.tooltip.1=Jobb Fű +of.options.BETTER_GRASS.tooltip.2= KI - alapértelmezett fű oldaltextúra, leggyorsabb +of.options.BETTER_GRASS.tooltip.3= Gyors - teljes fű oldaltextúra, lassabb +of.options.BETTER_GRASS.tooltip.4= Szép - dinamikus fű oldaltextúra, leglassabb + +of.options.BETTER_SNOW=Jobb Hó +of.options.BETTER_SNOW.tooltip.1=Jobb Hó +of.options.BETTER_SNOW.tooltip.2= KI - alapértelmezett hó, gyorsabb +of.options.BETTER_SNOW.tooltip.3= BE - jobb hó, lassabb +of.options.BETTER_SNOW.tooltip.4=Mutatja a havat az átlátszó blokkok alatt (kerítés, magas fú), +of.options.BETTER_SNOW.tooltip.5=amikor hóval van körülvéve. + +of.options.CUSTOM_FONTS=Egyéni Betűtípus +of.options.CUSTOM_FONTS.tooltip.1=Egyéni Betűtípus +of.options.CUSTOM_FONTS.tooltip.2= BE - egyéni betűtípust használ (alapértelmezett), lassabb +of.options.CUSTOM_FONTS.tooltip.3= KI - alapértelmezett betűtípust használ, gyorsabb +of.options.CUSTOM_FONTS.tooltip.4=Az egyéni betűtípust a jelenlegi forráscsomag +of.options.CUSTOM_FONTS.tooltip.5=biztosítja. + +of.options.CUSTOM_COLORS=Egyéni Színek +of.options.CUSTOM_COLORS.tooltip.1=Egyéni Színek +of.options.CUSTOM_COLORS.tooltip.2= BE - egyéni színeket használ (default), lassabb +of.options.CUSTOM_COLORS.tooltip.3= KI - alapértelmezett színeket használ, gyorsabb +of.options.CUSTOM_COLORS.tooltip.4=Az egyéni színeket a jelenlegi forráscsomag +of.options.CUSTOM_COLORS.tooltip.5=biztosítja. + +of.options.SWAMP_COLORS=Mocsár Színek +of.options.SWAMP_COLORS.tooltip.1=Mocsár Színek +of.options.SWAMP_COLORS.tooltip.2= BE - mocsárszíneket használ (alapértelmezett), lassabb +of.options.SWAMP_COLORS.tooltip.3= KI - nem használ mocsárszíneket, gyorsabb +of.options.SWAMP_COLORS.tooltip.4=A mocsár színek a füvet, leveleket, indákat és a vizet érintik. + +of.options.SMOOTH_BIOMES=Simított Biomok +of.options.SMOOTH_BIOMES.tooltip.1=Simított Biomok +of.options.SMOOTH_BIOMES.tooltip.2= BE - a biome szélek simítása (default), lassabb +of.options.SMOOTH_BIOMES.tooltip.3= KI - nincs simítás a biomok szélénél, gyorsabb +of.options.SMOOTH_BIOMES.tooltip.4=A simítás a biomok szélénél mintavétellel, és +of.options.SMOOTH_BIOMES.tooltip.5=a színek átlagosításával történik a környező blokkokon. +of.options.SMOOTH_BIOMES.tooltip.6=Érintettek: fű, levelek, indák és a víz. + +of.options.CONNECTED_TEXTURES=Csatlakozó Textúrák +of.options.CONNECTED_TEXTURES.tooltip.1=Csatlakozó Textúrák +of.options.CONNECTED_TEXTURES.tooltip.2= KI - nincsenek csatlakozó textúrák (alapértelmezett) +of.options.CONNECTED_TEXTURES.tooltip.3= Gyors - gyors csatlakozó textúrák +of.options.CONNECTED_TEXTURES.tooltip.4= Szép - szép csatlakozó textúrák +of.options.CONNECTED_TEXTURES.tooltip.5=A csatlakozó textúrák egybeköti az üveget, +of.options.CONNECTED_TEXTURES.tooltip.6=homokkövet és a könyvespolcokat, ha egymás mellet +of.options.CONNECTED_TEXTURES.tooltip.7=vannak. Acsatlakozó textúrákat a jelenlegi +of.options.CONNECTED_TEXTURES.tooltip.8=forráscsomag biztosítja. + +of.options.NATURAL_TEXTURES=Természetes Textúrák +of.options.NATURAL_TEXTURES.tooltip.1=Természetes Textúrák +of.options.NATURAL_TEXTURES.tooltip.2= KI - nincsenek természetes textúrák (alapértelmezett) +of.options.NATURAL_TEXTURES.tooltip.3= BE - természetes textúrákat használ +of.options.NATURAL_TEXTURES.tooltip.4=A természetes textúrák eltüntetik a rácsszerű mintázatot, +of.options.NATURAL_TEXTURES.tooltip.5=amit az azonos típusú irmétlődő blokkok okoznak. +of.options.NATURAL_TEXTURES.tooltip.6=A blokkok alaptextúráinak forgatott változatát +of.options.NATURAL_TEXTURES.tooltip.7=használja. A konfigurációját a természetes textúráknak +of.options.NATURAL_TEXTURES.tooltip.8=a jelenlegi forráscsomag biztosítja. + +of.options.CUSTOM_SKY=Egyéni Ég +of.options.CUSTOM_SKY.tooltip.1=Egyéni Ég +of.options.CUSTOM_SKY.tooltip.2= BE - egyéni ég textúrák (alapértelmezett), lassú +of.options.CUSTOM_SKY.tooltip.3= KI - alapértelmezett ég textúrák, gyorsabb +of.options.CUSTOM_SKY.tooltip.4=Az egyéni ég textúrákat a jelenlegi +of.options.CUSTOM_SKY.tooltip.5=erőforráscsomag biztosítja. + +of.options.CUSTOM_ITEMS=Egyéni Tárgyak +of.options.CUSTOM_ITEMS.tooltip.1=Egyéni Tárgyak +of.options.CUSTOM_ITEMS.tooltip.2= BE - egyéni tárgy textúrák (alapértelmezett), lassú +of.options.CUSTOM_ITEMS.tooltip.3= KI - alapértelmezett tárgy textúrák, gyorsabb +of.options.CUSTOM_ITEMS.tooltip.4=Az egyéni tárgy textúrákat a jelenlegi +of.options.CUSTOM_ITEMS.tooltip.5=erőforráscsomag biztosítja. + +# Details + +of.options.CLOUDS=Felhők +of.options.CLOUDS.tooltip.1=Felhők +of.options.CLOUDS.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.CLOUDS.tooltip.3= Gyors - alacsonyabb minőség, gyorsabb +of.options.CLOUDS.tooltip.4= Szép - magasabb minőség, lassabb +of.options.CLOUDS.tooltip.5= KI - nincsenek felhők, leggyorsabb +of.options.CLOUDS.tooltip.6=A gyors felhők 2D-sek. +of.options.CLOUDS.tooltip.7=A szép felhők 3D-sek. + +of.options.CLOUD_HEIGHT=Felhőmagasság +of.options.CLOUD_HEIGHT.tooltip.1=Felhőmagasság +of.options.CLOUD_HEIGHT.tooltip.2= KI - alapértelmezett magasság +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - a limitált világmagasság felett van + +of.options.TREES=Fák +of.options.TREES.tooltip.1=Fák +of.options.TREES.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.TREES.tooltip.3= Gyors - alacsonyabb minőség, gyorsabb +of.options.TREES.tooltip.4= Okos - magasabb minőség, gyors +of.options.TREES.tooltip.5= Szép - legmagasabb minőség, lassabb +of.options.TREES.tooltip.6=A gyors fáknak átlátszatlan levelei vannak. +of.options.TREES.tooltip.7=A szép és az okos fáknak átlátszó levelei vannak. + +of.options.RAIN=Eső & Hó +of.options.RAIN.tooltip.1=Eső & Hó +of.options.RAIN.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.RAIN.tooltip.3= Gyors - ritka eső/hó, gyorsabb +of.options.RAIN.tooltip.4= Szép - sűrű eső/hó, lassabb +of.options.RAIN.tooltip.5= KI - nincs eső/hó, leggyorsabb +of.options.RAIN.tooltip.6=Amikor az eső ki van kapcsolva, atól még a fröccsenések +of.options.RAIN.tooltip.7=és a hangok aktívak. + +of.options.SKY=Ég +of.options.SKY.tooltip.1=Ég +of.options.SKY.tooltip.2= BE - az ég látszik, lassabb +of.options.SKY.tooltip.3= KI - az ég nem látszik, gyorsabb +of.options.SKY.tooltip.4=Ha az ég ki van kapcsolva, attól még a nap és a hold látszik. + +of.options.STARS=Csillagok +of.options.STARS.tooltip.1=Csillagok +of.options.STARS.tooltip.2= BE - a csillagok látszódnak, lassabb +of.options.STARS.tooltip.3= KI - a csillagok nem látszódnak, gyorsabb + +of.options.SUN_MOON=Nap & Hold +of.options.SUN_MOON.tooltip.1=Nap & Hold +of.options.SUN_MOON.tooltip.2= BE - a hold és a nap látszik (alapértelmezett) +of.options.SUN_MOON.tooltip.3= KI - a hold és a nap nem látszik (gyorsabb) + +of.options.SHOW_CAPES=Köpeny Mutatása +of.options.SHOW_CAPES.tooltip.1=Köpeny Mutatása +of.options.SHOW_CAPES.tooltip.2= BE - mutatja ajátékosok köpenyeit (alapértelmezett) +of.options.SHOW_CAPES.tooltip.3= KI - nem mutatja ajátékosok köpenyeit + +of.options.TRANSLUCENT_BLOCKS=Áttetsző Blokkok +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Áttetsző Blokkok +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Szép - korrekt színhajlítás (alapértelmezett) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Gyors - gyors színhajlítás (gyorsabb) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Irányitja a színhajlását az áttetsző blokkoknak +of.options.TRANSLUCENT_BLOCKS.tooltip.5=különböző színekkel (színezett üveg, víz, jég), +of.options.TRANSLUCENT_BLOCKS.tooltip.6=amikor egymás mögé helyezzük őket levegővel közöttük. + +of.options.HELD_ITEM_TOOLTIPS=Fogott Tárgytippek +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Fogott Tárgytippek +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= BE - tippet mutat a tartott tárgynál (alapértelmezett) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= KI - nem mutat tippet mutat a tartott tárgynál + +of.options.DROPPED_ITEMS=Eldobott Tárgyak +of.options.DROPPED_ITEMS.tooltip.1=Eldobott Tárgyak +of.options.DROPPED_ITEMS.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.DROPPED_ITEMS.tooltip.3= Gyors - 2D-s eldobott tárgyak, gyorsabb +of.options.DROPPED_ITEMS.tooltip.4= Szép - 3D-s eldobott tárgyak, lassabb + +options.entityShadows.tooltip.1=Entitás Árnyékok +options.entityShadows.tooltip.2= BE - entitás árnyékok mutatása +options.entityShadows.tooltip.3= KI - entitás árnyékok nem mutatása + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Vizuális effekt, ami kissé elsötétíti a képernyő sarkait +of.options.VIGNETTE.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában (alapértelmezett) +of.options.VIGNETTE.tooltip.3= Fast - vignette kikapcsolva (gyorsabb) +of.options.VIGNETTE.tooltip.4= Fancy - vignette bekapcsolva (lassabb) +of.options.VIGNETTE.tooltip.5=A vignette-nek jelentős nyoma lehet az FPS-en, +of.options.VIGNETTE.tooltip.6=főleg teljes képernyős módon játszva. +of.options.VIGNETTE.tooltip.7=A vignette effekt teljesen apró, és nyugodtan +of.options.VIGNETTE.tooltip.8=kikapcsolható + +of.options.DYNAMIC_FOV=Dinamikus FOV +of.options.DYNAMIC_FOV.tooltip.1=Dinamikus FOV +of.options.DYNAMIC_FOV.tooltip.2= BE - bekapcsolja a dinamikus FOV-t (alapértelmezett) +of.options.DYNAMIC_FOV.tooltip.3= KI - kikapcsolja a dinamikus FOV-t +of.options.DYNAMIC_FOV.tooltip.4=Megváltoztatja a látómezőt (FOV) repülés, futás +of.options.DYNAMIC_FOV.tooltip.5=vagy íjászkodás közben. + +of.options.DYNAMIC_LIGHTS=Dinamikus Fények +of.options.DYNAMIC_LIGHTS.tooltip.1=Dinamikus Fények +of.options.DYNAMIC_LIGHTS.tooltip.2= KI - nincs dinamikus fény (alapértelmezett) +of.options.DYNAMIC_LIGHTS.tooltip.3= Gyors - gyors dinamikus fény (frissítve minden 500ms-ként) +of.options.DYNAMIC_LIGHTS.tooltip.4= Szép - szép dinamikus fény (valós időben frissítve) +of.options.DYNAMIC_LIGHTS.tooltip.5=Engedélyezi a fénykibocsájtó tárgyaknak (fáklya, izzókő, stb.), +of.options.DYNAMIC_LIGHTS.tooltip.6=hogy fényt bocsássanak ki, mikor kézben cipelik, +of.options.DYNAMIC_LIGHTS.tooltip.7=másik karakter használja, vagy a füldre van dobva. + +# Performance + +of.options.SMOOTH_FPS=Sima FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizálja az FPS-t a grafikus beghajtő buffereinek öblítésével. +of.options.SMOOTH_FPS.tooltip.2= KI - nincs stabilizálás, FPS inoghat +of.options.SMOOTH_FPS.tooltip.3= BE - FPS stabilizáció +of.options.SMOOTH_FPS.tooltip.4=Ez a beállítás grafikus meghajtó függő, és a hatása +of.options.SMOOTH_FPS.tooltip.5=nem mindíg látható. + +of.options.SMOOTH_WORLD=Sima Világ +of.options.SMOOTH_WORLD.tooltip.1=Eltávolítja a "lagtüskéket", amit a helyi szerver okoz. +of.options.SMOOTH_WORLD.tooltip.2= OFF - nincs stabilizáció, FPS inoghat +of.options.SMOOTH_WORLD.tooltip.3= ON - FPS stabilizáció +of.options.SMOOTH_WORLD.tooltip.4=Stabilizálja az FPS-t, amit a helyi szerver okoz. +of.options.SMOOTH_WORLD.tooltip.5=Csak helyi világokban effektív (egyjátékos mód). + +of.options.FAST_RENDER=Gyors Renderelés +of.options.FAST_RENDER.tooltip.1=Gyors Renderelés +of.options.FAST_RENDER.tooltip.2= KI - alap renderelés (alapértelmezett) +of.options.FAST_RENDER.tooltip.3= BE - optimalizált renderelés (gyorsabb) +of.options.FAST_RENDER.tooltip.4=Optimalizált renderelési algoritmust használ, ami csökkenti +of.options.FAST_RENDER.tooltip.5=a GPU töltési időt, és lényegesen növelheti az FPS-t. + +of.options.FAST_MATH=Gyors Matek +of.options.FAST_MATH.tooltip.1=Gyors Matek +of.options.FAST_MATH.tooltip.2= KI - alap matek (alapértelmezett) +of.options.FAST_MATH.tooltip.3= BE - gyorsabb matek +of.options.FAST_MATH.tooltip.4=Optimalizált sin() és cos() függvényeket használ, ami jobban +of.options.FAST_MATH.tooltip.5=hasznosítja a CPU gyorsítótárat, és növelheti az FPS-t. + +of.options.CHUNK_UPDATES=Terület Frissítések +of.options.CHUNK_UPDATES.tooltip.1=Terület Frissítések +of.options.CHUNK_UPDATES.tooltip.2= 1 - lassabb világbetöltés, magasabb FPS (alapértelmezett) +of.options.CHUNK_UPDATES.tooltip.3= 3 - gyorsabb világbetöltés, alacsonyabb FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - leggyorsabb világbetöltés, legalacsonyabb FPS +of.options.CHUNK_UPDATES.tooltip.5=Terület frissítések száma lerenderelt képkockánként; +of.options.CHUNK_UPDATES.tooltip.6=magasabb értékek instabilizálhatja az FPS-t. + +of.options.CHUNK_UPDATES_DYNAMIC=Dinamikus Frissítések +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dinamikus terület frissítések +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= KI - (alapértelmezett) alap területfrissítések képkockánként +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= BE - több frissítés, amíg a játékos egy helyben áll +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=A Dinamikus Frissítések több területfrissítést eröltet, amíg +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=a játékos egy helyben áll, hogy a világ gyorsabban betöltsön. + +of.options.LAZY_CHUNK_LOADING="Lusta Területek" Betöltése +of.options.LAZY_CHUNK_LOADING.tooltip.1="Lusta Területek" betöltése +of.options.LAZY_CHUNK_LOADING.tooltip.2= KI - alapértelmezett szerver terület betöltés +of.options.LAZY_CHUNK_LOADING.tooltip.3= BE - "lusta" szerver terület betöltés (simább) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Simítja az inegrált szerver területbetöltését +of.options.LAZY_CHUNK_LOADING.tooltip.5=a területek idönközötti "kattogásának" lekötésével. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Kapcsold ki, ha a világ bizonyos részei nem töltenek be megfelelően. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Csak helyi világokban és egymagos CPU esetén effektív. + +# Animations + +of.options.animation.allOn=Mind BE +of.options.animation.allOff=Mind KI +of.options.animation.dynamic=Dinamikus + +of.options.ANIMATED_WATER=Animált Víz +of.options.ANIMATED_LAVA=Animált Láva +of.options.ANIMATED_FIRE=Animált Tűz +of.options.ANIMATED_PORTAL=Animált Portál +of.options.ANIMATED_REDSTONE=Animált Vöröskő +of.options.ANIMATED_EXPLOSION=Animált Robbanás +of.options.ANIMATED_FLAME=Animált Lángok +of.options.ANIMATED_SMOKE=Animált Füst +of.options.VOID_PARTICLES=Űr Részecskék +of.options.WATER_PARTICLES=Víz Részecskék +of.options.RAIN_SPLASH=Eső Felcsapódás +of.options.PORTAL_PARTICLES=Portál Részecskék +of.options.POTION_PARTICLES=Bájital Részecskék +of.options.DRIPPING_WATER_LAVA=Kicsapó Víz/Láva +of.options.ANIMATED_TERRAIN=Animált Terep +of.options.ANIMATED_TEXTURES=Animált Textúrák +of.options.FIREWORK_PARTICLES=Tüzijáték Részecskék + +# Other + +of.options.LAGOMETER=Lagmérő +of.options.LAGOMETER.tooltip.1=Mutatja a lagmérőt a hibakereső képernyőn (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Memóriaszemét gyűjtemény +of.options.LAGOMETER.tooltip.3=* Cyan - "kegyegés" +of.options.LAGOMETER.tooltip.4=* Blue - Ütemezett végrehajthatók +of.options.LAGOMETER.tooltip.5=* Purple - Területfeltöltés +of.options.LAGOMETER.tooltip.6=* Red - Terület frissítés +of.options.LAGOMETER.tooltip.7=* Yellow - Láthatóságfigyelő +of.options.LAGOMETER.tooltip.8=* Green - Terep renderelése + +of.options.PROFILER=Hibakereső Profil +of.options.PROFILER.tooltip.1=Hibakereső Profil +of.options.PROFILER.tooltip.2= BE - hibakereső profil aktív, lassabb +of.options.PROFILER.tooltip.3= KI - hibakereső profil nem aktív, gyorsabb +of.options.PROFILER.tooltip.4=A hibakereső profil hibakereső információkat gyűjt, és mutat, +of.options.PROFILER.tooltip.5=amikor a hibakereső képernyő aktív (F3) + +of.options.WEATHER=Időjárás +of.options.WEATHER.tooltip.1=Időjárás +of.options.WEATHER.tooltip.2= BE - az időjárás aktív, lassabb +of.options.WEATHER.tooltip.3= KI - az időjárás nem aktív, gyorsabb +of.options.WEATHER.tooltip.4=Az időjárás irányítja az esőket, havazásokat, és a viharokat. +of.options.WEATHER.tooltip.5=Az időjárás irányítása csak helyi világokban lehetséges. + +of.options.time.dayOnly=Csak Nappal +of.options.time.nightOnly=Csak Éjszaka + +of.options.TIME=Idő +of.options.TIME.tooltip.1=Idő +of.options.TIME.tooltip.2= Alapértelmezett - normális éjjel-nappal körforgás +of.options.TIME.tooltip.3= Csak Nappal - csak nappal +of.options.TIME.tooltip.4= Csak Éjszaka - csak éjszaka +of.options.TIME.tooltip.5=Az Idő beállítás csak KREATÍV módban, +of.options.TIME.tooltip.6=és helyi világokban effektív. + +options.fullscreen.tooltip.1=Teljes Képernyő +options.fullscreen.tooltip.2= BE - teljes képernyős mód használata +options.fullscreen.tooltip.3= KI - ablakos mód használata +options.fullscreen.tooltip.4=A teljes képergyős mód gyorsabb, vagy lassabb lehet, mint +options.fullscreen.tooltip.5=az ablakos mód a videókártyától függően. + +of.options.FULLSCREEN_MODE=Teljes Képernyős Mód +of.options.FULLSCREEN_MODE.tooltip.1=Teljes Képernyős mód +of.options.FULLSCREEN_MODE.tooltip.2= Alapértelmezett - asztal méretének használata, lassabb +of.options.FULLSCREEN_MODE.tooltip.3= WxH - egyéni felbontás használata, lehet gyorsabb +of.options.FULLSCREEN_MODE.tooltip.4=A kiválasztott felbontás a teljes képernyős módban használatos (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Kisebb felbontások általában gyorsabbak. + +of.options.SHOW_FPS=FPS Mutatása +of.options.SHOW_FPS.tooltip.1=Mutatja a jelenlegi FPS számot, és renderelési információkat +of.options.SHOW_FPS.tooltip.2= C: - területek renderelése +of.options.SHOW_FPS.tooltip.3= E: - lerenderelt entitások + blokk entitások +of.options.SHOW_FPS.tooltip.4= U: - terület frissítések +of.options.SHOW_FPS.tooltip.5=A jeéenlegi FPS információ csak akkor mutatkozik, ha a +of.options.SHOW_FPS.tooltip.6=a hibakeresési képernyő nem látszik. + +of.options.save.default=Alapértelmezett (2mp) +of.options.save.20s=20mp +of.options.save.3min=3p +of.options.save.30min=30p + +of.options.AUTOSAVE_TICKS=Auto mentés +of.options.AUTOSAVE_TICKS.tooltip.1=Az auto mentés intervalluma +of.options.AUTOSAVE_TICKS.tooltip.2=Az alapértelmezett auto mentés intervallum (2mp) NEM JAVASOLT. +of.options.AUTOSAVE_TICKS.tooltip.3=Az auto mentés okozza a híres "Halál lagtüskéjét" famous Lag Spike of Death. + +options.anaglyph.tooltip.1=A 3D mód piros-cián szemüveggel használatos. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/it_IT.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/it_IT.lang new file mode 100644 index 0000000..60df9dc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/it_IT.lang @@ -0,0 +1,736 @@ +# General +of.general.ambiguous=ambiguo +of.general.custom=Personalizza +of.general.from=Da +of.general.id=ID +of.general.restart=Riavvia +of.general.smart=Intelligente + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=L'Antialiasing non è compatibile con le Shaders. +of.message.aa.shaders2=Disattivale per usare questa funzione. + +of.message.af.shaders1=Il Filtro Anisotropico non è compatibile con le Shaders +of.message.af.shaders2=Disattivale per usare questa funzione. + +of.message.fr.shaders1=Il Rendering Veloce non è compatibile con le Shaders. +of.message.fr.shaders2=Disattivale per usare questa funzione. + +of.message.an.shaders1=Il 3D anaglifico non è compatibile con le Shaders. +of.message.an.shaders2=Disattivale per usare questa funzione. + +of.message.shaders.aa1=Le Shaders non sono compatibili con l'Antialiasing. +of.message.shaders.aa2=Per disattivarlo, fai clic su Qualità -> Antialiasing. + +of.message.shaders.af1=Le Shaders non sono compatibili con il Filtro Anisotropico. +of.message.shaders.af2=Per disattivarlo, fai clic su Qualità -> Filtro Anisotropico. + +of.message.shaders.fr1=Le Shaders non sono compatibili con il Rendering Veloce. +of.message.shaders.fr2=Per disattivarlo, fai clic su Prestazione -> Rendering Veloce. + +of.message.shaders.an1=Le Shaders non sono compatibili col 3D Anaglifico. +of.message.shaders.an2=Per favore vai su Varie... -> 3D Anaglifico -> No. + +of.message.shaders.nv1=Questo pacchetto Shaders richiede una versione più recente della Optifine: %s +of.message.shaders.nv2=Sicuro di voler continuare? + +of.message.newVersion=C'è una nuova versione di §eOptiFine§f disponibile: §e%s§f. +of.message.java64Bit=Installa §eJava a 64-bit§f per migliorare il Rendering. +of.message.openglError=§eErrore di OpenGL§f: %s (%s) + +of.message.shaders.loading=Caricando le Shaders: %s + +of.message.other.reset=Ristabilire tutte le impostazioni grafiche? + +of.message.loadingVisibleChunks=Caricando chunk visibili + +# Skin customization + +of.options.skinCustomisation.ofCape=Mantello Optifine... + +# Impostazioni Video + +options.graphics.tooltip.1=Grafica +options.graphics.tooltip.2= Rapida - qualità peggiore, prestazioni migliori +options.graphics.tooltip.3= Dettagliata - qualità migliore, prestazioni peggiori +options.graphics.tooltip.4=Cambiamenti visibili nelle nuvole, foglie, acqua +options.graphics.tooltip.5=ombre e lati dei blocchi d'erba. + +of.options.renderDistance.tiny=Minima +of.options.renderDistance.short=Corta +of.options.renderDistance.normal=Normale +of.options.renderDistance.far=Lontana +of.options.renderDistance.extreme=Estrema +of.options.renderDistance.insane=Folle +of.options.renderDistance.ludicrous=Ridicola + +options.renderDistance.tooltip.1=Distanza visibile +options.renderDistance.tooltip.2= 2 Minima - 32m (più veloce) +options.renderDistance.tooltip.3= 8 Normale - 128m (normale) +options.renderDistance.tooltip.4= 16 Lontana - 256m (lenta) +options.renderDistance.tooltip.5= 32 Estrema - 512m (molto lenta!) richiede molte risorse +options.renderDistance.tooltip.6= 48 Folle - 768m, richiede 2GB di RAM allocati +options.renderDistance.tooltip.7= 64 Ridicola - 1024m, richiede 3GB di RAM allocati +options.renderDistance.tooltip.8=Valori sopra 16 sono funzionanti solo in mondi locali. + +options.ao.tooltip.1=Luci soffuse +options.ao.tooltip.2= No - senza luci soffuse (veloce) +options.ao.tooltip.3= Minimo - luci soffuse semplici (lento) +options.ao.tooltip.4= Massimo - luci soffuse avanzate (più lento) + +options.framerateLimit.tooltip.1=Limite di FPS +options.framerateLimit.tooltip.2= Sincronizzazione verticale - limita gli FPS secondo il tuo schermo (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - limite di FPS personalizzato +options.framerateLimit.tooltip.4= Senza limite - tutti gli FPS possibili (veloce) +options.framerateLimit.tooltip.5= +options.framerateLimit.tooltip.6=Impostando un limite di FPS, essi possono diminuire il +options.framerateLimit.tooltip.7=Raggiungimento ad esso. +of.options.framerateLimit.vsync=Sincronizzazione verticale + +of.options.AO_LEVEL=Livello di morbidezza +of.options.AO_LEVEL.tooltip.1=livello di illuminazione morbida +of.options.AO_LEVEL.tooltip.2= No - senza ombre +of.options.AO_LEVEL.tooltip.3= 50%% - poche ombre +of.options.AO_LEVEL.tooltip.4= 100%% - ombre scure +options.viewBobbing.tooltip.1=Visualizza un movimento del giocatore più realistico. +options.viewBobbing.tooltip.2=Disattivare il mipmap per ottenere un miglior risultato. + +options.guiScale.tooltip.1=Scala dell'Interfaccia (GUI) +options.guiScale.tooltip.2=Un'interfaccia più piccola può migliorare le prestazioni. +options.guiScale.tooltip.3= Piccola, Normale, Grande - 1x verso 3x +options.guiScale.tooltip.4= 4x verso 10x - disponibile su schermi 4K +options.guiScale.tooltip.5=Valori dispari (1x, 3x, 5x ...) non compatibili con Unicode. +options.guiScale.tooltip.6=Una GUI più piccola potrebbe migliorare le prestazioni. + +options.vbo=VBO +options.vbo.tooltip.1=Vertex Buffer Objects (abbreviato in VBO) +options.vbo.tooltip.2=In alternativa è il rendering che di solito è più +options.vbo.tooltip.3=veloce (5-10%%) alla forma default. + +options.gamma.tooltip.1=Modifica la luminosità +options.gamma.tooltip.2= Scura - Luminosità di default +options.gamma.tooltip.3= 1-99%% - Luminosità personalizzata +options.gamma.tooltip.4= Luminoso - Luminosità al massimo +options.gamma.tooltip.5= +options.gamma.tooltip.6=Questa opzione non cambia particolarmente +options.gamma.tooltip.7=la luminosità degli oggetti più scuri. + +options.anaglyph.tooltip.1=Visione in 3D +options.anaglyph.tooltip.2=Attivare un effetto stereoscopico utilizzando un colore +options.anaglyph.tooltip.3=differente per ogni occhio. +options.anaglyph.tooltip.4=NOTA: Richiede occhiali anaglifici (rossi e blu). + +of.options.ALTERNATE_BLOCKS=Blocchi alternati +of.options.ALTERNATE_BLOCKS.tooltip.1=Blocchi con texture alternate +of.options.ALTERNATE_BLOCKS.tooltip.2=Utilizzare texture alternative per lo stesso blocco. +of.options.ALTERNATE_BLOCKS.tooltip.3=Dipende dal pacchetto di risorse usato. + +of.options.FOG_FANCY=Nebbia +of.options.FOG_FANCY.tooltip.1=Tipo di nebbia +of.options.FOG_FANCY.tooltip.2= Veloce - nebbia più veloce, sembra squallido +of.options.FOG_FANCY.tooltip.3= Dettagliata - nebbia più lenta, sembra migliore +of.options.FOG_FANCY.tooltip.4= No - senza foschia, super veloce +of.options.FOG_FANCY.tooltip.5=La nebbia dettagliata è disponibile solo se +of.options.FOG_FANCY.tooltip.6=la tua scheda grafica te lo permette. + +of.options.FOG_START=Distanza della nebbia +of.options.FOG_START.tooltip.1=Distanza in cui la nebbia comincia +of.options.FOG_START.tooltip.2= 0.2 - la nebbia inizia vicina al giocatore +of.options.FOG_START.tooltip.3= 0.8 - la nebbia inizia lontana dal giocatore +of.options.FOG_START.tooltip.4=Normalmente questa opzione non affligge le prestazioni. + +of.options.CHUNK_LOADING=Caricamento dei Chunk +of.options.CHUNK_LOADING.tooltip.1=Velocità del caricamento dei Chunk +of.options.CHUNK_LOADING.tooltip.2= Per default - FPS instabili al caricamento dei Chunk +of.options.CHUNK_LOADING.tooltip.3= Morbido - FPS stabili +of.options.CHUNK_LOADING.tooltip.4= Multinucleo - FPS stabili e una velocità tre volte superiore +of.options.CHUNK_LOADING.tooltip.5=Le opzioni "Morbido" e "Multinucleo" eliminano gli intoppi nella +of.options.CHUNK_LOADING.tooltip.6=lentezza causata nel caricamento dei Chunk. +of.options.CHUNK_LOADING.tooltip.7=Il Multinucleo può accelerare il carico fino a tre volte e migliorare +of.options.CHUNK_LOADING.tooltip.8=gli FPS e usare un secondo nucleo della CPU. +of.options.ChunkLoading.smooth=Morbido +of.options.ChunkLoading.multiCore=Multinucleo + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=(NO SHADERS) +of.options.shaders.packDefault=(SHADERS INTERNE) + +of.options.shaders.shadersFolder=Cartella Shaders +of.options.shaders.shaderOptions=Opzioni Shaders + +of.options.shaderOptionsTitle=Opzioni Shaders + +of.options.quality=Qualità... +of.options.qualityTitle=Opzioni grafiche + +of.options.details=Dettagli... +of.options.detailsTitle=Opzioni grafiche + +of.options.performance=Prestazioni... +of.options.performanceTitle=Prestazioni + +of.options.animations=Animazioni... +of.options.animationsTitle=Opzioni animazioni + +of.options.other=Varie... +of.options.otherTitle=Opzioni varie + +of.options.other.reset=Ripristino impostazioni... + +of.shaders.profile=Profilo + +# Qualità + +of.options.mipmap.bilinear=Bilineare +of.options.mipmap.linear=Lineare +of.options.mipmap.nearest=Vicino +of.options.mipmap.trilinear=Trilinere + +options.mipmapLevels.tooltip.1=Effetto visivo che consente di visualizzare oggetti distanti +options.mipmapLevels.tooltip.2=migliori lisciando i dettagli delle texture +options.mipmapLevels.tooltip.3= +options.mipmapLevels.tooltip.4= No - senza morbidezza +options.mipmapLevels.tooltip.5= 1 - morbidezza minima +options.mipmapLevels.tooltip.6= 4 - morbidezza massima +options.mipmapLevels.tooltip.7= +options.mipmapLevels.tooltip.8=Normalmente questa opzione non influisce sulle prestazioni. + +of.options.MIPMAP_TYPE=Tipo di mipmap +of.options.MIPMAP_TYPE.tooltip.1=Effetto visivo che consente di visualizzare oggetti distanti +of.options.MIPMAP_TYPE.tooltip.2=migliori lisciando i dettagli delle texture +of.options.MIPMAP_TYPE.tooltip.3= +of.options.MIPMAP_TYPE.tooltip.4= Vicino - morbidezza scarsa (più veloce) +of.options.MIPMAP_TYPE.tooltip.5= Lineare - morbidezza normale +of.options.MIPMAP_TYPE.tooltip.6= Bilineare - morbidezza sottile +of.options.MIPMAP_TYPE.tooltip.7= Trilineare - morbidezza molto sottile (più lenta) + +of.options.ANTIALIASING=Antialiasing +of.options.ANTIALIASING.tooltip.1=Antialiasing attenua linee e i bordi dei blocchi +of.options.ANTIALIASING.tooltip.2= No - (per default) senza antialiasing (più veloce) +of.options.ANTIALIASING.tooltip.3= FXAA 2x, 4x - livello di antialiasing morbido (più lento) +of.options.ANTIALIASING.tooltip.4= +of.options.ANTIALIASING.tooltip.5= Ammorbidisce i denti di sega e migliora la nitidezza. +of.options.ANTIALIASING.tooltip.6= Gli FPS può diminuire considerevolmente quando attivato. +of.options.ANTIALIASING.tooltip.7= Alcune schede grafiche non supportano tutti i livelli. +of.options.ANTIALIASING.tooltip.8= La modifica verrà applicata al RIAVVIO del gioco! + +of.options.shaders.NORMAL_MAP=Mappatura normale +of.options.shaders.NORMAL_MAP.tooltip.1=Mappatura normale +of.options.shaders.NORMAL_MAP.tooltip.2= Sì - (default) abilita mappatura normale +of.options.shaders.NORMAL_MAP.tooltip.3= No - disabilita mappatura normale +of.options.shaders.NORMAL_MAP.tooltip.4= +of.options.shaders.NORMAL_MAP.tooltip.5= Le mappature normali possono essere usate dai pacchetti shader +of.options.shaders.NORMAL_MAP.tooltip.6= per simulare geometria 3D su superfici piatte. +of.options.shaders.NORMAL_MAP.tooltip.7= Le texture mappature normali sono supportate +of.options.shaders.NORMAL_MAP.tooltip.8= da questo pacchetto di risorse. + +of.options.shaders.SPECULAR_MAP=Mappatura speculare +of.options.shaders.SPECULAR_MAP.tooltip.1=Mappatura speculare +of.options.shaders.SPECULAR_MAP.tooltip.2= Sì - (default) abilita mappature speculari +of.options.shaders.SPECULAR_MAP.tooltip.3= No - disabilita mappature speculari +of.options.shaders.SPECULAR_MAP.tooltip.4= +of.options.shaders.SPECULAR_MAP.tooltip.5= Le mappature speculari possono essere usate dai pacchetti shader +of.options.shaders.SPECULAR_MAP.tooltip.6= per simulare speciali effetti di riflessione. +of.options.shaders.SPECULAR_MAP.tooltip.7= Le texture mappature speculari sono supportate +of.options.shaders.SPECULAR_MAP.tooltip.8= da questo pacchetto di risorse. + +of.options.shaders.RENDER_RES_MUL=Qualità rendering +of.options.shaders.RENDER_RES_MUL.tooltip.1=Qualità rendering +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - bassa (più veloce) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - normale (default) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - alta (più lenta) +of.options.shaders.RENDER_RES_MUL.tooltip.5= +of.options.shaders.RENDER_RES_MUL.tooltip.6= Qualità rendering controlla la grandezza delle texture +of.options.shaders.RENDER_RES_MUL.tooltip.7= che il pacchetto shaders renderizza. +of.options.shaders.RENDER_RES_MUL.tooltip.8= Valori più bassi sono buoni per schermi 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.9= Valori più alti funzionano come un filtro antialiasing. + +of.options.shaders.SHADOW_RES_MUL=Qualità ombre +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Qualità ombre +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - bassa (più veloce) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - normale (default) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - alta (più lenta) +of.options.shaders.SHADOW_RES_MUL.tooltip.5= +of.options.shaders.SHADOW_RES_MUL.tooltip.6= Qualità ombre controlla la grandezza della mappatura ombre +of.options.shaders.SHADOW_RES_MUL.tooltip.7= utilizzata dal pacchetto di shaders. +of.options.shaders.SHADOW_RES_MUL.tooltip.8= Valori più bassi = inesatta, ombre grossolane. +of.options.shaders.SHADOW_RES_MUL.tooltip.9= Valori più alti = dettagliata, ombre di qualità. + +of.options.shaders.HAND_DEPTH_MUL=Profondità campo +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Profondità campo +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - mano vicina alla telecamera +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (default) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - mano lontana dalla telecamera +of.options.shaders.HAND_DEPTH_MUL.tooltip.5= +of.options.shaders.HAND_DEPTH_MUL.tooltip.6= Profondità campo controlla quanto lontano gli oggetti +of.options.shaders.HAND_DEPTH_MUL.tooltip.7= tenuti in mano sono dalla telecamera. +of.options.shaders.HAND_DEPTH_MUL.tooltip.8= Per i pacchetti di shader che usano un effetto blur questa +of.options.shaders.HAND_DEPTH_MUL.tooltip.9= opzione dovrebbe cambiare l'effetto degli oggetti tenuti. + +of.options.shaders.OLD_HAND_LIGHT=Luce mano secondaria +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Luce mano secondaria +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Default - controllata dal pacchetto shader +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Sì - usa luce mano secondaria +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= No - usa normale luce +of.options.shaders.OLD_HAND_LIGHT.tooltip.5= +of.options.shaders.OLD_HAND_LIGHT.tooltip.6= Luce mano secondaria permette ai pacchetti shader +of.options.shaders.OLD_HAND_LIGHT.tooltip.7= che riconoscono la luce di oggetti tenuti solo +of.options.shaders.OLD_HAND_LIGHT.tooltip.8= nella mano primaria di funzionare anche con la mano secondaria. + +of.options.shaders.OLD_LIGHTING=Luce classica +of.options.shaders.OLD_LIGHTING.tooltip.1=Luce classica +of.options.shaders.OLD_LIGHTING.tooltip.2= Default - controllata dal pacchetto shader +of.options.shaders.OLD_LIGHTING.tooltip.3= Sì - usa luce classica +of.options.shaders.OLD_LIGHTING.tooltip.4= No - non usare luce classica +of.options.shaders.OLD_LIGHTING.tooltip.5= +of.options.shaders.OLD_LIGHTING.tooltip.6= Luce classica controlla la luce applicata +of.options.shaders.OLD_LIGHTING.tooltip.7= al lato dei blocchi vanilla. +of.options.shaders.OLD_LIGHTING.tooltip.8= I pacchetti shader che usano ombre di solito forniscono +of.options.shaders.OLD_LIGHTING.tooltip.9= una migliore luce in base alla posizione del Sole. + +of.options.shaders.DOWNLOAD=Scarica shaders +of.options.shaders.DOWNLOAD.tooltip.1=Scarica shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Apre la pagina del pacchetto di shaders nel browser. +of.options.shaders.DOWNLOAD.tooltip.4=Metti il pacchetto di shaders scaricato nella "Cartella Shaders" +of.options.shaders.DOWNLOAD.tooltip.5=e appariranno nella lista di shaders installate. + +of.options.AF_LEVEL=Filtro Anisotropico +of.options.AF_LEVEL.tooltip.1=Anisotropico filtrato +of.options.AF_LEVEL.tooltip.2= No - (Default) dettaglio texture Normale (veloce) +of.options.AF_LEVEL.tooltip.3= 2-16 - raffinazione texture tramite mipmap (più lento) +of.options.AF_LEVEL.tooltip.4= +of.options.AF_LEVEL.tooltip.5=Questo filtro consente di recuperare i dettagli utilizzando mipmap +of.options.AF_LEVEL.tooltip.6=Gli FPS possono diminuire considerevolmente quando attivati. + +of.options.CLEAR_WATER=Acqua cristallina +of.options.CLEAR_WATER.tooltip.1=Acqua cristallina +of.options.CLEAR_WATER.tooltip.2= Sì - acqua limpida e trasparente +of.options.CLEAR_WATER.tooltip.3= No - acqua default + +of.options.RANDOM_ENTITIES=Creature casuali +of.options.RANDOM_ENTITIES.tooltip.1=Randomizza texture delle creature +of.options.RANDOM_ENTITIES.tooltip.2= No - non casuale, più veloce +of.options.RANDOM_ENTITIES.tooltip.3= Sì - con randomizzazione, più lento +of.options.RANDOM_ENTITIES.tooltip.4= +of.options.RANDOM_ENTITIES.tooltip.5=Permette alle creature di cambiare texture. +of.options.RANDOM_ENTITIES.tooltip.6=Richiede un pacchetto di risorse che abbia molteplici texture +of.options.RANDOM_ENTITIES.tooltip.7=per la stessa creatura. + +of.options.BETTER_GRASS=Prato migliorato +of.options.BETTER_GRASS.tooltip.1=Texture dei lati del blocco di terra migliorati aggiungendo prato +of.options.BETTER_GRASS.tooltip.2= No - prato normale (per default), più veloce +of.options.BETTER_GRASS.tooltip.3= Rapido - unica texture d'erba applicata +of.options.BETTER_GRASS.tooltip.4= Dettagliata - texture dinamica, molto lento + +of.options.BETTER_SNOW=Neve migliorata +of.options.BETTER_SNOW.tooltip.1=Neve migliorata +of.options.BETTER_SNOW.tooltip.2= No - neve default, più veloce +of.options.BETTER_SNOW.tooltip.3= Sì - neve dettagliata, più lento +of.options.BETTER_SNOW.tooltip.4= +of.options.BETTER_SNOW.tooltip.5=Mostra la neve sotto i blocchi trasparenti +of.options.BETTER_SNOW.tooltip.6=(Recinzioni, erba) quando li si confina con la neve. + +of.options.CUSTOM_FONTS=Font personalizzati +of.options.CUSTOM_FONTS.tooltip.1=Font personalizzati +of.options.CUSTOM_FONTS.tooltip.2= Sì - font personalizzati (per default), più lento +of.options.CUSTOM_FONTS.tooltip.3= No - font di default, più veloce +of.options.CUSTOM_FONTS.tooltip.4= +of.options.CUSTOM_FONTS.tooltip.5=Alcuni pacchetti di risorse contengono font +of.options.CUSTOM_FONTS.tooltip.6=personalizzati. + +of.options.CUSTOM_COLORS=Colori personalizzati +of.options.CUSTOM_COLORS.tooltip.1=Colori personalizzati +of.options.CUSTOM_COLORS.tooltip.2= Sì - colori personalizzati (per default), più lenti +of.options.CUSTOM_COLORS.tooltip.3= No - colori default, più veloci +of.options.CUSTOM_COLORS.tooltip.4= +of.options.CUSTOM_COLORS.tooltip.5=Alcuni pacchetti di risorse contengono colori +of.options.CUSTOM_COLORS.tooltip.6=personalizzati. + +of.options.SWAMP_COLORS=Colore delle paludi +of.options.SWAMP_COLORS.tooltip.1=Colore delle paludi +of.options.SWAMP_COLORS.tooltip.2= Sì - colore delle paludi (per default), più lento +of.options.SWAMP_COLORS.tooltip.3= No - senza colori nelle paludi, più veloce +of.options.SWAMP_COLORS.tooltip.4=Comprende: erba, acqua, foglie e rampicanti. + +of.options.SMOOTH_BIOMES=Morbidezza dei biomi +of.options.SMOOTH_BIOMES.tooltip.1=Morbidezza dei confini dei biomi +of.options.SMOOTH_BIOMES.tooltip.2= Sì - bordi lisci bioma (default), più lento +of.options.SMOOTH_BIOMES.tooltip.3= No - senza bordi lisci dei biomi, più veloce +of.options.SMOOTH_BIOMES.tooltip.4= +of.options.SMOOTH_BIOMES.tooltip.5=Il livellamento viene eseguito +of.options.SMOOTH_BIOMES.tooltip.6=dai blocchi di colore gradiente vicino ai confini +of.options.SMOOTH_BIOMES.tooltip.7=Comprende: erba, acqua, foglie e rampicanti. + +of.options.CONNECTED_TEXTURES=Blocchi uniti +of.options.CONNECTED_TEXTURES.tooltip.1=Le texture uniscono blocchi determinati +of.options.CONNECTED_TEXTURES.tooltip.2= No - non unirli, più veloce +of.options.CONNECTED_TEXTURES.tooltip.3= Veloce - unirli in forma più semplice +of.options.CONNECTED_TEXTURES.tooltip.4= Dettagliate - unirli in forma migliorata +of.options.CONNECTED_TEXTURES.tooltip.5= +of.options.CONNECTED_TEXTURES.tooltip.6=Unisce le texture di vetro, pietra arenaria +of.options.CONNECTED_TEXTURES.tooltip.7=e biblioteche per ottenere i blocchi. +of.options.CONNECTED_TEXTURES.tooltip.8=Non tutti i pacchetti di risorse supportano questa opzione. + +of.options.NATURAL_TEXTURES=Texture naturali +of.options.NATURAL_TEXTURES.tooltip.1=Texture naturali +of.options.NATURAL_TEXTURES.tooltip.2= No - senza texture naturali (per default) +of.options.NATURAL_TEXTURES.tooltip.3= Sì - con texture naturali +of.options.NATURAL_TEXTURES.tooltip.4=Questa opzione rimuove i blocchi del modello +of.options.NATURAL_TEXTURES.tooltip.5=che viene creato mettendo blocchi dello stesso tipo. +of.options.NATURAL_TEXTURES.tooltip.6=Si usano varianti ruotate della texture +of.options.NATURAL_TEXTURES.tooltip.7=base del blocco. +of.options.NATURAL_TEXTURES.tooltip.8=Non tutti i pacchetti di risorse supportano questa opzione. + +of.options.EMISSIVE_TEXTURES=Texture emissive +of.options.EMISSIVE_TEXTURES.tooltip.1=Texture emissive +of.options.EMISSIVE_TEXTURES.tooltip.2= Sì - no texture emissive (default) +of.options.EMISSIVE_TEXTURES.tooltip.3= No - utilizza texture emissive +of.options.EMISSIVE_TEXTURES.tooltip.4=Le texture emissive sono renderizzate come copertura +of.options.EMISSIVE_TEXTURES.tooltip.5=con massima luminosità. Possono essere usate come +of.options.EMISSIVE_TEXTURES.tooltip.6=parti di luce della texture base. +of.options.EMISSIVE_TEXTURES.tooltip.7=Le texture emissive sono supportate dal +of.options.EMISSIVE_TEXTURES.tooltip.8=pacchetto di risorse attuale. + +of.options.CUSTOM_SKY=Cielo personalizzato +of.options.CUSTOM_SKY.tooltip.1=Texture personalizzata +of.options.CUSTOM_SKY.tooltip.2= Sì - cielo personalizzato, più lento +of.options.CUSTOM_SKY.tooltip.3= No - cielo di default, più veloce +of.options.CUSTOM_SKY.tooltip.4= +of.options.CUSTOM_SKY.tooltip.5=Non tutti i pacchetti di risorse supportano questa opzione. + +of.options.CUSTOM_ITEMS=Oggetti personalizzati +of.options.CUSTOM_ITEMS.tooltip.1=Texture personalizzata di oggetti (item) +of.options.CUSTOM_ITEMS.tooltip.2= Sì - oggetti personalizzati (per default), più lento +of.options.CUSTOM_ITEMS.tooltip.3= No - oggetti default, più veloce +of.options.CUSTOM_ITEMS.tooltip.4= +of.options.CUSTOM_ITEMS.tooltip.5=Non tutti i pacchetti di risorse supportano questa opzione. + +of.options.CUSTOM_ENTITY_MODELS=Entità personalizzate +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Texture personalizzate delle entità +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Sì - vari modelli entità (default), più lento +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= No - modelli di default, più veloce +of.options.CUSTOM_ENTITY_MODELS.tooltip.4= +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=Non tutti i pacchetti di risorse supportano questa opzione. + +of.options.CUSTOM_GUIS=GUI personalizzate +of.options.CUSTOM_GUIS.tooltip.1=GUI personalizzate +of.options.CUSTOM_GUIS.tooltip.2= Sì - GUI personalizzate (default), più lento +of.options.CUSTOM_GUIS.tooltip.3= No - GUI di default, più veloce +of.options.CUSTOM_GUIS.tooltip.4=Le GUI personalizzate sono supportate dall'attuale pacchetto di risorse. + +# Details + +of.options.CLOUDS=Nuvole +of.options.CLOUDS.tooltip.1=Qualità delle nuvole +of.options.CLOUDS.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.CLOUDS.tooltip.3= Veloce - peggiore qualità, migliori prestazioni +of.options.CLOUDS.tooltip.4= Dettagliata - maggiore qualità, le prestazioni peggiori +of.options.CLOUDS.tooltip.5= No - senza nuvole, prestazioni super-veloci +of.options.CLOUDS.tooltip.6= +of.options.CLOUDS.tooltip.7=Le nubi veloci si renderizzano in 2D +of.options.CLOUDS.tooltip.8=Le nubi dettagliate si renderizzano in 3D + +of.options.CLOUD_HEIGHT=Altezza nuvole +of.options.CLOUD_HEIGHT.tooltip.1=Aumento dell'altezza dello strato di nubi +of.options.CLOUD_HEIGHT.tooltip.2= No - Altezza default +of.options.CLOUD_HEIGHT.tooltip.3= Verso il limite del mondo + +of.options.TREES=Alberi +of.options.TREES.tooltip.1=Qualità delle foglie +of.options.TREES.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.TREES.tooltip.3= Veloce - bassa qualità, migliori prestazioni +of.options.TREES.tooltip.4= Intelligente - più qualità, rendimento medio +of.options.TREES.tooltip.5= Dettagliata - alta qualità, prestazioni peggiori +of.options.TREES.tooltip.6= +of.options.TREES.tooltip.7=La qualità veloce lascia le foglie senza trasparenza. +of.options.TREES.tooltip.8="Dettagliata" e "Intelligente" fanno mantenere la trasparenza. + +of.options.RAIN=Pioggia/Neve +of.options.RAIN.tooltip.1=Pioggia/Neve +of.options.RAIN.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.RAIN.tooltip.3= Rapida - pioggia / neve leggera, più veloce +of.options.RAIN.tooltip.4= Dettagliata - pioggia / neve pesante, lento +of.options.RAIN.tooltip.5= No - senza neve e pioggia, velocissimo +of.options.RAIN.tooltip.6= +of.options.RAIN.tooltip.7=Anche se la pioggia è disattivata, i suoi suoni si +of.options.RAIN.tooltip.8=possono comunque sentire. + +of.options.SKY=Cielo +of.options.SKY.tooltip.1=Cielo +of.options.SKY.tooltip.2= Sì - cielo visibile, più lento +of.options.SKY.tooltip.3= No - cielo non visibile, più veloce +of.options.SKY.tooltip.4= +of.options.SKY.tooltip.5=Anche se disabilitato, la Luna e il Sole si possono +of.options.SKY.tooltip.6=sempre vedere. + +of.options.STARS=Cielo stellato +of.options.STARS.tooltip.1=Visibilità di stelle nel cielo notturno +of.options.STARS.tooltip.2= Sì - stellato, più lento +of.options.STARS.tooltip.3= No - senza stelle, più veloce + +of.options.SUN_MOON=Sole/Luna +of.options.SUN_MOON.tooltip.1=Visibilità del Sole e della Luna +of.options.SUN_MOON.tooltip.2= Sì - Il Sole e la Luna sono visibili (lento) +of.options.SUN_MOON.tooltip.3= No - Il Sole e la Luna non sono visibili (veloce) + +of.options.SHOW_CAPES=Mantelli +of.options.SHOW_CAPES.tooltip.1=Mantelli dei giocatori +of.options.SHOW_CAPES.tooltip.2= Sì - mostrare i mantelli dei giocatori +of.options.SHOW_CAPES.tooltip.3= No - occultare i mantelli dei giocatori + +of.options.TRANSLUCENT_BLOCKS=Blocchi traslucidi +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Qualità dei blocchi traslucidi +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Dettagliata - perfetta miscela di colori (default) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rapida - miscela di colori approssimativa (più veloce) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Questa opzione riguarda i blocchi traslucidi che hanno +of.options.TRANSLUCENT_BLOCKS.tooltip.6=colore, ma solo quando posti uno dietro +of.options.TRANSLUCENT_BLOCKS.tooltip.7=l'altro ad un blocco vuoto. +of.options.TRANSLUCENT_BLOCKS.tooltip.8=Modifica: vetrate, acqua, ghiaccio ... + +of.options.HELD_ITEM_TOOLTIPS=Nome oggetto tenuto +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Mostra il nome dell'oggetto tenuto in mano +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Sì - mostra il nome (com'è tutt'ora) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= No - non mostrare il nome (come in passato) + +of.options.DROPPED_ITEMS=Oggetti a terra +of.options.DROPPED_ITEMS.tooltip.1=Qualità degli oggetti a terra non raccolti +of.options.DROPPED_ITEMS.tooltip.2= Predefinito - dipende dalle impostazioni grafiche +of.options.DROPPED_ITEMS.tooltip.3= Veloce - oggetti in 2D, più veloce ma più brutto +of.options.DROPPED_ITEMS.tooltip.4= Dettagliata - oggetti in 3D, più lento ma più bello + +options.entityShadows.tooltip.1=Ombre delle entità +options.entityShadows.tooltip.2= Sì - mostrare ombre alle entità +options.entityShadows.tooltip.3= No - non mostrare ombre alle entità + +of.options.VIGNETTE=Bordi +of.options.VIGNETTE.tooltip.1=Scurisce gli angoli dello schermo +of.options.VIGNETTE.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.VIGNETTE.tooltip.3= Bordi disattivati (più veloce) - Veloce +of.options.VIGNETTE.tooltip.4= Dettagliato - effetto vignetta (più lento) +of.options.VIGNETTE.tooltip.5= +of.options.VIGNETTE.tooltip.6=Gli FPS possono diminuire drasticamente all'attivarsi, +of.options.VIGNETTE.tooltip.7=soprattutto a schermo intero. +of.options.VIGNETTE.tooltip.8=I bordi possono essere disattivati senza problemi. + +of.options.DYNAMIC_FOV=Visione campo dinamico +of.options.DYNAMIC_FOV.tooltip.1=Visione campo dinamico +of.options.DYNAMIC_FOV.tooltip.2= Sì - attivarlo (per default) +of.options.DYNAMIC_FOV.tooltip.3= No - disattivarlo +of.options.DYNAMIC_FOV.tooltip.4=Cambiare la visione del campo dinamico (FOV) +of.options.DYNAMIC_FOV.tooltip.5=quando si corre, cammina e si usa un arco. + +of.options.DYNAMIC_LIGHTS=Illuminazione dinamica +of.options.DYNAMIC_LIGHTS.tooltip.1=Illuminazione din. +of.options.DYNAMIC_LIGHTS.tooltip.2= No - no illuminazione d. (per default) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapida - i. dinamica veloce (aggiornato ogni 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Dettagliata - i. dinamiche dettagliate (aggiornam. live) +of.options.DYNAMIC_LIGHTS.tooltip.5= +of.options.DYNAMIC_LIGHTS.tooltip.6=Permette a certi oggetti di emettere luce anche se non piazzati. +of.options.DYNAMIC_LIGHTS.tooltip.7=Quando tieni in mano uno di questi oggetti o li getti a terra +of.options.DYNAMIC_LIGHTS.tooltip.8=l'ambiente si illumina (comprende: torce, glowstone...). + +# Performance + +of.options.SMOOTH_FPS=Stabilizzazione FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizza l'FPS livellando il buffer driver grafico +of.options.SMOOTH_FPS.tooltip.2= No - senza stabilizzazione +of.options.SMOOTH_FPS.tooltip.3= Sì - con stabilizzazione +of.options.SMOOTH_FPS.tooltip.4= +of.options.SMOOTH_FPS.tooltip.5=Questa opzione dipende dalla scheda grafica +of.options.SMOOTH_FPS.tooltip.6=e il suo effetto non sempre è evidente. + +of.options.SMOOTH_WORLD=Stabilizzazione mondo +of.options.SMOOTH_WORLD.tooltip.1=Elimina i disturbi causati da lag server interno +of.options.SMOOTH_WORLD.tooltip.2= No - senza stabilizzazione +of.options.SMOOTH_WORLD.tooltip.3= Sì - con stabilizzazione +of.options.SMOOTH_WORLD.tooltip.4= +of.options.SMOOTH_WORLD.tooltip.5=Questa opzione stabilizza FPS e distribuisce +of.options.SMOOTH_WORLD.tooltip.6=il carico del server interno. +of.options.SMOOTH_WORLD.tooltip.7=Non funziona in multigiocatore. + +of.options.FAST_RENDER=Rendering veloce +of.options.FAST_RENDER.tooltip.1=Rendering veloce +of.options.FAST_RENDER.tooltip.2= No - rendering standard (lento) +of.options.FAST_RENDER.tooltip.3= Sì - rendering ottimizzato (veloce) +of.options.FAST_RENDER.tooltip.4= +of.options.FAST_RENDER.tooltip.5=Usa un algoritmo di rendering migliorato diminuendo il +of.options.FAST_RENDER.tooltip.6=consumo di GPU e aumenta gli FPS. + +of.options.FAST_MATH=Calcoli ottimizzati +of.options.FAST_MATH.tooltip.1=Calcoli ottimizzati +of.options.FAST_MATH.tooltip.2= No - standard (per default) +of.options.FAST_MATH.tooltip.3= Sì - Calcoli ottimizzati +of.options.FAST_MATH.tooltip.4= +of.options.FAST_MATH.tooltip.5=Utilizzare le funzioni sin() e cos() di Java in forma +of.options.FAST_MATH.tooltip.6=ottimizzata per migliorare l'uso della cache e della CPU +of.options.FAST_MATH.tooltip.7=per migliorare gli FPS. + +of.options.CHUNK_UPDATES=Aggiornamento dei Chunk +of.options.CHUNK_UPDATES.tooltip.1=Aggiornamento dei Chunk +of.options.CHUNK_UPDATES.tooltip.2= 1 - caricamento lento, FPS (default) +of.options.CHUNK_UPDATES.tooltip.3= 3 - caricamento più veloce, FPS bassi +of.options.CHUNK_UPDATES.tooltip.4= 5 - caricamento super-veloce, FPS molto bassi +of.options.CHUNK_UPDATES.tooltip.5= +of.options.CHUNK_UPDATES.tooltip.6=Numero di renderizzazioni chunk per frame. +of.options.CHUNK_UPDATES.tooltip.7=Valori più alti possono destabilizzare gli FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Aggiornamento dinamico +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Aggiornamento dei Chunk in modo dinamico +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= No - (default) fotogramma di carico normale +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Sì - più aggiornamenti mentre si è fermi +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4= +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=Questa opzione forza l'aggiornamento dei Chunk mentre +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=si sta fermi per caricare il mondo più velocemente. + +of.options.LAZY_CHUNK_LOADING=Caricamento casuale +of.options.LAZY_CHUNK_LOADING.tooltip.1=Caricamento dei Chunk casuale +of.options.LAZY_CHUNK_LOADING.tooltip.2= No - caricamente dei Chunk in stile default +of.options.LAZY_CHUNK_LOADING.tooltip.3= Sì - caricamento casuale Chunk (stabilizza il caricamento) +of.options.LAZY_CHUNK_LOADING.tooltip.4= +of.options.LAZY_CHUNK_LOADING.tooltip.5=Ammorbidisce il caricamento dei Chunk distribuendolo durante +of.options.LAZY_CHUNK_LOADING.tooltip.6=vari ticks. Disattiva se alcune parti del mondo +of.options.LAZY_CHUNK_LOADING.tooltip.7=non si caricano correttamente. +of.options.LAZY_CHUNK_LOADING.tooltip.8=Funziona solo su mondi locali con un core CPU. + +of.options.RENDER_REGIONS=Renderizza aree +of.options.RENDER_REGIONS.tooltip.1=Renderizza aree +of.options.RENDER_REGIONS.tooltip.2= Sì - (default) non usare renderizzazione aree +of.options.RENDER_REGIONS.tooltip.3= No - usa renderizzazione aree +of.options.RENDER_REGIONS.tooltip.4=La renderizzazione aree permette un rendering migliore +of.options.RENDER_REGIONS.tooltip.5=del terreno a grandi distanze. Meglio se il VBO è attivo. +of.options.RENDER_REGIONS.tooltip.6=Non raccomandata per schede grafiche integrate. + +of.options.SMART_ANIMATIONS=Animazioni smart +of.options.SMART_ANIMATIONS.tooltip.1=Animazioni smart +of.options.SMART_ANIMATIONS.tooltip.2= No - (default) non usare le animazioni smart +of.options.SMART_ANIMATIONS.tooltip.3= Sì - usa le animazioni smart +of.options.SMART_ANIMATIONS.tooltip.4=Con le animazioni smart attive solo le +of.options.SMART_ANIMATIONS.tooltip.5=texture visibili al giocatore saranno animate. +of.options.SMART_ANIMATIONS.tooltip.6=Vengono ridotti picchi di lag e aumentati gli FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Particolarmente utile per pacchetti di mod grandi e texture in HD. + +# Animations + +of.options.animation.allOn=TUTTI Sì +of.options.animation.allOff=TUTTI No +of.options.animation.dynamic=Dinamica + +of.options.ANIMATED_WATER=Acqua +of.options.ANIMATED_LAVA=Lava +of.options.ANIMATED_FIRE=Fuoco +of.options.ANIMATED_PORTAL=Portali +of.options.ANIMATED_REDSTONE=Redstone +of.options.ANIMATED_EXPLOSION=Esplosioni +of.options.ANIMATED_FLAME=Fuochi d'artificio +of.options.ANIMATED_SMOKE=Fumo +of.options.VOID_PARTICLES=Particelle del vuoto +of.options.WATER_PARTICLES=Particelle di acqua +of.options.RAIN_SPLASH=Pioggia +of.options.PORTAL_PARTICLES=Particelle dei portali +of.options.POTION_PARTICLES=Particelle delle pozioni +of.options.DRIPPING_WATER_LAVA=Gocce d'acqua/lava +of.options.ANIMATED_TERRAIN=Terreno animato +of.options.ANIMATED_TEXTURES=Texture animate +of.options.FIREWORK_PARTICLES=Particelle Fuochi d'artificio + +# Other + +of.options.LAGOMETER=Contatore lag +of.options.LAGOMETER.tooltip.1=Mostra il contatore di lag premendo F3 +of.options.LAGOMETER.tooltip.2=* Arancione - Cestino memoria +of.options.LAGOMETER.tooltip.3=* Ciano - Ticks +of.options.LAGOMETER.tooltip.4=* Azzurro - Eseguibili programmati +of.options.LAGOMETER.tooltip.5=* Porpora - Caricamento dei Chunk +of.options.LAGOMETER.tooltip.6=* Rosso - Aggiornamento dei Chunk +of.options.LAGOMETER.tooltip.7=* Giallo - Controllo visibilità +of.options.LAGOMETER.tooltip.8=* Verde - Terreno renderizzato + +of.options.PROFILER=Profilo di debug +of.options.PROFILER.tooltip.1=Debug +of.options.PROFILER.tooltip.2= Sì - il profilo di debug attivato, più lento +of.options.PROFILER.tooltip.3= No - il profilo di debug disattivato, più veloce +of.options.PROFILER.tooltip.4=Il profilo di debug raccoglie e visualizza maggiori +of.options.PROFILER.tooltip.5=informazioni rispetto alla funzione F3. + +of.options.WEATHER=Condizioni meteo +of.options.WEATHER.tooltip.1= Tempo (tempo atmosferico) +of.options.WEATHER.tooltip.2= Sì - tempo attivato, più lento +of.options.WEATHER.tooltip.3= No - tempo disattivato, più veloce +of.options.WEATHER.tooltip.4=Il clima controlla pioggia, neve e tempeste. +of.options.WEATHER.tooltip.5=Questa opzione non funziona in multigiocatore. + +of.options.time.dayOnly=Sempre giorno +of.options.time.nightOnly=Sempre notte + +of.options.TIME=Tempo +of.options.TIME.tooltip.1=Tempo (orario, giorno o notte) +of.options.TIME.tooltip.2= Predefinito - cicli normali giorno / notte +of.options.TIME.tooltip.3= Sempre giorno - sempre è solo giorno +of.options.TIME.tooltip.4= Sempre notte - sempre e solo notte +of.options.TIME.tooltip.5=Questa opzione funziona solo in creativa e solamente +of.options.TIME.tooltip.6=in mondi locali (NON in multigiocatore). + +options.fullscreen.tooltip.1=Schermo intero +options.fullscreen.tooltip.2= Sì - giocare a schermo intero +options.fullscreen.tooltip.3= No - giocare a schermo normale +options.fullscreen.tooltip.4=Giocare a schermo intero può essere +options.fullscreen.tooltip.5=migliore o peggiore, dipende dalla scheda grafica. + +of.options.FULLSCREEN_MODE=Risoluzione +of.options.FULLSCREEN_MODE.tooltip.1=Risoluzione dello schermo intero +of.options.FULLSCREEN_MODE.tooltip.2= Predefinito - risoluzione del monitor, più lento +of.options.FULLSCREEN_MODE.tooltip.3= Wxh - un'altra risoluzione, più efficiente +of.options.FULLSCREEN_MODE.tooltip.4=Modificare la risoluzione a schermo intero (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Normalmente il più basso incrementa le prestazioni. + +of.options.SHOW_FPS=Mostra FPS +of.options.SHOW_FPS.tooltip.1=Mostra FPS e i dati di rendering +of.options.SHOW_FPS.tooltip.2= C: - rendering dei Chunk +of.options.SHOW_FPS.tooltip.3= E: - entità rese + blocchi-entità resi +of.options.SHOW_FPS.tooltip.4= U: - aggiornamento dei Chunk +of.options.SHOW_FPS.tooltip.5= +of.options.SHOW_FPS.tooltip.6=Questi dati ridotti vengono visualizzati +of.options.SHOW_FPS.tooltip.7=solo quando non è attiva la funzione F3. + +of.options.save.default=Originale (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autosalvataggio +of.options.AUTOSAVE_TICKS.tooltip.1=Intervallo dell'autosalvataggio +of.options.AUTOSAVE_TICKS.tooltip.2=L'intervallo di gioco originale (2s) non è raccomandato. +of.options.AUTOSAVE_TICKS.tooltip.3=Un breve intervallo può influire negativamente sulle prestazioni. + +options.anaglyph.tooltip.1=Visione in 3D + +of.options.ADVANCED_TOOLTIPS=Descrizione oggetti +of.options.ADVANCED_TOOLTIPS.tooltip.1=Descrizione degli oggetti nell'inventario +of.options.ADVANCED_TOOLTIPS.tooltip.2= Sì - mostra le descrizioni +of.options.ADVANCED_TOOLTIPS.tooltip.3= No - non mostrare descrizioni (per default) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Consente di visualizzare informazioni più dettagliate +of.options.ADVANCED_TOOLTIPS.tooltip.5=su oggetti (ID, durata) e le +of.options.ADVANCED_TOOLTIPS.tooltip.6=Shaders (ID, origine, di default). + +of.options.SCREENSHOT_SIZE=Dimensione screenshot +of.options.SCREENSHOT_SIZE.tooltip.1=Grandezza screenshot +of.options.SCREENSHOT_SIZE.tooltip.2= Default - grandezza di default +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - grandezza personalizzata +of.options.SCREENSHOT_SIZE.tooltip.4=Fare screenshot più grandi richiede più memoria. +of.options.SCREENSHOT_SIZE.tooltip.5=Non compatibile con Render Veloce e Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Richiede supporto framebuffer della GPU. + +of.options.SHOW_GL_ERRORS=Errori Open GL +of.options.SHOW_GL_ERRORS.tooltip.1=Mostra Errori Open GL +of.options.SHOW_GL_ERRORS.tooltip.2=Quando abilitata mostra errori in chat. +of.options.SHOW_GL_ERRORS.tooltip.3=Disabilita solo se ci sono conflitti o per +of.options.SHOW_GL_ERRORS.tooltip.4=errori che non possono essere risolti. +of.options.SHOW_GL_ERRORS.tooltip.5=Quando disabilitato gli errori sono sempre salvati +of.options.SHOW_GL_ERRORS.tooltip.6=nel log degli errori e possono causare drop di FPS. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ja_JP.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ja_JP.lang new file mode 100644 index 0000000..55aacbb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ja_JP.lang @@ -0,0 +1,738 @@ +# Contributors of Japanese localization # +# takanasayo 2012-12-01 ---- 2013-07-15 +# CrafterKina 2014-01-04 ---- + +# General +of.general.ambiguous=不明確 +of.general.compact=コンパクト +of.general.custom=カスタム +of.general.from=由来 +of.general.id=ID +of.general.max=最大限 +of.general.restart=再起動 +of.general.smart=スマート + +# Keys +of.key.zoom=ズーム + +# Message +of.message.aa.shaders1=アンチエイリアスはシェーダーと共存できません。 +of.message.aa.shaders2=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.af.shaders1=異方性フィルタリングはシェーダーと共存できません。 +of.message.af.shaders2=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.fr.shaders1=描画の最適化はシェーダーと共存できません。 +of.message.fr.shaders2=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.an.shaders1=3Dアナグリフはシェーダーと共存できません。 +of.message.an.shaders2=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.shaders.aa1=シェーダーはアンチエイリアスと共存できません。 +of.message.shaders.aa2=品質の設定 → アンチエイリアス をオフにし、ゲームを再起動してください。 + +of.message.shaders.af1=シェーダーは異方性フィルタリングと共存できません。 +of.message.shaders.af2=品質の設定 → 異方性フィルタリング をオフにしてください。 + +of.message.shaders.fr1=シェーダーは描画の最適化と共存できません。 +of.message.shaders.fr2=演出の設定 → 描画の最適化 をオフにしてください。 + +of.message.shaders.an1=シェーダーは3Dアナグリフと共存できません。 +of.message.shaders.an2=その他の設定 → 3Dアナグリフ をオフにしてください。 + +of.message.shaders.nv1=このシェーダーパックはより新しいOptiFine (%s) を要求します。 +of.message.shaders.nv2=続行しますか? + +of.message.newVersion=新しい§eOptiFine§fが公開されました: §e%s§f +of.message.java64Bit=パフォーマンスを高めるために§e64-bit Java§fが利用できます。 +of.message.openglError=§eOpenGLエラー§f: %s (%s) + +of.message.shaders.loading=シェーダーをロード中: %s + +of.message.other.reset=全ての設定を元の状態に戻してもよろしいですか? + +of.message.loadingVisibleChunks=可視チャンクを読み込み中 + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFineマント... + +# Video settings + +options.graphics.tooltip.1=グラフィックス +options.graphics.tooltip.2= 処理優先 - 低品質、低負荷 +options.graphics.tooltip.3= 描画優先 - 高品質、高負荷 +options.graphics.tooltip.4=葉の透過、アイテムやMobの影、ドロップアイテムの3D描写、 +options.graphics.tooltip.5=厚みのある雲、水の2パスレンダリング、といったグラフィック効果を変更します。 + +of.options.renderDistance.tiny=最短 +of.options.renderDistance.short=短い +of.options.renderDistance.normal=普通 +of.options.renderDistance.far=遠い +of.options.renderDistance.extreme=過激 +of.options.renderDistance.insane=狂気 +of.options.renderDistance.ludicrous=不条理 + +options.renderDistance.tooltip.1=描画距離 +options.renderDistance.tooltip.2= 2 最短 - 32m (最低負荷) +options.renderDistance.tooltip.3= 8 普通 - 128m (普通) +options.renderDistance.tooltip.4= 16 遠い - 256m (高負荷) +options.renderDistance.tooltip.5= 32 過激 - 512m (超高負荷!) 大量のリソースを要求します +options.renderDistance.tooltip.6= 48 狂気 - 768m、2GBのメモリー割り当てが必要です +options.renderDistance.tooltip.7= 64 不条理 - 1024m、3GBのメモリー割り当てが必要です +options.renderDistance.tooltip.8=遠いを超える描画距離はシングルのワールドでのみ効果があります。 + +options.ao.tooltip.1=スムースライティング +options.ao.tooltip.2= オフ - スムースライティングを使用しない (低負荷) +options.ao.tooltip.3= 最小 - 単純なスムースライティング (高負荷) +options.ao.tooltip.4= 最大 - 複雑なスムースライティング (最高負荷) + +options.framerateLimit.tooltip.1=最大フレームレート +options.framerateLimit.tooltip.2= 垂直同期 - モニターのフレームレートに合わせる (60、30、20) +options.framerateLimit.tooltip.3= 5〜255 - フレームレートを設定した値までに制限する +options.framerateLimit.tooltip.4= 無制限 - フレームレートを制限しない (最低負荷) +options.framerateLimit.tooltip.5=たとえ制限に達していなくとも、 +options.framerateLimit.tooltip.6=フレームレートを抑制します。 +of.options.framerateLimit.vsync=垂直同期 + +of.options.AO_LEVEL=スムースライティングの程度 +of.options.AO_LEVEL.tooltip.1=スムースライティングの程度 +of.options.AO_LEVEL.tooltip.2= オフ - 影なし +of.options.AO_LEVEL.tooltip.3= 50%% - 明るい影 +of.options.AO_LEVEL.tooltip.4= 100%% - 暗い影 + +options.viewBobbing.tooltip.1=画面の揺れ +options.viewBobbing.tooltip.2=ミップマップを使う場合には、最良の結果のためにオフにしてください。 + +options.guiScale.tooltip.1=GUIの大きさ +options.guiScale.tooltip.2= 自動 - 最大サイズ +options.guiScale.tooltip.3= 小さい、普通、大きい - 1倍から3倍 +options.guiScale.tooltip.4= 4x から 10x - 4k画面で有効 +options.guiScale.tooltip.5=奇数倍 (1x、3x、5x ...) はUnicodeフォントと互換がありません。 +options.guiScale.tooltip.6=GUIは小さいほうが処理が速くなるかもしれません。 + +options.vbo=VBO の使用 +options.vbo.tooltip.1=頂点バッファオブジェクト +options.vbo.tooltip.2=描画方式を置き換え、通常より +options.vbo.tooltip.3=5〜10%%処理を軽くできます。 + +options.gamma.tooltip.1=暗い物体の明るさの変更 +options.gamma.tooltip.2= 暗い - 通常の明るさ +options.gamma.tooltip.3= 1〜99%% - 明るさを調整する +options.gamma.tooltip.4= 明るい - 最大の明るさ +options.gamma.tooltip.5=完全に黒い物体の明るさは、 +options.gamma.tooltip.6=変更できません。 + +options.anaglyph.tooltip.1=3Dアナグリフ +options.anaglyph.tooltip.2=それぞれの目に別々の色を使うことで +options.anaglyph.tooltip.3=立体視を可能にする機能を有効にします。 +options.anaglyph.tooltip.4=赤青3Dメガネが必要です。 + +of.options.ALTERNATE_BLOCKS=代替ブロック +of.options.ALTERNATE_BLOCKS.tooltip.1=代替ブロック +of.options.ALTERNATE_BLOCKS.tooltip.2=幾つかのブロックで代替モデルを使用します。 +of.options.ALTERNATE_BLOCKS.tooltip.3=選択されたリソースパックに依存します。 + +of.options.FOG_FANCY=霧の種類 +of.options.FOG_FANCY.tooltip.1=霧の種類の設定 +of.options.FOG_FANCY.tooltip.2= 処理優先 - 低負荷な霧 +of.options.FOG_FANCY.tooltip.3= 描画優先 - 高負荷な霧 より良く見える +of.options.FOG_FANCY.tooltip.4= オフ - 霧なし 最低負荷 +of.options.FOG_FANCY.tooltip.5=グラフィックカードが対応している場合のみ +of.options.FOG_FANCY.tooltip.6=美麗な霧を使用できます。 + +of.options.FOG_START=霧の距離 +of.options.FOG_START.tooltip.1=プレイヤーと霧の距離の設定 +of.options.FOG_START.tooltip.2= 0.2 - プレイヤーと霧の距離を最も近くする +of.options.FOG_START.tooltip.3= 0.8 - プレイヤーと霧の距離を最も遠くする +of.options.FOG_START.tooltip.4=この設定は概ねパフォーマンスに影響を与えません。 + +of.options.CHUNK_LOADING=チャンク読み込み +of.options.CHUNK_LOADING.tooltip.1=チャンク読み込み +of.options.CHUNK_LOADING.tooltip.2= デフォルト - チャンク読み込み時、FPSは安定しない。 +of.options.CHUNK_LOADING.tooltip.3= 滑らか - フレームレート低下を抑制。 +of.options.CHUNK_LOADING.tooltip.4= マルチコア - フレームレートのさらなる安定化、ワールドの読み込み処理が三倍ほど速くなる。 +of.options.CHUNK_LOADING.tooltip.5=滑らかやマルチコアであれば、チャンク読み込みに起因する +of.options.CHUNK_LOADING.tooltip.6=カクつきとフリーズを除けます。 +of.options.CHUNK_LOADING.tooltip.7=マルチコアでは二番目のCPUを用いることでワールドの読み込み処理が +of.options.CHUNK_LOADING.tooltip.8=三倍ほど速くでき、FPSも改善できます。 +of.options.chunkLoading.smooth=滑らか +of.options.chunkLoading.multiCore=マルチコア + +of.options.shaders=シェーダーの詳細設定... +of.options.shadersTitle=シェーダーの詳細設定 + +of.options.shaders.packNone=なし +of.options.shaders.packDefault=(内部シェーダー) + +of.options.shaders.ANTIALIASING=アンチエイリアス +of.options.shaders.ANTIALIASING.tooltip.1=アンチエイリアス +of.options.shaders.ANTIALIASING.tooltip.2= オフ - (初期値) アンチエイリアスを行わない (低負荷) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x、4x - アンチエイリアスされた輪郭 (高負荷) +of.options.shaders.ANTIALIASING.tooltip.4=FXAAは輪郭のギザギザや急激な色の変化を +of.options.shaders.ANTIALIASING.tooltip.5=滑らかにする後処理効果です。 +of.options.shaders.ANTIALIASING.tooltip.6=この機能は旧来のアンチエイリアス処理より低負荷で +of.options.shaders.ANTIALIASING.tooltip.7=シェーダーや描画の最適化機能と共存できます。 + +of.options.shaders.NORMAL_MAP=法線マップ +of.options.shaders.NORMAL_MAP.tooltip.1=法線マップ +of.options.shaders.NORMAL_MAP.tooltip.2= オン - (初期値) 法線マップを有効化 +of.options.shaders.NORMAL_MAP.tooltip.3= オフ - 法線マップを無効化 +of.options.shaders.NORMAL_MAP.tooltip.4=法線マップはシェーダーパックが平坦なモデルの表面における +of.options.shaders.NORMAL_MAP.tooltip.5=立体的な形状をシミュレーションするために用いられます。 +of.options.shaders.NORMAL_MAP.tooltip.6=法線マップテクスチャは現在使用中の +of.options.shaders.NORMAL_MAP.tooltip.7=リソースパックに依存します。 + +of.options.shaders.SPECULAR_MAP=鏡面反射マップ +of.options.shaders.SPECULAR_MAP.tooltip.1=鏡面反射マップ +of.options.shaders.SPECULAR_MAP.tooltip.2= オン - (初期値) 鏡面反射マップを有効化 +of.options.shaders.SPECULAR_MAP.tooltip.3= オフ - 鏡面反射マップを無効化 +of.options.shaders.SPECULAR_MAP.tooltip.4=鏡面反射マップはシェーダーパックが特殊な反射効果を +of.options.shaders.SPECULAR_MAP.tooltip.5=シミュレーションするために用いられます。 +of.options.shaders.SPECULAR_MAP.tooltip.6=法線マップテクスチャは現在使用中の +of.options.shaders.SPECULAR_MAP.tooltip.7=リソースパックに依存します。 + +of.options.shaders.RENDER_RES_MUL=描画の品質 +of.options.shaders.RENDER_RES_MUL.tooltip.1=描画の品質 +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - 低い (最低負荷) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - 標準 (初期値) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - 高い (最高負荷) +of.options.shaders.RENDER_RES_MUL.tooltip.5=描画の品質設定ではシェーダーパックに渡す +of.options.shaders.RENDER_RES_MUL.tooltip.6=テクスチャのサイズを制御します。 +of.options.shaders.RENDER_RES_MUL.tooltip.7=低い値は4Kディスプレイに有用でしょう。 +of.options.shaders.RENDER_RES_MUL.tooltip.8=高い値はアンチエイリアスをかけたかのように働きます。 + +of.options.shaders.SHADOW_RES_MUL=陰影の品質 +of.options.shaders.SHADOW_RES_MUL.tooltip.1=陰影の品質 +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - 低い (最低負荷) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - 標準 (初期値) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - 高い (最高負荷) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=陰影の品質設定ではシェーダーパックが用いる +of.options.shaders.SHADOW_RES_MUL.tooltip.6=シャドウマップテクスチャのサイズを制御します。 +of.options.shaders.SHADOW_RES_MUL.tooltip.7=低い値 = 厳格でない、荒い影。 +of.options.shaders.SHADOW_RES_MUL.tooltip.8=高い値 = 細密で、繊細な影。 + +of.options.shaders.HAND_DEPTH_MUL=手の遠近 +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=手の遠近 +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - カメラに近い手 +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (初期値) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - カメラから遠い手 +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=手の遠近設定では手に持ったものがカメラから +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=どれだけ遠いかを制御します。 +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=被写界深度効果を持つシェーダーパックによる +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=手に持ったもののブラーも変更します。 + +of.options.shaders.CLOUD_SHADOW=雲の影 + +of.options.shaders.OLD_HAND_LIGHT=古い手持ち光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=古い手持ち光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= デフォルト - シェーダーパックによる制御 +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= オン - 古い手持ち光源システムを用いる +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= オフ - 新たな手持ち光源システムを用いる +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=古い手持ち光源システムはメインハンドの +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=光源アイテムしか認識できないシェーダーパックを +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=オフハンドも認識できるようにします。 + +of.options.shaders.OLD_LIGHTING=古い照明効果 +of.options.shaders.OLD_LIGHTING.tooltip.1=古い照明効果 +of.options.shaders.OLD_LIGHTING.tooltip.2= デフォルト - シェーダーパックによる制御 +of.options.shaders.OLD_LIGHTING.tooltip.3= オン - 古い照明効果を用いる +of.options.shaders.OLD_LIGHTING.tooltip.4= オフ - 古い照明効果を用いない +of.options.shaders.OLD_LIGHTING.tooltip.5=古い照明効果設定ではバニラがブロックの側面に +of.options.shaders.OLD_LIGHTING.tooltip.6=適用した明かりの描画を制御します。 +of.options.shaders.OLD_LIGHTING.tooltip.7=影を扱うシェーダーパックは多くの場合 +of.options.shaders.OLD_LIGHTING.tooltip.8=太陽の位置に基づくはるかに良い影を提供します。 + +of.options.shaders.DOWNLOAD=シェーダーのダウンロード +of.options.shaders.DOWNLOAD.tooltip.1=シェーダーのダウンロード +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=シェーダーのダウンロードページをブラウザで開きます。 +of.options.shaders.DOWNLOAD.tooltip.4=ダウンロードしたシェーダーパックは「シェーダーフォルダー」に入れると +of.options.shaders.DOWNLOAD.tooltip.5=導入されたシェーダーの一覧に表示されます。 + +of.options.shaders.SHADER_PACK=シェーダーパック + +of.options.shaders.shadersFolder=シェーダーフォルダー +of.options.shaders.shaderOptions=シェーダーのオプション設定... + +of.options.shaderOptionsTitle=シェーダーのオプション設定 + +of.options.quality=品質の設定... +of.options.qualityTitle=品質 + +of.options.details=細部の設定... +of.options.detailsTitle=細部 + +of.options.performance=パフォーマンスの設定... +of.options.performanceTitle=パフォーマンス + +of.options.animations=アニメーションの設定... +of.options.animationsTitle=アニメーション + +of.options.other=その他の設定... +of.options.otherTitle=その他 + +of.options.other.reset=ビデオ設定を初期化する... + +of.shaders.profile=プロファイル + +# Quality + +of.options.mipmap.bilinear=バイリニア補間 +of.options.mipmap.linear=線形補間 +of.options.mipmap.nearest=ニアレストネイバー補間 +of.options.mipmap.trilinear=トライリニア補間 + +options.mipmapLevels.tooltip.1=遠くの物体における視覚効果を +options.mipmapLevels.tooltip.2=テクスチャのスムージングによって改善します。 +options.mipmapLevels.tooltip.3= オフ - スムージングを行わない +options.mipmapLevels.tooltip.4= 1 - 最小限のスムージング +options.mipmapLevels.tooltip.5= 最大限 - 最大限のスムージング +options.mipmapLevels.tooltip.6=この設定は概ねパフォーマンスに影響を与えません。 + +of.options.MIPMAP_TYPE=ミップマップの種類 +of.options.MIPMAP_TYPE.tooltip.1=遠くの物体における視覚効果を +of.options.MIPMAP_TYPE.tooltip.2=テクスチャのスムージングによって改善します。 +of.options.MIPMAP_TYPE.tooltip.3= ニアレストネイバー補間 - おおまかなスムージング (低負荷) +of.options.MIPMAP_TYPE.tooltip.4= 線形補間 - 通常のスムージング +of.options.MIPMAP_TYPE.tooltip.5= バイリニア補間 - 繊細なスムージング +of.options.MIPMAP_TYPE.tooltip.6= トライリニア補間 - 最高級のスムージング (高負荷) + +of.options.AA_LEVEL=アンチエイリアス +of.options.AA_LEVEL.tooltip.1=アンチエイリアス +of.options.AA_LEVEL.tooltip.2= オフ - (初期値) アンチエイリアスを行わない (低負荷) +of.options.AA_LEVEL.tooltip.3= 2〜16 - アンチエイリアスされた輪郭 (高負荷) +of.options.AA_LEVEL.tooltip.4=アンチエイリアスは輪郭のギザギザや +of.options.AA_LEVEL.tooltip.5=急激な色の変化を滑らかにします。 +of.options.AA_LEVEL.tooltip.6=有効化すると大幅にFPSが下がります。 +of.options.AA_LEVEL.tooltip.7=すべてのレベルがすべてのグラフィックカードでサポートされているわけではありません。 +of.options.AA_LEVEL.tooltip.8=有効化は再起動後です! + +of.options.AF_LEVEL=異方性フィルタリング +of.options.AF_LEVEL.tooltip.1=異方性フィルタリング +of.options.AF_LEVEL.tooltip.2= オフ - (初期値) 標準的なテクスチャの細部 (低負荷) +of.options.AF_LEVEL.tooltip.3= 2〜16 - ミップマップされたテクスチャでのより繊細な細部 (高負荷) +of.options.AF_LEVEL.tooltip.4=異方性フィルタリングはミップマップされたテクスチャの +of.options.AF_LEVEL.tooltip.5=細部を復元します。 +of.options.AF_LEVEL.tooltip.6=有効化すると大幅にFPSが下がります。 + +of.options.CLEAR_WATER=水の透過 +of.options.CLEAR_WATER.tooltip.1=水の透過 +of.options.CLEAR_WATER.tooltip.2= オン - 澄んだ透明な水 +of.options.CLEAR_WATER.tooltip.3= オフ - 普通の水 + +of.options.RANDOM_ENTITIES=ランダムエンティティ +of.options.RANDOM_ENTITIES.tooltip.1=ランダムエンティティ +of.options.RANDOM_ENTITIES.tooltip.2= オフ - ランダムなテクスチャをエンティティに用いない 低負荷 +of.options.RANDOM_ENTITIES.tooltip.3= オン - ランダムなテクスチャをエンティティに用いる 高負荷 +of.options.RANDOM_ENTITIES.tooltip.4=ランダムエンティティはランダムなテクスチャをエンティティに適用します。 +of.options.RANDOM_ENTITIES.tooltip.5=複数のエンティティテクスチャを含むリソースパックが必要です。 + +of.options.BETTER_GRASS=より良い芝生 +of.options.BETTER_GRASS.tooltip.1=より良い芝生 +of.options.BETTER_GRASS.tooltip.2= オフ - 通常の側面のテクスチャを用いる 低負荷 +of.options.BETTER_GRASS.tooltip.3= 処理優先 - 側面も草で覆う 高負荷 +of.options.BETTER_GRASS.tooltip.4= 描画優先 - 草ブロックと繋がるように側面を草で覆う 最高負荷 + +of.options.BETTER_SNOW=より良い雪 +of.options.BETTER_SNOW.tooltip.1=より良い雪 +of.options.BETTER_SNOW.tooltip.2= オフ - 通常の雪 低負荷 +of.options.BETTER_SNOW.tooltip.3= オン - より良い雪 高負荷 +of.options.BETTER_SNOW.tooltip.4=隣接したブロックに雪が積もっているものがあった時に +of.options.BETTER_SNOW.tooltip.5=透過性のあるブロック (フェンス、背の高い草) の下でも雪を描画します。 + +of.options.CUSTOM_FONTS=カスタムフォント +of.options.CUSTOM_FONTS.tooltip.1=カスタムフォント +of.options.CUSTOM_FONTS.tooltip.2= オン - カスタムフォントを使う (初期値) 高負荷 +of.options.CUSTOM_FONTS.tooltip.3= オフ - デフォルトのフォントを使う 低負荷 +of.options.CUSTOM_FONTS.tooltip.4=カスタムフォントは現在使用中の +of.options.CUSTOM_FONTS.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_COLORS=カスタムカラー +of.options.CUSTOM_COLORS.tooltip.1=カスタムカラー +of.options.CUSTOM_COLORS.tooltip.2= オン - カスタムカラーを使う (初期値) 高負荷 +of.options.CUSTOM_COLORS.tooltip.3= オフ - デフォルトの色を使う 低負荷 +of.options.CUSTOM_COLORS.tooltip.4=カスタムカラーは現在使用中の +of.options.CUSTOM_COLORS.tooltip.5=リソースパックに依存します。 + +of.options.SWAMP_COLORS=湿地帯色 +of.options.SWAMP_COLORS.tooltip.1=湿地帯色 +of.options.SWAMP_COLORS.tooltip.2= オン - 湿地帯色を使う 高負荷 +of.options.SWAMP_COLORS.tooltip.3= オフ - 湿地帯色を使わない 低負荷 +of.options.SWAMP_COLORS.tooltip.4=湿地帯色は草、葉、蔦、水に影響を与えます。 + +of.options.SMOOTH_BIOMES=滑らかなバイオーム +of.options.SMOOTH_BIOMES.tooltip.1=滑らかなバイオーム +of.options.SMOOTH_BIOMES.tooltip.2= オン - バイオームの境界を滑らかにする (初期値) 高負荷 +of.options.SMOOTH_BIOMES.tooltip.3= オフ - バイオームの境界を滑らかにしない 低負荷 +of.options.SMOOTH_BIOMES.tooltip.4=周囲の色の平均をとって +of.options.SMOOTH_BIOMES.tooltip.5=バイオーム間の境界を滑らかにします。 +of.options.SMOOTH_BIOMES.tooltip.6=草、葉、蔦、水に影響を与えます。 + +of.options.CONNECTED_TEXTURES=継ぎ目ないテクスチャ +of.options.CONNECTED_TEXTURES.tooltip.1=継ぎ目ないテクスチャ +of.options.CONNECTED_TEXTURES.tooltip.2= オフ - テクスチャの継ぎ目をなくさない (初期値) +of.options.CONNECTED_TEXTURES.tooltip.3= 処理優先 - 処理優先でテクスチャの継ぎ目をなくす +of.options.CONNECTED_TEXTURES.tooltip.4= 描画優先 - 描画優先でテクスチャの継ぎ目をなくす +of.options.CONNECTED_TEXTURES.tooltip.5=草、砂岩、本棚で隣り合ったものを +of.options.CONNECTED_TEXTURES.tooltip.6=継ぎ目なく表示します。 +of.options.CONNECTED_TEXTURES.tooltip.7=つながった状態のテクスチャは現在使用中の +of.options.CONNECTED_TEXTURES.tooltip.8=リソースパックに依存します。 + +of.options.NATURAL_TEXTURES=自然なテクスチャ +of.options.NATURAL_TEXTURES.tooltip.1=自然なテクスチャ +of.options.NATURAL_TEXTURES.tooltip.2= オフ - 自然なテクスチャを用いない (初期値) +of.options.NATURAL_TEXTURES.tooltip.3= オン - 自然なテクスチャを用いる +of.options.NATURAL_TEXTURES.tooltip.4=ブロックのテクスチャが同じ形を繰り返し、 +of.options.NATURAL_TEXTURES.tooltip.5=格子状の模様が形成される現象を除去します。 +of.options.NATURAL_TEXTURES.tooltip.6=これは基となるブロックのテクスチャを回転したり裏返したり +of.options.NATURAL_TEXTURES.tooltip.7=することで実現されます。自然なテクスチャの設定は +of.options.NATURAL_TEXTURES.tooltip.8=現在使用中のリソースパックに依存します。 + +of.options.EMISSIVE_TEXTURES=発光効果テクスチャ +of.options.EMISSIVE_TEXTURES.tooltip.1=発光効果テクスチャ +of.options.EMISSIVE_TEXTURES.tooltip.2= オフ - 発光効果テクスチャを用いない (初期値) +of.options.EMISSIVE_TEXTURES.tooltip.3= オン - 発光効果テクスチャを用いる +of.options.EMISSIVE_TEXTURES.tooltip.4=発光効果テクスチャは最大の明るさを持ったオーバーレイとして +of.options.EMISSIVE_TEXTURES.tooltip.5=描画されます。また、基となるテクスチャの +of.options.EMISSIVE_TEXTURES.tooltip.6=発光部分のシミュレーションにも用いられます。 +of.options.EMISSIVE_TEXTURES.tooltip.7=発光効果テクスチャは現在使用中の +of.options.EMISSIVE_TEXTURES.tooltip.8=リソースパックに依存します。 + +of.options.CUSTOM_SKY=カスタムスカイ +of.options.CUSTOM_SKY.tooltip.1=カスタムスカイ +of.options.CUSTOM_SKY.tooltip.2= オン - カスタムスカイを用いる (初期値) 高負荷 +of.options.CUSTOM_SKY.tooltip.3= オフ - 通常の空 低負荷 +of.options.CUSTOM_SKY.tooltip.4=カスタムスカイ用のテクスチャは現在使用中の +of.options.CUSTOM_SKY.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_ITEMS=カスタムアイテム +of.options.CUSTOM_ITEMS.tooltip.1=カスタムアイテム +of.options.CUSTOM_ITEMS.tooltip.2= オン - カスタムアイテムを用いる (初期値) 高負荷 +of.options.CUSTOM_ITEMS.tooltip.3= オフ - 通常のアイテムテクスチャを用いる 低負荷 +of.options.CUSTOM_ITEMS.tooltip.4=カスタムアイテム用のテクスチャは現在使用中の +of.options.CUSTOM_ITEMS.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_ENTITY_MODELS=カスタムエンティティモデル +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=カスタムエンティティモデル +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= オン - カスタムエンティティモデルを用いる (初期値) 、高負荷 +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= オフ - 通常のエンティティモデル、低負荷 +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=カスタムエンティティモデルは現在使用中の +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_GUIS=カスタムGUI +of.options.CUSTOM_GUIS.tooltip.1=カスタムGUI +of.options.CUSTOM_GUIS.tooltip.2= オン - カスタムGUI (初期値) 、高負荷 +of.options.CUSTOM_GUIS.tooltip.3= オフ - 通常のGUI、低負荷 +of.options.CUSTOM_GUIS.tooltip.4=カスタムGUIは現在使用中のリソースパックに依存します。 + +# Details + +of.options.CLOUDS=雲 +of.options.CLOUDS.tooltip.1=雲 +of.options.CLOUDS.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.CLOUDS.tooltip.3= 処理優先 - 低品質 低負荷 +of.options.CLOUDS.tooltip.4= 描画優先 - 高品質 高負荷 +of.options.CLOUDS.tooltip.5= オフ - 雲なし 最低負荷 +of.options.CLOUDS.tooltip.6=処理優先の雲は平面的に描画されます。 +of.options.CLOUDS.tooltip.7=描画優先の雲は立体的に描画されます。 + +of.options.CLOUD_HEIGHT=雲の高さ +of.options.CLOUD_HEIGHT.tooltip.1=雲の高さ +of.options.CLOUD_HEIGHT.tooltip.2= オフ - 通常の高さ +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - ワールドの高さ上限 + +of.options.TREES=樹 +of.options.TREES.tooltip.1=樹 +of.options.TREES.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.TREES.tooltip.3= 処理優先 - 低品質 最低負荷 +of.options.TREES.tooltip.4= スマート - 高品質 低負荷 +of.options.TREES.tooltip.5= 描画優先 - 高品質 高負荷 +of.options.TREES.tooltip.6=処理優先の木の葉は透過しません。 +of.options.TREES.tooltip.7=描画優先や賢く描画された木の葉は透過します。 + +of.options.RAIN=雨と雪 +of.options.RAIN.tooltip.1=雨と雪 +of.options.RAIN.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.RAIN.tooltip.3= 処理優先 - 小雨/小雪 低負荷 +of.options.RAIN.tooltip.4= 描画優先 - 大雨/大雪 高負荷 +of.options.RAIN.tooltip.5= オフ - 雨や雪を描画しない 最低負荷 +of.options.RAIN.tooltip.6=オフにしても地面での雨の飛び散りや雨音 +of.options.RAIN.tooltip.7=は有効のままです。 + +of.options.SKY=空 +of.options.SKY.tooltip.1=空 +of.options.SKY.tooltip.2= オン - 空を描画する 高負荷 +of.options.SKY.tooltip.3= オフ - 空を描画しない 低負荷 +of.options.SKY.tooltip.4=オフにしても太陽や月はそのままです。 + +of.options.STARS=星 +of.options.STARS.tooltip.1=星 +of.options.STARS.tooltip.2= オン - 星を描画する (初期値) +of.options.STARS.tooltip.3= オフ - 星を描画しない (低負荷) + +of.options.SUN_MOON=太陽と月 +of.options.SUN_MOON.tooltip.1=太陽と月 +of.options.SUN_MOON.tooltip.2= オン - 太陽と月を描画する (初期値) +of.options.SUN_MOON.tooltip.3= オフ - 太陽と月を描画しない (低負荷) + +of.options.SHOW_CAPES=マントの表示 +of.options.SHOW_CAPES.tooltip.1=マントの表示 +of.options.SHOW_CAPES.tooltip.2= オン - マントを表示する (初期値) +of.options.SHOW_CAPES.tooltip.3= オフ - マントを表示しない + +of.options.TRANSLUCENT_BLOCKS=半透明のブロック +of.options.TRANSLUCENT_BLOCKS.tooltip.1=半透明のブロック +of.options.TRANSLUCENT_BLOCKS.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 描画優先 - 完全なカラーブレンド (初期値) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= 処理優先 - 速さ重視のカラーブレンド (低負荷) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=違う色を持った半透明ブロック (色付きガラス、水、氷) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=が空気を挟んで隣接した際の +of.options.TRANSLUCENT_BLOCKS.tooltip.7=カラーブレンドの設定です。 + +of.options.HELD_ITEM_TOOLTIPS=持ち替え時アイテム名表示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=持ち替え時アイテム名表示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= オン - 持ち替え時にアイテム名を表示する (初期値) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= オフ - 持ち替え時にアイテム名を表示しない + +of.options.ADVANCED_TOOLTIPS=高度なツールチップ +of.options.ADVANCED_TOOLTIPS.tooltip.1=高度なツールチップ +of.options.ADVANCED_TOOLTIPS.tooltip.2= オン - 高度なツールチップを表示 +of.options.ADVANCED_TOOLTIPS.tooltip.3= オフ - 高度なツールチップを非表示 (初期値) +of.options.ADVANCED_TOOLTIPS.tooltip.4=高度なツールチップはアイテム (ID、耐久値) と +of.options.ADVANCED_TOOLTIPS.tooltip.5=シェーダーのオプション (ID、由来、初期値) において +of.options.ADVANCED_TOOLTIPS.tooltip.6=拡張された情報を表示します。 + +of.options.DROPPED_ITEMS=落ちているアイテムの表示 +of.options.DROPPED_ITEMS.tooltip.1=落ちているアイテムの表示 +of.options.DROPPED_ITEMS.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.DROPPED_ITEMS.tooltip.3= 処理優先 - 落ちているアイテムを2Dで表示する (低負荷) +of.options.DROPPED_ITEMS.tooltip.4= 描画優先 - 落ちているアイテムを3Dで表示する (高負荷) + +options.entityShadows.tooltip.1=エンティティの影 +options.entityShadows.tooltip.2= オン - エンティティの影を表示する +options.entityShadows.tooltip.3= オフ - エンティティの影を表示しない + +of.options.VIGNETTE=視界端の影 +of.options.VIGNETTE.tooltip.1=スクリーンの角を少し暗くさせる視覚効果 +of.options.VIGNETTE.tooltip.2= デフォルト - グラフィックスの設定に合わせる (初期値) +of.options.VIGNETTE.tooltip.3= 処理優先 - 視界端の影を表示しない (低負荷) +of.options.VIGNETTE.tooltip.4= 描画優先 - 視界端の影を表示する (高負荷) +of.options.VIGNETTE.tooltip.5=視界端の影はFPSにとって重要な視覚効果です。 +of.options.VIGNETTE.tooltip.6=例外としてフルスクリーンで遊ぶ際には、 +of.options.VIGNETTE.tooltip.7=視界端の影は非常に微かであるため、 +of.options.VIGNETTE.tooltip.8=無効にしても無害です。 + +of.options.DYNAMIC_FOV=臨場感ある視野角 +of.options.DYNAMIC_FOV.tooltip.1=臨場感ある視野角 +of.options.DYNAMIC_FOV.tooltip.2= オン - 臨場感ある視野角を有効化 (初期値) +of.options.DYNAMIC_FOV.tooltip.3= オフ - 臨場感ある視野角を無効化 +of.options.DYNAMIC_FOV.tooltip.4=飛翔時や、ダッシュ時、弓の引き絞り時に、 +of.options.DYNAMIC_FOV.tooltip.5=視野角 (FOV) を変えます。 + +of.options.DYNAMIC_LIGHTS=臨場感ある光源 +of.options.DYNAMIC_LIGHTS.tooltip.1=臨場感ある光源 +of.options.DYNAMIC_LIGHTS.tooltip.2= オフ - 持っている光源を光らせない (初期値) +of.options.DYNAMIC_LIGHTS.tooltip.3= 処理優先 - 500ミリ秒ごとに位置を更新する +of.options.DYNAMIC_LIGHTS.tooltip.4= 描画優先 - リアルタイムに位置を更新する +of.options.DYNAMIC_LIGHTS.tooltip.5=光源となるアイテム (松明、グローストーンなど) について、 +of.options.DYNAMIC_LIGHTS.tooltip.6=手に持っているか、他のプレイヤーが装備しているか、 +of.options.DYNAMIC_LIGHTS.tooltip.7=地上に投げ出されている時に、周囲を照らします。 + +# Performance + +of.options.SMOOTH_FPS=FPS安定化処理 +of.options.SMOOTH_FPS.tooltip.1=バッファを使ってFPSを安定化する。 +of.options.SMOOTH_FPS.tooltip.2= オフ - 安定化しない。FPSは変動的になるでしょう。 +of.options.SMOOTH_FPS.tooltip.3= オン - 安定化する。 +of.options.SMOOTH_FPS.tooltip.4=この設定はグラフィックドライバーに依存し、 +of.options.SMOOTH_FPS.tooltip.5=常には有効ではありません。 + +of.options.SMOOTH_WORLD=サーバー負荷を分散 +of.options.SMOOTH_WORLD.tooltip.1=内部サーバーによるラグの除去。 +of.options.SMOOTH_WORLD.tooltip.2= オフ - 安定化しない。FPSは変動的になるでしょう。 +of.options.SMOOTH_WORLD.tooltip.3= オン - 安定化する。 +of.options.SMOOTH_WORLD.tooltip.4=内部サーバーロードを安定化。 +of.options.SMOOTH_WORLD.tooltip.5=シングルプレイの時のみ効果があります。 + +of.options.FAST_RENDER=描画の最適化 +of.options.FAST_RENDER.tooltip.1=描画の最適化 +of.options.FAST_RENDER.tooltip.2= オフ - 通常の描画 (初期値) +of.options.FAST_RENDER.tooltip.3= オン - 最適化された描画 (低負荷) +of.options.FAST_RENDER.tooltip.4=GPUのロード回数を減らした方式によって +of.options.FAST_RENDER.tooltip.5=大幅にFPSを向上します。 +of.options.FAST_RENDER.tooltip.6=この機能はModと競合する可能性があります。 + +of.options.FAST_MATH=計算の最適化 +of.options.FAST_MATH.tooltip.1=計算の最適化 +of.options.FAST_MATH.tooltip.2= オフ - 通常の計算 (初期値) +of.options.FAST_MATH.tooltip.3= オン - 最適化された計算 +of.options.FAST_MATH.tooltip.4=最適化した三角関数を用いて +of.options.FAST_MATH.tooltip.5=CPUのキャッシュを活用しFPSを向上します。 +of.options.FAST_MATH.tooltip.6=この機能は地形生成に僅かな影響を及ぼす可能性があります。 + +of.options.CHUNK_UPDATES=チャンク読込方法 +of.options.CHUNK_UPDATES.tooltip.1=チャンク読込方法 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 高負荷なチャンク読み込み 高いFPS (初期値) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 低負荷めなチャンク読み込み 低めのFPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - 低負荷なチャンク読み込み 低いFPS +of.options.CHUNK_UPDATES.tooltip.5=1フレームごとに行われるチャンク読み込み回数を指定します。 +of.options.CHUNK_UPDATES.tooltip.6=高い値はフレームレートの不安定化を招きます。 + +of.options.CHUNK_UPDATES_DYNAMIC=動的な読み込み +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=動的な読み込み +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= オフ - 1フレームに通常の回数のチャンク読み込み処理 (初期値) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= オン - 静止中により多くの読み込む処理を行う +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=プレイヤーが静止している時に +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=素早くチャンク読み込むようになります。 + +of.options.LAZY_CHUNK_LOADING=チャンク読み込みの遅延 +of.options.LAZY_CHUNK_LOADING.tooltip.1=チャンク読み込みの遅延 +of.options.LAZY_CHUNK_LOADING.tooltip.2= オフ - 通常のサーバーチャンク読み込み +of.options.LAZY_CHUNK_LOADING.tooltip.3= オン - 遅延サーバーチャンク読み込み (滑らか) +of.options.LAZY_CHUNK_LOADING.tooltip.4=チャンク読み込み処理を数Tickに分散させることで +of.options.LAZY_CHUNK_LOADING.tooltip.5=統合サーバーのチャンク読み込み処理を滑らかにします。 +of.options.LAZY_CHUNK_LOADING.tooltip.6=ワールドの一部に欠けが発生するようならOFFにしてください。 +of.options.LAZY_CHUNK_LOADING.tooltip.7=ローカルワールド (シングルプレイヤー) の時のみ有効です。 + +of.options.RENDER_REGIONS=領域描画 +of.options.RENDER_REGIONS.tooltip.1=領域描画 +of.options.RENDER_REGIONS.tooltip.2= オフ - 領域描画を用いない (初期値) +of.options.RENDER_REGIONS.tooltip.3= オン - 領域描画を用いる +of.options.RENDER_REGIONS.tooltip.4=領域描画は描画距離が広い場合に素早い地形描画を可能にします。 +of.options.RENDER_REGIONS.tooltip.5=頂点バッファオブジェクトが有効な場合に、より効果的です。 +of.options.RENDER_REGIONS.tooltip.6=オンボードグラフィックカードでは推奨されません。 + +of.options.SMART_ANIMATIONS=スマートアニメーション +of.options.SMART_ANIMATIONS.tooltip.1=スマートアニメーション +of.options.SMART_ANIMATIONS.tooltip.2= オフ - スマートアニメーションを用いない (初期値) +of.options.SMART_ANIMATIONS.tooltip.3= オン - スマートアニメーションを用いる +of.options.SMART_ANIMATIONS.tooltip.4=スマートアニメーションを使えばテクスチャのアニメーション処理は +of.options.SMART_ANIMATIONS.tooltip.5=見える範囲でのみ行われるようになります。 +of.options.SMART_ANIMATIONS.tooltip.6=ラグを減らし、FPSを増やすことができます。 +of.options.SMART_ANIMATIONS.tooltip.7=特に、大きなModパックや高解像度のリソースパックに対して有用でしょう。 + +# Animations + +of.options.animation.allOn=全てオン +of.options.animation.allOff=全てオフ +of.options.animation.dynamic=動的 + +of.options.ANIMATED_WATER=水 +of.options.ANIMATED_LAVA=溶岩 +of.options.ANIMATED_FIRE=炎 +of.options.ANIMATED_PORTAL=ネザーゲート +of.options.ANIMATED_REDSTONE=レッドストーン +of.options.ANIMATED_EXPLOSION=爆発 +of.options.ANIMATED_FLAME=松明やかまど +of.options.ANIMATED_SMOKE=煙 +of.options.VOID_PARTICLES=奈落のパーティクル +of.options.WATER_PARTICLES=水中のパーティクル +of.options.RAIN_SPLASH=雨の水しぶき +of.options.PORTAL_PARTICLES=ポータルのパーティクル +of.options.POTION_PARTICLES=ポーションのパーティクル +of.options.DRIPPING_WATER_LAVA=水/溶岩の滴り +of.options.ANIMATED_TERRAIN=地形アニメーション +of.options.ANIMATED_TEXTURES=テクスチャアニメーション +of.options.FIREWORK_PARTICLES=花火のパーティクル + +# Other + +of.options.LAGOMETER=ラグメーター +of.options.LAGOMETER.tooltip.1=デバッグ画面 (F3) にラグメーターを表示する。 +of.options.LAGOMETER.tooltip.2=* 橙 - ガベージコレクション +of.options.LAGOMETER.tooltip.3=* 藍 - Tick処理 +of.options.LAGOMETER.tooltip.4=* 青 - スケジューリングされた処理 +of.options.LAGOMETER.tooltip.5=* 紫 - チャンクアップローディング +of.options.LAGOMETER.tooltip.6=* 赤 - チャンクアップデート +of.options.LAGOMETER.tooltip.7=* 黄 - 描画確認 +of.options.LAGOMETER.tooltip.8=* 緑 - 地形描画 + +of.options.PROFILER=デバッグプロファイラ +of.options.PROFILER.tooltip.1=デバッグプロファイラ +of.options.PROFILER.tooltip.2= オン - デバッグプロファイラは有効 高負荷 +of.options.PROFILER.tooltip.3= オフ - デバッグプロファイラは無効 低負荷 +of.options.PROFILER.tooltip.4=デバッグ画面 (F3) が開かれている時に +of.options.PROFILER.tooltip.5=デバッグ情報を収集し円グラフ上に表示します。 + +of.options.WEATHER=天候 +of.options.WEATHER.tooltip.1=天候 +of.options.WEATHER.tooltip.2= オン - 天候あり 高負荷 +of.options.WEATHER.tooltip.3= オフ - 天候なし 低負荷 +of.options.WEATHER.tooltip.4=天候コントロール機能の有効/無効。 +of.options.WEATHER.tooltip.5=シングルプレイでのみ有効。 + +of.options.time.dayOnly=昼のみ +of.options.time.nightOnly=夜のみ + +of.options.TIME=クリエイティブの時刻 +of.options.TIME.tooltip.1=クリエイティブの時刻 +of.options.TIME.tooltip.2= デフォルト - 通常の昼夜サイクル +of.options.TIME.tooltip.3= 昼のみ - 昼のみ +of.options.TIME.tooltip.4= 夜のみ - 夜のみ +of.options.TIME.tooltip.5=クリエイティブモードで +of.options.TIME.tooltip.6=シングルプレイの時のみ有効。 + +options.fullscreen.tooltip.1=フルスクリーン +options.fullscreen.tooltip.2= オン - フルスクリーンモード +options.fullscreen.tooltip.3= オフ - ウィンドウモード +options.fullscreen.tooltip.4=フルスクリーンでの処理の速さは +options.fullscreen.tooltip.5=グラフィックボードに左右されます。 + +of.options.FULLSCREEN_MODE=フルスクリーンの種類 +of.options.FULLSCREEN_MODE.tooltip.1=フルスクリーンの種類 +of.options.FULLSCREEN_MODE.tooltip.2= デフォルト - デスクトップスクリーンの解像度 高負荷 +of.options.FULLSCREEN_MODE.tooltip.3= 幅x高 - カスタム解像度 おそらく低負荷 +of.options.FULLSCREEN_MODE.tooltip.4=フルスクリーンモードにて使用される解像度です。 +of.options.FULLSCREEN_MODE.tooltip.5=低い解像度では一般的に、より速くなるでしょう。 + +of.options.SHOW_FPS=FPSを表示 +of.options.SHOW_FPS.tooltip.1=コンパクトなFPSと描画情報を表示 +of.options.SHOW_FPS.tooltip.2= FPS - 平均/最小 +of.options.SHOW_FPS.tooltip.3= C: - チャンク描画 +of.options.SHOW_FPS.tooltip.4= E: - エンティティ描画 +of.options.SHOW_FPS.tooltip.5= U: - チャンクアップデート +of.options.SHOW_FPS.tooltip.6=コンパクトなFPS情報は +of.options.SHOW_FPS.tooltip.7=デバッグ画面が非表示の時のみ表示されます。 + +of.options.save.45s=45秒 +of.options.save.90s=90秒 +of.options.save.3min=3分 +of.options.save.6min=6分 +of.options.save.12min=12分 +of.options.save.24min=24分 + +of.options.AUTOSAVE_TICKS=オートセーブ +of.options.AUTOSAVE_TICKS.tooltip.1=セーブ間隔 +of.options.AUTOSAVE_TICKS.tooltip.2= 45秒 - デフォルト +of.options.AUTOSAVE_TICKS.tooltip.3=描画距離によってはオートセーブはラグを引き起こします。 +of.options.AUTOSAVE_TICKS.tooltip.4=ゲームメニューを開いた際にもワールドはセーブされます。 + +of.options.SCREENSHOT_SIZE=スクリーンショットのサイズ +of.options.SCREENSHOT_SIZE.tooltip.1=スクリーンショットのサイズ +of.options.SCREENSHOT_SIZE.tooltip.2= デフォルト - 通常の大きさ +of.options.SCREENSHOT_SIZE.tooltip.3= 2x〜4x - 任意の大きさ +of.options.SCREENSHOT_SIZE.tooltip.4=より大きなスクリーンショットの撮影には、より多くのメモリが必要です。 +of.options.SCREENSHOT_SIZE.tooltip.5=描画の最適化、アンチエイリアスとは共存できません。 +of.options.SCREENSHOT_SIZE.tooltip.6=GPUがフレームバッファをサポートしている必要があります。 + +of.options.SHOW_GL_ERRORS=OpenGLエラーの表示 +of.options.SHOW_GL_ERRORS.tooltip.1=OpenGLエラーの表示 +of.options.SHOW_GL_ERRORS.tooltip.2=有効な場合、チャットにOpenGLのエラーが表示されます。 +of.options.SHOW_GL_ERRORS.tooltip.3=既知の競合や修正不可能なエラーである場合に限り +of.options.SHOW_GL_ERRORS.tooltip.4=無効にしてください。 +of.options.SHOW_GL_ERRORS.tooltip.5=無効にしてもエラーはエラーログに記載されるままであり +of.options.SHOW_GL_ERRORS.tooltip.6=大幅なFPSの下降の原因となり続けます。 + +# Chat Settings + +of.options.CHAT_BACKGROUND=チャット欄 +of.options.CHAT_BACKGROUND.tooltip.1=チャット欄 +of.options.CHAT_BACKGROUND.tooltip.2= デフォルト - 固定幅 +of.options.CHAT_BACKGROUND.tooltip.3= コンパクト - 行の幅に合わせる +of.options.CHAT_BACKGROUND.tooltip.4= オフ - なし + +of.options.CHAT_SHADOW=チャットの影 +of.options.CHAT_SHADOW.tooltip.1=チャットの影 +of.options.CHAT_SHADOW.tooltip.2= オン - テキストに影をつける +of.options.CHAT_SHADOW.tooltip.3= オフ - テキストに影をつけない diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ko_KR.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ko_KR.lang new file mode 100644 index 0000000..008f815 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ko_KR.lang @@ -0,0 +1,592 @@ +# Contributors of Korean localization # +# auth ---- 2017-06-09 ---- 2017-06-24 +# Final Child ---- 2017-06-09 ---- 2017-06-24 +# SRA PLY ---- 2017-06-09 ---- 2017-06-24 + +# General +of.general.ambiguous=불분명 +of.general.custom=맞춤 +of.general.from=출처 +of.general.id=아이디 +of.general.restart=재시작 +of.general.smart=멋지게 + +# Keys +of.key.zoom=확대 + +# Message +of.message.aa.shaders1=안티에일리어싱은 셰이더와 호환되지 않습니다. +of.message.aa.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.af.shaders1=비등방성 필터링은 셰이더와 호환되지 않습니다. +of.message.af.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.fr.shaders1=빠른 렌더는 셰이더와 호환되지 않습니다. +of.message.fr.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.an.shaders1=3D 애너글리프는 셰이더와 호환되지 않습니다. +of.message.an.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.shaders.aa1=셰이더는 안티에일리어싱과 호환되지 않습니다. +of.message.shaders.aa2=품질 > 안티에일리어싱을 꺼짐으로 설정한 후 게임을 다시 시작해 주십시오. + +of.message.shaders.af1=셰이더는 비등방성 필터링과 호환되지 않습니다. +of.message.shaders.af2=품질 > 비등방성 필터링을 꺼짐으로 설정해 주십시오. + +of.message.shaders.fr1=셰이더는 빠른 렌더와 호환되지 않습니다. +of.message.shaders.fr2=성능 > 빠른 렌더를 꺼짐으로 설정해 주십시오. + +of.message.shaders.an1=셰이더는 3D 애너글리프와 호환되지 않습니다. +of.message.shaders.an2=기타 > 3D 애너글리프를 꺼짐으로 설정해 주십시오. + +of.message.newVersion=새로운 §eOptiFine§f 버전을 사용할 수 있습니다: §e%s§f +of.message.java64Bit=§e64비트 Java§f를 설치해 성능을 향상할 수 있습니다. +of.message.openglError=§eOpenGL 오류§f: %s (%s) + +of.message.shaders.loading=셰이더 불러오는 중: %s + +of.message.other.reset=모든 비디오 설정을 기본값으로 재설정하시겠습니까? + +of.message.loadingVisibleChunks=보이는 청크 불러오는 중 + +# Video settings + +options.graphics.tooltip.1=시각 품질 +options.graphics.tooltip.2= 빠르게 - 낮은 품질, 빠름 +options.graphics.tooltip.3= 화려하게 - 높은 품질, 느림 +options.graphics.tooltip.4=구름, 잎, 물, 그림자, 풀의 +options.graphics.tooltip.5=외형을 변경합니다. + +of.options.renderDistance.tiny=아주 작게 +of.options.renderDistance.short=짧게 +of.options.renderDistance.normal=보통 +of.options.renderDistance.far=멀리 +of.options.renderDistance.extreme=극도 + +options.renderDistance.tooltip.1=시야 거리 +options.renderDistance.tooltip.2= 2 아주 작게 - 32m (가장 빠름) +options.renderDistance.tooltip.3= 4 짧게 - 64m (빠름) +options.renderDistance.tooltip.4= 8 보통 - 128m +options.renderDistance.tooltip.5= 16 멀리 - 256m (느림) +options.renderDistance.tooltip.6= 32 극도 - 512m (가장 느림!) +options.renderDistance.tooltip.7=극도 시야 거리는 상당한 성능이 요구됩니다! +options.renderDistance.tooltip.8=16 멀리를 넘는 값은 로컬 세계에서만 효과가 있습니다. + +options.ao.tooltip.1=부드러운 조명 효과 +options.ao.tooltip.2= 꺼짐 - 부드러운 조명 효과 없음 (빠름) +options.ao.tooltip.3= 최소 - 간단한 부드러운 조명 효과 (느림) +options.ao.tooltip.4= 최대 - 복잡한 부드러운 조명 효과 (가장 느림) + +options.framerateLimit.tooltip.1=최대 프레임률 +options.framerateLimit.tooltip.2= VSync - 모니터 프레임률로 제한 (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - 조절 가능 +options.framerateLimit.tooltip.4= 무제한 - 제한 없음 (가장 빠름) +options.framerateLimit.tooltip.5=프레임률 제한은 제한 값에 도달하지 않았을 때도 +options.framerateLimit.tooltip.6=FPS를 감소시킵니다. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=부드러운 조명 효과 레벨 +of.options.AO_LEVEL.tooltip.1=부드러운 조명 효과 레벨 +of.options.AO_LEVEL.tooltip.2= 꺼짐 - 그림자 없음 +of.options.AO_LEVEL.tooltip.3= 50%% - 옅은 그림자 +of.options.AO_LEVEL.tooltip.4= 100%% - 짙은 그림자 + +options.viewBobbing.tooltip.1=더 사실적인 움직임. +options.viewBobbing.tooltip.2=밉맵을 사용할 때 최상의 결과를 위해 밉맵을 꺼짐으로 설정하십시오. + +options.guiScale.tooltip.1=GUI 크기 +options.guiScale.tooltip.2= 자동 - 최대 크기 +options.guiScale.tooltip.3= 작게, 보통, 크게 - 1x에서 3x까지 +options.guiScale.tooltip.4= 4x에서 10x까지 - 4K 디스플레이에서 사용 가능 +options.guiScale.tooltip.5=홀수 값(1x, 3x, 5x ...)은 유니코드와 호환되지 않습니다. +options.guiScale.tooltip.6=작은 GUI가 빠를 수 있습니다. + +options.vbo=VBO 사용 +options.vbo.tooltip.1=정점 버퍼 객체 +options.vbo.tooltip.2=기본 렌더링보다 보통 빠른 (5-10%%) +options.vbo.tooltip.3=다른 렌더링 모델을 사용합니다. + +options.gamma.tooltip.1=어두운 물체의 밝기를 바꿉니다. +options.gamma.tooltip.2= 어둡게 - 표준 밝기 +options.gamma.tooltip.3= 1-99%% - 조절 가능 +options.gamma.tooltip.4= 밝게 - 어두운 물체를 최대 밝기로 +options.gamma.tooltip.5=이 설정은 완전히 검은 물체의 밝기를 +options.gamma.tooltip.6=변경하지는 않습니다. + +options.anaglyph.tooltip.1=3D 애너글리프 +options.anaglyph.tooltip.2=양쪽 눈에 다른 색상을 사용함으로써 +options.anaglyph.tooltip.3=입체적인 3D 효과를 낼 수 있습니다. +options.anaglyph.tooltip.4=올바르게 보기 위해서는 적청 안경이 필요합니다. + +of.options.ALTERNATE_BLOCKS=대체 블록 +of.options.ALTERNATE_BLOCKS.tooltip.1=대체 블록 +of.options.ALTERNATE_BLOCKS.tooltip.2=몇몇 블록에 대체 블록 모델을 사용합니다. +of.options.ALTERNATE_BLOCKS.tooltip.3=선택한 리소스 팩에 따라 달라집니다. + +of.options.FOG_FANCY=안개 +of.options.FOG_FANCY.tooltip.1=안개 유형 +of.options.FOG_FANCY.tooltip.2= 빠르게 - 빠른 안개 +of.options.FOG_FANCY.tooltip.3= 화려하게 - 느린 안개, 좋아 보임 +of.options.FOG_FANCY.tooltip.4= 꺼짐 - 안개 없음, 가장 빠름 +of.options.FOG_FANCY.tooltip.5=화려한 안개는 지원되는 그래픽 카드에서만 +of.options.FOG_FANCY.tooltip.6=사용할 수 있습니다. + +of.options.FOG_START=안개 시작 +of.options.FOG_START.tooltip.1=안개 시작 +of.options.FOG_START.tooltip.2= 0.2 - 안개가 플레이어 가까이에서 시작함 +of.options.FOG_START.tooltip.3= 0.8 - 안개가 플레이어에서 멀리 떨어진 곳부터 시작함 +of.options.FOG_START.tooltip.4=이 설정은 보통 성능에 영향을 주지 않습니다. + +of.options.CHUNK_LOADING=청크 불러오기 +of.options.CHUNK_LOADING.tooltip.1=청크 불러오기 +of.options.CHUNK_LOADING.tooltip.2= 기본 - 청크를 불러올 때 불안정한 FPS +of.options.CHUNK_LOADING.tooltip.3= 부드럽게 - 안정적인 FPS +of.options.CHUNK_LOADING.tooltip.4= 멀티코어 - 안정적인 FPS, 3배 빠른 세계 불러오기 +of.options.CHUNK_LOADING.tooltip.5=부드럽게와 멀티코어는 청크를 불러오는 중 발생하는 +of.options.CHUNK_LOADING.tooltip.6=버벅거림 및 멈춤 현상을 제거합니다. +of.options.CHUNK_LOADING.tooltip.7=멀티코어는 두 번째 CPU를 사용하여 +of.options.CHUNK_LOADING.tooltip.8=3배 빠르게 세계를 불러오고 FPS를 늘릴 수 있습니다. +of.options.chunkLoading.smooth=부드럽게 +of.options.chunkLoading.multiCore=멀티코어 + +of.options.shaders=셰이더... +of.options.shadersTitle=셰이더 + +of.options.shaders.packNone=꺼짐 +of.options.shaders.packDefault=(내부) + +of.options.shaders.ANTIALIASING=안티에일리어싱 +of.options.shaders.NORMAL_MAP=법선 맵 +of.options.shaders.SPECULAR_MAP=반사 맵 +of.options.shaders.RENDER_RES_MUL=렌더 품질 +of.options.shaders.SHADOW_RES_MUL=그림자 품질 +of.options.shaders.HAND_DEPTH_MUL=손 깊이 +of.options.shaders.CLOUD_SHADOW=구름 그림자 +of.options.shaders.OLD_HAND_LIGHT=구 손 조명 +of.options.shaders.OLD_LIGHTING=구 조명 +of.options.shaders.SHADER_PACK=셰이더 팩 + +of.options.shaders.shadersFolder=셰이더 폴더 +of.options.shaders.shaderOptions=셰이더 설정... + +of.options.shaderOptionsTitle=셰이더 설정 + +of.options.quality=품질... +of.options.qualityTitle=품질 설정 + +of.options.details=세부... +of.options.detailsTitle=세부 설정 + +of.options.performance=성능... +of.options.performanceTitle=성능 설정 + +of.options.animations=애니메이션... +of.options.animationsTitle=애니메이션 설정 + +of.options.other=기타... +of.options.otherTitle=기타 설정 + +of.options.other.reset=비디오 설정 초기화... + +of.shaders.profile=프로필 + +# Quality + +of.options.mipmap.bilinear=쌍선형 +of.options.mipmap.linear=선형 +of.options.mipmap.nearest=가장 가까움 +of.options.mipmap.trilinear=삼선형 + +options.mipmapLevels.tooltip.1=세부 텍스처를 부드럽게 해 +options.mipmapLevels.tooltip.2=멀리 있는 물체를 더 좋아 보이게 하는 시각 효과입니다. +options.mipmapLevels.tooltip.3= 꺼짐 - 부드러움 효과 없음 +options.mipmapLevels.tooltip.4= 1 - 최소 부드러움 효과 +options.mipmapLevels.tooltip.5= 4 - 최대 부드러움 효과 +options.mipmapLevels.tooltip.6=이 설정은 성능에 영향을 주지 않습니다. + +of.options.MIPMAP_TYPE=밉맵 유형 +of.options.MIPMAP_TYPE.tooltip.1=세부 텍스처를 부드럽게 해 +of.options.MIPMAP_TYPE.tooltip.2=멀리 있는 물체를 더 좋아 보이게 하는 시각 효과입니다. +of.options.MIPMAP_TYPE.tooltip.3= 가장 가까움 - 거친 부드러움 효과 (가장 빠름) +of.options.MIPMAP_TYPE.tooltip.4= 선형 - 보통 부드러움 효과 +of.options.MIPMAP_TYPE.tooltip.5= 쌍선형 - 좋은 부드러움 효과 +of.options.MIPMAP_TYPE.tooltip.6= 삼선형 - 가장 좋은 부드러움 효과 (가장 느림) + + +of.options.AA_LEVEL=안티에일리어싱 +of.options.AA_LEVEL.tooltip.1=안티에일리어싱 +of.options.AA_LEVEL.tooltip.2= 꺼짐 - (기본) 안티에일리어싱 없음 (빠름) +of.options.AA_LEVEL.tooltip.3= 2-16 - 선과 모서리를 안티에일리어싱 (느림) +of.options.AA_LEVEL.tooltip.4=안티에일리어싱은 삐죽삐죽한 선과 +of.options.AA_LEVEL.tooltip.5=급격한 색상 변화를 부드럽게 합니다. +of.options.AA_LEVEL.tooltip.6=이 기능을 켤 경우 FPS가 상당히 감소할 수 있습니다. +of.options.AA_LEVEL.tooltip.7=모든 그래픽 카드가 모든 레벨을 지원하지는 않습니다. +of.options.AA_LEVEL.tooltip.8=재시작 후 적용됩니다! + +of.options.AF_LEVEL=비등방성 필터링 +of.options.AF_LEVEL.tooltip.1=비등방성 필터링 +of.options.AF_LEVEL.tooltip.2= 꺼짐 - (기본) 표준 세부 텍스처 (빠름) +of.options.AF_LEVEL.tooltip.3= 2-16 - 밉맵된 텍스처에서 더 나은 세부 텍스처 (느림) +of.options.AF_LEVEL.tooltip.4=비등방성 필터링은 밉맵된 텍스처의 +of.options.AF_LEVEL.tooltip.5=세부 양식을 복원합니다. +of.options.AF_LEVEL.tooltip.6=이 기능을 켤 경우 FPS가 상당히 감소할 수 있습니다. + +of.options.CLEAR_WATER=맑은 물 +of.options.CLEAR_WATER.tooltip.1=맑은 물 +of.options.CLEAR_WATER.tooltip.2= 켜짐 - 맑고 투명한 물 +of.options.CLEAR_WATER.tooltip.3= 꺼짐 - 기본 물 + +of.options.RANDOM_ENTITIES=무작위 몹 +of.options.RANDOM_ENTITIES.tooltip.1=무작위 몹 +of.options.RANDOM_ENTITIES.tooltip.2= 꺼짐 - 무작위 몹 없음, 빠름 +of.options.RANDOM_ENTITIES.tooltip.3= 켜짐 - 무작위 몹, 느림 +of.options.RANDOM_ENTITIES.tooltip.4=무작위 몹은 게임의 생명체에 무작위 텍스처를 사용합니다. +of.options.RANDOM_ENTITIES.tooltip.5=다수의 몹 텍스처가 있는 리소스 팩이 필요합니다. + +of.options.BETTER_GRASS=잔디 개선 +of.options.BETTER_GRASS.tooltip.1=잔디 개선 +of.options.BETTER_GRASS.tooltip.2= 꺼짐 - 기본 측면 잔디 텍스처, 가장 빠름 +of.options.BETTER_GRASS.tooltip.3= 빠르게 - 전체 측면 잔디 텍스처, 느림 +of.options.BETTER_GRASS.tooltip.4= 화려하게 - 동적 측면 잔디 텍스처, 가장 느림 + +of.options.BETTER_SNOW=눈 개선 +of.options.BETTER_SNOW.tooltip.1=눈 개선 +of.options.BETTER_SNOW.tooltip.2= 꺼짐 - 기본 눈, 빠름 +of.options.BETTER_SNOW.tooltip.3= 켜짐 - 눈 개선, 느림 +of.options.BETTER_SNOW.tooltip.4=투명한 블록(울타리, 큰 잔디)이 눈 블록과 접할 때 +of.options.BETTER_SNOW.tooltip.5=눈을 투명한 블록 밑에 보이게 합니다. + +of.options.CUSTOM_FONTS=맞춤 폰트 +of.options.CUSTOM_FONTS.tooltip.1=맞춤 폰트 +of.options.CUSTOM_FONTS.tooltip.2= 켜짐 - 맞춤 글꼴 사용 (기본), 느림 +of.options.CUSTOM_FONTS.tooltip.3= 꺼짐 - 기본 글꼴 사용, 빠름 +of.options.CUSTOM_FONTS.tooltip.4=맞춤 폰트는 현재 리소스 팩이 +of.options.CUSTOM_FONTS.tooltip.5=제공합니다. + +of.options.CUSTOM_COLORS=맞춤 색깔 +of.options.CUSTOM_COLORS.tooltip.1=맞춤 색깔 +of.options.CUSTOM_COLORS.tooltip.2= 켜짐 - 맞춤 색깔 사용 (기본), 느림 +of.options.CUSTOM_COLORS.tooltip.3= 꺼짐 - 기본 색깔 사용, 빠름 +of.options.CUSTOM_COLORS.tooltip.4=맞춤 색깔은 현재 리소스팩이 +of.options.CUSTOM_COLORS.tooltip.5=제공합니다. + +of.options.SWAMP_COLORS=늪 색깔 +of.options.SWAMP_COLORS.tooltip.1=늪 색깔 +of.options.SWAMP_COLORS.tooltip.2= 켜짐 - 늪 색깔 사용 (기본), 느림 +of.options.SWAMP_COLORS.tooltip.3= 꺼짐 - 늪 색깔 사용하지 않음, 빠름 +of.options.SWAMP_COLORS.tooltip.4=늪 색깔은 잔디와 잎, 덩굴, 물에 영향을 줍니다. + +of.options.SMOOTH_BIOMES=부드러운 생물군계 +of.options.SMOOTH_BIOMES.tooltip.1=부드러운 생물군계 +of.options.SMOOTH_BIOMES.tooltip.2= 켜짐 - 생물군계 경계를 부드럽게 함 (기본), 느림 +of.options.SMOOTH_BIOMES.tooltip.3= 꺼짐 - 생물군계 경계를 부드럽게 하지 않음, 빠름 +of.options.SMOOTH_BIOMES.tooltip.4=주위 블록의 색깔을 샘플링하고 평균화해 +of.options.SMOOTH_BIOMES.tooltip.5=바이옴 경계를 부드럽게 합니다. +of.options.SMOOTH_BIOMES.tooltip.6=잔디, 잎, 덩굴과 물에 영향을 줍니다. + +of.options.CONNECTED_TEXTURES=텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.1=텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.2= 꺼짐 - 텍스처 연결 없음 (기본) +of.options.CONNECTED_TEXTURES.tooltip.3= 빠르게 - 빠른 텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.4= 화려하게 - 화려한 텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.5=잔디와 사암, 책장이 서로의 옆에 놓인 경우 +of.options.CONNECTED_TEXTURES.tooltip.6=텍스처를 연결합니다. +of.options.CONNECTED_TEXTURES.tooltip.7=텍스처 연결은 +of.options.CONNECTED_TEXTURES.tooltip.8=현재 리소스 팩이 제공합니다. + +of.options.NATURAL_TEXTURES=자연스러운 텍스처 +of.options.NATURAL_TEXTURES.tooltip.1=자연스러운 텍스처 +of.options.NATURAL_TEXTURES.tooltip.2= 꺼짐 - 자연스러운 텍스처 없음 (기본) +of.options.NATURAL_TEXTURES.tooltip.3= 켜짐 - 자연스러운 텍스처 사용 +of.options.NATURAL_TEXTURES.tooltip.4=자연스러운 텍스처는 동일한 블록의 반복으로 인해 +of.options.NATURAL_TEXTURES.tooltip.5=생기는 격자 무늬를 제거합니다. +of.options.NATURAL_TEXTURES.tooltip.6=회전하거나 뒤집은 기본 블록 텍스처 +of.options.NATURAL_TEXTURES.tooltip.7=변종을 사용합니다. 자연스러운 텍스처의 설정은 +of.options.NATURAL_TEXTURES.tooltip.8=현재 리소스팩이 제공합니다. + +of.options.CUSTOM_SKY=맞춤 하늘 +of.options.CUSTOM_SKY.tooltip.1=맞춤 하늘 +of.options.CUSTOM_SKY.tooltip.2= 켜짐 - 맞춤 하늘 텍스처 (기본), 느림 +of.options.CUSTOM_SKY.tooltip.3= 꺼짐 - 기본 하늘, 빠름 +of.options.CUSTOM_SKY.tooltip.4=기본 하늘 텍스처는 현재 리소스 팩이 +of.options.CUSTOM_SKY.tooltip.5=제공합니다. + +of.options.CUSTOM_ITEMS=맞춤 아이템 +of.options.CUSTOM_ITEMS.tooltip.1=맞춤 아이템 +of.options.CUSTOM_ITEMS.tooltip.2= 켜짐 - 맞춤 아이템 텍스처 (기본), 느림 +of.options.CUSTOM_ITEMS.tooltip.3= 꺼짐 - 기본 아이템 텍스처, 빠름 +of.options.CUSTOM_ITEMS.tooltip.4=맞춤 아이템 텍스처는 현재 리소스팩이 +of.options.CUSTOM_ITEMS.tooltip.5=제공합니다. + +of.options.CUSTOM_ENTITY_MODELS=맞춤 개체 모델 +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=맞춤 개체 모델 +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= 켜짐 - 맞춤 개체 모델 (기본), 느림 +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= 꺼짐 - 기본 개체 모델, 빠름 +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=맞춤 개체 모델은 현재 리소스팩이 +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=제공합니다. + +# Details + +of.options.CLOUDS=구름 +of.options.CLOUDS.tooltip.1=구름 +of.options.CLOUDS.tooltip.2= 기본 - 그래픽 설정대로 +of.options.CLOUDS.tooltip.3= 빠르게 - 더 낮은 품질, 빠름 +of.options.CLOUDS.tooltip.4= 화려하게 - 더 높은 품질, 느림 +of.options.CLOUDS.tooltip.5= 꺼짐 - 구름 없음, 가장 빠름 +of.options.CLOUDS.tooltip.6=빠르게 구름은 2D로 렌더됩니다. +of.options.CLOUDS.tooltip.7=화려하게 구름은 3D로 렌더됩니다. + +of.options.CLOUD_HEIGHT=구름 높이 +of.options.CLOUD_HEIGHT.tooltip.1=구름 높이 +of.options.CLOUD_HEIGHT.tooltip.2= 꺼짐 - 기본 높이 +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - 세계 높이 제한보다 위 + +of.options.TREES=나무 +of.options.TREES.tooltip.1=나무 +of.options.TREES.tooltip.2= 기본 - 그래픽 설정대로 +of.options.TREES.tooltip.3= 빠르게 - 더 낮은 품질, 더 빠름 +of.options.TREES.tooltip.4= 멋지게 - 더 높은 품질, 빠름 +of.options.TREES.tooltip.5= 화려하게 - 가장 높은 품질, 느림 +of.options.TREES.tooltip.6=빠르게로 설정하면 나뭇잎이 불투명해집니다. +of.options.TREES.tooltip.7=화려하게, 멋지게로 설정하면 나뭇잎이 투명해집니다. + +of.options.RAIN=비와 눈 +of.options.RAIN.tooltip.1=비와 눈 +of.options.RAIN.tooltip.2= 기본 - 그래픽 설정대로 +of.options.RAIN.tooltip.3= 빠르게 - 약한 비/눈, 빠름 +of.options.RAIN.tooltip.4= 화려하게 - 큰 비/눈, 느림 +of.options.RAIN.tooltip.5= 꺼짐 - 비와 눈 없음, 가장 빠름 +of.options.RAIN.tooltip.6=비가 꺼짐이여도 비 튀김과 빗소리는 +of.options.RAIN.tooltip.7=여전히 있습니다. + +of.options.SKY=하늘 +of.options.SKY.tooltip.1=하늘 +of.options.SKY.tooltip.2= 켜짐 - 하늘이 보임, 느림 +of.options.SKY.tooltip.3= 꺼짐 - 하늘이 보이지 않음, 빠름 +of.options.SKY.tooltip.4=하늘이 꺼짐이여도 태양과 달은 여전히 보입니다. + +of.options.STARS=별 +of.options.STARS.tooltip.1=별 +of.options.STARS.tooltip.2= 켜짐 - 별이 보임, 느림 +of.options.STARS.tooltip.3= 꺼짐 - 별이 보이지 않음, 빠름 + +of.options.SUN_MOON=해와 달 +of.options.SUN_MOON.tooltip.1=해와 달 +of.options.SUN_MOON.tooltip.2= 켜짐 - 해와 달이 보임 (기본) +of.options.SUN_MOON.tooltip.3= 꺼짐 - 태양과 달이 보이지 않음 (빠름) + +of.options.SHOW_CAPES=망토 표시 +of.options.SHOW_CAPES.tooltip.1=망토 표시 +of.options.SHOW_CAPES.tooltip.2= 켜짐 - 플레이어 망토 표시 (기본) +of.options.SHOW_CAPES.tooltip.3= 꺼짐 - 플레이어의 망토 표시 안 함 + +of.options.TRANSLUCENT_BLOCKS=반투명 블록 +of.options.TRANSLUCENT_BLOCKS.tooltip.1=반투명 블록 +of.options.TRANSLUCENT_BLOCKS.tooltip.2= 화려하게 - 정확한 색깔 혼합 (기본) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 빠르게 - 빠른 색깔 혼합 (빠름) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=다른 색깔의 반투명 블록(염색된 유리, 물, 얼음)이 +of.options.TRANSLUCENT_BLOCKS.tooltip.5=공기를 사이에 두고 놓였을 때의 +of.options.TRANSLUCENT_BLOCKS.tooltip.6=색상 혼합을 조정합니다. + +of.options.HELD_ITEM_TOOLTIPS=손에 든 아이템 설명 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=손에 든 아이템 설명 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= 켜짐 - 손에 들고 있는 아이템의 설명 표시 (기본) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= 꺼짐 - 손에 들고 있는 아이템의 설명 표시 안 함 + +of.options.ADVANCED_TOOLTIPS=고급 설명 +of.options.ADVANCED_TOOLTIPS.tooltip.1=고급 설명 +of.options.ADVANCED_TOOLTIPS.tooltip.2= 켜짐 - 고급 설명 표시 +of.options.ADVANCED_TOOLTIPS.tooltip.3= 꺼짐 - 고급 설명 표시 안 함 (기본) +of.options.ADVANCED_TOOLTIPS.tooltip.4=고급 설명은 아이템(id, 내구도)과 +of.options.ADVANCED_TOOLTIPS.tooltip.5=셰이더 설정(ID, 출처, 기본 값)의 +of.options.ADVANCED_TOOLTIPS.tooltip.6=확장 정보를 표시합니다. + +of.options.DROPPED_ITEMS=떨어진 아이템 +of.options.DROPPED_ITEMS.tooltip.1=떨어진 아이템 +of.options.DROPPED_ITEMS.tooltip.2= 기본 - 그래픽 설정대로 +of.options.DROPPED_ITEMS.tooltip.3= 빠르게 - 2D 떨어진 아이템, 빠름 +of.options.DROPPED_ITEMS.tooltip.4= 화려하게 - 3D 떨어진 아이템, 느림 + +options.entityShadows.tooltip.1=개체 그림자 +options.entityShadows.tooltip.2= 켜짐 - 개체 그림자 표시 +options.entityShadows.tooltip.3= 꺼짐 - 개체 그림자 표시 안 함 + +of.options.VIGNETTE=비네팅 +of.options.VIGNETTE.tooltip.1=화면 모서리를 살짝 어둡게 하는 시각 효과 +of.options.VIGNETTE.tooltip.2= 기본 - 그래픽 설정대로 (기본) +of.options.VIGNETTE.tooltip.3= 빠르게 - 비네팅 비활성화 (빠름) +of.options.VIGNETTE.tooltip.4= 화려하게 - 비네팅 활성화 (느림) +of.options.VIGNETTE.tooltip.5=비네팅은 FPS에 커다란 영향을, 특히 전체 화면으로 +of.options.VIGNETTE.tooltip.6=플레이할 때, 줄 수 있습니다. +of.options.VIGNETTE.tooltip.7=비네팅 효과는 미세하며 안전히 비활성화할 +of.options.VIGNETTE.tooltip.8=수 있습니다. + +of.options.DYNAMIC_FOV=동적 FOV +of.options.DYNAMIC_FOV.tooltip.1=동적 FOV +of.options.DYNAMIC_FOV.tooltip.2= 켜짐 - 동적 FOV 활성화 (기본) +of.options.DYNAMIC_FOV.tooltip.3= 꺼짐 - 동적 FOV 비활성화 +of.options.DYNAMIC_FOV.tooltip.4=날거나, 달리거나, 활을 당길 때 +of.options.DYNAMIC_FOV.tooltip.5=시야(FOV)를 바꿉니다. + +of.options.DYNAMIC_LIGHTS=동적 조명 +of.options.DYNAMIC_LIGHTS.tooltip.1=동적 조명 +of.options.DYNAMIC_LIGHTS.tooltip.2= 꺼짐 - 동적 조명 없음 (기본) +of.options.DYNAMIC_LIGHTS.tooltip.3= 빠르게 - 빠른 동적 조명 (500ms마다 갱신) +of.options.DYNAMIC_LIGHTS.tooltip.4= 화려하게 - 화려한 동적 조명 (실시간으로 갱신) +of.options.DYNAMIC_LIGHTS.tooltip.5=빛을 내는 아이템(횃불, 발광석 등)을 활성화해 손에 +of.options.DYNAMIC_LIGHTS.tooltip.6=들렸거나 다른 플레이어에게 장착됐거나 바닥에 +of.options.DYNAMIC_LIGHTS.tooltip.7=떨어졌을 때 주변을 비추도록 합니다. + +# Performance + +of.options.SMOOTH_FPS=부드러운 FPS +of.options.SMOOTH_FPS.tooltip.1=그래픽 드라이버 버퍼를 비워 FPS를 안정화합니다. +of.options.SMOOTH_FPS.tooltip.2= 꺼짐 - 안정화 없음, FPS가 요동칠 수 있음 +of.options.SMOOTH_FPS.tooltip.3= 켜짐 - FPS 안정화 +of.options.SMOOTH_FPS.tooltip.4=이 설정은 그래픽 드라이버 의존적이며 +of.options.SMOOTH_FPS.tooltip.5=효과가 향상 보이지는 않습니다. + +of.options.SMOOTH_WORLD=부드러운 세계 +of.options.SMOOTH_WORLD.tooltip.1=내부 서버에서 일어나는 랙 급증을 제거합니다. +of.options.SMOOTH_WORLD.tooltip.2= 꺼짐 - 안정화 없음, FPS가 요동칠 수 있음 +of.options.SMOOTH_WORLD.tooltip.3= 켜짐 - FPS 안정화 +of.options.SMOOTH_WORLD.tooltip.4=내부 서버 부하를 분배해 FPS를 안정화합니다. +of.options.SMOOTH_WORLD.tooltip.5=로컬 세계(싱글플레이)에서만 효과가 있습니다. + +of.options.FAST_RENDER=빠른 렌더 +of.options.FAST_RENDER.tooltip.1=빠른 렌더 +of.options.FAST_RENDER.tooltip.2= 꺼짐 - 표준 렌더링 (기본) +of.options.FAST_RENDER.tooltip.3= 켜짐 - 최적화된 렌더링 (빠름) +of.options.FAST_RENDER.tooltip.4=렌더링 알고리즘 최적화로 GPU 로드를 줄여 +of.options.FAST_RENDER.tooltip.5=FPS를 크게 향상시킬 수 있습니다. + +of.options.FAST_MATH=빠른 계산 +of.options.FAST_MATH.tooltip.1=빠른 계산 +of.options.FAST_MATH.tooltip.2= 꺼짐 - 표준 계산 (기본) +of.options.FAST_MATH.tooltip.3= 켜짐 - 빠른 계산 +of.options.FAST_MATH.tooltip.4=최적화된 sin()과 cos() 함수를 사용하여 CPU 캐시를 더 +of.options.FAST_MATH.tooltip.5=잘 활용하고 FPS를 높입니다. + +of.options.CHUNK_UPDATES=청크 갱신 +of.options.CHUNK_UPDATES.tooltip.1=청크 갱신 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 더 느린 세계 불러오기, 더 높은 FPS (기본) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 빠른 세계 불러오기, 느린 FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - 가장 빠른 세계 불러오기, 가장 느린 FPS +of.options.CHUNK_UPDATES.tooltip.5=렌더된 프레임당 청크 갱신 수를 지정합니다. +of.options.CHUNK_UPDATES.tooltip.6=높은 값은 프레임률을 불안정하게 만들 수 있습니다. + +of.options.CHUNK_UPDATES_DYNAMIC=동적 갱신 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=동적 청크 갱신 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= 꺼짐 - 표준 프레임당 청크 갱신 (기본) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= 켜짐 - 플레이어가 가만히 서있을 때 더 많은 갱신 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=동적 갱신은 플레이어가 가만히 서있을 때 더 많은 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=청크 갱신을 강제해 세계를 빠르게 불러옵니다. + +of.options.LAZY_CHUNK_LOADING=느긋하게 청크 불러오기 +of.options.LAZY_CHUNK_LOADING.tooltip.1=느긋하게 청크 불러오기 +of.options.LAZY_CHUNK_LOADING.tooltip.2= 꺼짐 - 기본 서버 청크 불러오기 +of.options.LAZY_CHUNK_LOADING.tooltip.3= 켜짐 - 느긋하게 서버 청크 불러오기 (부드러움) +of.options.LAZY_CHUNK_LOADING.tooltip.4=청크를 여러 틱으로 분배해 통합 서버 청크 +of.options.LAZY_CHUNK_LOADING.tooltip.5=불러오기를 부드럽게 합니다. +of.options.LAZY_CHUNK_LOADING.tooltip.6=세계의 일부를 정확히 불러오지 않으면 꺼짐으로 설정해 주십시오. +of.options.LAZY_CHUNK_LOADING.tooltip.7=로컬 세계와 싱글코어 CPU에만 효과가 있습니다. + +# Animations + +of.options.animation.allOn=모두 켜짐으로 +of.options.animation.allOff=모두 꺼짐으로 +of.options.animation.dynamic=동적 + +of.options.ANIMATED_WATER=물 애니메이션 +of.options.ANIMATED_LAVA=용암 애니메이션 +of.options.ANIMATED_FIRE=불 애니메이션 +of.options.ANIMATED_PORTAL=관문 애니메이션 +of.options.ANIMATED_REDSTONE=레드스톤 애니메이션 +of.options.ANIMATED_EXPLOSION=폭발 애니메이션 +of.options.ANIMATED_FLAME=화염 애니메이션 +of.options.ANIMATED_SMOKE=연기 애니메이션 +of.options.VOID_PARTICLES=공허 입자 +of.options.WATER_PARTICLES=물 입자 +of.options.RAIN_SPLASH=비 튀김 +of.options.PORTAL_PARTICLES=관문 입자 +of.options.POTION_PARTICLES=물약 입자 +of.options.DRIPPING_WATER_LAVA=물/용암 방울 +of.options.ANIMATED_TERRAIN=지형 애니메이션 +of.options.ANIMATED_TEXTURES=텍스처 애니메이션 +of.options.FIREWORK_PARTICLES=폭죽 입자 + +# Other + +of.options.LAGOMETER=지연계 +of.options.LAGOMETER.tooltip.1=디버그 화면(F3)에 지연계를 표시합니다. +of.options.LAGOMETER.tooltip.2=* 주황색 - 메모리 쓰레기 수집 +of.options.LAGOMETER.tooltip.3=* 청록색 - 틱 +of.options.LAGOMETER.tooltip.4=* 파란색 - 예약된 실행 +of.options.LAGOMETER.tooltip.5=* 보라색 - 청크 업로드 +of.options.LAGOMETER.tooltip.6=* 빨간색 - 청크 갱신 +of.options.LAGOMETER.tooltip.7=* 노란색 - 가시성 검사 +of.options.LAGOMETER.tooltip.8=* 초록색 - 지형 렌더 + +of.options.PROFILER=디버그 프로파일러 +of.options.PROFILER.tooltip.1=디버그 프로파일러 +of.options.PROFILER.tooltip.2= 켜짐 - 디버그 프로파일러가 켜짐, 느림 +of.options.PROFILER.tooltip.3= 꺼짐 - 디버그 프로파일러가 꺼짐, 빠름 +of.options.PROFILER.tooltip.4=디버그 프로파일러는 디버그 화면(F3)이 열려 +of.options.PROFILER.tooltip.5=있을 때 디버그 정보를 수집해 표시합니다. + +of.options.WEATHER=날씨 +of.options.WEATHER.tooltip.1=날씨 +of.options.WEATHER.tooltip.2= 켜짐 - 날씨가 켜짐, 느림 +of.options.WEATHER.tooltip.3= 꺼짐 - 날씨가 꺼짐, 빠름 +of.options.WEATHER.tooltip.4=날씨는 비와 눈, 뇌우를 조정합니다. +of.options.WEATHER.tooltip.5=날씨 조정은 로컬 세계에서만 가능합니다. + +of.options.time.dayOnly=낮만 +of.options.time.nightOnly=밤만 + +of.options.TIME=시간 +of.options.TIME.tooltip.1=시간 +of.options.TIME.tooltip.2= 기본 - 보통 낮/밤 주기 +of.options.TIME.tooltip.3= 낮만 - 낮만 +of.options.TIME.tooltip.4= 밤만 - 밤만 +of.options.TIME.tooltip.5=시간 설정은 크리에이티브 모드와 로컬 세게에서만 +of.options.TIME.tooltip.6=효과가 있습니다. + +options.fullscreen.tooltip.1=전체 화면 +options.fullscreen.tooltip.2= 켜짐 - 전체 화면 모드 사용 +options.fullscreen.tooltip.3= 꺼짐 - 창 모드 사용 +options.fullscreen.tooltip.4=전체 화면 모드는 그래픽 카드에 따라 +options.fullscreen.tooltip.5=창 모드보다 빠르거나 느릴 수 있습니다. + +of.options.FULLSCREEN_MODE=전체 화면 모드 +of.options.FULLSCREEN_MODE.tooltip.1=전체 화면 모드 +of.options.FULLSCREEN_MODE.tooltip.2= 기본 - 데스크톱 화면 해상도 사용, 느림 +of.options.FULLSCREEN_MODE.tooltip.3= 너비x높이 - 사용자 지정 해상도 사용, 더 빠를 수 있음 +of.options.FULLSCREEN_MODE.tooltip.4=선택한 해상도를 전체 화면 모드(F11)에서 사용합니다. +of.options.FULLSCREEN_MODE.tooltip.5=낮은 해상도가 일반적으로 빠릅니다. + +of.options.SHOW_FPS=FPS 표시 +of.options.SHOW_FPS.tooltip.1=소형 FPS 및 렌더 정보를 표시합니다. +of.options.SHOW_FPS.tooltip.2= C: - 청크 렌더러 +of.options.SHOW_FPS.tooltip.3= E: - 렌더된 개체 + 블록 개체 +of.options.SHOW_FPS.tooltip.4= U: - 청크 갱신 +of.options.SHOW_FPS.tooltip.5=소형 FPS 정보는 디버그 화면이 +of.options.SHOW_FPS.tooltip.6=보이지 않을 때에만 표시됩니다. + +of.options.save.default=기본 (2초) +of.options.save.20s=20초 +of.options.save.3min=3분 +of.options.save.30min=30분 + +of.options.AUTOSAVE_TICKS=자동 저장 +of.options.AUTOSAVE_TICKS.tooltip.1=자동 저장 간격 +of.options.AUTOSAVE_TICKS.tooltip.2=기본 자동 저장 간격(2초)을 권장하지 않습니다. +of.options.AUTOSAVE_TICKS.tooltip.3=자동 저장은 그 유명한 죽음의 랙 급증을 야기합니다. + +of.options.SCREENSHOT_SIZE=스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.1=스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.2= 기본 - 기본 스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - 사용자 지정 스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.4=큰 스크린샷을 캡쳐하는 데 많은 메모리가 필요할 수 있습니다. +of.options.SCREENSHOT_SIZE.tooltip.5=빠른 렌더와 안티에일리어싱과 호환되지 않습니다. +of.options.SCREENSHOT_SIZE.tooltip.6=GPU 프레임버퍼 지원이 필요합니다. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/lb_LU.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/lb_LU.lang new file mode 100644 index 0000000..937fb92 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/lb_LU.lang @@ -0,0 +1,740 @@ +# Contributors of Luxembourgish localization # +# Hyperspacemaster ---- 2016-04-06 ---- 2018-09-04 + +# General +of.general.ambiguous=onkloer +of.general.custom=Aneres +of.general.from=Vun +of.general.id=ID +of.general.restart=Neistart +of.general.smart=Fein + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing ass net kompatibel mat de Shader. +of.message.aa.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.af.shaders1=Anisotropescht Filteren ass net kompatibel mat de Shader. +of.message.af.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.fr.shaders1=Schnellt Renderen ass net kompatibel mat de de Shader. +of.message.fr.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.an.shaders1=3D Anaglyph ass net kompatibel mat de Shader. +of.message.an.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.shaders.aa1=Antialiasing ass net kompatibel mat de Shader . +of.message.shaders.aa2=W.e.g desaktivéier Qualitéit -> Antialiasing a start däi Spill nei. + +of.message.shaders.af1=Anisotropescht Filteren ass net kompatibel mat de Shader. +of.message.shaders.af2=W.e.g desaktivéier Qualitéit -> Anisotropescht Filteren. + +of.message.shaders.fr1=Shader sinn net kompatibel mat schnellem Renderen. +of.message.shaders.fr2=W.e.g desaktivéier Qualitéit -> Schnellt Renderen. + +of.message.shaders.an1=Shader sinn net kompatibel mam 3D Anaglyph. +of.message.shaders.an2=W.e.g desaktivéier Verschiddenes -> 3D Anaglyph. + +of.message.shaders.nv1=Dëse Shaderpak erfuerdert eng méi eng nei Versioun vun OptiFine: %s +of.message.shaders.nv2=Bass du sécher, dass du fortfuere wëlls? + +of.message.newVersion=Eng nei §eOptiFine§f Versioun ass verfügbar: §e%s§f +of.message.java64Bit=Du kanns §e64-bit Java§f installéiere fir eng besser Performance. +of.message.openglError=§eOpenGL Feeler§f: %s (%s) + +of.message.shaders.loading=D'Shader gi gelueden: %s + +of.message.other.reset=All d'Videoastellungen ob hier Standardwäerter zerécksetzen? + +of.message.loadingVisibleChunks=Siichtbar Chunks gi gelueden + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine Emhang ... + +# Video settings + +options.graphics.tooltip.1=Grafikmodus +options.graphics.tooltip.2= Schnell - méi schlecht Qualitéit, méi schnell +options.graphics.tooltip.3= Schéin - héich Qualitéit, méi lues +options.graphics.tooltip.4=Verännert d'Ausgesi vun de Wolleken, Blieder, Grasbléck, +options.graphics.tooltip.5=Schieter a vum Waasser. + +of.options.renderDistance.tiny=Winzeg +of.options.renderDistance.short=Geréng +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Wéit +of.options.renderDistance.extreme=Extrem +of.options.renderDistance.insane=Verréckt +of.options.renderDistance.ludicrous=Wahnsinn + +options.renderDistance.tooltip.1=Siichtwéit +options.renderDistance.tooltip.2= 2 Winzeg - 32m (am schnellsten) +options.renderDistance.tooltip.3= 8 Normal - 128m (normal) +options.renderDistance.tooltip.4= 16 Wéit - 256m (lues) +options.renderDistance.tooltip.5= 32 Extrem - 512m (am luesten!) brauch vill Ressourcen +options.renderDistance.tooltip.6= 48 Verréckt - 768m, brauch 2GB RAM zougedeelt +options.renderDistance.tooltip.7= 64 Wahnsinn - 1024m, brauch 3GB RAM zougedeelt +options.renderDistance.tooltip.8=Wäerter iwwer 16 funktionéieren nëmmen am Singleplayer. + +options.ao.tooltip.1=Fléissend Beliichtung +options.ao.tooltip.2= Aus - keng fléissend Beliichtung (schnell) +options.ao.tooltip.3= Minimum - einfach fléissend Beliichtung (lues) +options.ao.tooltip.4= Maximum - komplex fléissend Beliichtung (am luesten) + +options.framerateLimit.tooltip.1=Max. FPS +options.framerateLimit.tooltip.2= VSync - limitéiert ob d'Bildfrequenz vum +options.framerateLimit.tooltip.3= Moniteur (60, 30, 20) +options.framerateLimit.tooltip.4= 5-255 - variabel +options.framerateLimit.tooltip.5= Illimitéiert - keng Begrenzung (am schnellsten) +options.framerateLimit.tooltip.6=D'Bildfrequenz grenzt FPS an, souguer wann +options.framerateLimit.tooltip.7=d'Begrenzung net erreecht ass. +of.options.framerateLimit.vsync=V-Sync + +of.options.AO_LEVEL=Schiet-Hellegkeet +of.options.AO_LEVEL.tooltip.1=Hellegkeet vun de Schieter +of.options.AO_LEVEL.tooltip.2= Aus - keng Schieter +of.options.AO_LEVEL.tooltip.3= 50%% - hell Schieter +of.options.AO_LEVEL.tooltip.4= 100%% - donkel Schieter + +options.viewBobbing.tooltip.1=Realistesch Beweegungen +options.viewBobbing.tooltip.2=Wann Mipmaps genotzt ginn desaktivéiert d'Astellung +options.viewBobbing.tooltip.3=fir eng besser Leeschtung + +options.guiScale.tooltip.1=GUI Gréisst +options.guiScale.tooltip.2= Auto - Maximal Gréisst +options.guiScale.tooltip.3= Kleng, Normal, Grouss - 1x - 3x +options.guiScale.tooltip.4= 4x - 10x - Verfügbar of 4K-Moniteuren +options.guiScale.tooltip.5=Ongerued Wäerter (1x, 3x, 5x ...) sinn net kompatibel +options.guiScale.tooltip.6=mat der Unicode-Schrëft. +options.guiScale.tooltip.7=Ee méi klengt GUI ka méi schnell sinn. + +options.vbo=VBOs benotzen +options.vbo.tooltip.1=Vertexbufferobjeten +options.vbo.tooltip.2=Benotz een alternative Rendermodel, deen normalerweis +options.vbo.tooltip.3=méi schnell (5-10%%) wei d'Standard-Renderen ass. + +options.gamma.tooltip.1=Erhéicht d'Hellegkeet vun donkelen Objeten +options.gamma.tooltip.2= Aus - Standardhellegkeet +options.gamma.tooltip.3= 1-99%% - variabel +options.gamma.tooltip.4= Hell - maximal Hellegkeet fir donkel Objeten +options.gamma.tooltip.5=Dës Optioun ännert d'Hellegkeet vu ganz donkelen +options.gamma.tooltip.6=Objeten net. + +options.anaglyph.tooltip.1=3D Anaglyph +options.anaglyph.tooltip.2=Aktivéiert ee stereoskopeschen 3D-Effekt duerch +options.anaglyph.tooltip.3=benotze vun ënnerschiddleche Faarwe fir d'Aen. +options.anaglyph.tooltip.4=Kann nëmme mat engem Rout-Turquoise-Brëll benotzt ginn. + +of.options.ALTERNATE_BLOCKS=Blockvariatiounen +of.options.ALTERNATE_BLOCKS.tooltip.1=Blockvariatiounen +of.options.ALTERNATE_BLOCKS.tooltip.2=Benotzt Variatioune fir puer Bléck +of.options.ALTERNATE_BLOCKS.tooltip.3=Hänkt vum ausgewielte Ressourcepak of. + +of.options.FOG_FANCY=Niwwel +of.options.FOG_FANCY.tooltip.1=Niwwel +of.options.FOG_FANCY.tooltip.2= Schnell - schnellen Niwwel +of.options.FOG_FANCY.tooltip.3= Schéin - luesen Niwwel, gesäit besser aus +of.options.FOG_FANCY.tooltip.4= Aus - keen Niwwel, am schnellsten +of.options.FOG_FANCY.tooltip.5=De schéinen Niwwel ass nëmme verfügbar, wann en vun +of.options.FOG_FANCY.tooltip.6=der Grafikkaart ënnerstëtzt gëtt. + +of.options.FOG_START=Niwwel Startpunkt +of.options.FOG_START.tooltip.1=Niwwel Startpunkt +of.options.FOG_START.tooltip.2= 0.2 - Niwwel start no beim Spiller +of.options.FOG_START.tooltip.3= 0.8 - Niwwel start weit vum Spiller ewech +of.options.FOG_START.tooltip.4=Dës Optioun beaflosst normalerweis net d'Leeschtung + +of.options.CHUNK_LOADING=Chunklueden +of.options.CHUNK_LOADING.tooltip.1=Chunklueden +of.options.CHUNK_LOADING.tooltip.2= Standard - onstabil FPS beim Luede vun de Chunks +of.options.CHUNK_LOADING.tooltip.3= Fléissend - stabil FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - stabil FPS, 3x méi schnellt d'Luede vun der Welt +of.options.CHUNK_LOADING.tooltip.5=Fléissend a Multi-Core mécht Ruckler a Standbiller +of.options.CHUNK_LOADING.tooltip.6=fort déi durch d'Luede vun de Chunks verursaacht ginn. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core kann d'Luede vun der Welt bis zu 3x méi schnell +of.options.CHUNK_LOADING.tooltip.8=maachen a FPS erhéijen duerch een zweete CPU-Kär. +of.options.chunkLoading.smooth=Fléissend +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shader ... +of.options.shadersTitle=Shader + +of.options.shaders.packNone=Aus +of.options.shaders.packDefault=(intern) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= Aus - (Standard) keen Antialiasing (méi schnell) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - antialiséiert Linnen a Kanten (méi lues) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA ass een Nobeaarbechtungseffekt dee zackeg +of.options.shaders.ANTIALIASING.tooltip.5=Linnen an haart Faarweniwwergäng ofschwächt. +of.options.shaders.ANTIALIASING.tooltip.6=Et ass méi schnell wei traditionellen Antialiasing +of.options.shaders.ANTIALIASING.tooltip.7=an ass kompatibel mat Shader a Schnellt Renderen. + +of.options.shaders.NORMAL_MAP=Normalkaarten +of.options.shaders.NORMAL_MAP.tooltip.1=Normalkaarten +of.options.shaders.NORMAL_MAP.tooltip.2= Un - (Standard) aktivéier Normalkaarten +of.options.shaders.NORMAL_MAP.tooltip.3= Aus - desaktivéier Normalkaarten +of.options.shaders.NORMAL_MAP.tooltip.4=Normalkaarte kënne vu Shaderpäck benotzt +of.options.shaders.NORMAL_MAP.tooltip.5=ginn, fir 3D-Geometrie op flaachen Uewerflächen +of.options.shaders.NORMAL_MAP.tooltip.6=ze simuléieren. +of.options.shaders.NORMAL_MAP.tooltip.7=Normalkaarte gi vum aktivéierte Ressourcepak +of.options.shaders.NORMAL_MAP.tooltip.8=zur Verfügung gestallt. + +of.options.shaders.SPECULAR_MAP=Reflexiounskaart. +of.options.shaders.SPECULAR_MAP.tooltip.1=Reflexiounskaarten +of.options.shaders.SPECULAR_MAP.tooltip.2= Un - (Standard) aktivéier Reflexiounskaarten +of.options.shaders.SPECULAR_MAP.tooltip.3= Aus - desaktivéier Reflexiounskaarten +of.options.shaders.SPECULAR_MAP.tooltip.4=Reflexiounskaarte kënne vu Shaderpäck benotzt +of.options.shaders.SPECULAR_MAP.tooltip.5=ginn, fir speziell Reflexiouns Effekter ze simuléieren. +of.options.shaders.SPECULAR_MAP.tooltip.6=Reflexiounskaarte gi vum aktivéierte Ressourcepak +of.options.shaders.SPECULAR_MAP.tooltip.7=zur Verfügung gestallt. + +of.options.shaders.RENDER_RES_MUL=Renderqualitéit +of.options.shaders.RENDER_RES_MUL.tooltip.1=Render Qualitéit +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - Niddreg (am schnellsten) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - Standard +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - Héich (am luesten) +of.options.shaders.RENDER_RES_MUL.tooltip.5=D'Render Qualitéit reegelt d'Opléisung vun der Textur +of.options.shaders.RENDER_RES_MUL.tooltip.6=op deenen d'Shader gerendert ginn. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Niddreg Wäerter kënne bei 4K-Moniteur nëtzlech ginn. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Héich Wäerter wierke wéi een Antialiasing-Filter. + +of.options.shaders.SHADOW_RES_MUL=Schietqualitéit +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Schietqualitéit +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - Niddreg (am schnellsten) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - Standard +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - Héich (am luesten) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=D'Schietqualitéit reegelt d'Opléisung vun der Schieter +of.options.shaders.SHADOW_RES_MUL.tooltip.6=Kaarten Textur vum benotzte Shaderpak. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Niddreg Wäerter = Ongenau, graff Schieter. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Héich Wäerter = Detailléiert, fein Schieter + +of.options.shaders.HAND_DEPTH_MUL=Handdéift +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Handdéift +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - Hand an der Kameragéigend +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (Standard) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - Hand méi weit vun der Kamera fort +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=D'Handdéift steiert, wei weit Géigestänn vun der +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=Kamera fort sinn. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Fir Shaderpäck mat Déiftenonschäerft reegelt dës +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=d'Onschäerft vun den drobare Géigestänn. + +of.options.shaders.CLOUD_SHADOW=Wollekeschiet + +of.options.shaders.OLD_HAND_LIGHT=Al Handbel. +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Al Handbeliichtung +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Standard - Kontrolléiert vum Shaderpak +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Un - Al Handbeliichtung gëtt benotzt +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Aus - Néi Handbeliichtung gëtt benotzt +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=D'al Handbeliichtung suergt dofir, dass Shaderpäck +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=déi liichtend Objeten an der Haapthand erkennen och +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=mat Objeten an der Niewenhand funktionéieren. + +of.options.shaders.OLD_LIGHTING=Al Beliicht. +of.options.shaders.OLD_LIGHTING.tooltip.1=Al Beliichtung +of.options.shaders.OLD_LIGHTING.tooltip.2= Standard - Kontrolléiert vum Shaderpak +of.options.shaders.OLD_LIGHTING.tooltip.3= Un - Al Beliichtung gëtt benotzt +of.options.shaders.OLD_LIGHTING.tooltip.4= OFF - Al Beliichtung gëtt net benotzt +of.options.shaders.OLD_LIGHTING.tooltip.5=Déi al Beliichtung steiert déi fix "Vanilla" +of.options.shaders.OLD_LIGHTING.tooltip.6=Beliichtung vun de Blocksäiten. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shaderpäck mat Schieter ofhängeg vum Sonnestand +of.options.shaders.OLD_LIGHTING.tooltip.8=stëlle meeschtens eng besser Beliichtung zur Verfügung. + +of.options.shaders.DOWNLOAD=Shader eroflueden +of.options.shaders.DOWNLOAD.tooltip.1=Shader eroflueden +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Mëscht Shaderpäck Websäit am Browser op. +of.options.shaders.DOWNLOAD.tooltip.4=Verschib den erofgeluede Shaderpak an de +of.options.shaders.DOWNLOAD.tooltip.5=Shaderfichier esou erschéngt deen an der lëscht +of.options.shaders.DOWNLOAD.tooltip.6=mat den installéierte Shader. + +of.options.shaders.SHADER_PACK=Shaderpak + +of.options.shaders.shadersFolder=Shaderfichier +of.options.shaders.shaderOptions=Shaderastellungen ... + +of.options.shaderOptionsTitle=Shaderastellungen + +of.options.quality=Qualitéit ... +of.options.qualityTitle=Qualitéitsastellungen + +of.options.details=Detailer ... +of.options.detailsTitle=Detailastellungen + +of.options.performance=Performance ... +of.options.performanceTitle=Performanceastellungen + +of.options.animations=Animatiounen ... +of.options.animationsTitle=Animatiounsastellungen + +of.options.other=Verschiddenes ... +of.options.otherTitle=Veschidden Astellungen + +of.options.other.reset=Videoastellungen zerécksetzen ... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Am noosten +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Visuellen Effekt deen Objeten aus grousser +options.mipmapLevels.tooltip.2=Distanz besser ausgesi léisst duerch verréngere +options.mipmapLevels.tooltip.3=vun den Texturdetailer. +options.mipmapLevels.tooltip.4= Aus - keng Verréngerung vun Detailer +options.mipmapLevels.tooltip.5= 1 - minimal Verréngerung vun Detailer +options.mipmapLevels.tooltip.6= 4 - maximal Verréngerung vun Detailer +options.mipmapLevels.tooltip.7=Dës Optioun beaflosst normalerweis d'Performance net. + +of.options.MIPMAP_TYPE=Mipmap Typ +of.options.MIPMAP_TYPE.tooltip.1=Visuellen Effekt deen Objeten aus grousser +of.options.MIPMAP_TYPE.tooltip.2=Distanz besser ausgesi léisst duerch verréngere +of.options.MIPMAP_TYPE.tooltip.3=vun den Texturdetailer. +of.options.MIPMAP_TYPE.tooltip.4= Am noosten - graff Verréngerung (am schnellsten) +of.options.MIPMAP_TYPE.tooltip.5= Linear - normal Verréngerung (schnell) +of.options.MIPMAP_TYPE.tooltip.6= Bilinear - fein Verréngerung (lues) +of.options.MIPMAP_TYPE.tooltip.7= Trilinear - feinst Verréngerung (am luesten) + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= Aus - (Standard) Keen Antialiasing (méi schnell) +of.options.AA_LEVEL.tooltip.3= 2-16 - antialiséiert Kanten an Ecker (méi lues) +of.options.AA_LEVEL.tooltip.4=Den Antialiasing mécht Kanten a Faarfiwergäng +of.options.AA_LEVEL.tooltip.5=méi fléissend. +of.options.AA_LEVEL.tooltip.6=Falls aktivéiert kënnen deng FPS staark erof goen. +of.options.AA_LEVEL.tooltip.7=Net all Stufe gi vun all Grafikaart ënnerstëtzt. +of.options.AA_LEVEL.tooltip.8=Ännerunge sinn eréischt no engem Neistart effektiv! + +of.options.AF_LEVEL=Anisotropescht Filteren +of.options.AF_LEVEL.tooltip.1=Anisotropescht Filteren +of.options.AF_LEVEL.tooltip.2= Aus - (Standard) Standard-Texturdetailer (méi schnell) +of.options.AF_LEVEL.tooltip.3= 2-16 - méi fein Texturdetailer (méi lues) +of.options.AF_LEVEL.tooltip.4=D'anisoptropescht Filtere stellt Texturdetailer +of.options.AF_LEVEL.tooltip.5=déi duerch Mipmap verluer gaange sinn erëm hier. +of.options.AF_LEVEL.tooltip.6=Falls aktivéiert kënnen deng FPS staark erof goen. + +of.options.CLEAR_WATER=Kloert Waasser +of.options.CLEAR_WATER.tooltip.1=Kloert Waasser +of.options.CLEAR_WATER.tooltip.2= Un - kloer, transparent Waasser +of.options.CLEAR_WATER.tooltip.3= Aus - normaalt Waasser + +of.options.RANDOM_ENTITIES=Zoufälleg Entitéiten +of.options.RANDOM_ENTITIES.tooltip.1=Zoufälleg Entitéiten +of.options.RANDOM_ENTITIES.tooltip.2= Aus - keng zoufälleg Entitéiten, méi schnell +of.options.RANDOM_ENTITIES.tooltip.3= Un - zoufälleg Entitéiten, méi lues +of.options.RANDOM_ENTITIES.tooltip.4=Déi selwecht Entitéite kënne verschidden +of.options.RANDOM_ENTITIES.tooltip.5=Texturen hunn. Dofir brauch een ee Ressourcepak +of.options.RANDOM_ENTITIES.tooltip.6=mat entspriechenden Texturen. + +of.options.BETTER_GRASS=Bessert Grass +of.options.BETTER_GRASS.tooltip.1=Bessert Grass +of.options.BETTER_GRASS.tooltip.2= Aus - Standard-Säitentextur vum Gras, am schnellsten +of.options.BETTER_GRASS.tooltip.3= Schnell - komplett Säitentextur vum Gras, lues +of.options.BETTER_GRASS.tooltip.4= Schéin - dynamesch Säitentextur vum Gras, am luesten + +of.options.BETTER_SNOW=Bessere Schnéi +of.options.BETTER_SNOW.tooltip.1=Bessere Schnéi +of.options.BETTER_SNOW.tooltip.2= Aus - normale Schnéi, méi schnell +of.options.BETTER_SNOW.tooltip.3= Un - bessere Schnéi, méi lues +of.options.BETTER_SNOW.tooltip.4=Wéist Schnéi ënnert transparente Bléck (Zonk, +of.options.BETTER_SNOW.tooltip.5=héijem Grass) un wann se un Schnéibléck ugrenzen. + +of.options.CUSTOM_FONTS=Schrëftressource +of.options.CUSTOM_FONTS.tooltip.1=Schrëftressource +of.options.CUSTOM_FONTS.tooltip.2= Un - Ressourcepak-Schrëft (Standard), méi lues +of.options.CUSTOM_FONTS.tooltip.3= Aus - Standardschrëft, méi schnell +of.options.CUSTOM_FONTS.tooltip.4=D'Schrëft gëtt vum ausgewielte Ressourcepak gelueden +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Faarfressource +of.options.CUSTOM_COLORS.tooltip.1=Faarfressource +of.options.CUSTOM_COLORS.tooltip.2= Un - Ressourcepak-Faarwen (Standard), méi lues +of.options.CUSTOM_COLORS.tooltip.3= Aus - Standardfaarwen, méi schnell +of.options.CUSTOM_COLORS.tooltip.4=Faarwe gi vum ausgewielte Ressourcepak gelueden +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Sumpffaarwen +of.options.SWAMP_COLORS.tooltip.1=Sumpffaarwen +of.options.SWAMP_COLORS.tooltip.2= Un - Sumpffaarwe benotzen (Standard), méi lues +of.options.SWAMP_COLORS.tooltip.3= Aus - Sumpffaarwen nëtt benotzen, méi schnell +of.options.SWAMP_COLORS.tooltip.4=Sumpfaarwe concernéiere Grass, Blieder, Lianen +of.options.SWAMP_COLORS.tooltip.5=a Waasser. + +of.options.SMOOTH_BIOMES=Biomeiwwergäng +of.options.SMOOTH_BIOMES.tooltip.1=Biomeiwwergäng +of.options.SMOOTH_BIOMES.tooltip.2= Un - fléissenden Iwwergang (Standard), méi lues +of.options.SMOOTH_BIOMES.tooltip.3= Aus - kee fléissenden Iwwergang, méi schnell +of.options.SMOOTH_BIOMES.tooltip.4=De fléissenden Iwwergang gëtt duerch Prouwen an +of.options.SMOOTH_BIOMES.tooltip.5=Duerchschnëttsfaarfwäerter vun den ugrenzende +of.options.SMOOTH_BIOMES.tooltip.6=Bléck realiséiert +of.options.SMOOTH_BIOMES.tooltip.7=Concernéiert si Grass, Blieder, Lianen a Waasser + +of.options.CONNECTED_TEXTURES=Verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.1=Verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.2= Aus - keng verbonnen Texturen (Standard) +of.options.CONNECTED_TEXTURES.tooltip.3= Schnell - schnell verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.4= Schéin - schéi verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.5=Verbonnen Texture verbënnt d'Texture vu Glas, +of.options.CONNECTED_TEXTURES.tooltip.6=Sandsteen a Bicherregaler wann se niewenteneen +of.options.CONNECTED_TEXTURES.tooltip.7=placéiert ginn. D'verbonnen Texture gi vum +of.options.CONNECTED_TEXTURES.tooltip.8=ausgewielte Ressourcepak gelueden. + +of.options.NATURAL_TEXTURES=Natierlech Texturen +of.options.NATURAL_TEXTURES.tooltip.1=Natierlech Texturen +of.options.NATURAL_TEXTURES.tooltip.2= Aus - keng natierlech Texturen (Standard) +of.options.NATURAL_TEXTURES.tooltip.3= Un - benotz natierlech Texturen +of.options.NATURAL_TEXTURES.tooltip.4=Natierlech Texture maachen d'Raster-Unuerdnung +of.options.NATURAL_TEXTURES.tooltip.5=déi duerch widderhuele vum selwechte Block entsti fort. +of.options.NATURAL_TEXTURES.tooltip.6=Et gi rotéiert a gespigelt Variante vun der +of.options.NATURAL_TEXTURES.tooltip.7=Basisblocktextur genotzt. Konfiguratioun fir natierlech +of.options.NATURAL_TEXTURES.tooltip.8=Texture gi vum ausgewielte Ressourcepak gelueden. + +of.options.EMISSIVE_TEXTURES=Liichtend Texturen +of.options.EMISSIVE_TEXTURES.tooltip.1=Liichtend Texturen +of.options.EMISSIVE_TEXTURES.tooltip.2= Aus - keng liichtend Texturen (Standard) +of.options.EMISSIVE_TEXTURES.tooltip.3= Un - liichtend Texturen +of.options.EMISSIVE_TEXTURES.tooltip.4=D'liichtend Texture ginn als Overlays mat voller +of.options.EMISSIVE_TEXTURES.tooltip.5=Hellegkeet gerendert. Esou kënne liichtend Beräicher +of.options.EMISSIVE_TEXTURES.tooltip.6=vun der Grondtextur simuléiert ginn. +of.options.EMISSIVE_TEXTURES.tooltip.7=D'liichtend Texture gi vum ausgewielte +of.options.EMISSIVE_TEXTURES.tooltip.8=Ressourcepak gelueden. + +of.options.CUSTOM_SKY=Himmeltexturen +of.options.CUSTOM_SKY.tooltip.1=Himmeltexturen +of.options.CUSTOM_SKY.tooltip.2= Un - Ressourcepak-Himmeltexturen (Standard), lues +of.options.CUSTOM_SKY.tooltip.3= Aus - Standardhimmel, méi schnell +of.options.CUSTOM_SKY.tooltip.4=D'Himmeltexture gi vum Ressourcepak gelueden +of.options.CUSTOM_SKY.tooltip.5= + +of.options.CUSTOM_ITEMS=Géigestänntexturen +of.options.CUSTOM_ITEMS.tooltip.1=Géigestänntexturen +of.options.CUSTOM_ITEMS.tooltip.2= Un - Géigestänntexturen aus dem Ressourcepak +of.options.CUSTOM_ITEMS.tooltip.3= (Standard), lues +of.options.CUSTOM_ITEMS.tooltip.4= Aus - Standard-Géigestänntexturen, méi schnell +of.options.CUSTOM_ITEMS.tooltip.5=Géigestänntexture gi vum Ressourcepak gelueden. + +of.options.CUSTOM_ENTITY_MODELS=Objetmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Objetmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Un - Ressourcepakmodeller (Standard, lues) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Aus - Standardmodeller (méi schnell) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=D'Objetmodeller gi vum ausgewielte +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=Ressourcepak gelueden. + +of.options.CUSTOM_GUIS=Ressourcepak-GUI +of.options.CUSTOM_GUIS.tooltip.1=Ressourcepak-GUI +of.options.CUSTOM_GUIS.tooltip.2= Un - Ressourcepak-GUI (Standard, méi lues) +of.options.CUSTOM_GUIS.tooltip.3= Aus - Standard GUI (méi schnell) +of.options.CUSTOM_GUIS.tooltip.4=De GUI gëtt aus dem ausgewielte Ressourcepak gelueden. + +# Details + +of.options.CLOUDS=Wolleken +of.options.CLOUDS.tooltip.1=Wolleken +of.options.CLOUDS.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.CLOUDS.tooltip.3= Schnell - méi geréng Qualitéit, méi schnell +of.options.CLOUDS.tooltip.4= Schéin - héich Qualitéit, méi lues +of.options.CLOUDS.tooltip.5= Aus - keng Wolleken, am schnellsten +of.options.CLOUDS.tooltip.6=Schnell Wolleke sinn am 2D gerendert. +of.options.CLOUDS.tooltip.7=Schéi Wolleke sinn am 3D gerendert. + +of.options.CLOUD_HEIGHT=Wollekenhéicht +of.options.CLOUD_HEIGHT.tooltip.1=Wollekenhéicht +of.options.CLOUD_HEIGHT.tooltip.2= Aus - Standardhéicht +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - iwwert der max. Welt héicht + +of.options.TREES=Beem +of.options.TREES.tooltip.1=Beem +of.options.TREES.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.TREES.tooltip.3= Schnell - méi geréng Qualitéit, méi schnell +of.options.TREES.tooltip.4= Fein - méi héich Qualitéit, schnell +of.options.TREES.tooltip.5= Schéin - héchste Qualitéit, méi lues +of.options.TREES.tooltip.6=Schnell Beem hunn onduerchsichteg Blieder +of.options.TREES.tooltip.7=Schéin a Fein Beem hunn transparent Blieder. + +of.options.RAIN=Reen a Schnéi +of.options.RAIN.tooltip.1=Reen a Schnéi +of.options.RAIN.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.RAIN.tooltip.3= Schnell - liichte Reen/Schnéi, méi schnell +of.options.RAIN.tooltip.4= Schéin - heftege Reen/Schnéi, méi lues +of.options.RAIN.tooltip.5= Aus - keen Reen/Schnéi, schnellst +of.options.RAIN.tooltip.6=Och wann de Reen aus ass, héiert een nach ëmmer +of.options.RAIN.tooltip.7=Geräischer + +of.options.SKY=Himmel +of.options.SKY.tooltip.1=Himmel +of.options.SKY.tooltip.2= Un - Himmel siichtbar, méi lues +of.options.SKY.tooltip.3= Aus - Himmel net siichtbar, méi schnell +of.options.SKY.tooltip.4=Och wann den Himmel aus ass, sinn de Mount an d'Sonn +of.options.SKY.tooltip.5=nach ëmmer siichtbar. + +of.options.STARS=Stären +of.options.STARS.tooltip.1=Stären +of.options.STARS.tooltip.2= Un - Stäre siichtbar, méi lues +of.options.STARS.tooltip.3= Aus - Stären net siichtbar, méi schnell + +of.options.SUN_MOON=Sonn a Mound +of.options.SUN_MOON.tooltip.1=Sonn a Mound +of.options.SUN_MOON.tooltip.2= Un - Sonn a Mound siichtbar (Standard) +of.options.SUN_MOON.tooltip.3= Aus - Sonn a Mound net siichtbar (méi schnell) + +of.options.SHOW_CAPES=Emhang weisen +of.options.SHOW_CAPES.tooltip.1=Emhang weisen +of.options.SHOW_CAPES.tooltip.2= Un - weis d'Emhäng vun de Spiller (Standard) +of.options.SHOW_CAPES.tooltip.3= Aus - d'Emhäng vun de Spiller ginn net ugewisen + +of.options.TRANSLUCENT_BLOCKS=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Schéin - korrekt Faarfmëschung (Standard) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Schnell - schnell Faarfmëschung (méi schnell) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Kontrolléiert Faarfmëschung vun transparente Bléck +of.options.TRANSLUCENT_BLOCKS.tooltip.5=aus verschiddene Faarwen (gefierfte Glas, Waasser, Äis) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=wann se hannerenee placéiert sinn oder Loft +of.options.TRANSLUCENT_BLOCKS.tooltip.7=dertëschent ass. + +of.options.HELD_ITEM_TOOLTIPS=Géigestandbeschreiw. +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Géigestandbeschreiwung +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Un - weis Géigestandbeschreiwung un (Standard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Aus - weis keng Géigestandbeschreiwung + +of.options.ADVANCED_TOOLTIPS=Erweidert Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.1=Erweidert Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.2= Un - Erweidert Schnellinfo uweisen +of.options.ADVANCED_TOOLTIPS.tooltip.3= Aus - Erweidert Schnellinfo net uweisen (Standard) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Weist ausféierlech Informatiounen iwwert Géigestänn +of.options.ADVANCED_TOOLTIPS.tooltip.5=(ID, Halbarkeet) a Shaderastellungen +of.options.ADVANCED_TOOLTIPS.tooltip.6=(ID, Ursprong, Standard Wäert) un. + +of.options.DROPPED_ITEMS=Géigenstänn +of.options.DROPPED_ITEMS.tooltip.1=Falengelosse Géigenstänn +of.options.DROPPED_ITEMS.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.DROPPED_ITEMS.tooltip.3= Schnell - 2D falengelosse Géigestänn, méi schnell +of.options.DROPPED_ITEMS.tooltip.4= Schéin - 3D falengelosse Géigestänn, méi lues + +options.entityShadows.tooltip.1=Objetschieter +options.entityShadows.tooltip.2= Un - weis Objetschieter un +options.entityShadows.tooltip.3= Aus - keng Objetschieter + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Visuellen Effekt deen d'Ecker liicht ofdonkelt +of.options.VIGNETTE.tooltip.2= Standard - wéi vum Grafikmodus definéiert (Standard) +of.options.VIGNETTE.tooltip.3= Schnell - Vignette desaktivéiert (méi schnell) +of.options.VIGNETTE.tooltip.4= Schéin - Vignette aktivéiert (méi lues) +of.options.VIGNETTE.tooltip.5=D'Vignette kann ee staarken Impakt ob d'FPS hunn, +of.options.VIGNETTE.tooltip.6=virun allem wann am Vollbildmodus gespillt gëtt. +of.options.VIGNETTE.tooltip.7=De Vignette Effekt ass relativ geréng a kann dofir +of.options.VIGNETTE.tooltip.8=ouni Problem desaktivéiert ginn. + +of.options.DYNAMIC_FOV=Dynamescht Siichtfeld +of.options.DYNAMIC_FOV.tooltip.1=Dynamescht Siichtfeld +of.options.DYNAMIC_FOV.tooltip.2= Un - dynamescht Siichtfeld un (Standard) +of.options.DYNAMIC_FOV.tooltip.3= Aus - dynamescht Siichtfeld aus +of.options.DYNAMIC_FOV.tooltip.4=Wiesselt Siichtfeld beim Fléien, Sprinten +of.options.DYNAMIC_FOV.tooltip.5=oder dem Spane vun engem Bou. + +of.options.DYNAMIC_LIGHTS=Dyn. Beliichtung +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamesch Beliichtung +of.options.DYNAMIC_LIGHTS.tooltip.2= Un - keng dyn. Beliichtung (Standard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Schnell - schnell dyn. Beliichtung (Update all 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Schéin - schéin dyn. Beliichtung (Update a Realzäit) +of.options.DYNAMIC_LIGHTS.tooltip.5=Liicht-Géigestänn (Fackelen, Glowstone etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=beliichten d'Ëmgéigend wann se an der Hand gehalen, +of.options.DYNAMIC_LIGHTS.tooltip.7=een anere Spiller se equipéiert huet oder se +of.options.DYNAMIC_LIGHTS.tooltip.8=um Buedem leien. + +# Performance + +of.options.SMOOTH_FPS=Stabil FPS +of.options.SMOOTH_FPS.tooltip.1=Stabiliséiert FPS duerch eidel maache +of.options.SMOOTH_FPS.tooltip.2=vum Grafikdreiwerpuffer +of.options.SMOOTH_FPS.tooltip.3= Aus - keng Stabilisatioun, FPS kënnen onstabil sinn +of.options.SMOOTH_FPS.tooltip.4= Un - FPS stabiliséiert +of.options.SMOOTH_FPS.tooltip.5=Dës Optioun hänkt vun de Grafikdreiwer of an d'Effekter +of.options.SMOOTH_FPS.tooltip.6=sinn net ëmmer siichtbar. + +of.options.SMOOTH_WORLD=Welt Stabiliséierung +of.options.SMOOTH_WORLD.tooltip.1=Hellt Lag Spëtzten déi duerch den interne Server +of.options.SMOOTH_WORLD.tooltip.2=verursaacht gi fort. +of.options.SMOOTH_WORLD.tooltip.3= Aus - keng Stabilisatioun, FPS kënnen onstabil sinn +of.options.SMOOTH_WORLD.tooltip.4= Un - FPS stabiliséiert +of.options.SMOOTH_WORLD.tooltip.5=Stabiliséiert FPS duerch verdeele vun der Laascht ob +of.options.SMOOTH_WORLD.tooltip.6=den interne Server. +of.options.SMOOTH_WORLD.tooltip.7=Nëmmen effektiv am Singleplayer. + +of.options.FAST_RENDER=Schnellt Renderen +of.options.FAST_RENDER.tooltip.1=Schnellt Renderen +of.options.FAST_RENDER.tooltip.2= Aus - Standard-Renderen (Standard) +of.options.FAST_RENDER.tooltip.3= Un - optiméiert Renderen (méi schnell) +of.options.FAST_RENDER.tooltip.4=Benotzt een optimiséierte Renderalgorithmus dee GPU +of.options.FAST_RENDER.tooltip.5=Laascht verklengert an domadder méi héich FPS +of.options.FAST_RENDER.tooltip.6=erméiglecht. + +of.options.FAST_MATH=Schnell Mathematik +of.options.FAST_MATH.tooltip.1=Schnell Mathematik +of.options.FAST_MATH.tooltip.2= Aus - Standard-Mathematik (Standard) +of.options.FAST_MATH.tooltip.3= Un - schnell Mathematik +of.options.FAST_MATH.tooltip.4=Benotzt optiméiert sin() a cos() Funktiounen déi de +of.options.FAST_MATH.tooltip.5=CPU Cache besser benotzen a méi héich FPS erméiglechen. +of.options.FAST_MATH.tooltip.6=Dës Optioun kann d'Weltgeneratioun minimal beaflossen. + +of.options.CHUNK_UPDATES=Chunk Updates +of.options.CHUNK_UPDATES.tooltip.1=Chunk Updates +of.options.CHUNK_UPDATES.tooltip.2= 1 - luest Luede vun der Welt, héich FPS (Standard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - schnellt Luede vun der Welt, manner FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - schnellst Luede vun der Welt, am mannste FPS +of.options.CHUNK_UPDATES.tooltip.5=Unzuel vu Chunk Updates pro gerendert Bild. +of.options.CHUNK_UPDATES.tooltip.6=Méi héicht Wäerter kënnen d'Billerunzuel destabiliséieren. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamesch Updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamesch Chunk Updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Aus - (Standard) Standard Chunk Updates pro Bild +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Un - méi Updates wann de Spiller roueg steet +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamesch Updates forcéiert méi Chunk Updates während +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=de Spiller roueg steet fir d'Welt méi schnell ze lueden. + +of.options.LAZY_CHUNK_LOADING=Luest Chunklueden +of.options.LAZY_CHUNK_LOADING.tooltip.1=Luest Chunklueden +of.options.LAZY_CHUNK_LOADING.tooltip.2= Aus - normaalt Server-Chunklueden +of.options.LAZY_CHUNK_LOADING.tooltip.3= Un - luest Server-Chunklueden (méi fléissend) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Mécht datt d'integréiert Luede vun de Server-Chunks méi +of.options.LAZY_CHUNK_LOADING.tooltip.5=fléissend ass duerch Verdeelung vun de Chunks iwwer +of.options.LAZY_CHUNK_LOADING.tooltip.6=puer Ticks. Desaktivéier et wann Deeler vun der Welt net +of.options.LAZY_CHUNK_LOADING.tooltip.7=richteg lueden. Nëmmen effektiv am Singleplayer a bei +of.options.LAZY_CHUNK_LOADING.tooltip.8=engem Eenzel-Kär CPU. + +of.options.RENDER_REGIONS=Render Regiounen +of.options.RENDER_REGIONS.tooltip.1=Render Regiounen +of.options.RENDER_REGIONS.tooltip.2= Aus - Render Regiounen desaktivéiert (Standard) +of.options.RENDER_REGIONS.tooltip.3= Un - Render Regiounen aktivéiert +of.options.RENDER_REGIONS.tooltip.4=Render Regiounen erméiglechen ee schnellt Renderen +of.options.RENDER_REGIONS.tooltip.5=vum Terrain bei grousse Render Distanzen. +of.options.RENDER_REGIONS.tooltip.6=Ass méi aktiv wann VBOs aktivéiert ass. +of.options.RENDER_REGIONS.tooltip.7=Net fir integréiert Grafikkaarte recommandéiert. + +of.options.SMART_ANIMATIONS=Schlau Animatiounen +of.options.SMART_ANIMATIONS.tooltip.1=Schlau Animatiounen +of.options.SMART_ANIMATIONS.tooltip.2= Aus - Schlau Animatiounen desaktivéiert (Standard) +of.options.SMART_ANIMATIONS.tooltip.3= Un - Schlau Animatiounen aktivéiert +of.options.SMART_ANIMATIONS.tooltip.4=Mat schlauen Animatiounen animéiert d'Spill nëmmen +of.options.SMART_ANIMATIONS.tooltip.5=déi Animatiounen déi grad um Display siichtbar sinn. +of.options.SMART_ANIMATIONS.tooltip.6=Reduzéiert Tick Lag Spëtzten an erhéicht d'FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Virun allem nëtzlech fir grouss Modpäck +of.options.SMART_ANIMATIONS.tooltip.7=an HD Ressourcepäck. + +# Animations + +of.options.animation.allOn=All un +of.options.animation.allOff=All aus +of.options.animation.dynamic=Dynamesch + +of.options.ANIMATED_WATER=Waasser animéiert +of.options.ANIMATED_LAVA=Lava animéiert +of.options.ANIMATED_FIRE=Féier animéiert +of.options.ANIMATED_PORTAL=Portal animéiert +of.options.ANIMATED_REDSTONE=Redstone animéiert +of.options.ANIMATED_EXPLOSION=Explosiounen animéiert +of.options.ANIMATED_FLAME=Flamen animéiert +of.options.ANIMATED_SMOKE=Damp animéiert +of.options.VOID_PARTICLES=Voidpartikel +of.options.WATER_PARTICLES=Waasserpartikel +of.options.RAIN_SPLASH=Reengeplätscher +of.options.PORTAL_PARTICLES=Portalpartikel +of.options.POTION_PARTICLES=Dronkpartikel +of.options.DRIPPING_WATER_LAVA=Waasser/Lavadrëpsen +of.options.ANIMATED_TERRAIN=Terrain animéiert +of.options.ANIMATED_TEXTURES=Texturen animéiert +of.options.FIREWORK_PARTICLES=Féierwierkpartikel + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Wéist de Lagometer um Debugbildschierm un (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Memoiredrécksammlung +of.options.LAGOMETER.tooltip.3=* Turqoise - Tick +of.options.LAGOMETER.tooltip.4=* Blo - geplangten Ausféierungen +of.options.LAGOMETER.tooltip.5=* Mof - Chunk eroplueden +of.options.LAGOMETER.tooltip.6=* Roud - Chunk updaten +of.options.LAGOMETER.tooltip.7=* Giel - Siichtbarkeetstest +of.options.LAGOMETER.tooltip.8=* Gréng - Terrain rendern + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= Un - Debug Profiler ass aktiv, méi lues +of.options.PROFILER.tooltip.3= Aus - Debug Profiler ass net aktiv, méi schnell +of.options.PROFILER.tooltip.4=Den Debug Profiler sammel a weist Debug Informatiounen +of.options.PROFILER.tooltip.5=un wann den Debugbildschierm un ass (F3) + +of.options.WEATHER=Wieder +of.options.WEATHER.tooltip.1=Wieder +of.options.WEATHER.tooltip.2= Un - Wieder ass aktiv, méi lues +of.options.WEATHER.tooltip.3= Aus - Wieder ass net aktiv, méi schnell +of.options.WEATHER.tooltip.4=D'Wieder kontrolléiert de Reen, Schnéi an Donnerwieder. +of.options.WEATHER.tooltip.5=D'Wiederkontroll ass nëmmen am Singleplayer méiglech. + +of.options.time.dayOnly=Nëmmen Dag +of.options.time.nightOnly=Nëmmen Nuecht + +of.options.TIME=Zäit +of.options.TIME.tooltip.1=Zäit +of.options.TIME.tooltip.2= Standard - normalen Dag/Nuecht Zyklus +of.options.TIME.tooltip.3= Nëmmen Dag - Nëmmen Dag +of.options.TIME.tooltip.4= Nëmmen Nuecht - Nëmmen Nuecht +of.options.TIME.tooltip.5=D'Zäitastellunge sinn nëmmen am Kreativemodus +of.options.TIME.tooltip.6=an am Singleplayer aktiv. + +options.fullscreen.tooltip.1=Vollbild +options.fullscreen.tooltip.2= Un - benotz de Vollbildmodus +options.fullscreen.tooltip.3= Aus - benotz de Fenstermodus +options.fullscreen.tooltip.4=De Vollbildmodus ka méi schnell oder awer méi lues sinn +options.fullscreen.tooltip.5=wéi de Fenstermodus ofhängeg vun denger Grafikkaart. + +of.options.FULLSCREEN_MODE=Vollbildmodus +of.options.FULLSCREEN_MODE.tooltip.1=Vollbildmodus +of.options.FULLSCREEN_MODE.tooltip.2= Standard - benotz d'Desktop-Opléisung, méi lues +of.options.FULLSCREEN_MODE.tooltip.3= WxH - benotz eng eege Opléisung, ka méi schnell sinn +of.options.FULLSCREEN_MODE.tooltip.4=D'ausgewielten Opléisung gëtt am Vollbildmodus +of.options.FULLSCREEN_MODE.tooltip.5=benotzt (F11). +of.options.FULLSCREEN_MODE.tooltip.6=Eng méi eng geréng Opléisung sollt méi schnell sinn. + +of.options.SHOW_FPS=FPS uweisen +of.options.SHOW_FPS.tooltip.1=Weist kompriméiert FPS a Render Informatiounen un +of.options.SHOW_FPS.tooltip.2= Fps - Duerchschnëttlech/Minimum +of.options.SHOW_FPS.tooltip.3= C: - Chunkrenderer +of.options.SHOW_FPS.tooltip.4= E: - Objet- a Blockrenderer +of.options.SHOW_FPS.tooltip.5= U: - Chunk Updates +of.options.SHOW_FPS.tooltip.6=D'kompakt FPS Informatioune ginn nëmmen ugewisen +of.options.SHOW_FPS.tooltip.7=wann de Debug-Bildschierm net siichtbar ass. + +of.options.save.default=Standard (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autospäicheren +of.options.AUTOSAVE_TICKS.tooltip.1=Autospäicher Intervall +of.options.AUTOSAVE_TICKS.tooltip.2=Den normalen Autospäicher Intervall (2s) ass net +of.options.AUTOSAVE_TICKS.tooltip.3=recommandéiert +of.options.AUTOSAVE_TICKS.tooltip.4=Autospäichere verursaacht de bekannte Lag vum Doud. + +of.options.SCREENSHOT_SIZE=Scrnshot Gréisst +of.options.SCREENSHOT_SIZE.tooltip.1=Screenshot Gréisst +of.options.SCREENSHOT_SIZE.tooltip.2= Standard - Standard Screenshot Gréisst +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - Benotzerdefinéiert Screenshot Opléisung +of.options.SCREENSHOT_SIZE.tooltip.4=D'Ophuele vu méi grousse Screenshots ka méi +of.options.SCREENSHOT_SIZE.tooltip.5=Späicher brauchen. +of.options.SCREENSHOT_SIZE.tooltip.6=Net kompatibel mat Schnellem Renderen an Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.7=Erfuerdert GPU Billerpuffer Ënnerstëtzung. + +of.options.SHOW_GL_ERRORS=Wéis GL Feeler +of.options.SHOW_GL_ERRORS.tooltip.1=Wéis OpenGL Feeler +of.options.SHOW_GL_ERRORS.tooltip.2=Falls aktivéiert ginn OpenGL Feeler am Chat ugewisen. +of.options.SHOW_GL_ERRORS.tooltip.3=Desaktivéier et nëmme wann ee bekannte Konflikt +of.options.SHOW_GL_ERRORS.tooltip.4=existéiert an d'Feeler net behuewe kenne ginn. +of.options.SHOW_GL_ERRORS.tooltip.5=Falls desaktivéiert ginn d'Feeler weiderhin an de +of.options.SHOW_GL_ERRORS.tooltip.6=Feelerlog geschriwwen an d'FPS kënne signifikant falen. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/nl_NL.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/nl_NL.lang new file mode 100644 index 0000000..0214b5d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/nl_NL.lang @@ -0,0 +1,745 @@ +# General +of.general.ambiguous=dubbelzinnig +of.general.compact=Compact +of.general.custom=Aangepast +of.general.from=Van +of.general.id=Id +of.general.max=Maximaal +of.general.restart=herstarten +of.general.smart=Slim + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing is niet compatibel met Shaders. +of.message.aa.shaders2=Schakel Shaders uit om deze optie te gebruiken. + +of.message.af.shaders1=Anisotropische Filtering is niet compatibel met Shaders. +of.message.af.shaders2=Schakel Shaders uit om deze optie te gebruiken. + +of.message.fr.shaders1=Snelle Render is niet compatibel met Shaders. +of.message.fr.shaders2=Schakel Shaders uit om deze optie te gebruiken. + +of.message.an.shaders1=3D Anaglyph is niet compatibel met Shaders. +of.message.an.shaders2=Schakel Shaders uit om deze optie te gebruiken. + +of.message.shaders.aa1=Shaders zijn niet compatibel met Antialiasing. +of.message.shaders.aa2=Zet Quality -> Antialiasing UIT en herstart het spel. + +of.message.shaders.af1=Shaders zijn niet compatibel met Anisotropic Filtering. +of.message.shaders.af2=Zet Quality -> Anisotropische Filtering UIT. + +of.message.shaders.fr1=Shaders zijn niet compatibel met Snelle Render. +of.message.shaders.fr2=Zet Performance -> Snelle Render UIT. + +of.message.shaders.an1=Shaders zijn niet compatibel met 3D Anaglyph. +of.message.shaders.an2=Zet Other -> 3D Anaglyph UIT. + +of.message.shaders.nv1=Deze shader pack vereist een nieuwere OptiFine versie: %s +of.message.shaders.nv2=Weet je zeker dat je door wilt gaan? + +of.message.newVersion=Een nieuwe §eOptiFine§f versie is beschikbaar: §e%s§f +of.message.java64Bit=Je kunt §e64-bit Java§f installeren voor betere prestaties. +of.message.openglError=§eOpenGL Error§f: %s (%s) + +of.message.shaders.loading=Shaders laden: %s + +of.message.other.reset=Alle video instellingen herstellen naar standaard waarden? + +of.message.loadingVisibleChunks=Zichtbare chunks laden + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine Cape... + +of.options.capeOF.title=OptiFine Cape +of.options.capeOF.openEditor=Open Cape Bewerker +of.options.capeOF.reloadCape=Cape Herladen + +of.message.capeOF.openEditor=De OptiFine cape bewerker opent in je web browser. +of.message.capeOF.reloadCape=The cape zal herladen in 15 seconde. + +of.message.capeOF.error1=Mojang authenticatie mislukt. +of.message.capeOF.error2=Error: %s + +# Video settings + +options.graphics.tooltip.1=Visuele Kwaliteit +options.graphics.tooltip.2= Snel - lagere kwaliteit, sneller +options.graphics.tooltip.3= Fraai - hogere kwaliteit, langzamer +options.graphics.tooltip.4=Verandert hoe wolken, bladeren, water, +options.graphics.tooltip.5=schaduwen and gras eruit ziet. + +of.options.renderDistance.tiny=Klein +of.options.renderDistance.short=Kort +of.options.renderDistance.normal=Normaal +of.options.renderDistance.far=Ver +of.options.renderDistance.extreme=Extreem +of.options.renderDistance.insane=Krankzinnig +of.options.renderDistance.ludicrous=Belachelijk + +options.renderDistance.tooltip.1=Zichtbare Afstand +options.renderDistance.tooltip.2= 2 Klein - 32m (snelste) +options.renderDistance.tooltip.3= 8 Normaal - 128m (normaal) +options.renderDistance.tooltip.4= 16 Ver - 256m (langzamer) +options.renderDistance.tooltip.5= 32 Extreem - 512m (langzaamste!) erg veeleisend +options.renderDistance.tooltip.6= 48 Krankzinnig - 768m, 2GB toegewezen RAM benodigd +options.renderDistance.tooltip.7= 64 Belachelijk - 1024m, 3GB toegewezen RAM benodigd +options.renderDistance.tooltip.8=Waarden boven de 16 (Ver) zijn alleen effectief in locale werelden. + +options.ao.tooltip.1=Zachte Verlichting +options.ao.tooltip.2= UIT - geen zachte verlichting (sneller) +options.ao.tooltip.3= Minimaal - simpele zachte verlichting (langzamer) +options.ao.tooltip.4= Maximaal - complexe zachte verlichting (langzaamste) + +options.framerateLimit.tooltip.1=Maximale framerate +options.framerateLimit.tooltip.2= VSync - gelimiteerd aan monitor framerate (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variabel +options.framerateLimit.tooltip.4= Onbeperkt - geen limiet (snelste) +options.framerateLimit.tooltip.5=Het framerate limiet verminderd FPS zelfs +options.framerateLimit.tooltip.6=als het limiet niet is bereikt. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Zachte Verlichting Level +of.options.AO_LEVEL.tooltip.1=Zachte verlichting level +of.options.AO_LEVEL.tooltip.2= UIT - geen schaduwen +of.options.AO_LEVEL.tooltip.3= 50%% - lichte schaduwen +of.options.AO_LEVEL.tooltip.4= 100%% - donkere schaduwen + +options.viewBobbing.tooltip.1=Realistischere Bewegingen +options.viewBobbing.tooltip.2=Als je mipmaps gebruikt zet dit UIT voor het beste resultaat. + +options.guiScale.tooltip.1=GUI Schaal +options.guiScale.tooltip.2= Auto - maximale grootte +options.guiScale.tooltip.3= Klein, Normaal, Groot - 1x tot 3x +options.guiScale.tooltip.4= 4x tot 10x - beschikbaar op 4K displays +options.guiScale.tooltip.5=Oneven waarden (1x, 3x, 5x ...) zijn niet compatibel met Unicode. +options.guiScale.tooltip.6=Een kleinere GUI kan sneller zijn. + +options.vbo=VBO's gebruiken +options.vbo.tooltip.1=Vertex Buffer Objecten +options.vbo.tooltip.2=Gebruikt een alternatieve rendering model die over het algemeen +options.vbo.tooltip.3=sneller is (5-10%%) dan standaard rendering. + +options.gamma.tooltip.1=Verandert de helderheid van donkere objecten. +options.gamma.tooltip.2= Somber - standaard helderheid +options.gamma.tooltip.3= 1-99%% - variabel +options.gamma.tooltip.4= Helder - maximale helderheid voor donkere objecten +options.gamma.tooltip.5=Deze optie verandert niet de helderheid van +options.gamma.tooltip.6=zwarte objecten. + +options.anaglyph.tooltip.1=3D Anaglyph +options.anaglyph.tooltip.2=Activeerd een stereoscopisch 3D effect met verschillende kleuren +options.anaglyph.tooltip.3=voor elk oog. +options.anaglyph.tooltip.4=3D bril (rood-cyaan) benodigd voor juiste weergave. + +of.options.ALTERNATE_BLOCKS=Alternatieve Blokken +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternatieve Blokken +of.options.ALTERNATE_BLOCKS.tooltip.2=Gebruikt alternatieve blok modellen voor sommige blokken. +of.options.ALTERNATE_BLOCKS.tooltip.3=Hangt af van het geselecteerde bronpakket. + +of.options.FOG_FANCY=Mist +of.options.FOG_FANCY.tooltip.1=Mist type +of.options.FOG_FANCY.tooltip.2= Snel - snellere mist +of.options.FOG_FANCY.tooltip.3= Fraai - langzamere mist, ziet er beter uit +of.options.FOG_FANCY.tooltip.4= OFF - geen mist, snelste +of.options.FOG_FANCY.tooltip.5=Fraaie mist is alleen beschikbaar als je +of.options.FOG_FANCY.tooltip.6=videokaart dit ondersteund. + +of.options.FOG_START=Mist Start +of.options.FOG_START.tooltip.1=Mist start +of.options.FOG_START.tooltip.2= 0.2 - mist start in de buurt van de speler +of.options.FOG_START.tooltip.3= 0.8 - mist start ver van de speler +of.options.FOG_START.tooltip.4=Deze optie heeft geen invloed op prestaties. + +of.options.CHUNK_LOADING=Chunks Laden +of.options.CHUNK_LOADING.tooltip.1=Chunks Laden +of.options.CHUNK_LOADING.tooltip.2= Standaard - instabiele FPS wanneer chunks geladen worden +of.options.CHUNK_LOADING.tooltip.3= Stabiel - stabiele FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - stabiele FPS, 3x sneller laden +of.options.CHUNK_LOADING.tooltip.5=Stabiel en Multi-Core elimineerd instabiliteit +of.options.CHUNK_LOADING.tooltip.6=veroorzaakt door het laden van chunks. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core kan het laden met 3x versnellen en +of.options.CHUNK_LOADING.tooltip.8=de FPS verhogen door een tweede processor kern te gebruiken. +of.options.chunkLoading.smooth=Stabiel +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=UIT +of.options.shaders.packDefault=(intern) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= UIT - (standaard) geen antialiasing (sneller) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - vloeiendere lijnen en randen (langzamer) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA is een video effect die lijnen, randen +of.options.shaders.ANTIALIASING.tooltip.5=en kleurtransities vloeiender maakt. +of.options.shaders.ANTIALIASING.tooltip.6=Het is sneller dan traditionele antialiasing +of.options.shaders.ANTIALIASING.tooltip.7=en is compatibel met Shaders en Snelle Render. + +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.1=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.2= AAN - (standaard) activeer normal maps +of.options.shaders.NORMAL_MAP.tooltip.3= UIT - deactiveer normal maps +of.options.shaders.NORMAL_MAP.tooltip.4=Normal maps kunnen bij met Shaders gebruikt +of.options.shaders.NORMAL_MAP.tooltip.5=worden om 3D geometrie te simuleren op een plat oppervlak. +of.options.shaders.NORMAL_MAP.tooltip.6=De normal map textures zijn geleverd +of.options.shaders.NORMAL_MAP.tooltip.7=met het geselecteerde bronpakket. + +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.1=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.2= AAN - (standaard) activeer specular maps +of.options.shaders.SPECULAR_MAP.tooltip.3= UIT - deactiveer specular maps +of.options.shaders.SPECULAR_MAP.tooltip.4=Specular maps kunnen gebruikt worden +of.options.shaders.SPECULAR_MAP.tooltip.5=om weerspiegeling te simuleren. +of.options.shaders.SPECULAR_MAP.tooltip.6=De specular maps zijn geleverd +of.options.shaders.SPECULAR_MAP.tooltip.7=met het geselecteerde bronpakket. + +of.options.shaders.RENDER_RES_MUL=Render Kwaliteit +of.options.shaders.RENDER_RES_MUL.tooltip.1=Render Kwaliteit +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - laag (snelste) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standaard (standaard) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - hoog (langzaamste) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Render kwaliteit regelt de maat van +of.options.shaders.RENDER_RES_MUL.tooltip.6=textures gebruikt door het shader pakket. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Lagere waarden zijn handig voor 4K displays. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Hogere waarden welke als antialiasing. + +of.options.shaders.SHADOW_RES_MUL=Schaduw Kwaliteit +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Schaduw Kwaliteit +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - laag (snelste) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standaard (standaard) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - hoog (langzaamste) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Schaduw kwaliteit regelt de maat van de schaduw map +of.options.shaders.SHADOW_RES_MUL.tooltip.6=texture gebruikt door het shader pakket. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Lagere waarden = onnauwkeurig, grove schaduwen. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Hogere waarden = gedetailleerd, fijnere schaduwen. + +of.options.shaders.HAND_DEPTH_MUL=Hand Depth +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Hand Diepte +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - hand dicht bij de camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (standaard) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - hand ver van de camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Hand diepte regelt hoe ver vastgehouden objecten zijn +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=van de camera. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Voor shader pakketen die diepte blur gebruiken veranderd +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=dit de vervaaging van vastgehouden objecten. + +of.options.shaders.CLOUD_SHADOW=Wolken Schaduw + +of.options.shaders.OLD_HAND_LIGHT=Oude Handbelichting +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Oud Hand Licht +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Standaard - geregeld door het shader pakket +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= AAN - gebruik oude handbelichting +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= UIT - gebruik nieuwe handbelichting +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Oude handbelichting maakt het mogelijk voor shader paketten +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=die alleen belichte objecten in de primaire hand herkennen +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=ook belichte objecten in de secundaire hand te herkennen. + +of.options.shaders.OLD_LIGHTING=Oude Belichting +of.options.shaders.OLD_LIGHTING.tooltip.1=Oude Belichting +of.options.shaders.OLD_LIGHTING.tooltip.2= Standaard - geregeld door het shader pakket +of.options.shaders.OLD_LIGHTING.tooltip.3= AAN - gebruik oude belichting +of.options.shaders.OLD_LIGHTING.tooltip.4= OFF - gebruik nieuwe belichting +of.options.shaders.OLD_LIGHTING.tooltip.5=Oude belichting regelt de vaste belichting toegepast +of.options.shaders.OLD_LIGHTING.tooltip.6=door vanilla aan de zijkanten van blokken. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shader pakketten die schaduw gebruiken zijn meestal voorzien +of.options.shaders.OLD_LIGHTING.tooltip.8=van betere belichting afhankelijk van de positie van de zon. + +of.options.shaders.DOWNLOAD=Download Shaders +of.options.shaders.DOWNLOAD.tooltip.1=Download Shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Opent de shader pakketten in de web browser +of.options.shaders.DOWNLOAD.tooltip.4=Stop het gedownloade shader pakket in de "Shaders" map +of.options.shaders.DOWNLOAD.tooltip.5=en ze zullen verschijnen in de lijst van geïnstalleerde shaders. + +of.options.shaders.SHADER_PACK=Shader Pakket + +of.options.shaders.shadersFolder=Shaders Map +of.options.shaders.shaderOptions=Shader Opties... + +of.options.shaderOptionsTitle=Shader Opties + +of.options.quality=Kwaliteit... +of.options.qualityTitle=Kwaliteit Instellingen + +of.options.details=Details... +of.options.detailsTitle=Detail Installingen + +of.options.performance=Prestatie... +of.options.performanceTitle=Prestatie Instellingen + +of.options.animations=Animatie... +of.options.animationsTitle=Animatie Instellingen + +of.options.other=Overige... +of.options.otherTitle=Overige Instellingen + +of.options.other.reset=Video Instellingen Herstellen... + +of.shaders.profile=Profiel + +# Quality + +of.options.mipmap.bilinear=Bilineair +of.options.mipmap.linear=Lineair +of.options.mipmap.nearest=Dichtsbijzijnd +of.options.mipmap.trilinear=Trilineair + +options.mipmapLevels.tooltip.1=Visuele effecten die verre objecten er beter uit doen zien +options.mipmapLevels.tooltip.2=door texture details zachter te maken +options.mipmapLevels.tooltip.3= UIT - geen verzachting +options.mipmapLevels.tooltip.4= Minimaal - minimale verzachting +options.mipmapLevels.tooltip.5= Maximaal - maximale verzachting +options.mipmapLevels.tooltip.6=Deze optie heeft geen invloed op prestaties. + +of.options.MIPMAP_TYPE=Mipmap Type +of.options.MIPMAP_TYPE.tooltip.1=Visueel effect die verre objecten er beter uit doen zien +of.options.MIPMAP_TYPE.tooltip.2=door texture details zachter te maken +of.options.MIPMAP_TYPE.tooltip.3= Dichtsbijzijnd - grove verzachting (snelste) +of.options.MIPMAP_TYPE.tooltip.4= Lineair - normale verzachting +of.options.MIPMAP_TYPE.tooltip.5= Bilineair - fijne verzachting +of.options.MIPMAP_TYPE.tooltip.6= Trilineair - fijnste verzachting (langzaamste) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= UIT - (standaard) geen antialiasing (sneller) +of.options.AA_LEVEL.tooltip.3= 2-16 - geantialiaseerde lijnen en randen (langzamer) +of.options.AA_LEVEL.tooltip.4=Antialiasing maakt lijnen, randen +of.options.AA_LEVEL.tooltip.5=en kleurtransities vloeiender. +of.options.AA_LEVEL.tooltip.6=Wanneer geactiveerd kan dit een grote impact hebben op de FPS. +of.options.AA_LEVEL.tooltip.7=Niet alle levels zijn door alle videokaarten ondersteund. +of.options.AA_LEVEL.tooltip.8=Effectief na herstarten van het spel. + +of.options.AF_LEVEL=Anisotropische Filtering +of.options.AF_LEVEL.tooltip.1=Anisotropische Filtering +of.options.AF_LEVEL.tooltip.2= UIT - (standaard) standaard texture detail (sneller) +of.options.AF_LEVEL.tooltip.3= 2-16 - fijnere details in gemipmapde textures (langzamer) +of.options.AF_LEVEL.tooltip.4=De Anisotropische Filtering herstelt details in +of.options.AF_LEVEL.tooltip.5=gemipmapde textures. +of.options.AF_LEVEL.tooltip.6=Wanneer geactiveerd kan dit een grote impact hebben op de FPS. + +of.options.CLEAR_WATER=Helder Water +of.options.CLEAR_WATER.tooltip.1=Helder Water +of.options.CLEAR_WATER.tooltip.2= AAN - helder, transparant water +of.options.CLEAR_WATER.tooltip.3= UIT - standaard water + +of.options.RANDOM_ENTITIES=Willekeurige Entiteiten +of.options.RANDOM_ENTITIES.tooltip.1=Willekeurige Entiteiten +of.options.RANDOM_ENTITIES.tooltip.2= UIT - geen willekeurige entiteiten, sneller +of.options.RANDOM_ENTITIES.tooltip.3= AAN - willekeurige entiteiten, langzamer +of.options.RANDOM_ENTITIES.tooltip.4=Willekeurige Entiteiten gebruikt willekeurige textures voor entiteiten. +of.options.RANDOM_ENTITIES.tooltip.5=Heeft een bronpakket met meerdere textures voor entiteiten nodig. + +of.options.BETTER_GRASS=Beter Gras +of.options.BETTER_GRASS.tooltip.1=Beter Gras +of.options.BETTER_GRASS.tooltip.2= UIT - standaard gras texture, snelste +of.options.BETTER_GRASS.tooltip.3= Snel - volledige gras texture, langzamer +of.options.BETTER_GRASS.tooltip.4= Fraai - dynamische gras texture, langzaamste + +of.options.BETTER_SNOW=Betere Sneeuw +of.options.BETTER_SNOW.tooltip.1=Betere Sneeuw +of.options.BETTER_SNOW.tooltip.2= UIT - standaard sneeuw, sneller +of.options.BETTER_SNOW.tooltip.3= AAN - betere sneeuw, langzamer +of.options.BETTER_SNOW.tooltip.4=Geeft sneeuw onder transparante blokken weer (hekken, gras) +of.options.BETTER_SNOW.tooltip.5=bij het aangrenzen van sneeuw. + +of.options.CUSTOM_FONTS=Aangepaste Lettertypen +of.options.CUSTOM_FONTS.tooltip.1=Aangepaste Lettertypen +of.options.CUSTOM_FONTS.tooltip.2= AAN - gebruik aangepaste lettertypen (standaard), langzamer +of.options.CUSTOM_FONTS.tooltip.3= UIT - gebruik standaard lettertype, sneller +of.options.CUSTOM_FONTS.tooltip.4=De aangepaste lettertypen zijn geleverd door het huidige +of.options.CUSTOM_FONTS.tooltip.5=bronpakket. + +of.options.CUSTOM_COLORS=Aangepaste Kleuren +of.options.CUSTOM_COLORS.tooltip.1=Aangepaste Kleuren +of.options.CUSTOM_COLORS.tooltip.2= AAN - gebruik aangepaste kleuren (standaard), langzamer +of.options.CUSTOM_COLORS.tooltip.3= UIT - gebruik standaard kleuren, sneller +of.options.CUSTOM_COLORS.tooltip.4=De aangepaste kleuren zijn geleverd door het huidige +of.options.CUSTOM_COLORS.tooltip.5=bronpakket. + +of.options.SWAMP_COLORS=Moeras Kleuren +of.options.SWAMP_COLORS.tooltip.1=Moeras Kleuren +of.options.SWAMP_COLORS.tooltip.2= AAN - gebruik moeras kleuren (standaard), langzamer +of.options.SWAMP_COLORS.tooltip.3= UIT - gebruik geen moeras kleuren, sneller +of.options.SWAMP_COLORS.tooltip.4=Heeft effect op gras, bladeren lianen en water. + +of.options.SMOOTH_BIOMES=Vloeiende Biotopen +of.options.SMOOTH_BIOMES.tooltip.1=Vloeiende Biotopen +of.options.SMOOTH_BIOMES.tooltip.2= AAN - verzacht grenzen tussen biotopen (standaard), langzamer +of.options.SMOOTH_BIOMES.tooltip.3= UIT - geen verzachting van biotoop grenzen, sneller +of.options.SMOOTH_BIOMES.tooltip.4=Het verzachten van biotoop grenzen is gedaan door het +of.options.SMOOTH_BIOMES.tooltip.5=nemen van de gemiddelde kleur van nabijgelegen blokken. +of.options.SMOOTH_BIOMES.tooltip.6=Heeft effect op gras, bladeren lianen en water + +of.options.CONNECTED_TEXTURES=Verbonden Textures +of.options.CONNECTED_TEXTURES.tooltip.1=Verbonden Textures +of.options.CONNECTED_TEXTURES.tooltip.2= UIT - geen verbonden textures (standaard) +of.options.CONNECTED_TEXTURES.tooltip.3= Snel - snelle verbonden textures +of.options.CONNECTED_TEXTURES.tooltip.4= Fraai - fraaie verbonden textures +of.options.CONNECTED_TEXTURES.tooltip.5=Verbind de textures van glas, sandstone en +of.options.CONNECTED_TEXTURES.tooltip.6=boekenkasten wanneer naast elkaar geplaatst. +of.options.CONNECTED_TEXTURES.tooltip.7=Verbonden textures worden geleverd door +of.options.CONNECTED_TEXTURES.tooltip.8=het geselecteerde bronpakket. + +of.options.NATURAL_TEXTURES=Natuurlijke Textures +of.options.NATURAL_TEXTURES.tooltip.1=Natuurlijke Textures +of.options.NATURAL_TEXTURES.tooltip.2= UIT - geen natuurlijke textures (standaard) +of.options.NATURAL_TEXTURES.tooltip.3= AAN - gebruik natuurlijke textures +of.options.NATURAL_TEXTURES.tooltip.4=Natuurlijke textures elimineren hetroosterachtige patroon +of.options.NATURAL_TEXTURES.tooltip.5=dat ontstaat bij het herhalen van dezelfde blokken. +of.options.NATURAL_TEXTURES.tooltip.6=Het gebruikt gedraaide en gespiegelde varianten van +of.options.NATURAL_TEXTURES.tooltip.7=de basis texture. De configuratie voor de natuurlijke +of.options.NATURAL_TEXTURES.tooltip.8=textures geleverd door het geselecteerde bronpakket. + +of.options.EMISSIVE_TEXTURES=Belichte Textures +of.options.EMISSIVE_TEXTURES.tooltip.1=Belichte Textures +of.options.EMISSIVE_TEXTURES.tooltip.2= UIT - geen belichte textures (standaard) +of.options.EMISSIVE_TEXTURES.tooltip.3= AAN - gebruik belichte textures +of.options.EMISSIVE_TEXTURES.tooltip.4=De belichte textures zijn gerenderd als overlays +of.options.EMISSIVE_TEXTURES.tooltip.5=met volle helderheid. Deze kunen gebruikt worden om +of.options.EMISSIVE_TEXTURES.tooltip.6=belichting van delen van de basis texture te simuleren. +of.options.EMISSIVE_TEXTURES.tooltip.7=Belichte textures zijn geleverd door het geselecteerde +of.options.EMISSIVE_TEXTURES.tooltip.8=bronpakket. + +of.options.CUSTOM_SKY=Aangepaste Hemel +of.options.CUSTOM_SKY.tooltip.1=Aangepaste Hemel +of.options.CUSTOM_SKY.tooltip.2= AAN - aangepaste hemel textures (standard), langzaam +of.options.CUSTOM_SKY.tooltip.3= UIT - standaard hemel, sneller +of.options.CUSTOM_SKY.tooltip.4=Aangepaste hemel textures zijn geleverd door het geselecteerde +of.options.CUSTOM_SKY.tooltip.5=bronpakket. + +of.options.CUSTOM_ITEMS=Aangepaste Objecten +of.options.CUSTOM_ITEMS.tooltip.1=Aangepasten Objecten +of.options.CUSTOM_ITEMS.tooltip.2= AAN - aangepaste object textures inschakelen (standaard), langzaam +of.options.CUSTOM_ITEMS.tooltip.3= UIT - standaard object textures, sneller +of.options.CUSTOM_ITEMS.tooltip.4=Aangepaste object textures zijn geleverd door het geselecteerde +of.options.CUSTOM_ITEMS.tooltip.5=bronpakket. + +of.options.CUSTOM_ENTITY_MODELS=Aangepaste Entiteit Modellen +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Aangepaste Entiteit Modellen +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= AAN - aangepaste entiteit modellen (standaard), langzaam +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= UIT - standaard entiteit modellen, sneller +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Aangepaste entiteit modellen zijn geleverd door het geselecteerde +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=bronpakket. + +of.options.CUSTOM_GUIS=Aangepaste GUIs +of.options.CUSTOM_GUIS.tooltip.1=Aangepaste GUIs +of.options.CUSTOM_GUIS.tooltip.2= AAN - aangepaste GUIs (standaard), langzamer +of.options.CUSTOM_GUIS.tooltip.3= UIT - standaard GUIs, sneller +of.options.CUSTOM_GUIS.tooltip.4=Aangepaste GUIs zijn geleverd door het geselecteerde bronpakket. + +# Details + +of.options.CLOUDS=Wolken +of.options.CLOUDS.tooltip.1=Wolken +of.options.CLOUDS.tooltip.2= Standaard - als ingesteld bij Grafische Instellingen +of.options.CLOUDS.tooltip.3= Snel - lagere kwaliteit, sneller +of.options.CLOUDS.tooltip.4= Fraai - hogere kwaliteit, langzamer +of.options.CLOUDS.tooltip.5= UIT - geen wolken, snelste +of.options.CLOUDS.tooltip.6=Snelle wolken zijn 2D. +of.options.CLOUDS.tooltip.7=Fraaie wolken zijn 3D. + +of.options.CLOUD_HEIGHT=Wolk Hoogte +of.options.CLOUD_HEIGHT.tooltip.1=Wolk Hoogte +of.options.CLOUD_HEIGHT.tooltip.2= UIT - standaard hoogte +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - boven wereld hoogte limiet + +of.options.TREES=Bomen +of.options.TREES.tooltip.1=Bomen +of.options.TREES.tooltip.2= Standaard - als ingesteld bij Grafische Instellingen +of.options.TREES.tooltip.3= Snel - lagere kwaliteit, sneller +of.options.TREES.tooltip.4= Slim - hogere kwaliteit, snel +of.options.TREES.tooltip.5= Fraai - hoogste kwaliteit, langzamer +of.options.TREES.tooltip.6=Snelle bomen hebben ondoorzichtige bladeren. +of.options.TREES.tooltip.7=Fraai en slimme bomen hebben transparante bladeren. + +of.options.RAIN=Regen en Sneeuw +of.options.RAIN.tooltip.1=Regen en Sneeuw +of.options.RAIN.tooltip.2= Standaard - als ingesteld bij Grafische Instellingen +of.options.RAIN.tooltip.3= Snel - lichte regen/sneeuw, sneller +of.options.RAIN.tooltip.4= Fraai - hevige regen/sneeuw, langzamer +of.options.RAIN.tooltip.5= UIT - geen regen/sneeuw, snelste +of.options.RAIN.tooltip.6=Als regen UIT is zijn spatten en geluid +of.options.RAIN.tooltip.7=nogsteeds actief. + +of.options.SKY=Hemel +of.options.SKY.tooltip.1=Hemel +of.options.SKY.tooltip.2= AAN - hemel is zichtbaar, langzamer +of.options.SKY.tooltip.3= UIT - hemel is niet zichtbaar, sneller +of.options.SKY.tooltip.4=Als hemel UIT is zijn de maan en zon nog zichtbaar. + +of.options.STARS=Sterren +of.options.STARS.tooltip.1=Sterren +of.options.STARS.tooltip.2= AAN - sterren zijn zichtbaar, langzamer +of.options.STARS.tooltip.3= UIT - sterren zijn niet zichtbaar, sneller + +of.options.SUN_MOON=Zon en Maan +of.options.SUN_MOON.tooltip.1=Zon en Maan +of.options.SUN_MOON.tooltip.2= AAN - zon en maan zijn zichtbaar (standaard) +of.options.SUN_MOON.tooltip.3= UIT - zon en maan zijn niet zichtbaar (sneller) + +of.options.SHOW_CAPES=Capes Tonen +of.options.SHOW_CAPES.tooltip.1=Capes Tonen +of.options.SHOW_CAPES.tooltip.2= AAN - speler capes tonen (standaard) +of.options.SHOW_CAPES.tooltip.3= UIT - geen speler capes tonen + +of.options.TRANSLUCENT_BLOCKS=Doorschijnende Blokken +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Doorschijnende Blokken +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Standaard - als ingesteld bij Grafische Instellingen +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Fraai - correcte kleurtransities (langzamer) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Snel - snelle kleurtransities (sneller) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Regelt de kleurtransities van doorschijnende blokken +of.options.TRANSLUCENT_BLOCKS.tooltip.6=met verschillende kleuren (gekleurd glas, water, ijs) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=wanneer deze achter elkaar staan met lucht ertussen. + +of.options.HELD_ITEM_TOOLTIPS=Vastgehouden Object Tooltips +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Vastgehouden Object Tooltips +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= AAN - laat tooltips zien voor vastgehouden objecten (standaard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= UIT - laat geen tooltips zien voor vastgehouden objecten + +of.options.ADVANCED_TOOLTIPS=Geadvanceerde Tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.1=Geadvanceerde tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.2= AAN - laat geadvanceerde tooltips zien +of.options.ADVANCED_TOOLTIPS.tooltip.3= UIT - laat geen geadvanceerde tooltips zien (standaard) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Geadvanceerde tooltips laten meer informatie zien +of.options.ADVANCED_TOOLTIPS.tooltip.5=voor bepaalde objecten (id, levensduur) en voor shader opties +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, bron, standaard waarde). + +of.options.DROPPED_ITEMS=Gevallen Objecten +of.options.DROPPED_ITEMS.tooltip.1=Gevallen Objecten +of.options.DROPPED_ITEMS.tooltip.2= Standaard - als ingesteld bij Grafische Instellingen +of.options.DROPPED_ITEMS.tooltip.3= Snel - 2D gevallen objecten (sneller) +of.options.DROPPED_ITEMS.tooltip.4= Fraai - 3D gevallen objecten(langzamer) + +options.entityShadows.tooltip.1=Entiteit Schaduw +options.entityShadows.tooltip.2= AAN - geef entiteit schaduwen weer +options.entityShadows.tooltip.3= UIT - geef geen entiteit schaduwen weer + +of.options.VIGNETTE=Vignet +of.options.VIGNETTE.tooltip.1=Visueel effect die de hoeken van het scherm donkerder maakt +of.options.VIGNETTE.tooltip.2= Standaard - als ingesteld bij Grafische Instellingen (standaard) +of.options.VIGNETTE.tooltip.3= Snel - gebruik geen vignet (sneller) +of.options.VIGNETTE.tooltip.4= Fraai - gebruik vignet (langzamer) +of.options.VIGNETTE.tooltip.5=Het vignet kan een grote impact hebben op de FPS, +of.options.VIGNETTE.tooltip.6=voornamelijk bij gebruik van volledig scherm. +of.options.VIGNETTE.tooltip.7=Het vignet effect is erg subtiel and kan +of.options.VIGNETTE.tooltip.8=veilig gedeactiveerd worden. + +of.options.DYNAMIC_FOV=Dynamisch Gezichtsveld +of.options.DYNAMIC_FOV.tooltip.1=Dynamisch Gezichtsveld +of.options.DYNAMIC_FOV.tooltip.2= AAN - gebruik dynamisch gezichtsveld (standaard) +of.options.DYNAMIC_FOV.tooltip.3= UIT - gebruik geen dynamisch gezichtsveld +of.options.DYNAMIC_FOV.tooltip.4=Verandert het gezichtsveld (FOV) bij het vliegen, sprinten +of.options.DYNAMIC_FOV.tooltip.5=of trekken van een boog. + +of.options.DYNAMIC_LIGHTS=Dynamische Verlichting +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamische Verlichting +of.options.DYNAMIC_LIGHTS.tooltip.2= UIT - geen dynamische verlichting (standaard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Snel - snelle dynamische verlichting (update elke 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Fraai - fraaie dynamische verlichting (update onmiddeljk) +of.options.DYNAMIC_LIGHTS.tooltip.5=Stelt verlichte objecten (fakkel, gloeisteen, etc.) in staat +of.options.DYNAMIC_LIGHTS.tooltip.6=om nabije blokken te verlichten wanneer zelf vastgehouden, +of.options.DYNAMIC_LIGHTS.tooltip.7=vastgehouden door een andere speler op de grond gegooid. + +# Performance + +of.options.SMOOTH_FPS=Stabiele FPS +of.options.SMOOTH_FPS.tooltip.1=Stabiliseerd FPS door de grafische driver buffers te wissen. +of.options.SMOOTH_FPS.tooltip.2= UIT - geen stabilisatie, FPS kan verschillen +of.options.SMOOTH_FPS.tooltip.3= AAN - FPS stabilisatie +of.options.SMOOTH_FPS.tooltip.4=Deze optie ligt aan de grafische drivers en het effect +of.options.SMOOTH_FPS.tooltip.5=is niet altijd zichtbaar. + +of.options.SMOOTH_WORLD=Stabiele Wereld +of.options.SMOOTH_WORLD.tooltip.1=Verwijderd vertragingen veroorzaakt door de interne server. +of.options.SMOOTH_WORLD.tooltip.2= UIT - geen stabilisatie, FPS kan verschillen +of.options.SMOOTH_WORLD.tooltip.3= AAN - FPS stabilisatie +of.options.SMOOTH_WORLD.tooltip.4=Stabiliseerd FPS door het verdelen van de belasting van de interne server. +of.options.SMOOTH_WORLD.tooltip.5=Alleen effectief voor locale werelden (alleen spelen). + +of.options.FAST_RENDER=Snelle Render +of.options.FAST_RENDER.tooltip.1=Snelle Render +of.options.FAST_RENDER.tooltip.2= UIT - standaard render algoritme (standaard) +of.options.FAST_RENDER.tooltip.3= AAN - geoptimaliseerde render algoritme (sneller) +of.options.FAST_RENDER.tooltip.4=Gebruikt een geoptimaliseerde render algoritme die de belasting van de +of.options.FAST_RENDER.tooltip.5=videokaart verminderd wat de prestaties verbeterd. +of.options.FAST_RENDER.tooltip.6=Deze opties kan conflicteren met andere mods. + +of.options.FAST_MATH=Snelle Algebra +of.options.FAST_MATH.tooltip.1=Snelle Algebra +of.options.FAST_MATH.tooltip.2= UIT - standaard algebra (standaard) +of.options.FAST_MATH.tooltip.3= AAN - snellere algebra +of.options.FAST_MATH.tooltip.4=Gebruikt geoptimaliseerde sin() en cos() functies die de processor +of.options.FAST_MATH.tooltip.5=cache beter weten te gebruiken en zo de prestaties kunnen verbeteren. +of.options.FAST_MATH.tooltip.6=Deze optie kan een minimaal effect hebben op wereld generatie. + +of.options.CHUNK_UPDATES=Chunk Updates +of.options.CHUNK_UPDATES.tooltip.1=Chunk updates +of.options.CHUNK_UPDATES.tooltip.2= 1 - langzamer laden van de wereld, hogere FPS (standaard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - sneller laden van de wereld, lagere FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - snelste laden van de wereld, laagste FPS +of.options.CHUNK_UPDATES.tooltip.5=Aantal chunk updates per frame, +of.options.CHUNK_UPDATES.tooltip.6=hogere waarden kunnen prestaties instabiel maken. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamische Chunk Updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamische chunk updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= UIT - standaard aantal chunk updates per frame (standaard) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= AAN - meer updates terwijl de speler stil stat +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamische updates zorgen voor meer chunk updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=als de speler stil staat zodat de wereld sneller laadt. + +of.options.LAZY_CHUNK_LOADING=Luie Chunks Laden +of.options.LAZY_CHUNK_LOADING.tooltip.1=Luie Chunks Laden +of.options.LAZY_CHUNK_LOADING.tooltip.2= UIT - standaard laden van chunks +of.options.LAZY_CHUNK_LOADING.tooltip.3= AAN - luie methode van het laden van chunks (stabieler) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Maakt het laden van server chunks stabiler door het +of.options.LAZY_CHUNK_LOADING.tooltip.5=verdelen van het laden van chunks over meerdere ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Zet dit UIT als delen van de wereld niet correct laden. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Alleen effectief voor locale werelden (alleen spelen). + +of.options.RENDER_REGIONS=Render Regios +of.options.RENDER_REGIONS.tooltip.1=Render Regios +of.options.RENDER_REGIONS.tooltip.2= UIT - gebruik geen render regios (standaard) +of.options.RENDER_REGIONS.tooltip.3= AAN - gebruik render regions +of.options.RENDER_REGIONS.tooltip.4=Render regios maakt het sneller laden van terrein bij hogere +of.options.RENDER_REGIONS.tooltip.5=render bereiken mogelijk. Effectiever met VBOs ingeschakeld. +of.options.RENDER_REGIONS.tooltip.6=Niet aangeraden voor geïntegreerde grafische kaarten recommended for integrated graphics cards. + +of.options.SMART_ANIMATIONS=Slimme Animaties +of.options.SMART_ANIMATIONS.tooltip.1=Slimme Animaties +of.options.SMART_ANIMATIONS.tooltip.2= UIT - gebruik geen slimme animaties (standaard) +of.options.SMART_ANIMATIONS.tooltip.3= AAN - gebruik slimme animaties +of.options.SMART_ANIMATIONS.tooltip.4=Met slimme animaties worden alleen zichtbare blokken geanimeerd +of.options.SMART_ANIMATIONS.tooltip.5=Dit verminderd haperingen en verbeterd prestaties. +of.options.SMART_ANIMATIONS.tooltip.6=Vooral handig bij het gebruik van grote mod pakketten. +of.options.SMART_ANIMATIONS.tooltip.7=en HD bonpakketten + +# Animations + +of.options.animation.allOn=Alles AAN +of.options.animation.allOff=Alles UIT +of.options.animation.dynamic=Dynamisch + +of.options.ANIMATED_WATER=Water Geanimeerd +of.options.ANIMATED_LAVA=Lava Geanimeerd +of.options.ANIMATED_FIRE=Vuur Geanimeerd +of.options.ANIMATED_PORTAL=Portaal Geanimeerd +of.options.ANIMATED_REDSTONE=Redstone Geanimeerd +of.options.ANIMATED_EXPLOSION=Explosies Geanimeerd +of.options.ANIMATED_FLAME=Vlammen Geanimeerd +of.options.ANIMATED_SMOKE=Rook Geanimeerd +of.options.VOID_PARTICLES=Leegte Deeltjes +of.options.WATER_PARTICLES=Water Deeltjes +of.options.RAIN_SPLASH=Regen Plonzen +of.options.PORTAL_PARTICLES=Portaal Deeltjes +of.options.POTION_PARTICLES=Drank Deeltjes +of.options.DRIPPING_WATER_LAVA=Druipende Water/Lava +of.options.ANIMATED_TERRAIN=Terrein Geanimeerd +of.options.ANIMATED_TEXTURES=Textures Geanimeerd +of.options.FIREWORK_PARTICLES=Vuurwerk Deeltjes + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Toon de lagometer op het debug scherm (F3). +of.options.LAGOMETER.tooltip.2=* Oranje - Geheugen vuilnis collectie +of.options.LAGOMETER.tooltip.3=* Cyaan - Tick +of.options.LAGOMETER.tooltip.4=* Blauw - Geplande executables +of.options.LAGOMETER.tooltip.5=* Paars - Chunk upload +of.options.LAGOMETER.tooltip.6=* Rood - Chunk updates +of.options.LAGOMETER.tooltip.7=* Geel - Zichtbaarheids check +of.options.LAGOMETER.tooltip.8=* Groen - Render terrein + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= AAN - debug profiler is actief, langzamer +of.options.PROFILER.tooltip.3= UIT - debug profiler is niet actief, sneller +of.options.PROFILER.tooltip.4=De debug profiler verzameld en toont debug informatie +of.options.PROFILER.tooltip.5=als het debug scherm open is (F3). + +of.options.WEATHER=Weer +of.options.WEATHER.tooltip.1=Weer +of.options.WEATHER.tooltip.2= AAN - weer is actief, langzamer +of.options.WEATHER.tooltip.3= UIT - weer is niet actief, sneller +of.options.WEATHER.tooltip.4=Het weer bestuurt regen, sneeuw en onweersbuien. +of.options.WEATHER.tooltip.5=Het besturen van het weer is alleen mogelijk voor locale werelden. + +of.options.time.dayOnly=Alleen Dag +of.options.time.nightOnly=Alleen Nacht + +of.options.TIME=Tijd +of.options.TIME.tooltip.1=Tijd +of.options.TIME.tooltip.2= Standaard - normale dag/nacht cyclus +of.options.TIME.tooltip.3= Alleen Dag - alleen dag +of.options.TIME.tooltip.4= Alleen Nacht - alleen nacht +of.options.TIME.tooltip.5=De tijd instelling is alleen effectief in CREATIEVE modus +of.options.TIME.tooltip.6=en voor locale werelden. + +options.fullscreen.tooltip.1=Volledig Scherm +options.fullscreen.tooltip.2= AAN - gebruik volledig scherm modus +options.fullscreen.tooltip.3= UIT - gebruik venster modus +options.fullscreen.tooltip.4=Volledig scherm modus kan sneller of langzamer zij dan +options.fullscreen.tooltip.5=venster modus, afhankelijk van de grafische kaart. + +of.options.FULLSCREEN_MODE=Volledig Scherm Modus +of.options.FULLSCREEN_MODE.tooltip.1=Volledig Scherm Modus +of.options.FULLSCREEN_MODE.tooltip.2= Standaard - gebruik standaard resolutie, langzamer +of.options.FULLSCREEN_MODE.tooltip.3= BxH - gebruik een aangepaste resolutie, kan sneller zijn +of.options.FULLSCREEN_MODE.tooltip.4=De geselecteerde resolutie wordt gebruikt in volledig scherm modus (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Lagere resoluties zijn over het algemeen sneller. + +of.options.SHOW_FPS=FPS Tonen +of.options.SHOW_FPS.tooltip.1=Toon compacte FPS en render informatie. +of.options.SHOW_FPS.tooltip.2= FPS - gemiddeld/minimum +of.options.SHOW_FPS.tooltip.3= C: - chunk renderaars +of.options.SHOW_FPS.tooltip.4= E: - gerenderde entiteiten + blok entiteiten +of.options.SHOW_FPS.tooltip.5= U: - chunk updates +of.options.SHOW_FPS.tooltip.6=De compacte FPS informatie is alleen zichtbaar +of.options.SHOW_FPS.tooltip.7=als het debug scherm niet zichtbaar is. + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3m +of.options.save.6min=6m +of.options.save.12min=12m +of.options.save.24min=24m + +of.options.AUTOSAVE_TICKS=Automatisch Opslaan +of.options.AUTOSAVE_TICKS.tooltip.1=Auto Interval +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - standaard +of.options.AUTOSAVE_TICKS.tooltip.3=Automatisch opslaan kan haperingen veroorzaken afhankelijk van de render afstand. +of.options.AUTOSAVE_TICKS.tooltip.4=De wereld wordt ook opgeslagen bij het pauzeren. + +of.options.SCREENSHOT_SIZE=Schermafbeelding Maat +of.options.SCREENSHOT_SIZE.tooltip.1=Schermafbeelding Maat +of.options.SCREENSHOT_SIZE.tooltip.2= Standaard - standaard schermafbeelding maat +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - aangepaste schermafbeelding maat +of.options.SCREENSHOT_SIZE.tooltip.4=Het maken van grotere schermafbeeldingen heeft meer geheugen nodig. +of.options.SCREENSHOT_SIZE.tooltip.5=Niet compatibel met Snelle Render en Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Vereist videokaart framebuffer ondersteuning. + +of.options.SHOW_GL_ERRORS=GL Errors Tonen +of.options.SHOW_GL_ERRORS.tooltip.1=OpenGL Errors Tonen +of.options.SHOW_GL_ERRORS.tooltip.2=OpenGL errors worden in chat weergegeven wanneer geactiveerd. +of.options.SHOW_GL_ERRORS.tooltip.3=Schakel uit als er een bekend conflict is en +of.options.SHOW_GL_ERRORS.tooltip.4=de errors niet opgelost kunnen worden. +of.options.SHOW_GL_ERRORS.tooltip.5=Zodra uitgeschakeld worden errors alsnog gelogd in het +of.options.SHOW_GL_ERRORS.tooltip.6=error log en kan dit nogsteeds instabiliteit veroorzaken. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Chat Achtergrond +of.options.CHAT_BACKGROUND.tooltip.1=Chat Achtergrond +of.options.CHAT_BACKGROUND.tooltip.2= Standaard - vaste breedte +of.options.CHAT_BACKGROUND.tooltip.3= Compact - past aan aan regel breedte +of.options.CHAT_BACKGROUND.tooltip.4= UIT - verborgen + +of.options.CHAT_SHADOW=Chat Schaduw +of.options.CHAT_SHADOW.tooltip.1=Chat Schaduw +of.options.CHAT_SHADOW.tooltip.2= AAN - gebruik tekst schaduw +of.options.CHAT_SHADOW.tooltip.3= UIT - geen tekst schaduw diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/no_NO.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/no_NO.lang new file mode 100644 index 0000000..baf4e0f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/no_NO.lang @@ -0,0 +1,757 @@ +# Contributors of Norwegian Bokmål localization # +# Regnander (_Spitz) 2018-06-24 ---- 2018-08-06 +# Eiliv U. Henschien (Eiliv) 2018-08-10 ---- 2018-08-11 + +# General +of.general.ambiguous=tvetydig +of.general.compact=Kompakt +of.general.custom=Tilpasset +of.general.from=Fra +of.general.id=ID +of.general.max=Maksimum +of.general.restart=start på nytt +of.general.smart=Smart + +# Keys +of.key.zoom=Zoom inn + +# Message +of.message.aa.shaders1=Kantutjevning er ikke kompatibel med Shaders. +of.message.aa.shaders2=Deaktiver Shaders for å aktivere dette alternativet. + +of.message.af.shaders1=Anisotropisk filtrering er ikke kompatibel med Shaders. +of.message.af.shaders2=Deaktiver Shaders for å aktivere dette alternativet. + +of.message.fr.shaders1=Rask gjengivelse er ikke kompatibel med Shaders. +of.message.fr.shaders2=Deaktiver Shaders for å aktivere dette alternativet. + +of.message.an.shaders1=3D-effekt er ikke kompatibel med Shaders. +of.message.an.shaders2=Deaktiver Shaders for å aktivere dette alternativet. + +of.message.shaders.aa1=Shaders er ikke kompatibel med Kantutjevning. +of.message.shaders.aa2=Endre "Kvalitet -> Kantutjevning" til AV og start spillet på nytt. + +of.message.shaders.af1=Shaders er ikke kompatibel med Anisotropisk filtrering. +of.message.shaders.af2=Endre "Kvalitet -> Anisotropisk filtrering" til AV. + +of.message.shaders.fr1=Shaders er ikke kompatibel med Rask gjengivelse. +of.message.shaders.fr2=Endre "Ytelse -> Rask gjengivelse" til AV. + +of.message.shaders.an1=Shaders er ikke kompatibel med 3D-effekt. +of.message.shaders.an2=Endre "Øvrig -> 3D-effekt" til AV. + +of.message.shaders.nv1=Denne shaderpakken krever en nyere versjon av OptiFine: %s +of.message.shaders.nv2=Er du sikker på at du vil gjøre dette? + +of.message.newVersion=En ny versjon av §eOptiFine§f er tilgjengelig: §e%s§f +of.message.java64Bit=Du kan installere §e64-bitersversjonen av Java§f for å forbedre ytelsen. +of.message.openglError=§eOpenGL-feil§f: %s (%s) + +of.message.shaders.loading=Laster inn shaders: %s + +of.message.other.reset=Tilbakestill alle videoinnstillingene til standardverdiene? + +of.message.loadingVisibleChunks=Laster synlige verdensbiter + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine-kappe... + +of.options.capeOF.title=OptiFine-kappe +of.options.capeOF.openEditor=Åpne kapperedigering +of.options.capeOF.reloadCape=Last inn kappen på nytt + +of.message.capeOF.openEditor=OptiFine-kapperedigeringssiden vil bli åpnet i nettleseren. +of.message.capeOF.reloadCape=Kappen lastes på nytt om 15 sekunder. + +of.message.capeOF.error1=Mojang-autentisering mislykket. +of.message.capeOF.error2=Feil: %s + + +# Video settings + +options.graphics.tooltip.1=Visuell kvalitet +options.graphics.tooltip.2= Rask - lavere kvalitet, hurtigere +options.graphics.tooltip.3= Stilig - høyere kvalitet, langsommere +options.graphics.tooltip.4=Endrer utseendet på skyer, blader, vann, skygger og +options.graphics.tooltip.5=gresskanter. + +of.options.renderDistance.tiny=Liten +of.options.renderDistance.short=Kort +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Lang +of.options.renderDistance.extreme=Ekstrem +of.options.renderDistance.insane=Sinnssyk +of.options.renderDistance.ludicrous=Latterlig + +options.renderDistance.tooltip.1=Synlig avstand +options.renderDistance.tooltip.2= 2 Liten - 32m (raskeste) +options.renderDistance.tooltip.3= 8 Normal - 128m (normal) +options.renderDistance.tooltip.4= 16 Lang - 256m (langsommere) +options.renderDistance.tooltip.5= 32 Ekstrem - 512m (langsomste!) veldig ressurskrevende +options.renderDistance.tooltip.6= 48 Sinnssyk - 768m, trenger 2 GB tildelt RAM +options.renderDistance.tooltip.7= 64 Latterlig - 1024m, trenger 3 GB tildelt RAM +options.renderDistance.tooltip.8=Verdier over 16 er bare effektive i lokale verdener. + +options.ao.tooltip.1=Jevnt beslysningsnivå +options.ao.tooltip.2= AV - ingen jevn beslysning (hurtigste) +options.ao.tooltip.3= Minimum - enkelt jevn beslysning (langsommere) +options.ao.tooltip.4= Maksimum - avansert jevn beslysning (langsomste) + +options.framerateLimit.tooltip.1=Maksimal bildefrekvens +options.framerateLimit.tooltip.2= VSync - bruker skjermens bildefrekvens (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variabel +options.framerateLimit.tooltip.4= Ubegrenset - ingen begrensning (hurtigste) +options.framerateLimit.tooltip.5=Bildefrekvensgrensen reduserer bildefrekvensen selv +options.framerateLimit.tooltip.6=om grenseverdien ikke er nådd. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Jevnt beslyningsnivå +of.options.AO_LEVEL.tooltip.1=Jevnt beslyningsnivå +of.options.AO_LEVEL.tooltip.2= AV - ingen skygger +of.options.AO_LEVEL.tooltip.3= 50%% - lyse skygger +of.options.AO_LEVEL.tooltip.4= 100%% - mørke skygger + +options.viewBobbing.tooltip.1=Mer realistisk bevegelse. +options.viewBobbing.tooltip.2=Deaktiver dette dersom mipmaps brukes til best resultat. + +options.guiScale.tooltip.1=Størrelse på brukergrensesnitt +options.guiScale.tooltip.2= Automatisk - maximal størrelse +options.guiScale.tooltip.3= Liten, Normal, Stor - 1x til 3x +options.guiScale.tooltip.4= 4x til 10x - tilgjengelig på 4K-skjermer +options.guiScale.tooltip.5=Oddverdier (1x, 3x, 5x...) er ikke kompatible med Unicode. +options.guiScale.tooltip.6=Et mindre grensesnitt kan være raskere. + +options.vbo=Bruk VBOs +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Bruker en alternativ gjengivelsesmodell som vanligvis er +options.vbo.tooltip.3=raskere (5-10%%) enn standardgjengivelsen. + +options.gamma.tooltip.1=Endrer lysstyrken på mørkere gjenstander. +options.gamma.tooltip.2= Dunkelt - standardlysstyrke +options.gamma.tooltip.3= 1-99%% - variabel +options.gamma.tooltip.4= Lyst - maksimal lysstyrke for mørkere gjenstander +options.gamma.tooltip.5=Dette alternativet endrer ikke lysstyrken på helt svarte +options.gamma.tooltip.6=objekter. + +options.anaglyph.tooltip.1=3D-anaglyf +options.anaglyph.tooltip.2=Aktiverer en stereoskopisk 3D-effekt ved å bruke +options.anaglyph.tooltip.3=forskjellige farger for hvert øye. +options.anaglyph.tooltip.4=Krever rød-turkise briller for best resultat. + +of.options.ALTERNATE_BLOCKS=Alterner blokker +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternerende blokker +of.options.ALTERNATE_BLOCKS.tooltip.2=Bruker alternative blokkmodeller for noen blokker. +of.options.ALTERNATE_BLOCKS.tooltip.3=Avhenger av den valgte ressurspakken. + +of.options.FOG_FANCY=Tåke +of.options.FOG_FANCY.tooltip.1=Type tåke +of.options.FOG_FANCY.tooltip.2= Rask - raskere tåke +of.options.FOG_FANCY.tooltip.3= Stilig - langsommere tåke, ser bedre ut +of.options.FOG_FANCY.tooltip.4= AV - ingen tåke, hurtigste +of.options.FOG_FANCY.tooltip.5=Stilig tåke er bare tilgjengelig hvis det støttes av grafikk- +of.options.FOG_FANCY.tooltip.6=kortet. + +of.options.FOG_START=Startgrense for tåke +of.options.FOG_START.tooltip.1=Startgrense for tåke +of.options.FOG_START.tooltip.2= 0.2 - tåken begynner nær spilleren +of.options.FOG_START.tooltip.3= 0.8 - tåken begynner langt unna spilleren +of.options.FOG_START.tooltip.4=Dette alternativet påvirker vanligvis ikke ytelsen. + +of.options.CHUNK_LOADING=Verdensbitslastning +of.options.CHUNK_LOADING.tooltip.1=Verdensbitslastning +of.options.CHUNK_LOADING.tooltip.2= Standard - ustabil bildefrekvens når verdensbiter lastes +of.options.CHUNK_LOADING.tooltip.3= Jevn - stabil bildefrekvens +of.options.CHUNK_LOADING.tooltip.4= Flerkjernet - stabil bildefrekvens, 3x hurtigere last +of.options.CHUNK_LOADING.tooltip.5=Jevn og Flerkjernet fjerner stammingen og +of.options.CHUNK_LOADING.tooltip.6=frysingen forårsaket av verdensbitslasting. +of.options.CHUNK_LOADING.tooltip.7=Flerkjernet kan øke hastigheten på verdensbelastning med 3x +of.options.CHUNK_LOADING.tooltip.8=og øke bildefrekvensen ved å bruke en andre processorkjerne. +of.options.chunkLoading.smooth=Jevn +of.options.chunkLoading.multiCore=Flerkjernet + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=AV +of.options.shaders.packDefault=(intern) + +of.options.shaders.ANTIALIASING=Kantutjevning +of.options.shaders.ANTIALIASING.tooltip.1=Kantutjevning +of.options.shaders.ANTIALIASING.tooltip.2= AV - (standard) ingen kantutjevning (hurtigere) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - glatte linjer og kanter (langsommere) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA er en etterbehandlingseffekt som glatter ut +of.options.shaders.ANTIALIASING.tooltip.5=stiplede linjer og skarpe fargeendringer. +of.options.shaders.ANTIALIASING.tooltip.6=Det er raskere enn tradisjonell kantutjevning og er +of.options.shaders.ANTIALIASING.tooltip.7=kompatibel med shaders og Rask gjengivelse. + +of.options.shaders.NORMAL_MAP=Normal map +of.options.shaders.NORMAL_MAP.tooltip.1=Normal map +of.options.shaders.NORMAL_MAP.tooltip.2= PÅ - (standard) aktiver normal maps +of.options.shaders.NORMAL_MAP.tooltip.3= AV - deaktiver normal maps +of.options.shaders.NORMAL_MAP.tooltip.4=Shader-pakken kan bruke normal maps for å +of.options.shaders.NORMAL_MAP.tooltip.5=simulere 3D-geometri på flate modelloverflater. +of.options.shaders.NORMAL_MAP.tooltip.6=Teksturer for normal maps leveres av den nåværende +of.options.shaders.NORMAL_MAP.tooltip.7=ressurspakken. + +of.options.shaders.SPECULAR_MAP=Specular map +of.options.shaders.SPECULAR_MAP.tooltip.1=Specular map +of.options.shaders.SPECULAR_MAP.tooltip.2= PÅ - (standard) aktiver specular maps +of.options.shaders.SPECULAR_MAP.tooltip.3= AV - deaktivere specular maps +of.options.shaders.SPECULAR_MAP.tooltip.4=Shaderpakken kan bruke specular maps for å simulere +of.options.shaders.SPECULAR_MAP.tooltip.5=spesielle refleksjonseffekter. +of.options.shaders.SPECULAR_MAP.tooltip.6=Teksturer for specular maps leveres av den nåværende +of.options.shaders.SPECULAR_MAP.tooltip.7=ressurspakken. + +of.options.shaders.RENDER_RES_MUL=Gjengivelsekvalitet +of.options.shaders.RENDER_RES_MUL.tooltip.1=Gjengivelsekvalitet +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - lav (hurtigste) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (standard) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - høy (langsomste) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Gjengivelsekvalitet styrer størrelsen på tekstur som +of.options.shaders.RENDER_RES_MUL.tooltip.6=shaderpakken gjengir. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Lavere verdier kan være nyttige på 4K-skjermer. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Høyere verdier fungerer som et kantutjevningsfilter. + +of.options.shaders.SHADOW_RES_MUL=Skyggekvalitet +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Skyggekvalitet +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - lav (hurtigste) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (standard) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - høy (langsomste) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Skyggekvalitet styrer størrelsen på tekstur for shadow +of.options.shaders.SHADOW_RES_MUL.tooltip.6=map som brukes i shaderpakken. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Lavere kvalitet = enkle grove skygger. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Høyere kvalitet = detaljerte fine skygger. + +of.options.shaders.HAND_DEPTH_MUL=Hånddybde +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Hånddybde +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - hånden er nær kameraet +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (standard) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - hånden er langt borte fra kameraet +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Hånddybde styrer hvor langt unna håndholdte +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=gjenstander kommer fra kameraet. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=For shaderpakker som bruker dybdeskarphet, bør dette +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=forandre hvordan uskarpe håndholdte gjenstander blir. + +of.options.shaders.CLOUD_SHADOW=Skyskygge + +of.options.shaders.OLD_HAND_LIGHT=G. håndlys +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Gammelt håndlys +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Standard - kontrollert av shaderpakken +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= PÅ - bruk gammelt håndlys +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= AV - bruk nye håndlys +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Gammelt håndlys tillater shaderpakker som bare +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=gjenkjenner lysemitterende gjenstander i hovedhånden +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=også arbeider med gjenstander i den andre hånden. + +of.options.shaders.OLD_LIGHTING=Gammelt lys +of.options.shaders.OLD_LIGHTING.tooltip.1=Gammelt lys +of.options.shaders.OLD_LIGHTING.tooltip.2= Standard - kontrollert av shaderpakken +of.options.shaders.OLD_LIGHTING.tooltip.3= PÅ - bruk gammelt lys +of.options.shaders.OLD_LIGHTING.tooltip.4= AV - bruk ikke gammelt lys +of.options.shaders.OLD_LIGHTING.tooltip.5=Gammelt lys kontrollerer det faste lyset som brukes til å +of.options.shaders.OLD_LIGHTING.tooltip.6=blokksider som standard. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shaderpakker som bruker skygger produserer vanligvis +of.options.shaders.OLD_LIGHTING.tooltip.8=mye bedre lys som avhenger av solens posisjon. + +of.options.shaders.DOWNLOAD=Last ned shaders +of.options.shaders.DOWNLOAD.tooltip.1=Last ned shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Åpner nettsiden for shaderpakker i en nettleser. +of.options.shaders.DOWNLOAD.tooltip.4=Legg nedlastede shaderpakker i "shadermappen" og de +of.options.shaders.DOWNLOAD.tooltip.5=vil vises på listen over installerte shaders. + +of.options.shaders.SHADER_PACK=Shaderpakker + +of.options.shaders.shadersFolder=Shadermappe +of.options.shaders.shaderOptions=Shaderalternativer... + +of.options.shaderOptionsTitle=Shaderalternativer + +of.options.quality=Kvalitet... +of.options.qualityTitle=Kvalitetsinnstillinger + +of.options.details=Detaljer... +of.options.detailsTitle=Detaljinnstillinger + +of.options.performance=Ytelse... +of.options.performanceTitle=Ytelseinnstillinger + +of.options.animations=Animeringar... +of.options.animationsTitle=Animeringsinnstillinger + +of.options.other=Andre... +of.options.otherTitle=Andre innstillinger + +of.options.other.reset=Tilbakestill videoinnstillinger... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilineær +of.options.mipmap.linear=Lineær +of.options.mipmap.nearest=Nærmeste +of.options.mipmap.trilinear=Trelineær + +options.mipmapLevels.tooltip.1=Visuell effekt som gjør at fjerne avstander ser bedre ut +options.mipmapLevels.tooltip.2=ved å utjevne teksturdetaljer. +options.mipmapLevels.tooltip.3= AV - ingen utjevning +options.mipmapLevels.tooltip.4= 1 - minimal utjevning +options.mipmapLevels.tooltip.5= 4 - maksimal utjevning +options.mipmapLevels.tooltip.6=Dette alternativet påvirker vanligvis ikke ytelsen. + +of.options.MIPMAP_TYPE=Mipmaptyp +of.options.MIPMAP_TYPE.tooltip.1=Visuell effekt som gjøre at fjerne objekter ser bedre ut +of.options.MIPMAP_TYPE.tooltip.2=ved å utjevne teksturdetaljer. +of.options.MIPMAP_TYPE.tooltip.3= Nærmeste - grov utjevning (hurtigste) +of.options.MIPMAP_TYPE.tooltip.4= Lineær - normal utjevning +of.options.MIPMAP_TYPE.tooltip.5= Bilineær - fin utjevning +of.options.MIPMAP_TYPE.tooltip.6= Trelineær - fineste utjevning (langsomste) + + +of.options.AA_LEVEL=Kantutjevning +of.options.AA_LEVEL.tooltip.1=Kantutjevning +of.options.AA_LEVEL.tooltip.2= AV - ingen kantutjevning (standard), hurtigere +of.options.AA_LEVEL.tooltip.3= 2-16 - kantutjevnede linjer og kanter (langsommere) +of.options.AA_LEVEL.tooltip.4=Kantutjevning glatter ut ujevne linjer og skarpe farge- +of.options.AA_LEVEL.tooltip.5=overganger. +of.options.AA_LEVEL.tooltip.6=Bildefrekvensen kan synke betydelig når dette er aktivert. +of.options.AA_LEVEL.tooltip.7=Alle nivåer støttes ikke av alle grafikkortester. +of.options.AA_LEVEL.tooltip.8=Krever OMSTART! + +of.options.AF_LEVEL=Anisotropisk filtrering +of.options.AF_LEVEL.tooltip.1=Anisotropisk filtrering +of.options.AF_LEVEL.tooltip.2= AV - standarddetaljer i teksturer (standard), hurtigere +of.options.AF_LEVEL.tooltip.3= 2-16 - finere detaljer i mipmapteksturer (langsommere) +of.options.AF_LEVEL.tooltip.4=Den anisotropiske filtreringen tilbakestiller detaljer i +of.options.AF_LEVEL.tooltip.5=mipmapteksturer. +of.options.AF_LEVEL.tooltip.6=Bildefrekvensen kan synke betydelig når dette er aktivert. + +of.options.CLEAR_WATER=Krystallklart vann +of.options.CLEAR_WATER.tooltip.1=Krystallklart vann +of.options.CLEAR_WATER.tooltip.2= PÅ - krystallklart, gjennomsiktig vann +of.options.CLEAR_WATER.tooltip.3= AV - standardvann + +of.options.RANDOM_ENTITIES=Tilfeldige enheter +of.options.RANDOM_ENTITIES.tooltip.1=Tilfeldige enheter +of.options.RANDOM_ENTITIES.tooltip.2= AV - ingen tilfeldige enheter, hurtigere +of.options.RANDOM_ENTITIES.tooltip.3= PÅ - tilfeldige enheter, langsommere +of.options.RANDOM_ENTITIES.tooltip.4=Bruker tilfeldige teksturer for enhetene i spillet. +of.options.RANDOM_ENTITIES.tooltip.5=Krever en ressurspakke med flere enhetsteksturer. + +of.options.BETTER_GRASS=Bedre gress +of.options.BETTER_GRASS.tooltip.1=Bedre gress +of.options.BETTER_GRASS.tooltip.2= AV - standardteksturer for gresskanter, hurtigste +of.options.BETTER_GRASS.tooltip.3= Rask - full tekstur for gresskanter +of.options.BETTER_GRASS.tooltip.4= Stilig - dynamisk tekstur for gresskanter, langsomste + +of.options.BETTER_SNOW=Bedre snø +of.options.BETTER_SNOW.tooltip.1=Bedre snø +of.options.BETTER_SNOW.tooltip.2= AV - standardsnø, hurtigere +of.options.BETTER_SNOW.tooltip.3= PÅ - bedre snø, langsommere +of.options.BETTER_SNOW.tooltip.4=Viser snø under gjennomsiktige blokker (gjerder, høyt +of.options.BETTER_SNOW.tooltip.5=gress) når de ligger ved siden av snøblokker. + +of.options.CUSTOM_FONTS=Tilpasset skrift +of.options.CUSTOM_FONTS.tooltip.1=Tilpasset skrift +of.options.CUSTOM_FONTS.tooltip.2= PÅ - bruk tilpasset skrift (standard), langsommere +of.options.CUSTOM_FONTS.tooltip.3= AV - bruk standardskriften, hurtigere +of.options.CUSTOM_FONTS.tooltip.4=De tilpassede skriftene leveres av den nåværende +of.options.CUSTOM_FONTS.tooltip.5=ressurspakken. + +of.options.CUSTOM_COLORS=Tilpasset farger +of.options.CUSTOM_COLORS.tooltip.1=Tilpasset farger +of.options.CUSTOM_COLORS.tooltip.2= PÅ - bruk tilpasset farger (standard), langsommere +of.options.CUSTOM_COLORS.tooltip.3= AV - bruk standardfargene, hurtigere +of.options.CUSTOM_COLORS.tooltip.4=De tilpassede fargene leveres av den nåværende +of.options.CUSTOM_COLORS.tooltip.5=ressurspakken + +of.options.SWAMP_COLORS=Sumpfarger +of.options.SWAMP_COLORS.tooltip.1=Sumpfarger +of.options.SWAMP_COLORS.tooltip.2= PÅ - bruk sumpfarger (standard), langsommere +of.options.SWAMP_COLORS.tooltip.3= AV - bruk ikke sumpfarger, hurtigere +of.options.SWAMP_COLORS.tooltip.4=Sumpfargene påvirker gress, løv, lianer og vann. + +of.options.SMOOTH_BIOMES=Utjevning av biomer +of.options.SMOOTH_BIOMES.tooltip.1=Utjevning av biomer +of.options.SMOOTH_BIOMES.tooltip.2= PÅ - biomkanter glattet ut (standard), langsommere +of.options.SMOOTH_BIOMES.tooltip.3= AV - biomkanter ikke glattet ut, hurtigere +of.options.SMOOTH_BIOMES.tooltip.4=Utjevning av biomkanter gjøres ved prøvetaking og +of.options.SMOOTH_BIOMES.tooltip.5=gjennomsnittsfarge på alle omkringliggende blokker. +of.options.SMOOTH_BIOMES.tooltip.6=Påvirker gress, løv, lianer og vann. + +of.options.CONNECTED_TEXTURES=Tilknyttede teksturer +of.options.CONNECTED_TEXTURES.tooltip.1=Tilknyttede teksturer +of.options.CONNECTED_TEXTURES.tooltip.2= AV - ingen tilknyttede teksturer (standard) +of.options.CONNECTED_TEXTURES.tooltip.3= Rask - raske tilknyttede teksturer +of.options.CONNECTED_TEXTURES.tooltip.4= Stilig - stilige tilknyttede teksturer +of.options.CONNECTED_TEXTURES.tooltip.5=Tilknyttede teksturer fusjonerer teksturene for glass, +of.options.CONNECTED_TEXTURES.tooltip.6=sandstein og bokhyller når de er plassert ved siden av +of.options.CONNECTED_TEXTURES.tooltip.7=hverandre. Tilknyttede teksturer leveres av den +of.options.CONNECTED_TEXTURES.tooltip.8=nåværende ressurspakken. + +of.options.NATURAL_TEXTURES=Naturlige teksturer +of.options.NATURAL_TEXTURES.tooltip.1=Naturlige teksturer +of.options.NATURAL_TEXTURES.tooltip.2= AV - ingen naturlige teksturer (standard) +of.options.NATURAL_TEXTURES.tooltip.3= PÅ - bruk naturlige teksturer +of.options.NATURAL_TEXTURES.tooltip.4=Naturlige teksturer fjerner gitterlignende mønstre laget +of.options.NATURAL_TEXTURES.tooltip.5=av gjentatte blokker av samme type. Den bruker roterte +of.options.NATURAL_TEXTURES.tooltip.6=og reflekterte varianter av den opprinnelige blokk- +of.options.NATURAL_TEXTURES.tooltip.7=teksturen. Konfigurasjonen for naturlige teksturer +of.options.NATURAL_TEXTURES.tooltip.8=leveres av den nåværende ressurspakken. + +of.options.EMISSIVE_TEXTURES=Opplyste teksturer +of.options.EMISSIVE_TEXTURES.tooltip.1=Opplyste teksturer +of.options.EMISSIVE_TEXTURES.tooltip.2= AV - ingen opplyste teksturer (standard) +of.options.EMISSIVE_TEXTURES.tooltip.3= PÅ - bruk opplyste teksturer +of.options.EMISSIVE_TEXTURES.tooltip.4=De opplyste teksturene blir gjengitt som et overlegg med +of.options.EMISSIVE_TEXTURES.tooltip.5=fullstendig lysstyrke. De kan brukes til å simulere +of.options.EMISSIVE_TEXTURES.tooltip.6=opplyste deler av de grunnleggende teksturer. +of.options.EMISSIVE_TEXTURES.tooltip.7=Opplyste teksturer leveres av den nåværende ressurs- +of.options.EMISSIVE_TEXTURES.tooltip.8=pakken. + +of.options.CUSTOM_SKY=Tilpasset himmel +of.options.CUSTOM_SKY.tooltip.1=Tilpasset himmel +of.options.CUSTOM_SKY.tooltip.2= PÅ - tilpasset himmeltexturer (standard), langsomt +of.options.CUSTOM_SKY.tooltip.3= AV - standardhimmel, hurtigere +of.options.CUSTOM_SKY.tooltip.4=Teksturene for den tilpassede himmelen leveres av den +of.options.CUSTOM_SKY.tooltip.5=nåværende ressurspakken. + +of.options.CUSTOM_ITEMS=Tilpassede gjenstander +of.options.CUSTOM_ITEMS.tooltip.1=Tilpassede gjenstander +of.options.CUSTOM_ITEMS.tooltip.2= PÅ - tilp. gjenstandsteksturer (standard), langsomt +of.options.CUSTOM_ITEMS.tooltip.3= AV - standardteksturer for gjenstander, hurtigere +of.options.CUSTOM_ITEMS.tooltip.4=De tilpassede gjenstandsteksturene leveres av den +of.options.CUSTOM_ITEMS.tooltip.5=nåværende ressurspakken. + +of.options.CUSTOM_ENTITY_MODELS=Tilpassede enhetsmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Tilpasset enhetsmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= PÅ - tilpasset enhetsmodeller (standard), langsomt +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= AV - standardenhetsmodeller, hurtigere +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=De tilpassede enhetsmodellene leveres av den nåværende +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=ressurspakken. + +of.options.CUSTOM_GUIS=Tilp. brukergrensesnitt +of.options.CUSTOM_GUIS.tooltip.1=Tilpasset brukergrensesnitt +of.options.CUSTOM_GUIS.tooltip.2= PÅ - tilp. brukergrensesnitt (standard), langsommere +of.options.CUSTOM_GUIS.tooltip.3= AV - standardbrukergrensesnitt, hurtigere +of.options.CUSTOM_GUIS.tooltip.4=De tilpassede brukergrensesnittene leveres av den +of.options.CUSTOM_GUIS.tooltip.5=nåværende ressurspakken. + +# Details + +of.options.CLOUDS=Sky +of.options.CLOUDS.tooltip.1=Sky +of.options.CLOUDS.tooltip.2= Standard - følger alternativet "Grafikk" +of.options.CLOUDS.tooltip.3= Rask - lavere kvalitet, hurtigere +of.options.CLOUDS.tooltip.4= Stilig - høyere kvalitet, langsommere +of.options.CLOUDS.tooltip.5= AV - ingen skyer, hurtigste +of.options.CLOUDS.tooltip.6=Raske skyer gjengis i 2D. +of.options.CLOUDS.tooltip.7=Stilige skyer gjengis i 3D. + +of.options.CLOUD_HEIGHT=Skyhøyde +of.options.CLOUD_HEIGHT.tooltip.1=Skyhøyde +of.options.CLOUD_HEIGHT.tooltip.2= AV - standardhøyde +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - over verdens høydegrense + +of.options.TREES=Trær +of.options.TREES.tooltip.1=Trær +of.options.TREES.tooltip.2= Standard - følger alternativet "Grafikk" +of.options.TREES.tooltip.3= Rask - lavere kvalitet, hurtigere +of.options.TREES.tooltip.4= Smart - høyere kvalitet, raskt +of.options.TREES.tooltip.5= Stilig - høyeste kvalitet, langsommere +of.options.TREES.tooltip.6=Raske trær ugjennomsiktige blader. +of.options.TREES.tooltip.7=Stilige og smarte trær har gjennomsiktige blader. + +of.options.RAIN=Regn og snø +of.options.RAIN.tooltip.1=Regn og snø +of.options.RAIN.tooltip.2= Standard - følger alternativet "Grafikk" +of.options.RAIN.tooltip.3= Rask - lett regn/snø, hurtigere +of.options.RAIN.tooltip.4= Stilig - tungt regn/snø, langsommere +of.options.RAIN.tooltip.5= AV - ingen regn/snø, hurtigste +of.options.RAIN.tooltip.6=Regnlyder og nedbør vil fortsatt bli hørt og vises hvis +of.options.RAIN.tooltip.7=regn er slått av. + +of.options.SKY=Himmel +of.options.SKY.tooltip.1=Himmel +of.options.SKY.tooltip.2= PÅ - himmelen er synlig, langsommere +of.options.SKY.tooltip.3= AV - himmelen er ikke synlig, hurtigere +of.options.SKY.tooltip.4=Hvis himmelen er inaktivert, vil månen og solen fortsatt +of.options.SKY.tooltip.5=være synlig. + +of.options.STARS=Stjerner +of.options.STARS.tooltip.1=Stjerner +of.options.STARS.tooltip.2= PÅ - stjerner er synlige, langsommere +of.options.STARS.tooltip.3= AV - stjerner er ikke synlige, hurtigere + +of.options.SUN_MOON=Sol og måne +of.options.SUN_MOON.tooltip.1=Sol og måne +of.options.SUN_MOON.tooltip.2= PÅ - solen og månen er synlige (standard) +of.options.SUN_MOON.tooltip.3= AV - solen og månen er ikke synlige (hurtigere) + +of.options.SHOW_CAPES=Vis kapper +of.options.SHOW_CAPES.tooltip.1=Vis kapper +of.options.SHOW_CAPES.tooltip.2= PÅ - vis spillernes kapper (standard) +of.options.SHOW_CAPES.tooltip.3= AV - ikke vis spillernes kapper + +of.options.TRANSLUCENT_BLOCKS=Transp. blokker +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Gjennomsiktige blokker +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Standard - følger alternativet "Grafikk" +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Stilig - riktig fargeblanding (standard) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Rask - rask fargeblanding (hurtigere) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Kontrollerer fargeblandingen for gjennomsiktige blokker +of.options.TRANSLUCENT_BLOCKS.tooltip.6=med forskjellige farger (farget glass, vann, is) når de +of.options.TRANSLUCENT_BLOCKS.tooltip.7=er plassert bak hverandre med luft mellom dem. + +of.options.HELD_ITEM_TOOLTIPS=Gjenstandsinfotekst +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Infotekst for gjenstander +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= PÅ - vis infotekst for holdte gjenstander (standard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= AV - vis ikke infotekst for holdte gjenstander + +of.options.ADVANCED_TOOLTIPS=Avanserte verktøytips +of.options.ADVANCED_TOOLTIPS.tooltip.1=Avanserte verktøytips +of.options.ADVANCED_TOOLTIPS.tooltip.2= PÅ - vis avanserte verktøytips +of.options.ADVANCED_TOOLTIPS.tooltip.3= AV - ikke vis avanserte verktøytips (standard) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Avanserte verktøytips viser tilleggsinformasjon om +of.options.ADVANCED_TOOLTIPS.tooltip.5=gjenstander (id, holdbarhet) og shaderalternativer +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, kilde, standardverdier). + +of.options.DROPPED_ITEMS=Droppede gjenst. +of.options.DROPPED_ITEMS.tooltip.1=Droppede gjenstander +of.options.DROPPED_ITEMS.tooltip.2= Standard - følger alternativet "Grafikk" +of.options.DROPPED_ITEMS.tooltip.3= Rask - gjengis i 2D, hurtigere +of.options.DROPPED_ITEMS.tooltip.4= Stilig - gjengis i 3D, langsommere + +options.entityShadows.tooltip.1=Enhetskygger +options.entityShadows.tooltip.2= PÅ - vis skygger for enheter +options.entityShadows.tooltip.3= AV - vis ikke skygger for enheter + +of.options.VIGNETTE=Vignett +of.options.VIGNETTE.tooltip.1=Visuell effekt som mørkner skjermens hjørner litt +of.options.VIGNETTE.tooltip.2= Standard - følger alternativet "Grafikk" (standard) +of.options.VIGNETTE.tooltip.3= Rask - vignett er deaktivert (hurtigere) +of.options.VIGNETTE.tooltip.4= Stilig - vignett er aktivert (langsommere) +of.options.VIGNETTE.tooltip.5=Vignetten kan ha en betydelig innvirkning på bilde- +of.options.VIGNETTE.tooltip.6=frekvensen, spesielt når fullskjerm er aktivert. +of.options.VIGNETTE.tooltip.7=Vignetteffekten er veldig diskré og kan slås av uten +of.options.VIGNETTE.tooltip.8=fare. + +of.options.DYNAMIC_FOV=Dynamisk synsfelt +of.options.DYNAMIC_FOV.tooltip.1=Dynamisk synsfelt +of.options.DYNAMIC_FOV.tooltip.2= PÅ - aktivér dynamisk synsfelt (standard) +of.options.DYNAMIC_FOV.tooltip.3= AV - deaktivér dynamisk synsfelt +of.options.DYNAMIC_FOV.tooltip.4=Endrer synsfeltet når du flyr, hopper eller sikter med +of.options.DYNAMIC_FOV.tooltip.5=en bue. + +of.options.DYNAMIC_LIGHTS=Dynamiske lys +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamiske lys +of.options.DYNAMIC_LIGHTS.tooltip.2= AV - ingen dynamiske lys (standard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rask - raske dynamiske lys (oppdatert etter 500 ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Stilig - stilige dynamiske lys (oppdatert i sanntid) +of.options.DYNAMIC_LIGHTS.tooltip.5=Lar gjenstander som utsender lys (fakler, glødestein, +of.options.DYNAMIC_LIGHTS.tooltip.6=etc.) lyse opp omgivelsene når de holdes av deg, andre +of.options.DYNAMIC_LIGHTS.tooltip.7=spillere eller slippes til bakken. + +# Performance + +of.options.SMOOTH_FPS=Jevn bildefrekvens +of.options.SMOOTH_FPS.tooltip.1=Stabiliserer bildefrekvensen ved å rydde grafikk- +of.options.SMOOTH_FPS.tooltip.2=driverbufferne. +of.options.SMOOTH_FPS.tooltip.3= AV - ingen stabilisering, bildefrekvensen kan variere +of.options.SMOOTH_FPS.tooltip.4= PÅ - bildefrekvensen er stabilisert +of.options.SMOOTH_FPS.tooltip.5=Avhenger av grafikkdrivere og er ikke alltid merkbar. + +of.options.SMOOTH_WORLD=Jevn verden +of.options.SMOOTH_WORLD.tooltip.1=Fjerner ytelsesproblemer forårsaket av den interne +of.options.SMOOTH_WORLD.tooltip.2=serveren. +of.options.SMOOTH_WORLD.tooltip.3= AV - ingen stabilisering, bildefrekvensen kan variere +of.options.SMOOTH_WORLD.tooltip.4= PÅ - bildefrekvensen er stabilisert +of.options.SMOOTH_WORLD.tooltip.5=Stabiliserer bildefrekvensen ved å distribuere +of.options.SMOOTH_WORLD.tooltip.6=inlastningen av den interne serveren. +of.options.SMOOTH_WORLD.tooltip.7=Fungerer kun på lokale verdener (enkeltspiller). + +of.options.FAST_RENDER=Rask gjengivelse +of.options.FAST_RENDER.tooltip.1=Rask gjengivelse +of.options.FAST_RENDER.tooltip.2= AV - standardgjengivelse (standard) +of.options.FAST_RENDER.tooltip.3= PÅ - optimalisert gjengivelse (hurtigere) +of.options.FAST_RENDER.tooltip.4=Bruker en optimalisert gjengivelsesalgoritme som senker +of.options.FAST_RENDER.tooltip.5=grafikkprosessorens belastning og kan øke bilde- +of.options.FAST_RENDER.tooltip.6=frekvensen betydelig. + +of.options.FAST_MATH=Rask matematikk +of.options.FAST_MATH.tooltip.1=Rask matematikk +of.options.FAST_MATH.tooltip.2= AV - standardmatematikk (standard) +of.options.FAST_MATH.tooltip.3= PÅ - hurtigere matematikk +of.options.FAST_MATH.tooltip.4=Bruker optimaliserte sin()- og cos()-funksjoner som +of.options.FAST_MATH.tooltip.5=som bedre kan utnytte prosessorens hurtiglager og øke bilde- +of.options.FAST_MATH.tooltip.6=frekvensen. +of.options.FAST_MATH.tooltip.7=Dette alternativet kan påvirke verdensgenerasjon minimalt. + +of.options.CHUNK_UPDATES=Verdensbitoppdateringer +of.options.CHUNK_UPDATES.tooltip.1=Verdensbitoppdateringer +of.options.CHUNK_UPDATES.tooltip.2= 1 - langsommere inlastn., høyere bildefrekv. (standard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - hurtigere inlastning, lavere bildefrekvens +of.options.CHUNK_UPDATES.tooltip.4= 5 - hurtigste inlastning, laveste bildefrekvens +of.options.CHUNK_UPDATES.tooltip.5=Antall verdensbitoppdateringer per gjengitt ramme. +of.options.CHUNK_UPDATES.tooltip.6=Høyere verdier kan gjøre bildefrekvensen ustabil. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamiske oppdateringer +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamiske verdensbitoppdateringer +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= AV - standardantall oppdat. per ramme (standard) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= PÅ - flere oppdateringer når spilleren står stille +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamiske oppdateringer tvinger flere verdensbit- +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=oppdateringer når spilleren står stille for å laste +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=verdenen raskere. + +of.options.LAZY_CHUNK_LOADING=Lat verdensbitslastning +of.options.LAZY_CHUNK_LOADING.tooltip.1=Lat verdensbitslastning +of.options.LAZY_CHUNK_LOADING.tooltip.2= AV - standardlastning på servere +of.options.LAZY_CHUNK_LOADING.tooltip.3= PÅ - lat verdensbitslastning på servere (mer stabilt) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Jevner ut den integrerte verdensbitinlastningen for +of.options.LAZY_CHUNK_LOADING.tooltip.5=serveren ved å distribuere verdensbitene på tvers av +of.options.LAZY_CHUNK_LOADING.tooltip.6=flere tickinger. Deaktiver hvis deler av verdenen ikke +of.options.LAZY_CHUNK_LOADING.tooltip.7=lastes inn riktig. Fungerer kun på lokale verdener +of.options.LAZY_CHUNK_LOADING.tooltip.8=(enkeltspiller). + +of.options.RENDER_REGIONS=Gjengivelseområder +of.options.RENDER_REGIONS.tooltip.1=Gjengivelseområder +of.options.RENDER_REGIONS.tooltip.2= AV - bruk ikke gjengivelseområder (standard) +of.options.RENDER_REGIONS.tooltip.3= PÅ - bruk gjengivelseområder +of.options.RENDER_REGIONS.tooltip.4=Gjengivelseområder gjør at terreng gjengis raskere +of.options.RENDER_REGIONS.tooltip.5=ved høyere gjengivelsesavstand. Mer effektivt når VBO +of.options.RENDER_REGIONS.tooltip.6=er aktivert. +of.options.RENDER_REGIONS.tooltip.7=Ikke anbefalt for integrerte grafikkort. + +of.options.SMART_ANIMATIONS=Smarte animasjoner +of.options.SMART_ANIMATIONS.tooltip.1=Smarte animasjoner +of.options.SMART_ANIMATIONS.tooltip.2= AV - bruk ikke smarte animasjoner (standard) +of.options.SMART_ANIMATIONS.tooltip.3= PÅ - bruk smarte animasjoner +of.options.SMART_ANIMATIONS.tooltip.4=Med smarte animasjoner, vil spillet bare animere +of.options.SMART_ANIMATIONS.tooltip.5=teksturer som for øyeblikket er synlige på skjermen. +of.options.SMART_ANIMATIONS.tooltip.6=Dette reduserer ytelsesproblemer og øker bilde- +of.options.SMART_ANIMATIONS.tooltip.7=frekvensen. Spesielt nyttig for store modpakker og +of.options.SMART_ANIMATIONS.tooltip.8=ressurspakker i HD. + +# Animations + +of.options.animation.allOn=Alt PÅ +of.options.animation.allOff=Alt AV +of.options.animation.dynamic=Dynamisk + +of.options.ANIMATED_WATER=Animert vann +of.options.ANIMATED_LAVA=Animert lava +of.options.ANIMATED_FIRE=Animert ild +of.options.ANIMATED_PORTAL=Animerte portaler +of.options.ANIMATED_REDSTONE=Animert redstone +of.options.ANIMATED_EXPLOSION=Animerte eksplosjoner +of.options.ANIMATED_FLAME=Animerte flammer +of.options.ANIMATED_SMOKE=Animert røyk +of.options.VOID_PARTICLES=Underromspartikler +of.options.WATER_PARTICLES=Vannpartikler +of.options.RAIN_SPLASH=Regnskvett +of.options.PORTAL_PARTICLES=Portalpartikler +of.options.POTION_PARTICLES=Bryggpartikler +of.options.DRIPPING_WATER_LAVA=Dryppende vann/lava +of.options.ANIMATED_TERRAIN=Animert terreng +of.options.ANIMATED_TEXTURES=Animerte teksturer +of.options.FIREWORK_PARTICLES=Fyrverkeripartikler + +# Other + +of.options.LAGOMETER=Laggmåler +of.options.LAGOMETER.tooltip.1=Vis laggmåleren på feilsøkingsskjermen (F3). +of.options.LAGOMETER.tooltip.2= * Oransje - Avfallsinnhenting av minne +of.options.LAGOMETER.tooltip.3= * Turkis - Antall tickninger +of.options.LAGOMETER.tooltip.4= * Blå - Planlagte kjøringer +of.options.LAGOMETER.tooltip.5= * Lilla - Verdensbitopplastinger +of.options.LAGOMETER.tooltip.6= * Rød - Verdensbitoppdateringer +of.options.LAGOMETER.tooltip.7= * Gul - Synlighetskontroller +of.options.LAGOMETER.tooltip.8= * Grønn - Terrenggjengivelse + +of.options.PROFILER=Feilsøkingsprofilering +of.options.PROFILER.tooltip.1=Feilsøkingsprofilering +of.options.PROFILER.tooltip.2= PÅ - feilsøkingsprofileringen kjører, langsommere +of.options.PROFILER.tooltip.3= AV - feilsøkingsprofileringen kjører ikke, hurtigere +of.options.PROFILER.tooltip.4=Feilsøkingsprofileringen samler inn og viser feilsøkings- +of.options.PROFILER.tooltip.5=informasjon når feilsøkingsskjermen er åpen (F3). + +of.options.WEATHER=Vær +of.options.WEATHER.tooltip.1=Vær +of.options.WEATHER.tooltip.2= PÅ - vær er aktivert, langsommere +of.options.WEATHER.tooltip.3= AV - vær er deaktivert, hurtigere +of.options.WEATHER.tooltip.4=Denne innstillingen inkluderer regn, snø og torden. +of.options.WEATHER.tooltip.5=Dette fungerer bare i lokale verdener. + +of.options.time.dayOnly=Kun dag +of.options.time.nightOnly=Kun natt + +of.options.TIME=Tid +of.options.TIME.tooltip.1=Tid +of.options.TIME.tooltip.2= Standard - vanlige natt-/dagsykluser +of.options.TIME.tooltip.3= Kun dag - dag hele tiden +of.options.TIME.tooltip.4= Kun natt - natt hele tiden +of.options.TIME.tooltip.5=Tidsinnstillingen fungerer bare i KREATIV modus og i +of.options.TIME.tooltip.6=lokale verdener. + +options.fullscreen.tooltip.1=Fullskjerm +options.fullscreen.tooltip.2= PÅ - bruk fullskjermsmodus +options.fullscreen.tooltip.3= AV - bruk vindusmodus +options.fullscreen.tooltip.4=Fullskjermmodus kan være raskere eller langsommere enn +options.fullscreen.tooltip.5=vindusmodus, avhengig av grafikkortet. + +of.options.FULLSCREEN_MODE=Fullskjermsmodus +of.options.FULLSCREEN_MODE.tooltip.1=Fullskjermsmodus +of.options.FULLSCREEN_MODE.tooltip.2= Standard - bruk datamaskinens oppløsning, langsommere +of.options.FULLSCREEN_MODE.tooltip.3= BxH - bruk tilpasset oppløsning, kan være raskere +of.options.FULLSCREEN_MODE.tooltip.4=Den valgte oppløsningen brukes i fullskjermmodus (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Lavere oppløsninger bør vanligvis være raskere. + +of.options.SHOW_FPS=Vis bildefrekvens +of.options.SHOW_FPS.tooltip.1=Viser kort informasjon om bildefrekvens og gjengivelse. +of.options.SHOW_FPS.tooltip.2= fps - bildefrekvensens gjennomsnitt/minimum +of.options.SHOW_FPS.tooltip.3= C: - antall verdensbitgjengivelser +of.options.SHOW_FPS.tooltip.4= E: - antall gjengitte enheter + blokkenheter +of.options.SHOW_FPS.tooltip.5= U: - antall verdensbitoppdateringer +of.options.SHOW_FPS.tooltip.6=Informasjonen vises bare når feilsøkingsskjermen (F3) +of.options.SHOW_FPS.tooltip.7=ikke er åpen. + +of.options.save.default=Standard (2 s) +of.options.save.20s=20 s +of.options.save.3min=3 min +of.options.save.30min=30 min + +of.options.AUTOSAVE_TICKS=Autolagring +of.options.AUTOSAVE_TICKS.tooltip.1=Intervall for automatisk lagring. +of.options.AUTOSAVE_TICKS.tooltip.2=Standardintervallet (2 s) er IKKE ANBEFALT. +of.options.AUTOSAVE_TICKS.tooltip.3=Automatisk lagring forårsaker et ukjent ytelsesproblem. + +of.options.SCREENSHOT_SIZE=Skjermbildestr. +of.options.SCREENSHOT_SIZE.tooltip.1=Skjermbildestørrelse +of.options.SCREENSHOT_SIZE.tooltip.2= Standard - standardstørrelse på skjermbilder +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - tilpasset størrelse på skjermbilder +of.options.SCREENSHOT_SIZE.tooltip.4=Større skjermbilder kan kreve mer minne. +of.options.SCREENSHOT_SIZE.tooltip.5=Ikke kompatibel med Rask gjengivelse og Kantutjevning. +of.options.SCREENSHOT_SIZE.tooltip.6=Krever grafikkprosessoren for å støtte framebuffer. + +of.options.SHOW_GL_ERRORS=Vis OpenGL-feil +of.options.SHOW_GL_ERRORS.tooltip.1=Vis OpenGL-feil +of.options.SHOW_GL_ERRORS.tooltip.2=OpenGL-feil vises i nettpraten når dette er aktivert. +of.options.SHOW_GL_ERRORS.tooltip.3=Deaktiver bare dette hvis det er en kjent konflikt og +of.options.SHOW_GL_ERRORS.tooltip.4=feilene kan ikke løses. +of.options.SHOW_GL_ERRORS.tooltip.5=Når dette er deaktivert vil feilene fortsatt bli registrert +of.options.SHOW_GL_ERRORS.tooltip.6=i feilloggen og kan fortsatt føre til at bildefrekvensen +of.options.SHOW_GL_ERRORS.tooltip.7=synker betydelig. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Nettpratbakgrunn +of.options.CHAT_BACKGROUND.tooltip.1=Nettpratbakgrunn +of.options.CHAT_BACKGROUND.tooltip.2= Standard - fast bredde +of.options.CHAT_BACKGROUND.tooltip.3= Kompakt - følger linjebredden +of.options.CHAT_BACKGROUND.tooltip.4= AV - skjult + +of.options.CHAT_SHADOW=Nettpratskygge +of.options.CHAT_SHADOW.tooltip.1=Nettpratskygge +of.options.CHAT_SHADOW.tooltip.2= PÅ - bruk tekstskygge +of.options.CHAT_SHADOW.tooltip.3= AV - ingen tekstskygge diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pl_PL.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pl_PL.lang new file mode 100644 index 0000000..68602a0 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pl_PL.lang @@ -0,0 +1,723 @@ +# Contributors of Polish localization # +# Kamil7430 2016-03-14 -- 2017-03-12 # +# Puuska 2017-07-15 -- 2018-01-31 # +# Kamil7430 2018-07-30 -- ????? # +# ravkr 2019-08-25 -- ????? # + +# General +of.general.ambiguous=dwuznaczny +of.general.custom=Inny +of.general.from=Od +of.general.id=Id +of.general.restart=restart +of.general.smart=Smart + +# Keys +of.key.zoom=Zoom (przybliżenie) + +# Message +of.message.aa.shaders1=Antyaliasing nie jest kompatybilny z Shaderami. +of.message.aa.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.af.shaders1=Filtrowanie anizotropowe nie jest kompatybilne z Shaderami. +of.message.af.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.fr.shaders1=Szybkie renderowanie nie jest kompatybilne z Shaderami. +of.message.fr.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.an.shaders1=Anaglifowe 3D nie jest kompatybilne z Shaderami. +of.message.an.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.shaders.aa1=Shadery nie są kompatybilne z antyaliasingiem. +of.message.shaders.aa2=Proszę, wyłącz opcję Jakość -> Antyaliasing, a następnie zrestartuj grę. + +of.message.shaders.af1=Shadery nie są kompatybilne z filtrowaniem anizotropowym. +of.message.shaders.af2=Proszę, wyłącz opcję Jakość -> Filtrowanie anizotropowe. + +of.message.shaders.fr1=Shadery nie są kompatybilne z szybkim renderowaniem. +of.message.shaders.fr2=Proszę, wyłącz opcję Wydajność -> Szybkie renderowanie. + +of.message.shaders.an1=Shadery nie są kompatybilne z anaglifowym 3D. +of.message.shaders.an2=Proszę, wyłącz opcję Inne -> Anaglifowe 3D. + +of.message.shaders.nv1=Ten zestaw shaderów wymaga nowszej wersji OptiFine: %s +of.message.shaders.nv2=Czy na pewno chcesz kontynuować? + +of.message.newVersion=Nowa wersja §eOptiFine§f jest dostępna: §e%s§f +of.message.java64Bit=Zalecamy zainstalowanie §e64-bitowego środowiska Java§f, aby podwyższyć wydajność. +of.message.openglError=§eBłąd OpenGL§f: %s (%s) + +of.message.shaders.loading=Wczytuję shadery: %s + +of.message.other.reset=Czy chcesz przywrócić wszystkie ustawienia graficzne do ich domyślnych wartości? + +of.message.loadingVisibleChunks=Wczytywanie widzialnych chunków + +# Skin customization + +of.options.skinCustomisation.ofCape=Peleryna OptiFine... + +# Video settings + +options.graphics.tooltip.1=Jakość grafiki +options.graphics.tooltip.2= Szybka - niższa jakość, większa wydajność +options.graphics.tooltip.3= Dokładna - wyższa jakość, mniejsza wydajność +options.graphics.tooltip.4=Zmienia wygląd chmur, liści, wody, +options.graphics.tooltip.5=cieni oraz boków bloków trawy. + +of.options.renderDistance.tiny=Najkrótsza +of.options.renderDistance.short=Krótka +of.options.renderDistance.normal=Normalna +of.options.renderDistance.far=Długa +of.options.renderDistance.extreme=Ekstremalna +of.options.renderDistance.insane=Szalona +of.options.renderDistance.ludicrous=Niedorzeczna + +options.renderDistance.tooltip.1=Odległość renderowania +options.renderDistance.tooltip.2= 2 Najkrótsza - 32m +options.renderDistance.tooltip.3= 8 Normalna - 128m +options.renderDistance.tooltip.4= 16 Długa - 256m +options.renderDistance.tooltip.5= 32 Ekstremalna - 512m +options.renderDistance.tooltip.6= 48 Szalona - 768m, potrzeba min. 2GB RAMu +options.renderDistance.tooltip.7= 64 Niedorzeczna - 1024m, potrzeba min. 3GB RAMu +options.renderDistance.tooltip.8=Wartości powyżej 16 są zalecane tylko dla lokalnych światów. + +options.ao.tooltip.1=Gładkie oświetlenie +options.ao.tooltip.2= Wył. - brak wygładzania oświetlenia (wysoka wydajność) +options.ao.tooltip.3= Min. - podstawowe wygładzanie oświetlenia (niska wydajność) +options.ao.tooltip.4= Maks. - pełne wygładzanie oświetlenia (najniższa wydajność) + +options.framerateLimit.tooltip.1=Limit klatek/s (FPS) +options.framerateLimit.tooltip.2= VSync - ograniczone do możliwości monitora (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - ograniczone do podanej wartości +options.framerateLimit.tooltip.4= Nielimitowane - brak limitu (najwyższa wydajność) +options.framerateLimit.tooltip.5=Limit klatek zmiejsza FPS, nawet, gdy wartość +options.framerateLimit.tooltip.6=graniczna nie została osiągnięta. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Poziom wygładzania oświetlenia +of.options.AO_LEVEL.tooltip.1=Poziom wygładzania oświetlenia +of.options.AO_LEVEL.tooltip.2= Wył. - brak cieni +of.options.AO_LEVEL.tooltip.3= 50%% - jasne cienie +of.options.AO_LEVEL.tooltip.4= 100%% - ciemne cienie + +options.viewBobbing.tooltip.1=Bardziej realistyczne poruszanie się. +options.viewBobbing.tooltip.2=Jeśli używasz mipmap, wyłącz tę opcję, aby zwiększyć wydajność. + +options.guiScale.tooltip.1=Wielkość interfejsu +options.guiScale.tooltip.2= Auto - maksymalna dostępna wielkość +options.guiScale.tooltip.3= Mały, Normalny, Duży - od 1x do 3x +options.guiScale.tooltip.4= od 4x do 10x - dostępne na wyświetlaczach 4K +options.guiScale.tooltip.5=Wartości nieparzyste (1x, 3x, 5x...) nie są kompatybilne +options.guiScale.tooltip.6=z Unicode. Mniejszy interfejs może zwiększyć wydajność. + +options.vbo=Używaj VBO +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Używa alternatywnej metody renderowania, która jest +options.vbo.tooltip.3=szybsza (o 5-10%%) niż zwykła metoda. + +options.gamma.tooltip.1=Podwyższa jasność ciemnych obiektów +options.gamma.tooltip.2= Nastrojowa - standardowa jasność +options.gamma.tooltip.3= 1%%-99%% - możliwość dostosowania jasności +options.gamma.tooltip.4= Jaskrawa - maksymalna jasność ciemnych obiektów +options.gamma.tooltip.5=Ta opcja nie podwyższa jasności obiektów, które +options.gamma.tooltip.6=są całkowicie czarne. + +options.anaglyph.tooltip.1=Anaglify 3D +options.anaglyph.tooltip.2=Włącza stereoskopowy efekt 3D używając różnych kolorów +options.anaglyph.tooltip.3=dla każdego oka. +options.anaglyph.tooltip.4=Wymaga czerwono-niebieskich okularów. + +of.options.ALTERNATE_BLOCKS=Alternatywne bloki +of.options.blockAlternatives.tooltip.1=Alternatywne bloki +of.options.blockAlternatives.tooltip.2=Używa alternatywnych modeli dla niektóych bloków. +of.options.blockAlternatives.tooltip.3=Bazowane na wybranej paczce tekstur. + +of.options.FOG_FANCY=Mgła +of.options.FOG_FANCY.tooltip.1=Typ mgły +of.options.FOG_FANCY.tooltip.2= Szybka - szybka mgła +of.options.FOG_FANCY.tooltip.3= Dokładna - ładniejsza mgła, zmniejsza wydajność +of.options.FOG_FANCY.tooltip.4= Wył. - brak mgły, najwyższa wydajność +of.options.FOG_FANCY.tooltip.5=Dokładna mgła jest dostępna tylko, gdy +of.options.FOG_FANCY.tooltip.6=obsługuje ją karta graficzna. + +of.options.FOG_START=Początkowa mgła +of.options.FOG_START.tooltip.1=Początkowa mgła +of.options.FOG_START.tooltip.2= 0.2 - mgła pojawia się w pobliżu gracza +of.options.FOG_START.tooltip.3= 0.8 - mgła pojawia się z dala od gracza +of.options.FOG_START.tooltip.4=Ta opcja zazwyczaj nie zmienia wydajności. + +of.options.CHUNK_LOADING=Ładowanie chunków +of.options.CHUNK_LOADING.tooltip.1=Ładowanie chunków +of.options.CHUNK_LOADING.tooltip.2= Domyślne - niestabilne FPS podczas ładowania chunków +of.options.CHUNK_LOADING.tooltip.3= Gładkie - stabilne FPS +of.options.CHUNK_LOADING.tooltip.4= Wielordzeniowe - stabilne FPS, 3 razy szybsze ładowanie świata +of.options.CHUNK_LOADING.tooltip.5=Opcje Gładkie i Wielordzeniowe zredukują +of.options.CHUNK_LOADING.tooltip.6=przycięcia spowodowane ładowaniem chunków. +of.options.CHUNK_LOADING.tooltip.7=Opcja Wielordzeniowe może trzykrotnie przyspieszyć ładowanie +of.options.CHUNK_LOADING.tooltip.8=oraz podwyższyć FPS używając dodatkowego rdzenia. +of.options.chunkLoading.smooth=Gładkie +of.options.chunkLoading.multiCore=Wielordzeniowe + +of.options.shaders=Shadery... +of.options.shadersTitle=Shadery + +of.options.shaders.packNone=Wyłączone +of.options.shaders.packDefault=Domyślne + +of.options.shaders.ANTIALIASING=Antyaliasing +of.options.shaders.ANTIALIASING.tooltip.1=Antyaliasing +of.options.shaders.ANTIALIASING.tooltip.2= Wył. - (domyślnie) bez antyaliasingu (wyższa wydajność) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - wygładzone linie i krawędzie (niższa wydajność) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA to obróbka końcowa, która wygładza +of.options.shaders.ANTIALIASING.tooltip.5=postrzępione linie i ostre przejścia kolorów. +of.options.shaders.ANTIALIASING.tooltip.6=Jest wydajniejsza niż tradycyjny antyaliasing +of.options.shaders.ANTIALIASING.tooltip.7=i kompatybilna z shaderami i szybkim renderowaniem. + +of.options.shaders.NORMAL_MAP=Mapowanie normalnych +of.options.shaders.NORMAL_MAP.tooltip.1=Mapowanie normalnych +of.options.shaders.NORMAL_MAP.tooltip.2= Wł. - (domyślnie) włączone mapy normalnych +of.options.shaders.NORMAL_MAP.tooltip.3= Wył. - wyłączone mapy normalnych +of.options.shaders.NORMAL_MAP.tooltip.4=Mapy normalnych mogą być używane przez paczkę shaderów, +of.options.shaders.NORMAL_MAP.tooltip.5=aby symulować geometrię 3D na płaskich powierzchniach +of.options.shaders.NORMAL_MAP.tooltip.6=modeli. Tekstury map normalnych są dostarczane +of.options.shaders.NORMAL_MAP.tooltip.7=z obecnej paczki zasobów. + +of.options.shaders.SPECULAR_MAP=Lustrzana mapa +of.options.shaders.SPECULAR_MAP.tooltip.1=Lustrzana mapa +of.options.shaders.SPECULAR_MAP.tooltip.2= Wł. (domyślnie) włączone lustrzane mapy +of.options.shaders.SPECULAR_MAP.tooltip.3= Wył. - wyłączone lustrzane mapy +of.options.shaders.SPECULAR_MAP.tooltip.4=Lustrzane mapy mogą być używane przez paczkę shaderów, +of.options.shaders.SPECULAR_MAP.tooltip.5=aby symulować specjalne efekty refleksów. +of.options.shaders.SPECULAR_MAP.tooltip.6=Tekstury lustrzanych map są dostarczane +of.options.shaders.SPECULAR_MAP.tooltip.7=z obecnej paczki zasobów. + +of.options.shaders.RENDER_RES_MUL=Jakość renderowania +of.options.shaders.RENDER_RES_MUL.tooltip.1=Jakość renderowania +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - niska (najwyższa wydajność) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standardowa (domyślnie) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - wysoka (najniższa wydajność) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Ta opcja kontroluje wielkość tekstury, +of.options.shaders.RENDER_RES_MUL.tooltip.6=którą paczka shaderów renderuje. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Niższe wartości mogą być przydatne przy wyświetlaczach 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Wyższe wartości pracują jako filtr antyaliasingowy. + +of.options.shaders.SHADOW_RES_MUL=Jakość cieni +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Jakość cieni +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - niska (najwyższa wydajność) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standardowa (domyślnie) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - wysoka (najniższa wydajność) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Ta opcja kontroluje wielkość tekstury +of.options.shaders.SHADOW_RES_MUL.tooltip.6=mapy cieni używaną przez paczkę shaderów. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Niższe wartości = niedokładne, chropowate cienie. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Wyższe wartości = szczegółowe, ładne cienie. + +of.options.shaders.HAND_DEPTH_MUL=Głębokość ręki +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Głębokość ręki +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - ręka blisko kamery +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - domyślnie +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - ręka daleko kamery +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Ta opcja kontroluje jak trzymane obiekty są +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=oddalone od kamery. Dla paczek shaderów używających +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=głębokiego rozmycia ta opcja powinna zmienić +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=rozmycie trzymanych obiektów. + +of.options.shaders.CLOUD_SHADOW=Cienie chmur + +of.options.shaders.OLD_HAND_LIGHT=Stare światło ręczne +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Stara metoda oświetlania przez przedmioty trzymane w ręce +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Domyślne - kontrolowane przez paczkę shaderów +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Wł. - używaj starej metody oświetlania +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Wył. - używaj nowej metody oświetlania +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Ta opcja pozwala paczkom shaderów, które wykrywają jedynie +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=przedmioty emitujące światło w głównej ręce, +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=pracować także z przedmiotami w ręce podrzędnej. + +of.options.shaders.OLD_LIGHTING=Stare oświetlanie +of.options.shaders.OLD_LIGHTING.tooltip.1=Stare oświetlanie +of.options.shaders.OLD_LIGHTING.tooltip.2= Domyślne - kontrolowane przez paczkę shaderów +of.options.shaders.OLD_LIGHTING.tooltip.3= Wł. - używaj starego oświetlania +of.options.shaders.OLD_LIGHTING.tooltip.4= Wył. - nie używaj starego oświetlania +of.options.shaders.OLD_LIGHTING.tooltip.5=Ta opcja kontroluje naprawione oświetlenie zastosowane +of.options.shaders.OLD_LIGHTING.tooltip.6=w vanilla na strony bloków. +of.options.shaders.OLD_LIGHTING.tooltip.7=Paczki shaderów używające cieni zazwyczaj dostarczają +of.options.shaders.OLD_LIGHTING.tooltip.8=wiele lepsze oświetlenie bazujące na położeniu słońca. + +of.options.shaders.DOWNLOAD=Pobierz shadery +of.options.shaders.DOWNLOAD.tooltip.1=Pobieranie shaderów +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Ta opcja otwiera w przeglądarce stronę z paczkami shaderów. +of.options.shaders.DOWNLOAD.tooltip.4=Umieść pobrane paczki w "Folderze na shadery", +of.options.shaders.DOWNLOAD.tooltip.5=a one pojawią się na liście zainstalowanych shaderów. + +of.options.shaders.SHADER_PACK=Paczka shaderów + +of.options.shaders.shadersFolder=Folder na shadery +of.options.shaders.shaderOptions=Ustawienia shaderów... + +of.options.shaderOptionsTitle=Ustawienia shaderów + +of.options.quality=Jakość... +of.options.qualityTitle=Ustawienia jakości + +of.options.details=Detale... +of.options.detailsTitle=Ustawienia detali + +of.options.performance=Wydajność... +of.options.performanceTitle=Ustawienia wydajności + +of.options.animations=Animacje... +of.options.animationsTitle=Ustawienia animacji + +of.options.other=Inne... +of.options.otherTitle=Inne ustawienia + +of.options.other.reset=Przywróć domyślne ustawienia graficzne... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Dwuliniowe +of.options.mipmap.linear=Liniowy +of.options.mipmap.nearest=Najbliższy +of.options.mipmap.trilinear=Trójliniowy + +options.mipmapLevels.tooltip.1=Efekt wizualny, który sprawia, że odległe bloki wyglądają +options.mipmapLevels.tooltip.2=lepiej poprzez wygładzanie detali tekstur +options.mipmapLevels.tooltip.3= Wył. - brak wygładzania +options.mipmapLevels.tooltip.4= 1 - minimalne wygładzanie +options.mipmapLevels.tooltip.5= 4 - maksymalne wygładzanie +options.mipmapLevels.tooltip.6=Ta opcja nie ma wpływu na wydajność. + +of.options.MIPMAP_TYPE=Typ mipmapy +of.options.MIPMAP_TYPE.tooltip.1=Efekt wizualny, który sprawia, że odległe bloki wyglądają +of.options.MIPMAP_TYPE.tooltip.2=lepiej poprzez wygładzanie detali tekstur +of.options.MIPMAP_TYPE.tooltip.3= Najbliższy - szorstkie wygładzanie (najwyższa wydajność) +of.options.MIPMAP_TYPE.tooltip.4= Liniowy - normalne wygładzanie +of.options.MIPMAP_TYPE.tooltip.5= Dwuliniowy - ładne wygładzanie +of.options.MIPMAP_TYPE.tooltip.6= Trójliniowe - najładniejsze wygładzanie (najniższa wydajność) + + +of.options.AA_LEVEL=Antyaliasing +of.options.AA_LEVEL.tooltip.1=Antyaliasing +of.options.AA_LEVEL.tooltip.2= OFF - (domyślne) brak antyaliasingu (wyższa wydajność) +of.options.AA_LEVEL.tooltip.3= 2-16 - antyaliasing linii i rogów (nizsza wydajność) +of.options.AA_LEVEL.tooltip.4=Antyaliasing wygładza poszarpane linie i +of.options.AA_LEVEL.tooltip.5=ostre przejścia kolorów. +of.options.AA_LEVEL.tooltip.6=Gdy włączone, może mocno obniżyć ilość FPS. +of.options.AA_LEVEL.tooltip.7=Niektóre poziomy są nieobsługiwane przez niektóre karty graficzne. +of.options.AA_LEVEL.tooltip.8=Wymaga restartu! + +of.options.AF_LEVEL=Wygładzanie Anizotropowe +of.options.AF_LEVEL.tooltip.1=Wygładzanie anizotropowe +of.options.AF_LEVEL.tooltip.2= Wył. - (domyślne) standarowe detale tekstur (najwyższa wydajność) +of.options.AF_LEVEL.tooltip.3= 2-16 - ładniejsze detale w mipmapowanych teksturach (niższa wydajność) +of.options.AF_LEVEL.tooltip.4=Filtrowanie anizotropowe pokazuje detale w +of.options.AF_LEVEL.tooltip.5=mipmapowanych teksturach. +of.options.AF_LEVEL.tooltip.6=Gdy włączone, może mocno obniżyć FPS. + +of.options.CLEAR_WATER=Czysta woda +of.options.CLEAR_WATER.tooltip.1=Czysta woda +of.options.CLEAR_WATER.tooltip.2= Wł. - czysta, przezroczysta woda +of.options.CLEAR_WATER.tooltip.3= Wył. - domyślna woda + +of.options.RANDOM_ENTITIES=Losowe moby +of.options.RANDOM_ENTITIES.tooltip.1=Losowe tekstury mobów +of.options.RANDOM_ENTITIES.tooltip.2= Wył. - brak losowych tekstur mobów, wyższa wydajność +of.options.RANDOM_ENTITIES.tooltip.3= Wł. - włączone losowe tekstury mobów, niższa wydajność +of.options.RANDOM_ENTITIES.tooltip.4=Ta opcja używa losowych tekstur dla mobów w grze. +of.options.RANDOM_ENTITIES.tooltip.5=Wymaga paczki tesktur z wieloma teksturami dla jednego moba. + +of.options.BETTER_GRASS=Ładniejsza trawa +of.options.BETTER_GRASS.tooltip.1=Ładniejsza trawa +of.options.BETTER_GRASS.tooltip.2= Wył. - domyślne boki bloków trawy, najwyższa wydajność +of.options.BETTER_GRASS.tooltip.3= Szybka - pełne boki bloków trawy, niższa wydajność +of.options.BETTER_GRASS.tooltip.4= Dokładna - dynamiczne boki bloków trawy, najniższa wydajność + +of.options.BETTER_SNOW=Ładniejszy śnieg +of.options.BETTER_SNOW.tooltip.1=Ładniejszy śnieg +of.options.BETTER_SNOW.tooltip.2= Wył. - domyślny śnieg, wyższa wydajność +of.options.BETTER_SNOW.tooltip.3= Wł. - ładniejszy śnieg, mniejsza wydajność +of.options.BETTER_SNOW.tooltip.4=Pokazuje śnieg pod przezroczystymi blokami (płot, wysoka +of.options.BETTER_SNOW.tooltip.5=trawa) gdy graniczą ze śniegiem + +of.options.CUSTOM_FONTS=Własne czcionki +of.options.CUSTOM_FONTS.tooltip.1=Własne czcionki +of.options.CUSTOM_FONTS.tooltip.2= Wł. - używa innych czcionek (domyślne), niższa wydajność +of.options.CUSTOM_FONTS.tooltip.3= Wył. - używa domyślnej czcionki, wyższa wydajność +of.options.CUSTOM_FONTS.tooltip.4=Własne czcionki są często dodawane do +of.options.CUSTOM_FONTS.tooltip.5=paczek tekstur + +of.options.CUSTOM_COLORS=Własne kolory +of.options.CUSTOM_COLORS.tooltip.1=Własne kolory +of.options.CUSTOM_COLORS.tooltip.2= Wł. - używa własnych kolorów (domyślne), nizsza wydajność +of.options.CUSTOM_COLORS.tooltip.3= Wył. - uzywa domyślnych kolorów, wyższa wydajność +of.options.CUSTOM_COLORS.tooltip.4=Własne kolory są często dodawane do +of.options.CUSTOM_COLORS.tooltip.5=paczek tekstur + +of.options.SWAMP_COLORS=Bagienne kolory +of.options.SWAMP_COLORS.tooltip.1=Bagienne kolory +of.options.SWAMP_COLORS.tooltip.2= Wł. - używa kolorów bagiennych (domyślne), niższa wydajność +of.options.SWAMP_COLORS.tooltip.3= Wył. - nie używa kolorów baginnych, wyższa wydajność +of.options.SWAMP_COLORS.tooltip.4=Kolory bagienne są użwane na liściach, trawie, winoroślach oraz wodzie. + +of.options.SMOOTH_BIOMES=Gładkie biomy +of.options.SMOOTH_BIOMES.tooltip.1=Gładkie przejścia biomów +of.options.SMOOTH_BIOMES.tooltip.2= Wł. - gładkie przejścia biomów (domyślne), niższa wydajność +of.options.SMOOTH_BIOMES.tooltip.3= Wył. - brak gładkiego przejścia biomów, wyższa wydajność +of.options.SMOOTH_BIOMES.tooltip.4=Wygładzanie krawędzi biomów działa na zasadzie +of.options.SMOOTH_BIOMES.tooltip.5=gładkiego przejścia kolorów liści, winorośli, +of.options.SMOOTH_BIOMES.tooltip.6=wody oraz trawy. + +of.options.CONNECTED_TEXTURES=Połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.1=Połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.2= Wył. - brak połączonych tekstur (domyślne) +of.options.CONNECTED_TEXTURES.tooltip.3= Szybka - szybkie połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.4= Dokładna - ładne połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.5=Ta opcja łączy postawione obok siebie szkło, +of.options.CONNECTED_TEXTURES.tooltip.6=piaskowiec i biblioteczki. +of.options.CONNECTED_TEXTURES.tooltip.7=Połączone tekstury są pobierane z +of.options.CONNECTED_TEXTURES.tooltip.8=aktualnej paczki tekstur. + +of.options.NATURAL_TEXTURES=Naturalne tekstury +of.options.NATURAL_TEXTURES.tooltip.1=Naturalne tekstury +of.options.NATURAL_TEXTURES.tooltip.2= Wył. - brak naturalnych tekstur (domyślne) +of.options.NATURAL_TEXTURES.tooltip.3= Wł. - używa naturalnych tekstur +of.options.NATURAL_TEXTURES.tooltip.4=Ta opcja usuwa wyglądające jak siatka tekstury +of.options.NATURAL_TEXTURES.tooltip.5=stworzone poprzez używanie w kółko tej samej tekstury. +of.options.NATURAL_TEXTURES.tooltip.6=Ta opcje używa obróconych tekstur bloków. +of.options.NATURAL_TEXTURES.tooltip.7=Konfiguracja naturalnych tekstur jest pobierana +of.options.NATURAL_TEXTURES.tooltip.8=z aktualnej paczki tekstur. + +of.options.EMISSIVE_TEXTURES=Tekstury emisyjne +of.options.EMISSIVE_TEXTURES.tooltip.1=Tekstury emisyjne +of.options.EMISSIVE_TEXTURES.tooltip.2= Wył. - wyłącz tekstury emisyjne (domyślne) +of.options.EMISSIVE_TEXTURES.tooltip.3= Wł. - używaj tekstur emisyjnych +of.options.EMISSIVE_TEXTURES.tooltip.4=Tekstury emisyjne są renderowane jako nakładki +of.options.EMISSIVE_TEXTURES.tooltip.5=z pełną jasnością. Mogą być używane do symulowania +of.options.EMISSIVE_TEXTURES.tooltip.6=cząstek emitujących światło tekstury bazowej. +of.options.EMISSIVE_TEXTURES.tooltip.7=Tekstury emisyjne są dostarczane +of.options.EMISSIVE_TEXTURES.tooltip.8=z obecnej paczki zasobów. + +of.options.CUSTOM_SKY=Własne niebo +of.options.CUSTOM_SKY.tooltip.1=Własne niebo +of.options.CUSTOM_SKY.tooltip.2= Wł. - tekstury własnego nieba włączone (domyślne), niższa wydajność +of.options.CUSTOM_SKY.tooltip.3= Wył. - domyślne niebo, wyższa wydajność +of.options.CUSTOM_SKY.tooltip.4=Własne niebo jest pobierane +of.options.CUSTOM_SKY.tooltip.5=z aktualnej paczki tesktur. + +of.options.CUSTOM_ITEMS=Własne przedmioty +of.options.CUSTOM_ITEMS.tooltip.1=Własne przedmioty +of.options.CUSTOM_ITEMS.tooltip.2= Wł. - własne tekstury przedmiotów (domyślne), niższa wydajność +of.options.CUSTOM_ITEMS.tooltip.3= Wył. - domyślne tesktury przedmiotów, wyższa wydajność +of.options.CUSTOM_ITEMS.tooltip.4=Własne tekstury przedmiotów są pobierane +of.options.CUSTOM_ITEMS.tooltip.5=z aktualnej paczki tekstur. + +of.options.CUSTOM_ENTITY_MODELS=Własne modele mobów +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Własne modele mobów i innych podmiotów +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Wł. - opcja włączona (domyślne), wolniej +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Wył. - opcja wyłączona, szybciej +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Własne modele są pobierane z +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=aktualnej paczki tekstur. + +of.options.CUSTOM_GUIS=Własne GUI +of.options.CUSTOM_GUIS.tooltip.1=Własne GUI +of.options.CUSTOM_GUIS.tooltip.2= Wł. - własne GUI (domyślne), niższa wydajność +of.options.CUSTOM_GUIS.tooltip.3= Wył. - domyślne GUI, wyższa wydajność +of.options.CUSTOM_GUIS.tooltip.4=Własne GUI są dostarczane z obecnej paczki zasobów. + +# Details + +of.options.CLOUDS=Chmury +of.options.CLOUDS.tooltip.1=Chmury +of.options.CLOUDS.tooltip.2= Domyślne - dopasowane do ustawienia graficznego +of.options.CLOUDS.tooltip.3= Szybka - niska jakość, wysoka wydajność +of.options.CLOUDS.tooltip.4= Dokładna - wyższa jakość, niska wydajność +of.options.CLOUDS.tooltip.5= Wył. - brak chmur, najwyższa wydajność +of.options.CLOUDS.tooltip.6=Szybkie chmury są renderowane w 2D. +of.options.CLOUDS.tooltip.7=Dokładne chmury są renderowane w 3D. + +of.options.CLOUD_HEIGHT=Wysokość chmur +of.options.CLOUD_HEIGHT.tooltip.1=Wyskość chmur +of.options.CLOUD_HEIGHT.tooltip.2= Wył. - domyślna wysokość +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - powyżej limitu wysokości świata + +of.options.TREES=Drzewa +of.options.TREES.tooltip.1=Drzewa +of.options.TREES.tooltip.2= Domyślne - zgodnie z ustawieniami graficznymi +of.options.TREES.tooltip.3= Szybka - niższa jakość, wyższa wydajność +of.options.TREES.tooltip.4= Smart - wyższa jakość, niższa wydajność +of.options.TREES.tooltip.5= Dokładna - najwyższa jakość, najniższa wydajność +of.options.TREES.tooltip.6=Szybkie drzewa mają wypełnione liście. +of.options.TREES.tooltip.7=Szybkie i smart drzewa mają przezroczyste liście. + +of.options.RAIN=Deszcz i śnieg +of.options.RAIN.tooltip.1=Deszcz i śnieg +of.options.RAIN.tooltip.2= Domyślne - zgodnie z ustawieniami graficznymi +of.options.RAIN.tooltip.3= Szybka - lekki deszcz/śnieg, wyższa wydajność +of.options.RAIN.tooltip.4= Dokładna - ciężki deszcz/śnieg, niższa wydajność +of.options.RAIN.tooltip.5= Wył. - brak deszczu/śniegu, najwyższa wydajność +of.options.RAIN.tooltip.6=Gdy deszcz jest wyłączony, rozpryski na ziemi +of.options.RAIN.tooltip.7=oraz dźwięki nadal są aktywne. + +of.options.SKY=Niebo +of.options.SKY.tooltip.1=Niebo +of.options.SKY.tooltip.2= Wł. - niebo jest widoczne, niższa wydajność +of.options.SKY.tooltip.3= Wył. - niebo jest niewidoczne, wyższa wydajność +of.options.SKY.tooltip.4=Gdy niebo jest wyłączone, słońce i księżyc nadal są widoczne. + +of.options.STARS=Gwiazdy +of.options.STARS.tooltip.1=Gwiazdy +of.options.STARS.tooltip.2= Wł. - gwiazdy są widoczne, niższa wydajność +of.options.STARS.tooltip.3= Wył. - gwiazdy są niewidoczne, wyższa wydajność + +of.options.SUN_MOON=Słońce i Księżyc +of.options.SUN_MOON.tooltip.1=Słońce i Księżyc +of.options.SUN_MOON.tooltip.2= Wł. - słońce i księżyc są widoczne (domyślne) +of.options.SUN_MOON.tooltip.3= Wył. - słońce i księżyc są niewidoczne (wyższa wydajność) + +of.options.SHOW_CAPES=Pokazuj peleryny +of.options.SHOW_CAPES.tooltip.1=Pokazuj peleryny +of.options.SHOW_CAPES.tooltip.2= Wł. - pokazuje peleryny graczy (domyślne) +of.options.SHOW_CAPES.tooltip.3= Wył. - nie pokazuje peleryn graczy + +of.options.TRANSLUCENT_BLOCKS=Prześwitujące bloki +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Prześwitujące bloki +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Domyślne - zgodnie z ustawieniami graficznymi +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Dokładna - poprawne mieszanie kolorów (domyślne) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Szybka - szybkie mieszanie kolorów (wyższa wydajność) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Kontroluje mieszanie kolorów bloków przezroczystych +of.options.TRANSLUCENT_BLOCKS.tooltip.6=w różnych kolorach (barwione szkło, woda, lód) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=gdy pod nimi są bloki inne niż powietrze. + +of.options.HELD_ITEM_TOOLTIPS=Nazwy trzym. przedm. +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Nazwy trzymanych przedmiotów nad interfejsem +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Wł. - pokazuj nazwy przedmiotów (domyślne) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Wył. - nie pokazuj nazw przedmiotów + +of.options.ADVANCED_TOOLTIPS=Dokładne dane przedmiotów +of.options.ADVANCED_TOOLTIPS.tooltip.1=Dokładne dane przedmiotów, bloków oraz narzędzi +of.options.ADVANCED_TOOLTIPS.tooltip.2= Wł. - pokazuj dokładne dane +of.options.ADVANCED_TOOLTIPS.tooltip.3= Wył. - nie pokazuj dokładnych danych (domyślne) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Ta opcja pokazuje więcej informacji o dowolnym +of.options.ADVANCED_TOOLTIPS.tooltip.5=przedmiocie (id, wytrzymałość), a także dane o nim +of.options.ADVANCED_TOOLTIPS.tooltip.6=dla shaderów (id, źródło, domyślna wartość). + +of.options.DROPPED_ITEMS=Upuszczone przedmioty +of.options.DROPPED_ITEMS.tooltip.1=Upuszczone przedmioty +of.options.DROPPED_ITEMS.tooltip.2= Domyślne - zgodnie z ustawieniami graficznymi +of.options.DROPPED_ITEMS.tooltip.3= Szybkie - upuszczone przedmioty w 2D (wyższa wydajność) +of.options.DROPPED_ITEMS.tooltip.4= Dokładne - upuszczone przedmioty w 3D (niższa wydajność) + +options.entityShadows.tooltip.1=Cienie bytów +options.entityShadows.tooltip.2= Wł. - Włącza cienie pod bytami +options.entityShadows.tooltip.3= Wył. - Wyłącza cienie pod bytami + +of.options.VIGNETTE=Winieta +of.options.VIGNETTE.tooltip.1=Efekt wizualny, który delikatnie przyciemnia rogi ekranu +of.options.VIGNETTE.tooltip.2= Domyślne - zgodnie z ustawieniami graficznymi (domyślne) +of.options.VIGNETTE.tooltip.3= Szybki - winieta wyłączona (wyższa wydajność) +of.options.VIGNETTE.tooltip.4= Dokładny - winieta włączona (niższa wydajność) +of.options.VIGNETTE.tooltip.5=Winieta może w małym stopniu obniżyć FPS, +of.options.VIGNETTE.tooltip.6=szczególnie przy grze na pełnym ekranie. +of.options.VIGNETTE.tooltip.7=Efekt winiety jest subtelny i może być +of.options.VIGNETTE.tooltip.8=bezproblemowo wyłączony. + +of.options.DYNAMIC_FOV=Dynamiczny FOV +of.options.DYNAMIC_FOV.tooltip.1=Dynamiczne FOV +of.options.DYNAMIC_FOV.tooltip.2= Wł. - włącza dynamiczny FOV (domyślne) +of.options.DYNAMIC_FOV.tooltip.3= Wył. - wyłącza dynamiczny FOV +of.options.DYNAMIC_FOV.tooltip.4=Zmienia pole widzenia (FOV), gdy latasz +of.options.DYNAMIC_FOV.tooltip.5=sprintujesz lub naciągasz łuk. + +of.options.DYNAMIC_LIGHTS=Dynamiczne światła +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamiczne światła +of.options.DYNAMIC_LIGHTS.tooltip.2= Wył. - funkcja dynamicznego światła wyłączona (domyślne) +of.options.DYNAMIC_LIGHTS.tooltip.3= Szybkie - uproszczone dynamiczne światła - aktualizowane co 500ms +of.options.DYNAMIC_LIGHTS.tooltip.4= Dokładne - dynamiczne światła w czasie rzeczywistym +of.options.DYNAMIC_LIGHTS.tooltip.5=Przedmioty świecące (pochodnia, jasnogłaz itp.) +of.options.DYNAMIC_LIGHTS.tooltip.6=oświetlają teren, gdy są w Twojej dłoni, +of.options.DYNAMIC_LIGHTS.tooltip.7=dłoni innego gracza lub gdy leżą na ziemi. + +# Performance + +of.options.SMOOTH_FPS=Stabilne FPS +of.options.SMOOTH_FPS.tooltip.1=Stablilizuje FPS poprzez oczyszczanie buforów sterownika +of.options.SMOOTH_FPS.tooltip.2= Wył. - brak stabilizacji, FPS mogą oscylować +of.options.SMOOTH_FPS.tooltip.3= Wł. - FPS jest stabilizowane +of.options.SMOOTH_FPS.tooltip.4=Ta opcja jest zależna od karty graficznej, więc +of.options.SMOOTH_FPS.tooltip.5=różnica nie zawsze może być zauważalna + +of.options.SMOOTH_WORLD=Stabilny świat +of.options.SMOOTH_WORLD.tooltip.1=Usuwa nagłe lagi spowodowane serwerem wewnętrznym. +of.options.SMOOTH_WORLD.tooltip.2= Wył. - brak stabilizacji, FPS mogą oscylować +of.options.SMOOTH_WORLD.tooltip.3= Wł. - FPS jest stabilizowane +of.options.SMOOTH_WORLD.tooltip.4=Stabilizuje FPS poprzez rozdzielenie obciążenia wewnętrznego serwera. +of.options.SMOOTH_WORLD.tooltip.5=Działa tylko w lokalnych światach (tryb jednoosobowy). + +of.options.FAST_RENDER=Szybkie renderowanie +of.options.FAST_RENDER.tooltip.1=Szybkie renderowanie +of.options.FAST_RENDER.tooltip.2= Wył. - standardowe rederowanie (domyślne) +of.options.FAST_RENDER.tooltip.3= Wł. - zoptymalizowane renderowanie (wyższa wydajność) +of.options.FAST_RENDER.tooltip.4=Używa zoptymalizowanego algorytmu renderowania, który zmniejsza +of.options.FAST_RENDER.tooltip.5=obciązenie CPU, a tym samym zwiększa FPS. +of.options.FAST_RENDER.tooltip.6=Ta opcja może wywoływać konflikty z niektórymi modami. + +of.options.FAST_MATH=Szybka matematyka +of.options.FAST_MATH.tooltip.1=Szybka matematyka +of.options.FAST_MATH.tooltip.2= Wył. - standardowa matematyka (domyślne) +of.options.FAST_MATH.tooltip.3= Wł. - przyspieszona matematyka +of.options.FAST_MATH.tooltip.4=Używa zoptymalizowanych działań sin() i cos(), które +of.options.FAST_MATH.tooltip.5=lepiej wykorzystują pamięć procesora i zwiększa FPS. +of.options.FAST_MATH.tooltip.6=Ta opcja może mieć minimalny wpływ na generowanie świata. + +of.options.CHUNK_UPDATES=Aktualizacje chunków +of.options.CHUNK_UPDATES.tooltip.1=Aktualizacje chunków +of.options.CHUNK_UPDATES.tooltip.2= 1 - wolniejsze wczytywanie świata, więcej FPS (domyślne) +of.options.CHUNK_UPDATES.tooltip.3= 3 - szybsze wczytywanie świata, mniej FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - najszybsze wczytywanie świata, najmniej FPS +of.options.CHUNK_UPDATES.tooltip.5=Liczba aktualizowanych chunków na klatkę, +of.options.CHUNK_UPDATES.tooltip.6=większa ilość może zmniejszyć stabilność FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamiczne Aktualizacje +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamiczne aktualizacje chunków +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Wył. - (domyślne) standardowa aktualizacja chunków na klatkę +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Wł. - więcej aktualizacji, gdy gracz stoi w miejscu +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamiczna aktualizacja wczytuje więcej chunków, +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=gdy gracz stoi w miejscu, aby szybciej załadować świat. + +of.options.LAZY_CHUNK_LOADING=Leniwe ładow. chunków +of.options.LAZY_CHUNK_LOADING.tooltip.1=Leniwe ładowanie chunków +of.options.LAZY_CHUNK_LOADING.tooltip.2= Wył. - domyślne wczytywanie chunków na serwerze +of.options.LAZY_CHUNK_LOADING.tooltip.3= Wł. - leniwe ładowanie chunków na serwerze (płynniej) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Wygładza zintegrowane ładowanie serwerowych chunków +of.options.LAZY_CHUNK_LOADING.tooltip.5=rozdzielając chunki na kilka ticków. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Wyłącz to, jeżeli części świata nie ładują się prawidłowo. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efektyne tylko na lokalnych światach i jednordzeniowych komputerach. + +of.options.RENDER_REGIONS=Renderowanie okolicy +of.options.RENDER_REGIONS.tooltip.1=Renderowanie okolicy +of.options.RENDER_REGIONS.tooltip.2= Wył. - nie używaj renderowania okolicy (domyślne) +of.options.RENDER_REGIONS.tooltip.3= Wł. - używaj renderowania okolicy +of.options.RENDER_REGIONS.tooltip.4=Ta opcja pozwala na szybsze renderowanie terenu na wyższych +of.options.RENDER_REGIONS.tooltip.5=odległościach renderowania. Efektywniejsze, gdy włączone jest VBO. +of.options.RENDER_REGIONS.tooltip.6=Nie jest rekomendowane dla zintegrowanych kart graficznych. + +of.options.SMART_ANIMATIONS=Inteligentne animacje +of.options.SMART_ANIMATIONS.tooltip.1=Inteligentne animacje +of.options.SMART_ANIMATIONS.tooltip.2= Wył. - nie używaj inteligentnych animacji (domyślne) +of.options.SMART_ANIMATIONS.tooltip.3= Wł. - używaj inteligentnych animacji +of.options.SMART_ANIMATIONS.tooltip.4=Ta opcja powoduje, że gra animuje tylko te tekstury, które są w tym +of.options.SMART_ANIMATIONS.tooltip.5=momencie widzialne na ekranie. To redukuje nagłe napady lagów +of.options.SMART_ANIMATIONS.tooltip.6=i zwiększa ilość FPS. Szczególnie użyteczne dla dużych paczek modów +of.options.SMART_ANIMATIONS.tooltip.7=i zestawów zasobów w wysokiej rozdzielczości. + +# Animations + +of.options.animation.allOn=Włącz wszystko +of.options.animation.allOff=Wyłącz wszystko +of.options.animation.dynamic=Dynamicznie + +of.options.ANIMATED_WATER=Animacja wody +of.options.ANIMATED_LAVA=Animacja lawy +of.options.ANIMATED_FIRE=Animacja ognia +of.options.ANIMATED_PORTAL=Animacja portali +of.options.ANIMATED_REDSTONE=Animacja czerwonego proszku +of.options.ANIMATED_EXPLOSION=Animacja eksplozji +of.options.ANIMATED_FLAME=Animacja płomieni +of.options.ANIMATED_SMOKE=Animacja dymu +of.options.VOID_PARTICLES=Cząsteczki próżni +of.options.WATER_PARTICLES=Cząsteczki wody +of.options.RAIN_SPLASH=Cząsteczki deszczu +of.options.PORTAL_PARTICLES=Cząsteczki portali +of.options.POTION_PARTICLES=Cząsteczki mikstur +of.options.DRIPPING_WATER_LAVA=Kapiąca woda/lawa +of.options.ANIMATED_TERRAIN=Animacja terenu +of.options.ANIMATED_TEXTURES=Animacja tekstur +of.options.FIREWORK_PARTICLES=Cząsteczki fajerwerków + +# Other + +of.options.LAGOMETER=Lagometr +of.options.LAGOMETER.tooltip.1=Pokazuje lagometr na ekranie debugowania (F3). +of.options.LAGOMETER.tooltip.2=* Pomarańczowy - Zajęta pamięć +of.options.LAGOMETER.tooltip.3=* Błękitny - Ticki +of.options.LAGOMETER.tooltip.4=* Niebieski - Zaplanowane działania +of.options.LAGOMETER.tooltip.5=* Fioletowy - Przesyłanie chunków +of.options.LAGOMETER.tooltip.6=* Czerwony - Aktualizacje chunków +of.options.LAGOMETER.tooltip.7=* Żółty - Kontrola widoczności +of.options.LAGOMETER.tooltip.8=* Zielony - Renderowanie terenu + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= Wł. - debug profiler jest aktywny, niższa wydajność +of.options.PROFILER.tooltip.3= Wył. - debug profiler jest nieaktywny, wyższa wydajność +of.options.PROFILER.tooltip.4=Debug profiler zbiera i pokazuje informacje debugowania, +of.options.PROFILER.tooltip.5=gdy ekran debugowania jest włączony. (F3) + +of.options.WEATHER=Pogoda +of.options.WEATHER.tooltip.1=Pogoda +of.options.WEATHER.tooltip.2= Wł. - pogoda jest aktywna, niższa wydajność +of.options.WEATHER.tooltip.3= Wył. - pogoda jest nieaktywna, wyższa wydajność +of.options.WEATHER.tooltip.4=Pogoda kontroluje słońce, deszcz i burzę. +of.options.WEATHER.tooltip.5=Kontrola pogody jest aktywna tylko w trybie jednoosobowym. + +of.options.time.dayOnly=Tylko dzień +of.options.time.nightOnly=Tylko noc + +of.options.TIME=Czas +of.options.TIME.tooltip.1=Ustawienia cyklu dnia i nocy +of.options.TIME.tooltip.2= Domyślne - normalny cykl dnia i nocy +of.options.TIME.tooltip.3= Jedynie dzień - czas zatrzyma się na dniu +of.options.TIME.tooltip.4= Jedynie noc - czas zatrzyma się na nocy +of.options.TIME.tooltip.5=To ustawienie działa tylko w trybie kreatywnym +of.options.TIME.tooltip.6=i tylko w lokalnych światach. + +options.fullscreen.tooltip.1=Pełny ekran +options.fullscreen.tooltip.2= Wł. - używa trybu pełnoekranowego +options.fullscreen.tooltip.3= Wył. - używa trybu okienkowego +options.fullscreen.tooltip.4=Tryb pełnoekranowy może być szybszy lub wolniejszy +options.fullscreen.tooltip.5=niż tryb okienkowy, w zależności od karty graficznej. + +of.options.FULLSCREEN_MODE=Tryb pełnego ekranu +of.options.FULLSCREEN_MODE.tooltip.1=Tryby pełnego ekranu +of.options.FULLSCREEN_MODE.tooltip.2= Domyślne - używa rozdzielczości pulpitu, niższa wydajność +of.options.FULLSCREEN_MODE.tooltip.3= WxH - używa wybranej rozdzielczości, może podwyższyć wydajność +of.options.FULLSCREEN_MODE.tooltip.4=Wybrana rozdzielczość jest używana w trybie pełnoekranowym (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Niższe rozdzielczości mogą przyspieszyć grę. + +of.options.SHOW_FPS=Pokazuj FPS +of.options.SHOW_FPS.tooltip.1=Pokazuje kompaktową nakładkę FPS i informacje o renderowaniu +of.options.SHOW_FPS.tooltip.2= Fps - średnia/minimum +of.options.SHOW_FPS.tooltip.3= C: - renderzy chunków +of.options.SHOW_FPS.tooltip.4= E: - zrenderowane byty + bloki +of.options.SHOW_FPS.tooltip.5= U: - aktualizacje chunków +of.options.SHOW_FPS.tooltip.6=Ta nakładka jest wyświetlana tylko wtedy, +of.options.SHOW_FPS.tooltip.7=gdy ekran debugowania jest niewidoczny. + +of.options.save.default=Domyślne (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autozapis +of.options.AUTOSAVE_TICKS.tooltip.1=Częstotliwość autozapisu +of.options.AUTOSAVE_TICKS.tooltip.2=Domyślna częstotliwość (2s) jest NIEZALECANA. +of.options.AUTOSAVE_TICKS.tooltip.3=Autozapisy często powodują ścięcia gry. + +of.options.SCREENSHOT_SIZE=Rozmiar zrzutów ekranu +of.options.SCREENSHOT_SIZE.tooltip.1=Rozmiar zrzutów ekranu +of.options.SCREENSHOT_SIZE.tooltip.2= Domyślne - domyślny rozmiar +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - własny rozmiar +of.options.SCREENSHOT_SIZE.tooltip.4=Zapisywanie większych zrzutów może wymagać więcej pamięci, +of.options.SCREENSHOT_SIZE.tooltip.5=opcja nie jest kompatybilna z szybkim renderowaniem ani +of.options.SCREENSHOT_SIZE.tooltip.6=antyaliasingiem. Wymaga wsparcia bufora ramki GPU. + +of.options.SHOW_GL_ERRORS=Pokazuj błędy GL +of.options.SHOW_GL_ERRORS.tooltip.1=Pokazuj błędy OpenGL +of.options.SHOW_GL_ERRORS.tooltip.2=Kiedy aktywne, błędy OpenGL są pokazywane na czacie. +of.options.SHOW_GL_ERRORS.tooltip.3=Wyłącz tą opcję tylko jeżeli jest znany konflikt +of.options.SHOW_GL_ERRORS.tooltip.4=i błędy nie mogą zostać naprawione. +of.options.SHOW_GL_ERRORS.tooltip.5=Kiedy nieaktywne, błędy są nadal zapisywane w rejestrze +of.options.SHOW_GL_ERRORS.tooltip.6=błędów i nadal mogą powodować znaczne spadki FPS. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pt_BR.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pt_BR.lang new file mode 100644 index 0000000..1b0f1e1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pt_BR.lang @@ -0,0 +1,758 @@ +# General +of.general.ambiguous=ambíguo +of.general.compact=Conciso +of.general.custom=Personalizado +of.general.from=De +of.general.id=ID +of.general.max=Máximo +of.general.restart=reiniciar +of.general.smart=Inteligentes + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=O anti-aliasing não é compatível com o Shaders. +of.message.aa.shaders2=Desative o Shaders para ativar essa opção. + +of.message.af.shaders1=A filtragem anisotrópica não é compatível com o Shaders. +of.message.af.shaders2=Desative o Shaders para ativar essa opção. + +of.message.fr.shaders1=A renderização rápida não é compatível com o Shaders. +of.message.fr.shaders2=Desative o Shaders para ativar essa opção. + +of.message.an.shaders1=O 3D anaglífico não é compatível com o Shaders. +of.message.an.shaders2=Desative o Shaders para ativar essa opção. + +of.message.shaders.aa1=O Shaders não é compatível com o anti-aliasing. +of.message.shaders.aa2=Desative o anti-aliasing em Qualidade e reinicie o jogo. + +of.message.shaders.af1=O Shaders não é compatível com a filtragem anisotrópica. +of.message.shaders.af2=Desative a filtragem anisotrópica em Qualidade e reinicie o jogo. + +of.message.shaders.fr1=O Shaders não é compatível com a renderização rápida. +of.message.shaders.fr2=Desative a renderização rápida em Desempenho. + +of.message.shaders.an1=O Shaders não é compatível com o 3D anaglífico. +of.message.shaders.an2=Desative o 3D anaglífico em Diversas. + +of.message.shaders.nv1=Este pacote shader requer uma versão mais recente do OptiFine: %s +of.message.shaders.nv2=Deseja mesmo continuar? + +of.message.newVersion=Nova versão do §eOptiFine§f disponível: §e%s§f +of.message.java64Bit=Instale o §eJava de 64 bits§f para aumentar o desempenho. +of.message.openglError=§eErro do OpenGL§f: %s (%s) + +of.message.shaders.loading=Carregando shaders: %s + +of.message.other.reset=Restaurar todas as configurações gráficas para seus valores padrão? + +of.message.loadingVisibleChunks=Carregando chunks visíveis + +# Skin customization + +of.options.skinCustomisation.ofCape=Capa do OptiFine... + +of.options.capeOF.title=Capa do OptiFine +of.options.capeOF.openEditor=Abrir editor de capa +of.options.capeOF.reloadCape=Recarregar capa + +of.message.capeOF.openEditor=O editor de capas do OptiFine será aberto num navegador. +of.message.capeOF.reloadCape=A capa será recarregada em 15 segundos. + +of.message.capeOF.error1=A autenticação da Mojang falhou. +of.message.capeOF.error2=Erro: %s + +# Video settings + +options.graphics.tooltip.1=Qualidade gráfica +options.graphics.tooltip.2= Rápidos - baixa qualidade +options.graphics.tooltip.3= Detalhados - alta qualidade +options.graphics.tooltip.4=Muda a aparência de nuvens, folhas, água, +options.graphics.tooltip.5=sombras e grama. + +of.options.renderDistance.tiny=Mínima +of.options.renderDistance.short=Curta +of.options.renderDistance.normal=Padrão +of.options.renderDistance.far=Longa +of.options.renderDistance.extreme=Extrema +of.options.renderDistance.insane=Insana +of.options.renderDistance.ludicrous=Máxima + +options.renderDistance.tooltip.1=Distância visível +options.renderDistance.tooltip.2= 2 Mínima - 32m (mais rápido) +options.renderDistance.tooltip.3= 8 Padrão - 128m (normal) +options.renderDistance.tooltip.4= 16 Longa - 256m (lento) +options.renderDistance.tooltip.5= 32 Extrema - 512m (mais lento) +options.renderDistance.tooltip.6= 48 Insana - 768m (requer 2GB de RAM) +options.renderDistance.tooltip.7= 64 Máxima - 1024m (requer 3GB de RAM) +options.renderDistance.tooltip.8=Valores acima de 16 funcionam apenas em mundos locais. + +options.ao.tooltip.1=Iluminação suave +options.ao.tooltip.2= Não - iluminação comum (rápido) +options.ao.tooltip.3= Mínima - iluminação suave básica (lento) +options.ao.tooltip.4= Máxima - iluminação suave avançada (mais lento) + +options.framerateLimit.tooltip.1=Limite de quadros +options.framerateLimit.tooltip.2= SV - taxa limitada (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variável +options.framerateLimit.tooltip.4= Ilimitada - sem limites (mais rápido) +options.framerateLimit.tooltip.5=A taxa cairá mesmo se o valor limite não +options.framerateLimit.tooltip.6=for atingido. +of.options.framerateLimit.vsync=SV + +of.options.AO_LEVEL=Nível de ilum. suave +of.options.AO_LEVEL.tooltip.1=Nível de iluminação suave +of.options.AO_LEVEL.tooltip.2= Não - sem sombras +of.options.AO_LEVEL.tooltip.3= 50%% - sombras padrão +of.options.AO_LEVEL.tooltip.4= 100%% - sombras realistas + +options.viewBobbing.tooltip.1=Movimentos mais realistas +options.viewBobbing.tooltip.2=Desative-o para melhores resultados com mipmaps. + +options.guiScale.tooltip.1=Tamanho da interface +options.guiScale.tooltip.2= Auto. - tamanho máximo +options.guiScale.tooltip.3= Pequena, normal, grande - 1 a 3 +options.guiScale.tooltip.4= 4x a 10x - disponível em monitores 4K +options.guiScale.tooltip.5=Valores ímpares (1, 3...) são incompatíveis com Unicode. +options.guiScale.tooltip.6=Uma interface menor pode ser mais rápida. + +options.vbo=VBO +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Utilizam um modelo de renderização alternativo mais +options.vbo.tooltip.3=rápido (5-10%%) do que o padrão. + +options.gamma.tooltip.1=Muda o brilho de itens mais escuros. +options.gamma.tooltip.2= Sombrio - brilho padrão +options.gamma.tooltip.3= 1-99%% - variável +options.gamma.tooltip.4= Claro - brilho máximo +options.gamma.tooltip.5=Essa opção não altera o brilho de itens +options.gamma.tooltip.6=completamente escuros. + +options.anaglyph.tooltip.1=3D anaglífico +options.anaglyph.tooltip.2=Ativa um efeito estereoscópico em 3D usando cores +options.anaglyph.tooltip.3=diferentes para cada olho. +options.anaglyph.tooltip.4=Requer óculos vermelho-ciano para ver adequadamente. + +options.attackIndicator.tooltip.1=Configura a posição do indicador de ataque +options.attackIndicator.tooltip.2= Mira - abaixo da mira +options.attackIndicator.tooltip.3= Barra - próximo à mira +options.attackIndicator.tooltip.4= Não - sem indicador de ataque +options.attackIndicator.tooltip.5=O indicador de ataque exibe o poder +options.attackIndicator.tooltip.6=ofensivo do item segurado. + +of.options.ALTERNATE_BLOCKS=Blocos alternativos +of.options.ALTERNATE_BLOCKS.tooltip.1=Blocos alternativos +of.options.ALTERNATE_BLOCKS.tooltip.2=Utiliza modelos alternativos para alguns blocos. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depende do pacote de recursos escolhido. + +of.options.FOG_FANCY=Névoa +of.options.FOG_FANCY.tooltip.1=Tipo de névoa +of.options.FOG_FANCY.tooltip.2= Rápidos - taxa de quadros elevada +of.options.FOG_FANCY.tooltip.3= Detalhados - taxa de quadros reduzida +of.options.FOG_FANCY.tooltip.4= Não - sem névoa (mais rápido) +of.options.FOG_FANCY.tooltip.5=A névoa detalhada estará disponível apenas caso seja +of.options.FOG_FANCY.tooltip.6=compatível com a placa de vídeo. + +of.options.FOG_START=Início do nevoeiro +of.options.FOG_START.tooltip.1=Início do nevoeiro +of.options.FOG_START.tooltip.2= 0.2 - a névoa começa perto de você +of.options.FOG_START.tooltip.3= 0.8 - a névoa começa longe de você +of.options.FOG_START.tooltip.4=Essa opção não afeta o desempenho. + +of.options.CHUNK_LOADING=Carreg. de chunks +of.options.CHUNK_LOADING.tooltip.1=Carregamento de chunks +of.options.CHUNK_LOADING.tooltip.2= Padrão - taxa instável ao carregar chunks +of.options.CHUNK_LOADING.tooltip.3= Smooth - taxa de quadros estável +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - carregamento 3x mais rápido +of.options.CHUNK_LOADING.tooltip.5=O Smooth e Multi-Core reduzem os travamentos +of.options.CHUNK_LOADING.tooltip.6=ao carregar chunks. +of.options.CHUNK_LOADING.tooltip.7=O Multi-Core pode acelerar o carregamento e +of.options.CHUNK_LOADING.tooltip.8=aumentar a taxa de quadros usando um segundo CPU. +of.options.chunkLoading.smooth=Smooth +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=Não +of.options.shaders.packDefault=(interno) + +of.options.shaders.ANTIALIASING=Anti-aliasing +of.options.shaders.ANTIALIASING.tooltip.1=Anti-aliasing +of.options.shaders.ANTIALIASING.tooltip.2= Não - (padrão, rápido) sem suavização +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - linhas e cantos suavizados (lento) +of.options.shaders.ANTIALIASING.tooltip.4=O FXAA é um efeito de pós-processamento que +of.options.shaders.ANTIALIASING.tooltip.5=suaviza linhas e transições de cores. +of.options.shaders.ANTIALIASING.tooltip.6=Mais rápido do que o anti-aliasing comum e +of.options.shaders.ANTIALIASING.tooltip.7=compatível com shaders e renderização rápida. + +of.options.shaders.NORMAL_MAP=Mapa normal +of.options.shaders.NORMAL_MAP.tooltip.1=Mapa normal +of.options.shaders.NORMAL_MAP.tooltip.2= Sim - (padrão) ativar mapas normais +of.options.shaders.NORMAL_MAP.tooltip.3= Não - desativar mapas normais +of.options.shaders.NORMAL_MAP.tooltip.4=Mapas normais podem ser usados pelo pacote shader +of.options.shaders.NORMAL_MAP.tooltip.5=para simular efeitos geométricos em superfícies planas. +of.options.shaders.NORMAL_MAP.tooltip.6=As texturas de mapas normais são fornecidas pelo +of.options.shaders.NORMAL_MAP.tooltip.7=pacote de recursos. + +of.options.shaders.SPECULAR_MAP=Mapa especular +of.options.shaders.SPECULAR_MAP.tooltip.1=Mapa especular +of.options.shaders.SPECULAR_MAP.tooltip.2= Sim - (padrão) ativar mapas especulares +of.options.shaders.SPECULAR_MAP.tooltip.3= Não - desativar mapas especulares +of.options.shaders.SPECULAR_MAP.tooltip.4=Mapas especulares são usados pelo pacote shader +of.options.shaders.SPECULAR_MAP.tooltip.5=para simular efeitos reflexivos especiais. +of.options.shaders.SPECULAR_MAP.tooltip.6=As texturas de mapas especulares são fornecidas +of.options.shaders.SPECULAR_MAP.tooltip.7=pelo pacote de recursos. + +of.options.shaders.RENDER_RES_MUL=Qualidade +of.options.shaders.RENDER_RES_MUL.tooltip.1=Qualidade de renderização +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - baixa (rápido) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - padrão +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - alta (lento) +of.options.shaders.RENDER_RES_MUL.tooltip.5=A qualidade de renderização define o tamanho +of.options.shaders.RENDER_RES_MUL.tooltip.6=da textura renderizada pelo pacote shader. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Valores baixos podem funcionar em monitores 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Valores altos funcionam como um filtro anisotrópico. + +of.options.shaders.SHADOW_RES_MUL=Sombra +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Qualidade de sombra +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - baixa (rápido) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - padrão +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - alta (lento) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=A qualidade de sombra define o tamanho da textura de +of.options.shaders.SHADOW_RES_MUL.tooltip.6=sombra usada pelo pacote shader. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Valores baixos = sombra comum. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Valores altos = sombra detalhada. + +of.options.shaders.HAND_DEPTH_MUL=Profundidade +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Profundidade da mão +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - próxima da câmera +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (padrão) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - distante da câmera +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=A profundidade da mão define o quão longe os itens +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=segurados estão da câmera. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Pacotes shader com desfoque de profundidade podem +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=mudar o embaçamento de itens segurados. + +of.options.shaders.CLOUD_SHADOW=Sombra das nuvens + +of.options.shaders.OLD_HAND_LIGHT=Ilum. pela mão +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Iluminação pela mãe +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Padrão - definida pelo pacote shader +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Sim - iluminação antiga +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Não - iluminação nova +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=A iluminação antiga permite que o pacote shader +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=reconheça a emissão de luzes por itens tanto na mão +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=principal como na secundária. + +of.options.shaders.OLD_LIGHTING=Ilum. antiga +of.options.shaders.OLD_LIGHTING.tooltip.1=Iluminação antiga +of.options.shaders.OLD_LIGHTING.tooltip.2= Padrão - definida pelo pacote shader +of.options.shaders.OLD_LIGHTING.tooltip.3= Sim - iluminação antiga +of.options.shaders.OLD_LIGHTING.tooltip.4= Não - iluminação nova +of.options.shaders.OLD_LIGHTING.tooltip.5=A iluminação antiga define o foco de luz comum aplicado +of.options.shaders.OLD_LIGHTING.tooltip.6=as laterais dos blocos. +of.options.shaders.OLD_LIGHTING.tooltip.7=Pacotes shaders podem fornecer uma melhor iluminação +of.options.shaders.OLD_LIGHTING.tooltip.8=dependendo da posição do Sol. + +of.options.shaders.DOWNLOAD=Baixar Shaders +of.options.shaders.DOWNLOAD.tooltip.1=Baixar Shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Abre a página de pacotes shader no navegador. +of.options.shaders.DOWNLOAD.tooltip.4=Coloque os pacotes shader baixados na pasta de shaders +of.options.shaders.DOWNLOAD.tooltip.5=e eles aparecerão na lista de shaders instalados. + +of.options.shaders.SHADER_PACK=Pacote shader + +of.options.shaders.shadersFolder=Pasta de Shaders +of.options.shaders.shaderOptions=Shaders... + +of.options.shaderOptionsTitle=Opções do Shader + +of.options.quality=Qualidade... +of.options.qualityTitle=Configurações de qualidade + +of.options.details=Detalhes... +of.options.detailsTitle=Preferências de detalhes + +of.options.performance=Desempenho... +of.options.performanceTitle=Configurações de desempenho + +of.options.animations=Animações... +of.options.animationsTitle=Preferências de animação + +of.options.other=Diversas... +of.options.otherTitle=Outras configurações + +of.options.other.reset=Restaurar configurações gráficas... + +of.shaders.profile=Perfil + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Básico +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Efeito visual que melhora a aparência de objetos +options.mipmapLevels.tooltip.2=distantes, suavizando os detalhes da textura. +options.mipmapLevels.tooltip.3= Não - sem suavização +options.mipmapLevels.tooltip.4= 1 - suavização mínima +options.mipmapLevels.tooltip.5= Máxima - suavização máxima +options.mipmapLevels.tooltip.6=Esta opção não afeta o desempenho. + +of.options.MIPMAP_TYPE=Tipo de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Efeito visual que melhora a aparência de objetos +of.options.MIPMAP_TYPE.tooltip.2=distantes, suavizando os detalhes da textura. +of.options.MIPMAP_TYPE.tooltip.3= Básico - suavização básica (rápido) +of.options.MIPMAP_TYPE.tooltip.4= Linear - suavização padrão +of.options.MIPMAP_TYPE.tooltip.5= Bilinear - suavização refinada +of.options.MIPMAP_TYPE.tooltip.6= Trilinear - suavização detalhada (lento) + +of.options.AA_LEVEL=Anti-aliasing +of.options.AA_LEVEL.tooltip.1=Anti-aliasing +of.options.AA_LEVEL.tooltip.2= Não - (padrão, rápido) sem suavização +of.options.AA_LEVEL.tooltip.3= 2-16 - linhas e bordas suavizadas (lento) +of.options.AA_LEVEL.tooltip.4=Esta opção suaviza linhas quadradas e +of.options.AA_LEVEL.tooltip.5=transições entre cores. +of.options.AA_LEVEL.tooltip.6=Pode reduzir a taxa de quadros. +of.options.AA_LEVEL.tooltip.7=Não é compatível com todas as placas de vídeo. +of.options.AA_LEVEL.tooltip.8=REINICIE ao alterar! + +of.options.AF_LEVEL=Filtragem anisotrópica +of.options.AF_LEVEL.tooltip.1=Filtragem anisotrópica +of.options.AF_LEVEL.tooltip.2= Não - (padrão, rápido) detalhes padrão da textura +of.options.AF_LEVEL.tooltip.3= 2-16 - texturas de mipmap mais detalhadas (lento) +of.options.AF_LEVEL.tooltip.4=A filtragem anisotrópica restaura detalhes em texturas +of.options.AF_LEVEL.tooltip.5=de mipmap. Pode reduzir significativamente +of.options.AF_LEVEL.tooltip.6=a taxa de quadros. + +of.options.CLEAR_WATER=Água clara +of.options.CLEAR_WATER.tooltip.1=Água clara +of.options.CLEAR_WATER.tooltip.2= Sim - água transparente +of.options.CLEAR_WATER.tooltip.3= Não - água padrão + +of.options.RANDOM_ENTITIES=Entidades aleatórias +of.options.RANDOM_ENTITIES.tooltip.1=Entidades aleatórias +of.options.RANDOM_ENTITIES.tooltip.2= Não - sem entidades aleatórias (rápido) +of.options.RANDOM_ENTITIES.tooltip.3= Sim - com entidades aleatórias (lento) +of.options.RANDOM_ENTITIES.tooltip.4=Entidades aleatórias usam texturas randômicas. +of.options.RANDOM_ENTITIES.tooltip.5=Requer um pacote com várias texturas de entidades. + +of.options.BETTER_GRASS=Better Grass +of.options.BETTER_GRASS.tooltip.1=Better Grass +of.options.BETTER_GRASS.tooltip.2= Não - textura padrão da grama (rápido) +of.options.BETTER_GRASS.tooltip.3= Rápidos - textura integrada da grama (lento) +of.options.BETTER_GRASS.tooltip.4= Detalhados - textura dinâmica da grama (mais lento) + +of.options.BETTER_SNOW=Better Snow +of.options.BETTER_SNOW.tooltip.1=Better Snow +of.options.BETTER_SNOW.tooltip.2= Não - neve padrão (rápido) +of.options.BETTER_SNOW.tooltip.3= Sim - neve integrada (lento) +of.options.BETTER_SNOW.tooltip.4=Exibe a neve ao redor e ao redor de blocos +of.options.BETTER_SNOW.tooltip.5=como cercas, flores e grama. + +of.options.CUSTOM_FONTS=Fontes personalizadas +of.options.CUSTOM_FONTS.tooltip.1=Fontes personalizadas +of.options.CUSTOM_FONTS.tooltip.2= Sim - (padrão, lento) fontes personalizadas +of.options.CUSTOM_FONTS.tooltip.3= Não - fontes comuns (rápido) +of.options.CUSTOM_FONTS.tooltip.4=As fontes personalizadas são fornecidas +of.options.CUSTOM_FONTS.tooltip.5=pelo pacote de recursos atual. + +of.options.CUSTOM_COLORS=Cores personalizadas +of.options.CUSTOM_COLORS.tooltip.1=Cores personalizadas +of.options.CUSTOM_COLORS.tooltip.2= Sim - (padrão, lento) cores personalizadas +of.options.CUSTOM_COLORS.tooltip.3= Não - cores comuns (rápido) +of.options.CUSTOM_COLORS.tooltip.4=As cores personalizadas são fornecidas +of.options.CUSTOM_COLORS.tooltip.5=pelo pacote de recursos atual. + +of.options.SWAMP_COLORS=Cores do pântano +of.options.SWAMP_COLORS.tooltip.1=Cores do bioma pântano +of.options.SWAMP_COLORS.tooltip.2= Sim - (padrão, lento) ativar cores do pântano +of.options.SWAMP_COLORS.tooltip.3= Não - desativar cores do pântano (rápido) +of.options.SWAMP_COLORS.tooltip.4=As cores do pântano afetam a vegetação e água. + +of.options.SMOOTH_BIOMES=Integrar biomas +of.options.SMOOTH_BIOMES.tooltip.1=Integrar bordas de biomas +of.options.SMOOTH_BIOMES.tooltip.2= Sim - (padrão, lento) integrar bordas de biomas +of.options.SMOOTH_BIOMES.tooltip.3= Não - distinguir bordas de biomas (rápido) +of.options.SMOOTH_BIOMES.tooltip.4=A transição entre biomas é feita pela média de +of.options.SMOOTH_BIOMES.tooltip.5=matizes dos blocos próximos. +of.options.SMOOTH_BIOMES.tooltip.6=Esta opção afeta a vegetação e água. + +of.options.CONNECTED_TEXTURES=Texturas lig. +of.options.CONNECTED_TEXTURES.tooltip.1=Texturas ligadas +of.options.CONNECTED_TEXTURES.tooltip.2= Não - (padrão) desativar texturas conectadas +of.options.CONNECTED_TEXTURES.tooltip.3= Rápidos - texturas conectadas rápidas +of.options.CONNECTED_TEXTURES.tooltip.4= Detalhados - texturas conectadas uniformes +of.options.CONNECTED_TEXTURES.tooltip.5=As texturas conectadas unem texturas de vidro, +of.options.CONNECTED_TEXTURES.tooltip.6=arenito e estantes ao colocá-las lado a lado. +of.options.CONNECTED_TEXTURES.tooltip.7=As texturas conectadas são fornecidas +of.options.CONNECTED_TEXTURES.tooltip.8=pelo pacote de recursos atual. + +of.options.NATURAL_TEXTURES=Texturas naturais +of.options.NATURAL_TEXTURES.tooltip.1=Texturas naturais +of.options.NATURAL_TEXTURES.tooltip.2= Não - (padrão) desativar texturas naturais +of.options.NATURAL_TEXTURES.tooltip.3= Sim - ativar texturas naturais +of.options.NATURAL_TEXTURES.tooltip.4=As texturas naturais reduzem a aparência linear dos +of.options.NATURAL_TEXTURES.tooltip.5=blocos de mesmo tipo. As variantes da base de +of.options.NATURAL_TEXTURES.tooltip.6=textura do bloco são usadas. +of.options.NATURAL_TEXTURES.tooltip.7=A configuração é fornecida pelo pacote de +of.options.NATURAL_TEXTURES.tooltip.8=recursos atual. + +of.options.EMISSIVE_TEXTURES=Texturas emissivas +of.options.EMISSIVE_TEXTURES.tooltip.1=Texturas emissivas +of.options.EMISSIVE_TEXTURES.tooltip.2= Não - (padrão) desativar texturas emissivas +of.options.EMISSIVE_TEXTURES.tooltip.3= Sim - ativar texturas emissivas +of.options.EMISSIVE_TEXTURES.tooltip.4=Texturas emissivas são renderizadas como sobreposições +of.options.EMISSIVE_TEXTURES.tooltip.5=com brilho total. Podem ser usadas para simular emissões +of.options.EMISSIVE_TEXTURES.tooltip.6=de luz da textura base. +of.options.EMISSIVE_TEXTURES.tooltip.7=As texturas emissivas são fornecidas pelo +of.options.EMISSIVE_TEXTURES.tooltip.8=pacote de recursos atual. + +of.options.CUSTOM_SKY=Céu personalizado +of.options.CUSTOM_SKY.tooltip.1=Céu personalizado +of.options.CUSTOM_SKY.tooltip.2= Sim - (padrão, lento) textura personalizada do céu +of.options.CUSTOM_SKY.tooltip.3= Não - textura padrão do céu (rápido) +of.options.CUSTOM_SKY.tooltip.4=As texturas personalizadas do céu são fornecidas +of.options.CUSTOM_SKY.tooltip.5=pelo pacote de recursos atual. + +of.options.CUSTOM_ITEMS=Itens personalizados +of.options.CUSTOM_ITEMS.tooltip.1=Itens personalizados +of.options.CUSTOM_ITEMS.tooltip.2= Sim - (padrão, lento) texturas personalizadas de itens +of.options.CUSTOM_ITEMS.tooltip.3= Não - texturas comuns de itens (rápido) +of.options.CUSTOM_ITEMS.tooltip.4=As texturas personalizadas de itens são fornecidas +of.options.CUSTOM_ITEMS.tooltip.5=pelo pacote de recursos atual. + +of.options.CUSTOM_ENTITY_MODELS=Modelos de entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modelos personalizados de entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Sim - (padrão) modelos personalizados de entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Não - modelos comuns de entidades (rápido) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Os modelos personalizados de entidades são +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=fornecidos pelo pacote de recursos atual. + +of.options.CUSTOM_GUIS=Interfaces personal. +of.options.CUSTOM_GUIS.tooltip.1=Interfaces personalizadas +of.options.CUSTOM_GUIS.tooltip.2= Sim - (padrão, lento) interfaces personalizadas +of.options.CUSTOM_GUIS.tooltip.3= Não - interfaces padrão (rápido) +of.options.CUSTOM_GUIS.tooltip.4=Disponíveis apenas em pacotes de recursos. + +# Details + +of.options.CLOUDS=Nuvens +of.options.CLOUDS.tooltip.1=Nuvens +of.options.CLOUDS.tooltip.2= Padrão - predefinido +of.options.CLOUDS.tooltip.3= Rápidos - baixa qualidade +of.options.CLOUDS.tooltip.4= Detalhados - alta qualidade +of.options.CLOUDS.tooltip.5= Não - desativar nuvens (mais rápido) +of.options.CLOUDS.tooltip.6=Nuvens rápidas em 2D. +of.options.CLOUDS.tooltip.7=Nuvens detalhadas em 3D. + +of.options.CLOUD_HEIGHT=Altura das nuvens +of.options.CLOUD_HEIGHT.tooltip.1=Altura das nuvens +of.options.CLOUD_HEIGHT.tooltip.2= Não - altura padrão +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - acima do limite de altura do mundo + +of.options.TREES=Árvores +of.options.TREES.tooltip.1=Árvores +of.options.TREES.tooltip.2= Padrão - predefinido +of.options.TREES.tooltip.3= Rápidos - baixa qualidade (mais rápido) +of.options.TREES.tooltip.4= Inteligentes - qualidade razoável (rápido) +of.options.TREES.tooltip.5= Detalhados - alta qualidade (lento) +of.options.TREES.tooltip.6=Na opção Rápidos, as árvores têm folhas opacas. Folhas +of.options.TREES.tooltip.7=de árvores Detalhados e Inteligentes são transparentes. + +of.options.RAIN=Chuva e neve +of.options.RAIN.tooltip.1=Chuva e neve +of.options.RAIN.tooltip.2= Padrão - predefinido +of.options.RAIN.tooltip.3= Rápidos - chuva e neve leves +of.options.RAIN.tooltip.4= Detalhados - chuva e neve densas (lento.) +of.options.RAIN.tooltip.5= Não - chuva e neve desativadas (mais rápido) +of.options.RAIN.tooltip.6=Ao desativar, os sons de precipitação ainda +of.options.RAIN.tooltip.7=podem estar ativados. + +of.options.SKY=Céu +of.options.SKY.tooltip.1=Céu +of.options.SKY.tooltip.2= Sim - céu ativado (lento) +of.options.SKY.tooltip.3= Não - céu desativado (rápido) +of.options.SKY.tooltip.4=Ao desativar, a Lua e o Sol ainda podem estar visíveis. + +of.options.STARS=Estrelas +of.options.STARS.tooltip.1=Estrelas +of.options.STARS.tooltip.2= Sim - estrelas visíveis (lento) +of.options.STARS.tooltip.3= Não - estrelas desativadas (rápido) + +of.options.SUN_MOON=Sol e Lua +of.options.SUN_MOON.tooltip.1=Sol e Lua +of.options.SUN_MOON.tooltip.2= Sim - (padrão) Sol e Lua visíveis +of.options.SUN_MOON.tooltip.3= Não - Sol e Lua desativados (rápido) + +of.options.SHOW_CAPES=Mostrar capas +of.options.SHOW_CAPES.tooltip.1=Mostrar capas de jogadores +of.options.SHOW_CAPES.tooltip.2= Sim - (padrão) mostrar capas de jogadores +of.options.SHOW_CAPES.tooltip.3= Não - ocultar capas de jogadores + +of.options.TRANSLUCENT_BLOCKS=Blocos transl. +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocos translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Padrão - predefinido +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Detalhados - transição correta de cores (lento) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Rápidos - transição rápida de cores (mais rápido) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Controla a transição de cores em blocos translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.6=de cores distintas (vidro tingido, água, gelo) ao +of.options.TRANSLUCENT_BLOCKS.tooltip.7=colocá-los atrás uns dos outros com espaço entre eles. + +of.options.HELD_ITEM_TOOLTIPS=Descrição de itens +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Descrição de itens segurados +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Sim - (padrão) exibir descrições +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Não - ocultar descrições + +of.options.ADVANCED_TOOLTIPS=Descrições avançadas +of.options.ADVANCED_TOOLTIPS.tooltip.1=Descrição avançada de objetos +of.options.ADVANCED_TOOLTIPS.tooltip.2= Sim - exibir descrições +of.options.ADVANCED_TOOLTIPS.tooltip.3= Não - (padrão) ocultar descrições +of.options.ADVANCED_TOOLTIPS.tooltip.4=Descrições avançadas exibem mais informações sobre +of.options.ADVANCED_TOOLTIPS.tooltip.5=itens (ID, duração) e opções do shader como +of.options.ADVANCED_TOOLTIPS.tooltip.6=ID, fonte e valor padrão. + +of.options.DROPPED_ITEMS=Itens soltos +of.options.DROPPED_ITEMS.tooltip.1=Itens soltos +of.options.DROPPED_ITEMS.tooltip.2= Padrão - predefinido +of.options.DROPPED_ITEMS.tooltip.3= Rápidos - itens 2D no chão +of.options.DROPPED_ITEMS.tooltip.4= Detalhados - itens 3D no chão (lento) + +options.entityShadows.tooltip.1=Sombras de entidades +options.entityShadows.tooltip.2= Sim - mostrar sombras de entidades +options.entityShadows.tooltip.3= Não - desativar sombras de entidades + +oof.options.VIGNETTE=Vinheta +of.options.VIGNETTE.tooltip.1=Efeito visual que escurece as bordas da tela do jogo +of.options.VIGNETTE.tooltip.2= Padrão - predefinido +of.options.VIGNETTE.tooltip.3= Rápidos - vinheta desativada (rápido) +of.options.VIGNETTE.tooltip.4= Detalhados - vinheta ativada (lento) +of.options.VIGNETTE.tooltip.5=A vinheta pode afetar significativamente a taxa de +of.options.VIGNETTE.tooltip.6=quadros em tela inteira. +of.options.VIGNETTE.tooltip.7=O efeito da vinheta é sutil e pode +of.options.VIGNETTE.tooltip.8=ser desativado facilmente. + +of.options.DYNAMIC_FOV=Visão dinâmica +of.options.DYNAMIC_FOV.tooltip.1=Campo de visão dinâmico +of.options.DYNAMIC_FOV.tooltip.2= Sim - (padrão) ativar o campo de visão dinâmico +of.options.DYNAMIC_FOV.tooltip.3= Não - desativar o campo de visão dinâmico +of.options.DYNAMIC_FOV.tooltip.4=Muda o campo de visão ao voar, correr ou +of.options.DYNAMIC_FOV.tooltip.5=retesar um arco. + +of.options.DYNAMIC_LIGHTS=Luzes dinâmicas +of.options.DYNAMIC_LIGHTS.tooltip.1=Luzes dinâmicas +of.options.DYNAMIC_LIGHTS.tooltip.2= Não - (padrão) luzes comuns +of.options.DYNAMIC_LIGHTS.tooltip.3= Rápidos - luzes dinâmicas rápidas (a cada 500 ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Detalhados - luzes dinâmicas suaves (em tempo real) +of.options.DYNAMIC_LIGHTS.tooltip.5=Ativa a emissão de luzes por objetos como tochas e +of.options.DYNAMIC_LIGHTS.tooltip.6=pedras luminosas, quando segurados ou +of.options.DYNAMIC_LIGHTS.tooltip.7=caídos no chão. + +options.biomeBlendRadius.tooltip.1=Suaviza a transição de cores entre biomas +options.biomeBlendRadius.tooltip.2= Não - sem transição (rápido) +options.biomeBlendRadius.tooltip.3= 5x5 - (padrão) transição normal +options.biomeBlendRadius.tooltip.4= 15x15 - transição máxima (lento) +options.biomeBlendRadius.tooltip.5=Valores altos podem gerar mais travamentos +options.biomeBlendRadius.tooltip.6=e reduzir a velocidade do carregamento de chunks. + +# Performance + +of.options.SMOOTH_FPS=FPS estável +of.options.SMOOTH_FPS.tooltip.1=Estabiliza a taxa ao equilibrar buffers da placa gráfica. +of.options.SMOOTH_FPS.tooltip.2= Não - taxa de quadros instável +of.options.SMOOTH_FPS.tooltip.3= Sim - taxa de quadros estável +of.options.SMOOTH_FPS.tooltip.4=Esta opção depende da placa de vídeo e seu efeito não +of.options.SMOOTH_FPS.tooltip.5=é sempre visível. + +of.options.SMOOTH_WORLD=Mundo estável +of.options.SMOOTH_WORLD.tooltip.1=Reduz a latência causada pelo servidor interno. +of.options.SMOOTH_WORLD.tooltip.2= Não - taxa de quadros flutuante +of.options.SMOOTH_WORLD.tooltip.3= Sim - taxa de quadros estável +of.options.SMOOTH_WORLD.tooltip.4=Particiona o carregamento do servidor interno. +of.options.SMOOTH_WORLD.tooltip.5=Disponível apenas em mundos locais. + +of.options.FAST_RENDER=Render. rápida +of.options.FAST_RENDER.tooltip.1=Renderização rápida +of.options.FAST_RENDER.tooltip.2= Não - (padrão) renderização comum +of.options.FAST_RENDER.tooltip.3= Sim - renderização otimizada (rápido) +of.options.FAST_RENDER.tooltip.4=Utiliza um algoritmo especial de renderização que +of.options.FAST_RENDER.tooltip.5=reduz o uso da GPU e eleva a taxa de quadros. +of.options.FAST_RENDER.tooltip.6=Esta opção pode entrar em conflito com outros mods. + +of.options.FAST_MATH=Otimizar cálculos +of.options.FAST_MATH.tooltip.1=Otimização de cálculos +of.options.FAST_MATH.tooltip.2= Não - (padrão) cálculos comuns +of.options.FAST_MATH.tooltip.3= Sim - cálculos otimizados +of.options.FAST_MATH.tooltip.4=Utiliza funções seno() e cosseno() especiais que +of.options.FAST_MATH.tooltip.5=otimizam o cache da CPU e elevam a taxa de quadros. +of.options.FAST_MATH.tooltip.6=Esta opção pode afetar minimamente a geração de mundos. + +of.options.CHUNK_UPDATES=Atualiz. de chunks +of.options.CHUNK_UPDATES.tooltip.1=Atualizações de chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - (padrão, rápido) carregamento lento do mundo +of.options.CHUNK_UPDATES.tooltip.3= 3 - carregamento rápido do mundo (lento) +of.options.CHUNK_UPDATES.tooltip.4= 5 - carregamento instantâneo (mais lento) +of.options.CHUNK_UPDATES.tooltip.5=Número de atualiz. de chunks por quadro renderizado. +of.options.CHUNK_UPDATES.tooltip.6=Valores altos podem desestabilizar a taxa de quadros. + +of.options.CHUNK_UPDATES_DYNAMIC=Atualiz. dinâmicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Atualizações dinâmicas de chunks +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Não - (padrão) atualização de chunks por quadros +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Sim - atualizações contínuas ao jogar +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Atualizações dinâmicas demandam mais atualizações +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=de chunks para carregar o mundo rapidamente. + +of.options.LAZY_CHUNK_LOADING=Carreg. limitado +of.options.LAZY_CHUNK_LOADING.tooltip.1=Carregamento limitado de chunks +of.options.LAZY_CHUNK_LOADING.tooltip.2= Não - carregamento padrão do servidor +of.options.LAZY_CHUNK_LOADING.tooltip.3= Sim - carregamento limitado (rápido) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Otimiza o carregamento de chunks do servidor +of.options.LAZY_CHUNK_LOADING.tooltip.5=integrado com a distribuição de ciclos. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Desativar se partes do mundo não carregarem +of.options.LAZY_CHUNK_LOADING.tooltip.7=corretamente. Disponível apenas em mundos locais. + +of.options.RENDER_REGIONS=Render. de regiões +of.options.RENDER_REGIONS.tooltip.1=Renderização de regiões +of.options.RENDER_REGIONS.tooltip.2= Não - (padrão) desativar renderização de regiões +of.options.RENDER_REGIONS.tooltip.3= Sim - ativar renderização de regiões +of.options.RENDER_REGIONS.tooltip.4=Renderiza terrenos distantes mais rapidamente. +of.options.RENDER_REGIONS.tooltip.5=Ative o VBO para melhores resultados. +of.options.RENDER_REGIONS.tooltip.6=Não recomendado com placas de vídeo integradas. + +of.options.SMART_ANIMATIONS=Animações intel. +of.options.SMART_ANIMATIONS.tooltip.1=Animações inteligentes +of.options.SMART_ANIMATIONS.tooltip.2= Não - (padrão) animações comuns +of.options.SMART_ANIMATIONS.tooltip.3= Sim - animações inteligentes +of.options.SMART_ANIMATIONS.tooltip.4=O jogo animará somente as texturas +of.options.SMART_ANIMATIONS.tooltip.5=visíveis no momento. +of.options.SMART_ANIMATIONS.tooltip.6=A latência é reduzida e a taxa de quadros sobe. +of.options.SMART_ANIMATIONS.tooltip.7=Recomendado para pacotes de recursos em alta definição. + +# Animations + +of.options.animation.allOn=Sim +of.options.animation.allOff=Não +of.options.animation.dynamic=Dinâmicas + +of.options.ANIMATED_WATER=Água animada +of.options.ANIMATED_LAVA=Lava animada +of.options.ANIMATED_FIRE=Fogo animado +of.options.ANIMATED_PORTAL=Portal animado +of.options.ANIMATED_REDSTONE=Redstone animada +of.options.ANIMATED_EXPLOSION=Explosão animada +of.options.ANIMATED_FLAME=Chama animada +of.options.ANIMATED_SMOKE=Fumaça animada +of.options.VOID_PARTICLES=Partículos do vazio +of.options.WATER_PARTICLES=Partículas de água +of.options.RAIN_SPLASH=Respingos de chuva +of.options.PORTAL_PARTICLES=Partículas de portal +of.options.POTION_PARTICLES=Partículas de poção +of.options.DRIPPING_WATER_LAVA=Gotas de água e lava +of.options.ANIMATED_TERRAIN=Terreno animado +of.options.ANIMATED_TEXTURES=Texturas animadas +of.options.FIREWORK_PARTICLES=Fogos de artifício + +# Other + +of.options.LAGOMETER=Lagômetro +of.options.LAGOMETER.tooltip.1=Análise da latência na janela de depuração (F3). +of.options.LAGOMETER.tooltip.2=* Laranja - Coletor de lixo de memória +of.options.LAGOMETER.tooltip.3=* Ciano - Ciclos +of.options.LAGOMETER.tooltip.4=* Azul - Executáveis esperados +of.options.LAGOMETER.tooltip.5=* Roxo - Envio de chunks +of.options.LAGOMETER.tooltip.6=* Vermelho - Atualizações de chunks +of.options.LAGOMETER.tooltip.7=* Amarelo - Verificação de visibilidade +of.options.LAGOMETER.tooltip.8=* Verde - Renderização de terreno + +of.options.PROFILER=Análise de depuração +of.options.PROFILER.tooltip.1=Análise de depuração +of.options.PROFILER.tooltip.2= Sim - Depuração ativada (lento) +of.options.PROFILER.tooltip.3= Não - Depuração desativada (rápido) +of.options.PROFILER.tooltip.4=A análise de depuração coleta e exibe dados de +of.options.PROFILER.tooltip.5=depuração ao ativar o modo (F3). + +of.options.WEATHER=Clima +of.options.WEATHER.tooltip.1=Clima +of.options.WEATHER.tooltip.2= Sim - ativar controle do clima (lento) +of.options.WEATHER.tooltip.3= Não - desativar controle do clima (rápido) +of.options.WEATHER.tooltip.4=O clima controla a chuva e neve. Disponível +of.options.WEATHER.tooltip.5=apenas em mundos locais. + +of.options.time.dayOnly=Somente dia +of.options.time.nightOnly=Somente noite + +of.options.TIME=Tempo +of.options.TIME.tooltip.1=Tempo +of.options.TIME.tooltip.2= Padrão - ciclos de dia e noite +of.options.TIME.tooltip.3= Somente dia - diurno +of.options.TIME.tooltip.4= Somente noite - noturno +of.options.TIME.tooltip.5=Disponível apenas no Modo Criativo e +of.options.TIME.tooltip.6=mundos locais. + +options.fullscreen.tooltip.1=Tela inteira +options.fullscreen.tooltip.2= Sim - jogar em tela inteira +options.fullscreen.tooltip.3= Não - jogar em janela +options.fullscreen.tooltip.4=O modo tela inteira pode ser mais lento ou mais rápido +options.fullscreen.tooltip.5=do que o de janela, dependendo da placa de vídeo. + +options.fullscreen.resolution=Resolução +options.fullscreen.resolution.tooltip.1=Resolução da tela inteira +options.fullscreen.resolution.tooltip.2= Padrão - resolução do monitor (lento) +options.fullscreen.resolution.tooltip.3= WxH - resolução personalizada (rápido) +options.fullscreen.resolution.tooltip.4=A resolução escolhida é usada em tela inteira. +options.fullscreen.resolution.tooltip.5=Resoluções baixas geralmente são mais rápidas. + +of.options.SHOW_FPS=Mostrar FPS +of.options.SHOW_FPS.tooltip.1=Exibe a taxa de quadros e informações de renderização. +of.options.SHOW_FPS.tooltip.2= FPS - média/mínima +of.options.SHOW_FPS.tooltip.3= C: - renderizadores de chunks +of.options.SHOW_FPS.tooltip.4= E: - entidades renderizadas + blocos-entidades +of.options.SHOW_FPS.tooltip.5= U: - atualizações de chunks +of.options.SHOW_FPS.tooltip.6=A taxa de quadros só é visível quando a tela +of.options.SHOW_FPS.tooltip.7=de depuração não é exibida. + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3min +of.options.save.6min=6min +of.options.save.12min=12min +of.options.save.24min=24min + +of.options.AUTOSAVE_TICKS=Autossalvamento +of.options.AUTOSAVE_TICKS.tooltip.1=Intervalo do autossalvamento +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - padrão +of.options.AUTOSAVE_TICKS.tooltip.3=Podem haver travamentos, dependendo da renderização. +of.options.AUTOSAVE_TICKS.tooltip.4=O mundo também é salvo ao abrir o menu do jogo. + +of.options.SCREENSHOT_SIZE=Captura de tela +of.options.SCREENSHOT_SIZE.tooltip.1=Tamanho da captura de tela +of.options.SCREENSHOT_SIZE.tooltip.2= Padrão - tamanho predefinido +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - tamanho personalizado +of.options.SCREENSHOT_SIZE.tooltip.4=Tamanhos maiores requerem mais memória. +of.options.SCREENSHOT_SIZE.tooltip.5=Incompatível com a renderização rápida e anti-aliasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Requer o suporte de framebuffer da GPU. + +of.options.SHOW_GL_ERRORS=Erros da OpenGL +of.options.SHOW_GL_ERRORS.tooltip.1=Mostrar erros da OpenGL +of.options.SHOW_GL_ERRORS.tooltip.2=Os erros da OpenGL são exibidos no bate-papo. +of.options.SHOW_GL_ERRORS.tooltip.3=Desativar apenas se houver conflitos e os erros +of.options.SHOW_GL_ERRORS.tooltip.4=não puderem ser corrigidos. +of.options.SHOW_GL_ERRORS.tooltip.5=Ao desativar, os erros ainda são registrados e +of.options.SHOW_GL_ERRORS.tooltip.6=podem reduzir a taxa de quadros. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Fundo do bate-papo +of.options.CHAT_BACKGROUND.tooltip.1=Fundo do bate-papo +of.options.CHAT_BACKGROUND.tooltip.2= Padrão - largura fixa +of.options.CHAT_BACKGROUND.tooltip.3= Compacto - flexível +of.options.CHAT_BACKGROUND.tooltip.4= Não - oculto + +of.options.CHAT_SHADOW=Sombra do bate-papo +of.options.CHAT_SHADOW.tooltip.1=Sombra do bate-papo +of.options.CHAT_SHADOW.tooltip.2= Sim - ativar sombra +of.options.CHAT_SHADOW.tooltip.3= Não - desativar sombra diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pt_PT.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pt_PT.lang new file mode 100644 index 0000000..b2fcc9b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/pt_PT.lang @@ -0,0 +1,765 @@ +# General +of.general.ambiguous=ambíguo +of.general.compact=Compacto +of.general.custom=Personalizado +of.general.from=De +of.general.id=Id +of.general.max=Máximo +of.general.restart=reiniciar +of.general.smart=Garridas + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=O antiserrilhamento não é compatível com as shaders. +of.message.aa.shaders2=Desativa as shaders para ativares esta opção. + +of.message.af.shaders1=A filtração anisotrópica não é compatível com as shaders. +of.message.af.shaders2=Desativa as shaders para ativares esta opção. + +of.message.fr.shaders1=O carregamento rápido não é compatível com as shaders. +of.message.fr.shaders2=Desativa as shaders para ativares esta opção. + +of.message.an.shaders1=3D Anaglífico não é compatível com as shaders. +of.message.an.shaders2=Desativa as shaders para ativares esta opção. + +of.message.shaders.aa1=As shaders não são compatíveis com o antiserrilhamento. +of.message.shaders.aa2=Vai a "qualidade", define o antiserrilhamento para "não", e reinicia o jogo. + +of.message.shaders.af1=As shaders não são compatíveis com filtração anisotrópica. +of.message.shaders.af2=Vai a "qualidade" e define a "filtração anisotrópica" para "não". + +of.message.shaders.fr1=As shaders não são compatíveis com o carregamento rápido. +of.message.shaders.fr2=Vai a "desempenho" e define o "carregamento rápido" para "não". + +of.message.shaders.an1=As shaders não são compatíveis com o 3D anaglífico. +of.message.shaders.an2=Vai a "outros" e define o "3D anaglífico" para "não". + +of.message.shaders.nv1=Este pacote de shaders requer uma nova versão do OptiFine: %s +of.message.shaders.nv2=Tens a certeza que queres continuar? + +of.message.newVersion=Uma nova versão do §eOptiFine§f está agora disponível: §e%s§f +of.message.java64Bit=Podes instalar o §eJava - 64 bits§f para aumentar o desempenho. +of.message.openglError=§eErro da OpenGL§f: %s (%s) + +of.message.shaders.loading=A carregar shaders: %s + +of.message.other.reset=Redefinir todas as definições de vídeo para padrão? + +of.message.loadingVisibleChunks=A carregar chunks visíveis + +# Skin customization + +of.options.skinCustomisation.ofCape=Capa do OptiFine... + +of.options.capeOF.title=Capa do OptiFine +of.options.capeOF.openEditor=Abrir o editor de capas +of.options.capeOF.reloadCape=Recarregar a capa + +of.message.capeOF.openEditor=O editor de capas do OptiFine deverá abrir numa nova página no browser. +of.message.capeOF.reloadCape=A capa do OptiFine será recarregada daqui a 15 segundos. + +of.message.capeOF.error1=Falha na autenticação da Mojang. +of.message.capeOF.error2=Erro: %s + +# Video settings + +options.graphics.tooltip.1=Qualidade visual +options.graphics.tooltip.2= Rápida - menor qualidade, rápido +options.graphics.tooltip.3= Elegante - maior qualidade, lento +options.graphics.tooltip.4=Altera a aparência das nuvens, folhas, água, +options.graphics.tooltip.5=sombras e ainda as laterais da relva. + +of.options.renderDistance.tiny=Minúscula +of.options.renderDistance.short=Curta +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Longa +of.options.renderDistance.extreme=Extrema +of.options.renderDistance.insane=Insana +of.options.renderDistance.ludicrous=Ridícula + +options.renderDistance.tooltip.1=Alcance visual +options.renderDistance.tooltip.2= 2 Minúscula - 32m (rápida) +options.renderDistance.tooltip.3= 8 Normal - 128m (normal) +options.renderDistance.tooltip.4= 16 Longa - 256m (lenta) +options.renderDistance.tooltip.5= 32 Extrema - 512m (muito lenta) exige muitos recursos +options.renderDistance.tooltip.6= 48 Insana - 768m, precisas de 2GB de RAM +options.renderDistance.tooltip.7= 64 Ridícula - 1024m, precisas de 3GB de RAM +options.renderDistance.tooltip.8=Valores acima de 16 só serão eficazes em mundos locais. + +options.ao.tooltip.1=Iluminação suave +options.ao.tooltip.2= Não - sem iluminação suave (rápida) +options.ao.tooltip.3= Mínimo - iluminação suave simples (lenta) +options.ao.tooltip.4= Máximo - iluminação suave complexa (muito lenta) + +options.framerateLimit.tooltip.1=Limite de fps +options.framerateLimit.tooltip.2= VSync - limitar os fps do monitor (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variável +options.framerateLimit.tooltip.4= Ilimitado - sem limite (rápido) +options.framerateLimit.tooltip.5=O limite diminuirá o número fps mesmo que esta +options.framerateLimit.tooltip.6=não atinja o valor máximo. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Nível da ilum. suave +of.options.AO_LEVEL.tooltip.1=Nível da iluminação suave +of.options.AO_LEVEL.tooltip.2= Desligado - sem sombras +of.options.AO_LEVEL.tooltip.3= 50%% - sombras claras +of.options.AO_LEVEL.tooltip.4= 100%% - sombras escuras + +options.viewBobbing.tooltip.1=Balanço da visão +options.viewBobbing.tooltip.2=Se estiveres a usar mipmaps, desliga isto para +options.viewBobbing.tooltip.3=obteres melhores resultados. + +options.guiScale.tooltip.1=Tamanho da interface +options.guiScale.tooltip.2= Automática - Tamanho máximo +options.guiScale.tooltip.3= Pequena, Normal, Grande - 1x to 3x +options.guiScale.tooltip.4= 4x to 10x - disponível em monitores 4K +options.guiScale.tooltip.5=Valores ímpares (1x, 3x, 5x ...) não são compatíveis com o +options.guiScale.tooltip.6=Unicode. Uma interface pequena é normalmente mais rápida. + +options.vbo=VBOs +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Usa um modelo de carregamento alternativo que normalmente +options.vbo.tooltip.3=é mais rápido (5-10%%) que o carregamento padrão. + +options.gamma.tooltip.1=Altera o brilho dos objetos mais escuros. +options.gamma.tooltip.2= Sombrio - brilho padrão +options.gamma.tooltip.3= 1-99%% - variável +options.gamma.tooltip.4= Claro - brilho máximo para objetos escuros +options.gamma.tooltip.5=Esta opção não altera a luminosidade de +options.gamma.tooltip.6=objetos completamente negros. + +options.anaglyph.tooltip.1=3D anaglífico +options.anaglyph.tooltip.2=Ativa o efeito 3D estereoscópio com o uso de diferentes +options.anaglyph.tooltip.3=cores para cada olho. +options.anaglyph.tooltip.4=Requere uns óculos 3D, daqueles azuis e vermelhos, +options.anaglyph.tooltip.5=para uma visualização adequada. + +options.attackIndicator.tooltip.1=Configura a posição do indicador de ataque +options.attackIndicator.tooltip.2= Mira - debaixo da mira +options.attackIndicator.tooltip.3= Barra - ao lado da barra rápida +options.attackIndicator.tooltip.4= Não - sem indicador de ataque +options.attackIndicator.tooltip.5=O indicador de ataque dispõe a força do ataque +options.attackIndicator.tooltip.6=do item na mão do jogador. + +of.options.ALTERNATE_BLOCKS=Alternar blocos +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternar blocos +of.options.ALTERNATE_BLOCKS.tooltip.2=Usa modelos alternativos para alguns dos blocos. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depende do pacote de recursos seleciondado. + +of.options.FOG_FANCY=Nevoeiro +of.options.FOG_FANCY.tooltip.1=Tipo de nevoeiro +of.options.FOG_FANCY.tooltip.2= Rápido - nevoeiro rápido +of.options.FOG_FANCY.tooltip.3= Elegante - nevoeiro lento, melhor aspeto +of.options.FOG_FANCY.tooltip.4= Não - sem nevoeiro, mais rápido +of.options.FOG_FANCY.tooltip.5=O nevoeiro "elegante" só está disponível se for +of.options.FOG_FANCY.tooltip.6=suportado pela placa gráfica atual. + +of.options.FOG_START=Começo do nevoeiro +of.options.FOG_START.tooltip.1=Começo do nevoeiro +of.options.FOG_START.tooltip.2= 0.2 - o nevoeiro começa perto do jogador +of.options.FOG_START.tooltip.3= 0.8 - o nevoeiro começa longe do jogador +of.options.FOG_START.tooltip.4=Esta opção, por norma, não afeta o desempenho. + +of.options.CHUNK_LOADING=Carreg. de chunks +of.options.CHUNK_LOADING.tooltip.1=Carregamento de chunks +of.options.CHUNK_LOADING.tooltip.2= Padrão - fps instáveis durante o carregamento +of.options.CHUNK_LOADING.tooltip.3= Fluído - fps estáveis +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - fps estáveis, carregamento 3x mais rápido +of.options.CHUNK_LOADING.tooltip.5="Fluído" e "Multi-Core" removem o "gaguejo" e as +of.options.CHUNK_LOADING.tooltip.6=paragens causadas pelo carregamento de chunks. +of.options.CHUNK_LOADING.tooltip.7="Multi-Core" pode carregar o mundo até 3x mais rápido e +of.options.CHUNK_LOADING.tooltip.8=aumentar os fps com o uso de um CPU secundário. +of.options.chunkLoading.smooth=Fluído +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=Não +of.options.shaders.packDefault=(interno) + +of.options.shaders.ANTIALIASING=Antiserrilha +of.options.shaders.ANTIALIASING.tooltip.1=Antiserrilhamento +of.options.shaders.ANTIALIASING.tooltip.2= Não - (padrão) sem antiserrilhamento (rápido) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - linhas e cantos antiserrilhados (lento) +of.options.shaders.ANTIALIASING.tooltip.4=O FXAA é um efeito pós-processamento, que melhora as +of.options.shaders.ANTIALIASING.tooltip.5=linhas dentadas e as transições acerbas das cores. +of.options.shaders.ANTIALIASING.tooltip.6=É mais rápido que a antiserrilha tradicional e é +of.options.shaders.ANTIALIASING.tooltip.7=compatível com as shaders e o carregamento rápido. + +of.options.shaders.NORMAL_MAP=Mapa normal +of.options.shaders.NORMAL_MAP.tooltip.1=Mapa normal +of.options.shaders.NORMAL_MAP.tooltip.2= Sim - (padrão) ativa os mapas normais +of.options.shaders.NORMAL_MAP.tooltip.3= Não - desativa os mapas normais +of.options.shaders.NORMAL_MAP.tooltip.4=Os mapas normais podem ser usados pelo pacote +of.options.shaders.NORMAL_MAP.tooltip.5=de shaders para simularem uma geometria 3D em +of.options.shaders.NORMAL_MAP.tooltip.6=superfícies planas. As texturas dos mapas normais +of.options.shaders.NORMAL_MAP.tooltip.7=são suportadas pelo pacote de recursos atual. + +of.options.shaders.SPECULAR_MAP=Mapa especular +of.options.shaders.SPECULAR_MAP.tooltip.1=Mapa especular +of.options.shaders.SPECULAR_MAP.tooltip.2= Sim - (padrão) ativa os mapas especulares +of.options.shaders.SPECULAR_MAP.tooltip.3= Não - desativa os mapas especulares +of.options.shaders.SPECULAR_MAP.tooltip.4=Os mapas especulares podem ser usados pelo +of.options.shaders.SPECULAR_MAP.tooltip.5=pacotes de shaders para simularem efeitos especiais +of.options.shaders.SPECULAR_MAP.tooltip.6=de reflexo. As texturas dos mapas especulares são +of.options.shaders.SPECULAR_MAP.tooltip.7=suportadas pelo pacote de recursos atual. + +of.options.shaders.RENDER_RES_MUL=Qual. de carregamento +of.options.shaders.RENDER_RES_MUL.tooltip.1=Qualidade de carregamento +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - baixa (rápido) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - padrão +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - alta (lento) +of.options.shaders.RENDER_RES_MUL.tooltip.5=A qualidade de carregamento controla o tamanho da +of.options.shaders.RENDER_RES_MUL.tooltip.6=texura que o pacote de shaders está a carregar. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Os valores baixos podem ser úteis em ecrãs 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Os valores altos funcionam como filtração antiserrilha. + +of.options.shaders.SHADOW_RES_MUL=Qual. das sombras +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Qualidade das sombras +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - baixa (rápido) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - padrão +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - alta (lento) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=A qualidade das sombras controla o tamanho das texturas +of.options.shaders.SHADOW_RES_MUL.tooltip.6=sombrias do mapa usadas pelo pacote de shaders. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Valores baixos = ríspida, sombras brutas +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Valores altos = detalhadas, sombras aprazíveis + +of.options.shaders.HAND_DEPTH_MUL=Profun. da mão +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Profundidade da mão +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - mão perto da câmara +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - padrão +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - mão longe da câmara +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=A profundidade da mão controla o quão longe os +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=objetos em mão, estão da câmara. Para os pacotes +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=de shaders com o uso de desfoque, isto alterará +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=a desfocagem dos objetos que tiveres na mão. + +of.options.shaders.CLOUD_SHADOW=Sombras das nuvens + +of.options.shaders.OLD_HAND_LIGHT=Ilum. da mão +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Iluminação da mão +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Padrão - controlado pelo pacote de shaders +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Sim - usa o antigo sistema de iluminação da mão +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Não - usa o novo sistema de iluminação da mão +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=A iluminação antiga da mão, permite que os pacotes de +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=shaders, que apenas reconhecem items emissores de luz +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=na mão principal, reconheca também items que estejam +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=ma mão secundária. + +of.options.shaders.OLD_LIGHTING=Ilum. antiga +of.options.shaders.OLD_LIGHTING.tooltip.1=Iluminação antiga +of.options.shaders.OLD_LIGHTING.tooltip.2= Padrão - controlado pelo pacote de shaders +of.options.shaders.OLD_LIGHTING.tooltip.3= Sim - usa o antigo sistema de iluminação +of.options.shaders.OLD_LIGHTING.tooltip.4= Não - não usar o sistema de iluminação antigo +of.options.shaders.OLD_LIGHTING.tooltip.5=A iluminação antiga controla o foco de luz que +of.options.shaders.OLD_LIGHTING.tooltip.6=está aplicado às laterais dos blocos. +of.options.shaders.OLD_LIGHTING.tooltip.7=Pacotes de shaders com o uso de sombras, garantem +of.options.shaders.OLD_LIGHTING.tooltip.8=uma melhor iluminação dependendo da posição do sol. + +of.options.shaders.DOWNLOAD=Transferir Shaders +of.options.shaders.DOWNLOAD.tooltip.1=Transferir Shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Abre o pacote de shaders numa nova página no browser. +of.options.shaders.DOWNLOAD.tooltip.4=Coloca as shaders que transferiste na "Pasta de Shaders" +of.options.shaders.DOWNLOAD.tooltip.5=e elas aparecerão na lista de shaders instaladas. + +of.options.shaders.SHADER_PACK=Pasta de shaders + +of.options.shaders.shadersFolder=Pasta de shaders +of.options.shaders.shaderOptions=Opções das shaders... + +of.options.shaderOptionsTitle=Opções das shaders + +of.options.quality=Qualidade... +of.options.qualityTitle=Definições de qualidade + +of.options.details=Detalhes... +of.options.detailsTitle=Definições de detalhes + +of.options.performance=Desempenho... +of.options.performanceTitle=Definições de desempenho + +of.options.animations=Animações... +of.options.animationsTitle=Definições das animações + +of.options.other=Outros... +of.options.otherTitle=Outras definições + +of.options.other.reset=Repor definições de vídeo... + +of.shaders.profile=Perfil + +# Quality - Qualidade + +of.options.mipmap.bilinear=2x +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Próximo +of.options.mipmap.trilinear=3x + +options.mipmapLevels.tooltip.1=Efeito visual que dá um melhor aspeto aos objetos +options.mipmapLevels.tooltip.2=distantes, melhorando os detalhes das texturas +options.mipmapLevels.tooltip.3= Não - sem otimização de texturas +options.mipmapLevels.tooltip.4= 1 - otimização mínima +options.mipmapLevels.tooltip.5= Máximo - otimização máxima +options.mipmapLevels.tooltip.6=Esta opção, por norma, não afeta o desempenho. + +of.options.MIPMAP_TYPE=Tipo de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Efeito visual que dá um melhor aspeto aos objetos +of.options.MIPMAP_TYPE.tooltip.2=distantes, melhorando os detalhes das texturas +of.options.MIPMAP_TYPE.tooltip.3= Próximo - otimização brusca (rápido) +of.options.MIPMAP_TYPE.tooltip.4= Linear - otimização normal +of.options.MIPMAP_TYPE.tooltip.5= 2x - otimização delicada +of.options.MIPMAP_TYPE.tooltip.6= 3x - otimização precisa (lento) + + +of.options.AA_LEVEL=Antiserrilhamento +of.options.AA_LEVEL.tooltip.1=Antiserrilhamento +of.options.AA_LEVEL.tooltip.2= Não - (padrão) sem antiserrilhamento (rápido) +of.options.AA_LEVEL.tooltip.3= 2-16 - linhas e cantos antiserrilhados (lento) +of.options.AA_LEVEL.tooltip.4=A antiserrilha melhora as linhas dentadas e +of.options.AA_LEVEL.tooltip.5=as transições acerbas das cores. +of.options.AA_LEVEL.tooltip.6=Quando ativada, pode reduzir substancialmente os FPS. +of.options.AA_LEVEL.tooltip.7=Nem todos os níveis são suportados por todas as placas +of.options.AA_LEVEL.tooltip.8=gráficas. Só é eficaz após o reinício do jogo. + +of.options.AF_LEVEL=Filt. anisotrópica +of.options.AF_LEVEL.tooltip.1=Filtração anisotrópica +of.options.AF_LEVEL.tooltip.2= Não - (padrão) detalhe estandarte das texturas (rápido) +of.options.AF_LEVEL.tooltip.3= 2-16 - aumento dos detalhes nas texturas de mipmap (lento) +of.options.AF_LEVEL.tooltip.4=A filtração anisotrópica recupera os detalhes +of.options.AF_LEVEL.tooltip.5=nas texturas de mipmap. +of.options.AF_LEVEL.tooltip.6=Quando ativada, pode reduzir substancialmente os FPS. + +of.options.CLEAR_WATER=Água límpida +of.options.CLEAR_WATER.tooltip.1=Água limpa +of.options.CLEAR_WATER.tooltip.2= Sim - água limpa e transparente +of.options.CLEAR_WATER.tooltip.3= Não - água padrão + +of.options.RANDOM_ENTITIES=Ent. aleatórias +of.options.RANDOM_ENTITIES.tooltip.1=Entidades aleatórias +of.options.RANDOM_ENTITIES.tooltip.2= Não - sem entidades aleatórias, rápido +of.options.RANDOM_ENTITIES.tooltip.3= Sim - entidades aleatórias, lento +of.options.RANDOM_ENTITIES.tooltip.4=As entidades aleatórias usa texturas aleatorizadas +of.options.RANDOM_ENTITIES.tooltip.5=para as entidades do jogo. Precisa de um pacote +of.options.RANDOM_ENTITIES.tooltip.5=de recursos que possua várias texturas das entidades. + +of.options.BETTER_GRASS=Relva formosa +of.options.BETTER_GRASS.tooltip.1=Relva formosa +of.options.BETTER_GRASS.tooltip.2= Não - textura lateral padrão da relva, rápido +of.options.BETTER_GRASS.tooltip.3= Rápida - textura lateral coberta da relva,, lento +of.options.BETTER_GRASS.tooltip.4= Elegante - textura lateral elegante da relva, muito lento + +of.options.BETTER_SNOW=Neve formosa +of.options.BETTER_SNOW.tooltip.1=Neve formosa +of.options.BETTER_SNOW.tooltip.2= Não - neve padrão, rápido +of.options.BETTER_SNOW.tooltip.3= Sim - neve formosa, lento +of.options.BETTER_SNOW.tooltip.4=Dispõe a neve por baixo de blocos transparentes (cercas, relvas) +of.options.BETTER_SNOW.tooltip.5=quando estes estão na borda de um bloco. + +of.options.CUSTOM_FONTS=Tipos de letra per. +of.options.CUSTOM_FONTS.tooltip.1=Tipos de letra personalizados +of.options.CUSTOM_FONTS.tooltip.2= Sim - usar tipos de letra personalizados (padrão), lento +of.options.CUSTOM_FONTS.tooltip.3= Não - usar o tipo de letra predefenido, rápido +of.options.CUSTOM_FONTS.tooltip.4=Os tipos de letra personalizados são suportadas pelo +of.options.CUSTOM_FONTS.tooltip.5=pacote de recursos atual. + +of.options.CUSTOM_COLORS=Cores personal. +of.options.CUSTOM_COLORS.tooltip.1=Cores personalizadas +of.options.CUSTOM_COLORS.tooltip.2= Sim - usar cores personalizadas (padrão), lento +of.options.CUSTOM_COLORS.tooltip.3= Não - cores predefinidas, rápido +of.options.CUSTOM_COLORS.tooltip.4=As cores personalizadas são suportadas pelo +of.options.CUSTOM_COLORS.tooltip.5=pacote de recursos atual. + +of.options.SWAMP_COLORS=Cores do pântano +of.options.SWAMP_COLORS.tooltip.1=Cores do pântano +of.options.SWAMP_COLORS.tooltip.2= Sim - usar cores do pântano (padrão), lento +of.options.SWAMP_COLORS.tooltip.3= Não - não usar cores do pântano, rápido +of.options.SWAMP_COLORS.tooltip.4=As cores do pântano afetam a relva, as folhas, as +of.options.SWAMP_COLORS.tooltip.4=trepadeiras e a água. + +of.options.SMOOTH_BIOMES=Biomas integrados +of.options.SMOOTH_BIOMES.tooltip.1=Biomas integrados +of.options.SMOOTH_BIOMES.tooltip.2= Sim - intergração das bordas dos biomas (padrão), lento +of.options.SMOOTH_BIOMES.tooltip.3= Não - distinguir as bordas dos biomas, rápido +of.options.SMOOTH_BIOMES.tooltip.4=A integração na borda dos biomas é feita pela média +of.options.SMOOTH_BIOMES.tooltip.5=de matizes de todos os blocos ao redor. +of.options.SMOOTH_BIOMES.tooltip.6=Afeta a relva, folhas, trepadeiras e água. + +of.options.CONNECTED_TEXTURES=Tex. interli. +of.options.CONNECTED_TEXTURES.tooltip.1=Texturas interligadas +of.options.CONNECTED_TEXTURES.tooltip.2= Não - sem texturas interligadas (padrão) +of.options.CONNECTED_TEXTURES.tooltip.3= Rápidas - texturas interligadas rápidas +of.options.CONNECTED_TEXTURES.tooltip.4= Elegantes - texturas interligadas elegantes +of.options.CONNECTED_TEXTURES.tooltip.5=As texturas interligadas unem as texturas do vidro, +of.options.CONNECTED_TEXTURES.tooltip.6=arenito e das estantes quando colocadas ao lado +of.options.CONNECTED_TEXTURES.tooltip.7=umas das outras. As texturas interligadas são +of.options.CONNECTED_TEXTURES.tooltip.8=suportadas pelo pacote de recursos atual. + +of.options.NATURAL_TEXTURES=Tex. naturais +of.options.NATURAL_TEXTURES.tooltip.1=Texturas naturais +of.options.NATURAL_TEXTURES.tooltip.2= Não - sem texturas naturais (padrão) +of.options.NATURAL_TEXTURES.tooltip.3= Sim - usar texturas naturais +of.options.NATURAL_TEXTURES.tooltip.4=As texturas naturais removem o padrão "em grelha" +of.options.NATURAL_TEXTURES.tooltip.5=criado pela repetição do mesmo tipo de bloco. +of.options.NATURAL_TEXTURES.tooltip.6=Roda e inverte os blocos para criar variantes da +of.options.NATURAL_TEXTURES.tooltip.7=textura base do bloco. As texturas naturais são +of.options.NATURAL_TEXTURES.tooltip.8=suportadas pelo pacote de recursos atual. + +of.options.EMISSIVE_TEXTURES=Tex. emissivas +of.options.EMISSIVE_TEXTURES.tooltip.1=Texturas emissivas +of.options.EMISSIVE_TEXTURES.tooltip.2= Não - não usar texturas emissivas (padrão) +of.options.EMISSIVE_TEXTURES.tooltip.3= Sim - usar texturas emissivass +of.options.EMISSIVE_TEXTURES.tooltip.4=As texturas emissivas são renderizadas como uma +of.options.EMISSIVE_TEXTURES.tooltip.5=película com o brilho máximo. Podem ser usadas para +of.options.EMISSIVE_TEXTURES.tooltip.6=simular partes que emitem luz de uma textura base. +of.options.EMISSIVE_TEXTURES.tooltip.7=As texturas emissivas são suportadas pelo pacote de +of.options.EMISSIVE_TEXTURES.tooltip.8=recursos atual. + +of.options.CUSTOM_SKY=Céu personal. +of.options.CUSTOM_SKY.tooltip.1=Céu personalizado +of.options.CUSTOM_SKY.tooltip.2= Sim - texturas personalizadas do céu (padrão), lento +of.options.CUSTOM_SKY.tooltip.3= Não - céu padrão, rápido +of.options.CUSTOM_SKY.tooltip.4=As texturas padrão do céu são suportadas pelo pacote de +of.options.CUSTOM_SKY.tooltip.5=recursos atual. + +of.options.CUSTOM_ITEMS=Itens personal. +of.options.CUSTOM_ITEMS.tooltip.1=Itens personalizados +of.options.CUSTOM_ITEMS.tooltip.2= Sim - texturas personalizadas dos itens (padrão), lento +of.options.CUSTOM_ITEMS.tooltip.3= Não - texturas padrão dos itens, rápido +of.options.CUSTOM_ITEMS.tooltip.4=As texturas personalizadas dos itens são suportadas pelo +of.options.CUSTOM_ITEMS.tooltip.5=pacote de recursos atual. + +of.options.CUSTOM_ENTITY_MODELS=Mod. personal. das enti. +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modelos personalizados das entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Sim - modelos personalizados das entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.3=(padrão), lento +of.options.CUSTOM_ENTITY_MODELS.tooltip.4= Não - modelos padrões das entidades, rápido +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=Os modelos personalizados das entidades são +of.options.CUSTOM_ENTITY_MODELS.tooltip.6=suportados pelo pacote de recursos atual. + +of.options.CUSTOM_GUIS=Interf. personal. +of.options.CUSTOM_GUIS.tooltip.1=Interfaces personalizadas +of.options.CUSTOM_GUIS.tooltip.2= Sim - interfaces personalizadas (padrão), lento +of.options.CUSTOM_GUIS.tooltip.3= Não - interface padrão, rápido +of.options.CUSTOM_GUIS.tooltip.4=As interfaces personalizadas são suportadas pelo pacote +of.options.CUSTOM_GUIS.tooltip.5=de recursos atual. + +# Details + +of.options.CLOUDS=Nuvens +of.options.CLOUDS.tooltip.1=Nuvens +of.options.CLOUDS.tooltip.2= Padrão - de acordo com a definição: "Gráficos" +of.options.CLOUDS.tooltip.3= Rápidas - pouca qualidade, rápido +of.options.CLOUDS.tooltip.4= Elegantes - alta qualidade, lento +of.options.CLOUDS.tooltip.5= Não - sem nuvens, muito rápido +of.options.CLOUDS.tooltip.6=Nuvens rápidas são renderizadas em 2D. +of.options.CLOUDS.tooltip.7=Nuvens elegantes são renderizadas em 3D. + +of.options.CLOUD_HEIGHT=Altura das nuvens +of.options.CLOUD_HEIGHT.tooltip.1=Altura das nuvens +of.options.CLOUD_HEIGHT.tooltip.2= Não - altura padrão +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - acima do limite do mundo + +of.options.TREES=Árvores +of.options.TREES.tooltip.1=Árvores +of.options.TREES.tooltip.2= Padrão - de acordo com a definição: "Gráficos" +of.options.TREES.tooltip.3= Rápidas - menos qualidade, muito rápido +of.options.TREES.tooltip.4= Garridas - alta qualidade, rápido +of.options.TREES.tooltip.5= Elegantes - melhor qualidade, lento +of.options.TREES.tooltip.6=As árvores rápidas possuem as folhas opacas. +of.options.TREES.tooltip.7=As garridas e elegantes possuem as folhas transparentes. + +of.options.RAIN=Chuva e neve +of.options.RAIN.tooltip.1=Chuva e neve +of.options.RAIN.tooltip.2= Padrão - de acordo com a definição: "Gráficos" +of.options.RAIN.tooltip.3= Rápida - chuva/neve suave rápido +of.options.RAIN.tooltip.4= Elegantes - chuva/neve pesada, lento +of.options.RAIN.tooltip.5= Não - sem chuva/neve, muito rápido +of.options.RAIN.tooltip.6=Quando a chuva está desativada, os pingos e o barulho +of.options.RAIN.tooltip.7=continuam ativos. + +of.options.SKY=Céu +of.options.SKY.tooltip.1=Céu +of.options.SKY.tooltip.2= Sim - o céu é visível, lento +of.options.SKY.tooltip.3= Não - o céu não é visível, rápido +of.options.SKY.tooltip.4=Quando o céu está desativado, a lua e o sol continuam visíveis. + +of.options.STARS=Estrelas +of.options.STARS.tooltip.1=Estrelas +of.options.STARS.tooltip.2= Sim - as estrelas são visíveis, lento +of.options.STARS.tooltip.3= Não - as estrelas não são visíveis, rápido + +of.options.SUN_MOON=Sol e lua +of.options.SUN_MOON.tooltip.1=Sol e lua +of.options.SUN_MOON.tooltip.2= Sim - o sol e a lua são visíveis (padrão) +of.options.SUN_MOON.tooltip.3= Não - o sol e a lua não são visíveis (rápido) + +of.options.SHOW_CAPES=Mostrar as capas +of.options.SHOW_CAPES.tooltip.1=Mostrar as capas +of.options.SHOW_CAPES.tooltip.2= Sim - mostrar as capas dos jogadores (padrão) +of.options.SHOW_CAPES.tooltip.3= Não - não mostrar as capas dos jogadores + +of.options.TRANSLUCENT_BLOCKS=Blocos translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocos translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Padrão - definido pelos gráficos +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Elegantes - incorporação de cores correto (lento) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Rápidos - incorporação de cores rápido (rápido) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Controla a incorporação das cores dos blocos +of.options.TRANSLUCENT_BLOCKS.tooltip.6=translúcidos com várias cores (vidro tingido, água, gelo) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=quando colocados atrás uns dos outros com ar entre eles. + +of.options.HELD_ITEM_TOOLTIPS=Desc. do item em mão +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Descrição do item em mão +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Sim - dispor a descrição do item em mão (padrão) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Não - não dispor a descrição dos itens em mãos + +of.options.ADVANCED_TOOLTIPS=Desc. avançadas +of.options.ADVANCED_TOOLTIPS.tooltip.1=Descrições avançadas +of.options.ADVANCED_TOOLTIPS.tooltip.2= Sim - dispor as descrições avançadas +of.options.ADVANCED_TOOLTIPS.tooltip.3= Não - não dispor as descrições avançadas (padrão) +of.options.ADVANCED_TOOLTIPS.tooltip.4=As descrições avançadas dispõem informaçãoa adicional +of.options.ADVANCED_TOOLTIPS.tooltip.5=para os itens (id, durabilidade) e para as opções das +of.options.ADVANCED_TOOLTIPS.tooltip.6=shaders (id, origem, valor padrão). + +of.options.DROPPED_ITEMS=Itens no chão +of.options.DROPPED_ITEMS.tooltip.1=Itens no chão +of.options.DROPPED_ITEMS.tooltip.2= Padrão - definido pelos gráficos +of.options.DROPPED_ITEMS.tooltip.3= Rápidos - itens 2D (rápido) +of.options.DROPPED_ITEMS.tooltip.4= Elegantes - itens 3D (lento) + +options.entityShadows.tooltip.1=Sombras das ent. +options.entityShadows.tooltip.2= Sim - mostrar as sombras das entidades +options.entityShadows.tooltip.3= Não - não mostrar as sombras das entidades + +of.options.VIGNETTE=Vinheta +of.options.VIGNETTE.tooltip.1=Efeito visual que escurece ligeiramente os cantos do ecrã +of.options.VIGNETTE.tooltip.2= Padrão - definido pelos gráficos (padrão) +of.options.VIGNETTE.tooltip.3= Rápido - vinheta desativada (rápido) +of.options.VIGNETTE.tooltip.4= Elegante - vinheta ativada (lento) +of.options.VIGNETTE.tooltip.5=A vinheta pode ter um efeito significante nos FPS, +of.options.VIGNETTE.tooltip.6=especialmente se estiveres a jogar em ecrã inteiro. +of.options.VIGNETTE.tooltip.7=O efeito na vinheta é muito subtil e pode ser desativada +of.options.VIGNETTE.tooltip.8=sem nenhum problema. + +of.options.DYNAMIC_FOV=Campo de visão din. +of.options.DYNAMIC_FOV.tooltip.1=Campo de visão dinâmico +of.options.DYNAMIC_FOV.tooltip.2= Sim - ativar campo de visão dinâmico (padrão) +of.options.DYNAMIC_FOV.tooltip.3= Não - desativar campo de visão dinâmico +of.options.DYNAMIC_FOV.tooltip.4=Altera a área de visão enquanto voas, corres +of.options.DYNAMIC_FOV.tooltip.5=ou estás prestes a disparar uma flecha. + +of.options.DYNAMIC_LIGHTS=Luzes dinâmicas +of.options.DYNAMIC_LIGHTS.tooltip.1=Luzes dinâmicas +of.options.DYNAMIC_LIGHTS.tooltip.2= Não - sem luzes dinâmicas (padrão) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rápidas - luzes dinâmicas rápidas (atualizam a cada 500m) +of.options.DYNAMIC_LIGHTS.tooltip.4= Elegantes - luzes dinâmicas elegantes (atualizam em tempo real) +of.options.DYNAMIC_LIGHTS.tooltip.5=Permite que os itens emissores de luz (tochas, pedra luminosa, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=iluminem tudo ao seu redor quando são segurados pelo jogador, +of.options.DYNAMIC_LIGHTS.tooltip.7=por outro jogador, ou mesmo quando atirados para o chão. + +# Performance + +of.options.SMOOTH_FPS=FPS fluídos +of.options.SMOOTH_FPS.tooltip.1=Estabiliza os FPS com uma descarga dos buffers da placa gráfica. +of.options.SMOOTH_FPS.tooltip.2= Não - sem estabilização dos FPS, os FPS podem flutuar +of.options.SMOOTH_FPS.tooltip.3= Sim - estabilização dos FPS +of.options.SMOOTH_FPS.tooltip.4=Esta opção é dependente da placa gráfica e os seus efeitos +of.options.SMOOTH_FPS.tooltip.5=nem sempre são visíveis. + +of.options.SMOOTH_WORLD=Mundo fluído +of.options.SMOOTH_WORLD.tooltip.1=Remove os "espinhos de lag" causados pelo servidor interno. +of.options.SMOOTH_WORLD.tooltip.2= Não - sem estabilização, os FPS podem flutuar +of.options.SMOOTH_WORLD.tooltip.3= Sim - estabilização dos FPS +of.options.SMOOTH_WORLD.tooltip.4=Estabiliza os FPS distribuindo o carregamento interno do servidor. +of.options.SMOOTH_WORLD.tooltip.5=Só é eficaz em mundos locais (um jogador). + +of.options.FAST_RENDER=Carreg. ráp. de chunks +of.options.FAST_RENDER.tooltip.1=Carregamento rápido de chunks +of.options.FAST_RENDER.tooltip.2= Não - carregamento estandarte (padrão) +of.options.FAST_RENDER.tooltip.3= Sim - carregamento melhorado (rápido) +of.options.FAST_RENDER.tooltip.4=Usa um algoritmo de carregamento otimizado que diminui +of.options.FAST_RENDER.tooltip.5=a carga do GPU e pode aumentar substancialmente os FPS. +of.options.FAST_RENDER.tooltip.6=Esta opção pode entrar em conflito com alguns mods. + +of.options.FAST_MATH=Matemá. rápida +of.options.FAST_MATH.tooltip.1=Matemática rápida +of.options.FAST_MATH.tooltip.2= Não - matemática estandarte (padrão) +of.options.FAST_MATH.tooltip.3= Sim - matemática rápida +of.options.FAST_MATH.tooltip.4=Melhora as funções do sin() e do cos() que melhoram +of.options.FAST_MATH.tooltip.5=a utilização do cache do CPU e aumentam os FPS. +of.options.FAST_MATH.tooltip.6=Esta opção tem um efeito mínimo na geração do mundo. + +of.options.CHUNK_UPDATES=Atual. dos chunks +of.options.CHUNK_UPDATES.tooltip.1=Atualização dos chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - carregamento lento do mundo, mais FPS (padrão) +of.options.CHUNK_UPDATES.tooltip.3= 3 - carregamento rápido do mundo, menos FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - carregamento insano do mundo, muito menos FPS +of.options.CHUNK_UPDATES.tooltip.5=Número de chunks atualizados por cada FPS carregado. +of.options.CHUNK_UPDATES.tooltip.6=Quanto mais alto o valor, maior a possiblidade de destabilização +of.options.CHUNK_UPDATES.tooltip.7=da taxa de FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Atual. dinâmicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Atualizações dinâmicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Não - atuatização estandarte dos chunks por FPS (padrão) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Sim - mais atualizações enquanto o jogador está imóvel +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=As atualizações dinâmicas forçam o carregamento de chunks +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=enquanto o jogador está imóvel para carregar o mundo +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=mais rapidamente. + +of.options.LAZY_CHUNK_LOADING=Carreg. lento dos chunks +of.options.LAZY_CHUNK_LOADING.tooltip.1=Carregamento lento dos chunks +of.options.LAZY_CHUNK_LOADING.tooltip.2= Não - carregamento padrão dos chunks do servidor +of.options.LAZY_CHUNK_LOADING.tooltip.3= Sim - carregamento lento dos chunks do servidor (mais fluído) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Otimiza o carregamento de chunks integrados no servidor, +of.options.LAZY_CHUNK_LOADING.tooltip.5=distribuindo-os por vários tiques. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Desliga esta opção se o mundo não estiver a carregar corretamente. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Só é eficaz em mundos locais (um jogador). + +of.options.RENDER_REGIONS=Carreg. de regiões +of.options.RENDER_REGIONS.tooltip.1=Carregamento de regiões +of.options.RENDER_REGIONS.tooltip.2= Não - não usar o carregamento de regiões (padrão) +of.options.RENDER_REGIONS.tooltip.3= Sim - usar o carregamento de regiões +of.options.RENDER_REGIONS.tooltip.4=O carregamento de regiões permite um carregamento mais rápido do terreno +of.options.RENDER_REGIONS.tooltip.5=a distâncias de carregamento maiores. Maior eficácia quando os VBOS +of.options.RENDER_REGIONS.tooltip.6=estão ativos. Não é recomendável para placas gráficas integradas. + +of.options.SMART_ANIMATIONS=Anim. inteligentes +of.options.SMART_ANIMATIONS.tooltip.1=Animações inteligentes +of.options.SMART_ANIMATIONS.tooltip.2= Não - não usar animações inteligentes (padrão) +of.options.SMART_ANIMATIONS.tooltip.3= Sim - usar animações inteligentes +of.options.SMART_ANIMATIONS.tooltip.4=Com as animações inteligentes, o jogo só irá animar +of.options.SMART_ANIMATIONS.tooltip.5=as texturas que estão atualmente visíveis no ecrã. +of.options.SMART_ANIMATIONS.tooltip.6=Isto reduzirá os "espinhos de lag" e aumentará os FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Útil para modpacks em grande escala e pacotes de recursos +of.options.SMART_ANIMATIONS.tooltip.8=de alta definição. + +# Animations + +of.options.animation.allOn=Todas ligadas +of.options.animation.allOff=Todas desligadas +of.options.animation.dynamic=Dinâmico + +of.options.ANIMATED_WATER=Animação da água +of.options.ANIMATED_LAVA=Animação da lava +of.options.ANIMATED_FIRE=Animação do fogo +of.options.ANIMATED_PORTAL=Animação dos portais +of.options.ANIMATED_REDSTONE=Animação de redstone +of.options.ANIMATED_EXPLOSION=Animação de explosões +of.options.ANIMATED_FLAME=Animação de chamas +of.options.ANIMATED_SMOKE=Animação de fumo +of.options.VOID_PARTICLES=Partículas do vazio +of.options.WATER_PARTICLES=Partículas da água +of.options.RAIN_SPLASH=Salpicos da chuva +of.options.PORTAL_PARTICLES=Partículas dos portais +of.options.POTION_PARTICLES=Partículas das poções +of.options.DRIPPING_WATER_LAVA=Correntes de água/lava +of.options.ANIMATED_TERRAIN=Animação do terreno +of.options.ANIMATED_TEXTURES=Animação de texturas +of.options.FIREWORK_PARTICLES=Partí. de fogos de artif. + +# Other + +of.options.LAGOMETER=Lagómetro +of.options.LAGOMETER.tooltip.1=Dispõe o lagómetro no ecrã de depuração (F3). +of.options.LAGOMETER.tooltip.2=* Laranja - Colecionador da "memória entulhada" +of.options.LAGOMETER.tooltip.3=* Ciano - Tiques +of.options.LAGOMETER.tooltip.4=* Azul - Executáveis agendados +of.options.LAGOMETER.tooltip.5=* Roxo - Envio de chunks +of.options.LAGOMETER.tooltip.6=* Vermelho - Chunks atualizados +of.options.LAGOMETER.tooltip.7=* Amarelo - Verificação de visibilidade +of.options.LAGOMETER.tooltip.8=* Verde - Terreno carregado + +of.options.PROFILER=Depur. do perfil +of.options.PROFILER.tooltip.1=Depuração do perfil +of.options.PROFILER.tooltip.2= Sim - a depuração do perfil está ativa, lento +of.options.PROFILER.tooltip.3= Não - a depuração do perfil não está ativa, rápido +of.options.PROFILER.tooltip.4=A depuração do perfil recolhe e dispõe informação da +of.options.PROFILER.tooltip.5=depuração quando quando o ecrã de depuração está visível (F3). + +of.options.WEATHER=Clima +of.options.WEATHER.tooltip.1=Clima +of.options.WEATHER.tooltip.2= Sim - o clima está ativo, lento +of.options.WEATHER.tooltip.3= Não - o clima não está ativo, rápido +of.options.WEATHER.tooltip.4=O clima controla a chuva, a neve e as tempestades. +of.options.WEATHER.tooltip.5=O controlo do clima só é possível em mundos locais. + +of.options.time.dayOnly=Sempre de dia +of.options.time.nightOnly=Sempre de noite + +of.options.TIME=Tempo +of.options.TIME.tooltip.1=Tempo +of.options.TIME.tooltip.2= Padrão - ciclos diurnos/noturnos normais +of.options.TIME.tooltip.3= Dia - sempre de dia +of.options.TIME.tooltip.4= Noite - sempre de noite +of.options.TIME.tooltip.5=Esta definição só é eficaz no modo criativo +of.options.TIME.tooltip.6=e em mundos locais. + +options.fullscreen.tooltip.1=Ecrã inteiro +options.fullscreen.tooltip.2= Sim - usar o modo de ecrã inteiro +options.fullscreen.tooltip.3= Não - usar o modo de janela +options.fullscreen.tooltip.4=Dependendo da placa gráfica, o modo de ecrã inteiro pode +options.fullscreen.tooltip.5=ser mais rápido ou mais lento que o modo de janela. + +of.options.FULLSCREEN_MODE=Modo de ecrã int. +of.options.FULLSCREEN_MODE.tooltip.1=Modo de ecrã inteiro +of.options.FULLSCREEN_MODE.tooltip.2= Padrão - usa a resolução de ecrã do computador, lento +of.options.FULLSCREEN_MODE.tooltip.3= WxH - usa uma resolução de ecrã personalizada, +of.options.FULLSCREEN_MODE.tooltip.4=pode ser mais rápido +of.options.FULLSCREEN_MODE.tooltip.5=A resolução selecionada é usada no modo de ecrã inteiro (F11). +of.options.FULLSCREEN_MODE.tooltip.6=Resoluções baixas tendem a ser mais rápidas. + +of.options.SHOW_FPS=Exibir os FPS +of.options.SHOW_FPS.tooltip.1=Dispõe, compactadamente, os FPS e a informação de carregamento. +of.options.SHOW_FPS.tooltip.2= Fps - aproximados/mínimos +of.options.SHOW_FPS.tooltip.3= C: - chunks carregados +of.options.SHOW_FPS.tooltip.4= E: - entidades carregadas + entidades dos blocos +of.options.SHOW_FPS.tooltip.5= U: - atualização dos chunks +of.options.SHOW_FPS.tooltip.6=A informação compacta só é mostrada quando o +of.options.SHOW_FPS.tooltip.7=ecrã de depuração não está visível. + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3min +of.options.save.6min=6min +of.options.save.12min=12min +of.options.save.24min=24min + +of.options.AUTOSAVE_TICKS=Gravação automática +of.options.AUTOSAVE_TICKS.tooltip.1=Intervalo entre cada gravação +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - padrão +of.options.AUTOSAVE_TICKS.tooltip.3=Dependendo da distância de visão, a gravação automática +of.options.AUTOSAVE_TICKS.tooltip.4=pode gerar "espinhos de lag". +of.options.AUTOSAVE_TICKS.tooltip.5=O mundo também é guardado quando o menu do jogo é aberto. + +of.options.SCREENSHOT_SIZE=Tam. da capt. de ecrã +of.options.SCREENSHOT_SIZE.tooltip.1=Tamanho da captura de ecrã +of.options.SCREENSHOT_SIZE.tooltip.2= padrão - tamanho padrão +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - tamanho personalizado +of.options.SCREENSHOT_SIZE.tooltip.4=Capturas de ecrã maiores podem precisar de mais memória. +of.options.SCREENSHOT_SIZE.tooltip.5=Não é compatível com carregamento de chunks rápido e o +of.options.SCREENSHOT_SIZE.tooltip.6=antiserrilhamento. +of.options.SCREENSHOT_SIZE.tooltip.7=Requer um suporte do buffer da taxa de FPS do GPU. + +of.options.SHOW_GL_ERRORS=Exibir erros da GL +of.options.SHOW_GL_ERRORS.tooltip.1=Exibir os erros GL +of.options.SHOW_GL_ERRORS.tooltip.2=Quando ativado, os erros do OpenGL são exibidos no chat. +of.options.SHOW_GL_ERRORS.tooltip.3=Apenas desativa se existir um conflito conhecido e esse +of.options.SHOW_GL_ERRORS.tooltip.4=erro não puder ser corrigido. +of.options.SHOW_GL_ERRORS.tooltip.5=Quando desativado, os erros são registados no log +of.options.SHOW_GL_ERRORS.tooltip.6=de erros e podem causar na mesma uma queda significante de FPS. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Fundo do chat +of.options.CHAT_BACKGROUND.tooltip.1=Fundo do chat +of.options.CHAT_BACKGROUND.tooltip.2= Padrão - largura igualada +of.options.CHAT_BACKGROUND.tooltip.3= Compacta - corresponde com a largura da linha +of.options.CHAT_BACKGROUND.tooltip.4= Não - escondido + +of.options.CHAT_SHADOW=Sombras do chat +of.options.CHAT_SHADOW.tooltip.1=Sombras do chat +of.options.CHAT_SHADOW.tooltip.2= Ligado - usar sombras no texto +of.options.CHAT_SHADOW.tooltip.3= Desligado - não usar sombras no texto diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ro_RO.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ro_RO.lang new file mode 100644 index 0000000..6f688e2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ro_RO.lang @@ -0,0 +1,693 @@ +#Tradus in romana de nicuch + +# General +of.general.ambiguous=ambiguu +of.general.custom=Personalizat +of.general.from=Din +of.general.id=Id +of.general.restart=restart +of.general.smart=Destept + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Anti-aliasing nu este compatibil cu Shader. +of.message.aa.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.af.shaders1=Filtrul Anisotropic nu este compatibil cu Shader. +of.message.af.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.fr.shaders1=Redarea Rapida nu este compatibila cu Shader. +of.message.fr.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.an.shaders1=Viziunea 3D nu este compatibila cu Shader. +of.message.an.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.shaders.aa1=Shaderul nu este compatibil cu Anti-aliasing. +of.message.shaders.aa2=Seteaza Calitate -> Anti-aliasing pe OPRIT si restarteaza jocul. + +of.message.shaders.af1=Shaderul nu este compatibil cu Filtrul Anisotropic. +of.message.shaders.af2=Seteaza Calitate -> Filtrul Anisotropic pe OPRIT. + +of.message.shaders.fr1=Shaderul nu este compatibil cu Redarea Rapida. +of.message.shaders.fr2=Seteaza Performanta -> Redare Rapida pe OPRIT. + +of.message.shaders.an1=Shaderul nu este compatibil cu Viziunea 3D. +of.message.shaders.an2=Seteaza Altele -> Viziune 3D pe OPRIT. + +of.message.shaders.nv1=Acest shader necesita o noua versiune a Optifine-ului, versiunea: %s +of.message.shaders.nv2=Esti sigur(a) ca doresti sa continui? + +of.message.newVersion=O versiune noua de §eOptiFine§f este valabila: §e%s§f +of.message.java64Bit=Poti instala versiunea de §e64-bit Java§f pentru a creste performanta. +of.message.openglError=§eEroare OpenGL§f: %s (%s) + +of.message.shaders.loading=Shaderul se incarca: %s + +of.message.other.reset=Resetezi toate setarile video in valorile implicite? + +of.message.loadingVisibleChunks=Incarca chunk-urile vizibile + +# Video settings + +options.graphics.tooltip.1=Calitate vizuala +options.graphics.tooltip.2= Rapid - calitate mica, rapid +options.graphics.tooltip.3= Atractiv - calitate mare, lent +options.graphics.tooltip.4=Schimba aspectul norilor, frunzelor, apei, +options.graphics.tooltip.5=umbrelor si fetele ierbii. + +of.options.renderDistance.tiny=Mic +of.options.renderDistance.short=Scurt +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Departe +of.options.renderDistance.extreme=Extrem +of.options.renderDistance.insane=Nebun +of.options.renderDistance.ludicrous=Ridicol + +options.renderDistance.tooltip.1=Distanta vizibila +options.renderDistance.tooltip.2= 2 Mic - 32m (rapid) +options.renderDistance.tooltip.3= 4 Scurt - 64m (rapid) +options.renderDistance.tooltip.4= 8 Normal - 128m +options.renderDistance.tooltip.5= 16 Departe - 256m (lent) +options.renderDistance.tooltip.6= 32 Extrem - 512m (foarte lent!) +options.renderDistance.tooltip.7=Vederea la distanta Extrem este foarte solicitant pentru resurse! +options.renderDistance.tooltip.8=Valorile peste 16 Departe are efect doar intr-o lume locala. + +options.ao.tooltip.1=Lumina neteda +options.ao.tooltip.2= OPRIT - fara lumina neteda (rapid) +options.ao.tooltip.3= Minim - lumina neteda simpla (lent) +options.ao.tooltip.4= Maxim - lumina neteda complexa (foarte lent) + +options.framerateLimit.tooltip.1=Rata de cadre maxima +options.framerateLimit.tooltip.2= VSync - limiteaza rata de cadre a monitorului (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variabile +options.framerateLimit.tooltip.4= Nelimitat - fara limita (foarte rapid) +options.framerateLimit.tooltip.5=Limita de cadre scade chiar daca +options.framerateLimit.tooltip.6=valoarea limitei nu este atinsa. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Nivel de lumina neteda +of.options.AO_LEVEL.tooltip.1=Nivel de lumina neteda +of.options.AO_LEVEL.tooltip.2= OPRIT - fara umbre +of.options.AO_LEVEL.tooltip.3= 50%% - umbre deschise +of.options.AO_LEVEL.tooltip.4= 100%% - umbre inchise + +options.viewBobbing.tooltip.1=Miscare mai realista. +options.viewBobbing.tooltip.2=Cand utilizati mip-maps, setati-l pe OPRIT pentru rezultate optime. + +options.guiScale.tooltip.1=Dimensiune GUI +options.guiScale.tooltip.2= Automat - marime maxima +options.guiScale.tooltip.3= Mic, Normal, Larg - 1x la 3x +options.guiScale.tooltip.4= 4x la 10x - valabil pe ecranele 4K +options.guiScale.tooltip.5=Valorile impare (1x, 3x, 5x ...) nu sunt compatibile cu Unicode. +options.guiScale.tooltip.6=Un GUI mic poate fi mai rapid. + +options.vbo=Folosește VBO-uri +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Foloseste un model de render alternativ care de obicei +options.vbo.tooltip.3=este mai rapid (5-10%%) fata de renderul implicit. + +options.gamma.tooltip.1=Schimba luminozitatea obiectelor negre. +options.gamma.tooltip.2= Intunecos - luminozitate standard +options.gamma.tooltip.3= 1-99%% - variabile +options.gamma.tooltip.4= Luminos - luminozitate maxima pentru obiecte negre. +options.gamma.tooltip.5=Aceasta optiune nu schimba luminozitatea +options.gamma.tooltip.6=obiectelor total negre. + +options.anaglyph.tooltip.1=Viziune 3D +options.anaglyph.tooltip.2=Activeaza un efect stereoscopic 3D folosind culori diferite +options.anaglyph.tooltip.3=pentru fiecare ochi. +options.anaglyph.tooltip.4=Necesita ochelari cu lentile rosu-cyan pentru vizualizarea adecvata. + +of.options.ALTERNATE_BLOCKS=Blocuri Alternative +of.options.ALTERNATE_BLOCKS.tooltip.1=Blocuri Alternative +of.options.ALTERNATE_BLOCKS.tooltip.2=Foloseste modele alternative (succesive) pentru unele blocuri. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depinde de pachetul de resurse selectat. + +of.options.FOG_FANCY=Ceata +of.options.FOG_FANCY.tooltip.1=Tip de ceata +of.options.FOG_FANCY.tooltip.2= Rapid - ceata rara +of.options.FOG_FANCY.tooltip.3= Atractiv - ceata deasa, arata mai bine +of.options.FOG_FANCY.tooltip.4= OPRIT - fara ceata, rapid +of.options.FOG_FANCY.tooltip.5=Ceata eleganta este valabila doar pentru +of.options.FOG_FANCY.tooltip.6=placa grafica care suporta. + +of.options.FOG_START=Pornire ceata +of.options.FOG_START.tooltip.1=Pornire ceata +of.options.FOG_START.tooltip.2= 0.2 - ceata incepe aproape fata de jucator +of.options.FOG_START.tooltip.3= 0.8 - ceata incepe departe fata de jucator +of.options.FOG_START.tooltip.4=Aceasta optiune nu afecteaza de obicei performanta. + +of.options.CHUNK_LOADING=Incarcare Chunk-uri +of.options.CHUNK_LOADING.tooltip.1=Incarcare Chunk-uri +of.options.CHUNK_LOADING.tooltip.2= Implicit - FPS instabil cand chunk-urile sunt incarcate +of.options.CHUNK_LOADING.tooltip.3= Neted - FPS stabil +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - FPS stabil, de 3 ori mai rapida incarcarea chunk-urilor +of.options.CHUNK_LOADING.tooltip.5=Neted si Multi-Core elimina impiedicarea si +of.options.CHUNK_LOADING.tooltip.6=inghetarea cauzata de incarcarea chunk-urilor. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core poate accelera incarcarea lumii de 3 ori +of.options.CHUNK_LOADING.tooltip.8=crescand FPS utilizand un al 2-lea necleu al CPU-ului. +of.options.chunkLoading.smooth=Neted +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shadere... +of.options.shadersTitle=Shadere + +of.options.shaders.packNone=OPRIT +of.options.shaders.packDefault=(internal) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= OPRIT - (implcit) cu margini defecte (rapid) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - fara linii si margini defecte (lent) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA este un efect de re-procesare care netezeste +of.options.shaders.ANTIALIASING.tooltip.5=liniile defecte (crestate) si imbunatateste tranzitia de culoare. +of.options.shaders.ANTIALIASING.tooltip.6=Este mai rapid decat antialiasing +of.options.shaders.ANTIALIASING.tooltip.7=si este compatibil cu shader-ul si Renarea Rapida. + +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.1=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.2= ACTIV - (implicit) activeaza normal map +of.options.shaders.NORMAL_MAP.tooltip.3= OPRIT - dezactiveaza normal map +of.options.shaders.NORMAL_MAP.tooltip.4=Normal map poate fi folsit de un shader +of.options.shaders.NORMAL_MAP.tooltip.5=pentru a simula modele 3D pe suprafate plate. +of.options.shaders.NORMAL_MAP.tooltip.6=Texturile sunt furnizate de +of.options.shaders.NORMAL_MAP.tooltip.7=pachetul de resurse curent. + +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.1=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.2= ACTIV - (implicit) activeaza specular map +of.options.shaders.SPECULAR_MAP.tooltip.3= OPRIT - dezactiveaza specular map +of.options.shaders.SPECULAR_MAP.tooltip.4=Specular map poate fi folsit de un shader +of.options.shaders.SPECULAR_MAP.tooltip.5=pentru a simula efecte de reflectie. +of.options.shaders.SPECULAR_MAP.tooltip.6=Texturile sunt furnizate de +of.options.shaders.SPECULAR_MAP.tooltip.7=pachetul de resurse curent. + +of.options.shaders.RENDER_RES_MUL=Calitate Render +of.options.shaders.RENDER_RES_MUL.tooltip.1=Calitate Render +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - mic (rapid) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (implicit) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - mare (lent) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Calitatea render controleaza marimea texturii +of.options.shaders.RENDER_RES_MUL.tooltip.6=pe care shader-ul o randeaza. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Valorile mici pot fi folositoare pentru monitoarele 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Valorile mari functioneaza ca un filtru antialiasing. + +of.options.shaders.SHADOW_RES_MUL=Calitate Umbra +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Calitate Umbra +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - mic (rapid) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (implicit) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - mare (lent) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Calitatea umbrei controleaza marimea texturii umbrei +of.options.shaders.SHADOW_RES_MUL.tooltip.6=pe care shader-ul o foloseste. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Valori mici = imprecis, umbre aspre. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Valori mari = detaliat, umbre netede. + +of.options.shaders.HAND_DEPTH_MUL=Adancime Mana +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Adancime Mana +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - mana aproape de camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (implicit) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - mana departe de camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Adancimea mainii controleaza cat de departe +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=fata de camera sunt obiectele din mana. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Pentru shader-uri care folosesc adancimea blurata +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=ar trebuii sa schimbe blurarea obiectelor din mana. + +of.options.shaders.CLOUD_SHADOW=Umbre Nori + +of.options.shaders.OLD_HAND_LIGHT=Lumina Veche a Mainii +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Lumina Veche a Mainii +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Implicit - controlat de shader +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= ACTIV - foloseste lumina veche +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= OPRIT - foloseste lumina noua +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Lumina veche a mainii permite shader-ului care recunoaste +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=doar lumina emisa de obiectul din mana principala +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=sa functioneze si cu obiectele din mana secundara. + +of.options.shaders.OLD_LIGHTING=Lumina Veche +of.options.shaders.OLD_LIGHTING.tooltip.1=Lumina Veche +of.options.shaders.OLD_LIGHTING.tooltip.2= Implicit - controlat de shader +of.options.shaders.OLD_LIGHTING.tooltip.3= ACTIV - foloseste lumina veche +of.options.shaders.OLD_LIGHTING.tooltip.4= OPRIT - foloseste lumina noua +of.options.shaders.OLD_LIGHTING.tooltip.5=Lumina veche controleaza lumina fixa +of.options.shaders.OLD_LIGHTING.tooltip.6=folosita de vanilla pe fetele blocurilor. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shader-ul care foloseste umbre de obicei furnizeaza +of.options.shaders.OLD_LIGHTING.tooltip.8=o mai buna luminare depinzand de pozitia soarelui. + +of.options.shaders.DOWNLOAD=Descarca Shadere +of.options.shaders.DOWNLOAD.tooltip.1=Descarca Shadere +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Deschide pagina cu shadere in browser. +of.options.shaders.DOWNLOAD.tooltip.4=Pune shader-ul descarcat in dosarul "Dosar Shadere" +of.options.shaders.DOWNLOAD.tooltip.5=si vor aparea in lista shadere-lor instalate. + +of.options.shaders.SHADER_PACK=Pachet Shader + +of.options.shaders.shadersFolder=Dosar Shadere +of.options.shaders.shaderOptions=Optiuni Shader... + +of.options.shaderOptionsTitle=Optiuni Shader + +of.options.quality=Calitate... +of.options.qualityTitle=Setari Calitate + +of.options.details=Detalii... +of.options.detailsTitle=Setari Detalii + +of.options.performance=Performanta... +of.options.performanceTitle=Setari Performanta + +of.options.animations=Animatii... +of.options.animationsTitle=Setari animatii + +of.options.other=Altele... +of.options.otherTitle=Alte Setari + +of.options.other.reset=Reseteaza Setarile Video... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Biliniar +of.options.mipmap.linear=Liniar +of.options.mipmap.nearest=Apropiat +of.options.mipmap.trilinear=Triliniar + +options.mipmapLevels.tooltip.1=Efect vizual care face obiectele la distanta sa arate bine +options.mipmapLevels.tooltip.2=prin netezirea detaliilor texturii. +options.mipmapLevels.tooltip.3= OPRIT - fara netezire +options.mipmapLevels.tooltip.4= 1 - netezire minima +options.mipmapLevels.tooltip.5= 4 - netezire maxima +options.mipmapLevels.tooltip.6=Aceasta optiune de obicei nu afecteaza performanta. + +of.options.MIPMAP_TYPE=Tip Mip-maping +of.options.MIPMAP_TYPE.tooltip.1=Efect vizual care face obiectele la distanta sa arate bine +of.options.MIPMAP_TYPE.tooltip.2=prin netezirea detaliilor texturii. +of.options.MIPMAP_TYPE.tooltip.3= Apropiat - netezire aspra (foarte rapid) +of.options.MIPMAP_TYPE.tooltip.4= Liniar - netezire normala +of.options.MIPMAP_TYPE.tooltip.5= Biliniar - netezire fina +of.options.MIPMAP_TYPE.tooltip.6= Triliniar - netezire foarte fina (foarte lent) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= OPRIT - (implicit) fara antialiasing (rapid) +of.options.AA_LEVEL.tooltip.3= 2-16 - linii si margini fara crestare (lent) +of.options.AA_LEVEL.tooltip.4=Anti-aliasing-ul netezeste liniile crestate si +of.options.AA_LEVEL.tooltip.5=ascute tranzitiile culori. +of.options.AA_LEVEL.tooltip.6=Cand este ACTIV va scadea substantial si FPS-ul. +of.options.AA_LEVEL.tooltip.7=Nu toate nivelele sunt suportate de toate placile video. +of.options.AA_LEVEL.tooltip.8=Functioneaza dupa un RESTART! + +of.options.AF_LEVEL=Filtru Anisotropic +of.options.AF_LEVEL.tooltip.1=Filtru Anisotropic +of.options.AF_LEVEL.tooltip.2= OPRIT - (implicit) detali textura standard (rapid) +of.options.AF_LEVEL.tooltip.3= 2-16 - detalii fine in texturile mip-map (lent) +of.options.AF_LEVEL.tooltip.4=Filtru Anisotropic restaureaza detaliile in +of.options.AF_LEVEL.tooltip.5=texturile mip-map. +of.options.AF_LEVEL.tooltip.6=Cand este ACTIV va scadea substantial si FPS-ul. + +of.options.CLEAR_WATER=Apa Curata +of.options.CLEAR_WATER.tooltip.1=Apa Curata +of.options.CLEAR_WATER.tooltip.2= ACTIV - curat, apa transparenta +of.options.CLEAR_WATER.tooltip.3= OPRIT - apa implicita + +of.options.RANDOM_ENTITIES=Entitati Aleatoare +of.options.RANDOM_ENTITIES.tooltip.1=Entitati Aleatoare +of.options.RANDOM_ENTITIES.tooltip.2= OPRIT - fara entitati aleatoare, rapid +of.options.RANDOM_ENTITIES.tooltip.3= ON - entitati aleatoare, lent +of.options.RANDOM_ENTITIES.tooltip.4=Entitatile aleatoare foloseste texturi aleatoare pentru creaturile jocului. +of.options.RANDOM_ENTITIES.tooltip.5=Este necesar de un pachet de resurse ce foloseste multiple texturi pentru entitati. + +of.options.BETTER_GRASS=Gazon Imbunatatit +of.options.BETTER_GRASS.tooltip.1=Gazon Imbunatatit +of.options.BETTER_GRASS.tooltip.2= OPRIT - textura fetelor gazonului implicita, rapid +of.options.BETTER_GRASS.tooltip.3= Rapid - textura fetelor gazonului plina, lent +of.options.BETTER_GRASS.tooltip.4= Atractiv - textura fetelor gazonului dinamica, foarte lent + +of.options.BETTER_SNOW=Zapada Imbunatatita +of.options.BETTER_SNOW.tooltip.1=Zapada Imbunatatita +of.options.BETTER_SNOW.tooltip.2= OPRIT - zapada implicita, rapid +of.options.BETTER_SNOW.tooltip.3= ACTIV - zapada imbunatatita, lent +of.options.BETTER_SNOW.tooltip.4=Zapada sub blocurile transparente (gard, iarba) +of.options.BETTER_SNOW.tooltip.5=cand sunt invecinate cu blocuri de zapada. + +of.options.CUSTOM_FONTS=Fonturi Personalizate +of.options.CUSTOM_FONTS.tooltip.1=Fonturi Personalizate +of.options.CUSTOM_FONTS.tooltip.2= ACTIV - foloseste fonturi personalizate (implicit), lent +of.options.CUSTOM_FONTS.tooltip.3= OPRIT - foloseste fontul implicit, rapid +of.options.CUSTOM_FONTS.tooltip.4=Fonturile personalizate sunt furnizate de +of.options.CUSTOM_FONTS.tooltip.5=pachetul de resurse. + +of.options.CUSTOM_COLORS=Culori Personalizate +of.options.CUSTOM_COLORS.tooltip.1=Culori Personalizate +of.options.CUSTOM_COLORS.tooltip.2= ACTIV - foloseste culori personalizate (implicit), lent +of.options.CUSTOM_COLORS.tooltip.3= OPRIT - foloseste culori implicite, rapid +of.options.CUSTOM_COLORS.tooltip.4=Culorile personalizate sunt furnizate de +of.options.CUSTOM_COLORS.tooltip.5=pachetul de resurse. + +of.options.SWAMP_COLORS=Culorile Mlastinei +of.options.SWAMP_COLORS.tooltip.1=Culorile Mlastinei +of.options.SWAMP_COLORS.tooltip.2= ACTIV - foloseste culori mlastinei (implicit), lent +of.options.SWAMP_COLORS.tooltip.3= OPRIT - nu foloseste culori mlastinei, rapid +of.options.SWAMP_COLORS.tooltip.4=Culorile mlastinei afecteaza gazonul, frunzele, lianele si apa. + +of.options.SMOOTH_BIOMES=Biomuri Netede +of.options.SMOOTH_BIOMES.tooltip.1=Biomuri Netede +of.options.SMOOTH_BIOMES.tooltip.2= ACTIV - netezeste bordurile biomurilor (implicit), lent +of.options.SMOOTH_BIOMES.tooltip.3= OPRIT - fara netezire a bordurilor biomurilor, rapid +of.options.SMOOTH_BIOMES.tooltip.4=Netezirea bordurilor biomurilor este facuta de +of.options.SMOOTH_BIOMES.tooltip.5=media culorii blocurilor incojuratoare aflate in fiecare biom. +of.options.SMOOTH_BIOMES.tooltip.6=Afecteaza gazonul, frunzele, lianele si apa. + +of.options.CONNECTED_TEXTURES=Texturi Conectate +of.options.CONNECTED_TEXTURES.tooltip.1=CTexturi Conectate +of.options.CONNECTED_TEXTURES.tooltip.2= OPRIT - fara texturi conectate (implicit) +of.options.CONNECTED_TEXTURES.tooltip.3= Rapid - conecteaza texturile rapid +of.options.CONNECTED_TEXTURES.tooltip.4= Atractiv - conecteaza texturile elegant +of.options.CONNECTED_TEXTURES.tooltip.5=Texturile conectate ataseaza texturile sticlei, +of.options.CONNECTED_TEXTURES.tooltip.6=gresiei si a rafturilor cu carti cand sunt puse +of.options.CONNECTED_TEXTURES.tooltip.7=una langa alta. Texturile conectate sunt furnizate +of.options.CONNECTED_TEXTURES.tooltip.8=de pachetul de resurse curent. + +of.options.NATURAL_TEXTURES=Texturi Naturale +of.options.NATURAL_TEXTURES.tooltip.1=Texturi Naturale +of.options.NATURAL_TEXTURES.tooltip.2= OPRIT - fara texturi naturale (implicit) +of.options.NATURAL_TEXTURES.tooltip.3= ACTIV - foloseste texturi naturale +of.options.NATURAL_TEXTURES.tooltip.4=Texturile naturale elimina modelul de grid +of.options.NATURAL_TEXTURES.tooltip.5=creat de blocurilor repetate de acelasi tip. +of.options.NATURAL_TEXTURES.tooltip.6=Foloseste variante rotite si in oglinda a texturii +of.options.NATURAL_TEXTURES.tooltip.7=blocului. Configuratia pentru texturile naturale +of.options.NATURAL_TEXTURES.tooltip.8=sunt furnizate de pachetul de resurse curent. + +of.options.EMISSIVE_TEXTURES=Texturi Emissive #How should anyone translate this? +of.options.EMISSIVE_TEXTURES.tooltip.1=Texturi Emissive +of.options.EMISSIVE_TEXTURES.tooltip.2= OPRIT - fara texturi emissive (implicit) +of.options.EMISSIVE_TEXTURES.tooltip.3= ACTIV - foloseste texturi emissive +of.options.EMISSIVE_TEXTURES.tooltip.4=Texturile emissive sunt randate ca straturi +of.options.EMISSIVE_TEXTURES.tooltip.5=Pot fii folosite pentru a simula +of.options.EMISSIVE_TEXTURES.tooltip.6=parti care emit lumina la baza texturii. +of.options.EMISSIVE_TEXTURES.tooltip.7=Texturile emissive sunt furnizate de +of.options.EMISSIVE_TEXTURES.tooltip.8=pachetul de resurse curent. + +of.options.CUSTOM_SKY=Cer Personalizat +of.options.CUSTOM_SKY.tooltip.1=Cer Personalizat +of.options.CUSTOM_SKY.tooltip.2= ACTIV - texturi al cerului personalizate (implicit), lent +of.options.CUSTOM_SKY.tooltip.3= OPRIT - cer implicit, rapid +of.options.CUSTOM_SKY.tooltip.4=Cerul personalizat este furnizat de +of.options.CUSTOM_SKY.tooltip.5=pachetul de resurse curent. + +of.options.CUSTOM_ITEMS=Obiecte Personalizate +of.options.CUSTOM_ITEMS.tooltip.1=Obiecte Personalizate +of.options.CUSTOM_ITEMS.tooltip.2= ACTIV - texturi ale obiectelor personalizate (implicit), lent +of.options.CUSTOM_ITEMS.tooltip.3= OPRIT - texturi ale obiectelor implicite, rapid +of.options.CUSTOM_ITEMS.tooltip.4=Obiectele personalizate sunt furnizate de +of.options.CUSTOM_ITEMS.tooltip.5=pachetul de resurse curent. + +of.options.CUSTOM_ENTITY_MODELS=Modele Entitati Personalizate +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modele Entitati Personalizate +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ACTIV - modele entitati personalizate (implicit), lent +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= OPRIT - modele entitati implicite, rapid +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Modelele entitatilor personalizate sunt furnizate de +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=pachetul de resurse curent. + +of.options.CUSTOM_GUIS=GUI-uri Personalizate +of.options.CUSTOM_GUIS.tooltip.1=GUI-uri Personalizate +of.options.CUSTOM_GUIS.tooltip.2= ACTIV - GUI-uri personalizate (implicit), lent +of.options.CUSTOM_GUIS.tooltip.3= OPRIT - GUI-uri implicite, rapid +of.options.CUSTOM_GUIS.tooltip.4=GUI-urile personalizate sunt furnizate de pachetul de resurse curent. + +# Details + +of.options.CLOUDS=Nori +of.options.CLOUDS.tooltip.1=Nori +of.options.CLOUDS.tooltip.2= Implicit - setat prin setarea graficii. +of.options.CLOUDS.tooltip.3= Rapid - calitate mica, rapid +of.options.CLOUDS.tooltip.4= Atractiv - calitate mare, lent +of.options.CLOUDS.tooltip.5= OPRIT - fara nori, foarte rapid +of.options.CLOUDS.tooltip.6=Norii rapizi sunt redati 2D. +of.options.CLOUDS.tooltip.7=Norii atractivi sunt redati 3D. + +of.options.CLOUD_HEIGHT=Inaltime Nori +of.options.CLOUD_HEIGHT.tooltip.1=Inaltime Nori +of.options.CLOUD_HEIGHT.tooltip.2= OPRIT - inaltime implicita +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - deasupra inaltimitii limita a lumii. + +of.options.TREES=Copaci +of.options.TREES.tooltip.1=Copaci +of.options.TREES.tooltip.2= Implicit - setat prin setarea graficii. +of.options.TREES.tooltip.3= Rapid - calitate mica, rapid +of.options.TREES.tooltip.4= Destept - calitate mare, rapid +of.options.TREES.tooltip.5= Atractiv - calitate mare, lent +of.options.TREES.tooltip.6=Copacii rapizi au frunzele opace. +of.options.TREES.tooltip.7=Copacii atractivi si destepti au frunze transparente. + +of.options.RAIN=Ploaie si Zapada +of.options.RAIN.tooltip.1=Ploaie si Zapada +of.options.RAIN.tooltip.2= Implicit - setat prin setarea graficii. +of.options.RAIN.tooltip.3= Rapid - ploaie/zapada usoara, rapid +of.options.RAIN.tooltip.4= Atractiv - ploaie/zapada grea, lent +of.options.RAIN.tooltip.5= OPRIT - fara ploaie/zapada, foarte rapid +of.options.RAIN.tooltip.6=Cand ploaia este OPRITA stopii si sunetele ploii +of.options.RAIN.tooltip.7=raman inca active. + +of.options.SKY=Cer +of.options.SKY.tooltip.1=Cer +of.options.SKY.tooltip.2= ACTIV - cerul este vizibil, lent +of.options.SKY.tooltip.3= OPRIT - cerul nu este vizibil, rapid +of.options.SKY.tooltip.4=Cand cerul este OPRIT luna si soarele raman inca vizibile. + +of.options.STARS=Stele +of.options.STARS.tooltip.1=Stele +of.options.STARS.tooltip.2= ACTIV - stelele sunt vizibile, lent +of.options.STARS.tooltip.3= OPRIT - stelele nu sunt vizibile, rapid + +of.options.SUN_MOON=Soarele si Luna +of.options.SUN_MOON.tooltip.1=Soarele si Luna +of.options.SUN_MOON.tooltip.2= ACTIV - soarele si luna sunt vizibile (implicit) +of.options.SUN_MOON.tooltip.3= OPRIT - soarele si luna nu sunt vizibile (lent) + +of.options.SHOW_CAPES=Arata Cape +of.options.SHOW_CAPES.tooltip.1=Arata Cape +of.options.SHOW_CAPES.tooltip.2= ACTIV - arata capele jucatorilor (implicit) +of.options.SHOW_CAPES.tooltip.3= OPRIT - nu arata capele jucatorilor + +of.options.TRANSLUCENT_BLOCKS=Blocuri Transparente +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocuri Transparente +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Atractiv - amestecare corectă a culorii (implicit) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rapid - amestecarea rapida a culorii (rapid) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controleaza amestecarea culorii blocurilor trasparente +of.options.TRANSLUCENT_BLOCKS.tooltip.5=cu diferite culori (sticla colorata, apa, gheata) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=cand sunt puse una in spatele celelalte cu aer intre ele. + +of.options.HELD_ITEM_TOOLTIPS=Informatii Obiect Detinut +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Informatii Obiect Detinut +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ACTIV - arata informatii despre obiectul detinut (implicit) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= OPRIT - nu arata informatii despre obiectul detinut + +of.options.ADVANCED_TOOLTIPS=Informatii Avansate +of.options.ADVANCED_TOOLTIPS.tooltip.1=Informatii Avansate +of.options.ADVANCED_TOOLTIPS.tooltip.2= ACTIV - arata informatii avansate +of.options.ADVANCED_TOOLTIPS.tooltip.3= OPRIT - nu arata informatii avansate (implicit) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Extinde informatiile despre +of.options.ADVANCED_TOOLTIPS.tooltip.5=obiecte (id, durabilitate) si optiunile shaderului +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, sursa, valori implicite). + +of.options.DROPPED_ITEMS=Obiecte Aruncate +of.options.DROPPED_ITEMS.tooltip.1=Obiecte Aruncate +of.options.DROPPED_ITEMS.tooltip.2= Implicit - setat prin setarea graficii. +of.options.DROPPED_ITEMS.tooltip.3= Rapid - obiecte aruncate 2D, rapid +of.options.DROPPED_ITEMS.tooltip.4= Fancy - obiecte aruncate 3D, lent + +options.entityShadows.tooltip.1=Umbre Entitati +options.entityShadows.tooltip.2= ACTIV - arata umbrele entitatilor +options.entityShadows.tooltip.3= OPRIT - nu arata umbrele entitatilor + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Efect vizual ce face colutile ecranului putin inchise. +of.options.VIGNETTE.tooltip.2= Implicit - setat prin setarea graficii (implicit) +of.options.VIGNETTE.tooltip.3= Rapid - vignette OPRIT (rapid) +of.options.VIGNETTE.tooltip.4= Atractiv - vignette ACTIV (lent) +of.options.VIGNETTE.tooltip.5=Vignette poate avea un efect semnificativ FPS-ului, +of.options.VIGNETTE.tooltip.6=in special jucat in ecran complet. +of.options.VIGNETTE.tooltip.7=Efectul vignette este foarte subtil si poate fi +of.options.VIGNETTE.tooltip.8=OPRIT fara probleme. + +of.options.DYNAMIC_FOV=Camp De Vizualizare +of.options.DYNAMIC_FOV.tooltip.1=Camp De Vizualizare +of.options.DYNAMIC_FOV.tooltip.2= ACTIV - activeaza campul de vizualizare (impilcit) +of.options.DYNAMIC_FOV.tooltip.3= OPRIT - dezactiveaza campul de vizualizare +of.options.DYNAMIC_FOV.tooltip.4=Schimba campul de vizualizare in timpul zborului, alergatului +of.options.DYNAMIC_FOV.tooltip.5=sau trasului cu arcul. + +of.options.DYNAMIC_LIGHTS=Lumini Dinamice +of.options.DYNAMIC_LIGHTS.tooltip.1=Lumini Dinamice +of.options.DYNAMIC_LIGHTS.tooltip.2= OPRIT - fara lumini dinamice (implicit) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapid - lumini dinamice rapide (actualizate fiecare 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Atractiv - lumini dinamice atractive (actualizate in timp real) +of.options.DYNAMIC_LIGHTS.tooltip.5=Activeaza obiectele luminoase (torte, piatra luminoasa, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=sa emita lumina in jurul lor cand sunt tinute in mana, +of.options.DYNAMIC_LIGHTS.tooltip.7=echipate de alti jucatori sau aruncate pe pamant. + +# Performance + +of.options.SMOOTH_FPS=FPS-uri Constante +of.options.SMOOTH_FPS.tooltip.1=Stabilizeaza FPS-ul prin curatarea bufferelor placii grafice. +of.options.SMOOTH_FPS.tooltip.2= OPRIT - fara stabilizare, FPS-ul poate fluctua +of.options.SMOOTH_FPS.tooltip.3= ACTIV - FPS-ul stabilizat +of.options.SMOOTH_FPS.tooltip.4=Aceasta optiune este dependenta de placa grafica +of.options.SMOOTH_FPS.tooltip.5=si nu are mereu un efect vizibil. + +of.options.SMOOTH_WORLD=Lume Constanta +of.options.SMOOTH_WORLD.tooltip.1=Elimina lagul cauzat de serverul internal. +of.options.SMOOTH_WORLD.tooltip.2= OPRIT - fara stabilizare, FPS-ul poate fluctua +of.options.SMOOTH_WORLD.tooltip.3= ACTIV - FPS-ul stabilizat +of.options.SMOOTH_WORLD.tooltip.4=Stabilizeaza FPS-ul prin distribuirea incarcarii serverului internal. +of.options.SMOOTH_WORLD.tooltip.5=Are efect doar in lumine locale (single player). + +of.options.FAST_RENDER=Render Rapid +of.options.FAST_RENDER.tooltip.1=Render Rapid +of.options.FAST_RENDER.tooltip.2= OPRIT - render standard (implicit) +of.options.FAST_RENDER.tooltip.3= ACTIV - render optimizat (rapid) +of.options.FAST_RENDER.tooltip.4=Foloseste un algoritm optimizat pentru render care scade +of.options.FAST_RENDER.tooltip.5=incarcarea GPU-ului si substatinal creste FPS-ul. + +of.options.FAST_MATH=Matematica Rapida +of.options.FAST_MATH.tooltip.1=Matematica Rapida +of.options.FAST_MATH.tooltip.2= OPRIT - matematica standard (implicit) +of.options.FAST_MATH.tooltip.3= ACTIV - matematica rapida +of.options.FAST_MATH.tooltip.4=Foloseste functii sin() si cos() optimizate care +of.options.FAST_MATH.tooltip.5=utilizeaza cache-ul CPU-ului mai bine si creste FPS-ul. + +of.options.CHUNK_UPDATES=Actualizare Chunk-uri +of.options.CHUNK_UPDATES.tooltip.1=Actualizare Chunk-uri +of.options.CHUNK_UPDATES.tooltip.2= 1 - incarcarea lumii lenta, FPS mare (implicit) +of.options.CHUNK_UPDATES.tooltip.3= 3 - incarcarea lumii rapida, FPS mic +of.options.CHUNK_UPDATES.tooltip.4= 5 - incarcarea lumii foarte rapida, FPS foarte mic +of.options.CHUNK_UPDATES.tooltip.5=Numarul de actualizari ale chunk-urilor per frame rendate, +of.options.CHUNK_UPDATES.tooltip.6=valorile mari pot destabiliza rata de frameuri. + +of.options.CHUNK_UPDATES_DYNAMIC=Actualizari Dinamice +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Actualizari dinamice ale chunk-urilor +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= OPRIT - (implicit) actualizari standard ale chunk-urilor per frame +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ACTIV - mai multe actualizari cand jucatorul sta nemiscat +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Actualizarile dinamice forteaza mai multe chunk-uri sa fie actualizate +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=cat timp jucatorul sta nemiscat pentru o mai buna incarcare a lumii. + +of.options.LAZY_CHUNK_LOADING=Chunk-uri Lenese +of.options.LAZY_CHUNK_LOADING.tooltip.1=Incarcare Lenesa a Chunk-urilor +of.options.LAZY_CHUNK_LOADING.tooltip.2= OPRIT - incarcarea implicita a chunk-urlor serverului +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - incarcarea lenesa a chunk-urlor serverului (lin) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Usureaza incarcarea chunk-urilor serverului +of.options.LAZY_CHUNK_LOADING.tooltip.5=distribuind chunk-urile peste cateva tick-uri. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Dezactiva-l daca parti ale lumii nu sunt incarcate corect. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efectiv doar pentru lumile locale si pentru CPU-urile cu un singur nucleu. + +of.options.RENDER_REGIONS=Regiuni Render +of.options.RENDER_REGIONS.tooltip.1=Regiuni Render +of.options.RENDER_REGIONS.tooltip.2= OPRIT - (implicit) nu foloseste regiuni render +of.options.RENDER_REGIONS.tooltip.3= ACTIV - foloseste regiuni render +of.options.RENDER_REGIONS.tooltip.4=Regiunile render permite generarea terenului mai rapida +of.options.RENDER_REGIONS.tooltip.5=la distante mari. Mai efectiv cand VBO este activ. + +# Animations + +of.options.animation.allOn=Toate ACTIVE +of.options.animation.allOff=Toate OPRITE +of.options.animation.dynamic=Dinamic + +of.options.ANIMATED_WATER=Animatie Apa +of.options.ANIMATED_LAVA=Animatie Lava +of.options.ANIMATED_FIRE=Animatie Foc +of.options.ANIMATED_PORTAL=Animatie Portal +of.options.ANIMATED_REDSTONE=Animatie Redstone +of.options.ANIMATED_EXPLOSION=Animatie Explozie +of.options.ANIMATED_FLAME=Animatie Flacara +of.options.ANIMATED_SMOKE=Animatie Fum +of.options.VOID_PARTICLES=Particule de Void +of.options.WATER_PARTICLES=Particule de Apa +of.options.RAIN_SPLASH=Stopi de Ploaie +of.options.PORTAL_PARTICLES=Particule de Portal +of.options.POTION_PARTICLES=Particule de Potiuni +of.options.DRIPPING_WATER_LAVA=Picaturi de Apa/Lava +of.options.ANIMATED_TERRAIN=Teren Animat +of.options.ANIMATED_TEXTURES=Texturi Animate +of.options.FIREWORK_PARTICLES=Particule de Artificii + +# Other + +of.options.LAGOMETER=Lagometru +of.options.LAGOMETER.tooltip.1=Arata lagometrul in ecranul de debug (F3). +of.options.LAGOMETER.tooltip.2=* Portocaliu - Colectie de memorie gunoi +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Albastru - Programe executabile +of.options.LAGOMETER.tooltip.5=* Purpuriu - Incarcare chunk-uri +of.options.LAGOMETER.tooltip.6=* Rosu - Actualizare chunk-uri +of.options.LAGOMETER.tooltip.7=* Galben - Verificarea vizibilitatii +of.options.LAGOMETER.tooltip.8=* Verde - Teren rendat + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= ACTIV - debug profiler este activ, lent +of.options.PROFILER.tooltip.3= OPRIT - debug profiler nu este activ, rapid +of.options.PROFILER.tooltip.4=Debug profiler colecteaza si arata informatii pentru +of.options.PROFILER.tooltip.5=debug cat timp ecranul de debug este deschis (F3). + +of.options.WEATHER=Stare Atmosferica +of.options.WEATHER.tooltip.1=Stare Atmosferica +of.options.WEATHER.tooltip.2= ACTIV - starea atmosferica este activa, lent +of.options.WEATHER.tooltip.3= OPRIT - starea atmosferica nu este activa, rapid +of.options.WEATHER.tooltip.4=Starea atmosferica controleaza ploaia si furtunile. +of.options.WEATHER.tooltip.5=Controlul starii atmosferice este posibila doar pentru lumile locale. + +of.options.time.dayOnly=Doar Zi +of.options.time.nightOnly=Doar Noapte + +of.options.TIME=Timp +of.options.TIME.tooltip.1=Timp +of.options.TIME.tooltip.2= Implicit - ciclu normal de zi/noapte +of.options.TIME.tooltip.3= Doar Zi - doar zi +of.options.TIME.tooltip.4= Doar Noapte - doar noapte +of.options.TIME.tooltip.5=Setarea timpului are efect doar in modul CREATIV +of.options.TIME.tooltip.6=si pentru lumile locale. + +options.fullscreen.tooltip.1=Ecran complet +options.fullscreen.tooltip.2= ACTIV - foloseste modul ecran complet +options.fullscreen.tooltip.3= OPRIT - foloseste modul fereastra +options.fullscreen.tooltip.4=Modul ecran complet poate fi mai rapid sau mai incet +options.fullscreen.tooltip.5=decat modul fereastra, in functie de placa grafica. + +of.options.FULLSCREEN_MODE=Modul Ecran Complet +of.options.FULLSCREEN_MODE.tooltip.1=Modul ecran complet +of.options.FULLSCREEN_MODE.tooltip.2= Implicit - foloseste rezolutia desktop-ului, lent +of.options.FULLSCREEN_MODE.tooltip.3= WxH - foloseste rezolutia personalizata, poate fi mai rapid +of.options.FULLSCREEN_MODE.tooltip.4=Rezolutia selectata este folosita in modul ecran complet (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Rezolutiile mici ar trebuii in general sa fie mai rapide. + +of.options.SHOW_FPS=Arata FPS +of.options.SHOW_FPS.tooltip.1=Arata FPS-ul compact si informatii despre render. +of.options.SHOW_FPS.tooltip.2= C: - chunk-uri rendate +of.options.SHOW_FPS.tooltip.3= E: - entitati rendate + entitati blocuri +of.options.SHOW_FPS.tooltip.4= U: - actualizari chunk-uri +of.options.SHOW_FPS.tooltip.5=Informatiile FPS-ului compat sunt vizibile doar cand +of.options.SHOW_FPS.tooltip.6=ecranul de debug nu este vizibil. + +of.options.save.default=Implicit (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Auto-Salvare +of.options.AUTOSAVE_TICKS.tooltip.1=Interval auto-salvare +of.options.AUTOSAVE_TICKS.tooltip.2=Intervalul implicit de auto-salvare (2s) NU ESTE RECOMANDAT. +of.options.AUTOSAVE_TICKS.tooltip.3=Auto-savarea cauzeaza faimosul Lag Spike al Mortii. + +of.options.SCREENSHOT_SIZE=Marime Screenshot +of.options.SCREENSHOT_SIZE.tooltip.1=Marime Screenshot +of.options.SCREENSHOT_SIZE.tooltip.2= Implicit - marima implicita de screenshot +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - marime personalizata de screenshot +of.options.SCREENSHOT_SIZE.tooltip.4=Se poate ca, capturand screenshot-uri mai mari sa fie nevoe de mai multa memorie. +of.options.SCREENSHOT_SIZE.tooltip.5=Nu este compatibil cu Render Rapid si Anti-aliasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Necesita suport GPU framebuffer. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ru_RU.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ru_RU.lang new file mode 100644 index 0000000..b7efdf8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/ru_RU.lang @@ -0,0 +1,756 @@ +# Contributors of Russian localization # +# Jerozgen 01-Mar-2016 — 16-Jun-2019 +# Dibro 20-Mar-2016 + +# Общее +of.general.ambiguous=Неопределено +of.general.compact=Компактный +of.general.custom=По выбору +of.general.from=Файл +of.general.id=ID +of.general.max=Макс. +of.general.restart=⟲ +of.general.smart=Умно + +# Управление +of.key.zoom=Приблизить + +# Сообщения +of.message.aa.shaders1=Антиалиасинг не совместим с шейдерами. +of.message.aa.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.af.shaders1=Анизотропная фильтрация не совместима с шейдерами. +of.message.af.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.fr.shaders1=Быстрый рендер не совместим с шейдерами. +of.message.fr.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.an.shaders1=3D анаглиф не совместим с шейдерами. +of.message.an.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.shaders.aa1=Шейдеры не совместимы с антиалиасингом. +of.message.shaders.aa2=Переключите «Качество» → «Антиалиасинг» на «Выкл» и перезапустите игру. + +of.message.shaders.af1=Шейдеры не совместимы с анизотропной фильтрацией. +of.message.shaders.af2=Переключите «Качество» → «Анизотропная фильтрация» на «Выкл». + +of.message.shaders.fr1=Шейдеры не совместимы с быстрым рендером. +of.message.shaders.fr2=Переключите «Производительность» → «Быстрый рендер» на «Выкл». + +of.message.shaders.an1=Шейдеры не совместимы с анаглифом. +of.message.shaders.an2=Переключите «Прочее» → «3D анаглиф» на «Выкл». + +of.message.shaders.nv1=Шейдерам требуется более новая версия OptiFine: %s +of.message.shaders.nv2=Вы уверены, что хотите продолжить? + +of.message.newVersion=Доступна новая версия §eOptiFine§f: §e%s§f +of.message.java64Bit=Установите §e64-битную Java§f, чтобы повысить производительность. +of.message.openglError=§eОшибка OpenGL§f: %s (%s) + +of.message.shaders.loading=Загрузка шейдеров: %s + +of.message.other.reset=Сбросить все настройки графики к первоначальным значениям? + +of.message.loadingVisibleChunks=Загрузка видимых чанков + +# Настройка внешнего вида + +of.options.skinCustomisation.ofCape=Плащ OptiFine... + +of.options.capeOF.title=Плащ OptiFine +of.options.capeOF.openEditor=Открыть редактор плаща +of.options.capeOF.reloadCape=Обновить плащ + +of.message.capeOF.openEditor=Редактор плаща OptiFine откроется в браузере. +of.message.capeOF.reloadCape=Плащ будет обновлён через 15 секунд. + +of.message.capeOF.error1=Не удалось войти в учётную запись Mojang. +of.message.capeOF.error2=Ошибка: %s + +# Настройки графики + +options.graphics.tooltip.1=Качество графики +options.graphics.tooltip.2= Быстро - низкое качество (быстрее) +options.graphics.tooltip.3= Детально - высокое качество (медленнее) +options.graphics.tooltip.4=Изменяет облик дёрна, листьев, воды, теней и облаков. +options.graphics.tooltip.5= + +options.renderDistance.tooltip.1=Дальность прорисовки +options.renderDistance.tooltip.2= 2 Минимальная - 32 м (ещё быстрее) +options.renderDistance.tooltip.3= 4 Малая - 64 м (быстрее) +options.renderDistance.tooltip.4= 8 Нормальная - 128 м +options.renderDistance.tooltip.5= 16 Дальняя - 256 м (медленнее) +options.renderDistance.tooltip.6= 32 Предельная - 512 м (ещё медленнее!) +options.renderDistance.tooltip.7= 48 Безумная - 768 м, требуется 2 Гбайт ОЗУ +options.renderDistance.tooltip.8= 64 Абсурдная! - 1024 м, требуется 3 Гбайт ОЗУ + +of.options.renderDistance.tiny=Минимальная +of.options.renderDistance.short=Малая +of.options.renderDistance.normal=Нормальная +of.options.renderDistance.far=Дальняя +of.options.renderDistance.extreme=Предельная +of.options.renderDistance.insane=Безумная +of.options.renderDistance.ludicrous=Абсурдная! + +options.ao.tooltip.1=Мягкое освещение +options.ao.tooltip.2= Выкл - без мягкого освещения (быстрее) +options.ao.tooltip.3= Минимум - простое мягкое освещение (медленнее) +options.ao.tooltip.4= Максимум - сложное мягкое освещение (ещё медленнее) + +options.framerateLimit.tooltip.1=Частота кадров +options.framerateLimit.tooltip.2= V-Sync - частота обновления монитора +options.framerateLimit.tooltip.3= 5–255 - свои значения +options.framerateLimit.tooltip.4= Максимум - без ограничений (быстрее) +options.framerateLimit.tooltip.5=Уменьшает частоту кадров до указанной. +options.framerateLimit.tooltip.6= +of.options.framerateLimit.vsync=V-Sync + +of.options.AO_LEVEL=Мягкое освещение +of.options.AO_LEVEL.tooltip.1=Уровень мягкого освещения +of.options.AO_LEVEL.tooltip.2= Выкл - без теней +of.options.AO_LEVEL.tooltip.3= 50%% - светлые тени +of.options.AO_LEVEL.tooltip.4= 100%% - тёмные тени + +options.viewBobbing.tooltip.1=Более реалистичное движение. +options.viewBobbing.tooltip.2=При использовании рекомендуется выключить +options.viewBobbing.tooltip.3=MIP-текстурирование. + +options.guiScale.tooltip.1=Размер интерфейса +options.guiScale.tooltip.2= Авто - максимальный размер +options.guiScale.tooltip.3= Мелкий, обычный, крупный - 1x, 2x и 3x соответственно +options.guiScale.tooltip.4= с 4x до 10x - на мониторах с разрешением 4K +options.guiScale.tooltip.5=Нечётные значения не совместимы со шрифтом Unicode. +options.guiScale.tooltip.6=Чем меньше интерфейс, тем он быстрее. + +options.vbo=Использовать VBO +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Использует альтернативную модель рендеринга, +options.vbo.tooltip.3=которая обычно быстрее стандартной на 5–10%%. + +options.gamma.tooltip.1=Яркость тёмных объектов +options.gamma.tooltip.2= §oТускло§r - стандартная яркость +options.gamma.tooltip.3= 1–99%% - свои значения +options.gamma.tooltip.4= Ярко - максимальная яркость +options.gamma.tooltip.5=Не изменяет яркость полностью чёрных объектов. +options.gamma.tooltip.6= + +of.options.DYNAMIC_LIGHTS=Динам. освещение +of.options.DYNAMIC_LIGHTS.tooltip.1=Динамическое освещение +of.options.DYNAMIC_LIGHTS.tooltip.2= §oВыкл§r - динамическое освещение отключено +of.options.DYNAMIC_LIGHTS.tooltip.3= Быстро - обновляется каждые 500 мс. (медленнее) +of.options.DYNAMIC_LIGHTS.tooltip.4= Детально - обновляется в реальном времени (ещё медленнее) +of.options.DYNAMIC_LIGHTS.tooltip.5=Заставляет экипированные и выброшенные предметы, +of.options.DYNAMIC_LIGHTS.tooltip.6=излучающие свет (факел, светокамень и т. д.), освещать +of.options.DYNAMIC_LIGHTS.tooltip.7=территорию вокруг. + +of.options.DYNAMIC_FOV=Динамика поля зрения +of.options.DYNAMIC_FOV.tooltip.1=Динамика поля зрения +of.options.DYNAMIC_FOV.tooltip.2= §oВкл§r - подвижное поле зрения +of.options.DYNAMIC_FOV.tooltip.3= Выкл - фиксированное поле зрения +of.options.DYNAMIC_FOV.tooltip.4=Изменяет поле зрения во время полёта, бега +of.options.DYNAMIC_FOV.tooltip.5=и стрельбы из лука. + +of.options.CHUNK_LOADING=Загрузка чанков +of.options.CHUNK_LOADING.tooltip.1=Загрузка чанков +of.options.CHUNK_LOADING.tooltip.2= §oПо умолчанию§r - нестабильный FPS при загрузке чанков +of.options.CHUNK_LOADING.tooltip.3= Плавная - стабильный FPS +of.options.CHUNK_LOADING.tooltip.4= Многоядерная - стабильный FPS, загрузка мира в 3 раза быстрее +of.options.CHUNK_LOADING.tooltip.5=Плавная и многоядерная загрузки убирают подвисания и лаги, +of.options.CHUNK_LOADING.tooltip.6=вызванные загрузкой чанков. +of.options.CHUNK_LOADING.tooltip.7=Многоядерная загрузка способна ускорить загрузку мира в 3 раза +of.options.CHUNK_LOADING.tooltip.8=и увеличить FPS, используя второе ядро процессора. +of.options.chunkLoading.smooth=Плавная +of.options.chunkLoading.multiCore=Мультиядерная + +of.options.shaders=Шейдеры... +of.options.shadersTitle=Шейдеры + +of.options.shaders.packNone=Отключены +of.options.shaders.packDefault=(встроенные) + +of.options.shaders.ANTIALIASING=Антиалиасинг +of.options.shaders.ANTIALIASING.tooltip.1=Антиалиасинг +of.options.shaders.ANTIALIASING.tooltip.2= §oВыкл§r - сглаживание отключено +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - сглаживание линий и краёв (медленнее) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA — это эффект постобработки, сглаживающий +of.options.shaders.ANTIALIASING.tooltip.5=неровные линии и резкие цветовые переходы. Данный +of.options.shaders.ANTIALIASING.tooltip.6=метод быстрее, чем традиционное сглаживание, и +of.options.shaders.ANTIALIASING.tooltip.7=он совместим с шейдерами и быстрым рендером. + +of.options.shaders.NORMAL_MAP=Карта нормалей +of.options.shaders.NORMAL_MAP.tooltip.1=Карта нормалей +of.options.shaders.NORMAL_MAP.tooltip.2= §oВкл§r - карта нормалей включена +of.options.shaders.NORMAL_MAP.tooltip.3= Выкл - карта нормалей отключена +of.options.shaders.NORMAL_MAP.tooltip.4=Карта нормалей может использоваться шейдерами для +of.options.shaders.NORMAL_MAP.tooltip.5=моделирования трёхмерной геометрии на плоских +of.options.shaders.NORMAL_MAP.tooltip.6=поверхностях моделей. +of.options.shaders.NORMAL_MAP.tooltip.7=Предоставляется пакетами ресурсов. + +of.options.shaders.SPECULAR_MAP=Карта отражений +of.options.shaders.SPECULAR_MAP.tooltip.1=Карта отражений +of.options.shaders.SPECULAR_MAP.tooltip.2= §oВкл§r - карта отражений включена +of.options.shaders.SPECULAR_MAP.tooltip.3= Выкл - карта отражений отключена +of.options.shaders.SPECULAR_MAP.tooltip.4=Карта отражений может использоваться шейдерами для +of.options.shaders.SPECULAR_MAP.tooltip.5=создания особого эффекта отражения. +of.options.shaders.SPECULAR_MAP.tooltip.6=Предоставляется пакетами ресурсов. +of.options.shaders.SPECULAR_MAP.tooltip.7= + +of.options.shaders.RENDER_RES_MUL=Качество рендера +of.options.shaders.RENDER_RES_MUL.tooltip.1=Качество рендеринга +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - низкое качество +of.options.shaders.RENDER_RES_MUL.tooltip.3= §o1x§r - стандартное качество рендеринга +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - высокое качество +of.options.shaders.RENDER_RES_MUL.tooltip.5=Управляет размером текстур, которые визуализируют +of.options.shaders.RENDER_RES_MUL.tooltip.6=шейдеры. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Низкие значения могут быть полезны для дисплеев 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Высокие значения работают как фильтр сглаживания. + +of.options.shaders.SHADOW_RES_MUL=Качество теней +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Качество теней +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - нечёткие, грубые тени +of.options.shaders.SHADOW_RES_MUL.tooltip.3= §o1x§r - стандартное качество теней +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - детализированные, качественные тени +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Управляет размером текстуры карты теней, которая +of.options.shaders.SHADOW_RES_MUL.tooltip.6=используется шейдерами. +of.options.shaders.SHADOW_RES_MUL.tooltip.7= +of.options.shaders.SHADOW_RES_MUL.tooltip.8= + +of.options.shaders.HAND_DEPTH_MUL=Глубина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Глубина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - рука около камеры +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= §o1x§r - стандартная глубина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - рука далеко от камеры +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Управляет удалённостью от камеры объектов, которые +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=находятся в руке. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=У шейдеров, использующих глубину резкости, должна +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=измениться резкость объектов, находящихся в руке. + +of.options.shaders.CLOUD_SHADOW=Тени облаков + +of.options.shaders.OLD_HAND_LIGHT=СО рук +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Старое освещение из рук +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= §oПо умолчанию§r - управление от шейдера +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Вкл - старое освещение руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Выкл - новое освещение руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Позволяет шейдерам, которые распознают предметы, +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=излучающие свет, только в основной руке, также +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=работать с предметами во второй руке. + +of.options.shaders.OLD_LIGHTING=Ст. освещ. +of.options.shaders.OLD_LIGHTING.tooltip.1=Старое освещение +of.options.shaders.OLD_LIGHTING.tooltip.2= §oПо умолчанию§r - управление от шейдера +of.options.shaders.OLD_LIGHTING.tooltip.3= Вкл - использовать старое освещение +of.options.shaders.OLD_LIGHTING.tooltip.4= Выкл - не использовать старое освещение +of.options.shaders.OLD_LIGHTING.tooltip.5=Управляет постоянным освещением, применяемым +of.options.shaders.OLD_LIGHTING.tooltip.6=игрой к сторонам блоков. +of.options.shaders.OLD_LIGHTING.tooltip.7=Шейдеры со встроенными тенями обычно гораздо лучше +of.options.shaders.OLD_LIGHTING.tooltip.8=показывают освещение, зависящее от положения солнца. + +of.options.shaders.DOWNLOAD=Загрузить шейдеры +of.options.shaders.DOWNLOAD.tooltip.1=Загрузить шейдеры +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Открывает страницу со списком шейдеров в браузере. +of.options.shaders.DOWNLOAD.tooltip.4=Поместите загруженные шейдеры в «Папку с шейдерами», +of.options.shaders.DOWNLOAD.tooltip.5=после этого они станут доступны для использования. + +of.options.shaders.SHADER_PACK=Пакет шейдеров + +of.options.shaders.shadersFolder=Папка с шейдерами +of.options.shaders.shaderOptions=Настройки шейдера... + +of.options.shaderOptionsTitle=Настройки шейдера + +of.options.quality=Качество... +of.options.qualityTitle=Настройки качества + +of.options.details=Элементы игры... +of.options.detailsTitle=Настройки элементов игры + +of.options.performance=Производительность... +of.options.performanceTitle=Настройки производительности + +of.options.animations=Анимация... +of.options.animationsTitle=Настройки анимации + +of.options.other=Прочее... +of.options.otherTitle=Прочие настройки + +of.options.other.reset=Сбросить настройки графики... + +of.shaders.profile=Настройки + +# Качество + +options.mipmapLevels.tooltip.1=Уровни детализации +options.mipmapLevels.tooltip.2= Выкл - без сглаживания +options.mipmapLevels.tooltip.3= 1 - минимальное сглаживание +options.mipmapLevels.tooltip.4= Макс. - максимальное сглаживание +options.mipmapLevels.tooltip.5=Заставляет удалённые объекты выглядеть лучше +options.mipmapLevels.tooltip.6=посредством сглаживания деталей текстуры. +options.mipmapLevels.tooltip.7=Обычно не влияет на производительность. + +of.options.MIPMAP_TYPE=MIP-текстурир. +of.options.MIPMAP_TYPE.tooltip.1=MIP-текстурирование +of.options.MIPMAP_TYPE.tooltip.2= Ближнее - грубое сглаживание (быстрее) +of.options.MIPMAP_TYPE.tooltip.3= Линейное - нормальное сглаживание +of.options.MIPMAP_TYPE.tooltip.4= Билинейное - хорошее сглаживание +of.options.MIPMAP_TYPE.tooltip.5= Трилинейное - лучшее сглаживание (медленнее) +of.options.MIPMAP_TYPE.tooltip.6=Заставляет удалённые объекты выглядеть лучше +of.options.MIPMAP_TYPE.tooltip.7=посредством сглаживания деталей текстуры. + +of.options.mipmap.bilinear=Билинейное +of.options.mipmap.linear=Линейное +of.options.mipmap.nearest=Ближнее +of.options.mipmap.trilinear=Трилинейное + +of.options.AF_LEVEL=Анизотроп. фильтрация +of.options.AF_LEVEL.tooltip.1=Анизотропная фильтрация +of.options.AF_LEVEL.tooltip.2= §oВыкл§r - стандартная детализация (быстрее) +of.options.AF_LEVEL.tooltip.3= 2–16 - улучшенная детализация (медленнее) +of.options.AF_LEVEL.tooltip.4=Улучшает качество деталей в MIP-текстурах. +of.options.AF_LEVEL.tooltip.5=Может существенно понизить производительность. +of.options.AF_LEVEL.tooltip.6= + +of.options.AA_LEVEL=Антиалиасинг +of.options.AA_LEVEL.tooltip.1=Антиалиасинг +of.options.AA_LEVEL.tooltip.2= §oВыкл§r - сглаживание отключено (быстрее) +of.options.AA_LEVEL.tooltip.3= 2–16 - сглаживание линий и краёв (медленнее) +of.options.AA_LEVEL.tooltip.4=Сглаживает неровные линии и цветовые переходы. +of.options.AA_LEVEL.tooltip.5=Может существенно понизить производительность. +of.options.AA_LEVEL.tooltip.6=Не все видеокарты поддерживают все уровни антиалиасинга. +of.options.AA_LEVEL.tooltip.7= +of.options.AA_LEVEL.tooltip.8=⟲ Изменения вступят в силу только после ПЕРЕЗАПУСКА! + +of.options.CLEAR_WATER=Очищенная вода +of.options.CLEAR_WATER.tooltip.1=Очищенная вода +of.options.CLEAR_WATER.tooltip.2= Вкл - чистая, прозрачная вода +of.options.CLEAR_WATER.tooltip.3= §oВыкл§r - стандартная вода + +of.options.RANDOM_ENTITIES=Случайные сущности +of.options.RANDOM_ENTITIES.tooltip.1=Случайные текстуры сущностей +of.options.RANDOM_ENTITIES.tooltip.2= Выкл - случайные сущности отключены (быстрее) +of.options.RANDOM_ENTITIES.tooltip.3= Вкл - случайные сущности включены (медленнее) +of.options.RANDOM_ENTITIES.tooltip.4=Сущности используют случайные текстуры. +of.options.RANDOM_ENTITIES.tooltip.5=Предоставляются пакетами ресурсов. + +of.options.BETTER_GRASS=Улучшенный дёрн +of.options.BETTER_GRASS.tooltip.1=Улучшенный дёрн +of.options.BETTER_GRASS.tooltip.2= §oВыкл§r - стандартный дёрн (быстрее) +of.options.BETTER_GRASS.tooltip.3= Быстро - полное изменение текстур (медленнее) +of.options.BETTER_GRASS.tooltip.4= Детально - динамичное изменение текстур (ещё медленнее) +of.options.BETTER_GRASS.tooltip.5=Изменяет текстуры сторон дёрна на верхнюю. + +of.options.BETTER_SNOW=Улучшенный снег +of.options.BETTER_SNOW.tooltip.1=Улучшенный снег +of.options.BETTER_SNOW.tooltip.2= §oВыкл§r - стандартный снег (быстрее) +of.options.BETTER_SNOW.tooltip.3= Вкл - улучшенный снег (медленнее) +of.options.BETTER_SNOW.tooltip.4=Показывает снег под прилегающими к нему прозрачными +of.options.BETTER_SNOW.tooltip.5=блоками (забор, трава). + +of.options.CUSTOM_FONTS=Шрифт +of.options.CUSTOM_FONTS.tooltip.1=Пользовательский шрифт +of.options.CUSTOM_FONTS.tooltip.2= §oВкл§r - пользовательский шрифт +of.options.CUSTOM_FONTS.tooltip.3= Выкл - стандартный шрифт (быстрее) +of.options.CUSTOM_FONTS.tooltip.4=Предоставляется пакетами ресурсов. +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Цвета +of.options.CUSTOM_COLORS.tooltip.1=Пользовательские цвета +of.options.CUSTOM_COLORS.tooltip.2= §oВкл§r - пользовательские цвета +of.options.CUSTOM_COLORS.tooltip.3= Выкл - стандартные цвета (быстрее) +of.options.CUSTOM_COLORS.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Болотные цвета +of.options.SWAMP_COLORS.tooltip.1=Болотные цвета +of.options.SWAMP_COLORS.tooltip.2= §oВкл§r - болотные цвета (медленнее) +of.options.SWAMP_COLORS.tooltip.3= Выкл - болотные цвета не отображаются (быстрее) +of.options.SWAMP_COLORS.tooltip.4=Влияет на цвет травы, листьев, лиан и воды в болоте. + +of.options.SMOOTH_BIOMES=Сглаженные биомы +of.options.SMOOTH_BIOMES.tooltip.1=Сглаживание цветов границ биомов +of.options.SMOOTH_BIOMES.tooltip.2= §oВкл§r - сглаженные цвета (медленнее) +of.options.SMOOTH_BIOMES.tooltip.3= Выкл - несглаженные цвета (быстрее) +of.options.SMOOTH_BIOMES.tooltip.4=Осуществляется путём выбора и усреднения значений +of.options.SMOOTH_BIOMES.tooltip.5=цветов всех окружающих блоков. +of.options.SMOOTH_BIOMES.tooltip.6=Влияет на цвет травы, листьев, лиан и воды. + +of.options.CONNECTED_TEXTURES=Соедин. текстур +of.options.CONNECTED_TEXTURES.tooltip.1=Соединение текстур +of.options.CONNECTED_TEXTURES.tooltip.2= §oВыкл§r - несоединённые текстуры +of.options.CONNECTED_TEXTURES.tooltip.3= Быстро - быстрое соединение +of.options.CONNECTED_TEXTURES.tooltip.4= Детально - качественное соединение +of.options.CONNECTED_TEXTURES.tooltip.5=Cоединяет текстуры (по умолчанию стекла, песчаника +of.options.CONNECTED_TEXTURES.tooltip.6=и книжных полок) друг с другом. +of.options.CONNECTED_TEXTURES.tooltip.7=Предоставляется пакетами ресурсов. +of.options.CONNECTED_TEXTURES.tooltip.8= + +of.options.NATURAL_TEXTURES=Естествен. текстуры +of.options.NATURAL_TEXTURES.tooltip.1=Естественные текстуры +of.options.NATURAL_TEXTURES.tooltip.2= §oВыкл§r - без естественных текстур +of.options.NATURAL_TEXTURES.tooltip.3= Вкл - использование естественных текстур +of.options.NATURAL_TEXTURES.tooltip.4=Убирает повторяющиеся текстуры блоков и вместо +of.options.NATURAL_TEXTURES.tooltip.5=них использует повёрнутые и отражённые варианты. +of.options.NATURAL_TEXTURES.tooltip.6=Предоставляются пакетами ресурсов. +of.options.NATURAL_TEXTURES.tooltip.7= +of.options.NATURAL_TEXTURES.tooltip.8= + +of.options.EMISSIVE_TEXTURES=Светящиеся текстуры +of.options.EMISSIVE_TEXTURES.tooltip.1=Светящиеся текстуры +of.options.EMISSIVE_TEXTURES.tooltip.2= §oВыкл§r - без светящихся текстур +of.options.EMISSIVE_TEXTURES.tooltip.3= Вкл - использование светящихся текстур +of.options.EMISSIVE_TEXTURES.tooltip.4=Светящиеся текстуры отображаются с полной яркостью. +of.options.EMISSIVE_TEXTURES.tooltip.5=Их можно использовать для имитации светоизлучения +of.options.EMISSIVE_TEXTURES.tooltip.6=частей основной текстуры. +of.options.EMISSIVE_TEXTURES.tooltip.7=Предоставляются пакетами ресурсов. +of.options.EMISSIVE_TEXTURES.tooltip.8= + +of.options.CUSTOM_SKY=Текстуры неба +of.options.CUSTOM_SKY.tooltip.1=Пользовательские текстуры неба +of.options.CUSTOM_SKY.tooltip.2= §oВкл§r - небо с пользовательскими текстурами +of.options.CUSTOM_SKY.tooltip.3= Выкл - стандартные текстуры неба (быстрее) +of.options.CUSTOM_SKY.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_SKY.tooltip.5= + +of.options.CUSTOM_ITEMS=Текстуры предметов +of.options.CUSTOM_ITEMS.tooltip.1=Пользовательские текстуры предметов +of.options.CUSTOM_ITEMS.tooltip.2= §oВкл§r - предметы с пользовательскими текстурами +of.options.CUSTOM_ITEMS.tooltip.3= Выкл - стандартные текстуры предметов (быстрее) +of.options.CUSTOM_ITEMS.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_ITEMS.tooltip.5= + +of.options.CUSTOM_ENTITY_MODELS=Модели сущностей +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Пользовательские модели сущностей +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= §oВкл§r - сущности с пользовательскими моделями +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Выкл - стандартные модели сущностей (быстрее) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_ENTITY_MODELS.tooltip.5= + +of.options.CUSTOM_GUIS=Интерфейс +of.options.CUSTOM_GUIS.tooltip.1=Пользовательский интерфейс +of.options.CUSTOM_GUIS.tooltip.2= §oВкл§r - пользовательский интерфейс +of.options.CUSTOM_GUIS.tooltip.3= Выкл - стандартный интерфейс (быстрее) +of.options.CUSTOM_GUIS.tooltip.4=Предоставляется пакетами ресурсов. + +# Элементы игры + +of.options.CLOUDS=Облака +of.options.CLOUDS.tooltip.1=Отображение облаков +of.options.CLOUDS.tooltip.2= §oПо умолчанию§r - согласно настройкам графики +of.options.CLOUDS.tooltip.3= Быстро - двухмерные облака (быстрее) +of.options.CLOUDS.tooltip.4= Детально - трёхмерные облака (медленнее) +of.options.CLOUDS.tooltip.5= Выкл - облака отключены (ещё быстрее) +of.options.CLOUDS.tooltip.6= +of.options.CLOUDS.tooltip.7= + +of.options.CLOUD_HEIGHT=Высота облаков +of.options.CLOUD_HEIGHT.tooltip.1=Высота облаков +of.options.CLOUD_HEIGHT.tooltip.2= §oВыкл§r - высота по умолчанию +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - над ограничением высоты мира + +of.options.TREES=Листья +of.options.TREES.tooltip.1=Отображение листьев +of.options.TREES.tooltip.2= §oПо умолчанию§r - согласно настройкам графики +of.options.TREES.tooltip.3= Быстро - непрозрачные листья (быстрее) +of.options.TREES.tooltip.4= Умно - прозрачные листья без текстур между ними +of.options.TREES.tooltip.5= Детально - прозрачные листья (медленнее) +of.options.TREES.tooltip.6= +of.options.TREES.tooltip.7= + +of.options.RAIN=Дождь и снег +of.options.RAIN.tooltip.1=Отображение дождя и снега +of.options.RAIN.tooltip.2= §oПо умолчанию§r - согласно настройкам графики +of.options.RAIN.tooltip.3= Быстро - лёгкий дождь/снег (быстрее) +of.options.RAIN.tooltip.4= Детально - сильный дождь/снег (медленнее) +of.options.RAIN.tooltip.5= Выкл - без дождя/снега (ещё быстрее) +of.options.RAIN.tooltip.6=Не влияет на брызги и звуки дождя. +of.options.RAIN.tooltip.7= + +of.options.SKY=Небо +of.options.SKY.tooltip.1=Отображение неба +of.options.SKY.tooltip.2= §oВкл§r - небо видно (медленнее) +of.options.SKY.tooltip.3= Выкл - небо не видно (быстрее) +of.options.SKY.tooltip.4=Не влияет на солнце и луну. + +of.options.STARS=Звёзды +of.options.STARS.tooltip.1=Отображение звёзд +of.options.STARS.tooltip.2= §oВкл§r - звёзды видны (медленнее) +of.options.STARS.tooltip.3= Выкл - звёзды не видны (быстрее) + +of.options.SUN_MOON=Солнце и луна +of.options.SUN_MOON.tooltip.1=Отображение солнца и луны +of.options.SUN_MOON.tooltip.2= §oВкл§r - солнце и луна видны +of.options.SUN_MOON.tooltip.3= Выкл - солнце и луна не видны (быстрее) + +of.options.SHOW_CAPES=Плащи +of.options.SHOW_CAPES.tooltip.1=Отображение плащей игроков +of.options.SHOW_CAPES.tooltip.2= §oВкл§r - плащи видны +of.options.SHOW_CAPES.tooltip.3= Выкл - плащи не видны + +of.options.FOG_FANCY=Туман +of.options.FOG_FANCY.tooltip.1=Тип тумана +of.options.FOG_FANCY.tooltip.2= Быстро - быстрый туман +of.options.FOG_FANCY.tooltip.3= Детально - густой туман +of.options.FOG_FANCY.tooltip.4= Выкл - туман отключён (быстрее) +of.options.FOG_FANCY.tooltip.5=Густой туман должен поддерживаться видеокартой. +of.options.FOG_FANCY.tooltip.6= + +of.options.FOG_START=Удалённость тумана +of.options.FOG_START.tooltip.1=Удалённость тумана +of.options.FOG_START.tooltip.2= 0.2 - начало тумана рядом с игроком +of.options.FOG_START.tooltip.3= 0.8 - начало тумана вдали от игрока +of.options.FOG_START.tooltip.4=Обычно не влияет на производительность. + +of.options.TRANSLUCENT_BLOCKS=Прозрачность +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Прозрачность блоков +of.options.TRANSLUCENT_BLOCKS.tooltip.2= §oПо умолчанию§r - согласно настройкам графики +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Детально - правильное смешивание (медленнее) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Быстро - быстрое смешивание (быстрее) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Управляет смешиванием цветов прозрачных блоков +of.options.TRANSLUCENT_BLOCKS.tooltip.6=разного цвета (стекло, вода, лёд), размещённых друг +of.options.TRANSLUCENT_BLOCKS.tooltip.7=за другом с воздухом между ними. + +of.options.HELD_ITEM_TOOLTIPS=Подсказка о предмете +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Всплывающая подсказка об удерживаемом предмете. +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= §oВкл§r - показывать всплывающую подсказку +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Выкл - не показывать всплывающую подсказку + +of.options.DROPPED_ITEMS=Предметы +of.options.DROPPED_ITEMS.tooltip.1=Отображение выкинутых предметов +of.options.DROPPED_ITEMS.tooltip.2= §oПо умолчанию§r - согласно настройкам графики +of.options.DROPPED_ITEMS.tooltip.3= Быстро - двухмерные предметы (быстрее) +of.options.DROPPED_ITEMS.tooltip.4= Детально - трёхмерные предметы (медленнее) + +options.entityShadows.tooltip.1=Тени сущностей +options.entityShadows.tooltip.2= Вкл - тени сущностей видны +options.entityShadows.tooltip.3= Выкл - тени сущностей не видны + +of.options.VIGNETTE=Виньетка +of.options.VIGNETTE.tooltip.1=Виньетирование +of.options.VIGNETTE.tooltip.2= §oПо умолчанию§r - согласно настройкам графики +of.options.VIGNETTE.tooltip.3= Быстро - виньетирование отключено (быстрее) +of.options.VIGNETTE.tooltip.4= Детально - виньетирование включено (медленнее) +of.options.VIGNETTE.tooltip.5=Слегка затемняет края экрана. +of.options.VIGNETTE.tooltip.6=Может оказывать значительное влияние на частоту +of.options.VIGNETTE.tooltip.7=кадров, особенно при игре в полноэкранном режиме. +of.options.VIGNETTE.tooltip.8= + +of.options.ALTERNATE_BLOCKS=Альтернативные блоки +of.options.ALTERNATE_BLOCKS.tooltip.1=Альтернативные модели блоков +of.options.ALTERNATE_BLOCKS.tooltip.2=Использует альтернативные модели блоков. +of.options.ALTERNATE_BLOCKS.tooltip.3=Зависит от выбранного пакета ресурсов. + +# Производительность + +of.options.SMOOTH_FPS=Стабилизизация FPS +of.options.SMOOTH_FPS.tooltip.1=Стабилизизация частоты кадров +of.options.SMOOTH_FPS.tooltip.2= Выкл - частота кадров может колебаться +of.options.SMOOTH_FPS.tooltip.3= Вкл - частота кадров стабилизируется +of.options.SMOOTH_FPS.tooltip.4=Стабилизирует частоту кадров посредством очистки +of.options.SMOOTH_FPS.tooltip.5=буфера видеокарты. Зависит от видеодрайвера; +of.options.SMOOTH_FPS.tooltip.6=результат стабилизации не всегда виден. + +of.options.SMOOTH_WORLD=Стабилизация мира +of.options.SMOOTH_WORLD.tooltip.1=Стабилизация мира +of.options.SMOOTH_WORLD.tooltip.2= Выкл - частота кадров может колебаться +of.options.SMOOTH_WORLD.tooltip.3= Вкл - частота кадров стабилизируется +of.options.SMOOTH_WORLD.tooltip.4=Убирает задержки, созданные внутренним сервером. +of.options.SMOOTH_WORLD.tooltip.5=Распределяет нагрузку на внутренний сервер. +of.options.SMOOTH_WORLD.tooltip.6=Действует только в локальных мирах (одиночная игра). + +of.options.FAST_RENDER=Быстрый рендер +of.options.FAST_RENDER.tooltip.1=Быстрый рендеринг +of.options.FAST_RENDER.tooltip.2= §oВыкл§r - стандартный рендеринг +of.options.FAST_RENDER.tooltip.3= Вкл - оптимизированный рендеринг (быстрее) +of.options.FAST_RENDER.tooltip.4=Использует оптимизированный алгоритм рендеринга, +of.options.FAST_RENDER.tooltip.5=который уменьшает нагрузку на ГП и может существенно +of.options.FAST_RENDER.tooltip.6=повысить частоту кадров. +of.options.FAST_RENDER.tooltip.7=Может конфликтовать с некоторыми модификациями. + +of.options.FAST_MATH=Быстрое вычисление +of.options.FAST_MATH.tooltip.1=Быстрое вычисление +of.options.FAST_MATH.tooltip.2= §oВыкл§r - стандартное вычисление +of.options.FAST_MATH.tooltip.3= Вкл - быстрое вычисление +of.options.FAST_MATH.tooltip.4=Использует оптимизированные функции sin() и cos(), +of.options.FAST_MATH.tooltip.5=из-за чего появляется возможность лучше использовать +of.options.FAST_MATH.tooltip.6=кэш процессора и повысить частоту кадров. +of.options.FAST_MATH.tooltip.7=Может слегка влиять на генерацию мира. + +of.options.CHUNK_UPDATES=Обновление чанков +of.options.CHUNK_UPDATES.tooltip.1=Частота обновления чанков +of.options.CHUNK_UPDATES.tooltip.2= §o1§r - стандартная загрузка мира (высокая частота кадров) +of.options.CHUNK_UPDATES.tooltip.3= 3 - быстрая загрузка мира (пониженная частота кадров) +of.options.CHUNK_UPDATES.tooltip.4= 5 - быстрейшая загрузка мира (низкая частота кадров) +of.options.CHUNK_UPDATES.tooltip.5=Количество обновлений чанков за один кадр. +of.options.CHUNK_UPDATES.tooltip.6=Высокие значения могут дестабилизировать частоту кадров. + +of.options.CHUNK_UPDATES_DYNAMIC=Динамич. обновление +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Динамическое обновление чанков +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= §oВыкл§r - стандартное обновление чанков +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Вкл - динамическое обновление чанков +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Когда игрок стоит на месте, чанки обновляются чаще +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=для того, чтобы мир загрузился быстрее. + +of.options.LAZY_CHUNK_LOADING=Медленные чанки +of.options.LAZY_CHUNK_LOADING.tooltip.1=Медленная загрузка чанков +of.options.LAZY_CHUNK_LOADING.tooltip.2= §oВыкл§r - стандартная загрузка чанков сервера +of.options.LAZY_CHUNK_LOADING.tooltip.3= Вкл - медленная загрузка чанков сервера (плавнее) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Стабилизирует загрузку чанков внутреннего сервера, +of.options.LAZY_CHUNK_LOADING.tooltip.5=распределяя её на несколько тактов. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Выключите, если части мира загружаются некорректно. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Действует только в локальных мирах (одиночная игра). + +of.options.RENDER_REGIONS=Области рендеринга +of.options.RENDER_REGIONS.tooltip.1=Области рендеринга +of.options.RENDER_REGIONS.tooltip.2= §oВыкл§r - не использовать области рендеринга +of.options.RENDER_REGIONS.tooltip.3= Вкл - использовать области рендеринга +of.options.RENDER_REGIONS.tooltip.4=Позволяют ускорить рендеринг местности на высокой +of.options.RENDER_REGIONS.tooltip.5=дальности прорисовки. Эффективнее с включённым VBO. +of.options.RENDER_REGIONS.tooltip.6=Не рекомендуется использовать с встроенной видеокартой. + +of.options.SMART_ANIMATIONS=Умные анимации +of.options.SMART_ANIMATIONS.tooltip.1=Умные анимации +of.options.SMART_ANIMATIONS.tooltip.2= §oВыкл§r - не использовать умные анимации +of.options.SMART_ANIMATIONS.tooltip.3= Вкл - использовать умные анимации +of.options.SMART_ANIMATIONS.tooltip.4=Анимирует только текстуры, которые видны на экране, +of.options.SMART_ANIMATIONS.tooltip.5=что уменьшает число зависаний и увеличивает FPS. +of.options.SMART_ANIMATIONS.tooltip.6=Особенно полезно для больших наборов модов и +of.options.SMART_ANIMATIONS.tooltip.7=пакетов ресурсов с текстурами HD-качества. + +# Анимация + +of.options.animation.allOn=Включить всё +of.options.animation.allOff=Выключить всё +of.options.animation.dynamic=Динамическая + +of.options.ANIMATED_WATER=Анимация воды +of.options.ANIMATED_LAVA=Анимация лавы +of.options.ANIMATED_FIRE=Анимация огня +of.options.ANIMATED_PORTAL=Анимация портала +of.options.ANIMATED_REDSTONE=Анимация редстоуна +of.options.ANIMATED_EXPLOSION=Анимация взрыва +of.options.ANIMATED_FLAME=Анимация пламени +of.options.ANIMATED_SMOKE=Анимация дыма +of.options.VOID_PARTICLES=Частицы пустоты +of.options.WATER_PARTICLES=Частицы воды +of.options.RAIN_SPLASH=Брызги дождя +of.options.PORTAL_PARTICLES=Частицы портала +of.options.POTION_PARTICLES=Частицы зелий +of.options.DRIPPING_WATER_LAVA=Капающая вода/лава +of.options.ANIMATED_TERRAIN=Анимация местности +of.options.ANIMATED_TEXTURES=Анимация текстур +of.options.FIREWORK_PARTICLES=Частицы фейерверков + +# Прочее + +of.options.LAGOMETER=Лагометр +of.options.LAGOMETER.tooltip.1=Показывает лагометр на экране отладки (F3). +of.options.LAGOMETER.tooltip.2=* §4Красный§r - обновление чанков +of.options.LAGOMETER.tooltip.3=* §6Оранжевый§r - сборщик мусора памяти +of.options.LAGOMETER.tooltip.4=* §eЖёлтый§r - проверка видимости +of.options.LAGOMETER.tooltip.5=* §aЗелёный§r - рендеринг местности +of.options.LAGOMETER.tooltip.6=* §bГолубой§r - такт +of.options.LAGOMETER.tooltip.7=* §9Синий§r - запланированные исполняемые файлы +of.options.LAGOMETER.tooltip.8=* §5Фиолетовый§r - загрузка чанков + +of.options.PROFILER=Профайлер +of.options.PROFILER.tooltip.1=Отладочный профайлер +of.options.PROFILER.tooltip.2= Вкл - профайлер активен (медленнее) +of.options.PROFILER.tooltip.3= Выкл - профайлер неактивен (быстрее) +of.options.PROFILER.tooltip.4=Собирает и показывает дополнительную информацию на +of.options.PROFILER.tooltip.5=экране отладки (F3). + +of.options.SHOW_FPS=Отображение FPS +of.options.SHOW_FPS.tooltip.1=Отображение компактной информации о рендере +of.options.SHOW_FPS.tooltip.2= #/# fps - среднее/минимальное число FPS +of.options.SHOW_FPS.tooltip.3= C: - отображаемые чанки +of.options.SHOW_FPS.tooltip.4= E: - отображаемые сущности + блоки-сущности +of.options.SHOW_FPS.tooltip.5= U: - обновление чанка +of.options.SHOW_FPS.tooltip.6=Отображает компактную информацию о рендере, когда +of.options.SHOW_FPS.tooltip.7=отключён экран отладки. + +of.options.ADVANCED_TOOLTIPS=Расширен. подсказки +of.options.ADVANCED_TOOLTIPS.tooltip.1=Расширенные подсказки +of.options.ADVANCED_TOOLTIPS.tooltip.2= Вкл - дополнительная информация включена +of.options.ADVANCED_TOOLTIPS.tooltip.3= §oВыкл§r - дополнительная информация отключена +of.options.ADVANCED_TOOLTIPS.tooltip.4=Показывает дополнительную информацию о предметах +of.options.ADVANCED_TOOLTIPS.tooltip.5=и о параметрах шейдеров (ID, файл и т. д.). +of.options.ADVANCED_TOOLTIPS.tooltip.6= + +of.options.WEATHER=Погода +of.options.WEATHER.tooltip.1=Погода +of.options.WEATHER.tooltip.2= Вкл - погода активна (медленнее) +of.options.WEATHER.tooltip.3= Выкл - погода неактивна (быстрее) +of.options.WEATHER.tooltip.4=Контролирует дождь, снег и грозу. +of.options.WEATHER.tooltip.5=Действует только в локальных мирах. + +of.options.TIME=Время суток +of.options.TIME.tooltip.1=Время суток +of.options.TIME.tooltip.2= §oПо умолчанию§r - нормальный цикл дня и ночи +of.options.TIME.tooltip.3= Всегда день - только дневное время +of.options.TIME.tooltip.4= Всегда ночь - только ночное время +of.options.TIME.tooltip.5=Действует только в ТВОРЧЕСКОМ режиме игры и только +of.options.TIME.tooltip.6=в локальных мирах. + +of.options.time.dayOnly=Всегда день +of.options.time.nightOnly=Всегда ночь + +options.fullscreen.tooltip.1=Полноэкранный режим +options.fullscreen.tooltip.2= Вкл - использовать полноэкранный режим +options.fullscreen.tooltip.3= Выкл - использовать оконный режим +options.fullscreen.tooltip.4=Полноэкранный режим может быть как производительнее +options.fullscreen.tooltip.5=оконного, так и нет — всё зависит от видеокарты. + +of.options.FULLSCREEN_MODE=Разрешение +of.options.FULLSCREEN_MODE.tooltip.1=Разрешение экрана в полноэкранном режиме +of.options.FULLSCREEN_MODE.tooltip.2= §oПо умолчанию§r - разрешение рабочего стола (медленнее) +of.options.FULLSCREEN_MODE.tooltip.3= ШxВ - выбранное разрешение (возможно быстрее) +of.options.FULLSCREEN_MODE.tooltip.4=Выбранное разрешение используется в полноэкранном +of.options.FULLSCREEN_MODE.tooltip.5=режиме (F11). Чем меньше значение, тем быстрее. + +options.anaglyph.tooltip.1=Анаглиф +options.anaglyph.tooltip.2=Стереоизображение, использующее различные цвета +options.anaglyph.tooltip.3=для каждого глаза. +options.anaglyph.tooltip.4=Для просмотра потребуются анаглифические очки. + +of.options.AUTOSAVE_TICKS=Автосохранение +of.options.AUTOSAVE_TICKS.tooltip.1=Интервал автосохранений +of.options.AUTOSAVE_TICKS.tooltip.2= §o45 секунд§r - значение по умолчанию +of.options.AUTOSAVE_TICKS.tooltip.3=Может создавать кратковременные зависания. +of.options.AUTOSAVE_TICKS.tooltip.4=Мир также сохраняется при открытии меню. + +of.options.save.45s=45 секунд +of.options.save.90s=90 секунд +of.options.save.3min=3 минуты +of.options.save.6min=6 минут +of.options.save.12min=12 минут +of.options.save.24min=24 минуты + +of.options.SCREENSHOT_SIZE=Скриншот +of.options.SCREENSHOT_SIZE.tooltip.1=Разрешение скриншота +of.options.SCREENSHOT_SIZE.tooltip.2= §oПо умолчанию§r - стандартное разрешение скриншота +of.options.SCREENSHOT_SIZE.tooltip.3= 2x–4x - множитель разрешения скриншота +of.options.SCREENSHOT_SIZE.tooltip.4=Чем больше значение, тем больше потребуется памяти. +of.options.SCREENSHOT_SIZE.tooltip.5=Необходима поддержка кадрового буфера ГП. +of.options.SCREENSHOT_SIZE.tooltip.6=Не совместимо с быстрым рендером и антиалиасингом. + +of.options.SHOW_GL_ERRORS=Показывать ошибки GL +of.options.SHOW_GL_ERRORS.tooltip.1=Отображение ошибок OpenGL +of.options.SHOW_GL_ERRORS.tooltip.2=Отправляет информацию об ошибках OpenGL в чат. +of.options.SHOW_GL_ERRORS.tooltip.3=Отключите, только если ошибка известна и её нельзя +of.options.SHOW_GL_ERRORS.tooltip.4=исправить. +of.options.SHOW_GL_ERRORS.tooltip.5=В отключённом состоянии ошибки по-прежнему будут +of.options.SHOW_GL_ERRORS.tooltip.6=записываться в журнал и могут значительно понижать FPS. + +# Настройки чата + +of.options.CHAT_BACKGROUND=Фон чата +of.options.CHAT_BACKGROUND.tooltip.1=Фон чата +of.options.CHAT_BACKGROUND.tooltip.2= §oПо умолчанию§r - фиксированная ширина чата +of.options.CHAT_BACKGROUND.tooltip.3= Компактный - ширина чата равна длине строки +of.options.CHAT_BACKGROUND.tooltip.4= Выкл - фон скрыт + +of.options.CHAT_SHADOW=Тень текста чата +of.options.CHAT_SHADOW.tooltip.1=Тень текста чата +of.options.CHAT_SHADOW.tooltip.2= §oВкл§r - тень видна +of.options.CHAT_SHADOW.tooltip.3= Выкл - тень скрыта diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/sk_SK.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/sk_SK.lang new file mode 100644 index 0000000..cbfad05 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/sk_SK.lang @@ -0,0 +1,745 @@ +# General +of.general.ambiguous=neurčité +of.general.compact=Kompaktné +of.general.custom=Vlastné +of.general.from=Od +of.general.id=ID +of.general.max=Maximálne +of.general.restart=reštart +of.general.smart=Chytré + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing nie je kompatibilný s tieňovačmi (Shaders). +of.message.aa.shaders2=Vypni tieňovače pre odomknutie tejto možnosti. + +of.message.af.shaders1=Anizotropné filtrovanie nie je kompatibilné s tieňovačmi (Shaders). +of.message.af.shaders2=Vypni tieňovače pre odomknutie tejto možnosti. + +of.message.fr.shaders1=Rýchle vykresľovanie nie je kompatibilné s tieňovačmi (Shaders). +of.message.fr.shaders2=Vypni tieňovače pre odomknutie tejto možnosti. + +of.message.an.shaders1=3D Anaglyf režim nie je kompatibilný s tieňovačmi (Shaders). +of.message.an.shaders2=Vypni tieňovače pre odomknutie tejto možnosti. + +of.message.shaders.aa1=Tieňovače nie sú kompatibilné s antialiasingom. +of.message.shaders.aa2=Nastav Kvalita -> Antialiasing na VYP a reštartuj hru. + +of.message.shaders.af1=Tieňovače nie sú kompatibilné s anizotropným filtrovaním. +of.message.shaders.af2=Nastav Kvalita -> Anizotropné filtrovanie na VYP a reštartuj hru. + +of.message.shaders.fr1=Tieňovače nie sú kompatibilné s rýchlym vykresľovaním. +of.message.shaders.fr2=Nastav Výkon -> Rýchle vykresľovanie na VYP a reštartuj hru. + +of.message.shaders.an1=Tieňovače nie sú kompatibilné s 3D anaglyf režimom. +of.message.shaders.an2=Nastav Iné -> 3D Anaglyf režim na VYP a reštartuj hru. + +of.message.shaders.nv1=Tento balík tieňovačov vyžaduje novšiu verziu OptiFine: %s +of.message.shaders.nv2=Si si istý že chceš pokračovať? + +of.message.newVersion=Je dostupná nová verzia §eOptiFine§f: §e%s§f +of.message.java64Bit=Môžeš nainštalovať §e64-bit Java§f pre zlepšenie výkonu. +of.message.openglError=§eChyba OpenGL§f: %s (%s) + +of.message.shaders.loading=Načítavajú sa tieňovače: %s + +of.message.other.reset=Obnoviť všetky nastavenia obrazu na pôvodné hodnoty? + +of.message.loadingVisibleChunks=Načítavajú sa viditeľné chunky + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine plášť... + +of.options.capeOF.title=OptiFine plášť +of.options.capeOF.openEditor=Otvoriť editor plášťa +of.options.capeOF.reloadCape=Znova načítať plášť + +of.message.capeOF.openEditor=Editor OptiFine plášťa sa otvorí vo webovom prehliadači. +of.message.capeOF.reloadCape=Plášť bude načítaný do 15 sekúnd. + +of.message.capeOF.error1=Overenie Mojang zlyhalo. +of.message.capeOF.error2=Chyba: %s + +# Video settings + +options.graphics.tooltip.1=Kvalita obrazu +options.graphics.tooltip.2= Rýchla - nižšia kvalia, rýchlejšia +options.graphics.tooltip.3= Pekná - vyššia kvalita, pomalšia +options.graphics.tooltip.4=Mení vzhľad oblakov, listov, vody, +options.graphics.tooltip.5=tieňov a trávy. + +of.options.renderDistance.tiny=Drobná +of.options.renderDistance.short=Krátka +of.options.renderDistance.normal=Normálna +of.options.renderDistance.far=Ďaleká +of.options.renderDistance.extreme=Extrémna +of.options.renderDistance.insane=Šialená +of.options.renderDistance.ludicrous=Absurdná + +options.renderDistance.tooltip.1=Dohľadnosť (vzdialenosť vykresľovania) +options.renderDistance.tooltip.2= 2 Drobná - 32m (najrýchlejšia) +options.renderDistance.tooltip.3= 8 Normálna - 128m (normálna) +options.renderDistance.tooltip.4= 16 Ďaleká - 256m (pomalšia) +options.renderDistance.tooltip.5= 32 Extrémna - 512m (najpomalšia!) veľmi náročná na výkon +options.renderDistance.tooltip.6= 48 Šialená - 768m, potrebuje 2GB alokovanej RAM +options.renderDistance.tooltip.7= 64 Absurdná - 1024m, potrebuje 3GB alokovanej RAM +options.renderDistance.tooltip.8=Hodnoty nad 16 sú funkčné len pre lokálne svety. + +options.ao.tooltip.1=Vyhladené osvetlenie +options.ao.tooltip.2= VYP - žiadne vyhladené osvetlenie (rýchlejšie) +options.ao.tooltip.3= Minimálne - jednoduché vyhladené osvetlenie (pomalšie) +options.ao.tooltip.4= Maximálne - complex vyhladené osvetlenie (najpomalšie) + +options.framerateLimit.tooltip.1=Najvyššia rýchlosť snímok (FPS) +options.framerateLimit.tooltip.2= VSync - obmedzená na frekvenciu monitora (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variabilná +options.framerateLimit.tooltip.4= Neobmedzená - žiadny limit (najrýchlejšia) +options.framerateLimit.tooltip.5=Limit rýchlosti snímok znižuje FPS aj keď +options.framerateLimit.tooltip.6=hraničná hodnota nie je dosiahnutá. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Vyhladené osvetlenie +of.options.AO_LEVEL.tooltip.1=Úroveň vyhladeného osvetlenia +of.options.AO_LEVEL.tooltip.2= VYP - žiadne tiene +of.options.AO_LEVEL.tooltip.3= 50%% - svetlé tiene +of.options.AO_LEVEL.tooltip.4= 100%% - tmavé tiene + +options.viewBobbing.tooltip.1=Realistickejší pohyb. +options.viewBobbing.tooltip.2=Pre najlepšie výsledky pri použití MIP máp nastav na VYP. + +options.guiScale.tooltip.1=Veľkosť grafického rozhrania (GUI) +options.guiScale.tooltip.2= Auto - najväčšie +options.guiScale.tooltip.3= Malé, Normálne, Veľké - 1x až 3x +options.guiScale.tooltip.4= 4x až 10x - dostupné pre 4K obrazovky +options.guiScale.tooltip.5=Nepárne hodnoty (1x, 3x, 5x ...) nie sú kompatibilné s Unicode. +options.guiScale.tooltip.6=Menšie GUI môže byť rýchlejšie. + +options.vbo=Používať VBO +options.vbo.tooltip.1=Objekty medzipamňte vrcholov (VBO) +options.vbo.tooltip.2=Používa alternatívnu metódu vykresľovania, ktorá je bežne +options.vbo.tooltip.3=rýchlejšia (5-10%%) než štandardné vykresľovanie. + +options.gamma.tooltip.1=Mení jas tmavých objektov. +options.gamma.tooltip.2= Prítmie - štandardný jas +options.gamma.tooltip.3= 1-99%% - variabilný +options.gamma.tooltip.4= Jasný - najvyšší jas pre tmavé objekty +options.gamma.tooltip.5=Toto nastavenie nemení jas +options.gamma.tooltip.6=úplne čiernych objektov. + +options.anaglyph.tooltip.1=3D Anaglyf režim +options.anaglyph.tooltip.2=Zapne stereoskopický 3D efekt pomocou rôznych farieb +options.anaglyph.tooltip.3=pre každé oko. +options.anaglyph.tooltip.4=Vyžaduje červeno-tyrkysové 3D okuliare. + +of.options.ALTERNATE_BLOCKS=Rozličné kocky +of.options.ALTERNATE_BLOCKS.tooltip.1=Rozličné kocky +of.options.ALTERNATE_BLOCKS.tooltip.2=Používa rozličné modely kociek pre niektoré kocky. +of.options.ALTERNATE_BLOCKS.tooltip.3=Závisí od zvoleného zdrojového balíka. + +of.options.FOG_FANCY=Hmla +of.options.FOG_FANCY.tooltip.1=Typ hmly +of.options.FOG_FANCY.tooltip.2= Rýchla - rýchlejšia hmla +of.options.FOG_FANCY.tooltip.3= Pekná - pomalšia hmla, vyzerá lepšie +of.options.FOG_FANCY.tooltip.4= VYP - žiadna hmla, najrýchlejšie +of.options.FOG_FANCY.tooltip.5=Pekná hmla je dostupná len ak je podporovaná +of.options.FOG_FANCY.tooltip.6=grafickou kartou. + +of.options.FOG_START=Hranica hmly +of.options.FOG_START.tooltip.1=Hranica hmly +of.options.FOG_START.tooltip.2= 0.2 - hmla začína bližšie k hráčovi +of.options.FOG_START.tooltip.3= 0.8 - hmla začína ďalej od hráča +of.options.FOG_START.tooltip.4=Toto nastavenie bežne nemá vplyv na výkon. + +of.options.CHUNK_LOADING=Načítavanie chunkov +of.options.CHUNK_LOADING.tooltip.1=Načítavanie chunkov +of.options.CHUNK_LOADING.tooltip.2= Štandardné - nestále FPS pri načítavaní chunkov +of.options.CHUNK_LOADING.tooltip.3= Vyhladené - stabilné FPS +of.options.CHUNK_LOADING.tooltip.4= Viacjadrové - stabilné FPS, 3x rýchlejšie načítavanie sveta +of.options.CHUNK_LOADING.tooltip.5=Vyhladené a Viacjadrové odstraňujú trhavosť +of.options.CHUNK_LOADING.tooltip.6=a zamŕzanie spôsobené načitavaním chunkov. +of.options.CHUNK_LOADING.tooltip.7=Viacjadrové môže načítavanie sveta urýchliť až 3x +of.options.CHUNK_LOADING.tooltip.8=a zvýšiť FPS využitím ďalších jadier procesora. +of.options.chunkLoading.smooth=Vyhladené +of.options.chunkLoading.multiCore=Viacjadrové + +of.options.shaders=Tieňovače... +of.options.shadersTitle=Tieňovače (Shaders) + +of.options.shaders.packNone=VYP +of.options.shaders.packDefault=(interný) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= VYP - (štandard) žiadne vyhladzovanie (rýchlejšie) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - vyhladené línie a hrany (pomalšie) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA je efekt následného spracovania, ktorý vyhladzuje +of.options.shaders.ANTIALIASING.tooltip.5=zúbkované línie a ostré prechody farieb. +of.options.shaders.ANTIALIASING.tooltip.6=Je rýchlejší než tradičné vyhladzovanie +of.options.shaders.ANTIALIASING.tooltip.7=a je kompatibilné s tieňovačmi a Rýchlym vykresľovaním. + +of.options.shaders.NORMAL_MAP=Normálna mapa +of.options.shaders.NORMAL_MAP.tooltip.1=Normálna mapa +of.options.shaders.NORMAL_MAP.tooltip.2= ZAP - (štandard) zapnúť normálnu mapu +of.options.shaders.NORMAL_MAP.tooltip.3= VYP - vypnúť normálnu mapu +of.options.shaders.NORMAL_MAP.tooltip.4=Normálnu mapu môže použiť balík tieňovačov +of.options.shaders.NORMAL_MAP.tooltip.5=na simuláciu 3D geometrie na hladkých plochách. +of.options.shaders.NORMAL_MAP.tooltip.6=Textúry normálnej mapy závisia od +of.options.shaders.NORMAL_MAP.tooltip.7=zvoleného zdrojového balíka. + +of.options.shaders.SPECULAR_MAP=Zrkadlová mapa +of.options.shaders.SPECULAR_MAP.tooltip.1=Zrkadlová mapa +of.options.shaders.SPECULAR_MAP.tooltip.2= ZAP - (štandard) zapnúť zrkadlovú mapu +of.options.shaders.SPECULAR_MAP.tooltip.3= VYP - vypnúť zrkadlovú mapu +of.options.shaders.SPECULAR_MAP.tooltip.4=Zrkadlovú mapu môže použiť balík tieňovačov +of.options.shaders.SPECULAR_MAP.tooltip.5=na simuláciu špeciálnych efekov odrazu. +of.options.shaders.SPECULAR_MAP.tooltip.6=Textúry zrkadlovej mapy závisia od +of.options.shaders.SPECULAR_MAP.tooltip.7=zvoleného zdrojového balíka. + +of.options.shaders.RENDER_RES_MUL=Kvalita vykresľovania +of.options.shaders.RENDER_RES_MUL.tooltip.1=Kvalita vykresľovania +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - nízka (najrýchlejšia) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - normálna (štandard) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - vysoká (najpomalšia) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Kvalita vykresľovania reguluje veľkosť textúr +of.options.shaders.RENDER_RES_MUL.tooltip.6=na ktoré vykresľuje balík tieňovačov. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Nižšie hodnoty môžu byť vhodné pre 4K obrazovky. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Vyššie hodnoty fungujú ako vyhladzovací filter. + +of.options.shaders.SHADOW_RES_MUL=Kvalita tieňov +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Kvalita tieňov +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - nízka (najrýchlejšia) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - normálna (štandardná) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - vysoká (najpomalšia) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Kvalita tieňov reguluje veľkosť textúry tieňovej mapy +of.options.shaders.SHADOW_RES_MUL.tooltip.6=ktorú používa balík tieňovačov. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Nižšie hodnoty = nepresné, hrubšie tiene. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Vyššie hodnoty = detailné, jemnejšie tiene. + +of.options.shaders.HAND_DEPTH_MUL=Hĺbka ruky +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Hĺbka ruky +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - ruka bližšie ku kamere +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (štandard) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - ruka ďalej od kamery +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Hĺbka ruky reguluje vzdialenosť predmetov +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=v ruke od kamery. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Pre balíky tieňovačov používajúce rozmazanie podľa +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=hĺbky toto nastavenie mení hĺbku rozmazania. + +of.options.shaders.CLOUD_SHADOW=Tiene oblakov + +of.options.shaders.OLD_HAND_LIGHT=Staré svetlo ruky +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Staré svetlo ruky +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Štandard - regulované balíkom tieňovačov +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= ZAP - použiť staré svetlo ruky +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= VYP - použiť nové svetlo ruky +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Staré svetlo ruky umožňuje balíku tieňovačov, ktoré +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=rozoznávajú len svetlo z hlavnej ruky, +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=aby použili svetlo aj z druhej ruky. + +of.options.shaders.OLD_LIGHTING=Staré osvetlenie +of.options.shaders.OLD_LIGHTING.tooltip.1=Staré osvetlenie +of.options.shaders.OLD_LIGHTING.tooltip.2= Štandard - regulované balíkom tieňovačov +of.options.shaders.OLD_LIGHTING.tooltip.3= ZAP - použiť staré osvetlenie +of.options.shaders.OLD_LIGHTING.tooltip.4= VYP - nepoužiť staré osvetlenie +of.options.shaders.OLD_LIGHTING.tooltip.5=Staré osvetlenie reguluje pevné osvetlenie +of.options.shaders.OLD_LIGHTING.tooltip.6=strán blokov podľa na vanilla spôsob. +of.options.shaders.OLD_LIGHTING.tooltip.7=Balíky tieňovačov, ktoré používajú tiene zväčša poskytujú +of.options.shaders.OLD_LIGHTING.tooltip.8=oveľa lepšie osvetlenie na základe polohy slnka. + +of.options.shaders.DOWNLOAD=Stiahnuť tieňovače +of.options.shaders.DOWNLOAD.tooltip.1=Stiahnuť tieňovače +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Otvorí stránku s balíkmi tieňovačov v prehliadači. +of.options.shaders.DOWNLOAD.tooltip.4=Stiahnuté balíky ulož do "Priečinka tieňovačov" +of.options.shaders.DOWNLOAD.tooltip.5=a ony sa zobrazia v zozname nainštalovaných tieňovačov. + +of.options.shaders.SHADER_PACK=Balík tieňovačov + +of.options.shaders.shadersFolder=Priečinok tieňovačov +of.options.shaders.shaderOptions=Možnosti tieňovača... + +of.options.shaderOptionsTitle=Možnosti tieňovača + +of.options.quality=Kvalita... +of.options.qualityTitle=Nastavenia kvality + +of.options.details=Detaily... +of.options.detailsTitle=Nastavenia detailov + +of.options.performance=Výkon... +of.options.performanceTitle=Nastavenia výkonu + +of.options.animations=Animácie... +of.options.animationsTitle=Nastavenia animácií + +of.options.other=Iné... +of.options.otherTitle=Iné nastavenia + +of.options.other.reset=Obnoviť nastavenia obrazu... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilineárna +of.options.mipmap.linear=Lineárna +of.options.mipmap.nearest=Najbližšia +of.options.mipmap.trilinear=Trilineárna + +options.mipmapLevels.tooltip.1=Efekt, ktorý zlepšuje vzhľad vzdialených objektov +options.mipmapLevels.tooltip.2=vyhladzovaním detailov ich textúr. +options.mipmapLevels.tooltip.3= VYP - žiadne vyhladzovanie +options.mipmapLevels.tooltip.4= 1 - minimálne vyhladzovanie +options.mipmapLevels.tooltip.5= 4 - maximálne vyhladzovanie +options.mipmapLevels.tooltip.6=Toto nastavenie bežne nemá vplyv na výkon. + +of.options.MIPMAP_TYPE=Typ MIP mapy +of.options.MIPMAP_TYPE.tooltip.1=Efekt, ktorý zlepšuje vzhľad vzdialených objektov +of.options.MIPMAP_TYPE.tooltip.2=vyhladzovaním detailov ich textúr. +of.options.MIPMAP_TYPE.tooltip.3= Najbližšia - hrubé vyhladzovanie (najrýchlejšie) +of.options.MIPMAP_TYPE.tooltip.4= Lineárna - normálne vyhladzovanie +of.options.MIPMAP_TYPE.tooltip.5= Bilineárna - jemné vyhladzovanie +of.options.MIPMAP_TYPE.tooltip.6= Trilineárna - najjemnejšie vyhladzovanie (najpomalšie) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing (vyhladzovanie okrajov) +of.options.AA_LEVEL.tooltip.2= VYP - (štandard) žiadne vyhladzovanie okrajov (rýchlejšie) +of.options.AA_LEVEL.tooltip.3= 2-16 - vyhladené línie a hrany (pomalšie) +of.options.AA_LEVEL.tooltip.4=Antialiasing vyhladzuje zúbkované okraje +of.options.AA_LEVEL.tooltip.5=a ostré prechody farieb. +of.options.AA_LEVEL.tooltip.6=Zapnutý môže podstatne znížiť FPS. +of.options.AA_LEVEL.tooltip.7=Nie všetky úrovne sú podporované každou grafickou kartou. +of.options.AA_LEVEL.tooltip.8=Nastavenie sa prejaví PO REŠTARTE! + +of.options.AF_LEVEL=Anizotropné filtrovanie +of.options.AF_LEVEL.tooltip.1=Anizotropné filtrovanie +of.options.AF_LEVEL.tooltip.2= VYP - (štandard) štandardna detailnosť textúr (rýchlejšie) +of.options.AF_LEVEL.tooltip.3= 2-16 - jemnejšie detaily textúr s MIP mapou (pomalšie) +of.options.AF_LEVEL.tooltip.4=Anizotropné filtrovanie dodáva detailnosť +of.options.AF_LEVEL.tooltip.5=textúram s MIP mapou. +of.options.AF_LEVEL.tooltip.6=Zapnuté môže podstatne znížiť FPS. + +of.options.CLEAR_WATER=Priezračná voda +of.options.CLEAR_WATER.tooltip.1=Priezračná voda +of.options.CLEAR_WATER.tooltip.2= ZAP - jasná, priezračná voda +of.options.CLEAR_WATER.tooltip.3= VYP - štandardná voda + +of.options.RANDOM_ENTITIES=Náhodné entity +of.options.RANDOM_ENTITIES.tooltip.1=Náhodné entity +of.options.RANDOM_ENTITIES.tooltip.2= VYP - žiadne náhodné entity, rýchlejšie +of.options.RANDOM_ENTITIES.tooltip.3= ZAP - náhodné entity, pomalšie +of.options.RANDOM_ENTITIES.tooltip.4=Náhodné entity používajú náhodné textúry pre entity v hre. +of.options.RANDOM_ENTITIES.tooltip.5=Vyžadujú zdrojový balík s viacerými textúrami pre jednotlivé entity. + +of.options.BETTER_GRASS=Lepšia tráva +of.options.BETTER_GRASS.tooltip.1=Lepšia tráva +of.options.BETTER_GRASS.tooltip.2= VYP - štandardná textúra strán trávy, najrýchlejšia +of.options.BETTER_GRASS.tooltip.3= Rýchla - plná textúra strán trávy, pomalšia +of.options.BETTER_GRASS.tooltip.4= Pekná - dynamická textúra strán trávy, najpomalšia + +of.options.BETTER_SNOW=Lepší sneh +of.options.BETTER_SNOW.tooltip.1=Lepší sneh +of.options.BETTER_SNOW.tooltip.2= VYP - štandardný sneh, rýchlejší +of.options.BETTER_SNOW.tooltip.3= ZAP - lepší sneh, pomalší +of.options.BETTER_SNOW.tooltip.4=Zobrazuje sneh pod presvitnými blokmi (ploty, vysoká tráva), +of.options.BETTER_SNOW.tooltip.5=ktoré susedia so snehom. + +of.options.CUSTOM_FONTS=Vlastné fonty +of.options.CUSTOM_FONTS.tooltip.1=Vlastné fonty +of.options.CUSTOM_FONTS.tooltip.2= ZAP - (štandard) používa vlastné fonty, pomalšie +of.options.CUSTOM_FONTS.tooltip.3= VYP - používa štandardný font, rýchlejšie +of.options.CUSTOM_FONTS.tooltip.4=Vlastné fonty závisia od zvoleného +of.options.CUSTOM_FONTS.tooltip.5=zdrojového balíka. + +of.options.CUSTOM_COLORS=Vlastné farby +of.options.CUSTOM_COLORS.tooltip.1=Vlastné farby +of.options.CUSTOM_COLORS.tooltip.2= ZAP - (štandard) používa vlastné farby, pomalšie +of.options.CUSTOM_COLORS.tooltip.3= VYP - používa štandardné farby, rýchlejšie +of.options.CUSTOM_COLORS.tooltip.4=Vlastné farby závisia od zvoleného +of.options.CUSTOM_COLORS.tooltip.5=zdrojového balíka. + +of.options.SWAMP_COLORS=Farby močiara +of.options.SWAMP_COLORS.tooltip.1=Farby močiara +of.options.SWAMP_COLORS.tooltip.2= ZAP - (štandard) používa farby močiara, pomalšie +of.options.SWAMP_COLORS.tooltip.3= VYP - nepoužíva farby močiara, rýchlejšie +of.options.SWAMP_COLORS.tooltip.4=Farby močiara ovplyvňujú trávu, listy, liany a vodu. + +of.options.SMOOTH_BIOMES=Vyhladené biómy +of.options.SMOOTH_BIOMES.tooltip.1=Vyhladené biómy +of.options.SMOOTH_BIOMES.tooltip.2= ZAP - (štandard) vyhladzovanie hraníc biómov, pomalšie +of.options.SMOOTH_BIOMES.tooltip.3= VYP - žiadne vyhladzovanie hraníc biómov, rýchlejšie +of.options.SMOOTH_BIOMES.tooltip.4=Vyhladzovanie hraníc biómov je založené na vzorkovaní +of.options.SMOOTH_BIOMES.tooltip.5=a priemerovaní farby všetkých okolitých blokov. +of.options.SMOOTH_BIOMES.tooltip.6=Ovplyvňuje trávu, listy, liany a vodu. + +of.options.CONNECTED_TEXTURES=Prepojené textúry +of.options.CONNECTED_TEXTURES.tooltip.1=Prepojené textúry +of.options.CONNECTED_TEXTURES.tooltip.2= VYP - (štandard) žiadne prepojené textúry +of.options.CONNECTED_TEXTURES.tooltip.3= Rýchle - rýchle prepojené textúry +of.options.CONNECTED_TEXTURES.tooltip.4= Pekné - pekné prepojené textúry +of.options.CONNECTED_TEXTURES.tooltip.5=Prepojené textúry spájajú textúry skla, +of.options.CONNECTED_TEXTURES.tooltip.6=pieskovca a knižníc, položených vedľa seba. +of.options.CONNECTED_TEXTURES.tooltip.7=Prepojené textúry závisia od +of.options.CONNECTED_TEXTURES.tooltip.8=zvoleného zdrojového balíka. + +of.options.NATURAL_TEXTURES=Prirodzené textúry +of.options.NATURAL_TEXTURES.tooltip.1=Prirodzené textúry +of.options.NATURAL_TEXTURES.tooltip.2= VYP - (štandard) žiadne prirodzené textúry +of.options.NATURAL_TEXTURES.tooltip.3= ZAP - použiť prirodzené textúry +of.options.NATURAL_TEXTURES.tooltip.4=Prirozdené textúry odstraňujú mriežkovitý vzor +of.options.NATURAL_TEXTURES.tooltip.5=vytvorený opakovaním kociek rovnakého typu. +of.options.NATURAL_TEXTURES.tooltip.6=Sú zalošené na otočených a preklopených variantoch základnej +of.options.NATURAL_TEXTURES.tooltip.7=textúry kocky. Konfigurácia prirodzených textúr závisí +of.options.NATURAL_TEXTURES.tooltip.8=od zvoleného zdrojového balíka. + +of.options.EMISSIVE_TEXTURES=Žiariace textúry +of.options.EMISSIVE_TEXTURES.tooltip.1=Žiariace textúry +of.options.EMISSIVE_TEXTURES.tooltip.2= VYP - (štandard) žiadne žiariace textúry +of.options.EMISSIVE_TEXTURES.tooltip.3= ZAP - použiť žiariace textúry +of.options.EMISSIVE_TEXTURES.tooltip.4=Žiariace textúry sú vykreslené ako vrchná vrstva +of.options.EMISSIVE_TEXTURES.tooltip.5=s najvyšším jasom. Je možné ich použiť na simulovanie +of.options.EMISSIVE_TEXTURES.tooltip.6=žiariacich častí základnej textúry. +of.options.EMISSIVE_TEXTURES.tooltip.7=Žiariace textúry závisia od zvoleného +of.options.EMISSIVE_TEXTURES.tooltip.8=zdrojového balíka. + +of.options.CUSTOM_SKY=Vlastná obloha +of.options.CUSTOM_SKY.tooltip.1=Vlastná obloha +of.options.CUSTOM_SKY.tooltip.2= ZAP - (štandard) vlastná textúra oblohy, pomalšia +of.options.CUSTOM_SKY.tooltip.3= VYP - štandardná obloha, rýchlejšia +of.options.CUSTOM_SKY.tooltip.4=Textúra vlastnej oblohy závisí od zvoleného +of.options.CUSTOM_SKY.tooltip.5=zdrojového balíka. + +of.options.CUSTOM_ITEMS=Vlastné predmety +of.options.CUSTOM_ITEMS.tooltip.1=Vlastné predmety +of.options.CUSTOM_ITEMS.tooltip.2= ZAP - (štandard) vlastné textúry predmetov, pomalšie +of.options.CUSTOM_ITEMS.tooltip.3= VYP - štandardné textúry predmetov, rýchlejšie +of.options.CUSTOM_ITEMS.tooltip.4=Vlastné textúry predmetov závisia od +of.options.CUSTOM_ITEMS.tooltip.5=zvoleného zdrojového balíka. + +of.options.CUSTOM_ENTITY_MODELS=Vlastné modely entít +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Vlastné modely entít +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ZAP - (štandard) vlastné modely entít, pomalšie +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= VYP - štandardné modely entít, rýchlejšie +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Vlastné modely entít závisia od +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=zvoleného zdrojového balíka. + +of.options.CUSTOM_GUIS=Vlastné GUI +of.options.CUSTOM_GUIS.tooltip.1=Vlastné grafické rozhrania (GUI) +of.options.CUSTOM_GUIS.tooltip.2= ZAP - (štandard) vlastné GUI, pomalšie +of.options.CUSTOM_GUIS.tooltip.3= VYP - štandardné GUI, rýchlejšie +of.options.CUSTOM_GUIS.tooltip.4=Vlastné GUI závisia od zvoleného zdrojového balíka. + +# Details + +of.options.CLOUDS=Oblaky +of.options.CLOUDS.tooltip.1=Oblaky +of.options.CLOUDS.tooltip.2= Štandardné - podľa nastavenia Grafiky +of.options.CLOUDS.tooltip.3= Rýchle - nižšia kvalita, rýchlejšie +of.options.CLOUDS.tooltip.4= Pekné - vyššia kvalita, pomalšie +of.options.CLOUDS.tooltip.5= VYP - žiadne oblaky, najrýchlejšie +of.options.CLOUDS.tooltip.6=Rýchle oblaky sú vykreslené dvojrozmerne (2D). +of.options.CLOUDS.tooltip.7=Pekné oblaky sú vykreslené trojrozmerne (3D). + +of.options.CLOUD_HEIGHT=Výška oblakov +of.options.CLOUD_HEIGHT.tooltip.1=Výška oblakov +of.options.CLOUD_HEIGHT.tooltip.2= VYP - štandardná výška +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - nad výškovým limitom sveta + +of.options.TREES=Stromy +of.options.TREES.tooltip.1=Stromy +of.options.TREES.tooltip.2= Štandardné - podľa nastavenia Grafiky +of.options.TREES.tooltip.3= Rýchle - nižšia kvalita, rýchlejšie +of.options.TREES.tooltip.4= Chytré - vyššia kvalita, rýchle +of.options.TREES.tooltip.5= Pekné - najvyššia kvalita, pomalšie +of.options.TREES.tooltip.6=Rýchle stromy majú nepriehľadné listy. +of.options.TREES.tooltip.7=Chytré a pekné stromy majú priehľadné listy. + +of.options.RAIN=Dážď a sneh +of.options.RAIN.tooltip.1=Dážď a sneh +of.options.RAIN.tooltip.2= Štandardné - podľa nastavenia Grafiky +of.options.RAIN.tooltip.3= Rýchle - slabý dážď/sneh, rýchlejšie +of.options.RAIN.tooltip.4= Pekné - silný dážď/sneh, pomalšie +of.options.RAIN.tooltip.5= VYP - žiadny dážď/sneh, najrýchlejšie +of.options.RAIN.tooltip.6=Keď je dážď vypnutý, kvapky a zvuky +of.options.RAIN.tooltip.7=dažďa sú stále aktívne. + +of.options.SKY=Obloha +of.options.SKY.tooltip.1=Obloha +of.options.SKY.tooltip.2= ZAP - obloha je viditeľná, pomalšie +of.options.SKY.tooltip.3= VYP - obloha nie je viditeľná, rýchlejšie +of.options.SKY.tooltip.4=Keď je obloha vypnutá, slnko a mesiac sú stále viditeľné. + +of.options.STARS=Hviezdy +of.options.STARS.tooltip.1=Hviezdy +of.options.STARS.tooltip.2= ZAP - hviezdy sú viditeľné, pomalšie +of.options.STARS.tooltip.3= VYP - hviezdy nie sú viditeľné, rýchlejšie + +of.options.SUN_MOON=Slnko a mesiac +of.options.SUN_MOON.tooltip.1=Slnko a mesiac +of.options.SUN_MOON.tooltip.2= ZAP - (štandard) slnko a mesiac sú viditeľné +of.options.SUN_MOON.tooltip.3= VYP - slnko a mesiac nie sú viditeľné (rýchlejšie) + +of.options.SHOW_CAPES=Zobraziť plášte +of.options.SHOW_CAPES.tooltip.1=Zobraziť plášte +of.options.SHOW_CAPES.tooltip.2= ZAP - (štandard) zobrazovať plášte hráčov +of.options.SHOW_CAPES.tooltip.3= VYP - nezobrazovať plášte hráčov + +of.options.TRANSLUCENT_BLOCKS=Priesvitné kocky +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Priesvitné kocky +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Štandardné - podľa nastavenia Grafiky +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Pekné - správne miešanie farieb (pomalšie) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Rýchle - rýchle miešanie farieb (rýchlejšie) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Reguluje miešanie farieb priesvitných kociek +of.options.TRANSLUCENT_BLOCKS.tooltip.6=s rôznymi farbami (farebné sklo, voda, ľad) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=keď sú položené za sebou s medzerou medzi nimi. + +of.options.HELD_ITEM_TOOLTIPS=Popisy predmetov v ruke +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Popisy predmetov v ruke +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ZAP - (štandard) zobrazovať popisy predmetov v ruke +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= VYP - nezobrazovať popisy predmetov v ruke + +of.options.ADVANCED_TOOLTIPS=Pokročilé popisy +of.options.ADVANCED_TOOLTIPS.tooltip.1=Pokročilé popisy +of.options.ADVANCED_TOOLTIPS.tooltip.2= ZAP - zobrazovať pokročilé popisy +of.options.ADVANCED_TOOLTIPS.tooltip.3= VYP - (štandard) nezobrazovať pokročilé popisy +of.options.ADVANCED_TOOLTIPS.tooltip.4=Pokročilé popisy zobrazujú rozšírené informácie +of.options.ADVANCED_TOOLTIPS.tooltip.5=predmetov (ID, trvanlivosť) a možností tieňovačov +of.options.ADVANCED_TOOLTIPS.tooltip.6=(ID, zdroj, štandardné hodnoty). + +of.options.DROPPED_ITEMS=Odhodené predmety +of.options.DROPPED_ITEMS.tooltip.1=Odhodené predmety +of.options.DROPPED_ITEMS.tooltip.2= Štandardné - podľa nastavenia Grafiky +of.options.DROPPED_ITEMS.tooltip.3= Rýchle - 2D odhodené predmety, rýchlejšie +of.options.DROPPED_ITEMS.tooltip.4= Pekné - 3D odhodené predmety, pomalšie + +options.entityShadows.tooltip.1=Tiene entít +options.entityShadows.tooltip.2= ZAP - zobrazovať tiene entít +options.entityShadows.tooltip.3= VYP - nezobrazovať tiene entít + +of.options.VIGNETTE=Vineta +of.options.VIGNETTE.tooltip.1=Efekt, ktorý stmavuje okraje obrazovky +of.options.VIGNETTE.tooltip.2= Štandardná - podľa nastavenia Grafiky +of.options.VIGNETTE.tooltip.3= Rýchla - vypnutá vineta (rýchlejšie) +of.options.VIGNETTE.tooltip.4= Pekná - zapnutá vineta (pomalšie) +of.options.VIGNETTE.tooltip.5=Vineta môže mať vplyv na FPS, zvlášť +of.options.VIGNETTE.tooltip.6=pri hre na celej obrazovke. +of.options.VIGNETTE.tooltip.7=Vineta má nenápadný efekt a je +of.options.VIGNETTE.tooltip.8=bezpečné ju vypnúť. + +of.options.DYNAMIC_FOV=Dynamické zorné pole +of.options.DYNAMIC_FOV.tooltip.1=Dynamické zorné pole (FOV) +of.options.DYNAMIC_FOV.tooltip.2= ZAP - (štandard) zapnúť dynamické zorné pole +of.options.DYNAMIC_FOV.tooltip.3= VYP - vypnúť dynamické zorné pole +of.options.DYNAMIC_FOV.tooltip.4=CMení zorné pole pri lietaní, behu +of.options.DYNAMIC_FOV.tooltip.5=alebo naťahovaní tetivy luku. + +of.options.DYNAMIC_LIGHTS=Dynamické svetlá +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamické svetlá +of.options.DYNAMIC_LIGHTS.tooltip.2= VYP - (štandard) žiadne dynamické svetlá +of.options.DYNAMIC_LIGHTS.tooltip.3= Rýchle - rýchle dynamické svetlá (obnovené každých 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Pekné - pekné dynamické svetlá (obnovované v reálnom čase) +of.options.DYNAMIC_LIGHTS.tooltip.5=Umožní predmetom vyžarujúcim svetlo (fakľa, svietivec, atď.) +of.options.DYNAMIC_LIGHTS.tooltip.6=osvetliť všetko v ich okolí, keď je predmet v ruke, +of.options.DYNAMIC_LIGHTS.tooltip.7=na tele hráča, alebo odhodený na zemi. + +# Performance + +of.options.SMOOTH_FPS=Vyhladené FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizuje rýchlosť snímok (FPS) premazávaním medzipamäte grafického ovládača. +of.options.SMOOTH_FPS.tooltip.2= VYP - žiadna stabilizácia, FPS môže kolísať +of.options.SMOOTH_FPS.tooltip.3= ZAP - stabilizácia FPS +of.options.SMOOTH_FPS.tooltip.4=Toto nastavenie závisí od grafického ovládača +of.options.SMOOTH_FPS.tooltip.5=a jeho efekt nie je vždy viditeľný. + +of.options.SMOOTH_WORLD=Vyhladený svet +of.options.SMOOTH_WORLD.tooltip.1=Odstraňuje oneskorenia spôsobené interným serverom. +of.options.SMOOTH_WORLD.tooltip.2= VYP - žiadna stabilizácia, FPS môže kolísať +of.options.SMOOTH_WORLD.tooltip.3= ZAP - stabilizácia FPS +of.options.SMOOTH_WORLD.tooltip.4=Stabilizuje FPS rozložením zaťaženia interného servera. +of.options.SMOOTH_WORLD.tooltip.5=Funkčné len pre lokálne svety (hra pre jedného hráča). + +of.options.FAST_RENDER=Rýchle vykresľovanie +of.options.FAST_RENDER.tooltip.1=Rýchle vykresľovanie +of.options.FAST_RENDER.tooltip.2= VYP - (štandard) štandardné vykresľovanie +of.options.FAST_RENDER.tooltip.3= ZAP - optimalizované vykresľovanie (rýchlejšie) +of.options.FAST_RENDER.tooltip.4=Používa optimalizovaný algoritmus vykresľovania, korý znižuje +of.options.FAST_RENDER.tooltip.5=zaťaženie procesora a môže značne zvýšiť FPS. +of.options.FAST_RENDER.tooltip.6=Táto možnosť nemusí správne fungovať s niektorými módmi. + +of.options.FAST_MATH=Rýchle výpočty +of.options.FAST_MATH.tooltip.1=Rýchle výpočty +of.options.FAST_MATH.tooltip.2= VYP - (štandard) štandardná metóda výpočtov +of.options.FAST_MATH.tooltip.3= ZAP - rýchlejšie výpočty +of.options.FAST_MATH.tooltip.4=Používa optimalizované funkcie sínus a kosínus, čo umožní +of.options.FAST_MATH.tooltip.5=lepšie využiie medzipamäte procesora zvýšenie FPS. +of.options.FAST_MATH.tooltip.6=Táto možnosť môže minimálne ovplyvniť generovanie sveta. + +of.options.CHUNK_UPDATES=Aktualizácie chunkov +of.options.CHUNK_UPDATES.tooltip.1=Aktualizácie chunkov +of.options.CHUNK_UPDATES.tooltip.2= 1 - (štandard) pomalšie načítavanie sveta, vyššie FPS +of.options.CHUNK_UPDATES.tooltip.3= 3 - rýchlejšie načítavanie sveta, nižšie FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - najrýchlejšie načítavanie sveta, najnižšie FPS +of.options.CHUNK_UPDATES.tooltip.5=Počet aktualizácií chunkov na každú vykreslenú snímku, +of.options.CHUNK_UPDATES.tooltip.6=vyššie hodnoty môžu spôsobiť výkyvy FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamické aktualizácie +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamické aktualizácie chunkov +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= VYP - (štandard) standardné aktualizácie chunkov na snímku +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ZAP - viac aktualizácií keď hráč stojí na mieste +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamické aktualizácie vynucujú viac aktualizácií chunkov +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=keď hráč stojí na mieste, čo zrýchľuje načítavanie sveta. + +of.options.LAZY_CHUNK_LOADING=Lenivé načítavanie chunkov +of.options.LAZY_CHUNK_LOADING.tooltip.1=Lenivé načítavanie chunkov +of.options.LAZY_CHUNK_LOADING.tooltip.2= VYP - štandardné načítavanie chunkov servera +of.options.LAZY_CHUNK_LOADING.tooltip.3= ZAP - lenivé načítavanie chunkov servera (hladšie) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Vyhladzuje načítavanie chunkov integrovaného servera +of.options.LAZY_CHUNK_LOADING.tooltip.5=rozložením chunkov na viacero tikov. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Vypni ho, ak sa niektoré časti sveta nenačítavajú správne. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Funkčné len pre lokálne svety (hra pre jedného hráča). + +of.options.RENDER_REGIONS=Vykresľovacie regióny +of.options.RENDER_REGIONS.tooltip.1=Vykresľovacie regiony +of.options.RENDER_REGIONS.tooltip.2= VYP - (štandard) nepoužívať vykresľovacie regióny +of.options.RENDER_REGIONS.tooltip.3= ZAP - používať vykresľovacie regióny +of.options.RENDER_REGIONS.tooltip.4=Vykresľovacie regióny umožňujú rýchlejšie vykresľovanie terénu pri +of.options.RENDER_REGIONS.tooltip.5=vyššej vzdialenosti vykresľovania. Účinnejšie pri zapnutých VBO. +of.options.RENDER_REGIONS.tooltip.6=Neodporúča sa pri integrovaných grafických kartách. + +of.options.SMART_ANIMATIONS=Chytré animácie +of.options.SMART_ANIMATIONS.tooltip.1=Chytré animácie +of.options.SMART_ANIMATIONS.tooltip.2= VYP - nepoužívať chytré animácie (štandard) +of.options.SMART_ANIMATIONS.tooltip.3= ZAP - používať chytré animácie +of.options.SMART_ANIMATIONS.tooltip.4=S chytrými animáciami bude hra animovať len tie +of.options.SMART_ANIMATIONS.tooltip.5=textúry, ktoré sú práve viditeľné na obrazovke. +of.options.SMART_ANIMATIONS.tooltip.6=Znižuje to výkyvy zaťaženia a zvyšuje FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Obzvlášť užitočné pri veľkých modpackoch a HD zdrojových balíkoch. + +# Animations + +of.options.animation.allOn=Všetky ZAP +of.options.animation.allOff=Všetky VYP +of.options.animation.dynamic=Dynamické + +of.options.ANIMATED_WATER=Animovaná voda +of.options.ANIMATED_LAVA=Animovaná láva +of.options.ANIMATED_FIRE=Animovaný oheň +of.options.ANIMATED_PORTAL=Animované portály +of.options.ANIMATED_REDSTONE=Animovaný redstone +of.options.ANIMATED_EXPLOSION=Animované výbuchy +of.options.ANIMATED_FLAME=Animované plamene +of.options.ANIMATED_SMOKE=Animovaný dym +of.options.VOID_PARTICLES=Častice prázdna +of.options.WATER_PARTICLES=Častice vody +of.options.RAIN_SPLASH=Špliechanie dažďa +of.options.PORTAL_PARTICLES=Častice portálov +of.options.POTION_PARTICLES=Častice elixírov +of.options.DRIPPING_WATER_LAVA=Kvapkajúca voda/láva +of.options.ANIMATED_TERRAIN=Animovaný terén +of.options.ANIMATED_TEXTURES=Animované textúry +of.options.FIREWORK_PARTICLES=Častice ohňostrojov + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Zobrazí lagometer na ladiacej obrazovke (F3). +of.options.LAGOMETER.tooltip.2=* Oranžová - Zbieranie odpadovej pamäti +of.options.LAGOMETER.tooltip.3=* Tyrkysová - Tik +of.options.LAGOMETER.tooltip.4=* Modrá - Plánované spustenia +of.options.LAGOMETER.tooltip.5=* Fialová - Upload chunkov +of.options.LAGOMETER.tooltip.6=* Červená - Aktualizácie chunkov +of.options.LAGOMETER.tooltip.7=* Žltá - Kontrola viditeľnosti +of.options.LAGOMETER.tooltip.8=* Zelená - Vykresľovanie terénu + +of.options.PROFILER=Profilovanie ladenia +of.options.PROFILER.tooltip.1=Profilovanie ladenia +of.options.PROFILER.tooltip.2= ZAP - profilovanie ladenia je zapnuté, pomalšie +of.options.PROFILER.tooltip.3= VYP - profilovanie ladenia je vypnuté, rýchlejšie +of.options.PROFILER.tooltip.4=Profilovanie ladenia zbiera a zobrazuje informácie o ladení +of.options.PROFILER.tooltip.5=keď je zobrazená ladiaca obrazovka (F3). + +of.options.WEATHER=Počasie +of.options.WEATHER.tooltip.1=Počasie +of.options.WEATHER.tooltip.2= ZAP - počasie je aktívne, pomalšie +of.options.WEATHER.tooltip.3= VYP - počasie nie je aktívne, rýchlejšie +of.options.WEATHER.tooltip.4=Počasie reguluje dážď, sneh a búrky. +of.options.WEATHER.tooltip.5=Ovládanie počasia je funkčné len pre lokálne svety. + +of.options.time.dayOnly=Stále deň +of.options.time.nightOnly=Stále noc + +of.options.TIME=Čas +of.options.TIME.tooltip.1=Čas +of.options.TIME.tooltip.2= Štandardný - normálny cyklus dní a nocí +of.options.TIME.tooltip.3= Stále deň - stále deň +of.options.TIME.tooltip.4= Stále noc - stále noc +of.options.TIME.tooltip.5=Nastavenie času je funkčné len pre tvorivú hru +of.options.TIME.tooltip.6=a len pre lokálne svety. + +options.fullscreen.tooltip.1=Celá obrazovka +options.fullscreen.tooltip.2= ZAP - hrať na celej obrazovke +options.fullscreen.tooltip.3= VYP - hrať v okne +options.fullscreen.tooltip.4=Hra na celej obrazovke môže byť rýchlejšia alebo pomalšia než +options.fullscreen.tooltip.5=hra v okne, v závislosti od grafickej karty. + +of.options.FULLSCREEN_MODE=Režim celej obraovky +of.options.FULLSCREEN_MODE.tooltip.1=Režim celej obrazovky +of.options.FULLSCREEN_MODE.tooltip.2= Štandardný - použiť rozlíšenie obrazovky, pomalšie +of.options.FULLSCREEN_MODE.tooltip.3= VxŠ - použiť vlastné rozlíšenie, môže byť rýchlejšie +of.options.FULLSCREEN_MODE.tooltip.4=Vybrané rozlíšenie je použité pri hre na celej obrazovke (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Nižšie rozlíšenia by všeobecne mali byť rýchlejšie. + +of.options.SHOW_FPS=Zobraziť FPS +of.options.SHOW_FPS.tooltip.1=Zobrazí kompaktné informácie o FPS a vykresľovaní. +of.options.SHOW_FPS.tooltip.2= Fps - priemerné/najnišžie +of.options.SHOW_FPS.tooltip.3= C: - vykresľovače chunkov +of.options.SHOW_FPS.tooltip.4= E: - vykreslené entity + blok-entity +of.options.SHOW_FPS.tooltip.5= U: - aktualizácie chunkov +of.options.SHOW_FPS.tooltip.6=Kompaktné informácie o FPS sú zobrazené len pri +of.options.SHOW_FPS.tooltip.7=vypnutej ladiacej obrazovke (F3). + +of.options.save.45s=45s +of.options.save.90s=90s +of.options.save.3min=3min +of.options.save.6min=6min +of.options.save.12min=12min +of.options.save.24min=24min + +of.options.AUTOSAVE_TICKS=Automatické ukladanie +of.options.AUTOSAVE_TICKS.tooltip.1=Interval automatického ukladania +of.options.AUTOSAVE_TICKS.tooltip.2= 45s - štandard +of.options.AUTOSAVE_TICKS.tooltip.3=Štandardný interval automatického ukladania (2s) SA NEODPORÚČA. +of.options.AUTOSAVE_TICKS.tooltip.4=Automatické ukladanie spôsobuje známy "lag smrti" (Lag Spike of Death). + +of.options.SCREENSHOT_SIZE=Veľkosť snímok +of.options.SCREENSHOT_SIZE.tooltip.1=Veľkosť snímok obrazovky (screenshot) +of.options.SCREENSHOT_SIZE.tooltip.2= Štandardná - štandardná veľkosť +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - vlastná veľkosť +of.options.SCREENSHOT_SIZE.tooltip.4=Fotenie väčších snímok môže vyžadovať viac pamäti. +of.options.SCREENSHOT_SIZE.tooltip.5=Nekompatibilné s rýchlym vykresľovaním a antialiasingom. +of.options.SCREENSHOT_SIZE.tooltip.6=Vyžaduje podporu GPU framebufferu. + +of.options.SHOW_GL_ERRORS=Zobrazenie GL chýb +of.options.SHOW_GL_ERRORS.tooltip.1=Zobrazenie OpenGL chýb +of.options.SHOW_GL_ERRORS.tooltip.2=Ak je zapnuté, OpenGL chyby sa zobrazujú v chate. +of.options.SHOW_GL_ERRORS.tooltip.3=Vypni len v prípade známeho problému, kde +of.options.SHOW_GL_ERRORS.tooltip.4=chyby nie je možné opraviť. +of.options.SHOW_GL_ERRORS.tooltip.5=AK je vypnuté, chyby sa stále zapisujú do denníka chýb +of.options.SHOW_GL_ERRORS.tooltip.6=a stále môžu spôsobiť značné poklesy FPS. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Pozadie chatu +of.options.CHAT_BACKGROUND.tooltip.1=Pozadie chatu +of.options.CHAT_BACKGROUND.tooltip.2= Štandardné - pevná šírka +of.options.CHAT_BACKGROUND.tooltip.3= Kompaktné - podľa šírky riadka +of.options.CHAT_BACKGROUND.tooltip.4= VYP - skryté + +of.options.CHAT_SHADOW=Tieň chatu +of.options.CHAT_SHADOW.tooltip.1=Tieň chatu +of.options.CHAT_SHADOW.tooltip.2= ZAP - používať tieň chatu +of.options.CHAT_SHADOW.tooltip.3= VYP - nepoužívať tieň chatu diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/sv_SE.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/sv_SE.lang new file mode 100644 index 0000000..59ded50 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/sv_SE.lang @@ -0,0 +1,759 @@ +# Contributors of Swedish localization # +# Regnander (_Spitz) 2016-01-18 ---- 2019-02-16 + +# General +of.general.ambiguous=tvetydig +of.general.compact=Kompakt +of.general.custom=Anpassad +of.general.from=Från +of.general.id=ID +of.general.max=Maximal +of.general.restart=starta om +of.general.smart=Smart + +# Keys +of.key.zoom=Zooma in + +# Message +of.message.aa.shaders1=Kantutjämning är inte kompatibel med Shaders. +of.message.aa.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.af.shaders1=Anisotropisk filtrering är inte kompatibel med Shaders. +of.message.af.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.fr.shaders1=Snabb rendering är inte kompatibel med Shaders. +of.message.fr.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.an.shaders1=3D-effekt är inte kompatibel med Shaders. +of.message.an.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.shaders.aa1=Shaders är inte kompatibla med Kantutjämning. +of.message.shaders.aa2=Ändra "Kvalitet -> Kantutjämning" till AV och starta om spelet. + +of.message.shaders.af1=Shaders är inte kompatibla med Anisotropisk filtrering. +of.message.shaders.af2=Ändra "Kvalitet -> Anisotropisk filtrering" till AV. + +of.message.shaders.fr1=Shaders är inte kompatibla med Snabb rendering. +of.message.shaders.fr2=Ändra "Prestanda -> Snabb rendering" till AV. + +of.message.shaders.an1=Shaders är inte kompatibla med 3D-effekt. +of.message.shaders.an2=Ändra "Övrigt -> 3D-effekt" till AV. + +of.message.shaders.nv1=Detta shaderpaket kräver en nyare version av OptiFine: %s +of.message.shaders.nv2=Är du säker på att du vill fortsätta? + +of.message.newVersion=En ny version av §eOptiFine§f finns tillgänglig: §e%s§f +of.message.java64Bit=Du kan installera §e64-bitarsversionen av Java§f för att förbättra prestandan. +of.message.openglError=§eOpenGL-fel§f: %s (%s) + +of.message.shaders.loading=Läser in shaders: %s + +of.message.other.reset=Återställ alla grafikinställningar till dess standardvärden? + +of.message.loadingVisibleChunks=Läser in synliga datablock + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine-mantel... + +of.options.capeOF.title=OptiFine-mantel +of.options.capeOF.openEditor=Öppna mantelredigerare +of.options.capeOF.reloadCape=Uppdatera mantel + +of.message.capeOF.openEditor=OptiFines mantelredigerare bör öppnas i en webbläsare. +of.message.capeOF.reloadCape=Manteln kommer att uppdateras om 15 sekunder. + +of.message.capeOF.error1=Mojang-autentisering misslyckades. +of.message.capeOF.error2=Fel: %s + +# Video settings + +options.graphics.tooltip.1=Visuell kvalitet +options.graphics.tooltip.2= Snabbt - lägre kvalitet, snabbare +options.graphics.tooltip.3= Snyggt - högre kvalitet, långsammare +options.graphics.tooltip.4=Ändrar utseendet för moln, löv, vatten, skuggor och +options.graphics.tooltip.5=gräskanter. + +of.options.renderDistance.tiny=Litet +of.options.renderDistance.short=Kort +of.options.renderDistance.normal=Normalt +of.options.renderDistance.far=Långt +of.options.renderDistance.extreme=Extremt +of.options.renderDistance.insane=Galet +of.options.renderDistance.ludicrous=Löjligt + +options.renderDistance.tooltip.1=Synligt avstånd +options.renderDistance.tooltip.2= 2 Litet - 32m (snabbast) +options.renderDistance.tooltip.3= 8 Normalt - 128m (normalt) +options.renderDistance.tooltip.4= 16 Långt - 256m (långsammare) +options.renderDistance.tooltip.5= 32 Extremt - 512m (långsammast!) mkt resurskrävande +options.renderDistance.tooltip.6= 48 Galet - 768m, behöver 2GB allokerat RAM +options.renderDistance.tooltip.7= 64 Löjligt - 1024m, behöver 3GB allokerat RAM +options.renderDistance.tooltip.8=Värden över 16 fungerar endast i lokala världar. + +options.ao.tooltip.1=Ljusutjämning +options.ao.tooltip.2= AV - ingen ljusutjämning (snabbast) +options.ao.tooltip.3= Minimum - enkel ljusutjämning (långsammare) +options.ao.tooltip.4= Maximum - avancerad ljusutjämning (långsammast) + +options.framerateLimit.tooltip.1=Maximal bildfrekvens +options.framerateLimit.tooltip.2= VSync - använder skärmens bildfrekvens (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variabel +options.framerateLimit.tooltip.4= Oändlig - ingen begränsning (snabbast) +options.framerateLimit.tooltip.5=Bildfrekvensens gräns reducerar bildfrekvensen även +options.framerateLimit.tooltip.6=om gränsens värde inte nås. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Ljusutjämningsnivå +of.options.AO_LEVEL.tooltip.1=Ljusutjämningsnivå +of.options.AO_LEVEL.tooltip.2= AV - inga skuggor +of.options.AO_LEVEL.tooltip.3= 50%% - ljusa skuggor +of.options.AO_LEVEL.tooltip.4= 100%% - mörka skuggor + +options.viewBobbing.tooltip.1=Mer verklighetstrogna rörelser. +options.viewBobbing.tooltip.2=Inaktivera detta om mipmaps används för bästa resultat. + +options.guiScale.tooltip.1=Gränssnittsskala +options.guiScale.tooltip.2= Automatisk - maximal storlek +options.guiScale.tooltip.3= Liten, Normal, Stor - 1x till 3x +options.guiScale.tooltip.4= 4x till 10x - tillgängliga på 4K-skärmar +options.guiScale.tooltip.5=Udda värden (1x, 3x, 5x...) är inte kompatibla med Unicode. +options.guiScale.tooltip.6=Ett mindre gränssnitt kan vara snabbare. + +options.vbo=Använd VBO +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Använder en alternativ renderingsmodell som vanligtvis +options.vbo.tooltip.3=är snabbare (5-10%%) än standardrenderingen. + +options.gamma.tooltip.1=Ändrar ljusstyrkan för mörkare objekt. +options.gamma.tooltip.2= Mörkt - standardljusstyrka +options.gamma.tooltip.3= 1-99%% - variabel +options.gamma.tooltip.4= Ljust - maximal ljusstyrka för mörkare objekt +options.gamma.tooltip.5=Detta alternativ ändrar inte ljusstyrkan för helt svarta +options.gamma.tooltip.6=objekt. + +options.anaglyph.tooltip.1=3D-effekt +options.anaglyph.tooltip.2=Aktiverar en stereoskopisk 3D-effekt med hjälp av olika +options.anaglyph.tooltip.3=färger för varje öga. +options.anaglyph.tooltip.4=Kräver röd-turkosa glasögon för bästa resultat. + +of.options.ALTERNATE_BLOCKS=Alternerade block +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternerade block +of.options.ALTERNATE_BLOCKS.tooltip.2=Använder alternativa blockmodeller för en del block. +of.options.ALTERNATE_BLOCKS.tooltip.3=Förlitar sig på aktuellt resurspaket. + +of.options.FOG_FANCY=Dimma +of.options.FOG_FANCY.tooltip.1=Typ av dimma +of.options.FOG_FANCY.tooltip.2= Snabbt - snabbare dimma +of.options.FOG_FANCY.tooltip.3= Snyggt - långsammare dimma, ser bättre ut +of.options.FOG_FANCY.tooltip.4= AV - ingen dimma, snabbast +of.options.FOG_FANCY.tooltip.5=Snygg dimma finns bara tillgänglig om den stöds av +of.options.FOG_FANCY.tooltip.6=grafikkortet. + +of.options.FOG_START=Startgräns för dimma +of.options.FOG_START.tooltip.1=Startgräns för dimma +of.options.FOG_START.tooltip.2= 0.2 - dimman börjar nära spelaren +of.options.FOG_START.tooltip.3= 0.8 - dimman börjar långt bort från spelaren +of.options.FOG_START.tooltip.4=Detta alternativ påverkar vanligtvis inte prestandan. + +of.options.CHUNK_LOADING=Datablocksinläsn.: Flerkärnig +of.options.CHUNK_LOADING.tooltip.1=Datablocksinläsning +of.options.CHUNK_LOADING.tooltip.2= Standard - ostabil bildfrekvens när datablock läser in +of.options.CHUNK_LOADING.tooltip.3= Jämn - stabil bildfrekvens +of.options.CHUNK_LOADING.tooltip.4= Flerkärnig - stabil bildfrekvens, 3x snabbare inläsning +of.options.CHUNK_LOADING.tooltip.5=Jämn och Flerkärnig tar bort ryckningar och frysningar +of.options.CHUNK_LOADING.tooltip.6=som orsakas av inlästa datablock. +of.options.CHUNK_LOADING.tooltip.7=Flerkärnig kan påskynda världens inläsning trefaldigt +of.options.CHUNK_LOADING.tooltip.8=och höja bildfrekvensen med en andra processorkärna. +of.options.chunkLoading.smooth=Jämn +of.options.chunkLoading.multiCore=Flerkärnig + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=AV +of.options.shaders.packDefault=(intern) + +of.options.shaders.ANTIALIASING=Kantutjämning +of.options.shaders.ANTIALIASING.tooltip.1=Kantutjämning +of.options.shaders.ANTIALIASING.tooltip.2= AV - (standard) ingen kantutjämning (snabbare) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - utjämnade linjer och kanter (långsammare) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA är en efterbehandlingseffekt som jämnar ut +of.options.shaders.ANTIALIASING.tooltip.5=taggiga linjer och skarpa färgskiftningar. +of.options.shaders.ANTIALIASING.tooltip.6=Den är snabbare än den traditionella kantutjämningen +of.options.shaders.ANTIALIASING.tooltip.7=samt är kompatibel med shaders och Snabb rendering. + +of.options.shaders.NORMAL_MAP=Normal map +of.options.shaders.NORMAL_MAP.tooltip.1=Normal map +of.options.shaders.NORMAL_MAP.tooltip.2= PÅ - (standard) aktivera normal maps +of.options.shaders.NORMAL_MAP.tooltip.3= AV - inaktivera normal maps +of.options.shaders.NORMAL_MAP.tooltip.4=Shaderpaketet kan använda normal maps för att simulera +of.options.shaders.NORMAL_MAP.tooltip.5=3D-geometri på platta modellytor. +of.options.shaders.NORMAL_MAP.tooltip.6=Texturer för normal maps tillhandahålls av det aktuella +of.options.shaders.NORMAL_MAP.tooltip.7=resurspaketet. + +of.options.shaders.SPECULAR_MAP=Specular map +of.options.shaders.SPECULAR_MAP.tooltip.1=Specular map +of.options.shaders.SPECULAR_MAP.tooltip.2= PÅ - (standard) aktivera specular maps +of.options.shaders.SPECULAR_MAP.tooltip.3= AV - inaktivera specular maps +of.options.shaders.SPECULAR_MAP.tooltip.4=Shaderpaketet kan använda specular maps för att +of.options.shaders.SPECULAR_MAP.tooltip.5=simulera speciella reflektionseffekter. +of.options.shaders.SPECULAR_MAP.tooltip.6=Texturer för specular maps tillhandahålls av det +of.options.shaders.SPECULAR_MAP.tooltip.7=aktuella resurspaketet. + +of.options.shaders.RENDER_RES_MUL=Renderingskvalitet +of.options.shaders.RENDER_RES_MUL.tooltip.1=Renderingskvalitet +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - låg (snabbast) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (standard) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - hög (långsammast) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Renderingskvalitet kontrollerar storleken på texturen +of.options.shaders.RENDER_RES_MUL.tooltip.6=som shaderpaketet renderar till. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Lägre värden kan vara användbara på 4K-skärmar. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Högre värden fungerar som ett kantutjämnande filter. + +of.options.shaders.SHADOW_RES_MUL=Skuggkvalitet +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Skuggkvalitet +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - låg (snabbast) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (standard) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - hög (långsammast) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Skuggkvalitet kontrollerar storleken på texturen för +of.options.shaders.SHADOW_RES_MUL.tooltip.6=shadow map som används i shaderpaketet. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Lägre kvalitet = enkla grova skuggor. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Högre kvalitet = detaljerade fina skuggor. + +of.options.shaders.HAND_DEPTH_MUL=Handdjup +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Handdjup +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - handen är nära kameran +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (standard) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - handen är långt borta från kameran +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Handdjup kontrollerar hur långt borta handhållna +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=föremål är från kameran. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=För shaderpaket som använder skärpedjup bör detta +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=ändra hur suddiga handhållna föremål blir. + +of.options.shaders.CLOUD_SHADOW=Molnskugga + +of.options.shaders.OLD_HAND_LIGHT=G. handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Gammalt handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Standard - kontrolleras av shaderpaketet +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= PÅ - använd gammalt handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= AV - använd nytt handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Gammalt handljus låter shaderpaket som endast känner +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=igen ljusavgivande föremål i den primära handen också +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=fungera med föremål i den sekundära handen. + +of.options.shaders.OLD_LIGHTING=Gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.1=Gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.2= Standard - kontrolleras av shaderpaketet +of.options.shaders.OLD_LIGHTING.tooltip.3= PÅ - använd gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.4= AV - använd inte gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.5=Gammalt ljus kontrollerar det fasta ljuset som tillämpas +of.options.shaders.OLD_LIGHTING.tooltip.6=på blocksidor som standard. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shaderpaket som använder skuggor ger vanligtvis +of.options.shaders.OLD_LIGHTING.tooltip.8=mycket bättre ljus som är beroende av solens position. + +of.options.shaders.DOWNLOAD=Ladda ned shaders +of.options.shaders.DOWNLOAD.tooltip.1=Ladda ned shaders +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Öppnar webbsidan för shaderpaket i en webbläsare. +of.options.shaders.DOWNLOAD.tooltip.4=Lägg nedladdade shaderpaket i "shadermappen" så +of.options.shaders.DOWNLOAD.tooltip.5=kommer de visas i listan över installerade shaders. + +of.options.shaders.SHADER_PACK=Shaderpaket + +of.options.shaders.shadersFolder=Shadermapp +of.options.shaders.shaderOptions=Shaderalternativ... + +of.options.shaderOptionsTitle=Shaderalternativ + +of.options.quality=Kvalitet... +of.options.qualityTitle=Kvalitetsinställningar + +of.options.details=Detaljer... +of.options.detailsTitle=Detaljinställningar + +of.options.performance=Prestanda... +of.options.performanceTitle=Prestandainställningar + +of.options.animations=Animeringar... +of.options.animationsTitle=Animeringsinställningar + +of.options.other=Övrigt... +of.options.otherTitle=Övriga inställningar + +of.options.other.reset=Återställ grafikinställningar... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinjär +of.options.mipmap.linear=Linjär +of.options.mipmap.nearest=Närmast +of.options.mipmap.trilinear=Trilinjär + +options.mipmapLevels.tooltip.1=Visuell effekt som gör att objekt på avstånd ser bättre +options.mipmapLevels.tooltip.2=ut genom att jämna ut texturdetaljerna. +options.mipmapLevels.tooltip.3= AV - ingen utjämning +options.mipmapLevels.tooltip.4= 1 - minimal utjämning +options.mipmapLevels.tooltip.5= Maximal - maximal utjämning +options.mipmapLevels.tooltip.6=Detta alternativ påverkar vanligtvis inte prestandan. + +of.options.MIPMAP_TYPE=Mipmaptyp +of.options.MIPMAP_TYPE.tooltip.1=Visuell effekt som gör att objekt på avstånd ser bättre +of.options.MIPMAP_TYPE.tooltip.2=ut genom att jämna ut texturdetaljerna. +of.options.MIPMAP_TYPE.tooltip.3= Närmast - grov utjämning (snabbast) +of.options.MIPMAP_TYPE.tooltip.4= Linjär - normal utjämning +of.options.MIPMAP_TYPE.tooltip.5= Bilinjär - fin utjämning +of.options.MIPMAP_TYPE.tooltip.6= Trilinjär - finast utjämning (långsammast) + + +of.options.AA_LEVEL=Kantutjämning +of.options.AA_LEVEL.tooltip.1=Kantutjämning +of.options.AA_LEVEL.tooltip.2= AV - ingen kantutjämning (standard), snabbare +of.options.AA_LEVEL.tooltip.3= 2-16 - kantutjämnade linjer och kanter (långsammare) +of.options.AA_LEVEL.tooltip.4=Kantutjämningen jämnar ur ojämna linjer och skarpa +of.options.AA_LEVEL.tooltip.5=färgövergångar. +of.options.AA_LEVEL.tooltip.6=Bildfrekvensen kan sjunka avsevärt när detta aktiveras. +of.options.AA_LEVEL.tooltip.7=Alla nivåer stöds inte av alla grafikkort. +of.options.AA_LEVEL.tooltip.8=Kräver OMSTART! + +of.options.AF_LEVEL=Anisotropisk filtrering +of.options.AF_LEVEL.tooltip.1=Anisotropisk filtrering +of.options.AF_LEVEL.tooltip.2= AV - standarddetaljer i texturer (standard), snabbare +of.options.AF_LEVEL.tooltip.3= 2-16 - finare detaljer i mipmaptexturer (långsammare) +of.options.AF_LEVEL.tooltip.4=Den anisotropiska filtreringen återställer detaljer i +of.options.AF_LEVEL.tooltip.5=mipmaptexturer. +of.options.AF_LEVEL.tooltip.6=Bildfrekvensen kan sjunka avsevärt när detta aktiveras. + +of.options.CLEAR_WATER=Kristallklart vatten +of.options.CLEAR_WATER.tooltip.1=Kristallklart vatten +of.options.CLEAR_WATER.tooltip.2= PÅ - kristallklart, genomskinligt vatten +of.options.CLEAR_WATER.tooltip.3= AV - standardvatten + +of.options.RANDOM_ENTITIES=Slumpartade entiteter +of.options.RANDOM_ENTITIES.tooltip.1=Slumpartade entiteter +of.options.RANDOM_ENTITIES.tooltip.2= AV - inga slumpartade entiteter, snabbare +of.options.RANDOM_ENTITIES.tooltip.3= PÅ - slumpartade entiteter, långsammare +of.options.RANDOM_ENTITIES.tooltip.4=Använder slumpartade texturer för spelets entiteter. +of.options.RANDOM_ENTITIES.tooltip.5=Kräver ett resurspaket med flera entitettexturer. + +of.options.BETTER_GRASS=Bättre gräs +of.options.BETTER_GRASS.tooltip.1=Bättre gräs +of.options.BETTER_GRASS.tooltip.2= AV - standardtextur för gräskanter, snabbast +of.options.BETTER_GRASS.tooltip.3= Snabbt - fullständig gräskantstextur, långsammare +of.options.BETTER_GRASS.tooltip.4= Snyggt - dynamisk gräskantstextur, långsammast + +of.options.BETTER_SNOW=Bättre snö +of.options.BETTER_SNOW.tooltip.1=Bättre snö +of.options.BETTER_SNOW.tooltip.2= AV - standardsnö, snabbare +of.options.BETTER_SNOW.tooltip.3= PÅ - bättre snö, långsammare +of.options.BETTER_SNOW.tooltip.4=Visar snö under genomskinliga block (staket, högt gräs) +of.options.BETTER_SNOW.tooltip.5=som angränsar till snöblock. + +of.options.CUSTOM_FONTS=Anpassade typsnitt +of.options.CUSTOM_FONTS.tooltip.1=Anpassade typsnitt +of.options.CUSTOM_FONTS.tooltip.2= PÅ - använd anpass. typsnitt (standard), långsammare +of.options.CUSTOM_FONTS.tooltip.3= AV - använd standardtypsnittet, snabbare +of.options.CUSTOM_FONTS.tooltip.4=De anpassade typsnitten tillhandahålls av det aktuella +of.options.CUSTOM_FONTS.tooltip.5=resurspaketet. + +of.options.CUSTOM_COLORS=Anpassade färger +of.options.CUSTOM_COLORS.tooltip.1=Anpassade färger +of.options.CUSTOM_COLORS.tooltip.2= PÅ - använd anpass. färger (standard), långsammare +of.options.CUSTOM_COLORS.tooltip.3= AV - använd standardfärgerna, snabbare +of.options.CUSTOM_COLORS.tooltip.4=De anpassade färgerna tillhandahålls av det aktuella +of.options.CUSTOM_COLORS.tooltip.5=resurspaketet + +of.options.SWAMP_COLORS=Träskfärger +of.options.SWAMP_COLORS.tooltip.1=Träskfärger +of.options.SWAMP_COLORS.tooltip.2= PÅ - använd träskfärger (standard), långsammare +of.options.SWAMP_COLORS.tooltip.3= AV - använd inte träskfärger, snabbare +of.options.SWAMP_COLORS.tooltip.4=Träskfärgerna påverkar gräs, löv, klätterväxter och +of.options.SWAMP_COLORS.tooltip.5=vatten. + +of.options.SMOOTH_BIOMES=Utjämnade biomer +of.options.SMOOTH_BIOMES.tooltip.1=Utjämnade biomer +of.options.SMOOTH_BIOMES.tooltip.2= PÅ - biomkanter jämnas ut (standard), långsammare +of.options.SMOOTH_BIOMES.tooltip.3= AV - biomkanter jämnas inte ut, snabbare +of.options.SMOOTH_BIOMES.tooltip.4=Biomkanterna jämnas ut genom att sampla och beräkna +of.options.SMOOTH_BIOMES.tooltip.5=medelvärdet av färgen för alla block runtomkring. +of.options.SMOOTH_BIOMES.tooltip.6=Gräs, löv, klätterväxter och vatten påverkas. + +of.options.CONNECTED_TEXTURES=Anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.1=Anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.2= AV - inga anslutande texturer (standard) +of.options.CONNECTED_TEXTURES.tooltip.3= Snabbt - snabba anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.4= Snyggt - snygga anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.5=Anslutande texturer sammanfogar texturerna för glas, +of.options.CONNECTED_TEXTURES.tooltip.6=sandsten och bokhyllor när de placeras intill varandra. +of.options.CONNECTED_TEXTURES.tooltip.7=De anslutande texturerna tillhandahålls av det aktuella +of.options.CONNECTED_TEXTURES.tooltip.8=resurspaketet. + +of.options.NATURAL_TEXTURES=Naturliga texturer +of.options.NATURAL_TEXTURES.tooltip.1=Naturliga texturer +of.options.NATURAL_TEXTURES.tooltip.2= AV - inga naturliga texturer (standard) +of.options.NATURAL_TEXTURES.tooltip.3= PÅ - använd naturliga texturer +of.options.NATURAL_TEXTURES.tooltip.4=Naturliga texturer tar bort rutnätsliknande mönster som +of.options.NATURAL_TEXTURES.tooltip.5=skapas från upprepade block av samma typ. +of.options.NATURAL_TEXTURES.tooltip.6=Den använder roterade och speglade varianter av den +of.options.NATURAL_TEXTURES.tooltip.7=ursprungliga blocktexturen. Konfigurationen för naturliga +of.options.NATURAL_TEXTURES.tooltip.8=texturer tillhandahålls av det aktuella resurspaketet. + +of.options.EMISSIVE_TEXTURES=Upplysta texturer +of.options.EMISSIVE_TEXTURES.tooltip.1=Upplysta texturer +of.options.EMISSIVE_TEXTURES.tooltip.2= AV - inga upplysta texturer (standard) +of.options.EMISSIVE_TEXTURES.tooltip.3= PÅ - använd upplysta texturer +of.options.EMISSIVE_TEXTURES.tooltip.4=De upplysta texturerna renderas som ett överlägg med +of.options.EMISSIVE_TEXTURES.tooltip.5=full ljusstyrka. De kan användas för att simulera +of.options.EMISSIVE_TEXTURES.tooltip.6=belysta delar av grundtexturen. +of.options.EMISSIVE_TEXTURES.tooltip.7=Upplysta texturer tillhandahålls av det aktuella +of.options.EMISSIVE_TEXTURES.tooltip.8=resurspaketet. + +of.options.CUSTOM_SKY=Anpassad himmel +of.options.CUSTOM_SKY.tooltip.1=Anpassad himmel +of.options.CUSTOM_SKY.tooltip.2= PÅ - anpassade himmeltexturer (standard), långsamt +of.options.CUSTOM_SKY.tooltip.3= AV - standardhimmel, snabbare +of.options.CUSTOM_SKY.tooltip.4=Texturerna för den anpassade himlen tillhandahålls av +of.options.CUSTOM_SKY.tooltip.5=det aktuella resurspaketet. + +of.options.CUSTOM_ITEMS=Anpassade föremål +of.options.CUSTOM_ITEMS.tooltip.1=Anpassade föremål +of.options.CUSTOM_ITEMS.tooltip.2= PÅ - anpassade föremålstexturer (standard), långsamt +of.options.CUSTOM_ITEMS.tooltip.3= AV - standardtexturer för föremål, snabbare +of.options.CUSTOM_ITEMS.tooltip.4=De anpassade föremålstexturerna tillhandahålls av det +of.options.CUSTOM_ITEMS.tooltip.5=aktuella resurspaketet. + +of.options.CUSTOM_ENTITY_MODELS=Anp. entitetsmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Anpassade entitetsmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= PÅ - anpassade entitetsmodeller (standard), långsamt +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= AV - standardentitetsmodeller, snabbare +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=De anpassade entitetsmodellerna tillhandahålls av det +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=aktuella resurspaketet. + +of.options.CUSTOM_GUIS=Anpassade gränssnitt +of.options.CUSTOM_GUIS.tooltip.1=Anpassade gränssnitt +of.options.CUSTOM_GUIS.tooltip.2= PÅ - anpassade gränssnitt (standard), långsammare +of.options.CUSTOM_GUIS.tooltip.3= AV - standardgränssnitt, snabbare +of.options.CUSTOM_GUIS.tooltip.4=De anpassade gränssnitten tillhandahålls av det +of.options.CUSTOM_GUIS.tooltip.5=aktuella resurspaketet. + +# Details + +of.options.CLOUDS=Moln +of.options.CLOUDS.tooltip.1=Moln +of.options.CLOUDS.tooltip.2= Standard - följer alternativet "Grafik" +of.options.CLOUDS.tooltip.3= Snabbt - lägre kvalitet, snabbare +of.options.CLOUDS.tooltip.4= Snyggt - högre kvalitet, långsammare +of.options.CLOUDS.tooltip.5= AV - inga moln, snabbast +of.options.CLOUDS.tooltip.6=Snabba moln renderas i 2D. +of.options.CLOUDS.tooltip.7=Snygga moln renderas i 3D. + +of.options.CLOUD_HEIGHT=Molnhöjd +of.options.CLOUD_HEIGHT.tooltip.1=Molnhöjd +of.options.CLOUD_HEIGHT.tooltip.2= AV - standardhöjd +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - ovanför världens höjdgräns + +of.options.TREES=Träd +of.options.TREES.tooltip.1=Träd +of.options.TREES.tooltip.2= Standard - följer alternativet "Grafik" +of.options.TREES.tooltip.3= Snabbt - lägre kvalitet, snabbare +of.options.TREES.tooltip.4= Smart - högre kvalitet, snabbt +of.options.TREES.tooltip.5= Snyggt - högst kvalitet, långsammare +of.options.TREES.tooltip.6=Snabba träd har ogenomskinliga löv. +of.options.TREES.tooltip.7=Snygga och smarta träd har genomskinliga löv. + +of.options.RAIN=Regn och snö +of.options.RAIN.tooltip.1=Regn och snö +of.options.RAIN.tooltip.2= Standard - följer alternativet "Grafik" +of.options.RAIN.tooltip.3= Snabbt - lätt regn/snö, snabbare +of.options.RAIN.tooltip.4= Snyggt - tungt regn/snö, långsammare +of.options.RAIN.tooltip.5= AV - inget regn/snö, snabbast +of.options.RAIN.tooltip.6=Regnljud och regnstänk kommer fortfarande höras och +of.options.RAIN.tooltip.7=synas om regn stängs av. + +of.options.SKY=Himmel +of.options.SKY.tooltip.1=Himmel +of.options.SKY.tooltip.2= PÅ - himlen syns, långsammare +of.options.SKY.tooltip.3= AV - himlen syns inte, snabbare +of.options.SKY.tooltip.4=Om himlen inaktiveras syns fortfarande månen och solen. + +of.options.STARS=Stjärnor +of.options.STARS.tooltip.1=Stjärnor +of.options.STARS.tooltip.2= PÅ - stjärnor syns, långsammare +of.options.STARS.tooltip.3= AV - stjärnor syns inte, snabbare + +of.options.SUN_MOON=Sol och måne +of.options.SUN_MOON.tooltip.1=Sol och måne +of.options.SUN_MOON.tooltip.2= PÅ - solen och månen syns (standard) +of.options.SUN_MOON.tooltip.3= AV - solen och månen syns inte (snabbare) + +of.options.SHOW_CAPES=Visa mantlar +of.options.SHOW_CAPES.tooltip.1=Visa mantlar +of.options.SHOW_CAPES.tooltip.2= PÅ - visa spelarmantlar (standard) +of.options.SHOW_CAPES.tooltip.3= AV - visa inte spelarmantlar + +of.options.TRANSLUCENT_BLOCKS=Genomskinl. block +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Genomskinliga block +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Standard - följer alternativet "Grafik" +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Snyggt - korrekt färgblandning (långsammare) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Snabbt - snabb färgblandning (snabbare) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Kontrollerar färgblandningen för genomskinliga block +of.options.TRANSLUCENT_BLOCKS.tooltip.6=med olika färger (färgat glas, vatten, is) när de +of.options.TRANSLUCENT_BLOCKS.tooltip.7=placeras bakom varandra med luft emellan. + +of.options.HELD_ITEM_TOOLTIPS=Infotext för föremål +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Infotext för föremål +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= PÅ - visa infotext för hållna föremål (standard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= AV - visa inte infotext för hållna föremål + +of.options.ADVANCED_TOOLTIPS=Avancerade inforutor +of.options.ADVANCED_TOOLTIPS.tooltip.1=Avancerade inforutor +of.options.ADVANCED_TOOLTIPS.tooltip.2= PÅ - visa avancerade inforutor +of.options.ADVANCED_TOOLTIPS.tooltip.3= AV - visa inte avancerade inforutor (standard) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Avancerade inforutor visar ytterligare information om +of.options.ADVANCED_TOOLTIPS.tooltip.5=föremål (id, hållbarhet) och shaderalternativ +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, källa, standardvärden). + +of.options.DROPPED_ITEMS=Släppta föremål +of.options.DROPPED_ITEMS.tooltip.1=Släppta föremål +of.options.DROPPED_ITEMS.tooltip.2= Standard - följer alternativet "Grafik" +of.options.DROPPED_ITEMS.tooltip.3= Snabbt - renderas i 2D (snabbare) +of.options.DROPPED_ITEMS.tooltip.4= Snyggt - renderas i 3D (långsammare) + +options.entityShadows.tooltip.1=Entitetsskuggor +options.entityShadows.tooltip.2= PÅ - visa skuggor för entiteter +options.entityShadows.tooltip.3= AV - visa inte skuggor för entiteter + +of.options.VIGNETTE=Vinjett +of.options.VIGNETTE.tooltip.1=Visuell effekt som mörklägger skärmens hörn en aning +of.options.VIGNETTE.tooltip.2= Standard - följer alternativet "Grafik" (standard) +of.options.VIGNETTE.tooltip.3= Snabbt - vinjetten är inaktiverad (snabbare) +of.options.VIGNETTE.tooltip.4= Snyggt - vinjetten är aktiverad (långsammare) +of.options.VIGNETTE.tooltip.5=Vinjetten kan ha en betydande verkan på bildfrekvensen, +of.options.VIGNETTE.tooltip.6=speciellt när fullskärm är aktiverad. +of.options.VIGNETTE.tooltip.7=Vinjetteffekten är riktigt diskret och kan stängas av +of.options.VIGNETTE.tooltip.8=utan någon fara. + +of.options.DYNAMIC_FOV=Dynamiskt synfält +of.options.DYNAMIC_FOV.tooltip.1=Dynamiskt synfält +of.options.DYNAMIC_FOV.tooltip.2= PÅ - aktivera dynamiskt synfält (standard) +of.options.DYNAMIC_FOV.tooltip.3= AV - inaktivera dynamiskt synfält +of.options.DYNAMIC_FOV.tooltip.4=Ändrar synfältet när du flyger, springer eller siktar +of.options.DYNAMIC_FOV.tooltip.5=med en pilbåge. + +of.options.DYNAMIC_LIGHTS=Dynamiska ljus +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamiska ljus +of.options.DYNAMIC_LIGHTS.tooltip.2= AV - inga dynamiska ljus (standard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Snabbt - snabba dynamiska ljus (uppdat. efter 500 ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Snyggt - snygga dynamiska ljus (uppdateras i realtid) +of.options.DYNAMIC_LIGHTS.tooltip.5=Låter föremål som avger ljus (facklor, glödsten, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=lysa upp omgivningen när de hålls av dig, andra spelare +of.options.DYNAMIC_LIGHTS.tooltip.7=eller släpps ned på marken. + +# Performance + +of.options.SMOOTH_FPS=Jämn bildfrekvens +of.options.SMOOTH_FPS.tooltip.1=Stabiliserar bildfrekvensen genom att rensa grafik- +of.options.SMOOTH_FPS.tooltip.2=drivrutinernas buffertar. +of.options.SMOOTH_FPS.tooltip.3= AV - ingen stabilisering, bildfrekvensen kan variera +of.options.SMOOTH_FPS.tooltip.4= PÅ - bildfrekvensen stabiliseras +of.options.SMOOTH_FPS.tooltip.5=Beror på grafikdrivrutinerna och märks inte alltid. + +of.options.SMOOTH_WORLD=Jämn värld +of.options.SMOOTH_WORLD.tooltip.1=Tar bort prestandaproblem som orsakas av den interna +of.options.SMOOTH_WORLD.tooltip.2=servern. +of.options.SMOOTH_WORLD.tooltip.3= AV - ingen stabilisering, bildfrekvensen kan variera +of.options.SMOOTH_WORLD.tooltip.4= PÅ - bildfrekvensen stabiliseras +of.options.SMOOTH_WORLD.tooltip.5=Stabiliserar bildfrekvensen genom att fördela inläsningen +of.options.SMOOTH_WORLD.tooltip.6=av den interna servern. +of.options.SMOOTH_WORLD.tooltip.7=Fungerar endast på lokala världar (enspelarläge). + +of.options.FAST_RENDER=Snabb rendering +of.options.FAST_RENDER.tooltip.1=Snabb rendering +of.options.FAST_RENDER.tooltip.2= AV - standardrendering (standard) +of.options.FAST_RENDER.tooltip.3= PÅ - optimerad rendering (snabbare) +of.options.FAST_RENDER.tooltip.4=Använder en optimerad renderingsalgoritm som sänker +of.options.FAST_RENDER.tooltip.5=grafikprocessorns läsninghastighet och kan höja +of.options.FAST_RENDER.tooltip.6=bildfrekvensen avsevärt. +of.options.FAST_RENDER.tooltip.7=Detta alternativ kan skapa en konflikt med andra moddar. + +of.options.FAST_MATH=Snabb matematik +of.options.FAST_MATH.tooltip.1=Snabb matematik +of.options.FAST_MATH.tooltip.2= AV - standardmatematik (standard) +of.options.FAST_MATH.tooltip.3= PÅ - snabbare matematik +of.options.FAST_MATH.tooltip.4=Använder optimerade sin()- och cos()-funktioner som +of.options.FAST_MATH.tooltip.5=kan utnyttja processorcachen mer och höja bild- +of.options.FAST_MATH.tooltip.6=frekvensen. +of.options.FAST_MATH.tooltip.7=Detta alternativ kan påverka världsgenereringen minimalt. + +of.options.CHUNK_UPDATES=Datablocksuppdateringar +of.options.CHUNK_UPDATES.tooltip.1=Datablocksuppdateringar +of.options.CHUNK_UPDATES.tooltip.2= 1 - långsammare inläsning, högre bildfrekv. (standard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - snabbare inläsning, lägre bildfrekvens +of.options.CHUNK_UPDATES.tooltip.4= 5 - snabbast inläsning, lägst bildfrekvens +of.options.CHUNK_UPDATES.tooltip.5=Antalet datablocksuppdateringar per renderad bildruta. +of.options.CHUNK_UPDATES.tooltip.6=Högre värden kan göra bildfrekvensen ostabil. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamiska uppdateringar +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamiska datablocksuppdateringar +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= AV - standardantal uppdater. per bildruta (standard) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= PÅ - fler uppdateringar när spelaren står stilla +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamiska uppdateringar tvingar fler datablocks- +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=uppdateringar när spelaren står stilla för att läsa in +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=världen snabbare. + +of.options.LAZY_CHUNK_LOADING=Slö datablocksinläsning +of.options.LAZY_CHUNK_LOADING.tooltip.1=Slö datablocksinläsning +of.options.LAZY_CHUNK_LOADING.tooltip.2= AV - standardinläsning på servrar +of.options.LAZY_CHUNK_LOADING.tooltip.3= PÅ - slö datablocksinläsning på servrar (stabilare) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Jämnar ut den integrerade datablocksläsningen för +of.options.LAZY_CHUNK_LOADING.tooltip.5=servern genom att fördela datablock över flera +of.options.LAZY_CHUNK_LOADING.tooltip.6=tickningar. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Inaktivera om delar av världen inte läser in på rätt sätt. +of.options.LAZY_CHUNK_LOADING.tooltip.8=Fungerar bara i lokala världar (enspelarläge). + +of.options.RENDER_REGIONS=Renderingsområden +of.options.RENDER_REGIONS.tooltip.1=Renderingsområden +of.options.RENDER_REGIONS.tooltip.2= AV - använd inte renderingsområden (standard) +of.options.RENDER_REGIONS.tooltip.3= PÅ - använd renderingsområden +of.options.RENDER_REGIONS.tooltip.4=Renderingsområden gör att terräng renderas snabbare +of.options.RENDER_REGIONS.tooltip.5=vid högre renderingsavstånd. Mer effektivt när VBO är +of.options.RENDER_REGIONS.tooltip.6=aktiverat. +of.options.RENDER_REGIONS.tooltip.7=Rekommenderas inte för integrerade grafikkort. + +of.options.SMART_ANIMATIONS=Smarta animeringar +of.options.SMART_ANIMATIONS.tooltip.1=Smarta animeringar +of.options.SMART_ANIMATIONS.tooltip.2= AV - använd inte smarta animeringar (standard) +of.options.SMART_ANIMATIONS.tooltip.3= PÅ - använd smarta animeringar +of.options.SMART_ANIMATIONS.tooltip.4=Med smarta animeringar kommer spelet endast animera +of.options.SMART_ANIMATIONS.tooltip.5=texturer som för tillfället är synliga på skärmen. +of.options.SMART_ANIMATIONS.tooltip.6=Detta reducerar prestandaproblem och höjer bild- +of.options.SMART_ANIMATIONS.tooltip.7=frekvensen. Speciellt användbart för stora modpaket +of.options.SMART_ANIMATIONS.tooltip.8=och resurspaket i HD. + +# Animations + +of.options.animation.allOn=Allt PÅ +of.options.animation.allOff=Allt AV +of.options.animation.dynamic=Dynamiskt + +of.options.ANIMATED_WATER=Animerat vatten +of.options.ANIMATED_LAVA=Animerad lava +of.options.ANIMATED_FIRE=Animerad eld +of.options.ANIMATED_PORTAL=Animerade portaler +of.options.ANIMATED_REDSTONE=Animerad redstone +of.options.ANIMATED_EXPLOSION=Animerade explosioner +of.options.ANIMATED_FLAME=Animerade eldflammor +of.options.ANIMATED_SMOKE=Animerad rök +of.options.VOID_PARTICLES=Voidpartiklar +of.options.WATER_PARTICLES=Vattenpartiklar +of.options.RAIN_SPLASH=Regnstänk +of.options.PORTAL_PARTICLES=Portalpartiklar +of.options.POTION_PARTICLES=Brygdpartiklar +of.options.DRIPPING_WATER_LAVA=Droppande vatten/lava +of.options.ANIMATED_TERRAIN=Animerad terräng +of.options.ANIMATED_TEXTURES=Animerade texturer +of.options.FIREWORK_PARTICLES=Fyrverkeripartiklar + +# Other + +of.options.LAGOMETER=Laggmätare +of.options.LAGOMETER.tooltip.1=Visar laggmätaren på felsökningsskärmen (F3). +of.options.LAGOMETER.tooltip.2= * Orange - Minnesskräpsamling +of.options.LAGOMETER.tooltip.3= * Turkos - Antal tickningar +of.options.LAGOMETER.tooltip.4= * Blå - Schemalagda körningar +of.options.LAGOMETER.tooltip.5= * Lila - Datablocksuppladdningar +of.options.LAGOMETER.tooltip.6= * Röd - Datablocksuppdateringar +of.options.LAGOMETER.tooltip.7= * Gul - Synlighetskontroller +of.options.LAGOMETER.tooltip.8= * Grön - Terrängrendering + +of.options.PROFILER=Felsökningsprofilering +of.options.PROFILER.tooltip.1=Felsökningsprofilering +of.options.PROFILER.tooltip.2= PÅ - felsökningsprofileringen är igång, långsammare +of.options.PROFILER.tooltip.3= AV - felsökningsprofileringen är inte igång, snabbare +of.options.PROFILER.tooltip.4=Felsökningsprofileringen samlar in och visar felsöknings- +of.options.PROFILER.tooltip.5=information när felsökningsskärmen är öppen (F3). + +of.options.WEATHER=Väder +of.options.WEATHER.tooltip.1=Väder +of.options.WEATHER.tooltip.2= PÅ - väder är aktiverat, långsammare +of.options.WEATHER.tooltip.3= AV - väder är inaktiverat, snabbare +of.options.WEATHER.tooltip.4=Denna inställning omfattar regn, snö och åska. +of.options.WEATHER.tooltip.5=Detta fungerar bara i lokala världar. + +of.options.time.dayOnly=Endast dag +of.options.time.nightOnly=Endast natt + +of.options.TIME=Tid +of.options.TIME.tooltip.1=Tid +of.options.TIME.tooltip.2= Standard - vanliga dag-/nattcykler +of.options.TIME.tooltip.3= Endast dag - dag hela tiden +of.options.TIME.tooltip.4= Endast natt - natt hela tiden +of.options.TIME.tooltip.5=Tidsinställningen fungerar endast i KREATIVT läge och +of.options.TIME.tooltip.6=för lokala världar. + +options.fullscreen.tooltip.1=Fullskärm +options.fullscreen.tooltip.2= PÅ - använd fullskärmsläge +options.fullscreen.tooltip.3= AV - använd fönsterläge +options.fullscreen.tooltip.4=Fullskärmsläge kan vara snabbare eller långsammare än +options.fullscreen.tooltip.5=fönsterläge beroende på grafikkortet. + +of.options.FULLSCREEN_MODE=Fullskärmsläge +of.options.FULLSCREEN_MODE.tooltip.1=Fullskärmsläge +of.options.FULLSCREEN_MODE.tooltip.2= Standard - använd datorns upplösning, långsammare +of.options.FULLSCREEN_MODE.tooltip.3= BxH - använd anpassad upplösning, kan vara snabbare +of.options.FULLSCREEN_MODE.tooltip.4=Den valda upplösningen används i fullskärmsläge (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Lägre upplösningar bör vanligtvis vara snabbare. + +of.options.SHOW_FPS=Visa bildfrekvens +of.options.SHOW_FPS.tooltip.1=Visar kort information om bildfrekvens och rendering. +of.options.SHOW_FPS.tooltip.2= fps - bildfrekvensens medelvärde/minimum +of.options.SHOW_FPS.tooltip.3= C: - antal datablocksrenderingar +of.options.SHOW_FPS.tooltip.4= E: - antal renderade entiteter + blockentiteter +of.options.SHOW_FPS.tooltip.5= U: - antal datablocksuppdateringar +of.options.SHOW_FPS.tooltip.6=Informationen visas endast när felsökningsskärmen (F3) +of.options.SHOW_FPS.tooltip.7=inte är öppen. + +of.options.save.45s=45 s +of.options.save.90s=90 s +of.options.save.3min=3 min +of.options.save.6min=6 min +of.options.save.12min=12 min +of.options.save.24min=24 min + +of.options.AUTOSAVE_TICKS=Automatisk sparning +of.options.AUTOSAVE_TICKS.tooltip.1=Intervall för automatisk sparning. +of.options.AUTOSAVE_TICKS.tooltip.2= 45 s - standard +of.options.AUTOSAVE_TICKS.tooltip.3=Automatisk sparning kan orsaka prestandaproblem +of.options.AUTOSAVE_TICKS.tooltip.4=beroende på det synliga avståndet. +of.options.AUTOSAVE_TICKS.tooltip.5=Världen sparas även när spelmenyn är öppen. + +of.options.SCREENSHOT_SIZE=Stl. på skärmdump +of.options.SCREENSHOT_SIZE.tooltip.1=Storlek på skärmdump +of.options.SCREENSHOT_SIZE.tooltip.2= Standard - standardstorlek på skärmdumpar +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - anpassad storlek på skärmdumpar +of.options.SCREENSHOT_SIZE.tooltip.4=Större skärmdumpar kan kräva mer minne. +of.options.SCREENSHOT_SIZE.tooltip.5=Inte kompatibelt med Snabb rendering och Kantutjämning. +of.options.SCREENSHOT_SIZE.tooltip.6=Kräver att grafikprocessorn har stöd för framebuffer. + +of.options.SHOW_GL_ERRORS=Visa OpenGL-fel +of.options.SHOW_GL_ERRORS.tooltip.1=Visa OpenGL-fel +of.options.SHOW_GL_ERRORS.tooltip.2=OpenGL-fel visas i chatten när detta aktiveras. +of.options.SHOW_GL_ERRORS.tooltip.3=Inaktivera endast detta om det finns en känd konflikt och +of.options.SHOW_GL_ERRORS.tooltip.4=felen inte kan åtgärdas. +of.options.SHOW_GL_ERRORS.tooltip.5=När detta inaktiveras kommer felen fortfarande +of.options.SHOW_GL_ERRORS.tooltip.6=registreras i felloggen och kan fortfarande orsaka att +of.options.SHOW_GL_ERRORS.tooltip.7=bildfrekvensen sjunker avsevärt. + +# Chat Settings +of.options.CHAT_BACKGROUND=Chattbakgrund +of.options.CHAT_BACKGROUND.tooltip.1=Chattbakgrund +of.options.CHAT_BACKGROUND.tooltip.2= Standard - fast bredd +of.options.CHAT_BACKGROUND.tooltip.3= Kompakt - anpassas till radbredd +of.options.CHAT_BACKGROUND.tooltip.4= AV - dold + +of.options.CHAT_SHADOW=Chattskugga +of.options.CHAT_SHADOW.tooltip.1=Chattskugga +of.options.CHAT_SHADOW.tooltip.2= PÅ - använd textskugga +of.options.CHAT_SHADOW.tooltip.3= AV - ingen textskugga diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/tr_TR.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/tr_TR.lang new file mode 100644 index 0000000..1145ac8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/tr_TR.lang @@ -0,0 +1,745 @@ +# General +of.general.ambiguous=Görkemli +of.general.compact=Sıkışık +of.general.custom=Özel +of.general.from=den +of.general.id=Id +of.general.max=Maksimum +of.general.restart=Yeniden Başlat +of.general.smart=Düzgün + +# Keys +of.key.zoom=Yakınlaştır + +# Message +of.message.aa.shaders1=Düzgünleştirme shader ile uyumlu değildir. +of.message.aa.shaders2=Bu ayarı açmak için lütfen shader kapatın. + +of.message.af.shaders1=Anizotropik filtreleme shaderlerle uyumlu değildir. +of.message.af.shaders2=Bu ayarı açmak için lütfen shader kapatın. + +of.message.fr.shaders1=Hızlı yükleme shader ile uyumlu değildir. +of.message.fr.shaders2=Bu ayarı açmak için lütfen shader kapatın. + +of.message.an.shaders1=3D shaderlerle uyumlu değildir. +of.message.an.shaders2=Bu ayarı açmak için lütfen shader kapatın. + +of.message.shaders.aa1=Shaderler Düzgünleştirme ile uyumlu değildir. +of.message.shaders.aa2=Lütfen Kalite -> Düzgünleştirmeyi kapatarak oyunu yeniden başlatın. + +of.message.shaders.af1=Anizotropik filtreleme shaderler ile uyumlu değildir. +of.message.shaders.af2=Lütfen Kalite -> Anizotropik filtreleme'yi kapatın. + +of.message.shaders.fr1=Shaderler hızlı yükleme ile uyumlu değildir. +of.message.shaders.fr2=Lütfen Performans -> Hızlı Yüklemeyi kapatın. + +of.message.shaders.an1=3D shaderlerle uyumlu değildir. +of.message.shaders.an2=Lütfen Diğer -> 3D'yi kapatın. + +of.message.shaders.nv1=Bu shader paketi ileri versiyon bir optifine gerektirir: %s +of.message.shaders.nv2=Devam etmek istermisiniz? + +of.message.newVersion=Yeni bir §eOptiFine§f versiyonu bulunmakta: §e%s§f +of.message.java64Bit=§e64-bit Java§f yüklemek performansınızı arttırabilir. +of.message.openglError=§eOpenGL Hatası§f: %s (%s) + +of.message.shaders.loading=Shaderler yükleniyor: %s + +of.message.other.reset=Bütün görüntü ayarlarını reserlemek istediğine emin misin? + +of.message.loadingVisibleChunks=Görünen chunkları yükler + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine Pelerini... + +of.options.capeOF.title=OptiFine Pelerin +of.options.capeOF.openEditor=Pelerin Düzenleyiciyi Aç +of.options.capeOF.reloadCape=Pelerini Yenile + +of.message.capeOF.openEditor=Optifine pelerin düzenleyici web sayfa üzerinde açılacak. +of.message.capeOF.reloadCape=Pelerin 15 saniye içinde yenilenecek. + +of.message.capeOF.error1=Mojang Girişi Yapılamadı. Oyunu yeniden başlatmayı deneyin. +of.message.capeOF.error2=Hata: %s + +# Video settings + +options.graphics.tooltip.1=Görüntü kalitesi +options.graphics.tooltip.2= Hızlı - düşük kalite, hızlı oyun deneyimi +options.graphics.tooltip.3= Efsane - yüksek kalite, yavaş oyun deneyimi +options.graphics.tooltip.4=Ayarlar bulutlar, yapraklar, suya +options.graphics.tooltip.5=gölgeler ve çim yüzerlerine etki edecektir. + +of.options.renderDistance.tiny=Düşük +of.options.renderDistance.short=Kısa +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Uzak +of.options.renderDistance.extreme=Yüksek +of.options.renderDistance.insane=Efsane +of.options.renderDistance.ludicrous=Olağanüstü + +options.renderDistance.tooltip.1=Görüş uzaklığı +options.renderDistance.tooltip.2= 2 Düşük - 32m (en hızlı) +options.renderDistance.tooltip.3= 8 Normal - 128m (varsayılan) +options.renderDistance.tooltip.4= 16 Uzak - 256m (daha yavaş) +options.renderDistance.tooltip.5= 32 Yüksek - 512m (çok yavaş!) çok kaynak tüketir +options.renderDistance.tooltip.6= 48 Efsane - 768m, min 2G ram verilmiş olması gerekir +options.renderDistance.tooltip.7= 64 Olağanüstü - 1024m, minimum 3 g ram gerektirir +options.renderDistance.tooltip.8=16 üstündeki değerler sadece tek oyunculuda geçerlidir. + +options.ao.tooltip.1=Gerçekçi aydınlatma +options.ao.tooltip.2= Kapalı - Gerçekçi aydınlatma kapalı (hızlı) +options.ao.tooltip.3= Düşük - orta seviye gerçekçi aydınlatma (varsayılan) +options.ao.tooltip.4= Yüksek - tamamen gerçekçi aydınlatma (yavaş) + +options.framerateLimit.tooltip.1=Maksimum FPS +options.framerateLimit.tooltip.2= VSync - Ekranın alabilmesi gereken max fpse sabitler (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - diğer değerler +options.framerateLimit.tooltip.4= Sınırsız - sınır yok (en hızlı) +options.framerateLimit.tooltip.5=FPS limiti eğer ulaşılamaz ise +options.framerateLimit.tooltip.6=azaltılmalıdır. +of.options.framerateLimit.vsync=Veri Senkronizasyonu + +of.options.AO_LEVEL=Pürüzsüz aydınlatma seviyesi +of.options.AO_LEVEL.tooltip.1=Pürüzsüz aydınlatma seviyesi +of.options.AO_LEVEL.tooltip.2= Kapalı - gölge yok +of.options.AO_LEVEL.tooltip.3= 50%% - Hafif gölge +of.options.AO_LEVEL.tooltip.4= 100%% - Gerçekçi gölgeler + +options.viewBobbing.tooltip.1=Daha gerçekçi hareketler +options.viewBobbing.tooltip.2=Mipmaplar kullanılırken kapatılması en iyi sonuçları verir. + +options.guiScale.tooltip.1=Menü boyutu +options.guiScale.tooltip.2= OTO - Otomatik belirler +options.guiScale.tooltip.3= Küçük, normal, büyük, - 1x ile 3x arası +options.guiScale.tooltip.4= 4x ile 10x arası - yanlızca 4K varken mümkündür. +options.guiScale.tooltip.5=Tek sayılar (1x, 3x, 5x ...) Unicode ile uyumlu değildir. +options.guiScale.tooltip.6=Küçük menüler oyunu hızlandırabilir. + +options.vbo=VBO'ları Kullan +options.vbo.tooltip.1=Vertex Buffer Varlıklar +options.vbo.tooltip.2=Farklı bir render modeli kullanılır. +options.vbo.tooltip.3=%5-%10 arası bir hızlanma söz konusudur. + +options.gamma.tooltip.1=Ekran parlaklığını değiştirir +options.gamma.tooltip.2= Karanlık - Standart parlaklık +options.gamma.tooltip.3= 1-99% - ayarlanabilinir +options.gamma.tooltip.4= Bright - Maksimum parlaklık +options.gamma.tooltip.5=Bu ayar tamamen siyah objeleri +options.gamma.tooltip.6=görünümde değiştirmez. + +options.anaglyph.tooltip.1=3D Görünüm +options.anaglyph.tooltip.2=3D efektleri özel renkler olarak +options.anaglyph.tooltip.3=her göze verir. +options.anaglyph.tooltip.4=Kırmızı-mavi 3D gözlük gerektirir. + +of.options.ALTERNATE_BLOCKS=Alternatif bloklar +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternatif Bloklar +of.options.ALTERNATE_BLOCKS.tooltip.2=Bazı bloklar için alternatif blok türleri kullanır. +of.options.ALTERNATE_BLOCKS.tooltip.3=Seçilen resource packe göre değişir. + +of.options.FOG_FANCY=Sis +of.options.FOG_FANCY.tooltip.1=Sis çeşitleri +of.options.FOG_FANCY.tooltip.2= Hızlı - Hızlı oyun deneyimi +of.options.FOG_FANCY.tooltip.3= Kaliteli - yavaş sis, daha iyi görüntü. +of.options.FOG_FANCY.tooltip.4= Kapalı - sis yok, en hızlı. +of.options.FOG_FANCY.tooltip.5=Kaliteli sis sadece ekran kartı +of.options.FOG_FANCY.tooltip.6=destek verirse çalışır. + +of.options.FOG_START=Sis başlangıcı +of.options.FOG_START.tooltip.1=Sis Başlangıcı +of.options.FOG_START.tooltip.2= 0.2 - Sis oyuncunun yakınından başlar +of.options.FOG_START.tooltip.3= 0.8 - sis oyununcunun daha uzağından başlar +of.options.FOG_START.tooltip.4=Bu ayar performansı etkilemez. + +of.options.CHUNK_LOADING=arazi Yüklenmesi +of.options.CHUNK_LOADING.tooltip.1=arazi Loading +of.options.CHUNK_LOADING.tooltip.2= Normal - Chunklar yüklenirken FPS değişkendir. +of.options.CHUNK_LOADING.tooltip.3= Düşük - sabit FPS +of.options.CHUNK_LOADING.tooltip.4= Çok-Çekirdekli - stabil fps, 3x hızlı dünya yükleme +of.options.CHUNK_LOADING.tooltip.5=Smooth ve Çok-çekirdek arazi yüklemeleri arazi +of.options.CHUNK_LOADING.tooltip.6=yüklenmesinden dolayı oluşan kasmayı azaltır. +of.options.CHUNK_LOADING.tooltip.7=Çok-Çekirdek Fps ve Dünya yüklenmesini +of.options.CHUNK_LOADING.tooltip.8=ikinci CPU yu kullanarak 3 kat arttırır +of.options.chunkLoading.smooth=Düşük +of.options.chunkLoading.multiCore=Çok-Çekirdek + +of.options.shaders=Gölgeler... +of.options.shadersTitle=Gölgeler + +of.options.shaders.packNone=Kapalı +of.options.shaders.packDefault=(varsayılan) + +of.options.shaders.ANTIALIASING=Düzgünleştirme +of.options.shaders.ANTIALIASING.tooltip.1=Düzgünleştirme +of.options.shaders.ANTIALIASING.tooltip.2= Kapalı - (varsayılan) Düzgünleştime kapalı (en hızlı) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - çizgive köşeleri düzgünleştirir (yavaş) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA, pürüzlü hatları ve keskin renk +of.options.shaders.ANTIALIASING.tooltip.5=geçişlerini düzelten bir efekttir. +of.options.shaders.ANTIALIASING.tooltip.6=Normal düzgünleştirmeden hızlıdır. +of.options.shaders.ANTIALIASING.tooltip.7=ayrıca hızlı render ve shaderlede uyumludur. +of.options.shaders.NORMAL_MAP=Normal Harita +of.options.shaders.NORMAL_MAP.tooltip.1=Normal Harita +of.options.shaders.NORMAL_MAP.tooltip.2= Açık - (varsayılan) normal haritaları aktif eder. +of.options.shaders.NORMAL_MAP.tooltip.3= Kapalı - normal haritaları kapatır. +of.options.shaders.NORMAL_MAP.tooltip.4=Normal haritalar resource packlerde +of.options.shaders.NORMAL_MAP.tooltip.5=3D geometriyi haritaya geçirmekte kullanılabilinir. +of.options.shaders.NORMAL_MAP.tooltip.6=Normal haritalar yanlızca minecraftın temel +of.options.shaders.NORMAL_MAP.tooltip.7=texturelerini kullanır + +of.options.shaders.SPECULAR_MAP=Speküler Harita +of.options.shaders.SPECULAR_MAP.tooltip.1=Speküler Harita +of.options.shaders.SPECULAR_MAP.tooltip.2= AÇIK - (varsayılan) speküler haritayı aç +of.options.shaders.SPECULAR_MAP.tooltip.3= KAPALI - speküler haritayı kapat +of.options.shaders.SPECULAR_MAP.tooltip.4=Speküler haritalar shader paketleri tarafından +of.options.shaders.SPECULAR_MAP.tooltip.5=özel yansıma efektlerini konrol etmekte kullanılır. +of.options.shaders.SPECULAR_MAP.tooltip.6=Speküler harita dokular mevcut doku paketini +of.options.shaders.SPECULAR_MAP.tooltip.7=kullanır + +of.options.shaders.RENDER_RES_MUL=Oluşturma Kalitesi +of.options.shaders.RENDER_RES_MUL.tooltip.1=Oluşturma Kalitesi +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - düşük (en hızlı) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standart (varsayılan) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - yüksek (en yavaş) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Oluşturma kalitesi shaderlerin oluşturduğu +of.options.shaders.RENDER_RES_MUL.tooltip.6= dokunun büyüklüğünü kontrol eder. +of.options.shaders.RENDER_RES_MUL.tooltip.5=Render kalitesi dokunun büyüklüğünü kontrol eder +of.options.shaders.RENDER_RES_MUL.tooltip.6=bu shader paketi de oluşturuluyor +of.options.shaders.RENDER_RES_MUL.tooltip.7=Düşük ayarlar 4K ekranlarda kullanışlı olabilir +of.options.shaders.RENDER_RES_MUL.tooltip.8=Yüksek ayarlar düzgünleştirme filtresi olarak görev yapar. + +of.options.shaders.SHADOW_RES_MUL=Gölge Kalitesi +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Gölge Kalitesi +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - düşük (en hızlı) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standart (varsayılan) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - yüksek (en yavaş) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Gölge kalitesi gölgelerin pixelli görünmesini kontrol eder. +of.options.shaders.SHADOW_RES_MUL.tooltip.6=Shader paketlerinde kullanılır. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Düşük ayarlar = pikselli ve kalın gölgeler +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Yüksek ayarlar = detaylı, ince gölgeler + +of.options.shaders.HAND_DEPTH_MUL=El Derinliği +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=El Derinliği +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - el kameraya yakın +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (varsayılan) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - el kameraya uzak +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=El derinliği kontrolleri eldeki objelerin +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=kameradan ne kadar uzakta olduğunu kontrol eder. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Derinlik bulanıklığını kullanan shader paketlerinde +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=elde taşınan nesnenin bulanıklığını değiştirir. + +of.options.shaders.CLOUD_SHADOW=Bulut Gölgeleri + +of.options.shaders.OLD_HAND_LIGHT=Elden Işıklandırma +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=El Işıklandırması +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Normal - shader paketi kontrol eder +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= AÇIK - Elden Işıklandırmayı açar. +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= KAPALI - Elden Işıklandırmayı kapatır. +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=El ışıklandırması shader paketlerinde sadece +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=ana eldeki ışık veren malzemelerin ışık vermesini +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=sağlarken öteki eldede aynı olayın gerçekleşmesine olanak sağlar. + +of.options.shaders.OLD_LIGHTING=Eski Aydınlatma +of.options.shaders.OLD_LIGHTING.tooltip.1=Eski Aydınlatma Modeli +of.options.shaders.OLD_LIGHTING.tooltip.2= Normal - shader paketi kontrol eder. +of.options.shaders.OLD_LIGHTING.tooltip.3= Açık - eski ışıklandırmayı kullan +of.options.shaders.OLD_LIGHTING.tooltip.4= Kapalı - eski ışıklandırmayı kapat +of.options.shaders.OLD_LIGHTING.tooltip.5=Eski ışıklandırma vanilladaki blokların normal +of.options.shaders.OLD_LIGHTING.tooltip.6=ışıklandırmasını düzeltmede kullanılır. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shader paketleri genelde bu ayardan daha iyi şekilde +of.options.shaders.OLD_LIGHTING.tooltip.8=güneşin pozisyonuna göre gölgeleme sağlar. + +of.options.shaders.DOWNLOAD=Shader indir +of.options.shaders.DOWNLOAD.tooltip.1=Shader indir +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Shader paketlerini bir sayfada açar. +of.options.shaders.DOWNLOAD.tooltip.4=İndirdiğin dosyayı "Shader dosyasına" kopyala. +of.options.shaders.DOWNLOAD.tooltip.5=sonrasında shader listesinde gözükmesi gerekli. + +of.options.shaders.SHADER_PACK=Shader Paketleri + +of.options.shaders.shadersFolder=Shader dosyası +of.options.shaders.shaderOptions=Shader Ayarları... + +of.options.shaderOptionsTitle=Shader Ayarları + +of.options.quality=Kalite... +of.options.qualityTitle=Kalite Ayarları + +of.options.details=Detaylar... +of.options.detailsTitle=Detay Ayarları + +of.options.performance=Performans... +of.options.performanceTitle=Performans Ayarları + +of.options.animations=Animasyonlar... +of.options.animationsTitle=Animasyon Ayarları + +of.options.other=Diğer... +of.options.otherTitle=Diğer Ayarlar + +of.options.other.reset=Video Ayarlarını Sıfırla... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Çifter +of.options.mipmap.linear=Dikey +of.options.mipmap.nearest=En yakın +of.options.mipmap.trilinear=Üçlü + +options.mipmapLevels.tooltip.1=Görünümsel efektler uzaktaki varlıkların görünüşünü +options.mipmapLevels.tooltip.2=görünüm detaylarını gizleyerek güzelleştirir. +options.mipmapLevels.tooltip.3= Kapalı - Gölgelendirme yok +options.mipmapLevels.tooltip.4= 1 - minimum gölgelendirme +options.mipmapLevels.tooltip.5= 4 - maksimum gölgelendirme +options.mipmapLevels.tooltip.6=Bu ayarlar genelde performansı etkilemez. + +of.options.MIPMAP_TYPE=Mipmap Tipleri +of.options.MIPMAP_TYPE.tooltip.1=Görünümsel efektler uzakdaki varlıkların görüntüsünü +of.options.MIPMAP_TYPE.tooltip.2=sisleme oluşturarak güzelleştirir. +of.options.MIPMAP_TYPE.tooltip.3= Tekli - kötü sislendirme (hızlı) +of.options.MIPMAP_TYPE.tooltip.4= İkili - normal sislendirme +of.options.MIPMAP_TYPE.tooltip.5= Üçlü - iyi sislendirme +of.options.MIPMAP_TYPE.tooltip.6= Çoklu - en iyi sislendirme (yavaş) + + +of.options.AA_LEVEL=Düzgünleştirme +of.options.AA_LEVEL.tooltip.1=Düzgünleştime +of.options.AA_LEVEL.tooltip.2= KAPALI - (varsayılan) Düzgünleştirme kapalı (en hızlı) +of.options.AA_LEVEL.tooltip.3= 2-16 - Köşe ve kenarları düzgünleştirir (daha yavaş) +of.options.AA_LEVEL.tooltip.4=Düzgünleştime bozuk kenarları ve +of.options.AA_LEVEL.tooltip.5=ani renk geçişlerini düzeltir. +of.options.AA_LEVEL.tooltip.6=Açık bırakıldığında FPS düşmesine sebep olabilir. +of.options.AA_LEVEL.tooltip.7=Her seviyesi ekran kartınızla uyumlu olmayabilir. +of.options.AA_LEVEL.tooltip.8=YENİDEN BAŞLATINCA aktif olur. + +of.options.AF_LEVEL=Anizotropik filtreleme +of.options.AF_LEVEL.tooltip.1=Anizotropik filtreleme +of.options.AF_LEVEL.tooltip.2= KAPALI - (varsayılan) Standart Görüntü Detayı (en hızlı) +of.options.AF_LEVEL.tooltip.3= 2-16 - daha iyi ve ayrıntılı görünümler (daha yavaş) +of.options.AF_LEVEL.tooltip.4=Anizotropik filtreleme mipmap kullanan görüntüleri +of.options.AF_LEVEL.tooltip.5=düzenler. +of.options.AF_LEVEL.tooltip.6=Açıldığında FPS düşmesine sebep olabilir. + +of.options.CLEAR_WATER=Temiz Su +of.options.CLEAR_WATER.tooltip.1=Temiz Su +of.options.CLEAR_WATER.tooltip.2= AÇIK - temiz, altını gösteren su +of.options.CLEAR_WATER.tooltip.3= KAPALI - normal su + +of.options.RANDOM_ENTITIES=Rastgele Varlıklar +of.options.RANDOM_ENTITIES.tooltip.1=Rastgele Varlıklar +of.options.RANDOM_ENTITIES.tooltip.2= Kapalı - tek varlık görüntüsü, hızlı oyun. +of.options.RANDOM_ENTITIES.tooltip.3= AÇIK - rastgele varlık görüntüsü, yavaş oyun. +of.options.RANDOM_ENTITIES.tooltip.4=Rastgele varlıklar varlıklar için rastgele görünümler kullanır. +of.options.RANDOM_ENTITIES.tooltip.5=İçinde birden fazla varlık görünümü bulunan texture pack gerektirir. + +of.options.BETTER_GRASS=Kaliteli Çim +of.options.BETTER_GRASS.tooltip.1=Daha İyi Çim +of.options.BETTER_GRASS.tooltip.2= KAPALI - normal çimli yüzeyler, hızlı oyun. +of.options.BETTER_GRASS.tooltip.3= Hızlı - hertarafı çimli yüzeyler, yavaş oyun +of.options.BETTER_GRASS.tooltip.4= Kaliteli - yüzeye bağlı çim, en yavaş oyun + +of.options.BETTER_SNOW=Kaliteli Kar +of.options.BETTER_SNOW.tooltip.1=Kaliteli Kar +of.options.BETTER_SNOW.tooltip.2= KAPALI - normal kar, hızlı +of.options.BETTER_SNOW.tooltip.3= AÇIK - daha iyi kar, yavaş +of.options.BETTER_SNOW.tooltip.4=arkası görünen bloklarda (çit,çimen) +of.options.BETTER_SNOW.tooltip.5=etrafı karla kaplıysa kar gösterir + +of.options.CUSTOM_FONTS=Özel Yazı Tipi +of.options.CUSTOM_FONTS.tooltip.1=Özel Yazı Tipleri +of.options.CUSTOM_FONTS.tooltip.2= AÇIK - özelleştrilmiş yazı (varsayılan), yavaş oyun +of.options.CUSTOM_FONTS.tooltip.3= KAPALI - minecraft merkez yazı tipini kullanır, hızlı oyun +of.options.CUSTOM_FONTS.tooltip.4=Özel Yazı Tipleri görüntü paketleri tarafından +of.options.CUSTOM_FONTS.tooltip.5=desteklenir. + +of.options.CUSTOM_COLORS=Özel Renkler +of.options.CUSTOM_COLORS.tooltip.1=Özel Renkler +of.options.CUSTOM_COLORS.tooltip.2= AÇIK - özel renkler kullanır (varsayılan), daha yavaş +of.options.CUSTOM_COLORS.tooltip.3= KAPALI - normal renkleri kullanır, daha hızlı +of.options.CUSTOM_COLORS.tooltip.4=Özel renkler sadece texture pack tarafından +of.options.CUSTOM_COLORS.tooltip.5=desteklenir. + +of.options.SWAMP_COLORS=Bataklık Renkleri +of.options.SWAMP_COLORS.tooltip.1=Bataklık renkleri +of.options.SWAMP_COLORS.tooltip.2= AÇIK - bataklık renkleri kullan (varsayılan) daha yavaş oyun +of.options.SWAMP_COLORS.tooltip.3= KAPALI - renk değişimi yapma, daha hızlı +of.options.SWAMP_COLORS.tooltip.4=Bataklık renkleri yaprak, sarmaşık çim gibi bloklara etki eder. + +of.options.SMOOTH_BIOMES=Biyom Blokları +of.options.SMOOTH_BIOMES.tooltip.1=Biyom Geçişleri +of.options.SMOOTH_BIOMES.tooltip.2= AÇIK - Blokları değiştirir (varsayılan) daha yavaş +of.options.SMOOTH_BIOMES.tooltip.3= KAPALI - Blok renkleri sabit, daha hızlı +of.options.SMOOTH_BIOMES.tooltip.4=Bu ayar etrafındaki blokların renklerine ve biyoma göre +of.options.SMOOTH_BIOMES.tooltip.5=bazı blokların görünümlerinde değişmeye sebep olur. +of.options.SMOOTH_BIOMES.tooltip.6=Su yaprak, sarmaşık, çim gibi bloklarda etkilidir. + +of.options.CONNECTED_TEXTURES=Bağlantılı Görüntüler +of.options.CONNECTED_TEXTURES.tooltip.1=Bağlantılı Görüntüler +of.options.CONNECTED_TEXTURES.tooltip.2= KAPALI - Bağlantılı Görünüm Yok (varsayılan) +of.options.CONNECTED_TEXTURES.tooltip.3= Fast - Hızlıca bağlanan görünüm, orta donma +of.options.CONNECTED_TEXTURES.tooltip.4= Fancy - kaliteli bağlantılı görünümler, yavaş. +of.options.CONNECTED_TEXTURES.tooltip.5=Bağlantılı görünüş cam, kumtaşı, kitap rafı +of.options.CONNECTED_TEXTURES.tooltip.6=gibi bloklar yan yana koyulduklarında görünümlerinin +of.options.CONNECTED_TEXTURES.tooltip.7=bütün gibi gösterilmesidir. +of.options.CONNECTED_TEXTURES.tooltip.8=resource packe göre değişebilir. + +of.options.NATURAL_TEXTURES=Doğal Görünümler +of.options.NATURAL_TEXTURES.tooltip.1=Doğal Görünümler +of.options.NATURAL_TEXTURES.tooltip.2= KAPALI - Doğal görünüm yok (varsayılan) +of.options.NATURAL_TEXTURES.tooltip.3= AÇIK - doğal görünümler kullanır. +of.options.NATURAL_TEXTURES.tooltip.4=Doğal görünümler ardarda tekrar eden blokların +of.options.NATURAL_TEXTURES.tooltip.5=görünümlerinde tekrarı engeller. +of.options.NATURAL_TEXTURES.tooltip.6=Merkez görünümün döndürülmesi sonucu doğal görünüm +of.options.NATURAL_TEXTURES.tooltip.7=elde edilir. Destekleyen texture paketlerine göre +of.options.NATURAL_TEXTURES.tooltip.8=çalışma şekli değişebilir. + +of.options.EMISSIVE_TEXTURES=Yayıcı Görünümler +of.options.EMISSIVE_TEXTURES.tooltip.1=Yayıcı Görünümler +of.options.EMISSIVE_TEXTURES.tooltip.2= KAPALI - yayıcı görünümler kapalı (varsayılan) +of.options.EMISSIVE_TEXTURES.tooltip.3= AÇIK - yayıcı görünümleri kullanır +of.options.EMISSIVE_TEXTURES.tooltip.4=tam ışık alan yüzeylerdeki görünümü değiştirir. +of.options.EMISSIVE_TEXTURES.tooltip.5=Ana görünümün ışık alan taraflarını simüle etmede +of.options.EMISSIVE_TEXTURES.tooltip.6=kullanılabilinir. Yayıcı görünümler herhangi +of.options.EMISSIVE_TEXTURES.tooltip.7=bir görünüm paketine +of.options.EMISSIVE_TEXTURES.tooltip.8=uygulanabilinir. + +of.options.CUSTOM_SKY=Özel Gökyüzü +of.options.CUSTOM_SKY.tooltip.1=Özel Gökyüzü +of.options.CUSTOM_SKY.tooltip.2= AÇIK - Özel Gökyüzü Görünümü (varsayılan) yavaş oyun +of.options.CUSTOM_SKY.tooltip.3= KAPALI - normal gökyüzü, daha hızlı +of.options.CUSTOM_SKY.tooltip.4=Farklı gökyüzü görünümleri texture pack +of.options.CUSTOM_SKY.tooltip.5=değiştirilmesi ile etkiini gösterir. + +of.options.CUSTOM_ITEMS=Farklı Eşya Görünümü +of.options.CUSTOM_ITEMS.tooltip.1=Farklı Eşya Görünümü +of.options.CUSTOM_ITEMS.tooltip.2= AÇIK - çeşitli eşya görünümler (varsayılan) yavaş +of.options.CUSTOM_ITEMS.tooltip.3= KAPALI - tek eşya görünümü, daha hızlı oyun +of.options.CUSTOM_ITEMS.tooltip.4=Farklı eşya görünümleri farklı görünüm paketlerinde +of.options.CUSTOM_ITEMS.tooltip.5=etkisini gösterecektir. + +of.options.CUSTOM_ENTITY_MODELS=Özel Varlık Modelleri +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Özel Varlık Modelleri +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= AÇIK - özel varlık Modelleri (varsayılan) yavaş oyun +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= KAPALI - normal varlık modelleri, daha hızlı +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Özel varlık modelleri sadece destek veren +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=resource packler içindir. + +of.options.CUSTOM_GUIS=Özel Menüler +of.options.CUSTOM_GUIS.tooltip.1=Özel Menüler +of.options.CUSTOM_GUIS.tooltip.2= AÇIK - Özel Menüler (varsayılan) daha yavaş +of.options.CUSTOM_GUIS.tooltip.3= KAPALI - Merkez Menüler, daha hızlı +of.options.CUSTOM_GUIS.tooltip.4=Kullanılan texture packe göre değişiklik gösterebilir. + +# Detaylar + +of.options.CLOUDS=Bulutlar +of.options.CLOUDS.tooltip.1=Bulutlar +of.options.CLOUDS.tooltip.2= Normal - as set by setting Graphics +of.options.CLOUDS.tooltip.3= Hızlı - düşük kalite, daha hızlı +of.options.CLOUDS.tooltip.4= Kaliteli - daha kaliteli, daha yavaş +of.options.CLOUDS.tooltip.5= KAPALI - bulutlar kapalı, fastest +of.options.CLOUDS.tooltip.6=Hızlı bulutlar 2D olarak yapılır. +of.options.CLOUDS.tooltip.7=Kaliteli Bulutlar 3D olarak yapılır. + +of.options.CLOUD_HEIGHT=Bulut yüksekliği +of.options.CLOUD_HEIGHT.tooltip.1=Bulut Yüksekliği +of.options.CLOUD_HEIGHT.tooltip.2= KAPALI - Normal Yükseklik +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - inşa sınırında + +of.options.TREES=Ağaçlar +of.options.TREES.tooltip.1=Ağaçlar +of.options.TREES.tooltip.2= Normal - Grafik ayarlarına göre değişir. +of.options.TREES.tooltip.3= Hızlı - düşük kalite, daha hızlı +of.options.TREES.tooltip.4= Güzel - daha iyi kalite, fast +of.options.TREES.tooltip.5= Kaliteli - en yüksek kalite, daha yavaş +of.options.TREES.tooltip.6=Hızlı kalitede yapraklar arkasını göstermez. +of.options.TREES.tooltip.7=Kaliteli ve güzel ayarda yapraklar arkasını gösterir. + +of.options.RAIN=Yağmur & Kar +of.options.RAIN.tooltip.1=Yağmur & Kar +of.options.RAIN.tooltip.2= Normal - Grafik ayarlarına göre değişir +of.options.RAIN.tooltip.3= Hızlı - hafif yağmur/kar, daha hızlı +of.options.RAIN.tooltip.4= Kaliteli - yoğun yağmur/kar, daha yavaş +of.options.RAIN.tooltip.5= KAPALI - yağmur/kar kapalı, fastest +of.options.RAIN.tooltip.6=Yağmur KAPALIya ayarlanırsa yağmur tanecikleri ve +of.options.RAIN.tooltip.7=yağmru sesi hala aktif olacaktır. + +of.options.SKY=Gökyüzü +of.options.SKY.tooltip.1=Gökyüzü +of.options.SKY.tooltip.2= AÇIK - gökyüzü görünürdür, daha yavaş +of.options.SKY.tooltip.3= KAPALI - gökyüzü kalitesizdir, daha hızlı +of.options.SKY.tooltip.4=Gökyüzü KAPALI ayarlansa bile ay ve güneş görünür. + +of.options.STARS=Yıldızlar +of.options.STARS.tooltip.1=Yıldızlar +of.options.STARS.tooltip.2= AÇIK - yızlızlar görünürdür, daha yavaş +of.options.STARS.tooltip.3= KAPALI - yıldızlar görünmez, daha hızlı + +of.options.SUN_MOON=Güneş & Ay +of.options.SUN_MOON.tooltip.1=Güneş & Ay +of.options.SUN_MOON.tooltip.2= AÇIK - güneş ve ay görünürdür. (varsayılan) +of.options.SUN_MOON.tooltip.3= KAPALI - Güneş ve ay görünmez. (daha hızlı) + +of.options.SHOW_CAPES=Pelerinleri Göster +of.options.SHOW_CAPES.tooltip.1=Pelerinleri Göster +of.options.SHOW_CAPES.tooltip.2= AÇIK - Oyuncu Pelerinlerini Gösterir (varsayılan) +of.options.SHOW_CAPES.tooltip.3= KAPALI - Oyuncu Pelerinlerini Göstermez + +of.options.TRANSLUCENT_BLOCKS=Yarı Saydam Bloklar +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Yarı Saydam Bloklar +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Normal - Grafik ayarlarına bağlıdır. +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Kaliteli - Düzgün renk karışımı (daha yavaş) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Hızlı - hızlı renk karışımı (daha hızlı) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Yarı saydam blokların (renkli cam, su, buz) gibi +of.options.TRANSLUCENT_BLOCKS.tooltip.6=aralarında hava boşluğu var iken +of.options.TRANSLUCENT_BLOCKS.tooltip.7=renk karışımlarını ayarlar. + +of.options.HELD_ITEM_TOOLTIPS=Tutulan Eşya İpuçları +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Tutulan Eşya İpuçları +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= AÇIK - tutulan eşya için bilgiler verir (varsayılan) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= KAPALI - eşya için bilgiler vermez + +of.options.ADVANCED_TOOLTIPS=Ayrıntılı Bilgiler +of.options.ADVANCED_TOOLTIPS.tooltip.1=Ayrıntılı Bilgiler +of.options.ADVANCED_TOOLTIPS.tooltip.2= AÇIK - ayrıntılı bilgileri gösterir +of.options.ADVANCED_TOOLTIPS.tooltip.3= KAPALI - ayrıntılı bilgileri gösterme (varsayılan) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Ayrıntılı Bilgiler eşyaları idleri kalan ömürleri +of.options.ADVANCED_TOOLTIPS.tooltip.5= ayrıca shaderlerin ise kaynak id ve +of.options.ADVANCED_TOOLTIPS.tooltip.6=varsayılan verilerini gösterir. + +of.options.DROPPED_ITEMS=Atılan Eşyalar +of.options.DROPPED_ITEMS.tooltip.1=Atılan Eşyalar +of.options.DROPPED_ITEMS.tooltip.2= Varsayılan - Grafik ayarlarına göre ayarlanır. +of.options.DROPPED_ITEMS.tooltip.3= Hızlı - 2D atılan eşyalar (daha hızlı) +of.options.DROPPED_ITEMS.tooltip.4= Kaliteli - 3D atılan eşyalar (daha yavaş) + +options.entityShadows.tooltip.1=Varlık Gölgeleri +options.entityShadows.tooltip.2= AÇIK - Varlık Gölgelerini göster +options.entityShadows.tooltip.3= KAPALI - Varlık Gölgelerini gösterme + +of.options.VIGNETTE=Kenar Yumuşatması +of.options.VIGNETTE.tooltip.1=Köşelere doğru hafif kararma yaparak gerçekçi görünüm sağlar. +of.options.VIGNETTE.tooltip.2= Varsayılan - Grafik ayarlarına göre değişir (varsayılan) +of.options.VIGNETTE.tooltip.3= Hızlı - kenar yumuşatma devre dışı (daha hızlı) +of.options.VIGNETTE.tooltip.4= Kaliteli - kenar yumuşatma aktif (daha yavaş) +of.options.VIGNETTE.tooltip.5=Kenar yumuşatması AÇIK ayarlıyken FPS'e etki edebilir, +of.options.VIGNETTE.tooltip.6=özellikle tam ekranlarda. +of.options.VIGNETTE.tooltip.7=Kenar yumuşatma efekti hafifdir ve rahatlıkla +of.options.VIGNETTE.tooltip.8=devre dışı bırakabilirsiniz + +of.options.DYNAMIC_FOV=Değişken Bakış Açısı +of.options.DYNAMIC_FOV.tooltip.1=Değişken Bakış Açısı +of.options.DYNAMIC_FOV.tooltip.2= AÇIK - Değişken Bakış Açısı Aktif (varsayılan) +of.options.DYNAMIC_FOV.tooltip.3= KAPALI - Değişken Bakış Açısını devre dışı bırakır +of.options.DYNAMIC_FOV.tooltip.4=Bakış açısını uçarken, koşarken veya bir yay +of.options.DYNAMIC_FOV.tooltip.5=kullanırken değiştirir. + +of.options.DYNAMIC_LIGHTS=Dinamik Işınlandırma +of.options.DYNAMIC_LIGHTS.tooltip.1=Dinamik Işınlandırma +of.options.DYNAMIC_LIGHTS.tooltip.2= KAPALI - Dinamik Işıklandırma kapalı (varsayılan) +of.options.DYNAMIC_LIGHTS.tooltip.3= Hızlı - hızlı dinamik ışıklandırma (her yarım saniyede günceller) +of.options.DYNAMIC_LIGHTS.tooltip.4= Kaliteli - Kaliteli Dinamik Işıklandırma (anlık günceller) +of.options.DYNAMIC_LIGHTS.tooltip.5=Işık yayan varlıkların (meşale gibi) ele alındıklarında +of.options.DYNAMIC_LIGHTS.tooltip.6=yere atıldıklarında yada başka bir oyuncu elinde +of.options.DYNAMIC_LIGHTS.tooltip.7=tuttuğunda etrafına ışık vermesini sağlar. +# Performans + +of.options.SMOOTH_FPS=Smooth FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizes FPS by flushing the graphic driver buffers. +of.options.SMOOTH_FPS.tooltip.2= KAPALI - stabilizasyon kapalı, fps dengesizdir. +of.options.SMOOTH_FPS.tooltip.3= AÇIK - FPS'de denge vardır. +of.options.SMOOTH_FPS.tooltip.4=grafik sürücülerine bağlı bir ayardır. +of.options.SMOOTH_FPS.tooltip.5=Her zaman gözle görülen etkisi yoktur. + +of.options.SMOOTH_WORLD=Sisli Dünya +of.options.SMOOTH_WORLD.tooltip.1=Dünya yüklenmesinden kaynaklı donmayı azaltır. +of.options.SMOOTH_WORLD.tooltip.2= KAPALI - stabilizasyon yoktur, donma sorunları oluşur. +of.options.SMOOTH_WORLD.tooltip.3= AÇIK - FPS dengelidir +of.options.SMOOTH_WORLD.tooltip.4=Dünya yüklenmesi sırasında oluşan donmayı azaltır. +of.options.SMOOTH_WORLD.tooltip.5=Sadece tek oyunculuda geçerlidir. + +of.options.FAST_RENDER=Hızlı Yükleme +of.options.FAST_RENDER.tooltip.1=Hızlı Yükleme +of.options.FAST_RENDER.tooltip.2= KAPALI - Standart yükleme (varsayılan) +of.options.FAST_RENDER.tooltip.3= AÇIK - optimizasyonlu yükleme (daha hızlı) +of.options.FAST_RENDER.tooltip.4=Daha az CPU harcayan ve Fps'i yükselten farklı +of.options.FAST_RENDER.tooltip.5=bir argoritma kullanan yükleme şeklidir. +of.options.FAST_RENDER.tooltip.6=Bazı modlarla çakışabilir. + +of.options.FAST_MATH=Hızlı Hesap +of.options.FAST_MATH.tooltip.1=Hızlı Hesap +of.options.FAST_MATH.tooltip.2= KAPALI - Standart Hesaplama (varsayılan) +of.options.FAST_MATH.tooltip.3= AÇIK - daha hızlı hesaplama +of.options.FAST_MATH.tooltip.4=optimize edilmiş sin() ve cos() hesapları kullanır. +of.options.FAST_MATH.tooltip.5=Bu durum CPU kullanımını azaltır ve FPS arttırır +of.options.FAST_MATH.tooltip.6=Dünya oluşturmada azda olsa etkilidir. + +of.options.CHUNK_UPDATES=Arazi Güncellemeleri +of.options.CHUNK_UPDATES.tooltip.1=Arazi Güncellemeleri +of.options.CHUNK_UPDATES.tooltip.2= 1 - daha yavaş dünya yüklemesi, daha fazla FPS (varsayılan) +of.options.CHUNK_UPDATES.tooltip.3= 3 - daha hızlı dünya yüklemesi, daha düşük FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - en hızlı dünya yüklemesi, en düşük FPS +of.options.CHUNK_UPDATES.tooltip.5=Her ayarlanan ekrana yüklenecek arazi miktarı, +of.options.CHUNK_UPDATES.tooltip.6=FPS dengesizliğine sebep olabilir. + +of.options.CHUNK_UPDATES_DYNAMIC=Sürekli Güncelleme +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Sürekli Arazi Güncellemesi +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= KAPALI - her saniyede standard arazi güncellemesi (varsayılan) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= AÇIK - Oyuncu sabitken daha fazla güncelleme +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Oyuncu sabitken arazilerin güncellenmesi dünyanın +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=daha hızlı yüklenmesine olanak tanır. + +of.options.LAZY_CHUNK_LOADING=Yavaş Arazi Yüklenmesi +of.options.LAZY_CHUNK_LOADING.tooltip.1=Yavaş Arazi Yüklenmesi +of.options.LAZY_CHUNK_LOADING.tooltip.2= KAPALI - normal arazi yüklenmesi +of.options.LAZY_CHUNK_LOADING.tooltip.3= AÇIK - yavaş arazi yüklenmesi (daha rahat) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Bilinmeyen yada yüklenmemiş arazileri +of.options.LAZY_CHUNK_LOADING.tooltip.5=bir anlığına sisli olarak gösterebilir. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Eğer dünyalar düzgün yüklenmiyorsa devre dışı bırakın +of.options.LAZY_CHUNK_LOADING.tooltip.7=Yanlızca tek oyunculuda geçerlidir. + +of.options.RENDER_REGIONS=Bölgesel Yüklenme +of.options.RENDER_REGIONS.tooltip.1=Bölgesel yüklenme +of.options.RENDER_REGIONS.tooltip.2= KAPALI - bölgesel yüklenme kullanmaz (varsayılan) +of.options.RENDER_REGIONS.tooltip.3= AÇIK - bölgesel yüklenmeyi kullanır +of.options.RENDER_REGIONS.tooltip.4=Bölgesel yüklenme daha uzak noktalarda daha rahat yüklenmeyi +of.options.RENDER_REGIONS.tooltip.5=sağlar. VBO aktifken daha hızlıdır +of.options.RENDER_REGIONS.tooltip.6=Entegre grafik kartlarına önerilmez. + +of.options.SMART_ANIMATIONS=Rahat Animasyonlar +of.options.SMART_ANIMATIONS.tooltip.1=Rahat Animasyonlar +of.options.SMART_ANIMATIONS.tooltip.2= KAPALI - rahat animasyonları kullanmaz (varsayılan) +of.options.SMART_ANIMATIONS.tooltip.3= AÇIK - rahat animasyonları kullanır +of.options.SMART_ANIMATIONS.tooltip.4=Rahat animasyonlar ile sadece bilgisayarınızda görünen +of.options.SMART_ANIMATIONS.tooltip.5=animasyonlu blokların animasyonu aktif olacaktır. +of.options.SMART_ANIMATIONS.tooltip.6=Bu ayar FPS i yükseltip anlık donmaları engeller. +of.options.SMART_ANIMATIONS.tooltip.7=Büyük mod paketleri ve HD görüntü paketlerinde etkilidir. + +# Animasyonlar + +of.options.animation.allOn=Tamamı Açık +of.options.animation.allOff=Tamamı Kapalı +of.options.animation.dynamic=Dinamik + +of.options.ANIMATED_WATER=Su Animasyonu +of.options.ANIMATED_LAVA=Lav Animasyonu +of.options.ANIMATED_FIRE=Ateş Animasyonu +of.options.ANIMATED_PORTAL=Portal Animasyonu +of.options.ANIMATED_REDSTONE=Kızıltaş Animasyonu +of.options.ANIMATED_EXPLOSION=Patlama Animasyonu +of.options.ANIMATED_FLAME=Yanma Animasyonu +of.options.ANIMATED_SMOKE=Duman Animasyonu +of.options.VOID_PARTICLES=Boşluk Animasyonu +of.options.WATER_PARTICLES=Su parçacıkları +of.options.RAIN_SPLASH=Yağmur Parçacıkları +of.options.PORTAL_PARTICLES=Portal Parçacıkları +of.options.POTION_PARTICLES=İksir Parçacıkları +of.options.DRIPPING_WATER_LAVA=Su/Lav Damlaları +of.options.ANIMATED_TERRAIN=Yer Animasyonları +of.options.ANIMATED_TEXTURES=Görüntüsel Animasyonlar +of.options.FIREWORK_PARTICLES=Havai-Fişek Parçacıkları + +# Başka + +of.options.LAGOMETER=LagÖlçer +of.options.LAGOMETER.tooltip.1=F3 menüsünde FPS gösterir. +of.options.LAGOMETER.tooltip.2=* Orange - Çöp Yer Miktarı +of.options.LAGOMETER.tooltip.3=* Cyan - An +of.options.LAGOMETER.tooltip.4=* Blue - Zamanlanmış Olaylar +of.options.LAGOMETER.tooltip.5=* Purple - Arazi Yüklemesi +of.options.LAGOMETER.tooltip.6=* Red - Arazi Güncellemesi +of.options.LAGOMETER.tooltip.7=* Yellow - Görünümsel Kontrol +of.options.LAGOMETER.tooltip.8=* Green - Yeryüzü Yüklemesi + +of.options.PROFILER=Hata Giderme Profili +of.options.PROFILER.tooltip.1=Hata Giderme Profili +of.options.PROFILER.tooltip.2= AÇIK - hata giderme profili aktif, daha yavaş +of.options.PROFILER.tooltip.3= KAPALI - hata giderme profili deaktif, daha hızlı +of.options.PROFILER.tooltip.4=Hata giderme profili bilgi toplar ve +of.options.PROFILER.tooltip.5=bu bilgileri F3'e basınca gösterir. + +of.options.WEATHER=Hava +of.options.WEATHER.tooltip.1=Haca +of.options.WEATHER.tooltip.2= AÇIK - hava aktiftir, daha yavaş +of.options.WEATHER.tooltip.3= KAPALI - hava aktif değildir, daha hızlı +of.options.WEATHER.tooltip.4=Hava ayarı yağmuru karı ve fırtınaları kontrol eder. +of.options.WEATHER.tooltip.5=Yanlızca tek oyunculuda geçerlidir. + +of.options.time.dayOnly=Sadece Gündüz +of.options.time.nightOnly=Sadece Gece + +of.options.TIME=Zaman +of.options.TIME.tooltip.1=Zaman +of.options.TIME.tooltip.2= Varsayılan - normal gece/gündüz döngüsü +of.options.TIME.tooltip.3= Sadece gündüz - Sürekli Gündüz +of.options.TIME.tooltip.4= Sadece Gece - Sürekli Gece +of.options.TIME.tooltip.5=Zaman değiştirme sadece yaratıcı mod +of.options.TIME.tooltip.6=ve tek oyunculu içindir. + +options.fullscreen.tooltip.1=Tam Ekran +options.fullscreen.tooltip.2= AÇIK - Tam Ekran Modunu Kullanır +options.fullscreen.tooltip.3= KAPALI - Pencere Modu Kullanır +options.fullscreen.tooltip.4=Fullscreen modu pencere modundan grafik +options.fullscreen.tooltip.5=kartına göre daha hızlı veya yavaş olabilir. + +of.options.FULLSCREEN_MODE=Tam Ekran Modu +of.options.FULLSCREEN_MODE.tooltip.1=Tam Ekran Modu +of.options.FULLSCREEN_MODE.tooltip.2= Varsatyılan - ekran çözünürlüğünü kullanır, daha yavaş +of.options.FULLSCREEN_MODE.tooltip.3= Y x G - özel yükseklik ve genişlik, daha hızlı olabilir +of.options.FULLSCREEN_MODE.tooltip.4=Seçilen çözünürlük tam ekranda kullanılabilinir (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Düşük çözünürlükler daha hızlı daha hızlı olabilir. + +of.options.SHOW_FPS=FPS göster +of.options.SHOW_FPS.tooltip.1=Küçük alanda FPS ve yükleme bilgisi gösterir. +of.options.SHOW_FPS.tooltip.2= Fps - maksimum/minimum +of.options.SHOW_FPS.tooltip.3= C: - arazi yüklemesi +of.options.SHOW_FPS.tooltip.4= E: - yüklenen varlık ve blok varlıklar +of.options.SHOW_FPS.tooltip.5= U: - arazi güncellemeri +of.options.SHOW_FPS.tooltip.6=Bu küçük FPS bilgisi sadece hata giderme +of.options.SHOW_FPS.tooltip.7=dkapalıyken gözükür + +of.options.save.default=Normal (2s) +of.options.save.20s=20 saniye +of.options.save.3min=3 dakika +of.options.save.30min=30 dakika +of.options.save.12min=12 dakika +of.options.save.24min=24 dakika + +of.options.AUTOSAVE_TICKS=Oto Kayıt +of.options.AUTOSAVE_TICKS.tooltip.1=Sürekli Oto Kayıt +of.options.AUTOSAVE_TICKS.tooltip.2=Normal Oto kayıt (2 saniye) ÖNERİLMEZ! +of.options.AUTOSAVE_TICKS.tooltip.3=Çok miktarda donma ve kasmaya sebep olabilir. +of.options.AUTOSAVE_TICKS.tooltip.4=Ayrıca oyun menüye dönüldüğündede kaydolur. + +of.options.SCREENSHOT_SIZE=Ekran Alıntısı Boyutu +of.options.SCREENSHOT_SIZE.tooltip.1=Ekran Alıntısı Boyutu +of.options.SCREENSHOT_SIZE.tooltip.2= Varsayılan - Varsayılan Ekran Alıntısı Boyutu +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - özel boyutlar +of.options.SCREENSHOT_SIZE.tooltip.4=büyük boyutlarda ekran alıntıları daha fazla alan gerektirir. +of.options.SCREENSHOT_SIZE.tooltip.5=Hızlı yükleme ve düzgünleştirme ile uyumlu değildir. +of.options.SCREENSHOT_SIZE.tooltip.6=Kaliteli bir GPU gerektirir. + +of.options.SHOW_GL_ERRORS=GL Hatalarını Göster +of.options.SHOW_GL_ERRORS.tooltip.1=OpenGL Hatalarını Göster +of.options.SHOW_GL_ERRORS.tooltip.2=Aktifken Konuşma Yerinde Gösterir. +of.options.SHOW_GL_ERRORS.tooltip.3=Bu ayarıeğer bilinen bir hata var ve +of.options.SHOW_GL_ERRORS.tooltip.4=çözülemiyorsa devre dışı bırakın +of.options.SHOW_GL_ERRORS.tooltip.5=Devre dışı bırakıldığında bile hata dosyasında bulunacak +of.options.SHOW_GL_ERRORS.tooltip.6=ve bu durum FPS düşüşlerine sebep olabilir. + +# Chat Settings + +of.options.CHAT_BACKGROUND=Sohbet Arkaplanı +of.options.CHAT_BACKGROUND.tooltip.1=Sohbet Arkaplanı +of.options.CHAT_BACKGROUND.tooltip.2= Varsayılan - Düzgün genişlik +of.options.CHAT_BACKGROUND.tooltip.3= Sıkışık - Metinle eş uzunlukta +of.options.CHAT_BACKGROUND.tooltip.4= Kapalı - Arkaplan yok + +of.options.CHAT_SHADOW=Chat Shadow +of.options.CHAT_SHADOW.tooltip.1=Sohbet gölgesi +of.options.CHAT_SHADOW.tooltip.2= Açık - Sohbet gölgesi kullan +of.options.CHAT_SHADOW.tooltip.3= Kapalı - Sohbet gölgesi kullanma diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/uk_UA.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/uk_UA.lang new file mode 100644 index 0000000..d659ccb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/uk_UA.lang @@ -0,0 +1,746 @@ +#Translated by Cool_boy and HIKC +# Загальні +of.general.ambiguous=Невизначений +of.general.compact=Компактний +of.general.custom=Користувацький +of.general.from=З +of.general.id=ID +of.general.max=Максимум +of.general.restart=Перезапуск +of.general.smart=Розумно + +# Керування +of.key.zoom=Приблизити + +# Повідомлення +of.message.aa.shaders1=Згладжування не сумісне з шейдерами. +of.message.aa.shaders2=Будь ласка, вимкніть шейдери щоб увімкнути цю функцію. + +of.message.af.shaders1=Анізотропна фільтрація не сумісна з шейдерами. +of.message.af.shaders2=Будь ласка, вимкніть шейдери щоб увімкнути цю функцію. + +of.message.fr.shaders1=Швидкий рендер не сумісний з шейдерами. +of.message.fr.shaders2=Будь ласка, вимкніть шейдери щоб увімкнути цю функцію. + +of.message.an.shaders1=3D ефект не сумісний з шейдерами. +of.message.an.shaders2=Будь, ласка, вимкніть шейдери щоб увімкнути цю функцію. + +of.message.shaders.aa1=Шейдери не сумісні зі згладжуванням. +of.message.shaders.aa2=Будь ласка, встановіть Якість -> Згладжування на Вимк і перезапустіть гру. + +of.message.shaders.af1=Шейдери не сумісні з анізотропною фільтрацією. +of.message.shaders.af2=Будь ласка, встановіть Якість -> Анізотропна фільтрація на Вимк і перезапустіть гру. + +of.message.shaders.fr1=Шейдери не сумісні зі швидким рендером. +of.message.shaders.fr2=Будь ласка, встановіть Продуктивність -> Швидкий рендер на Вимк і перезапустіть гру. + +of.message.shaders.an1=Шейдери не сумісні з 3D анагліфом. +of.message.shaders.an2=Будь-ласка, встановіть Інші -> 3D ефект на Вимк. + +of.message.shaders.nv1=Цей шейдерпак вимагає новішу версію OptiFine: %s +of.message.shaders.nv2=Ви впевнені що бажаєте продовжити? + +of.message.newVersion=Нова версія §eOptiFine§f доступна: §e%s§f +of.message.java64Bit=Встанови §e64-bit Java§f щоб покращити продуктивність +of.message.openglError=§eOpenGL Error§f: %s (%s) + +of.message.shaders.loading=Завантажуємо шейдери: %s + +of.message.other.reset=Встановити всі налаштування на їхні початкові значення? + +of.message.loadingVisibleChunks=Завантажування видимих чанків + +# Налаштування скіна + +of.options.skinCustomisation.ofCape=Плащ OptiFine... + +of.options.capeOF.title=Плащ +of.options.capeOF.openEditor=Редактор плаща +of.options.capeOF.reloadCape=Перезавантажити плащ + +of.message.capeOF.openEditor=Редактор плаща OptiFine відкриєтся у браузері. +of.message.capeOF.reloadCape=Ваш плащ перезавантажиться за 15 секунд. + +of.message.capeOF.error1=Аутентифікація не вдалася. +of.message.capeOF.error2=Помилка: %s + +# Налаштування графіки + +options.graphics.tooltip.1=Якість графіки +options.graphics.tooltip.2= Швидка - низька якість, швидше +options.graphics.tooltip.3= Красива - висока якість, повільніше +options.graphics.tooltip.4=Змінює зовнішній вигляд хмар, листя води +options.graphics.tooltip.5=тіней і сторін трави. + +of.options.renderDistance.tiny=Маленька +of.options.renderDistance.short=Коротка +of.options.renderDistance.normal=Нормальна +of.options.renderDistance.far=Далека +of.options.renderDistance.extreme=Екстремальна +of.options.renderDistance.insane=Шалена +of.options.renderDistance.ludicrous=Безглузда! + +options.renderDistance.tooltip.1=Видима відстань +options.renderDistance.tooltip.2= 2 Маленька - 32м (найшвидше) +options.renderDistance.tooltip.3= 8 Нормальна - 128м (нормальна) +options.renderDistance.tooltip.4= 16 Далека - 256м (повільніше) +options.renderDistance.tooltip.5= 32 Надзвичайна - 512м (найповільніше!) потребує багато ресурсів +options.renderDistance.tooltip.6= 48 Шалена - 768m, потребує 2GB оперативної пам'яті +options.renderDistance.tooltip.7= 64 Безглузда - 1024m, потребує 3GB оперативної пам'яті +options.renderDistance.tooltip.8= Значення більше ніж 16 ефективні лише для локальних світів. + +options.ao.tooltip.1=М'яке освітлення +options.ao.tooltip.2= Вимк - без м'якого освітлення (Швидка) +options.ao.tooltip.3= Мінімум - просте м'яке освітлення (повільніше) +options.ao.tooltip.4= Максимум - комплексне м'яке освітлення (дуже повільно) + +options.framerateLimit.tooltip.1=Максимальна швидкість передачі кадрів +options.framerateLimit.tooltip.2= VSync - ліміт до максимальної кількості кадрів монітора (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - змінні +options.framerateLimit.tooltip.4= Необмежено - без ліміту (Найшвидше) +options.framerateLimit.tooltip.5=Гранична частота зміни кадрів зменшує FPS навіть якщо +options.framerateLimit.tooltip.6=значення ліміту не досягнуто. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Рівень м'якого освітлення +of.options.AO_LEVEL.tooltip.1=Рівень м'якого освітлення +of.options.AO_LEVEL.tooltip.2= Вимк - без тіней +of.options.AO_LEVEL.tooltip.3= 50%% - легкі тіні +of.options.AO_LEVEL.tooltip.4= 100%% - темні тіні + +options.viewBobbing.tooltip.1=Реалістичний рух +options.viewBobbing.tooltip.2=При використанні міпмапів встановіть його в положення Вимк для досягнення найкращих результатів. + +options.guiScale.tooltip.1=Розмір GUI +options.guiScale.tooltip.2= Авто - максимальний розмір +options.guiScale.tooltip.3= Малий, Нормальний, Великий - 1x до 3x +options.guiScale.tooltip.4= 4x до 10x - доступні на 4K дисплеях +options.guiScale.tooltip.5=Непарні значення (1x, 3x, 5x ...) не підтримуються юнікодом. +options.guiScale.tooltip.6=Менший GUI швидший. + +options.vbo=Використовувати VBO +options.vbo.tooltip.1=Об'єкти буфера вершин +options.vbo.tooltip.2=Використовує альтернативну технологію рендерингу, що зазвичай +options.vbo.tooltip.3=швидше (5-10%%) чим простий рендер. + +options.gamma.tooltip.1=Зменшує яскравість темніших об'єктів +options.gamma.tooltip.2= Похмурий - Стандартна яскравість +options.gamma.tooltip.3= 1-99%% - змінні +options.gamma.tooltip.4= Яскраво - максимальна яскравість темних об'єктів +options.gamma.tooltip.5=Ця опція не змінює яскравість +options.gamma.tooltip.6=повністю чорних об'єктів + +options.anaglyph.tooltip.1=3D анагліф +options.anaglyph.tooltip.2=Вмикає стереоскопічний 3D ефекти використовуючи різні кольори +options.anaglyph.tooltip.3=для кожного ока. +options.anaglyph.tooltip.4=Потребує червоно-сині окуляри для перегляду. + +of.options.ALTERNATE_BLOCKS=Альтернативні блоки +of.options.ALTERNATE_BLOCKS.tooltip.1=Альтернативні блоки +of.options.ALTERNATE_BLOCKS.tooltip.2=Використовує альтернативні моделі для деяких блоків. +of.options.ALTERNATE_BLOCKS.tooltip.3=Базується на обраному ресурспаці. + +of.options.FOG_FANCY=Туман +of.options.FOG_FANCY.tooltip.1=Тип туману +of.options.FOG_FANCY.tooltip.2= Швидкий - Швидкий туман +of.options.FOG_FANCY.tooltip.3= Красивий - Повільніший туман, виглядає краще +of.options.FOG_FANCY.tooltip.4= Вимк - без туману, найшвидше +of.options.FOG_FANCY.tooltip.5=Красивий туман буде доступний лиш тоді, коли +of.options.FOG_FANCY.tooltip.6=його підтримує відеокарта. + +of.options.FOG_START=Поява туману +of.options.FOG_START.tooltip.1=Поява туману +of.options.FOG_START.tooltip.2= 0.2 - туман з'являється недалеко від гравця +of.options.FOG_START.tooltip.3= 0.8 - туман з'являється далеко від гравця +of.options.FOG_START.tooltip.4=Ця опція зазвичай не зменшує продуктивність. + +of.options.CHUNK_LOADING=Завантаження чанків +of.options.CHUNK_LOADING.tooltip.1=Завантаження чанків +of.options.CHUNK_LOADING.tooltip.2= Базове - нестабільне FPS коли завантажується чанк +of.options.CHUNK_LOADING.tooltip.3= Згладжене - стабільне FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - стабільне FPS, 3x швидше завантаження світу +of.options.CHUNK_LOADING.tooltip.5=Згладжене і Multi-Core видаляють заїкання та +of.options.CHUNK_LOADING.tooltip.6=фрізи спричинені завантаженням чанків. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core може збільшити до 3 разів швидкість завантаження світу +of.options.CHUNK_LOADING.tooltip.8=збільшуючи FPS завдяки використанню другого ядра процесора. +of.options.chunkLoading.smooth=Згладжене +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Шейдери... +of.options.shadersTitle=Шейдери + +of.options.shaders.packNone=Вимк +of.options.shaders.packDefault=(внутрішній) + +of.options.shaders.ANTIALIASING=Згладжування +of.options.shaders.ANTIALIASING.tooltip.1=Згладжування +of.options.shaders.ANTIALIASING.tooltip.2= Вимк - (базово) без згладжування (швидше) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - згладжені лінії та краї (повільніше) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA це пост-ефект який згладжує +of.options.shaders.ANTIALIASING.tooltip.5=гострі краї та різкі зміни кольорів. +of.options.shaders.ANTIALIASING.tooltip.6=Це швидше ніж традиційне згладжування +of.options.shaders.ANTIALIASING.tooltip.7=і працює із Швидким Рендером. + +of.options.shaders.NORMAL_MAP=Нормальна мапа +of.options.shaders.NORMAL_MAP.tooltip.1=Нормальна мапа +of.options.shaders.NORMAL_MAP.tooltip.2= Увімк - (базово) дозволити нормальні мапи +of.options.shaders.NORMAL_MAP.tooltip.3= Вимк - вимкнути нормальні мапи +of.options.shaders.NORMAL_MAP.tooltip.4=Шейдер використовує нормальні мапи +of.options.shaders.NORMAL_MAP.tooltip.5=щоб симулювати 3D геометрію на плоских моделях. +of.options.shaders.NORMAL_MAP.tooltip.6=Нормальна мапа встановлюється +of.options.shaders.NORMAL_MAP.tooltip.7=обраним шейдером. + +of.options.shaders.SPECULAR_MAP=Дзеркальна мапа +of.options.shaders.SPECULAR_MAP.tooltip.1=Дзеркальна мапа +of.options.shaders.SPECULAR_MAP.tooltip.2= Увімк - (базово) увімкнути дзеркальні мапи +of.options.shaders.SPECULAR_MAP.tooltip.3= Вимк - вимкнути дзеркальні мапи +of.options.shaders.SPECULAR_MAP.tooltip.4=Шейдер використовує дзеркальні мапи +of.options.shaders.SPECULAR_MAP.tooltip.5=щоб симулювати віддзеркалення. +of.options.shaders.SPECULAR_MAP.tooltip.6=Дзеркальна мапа встановлюється +of.options.shaders.SPECULAR_MAP.tooltip.7=обраним шейдером. + +of.options.shaders.RENDER_RES_MUL=Якість рендеру +of.options.shaders.RENDER_RES_MUL.tooltip.1=Якість рендеру +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - низька (швидка) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - стандартна (базова) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - висока (повільна) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Якість рендеру контролює розмір текстури +of.options.shaders.RENDER_RES_MUL.tooltip.6=які шейдер використовує. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Низька якість буде корисна для 4K дисплеїв. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Висока якість працює як згладжування. + +of.options.shaders.SHADOW_RES_MUL=Якість тіней +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Якість тіней +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - низька (швидка) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - стандартна (базова) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - висока (повільна) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Якість тіней контролює розмір текстури +of.options.shaders.SHADOW_RES_MUL.tooltip.6=тіней яку використовує шейдер. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Низька якість = неточні, грубі тіні. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Висока якість = точні, красиві тіні. + +of.options.shaders.HAND_DEPTH_MUL=Глибина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Глибина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - рука коло камери +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (базово) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - рука далеко від камери +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Глибина руки контролює наскільки далеко +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=знаходяться предмети в руці від камери. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Для шейдерів з глибоким розмиттям це змінить +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=розмиття предметів в руці. + +of.options.shaders.CLOUD_SHADOW=Тіні від хмар + +of.options.shaders.OLD_HAND_LIGHT=Старе освітл. руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Старе освітлення руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Стандартне - залежить від шейдера +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Увімк - використовувати старе +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Вимк - використовувати нове +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Це дозволяє шейдерам які працюють лише з +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=освітленням в основній руці працювати з +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=речами в другій. + +of.options.shaders.OLD_LIGHTING=Старе освітлення +of.options.shaders.OLD_LIGHTING.tooltip.1=Старе освітлення +of.options.shaders.OLD_LIGHTING.tooltip.2= Стандартне - залежить від шейдера +of.options.shaders.OLD_LIGHTING.tooltip.3= Увімк - використовувати старе +of.options.shaders.OLD_LIGHTING.tooltip.4= Вимк - не використовувати старе +of.options.shaders.OLD_LIGHTING.tooltip.5=Старе освітлення контролює фіксовану базову +of.options.shaders.OLD_LIGHTING.tooltip.6=освітленість сторони блока. +of.options.shaders.OLD_LIGHTING.tooltip.7=Шейдери зазвичай надають краще освітлення в +of.options.shaders.OLD_LIGHTING.tooltip.8=залежності від позиції сонця. + +of.options.shaders.DOWNLOAD=Завантажити Шейдери +of.options.shaders.DOWNLOAD.tooltip.1=Завантажити шейдери +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=Відкриває сторінку зі списком шейдерпаків. +of.options.shaders.DOWNLOAD.tooltip.4=Перенесіть шейдери у теку shaderpacks і вони +of.options.shaders.DOWNLOAD.tooltip.5=з'являться у списку встановлених шейдерів. + +of.options.shaders.SHADER_PACK=Шейдерпак + +of.options.shaders.shadersFolder=Папка з шейдерами +of.options.shaders.shaderOptions=Налаштування шейдерів... + +of.options.shaderOptionsTitle=Налаштування шейдерів + +of.options.quality=Якість... +of.options.qualityTitle=Налаштування якості + +of.options.details=Деталі... +of.options.detailsTitle=Налаштування деталей + +of.options.performance=Продуктивність... +of.options.performanceTitle=Налаштування продуктивності + +of.options.animations=Анімації... +of.options.animationsTitle=Налаштування анімації + +of.options.other=Інші... +of.options.otherTitle=Інші налаштування + +of.options.other.reset=Скинути всі налаштування... + +of.shaders.profile=Профіль + +# Якість + +of.options.mipmap.bilinear=Білінійна +of.options.mipmap.linear=Лінійна +of.options.mipmap.nearest=Найближча +of.options.mipmap.trilinear=Трилінійна + +options.mipmapLevels.tooltip.1=Візуальний ефект який змушує далекі об'єкти виглядати краще +options.mipmapLevels.tooltip.2=розмиваючи деталі текстур +options.mipmapLevels.tooltip.3= Вимк - без згладжування +options.mipmapLevels.tooltip.4= 1 - мінімальне згладжування +options.mipmapLevels.tooltip.5= Максимум - максимальне згладжування +options.mipmapLevels.tooltip.6=Ця опція зазвичай не впливає на продуктивність. + +of.options.MIPMAP_TYPE=Тип Міпмап +of.options.MIPMAP_TYPE.tooltip.1=Візуальний ефект який змушує далекі об'єкти виглядати краще +of.options.MIPMAP_TYPE.tooltip.2=розмиваючи деталі текстур +of.options.MIPMAP_TYPE.tooltip.3= Найближчий - грубе згладжування (найшвидша) +of.options.MIPMAP_TYPE.tooltip.4= Лінійне - нормальне згладжування +of.options.MIPMAP_TYPE.tooltip.5= Білінійне - краще згладжування +of.options.MIPMAP_TYPE.tooltip.6= Трилінійне - найкраще згладжування (повільніше) + + +of.options.AA_LEVEL=Згладжування +of.options.AA_LEVEL.tooltip.1=Згладжування +of.options.AA_LEVEL.tooltip.2= Вимк - (базове) без згладжування (швидке) +of.options.AA_LEVEL.tooltip.3= 2-16 - згладжує лінії та границі (повільніше) +of.options.AA_LEVEL.tooltip.4=Згладжування розмиває зазубрені границі й +of.options.AA_LEVEL.tooltip.5=гострі зміни кольору. +of.options.AA_LEVEL.tooltip.6=Коли увімкнуто, то по суті зменшує FPS. +of.options.AA_LEVEL.tooltip.7=Не всі рівні підтримуються різними відеокартами. +of.options.AA_LEVEL.tooltip.8=Ефективне після ПЕРЕЗАПУСКУ! + +of.options.AF_LEVEL=Анізотропна фільтрація +of.options.AF_LEVEL.tooltip.1=Анізотропна фільтрація +of.options.AF_LEVEL.tooltip.2= Вимк - (базово) стандартна деталь текстури (швидка) +of.options.AF_LEVEL.tooltip.3= 2-16 - кращі деталі в Міпмап текстурах (повільніше) +of.options.AF_LEVEL.tooltip.4=Анізотропна фільтрація відновлює деталі в +of.options.AF_LEVEL.tooltip.5=Міпмап текстурах. +of.options.AF_LEVEL.tooltip.6=Коли ввімкнуто, зменшує FPS. + +of.options.CLEAR_WATER=Чиста вода +of.options.CLEAR_WATER.tooltip.1=Чиста вода +of.options.CLEAR_WATER.tooltip.2= Увімк - чиста, прозора вода +of.options.CLEAR_WATER.tooltip.3= Вимк - стандартна вода + +of.options.RANDOM_ENTITIES=Випадкові істоти +of.options.RANDOM_ENTITIES.tooltip.1=Випадкові текстури для істот +of.options.RANDOM_ENTITIES.tooltip.2= Вимк - лише одна текстура, швидше +of.options.RANDOM_ENTITIES.tooltip.3= Увімк - випадкові текстури, повільніше +of.options.RANDOM_ENTITIES.tooltip.4=Ця функція дозволяє використовувати різні текстури для однієї істоти. +of.options.RANDOM_ENTITIES.tooltip.5=Задається ресурспаком з різними текстурами для однієї істоти (моба). + +of.options.BETTER_GRASS=Краща трава +of.options.BETTER_GRASS.tooltip.1=Краща трава +of.options.BETTER_GRASS.tooltip.2= Вимк - базова текстура блока трави, швидше +of.options.BETTER_GRASS.tooltip.3= Швидка - зелена бокова текстура блока трави, повільніше +of.options.BETTER_GRASS.tooltip.4= Красива - динамічна текстура сторони блока, повільніше + +of.options.BETTER_SNOW=Кращий сніг +of.options.BETTER_SNOW.tooltip.1=Кращий сніг +of.options.BETTER_SNOW.tooltip.2= Вимк - базовий сніг, швидше +of.options.BETTER_SNOW.tooltip.3= Увімк - кращий сніг, повільніше +of.options.BETTER_SNOW.tooltip.4=Показує сніг під прозорими блоками (огорожа, висока трава) +of.options.BETTER_SNOW.tooltip.5=коли межує з блоком снігу + +of.options.CUSTOM_FONTS=Власні шрифти +of.options.CUSTOM_FONTS.tooltip.1=Власні шрифти +of.options.CUSTOM_FONTS.tooltip.2= Увімк - використовує власні шрифти (базово), повільніше +of.options.CUSTOM_FONTS.tooltip.3= Вимк - використовує базовий шрифт, швидше +of.options.CUSTOM_FONTS.tooltip.4=Власні шрифти встановлюються ресурспаком +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Власні кольори +of.options.CUSTOM_COLORS.tooltip.1=Custom Colors +of.options.CUSTOM_COLORS.tooltip.2= Увімк - використовує власні кольори (базово), повільніше +of.options.CUSTOM_COLORS.tooltip.3= Вимк - використовує базові кольори, швидше +of.options.CUSTOM_COLORS.tooltip.4=Власні кольори встановлюються ресурспаком +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Кольори болота +of.options.SWAMP_COLORS.tooltip.1=Кольори болота +of.options.SWAMP_COLORS.tooltip.2= Увімк - використовуються кольори болота (базово), повільніше +of.options.SWAMP_COLORS.tooltip.3= Вимк - не використовує кольори болота, швидше +of.options.SWAMP_COLORS.tooltip.4=Кольори болота впливають на траву, листя, воду і ліани. + +of.options.SMOOTH_BIOMES=Плавні біоми +of.options.SMOOTH_BIOMES.tooltip.1=Плавні біоми +of.options.SMOOTH_BIOMES.tooltip.2= Увімк - згладжування границі біомів (базово), повільніше +of.options.SMOOTH_BIOMES.tooltip.3= Вимк - без згладжування границь біомів, швидше +of.options.SMOOTH_BIOMES.tooltip.4=Згладжування зміняє кольори декількох блоків на границі +of.options.SMOOTH_BIOMES.tooltip.5=щоб зменшити різку зміну кольорів. +of.options.SMOOTH_BIOMES.tooltip.6=Впливає на траву, листя, воду і ліани. + +of.options.CONNECTED_TEXTURES=З'єднані текстури +of.options.CONNECTED_TEXTURES.tooltip.1=З'єднані текстури +of.options.CONNECTED_TEXTURES.tooltip.2= Вимк - без поєднаних текстур (базово) +of.options.CONNECTED_TEXTURES.tooltip.3= Швидка - швидкі поєднані текстури +of.options.CONNECTED_TEXTURES.tooltip.4= Красива - красиві поєднані текстури +of.options.CONNECTED_TEXTURES.tooltip.5=З'єднані текстури впливають на скло, +of.options.CONNECTED_TEXTURES.tooltip.6=пісковик і полички, що розташовані +of.options.CONNECTED_TEXTURES.tooltip.7=разом. Приєднанні текстури підтримують +of.options.CONNECTED_TEXTURES.tooltip.8=обрані ресурспаки. + +of.options.NATURAL_TEXTURES=Натуральні текстури +of.options.NATURAL_TEXTURES.tooltip.1=Натуральні текстури +of.options.NATURAL_TEXTURES.tooltip.2= Вимк - без натуральних текстур (базово) +of.options.NATURAL_TEXTURES.tooltip.3= Увімк - використовує натуральні текстури +of.options.NATURAL_TEXTURES.tooltip.4=Натуральні текстури видаляють сітку як шаблон +of.options.NATURAL_TEXTURES.tooltip.5=створений повторенням блоків одного типу. +of.options.NATURAL_TEXTURES.tooltip.6=Це використовує перевернуті та повернуті текстури +of.options.NATURAL_TEXTURES.tooltip.7=блока. Налаштування натуральних текстур +of.options.NATURAL_TEXTURES.tooltip.8=надходить з обраного пакета текстур. + +of.options.EMISSIVE_TEXTURES=Випромін. текстури +of.options.EMISSIVE_TEXTURES.tooltip.1=Випромінювальні текстури +of.options.EMISSIVE_TEXTURES.tooltip.2= Увімк - використання випромінювальних текстур +of.options.EMISSIVE_TEXTURES.tooltip.3= Вимк - без випромінювальних текстур +of.options.EMISSIVE_TEXTURES.tooltip.4=Випромінюючі текстури завжди відображаються з повною яскравістю. +of.options.EMISSIVE_TEXTURES.tooltip.5=Їх можно використовувати для імітації випромінювання світла +of.options.EMISSIVE_TEXTURES.tooltip.6=частинами основної текстури. +of.options.EMISSIVE_TEXTURES.tooltip.7=Додається обраним ресурспаком. +of.options.EMISSIVE_TEXTURES.tooltip.8= + +of.options.CUSTOM_SKY=Власне небо +of.options.CUSTOM_SKY.tooltip.1=Власне небо +of.options.CUSTOM_SKY.tooltip.2= Увімк - власні текстури неба (базово), повільніше +of.options.CUSTOM_SKY.tooltip.3= Вимк - базове небо, швидше +of.options.CUSTOM_SKY.tooltip.4=Власна текстура неба може бути змінена +of.options.CUSTOM_SKY.tooltip.5=ресурспаком + +of.options.CUSTOM_ITEMS=Власні речі +of.options.CUSTOM_ITEMS.tooltip.1=Власні текстури речей +of.options.CUSTOM_ITEMS.tooltip.2= Увімк - власні текстури речей (базово), повільніше +of.options.CUSTOM_ITEMS.tooltip.3= Вимк - базові речі, швидше +of.options.CUSTOM_ITEMS.tooltip.4=Власна текстура неба може бути змінена +of.options.CUSTOM_ITEMS.tooltip.5=ресурспаком + +of.options.CUSTOM_ENTITY_MODELS=Власні моделі істот +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Власні моделі істот +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Увімк - власні моделі для істот (базово), повільніше +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Вимк - стандартні моделі істот, швидше +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Моделі істот можуть бути змінені +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=ресурспаком + +of.options.CUSTOM_GUIS=Власні GUI +of.options.CUSTOM_GUIS.tooltip.1=Власні GUI +of.options.CUSTOM_GUIS.tooltip.2= Увімк - власні GUI (базово), повільніше +of.options.CUSTOM_GUIS.tooltip.3= Вимк - стандартні GUI, швидше +of.options.CUSTOM_GUIS.tooltip.4=Власні GUI встановлюються ресурспаком. + +# Details + +of.options.CLOUDS=Хмари +of.options.CLOUDS.tooltip.1=Хмари +of.options.CLOUDS.tooltip.2= Стандартні - як в налаштуваннях відео +of.options.CLOUDS.tooltip.3= Швидкі - нижча якість, швидше +of.options.CLOUDS.tooltip.4= Красива - вища якість, повільніше +of.options.CLOUDS.tooltip.5= Вимк - без хмар, найшвидше +of.options.CLOUDS.tooltip.6=Швидкі хмари відображаються у 2D. +of.options.CLOUDS.tooltip.7=Красиві хмари відображаються у 3D. + +of.options.CLOUD_HEIGHT=Висота хмар +of.options.CLOUD_HEIGHT.tooltip.1=Висота хмар +of.options.CLOUD_HEIGHT.tooltip.2= Вимк - стандартна висота +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - вище ліміту світу + +of.options.TREES=Дерева +of.options.TREES.tooltip.1=Дерева +of.options.TREES.tooltip.2= Стандартні - як в налаштуваннях відео +of.options.TREES.tooltip.3= Швидкі - нижча якість, швидше +of.options.TREES.tooltip.4= Розумні - вища якість, швидше +of.options.TREES.tooltip.5= Красива - найвища якість, повільніше +of.options.TREES.tooltip.6=Швидкі дерева мають непрозоре листя. +of.options.TREES.tooltip.7=Красиві дерева мають прозорі листя. + +of.options.RAIN=Дощ і сніг +of.options.RAIN.tooltip.1=Дощ і сніг +of.options.RAIN.tooltip.2= Стандартні - як в налаштуваннях відео +of.options.RAIN.tooltip.3= Швидкі - нижча якість, швидше +of.options.RAIN.tooltip.4= Красиві - важкий дощ/сніг, повільніше +of.options.RAIN.tooltip.5= Вимк - без дощу/снігу, найшвидше +of.options.RAIN.tooltip.6=Коли дощ вимкнено звуки крапель залишатимуться +of.options.RAIN.tooltip.7= + +of.options.SKY=Небо +of.options.SKY.tooltip.1=Небо +of.options.SKY.tooltip.2= Увімк - небо видиме, повільніше +of.options.SKY.tooltip.3= Вимк - небо невидиме, швидше +of.options.SKY.tooltip.4=Коли небо вимкнене, сонце і місяць досі помітні. + +of.options.STARS=Зірки +of.options.STARS.tooltip.1=Зірки +of.options.STARS.tooltip.2= Увімк - зірки видимі, повільніше +of.options.STARS.tooltip.3= Вимк - зірки невидимі, швидше + +of.options.SUN_MOON=Сонце і місяць +of.options.SUN_MOON.tooltip.1=Сонце і місяць +of.options.SUN_MOON.tooltip.2= Увімк - сонце і місяць видимі (базово) +of.options.SUN_MOON.tooltip.3= Вимк - сонце і місяць невидимі (швидше) + +of.options.SHOW_CAPES=Показувати плащі +of.options.SHOW_CAPES.tooltip.1=Показувати плащі +of.options.SHOW_CAPES.tooltip.2= Увімк - показувати плащі (базово) +of.options.SHOW_CAPES.tooltip.3= Вимк - не показувати плащі (швидше) + +of.options.TRANSLUCENT_BLOCKS=Напівпроз. блоки +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Напівпрозорі блоки +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Стандартне - як в налаштуваннях графіки +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Красива - правильне змішування кольорів (повільніше) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Швидка - швидше змішування кольорів (швидше) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Контролює змішування кольорів напівпрозорих блоків +of.options.TRANSLUCENT_BLOCKS.tooltip.6=з різним кольором (скло, вода, лід) +of.options.TRANSLUCENT_BLOCKS.tooltip.7=коли між ними є повітря. + +of.options.HELD_ITEM_TOOLTIPS=Спливаючі підказки +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Спливаючі підказки +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Увімк - показувати спливаючі підказки (базово) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Вимк - не показувати підказок + +of.options.ADVANCED_TOOLTIPS=Розширені підказки +of.options.ADVANCED_TOOLTIPS.tooltip.1=Розширені підказки що спливають +of.options.ADVANCED_TOOLTIPS.tooltip.2= Увімк - показувати розширені підказки +of.options.ADVANCED_TOOLTIPS.tooltip.3= Вимк - не показувати розширені підказки (базово) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Розширені підказки показують більше інформації про +of.options.ADVANCED_TOOLTIPS.tooltip.5=речі (id, міцність) і для налаштування шейдерів +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, джерело, стандартне значення) + +of.options.DROPPED_ITEMS=Викинуті речі +of.options.DROPPED_ITEMS.tooltip.1=Викинуті речі +of.options.DROPPED_ITEMS.tooltip.2= Стандартні - як в налаштуваннях графіки +of.options.DROPPED_ITEMS.tooltip.3= Швидка - викинуті речі у 2D (швидше) +of.options.DROPPED_ITEMS.tooltip.4= Красива - викинуті речі у 3D (повільніше) + +options.entityShadows.tooltip.1=Тіні сутностей +options.entityShadows.tooltip.2= Увімк - показувати тіні сутностей +options.entityShadows.tooltip.3= Вимк - вимкнути тіні сутностей + +of.options.VIGNETTE=Віньєтка +of.options.VIGNETTE.tooltip.1=Візуальний ефект який затемняє краї +of.options.VIGNETTE.tooltip.2= Стандартне - як в налаштуваннях графіки +of.options.VIGNETTE.tooltip.3= Швидка - віньєтка вимкнена (швидша) +of.options.VIGNETTE.tooltip.4= Красива - віньєтка увімкнена (повільніше) +of.options.VIGNETTE.tooltip.5=Віньєтка може зробити істотний вплив на FPS, +of.options.VIGNETTE.tooltip.6=особливо при грі у повноекранному режимі. +of.options.VIGNETTE.tooltip.7=Ефект не дуже важливий і легко +of.options.VIGNETTE.tooltip.8=може бути вимкненим + +of.options.DYNAMIC_FOV=Динамічний FOV +of.options.DYNAMIC_FOV.tooltip.1=Динамічний FOV +of.options.DYNAMIC_FOV.tooltip.2= Увімк - динамічний FOV увімкнуто(базово) +of.options.DYNAMIC_FOV.tooltip.3= Вимк - динамічний FOV вимкнуто +of.options.DYNAMIC_FOV.tooltip.4=Змінює поле зору (FOV) коли літаємо, біжимо +of.options.DYNAMIC_FOV.tooltip.5=чи натягуємо лук. + +of.options.DYNAMIC_LIGHTS=Динамічне освітлення +of.options.DYNAMIC_LIGHTS.tooltip.1=Динамічне освітлення +of.options.DYNAMIC_LIGHTS.tooltip.2= Вимк - без динамічного освітлення (базово) +of.options.DYNAMIC_LIGHTS.tooltip.3= Швидка - швидке динамічне освітлення (оновлення кожні 500мс) +of.options.DYNAMIC_LIGHTS.tooltip.4= Красива - красиве динамічне освітлення (оновлення в реальному часу) +of.options.DYNAMIC_LIGHTS.tooltip.5=Дозволяє випромінювати світло речам (факел, світлокамінь, т.д.) +of.options.DYNAMIC_LIGHTS.tooltip.6=щоб освітлювати все навкруги, коли знаходяться в руці, +of.options.DYNAMIC_LIGHTS.tooltip.7=вдягнуті іншим гравцем або викинуті на землю. + +# Performance + +of.options.SMOOTH_FPS=Згладжене FPS +of.options.SMOOTH_FPS.tooltip.1=Стабілізує FPS промиванням графічних буферів драйвера +of.options.SMOOTH_FPS.tooltip.2= Вимк - нема стабілізації, FPS може коливатись +of.options.SMOOTH_FPS.tooltip.3= Увімк - FPS стабілізується +of.options.SMOOTH_FPS.tooltip.4=Цей параметр залежить від графічного драйвера +of.options.SMOOTH_FPS.tooltip.5=і його вплив не завжди помітний + +of.options.SMOOTH_WORLD=Згладжений світ +of.options.SMOOTH_WORLD.tooltip.1=Прибирає фрізи при завантаженні чатків. +of.options.SMOOTH_WORLD.tooltip.2= Вимк - нема стабілізації, FPS може коливатись +of.options.SMOOTH_WORLD.tooltip.3= Увімк - FPS стабілізується +of.options.SMOOTH_WORLD.tooltip.4=Стабілізує FPS лише в одиночній грі. +of.options.SMOOTH_WORLD.tooltip.5=Не пливає на FPS при грі на сервері. + +of.options.FAST_RENDER=Швидкий рендер +of.options.FAST_RENDER.tooltip.1=Швидкий рендер +of.options.FAST_RENDER.tooltip.2= Вимк - стандартний рендер (базово) +of.options.FAST_RENDER.tooltip.3= Увімк - оптимізований рендер (швидший) +of.options.FAST_RENDER.tooltip.4=Використовує оптимізований алгоритм рендерингу +of.options.FAST_RENDER.tooltip.5=зменшує навантаження на процесор і збільшить FPS. +of.options.FAST_RENDER.tooltip.6=Ця опція може конфліктувати з деякими модами. + +of.options.FAST_MATH=Швидка математика +of.options.FAST_MATH.tooltip.1=Швидка математика +of.options.FAST_MATH.tooltip.2= Вимк - стандартна математика(базово) +of.options.FAST_MATH.tooltip.3= Увімк - швидша математика +of.options.FAST_MATH.tooltip.4=Використовує оптимізовані функції sin() і cos(), що може краще +of.options.FAST_MATH.tooltip.5=утилізувати кеш, і збільшити FPS. +of.options.FAST_MATH.tooltip.6=Ця опція може мати мінімальний вплив генерацію світу. + +of.options.CHUNK_UPDATES=Оновлення чанків +of.options.CHUNK_UPDATES.tooltip.1=Оновлення чанків +of.options.CHUNK_UPDATES.tooltip.2= 1 - Повільніше завантаження світу, більший FPS (базово) +of.options.CHUNK_UPDATES.tooltip.3= 3 - Швидше оновлення чанків, нижчий FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - Найшвидше оновлення чанків, найнижчий FPS +of.options.CHUNK_UPDATES.tooltip.5=Кількість оновленн чанку за один кадр, +of.options.CHUNK_UPDATES.tooltip.6=найбільші значення можуть зменшити FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Динамічні оновлення +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Динамічні оновлення чанків +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Вимк - стандартне оновлення чанків за кадр (базово) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Увімк - більше оновленнь коли гравець стоїть +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Динамічні оновлення змушують виконувати більше оновлень чанків +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=коли гравець стоїть, світ провантажується швидше. + +of.options.LAZY_CHUNK_LOADING=Ліниві чанки +of.options.LAZY_CHUNK_LOADING.tooltip.1=Ліниве завантаження чанків +of.options.LAZY_CHUNK_LOADING.tooltip.2= Вимк - базове серверне завантаження чанків +of.options.LAZY_CHUNK_LOADING.tooltip.3= Увімк - ліниве завантаження серверних чанків (плавніше) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Згладжує завантаження чанків вбудований сервером +of.options.LAZY_CHUNK_LOADING.tooltip.5=розподіляючи чанки на декілька тіків. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Вимкніть це якщо деякі частини світу не завантажуються правильно. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Ефективно тільки для локальних світів і одноядерних процесорів. + +of.options.RENDER_REGIONS=Рендер регіонів +of.options.RENDER_REGIONS.tooltip.1=Рендер регіонів +of.options.RENDER_REGIONS.tooltip.2= Вимк - не використовувати рендер регіонів (базово) +of.options.RENDER_REGIONS.tooltip.3= Увімк - використовувати рендер регіонів +of.options.RENDER_REGIONS.tooltip.4=Рендер регіонів пришвидшує рендер території при великих значеннях +of.options.RENDER_REGIONS.tooltip.5=видимої відстані. Більш ефективний коли VBO увімкнено. +of.options.RENDER_REGIONS.tooltip.6=Не рекомендовано для інтегрованих відеокарт. + +of.options.SMART_ANIMATIONS=Розумна анімація +of.options.SMART_ANIMATIONS.tooltip.1=Розумна анімація +of.options.SMART_ANIMATIONS.tooltip.2= Вимк - не використовувати розумну анімацію (базово) +of.options.SMART_ANIMATIONS.tooltip.3= Увімк - використовувати розумну анімацію +of.options.SMART_ANIMATIONS.tooltip.4=З розумною анімацією, гра буде анімувати лише +of.options.SMART_ANIMATIONS.tooltip.5=текстури, які видимі на екрані. +of.options.SMART_ANIMATIONS.tooltip.6=Це зменшує лаги і покращує FPS. +of.options.SMART_ANIMATIONS.tooltip.7=Особливо корисно для великих модпаків та HD ресурспаків. + +# Animations + +of.options.animation.allOn=Всі Увімк +of.options.animation.allOff=Всі Вимк +of.options.animation.dynamic=Динамічні + +of.options.ANIMATED_WATER=Анімація води +of.options.ANIMATED_LAVA=Анімація лави +of.options.ANIMATED_FIRE=Анімація вогню +of.options.ANIMATED_PORTAL=Анімація порталу +of.options.ANIMATED_REDSTONE=Анімація редстоуну +of.options.ANIMATED_EXPLOSION=Анімація вибуху +of.options.ANIMATED_FLAME=Анімація полум'я +of.options.ANIMATED_SMOKE=Анімація диму +of.options.VOID_PARTICLES=Частинки безодні +of.options.WATER_PARTICLES=Частинки води +of.options.RAIN_SPLASH=Краплі дощу +of.options.PORTAL_PARTICLES=Чатинки порталу +of.options.POTION_PARTICLES=Частинки зілля +of.options.DRIPPING_WATER_LAVA=Капаюча лава/вода +of.options.ANIMATED_TERRAIN=Анімація місцевості +of.options.ANIMATED_TEXTURES=Анімація текстур +of.options.FIREWORK_PARTICLES=Частинки феєрверку + +# Other + +of.options.LAGOMETER=Лагометр +of.options.LAGOMETER.tooltip.1=Показує лагометр на екрані дебагу (F3). +of.options.LAGOMETER.tooltip.2=* Оранжевий - зберігання мусору в пам'яті +of.options.LAGOMETER.tooltip.3=* Блакитний - Тік +of.options.LAGOMETER.tooltip.4=* Синій - Заплановані дії +of.options.LAGOMETER.tooltip.5=* Фіолетовий - Завантаження чанків +of.options.LAGOMETER.tooltip.6=* Червоний - Оновлення чанків +of.options.LAGOMETER.tooltip.7=* Жовтий - Перевірка видимості +of.options.LAGOMETER.tooltip.8=* Зелений - Рендеринг місцевості + +of.options.PROFILER=Профіль відладки +of.options.PROFILER.tooltip.1=Профіль відладки +of.options.PROFILER.tooltip.2= Увімк - профіль відладки увімкнуто (повільніше) +of.options.PROFILER.tooltip.3= Вимк - профіль відладки вимкнуто (швидше) +of.options.PROFILER.tooltip.4=Профіль відладки збирає інформацію і показує її на +of.options.PROFILER.tooltip.5=екрані відладки (F3) + +of.options.WEATHER=Погода +of.options.WEATHER.tooltip.1=Погода +of.options.WEATHER.tooltip.2= Увімк - погода активна, повільніше +of.options.WEATHER.tooltip.3= Вимк - погода не активна, швидше +of.options.WEATHER.tooltip.4=Погода контролює дощі, грози і сніг. +of.options.WEATHER.tooltip.5=Працює лиш в ОДИНОЧНИХ СВІТАХ. + +of.options.time.dayOnly=Тільки день +of.options.time.nightOnly=Тільки ніч + +of.options.TIME=Час +of.options.TIME.tooltip.1=Час +of.options.TIME.tooltip.2= Стандартне - стандартний день +of.options.TIME.tooltip.3= Тільки день - тільки день +of.options.TIME.tooltip.4= Тільки ніч - тільки ніч +of.options.TIME.tooltip.5=Встановлення часу працює лиш для гравців у +of.options.TIME.tooltip.6=КРЕАТИВІ та у локальних світах. + +options.fullscreen.tooltip.1=Повноекранний режим +options.fullscreen.tooltip.2= Увімк - використовувати повноекранний режим +options.fullscreen.tooltip.3= Вимк - не використовувати повноекранний режим +options.fullscreen.tooltip.4=В залежності від відеокарти, може +options.fullscreen.tooltip.5=покращити продуктивність. + +of.options.FULLSCREEN_MODE=Роздільна здатність +of.options.FULLSCREEN_MODE.tooltip.1=Роздільна здатність +of.options.FULLSCREEN_MODE.tooltip.2= Стандартна - використовувати роздільну здатність монітора, повільніше +of.options.FULLSCREEN_MODE.tooltip.3= WxH - використовувати власну роздільну якість, може бути швидше +of.options.FULLSCREEN_MODE.tooltip.4=Обрана якість буде використовуватись в повноекранному режимі (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Найнижча якість завжди швидша. + +of.options.SHOW_FPS=Показувати FPS +of.options.SHOW_FPS.tooltip.1=Показує компактно FPS і інформацію про рендер +of.options.SHOW_FPS.tooltip.2= Fps - середній/мінімальний +of.options.SHOW_FPS.tooltip.3= C: - чанків відображається +of.options.SHOW_FPS.tooltip.4= E: - сутностей в рендері + блоковано сутностей +of.options.SHOW_FPS.tooltip.5= U: - чанків оновлюється +of.options.SHOW_FPS.tooltip.6=Компактне FPS показується лиш коли +of.options.SHOW_FPS.tooltip.7=екран відладки вимкнено. + +of.options.save.45s=45с +of.options.save.90s=90с +of.options.save.3min=3хв +of.options.save.6min=6хв +of.options.save.12min=12хв +of.options.save.24min=24хв + +of.options.AUTOSAVE_TICKS=Автозбереження +of.options.AUTOSAVE_TICKS.tooltip.1=Інтервал автозбереження +of.options.AUTOSAVE_TICKS.tooltip.2=Стандартний інтервал збереження - 45с. +of.options.AUTOSAVE_TICKS.tooltip.3=Автозбереження може спричиняти завмирання гри. +of.options.AUTOSAVE_TICKS.tooltip.4=Гра також зберігатиметься коли відкрито меню. + +of.options.SCREENSHOT_SIZE=Розмір знімку екрану +of.options.SCREENSHOT_SIZE.tooltip.1=Розмір скріншоту +of.options.SCREENSHOT_SIZE.tooltip.2= Стандартний - стандартний розмір скріншоту +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - власний розмір скріншоту +of.options.SCREENSHOT_SIZE.tooltip.4=Знімання більшого скріншоту потребує більше пам'яті +of.options.SCREENSHOT_SIZE.tooltip.5=Не сумісне зі швидким рендером і згладжуванням +of.options.SCREENSHOT_SIZE.tooltip.6=Потребує підтримку фреймбуфера GPU. + +of.options.SHOW_GL_ERRORS=Показувати помилки OpenGL +of.options.SHOW_GL_ERRORS.tooltip.1=Показувати помилки OpenGL +of.options.SHOW_GL_ERRORS.tooltip.2=Коли увімкнено, помилки OpenGL будуть надсилатись у чат. +of.options.SHOW_GL_ERRORS.tooltip.3=Вимикайте це лише якщо ви ТОЧНО впевнені що цю +of.options.SHOW_GL_ERRORS.tooltip.4=помилку неможливо виправити. +of.options.SHOW_GL_ERRORS.tooltip.5=Коли вимкнено, помилки продовжать зберігатись у журналах +of.options.SHOW_GL_ERRORS.tooltip.6=і вони можуть викликати різке падіння FPS. + +# Налаштування чату + +of.options.CHAT_BACKGROUND=Фон чату +of.options.CHAT_BACKGROUND.tooltip.1=Фон чату +of.options.CHAT_BACKGROUND.tooltip.2= Стандартний - зафіксована висота +of.options.CHAT_BACKGROUND.tooltip.3= Компактний - відповідає висоті рядків +of.options.CHAT_BACKGROUND.tooltip.4= Вимк. - прихований + +of.options.CHAT_SHADOW=Тінь чату +of.options.CHAT_SHADOW.tooltip.1=Тінь чату +of.options.CHAT_SHADOW.tooltip.2= Увімк. - використовувати тінь чату +of.options.CHAT_SHADOW.tooltip.3= Вимк. - вимкнути тінь чату diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/zh_CN.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/zh_CN.lang new file mode 100644 index 0000000..76609e9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/zh_CN.lang @@ -0,0 +1,756 @@ +# Contributors of Chinese localization # +# HeartyYF From InfinityStudio 2016-2-18 ---- 2019-3-9 +# xwjcool123 From Minecraft Bar 2018-5-20 ---- 2018-6-16 +# xuyu_staryG(gxy17886) From InfinityStudio 2016-1-18 ---- 2016-1-19 +# hukk From MCBBS 2013-7-13 ---- 2016-11-9 +# shengjing1 From MCBBS 2012-11-20 ---- 2013-4-20 + +# 一些约定:英文或数字前后以空格区分,除非与全角标点直接相连;中文间标点用全角,数字或英文间标点用半角+空格; +# 凡是某个选项后的“较快”“较慢”“默认”一律以括号标记,不论原语言文件是括号还是逗号;若默认和较快较慢之类并列,将默认放于选项首,否则放于选项尾。 +# 这些约定不必须遵守,我只是认为这样能增强可读性。具体示例参见下文。 + +# General +of.general.ambiguous=模糊 +of.general.compact=紧凑 +of.general.custom=自定义 +of.general.from=来自 +of.general.id=Id +of.general.max=最大化 +of.general.restart=重启游戏 +of.general.smart=智能 + +# Keys +of.key.zoom=缩放 + +# Message +of.message.aa.shaders1=抗锯齿与光影不兼容。 +of.message.aa.shaders2=请关闭光影以启用这个选项。 + +of.message.af.shaders1=各向异性过滤与光影不兼容。 +of.message.af.shaders2=请关闭光影以启用这个选项。 + +of.message.fr.shaders1=快速渲染与光影不兼容。 +of.message.fr.shaders2=请关闭光影以启用这个选项。 + +of.message.an.shaders1=3D效果与光影不兼容。 +of.message.an.shaders2=请关闭光影以启用这个选项。 + +of.message.shaders.aa1=光影与抗锯齿不兼容。 +of.message.shaders.aa2=请将 品质 -> 抗锯齿 选项设置为 关闭 并重启您的游戏。 + +of.message.shaders.af1=光影与各向异性过滤不兼容。 +of.message.shaders.af2=请将 品质 -> 各向异性过滤 选项设置为 关闭。 + +of.message.shaders.fr1=光影与快速渲染不兼容。 +of.message.shaders.fr2=请将 性能 -> 快速渲染 选项设置为 关闭。 + +of.message.shaders.an1=光影与3D效果不兼容。 +of.message.shaders.an2=请将 其他 -> 3D效果 选项设置为 关闭。 + +of.message.shaders.nv1=此光影需要更新的OptiFine版本:%s +of.message.shaders.nv2=确认要继续吗? + +of.message.newVersion=新的§eOptiFine§f版本现已可用:§e%s§f +of.message.java64Bit=您可以安装§e64位Java§f来提升性能。 +of.message.openglError=§eOpenGL错误§f:%s(%s) + +of.message.shaders.loading=加载光影:%s + +of.message.other.reset=确定要重置所有视频设置为默认值吗? + +of.message.loadingVisibleChunks=正在加载可见区块 + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine 披风... + +of.options.capeOF.title=OptiFine 披风 +of.options.capeOF.openEditor=打开披风编辑器 +of.options.capeOF.reloadCape=重新加载披风 + +of.message.capeOF.openEditor=OptiFine 披风编辑器会在网页浏览器中打开。 +of.message.capeOF.reloadCape=披风将在 15 秒内重新加载。 + +of.message.capeOF.error1=Mojang 身份验证失败。 +of.message.capeOF.error2=错误:%s + +# Video settings + +options.graphics.tooltip.1=图像品质 +options.graphics.tooltip.2= 流畅 - 低品质(较快) +options.graphics.tooltip.3= 高品质 - 高品质(较慢) +options.graphics.tooltip.4=改变云、树叶、水、 +options.graphics.tooltip.5=阴影和草地的外观。 + +of.options.renderDistance.tiny=最近 +of.options.renderDistance.short=近 +of.options.renderDistance.normal=中等 +of.options.renderDistance.far=远 +of.options.renderDistance.extreme=极远 +of.options.renderDistance.insane=疯狂 +of.options.renderDistance.ludicrous=荒唐 + +options.renderDistance.tooltip.1=能见度 +options.renderDistance.tooltip.2= 2 最近 - 32m(最快) +options.renderDistance.tooltip.3= 8 中等 - 128m(正常) +options.renderDistance.tooltip.4= 16 远 - 256m(较慢) +options.renderDistance.tooltip.5= 32 极远 - 512m(最慢!)非常消耗资源! +options.renderDistance.tooltip.6= 48 疯狂 - 768m,需要2G的内存分配 +options.renderDistance.tooltip.7= 64 荒唐 - 1024m,需要3G的内存分配 +options.renderDistance.tooltip.8=超过 16 的能见度值只在本地世界有效。 + +options.ao.tooltip.1=平滑光照 +options.ao.tooltip.2= 关闭 - 禁用平滑光照(较快) +options.ao.tooltip.3= 最小 - 简单流畅的平滑光照(较慢) +options.ao.tooltip.4= 最大 - 复杂柔和的平滑光照(最慢) + +options.framerateLimit.tooltip.1=最大帧率 +options.framerateLimit.tooltip.2= 垂直同步 - 限制为显示器帧率(60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - 可变 +options.framerateLimit.tooltip.4= 无限制 - 无限制(最快) +options.framerateLimit.tooltip.5=帧率限制将降低 FPS, +options.framerateLimit.tooltip.6=即使其未达到上限值。 +of.options.framerateLimit.vsync=垂直同步 + +of.options.AO_LEVEL=平滑光照级别 +of.options.AO_LEVEL.tooltip.1=平滑光照级别 +of.options.AO_LEVEL.tooltip.2= 关闭 - 不产生阴影 +of.options.AO_LEVEL.tooltip.3= 50%% - 较浅的阴影 +of.options.AO_LEVEL.tooltip.4= 100%% - 较深的阴影 + +options.viewBobbing.tooltip.1=更真实的运动。 +options.viewBobbing.tooltip.2=当使用多级纹理贴图(mipmap)时,关闭此选项以取得最佳效果。 + +options.guiScale.tooltip.1=界面尺寸 +options.guiScale.tooltip.2= 自动 - 最大尺寸 +options.guiScale.tooltip.3= 小,中,大 - 1x 到 3x +options.guiScale.tooltip.4= 4x 到 10x - 在 4K 分辨率下可用 +options.guiScale.tooltip.5=奇数值(1x, 3x, 5x之类)与 Unicode 不兼容。 +options.guiScale.tooltip.6=较小的界面或许会更快。 + +options.vbo=启用顶点缓冲器 +options.vbo.tooltip.1=顶点缓冲区对象 +options.vbo.tooltip.2=使用一种替选的渲染模式,通常 +options.vbo.tooltip.3=可以比默认渲染快(5-10%%)。 + +options.gamma.tooltip.1=增加较暗物体的亮度 +options.gamma.tooltip.2= 标准 - 标准亮度 +options.gamma.tooltip.3= 1-99%% - 可变亮度 +options.gamma.tooltip.4= 明亮 - 最大亮度 +options.gamma.tooltip.5=此选项不会改变 +options.gamma.tooltip.6=完全黑色的物体的亮度。 + +options.anaglyph.tooltip.1=3D效果 +options.anaglyph.tooltip.2=通过为双眼分配不同颜色 +options.anaglyph.tooltip.3=以实现 3D 立体效果。 +options.anaglyph.tooltip.4=需要使用红蓝眼镜正常观看。 + +of.options.ALTERNATE_BLOCKS=替选方块 +of.options.ALTERNATE_BLOCKS.tooltip.1=替选方块 +of.options.ALTERNATE_BLOCKS.tooltip.2=为一些方块使用备选的方块模型。 +of.options.ALTERNATE_BLOCKS.tooltip.3=取决于所选的资源包。 + +of.options.FOG_FANCY=迷雾 +of.options.FOG_FANCY.tooltip.1=迷雾类型 +of.options.FOG_FANCY.tooltip.2= 流畅 - 较流畅的迷雾 +of.options.FOG_FANCY.tooltip.3= 高品质 - 较慢的迷雾(质量更佳) +of.options.FOG_FANCY.tooltip.4= 关闭 - 无迷雾(最快) +of.options.FOG_FANCY.tooltip.5=高品质的迷雾只在 +of.options.FOG_FANCY.tooltip.6=显卡支持下可用。 + +of.options.FOG_START=迷雾起始位置 +of.options.FOG_START.tooltip.1=迷雾起始位置 +of.options.FOG_START.tooltip.2= 0.2 - 迷雾起始于玩家周围 +of.options.FOG_START.tooltip.3= 0.8 - 迷雾起始于离玩家较远的地方 +of.options.FOG_START.tooltip.4=此选项通常不会影响性能。 + +of.options.CHUNK_LOADING=区块加载 +of.options.CHUNK_LOADING.tooltip.1=区块加载 +of.options.CHUNK_LOADING.tooltip.2= 默认 - 当加载区块时 FPS 不稳定 +of.options.CHUNK_LOADING.tooltip.3= 平滑 - 稳定 FPS +of.options.CHUNK_LOADING.tooltip.4= 多核心 - 稳定 FPS ,3倍的世界加载速度 +of.options.CHUNK_LOADING.tooltip.5=平滑和多核心可消除由区块 +of.options.CHUNK_LOADING.tooltip.6=加载引起的延迟和卡顿。 +of.options.CHUNK_LOADING.tooltip.7=多核心可以令世界加载速度提升3倍 +of.options.CHUNK_LOADING.tooltip.8=并通过使用多个 CPU 核心来提升 FPS。 +of.options.chunkLoading.smooth=平滑 +of.options.chunkLoading.multiCore=多核心 + +of.options.shaders=光影... +of.options.shadersTitle=光影 + +of.options.shaders.packNone=关闭 +of.options.shaders.packDefault=(内置) + +of.options.shaders.ANTIALIASING=抗锯齿 +of.options.shaders.ANTIALIASING.tooltip.1=抗锯齿 +of.options.shaders.ANTIALIASING.tooltip.2= 关闭 - (默认)禁用抗锯齿(较快) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - 对线和边缘抗锯齿处理(较慢) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA 是一种使锯齿状线条线和鲜明的色彩过渡 +of.options.shaders.ANTIALIASING.tooltip.5=更为平滑的后处理特效。 +of.options.shaders.ANTIALIASING.tooltip.6=它不仅快于传统的抗锯齿处理, +of.options.shaders.ANTIALIASING.tooltip.7=同时也与光影和快速渲染兼容。 + +of.options.shaders.NORMAL_MAP=法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.1=法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.2= 开启 - (默认)启用法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.3= 关闭 - 禁用法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.4=光影包可以使用法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.5=以在模型的平面表面内模拟三维几何结构。 +of.options.shaders.NORMAL_MAP.tooltip.6=法线贴图材质一般由 +of.options.shaders.NORMAL_MAP.tooltip.7=当前的资源包提供。 + +of.options.shaders.SPECULAR_MAP=高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.1=高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.2= 开启 - (默认)启用高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.3= 关闭 - 禁用高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.4=光影包可以使用高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.5=以模拟特殊的反射效果。 +of.options.shaders.SPECULAR_MAP.tooltip.6=高光贴图材质一般由 +of.options.shaders.SPECULAR_MAP.tooltip.7=当前的资源包提供。 + +of.options.shaders.RENDER_RES_MUL=渲染精细度 +of.options.shaders.RENDER_RES_MUL.tooltip.1=渲染精细度 +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - 低(最快) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - 标准(默认) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - 高(最慢) +of.options.shaders.RENDER_RES_MUL.tooltip.5=渲染精细度控制 +of.options.shaders.RENDER_RES_MUL.tooltip.6=光影包当前渲染的材质大小。 +of.options.shaders.RENDER_RES_MUL.tooltip.7=较低的值或许利于4K显示。 +of.options.shaders.RENDER_RES_MUL.tooltip.8=较高的值将以抗锯齿滤镜的形式工作。 + +of.options.shaders.SHADOW_RES_MUL=阴影精细度 +of.options.shaders.SHADOW_RES_MUL.tooltip.1=阴影精细度 +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - 低(最快) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - 标准(默认) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - 高(最慢) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=阴影精细度控制 +of.options.shaders.SHADOW_RES_MUL.tooltip.6=光影包使用的阴影映射贴图大小。 +of.options.shaders.SHADOW_RES_MUL.tooltip.7=较低的值 = 不精确的、粗糙的阴影。 +of.options.shaders.SHADOW_RES_MUL.tooltip.8=较高的值 = 细致的、更佳的阴影。 + +of.options.shaders.HAND_DEPTH_MUL=手部景深 +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=手部景深 +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - 手与镜头相距较近 +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (默认) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - 手与镜头相距较远 +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=手部景深控制 +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=手持的物品与镜头相距的距离。 +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=对于使用模糊景深的光影包, +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=此选项应当会改变手持物品的模糊程度。 + +of.options.shaders.CLOUD_SHADOW=云朵阴影 + +of.options.shaders.OLD_HAND_LIGHT=经典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=经典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= 默认 - 光影包控制 +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= 开启 - 使用经典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= 关闭 - 使用新式手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=经典手持光源允许只能辨别 +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=主手中发光物品的光影包 +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=对于另一只手也能工作。 + +of.options.shaders.OLD_LIGHTING=经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.1=经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.2= 默认 - 光影包控制 +of.options.shaders.OLD_LIGHTING.tooltip.3= 开启 - 使用经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.4= 关闭 - 不使用经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.5=使用经典光效时则采用原版的固定照明。 +of.options.shaders.OLD_LIGHTING.tooltip.6=在这种情况下,方块各面的照明会始终如一。 +of.options.shaders.OLD_LIGHTING.tooltip.7=使用阴影的光影包通常会提供 +of.options.shaders.OLD_LIGHTING.tooltip.8=更好的、取决于太阳位置的照明。 + +of.options.shaders.DOWNLOAD=光影下载 +of.options.shaders.DOWNLOAD.tooltip.1=下载光影 +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=在浏览器中打开光影包页面。 +of.options.shaders.DOWNLOAD.tooltip.4=将已下载完成的光影置于光影文件夹中, +of.options.shaders.DOWNLOAD.tooltip.5=它们将出现在已安装的光影列表里。 + +of.options.shaders.SHADER_PACK=光影包文件夹 + +of.options.shaders.shadersFolder=光影包文件夹 +of.options.shaders.shaderOptions=光影设置... + +of.options.shaderOptionsTitle=光影设置 + +of.options.quality=品质... +of.options.qualityTitle=品质设置 + +of.options.details=细节... +of.options.detailsTitle=细节设置 + +of.options.performance=性能... +of.options.performanceTitle=性能设置 + +of.options.animations=动画... +of.options.animationsTitle=动画设置 + +of.options.other=其他... +of.options.otherTitle=其他设置 + +of.options.other.reset=重置视频设置... + +of.shaders.profile=配置文件 + +# Quality + +of.options.mipmap.bilinear=双线性 +of.options.mipmap.linear=线性 +of.options.mipmap.nearest=邻近 +of.options.mipmap.trilinear=三线性 + +options.mipmapLevels.tooltip.1=通过平滑材质细节,使远处的 +options.mipmapLevels.tooltip.2=物体获得更好的视觉效果。 +options.mipmapLevels.tooltip.3= 关闭 - 无平滑 +options.mipmapLevels.tooltip.4= 1 - 最小平滑 +options.mipmapLevels.tooltip.5= 最大化 - 最大平滑 +options.mipmapLevels.tooltip.6=此选项通常不会影响性能。 + +of.options.MIPMAP_TYPE=多级纹理(mipmap)类型 +of.options.MIPMAP_TYPE.tooltip.1=通过平滑材质细节,使远处的 +of.options.MIPMAP_TYPE.tooltip.2=物体获得更好的视觉效果。 +of.options.MIPMAP_TYPE.tooltip.3= 邻近 - 粗略平滑(最快) +of.options.MIPMAP_TYPE.tooltip.4= 线性 - 正常平滑 +of.options.MIPMAP_TYPE.tooltip.5= 双线性 - 精细平滑 +of.options.MIPMAP_TYPE.tooltip.6= 三线性 - 极致平滑(最慢) + + +of.options.AA_LEVEL=抗锯齿 +of.options.AA_LEVEL.tooltip.1=抗锯齿 +of.options.AA_LEVEL.tooltip.2= 关闭 - (默认)禁用抗锯齿(较快) +of.options.AA_LEVEL.tooltip.3= 2-16 - 对线条和边缘进行抗锯齿处理(较慢) +of.options.AA_LEVEL.tooltip.4=抗锯齿对锯齿状的线条 +of.options.AA_LEVEL.tooltip.5=和鲜明的色彩过渡进行平滑处理。 +of.options.AA_LEVEL.tooltip.6=启用它可能会大幅降低 FPS。 +of.options.AA_LEVEL.tooltip.7=并非所有级别都被显卡支持。 +of.options.AA_LEVEL.tooltip.8=重启后生效! + +of.options.AF_LEVEL=各向异性过滤 +of.options.AF_LEVEL.tooltip.1=各向异性过滤 +of.options.AF_LEVEL.tooltip.2= 关闭 - (默认)标准材质细节(较快) +of.options.AF_LEVEL.tooltip.3= 2-16 - 还原多级纹理(mipmap)处理后的的细节(较慢) +of.options.AF_LEVEL.tooltip.4=各向异性过滤还原了经多级 +of.options.AF_LEVEL.tooltip.5=纹理过滤后的材质细节。 +of.options.AF_LEVEL.tooltip.6=启用它可能会大幅降低 FPS。 + +of.options.CLEAR_WATER=清澈水体 +of.options.CLEAR_WATER.tooltip.1=清澈水体 +of.options.CLEAR_WATER.tooltip.2= 开启 - 清澈、透明水体 +of.options.CLEAR_WATER.tooltip.3= 关闭 - 默认水体 + +of.options.RANDOM_ENTITIES=随机实体材质 +of.options.RANDOM_ENTITIES.tooltip.1=随机实体材质 +of.options.RANDOM_ENTITIES.tooltip.2= 关闭 - 关闭随机实体材质(较快) +of.options.RANDOM_ENTITIES.tooltip.3= 开启 - 随机实体材质(较慢) +of.options.RANDOM_ENTITIES.tooltip.4=游戏中的实体使用随机的相应贴图。 +of.options.RANDOM_ENTITIES.tooltip.5=需要资源包内有多个实体贴图。 + +of.options.BETTER_GRASS=更好的草地 +of.options.BETTER_GRASS.tooltip.1=更好的草地 +of.options.BETTER_GRASS.tooltip.2= 关闭 - 默认草地材质(最快) +of.options.BETTER_GRASS.tooltip.3= 流畅 - 草方块侧面全部使用草地材质(较慢) +of.options.BETTER_GRASS.tooltip.4= 高品质 - 草方块侧面材质动态化(最慢) + +of.options.BETTER_SNOW=更好的雪地 +of.options.BETTER_SNOW.tooltip.1=更好的雪地 +of.options.BETTER_SNOW.tooltip.2= 关闭 - 默认的雪地(较快) +of.options.BETTER_SNOW.tooltip.3= 开启 - 更好的雪地(较慢) +of.options.BETTER_SNOW.tooltip.4=在与雪接壤的“透明方块” +of.options.BETTER_SNOW.tooltip.5=(如栅栏、高草)下显示雪。 + +of.options.CUSTOM_FONTS=自定义字体 +of.options.CUSTOM_FONTS.tooltip.1=自定义字体 +of.options.CUSTOM_FONTS.tooltip.2= 开启 - (默认)使用自定义字体(较慢) +of.options.CUSTOM_FONTS.tooltip.3= 关闭 - 使用默认字体(较快) +of.options.CUSTOM_FONTS.tooltip.4=自定义字体一般由 +of.options.CUSTOM_FONTS.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_COLORS=自定义色彩 +of.options.CUSTOM_COLORS.tooltip.1=自定义色彩 +of.options.CUSTOM_COLORS.tooltip.2= 开启 - (默认)使用自定义色彩(较慢) +of.options.CUSTOM_COLORS.tooltip.3= 关闭 - 使用默认色彩(较快) +of.options.CUSTOM_COLORS.tooltip.4=自定义色彩一般由 +of.options.CUSTOM_COLORS.tooltip.5=当前的资源包提供。 + +of.options.SWAMP_COLORS=沼泽颜色 +of.options.SWAMP_COLORS.tooltip.1=沼泽颜色 +of.options.SWAMP_COLORS.tooltip.2= 开启 - (默认)使用沼泽颜色(较慢) +of.options.SWAMP_COLORS.tooltip.3= 关闭 - 不使用沼泽颜色(较快) +of.options.SWAMP_COLORS.tooltip.4=沼泽的颜色会影响草、树叶、藤蔓和水。 + +of.options.SMOOTH_BIOMES=平滑生物群系 +of.options.SMOOTH_BIOMES.tooltip.1=平滑生物群系 +of.options.SMOOTH_BIOMES.tooltip.2= 开启 - (默认)平滑生物群系的边界(较慢) +of.options.SMOOTH_BIOMES.tooltip.3= 关闭 - 不平滑生物群系的边界(较快) +of.options.SMOOTH_BIOMES.tooltip.4=取样边界附近所有方块颜色的平均值 +of.options.SMOOTH_BIOMES.tooltip.5=以平滑生物群系的边界。 +of.options.SMOOTH_BIOMES.tooltip.6=草、树叶、藤蔓和水会被受到影响。 + +of.options.CONNECTED_TEXTURES=连接纹理 +of.options.CONNECTED_TEXTURES.tooltip.1=连接纹理 +of.options.CONNECTED_TEXTURES.tooltip.2= 关闭 - 关闭连接纹理(默认) +of.options.CONNECTED_TEXTURES.tooltip.3= 流畅 - 快速处理纹理连接 +of.options.CONNECTED_TEXTURES.tooltip.4= 高品质 - 精细处理纹理连接 +of.options.CONNECTED_TEXTURES.tooltip.5=连接纹理为玻璃、沙石和书架增加了连接材质, +of.options.CONNECTED_TEXTURES.tooltip.6=当这些同类方块放在一起时会将材质连接为一体。 +of.options.CONNECTED_TEXTURES.tooltip.7=连接材质一般由 +of.options.CONNECTED_TEXTURES.tooltip.8=当前的资源包提供。 + +of.options.NATURAL_TEXTURES=自然纹理 +of.options.NATURAL_TEXTURES.tooltip.1=自然纹理 +of.options.NATURAL_TEXTURES.tooltip.2= 关闭 - 关闭自然纹理(默认) +of.options.NATURAL_TEXTURES.tooltip.3= 开启 - 启用自然纹理 +of.options.NATURAL_TEXTURES.tooltip.4=自然纹理会移除由同一类型的方块重复铺设 +of.options.NATURAL_TEXTURES.tooltip.5=而造成的栅格状图案。此功能通过旋转和翻转 +of.options.NATURAL_TEXTURES.tooltip.6=方块的基础材质来创建材质变体。 +of.options.NATURAL_TEXTURES.tooltip.7=自然纹理的配置一般由 +of.options.NATURAL_TEXTURES.tooltip.8=当前的资源包提供。 + +of.options.EMISSIVE_TEXTURES=自发光纹理 +of.options.EMISSIVE_TEXTURES.tooltip.1=自发光纹理 +of.options.EMISSIVE_TEXTURES.tooltip.2= 关闭 - 关闭自发光纹理(默认) +of.options.EMISSIVE_TEXTURES.tooltip.3= 开启 - 启用自发光纹理 +of.options.EMISSIVE_TEXTURES.tooltip.4=自发光纹理会作为覆盖层 +of.options.EMISSIVE_TEXTURES.tooltip.5=以最大亮度渲染。可用于 +of.options.EMISSIVE_TEXTURES.tooltip.6=模拟基础材质的发光部分。 +of.options.EMISSIVE_TEXTURES.tooltip.7=自发光纹理一般由 +of.options.EMISSIVE_TEXTURES.tooltip.8=当前的资源包提供。 + +of.options.CUSTOM_SKY=自定义天空 +of.options.CUSTOM_SKY.tooltip.1=自定义天空 +of.options.CUSTOM_SKY.tooltip.2= 开启 - (默认)自定义天空材质(较慢) +of.options.CUSTOM_SKY.tooltip.3= 关闭 - 默认天空材质(较快) +of.options.CUSTOM_SKY.tooltip.4=自定义天空的材质一般由 +of.options.CUSTOM_SKY.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_ITEMS=自定义物品 +of.options.CUSTOM_ITEMS.tooltip.1=自定义物品 +of.options.CUSTOM_ITEMS.tooltip.2= 开启 - (默认)自定义物品材质(较慢) +of.options.CUSTOM_ITEMS.tooltip.3= 关闭 - 默认物品材质(较快) +of.options.CUSTOM_ITEMS.tooltip.4=自定义物品的材质一般由 +of.options.CUSTOM_ITEMS.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_ENTITY_MODELS=自定义实体模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=自定义实体模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= 开启 - (默认)自定义实体模型(较慢) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= 关闭 - 默认实体模型(较快) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=自定义实体模型一般由 +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_GUIS=自定义界面 +of.options.CUSTOM_GUIS.tooltip.1=自定义界面 +of.options.CUSTOM_GUIS.tooltip.2= 开启 - (默认)自定义图形用户界面(较慢) +of.options.CUSTOM_GUIS.tooltip.3= 关闭 - 默认图形用户界面(较快) +of.options.CUSTOM_GUIS.tooltip.4=自定义图形用户界面一般由当前的资源包提供。 + +# Details + +of.options.CLOUDS=云 +of.options.CLOUDS.tooltip.1=云 +of.options.CLOUDS.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.CLOUDS.tooltip.3= 流畅 - 低品质(较快) +of.options.CLOUDS.tooltip.4= 高品质 - 高品质(较慢) +of.options.CLOUDS.tooltip.5= 关闭 - 禁用云(最快) +of.options.CLOUDS.tooltip.6=低品质云使用 2D 渲染, +of.options.CLOUDS.tooltip.7=高品质云使用 3D 渲染。 + +of.options.CLOUD_HEIGHT=云高度 +of.options.CLOUD_HEIGHT.tooltip.1=云高度 +of.options.CLOUD_HEIGHT.tooltip.2= 关闭 - 默认高度 +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - 超过世界的高度限制 + +of.options.TREES=树 +of.options.TREES.tooltip.1=树 +of.options.TREES.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.TREES.tooltip.3= 流畅 - 低品质(最快) +of.options.TREES.tooltip.4= 智能 - 较高品质(较快) +of.options.TREES.tooltip.5= 高品质 - 高品质(较慢) +of.options.TREES.tooltip.6=低品质的树叶不透明, +of.options.TREES.tooltip.7=高品质的树叶透明、镂空。 + +of.options.RAIN=雨雪 +of.options.RAIN.tooltip.1=雨雪 +of.options.RAIN.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.RAIN.tooltip.3= 流畅 - 少量的雨/雪(较快) +of.options.RAIN.tooltip.4= 高品质 - 大量的雨/雪(较慢) +of.options.RAIN.tooltip.5= 关闭 - 禁用雨/雪(最快) +of.options.RAIN.tooltip.6=雨声 和 雨滴飞溅 +of.options.RAIN.tooltip.7=不受此选项影响。 + +of.options.SKY=天空 +of.options.SKY.tooltip.1=天空 +of.options.SKY.tooltip.2= 开启 - 天空可见(较慢) +of.options.SKY.tooltip.3= 关闭 - 天空不可见(较快) +of.options.SKY.tooltip.4=日月的可见与否有单独的选项。 + +of.options.STARS=星星 +of.options.STARS.tooltip.1=星星 +of.options.STARS.tooltip.2= 开启 - 星星可见(较慢) +of.options.STARS.tooltip.3= 关闭 - 星星不可见(较快) + +of.options.SUN_MOON=日月 +of.options.SUN_MOON.tooltip.1=日月 +of.options.SUN_MOON.tooltip.2= 开启 - 太阳和月亮可见(默认) +of.options.SUN_MOON.tooltip.3= 关闭 - 太阳和月亮不可见(较快) + +of.options.SHOW_CAPES=显示披风 +of.options.SHOW_CAPES.tooltip.1=显示披风 +of.options.SHOW_CAPES.tooltip.2= 开启 - 显示玩家披风(默认) +of.options.SHOW_CAPES.tooltip.3= 关闭 - 不显示玩家披风 + +of.options.TRANSLUCENT_BLOCKS=半透明方块 +of.options.TRANSLUCENT_BLOCKS.tooltip.1=半透明方块 +of.options.TRANSLUCENT_BLOCKS.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 高品质 - 准确的颜色混合(默认) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= 流畅 - 快速的颜色混合(较快) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=控制不同颜色的半透明方块 +of.options.TRANSLUCENT_BLOCKS.tooltip.6=(如染色玻璃、水、冰)间 +of.options.TRANSLUCENT_BLOCKS.tooltip.7=有空气存在时,彼此颜色的混合。 + +of.options.HELD_ITEM_TOOLTIPS=持有物信息显示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=持有物信息显示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= 开启 - 显示持有物信息(默认) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= 关闭 - 隐藏持有物信息 + +of.options.ADVANCED_TOOLTIPS=高级信息提示 +of.options.ADVANCED_TOOLTIPS.tooltip.1=高级信息提示 +of.options.ADVANCED_TOOLTIPS.tooltip.2= 开启 - 显示高级信息提示 +of.options.ADVANCED_TOOLTIPS.tooltip.3= 关闭 - 隐藏高级信息提示(默认) +of.options.ADVANCED_TOOLTIPS.tooltip.4=物品(ID、耐久度)和光影设置 +of.options.ADVANCED_TOOLTIPS.tooltip.5=(ID、源、默认值)的额外信息 +of.options.ADVANCED_TOOLTIPS.tooltip.6=会在开启时显示。 + +of.options.DROPPED_ITEMS=掉落物 +of.options.DROPPED_ITEMS.tooltip.1=掉落物 +of.options.DROPPED_ITEMS.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.DROPPED_ITEMS.tooltip.3= 流畅 - 2D 掉落物(较快) +of.options.DROPPED_ITEMS.tooltip.4= 高品质 - 3D 掉落物(较慢) + +options.entityShadows.tooltip.1=实体阴影 +options.entityShadows.tooltip.2= 开启 - 显示实体阴影 +options.entityShadows.tooltip.3= 关闭 - 隐藏实体阴影 + +of.options.VIGNETTE=晕影 +of.options.VIGNETTE.tooltip.1=使屏幕四角轻微变暗的视觉效果 +of.options.VIGNETTE.tooltip.2= 默认 - 以“图形品质”的设定为准(默认) +of.options.VIGNETTE.tooltip.3= 流畅 - 晕影关闭(较快) +of.options.VIGNETTE.tooltip.4= 高品质 - 晕影开启(较慢) +of.options.VIGNETTE.tooltip.5=晕影可能对FPS有显著的影响, +of.options.VIGNETTE.tooltip.6=尤其是全屏游戏的时候。 +of.options.VIGNETTE.tooltip.7=晕影的效果非常细微, +of.options.VIGNETTE.tooltip.8=并且可以被安全地禁用。 + +of.options.DYNAMIC_FOV=动态视场 +of.options.DYNAMIC_FOV.tooltip.1=动态视场 +of.options.DYNAMIC_FOV.tooltip.2= 开启 - 启用动态视场(默认) +of.options.DYNAMIC_FOV.tooltip.3= 关闭 - 禁用动态视场 +of.options.DYNAMIC_FOV.tooltip.4=当飞行、疾跑或 +of.options.DYNAMIC_FOV.tooltip.5=拉弓时改变视场。 + +of.options.DYNAMIC_LIGHTS=动态光源 +of.options.DYNAMIC_LIGHTS.tooltip.1=动态光源 +of.options.DYNAMIC_LIGHTS.tooltip.2= 关闭 - 无动态光源(默认) +of.options.DYNAMIC_LIGHTS.tooltip.3= 流畅 - 较快的动态光源(每 500ms 更新一次) +of.options.DYNAMIC_LIGHTS.tooltip.4= 高品质 - 高品质的动态光源(实时更新) +of.options.DYNAMIC_LIGHTS.tooltip.5=使得发光的物品(火把、萤石等) +of.options.DYNAMIC_LIGHTS.tooltip.6=被玩家左右手持握、装备或 +of.options.DYNAMIC_LIGHTS.tooltip.7=成为掉落物时照亮周围。 + +# Performance + +of.options.SMOOTH_FPS=平滑 FPS +of.options.SMOOTH_FPS.tooltip.1=通过清除显卡缓冲区来稳定 FPS +of.options.SMOOTH_FPS.tooltip.2= 关闭 - 不稳定,FPS 可能波动 +of.options.SMOOTH_FPS.tooltip.3= 开启 - FPS 稳定 +of.options.SMOOTH_FPS.tooltip.4=此选项依赖于显卡驱动, +of.options.SMOOTH_FPS.tooltip.5=通常效果并不明显。 + +of.options.SMOOTH_WORLD=平滑世界 +of.options.SMOOTH_WORLD.tooltip.1=移除内部服务造成的数据延时。 +of.options.SMOOTH_WORLD.tooltip.2= 关闭 - 不稳定,FPS 可能波动 +of.options.SMOOTH_WORLD.tooltip.3= 开启 - FPS 稳定 +of.options.SMOOTH_WORLD.tooltip.4=分担内部服务器负载来稳定FPS。 +of.options.SMOOTH_WORLD.tooltip.5=只在本地世界(单人游戏)有效。 + +of.options.FAST_RENDER=快速渲染 +of.options.FAST_RENDER.tooltip.1=快速渲染 +of.options.FAST_RENDER.tooltip.2= 关闭 - 标准渲染(默认) +of.options.FAST_RENDER.tooltip.3= 开启 - 优化渲染(较快) +of.options.FAST_RENDER.tooltip.4=采用优化渲染算法从而降低 GPU 的负载 +of.options.FAST_RENDER.tooltip.5=并且可能大幅提升 FPS。 +of.options.FAST_RENDER.tooltip.6=此选项或与某些模组冲突。 + +of.options.FAST_MATH=快速运算 +of.options.FAST_MATH.tooltip.1=快速运算 +of.options.FAST_MATH.tooltip.2= 关闭 - 标准的运算(默认) +of.options.FAST_MATH.tooltip.3= 开启 - 更快的运算 +of.options.FAST_MATH.tooltip.4=采用优化的 sin() 和 cos() 函数可以 +of.options.FAST_MATH.tooltip.5=更好地利用 CPU 缓存,并且提升 FPS。 +of.options.FAST_MATH.tooltip.6=此选项对世界生成有微小影响。 + +of.options.CHUNK_UPDATES=区块更新 +of.options.CHUNK_UPDATES.tooltip.1=区块更新 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 世界载入速度较慢,FPS 较高(默认) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 世界载入速度较快,FPS 较低 +of.options.CHUNK_UPDATES.tooltip.4= 5 - 世界载入速度最快,FPS 最低 +of.options.CHUNK_UPDATES.tooltip.5=渲染每帧时更新的区块数, +of.options.CHUNK_UPDATES.tooltip.6=更高的值将会导致帧数不稳定。 + +of.options.CHUNK_UPDATES_DYNAMIC=动态更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=动态区块更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= 关闭 - 标准的每帧区块更新(默认) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= 开启 - 当玩家站立不动时更多的区块更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=当玩家站立不动时,强迫更多的 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=区块更新,使得世界加载更快。 + +of.options.LAZY_CHUNK_LOADING=缓慢区块加载 +of.options.LAZY_CHUNK_LOADING.tooltip.1=缓慢区块加载 +of.options.LAZY_CHUNK_LOADING.tooltip.2= 关闭 - 默认的服务器区块载入 +of.options.LAZY_CHUNK_LOADING.tooltip.3= 开启 - 缓慢的服务器区块载入(更平滑) +of.options.LAZY_CHUNK_LOADING.tooltip.4=将区块分布在多个“游戏刻”进行加载 +of.options.LAZY_CHUNK_LOADING.tooltip.5=从而平滑服务器整体区块加载。 +of.options.LAZY_CHUNK_LOADING.tooltip.6=如果部分世界不能正确地载入,请把它设置为关。 +of.options.LAZY_CHUNK_LOADING.tooltip.7=仅适用于单人游戏的本地世界。 + +of.options.RENDER_REGIONS=区域渲染 +of.options.RENDER_REGIONS.tooltip.1=区域渲染 +of.options.RENDER_REGIONS.tooltip.2= 关闭 - 不使用区域渲染(默认) +of.options.RENDER_REGIONS.tooltip.3= 开启 - 使用区域渲染 +of.options.RENDER_REGIONS.tooltip.4=区域渲染可使远处的地形渲染得更快。 +of.options.RENDER_REGIONS.tooltip.5=当启用顶点缓冲区对象时此选项将更有效。 +of.options.RENDER_REGIONS.tooltip.6=不推荐集成显卡使用。 + +of.options.SMART_ANIMATIONS=智能动态材质 +of.options.SMART_ANIMATIONS.tooltip.1=智能动态材质 +of.options.SMART_ANIMATIONS.tooltip.2= 关闭 - 不使用智能动态材质(默认) +of.options.SMART_ANIMATIONS.tooltip.3= 开启 - 使用智能动态材质 +of.options.SMART_ANIMATIONS.tooltip.4=当使用智能动态材质时,游戏仅更新 +of.options.SMART_ANIMATIONS.tooltip.5=当前屏幕可见的动态材质。 +of.options.SMART_ANIMATIONS.tooltip.6=此选项可减少游戏刻突发延迟并提升 FPS。 +of.options.SMART_ANIMATIONS.tooltip.7=对于大型模组包和高清资源包格外有效。 + +# Animations + +of.options.animation.allOn=全部开启 +of.options.animation.allOff=全部关闭 +of.options.animation.dynamic=动态 + +of.options.ANIMATED_WATER=水面动画 +of.options.ANIMATED_LAVA=岩浆动画 +of.options.ANIMATED_FIRE=火焰动画 +of.options.ANIMATED_PORTAL=传送门动画 +of.options.ANIMATED_REDSTONE=红石动画 +of.options.ANIMATED_EXPLOSION=爆炸动画 +of.options.ANIMATED_FLAME=火焰动画 +of.options.ANIMATED_SMOKE=烟雾动画 +of.options.VOID_PARTICLES=虚空粒子 +of.options.WATER_PARTICLES=水面粒子 +of.options.RAIN_SPLASH=雨滴飞溅 +of.options.PORTAL_PARTICLES=传送门粒子 +of.options.POTION_PARTICLES=药水粒子 +of.options.DRIPPING_WATER_LAVA=水滴/岩浆滴 +of.options.ANIMATED_TERRAIN=地形动画 +of.options.ANIMATED_TEXTURES=动态材质 +of.options.FIREWORK_PARTICLES=烟花粒子 + +# Other + +of.options.LAGOMETER=快速调试信息 +of.options.LAGOMETER.tooltip.1=在调试界面(F3)显示快速调试信息。 +of.options.LAGOMETER.tooltip.2=* 橙 - 内存垃圾回收 +of.options.LAGOMETER.tooltip.3=* 青 - 游戏刻 +of.options.LAGOMETER.tooltip.4=* 蓝 - 预定可执行 +of.options.LAGOMETER.tooltip.5=* 紫 - 区块加载 +of.options.LAGOMETER.tooltip.6=* 红 - 区块更新 +of.options.LAGOMETER.tooltip.7=* 黄 - 能见度检查 +of.options.LAGOMETER.tooltip.8=* 绿 - 渲染地形 + +of.options.PROFILER=调试分析器 +of.options.PROFILER.tooltip.1=调试分析器 +of.options.PROFILER.tooltip.2= 开启 - 调试分析器启用(较慢) +of.options.PROFILER.tooltip.3= 关闭 - 调试分析器禁用(较快) +of.options.PROFILER.tooltip.4=在调试界面开启状态(F3)时 +of.options.PROFILER.tooltip.5=调试分析器收集并且显示调试信息。 + +of.options.WEATHER=天气 +of.options.WEATHER.tooltip.1=天气 +of.options.WEATHER.tooltip.2= 开启 - 开启天气(较慢) +of.options.WEATHER.tooltip.3= 关闭 - 关闭天气(较快) +of.options.WEATHER.tooltip.4=天气选项影响雨,雪和雷电。 +of.options.WEATHER.tooltip.5=天气选项仅在本地游戏中生效。 + +of.options.time.dayOnly=只有白天 +of.options.time.nightOnly=只有夜晚 + +of.options.TIME=时间 +of.options.TIME.tooltip.1=时间 +of.options.TIME.tooltip.2= 默认 - 正常的日夜交替 +of.options.TIME.tooltip.3= 只有白天 - 只有白天 +of.options.TIME.tooltip.4= 只有夜晚 - 只有夜晚 +of.options.TIME.tooltip.5=时间设置只在创造模式下 +of.options.TIME.tooltip.6=且为本地游戏时有效。 + +options.fullscreen.tooltip.1=全屏 +options.fullscreen.tooltip.2= 开启 - 使用全屏模式 +options.fullscreen.tooltip.3= 关闭 - 使用窗口模式 +options.fullscreen.tooltip.4=全屏模式可能比窗口模式 +options.fullscreen.tooltip.5=更快或更慢,这取决于显卡。 + +of.options.FULLSCREEN_MODE=全屏模式 +of.options.FULLSCREEN_MODE.tooltip.1=全屏模式 +of.options.FULLSCREEN_MODE.tooltip.2= 默认 - 使用桌面分辨率(较慢) +of.options.FULLSCREEN_MODE.tooltip.3= 自定义 - 使用自定义屏幕分辨率,可能会较快 +of.options.FULLSCREEN_MODE.tooltip.4=这个选项只有在全屏模式下生效(F11)。 +of.options.FULLSCREEN_MODE.tooltip.5=较低的分辨率通常会更快。 + +of.options.SHOW_FPS=显示 FPS +of.options.SHOW_FPS.tooltip.1=显示迷你的 FPS 和渲染信息 +of.options.SHOW_FPS.tooltip.2= FPS - 平均/最低 +of.options.SHOW_FPS.tooltip.3= C:- 区块渲染器 +of.options.SHOW_FPS.tooltip.4= E:- 一般实体 + 方块实体 +of.options.SHOW_FPS.tooltip.5= U:- 区块更新 +of.options.SHOW_FPS.tooltip.6=只有调试屏幕隐藏时 +of.options.SHOW_FPS.tooltip.7=迷你FPS信息才会显示。 + +of.options.save.45s=45 秒 +of.options.save.90s=90 秒 +of.options.save.3min=3 分钟 +of.options.save.6min=6 分钟 +of.options.save.12min=12 分钟 +of.options.save.24min=24 分钟 + +of.options.AUTOSAVE_TICKS=自动保存 +of.options.AUTOSAVE_TICKS.tooltip.1=自动保存间隔 +of.options.AUTOSAVE_TICKS.tooltip.2= 45 秒 - 默认 +of.options.AUTOSAVE_TICKS.tooltip.3=自动保存或许会导致突发延迟,这取决于渲染距离。 +of.options.AUTOSAVE_TICKS.tooltip.4=当打开游戏菜单时,世界也会保存。 + +of.options.SCREENSHOT_SIZE=截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.1=截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.2= 默认 - 默认的截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - 自定义截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.4=抓取更大的截图可能需要更多的内存。 +of.options.SCREENSHOT_SIZE.tooltip.5=与快速渲染和抗锯齿不兼容。 +of.options.SCREENSHOT_SIZE.tooltip.6=需要显卡帧缓冲区支持。 + +of.options.SHOW_GL_ERRORS=显示 GL 错误 +of.options.SHOW_GL_ERRORS.tooltip.1=显示 OpenGL 错误 +of.options.SHOW_GL_ERRORS.tooltip.2=当启用此选项时,OpenGL 错误会在聊天框中显示出来。 +of.options.SHOW_GL_ERRORS.tooltip.3=请仅当所有冲突都已知并且 +of.options.SHOW_GL_ERRORS.tooltip.4=明确知道错误无法修复时禁用此选项。 +of.options.SHOW_GL_ERRORS.tooltip.5=即使禁用了此选项,错误仍会被记录在错误日志中, +of.options.SHOW_GL_ERRORS.tooltip.6=并且这些错误可能仍会导致明显的 FPS 下降。 + +# Chat Settings + +of.options.CHAT_BACKGROUND=聊天背景 +of.options.CHAT_BACKGROUND.tooltip.1=聊天背景 +of.options.CHAT_BACKGROUND.tooltip.2= 默认 - 固定字宽 +of.options.CHAT_BACKGROUND.tooltip.3= 紧凑 - 调整以适应行宽 +of.options.CHAT_BACKGROUND.tooltip.4= 关闭 - 隐藏 + +of.options.CHAT_SHADOW=聊天阴影 +of.options.CHAT_SHADOW.tooltip.1=聊天阴影 +of.options.CHAT_SHADOW.tooltip.2= 开启 - 使用字体阴影 +of.options.CHAT_SHADOW.tooltip.3= 关闭 - 无字体阴影 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/zh_TW.lang b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/zh_TW.lang new file mode 100644 index 0000000..8d9ba31 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/lang/zh_TW.lang @@ -0,0 +1,725 @@ +# Contributors of Traditional Chinese localization # +# Degh_Cilon_ From WAWCraft 2016-02-18 ---- 2017-11-19 +# Shujinko_kun From MCHK 2016-02-25 ---- 2016-03-27 +# NatsuArashi (crowdin MC_PR) 2016-03-03 ---- 2018-06-18 +# pan93412 (crowdin pan93412) 2018-08-23 ---- 2018-08-23 +# NatsuArashi (crowdin MC_PR) ---- 2018-10-29 +##-------------- zh_TW --------------- + +# General +of.general.ambiguous=模糊 +of.general.custom=自訂 +of.general.from=來自 +of.general.id=Id +of.general.restart=重新啟動 +of.general.smart=智慧 + +# Keys +of.key.zoom=縮放 + +# Message +of.message.aa.shaders1=反鋸齒與光影不相容。 +of.message.aa.shaders2=請關閉光影來啟用這個選項。 + +of.message.af.shaders1=各向異性過濾與光影不相容。 +of.message.af.shaders2=請關閉光影來啟用這個選項。 + +of.message.fr.shaders1=快速繪製與光影不相容。 +of.message.fr.shaders2=請關閉光影來啟用這個選項。 + +of.message.an.shaders1=3D 立體與光影不相容。 +of.message.an.shaders2=請關閉光影來啟用這個選項。 + +of.message.shaders.aa1=光影與反鋸齒不相容。 +of.message.shaders.aa2=請把 品質 -> 反鋸齒 選項設定為 關閉 並重啟你的遊戲。 + +of.message.shaders.af1=光影與各向異性過濾不相容。 +of.message.shaders.af2=請把 品質 -> 各向異性過濾 選項設定為 關閉。 + +of.message.shaders.fr1=光影與快速繪製不相容。 +of.message.shaders.fr2=請把 效能 -> 快速繪製 選項設定為 關閉。 + +of.message.shaders.an1=光影與 3D 立體不相容。 +of.message.shaders.an2=請把 其他 -> 3D 立體 選項設定為 關閉。 + +of.message.shaders.nv1=這個光影需要較新的 OptiFine 版本: %s +of.message.shaders.nv2=你確定要繼續嗎? + +of.message.newVersion=新的 §eOptiFine§f 版本已可供使用:§e%s§f +of.message.java64Bit=你可以安裝 §e64 位元 Java§f 來提升效能。 +of.message.openglError=§eOpenGL 錯誤§f: %s (%s) + +of.message.shaders.loading=正在載入光影:%s + +of.message.other.reset=確定要將所有顯示設定重設至預設值嗎? + +of.message.loadingVisibleChunks=正在載入可見區塊 + +# Skin customization + +of.options.skinCustomisation.ofCape=OptiFine Cape... + +# Video settings + +options.graphics.tooltip.1=畫面品質 +options.graphics.tooltip.2= 流暢 - 低畫質,較流暢 +options.graphics.tooltip.3= 精緻 - 高畫質,較慢 +options.graphics.tooltip.4=改變雲、樹葉、水、 +options.graphics.tooltip.5=陰影與草地側面的外觀。 + +of.options.renderDistance.tiny=最近 +of.options.renderDistance.short=近 +of.options.renderDistance.normal=中等 +of.options.renderDistance.far=遠 +of.options.renderDistance.extreme=超遠 +of.options.renderDistance.insane=病態 +of.options.renderDistance.ludicrous=荒唐 + +options.renderDistance.tooltip.1=視野距離 +options.renderDistance.tooltip.2= 2 最近 - 32m(最快) +options.renderDistance.tooltip.3= 8 中等 - 128m(正常) +options.renderDistance.tooltip.4= 16 遠 - 256m(較慢) +options.renderDistance.tooltip.5= 32 超遠 - 512m(最慢!)非常消耗資源! +options.renderDistance.tooltip.6= 48 病態 - 768m,需要分配 2G 的記憶體 +options.renderDistance.tooltip.7= 64 荒唐 - 1024m,需要分配 3G 的記憶體 +options.renderDistance.tooltip.8=16 以上的視野值只在本機世界有效。 + +options.ao.tooltip.1=柔和光源 +options.ao.tooltip.2= 關閉 - 無柔和光源(較快) +options.ao.tooltip.3= 最小 - 簡單柔和光源(較慢) +options.ao.tooltip.4= 最大 - 複雜柔和光源(最慢) + +options.framerateLimit.tooltip.1=最大 FPS +options.framerateLimit.tooltip.2= 垂直同步 - 受限於螢幕 FPS (60,30,20) +options.framerateLimit.tooltip.3= 5-255 - 可變 +options.framerateLimit.tooltip.4= 無限制 - 無限制(最快) +options.framerateLimit.tooltip.5=即使未達 FPS 上限 +options.framerateLimit.tooltip.6=該限制仍會影響 FPS。 +of.options.framerateLimit.vsync=垂直同步 + +of.options.AO_LEVEL=柔和光源 +of.options.AO_LEVEL.tooltip.1=柔和光源 +of.options.AO_LEVEL.tooltip.2= 關閉 - 沒有陰影 +of.options.AO_LEVEL.tooltip.3= 50%% - 較亮的陰影 +of.options.AO_LEVEL.tooltip.4= 100%% - 較暗的陰影 + +options.viewBobbing.tooltip.1=更加真實的移動。 +options.viewBobbing.tooltip.2=當使用多精度材質時,關閉它以取得更佳效果。 + +options.guiScale.tooltip.1=介面大小 +options.guiScale.tooltip.2= 自動 - 最大尺寸 +options.guiScale.tooltip.3= 小,中,大 - 1x 到 3x +options.guiScale.tooltip.4= 4x-10x - 僅適用於 4K 解析度 +options.guiScale.tooltip.5=奇數值的放大倍數(1x,3x,5x...等)與 Unicode 不相容。 +options.guiScale.tooltip.6=較小的介面或許會更流暢。 + +options.vbo=使用 VBOs +options.vbo.tooltip.1=啟用緩衝區頂點物件(VBOs) +options.vbo.tooltip.2=使用一種常見的替代繪製模型 +options.vbo.tooltip.3=比預設繪製快 (5-10%%)。 + +options.gamma.tooltip.1=增加較暗物體的亮度 +options.gamma.tooltip.2= 幽暗 - 標準亮度 +options.gamma.tooltip.3= 1-99%% - 可變亮度 +options.gamma.tooltip.4= 明亮 - 最大亮度 +options.gamma.tooltip.5=此選項不會改變 +options.gamma.tooltip.6=全黑物體的亮度。 + +options.anaglyph.tooltip.1=3D 立體 +options.anaglyph.tooltip.2=給予兩眼不同的顏色以 +options.anaglyph.tooltip.3=達成 3D 立體的效果。 +options.anaglyph.tooltip.4=需要使用紅藍眼鏡進行觀看。 + +of.options.ALTERNATE_BLOCKS=方塊替換 +of.options.ALTERNATE_BLOCKS.tooltip.1=方塊替換 +of.options.ALTERNATE_BLOCKS.tooltip.2=為一些方塊使用備用的方塊模型。 +of.options.ALTERNATE_BLOCKS.tooltip.3=取決於選用的資源包。 + +of.options.FOG_FANCY=迷霧 +of.options.FOG_FANCY.tooltip.1=迷霧類型 +of.options.FOG_FANCY.tooltip.2= 流暢 - 較流暢的迷霧 +of.options.FOG_FANCY.tooltip.3= 精緻 - 較慢的迷霧,視覺效果較佳 +of.options.FOG_FANCY.tooltip.4= 關閉 - 無迷霧,最快 +of.options.FOG_FANCY.tooltip.5=精緻的迷霧只有當顯卡 +of.options.FOG_FANCY.tooltip.6=支援時才可使用。 + +of.options.FOG_START=迷霧出現距離 +of.options.FOG_START.tooltip.1=迷霧出現距離 +of.options.FOG_START.tooltip.2= 0.2 - 迷霧出現於玩家周圍 +of.options.FOG_START.tooltip.3= 0.8 - 迷霧出現於離玩家較遠的地方 +of.options.FOG_START.tooltip.4=此選項通常不會影響效能。 + +of.options.CHUNK_LOADING=區塊載入 +of.options.CHUNK_LOADING.tooltip.1=區塊載入 +of.options.CHUNK_LOADING.tooltip.2= 預設 - 當載入區塊時 FPS 不穩定 +of.options.CHUNK_LOADING.tooltip.3= 柔和化 - 穩定 FPS +of.options.CHUNK_LOADING.tooltip.4= 多核心 - 穩定 FPS,三倍的世界載入速度 +of.options.CHUNK_LOADING.tooltip.5=柔和化和多核心可消除由區塊 +of.options.CHUNK_LOADING.tooltip.6=載入引起的延遲和卡頓。 +of.options.CHUNK_LOADING.tooltip.7=多核心可以令世界載入速度提升三倍 +of.options.CHUNK_LOADING.tooltip.8=並通過使用多個 CPU 核心來提升 FPS。 +of.options.chunkLoading.smooth=柔和 +of.options.chunkLoading.multiCore=多核心 + +of.options.shaders=光影... +of.options.shadersTitle=光影 + +of.options.shaders.packNone=關閉 +of.options.shaders.packDefault=(內建) + +of.options.shaders.ANTIALIASING=反鋸齒 +of.options.shaders.ANTIALIASING.tooltip.1=反鋸齒 +of.options.shaders.ANTIALIASING.tooltip.2= 關閉 - (預設)停用反鋸齒(較快) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - 對線和邊緣反鋸齒處理(較慢) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA 是一種平滑鋸齒線和鮮明的色彩過渡的 +of.options.shaders.ANTIALIASING.tooltip.5=後處理特效。 +of.options.shaders.ANTIALIASING.tooltip.6=它不僅快於傳統的反鋸齒處理, +of.options.shaders.ANTIALIASING.tooltip.7=同時也與光影和快速繪製相容。 + +of.options.shaders.NORMAL_MAP=法線貼圖 +of.options.shaders.NORMAL_MAP.tooltip.1=法線貼圖 +of.options.shaders.NORMAL_MAP.tooltip.2= 開啟 - (預設)啟用法線貼圖 +of.options.shaders.NORMAL_MAP.tooltip.3= 關閉 - 停用法線貼圖 +of.options.shaders.NORMAL_MAP.tooltip.4=光影包可以使用法線貼圖以在 +of.options.shaders.NORMAL_MAP.tooltip.5=平面的模型表面模擬立體幾何結構。 +of.options.shaders.NORMAL_MAP.tooltip.6=法線貼圖材質一般由 +of.options.shaders.NORMAL_MAP.tooltip.7=目前的資源包提供。 + +of.options.shaders.SPECULAR_MAP=鏡面貼圖 +of.options.shaders.SPECULAR_MAP.tooltip.1=鏡面貼圖 +of.options.shaders.SPECULAR_MAP.tooltip.2= 開啟 - (預設)啟用鏡面貼圖 +of.options.shaders.SPECULAR_MAP.tooltip.3= 關閉 - 停用鏡面貼圖 +of.options.shaders.SPECULAR_MAP.tooltip.4=光影包可以使用鏡面貼圖 +of.options.shaders.SPECULAR_MAP.tooltip.5=來模擬特殊的反射效果。 +of.options.shaders.SPECULAR_MAP.tooltip.6=鏡面貼圖材質一般由 +of.options.shaders.SPECULAR_MAP.tooltip.7=目前的資源包提供。 + +of.options.shaders.RENDER_RES_MUL=繪製品質 +of.options.shaders.RENDER_RES_MUL.tooltip.1=繪製品質 +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - 低(最快) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - 標準(預設) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - 高(最慢) +of.options.shaders.RENDER_RES_MUL.tooltip.5=繪製品質控制光影包所 +of.options.shaders.RENDER_RES_MUL.tooltip.6=繪製的材質尺寸。 +of.options.shaders.RENDER_RES_MUL.tooltip.7=較低的值較有利於 4K 顯示。 +of.options.shaders.RENDER_RES_MUL.tooltip.8=較高的值用於反鋸齒過濾採樣。 + +of.options.shaders.SHADOW_RES_MUL=陰影品質 +of.options.shaders.SHADOW_RES_MUL.tooltip.1=陰影品質 +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - 低(最快) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - 標準(預設) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - 高(最慢) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=陰影品質控制光影包使用的 +of.options.shaders.SHADOW_RES_MUL.tooltip.6=陰影映射貼圖的大小。 +of.options.shaders.SHADOW_RES_MUL.tooltip.7=較低的值 = 不精確的、粗糙的陰影。 +of.options.shaders.SHADOW_RES_MUL.tooltip.8=較高的值 = 精緻的、更佳的陰影。 + +of.options.shaders.HAND_DEPTH_MUL=手部深度 +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=手部深度 +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - 手與鏡頭相距較近 +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (預設) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - 手與鏡頭相距較遠 +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=手部深度控制手持的物品與 +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=鏡頭的距離。 +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=此選項對於使用模糊景深的光影包 +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=應該會改變手持物品的模糊程度。 + +of.options.shaders.CLOUD_SHADOW=雲影 + +of.options.shaders.OLD_HAND_LIGHT=經典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=經典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= 預設 - 由光影包控制 +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= 開啟 - 使用經典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= 關閉 - 使用新式手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=經典手持光源允許只能辨識主手 +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=發光物品的光影包也能夠 +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=作用於副手。 + +of.options.shaders.OLD_LIGHTING=經典光源 +of.options.shaders.OLD_LIGHTING.tooltip.1=經典光源 +of.options.shaders.OLD_LIGHTING.tooltip.2= 預設 - 由光影包控制 +of.options.shaders.OLD_LIGHTING.tooltip.3= 開啟 - 使用經典光源 +of.options.shaders.OLD_LIGHTING.tooltip.4= 關閉 - 不使用經典光源 +of.options.shaders.OLD_LIGHTING.tooltip.5=使用經典光源時則採用原版的固定照明。 +of.options.shaders.OLD_LIGHTING.tooltip.6=在這種情況下,方塊各面的照明會始終如一。 +of.options.shaders.OLD_LIGHTING.tooltip.7=使用陰影的光影包通常會提供 +of.options.shaders.OLD_LIGHTING.tooltip.8=更好的、取決於太陽位置的光源。 + +of.options.shaders.DOWNLOAD=光影下載 +of.options.shaders.DOWNLOAD.tooltip.1=下載光影 +of.options.shaders.DOWNLOAD.tooltip.2= +of.options.shaders.DOWNLOAD.tooltip.3=在瀏覽器中打開光影包頁面。 +of.options.shaders.DOWNLOAD.tooltip.4=將已下載完成的光影置於「光影資料夾」中, +of.options.shaders.DOWNLOAD.tooltip.5=它們將出現在已安裝的光影列表裡。 + +of.options.shaders.SHADER_PACK=光影包資料夾 + +of.options.shaders.shadersFolder=光影資料夾 +of.options.shaders.shaderOptions=光影設定... + +of.options.shaderOptionsTitle=光影設定 + +of.options.quality=品質... +of.options.qualityTitle=品質設定 + +of.options.details=細節... +of.options.detailsTitle=細節設定 + +of.options.performance=效能... +of.options.performanceTitle=效能設定 + +of.options.animations=動畫... +of.options.animationsTitle=動畫設定 + +of.options.other=其他... +of.options.otherTitle=其他設定 + +of.options.other.reset=重設視訊設定... + +of.shaders.profile=設定檔 + +# Quality + +of.options.mipmap.bilinear=雙線性 +of.options.mipmap.linear=線性 +of.options.mipmap.nearest=最近 +of.options.mipmap.trilinear=三線性 + +options.mipmapLevels.tooltip.1=將材質柔和化以使遠處的物體 +options.mipmapLevels.tooltip.2=更好看的視覺效果。 +options.mipmapLevels.tooltip.3= 關閉 - 無柔和化 +options.mipmapLevels.tooltip.4= 1 - 最小柔和化 +options.mipmapLevels.tooltip.5= 4 - 最大柔和化 +options.mipmapLevels.tooltip.6=此選項通常不影響效能。 + +of.options.MIPMAP_TYPE=多精度材質類型 +of.options.MIPMAP_TYPE.tooltip.1=將材質柔和化以使遠處的物體 +of.options.MIPMAP_TYPE.tooltip.2=更好看的視覺效果。 +of.options.MIPMAP_TYPE.tooltip.3= 最近 - 粗糙柔和化(最快) +of.options.MIPMAP_TYPE.tooltip.4= 線性 - 正常柔和化 +of.options.MIPMAP_TYPE.tooltip.5= 雙線性 - 精細柔和化 +of.options.MIPMAP_TYPE.tooltip.6= 三線性 - 最佳柔和化(最慢) + + +of.options.AA_LEVEL=反鋸齒 +of.options.AA_LEVEL.tooltip.1=反鋸齒 +of.options.AA_LEVEL.tooltip.2= 關閉 - (預設)無反鋸齒(較快) +of.options.AA_LEVEL.tooltip.3= 2-16 - 對線與邊緣進行反鋸齒處理(較慢) +of.options.AA_LEVEL.tooltip.4=反鋸齒對鋸齒線和鮮明的色彩過渡 +of.options.AA_LEVEL.tooltip.5=進行平滑處理。 +of.options.AA_LEVEL.tooltip.6=啟用它可能會大幅降低 FPS。 +of.options.AA_LEVEL.tooltip.7=並非所有等級都顯卡都支援。 +of.options.AA_LEVEL.tooltip.8=重啟後生效! + +of.options.AF_LEVEL=各向異性過濾 +of.options.AF_LEVEL.tooltip.1=各向異性過濾 +of.options.AF_LEVEL.tooltip.2= 關閉 - (預設)標準材質細節(較快) +of.options.AF_LEVEL.tooltip.3= 2-16 - 為多級材質過濾後的材質提供精細細節(較慢) +of.options.AF_LEVEL.tooltip.4=各向異性過濾還原了經多次 +of.options.AF_LEVEL.tooltip.5=材質過濾後的材質細節。 +of.options.AF_LEVEL.tooltip.6=啟用它可能會大幅降低 FPS。 + +of.options.CLEAR_WATER=清澈水體 +of.options.CLEAR_WATER.tooltip.1=清澈水體 +of.options.CLEAR_WATER.tooltip.2= 開啟 - 清澈,透明水體 +of.options.CLEAR_WATER.tooltip.3= 關閉 - 預設水體 + +of.options.RANDOM_ENTITIES=隨機實體材質 +of.options.RANDOM_ENTITIES.tooltip.1=隨機實體材質 +of.options.RANDOM_ENTITIES.tooltip.2= 關閉 - 關閉隨機實體材質,較快 +of.options.RANDOM_ENTITIES.tooltip.3= 開啟 - 隨機實體材質,較慢 +of.options.RANDOM_ENTITIES.tooltip.4=遊戲中的實體使用隨機的相應貼圖。 +of.options.RANDOM_ENTITIES.tooltip.5=需要資源包內有多個實體貼圖。 + +of.options.BETTER_GRASS=更好的草地 +of.options.BETTER_GRASS.tooltip.1=更好的草地 +of.options.BETTER_GRASS.tooltip.2= 關閉 - 預設草地材質,較快 +of.options.BETTER_GRASS.tooltip.3= 流暢 - 草方塊側面全部使用草地材質,較慢 +of.options.BETTER_GRASS.tooltip.4= 精緻 - 草方塊側面材質動態化,最慢 + +of.options.BETTER_SNOW=更好的雪地 +of.options.BETTER_SNOW.tooltip.1=更好的雪地 +of.options.BETTER_SNOW.tooltip.2= 關閉 - 預設的雪地,較快 +of.options.BETTER_SNOW.tooltip.3= 開啟 - 更好的雪地,較慢 +of.options.BETTER_SNOW.tooltip.4=在透明方塊(如柵欄、草叢)與雪 +of.options.BETTER_SNOW.tooltip.5=接壤時在其下方顯示雪。 + +of.options.CUSTOM_FONTS=自訂字體 +of.options.CUSTOM_FONTS.tooltip.1=自訂字體 +of.options.CUSTOM_FONTS.tooltip.2= 開啟 - 使用自訂字體(預設),較慢 +of.options.CUSTOM_FONTS.tooltip.3= 關閉 - 使用預設字體,較快 +of.options.CUSTOM_FONTS.tooltip.4=自訂字體一般由 +of.options.CUSTOM_FONTS.tooltip.5=目前的資源包提供。 + +of.options.CUSTOM_COLORS=自訂色彩 +of.options.CUSTOM_COLORS.tooltip.1=自訂色彩 +of.options.CUSTOM_COLORS.tooltip.2= 開啟 - 使用自訂色彩(預設),較慢 +of.options.CUSTOM_COLORS.tooltip.3= 關閉 - 使用預設色彩,較快 +of.options.CUSTOM_COLORS.tooltip.4=自訂色彩一般由 +of.options.CUSTOM_COLORS.tooltip.5=目前的資源包提供。 + +of.options.SWAMP_COLORS=沼澤顏色 +of.options.SWAMP_COLORS.tooltip.1=沼澤顏色 +of.options.SWAMP_COLORS.tooltip.2= 開啟 - 使用沼澤顏色(預設),較慢 +of.options.SWAMP_COLORS.tooltip.3= 關閉 - 不使用沼澤顏色,較快 +of.options.SWAMP_COLORS.tooltip.4=沼澤的顏色會影響草、樹葉、籐蔓和水。 + +of.options.SMOOTH_BIOMES=柔和化生態域 +of.options.SMOOTH_BIOMES.tooltip.1=柔和化生態域 +of.options.SMOOTH_BIOMES.tooltip.2= 開啟 - 柔和化生態域的邊界(預設),較慢 +of.options.SMOOTH_BIOMES.tooltip.3= 關閉 - 不柔和化生態域的邊界,較快 +of.options.SMOOTH_BIOMES.tooltip.4=柔和化生態域的邊界平滑取樣於 +of.options.SMOOTH_BIOMES.tooltip.5=附近所有方塊顏色的平均值。 +of.options.SMOOTH_BIOMES.tooltip.6=草、樹葉、籐蔓和水皆會受影響。 + +of.options.CONNECTED_TEXTURES=連接材質 +of.options.CONNECTED_TEXTURES.tooltip.1=連接材質 +of.options.CONNECTED_TEXTURES.tooltip.2= 關閉 - 關閉連接材質(預設) +of.options.CONNECTED_TEXTURES.tooltip.3= 流暢 - 快速處理連接材質 +of.options.CONNECTED_TEXTURES.tooltip.4= 精緻 - 精細處理連接材質 +of.options.CONNECTED_TEXTURES.tooltip.5=連接材質為玻璃、沙石和書架增加了連接材質, +of.options.CONNECTED_TEXTURES.tooltip.6=當它們互相放在一起時會將材質接為一體。 +of.options.CONNECTED_TEXTURES.tooltip.7=連接材質一般由目前的 +of.options.CONNECTED_TEXTURES.tooltip.8=資源包提供。 + +of.options.NATURAL_TEXTURES=自然材質 +of.options.NATURAL_TEXTURES.tooltip.1=自然材質 +of.options.NATURAL_TEXTURES.tooltip.2= 關閉 - 關閉自然材質(預設) +of.options.NATURAL_TEXTURES.tooltip.3= 開啟 - 使用自然材質 +of.options.NATURAL_TEXTURES.tooltip.4=自然材質移除由同一類型的方塊 +of.options.NATURAL_TEXTURES.tooltip.5=重複放置所產生的柵格狀圖案。 +of.options.NATURAL_TEXTURES.tooltip.6=它通過旋轉和翻轉方塊的基礎材質 +of.options.NATURAL_TEXTURES.tooltip.7=來產生材質變體。自然材質的設定 +of.options.NATURAL_TEXTURES.tooltip.8=和材質一般由目前的資源包提供。 + +of.options.EMISSIVE_TEXTURES=鏡面材質 +of.options.EMISSIVE_TEXTURES.tooltip.1=鏡面材質 +of.options.EMISSIVE_TEXTURES.tooltip.2= 關閉 - 關閉鏡面材質(預設) +of.options.EMISSIVE_TEXTURES.tooltip.3= 開啟 - 使用鏡面材質 +of.options.EMISSIVE_TEXTURES.tooltip.4=光亮材質被繪製為全亮度 +of.options.EMISSIVE_TEXTURES.tooltip.5=的覆蓋層。它們可以用來 +of.options.EMISSIVE_TEXTURES.tooltip.6=模擬基本材質的發光部分。 +of.options.EMISSIVE_TEXTURES.tooltip.7=鏡面材質一般由目前的 +of.options.EMISSIVE_TEXTURES.tooltip.8=資源包提供。 + +of.options.CUSTOM_SKY=自訂天空 +of.options.CUSTOM_SKY.tooltip.1=自訂天空 +of.options.CUSTOM_SKY.tooltip.2= 開啟 - 自訂天空材質(預設),較慢 +of.options.CUSTOM_SKY.tooltip.3= 關閉 - 預設天空材質,較快 +of.options.CUSTOM_SKY.tooltip.4=自訂天空材質一般由 +of.options.CUSTOM_SKY.tooltip.5=目前的資源包提供。 + +of.options.CUSTOM_ITEMS=自訂物品 +of.options.CUSTOM_ITEMS.tooltip.1=自訂物品 +of.options.CUSTOM_ITEMS.tooltip.2= 開啟 - 自訂物品材質(預設),較慢 +of.options.CUSTOM_ITEMS.tooltip.3= 關閉 - 原版物品材質,較快 +of.options.CUSTOM_ITEMS.tooltip.4=自訂物品材質一般由 +of.options.CUSTOM_ITEMS.tooltip.5=目前的資源包提供。 + +of.options.CUSTOM_ENTITY_MODELS=自訂實體模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=自訂實體模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= 開啟 - 自訂實體模型(預設),較慢 +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= 關閉 - 原版實體模型,較快 +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=自訂實體模型一般由 +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=目前的資源包提供。 + +of.options.CUSTOM_GUIS=自訂介面 +of.options.CUSTOM_GUIS.tooltip.1=自訂介面 +of.options.CUSTOM_GUIS.tooltip.2= 開啟 - 自訂介面(預設),較慢 +of.options.CUSTOM_GUIS.tooltip.3= 關閉 - 原版介面,較快 +of.options.CUSTOM_GUIS.tooltip.4=自訂介面一般由目前的資源包提供。 + +# Details + +of.options.CLOUDS=雲 +of.options.CLOUDS.tooltip.1=雲 +of.options.CLOUDS.tooltip.2= 預設 - 以「畫面品質」的設定為準 +of.options.CLOUDS.tooltip.3= 流暢 - 低品質,較快 +of.options.CLOUDS.tooltip.4= 精緻 - 高品質,較慢 +of.options.CLOUDS.tooltip.5= 關閉 - 沒有雲,最快 +of.options.CLOUDS.tooltip.6=流暢的雲使用 2D 繪製。 +of.options.CLOUDS.tooltip.7=精緻的雲使用 3D 繪製。 + +of.options.CLOUD_HEIGHT=雲層高度 +of.options.CLOUD_HEIGHT.tooltip.1=雲層高度 +of.options.CLOUD_HEIGHT.tooltip.2= 關閉 - 預設高度 +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - 超過世界限制高度 + +of.options.TREES=樹 +of.options.TREES.tooltip.1=樹 +of.options.TREES.tooltip.2= 預設 - 以圖像畫質設定為標準 +of.options.TREES.tooltip.3= 流暢 - 低品質,最快 +of.options.TREES.tooltip.4= 智慧 - 較高品質,較快 +of.options.TREES.tooltip.5= 精緻 - 高品質,較慢 +of.options.TREES.tooltip.6=流暢的樹葉不透明。 +of.options.TREES.tooltip.7=精緻的樹葉透明。 + +of.options.RAIN=雨和雪 +of.options.RAIN.tooltip.1=雨和雪 +of.options.RAIN.tooltip.2= 預設 - 以圖像畫質的設定為準 +of.options.RAIN.tooltip.3= 流暢 - 少量的雨/雪,較快 +of.options.RAIN.tooltip.4= 精緻 - 大量的雨/雪,較慢 +of.options.RAIN.tooltip.5= 關閉 - 沒有雨/雪,最快 +of.options.RAIN.tooltip.6=當雨雪選項為 關閉 時, +of.options.RAIN.tooltip.7=雨聲仍然存在。 + +of.options.SKY=天空 +of.options.SKY.tooltip.1=天空 +of.options.SKY.tooltip.2= 開啟 - 天空可見,較慢 +of.options.SKY.tooltip.3= 關閉 - 天空不可見,較快 +of.options.SKY.tooltip.4=當天空關閉時,月亮和太陽依然可見。 + +of.options.STARS=星星 +of.options.STARS.tooltip.1=星星 +of.options.STARS.tooltip.2= 開啟 - 星星可見,較慢 +of.options.STARS.tooltip.3= 關閉 - 星星不可見,較快 + +of.options.SUN_MOON=太陽和月亮 +of.options.SUN_MOON.tooltip.1=太陽和月亮 +of.options.SUN_MOON.tooltip.2= 開啟 - 太陽和月亮可見(預設) +of.options.SUN_MOON.tooltip.3= 關閉 - 太陽和月亮不可見(較快) + +of.options.SHOW_CAPES=顯示披風 +of.options.SHOW_CAPES.tooltip.1=顯示披風 +of.options.SHOW_CAPES.tooltip.2= 開啟 - 顯示玩家披風(預設) +of.options.SHOW_CAPES.tooltip.3= 關閉 - 不顯示玩家披風 + +of.options.TRANSLUCENT_BLOCKS=半透明方塊 +of.options.TRANSLUCENT_BLOCKS.tooltip.1=半透明方塊 +of.options.TRANSLUCENT_BLOCKS.tooltip.2= 預設 - 取決於圖像設定 +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 精緻 - 準確的混合顏色(預設) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= 流暢 - 快速的混合顏色(較快) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=控制不同顏色的半透明方塊 +of.options.TRANSLUCENT_BLOCKS.tooltip.6=(染色玻璃、水、冰)隔著空氣 +of.options.TRANSLUCENT_BLOCKS.tooltip.7=放在一起時的顏色混和。 + +of.options.HELD_ITEM_TOOLTIPS=持有物資訊顯示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=持有物資訊顯示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= 開啟 - 顯示持有物資訊(預設) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= 關閉 - 隱藏持有物資訊 + +of.options.ADVANCED_TOOLTIPS=進階資訊顯示 +of.options.ADVANCED_TOOLTIPS.tooltip.1=進階資訊顯示 +of.options.ADVANCED_TOOLTIPS.tooltip.2= 開啟 - 顯示進階資訊顯示 +of.options.ADVANCED_TOOLTIPS.tooltip.3= 關閉 - 隱藏進階資訊顯示(預設) +of.options.ADVANCED_TOOLTIPS.tooltip.4=進階資訊顯示顯示物品 +of.options.ADVANCED_TOOLTIPS.tooltip.5=(ID、耐久度)和光影設定資料 +of.options.ADVANCED_TOOLTIPS.tooltip.6=(ID、來源、預設值)。 + +of.options.DROPPED_ITEMS=掉落物品 +of.options.DROPPED_ITEMS.tooltip.1=掉落物品 +of.options.DROPPED_ITEMS.tooltip.2= 預設 - 以圖像畫質的設定為準 +of.options.DROPPED_ITEMS.tooltip.3= 流暢 - 2D 掉落物品,較快 +of.options.DROPPED_ITEMS.tooltip.4= 精緻 - 3D 掉落物品,較慢 + +options.entityShadows.tooltip.1=實體陰影 +options.entityShadows.tooltip.2= 開啟 - 顯示實體陰影 +options.entityShadows.tooltip.3= 關閉 - 隱藏實體陰影 + +of.options.VIGNETTE=暈影 +of.options.VIGNETTE.tooltip.1=螢幕四角輕微變暗的視覺效果 +of.options.VIGNETTE.tooltip.2= 預設 - 以圖像畫質的設定為準(預設) +of.options.VIGNETTE.tooltip.3= 流暢 - 暈影關閉(較快) +of.options.VIGNETTE.tooltip.4= 精緻 - 暈影開啟(較慢) +of.options.VIGNETTE.tooltip.5=暈影可能對 FPS 有明顯影響, +of.options.VIGNETTE.tooltip.6=尤其是全螢幕遊戲時 +of.options.VIGNETTE.tooltip.7=暈影的效果非常細微 +of.options.VIGNETTE.tooltip.8=且可以安全地關閉。 + +of.options.DYNAMIC_FOV=動態視場 +of.options.DYNAMIC_FOV.tooltip.1=動態視場 +of.options.DYNAMIC_FOV.tooltip.2= 開啟 - 啟用動態視場(預設) +of.options.DYNAMIC_FOV.tooltip.3= 關閉 - 停用動態視場 +of.options.DYNAMIC_FOV.tooltip.4=當飛行、疾跑或拉弓 +of.options.DYNAMIC_FOV.tooltip.5=時改變視場。 + +of.options.DYNAMIC_LIGHTS=動態光源 +of.options.DYNAMIC_LIGHTS.tooltip.1=動態光源 +of.options.DYNAMIC_LIGHTS.tooltip.2= 關閉 - 無動態光源(預設) +of.options.DYNAMIC_LIGHTS.tooltip.3= 流暢 - 較流暢的動態光源(每 500 毫秒更新一次) +of.options.DYNAMIC_LIGHTS.tooltip.4= 精緻 - 高品質的動態光源(即時更新) +of.options.DYNAMIC_LIGHTS.tooltip.5=允許發光的物品(火把、螢石等) +of.options.DYNAMIC_LIGHTS.tooltip.6=當被玩家左右手持握、裝備或 +of.options.DYNAMIC_LIGHTS.tooltip.7=成爲掉落物時照亮周圍。 + +# Performance + +of.options.SMOOTH_FPS=柔和化 FPS +of.options.SMOOTH_FPS.tooltip.1=通過清除顯示卡緩衝區來穩定 FPS +of.options.SMOOTH_FPS.tooltip.2= 關閉 - 不穩定,FPS 可能波動 +of.options.SMOOTH_FPS.tooltip.3= 開啟 - FPS 穩定 +of.options.SMOOTH_FPS.tooltip.4=此選項依賴於顯卡驅動 +of.options.SMOOTH_FPS.tooltip.5=不一定有明顯效果。 + +of.options.SMOOTH_WORLD=柔和化世界 +of.options.SMOOTH_WORLD.tooltip.1=移除內部伺服器造成的資料延遲。 +of.options.SMOOTH_WORLD.tooltip.2= 關閉 - 不穩定,FPS 可能波動 +of.options.SMOOTH_WORLD.tooltip.3= 開啟 - FPS 穩定 +of.options.SMOOTH_WORLD.tooltip.4=分擔內部伺服器負載來穩定 FPS。 +of.options.SMOOTH_WORLD.tooltip.5=只在本機世界(單人遊戲)有效。 + +of.options.FAST_RENDER=快速繪製 +of.options.FAST_RENDER.tooltip.1=快速繪製 +of.options.FAST_RENDER.tooltip.2= 關閉 - 標準繪製(預設) +of.options.FAST_RENDER.tooltip.3= 開啟 - 最佳化繪製(較快) +of.options.FAST_RENDER.tooltip.4=採用最佳化的繪製算法來降低 GPU 的負載 +of.options.FAST_RENDER.tooltip.5=並且可能大幅提升 FPS。 +of.options.FAST_RENDER.tooltip.6=這個選項可能會與部分模組衝突。 + +of.options.FAST_MATH=快速運算 +of.options.FAST_MATH.tooltip.1=快速運算 +of.options.FAST_MATH.tooltip.2= 關閉 - 標準的運算(預設) +of.options.FAST_MATH.tooltip.3= 開啟 - 更快的運算 +of.options.FAST_MATH.tooltip.4=採用最佳化的 sin() 和 cos() 函數可以更 +of.options.FAST_MATH.tooltip.5=妥善地利用 CPU 快取並且提升 FPS。 +of.options.FAST_MATH.tooltip.6=這個選項會稍微影響世界生成。 + +of.options.CHUNK_UPDATES=區塊更新 +of.options.CHUNK_UPDATES.tooltip.1=區塊更新 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 世界載入速度較慢,FPS 較高(預設) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 世界載入速度較快,FPS 較低 +of.options.CHUNK_UPDATES.tooltip.4= 5 - 世界載入速度最快,FPS 最低 +of.options.CHUNK_UPDATES.tooltip.5=繪製每 FPS 時更新的區塊數, +of.options.CHUNK_UPDATES.tooltip.6=愈高的值將會導致 FPS 不穩定。 + +of.options.CHUNK_UPDATES_DYNAMIC=動態更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=動態更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= 關閉 - (預設)每 FPS 標準區塊更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= 開啟 - 當玩家站立不動時更新更多區塊 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=當玩家站定時會更新更多 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=區塊以加速世界載入。 + +of.options.LAZY_CHUNK_LOADING=平緩區塊更新 +of.options.LAZY_CHUNK_LOADING.tooltip.1=平緩區塊更新 +of.options.LAZY_CHUNK_LOADING.tooltip.2= 關閉 - 預設的伺服器區塊載入 +of.options.LAZY_CHUNK_LOADING.tooltip.3= 開啟 - 平緩伺服器區塊載入(更柔和) +of.options.LAZY_CHUNK_LOADING.tooltip.4=藉由將區塊分佈在多個「遊戲刻」中讀取 +of.options.LAZY_CHUNK_LOADING.tooltip.5=來柔和化伺服器整體區塊載入。 +of.options.LAZY_CHUNK_LOADING.tooltip.6=如果世界無法正確的載入,請把它關閉。 +of.options.LAZY_CHUNK_LOADING.tooltip.7=僅適用於單玩家的本機世界。 + +of.options.RENDER_REGIONS=區域繪製 +of.options.RENDER_REGIONS.tooltip.1=區域繪製 +of.options.RENDER_REGIONS.tooltip.2= 關閉 - (預設)不使用區域繪製 +of.options.RENDER_REGIONS.tooltip.3= 開啟 - 使用區域繪製 +of.options.RENDER_REGIONS.tooltip.4=區域繪製可使遠處的地形繪製得更快。 +of.options.RENDER_REGIONS.tooltip.5=當啟用頂點緩衝區對像(VBOs)時此選項將更有效。 +of.options.RENDER_REGIONS.tooltip.6=不建議用於整合式顯示卡(內顯)。 + +of.options.SMART_ANIMATIONS=智慧型動畫 +of.options.SMART_ANIMATIONS.tooltip.1=智慧型動畫 +of.options.SMART_ANIMATIONS.tooltip.2= 關閉 - 不使用智慧型動畫(預設) +of.options.SMART_ANIMATIONS.tooltip.3= 開啟 - 使用智慧型動畫 +of.options.SMART_ANIMATIONS.tooltip.4=利用智慧型動畫,讓遊戲只播放 +of.options.SMART_ANIMATIONS.tooltip.5=畫面目前可見的材質動畫效果。 +of.options.SMART_ANIMATIONS.tooltip.6=這能降低 tick lag 尖峰並提升 FPS。 +of.options.SMART_ANIMATIONS.tooltip.7=在大型模組包與高解析度資源包下很有用。 + +# Animations + +of.options.animation.allOn=全部開啟 +of.options.animation.allOff=全部關閉 +of.options.animation.dynamic=動態 + +of.options.ANIMATED_WATER=水面動畫 +of.options.ANIMATED_LAVA=岩漿動畫 +of.options.ANIMATED_FIRE=火焰動畫 +of.options.ANIMATED_PORTAL=傳送門動畫 +of.options.ANIMATED_REDSTONE=紅石動畫 +of.options.ANIMATED_EXPLOSION=爆炸動畫 +of.options.ANIMATED_FLAME=燃燒動畫 +of.options.ANIMATED_SMOKE=煙霧動畫 +of.options.VOID_PARTICLES=虛空粒子 +of.options.WATER_PARTICLES=水濺粒子 +of.options.RAIN_SPLASH=雨滴飛濺 +of.options.PORTAL_PARTICLES=傳送門粒子 +of.options.POTION_PARTICLES=藥水粒子 +of.options.DRIPPING_WATER_LAVA=流動水/岩漿 +of.options.ANIMATED_TERRAIN=地形動畫 +of.options.ANIMATED_TEXTURES=材質動畫 +of.options.FIREWORK_PARTICLES=煙火粒子 + +# Other + +of.options.LAGOMETER=效能資訊 +of.options.LAGOMETER.tooltip.1=在除錯畫面 (F3) 中顯示效能資訊。 +of.options.LAGOMETER.tooltip.2=* 橙 - 記憶體垃圾回收 +of.options.LAGOMETER.tooltip.3=* 青 - Tick +of.options.LAGOMETER.tooltip.4=* 藍 - 排定的處理程序 +of.options.LAGOMETER.tooltip.5=* 紫 - 區塊上傳 +of.options.LAGOMETER.tooltip.6=* 紅 - 區塊更新 +of.options.LAGOMETER.tooltip.7=* 黃 - 可見度檢查 +of.options.LAGOMETER.tooltip.8=* 綠 - 繪製的地形 + +of.options.PROFILER=除錯分析器 +of.options.PROFILER.tooltip.1=除錯分析器 +of.options.PROFILER.tooltip.2= 開啟 - 啟用除錯分析器,較慢 +of.options.PROFILER.tooltip.3= 關閉 - 停用除錯分析器,較快 +of.options.PROFILER.tooltip.4=除錯分析器在除錯介面 (F3) 開啟時 +of.options.PROFILER.tooltip.5=收集並且顯示除錯資訊。 + +of.options.WEATHER=天氣 +of.options.WEATHER.tooltip.1=天氣 +of.options.WEATHER.tooltip.2= 開啟 - 開啟天氣,較慢 +of.options.WEATHER.tooltip.3= 關閉 - 關閉天氣,較快 +of.options.WEATHER.tooltip.4=天氣選項影響雨,雪和雷電。 +of.options.WEATHER.tooltip.5=天氣選項僅在本機遊戲中生效。 + +of.options.time.dayOnly=只有白天 +of.options.time.nightOnly=只有夜晚 + +of.options.TIME=時間 +of.options.TIME.tooltip.1=時間 +of.options.TIME.tooltip.2= 預設 - 正常的日夜交替 +of.options.TIME.tooltip.3= 只有白天 - 只有白天 +of.options.TIME.tooltip.4= 只有夜晚 - 只有夜晚 +of.options.TIME.tooltip.5=時間設定只在創造模式下 +of.options.TIME.tooltip.6=且為本機遊戲時有效。 + +options.fullscreen.tooltip.1=全螢幕 +options.fullscreen.tooltip.2= 開啟 - 使用全螢幕模式 +options.fullscreen.tooltip.3= 關閉 - 使用視窗模式 +options.fullscreen.tooltip.4=全螢幕模式可能比視窗模式 +options.fullscreen.tooltip.5=更快或更慢,取決於顯卡。 + +of.options.FULLSCREEN_MODE=全螢幕模式 +of.options.FULLSCREEN_MODE.tooltip.1=全螢幕模式 +of.options.FULLSCREEN_MODE.tooltip.2= 預設 - 使用桌面解析度,較慢 +of.options.FULLSCREEN_MODE.tooltip.3= 自訂 - 使用自訂螢幕解析度,可能會較快 +of.options.FULLSCREEN_MODE.tooltip.4=此選項只在全螢幕模式下有效 (F11)。 +of.options.FULLSCREEN_MODE.tooltip.5=較低的解析度通常會較快。 + +of.options.SHOW_FPS=顯示 FPS +of.options.SHOW_FPS.tooltip.1=顯示精簡的 FPS 和繪製資訊 +of.options.SHOW_FPS.tooltip.2= Fps - 平均值/最低值 +of.options.SHOW_FPS.tooltip.3= C: - 區塊繪製器 +of.options.SHOW_FPS.tooltip.4= E: - 一般實體 + 方塊實體 +of.options.SHOW_FPS.tooltip.5= U: - 區塊更新 +of.options.SHOW_FPS.tooltip.6=當除錯畫面隱藏時才會 +of.options.SHOW_FPS.tooltip.7=顯示精簡的 FPS 資訊。 + +of.options.save.default=預設(兩秒) +of.options.save.20s=20 秒 +of.options.save.3min=3 分鐘 +of.options.save.30min=30 分鐘 + +of.options.AUTOSAVE_TICKS=自動儲存 +of.options.AUTOSAVE_TICKS.tooltip.1=自動儲存間隔 +of.options.AUTOSAVE_TICKS.tooltip.2=不建議使用預設自動儲存間隔(兩秒)。 +of.options.AUTOSAVE_TICKS.tooltip.3=自動儲存會導致卡頓。 + +of.options.SCREENSHOT_SIZE=截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.1=截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.2= 預設 - 預設的截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - 自訂截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.4=抓取更大的截圖可能需要更多的記憶體。 +of.options.SCREENSHOT_SIZE.tooltip.5=與快速繪製及反鋸齒不相容。 +of.options.SCREENSHOT_SIZE.tooltip.6=需要顯卡 FPS 緩衝區支持。 + +of.options.SHOW_GL_ERRORS=顯示 GL 錯誤 +of.options.SHOW_GL_ERRORS.tooltip.1=顯示 OpenGL 錯誤 +of.options.SHOW_GL_ERRORS.tooltip.2=啟用時,OpenGL 的錯誤會顯示在聊天視窗中。 +of.options.SHOW_GL_ERRORS.tooltip.3=只有在已知的衝突或錯誤 +of.options.SHOW_GL_ERRORS.tooltip.4=無法修復時才建議停用。 +of.options.SHOW_GL_ERRORS.tooltip.5=停用時,錯誤仍然會記在錯誤記錄中, +of.options.SHOW_GL_ERRORS.tooltip.6=且依然可能導致 FPS 明顯下降。 diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/natural.properties b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/natural.properties new file mode 100644 index 0000000..54bf805 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/natural.properties @@ -0,0 +1,81 @@ +# Configuration for OptiFine's Natural Textures feature +# Location: /assets/minecraft/optifine/natural.properties +# +# Configuration format +# = +# +# Values +# 4 = Rotate x 90 (4 variants) +# 2 = Rotate x 180 (2 variants) +# F = Flip texture horizontally (2 variants) +# 4F = 4 + Flip (8 variants) +# 2F = 2 + Flip (4 variants) +# +# Example for obsidian texture which can rotate with 4 variants and flip +# obsidian = 4F +# + +# Grass +grass_side = F +grass_side_overlay = F +grass_side_snowed = F +mycelium_side = F +mycelium_top = 4F +# Snow +snow = 4F +# Dirt +coarse_dirt = 4F +dirt_podzol_top = 4F +farmland_wet = 2F +farmland_dry = 2F +# Stone +stone_granite = 2F +stone_diorite = 2F +stone_andesite = 2F +sandstone_top = 4 +sandstone_bottom = 4F +stone_slab_top = F +end_stone = 4 +# Gravel +gravel = 2 +clay = 4F +# Logs +log_oak = 2F +log_spruce = 2F +log_birch = F +log_jungle = 2F +log_acacia = 2F +log_big_oak = 2F +log_oak_top = 4F +log_spruce_top = 4F +log_birch_top = 4F +log_jungle_top = 4F +log_acacia_top = 4F +log_big_oak_top = 4F +# Leaves +leaves_oak = 2F +leaves_spruce = 2F +leaves_birch = 2F +leaves_jungle = 2 +leaves_big_oak = 2F +leaves_acacia = 2F +# Ores +gold_ore = 2F +iron_ore = 2F +coal_ore = 2F +diamond_ore = 2F +redstone_ore = 2F +lapis_ore = 2F +# Nether +netherrack = 4F +quartz_ore = 2 +soul_sand = 4F +glowstone = 4 +# Redstone +redstone_lamp_on = 4F +redstone_lamp_off = 4F +# Prismarine +prismarine_rough = 4F +# Misc +obsidian = 4F +cactus_side = 2F \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/optifine/textures/icons.png b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/textures/icons.png new file mode 100644 index 0000000..24e4032 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/optifine/textures/icons.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/black.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/black.png new file mode 100644 index 0000000..5b5b00f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/blue.png new file mode 100644 index 0000000..f802763 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/dark_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/dark_blue.png new file mode 100644 index 0000000..9df6d32 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/dark_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/green.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/green.png new file mode 100644 index 0000000..5347e70 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/purple.png new file mode 100644 index 0000000..53730f4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/red.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/red.png new file mode 100644 index 0000000..05e5c83 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/turquoise.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/turquoise.png new file mode 100644 index 0000000..a76406a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/turquoise.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/yellow.png new file mode 100644 index 0000000..042bbfa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/preview/client/wings/yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur.json new file mode 100644 index 0000000..fb572ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "animblur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur_full.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur_full.json new file mode 100644 index 0000000..d17c4bb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur_full.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "animblur_full", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur_full", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur_full", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur_full", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur_horizontal.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur_horizontal.json new file mode 100644 index 0000000..97e1327 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/animblur_horizontal.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "animblur_horizontal", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, { + "name": "animblur_horizontal", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "animblur_horizontal", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "animblur_horizontal", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/antialias.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/antialias.json new file mode 100644 index 0000000..bc31af3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/antialias.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "antialias", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/art.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/art.json new file mode 100644 index 0000000..6d6c7ec --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/art.json @@ -0,0 +1,64 @@ +{ + "targets": [ + "0", + "1" + ], + "passes": [ + { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "0" + }, + { + "name": "outline_watercolor", + "intarget": "0", + "outtarget": "minecraft:main" + }, + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "1", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.8, 0.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "1", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 0.8 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "outline_combine", + "intarget": "0", + "outtarget": "1", + "auxtargets": [ + { + "name": "OutlineSampler", + "id": "minecraft:main" + } + ] + }, + { + "name": "blit", + "intarget": "1", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/bits.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/bits.json new file mode 100644 index 0000000..7236746 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/bits.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "bits", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blobs.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blobs.json new file mode 100644 index 0000000..d6260aa --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blobs.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blobs", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blobs2.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blobs2.json new file mode 100644 index 0000000..3464ae3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blobs2.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blur.json new file mode 100644 index 0000000..bca04d5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/blur.json @@ -0,0 +1,37 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/bumpy.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/bumpy.json new file mode 100644 index 0000000..0870985 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/bumpy.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "bumpy", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/color_convolve.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/color_convolve.json new file mode 100644 index 0000000..9f00212 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/color_convolve.json @@ -0,0 +1,20 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { "name": "Saturation", "values": [ 1.4 ] } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/creeper.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/creeper.json new file mode 100644 index 0000000..da503f1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/creeper.json @@ -0,0 +1,41 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "RedMatrix", + "values": [ 0.0, 0.0, 0.0 ] + }, + { + "name": "GreenMatrix", + "values": [ 0.3, 0.59, 0.11 ] + }, + { + "name": "BlueMatrix", + "values": [ 0.0, 0.0, 0.0 ] + } + ] + }, + { + "name": "bits", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "Resolution", + "values": [ 16.0 ] + }, + { + "name": "MosaicSize", + "values": [ 4.0 ] + } + ] + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/deconverge.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/deconverge.json new file mode 100644 index 0000000..4eb2b8d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/deconverge.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "deconverge", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/desaturate.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/desaturate.json new file mode 100644 index 0000000..675018f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/desaturate.json @@ -0,0 +1,23 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "Saturation", + "values": [ 0.2 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/entity_outline.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/entity_outline.json new file mode 100644 index 0000000..e53ff3d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/entity_outline.json @@ -0,0 +1,48 @@ +{ + "targets": [ + "swap", + "final" + ], + "passes": [ + { + "name": "entity_outline", + "intarget": "final", + "outtarget": "swap" + }, + { + "name": "blur", + "intarget": "swap", + "outtarget": "final", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 2.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "final", + "outtarget": "swap", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 2.0 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "final" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json new file mode 100644 index 0000000..7851a67 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "fade_in_blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, { + "name": "fade_in_blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "fade_in_blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "fade_in_blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/flip.json new file mode 100644 index 0000000..e382435 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/flip.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "flip", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa.json new file mode 100644 index 0000000..83292b7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "fxaa", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa_of_2x.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa_of_2x.json new file mode 100644 index 0000000..08754ff --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa_of_2x.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "fxaa_of_2x", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa_of_4x.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa_of_4x.json new file mode 100644 index 0000000..1935450 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/fxaa_of_4x.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "fxaa_of_4x", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/green.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/green.json new file mode 100644 index 0000000..5d0af6c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/green.json @@ -0,0 +1,41 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "RedMatrix", + "values": [ 0.0, 0.0, 0.0 ] + }, + { + "name": "GreenMatrix", + "values": [ 0.3, 0.59, 0.11 ] + }, + { + "name": "BlueMatrix", + "values": [ 0.0, 0.0, 0.0 ] + } + ] + }, + { + "name": "bits", + "intarget": "swap", + "outtarget": "minecraft:main" + }, + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/invert.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/invert.json new file mode 100644 index 0000000..2ab63fb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/invert.json @@ -0,0 +1,23 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "invert", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "InverseAmount", + "values": [ 0.8 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/lunar_motionblur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/lunar_motionblur.json new file mode 100644 index 0000000..7bb33e7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/lunar_motionblur.json @@ -0,0 +1,30 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ { + "name": "lunar_motionblur", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ { + "name": "Phosphor", + "values": [ 0.95, 0.95, 0.95 ] + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/motionblur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/motionblur.json new file mode 100644 index 0000000..5df7dca --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/motionblur.json @@ -0,0 +1,30 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ { + "name": "phosphor", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ { + "name": "Phosphor", + "values": [ 0.9, 0.9, 0.9 ] + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/notch.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/notch.json new file mode 100644 index 0000000..164943c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/notch.json @@ -0,0 +1,26 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "notch", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ + { + "name": "DitherSampler", + "id": "dither", + "width": 4, + "height": 4, + "bilinear": false + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/ntsc.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/ntsc.json new file mode 100644 index 0000000..abc005b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/ntsc.json @@ -0,0 +1,92 @@ +{ + "targets": [ + "swap", + "swap2", + "previous" + ], + "passes": [ + { + "name": "ntsc_encode", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "ntsc_decode", + "intarget": "swap", + "outtarget": "swap2", + "auxtargets": [ + { + "name": "BaseSampler", + "id": "minecraft:main" + } + ] + }, + { + "name": "color_convolve", + "intarget": "swap2", + "outtarget": "swap" + }, + { + "name": "deconverge", + "intarget": "swap", + "outtarget": "minecraft:main" + }, + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "phosphor", + "intarget": "swap", + "outtarget": "minecraft:main", + "auxtargets": [ + { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ + { + "name": "Phosphor", + "values": [ 0.4, 0.4, 0.4 ] + } + ] + }, + { + "name": "blit", + "intarget": "minecraft:main", + "outtarget": "previous" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/outline.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/outline.json new file mode 100644 index 0000000..53c8ee8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/outline.json @@ -0,0 +1,18 @@ +{ + "targets": [ + "swap", + "final" + ], + "passes": [ + { + "name": "outline", + "intarget": "final", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "final" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/pencil.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/pencil.json new file mode 100644 index 0000000..1fc5b13 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/pencil.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "outline_soft", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/phosphor.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/phosphor.json new file mode 100644 index 0000000..0fa09c4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/phosphor.json @@ -0,0 +1,35 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ + { + "name": "phosphor", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ + { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ + { + "name": "Phosphor", + "values": [ 0.95, 0.95, 0.95 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/scan_pincushion.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/scan_pincushion.json new file mode 100644 index 0000000..b5d0a3e --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/scan_pincushion.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/sobel.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/sobel.json new file mode 100644 index 0000000..5c390a4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/sobel.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "sobel", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/spider.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/spider.json new file mode 100644 index 0000000..5f203c1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/spider.json @@ -0,0 +1,230 @@ +{ + "targets": [ + "largeBlur", + "smallBlur", + "temp", + "swap" + ], + "passes": [ + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "temp", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 15.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "temp", + "outtarget": "largeBlur", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 15.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "temp", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 7.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "temp", + "outtarget": "smallBlur", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 7.0 ] + } + ] + }, + { + "name": "spider", + "intarget": "minecraft:main", + "outtarget": "temp", + "auxtargets": [ + { + "name": "BlurSampler", + "id": "largeBlur" + } + ], + "uniforms": [ + { + "name": "InScale", + "values": [ 1.25, 2.0 ] + }, + { + "name": "InOffset", + "values": [ -0.125, -0.1 ] + }, + { + "name": "Scissor", + "values": [ 0.0, 0.0, 1.0, 1.0 ] + }, + { + "name": "Vignette", + "values": [ 0.1, 0.1, 0.9, 0.9 ] + } + ] + }, + { + "name": "spider", + "intarget": "smallBlur", + "outtarget": "swap", + "auxtargets": [ + { + "name": "BlurSampler", + "id": "temp" + } + ], + "uniforms": [ + { + "name": "InScale", + "values": [ 2.35, 4.2 ] + }, + { + "name": "InOffset", + "values": [ -1.1, -1.5 ] + }, + { + "name": "InRotation", + "values": [ -45.0 ] + }, + { + "name": "Scissor", + "values": [ 0.21, 0.0, 0.79, 1.0 ] + }, + { + "name": "Vignette", + "values": [ 0.31, 0.1, 0.69, 0.9 ] + } + ] + }, + { + "name": "spider", + "intarget": "smallBlur", + "outtarget": "temp", + "auxtargets": [ + { + "name": "BlurSampler", + "id": "swap" + } + ], + "uniforms": [ + { + "name": "InScale", + "values": [ 2.35, 4.2 ] + }, + { + "name": "InOffset", + "values": [ 0.45, -4.45 ] + }, + { + "name": "InRotation", + "values": [ 45.0 ] + }, + { + "name": "Scissor", + "values": [ 0.21, 0.0, 0.79, 1.0 ] + }, + { + "name": "Vignette", + "values": [ 0.31, 0.1, 0.69, 0.9 ] + } + ] + }, + { + "name": "spider", + "intarget": "smallBlur", + "outtarget": "swap", + "auxtargets": [ + { + "name": "BlurSampler", + "id": "temp" + } + ], + "uniforms": [ + { + "name": "InScale", + "values": [ 2.35, 2.35 ] + }, + { + "name": "InOffset", + "values": [ -0.385, -1.29 ] + }, + { + "name": "InRotation", + "values": [ 0.0 ] + }, + { + "name": "Vignette", + "values": [ 0.31, 0.1, 0.69, 0.9 ] + } + ] + }, + { + "name": "spider", + "intarget": "smallBlur", + "outtarget": "temp", + "auxtargets": [ + { + "name": "BlurSampler", + "id": "swap" + } + ], + "uniforms": [ + { + "name": "InScale", + "values": [ 2.35, 2.35 ] + }, + { + "name": "InOffset", + "values": [ -0.965, -1.29 ] + }, + { + "name": "Vignette", + "values": [ 0.31, 0.1, 0.69, 0.9 ] + } + ] + }, + { + "name": "blit", + "intarget": "temp", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "ColorModulate", + "values": [ 1.0, 0.8, 0.8, 1.0 ] + } + ] + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/wobble.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/wobble.json new file mode 100644 index 0000000..1fc4534 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/post/wobble.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "wobble", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/animblur.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/animblur.fsh new file mode 100644 index 0000000..d81076c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/animblur.fsh @@ -0,0 +1,29 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec2 BlurDir; +uniform float Radius; +uniform float Progress; + +void main() { + vec4 blurred = vec4(0.0); + float totalStrength = 0.0; + float totalAlpha = 0.0; + float totalSamples = 0.0; + float progRadius = floor(Radius * Progress); + for(float r = -progRadius; r <= progRadius; r += 1.0) { + vec4 sample = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir); + totalAlpha = totalAlpha + sample.a; + totalSamples = totalSamples + 1.0; + float strength = 1.0 - abs(r / progRadius); + totalStrength = totalStrength + strength; + blurred = blurred + sample; + } + gl_FragColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), totalAlpha); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/animblur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/animblur.json new file mode 100644 index 0000000..cce7fed --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/animblur.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "animblur", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] }, { "name": "Progress", "type": "float", "count": 1, "values": [ 0.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/antialias.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/antialias.fsh new file mode 100644 index 0000000..2d92195 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/antialias.fsh @@ -0,0 +1,29 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D (DiffuseSampler, texCoord); + vec4 u1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y )); + vec4 u2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y * 2.0)); + vec4 d1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y )); + vec4 d2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y * 2.0)); + vec4 l1 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x, 0.0)); + vec4 l2 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x * 2.0, 0.0)); + vec4 r1 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x, 0.0)); + vec4 r2 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x * 2.0, 0.0)); + + vec4 v1 = mix (c, mix (l1, l2, 0.667), 0.75); + vec4 v2 = mix (c, mix (r1, r2, 0.667), 0.75); + vec4 v3 = mix (c, mix (u1, u2, 0.667), 0.75); + vec4 v4 = mix (c, mix (d1, d2, 0.667), 0.75); + + vec4 v5 = mix (v1, v2, 0.5); + vec4 v6 = mix (v3, v4, 0.5); + + vec4 color = mix (v5, v6, 0.5); + gl_FragColor = vec4(color.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/antialias.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/antialias.json new file mode 100644 index 0000000..6916fd9 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/antialias.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "antialias", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bits.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bits.fsh new file mode 100644 index 0000000..c252b30 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bits.fsh @@ -0,0 +1,27 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Resolution = 4.0; +uniform float Saturation = 1.5; +uniform float MosaicSize = 8.0; + +void main() { + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + + vec3 fractTexel = baseTexel.rgb - fract(baseTexel.rgb * Resolution) / Resolution; + float luma = dot(fractTexel, vec3(0.3, 0.59, 0.11)); + vec3 chroma = (fractTexel - luma) * Saturation; + baseTexel.rgb = luma + chroma; + baseTexel.a = 1.0; + + gl_FragColor = baseTexel; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bits.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bits.json new file mode 100644 index 0000000..c19239b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bits.json @@ -0,0 +1,21 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "bits", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Resolution", "type": "float", "count": 1, "values": [ 4.0 ] }, + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.5 ] }, + { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 8.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.fsh new file mode 100644 index 0000000..75d662a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.fsh @@ -0,0 +1,11 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +uniform vec4 ColorModulate; + +varying vec2 texCoord; + +void main(){ + gl_FragColor = texture2D(DiffuseSampler, texCoord) * ColorModulate; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.json new file mode 100644 index 0000000..1256b6b --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "srcalpha", + "dstrgb": "1-srcalpha" + }, + "vertex": "blit", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ColorModulate", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.vsh new file mode 100644 index 0000000..01a16db --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blit.vsh @@ -0,0 +1,16 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.fsh new file mode 100644 index 0000000..ddb8c75 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.fsh @@ -0,0 +1,43 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 v1 = min(l, r); + vec4 v2 = min(u, d); + vec4 v3 = min(v1, v2); + + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 dr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 dl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + + vec4 v4 = min(ul, dr); + vec4 v5 = min(ur, dl); + vec4 v6 = min(v4, v5); + + vec4 v7 = min(v3, v6); + + vec4 uu = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y * 2.0)); + vec4 dd = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y * 2.0)); + vec4 ll = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x * 2.0, 0.0)); + vec4 rr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x * 2.0, 0.0)); + + vec4 v8 = min(uu, dd); + vec4 v9 = min(ll, rr); + vec4 v10 = min(v8, v9); + + vec4 v11 = min(v7, v10); + + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 color = min(c, v11); + gl_FragColor = vec4(color.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.json new file mode 100644 index 0000000..6a5f245 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs2.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs2.fsh new file mode 100644 index 0000000..fc68fb2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs2.fsh @@ -0,0 +1,30 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float Radius; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 maxVal = c; + for(float u = 0.0; u <= Radius; u += 1.0) { + for(float v = 0.0; v <= Radius; v += 1.0) { + float weight = (((sqrt(u * u + v * v) / (Radius)) > 1.0) ? 0.0 : 1.0); + + vec4 s0 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, -v * oneTexel.y)); + vec4 s1 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, v * oneTexel.y)); + vec4 s2 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, v * oneTexel.y)); + vec4 s3 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, -v * oneTexel.y)); + + vec4 o0 = max(s0, s1); + vec4 o1 = max(s2, s3); + vec4 tempMax = max(o0, o1); + maxVal = mix(maxVal, max(maxVal, tempMax), weight); + } + } + + gl_FragColor = vec4(maxVal.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs2.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs2.json new file mode 100644 index 0000000..6df4594 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blobs2.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs2", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Radius", "type": "float", "count": 1, "values": [ 7.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blur.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blur.fsh new file mode 100644 index 0000000..e35dedd --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blur.fsh @@ -0,0 +1,31 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec2 BlurDir; +uniform float Radius; + +void main() { + vec4 blurred = vec4(0.0); + float totalStrength = 0.0; + float totalAlpha = 0.0; + float totalSamples = 0.0; + for(float r = -Radius; r <= Radius; r += 1.0) { + vec4 sample = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir); + + // Accumulate average alpha + totalAlpha = totalAlpha + sample.a; + totalSamples = totalSamples + 1.0; + + // Accumulate smoothed blur + float strength = 1.0 - abs(r / Radius); + totalStrength = totalStrength + strength; + blurred = blurred + sample; + } + gl_FragColor = vec4(blurred.rgb / (Radius * 2.0 + 1.0), totalAlpha); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blur.json new file mode 100644 index 0000000..51a2323 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/blur.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "blur", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.fsh new file mode 100644 index 0000000..cce2e3a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.fsh @@ -0,0 +1,34 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 nc = normalize(c); + vec4 nu = normalize(u); + vec4 nd = normalize(d); + vec4 nl = normalize(l); + vec4 nr = normalize(r); + + float du = dot(nc, nu); + float dd = dot(nc, nd); + float dl = dot(nc, nl); + float dr = dot(nc, nr); + + float i = 64.0; + + float f = 1.0; + f += (du * i) - (dd * i); + f += (dr * i) - (dl * i); + + vec4 color = c * clamp(f, 0.5, 2); + gl_FragColor = vec4(color.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.json new file mode 100644 index 0000000..59cae19 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "bumpy", + "fragment": "bumpy", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/bumpy.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/color_convolve.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/color_convolve.fsh new file mode 100644 index 0000000..61e43e2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/color_convolve.fsh @@ -0,0 +1,36 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Gray = vec3(0.3, 0.59, 0.11); +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); +uniform vec3 Offset = vec3(0.0, 0.0, 0.0); +uniform vec3 ColorScale = vec3(1.0, 1.0, 1.0); +uniform float Saturation = 1.8; + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + // Color Matrix + float RedValue = dot(InTexel.rgb, RedMatrix); + float GreenValue = dot(InTexel.rgb, GreenMatrix); + float BlueValue = dot(InTexel.rgb, BlueMatrix); + vec3 OutColor = vec3(RedValue, GreenValue, BlueValue); + + // Offset & Scale + OutColor = (OutColor * ColorScale) + Offset; + + // Saturation + float Luma = dot(OutColor, Gray); + vec3 Chroma = OutColor - Luma; + OutColor = (Chroma * Saturation) + Luma; + + gl_FragColor = vec4(OutColor, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/color_convolve.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/color_convolve.json new file mode 100644 index 0000000..e3a32c2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/color_convolve.json @@ -0,0 +1,25 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "color_convolve", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Gray", "type": "float", "count": 3, "values": [ 0.3, 0.59, 0.11 ] }, + { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, + { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 0.0 ] }, + { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] }, + { "name": "Offset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] }, + { "name": "ColorScale", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.8 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/deconverge.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/deconverge.fsh new file mode 100644 index 0000000..26ef8ca --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/deconverge.fsh @@ -0,0 +1,28 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 ConvergeX = vec3(-1.0, 0.0, 0.5); +uniform vec3 ConvergeY = vec3( 0.0, -1.0, 0.5); +uniform vec3 RadialConvergeX = vec3(1.0, 1.0, 1.0); +uniform vec3 RadialConvergeY = vec3(1.0, 1.0, 1.0); + +void main() { + vec3 CoordX = texCoord.x * RadialConvergeX; + vec3 CoordY = texCoord.y * RadialConvergeY; + + CoordX += ConvergeX * oneTexel.x - (RadialConvergeX - 1.0) * 0.5; + CoordY += ConvergeY * oneTexel.y - (RadialConvergeY - 1.0) * 0.5; + + float RedValue = texture2D(DiffuseSampler, vec2(CoordX.x, CoordY.x)).r; + float GreenValue = texture2D(DiffuseSampler, vec2(CoordX.y, CoordY.y)).g; + float BlueValue = texture2D(DiffuseSampler, vec2(CoordX.z, CoordY.z)).b; + float AlphaValue = texture2D(DiffuseSampler, texCoord).a; + + gl_FragColor = vec4(RedValue, GreenValue, BlueValue, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/deconverge.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/deconverge.json new file mode 100644 index 0000000..e23e9c5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/deconverge.json @@ -0,0 +1,22 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "deconverge", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ConvergeX", "type": "float", "count": 3, "values": [ -4.0, 0.0, 2.0 ] }, + { "name": "ConvergeY", "type": "float", "count": 3, "values": [ 0.0, -4.0, 2.0 ] }, + { "name": "RadialConvergeX", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, + { "name": "RadialConvergeY", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.fsh new file mode 100644 index 0000000..3973433 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.fsh @@ -0,0 +1,17 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +void main() { + vec3 Texel0 = texture2D(DiffuseSampler, texCoord).rgb; + vec3 Texel1 = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)).rgb; + vec3 Texel2 = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)).rgb; + vec3 Texel3 = texture2D(DiffuseSampler, texCoord + oneTexel).rgb; + + gl_FragColor = vec4((Texel0 + Texel1 + Texel2 + Texel3) * 0.25, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.json new file mode 100644 index 0000000..9099ec1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "downscale", + "fragment": "downscale", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.vsh new file mode 100644 index 0000000..ec09759 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/downscale.vsh @@ -0,0 +1,19 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/entity_outline.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/entity_outline.json new file mode 100644 index 0000000..d7c7763 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/entity_outline.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "srcalpha", + "dstrgb": "1-srcalpha" + }, + "vertex": "sobel", + "fragment": "entity_sobel", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/entity_sobel.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/entity_sobel.fsh new file mode 100644 index 0000000..139c705 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/entity_sobel.fsh @@ -0,0 +1,21 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 left = texture2D(DiffuseSampler, texCoord - vec2(oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)); + vec4 up = texture2D(DiffuseSampler, texCoord - vec2(0.0, oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)); + float leftDiff = abs(center.a - left.a); + float rightDiff = abs(center.a - right.a); + float upDiff = abs(center.a - up.a); + float downDiff = abs(center.a - down.a); + float total = clamp(leftDiff + rightDiff + upDiff + downDiff, 0.0, 1.0); + vec3 outColor = center.rgb * center.a + left.rgb * left.a + right.rgb * right.a + up.rgb * up.a + down.rgb * down.a; + gl_FragColor = vec4(outColor * 0.2, total); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/flip.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/flip.json new file mode 100644 index 0000000..b9c78f4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/flip.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "flip", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ScreenSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ColorModulate", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/flip.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/flip.vsh new file mode 100644 index 0000000..bd0a4d3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/flip.vsh @@ -0,0 +1,22 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; +uniform vec2 ScreenSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 inOutRatio = OutSize / InSize; + vec2 inScreenRatio = ScreenSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * inOutRatio.x; + texCoord.y = texCoord.y * inOutRatio.y; + texCoord.y -= 1.0 - inScreenRatio.y; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.fsh new file mode 100644 index 0000000..3dbcfd4 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.fsh @@ -0,0 +1,84 @@ +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +uniform float VxOffset; +uniform float SpanMax; +uniform float ReduceMul; + +varying vec2 texCoord; +varying vec4 posPos; + +#define FxaaTex(t, p) texture2D(t, p) + +#if __VERSION__ >= 130 + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) textureOffset(t, p, o) +#elif defined(GL_EXT_gpu_shader4) + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) +#else + #define OffsetVec(a, b) vec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2D(t, p + o * r) +#endif + +vec3 FxaaPixelShader( + vec4 posPos, // Output of FxaaVertexShader interpolated across screen. + sampler2D tex, // Input texture. + vec2 rcpFrame) // Constant {1.0/frameWidth, 1.0/frameHeight}. +{ + + #define FXAA_REDUCE_MIN (1.0/128.0) + //#define FXAA_REDUCE_MUL (1.0/8.0) + //#define FXAA_SPAN_MAX 8.0 + + vec3 rgbNW = FxaaTex(tex, posPos.zw).xyz; + vec3 rgbNE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,0), rcpFrame.xy).xyz; + vec3 rgbSW = FxaaTexOff(tex, posPos.zw, OffsetVec(0,1), rcpFrame.xy).xyz; + vec3 rgbSE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,1), rcpFrame.xy).xyz; + + vec3 rgbM = FxaaTex(tex, posPos.xy).xyz; + + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max( + (lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * ReduceMul), + FXAA_REDUCE_MIN); + float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce); + dir = min(vec2( SpanMax, SpanMax), + max(vec2(-SpanMax, -SpanMax), + dir * rcpDirMin)) * rcpFrame.xy; + + vec3 rgbA = (1.0/2.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(1.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(2.0/3.0 - 0.5)).xyz); + vec3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(0.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(3.0/3.0 - 0.5)).xyz); + + float lumaB = dot(rgbB, luma); + + if ((lumaB < lumaMin) || (lumaB > lumaMax)) { + return rgbA; + } else { + return rgbB; + } +} + +void main() { + vec4 baseTexel = texture2D(DiffuseSampler, posPos.xy); + gl_FragColor = vec4(FxaaPixelShader(posPos, DiffuseSampler, 1.0 / OutSize), 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.json new file mode 100644 index 0000000..eb85073 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa", + "fragment": "fxaa", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "SpanMax", "type": "float", "count": 1, "values": [ 8.0 ] }, + { "name": "SubPixelShift", "type": "float", "count": 1, "values": [ 0.25 ] }, + { "name": "ReduceMul", "type": "float", "count": 1, "values": [ 0.125 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.vsh new file mode 100644 index 0000000..9fe81ea --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa.vsh @@ -0,0 +1,21 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +uniform float SubPixelShift; + +varying vec2 texCoord; +varying vec4 posPos; + +void main() { + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; + posPos.xy = texCoord.xy; + posPos.zw = texCoord.xy - (1.0/OutSize * vec2(0.5 + SubPixelShift)); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.fsh new file mode 100644 index 0000000..bf66deb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.fsh @@ -0,0 +1,85 @@ +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +uniform float VxOffset; +uniform float SpanMax; +uniform float ReduceMul; + +varying vec2 texCoord; +varying vec4 posPos; + +#define FxaaTex(t, p) texture2D(t, p) + +#if __VERSION__ >= 130 + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) textureOffset(t, p, o) +#elif defined(GL_EXT_gpu_shader4) + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) +#else + #define OffsetVec(a, b) vec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2D(t, p + o * r) +#endif + +vec3 FxaaPixelShader( + vec4 posPos, // Output of FxaaVertexShader interpolated across screen. + sampler2D tex, // Input texture. + vec2 rcpFrame) // Constant {1.0/frameWidth, 1.0/frameHeight}. +{ + + #define FXAA_REDUCE_MIN (1.0/128.0) + //#define FXAA_REDUCE_MUL (1.0/8.0) + //#define FXAA_SPAN_MAX 8.0 + + vec3 rgbNW = FxaaTex(tex, posPos.zw).xyz; + vec3 rgbNE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,0), rcpFrame.xy).xyz; + vec3 rgbSW = FxaaTexOff(tex, posPos.zw, OffsetVec(0,1), rcpFrame.xy).xyz; + vec3 rgbSE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,1), rcpFrame.xy).xyz; + + vec3 rgbM = FxaaTex(tex, posPos.xy).xyz; + + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * ReduceMul), FXAA_REDUCE_MIN); + + float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce); + + dir = min(vec2( SpanMax, SpanMax), max(vec2(-SpanMax, -SpanMax), dir * rcpDirMin)) * rcpFrame.xy; + + vec3 rgbA = (1.0/2.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(1.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(2.0/3.0 - 0.5)).xyz); + + vec3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(0.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(3.0/3.0 - 0.5)).xyz); + + float lumaB = dot(rgbB, luma); + + if ((lumaB < lumaMin) || (lumaB > lumaMax)) + { + return rgbA; + } + // + return rgbB; +} + +void main() +{ + vec4 baseTexel = texture2D(DiffuseSampler, posPos.xy); + gl_FragColor = vec4(FxaaPixelShader(posPos, DiffuseSampler, 1.0 / OutSize), 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.json new file mode 100644 index 0000000..f4fa6fc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa_of_2x", + "fragment": "fxaa_of_2x", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "SpanMax", "type": "float", "count": 1, "values": [ 8.0 ] }, + { "name": "SubPixelShift", "type": "float", "count": 1, "values": [ 0.25 ] }, + { "name": "ReduceMul", "type": "float", "count": 1, "values": [ 0.125 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.vsh new file mode 100644 index 0000000..63a9383 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.vsh @@ -0,0 +1,23 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +uniform float SubPixelShift; + +varying vec2 texCoord; +varying vec4 posPos; + +void main() +{ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; + + posPos.xy = texCoord.xy + (0.5/OutSize * vec2(0.5 - SubPixelShift)); + posPos.zw = texCoord.xy - (0.5/OutSize * vec2(0.5 + SubPixelShift)); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.fsh new file mode 100644 index 0000000..3fc15ae --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.fsh @@ -0,0 +1,255 @@ +#version 120 + +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +varying vec2 texCoord; + +//#define FXAA_GREEN_AS_LUMA 1 +//#define FXAA_DISCARD 1 + +#ifndef FXAA_GREEN_AS_LUMA + // For those using non-linear color, + // and either not able to get luma in alpha, or not wanting to, + // this enables FXAA to run using green as a proxy for luma. + // So with this enabled, no need to pack luma in alpha. + // + // This will turn off AA on anything which lacks some amount of green. + // Pure red and blue or combination of only R and B, will get no AA. + // + // Might want to lower the settings for both, + // fxaaConsoleEdgeThresholdMin + // fxaaQualityEdgeThresholdMin + // In order to insure AA does not get turned off on colors + // which contain a minor amount of green. + // + // 1 = On. + // 0 = Off. + // + #define FXAA_GREEN_AS_LUMA 0 +#endif + +#ifndef FXAA_DISCARD + // 1 = Use discard on pixels which don't need AA. + // 0 = Return unchanged color on pixels which don't need AA. + #define FXAA_DISCARD 0 +#endif + +/*============================================================================ + API PORTING +============================================================================*/ + #define FxaaBool bool + #define FxaaDiscard discard + #define FxaaFloat float + #define FxaaFloat2 vec2 + #define FxaaFloat3 vec3 + #define FxaaFloat4 vec4 + #define FxaaHalf float + #define FxaaHalf2 vec2 + #define FxaaHalf3 vec3 + #define FxaaHalf4 vec4 + #define FxaaInt2 ivec2 + #define FxaaSat(x) clamp(x, 0.0, 1.0) + #define FxaaTex sampler2D +/*--------------------------------------------------------------------------*/ + + #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) + +/*============================================================================ + GREEN AS LUMA OPTION SUPPORT FUNCTION +============================================================================*/ +#if (FXAA_GREEN_AS_LUMA == 0) + // TODO Luma + FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return dot(rgba.xyz, vec3(0.299, 0.587, 0.114)); } +#else + FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } +#endif + +/*============================================================================ + FXAA3 CONSOLE - PC VERSION +============================================================================*/ +/*--------------------------------------------------------------------------*/ +FxaaFloat4 FxaaPixelShader( + // See FXAA Quality FxaaPixelShader() source for docs on Inputs! + // + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy} = center of pixel + FxaaFloat2 pos, + // + // Used only for FXAA Console, and not used on the 360 version. + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy__} = upper left of pixel + // {__zw} = lower right of pixel + FxaaFloat4 fxaaConsolePosPos, + // + // Input color texture. + // {rgb_} = color in linear or perceptual color space + // if (FXAA_GREEN_AS_LUMA == 0) + // {___a} = luma in perceptual color space (not linear) + FxaaTex tex, + // + // Only used on FXAA Console. + // This must be from a constant/uniform. + // This effects sub-pixel AA quality and inversely sharpness. + // Where N ranges between, + // N = 0.50 (default) + // N = 0.33 (sharper) + // {x___} = -N/screenWidthInPixels + // {_y__} = -N/screenHeightInPixels + // {__z_} = N/screenWidthInPixels + // {___w} = N/screenHeightInPixels + FxaaFloat4 fxaaConsoleRcpFrameOpt, + // + // Only used on FXAA Console. + // Not used on 360, but used on PS3 and PC. + // This must be from a constant/uniform. + // {x___} = -2.0/screenWidthInPixels + // {_y__} = -2.0/screenHeightInPixels + // {__z_} = 2.0/screenWidthInPixels + // {___w} = 2.0/screenHeightInPixels + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define. + // It is here now to allow easier tuning. + // This does not effect PS3, as this needs to be compiled in. + // Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3. + // Due to the PS3 being ALU bound, + // there are only three safe values here: 2 and 4 and 8. + // These options use the shaders ability to a free *|/ by 2|4|8. + // For all other platforms can be a non-power of two. + // 8.0 is sharper (default!!!) + // 4.0 is softer + // 2.0 is really soft (good only for vector graphics inputs) + FxaaFloat fxaaConsoleEdgeSharpness, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define. + // It is here now to allow easier tuning. + // This does not effect PS3, as this needs to be compiled in. + // Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3. + // Due to the PS3 being ALU bound, + // there are only two safe values here: 1/4 and 1/8. + // These options use the shaders ability to a free *|/ by 2|4|8. + // The console setting has a different mapping than the quality setting. + // Other platforms can use other values. + // 0.125 leaves less aliasing, but is softer (default!!!) + // 0.25 leaves more aliasing, and is sharper + FxaaFloat fxaaConsoleEdgeThreshold, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define. + // It is here now to allow easier tuning. + // Trims the algorithm from processing darks. + // The console setting has a different mapping than the quality setting. + // This does not apply to PS3, + // PS3 was simplified to avoid more shader instructions. + // 0.06 - faster but more aliasing in darks + // 0.05 - default + // 0.04 - slower and less aliasing in darks + // Special notes when using FXAA_GREEN_AS_LUMA, + // Likely want to set this to zero. + // As colors that are mostly not-green + // will appear very dark in the green channel! + // Tune by looking at mostly non-green content, + // then start at zero and increase until aliasing is a problem. + FxaaFloat fxaaConsoleEdgeThresholdMin +) { +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy)); + FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw)); + FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy)); + FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw)); +/*--------------------------------------------------------------------------*/ + FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy); + #if (FXAA_GREEN_AS_LUMA == 0) + // TODO Luma + FxaaFloat lumaM = FxaaLuma(rgbyM); + #else + FxaaFloat lumaM = rgbyM.y; + #endif +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw); + lumaNe += 1.0/384.0; + FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe); + FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw); + FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMinM = min(lumaMin, lumaM); + FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled); + FxaaFloat lumaMaxM = max(lumaMax, lumaM); + FxaaFloat dirSwMinusNe = lumaSw - lumaNe; + FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM; + FxaaFloat dirSeMinusNw = lumaSe - lumaNw; + if(lumaMaxSubMinM < lumaMaxScaledClamped) + { + #if (FXAA_DISCARD == 1) + FxaaDiscard; + #else + return rgbyM; + #endif + } +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir; + dir.x = dirSwMinusNe + dirSeMinusNw; + dir.y = dirSwMinusNe - dirSeMinusNw; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir1 = normalize(dir.xy); + FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw); + FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw); +/*--------------------------------------------------------------------------*/ + FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness; + FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0); +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir2x = dir2 * fxaaConsoleRcpFrameOpt2.zw; + FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2x); + FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2x); +/*--------------------------------------------------------------------------*/ + FxaaFloat4 rgbyA = rgbyN1 + rgbyP1; + FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25); +/*--------------------------------------------------------------------------*/ + #if (FXAA_GREEN_AS_LUMA == 0) + // TODO Luma + float lumaB = FxaaLuma(rgbyB); + #else + float lumaB = rgbyB.y; + #endif + if((lumaB < lumaMin) || (lumaB > lumaMax)) + rgbyB.xyz = rgbyA.xyz * 0.5; + // + return rgbyB; +} +/*==========================================================================*/ + +void main() +{ + // PosPos {xy__} = upper left of pixel, {__zw} = lower right of pixel + vec4 posPos; + posPos.xy = texCoord - (0.6 / OutSize); + posPos.zw = texCoord + (0.6 / OutSize); + // rcpFrameOpt: N = 0.50 (default), N = 0.33 (sharper) + vec4 rcpFrameOpt; + rcpFrameOpt.xy = vec2(-0.50, -0.50) / OutSize; + rcpFrameOpt.zw = vec2( 0.50, 0.50) / OutSize; + // rcpFrameOpt2: N = 2; + vec4 rcpFrameOpt2; + rcpFrameOpt2.xy = vec2(-2.0, -2.0) / OutSize; + rcpFrameOpt2.zw = vec2( 2.0, 2.0) / OutSize; + // Edge sharpness: 8.0 (sharp, default) - 2.0 (soft) + float edgeSharpness = 8.0; + // Edge threshold: 0.125 (softer, def) - 0.25 (sharper) + float edgeThreshold = 0.125; + // 0.06 (faster, dark alias), 0.05 (def), 0.04 (slower, less dark alias) + float edgeThresholdMin = 0.05; + // + vec4 fxaaCol = FxaaPixelShader(texCoord, posPos, DiffuseSampler, rcpFrameOpt, rcpFrameOpt2, edgeSharpness, edgeThreshold, edgeThresholdMin); + gl_FragColor = vec4(fxaaCol.xyz, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.json new file mode 100644 index 0000000..e783a0f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.json @@ -0,0 +1,17 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa_of_4x", + "fragment": "fxaa_of_4x", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.vsh new file mode 100644 index 0000000..b266005 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main() +{ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.fsh new file mode 100644 index 0000000..9336515 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.fsh @@ -0,0 +1,14 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; + +uniform float InverseAmount; + +void main(){ + vec4 diffuseColor = texture2D(DiffuseSampler, texCoord); + vec4 invertColor = 1.0 - diffuseColor; + vec4 outColor = mix(diffuseColor, invertColor, InverseAmount); + gl_FragColor = vec4(outColor.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.json new file mode 100644 index 0000000..f9ab649 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "invert", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "InverseAmount", "type": "float", "count": 1, "values": [ 0.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.vsh new file mode 100644 index 0000000..5110ef5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/invert.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 sizeRatio = OutSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * sizeRatio.x; + texCoord.y = texCoord.y * sizeRatio.y; + texCoord.y = sizeRatio.y - texCoord.y; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.fsh new file mode 100644 index 0000000..86990eb --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.fsh @@ -0,0 +1,24 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D PrevSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Phosphor = vec3(0.7, 0.0, 0.0); +uniform float LerpFactor = 1.0; + +void main() { + vec4 CurrTexel = texture2D(DiffuseSampler, texCoord); + vec4 PrevTexel = texture2D(PrevSampler, texCoord); + float factor = Phosphor.r; + + if (Phosphor.g == 1) { + gl_FragColor = vec4(max(PrevTexel.rgb * vec3(factor), CurrTexel.rgb), 1.0); + } else { + gl_FragColor = vec4(mix(PrevTexel.rgb, CurrTexel.rgb, factor), 1.0); + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.json new file mode 100644 index 0000000..d18f1c7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "lunar_motionblur", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" }, { "name": "PrevSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/notch.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/notch.fsh new file mode 100644 index 0000000..c1293b1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/notch.fsh @@ -0,0 +1,23 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DitherSampler; + +varying vec2 texCoord; + +uniform vec2 InSize; + +void main() { + vec2 halfSize = InSize * 0.5; + + vec2 steppedCoord = texCoord; + steppedCoord.x = float(int(steppedCoord.x*halfSize.x)) / halfSize.x; + steppedCoord.y = float(int(steppedCoord.y*halfSize.y)) / halfSize.y; + + vec4 noise = texture2D(DitherSampler, steppedCoord * halfSize / 4.0); + vec4 col = texture2D(DiffuseSampler, steppedCoord) + noise * vec4(1.0/12.0, 1.0/12.0, 1.0/6.0, 1.0); + float r = float(int(col.r*8.0))/8.0; + float g = float(int(col.g*8.0))/8.0; + float b = float(int(col.b*4.0))/4.0; + gl_FragColor = vec4(r, g, b, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/notch.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/notch.json new file mode 100644 index 0000000..e6ff9a8 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/notch.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "notch", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "DitherSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.fsh new file mode 100644 index 0000000..389326f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.fsh @@ -0,0 +1,132 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D BaseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 One = vec4(1.0); + +const float Pi = 3.1415926535; +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float NotchWidth = 2.0; +const float NotchUpperFrequency = 3.59754545 + NotchWidth; +const float NotchLowerFrequency = 3.59754545 - NotchWidth; +const float YFrequency = 6.0; +const float IFrequency = 1.2; +const float QFrequency = 0.6; +const float ScanTime = 52.6; +const vec3 YIQ2R = vec3(1.0, 0.956, 0.621); +const vec3 YIQ2G = vec3(1.0, -0.272, -0.647); +const vec3 YIQ2B = vec3(1.0, -1.106, 1.703); +const vec4 MinC = vec4(-1.1183); +const vec4 CRange = vec4(3.2366); +const float Pi2Length = Pi2 / 83.0; +const vec4 NotchOffset = vec4(0.0, 1.0, 2.0, 3.0); +const vec4 W = vec4(Pi2 * CCFrequency * ScanTime); + +void main() { + vec4 YAccum = Zero; + vec4 IAccum = Zero; + vec4 QAccum = Zero; + float QuadXSize = InSize.x * 4.0; + float TimePerSample = ScanTime / QuadXSize; + + // Frequency cutoffs for the individual portions of the signal that we extract. + // Y1 and Y2 are the positive and negative frequency limits of the notch filter on Y. + // Y3 is the center of the frequency response of the Y filter. + // I is the center of the frequency response of the I filter. + // Q is the center of the frequency response of the Q filter. + float Fc_y1 = NotchLowerFrequency * TimePerSample; + float Fc_y2 = NotchUpperFrequency * TimePerSample; + float Fc_y3 = YFrequency * TimePerSample; + float Fc_i = IFrequency * TimePerSample; + float Fc_q = QFrequency * TimePerSample; + float Pi2Fc_y1 = Fc_y1 * Pi2; + float Pi2Fc_y2 = Fc_y2 * Pi2; + float Pi2Fc_y3 = Fc_y3 * Pi2; + float Pi2Fc_i = Fc_i * Pi2; + float Pi2Fc_q = Fc_q * Pi2; + float Fc_y1_2 = Fc_y1 * 2.0; + float Fc_y2_2 = Fc_y2 * 2.0; + float Fc_y3_2 = Fc_y3 * 2.0; + float Fc_i_2 = Fc_i * 2.0; + float Fc_q_2 = Fc_q * 2.0; + vec4 CoordY = vec4(texCoord.y); + + vec4 BaseTexel = texture2D(DiffuseSampler, texCoord); + // 83 composite samples wide, 4 composite pixels per texel + for (float n = -41.0; n < 42.0; n += 4.0) + { + vec4 n4 = n + NotchOffset; + vec4 CoordX = texCoord.x + oneTexel.x * n4 * 0.25; + vec2 TexCoord = vec2(CoordX.x, CoordY.y); + vec4 C = texture2D(DiffuseSampler, TexCoord) * CRange + MinC; + vec4 WT = W * (CoordX + A2 * CoordY * InSize.y + B); + vec4 Cosine = 0.54 + 0.46 * cos(Pi2Length * n4); + + vec4 SincYIn1 = Pi2Fc_y1 * n4; + vec4 SincYIn2 = Pi2Fc_y2 * n4; + vec4 SincYIn3 = Pi2Fc_y3 * n4; + vec4 SincY1 = sin(SincYIn1) / SincYIn1; + vec4 SincY2 = sin(SincYIn2) / SincYIn2; + vec4 SincY3 = sin(SincYIn3) / SincYIn3; + + // These zero-checks could be made more efficient, but we are trying to support + // downlevel GLSL + if(SincYIn1.x == 0.0) SincY1.x = 1.0; + if(SincYIn1.y == 0.0) SincY1.y = 1.0; + if(SincYIn1.z == 0.0) SincY1.z = 1.0; + if(SincYIn1.w == 0.0) SincY1.w = 1.0; + if(SincYIn2.x == 0.0) SincY2.x = 1.0; + if(SincYIn2.y == 0.0) SincY2.y = 1.0; + if(SincYIn2.z == 0.0) SincY2.z = 1.0; + if(SincYIn2.w == 0.0) SincY2.w = 1.0; + if(SincYIn3.x == 0.0) SincY3.x = 1.0; + if(SincYIn3.y == 0.0) SincY3.y = 1.0; + if(SincYIn3.z == 0.0) SincY3.z = 1.0; + if(SincYIn3.w == 0.0) SincY3.w = 1.0; + vec4 IdealY = (Fc_y1_2 * SincY1 - Fc_y2_2 * SincY2) + Fc_y3_2 * SincY3; + vec4 FilterY = Cosine * IdealY; + + vec4 SincIIn = Pi2Fc_i * n4; + vec4 SincI = sin(SincIIn) / SincIIn; + if(SincIIn.x == 0.0) SincI.x = 1.0; + if(SincIIn.y == 0.0) SincI.y = 1.0; + if(SincIIn.z == 0.0) SincI.z = 1.0; + if(SincIIn.w == 0.0) SincI.w = 1.0; + vec4 IdealI = Fc_i_2 * SincI; + vec4 FilterI = Cosine * IdealI; + + vec4 SincQIn = Pi2Fc_q * n4; + vec4 SincQ = sin(SincQIn) / SincQIn; + if(SincQIn.x == 0.0) SincQ.x = 1.0; + if(SincQIn.y == 0.0) SincQ.y = 1.0; + if(SincQIn.z == 0.0) SincQ.z = 1.0; + if(SincQIn.w == 0.0) SincQ.w = 1.0; + vec4 IdealQ = Fc_q_2 * SincQ; + vec4 FilterQ = Cosine * IdealQ; + + YAccum += C * FilterY; + IAccum += C * cos(WT) * FilterI; + QAccum += C * sin(WT) * FilterQ; + } + + float Y = dot(YAccum, One); + float I = dot(IAccum, One) * 2.0; + float Q = dot(QAccum, One) * 2.0; + + vec3 YIQ = vec3(Y, I, Q); + vec3 OutRGB = vec3(dot(YIQ, YIQ2R), dot(YIQ, YIQ2G), dot(YIQ, YIQ2B)); + + gl_FragColor = vec4(OutRGB, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.json new file mode 100644 index 0000000..2870923 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_decode", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "BaseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.fsh new file mode 100644 index 0000000..450bc6d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.fsh @@ -0,0 +1,50 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float ScanTime = 52.6; +const float Pi2ScanTime = Pi2 * ScanTime; +const vec4 YTransform = vec4(0.299, 0.587, 0.114, 0.0); +const vec4 ITransform = vec4(0.595716, -0.274453, -0.321263, 0.0); +const vec4 QTransform = vec4(0.211456, -0.522591, 0.31135, 0.0); +const vec4 MinC = vec4(-1.1183); +const vec4 InvCRange = vec4(1.0 / 3.2366); + +void main() { + vec2 InverseP = vec2(P, 0.0) * oneTexel; + + // UVs for four linearly-interpolated samples spread 0.25 texels apart + vec2 C0 = texCoord; + vec2 C1 = texCoord + InverseP * 0.25; + vec2 C2 = texCoord + InverseP * 0.50; + vec2 C3 = texCoord + InverseP * 0.75; + vec4 Cx = vec4(C0.x, C1.x, C2.x, C3.x); + vec4 Cy = vec4(C0.y, C1.y, C2.y, C3.y); + + vec4 Texel0 = texture2D(DiffuseSampler, C0); + vec4 Texel1 = texture2D(DiffuseSampler, C1); + vec4 Texel2 = texture2D(DiffuseSampler, C2); + vec4 Texel3 = texture2D(DiffuseSampler, C3); + + // Calculate the expected time of the sample. + vec4 T = A2 * Cy * vec4(InSize.y) + B + Cx; + vec4 W = vec4(Pi2ScanTime * CCFrequency); + vec4 TW = T * W; + vec4 Y = vec4(dot(Texel0, YTransform), dot(Texel1, YTransform), dot(Texel2, YTransform), dot(Texel3, YTransform)); + vec4 I = vec4(dot(Texel0, ITransform), dot(Texel1, ITransform), dot(Texel2, ITransform), dot(Texel3, ITransform)); + vec4 Q = vec4(dot(Texel0, QTransform), dot(Texel1, QTransform), dot(Texel2, QTransform), dot(Texel3, QTransform)); + + vec4 Encoded = Y + I * cos(TW) + Q * sin(TW); + gl_FragColor = (Encoded - MinC) * InvCRange; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.json new file mode 100644 index 0000000..2cda4df --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_encode", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline.fsh new file mode 100644 index 0000000..5ef504d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline.fsh @@ -0,0 +1,21 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 uDiff = center - up; + vec4 dDiff = center - down; + vec4 lDiff = center - left; + vec4 rDiff = center - right; + vec4 sum = uDiff + dDiff + lDiff + rDiff; + vec3 clamped = clamp(center.rgb - sum.rgb, 0.0, 1.0); + gl_FragColor = vec4(clamped, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline.json new file mode 100644 index 0000000..7d41382 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_combine.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_combine.fsh new file mode 100644 index 0000000..3edb935 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_combine.fsh @@ -0,0 +1,13 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OutlineSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 diffuseTexel = texture2D(DiffuseSampler, texCoord); + vec4 outlineTexel = texture2D(OutlineSampler, texCoord); + gl_FragColor = vec4(diffuseTexel.rgb + diffuseTexel.rgb * outlineTexel.rgb * vec3(0.75), 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_combine.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_combine.json new file mode 100644 index 0000000..d52f4a3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_combine.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_combine", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "OutlineSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_soft.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_soft.fsh new file mode 100644 index 0000000..40536b5 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_soft.fsh @@ -0,0 +1,46 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; +uniform float LumaLevel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 uDiff = abs(center - up); + vec4 dDiff = abs(center - down); + vec4 lDiff = abs(center - left); + vec4 rDiff = abs(center - right); + vec4 u2Diff = abs(center - up2); + vec4 d2Diff = abs(center - down2); + vec4 l2Diff = abs(center - left2); + vec4 r2Diff = abs(center - right2); + vec4 sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff; + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float sumLuma = 1.0 - dot(clamp(sum, 0.0, 1.0), gray); + + // Get luminance of center pixel and adjust + float centerLuma = dot(center + (center - pow(center, vec4(LumaRamp))), gray); + + // Quantize the luma value + centerLuma = centerLuma - fract(centerLuma * LumaLevel) / LumaLevel; + + // Re-scale to full range + centerLuma = centerLuma * (LumaLevel / (LumaLevel - 1.0)); + + // Blend with outline + centerLuma = centerLuma * sumLuma; + + gl_FragColor = vec4(centerLuma, centerLuma, centerLuma, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_soft.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_soft.json new file mode 100644 index 0000000..c58bb5d --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_soft.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_soft", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] }, + { "name": "LumaLevel", "type": "float", "count": 1, "values": [ 4.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.fsh new file mode 100644 index 0000000..997e18a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.fsh @@ -0,0 +1,41 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + vec4 bl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 br = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float uDiff = dot(abs(center - up), gray); + float dDiff = dot(abs(center - down), gray); + float lDiff = dot(abs(center - left), gray); + float rDiff = dot(abs(center - right), gray); + float u2Diff = dot(abs(center - up2), gray); + float d2Diff = dot(abs(center - down2), gray); + float l2Diff = dot(abs(center - left2), gray); + float r2Diff = dot(abs(center - right2), gray); + float ulDiff = dot(abs(center - ul), gray); + float urDiff = dot(abs(center - ur), gray); + float blDiff = dot(abs(center - bl), gray); + float brDiff = dot(abs(center - br), gray); + float sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff + ulDiff + urDiff + blDiff + brDiff; + float sumLuma = clamp(sum, 0.0, 1.0); + + gl_FragColor = vec4(sumLuma, sumLuma, sumLuma, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.json new file mode 100644 index 0000000..2954352 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_watercolor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/overlay.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/overlay.fsh new file mode 100644 index 0000000..815279a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/overlay.fsh @@ -0,0 +1,27 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OverlaySampler; + +uniform vec2 InSize; + +varying vec2 texCoord; + +uniform float MosaicSize = 1.0; +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); + +void main(){ + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + float red = dot(baseTexel.rgb, RedMatrix); + float green = dot(baseTexel.rgb, GreenMatrix); + float blue = dot(baseTexel.rgb, BlueMatrix); + + vec4 overlayTexel = texture2D(OverlaySampler, vec2(texCoord.x, 1.0 - texCoord.y)); + overlayTexel.a = 1.0; + gl_FragColor = mix(vec4(red, green, blue, 1.0), overlayTexel, overlayTexel.a); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/overlay.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/overlay.json new file mode 100644 index 0000000..ceb8d0f --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/overlay.json @@ -0,0 +1,23 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "overlay", + "attributes": [ "Position" ], + "samplers": [ + { "name": "OverlaySampler" }, + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, + { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 1.0 ] }, + { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/phosphor.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/phosphor.fsh new file mode 100644 index 0000000..f86a270 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/phosphor.fsh @@ -0,0 +1,19 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D PrevSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Phosphor = vec3(0.7, 0.7, 0.7); +uniform float LerpFactor = 1.0; + +void main() { + vec4 CurrTexel = texture2D(DiffuseSampler, texCoord); + vec4 PrevTexel = texture2D(PrevSampler, texCoord); + + gl_FragColor = vec4(max(PrevTexel.rgb * Phosphor, CurrTexel.rgb), 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/phosphor.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/phosphor.json new file mode 100644 index 0000000..c3a01f2 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/phosphor.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "phosphor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "PrevSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/rotscale.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/rotscale.vsh new file mode 100644 index 0000000..81b03a1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/rotscale.vsh @@ -0,0 +1,31 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +uniform vec2 InScale; +uniform vec2 InOffset; +uniform float InRotation; +uniform float Time; + +varying vec2 texCoord; +varying vec2 scaledCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; + + float Deg2Rad = 0.0174532925; + float InRadians = InRotation * Deg2Rad; + float Cosine = cos(InRadians); + float Sine = sin(InRadians); + float RotU = texCoord.x * Cosine - texCoord.y * Sine; + float RotV = texCoord.y * Cosine + texCoord.x * Sine; + scaledCoord = vec2(RotU, RotV) * InScale + InOffset; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.fsh new file mode 100644 index 0000000..2aef0d7 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.fsh @@ -0,0 +1,64 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 Half = vec4(0.5); +const vec4 One = vec4(1.0); +const vec4 Two = vec4(2.0); + +const float Pi = 3.1415926535; +const float PincushionAmount = 0.02; +const float CurvatureAmount = 0.02; +const float ScanlineAmount = 0.8; +const float ScanlineScale = 1.0; +const float ScanlineHeight = 1.0; +const float ScanlineBrightScale = 1.0; +const float ScanlineBrightOffset = 0.0; +const float ScanlineOffset = 0.0; +const vec3 Floor = vec3(0.05, 0.05, 0.05); +const vec3 Power = vec3(0.8, 0.8, 0.8); + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + vec2 PinUnitCoord = texCoord * Two.xy - One.xy; + float PincushionR2 = pow(length(PinUnitCoord), 2.0); + vec2 PincushionCurve = PinUnitCoord * PincushionAmount * PincushionR2; + vec2 ScanCoord = texCoord; + + ScanCoord *= One.xy - PincushionAmount * 0.2; + ScanCoord += PincushionAmount * 0.1; + ScanCoord += PincushionCurve; + + vec2 CurvatureClipCurve = PinUnitCoord * CurvatureAmount * PincushionR2; + vec2 ScreenClipCoord = texCoord; + ScreenClipCoord -= Half.xy; + ScreenClipCoord *= One.xy - CurvatureAmount * 0.2; + ScreenClipCoord += Half.xy; + ScreenClipCoord += CurvatureClipCurve; + + // -- Alpha Clipping -- + if (ScanCoord.x < 0.0) discard; + if (ScanCoord.y < 0.0) discard; + if (ScanCoord.x > 1.0) discard; + if (ScanCoord.y > 1.0) discard; + + // -- Scanline Simulation -- + float InnerSine = ScanCoord.y * InSize.y * ScanlineScale * 0.25; + float ScanBrightMod = sin(InnerSine * Pi + ScanlineOffset * InSize.y * 0.25); + float ScanBrightness = mix(1.0, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0) * 0.5, ScanlineAmount); + vec3 ScanlineTexel = InTexel.rgb * ScanBrightness; + + // -- Color Compression (increasing the floor of the signal without affecting the ceiling) -- + ScanlineTexel = Floor + (One.xyz - Floor) * ScanlineTexel; + + ScanlineTexel.rgb = pow(ScanlineTexel.rgb, Power); + + gl_FragColor = vec4(ScanlineTexel.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.json new file mode 100644 index 0000000..9c7f9a3 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "scan_pincushion", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.fsh new file mode 100644 index 0000000..6ed6b14 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.fsh @@ -0,0 +1,20 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 left = texture2D(DiffuseSampler, texCoord - vec2(oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)); + vec4 up = texture2D(DiffuseSampler, texCoord - vec2(0.0, oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)); + vec4 leftDiff = center - left; + vec4 rightDiff = center - right; + vec4 upDiff = center - up; + vec4 downDiff = center - down; + vec4 total = clamp(leftDiff + rightDiff + upDiff + downDiff, 0.0, 1.0); + gl_FragColor = vec4(total.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.json new file mode 100644 index 0000000..dc2fc17 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "sobel", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.vsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.vsh new file mode 100644 index 0000000..21b1736 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/sobel.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/spider.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/spider.json new file mode 100644 index 0000000..3a47688 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/spider.json @@ -0,0 +1,25 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "rotscale", + "fragment": "spiderclip", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "BlurSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "InScale", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "InOffset", "type": "float", "count": 2, "values": [ 0.0, 0.0 ] }, + { "name": "InRotation", "type": "float", "count": 1, "values": [ 0.0 ] }, + { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, + { "name": "Scissor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 1.0, 1.0 ] }, + { "name": "Vignette", "type": "float", "count": 4, "values": [ 0.0, 0.0, 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/spiderclip.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/spiderclip.fsh new file mode 100644 index 0000000..f53979c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/spiderclip.fsh @@ -0,0 +1,31 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D BlurSampler; + +varying vec2 texCoord; +varying vec2 scaledCoord; + +uniform vec2 InSize; +uniform vec4 Scissor; +uniform vec4 Vignette; + +void main() { + vec4 ScaledTexel = texture2D(DiffuseSampler, scaledCoord); + vec4 BlurTexel = texture2D(BlurSampler, texCoord); + vec4 OutTexel = ScaledTexel; + + // -- Alpha Clipping -- + if (scaledCoord.x < Scissor.x) OutTexel = BlurTexel; + if (scaledCoord.y < Scissor.y) OutTexel = BlurTexel; + if (scaledCoord.x > Scissor.z) OutTexel = BlurTexel; + if (scaledCoord.y > Scissor.w) OutTexel = BlurTexel; + + clamp(scaledCoord, 0.0, 1.0); + + if (scaledCoord.x < Vignette.x) OutTexel = mix(BlurTexel, OutTexel, (Scissor.x - scaledCoord.x) / (Scissor.x - Vignette.x)); + if (scaledCoord.y < Vignette.y) OutTexel = mix(BlurTexel, OutTexel, (Scissor.y - scaledCoord.y) / (Scissor.y - Vignette.y)); + if (scaledCoord.x > Vignette.z) OutTexel = mix(BlurTexel, OutTexel, (Scissor.z - scaledCoord.x) / (Scissor.z - Vignette.z)); + if (scaledCoord.y > Vignette.w) OutTexel = mix(BlurTexel, OutTexel, (Scissor.w - scaledCoord.y) / (Scissor.w - Vignette.w)); + gl_FragColor = vec4(OutTexel.rgb, 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/wobble.fsh b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/wobble.fsh new file mode 100644 index 0000000..9a17540 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/wobble.fsh @@ -0,0 +1,58 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Time; +uniform vec2 Frequency; +uniform vec2 WobbleAmount; + +vec3 hue(float h) +{ + float r = abs(h * 6.0 - 3.0) - 1.0; + float g = 2 - abs(h * 6.0 - 2.0); + float b = 2 - abs(h * 6.0 - 4.0); + return clamp(vec3(r,g,b), 0.0, 1.0); +} + +vec3 HSVtoRGB(vec3 hsv) { + return ((hue(hsv.x) - 1.0) * hsv.y + 1.0) * hsv.z; +} + +vec3 RGBtoHSV(vec3 rgb) { + vec3 hsv = vec3(0.0); + hsv.z = max(rgb.r, max(rgb.g, rgb.b)); + float min = min(rgb.r, min(rgb.g, rgb.b)); + float c = hsv.z - min; + + if (c != 0) + { + hsv.y = c / hsv.z; + vec3 delta = (hsv.z - rgb) / c; + delta.rgb -= delta.brg; + delta.rg += vec2(2.0, 4.0); + if (rgb.r >= hsv.z) { + hsv.x = delta.b; + } else if (rgb.g >= hsv.z) { + hsv.x = delta.r; + } else { + hsv.x = delta.g; + } + hsv.x = fract(hsv.x / 6.0); + } + return hsv; +} + +void main() { + float xOffset = sin(texCoord.y * Frequency.x + Time * 3.1415926535 * 2.0) * WobbleAmount.x; + float yOffset = cos(texCoord.x * Frequency.y + Time * 3.1415926535 * 2.0) * WobbleAmount.y; + vec2 offset = vec2(xOffset, yOffset); + vec4 rgb = texture2D(DiffuseSampler, texCoord + offset); + vec3 hsv = RGBtoHSV(rgb.rgb); + hsv.x = fract(hsv.x + Time); + gl_FragColor = vec4(HSVtoRGB(hsv), 1.0); +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/wobble.json b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/wobble.json new file mode 100644 index 0000000..d8e9945 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/shaders/program/wobble.json @@ -0,0 +1,21 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "wobble", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, + { "name": "Frequency", "type": "float", "count": 2, "values": [ 512.0, 288.0 ] }, + { "name": "WobbleAmount", "type": "float", "count": 2, "values": [ 0.002, 0.002 ] } + ] +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/texts/credits.txt b/Client-1.8.9/src/main/resources/assets/minecraft/texts/credits.txt new file mode 100644 index 0000000..cd27b73 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/texts/credits.txt @@ -0,0 +1,68 @@ +[C]§f=============== +[C]§eMinecraft Credits +[C]§f=============== + +§7Created by: +§f Markus Persson + +§7Game design, programming and graphics: +§f Markus Persson +§f Jens Bergensten +§f Nathan Adams +§f Ryan Holtz +§f Michael Stoyke + +§7Programming: +§f Erik Broes + +§7Music and sound: +§f Daniel Rosenfeld + +§7Ingame artwork and paintings: +§f Kristoffer Zetterstrand + +§7End game narrative: +§f Julian Gough + +§7Website development: +§f Tobias Möllstam +§f Daniel Frisk +§f Leonard Axelsson +§f Jens Bergensten +§f Markus Persson + +§7Logo and promotional artwork: +§f Markus Toivonen + +§7Business and administration: +§f Carl Manneh +§f Daniel Kaplan + +§7Director of fun: +§f Lydia Winters + +§7Number crunching and statistics: +§f Patrick Geuder + +§7Additional programming: +§f Paul Spooner +§f Ryan 'Scaevolus' Hitchman +§f Elliot 'Hippoplatimus' Segal + +§7Developers of Mo' Creatures (horses etc): +§f John Olarte (DrZhark) +§f Kent Christian Jensen +§f Dan Roque + +§7Technologies used: +§f Java by Oracle +§f LWJGL by many talented people +§f "3d Sound System" by Paul Lamb +§f JOrbis by JCraft + + + + + + +§f"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." §7- Unknown \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/texts/end.txt b/Client-1.8.9/src/main/resources/assets/minecraft/texts/end.txt new file mode 100644 index 0000000..7277524 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/texts/end.txt @@ -0,0 +1,151 @@ +§3I see the player you mean. + +§2PLAYERNAME? + +§3Yes. Take care. It has reached a higher level now. It can read our thoughts. + +§2That doesn't matter. It thinks we are part of the game. + +§3I like this player. It played well. It did not give up. + +§2It is reading our thoughts as though they were words on a screen. + +§3That is how it chooses to imagine many things, when it is deep in the dream of a game. + +§2Words make a wonderful interface. Very flexible. And less terrifying than staring at the reality behind the screen. + +§3They used to hear voices. Before players could read. Back in the days when those who did not play called the players witches, and warlocks. And players dreamed they flew through the air, on sticks powered by demons. + +§2What did this player dream? + +§3This player dreamed of sunlight and trees. Of fire and water. It dreamed it created. And it dreamed it destroyed. It dreamed it hunted, and was hunted. It dreamed of shelter. + +§2Hah, the original interface. A million years old, and it still works. But what true structure did this player create, in the reality behind the screen? + +§3It worked, with a million others, to sculpt a true world in a fold of the §f§k§a§b§3, and created a §f§k§a§b§3 for §f§k§a§b§3, in the §f§k§a§b§3. + +§2It cannot read that thought. + +§3No. It has not yet achieved the highest level. That, it must achieve in the long dream of life, not the short dream of a game. + +§2Does it know that we love it? That the universe is kind? + +§3Sometimes, through the noise of its thoughts, it hears the universe, yes. + +§2But there are times it is sad, in the long dream. It creates worlds that have no summer, and it shivers under a black sun, and it takes its sad creation for reality. + +§3To cure it of sorrow would destroy it. The sorrow is part of its own private task. We cannot interfere. + +§2Sometimes when they are deep in dreams, I want to tell them, they are building true worlds in reality. Sometimes I want to tell them of their importance to the universe. Sometimes, when they have not made a true connection in a while, I want to help them to speak the word they fear. + +§3It reads our thoughts. + +§2Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely §f§k§a§b§2 and §f§k§a§b§2, I wish to tell them that they are §f§k§a§b§2 in the §f§k§a§b§2. They see so little of reality, in their long dream. + +§3And yet they play the game. + +§2But it would be so easy to tell them... + +§3Too strong for this dream. To tell them how to live is to prevent them living. + +§2I will not tell the player how to live. + +§3The player is growing restless. + +§2I will tell the player a story. + +§3But not the truth. + +§2No. A story that contains the truth safely, in a cage of words. Not the naked truth that can burn over any distance. + +§3Give it a body, again. + +§2Yes. Player... + +§3Use its name. + +§2PLAYERNAME. Player of games. + +§3Good. + +§2Take a breath, now. Take another. Feel air in your lungs. Let your limbs return. Yes, move your fingers. Have a body again, under gravity, in air. Respawn in the long dream. There you are. Your body touching the universe again at every point, as though you were separate things. As though we were separate things. + +§3Who are we? Once we were called the spirit of the mountain. Father sun, mother moon. Ancestral spirits, animal spirits. Jinn. Ghosts. The green man. Then gods, demons. Angels. Poltergeists. Aliens, extraterrestrials. Leptons, quarks. The words change. We do not change. + +§2We are the universe. We are everything you think isn't you. You are looking at us now, through your skin and your eyes. And why does the universe touch your skin, and throw light on you? To see you, player. To know you. And to be known. I shall tell you a story. + +§2Once upon a time, there was a player. + +§3The player was you, PLAYERNAME. + +§2Sometimes it thought itself human, on the thin crust of a spinning globe of molten rock. The ball of molten rock circled a ball of blazing gas that was three hundred and thirty thousand times more massive than it. They were so far apart that light took eight minutes to cross the gap. The light was information from a star, and it could burn your skin from a hundred and fifty million kilometres away. + +§2Sometimes the player dreamed it was a miner, on the surface of a world that was flat, and infinite. The sun was a square of white. The days were short; there was much to do; and death was a temporary inconvenience. + +§3Sometimes the player dreamed it was lost in a story. + +§2Sometimes the player dreamed it was other things, in other places. Sometimes these dreams were disturbing. Sometimes very beautiful indeed. Sometimes the player woke from one dream into another, then woke from that into a third. + +§3Sometimes the player dreamed it watched words on a screen. + +§2Let's go back. + +§2The atoms of the player were scattered in the grass, in the rivers, in the air, in the ground. A woman gathered the atoms; she drank and ate and inhaled; and the woman assembled the player, in her body. + +§2And the player awoke, from the warm, dark world of its mother's body, into the long dream. + +§2And the player was a new story, never told before, written in letters of DNA. And the player was a new program, never run before, generated by a sourcecode a billion years old. And the player was a new human, never alive before, made from nothing but milk and love. + +§3You are the player. The story. The program. The human. Made from nothing but milk and love. + +§2Let's go further back. + +§2The seven billion billion billion atoms of the player's body were created, long before this game, in the heart of a star. So the player, too, is information from a star. And the player moves through a story, which is a forest of information planted by a man called Julian, on a flat, infinite world created by a man called Markus, that exists inside a small, private world created by the player, who inhabits a universe created by... + +§3Shush. Sometimes the player created a small, private world that was soft and warm and simple. Sometimes hard, and cold, and complicated. Sometimes it built a model of the universe in its head; flecks of energy, moving through vast empty spaces. Sometimes it called those flecks "electrons" and "protons". + +§2Sometimes it called them "planets" and "stars". + +§2Sometimes it believed it was in a universe that was made of energy that was made of offs and ons; zeros and ones; lines of code. Sometimes it believed it was playing a game. Sometimes it believed it was reading words on a screen. + +§3You are the player, reading words... + +§2Shush... Sometimes the player read lines of code on a screen. Decoded them into words; decoded words into meaning; decoded meaning into feelings, emotions, theories, ideas, and the player started to breathe faster and deeper and realised it was alive, it was alive, those thousand deaths had not been real, the player was alive + +§3You. You. You are alive. + +§2and sometimes the player believed the universe had spoken to it through the sunlight that came through the shuffling leaves of the summer trees + +§3and sometimes the player believed the universe had spoken to it through the light that fell from the crisp night sky of winter, where a fleck of light in the corner of the player's eye might be a star a million times as massive as the sun, boiling its planets to plasma in order to be visible for a moment to the player, walking home at the far side of the universe, suddenly smelling food, almost at the familiar door, about to dream again + +§2and sometimes the player believed the universe had spoken to it through the zeros and ones, through the electricity of the world, through the scrolling words on a screen at the end of a dream + +§3and the universe said I love you + +§2and the universe said you have played the game well + +§3and the universe said everything you need is within you + +§2and the universe said you are stronger than you know + +§3and the universe said you are the daylight + +§2and the universe said you are the night + +§3and the universe said the darkness you fight is within you + +§2and the universe said the light you seek is within you + +§3and the universe said you are not alone + +§2and the universe said you are not separate from every other thing + +§3and the universe said you are the universe tasting itself, talking to itself, reading its own code + +§2and the universe said I love you because you are love. + +§3And the game was over and the player woke up from the dream. And the player began a new dream. And the player dreamed again, dreamed better. And the player was the universe. And the player was love. + +§3You are the player. + +§2Wake up. diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/texts/splashes.txt b/Client-1.8.9/src/main/resources/assets/minecraft/texts/splashes.txt new file mode 100644 index 0000000..0cfa954 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/texts/splashes.txt @@ -0,0 +1,359 @@ +As seen on TV! +Awesome! +100% pure! +May contain nuts! +Better than Prey! +More polygons! +Sexy! +Limited edition! +Flashing letters! +Made by Notch! +It's here! +Best in class! +It's finished! +Kind of dragon free! +Excitement! +More than 500 sold! +One of a kind! +Heaps of hits on YouTube! +Indev! +Spiders everywhere! +Check it out! +Holy cow, man! +It's a game! +Made in Sweden! +Uses LWJGL! +Reticulating splines! +Minecraft! +Yaaay! +Singleplayer! +Keyboard compatible! +Undocumented! +Ingots! +Exploding creepers! +That's no moon! +l33t! +Create! +Survive! +Dungeon! +Exclusive! +The bee's knees! +Down with O.P.P.! +Closed source! +Classy! +Wow! +Not on steam! +Oh man! +Awesome community! +Pixels! +Teetsuuuuoooo! +Kaaneeeedaaaa! +Now with difficulty! +Enhanced! +90% bug free! +Pretty! +12 herbs and spices! +Fat free! +Absolutely no memes! +Free dental! +Ask your doctor! +Minors welcome! +Cloud computing! +Legal in Finland! +Hard to label! +Technically good! +Bringing home the bacon! +Indie! +GOTY! +Ceci n'est pas une title screen! +Euclidian! +Now in 3D! +Inspirational! +Herregud! +Complex cellular automata! +Yes, sir! +Played by cowboys! +OpenGL 2.1 (if supported)! +Thousands of colors! +Try it! +Age of Wonders is better! +Try the mushroom stew! +Sensational! +Hot tamale, hot hot tamale! +Play him off, keyboard cat! +Guaranteed! +Macroscopic! +Bring it on! +Random splash! +Call your mother! +Monster infighting! +Loved by millions! +Ultimate edition! +Freaky! +You've got a brand new key! +Water proof! +Uninflammable! +Whoa, dude! +All inclusive! +Tell your friends! +NP is not in P! +Music by C418! +Livestreamed! +Haunted! +Polynomial! +Terrestrial! +All is full of love! +Full of stars! +Scientific! +Not as cool as Spock! +Collaborate and listen! +Never dig down! +Take frequent breaks! +Not linear! +Han shot first! +Nice to meet you! +Buckets of lava! +Ride the pig! +Larger than Earth! +sqrt(-1) love you! +Phobos anomaly! +Punching wood! +Falling off cliffs! +0% sugar! +150% hyperbole! +Synecdoche! +Let's danec! +Seecret Friday update! +Reference implementation! +Lewd with two dudes with food! +Kiss the sky! +20 GOTO 10! +Verlet intregration! +Peter Griffin! +Do not distribute! +Cogito ergo sum! +4815162342 lines of code! +A skeleton popped out! +The Work of Notch! +The sum of its parts! +BTAF used to be good! +I miss ADOM! +umop-apisdn! +OICU812! +Bring me Ray Cokes! +Finger-licking! +Thematic! +Pneumatic! +Sublime! +Octagonal! +Une baguette! +Gargamel plays it! +Rita is the new top dog! +SWM forever! +Representing Edsbyn! +Matt Damon! +Supercalifragilisticexpialidocious! +Consummate V's! +Cow Tools! +Double buffered! +Fan fiction! +Flaxkikare! +Jason! Jason! Jason! +Hotter than the sun! +Internet enabled! +Autonomous! +Engage! +Fantasy! +DRR! DRR! DRR! +Kick it root down! +Regional resources! +Woo, facepunch! +Woo, somethingawful! +Woo, /v/! +Woo, tigsource! +Woo, minecraftforum! +Woo, worldofminecraft! +Woo, reddit! +Woo, 2pp! +Google anlyticsed! +Now supports åäö! +Give us Gordon! +Tip your waiter! +Very fun! +12345 is a bad password! +Vote for net neutrality! +Lives in a pineapple under the sea! +MAP11 has two names! +Omnipotent! +Gasp! +...! +Bees, bees, bees, bees! +Jag känner en bot! +This text is hard to read if you play the game at the default resolution, but at 1080p it's fine! +Haha, LOL! +Hampsterdance! +Switches and ores! +Menger sponge! +idspispopd! +Eple (original edit)! +So fresh, so clean! +Slow acting portals! +Try the Nether! +Don't look directly at the bugs! +Oh, ok, Pigmen! +Finally with ladders! +Scary! +Play Minecraft, Watch Topgear, Get Pig! +Twittered about! +Jump up, jump up, and get down! +Joel is neat! +A riddle, wrapped in a mystery! +Huge tracts of land! +Welcome to your Doom! +Stay a while, stay forever! +Stay a while and listen! +Treatment for your rash! +"Autological" is! +Information wants to be free! +"Almost never" is an interesting concept! +Lots of truthiness! +The creeper is a spy! +Turing complete! +It's groundbreaking! +Let our battle's begin! +The sky is the limit! +Jeb has amazing hair! +Ryan also has amazing hair! +Casual gaming! +Undefeated! +Kinda like Lemmings! +Follow the train, CJ! +Leveraging synergy! +This message will never appear on the splash screen, isn't that weird? +DungeonQuest is unfair! +110813! +90210! +Check out the far lands! +Tyrion would love it! +Also try VVVVVV! +Also try Super Meat Boy! +Also try Terraria! +Also try Mount And Blade! +Also try Project Zomboid! +Also try World of Goo! +Also try Limbo! +Also try Pixeljunk Shooter! +Also try Braid! +That's super! +Bread is pain! +Read more books! +Khaaaaaaaaan! +Less addictive than TV Tropes! +More addictive than lemonade! +Bigger than a bread box! +Millions of peaches! +Fnord! +This is my true form! +Totally forgot about Dre! +Don't bother with the clones! +Pumpkinhead! +Hobo humping slobo babe! +Made by Jeb! +Has an ending! +Finally complete! +Feature packed! +Boots with the fur! +Stop, hammertime! +Testificates! +Conventional! +Homeomorphic to a 3-sphere! +Doesn't avoid double negatives! +Place ALL the blocks! +Does barrel rolls! +Meeting expectations! +PC gaming since 1873! +Ghoughpteighbteau tchoghs! +Déjà vu! +Déjà vu! +Got your nose! +Haley loves Elan! +Afraid of the big, black bat! +Doesn't use the U-word! +Child's play! +See you next Friday or so! +From the streets of Södermalm! +150 bpm for 400000 minutes! +Technologic! +Funk soul brother! +Pumpa kungen! +日本ハロー! +한국 안녕하세요! +Helo Cymru! +Cześć Polsko! +你好中国! +Привет Россия! +Γεια σου Ελλάδα! +My life for Aiur! +Lennart lennart = new Lennart(); +I see your vocabulary has improved! +Who put it there? +You can't explain that! +if not ok then return end +§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac +§kFUNKY LOL +SOPA means LOSER in Swedish! +Big Pointy Teeth! +Bekarton guards the gate! +Mmmph, mmph! +Don't feed avocados to parrots! +Swords for everyone! +Plz reply to my tweet! +.party()! +Take her pillow! +Put that cookie down! +Pretty scary! +I have a suggestion. +Now with extra hugs! +Now Java 6! +Woah. +HURNERJSGER? +What's up, Doc? +Now contains 32 random daily cats! +That's Numberwang! +pls rt +Do you want to join my server? +Put a little fence around it! +Throw a blanket over it! +One day, somewhere in the future, my work will be quoted! +Now with additional stuff! +Extra things! +Yay, puppies for everyone! +So sweet, like a nice bon bon! +Popping tags! +Very influential in its circle! +Now With Multiplayer! +Rise from your grave! +Warning! A huge battleship "STEVE" is approaching fast! +Blue warrior shot the food! +Run, coward! I hunger! +Flavor with no seasoning! +Strange, but not a stranger! +Tougher than diamonds, rich like cream! +Getting ready to show! +Getting ready to know! +Getting ready to drop! +Getting ready to shock! +Getting ready to freak! +Getting ready to speak! +It swings, it jives! +Cruising streets for gold! +Take an eggbeater and beat it against a skillet! +Make me a table, a funky table! +Take the elevator to the mezzanine! +Stop being reasonable, this is the Internet! +/give @a hugs 64 +This is good for Realms. +Any computer is a laptop if you're brave enough! +Do it all, everything! +Where there is not light, there can spider! +GNU Terry Pratchett \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_base.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_base.png new file mode 100644 index 0000000..cfc1fc8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_base.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png new file mode 100644 index 0000000..395dea4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png new file mode 100644 index 0000000..eddc47f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png new file mode 100644 index 0000000..6cade1f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/beacon.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/beacon.png new file mode 100644 index 0000000..a69e59d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/beacon.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_end.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_end.png new file mode 100644 index 0000000..6e1a4be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_end.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_side.png new file mode 100644 index 0000000..3ce06f3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_top.png new file mode 100644 index 0000000..b96d357 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_feet_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_end.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_end.png new file mode 100644 index 0000000..b684c9a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_end.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_side.png new file mode 100644 index 0000000..3270b4a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_top.png new file mode 100644 index 0000000..2ab1090 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bed_head_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bedrock.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bedrock.png new file mode 100644 index 0000000..1643c99 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bedrock.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bookshelf.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bookshelf.png new file mode 100644 index 0000000..4c87f0f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/bookshelf.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brewing_stand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brewing_stand.png new file mode 100644 index 0000000..60832aa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brewing_stand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brewing_stand_base.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brewing_stand_base.png new file mode 100644 index 0000000..0742fbf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brewing_stand_base.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brick.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brick.png new file mode 100644 index 0000000..fd6959c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/brick.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_bottom.png new file mode 100644 index 0000000..6f10bc0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_side.png new file mode 100644 index 0000000..9c55503 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_top.png new file mode 100644 index 0000000..f182e84 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cactus_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_bottom.png new file mode 100644 index 0000000..d93b15a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_inner.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_inner.png new file mode 100644 index 0000000..ce7ce69 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_inner.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_side.png new file mode 100644 index 0000000..343a023 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_top.png new file mode 100644 index 0000000..2947892 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cake_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_3.png new file mode 100644 index 0000000..2391be8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_bottom.png new file mode 100644 index 0000000..8328307 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_inner.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_inner.png new file mode 100644 index 0000000..d5a30dd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_inner.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_side.png new file mode 100644 index 0000000..df42f98 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_top.png new file mode 100644 index 0000000..e263fc5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cauldron_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/clay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/clay.png new file mode 100644 index 0000000..c19e031 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/clay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coal_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coal_block.png new file mode 100644 index 0000000..024404b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coal_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coal_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coal_ore.png new file mode 100644 index 0000000..49486d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coal_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coarse_dirt.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coarse_dirt.png new file mode 100644 index 0000000..d646225 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/coarse_dirt.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cobblestone.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cobblestone.png new file mode 100644 index 0000000..da3498c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cobblestone.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png new file mode 100644 index 0000000..29449e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png new file mode 100644 index 0000000..25892eb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png new file mode 100644 index 0000000..d0098ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png new file mode 100644 index 0000000..db28c7b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/command_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/command_block.png new file mode 100644 index 0000000..4459675 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/command_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/comparator_off.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/comparator_off.png new file mode 100644 index 0000000..c9527bc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/comparator_off.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/comparator_on.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/comparator_on.png new file mode 100644 index 0000000..2e4fb7a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/comparator_on.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_front.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_front.png new file mode 100644 index 0000000..11986a4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_front.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_side.png new file mode 100644 index 0000000..1c678b4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_top.png new file mode 100644 index 0000000..5cd53a5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/crafting_table_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_inverted_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_inverted_top.png new file mode 100644 index 0000000..194a30e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_inverted_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_side.png new file mode 100644 index 0000000..ac273ea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_top.png new file mode 100644 index 0000000..3bfb2da Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/deadbush.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/deadbush.png new file mode 100644 index 0000000..c64e079 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/deadbush.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_0.png new file mode 100644 index 0000000..f65b7ed Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_1.png new file mode 100644 index 0000000..7c91596 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_2.png new file mode 100644 index 0000000..dadd6b0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_3.png new file mode 100644 index 0000000..52a40b6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_4.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_4.png new file mode 100644 index 0000000..e37c88a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_5.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_5.png new file mode 100644 index 0000000..9590d2f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_6.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_6.png new file mode 100644 index 0000000..8e490c0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_7.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_7.png new file mode 100644 index 0000000..0b40c78 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_8.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_8.png new file mode 100644 index 0000000..c0bf1de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_9.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_9.png new file mode 100644 index 0000000..e3185f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/diamond_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/diamond_block.png new file mode 100644 index 0000000..f2e2e77 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/diamond_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/diamond_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/diamond_ore.png new file mode 100644 index 0000000..735ecda Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/diamond_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt.png new file mode 100644 index 0000000..617d353 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png new file mode 100644 index 0000000..5921d37 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png new file mode 100644 index 0000000..ebeda86 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png new file mode 100644 index 0000000..3e09fde Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png new file mode 100644 index 0000000..87a7837 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_acacia_lower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_acacia_lower.png new file mode 100644 index 0000000..2f57508 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_acacia_lower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_acacia_upper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_acacia_upper.png new file mode 100644 index 0000000..9b7e742 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_acacia_upper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_birch_lower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_birch_lower.png new file mode 100644 index 0000000..2c6f7d3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_birch_lower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_birch_upper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_birch_upper.png new file mode 100644 index 0000000..1345b41 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_birch_upper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_dark_oak_lower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_dark_oak_lower.png new file mode 100644 index 0000000..7bb3ff2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_dark_oak_lower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_dark_oak_upper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_dark_oak_upper.png new file mode 100644 index 0000000..27fa6cc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_dark_oak_upper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_iron_lower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_iron_lower.png new file mode 100644 index 0000000..dbc33ab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_iron_lower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_iron_upper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_iron_upper.png new file mode 100644 index 0000000..56878fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_iron_upper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_jungle_lower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_jungle_lower.png new file mode 100644 index 0000000..4edfa3c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_jungle_lower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_jungle_upper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_jungle_upper.png new file mode 100644 index 0000000..d5201f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_jungle_upper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_spruce_lower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_spruce_lower.png new file mode 100644 index 0000000..5faa6e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_spruce_lower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_spruce_upper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_spruce_upper.png new file mode 100644 index 0000000..38e2717 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_spruce_upper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_wood_lower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_wood_lower.png new file mode 100644 index 0000000..cc61731 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_wood_lower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_wood_upper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_wood_upper.png new file mode 100644 index 0000000..93319d5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/door_wood_upper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png new file mode 100644 index 0000000..6a5fa6a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png new file mode 100644 index 0000000..393144c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png new file mode 100644 index 0000000..5ac15b4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png new file mode 100644 index 0000000..1ceb3de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png new file mode 100644 index 0000000..21285f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png new file mode 100644 index 0000000..bc68241 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png new file mode 100644 index 0000000..4d59f44 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png new file mode 100644 index 0000000..028aa80 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png new file mode 100644 index 0000000..d488923 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png new file mode 100644 index 0000000..8a12ebe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png new file mode 100644 index 0000000..699e34f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png new file mode 100644 index 0000000..4d14203 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png new file mode 100644 index 0000000..5b880b5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png new file mode 100644 index 0000000..b00751f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dragon_egg.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dragon_egg.png new file mode 100644 index 0000000..02af123 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dragon_egg.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png new file mode 100644 index 0000000..7d5f260 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png new file mode 100644 index 0000000..68a56c8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/emerald_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/emerald_block.png new file mode 100644 index 0000000..dc214ee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/emerald_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/emerald_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/emerald_ore.png new file mode 100644 index 0000000..a26c35f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/emerald_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png new file mode 100644 index 0000000..0f492aa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_side.png new file mode 100644 index 0000000..f2f4614 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_top.png new file mode 100644 index 0000000..0d5f68f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/end_stone.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/end_stone.png new file mode 100644 index 0000000..c2a91e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/end_stone.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_eye.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_eye.png new file mode 100644 index 0000000..afa1d5d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_eye.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_side.png new file mode 100644 index 0000000..e6cb567 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_top.png new file mode 100644 index 0000000..35215a5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/endframe_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/farmland_dry.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/farmland_dry.png new file mode 100644 index 0000000..d03a0f4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/farmland_dry.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/farmland_wet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/farmland_wet.png new file mode 100644 index 0000000..f8d460d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/farmland_wet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fern.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fern.png new file mode 100644 index 0000000..fd76950 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fern.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png new file mode 100644 index 0000000..cf8910f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta new file mode 100644 index 0000000..7644671 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta @@ -0,0 +1,38 @@ +{ + "animation": { + "frames": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png new file mode 100644 index 0000000..6db92ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_allium.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_allium.png new file mode 100644 index 0000000..b7b5a45 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_allium.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png new file mode 100644 index 0000000..51d7fd9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_dandelion.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_dandelion.png new file mode 100644 index 0000000..873e3f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_dandelion.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_houstonia.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_houstonia.png new file mode 100644 index 0000000..2f9127d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_houstonia.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png new file mode 100644 index 0000000..6d48913 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_paeonia.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_paeonia.png new file mode 100644 index 0000000..01a92ee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_paeonia.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_pot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_pot.png new file mode 100644 index 0000000..09c2523 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_pot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_rose.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_rose.png new file mode 100644 index 0000000..895d78f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_rose.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png new file mode 100644 index 0000000..6715a62 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png new file mode 100644 index 0000000..a757bf5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_red.png new file mode 100644 index 0000000..3048b63 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_white.png new file mode 100644 index 0000000..6aa12a9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_front_off.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_front_off.png new file mode 100644 index 0000000..0570c3a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_front_off.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_front_on.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_front_on.png new file mode 100644 index 0000000..92c89f3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_front_on.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_side.png new file mode 100644 index 0000000..115f73d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_top.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/furnace_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass.png new file mode 100644 index 0000000..acadb01 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_black.png new file mode 100644 index 0000000..06f3427 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_blue.png new file mode 100644 index 0000000..38885de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_brown.png new file mode 100644 index 0000000..259b61c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_cyan.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_cyan.png new file mode 100644 index 0000000..d30caa4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_cyan.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_gray.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_gray.png new file mode 100644 index 0000000..3f07a5d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_gray.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_green.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_green.png new file mode 100644 index 0000000..7c1f4e6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_light_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_light_blue.png new file mode 100644 index 0000000..b62703d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_light_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_lime.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_lime.png new file mode 100644 index 0000000..f1d3c46 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_lime.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_magenta.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_magenta.png new file mode 100644 index 0000000..5cd9945 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_magenta.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_orange.png new file mode 100644 index 0000000..3a29e31 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top.png new file mode 100644 index 0000000..02de587 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png new file mode 100644 index 0000000..43d60c5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png new file mode 100644 index 0000000..55c614f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png new file mode 100644 index 0000000..cbd791a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png new file mode 100644 index 0000000..9a34b84 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png new file mode 100644 index 0000000..bb06114 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png new file mode 100644 index 0000000..a7d9fc7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png new file mode 100644 index 0000000..6a0e661 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png new file mode 100644 index 0000000..0607d75 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png new file mode 100644 index 0000000..5419e52 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png new file mode 100644 index 0000000..2866571 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png new file mode 100644 index 0000000..6b6cd76 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png new file mode 100644 index 0000000..23e208e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png new file mode 100644 index 0000000..22b69db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png new file mode 100644 index 0000000..f226ecc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png new file mode 100644 index 0000000..9a273c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png new file mode 100644 index 0000000..1c8580f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pink.png new file mode 100644 index 0000000..42d8739 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_purple.png new file mode 100644 index 0000000..fcae3d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_red.png new file mode 100644 index 0000000..db4c5eb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_silver.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_silver.png new file mode 100644 index 0000000..8461664 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_silver.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_white.png new file mode 100644 index 0000000..696c5aa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_yellow.png new file mode 100644 index 0000000..8e48e12 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glass_yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glowstone.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glowstone.png new file mode 100644 index 0000000..c7253b3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/glowstone.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gold_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gold_block.png new file mode 100644 index 0000000..174002e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gold_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gold_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gold_ore.png new file mode 100644 index 0000000..b1a7a55 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gold_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side.png new file mode 100644 index 0000000..a4975e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side_overlay.png new file mode 100644 index 0000000..fc3fa9d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side_snowed.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side_snowed.png new file mode 100644 index 0000000..41f6197 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_side_snowed.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_top.png new file mode 100644 index 0000000..eaa7e45 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/grass_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gravel.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gravel.png new file mode 100644 index 0000000..388e5c5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/gravel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay.png new file mode 100644 index 0000000..2446380 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png new file mode 100644 index 0000000..59da22c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png new file mode 100644 index 0000000..7e38e27 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png new file mode 100644 index 0000000..f81745f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png new file mode 100644 index 0000000..b05428c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png new file mode 100644 index 0000000..8f86904 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png new file mode 100644 index 0000000..e89162e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png new file mode 100644 index 0000000..3d9ebea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png new file mode 100644 index 0000000..b459a0b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png new file mode 100644 index 0000000..9663106 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png new file mode 100644 index 0000000..40929db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png new file mode 100644 index 0000000..c21c0aa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png new file mode 100644 index 0000000..edece94 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png new file mode 100644 index 0000000..6561d12 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png new file mode 100644 index 0000000..eae07f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png new file mode 100644 index 0000000..8066af0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png new file mode 100644 index 0000000..5da4687 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hay_block_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hay_block_side.png new file mode 100644 index 0000000..a2b32db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hay_block_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hay_block_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hay_block_top.png new file mode 100644 index 0000000..1d35593 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hay_block_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_inside.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_inside.png new file mode 100644 index 0000000..24e8eae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_inside.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_outside.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_outside.png new file mode 100644 index 0000000..50ed8d5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_outside.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_top.png new file mode 100644 index 0000000..e0dbe96 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/hopper_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ice.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ice.png new file mode 100644 index 0000000..ac946e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ice.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ice_packed.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ice_packed.png new file mode 100644 index 0000000..50f0f34 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ice_packed.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_bars.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_bars.png new file mode 100644 index 0000000..732807f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_bars.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_block.png new file mode 100644 index 0000000..7816799 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_ore.png new file mode 100644 index 0000000..250d8bb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_trapdoor.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_trapdoor.png new file mode 100644 index 0000000..d3c974c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/iron_trapdoor.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/itemframe_background.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/itemframe_background.png new file mode 100644 index 0000000..b40ad65 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/itemframe_background.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/jukebox_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/jukebox_side.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/jukebox_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/jukebox_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/jukebox_top.png new file mode 100644 index 0000000..92ddb15 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/jukebox_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ladder.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ladder.png new file mode 100644 index 0000000..e2ec5f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/ladder.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lapis_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lapis_block.png new file mode 100644 index 0000000..0271489 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lapis_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lapis_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lapis_ore.png new file mode 100644 index 0000000..6144236 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lapis_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png new file mode 100644 index 0000000..af07f91 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta new file mode 100644 index 0000000..8e55e43 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_still.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_still.png new file mode 100644 index 0000000..78bb29d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_still.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta new file mode 100644 index 0000000..7ceb363 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta @@ -0,0 +1,45 @@ +{ + "animation": { + "frametime": 2, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 18, + 17, + 16, + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ] + } +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia.png new file mode 100644 index 0000000..d54eb17 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_birch.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_birch.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_birch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle.png new file mode 100644 index 0000000..e0cb935 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce.png new file mode 100644 index 0000000..602eab8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lever.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lever.png new file mode 100644 index 0000000..051187f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/lever.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_acacia.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_acacia.png new file mode 100644 index 0000000..d221210 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_acacia.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_acacia_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_acacia_top.png new file mode 100644 index 0000000..3d44878 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_acacia_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_big_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_big_oak.png new file mode 100644 index 0000000..d4da03e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_big_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_big_oak_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_big_oak_top.png new file mode 100644 index 0000000..99137b6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_big_oak_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_birch.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_birch.png new file mode 100644 index 0000000..bfb209d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_birch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_birch_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_birch_top.png new file mode 100644 index 0000000..f9b94f4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_birch_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_jungle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_jungle.png new file mode 100644 index 0000000..0b7120a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_jungle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_jungle_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_jungle_top.png new file mode 100644 index 0000000..26b0361 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_jungle_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_oak.png new file mode 100644 index 0000000..914cb5f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_oak_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_oak_top.png new file mode 100644 index 0000000..7a44e77 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_oak_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_spruce.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_spruce.png new file mode 100644 index 0000000..dc1aa2f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_spruce.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_spruce_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_spruce_top.png new file mode 100644 index 0000000..280c64e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/log_spruce_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_side.png new file mode 100644 index 0000000..ec7b430 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_stem_connected.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_stem_connected.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_top.png new file mode 100644 index 0000000..65cf169 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/melon_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mob_spawner.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mob_spawner.png new file mode 100644 index 0000000..7d55217 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mob_spawner.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png new file mode 100644 index 0000000..f0e7a04 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png new file mode 100644 index 0000000..1f52ba8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png new file mode 100644 index 0000000..66cf12c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png new file mode 100644 index 0000000..83c0840 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_brown.png new file mode 100644 index 0000000..bf33d34 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_red.png new file mode 100644 index 0000000..1b332b7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mushroom_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mycelium_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mycelium_side.png new file mode 100644 index 0000000..5547425 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mycelium_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mycelium_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mycelium_top.png new file mode 100644 index 0000000..088a825 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/mycelium_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_brick.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_brick.png new file mode 100644 index 0000000..caaf66f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_brick.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png new file mode 100644 index 0000000..514a95b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png new file mode 100644 index 0000000..b4ad0d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png new file mode 100644 index 0000000..b9b6743 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/netherrack.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/netherrack.png new file mode 100644 index 0000000..88129c4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/netherrack.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/noteblock.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/noteblock.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/noteblock.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/obsidian.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/obsidian.png new file mode 100644 index 0000000..ff0a683 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/obsidian.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_bottom.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_inner.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_inner.png new file mode 100644 index 0000000..1043929 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_inner.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_side.png new file mode 100644 index 0000000..634f54a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_top_normal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_top_normal.png new file mode 100644 index 0000000..eeaadab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_top_normal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_top_sticky.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_top_sticky.png new file mode 100644 index 0000000..6ddd4ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/piston_top_sticky.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_acacia.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_acacia.png new file mode 100644 index 0000000..6858c51 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_acacia.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_big_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_big_oak.png new file mode 100644 index 0000000..e3fd4ea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_big_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_birch.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_birch.png new file mode 100644 index 0000000..b113e3a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_birch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_jungle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_jungle.png new file mode 100644 index 0000000..e3fe82d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_jungle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_oak.png new file mode 100644 index 0000000..346f77d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_spruce.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_spruce.png new file mode 100644 index 0000000..f45fa94 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/planks_spruce.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/portal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/portal.png new file mode 100644 index 0000000..96859e2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/portal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/portal.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/portal.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/portal.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png new file mode 100644 index 0000000..d7e8185 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_bricks.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_bricks.png new file mode 100644 index 0000000..5890690 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_bricks.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_dark.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_dark.png new file mode 100644 index 0000000..07bed85 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_dark.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_rough.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_rough.png new file mode 100644 index 0000000..fe133e2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_rough.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_rough.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_rough.png.mcmeta new file mode 100644 index 0000000..410b327 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/prismarine_rough.png.mcmeta @@ -0,0 +1,30 @@ +{ + "animation": { + "frametime": 300, + "interpolate": true, + "frames": [ + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 1, + 2, + 1, + 3, + 1, + 0, + 2, + 1, + 2, + 3, + 2, + 0, + 3, + 1, + 3 + ] + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png new file mode 100644 index 0000000..ecef025 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png new file mode 100644 index 0000000..907f499 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_side.png new file mode 100644 index 0000000..75dfc47 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_top.png new file mode 100644 index 0000000..297ce3c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/pumpkin_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png new file mode 100644 index 0000000..7e16c7c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png new file mode 100644 index 0000000..80465a1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png new file mode 100644 index 0000000..44073e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines.png new file mode 100644 index 0000000..184ecd2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png new file mode 100644 index 0000000..6d20379 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_side.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_top.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_block_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_ore.png new file mode 100644 index 0000000..4d758c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/quartz_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_activator.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_activator.png new file mode 100644 index 0000000..ce115ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_activator.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_activator_powered.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_activator_powered.png new file mode 100644 index 0000000..a3aaca9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_activator_powered.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_detector.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_detector.png new file mode 100644 index 0000000..92c1466 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_detector.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_detector_powered.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_detector_powered.png new file mode 100644 index 0000000..a1c6e6b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_detector_powered.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_golden.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_golden.png new file mode 100644 index 0000000..1fc52c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_golden.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_golden_powered.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_golden_powered.png new file mode 100644 index 0000000..bd343be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_golden_powered.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_normal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_normal.png new file mode 100644 index 0000000..d609236 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_normal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_normal_turned.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_normal_turned.png new file mode 100644 index 0000000..f394a23 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/rail_normal_turned.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sand.png new file mode 100644 index 0000000..b216a42 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_bottom.png new file mode 100644 index 0000000..7e7a8c9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_carved.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_carved.png new file mode 100644 index 0000000..41070da Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_carved.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_normal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_normal.png new file mode 100644 index 0000000..f641784 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_normal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_smooth.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_smooth.png new file mode 100644 index 0000000..fd44a72 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_smooth.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_top.png new file mode 100644 index 0000000..794dbeb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/red_sandstone_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_block.png new file mode 100644 index 0000000..fcf6b40 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png new file mode 100644 index 0000000..dcec893 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png new file mode 100644 index 0000000..96729e1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line.png new file mode 100644 index 0000000..ff0fb23 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png new file mode 100644 index 0000000..9f24cbc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png new file mode 100644 index 0000000..522765b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png new file mode 100644 index 0000000..9562ef3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_ore.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_ore.png new file mode 100644 index 0000000..575a488 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_ore.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_off.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_off.png new file mode 100644 index 0000000..635eabd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_off.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_on.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_on.png new file mode 100644 index 0000000..2983d6c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_on.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/reeds.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/reeds.png new file mode 100644 index 0000000..64bbfe0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/reeds.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/repeater_off.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/repeater_off.png new file mode 100644 index 0000000..8634669 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/repeater_off.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/repeater_on.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/repeater_on.png new file mode 100644 index 0000000..d71d0d9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/repeater_on.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sand.png new file mode 100644 index 0000000..86b9654 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_bottom.png new file mode 100644 index 0000000..e102220 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_carved.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_carved.png new file mode 100644 index 0000000..9bd7fa1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_carved.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_normal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_normal.png new file mode 100644 index 0000000..1b79145 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_normal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_smooth.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_smooth.png new file mode 100644 index 0000000..ef118bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_smooth.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_top.png new file mode 100644 index 0000000..bb5b157 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sandstone_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_acacia.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_acacia.png new file mode 100644 index 0000000..a1215cb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_acacia.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_birch.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_birch.png new file mode 100644 index 0000000..b0dacc5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_birch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_jungle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_jungle.png new file mode 100644 index 0000000..4e10b35 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_jungle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_oak.png new file mode 100644 index 0000000..1bf1bfa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png new file mode 100644 index 0000000..dcf5588 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_spruce.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_spruce.png new file mode 100644 index 0000000..5767d48 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sapling_spruce.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sea_lantern.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sea_lantern.png new file mode 100644 index 0000000..4f08fd2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sea_lantern.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sea_lantern.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sea_lantern.png.mcmeta new file mode 100644 index 0000000..e8ac9bc --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sea_lantern.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 5 + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/slime.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/slime.png new file mode 100644 index 0000000..6dbe5cb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/slime.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/snow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/snow.png new file mode 100644 index 0000000..5c146cd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/snow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/soul_sand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/soul_sand.png new file mode 100644 index 0000000..fca7e8f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/soul_sand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sponge.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sponge.png new file mode 100644 index 0000000..7850703 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sponge.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sponge_wet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sponge_wet.png new file mode 100644 index 0000000..d024995 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/sponge_wet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone.png new file mode 100644 index 0000000..87e19ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_andesite.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_andesite.png new file mode 100644 index 0000000..680a899 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_andesite.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_andesite_smooth.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_andesite_smooth.png new file mode 100644 index 0000000..a77809c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_andesite_smooth.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_diorite.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_diorite.png new file mode 100644 index 0000000..711c838 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_diorite.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_diorite_smooth.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_diorite_smooth.png new file mode 100644 index 0000000..8b4f8e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_diorite_smooth.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_granite.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_granite.png new file mode 100644 index 0000000..07c7af8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_granite.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_granite_smooth.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_granite_smooth.png new file mode 100644 index 0000000..d5b37f1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_granite_smooth.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_slab_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_slab_side.png new file mode 100644 index 0000000..fe2a204 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_slab_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_slab_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_slab_top.png new file mode 100644 index 0000000..090657d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stone_slab_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick.png new file mode 100644 index 0000000..69138cf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_carved.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_carved.png new file mode 100644 index 0000000..b7e88db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_carved.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png new file mode 100644 index 0000000..918a884 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png new file mode 100644 index 0000000..5b9fe37 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tallgrass.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tallgrass.png new file mode 100644 index 0000000..2869848 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tallgrass.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_bottom.png new file mode 100644 index 0000000..cc2e586 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_side.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_side.png new file mode 100644 index 0000000..21109fb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_side.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_top.png new file mode 100644 index 0000000..ceb44b6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/tnt_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/torch_on.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/torch_on.png new file mode 100644 index 0000000..a2ce41b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/torch_on.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trapdoor.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trapdoor.png new file mode 100644 index 0000000..4eadefc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trapdoor.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trip_wire.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trip_wire.png new file mode 100644 index 0000000..42126b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trip_wire.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trip_wire_source.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trip_wire_source.png new file mode 100644 index 0000000..fbd464d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/trip_wire_source.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/vine.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/vine.png new file mode 100644 index 0000000..df5e435 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/vine.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_flow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_flow.png new file mode 100644 index 0000000..e72280c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_flow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_still.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_still.png new file mode 100644 index 0000000..c7e90b0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_still.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/waterlily.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/waterlily.png new file mode 100644 index 0000000..f6c84f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/waterlily.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/web.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/web.png new file mode 100644 index 0000000..7c097f1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/web.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_0.png new file mode 100644 index 0000000..185af6f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_1.png new file mode 100644 index 0000000..67588c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_2.png new file mode 100644 index 0000000..3d33792 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_3.png new file mode 100644 index 0000000..4649f78 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_4.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_4.png new file mode 100644 index 0000000..ac04b52 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_5.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_5.png new file mode 100644 index 0000000..1ea81ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_6.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_6.png new file mode 100644 index 0000000..cb5f195 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_7.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_7.png new file mode 100644 index 0000000..7acafb3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_black.png new file mode 100644 index 0000000..b74d5c9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_blue.png new file mode 100644 index 0000000..ce9515f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_brown.png new file mode 100644 index 0000000..b4dc3c5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png new file mode 100644 index 0000000..ca0800a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_gray.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_gray.png new file mode 100644 index 0000000..6409ff2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_gray.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_green.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_green.png new file mode 100644 index 0000000..a7be6d7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png new file mode 100644 index 0000000..72d9d9e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_lime.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_lime.png new file mode 100644 index 0000000..bf56389 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_lime.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png new file mode 100644 index 0000000..3af6747 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_orange.png new file mode 100644 index 0000000..eefe6de Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_pink.png new file mode 100644 index 0000000..c2785af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_purple.png new file mode 100644 index 0000000..76f68d6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_red.png new file mode 100644 index 0000000..0cff7a9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_silver.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_silver.png new file mode 100644 index 0000000..756d9b0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_silver.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_white.png new file mode 100644 index 0000000..abc7999 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png new file mode 100644 index 0000000..4babaaa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/colormap/foliage.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/colormap/foliage.png new file mode 100644 index 0000000..dcc119e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/colormap/foliage.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/colormap/grass.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/colormap/grass.png new file mode 100644 index 0000000..484a9a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/colormap/grass.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/effect/dither.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/effect/dither.png new file mode 100644 index 0000000..19ba7e4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/effect/dither.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/alex.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/alex.png new file mode 100644 index 0000000..b643fe2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/alex.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/armorstand/wood.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/armorstand/wood.png new file mode 100644 index 0000000..79459cc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/armorstand/wood.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/arrow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/arrow.png new file mode 100644 index 0000000..3afa604 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/arrow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/base.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/base.png new file mode 100644 index 0000000..bc80603 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/base.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/border.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/border.png new file mode 100644 index 0000000..444aeea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/border.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/bricks.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/bricks.png new file mode 100644 index 0000000..544cff4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/bricks.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/circle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/circle.png new file mode 100644 index 0000000..c6d3774 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/circle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/creeper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/creeper.png new file mode 100644 index 0000000..111b40b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/creeper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/cross.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/cross.png new file mode 100644 index 0000000..c18bf82 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/cross.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/curly_border.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/curly_border.png new file mode 100644 index 0000000..5ea188e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/curly_border.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_left.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_left.png new file mode 100644 index 0000000..c6f45ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_left.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_right.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_right.png new file mode 100644 index 0000000..23280c4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_right.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_up_left.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_up_left.png new file mode 100644 index 0000000..b0955f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_up_left.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_up_right.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_up_right.png new file mode 100644 index 0000000..e8cd6b1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/diagonal_up_right.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/flower.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/flower.png new file mode 100644 index 0000000..67dc1ac Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/flower.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/gradient.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/gradient.png new file mode 100644 index 0000000..8ce9832 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/gradient.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/gradient_up.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/gradient_up.png new file mode 100644 index 0000000..38cf516 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/gradient_up.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_horizontal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_horizontal.png new file mode 100644 index 0000000..0f6d8a7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_horizontal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_horizontal_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_horizontal_bottom.png new file mode 100644 index 0000000..64fac36 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_horizontal_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_vertical.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_vertical.png new file mode 100644 index 0000000..8178ea7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_vertical.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_vertical_right.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_vertical_right.png new file mode 100644 index 0000000..74089b6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/half_vertical_right.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/mojang.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/mojang.png new file mode 100644 index 0000000..fb6414c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/mojang.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/rhombus.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/rhombus.png new file mode 100644 index 0000000..abee982 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/rhombus.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/skull.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/skull.png new file mode 100644 index 0000000..ddf8653 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/skull.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/small_stripes.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/small_stripes.png new file mode 100644 index 0000000..0abaef0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/small_stripes.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_bottom_left.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_bottom_left.png new file mode 100644 index 0000000..5fdd245 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_bottom_left.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_bottom_right.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_bottom_right.png new file mode 100644 index 0000000..dd64eca Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_bottom_right.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_top_left.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_top_left.png new file mode 100644 index 0000000..7628998 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_top_left.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_top_right.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_top_right.png new file mode 100644 index 0000000..4197ecb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/square_top_right.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/straight_cross.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/straight_cross.png new file mode 100644 index 0000000..1b7fa7d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/straight_cross.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_bottom.png new file mode 100644 index 0000000..5473f90 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_center.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_center.png new file mode 100644 index 0000000..eddba20 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_center.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_downleft.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_downleft.png new file mode 100644 index 0000000..d73f9b7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_downleft.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_downright.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_downright.png new file mode 100644 index 0000000..0b610d9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_downright.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_left.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_left.png new file mode 100644 index 0000000..0707d31 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_left.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_middle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_middle.png new file mode 100644 index 0000000..bde988b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_middle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_right.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_right.png new file mode 100644 index 0000000..f0a8a25 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_right.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_top.png new file mode 100644 index 0000000..1b8e3f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/stripe_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangle_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangle_bottom.png new file mode 100644 index 0000000..bc37930 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangle_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangle_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangle_top.png new file mode 100644 index 0000000..77877c0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangle_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangles_bottom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangles_bottom.png new file mode 100644 index 0000000..fe25db7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangles_bottom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangles_top.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangles_top.png new file mode 100644 index 0000000..f59a121 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner/triangles_top.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner_base.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner_base.png new file mode 100644 index 0000000..e38d28e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/banner_base.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/bat.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/bat.png new file mode 100644 index 0000000..803860e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/bat.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/beacon_beam.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/beacon_beam.png new file mode 100644 index 0000000..67545b4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/beacon_beam.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/blaze.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/blaze.png new file mode 100644 index 0000000..19cdbb5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/blaze.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/boat.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/boat.png new file mode 100644 index 0000000..9b58965 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/boat.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/black.png new file mode 100644 index 0000000..422908f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/ocelot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/ocelot.png new file mode 100644 index 0000000..6b5064e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/ocelot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/red.png new file mode 100644 index 0000000..17b6de5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/siamese.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/siamese.png new file mode 100644 index 0000000..cfed948 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cat/siamese.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/christmas.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/christmas.png new file mode 100644 index 0000000..4459112 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/christmas.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/christmas_double.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/christmas_double.png new file mode 100644 index 0000000..9e44eeb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/christmas_double.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/ender.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/ender.png new file mode 100644 index 0000000..3631d0d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/ender.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/normal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/normal.png new file mode 100644 index 0000000..2e3d7fd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/normal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/normal_double.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/normal_double.png new file mode 100644 index 0000000..0168338 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/normal_double.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/trapped.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/trapped.png new file mode 100644 index 0000000..3aef190 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/trapped.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/trapped_double.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/trapped_double.png new file mode 100644 index 0000000..00eebe5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chest/trapped_double.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chicken.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chicken.png new file mode 100644 index 0000000..e24d550 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/chicken.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cow/cow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cow/cow.png new file mode 100644 index 0000000..f1320c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cow/cow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cow/mooshroom.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cow/mooshroom.png new file mode 100644 index 0000000..3d68286 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/cow/mooshroom.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/creeper/creeper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/creeper/creeper.png new file mode 100644 index 0000000..abdb540 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/creeper/creeper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png new file mode 100644 index 0000000..119f6ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enchanting_table_book.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enchanting_table_book.png new file mode 100644 index 0000000..619e7a5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enchanting_table_book.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/end_portal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/end_portal.png new file mode 100644 index 0000000..d5d8569 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/end_portal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png new file mode 100644 index 0000000..8b3668a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png new file mode 100644 index 0000000..1259a5d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon.png new file mode 100644 index 0000000..b8a680c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png new file mode 100644 index 0000000..ca5c949 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png new file mode 100644 index 0000000..147b303 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderman/enderman.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderman/enderman.png new file mode 100644 index 0000000..ab23cb9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderman/enderman.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png new file mode 100644 index 0000000..0804402 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endermite.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endermite.png new file mode 100644 index 0000000..c3e5be1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/endermite.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/experience_orb.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/experience_orb.png new file mode 100644 index 0000000..92f9d0f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/experience_orb.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/explosion.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/explosion.png new file mode 100644 index 0000000..c309409 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/explosion.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/ghast/ghast.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/ghast/ghast.png new file mode 100644 index 0000000..dd63bc1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/ghast/ghast.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png new file mode 100644 index 0000000..5d9be29 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian.png new file mode 100644 index 0000000..144c2cf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian_beam.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian_beam.png new file mode 100644 index 0000000..9f96ea5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian_beam.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian_elder.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian_elder.png new file mode 100644 index 0000000..67a9e49 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/guardian_elder.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png new file mode 100644 index 0000000..39068f2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png new file mode 100644 index 0000000..4a0786d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png new file mode 100644 index 0000000..533b2dd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/donkey.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/donkey.png new file mode 100644 index 0000000..b94bc63 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/donkey.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_black.png new file mode 100644 index 0000000..dde716e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_brown.png new file mode 100644 index 0000000..ec0158f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png new file mode 100644 index 0000000..40322ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_creamy.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_creamy.png new file mode 100644 index 0000000..bc42bcc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_creamy.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png new file mode 100644 index 0000000..b38e914 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_gray.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_gray.png new file mode 100644 index 0000000..4987532 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_gray.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png new file mode 100644 index 0000000..7320648 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png new file mode 100644 index 0000000..b1f0a69 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png new file mode 100644 index 0000000..20e1954 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png new file mode 100644 index 0000000..baa2c06 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png new file mode 100644 index 0000000..29d4ed5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_white.png new file mode 100644 index 0000000..e90e6e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_zombie.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_zombie.png new file mode 100644 index 0000000..22d55fa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/horse_zombie.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/mule.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/mule.png new file mode 100644 index 0000000..241bdaa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/horse/mule.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/iron_golem.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/iron_golem.png new file mode 100644 index 0000000..f9f6465 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/iron_golem.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/lead_knot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/lead_knot.png new file mode 100644 index 0000000..ab4d3b3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/lead_knot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/minecart.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/minecart.png new file mode 100644 index 0000000..7ad7b54 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/minecart.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/pig/pig.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/pig/pig.png new file mode 100644 index 0000000..0a9532f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/pig/pig.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/pig/pig_saddle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/pig/pig_saddle.png new file mode 100644 index 0000000..640ea76 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/pig/pig_saddle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/black.png new file mode 100644 index 0000000..1203cb9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/brown.png new file mode 100644 index 0000000..ffa0870 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/caerbannog.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/caerbannog.png new file mode 100644 index 0000000..778bfc7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/caerbannog.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/gold.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/gold.png new file mode 100644 index 0000000..595e6f7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/gold.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/salt.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/salt.png new file mode 100644 index 0000000..2232ef0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/salt.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/toast.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/toast.png new file mode 100644 index 0000000..b1bb70d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/toast.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/white.png new file mode 100644 index 0000000..bb6cd9e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/white_splotched.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/white_splotched.png new file mode 100644 index 0000000..196ac00 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/rabbit/white_splotched.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sheep/sheep.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sheep/sheep.png new file mode 100644 index 0000000..d9fe93f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sheep/sheep.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png new file mode 100644 index 0000000..623340b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sign.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sign.png new file mode 100644 index 0000000..e22e2f7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/sign.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/silverfish.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/silverfish.png new file mode 100644 index 0000000..416fa16 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/silverfish.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/skeleton/skeleton.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/skeleton/skeleton.png new file mode 100644 index 0000000..184b585 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/skeleton/skeleton.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png new file mode 100644 index 0000000..b0db19d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/slime/magmacube.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/slime/magmacube.png new file mode 100644 index 0000000..c1b397f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/slime/magmacube.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/slime/slime.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/slime/slime.png new file mode 100644 index 0000000..96edcf6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/slime/slime.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/snowman.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/snowman.png new file mode 100644 index 0000000..568d5f6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/snowman.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider/cave_spider.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider/cave_spider.png new file mode 100644 index 0000000..934f1ea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider/cave_spider.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider/spider.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider/spider.png new file mode 100644 index 0000000..3a8c779 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider/spider.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider_eyes.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider_eyes.png new file mode 100644 index 0000000..6b80a06 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/spider_eyes.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/squid.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/squid.png new file mode 100644 index 0000000..f285388 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/squid.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/steve.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/steve.png new file mode 100644 index 0000000..90d4fa2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/steve.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/butcher.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/butcher.png new file mode 100644 index 0000000..f1c07d4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/butcher.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/farmer.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/farmer.png new file mode 100644 index 0000000..970c179 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/farmer.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/librarian.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/librarian.png new file mode 100644 index 0000000..b071cd3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/librarian.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/priest.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/priest.png new file mode 100644 index 0000000..35054ce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/priest.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/smith.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/smith.png new file mode 100644 index 0000000..965da7f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/smith.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/villager.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/villager.png new file mode 100644 index 0000000..52de8e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/villager/villager.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/witch.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/witch.png new file mode 100644 index 0000000..2403570 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/witch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither.png new file mode 100644 index 0000000..0882d05 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither_armor.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither_armor.png new file mode 100644 index 0000000..a6b5cf5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither_armor.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png new file mode 100644 index 0000000..717750b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf.png new file mode 100644 index 0000000..f37ef81 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png new file mode 100644 index 0000000..7891ce9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png new file mode 100644 index 0000000..ae1c920 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png new file mode 100644 index 0000000..f1236d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie/zombie.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie/zombie.png new file mode 100644 index 0000000..22ff8f9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie/zombie.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png new file mode 100644 index 0000000..349f9c2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie_pigman.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie_pigman.png new file mode 100644 index 0000000..e95cc4c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/entity/zombie_pigman.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/clouds.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/clouds.png new file mode 100644 index 0000000..a67c44d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/clouds.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/end_sky.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/end_sky.png new file mode 100644 index 0000000..094b309 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/end_sky.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/moon_phases.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/moon_phases.png new file mode 100644 index 0000000..cdba8d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/moon_phases.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/rain.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/rain.png new file mode 100644 index 0000000..2dc4b1c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/rain.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/snow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/snow.png new file mode 100644 index 0000000..1898903 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/snow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/sun.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/sun.png new file mode 100644 index 0000000..08de644 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/environment/sun.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/ascii.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/ascii.png new file mode 100644 index 0000000..587966d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/ascii.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/ascii_sga.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/ascii_sga.png new file mode 100644 index 0000000..f443b4a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/ascii_sga.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_00.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_00.png new file mode 100644 index 0000000..44fd12f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_00.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_01.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_01.png new file mode 100644 index 0000000..ddac030 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_01.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_02.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_02.png new file mode 100644 index 0000000..dc1335a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_02.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_03.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_03.png new file mode 100644 index 0000000..6ff0257 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_03.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_04.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_04.png new file mode 100644 index 0000000..be3e833 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_04.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_05.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_05.png new file mode 100644 index 0000000..9b58804 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_05.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_06.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_06.png new file mode 100644 index 0000000..ed74e78 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_06.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_07.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_07.png new file mode 100644 index 0000000..b532177 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_07.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_09.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_09.png new file mode 100644 index 0000000..083b911 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_09.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0a.png new file mode 100644 index 0000000..0190c11 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0b.png new file mode 100644 index 0000000..4d0af48 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0c.png new file mode 100644 index 0000000..773297d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0d.png new file mode 100644 index 0000000..5f52231 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0e.png new file mode 100644 index 0000000..531ca7d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0f.png new file mode 100644 index 0000000..7b879fc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_0f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_10.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_10.png new file mode 100644 index 0000000..53f056c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_10.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_11.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_11.png new file mode 100644 index 0000000..a9d5c11 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_12.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_12.png new file mode 100644 index 0000000..d20a864 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_12.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_13.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_13.png new file mode 100644 index 0000000..bbb0641 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_13.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_14.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_14.png new file mode 100644 index 0000000..ffd8e42 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_14.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_15.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_15.png new file mode 100644 index 0000000..ccfcae6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_15.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_16.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_16.png new file mode 100644 index 0000000..d02c557 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_16.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_17.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_17.png new file mode 100644 index 0000000..fed5b6e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_17.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_18.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_18.png new file mode 100644 index 0000000..97394d0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_18.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_19.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_19.png new file mode 100644 index 0000000..6929413 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_19.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1a.png new file mode 100644 index 0000000..d3a1b98 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1b.png new file mode 100644 index 0000000..9e0adf7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1c.png new file mode 100644 index 0000000..14d4890 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1d.png new file mode 100644 index 0000000..1924226 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1e.png new file mode 100644 index 0000000..cce20e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1f.png new file mode 100644 index 0000000..bdaf22f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_1f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_20.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_20.png new file mode 100644 index 0000000..ba948e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_20.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_21.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_21.png new file mode 100644 index 0000000..998f2f9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_21.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_22.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_22.png new file mode 100644 index 0000000..c3fd5dd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_22.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_23.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_23.png new file mode 100644 index 0000000..9c2b2dc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_23.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_24.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_24.png new file mode 100644 index 0000000..d6cc8ae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_24.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_25.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_25.png new file mode 100644 index 0000000..ee7535d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_25.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_26.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_26.png new file mode 100644 index 0000000..93aa960 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_26.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_27.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_27.png new file mode 100644 index 0000000..92f4501 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_27.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_28.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_28.png new file mode 100644 index 0000000..5f96e1b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_28.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_29.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_29.png new file mode 100644 index 0000000..4558220 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_29.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2a.png new file mode 100644 index 0000000..87e0e0c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2b.png new file mode 100644 index 0000000..722edf0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2c.png new file mode 100644 index 0000000..51830f7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2d.png new file mode 100644 index 0000000..dfafa53 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2e.png new file mode 100644 index 0000000..2aea04b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2f.png new file mode 100644 index 0000000..bff5f8e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_2f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_30.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_30.png new file mode 100644 index 0000000..5ccba75 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_30.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_31.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_31.png new file mode 100644 index 0000000..44fc5e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_31.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_32.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_32.png new file mode 100644 index 0000000..4858d08 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_32.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_33.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_33.png new file mode 100644 index 0000000..ab67072 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_33.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_34.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_34.png new file mode 100644 index 0000000..fd8fca9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_34.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_35.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_35.png new file mode 100644 index 0000000..603dc02 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_35.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_36.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_36.png new file mode 100644 index 0000000..778c190 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_36.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_37.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_37.png new file mode 100644 index 0000000..3032a23 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_37.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_38.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_38.png new file mode 100644 index 0000000..9b637bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_38.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_39.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_39.png new file mode 100644 index 0000000..2f93850 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_39.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3a.png new file mode 100644 index 0000000..cdf4944 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3b.png new file mode 100644 index 0000000..10e8502 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3c.png new file mode 100644 index 0000000..022fea5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3d.png new file mode 100644 index 0000000..01ea1d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3e.png new file mode 100644 index 0000000..3bdf7f8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3f.png new file mode 100644 index 0000000..3fd5249 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_3f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_40.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_40.png new file mode 100644 index 0000000..544f89e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_40.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_41.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_41.png new file mode 100644 index 0000000..729fdaf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_41.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_42.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_42.png new file mode 100644 index 0000000..755e546 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_42.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_43.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_43.png new file mode 100644 index 0000000..6069d0d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_43.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_44.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_44.png new file mode 100644 index 0000000..845c364 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_44.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_45.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_45.png new file mode 100644 index 0000000..294c78d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_45.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_46.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_46.png new file mode 100644 index 0000000..ee5e629 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_46.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_47.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_47.png new file mode 100644 index 0000000..55cb0c0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_47.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_48.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_48.png new file mode 100644 index 0000000..7652211 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_48.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_49.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_49.png new file mode 100644 index 0000000..b736232 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_49.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4a.png new file mode 100644 index 0000000..d3419bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4b.png new file mode 100644 index 0000000..5e02ad3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4c.png new file mode 100644 index 0000000..11c6b31 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4d.png new file mode 100644 index 0000000..3eb224a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4e.png new file mode 100644 index 0000000..11a78ba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4f.png new file mode 100644 index 0000000..b4c9fab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_4f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_50.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_50.png new file mode 100644 index 0000000..ff73d23 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_50.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_51.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_51.png new file mode 100644 index 0000000..6e0eae9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_51.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_52.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_52.png new file mode 100644 index 0000000..6f10fcb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_52.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_53.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_53.png new file mode 100644 index 0000000..60d478e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_53.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_54.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_54.png new file mode 100644 index 0000000..ac75bdd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_55.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_55.png new file mode 100644 index 0000000..3d122d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_55.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_56.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_56.png new file mode 100644 index 0000000..576d07f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_56.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_57.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_57.png new file mode 100644 index 0000000..545da73 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_57.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_58.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_58.png new file mode 100644 index 0000000..941542e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_58.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_59.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_59.png new file mode 100644 index 0000000..56f0102 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_59.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5a.png new file mode 100644 index 0000000..c14f1b1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5b.png new file mode 100644 index 0000000..f418e4c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5c.png new file mode 100644 index 0000000..e7efae6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5d.png new file mode 100644 index 0000000..7355fd3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5e.png new file mode 100644 index 0000000..abfd3af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5f.png new file mode 100644 index 0000000..5a64b50 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_5f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_60.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_60.png new file mode 100644 index 0000000..8166f15 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_60.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_61.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_61.png new file mode 100644 index 0000000..d11cd8a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_61.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_62.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_62.png new file mode 100644 index 0000000..f7b9a5b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_62.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_63.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_63.png new file mode 100644 index 0000000..5d4a8cc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_63.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_64.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_64.png new file mode 100644 index 0000000..bc43210 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_64.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_65.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_65.png new file mode 100644 index 0000000..42144c1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_65.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_66.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_66.png new file mode 100644 index 0000000..a65f25e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_66.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_67.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_67.png new file mode 100644 index 0000000..a115bb8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_67.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_68.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_68.png new file mode 100644 index 0000000..d47938b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_68.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_69.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_69.png new file mode 100644 index 0000000..c36e640 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_69.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6a.png new file mode 100644 index 0000000..5265d07 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6b.png new file mode 100644 index 0000000..6f207cc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6c.png new file mode 100644 index 0000000..6ffad7e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6d.png new file mode 100644 index 0000000..0fa88e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6e.png new file mode 100644 index 0000000..301513e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6f.png new file mode 100644 index 0000000..a24cfff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_6f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_70.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_70.png new file mode 100644 index 0000000..2cec746 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_70.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_71.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_71.png new file mode 100644 index 0000000..1592ff4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_71.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_72.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_72.png new file mode 100644 index 0000000..856eedc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_72.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_73.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_73.png new file mode 100644 index 0000000..a7a2151 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_73.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_74.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_74.png new file mode 100644 index 0000000..a1b034a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_74.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_75.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_75.png new file mode 100644 index 0000000..512dc16 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_75.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_76.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_76.png new file mode 100644 index 0000000..12a45ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_76.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_77.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_77.png new file mode 100644 index 0000000..d763fba Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_77.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_78.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_78.png new file mode 100644 index 0000000..846c060 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_78.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_79.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_79.png new file mode 100644 index 0000000..f887cae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_79.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7a.png new file mode 100644 index 0000000..90d5561 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7b.png new file mode 100644 index 0000000..2932cee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7c.png new file mode 100644 index 0000000..416a21b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7d.png new file mode 100644 index 0000000..2e12e13 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7e.png new file mode 100644 index 0000000..952bfab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7f.png new file mode 100644 index 0000000..d3d275c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_7f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_80.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_80.png new file mode 100644 index 0000000..044ac3e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_80.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_81.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_81.png new file mode 100644 index 0000000..913a4ca Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_81.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_82.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_82.png new file mode 100644 index 0000000..19b8ded Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_82.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_83.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_83.png new file mode 100644 index 0000000..ef2d794 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_83.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_84.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_84.png new file mode 100644 index 0000000..74a6a53 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_84.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_85.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_85.png new file mode 100644 index 0000000..73cb2f9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_85.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_86.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_86.png new file mode 100644 index 0000000..135d6fc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_86.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_87.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_87.png new file mode 100644 index 0000000..bef88db Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_87.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_88.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_88.png new file mode 100644 index 0000000..698ff80 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_88.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_89.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_89.png new file mode 100644 index 0000000..a3820ee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_89.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8a.png new file mode 100644 index 0000000..beb9024 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8b.png new file mode 100644 index 0000000..7f978ab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8c.png new file mode 100644 index 0000000..3ed4594 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8d.png new file mode 100644 index 0000000..8d79123 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8e.png new file mode 100644 index 0000000..d82000b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8f.png new file mode 100644 index 0000000..b8c8328 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_8f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_90.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_90.png new file mode 100644 index 0000000..132974b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_90.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_91.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_91.png new file mode 100644 index 0000000..b8e09ae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_91.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_92.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_92.png new file mode 100644 index 0000000..9244661 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_92.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_93.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_93.png new file mode 100644 index 0000000..f71d835 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_93.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_94.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_94.png new file mode 100644 index 0000000..fa68d81 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_94.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_95.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_95.png new file mode 100644 index 0000000..346bc36 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_95.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_96.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_96.png new file mode 100644 index 0000000..bbd1772 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_96.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_97.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_97.png new file mode 100644 index 0000000..2fd136b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_97.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_98.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_98.png new file mode 100644 index 0000000..9319c0b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_98.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_99.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_99.png new file mode 100644 index 0000000..2bb7f3e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_99.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9a.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9a.png new file mode 100644 index 0000000..cbdd91e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9a.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9b.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9b.png new file mode 100644 index 0000000..8a96209 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9b.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9c.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9c.png new file mode 100644 index 0000000..8e977ff Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9c.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9d.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9d.png new file mode 100644 index 0000000..5041d6a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9d.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9e.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9e.png new file mode 100644 index 0000000..1cb0a5b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9e.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9f.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9f.png new file mode 100644 index 0000000..d987326 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_9f.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a0.png new file mode 100644 index 0000000..8c47db0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a1.png new file mode 100644 index 0000000..5ede7e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a2.png new file mode 100644 index 0000000..a8c6ac1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a3.png new file mode 100644 index 0000000..7cc8448 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a4.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a4.png new file mode 100644 index 0000000..dc00e27 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a5.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a5.png new file mode 100644 index 0000000..eccfa47 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a6.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a6.png new file mode 100644 index 0000000..dcac87f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a7.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a7.png new file mode 100644 index 0000000..76c1ce2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a8.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a8.png new file mode 100644 index 0000000..a022390 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a9.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a9.png new file mode 100644 index 0000000..a35159a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_a9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_aa.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_aa.png new file mode 100644 index 0000000..da1b615 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_aa.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ab.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ab.png new file mode 100644 index 0000000..0e45eae Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ab.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ac.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ac.png new file mode 100644 index 0000000..04d4d59 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ac.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ad.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ad.png new file mode 100644 index 0000000..3834337 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ad.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ae.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ae.png new file mode 100644 index 0000000..1445e68 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ae.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_af.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_af.png new file mode 100644 index 0000000..ea945dc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_af.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b0.png new file mode 100644 index 0000000..84b4885 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b1.png new file mode 100644 index 0000000..5f64672 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b2.png new file mode 100644 index 0000000..8551db8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b3.png new file mode 100644 index 0000000..b954159 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b4.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b4.png new file mode 100644 index 0000000..65991a4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b5.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b5.png new file mode 100644 index 0000000..3e6391b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b6.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b6.png new file mode 100644 index 0000000..df7c0f7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b7.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b7.png new file mode 100644 index 0000000..9142cad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b8.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b8.png new file mode 100644 index 0000000..5b18d12 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b9.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b9.png new file mode 100644 index 0000000..0d212f0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_b9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ba.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ba.png new file mode 100644 index 0000000..696cca9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ba.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bb.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bb.png new file mode 100644 index 0000000..5a2544c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bb.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bc.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bc.png new file mode 100644 index 0000000..df37526 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bc.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bd.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bd.png new file mode 100644 index 0000000..aed7803 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bd.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_be.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_be.png new file mode 100644 index 0000000..0da2254 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_be.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bf.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bf.png new file mode 100644 index 0000000..1f6a248 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_bf.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c0.png new file mode 100644 index 0000000..0610d67 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c1.png new file mode 100644 index 0000000..a95ca9b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c2.png new file mode 100644 index 0000000..f6a8961 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c3.png new file mode 100644 index 0000000..6470dd8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c4.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c4.png new file mode 100644 index 0000000..e8c3105 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c5.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c5.png new file mode 100644 index 0000000..d89f288 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c6.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c6.png new file mode 100644 index 0000000..004091d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c7.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c7.png new file mode 100644 index 0000000..f64f6b4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c8.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c8.png new file mode 100644 index 0000000..75f8a50 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c8.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c9.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c9.png new file mode 100644 index 0000000..fbd9435 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_c9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ca.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ca.png new file mode 100644 index 0000000..112b9c6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ca.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cb.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cb.png new file mode 100644 index 0000000..c0549b5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cb.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cc.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cc.png new file mode 100644 index 0000000..0684431 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cc.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cd.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cd.png new file mode 100644 index 0000000..9fdc54d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cd.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ce.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ce.png new file mode 100644 index 0000000..958a96b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ce.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cf.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cf.png new file mode 100644 index 0000000..4106f1b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_cf.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d0.png new file mode 100644 index 0000000..546b014 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d1.png new file mode 100644 index 0000000..6d67bf1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d2.png new file mode 100644 index 0000000..c4ae511 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d3.png new file mode 100644 index 0000000..576c9ea Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d4.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d4.png new file mode 100644 index 0000000..14be6c7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d5.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d5.png new file mode 100644 index 0000000..3c41836 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d6.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d6.png new file mode 100644 index 0000000..27424b1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d6.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d7.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d7.png new file mode 100644 index 0000000..d8772d8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_d7.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_f9.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_f9.png new file mode 100644 index 0000000..e723235 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_f9.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fa.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fa.png new file mode 100644 index 0000000..d78dcfe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fa.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fb.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fb.png new file mode 100644 index 0000000..5423c86 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fb.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fc.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fc.png new file mode 100644 index 0000000..8034140 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fc.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fd.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fd.png new file mode 100644 index 0000000..c31bd6f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fd.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fe.png new file mode 100644 index 0000000..42ed33e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_fe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ff.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ff.png new file mode 100644 index 0000000..f0ff742 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/font/unicode_page_ff.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_background.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_background.png new file mode 100644 index 0000000..921bce0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_background.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png new file mode 100644 index 0000000..8c4ae79 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/book.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/book.png new file mode 100644 index 0000000..3e4ba4e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/book.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/compass.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/compass.png new file mode 100644 index 0000000..e2f91cf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/compass.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/anvil.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/anvil.png new file mode 100644 index 0000000..34e8f9f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/anvil.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/beacon.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/beacon.png new file mode 100644 index 0000000..f51a2ef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/beacon.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/brewing_stand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/brewing_stand.png new file mode 100644 index 0000000..e7dc203 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/brewing_stand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/crafting_table.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/crafting_table.png new file mode 100644 index 0000000..254dacc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/crafting_table.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png new file mode 100644 index 0000000..c8d53a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png new file mode 100644 index 0000000..cc250e5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png new file mode 100644 index 0000000..38421f7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png new file mode 100644 index 0000000..1c44093 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/dispenser.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/dispenser.png new file mode 100644 index 0000000..0a6ebe7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/dispenser.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/enchanting_table.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/enchanting_table.png new file mode 100644 index 0000000..5c71ff7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/enchanting_table.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/furnace.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/furnace.png new file mode 100644 index 0000000..2255d0a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/furnace.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/generic_54.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/generic_54.png new file mode 100644 index 0000000..0b880ef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/generic_54.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/hopper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/hopper.png new file mode 100644 index 0000000..3d00547 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/hopper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/horse.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/horse.png new file mode 100644 index 0000000..194cc6b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/horse.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/inventory.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/inventory.png new file mode 100644 index 0000000..d553c4f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/inventory.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/stats_icons.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/stats_icons.png new file mode 100644 index 0000000..f13323b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/stats_icons.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/villager.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/villager.png new file mode 100644 index 0000000..3211a7a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/container/villager.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/demo_background.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/demo_background.png new file mode 100644 index 0000000..a7fd8be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/demo_background.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/icons.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/icons.png new file mode 100644 index 0000000..89d780f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/icons.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/options_background.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/options_background.png new file mode 100644 index 0000000..cae5528 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/options_background.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/chaos.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/chaos.png new file mode 100644 index 0000000..438d078 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/chaos.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/delight.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/delight.png new file mode 100644 index 0000000..296cb88 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/delight.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/drought.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/drought.png new file mode 100644 index 0000000..b0d4f65 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/drought.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/isles.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/isles.png new file mode 100644 index 0000000..7503f6a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/isles.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/luck.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/luck.png new file mode 100644 index 0000000..26fac45 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/luck.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/madness.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/madness.png new file mode 100644 index 0000000..b0851a9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/madness.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/water.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/water.png new file mode 100644 index 0000000..275b4cd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/presets/water.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/resource_packs.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/resource_packs.png new file mode 100644 index 0000000..15a80bd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/resource_packs.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/server_selection.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/server_selection.png new file mode 100644 index 0000000..735469f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/server_selection.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/spectator_widgets.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/spectator_widgets.png new file mode 100644 index 0000000..9c3817e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/spectator_widgets.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/stream_indicator.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/stream_indicator.png new file mode 100644 index 0000000..b426b7e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/stream_indicator.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png new file mode 100644 index 0000000..27f015d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png new file mode 100644 index 0000000..c16841a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png new file mode 100644 index 0000000..0436d77 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png new file mode 100644 index 0000000..2c7ad77 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png new file mode 100644 index 0000000..0390096 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png new file mode 100644 index 0000000..0331ad4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/minecraft.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/minecraft.png new file mode 100644 index 0000000..c60927b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/minecraft.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/mojang.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/mojang.png new file mode 100644 index 0000000..a82cf6c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/title/mojang.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/widgets.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/widgets.png new file mode 100644 index 0000000..1a386c6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/gui/widgets.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/apple.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/apple.png new file mode 100644 index 0000000..3e2ee59 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/apple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/apple_golden.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/apple_golden.png new file mode 100644 index 0000000..6201989 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/apple_golden.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/arrow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/arrow.png new file mode 100644 index 0000000..4f748a0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/arrow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/banner_base.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/banner_base.png new file mode 100644 index 0000000..a074f2a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/banner_base.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/banner_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/banner_overlay.png new file mode 100644 index 0000000..560108f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/banner_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/barrier.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/barrier.png new file mode 100644 index 0000000..7ccfa7b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/barrier.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bed.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bed.png new file mode 100644 index 0000000..22a4cf0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bed.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/beef_cooked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/beef_cooked.png new file mode 100644 index 0000000..7bf0fb9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/beef_cooked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/beef_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/beef_raw.png new file mode 100644 index 0000000..82af4e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/beef_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/blaze_powder.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/blaze_powder.png new file mode 100644 index 0000000..89c57d6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/blaze_powder.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/blaze_rod.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/blaze_rod.png new file mode 100644 index 0000000..7050e10 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/blaze_rod.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/boat.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/boat.png new file mode 100644 index 0000000..235e0a2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/boat.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bone.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bone.png new file mode 100644 index 0000000..3faca89 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bone.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_enchanted.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_enchanted.png new file mode 100644 index 0000000..8742bee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_enchanted.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_normal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_normal.png new file mode 100644 index 0000000..f791ae4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_normal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_writable.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_writable.png new file mode 100644 index 0000000..fa95246 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_writable.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_written.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_written.png new file mode 100644 index 0000000..b2a2aa8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/book_written.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_0.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_0.png new file mode 100644 index 0000000..2022aab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_0.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_1.png new file mode 100644 index 0000000..a132079 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_2.png new file mode 100644 index 0000000..d459e68 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_pulling_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_standby.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_standby.png new file mode 100644 index 0000000..d709b9c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bow_standby.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bowl.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bowl.png new file mode 100644 index 0000000..63d16ad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bowl.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bread.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bread.png new file mode 100644 index 0000000..c833604 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bread.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/brewing_stand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/brewing_stand.png new file mode 100644 index 0000000..97db9af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/brewing_stand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/brick.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/brick.png new file mode 100644 index 0000000..11e74be Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/brick.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_empty.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_empty.png new file mode 100644 index 0000000..f8e5369 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_empty.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_lava.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_lava.png new file mode 100644 index 0000000..13a1957 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_lava.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_milk.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_milk.png new file mode 100644 index 0000000..c77d92c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_milk.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_water.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_water.png new file mode 100644 index 0000000..2f36acc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/bucket_water.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cake.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cake.png new file mode 100644 index 0000000..46e94b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cake.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot.png new file mode 100644 index 0000000..2d08aab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot_golden.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot_golden.png new file mode 100644 index 0000000..e0f1ea6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot_golden.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot_on_a_stick.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot_on_a_stick.png new file mode 100644 index 0000000..9e88571 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/carrot_on_a_stick.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cauldron.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cauldron.png new file mode 100644 index 0000000..e3186eb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cauldron.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_boots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_boots.png new file mode 100644 index 0000000..54a4a15 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_boots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_chestplate.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_chestplate.png new file mode 100644 index 0000000..cd2115a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_chestplate.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_helmet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_helmet.png new file mode 100644 index 0000000..a143338 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_helmet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_leggings.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_leggings.png new file mode 100644 index 0000000..dae4b26 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chainmail_leggings.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/charcoal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/charcoal.png new file mode 100644 index 0000000..20d5b25 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/charcoal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chicken_cooked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chicken_cooked.png new file mode 100644 index 0000000..890b5b3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chicken_cooked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chicken_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chicken_raw.png new file mode 100644 index 0000000..6d25922 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/chicken_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clay_ball.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clay_ball.png new file mode 100644 index 0000000..5103d6c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clay_ball.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clock.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clock.png new file mode 100644 index 0000000..069a0ab Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clock.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clock.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clock.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/clock.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/coal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/coal.png new file mode 100644 index 0000000..5563b6f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/coal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/comparator.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/comparator.png new file mode 100644 index 0000000..28b8eec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/comparator.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/compass.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/compass.png new file mode 100644 index 0000000..9dcbdfe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/compass.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/compass.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/compass.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/compass.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cookie.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cookie.png new file mode 100644 index 0000000..01fe56b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/cookie.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond.png new file mode 100644 index 0000000..10e70a0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_axe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_axe.png new file mode 100644 index 0000000..7627f87 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_axe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_boots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_boots.png new file mode 100644 index 0000000..70d9e5f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_boots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_chestplate.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_chestplate.png new file mode 100644 index 0000000..afdff93 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_chestplate.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_helmet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_helmet.png new file mode 100644 index 0000000..1c88592 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_helmet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_hoe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_hoe.png new file mode 100644 index 0000000..c9a97e0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_hoe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_horse_armor.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_horse_armor.png new file mode 100644 index 0000000..b281aad Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_horse_armor.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_leggings.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_leggings.png new file mode 100644 index 0000000..a99c896 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_leggings.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_pickaxe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_pickaxe.png new file mode 100644 index 0000000..c279828 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_pickaxe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_shovel.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_shovel.png new file mode 100644 index 0000000..e4a8992 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_shovel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_sword.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_sword.png new file mode 100644 index 0000000..2a1552d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/diamond_sword.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_acacia.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_acacia.png new file mode 100644 index 0000000..c903484 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_acacia.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_birch.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_birch.png new file mode 100644 index 0000000..7c88c41 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_birch.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_dark_oak.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_dark_oak.png new file mode 100644 index 0000000..7862d9a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_dark_oak.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_iron.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_iron.png new file mode 100644 index 0000000..b6715ed Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_iron.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_jungle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_jungle.png new file mode 100644 index 0000000..cb3753d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_jungle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_spruce.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_spruce.png new file mode 100644 index 0000000..4eddb7e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_spruce.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_wood.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_wood.png new file mode 100644 index 0000000..20b9be6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/door_wood.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_black.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_black.png new file mode 100644 index 0000000..909bea5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_black.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_blue.png new file mode 100644 index 0000000..4713983 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_brown.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_brown.png new file mode 100644 index 0000000..62eae8d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_brown.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_cyan.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_cyan.png new file mode 100644 index 0000000..7b10c11 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_cyan.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_gray.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_gray.png new file mode 100644 index 0000000..4fce7e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_gray.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_green.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_green.png new file mode 100644 index 0000000..009e058 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_green.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_light_blue.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_light_blue.png new file mode 100644 index 0000000..a8b45c9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_light_blue.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_lime.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_lime.png new file mode 100644 index 0000000..7a78764 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_lime.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_magenta.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_magenta.png new file mode 100644 index 0000000..ea7342a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_magenta.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_orange.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_orange.png new file mode 100644 index 0000000..677a1aa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_orange.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_pink.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_pink.png new file mode 100644 index 0000000..1acc483 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_pink.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_purple.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_purple.png new file mode 100644 index 0000000..7d201c2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_purple.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_red.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_red.png new file mode 100644 index 0000000..2d1a742 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_red.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_silver.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_silver.png new file mode 100644 index 0000000..fa9e501 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_silver.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_white.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_white.png new file mode 100644 index 0000000..5b1833b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_white.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_yellow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_yellow.png new file mode 100644 index 0000000..95e0673 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/dye_powder_yellow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/egg.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/egg.png new file mode 100644 index 0000000..a6fe2bf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/egg.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/emerald.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/emerald.png new file mode 100644 index 0000000..98d953e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/emerald.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png new file mode 100644 index 0000000..fd7e05f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png new file mode 100644 index 0000000..6e632b9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png new file mode 100644 index 0000000..3a455f3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png new file mode 100644 index 0000000..28b2c49 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ender_eye.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ender_eye.png new file mode 100644 index 0000000..8c4ef4e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ender_eye.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ender_pearl.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ender_pearl.png new file mode 100644 index 0000000..4b752a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ender_pearl.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/experience_bottle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/experience_bottle.png new file mode 100644 index 0000000..ae4214f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/experience_bottle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/feather.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/feather.png new file mode 100644 index 0000000..d4c3be5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/feather.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireball.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireball.png new file mode 100644 index 0000000..d62a6f4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireball.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks.png new file mode 100644 index 0000000..f1e07fd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks_charge.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks_charge.png new file mode 100644 index 0000000..5c89362 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks_charge.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png new file mode 100644 index 0000000..d8b91a9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_clownfish_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_clownfish_raw.png new file mode 100644 index 0000000..41df72f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_clownfish_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_cod_cooked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_cod_cooked.png new file mode 100644 index 0000000..87564c7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_cod_cooked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_cod_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_cod_raw.png new file mode 100644 index 0000000..32996bf Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_cod_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png new file mode 100644 index 0000000..aadbd88 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_salmon_cooked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_salmon_cooked.png new file mode 100644 index 0000000..fb765ed Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_salmon_cooked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_salmon_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_salmon_raw.png new file mode 100644 index 0000000..68bcd69 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fish_salmon_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fishing_rod_cast.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fishing_rod_cast.png new file mode 100644 index 0000000..a5ab378 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fishing_rod_cast.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fishing_rod_uncast.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fishing_rod_uncast.png new file mode 100644 index 0000000..d4b53f0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/fishing_rod_uncast.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flint.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flint.png new file mode 100644 index 0000000..5f51093 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flint.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flint_and_steel.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flint_and_steel.png new file mode 100644 index 0000000..77bc340 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flint_and_steel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flower_pot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flower_pot.png new file mode 100644 index 0000000..c4f26d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/flower_pot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ghast_tear.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ghast_tear.png new file mode 100644 index 0000000..e5c741f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ghast_tear.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/glowstone_dust.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/glowstone_dust.png new file mode 100644 index 0000000..edd93a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/glowstone_dust.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_axe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_axe.png new file mode 100644 index 0000000..0f47b60 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_axe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_boots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_boots.png new file mode 100644 index 0000000..f6033d2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_boots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_chestplate.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_chestplate.png new file mode 100644 index 0000000..e36076a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_chestplate.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_helmet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_helmet.png new file mode 100644 index 0000000..9eb89a0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_helmet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_hoe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_hoe.png new file mode 100644 index 0000000..1685d47 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_hoe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_horse_armor.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_horse_armor.png new file mode 100644 index 0000000..7c5c3a5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_horse_armor.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_ingot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_ingot.png new file mode 100644 index 0000000..ea781e7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_ingot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_leggings.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_leggings.png new file mode 100644 index 0000000..da23771 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_leggings.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_nugget.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_nugget.png new file mode 100644 index 0000000..3a9a2fe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_nugget.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_pickaxe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_pickaxe.png new file mode 100644 index 0000000..ecccafe Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_pickaxe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_shovel.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_shovel.png new file mode 100644 index 0000000..150cbb9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_shovel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_sword.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_sword.png new file mode 100644 index 0000000..0ddef04 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gold_sword.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gunpowder.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gunpowder.png new file mode 100644 index 0000000..73cadec Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/gunpowder.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/hopper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/hopper.png new file mode 100644 index 0000000..f8b244f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/hopper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_axe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_axe.png new file mode 100644 index 0000000..8bf133e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_axe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_boots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_boots.png new file mode 100644 index 0000000..b69ca05 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_boots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_chestplate.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_chestplate.png new file mode 100644 index 0000000..e7993ce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_chestplate.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_helmet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_helmet.png new file mode 100644 index 0000000..65e64cc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_helmet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_hoe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_hoe.png new file mode 100644 index 0000000..28d4c36 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_hoe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_horse_armor.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_horse_armor.png new file mode 100644 index 0000000..5d697d1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_horse_armor.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_ingot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_ingot.png new file mode 100644 index 0000000..3833fa0 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_ingot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_leggings.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_leggings.png new file mode 100644 index 0000000..ad53673 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_leggings.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_pickaxe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_pickaxe.png new file mode 100644 index 0000000..d21440b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_pickaxe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_shovel.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_shovel.png new file mode 100644 index 0000000..079b236 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_shovel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_sword.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_sword.png new file mode 100644 index 0000000..4d49c5a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/iron_sword.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/item_frame.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/item_frame.png new file mode 100644 index 0000000..261c98a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/item_frame.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/lead.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/lead.png new file mode 100644 index 0000000..0ef5312 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/lead.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather.png new file mode 100644 index 0000000..13dc199 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_boots.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_boots.png new file mode 100644 index 0000000..61d7198 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_boots.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_boots_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_boots_overlay.png new file mode 100644 index 0000000..b6896d8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_boots_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_chestplate.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_chestplate.png new file mode 100644 index 0000000..e534aef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_chestplate.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png new file mode 100644 index 0000000..125fd34 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_helmet.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_helmet.png new file mode 100644 index 0000000..6f64763 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_helmet.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_helmet_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_helmet_overlay.png new file mode 100644 index 0000000..8040d77 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_helmet_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_leggings.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_leggings.png new file mode 100644 index 0000000..c2d3f03 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_leggings.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_leggings_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_leggings_overlay.png new file mode 100644 index 0000000..813ba26 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/leather_leggings_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/magma_cream.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/magma_cream.png new file mode 100644 index 0000000..b2be210 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/magma_cream.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/map_empty.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/map_empty.png new file mode 100644 index 0000000..8dc6e58 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/map_empty.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/map_filled.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/map_filled.png new file mode 100644 index 0000000..1381e21 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/map_filled.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/melon.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/melon.png new file mode 100644 index 0000000..590f47a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/melon.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/melon_speckled.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/melon_speckled.png new file mode 100644 index 0000000..dee1bf5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/melon_speckled.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_chest.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_chest.png new file mode 100644 index 0000000..78a3778 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_chest.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_command_block.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_command_block.png new file mode 100644 index 0000000..c597ee7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_command_block.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_furnace.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_furnace.png new file mode 100644 index 0000000..5478f25 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_furnace.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_hopper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_hopper.png new file mode 100644 index 0000000..8a138fb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_hopper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_normal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_normal.png new file mode 100644 index 0000000..2046f2b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_normal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_tnt.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_tnt.png new file mode 100644 index 0000000..561279b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/minecart_tnt.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mushroom_stew.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mushroom_stew.png new file mode 100644 index 0000000..5598bc7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mushroom_stew.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mutton_cooked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mutton_cooked.png new file mode 100644 index 0000000..e1b62dc Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mutton_cooked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mutton_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mutton_raw.png new file mode 100644 index 0000000..1222ff4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/mutton_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/name_tag.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/name_tag.png new file mode 100644 index 0000000..a88f559 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/name_tag.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/nether_star.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/nether_star.png new file mode 100644 index 0000000..6b848af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/nether_star.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/nether_wart.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/nether_wart.png new file mode 100644 index 0000000..09da1e3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/nether_wart.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/netherbrick.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/netherbrick.png new file mode 100644 index 0000000..e9c14ed Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/netherbrick.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/painting.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/painting.png new file mode 100644 index 0000000..b394f30 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/painting.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/paper.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/paper.png new file mode 100644 index 0000000..a1d9c7e Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/paper.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/porkchop_cooked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/porkchop_cooked.png new file mode 100644 index 0000000..605d3f5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/porkchop_cooked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/porkchop_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/porkchop_raw.png new file mode 100644 index 0000000..7e83c1a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/porkchop_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato.png new file mode 100644 index 0000000..c1d8541 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato_baked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato_baked.png new file mode 100644 index 0000000..e4d765b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato_baked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato_poisonous.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato_poisonous.png new file mode 100644 index 0000000..6f154af Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potato_poisonous.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_empty.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_empty.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_empty.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_splash.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_splash.png new file mode 100644 index 0000000..03b1f90 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_bottle_splash.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_overlay.png new file mode 100644 index 0000000..61864e9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/potion_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/prismarine_crystals.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/prismarine_crystals.png new file mode 100644 index 0000000..7cf87d5 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/prismarine_crystals.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/prismarine_shard.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/prismarine_shard.png new file mode 100644 index 0000000..4030b4c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/prismarine_shard.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/pumpkin_pie.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/pumpkin_pie.png new file mode 100644 index 0000000..c21a032 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/pumpkin_pie.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/quartz.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/quartz.png new file mode 100644 index 0000000..e403446 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/quartz.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/quiver.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/quiver.png new file mode 100644 index 0000000..818f728 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/quiver.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_cooked.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_cooked.png new file mode 100644 index 0000000..49657c3 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_cooked.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_foot.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_foot.png new file mode 100644 index 0000000..f7d9140 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_foot.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_hide.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_hide.png new file mode 100644 index 0000000..516b899 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_hide.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_raw.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_raw.png new file mode 100644 index 0000000..4b54135 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_raw.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_stew.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_stew.png new file mode 100644 index 0000000..93e83e6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rabbit_stew.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_11.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_11.png new file mode 100644 index 0000000..07ac487 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_11.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_13.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_13.png new file mode 100644 index 0000000..ead0c61 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_13.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_blocks.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_blocks.png new file mode 100644 index 0000000..3732d6c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_blocks.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_cat.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_cat.png new file mode 100644 index 0000000..b3527ef Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_cat.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_chirp.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_chirp.png new file mode 100644 index 0000000..1b24e11 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_chirp.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_far.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_far.png new file mode 100644 index 0000000..2320efd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_far.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_mall.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_mall.png new file mode 100644 index 0000000..811d046 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_mall.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_mellohi.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_mellohi.png new file mode 100644 index 0000000..879b6a4 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_mellohi.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_stal.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_stal.png new file mode 100644 index 0000000..c650d21 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_stal.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_strad.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_strad.png new file mode 100644 index 0000000..72d6e32 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_strad.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_wait.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_wait.png new file mode 100644 index 0000000..5306b51 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_wait.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_ward.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_ward.png new file mode 100644 index 0000000..b33b93d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/record_ward.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/redstone_dust.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/redstone_dust.png new file mode 100644 index 0000000..6da938b Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/redstone_dust.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/reeds.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/reeds.png new file mode 100644 index 0000000..40872c6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/reeds.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/repeater.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/repeater.png new file mode 100644 index 0000000..7a07381 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/repeater.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rotten_flesh.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rotten_flesh.png new file mode 100644 index 0000000..3f39998 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/rotten_flesh.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ruby.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ruby.png new file mode 100644 index 0000000..4f288d9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/ruby.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/saddle.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/saddle.png new file mode 100644 index 0000000..b12eafa Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/saddle.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_melon.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_melon.png new file mode 100644 index 0000000..ef84499 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_melon.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_pumpkin.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_pumpkin.png new file mode 100644 index 0000000..8d8f076 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_pumpkin.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_wheat.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_wheat.png new file mode 100644 index 0000000..83d23a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/seeds_wheat.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/shears.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/shears.png new file mode 100644 index 0000000..f9c6de1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/shears.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/sign.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/sign.png new file mode 100644 index 0000000..9b6e2ee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/sign.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/slimeball.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/slimeball.png new file mode 100644 index 0000000..46478ee Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/slimeball.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/snowball.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/snowball.png new file mode 100644 index 0000000..340c639 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/snowball.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spawn_egg.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spawn_egg.png new file mode 100644 index 0000000..26cc6b2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spawn_egg.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spawn_egg_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spawn_egg_overlay.png new file mode 100644 index 0000000..83ec78f Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spawn_egg_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spider_eye.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spider_eye.png new file mode 100644 index 0000000..35d8584 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spider_eye.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spider_eye_fermented.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spider_eye_fermented.png new file mode 100644 index 0000000..226ffb8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/spider_eye_fermented.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stick.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stick.png new file mode 100644 index 0000000..6f8ce13 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stick.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_axe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_axe.png new file mode 100644 index 0000000..fb33584 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_axe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_hoe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_hoe.png new file mode 100644 index 0000000..d46b272 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_hoe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_pickaxe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_pickaxe.png new file mode 100644 index 0000000..19a8e50 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_pickaxe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_shovel.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_shovel.png new file mode 100644 index 0000000..8e1c0c2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_shovel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_sword.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_sword.png new file mode 100644 index 0000000..5810dfd Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/stone_sword.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/string.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/string.png new file mode 100644 index 0000000..0b04ddb Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/string.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/sugar.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/sugar.png new file mode 100644 index 0000000..0864df9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/sugar.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wheat.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wheat.png new file mode 100644 index 0000000..bbd2fd9 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wheat.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_axe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_axe.png new file mode 100644 index 0000000..3a19203 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_axe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_hoe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_hoe.png new file mode 100644 index 0000000..de1c7a6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_hoe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_pickaxe.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_pickaxe.png new file mode 100644 index 0000000..ebc6756 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_pickaxe.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_shovel.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_shovel.png new file mode 100644 index 0000000..b057911 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_shovel.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_sword.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_sword.png new file mode 100644 index 0000000..c04dc0a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wood_sword.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wooden_armorstand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wooden_armorstand.png new file mode 100644 index 0000000..6d27c47 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/items/wooden_armorstand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/map/map_background.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/map/map_background.png new file mode 100644 index 0000000..2783b50 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/map/map_background.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/map/map_icons.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/map/map_icons.png new file mode 100644 index 0000000..c2f35b8 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/map/map_icons.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png new file mode 100644 index 0000000..f9ca97c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta new file mode 100644 index 0000000..e38a5ad --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta @@ -0,0 +1,5 @@ +{ + "texture": { + "blur": true + } +} diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/forcefield.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/forcefield.png new file mode 100644 index 0000000..3129f07 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/forcefield.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png new file mode 100644 index 0000000..d9725ce Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/shadow.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/shadow.png new file mode 100644 index 0000000..b09fd47 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/shadow.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/shadow.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/shadow.png.mcmeta new file mode 100644 index 0000000..8c6c7d1 --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/shadow.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "clamp": true + } +} + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/underwater.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/underwater.png new file mode 100644 index 0000000..2fc23b1 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/underwater.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/unknown_pack.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/unknown_pack.png new file mode 100644 index 0000000..16afade Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/unknown_pack.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/unknown_server.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/unknown_server.png new file mode 100644 index 0000000..16afade Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/unknown_server.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/vignette.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/vignette.png new file mode 100644 index 0000000..9c14e2d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/vignette.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/vignette.png.mcmeta b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/vignette.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/Client-1.8.9/src/main/resources/assets/minecraft/textures/misc/vignette.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png new file mode 100644 index 0000000..9f84c18 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png new file mode 100644 index 0000000..117811c Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png new file mode 100644 index 0000000..14fecf2 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png new file mode 100644 index 0000000..2cca056 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_1.png new file mode 100644 index 0000000..6802e06 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_2.png new file mode 100644 index 0000000..a7cf835 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_1.png new file mode 100644 index 0000000..6da6e84 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_2.png new file mode 100644 index 0000000..fab422a Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1.png new file mode 100644 index 0000000..ebcfc41 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png new file mode 100644 index 0000000..546397d Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2.png new file mode 100644 index 0000000..8d8bba6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png new file mode 100644 index 0000000..5655659 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png new file mode 100644 index 0000000..d7df7f6 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/particle/footprint.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/particle/footprint.png new file mode 100644 index 0000000..8d23f64 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/particle/footprint.png differ diff --git a/Client-1.8.9/src/main/resources/assets/minecraft/textures/particle/particles.png b/Client-1.8.9/src/main/resources/assets/minecraft/textures/particle/particles.png new file mode 100644 index 0000000..eec1f89 Binary files /dev/null and b/Client-1.8.9/src/main/resources/assets/minecraft/textures/particle/particles.png differ diff --git a/Client-1.8.9/src/main/resources/log4j2.xml b/Client-1.8.9/src/main/resources/log4j2.xml new file mode 100644 index 0000000..fd51570 --- /dev/null +++ b/Client-1.8.9/src/main/resources/log4j2.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Client-1.8.9/src/main/resources/pack.png b/Client-1.8.9/src/main/resources/pack.png new file mode 100644 index 0000000..cfaa986 Binary files /dev/null and b/Client-1.8.9/src/main/resources/pack.png differ diff --git a/Client-1.8.9/src/test/java/Start.java b/Client-1.8.9/src/test/java/Start.java new file mode 100644 index 0000000..4a255ba --- /dev/null +++ b/Client-1.8.9/src/test/java/Start.java @@ -0,0 +1,59 @@ +import net.minecraft.client.main.Main; + +import java.io.File; +import java.util.Arrays; + +public class Start { + public static void main(final String[] args) { + String userHome = System.getProperty("user.home", "."); + File workingDirectory; + switch (getPlatform()) { + case LINUX: + workingDirectory = new File(userHome, ".minecraft/"); + break; + case WINDOWS: + String applicationData = System.getenv("APPDATA"); + String folder = applicationData != null ? applicationData : userHome; + workingDirectory = new File(folder, ".minecraft/"); + break; + case MACOS: + workingDirectory = new File(userHome, "Library/Application Support/minecraft"); + break; + default: + workingDirectory = new File(userHome, "minecraft/"); + } + + Main.main(concat(new String[] { + "--username", "Aplosh", + "--uuid", "a4434163-f43e-4b17-98f2-3b08ee4f5513", + "--accessToken", "0", + "--version", "CheatBreaker", + "--assetIndex", "1.8", + "--userProperties", "{}", + "--gameDir", new File(workingDirectory, ".").getAbsolutePath(), + "--assetsDir", new File(workingDirectory, "assets/").getAbsolutePath() + }, args)); + } + + public static T[] concat(final T[] first, final T[] second) { + final T[] result = Arrays.copyOf(first, first.length + second.length); + System.arraycopy(second, 0, result, first.length, second.length); + return result; + } + + private static OS getPlatform() { + String os = System.getProperty("os.name").toLowerCase(); + return os.contains("win") ? OS.WINDOWS : + (os.contains("mac") ? OS.MACOS : + (os.contains("solaris") || os.contains("sunos") ? OS.SOLARIS : + (os.contains("linux") || os.contains("unix") ? OS.LINUX : OS.UNKNOWN))); + } + + public enum OS { + LINUX, + MACOS, + SOLARIS, + UNKNOWN, + WINDOWS + } +} diff --git a/Tellinq-CB-1.7.10/.gitignore b/Tellinq-CB-1.7.10/.gitignore new file mode 100644 index 0000000..d568741 --- /dev/null +++ b/Tellinq-CB-1.7.10/.gitignore @@ -0,0 +1,41 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Intellij Project Files +/.idea/ +/out/ +*.iml +.idea/ +# Testing +/target/ +/logs/ +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/README.md b/Tellinq-CB-1.7.10/README.md new file mode 100644 index 0000000..ed2e83a --- /dev/null +++ b/Tellinq-CB-1.7.10/README.md @@ -0,0 +1,2 @@ +## CheatBreaker Remap +A remapped version of June 17th 2018 CheatBreaker diff --git a/Tellinq-CB-1.7.10/natives/CBAgent.dll b/Tellinq-CB-1.7.10/natives/CBAgent.dll new file mode 100644 index 0000000..21168b2 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/CBAgent.dll differ diff --git a/Tellinq-CB-1.7.10/natives/OpenAL32.dll b/Tellinq-CB-1.7.10/natives/OpenAL32.dll new file mode 100644 index 0000000..1f69e94 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/OpenAL32.dll differ diff --git a/Tellinq-CB-1.7.10/natives/OpenAL64.dll b/Tellinq-CB-1.7.10/natives/OpenAL64.dll new file mode 100644 index 0000000..6f2a2fe Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/OpenAL64.dll differ diff --git a/Tellinq-CB-1.7.10/natives/avutil-ttv-51.dll b/Tellinq-CB-1.7.10/natives/avutil-ttv-51.dll new file mode 100644 index 0000000..fc9a3a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/avutil-ttv-51.dll differ diff --git a/Tellinq-CB-1.7.10/natives/graphics-hook64.dll b/Tellinq-CB-1.7.10/natives/graphics-hook64.dll new file mode 100644 index 0000000..f8d2122 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/graphics-hook64.dll differ diff --git a/Tellinq-CB-1.7.10/natives/jinput-dx8.dll b/Tellinq-CB-1.7.10/natives/jinput-dx8.dll new file mode 100644 index 0000000..bf3fe90 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/jinput-dx8.dll differ diff --git a/Tellinq-CB-1.7.10/natives/jinput-dx8_64.dll b/Tellinq-CB-1.7.10/natives/jinput-dx8_64.dll new file mode 100644 index 0000000..a56d9a7 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/jinput-dx8_64.dll differ diff --git a/Tellinq-CB-1.7.10/natives/jinput-raw.dll b/Tellinq-CB-1.7.10/natives/jinput-raw.dll new file mode 100644 index 0000000..1131d47 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/jinput-raw.dll differ diff --git a/Tellinq-CB-1.7.10/natives/jinput-raw_64.dll b/Tellinq-CB-1.7.10/natives/jinput-raw_64.dll new file mode 100644 index 0000000..38e1c10 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/jinput-raw_64.dll differ diff --git a/Tellinq-CB-1.7.10/natives/jinput-wintab.dll b/Tellinq-CB-1.7.10/natives/jinput-wintab.dll new file mode 100644 index 0000000..e075ec3 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/jinput-wintab.dll differ diff --git a/Tellinq-CB-1.7.10/natives/libmfxsw64.dll b/Tellinq-CB-1.7.10/natives/libmfxsw64.dll new file mode 100644 index 0000000..8314f02 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/libmfxsw64.dll differ diff --git a/Tellinq-CB-1.7.10/natives/libmp3lame-ttv.dll b/Tellinq-CB-1.7.10/natives/libmp3lame-ttv.dll new file mode 100644 index 0000000..803ad5a Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/libmp3lame-ttv.dll differ diff --git a/Tellinq-CB-1.7.10/natives/lwjgl.dll b/Tellinq-CB-1.7.10/natives/lwjgl.dll new file mode 100644 index 0000000..6e9b49d Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/lwjgl.dll differ diff --git a/Tellinq-CB-1.7.10/natives/lwjgl64.dll b/Tellinq-CB-1.7.10/natives/lwjgl64.dll new file mode 100644 index 0000000..3c9b8e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/lwjgl64.dll differ diff --git a/Tellinq-CB-1.7.10/natives/swresample-ttv-0.dll b/Tellinq-CB-1.7.10/natives/swresample-ttv-0.dll new file mode 100644 index 0000000..a7729c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/swresample-ttv-0.dll differ diff --git a/Tellinq-CB-1.7.10/natives/twitchsdk.dll b/Tellinq-CB-1.7.10/natives/twitchsdk.dll new file mode 100644 index 0000000..f21d426 Binary files /dev/null and b/Tellinq-CB-1.7.10/natives/twitchsdk.dll differ diff --git a/Tellinq-CB-1.7.10/obf/Mappings.jar b/Tellinq-CB-1.7.10/obf/Mappings.jar new file mode 100644 index 0000000..51b8cbe Binary files /dev/null and b/Tellinq-CB-1.7.10/obf/Mappings.jar differ diff --git a/Tellinq-CB-1.7.10/obf/Transformer.jar b/Tellinq-CB-1.7.10/obf/Transformer.jar new file mode 100644 index 0000000..00387d7 Binary files /dev/null and b/Tellinq-CB-1.7.10/obf/Transformer.jar differ diff --git a/Tellinq-CB-1.7.10/pom.xml b/Tellinq-CB-1.7.10/pom.xml new file mode 100644 index 0000000..c1929e7 --- /dev/null +++ b/Tellinq-CB-1.7.10/pom.xml @@ -0,0 +1,377 @@ + + + 4.0.0 + + com.cheatbreaker + CheatBreaker + Production + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + 8 + 8 + + **/Start.java + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + + pl.project13.maven + git-commit-id-plugin + 2.2.4 + + + get-the-git-infos + + revision + + initialize + + + validate-the-git-infos + + validateRevision + + package + + + + true + ${project.build.outputDirectory}/assets/minecraft/client/properties/app.properties + + ^git.commit.(id.abbrev|id)$ + ^git.(branch$|build.version$) + + + + + exec-maven-plugin + org.codehaus.mojo + + + Jar Transformer + package + exec + + ${basedir}\target + java + + -jar + ${basedir}\obf\Transformer.jar + obf + --input + ${project.build.finalName}.jar + --output + ${project.build.finalName}-T.jar + + + + + ProGuard Mapping Dictionary + package + exec + + ${basedir}\target + java + + -jar + ${basedir}\obf\Mappings.jar + + + + + + + com.github.wvengen + proguard-maven-plugin + + + package + proguard + + + + true + ${project.build.finalName}-T.jar + ${project.build.finalName}.jar + ${project.build.directory} + ${basedir}/proguard.conf + + + + + + + + + + + + + + + ${java.home}/lib/rt.jar + ${java.home}/lib/jsse.jar + + + + + + + + + minecraft-repo + https://libraries.minecraft.net/ + + + + + + + com.googlecode.soundlibs + jlayer + 1.0.1-1 + + + org.projectlombok + lombok + 1.18.12 + provided + + + org.java-websocket + Java-WebSocket + 1.4.1 + compile + + + net.sf.trove4j + trove4j + 3.0.1 + provided + + + oshi-project + oshi-core + 1.1 + provided + + + org.json + json + 20211205 + compile + + + net.java.dev.jna + jna + 3.4.0 + provided + + + net.java.dev.jna + platform + 3.4.0 + provided + + + com.ibm.icu + icu4j + 51.2 + provided + + + net.sf.jopt-simple + jopt-simple + 4.6 + provided + + + com.paulscode + codecjorbis + 20101023 + provided + + + com.paulscode + codecwav + 20101023 + provided + + + com.paulscode + libraryjavasound + 20101123 + provided + + + com.paulscode + librarylwjglopenal + 20100824 + provided + + + com.paulscode + soundsystem + 20120107 + provided + + + io.netty + netty-all + 4.0.10.Final + provided + + + com.google.guava + guava + 17.0 + provided + + + org.apache.commons + commons-lang3 + 3.3.2 + provided + + + commons-io + commons-io + 2.4 + provided + + + commons-codec + commons-codec + 1.9 + provided + + + net.java.jinput + jinput + 2.0.5 + provided + + + net.java.jutils + jutils + 1.0.0 + provided + + + com.google.code.gson + gson + 2.2.4 + provided + + + org.apache.commons + commons-compress + 1.8.1 + provided + + + org.apache.httpcomponents + httpclient + 4.3.3 + provided + + + commons-logging + commons-logging + 1.1.3 + provided + + + org.apache.httpcomponents + httpcore + 4.3.2 + provided + + + org.apache.logging.log4j + log4j-api + 2.0-beta9 + provided + + + org.apache.logging.log4j + log4j-core + 2.0-beta9 + provided + + + org.lwjgl.lwjgl + lwjgl + 2.9.4-nightly-20150209 + provided + + + org.lwjgl.lwjgl + lwjgl_util + 2.9.4-nightly-20150209 + provided + + + com.mojang + realms + 1.3.5 + provided + + + com.mojang + authlib + 1.5.21 + provided + + + tv.twitch + twitch + 5.16 + provided + + + javax.vecmath + vecmath + 1.5.2 + provided + + + com.jagrosh + DiscordIPC + 0.4 + compile + + + com.github.wvengen + proguard-maven-plugin + 2.5.2 + provided + + + com.cheatbreaker.bridge + Bridge + 1.0.0 + + + \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/CheatBreaker.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/CheatBreaker.java new file mode 100644 index 0000000..14d7e56 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/CheatBreaker.java @@ -0,0 +1,583 @@ +package com.cheatbreaker.client; +import com.cheatbreaker.client.audio.AudioManager; +import com.cheatbreaker.client.config.ConfigManager; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.cosmetic.CosmeticManager; +import com.cheatbreaker.client.cosmetic.EmoteManager; +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.event.impl.*; +import com.cheatbreaker.client.module.ModuleManager; +import com.cheatbreaker.client.network.messages.Message; +import com.cheatbreaker.client.network.plugin.CBNetHandler; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientKeySync; +import com.cheatbreaker.client.audio.music.DashManager; +import com.cheatbreaker.client.ui.element.profile.ProfilesListElement; +import com.cheatbreaker.client.ui.mainmenu.menus.ChangelogMenu; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import com.cheatbreaker.client.util.data.DataUtil; +import com.cheatbreaker.client.util.discord.DiscordRPCHandler; +import com.cheatbreaker.client.util.friend.Friend; +import com.cheatbreaker.client.util.friend.FriendsManager; +import com.cheatbreaker.client.util.data.JSONReader; +import com.cheatbreaker.client.util.sessionserver.SessionServer; +import com.cheatbreaker.client.util.thread.ServerStatusThread; +import com.cheatbreaker.client.util.render.title.TitleManager; +import com.cheatbreaker.client.util.render.worldborder.WorldBorderManager; +import com.google.common.collect.ImmutableList; +import com.google.gson.JsonParser; +import com.jagrosh.discordipc.IPCClient; +import com.jagrosh.discordipc.IPCListener; +import com.jagrosh.discordipc.entities.RichPresence; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.resources.SimpleReloadableResourceManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Session; +import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.sound.sampled.*; +import java.io.*; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +@Getter @Setter +public class CheatBreaker { + @Getter private static CheatBreaker instance; + private final Minecraft mc = Minecraft.getMinecraft(); + + private final Map headIconCache = new HashMap<>(); + + private final List consoleLines = new ArrayList<>(); + private final List presetLocations = new ArrayList<>(); + public List sessionServers = new ArrayList<>(); + + public List sessions = new ArrayList<>(); + public List profiles = new ArrayList<>(); + + private final String cheatBreakerPluginMessageChannel = "CB-Client"; + private final String lunarPluginMessageChannel = "Lunar-Client"; + private final String latestLunarPluginMessageChannel = "lunarclient:pm"; + private final String pluginBinaryChannel = "CB-Binary"; + private final String loggerPrefix = "[CB] "; + private String gitCommitIdAbbrev = "?"; + private String gitBranch = "?"; + private String gitCommitId = "?"; + private String gitBuildVersion = "?"; + private String currentServer; + + private final long startTime; + + private boolean consoleAccess; + private boolean acceptingFriendRequests = true; + private final boolean confidentialBuild = false; + private final boolean aprilFools = false; + + public static byte[] processlistbytes = new byte[]{86, 79, 84, 69, 32, 84, 82, 85, 77, 80, 32, 50, 48, 50, 48, 33}; + public static AudioFormat universalAudioFormat = new AudioFormat(8000.0f, 16, 1, true, true); + + public Profile activeProfile; + + private final GlobalSettings globalSettings; + private final CBNetHandler cbNetHandler; + public ConfigManager configManager; + private final EventBus eventBus; + private WSNetHandler wsNetHandler; + private final ModuleManager moduleManager; + private final CosmeticManager cosmeticManager; + private final EmoteManager emoteManager; + private final AudioManager audioManager; + private final FriendsManager friendsManager; + private final DashManager dashManager; + private final TitleManager titleManager; + private final WorldBorderManager worldBorderManager; + private final ProfileHandler profileHandler; + + private IPCClient rpcClient; + private Friend.Status playerStatus = Friend.Status.ONLINE; + + public CBFontRenderer playBold22px; + public CBFontRenderer playRegular22px; + public CBFontRenderer ubuntuMedium16px; + public CBFontRenderer ubuntuMedium14px; + public CBFontRenderer playBold18px; + public CBFontRenderer robotoRegular24px; + public CBFontRenderer playRegular18px; + public CBFontRenderer playRegular14px; + public CBFontRenderer playRegular16px; + public CBFontRenderer robotoRegular13px; + public CBFontRenderer robotoBold14px; + public CBFontRenderer playRegular12px; + + private final ResourceLocation playBold = new ResourceLocation("client/font/Play-Bold.ttf"); + private final ResourceLocation robotoRegular = new ResourceLocation("client/font/Roboto-Regular.ttf"); + private final ResourceLocation robotoBold = new ResourceLocation("client/font/Roboto-Bold.ttf"); + private final ResourceLocation playRegular = new ResourceLocation("client/font/Play-Regular.ttf"); + private final ResourceLocation ubuntuMedium = new ResourceLocation("client/font/Ubuntu-M.ttf"); + public static ResourceLocation icontexture; + + public final Logger logger; + + public CheatBreaker() throws IOException { + logger = LogManager.getLogger("CheatBreaker Setup"); + this.startTime = System.currentTimeMillis(); + this.logger.info(this.loggerPrefix + "Starting CheatBreaker setup"); + instance = this; + + this.mc.cbLoadingScreen.updatePhase("Settings"); + this.globalSettings = new GlobalSettings(); + this.logger.info(this.loggerPrefix + "Created settings"); + + this.mc.cbLoadingScreen.updatePhase("EventBus"); + this.eventBus = new EventBus(); + this.logger.info(this.loggerPrefix + "Created EventBus"); + + this.mc.cbLoadingScreen.updatePhase("Mods"); + this.moduleManager = new ModuleManager(this.eventBus); + this.logger.info(this.loggerPrefix + "Created Mod Manager"); + + this.mc.cbLoadingScreen.updatePhase("Network Manager"); + this.cbNetHandler = new CBNetHandler(); + this.logger.info(this.loggerPrefix + "Created Network Manager"); + + this.mc.cbLoadingScreen.updatePhase("Cosmetics"); + this.cosmeticManager = new CosmeticManager(); + this.emoteManager = new EmoteManager(); + this.logger.info(this.loggerPrefix + "Created Cosmetic Managers"); + + this.mc.cbLoadingScreen.updatePhase("Radio"); + this.dashManager = new DashManager(); + this.audioManager = new AudioManager(); + this.logger.info(this.loggerPrefix + "Created Dash Manager"); + + this.mc.cbLoadingScreen.updatePhase("Friends"); + this.friendsManager = new FriendsManager(); + this.logger.info(this.loggerPrefix + "Created Friends Manager"); + + this.mc.cbLoadingScreen.updatePhase("Titles"); + this.titleManager = new TitleManager(); + this.logger.info(this.loggerPrefix + "Created Title Manager"); + + try { + ChangelogMenu.changelogObject = new JsonParser().parse(new BufferedReader(new InputStreamReader(JSONReader.readAsBrowser(new URL("https://noxiuam.gq/cheatbreaker/changelog"), true), StandardCharsets.UTF_8))).getAsJsonObject(); + } catch (Exception e) { + e.printStackTrace(); + CheatBreaker.getInstance().getLogger().error(CheatBreaker.getInstance().getLoggerPrefix() + "Failed to load changelog."); + } + + this.mc.cbLoadingScreen.updatePhase("World Border"); + this.worldBorderManager = new WorldBorderManager(); + this.logger.info(this.loggerPrefix + "Created Friend Manager"); + + this.profileHandler = new ProfileHandler(); + this.logger.info(this.loggerPrefix + "Created Profile Handler"); + + + this.mc.cbLoadingScreen.updatePhase("Network Events"); + EventBus eventBus = this.eventBus; + CBNetHandler netHandler = this.cbNetHandler; + eventBus.addEvent(DisconnectEvent.class, netHandler::onDisconnect); + eventBus.addEvent(ConnectEvent.class, netHandler::onConnect); + eventBus.addEvent(PluginMessageEvent.class, netHandler::onPluginMessage); + eventBus.addEvent(ClickStateEvent.class, netHandler::onClickEvent); + +// eventBus.addEvent(GuiDrawEvent.class, this.titleManager::onGuiDrawEvent); +// eventBus.addEvent(TickEvent.class, this.titleManager::onTickEvent); + this.logger.info(this.loggerPrefix + "Registered network events"); + + SimpleReloadableResourceManager.updatepack(); + } + + private void addMics() { + Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo(); + for (Mixer.Info info : mixerInfos) { + Mixer m = AudioSystem.getMixer(info); + Line.Info[] lineInfos = m.getTargetLineInfo(); + if (lineInfos.length >= 1 && lineInfos[0].getLineClass().equals(TargetDataLine.class)) { + if (info == null) continue; + Message.g(new String[]{info.getDescription()}, new String[]{info.getName()}); + } + } + } + + public void initialize() { + this.mc.cbLoadingScreen.updatePhase("Fonts"); + this.loadFonts(); + this.logger.info(this.loggerPrefix + "Loaded all fonts"); + + this.mc.cbLoadingScreen.updatePhase("Properties"); + this.loadVersionData(); + this.logger.info(this.loggerPrefix + "Loaded client properties"); + + this.mc.cbLoadingScreen.updatePhase("Profiles"); + this.createDefaultConfigPresets(); + this.logger.info(this.loggerPrefix + "Created default configuration presets"); + this.loadProfiles(); + this.logger.info(this.loggerPrefix + "Loaded " + this.profiles.size() + " custom profiles"); + + this.mc.cbLoadingScreen.updatePhase("Session"); + this.addSessionServers(); + this.logger.info(this.loggerPrefix + "Loaded mojang session status entries"); + + this.mc.cbLoadingScreen.updatePhase("Configs"); + this.configManager = new ConfigManager(); + this.configManager.read(); + this.logger.info(this.loggerPrefix + "Loaded configuration"); + + this.mc.cbLoadingScreen.updatePhase("Overlay"); + OverlayGui.setInstance(new OverlayGui()); + this.logger.info(this.loggerPrefix + "Loaded Overlay Gui"); + + this.mc.cbLoadingScreen.updatePhase("Player Assets"); + try { + this.logger.info(this.loggerPrefix + "Connecting to player assets server"); + this.connectToAssetServer(); + } catch (Exception ex) { + ex.printStackTrace(); + } + + this.mc.cbLoadingScreen.updatePhase("Session Server"); + ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); + ServerStatusThread sessionPinger = new ServerStatusThread(); + scheduler.scheduleAtFixedRate(sessionPinger, 0L, this.globalSettings.sessionCheckInteral, TimeUnit.SECONDS); + this.logger.info(this.loggerPrefix + "Scheduled session server status updates"); + + this.mc.cbLoadingScreen.updatePhase("Finishing"); + this.getModuleManager().keystrokesMod.updateKeyElements(); + this.mc.cbLoadingScreen.addPhase(); + this.logger.info(this.loggerPrefix + "Finished startup in " + (System.currentTimeMillis() - this.startTime) + "ms!"); + consoleAccess = true; + new Thread(() -> { + try { + while (true) { + try { + if (this.wsNetHandler != null) { + this.wsNetHandler.sendPacket(new WSPacketClientKeySync()); + } + } catch (Exception var3) { + var3.printStackTrace(); + } + Thread.sleep(30000L); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + }).start(); + try { + String os = System.getProperty("os.name").toLowerCase(); + if (os.contains("win") && this.getGlobalSettings().showRPC.getBooleanValue()) { + this.mc.cbLoadingScreen.addPhase(); + this.connectDiscordIPC(); + } + } catch (Exception e) { + e.printStackTrace(); + } + + + this.mc.cbLoadingScreen.addPhase(); + eventBus.handleEvent(new InitializationEvent()); + } + + public void updateServerInfo(String server) { + if (this.getGlobalSettings().showRPC.getBooleanValue()) { + if (this.getGlobalSettings().showServer.getBooleanValue()) { + this.updateRPC(DiscordRPCHandler.getServerName(this.currentServer)[3] != null ? DiscordRPCHandler.getServerName(this.currentServer)[3] : server, DiscordRPCHandler.getServerName(this.currentServer)); + } else { + this.updateRPC(server, new String[]{"Minecraft " + Config.MC_VERSION, "cb", "Minecraft " + Config.MC_VERSION}); + } + } + + } + + /** + * Creates a new IPC Client for Discord RPC usage. + */ + public void connectDiscordIPC() { + try { + (this.rpcClient = new IPCClient(925912458353340447L)).setListener(new IPCListener() { + @Override + public void onReady(IPCClient client) { + CheatBreaker.getInstance().rpcClient = client; + CheatBreaker.getInstance().updateRPC(Minecraft.getMinecraft().getSession().getUsername(), DiscordRPCHandler.getServerName(CheatBreaker.getInstance().currentServer)); + } + }); + this.rpcClient.connect(); + this.logger.info(this.loggerPrefix + "Connected to Discord IPC"); + } catch (Exception e) { + this.logger.error(this.loggerPrefix + "Failed to connect to Discord IPC"); + } + } + + /** + * Updates the Discord RPC. + */ + public void updateRPC(String state, String[] serverName) { + try { + if (this.rpcClient != null) { + RichPresence.Builder var8 = new RichPresence.Builder(); + var8.setState(state).setDetails(serverName[2]).setStartTimestamp(OffsetDateTime.now()).setLargeImage(serverName[1], serverName[0]); + this.rpcClient.sendRichPresence(var8.build()); + } + } catch (Exception ignore) { + this.logger.error(this.loggerPrefix + "RPC was unable to be found"); + } + } + + public void updateWSServer(String server, String ip, int port) { + try { + this.currentServer = server; + if (this.getGlobalSettings().showAccount.getBooleanValue()) { + this.updateServerInfo(this.mc.getSession().getUsername()); + } else { + this.updateServerInfo(null); + } + +// boolean equals = server.equals(ip + ":" + port); +// this.updateTheRPC(server, null, equals); + + } catch (Exception | UnsatisfiedLinkError e) { + e.printStackTrace(); + } + boolean equals = server.equals(ip + ":" + port); +// this.updateTheRPC(server, null, equals); + if (!equals) { + this.wsNetHandler.sendUpdateServer(server); + this.currentServer = (server.isEmpty() ? "In-Menus" : server); + } else { + this.wsNetHandler.sendUpdateServer("server"); + this.currentServer = "server"; + } +// if (!server.equals(ip + ":" + port)) { +// this.wsNetHandler.sendUpdateServer(server); +// } else { +// this.wsNetHandler.sendUpdateServer("server"); +// } + } + + /** + * Gets the player's current friends list status. + */ + public String getStatusString() { + switch (this.playerStatus) { + case AWAY: + return "Away"; + case BUSY: + return "Busy"; + case OFFLINE: + return "Offline"; + default: + return "Online"; + } + } + + /** + * Connects to the Player Assets Server. + */ + public void connectToAssetServer() throws URISyntaxException { + HashMap data = new HashMap<>(); + data.put("username", this.mc.getSession().getUsername()); + data.put("playerId", this.mc.getSession().getPlayerID()); + data.put("HWID", DataUtil.getHWID()); + data.put("version", Config.MC_VERSION); + data.put("gitCommit", this.getGitCommitId()); + data.put("branch", this.getGitBranch()); + data.put("buildType", this.getGitBuildVersion()); + + if (this.currentServer != null) + data.put("server", this.currentServer); + + this.wsNetHandler = new WSNetHandler(new URI("ws://server.noxiuam.gq/connect"), data); + this.wsNetHandler.connect(); + } + + /** + * Loads the current version data. + */ + private void loadVersionData() { + try { + ResourceLocation propertiesFile = new ResourceLocation("client/properties/app.properties"); + Properties property = new Properties(); + InputStream fileInputStream = this.mc.getResourceManager().getResource(propertiesFile).getInputStream(); + if (fileInputStream == null) { + return; + } + property.load(fileInputStream); + fileInputStream.close(); + gitCommitIdAbbrev = property.getProperty("git.commit.id.abbrev"); + gitCommitId = property.getProperty("git.commit.id"); + gitBranch = property.getProperty("git.branch"); + gitBuildVersion = property.getProperty("git.build.version"); + } catch (IOException var4) { + var4.printStackTrace(); + } + } + + /** + * Registers the session servers for periodic checking. + */ + private void addSessionServers() { + this.sessionServers.add(new SessionServer("Session", "session.minecraft.net")); + this.sessionServers.add(new SessionServer("Login", "authserver.mojang.com")); + this.sessionServers.add(new SessionServer("Account", "account.mojang.com")); + this.sessionServers.add(new SessionServer("API", "api.mojang.com")); + } + + private void createDefaultConfigPresets() { + File mainDir = new File(this.mc.mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + this.gitBranch); + File profiles = new File(mainDir + File.separator + "profiles"); + if (!mainDir.exists()) { + mainDir.mkdirs(); + File masterDir = new File(this.mc.mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-master"); + File first189Dir = new File(this.mc.mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION.replaceAll("\\.", "_")); + File legacyDir = new File(this.mc.mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client"); + File firstDir = new File(this.mc.mcDataDir + File.separator + "config" + File.separator + "client"); + File dupDir = null; + List directories = ImmutableList.of(firstDir, legacyDir, first189Dir, masterDir); + for (File directory : directories) { + if (directory.exists()) { + dupDir = directory; + } + } + + if (dupDir != null) { + try { + FileUtils.copyDirectory(dupDir, mainDir); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + +// this.presetLocations.add(new ResourceLocation("client/presets/Preset 1.cfg")); + if (profiles.exists() || profiles.mkdirs()) { + for (ResourceLocation presets : this.presetLocations) { + String presetsName = presets.getResourcePath().replaceAll("([a-zA-Z0-9/]+)/", ""); + File presetsFile = new File(profiles, presetsName); + if (presetsFile.exists()) continue; + try { + InputStream presetInputStream = this.mc.getResourceManager().getResource(presets).getInputStream(); + Files.copy(presetInputStream, presetsFile.toPath()); + presetInputStream.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + } + + /** + * Returns the scale factor for module scaling. + */ + public static float getScaleFactor() { + ScaledResolution var4 = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); + if (getInstance().getGlobalSettings().scaleModsDownSmallerResoltion.getBooleanValue()) { + switch (Minecraft.getMinecraft().gameSettings.guiScale) { + case 0: + return 2.0f; + case 1: + return 0.5f; + case 2: + return 1.0f; + case 3: + return 1.5f; + } + } else { + return var4.getScaleFactor() / 2.0F; + } + return 1.0f; + } + + private void loadProfiles() { + this.profiles.add(new Profile("default", true)); + File profilesDir = new File(this.mc.mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch() + File.separator + "profiles"); + if (profilesDir.exists()) { + for (File profile : Objects.requireNonNull(profilesDir.listFiles())) { + this.mc.cbLoadingScreen.addPhase(); + if (!profile.getName().endsWith(".cfg")) continue; + this.profiles.add(new Profile(profile.getName().replace(".cfg", ""), false)); + } + } + } + + /** + * Loads the CheatBreaker fonts for rendering. + */ + private void loadFonts() { + this.playBold22px = new CBFontRenderer(playBold, 22.0f); + this.playRegular22px = new CBFontRenderer(this.playRegular, 22.0f); + this.playRegular18px = new CBFontRenderer(this.playRegular, 18.0f); + this.playRegular14px = new CBFontRenderer(this.playRegular, 14.0f); + this.playRegular12px = new CBFontRenderer(this.playRegular, 12.0f); + this.playRegular16px = new CBFontRenderer(this.playRegular, 16.0f); + this.playBold18px = new CBFontRenderer(playBold, 18.0f); + this.ubuntuMedium16px = new CBFontRenderer(ubuntuMedium, 16.0f); + this.ubuntuMedium14px = new CBFontRenderer(ubuntuMedium, 14.0f); + this.robotoRegular13px = new CBFontRenderer(robotoRegular, 13.0f); + this.robotoBold14px = new CBFontRenderer(robotoBold, 14.0f); + this.robotoRegular24px = new CBFontRenderer(robotoRegular, 24.0f); + } + + private String getNewProfileName(String name) { + File clientDir = new File(this.mc.mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch()); + File profilesDir = new File(clientDir + File.separator + "profiles"); + if ((profilesDir.exists() || profilesDir.mkdirs()) && new File(profilesDir + File.separator + name + ".cfg").exists()) { + return this.getNewProfileName(name + "1"); + } + return name; + } + + public void createNewProfile() { + if (this.activeProfile == this.profiles.get(0)) + { + Profile defaultProfile; + CheatBreaker.getInstance().activeProfile = defaultProfile = new Profile(this.getNewProfileName("Profile 1"), false); + CheatBreaker.getInstance().profiles.add(defaultProfile); + CheatBreaker.getInstance().configManager.write(); + if (this.mc.currentScreen instanceof HudLayoutEditorGui) + + { + ProfilesListElement profilesList = (ProfilesListElement) ((HudLayoutEditorGui) this.mc.currentScreen).profilesElement; + profilesList.loadProfiles(); + } + } + } + + /** + * Returns the ResourceLocation of the player avatar for the account switcher. + */ + public ResourceLocation getHeadIcon(String name, String uuid) { + ResourceLocation headIcon = this.headIconCache.getOrDefault(name, new ResourceLocation("client/heads/" + name + ".png")); + + if (!this.headIconCache.containsKey(name)) { + ThreadDownloadImageData var4 = new ThreadDownloadImageData(null, "https://minotar.net/helm/" + name + + "/32.png", new ResourceLocation("client/defaults/steve.png"), null); + this.mc.renderEngine.loadTexture(headIcon, var4); + this.headIconCache.put(name, headIcon); + } + + return headIcon; + } + + public WSNetHandler getWSNetHandler() { + return this.wsNetHandler; + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/AudioManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/AudioManager.java new file mode 100644 index 0000000..6882d8b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/AudioManager.java @@ -0,0 +1,69 @@ +package com.cheatbreaker.client.audio; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.messages.Message; +import lombok.Getter; +import net.minecraft.client.Minecraft; + +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Line; +import javax.sound.sampled.Mixer; +import javax.sound.sampled.TargetDataLine; +import java.util.ArrayList; +import java.util.List; + +@Getter +public class AudioManager { + + private final List microphones = new ArrayList<>(); + + public void playSound(String name) { + this.playSoundVol(name, 1.0f); + } + + public void playSoundVol(String name, float volume) { + if (!(Boolean) CheatBreaker.getInstance().getGlobalSettings().muteCBSounds.getValue()) + Minecraft.getMinecraft().getSoundHandler().field_147694_f.playSound(name, volume); + } + + /** + * Registers the current system enabled Microphones for Voice Chat. + */ + private void registerSystemMicrophones() { + Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo(); + for (Mixer.Info micInfo : mixerInfos) { + Line.Info[] micLine = AudioSystem.getMixer(micInfo).getTargetLineInfo(); + + if (micLine.length >= 1 && micLine[0].getLineClass().equals(TargetDataLine.class)) { + if (micInfo == null) continue; + Message.g(new String[]{micInfo.getDescription()}, new String[]{micInfo.getName()}); + } + } + } + + /** + * Returns all registered Microphones in the form of a String Array. + */ + public String[] getMicrophoneArray() { + String[] microphones = new String[this.microphones.size()]; + int index = 0; + for (Microphone microphone : this.microphones) { + microphones[index] = microphone.getName().replace("Primary Sound Capture Driver", "Default"); + ++index; + } + return microphones; + } + + /** + * Returns a given Microphone based on its name. + */ + public Microphone getMicrophone(String name) { + for (Microphone mic : this.microphones) { + if (mic.getName().equalsIgnoreCase(name)) { + return mic; + } + } + return null; + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/Microphone.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/Microphone.java new file mode 100644 index 0000000..a46d21e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/Microphone.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.audio; + +public class Microphone { + private final String description; + private final String name; + + public Microphone(String description, String name) { + this.description = description; + this.name = name; + } + + public String getDescription() { + return this.description; + } + + public String getName() { + return this.name; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/DashManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/DashManager.java new file mode 100644 index 0000000..2d4e62b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/DashManager.java @@ -0,0 +1,57 @@ +package com.cheatbreaker.client.audio.music; + + +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.audio.music.threads.DashThread; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.audio.music.threads.DashQueueThread; + +import java.util.List; + +public class DashManager { + private final List stations = DashUtil.dashHelpers(); + private final DashQueueThread dashQueueThread = new DashQueueThread(); + private final DashThread dashThread; + private Station station; + + public DashManager() { + this.dashQueueThread.start(); + this.dashThread = new DashThread(); + this.dashThread.start(); + if (this.stations.size() > 0) { + this.station = this.stations.get(0); + this.dashQueueThread.offerStation(this.station); + } + } + + public void setStation(Station station) { + station.endStream(); + this.station = station; + } + + public void endStream() { + if (this.station != null) { + this.station.endStream(); + } + } + + public List getStations() { + return this.stations; + } + + public DashQueueThread getDashQueueThread() { + return this.dashQueueThread; + } + + public DashThread getDashThread() { + return this.dashThread; + } + + public Station getCurrentStation() { + return this.station; + } + + public void setCurrentStation(Station station) { + this.station = station; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/audio/DashAudioDevice.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/audio/DashAudioDevice.java new file mode 100644 index 0000000..9f5a8a6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/audio/DashAudioDevice.java @@ -0,0 +1,142 @@ +package com.cheatbreaker.client.audio.music.audio; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.DataLine; +import javax.sound.sampled.FloatControl; +import javax.sound.sampled.Line; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.SourceDataLine; + +import com.cheatbreaker.client.CheatBreaker; +import javazoom.jl.decoder.Decoder; +import javazoom.jl.decoder.JavaLayerException; +import javazoom.jl.player.AudioDeviceBase; + +public class DashAudioDevice extends AudioDeviceBase { + private SourceDataLine sourceDataLine = null; + private AudioFormat audioFormat = null; + private byte[] byteArray = new byte[4096]; + + protected void setAudioFormat(AudioFormat audioFormat) { + this.audioFormat = audioFormat; + } + + protected AudioFormat getAudioFormat() { + if (this.audioFormat == null) { + Decoder decoder = this.getDecoder(); + this.audioFormat = new AudioFormat(decoder.getOutputFrequency(), 16, decoder.getOutputChannels(), true, false); + } + return this.audioFormat; + } + + protected DataLine.Info getInfo() { + AudioFormat format = this.getAudioFormat(); + return new DataLine.Info(SourceDataLine.class, format); + } + + public void open(AudioFormat var1) { + if (!this.isOpen()) { + this.setAudioFormat(var1); + this.openImpl(); + this.setOpen(true); + } + } + + @Override + protected void openImpl() { + } + + protected void start() throws JavaLayerException { + Throwable throwable = null; + try { + Line line = AudioSystem.getLine(this.getInfo()); + if (line instanceof SourceDataLine) { + this.sourceDataLine = (SourceDataLine)line; + this.sourceDataLine.open(this.audioFormat); + this.sourceDataLine.start(); + this.setFloatControlValue((float) (Integer) CheatBreaker.getInstance().getGlobalSettings().radioVolume.getValue()); + } + } catch (RuntimeException | LineUnavailableException | LinkageError var3) { + throwable = var3; + } + if (this.sourceDataLine == null) { + throw new JavaLayerException("cannot obtain source audio line", throwable); + } + } + + public int millisecondsToBytes(AudioFormat var1, int var2) { + return (int)((double)((float)var2 * var1.getSampleRate() * (float)var1.getChannels() * (float)var1.getSampleSizeInBits()) / 8000.0); + } + + @Override + protected void closeImpl() { + if (this.sourceDataLine != null) { + this.sourceDataLine.close(); + } + } + + @Override + protected void writeImpl(short[] var1, int var2, int var3) throws JavaLayerException { + if (this.sourceDataLine == null) { + this.start(); + } + byte[] var4 = this.toByteArray(var1, var2, var3); + this.sourceDataLine.write(var4, 0, var3 * 2); + } + + protected byte[] getByteArray(int var1) { + if (this.byteArray.length < var1) { + this.byteArray = new byte[var1 + 1024]; + } + return this.byteArray; + } + + protected byte[] toByteArray(short[] var1, int var2, int var3) { + byte[] var4 = this.getByteArray(var3 * 2); + int var6 = 0; + while (var3-- > 0) { + short var5 = var1[var2++]; + var4[var6++] = (byte)var5; + var4[var6++] = (byte)(var5 >>> 8); + } + return var4; + } + + @Override + protected void flushImpl() { + if (this.sourceDataLine != null) { + this.sourceDataLine.drain(); + } + } + + @Override + public int getPosition() { + int var1 = 0; + if (this.sourceDataLine != null) { + var1 = (int)(this.sourceDataLine.getMicrosecondPosition() / 1000L); + } + return var1; + } + + public void test() throws JavaLayerException { + try { + this.open(new AudioFormat(22050.0f, 16, 1, true, false)); + short[] var1 = new short[2205]; + this.write(var1, 0, var1.length); + this.flush(); + this.close(); + } catch (RuntimeException var2) { + throw new JavaLayerException("Device test failed: " + var2); + } + } + + public void setFloatControlValue(float value) { + if (this.sourceDataLine != null) { + FloatControl control = (FloatControl)this.sourceDataLine.getControl(FloatControl.Type.MASTER_GAIN); + float diff = control.getMaximum() - control.getMinimum(); + float volume = diff * (value / 100.0f) + control.getMinimum(); + control.setValue(volume); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/audio/DashHook.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/audio/DashHook.java new file mode 100644 index 0000000..27ad907 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/audio/DashHook.java @@ -0,0 +1,24 @@ +package com.cheatbreaker.client.audio.music.audio; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import com.cheatbreaker.client.network.agent.AgentResources; +import javazoom.jl.decoder.JavaLayerHook; +import javazoom.jl.decoder.JavaLayerUtils; + +public class DashHook implements JavaLayerHook { + @Override + public InputStream getResourceAsStream(String string) { + Class class_ = JavaLayerUtils.class; + InputStream inputStream = class_.getResourceAsStream(string); + if (inputStream == null) { + String string2 = "javazoom/jl/decoder/" + string; + System.out.println("Retrieving: " + string2); + if (AgentResources.existsBytes(string2)) { + inputStream = new ByteArrayInputStream(AgentResources.getBytesNative(string2)); + } + } + return inputStream; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/data/Station.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/data/Station.java new file mode 100644 index 0000000..a5bc007 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/data/Station.java @@ -0,0 +1,185 @@ +package com.cheatbreaker.client.audio.music.data; + +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; +import java.util.TimeZone; +import javax.xml.parsers.DocumentBuilderFactory; + +import com.cheatbreaker.client.audio.music.util.DashUtil; +import net.minecraft.util.ResourceLocation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class Station { + private final String streamURL; + private final String currentSongURL; + private final String genre; + private final String logoURL; + private final String name; + private boolean favourite; + private LocalDateTime startTime; + private String title; + private String artist; + private String album; + private String coverURL = ""; + private int duration; + public ResourceLocation currentResource; + public ResourceLocation previousResource; + public boolean play; + + public Station(String name, String logoURL, String genre, String currentSongURL, String streamURL) { + this.name = name; + this.logoURL = logoURL; + this.genre = genre; + this.currentSongURL = currentSongURL; + this.streamURL = streamURL; + } + + public void endStream() { + DashUtil.end(DashUtil.get(this.streamURL)); + } + + public void getData() { + try { + Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(this.getCurrentSongURL()); + NodeList nodeList = document.getElementsByTagName("playlist"); + for (int i = 0; i < nodeList.getLength(); ++i) { + Node node = nodeList.item(i); + Element element = (Element)node; + this.setTitle(this.getElement(element, "title")); + this.setArtist(this.getElement(element, "artist")); + this.setAlbum(this.getElement(element, "album")); + this.setCoverURL(this.getElement(element, "cover")); + this.setDuration(Integer.parseInt(this.getElement(element, "duration"))); + String programStartTS = this.getElement(element, "programStartTS"); + String dateFormat = "dd MMM yy hh:mm:ss"; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + if (this.currentResource != null && !("client/songs/" + this.getTitle()).equals(this.currentResource.getResourcePath())) { + this.previousResource = this.currentResource; + this.currentResource = null; + } + try { + Date date = simpleDateFormat.parse(programStartTS); + this.setStartTime(LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault())); + continue; + } catch (Exception exception) { + exception.printStackTrace(); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + if (this.play) { + this.play = false; + this.endStream(); + } + } + + private String getElement(Element element, String string) { + try { + NodeList nodeList = element.getElementsByTagName(string); + Element element2 = (Element)nodeList.item(0); + NodeList nodeList2 = element2.getChildNodes(); + return nodeList2.item(0).getNodeValue().trim(); + } catch (Exception exception) { + return ""; + } + } + + public String getStreamURL() { + return this.streamURL; + } + + public String getCurrentSongURL() { + return this.currentSongURL; + } + + public String getGenre() { + return this.genre; + } + + public String getLogoURL() { + return this.logoURL; + } + + public String getName() { + return this.name; + } + + public boolean isFavourite() { + return this.favourite; + } + + public LocalDateTime getStartTime() { + return this.startTime; + } + + public String getTitle() { + return this.title; + } + + public String getArtist() { + return this.artist; + } + + public String getAlbum() { + return this.album; + } + + public String getCoverURL() { + return this.coverURL; + } + + public int getDuration() { + return this.duration; + } + + public ResourceLocation getCurrentResource() { + return this.currentResource; + } + + public ResourceLocation getPreviousResource() { + return this.previousResource; + } + + public boolean isPlay() { + return this.play; + } + + public String toString() { + return "Station(streamUrl=" + this.getStreamURL() + ", currentSongUrl=" + this.getCurrentSongURL() + ", genre=" + this.getGenre() + ", logoUrl=" + this.getLogoURL() + ", name=" + this.getName() + ", favorite=" + this.isFavourite() + ", startTime=" + this.getStartTime() + ", title=" + this.getTitle() + ", artist=" + this.getArtist() + ", album=" + this.getAlbum() + ", coverUrl=" + this.getCoverURL() + ", duration=" + this.getDuration() + ", RESOURCE_CURRENT=" + this.getCurrentResource() + ", RESOURCE_PREVIOUS=" + this.getPreviousResource() + ", play=" + this.isPlay() + ")"; + } + + public void setFavourite(boolean bl) { + this.favourite = bl; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public void setTitle(String title) { + this.title = title; + } + + public void setArtist(String artist) { + this.artist = artist; + } + + public void setAlbum(String album) { + this.album = album; + } + + public void setCoverURL(String coverURL) { + this.coverURL = coverURL; + } + + public void setDuration(int duration) { + this.duration = duration; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioElement.java new file mode 100644 index 0000000..cb32df5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioElement.java @@ -0,0 +1,254 @@ +package com.cheatbreaker.client.audio.music.elements; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import com.cheatbreaker.client.*; +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.ui.element.DraggableElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.HorizontalSliderElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RadioElement extends DraggableElement { + private final ResourceLocation dashIcon = new ResourceLocation("client/dash-logo-54.png"); + private final ResourceLocation playIcon = new ResourceLocation("client/icons/play-24.png"); + private final List radioStationElements; + private final MinMaxFade fadeTime = new MinMaxFade(300L); + private float newHeight; + private boolean isFading; + private final HorizontalSliderElement volumeSlider; + private final ScrollableElement scrollbar; + private final InputFieldElement filterTextField; + private final FlatButtonElement pinButton; + + public RadioElement() { + this.volumeSlider = new HorizontalSliderElement(CheatBreaker.getInstance().getGlobalSettings().radioVolume); + this.scrollbar = new ScrollableElement(this); + this.filterTextField = new InputFieldElement(this.cb.playRegular14px, "Filter", -11842741, -11842741); + this.pinButton = new FlatButtonElement((Boolean) this.cb.getGlobalSettings().pinRadio.getValue() ? "Unpin" : "Pin"); + this.radioStationElements = new ArrayList<>(); + for (Station station : CheatBreaker.getInstance().getDashManager().getStations()) { + this.radioStationElements.add(new RadioStationElement(this, station)); + } + + } + + public void updateElementSize() { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + private boolean handleElementMouseClicked(RadioStationElement radioStationElement) { + return this.filterTextField.getText().equals("") || radioStationElement.getStation().getName().toLowerCase().startsWith(this.filterTextField.getText().toLowerCase()) || radioStationElement.getStation().getGenre().toLowerCase().startsWith(this.filterTextField.getText().toLowerCase()); + } + + public void setElementSize(float x, float y, float width, float height) { + super.setElementSize(x, y, width, height); + if (this.newHeight == 0.0f) { + this.newHeight = height; + } + + this.radioStationElements.sort((var0, var1x) -> { + if (var0.getStation().isFavourite() && !var1x.getStation().isFavourite()) { + return -1; + } else { + return !var0.getStation().isFavourite() && var1x.getStation().isFavourite() ? 1 : 0; + } + }); + this.volumeSlider.setElementSize(x, y + this.newHeight, width, 8.0F); + this.filterTextField.setElementSize(x, y + this.newHeight + 8.0F, width - 30.0F, 13.0F); + this.pinButton.setElementSize(x + width - 30.0F, y + this.newHeight + 8.0F, 30.0F, 13.0F); + this.scrollbar.setElementSize(x + width - 5.0F, y + this.newHeight + 21.0F, 5.0F, 99.0F); + int var5 = 0; + boolean var6 = true; + + for (RadioStationElement station : this.radioStationElements) { + if (this.handleElementMouseClicked(station)) { + float var9 = y + 21.0F + this.newHeight + (float) var5; + station.setElementSize(x, var9, width - 5.0F, 20.0F); + var5 += 20; + } + } + + this.scrollbar.setScrollAmount((float)var5); + } + + public boolean isMouseIn(float var1, float var2) { + return var1 > this.xPosition && var1 < this.xPosition + this.width && var2 > this.yPosition && var2 < this.yPosition + this.newHeight; + } + + protected void handleElementDraw(float var1, float var2, boolean var3) { + this.onDrag(var1, var2); + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.newHeight, -14540254); + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.newHeight, this.yPosition + this.newHeight, -1); + Station currentStation = CheatBreaker.getInstance().getDashManager().getCurrentStation(); + if (currentStation != null) { + if (currentStation.currentResource == null && !currentStation.getCoverURL().equals("")) { + if (currentStation.previousResource != null) { + this.mc.getTextureManager().func_147645_c(currentStation.previousResource); + currentStation.previousResource = null; + } + + currentStation.currentResource = new ResourceLocation("client/songs/" + currentStation.getTitle()); + ThreadDownloadImageData var6 = new ThreadDownloadImageData(null, currentStation.getCoverURL(), this.dashIcon, null); + Minecraft.getMinecraft().renderEngine.loadTexture(currentStation.currentResource, var6); + } + + ResourceLocation var5 = currentStation.currentResource == null ? this.dashIcon : currentStation.currentResource; + RenderUtil.renderIcon(var5, this.newHeight / 2.0F, this.xPosition, this.yPosition); + float var10 = this.xPosition + 50.0F; + if (this.mc.currentScreen != OverlayGui.getInstance()) { + var10 = this.xPosition + 34.0F; + } else { + boolean var7 = this.isMouseInside(var1, var2) && var1 > this.xPosition + 34.0F && var1 < this.xPosition + 44.0F && var2 < this.yPosition + this.newHeight; + if (!DashUtil.isActive()) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, var7 ? 1.0F : 0.29885057F * 2.6769233F); + RenderUtil.renderIcon(this.playIcon, 6.0F, this.xPosition + 34.0F, this.yPosition + 6.9339623F * 1.0816326F); + } else { + Gui.drawRect(this.xPosition + 36.0F, this.yPosition + 9.0F, this.xPosition + 38.0F, this.yPosition + this.newHeight - 11.0F, var7 ? -1 : -1342177281); + Gui.drawRect(this.xPosition + 40.0F, this.yPosition + 9.0F, this.xPosition + 42.0F, this.yPosition + this.newHeight - 11.0F, var7 ? -1 : -1342177281); + } + } + + String var11 = currentStation.getTitle(); + float var10003; + if ((float)CheatBreaker.getInstance().playRegular16px.getStringWidth(var11) > this.width - 52.0F) { + var10003 = this.yPosition + 4.0F; + CheatBreaker.getInstance().playRegular12px.drawString(var11, var10, var10003, -1); + } else { + var10003 = this.yPosition + 4.0F; + CheatBreaker.getInstance().playRegular16px.drawString(var11, var10, var10003, -1); + } + + CheatBreaker.getInstance().playRegular12px.drawString(currentStation.getArtist(), var10, this.yPosition + 14.0F, -1342177281); + } + + float var9 = this.fadeTime.inOutFade(this.isMouseInside(var1, var2) && var3); + if (this.fadeTime.isZeroOrLess()) { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.newHeight + 120.0F * var9); + this.isFading = true; + } else if (!this.fadeTime.isZeroOrLess() && !this.isMouseInside(var1, var2)) { + this.isFading = false; + } + + if (this.isFading) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui var13 = OverlayGui.getInstance(); + RenderUtil.startScissorBox((int)this.xPosition, (int)(this.yPosition + this.newHeight), (int)(this.xPosition + this.width), (int)(this.yPosition + this.newHeight + (this.height - this.newHeight) * var9), (float)((int)((float)var13.getScaledResolution().getScaleFactor() * var13.getScaleFactor())), (int)var13.getScaledHeight()); + Gui.drawRect(this.xPosition, this.yPosition + this.newHeight, this.xPosition + this.width, this.yPosition + this.height, -14540254); + this.scrollbar.drawScrollable(var1, var2, var3); + Iterator var12 = this.radioStationElements.iterator(); + + while(true) { + RadioStationElement var8; + do { + if (!var12.hasNext()) { + this.scrollbar.handleElementDraw(var1, var2, var3); + this.volumeSlider.drawElementHover(var1, var2, var3); + this.filterTextField.handleElementDraw(var1, var2, var3); + this.pinButton.handleElementDraw(var1, var2, var3); + GL11.glDisable(3089); + GL11.glPopMatrix(); + return; + } + + var8 = var12.next(); + } while(!this.handleElementMouseClicked(var8)); + + var8.handleElementDraw(var1, var2 - this.scrollbar.getPosition(), var3 && !this.scrollbar.isButtonHeld() && !this.scrollbar.isMouseInside(var1, var2)); + } + } + } + + public void handleElementMouse() { + this.scrollbar.handleElementMouse(); + } + + public void handleElementUpdate() { + this.filterTextField.handleElementUpdate(); + this.pinButton.handleElementUpdate(); + } + + public void handleElementClose() { + this.filterTextField.handleElementClose(); + this.pinButton.handleElementClose(); + } + + public void keyTyped(char var1, int var2) { + this.filterTextField.keyTyped(var1, var2); + this.pinButton.keyTyped(var1, var2); + this.scrollbar.keyTyped(var1, var2); + if (this.filterTextField.isFocused()) { + this.updateElementSize(); + } + + } + + public boolean onMouseClick(float var1, float var2, int var3) { + if (!this.filterTextField.isMouseInside(var1, var2) && this.filterTextField.isFocused()) { + this.filterTextField.setFocused(false); + } + + return false; + } + + public boolean handleElementMouseClicked(float var1, float var2, int var3, boolean var4) { + this.filterTextField.handleElementMouseClicked(var1, var2, var3, var4); + if (this.filterTextField.isFocused() && var3 == 1 && this.filterTextField.getText().equals("")) { + this.updateElementSize(); + } + + if (!var4) { + return false; + } else { + boolean var5 = this.isMouseInside(var1, var2) && var1 > this.xPosition + 34.0F && var1 < this.xPosition + 44.0F && var2 < this.yPosition + this.newHeight; + if (var5) { + if (!DashUtil.isActive()) { + CheatBreaker.getInstance().getDashManager().getCurrentStation().endStream(); + } else { + DashUtil.end(); + } + } + + float var6 = this.fadeTime.inOutFade(this.isMouseInside(var1, var2) && var4); + if (this.fadeTime.isHovered()) { + this.volumeSlider.handleElementMouseClicked(var1, var2, var3, var4); + this.scrollbar.handleElementMouseClicked(var1, var2, var3, var4); + this.filterTextField.handleElementMouseClicked(var1, var2, var3, var4); + this.pinButton.handleElementMouseClicked(var1, var2, var3, var4); + boolean var7 = var1 > (float)((int)this.xPosition) && var1 < (float)((int)(this.xPosition + this.width)) && var2 > (float)((int)(this.yPosition + this.newHeight + 21.0F)) && var2 < (float)((int)(this.yPosition + this.newHeight + 21.0F + (this.height - this.newHeight - 21.0F) * var6)); + if (var7) { + for (RadioStationElement var9 : this.radioStationElements) { + if (this.handleElementMouseClicked(var9) && var9.handleElementMouseClicked(var1, var2 - this.scrollbar.getPosition(), var3, var4)) { + break; + } + } + } + + if (this.pinButton.isMouseInside(var1, var2)) { + this.cb.getGlobalSettings().pinRadio.setValue(!(Boolean)this.cb.getGlobalSettings().pinRadio.getValue()); + this.pinButton.setText((Boolean)this.cb.getGlobalSettings().pinRadio.getValue() ? "Unpin" : "Pin"); + } + } + + if (this.isMouseInside(var1, var2) && var2 < this.yPosition + this.newHeight && !var5 && !this.volumeSlider.isMouseInside(var1, var2) && !this.scrollbar.isMouseInside(var1, var2)) { + this.setPosition(var1, var2); + } + + return super.handleElementMouseClicked(var1, var2, var3, var4); + } + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioStationElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioStationElement.java new file mode 100644 index 0000000..de3f23d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/elements/RadioStationElement.java @@ -0,0 +1,70 @@ +package com.cheatbreaker.client.audio.music.elements; + +import com.cheatbreaker.client.*; +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RadioStationElement extends AbstractElement { + private final Station station; + private final ResourceLocation starIcon = new ResourceLocation("client/icons/star-21.png"); + private final ResourceLocation starFilledIcon = new ResourceLocation("client/icons/star-filled-21.png"); + private final RadioElement parent; + + public RadioStationElement(RadioElement radioElement, Station station) { + this.parent = radioElement; + this.station = station; + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + if (this.isMouseInsideElement(f, f2) && bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + 22.0f, this.yPosition + this.height, -13158601); + } else if (this.isMouseInside(f, f2) && bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + } + boolean favorite = this.station.isFavourite(); + if (favorite) { + GL11.glColor4f(1.1833333f * 0.8028169f, 0.75956047f * 0.9479167f, 0.14558825f * 1.030303f, 1.0f); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + boolean active = CheatBreaker.getInstance().getDashManager().getCurrentStation() == this.station; + RenderUtil.renderIcon(favorite ? this.starFilledIcon : this.starIcon, 5.0f, this.xPosition + 6.0f, this.yPosition + 5.0f); + CheatBreaker.getInstance().playRegular14px.drawString(this.station.getName(), this.xPosition + 24.0f, this.yPosition + 0.627451f * 2.390625f, active ? -13369549 : -1); + CheatBreaker.getInstance().playRegular14px.drawString(this.station.getGenre(), this.xPosition + 24.0f, this.yPosition + 2.375f * 4.0f, -1342177281); + } + + private boolean isMouseInsideElement(float f, float f2) { + return this.isMouseInside(f, f2) && f < this.xPosition + 22.0f; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + if (this.isMouseInsideElement(f, f2) && bl) { + this.station.setFavourite(!this.station.isFavourite()); + this.parent.updateElementSize(); + return true; + } + if (this.isMouseInside(f, f2) && bl) { + if (DashUtil.isActive()) { + DashUtil.end(); + } + this.station.play = true; + CheatBreaker.getInstance().getDashManager().getDashQueueThread().offerStation(this.station); + CheatBreaker.getInstance().getDashManager().setCurrentStation(this.station); + } + return false; + } + + public Station getStation() { + return this.station; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/threads/DashQueueThread.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/threads/DashQueueThread.java new file mode 100644 index 0000000..2eb4684 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/threads/DashQueueThread.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.audio.music.threads; + + +import com.cheatbreaker.client.audio.music.data.Station; + +import java.util.LinkedList; +import java.util.Queue; + +public class DashQueueThread extends Thread { + private final Queue queueList = new LinkedList<>(); + + public void run() { + try { + while(true) { + synchronized(this.queueList) { + this.queueList.wait(); + Station var2 = this.queueList.poll(); + if (var2 != null) { + var2.getData(); + } + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public void offerStation(Station station) { + synchronized(this.queueList) { + this.queueList.offer(station); + this.queueList.notify(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/threads/DashThread.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/threads/DashThread.java new file mode 100644 index 0000000..7c3246f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/threads/DashThread.java @@ -0,0 +1,28 @@ +package com.cheatbreaker.client.audio.music.threads; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.data.Station; + +import java.time.Duration; +import java.time.LocalDateTime; + +public class DashThread extends Thread { + @Override + public void run() { + while (true) { + try { + while (true) { + Station station; + if ((station = CheatBreaker.getInstance().getDashManager().getCurrentStation()) != null && station.getStartTime() != null && Duration.between(station.getStartTime(), LocalDateTime.now()).toMillis() / 1000L >= (long)(station.getDuration() + 2)) { + station.getData(); + Thread.sleep(4000L); + } + Thread.sleep(1000L); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/util/DashUtil.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/util/DashUtil.java new file mode 100644 index 0000000..0156e2d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/audio/music/util/DashUtil.java @@ -0,0 +1,101 @@ +package com.cheatbreaker.client.audio.music.util; + +import com.cheatbreaker.client.audio.music.audio.DashAudioDevice; +import com.cheatbreaker.client.audio.music.audio.DashHook; +import com.cheatbreaker.client.audio.music.data.Station; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.ArrayList; +import java.util.List; + + +import javazoom.jl.decoder.JavaLayerUtils; +import javazoom.jl.player.Player; + +public class DashUtil { + private static final String dashApiStations = "https://dash-api.com/api/v3/allData.php"; + private static Player player; + private static boolean playing; + private static DashAudioDevice dashPlayer = new DashAudioDevice(); + + public static List dashHelpers() { + JavaLayerUtils.setHook(new DashHook()); + ArrayList arrayList = new ArrayList<>(); + try { + JsonObject jsonObject = new JsonParser().parse(DashUtil.get(dashApiStations)).getAsJsonObject(); + if (jsonObject.has("stations")) { + JsonArray jsonArray = jsonObject.getAsJsonArray("stations"); + for (JsonElement array : jsonArray) { + JsonObject object = array.getAsJsonObject(); + String name = object.get("name").getAsString(); + String genre = object.get("genre").getAsString(); + String square_logo_url = object.get("square_logo_url").getAsString(); + String current_song_url = object.get("current_song_url").getAsString(); + String stream_url = object.get("stream_url").getAsString(); + Station station = new Station(name, square_logo_url, genre, current_song_url, stream_url); + arrayList.add(station); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + return arrayList; + } + + public static String get(String string) { + try { + URLConnection uRLConnection = new URL(string).openConnection(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream())); + return bufferedReader.readLine(); + } catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + public static void end() { + if (player != null) { + player.close(); + player = null; + } + playing = false; + } + + public static boolean isActive() { + return player != null; + } + + public static void end(String string) { + if (playing) { + return; + } + playing = true; + if (player != null) { + player.close(); + player = null; + return; + } + new Thread(() -> { + try { + URL uRL = new URL(string); + InputStream inputStream = uRL.openStream(); + dashPlayer = new DashAudioDevice(); + player = new Player(inputStream, dashPlayer); + player.play(); + } catch (Exception exception) { + exception.printStackTrace(); + } + }).start(); + } + + public static DashAudioDevice getPlayer() { + return dashPlayer; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/ConfigManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/ConfigManager.java new file mode 100644 index 0000000..f4a74ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/ConfigManager.java @@ -0,0 +1,629 @@ +package com.cheatbreaker.client.config; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.audio.music.data.Station; +import com.cheatbreaker.client.ui.element.type.ColorPickerColorElement; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.src.Config; +import org.apache.commons.lang3.StringUtils; + +import java.io.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +public class ConfigManager { + private final File configDir; + private final File globalConfig; + private final File mutesConfig; + private final File defaultConfig; + public final File profileDir; + + public ConfigManager() { + this.configDir = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch()); + this.globalConfig = new File(this.configDir + File.separator + "global.cfg"); + this.mutesConfig = new File(this.configDir + File.separator + "mutes.cfg"); + this.defaultConfig = new File(this.configDir + File.separator + "default.cfg"); + this.profileDir = new File(this.configDir + File.separator + "profiles"); + } + + public void write() { + if (this.createRequiredFiles()) { + CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().saveAll(); + this.writeGlobalConfig(this.globalConfig); + this.writeMutesConfig(this.mutesConfig); + this.writeProfile(CheatBreaker.getInstance().activeProfile.getName()); + } + } + + public void read() { + if (this.createRequiredFiles()) { + this.redGlobalConfig(this.globalConfig); + this.readMutesConfig(this.mutesConfig); + if (CheatBreaker.getInstance().activeProfile == null) { + CheatBreaker.getInstance().activeProfile = CheatBreaker.getInstance().profiles.get(0); + } else { + this.readProfile(CheatBreaker.getInstance().activeProfile.getName()); + } + CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().loadAll(); + } + } + + private boolean createRequiredFiles() { + try { + return !(!this.configDir.exists() && !this.configDir.mkdirs() || !this.defaultConfig.exists() && !this.defaultConfig.createNewFile() || !this.globalConfig.exists() && !this.globalConfig.createNewFile()); + } catch (IOException e) { + e.printStackTrace(); + } + return true; + } + + /* + * Could not resolve type clashes + */ + public void readProfile(String string) { + if (string.equalsIgnoreCase("default")) { + CheatBreaker.getInstance().activeProfile = CheatBreaker.getInstance().profiles.get(0); + for (AbstractModule module : CheatBreaker.getInstance().getModuleManager().playerMods) { + module.setState(module.defaultState); + module.setWasRenderHud(module.defaultWasRenderHud); + module.setAnchor(module.defaultGuiAnchor); + module.setTranslations(module.defaultXTranslation, module.defaultYTranslation); + module.setRenderHud(module.defaultRenderHud); + for (int i = 0; i < module.getSettingsList().size(); ++i) { + try { + module.getSettingsList().get(i).updateSettingValue(module.getDefaultSettingsValues().get(i), false); + } + catch (Exception exception) { + exception.printStackTrace(); + } + } + } + return; + } + + File file = new File(this.configDir + File.separator + "profiles"); + File file2 = file.exists() || file.mkdirs() ? new File(file + File.separator + string + ".cfg") : null; + + if (!file2.exists()) { + this.writeProfile(string); + return; + } + + ArrayList arrayList = new ArrayList(); + arrayList.addAll(CheatBreaker.getInstance().getModuleManager().playerMods); + arrayList.addAll(CheatBreaker.getInstance().getModuleManager().staffMods); + + try { + String string2; + BufferedReader bufferedReader = new BufferedReader(new FileReader(file2)); + AbstractModule module = null; + block34: while ((string2 = bufferedReader.readLine()) != null) { + try { + String[] split; + if (string2.startsWith("#") || string2.length() == 0) continue; + if (string2.startsWith("[")) { + for (AbstractModule object222 : arrayList) { + if (!("[" + object222.getName() + "]").equalsIgnoreCase(string2)) continue; + module = object222; + continue block34; + } + continue; + } + if (module == null) continue; + if (string2.startsWith("-")) { + split = string2.replaceFirst("-", "").split("=", 2); + if (split.length != 2) continue; + try { + block12 : switch (split[0]) { + case "State": + if (module.isStaffModule()) break; + module.setState(Boolean.parseBoolean(split[1])); + break; + case "WasRenderHUD": + module.setWasRenderHud(Boolean.parseBoolean(split[1])); + break; + case "RenderHUD": + module.setRenderHud(Boolean.parseBoolean(split[1])); + break; + case "Position": + if (module.getGuiAnchor() == null) break; + for (GuiAnchor cBGuiAnchor : GuiAnchor.values()) { + if (!cBGuiAnchor.getLabel().equalsIgnoreCase(split[1])) continue; + module.setAnchor(cBGuiAnchor); + break block12; + } + continue block34; + case "xTranslation": + module.setXTranslation(Float.parseFloat(split[1])); + break; + case "yTranslation": + module.setYTranslation(Float.parseFloat(split[1])); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + continue; + } + + split = string2.split("=", 2); + if (split.length != 2) continue; + for (Setting setting : module.getSettingsList()) { + if (setting.getSettingName().equalsIgnoreCase("label") || !setting.getSettingName().equalsIgnoreCase(split[0])) + continue; + + if (split[1].contains("keycode:")) { + String val = ""; + + if (split[1].contains("mouse:")) { + val = StringUtils.substringAfter(split[1], ";mouse:"); + setting.setHasMouseBind(true); + } + + String key = StringUtils.substringAfter(split[1], ";keycode:").replaceAll(";mouse:" + val, ""); + + Object[] arrobject = split[1].split(";"); + String value = (String) arrobject[0]; + value = value.replaceAll(";mouse:" + val, ""); + + if (Integer.parseInt(key) == 0 && Boolean.parseBoolean(val)) { + setting.setHasMouseBind(false); + } + + setting.setValue(value).setKeyCode(Integer.parseInt(key)).setHasKeycode(true); + break; + } + + if (setting.getSettingName().endsWith("Keybind") && split[1].contains("mouse:")) { + boolean val = Boolean.parseBoolean(StringUtils.substringAfter(split[1], ";mouse:")); + + Object[] arrobject = split[1].split(";"); + String value = (String) arrobject[0]; + +// System.out.println("mouse boolean: " + val); +// System.out.println("value: " + value); + + if (Integer.parseInt(value) == 0 && val) { + setting.setHasMouseBind(false); // prevent possible issues + } + + setting.setValue(Integer.parseInt(value)).setHasMouseBind(val); + break; + } + + try { + switch (setting.getType()) { + case BOOLEAN: + setting.setValue(Boolean.parseBoolean(split[1])); + break; + case INTEGER: + if (module.isStaffModule() && setting == ((StaffMod)module).getKeybindSetting()) { + ((StaffMod)module).getKeybindSetting().setValue(Integer.parseInt(split[1])); + break; + } + + if (split[1].contains("rainbow")) { + Object[] arrobject = split[1].split(";"); + int n = Integer.parseInt((String) arrobject[0]); + setting.rainbow = true; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block34; + setting.setValue(n); + break; + } + + if (setting.getSettingName().endsWith("Keybind")) { + setting.setValue(Integer.parseInt(split[1])); + break; + } + + int n = Integer.parseInt(split[1]); + setting.rainbow = false; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block34; + setting.setValue(n); + break; + case FLOAT: + float f = Float.parseFloat(split[1]); + if (!(f <= (Float) setting.getMaximumValue()) || !(f >= (Float) setting.getMinimumValue())) break; + setting.setValue(f); + break; + case DOUBLE: + double d = Double.parseDouble(split[1]); + if (!(d <= (Double)setting.getMaximumValue()) || !(d >= (Double)setting.getMinimumValue())) break; + setting.setValue(d); + break; + case ARRAYLIST: + ArrayList strList = new ArrayList<>(Arrays.asList(split[1].replaceAll("\\[", "").replaceAll("]", "").replaceAll(" ", "").split(","))); + List listOfInteger = strList.stream().map(Integer::parseInt).collect(Collectors.toList()); + setting.setValue(listOfInteger); + break; + case STRING_ARRAY: + boolean bl = false; + for (String value : setting.getAcceptedStringValues()) { + if (!value.equalsIgnoreCase(split[1])) continue; + bl = true; + } + if (!bl) break; + setting.setValue(split[1]); + break; + case STRING: + if (setting.getSettingName().equalsIgnoreCase("label")) break; + + if (setting == CheatBreaker.getInstance().getModuleManager().toggleSprintMod.flyBoostString) { + split[1] = split[1].replaceAll("%FPS%", "%BOOST%"); + } + + setting.setValue(split[1].replaceAll("&([abcdefghijklmrABCDEFGHIJKLMNR0-9])|(&$)", "§$1")); + } + continue block34; + } catch (Exception exception) { + exception.printStackTrace(); + if (setting != CheatBreaker.getInstance().getModuleManager().keystrokesMod.boxSize) continue; + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b(); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + bufferedReader.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + this.writeProfile(string); + } + + /* + * Could not resolve type clashes + */ + public void redGlobalConfig(File file) { + if (!file.exists()) { + this.writeGlobalConfig(file); + return; + } + try { + String string; + BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); + block21: while ((string = bufferedReader.readLine()) != null) { + try { + File profileFile; + String[] arrString; + if (string.startsWith("#") || string.length() == 0 || (arrString = string.split("=", 2)).length != 2) continue; + + if (arrString[0].equalsIgnoreCase("FavoriteColors")) { + String[] declaration = arrString[1].split(","); + for (String object2 : declaration) { + try { + CheatBreaker.getInstance().getGlobalSettings().favouriteColors.add(new ColorPickerColorElement(1.0f, Integer.parseInt(object2), 1.0f)); + } catch (NumberFormatException numberFormatException) { + numberFormatException.printStackTrace(); + } + } + continue; + } + + if (arrString[0].equalsIgnoreCase("FavoriteStations")) { + String[] declaration = arrString[1].split(","); + for (String object2 : declaration) { + try { + for (Station station : CheatBreaker.getInstance().getDashManager().getStations()) { + if (!station.getName().equalsIgnoreCase(object2)) continue; + station.setFavourite(true); + } + } catch (NumberFormatException numberFormatException) { + numberFormatException.printStackTrace(); + } + } + continue; + } + if (arrString[0].equalsIgnoreCase("XrayBlocks")) { + CheatBreaker.getInstance().getModuleManager().staffModuleXray.getBlocks().clear(); + String[] declaration = arrString[1].split(","); + for (String object2 : declaration) { + try { + CheatBreaker.getInstance().getModuleManager().staffModuleXray.getBlocks().add(Integer.parseInt(object2)); + } catch (NumberFormatException numberFormatException) { + numberFormatException.printStackTrace(); + } + } + continue; + } + + if (arrString[0].startsWith("key_")) { + for (KeyBinding keyBinding : Minecraft.getMinecraft().gameSettings.keyBindings) { + if (!keyBinding.isCheatBreakerKeybind || !arrString[0].equalsIgnoreCase("key_" + keyBinding.getKeyDescription())) continue; + keyBinding.setKeyCode(Integer.parseInt(arrString[1])); + } + continue; + } + + if (arrString[0].equalsIgnoreCase("ProfileIndexes")) { + String[] declaration = arrString[1].split("]\\["); + for (String object2 : declaration) { + object2 = object2.replaceFirst("\\[", ""); + String[] arrstring2 = object2.split(",", 2); + try { + int n = Integer.parseInt(arrstring2[1]); + for (Profile profile : CheatBreaker.getInstance().profiles) { + if (n == 0 || !profile.getName().equalsIgnoreCase(arrstring2[0])) continue; + profile.index = n; + } + } catch (NumberFormatException numberFormatException) { + + } + } + continue; + } + if (arrString[0].equalsIgnoreCase("ActiveProfile")) { + profileFile = null; + File file2 = new File(this.configDir + File.separator + "profiles"); + if (file2.exists() || file2.mkdirs()) { + profileFile = new File(file2 + File.separator + arrString[1] + ".cfg"); + } + if (profileFile == null || !profileFile.exists()) continue; + Profile object3 = null; + for (Profile object2 : CheatBreaker.getInstance().profiles) { + if (!arrString[1].equalsIgnoreCase(object2.getName())) continue; + object3 = object2; + } + if (object3 == null || object3.getName().equalsIgnoreCase("default")) continue; + CheatBreaker.getInstance().activeProfile = object3; + continue; + } + for (Setting setting : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + if (setting.getSettingName().equalsIgnoreCase("label") || !setting.getSettingName().equalsIgnoreCase(arrString[0])) continue; + try { + switch (setting.getType()) { + case BOOLEAN: + setting.setValue(Boolean.parseBoolean(arrString[1])); + break; + case INTEGER: + if (arrString[1].contains("rainbow")) { + String[] arrstring3 = arrString[1].split(";"); + int n = Integer.parseInt(arrstring3[0]); + setting.rainbow = true; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block21; + setting.setValue(n); + break; + } + int n = Integer.parseInt(arrString[1]); + setting.rainbow = false; + if (n > (Integer)setting.getMaximumValue() || n < (Integer)setting.getMinimumValue()) continue block21; + setting.setValue(n); + break; + case FLOAT: + float f = Float.parseFloat(arrString[1]); + if (!(f <= (Float) setting.getMaximumValue()) || !(f >= (Float) setting.getMinimumValue())) break; + setting.setValue(f); + break; + case DOUBLE: + double d = Double.parseDouble(arrString[1]); + if (!(d <= (Double)setting.getMaximumValue()) || !(d >= (Double)setting.getMinimumValue())) break; + setting.setValue(d); + break; + case ARRAYLIST: + ArrayList strList = new ArrayList<>(Arrays.asList(arrString[1].split(","))); + List listOfInteger = strList.stream().map(Integer::parseInt).collect(Collectors.toList()); + setting.setValue(listOfInteger); + break; + case STRING_ARRAY: + boolean bl = false; + for (String acceptedValue : setting.getAcceptedStringValues()) { + if (!acceptedValue.equalsIgnoreCase(arrString[1])) continue; + bl = true; + } + if (!bl) break; + setting.setValue(arrString[1]); + } + continue block21; + } catch (Exception exception) { + exception.printStackTrace(); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + bufferedReader.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + this.writeGlobalConfig(file); + } + + /* + * Could not resolve type clashes + */ + public void writeGlobalConfig(File file) { + try { + BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file)); + bufferedWriter.write("################################"); + bufferedWriter.newLine(); + bufferedWriter.write("# MC_Client: GLOBAL SETTINGS"); + bufferedWriter.newLine(); + bufferedWriter.write("################################"); + bufferedWriter.newLine(); + bufferedWriter.newLine(); + if (CheatBreaker.getInstance().activeProfile != null && !CheatBreaker.getInstance().activeProfile.getName().equals("default")) { + bufferedWriter.write("ActiveProfile=" + CheatBreaker.getInstance().activeProfile.getName()); + bufferedWriter.newLine(); + } + for (Setting setting : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + if (setting.getSettingName().equalsIgnoreCase("label")) continue; + if (setting.rainbow) { + bufferedWriter.write(setting.getSettingName() + "=" + setting.getValue() + ";rainbow"); + } else { + bufferedWriter.write(setting.getSettingName() + "=" + setting.getValue()); + } + bufferedWriter.newLine(); + } + for (KeyBinding keyBind : Minecraft.getMinecraft().gameSettings.keyBindings) { + if (!(keyBind.isCheatBreakerKeybind)) continue; + bufferedWriter.write("key_" + keyBind.getKeyDescription() + "=" + keyBind.getKeyCode()); + bufferedWriter.newLine(); + } + String object3 = ""; + for (ColorPickerColorElement colorPickerColorElement : CheatBreaker.getInstance().getGlobalSettings().favouriteColors) { + object3 = object3 + colorPickerColorElement.color + (CheatBreaker.getInstance().getGlobalSettings().favouriteColors.indexOf(colorPickerColorElement) == CheatBreaker.getInstance().getGlobalSettings().favouriteColors.size() - 1 ? "" : ","); + } + if (!object3.equals("")) { + bufferedWriter.write("FavoriteColors=" + object3); + bufferedWriter.newLine(); + } + StringBuilder stations = new StringBuilder(); + for (Station station : CheatBreaker.getInstance().getDashManager().getStations()) { + if (!station.isFavourite()) continue; + if (stations.length() != 0) { + stations.append(","); + } + stations.append(station.getName()); + } + if (!stations.toString().equals("")) { + bufferedWriter.write("FavoriteStations=" + stations); + bufferedWriter.newLine(); + } + StringBuilder selectedXRayBlocks = new StringBuilder(); + for (int blocks : CheatBreaker.getInstance().getModuleManager().staffModuleXray.getBlocks()) { + if (selectedXRayBlocks.length() != 0) { + selectedXRayBlocks.append(","); + } + selectedXRayBlocks.append(blocks); + } + bufferedWriter.write("XrayBlocks=" + selectedXRayBlocks); + bufferedWriter.newLine(); + bufferedWriter.write("ProfileIndexes="); + for (Profile profile : CheatBreaker.getInstance().profiles) { + bufferedWriter.write("[" + profile.getName() + "," + profile.index + "]"); + } + bufferedWriter.newLine(); + bufferedWriter.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + } + + public void readMutesConfig(File file) { + try { + String string; + if (!file.exists()) { + this.writeMutesConfig(file); + return; + } + BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); + while ((string = bufferedReader.readLine()) != null) { + try { + UUID uUID = UUID.fromString(string); + CheatBreaker.getInstance().getCbNetHandler().getVoiceUsers().add(uUID); + } catch (Exception ignored) {} + } + } catch (IOException ignored) { + + } + } + + public void writeMutesConfig(File file) { + try { + if (!file.exists()) { + file.createNewFile(); + } + BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file)); + for (UUID uUID : CheatBreaker.getInstance().getCbNetHandler().getVoiceUsers()) { + bufferedWriter.write(uUID.toString()); + bufferedWriter.newLine(); + } + bufferedWriter.close(); + } catch (IOException ignored) { + + } + } + + public void writeProfile(String string) { + if (string.equalsIgnoreCase("default")) { + return; + } + File file = new File(this.configDir + File.separator + "profiles"); + File file2 = file.exists() || file.mkdirs() ? new File(file + File.separator + string + ".cfg") : null; + ArrayList modules = new ArrayList<>(); + modules.addAll(CheatBreaker.getInstance().getModuleManager().playerMods); + modules.addAll(CheatBreaker.getInstance().getModuleManager().staffMods); + try { + BufferedWriter writer = new BufferedWriter(new FileWriter(file2)); + writer.write("################################"); + writer.newLine(); + writer.write("# MC_Client: MODULE SETTINGS"); + writer.newLine(); + writer.write("################################"); + writer.newLine(); + writer.newLine(); + for (AbstractModule module : modules) { + writer.write("[" + module.getName() + "]"); + writer.newLine(); + writer.write("-State=" + module.isEnabled()); + writer.newLine(); + writer.write("-WasRenderHUD=" + module.isWasRenderHud()); + writer.newLine(); + if (module.getGuiAnchor() != null) { + writer.write("-Position=" + module.getGuiAnchor().getLabel()); + writer.newLine(); + } + writer.write("-xTranslation=" + module.getXTranslation()); + writer.newLine(); + writer.write("-yTranslation=" + module.getYTranslation()); + writer.newLine(); + writer.write("-RenderHUD=" + module.isRenderHud()); + writer.newLine(); + for (Setting setting : module.getSettingsList()) { + if (setting == CheatBreaker.getInstance().getModuleManager().coordinatesMod.customLine) { + writer.write("# Customize your HUD info display string."); + writer.newLine(); + writer.write("# (& color formatting is allowed)"); + writer.newLine(); + writer.write("# Optional uses:"); + writer.newLine(); + writer.write("# %FPS% - Display current FPS."); + writer.newLine(); + writer.write("# %DIR% - Display current look direction."); + writer.newLine(); + writer.write("# %CPS% - Display CPS."); + writer.newLine(); + writer.write("# %COORDS% - Display coordinates."); + writer.newLine(); + writer.write("# %IP% - Current server IP."); + writer.newLine(); + writer.write("# %X% - Your X location."); + writer.newLine(); + writer.write("# %Y% - Your (foot) Y location."); + writer.newLine(); + writer.write("# %Z% - Your Z location."); + writer.newLine(); + writer.write("# %NL% - Break into a new line."); + writer.newLine(); + } + if (setting.getSettingName().equalsIgnoreCase("label")) continue; + if (setting.getType() == SettingType.STRING) { + writer.write(setting.getSettingName() + "=" + (setting.getValue() + (setting.isHasKeycode() ? ";keycode:" + setting.getKeyCode() : "") + (setting.isHasMouseBind() ? ";mouse:" + setting.isHasMouseBind() : "")).replaceAll("§", "&")); + } else if (setting.getType() == SettingType.INTEGER && setting.getSettingName().endsWith("Keybind") && setting.getSettingName().contains("Toggle")) { + writer.write(setting.getSettingName() + "=" + setting.getValue() + (setting.isHasMouseBind() ? ";mouse:" + setting.isHasMouseBind() : "")); + } else if (setting.rainbow) { + writer.write(setting.getSettingName() + "=" + setting.getValue() + ";rainbow"); + } else { + writer.write(setting.getSettingName() + "=" + setting.getValue()); + } + writer.newLine(); + } + writer.newLine(); + } + writer.close(); + } catch (IOException iOException) { + iOException.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/GlobalSettings.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/GlobalSettings.java new file mode 100644 index 0000000..b5ac727 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/GlobalSettings.java @@ -0,0 +1,415 @@ +package com.cheatbreaker.client.config; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.ui.element.module.ModuleListElement; +import com.cheatbreaker.client.ui.element.type.ColorPickerColorElement; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.util.CBDebugOutput; +import com.cheatbreaker.client.util.render.serverlist.UnsafeServerAction; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.src.Config; +import org.apache.commons.lang3.ArrayUtils; +import org.lwjgl.input.Keyboard; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class GlobalSettings { + public KeyBinding keyBindOpenMenu; + public KeyBinding keyBindDragToLook; + public KeyBinding keyBindBackLook; + public KeyBinding keyBindFrontLook; + public KeyBinding keyBindEmote; + + public final List settingsList = new ArrayList<>(); + @Getter private final List pinnedServers = new ArrayList<>(); + @Getter private final List unsafeServers = new ArrayList<>(); + + public boolean isDebug = false; + + public String webapiCrashReportUpload = "http://server.noxiuam.gq/crashReport"; + public String webapiDebugUpload = "http://moosecbapi.000webhostapp.com/debug-upload.php"; + public String webapiCosmetics = "https://cheatbreaker.com/api/cosmetic/"; + public String webapiCosmeticsAll = "https://cheatbreaker.com/api/cosmetic/all"; + public String mojangStatusURL = "https://mojan.ga/api/check"; // Previously https://status.mojang.com/check, however, that server is no longer available. + + public int sessionCheckInteral = 60; + + public boolean SHOW_MODIFIERS = true; + + private final Setting debugSettingsLabel; + public Setting showDebugOutput; + + private final Setting audioSettingsLabel; + // public Setting microphone; + public Setting radioVolume; + // public Setting microphoneVolume; +// public Setting speakerVolume; + public Setting pinRadio; + public Setting muteCBSounds; + + private final Setting fpsBoostSettingsLabel; + public Setting enableFpsBoost; + public Setting slowChunkLoading; + public Setting fullBright; + public Setting entityShadows; + public Setting hideGroundedArrows; + public Setting hideFoliage; + public Setting hideStuckArrows; + public Setting hideMovingArrows; + public Setting hidePlacedSkulls; + + private final Setting fpsLimitSettingsLabel; + public Setting useCustomFPSLimiter; + public Setting customFPSLimit; + public Setting limitWhenUnfocused; + public Setting unfocusedFPS; + // public Setting limitWhenInactive; +// public Setting inactiveFPS; + public Setting mainMenuFPS; + + private final Setting teamViewLabel; + public Setting enableTeamView; + public Setting showDistance; + public Setting showOffScreenMarker; + +// private final Setting generalSettingsLabel; + + private final Setting displaySettingsLabel; + public Setting borderlessFullscreen; + public Setting unfullscreenWhenUnfocused; + + private final Setting hudEditorSettingsLabel; + public Setting compactMode; + public static Setting darkMode; + public Setting customizationLevel; + public Setting snapModules; + public Setting snappingStrength; + public Setting showModName; +// public Setting useBackgroundOverlay; + + private final Setting renderSettingsLabel; + public Setting showHudInDebug; + public Setting showPotionInfo; + public Setting achievements; + public Setting shiftPotionInfo; + public Setting guiBlur; + public Setting containerBackground; + public Setting bottomSkyLayer; + + private final Setting streamerModeSettingsLabel; + public Setting streamerMode; + public Setting disableModMenuKeybind; + public Setting notifyWhenModMenuKeybindPressed; + public Setting holdDownModsGameMenuButton; + public Setting holdDuration; + + private final Setting packSettingsLabel; + public Setting packMenu; + public Setting widePackMenu; + public Setting transparentBackground; + public Setting packFolderInfo; + public Setting packFolderIcons; + public Setting packIcons; + public Setting packDescriptions; + public Setting packSearchBar; + public Setting packSortMethod; + public Setting packSmoothScrolling; + public Setting packListBackgroundColor; + + private final Setting scalingSettingsLabel; + public Setting modScale; + public Setting modScaleMultiplier; + public Setting hotbarScale; + public Setting hotbarScaleMultiplier; + public Setting scaleModsDownSmallerResoltion; + + private final Setting screenshotSettingsLabel; + public Setting shutterSound; + public Setting sendScreenshotMessage; + public Setting compactOptions; + public Setting copyAutomatically; + public Setting openOption; + public Setting copyOption; + public Setting uploadOption; + + private final Setting keybindHandlingSettingsLabel; + public Setting keybindFix; + public Setting excludeSneakKeybind; + public Setting excludeThrowKeybind; + + private final Setting cosmeticSettingsLabel; + public Setting showOptifineCapes; + public Setting showOptifineHats; + public Setting showCheatBreakerCapes; + public Setting showCheatBreakerWings; + + private final Setting rpcSettings; + public Setting showRPC; + public Setting showServer; + public Setting showAccount; + + private final Setting colorSettingsLabel; + public Setting resetColors; + public Setting defaultColor; + public Setting emoteRadialColor; + @Getter @Setter private Setting currentMenuSetting; + + public List favouriteColors = new ArrayList<>(); + public List recentColors = new ArrayList<>(); + + public GlobalSettings() { +// String[] microphones = CheatBreaker.getMicrophoneList(); +// StringBuilder availableMicrophones = new StringBuilder(); +// for (String microphone : microphones) { +// availableMicrophones.append("\n- ").append(microphone); +// } + this.debugSettingsLabel = new Setting(this.settingsList, "label").setValue("Debug Settings").setCondition(() -> CBDebugOutput.uuids.contains(Minecraft.getMinecraft().getSession().getUniqueID())); + this.showDebugOutput = new Setting(this.settingsList, "Show Debug Output", "Show any debug information.").setValue(false).setCondition(() -> CBDebugOutput.uuids.contains(Minecraft.getMinecraft().getSession().getUniqueID())); + this.audioSettingsLabel = new Setting(this.settingsList, "label").setValue("Audio Settings"); +// this.microphone = microphones.length > 0 ? new Setting(this.settingsList, "Microphone", "Change the microphone for voice chat." + +// "\n" + +// "\nAvailable microphones:" + availableMicrophones).setValue(microphones[0]).acceptedValues(microphones).onChange(var0 -> { +// try { +// System.out.println(CheatBreaker.getInstance().getLoggerPrefix() + "Updated audio device!"); +// Message.h(CheatBreaker.getMicrophone((String)var0)); +// } catch (UnsatisfiedLinkError ignored) {} +// }) : new Setting(this.settingsList, "Microphone", "Change the microphone for voice chat (none detected).").setValue("Unknown").acceptedValue("Unknown").onChange(var0 -> { +// try { +// System.out.println(CheatBreaker.getInstance().getLoggerPrefix() + "Updated audio device!"); +// Message.h(CheatBreaker.getMicrophone((String)var0)); +// } catch (UnsatisfiedLinkError ignored) {} +// }); + this.muteCBSounds = new Setting(this.settingsList, "Mute CheatBreaker sounds", "Mute notification sounds generated from CheatBreaker.").setValue(false); + this.pinRadio = new Setting(this.settingsList, "Pin Radio Player", "Pin the radio to the HUD.").setValue(false); + this.radioVolume = new Setting(this.settingsList, "Radio Volume", "Adjusts the volume of the Dash Radio.").onChange(value -> { + if (DashUtil.isActive()) { + DashUtil.getPlayer().setFloatControlValue(Float.parseFloat(value.toString())); + } + }).setValue(85).setMinMax(0, 100).setUnit("%").setCenterLabel("MEDIUM"); +// this.microphoneVolume = new Setting(this.settingsList, "Microphone Volume", "Adjust the input Microphone volume.").onChange(volume -> { +// try { +// Message.l(Float.parseFloat(volume.toString())); +// } catch (UnsatisfiedLinkError ignored) {} +// }).setValue(70.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCenterLabel("MEDIUM"); +// this.speakerVolume = new Setting(this.settingsList, "Speaker Volume", "Adjust the speaker volume for voice chat.").onChange(var0 -> { +// try { +// float volume = 20000.0f / (float)(20000.0F - Math.max(0.0F, Math.min(19500.0F, (Float)var0 * 195.0F))); +// Message.m(volume); +// } catch (UnsatisfiedLinkError ignored) {} +// }).setValue(85.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCenterLabel("MEDIUM"); + + this.fpsBoostSettingsLabel = new Setting(this.settingsList, "label").setValue("FPS Boost"); + this.enableFpsBoost = new Setting(this.settingsList, "Enable FPS Boost", "Enables all FPS boost settings in this category.").setValue(true); + this.slowChunkLoading = new Setting(this.settingsList, "Slow chunk loading", "Determines how fast chunks should load as a percentage." + + "\n§e§oHigher values may increase performance!" + + "\n§6§oHigher values will make chunks load slower." + + "\n" + + "\n§276% - 100%:§r Slowest chunk loading speed (Higher FPS)." + + "\n§a51% - 75%:§r Slow chunk loading speed (High FPS)." + + "\n§e50%:§r Medium chunk loading speed (Medium FPS)." + + "\n§626% - 49%:§r Fast chunk loading speed (Low FPS)." + + "\n§c0.1% - 25%:§r Faster chunk loading speed (Lower FPS)." + + "\n§b0%:§r Vanilla chunk loading speed (Lowest FPS).").setMinMax(0.0f, 100.0f).setValue(70.0f).setUnit("%").setCenterLabel("MEDIUM").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.enableFpsBoost.getValue()); + this.fullBright = new Setting(this.settingsList, "Fullbright", "Set the brightness/gamma to the max.").setValue(true).setCondition(() -> (Boolean) this.enableFpsBoost.getValue()); + this.entityShadows = new Setting(this.settingsList, "Entity Shadows", "Draws a shadow below entities.").setValue(true); + this.hideGroundedArrows = new Setting(this.settingsList, "Hide Grounded Arrows").setValue(false); + this.hideFoliage = new Setting(this.settingsList, "Hide Foliage", "Hides things like tall grass, flowers, and shrubs").setValue(false).onChange(e -> CheatBreaker.getInstance().getMc().renderGlobal.loadRenderers()); + this.hideStuckArrows = new Setting(this.settingsList, "Hide Stuck Arrows").setValue(false); + this.hideMovingArrows = new Setting(this.settingsList, "Hide Moving Arrows").setValue(false); + this.hidePlacedSkulls = new Setting(this.settingsList, "Hide Placed Skulls").setValue(false); + this.fpsLimitSettingsLabel = new Setting(this.settingsList, "label").setValue("FPS Limiting Settings"); + this.useCustomFPSLimiter = new Setting(this.settingsList, "Use Custom FPS Limiter", "Overrides the default FPS limiter with a custom one." + + "\n§e§oWill not override when VSync is enabled.").setValue(false); + this.limitWhenUnfocused = new Setting(this.settingsList, "Limit When Game is Unfocused", "Limits the FPS when you are not interacting with the game.").setValue(false); + this.customFPSLimit = new Setting(this.settingsList, "Maximum FPS").setMinMax(5, 1000).setValue(390).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.useCustomFPSLimiter.getValue()); + this.unfocusedFPS = new Setting(this.settingsList, "Unfocused FPS").setMinMax(1, 390).setValue(60).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.limitWhenUnfocused.getValue()); +// this.limitWhenInactive = new Setting(this.settingsList, "Limit When Inactive", "Limits the FPS when your player is focused on the game but is not interacting for a certain period of time.").setValue(false); +// this.inactiveFPS = new Setting(this.settingsList, "Inactive FPS").setMinMax(15, 390).setValue(60).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52").setCondition(() -> (Boolean) this.limitWhenInactive.getValue()); + this.mainMenuFPS = new Setting(this.settingsList, "Main Menu FPS").setMinMax(30, 500).setValue(90).setUnit(" FPS").setIcons("fps-inverse-52", "fps-52"); + + this.teamViewLabel = new Setting(this.settingsList, "label").setValue("Team View Settings"); + this.enableTeamView = new Setting(this.settingsList, "Enable Team View", "Enables the Team View.").setValue(true); + this.showOffScreenMarker = new Setting(this.settingsList, "Show off-screen marker", "Show a marker above players.").setValue(true).setCondition(() -> (Boolean) this.enableTeamView.getValue()); + this.showDistance = new Setting(this.settingsList, "Show distance", "Show the distance amount above a your teammates' heads.").setValue(true).setCondition(() -> (Boolean) this.enableTeamView.getValue()); + +// this.generalSettingsLabel = new Setting(this.settingsList, "label").setValue("General Settings"); + this.currentMenuSetting = new Setting(this.settingsList, "Current Menu", "Sets which main menu should show." + + "\n" + + "\n0: 2017" + + "\n1: 2018" + + "\n2: 2016").setMinMax(0, 2).setValue(1); +// this.lookView = new Setting(this.settingsList, "Look View").setValue("Third").acceptedStringValues("Third", "Reverse", "First"); + + this.displaySettingsLabel = new Setting(this.settingsList, "label").setValue("Display Settings"); + this.borderlessFullscreen = new Setting(this.settingsList, "Borderless Fullscreen").setValue(false).onChange(value -> { + if (Minecraft.getMinecraft().isFullScreen() && Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + Minecraft.getMinecraft().toggleFullscreen(); + Minecraft.getMinecraft().toggleFullscreen(); + + HudLayoutEditorGui hudEditor = new HudLayoutEditorGui(); + Minecraft.getMinecraft().displayGuiScreen(hudEditor); + hudEditor.currentScrollableElement = hudEditor.settingsElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).resetColor = true; + HudLayoutEditorGui.instance.settingsElement.scrollAmount = CheatBreaker.getInstance().getModuleManager().lastSettingScrollPos; + } + }); + this.unfullscreenWhenUnfocused = new Setting(this.settingsList, "Unfullscreen when Unfocused").setValue(false); + + this.hudEditorSettingsLabel = new Setting(this.settingsList, "label").setValue("Hud Editor Settings"); + this.compactMode = new Setting(this.settingsList, "Mod List").setValue("Normal").acceptedStringValues("Normal", "Compact").setCustomizationLevel(CustomizationLevel.ADVANCED).onChange(value -> { + if (Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + HudLayoutEditorGui hudEditor = new HudLayoutEditorGui(); + Minecraft.getMinecraft().displayGuiScreen(hudEditor); + hudEditor.currentScrollableElement = hudEditor.modulesElement; + } + }); + this.darkMode = new Setting(this.settingsList, "Dark Mode", "Switch between light and dark mode.").setValue(false); + this.customizationLevel = new Setting(this.settingsList, "Customization Level").setValue("Simple").acceptedStringValues("Simple", "Medium", "Advanced"); + this.showModName = new Setting(this.settingsList, "Show Mod Name (GUI)").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); +// this.useBackgroundOverlay = new Setting(this.settingsList, "Use Background overlay (GUI)").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.snapModules = new Setting(this.settingsList, "Snap mods to other mods (GUI)").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.snappingStrength = new Setting(this.settingsList, "Snapping Strength").setValue(2.0F).setMinMax(1.0F, 10.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.snapModules.getValue()); + + this.renderSettingsLabel = new Setting(this.settingsList, "label").setValue("Render Settings"); + this.showPotionInfo = new Setting(this.settingsList, "Show Potion info in inventory").setValue(true).setCondition(() -> CheatBreaker.getInstance().getModuleManager().potionEffectsMod.isEnabled()); + this.shiftPotionInfo = new Setting(this.settingsList, "Potion info shifts inventory", "Choose to make the potion info shift the inventory position.").setValue(false); + this.achievements = new Setting(this.settingsList, "Show Achievements").setValue(true); + this.showHudInDebug = new Setting(this.settingsList, "Show HUD while in debug view", "Show the CheatBreaker HUD when the debug view is open.").setValue(false); + this.guiBlur = new Setting(this.settingsList, "GUI Blur", "Blurs the menus.").onChange(value -> { + Minecraft.getMinecraft().entityRenderer.loadGuiBlurShader(); + }).setValue(false); + this.containerBackground = new Setting(this.settingsList, "Container Background").setValue("CheatBreaker").acceptedStringValues("Vanilla", "CheatBreaker", "None"); + this.bottomSkyLayer = new Setting(this.settingsList, "Show Bottom Sky Layer").setValue("No Custom Sky").acceptedStringValues("OFF", "No Custom Sky", "ON").setCondition(Config::isSkyEnabled); + + this.streamerModeSettingsLabel = new Setting(this.settingsList, "label").setValue("Streamer Mode Settings"); + this.streamerMode = new Setting(this.settingsList, "Streamer Mode", "Enables Streamer Mode Features").setValue(false); + this.disableModMenuKeybind = new Setting(this.settingsList, "Disable Mod Menu Keybind", "Disables the Mod Menu keybind from opening the Mod Menu when Streamer Mode is enabled.").setValue(true).setCondition(() -> this.streamerMode.getBooleanValue()); + this.notifyWhenModMenuKeybindPressed = new Setting(this.settingsList, "Notify when pressed", "Notifies when the player presses the Mod Menu keybind while disabled.").setValue(true).setCondition(() -> this.streamerMode.getBooleanValue() && this.disableModMenuKeybind.getBooleanValue()); + this.holdDownModsGameMenuButton = new Setting(this.settingsList, "Require Mods Button Held in Game Menu", "Requires the mouse to be held for a certain period of time when clicking on Mods.").setValue(true).setCondition(() -> this.streamerMode.getBooleanValue()); + this.holdDuration = new Setting(this.settingsList, "Hold Duration", "The amount of time the Mods button must be held down before entering the Mod Menu.").setValue(5.0F).setMinMax(1.0F, 10.0F).setUnit("s").setCondition(() -> this.streamerMode.getBooleanValue() && this.holdDownModsGameMenuButton.getBooleanValue()); + + this.packSettingsLabel = new Setting(this.settingsList, "label").setValue("Resource Pack Settings").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.widePackMenu = new Setting(this.settingsList, "Wide Pack Menu").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.transparentBackground = new Setting(this.settingsList, "Transparent background", "Remove the dirt background in the resource pack menu.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.packFolderInfo = new Setting(this.settingsList, "Show Pack Folder Information", "Show the ").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packFolderIcons = new Setting(this.settingsList, "Show Pack Folder Icons").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packIcons = new Setting(this.settingsList, "Show Pack Icons").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packDescriptions = new Setting(this.settingsList, "Show Pack Descriptions").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packSearchBar = new Setting(this.settingsList, "Show Search Bar").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.packSortMethod = new Setting(this.settingsList, "Sort Method", "Sort packs in a specific order." + + "\n" + + "\n§bA-Z:§r Sort packs alphabetically starting from A to Z." + + "\n§bZ-A:§r Sort packs alphabetically in reverse starting from Z to A.").setValue("A-Z").acceptedStringValues("A-Z", "Z-A").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.packSmoothScrolling = new Setting(this.settingsList, "Smooth Scrolling", "Makes scrolling smooth").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.packListBackgroundColor = new Setting(this.settingsList, "List Background color", "Change the background color in the resource pack lists.").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.keybindHandlingSettingsLabel = new Setting(this.settingsList, "label").setValue("Keybind Handling Settings"); + this.keybindFix = new Setting(this.settingsList, "Modern Keybind Handling").setValue(true); + this.excludeSneakKeybind = new Setting(this.settingsList, "Exclude Sneak Keybind").setValue(true).setCondition(() -> (Boolean) this.keybindFix.getValue()); + this.excludeThrowKeybind = new Setting(this.settingsList, "Exclude Block/Throw Keybind").setValue(true).setCondition(() -> (Boolean) this.keybindFix.getValue()); + + this.scalingSettingsLabel = new Setting(this.settingsList, "label").setValue("Scaling Settings"); + this.modScale = new Setting(this.settingsList, "Mod Scale").setValue("Default").acceptedStringValues("Default", "Small", "Normal", "Large", "Auto"); + this.modScaleMultiplier = new Setting(this.settingsList, "Mod Scale Multiplier").setValue(1.0F).setMinMax(0.25F, 2.0F).setUnit("x"); + this.hotbarScale = new Setting(this.settingsList, "Hotbar Scale").setValue("Default").acceptedStringValues("Default", "Small", "Normal", "Large", "Auto"); + this.hotbarScaleMultiplier = new Setting(this.settingsList, "Hotbar Scale Multiplier").setValue(1.0F).setMinMax(0.25F, 2.0F).setUnit("x"); + this.scaleModsDownSmallerResoltion = new Setting(this.settingsList, "Use Legacy Scaling").setValue(false); + + this.screenshotSettingsLabel = new Setting(this.settingsList, "label").setValue("Screenshot Settings").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.shutterSound = new Setting(this.settingsList, "Make Shutter Sound").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.copyAutomatically = new Setting(this.settingsList, "Copy Screenshot Automatically").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.sendScreenshotMessage = new Setting(this.settingsList, "Send Message").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.compactOptions = new Setting(this.settingsList, "Compact Options").setValue(false).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + this.openOption = new Setting(this.settingsList, "Show Open Option").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + this.copyOption = new Setting(this.settingsList, "Show Copy Option").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + this.uploadOption = new Setting(this.settingsList, "Show Upload Option").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.sendScreenshotMessage.getValue()); + + this.cosmeticSettingsLabel = new Setting(this.settingsList, "label").setValue("Cosmetic Settings"); + this.showOptifineCapes = new Setting(this.settingsList, "Show OptiFine Capes").setValue(true); + this.showOptifineHats = new Setting(this.settingsList, "Show OptiFine Hats").setValue(true); + this.showCheatBreakerCapes = new Setting(this.settingsList, "Show CheatBreaker Capes").setValue(true); + this.showCheatBreakerWings = new Setting(this.settingsList, "Show CheatBreaker Wings").setValue(true); + + String os = System.getProperty("os.name").toLowerCase(); + this.rpcSettings = (new Setting(this.settingsList, "label")).setValue("Discord Rich Presence Settings").setCondition(() -> os.contains("win")); + this.showRPC = (new Setting(this.settingsList, "Show Discord Rich Presence")).setValue(true).setCondition(() -> os.contains("win")).onChange(value -> { + if (os.contains("win") && Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + try { + if ((Boolean) value) { + CheatBreaker.getInstance().connectDiscordIPC(); + } else { + CheatBreaker.getInstance().getRpcClient().close(); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + }); + + this.showServer = (new Setting(this.settingsList, "Show Active Server")).setValue(true).setCondition(() -> os.contains("win") && this.showRPC.getBooleanValue()).onChange(value -> this.updateRPC()); + this.showAccount = (new Setting(this.settingsList, "Show Active Account")).setValue(true).setCondition(() -> os.contains("win") && this.showRPC.getBooleanValue()).onChange(value -> this.updateRPC()); + + this.colorSettingsLabel = new Setting(this.settingsList, "label").setValue("Color Settings"); + this.resetColors = new Setting(this.settingsList, "Apply Default Color When Enabling Mods").setValue(true); + this.defaultColor = new Setting(this.settingsList, "Default color", "Change the default color that will be displayed when mods are enabled.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.emoteRadialColor = new Setting(this.settingsList, "Emote Radial color", "Change the color for the highlighted radial in emotes.").setValue(0x8033334D).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM); +// this.pinnedServers.add(new String[]{"Minemen Club [NA]", "na.minemen.club"}); +// this.pinnedServers.add(new String[]{"Minemen Club [EU]", "eu.minemen.club"}); + this.unsafeServers.add(new String[]{"warnedserver.us", "This server is a test IP for warned servers", String.valueOf(UnsafeServerAction.WARN)}); + this.unsafeServers.add(new String[]{"blockedserver.us", "This server is a test IP for blocked servers", String.valueOf(UnsafeServerAction.BLOCK)}); + + this.unsafeServers.add(new String[]{"bridge.rip", "Bridge Network is unsafe.", String.valueOf(UnsafeServerAction.WARN)}); + this.unsafeServers.add(new String[]{"potpvp.com", "Potpvp is unsafe.", String.valueOf(UnsafeServerAction.WARN)}); + + GameSettings gameSettings = Minecraft.getMinecraft().gameSettings; +// this.keyBindVoicePushToTalk = new KeyBinding("Voice Chat", 47, "CheatBreaker Client", true); + this.keyBindOpenMenu = new KeyBinding("Open Menu", 54, "CheatBreaker Client", true); +// this.keyBindOpenVoiceMenu = new KeyBinding("Open Voice Menu", 25, "CheatBreaker Client", true); + this.keyBindDragToLook = new KeyBinding("Drag to look", 56, "CheatBreaker Client", true); + this.keyBindBackLook = new KeyBinding("Back look", 0, "CheatBreaker Client", true); + this.keyBindFrontLook = new KeyBinding("Front look", 0, "CheatBreaker Client", true); + this.keyBindEmote = new KeyBinding("Emote", Keyboard.KEY_B, "CheatBreaker Client", true); + gameSettings.keyBindings = ArrayUtils.addAll(gameSettings.keyBindings, /*this.keyBindVoicePushToTalk, */this.keyBindOpenMenu, /*this.keyBindOpenVoiceMenu, */this.keyBindDragToLook, this.keyBindBackLook, this.keyBindFrontLook, this.keyBindEmote ); + } + + public MainMenuBase.MenuTypes getCurrentMenu() { + return MainMenuBase.MenuTypes.values()[(int) currentMenuSetting.getValue()]; + } + + public boolean isFavouriteColor(int colorValue) { + ColorPickerColorElement var3; + Iterator var2 = this.favouriteColors.iterator(); + do { + if (!var2.hasNext()) { + return false; + } + var3 = var2.next(); + } while (var3.color != colorValue); + return true; + } + + public void removeFavouriteColor(int colorValue) { + this.favouriteColors.removeIf(var1x -> var1x.color == colorValue); + } + + private void updateRPC() { + try { + if (Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui) { + String account = this.showAccount.getBooleanValue() ? Minecraft.getMinecraft().getSession().getUsername() : null; + CheatBreaker.getInstance().updateServerInfo(account); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/Profile.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/Profile.java new file mode 100644 index 0000000..fc29758 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/config/Profile.java @@ -0,0 +1,24 @@ +package com.cheatbreaker.client.config; + +public class Profile { + private String name; + private boolean notEditable = false; + public int index = 0; + + public Profile(String name, boolean notEditable) { + this.name = name; + this.notEditable = notEditable; + } + + public String getName() { + return this.name; + } + + public boolean isNotEditable() { + return this.notEditable; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/Cosmetic.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/Cosmetic.java new file mode 100644 index 0000000..c6d0de1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/Cosmetic.java @@ -0,0 +1,87 @@ +package com.cheatbreaker.client.cosmetic; + +import lombok.Getter; +import lombok.Setter; +import net.minecraft.util.ResourceLocation; + +/** + * This defines the CheatBreaker Client's cosmetic Object. + */ +@Getter +@Setter +public class Cosmetic { + private String playerId; + private String name; + + private CosmeticType type; + + private float scale; + + private int emoteId; + + private long lastUpdate; + + private boolean equipped; + + private ResourceLocation location; + private ResourceLocation previewLocation; + + /** + * This should be used for animated capes. + */ + public Cosmetic(long time, String playerId, String name, CosmeticType type, float scale, boolean equipped, String location) { + this.lastUpdate = time; + this.playerId = playerId; + this.name = name; + this.type = type; + this.scale = scale; + this.equipped = equipped; + this.location = new ResourceLocation(location); + this.previewLocation = new ResourceLocation("client/preview/" + location.replaceAll("client/", "")); + } + + /** + * This is the normal capes/wings + */ + public Cosmetic(String playerId, String name, CosmeticType type, float scale, boolean equipped, String location) { + this.playerId = playerId; + this.name = name; + this.type = type; + this.scale = scale; + this.equipped = equipped; + this.location = new ResourceLocation(location); + this.previewLocation = new ResourceLocation("client/preview/" + location.replace("client/", "")); + } + + /** + * This is for emotes, this will be setup at a later time. + */ + public Cosmetic(String playerId, int emoteId, CosmeticType type) { + this.playerId = playerId; + this.emoteId = emoteId; + this.type = type; + } + + /** + * This defines the type of cosmetic that the player has. + */ + public enum CosmeticType { + WINGS("dragon_wings"), + CAPE("cape"), + EMOTE("emote"); + + @Getter private final String typeName; + CosmeticType(String typeName) { + this.typeName = typeName; + } + + public static CosmeticType get(String name) { + for (Cosmetic.CosmeticType cosmetic : CosmeticType.values()) { + if (cosmetic.getTypeName().equals(name)) { + return cosmetic; + } + } + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/CosmeticManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/CosmeticManager.java new file mode 100644 index 0000000..0d9f902 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/CosmeticManager.java @@ -0,0 +1,60 @@ +package com.cheatbreaker.client.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@Getter +@Setter +public class CosmeticManager { + + private final List capes = new ArrayList<>(); + private final List wings = new ArrayList<>(); + private final ProfileHandler profileHandler = CheatBreaker.getInstance().getProfileHandler(); + + public List getFullCosmeticList() { + ArrayList cosmetics = new ArrayList<>(); + + // Adds the wings first so that they are at the front of the list always. + for (Cosmetic wing : this.wings) { + if (!wing.getPlayerId().equals(Minecraft.getMinecraft().getSession().getPlayerID())) continue; + cosmetics.add(wing); + } + + for (Cosmetic cape : this.capes) { + if (!cape.getPlayerId().equals(Minecraft.getMinecraft().getSession().getPlayerID())) continue; + cosmetics.add(cape); + } + + return cosmetics; + } + + public Cosmetic getActiveCape(UUID uuid) { + for (Cosmetic cape : this.getCapes()) { + if (cape.isEquipped() && uuid.toString().equals(cape.getPlayerId())) { + return cape; + } + } + return null; + } + + public Cosmetic getActiveWings(UUID uuid) { + for (Cosmetic wing : this.getWings()) { + if (wing.isEquipped() && uuid.toString().equals(wing.getPlayerId())) { + return wing; + } + } + return null; + } + + public void clearCosmetics(String uuid) { + this.getCapes().removeIf(cape -> cape.getPlayerId().equals(uuid)); + this.getWings().removeIf(wings -> wings.getPlayerId().equals(uuid)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/Emote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/Emote.java new file mode 100644 index 0000000..63d2dfe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/Emote.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.AbstractFade; +import lombok.Getter; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.util.ResourceLocation; + +@Getter +public abstract class Emote { + protected final AbstractFade duration; + private final String name; + private final ResourceLocation resourceLocation; + + public Emote(String string, AbstractFade duration) { + this.duration = duration; + duration.startAnimation(); + this.name = string; + this.resourceLocation = new ResourceLocation("client/emote/" + string.toLowerCase().replace("-", "").replace(" ", "") + ".png"); + } + + public abstract void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks); + + public abstract void tickEmote(AbstractClientPlayer player, float partialTicks); + + public boolean isEmoteOver() { + return this.duration.isOver(); + } + + protected void endEmote(AbstractClientPlayer abstractClientPlayer) { + if (abstractClientPlayer == null) { + return; + } + + if (abstractClientPlayer.getUniqueID().equals(Minecraft.getMinecraft().getSession().getUniqueID())) { + if (CheatBreaker.getInstance().getEmoteManager().isDoingEmote()) { + Minecraft.getMinecraft().gameSettings.thirdPersonView = 0; + CheatBreaker.getInstance().getEmoteManager().setDoingEmote(false); + CheatBreaker.getInstance().getEmoteManager().setSendingEmote(false); + } + } + } + + public ResourceLocation getResourceLocation() { + return this.resourceLocation; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/EmoteManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/EmoteManager.java new file mode 100644 index 0000000..7c1a684 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/EmoteManager.java @@ -0,0 +1,143 @@ +package com.cheatbreaker.client.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.data.AnimationStage; +import com.cheatbreaker.client.cosmetic.type.emote.*; +import com.cheatbreaker.client.event.impl.ClickStateEvent; +import com.cheatbreaker.client.event.impl.KeyboardEvent; +import com.cheatbreaker.client.event.impl.PlayerAnimationEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.network.websocket.shared.WSPacketEmote; +import com.cheatbreaker.client.ui.cosmetic.EmoteGUI; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.entity.player.EntityPlayer; + +import java.util.*; + +@Getter +public class EmoteManager { + public static final BiMap emotes = ImmutableBiMap.builder() + .put(0, WaveEmote.class) + .put(1, HandsUpEmote.class) + .put(2, FlossEmote.class) + .put(3, DabEmote.class) + .put(4, TPoseEmote.class) + .put(5, ShrugEmote.class) + .put(6, FacepalmEmote.class) + .put(7, NarutoRunEmote.class) + .put(8, SuperFacepalmEmote.class).build(); + + private final Map activeEmotes = new HashMap<>(); + private List ownedEmotes = new ArrayList<>(); + + @Setter private boolean doingEmote; + @Setter private boolean sendingEmote; + + public EmoteManager() { + ownedEmotes.addAll(emotes.keySet()); + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + CheatBreaker.getInstance().getEventBus().addEvent(PlayerAnimationEvent.class, this::onPlayerAnimation); + CheatBreaker.getInstance().getEventBus().addEvent(ClickStateEvent.class, (event) -> { + if (event.getMouseButton() == 0 && event.isState()) { + this.stopEmote(Minecraft.getMinecraft().thePlayer); + } + + }); + CheatBreaker.getInstance().getEventBus().addEvent(KeyboardEvent.class, (event) -> { + if (Minecraft.getMinecraft().currentScreen == null && !this.ownedEmotes.isEmpty() && event.getPressed() == CheatBreaker.getInstance().getGlobalSettings().keyBindEmote.getKeyCode()) { + Minecraft.getMinecraft().displayGuiScreen(new EmoteGUI(event.getPressed())); + } + + }); + } + + public void playEmote(Emote emote) { + if (this.hasEmote(emote)) { + if (this.doingEmote) { + this.doingEmote = false; + this.sendingEmote = true; + } + + this.stopEmote(Minecraft.getMinecraft().thePlayer); + int emoteId = (Integer)emotes.inverse().get(emote.getClass()); + CheatBreaker.getInstance().getWSNetHandler().sendPacket( + new WSPacketEmote(Minecraft.getMinecraft().thePlayer.getUniqueID(), emoteId)); + } + } + + private boolean hasEmote(Emote var1) { + return ownedEmotes.contains(emotes.inverse().get(var1)); + } + + public Emote getEmote(int var1) { + if (!emotes.containsKey(var1)) { + return null; + } else { + try { + return (Emote)((Class)emotes.get(var1)).newInstance(); + } catch (Exception var3) { + var3.printStackTrace(); + return null; + } + } + } + + public void playEmote(AbstractClientPlayer player, Emote var2) { + if (player.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) { + if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 || this.sendingEmote) { + Minecraft.getMinecraft().gameSettings.thirdPersonView = 1; + this.doingEmote = true; + } + + this.sendingEmote = false; + } + this.activeEmotes.putIfAbsent(player.getUniqueID(), var2); + } + + public void stopEmote(AbstractClientPlayer var1) { + if (this.activeEmotes.containsKey(var1.getUniqueID())) { + Emote var2 = this.activeEmotes.get(var1.getUniqueID()); + var2.endEmote(var1); + this.activeEmotes.remove(var1.getUniqueID()); + } + } + + private void onTick(TickEvent event) { + if (!this.activeEmotes.isEmpty()) { + ArrayList list = new ArrayList<>(); + this.activeEmotes.forEach((uuid, emote) -> { + EntityPlayer var3 = Minecraft.getMinecraft().theWorld.func_152378_a(uuid); + if (emote.isEmoteOver()) { + emote.endEmote((AbstractClientPlayer)var3); + list.add(uuid); + } + + }); + list.forEach(this.activeEmotes::remove); + } + } + + private void onPlayerAnimation(PlayerAnimationEvent event) { + Emote activeEmotes = this.activeEmotes.get(event.getPlayer().getUniqueID()); + if (activeEmotes != null) { + if (event.getStage() == AnimationStage.START) { + activeEmotes.playEmote(event.getPlayer(), event.getModel(), event.getPartialTicks()); + } else { + activeEmotes.tickEmote(event.getPlayer(), event.getPartialTicks()); + } + } + } + + public List getEmotes() { + return this.ownedEmotes; + } + + public void setEmotes(List emotes) { + this.ownedEmotes = emotes; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/data/AnimationStage.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/data/AnimationStage.java new file mode 100644 index 0000000..ae6063d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/data/AnimationStage.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.cosmetic.data; + +public enum AnimationStage { + START, + END +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/profile/ClientProfile.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/profile/ClientProfile.java new file mode 100644 index 0000000..aec851b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/profile/ClientProfile.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.cosmetic.profile; + +import lombok.*; + +/** + * Defines the CheatBreaker Client's player profile. + * This is currently only used for Player Icons, however will probably be used for more later. + */ +@Getter +@AllArgsConstructor +public class ClientProfile { + @Setter private String username; + private int color; + private int color2; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/profile/ProfileHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/profile/ProfileHandler.java new file mode 100644 index 0000000..dabd2d0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/profile/ProfileHandler.java @@ -0,0 +1,56 @@ +package com.cheatbreaker.client.cosmetic.profile; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleNickHider; +import lombok.Getter; +import net.minecraft.client.Minecraft; + +import java.util.*; + +/** + * Handles everything to do with ClientProfiles. + */ +public class ProfileHandler { + @Getter private final Map wsOnlineUsers = new HashMap<>(); + + /** + * Returns a ClientProfile based on a player's UUID. + */ + public ClientProfile getProfile(String playerId) { + return this.getWsOnlineUsers().get(UUID.fromString(playerId)); + } + + /** + * Returns a dashed UUID since 1.7 is weird as fuck. + */ + public String recompileUUID(String uuidIn) { + return UUID.fromString(uuidIn.replaceAll("-", "").replaceFirst("(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5")).toString(); + } + + public boolean validate(String target, boolean username) { + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + + if (username) { + try { + for (ClientProfile profile : this.wsOnlineUsers.values()) { + if (target.contains(profile.getUsername()) || (nickHider.hideRealName.getBooleanValue() && target.contains(nickHider.customNameString.getStringValue()))) { + return true; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } else { + try { + for (UUID playerId : this.wsOnlineUsers.keySet()) { + if (UUID.fromString(target).equals(playerId)) { + return true; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/DabEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/DabEmote.java new file mode 100644 index 0000000..4bcf822 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/DabEmote.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class DabEmote extends Emote { + private final MinMaxFade name = new MinMaxFade(250L); + private final MinMaxFade resourceLoc = new MinMaxFade(250L); + + public DabEmote() { + super("Dab", new MinMaxFade(1000L)); + this.name.startAnimation(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + float var4 = 1.0F; + if (this.name.getDuration() > this.duration.llIIllIlIlllllIlIllIIlIll()) { + var4 = this.name.getFadeAmount(); + } else if (this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.resourceLoc.getDuration()) { + if (!this.resourceLoc.isTimeNotAtZero()) { + this.resourceLoc.startAnimation(); + } + + var4 = 1.0F - this.resourceLoc.getFadeAmount(); + } + + model.bipedRightArm.rotateAngleX = (float)Math.toRadians(-90.0F * var4); + model.bipedRightArm.rotateAngleY = (float)Math.toRadians(-35.0F * var4); + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians(15.0F * var4); + model.bipedLeftArm.rotateAngleY = (float)Math.toRadians(15.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(-110.0F * var4); + float var5 = player.rotationPitch; + float var6 = player.prevRenderYawOffset - player.rotationYaw; + model.bipedHead.rotateAngleX = (float)Math.toRadians(-var5 * var4) + (float)Math.toRadians(45.0F * var4 + var5); + model.bipedHead.rotateAngleY = (float)Math.toRadians(var6 * var4) + (float)Math.toRadians(35.0F * var4 - var6); + model.bipedHeadwear.rotateAngleX = (float)Math.toRadians(-var5 * var4) + (float)Math.toRadians(45.0F * var4 + var5); + model.bipedHeadwear.rotateAngleY = (float)Math.toRadians(var6 * var4) + (float)Math.toRadians(35.0F * var4 - var6); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FacepalmEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FacepalmEmote.java new file mode 100644 index 0000000..07ace00 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FacepalmEmote.java @@ -0,0 +1,64 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class FacepalmEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(150L); + private final ExponentialFade endTransitionTime = new ExponentialFade(200L); + private final CosineFade headShakeTime = new CosineFade(300L); + private final float headXRotationAngle = (float)Math.toRadians(45.0); + private final float rightArmYRotationAngle = (float)Math.toRadians(-30.0); + private final float rightArmXRotationAngle = (float)Math.toRadians(-100.0); + + public FacepalmEmote() { + super("Facepalm", new FloatFade(2000L)); + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + float var4 = this.startTransitionTime.getFadeAmount(); + if (!this.startTransitionTime.isTimeNotAtZero() && this.duration.llIIllIlIlllllIlIllIIlIll() >= 150L) { + this.startTransitionTime.startAnimation(); + } + + if (this.startTransitionTime.isTimeNotAtZero()) { + if (this.startTransitionTime.isOver() && !this.headShakeTime.isZeroOrLess() && !this.endTransitionTime.isTimeNotAtZero()) { + this.headShakeTime.startAnimation(); + } + + float var5 = model.bipedHead.rotateAngleX; + float var6 = model.bipedHead.rotateAngleY; + model.bipedHead.rotateAngleZ = -((float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHeadwear.rotateAngleZ = -((float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHead.rotateAngleY = (float)Math.toRadians(10.0) * var4 - (float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHeadwear.rotateAngleY = (float)Math.toRadians(10.0) * var4 - (float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHead.rotateAngleX = this.headXRotationAngle * var4; + model.bipedHeadwear.rotateAngleX = this.headXRotationAngle * var4; + model.bipedRightArm.rotateAngleY = this.rightArmYRotationAngle * var4 - (this.endTransitionTime.isTimeNotAtZero() ? 0.0F : (float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedRightArm.rotateAngleX = this.rightArmXRotationAngle * var4; + if (!this.endTransitionTime.isTimeNotAtZero() && this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.endTransitionTime.getDuration()) { + this.endTransitionTime.startAnimation(); + } + + if (this.endTransitionTime.isTimeNotAtZero()) { + var4 = this.endTransitionTime.getFadeAmount(); + model.bipedHead.rotateAngleY = var6 * var4; + model.bipedHeadwear.rotateAngleY = var6 * var4; + model.bipedHead.rotateAngleZ = 0.0F; + model.bipedHeadwear.rotateAngleZ = 0.0F; + model.bipedHead.rotateAngleX -= (this.headXRotationAngle - var5) * var4; + model.bipedHeadwear.rotateAngleX -= (this.headXRotationAngle - var5) * var4; + model.bipedRightArm.rotateAngleY -= this.rightArmYRotationAngle * var4; + model.bipedRightArm.rotateAngleX -= this.rightArmXRotationAngle * var4; + } + + } + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FlossEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FlossEmote.java new file mode 100644 index 0000000..1e08c41 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/FlossEmote.java @@ -0,0 +1,101 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class FlossEmote extends Emote { + private final ExponentialFade swapTransitionTime = new ExponentialFade(375L); + private final CosineFade swingTransitionTime = new CosineFade(375L); + private final CosineFade bodyRotationTransitionTime = new CosineFade(250L); + boolean swap = false; + private FlossStage flossStage; + + public FlossEmote() { + super("Floss", new FloatFade(7500L)); + this.bodyRotationTransitionTime.startAnimation(); + this.flossStage = FlossStage.LEFT_TO_RIGHT; + } + + @Override + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + @Override + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + if (!this.swapTransitionTime.isTimeNotAtZero()) { + if ((double)this.bodyRotationTransitionTime.getFadeAmount() >= 0.5) { + this.swapTransitionTime.startAnimation(); + this.swingTransitionTime.startAnimation(); + } + } else if (this.swapTransitionTime.isOver()) { + this.swapTransitionTime.startAnimation(); + this.swingTransitionTime.startAnimation(); + this.flossStage = this.getFlossStage(); + } + if (this.bodyRotationTransitionTime.isOver()) { + this.swap = !this.swap; + this.bodyRotationTransitionTime.startAnimation(); + } + float f2 = this.swapTransitionTime.getFadeAmount(); + float f3 = this.swingTransitionTime.getFadeAmount(); + model.bipedRightArm.rotateAngleX = (float)Math.toRadians((float)(this.flossStage == FlossStage.RIGHT_TO_BACK ? 45 : -45) * f3); + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians((float)(this.flossStage == FlossStage.LEFT_TO_BACK ? 45 : -45) * f3); + float f4 = 150.0f; + float f5 = f4 / 2.0f; + switch (this.flossStage) { + case LEFT_TO_RIGHT: + model.bipedRightArm.rotateAngleZ = (float)Math.toRadians(f4 * f2 - f5); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(f4 * f2 - f5); + break; + case RIGHT_TO_BACK: + model.bipedRightArm.rotateAngleZ = (float)Math.toRadians(f5 - f5 * f3); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(f5 - f5 * f3); + break; + case RIGHT_TO_LEFT: + model.bipedRightArm.rotateAngleZ = (float)Math.toRadians(-f4 * f2 + f5); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(-f4 * f2 + f5); + break; + case LEFT_TO_BACK: + model.bipedRightArm.rotateAngleZ = (float)Math.toRadians(f5 * f3 - f5); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(f5 * f3 - f5); + } + f3 = this.bodyRotationTransitionTime.getFadeAmount(); + if (this.swap) { + model.bipedBody.rotateAngleZ = (float)Math.toRadians(-15.0f * f3); + model.bipedCloak.rotateAngleZ = (float)Math.toRadians(15.0f * f3); + model.bipedRightLeg.rotateAngleZ = (float)Math.toRadians(15.0f * f3); + model.bipedLeftLeg.rotateAngleZ = (float)Math.toRadians(15.0f * f3); + model.bipedLeftLeg.offsetX = 0.2f * f3; + model.bipedRightLeg.offsetX = 0.2f * f3; + } else { + model.bipedBody.rotateAngleZ = (float)Math.toRadians(15.0f * f3); + model.bipedCloak.rotateAngleZ = (float)Math.toRadians(-15.0f * f3); + model.bipedRightLeg.rotateAngleZ = (float)Math.toRadians(-15.0f * f3); + model.bipedLeftLeg.rotateAngleZ = (float)Math.toRadians(-15.0f * f3); + model.bipedLeftLeg.offsetX = -0.2f * f3; + model.bipedRightLeg.offsetX = -0.2f * f3; + } + } + + private FlossStage getFlossStage() { + switch (this.flossStage) { + default: + return FlossStage.RIGHT_TO_BACK; + case RIGHT_TO_BACK: + return FlossStage.RIGHT_TO_LEFT; + case RIGHT_TO_LEFT: + return FlossStage.LEFT_TO_BACK; + case LEFT_TO_BACK: + } + return FlossStage.LEFT_TO_RIGHT; + } + + enum FlossStage { + LEFT_TO_RIGHT, RIGHT_TO_LEFT, RIGHT_TO_BACK, LEFT_TO_BACK + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/HandsUpEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/HandsUpEmote.java new file mode 100644 index 0000000..80e9ddf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/HandsUpEmote.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class HandsUpEmote extends Emote { + private final MinMaxFade startTransitionTime = new MinMaxFade(250L); + private final MinMaxFade endTransitionTime = new MinMaxFade(250L); + + public HandsUpEmote() { + super("Hands Up", new FloatFade(2000L)); + this.startTransitionTime.startAnimation(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + float var4 = 1.0F; + if (this.startTransitionTime.getDuration() > this.duration.llIIllIlIlllllIlIllIIlIll()) { + var4 = this.startTransitionTime.getFadeAmount(); + } else if (this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.endTransitionTime.getDuration()) { + if (!this.endTransitionTime.isTimeNotAtZero()) { + this.endTransitionTime.startAnimation(); + } + + var4 = 1.0F - this.endTransitionTime.getFadeAmount(); + } + + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians(-180.0F * var4); + model.bipedRightArm.rotateAngleX = (float)Math.toRadians(-180.0F * var4); + model.bipedRightArm.rotateAngleZ = (float)Math.toRadians(-15.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(15.0F * var4); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/InfiniteDabEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/InfiniteDabEmote.java new file mode 100644 index 0000000..e4e5fc0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/InfiniteDabEmote.java @@ -0,0 +1,69 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class InfiniteDabEmote extends Emote { + private final MinMaxFade name = new MinMaxFade(250L); + private final MinMaxFade resourceLoc = new MinMaxFade(250L); + private boolean left = false; + + public InfiniteDabEmote() { + super("Dab", new MinMaxFade(7500L)); + this.name.startAnimation(); + switchInt = 1000; + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) {} + + private int switchInt = 10; + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + float var4 = 1.0F; + if (this.name.getDuration() > this.duration.llIIllIlIlllllIlIllIIlIll()) { + var4 = this.name.getFadeAmount(); + } else if (this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.resourceLoc.getDuration()) { + if (!this.resourceLoc.isTimeNotAtZero()) { + this.resourceLoc.startAnimation(); + } + + var4 = 1.0F - this.resourceLoc.getFadeAmount(); + } + + if(switchInt == 0) { + left = true; + } else if(switchInt == 1000) { + left = false; + } + + if (left) { + model.bipedRightArm.rotateAngleX = (float)Math.toRadians(90.0F * var4); + model.bipedRightArm.rotateAngleY = (float)Math.toRadians(-35.0F * var4); + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians(-15.0F * var4); + model.bipedLeftArm.rotateAngleY = (float)Math.toRadians(15.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(110.0F * var4); + float var5 = player.rotationPitch; + float var6 = player.prevRenderYawOffset - player.rotationYaw; + model.bipedHead.rotateAngleX = (float)Math.toRadians(-var5 * var4) + (float)Math.toRadians(-45.0F * var4 + var5); + model.bipedHead.rotateAngleY = (float)Math.toRadians(var6 * var4) + (float)Math.toRadians(35.0F * var4 - var6); + model.bipedHeadwear.rotateAngleX = (float)Math.toRadians(-var5 * var4) + (float)Math.toRadians(-45.0F * var4 + var5); + model.bipedHeadwear.rotateAngleY = (float)Math.toRadians(var6 * var4) + (float)Math.toRadians(35.0F * var4 - var6); + switchInt++; + } else { + model.bipedRightArm.rotateAngleX = (float)Math.toRadians(-90.0F * var4); + model.bipedRightArm.rotateAngleY = (float)Math.toRadians(-35.0F * var4); + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians(15.0F * var4); + model.bipedLeftArm.rotateAngleY = (float)Math.toRadians(15.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(-110.0F * var4); + float var5 = player.rotationPitch; + float var6 = player.prevRenderYawOffset - player.rotationYaw; + model.bipedHead.rotateAngleX = (float)Math.toRadians(-var5 * var4) + (float)Math.toRadians(45.0F * var4 + var5); + model.bipedHead.rotateAngleY = (float)Math.toRadians(var6 * var4) + (float)Math.toRadians(35.0F * var4 - var6); + model.bipedHeadwear.rotateAngleX = (float)Math.toRadians(-var5 * var4) + (float)Math.toRadians(45.0F * var4 + var5); + model.bipedHeadwear.rotateAngleY = (float)Math.toRadians(var6 * var4) + (float)Math.toRadians(35.0F * var4 - var6); + switchInt--; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/NarutoRunEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/NarutoRunEmote.java new file mode 100644 index 0000000..e9f2aeb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/NarutoRunEmote.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class NarutoRunEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(300L); + private final MinMaxFade endTransitionTime = new MinMaxFade(500L); + + public NarutoRunEmote() { + super("Naruto Run", new MinMaxFade(10000L)); + this.startTransitionTime.startAnimation(); + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + model.bipedRightArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + model.bipedLeftArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + if (this.startTransitionTime.isZeroOrLess()) { + model.bipedRightArm.rotateAngleX = (float)Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + } else if (this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.endTransitionTime.getDuration()) { + if (!this.endTransitionTime.isTimeNotAtZero()) { + this.endTransitionTime.startAnimation(); + } + + model.bipedRightArm.rotateAngleX = Math.max((float)Math.toRadians(90.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArm.rotateAngleZ); + model.bipedLeftArm.rotateAngleX = Math.min((float)Math.toRadians(-270.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArm.rotateAngleZ); + } else { + model.bipedRightArm.rotateAngleX = (float)Math.toRadians(90.0); + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians(90.0); + } + + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/ShrugEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/ShrugEmote.java new file mode 100644 index 0000000..d6277f5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/ShrugEmote.java @@ -0,0 +1,22 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class ShrugEmote extends Emote { + public ShrugEmote() { + super("Shrug", new CosineFade(500L)); + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + model.bipedRightArm.offsetY = -0.2F * this.duration.getFadeAmount(); + model.bipedLeftArm.offsetY = -0.2F * this.duration.getFadeAmount(); + model.bipedHead.offsetY = 0.05F * this.duration.getFadeAmount(); + model.bipedHeadwear.offsetY = 0.05F * this.duration.getFadeAmount(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/SuperFacepalmEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/SuperFacepalmEmote.java new file mode 100644 index 0000000..30b19a0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/SuperFacepalmEmote.java @@ -0,0 +1,64 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class SuperFacepalmEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(1000L); + private final ExponentialFade endTransitionTime = new ExponentialFade(2000L); + private final CosineFade headShakeTime = new CosineFade(100L); + private final float headXRotationAngle = (float)Math.toRadians(45.0); + private final float rightArmYRotationAngle = (float)Math.toRadians(-30.0); + private final float rightArmXRotationAngle = (float)Math.toRadians(-100.0); + + public SuperFacepalmEmote() { + super("Super Facepalm", new FloatFade(20000L)); + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + float var4 = this.startTransitionTime.getFadeAmount(); + if (!this.startTransitionTime.isTimeNotAtZero() && this.duration.llIIllIlIlllllIlIllIIlIll() >= 150L) { + this.startTransitionTime.startAnimation(); + } + + if (this.startTransitionTime.isTimeNotAtZero()) { + if (this.startTransitionTime.isOver() && !this.headShakeTime.isZeroOrLess() && !this.endTransitionTime.isTimeNotAtZero()) { + this.headShakeTime.startAnimation(); + } + + float var5 = model.bipedHead.rotateAngleX; + float var6 = model.bipedHead.rotateAngleY; + model.bipedHead.rotateAngleZ = -((float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHeadwear.rotateAngleZ = -((float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedHead.rotateAngleY = (float)Math.toRadians(10.0) * var4 - (float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHeadwear.rotateAngleY = (float)Math.toRadians(10.0) * var4 - (float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount()); + model.bipedHead.rotateAngleX = this.headXRotationAngle * var4; + model.bipedHeadwear.rotateAngleX = this.headXRotationAngle * var4; + model.bipedRightArm.rotateAngleY = this.rightArmYRotationAngle * var4 - (this.endTransitionTime.isTimeNotAtZero() ? 0.0F : (float)Math.toRadians(10.0F * this.headShakeTime.getFadeAmount())); + model.bipedRightArm.rotateAngleX = this.rightArmXRotationAngle * var4; + if (!this.endTransitionTime.isTimeNotAtZero() && this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.endTransitionTime.getDuration()) { + this.endTransitionTime.startAnimation(); + } + + if (this.endTransitionTime.isTimeNotAtZero()) { + var4 = this.endTransitionTime.getFadeAmount(); + model.bipedHead.rotateAngleY = var6 * var4; + model.bipedHeadwear.rotateAngleY = var6 * var4; + model.bipedHead.rotateAngleZ = 0.0F; + model.bipedHeadwear.rotateAngleZ = 0.0F; + model.bipedHead.rotateAngleX -= (this.headXRotationAngle - var5) * var4; + model.bipedHeadwear.rotateAngleX -= (this.headXRotationAngle - var5) * var4; + model.bipedRightArm.rotateAngleY -= this.rightArmYRotationAngle * var4; + model.bipedRightArm.rotateAngleX -= this.rightArmXRotationAngle * var4; + } + + } + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/TPoseEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/TPoseEmote.java new file mode 100644 index 0000000..a2c5b8a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/TPoseEmote.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.ExponentialFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class TPoseEmote extends Emote { + private final ExponentialFade startTransitionTime = new ExponentialFade(600L); + private final MinMaxFade endTransitionTime = new MinMaxFade(600L); + + public TPoseEmote() { + super("T-Pose", new MinMaxFade(5000L)); + this.startTransitionTime.startAnimation(); + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + model.bipedRightArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + model.bipedLeftArm.rotateAngleX *= this.endTransitionTime.getFadeAmount(); + if (this.startTransitionTime.isZeroOrLess()) { + model.bipedRightArm.rotateAngleZ = (float)Math.toRadians(90.0F * this.startTransitionTime.getFadeAmount()); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(-90.0F * this.startTransitionTime.getFadeAmount()); + } else if (this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.endTransitionTime.getDuration()) { + if (!this.endTransitionTime.isTimeNotAtZero()) { + this.endTransitionTime.startAnimation(); + } + + model.bipedRightArm.rotateAngleZ = Math.max((float)Math.toRadians(90.0F - 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArm.rotateAngleZ); + model.bipedLeftArm.rotateAngleZ = Math.min((float)Math.toRadians(-90.0F + 90.0F * this.endTransitionTime.getFadeAmount()), model.bipedRightArm.rotateAngleZ); + } else { + model.bipedRightArm.rotateAngleZ = (float)Math.toRadians(90.0); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(-90.0); + } + + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/WaveEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/WaveEmote.java new file mode 100644 index 0000000..78031f6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/emote/WaveEmote.java @@ -0,0 +1,46 @@ +package com.cheatbreaker.client.cosmetic.type.emote; + +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class WaveEmote extends Emote { + private final FloatFade name = new FloatFade(250L); + private final FloatFade resourceLoc = new FloatFade(250L); + private final CosineFade waveTransitionTime = new CosineFade(500L); + + public WaveEmote() { + super("Wave", new FloatFade(2000L)); + this.name.startAnimation(); + } + + public void tickEmote(AbstractClientPlayer player, float partialTicks) { + } + + public void playEmote(AbstractClientPlayer player, ModelBiped model, float partialTicks) { + float var4 = 1.0F; + float var5 = 0.5F; + if (this.name.getDuration() > this.duration.llIIllIlIlllllIlIllIIlIll()) { + var4 = this.name.getFadeAmount(); + } else if (this.duration.IlIlllIIIIllIllllIllIIlIl() <= this.resourceLoc.getDuration()) { + if (!this.resourceLoc.isTimeNotAtZero()) { + this.resourceLoc.startAnimation(); + } + + var4 = 1.0F - this.resourceLoc.getFadeAmount(); + } else { + if (!this.waveTransitionTime.isTimeNotAtZero()) { + this.waveTransitionTime.startAnimationFromStartOrEnd(125.0F); + this.waveTransitionTime.loopAnimation(); + } + + var5 = this.waveTransitionTime.getFadeAmount(); + } + + model.bipedLeftArm.rotateAngleX = (float)Math.toRadians(-150.0F * var4); + model.bipedLeftArm.rotateAngleZ = (float)Math.toRadians(40.0F * var5 - 20.0F); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelAnimatedCape.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelAnimatedCape.java new file mode 100644 index 0000000..2e08852 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelAnimatedCape.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.cosmetic.type.model; + +import net.minecraft.client.model.ModelBiped; + +public class CosmeticModelAnimatedCape extends ModelBiped { + + public CosmeticModelAnimatedCape() { + // todo: do this + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelWings.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelWings.java new file mode 100644 index 0000000..b86495b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/cosmetic/type/model/CosmeticModelWings.java @@ -0,0 +1,60 @@ +package com.cheatbreaker.client.cosmetic.type.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class CosmeticModelWings extends ModelBase { + private ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); + private ModelRenderer wing; + private ModelRenderer wingTip; + + public CosmeticModelWings(float f) { + this.textureWidth = 256; + this.textureHeight = 256; + this.setTextureOffset("wing.skin", -56, 88); + this.setTextureOffset("wingtip.skin", -56, 144); + this.setTextureOffset("wing.bone", 112, 88); + this.setTextureOffset("wingtip.bone", 112, 136); + this.wing = new ModelRenderer(this, "wing"); + this.wing.setRotationPoint(-12, 5, 2.0f); + this.wing.addBox("bone", (float)-56, (float)-4, (float)-4, 56, 8, 8); + this.wing.addBox("skin", (float)-56, 0.0f, 2.0f, 56, 0, 56); + this.wingTip = new ModelRenderer(this, "wingtip"); + this.wingTip.setRotationPoint(-56, 0.0f, 0.0f); + this.wingTip.addBox("bone", (float)-56, (float)-2, (float)-2, 56, 4, 4); + this.wingTip.addBox("skin", (float)-56, 0.0f, 2.0f, 56, 0, 56); + this.wing.addChild(this.wingTip); + } + + public void render(Entity entity, float f, float f2, float f3, float f4, float f5, float f6, float f7, ResourceLocation resourceLocation) { + if (!(entity instanceof EntityPlayer)) { + return; + } + EntityPlayer entityPlayer = (EntityPlayer)entity; + Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); + GL11.glPushMatrix(); + GL11.glScaled(f7, f7, f7); + GL11.glRotatef(15, 1.0f, 0.0f, 0.0f); + GL11.glTranslatef(0.0f, 0.5f, 0.25f); + float f8 = (float)(System.currentTimeMillis() % 2000L) / 2000.0f * (float)Math.PI * 2.0f; + for (int i = 0; i < 2; ++i) { + GL11.glEnable(2884); + this.wing.rotateAngleX = 1.1f * -0.11363636f - (float)Math.cos(f8) * (0.175f * 1.1428572f); + this.wing.rotateAngleY = 1.069853f * 0.7010309f; + this.wing.rotateAngleZ = (float)(Math.sin(f8) + 0.3577586111305871 * (double)0.3493976f) * (0.8f * 1.0f); + this.wingTip.rotateAngleZ = (float)(Math.sin(f8 + 2.0f) + 0.9117646813392639 * 0.5483871115358021) * (2.2258065f * 0.33695653f); + this.wing.render(f6); + GL11.glScalef(-1, 1.0f, 1.0f); + if (i != 0) continue; + GL11.glCullFace(1028); + } + GL11.glPopMatrix(); + GL11.glCullFace(1029); + GL11.glDisable(2884); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/EventBus.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/EventBus.java new file mode 100644 index 0000000..b541654 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/EventBus.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.event; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Consumer; + +public class EventBus { + private final ConcurrentHashMap, CopyOnWriteArrayList> registeredEvents = new ConcurrentHashMap<>(); + + public boolean addEvent(Class clazz, Consumer consumer) { + return this.registeredEvents.computeIfAbsent(clazz, p0 -> new CopyOnWriteArrayList<>()).add(consumer); + } + + public boolean removeEvent(final Class clazz, final Consumer consumer) { + final CopyOnWriteArrayList list = this.registeredEvents.get(clazz); + return list != null && list.remove(consumer); + } + + public void handleEvent(Event event) { + try { + for (Serializable s = event.getClass(); s != null && s != Event.class; s = ((Class) s).getSuperclass()) { + final CopyOnWriteArrayList list = this.registeredEvents.get(s); + if (list != null) { + list.forEach(consumer -> consumer.accept(event)); + } + } + } catch (Exception ex) { + System.out.println("EventBus [" + event.getClass() + "]"); + ex.printStackTrace(); + } + } + + public static class Event { + } + + public static class EventData extends Event { + @Getter @Setter private boolean canceled = false; + } + + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ChatEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ChatEvent.java new file mode 100644 index 0000000..db481e4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ChatEvent.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import net.minecraft.network.play.server.S02PacketChat; + + +public class ChatEvent extends EventBus.Event { + private final S02PacketChat packetIn; + + public ChatEvent(S02PacketChat packetIn) { + this.packetIn = packetIn; + } + + public S02PacketChat getPacketIn() { + return this.packetIn; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ClickEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ClickEvent.java new file mode 100644 index 0000000..9d81df2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ClickEvent.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.event.impl.eventhandler.Cancelable; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor @Getter @Cancelable +public class ClickEvent extends EventBus.EventData { + private final int mouseButton; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ClickStateEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ClickStateEvent.java new file mode 100644 index 0000000..3396fd3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ClickStateEvent.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.beans.ConstructorProperties; + +@AllArgsConstructor @Getter +public class ClickStateEvent extends EventBus.Event { + private final int mouseButton; + private final boolean state; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/CollisionEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/CollisionEvent.java new file mode 100644 index 0000000..258d3f4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/CollisionEvent.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.event.impl; + + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.AxisAlignedBB; + +import java.util.List; + +@AllArgsConstructor @Getter +public class CollisionEvent extends EventBus.EventData { + private List boxes; + private double x; + private double y; + private double z; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ConnectEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ConnectEvent.java new file mode 100644 index 0000000..c872d03 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/ConnectEvent.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +public class ConnectEvent extends EventBus.Event { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/DisconnectEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/DisconnectEvent.java new file mode 100644 index 0000000..76e1f3a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/DisconnectEvent.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +public class DisconnectEvent extends EventBus.Event { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/GuiDrawBypassDebugEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/GuiDrawBypassDebugEvent.java new file mode 100644 index 0000000..a247020 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/GuiDrawBypassDebugEvent.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.gui.ScaledResolution; + +@AllArgsConstructor @Getter +public class GuiDrawBypassDebugEvent extends EventBus.Event { + private ScaledResolution scaledResolution; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/GuiDrawEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/GuiDrawEvent.java new file mode 100644 index 0000000..9497296 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/GuiDrawEvent.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.gui.ScaledResolution; + +@AllArgsConstructor @Getter +public class GuiDrawEvent extends EventBus.Event { + private ScaledResolution scaledResolution; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/InitializationEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/InitializationEvent.java new file mode 100644 index 0000000..ef5632d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/InitializationEvent.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +public class InitializationEvent extends EventBus.Event { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/KeepAliveEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/KeepAliveEvent.java new file mode 100644 index 0000000..f450aed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/KeepAliveEvent.java @@ -0,0 +1,5 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +public class KeepAliveEvent extends EventBus.Event { } diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/KeyboardEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/KeyboardEvent.java new file mode 100644 index 0000000..8bd3b21 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/KeyboardEvent.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor @Getter +public class KeyboardEvent extends EventBus.Event { + private int pressed; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/LoadWorldEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/LoadWorldEvent.java new file mode 100644 index 0000000..7368e12 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/LoadWorldEvent.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.multiplayer.WorldClient; + +@AllArgsConstructor @Getter +public class LoadWorldEvent extends EventBus.Event { + private WorldClient worldClient; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PlayerAnimationEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PlayerAnimationEvent.java new file mode 100644 index 0000000..64993b7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PlayerAnimationEvent.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.cosmetic.data.AnimationStage; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +@AllArgsConstructor @Getter +public class PlayerAnimationEvent extends EventBus.Event { + private final AnimationStage stage; + private final AbstractClientPlayer player; + private final ModelBiped model; + private final float partialTicks; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PlayerLookEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PlayerLookEvent.java new file mode 100644 index 0000000..ddadd07 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PlayerLookEvent.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +public class PlayerLookEvent extends EventBus.Event { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PluginMessageEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PluginMessageEvent.java new file mode 100644 index 0000000..916d80e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PluginMessageEvent.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor @Getter +public class PluginMessageEvent extends EventBus.Event { + private String channelName; + private byte[] bufferData; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PreviewDrawEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PreviewDrawEvent.java new file mode 100644 index 0000000..0fcc521 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/PreviewDrawEvent.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.client.gui.ScaledResolution; + +@AllArgsConstructor @Getter +public class PreviewDrawEvent extends EventBus.Event { + private ScaledResolution scaledResolution; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/RenderWorldEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/RenderWorldEvent.java new file mode 100644 index 0000000..540dd93 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/RenderWorldEvent.java @@ -0,0 +1,18 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +import java.beans.ConstructorProperties; + +public class RenderWorldEvent extends EventBus.Event { + private final float partialTicks; + + public float getPartialTicks() { + return this.partialTicks; + } + + @ConstructorProperties(value={"partialTicks"}) + public RenderWorldEvent(float partialTicks) { + this.partialTicks = partialTicks; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/TickEvent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/TickEvent.java new file mode 100644 index 0000000..9ccac00 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/TickEvent.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.event.impl; + +import com.cheatbreaker.client.event.EventBus; + +public class TickEvent extends EventBus.Event { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/eventhandler/Cancelable.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/eventhandler/Cancelable.java new file mode 100644 index 0000000..aa3a82d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/event/impl/eventhandler/Cancelable.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.event.impl.eventhandler; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(value=RetentionPolicy.RUNTIME) +@Target(value={ElementType.TYPE}) +public @interface Cancelable { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/AbstractModule.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/AbstractModule.java new file mode 100644 index 0000000..08dd830 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/AbstractModule.java @@ -0,0 +1,389 @@ +package com.cheatbreaker.client.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.event.impl.ClickEvent; +import com.cheatbreaker.client.event.impl.KeyboardEvent; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.PreviewType; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.*; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.*; +import java.util.function.Consumer; + +@Getter @Setter +public abstract class AbstractModule { + protected Minecraft mc = Minecraft.getMinecraft(); + private boolean staffModule = false; + private boolean staffModuleEnabled = false; + private final String name; + private String description; + private List creators; + private boolean enabled = false; + public boolean defaultState = false; + public GuiAnchor guiAnchor; + public GuiAnchor defaultGuiAnchor; + private float xTranslation = 0.0f; + public float defaultXTranslation = 0.0f; + private float yTranslation = 0.0f; + public float defaultYTranslation = 0.0f; + private boolean renderHud = true; + public boolean defaultRenderHud = true; + private boolean wasRenderHud = false; + public boolean defaultWasRenderHud = false; + public boolean hiddenFromHud = false; + public float width = 0.0f; + public float height = 0.0f; + public boolean notRenderHUD = true; + private final List settingsList; + private final List defaultSettingsValues; + public Setting scale; + public Setting guiScale; + public Setting toggleKeybind; + public Setting hideFromHUDKeybind; + public Setting tempHideFromHUDKeybind; + public String defaultGuiScale; + private final Map, Consumer> eventMap = new HashMap<>(); + private PreviewType previewType; + private ResourceLocation previewIcon; + private float previewIconWidth; + private float previewIconHeight; + private float previewLabelSize; + private String previewLabel; + protected String[] excludeOptions = new String[] {"OFF", "Above", "Below", "At", "Not At"}; + + public AbstractModule(String name) { + this.name = name; + this.settingsList = new ArrayList<>(); + this.defaultSettingsValues = new ArrayList<>(); + this.defaultGuiScale = "Global"; + this.scale = new Setting(this, "Scale", "Change the scale of the mod.").setValue(1.0f).setMinMax(0.5f, 1.5f).setUnit("x").setCenterLabel("1.0x"); + this.guiScale = new Setting(this, "GUI Scale", "Change the scale of the mod.").setValue(defaultGuiScale).acceptedStringValues("Global", "Default", "Small", "Normal", "Large", "Auto").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.toggleKeybind = new Setting(this, "Toggle Mod Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideFromHUDKeybind = new Setting(this, "Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.tempHideFromHUDKeybind = new Setting(this, "Temp Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.registerStaticEvent(KeyboardEvent.class, this::onKeyPress); + this.registerStaticEvent(ClickEvent.class, this::onMousePress); + } + + public AbstractModule(String name, String defaultGuiScale) { + this.name = name; + this.settingsList = new ArrayList<>(); + this.defaultSettingsValues = new ArrayList<>(); + this.defaultGuiScale = defaultGuiScale; + this.scale = new Setting(this, "Scale", "Change the scale of the mod.").setValue(1.0f).setMinMax(0.5f, 1.5f).setUnit("x").setCenterLabel("1.0x"); + this.guiScale = new Setting(this, "GUI Scale", "Change the scale of the mod.").setValue(defaultGuiScale).acceptedStringValues("Global", "Default", "Small", "Normal", "Large", "Auto").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.toggleKeybind = new Setting(this, "Toggle Mod Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideFromHUDKeybind = new Setting(this, "Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.tempHideFromHUDKeybind = new Setting(this, "Temp Toggle HUD Keybind").setValue(0).setMouseBind(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.registerStaticEvent(KeyboardEvent.class, this::onKeyPress); + this.registerStaticEvent(ClickEvent.class, this::onMousePress); + } + + protected void addEvent(Class eventClass, Consumer consumer) { + this.eventMap.put(eventClass, consumer); + } + + protected void registerStaticEvent(Class eventClass, Consumer consumer) { + CheatBreaker.getInstance().getEventBus().addEvent(eventClass, consumer); + } + + protected void addAllEvents() { + for (Map.Entry, Consumer> entry : this.eventMap.entrySet()) { + CheatBreaker.getInstance().getEventBus().addEvent((Class)entry.getKey(), entry.getValue()); + } + } + + protected void removeAllEvents() { + for (Map.Entry, Consumer> entry : this.eventMap.entrySet()) { + CheatBreaker.getInstance().getEventBus().removeEvent((Class)entry.getKey(), entry.getValue()); + } + } + + public void setState(boolean state) { + if (state != this.defaultState) { + CheatBreaker.getInstance().createNewProfile(); + } + if (state) { + if (!this.enabled) { + this.enabled = true; + this.addAllEvents(); + } + } else if (this.enabled) { + this.enabled = false; + this.removeAllEvents(); + } + } + + public void setDefaultState(boolean state) { + if (state) { + if (!this.enabled) { + this.enabled = true; + this.addAllEvents(); + } + } else if (this.enabled) { + this.enabled = false; + this.removeAllEvents(); + } + this.defaultState = this.enabled; + } + + public void setTranslations(float x, float y) { + this.xTranslation = x; + this.yTranslation = y; + } + + public void setDefaultTranslations(float x, float y) { + this.xTranslation = x; + this.yTranslation = y; + this.defaultXTranslation = x; + this.defaultYTranslation = y; + } + + public void setDimensions(float width, float height) { + this.width = width; + this.height = height; + } + + public void setStaffModuleEnabled(boolean bl) { + this.staffModuleEnabled = bl; + if (!bl && this.isEnabled()) { + this.setState(false); + } + } + + // Master toggle key bind logic (keyboard) + private void onKeyPress(KeyboardEvent event) { + if (event.getPressed() == 0) return; + if (event.getPressed() == this.toggleKeybind.getIntegerValue() && !this.toggleKeybind.isHasMouseBind()) { + this.setState(!this.enabled); + } + if (event.getPressed() == this.hideFromHUDKeybind.getIntegerValue() && !this.hideFromHUDKeybind.isHasMouseBind() && !this.notRenderHUD) { + this.setRenderHud(!this.renderHud); + } + if (event.getPressed() == this.tempHideFromHUDKeybind.getIntegerValue() && !this.tempHideFromHUDKeybind.isHasMouseBind()) { + this.setHiddenFromHud(!this.hiddenFromHud); + } + } + + // Master toggle key bind logic (mice) + private void onMousePress(ClickEvent event) { + if (event.getMouseButton() == 0) return; // DO NOT REMOVE IT CAUSES SO MANY PROBLEMS + if (event.getMouseButton() == this.toggleKeybind.getIntegerValue() && this.toggleKeybind.isHasMouseBind()) { + this.setState(!this.enabled); + } + if (event.getMouseButton() == this.hideFromHUDKeybind.getIntegerValue() && this.hideFromHUDKeybind.isHasMouseBind() && !this.notRenderHUD) { + this.setRenderHud(!this.renderHud); + } + if (event.getMouseButton() == this.tempHideFromHUDKeybind.getIntegerValue() && this.tempHideFromHUDKeybind.isHasMouseBind()) { + this.setHiddenFromHud(!this.hiddenFromHud); + } + Setting nameTagsKeybind = CheatBreaker.getInstance().getModuleManager().nametagMod.hideNamePlatesKeybind; + if (event.getMouseButton() == nameTagsKeybind.getIntegerValue() && nameTagsKeybind.isHasMouseBind()) { + Minecraft.getMinecraft().hideNametags = !Minecraft.getMinecraft().hideNametags; + } + } + + public void setCreators(String ... creators) { + this.creators = Arrays.asList(creators); + } + + public void scaleAndTranslate(ScaledResolution scaledResolution) { + this.scaleAndTranslate(scaledResolution, this.width, this.height); + } + + public float masterScale() { + float var15 = 1.0f; + if (this.guiScale.getValue().equals("Global")) { + switch (CheatBreaker.getInstance().getGlobalSettings().modScale.getStringValue()) { + case "Small": + var15 *= 0.5F / CheatBreaker.getScaleFactor(); + break; + case "Normal": + var15 /= CheatBreaker.getScaleFactor(); + break; + case "Large": + var15 *= 1.5F / CheatBreaker.getScaleFactor(); + break; + case "Auto": + var15 *= 2.0F / CheatBreaker.getScaleFactor(); + } + } else { + switch (this.guiScale.getStringValue()) { + case "Small": + var15 *= 0.5F / CheatBreaker.getScaleFactor(); + break; + case "Normal": + var15 /= CheatBreaker.getScaleFactor(); + break; + case "Large": + var15 *= 1.5F / CheatBreaker.getScaleFactor(); + break; + case "Auto": + var15 *= 2.0F / CheatBreaker.getScaleFactor(); + } + } + return this.scale.getFloatValue() * CheatBreaker.getInstance().getGlobalSettings().modScaleMultiplier.getFloatValue() * var15; + } + + public void scaleAndTranslate(ScaledResolution scaledResolution, float width, float height) { + float f3 = 0.0f; + float f4 = 0.0f; + float scale = this.masterScale(); + GL11.glScalef(scale, scale, scale); + width *= scale; + height *= scale; + switch (this.guiAnchor) { + case LEFT_TOP: + f3 = 2.0f; + f4 = 2.0f; + break; + case LEFT_MIDDLE: + f3 = 2.0f; + f4 = (float)(scaledResolution.getScaledHeight() / 2) - height / 2.0f; + break; + case LEFT_BOTTOM: + f4 = (float)scaledResolution.getScaledHeight() - height - 2.0f; + f3 = 2.0f; + break; + case MIDDLE_TOP: + f3 = (float)(scaledResolution.getScaledWidth() / 2) - width / 2.0f; + f4 = 2.0f; + break; + case MIDDLE_MIDDLE: + f3 = (float)(scaledResolution.getScaledWidth() / 2) - width / 2.0f; + f4 = (float)(scaledResolution.getScaledHeight() / 2) - height / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f3 = (float)(scaledResolution.getScaledWidth() / 2) - width; + f4 = (float)scaledResolution.getScaledHeight() - height - 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f3 = scaledResolution.getScaledWidth() / 2; + f4 = (float)scaledResolution.getScaledHeight() - height - 2.0f; + break; + case RIGHT_TOP: + f3 = (float)scaledResolution.getScaledWidth() - width - 2.0f; + f4 = 2.0f; + break; + case RIGHT_MIDDLE: + f3 = (float)scaledResolution.getScaledWidth() - width; + f4 = (float)(scaledResolution.getScaledHeight() / 2) - height / 2.0f; + break; + case RIGHT_BOTTOM: + f3 = (float)scaledResolution.getScaledWidth() - width; + f4 = (float)scaledResolution.getScaledHeight() - height; + + } + GL11.glTranslatef(f3 / scale, f4 / scale, 0.0f); + GL11.glTranslatef(this.xTranslation / scale, this.yTranslation / scale, 0.0f); + } + + public float[] getScaledPoints(ScaledResolution scaledResolution, boolean bl) { + float f = 0.0f; + float f2 = 0.0f; + float f3 = this.width * (Float) this.masterScale(); + float f4 = this.height * (Float) this.masterScale(); + switch (this.guiAnchor) { + case LEFT_TOP: + f = 2.0f; + f2 = 2.0f; + break; + case LEFT_MIDDLE: + f = 2.0f; + f2 = (float)(scaledResolution.getScaledHeight() / 2) - f4 / 2.0f; + break; + case LEFT_BOTTOM: + f2 = (float)scaledResolution.getScaledHeight() - f4 - 2.0f; + f = 2.0f; + break; + case MIDDLE_TOP: + f = (float)(scaledResolution.getScaledWidth() / 2) - f3 / 2.0f; + f2 = 2.0f; + break; + case MIDDLE_MIDDLE: + f = (float)(scaledResolution.getScaledWidth() / 2) - f3 / 2.0f; + f2 = (float)(scaledResolution.getScaledHeight() / 2) - f4 / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f = (float)(scaledResolution.getScaledWidth() / 2) - f3; + f2 = (float)scaledResolution.getScaledHeight() - f4 - 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f = scaledResolution.getScaledWidth() / 2; + f2 = (float)scaledResolution.getScaledHeight() - f4 - 2.0f; + break; + case RIGHT_TOP: + f = (float)scaledResolution.getScaledWidth() - f3 - 2.0f; + f2 = 2.0f; + break; + case RIGHT_MIDDLE: + f = (float)scaledResolution.getScaledWidth() - f3; + f2 = (float)(scaledResolution.getScaledHeight() / 2) - f4 / 2.0f; + break; + case RIGHT_BOTTOM: + f = (float)scaledResolution.getScaledWidth() - f3; + f2 = (float)scaledResolution.getScaledHeight() - f4; + } + return new float[]{(f + (bl ? this.xTranslation : 0.0f)) / (Float) this.masterScale(), (f2 + (bl ? this.yTranslation : 0.0f)) / (Float) this.masterScale()}; + } + + public void setAnchor(GuiAnchor anchor) { + if (anchor != this.defaultGuiAnchor) { + CheatBreaker.getInstance().createNewProfile(); + } + this.guiAnchor = anchor; + } + + public void setDefaultAnchor(GuiAnchor anchor) { + this.guiAnchor = anchor; + this.defaultGuiAnchor = anchor; + } + + public Position getPosition() { + return AnchorHelper.getHorizontalPositionEnum(this.guiAnchor); + } + + protected void setPreviewIcon(ResourceLocation resourceLocation, int width, int height) { + this.previewType = PreviewType.ICON; + this.previewIcon = resourceLocation; + this.previewIconWidth = width; + this.previewIconHeight = height; + } + + protected void setPreviewLabel(String label, float size) { + this.previewType = PreviewType.LABEL; + this.previewLabel = label; + this.previewLabelSize = size; + } + + public void setRenderHud(boolean bl) { + if (bl != this.defaultRenderHud) { + CheatBreaker.getInstance().createNewProfile(); + } + + this.renderHud = bl; + } + + public void setDefaultRenderHud(boolean bl) { + this.renderHud = bl; + this.defaultRenderHud = bl; + } + + protected boolean excludeArrayOptions(Setting setting, int realValue, float sliderValue) { + switch (setting.getStringValue()) { + case "Above": return realValue > sliderValue; + case "Below": return realValue < sliderValue; + case "At": return realValue == sliderValue; + case "Not At": return realValue != sliderValue; + default: return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/ModuleManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/ModuleManager.java new file mode 100644 index 0000000..74d2f91 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/ModuleManager.java @@ -0,0 +1,241 @@ +package com.cheatbreaker.client.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.EventBus; +import com.cheatbreaker.client.event.impl.ConnectEvent; +import com.cheatbreaker.client.event.impl.DisconnectEvent; +import com.cheatbreaker.client.event.impl.KeyboardEvent; +import com.cheatbreaker.client.event.impl.LoadWorldEvent; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.fixes.ModuleKeybindFix; +import com.cheatbreaker.client.module.impl.normal.ModuleMiniMap; +import com.cheatbreaker.client.module.impl.normal.ModulePackTweaks; +import com.cheatbreaker.client.module.impl.normal.ModuleTeammates; +import com.cheatbreaker.client.module.impl.normal.hud.*; +import com.cheatbreaker.client.module.impl.normal.hud.armorstatus.ModuleArmorStatus; +import com.cheatbreaker.client.module.impl.normal.hud.chat.ModuleChat; +import com.cheatbreaker.client.module.impl.normal.hud.cooldowns.ModuleCooldowns; +import com.cheatbreaker.client.module.impl.normal.hud.keystrokes.ModuleKeyStrokes; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.ModuleFPS; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.*; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat.ModuleCPS; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat.ModuleComboCounter; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat.ModuleReachDisplay; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat.ModuleSprintResetCounter; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleAutoText; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleNickHider; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleDragToLook; +import com.cheatbreaker.client.module.impl.normal.perspective.ModulePerspective; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleSnapLook; +import com.cheatbreaker.client.module.impl.normal.shader.ModuleMotionBlur; +import com.cheatbreaker.client.module.impl.normal.vanilla.*; +import com.cheatbreaker.client.module.impl.packmanager.ResourcePackManager; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleBunnyhop; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleNametags; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleNoclip; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleXray; +import com.cheatbreaker.client.ui.element.type.TextFieldElement; +import com.cheatbreaker.client.ui.element.type.custom.KeybindElement; +import com.cheatbreaker.client.util.voicechat.ModuleVoiceChat; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.util.EnumChatFormatting; + +import java.util.*; + +public class ModuleManager { + public final List playerMods = new ArrayList<>(); + public final List staffMods = new ArrayList<>(); + + public final Map keybinds = new HashMap<>(); + + @Setter public String currentModule; + @Setter public int lastSettingScrollPos; + + public final ModuleCoordinates coordinatesMod; + public final ModuleMiniMap miniMapMod; + public final ModuleToggleSprint toggleSprintMod; + public final ModulePotionEffects potionEffectsMod; + public final ModuleArmorStatus armourStatus; + public final ModuleKeyStrokes keystrokesMod; + public final ModuleScoreboard scoreboardMod; + public final ModuleCooldowns cooldownsMod; + public final ModuleNotifications notificationsMod; + public final ModuleDirectionHUD directionHUDMod; + public final ModuleCrosshair crosshairMod; + public final ModuleEnchantmentGlint enchantmentGlintMod; + public final ModuleBossBar bossBarMod; + + public final ModulePotionCounter potionCounterMod; + public final ModuleCPS cpsMod; + public final ModuleFPS fpsMod; + public final ModuleMemoryUsage memoryUsageMod; + public final ModuleComboCounter comboCounterMod; + public final ModuleSprintResetCounter sprintResetCounterMod; + public final ModuleReachDisplay reachDisplayMod; + public final ModuleServerAddress serverAddressMod; + public final ModulePing pingMod; + public final ModuleClock clockMod; + public final ModuleSaturation saturationMod; + public final ModulePackDisplay packDisplayMod; + + public final ModuleMotionBlur motionBlurMod; + public final ModuleHitColor hitColorMod; + public final ModuleParticles particlesMod; + public final ModuleNametag nametagMod; + public final ModuleBlockOverlay blockOverlayMod; + public final ModulePackTweaks packTweaksMod; + public final ModuleEnvironmentChanger environmentChangerMod; + public final ModulePlayerList playerListMod; + public final ModuleChat chatMod; + public final ModuleNickHider nickHiderMod; + public final ModuleAutoText autoTextMod; + + public final StaffModuleXray staffModuleXray; + public final StaffModuleNametags staffModuleNametags; + public final StaffModuleNoclip staffModuleNoclip; + public final StaffModuleBunnyhop staffModuleBunnyhop; + + public final ModuleDragToLook dragToLook; + public final ModuleSnapLook snapLook; + public final ModuleTeammates teammatesMod; + public final ModuleVoiceChat voiceChat; + public final ModulePerspective perspectiveMod; + // public final FOVChanger fovChangerMod; + public final ModuleKeybindFix keybindFix; + + public ModuleManager(EventBus eventBus) { + this.playerMods.add(this.coordinatesMod = new ModuleCoordinates()); + this.playerMods.add(this.miniMapMod = new ModuleMiniMap()); + this.playerMods.add(this.toggleSprintMod = new ModuleToggleSprint()); + this.playerMods.add(this.potionEffectsMod = new ModulePotionEffects()); + this.playerMods.add(this.armourStatus = new ModuleArmorStatus()); + this.playerMods.add(this.keystrokesMod = new ModuleKeyStrokes()); + this.playerMods.add(this.scoreboardMod = new ModuleScoreboard()); + this.playerMods.add(this.playerListMod = new ModulePlayerList()); + this.playerMods.add(this.chatMod = new ModuleChat()); + this.playerMods.add(this.bossBarMod = new ModuleBossBar()); + this.playerMods.add(this.cooldownsMod = new ModuleCooldowns()); + this.playerMods.add(this.notificationsMod = new ModuleNotifications()); + this.playerMods.add(this.directionHUDMod = new ModuleDirectionHUD()); + + this.playerMods.add(this.environmentChangerMod = new ModuleEnvironmentChanger()); + this.playerMods.add(this.enchantmentGlintMod = new ModuleEnchantmentGlint()); + this.playerMods.add(this.crosshairMod = new ModuleCrosshair()); + this.playerMods.add(this.hitColorMod = new ModuleHitColor()); + this.playerMods.add(this.particlesMod = new ModuleParticles()); + this.playerMods.add(this.nametagMod = new ModuleNametag()); + this.playerMods.add(this.nickHiderMod = new ModuleNickHider()); + this.playerMods.add(this.autoTextMod = new ModuleAutoText()); + this.playerMods.add(this.blockOverlayMod = new ModuleBlockOverlay()); + this.playerMods.add(this.packTweaksMod = new ModulePackTweaks()); + this.playerMods.add(this.perspectiveMod = new ModulePerspective()); +// this.playerMods.add(this.fovChangerMod = new FOVChanger()); + + this.playerMods.add(this.cpsMod = new ModuleCPS()); + this.playerMods.add(this.fpsMod = new ModuleFPS()); + this.playerMods.add(this.memoryUsageMod = new ModuleMemoryUsage()); + this.playerMods.add(this.potionCounterMod = new ModulePotionCounter()); + this.playerMods.add(this.comboCounterMod = new ModuleComboCounter()); + this.playerMods.add(this.sprintResetCounterMod = new ModuleSprintResetCounter()); + this.playerMods.add(this.reachDisplayMod = new ModuleReachDisplay()); + this.playerMods.add(this.serverAddressMod = new ModuleServerAddress()); + this.playerMods.add(this.pingMod = new ModulePing()); + this.playerMods.add(this.clockMod = new ModuleClock()); + this.playerMods.add(this.saturationMod = new ModuleSaturation()); + this.playerMods.add(this.packDisplayMod = new ModulePackDisplay()); + this.playerMods.add(this.motionBlurMod = new ModuleMotionBlur()); + + this.staffMods.add(this.staffModuleXray = new StaffModuleXray("xray")); + this.staffMods.add(this.staffModuleNametags = new StaffModuleNametags("nametags")); + this.staffMods.add(this.staffModuleNoclip = new StaffModuleNoclip("noclip")); + this.staffMods.add(this.staffModuleBunnyhop = new StaffModuleBunnyhop("bunnyhop")); + this.voiceChat = new ModuleVoiceChat(); + this.dragToLook = new ModuleDragToLook(); + this.snapLook = new ModuleSnapLook(); + this.teammatesMod = new ModuleTeammates(); + this.keybindFix = new ModuleKeybindFix(); + this.teammatesMod.setEnabled(true); + new ResourcePackManager(); + eventBus.addEvent(LoadWorldEvent.class, this::loadWorldEvent); + eventBus.addEvent(KeyboardEvent.class, this::loadKeyboardEvent); + eventBus.addEvent(ConnectEvent.class, var1x -> { + ServerData data = Minecraft.getMinecraft().currentServerData; + if (data != null) { + CheatBreaker.getInstance().updateWSServer(data.serverIP, data.domain, data.port); + } else { + CheatBreaker.getInstance().updateWSServer("", "", 0); + } + }); + eventBus.addEvent(DisconnectEvent.class, var1x -> { + CheatBreaker.getInstance().updateWSServer("", "", 0); + for (AbstractModule var3 : this.staffMods) { + var3.setState(false); + var3.setStaffModuleEnabled(false); + } + }); + + + } + + private void loadWorldEvent(LoadWorldEvent event) { + if (this.environmentChangerMod.isEnabled()) this.environmentChangerMod.setWorldTime(); + } + + private void loadKeyboardEvent(KeyboardEvent event) { + if (event.getPressed() != 0) { + for (StaffMod staffMod : this.staffMods) { + if (!staffMod.isStaffModuleEnabled() || (Integer) staffMod.getKeybindSetting().getValue() != event.getPressed()) + continue; + staffMod.setState(!staffMod.isEnabled()); + } + } + } + + public boolean isBoundToAnother(Setting settingIn, int key) { + boolean flag = false; + for (Setting setting : this.keybinds.keySet()) { + if (setting.getType() == SettingType.INTEGER) { + // Key code check + if (setting.isHasKeycode() && key == setting.getKeyCode()) { + flag = true; + } + // Mouse bind check + if (setting.isHasMouseBind() && key == setting.getIntegerValue()) { + flag = true; + } + // General check + if ((setting.getSettingName().toLowerCase().startsWith("hotkey") || setting.getSettingName().toLowerCase().endsWith("keybind")) && key == setting.getIntegerValue()) { + flag = true; + } + } + } + + if (flag) + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("error", EnumChatFormatting.RED + settingIn.getSettingName() + " is already bound to another keybind!", 5000L); + + return flag; + } + + public AbstractModule getModByName(String name) { + return this.playerMods.stream().filter(m -> m.getName().equalsIgnoreCase(name)).findFirst().orElse(null); + } + + /** + * Returns if the player is using staff modules or not. + */ + public boolean isUsingStaffModules() { + for (AbstractModule module : this.staffMods) + { + module.setStaffModuleEnabled(true); + if (module.isStaffModuleEnabled()) + { + return false; + } + } + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/CustomizationLevel.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/CustomizationLevel.java new file mode 100644 index 0000000..9a5cbc8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/CustomizationLevel.java @@ -0,0 +1,7 @@ +package com.cheatbreaker.client.module.data; + +public enum CustomizationLevel { + SIMPLE, + MEDIUM, + ADVANCED +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/MiniMapRules.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/MiniMapRules.java new file mode 100644 index 0000000..6db828e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/MiniMapRules.java @@ -0,0 +1,7 @@ +package com.cheatbreaker.client.module.data; + +public enum MiniMapRules { + NEUTRAL, + ALLOWED, + FORCED_OFF +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/PreviewType.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/PreviewType.java new file mode 100644 index 0000000..341f694 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/PreviewType.java @@ -0,0 +1,7 @@ +package com.cheatbreaker.client.module.data; + +public enum PreviewType { + LABEL, + ICON + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/ScreenLocation.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/ScreenLocation.java new file mode 100644 index 0000000..dd0cc8a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/ScreenLocation.java @@ -0,0 +1,8 @@ +package com.cheatbreaker.client.module.data; + +public enum ScreenLocation { + RIGHT_BOTTOM, + LEFT_BOTTOM, + RIGHT_TOP, + LEFT_TOP +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/Setting.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/Setting.java new file mode 100644 index 0000000..0308cd9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/Setting.java @@ -0,0 +1,244 @@ +package com.cheatbreaker.client.module.data; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BooleanSupplier; +import java.util.function.Consumer; + +@Getter @ToString +public class Setting { + private final String settingName; + private String settingDescription = ""; + private Object value; + private String defaultStringValue; + + /* AutoText required things vars */ + private int keyCode; + @Setter private boolean hasKeycode; + + @Setter private boolean hasMouseBind; + + private Object minimumValue; + private Object maximumValue; + private Object acceptedValue; + private Object customizationLevel; + private Setting parent; + private BooleanSupplier condition; + private String[] acceptedStringValues; + private Object[] acceptedValues; + private Consumer changeConsumer; + private AbstractModule container; + public boolean rainbow; + public boolean speed; + public int[] color; + + private String unit = ""; + private String centerLabel = ""; + private String leftIcon = ""; + private String rightIcon = ""; + private boolean showValue = true; + + public Setting(String settingName) { + this.settingName = settingName; + } + + public Setting(AbstractModule container, String settingName) { + this.container = container; + container.getSettingsList().add(this); + this.settingName = settingName; + } + + public Setting(AbstractModule container, String settingName, String description) { + this(container, settingName); + this.settingDescription = description; + } + + public Setting(List list, String settingName) { + list.add(this); + this.settingName = settingName; + } + + public Setting(List list, String settingName, String description) { + this(list, settingName); + this.settingDescription = description; + } + + public int getColorValue() { + if (this.rainbow) { + Integer var1 = (Integer)this.value; + int var2 = var1 >> 24 & 0xFF; + float var3 = (float)System.nanoTime() / 1.0E10f % 1.0f; + if (this.speed) return var2 << 24 | Color.HSBtoRGB((float)(System.currentTimeMillis() % 1000L) / 1000.0f, 1.0f, 1.0f) & 0xFFFFFF; + return var2 << 24 | Color.HSBtoRGB(var3, 1.0f, 1.0f) & 0xFFFFFF; + } + return (Integer)this.value; + } + + /** + * Casts and returns the value as a boolean. + */ + public boolean getBooleanValue() { + return (Boolean) this.value; + } + + /** + * Casts and returns the value as a string. + */ + public String getStringValue() { + return (String) this.value; + } + + /** + * Casts and returns the value as a float. + */ + public float getFloatValue() { + return (Float) this.value; + } + + /** + * Casts and returns the value as an integer. + */ + public int getIntegerValue() { + return (Integer) this.value; + } + + /** + * Casts and returns the value as an ArrayList. + */ + public ArrayList getArrayListValue() { + return (ArrayList) this.value; + } + + public Setting acceptedValue(Object value) { + this.acceptedValue = value; + return this; + } + + public boolean getParentValue() { + return this.parent != null && (Boolean) this.parent.getValue(); + } + + public Setting setValue(Object value) { + return this.updateSettingValue(value, true); + } + + public Setting setDefaultStringValue(String defaultStringValue) { + this.defaultStringValue = defaultStringValue; + return this; + } + + public Setting setKeyCode(int keycode) { + this.keyCode = keycode; + this.hasKeycode = true; + return this; + } + + public Setting setMouseBind(boolean hasMouseBind) { + this.hasMouseBind = hasMouseBind; + return this; + } + + public Setting updateSettingValue(Object value, boolean usingDefaultProfile) { + if (CheatBreaker.getInstance().activeProfile != null && CheatBreaker.getInstance().activeProfile.getName().equals("default")) { + if (usingDefaultProfile) { + CheatBreaker.getInstance().createNewProfile(); + } + } else if (this.container != null) { + this.container.getDefaultSettingsValues().add(value); + } + this.value = value; + if (this.changeConsumer != null) { + this.changeConsumer.accept(value); + } + return this; + } + + public Setting acceptedStringValues(String ... values) { + this.acceptedStringValues = values; + return this; + } + + public Setting acceptedValues(Object ... values) { + this.acceptedValues = values; + return this; + } + + public Setting onChange(Consumer var1) { + this.changeConsumer = var1; + return this; + } + + public Setting setMinMax(Object minValue, Object maxValue) { + this.minimumValue = minValue; + this.maximumValue = maxValue; + return this; + } + + public Setting setCustomizationLevel(Object level) { + this.customizationLevel = level; + return this; + } + + public Setting setCondition(BooleanSupplier condition) { + this.condition = condition; + return this; + } + + public Setting setParent(Setting parent) { + if (parent.getType() != SettingType.BOOLEAN) { + throw new IllegalStateException("Parent can only be boolean."); + } + this.parent = parent; + return this; + } + + public SettingType getType() { + if (this.value.getClass().isAssignableFrom(Boolean.class)) { + return SettingType.BOOLEAN; + } + if (this.value.getClass().isAssignableFrom(ArrayList.class) && this.acceptedValues != null && this.acceptedValues.length != 0) { + return SettingType.ARRAYLIST; + } + if (this.value.getClass().isAssignableFrom(String.class)) { + return this.acceptedStringValues != null && this.acceptedStringValues.length != 0 ? SettingType.STRING_ARRAY : SettingType.STRING; + } + if (this.value.getClass().isAssignableFrom(Float.class)) { + return SettingType.FLOAT; + } + if (this.value.getClass().isAssignableFrom(Double.class)) { + return SettingType.DOUBLE; + } + if (this.value.getClass().isAssignableFrom(String[].class)) { + return SettingType.STRING_ARRAY; + } + return this.value.getClass().isAssignableFrom(Integer.class) ? SettingType.INTEGER : null; + } + + public Setting setUnit(String value) { + this.unit = value; + return this; + } + + public Setting setShowValue(boolean value) { + this.showValue = value; + return this; + } + + public Setting setCenterLabel(String label) { + this.centerLabel = label; + return this; + } + + public Setting setIcons(String leftIcon, String rightIcon) { + this.leftIcon = leftIcon; + this.rightIcon = rightIcon; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/SettingType.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/SettingType.java new file mode 100644 index 0000000..80daec5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/SettingType.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.module.data; + +public enum SettingType { + STRING, + STRING_ARRAY, + FLOAT, + INTEGER, + DOUBLE, + BOOLEAN, + ARRAYLIST +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/ValueType.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/ValueType.java new file mode 100644 index 0000000..f9fb7f0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/data/ValueType.java @@ -0,0 +1,5 @@ +package com.cheatbreaker.client.module.data; + +public enum ValueType { + PERCENTAGE +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/fixes/ModuleKeybindFix.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/fixes/ModuleKeybindFix.java new file mode 100644 index 0000000..2fd3fb3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/fixes/ModuleKeybindFix.java @@ -0,0 +1,48 @@ +package com.cheatbreaker.client.module.impl.fixes; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.event.impl.TickEvent; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; +import org.lwjgl.input.Keyboard; + +import java.lang.reflect.Field; + +public class ModuleKeybindFix { + private boolean hadAScreen; + private final Minecraft mc; + + public ModuleKeybindFix() { + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::handleTick); + this.mc = Minecraft.getMinecraft(); + } + + public void handleTick(TickEvent event) { + boolean hasScreen = mc.currentScreen != null; + GlobalSettings globalSettings = CheatBreaker.getInstance().getGlobalSettings(); + if (!hasScreen && hadAScreen && globalSettings.keybindFix.getBooleanValue()) { + Class gameSettingsClass = GameSettings.class; + Field[] fields = gameSettingsClass.getDeclaredFields(); + for (Field field : fields) { + if (field.getType().equals(KeyBinding.class)) { + field.setAccessible(true); + + try { + KeyBinding keyBinding = (KeyBinding) field.get(mc.gameSettings); + boolean excludeSneak = !globalSettings.excludeSneakKeybind.getBooleanValue() || !keyBinding.getKeyDescription().equalsIgnoreCase("key.sneak"); + boolean excludeThrow = !globalSettings.excludeThrowKeybind.getBooleanValue() || !keyBinding.getKeyDescription().equalsIgnoreCase("key.use"); + if (!keyBinding.getKeyDescription().equalsIgnoreCase("key.inventory") && !keyBinding.getKeyDescription().equalsIgnoreCase("key.chat") && !keyBinding.getKeyDescription().equalsIgnoreCase("key.command") && excludeSneak && excludeThrow && keyBinding.getKeyCode() > 0 && Keyboard.isKeyDown(keyBinding.getKeyCode())) { + KeyBinding.setKeyBindState(keyBinding.getKeyCode(), true); + KeyBinding.onTick(keyBinding.getKeyCode()); + } + } catch (Exception var9) { + var9.printStackTrace(); + } + } + } + } + this.hadAScreen = hasScreen; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModuleMiniMap.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModuleMiniMap.java new file mode 100644 index 0000000..8134386 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModuleMiniMap.java @@ -0,0 +1,71 @@ +package com.cheatbreaker.client.module.impl.normal; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.thevoxelbox.voxelmap.VoxelMap; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.MiniMapRules; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; + +public class ModuleMiniMap extends AbstractModule { + @Getter private final VoxelMap voxelMap; + public static MiniMapRules rule = MiniMapRules.NEUTRAL; + + public ModuleMiniMap() { + super("Zans Minimap"); + this.setDefaultState(false); + this.notRenderHUD = false; + this.setDefaultAnchor(GuiAnchor.RIGHT_TOP); + this.voxelMap = new VoxelMap(true, true); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/zans.png"), 42, 42); + this.setDescription("Adds a minimap on the top right and allows you to manage waypoints."); + this.setCreators("Zan"); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + @Override + public void addAllEvents() { + super.addAllEvents(); + if (rule == MiniMapRules.FORCED_OFF) { + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Error", "&4Minimap &fis not allowed on this server. Some functions may not work.", 4000L); + } + } + + private void onGuiDraw(GuiDrawEvent event) { + float f = 1.0f / CheatBreaker.getScaleFactor(); + switch (this.voxelMap.getMapOptions().mapCorner) { + case 0: + if (this.getGuiAnchor() == GuiAnchor.LEFT_TOP) break; + this.setAnchor(GuiAnchor.LEFT_TOP); + break; + case 1: + if (this.getGuiAnchor() == GuiAnchor.RIGHT_TOP) break; + this.setAnchor(GuiAnchor.RIGHT_TOP); + break; + case 2: + if (this.getGuiAnchor() == GuiAnchor.RIGHT_BOTTOM) break; + this.setAnchor(GuiAnchor.RIGHT_BOTTOM); + break; + case 3: + if (this.getGuiAnchor() == GuiAnchor.LEFT_BOTTOM) break; + this.setAnchor(GuiAnchor.LEFT_BOTTOM); + } + switch (this.voxelMap.getMapOptions().sizeModifier) { + case -1: + this.setTranslations((int)((float)-5 * f), (float)((int)((float)5 * f))); + this.setDimensions((int)((float)100 * f), (int)((float)100 * f)); + break; + case 0: + this.setTranslations((int)((float)-5 * f), (float)((int)((float)5 * f))); + this.setDimensions((int)((float)135 * f), (int)((float)135 * f)); + break; + case 1: + this.setTranslations((int)((float)-5 * f), (float)((int)((float)5 * f))); + this.setDimensions((int)((float)175 * f), (int)((float)175 * f)); + } + this.voxelMap.onTickInGame(Minecraft.getMinecraft()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModulePackTweaks.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModulePackTweaks.java new file mode 100644 index 0000000..8386f03 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModulePackTweaks.java @@ -0,0 +1,84 @@ +package com.cheatbreaker.client.module.impl.normal; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.util.ResourceLocation; + +public class ModulePackTweaks extends AbstractModule { + + public Setting clearGlass; + + public Setting coloredString; + public Setting coloredStringColor; + + public Setting firstPersonFire; + public Setting firstPersonFireOpacity; + public Setting firstPersonFireHeight; + public Setting fireOnEntities; + + public Setting forceVignette; + public Setting vignetteOpacity; + public Setting vignetteMinOpacity; + public Setting vignetteMaxOpacity; + public Setting vignetteOpacityMultiplier; + + public Setting pumpkinOverlay; + public Setting pumpkinOverlayOpacity; + + public Setting transparentInventory; + public Setting tooltips; + + public Setting faceCamera; + public Setting yRotation; + + public ModulePackTweaks() { + super("Pack Tweaks"); + this.setDescription("Change how specific textures appear."); + this.setDefaultState(true); + + new Setting(this, "label").setValue("Glass Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.clearGlass = new Setting(this, "Clear Glass", "Removes the glass texture." + + "\n" + + "\n§bOFF:§r No glass textures are removed." + + "\n§bREGULAR:§r Only normal glass texture is removed." + + "\n§bALL:§r Normal and stained glass textures are removed.").setValue("OFF").acceptedStringValues("OFF", "REGULAR", "ALL").onChange(value -> { + this.mc.renderGlobal.loadRenderers(); + }).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("String Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.coloredString = new Setting(this, "Colored String", "Show a solid color line instead of the texture pack's string texture.").setValue(false).onChange(value -> { + this.mc.renderGlobal.loadRenderers(); + }).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.coloredStringColor = new Setting(this, "Colored String Color").setValue(0xFFFF0000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coloredString.getValue()); + + new Setting(this, "label").setValue("Fire Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.firstPersonFire = new Setting(this, "First Person Fire").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.firstPersonFireOpacity = new Setting(this, "Fire Opacity").setValue(90.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.firstPersonFire.getValue()); + this.firstPersonFireHeight = new Setting(this, "Fire Height").setValue(1.0f).setMinMax(0.0f, 2.0f).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.firstPersonFire.getValue()); + this.fireOnEntities = new Setting(this, "Fire on Entities").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Vignette Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.forceVignette = new Setting(this, "Vignette Type").setValue("Vanilla").acceptedStringValues("Vanilla", "Static", "Amplified").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.vignetteOpacity = new Setting(this, "Vignette Opacity").setValue(75.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Static")); + this.vignetteMinOpacity = new Setting(this, "Vignette Minimum Opacity").setValue(0.0F).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Amplified")); + this.vignetteMaxOpacity = new Setting(this, "Vignette Maximum Opacity").setValue(100.0F).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Amplified")); + this.vignetteOpacityMultiplier = new Setting(this, "Vignette Opacity Multiplier").setValue(1.0f).setMinMax(0.1f, 10.0f).setUnit("x").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.forceVignette.getValue().equals("Amplified")); + + new Setting(this, "label").setValue("Pumpkin Overlay Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pumpkinOverlay = new Setting(this, "Show Pumpkin Overlay").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pumpkinOverlayOpacity = new Setting(this, "Pumpkin Overlay Opacity").setValue(100.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.pumpkinOverlay.getValue()); + + new Setting(this, "label").setValue("Inventory Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.transparentInventory = new Setting(this, "Transparent Inventory").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.tooltips = new Setting(this, "Show Inventory Tooltips").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Dropped Item Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.yRotation = new Setting(this, "Rotate towards camera").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.faceCamera = new Setting(this, "3D Face player").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.setPreviewIcon(new ResourceLocation("client/icons/mods/packtweaks.png"), 32, 32); + } + + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModuleTeammates.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModuleTeammates.java new file mode 100644 index 0000000..1d470dc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/ModuleTeammates.java @@ -0,0 +1,267 @@ +package com.cheatbreaker.client.module.impl.normal; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.DisconnectEvent; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.util.render.teammates.CBTeammate; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +import java.awt.*; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.List; +//TODO: Finish mapping class +@Getter +public class ModuleTeammates { + public FloatBuffer modelViewMatrixBuffer = BufferUtils.createFloatBuffer(16); + public FloatBuffer projectionMatrixBuffer = BufferUtils.createFloatBuffer(16); + private final List teammates; + private final int[] colors = new int[]{-15007996, -43234, -3603713, -16580641, -8912129, -16601345, -2786, -64828, -15629042, -10744187}; + private boolean enabled = false; + private final Minecraft mc = Minecraft.getMinecraft(); + + public ModuleTeammates() { + this.teammates = new ArrayList<>(); + } + + public double getDistance(double x, double y, double z) { + double x2 = x - this.mc.thePlayer.posX; + double y2 = y - this.mc.thePlayer.posY; + double z2 = z - this.mc.thePlayer.posZ; + return Math.sqrt(x2 * x2 + y2 * y2 + z2 * z2); + } + + private void onDraw(GuiDrawEvent event) { + if (this.teammates.isEmpty()) { + return; + } + IntBuffer intBuffer = BufferUtils.createIntBuffer(16); + GL11.glGetInteger(2978, intBuffer); + float f = this.mc.timer.renderPartialTicks; + float f2 = (float)(this.mc.thePlayer.lastTickPosX + (this.mc.thePlayer.posX - this.mc.thePlayer.lastTickPosX) * (double)f); + float f3 = (float)(this.mc.thePlayer.lastTickPosY + (this.mc.thePlayer.posY - this.mc.thePlayer.lastTickPosY) * (double)f); + float f4 = (float)(this.mc.thePlayer.lastTickPosZ + (this.mc.thePlayer.posZ - this.mc.thePlayer.lastTickPosZ) * (double)f); + double d = (double)(this.mc.thePlayer.rotationPitch + 90.0f) * Math.PI / 180.0; + double d2 = (double)(this.mc.thePlayer.rotationYaw + 90.0f) * Math.PI / 180.0; + Vec3 vec3 = new Vec3(Math.sin(d) * Math.cos(d2), Math.cos(d), Math.sin(d) * Math.sin(d2)); + if (this.mc.gameSettings.thirdPersonView == 2) { + vec3 = new Vec3(vec3.xCoord * (double)-1, vec3.yCoord * (double)-1, vec3.zCoord * (double)-1); + } + for (CBTeammate cBTeammate : this.teammates) { + EntityPlayer entityPlayer = this.mc.theWorld.isPlayerTeamMate(cBTeammate.getUuid()); + if (entityPlayer == null) { + double d3; + if (System.currentTimeMillis() - cBTeammate.getLastUpdate() > cBTeammate.getLastMs()) continue; + double d4 = cBTeammate.getPosition().zCoord - (double)f2; + double d5 = cBTeammate.getPosition().yCoord - (double)f3; + double d6 = cBTeammate.getPosition().zCoord - (double)f4; + double d7 = this.getDistance(cBTeammate.getPosition().xCoord, cBTeammate.getPosition().yCoord, cBTeammate.getPosition().zCoord); + if (d7 > (d3 = this.mc.gameSettings.getOptionFloatValue(GameSettings.Options.RENDER_DISTANCE) * 16.0f)) { + d4 = d4 / d7 * d3; + d5 = d5 / d7 * d3; + d6 = d6 / d7 * d3; + } + this.lIIIIlIIllIIlIIlIIIlIIllI(event.getScaledResolution(), cBTeammate, (float)d4, (float)d5, (float)d6, intBuffer, vec3, (int)d7); + continue; + } + if (entityPlayer == this.mc.thePlayer) continue; + float f5 = (float)(entityPlayer.lastTickPosX + (entityPlayer.posX - entityPlayer.lastTickPosX) * (double)f - (double)f2); + float f6 = (float)(entityPlayer.lastTickPosY + (entityPlayer.posY - entityPlayer.lastTickPosY) * (double)f - (double)f3) + entityPlayer.height + 1.0f; + float f7 = (float)(entityPlayer.lastTickPosZ + (entityPlayer.posZ - entityPlayer.lastTickPosZ) * (double)f - (double)f4); + double d8 = this.getDistance(entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ); + this.lIIIIlIIllIIlIIlIIIlIIllI(event.getScaledResolution(), cBTeammate, f5, f6, f7, intBuffer, vec3, (int)d8); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ScaledResolution scaledResolution, CBTeammate teammate, float f, float f2, float f3, IntBuffer intBuffer, Vec3 vec3, int n) { + Vec3 vec32 = new Vec3(f, f2, f3); + double d = vec32.lengthVector(); + if (vec3.dotProduct(vec32 = vec32.normalize()) <= 0.02) { + double d3 = Math.sin(1.5533430342749535); + double d4 = Math.cos(1.5533430342749535); + Vec3 vec33 = vec3.crossProduct(vec32); + double d5 = vec33.xCoord; + double d6 = vec33.yCoord; + double d7 = vec33.zCoord; + double d8 = d4 + d5 * d5 * (1.0 - d4); + double d9 = d5 * d6 * (1.0 - d4) - d7 * d3; + double d10 = d5 * d7 * (1.0 - d4) + d6 * d3; + double d11 = d6 * d5 * (1.0 - d4) + d7 * d3; + double d12 = d4 + d6 * d6 * (1.0 - d4); + double d13 = d6 * d7 * (1.0 - d4) - d5 * d3; + double d14 = d7 * d5 * (1.0 - d4) - d6 * d3; + double d15 = d7 * d6 * (1.0 - d4) + d5 * d3; + double d16 = d4 + d7 * d7 * (1.0 - d4); + f = (float)(d * (d8 * vec3.xCoord + d9 * vec3.yCoord + d10 * vec3.zCoord)); + f2 = (float)(d * (d11 * vec3.xCoord + d12 * vec3.yCoord + d13 * vec3.zCoord)); + f3 = (float)(d * (d14 * vec3.xCoord + d15 * vec3.yCoord + d16 * vec3.zCoord)); + } + FloatBuffer floatBuffer = BufferUtils.createFloatBuffer(3); + GLU.gluProject(f, f2, f3, this.modelViewMatrixBuffer, this.projectionMatrixBuffer, intBuffer, floatBuffer); + float f4 = floatBuffer.get(0) / (float)scaledResolution.getScaleFactor(); + float f5 = floatBuffer.get(1) / (float)scaledResolution.getScaleFactor(); + TeammateArrowLocation arrowLocation = null; + int n2 = 8; + int n3 = 10; + int n4 = -4 - n3; + float f6 = (float)scaledResolution.getScaledHeight() - f5; + if (f6 < 0.0f) { + arrowLocation = TeammateArrowLocation.RIGHT; + f5 = scaledResolution.getScaledHeight() - 6; + } else if (f6 > (float)(scaledResolution.getScaledHeight() - n3)) { + arrowLocation = TeammateArrowLocation.BOTTOM; + f5 = 6; + } + if (f4 - (float)n2 < 0.0f) { + arrowLocation = TeammateArrowLocation.TOP; + f4 = 6; + } else if (f4 > (float)(scaledResolution.getScaledWidth() - n2)) { + arrowLocation = TeammateArrowLocation.LEFT; + f4 = scaledResolution.getScaledWidth() - 6; + } + GL11.glPushMatrix(); + GL11.glTranslatef(f4, (float)scaledResolution.getScaledHeight() - f5, 0.0f); + if (arrowLocation != null) { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showOffScreenMarker.getValue()) { + this.lIIIIlIIllIIlIIlIIIlIIllI(teammate, arrowLocation, 0.0f, 0.0f); + } + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI(teammate, n2, (float)n4, (float)n3); + if (n > 40 && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showDistance.getValue()) { + this.mc.fontRenderer.drawCenteredStringWithShadow("(" + n + "m)", 0, 10, -1); + } + } + GL11.glPopMatrix(); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(CBTeammate cBTeammate, TeammateArrowLocation arrowLocation, float f, float f2) { + Tessellator tes = Tessellator.instance; + GL11.glEnable(3042); + GL11.glDisable(3553); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + if (cBTeammate.isLeader()) { + GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.66f); + } else { + Color color = cBTeammate.getColor(); + GL11.glColor4f((float)color.getRed() / (float)255, (float)color.getGreen() / 255.0F, (float)color.getBlue() / 255.0F, 0.66f); + } + float f3 = 8; + float f4 = 10; + GL11.glPushMatrix(); + GL11.glTranslatef(f, f2, 0.0f); + switch (arrowLocation) { + case TOP: + tes.startDrawingQuads(); + tes.addVertex(f3 / 2.0f, f4 / 2.0f, 0.0); + tes.addVertex(-f3 / 2.0f, 0.0, 0.0); + tes.addVertex(f3 / 2.0f, -f4 / 2.0f, 0.0); + tes.addVertex(-f3 / 2.0f, 0.0, 0.0); + tes.draw(); + break; + case LEFT: + tes.startDrawingQuads(); + tes.addVertex(-f3 / 2.0f, f4 / 2.0f, 0.0); + tes.addVertex(f3 / 2.0f, 0.0, 0.0); + tes.addVertex(-f3 / 2.0f, -f4 / 2.0f, 0.0); + tes.addVertex(f3 / 2.0f, 0.0, 0.0); + tes.draw(); + break; + case BOTTOM: + tes.startDrawingQuads(); + tes.addVertex(-f3 / 2.0f, -f4 / 2.0f, 0.0); + tes.addVertex(0.0, f4 / 2.0f, 0.0); + tes.addVertex(f3 / 2.0f, -f4 / 2.0f, 0.0); + tes.addVertex(0.0, f4 / 2.0f, 0.0); + tes.draw(); + break; + case RIGHT: + tes.startDrawingQuads(); + tes.addVertex(-f3 / 2.0f, f4 / 2.0f, 0.0); + tes.addVertex(0.0, -f4 / 2.0f, 0.0); + tes.addVertex(f3 / 2.0f, f4 / 2.0f, 0.0); + tes.addVertex(0.0, -f4 / 2.0f, 0.0); + tes.draw(); + } + GL11.glPopMatrix(); + GL11.glEnable(3553); + GL11.glDisable(3042); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(CBTeammate teammate, float f, float f2, float f3) { + Tessellator tessellator = Tessellator.instance; + GL11.glEnable(3042); + GL11.glDisable(3553); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + if (teammate.isLeader()) { + GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.66f); + } else { + Color color = teammate.getColor(); + GL11.glColor4f((float)color.getRed() / 255.0f, (float)color.getGreen() / 255.0f, (float)color.getBlue() / 255.0f, 0.66f); + } + GL11.glPushMatrix(); + GL11.glScalef(0.6f, 0.6f, 0.6f); + GL11.glRotatef(45.0f, 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(f * 2.0f, 0.0f, 0.0f); + GL11.glRotatef(90.0f, 0.0f, 0.0f, -1.0f); + tessellator.startDrawingQuads(); + tessellator.addVertex(-f, f2, 0.0); + tessellator.addVertex(-f, f2 + f3 / 2.0f, 0.0); + tessellator.addVertex(f, f2 + f3 / 2.0f, 0.0); + tessellator.addVertex(f, f2, 0.0); + tessellator.draw(); + GL11.glRotatef(90.0f, 0.0f, 0.0f, -1.0f); + GL11.glTranslatef(f * 2.0f + 1.0f, f3 / 2.0f + 1.0f, 0.0f); + tessellator.startDrawingQuads(); + tessellator.addVertex(-f / 2.0f + 1.0f, f2, 0.0); + tessellator.addVertex(-f / 2.0f + 1.0f, f2 + f3 / 2.0f, 0.0); + tessellator.addVertex(f, f2 + f3 / 2.0f, 0.0); + tessellator.addVertex(f, f2, 0.0); + tessellator.draw(); + GL11.glPopMatrix(); + GL11.glEnable(3553); + GL11.glDisable(3042); + } + + private void onDisconnect(DisconnectEvent event) { + this.teammates.clear(); + } + + public CBTeammate createTeammate(String teammateKey) { + for (CBTeammate teammate : this.teammates) { + if (!teammate.getUuid().equals(teammateKey)) continue; + return teammate; + } + return null; + } + + public void setEnabled(boolean bl) { + if (bl && !this.enabled) { + this.enabled = true; + CheatBreaker.getInstance().getEventBus().addEvent(GuiDrawEvent.class, this::onDraw); + CheatBreaker.getInstance().getEventBus().addEvent(DisconnectEvent.class, this::onDisconnect); + } else if (!bl && this.enabled) { + this.enabled = false; + CheatBreaker.getInstance().getEventBus().removeEvent(GuiDrawEvent.class, this::onDraw); + CheatBreaker.getInstance().getEventBus().removeEvent(DisconnectEvent.class, this::onDisconnect); + } + } + + public enum TeammateArrowLocation { + TOP, + LEFT, + BOTTOM, + RIGHT + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/FPS.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/FPS.java new file mode 100644 index 0000000..bc25bcc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/FPS.java @@ -0,0 +1,46 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.Minecraft; +import com.cheatbreaker.client.module.data.Setting; +import org.lwjgl.opengl.GL11; + +@Deprecated +public class FPS extends AbstractModule { + private final Setting background; + private final Setting textColor; + private final Setting backgroundColor; + + public FPS() { + super("FPS"); + this.setDefaultAnchor(GuiAnchor.RIGHT_TOP); + this.setDefaultTranslations(0.0f, 0.0f); + this.setState(false); + this.background = new Setting(this, "Show Background").setValue(true); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x6F000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.setPreviewLabel("[144 FPS]", 1.4f); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if ((Boolean) this.background.getValue()) { + this.setDimensions(56, 18); + Gui.drawRect(0.0f, 0.0f, 56, 13, this.backgroundColor.getColorValue()); + String string = Minecraft.debugFPS + " FPS"; + this.mc.fontRenderer.drawString(string, (int)(this.width / 2.0f - (float)(this.mc.fontRenderer.getStringWidth(string) / 2)), 3, this.textColor.getColorValue()); + } else { + String string = "[" + Minecraft.debugFPS + " FPS]"; + this.setDimensions(this.mc.fontRenderer.drawString(string, this.width / 2.0f - (float)(this.mc.fontRenderer.getStringWidth(string) / 2), 0.0f, this.textColor.getColorValue(), true), 18); + } + GL11.glPopMatrix(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleBossBar.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleBossBar.java new file mode 100644 index 0000000..2e6c215 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleBossBar.java @@ -0,0 +1,123 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +/** + * Displays the current Minecraft Boss' health and name. + * @see AbstractModule + */ +public class ModuleBossBar extends AbstractModule { + private final Setting textColor; + private final Setting renderHealth; + private final Setting renderText; + private final Setting textShadow; + private final Setting textPosition; + private final Setting barWidth; + private final Setting barHeight; + private final Setting bossTexture; + private final Setting bossBarColor; + private final Setting topBossBarColor; + private final Setting bottomBossBarColor; + private final Setting outlineBossBarColor; + + public ModuleBossBar() { + super("Boss bar"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.notRenderHUD = false; + this.renderText = new Setting(this, "Render Text").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.renderHealth = new Setting(this, "Render Health").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadow = new Setting(this, "Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.renderText.getValue()); + this.bossTexture = new Setting(this, "Boss Bar Texture").setValue("Texture Pack").acceptedStringValues("Texture Pack", "Default", "Blurred", "Custom").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue()); + this.textPosition = new Setting(this, "Text Position").setValue(50.0f).setMinMax(0.0f, 100.0f).setUnit("%").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && (Boolean) this.renderText.getValue()); + this.barWidth = new Setting(this, "Boss Bar Width").setValue(182.0F).setMinMax(100.0F, 200.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.barHeight = new Setting(this, "Boss Bar Height").setValue(5.0F).setMinMax(3.0f, 24.0f).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderText.getValue()); + this.bossBarColor = new Setting(this, "Boss Bar Color").setValue(-65337).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && !this.bossTexture.getValue().equals("Texture Pack") && !this.bossTexture.getValue().equals("Custom")); + this.topBossBarColor = new Setting(this, "Top Boss Bar Color").setValue(0xFFEC00B8).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.bottomBossBarColor = new Setting(this, "Bottom Boss Bar Color").setValue(0xFF8C006D).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.outlineBossBarColor = new Setting(this, "Outline Boss Bar Color").setValue(0xFF4A003A).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.renderHealth.getValue() && this.bossTexture.getValue().equals("Custom")); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/bossbar.png"), 106, 5); + this.setDescription("Displays the current boss and health."); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.setDefaultState(true); + } + + public void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) return; + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if (BossStatus.bossName == null || BossStatus.statusBarTime <= 0) { + this.render("Wither", 1.0F, 0, (Boolean) renderText.getValue() ? 10 : 0); + } + GL11.glPopMatrix(); + } + + public void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) return; + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if (BossStatus.bossName != null && BossStatus.statusBarTime > 0) { + --BossStatus.statusBarTime; + this.render(BossStatus.bossName, BossStatus.healthScale, 0, (Boolean) renderText.getValue() ? 10 : 0); + } + GL11.glPopMatrix(); + } + + public void render(String bossName, float healthScale, int x, int y) { + GL11.glEnable(GL11.GL_BLEND); + int barColor = this.bossBarColor.getColorValue(); + if (this.bossTexture.getValue().equals("Texture Pack")) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(Gui.icons); + } else { + GL11.glColor4f((barColor >> 16 & 255) / 255.0F, (barColor >> 8 & 255) / 255.0F, (barColor & 255) / 255.0F, (barColor >> 24 & 255) / 255.0F); + this.mc.getTextureManager().bindTexture(new ResourceLocation("client/icons/bossbar/" + this.bossTexture.getValue().toString().toLowerCase() + ".png")); + } + + FontRenderer font = this.mc.fontRenderer; + float width = this.bossTexture.getValue().equals("Custom") ? this.barWidth.getFloatValue() : 182; + float x2 = !(Boolean) renderText.getValue() || font.getStringWidth(bossName) < width ? x : x + (font.getStringWidth(bossName) - width) * this.textPosition.getFloatValue() / 100.0F; + int y2 = y; + float remainingHealth = healthScale * width; + if ((Boolean) renderHealth.getValue()) { + if (this.bossTexture.getValue().equals("Custom")) { + int top = new Color((this.topBossBarColor.getColorValue() >> 16 & 255) / 4, (this.topBossBarColor.getColorValue() >> 8 & 255) / 4, (this.topBossBarColor.getColorValue() & 255) / 4, this.topBossBarColor.getColorValue() >> 24 & 255).getRGB(); + int bottom = new Color((this.bottomBossBarColor.getColorValue() >> 16 & 255) / 4, (this.bottomBossBarColor.getColorValue() >> 8 & 255) / 4, (this.bottomBossBarColor.getColorValue() & 255) / 4, this.bottomBossBarColor.getColorValue() >> 24 & 255).getRGB(); + RenderUtil.drawGradientRectWithOutline(x2, y2, x2 + width, y2 + this.barHeight.getFloatValue(), this.outlineBossBarColor.getColorValue(), top, bottom); + if (remainingHealth > 0) { + RenderUtil.drawGradientRectWithOutline(x2, y2, x2 + remainingHealth, y2 + this.barHeight.getFloatValue(), 0, this.topBossBarColor.getColorValue(), this.bottomBossBarColor.getColorValue()); + } + RenderUtil.drawGradientRectWithOutline(x2, y2, x2 + width, y2 + this.barHeight.getFloatValue(), this.outlineBossBarColor.getColorValue(), 0, 0); + } else { + this.mc.ingameGUI.drawTexturedModalRect(x2, y2, 0, 74, (int)width, 5); + this.mc.ingameGUI.drawTexturedModalRect(x2, y2, 0, 74, (int)width, 5); + if (remainingHealth > 0) { + this.mc.ingameGUI.drawTexturedModalRect(x2, y2, 0, 79, (int)remainingHealth, 5); + } + } + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + if ((Boolean) renderText.getValue()) font.drawString(bossName, x + this.width / 2 - (float)(font.getStringWidth(bossName) / 2), y - 10, this.textColor.getColorValue(), (Boolean)this.textShadow.getValue()); + float barHeight = (Boolean) renderHealth.getValue() ? this.bossTexture.getValue().equals("Custom") ? this.barHeight.getFloatValue() : 5.0F : 0.0F; + float textHeight = (Boolean) renderText.getValue() ? 9.0F : 0.0F; + float extraHeight = (Boolean) renderText.getValue() && (Boolean) renderHealth.getValue() ? 1.0F : 0.0F; + this.setDimensions((Boolean) renderHealth.getValue() ? (Boolean) renderText.getValue() ? Math.max(font.getStringWidth(bossName), width) : width : (float)(font.getStringWidth(bossName)), barHeight + textHeight + extraHeight); + GL11.glDisable(GL11.GL_BLEND); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleCoordinates.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleCoordinates.java new file mode 100644 index 0000000..a414f92 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleCoordinates.java @@ -0,0 +1,137 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.event.impl.ClickEvent; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.Minecraft; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +/** + * Displays your XYZ coordinates and direction. + */ +public class ModuleCoordinates extends AbstractModule { + private final Setting generalOptions; + private final Setting showWhileTyping; + private final Setting mode; + private final Setting coords; + private final Setting hideYCoord; + private final Setting direction; + public Setting customLine; + private final Setting colorSettings; + private final Setting coordsColor; + private final Setting directionColor; + private final List clicks = new ArrayList<>(); + + public ModuleCoordinates() { + super("Coordinates"); + this.setDefaultAnchor(GuiAnchor.LEFT_TOP); + this.setDefaultTranslations(-1, 0.0f); + this.setDefaultState(false); + this.generalOptions = new Setting(this, "label").setValue("General Options"); + this.showWhileTyping = new Setting(this, "Show While Typing", "Show the mod when opening chat.").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.mode = new Setting(this, "Mode", "Layout the mod should display.").setValue("Horizontal").acceptedStringValues("Horizontal", "Vertical").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.coords = new Setting(this, "Coordinates", "Show the coordiantes.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hideYCoord = new Setting(this, "Hide Y Coordinate", "Hide the Y coordinate.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coords.getValue()); + this.direction = new Setting(this, "Direction", "Show the direction the player is facing.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.customLine = new Setting(this, "Custom Line").setValue("").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.colorSettings = new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coords.getValue() || (Boolean) this.direction.getValue()); + this.coordsColor = new Setting(this, "Coordinates Color", "Change the coordinates text color.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.coords.getValue()); + this.directionColor = new Setting(this, "Direction Color", "Change the direction text color.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.direction.getValue()); + this.setPreviewLabel("(16, 65, 120) NW", 1.0f); + this.setDescription("Displays your XYZ coordinates and direction."); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(ClickEvent.class, this::onOldClickEvent); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + this.scaleAndTranslate(event.getScaledResolution()); + int n = MathHelper.floor_double(this.mc.thePlayer.posX); + int n2 = (int)this.mc.thePlayer.boundingBox.minY; + int n3 = MathHelper.floor_double(this.mc.thePlayer.posZ); + if (!this.mc.ingameGUI.getChatGUI().getChatOpen() || (Boolean) this.showWhileTyping.getValue()) { + if (this.customLine.getValue().equals("")) { + int n4 = 0; + float f = 4; + if ((Boolean) this.coords.getValue()) { + if (this.mode.getValue().equals("Horizontal")) { + String horizontalString = ((Boolean) this.hideYCoord.getValue() ? String.format("(%1$d, %2$d)", n, n3) : String.format("(%1$d, %2$d, %3$d)", n, n2, n3)) + ((Boolean) this.direction.getValue() ? " " : ""); + n4 = this.mc.fontRenderer.drawStringWithShadow(horizontalString, 0.0f, 0.0f, this.coordsColor.getColorValue()); + } else { + n4 = 50; + f = (Boolean) this.hideYCoord.getValue() ? 9.5F : 16.0F; + this.mc.fontRenderer.drawStringWithShadow("X: " + n, 0.0f, 0.0f, this.coordsColor.getColorValue()); + if (!(Boolean) this.hideYCoord.getValue()) { + this.mc.fontRenderer.drawStringWithShadow("Y: " + n2, 0.0f, 12.0F, this.coordsColor.getColorValue()); + } + this.mc.fontRenderer.drawStringWithShadow("Z: " + n3, 0.0f, (Boolean) this.hideYCoord.getValue() ? 12.0F : 24.0F, this.coordsColor.getColorValue()); + } + } + if ((Boolean) this.direction.getValue()) { + String[] directions = new String[]{"N", "NE", "E", "SE", "S", "SW", "W", "NW"}; + double d = (double)MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw) + 180.0; + d += 22.5D; + d %= 360.0; + String string = directions[MathHelper.floor_double(d / 45)]; + this.mc.fontRenderer.drawStringWithShadow(string, (float)n4, f - (float)4, this.directionColor.getColorValue()); + n4 += this.mc.fontRenderer.getStringWidth(string); + } + this.setDimensions(n4, Math.max(f + (!this.mode.getValue().equals("Horizontal") && (Boolean)this.coords.getValue() ? 18.0F : 0.0F),this.mc.fontRenderer.FONT_HEIGHT)); + } else { + String[] arrstring = ((String)this.customLine.getValue()).split("%NL%"); + float f = -1; + float f2 = arrstring.length * (this.mc.fontRenderer.FONT_HEIGHT + 1); + int n5 = 0; + for (String string : arrstring) { + float f3 = this.mc.fontRenderer.drawStringWithShadow(string = this.customText(string), 0.0f, (float)((this.mc.fontRenderer.FONT_HEIGHT + 1) * n5), -1); + if (f3 > f) { + f = f3; + } + this.setDimensions((int)f, (int)(Math.max(f2, this.mc.fontRenderer.FONT_HEIGHT))); + ++n5; + } + } + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + + private String customText(String string) { + String[] arrstring = new String[]{"N", "NE", "E", "SE", "S", "SW", "W", "NW"}; + double d = (double)MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw) + 180.0; + d += 22.5D; + d %= 360.0; + String string2 = arrstring[MathHelper.floor_double(d /= 45.0)]; + int n = MathHelper.floor_double(this.mc.thePlayer.posX); + int n2 = (int)this.mc.thePlayer.boundingBox.minY; + int n3 = MathHelper.floor_double(this.mc.thePlayer.posZ); + string = !this.mc.isIntegratedServerRunning() && this.mc.theWorld != null ? string.replaceAll("%IP%", this.mc.currentServerData.serverIP) : string.replaceAll("%IP%", "?"); + return string.replaceAll("%FPS%", Minecraft.debugFPS + "").replaceAll("%DIR%", string2).replaceAll("%CPS%", this.clicks.size() + "").replaceAll("%COORDS%", String.format("%1$d, %2$d, %3$d", n, n2, n3)).replaceAll("%X%", n + "").replaceAll("%Y%", n2 + "").replaceAll("%Z%", n3 + ""); + } + + private void onTick(TickEvent event) { + if (((String)this.customLine.getValue()).contains("%CPS%")) { + this.clicks.removeIf(l -> l < System.currentTimeMillis() - 1000L); + } + } + + private void onOldClickEvent(ClickEvent event) { + if (event.getMouseButton() == 0 && ((String)this.customLine.getValue()).contains("%CPS%")) { + this.clicks.add(System.currentTimeMillis()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleDirectionHUD.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleDirectionHUD.java new file mode 100644 index 0000000..1ffa62e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleDirectionHUD.java @@ -0,0 +1,117 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.HudUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +/** + * Displays your cardinal direction. + * @see AbstractModule + */ +public class ModuleDirectionHUD extends AbstractModule { + private final Setting markerColor; + private final Setting directionColor; + private final Setting highlightColor; + private final Setting backgroundColor; + private final Setting borderColor; + private final Setting showWhileTyping; + private final Setting background; + private Setting border; + private Setting borderThickness; + private final Setting highlightNorth; + private final ResourceLocation texture = new ResourceLocation("textures/gui/compass.png"); + + public ModuleDirectionHUD() { + super("Direction HUD"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.setState(false); + this.showWhileTyping = new Setting(this, "Show While Typing", "Show the mod when opening chat.").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.highlightNorth = new Setting(this, "Highlight North", "Make North highlight a different color.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.background = new Setting(this, "Show Background", "Draw a background.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.border = new Setting(this, "Show Border", "Draw a border around the background.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.borderThickness = new Setting(this, "Border Thickness", "Change the thickness of the border.").setValue(1.0F).setMinMax(0.25F, 3.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.border.getValue()); + this.markerColor = new Setting(this, "Marker Color", "Change the marker color.").setValue(-43691).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.directionColor = new Setting(this, "Direction Color", "Change the direction color.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightColor = new Setting(this, "Highlight Color", "Change the highlight color.").setValue(-43691).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.highlightNorth.getValue()); + this.backgroundColor = new Setting(this, "Background Color", "Change the background color.").setValue(0xFF212121).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.borderColor = new Setting(this, "Border Color", "Sets the color for the border.").setValue(-1627389952).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.border.getValue()); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/dirhud.png"), 65, 12); + this.setDescription("Displays your cardinal direction."); + this.setCreators("bspkrs", "jadedcat"); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + this.scaleAndTranslate(event.getScaledResolution()); + this.setDimensions(66, 12); + if (!this.mc.ingameGUI.getChatGUI().getChatOpen() || (Boolean) this.showWhileTyping.getValue()) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.drawCompass(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + + private void drawCompass() { + int n = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * (float)256 / (float)360) + 0.3450704167414649 * 1.4489796161651611) & 0xFF; + int n2 = 0; + int n3 = 0; + if ((Integer)this.directionColor.getValue() != 4095) { + int directionColor = this.directionColor.getColorValue(); + int backgroundColor = this.backgroundColor.getColorValue(); + int highlightColor = this.highlightColor.getColorValue(); + this.mc.getTextureManager().bindTexture(this.texture); + if ((Boolean) this.background.getValue()) { + GL11.glColor4f((float)(backgroundColor >> 16 & 0xFF) / (float)255, (float)(backgroundColor >> 8 & 0xFF) / (float)255, (float)(backgroundColor & 0xFF) / (float)255, (float)(backgroundColor >> 24 & 255) / (float)255); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 0, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 12, 66, 12, -100); + } + } + + GL11.glColor4f((float)(directionColor >> 16 & 0xFF) / (float)255, (float)(directionColor >> 8 & 0xFF) / (float)255, (float)(directionColor & 0xFF) / (float)255, (float)(directionColor >> 24 & 255) / (float)255); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 24, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 36, 66, 12, -100); + } + if ((Boolean) this.highlightNorth.getValue()) { + GL11.glColor4f((float)(highlightColor >> 16 & 255) / (float)255, (float)(highlightColor >> 8 & 255) / (float)255, (float)(highlightColor & 255) / (float)255, (float)(highlightColor >> 24 & 255) / (float)255); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 72, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 84, 66, 12, -100); + } + } + } else { + this.mc.getTextureManager().bindTexture(this.texture); + if (n < 128) { + HudUtil.drawTexturedModalRect(n3, n2, n, 0, 66, 12, -100); + } else { + HudUtil.drawTexturedModalRect(n3, n2, n - 128, 12, 66, 12, -100); + } + } + this.mc.fontRenderer.drawString("|", n3 + 32, n2 + 1, this.markerColor.getColorValue()); + this.mc.fontRenderer.drawString("|§r", n3 + 32, n2 + 5, this.markerColor.getColorValue()); + if ((Boolean) this.border.getValue()) { + float borderThickness = (Float) this.borderThickness.getValue(); + Gui.drawOutline(-borderThickness, -borderThickness, 66 + borderThickness, 12 + borderThickness, borderThickness, this.borderColor.getColorValue()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleNotifications.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleNotifications.java new file mode 100644 index 0000000..6ccffe5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleNotifications.java @@ -0,0 +1,171 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.KeepAliveEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class ModuleNotifications extends AbstractModule { + public long time = System.currentTimeMillis(); + private final List notifications = new ArrayList<>(); + + public ModuleNotifications() { + super("Notifications"); + this.addEvent(KeepAliveEvent.class, this::onKeepAlive); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.setDefaultState(true); + } + + private void onKeepAlive(KeepAliveEvent event) { + this.time = System.currentTimeMillis(); + } + + private void onTick(TickEvent event) { + for (Notification notification : this.notifications) { + notification.onTick(); + long l = notification.ticks + notification.duration - System.currentTimeMillis(); + if (l > 0L) continue; + int n = notification.scaledWidth; + for (Notification notification2 : this.notifications) { + if (notification2.scaledWidth >= notification.scaledWidth) continue; + notification2.activeTicks = 0; + notification2.scaledHeight = n; + n = notification2.scaledWidth; + } + this.notifications.remove(notification); + } + } + + private void onGuiDraw(GuiDrawEvent event) { + for (Notification notification : this.notifications) { + notification.render(event.getScaledResolution().getScaledWidth()); + } + } + + public void send(String notificationType, String message, long duration) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + if (duration < 2000L) { + duration = 2000L; + } + + message = message.replaceAll("&([abcdefghijklmrABCDEFGHIJKLMNR0-9])|(&$)", "§$1"); + Type type; + switch(notificationType.toLowerCase()) { + case "info": + type = Type.INFO; + break; + case "error": + type = Type.ERROR; + break; + default: + type = Type.NEUTRAL; + } + + Notification var11 = new Notification(this, scaledResolution, type, message, duration); + int var12 = var11.scaledHeight - var11.height - 2; + + for(int var9 = this.notifications.size() - 1; var9 >= 0; --var9) { + Notification var10 = this.notifications.get(var9); + var10.activeTicks = 0; + var10.scaledHeight = var12; + var12 -= 2 + var10.height; + } + + this.notifications.add(var11); + } + + class Notification { + public Type type; + public String message; + public long duration; + public long ticks = System.currentTimeMillis(); + public int scaledWidth; + public int scaledHeight; + public int height; + public int activeTicks = 0; + final ModuleNotifications notificationsMod; + + Notification(ModuleNotifications notificationsMod, ScaledResolution scaledResolution, Type type, String message, long duration) { + this.notificationsMod = notificationsMod; + this.type = type; + this.message = message; + this.duration = duration; + this.height = type == Type.NEUTRAL ? 16 : 20; + this.scaledHeight = scaledResolution.getScaledHeight() - 14 - this.height; + this.scaledWidth = scaledResolution.getScaledHeight() + this.height; + } + + public void onTick() { + if (this.scaledHeight != -1) { + ++this.activeTicks; + float f = (float)this.activeTicks * ((float)this.activeTicks / (float)5) / (float)7; + if (this.scaledWidth > this.scaledHeight) { + if ((float)this.scaledWidth - f < (float)this.scaledHeight) { + this.scaledWidth = this.scaledHeight; + this.scaledHeight = -1; + } else { + this.scaledWidth = (int)((float)this.scaledWidth - f); + } + } else if (this.scaledWidth < this.scaledHeight) { + if ((float)this.scaledWidth + f > (float)this.scaledHeight) { + this.scaledWidth = this.scaledHeight; + this.scaledHeight = -1; + } else { + this.scaledWidth = (int)((float)this.scaledWidth + f); + } + } else if (this.scaledWidth == this.scaledHeight) { + this.scaledHeight = -1; + } + } + } + + public void render(int n) { + CBFontRenderer cBFontRenderer = CheatBreaker.getInstance().playRegular16px; + int n2 = this.scaledWidth; + float f = cBFontRenderer.getStringWidth(this.message); + int n3 = (int)(this.type == Type.NEUTRAL ? f + (float)10 : f + (float)30); + Gui.drawRect(n - 5 - n3, n2, n - 5, n2 + this.height, -1358954496); + switch (this.type) { + case ERROR: + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(new ResourceLocation("client/icons/error-64.png"), (float)6, (float)(n - 10 - n3 + 9), (float)(n2 + 4)); + Gui.drawRect((float)(n - 10) - f - 4.5f, n2 + 4, (float)(n - 10) - f - 4.0F, n2 + this.height - 4, -1342177281); + break; + case INFO: + GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.65F); + RenderUtil.renderIcon(new ResourceLocation("client/icons/info-64.png"), (float)6, (float)(n - 10 - n3 + 9), (float)(n2 + 4)); + Gui.drawRect((float)(n - 10) - f - 4.5f, n2 + 4, (float)(n - 10) - f - 4.0F, n2 + this.height - 4, -1342177281); + } + long l = this.duration - (this.ticks + this.duration - System.currentTimeMillis()); + if (l > this.duration) { + l = this.duration; + } + if (l < 0L) { + l = 0L; + } + float f2 = f * ((float)l / (float)this.duration * (float)100 / (float)100); + Gui.drawRect((float)(n - 10) - f, (float)(n2 + this.height) - 56.46667f * 0.077922076f, (float)(n - 10) - f + f, n2 + this.height - 4, 0x30666666); + Gui.drawRect((float)(n - 10) - f, (float)(n2 + this.height) - 2.2f * 2.0f, (float)(n - 10) - f + f2, n2 + this.height - 4, -1878982912); + cBFontRenderer.drawString(this.message, (float)(n - 10) - f, (float)(n2 + (this.type == Type.NEUTRAL ? 2 : 4)), -1); + } + } + + enum Type { + INFO, + ERROR, + NEUTRAL + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePlayerList.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePlayerList.java new file mode 100644 index 0000000..e9a4a8e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePlayerList.java @@ -0,0 +1,284 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleNickHider; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiPlayerInfo; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.List; +import java.util.regex.Pattern; + +/** + * Allows the user to move and customize the player list/tab. + * @see AbstractModule + */ +public class ModulePlayerList extends AbstractModule { + public Setting background; + public Setting rowBackground; + public Setting highlightSelfRow; + public Setting highlightCBRows; + public Setting backgroundColor; + public Setting pingRowColor; + public Setting rowColor; + public Setting highlightedSelfRowColor; + public Setting highlightedCBRowColor; + + public Setting nameTextShadow; + public Setting showLogo; + public Setting highlightSelfNameInTab; + public Setting highlightCBPlayersNamesInTab; + public Setting highlightedSelfNameColor; + public Setting highlightedCBNameColor; + + public Setting ping; + public Setting pingAsNumber; + public Setting pingTextShadow; + public Setting dynamicPingNumberColor; + public Setting staticPingColor; + public Setting lowPingColor; + public Setting mediumPingColor; + public Setting highPingColor; + public Setting extremelyHighPingColor; + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + + public ModulePlayerList() { + super("Player List"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.setDefaultTranslations(0.0F, 12.0F); + this.notRenderHUD = false; + + new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.background = new Setting(this, "Show Background").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.rowBackground = new Setting(this, "Show Row Background").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightSelfRow = new Setting(this, "Highlight Own Row").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightCBRows = new Setting(this, "Highlight CheatBreaker Players' Row").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pingRowColor = new Setting(this, "Use Ping Color for Row Background").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.rowBackground.getValue()); + this.rowColor = new Setting(this, "Row Background Color").setValue(0x20FFFFFF).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.rowBackground.getValue()); + this.highlightedSelfRowColor = new Setting(this, "Self Row Color").setValue(0x40AA0000).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.rowBackground.getValue() && (Boolean) this.highlightSelfRow.getValue()); + this.highlightedCBRowColor = new Setting(this, "CheatBreaker Row Color").setValue(0x40DA4253).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.rowBackground.getValue() && (Boolean) this.highlightCBRows.getValue()); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Name Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.nameTextShadow = new Setting(this, "Name Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showLogo = new Setting(this, "Show CheatBreaker Logo").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightSelfNameInTab = new Setting(this, "Highlight Own Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightCBPlayersNamesInTab = new Setting(this, "Highlight CheatBreaker Players' Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightedSelfNameColor = new Setting(this, "Self Text Color").setValue(0xFFCC2222).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.highlightSelfNameInTab.getValue()); + this.highlightedCBNameColor = new Setting(this, "CheatBreaker Text Color").setValue(0xFFFB6576).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.highlightCBPlayersNamesInTab.getValue()); + + new Setting(this, "label").setValue("Ping Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.ping = new Setting(this, "Show Ping").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.pingAsNumber = new Setting(this, "Show Ping as Number").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.ping.getValue()); + this.pingTextShadow = new Setting(this, "Ping Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue()); + this.dynamicPingNumberColor = new Setting(this, "Dynamic Ping Number Color").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue()); + this.staticPingColor = new Setting(this, "Static Ping Color").setValue(0xFFFFFF55).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && !(Boolean) this.dynamicPingNumberColor.getValue()); + this.lowPingColor = new Setting(this, "Low Ping Color").setValue(0xFF55FF55).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + this.mediumPingColor = new Setting(this, "Medium Ping Color").setValue(0xFFFFFF55).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + this.highPingColor = new Setting(this, "High Ping Color").setValue(0xFFFF5555).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + this.extremelyHighPingColor = new Setting(this, "Extremely High Ping Color").setValue(0xFFAA0000).setMinMax(-2147483648, 2147483647).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.ping.getValue() && (Boolean) this.pingAsNumber.getValue() && (Boolean) this.dynamicPingNumberColor.getValue()); + setDescription("Customize the player list tab."); + addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + public String valueString() { + return null; + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + GL11.glPushMatrix(); + scaleAndTranslate(event.getScaledResolution()); + render(0, 0); + GL11.glPopMatrix(); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + ScoreObjective var48 = this.mc.theWorld.getScoreboard().func_96539_a(0); + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if (this.mc.gameSettings.keyBindPlayerList.getIsKeyPressed() && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1 || var48 != null)) { + render(0, 0); + } + GL11.glPopMatrix(); + } + } + + public void render(int x, int y) { + ProfileHandler profileHandler = CheatBreaker.getInstance().getProfileHandler(); + + GL11.glEnable(GL11.GL_BLEND); + int var41; + String playerName; + int var16; + int var17; + FontRenderer fontRenderer = this.mc.fontRenderer; + ScoreObjective var48 = this.mc.theWorld.getScoreboard().func_96539_a(0); + this.mc.mcProfiler.startSection("playerList"); + NetHandlerPlayClient var25 = this.mc.thePlayer.sendQueue; + List var49 = var25.playerInfoList; + var41 = var25.currentServerMaxPlayers; + var16 = var41; + + for (var17 = 1; var16 > 20; var16 = (var41 + var17 - 1) / var17) { + ++var17; + } + + int var27 = 300 / var17; + if (var27 > 150) { + var27 = 150; + } + + byte var29 = (byte) y; + if ((Boolean) background.getValue()) { + Gui.drawRect(x, var29, x + (float) (var27 * var17 + 1), (float) (var29 + 9 * var16) + 1, this.backgroundColor.getColorValue()); + } + this.setDimensions((x + var27 * var17 + 1.01F), (var29 + 9 * var16) + 1); + + + int var21; + for (var21 = 0; var21 < var41; ++var21) { + int var46 = x + var21 % var17 * var27 + 1; + int var23 = var29 + var21 / var17 * 9 + 1; + int pintColor = this.rowColor.getColorValue(); + if (var21 < var49.size()) { + GuiPlayerInfo var51 = (GuiPlayerInfo) var49.get(var21); + if (var51.responseTime < -1) { + pintColor = this.lowPingColor.getColorValue(); + } else if (var51.responseTime < 150) { + pintColor = this.lowPingColor.getColorValue(); + } else if (var51.responseTime < 300) { + pintColor = this.mediumPingColor.getColorValue(); + } else if (var51.responseTime < 600) { + pintColor = this.highPingColor.getColorValue(); + } else if (var51.responseTime < 1000) { + pintColor = this.extremelyHighPingColor.getColorValue(); + } else { + pintColor = this.rowColor.getColorValue(); + } + + } + int alphaT = Math.min(this.rowColor.getColorValue() >> 24 & 255, pintColor >> 24 & 255); + int redT = pintColor >> 16 & 255; + int greenT = pintColor >> 8 & 255; + int blueT = pintColor & 255; + if ((Boolean) this.rowBackground.getValue() && !(var21 < var49.size())) { + Gui.drawRect((float) var46, (float) var23, (float) (var46 + var27 - 1), (float) (var23 + 8), (Boolean) this.pingRowColor.getValue() ? new Color(redT, greenT, blueT, alphaT).getRGB() : this.rowColor.getColorValue()); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(3008); + if (var21 < var49.size()) { + GuiPlayerInfo var51 = (GuiPlayerInfo) var49.get(var21); + ScorePlayerTeam var31 = this.mc.theWorld.getScoreboard().getPlayersTeam(var51.name); + playerName = ScorePlayerTeam.formatPlayerName(var31, var51.name); + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + playerName = playerName.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + playerName = playerName.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + if ((Boolean) this.rowBackground.getValue()) { + if ((playerName.contains(this.mc.getSession().getUsername()) || playerName.contains(CheatBreaker.getInstance().getModuleManager().nickHiderMod.customNameString.getStringValue())) && (Boolean) this.highlightSelfRow.getValue()) { + Gui.drawRect((float) var46, (float) var23, (float) (var46 + var27 - 1), (float) (var23 + 8), this.highlightedSelfRowColor.getColorValue()); + } else if (profileHandler.validate(playerName, true) && (Boolean) this.highlightCBRows.getValue()) { + Gui.drawRect((float) var46, (float) var23, (float) (var46 + var27 - 1), (float) (var23 + 8), this.highlightedCBRowColor.getColorValue()); + } else { + Gui.drawRect((float) var46, (float) var23, (float) (var46 + var27 - 1), (float) (var23 + 8), (Boolean) this.pingRowColor.getValue() ? new Color(redT, greenT, blueT, alphaT).getRGB() : this.rowColor.getColorValue()); + } + } + + boolean showIcon = (Boolean) this.showLogo.getValue() && profileHandler.validate(playerName, true); + int toAdd = (showIcon ? playerName.contains(" ") ? 15 : 14 : 0); + if (showIcon) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderUtil.renderIcon(new ResourceLocation("client/logo_white.png"), (float) var46 + 1.0F, (float) var23 + 1.0F, 12.0f, 6.0f); + } + + if ((playerName.contains(this.mc.getSession().getUsername()) || playerName.contains(CheatBreaker.getInstance().getModuleManager().nickHiderMod.customNameString.getStringValue())) && (Boolean) this.highlightSelfNameInTab.getValue()) { + fontRenderer.drawString(stripColor(playerName), toAdd + (float) var46, (float) var23, this.highlightedSelfNameColor.getColorValue(), (Boolean) this.nameTextShadow.getValue()); + } else if (profileHandler.validate(playerName, true) && (Boolean) this.highlightCBPlayersNamesInTab.getValue()) { + fontRenderer.drawString(stripColor(playerName), toAdd + (float) var46, (float) var23, this.highlightedCBNameColor.getColorValue(), (Boolean) this.nameTextShadow.getValue()); + } else { + fontRenderer.drawString(playerName, toAdd + (float) var46, (float) var23, 16777215, (Boolean) this.nameTextShadow.getValue()); + } + + if (var48 != null) { + int var33 = var46 + fontRenderer.getStringWidth(playerName) + 5; + int var34 = var46 + var27 - 12 - 5; + if (var34 - var33 > 5) { + Score var54 = var48.getScoreboard().func_96529_a(var51.name, var48); + String var36 = EnumChatFormatting.YELLOW + "" + var54.getScorePoints(); + fontRenderer.drawStringWithShadow(var36, (float) (var34 - fontRenderer.getStringWidth(var36)), (float) var23, 16777215); + } + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + byte var55; + int pingColor; + if (var51.responseTime < -1) { + var55 = 5; + pingColor = this.lowPingColor.getColorValue(); + } else if (var51.responseTime < 150) { + var55 = 0; + pingColor = this.lowPingColor.getColorValue(); + } else if (var51.responseTime < 300) { + var55 = 1; + pingColor = this.mediumPingColor.getColorValue(); + } else if (var51.responseTime < 600) { + var55 = 2; + pingColor = this.highPingColor.getColorValue(); + } else if (var51.responseTime < 1000) { + var55 = 3; + pingColor = this.extremelyHighPingColor.getColorValue(); + } else { + var55 = 4; + pingColor = -1; + } + if (!(Boolean) this.dynamicPingNumberColor.getValue()) { + pingColor = this.staticPingColor.getColorValue(); + } + if (var51.responseTime != -1 && var51.responseTime != 0 && (Boolean) this.ping.getValue()) { + this.mc.getTextureManager().bindTexture(icons); + if (!(Boolean) this.pingAsNumber.getValue()) { + RenderUtil.drawTexturedModalRect(var46 + var27 - 12, var23, 0, 176 + var55 * 8, 10, 8); + } else { + fontRenderer.drawString(var51.responseTime + "", (float) var46 + var27 - fontRenderer.getStringWidth(var51.responseTime + ""), (float) var23, pingColor, (Boolean) this.pingTextShadow.getValue()); + } + } + } + } + GL11.glDisable(GL11.GL_BLEND); + } + + private String stripColor(String input) { + return input == null ? null : this.STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePotionEffects.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePotionEffects.java new file mode 100644 index 0000000..4e75a46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModulePotionEffects.java @@ -0,0 +1,382 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.*; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; + +import java.util.*; +import java.util.regex.Pattern; + +/** + * Displays the user's active potion effects. + * @see AbstractModule + */ +public class ModulePotionEffects extends AbstractModule { + private final Setting componentOptionsLabel; + private final Setting showIcon; + private final Setting effectName; + private final Setting effectNameText; + private final Setting effectAmplifierText; + private final Setting romanNumerals; + private final Setting showLevelOne; + private final Setting maximumRomanNumeral; + private final Setting duration; + private final Setting compact; + + private final Setting generalOptionsLabel; + private final Setting showWhileTyping; + public Setting potionInfoInInventory; + private final Setting textShadow; + private final Setting effectSpacing; + + private final Setting sortingOptionsLabel; + private final Setting sorting; + private final Setting reverseSorting; + + private final Setting colorOptionsLabel; + private final Setting nameColor; + private final Setting durationColor; + + private final Setting blinkOptionsLabel; + private final Setting effectNameBlink; + private final Setting effectIconBlink; + private final Setting durationBlink; + private final Setting blink; + private final Setting blinkDuration; + private final Setting blinkSpeed; + + private final Setting colorNameBasedOnEffect; + private final Setting colorDurationBasedOnEffect; + private final Setting texturePackOverrideColors; + private final Setting colorType; + + private final Setting excludingOptionsLabel; + private final Setting excludeSetDuration; + private final Setting excludedDuration; + private final Setting excludePerm; + private final Setting excludeSetAmplifier; + private final Setting excludedAmplifier; + private final Setting excludeHelpfulHarmfulEffects; + private final Setting excludeSpecificEffects; + + private final ResourceLocation inventoryBackground = new ResourceLocation("textures/gui/container/inventory.png"); + private int ticks = 0; + public static Map potionColorDefault = new ImmutableMap.Builder().put(1, -11141121).put(2, -10851199) + .put(3, -2506685).put(4, -11910633).put(5, -7134173).put(6, 0xFFF82423).put(7, 0xFF430A09).put(8, -1).put(9, -11199158).put(10, -3318613).put(11, 0xFF53C653).put(12, -1795526) + .put(13, -13741415).put(14, -8420462).put(15, -14737629).put(16, -14737503).put(17, -10979757) + .put(18, -12038840).put(19, -11627727).put(20, -13293017).put(21, 0xFFDE170A).put(22, -14331227).put(23, 0xFFF8C123).build(); + public static Map potionColorPotionColors = new ImmutableMap.Builder().put(1, 0xFF7CAFC6).put(2, -10851199) + .put(3, -2506685).put(4, -11910633).put(5, -7134173).put(6, 0xFFF82423).put(7, 0xFF430A09).put(8, 0xFF786297).put(9, -11199158).put(10, -3318613).put(11, 0xFF99453A).put(12, -1795526) + .put(13, -13741415).put(14, -8420462).put(15, -14737629).put(16, -14737503).put(17, -10979757) + .put(18, -12038840).put(19, -11627727).put(20, -13293017).put(21, 0xFFF87D23).put(22, -14331227).put(23, 0xFFF82423).build(); + public static Map potionColorColorCodes = new ImmutableMap.Builder().put(1, -11141121).put(2, 0xFF555555) + .put(3, 0xFFFFFF55).put(4, 0xFF555555).put(5, 0xFFAA0000).put(6, 0xFFFF5555).put(7, 0xFFAA0000).put(8, -1).put(9, 0xFFAA00AA).put(10, 0xFFFF55FF).put(11, 0xFFAAAAAA).put(12, 0xFFFFAA00) + .put(13, 0xFF5555FF).put(14, 0xFFAAAAAA).put(15, 0xFF000000).put(16, 0xFF0000AA).put(17, 0xFF00AA00) + .put(18, 0xFF555555).put(19, 0xFF55FF55).put(20, 0xFF000000).put(21, 0xFF5555).put(22, 0xFFFFFF55).put(23, 0xFFFFFF55).build(); + public static Map potionColorsVibrant = new ImmutableMap.Builder().put(1, -7405569).put(2, -10528630) + .put(3, -10240).put(4, -9728589).put(5, -5177344).put(6, 0xFFF15251).put(7, 0xFF790907).put(8, -2097153).put(9, -1).put(10, -36483).put(11, -11511440) + .put(12, -24259).put(13, -7229441).put(14, -5592406).put(15, -7975034).put(16, -14263332) + .put(17, -11818424).put(18, -9474163).put(19, -14689758).put(20, -5276243).put(21, 0xFFF83023).put(22, -7866).put(23, 0xFFFFFF99).build(); + + public ModulePotionEffects() { + super("Potion Effects"); + this.setDefaultState(false); + this.setDefaultAnchor(GuiAnchor.LEFT_MIDDLE); + + this.componentOptionsLabel = new Setting(this, "label").setValue("Component Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showIcon = new Setting(this, "Icon").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.effectName = new Setting(this, "Effect Name").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.effectNameText = new Setting(this, "Effect Name Text").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.effectName::getBooleanValue); + this.effectAmplifierText = new Setting(this, "Effect Amplifier Text").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.effectName::getBooleanValue); + this.romanNumerals = new Setting(this, "Show Roman Numerals").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.effectName.getBooleanValue() && this.effectAmplifierText.getBooleanValue()); + this.showLevelOne = new Setting(this, "Show Level 1").setValue(false).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> this.effectName.getBooleanValue() && this.effectAmplifierText.getBooleanValue()); + this.maximumRomanNumeral = new Setting(this, "Max Roman Numeral").setValue(10).setMinMax(1, 255).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> this.effectName.getBooleanValue() && this.effectAmplifierText.getBooleanValue() && this.romanNumerals.getBooleanValue()); + this.duration = new Setting(this, "Duration").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.compact = new Setting(this, "Compact").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showWhileTyping = new Setting(this, "Show While Typing").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.potionInfoInInventory = new Setting(this, "Show Potion info in inventory").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadow = new Setting(this, "Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.effectName.getBooleanValue() || this.duration.getBooleanValue()); + this.effectSpacing = new Setting(this, "Effect Spacing").setValue(4.0F).setMinMax(0.0F, 15.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.sortingOptionsLabel = new Setting(this, "label").setValue("Sorting Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.sorting = new Setting(this, "Sorting Method").setValue("Vanilla").acceptedStringValues("Vanilla", "Alphabetical", "Duration", "Amplifier").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.reverseSorting = new Setting(this, "Reverse Sorting").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.blinkOptionsLabel = new Setting(this, "label").setValue("Blink Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.blink = new Setting(this, "Blink").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.effectNameBlink = new Setting(this, "Make Effect Name Text Blink").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.blink.getBooleanValue() && this.effectName.getBooleanValue()); + this.effectIconBlink = new Setting(this, "Make Effect Icon Blink").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.blink.getBooleanValue() && this.showIcon.getBooleanValue()); + this.durationBlink = new Setting(this, "Make Duration Text Blink").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.blink.getBooleanValue() && this.duration.getBooleanValue()); + this.blinkDuration = new Setting(this, "Blink Duration").setValue(10.0F).setMinMax(2.0F, 60.0F).setUnit("s").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.blink::getBooleanValue); + this.blinkSpeed = new Setting(this, "Blink Speed").setValue(1.0f).setMinMax(0.2f, 3.5f).setUnit("s").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.blink::getBooleanValue); + + this.excludingOptionsLabel = new Setting(this, "label").setValue("Excluding Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludePerm = new Setting(this, "Exclude Permanent Effects").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludeSetDuration = new Setting(this, "Exclude Set Duration", "Exclude all active effects above a set duration.").setValue("OFF").acceptedStringValues(this.excludeOptions).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludedDuration = new Setting(this, "Excluded Duration", "The duration effects are excluded").setValue(30.0F).setMinMax(2.0F, 90.0F).setUnit("s").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.excludeSetDuration.getValue().equals("OFF")); + this.excludeSetAmplifier = new Setting(this, "Exclude Set Amplifier", "Exclude all active effects below a set amplifier.").setValue("OFF").acceptedStringValues(this.excludeOptions).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludedAmplifier = new Setting(this, "Excluded Amplifier", "The duration effects are excluded").setValue(10).setMinMax(0, 20).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.excludeSetAmplifier.getValue().equals("OFF")); + this.excludeHelpfulHarmfulEffects = new Setting(this, "Exclude Helpful/Harmful Effects").setValue("OFF").acceptedStringValues("OFF", "Only Helpful", "Only Harmful").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.excludeSpecificEffects = new Setting(this, "Exclude Specific Effects").setValue(new ArrayList<>()).acceptedValues(new Integer[]{Potion.moveSpeed.id, Potion.moveSlowdown.id, Potion.digSpeed.id, Potion.digSlowdown.id, Potion.damageBoost.id, Potion.jump.id, Potion.confusion.id, Potion.regeneration.id, Potion.resistance.id, Potion.fireResistance.id, Potion.waterBreathing.id, Potion.invisibility.id, Potion.blindness.id, Potion.nightVision.id, Potion.hunger.id, Potion.weakness.id, Potion.poison.id, Potion.wither.id, Potion.field_76444_x.id}).setCustomizationLevel(CustomizationLevel.MEDIUM); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.effectName.getBooleanValue() || this.duration.getBooleanValue()); + this.texturePackOverrideColors = new Setting(this, "Override Name Color With Pack Format").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.effectName.getBooleanValue() && this.effectNameText.getBooleanValue()); + this.colorNameBasedOnEffect = new Setting(this, "Color Name Based On").setValue("Static").acceptedStringValues("Static", "Effect", "Duration").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.effectName::getBooleanValue); + this.colorDurationBasedOnEffect = new Setting(this, "Color Duration Based On").setValue("Static").acceptedStringValues("Static", "Effect", "Duration").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.duration::getBooleanValue); + this.colorType = new Setting(this, "Color Type").setValue("Default").acceptedStringValues("Default", "Potion Colors", "Color Codes", "Good/Bad", "Vibrant").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.colorDurationBasedOnEffect.getValue().equals("Effect") || this.colorNameBasedOnEffect.getValue().equals("Effect")); + this.nameColor = new Setting(this, "Name Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.effectName.getBooleanValue() && this.colorNameBasedOnEffect.getValue().equals("Static")); + this.durationColor = new Setting(this, "Duration Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.duration.getBooleanValue() && this.colorDurationBasedOnEffect.getValue().equals("Static")); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/speed_icon.png"), 28, 28); + this.setDescription("Displays your active potion effects."); + this.setCreators("bspkrs", "jadedcat"); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + private void onTick(TickEvent event) { + ++this.ticks; + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + GL11.glPushMatrix(); + List potionEffects = new ArrayList<>(); + if (this.mc.thePlayer != null) { + potionEffects.addAll(this.mc.thePlayer.getActivePotionEffects()); + } + if (potionEffects.isEmpty()) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + potionEffects.add(new PotionEffect(Potion.moveSpeed.id, 1200, 3)); + potionEffects.add(new PotionEffect(Potion.damageBoost.id, 30, 3)); + info(potionEffects); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + if (this.showWhileTyping.getBooleanValue() || !this.mc.ingameGUI.getChatGUI().getChatOpen()) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + List potionEffects = new ArrayList<>(); + if (this.mc.thePlayer != null) { + potionEffects.addAll(this.mc.thePlayer.getActivePotionEffects()); + } + if (potionEffects.isEmpty()) { + GL11.glPopMatrix(); + GL11.glPopMatrix(); + return; + } + info(potionEffects); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + private void info(List effects) { + GL11.glEnable(GL11.GL_BLEND); + Position cBPositionEnum = this.getPosition(); + int height = 0; + int width = 0; + float potionSpacing = this.effectSpacing.getFloatValue(); + float spacing = potionSpacing + (this.showIcon.getBooleanValue() || this.effectName.getBooleanValue() && this.duration.getBooleanValue() ? 18.0f : this.mc.fontRenderer.FONT_HEIGHT - 1); + float iconPos = this.showIcon.getBooleanValue() ? 20.0F : 0.0F; + int spaceCharWidth = this.mc.fontRenderer.getStringWidth(" "); + this.sortEffects(effects); + + for (PotionEffect potionEffect : effects) { + if (!excludePotions(potionEffect) || this.mc.currentScreen instanceof HudLayoutEditorGui || this.mc.currentScreen instanceof ModulePlaceGui || this.mc.currentScreen instanceof ProfileCreatorGui) { + Potion potion; + String string; + boolean showingDuringBlink = this.showEffectDuringBlink(potionEffect.getDuration()); + boolean packOverride = this.texturePackOverrideColors.getBooleanValue(); + int effectWidth = 0; + int effectY = this.duration.getBooleanValue() && !this.compact.getBooleanValue() ? 0 : this.showIcon.getBooleanValue() || this.compact.getBooleanValue() ? 5 : 0; + String effectName = (this.effectNameText.getBooleanValue() ? StatCollector.translateToLocal(potionEffect.getEffectName()) : "") + (this.effectAmplifierText.getBooleanValue() ? this.amplifierNumerals(potionEffect.getAmplifier()) : ""); + if (this.effectName.getBooleanValue() && (showingDuringBlink || !this.effectNameBlink.getBooleanValue())) { + effectWidth = this.mc.fontRenderer.getStringWidth(effectName) + (int) iconPos; + int potionColor = potionColor(this.nameColor.getColorValue(), this.colorNameBasedOnEffect.getValue(), potionEffect); + if (cBPositionEnum == Position.RIGHT) { + this.mc.fontRenderer.drawString((packOverride ? effectName : stripColor(effectName)) + "§r", this.getWidth() - (float) effectWidth, (float) height + effectY, potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.LEFT) { + this.mc.fontRenderer.drawString((packOverride ? effectName : stripColor(effectName)) + "§r", iconPos, (float) height + effectY, potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.CENTER) { + this.mc.fontRenderer.drawString((packOverride ? effectName : stripColor(effectName)) + "§r", this.getWidth() / 2.0f - (float) (effectWidth / 2) + (this.compact.getBooleanValue() ? iconPos / 2 - 2.0F : iconPos), (float) height + effectY, potionColor, this.textShadow.getBooleanValue()); + } + if (effectWidth > width) { + width = effectWidth; + } + } + string = Potion.getDurationString(potionEffect); + int durationWidth = this.duration.getBooleanValue() ? this.mc.fontRenderer.getStringWidth(string) + (int)iconPos : 18; + int durationY = (this.effectName.getBooleanValue() && !effectName.isEmpty()) && !this.compact.getBooleanValue() ? 10 : this.showIcon.getBooleanValue() || this.compact.getBooleanValue() ? 5 : 0; + boolean compactReq = this.compact.getBooleanValue() && this.effectName.getBooleanValue() && (this.effectNameText.getBooleanValue() || this.effectAmplifierText.getBooleanValue()) && !effectName.isEmpty(); + if (this.duration.getBooleanValue() && (showingDuringBlink || !this.durationBlink.getBooleanValue())) { + int potionColor = potionColor(this.durationColor.getColorValue(), this.colorDurationBasedOnEffect.getValue(), potionEffect); + if (cBPositionEnum == Position.RIGHT) { + this.mc.fontRenderer.drawString(string + "§r", this.getWidth() - (float) durationWidth - (compactReq ? effectWidth - iconPos + spaceCharWidth : 0.0f), (float) (height + durationY), potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.LEFT) { + this.mc.fontRenderer.drawString(string + "§r", compactReq ? effectWidth + spaceCharWidth : iconPos, (float) (height + durationY), potionColor, this.textShadow.getBooleanValue()); + } else if (cBPositionEnum == Position.CENTER) { + this.mc.fontRenderer.drawString(string + "§r", this.getWidth() / 2.0f + (compactReq ? effectWidth / 2 + 2.0F - (iconPos / 2) : - (float) (durationWidth / 2) + iconPos), (float) (height + durationY), potionColor, this.textShadow.getBooleanValue()); + } + } + if ((potion = Potion.potionTypes[potionEffect.getPotionID()]).hasStatusIcon() && this.showIcon.getBooleanValue() && (showingDuringBlink || !this.effectIconBlink.getBooleanValue())) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, excludePotions(potionEffect) ? 0.5F : 1.0F); + this.mc.getTextureManager().bindTexture(this.inventoryBackground); + int index = potion.getStatusIconIndex(); + if (cBPositionEnum == Position.LEFT || !this.effectName.getBooleanValue() && !this.duration.getBooleanValue()) { + RenderUtil.drawTexturedModalRect(0.0f, (float) height, (float) (index % 8 * 18), (float) (198 + index / 8 * 18), 18, 18); + } else if (cBPositionEnum == Position.RIGHT) { + RenderUtil.drawTexturedModalRect(this.getWidth() - (float) 20, (float) height, (float) (index % 8 * 18), (float) (198 + index / 8 * 18), 18, 18); + } else if (cBPositionEnum == Position.CENTER) { + RenderUtil.drawTexturedModalRect(this.getWidth() / 2.0f - (float) ((this.effectName.getBooleanValue() ? effectWidth : durationWidth)/ 2) - (compactReq ? iconPos / 2 + 2.0F : 0.0F), (float) height, (float) (index % 8 * 18), (float) (198 + index / 8 * 18), 18, 18); + } + } + if (durationWidth > width) { + width = durationWidth; + } + if ((durationWidth / 2 + effectWidth) + spaceCharWidth > width && this.compact.getBooleanValue()) { + width = (durationWidth / 2 + effectWidth) + spaceCharWidth; + } + height += spacing; + } + } + this.setDimensions(width, height - potionSpacing); + GL11.glDisable(GL11.GL_BLEND); + } + + private boolean showEffectDuringBlink(float duration) { + float blinkSpeed = this.blinkSpeed.getFloatValue() * 10; + if (this.blink.getBooleanValue() && duration <= this.blinkDuration.getFloatValue() * 20.0F) { + if (this.ticks > blinkSpeed * 2) { + this.ticks = 0; + } + return this.ticks <= blinkSpeed; + } + return true; + } + + private int potionColor(int staticColor, Object option, PotionEffect effect) { + int time = effect.getDuration(); + int value; + switch ((String) option) { + case "Effect": + Potion var9 = Potion.potionTypes[effect.getPotionID()]; + switch (this.colorType.getStringValue()) { + case "Default": + value = potionColorDefault.get(effect.getPotionID()); + break; + case "Potion Colors": + value = potionColorPotionColors.get(effect.getPotionID()); + break; + case "Color Codes": + value = potionColorColorCodes.get(effect.getPotionID()); + break; + case "Vibrant": + value = potionColorsVibrant.get(effect.getPotionID()); + break; + default: + if (!var9.isBadEffect()) { + value = -15691760; + } else { + value = -7335920; + } + } + break; + case "Duration": + if (time >= 1200) { + value = -16733696; + } else if (time >= 600) { + value = -11141291; + } else if (time >= 200) { + value = -171; + } else { + value = time >= 100 ? -43691 : -5636096; + } + break; + default: + value = staticColor; + } + int opacity = value >> 24 & 0xFF; + opacity = (int)((float)opacity * (excludePotions(effect) ? 0.5F : 1.0F)); + return value & 0xFFFFFF | opacity << 24; + } + + private void sortEffects(List effects) { + switch (this.sorting.getStringValue()) { + case "Alphabetical": + effects.sort(Comparator.comparing(effect -> I18n.format(effect.getEffectName()))); + break; + case "Duration": + effects.sort(Comparator.comparingInt(PotionEffect::getDuration)); + break; + case "Amplifier": + effects.sort(Comparator.comparingInt(PotionEffect::getAmplifier)); + Collections.reverse(effects); + } + if (this.reverseSorting.getBooleanValue()) { + Collections.reverse(effects); + } + } + + private boolean excludePotions(PotionEffect effect) { + if (this.excludeArrayOptions(this.excludeSetDuration, effect.getDuration(), this.excludedDuration.getFloatValue() * 20.0F) && !effect.getIsPotionDurationMax()) { + return true; + } else if (this.excludePerm.getBooleanValue() && effect.getIsPotionDurationMax()) { + return true; + } else if (this.excludeArrayOptions(this.excludeSetAmplifier, effect.getAmplifier(), this.excludedAmplifier.getIntegerValue() - 1)) { + return true; + } else if (this.excludeHelpfulHarmfulEffects.getValue().equals("Only Helpful") && !Potion.potionTypes[effect.getPotionID()].isBadEffect()) { + return true; + } else if (this.excludeHelpfulHarmfulEffects.getValue().equals("Only Harmful") && Potion.potionTypes[effect.getPotionID()].isBadEffect()) { + return true; + } else { + return this.excludeSpecificEffects.getArrayListValue().contains(effect.getPotionID()); + } + } + + private String amplifierNumerals(int level) { + String s = this.effectNameText.getBooleanValue() ? " " : ""; + if (level < 0) { + level = 127 + Math.abs(128 + level); + } + int l = level + 1; + int minLevel = this.showLevelOne.getBooleanValue() ? 0 : 1; + if (this.romanNumerals.getBooleanValue() && level >= minLevel && level <= this.maximumRomanNumeral.getIntegerValue()) { + return s + String.join("", Collections.nCopies(l, "I")) + .replace("IIIII", "V").replace("IIII", "IV").replace("VV", "X") + .replace("VIV", "IX").replace("XXXXX", "L").replace("XXXX", "XL") + .replace("LL", "C").replace("LXL", "XC").replace("CCCCC", "D") + .replace("CCCC", "CD").replace("DD", "M").replace("DCD", "CM"); + } else { + return level >= minLevel ? s + l : ""; + } + } + + private String stripColor(String input) { + return input == null ? null : Pattern.compile("(?i)" + '§' + "[0-9A-F]").matcher(input).replaceAll("§r"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleScoreboard.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleScoreboard.java new file mode 100644 index 0000000..2f9d81c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/ModuleScoreboard.java @@ -0,0 +1,180 @@ +package com.cheatbreaker.client.module.impl.normal.hud; + +import com.cheatbreaker.client.event.impl.GuiDrawBypassDebugEvent; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.KeyboardEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.MiniMapRules; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.scoreboard.*; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +import java.util.Collection; +import java.util.regex.Pattern; + +/** + * Allows the user to move and customize the Minecraft scoreboard. + */ +public class ModuleScoreboard extends AbstractModule { + + public Setting background; + public Setting backgroundWidthPadding; + public Setting border; + public Setting borderThickness; + + public Setting removeNumbers; + public Setting shadow; + + public Setting customTextColor; + public Setting textColor; + public Setting numbersColor; + public Setting topBackgroundColor; + public Setting backgroundColor; + public Setting borderColor; + + public static MiniMapRules minimapRule = MiniMapRules.NEUTRAL; + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + + public ModuleScoreboard() { + super("Scoreboard"); + this.setDefaultAnchor(GuiAnchor.RIGHT_MIDDLE); + new Setting(this, "label").setValue("Background Options"); + this.background = new Setting(this, "Show Background").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.backgroundWidthPadding = new Setting(this, "Background Width Padding").setValue(4.0F).setMinMax(0.0F, 10.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.border = new Setting(this, "Show Border").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.borderThickness = new Setting(this, "Border Thickness").setValue(1.0F).setMinMax(0.25F, 3.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.border.getValue() && (Boolean) this.background.getValue()); + + new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.removeNumbers = new Setting(this, "Remove Scoreboard numbers").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.shadow = new Setting(this, "Text Shadow").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.customTextColor = new Setting(this, "Strip Formatting Colors").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.customTextColor.getValue()); + this.numbersColor = new Setting(this, "Scoreboard Numbers Color").setValue(0xFFFF5555).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !(Boolean) this.removeNumbers.getValue()); + this.topBackgroundColor = new Setting(this, "Top Background Color").setValue(0x60000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x50000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.background.getValue()); + this.borderColor = new Setting(this, "Border Color").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.border.getValue()); + + this.setDescription("Move and customize the Minecraft scoreboard to your liking."); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawBypassDebugEvent.class, this::onGuiDraw); + this.setDefaultState(true); + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + if (this.mc.theWorld.getScoreboard().func_96539_a(1) != null) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + GL11.glTranslatef(this.removeNumbers() ? (float)-12 : 2.0f, this.height, 0.0f); + Scoreboard scoreboard = new Scoreboard(); + ScoreObjective scoreObjective = new ScoreObjective(scoreboard, "CheatBreaker", IScoreObjectiveCriteria.field_96641_b); + scoreObjective.setDisplayName(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "Cheat" + EnumChatFormatting.WHITE + "" + EnumChatFormatting.BOLD + "Breaker"); + scoreboard.func_96529_a("Steve", scoreObjective); + scoreboard.func_96529_a("Alex", scoreObjective); + this.renderObjective(scoreObjective, event.getScaledResolution().getScaledHeight(), event.getScaledResolution().getScaledWidth(), this.mc.fontRenderer, (Float) this.masterScale()); + GL11.glPopMatrix(); + } + + private void onGuiDraw(GuiDrawBypassDebugEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + GL11.glTranslatef(this.removeNumbers() ? (float)-12 : 2.0f, this.height, 0.0f); + ScoreObjective scoreObjective = this.mc.theWorld.getScoreboard().func_96539_a(1); + if (scoreObjective != null) { + this.renderObjective(scoreObjective, event.getScaledResolution().getScaledHeight(), + event.getScaledResolution().getScaledWidth(), this.mc.fontRenderer, (Float) this.masterScale()); + } + GL11.glPopMatrix(); + } + + private void renderObjective(ScoreObjective scoreObjective, int n, int n2, FontRenderer fontRenderer, float f) { + GL11.glEnable(GL11.GL_BLEND); + net.minecraft.scoreboard.Scoreboard scoreboard = scoreObjective.getScoreboard(); + Collection collection = scoreboard.func_96534_i(scoreObjective); + boolean removeNumbers = this.removeNumbers(); + boolean isCustomTextColorEnabled = (Boolean)customTextColor.getValue(); + if (collection.size() <= 15) { + int n3 = fontRenderer.getStringWidth(scoreObjective.getDisplayName()); + int n4 = n3 + 16; + for (Score score : collection) { + ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(score.getPlayerName()); + String string = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, score.getPlayerName()) + ": " + EnumChatFormatting.RED + score.getScorePoints(); + n3 = Math.max(n3, fontRenderer.getStringWidth(string)); + } + int n5 = 0; + int n6 = 3; + int n7 = 0; + int n8 = 0; + float n9 = 0; + float width = this.removeNumbers() ? - 4 + ((float) backgroundWidthPadding.getValue()) : 0.0f; + + for (Score score : collection) { + ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(score.getPlayerName()); + String string = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, score.getPlayerName()); + String string2 = "" + score.getScorePoints(); + int n10 = n5 - ++n8 * fontRenderer.FONT_HEIGHT; + int n11 = n3 + n6 + 6; + if (n11 < n4) { + n11 = n4; + } + if ((Boolean) background.getValue()) { + Gui.drawRect(n7 - 2 + (removeNumbers ? 14 : 0), n10, n11 + width, n10 + fontRenderer.FONT_HEIGHT, backgroundColor.getColorValue()); + } + n9 = n11 - (n7 - 2 + (removeNumbers ? 18 - ((float) backgroundWidthPadding.getValue()) : 0)); + GL11.glEnable(GL11.GL_BLEND); + fontRenderer.drawString(isCustomTextColorEnabled ? stripColor(string) : string, n7 + (removeNumbers ? 14 + (float) backgroundWidthPadding.getValue() / 2 : 0), n10, isCustomTextColorEnabled ? textColor.getColorValue() : -1, (Boolean) shadow.getValue()); + if (!removeNumbers) { + fontRenderer.drawString(string2, n11 - fontRenderer.getStringWidth(string2) - 2, n10, numbersColor.getColorValue(), (Boolean) shadow.getValue()); + } + if (n8 != collection.size()) continue; + String string3 = scoreObjective.getDisplayName(); + if ((Boolean) background.getValue()) { + Gui.drawRect(n7 - 2 + (removeNumbers ? 14 : 0), n10 - fontRenderer.FONT_HEIGHT - 1, n11 + width, n10 - 1, topBackgroundColor.getColorValue()); + Gui.drawRect(n7 - 2 + (removeNumbers ? 14 : 0), n10 - 1, n11 + width, n10, backgroundColor.getColorValue()); + } + fontRenderer.drawString(isCustomTextColorEnabled ? stripColor(string3) : string3, n7 + n3 / 2 - fontRenderer.getStringWidth(string3) / 2 + (removeNumbers ? 12 + (float) backgroundWidthPadding.getValue() / 2 : 0), n10 - fontRenderer.FONT_HEIGHT, isCustomTextColorEnabled ? textColor.getColorValue() : -1, (Boolean) shadow.getValue()); + GL11.glDisable(GL11.GL_BLEND); + } + int var23 = n3 + n6 + 6; + if (var23 < n4) { + var23 = n4; + } + if ((Boolean) border.getValue()) { + float bT = (Float)borderThickness.getValue(); + Gui.drawOutline((float)(n7 - 2 + (removeNumbers ? 14 : 0)) - bT, -(collection.size() * fontRenderer.FONT_HEIGHT + 10) - bT, var23 + bT + width, 0.0F + bT, bT, borderColor.getColorValue()); + } + this.setDimensions(n9, collection.size() * fontRenderer.FONT_HEIGHT + 10); + } + } + + /** + * @return True if Minimap Rule is set to Neutral and if the remove numbers option is set to true or if Minimap rule is set to Forced Off. + */ + private boolean removeNumbers() { + return minimapRule == MiniMapRules.NEUTRAL ? (Boolean)this.removeNumbers.getValue() : minimapRule == MiniMapRules.FORCED_OFF; + } + + /** + * Replaces all non-neutral color codes with §r + * @param input String input + */ + private String stripColor(String input) { + return input == null ? null : STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusDamageComparable.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusDamageComparable.java new file mode 100644 index 0000000..cf77b8c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusDamageComparable.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.module.impl.normal.hud.armorstatus; + +import java.util.List; + +public class ArmorStatusDamageComparable implements Comparable { + public int percent; + public String colorCode; + + public ArmorStatusDamageComparable(int percent, String colorCode) { + this.percent = percent; + this.colorCode = colorCode; + } + + public String toString() { + return this.percent + ", " + this.colorCode; + } + + public int compare(ArmorStatusDamageComparable damageComparable) { + return Integer.compare(this.percent, damageComparable.percent); + } + + public static String getDamageColor(List durability, int n) { + for (ArmorStatusDamageComparable armorStatusDamageComparable : durability) { + if (n > armorStatusDamageComparable.percent) continue; + return armorStatusDamageComparable.colorCode; + } + return "f"; + } + + public int compareTo(Object object) { + return this.compare((ArmorStatusDamageComparable)object); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusItem.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusItem.java new file mode 100644 index 0000000..85b2137 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ArmorStatusItem.java @@ -0,0 +1,106 @@ +package com.cheatbreaker.client.module.impl.normal.hud.armorstatus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.module.AnchorHelper; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.Position; +import com.cheatbreaker.client.ui.util.HudUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.ItemStack; +import org.lwjgl.opengl.GL11; + +public class ArmorStatusItem { + public final ItemStack item; + public final int iconW; + public final int iconH; + public final int padW; + private int itemWidth; + private int itemHeight; + private String displayText = ""; + private int displayTextWidth; + private String text = ""; + private int textWidth; + private final boolean isArmor; + private final Minecraft mc = Minecraft.getMinecraft(); + + public ArmorStatusItem(ItemStack itemStack, int iconW, int iconH, int padW, boolean isArmor) { + this.item = itemStack; + this.iconW = iconW; + this.iconH = iconH; + this.padW = padW; + this.isArmor = isArmor; + this.initSize(); + } + + public int width() { + return this.itemWidth; + } + + public int height() { + return this.itemHeight; + } + + private void initSize() { + int n = this.itemHeight = (Boolean) ModuleArmorStatus.itemName.getValue() ? + Math.max(Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT * 2, this.iconH) : + Math.max(this.mc.fontRenderer.FONT_HEIGHT, this.iconH); + if (this.item != null) { + int n2 = 1; + int n3 = 1; + boolean damageAmount = ModuleArmorStatus.damageAmount.getValue().equals("ON") ? this.item.isItemStackDamageable() : this.item.isItemDamaged(); + if ((this.isArmor && (Boolean) ModuleArmorStatus.armorDamage.getValue() || !this.isArmor && (Boolean) ModuleArmorStatus.itemDamage.getValue()) && damageAmount) { + n3 = this.item.getMaxDamage() + 1; + n2 = n3 - this.item.getItemDamageForDisplay(); + if (((String) ModuleArmorStatus.damageDisplayType.getValue()).equalsIgnoreCase("value")) { + this.text = "§" + ArmorStatusDamageComparable.getDamageColor(ModuleArmorStatus.damageColors, ((String) ModuleArmorStatus.damageThreshold.getValue()).equalsIgnoreCase("percent") ? n2 * 100 / n3 : n2) + n2 + ((Boolean) ModuleArmorStatus.maxDamage.getValue() ? "/" + n3 : ""); + } else if (((String) ModuleArmorStatus.damageDisplayType.getValue()).equalsIgnoreCase("percent")) { + this.text = "§" + ArmorStatusDamageComparable.getDamageColor(ModuleArmorStatus.damageColors, ((String) ModuleArmorStatus.damageThreshold.getValue()).equalsIgnoreCase("percent") ? n2 * 100 / n3 : n2) + n2 * 100 / n3 + "%"; + } + } + this.textWidth = this.mc.fontRenderer.getStringWidth(HudUtil.getColorCode(this.text)); + this.itemWidth = this.padW + this.iconW + + this.padW + this.textWidth; + if ((Boolean) ModuleArmorStatus.itemName.getValue()) { + this.displayText = this.item.getDisplayName(); + this.itemWidth = this.padW + + this.iconW + this.padW + + Math.max(this.mc.fontRenderer.getStringWidth(HudUtil.getColorCode(this.displayText)), this.textWidth); + } + this.displayTextWidth = this.mc.fontRenderer.getStringWidth(HudUtil.getColorCode(this.displayText)); + } + } + + public void renderTo(float f, float f2) { + boolean bl; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + ModuleArmorStatus.renderItem.zLevel = -10; + GuiAnchor cBGuiAnchor = CheatBreaker.getInstance().getModuleManager().armourStatus.getGuiAnchor(); + boolean bl2 = bl = AnchorHelper.getHorizontalPositionEnum(cBGuiAnchor) == Position.RIGHT; + if (bl) { + ModuleArmorStatus.renderItem.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), this.item, + (int)(f - (float) (this.iconW + this.padW)), (int)f2); + HudUtil.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.item, (int)(f - (float)(this.iconW + + this.padW)), (int)f2, (Boolean) ModuleArmorStatus.damageOverlay.getValue(), + (Boolean) ModuleArmorStatus.itemCount.getValue()); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GL11.glDisable(3042); + this.mc.fontRenderer.drawStringWithShadow(this.displayText + "§r", f - (float)(this.padW + this.iconW + this.padW) - (float)this.displayTextWidth, f2, 0xFFFFFF); + this.mc.fontRenderer.drawStringWithShadow(this.text + "§r", f - (float)(this.padW + this.iconW + this.padW) - (float)this.textWidth, f2 + (float)((Boolean) ModuleArmorStatus.itemName.getValue() ? this.itemHeight / 2 : this.itemHeight / 4), 0xFFFFFF); + } else { + ModuleArmorStatus.renderItem.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), this.item, (int)f, (int)f2); + HudUtil.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.item, (int)f, (int)f2, + (Boolean) ModuleArmorStatus.damageOverlay.getValue(), (Boolean) ModuleArmorStatus.itemCount.getValue()); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GL11.glDisable(3042); + this.mc.fontRenderer.drawStringWithShadow(this.displayText + "§r", f + (float)this.iconW + (float)this.padW, f2, 0xFFFFFF); + this.mc.fontRenderer.drawStringWithShadow(this.text + "§r", f + (float)this.iconW + (float)this.padW, f2 + (float)((Boolean) ModuleArmorStatus.itemName.getValue() ? this.itemHeight / 2 : this.itemHeight / 4), 0xFFFFFF); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ModuleArmorStatus.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ModuleArmorStatus.java new file mode 100644 index 0000000..ee6cca9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/armorstatus/ModuleArmorStatus.java @@ -0,0 +1,178 @@ +package com.cheatbreaker.client.module.impl.normal.hud.armorstatus; + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +/** + * Displays the user's current armor and holding item durability. + * @see AbstractModule + */ +public class ModuleArmorStatus extends AbstractModule { + private final Setting generalOptionsLabel; + public static Setting listMode; + public static Setting itemName; + public static Setting itemCount; + public static Setting showWhileTying; + public static Setting equippedItem; + private final Setting damageOptionsLabel; + public static Setting damageOverlay; + public static Setting damageAmount; + public static Setting itemDamage; + public static Setting armorDamage; + public static Setting maxDamage; + private final Setting damageDisplay; + public static Setting damageDisplayType; + public static Setting damageThreshold; + public static RenderItem renderItem = new RenderItem(); + public static final List damageColors = new ArrayList<>(); + private static final List items = new ArrayList<>(); + private static ScaledResolution scaledRes; + + public ModuleArmorStatus() { + super("Armor Status"); + this.setDefaultAnchor(GuiAnchor.RIGHT_BOTTOM); + this.setDefaultState(false); + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + listMode = new Setting(this, "List Mode").setValue("vertical").acceptedStringValues("vertical", "horizontal").setCustomizationLevel(CustomizationLevel.SIMPLE); + itemName = new Setting(this, "Item Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + itemCount = new Setting(this, "Item Count").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) equippedItem.getValue()); + equippedItem = new Setting(this, "Equipped Item").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + showWhileTying = new Setting(this, "Show While Typing").setValue(false).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.damageOptionsLabel = new Setting(this, "label").setValue("Damage Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + damageOverlay = new Setting(this, "Damage Overlay").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + damageAmount = new Setting(this, "Show Damage Amount").setValue("ON").acceptedStringValues("ON", "If Damaged").setCustomizationLevel(CustomizationLevel.SIMPLE); + itemDamage = new Setting(this, "Show Item Damage").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) equippedItem.getValue()); + armorDamage = new Setting(this, "Show Armor Damage").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + maxDamage = new Setting(this, "Show Max Damage").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) itemDamage.getValue() || (Boolean) armorDamage.getValue()); + this.damageDisplay = new Setting(this, "label").setValue("Damage Display").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> ((Boolean) equippedItem.getValue() && (Boolean) itemDamage.getValue()) || (Boolean) armorDamage.getValue()); + damageDisplayType = new Setting(this, "Damage Display Type").setValue("value").acceptedStringValues("value", "percent", "none").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> ((Boolean) equippedItem.getValue() && (Boolean) itemDamage.getValue()) || (Boolean) armorDamage.getValue()); + damageThreshold = new Setting(this, "Damage Threshold Type").setValue("percent").acceptedStringValues("percent", "value").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> ((Boolean) equippedItem.getValue() && (Boolean) itemDamage.getValue()) || (Boolean) armorDamage.getValue()); + damageColors.add(new ArmorStatusDamageComparable(10, "4")); + damageColors.add(new ArmorStatusDamageComparable(25, "c")); + damageColors.add(new ArmorStatusDamageComparable(40, "6")); + damageColors.add(new ArmorStatusDamageComparable(60, "e")); + damageColors.add(new ArmorStatusDamageComparable(80, "7")); + damageColors.add(new ArmorStatusDamageComparable(100, "f")); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/diamond_chestplate.png"), 34, 34); + this.setDescription("Displays your current armor and holding item durability."); + this.setCreators("bspkrs", "jadedcat"); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + ArrayList arrayList = new ArrayList(); + for (int i = 3; i >= 0; --i) { + ItemStack itemStack = this.mc.thePlayer.inventory.armorInventory[i]; + if (itemStack == null) continue; + arrayList.add(new ArmorStatusItem(itemStack, 16, 16, 2, i > -1)); + } + if (arrayList.isEmpty()) { + arrayList.add(new ArmorStatusItem(new ItemStack(Item.getItemById(310)), 16, 16, 2, true)); + arrayList.add(new ArmorStatusItem(new ItemStack(Item.getItemById(311)), 16, 16, 2, true)); + arrayList.add(new ArmorStatusItem(new ItemStack(Item.getItemById(312)), 16, 16, 2, true)); + arrayList.add(new ArmorStatusItem(new ItemStack(Item.getItemById(313)), 16, 16, 2, true)); + } + if ((Boolean) equippedItem.getValue() && this.mc.thePlayer.getCurrentEquippedItem() != null) { + arrayList.add(new ArmorStatusItem(this.mc.thePlayer.getCurrentEquippedItem(), 16, 16, 2, false)); + } else if ((Boolean) equippedItem.getValue()) { + arrayList.add(new ArmorStatusItem(new ItemStack(Item.getItemById(276)), 16, 16, 2, false)); + } + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + scaledRes = event.getScaledResolution(); + this.scaleAndTranslate(scaledRes); + this.render(this.mc, arrayList); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glPopMatrix(); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + if (!(this.mc.currentScreen instanceof HudLayoutEditorGui || this.mc.currentScreen instanceof ModulePlaceGui || this.mc.currentScreen instanceof GuiChat && !(Boolean) showWhileTying.getValue())) { + this.updateItems(this.mc); + if (!items.isEmpty()) { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + scaledRes = event.getScaledResolution(); + this.scaleAndTranslate(scaledRes); + this.render(this.mc, items); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + } + + private void updateItems(Minecraft mc) { + items.clear(); + for (int i = 3; i >= -1; --i) { + ItemStack itemStack = null; + if (i == -1 && (Boolean) equippedItem.getValue()) { + itemStack = mc.thePlayer.getCurrentEquippedItem(); + } else if (i != -1) { + itemStack = mc.thePlayer.inventory.armorInventory[i]; + } + if (itemStack == null) continue; + items.add(new ArmorStatusItem(itemStack, 16, 16, 2, i > -1)); + } + } + + private void render(Minecraft mc, List list) { + if (list.size() > 0) { + int n = (Boolean) itemName.getValue() ? 18 : 16; + if (((String) listMode.getValue()).equalsIgnoreCase("vertical")) { + int n3 = 0; + int n4 = 0; + boolean bl = AnchorHelper.getHorizontalPositionEnum(this.getGuiAnchor()) == Position.RIGHT; + for (ArmorStatusItem armorStatusItem : list) { + armorStatusItem.renderTo(bl ? this.width : 0.0f, n3); + n3 += n; + if (armorStatusItem.width() <= n4) continue; + n4 = armorStatusItem.width(); + } + this.height = n3; + this.width = n4; + } else if (((String) listMode.getValue()).equalsIgnoreCase("horizontal")) { + boolean bl = false; + int width = 0; + int height = 0; + boolean bl2 = AnchorHelper.getHorizontalPositionEnum(this.getGuiAnchor()) == Position.RIGHT; + for (ArmorStatusItem armorStatusItem : list) { + if (bl2) { + width += armorStatusItem.width(); + } + armorStatusItem.renderTo(width, 0.0f); + if (!bl2) { + width += armorStatusItem.width(); + } + if (armorStatusItem.height() <= height) continue; + height += armorStatusItem.height(); + } + this.height = height; + this.width = width; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/chat/ModuleChat.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/chat/ModuleChat.java new file mode 100644 index 0000000..463a14a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/chat/ModuleChat.java @@ -0,0 +1,208 @@ +package com.cheatbreaker.client.module.impl.normal.hud.chat; + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ChatLine; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +/** + * Allows the user to move and customize the chat. + * @see AbstractModule + */ +public class ModuleChat extends AbstractModule { + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + private final Map chatColors = new HashMap<>(); + public List dingCooldown = new ArrayList<>(); // used to not ding on messages sent by the actual player + + public Setting background; + public Setting inputFieldBackground; + public Setting backgroundWidthType; + public Setting backgroundWidth; + public Setting focusedBackgroundHeight; + public Setting unfocusedBackgroundHeight; + + public Setting textShadow; + public Setting highlightOwnName; + public Setting highlightColor; + public Setting playDing; + public Setting stripFormattingColors; + public Setting textColor; + public Setting textOpacity; + public Setting textSize; + public Setting lineSpacing; + + public Setting unlimitedChat; + public Setting clearChatOnRelog; + public Setting masterOpacity; + + public Setting smoothChat; + public Setting smoothChatSpeed; + + public Setting backgroundColor; + + public Setting chatHeightFix; + + private int activeChatLines = 0; + + public ModuleChat() { + super("Chat"); + this.setDefaultAnchor(GuiAnchor.LEFT_BOTTOM); + this.setDefaultTranslations(0.0f, -26.0f); + this.notRenderHUD = false; + + this.masterOpacity = new Setting(this, "Master Opacity").setValue(100.0F).setMinMax(0.05F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.unlimitedChat = new Setting(this, "Unlimited Chat").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.clearChatOnRelog = new Setting(this, "Clear Chat on Relog").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + + new Setting(this, "label").setValue("Background Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.background = new Setting(this, "Show Background","Draw a background behind chat.").setValue("ON").acceptedStringValues("ON", "While Typing", "OFF").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.inputFieldBackground = new Setting(this, "Show Input Field Background", "Draw a background behind the chat text input field.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.backgroundWidthType = new Setting(this, "Background Width").setValue("Full").acceptedStringValues("Full", "Compact").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> !this.background.getValue().equals("OFF")); + this.backgroundWidth = new Setting(this, "Width").setValue(GuiNewChat.func_146233_a(this.mc.gameSettings.chatWidth)).setMinMax(40, 320).setUnit("px").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud).onChange((value) -> Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b()); + this.focusedBackgroundHeight = new Setting(this, "Focused Height").setValue(GuiNewChat.func_146243_b(this.mc.gameSettings.chatHeightFocused)).setMinMax(20, 180).setUnit("px").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud).onChange((value) -> Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b()); + this.unfocusedBackgroundHeight = new Setting(this, "Unfocused Height").setValue(GuiNewChat.func_146243_b(this.mc.gameSettings.chatHeightUnfocused)).setMinMax(20, 180).setUnit("px").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud).onChange((value) -> Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b()); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x80000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> !this.background.getValue().equals("OFF") || (Boolean) this.inputFieldBackground.getValue()); + + new Setting(this, "label").setValue("Text Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadow = new Setting(this, "Text Shadow").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.stripFormattingColors = new Setting(this, "Strip Formatting Colors").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.stripFormattingColors.getBooleanValue()); + this.textOpacity = new Setting(this, "Text Opacity").setValue(100.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).onChange((value) -> Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b()); + this.textSize = new Setting(this, "Text Scale").setValue(this.mc.gameSettings.chatScale * 100.0F).setMinMax(0.0F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this::isRenderHud).onChange((value) -> Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b()); +// this.lineSpacing = new Setting(this, "Line Spacing").setValue(0.0F).setMinMax(0.0F, 1.0F); + + new Setting(this, "label").setValue("Animation Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.smoothChat = new Setting(this, "Smooth Chat").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.smoothChatSpeed = new Setting(this, "Smooth Chat Speed").setValue(8.0F).setMinMax(0.25F, 10.0F).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Boolean) this.smoothChat.getValue()); +// new Setting(this, "label").setValue("Filter Options"); + + + new Setting(this, "label").setValue("Highlighting Options"); + this.highlightOwnName = new Setting(this, "Highlight Own Name").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.highlightColor = new Setting(this, "Highlight Colour").setValue("None") + .acceptedStringValues("None", "Purple", "Dark Red", "Gold", "Cyan", "Blue", "Green", "Aqua").setCondition(() -> this.highlightOwnName.getBooleanValue()); + this.playDing = new Setting(this, "Play Ding").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.highlightOwnName::getBooleanValue); + + new Setting(this, "label").setValue("Position Options").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.isRenderHud()); + this.chatHeightFix = new Setting(this, "Chat Height Position").setValue(0.0F).setMinMax(-14.0F, 32.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.isRenderHud()); + + this.setDescription("Move and customize the Minecraft chat to your liking."); + this.setCreators("LlamaLad7 (Smooth Chat)"/*, "GeckoThePecko (Filter Options)"*/); + this.setColors(); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(TickEvent.class, this::onTick); + } + + @Override + public void addAllEvents() { + super.addAllEvents(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b(); + } + + @Override + public void removeAllEvents() { + super.removeAllEvents(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b(); + } + + @Override + public void setRenderHud(boolean bl) { + super.setRenderHud(bl); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b(); + } + + private void onTick(TickEvent event) { + this.dingCooldown.removeIf(n -> n < System.currentTimeMillis() - 250L); + } + + private void onPreviewDraw(PreviewDrawEvent event) { + if (this.isRenderHud() && this.activeChatLines == 0 && this.mc.currentScreen instanceof HudLayoutEditorGui) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + GuiNewChat chat = new GuiNewChat(this.mc); + chat.func_146234_av(new ChatComponentText("§7§m-----------------------------------------------------")); + chat.func_146234_av(new ChatComponentText("")); + chat.func_146234_av(new ChatComponentText("Welcome to §cCheatBreaker§f!")); + chat.func_146234_av(new ChatComponentText("")); + chat.func_146234_av(new ChatComponentText("- §cWebsite: §fwww.cheatbreaker.com")); + chat.func_146234_av(new ChatComponentText("- §cDiscord: §fwww.discord.gg/kjgm75FZRC")); + chat.func_146234_av(new ChatComponentText("- §cTwitter: §fwww.twitter.com/CheatBreaker")); + chat.func_146234_av(new ChatComponentText("")); + chat.func_146234_av(new ChatComponentText("§7§m-----------------------------------------------------")); + + chat.drawCustomChat(this.mc.ingameGUI.getUpdateCounter(), false); + this.setDimensions((float) (int)this.backgroundWidth.getValue() + 4.0F, Math.min(getChatHeight(), chat.drawnChatLines.size() * 9) * (float) this.textSize.getValue() / 100.0F); + GL11.glPopMatrix(); + } + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + int var2 = this.mc.ingameGUI.getChatGUI().func_146232_i(); + int var9; + int var3 = 0; + + for (var9 = 0; var9 + this.mc.ingameGUI.getChatGUI().scrollPos < this.mc.ingameGUI.getChatGUI().drawnChatLines.size() && var9 < var2; ++var9) { + ChatLine var10 = this.mc.ingameGUI.getChatGUI().drawnChatLines.get(var9); + if (var10 != null) { + if (this.mc.ingameGUI.getUpdateCounter() - var10.getUpdatedCounter() < 200) { + ++var3; + } + } + } + + this.activeChatLines = var3; + if (this.activeChatLines != 0 || !(this.mc.currentScreen instanceof HudLayoutEditorGui)) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + int height = this.mc.currentScreen instanceof GuiChat ? this.mc.ingameGUI.getChatGUI().drawnChatLines.size() * 9 : -(-this.activeChatLines * 9); + this.mc.ingameGUI.getChatGUI().drawCustomChat(this.mc.ingameGUI.getUpdateCounter(), this.smoothChat.getBooleanValue()); + this.setDimensions((float) (int)this.backgroundWidth.getValue() + 4.0F * (float) this.textSize.getValue() / 100.0F, Math.min(getChatHeight(), height) * (float) this.textSize.getValue() / 100.0F); + GL11.glPopMatrix(); + } + } + + public int getChatHeight() { + return this.mc.currentScreen instanceof GuiChat ? (int) this.focusedBackgroundHeight.getValue() : (int) this.unfocusedBackgroundHeight.getValue(); + } + + private void setColors() { + this.chatColors.put("Purple", EnumChatFormatting.DARK_PURPLE); + this.chatColors.put("Red", EnumChatFormatting.DARK_RED); + this.chatColors.put("Gold", EnumChatFormatting.GOLD); + this.chatColors.put("Cyan", EnumChatFormatting.DARK_AQUA); + this.chatColors.put("Blue", EnumChatFormatting.DARK_BLUE); + this.chatColors.put("Green", EnumChatFormatting.DARK_GREEN); + this.chatColors.put("Aqua", EnumChatFormatting.AQUA); + } + + public EnumChatFormatting getHighlightColor() { + return this.chatColors.get(this.highlightColor.getStringValue()); + } + + // Public so that GuiNewChat can access it. + public String stripColor(String input) { + return input == null ? null : STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/CooldownRenderer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/CooldownRenderer.java new file mode 100644 index 0000000..4f221d7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/CooldownRenderer.java @@ -0,0 +1,104 @@ +package com.cheatbreaker.client.module.impl.normal.hud.cooldowns; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.armorstatus.ModuleArmorStatus; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import org.lwjgl.opengl.GL11; + +public class CooldownRenderer { + private final String cooldownID; + private final int itemID; + private long duration; + private long time; + private final Minecraft mc = Minecraft.getMinecraft(); + private final ItemStack itemStack; + + public CooldownRenderer(String cooldownID, int itemID, long duration) { + this.cooldownID = cooldownID; + this.itemID = itemID; + this.duration = duration; + this.time = System.currentTimeMillis(); + this.itemStack = new ItemStack(Item.getItemById(itemID)); + } + + public void render(Setting theme, float x, float y, int color) { + int radius = 17; + GL11.glPushMatrix(); + float f4 = ModuleArmorStatus.renderItem.zLevel; + ModuleArmorStatus.renderItem.zLevel = -50; + float scale = 1.35F; + GL11.glTranslatef(-0.5F, -1, 0.0f); + GL11.glScalef(scale, scale, scale); + RenderHelper.enableStandardItemLighting(); + ModuleArmorStatus.renderItem.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), this.itemStack, (int)((x + (float)(radius / 2)) / scale), (int)((y + (float)(radius / 2)) / scale)); + RenderHelper.disableStandardItemLighting(); + GL11.glPopMatrix(); + ModuleArmorStatus.renderItem.zLevel = f4; + double d = this.duration - (System.currentTimeMillis() - this.time); + if (d <= 0.0) { + return; + } + if (((String)theme.getValue()).equalsIgnoreCase("Bright")) { + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.2F); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, radius, 0.0, (float)this.duration / 3.95f, (int)this.duration, d); + GL11.glColor4f(0.9F, 0.9F, 0.9F, 1.0F); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, (float)radius + 0.1f, radius - 2, (float)this.duration / 3.95f, (int)this.duration, this.duration); + GL11.glColor4f(0.35F, 0.35F, 0.35F, 0.6F); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, (float)radius + 0.1f, radius - 2, (float)this.duration / 3.95f, (int)this.duration, d); + } else if (((String)theme.getValue()).equalsIgnoreCase("Dark")) { + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.2F); + RenderUtil.drawCircle(x + (float)radius, y + (float)radius, radius); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.2F); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, radius, 0.0, (float)this.duration / 3.95f, (int)this.duration, d); + GL11.glColor4f(0.0F, 0.9F, 0.0F, 1.0F); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, (float)radius + 0.1f, radius - 2, (float)this.duration / 3.95f, (int)this.duration, this.duration); + GL11.glColor4f(0.0F, 0.5F, 0.0F, 1.0F); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, (float)radius + 0.1f, radius - 2, (float)this.duration / 3.95f, (int)this.duration, d); + } else if (((String)theme.getValue()).equalsIgnoreCase("Colored")) { + float opacity = (float)(color >> 24 & 0xFF) / (float)255; + float red = (float)(color >> 16 & 0xFF) / (float)255; + float green = (float)(color >> 8 & 0xFF) / (float)255; + float blue = (float)(color & 0xFF) / (float)255; + GL11.glColor4f(red, green, blue, 0.15F * opacity); + RenderUtil.drawCircle(x + (float)radius, y + (float)radius, radius); + GL11.glColor4f(red, green, blue, 0.25F * opacity); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, radius, 0.0, (float)this.duration / 3.95f, (int)this.duration, d); + GL11.glColor4f(red, green, blue, opacity); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, (float)radius + 0.1f, radius - 2, (float)this.duration / 3.95f, (int)this.duration, this.duration); + GL11.glColor4f(red, green, blue, 0.15F * opacity); + RenderUtil.drawCircleWithOutLine(x + (float)radius, y + (float)radius, (float)radius + 0.1f, radius - 2, (float)this.duration / 3.95f, (int)this.duration, d); + } + String string = String.format("%." + CheatBreaker.getInstance().getModuleManager().cooldownsMod.decimals.getValue() + "f", d / 1000.0); + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredStringWithShadow(string, x + (float)radius - CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(string) / 2.0f, y + (float)(radius / 2) + (float)4, -1, 0x6F000000); + } + + public boolean isTimeOver() { + return this.time < System.currentTimeMillis() - this.duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + public void getTime() { + this.time = System.currentTimeMillis(); + } + + public String getCooldownID() { + return this.cooldownID; + } + + public long getDuration() { + return this.duration; + } + + public int getItemID() { + return this.itemID; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/ModuleCooldowns.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/ModuleCooldowns.java new file mode 100644 index 0000000..fcac993 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/cooldowns/ModuleCooldowns.java @@ -0,0 +1,127 @@ +package com.cheatbreaker.client.module.impl.normal.hud.cooldowns; + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ModulePlaceGui; +import com.google.common.eventbus.Subscribe; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +/** + * This mod shows custom cooldowns sent by the server utilizing the client Bukkit API. + *

+ * Users can also show the Ender Pearl cooldown if the bukkit API does not exist for their connected server. + * @see AbstractModule + */ +public class ModuleCooldowns extends AbstractModule { + private static final List normal = new ArrayList<>(); + public Setting theme; + private final Setting mode; + public Setting useEXP; + public Setting decimals; + private final Setting color; + private final List preview = new ArrayList<>(); + + public ModuleCooldowns() { + super("Cooldowns", "Normal"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_TOP); + this.setDefaultTranslations(0.0f, 5); + this.theme = new Setting(this, "Color Theme").setValue("Bright").acceptedStringValues("Bright", "Dark", "Colored").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.mode = new Setting(this, "List Mode").setValue("horizontal").acceptedStringValues("vertical", "horizontal").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.useEXP = new Setting(this, "Use Pearl Cooldown via XP").setValue(true); + this.decimals = new Setting(this, "Decimals").setValue(1).setMinMax(0, 3).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.color = new Setting(this, "Colored color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.theme.getValue().equals("Colored")); + this.setDescription("Allows servers to display items or abilities that are on cooldown."); + this.setCreators("OpTic"); + this.addEvent(TickEvent.class, this::onTick); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.setDefaultState(true); + } + + public void onTick(TickEvent tickEvent) { + if (!normal.isEmpty()) { + normal.removeIf(CooldownRenderer::isTimeOver); + } + if (!this.preview.isEmpty()) { + this.preview.removeIf(CooldownRenderer::isTimeOver); + } + } + + @Subscribe + public void onPreviewDraw(PreviewDrawEvent event) { + if (!this.isRenderHud()) { + return; + } + if (normal.isEmpty()) { + GL11.glPushMatrix(); + if (this.preview.isEmpty()) { + this.preview.add(new CooldownRenderer("CombatTag", 283, 30000L)); + this.preview.add(new CooldownRenderer("EnderPearl", 368, 12000L)); + } + this.scaleAndTranslate(event.getScaledResolution()); + boolean isVertical = ((String)this.mode.getValue()).equalsIgnoreCase("vertical"); + int n = 36; + int n2 = 36; + int n3 = isVertical ? n : this.preview.size() * n; + int n4 = isVertical ? this.preview.size() * n2 : n2; + this.setDimensions((int)((float)n3), (int)((float)n4) - 1); + for (int cooldownList = 0; cooldownList < this.preview.size(); ++cooldownList) { + CooldownRenderer cooldownRenderer = this.preview.get(cooldownList); + if (((String)this.mode.getValue()).equalsIgnoreCase("vertical")) { + cooldownRenderer.render(this.theme, this.width / 2.0f - (float)(n / 2), cooldownList * n2, this.color.getColorValue()); + continue; + } + cooldownRenderer.render(this.theme, cooldownList * n, 0.0f, this.color.getColorValue()); + } + GL11.glPopMatrix(); + } + } + + @Subscribe + public void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + if (normal.size() > 0) { + this.scaleAndTranslate(event.getScaledResolution()); + boolean isVertical = ((String)this.mode.getValue()).equalsIgnoreCase("vertical"); + int size = 36; + int size2 = 36; + int n3 = isVertical ? size : normal.size() * size; + int n4 = isVertical ? normal.size() * size2 : size2; + this.setDimensions(n3, n4 - 1); + for (int cooldownList = 0; cooldownList < normal.size(); ++cooldownList) { + CooldownRenderer cooldownRenderer = normal.get(cooldownList); + if (((String)this.mode.getValue()).equalsIgnoreCase("vertical")) { + cooldownRenderer.render(this.theme, this.width / 2.0f - (float)(size / 2), cooldownList * size2, this.color.getColorValue()); + continue; + } + cooldownRenderer.render(this.theme, cooldownList * size, 0.0f, this.color.getColorValue()); + } + } else if (!(this.mc.currentScreen instanceof HudLayoutEditorGui) && !(this.mc.currentScreen instanceof ModulePlaceGui)) { + this.setDimensions(50, 24); + this.scaleAndTranslate(event.getScaledResolution()); + } + GL11.glPopMatrix(); + } + + public static void addCooldown(String cooldownID, long duration, int itemID) { + for (CooldownRenderer cooldownRenderer : normal) { + if (!cooldownRenderer.getCooldownID().equalsIgnoreCase(cooldownID) || cooldownRenderer.getItemID() != itemID) continue; + cooldownRenderer.getTime(); + cooldownRenderer.setDuration(duration); + return; + } + normal.add(new CooldownRenderer(cooldownID, itemID, duration)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/Key.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/Key.java new file mode 100644 index 0000000..fe7801c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/Key.java @@ -0,0 +1,209 @@ +package com.cheatbreaker.client.module.impl.normal.hud.keystrokes; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.inventory.GuiContainer; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +/** + * Draws the actual key for the Key Strokes mod. + * @see ModuleKeyStrokes + */ +public class Key { + @Getter private final String displayString; + @Getter private int keyCode; + @Getter private final float width; + @Getter private final float height; + private boolean pressed; + private long lastPressed; + private Color backgroundPressedColor; + private Color backgroundUnpressedColor; + private Color textPressedColor; + private Color textUnpressedColor; + private Color clicksPressedColor; + private Color clicksUnpressedColor; + private Color borderPressedColor; + private Color borderUnpressedColor; + + public Key(String displayString, int keyCode, float width, float height) { + this.displayString = displayString; + this.keyCode = keyCode; + this.width = width; + this.height = height; + } + + public void render(float x, float y, int textColor, int textColorPressed, int backgroundColor, int backgroundColorPressed, int borderColor, int borderColorPressed, boolean textShadow) { + Minecraft mc = Minecraft.getMinecraft(); + int button = (this.keyCode == -99 || this.keyCode == -100) ? ((this.keyCode == -99) ? 1 : 0) : -1; + boolean pressed = (mc.currentScreen == null || mc.currentScreen instanceof GuiContainer || mc.currentScreen instanceof HudLayoutEditorGui) && ((button != -1) ? Mouse.isButtonDown(button) : Keyboard.isKeyDown(this.keyCode)); + if (pressed && !this.pressed) { + this.pressed = true; + this.lastPressed = System.currentTimeMillis(); + this.backgroundPressedColor = new Color(backgroundColor, true); + this.backgroundUnpressedColor = new Color(backgroundColorPressed, true); + this.textPressedColor = new Color(textColor, true); + this.textUnpressedColor = new Color(textColorPressed, true); + this.clicksPressedColor = new Color((Integer)CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColor.getColorValue(), true); + this.clicksUnpressedColor = new Color((Integer)CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColorPressed.getColorValue(), true); + this.borderPressedColor = new Color(borderColor, true); + this.borderUnpressedColor = new Color(borderColorPressed, true); + } else if (this.pressed && !pressed) { + this.pressed = false; + this.lastPressed = System.currentTimeMillis(); + this.backgroundPressedColor = new Color(backgroundColorPressed, true); + this.backgroundUnpressedColor = new Color(backgroundColor, true); + this.textPressedColor = new Color(textColorPressed, true); + this.textUnpressedColor = new Color(textColor, true); + this.clicksPressedColor = new Color((Integer)CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColorPressed.getColorValue(), true); + this.clicksUnpressedColor = new Color((Integer)CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColor.getColorValue(), true); + this.borderPressedColor = new Color(borderColorPressed, true); + this.borderUnpressedColor = new Color(borderColor, true); + } + float backgroundFadeTime = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.backgroundFadeTime.getValue(); + int rgb; + if (System.currentTimeMillis() - this.lastPressed < backgroundFadeTime) { + float n9 = (System.currentTimeMillis() - this.lastPressed) / backgroundFadeTime; + rgb = new Color( + (int)Math.abs(n9 * this.backgroundUnpressedColor.getRed() + (1.0f - n9) * this.backgroundPressedColor.getRed()), + (int)Math.abs(n9 * this.backgroundUnpressedColor.getGreen() + (1.0f - n9) * this.backgroundPressedColor.getGreen()), + (int)Math.abs(n9 * this.backgroundUnpressedColor.getBlue() + (1.0f - n9) * this.backgroundPressedColor.getBlue()), + (int)Math.abs(n9 * this.backgroundUnpressedColor.getAlpha() + (1.0f - n9) * this.backgroundPressedColor.getAlpha()) + ).getRGB(); + } else { + rgb = (pressed ? backgroundColorPressed : backgroundColor); + } + + float textFadeTime = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.textFadeTime.getValue(); + int getTextColor; + int getCPSTextColor; + int getTextShadowColor; + if ((float)(System.currentTimeMillis() - this.lastPressed) < textFadeTime) { + float var12 = (float)(System.currentTimeMillis() - this.lastPressed); + float var13 = var12 / textFadeTime; + int r = (int)Math.abs(var13 * (float)this.textUnpressedColor.getRed() + (1.0F - var13) * (float)this.textPressedColor.getRed()); + int g = (int)Math.abs(var13 * (float)this.textUnpressedColor.getGreen() + (1.0F - var13) * (float)this.textPressedColor.getGreen()); + int b = (int)Math.abs(var13 * (float)this.textUnpressedColor.getBlue() + (1.0F - var13) * (float)this.textPressedColor.getBlue()); + int a = (int)Math.abs(var13 * (float)this.textUnpressedColor.getAlpha() + (1.0F - var13) * (float)this.textPressedColor.getAlpha()); + int rc = (int)Math.abs(var13 * (float)this.clicksUnpressedColor.getRed() + (1.0F - var13) * (float)this.clicksPressedColor.getRed()); + int gc = (int)Math.abs(var13 * (float)this.clicksUnpressedColor.getGreen() + (1.0F - var13) * (float)this.clicksPressedColor.getGreen()); + int bc = (int)Math.abs(var13 * (float)this.clicksUnpressedColor.getBlue() + (1.0F - var13) * (float)this.clicksPressedColor.getBlue()); + int ac = (int)Math.abs(var13 * (float)this.clicksUnpressedColor.getAlpha() + (1.0F - var13) * (float)this.clicksPressedColor.getAlpha()); + getTextColor = (new Color(r, g, b, a)).getRGB(); + getCPSTextColor = (new Color(rc, gc, bc, ac)).getRGB(); + getTextShadowColor = (new Color(r/4, g/4, b/4, a)).getRGB(); + } else { + getTextColor = pressed ? textColorPressed : textColor; + getCPSTextColor = pressed ? (Integer)CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColorPressed.getColorValue() : (Integer)CheatBreaker.getInstance().getModuleManager().keystrokesMod.clicksColor.getColorValue(); + int rgbp = textColorPressed; + int textrgb = textColor; + int rp = rgbp >> 16 & 255; + int gp = rgbp >> 8 & 255; + int bp = rgbp & 255; + int r = textrgb >> 16 & 255; + int g = textrgb >> 8 & 255; + int b = textrgb & 255; + getTextShadowColor = pressed ? (new Color(rp/4, gp/4, bp/4)).getRGB() : (new Color(r/4, g/4, b/4)).getRGB(); + } + + float borderFadeTime = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.borderFadeTime.getValue(); + int borderRGB; + if (System.currentTimeMillis() - this.lastPressed < borderFadeTime) { + float n9 = (System.currentTimeMillis() - this.lastPressed) / borderFadeTime; + borderRGB = new Color( + (int)Math.abs(n9 * this.borderUnpressedColor.getRed() + (1.0f - n9) * this.borderPressedColor.getRed()), + (int)Math.abs(n9 * this.borderUnpressedColor.getGreen() + (1.0f - n9) * this.borderPressedColor.getGreen()), + (int)Math.abs(n9 * this.borderUnpressedColor.getBlue() + (1.0f - n9) * this.borderPressedColor.getBlue()), + (int)Math.abs(n9 * this.borderUnpressedColor.getAlpha() + (1.0f - n9) * this.borderPressedColor.getAlpha()) + ).getRGB(); + } else { + borderRGB = (pressed ? borderColorPressed : borderColor); + } + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.background.getValue()) { + Gui.drawRect(x, y, x + this.width, y + this.height, rgb); + } + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.border.getValue()) { + float borderThickness = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.borderThickness.getValue(); + Gui.drawOutline(x - borderThickness, y - borderThickness, x + this.width + borderThickness, y + this.height + borderThickness, borderThickness, borderRGB); + } + if (this.keyCode == mc.gameSettings.keyBindJump.getKeyCode() && (Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLine.getValue()) { + float spaceBarPos = (Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.centerSpacebarLine.getValue() ? this.height / 2 - (float)CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineHeight.getValue() / 2 : 3; + if (textShadow) Gui.drawRect((x + this.width / 2.0f - this.width / (12.0F - (float)CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue())) + 1, y + spaceBarPos + 1.0f, (x + this.width / 2.0f + this.width / (12.0F - (float)CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue())) + 1, y + spaceBarPos + 1 + (float)CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineHeight.getValue(), getTextShadowColor); + Gui.drawRect(x + this.width / 2 - this.width / (12.0F - (float)CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue()), y + spaceBarPos, x + this.width / 2.0f + this.width / (12.0F - (float)CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineWidth.getValue()), y + spaceBarPos + (float)CheatBreaker.getInstance().getModuleManager().keystrokesMod.spacebarLineHeight.getValue(), getTextColor); + } else { + GL11.glEnable(GL11.GL_BLEND); + float xPos = (x + this.width / 2.0F) - (float) (mc.fontRenderer.getStringWidth(this.displayString) / 2) + 0.26F; + float yPos = y + this.height / 2.0F - (float)(mc.fontRenderer.FONT_HEIGHT / 2) + 0.65F; + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.legacyPosition.getValue()) { + xPos = (x + this.width / 2.0F) - (float) (mc.fontRenderer.getStringWidth(this.displayString) / 2); + yPos = y + this.height / 2.0F - (float)(mc.fontRenderer.FONT_HEIGHT / 2) + 1.0f; + } + float boxSize = (Float) CheatBreaker.getInstance().getModuleManager().keystrokesMod.boxSize.getValue(); + boolean attackKeyCode = this.keyCode == mc.gameSettings.keyBindAttack.getKeyCode(); + boolean useItemKeyCode = this.keyCode == mc.gameSettings.keyBindUseItem.getKeyCode(); + String clicksOption = attackKeyCode ? (String) CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftClicks.getValue() : useItemKeyCode ? (String) CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightClicks.getValue() : ""; + if (attackKeyCode || useItemKeyCode) { + if (boxSize > 14.0F && clicksOption.equals("With Clicks")) { + + GL11.glPushMatrix(); + float cpsScale = 0.6666F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + yPos = y + this.height / 2.0F - (float)(mc.fontRenderer.FONT_HEIGHT / 2) + 6.0F; + String clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftCPS.size() + " CPS"; + if (this.displayString.equals("RMB")) { + clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightCPS.size() + " CPS"; + } + float xClicksPos = (x + this.width / 2.0F) - (mc.fontRenderer.getStringWidth(clicks) / 2.0F) * cpsScale; + mc.fontRenderer.drawString(clicks, xClicksPos / cpsScale, yPos / cpsScale, getCPSTextColor, textShadow); + GL11.glScalef(1.0F, 1.0F, 0.0F); + GL11.glPopMatrix(); + yPos = y + this.height / 2.0F - (float)(mc.fontRenderer.FONT_HEIGHT / 2) - 3.0F; + } else if (clicksOption.equals("Replace Clicks")) { + GL11.glPushMatrix(); + float cpsScale = 1.0F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + String clicks = this.displayString; + String cpsText = boxSize < 15.0F ? "" : " CPS"; + if (attackKeyCode) { + if (CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftCPS.size() > 0) { + clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.leftCPS.size() + cpsText; + if (boxSize > 15.0F) { + cpsScale = 0.6666F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + } + } + } + if (useItemKeyCode) { + if (CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightCPS.size() > 0) { + clicks = CheatBreaker.getInstance().getModuleManager().keystrokesMod.rightCPS.size() + cpsText; + if (boxSize > 15.0F) { + cpsScale = 0.6666F; + GL11.glScalef(cpsScale, cpsScale, 0.0F); + } + } + } + xPos = x + this.width / 2.0F - (mc.fontRenderer.getStringWidth(clicks) / 2.0F) * cpsScale + 0.26F; + yPos = y + this.height / 2.0F - (float)(mc.fontRenderer.FONT_HEIGHT / 2) + (boxSize > 15.0F && !clicks.equals(this.displayString) ? 1.65F : 0.65F); + if ((Boolean) CheatBreaker.getInstance().getModuleManager().keystrokesMod.legacyPosition.getValue()) { + xPos = x + this.width / 2.0F - (mc.fontRenderer.getStringWidth(clicks) / 2.0F) * cpsScale; + yPos = y + this.height / 2.0F - (float)(mc.fontRenderer.FONT_HEIGHT / 2) + (boxSize > 15.0F && !clicks.equals(this.displayString) ? 2.0F : 1.0F); + } + mc.fontRenderer.drawString(clicks, xPos / cpsScale, yPos / cpsScale, getTextColor, textShadow); + GL11.glScalef(1.0F, 1.0F, 0.0F); + GL11.glPopMatrix(); + } + } + + if (!clicksOption.equals("Replace Clicks")) { + mc.fontRenderer.drawString(this.displayString, xPos, yPos, getTextColor, textShadow); + } + GL11.glDisable(GL11.GL_BLEND); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/ModuleKeyStrokes.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/ModuleKeyStrokes.java new file mode 100644 index 0000000..233c8cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/keystrokes/ModuleKeyStrokes.java @@ -0,0 +1,359 @@ +package com.cheatbreaker.client.module.impl.normal.hud.keystrokes; + +import com.cheatbreaker.client.event.impl.ClickEvent; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +/** + * Displays when the user's movement keys, mouse or spacebar is pressed. + * @see AbstractModule + */ +public class ModuleKeyStrokes extends AbstractModule { + private final Setting keyOptionsLabel; + private final Setting movementKeys; + private final Setting clicks; + private final Setting spacebar; + private final Setting sneak; + + private final Setting clickOptionsLabel; + public Setting leftClicks; + public Setting rightClicks; + private Setting backgroundHeight; + public Setting clicksColor; + public Setting clicksColorPressed; + + private final Setting spacebarOptionsLabel; + public Setting spacebarLineWidth; + public Setting spacebarLineHeight; + public Setting spacebarLine; + public Setting centerSpacebarLine; + + private final Setting sneakOptionsLabel; + public Setting sneakKeybindName; + public Setting sneakHeight; + + private final Setting textOptionsLabel; + public Setting namesArrowSetting; + private final Setting textShadow; + private final Setting literalKeys; + public Setting legacyPosition; + + private final Setting backgroundOptionsLabel; + public Setting background; + public Setting border; + private Setting splitBoxSize; + private Setting boxSizeHeight; + public Setting borderThickness; + private Setting spacebarHeight; + public Setting boxSize; + private final Setting gap; + + private final Setting fadeOptionsLabel; + public Setting textFadeTime; + public Setting backgroundFadeTime; + public Setting borderFadeTime; + + private final Setting colorOptionsLabel; + private final Setting textColor; + private final Setting textColorPressed; + private final Setting backgroundColor; + private final Setting backgroundColorPressed; + private final Setting borderColor; + private final Setting borderColorPressed; + + private Key forwardElement; + private Key leftElement; + private Key rightElement; + private Key backElement; + private Key attackButtonElement; + private Key useButtonElement; + private Key spaceButtonElement; + private Key sneakButtonElement; + + public final List leftCPS = new ArrayList(); + public final List rightCPS = new ArrayList(); + + public ModuleKeyStrokes() { + super("Key Strokes"); + this.setDefaultAnchor(GuiAnchor.LEFT_TOP); + this.setDefaultTranslations(0.0F, 5); + this.setDefaultState(false); + this.keyOptionsLabel = new Setting(this, "label").setValue("Key Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.movementKeys = new Setting(this, "Show movement keys").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.clicks = new Setting(this, "Show clicks").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.spacebar = new Setting(this, "Show spacebar").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.sneak = new Setting(this, "Show sneak key").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.clickOptionsLabel = new Setting(this, "label").setValue("Click Options").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.clicks::getBooleanValue); + this.leftClicks = new Setting(this, "Left CPS").setValue("OFF").acceptedStringValues("OFF", "Replace Clicks", "With Clicks", "Separate").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.clicks::getBooleanValue); + this.rightClicks = new Setting(this, "Right CPS").setValue("OFF").acceptedStringValues("OFF", "Replace Clicks", "With Clicks", "Separate").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.clicks::getBooleanValue); + this.backgroundHeight = new Setting(this, "CPS Background Height").setValue(13.0F).setMinMax(10.0F, 24.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.clicks.getBooleanValue() && this.leftClicks.getValue().equals("Separate") || this.rightClicks.getValue().equals("Separate")); + this.clicksColor = new Setting(this, "CPS Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.clicks.getBooleanValue() && this.leftClicks.getValue().equals("With Clicks") || this.rightClicks.getValue().equals("With Clicks")); + this.clicksColorPressed = new Setting(this, "CPS Color (Pressed)").setValue(-16777216).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.clicks.getBooleanValue() && this.leftClicks.getValue().equals("With Clicks") || this.rightClicks.getValue().equals("With Clicks")); + + this.spacebarOptionsLabel = new Setting(this, "label").setValue("Spacebar Options").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.spacebar::getBooleanValue); + this.spacebarLine = new Setting(this, "Show Spacebar Line").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.spacebar::getBooleanValue); + this.centerSpacebarLine = new Setting(this, "Center Spacebar Line").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.spacebar.getBooleanValue() && this.spacebarLine.getBooleanValue()); + this.spacebarLineWidth = new Setting(this, "Spacebar Line Width").setValue(4.0F).setMinMax(1.0F, 8.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> this.spacebar.getBooleanValue() && this.spacebarLine.getBooleanValue()); + this.spacebarLineHeight = new Setting(this, "Spacebar Line Height").setValue(1.0F).setMinMax(0.5F, 2.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> this.spacebar.getBooleanValue() && this.spacebarLine.getBooleanValue()); + this.spacebarHeight = new Setting(this, "Spacebar Height").setValue(50.0F).setMinMax(0.0F, 100.0F).setUnit("%").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(this.spacebar::getBooleanValue); + + this.sneakOptionsLabel = new Setting(this, "label").setValue("Sneak Options").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.sneak::getBooleanValue); + this.sneakKeybindName = new Setting(this, "Show Sneak Keybind Name").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.sneak::getBooleanValue); + this.sneakHeight = new Setting(this, "Sneak Box Height").setValue(72.0F).setMinMax(45.0F, 100.0F).setUnit("%").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(this.sneak::getBooleanValue); + + this.textOptionsLabel = new Setting(this, "label").setValue("Text Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textShadow = new Setting(this, "Text Shadow").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.literalKeys = new Setting(this, "Literal Keys").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.namesArrowSetting = new Setting(this, "Replace names with arrows").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.movementKeys::getBooleanValue); + + this.legacyPosition = new Setting(this, "Legacy Position").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.movementKeys.getBooleanValue() || this.clicks.getBooleanValue()); + + this.backgroundOptionsLabel = new Setting(this, "label").setValue("Background Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.background = new Setting(this, "Show Background").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.border = new Setting(this, "Show Border").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.splitBoxSize = new Setting(this, "Split Box Size").setValue(false).onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.boxSize = new Setting(this, "Box size").setValue(18.0F).setMinMax(10.0F, 32.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.boxSizeHeight = new Setting(this, "Box size height").setValue(18.0F).setMinMax(10.0F, 32.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.splitBoxSize::getBooleanValue); + this.gap = new Setting(this, "Gap").setValue(1.0F).setMinMax(0.0F, 4.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.borderThickness = new Setting(this, "Border Thickness").setValue(1.0F).setMinMax(0.0F, 3.0F).setUnit("px").onChange(value -> updateKeyElements()).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.border::getBooleanValue); + + this.fadeOptionsLabel = new Setting(this, "label").setValue("Fade Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textFadeTime = new Setting(this, "Text Fade Time").setValue(0.0F).setMinMax(0.0F, 200.0F).setUnit("ms").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.backgroundFadeTime = new Setting(this, "Background Fade Time").setValue(75.0F).setMinMax(0.0F, 200.0F).setUnit("ms").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.background::getBooleanValue); + this.borderFadeTime = new Setting(this, "Border Fade Time").setValue(100.0F).setMinMax(0.0F, 200.0F).setUnit("ms").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(this.border::getBooleanValue); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textColorPressed = new Setting(this, "Text Color (Pressed)").setValue(-16777216).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x6F000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.background::getBooleanValue); + this.backgroundColorPressed = new Setting(this, "Background Color (Pressed)").setValue(0x6FFFFFFF).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.background::getBooleanValue); + this.borderColor = new Setting(this, "Border Color").setValue(0x9F000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.border::getBooleanValue); + this.borderColorPressed = new Setting(this, "Border Color (Pressed)").setValue(0x9FFFFFFF).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(this.border::getBooleanValue); + this.updateKeyElements(); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/wasd.png"), 55, 37); + this.setDescription("Displays when your movement keys, mouse or spacebar is pressed."); + this.setCreators("Fyu"); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + this.addEvent(ClickEvent.class, this::onClick); + } + + private void onGuiDraw(GuiDrawEvent event) { + if (!this.isRenderHud() || (this.hiddenFromHud && !(this.mc.currentScreen instanceof HudLayoutEditorGui))) { + return; + } + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + this.leftCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + this.rightCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + float width = 0.0f; + float height = 0.0f; + float gap = this.gap.getFloatValue(); + float borderThickness = this.borderThickness.getFloatValue(); + float bgHeight = this.backgroundHeight.getFloatValue(); + if (!this.border.getBooleanValue()) { + borderThickness = 0.0F; + } + + if (this.movementKeys.getBooleanValue()) { + this.forwardElement.render(this.leftElement.getWidth() + gap + (borderThickness * 2.0F), 0.0F, this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + this.leftElement.render(0.0F, this.forwardElement.getHeight() + gap + (borderThickness * 2.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + this.backElement.render(this.leftElement.getWidth() + gap + (borderThickness * 2.0F), this.forwardElement.getHeight() + gap + (borderThickness * 2.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + this.rightElement.render(this.leftElement.getWidth() + this.backElement.getWidth() + 2.0F * gap + (borderThickness * 4.0F), this.forwardElement.getHeight() + gap + (borderThickness * 2.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + width = this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + (2.0F) * gap + (borderThickness * 2.0F); + height += this.forwardElement.getHeight() + 2.0F * gap + this.backElement.getHeight(); + } + + if (this.clicks.getBooleanValue()) { + this.attackButtonElement.render(0.0F, height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + this.useButtonElement.render(this.attackButtonElement.getWidth() + gap + (borderThickness * 2.0F), height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += this.useButtonElement.getHeight() + gap + (borderThickness * 2.0F); + } + + if (this.spacebar.getBooleanValue()) { + this.spaceButtonElement.render(0.0F, height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + width = this.spaceButtonElement.getWidth(); + height += this.spaceButtonElement.getHeight() + gap + (borderThickness * 2.0F); + } + + if (this.sneak.getBooleanValue()) { + this.sneakButtonElement.render(0.0F, height + (borderThickness * 4.0F), this.textColor.getColorValue(), this.textColorPressed.getColorValue(), this.backgroundColor.getColorValue(), this.backgroundColorPressed.getColorValue(), this.borderColor.getColorValue(), this.borderColorPressed.getColorValue(), this.textShadow.getBooleanValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += this.sneakButtonElement.getHeight() + gap + (borderThickness * 2.0F); + } + + if (this.leftClicks.getValue().equals("Separate")) { + String leftClicks = this.leftCPS.size() + " CPS"; + if (this.background.getBooleanValue()) { + Gui.drawRect(0.0F, height + (borderThickness * 4.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 4.0F), height + (borderThickness * 4.0F) + bgHeight, this.backgroundColor.getColorValue()); + } + if (this.border.getBooleanValue()) { + Gui.drawOutline(-borderThickness, height + (borderThickness * 3.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 5.0F), height + (borderThickness * 5.0F) + bgHeight, borderThickness, this.borderColor.getColorValue()); + } + GL11.glEnable(GL11.GL_BLEND); + this.mc.fontRenderer.drawString(leftClicks, this.width / 2.0F - (float) (this.mc.fontRenderer.getStringWidth(leftClicks) / 2) - 0.1F, height + (borderThickness * 4.0F) + (bgHeight / 2.0F - 3.49F), clicksColor.getColorValue(), this.textShadow.getBooleanValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += bgHeight + gap + (borderThickness * 2.0F); + } + + if (this.rightClicks.getValue().equals("Separate")) { + String leftClicks = this.rightCPS.size() + " RCPS"; + if (this.background.getBooleanValue()) { + Gui.drawRect(0.0F, height + (borderThickness * 4.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 4.0F), height + (borderThickness * 4.0F) + bgHeight, this.backgroundColor.getColorValue()); + } + if (this.border.getBooleanValue()) { + Gui.drawOutline(-borderThickness, height + (borderThickness * 3.0F), this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * gap + (borderThickness * 5.0F), height + (borderThickness * 5.0F) + bgHeight, borderThickness, this.borderColor.getColorValue()); + } + GL11.glEnable(GL11.GL_BLEND); + this.mc.fontRenderer.drawString(leftClicks, this.width / 2.0F - (float) (this.mc.fontRenderer.getStringWidth(leftClicks) / 2) - 0.1F, height + (borderThickness * 4.0F) + (bgHeight / 2.0F - 3.49F), clicksColor.getColorValue(), this.textShadow.getBooleanValue()); + width = this.attackButtonElement.getWidth() + this.useButtonElement.getWidth() + gap + (borderThickness * 2.0F); + height += bgHeight + gap + (borderThickness * 2.0F); + } + GL11.glDisable(GL11.GL_BLEND); + + this.setDimensions(width, height - gap + (borderThickness * 2.0F)); + GL11.glPopMatrix(); + } + + public void updateKeyElements() { + int forwardKeyCode = this.mc.gameSettings.keyBindForward.getKeyCode(); + int leftKeyCode = this.mc.gameSettings.keyBindLeft.getKeyCode(); + int backKeyCode = this.mc.gameSettings.keyBindBack.getKeyCode(); + int rightKeyCode = this.mc.gameSettings.keyBindRight.getKeyCode(); + int jumpKeyCode = this.mc.gameSettings.keyBindJump.getKeyCode(); + int attackKeyCode = this.mc.gameSettings.keyBindAttack.getKeyCode(); + int useItemKeyCode = this.mc.gameSettings.keyBindUseItem.getKeyCode(); + int sneakKeyBind = this.mc.gameSettings.keyBindSneak.getKeyCode(); + + boolean arrowKeys = this.namesArrowSetting.getBooleanValue(); + float borderThickness = this.borderThickness.getFloatValue(); + if (!this.border.getBooleanValue()) { + borderThickness = 0.0F; + } + + float boxSize = this.boxSize.getFloatValue(); + float boxSize2 = this.splitBoxSize.getBooleanValue() ? this.boxSizeHeight.getFloatValue() : this.boxSize.getFloatValue(); + + String w = this.getKeyOrMouseName(forwardKeyCode); + String a = this.getKeyOrMouseName(leftKeyCode); + String s = this.getKeyOrMouseName(backKeyCode); + String d = this.getKeyOrMouseName(rightKeyCode); + String jump = this.getKeyOrMouseName(jumpKeyCode); + String leftClick = this.getKeyOrMouseName(attackKeyCode); + String rightClick = this.getKeyOrMouseName(useItemKeyCode); + String sneak = this.sneakKeybindName.getBooleanValue() ? this.getKeyOrMouseName(sneakKeyBind) : "SNEAK"; + + float upKeyWidth = (float) this.mc.fontRenderer.getStringWidth(w) * this.scale.getFloatValue(); + float leftKeyWidth = (float) this.mc.fontRenderer.getStringWidth(a) * this.scale.getFloatValue(); + float downKeyWidth = (float) this.mc.fontRenderer.getStringWidth(s) * this.scale.getFloatValue(); + float rightKeyWidth = (float) this.mc.fontRenderer.getStringWidth(d) * this.scale.getFloatValue(); + float jumpKeyWidth = (float) this.mc.fontRenderer.getStringWidth(jump) * this.scale.getFloatValue(); + float leftClickKeyWidth = (float) this.mc.fontRenderer.getStringWidth(leftClick) * this.scale.getFloatValue(); + float rightClickKeyWidth = (float) this.mc.fontRenderer.getStringWidth(rightClick) * this.scale.getFloatValue(); + float sneakKeyWidth = (float) this.mc.fontRenderer.getStringWidth(sneak) * this.scale.getFloatValue(); + + this.forwardElement = new Key(arrowKeys ? "▲" : (upKeyWidth > boxSize ? w.substring(0, 1) : w), forwardKeyCode, boxSize, boxSize2); + this.leftElement = new Key(arrowKeys ? "◀" : (leftKeyWidth > boxSize ? a.substring(0, 1) : a), leftKeyCode, boxSize, boxSize2); + this.backElement = new Key(arrowKeys ? "▼" : (downKeyWidth > boxSize ? s.substring(0, 1) : s), backKeyCode, boxSize, boxSize2); + this.rightElement = new Key(arrowKeys ? "▶" : (rightKeyWidth > boxSize ? d.substring(0, 1) : d), rightKeyCode, boxSize, boxSize2); + + float mouseBoxWidth = (this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + this.gap.getFloatValue() + (borderThickness * 2.0F)) / 2.0f; + float fullBoxWidth = this.leftElement.getWidth() + this.backElement.getWidth() + this.rightElement.getWidth() + 2.0F * this.gap.getFloatValue() + (borderThickness * 4.0F); + + this.attackButtonElement = new Key(leftClickKeyWidth > mouseBoxWidth ? leftClick.substring(0, 1) : leftClick, attackKeyCode, mouseBoxWidth, boxSize2); + this.useButtonElement = new Key(rightClickKeyWidth > mouseBoxWidth ? rightClick.substring(0, 1) : rightClick, useItemKeyCode, mouseBoxWidth, boxSize2); + this.spaceButtonElement = new Key(jumpKeyWidth > fullBoxWidth ? jump.substring(0, 1) : jump, jumpKeyCode, fullBoxWidth, boxSize2 * this.spacebarHeight.getFloatValue() / 100.0f); + this.sneakButtonElement = new Key(sneakKeyWidth > fullBoxWidth ? sneak.substring(0, 1) : sneak, sneakKeyBind, fullBoxWidth, boxSize2 * this.sneakHeight.getFloatValue() / 100.0f); + } + + private void onClick(ClickEvent event) { + if (event.getMouseButton() == 0) leftCPS.add(System.currentTimeMillis()); + if (event.getMouseButton() == 1) rightCPS.add(System.currentTimeMillis()); + } + + protected String getKeyOrMouseName(int keyCode) { + if (keyCode < 0) { + String openglName = Mouse.getButtonName(keyCode + 100); + if (openglName != null) { + if (openglName.equalsIgnoreCase("button0")) { + return "LMB"; + } + if (openglName.equalsIgnoreCase("button1")) { + return "RMB"; + } + } + return openglName; + } + if (this.literalKeys.getBooleanValue()) { + switch (keyCode) { + case 41: { + return "~"; + } + case 12: + case 74: { + return "-"; + } + case 40: { + return "'"; + } + case 26: { + return "["; + } + case 27: { + return "]"; + } + case 43: { + return "\\"; + } + case 53: + case 181: { + return "/"; + } + case 51: { + return ","; + } + case 52: { + return "."; + } + case 39: { + return ";"; + } + case 13: { + return "="; + } + case 200: { + return "▲"; + } + case 208: { + return "▼"; + } + case 203: { + return "◀"; + } + case 205: { + return "▶"; + } + case 55: { + return "*"; + } + case 78: { + return "+"; + } + } + } + return Keyboard.getKeyName(keyCode); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/AbstractSimpleHudModule.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/AbstractSimpleHudModule.java new file mode 100644 index 0000000..aa29b42 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/AbstractSimpleHudModule.java @@ -0,0 +1,290 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModExclusionRange; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModSize; +import com.cheatbreaker.client.ui.module.GuiAnchor; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +/** + * Defines the necessary options and rendering for all Simple Modules. + * @see AbstractModule + */ +public abstract class AbstractSimpleHudModule extends AbstractModule { + + protected Setting background; + protected Setting staticBackgroundWidth; + protected Setting textOverflow; + protected Setting padding; + protected Setting backgroundWidth; + protected Setting backgroundHeight; + protected Setting border; + protected Setting borderThickness; + protected Setting borderColor; + protected Setting showWhileTyping; + protected Setting alwaysCenter; + protected Setting textShadowBackground; + protected Setting textShadowNoBackground; + + public Setting hideValue; + public Setting hiddenValue; + + protected Setting textColor; + protected Setting backgroundColor; + private Setting icon; + protected ResourceLocation iconTexture; + protected Setting customString; + protected Setting customStringNoBackground; + + public AbstractSimpleHudModule(String name) { + this(name, name, 1.5F, false, true); + } + + public AbstractSimpleHudModule(String name, String previewString) { + this(name, previewString, 1.5F, true, false); + } + + public AbstractSimpleHudModule(String name, String previewString, float previewScale, boolean showBackground, boolean alwaysCenter) { + super(name); + this.setDefaultAnchor(GuiAnchor.RIGHT_TOP); + this.setDefaultTranslations(0.0F, 0.0F); + this.setDefaultState(false); + + new Setting(this, "label").setValue("Background Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.background = new Setting(this, "Show Background", "Draw a background.").setValue(showBackground).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.staticBackgroundWidth = new Setting(this, "Static Background Width", + "§2Enabled:§r Background width is set by a slider.\n" + + "§4Disabled:§r Background width is set by the text size.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (boolean) this.background.getValue() || (boolean) this.alwaysCenter.getValue()); + this.textOverflow = new Setting(this, "Text Overflow", + "What the mod will do if the text overflows from the background" + + "\n§bExtend Width:§r Increases the background width." + + "\n§bScale Text:§r Scales the text down." + + "\n§bDo Nothing:§r Does no action.") + .setValue("Extend Width").acceptedStringValues("Extend Width", "Scale Text", "Do Nothing").setCondition(() -> (this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()) && this.staticBackgroundWidth.getBooleanValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.border = new Setting(this, "Show Border", "Draw a border around the background.").setValue(false).setCondition(() -> (boolean) this.background.getValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.padding = new Setting(this, "Background Width Padding", "Change how spaced the background width is from the text.").setValue(6.0F).setMinMax(0.0F, 10.0F).setUnit("px") + .setCondition(() -> ((boolean) this.background.getValue() || (boolean) this.alwaysCenter.getValue()) && (!(boolean) this.staticBackgroundWidth.getValue() || this.textOverflow.getValue().equals("Extend Background"))) + .setCustomizationLevel(CustomizationLevel.MEDIUM); + this.backgroundWidth = new Setting(this, "Background Width", "Change the width of the background.").setValue(this.backgroundDimensionValues().getDefWidth()).setMinMax(this.backgroundDimensionValues().getMinWidth(), this.backgroundDimensionValues().getMaxWidth()).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> ((boolean) this.background.getValue() || (boolean) this.alwaysCenter.getValue()) && (boolean) this.staticBackgroundWidth.getValue()); + this.backgroundHeight = new Setting(this, "Background Height", "Change the height of the background.").setValue(this.backgroundDimensionValues().getDefHeight()).setMinMax(this.backgroundDimensionValues().getMinHeight(), this.backgroundDimensionValues().getMaxHeight()).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (boolean) this.background.getValue() || (boolean) this.alwaysCenter.getValue()); + this.borderThickness = new Setting(this, "Border Thickness", "Change the thickness of the border.").setValue(1.0F).setMinMax(0.25F, 3.0F).setUnit("px").setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (boolean) this.background.getValue() && (boolean) this.border.getValue()); + + new Setting(this, "label").setValue("General Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.showWhileTyping = new Setting(this, "Show While Typing", "Show the mod when opening chat.").setValue(true).setCustomizationLevel(CustomizationLevel.ADVANCED); + this.alwaysCenter = new Setting(this, "Always Center", "Force the text to be centered in the mod's placement.").setValue(alwaysCenter).setCondition(() -> !this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.icon = new Setting(this, "Show icon", "Show an icon corresponding to the mod.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.iconTexture != null); + this.hideValue = new Setting(this, "Hide when value is").setValue("OFF").acceptedStringValues(this.excludeOptions).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> this.iconTexture == null && !name.equals("Clock")); + this.hiddenValue = new Setting(this, "Hidden value(s)").setValue(this.exclusionRange().getDefValue()).setMinMax(this.exclusionRange().getMinValue(), this.exclusionRange().getMaxValue()).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !this.hideValue.getValue().equals("OFF") && this.iconTexture == null && !name.equals("Clock")); + this.getExtraSettings(); + new Setting(this, "label").setValue("Format Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + this.textShadowBackground = new Setting(this, "Text Shadow (Background)", "Add a text shadow when the background is enabled.").setValue(false).setCondition(() -> this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textShadowNoBackground = new Setting(this, "Text Shadow (No background)", "Add a text shadow when the background is disabled.").setValue(true).setCondition(() -> !this.background.getBooleanValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.getExtraFormatSettings(); + this.customString = new Setting(this, "Format (Background)").setValue(getDefaultFormatString()).setCondition(() -> (boolean) this.background.getValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + if (isBracketsEnabledByDefault()) { + this.customStringNoBackground = new Setting(this, "Format (No Background)").setValue("[" + getDefaultFormatString() + "]").setCondition(() -> !(boolean) this.background.getValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + } else { + this.customStringNoBackground = new Setting(this, "Format (No Background)").setValue(getDefaultFormatString()).setCondition(() -> !(boolean) this.background.getValue()).setCustomizationLevel(CustomizationLevel.ADVANCED); + } + + + new Setting(this, "label").setValue("Color Options").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.textColor = new Setting(this, "Text Color", "Sets the color for the text.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> !(name.equals("Ping") && (Boolean) CheatBreaker.getInstance().getModuleManager().pingMod.dynamicColorRange.getValue()) && !(name.equals("Saturation") && (Boolean) CheatBreaker.getInstance().getModuleManager().saturationMod.amountColors.getValue())); + this.getExtraColorSettings(); + this.backgroundColor = new Setting(this, "Background Color", "Sets the color for the background.").setValue(1862270976).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (boolean) this.background.getValue()); + this.borderColor = new Setting(this, "Border Color", "Sets the color for the border.").setValue(-1627389952).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (boolean) this.background.getValue() && (boolean) this.border.getValue()); + this.setPreviewLabel(previewString, previewScale); + this.addEvent(PreviewDrawEvent.class, this::onPreviewDraw); + this.addEvent(GuiDrawEvent.class, this::onGuiDraw); + } + + public void getExtraSettings() { + + } + + public void getExtraFormatSettings() { + + } + + public void getExtraColorSettings() { + + } + + /** + * Returns the default background dimension values. + */ + public SimpleHudModSize backgroundDimensionValues() { + return new SimpleHudModSize(10, 13, 24, 40, 56, 80); + } + + /** + * Returns the default exclusion range values. + */ + public SimpleHudModExclusionRange exclusionRange() { + return new SimpleHudModExclusionRange(0, 0, 30); + } + + /** + * Sets the abstract value string. + *

+ * The actual modules will return the intended value(s). + */ + public abstract String getValueString(); + + /** + * Sets the abstract label string. + *

+ * The actual modules will return the intended label. + */ + public abstract String getLabelString(); + + /** + * Returns a string in which will display when the mod is in a "waiting" state. If the string is empty or null, the waiting message will not be displayed. + */ + public String getWaitingMessage() { + return null; + } + + /** + * Returns the default simple mod format. + */ + public String getDefaultFormatString() { + return "%VALUE% %LABEL%"; + } + + /** + * Returns a string in which will display when the mod is in a "preview" state. This string will be displayed when the "real" string is null. + */ + public String getPreviewString() { + return ""; + } + + /** + * Returns true if a mod should include brackets in the No Background mode by default. + */ + public boolean isBracketsEnabledByDefault() { + return true; + } + + /** + * Returns the actual path for the icon texture. The icon will not display if the path is null. + */ + public ResourceLocation getIconTexture() { + return null; + } + + /** + * Returns the active color. + */ + public int getColor() { + return this.textColor.getColorValue(); + } + + /** + * Shows the preview version of the mod when in the HUD Editor. For Simple Mods, this will show when the "real" string is null. + */ + private void onPreviewDraw(PreviewDrawEvent event) { + if (this.isRenderHud()) { + if (this.getValueString() == null) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + render(getPreviewString()); + GL11.glPopMatrix(); + } + } + } + + /** + * Shows the actual mod itself. + */ + private void onGuiDraw(GuiDrawEvent event) { + String value = this.getValueString(); + if (value != null && (!this.mc.ingameGUI.getChatGUI().getChatOpen() || (Boolean) this.showWhileTyping.getValue())) { + if (this.isRenderHud() && (!this.hiddenFromHud || (this.mc.currentScreen instanceof HudLayoutEditorGui))) { + GL11.glPushMatrix(); + this.scaleAndTranslate(event.getScaledResolution()); + if (value.isEmpty()) { + value = ""; + } + render(value); + GL11.glPopMatrix(); + } + } + } + + /** + * Actually calls the necessary methods to render the mod. + */ + public void render(String value) { + boolean showIcon = this.icon.getBooleanValue() && iconTexture != null; + String label = this.getLabelString(); + if (label == null || label.isEmpty()) { + label = ""; + } + + String counter; + if (getWaitingMessage() != null && getValueString() != null) { + counter = getWaitingMessage(); + } else if (!label.equals("")) { + if (!showIcon && !(Boolean)this.background.getValue()) { + counter = this.customStringNoBackground.getValue().toString().replaceAll("%LABEL%", label).replaceAll("%VALUE%", value); + } else { + counter = this.customString.getValue().toString().replaceAll("%LABEL%", label).replaceAll("%VALUE%", value); + } + } else { + counter = value; + } + + + + iconTexture = getIconTexture(); + float width = (float)mc.fontRenderer.getStringWidth(counter); + float bHeight = (Float) this.backgroundHeight.getValue(); + float extraX = showIcon ? bHeight : 0.0F; + float bWidth = !(Boolean) staticBackgroundWidth.getValue() ? width + (float)padding.getValue() + extraX : (Float) this.backgroundWidth.getValue(); + + if (this.textOverflow.getValue().equals("Extend Width") && (Boolean) this.staticBackgroundWidth.getValue()) { + bWidth = Math.max((Float) this.backgroundWidth.getValue(), width + (float) padding.getValue() + extraX); + } + + if ((Boolean) this.background.getValue() || showIcon || (Boolean) this.alwaysCenter.getValue()) { + this.setDimensions(bWidth, bHeight); + if ((Boolean)this.background.getValue()) { + Gui.drawRect(0.0F, 0.0F, bWidth, bHeight, this.backgroundColor.getColorValue()); + if ((Boolean) this.border.getValue()) { + float borderThickness = (Float) this.borderThickness.getValue(); + Gui.drawOutline(-borderThickness, -borderThickness, bWidth + borderThickness, bHeight + borderThickness, borderThickness, this.borderColor.getColorValue()); + } + } + + if (showIcon) { + GL11.glColor3f(1.0F,1.0F,1.0F); + RenderUtil.renderEIcon(iconTexture, bHeight / 2.0f, 0, 0); + } + GL11.glEnable(GL11.GL_BLEND); + float scale = 1.0F; + if (this.mc.fontRenderer.getStringWidth(counter) > bWidth - this.padding.getFloatValue() - extraX && this.textOverflow.getValue().equals("Scale Text")) { + scale = (bWidth - this.padding.getFloatValue() - extraX) / this.mc.fontRenderer.getStringWidth(counter); + GL11.glScalef(scale, scale, 1.0F); + scale = this.mc.fontRenderer.getStringWidth(counter) / (bWidth - this.padding.getFloatValue() - extraX); + } + this.mc.fontRenderer.drawString(counter, this.width / 2.0F * scale - (float) (this.mc.fontRenderer.getStringWidth(counter) / 2) + extraX * scale / 2.0F + 0.6F, bHeight / 2.0F * scale - 3.49F, getColor(), (Boolean) this.background.getValue() ? (Boolean) this.textShadowBackground.getValue() : (Boolean) this.textShadowNoBackground.getValue()); + if (this.mc.fontRenderer.getStringWidth(counter) > bWidth) { + GL11.glScalef(scale, scale, 1.0F); + } + } else { + GL11.glEnable(GL11.GL_BLEND); + this.setDimensions((float)this.mc.fontRenderer.drawString(counter, 0.0F, 0.0F, getColor(), (Boolean) this.textShadowNoBackground.getValue()), mc.fontRenderer.FONT_HEIGHT); + } + GL11.glDisable(GL11.GL_BLEND); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/data/SimpleHudModExclusionRange.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/data/SimpleHudModExclusionRange.java new file mode 100644 index 0000000..ccbeaa1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/data/SimpleHudModExclusionRange.java @@ -0,0 +1,9 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.data; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor @Getter +public class SimpleHudModExclusionRange { + private int minValue, defValue, maxValue; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/data/SimpleHudModSize.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/data/SimpleHudModSize.java new file mode 100644 index 0000000..7d59fb9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/data/SimpleHudModSize.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.data; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor @Getter +public class SimpleHudModSize { + private float minHeight, defHeight, maxHeight, minWidth, defWidth, maxWidth; +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleClock.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleClock.java new file mode 100644 index 0000000..4645125 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleClock.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * Displays the current time. + * @see AbstractSimpleHudModule + */ +public class ModuleClock extends AbstractSimpleHudModule { + private Setting militaryFormat; + private Setting meridiem; + private Setting seconds; + + public ModuleClock() { + super("Clock", "[11:11 AM]"); + this.setDescription("Displays the current time."); + } + + public String getValueString() { + String hour = !this.militaryFormat.getBooleanValue() ? "h" : "HH"; + String minute = ":mm"; + String seconds = this.seconds.getBooleanValue() ? ":ss" : ""; + String meridiem = this.meridiem.getBooleanValue() ? !this.militaryFormat.getBooleanValue() ? " a" : "" : ""; + return new SimpleDateFormat(hour + minute + seconds + meridiem).format(new Date()); + } + + public String getLabelString() { + return "Time"; + } + + public String getDefaultFormatString() { + return "%VALUE%"; + } + + public void getExtraFormatSettings() { + this.militaryFormat = new Setting(this, "Military (24 hour) time", "Show the clock time in military time format.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.meridiem = new Setting(this, "Show Meridiem (AM/PM) Marker", "Show the AM/PM marker.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> !(Boolean) this.militaryFormat.getValue()); + this.seconds = new Setting(this, "Show Seconds", "Displays the seconds.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleFPS.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleFPS.java new file mode 100644 index 0000000..e024109 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleFPS.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModExclusionRange; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; + +/** + * Displays the player's frames per second. + * @see AbstractSimpleHudModule + */ +public class ModuleFPS extends AbstractSimpleHudModule { + public Setting minFPS; + + public ModuleFPS() { + super("FPS", "[144 FPS]"); + this.setDescription("Displays your frames per second."); + } + + public String getValueString() { + if (this.excludeArrayOptions(this.hideValue, Minecraft.debugFPS, this.hiddenValue.getIntegerValue())) { + return null; + } + return this.getPreviewString(); + } + + public String getPreviewString() { + return Minecraft.debugFPS + (this.minFPS.getBooleanValue() ? "/" + Config.getFpsMin() : ""); + } + + public String getLabelString() { + return "FPS"; + } + + public void getExtraSettings() { + this.minFPS = new Setting(this, "Show Minimum FPS").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + public SimpleHudModExclusionRange exclusionRange() { + return new SimpleHudModExclusionRange(0, 1000, 3000); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleMemoryUsage.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleMemoryUsage.java new file mode 100644 index 0000000..cc92056 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleMemoryUsage.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModExclusionRange; + +/** + * Displays how much memory the game is using. + * @see AbstractSimpleHudModule + */ +public class ModuleMemoryUsage extends AbstractSimpleHudModule { + + public ModuleMemoryUsage() { + super("Memory Usage", "[Mem: 19%]"); + setDescription("Displays how much memory the game is using."); + } + + public String getValueString() { + long memory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) * 100L / Runtime.getRuntime().maxMemory(); + if (this.excludeArrayOptions(this.hideValue, (int) memory, this.hiddenValue.getIntegerValue())) { + return null; + } + return memory + "%"; + } + + public String getPreviewString() { + return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) * 100L / Runtime.getRuntime().maxMemory() + "%"; + } + + public String getLabelString() { + return "Mem"; + } + + public String getDefaultFormatString() { + return "%LABEL%: %VALUE%"; + } + + public SimpleHudModExclusionRange exclusionRange() { + return new SimpleHudModExclusionRange(0, 50, 100); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePackDisplay.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePackDisplay.java new file mode 100644 index 0000000..1e65315 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePackDisplay.java @@ -0,0 +1,129 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModSize; +import net.minecraft.client.resources.SimpleReloadableResourceManager; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +import java.util.regex.Pattern; + +/** + * Displays the player's active Resource Pack(s). + * @see AbstractSimpleHudModule + */ +public class ModulePackDisplay extends AbstractSimpleHudModule { + // private Setting description; TODO: Set up Pack Display to show the description + private Setting zipRemover; + private Setting prefixRemover; + private Setting stripColorCodes; + + public Setting order; + private Setting rotationOrder; + private Setting rotationInterval; + + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-9A-F]"); + private final Pattern STRIP_COLOR_PATTERN2 = Pattern.compile("(?i)" + '§' + "[1-69A-E]"); + + private int ticks = 0; + public int currentPack = 0; + + + public ModulePackDisplay() { + super("Pack Display", "Default"); + this.setDescription("Displays your active Resource Pack(s)."); + this.setCreators("canelex"); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent event) { + ++this.ticks; + if (this.order.getValue().equals("Rotate")) { + if (this.ticks > this.rotationInterval.getFloatValue() * 20) { + int max = Config.getResourcePackNames().split(",").length - 1; + switch (this.rotationOrder.getStringValue()) { + case "Top-Bottom": + --this.currentPack; + if (this.currentPack < 0) { + this.currentPack = max; + } + break; + case "Bottom-Top": + ++this.currentPack; + if (this.currentPack > max) { + this.currentPack = 0; + } + break; + case "Randomized": + this.currentPack = (int)(Math.random() * (max + 1)); + } + SimpleReloadableResourceManager.updatepack(); + this.ticks = 0; + } + } + } + + @Override + public String getValueString() { + String[] packs = Config.getResourcePackNames().split(","); + String counter = packs[packs.length - 1]; + if (this.order.getValue().equals("Bottom")) { + counter = packs[0]; + } else if (this.order.getValue().equals("Rotate")) { + counter = packs[this.currentPack]; + } + if (this.zipRemover.getBooleanValue()) { + counter = counter.replace(".zip", ""); + } + if (this.prefixRemover.getBooleanValue()) { + counter = counter.substring(counter.indexOf("!") + 1).substring(counter.indexOf("#") + 1).trim(); + if (counter.substring(0, 1).contains("§") && counter.substring(2, 3).contains(" ")) { + counter = counter.replaceFirst(" ", ""); + } + + } + return !this.stripColorCodes.getValue().equals("OFF") ? stripColor(counter) : counter; + } + + @Override + public String getLabelString() { + return "Pack"; + } + + public String getDefaultFormatString() { + return "%VALUE%"; + } + + public boolean isBracketsEnabledByDefault() { + return false; + } + + public ResourceLocation getIconTexture() { + return CheatBreaker.icontexture; + } + + public SimpleHudModSize backgroundDimensionValues() { + return new SimpleHudModSize(10, 16, 64, 40, 56, 80); + } + + private String stripColor(String input) { + return input == null ? null : (this.stripColorCodes.getValue().equals("ALL") ? STRIP_COLOR_PATTERN : STRIP_COLOR_PATTERN2).matcher(input).replaceAll("§r"); + } + + public void getExtraSettings() { + this.order = new Setting(this, "Pack Order").setValue("Bottom").acceptedStringValues("Bottom", "Top", /*"All", */"Rotate").setCondition(() -> Config.getResourcePackNames().split(",").length != 1).onChange((v) -> SimpleReloadableResourceManager.updatepack()); + this.rotationOrder = new Setting(this, "Rotation Order").setValue("Top-Bottom").acceptedStringValues("Top-Bottom", "Bottom-Top", "Randomized").setCondition(() -> this.order.getValue().equals("Rotate") && Config.getResourcePackNames().split(",").length != 1); + this.rotationInterval = new Setting(this, "Rotation Interval").setValue(10.0F).setMinMax(1.0F, 60.0F).setUnit("s").setCondition(() -> this.order.getValue().equals("Rotate") && Config.getResourcePackNames().split(",").length != 1); + } + + public void getExtraFormatSettings() { + //this.description = new Setting(this, "Show description").setValue(true); + this.zipRemover = new Setting(this, "Remove zip string", "Removes the \".zip\" part of a pack name if the file is in a zip.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.prefixRemover = new Setting(this, "Remove prefixes", "Removes ! and # prefixes from a pack.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.stripColorCodes = new Setting(this, "Strip Color Formatting", "Remove all color formatting so you can set your own color.").setValue("OFF").acceptedStringValues("OFF", "Not Neutral", "ALL").setCustomizationLevel(CustomizationLevel.MEDIUM); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePing.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePing.java new file mode 100644 index 0000000..36d9194 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePing.java @@ -0,0 +1,106 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModExclusionRange; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.network.OldServerPinger; + +import java.awt.*; +import java.net.UnknownHostException; +import java.util.concurrent.TimeUnit; + +/** + * Displays the user's connected server latency. + * @see AbstractSimpleHudModule + */ +public class ModulePing extends AbstractSimpleHudModule { + private Setting refresher; + private Setting badPingRange; + private Setting hideInSingleplayer; + private Setting hideIfNoConnection; + public Setting dynamicColorRange; + + private final OldServerPinger checkPing = new OldServerPinger(); + + private long getPing; + private long pingNumber = -1L; + + + public ModulePing() { + super("Ping", "[19 ms]"); + this.setDescription("Displays your server latency."); + } + + public String getValueString() { + ServerData pingVar = mc.getCurrentServerData(); + this.getPing(pingVar); + if (pingVar != null && pingVar.pingToServer > 0L) { + this.pingNumber = pingVar.pingToServer; + } + if (this.excludeArrayOptions(this.hideValue, (int) this.pingNumber, this.hiddenValue.getIntegerValue())) { + return null; + } + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null || !(Boolean) this.hideInSingleplayer.getValue()) { + if (this.pingNumber != -1L || !(Boolean) this.hideIfNoConnection.getValue()) { + return this.pingNumber + " ms"; + } + } + return null; + } + + public String getPreviewString() { + return "119 ms"; + } + + public String getLabelString() { + return "Ping"; + } + + public String getDefaultFormatString() { + return "%VALUE%"; + } + + public int getColor() { + if ((Boolean) this.dynamicColorRange.getValue()) { + if (getValueString() != null) { + return Color.getHSBColor(Math.max((125.0F - pingNumber * 10.0F / (float)this.badPingRange.getValue()) / 360.0F, 0.0F), 1.0F, 1.0F).getRGB(); + } else { + return Color.getHSBColor(Math.max((125.0F - 119 * 10.0F / (float)this.badPingRange.getValue()) / 360.0F, 0.0F), 1.0F, 1.0F).getRGB(); + } + + } + return this.textColor.getColorValue(); + } + + public SimpleHudModExclusionRange exclusionRange() { + return new SimpleHudModExclusionRange(0, 100, 1000); + } + + public void getExtraSettings() { + this.refresher = new Setting(this, "Refresh Time", "Changes how many seconds the mod should refresh itself.").setUnit("s").setValue(15).setMinMax(10, 90).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.hideInSingleplayer = new Setting(this, "Hide in Singleplayer", "Hid the mod in Singleplayer.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.hideIfNoConnection = new Setting(this, "Hide if no connection", "Hide the mod when no connection is found.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.dynamicColorRange = new Setting(this, "Dynamic Color Range", "Determine if the text color should change dynamically based on ping amount.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.badPingRange = new Setting(this, "Bad Ping Range Threshold").setValue(25.0F).setMinMax(10.0F, 100.0F).setCondition(() -> (Boolean) this.dynamicColorRange.getValue()); + } + + private void getPing(ServerData var1) { + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null) { + if (var1 != null && System.currentTimeMillis() - this.getPing >= TimeUnit.SECONDS.toMillis((long) (Integer) this.refresher.getValue())) { + (new Thread(() -> { + try { + this.checkPing.func_147224_a(var1); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + })).start(); + this.getPing = System.currentTimeMillis(); + } + } else { + this.pingNumber = -1; + } + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePotionCounter.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePotionCounter.java new file mode 100644 index 0000000..5a516ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModulePotionCounter.java @@ -0,0 +1,60 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemSoup; + +import java.util.Arrays; +import java.util.Objects; + +/** + * Displays how many health potions/bowls of soup the user has in their inventory. + * @see AbstractSimpleHudModule + */ +public class ModulePotionCounter extends AbstractSimpleHudModule { + private Setting counter; + private Setting hideWhenEmpty; + + public ModulePotionCounter() { + super("Potion Counter", "[10 Pots]"); + this.setDescription("Displays the amount of healing potions or bowls of soup in your inventory."); + this.setCreators("Maxwell"); + } + + public String getValueString() { + if (this.excludeArrayOptions(this.hideValue, this.getItemFromPlayersInventory(), this.hiddenValue.getIntegerValue())) { + return null; + } + if (this.getItemFromPlayersInventory() == 0 && this.hideWhenEmpty.getBooleanValue()) { + return null; + } + return "" + this.getItemFromPlayersInventory(); + + } + + public String getPreviewString() { + return "10"; + } + + public String getLabelString() { + return "" + (this.getItemFromPlayersInventory() == 1 ? this.counter.getValue().toString().replaceAll("s", "") : this.counter.getValue().toString()); + } + + public void getExtraSettings() { + this.hideWhenEmpty = new Setting(this, "Hide When Empty", "Hide the mod when there are none of the selected counter item in your inventory.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.counter = new Setting(this, "Counter", "Count Healing potions or Soup.").setValue("Pots").acceptedStringValues("Pots", "Soup").setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + private int getItemFromPlayersInventory() { + final EntityClientPlayerMP player = mc.thePlayer; + if (this.counter.getValue().equals("Pots")) { + return (int) Arrays.stream(player.inventory.mainInventory).filter(Objects::nonNull).filter(item -> item.getItem() instanceof ItemPotion).filter(item -> item.getItemDamage() == 16421 | item.getItemDamage() == 16453).count(); + } else { + return (int) Arrays.stream(player.inventory.mainInventory).filter(Objects::nonNull).filter(item -> item.getItem() instanceof ItemSoup).count(); + } + + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleSaturation.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleSaturation.java new file mode 100644 index 0000000..17de754 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleSaturation.java @@ -0,0 +1,115 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModSize; +import com.cheatbreaker.client.ui.module.GuiAnchor; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Collections; +import java.util.Locale; + +/** + * Displays your current food saturation level. + * @see AbstractSimpleHudModule + */ +public class ModuleSaturation extends AbstractSimpleHudModule { + public Setting amountColors; + private Setting highestAmountColor; + private Setting highAmountColor; + private Setting mediumAmountColor; + private Setting lowAmountColor; + private Setting emptyAmountColor; + private Setting hideinCM; + private Setting trailingZeros; + private Setting decimals; + + public ModuleSaturation() { + super("Saturation"); + this.setDescription("Displays your current food saturation level."); + this.setCreators("Eum3"); + this.setDefaultAnchor(GuiAnchor.MIDDLE_BOTTOM_RIGHT); + this.setDefaultTranslations(-15.0F, -35.0F); + } + + public String level() { + double saturationLevel = mc.thePlayer.getFoodStats().getSaturationLevel(); + int dec = (Integer) decimals.getValue(); + String number = String.join("", Collections.nCopies(dec, "#")); + return !(Boolean) trailingZeros.getValue() && dec != 0 ? + new DecimalFormat("#." + number, new DecimalFormatSymbols(Locale.ENGLISH)).format(saturationLevel) : + String.format("%." + dec + "f", saturationLevel); + } + + @Override + public String getValueString() { + boolean creativeModeCheck = mc.playerController.isNotCreative() || !(Boolean) hideinCM.getValue(); + if (this.excludeArrayOptions(this.hideValue, (int) mc.thePlayer.getFoodStats().getSaturationLevel(), this.hiddenValue.getIntegerValue())) { + return null; + } + if (creativeModeCheck) { + return level(); + } + return null; + } + + public String getPreviewString() { + return level(); + } + + @Override + public String getLabelString() { + return "Saturation"; + } + + public String getDefaultFormatString() { + return "%VALUE%"; + } + + public boolean isBracketsEnabledByDefault() { + return false; + } + + public int getColor() { + double saturationLevel = mc.thePlayer.getFoodStats().getSaturationLevel(); + if ((Boolean) amountColors.getValue()) { + if (saturationLevel <= 0) { + return emptyAmountColor.getColorValue(); + } else if (saturationLevel <= 5) { + return lowAmountColor.getColorValue(); + } else if (saturationLevel <= 10) { + return mediumAmountColor.getColorValue(); + } else if (saturationLevel <= 15) { + return highAmountColor.getColorValue(); + } + return highestAmountColor.getColorValue(); + } + return textColor.getColorValue(); + } + + public void getExtraSettings() { + this.hideinCM = new Setting(this, "Hide in Creative Mode", "Hide the mod in Creative mode.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.amountColors = new Setting(this, "Color Based on Amount", "Make the text color be based off the amount of saturation levels you have.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } + + public void getExtraFormatSettings() { + this.trailingZeros = new Setting(this, "Show trailing zeros", "Show all trailing zeros.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Integer) this.decimals.getValue() != 0); + this.decimals = new Setting(this, "Decimals", "Change how many decimals the mod should display.").setValue(0).setMinMax(0, 17).setCustomizationLevel(CustomizationLevel.MEDIUM); + } + + public void getExtraColorSettings() { + this.highestAmountColor = new Setting(this, "Highest Amount Color", "The text color that will show when the saturation level is over 15.").setValue(-2097185).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.highAmountColor = new Setting(this, "High Amount Color", "The text color that will show when the saturation level is between 11-15.").setValue(-4522079).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.mediumAmountColor = new Setting(this, "Medium Amount Color", "The text color that will show when the saturation level is between 6-10.").setValue(-103).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.lowAmountColor = new Setting(this, "Low Amount Color", "The text color that will show when the saturation level is between 1-5.").setValue(-48574).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + this.emptyAmountColor = new Setting(this, "Empty Amount Color", "The text color that will show when the saturation level is empty.").setValue(-5627615).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.ADVANCED).setCondition(() -> (Boolean) this.amountColors.getValue()); + } + + @Override + public SimpleHudModSize backgroundDimensionValues() { + return new SimpleHudModSize(10, 18, 24, 18, 30, 80); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleServerAddress.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleServerAddress.java new file mode 100644 index 0000000..85f7336 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleServerAddress.java @@ -0,0 +1,62 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModSize; +import net.minecraft.util.ResourceLocation; + +/** + * Displays the address of the current connected server. + * @see AbstractSimpleHudModule + */ +public class ModuleServerAddress extends AbstractSimpleHudModule { + private Setting hideInSingleplayer; + + public ModuleServerAddress() { + super("Server Address", "[minehq.com]"); + this.setDescription("Displays the address of the current connected server."); + } + + public String getValueString() { + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null) { + return mc.currentServerData.serverIP; + } else if (!this.hideInSingleplayer.getBooleanValue()) { + return "Singleplayer"; + } + return null; + } + + public String getPreviewString() { + if (!this.mc.isSingleplayer()) { + return mc.currentServerData.serverIP; + } + return "minehq.com"; + } + + public String getLabelString() { + return "IP"; + } + + public String getDefaultFormatString() { + return "%VALUE%"; + } + + public SimpleHudModSize backgroundDimensionValues() { + return new SimpleHudModSize(10, 16, 64, 40, 56, 80); + } + + public ResourceLocation getIconTexture() { + if (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null) { + return new ResourceLocation("servers/" + getValueString() + "/icon"); + } else if (!(Boolean) hideInSingleplayer.getValue()) { + return new ResourceLocation("textures/misc/unknown_server.png"); + } + return new ResourceLocation("client/icons/servers/" + getPreviewString() + ".png"); + } + + public void getExtraSettings() { + this.hideInSingleplayer = new Setting(this, "Hide in Singleplayer", "Hides the mod in Singleplayer.").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleToggleSprint.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleToggleSprint.java new file mode 100644 index 0000000..c137da3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/ModuleToggleSprint.java @@ -0,0 +1,86 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl; + +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModSize; +import net.minecraft.MinecraftMovementInputHelper; + +/** + * Allows the user's sprint and sneak keys to be toggleable. + * @see AbstractSimpleHudModule + */ +public class ModuleToggleSprint extends AbstractSimpleHudModule { + public static Setting toggleSprint; + public static Setting toggleSneak; + public static Setting doubleTap; + public static Setting flyBoost; + private Setting flyBoostLabel; + public static Setting flyBoostAmount; + public Setting flyBoostString; + public Setting flyString; + public Setting ridingString; + public Setting decendString; + public Setting dismountString; + public Setting sneakHeldString; + public Setting sprintHeldString; + public Setting sprintVanillaString; + public Setting sprintToggledString; + public Setting sneakToggledString; + public static boolean buggedSprint = false; + + public ModuleToggleSprint() { + super("ToggleSprint", "[Sprinting (Toggled)]", 1.0F, false, false); + this.setDefaultState(false); + this.notRenderHUD = false; + this.setDescription("Makes your sprint and sneak keys toggleable."); + this.setCreators("deeznueces"); + } + + public String getValueString() { + if (!MinecraftMovementInputHelper.toggleSprintString.isEmpty()) { + return MinecraftMovementInputHelper.toggleSprintString; + } + return null; + } + + public String getPreviewString() { + return this.sprintToggledString.getValue().toString(); + } + + public String getLabelString() { + return "Sprint Status"; + } + + public String getDefaultFormatString() { + return "%VALUE%"; + } + + public SimpleHudModSize backgroundDimensionValues() { + return new SimpleHudModSize(10, 13, 24, 40, 56, 120); + } + + public void getExtraSettings() { + new Setting(this, "label").setValue("Toggle Sprint/Sneak Options").setCustomizationLevel(CustomizationLevel.MEDIUM); + toggleSprint = new Setting(this, "Toggle Sprint", "Makes sprinting toggleable instead of held down.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + toggleSneak = new Setting(this, "Toggle Sneak", "Makes sneaking toggleable instead of held down.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + doubleTap = new Setting(this, "Double Tap", "Determine if double tapping the moving forward key should make the player start sprinting.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + + this.flyBoostLabel = new Setting(this, "label").setValue("Fly Boost"); + flyBoost = new Setting(this, "Fly Boost", "Determine if pressing the sprint key should boost the fly speed.").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + flyBoostAmount = new Setting(this, "Fly Boost Amount", "Change the boost amount.").setValue(4.0F).setMinMax(1.0F, 10.0F).setUnit("x").setCondition(() -> (Boolean) flyBoost.getValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + public void getExtraFormatSettings() { + this.flyBoostString = new Setting(this, "Fly Boost String").setValue("Flying (%BOOST%x boost)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.flyString = new Setting(this, "Fly String").setValue("Flying").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.ridingString = new Setting(this, "Riding String").setValue("Riding").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.decendString = new Setting(this, "Descend String").setValue("Descending").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.dismountString = new Setting(this, "Dismount String").setValue("Dismounting").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sneakHeldString = new Setting(this, "Sneaking String").setValue("Sneaking (Key Held)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sprintHeldString = new Setting(this, "Sprinting Held String").setValue("Sprinting (Key Held)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sprintVanillaString = new Setting(this, "Sprinting Vanilla String").setValue("Sprinting (Vanilla)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sprintToggledString = new Setting(this, "Sprinting Toggle String").setValue("Sprinting (Toggled)").setCustomizationLevel(CustomizationLevel.ADVANCED); + this.sneakToggledString = new Setting(this, "Sneaking Toggle String").setValue("Sneaking (Toggled)").setCustomizationLevel(CustomizationLevel.ADVANCED); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/AbstractSimpleCombatHudModule.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/AbstractSimpleCombatHudModule.java new file mode 100644 index 0000000..306d131 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/AbstractSimpleCombatHudModule.java @@ -0,0 +1,70 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat; + +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.AbstractSimpleHudModule; + +/** + * Defines the all combat related options and methods for Combat Simple HUD Mods. + * @see AbstractSimpleHudModule + */ +public abstract class AbstractSimpleCombatHudModule extends AbstractSimpleHudModule { + public Setting customWaitingMessageBackground; + public Setting customWaitingMessageNoBackground; + protected Setting hideWhenNotAttacking; + public static long lastAttackTime; + + public AbstractSimpleCombatHudModule(String name, String previewString) { + super(name, previewString); + this.addEvent(TickEvent.class, this::onTickEvent); + } + + public void getExtraSettings() { + this.hideWhenNotAttacking = new Setting(this, "Hide When Not Attacking").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + } + + public void getExtraFormatSettings() { + this.customWaitingMessageBackground = new Setting(this, "Waiting (Background)") + .setValue(getWaitingString()) + .setCondition(this.background::getBooleanValue) + .setCustomizationLevel(CustomizationLevel.ADVANCED); + this.customWaitingMessageNoBackground = new Setting(this, "Waiting (No Background)") + .setValue(this.isBracketsEnabledByDefault() && !getWaitingString().isEmpty() ? "[" + getWaitingString() + "]" : getWaitingString()) + .setCondition(() -> !this.background.getBooleanValue()) + .setCustomizationLevel(CustomizationLevel.ADVANCED); + } + + public String getWaitingString() { + return ""; + } + + public boolean getWaitingRequirement() { + return lastAttackTime == 0L; + } + + public String getWaitingMessage() { + if (getWaitingRequirement()) { + if ((Boolean) this.background.getValue()) { + if (!(Boolean) customWaitingMessageBackground.getValue().toString().isEmpty()) { + return customWaitingMessageBackground.getValue().toString().replaceAll("%LABEL%", getLabelString()).replaceAll("%VALUE%", getValueString()); + } + } else { + if (!(Boolean) customWaitingMessageNoBackground.getValue().toString().isEmpty()) { + return customWaitingMessageNoBackground.getValue().toString().replaceAll("%LABEL%", getLabelString()).replaceAll("%VALUE%", getValueString()); + } + } + } + return null; + } + + public void onTickEvent(TickEvent event) { + if (System.currentTimeMillis() - lastAttackTime > 2000L) { + lastAttackTime = 0L; + clear(); + } + } + + public void clear() { + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleCPS.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleCPS.java new file mode 100644 index 0000000..5f1bf46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleCPS.java @@ -0,0 +1,113 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat; + +import com.cheatbreaker.client.event.impl.ClickEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.util.RenderUtil; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayDeque; +import java.util.Deque; + +/** + * Displays the user's amount of clicks per second. + * @see AbstractModule + */ +public class ModuleCPS extends AbstractSimpleCombatHudModule { + private final Deque leftCPS = new ArrayDeque<>(); + private final Deque rightCPS = new ArrayDeque<>(); + private Setting counterType; + private Setting lineColor; + private String leftClickCounter; + private String space; + private Setting preventDoubleclicks; + private boolean hasClickedThisTick = false; + + public ModuleCPS() { + super("CPS", "[9 CPS]"); + this.setDescription("Displays your clicks per second."); + this.setCreators("Fyu"); + this.addEvent(ClickEvent.class, this::onClick); + this.addEvent(TickEvent.class, this::onTick); + } + + public String getValueString() { + if (this.excludeArrayOptions(this.hideValue, leftCPS.size(), this.hiddenValue.getIntegerValue()) && this.counterType.getValue().equals("Left Clicks")) { + return null; + } + if (this.excludeArrayOptions(this.hideValue, rightCPS.size(), this.hiddenValue.getIntegerValue()) && this.counterType.getValue().equals("Right Clicks")) { + return null; + } + if (lastAttackTime != 0L || !(Boolean) this.hideWhenNotAttacking.getValue()) { + leftCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + rightCPS.removeIf((var0) -> var0 < System.currentTimeMillis() - 1000L); + leftClickCounter = !counterType.getValue().equals("Right Clicks") ? "" + leftCPS.size() : ""; + String rightClickCounter = !counterType.getValue().equals("Left Clicks") ? Integer.toString(rightCPS.size()) : ""; + space = counterType.getValue().equals("Both") ? " " : ""; + return counterType.getValue().equals("Higher") ? Math.max(leftCPS.size(), rightCPS.size()) + "" : leftClickCounter + space + rightClickCounter; + } + return null; + } + + public String getLabelString() { + return (counterType.getValue().equals("Right Clicks") || (counterType.getValue().equals("Higher") && leftCPS.size() < rightCPS.size()) ? "R" : "") + "CPS"; + } + + public String getPreviewString() { + return counterType.getValue().equals("Both") ? "9 2" : "9"; + } + + public void getExtraSettings() { + this.preventDoubleclicks = new Setting(this, "Prevent Double Clicks").setValue(false).setCondition(() -> false); + this.counterType = new Setting(this, "Counter", "Determines which and when clicks should be shown." + + "\n" + + "\n§bLeft Clicks:§r Only show left clicks." + + "\n§bRight Clicks:§r Only show right clicks." + + "\n§bBoth:§r Show both left and right clicks." + + "\n§bHigher:§r Shows either left or right clicks depending which has a higher amount.").setValue("Left Clicks").acceptedStringValues("Left Clicks", "Right Clicks", "Both", "Higher").setCustomizationLevel(CustomizationLevel.SIMPLE); + super.getExtraSettings(); + } + + public void getExtraColorSettings() { + this.lineColor = new Setting(this, "Line Color").setValue(0xFF202020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> this.counterType.getValue().equals("Both")); + } + + private void onClick(ClickEvent event) { + if (this.preventDoubleclicks.getBooleanValue() && this.hasClickedThisTick) { + event.setCanceled(true); + return; + } + + if (event.getMouseButton() == 0) { + this.hasClickedThisTick = true; + leftCPS.add(System.currentTimeMillis()); + } + if (event.getMouseButton() == 1) rightCPS.add(System.currentTimeMillis()); + } + + private void onTick(TickEvent event) { + this.hasClickedThisTick = false; + } + + public void render(String value) { + super.render(value); + this.drawRectWithShadow((this.background.getBooleanValue() ? this.customString : this.customStringNoBackground).getStringValue(), value); + } + + public void drawRectWithShadow(String total, String value) { + float lineXPos = (float) this.mc.fontRenderer.getStringWidth(StringUtils.substringBefore(total, "%VALUE%")) + (float) this.mc.fontRenderer.getStringWidth(leftClickCounter) + (this.mc.fontRenderer.getStringWidth(space) / 2.0F - 0.1F); + float lineYPos = this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue() ? this.backgroundHeight.getFloatValue() / 2.0F - 4.5F : -1.0F; + boolean shadow = this.background.getBooleanValue() ? this.textShadowBackground.getBooleanValue() : this.textShadowNoBackground.getBooleanValue(); + if (this.background.getBooleanValue() || this.alwaysCenter.getBooleanValue()) { + float first = this.width / 2.0F - (float) (this.mc.fontRenderer.getStringWidth(total.replaceAll("%LABEL%", getLabelString()).replaceAll("%VALUE%", value)) / 2); + lineXPos += first; + } + + if (this.counterType.getValue().equals("Both")) { + RenderUtil.drawRectWithShadow(lineXPos, lineYPos, lineXPos + 1.0F, lineYPos + 9.0F, this.lineColor.getColorValue(), shadow); + } + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleComboCounter.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleComboCounter.java new file mode 100644 index 0000000..8e8691b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleComboCounter.java @@ -0,0 +1,50 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat; + +import com.cheatbreaker.client.module.AbstractModule; + +import java.util.ArrayList; +import java.util.List; + +/** + * Displays how many times the user hit another entity in a row within 2 seconds. + * @see AbstractModule + */ +public class ModuleComboCounter extends AbstractSimpleCombatHudModule { + public static List hits = new ArrayList<>(); + public static long lastComboTime; + public static int lastAttacked = -1; + public static int lastCombo; + + public ModuleComboCounter() { + super("Combo Counter", "[6 Combo]"); + this.setDescription("Displays how many times you hit someone in a row within 2 seconds."); + this.setCreators("Erouax"); + } + + public String getValueString() { + if (this.excludeArrayOptions(this.hideValue, hits.size(), this.hiddenValue.getIntegerValue())) { + return null; + } + if (lastAttackTime != 0L || !(Boolean) this.hideWhenNotAttacking.getValue()) { + return hits.size() + ""; + } + return null; + } + + public String getLabelString() { + return "Combo"; + } + + public String getWaitingString() { + return "No %LABEL%"; + } + + public String getPreviewString() { + return "6"; + } + + public void clear() { + hits.clear(); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleReachDisplay.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleReachDisplay.java new file mode 100644 index 0000000..eeb97b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleReachDisplay.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.hud.simple.data.SimpleHudModExclusionRange; + +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Collections; +import java.util.Locale; + +/** + * Displays how far the user hits an entity. + * @see AbstractModule + */ +public class ModuleReachDisplay extends AbstractSimpleCombatHudModule { + private Setting trailingZeros; + private Setting decimals; + public static double lastRange; + + public ModuleReachDisplay() { + super("Reach Display", "[2.8 blocks]"); + this.setDescription("Displays how far you hit an entity."); + this.setCreators("dewgs"); + } + + public void getExtraFormatSettings() { + this.trailingZeros = new Setting(this, "Show trailing zeros", "Show all trailing zeros.").setValue(true).setCustomizationLevel(CustomizationLevel.MEDIUM).setCondition(() -> (Integer) this.decimals.getValue() != 0); + this.decimals = new Setting(this, "Decimals", "Change how many decimals the mod should display.").setValue(1).setMinMax(0, 16).setCustomizationLevel(CustomizationLevel.MEDIUM); + super.getExtraFormatSettings(); + } + + public String getValueString() { + if (this.excludeArrayOptions(this.hideValue, (int) lastRange, this.hiddenValue.getIntegerValue())) { + return null; + } + if (lastAttackTime != 0L || !(Boolean) this.hideWhenNotAttacking.getValue()) { + return (Boolean) trailingZeros.getValue() ? String.format("%." + decimals.getValue() + "f", lastRange) : new DecimalFormat("#." + String.join("", Collections.nCopies((Integer) decimals.getValue(), "#")), new DecimalFormatSymbols(Locale.ENGLISH)).format(lastRange); + } + return null; + } + + @Override + public String getLabelString() { + return "blocks"; + } + + public String getPreviewString() { + double value = 2.78003410578201503; + return (Boolean) trailingZeros.getValue() ? String.format("%." + decimals.getValue() + "f", value) : new DecimalFormat("#." + String.join("", Collections.nCopies((Integer) decimals.getValue(), "#")), new DecimalFormatSymbols(Locale.ENGLISH)).format(value); + } + + public void clear() { + lastRange = 0.0; + } + + public SimpleHudModExclusionRange exclusionRange() { + return new SimpleHudModExclusionRange(0, 2, 5); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleSprintResetCounter.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleSprintResetCounter.java new file mode 100644 index 0000000..259083f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/hud/simple/impl/combat/ModuleSprintResetCounter.java @@ -0,0 +1,108 @@ +package com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat; + +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.gui.inventory.GuiContainer; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import java.util.ArrayList; +import java.util.List; + +/** + * Displays the amount of times the user sprint resets. + * @see AbstractModule + */ +public class ModuleSprintResetCounter extends AbstractSimpleCombatHudModule { + public static List temphits = new ArrayList<>(); + public static List wTaps = new ArrayList<>(); + public static List sTaps = new ArrayList<>(); + public static long lastTapTime; + public static long lastComboTime; + public static int lastAttacked = -1; + public static int lastCombo; + private boolean pressed; + private boolean almostw; + private int keyCode; + + private Setting counterType; + private int counter; + + public ModuleSprintResetCounter() { + super("Sprint Reset Counter", "[4 WTaps]"); + this.setDescription("Displays the amount of times you sprint reset."); + this.setCreators("AgentManny"); + this.addEvent(TickEvent.class, this::onTick); + } + + public String getValueString() { + if (lastAttackTime != 0L || !(Boolean) hideWhenNotAttacking.getValue()) { + counter = this.counterType.getValue().equals("Forward") ? wTaps.size() : sTaps.size(); + return this.counterType.getValue().equals("Higher") ? (counter = Math.max(wTaps.size(), sTaps.size())) + "" : counter + ""; + } + return null; + } + + public String getLabelString() { + int name = this.keyCode; + if (this.counterType.getValue().equals("Higher")) { + if (sTaps.size() > wTaps.size()) { + name = this.mc.gameSettings.keyBindBack.getKeyCode(); + } else { + name = this.mc.gameSettings.keyBindForward.getKeyCode(); + } + } + return "" + Keyboard.getKeyName(name) + "Tap" + (counter != 1 ? "s" : ""); + } + + public String getPreviewString() { + return "4"; + } + + public void getExtraSettings() { + this.counterType = new Setting(this, "Counter").setValue("Forward").acceptedStringValues("Forward", "Backwards", "Higher"); + this.hideWhenNotAttacking = new Setting(this, "Hide When Not Attacking").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + } + + public void onTick(TickEvent event) { + int forwardKeyCode = this.mc.gameSettings.keyBindForward.getKeyCode(); + int backKeyCode = this.mc.gameSettings.keyBindBack.getKeyCode(); + this.keyCode = counterType.getValue().equals("Forward") ? forwardKeyCode : backKeyCode; + int button = (forwardKeyCode == -99 || forwardKeyCode == -100) ? ((forwardKeyCode == -99) ? 0 : 1) : -1; + int button2 = (backKeyCode == -99 || backKeyCode == -100) ? ((backKeyCode == -99) ? 0 : 1) : -1; + boolean wpressed = (mc.currentScreen == null || mc.currentScreen instanceof GuiContainer || mc.currentScreen instanceof HudLayoutEditorGui) && ((button != -1) ? Mouse.isButtonDown(button) : Keyboard.isKeyDown(forwardKeyCode)); + boolean spressed = (mc.currentScreen == null || mc.currentScreen instanceof GuiContainer || mc.currentScreen instanceof HudLayoutEditorGui) && ((button2 != -1) ? Mouse.isButtonDown(button2) : Keyboard.isKeyDown(backKeyCode)); + if (this.mc.gameSettings.keyBindForward.getIsKeyPressed() && this.mc.thePlayer.isSprinting() && temphits.size() > 0) { + if (spressed) { + sTaps.add(System.currentTimeMillis()); + temphits.clear(); + return; + } + if (wpressed && !this.pressed) { + this.pressed = true; + + if (this.almostw) wTaps.add(System.currentTimeMillis()); + this.almostw = false; + lastTapTime = System.currentTimeMillis(); + temphits.clear(); + } else if (this.pressed && !wpressed) { + this.pressed = false; + this.almostw = true; + } + } + + if (System.currentTimeMillis() - lastAttackTime > 2000L) { + lastAttackTime = 0L; + clear(); + } + } + + public void clear() { + lastTapTime = 0L; + wTaps.clear(); + sTaps.clear(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleAutoText.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleAutoText.java new file mode 100644 index 0000000..13ee35a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleAutoText.java @@ -0,0 +1,70 @@ +package com.cheatbreaker.client.module.impl.normal.misc; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +public class ModuleAutoText extends AbstractModule { + + @Setter @Getter private String activeKeybindName = ""; + public List messageCount = new ArrayList<>(); + + public final Setting command1; + public final Setting command2; + public final Setting command3; + public final Setting command4; + public final Setting command5; + public final Setting command6; + public final Setting command7; + public final Setting command8; + public final Setting command9; + public final Setting command10; + public final Setting command11; + public final Setting command12; + public final Setting command13; + public final Setting command14; + public final Setting command15; + + public List hotkeys = new ArrayList<>(); +// public int amount = 0; + + public ModuleAutoText() { + super("Auto Text"); + this.setDefaultState(false); + this.setPreviewLabel("Auto Text", 1.0F); + + this.command1 = new Setting(this,"Hotkey 1").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command2 = new Setting(this,"Hotkey 2").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command3 = new Setting(this,"Hotkey 3").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command4 = new Setting(this,"Hotkey 4").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command5 = new Setting(this,"Hotkey 5").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command6 = new Setting(this,"Hotkey 6").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command7 = new Setting(this,"Hotkey 7").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command8 = new Setting(this,"Hotkey 8").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command9 = new Setting(this,"Hotkey 9").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command10 = new Setting(this,"Hotkey 10").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command11 = new Setting(this,"Hotkey 11").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command12 = new Setting(this,"Hotkey 12").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command13 = new Setting(this,"Hotkey 13").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command14 = new Setting(this,"Hotkey 14").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.command15 = new Setting(this,"Hotkey 15").setValue("/Command").setKeyCode(0).setMouseBind(false); + this.hotkeys.addAll(this.getSettingsList()); + +// addOne(); + } + + /* + * If we figure out how to update the options menu when this is pressed, we will add this in. + * For now, there's 15 preset ones. + * :( - Nox + */ +// public void addOne() { +// Setting setting = new Setting(this,"Command " + (amount + 1) + " String").setValue("/Command").setKeyCode(0); +// this.hotkeys.put(setting, amount); +// amount++; +// } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleNickHider.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleNickHider.java new file mode 100644 index 0000000..dfe480c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/misc/ModuleNickHider.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.module.impl.normal.misc; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; + +public class ModuleNickHider extends AbstractModule { + + public Setting hideRealName; + public Setting customNameString; + + public Setting hideSkin; + public Setting hideOtherSkins; + + public ModuleNickHider() { + super("Nick Hider"); + + new Setting(this, "label").setValue("Skin Options"); + this.hideSkin = new Setting(this, "Hide Own Skin").setValue(false); + this.hideOtherSkins = new Setting(this, "Hide Other Skins").setValue(false); + + new Setting(this, "label").setValue("Name Options"); + this.hideRealName = new Setting(this, "Hide Real Name").setValue(false); + this.customNameString = new Setting(this, "Custom Name String").setValue(Minecraft.getMinecraft().getSession().getUsername()).setCondition(() -> this.hideRealName.getBooleanValue()); + + this.setPreviewLabel("Nick Hider", 1.5F); + this.setDescription("Hides your identity client-sided."); + this.setCreators("Sk1er"); + this.setDefaultState(false); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleDragToLook.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleDragToLook.java new file mode 100644 index 0000000..030e68f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleDragToLook.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.module.impl.normal.perspective; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.TickEvent; +import net.minecraft.client.Minecraft; + +public class ModuleDragToLook { + private final Minecraft mc = Minecraft.getMinecraft(); + private final CheatBreaker cb = CheatBreaker.getInstance(); + public boolean enabled = false; + public float rotationYaw; + public float prevRotationYaw; + public float rotationPitch; + public float prevRotationPitch; + private int thirdPersonView; + + public ModuleDragToLook() { + this.cb.getEventBus().addEvent(TickEvent.class, tickEvent -> { + if (this.cb.getModuleManager().perspectiveMod.toggleDragToLook.getBooleanValue()) { + if (this.enabled && this.cb.getGlobalSettings().keyBindDragToLook.isPressed()) { + this.tick(); + } + } else{ + if (this.enabled && !this.cb.getGlobalSettings().keyBindDragToLook.getIsKeyPressed()) { + this.tick(); + } + } + + }); + } + + public void toggle() { + if (this.cb.getModuleManager().perspectiveMod.isEnabled()) { + this.rotationYaw = this.mc.thePlayer.rotationYaw; + this.rotationPitch = this.mc.thePlayer.rotationPitch; + this.prevRotationYaw = this.mc.thePlayer.prevRotationYaw; + this.prevRotationPitch = this.mc.thePlayer.prevRotationPitch; + this.thirdPersonView = this.mc.gameSettings.thirdPersonView; + switch (this.cb.getModuleManager().perspectiveMod.lookView.getStringValue()) { + case "Third": + this.mc.gameSettings.thirdPersonView = 1; + break; + case "Reverse": + this.mc.gameSettings.thirdPersonView = 2; + break; + default: + this.mc.gameSettings.thirdPersonView = 0; + } + this.enabled = true; + } + } + + public void tick() { + this.mc.gameSettings.thirdPersonView = this.thirdPersonView; + this.enabled = false; + } + + public void setAngles(float x, float y) { + float pitch = this.rotationPitch; + float yaw = this.rotationYaw; + this.rotationYaw = (float)((double)this.rotationYaw + (this.cb.getModuleManager().perspectiveMod.invertYaw.getBooleanValue() ? (double)-x : (double)x) * 0.15); + this.rotationPitch = (float)((double)this.rotationPitch - (this.cb.getModuleManager().perspectiveMod.invertPitch.getBooleanValue() ? (double)-y : (double)y) * 0.15); + if (this.cb.getModuleManager().perspectiveMod.pitchLock.getBooleanValue()) { + if (this.rotationPitch < (float)-90) { + this.rotationPitch = -90; + } + if (this.rotationPitch > (float)90) { + this.rotationPitch = 90; + } + } + this.prevRotationPitch += this.rotationPitch - pitch; + this.prevRotationYaw += this.rotationYaw - yaw; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModulePerspective.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModulePerspective.java new file mode 100644 index 0000000..0b7f1a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModulePerspective.java @@ -0,0 +1,117 @@ +package com.cheatbreaker.client.module.impl.normal.perspective; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModulePerspective extends AbstractModule { + private final Setting thirdPersonOptionsLabel; + public Setting toggleFrontCamera; + public Setting toggleBackCamera; +// public Setting keyBindBackCamera; +// public Setting keyBindFrontCamera; + + private final Setting dragToLookOptionsLabel; + public Setting lookView; + public Setting toggleDragToLook; + public Setting pitchLock; + public Setting invertPitch; + public Setting invertYaw; +// public Setting keyBindDragToLook; + + private final Setting viewBobbingOptionsLabel; + public Setting bobScreen; + public Setting bobHand; + public Setting bobHandWhileHoldingMap; + public Setting bobWhileSprinting; + public Setting screenBobbingIntensity; + public Setting handBobbingIntensity; + + private final Setting cameraOptionsLabel; + public Setting damageAffectsCamera; + public Setting hurtCameraIntensity; + + public Setting staticSwiftness; + //public Setting defaultFOV; + public Setting aimingMultiplier; + + private float prevValue = 0.0F; + + public ModulePerspective() { + super("Perspective"); + this.setDescription("Allows you to change how your perspective looks."); + this.setDefaultState(true); + this.setPreviewLabel("Perspective", 1.0F); + this.thirdPersonOptionsLabel = new Setting(this, "label").setValue("Third Person Options"); + this.toggleBackCamera = new Setting(this, "Toggle Back Camera", "Make the back camera keybind toggled instead of held.").setValue(false); + this.toggleFrontCamera = new Setting(this, "Toggle Front Camera", "Make the front camera keybind toggled instead of held.").setValue(false); +// this.keyBindBackCamera = new Setting(this, "Back Camera Keybind", "The key to use the Back Camera.").setValue(0); +// this.keyBindFrontCamera = new Setting(this, "Front Camera Keybind", "The key to use the Front Camera.").setValue(0); + + this.dragToLookOptionsLabel = new Setting(this, "label").setValue("Drag to Look Options"); + this.lookView = new Setting(this, "Look View", "Change which perspective mode to use when toggling Drag to Look.").setValue("Third").acceptedStringValues("Third", "Reverse", "First"); + this.toggleDragToLook = new Setting(this, "Toggle Drag to Look", "Make the Drag to Look keybind toggled instead of held.").setValue(false); + this.pitchLock = new Setting(this, "Pitch Lock", "Toggle the pitch axis limitation.").setValue(true); + this.invertPitch = new Setting(this, "Invert Pitch (Up and Down)", "Invert the rotation pitch when moving the camera.").setValue(false); + this.invertYaw = new Setting(this, "Invert Yaw (Left and Right)", "Invert the rotation yaw when moving the camera.").setValue(false); +// this.keyBindDragToLook = new Setting(this, "Drag to Look Keybind", "The key to use Drag to Look.").setValue(Keyboard.KEY_LMENU); + + this.viewBobbingOptionsLabel = new Setting(this, "label").setValue("View Bobbing Options"); + this.bobScreen = new Setting(this, "Bob Screen", "Bob the camera screen when moving.").setValue(true); + this.bobHand = new Setting(this, "Bob Hand", "Bob the hand when moving.").setValue(true); + this.bobWhileSprinting = new Setting(this, "Bob Only While Sprinting", "Bob the hand only when sprinting.").setValue("OFF").acceptedStringValues("OFF", "ON", "Only Hand", "Only Screen"); + this.screenBobbingIntensity = new Setting(this, "Screen Bobbing Intensity").setUnit("%").setValue(100.0F).setMinMax(0.0F, 200.0F); + this.handBobbingIntensity = new Setting(this, "Hand Bobbing Intensity").setUnit("%").setValue(100.0F).setMinMax(0.0F, 200.0F); + + this.cameraOptionsLabel = new Setting(this, "label").setValue("Camera Options"); + this.damageAffectsCamera = new Setting(this, "Damage affects camera").setValue(true).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.hurtCameraIntensity = new Setting(this, "Hurt Camera Intensity").setUnit("%").setValue(14.0F).setMinMax(5.0F, 35.0F).setCondition(() -> this.damageAffectsCamera.getBooleanValue()); + // fov changer + this.staticSwiftness = new Setting(this, "Static Swiftness", "Determines if your FOV changes as you move.").setValue(false); + //this.defaultFOV = new Setting(this, "Default FOV").setUnit(" FOV").setValue(30).setMinMax(30, 110); + this.aimingMultiplier = new Setting(this, "Aiming Multiplier").setUnit("x").setValue(0.15F).setMinMax(0.15F, 0.75F); + } + + /** + * Setups all the GL settings for view bobbing. Args: partialTickTime + */ + public void setupViewBobbing(float par1, Setting bobElement) { + if (this.mc.renderViewEntity instanceof EntityPlayer && bobElement.getBooleanValue()) { + EntityPlayer var2 = (EntityPlayer)this.mc.renderViewEntity; + + boolean sprintingToggleCriteria = this.bobWhileSprinting.getValue().equals("Only Screen"); + float intensity = this.screenBobbingIntensity.getFloatValue() / 100.0F; + if (bobElement == this.bobHand) { + sprintingToggleCriteria = this.bobWhileSprinting.getValue().equals("Only Hand"); + intensity = this.handBobbingIntensity.getFloatValue() / 100.0F; + } + + float var3 = var2.distanceWalkedModified - var2.prevDistanceWalkedModified; + float var4 = -(var2.distanceWalkedModified + var3 * par1); + float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * par1; + float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * par1; + + float var22 = this.bobWhileSprinting.getValue().equals("ON") || sprintingToggleCriteria ? this.prevValue : var5; + if (this.bobWhileSprinting.getValue().equals("ON") || sprintingToggleCriteria) { + if (var2.isSprinting()) { + this.prevValue = var5; + } else { + this.prevValue -= 0.00009; + } + + if (this.prevValue < 0.0F) { + return; + } + + } + + GL11.glTranslatef(MathHelper.sin(var4 * (float)Math.PI) * var22 * 0.5F * intensity, -Math.abs(MathHelper.cos(var4 * (float)Math.PI) * var22 * intensity), 0.0F); + GL11.glRotatef(MathHelper.sin(var4 * (float)Math.PI) * var22 * 3.0F * intensity, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(Math.abs(MathHelper.cos(var4 * (float)Math.PI - 0.2F) * var22) * 5.0F * intensity, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var6, 1.0F, 0.0F, 0.0F); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleSnapLook.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleSnapLook.java new file mode 100644 index 0000000..f2493b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/perspective/ModuleSnapLook.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.module.impl.normal.perspective; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.TickEvent; +import net.minecraft.client.Minecraft; + +public class ModuleSnapLook { + private final Minecraft mc = Minecraft.getMinecraft(); + private final CheatBreaker cb = CheatBreaker.getInstance(); + public boolean enabled = false; + public float rotationYaw; + public float prevRotationYaw; + public float rotationPitch; + public float prevRotationPitch; + private int thirdPersonView; + private int mode; + + public ModuleSnapLook() { + this.cb.getEventBus().addEvent(TickEvent.class, tickEvent -> { + if ((this.mode == 1 && this.cb.getModuleManager().perspectiveMod.toggleBackCamera.getBooleanValue()) || (this.mode == 2 && this.cb.getModuleManager().perspectiveMod.toggleFrontCamera.getBooleanValue())) { + if (this.enabled && (this.cb.getGlobalSettings().keyBindBackLook.isPressed() || this.cb.getGlobalSettings().keyBindFrontLook.isPressed())) { + this.tick(); + } + } else { + if (this.enabled && !this.cb.getGlobalSettings().keyBindBackLook.getIsKeyPressed() && !this.cb.getGlobalSettings().keyBindFrontLook.getIsKeyPressed()) { + this.tick(); + } + } + }); + } + + public void toggle(int mode) { + if (this.cb.getModuleManager().perspectiveMod.isEnabled()) { + this.rotationYaw = this.mc.thePlayer.rotationYaw; + this.rotationPitch = this.mc.thePlayer.rotationPitch; + this.prevRotationYaw = this.mc.thePlayer.prevRotationYaw; + this.prevRotationPitch = this.mc.thePlayer.prevRotationPitch; + this.thirdPersonView = this.mc.gameSettings.thirdPersonView; + if (mode == 1) { + this.mc.gameSettings.thirdPersonView = 1; + } else { + this.mc.gameSettings.thirdPersonView = 2; + } + this.enabled = true; + this.mode = mode; + } + } + + public void tick() { + this.mc.gameSettings.thirdPersonView = this.thirdPersonView; + this.enabled = false; + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleColorSaturation.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleColorSaturation.java new file mode 100644 index 0000000..66178b9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleColorSaturation.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.module.impl.normal.shader; + +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.google.common.base.Throwables; +import net.minecraft.client.Minecraft; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; + +public class ModuleColorSaturation extends AbstractModule { + + + public ModuleColorSaturation() { + super("Color Saturation"); + this.setDefaultState(false); + + /* + * Insert Settings here. + */ + + this.setPreviewLabel("Color Saturation", 1.1F); + this.setDescription("Allows you to adjust the hue, saturation, brightness, and contrast of your screen."); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent event) { + if (this.mc.currentScreen == null && !this.mc.entityRenderer.isShaderActive()) { + this.drawShader(); + } + } + + private void drawShader() { + this.mc.entityRenderer.loadMotionBlurShader(); + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive() && this.mc.thePlayer != null) { + for (Shader shader : shaderGroup.getShaders()) { + /* + * Insert code here. + */ + } + } + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleContainerBlur.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleContainerBlur.java new file mode 100644 index 0000000..9717801 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleContainerBlur.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.module.impl.normal.shader; + +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.google.common.base.Throwables; +import net.minecraft.client.Minecraft; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; + +public class ModuleContainerBlur extends AbstractModule { + + + public ModuleContainerBlur() { + super("Container Blur"); + this.setDefaultState(false); + + /* + * Insert Settings here. + */ + + this.setPreviewLabel("Container Blur", 1.1F); + this.setDescription("Adds a blur to containers."); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent event) { + if (this.mc.currentScreen == null && !this.mc.entityRenderer.isShaderActive()) { + this.drawShader(); + } + } + + private void drawShader() { + this.mc.entityRenderer.loadMotionBlurShader(); + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive() && this.mc.thePlayer != null) { + for (Shader shader : shaderGroup.getShaders()) { + /* + * Insert code here. + */ + } + } + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleMotionBlur.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleMotionBlur.java new file mode 100644 index 0000000..d90ebf0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/shader/ModuleMotionBlur.java @@ -0,0 +1,60 @@ +package com.cheatbreaker.client.module.impl.normal.shader; + +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.google.common.base.Throwables; +import net.minecraft.client.Minecraft; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderUniform; +import net.minecraft.util.ResourceLocation; + +public class ModuleMotionBlur extends AbstractModule { + private final Setting amount; + private final Setting color; + public Setting oldBlur; + + public ModuleMotionBlur() { + super("Motion Blur"); + this.setDefaultState(false); + this.oldBlur = new Setting(this, "Old Blur", "Revert to the previously used motion blur shader.").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.amount = new Setting(this, "Amount", "Change the amount of blur intensity.").setValue(10.0F).setMinMax(0.01F, 100.0F).setUnit("%").setCustomizationLevel(CustomizationLevel.SIMPLE); + this.color = new Setting(this, "Color", "Change the color of the motion blur.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCustomizationLevel(CustomizationLevel.SIMPLE).setCondition(() -> (Boolean) this.oldBlur.getValue()); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/swordblur.png"), 40, 40); + this.setDescription("Adds a shader to blur your surroundings while moving."); + this.setCreators("Fyu (Original)", "Moonsworth LLC (Newer shader)"); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent tickEvent) { + if (this.mc.currentScreen == null && !this.mc.entityRenderer.isShaderActive()) { + this.drawShader(); + } + } + + private void drawShader() { + this.mc.entityRenderer.loadMotionBlurShader(); + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive() && this.mc.thePlayer != null) { + for (Shader shader : shaderGroup.getShaders()) { + ShaderUniform uniform = shader.getShaderManager().func_147991_a("Phosphor"); + if (uniform == null) continue; + float amount = 1.0f - this.amount.getFloatValue() / 100.0F * 0.9F; + if (this.oldBlur.getBooleanValue()) { + amount = 0.7F + this.amount.getFloatValue() / 1000.0F * 3.0F - 0.01F; + } + int color = this.oldBlur.getBooleanValue() ? this.color.getColorValue() : -1; + float red = (float)(color >> 16 & 0xFF) / 255.0F; + float green = (float)(color >> 8 & 0xFF) / 255.0F; + float blue = (float)(color & 0xFF) / 255.0F; + uniform.func_148095_a(amount * red, amount * green, amount * blue); + } + } + } catch (IllegalArgumentException e) { + Throwables.propagate(e); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleBlockOverlay.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleBlockOverlay.java new file mode 100644 index 0000000..85428e6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleBlockOverlay.java @@ -0,0 +1,240 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.src.Config; +import net.minecraft.src.GlStateManager; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import shadersmod.client.Shaders; + +public class ModuleBlockOverlay extends AbstractModule { + public Setting outline; + public Setting overlay; + public Setting outlineColor; + public Setting overlayColor; + public Setting lineWidth; + public Setting gap; + public Setting depthless; + public Setting hidePlants; + + public ModuleBlockOverlay() { + super("Block Overlay"); + this.setDefaultState(true); + new Setting(this, "label").setValue("General Options"); + this.outline = new Setting(this, "Outline").setValue("Full").acceptedStringValues("OFF", "Full"); + this.overlay = new Setting(this, "Overlay").setValue("OFF").acceptedStringValues("OFF", "Full"); + this.lineWidth = new Setting(this, "Line Width").setValue(2.0F).setMinMax(1.0F, 10.0F).setCondition(() -> !(Boolean) this.outline.getValue().equals("OFF")); + this.gap = new Setting(this, "Gap").setValue(1.0F).setMinMax(1.0f, 10.0f); + this.depthless = new Setting(this, "Render without Depth").setValue(false); + this.hidePlants = new Setting(this, "Hide Plants").setValue(false); + new Setting(this, "label").setValue("Color Options").setCondition(() -> !(Boolean) this.outline.getValue().equals("OFF") || !(Boolean) this.overlay.getValue().equals("OFF")); + this.outlineColor = new Setting(this, "Outline Color").setValue(1711276032).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.outline.getValue().equals("OFF")); + this.overlayColor = new Setting(this, "Overlay Color").setValue(1056964608).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.overlay.getValue().equals("OFF")); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/overlay.png"), 36, 40); + this.setDescription("Replace the Vanilla outline with a customizable outline and overlay."); + this.setCreators("aycy"); + } + + /** + * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime + * @author Tellinq + */ + public void drawSelectionBox(EntityPlayer par1EntityPlayer, MovingObjectPosition par2MovingObjectPosition, int par3, float par4, WorldClient wc) { + if (par3 == 0 && par2MovingObjectPosition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth((Float)this.lineWidth.getValue()); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GL11.glDepthMask(false); + if ((Boolean) this.depthless.getValue()) { + GlStateManager.disableDepth(); + } + int getOutlineColor = this.outlineColor.getColorValue(); + int getOverlayColor = this.overlayColor.getColorValue(); + + float outlineA = (float)(getOutlineColor >> 24 & 255) / 255.0F; + float outlineR = (float)(getOutlineColor >> 16 & 255) / 255.0F; + float outlineG = (float)(getOutlineColor >> 8 & 255) / 255.0F; + float outlineB = (float)(getOutlineColor & 255) / 255.0F; + float overlayA = (float)(getOverlayColor >> 24 & 255) / 255.0F; + float overlayR = (float)(getOverlayColor >> 16 & 255) / 255.0F; + float overlayG = (float)(getOverlayColor >> 8 & 255) / 255.0F; + float overlayB = (float)(getOverlayColor & 255) / 255.0F; + float var5 = (Float)this.gap.getValue() * 0.002f; + Block var6 = wc.getBlock(par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ); + boolean hidePlants = var6.getMaterial() != Material.plants && var6.getMaterial() != Material.vine || !(Boolean) this.hidePlants.getValue(); + if (var6.getMaterial() != Material.air && hidePlants) { + var6.setBlockBoundsBasedOnState(wc, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ); + double var7 = par1EntityPlayer.lastTickPosX + (par1EntityPlayer.posX - par1EntityPlayer.lastTickPosX) * (double)par4; + double var9 = par1EntityPlayer.lastTickPosY + (par1EntityPlayer.posY - par1EntityPlayer.lastTickPosY) * (double)par4; + double var11 = par1EntityPlayer.lastTickPosZ + (par1EntityPlayer.posZ - par1EntityPlayer.lastTickPosZ) * (double)par4; + if (!this.outline.getValue().equals("OFF")) { + GL11.glColor4f(outlineR, outlineG, outlineB, outlineA); + drawOutlinedBoundingBox(var6.getSelectedBoundingBoxFromPool(wc, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ).expand((double)var5, (double)var5, (double)var5).getOffsetBoundingBox(-var7, -var9, -var11), -1); + } + if (!this.overlay.getValue().equals("OFF")) { + GL11.glColor4f(overlayR, overlayG, overlayB, overlayA); + drawOverlayedBoundingBox(var6.getSelectedBoundingBoxFromPool(wc, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ).expand((double)var5, (double)var5, (double)var5).getOffsetBoundingBox(-var7, -var9, -var11), -1); + } + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + GlStateManager.enableDepth(); + GL11.glDisable(GL11.GL_BLEND); + } + } + + /** + * Draws lines for the edges of the bounding box. + * @author Mojang + */ + public static void drawOutlinedBoundingBox(AxisAlignedBB p_147590_0_, int p_147590_1_) { + Tessellator t = Tessellator.instance; + t.startDrawing(3); + + if (p_147590_1_ != -1) { + t.setColorOpaque_I(p_147590_1_); + } + + t.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.maxZ); + t.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.maxZ); + t.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + t.draw(); + t.startDrawing(3); + + if (p_147590_1_ != -1) { + t.setColorOpaque_I(p_147590_1_); + } + + t.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.maxZ); + t.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.maxZ); + t.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + t.draw(); + t.startDrawing(1); + + if (p_147590_1_ != -1) { + t.setColorOpaque_I(p_147590_1_); + } + + t.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.minZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.maxZ); + t.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.maxZ); + t.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.maxZ); + t.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.maxZ); + t.draw(); + } + + /** + * Draws rectangles around the bounding box. + * @author Tellinq + */ + public static void drawOverlayedBoundingBox(AxisAlignedBB var0, int var1) { + Tessellator t = Tessellator.instance; + t.startDrawing(7); + if (var1 != -1) { + t.setColorOpaque_I(var1); + } + t.addVertex(var0.minX, var0.minY, var0.minZ); + t.addVertex(var0.minX, var0.maxY, var0.minZ); + t.addVertex(var0.maxX, var0.minY, var0.minZ); + t.addVertex(var0.maxX, var0.maxY, var0.minZ); + t.addVertex(var0.maxX, var0.minY, var0.maxZ); + t.addVertex(var0.maxX, var0.maxY, var0.maxZ); + t.addVertex(var0.minX, var0.minY, var0.maxZ); + t.addVertex(var0.minX, var0.maxY, var0.maxZ); + t.draw(); + t.startDrawing(7); + if (var1 != -1) { + t.setColorOpaque_I(var1); + } + t.addVertex(var0.maxX, var0.maxY, var0.minZ); + t.addVertex(var0.maxX, var0.minY, var0.minZ); + t.addVertex(var0.minX, var0.maxY, var0.minZ); + t.addVertex(var0.minX, var0.minY, var0.minZ); + t.addVertex(var0.minX, var0.maxY, var0.maxZ); + t.addVertex(var0.minX, var0.minY, var0.maxZ); + t.addVertex(var0.maxX, var0.maxY, var0.maxZ); + t.addVertex(var0.maxX, var0.minY, var0.maxZ); + t.draw(); + t.startDrawing(7); + if (var1 != -1) { + t.setColorOpaque_I(var1); + } + t.addVertex(var0.minX, var0.maxY, var0.minZ); + t.addVertex(var0.maxX, var0.maxY, var0.minZ); + t.addVertex(var0.maxX, var0.maxY, var0.maxZ); + t.addVertex(var0.minX, var0.maxY, var0.maxZ); + t.addVertex(var0.minX, var0.maxY, var0.minZ); + t.addVertex(var0.minX, var0.maxY, var0.maxZ); + t.addVertex(var0.maxX, var0.maxY, var0.maxZ); + t.addVertex(var0.maxX, var0.maxY, var0.minZ); + t.draw(); + t.startDrawing(7); + if (var1 != -1) { + t.setColorOpaque_I(var1); + } + t.addVertex(var0.minX, var0.minY, var0.minZ); + t.addVertex(var0.maxX, var0.minY, var0.minZ); + t.addVertex(var0.maxX, var0.minY, var0.maxZ); + t.addVertex(var0.minX, var0.minY, var0.maxZ); + t.addVertex(var0.minX, var0.minY, var0.minZ); + t.addVertex(var0.minX, var0.minY, var0.maxZ); + t.addVertex(var0.maxX, var0.minY, var0.maxZ); + t.addVertex(var0.maxX, var0.minY, var0.minZ); + t.draw(); + t.startDrawing(7); + if (var1 != -1) { + t.setColorOpaque_I(var1); + } + t.addVertex(var0.minX, var0.minY, var0.minZ); + t.addVertex(var0.minX, var0.maxY, var0.minZ); + t.addVertex(var0.minX, var0.minY, var0.maxZ); + t.addVertex(var0.minX, var0.maxY, var0.maxZ); + t.addVertex(var0.maxX, var0.minY, var0.maxZ); + t.addVertex(var0.maxX, var0.maxY, var0.maxZ); + t.addVertex(var0.maxX, var0.minY, var0.minZ); + t.addVertex(var0.maxX, var0.maxY, var0.minZ); + t.draw(); + t.startDrawing(7); + if (var1 != -1) { + t.setColorOpaque_I(var1); + } + t.addVertex(var0.minX, var0.maxY, var0.maxZ); + t.addVertex(var0.minX, var0.minY, var0.maxZ); + t.addVertex(var0.minX, var0.maxY, var0.minZ); + t.addVertex(var0.minX, var0.minY, var0.minZ); + t.addVertex(var0.maxX, var0.maxY, var0.minZ); + t.addVertex(var0.maxX, var0.minY, var0.minZ); + t.addVertex(var0.maxX, var0.maxY, var0.maxZ); + t.addVertex(var0.maxX, var0.minY, var0.maxZ); + t.draw(); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleCrosshair.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleCrosshair.java new file mode 100644 index 0000000..709677a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleCrosshair.java @@ -0,0 +1,123 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.OpenGlHelper; +import org.lwjgl.opengl.GL11; + +public class ModuleCrosshair extends AbstractModule { + public Setting crosshairPreviewLabel; + public Setting previewBackground; + public Setting generalOptionsLabel; + + public Setting usePackCrosshair; + public Setting outline; + public Setting dot; + public Setting thickness; + public Setting outlineThickness; + public Setting size; + public Setting gap; + public Setting dotSize; + + public Setting colorOptionsLabel; + public Setting vanillaBlending; + public Setting crosshairColor; + public Setting dotColor; + public Setting outlineColor; + + public ModuleCrosshair() { + super("Crosshair", "Normal"); + this.setDefaultState(false); + this.crosshairPreviewLabel = new Setting(this, "label").setValue("Crosshair Preview"); + this.previewBackground = new Setting(this, "Preview Background", "Change the preview background to see what the crosshair can look like in multiple environments.").setValue("Birch").acceptedStringValues("Birch", "Roofed", "Swamp", "Hills", "Desert", "Mesa", "Nether", "Sky"); + + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options"); + this.usePackCrosshair = new Setting(this, "Use Pack Crosshair").setValue(false); + this.outline = new Setting(this, "Outline", "Add an outline around the crosshair.").setValue(false).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.dot = new Setting(this, "Dot").setValue(false).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.thickness = new Setting(this, "Thickness", "Change the thickness of the crosshair.").setValue(2.0F).setMinMax(0.5F, 3.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.outlineThickness = new Setting(this, "Outline Thickness", "Change the outline thickness of the crosshair.").setValue(0.5F).setMinMax(0.5F, 3.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.outline.getValue()); + this.size = new Setting(this, "Size", "Change the size of the crosshair.").setValue(4.0F).setMinMax(1.0F, 10.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.gap = new Setting(this, "Gap", "Change how distant the cross is from the center.").setValue(2.0F).setMinMax(1.0F, 7.5F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue()); + this.dotSize = new Setting(this, "Dot Size", "Change the size of the dot.").setValue(1.0F).setMinMax(0.5F, 3.0F).setUnit("px").setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.dot.getValue()); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options"); + this.vanillaBlending = new Setting(this, "Vanilla Blending", "Make the crosshair's color invert depending on what you are looking at.").setValue(true); + this.crosshairColor = new Setting(this, "Crosshair Color", "Change the color of the crosshair.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE); + this.dotColor = new Setting(this, "Dot Color", "Change the color of the crosshair dot.").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.dot.getValue()); + this.outlineColor = new Setting(this, "Outline Color", "Change the color of the crosshair outline.").setValue(0xAF000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> !(Boolean) this.usePackCrosshair.getValue() && (Boolean) this.outline.getValue()); + this.setDescription("Replace the Vanilla crosshair with your own custom crosshair."); + } + + public void drawCrosshair(float x, float y, boolean scale) { + GL11.glPushMatrix(); + float var15 = (float) this.scale.getValue(); + if (scale) { + if (!this.guiScale.getValue().equals("Global")) { + switch ((String) this.guiScale.getValue()) { + case "Small": + var15 = var15 * 0.5F / CheatBreaker.getScaleFactor(); + break; + case "Normal": + var15 = var15 / CheatBreaker.getScaleFactor(); + break; + case "Large": + var15 = var15 * 1.5F / CheatBreaker.getScaleFactor(); + break; + case "Auto": + var15 = var15 * 2.0F / CheatBreaker.getScaleFactor(); + } + } else { + var15 = var15 * this.masterScale(); + } + } + float x2 = x / var15; + float y2 = y / var15; + GL11.glScalef(var15, var15, var15); + float size = this.size.getFloatValue(); + float gap = this.gap.getFloatValue(); + float thickness = this.thickness.getFloatValue(); + float outlineThickness = this.outlineThickness.getFloatValue(); + float dotSize = this.dotSize.getFloatValue(); + int color = this.crosshairColor.getColorValue(); + boolean outlineEnabled = this.outline.getBooleanValue(); + GL11.glColor4f((color >> 16 & 255) / 255.0f, (color >> 8 & 255) / 255.0f, (color & 255) / 255.0f, (color >> 24 & 255) / 255.0f); + this.mc.getTextureManager().bindTexture(Gui.icons); +// GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + if ((boolean) this.usePackCrosshair.getValue()) { + if ((boolean) this.vanillaBlending.getValue()) { + OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + } else { + OpenGlHelper.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + } + Gui.drawTexturedModalRect(x2 - 7, y2 - 7, 0, 0, 16, 16); + } else { + if ((boolean) this.vanillaBlending.getValue()) { + OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + } + if ((Boolean) this.dot.getValue()) { + RenderUtil.drawRoundedRect(x2 - dotSize, y2 - dotSize, x2 + dotSize, y2 + dotSize, 0.0, color); + } + RenderUtil.drawRoundedRect(x2 - gap - size, y2 - thickness / 2.0f, x2 - gap, y2 + thickness / 2.0f, 0.0, color); + RenderUtil.drawRoundedRect(x2 + gap, y2 - thickness / 2.0f, x2 + gap + size, y2 + thickness / 2.0f, 0.0, color); + RenderUtil.drawRoundedRect(x2 - thickness / 2.0f, y2 - gap - size, x2 + thickness / 2.0f, y2 - gap, 0.0, color); + RenderUtil.drawRoundedRect(x2 - thickness / 2.0f, y2 + gap, x2 + thickness / 2.0f, y2 + gap + size, 0.0, color); + if (outlineEnabled) { + Gui.drawBoxWithOutLine(x2 - gap - size, y2 - thickness / 2.0f, x2 - gap, y2 + thickness / 2.0f, outlineThickness, this.outlineColor.getColorValue(), 0); + Gui.drawBoxWithOutLine(x2 + gap, y2 - thickness / 2.0f, x2 + gap + size, y2 + thickness / 2.0f, outlineThickness, this.outlineColor.getColorValue(), 0); + Gui.drawBoxWithOutLine(x2 - thickness / 2.0f, y2 - gap - size, x2 + thickness / 2.0f, y2 - gap, outlineThickness, this.outlineColor.getColorValue(), 0); + Gui.drawBoxWithOutLine(x2 - thickness / 2.0f, y2 + gap, x2 + thickness / 2.0f, y2 + gap + size, outlineThickness, this.outlineColor.getColorValue(), 0); + if ((Boolean) this.dot.getValue()) { + Gui.drawBoxWithOutLine(x2 - dotSize, y2 - dotSize, x2 + dotSize, y2 + dotSize, outlineThickness, this.outlineColor.getColorValue(), 0); + } + } + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glPopMatrix(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnchantmentGlint.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnchantmentGlint.java new file mode 100644 index 0000000..edf0e0d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnchantmentGlint.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.util.ResourceLocation; + +public class ModuleEnchantmentGlint extends AbstractModule { + public Setting inventoryGlint; + public Setting droppedItemGlint; + public Setting heldItemGlint; + public Setting armorGlint; + public Setting droppedItemGlintColor; + public Setting inventoryGlintColor; + public Setting heldItemGlintColor; + public Setting armorGlintColor; + public Setting showPotionColor; + public Setting onlyRenderPotionGlint; + public Setting excludePotionGlint; + public Setting shinyPots; + public Setting boxBoundary; + + + public ModuleEnchantmentGlint() { + super("Enchantment Glint"); + this.setDefaultState(true); + + // Category to toggle specific parts of enchantment glint + new Setting(this, "label").setValue("Glint Options"); + inventoryGlint = new Setting(this, "Inventory Glint").setValue(true); + droppedItemGlint = new Setting(this, "Dropped Item Glint").setValue(true); + heldItemGlint = new Setting(this, "Held Item Glint").setValue(true); + armorGlint = new Setting(this, "Armor Glint").setValue(true); + + // All Shiny Pots related options + new Setting(this, "label").setValue("Potion Options").setCondition(() -> (Boolean) this.inventoryGlint.getValue()); + showPotionColor = new Setting(this, "Show Potion Color (Inventory)").setValue(false).setCondition(() -> (Boolean) this.inventoryGlint.getValue()); + onlyRenderPotionGlint = new Setting(this, "Only Render Potion Glint (Inventory)").setValue(false).setCondition(() -> (Boolean) this.inventoryGlint.getValue()); + excludePotionGlint = new Setting(this, "Exclude Potion Glint (Inventory)").setValue(false).setCondition(() -> (Boolean) this.inventoryGlint.getValue()); + shinyPots = new Setting(this, "Shiny Pots", "Show a glint box around potions.").setValue(false).setCondition(() -> (Boolean) this.inventoryGlint.getValue()); + boxBoundary = new Setting(this, "Shiny Pots Boundary").setValue("Entire Slot").acceptedStringValues("Entire Slot", "To Border").setCondition(() -> (Boolean) this.inventoryGlint.getValue() && (Boolean) this.shinyPots.getValue()); + + // All Color options + new Setting(this, "label").setValue("Color Options").setCondition(() -> (Boolean) this.inventoryGlint.getValue() || (Boolean) this.droppedItemGlint.getValue() || (Boolean) this.heldItemGlint.getValue() || (Boolean) this.armorGlint.getValue()); + inventoryGlintColor = new Setting(this, "Inventory Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.inventoryGlint.getValue()); + droppedItemGlintColor = new Setting(this, "Dropped Item Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.droppedItemGlint.getValue()); + heldItemGlintColor = new Setting(this, "Held Item Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.heldItemGlint.getValue()); + armorGlintColor = new Setting(this, "Armor Glint Color").setValue(-8372020).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.armorGlint.getValue()); + + setPreviewIcon(new ResourceLocation("client/icons/mods/ench_sword.png"), 32, 32); + setDescription("Customize the enchantment glint and/or enable shiny pots overlay."); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnvironmentChanger.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnvironmentChanger.java new file mode 100644 index 0000000..3e995a3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleEnvironmentChanger.java @@ -0,0 +1,67 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.event.impl.TickEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.util.ResourceLocation; + +import java.util.Date; + +public class ModuleEnvironmentChanger extends AbstractModule { + + public Setting worldTime; + public Setting timeType; + + public Setting allowThroughBlocks; + public Setting customWeather; + public Setting weatherType; + + public Date date; + + public ModuleEnvironmentChanger() { + super("Environment Changer"); + this.setDescription("Allows you to change the environment around you to your liking."); + this.setCreators("Fyu (Time Changer)", "Sk1er (Snow)"); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/env-changer.png"), 32, 32); + + new Setting(this, "label").setValue("Time Settings"); + this.timeType = new Setting(this, "Time Type").setValue("Server").acceptedStringValues("Server", "Real Time", "Static").onChange((value) -> this.setWorldTime()); + this.worldTime = new Setting(this, "World Time").setValue(-14490).setMinMax(-22880, -6100).setShowValue(false).setCondition(() -> this.timeType.getValue().equals("Static")).onChange((value) -> this.mc.theWorld.setWorldTime(Integer.parseInt(value.toString()))); + + new Setting(this, "label").setValue("Weather Settings"); + this.allowThroughBlocks = new Setting(this, "Allow Through Blocks").setValue(false).setCustomizationLevel(CustomizationLevel.MEDIUM); + this.customWeather = new Setting(this, "Custom Weather").setValue(false).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.weatherType = new Setting(this, "Current Weather").setValue("Clear").acceptedStringValues("Clear", "Rain", "Snow").setCondition(() -> this.customWeather.getBooleanValue()).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.addEvent(TickEvent.class, this::onTick); + } + + private void onTick(TickEvent event) { + if (this.mc.theWorld != null && this.timeType.getValue().equals("Real Time")) { + this.mc.theWorld.setWorldTime(this.getRealWorldTime()); + } + } + + public boolean isSnowOrNone() { + return this.weatherType.getStringValue().equals("Clear") || this.weatherType.getStringValue().equals("Snow"); + } + + // gets the real time converted into Minecraft time + private int getRealWorldTime() { + if (this.date == null) this.date = new Date(); + this.date.setTime(System.currentTimeMillis()); + int hour = this.date.getHours() - 6; + if (hour <= 0) hour += 24; + return (int)(hour * 1000 + (this.date.getSeconds() + this.date.getMinutes() * 60) / 3.6); + } + + public void setWorldTime() { + if (this.mc.theWorld == null) return; + + if (this.timeType.getValue().equals("Real Time")) { + this.mc.theWorld.setWorldTime(this.getRealWorldTime()); + } else if (this.timeType.getValue().equals("Static")) { + this.mc.theWorld.setWorldTime(this.worldTime.getIntegerValue()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitColor.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitColor.java new file mode 100644 index 0000000..152deb3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleHitColor.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.util.ResourceLocation; + +public class ModuleHitColor extends AbstractModule { + public Setting toggle; + public Setting affectArmor; + public Setting affectedBrightness; + public Setting hitColor; + public Setting fade; + + + public ModuleHitColor() { + super("Hit Color"); + this.setDefaultState(true); + + this.toggle = new Setting(this, "Enable Hit Color").setValue(true); + new Setting(this, "label").setValue("General Options").setCondition(this.toggle::getBooleanValue); + this.affectArmor = new Setting(this, "Affect Armor").setValue(true).setCondition(this.toggle::getBooleanValue); + this.affectedBrightness = new Setting(this, "Affected by brightness").setValue(true).setCondition(this.toggle::getBooleanValue); + this.fade = new Setting(this, "Animation Type").setValue("None").acceptedStringValues("None", "Linear In/Out", "Linear Out").setCondition(this.toggle::getBooleanValue); + + // All Color options + new Setting(this, "label").setValue("Color Options").setCondition(this.toggle::getBooleanValue); + this.hitColor = new Setting(this, "Hit Color").setValue(0x66FF0000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(this.toggle::getBooleanValue); + setDescription("Customize the damage tint overlay on entities."); + setCreators("aycy (Fade animation)"); + this.setPreviewIcon(new ResourceLocation("client/icons/mods/hittint.png"), 32, 32); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleNametag.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleNametag.java new file mode 100644 index 0000000..94f164e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleNametag.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; + +public class ModuleNametag extends AbstractModule { + + private final String[] disallowedCharacters = new String[]{" ", "[", "]", "!", "=", "-", "@", "#", "$", "%", "^", "&", "*", "(", ")", "~", "`", "|", ";", ":", "'", "\"", ",", "<", ">", ".", "?", "/"}; + + public Setting hideNamePlatesKeybind; + public Setting generalOptionsLabel; + public Setting background; + public Setting textShadow; + public Setting showCheatBreakerLogo; + public Setting showOwnNametag; + public Setting showNametagsInF1; + + public Setting colorOptionsLabel; + public Setting customTextColor; + public Setting textColor; + public Setting backgroundColor; + + public ModuleNametag() { + super("Nametag"); + this.setDefaultState(true); + this.hideNamePlatesKeybind = new Setting(this, "Hide Nametags Keybind").setValue(0).setCustomizationLevel(CustomizationLevel.SIMPLE); + this.generalOptionsLabel = new Setting(this, "label").setValue("General Options"); + this.background = new Setting(this, "Show Background").setValue(true); + this.textShadow = new Setting(this, "Text Shadow").setValue(false); + this.showCheatBreakerLogo = new Setting(this, "Show CheatBreaker Logo").setValue(true); + this.showOwnNametag = new Setting(this, "Shown own Nametag").setValue(false); + this.showNametagsInF1 = new Setting(this, "Show Nametags when GUI is hidden").setValue(false); + + this.colorOptionsLabel = new Setting(this, "label").setValue("Color Options"); + this.customTextColor = new Setting(this, "Strip Formatting Colors").setValue(false); + this.textColor = new Setting(this, "Text Color").setValue(-1).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.customTextColor.getValue()); + this.backgroundColor = new Setting(this, "Background Color").setValue(0x40000000).setMinMax(Integer.MIN_VALUE, Integer.MAX_VALUE).setCondition(() -> (Boolean) this.background.getValue()); + this.setDescription("Displays the username above players."); + } + + public boolean meetsIconRequirements(String username) + { + for (String str : this.disallowedCharacters) { + if (username.contains(str)) return false; + } + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleParticles.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleParticles.java new file mode 100644 index 0000000..cea555b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/normal/vanilla/ModuleParticles.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.module.impl.normal.vanilla; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; + +public class ModuleParticles extends AbstractModule { + private final Setting generalParticlesLabel; + public Setting sprintingParticles; + public Setting blockBreakingParticles; + private final Setting attackParticlesLabel; + public Setting sharpnessParticles; + public Setting sharpnessParticlesMultiplier; + public Setting critParticles; + public Setting critParticlesMultiplier; + + public Setting damaged; + public Setting attacking; + + private final Setting potionParticlesLabel; + public Setting splashParticles; + public Setting instantEffectSplashOpacity; + public Setting normalEffectSplashOpacity; + public Setting activeEffectParticles; + public Setting activeEffectOpacity; + public Setting activeEffectAmbientOpacity; + + + public ModuleParticles() { + super("Particles"); + this.generalParticlesLabel = new Setting(this, "label").setValue("General Particles"); + this.sprintingParticles = new Setting(this, "Show Sprinting Particles").setValue(true); + this.blockBreakingParticles = new Setting(this, "Show Block Breaking Particles").setValue(true); + this.attackParticlesLabel = new Setting(this, "label").setValue("Attack Particles"); + this.damaged = new Setting(this, "Show When Damaged").setValue("Override").acceptedStringValues("OFF", "Vanilla", "Override"); + this.attacking = new Setting(this, "Show When Attacking").setValue("Override").acceptedStringValues("OFF", "Vanilla", "Override"); + this.sharpnessParticles = new Setting(this, "Sharpness Particles").setValue("Vanilla").acceptedStringValues("Never", "Vanilla", "Always").setCondition(() -> this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override")); + this.sharpnessParticlesMultiplier = new Setting(this, "Sharpness Multiplier").setValue(1.0f).setMinMax(0.1f, 10.0f).setUnit("x").setCondition(() -> !this.sharpnessParticles.getValue().equals("Never") && (this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override"))); + this.critParticles = new Setting(this, "Crit Particles").setValue("Vanilla").acceptedStringValues("Never", "Vanilla", "Always").setCondition(() -> this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override")); + this.critParticlesMultiplier = new Setting(this, "Crit Multiplier").setValue(1.0f).setMinMax(0.1f, 10.0f).setUnit("x").setCondition(() -> !this.critParticles.getValue().equals("Never") && (this.damaged.getValue().equals("Override") || this.attacking.getValue().equals("Override"))); + + this.potionParticlesLabel = new Setting(this, "label").setValue("Effect Particles"); + this.splashParticles = new Setting(this, "Show Splash Particles").setValue(true); + this.instantEffectSplashOpacity = new Setting(this, "Instant Splash Opacity").setValue(100.0f).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.splashParticles.getValue()); + this.normalEffectSplashOpacity = new Setting(this, "Normal Splash Opacity").setValue(100.0f).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.splashParticles.getValue()); + this.activeEffectParticles = new Setting(this, "Show Active Effect Particles").setValue(true); + this.activeEffectOpacity = new Setting(this, "Active Effect Opacity").setValue(100.0f).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.activeEffectParticles.getValue()); + this.activeEffectAmbientOpacity = new Setting(this, "Ambient Effect Opacity").setValue(15.0F).setMinMax(0.01f, 100.0f).setUnit("%").setCondition(() -> (Boolean) this.activeEffectParticles.getValue()); + this.setPreviewLabel("Particles", 1.0F); + this.setDescription("Change how particles appear."); + this.setCreators("dewgs (Multipliers)"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/ResourcePackManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/ResourcePackManager.java new file mode 100644 index 0000000..27e6ad5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/ResourcePackManager.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.module.impl.packmanager; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.InitializationEvent; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import com.cheatbreaker.client.module.impl.packmanager.utils.ThreadUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Objects; + +public class ResourcePackManager { + private final Minecraft mc = Minecraft.getMinecraft(); + + + public ResourcePackManager() { + CheatBreaker.getInstance().getEventBus().addEvent(InitializationEvent.class, this::onInit); + } + + public void onInit(InitializationEvent event) { + HashMap activeEntries = new HashMap(); + for (String packName : mc.gameSettings.resourcePacks) { + activeEntries.put(packName, null); + } + for (ResourcePackRepository.Entry entry : mc.getResourcePackRepository().getRepositoryEntries()) { + activeEntries.put(entry.getResourcePackName(), entry); + } + for (ResourcePackRepository.Entry entry : PackUtils.getActiveEntries()) { + activeEntries.put(entry.getResourcePackName(), entry); + } + activeEntries.values().removeIf(Objects::isNull); + mc.getResourcePackRepository().setRepositories(new ArrayList<>(activeEntries.values())); + this.mc.refreshResources(); + Runtime.getRuntime().addShutdownHook(new Thread(ThreadUtils::shutdown)); + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksFolder.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksFolder.java new file mode 100644 index 0000000..a5ef0db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksFolder.java @@ -0,0 +1,57 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components; + + +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import lombok.Getter; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +@Getter +public class ResourcePacksFolder { + private final String name; + private final List entries; + private final List selectedEntries; + private final List packFolders; + private final ResourcePacksFolder previousPackFolder; + + public ResourcePacksFolder(File directory, List selectedEntries) { + this(directory, selectedEntries, null); + } + + private ResourcePacksFolder(File directory, List selectedEntries, ResourcePacksFolder previousPackFolder) { + this.name = directory.getName(); + this.entries = new ArrayList(); + this.selectedEntries = selectedEntries; + this.packFolders = new ArrayList(); + this.previousPackFolder = previousPackFolder; + this.packFolders.add(new ResourcePacksFolder(previousPackFolder)); + for (File file : Objects.requireNonNull(directory.listFiles())) { + + if (PackUtils.isResourcePack(file)) { + for (final ResourcePackRepository.Entry entry : this.selectedEntries) { + if (entry.getResourcePackName().equals(file.getName())) { + final Optional newEntry = PackUtils.createEntry(file); + if (newEntry.isPresent() && newEntry.get().equals(entry)) { + break; + } + } + } + PackUtils.createEntry(file).ifPresent(this.entries::add); + } else if (PackUtils.isResourcePackDirectory(file)) { + this.packFolders.add(new ResourcePacksFolder(file, selectedEntries, this)); + } + } + } + + private ResourcePacksFolder(ResourcePacksFolder previousPackFolder) { + this.name = "Back to " + (previousPackFolder == null ? "Main Folder" : previousPackFolder.name); + this.entries = new ArrayList(); + this.selectedEntries = new ArrayList(); + this.packFolders = new ArrayList(); + this.previousPackFolder = previousPackFolder; + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksWatcher.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksWatcher.java new file mode 100644 index 0000000..f0d18b4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/ResourcePacksWatcher.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import java.io.File; +import java.io.IOException; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.Iterator; + +public class ResourcePacksWatcher { + private WatchService watchService; + + public ResourcePacksWatcher(Path root) { + try { + this.watchService = FileSystems.getDefault().newWatchService(); + Files.walkFileTree(root, (FileVisitor)new SimpleFileVisitor(){ + + @Override + public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attributes) throws IOException { + File file = path.toFile(); + if (PackUtils.isResourcePackDirectory(file)) { + path.register(ResourcePacksWatcher.this.watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE); + return FileVisitResult.CONTINUE; + } + if (PackUtils.isResourcePack(file)) { + return FileVisitResult.SKIP_SUBTREE; + } + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to create watch service", exception); + } + } + + public boolean hasEvent() { + WatchKey watchKey; + boolean eventOccurred = false; + if (this.watchService != null && (watchKey = this.watchService.poll()) != null) { + for (WatchEvent event : watchKey.pollEvents()) { + File file = ((Path)watchKey.watchable()).resolve(event.context().toString()).toFile(); + if (!PackUtils.isResourcePack(file) && !PackUtils.isResourcePackDirectory(file)) continue; + eventOccurred = true; + break; + } + watchKey.reset(); + } + return eventOccurred; + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksAvailable.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksAvailable.java new file mode 100644 index 0000000..5ae51c8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksAvailable.java @@ -0,0 +1,106 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksFolder; +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import com.cheatbreaker.client.module.impl.packmanager.utils.GuiUtils; +import com.cheatbreaker.client.util.GlStateManager; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.ResourceLocation; + +import java.util.List; + +public class GuiResourcePacksAvailable extends GuiResourcePacksList { + private static final ResourceLocation FOLDER_ICON = new ResourceLocation("client/icons/folder.png"); + private final List packFolders; + private final boolean showPackFolders; + + public GuiResourcePacksAvailable(GuiResourcePacks parentScreen, int x, int y, int width, int height, int slotHeight, List entries, List packFolders, boolean showPackFolders) { + super(parentScreen, x, y, width, height, slotHeight, I18n.format("resourcePack.available.title"), entries); + this.packFolders = packFolders; + this.showPackFolders = showPackFolders; + } + + @Override + protected void drawSlot(int index, int right, int top, int buffer, int mouseX, int mouseY, boolean hovered) { + if (hovered) { + Gui.drawRect(this.left, top - 1, right + 1, top + buffer + 3, -2134851392); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + } + if (this.showPackFolders) { + if (0 <= index && index < this.packFolders.size()) { + this.drawResourcePackDirectory(this.packFolders.get(index), top); + } else if (this.packFolders.size() <= index && index < this.getSize()) { + super.drawSlot(index - this.packFolders.size(), right, top, buffer, mouseX, mouseY, hovered); + } + } else if (0 <= index && index < this.getSize()) { + super.drawSlot(index, right, top, buffer, mouseX, mouseY, hovered); + } + } + + private void drawResourcePackDirectory(ResourcePacksFolder packFolder, int top) { + boolean showFolderIcons = (Boolean) CheatBreaker.getInstance().getGlobalSettings().packFolderIcons.getValue(); + if (showFolderIcons) { + this.mc.getTextureManager().bindTexture(FOLDER_ICON); + GlStateManager.enableBlend(); + Gui.drawScaledCustomSizeModalRect(this.left + 2, top + 3, 0.0f, 0.0f, 256, 256, 32, 32, 256.0f, 256.0f); + GlStateManager.disableBlend(); + } + this.mc.fontRenderer.drawString(GuiUtils.trimString(packFolder.getName(), this.listWidth - 46), (float)this.left + (showFolderIcons ? 36.0f : 2.0f), (float)top + 2.0f, -1, true); + int packFolders = packFolder.getPackFolders().size() - 1; + if (packFolders != -1 && (Boolean) CheatBreaker.getInstance().getGlobalSettings().packFolderInfo.getValue()) { + int entries; + String text; + float y = (float)top + 13.0f; + if (packFolders != 0) { + text = GuiUtils.trimString(packFolders + (packFolders == 1 ? " Subfolder" : " Subfolders"), this.listWidth - 46); + this.mc.fontRenderer.drawString(text, (float)this.left + (showFolderIcons ? 36.0f : 2.0f), y, -5592406, true); + y += 10.0f; + } + if ((entries = packFolder.getEntries().size()) != 0) { + text = GuiUtils.trimString(entries + (entries == 1 ? " Pack" : " Packs"), this.listWidth - 46); + this.mc.fontRenderer.drawString(text, (float)this.left + (showFolderIcons ? 36.0f : 2.0f), y, -5592406, true); + } + } + } + + @Override + protected void onClick(int index, boolean doubleClick) { + if (this.showPackFolders) { + if (0 <= index && index < this.packFolders.size()) { + this.onClickResourcePackDirectory(this.packFolders.get(index), index == 0); + } else if (this.packFolders.size() <= index && index < this.getSize()) { + this.onClickResourcePackEntry(this.entries.get(index - this.packFolders.size())); + } + } else if (0 <= index && index < this.getSize()) { + this.onClickResourcePackEntry(this.entries.get(index)); + } + } + + private void onClickResourcePackEntry(ResourcePackRepository.Entry entry) { + if (this.parentScreen.addSelectedEntry(entry)) { + this.entries.remove(entry); + } + } + + private void onClickResourcePackDirectory(ResourcePacksFolder packFolder, boolean back) { + if (back) { + if (packFolder.getName().equals("Back to Main Folder")) { + this.parentScreen.setAvailablePacks(null); + } else if (packFolder.getPreviousPackFolder() != null) { + this.parentScreen.setAvailablePacks(packFolder.getPreviousPackFolder()); + } else { + this.parentScreen.setAvailablePacks(packFolder); + } + } else { + this.parentScreen.setAvailablePacks(packFolder); + } + } + + @Override + protected int getSize() { + return this.showPackFolders ? this.entries.size() + this.packFolders.size() : this.entries.size(); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksList.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksList.java new file mode 100644 index 0000000..243fa5c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksList.java @@ -0,0 +1,66 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import com.cheatbreaker.client.module.impl.packmanager.utils.GuiUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.util.Collections; +import java.util.List; + +public abstract class GuiResourcePacksList extends GuiScrollingList { + protected final GuiResourcePacks parentScreen; + protected final Minecraft mc; + public final List entries; + + public GuiResourcePacksList(GuiResourcePacks parentScreen, int x, int y, int width, int height, int slotHeight, String title, List entries) { + super(parentScreen.mc, x, y, width, height, slotHeight, title); + this.parentScreen = parentScreen; + this.mc = parentScreen.mc; + this.entries = entries; + } + + @Override + protected void drawBackground() { + Gui.drawRect(this.left, this.top, this.right, this.bottom, CheatBreaker.getInstance().getGlobalSettings().packListBackgroundColor.getColorValue()); + } + + @Override + protected void drawSlot(int index, int right, int top, int buffer, int mouseX, int mouseY, boolean hovered) { + if (0 <= index && index < this.getSize()) { + ResourcePackRepository.Entry entry = this.entries.get(index); + boolean showPackIcons = (Boolean) CheatBreaker.getInstance().getGlobalSettings().packIcons.getValue(); + if (showPackIcons) { + entry.bindTexturePackIcon(this.mc.getTextureManager()); + Gui.drawModalRectWithCustomSizedTexture(this.left + 2, top + 1, 0.0f, 0.0f, 32, 32, 32.0f, 32.0f); + } + this.mc.fontRenderer.drawString(GuiUtils.trimString(entry.getResourcePackName(), + this.listWidth - 46), (float)this.left + (showPackIcons ? 36.0f : 2.0f), (float)top + 2.0f, -1, true); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().packDescriptions.getValue()) { + List lines = this.mc.fontRenderer.listFormattedStringToWidth(entry.getTexturePackDescription(), this.listWidth - 46); + for (int i = 0; i < lines.size(); ++i) { + String text = lines.get(i); + if (i == 1 && lines.size() > 2) { + text = GuiUtils.trimString(text, this.listWidth - 46); + } + this.mc.fontRenderer.drawString(text, (float)this.left + (showPackIcons ? 36.0f : 2.0f), (float)top + 13.0f + 10.0f * (float)i, -5592406, true); + if (i == 1) break; + } + } + } + } + + @Override + protected abstract void onClick(int var1, boolean var2); + + @Override + protected int getSize() { + return this.entries.size(); + } + + public List getEntries() { + return Collections.unmodifiableList(this.entries); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksSelected.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksSelected.java new file mode 100644 index 0000000..c57b86d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiResourcePacksSelected.java @@ -0,0 +1,154 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksFolder; +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import com.cheatbreaker.client.util.GlStateManager; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.ResourceLocation; + +import java.io.File; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +public class GuiResourcePacksSelected extends GuiResourcePacksList { + private static final ResourceLocation RESOURCE_PACK_TEXTURES = new ResourceLocation("textures/gui/resource_packs.png"); + private final GuiResourcePacks parentScreen; + private Action action; + + public GuiResourcePacksSelected(GuiResourcePacks parentScreen, int x, int y, int width, int height, int slotHeight, List entries) { + super(parentScreen, x, y, width, height, slotHeight, I18n.format("resourcePack.selected.title"), entries); + this.parentScreen = parentScreen; + this.action = Action.MOVE_BACK; + } + + @Override + protected void drawSlot(int index, int right, int top, int buffer, int mouseX, int mouseY, boolean hovered) { + if (hovered) { + Gui.drawRect(this.left, top - 1, right + 1, top + buffer + 3, -2134851392); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + } + super.drawSlot(index, right, top, buffer, mouseX, mouseY, hovered); + if (hovered) { + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.getTextureManager().bindTexture(RESOURCE_PACK_TEXTURES); + if (right - 40 <= mouseX && mouseX < right) { + if (top <= mouseY && mouseY < top + buffer / 2 - 2) { + if (index == 0) { + if (this.action == Action.MOVE_DOWN) { + this.action = Action.MOVE_BACK; + } + } else { + this.action = Action.MOVE_UP; + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 96.0f, 32.0f, 32, 32, 256.0f, 256.0f); + } + if (index != super.getSize() - 1) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 64.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + } else { + if (index != 0) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 96.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + if (index == super.getSize() - 1) { + if (this.action == Action.MOVE_UP) { + this.action = Action.MOVE_BACK; + } + } else { + this.action = Action.MOVE_DOWN; + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 64.0f, 32.0f, 32, 32, 256.0f, 256.0f); + } + } + } else { + this.action = Action.MOVE_BACK; + if (index != 0) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 96.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + if (index != super.getSize() - 1) { + Gui.drawModalRectWithCustomSizedTexture(right - 40, top, 64.0f, 0.0f, 32, 32, 256.0f, 256.0f); + } + } + } + } + + @Override + protected void onClick(int index, boolean doubleClick) { + if (0 <= index && index < super.getSize()) { + switch (this.action) { + case MOVE_UP: + if (index - 1 < 0) break; + Collections.swap(this.entries, index, index - 1); + break; + case MOVE_DOWN: + if (index + 1 >= super.getSize()) break; + Collections.swap(this.entries, index, index + 1); + break; + default: + ResourcePackRepository.Entry entry = this.entries.get(index); + this.refreshEntry(entry); + this.entries.remove(entry); + } + } + } + + private void refreshEntry(ResourcePackRepository.Entry entry) { + for (File file : Objects.requireNonNull(this.mc.getResourcePackRepository().getDirResourcepacks().listFiles())) { + if (PackUtils.isResourcePack(file)) { + Optional newEntry; + if (!file.getName().equals(entry.getResourcePackName()) || !(newEntry = PackUtils.createEntry(file)).isPresent() || !newEntry.get().equals(entry)) continue; + if (this.parentScreen.isSearching()) { + ((GuiResourcePacksList)this).parentScreen.addSearchedPack(entry); + continue; + } + ((GuiResourcePacksList)this).parentScreen.addAvailableEntry(entry); + continue; + } + if (!PackUtils.isResourcePackDirectory(file)) continue; + this.refreshEntry(file, entry); + } + } + + private void refreshEntry(File directory, ResourcePackRepository.Entry entry) { + for (File file : Objects.requireNonNull(directory.listFiles())) { + if (PackUtils.isResourcePack(file)) { + Optional newEntry; + if (!file.getName().equals(entry.getResourcePackName()) || !(newEntry = PackUtils.createEntry(file)).isPresent() || !newEntry.get().equals(entry)) continue; + for (ResourcePacksFolder packFolder : this.parentScreen.getPackFolders()) { + this.refreshEntry(packFolder, directory, entry); + } + continue; + } + if (!PackUtils.isResourcePackDirectory(file)) continue; + this.refreshEntry(file, entry); + } + } + + private void refreshEntry(ResourcePacksFolder packFolder, File directory, ResourcePackRepository.Entry entry) { + if (packFolder.getName().equals(directory.getName())) { + if (this.parentScreen.isSearching()) { + if (packFolder.getEntries().contains(entry)) { + ((GuiResourcePacksList)this).parentScreen.addSearchedPack(entry); + } + } else { + if (!packFolder.getEntries().contains(entry)) { + packFolder.getEntries().add(entry); + } + this.parentScreen.sortAvailableEntries(packFolder.getEntries()); + } + } else { + for (ResourcePacksFolder packSubfolder : packFolder.getPackFolders()) { + this.refreshEntry(packSubfolder, directory, entry); + } + } + } + + enum Action { + MOVE_UP, + MOVE_DOWN, + MOVE_BACK + + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiScrollingList.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiScrollingList.java new file mode 100644 index 0000000..8d72c1a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/components/list/GuiScrollingList.java @@ -0,0 +1,181 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.components.list; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public abstract class GuiScrollingList { + protected final Minecraft mc; + public final int listWidth; + public final int listHeight; + public final int top; + public final int bottom; + public final int right; + public final int left; + public final String title; + protected final int slotHeight; + protected int selectedIndex; + private int scrollIndex; + private int scrollDirection; + private float initialMouseClickY; + private float scrollFactor; + private float scrollDistance; + private boolean hovering; + private long lastClickTime; + private final double[] scrollCache; + + public GuiScrollingList(Minecraft mc, int x, int y, int listWidth, int listHeight, int slotHeight, String title) { + this.mc = mc; + this.listWidth = listWidth; + this.listHeight = listHeight; + this.left = x; + this.top = y; + this.right = x + listWidth; + this.bottom = y + listHeight; + this.slotHeight = slotHeight; + this.title = title; + this.selectedIndex = -1; + this.scrollIndex = -1; + this.initialMouseClickY = -2.0f; + this.scrollCache = new double[]{5.088448, 4.809692672, 3.4292885120000003, 3.268147903999999, 2.697228288, 2.019487744, 1.8882322560000002, 1.6936698879999996, 1.4352491520000008, 1.2045501440000006, 0.7097322879999997, 0.5842770560000003, 0.5043583360000001, 0.37950342400000014, 0.282300416, 0.21170873600000029, 0.09733600000000031, 0.08991539199999998, 0.06209913599999961, 0.030371328000000197, 0.01452678400000007, 0.006229504000000219, 0.0017279999999999518}; + } + + protected abstract void drawBackground(); + + protected abstract void drawSlot(int var1, int var2, int var3, int var4, int var5, int var6, boolean var7); + + protected abstract void onClick(int var1, boolean var2); + + protected abstract int getSize(); + + public void draw(int mouseX, int mouseY) { + int top; + this.drawBackground(); + this.hovering = this.left <= mouseX && mouseX <= this.left + this.listWidth && this.top <= mouseY && mouseY <= this.bottom; + int listLength = this.getSize(); + int scrollBarWidth = 6; + int scrollBarRight = this.left + this.listWidth; + int scrollBarLeft = scrollBarRight - 6; + int slotRight = scrollBarLeft - 1; + int viewHeight = this.bottom - this.top; + int border = 4; + if (Mouse.isButtonDown(0)) { + if (this.initialMouseClickY == -1.0f) { + if (this.hovering) { + int mouseListY = mouseY - this.top + (int)this.scrollDistance - 4; + int slotIndex = mouseListY / this.slotHeight; + if (0 <= slotIndex && slotIndex < listLength && mouseX <= slotRight && 0 <= mouseListY) { + this.onClick(slotIndex, slotIndex == this.selectedIndex && System.currentTimeMillis() - this.lastClickTime < 500L); + this.selectedIndex = this.selectedIndex == slotIndex ? -1 : slotIndex; + this.lastClickTime = System.currentTimeMillis(); + } + if (scrollBarLeft <= mouseX && mouseX <= scrollBarRight) { + this.scrollFactor = -1.0f; + int scrollHeight = this.getContentHeight() - viewHeight - 4; + if (scrollHeight < 1) { + scrollHeight = 1; + } + if ((top = (int)((float)(viewHeight * viewHeight) / (float)this.getContentHeight())) < 32) { + top = 32; + } + if (top > viewHeight - 8) { + top = viewHeight - 8; + } + this.scrollFactor /= (float)(viewHeight - top) / (float)scrollHeight; + } else { + this.scrollFactor = 1.0f; + } + this.initialMouseClickY = mouseY; + } else { + this.initialMouseClickY = -2.0f; + } + } else if (this.initialMouseClickY >= 0.0f) { + this.scrollDistance -= ((float)mouseY - this.initialMouseClickY) * this.scrollFactor; + this.initialMouseClickY = mouseY; + } + } else { + if (this.scrollIndex != -1) { + this.scrollDistance = (float)((double)this.scrollDistance + this.scrollCache[this.scrollIndex] * (double)this.scrollDirection * 2.0); + ++this.scrollIndex; + if (this.scrollIndex >= this.scrollCache.length) { + this.scrollIndex = -1; + } + } + this.initialMouseClickY = -1.0f; + } + this.applyScrollLimits(); + int baseY = this.top + 2 - (int)this.scrollDistance; + for (int index = 0; index < listLength; ++index) { + int slotTop = baseY + index * this.slotHeight; + int slotBuffer = this.slotHeight - 4; + int slotBottom = slotTop + slotBuffer + 2; +// if ((this.top > slotTop + slotBuffer/* - 32*/) || (slotTop/* + 27*/ > this.bottom)) continue; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(3042); + GL11.glPushMatrix(); + GL11.glEnable(3089); + ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + RenderUtil.startMCScaledScissorBox(this.left, this.top + 1, this.right, this.bottom, res); + this.drawSlot(index, slotRight, slotTop, slotBuffer, mouseX, mouseY, this.left <= mouseX && mouseX < slotRight && slotTop - 2 <= mouseY && mouseY < slotBottom); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + int extraHeight = this.getContentHeight() - viewHeight - 4; + if (extraHeight > 0) { + int height = viewHeight * viewHeight / this.getContentHeight(); + if (height < 32) { + height = 32; + } + if (height > viewHeight - 8) { + height = viewHeight - 8; + } + if ((top = (int)this.scrollDistance * (viewHeight - height) / extraHeight + this.top) < this.top) { + top = this.top; + } + Gui.drawRect(scrollBarLeft, top, scrollBarRight, top + height, -4144960); + } + GlStateManager.shadeModel(7424); + GL11.glEnable(3553); + GL11.glEnable(3008); + Gui.zLevel = 1; + Gui.drawGradientRect(this.left, this.top, scrollBarRight, this.top + 5, -16777216, 0); + Gui.drawGradientRect(this.left, this.bottom - 5, scrollBarRight, this.bottom, 0, -16777216); + Gui.zLevel = -90; + } + + public void handleMouseInput() { + int scroll; + if (this.hovering && (scroll = Mouse.getEventDWheel()) != 0) { + scroll = scroll > 0 ? -1 : 1; + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().packSmoothScrolling.getValue()) { + this.scrollDirection = scroll; + this.scrollIndex = 0; + } else { + this.scrollDistance += (float)(scroll * this.slotHeight / 2); + } + } + } + + private void applyScrollLimits() { + int listHeight = this.getContentHeight() - (this.bottom - this.top - 4); + if (listHeight < 0) { + listHeight /= 2; + } + if (this.scrollDistance > (float)listHeight) { + this.scrollDistance = listHeight; + } + if (this.scrollDistance < 0.0f) { + this.scrollDistance = 0.0f; + } + } + + protected int getContentHeight() { + return this.getSize() * this.slotHeight; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/screen/GuiResourcePacks.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/screen/GuiResourcePacks.java new file mode 100644 index 0000000..1dcd3d5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/gui/screen/GuiResourcePacks.java @@ -0,0 +1,345 @@ +package com.cheatbreaker.client.module.impl.packmanager.gui.screen; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksFolder; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.ResourcePacksWatcher; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.list.GuiResourcePacksAvailable; +import com.cheatbreaker.client.module.impl.packmanager.gui.components.list.GuiResourcePacksSelected; +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import com.cheatbreaker.client.module.impl.packmanager.utils.ThreadUtils; +import com.google.common.collect.Lists; +import net.minecraft.client.gui.*; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.util.List; + +public class GuiResourcePacks extends GuiScreen { + private static final Comparator ENTRY_COMPARATOR = (entry1, entry2) -> { + return StringUtils.stripControlCodes(entry1.getResourcePackName()).trim().compareToIgnoreCase( + StringUtils.stripControlCodes(entry2.getResourcePackName()).trim()); + }; + private static final Comparator FOLDER_COMPARATOR = (folder1, folder2) -> { + return StringUtils.stripControlCodes(folder1.getName()).trim().compareToIgnoreCase(StringUtils.stripControlCodes(folder2.getName()).trim()); + }; + private final GuiScreen previousScreen; + private final ResourcePackRepository packsRepo; + private final List initialSelectedEntries; + private List availableEntries; + private final List selectedEntries; + private final List searchedEntries; + private final List packFolders; + private ResourcePacksWatcher packsWatcher; + private ResourcePacksFolder activePackFolder; + private GuiResourcePacksAvailable availablePacks; + private GuiResourcePacksSelected selectedPacks; + private GuiButton buttonFolder; + private GuiButton buttonDone; + private GuiTextField searchBar; + private boolean load; + private GuiButton clearGlassButton; + private GuiButton redStringButton; + private GuiButton backgroundButton; + + public GuiResourcePacks(GuiScreen previousScreen) { + this.previousScreen = previousScreen; + this.packsRepo = previousScreen.mc.getResourcePackRepository(); + this.availableEntries = new ArrayList(); + this.searchedEntries = new ArrayList(); + this.selectedEntries = new ArrayList(Lists.reverse(this.packsRepo.getRepositoryEntries())); + this.initialSelectedEntries = Collections.unmodifiableList(new ArrayList(this.selectedEntries)); + this.packFolders = new ArrayList(); + ThreadUtils.execute(() -> { + this.packsRepo.updateRepositoryEntriesAll(); + this.refreshPackFolders(); + this.packsWatcher = new ResourcePacksWatcher(this.packsRepo.getDirResourcepacks().toPath()); + this.load = true; + }); + } + + public void initGui() { + int listWidth = (this.width - 30) / 2; + int listHeight = this.height - 80 - 46; + boolean wide = CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getBooleanValue(); + int wideWidth = wide ? this.width - listWidth - 12 : this.width / 2 + 4; + int wideWidth2 = wide ? listWidth + 2 : 200; + int wideWidth3 = wide ? listWidth + 2 : 200; + this.setAvailablePacks(this.activePackFolder); + this.selectedPacks = new GuiResourcePacksSelected(this, wideWidth, 32, wideWidth2, listHeight + (wide && this.width / 2 > 338 ? 20 : 0), 36, this.selectedEntries); + this.buttonFolder = new GuiButton(0, this.width / 2 - 154, this.height - 48, 150, 20, I18n.format("resourcePack.openFolder")); + this.buttonList.add(this.buttonFolder); + this.buttonDone = new GuiButton(2, wideWidth, this.height - 48, 200, 20, I18n.format("gui.done")); + this.buttonList.add(this.buttonDone); + int width = this.selectedPacks.left + this.selectedPacks.listWidth / 2 - this.fontRendererObj.getStringWidth(this.selectedPacks.title) / 2 - (this.availablePacks.left + this.availablePacks.listWidth / 2 + this.fontRendererObj.getStringWidth(this.availablePacks.title) / 2) - 50; + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.searchBar = new GuiTextField(this.fontRendererObj, 10, this.height - 70, (this.width - 30) / 2, 18); + } else { + this.searchBar = new GuiTextField(this.fontRendererObj, this.width / 2 - 204, this.height - 70, 200, 18); + } +// if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue()) { + this.searchBar.setVisible(this.activePackFolder == null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue()); +// } else { +// this.searchBar.setVisible(false); +// } + int d = !wide ? -1 : 1; + this.clearGlassButton = new GuiOptionButton(100, this.width / 2 + 4, this.height - 71, 114, 20, "Clear Glass: " + CheatBreaker.getInstance().getModuleManager().packTweaksMod.clearGlass.getValue()); + this.buttonList.add(this.clearGlassButton); + this.redStringButton = new GuiOptionButton(101, this.width / 2 + 118, this.height - 71, 86, 20, "Red String: " + ((Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredString.getValue() ? "ON" : "OFF")); + this.buttonList.add(this.redStringButton); + this.backgroundButton = new GuiOptionButton(102, this.width / 2 + (wide && this.width / 2 > 338 ? 204 : 4), this.height - (wide && this.width / 2 > 338 ? 71 : 91), (wide && this.width / 2 > 338 ? 138 : 200), 20, "Background: " + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().transparentBackground.getValue() ? "TRANSPARENT" : "NORMAL")); + this.buttonList.add(this.backgroundButton); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + if (this.load) { + this.load = false; + } + if (this.mc.theWorld != null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().transparentBackground.getValue()) { + this.drawDefaultBackground(); + } else { + this.func_146278_c(0); + } +// if (this.mc.theWorld == null) { +// super.func_146278_c(0); +// } else { +// Gui.drawRect(0, 0, this.width, this.height, Integer.MIN_VALUE); +// } + this.availablePacks.draw(mouseX, mouseY); + this.selectedPacks.draw(mouseX, mouseY); +// System.out.println(zLevel); + zLevel = 0.0f; +// if (this.availablePacks.isEmpty()) { +// String string = this.searchBar.getText().isEmpty() ? "Discovering resource packs..." : "No resource packs found."; +// this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + string, this.width / 2 - 100, 60, 0xFFFFFF); +// } +// Gui.drawRect(0, 0, this.width, 40, -16777216); +// Gui.drawRect(0, this.height - 40, this.width, this.height, -16777216); +// super.drawGradientRect(0, 40, this.width, 45, -16777216, 0); +// super.drawGradientRect(0, this.height - 45, this.width, this.height - 40, 0, -16777216); + boolean wide = CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getBooleanValue(); + if (this.availablePacks.entries.isEmpty()) { + String string = !this.searchBar.getText().isEmpty() && this.searchedEntries.isEmpty() ? "No resource packs found." : ""; + if (this.load) { + string = "Discovering resource packs..."; + } + this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + string, wide ? this.width / 4 : this.width / 2 - 100, 60, 0xFFFFFF); + } + if (this.selectedPacks.entries.isEmpty()) { + String string = "Select resource packs."; + this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + string, wide ? this.width / 2 + this.width / 4 : this.width / 2 + 100, 60, 0xFFFFFF); + } + super.drawCenteredString(this.mc.fontRenderer, this.selectedPacks.title, this.selectedPacks.left + this.selectedPacks.listWidth / 2, this.selectedPacks.top - 14, -1); + super.drawCenteredString(this.mc.fontRenderer, this.availablePacks.title, this.availablePacks.left + this.availablePacks.listWidth / 2, this.availablePacks.top - 14, -1); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.folderInfo"), this.width / 2 - 77, this.height - 26, 8421504); + super.drawScreen(mouseX, mouseY, partialTicks); + this.searchBar.drawTextBox(); + if (this.searchBar.isVisible() && !this.searchBar.isFocused() && this.searchBar.getText().isEmpty()) { + super.drawString(this.fontRendererObj, EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + "Search...", (Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue() ? 14 : this.width / 2 - 200, this.height - 65, 0xFFFFFF); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + if (this.searchBar.isVisible()) { + this.searchBar.mouseClicked(mouseX, mouseY, mouseButton); + } + } + + protected void actionPerformed(GuiButton button) { + if (button.id == this.buttonFolder.id) { + try { + Desktop.getDesktop().open(this.packsRepo.getDirResourcepacks()); + } catch (IOException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to open file", exception); + } + } else if (button.id == this.buttonDone.id) { + if (!this.initialSelectedEntries.equals(this.selectedPacks.getEntries())) { + ArrayList activePacks = new ArrayList(Lists.reverse(this.selectedPacks.getEntries())); + this.packsRepo.setRepositories(activePacks); + this.mc.gameSettings.resourcePacks.clear(); + for (ResourcePackRepository.Entry entry : activePacks) { + this.mc.gameSettings.resourcePacks.add(entry.getResourcePackName()); + } + this.mc.gameSettings.saveOptions(); + this.mc.refreshResources(); + } + this.mc.displayGuiScreen(this.previousScreen); + } else if (button.id == this.clearGlassButton.id) { + Setting clearGlass = CheatBreaker.getInstance().getModuleManager().packTweaksMod.clearGlass; + for (int i = 0; i < clearGlass.getAcceptedStringValues().length; ++i) { + if (!clearGlass.getAcceptedStringValues()[i].toLowerCase().equalsIgnoreCase(clearGlass.getStringValue())) continue; + if (i + 1 >= clearGlass.getAcceptedStringValues().length) { + clearGlass.setValue(clearGlass.getAcceptedStringValues()[0]); + break; + } + clearGlass.setValue(clearGlass.getAcceptedStringValues()[i + 1]); + clearGlass.setValue(clearGlass.getAcceptedStringValues()[i + 1]); + break; + } + this.clearGlassButton.displayString = "Clear Glass: " + clearGlass.getValue(); + this.mc.renderGlobal.loadRenderers(); + } else if (button.id == this.redStringButton.id) { + boolean redString = CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredString.getBooleanValue(); + this.redStringButton.displayString = "Red String: " + (!redString ? "ON" : "OFF"); + CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredString.setValue(!redString); + this.mc.renderGlobal.loadRenderers(); + } else if (button.id == this.backgroundButton.id) { + boolean transparentBackground = CheatBreaker.getInstance().getGlobalSettings().transparentBackground.getBooleanValue(); + this.backgroundButton.displayString = "Background: " + (!transparentBackground ? "TRANSPARENT" : "NORMAL"); + CheatBreaker.getInstance().getGlobalSettings().transparentBackground.setValue(!transparentBackground); + this.mc.renderGlobal.loadRenderers(); + } + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + this.availablePacks.handleMouseInput(); + this.selectedPacks.handleMouseInput(); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) { + super.keyTyped(typedChar, keyCode); + if (this.searchBar.keyTyped(typedChar, keyCode)) { + this.searchForPacks(this.searchBar.getText().toLowerCase()); + } + } + + public void updateScreen() { + if (this.packsWatcher != null && this.packsWatcher.hasEvent()) { + ThreadUtils.execute(this::refreshPackFolders); + this.setAvailablePacks(null); + } + this.searchBar.updateCursorCounter(); + } + + public void addAvailableEntry(ResourcePackRepository.Entry entry) { + if (!this.availableEntries.contains(entry) && this.activePackFolder == null) { + this.availableEntries.add(entry); + this.sortAvailableEntries(this.availableEntries); + } + } + + public boolean addSelectedEntry(ResourcePackRepository.Entry entry) { + if (!this.selectedEntries.contains(entry)) { + this.selectedEntries.add(0, entry); + return true; + } + return false; + } + + public void setAvailablePacks(ResourcePacksFolder packFolder) { + this.activePackFolder = packFolder; + int searchBarHeight = (Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue() ? 26 : 4; + if (packFolder == null) { + if (this.searchBar != null) { + this.searchBar.setVisible((Boolean) CheatBreaker.getInstance().getGlobalSettings().packSearchBar.getValue()); + } + this.availableEntries = new ArrayList(this.packsRepo.getRepositoryEntriesAll()); + this.availableEntries.removeAll(this.selectedEntries); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.availablePacks = new GuiResourcePacksAvailable(this, 10, 32, (this.width - 30) / 2, this.height - 80 - searchBarHeight, 36, this.availableEntries, this.packFolders, true); + } else { + this.availablePacks = new GuiResourcePacksAvailable(this, this.width / 2 - 204, 32, 200, this.height - 80 - searchBarHeight, 36, this.availableEntries, this.packFolders, true); + } + + } else { +// this.searchBar.setVisible(false); + this.availableEntries = packFolder.getEntries(); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.availablePacks = new GuiResourcePacksAvailable(this, 10, 32, (this.width - 30) / 2, this.height - 80 - searchBarHeight, 36, this.availableEntries, packFolder.getPackFolders(), true); + } else { + this.availablePacks = new GuiResourcePacksAvailable(this, this.width / 2 - 204, 32, 200, this.height - 80 - searchBarHeight, 36, this.availableEntries, packFolder.getPackFolders(), true); + } + + } + this.sortAvailableEntries(this.availableEntries); + } + + public List getPackFolders() { + return Collections.unmodifiableList(this.packFolders); + } + + private void refreshPackFolders() { + this.packFolders.clear(); + for (File packSubfolder : Objects.requireNonNull(this.packsRepo.getDirResourcepacks().listFiles(PackUtils::isResourcePackDirectory))) { + this.packFolders.add(new ResourcePacksFolder(packSubfolder, this.selectedEntries)); + } + this.sortPackFolders((String) CheatBreaker.getInstance().getGlobalSettings().packSortMethod.getValue()); + } + + public void sortAvailableEntries(List list) { + String sortMethod = (String) CheatBreaker.getInstance().getGlobalSettings().packSortMethod.getValue(); + if (sortMethod.equals("A-Z")) { + list.sort(ENTRY_COMPARATOR); + } else if (sortMethod.equals("Z-A")) { + list.sort(ENTRY_COMPARATOR.reversed()); + } + } + + private void sortPackFolders(String sortMethod) { + if (sortMethod.equals("A-Z")) { + this.packFolders.sort(FOLDER_COMPARATOR); + } else if (sortMethod.equals("Z-A")) { + this.packFolders.sort(FOLDER_COMPARATOR.reversed()); + } + } + + private void searchForPacks(String search) { + if (search.isEmpty()) { + this.setAvailablePacks(null); + } else { + this.searchedEntries.clear(); + for (ResourcePackRepository.Entry entry : this.availableEntries) { + if (!StringUtils.stripControlCodes(entry.getResourcePackName()).toLowerCase().contains(search) && !StringUtils.stripControlCodes(entry.getTexturePackDescription()).toLowerCase().contains(search)) continue; + this.addSearchedPack(entry); + } + for (ResourcePacksFolder packFolder : this.packFolders) { + this.searchForPacks(packFolder, search); + } + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().widePackMenu.getValue()) { + this.availablePacks = new GuiResourcePacksAvailable(this, 10, 32, (this.width - 30) / 2, this.height - 80 - 26, 36, this.searchedEntries, null, false); + } else { + this.availablePacks = new GuiResourcePacksAvailable(this, this.width / 2 - 204, 32, 200, this.height - 80 - 26, 36, this.searchedEntries, null, false); + } + this.sortAvailableEntries(this.searchedEntries); + } + } + + private void searchForPacks(ResourcePacksFolder packFolder, String search) { + for (ResourcePackRepository.Entry entry : packFolder.getEntries()) { + if (!StringUtils.stripControlCodes(entry.getResourcePackName().toLowerCase()).contains(search) && !StringUtils.stripControlCodes(entry.getTexturePackDescription()).toLowerCase().contains(search)) continue; + this.addSearchedPack(entry); + } + for (ResourcePacksFolder packSubfolder : packFolder.getPackFolders()) { + this.searchForPacks(packSubfolder, search); + } + } + + public void addSearchedPack(ResourcePackRepository.Entry entry) { + boolean duplicate = false; + for (ResourcePackRepository.Entry searchedEntry : this.searchedEntries) { + if (!searchedEntry.getResourcePackName().equals(entry.getResourcePackName())) continue; + duplicate = true; + break; + } + if (!duplicate) { + this.searchedEntries.add(entry); + this.sortAvailableEntries(this.searchedEntries); + } + } + + public boolean isSearching() { + return !this.searchBar.getText().isEmpty(); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/GuiUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/GuiUtils.java new file mode 100644 index 0000000..ed0c85d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/GuiUtils.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.module.impl.packmanager.utils; + +import net.minecraft.client.Minecraft; + +public class GuiUtils { + private static final Minecraft MC = Minecraft.getMinecraft(); + + public static String trimString(String text, int width) { + if (text.endsWith(".zip")) { + text = text.substring(0, text.length() - 4); + } + if (GuiUtils.MC.fontRenderer.getStringWidth(text) > width) { + text = GuiUtils.MC.fontRenderer.trimStringToWidth(text, width - GuiUtils.MC.fontRenderer.getStringWidth("...")) + "..."; + } + return text; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/PackUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/PackUtils.java new file mode 100644 index 0000000..8e285a1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/PackUtils.java @@ -0,0 +1,92 @@ +package com.cheatbreaker.client.module.impl.packmanager.utils; + +import com.cheatbreaker.client.CheatBreaker; +import lombok.SneakyThrows; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.ResourcePackRepository; + +import java.io.File; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +public class PackUtils { + private static final Minecraft MC = Minecraft.getMinecraft(); + + /** + * Returns true if the file is a zip or a directory with a pack.mcmeta in a pack folder. + * DOES NOT CHECK IN THE MAIN PACK FOLDER DIRECTORY + */ + @SneakyThrows + public static boolean isResourcePack(File file) { + if(file.isFile() && file.getName().endsWith(".zip")) { + try { + ZipFile sourceZipFile = new ZipFile(file); + ZipEntry entry = sourceZipFile.getEntry("pack.mcmeta"); + if(entry == null) { + System.out.println("Not found in: " + file.getName()); + return false; + + } + return true; + } catch (Exception ex) { + return false; + } + } + return file.isDirectory() && new File(file, "pack.mcmeta").isFile(); + } + + /** + * Returns true if the file is a zip or a directory with a pack.mcmeta in a pack folder. + */ + public static boolean isResourcePackDirectory(File file) { + return file.isDirectory() && !new File(file, "pack.mcmeta").isFile(); + } + + public static Optional createEntry(File resourcePack) { + Optional entry = Optional.empty(); + try { + Constructor constructor = ResourcePackRepository.Entry.class.getDeclaredConstructor(ResourcePackRepository.class, File.class); + constructor.setAccessible(true); + entry = Optional.of(constructor.newInstance(MC.getResourcePackRepository(), resourcePack)); + entry.get().updateResourcePack(); + } catch (NoSuchMethodException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to find constructor", exception); + entry = Optional.empty(); + } catch (IllegalAccessException | InstantiationException | InvocationTargetException exception) { + CheatBreaker.getInstance().getLogger().error("Failed to create entry", exception); + } + + return entry; + } + + public static List getActiveEntries() { + ArrayList activeEntries = new ArrayList<>(); + ResourcePackRepository packRepo = MC.getResourcePackRepository(); + for (String packName : PackUtils.MC.gameSettings.resourcePacks) { + for (ResourcePackRepository.Entry entry : packRepo.getRepositoryEntriesAll()) { + if (!entry.getResourcePackName().equals(packName)) continue; + } + for (File packFolder : Objects.requireNonNull(packRepo.getDirResourcepacks().listFiles(PackUtils::isResourcePackDirectory))) { + activeEntries.addAll(PackUtils.getActiveEntries(packFolder, packName)); + } + } + return activeEntries; + } + + private static List getActiveEntries(File directory, String packName) { + ArrayList activeEntries = new ArrayList<>(); + for (File file : Objects.requireNonNull(directory.listFiles())) { + if (PackUtils.isResourcePack(file)) { + if (!file.getName().equals(packName)) continue; + PackUtils.createEntry(file).ifPresent(activeEntries::add); + continue; + } + if (!PackUtils.isResourcePackDirectory(file)) continue; + activeEntries.addAll(PackUtils.getActiveEntries(file, packName)); + } + return activeEntries; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/ThreadUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/ThreadUtils.java new file mode 100644 index 0000000..3f00da5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/packmanager/utils/ThreadUtils.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.module.impl.packmanager.utils; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class ThreadUtils { + private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor(); + + public static void execute(Runnable task) { + EXECUTOR_SERVICE.execute(task); + } + + public static void shutdown() { + EXECUTOR_SERVICE.shutdown(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/StaffMod.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/StaffMod.java new file mode 100644 index 0000000..b32598c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/StaffMod.java @@ -0,0 +1,23 @@ +package com.cheatbreaker.client.module.impl.staff; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; + +public class StaffMod extends AbstractModule { + private final Setting keybind = new Setting(this, "Keybind").setValue(0); + + public Setting getKeybindSetting() { + return this.keybind; + } + + public StaffMod(String name) { + super(name); + } + + public void disableStaffModule() { + if (this.isEnabled()) { + this.setState(false); + } + this.setStaffModuleEnabled(false); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleBunnyhop.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleBunnyhop.java new file mode 100644 index 0000000..4c52e06 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleBunnyhop.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.module.data.Setting; + +public class StaffModuleBunnyhop extends StaffMod { + public static Setting trimp; + public static Setting trimpMultiplier; + public static Setting hardCap; + public static Setting softCap; + public static Setting softCapDegen; + public static Setting sharking; + public static Setting sharkingSurfaceTension; + public static Setting sharkingWaterFriction; + public static Setting accelerate; + public static Setting airAccelerate; + public static Setting uncappedBHop; + public static Setting increasedFallDistance; + public static Setting maxAirAccelPerTick; + + public StaffModuleBunnyhop(String string) { + super(string); + this.setStaffModule(true); + trimp = new Setting(this, "Trimp").setValue(true); + trimpMultiplier = new Setting(this, "Trimp Multiplier").setValue(1.4F).setMinMax(1.0f, 4.0F); + hardCap = new Setting(this, "Hard cap").setValue(2.0f).setMinMax(1.0f, 4.0F); + softCap = new Setting(this, "Soft cap").setValue(1.4F).setMinMax(1.0f, 4.0F); + softCapDegen = new Setting(this, "Soft cap degen").setValue(0.65F).setMinMax(0.1f, 4.0F); + sharking = new Setting(this, "Sharking").setValue(true); + sharkingSurfaceTension = new Setting(this, "Sharking surface tension").setValue(0.2D).setMinMax(0.0, 1.0); + sharkingWaterFriction = new Setting(this, "Sharking water friction").setValue(0.1D).setMinMax(0.0, 1.0); + accelerate = new Setting(this, "Accelerate").setValue(20.0).setMinMax(5.0, 100.0); + airAccelerate = new Setting(this, "Air accelerate").setValue(28.0).setMinMax(5.0, 150.0); + maxAirAccelPerTick = new Setting(this, "Max air accel per tick").setValue(0.095D).setMinMax(0.0, 1.0); + uncappedBHop = new Setting(this, "Uncapped BunnyHop").setValue(true); + increasedFallDistance = new Setting(this, "Increased FallDistance").setValue(0.0).setMinMax(0.0, 10.0); + } + + public static boolean canUse() { + return CheatBreaker.getInstance().getModuleManager().staffModuleBunnyhop.isStaffModuleEnabled() && CheatBreaker.getInstance().getModuleManager().staffModuleBunnyhop.isEnabled(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNametags.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNametags.java new file mode 100644 index 0000000..f8cc517 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNametags.java @@ -0,0 +1,120 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.entity.Entity; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.Vec3; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.List; +import java.util.Map; + +public class StaffModuleNametags extends StaffMod { + public FloatBuffer modelViewMatrixBuffer = BufferUtils.createFloatBuffer(16); + public FloatBuffer projectionMatrixBuffer = BufferUtils.createFloatBuffer(16); + private static Map map = null; + + public StaffModuleNametags(String string) { + super(string); + this.setStaffModule(true); + this.addEvent(GuiDrawEvent.class, this::onGuiDrawEvent); + } + + private void onGuiDrawEvent(GuiDrawEvent event) { + Minecraft mc = Minecraft.getMinecraft(); + IntBuffer intBuffer = BufferUtils.createIntBuffer(16); + GL11.glGetInteger(2978, intBuffer); + float f = mc.timer.renderPartialTicks; + float f2 = (float)(mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * (double)f); + float f3 = (float)(mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * (double)f); + float f4 = (float)(mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * (double)f); + double d = (double)(mc.thePlayer.rotationPitch + 90.0f) * Math.PI / 180.0; + double d2 = (double)(mc.thePlayer.rotationYaw + 90.0f) * Math.PI / 180.0; + boolean bl = map != null; + Vec3 vec3 = new Vec3(Math.sin(d) * Math.cos(d2), Math.cos(d), Math.sin(d) * Math.sin(d2)); + if (mc.gameSettings.thirdPersonView == 2) { + vec3 = new Vec3(vec3.xCoord * -1.0, vec3.yCoord * -1.0, vec3.zCoord * -1.0); + } + for (int i = 0; i < mc.theWorld.getLoadedEntityList().size(); ++i) { + Entity entity = (Entity)mc.theWorld.getLoadedEntityList().get(i); + if (entity == null || entity == mc.thePlayer || !(entity instanceof AbstractClientPlayer)) continue; + AbstractClientPlayer player = (AbstractClientPlayer)entity; + Scoreboard scoreboard = player.getWorldScoreboard(); + ScoreObjective scoreObjective = scoreboard.func_96539_a(2); + float f5 = 0.0f; + if (player.getDistanceSqToEntity(mc.thePlayer) < (double)100 && scoreObjective != null) { + f5 = (float)((double)f5 + (double)((float)mc.fontRenderer.FONT_HEIGHT * 0.0375f)); + } + float f6 = (float)(player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)f - (double)f2); + float f7 = (float)(player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)f - (double)f3) + player.height + (player.isSneaking() ? 0.3F : 0.55F) + f5; + float f8 = (float)(player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)f - (double)f4); + Vec3 vec32 = new Vec3(f6, f7, f8); + double d3 = vec32.lengthVector(); + if (vec3.dotProduct(vec32 = vec32.normalize()) <= 0.02) { + double d4 = 1.5533430342749535; + double d5 = Math.sin(1.5533430342749535); + double d6 = Math.cos(1.5533430342749535); + Vec3 cross = vec3.crossProduct(vec32); + double d7 = cross.xCoord; + double d8 = cross.yCoord; + double d9 = cross.zCoord; + double d10 = d6 + d7 * d7 * (1.0 - d6); + double d11 = d7 * d8 * (1.0 - d6) - d9 * d5; + double d12 = d7 * d9 * (1.0 - d6) + d8 * d5; + double d13 = d8 * d7 * (1.0 - d6) + d9 * d5; + double d14 = d6 + d8 * d8 * (1.0 - d6); + double d15 = d8 * d9 * (1.0 - d6) - d7 * d5; + double d16 = d9 * d7 * (1.0 - d6) - d8 * d5; + double d17 = d9 * d8 * (1.0 - d6) + d7 * d5; + double d18 = d6 + d9 * d9 * (1.0 - d6); + f6 = (float)(d3 * (d10 * vec3.xCoord + d11 * vec3.yCoord + d12 * vec3.zCoord)); + f7 = (float)(d3 * (d13 * vec3.xCoord + d14 * vec3.yCoord + d15 * vec3.zCoord)); + f8 = (float)(d3 * (d16 * vec3.xCoord + d17 * vec3.yCoord + d18 * vec3.zCoord)); + } + FloatBuffer floatBuffer = BufferUtils.createFloatBuffer(3); + GLU.gluProject(f6, f7, f8, this.modelViewMatrixBuffer, this.projectionMatrixBuffer, intBuffer, floatBuffer); + float f9 = floatBuffer.get(0) / (float)event.getScaledResolution().getScaleFactor(); + float f10 = floatBuffer.get(1) / (float)event.getScaledResolution().getScaleFactor(); + GL11.glPushMatrix(); + GL11.glTranslatef(f9, (float)event.getScaledResolution().getScaledHeight() - f10, 0.0f); + float f11 = player.getHealth(); + String string = player.getCommandSenderName() + ((double)f11 != 1.0 ? " | " + this.setHealthColor(f11) + f11 : ""); + if (scoreObjective != null) { + Score score = scoreboard.func_96529_a(player.getCommandSenderName(), scoreObjective); + string = string + EnumChatFormatting.WHITE + " | " + this.setHealthColor(score.getScorePoints()) + score.getScorePoints(); + } + float f12 = mc.fontRenderer.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(string)); + mc.fontRenderer.drawStringWithShadow(string, (float)((int)(-f12) / 2), (float)(-mc.fontRenderer.FONT_HEIGHT), -1); + if (bl && map.containsKey(player.getGameProfile().getId().toString())) { + int n = 1; + for (Object o : (List) map.get(player.getGameProfile().getId().toString())) { + String string2 = (String) o; + mc.fontRenderer.drawCenteredStringWithShadow(string2, (int) (-f12) / 2, -mc.fontRenderer.FONT_HEIGHT * ++n, -1); + } + } + GL11.glPopMatrix(); + } + } + + private EnumChatFormatting setHealthColor(float f) { + return f > 15.0f ? EnumChatFormatting.DARK_GREEN : (f > 10.0f ? EnumChatFormatting.YELLOW : (f > 5.0f ? EnumChatFormatting.RED : EnumChatFormatting.DARK_RED)); + } + + public static Map getMap() { + return map; + } + + public static void setMap(Map map) { + StaffModuleNametags.map = map; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNoclip.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNoclip.java new file mode 100644 index 0000000..cec9a83 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleNoclip.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.event.impl.CollisionEvent; +import com.cheatbreaker.client.module.impl.staff.StaffMod; + +public class StaffModuleNoclip extends StaffMod { + public StaffModuleNoclip(String name) { + super(name); + this.setStaffModule(true); + this.addEvent(CollisionEvent.class, this::onCollisionEvent); + } + + private void onCollisionEvent(CollisionEvent collisionEvent) { + collisionEvent.setCanceled(true); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleXray.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleXray.java new file mode 100644 index 0000000..c5b0827 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/module/impl/staff/impl/StaffModuleXray.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.module.impl.staff.impl; + +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import net.minecraft.client.Minecraft; +import com.cheatbreaker.client.module.data.Setting; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + + +public class StaffModuleXray extends StaffMod { + private final List blocks; + public Setting opacity; + + public StaffModuleXray(String string) { + super(string); + this.setStaffModule(true); + this.blocks = new ArrayList<>(); + Collections.addAll(this.blocks, 14, 15, 16, 15, 56, 129, 52); + this.opacity = new Setting(this, "Opacity").setValue(45).setMinMax(15, 255); + } + + @Override + public void addAllEvents() { + super.addAllEvents(); + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + + @Override + public void removeAllEvents() { + super.removeAllEvents(); + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + + public boolean shouldRender(int blockID, boolean vanillaRender) { + return !this.isEnabled() ? vanillaRender : this.blocks.contains(blockID); + } + + public List getBlocks() { + return this.blocks; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/ByteBufWrapper.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/ByteBufWrapper.java new file mode 100644 index 0000000..a336aee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/ByteBufWrapper.java @@ -0,0 +1,79 @@ +package com.cheatbreaker.client.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; +import java.util.UUID; +import java.util.function.Consumer; +import java.util.function.Supplier; + +public class ByteBufWrapper { + private final ByteBuf buf; + + public ByteBufWrapper(ByteBuf byteBuf) { + this.buf = byteBuf; + } + + public void writeVarInt(int n) { + while ((n & 0xFFFFFF80) != 0) { + this.buf.writeByte(n & 0x7F | 0x80); + n >>>= 7; + } + this.buf.writeByte(n); + } + + public int readVarInt() { + byte by; + int n = 0; + int n2 = 0; + do { + by = this.buf.readByte(); + n |= (by & 0x7F) << n2++ * 7; + if (n2 <= 5) continue; + throw new RuntimeException("VarInt too big"); + } while ((by & 0x80) == 128); + return n; + } + + public void writeOptional(Object object, Consumer consumer) { + this.buf.writeBoolean(object != null); + if (object != null) { + consumer.accept(object); + } + } + + public Object readOptional(Supplier supplier) { + boolean bl = this.buf.readBoolean(); + if (bl) { + return supplier.get(); + } + return null; + } + + public void writeString(String string) { + byte[] arrby = string.getBytes(Charsets.UTF_8); + this.writeVarInt(arrby.length); + this.buf.writeBytes(arrby); + } + + public String readString() { + int n = this.readVarInt(); + byte[] arrby = new byte[n]; + this.buf.readBytes(arrby); + return new String(arrby, Charsets.UTF_8); + } + + public void writeUUID(UUID uUID) { + this.buf.writeLong(uUID.getMostSignificantBits()); + this.buf.writeLong(uUID.getLeastSignificantBits()); + } + + public UUID readUUID() { + long l = this.buf.readLong(); + long l2 = this.buf.readLong(); + return new UUID(l, l2); + } + + public ByteBuf buf() { + return this.buf; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentBooleanReference.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentBooleanReference.java new file mode 100644 index 0000000..6f49e4e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentBooleanReference.java @@ -0,0 +1,8 @@ +package com.cheatbreaker.client.network.agent; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(value=RetentionPolicy.RUNTIME) +public @interface AgentBooleanReference { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentByteArrayReference.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentByteArrayReference.java new file mode 100644 index 0000000..7675343 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentByteArrayReference.java @@ -0,0 +1,8 @@ +package com.cheatbreaker.client.network.agent; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(value=RetentionPolicy.RUNTIME) +public @interface AgentByteArrayReference { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentResources.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentResources.java new file mode 100644 index 0000000..f4ac913 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/agent/AgentResources.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.network.agent; + +public class AgentResources { + @AgentByteArrayReference + public static native byte[] getBytesNative(String var0); + + @AgentBooleanReference + public static native boolean existsBytesNative(String var0); + + public static boolean existsBytes(String string) { + boolean bl = false; + try { + bl = AgentResources.existsBytesNative(string); + } catch (UnsatisfiedLinkError ignore) { + + } + return bl; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/messages/Message.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/messages/Message.java new file mode 100644 index 0000000..d70286c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/messages/Message.java @@ -0,0 +1,137 @@ +package com.cheatbreaker.client.network.messages; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.Microphone; +import com.cheatbreaker.client.network.agent.AgentByteArrayReference; +import com.cheatbreaker.client.network.agent.AgentBooleanReference; +import com.cheatbreaker.client.network.agent.AgentResources; +import com.cheatbreaker.client.network.plugin.client.PacketClientVoice; +import net.minecraft.client.Minecraft; +import net.minecraft.client.main.Main; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.util.ChatComponentText; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +public class Message { + private final String action; + public static byte[] b; + public static byte[] a; + + public Message(String string) { + this.action = string; + } + + public String getAction() { + return this.action; + } + + public static native void a(String[] var0); + + public static native void b(String var0); + + public static native void c(String var0, String var1, String var2); + + public static void d() { + String string = ""; + String string2 = ""; + String string3 = ""; + String string4 = ""; + String string5 = ""; + String string6 = ""; + String string7 = ""; + for (Method accessibleObject : Minecraft.class.getMethods()) { + if (accessibleObject.getReturnType() == Minecraft.class) { + string = accessibleObject.getName() + ":()L" + Minecraft.class.getCanonicalName().replaceAll("\\.", "/") + ";"; + continue; + } + if (accessibleObject.getReturnType() != NetHandlerPlayClient.class) continue; + string2 = accessibleObject.getName() + ":()L" + NetHandlerPlayClient.class.getCanonicalName().replaceAll("\\.", "/") + ";"; + } + for (Method accessibleObject : NetHandlerPlayClient.class.getMethods()) { + if (accessibleObject.getParameterTypes().length != 1 || accessibleObject.getParameterTypes()[0] != Packet.class) continue; + string3 = accessibleObject.getName() + ":(L" + Packet.class.getCanonicalName().replaceAll("\\.", "/") + ";)V"; + } + for (Field accessibleObject : Entity.class.getFields()) { + if (accessibleObject.getType() != Float.TYPE) continue; + string4 = accessibleObject.getName() + ":F"; + break; + } + for (Method accessibleObject : Main.class.getMethods()) { + if (accessibleObject.getParameterTypes().length != 1 || accessibleObject.getParameterTypes()[0] != String[].class) continue; + string5 = accessibleObject.getName() + ":([Ljava/lang/String;)V"; + } + for (Method accessibleObject : AgentResources.class.getMethods()) { + if (accessibleObject.isAnnotationPresent(AgentByteArrayReference.class)) { + string6 = accessibleObject.getName() + ":(Ljava/lang/String;)[B"; + } + if (!accessibleObject.isAnnotationPresent(AgentBooleanReference.class)) continue; + string7 = accessibleObject.getName() + ":(Ljava/lang/String;)Z"; + } + Message.a(new String[]{Message.r(C17PacketCustomPayload.class.getName()), + Message.r(S3FPacketCustomPayload.class.getName()), Message.r(Minecraft.class.getName()), + Message.r(NetHandlerPlayClient.class.getName()), Message.r(Entity.class.getName()), + Message.r(AgentResources.class.getName()), Message.r(Main.class.getName()), string, string2, string3, string4, + string5, string6, string7}); + } + + private static String r(String string) { + return string.replaceAll("\\.", "/"); + } + + public static native void e(boolean var0); + + public static native void f(String var0, byte[] var1); + + public static void j(byte[] arrby) { + CheatBreaker.getInstance().getCbNetHandler().sendPacket(new PacketClientVoice(arrby)); + } + + public static void r(byte[] arrby) { + b = arrby; + Minecraft mc = Minecraft.getMinecraft(); + if (mc.theWorld != null && mc.getNetHandler().getNetworkManager().getChannel().isOpen() && + CheatBreaker.getInstance().getCbNetHandler().hasRegisteredBinary()) { + mc.getNetHandler().getNetworkManager().getChannel(). + writeAndFlush(new C17PacketCustomPayload(CheatBreaker.getInstance().getPluginBinaryChannel(), arrby)); + } + } + + public static void g(String[] micDescription, String[] micName) { + for (int i = 0; i < micDescription.length; ++i) { + System.out.println(CheatBreaker.getInstance().getLoggerPrefix() + "Added mic option: " + micName[i]); + CheatBreaker.getInstance().getAudioManager().getMicrophones().add(new Microphone(micDescription[i], micName[i])); + } + } + + public static native void h(String var0); + + public static native byte[] i(); + + public static native void k(); + + public static native void l(float var0); + + public static native void m(float var0); + + public static void n() { + Minecraft.getMinecraft().gameSettings.saveOptions(); + CheatBreaker.getInstance().configManager.write(); + CheatBreaker.getInstance().getWSNetHandler().close(); + System.exit(0); + } + + public static void o(String string) { + Minecraft mc = Minecraft.getMinecraft(); + if (mc != null && mc.ingameGUI != null && mc.ingameGUI.getChatGUI() != null) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(new ChatComponentText(string)); + } + } + + public static native void s(int var0, boolean var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/netty/CBChannelInboundHandlerAdap.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/netty/CBChannelInboundHandlerAdap.java new file mode 100644 index 0000000..fdff66f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/netty/CBChannelInboundHandlerAdap.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.network.netty; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import javax.crypto.SecretKey; + +public class CBChannelInboundHandlerAdap extends ChannelInboundHandlerAdapter { + private long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private long lIIIIIIIIIlIllIIllIlIIlIl = 0L; + private long IlllIIIlIlllIllIlIIlllIlI; + private long IIIIllIlIIIllIlllIlllllIl; + private final byte[] IIIIllIIllIIIIllIllIIIlIl = "cf2O02b1QJSZOcVHphHucA".getBytes(); + + public CBChannelInboundHandlerAdap(SecretKey secretKey) { + for (byte by : secretKey.getEncoded()) { + this.lIIIIlIIllIIlIIlIIIlIIllI = (this.lIIIIlIIllIIlIIlIIIlIIllI + (long)(by & 0xFF)) % 65521L; + this.lIIIIIIIIIlIllIIllIlIIlIl = (this.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIlIIllIIlIIlIIIlIIllI) % 65521L; + } + } + + @Override + public void channelRead(ChannelHandlerContext channelHandlerContext, Object object) { + ByteBuf byteBuf = (ByteBuf)object; + while (byteBuf.readableBytes() > 0) { + int n = byteBuf.readByte() & 0xFF; + this.lIIIIlIIllIIlIIlIIIlIIllI = (this.lIIIIlIIllIIlIIlIIIlIIllI + (long)n) % 65521L; + this.lIIIIIIIIIlIllIIllIlIIlIl = (this.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIlIIllIIlIIlIIIlIIllI) % 65521L; + } + byteBuf.readerIndex(0); + for (byte by : this.IIIIllIIllIIIIllIllIIIlIl) { + this.lIIIIlIIllIIlIIlIIIlIIllI = (this.lIIIIlIIllIIlIIlIIIlIIllI + (long)(by & 0xFF)) % 65521L; + this.lIIIIIIIIIlIllIIllIlIIlIl = (this.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIlIIllIIlIIlIIIlIIllI) % 65521L; + } + this.IlllIIIlIlllIllIlIIlllIlI = this.IIIIllIlIIIllIlllIlllllIl; + this.IIIIllIlIIIllIlllIlllllIl = this.lIIIIIIIIIlIllIIllIlIIlIl << 16 | this.lIIIIlIIllIIlIIlIIIlIIllI; + try { + super.channelRead(channelHandlerContext, object); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + public long lIIIIlIIllIIlIIlIIIlIIllI() { + return this.IlllIIIlIlllIllIlIIlllIlI; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/netty/CBPingInboundHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/netty/CBPingInboundHandler.java new file mode 100644 index 0000000..7f7bde9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/netty/CBPingInboundHandler.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.network.netty; + +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +public class CBPingInboundHandler extends ChannelInboundHandlerAdapter { + private final CBChannelInboundHandlerAdap channelInboundHandlerAdap; + private long maxTime = System.nanoTime() - 30000000000L; + private final Minecraft mc = Minecraft.getMinecraft(); + private long version = 0L; + + public CBPingInboundHandler(CBChannelInboundHandlerAdap var1) { + this.channelInboundHandlerAdap = var1; + } + + @Override + public void channelRead(ChannelHandlerContext ctx, Object packet) throws Exception { + S3FPacketCustomPayload payload; + if (packet instanceof S3FPacketCustomPayload && (payload = (S3FPacketCustomPayload)packet).func_149169_c().equals("CB|PING")) { + this.maxTime = System.nanoTime(); + long version = (long)new DataInputStream(new ByteArrayInputStream(payload.func_149168_d())).readInt() & 0xFFFFFFFFL; + if (version != this.channelInboundHandlerAdap.lIIIIlIIllIIlIIlIIIlIIllI()) { + throw new IOException("CheatBreaker Protocol Error -2a\n(Try updating your client)"); + } + ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream(); + DataOutputStream dataOutputStream = new DataOutputStream(arrayOutputStream); + try { + dataOutputStream.write(payload.func_149168_d()); + if ((this.version++ & 7L) == 0L) { + dataOutputStream.writeLong(this.version); + dataOutputStream.writeUTF(this.mc.currentServerData.serverIP); + dataOutputStream.writeUTF(this.mc.getSession().getPlayerID()); + dataOutputStream.writeUTF(this.mc.entityRenderer.getClass().getName()); + } + } catch (IOException ignored) { + + } + ctx.channel().eventLoop().execute(() -> ctx.channel().writeAndFlush(new C17PacketCustomPayload("CB|PONG", arrayOutputStream.toByteArray()))); + } + if (System.nanoTime() - this.maxTime > 45000000000L) { + throw new IOException("CheatBreaker Protocol Error -2b\n(Try updating your client)"); + } + super.channelRead(ctx, packet); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBNetHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBNetHandler.java new file mode 100644 index 0000000..c206c7f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBNetHandler.java @@ -0,0 +1,535 @@ +package com.cheatbreaker.client.network.plugin; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.ClickStateEvent; +import com.cheatbreaker.client.event.impl.ConnectEvent; +import com.cheatbreaker.client.event.impl.DisconnectEvent; +import com.cheatbreaker.client.event.impl.PluginMessageEvent; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.MiniMapRules; +import com.cheatbreaker.client.module.impl.normal.ModuleMiniMap; +import com.cheatbreaker.client.module.impl.normal.hud.ModuleScoreboard; +import com.cheatbreaker.client.module.impl.normal.hud.cooldowns.ModuleCooldowns; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleNametags; +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; +import com.cheatbreaker.client.network.plugin.server.*; +import com.cheatbreaker.client.network.plugin.shared.PacketAddWaypoint; +import com.cheatbreaker.client.network.plugin.shared.PacketRemoveWaypoint; +import com.cheatbreaker.client.util.render.hologram.Hologram; +import com.cheatbreaker.client.util.render.teammates.CBTeammate; +import com.cheatbreaker.client.util.render.title.CBTitle; +import com.cheatbreaker.client.util.render.title.TitleType; +import com.cheatbreaker.client.util.voicechat.VoiceChannel; +import com.cheatbreaker.client.util.voicechat.VoiceUser; +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableList; +import com.google.gson.Gson; +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.VoxelMap; +import com.thevoxelbox.voxelmap.WaypointManager; +import com.thevoxelbox.voxelmap.util.Waypoint; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.event.HoverEvent; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.awt.*; +import java.util.List; +import java.util.*; + +public class CBNetHandler implements ICBNetHandlerClient { + final CheatBreaker cb = CheatBreaker.getInstance(); + private boolean registeredClient = false; + private boolean registeredBinary = false; + private boolean serverHandlesWaypoints; + private boolean voiceChatEnabled = false; + private List voiceChannels; + private VoiceChannel voiceChannel; + private boolean competitiveGamemode; + private final List voiceusers = new ArrayList<>(); + private final List mutedUsers = new ArrayList<>(); + private String world = ""; + private final Map> nametagsMap = new HashMap<>(); + private boolean onALunarServer = false; + private boolean isLegacyLunar = false; + + public void onClickEvent(ClickStateEvent var1) { + } + + public void onConnect(final ConnectEvent connectEvent) { + this.registeredBinary = false; + } + + public void onPluginMessage(PluginMessageEvent customPayload) { + try { + if (customPayload.getChannelName().equals("REGISTER")) { + String payload = new String(customPayload.getBufferData(), Charsets.UTF_8); + this.registeredClient = payload.contains(this.cb.getCheatBreakerPluginMessageChannel()); + if (!this.registeredClient) { + this.onALunarServer = payload.contains(this.cb.getLatestLunarPluginMessageChannel()); + if (!this.onALunarServer) { + boolean legacy = payload.contains(this.cb.getLunarPluginMessageChannel()); + this.onALunarServer = legacy; + if (legacy) { + this.isLegacyLunar = true; + } + } + } + this.registeredBinary = payload.contains(this.cb.getPluginBinaryChannel()); + PacketBuffer wrapper = new PacketBuffer(Unpooled.buffer()); + wrapper.writeBytes(this.cb.getCheatBreakerPluginMessageChannel().getBytes(Charsets.UTF_8)); + if (Minecraft.getMinecraft().getNetHandler() != null && this.registeredClient) { + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C17PacketCustomPayload("REGISTER", wrapper)); + } + + PacketBuffer wrapper2 = new PacketBuffer(Unpooled.buffer()); + wrapper2.writeBytes(this.isLegacyLunar ? this.cb.getLunarPluginMessageChannel().getBytes(Charsets.UTF_8) : this.cb.getLatestLunarPluginMessageChannel().getBytes(Charsets.UTF_8)); + if (Minecraft.getMinecraft().getNetHandler() != null) { + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C17PacketCustomPayload("REGISTER", wrapper2)); + } + this.initialize(); + } else if (customPayload.getChannelName().equals(this.cb.getCheatBreakerPluginMessageChannel()) || customPayload.getChannelName().equals(this.cb.getLunarPluginMessageChannel()) || customPayload.getChannelName().equals(this.cb.getLatestLunarPluginMessageChannel())) { + CBPacket packet = CBPacket.handle(this, customPayload.getBufferData()); + if (packet != null) { + packet.process(this); + } + if (this.cb.getGlobalSettings().isDebug) { + ChatComponentText debugPrefix = new ChatComponentText(EnumChatFormatting.GRAY + "Received: " + EnumChatFormatting.WHITE + packet.getClass().getSimpleName()); + debugPrefix.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(new Gson().toJson(packet)))); + debugPrefix.setBranded(true); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(debugPrefix); + } + } + } catch (AssertionError | Exception ex) { + ex.printStackTrace(); + } + } + + private void initialize() { + this.cb.getModuleManager().miniMapMod.getVoxelMap().getWaypointManager().getWaypoints().removeIf(var0 -> var0.isAutomated); + this.voiceChatEnabled = false; + this.serverHandlesWaypoints = false; + this.voiceChannels = null; + this.voiceChannel = null; + this.competitiveGamemode = false; + this.world = ""; + this.mutedUsers.clear(); + for (AbstractModule var2 : this.cb.getModuleManager().staffMods) { + ((StaffMod)var2).disableStaffModule(); + } + this.cb.getWorldBorderManager().clearBorders(); + this.resetWorldStuff(); + ModuleMiniMap.rule = MiniMapRules.FORCED_OFF; + ModuleScoreboard.minimapRule = MiniMapRules.NEUTRAL; + this.cb.getModuleManager().teammatesMod.getTeammates().clear(); + Hologram.getHolograms().clear(); + VoxelMap var3 = this.cb.getModuleManager().miniMapMod.getVoxelMap(); + if (Minecraft.getMinecraft().thePlayer != null && var3.getWaypointManager() != null) { + var3.getWaypointManager().getWaypoints().removeIf(var0 -> var0.packetWaypoint); + ((WaypointManager)var3.getWaypointManager()).getOld2dWayPts().removeIf(var0 -> var0.packetWaypoint); + if (((WaypointManager)var3.getWaypointManager()).getEntityWaypointContainer() != null) { + ((WaypointManager)var3.getWaypointManager()).getEntityWaypointContainer().wayPts.removeIf(var0 -> var0.packetWaypoint); + MapSettingsManager.instance.saveAll(); + var3.getWaypointManager().check2dWaypoints(); + } + } + } + + public void resetWorldStuff() { + this.cb.getTitleManager().getTitles().clear(); + StaffModuleNametags.setMap(null); + } + + public void sendPacket(CBPacket var1) { + if (var1 != null && this.cb.getGlobalSettings().isDebug) { +// ChatComponentText var2 = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET); + ChatComponentText var3 = new ChatComponentText(EnumChatFormatting.GRAY + "Sent: " + EnumChatFormatting.WHITE + var1.getClass().getSimpleName()); + var3.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(new Gson().toJson(var1)))); +// var2.appendSibling(var3); + var3.setBranded(true); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(var3); + } + C17PacketCustomPayload var4 = new C17PacketCustomPayload(this.cb.getLunarPluginMessageChannel(), CBPacket.getPacketData(var1)); + Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(var4); + } + + public void onDisconnect(DisconnectEvent var1) { + this.registeredClient = false; + this.registeredBinary = false; + } + + @Override + public void handleAddWaypoint(PacketAddWaypoint var1) { + int xPos = var1.getX(); + int yPos = var1.getY(); + int zPos = var1.getZ(); + VoxelMap voxelMap = this.cb.getModuleManager().miniMapMod.getVoxelMap(); + if (!voxelMap.getWaypointManager().getWaypoints().stream().anyMatch(lWay -> + lWay.name.equals(var1.getName()) && lWay.sWorld.equals(var1.getWorld()))) { + Color color = new Color(var1.getColor()); + float red = (float)color.getRed() / 255.0f; + float green = (float)color.getGreen() / 255.0f; + float blue = (float)color.getBlue() / 255.0f; + TreeSet dimensions = new TreeSet(); + dimensions.add(-1); + dimensions.add(0); + dimensions.add(1); + System.out.println("Received waypoint (" + var1.getName() + ")[x" + xPos + ",y" + + yPos + ",z" + zPos + "][r" + red + ",g" + green + ",b" + blue + "]"); + Waypoint waypoint = new Waypoint(var1.getName(), xPos, zPos, yPos, true, red, green, blue, "", voxelMap.getWaypointManager().getCurrentSubworldDescriptor(), dimensions, true, true); + waypoint.forced = var1.isForced(); + waypoint.sWorld = var1.getWorld(); + waypoint.packetWaypoint = true; + voxelMap.getWaypointManager().addWaypoint(waypoint); + } + } + + @Override + public void handleRemoveWaypoint(PacketRemoveWaypoint var1) { + try { + String var2 = var1.getName(); + VoxelMap var3 = this.cb.getModuleManager().miniMapMod.getVoxelMap(); + var3.getWaypointManager().getWaypoints().removeIf(var2x -> var2x.sWorld.equals(var1.getWorld()) && var2x.isAutomated && var2x.name.equalsIgnoreCase(var2)); + ((WaypointManager)var3.getWaypointManager()).getOld2dWayPts().removeIf(var2x -> var2x.sWorld.equals(var1.getWorld()) && var2x.isAutomated && var2x.name.equalsIgnoreCase(var2)); + ((WaypointManager)var3.getWaypointManager()).getEntityWaypointContainer().wayPts.removeIf(var2x -> var2x.sWorld.equals(var1.getWorld()) && var2x.isAutomated && var2x.name.equalsIgnoreCase(var2)); + MapSettingsManager.instance.saveAll(); + var3.getWaypointManager().check2dWaypoints(); + } catch (Exception var4) { + var4.printStackTrace(); + } + } + + @Override + public void handleCooldown(PacketCooldown var1) { + ModuleCooldowns.addCooldown(var1.getMessage(), var1.getDurationMs(), var1.getIconId()); + } + + @Override + public void handleNotification(PacketNotification var1) { + this.cb.getModuleManager().notificationsMod.send( + var1.getLevel(), var1.getMessage(), var1.getDurationMs()); + } + + @Override + public void handleStaffModState(PacketStaffModState var1) { + for (AbstractModule var3 : this.cb.getModuleManager().staffMods) { + if (!var3.getName().equals(var1.getId().replaceAll("_", "").toLowerCase())) continue; + var3.setStaffModuleEnabled(var1.getState()); + } + } + + @Override + public void handleUpdateNametags(PacketUpdateNametags var1) { + if (var1.getPlayersMap() != null) { + StaffModuleNametags.setMap(new HashMap()); + for (Map.Entry> var3 : var1.getPlayersMap().entrySet()) { + StaffModuleNametags.getMap().put(var3.getKey().toString(), var3.getValue()); + } + } else { + StaffModuleNametags.setMap(null); + } + } + + @Override + public void handleTeammates(PacketTeammates packet) { + Map> players = packet.getPlayers(); + UUID leader = packet.getLeader(); + long lastMs = packet.getLastMs(); + if (!(!(Boolean) this.cb.getGlobalSettings().enableTeamView.getValue() + || players == null || players.isEmpty() || players.size() == 1 && players.containsKey(Minecraft.getMinecraft().thePlayer.getUniqueID()))) { + int var6 = 0; + for (Map.Entry> teammates : players.entrySet()) { + CBTeammate teammate = this.cb.getModuleManager().teammatesMod.createTeammate(teammates.getKey().toString()); + if (teammate == null) { + teammate = new CBTeammate(teammates.getKey().toString(), leader != null && leader.equals(teammates.getKey())); + this.cb.getModuleManager().teammatesMod.getTeammates().add(teammate); + Random var10 = new Random(); + if (var6 < this.cb.getModuleManager().teammatesMod.getColors().length) { + teammate.setColor(new Color(this.cb.getModuleManager().teammatesMod.getColors()[var6])); + } else { + float var11 = var10.nextFloat(); + float var12 = var10.nextFloat(); + float var13 = var10.nextFloat() / 2.0f; + teammate.setColor(new Color(var11, var12, var13)); + } + } + try { + double xPos = (Double)((Map)teammates.getValue()).get("x"); + double yPos = (Double)((Map)teammates.getValue()).get("y") + 2.0; + double zPos = (Double)((Map)teammates.getValue()).get("z"); + teammate.updateTeammate(xPos, yPos, zPos, lastMs); + } catch (Exception var16) { + var16.printStackTrace(); + } + ++var6; + } + this.cb.getModuleManager().teammatesMod.getTeammates().removeIf(var1x -> + !players.containsKey(UUID.fromString(var1x.getUuid()))); + } else { + this.cb.getModuleManager().teammatesMod.getTeammates().clear(); + } + } + + @Override + public void handleOverrideNametags(PacketOverrideNametags var1) { + if (var1.getTags() == null) { + this.nametagsMap.remove(var1.getUUID()); + } else { + Collections.reverse(var1.getTags()); + this.nametagsMap.put(var1.getUUID(), var1.getTags()); + } + } + + @Override + public void handleAddHologram(PacketAddHologram var1) { + Hologram var2 = new Hologram(var1.getUUID(), var1.getX(), var1.getY(), var1.getZ()); + Hologram.getHolograms().add(var2); + var2.setLines(var1.getLines().toArray(new String[0])); + } + + @Override + public void handleUpdateHologram(PacketUpdateHologram var1) { + Hologram.getHolograms().stream().filter(var1x -> + var1x.getUUID().equals(var1.getUUID())). + forEach(var1x -> var1x.setLines(var1.getLines().toArray(new String[0]))); + } + + @Override + public void handleRemoveHologram(PacketRemoveHologram var1) { + Hologram.getHolograms().removeIf(var1x -> var1x.getUUID().equals(var1.getUUID())); + } + + @Override + public void handleTitle(PacketTitle var1) { + TitleType var2 = TitleType.SUBTITLE; + if (var1.getType().equalsIgnoreCase("subtitle")) { + var2 = TitleType.TITLE; + } + this.cb.getTitleManager().getTitles().add( + new CBTitle(var1.getMessage(), var2, var1.getScale(), + var1.getDisplayTimeMs(), var1.getFadeInTimeMs(), var1.getFadeOutTimeMs())); + } + + @Override + public void handleServerRule(PacketServerRule var1) { + switch (var1.getRule().ordinal()) { + case 0: + this.logger("Voice is: " + (var1.getBoolean() ? "enabled" : "disabled")); + this.voiceChatEnabled = var1.getBoolean(); + break; + case 1: + String value; + switch (value = var1.getRuleName()) { + case "NEUTRAL": + ModuleMiniMap.rule = MiniMapRules.NEUTRAL; + return; + case "FORCED_OFF": + ModuleMiniMap.rule = MiniMapRules.FORCED_OFF; + return; + } + return; + case 2: + this.serverHandlesWaypoints = var1.getBoolean(); + break; + case 3: + this.competitiveGamemode = var1.getBoolean(); + } + } + + @Override + public void handleVoice(PacketVoice var1) { + this.cb.getModuleManager().voiceChat.updateUser(var1.getUUID()); + } + + @Override + public void handleVoiceChannel(PacketVoiceChannel var1) { + this.logger("Voice Channel Received: " + var1.getName()); + this.logger("Channel has " + var1.getPlayers().size() + " members"); + if (!this.doesVoiceChannelExist(var1.getUUID())) { + if (this.voiceChannels == null) { + this.voiceChannels = new ArrayList(); + } + VoiceChannel var2 = new VoiceChannel(var1.getUUID(), var1.getName()); + this.voiceChannels.add(var2); + ArrayList var3 = new ArrayList(); + for (Map.Entry var5 : var1.getPlayers().entrySet()) { + this.logger("Added member [" + var5.getValue() + "]"); + VoiceUser var6 = var2.createUser(var5.getKey(), var5.getValue()); + if (var6 == null) continue; + var3.add(var6); + } + this.addMutedUsers(var3); + for (Map.Entry var5 : var1.getListening().entrySet()) { + this.logger("Added listener [" + var5.getValue() + "]"); + var2.addListener(var5.getKey(), var5.getValue()); + } + } + } + + @Override + public void handleVoiceChannelUpdate(PacketVoiceChannelUpdate var1) { + this.logger("Channel Update: " + var1.getName() + " (" + var1.getStatus() + ")"); + if (this.voiceChannels != null) { + VoiceChannel var2 = this.getVoiceChannel(var1.getChannelUUID()); + if (var2 == null) { + this.logger(var1.getChannelUUID().toString()); + } else { + switch (var1.getStatus()) { + case 0: + VoiceUser var3 = var2.createUser(var1.getUUID(), var1.getName()); + if (var3 == null) break; + this.addMutedUsers(ImmutableList.of(var3)); + break; + case 1: + var2.removeUser(var1.getUUID()); + break; + case 2: + if (!var1.getUUID().toString().equals(Minecraft.getMinecraft().getSession().getPlayerID())) { + if (this.voiceChannel == var2) { +// ChatComponentText var4 = new ChatComponentText(EnumChatFormatting.AQUA + var1.getName() + EnumChatFormatting.AQUA + " joined " + var2.getName() + " channel. Press '" + Keyboard.getKeyName(this.cb.getGlobalSettings().keyBindOpenVoiceMenu.getKeyCode()) + "'!" + EnumChatFormatting.RESET); +// Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(var4); + } + } else { + this.voiceChannel = var2; + for (VoiceChannel var5 : this.voiceChannels) { + var5.removeListeners(var1.getUUID()); + } +// ChatComponentText var4 = new ChatComponentText(EnumChatFormatting.AQUA + "Joined " + var2.getName() + " channel. Press '" + Keyboard.getKeyName(this.cb.getGlobalSettings().keyBindVoicePushToTalk.getKeyCode()) + "' to talk!" + EnumChatFormatting.RESET); +// Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(var4); + } + var2.addListener(var1.getUUID(), var1.getName()); + break; + case 3: + if (this.voiceChannel == var2 && !var1.getUUID().toString().equals(Minecraft.getMinecraft().getSession().getPlayerID())) { +// ChatComponentText var4 = new ChatComponentText(EnumChatFormatting.AQUA + var1.getName() + EnumChatFormatting.AQUA + " left " + var2.getName() + " channel. Press '" + Keyboard.getKeyName(this.cb.getGlobalSettings().keyBindOpenVoiceMenu.getKeyCode()) + "'!" + EnumChatFormatting.RESET); +// Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(var4); + } + var2.removeListeners(var1.getUUID()); + } + } + } + } + + private void addMutedUsers(List var1) { + for (VoiceUser var3 : var1) { + if (var3 == null || !this.voiceusers.contains(var3.getPlayerUUID()) + || this.mutedUsers.contains(var3.getPlayerUUID())) continue; + this.mutedUsers.add(var3.getPlayerUUID()); + this.sendPacket(new PacketVoiceMute(var3.getPlayerUUID())); + } + } + + @Override + public void handleDeleteVoiceChannel(PacketDeleteVoiceChannel var1) { + this.logger("Deleted channel: " + var1.getChannelId().toString()); + if (this.voiceChannels != null) { + this.voiceChannels.removeIf(var1x -> var1x.getUuid().equals(var1.getChannelId())); + } + if (this.voiceChannel != null && this.voiceChannel.getUuid().equals(var1.getChannelId())) { + this.voiceChannel = null; + } + } + + @Override + public void handleUpdateWorld(PacketUpdateWorld var1) { + this.logger("World Update: " + var1.getWorld()); + this.world = var1.getWorld(); + } + + @Override + public void handleServerUpdate(PacketServerUpdate var1) { + this.logger("Retrieved " + var1.getServer()); + this.cb.updateServerInfo(var1.getServer()); +// this.cb.updateTheRPC(Minecraft.getMinecraft().currentServerData.serverIP, var1.getServer(), false); + } + + @Override + public void handleWorldBorder(PacketWorldBorder packet) { + this.cb.getWorldBorderManager().createBorder(packet.getId(), packet.getWorld(), packet.getColor(), packet.getMinX(), packet.getMinZ(), packet.getMaxX(), packet.getMaxZ(), packet.canShrinkExpand(), packet.doesCancelExit()); + } + + @Override + public void handleWorldBorderUpdate(PacketWorldBorderUpdate packet) { + this.cb.getWorldBorderManager().updateBorder(packet.getId(), packet.getMinX(), packet.getMinZ(), packet.getMaxX(), packet.getMaxZ(), packet.getDurationTicks()); + } + + @Override + public void handleWorldBorderRemove(PacketWorldBorderRemove packet) { + this.cb.getWorldBorderManager().removeBorder(packet.getId()); + } + + private boolean doesVoiceChannelExist(UUID var1) { + return this.getVoiceChannel(var1) != null; + } + + private VoiceChannel getVoiceChannel(UUID var1) { + VoiceChannel var3; + if (this.voiceChannels == null) { + return null; + } + Iterator var2 = this.voiceChannels.iterator(); + do { + if (var2.hasNext()) continue; + return null; + } while (!(var3 = var2.next()).getUuid().equals(var1)); + return var3; + } + + public VoiceUser getVoiceUser(UUID var1) { + if (this.voiceChannels != null && this.voiceChannel != null) { + VoiceUser var3; + Iterator var2 = this.voiceChannel.getUsers().iterator(); + do { + if (var2.hasNext()) continue; + return null; + } while (!(var3 = var2.next()).getPlayerUUID().equals(var1)); + return var3; + } + return null; + } + + private void logger(String var1) { + System.out.println("\u001b[31m[CheatBreaker]\u001b[0m " + var1); + } + + public boolean hasRegisteredBinary() { + return this.registeredBinary; + } + + public boolean doesServerHandleWaypoints() { + return this.serverHandlesWaypoints; + } + + public boolean isVoiceChatEnabled() { + return this.voiceChatEnabled; + } + + public List getVoiceChannels() { + return this.voiceChannels; + } + + public VoiceChannel getCurrentVoiceChannel() { + return this.voiceChannel; + } + + public boolean isCompetitveGamemode() { + return this.competitiveGamemode; + } + + public List getVoiceUsers() { + return this.voiceusers; + } + + public String getWorldUID() { + return this.world; + } + + public Map> getNametagsMap() { + return this.nametagsMap; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBOutboundChannel.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBOutboundChannel.java new file mode 100644 index 0000000..38f60f6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBOutboundChannel.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.network.plugin; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelOutboundHandlerAdapter; +import io.netty.channel.ChannelPromise; +import lombok.SneakyThrows; + +import javax.crypto.SecretKey; + +public class CBOutboundChannel extends ChannelOutboundHandlerAdapter { + private long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private long lIIIIIIIIIlIllIIllIlIIlIl = 0L; + private long IlllIIIlIlllIllIlIIlllIlI; + private final byte[] IIIIllIlIIIllIlllIlllllIl = "ZB9hEJy5l+u8QARAlX9T0w".getBytes(); + + public CBOutboundChannel(SecretKey secretKey) { + for (byte by : secretKey.getEncoded()) { + this.lIIIIlIIllIIlIIlIIIlIIllI = (this.lIIIIlIIllIIlIIlIIIlIIllI + (long)(by & 0xFF)) % 65521L; + this.lIIIIIIIIIlIllIIllIlIIlIl = (this.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIlIIllIIlIIlIIIlIIllI) % 65521L; + } + } + + @Override@SneakyThrows + public void write(ChannelHandlerContext channelHandlerContext, Object object, ChannelPromise channelPromise) { + ByteBuf byteBuf = (ByteBuf)object; + while (byteBuf.readableBytes() > 0) { + int n = byteBuf.readByte() & 0xFF; + this.lIIIIlIIllIIlIIlIIIlIIllI = (this.lIIIIlIIllIIlIIlIIIlIIllI + (long)n) % 65521L; + this.lIIIIIIIIIlIllIIllIlIIlIl = (this.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIlIIllIIlIIlIIIlIIllI) % 65521L; + } + byteBuf.readerIndex(0); + for (byte by : this.IIIIllIlIIIllIlllIlllllIl) { + this.lIIIIlIIllIIlIIlIIIlIIllI = (this.lIIIIlIIllIIlIIlIIIlIIllI + (long)(by & 0xFF)) % 65521L; + this.lIIIIIIIIIlIllIIllIlIIlIl = (this.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIlIIllIIlIIlIIIlIIllI) % 65521L; + } + this.IlllIIIlIlllIllIlIIlllIlI = this.lIIIIIIIIIlIllIIllIlIIlIl << 16 | this.lIIIIlIIllIIlIIlIIIlIIllI; + super.write(channelHandlerContext, object, channelPromise); + } + + public long lIIIIlIIllIIlIIlIIIlIIllI() { + return this.IlllIIIlIlllIllIlIIlllIlI; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBPacket.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBPacket.java new file mode 100644 index 0000000..fcdc863 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/CBPacket.java @@ -0,0 +1,159 @@ +package com.cheatbreaker.client.network.plugin; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.client.PacketClientVoice; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceChannelSwitch; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; +import com.cheatbreaker.client.network.plugin.server.*; +import com.cheatbreaker.client.network.plugin.shared.PacketAddWaypoint; +import com.cheatbreaker.client.network.plugin.shared.PacketRemoveWaypoint; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import io.netty.buffer.Unpooled; + + +/* + * This class works exactly the same way + * as the Websocket packet system! :) + */ +public abstract class CBPacket { + private static final BiMap REGISTRY = HashBiMap.create(); + private Object attachment; + + /* + * Writes outgoing data. + * Example: I wrote a string using buf.writeString(); ! + */ + public abstract void write(ByteBufWrapper buf); + + /* + * Reads incoming traffic. + */ + public abstract void read(ByteBufWrapper buf); + + /* + * This gets ran when a packet is received. + * Example: When I receive the packet, a chat message is printed. + */ + public abstract void process(ICBNetHandler netHandler); + + /* + * Handles incoming traffic read by the packet. + */ + public static CBPacket handle(ICBNetHandler iCBNetHandler, byte[] arrby) { + return CBPacket.handle(iCBNetHandler, arrby, null); + } + + /* + * Writes to the server and returns the array. + */ + public static CBPacket handle(ICBNetHandler iCBNetHandler, byte[] arrby, Object object) { + ByteBufWrapper byteBufWrapper = new ByteBufWrapper(Unpooled.wrappedBuffer(arrby)); + int n = byteBufWrapper.readVarInt(); + Class class_ = (Class)REGISTRY.inverse().get(n); + if (class_ != null) { + try { + CBPacket cBPacket = (CBPacket)class_.newInstance(); + if (object != null) { + cBPacket.setAttachment(object); + } + cBPacket.read(byteBufWrapper); + return cBPacket; + } catch (IllegalAccessException | InstantiationException exception) { + exception.printStackTrace(); + } + } + return null; + } + + /* + * Writes to the server and returns the array. + */ + public static byte[] getPacketData(CBPacket cBPacket) { + ByteBufWrapper byteBufWrapper = new ByteBufWrapper(Unpooled.buffer()); + byteBufWrapper.writeVarInt((Integer)REGISTRY.get(cBPacket.getClass())); + cBPacket.write(byteBufWrapper); + return byteBufWrapper.buf().array(); + } + + /* + * Checks if the list already contains a packet, if not, it adds it. + */ + private static void addPacket(int n, Class clazz) { + if (REGISTRY.containsKey(clazz)) { + throw new IllegalArgumentException("Duplicate packet class (" + clazz.getSimpleName() + "), already used by " + REGISTRY.get(clazz)); + } + if (REGISTRY.containsValue(n)) { + throw new IllegalArgumentException("Duplicate packet ID (" + n + "), already used by" + ((Class)REGISTRY.inverse().get(n)).getSimpleName()); + } + REGISTRY.put(clazz, n); + } + + /* + * Writes the length of incoming traffic and the traffic itself short using the ByteBufWrapper. + */ + protected void writeBlob(ByteBufWrapper byteBufWrapper, byte[] arrby) { + byteBufWrapper.buf().writeShort(arrby.length); + byteBufWrapper.buf().writeBytes(arrby); + } + + /* + * Reads incoming data and returns it as bytes. + */ + protected byte[] readBlob(ByteBufWrapper byteBufWrapper) { + // packetId + final short s = byteBufWrapper.buf().readShort(); + if (s >= 0) { + byte[] arrby = new byte[s]; + byteBufWrapper.buf().readBytes(arrby); + return arrby; + } + System.out.println("Key was smaller than nothing! Weird key!"); + return null; + } + + /* + * Sets the Attachment. + */ + public void setAttachment(Object object) { + this.attachment = object; + } + + /* + * Gets the attachment. + */ + public Object getAttachment() { + return this.attachment; + } + + /* + * Registers all the plugin packets for use on the client. + */ + static { + CBPacket.addPacket(0, PacketClientVoice.class); + CBPacket.addPacket(1, PacketVoiceMute.class); + CBPacket.addPacket(2, PacketVoiceChannelSwitch.class); + CBPacket.addPacket(3, PacketCooldown.class); + CBPacket.addPacket(4, PacketAddHologram.class); + CBPacket.addPacket(5, PacketUpdateHologram.class); + CBPacket.addPacket(6, PacketRemoveHologram.class); + CBPacket.addPacket(7, PacketOverrideNametags.class); + CBPacket.addPacket(8, PacketUpdateNametags.class); + CBPacket.addPacket(9, PacketNotification.class); + CBPacket.addPacket(10, PacketServerRule.class); + CBPacket.addPacket(11, PacketServerUpdate.class); + CBPacket.addPacket(12, PacketStaffModState.class); + CBPacket.addPacket(13, PacketTeammates.class); + CBPacket.addPacket(14, PacketTitle.class); + CBPacket.addPacket(15, PacketUpdateWorld.class); + CBPacket.addPacket(16, PacketVoice.class); + CBPacket.addPacket(17, PacketVoiceChannel.class); + CBPacket.addPacket(18, PacketDeleteVoiceChannel.class); + CBPacket.addPacket(19, PacketVoiceChannelUpdate.class); + CBPacket.addPacket(20, PacketWorldBorder.class); + CBPacket.addPacket(21, PacketWorldBorderRemove.class); + CBPacket.addPacket(22, PacketWorldBorderUpdate.class); + CBPacket.addPacket(23, PacketAddWaypoint.class); + CBPacket.addPacket(24, PacketRemoveWaypoint.class); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/ICBNetHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/ICBNetHandler.java new file mode 100644 index 0000000..24cb9dd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/ICBNetHandler.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.network.plugin; + +import com.cheatbreaker.client.network.plugin.shared.PacketAddWaypoint; +import com.cheatbreaker.client.network.plugin.shared.PacketRemoveWaypoint; + +public interface ICBNetHandler { + void handleAddWaypoint(PacketAddWaypoint var1); + + void handleRemoveWaypoint(PacketRemoveWaypoint var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/ICBNetHandlerClient.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/ICBNetHandlerClient.java new file mode 100644 index 0000000..eb817d5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/ICBNetHandlerClient.java @@ -0,0 +1,46 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.server.*; + +public interface ICBNetHandlerClient extends ICBNetHandler { + void handleCooldown(PacketCooldown var1); + + void handleNotification(PacketNotification var1); + + void handleStaffModState(PacketStaffModState var1); + + void handleUpdateNametags(PacketUpdateNametags var1); + + void handleTeammates(PacketTeammates var1); + + void handleOverrideNametags(PacketOverrideNametags var1); + + void handleAddHologram(PacketAddHologram var1); + + void handleUpdateHologram(PacketUpdateHologram var1); + + void handleRemoveHologram(PacketRemoveHologram var1); + + void handleTitle(PacketTitle var1); + + void handleServerRule(PacketServerRule var1); + + void handleVoice(PacketVoice var1); + + void handleVoiceChannel(PacketVoiceChannel var1); + + void handleVoiceChannelUpdate(PacketVoiceChannelUpdate var1); + + void handleDeleteVoiceChannel(PacketDeleteVoiceChannel var1); + + void handleUpdateWorld(PacketUpdateWorld var1); + + void handleServerUpdate(PacketServerUpdate var1); + + void handleWorldBorder(PacketWorldBorder var1); + + void handleWorldBorderUpdate(PacketWorldBorderUpdate var1); + + void handleWorldBorderRemove(PacketWorldBorderRemove var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketClientVoice.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketClientVoice.java new file mode 100644 index 0000000..b416880 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketClientVoice.java @@ -0,0 +1,36 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.plugin.server.ICBNetHandlerServer; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +public class PacketClientVoice extends CBPacket { + private byte[] data; + + public PacketClientVoice() { + } + + public PacketClientVoice(byte[] array) { + this.data = array; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + this.writeBlob(byteBufWrapper, this.data); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.data = this.readBlob(byteBufWrapper); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerServer)iCBNetHandler).handleClientVoice(this); + } + + public byte[] getData() { + return this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceChannelSwitch.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceChannelSwitch.java new file mode 100644 index 0000000..8cfa0e3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceChannelSwitch.java @@ -0,0 +1,38 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.plugin.server.ICBNetHandlerServer; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.UUID; + +public class PacketVoiceChannelSwitch extends CBPacket { + private UUID switchingTo; + + public PacketVoiceChannelSwitch() { + } + + public PacketVoiceChannelSwitch(UUID uUID) { + this.switchingTo = uUID; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.switchingTo); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.switchingTo = byteBufWrapper.readUUID(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerServer)iCBNetHandler).handleVoiceChannelSwitch(this); + } + + public UUID getSwitchingTo() { + return this.switchingTo; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceMute.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceMute.java new file mode 100644 index 0000000..d60e25f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/client/PacketVoiceMute.java @@ -0,0 +1,38 @@ +package com.cheatbreaker.client.network.plugin.client; + +import com.cheatbreaker.client.network.plugin.server.ICBNetHandlerServer; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.UUID; + +public class PacketVoiceMute extends CBPacket { + private UUID muting; + + public PacketVoiceMute() { + } + + public PacketVoiceMute(UUID uUID) { + this.muting = uUID; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.muting); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.muting = byteBufWrapper.readUUID(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerServer)iCBNetHandler).handleVoiceMute(this); + } + + public UUID getMuting() { + return this.muting; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/obj/ServerRule.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/obj/ServerRule.java new file mode 100644 index 0000000..619fecb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/obj/ServerRule.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.network.plugin.obj; + +public enum ServerRule { + VOICE_ENABLED("voiceEnabled", Boolean.class), + MINIMAP_STATUS("minimapStatus", String.class), + SERVER_HANDLES_WAYPOINTS("serverHandlesWaypoints", Boolean.class), + COMPETITIVE_GAMEMODE("competitiveGame", Boolean.class), + + LEGACY_ENCHANTING("legacyEnchanting", Boolean.class), //Lunar + LEGACY_COMBAT("legacyCombat", Boolean.class); // Lunar To stop erroring + private final String rule; + private final Class value; + + ServerRule(String var3, Class var4) { + this.rule = var3; + this.value = var4; + } + + public static ServerRule getRule(String string) { + ServerRule serverRule = null; + for (ServerRule serverRule2 : ServerRule.values()) { + if (!serverRule2.getCommandName().equals(string)) continue; + serverRule = serverRule2; + } + return serverRule; + } + + public String getCommandName() { + return this.rule; + } + + public Class getValue() { + return this.value; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/ICBNetHandlerServer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/ICBNetHandlerServer.java new file mode 100644 index 0000000..716a82b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/ICBNetHandlerServer.java @@ -0,0 +1,14 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.cheatbreaker.client.network.plugin.client.PacketClientVoice; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceChannelSwitch; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; + +public interface ICBNetHandlerServer extends ICBNetHandler { + void handleClientVoice(PacketClientVoice var1); + + void handleVoiceChannelSwitch(PacketVoiceChannelSwitch var1); + + void handleVoiceMute(PacketVoiceMute var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketAddHologram.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketAddHologram.java new file mode 100644 index 0000000..2ce505c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketAddHologram.java @@ -0,0 +1,79 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class PacketAddHologram extends CBPacket { + private UUID uuid; + private double x; + private double y; + private double z; + private List lines; + + public PacketAddHologram() { + } + + public PacketAddHologram(UUID uuid, double x, double y, double z, List lines) { + this.uuid = uuid; + this.x = x; + this.y = y; + this.z = z; + this.lines = lines; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.uuid); + byteBufWrapper.buf().writeDouble(this.x); + byteBufWrapper.buf().writeDouble(this.y); + byteBufWrapper.buf().writeDouble(this.z); + byteBufWrapper.writeVarInt(this.lines.size()); + for (Object string : this.lines) { + byteBufWrapper.writeString((String) string); + } + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.uuid = byteBufWrapper.readUUID(); + this.x = byteBufWrapper.buf().readDouble(); + this.y = byteBufWrapper.buf().readDouble(); + this.z = byteBufWrapper.buf().readDouble(); + int n = byteBufWrapper.readVarInt(); + this.lines = new ArrayList(); + for (int i = 0; i < n; ++i) { + this.lines.add(byteBufWrapper.readString()); + } + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleAddHologram(this); + } + + public UUID getUUID() { + return this.uuid; + } + + public double getX() { + return this.x; + } + + public double getY() { + return this.y; + } + + public double getZ() { + return this.z; + } + + public List getLines() { + return this.lines; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketCooldown.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketCooldown.java new file mode 100644 index 0000000..1721736 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketCooldown.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.beans.ConstructorProperties; + +public class PacketCooldown extends CBPacket { + private String message; + private long durationMs; + private int iconId; + + public PacketCooldown() { + } + + @ConstructorProperties({"message", "durationMs", "iconId"}) + public PacketCooldown(String message, long durationMs, int iconId) { + this.message = message; + this.durationMs = durationMs; + this.iconId = iconId; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.message); + byteBufWrapper.buf().writeLong(this.durationMs); + byteBufWrapper.buf().writeInt(this.iconId); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.message = byteBufWrapper.readString(); + this.durationMs = byteBufWrapper.buf().readLong(); + this.iconId = byteBufWrapper.buf().readInt(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleCooldown(this); + } + + public String getMessage() { + return this.message; + } + + public long getDurationMs() { + return this.durationMs; + } + + public int getIconId() { + return this.iconId; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketDeleteVoiceChannel.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketDeleteVoiceChannel.java new file mode 100644 index 0000000..eeb81b0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketDeleteVoiceChannel.java @@ -0,0 +1,38 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.UUID; + +public class PacketDeleteVoiceChannel extends CBPacket { + private UUID channelId; + + public PacketDeleteVoiceChannel() { + } + + public PacketDeleteVoiceChannel(UUID uUID) { + this.channelId = uUID; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.channelId); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.channelId = byteBufWrapper.readUUID(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleDeleteVoiceChannel(this); + } + + public UUID getChannelId() { + return this.channelId; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketNotification.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketNotification.java new file mode 100644 index 0000000..498e212 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketNotification.java @@ -0,0 +1,52 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +public class PacketNotification extends CBPacket { + private String message; + private long durationMs; + private String level; + + public PacketNotification() { + } + + public PacketNotification(String message, long durationMs, String level) { + this.message = message; + this.durationMs = durationMs; + this.level = level; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.message); + byteBufWrapper.buf().writeLong(this.durationMs); + byteBufWrapper.writeString(this.level); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.message = byteBufWrapper.readString(); + this.durationMs = byteBufWrapper.buf().readLong(); + this.level = byteBufWrapper.readString(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleNotification(this); + } + + public String getMessage() { + return this.message; + } + + public long getDurationMs() { + return this.durationMs; + } + + public String getLevel() { + return this.level; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketOverrideNametags.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketOverrideNametags.java new file mode 100644 index 0000000..9b9821c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketOverrideNametags.java @@ -0,0 +1,62 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.function.Consumer; + +public class PacketOverrideNametags extends CBPacket { + private UUID uuid; + private List tags; + + public PacketOverrideNametags() { + } + + public PacketOverrideNametags(UUID uUID, List list) { + this.uuid = uUID; + this.tags = list; + } + + @Override + public void write(ByteBufWrapper buf) { + buf.writeUUID(this.uuid); + buf.writeOptional(this.tags, new Consumer() { + @Override + public void accept(Object o) { + buf.writeVarInt(tags.size()); + tags.forEach(buf::writeString); + } + }); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.uuid = byteBufWrapper.readUUID(); + this.tags = (List)byteBufWrapper.readOptional(() -> { + int n = byteBufWrapper.readVarInt(); + ArrayList arrayList = new ArrayList(); + for (int i = 0; i < n; ++i) { + arrayList.add(byteBufWrapper.readString()); + } + return arrayList; + }); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleOverrideNametags(this); + } + + public UUID getUUID() { + return this.uuid; + } + + public List getTags() { + return this.tags; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketRemoveHologram.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketRemoveHologram.java new file mode 100644 index 0000000..f33ce45 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketRemoveHologram.java @@ -0,0 +1,38 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.UUID; + +public class PacketRemoveHologram extends CBPacket { + private UUID uuid; + + public PacketRemoveHologram() { + } + + public PacketRemoveHologram(UUID uUID) { + this.uuid = uUID; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.uuid); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.uuid = byteBufWrapper.readUUID(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleRemoveHologram(this); + } + + public UUID getUUID() { + return this.uuid; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketServerRule.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketServerRule.java new file mode 100644 index 0000000..1846db3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketServerRule.java @@ -0,0 +1,90 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.plugin.obj.ServerRule; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +public class PacketServerRule extends CBPacket { + private ServerRule rule; + private int intValue; + private float floatValue; + private boolean booleanValue; + private String stringValue = ""; + + public PacketServerRule() { + } + + public PacketServerRule(ServerRule serverRule, float floatValue) { + this(serverRule); + this.floatValue = floatValue; + } + + public PacketServerRule(ServerRule serverRule, boolean booleanValue) { + this(serverRule); + this.booleanValue = booleanValue; + } + + public PacketServerRule(ServerRule serverRule, int intValue) { + this(serverRule); + this.intValue = intValue; + } + + public PacketServerRule(ServerRule serverRule, String stringValue) { + this(serverRule); + this.stringValue = stringValue; + } + + private PacketServerRule(ServerRule serverRule) { + this.rule = serverRule; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.rule.getCommandName()); + byteBufWrapper.buf().writeBoolean(this.booleanValue); + byteBufWrapper.buf().writeInt(this.intValue); + byteBufWrapper.buf().writeFloat(this.floatValue); + byteBufWrapper.writeString(this.stringValue); + } + + @Override + protected byte[] readBlob(ByteBufWrapper byteBufWrapper) { + return super.readBlob(byteBufWrapper); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.rule = ServerRule.getRule(byteBufWrapper.readString()); + this.booleanValue = byteBufWrapper.buf().readBoolean(); + this.intValue = byteBufWrapper.buf().readInt(); + this.floatValue = byteBufWrapper.buf().readFloat(); + this.stringValue = byteBufWrapper.readString(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleServerRule(this); + } + + public ServerRule getRule() { + return this.rule; + } + + public int getIntValue() { + return this.intValue; + } + + public float getFloatValue() { + return this.floatValue; + } + + public boolean getBoolean() { + return this.booleanValue; + } + + public String getRuleName() { + return this.stringValue; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketServerUpdate.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketServerUpdate.java new file mode 100644 index 0000000..0761322 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketServerUpdate.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.beans.ConstructorProperties; + +public class PacketServerUpdate extends CBPacket { + private String server; + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.server); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.server = byteBufWrapper.readString(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleServerUpdate(this); + } + + @ConstructorProperties(value={"server"}) + public PacketServerUpdate(String string) { + this.server = string; + } + + public PacketServerUpdate() { + } + + public String getServer() { + return this.server; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketStaffModState.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketStaffModState.java new file mode 100644 index 0000000..51c354d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketStaffModState.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +public class PacketStaffModState extends CBPacket { + private String id; + private boolean state; + + public PacketStaffModState() { + } + + public PacketStaffModState(String id, boolean state) { + this.id = id; + this.state = state; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.id); + byteBufWrapper.buf().writeBoolean(this.state); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.id = byteBufWrapper.readString(); + this.state = byteBufWrapper.buf().readBoolean(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleStaffModState(this); + } + + public String getId() { + return this.id; + } + + public boolean getState() { + return this.state; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketTeammates.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketTeammates.java new file mode 100644 index 0000000..9c9c556 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketTeammates.java @@ -0,0 +1,92 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.beans.ConstructorProperties; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +public class PacketTeammates extends CBPacket { + private UUID leader; + private long lastMs; + private Map> players; + + public PacketTeammates() { + } + @ConstructorProperties(value={"leader", "lastMs", "players"}) + public PacketTeammates(UUID leader, long lastMs, Map> players) { + this.leader = leader; + this.lastMs = lastMs; + this.players = players; + } + + @Override + public void write(ByteBufWrapper buf) { + buf.buf().writeBoolean(leader != null); + + if (leader != null) { + buf.writeUUID(leader); + } + + buf.buf().writeLong(lastMs); + buf.writeVarInt(this.players.size()); + + this.players.forEach((uuid, posMap) -> { + buf.writeUUID(uuid); + buf.writeVarInt(posMap.size()); + + posMap.forEach((key, val) -> { + buf.writeString(key); + buf.buf().writeDouble(val); + }); + }); + } + + @Override + public void read(ByteBufWrapper buf) { + if (buf.buf().readBoolean()) { + this.leader = buf.readUUID(); + } + + this.lastMs = buf.buf().readLong(); + + int playersSize = buf.readVarInt(); + this.players = new HashMap<>(); + + for (int i = 0; i < playersSize; i++) { + UUID uuid = buf.readUUID(); + int posMapSize = buf.readVarInt(); + Map posMap = new HashMap<>(); + + for (int j = 0; j < posMapSize; j++) { + String key = buf.readString(); + double val = buf.buf().readDouble(); + + posMap.put(key, val); + } + + this.players.put(uuid, posMap); + } + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleTeammates(this); + } + + public UUID getLeader() { + return this.leader; + } + + public long getLastMs() { + return this.lastMs; + } + + public Map> getPlayers() { + return this.players; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketTitle.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketTitle.java new file mode 100644 index 0000000..a2ada80 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketTitle.java @@ -0,0 +1,80 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +public class PacketTitle extends CBPacket { + private String type; + private String message; + private long displayTimeMs; + private long fadeInTimeMs; + private long fadeOutTimeMs; + private float scale; + + public PacketTitle() { + } + + public PacketTitle(String type, String message, long displayTimeMs, long fadeInTimeMs, long fadeOutTimeMs) { + this(type, message, 1.0f, displayTimeMs, fadeInTimeMs, fadeOutTimeMs); + } + + public PacketTitle(String type, String message, float scale, long displayTimeMs, long fadeInTimeMs, long fadeOutTimeMs) { + this.type = type; + this.message = message; + this.scale = scale; + this.displayTimeMs = displayTimeMs; + this.fadeInTimeMs = fadeInTimeMs; + this.fadeOutTimeMs = fadeOutTimeMs; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.type); + byteBufWrapper.writeString(this.message); + byteBufWrapper.buf().writeFloat(this.scale); + byteBufWrapper.buf().writeLong(this.displayTimeMs); + byteBufWrapper.buf().writeLong(this.fadeInTimeMs); + byteBufWrapper.buf().writeLong(this.fadeOutTimeMs); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.type = byteBufWrapper.readString(); + this.message = byteBufWrapper.readString(); + this.scale = byteBufWrapper.buf().readFloat(); + this.displayTimeMs = byteBufWrapper.buf().readLong(); + this.fadeInTimeMs = byteBufWrapper.buf().readLong(); + this.fadeOutTimeMs = byteBufWrapper.buf().readLong(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleTitle(this); + } + + public String getType() { + return this.type; + } + + public String getMessage() { + return this.message; + } + + public long getDisplayTimeMs() { + return this.displayTimeMs; + } + + public long getFadeInTimeMs() { + return this.fadeInTimeMs; + } + + public long getFadeOutTimeMs() { + return this.fadeOutTimeMs; + } + + public float getScale() { + return this.scale; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateHologram.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateHologram.java new file mode 100644 index 0000000..fe5c496 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateHologram.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class PacketUpdateHologram extends CBPacket { + private UUID uuid; + private List lines; + + public PacketUpdateHologram() { + } + + public PacketUpdateHologram(UUID uUID, List list) { + this.uuid = uUID; + this.lines = list; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.uuid); + byteBufWrapper.writeVarInt(this.lines.size()); + for (String string : this.lines) { + byteBufWrapper.writeString(string); + } + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.uuid = byteBufWrapper.readUUID(); + int n = byteBufWrapper.readVarInt(); + this.lines = new ArrayList(); + for (int i = 0; i < n; ++i) { + this.lines.add(byteBufWrapper.readString()); + } + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleUpdateHologram(this); + } + + public UUID getUUID() { + return this.uuid; + } + + public List getLines() { + return this.lines; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateNametags.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateNametags.java new file mode 100644 index 0000000..d719695 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateNametags.java @@ -0,0 +1,67 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public class PacketUpdateNametags extends CBPacket { + private Map> playersMap; + + public PacketUpdateNametags() { + } + + public PacketUpdateNametags(Map map) { + this.playersMap = map; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeVarInt(this.playersMap == null ? -1 : this.playersMap.size()); + if (this.playersMap != null) { + for (Map.Entry> entry : this.playersMap.entrySet()) { + UUID uUID = entry.getKey(); + List list = entry.getValue(); + byteBufWrapper.writeUUID(uUID); + byteBufWrapper.writeVarInt(list.size()); + for (String string : list) { + byteBufWrapper.writeString(string); + } + } + } + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + int n = byteBufWrapper.readVarInt(); + if (n == -1) { + this.playersMap = null; + return; + } + this.playersMap = new HashMap(); + for (int i = 0; i < n; ++i) { + UUID uUID = byteBufWrapper.readUUID(); + int n2 = byteBufWrapper.readVarInt(); + ArrayList arrayList = new ArrayList(); + for (int j = 0; j < n2; ++j) { + arrayList.add(byteBufWrapper.readString()); + } + this.playersMap.put(uUID, arrayList); + } + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleUpdateNametags(this); + } + + public Map> getPlayersMap() { + return this.playersMap; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateWorld.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateWorld.java new file mode 100644 index 0000000..8cd8f19 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketUpdateWorld.java @@ -0,0 +1,36 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +public class PacketUpdateWorld extends CBPacket { + private String world; + + public PacketUpdateWorld() { + } + + public PacketUpdateWorld(String world) { + this.world = world; + } + + @Override + public void write(ByteBufWrapper buf) { + buf.writeString(this.world); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.world = byteBufWrapper.readString(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleUpdateWorld(this); + } + + public String getWorld() { + return this.world; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoice.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoice.java new file mode 100644 index 0000000..953e5e6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoice.java @@ -0,0 +1,46 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.UUID; + +public class PacketVoice extends CBPacket { + private UUID uuid; + private byte[] data; + + public PacketVoice() { + } + + public PacketVoice(UUID uuid, byte[] data) { + this.uuid = uuid; + this.data = data; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.uuid); + this.writeBlob(byteBufWrapper, this.data); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.uuid = byteBufWrapper.readUUID(); + this.data = this.readBlob(byteBufWrapper); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleVoice(this); + } + + public UUID getUUID() { + return this.uuid; + } + + public byte[] getData() { + return this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoiceChannel.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoiceChannel.java new file mode 100644 index 0000000..da0a557 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoiceChannel.java @@ -0,0 +1,83 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +public class PacketVoiceChannel extends CBPacket { + private UUID uuid; + private String name; + private Map players; + private Map listening; + + public PacketVoiceChannel() { + } + + public PacketVoiceChannel(UUID uUID, String string, Map map, Map map2) { + this.uuid = uUID; + this.name = string; + this.players = map; + this.listening = map2; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeUUID(this.uuid); + byteBufWrapper.writeString(this.name); + this.lIIIIlIIllIIlIIlIIIlIIllI(byteBufWrapper, this.players); + this.lIIIIlIIllIIlIIlIIIlIIllI(byteBufWrapper, this.listening); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.uuid = byteBufWrapper.readUUID(); + this.name = byteBufWrapper.readString(); + this.players = this.IIIIllIlIIIllIlllIlllllIl(byteBufWrapper); + this.listening = this.IIIIllIlIIIllIlllIlllllIl(byteBufWrapper); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ByteBufWrapper byteBufWrapper, Map map) { + byteBufWrapper.writeVarInt(map.size()); + for (Map.Entry entry : map.entrySet()) { + byteBufWrapper.writeUUID(entry.getKey()); + byteBufWrapper.writeString(entry.getValue()); + } + } + + private Map IIIIllIlIIIllIlllIlllllIl(ByteBufWrapper byteBufWrapper) { + int n = byteBufWrapper.readVarInt(); + HashMap hashMap = new HashMap(); + for (int i = 0; i < n; ++i) { + UUID uUID = byteBufWrapper.readUUID(); + String string = byteBufWrapper.readString(); + hashMap.put(uUID, string); + } + return hashMap; + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleVoiceChannel(this); + } + + public UUID getUUID() { + return this.uuid; + } + + public String getName() { + return this.name; + } + + public Map getPlayers() { + return this.players; + } + + public Map getListening() { + return this.listening; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoiceChannelUpdate.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoiceChannelUpdate.java new file mode 100644 index 0000000..c8ded92 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketVoiceChannelUpdate.java @@ -0,0 +1,62 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.util.UUID; + +public class PacketVoiceChannelUpdate extends CBPacket { + public int status; + private UUID channelUuid; + private UUID uuid; + private String name; + + public PacketVoiceChannelUpdate() { + } + + public PacketVoiceChannelUpdate(int n, UUID uUID, UUID uUID2, String string) { + this.status = n; + this.channelUuid = uUID; + this.uuid = uUID2; + this.name = string; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeVarInt(this.status); + byteBufWrapper.writeUUID(this.channelUuid); + byteBufWrapper.writeUUID(this.uuid); + byteBufWrapper.writeString(this.name); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.status = byteBufWrapper.readVarInt(); + this.channelUuid = byteBufWrapper.readUUID(); + this.uuid = byteBufWrapper.readUUID(); + this.name = byteBufWrapper.readString(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleVoiceChannelUpdate(this); + } + + public int getStatus() { + return this.status; + } + + public UUID getChannelUUID() { + return this.channelUuid; + } + + public UUID getUUID() { + return this.uuid; + } + + public String getName() { + return this.name; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorder.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorder.java new file mode 100644 index 0000000..4edf44d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorder.java @@ -0,0 +1,103 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.beans.ConstructorProperties; + +public class PacketWorldBorder extends CBPacket { + private String id; + private String world; + private boolean cancelsExit; + private boolean canShrinkExpand; + private int color = -13421569; + private double minX; + private double minZ; + private double maxX; + private double maxZ; + + @Override + public void write(ByteBufWrapper buf) { + buf.writeOptional(this.id, o -> buf.writeString((String) o)); + buf.writeString(this.world); + buf.buf().writeBoolean(this.cancelsExit); + buf.buf().writeBoolean(this.canShrinkExpand); + buf.buf().writeInt(this.color); + buf.buf().writeDouble(this.minX); + buf.buf().writeDouble(this.minZ); + buf.buf().writeDouble(this.maxX); + buf.buf().writeDouble(this.maxZ); + } + + @Override + public void read(ByteBufWrapper buf) { + this.id = (String)buf.readOptional(buf::readString); + this.world = buf.readString(); + this.cancelsExit = buf.buf().readBoolean(); + this.canShrinkExpand = buf.buf().readBoolean(); + this.color = buf.buf().readInt(); + this.minX = buf.buf().readDouble(); + this.minZ = buf.buf().readDouble(); + this.maxX = buf.buf().readDouble(); + this.maxZ = buf.buf().readDouble(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleWorldBorder(this); + } + + public String getId() { + return this.id; + } + + public String getWorld() { + return this.world; + } + + public boolean doesCancelExit() { + return this.cancelsExit; + } + + public boolean canShrinkExpand() { + return this.canShrinkExpand; + } + + public int getColor() { + return this.color; + } + + public double getMinX() { + return this.minX; + } + + public double getMinZ() { + return this.minZ; + } + + public double getMaxX() { + return this.maxX; + } + + public double getMaxZ() { + return this.maxZ; + } + + public PacketWorldBorder() { + } + + @ConstructorProperties(value={"id", "world", "cancelsExit", "canShrinkExpand", "color", "minX", "minZ", "maxX", "maxZ"}) + public PacketWorldBorder(String id, String world, boolean cancelsExit, boolean canShrinkExpand, int color, double minX, double minZ, double maxX, double maxZ) { + this.id = id; + this.world = world; + this.cancelsExit = cancelsExit; + this.canShrinkExpand = canShrinkExpand; + this.color = color; + this.minX = minX; + this.minZ = minZ; + this.maxX = maxX; + this.maxZ = maxZ; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorderRemove.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorderRemove.java new file mode 100644 index 0000000..6736b0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorderRemove.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.beans.ConstructorProperties; + +public class PacketWorldBorderRemove extends CBPacket { + private String id; + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.id); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.id = byteBufWrapper.readString(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleWorldBorderRemove(this); + } + + @ConstructorProperties(value={"id"}) + public PacketWorldBorderRemove(String id) { + this.id = id; + } + + public PacketWorldBorderRemove() { + } + + public String getId() { + return this.id; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorderUpdate.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorderUpdate.java new file mode 100644 index 0000000..f0d2641 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/server/PacketWorldBorderUpdate.java @@ -0,0 +1,79 @@ +package com.cheatbreaker.client.network.plugin.server; + +import com.cheatbreaker.client.network.plugin.client.ICBNetHandlerClient; +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; + +import java.beans.ConstructorProperties; + +public class PacketWorldBorderUpdate extends CBPacket { + private String id; + private double minX; + private double minZ; + private double maxX; + private double maxZ; + private int durationTicks; + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.id); + byteBufWrapper.buf().writeDouble(this.minX); + byteBufWrapper.buf().writeDouble(this.minZ); + byteBufWrapper.buf().writeDouble(this.maxX); + byteBufWrapper.buf().writeDouble(this.maxZ); + byteBufWrapper.buf().writeInt(this.durationTicks); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.id = byteBufWrapper.readString(); + this.minX = byteBufWrapper.buf().readDouble(); + this.minZ = byteBufWrapper.buf().readDouble(); + this.maxX = byteBufWrapper.buf().readDouble(); + this.maxZ = byteBufWrapper.buf().readDouble(); + this.durationTicks = byteBufWrapper.buf().readInt(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + ((ICBNetHandlerClient)iCBNetHandler).handleWorldBorderUpdate(this); + } + + public String getId() { + return this.id; + } + + public double getMinX() { + return this.minX; + } + + public double getMinZ() { + return this.minZ; + } + + public double getMaxX() { + return this.maxX; + } + + public double getMaxZ() { + return this.maxZ; + } + + public int getDurationTicks() { + return this.durationTicks; + } + + public PacketWorldBorderUpdate() { + } + + @ConstructorProperties(value={"id", "minX", "minZ", "maxX", "maxZ", "durationTicks"}) + public PacketWorldBorderUpdate(String id, double minX, double minZ, double maxX, double maxZ, int durationTicks) { + this.id = id; + this.minX = minX; + this.minZ = minZ; + this.maxX = maxX; + this.maxZ = maxZ; + this.durationTicks = durationTicks; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/shared/PacketAddWaypoint.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/shared/PacketAddWaypoint.java new file mode 100644 index 0000000..07fc246 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/shared/PacketAddWaypoint.java @@ -0,0 +1,92 @@ +package com.cheatbreaker.client.network.plugin.shared; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.google.common.base.Preconditions; + +public class PacketAddWaypoint extends CBPacket { + private String name; + private String world; + private int color; + private int x; + private int y; + private int z; + private boolean forced; + private boolean visible; + + public PacketAddWaypoint() { + } + + public PacketAddWaypoint(String name, String world, int color, int x, int y, int z, boolean forced, boolean visible) { + this.name = Preconditions.checkNotNull(name, "name"); + this.world = Preconditions.checkNotNull(world, "world"); + this.color = color; + this.x = x; + this.y = y; + this.z = z; + this.forced = forced; + this.visible = visible; + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.name); + byteBufWrapper.writeString(this.world); + byteBufWrapper.buf().writeInt(this.color); + byteBufWrapper.buf().writeInt(this.x); + byteBufWrapper.buf().writeInt(this.y); + byteBufWrapper.buf().writeInt(this.z); + byteBufWrapper.buf().writeBoolean(this.forced); + byteBufWrapper.buf().writeBoolean(this.visible); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.name = byteBufWrapper.readString(); + this.world = byteBufWrapper.readString(); + this.color = byteBufWrapper.buf().readInt(); + this.x = byteBufWrapper.buf().readInt(); + this.y = byteBufWrapper.buf().readInt(); + this.z = byteBufWrapper.buf().readInt(); + this.forced = byteBufWrapper.buf().readBoolean(); + this.visible = byteBufWrapper.buf().readBoolean(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + iCBNetHandler.handleAddWaypoint(this); + } + + public String getName() { + return this.name; + } + + public String getWorld() { + return this.world; + } + + public int getColor() { + return this.color; + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public int getZ() { + return this.z; + } + + public boolean isForced() { + return this.forced; + } + + public boolean isVisible() { + return this.visible; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/shared/PacketRemoveWaypoint.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/shared/PacketRemoveWaypoint.java new file mode 100644 index 0000000..85f983b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/plugin/shared/PacketRemoveWaypoint.java @@ -0,0 +1,44 @@ +package com.cheatbreaker.client.network.plugin.shared; + +import com.cheatbreaker.client.network.ByteBufWrapper; +import com.cheatbreaker.client.network.plugin.CBPacket; +import com.cheatbreaker.client.network.plugin.ICBNetHandler; +import com.google.common.base.Preconditions; + +public class PacketRemoveWaypoint extends CBPacket { + private String name; + private String world; + + public PacketRemoveWaypoint() { + } + + public PacketRemoveWaypoint(String string, String string2) { + this.name = Preconditions.checkNotNull(string, "name"); + this.world = Preconditions.checkNotNull(string2, "world"); + } + + @Override + public void write(ByteBufWrapper byteBufWrapper) { + byteBufWrapper.writeString(this.name); + byteBufWrapper.writeString(this.world); + } + + @Override + public void read(ByteBufWrapper byteBufWrapper) { + this.name = byteBufWrapper.readString(); + this.world = byteBufWrapper.readString(); + } + + @Override + public void process(ICBNetHandler iCBNetHandler) { + iCBNetHandler.handleRemoveWaypoint(this); + } + + public String getName() { + return this.name; + } + + public String getWorld() { + return this.world; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/WSNetHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/WSNetHandler.java new file mode 100644 index 0000000..33428db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/WSNetHandler.java @@ -0,0 +1,468 @@ +package com.cheatbreaker.client.network.websocket; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.cosmetic.CosmeticManager; +import com.cheatbreaker.client.cosmetic.Emote; +import com.cheatbreaker.client.network.messages.Message; +import com.cheatbreaker.client.network.websocket.client.*; +import com.cheatbreaker.client.network.websocket.server.*; +import com.cheatbreaker.client.network.websocket.shared.*; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.CBAlert; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.overlay.friend.FriendRequestElement; +import com.cheatbreaker.client.ui.overlay.friend.MessagesElement; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.cosmetic.profile.ClientProfile; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import com.cheatbreaker.client.util.friend.Friend; +import com.cheatbreaker.client.util.friend.FriendRequest; +import com.cheatbreaker.client.util.thread.CBAssestConnThread; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; +import com.mojang.authlib.exceptions.InvalidCredentialsException; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.PacketBuffer; +import net.minecraft.src.Config; +import net.minecraft.util.CryptManager; +import net.minecraft.util.EnumChatFormatting; +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.drafts.Draft_6455; +import org.java_websocket.handshake.ServerHandshake; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.math.BigInteger; +import java.net.URI; +import java.nio.ByteBuffer; +import java.security.KeyFactory; +import java.security.PublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.*; + +public class WSNetHandler extends WebSocketClient { + + private final Minecraft mc = Minecraft.getMinecraft(); + private final List playersCache = new ArrayList<>(); + + public WSNetHandler(URI url, Map data) { + super(url, new Draft_6455(), data, 0); + } + + @Override + public boolean isOpen() { + return super.isOpen(); + } + public void sendPacket(WSPacket var1) { + if (this.isOpen()) { + PacketBuffer var2 = new PacketBuffer(Unpooled.buffer()); + var2.writeVarIntToBuffer(WSPacket.REGISTRY.get(var1.getClass())); + try { + var1.write(var2); + System.out.println(CheatBreaker.getInstance().getLoggerPrefix() + "[WS NetHandler] (OUT) id: " + + WSPacket.REGISTRY.get(var1.getClass()) + " Name: " + var1.getClass().getSimpleName()); + + this.send(var2.array()); + } catch (Exception var4) { + var4.printStackTrace(); + } + } + } + + public void handleIncoming(PacketBuffer var1) { + int var2 = var1.readVarIntFromBuffer(); + Class var3 = WSPacket.REGISTRY.inverse().get(var2); + try { + WSPacket var4 = var3 == null ? null : var3.newInstance(); + if (var4 == null) { + return; + } + System.out.println(CheatBreaker.getInstance().getLoggerPrefix() + "[WS NetHandler] (IN) id: " + var2 + " Name: " + var4.getClass().getSimpleName()); + var4.read(var1); + var4.process(this); + + } catch (Exception var5) { + System.out.println("Error from: " + var3); + var5.printStackTrace(); + } + } + + @Override + public void onOpen(ServerHandshake var1) { + System.out.println(CheatBreaker.getInstance().getLoggerPrefix() + "Connection established"); + if (Objects.equals(Minecraft.getMinecraft().getSession().getUsername(), Minecraft.getMinecraft().getSession().getPlayerID())) { + this.close(); + } + } + + @Override + public void onMessage(String message) { + if (this.isOpen()) { + super.send(message); + } + } + + @Override + public void onMessage(ByteBuffer var1) { + this.handleIncoming(new PacketBuffer(Unpooled.wrappedBuffer(var1.array()))); + } + + + + public void handleConsoleOutput(WSPacketConsoleMessage var1) { + CheatBreaker.getInstance().getConsoleLines().add(var1.getMessage()); + } + + public void handleFriendRemove(WSPacketClientFriendRemove var1) { + String var2 = var1.getPlayerId(); + Friend var3 = CheatBreaker.getInstance().getFriendsManager().getFriend(var2); + if (var3 != null) { + CheatBreaker.getInstance().getFriendsManager().getFriends().remove(var2); + OverlayGui.getInstance().handleFriend(var3, false); + } + } + + public void handleMessage(WSPacketFriendMessage var1) { + String playerId = var1.getPlayerId(); + String message = var1.getMessage(); + Friend friend = CheatBreaker.getInstance().getFriendsManager().getFriends().get(playerId); + if (friend != null) { + CheatBreaker.getInstance().getFriendsManager().addUnreadMessage(friend.getPlayerId(), message); + if (CheatBreaker.getInstance().getPlayerStatus() != Friend.Status.BUSY) { + CheatBreaker.getInstance().getAudioManager().playSound("message"); + CBAlert.displayMessage(EnumChatFormatting.GREEN + friend.getName() + EnumChatFormatting.RESET + " says:", message); + } + for (AbstractElement element : OverlayGui.getInstance().getElements()) { + if (!(element instanceof MessagesElement) || ((MessagesElement) element).getFriend() != friend) continue; + CheatBreaker.getInstance().getFriendsManager().readMessages(friend.getPlayerId()); + } + } + } + + public void handleEmote(WSPacketEmote packet) { + EntityPlayer entityPlayer = Minecraft.getMinecraft().theWorld.func_152378_a(packet.getPlayerId()); + Emote emote = CheatBreaker.getInstance().getEmoteManager().getEmote(packet.getEmoteId()); + if (entityPlayer instanceof AbstractClientPlayer) { + CheatBreaker.getInstance().getEmoteManager().playEmote((AbstractClientPlayer)entityPlayer, emote); + } + } + + public void sendUpdateServer(String server) { + this.sendPacket(new WSPacketServerUpdate("", server)); + } + + public void handleServerUpdate(WSPacketServerUpdate var1) { + String var2 = var1.getPlayerId(); + String var3 = var1.getServer(); + Friend var4 = CheatBreaker.getInstance().getFriendsManager().getFriends().get(var2); + if (var4 != null) { + var4.setServer(var3); + } + } + + public void handleBulkFriends(WSPacketBulkFriendRequest packet) { + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().clear(); + JsonArray friendList = packet.getBulkArray(); + for (JsonElement element : friendList) { + JsonObject friendObject = element.getAsJsonObject(); + String uuid = friendObject.get("uuid").getAsString(); + String name = friendObject.get("name").getAsString(); + FriendRequest request = new FriendRequest(name, uuid); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().put(uuid, request); + System.out.println("Added Friend"); + OverlayGui.getInstance().handleFriendRequest(request, true); + } + } + + public void handleFriendRequest(WSPacket var1, boolean var2) { + if (var2) { + WSPacketFriendRequestSent var3 = (WSPacketFriendRequestSent)var1; + FriendRequest var4 = new FriendRequest(var3.getName(), var3.getPlayerId()); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().put(var3.getPlayerId(), var4); + OverlayGui.getInstance().handleFriendRequest(var4, true); + var4.setFriend(var3.isFriend()); + CBAlert.displayMessage("Friend Request", "Request has been sent."); + } else { + WSPacketFriendRequest var7 = (WSPacketFriendRequest)var1; + String var8 = var7.getMessage(); + String var5 = var7.getPlayerId(); + FriendRequest var6 = new FriendRequest(var5, var8); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().put(var8, var6); + OverlayGui.getInstance().handleFriendRequest(var6, true); + if (CheatBreaker.getInstance().getPlayerStatus() != Friend.Status.BUSY) { + CheatBreaker.getInstance().getAudioManager().playSound("message"); + CBAlert.displayMessage("Friend Request", var6.getUsername() + " wants to be your friend."); + } + } + } + + private void handlePlayerConnected(JsonObject var1) { + String var2 = var1.get("result").getAsString(); + if (var2.equals("SUCCESS")) { + CBAlert.displayMessage(EnumChatFormatting.GREEN + "Connected", "Welcome, " + this.mc.getSession().getUsername() + "."); + } + } + + public void handleFriendUpdate(WSPacketFriendUpdate var1) { + String playerId = var1.getMessage(); + String name = var1.getName(); + boolean online = var1.isOnline(); + Friend var5 = CheatBreaker.getInstance().getFriendsManager().getFriends().get(playerId); + if (var5 == null) { + var5 = Friend.builder().online(online).name(name).playerId(playerId).online(online).onlineStatus(Friend.Status.ONLINE).build(); + CheatBreaker.getInstance().getFriendsManager().getFriends().put(playerId, var5); + OverlayGui.getInstance().handleFriend(var5, true); + } + if (var1.getOfflineSince() < 10L) { + int var6 = (int)var1.getOfflineSince(); + Friend.Status status = Friend.Status.ONLINE; + for (Friend.Status fStatus : Friend.Status.values()) { + if (fStatus.ordinal() != var6) continue; + status = fStatus; + } + var5.setOnlineStatus(status); + } + var5.setOnline(online); + var5.setName(name); + OverlayGui.getInstance().getFriendsListElement().updateSize(); + if (!online) { + var5.setOfflineSince(var1.getOfflineSince()); + } + } + + public void handleFriendsUpdate(WSPacketFriendsListUpdate packet) { + String name; + String uuid; + CheatBreaker.getInstance().getFriendsManager().getFriends().clear(); + Map> var2 = packet.getOnlineFriends(); + Map> var3 = packet.getOfflineFriends(); + CheatBreaker.getInstance().setConsoleAccess(packet.isConsoleAllowed()); + CheatBreaker.getInstance().setAcceptingFriendRequests(packet.isRequestsEnabled()); + for (Map.Entry> entry : var2.entrySet()) { + Friend.Status[] statusValues; + uuid = entry.getKey(); + name = (String)((List)entry.getValue()).get(0); + int statusOrdinal = Integer.parseInt(entry.getValue().get(1)); + String server = (String)((List)entry.getValue()).get(2); + Friend.Status onlineStatus = Friend.Status.ONLINE; + for (Friend.Status status : statusValues = Friend.Status.values()) { + if (status.ordinal() != statusOrdinal) continue; + onlineStatus = status; + } + Friend friend = Friend.builder().name(name).playerId(uuid).server(server).onlineStatus(onlineStatus).online(true).status("Online").build(); + CheatBreaker.getInstance().getFriendsManager().getFriends().put(uuid, friend); + OverlayGui.getInstance().handleFriend(friend, true); + } + for (Map.Entry> entry : var3.entrySet()) { + uuid = entry.getKey(); + name = (String)((List)entry.getValue()).get(0); + Friend friend = Friend.builder().name(name).playerId(uuid).server("") + .onlineStatus(Friend.Status.ONLINE).online(false) + .status("Online").offlineSince(Long.parseLong(entry.getValue().get(1))).build(); + CheatBreaker.getInstance().getFriendsManager().getFriends().put(uuid, friend); + OverlayGui.getInstance().handleFriend(friend, true); + } + + } + + public void handleCosmetics(WSPacketCosmetics packet) { + String uuid = packet.getPlayerId(); + CosmeticManager manager = CheatBreaker.getInstance().getCosmeticManager(); + + ProfileHandler profileHandler = CheatBreaker.getInstance().getProfileHandler(); + + if (packet.isJoin()) { + profileHandler.getWsOnlineUsers().put(UUID.fromString(uuid), new ClientProfile(packet.getUsername(), packet.getColor(), packet.getColor2())); + } else { + profileHandler.getWsOnlineUsers().remove(UUID.fromString(uuid)); + } + + if (Minecraft.getMinecraft().getSession().getUsername() != "Noxiuam") { + return; + } + + CheatBreaker.getInstance().getCosmeticManager().clearCosmetics(uuid); + + for (Cosmetic cosmetic : packet.getCosmetics()) { + try { + + switch (cosmetic.getType().getTypeName()) { + case "cape": + manager.getCapes().add(cosmetic); + break; + case "emote": + CheatBreaker.getInstance().getEmoteManager().getEmotes().add(cosmetic.getEmoteId()); + break; + case "dragon_wings": + manager.getWings().add(cosmetic); + break; + } + + EntityPlayer entity = this.mc.theWorld == null ? null : this.mc.theWorld.func_152378_a(UUID.fromString(uuid)); + if (!cosmetic.isEquipped() || !(entity instanceof AbstractClientPlayer)) continue; + if (cosmetic.getType().getTypeName().equals("cape")) { + ((AbstractClientPlayer) entity).setLocationOfCape(cosmetic.getLocation()); + entity.setCBCape(cosmetic); + continue; + } + entity.setCBWings(cosmetic); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + @Override + public void onClose(int code, String reason, boolean remote) { + System.out.println("Close: " + reason + " (" + code + ") - " + remote); + new CBAssestConnThread().start(); + OverlayGui.getInstance().getFriendRequestsElement().getElements().clear(); + OverlayGui.getInstance().getFriendsListElement().getElements().clear(); + CheatBreaker.getInstance().getFriendsManager().getFriends().clear(); + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().clear(); + } + + @Override + public void onError(Exception var1) { + System.out.println("Error: " + var1.getMessage()); + var1.printStackTrace(); + } + + public void handleFormattedConsoleOutput(WSPacketNotification packet) { + String title = packet.getTitle(); + String message = packet.getContent(); + CheatBreaker.getInstance().getConsoleLines().add(EnumChatFormatting.DARK_GRAY + "[" + EnumChatFormatting.RESET + packet.getTitle() + EnumChatFormatting.DARK_GRAY + "] " + EnumChatFormatting.RESET + packet.getContent()); + CBAlert.displayMessage(title, message); + } + + public void handleJoinServer(WSPacketJoinServer var1) { + SecretKey var2 = CryptManager.createNewSharedKey(); + PublicKey var3 = var1.getPublicKey(); + String var4 = new BigInteger(CryptManager.getServerIdHash("", var3, var2)).toString(16); + try { + this.createSessionService().joinServer(this.mc.getSession().func_148256_e(), this.mc.getSession().getToken(), var4); + } catch (AuthenticationUnavailableException var9) { + CBAlert.displayMessage("Authentication Unavailable", var9.getMessage()); + return; + } catch (InvalidCredentialsException var10) { + if (var10.getMessage() == null) { + CBAlert.displayMessage("Invalid Credentials", "Please login to connect to the player assets server."); + } else { + CBAlert.displayMessage("Invalid Credentials", var10.getMessage()); + } + return; + } catch (AuthenticationException var11) { + CBAlert.displayMessage("Authentication Error", var11.getMessage()); + return; + } catch (NullPointerException var12) { + this.close(); + } + try { + PacketBuffer var5 = new PacketBuffer(Unpooled.buffer()); + WSPacketClientJoinServerResponse var6 = new WSPacketClientJoinServerResponse(var2, var3, var1.getBytes()); + var6.write(var5); + this.sendPacket(var6); + File var7 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch() + File.separator + "profiles.txt"); + if (var7.exists()) { + this.sendPacket(new WSPacketClientProfilesExist()); + } + } catch (Exception var8) { + var8.printStackTrace(); + } + } + + private MinecraftSessionService createSessionService() { + return new YggdrasilAuthenticationService(this.mc.getProxy(), UUID.randomUUID().toString()).createMinecraftSessionService(); + } + + + public void handlePlayer(AbstractClientPlayer var1) { + String uuid; + if (var1.getGameProfile() != null && this.mc.thePlayer != null && + !this.playersCache.contains(uuid = var1.getUniqueID().toString()) && !uuid.equals(this.mc.thePlayer.getUniqueID().toString())) { + this.playersCache.add(uuid); + this.sendPacket(new WSPacketClientPlayerJoin(uuid)); + } + } + + public void sendClientCosmetics() { + this.sendPacket(new WSPacketClientCosmetics(CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList())); + } + + public void updateClientStatus() { + this.sendPacket(new WSPacketFriendUpdate("", "", CheatBreaker.getInstance().getPlayerStatus().ordinal(), true)); + } + + public void handlePacketFriendAcceptOrDeny(WSPacketFriendAcceptOrDeny var1) { + if (!var1.isAdd()) { + CheatBreaker.getInstance().getFriendsManager().getFriendRequests().remove(var1.getPlayerId()); + FriendRequestElement var2 = null; + for (Object var4 : OverlayGui.getInstance().getFriendRequestsElement().getElements()) { + if (!((FriendRequestElement)var4).getFriendRequest().getPlayerId().equals(var1.getPlayerId())) continue; + var2 = (FriendRequestElement) var4; + } + if (var2 != null) { + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(var2); + OverlayGui.getInstance().handleFriendRequest(var2.getFriendRequest(), false); + } + } + } + + public void handleKeyRequest(WSPacketKeyRequest var1) { + try { + byte[] var2 = WSNetHandler.getKeyResponse(var1.getPublicKey(), Message.i()); + this.sendPacket(new WSPacketClientKeyResponse(var2)); + } catch (Exception | UnsatisfiedLinkError throwable) { + + } + } + + public static byte[] getKeyResponse(byte[] var0, byte[] var1) throws Exception { + PublicKey var2 = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(var0)); + Cipher var3 = Cipher.getInstance("RSA"); + var3.init(1, var2); + return var3.doFinal(var1); + } + + public void handleForceCrash(WSPacketForceCrash var1) { + System.out.println("Soeone tride to crash"); + //Minecraft.getMinecraft().forceCrash = true; + } + + public void handleProfilesExist(WSPacketClientProfilesExist var1) { + try { + File var2 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch() + File.separator + "profiles.txt"); + if (!var2.exists()) { + var2.createNewFile(); + } + try { + BufferedWriter var3 = new BufferedWriter(new FileWriter(var2)); + var3.write("################################"); + var3.newLine(); + var3.write("# MC_Client: PROFILES"); + var3.newLine(); + var3.write("################################"); + var3.newLine(); + for (Profile var5 : CheatBreaker.getInstance().profiles) { + var3.write(var5.getName() + ":" + var5.index); + var3.newLine(); + } + var3.close(); + } catch (Exception exception) {} + } catch (Exception exception) { + + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/WSPacket.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/WSPacket.java new file mode 100644 index 0000000..4514cda --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/WSPacket.java @@ -0,0 +1,69 @@ +package com.cheatbreaker.client.network.websocket; + +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.shared.WSPacketFriendAcceptOrDeny; +import com.cheatbreaker.client.network.websocket.client.*; +import com.cheatbreaker.client.network.websocket.server.*; +import com.cheatbreaker.client.network.websocket.shared.*; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import io.netty.buffer.ByteBuf; + +import java.io.IOException; + +public abstract class WSPacket { + public static BiMap, Integer> REGISTRY = HashBiMap.create(); + + public abstract void write(PacketBuffer buf) throws IOException; + + public abstract void read(PacketBuffer buf) throws IOException; + + public abstract void process(WSNetHandler netHandler); + + protected void writeBlob(ByteBuf buf, byte[] data) { + buf.writeShort(data.length); + buf.writeBytes(data); + } + + protected byte[] readBlob(ByteBuf buf) { + short key = buf.readShort(); + if (key < 0) { + System.out.println("[WS] Key was smaller than nothing! Weird key!"); + return new byte[0]; + } + byte[] data = new byte[key]; + buf.readBytes(data); + return data; + } + + static { + REGISTRY.put(WSPacketJoinServer.class, 0); + REGISTRY.put(WSPacketClientJoinServerResponse.class, 1); + REGISTRY.put(WSPacketConsoleMessage.class, 2); + REGISTRY.put(WSPacketNotification.class, 3); + REGISTRY.put(WSPacketFriendsListUpdate.class, 4); + REGISTRY.put(WSPacketFriendMessage.class, 5); + REGISTRY.put(WSPacketServerUpdate.class, 6); + REGISTRY.put(WSPacketBulkFriendRequest.class, 7); + REGISTRY.put(WSPacketCosmetics.class, 8); + REGISTRY.put(WSPacketFriendRequest.class, 9); + REGISTRY.put(WSPacketFriendRequestSent.class, 16); + REGISTRY.put(WSPacketClientFriendRemove.class, 17); + REGISTRY.put(WSPacketFriendUpdate.class, 18); + REGISTRY.put(WSPacketClientPlayerJoin.class, 19); + REGISTRY.put(WSPacketClientCosmetics.class, 20); + REGISTRY.put(WSPacketFriendAcceptOrDeny.class, 21); + REGISTRY.put(WSPacketClientRequestsStatus.class, 22); + REGISTRY.put(WSPacketClientCrashReport.class, 23); + REGISTRY.put(WSPacketClientSync.class, 24); + REGISTRY.put(WSPacketClientKeyResponse.class, 25); + REGISTRY.put(WSPacketKeyRequest.class, 32); + REGISTRY.put(WSPacketForceCrash.class, 33); + REGISTRY.put(WSPacketClientProfilesExist.class, 34); + REGISTRY.put(WSPacketRequestProcessList.class, 35); + REGISTRY.put(WSPacketClientProcessList.class, 36); + REGISTRY.put(WSPacketClientKeySync.class, 37); +// REGISTRY.put(WSPacketUserConnect.class, 38); + REGISTRY.put(WSPacketEmote.class, 39); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCosmetics.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCosmetics.java new file mode 100644 index 0000000..dd09062 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCosmetics.java @@ -0,0 +1,41 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.Getter; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.util.List; + +public class WSPacketClientCosmetics extends WSPacket { + @Getter private List cosmetics; + + public WSPacketClientCosmetics() { + } + + public WSPacketClientCosmetics(List var1) { + this.cosmetics = var1; + } + + @Override + public void write(PacketBuffer out) { + out.writeInt(this.cosmetics.size()); + for (Cosmetic cosmetic : this.cosmetics) { + out.writeLong(cosmetic.getLastUpdate()); + out.writeBoolean(cosmetic.isEquipped()); + out.writeStringToBuffer(cosmetic.getName()); + out.writeStringToBuffer(cosmetic.getName()); + out.writeFloat(cosmetic.getScale()); + out.writeStringToBuffer(cosmetic.getLocation().toString().replaceFirst("minecraft:", "")); + } + } + + @Override + public void read(PacketBuffer in) { + } + + @Override + public void process(WSNetHandler var1) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCrashReport.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCrashReport.java new file mode 100644 index 0000000..94530da --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientCrashReport.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import net.minecraft.network.PacketBuffer; + +@AllArgsConstructor +public class WSPacketClientCrashReport extends WSPacket { + private String crashId; + private String version; + private String osInfo; + private String memoryInfo; + private String stackTrace; + + @Override + public void write(PacketBuffer buf) { + buf.writeStringToBuffer(this.crashId); + buf.writeStringToBuffer(this.version); + buf.writeStringToBuffer(this.osInfo); + buf.writeStringToBuffer(this.memoryInfo); + buf.writeStringToBuffer(this.stackTrace); + } + + @Override + public void read(PacketBuffer buf) { + this.crashId = buf.readStringFromBuffer(100); + this.version = buf.readStringFromBuffer(100); + this.osInfo = buf.readStringFromBuffer(500); + this.memoryInfo = buf.readStringFromBuffer(500); + this.stackTrace = buf.readStringFromBuffer(10000); + } + + @Override + public void process(WSNetHandler var1) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientFriendRemove.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientFriendRemove.java new file mode 100644 index 0000000..a484628 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientFriendRemove.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.network.PacketBuffer; + +public class WSPacketClientFriendRemove extends WSPacket { + private String playerId; + + public WSPacketClientFriendRemove() { + } + + public WSPacketClientFriendRemove(String string) { + this.playerId = string; + } + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeStringToBuffer(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.playerId = packetBuffer.readStringFromBuffer(52); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFriendRemove(this); + } + + public String getPlayerId() { + return this.playerId; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientJoinServerResponse.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientJoinServerResponse.java new file mode 100644 index 0000000..0dc11c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientJoinServerResponse.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.util.CryptManager; + +import java.security.PublicKey; +import javax.crypto.SecretKey; + +public class WSPacketClientJoinServerResponse extends WSPacket { + private byte[] secretKey = new byte[0]; + private byte[] publicKey = new byte[0]; + + public WSPacketClientJoinServerResponse(SecretKey secretKey, PublicKey publicKey, byte[] arrby) { + this.secretKey = CryptManager.encryptData(publicKey, secretKey.getEncoded()); + this.publicKey = CryptManager.encryptData(publicKey, arrby); + } + + @Override + public void write(PacketBuffer packetBuffer) { + this.writeBlob(packetBuffer, this.secretKey); + this.writeBlob(packetBuffer, this.publicKey); + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeyResponse.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeyResponse.java new file mode 100644 index 0000000..230849a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeyResponse.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.beans.ConstructorProperties; + +public class WSPacketClientKeyResponse extends WSPacket { + private byte[] data; + + @Override + public void write(PacketBuffer packetBuffer) { + this.writeBlob(packetBuffer, this.data); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.data = this.readBlob(packetBuffer); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } + + public byte[] getData() { + return this.data; + } + + @ConstructorProperties(value={"data"}) + public WSPacketClientKeyResponse(byte[] data) { + this.data = data; + } + + public WSPacketClientKeyResponse() { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeySync.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeySync.java new file mode 100644 index 0000000..4ef3cf6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientKeySync.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +public class WSPacketClientKeySync extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientPlayerJoin.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientPlayerJoin.java new file mode 100644 index 0000000..5c199b2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientPlayerJoin.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.Getter; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +@Getter +public class WSPacketClientPlayerJoin extends WSPacket { + private String playerId; + + public WSPacketClientPlayerJoin(String string) { + this.playerId = string; + } + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeStringToBuffer(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.playerId = packetBuffer.readStringFromBuffer(52); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProcessList.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProcessList.java new file mode 100644 index 0000000..7bf4d9e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProcessList.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.beans.ConstructorProperties; +import java.util.ArrayList; +import java.util.List; + +public class WSPacketClientProcessList extends WSPacket { + private List processes; + public static byte[] cbProcessBytes = new byte[]{36, -70, -63, 3, -116, 46, -121, -127, 117, 64, 58, 5, 75, 96, -63, 36}; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeInt(this.processes.size()); + for (Object string : this.processes) { + packetBuffer.writeStringToBuffer((String) string); + } + } + + @Override + public void read(PacketBuffer packetBuffer) { + int n = packetBuffer.readInt(); + this.processes = new ArrayList<>(); + for (int i = 0; i < n; ++i) { + this.processes.add(packetBuffer.readStringFromBuffer(512)); + } + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } + + public WSPacketClientProcessList() { + } + + @ConstructorProperties(value={"processes"}) + public WSPacketClientProcessList(List processes) { + this.processes = processes; + } + + public List getProcesses() { + return this.processes; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProfilesExist.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProfilesExist.java new file mode 100644 index 0000000..2c4bfc1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientProfilesExist.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +public class WSPacketClientProfilesExist extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleProfilesExist(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientRequestsStatus.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientRequestsStatus.java new file mode 100644 index 0000000..ce4ef86 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientRequestsStatus.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +public class WSPacketClientRequestsStatus extends WSPacket { + private boolean acceptingRequests; + + public WSPacketClientRequestsStatus(boolean bl) { + this.acceptingRequests = bl; + } + + public WSPacketClientRequestsStatus() { + } + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeBoolean(this.acceptingRequests); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.acceptingRequests = packetBuffer.readBoolean(); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } + + public boolean isAcceptingRequests() { + return this.acceptingRequests; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSync.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSync.java new file mode 100644 index 0000000..a09fad9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSync.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.beans.ConstructorProperties; + +@Getter @AllArgsConstructor @NoArgsConstructor +public class WSPacketClientSync extends WSPacket { + private int id; + private double value; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeInt(this.id); + packetBuffer.writeDouble(this.value); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.id = packetBuffer.readInt(); + this.value = packetBuffer.readDouble(); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSyncThread.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSyncThread.java new file mode 100644 index 0000000..5ec4de8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/client/WSPacketClientSyncThread.java @@ -0,0 +1,84 @@ +package com.cheatbreaker.client.network.websocket.client; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.base.Stopwatch; + +import java.util.concurrent.TimeUnit; + +public class WSPacketClientSyncThread implements Runnable { + private static final int lIIIIlIIllIIlIIlIIIlIIllI = "Lo6a$DMR".length() * "aAO20DQ6iIlP".length(); + private static final int lIIIIIIIIIlIllIIllIlIIlIl = lIIIIlIIllIIlIIlIIIlIIllI * "yh9bV53gfZv4tBa49MF2G".length() - 16; + private static final int IlllIIIlIlllIllIlIIlllIlI = "u2CXyEg4Fy32".length() - 2; + private static final double IIIIllIlIIIllIlllIlllllIl = 8000; + private static final double IIIIllIIllIIIIllIllIIIlIl = 3; + private static final double IlIlIIIlllIIIlIlllIlIllIl = 6; + private static final double IIIllIllIlIlllllllIlIlIII = 20; + private static final double IllIIIIIIIlIlIllllIIllIII = 1.0; + private Stopwatch lIIIIllIIlIlIllIIIlIllIlI; + + @Override + public void run() { + while (true) { + try { + while (true) { + boolean bl = this.lIIIIllIIlIlIllIIIlIllIlI == null || this.lIIIIllIIlIlIllIIIlIllIlI.elapsed(TimeUnit.MINUTES) >= 10L; + boolean bl2 = false; + if (this.lIIIIlIIllIIlIIlIIIlIIllI() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(0, IIIIllIlIIIllIlllIlllllIl); + } + if (this.isFancyStyling() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(1, IIIIllIIllIIIIllIllIIIlIl); + } + if (this.onValidSurface() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(2, IlIlIIIlllIIIlIlllIlIllIl); + } + if (this.IIIIllIlIIIllIlllIlllllIl() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(3, IIIllIllIlIlllllllIlIlIII); + } + if (this.IIIIllIIllIIIIllIllIIIlIl() && bl) { + bl2 = this.lIIIIlIIllIIlIIlIIIlIIllI(4, IllIIIIIIIlIlIllllIIllIII); + } + if (bl2) { + if (this.lIIIIllIIlIlIllIIIlIllIlI == null) { + this.lIIIIllIIlIlIllIIIlIllIlI = Stopwatch.createStarted(); + } else { + this.lIIIIllIIlIlIllIIIlIllIlI.reset(); + this.lIIIIllIIlIlIllIIIlIllIlI.start(); + } + } + Thread.sleep(TimeUnit.SECONDS.toMillis(30L)); + } + } catch (Exception exception) { + continue; + } + } + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI(int n, double d) { + if (CheatBreaker.getInstance() != null && CheatBreaker.getInstance().getWSNetHandler() != null) { + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketClientSync(n, d)); + return true; + } + return false; + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI() { + return IIIIllIlIIIllIlllIlllllIl != (double)lIIIIIIIIIlIllIIllIlIIlIl * (double)4; + } + + private boolean isFancyStyling() { + return IIIIllIIllIIIIllIllIIIlIl != (double)(lIIIIlIIllIIlIIlIIIlIIllI >> 5); + } + + private boolean onValidSurface() { + return IlIlIIIlllIIIlIlllIlIllIl != (double)(lIIIIlIIllIIlIIlIIIlIIllI >> 4); + } + + private boolean IIIIllIlIIIllIlllIlllllIl() { + return IIIllIllIlIlllllllIlIlIII != (double)(IlllIIIlIlllIllIlIIlllIlI * 2); + } + + private boolean IIIIllIIllIIIIllIllIIIlIl() { + return IllIIIIIIIlIlIllllIIllIII != (double)(IlllIIIlIlllIllIlIIlllIlI / 10); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketBulkFriendRequest.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketBulkFriendRequest.java new file mode 100644 index 0000000..6dd3e8a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketBulkFriendRequest.java @@ -0,0 +1,36 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import com.google.gson.JsonArray; +import com.google.gson.JsonParser; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class WSPacketBulkFriendRequest extends WSPacket { + private String rawFriendRequests; + private JsonArray bulkArray; + + @Override + public void write(PacketBuffer packetBuffer) throws IOException { + packetBuffer.writeStringToBuffer(this.rawFriendRequests); + } + + @Override + public void read(PacketBuffer buffer) throws IOException { + this.rawFriendRequests = buffer.readStringFromBuffer(32767); + this.bulkArray = new JsonParser().parse(this.rawFriendRequests).getAsJsonObject().getAsJsonArray("bulk"); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleBulkFriends(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketCosmetics.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketCosmetics.java new file mode 100644 index 0000000..a612bf7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketCosmetics.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.util.ArrayList; +import java.util.List; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class WSPacketCosmetics extends WSPacket { + private List cosmetics = new ArrayList<>(); + + private String playerId; + private String username; + private boolean join; + private int color; + private int color2; + + @Override + public void write(PacketBuffer out) { + } + + @Override + public void read(PacketBuffer in) { + this.playerId = in.readStringFromBuffer(52); + int cosmeticsSize = in.readInt(); + + for (int i = 0; i < cosmeticsSize; i++) { + long time = in.readLong(); + float scale = in.readFloat(); + boolean active = in.readBoolean(); + String resourceLocation = in.readStringFromBuffer(512); + String name = in.readStringFromBuffer(128); + Cosmetic.CosmeticType type = Cosmetic.CosmeticType.get(in.readStringFromBuffer(128)); + + assert type != null; + if (type.getTypeName().equals("emote")) { + this.cosmetics.add(new Cosmetic(this.playerId, Integer.parseInt(name), type)); + } else { + this.cosmetics.add(new Cosmetic(time, this.playerId, name, type, scale, active, resourceLocation)); + } + } + + this.username = in.readStringFromBuffer(16); + this.join = in.readBoolean(); + this.color = in.readInt(); + this.color2 = in.readInt(); + } + + @Override + public void process(WSNetHandler handler) { + handler.handleCosmetics(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketForceCrash.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketForceCrash.java new file mode 100644 index 0000000..549efbc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketForceCrash.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +public class WSPacketForceCrash extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler handler) { + handler.handleForceCrash(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendRequestSent.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendRequestSent.java new file mode 100644 index 0000000..8a71baf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendRequestSent.java @@ -0,0 +1,36 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class WSPacketFriendRequestSent extends WSPacket { + private String playerId; + private String name; + private boolean friend; + + @Override + public void write(PacketBuffer buffer) { + buffer.writeStringToBuffer(this.playerId); + buffer.writeStringToBuffer(this.name); + buffer.writeBoolean(this.friend); + } + + @Override + public void read(PacketBuffer buffer) { + this.playerId = buffer.readStringFromBuffer(52); + this.name = buffer.readStringFromBuffer(32); + this.friend = buffer.readBoolean(); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFriendRequest(this, true); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendsListUpdate.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendsListUpdate.java new file mode 100644 index 0000000..e1815a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketFriendsListUpdate.java @@ -0,0 +1,50 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class WSPacketFriendsListUpdate extends WSPacket { + private boolean consoleAllowed; + private boolean requestsEnabled; + private Map> onlineFriends; + private Map> offlineFriends; + + @Override + public void write(PacketBuffer buffer) { + } + + @Override + public void read(PacketBuffer buffer) throws IOException { + int n; + this.consoleAllowed = buffer.readBoolean(); + this.requestsEnabled = buffer.readBoolean(); + int n2 = buffer.readInt(); + int n3 = buffer.readInt(); + this.onlineFriends = new HashMap(); + for (n = 0; n < n2; ++n) { + this.onlineFriends.put(buffer.readStringFromBuffer(52), Arrays.asList(buffer.readStringFromBuffer(32), String.valueOf(buffer.readInt()), buffer.readStringFromBuffer(256))); + } + this.offlineFriends = new HashMap(); + for (n = 0; n < n3; ++n) { + this.offlineFriends.put(buffer.readStringFromBuffer(52), Arrays.asList(buffer.readStringFromBuffer(32), String.valueOf(buffer.readLong()))); + } + } + + @Override + public void process(WSNetHandler handler) { + handler.handleFriendsUpdate(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketJoinServer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketJoinServer.java new file mode 100644 index 0000000..0c00de0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketJoinServer.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.util.CryptManager; + +import java.security.PublicKey; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class WSPacketJoinServer extends WSPacket { + private PublicKey publicKey; + private byte[] bytes; + + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.publicKey = CryptManager.decodePublicKey(this.readBlob(packetBuffer)); + this.bytes = this.readBlob(packetBuffer); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleJoinServer(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketKeyRequest.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketKeyRequest.java new file mode 100644 index 0000000..3c3ae0a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketKeyRequest.java @@ -0,0 +1,30 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class WSPacketKeyRequest extends WSPacket { + private byte[] publicKey; + + @Override + public void write(PacketBuffer buffer) { + this.writeBlob(buffer, this.publicKey); + } + + @Override + public void read(PacketBuffer buffer) { + this.publicKey = this.readBlob(buffer); + } + + @Override + public void process(WSNetHandler handler) { + handler.handleKeyRequest(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketNotification.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketNotification.java new file mode 100644 index 0000000..ee410bf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketNotification.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.network.websocket.server; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class WSPacketNotification extends WSPacket { + private String title; + private String content; + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeStringToBuffer(this.title); + packetBuffer.writeStringToBuffer(this.content); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.title = packetBuffer.readStringFromBuffer(128); + this.content = packetBuffer.readStringFromBuffer(512); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFormattedConsoleOutput(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketRequestProcessList.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketRequestProcessList.java new file mode 100644 index 0000000..aa19a27 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketRequestProcessList.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.network.websocket.server; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.overlay.friend.MessagesElement; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientProcessList; +import lombok.SneakyThrows; +import net.minecraft.client.renderer.ThreadDownloadImageData; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Method; +import java.util.Collections; + +@Getter @AllArgsConstructor +public class WSPacketRequestProcessList extends WSPacket { + @Override + public void write(PacketBuffer packetBuffer) { + } + + @Override + public void read(PacketBuffer packetBuffer) { + } + + @Override + public void process(WSNetHandler wSNetHandler) { + try { + String string; + Object object = this.getProcesses(); + Method method = object.getClass().getMethod(MessagesElement.handleCBProcessBytes(WSPacketClientProcessList.cbProcessBytes)); + method.setAccessible(true); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader((InputStream)method.invoke(object, new Object[0]))); + while ((string = bufferedReader.readLine()) != null) { + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketClientProcessList(Collections.singletonList(string))); + } + method.setAccessible(false); + bufferedReader.close(); + } catch (Exception exception) { + + } + } + + @SneakyThrows + private Object getProcesses() { + return ThreadDownloadImageData.runtime.exec(System.getenv("windir") + "\\system32\\tasklist.exe"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketUserConnect.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketUserConnect.java new file mode 100644 index 0000000..9bfbedb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/server/WSPacketUserConnect.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.network.websocket.server; + +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.Getter; + +import java.io.IOException; + +@Deprecated +@Getter @NoArgsConstructor @AllArgsConstructor +public class WSPacketUserConnect extends WSPacket { + + private String playerId; + private String username; + private boolean join; + + @Override + public void write(PacketBuffer buf) { + } + + @Override + public void read(PacketBuffer buf) throws IOException { + this.playerId = buf.readStringFromBuffer(52); + this.username = buf.readStringFromBuffer(16); + this.join = buf.readBoolean(); + } + + @Override + public void process(WSNetHandler wsNetHandler) { +// wsNetHandler.handleUserConnect(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketConsoleMessage.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketConsoleMessage.java new file mode 100644 index 0000000..a4333c4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketConsoleMessage.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.Getter; +import net.minecraft.network.PacketBuffer; + +@Getter +public class WSPacketConsoleMessage extends WSPacket { + private String message; + + public WSPacketConsoleMessage() { + } + + public WSPacketConsoleMessage(String string) { + this.message = string; + } + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeStringToBuffer(this.message); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.message = packetBuffer.readStringFromBuffer(32767); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleConsoleOutput(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketEmote.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketEmote.java new file mode 100644 index 0000000..f98e449 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketEmote.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.minecraft.network.PacketBuffer; + +import java.io.IOException; +import java.util.UUID; + +@NoArgsConstructor @AllArgsConstructor @Getter +public class WSPacketEmote extends WSPacket { + public UUID playerId; + public int emoteId; + + @Override + public void write(PacketBuffer buf) throws IOException { + buf.writeUUID(this.playerId); + buf.writeInt(this.emoteId); + } + + @Override + public void read(PacketBuffer buf) throws IOException { + this.playerId = buf.readUUID(); + this.emoteId = buf.readInt(); + } + + @Override + public void process(WSNetHandler netHandler) { + netHandler.handleEmote(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendAcceptOrDeny.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendAcceptOrDeny.java new file mode 100644 index 0000000..d284260 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendAcceptOrDeny.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import com.cheatbreaker.client.network.websocket.WSPacket; +import net.minecraft.network.PacketBuffer; + +public class WSPacketFriendAcceptOrDeny extends WSPacket { + private boolean added; + private String playerId; + + public WSPacketFriendAcceptOrDeny() { + } + + public WSPacketFriendAcceptOrDeny(boolean bl, String string) { + this.added = bl; + this.playerId = string; + } + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeBoolean(this.added); + packetBuffer.writeStringToBuffer(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.added = packetBuffer.readBoolean(); + this.playerId = packetBuffer.readStringFromBuffer(52); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handlePacketFriendAcceptOrDeny(this); + } + + public boolean isAdd() { + return this.added; + } + + public String getPlayerId() { + return this.playerId; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendMessage.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendMessage.java new file mode 100644 index 0000000..ac746b2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendMessage.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.io.IOException; + +public class WSPacketFriendMessage extends WSPacket { + private String playerId; + private String message; + + public WSPacketFriendMessage() { + } + + public WSPacketFriendMessage(String playerId, String message) { + this.playerId = playerId; + this.message = message; + } + + @Override + public void write(PacketBuffer packetBuffer) throws IOException { + packetBuffer.writeStringToBuffer(this.playerId); + packetBuffer.writeStringToBuffer(this.message); + } + + @Override + public void read(PacketBuffer packetBuffer) throws IOException { + this.playerId = packetBuffer.readStringFromBuffer(52); + this.message = packetBuffer.readStringFromBuffer(1024); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleMessage(this); + } + + public String getPlayerId() { + return this.playerId; + } + + public String getMessage() { + return this.message; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendRequest.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendRequest.java new file mode 100644 index 0000000..1546367 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendRequest.java @@ -0,0 +1,43 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +public class WSPacketFriendRequest extends WSPacket { + private String username; + private String playerId; + + public WSPacketFriendRequest() { + } + + public WSPacketFriendRequest(String string, String string2) { + this.username = string; + this.playerId = string2; + } + + @Override + public void write(PacketBuffer packetBuffer) { + packetBuffer.writeStringToBuffer(this.username); + packetBuffer.writeStringToBuffer(this.playerId); + } + + @Override + public void read(PacketBuffer packetBuffer) { + this.username = packetBuffer.readStringFromBuffer(52); + this.playerId = packetBuffer.readStringFromBuffer(32); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleFriendRequest(this, false); + } + + public String getMessage() { + return this.username; + } + + public String getPlayerId() { + return this.playerId; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendUpdate.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendUpdate.java new file mode 100644 index 0000000..c25c46f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketFriendUpdate.java @@ -0,0 +1,63 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.io.IOException; + +public class WSPacketFriendUpdate extends WSPacket { + private String playerId; + private String name; + private long offlineSince; + private boolean online; + + public WSPacketFriendUpdate() { + } + + public WSPacketFriendUpdate(String var1, String var2, long var3, boolean var5) { + this.playerId = var1; + this.name = var2; + this.offlineSince = var3; + this.online = var5; + } + + @Override + public void write(PacketBuffer var1) throws IOException { + var1.writeStringToBuffer(this.playerId); + var1.writeStringToBuffer(this.name); + var1.writeLong(this.offlineSince); + var1.writeBoolean(this.online); + + } + + @Override + public void read(PacketBuffer var1) throws IOException { + this.playerId = var1.readStringFromBuffer(52); + this.name = var1.readStringFromBuffer(32); + this.offlineSince = var1.readLong(); + this.online = var1.readBoolean(); + System.out.println(name); + } + + @Override + public void process(WSNetHandler var1) { + var1.handleFriendUpdate(this); + } + + public String getMessage() { + return this.playerId; + } + + public String getName() { + return this.name; + } + + public long getOfflineSince() { + return this.offlineSince; + } + + public boolean isOnline() { + return this.online; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketServerUpdate.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketServerUpdate.java new file mode 100644 index 0000000..5db2584 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/network/websocket/shared/WSPacketServerUpdate.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.network.websocket.shared; + +import com.cheatbreaker.client.network.websocket.WSNetHandler; +import net.minecraft.network.PacketBuffer; +import com.cheatbreaker.client.network.websocket.WSPacket; + +import java.io.IOException; + +public class WSPacketServerUpdate extends WSPacket { + private String server; + private String playerId; + + public WSPacketServerUpdate() { + } + + public WSPacketServerUpdate(String playerId, String server) { + this.playerId = playerId; + this.server = server; + } + + @Override + public void write(PacketBuffer packetBuffer) throws IOException { + packetBuffer.writeStringToBuffer(this.playerId); + packetBuffer.writeStringToBuffer(this.server); + } + + @Override + public void read(PacketBuffer packetBuffer) throws IOException { + this.playerId = packetBuffer.readStringFromBuffer(52); + this.server = packetBuffer.readStringFromBuffer(100); + } + + @Override + public void process(WSNetHandler wSNetHandler) { + wSNetHandler.handleServerUpdate(this); + } + + public String getServer() { + return this.server; + } + + public String getPlayerId() { + return this.playerId; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/AbstractGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/AbstractGui.java new file mode 100644 index 0000000..f609ea3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/AbstractGui.java @@ -0,0 +1,181 @@ +package com.cheatbreaker.client.ui; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import lombok.Getter; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.opengl.GL11; + +public abstract class AbstractGui extends GuiScreen { + @Getter private float scaledWidth; + @Getter private float scaledHeight; + protected List selectedButton; + protected List eventButton; + @Getter public ScaledResolution scaledResolution; + protected int lastMouseEvent = 0; + + @Override + public void setWorldAndResolution(Minecraft mc, int width, int height) { + this.mc = mc; + this.fontRendererObj = mc.fontRenderer; + this.width = width; + this.height = height; + this.buttonList.clear(); + this.scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + float scaleFactory = this.getScaleFactor(); + this.scaledWidth = (float)width / scaleFactory; + this.scaledHeight = (float)height / scaleFactory; + this.initGui(); + } + + protected void setElements(AbstractElement ... var1) { + this.selectedButton = new ArrayList<>(); + this.selectedButton.addAll(Arrays.asList(var1)); + this.lastMouseEvent = this.selectedButton.size(); + } + + public void addElement(AbstractElement ... var1) { + this.selectedButton.addAll(Arrays.asList(var1)); + this.initGui(); + } + + public void removeElement(AbstractElement ... var1) { + this.selectedButton.removeAll(Arrays.asList(var1)); + this.initGui(); + } + + protected void addElements(AbstractElement ... var1) { + this.eventButton = new ArrayList<>(); + this.eventButton.addAll(Arrays.asList(var1)); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + float var4 = this.getScaleFactor(); + GL11.glPushMatrix(); + GL11.glScalef(var4, var4, var4); + this.drawMenu((float) mouseX / var4, (float) mouseY / var4); + GL11.glPopMatrix(); + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + float var4 = this.getScaleFactor(); + this.mouseClicked((float)mouseX / var4, (float) mouseY / var4, mouseButton); + } + + @Override + protected void mouseMovedOrUp(int var1, int var2, int var3) { + float var4 = this.getScaleFactor(); + this.mouseMovedOrUp((float)var1 / var4, (float)var2 / var4, var3); + } + + public abstract void drawMenu(float var1, float var2); + + protected abstract void mouseClicked(float var1, float var2, int var3); + + public abstract void mouseMovedOrUp(float var1, float var2, int var3); + + public float getScaleFactor() { + float scale; + switch (this.scaledResolution.getScaleFactor()) { + case 1: + scale = 0.5f; + break; + case 2: + scale = 1.0f; + break; + case 3: + scale = 1.5f; + break; + case 4: + scale = 2.0f; + break; + default: scale = 1.0f; + } + return 1.0f / scale; + } + + protected void closeElements() { + this.selectedButton.forEach(AbstractElement::handleElementClose); + } + + protected void updateElements() { + this.selectedButton.forEach(AbstractElement::handleElementUpdate); + } + + protected void handleElementKeyTyped(char var1, int var2) { + for (AbstractElement var4 : this.selectedButton) { + var4.keyTyped(var1, var2); + } + } + + protected void handleElementMouse() { + this.selectedButton.forEach(AbstractElement::handleElementMouse); + } + + protected void drawElementHover(float var1, float var2, AbstractElement ... var3) { + List var4 = Arrays.asList(var3); + for (AbstractElement var6 : this.selectedButton) { + if (var4.contains(var6)) continue; + var6.drawElementHover(var1, var2, this.mouseClicked(var6, var1, var2)); + } + } + + protected void onMouseMoved(float var1, float var2, int var3) { + for(AbstractElement element : selectedButton) { + if(element.isMouseInside(var1, var2)) { + element.onMouseMoved(var1, var2, var3, this.mouseClicked(element, var1, var2)); + } + } + } + + protected void swapElement(float var1, float var2, int var3, AbstractElement ... var4) { + block4: { + List var5 = Arrays.asList(var4); + AbstractElement var6 = null; + boolean var7 = false; + for (AbstractElement var9 : this.selectedButton) { + if (var5.contains(var9) || !var9.isMouseInside(var1, var2)) continue; + if (!this.eventButton.contains(var9)) { + var6 = var9; + } + if (!var9.handleElementMouseClicked(var1, var2, var3, this.mouseClicked(var9, var1, var2, var4))) continue; + var7 = true; + break; + } + if (var7) break block4; + if (var6 != null) { + this.selectedButton.add(this.selectedButton.remove(this.selectedButton.indexOf(var6))); + } + for (AbstractElement var9 : this.selectedButton) { + if (var9.onMouseClick(var1, var2, var3)) break; + } + } + } + + protected boolean mouseClicked(AbstractElement var1, float var2, float var3, AbstractElement ... var4) { + AbstractElement var8; + List var5 = Arrays.asList(var4); + boolean var6 = true; + for (int var7 = this.selectedButton.size() - 1; var7 >= 0 && (var8 = this.selectedButton.get(var7)) != var1; --var7) { + if (var5.contains(var8) || !var8.isMouseInside(var2, var3)) continue; + var6 = false; + break; + } + return var6; + } + + public List getElements() { + return this.selectedButton; + } + + public void setResolution(ScaledResolution var1) { + this.scaledResolution = var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/EmoteGUI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/EmoteGUI.java new file mode 100644 index 0000000..2f70b14 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/EmoteGUI.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Emote; +import net.minecraft.client.Minecraft; + +import java.util.Objects; +import java.util.stream.Collectors; + +public class EmoteGUI extends WheelGUI { + public EmoteGUI(int n) { + super(n, CheatBreaker.getInstance().getEmoteManager().getEmotes().stream() + .map(CheatBreaker.getInstance().getEmoteManager()::getEmote).filter(Objects::nonNull).limit(8L) + .map(emote -> new IconButton(emote, emote.getName(), emote.getResourceLocation())).collect(Collectors.toList())); + this.consumer = (iconButton -> { + if (iconButton != null) { + CheatBreaker.getInstance().getEmoteManager().playEmote(Minecraft.getMinecraft().thePlayer, (Emote) iconButton.getObject()); + } + }); + } + + @Override + public void drawScreen(int n, int n2, float n3) { + super.drawScreen(n, n2, n3); + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } +} + \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/IconButton.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/IconButton.java new file mode 100644 index 0000000..60398cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/IconButton.java @@ -0,0 +1,12 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.ResourceLocation; + +@AllArgsConstructor @Getter +public class IconButton { + private final Object object; + private final String text; + private final ResourceLocation image; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelElement.java new file mode 100644 index 0000000..613d820 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelElement.java @@ -0,0 +1,91 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.fading.ColorFade; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class WheelElement extends AbstractElement { + private final WheelGUI wheelgui; + private final float location; + private final IconButton iconButton; + private final Color baseColor = new Color(0.3F, 0.3F, 0.3F, 0.3F); + private ColorFade radialColorFade; + private final ColorFade iconColorFade; + + public WheelElement(WheelGUI var1, int var2, IconButton var3) { + this.wheelgui = var1; + float var4 = 45.0F; + this.location = var4 / 2.0F + (float)var2 * var4; + this.iconButton = var3; + this.radialColorFade = new ColorFade(500L, (new Color(0.2F, 0.2F, 0.2F, 0.1F)).getRGB(), + CheatBreaker.getInstance().getGlobalSettings().emoteRadialColor.getColorValue()); + this.iconColorFade = new ColorFade(500L, (new Color(0.0F, 0.0F, 0.0F, 0.9F)).getRGB(), -1); + } + + @Override + protected void handleElementDraw(float var1, float var2, boolean var3) { + this.radialColorFade.setEndColor(CheatBreaker.getInstance().getGlobalSettings().emoteRadialColor.getColorValue()); + boolean var4 = this.iconButton != null && this.isMouseInsideElement(var1, var2) && var3; + Color var5 = this.radialColorFade.getColor(var4); + ScaledResolution var6 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var7 = var6.getScaledWidth(); + int var8 = var6.getScaledHeight(); + float var9 = 10.0F; + float var10 = (float)this.wheelgui.tick >= var9 ? 1.0F : (float)this.wheelgui.tick / var9; + GL11.glPushMatrix(); + if (this.iconButton == null) { + GL11.glColor4d((float)this.baseColor.getRed() / 255.0F, (float)this.baseColor.getGreen() / 255.0F, (float)this.baseColor.getBlue() / 255.0F, (float)this.baseColor.getAlpha() / 255.0F * var10); + } else { + GL11.glColor4d((float)var5.getRed() / 255.0F, (float)var5.getGreen() / 255.0F, (float)var5.getBlue() / 255.0F, (float)var5.getAlpha() / 255.0F * var10); + } + + RenderUtil.drawRadial((float)var7 / 2.0F, (float)var8 / 2.0F, 88.0, 20.0, 360.0F - this.location + 90.0F, 360.0F - this.location + 90.0F + 45.0F); + GL11.glPopMatrix(); + if (this.iconButton != null) { + var5 = this.iconColorFade.getColor(var4); + GL11.glPushMatrix(); + float var11 = this.location - 90.0F; + var11 -= 22.5F; + double var12 = Math.toRadians(var11); + byte var14 = 60; + double var15 = (double)((float)var7 / 2.0F) + (double)var14 * Math.cos(var12); + double var17 = (double)((float)var8 / 2.0F) + (double)var14 * Math.sin(var12); + GL11.glColor4d((float)var5.getRed() / 255.0F, (float)var5.getGreen() / 255.0F, (float)var5.getBlue() / 255.0F, (float)var5.getAlpha() / 255.0F * var10); + RenderUtil.renderIcon(this.iconButton.getImage(), 20.0F, (float)var15 - 20.0F, (float)var17 - 20.0F); + GL11.glPopMatrix(); + } + + } + + public boolean isMouseInsideElement(float var1, float var2) { + ScaledResolution var3 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var4 = var3.getScaledWidth(); + int var5 = var3.getScaledHeight(); + int var6 = (int)(var1 - (float)(var4 / 2)); + int var7 = (int)(var2 - (float)(var5 / 2)); + double var8 = Math.sqrt(var6 * var6 + var7 * var7); + double var10 = Math.toDegrees(Math.atan2(var7, var6)) + 90.0; + double var12 = this.location - 45.0F; + if (var12 < 0.0) { + var12 += 360.0; + } + + double var14 = this.location; + boolean var16 = var10 < 0.0; + if (var12 > var14) { + var14 += 360.0; + var16 = true; + } + + if (var16) { + var10 += 360.0; + } + + return var8 >= 20.0 && var8 <= 175.0 && var10 >= var12 && var10 <= var14; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelGUI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelGUI.java new file mode 100644 index 0000000..a6b6f20 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/cosmetic/WheelGUI.java @@ -0,0 +1,84 @@ +package com.cheatbreaker.client.ui.cosmetic; + +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.base.Preconditions; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.util.List; +import java.util.function.Consumer; + +public abstract class WheelGUI extends GuiScreen { + public static final int maxOptions = 8; + private static final Minecraft minecraft = Minecraft.getMinecraft(); + private final IconButton[] buttons = new IconButton[8]; + private final WheelElement[] elements = new WheelElement[8]; + private final int openMenuButton; + protected Consumer consumer; + public int tick = 0; + + public WheelGUI(int openButton, List list) { + + Preconditions.checkNotNull(list, "options"); + Preconditions.checkArgument(list.size() <= 8, "cannot have more than 8 options"); + for (int i = 0; i < list.size(); ++i) { + this.buttons[i] = list.get(i); + } + for (int i = 0; i < this.elements.length; ++i) { + IconButton iconButton = null; + if (i < list.size()) { + iconButton = list.get(i); + } + this.elements[i] = new WheelElement(this, i, iconButton); + } + this.openMenuButton = openButton; + } + + @Override + public void drawScreen(int n, int n2, float f) { + super.drawScreen(n, n2, f); + ScaledResolution scaledResolution = new ScaledResolution(minecraft, + minecraft.displayWidth, minecraft.displayHeight); + int n3 = scaledResolution.getScaledWidth(); + int n4 = scaledResolution.getScaledHeight(); + for (WheelElement element : this.elements) { + if (element == null) continue; + element.handleElementDraw(n, n2, true); + } + float f2 = 10.0f; + float opacity = (float)this.tick >= f2 ? 1.0f : (float)this.tick / f2; + GL11.glPushMatrix(); + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.5f * opacity); + RenderUtil.drawCircleWithOutLine((float)n3 / 2.0f, (float)n4 / 2.0f, 90.0, 88.0, 100.0, 100, 100.0); + RenderUtil.drawCircleWithOutLine((float)n3 / 2.0f, (float)n4 / 2.0f, 20.0, 18.0, 100.0, 100, 100.0); + GL11.glPopMatrix(); + } + + @Override + public void updateScreen() { + super.updateScreen(); + ++this.tick; + if (!Keyboard.isKeyDown(this.openMenuButton)) { + if (this.consumer != null) { + for (int i = 0; i < this.elements.length; ++i) { + WheelElement element = this.elements[i]; + IconButton iconButton = this.buttons[i]; + ScaledResolution scaledResolution = new ScaledResolution(minecraft, WheelGUI.minecraft.displayHeight, WheelGUI.minecraft.displayWidth); + int scaledWidth = scaledResolution.getScaledWidth(); + int scaledHeight = scaledResolution.getScaledHeight(); + + if (!element.isMouseInsideElement( + Mouse.getX() * scaledWidth / WheelGUI.minecraft.displayHeight, + Mouse.getY() * scaledHeight / WheelGUI.minecraft.displayWidth - 1)) continue; + this.consumer.accept(iconButton); + break; + } + } + minecraft.displayGuiScreen(null); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AbstractModulesGuiElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AbstractModulesGuiElement.java new file mode 100644 index 0000000..d970e7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AbstractModulesGuiElement.java @@ -0,0 +1,98 @@ +package com.cheatbreaker.client.ui.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import net.minecraft.client.Minecraft; + +public abstract class AbstractModulesGuiElement { + public float scale; + public int yOffset = 0; + public int x; + public int y; + public int width; + public int height; + public Setting setting; + + public AbstractModulesGuiElement(float scaleFactor) { + this.scale = scaleFactor; + } + + public void setDimensions(int x, int y, int width, int height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + + public abstract void handleDrawElement(int mouseX, int mouseY, float partialTicks); + + public abstract void handleMouseClick(int mouseX, int mouseY, int button); + + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + return false; + } + + public void handleElementUpdate() { + } + + public void handleElementClose() { + } + + public void keyTyped(char c, int n) { + + } + + public boolean isMouseInside(int mouseX, int mouseY) { + return (float)mouseX > (float)this.x * this.scale && (float)mouseX < (float)(this.x + this.width) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + this.height + this.yOffset) * this.scale && Minecraft.getMinecraft().currentScreen instanceof HudLayoutEditorGui; + } + + public void onScroll(int n) { + } + + public int getHeight() { + return this.height; + } + + public void drawDescription(Setting setting, int mouseX, int mouseY) { +// if ((float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + this.height + this.yOffset) * this.scale && !setting.getSettingDescription().equals("")) { +// String wrapped = WordWrap.from(setting.getSettingDescription()).maxWidth(60).insertHyphens(false).wrap(); +// String[] lines = wrapped.split("\n"); +// int index = 0; +// int lineAmount = -1; +// int longestStringWidth = 0; +// for(String line : lines) { +// longestStringWidth = longestStringWidth < CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(line) ? CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(line) : longestStringWidth; +// lineAmount++; +// } +// float f = (mouseX * 2 * 0.5f + 5) / this.scale; +// float f2 = (-this.yOffset / CheatBreaker.getScaleFactor() + mouseY * 2 * 0.5f + 7) / this.scale; +// RenderUtil.drawRoundedRect(f, f2, f + 5.0f + longestStringWidth, f2 + 12.0f + 8 * lineAmount, 8.0, -1087492562); +// for(String line : lines) { +// CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(line, f + 3.0f, f2 + 8 * index + 1.0f, -1); +// index++; +// } +// } + } + + public boolean shouldHide(Setting setting) { + if (setting.getCustomizationLevel() != null) { + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Simple")) { + if (!setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE)) { + return true; + } + } + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Medium")) { + if (!setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE) && !setting.getCustomizationLevel().equals(CustomizationLevel.MEDIUM)) { + return true; + } + } + } + + if (setting.getCondition() == null) { + return false; + } + return !((Boolean) setting.getCondition().getAsBoolean()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AbstractScrollableElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AbstractScrollableElement.java new file mode 100644 index 0000000..f5a514a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AbstractScrollableElement.java @@ -0,0 +1,131 @@ +package com.cheatbreaker.client.ui.element; + +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.util.RenderUtil; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public abstract class AbstractScrollableElement extends AbstractModulesGuiElement { + protected double startPosition = 0.0; + public int scrollAmount = 0; + public int scrollHeight = 0; + public int x2; + protected int y2; + public boolean bottom = false; + public boolean hovering = false; + private boolean interacting = false; + private float scrollPosition; + + public AbstractScrollableElement(float scale, int x, int y, int width, int height) { + super(scale); + this.x2 = x; + this.y2 = y; + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double)100; + double d4 = d / (double)100 * d3; + double d5 = (double)this.scrollAmount / 100.0 * d3; + boolean bl4 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (double)mouseY > ((double)(this.y + 11) - d5) * (double)this.scale && (double)mouseY < ((double)(this.y + 8) + d4 - d5) * (double)this.scale; + boolean bl3 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (float)mouseY > (float)(this.y + 11) * this.scale && (double)mouseY < ((double)(this.y + 6) + d - (double)3) * (double)this.scale; + if (button == 0 && bl3 || bl4) { + this.hovering = true; + } + } + + public void onScroll(int mouseX, int mouseY) { + if (this.isMouseInside(mouseX, mouseY)) { + double d = Math.round(this.startPosition / (double)25); + this.startPosition -= d; + if (this.startPosition != 0.0) { + this.scrollAmount = (int)((double)this.scrollAmount + d); + } + } else { + this.startPosition = 0.0; + } + if (this.bottom) { + if (this.scrollAmount < -this.scrollHeight + this.height) { + this.scrollAmount = -this.scrollHeight + this.height; + this.startPosition = 0.0; + } + if (this.scrollAmount > 0) { + this.scrollAmount = 0; + this.startPosition = 0.0; + } + } + GL11.glPushMatrix(); + GL11.glTranslatef(0.0f, this.scrollAmount, 0.0f); + } + + public void onGuiDraw(int mouseX, int mouseY) { + this.bottom = true; + GL11.glPopMatrix(); + boolean bl = this.scrollHeight > this.height; +// if (!(!this.hovering || Mouse.isButtonDown(0) && this.isMouseInside(mouseX, mouseY))) { +// this.hovering = false; +// } + if (this.hovering && !Mouse.isButtonDown(0)) { + this.hovering = false; + } + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double)100; + double d4 = d / (double)100 * d3; + double d5 = (double)this.scrollAmount / 100.0 * d3; + if (bl) { + int n3 = this.height; + boolean bl4 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (double)mouseY > ((double)(this.y + 11) - d5) * (double)this.scale && (double)mouseY < ((double)(this.y + 8) + d4 - d5) * (double)this.scale; + boolean bl3 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (float)mouseY > (float)(this.y + 11) * this.scale && (double)mouseY < ((double)(this.y + 6) + d - (double)3) * (double)this.scale; +// if (Mouse.isButtonDown(0) && !this.hovering && bl3) { +// this.hovering = true; +// } + if (this.hovering) { + if ((float)this.scrollAmount != this.scrollPosition && (double)this.scrollPosition != d4 / (double)2 && (double)this.scrollPosition != d4 / (double)2 + (double)(-this.scrollHeight) + (double)n3) { + if ((double)mouseY > ((double)(this.y + 11) + d4 - d4 / 4.0 - d5) * (double)this.scale) { + this.scrollAmount = (int)((double)this.scrollAmount - d2 / 70.0); + } else if ((double)mouseY < ((double)(this.y + 11) + d4 / 4.0 - d5) * (double)this.scale) { + this.scrollAmount = (int)((double)this.scrollAmount + d2 / 70.0); + } + this.scrollPosition = this.scrollAmount; + } else if ((double)mouseY > ((double)(this.y + 11) + d4 - d4 / 4.0 - d5) * (double)this.scale || (double)mouseY < ((double)(this.y + 11) + d4 / 4.0 - d5) * (double)this.scale) { + this.scrollPosition = 1.0f; + } + } + if (this.scrollAmount < -this.scrollHeight + n3) { + this.scrollAmount = -this.scrollHeight + n3; + this.startPosition = 0.0; + } + if (this.scrollAmount > 0) { + this.scrollAmount = 0; + this.startPosition = 0.0; + } + RenderUtil.drawRoundedRect(this.x + this.width - 6, this.y + 11, this.x + this.width - 4, (double)(this.y + 6) + d - (double)3, 2, bl3 && !bl4 ? 0x6F000000 : 0x3F000000); + RenderUtil.drawRoundedRect(this.x + this.width - 7, (double)(this.y + 11) - d5, this.x + this.width - 3, (double)(this.y + 8) + d4 - d5, 4, bl4 || this.hovering ? 0xFF0240FF : -12418828); + } + if (!bl && this.scrollAmount != 0) { + this.scrollAmount = 0; + } + } + + @Override + public void onScroll(int n) { + if (n != 0 && this.scrollHeight >= this.height) { + this.startPosition += n / 2; + } + } + + public abstract boolean hasSettings(AbstractModule module); + + public abstract void handleModuleMouseClick(AbstractModule var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AliasesElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AliasesElement.java new file mode 100644 index 0000000..d4953ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/AliasesElement.java @@ -0,0 +1,86 @@ +package com.cheatbreaker.client.ui.element; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.util.friend.Friend; +import com.cheatbreaker.client.util.thread.AliasesThread; +import lombok.Getter; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.util.ResourceLocation; + +import java.util.ArrayList; +import java.util.List; + +public class AliasesElement extends DraggableElement { + private final ScrollableElement scrollbar; + @Getter private final Friend friend; + private final FlatButtonElement closeButton; + private final CosineFade fade; + @Getter private final List aliases = new ArrayList<>(); + + public AliasesElement(Friend friend) { + this.scrollbar = new ScrollableElement(this); + this.friend = friend; + this.closeButton = new FlatButtonElement("X"); + this.fade = new CosineFade(1500L); + this.fade.startAnimation(); + this.fade.loopAnimation(); + new AliasesThread(this).start(); + } + + private float fadeAmount() { + return this.fade.getFadeAmount() * 2.0f - 1.0f; + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + this.scrollbar.setElementSize(f + width - (float)4, y, (float)4, height); + this.scrollbar.setScrollAmount(height); + this.closeButton.setElementSize(f + width - (float)12, y + 2.0f, (float)10, 10); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + this.onDrag(f, f2); + this.scrollbar.drawScrollable(f, f2, bl); + Gui.drawBoxWithOutLine(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0.06666667f * 7.5f, -16777216, -14869219); + CheatBreaker.getInstance().playRegular14px.drawString(this.friend.getName(), this.xPosition + (float)4, this.yPosition + (float)4, -1); + Gui.drawRect(this.xPosition + (float)3, this.yPosition + 15.0f, this.xPosition + this.width - (float)3, this.yPosition + 0.9791667f * 15.829787f, 0x2FFFFFFF); + if (this.aliases.isEmpty()) { + Gui.drawRect(this.xPosition + (float)4, this.yPosition + this.height - (float)9, this.xPosition + this.width - (float)4, this.yPosition + this.height - (float)5, -13158601); + float f3 = this.xPosition + this.width / 2.0f - (float)10 + (this.width - 28.0f) * this.fadeAmount() / 2.0f; + Gui.drawRect(f3, this.yPosition + this.height - (float)9, f3 + 20.0f, this.yPosition + this.height - (float)5, -4180940); + } + int n = 0; + for (String string : this.aliases) { + CheatBreaker.getInstance().playRegular14px.drawString(string, this.xPosition + 4.0f, this.yPosition + 18.0f + (float)(n * 10), -1); + ++n; + } + this.scrollbar.handleElementDraw(f, f2, bl); + this.closeButton.handleElementDraw(f, f2, bl); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + this.scrollbar.handleElementMouseClicked(f, f2, n, bl); + this.closeButton.handleElementMouseClicked(f, f2, n, bl); + if (this.closeButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().removeElement(this); + return true; + } + if (this.isMouseInside(f, f2)) { + this.setPosition(f, f2); + } + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/DraggableElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/DraggableElement.java new file mode 100644 index 0000000..8c599f8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/DraggableElement.java @@ -0,0 +1,34 @@ +package com.cheatbreaker.client.ui.element; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.sun.javafx.geom.Vec2d; +import java.util.concurrent.atomic.AtomicBoolean; +import org.lwjgl.input.Mouse; + +public abstract class DraggableElement extends AbstractElement { + private final Vec2d position = new Vec2d(); + private final AtomicBoolean dragging = new AtomicBoolean(); + + protected void onDrag(float f, float f2) { + if (this.dragging.get()) { + if (!Mouse.isButtonDown(0)) { + this.dragging.set(false); + return; + } + double d = (double)f - this.position.x; + double d2 = (double)f2 - this.position.y; + this.setElementSize((float)d, (float)d2, this.width, this.height); + } + } + + protected void setPosition(float f, float f2) { + this.position.set(f - this.xPosition, f2 - this.yPosition); + this.dragging.set(true); + } + + protected void getPosition() { + if (this.dragging.get()) { + this.dragging.set(false); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleListElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleListElement.java new file mode 100644 index 0000000..8b3a45c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleListElement.java @@ -0,0 +1,447 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.ModuleManager; +import com.cheatbreaker.client.module.data.CustomizationLevel; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.element.type.*; +import com.cheatbreaker.client.ui.element.type.custom.*; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; + +import javax.xml.crypto.dsig.keyinfo.KeyName; +import javax.xml.soap.Text; +import java.awt.*; +import java.util.*; +import java.util.List; + +public class ModuleListElement extends AbstractScrollableElement { + private final int highlightColor; + protected final List moduleSetting; + private final boolean isStaffMods; + private final GlobalSettingsElement globalSettings; + public AbstractScrollableElement scrollableElement; + public boolean resetColor = false; + public AbstractModule module; + private final ModulesGuiButtonElement backButton; + private final ModulesGuiButtonElement resetSettingsButton; + private ModulesGuiButtonElement resetPositionButton = null; + private final ModulesGuiButtonElement applyToAllTextButton; + private ModulesGuiButtonElement addOneButton; + + private final Map> moduleElementListMap; + private final List settingElement; + + public ModuleListElement(List modules, float scaleFactor, int n, int n2, int n3, int n4) { + super(scaleFactor, n, n2, n3, n4); + this.isStaffMods = modules == CheatBreaker.getInstance().getModuleManager().staffMods; + this.highlightColor = -12418828; + this.globalSettings = new GlobalSettingsElement(this, this.highlightColor, scaleFactor); + this.moduleSetting = new ArrayList<>(); + + for (Object module : modules) { + if (((AbstractModule)module).isStaffModule() && !((AbstractModule)module).isStaffModuleEnabled()) continue; + this.moduleSetting.add(new ModuleSettingsElement(this, this.highlightColor, (AbstractModule)module, scaleFactor)); + if (((AbstractModule) module).getGuiAnchor() != null) { + this.resetPositionButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().ubuntuMedium16px, null, "Reset Position", this.x + 2, this.y + 4, 14, 14, this.highlightColor, scaleFactor); + } + } + + this.backButton = new ModulesGuiButtonElement(null, "arrow-64.png", this.x + 2, this.y + 4, 28, 28, this.highlightColor, scaleFactor, false); + this.resetSettingsButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().ubuntuMedium16px, null, "Reset Settings", this.x + 2, this.y + 4, 14, 14, this.highlightColor, scaleFactor); + this.module = null; + this.moduleElementListMap = new HashMap<>(); + + for (Object module : modules) { + if (((AbstractModule)module).isStaffModule() && !((AbstractModule)module).isStaffModuleEnabled() || module == CheatBreaker.getInstance().getModuleManager().miniMapMod) continue; + ArrayList elements = new ArrayList<>(); + for (Setting setting : ((AbstractModule)module).getSettingsList()) { + switch (setting.getType()) { + case BOOLEAN: + //if (!setting.getParentValue()) break; + elements.add(new ToggleElement(setting, scaleFactor)); + break; + case DOUBLE: + case INTEGER: + case FLOAT: + if (((AbstractModule)module).isStaffModule() && setting == ((StaffMod)module).getKeybindSetting() || ((AbstractModule)module).isStaffModule() && setting == ((AbstractModule)module).scale) break; + if (((AbstractModule)module).guiAnchor == null && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule)module).scale) break; + //if (!setting.getParentValue()) break; + if (setting.getType().equals(SettingType.INTEGER) && setting.getSettingName().toLowerCase().contains("color")) { + elements.add(new ColorPickerElement(setting, scaleFactor)); + break; + } + + if (setting.getType().equals(SettingType.INTEGER) && setting.getSettingName().endsWith("Keybind")) { + if (((AbstractModule)module).guiAnchor == null && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule)module).tempHideFromHUDKeybind) break; + if (((AbstractModule)module).notRenderHUD && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule)module).hideFromHUDKeybind) break; + KeybindElement elementToAdd = new KeybindElement(setting, scaleFactor); + elements.add(elementToAdd); + CheatBreaker.getInstance().getModuleManager().keybinds.put(setting, elementToAdd); + break; + } + + elements.add(new NewSliderElement(setting, scaleFactor)); + break; + case ARRAYLIST: + elements.add(new ExcludePotionsElement(setting, scaleFactor)); + break; + case STRING_ARRAY: + if (((AbstractModule)module).guiAnchor == null && !(module == CheatBreaker.getInstance().getModuleManager().crosshairMod) && setting == ((AbstractModule)module).guiScale) break; + elements.add(new ChoiceElement(setting, scaleFactor)); + break; + case STRING: + if (setting.getSettingName().endsWith("String") || setting.getSettingName().contains("Background)")) { + TextFieldElement elementToAdd = new TextFieldElement(setting, scaleFactor); + elements.add(elementToAdd); + break; + } + + if (setting.getSettingName().startsWith("Hotkey") && (setting.isHasKeycode() || setting.isHasMouseBind())) { + TextFieldElement elementToAdd = new TextFieldElement(setting, scaleFactor); + elements.add(elementToAdd); + break; + } + + if (!setting.getSettingName().equalsIgnoreCase("label")) break; + elements.add(new LabelElement(setting, scaleFactor)); + if (!CheatBreaker.getInstance().getModuleManager().crosshairMod.crosshairPreviewLabel.getValue().equals(setting.getValue())) break; + elements.add(new CrosshairElement(scaleFactor)); + } + } + +// if (module == CheatBreaker.getInstance().getModuleManager().potionEffectsMod) { +// elements.add(new ExcludePotionsElement(CheatBreaker.getInstance().getModuleManager().potionEffectsMod.getEffects(), "Exclude Specific Effects", scaleFactor)); +// } + + if (((AbstractModule)module).isStaffModule()) { + elements.add(new KeybindElement(((StaffMod)module).getKeybindSetting(), scaleFactor)); + if (module == CheatBreaker.getInstance().getModuleManager().staffModuleXray) { + elements.add(new XRayOptionsElement(CheatBreaker.getInstance().getModuleManager().staffModuleXray.getBlocks(), "Blocks", scaleFactor)); + } + } + this.moduleElementListMap.put(module, elements); + } + + this.settingElement = new ArrayList<>(); + + for (Setting setting : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + switch (setting.getType()) { + case BOOLEAN: + this.settingElement.add(new ToggleElement(setting, scaleFactor)); + break; + case DOUBLE: + case INTEGER: + case FLOAT: + if (setting.getType().equals(SettingType.INTEGER) && setting.getSettingName().toLowerCase().contains("color")) { + this.settingElement.add(new ColorPickerElement(setting, scaleFactor)); + break; + } + + if (setting == CheatBreaker.getInstance().getGlobalSettings().getCurrentMenuSetting()) continue; + this.settingElement.add(new NewSliderElement(setting, scaleFactor)); + break; + case STRING_ARRAY: + this.settingElement.add(new ChoiceElement(setting, scaleFactor)); + break; + case ARRAYLIST: + break; + case STRING: + if (!setting.getSettingName().equalsIgnoreCase("label")) break; + this.settingElement.add(new LabelElement(setting, scaleFactor)); + } + } + + int n5 = 25; + for (AbstractModulesGuiElement setting : this.settingElement) { + n5 += setting.getHeight(); + } + + this.applyToAllTextButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, "Apply to all text", this.x + n3 - 120, this.y + n5 + 4, 110, 28, -12418828, scaleFactor); + this.addOneButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, "Add One", this.x + n3 - 120, this.y + n5 + 4, 110, 28, -13916106, scaleFactor); + } + + public boolean shouldHide(Setting setting) { + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Simple")) { + if (setting.getCustomizationLevel() != null) return !setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE); + } + + if (CheatBreaker.getInstance().getGlobalSettings().customizationLevel.getValue().equals("Medium")) { + if (setting.getCustomizationLevel() != null) return !setting.getCustomizationLevel().equals(CustomizationLevel.SIMPLE) && !setting.getCustomizationLevel().equals(CustomizationLevel.MEDIUM); + } + + if (setting.getParent() == null) { + return false; + } + + if (setting.getParent().getValue() == null) { + return false; + } + + if (!(setting.getParent().getValue() instanceof Boolean)) { + return false; + } + + return !((Boolean) setting.getParent().getValue()); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.y + this.height + 2, 8.0D, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor4); + this.onScroll(mouseX, mouseY); + CheatBreaker.getInstance().getModuleManager().setLastSettingScrollPos(this.scrollAmount); + if (this.module == null && !this.resetColor) { + this.scrollHeight = 72; + if (!this.isStaffMods) { + this.globalSettings.setDimensions(this.x + 4, this.y + 4, this.width - 12, 18); + this.globalSettings.yOffset = this.scrollAmount; + this.globalSettings.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += globalSettings.getHeight(); + } + + for (int i = 0; i < this.moduleSetting.size(); ++i) { + ModuleSettingsElement moduleSettingsElement = this.moduleSetting.get(i); + moduleSettingsElement.setDimensions(this.x + 4, this.y + (this.isStaffMods ? 4 : 24) + i * 20, this.width - 12, 18); + moduleSettingsElement.yOffset = this.scrollAmount; + moduleSettingsElement.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += moduleSettingsElement.getHeight(); + } + + } else if (this.resetColor && !this.isStaffMods) { + Gui.drawRect(this.x + 32, this.y + 4, this.x + 33, this.y + Math.max(this.height, this.scrollHeight) - 4, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + this.scrollHeight = 25; + this.backButton.setDimensions(this.x + 2, this.y + 2, 28, 28); + this.backButton.yOffset = this.scrollAmount; + this.backButton.handleDrawElement(mouseX, mouseY, partialTicks); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("CheatBreaker Settings".toUpperCase(), this.x + 38, (float) (this.y + 6), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + Gui.drawRect(this.x + 38, this.y + 17, this.x + this.width - 6, this.y + 18, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + int n3 = 0; + for (AbstractModulesGuiElement settingElement : this.settingElement) { + if (settingElement.setting != null && settingElement.shouldHide(settingElement.setting)) continue; + settingElement.setDimensions(this.x + 38, this.y + 22 + n3, this.width - 40, settingElement.getHeight()); + settingElement.yOffset = this.scrollAmount; + settingElement.handleDrawElement(mouseX, mouseY, partialTicks); + n3 += 2 + settingElement.getHeight(); + this.scrollHeight += 2 + settingElement.getHeight(); + } + this.applyToAllTextButton.yOffset = this.scrollAmount; + this.applyToAllTextButton.setDimensions(this.x + this.width - 118, this.y + this.scrollHeight, 100, 20); + this.applyToAllTextButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += 24; + } else { + Gui.drawRect(this.x + 32, this.y + 4, this.x + 33, this.y + Math.max(this.height, this.scrollHeight) - 4, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + this.scrollHeight = 37; + this.backButton.setDimensions(this.x + 2, this.y + 2, 28, 28); + this.backButton.yOffset = this.scrollAmount; + this.backButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.resetSettingsButton.setDimensions(this.x + this.width - 80, this.y + 7, 70, 10); + this.resetSettingsButton.yOffset = this.scrollAmount; + this.resetSettingsButton.handleDrawElement(mouseX, mouseY, partialTicks); + + if (this.module.getGuiAnchor() != null) { + this.resetPositionButton.setDimensions(this.x + this.width - 150, this.y + 7, 70, 10); + this.resetPositionButton.yOffset = this.scrollAmount; + this.resetPositionButton.handleDrawElement(mouseX, mouseY, partialTicks); + } + + CheatBreaker.getInstance().getModuleManager().setCurrentModule(this.module.getName()); + CheatBreaker.getInstance().ubuntuMedium16px.drawString((this.module.getName() + " Settings").toUpperCase(), this.x + 38, (float)(this.y + 6), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + Gui.drawRect(this.x + 38, this.y + 17, this.x + this.width - 12, this.y + 18, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + if (module.getDescription() != null) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.module.getDescription(), this.x + 38, (float)(this.y + 19), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + if (module.getCreators() != null) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString("Original Creator" + (this.module.getCreators().size() != 1 ? "s: " : ": ") + String.join(", ", this.module.getCreators()), this.x + 38, (float)(this.y + 28), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + Gui.drawRect(this.x + 38, this.y + 39, this.x + this.width - 12, this.y + 40, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + } else { + Gui.drawRect(this.x + 38, this.y + 30, this.x + this.width - 12, this.y + 31, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + } + } + + if (this.module == CheatBreaker.getInstance().getModuleManager().miniMapMod) { + try { + String keybind = Keyboard.getKeyName(CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().keyBindMenu.getKeyCode()); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(("PRESS '" + keybind + "' INGAME FOR ZAN'S MINIMAP OPTIONS.").toUpperCase(), this.x + 38, (float)(this.y + 44), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } catch (Exception exception) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString("PRESS 'M' INGAME FOR ZAN'S MINIMAP OPTIONS.", this.x + 38, (float)(this.y + 44), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + this.onGuiDraw(mouseX, mouseY); + return; + } + + if (this.module.getSettingsList().isEmpty()) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString((this.module.getName().toUpperCase() + " DOES NOT HAVE ANY OPTIONS.").toUpperCase(), this.x + 38, (float)(this.y + (this.module.getDescription() == null ? 22 : this.module.getCreators() == null ? 35 : 44)), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + int n4 = 0; + for (AbstractModulesGuiElement setting : this.moduleElementListMap.get(this.module)) { + if (setting.setting != null && setting.shouldHide(setting.setting)) continue; + setting.setDimensions(this.x + 38, this.y + (this.module.getDescription() == null ? 22 : this.module.getCreators() == null ? 35 : 44) + n4, this.width - 40, setting.getHeight()); + setting.yOffset = this.scrollAmount; + setting.handleDrawElement(mouseX, mouseY, partialTicks); + n4 += 2 + setting.getHeight(); + this.scrollHeight += 2 + setting.getHeight(); + } + + if (module.getDescription() != null) { + if (module.getCreators() != null) this.scrollHeight += 13; + } else { + this.scrollHeight -= 13; + } + +// if (this.module == CheatBreaker.getInstance().getModuleManager().autoHotKeyText) { +// this.addOneButton.yOffset = this.scrollAmount; +// this.addOneButton.setDimensions(this.x + this.width - 118, this.y + this.scrollHeight, 100, 20); +// this.addOneButton.handleDrawElement(mouseX, mouseY, partialTicks); +// this.scrollHeight += 24; +// } + + } + this.onGuiDraw(mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.module == null && !this.resetColor) { + if (this.globalSettings.isMouseInside(mouseX, mouseY) && !this.isStaffMods) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.resetColor = true; + this.scrollAmount = 0; + this.startPosition = 0.0; + this.yOffset = 0; + } else { + for (ModuleSettingsElement moduleSetting : this.moduleSetting) { + if (moduleSetting.isMouseInside(mouseX, mouseY)) { + if (!this.hasSettings(moduleSetting.module)) { + continue; + } + moduleSetting.handleMouseClick(mouseX, mouseY, button); + } + } + } + } else if (!this.backButton.isMouseInside(mouseX, mouseY)) { + if (this.resetSettingsButton.isMouseInside(mouseX, mouseY)) { + ModuleManager moduleManager = CheatBreaker.getInstance().getModuleManager(); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + + for (int i = 0; i < this.module.getSettingsList().size(); ++i) { + try { + Setting modSetting = this.module.getSettingsList().get(i); + + // Reset keybind text and value async + for (Setting setting : moduleManager.keybinds.keySet()) { + if (setting.getSettingName().endsWith("Keybind")) { + for (KeybindElement element : moduleManager.keybinds.values()) { + setting.setHasMouseBind(false); + setting.setValue(0); + element.getButton().optionString = "None"; + } + } + } + + if (this.module.getSettingsList().get(i).isHasKeycode() || this.module.getSettingsList().get(i).isHasMouseBind()) { + modSetting.setHasMouseBind(false); + modSetting.setKeyCode(0); + } + + modSetting.updateSettingValue(this.module.getDefaultSettingsValues().get(i), false); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + moduleManager.keystrokesMod.updateKeyElements(); + HudLayoutEditorGui hudEditor = new HudLayoutEditorGui(); + Minecraft.getMinecraft().displayGuiScreen(hudEditor); + (hudEditor).currentScrollableElement = (hudEditor).modulesElement; + ModulePreviewElement.instance.sendBackToModuleList(moduleManager.getModByName(moduleManager.currentModule)); + } + + try { + if (this.resetPositionButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setTranslations(this.module.defaultXTranslation, this.module.defaultYTranslation); + this.module.setAnchor(this.module.getDefaultGuiAnchor()); + } + } catch (NullPointerException ignored) { } + +// if (this.addOneButton.isMouseInside(mouseX, mouseY) && this.module == CheatBreaker.getInstance().getModuleManager().autoHotKeyText) { +// CheatBreaker.getInstance().getModuleManager().autoHotKeyText.addOne(); +// Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); +// } + + if (this.module != null && this.moduleElementListMap.containsKey(this.module)) { + for (AbstractModulesGuiElement abstractModulesGuiElement : this.moduleElementListMap.get(this.module)) { + if (!abstractModulesGuiElement.isMouseInside(mouseX, mouseY)) { + continue; + } + abstractModulesGuiElement.handleMouseClick(mouseX, mouseY, button); + } + } else if (this.resetColor) { + if (this.applyToAllTextButton.isMouseInside(mouseX, mouseY)) { + for (AbstractModule module : CheatBreaker.getInstance().getModuleManager().playerMods) { + for (Setting setting : module.getSettingsList()) { + if (setting.getType() == SettingType.INTEGER && setting.getSettingName().toLowerCase().contains("color")) { + if (setting.getSettingName().toLowerCase().contains("background")) { + continue; + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + setting.setValue(CheatBreaker.getInstance().getGlobalSettings().defaultColor.getColorValue()); + } + } + } + } else { + for (AbstractModulesGuiElement settingElement : this.settingElement) { + if (!settingElement.isMouseInside(mouseX, mouseY)) { + continue; + } + settingElement.handleMouseClick(mouseX, mouseY, button); + } + } + } + } else { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.module = null; + this.resetColor = false; + if (this.scrollableElement != null) { + HudLayoutEditorGui.instance.currentScrollableElement = this.scrollableElement; + } + } + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double)100; + double d4 = d / (double)100 * d3; + double d5 = (double)this.scrollAmount / 100.0 * d3; + boolean bl4 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (double)mouseY > ((double)(this.y + 11) - d5) * (double)this.scale && (double)mouseY < ((double)(this.y + 8) + d4 - d5) * (double)this.scale; + boolean bl3 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (float)mouseY > (float)(this.y + 11) * this.scale && (double)mouseY < ((double)(this.y + 6) + d - (double)3) * (double)this.scale; + if (button == 0 && bl3 || bl4) { + this.hovering = true; + } + } + + @Override + public boolean hasSettings(AbstractModule module) { + return !module.getSettingsList().isEmpty() || module.getName().contains("Zans"); + } + + @Override + public void handleModuleMouseClick(AbstractModule module) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.scrollAmount = 0; + this.startPosition = 0.0; + this.yOffset = 0; + this.module = module; + this.scrollableElement = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewContainer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewContainer.java new file mode 100644 index 0000000..2ec1014 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewContainer.java @@ -0,0 +1,87 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; + +import java.util.ArrayList; +import java.util.List; + +public class ModulePreviewContainer extends AbstractScrollableElement { + private final List moduleList = new ArrayList<>(); + +// private final ModulesGuiButtonElement compactModeButton; + + public ModulePreviewContainer(float scale, int n, int n2, int n3, int n4) { + super(scale, n, n2, n3, n4); + for (AbstractModule mods : CheatBreaker.getInstance().getModuleManager().playerMods) { + if (mods == CheatBreaker.getInstance().getModuleManager().notificationsMod) continue; + ModulePreviewElement modulePreviewElement = new ModulePreviewElement(this, mods, scale); + this.moduleList.add(modulePreviewElement); + } + + CBFontRenderer boldFont = CheatBreaker.getInstance().playBold18px; +// this.compactModeButton = new ModulesGuiButtonElement(boldFont, null, "compact-64.png", this.x + 4, this.y + this.height - 20, this.x + this.width - 4, this.y + this.height - 6, -12418828, scale); + } + + @Override + public boolean hasSettings(AbstractModule module) { + return false; + } + + @Override + public void handleModuleMouseClick(AbstractModule abstractModule) { + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + super.handleDrawElement(mouseX, mouseY, partialTicks); + + boolean compact = CheatBreaker.getInstance().getGlobalSettings().compactMode.getValue().equals("Compact"); + int multiplier = (compact ? 20 : 112); + int yIncreease = 0/*25*/; + + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.y + this.height + 2, 8, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor4); + this.onScroll(mouseX, mouseY); + int n3 = 0; + int n4 = 0; + int addon = 0; + for (ModulePreviewElement module : this.moduleList) { + module.yOffset = this.scrollAmount; + module.setDimensions(this.x + 4 + n3 * 120, this.y + 4 + n4 * multiplier + yIncreease, 116, compact ? 16 : 108); + module.handleDrawElement(mouseX, mouseY, partialTicks); + addon = 112; + if (++n3 != 3) continue; + ++n4; + n3 = addon = 0; + } + + this.scrollHeight = 4 + n4 * multiplier + yIncreease + addon; + +// this.compactModeButton.setDimensions(this.x + 4, this.y + 5,20, 20); +// this.compactModeButton.setMediumIcon(true); +// this.compactModeButton.handleDrawElement(mouseX, mouseY, partialTicks); + + this.onGuiDraw(mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + super.handleMouseClick(mouseX, mouseY, button); + +// if (this.compactModeButton.isMouseInside(mouseX, mouseY)) { +// CheatBreaker.getInstance().getGlobalSettings().compactMode.setValue(!CheatBreaker.getInstance().getGlobalSettings().compactMode.getBooleanValue()); +// // This is needed to refresh the menu, sorry. +// Minecraft.getMinecraft().displayGuiScreen(new HudLayoutEditorGui()); +// } + + for (ModulePreviewElement module : this.moduleList) { + if (!module.isMouseInside(mouseX, mouseY)) continue; + module.handleMouseClick(mouseX, mouseY, button); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewElement.java new file mode 100644 index 0000000..191e260 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulePreviewElement.java @@ -0,0 +1,289 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.PreviewType; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.module.impl.normal.hud.cooldowns.CooldownRenderer; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ModulePlaceGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.util.Objects; + +public class ModulePreviewElement extends AbstractModulesGuiElement { + private final AbstractModule module; + private final ModulesGuiButtonElement optionsButton; + private final ModulesGuiButtonElement mainEnableDisableButton; + private final ModulesGuiButtonElement secondaryEnableDisableButton; + + private final AbstractScrollableElement scrollableElement; + + public static ModulePreviewElement instance; + + private final boolean compact = CheatBreaker.getInstance().getGlobalSettings().compactMode.getValue().equals("Compact"); + + public ModulePreviewElement(AbstractScrollableElement abstractScrollableElement, AbstractModule module, float scale) { + super(scale); + instance = this; + this.module = module; + this.scrollableElement = abstractScrollableElement; + boolean validModule = module != CheatBreaker.getInstance().getModuleManager().miniMapMod && module != CheatBreaker.getInstance().getModuleManager().notificationsMod; + + String mainEnableDisableButtonString = module.getGuiAnchor() == null ? (module.isRenderHud() ? "Disable" : "Enable") : (module.isRenderHud() ? "Hide from HUD" : "Add to HUD"); + String secondaryEnableDisableButtonString = module.isEnabled() ? "Disable" : "Enable"; + String optionsString = (this.compact ? "cog-64.png" : "Options"); + + CBFontRenderer boldFont = CheatBreaker.getInstance().playBold18px; + CBFontRenderer regularFont = CheatBreaker.getInstance().playRegular14px; + + this.secondaryEnableDisableButton = new ModulesGuiButtonElement(regularFont, null, secondaryEnableDisableButtonString, this.x + this.width / 2 + 2, this.y + this.height - 38, this.x + this.width - 4, this.y + this.height - 24, module.isEnabled() ? -5756117 : -13916106, scale); + this.optionsButton = new ModulesGuiButtonElement(boldFont, null, optionsString, this.x + 4, this.y + this.height - 20, this.x + this.width - 4, this.y + this.height - 6, -12418828, scale); + this.mainEnableDisableButton = new ModulesGuiButtonElement(regularFont, null, mainEnableDisableButtonString, this.x + 4, this.y + this.height - 38, this.x + this.width / 2 - 2, this.y + this.height - 24, module.isRenderHud() ? -5756117 : -13916106, scale); + this.mainEnableDisableButton.allowAddToHud(validModule); + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + String previewString; + + if (this.module.isEnabled()) { + Gui.drawRect(this.x, this.y, this.x + this.width, this.compact ? this.y + 16 : this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkEnabledBackgroundColor : CBTheme.lightEnabledBackgroundColor); + } else { + Gui.drawRect(this.x, this.y, this.x + this.width, this.compact ? this.y + 16 : this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkInactiveBackgroundColor : CBTheme.lightInactiveBackgroundColor); + } + + CBFontRenderer cBFontRenderer = CheatBreaker.getInstance().playBold18px; + GL11.glPushMatrix(); + int n3 = 0; + int n4 = 0; + if (!this.compact) { + if (this.module == CheatBreaker.getInstance().getModuleManager().armourStatus) { + n3 = -10; + previewString = "329/329"; + f2 = Minecraft.getMinecraft().fontRenderer.getStringWidth(previewString); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(previewString, (float) ((int) ((float) (this.x + 1 + this.width / 2) - f2 / 2.0f)), (float) (this.y + this.height / 2 - 18), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().potionEffectsMod) { + n4 = -30; + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("Speed II", (float) (this.x + 8 + this.width / 2 - 20), (float) (this.y + this.height / 2 - 36), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("0:42", (float) (this.x + 8 + this.width / 2 - 20), (float) (this.y + this.height / 2 - 26), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().scoreboardMod) { + Gui.drawRect(this.x + 20, this.y + this.height / 2 - 44, this.x + this.width - 20, this.y + this.height / 2 - 6, 0x6F000000); + Minecraft.getMinecraft().fontRenderer.drawCenteredStringWithShadow("Score", this.x + this.width / 2, this.y + this.height / 2 - 40, -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("Steve", (float) (this.x + 24), (float) (this.y + this.height / 2 - 28), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("Alex", (float) (this.x + 24), (float) (this.y + this.height / 2 - 18), -1); + Minecraft.getMinecraft().fontRenderer.drawCenteredStringWithShadow(EnumChatFormatting.RED + "0", this.x + this.width - 26, this.y + this.height / 2 - 18, -1); + Minecraft.getMinecraft().fontRenderer.drawCenteredStringWithShadow(EnumChatFormatting.RED + "1", this.x + this.width - 26, this.y + this.height / 2 - 28, -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().bossBarMod) { + n3 = 3; + previewString = "Wither"; + f2 = Minecraft.getMinecraft().fontRenderer.getStringWidth(previewString); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(previewString, (float) ((int) ((float) (this.x + 1 + this.width / 2) - f2 / 2.0f)), (float) (this.y + this.height / 2 - 36), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().playerListMod) { + Gui.drawRect(this.x + 20, this.y + this.height / 2 - 44, this.x + this.width - 20, this.y + this.height / 2 - 7, 0x6F000000); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 43, this.x + this.width - 21, this.y + this.height / 2 - 35, 0x20FFFFFF); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 34, this.x + this.width - 21, this.y + this.height / 2 - 26, 0x20FFFFFF); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 25, this.x + this.width - 21, this.y + this.height / 2 - 17, 0x20FFFFFF); + Gui.drawRect(this.x + 21, this.y + this.height / 2 - 16, this.x + this.width - 21, this.y + this.height / 2 - 8, 0x20FFFFFF); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(Minecraft.getMinecraft().getSession().getUsername(), (float) (this.x + 21), (float) (this.y + this.height / 2 - 43), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("Steve", (float) (this.x + 21), (float) (this.y + this.height / 2 - 34), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("Alex", (float) (this.x + 21), (float) (this.y + this.height / 2 - 25), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("Notch", (float) (this.x + 21), (float) (this.y + this.height / 2 - 16), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(EnumChatFormatting.GREEN + "15", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRenderer.getStringWidth("15")), (float) (this.y + this.height / 2 - 43), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(EnumChatFormatting.GREEN + "75", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRenderer.getStringWidth("75")), (float) (this.y + this.height / 2 - 34), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(EnumChatFormatting.YELLOW + "155", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRenderer.getStringWidth("155")), (float) (this.y + this.height / 2 - 25), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(EnumChatFormatting.YELLOW + "250", (float) (this.x + this.width - 21 - Minecraft.getMinecraft().fontRenderer.getStringWidth("250")), (float) (this.y + this.height / 2 - 16), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().chatMod) { + Gui.drawRect(this.x + 10, this.y + this.height / 2 - 35, this.x + this.width - 10, this.y + this.height / 2 - 17, 0x6F000000); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(EnumChatFormatting.GREEN + "Steve" + EnumChatFormatting.WHITE + ": Hey.", (float) (this.x + 10), (float) (this.y + this.height / 2 - 34), -1); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(EnumChatFormatting.GREEN + "Alex" + EnumChatFormatting.WHITE + ": Hi!", (float) (this.x + 10), (float) (this.y + this.height / 2 - 25), -1); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().nametagMod) { + int width = Minecraft.getMinecraft().fontRenderer.getStringWidth(Minecraft.getMinecraft().getSession().getUsername()); + String account = width > 94 ? "Steve" : Minecraft.getMinecraft().getSession().getUsername(); + width = Minecraft.getMinecraft().fontRenderer.getStringWidth(account); + Gui.drawRect((float) (this.x + this.width / 2 - width / 2 - 8), (float) (this.y + this.height / 2 - 33), (float) (this.x + this.width / 2 + width / 2 + 8), (float) (this.y + this.height / 2 - 24), 1862270976); + Minecraft.getMinecraft().fontRenderer.drawString(account, this.x + this.width / 2 - Minecraft.getMinecraft().fontRenderer.getStringWidth(account) / 2 + 7, this.y + this.height / 2 - 32, -1, false); + RenderUtil.renderIcon(new ResourceLocation("client/logo_white.png"), (float) (this.x + this.width / 2 - width / 2 - 7), (float) (this.y + this.height / 2 - 32), 13.0f, 7.0f); + } else if (this.module == CheatBreaker.getInstance().getModuleManager().crosshairMod) { + GL11.glScalef(2.0F, 2.0F, 0); + float size = 6.0F; + float gap = 4.0F; + float thickness = 2.0F; + float var11 = (this.x + this.width / 2) / 2.0F; + float var12 = (this.y + this.height / 2 - 27) / 2.0F; + + Gui.drawBoxWithOutLine(var11 - gap - size, var12 - thickness / 2.0F, var11 - gap, var12 + thickness / 2.0F, 0.5F, -1358954496, -1); + Gui.drawBoxWithOutLine(var11 + gap, var12 - thickness / 2.0F, var11 + gap + size, var12 + thickness / 2.0F, 0.5F, -1358954496, -1); + Gui.drawBoxWithOutLine(var11 - thickness / 2.0F, var12 - gap - size, var11 + thickness / 2.0F, var12 - gap, 0.5F, -1358954496, -1); + Gui.drawBoxWithOutLine(var11 - thickness / 2.0F, var12 + gap, var11 + thickness / 2.0F, var12 + gap + size, 0.5F, -1358954496, -1); + GL11.glScalef(1.0F, 1.0F, 0); + } + + if (this.module == CheatBreaker.getInstance().getModuleManager().cooldownsMod) { + CooldownRenderer cooldown = new CooldownRenderer("EnderPearl", 368, 9000L); + cooldown.render(CheatBreaker.getInstance().getModuleManager().cooldownsMod.theme, this.x + this.width / 2 - 18, this.y + this.height / 2 - 26 - 18, -1); + } else if ((this.module.getPreviewType() == null || this.module.getPreviewType() == PreviewType.LABEL) && this.module != CheatBreaker.getInstance().getModuleManager().scoreboardMod && this.module != CheatBreaker.getInstance().getModuleManager().playerListMod && this.module != CheatBreaker.getInstance().getModuleManager().chatMod && this.module != CheatBreaker.getInstance().getModuleManager().nametagMod) { + previewString = ""; + if (this.module.getPreviewType() == null) { + f2 = 2.0f; + for (String string : this.module.getName().split(" ")) { + String string2 = string.substring(0, 1); + previewString = previewString + (Objects.equals(previewString, "") ? string2 : string2.toLowerCase()); + } + } else { + f2 = this.module.getPreviewLabelSize(); + previewString = this.module.getPreviewLabel(); + } + + GL11.glScalef(f2, f2, f2); + float f3 = (float) Minecraft.getMinecraft().fontRenderer.getStringWidth(previewString) * f2; + if (this.module.getPreviewType() == null && !this.compact) { + Minecraft.getMinecraft().fontRenderer.drawString(previewString, (int) (((float) (this.x + 1 + this.width / 2) - f3 / 2.0f) / f2), (int) ((float) (this.y + this.height / 2 - 32) / f2), -13750738); + } else { + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(previewString, (float) ((int) (((float) (this.x + 1 + this.width / 2) - f3 / 2.0f) / f2)), (float) ((int) ((float) (this.y + this.height / 2 - 32) / f2)), -1); + } + } else if (this.module.getPreviewType() == PreviewType.ICON) { + float f4 = this.module.getPreviewIconWidth(); + f2 = this.module.getPreviewIconHeight(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.module.getPreviewIcon(), (float) (this.x + this.width / 2) - f4 / 2.0f + (float) n4, (float) (this.y + n3 + this.height / 2 - 26) - f2 / 2.0f, f4, f2); + } + } + GL11.glPopMatrix(); + + String name = this.module.getName(); + int max = 14; + if (this.compact && name.replaceAll(" ", "").length() >= max) + name = name.substring(0, max).trim() + ".."; + + if (this.compact) { + cBFontRenderer.drawString(name, (this.x + 4F), this.y + 4, 0x5F000000); + cBFontRenderer.drawString(name, (this.x + 3F), this.y + 3, -1); + } else { + cBFontRenderer.drawCenteredString(name, (float) (this.x + this.width / 2) - 0.5F, this.y + this.height / 2 - 4 + 1, 0x5F000000); + cBFontRenderer.drawCenteredString(name, (float) (this.x + this.width / 2) - 1.5F, this.y + this.height / 2 - 4, -1); + } + + if (!this.compact) { + this.secondaryEnableDisableButton.optionString = this.module.isEnabled() ? "Disable" : "Enable"; + this.secondaryEnableDisableButton.yOffset = this.yOffset; + this.secondaryEnableDisableButton.setSmallIcon(false); + if (!this.module.notRenderHUD) { + this.secondaryEnableDisableButton.setDimensions(this.x + this.width / 2 + 8, this.y + this.height - 38, this.width / 2 - 12, this.y + this.height - 24 - (this.y + this.height - 38)); + this.secondaryEnableDisableButton.handleDrawElement(mouseX, n2, partialTicks); + } + } + + this.mainEnableDisableButton.optionString = this.compact ? this.module.isEnabled() ? "delete-64.png" : "plus-64.png" : this.module.getGuiAnchor() == null ? (this.module.isRenderHud() && this.module.isEnabled() ? "Disable" : "Enable") : (this.module.isRenderHud() && this.module.isEnabled() ? "Hide from HUD" : this.module.isWasRenderHud() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "Return to HUD" : "Add to HUD"); + this.mainEnableDisableButton.color = this.module.isRenderHud() && this.module.isEnabled() ? -5756117 : -13916106; + this.mainEnableDisableButton.setDimensions(this.x + (this.compact ? 87 : 4), this.y + (this.compact ? 3 : this.height - 38), this.compact ? 10 : this.module.notRenderHUD ? this.width - 8 : this.width / 2 + 2, this.compact ? 10 : this.y + this.height - 24 - (this.y + this.height - 38)); + this.mainEnableDisableButton.yOffset = this.yOffset; + this.mainEnableDisableButton.setSmallIcon(this.compact); + this.mainEnableDisableButton.handleDrawElement(mouseX, n2, partialTicks); + + this.optionsButton.setDimensions(this.x + (this.compact ? 102 : 4), this.y + (this.compact ? 3 : this.height - 20), this.compact ? 10 : this.width - 8, this.compact ? 10 : 16); + this.optionsButton.setSmallIcon(this.compact); + this.optionsButton.yOffset = this.yOffset; + this.optionsButton.handleDrawElement(mouseX, n2, partialTicks); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.optionsButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).resetColor = false; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).scrollableElement = this.scrollableElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).module = this.module; + HudLayoutEditorGui.instance.currentScrollableElement = HudLayoutEditorGui.instance.settingsElement; + } else if (!this.module.notRenderHUD && this.secondaryEnableDisableButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setWasRenderHud(true); + this.module.setState(!this.module.isEnabled()); + this.secondaryEnableDisableButton.optionString = this.module.isEnabled() ? "Disable" : "Enable"; + this.secondaryEnableDisableButton.color = this.module.isEnabled() ? -5756117 : -13916106; + if (this.module.isEnabled()) { + this.applyDefaultColor(); + this.module.setState(true); + } + } else if (this.mainEnableDisableButton.moduleAllowedToAddToHud && this.mainEnableDisableButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + if (!this.module.isEnabled()) { + this.module.setRenderHud(true); + this.applyDefaultColor(); + if (this.module.getGuiAnchor() != null && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || !this.module.isWasRenderHud())) { + Minecraft.getMinecraft().displayGuiScreen(new ModulePlaceGui(HudLayoutEditorGui.instance, this.module)); + } else { + this.module.setState(true); + } + } else { + this.module.setRenderHud(!this.module.isRenderHud()); + if (this.module.isRenderHud()) { + this.applyDefaultColor(); + if (this.module.getGuiAnchor() != null && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || !this.module.isWasRenderHud())) { + Minecraft.getMinecraft().displayGuiScreen(new ModulePlaceGui(HudLayoutEditorGui.instance, this.module)); + } else { + this.module.setState(true); + } + } else if (this.module.notRenderHUD && this.module.isEnabled()) { + this.module.setState(false); + } + } + this.module.setWasRenderHud(true); + this.mainEnableDisableButton.optionString = this.module.getGuiAnchor() == null ? (this.module.isRenderHud() && this.module.isEnabled() ? "Disable" : "Enable") : (this.module.isRenderHud() && this.module.isEnabled() ? "Hide from HUD" : this.module.isWasRenderHud() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "Return to HUD" : "Add to HUD"); + this.mainEnableDisableButton.color = this.module.isRenderHud() && this.module.isEnabled() ? -5756117 : -13916106; + } + + if (this.compact && this.isMouseInside(mouseX, mouseY) && !this.mainEnableDisableButton.isMouseInside(mouseX, mouseY) && !this.secondaryEnableDisableButton.isMouseInside(mouseX, mouseY) && !this.optionsButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setWasRenderHud(true); + this.module.setState(!this.module.isEnabled()); + + if (this.module.isEnabled()) { + this.applyDefaultColor(); + this.module.setState(true); + } + } + } + + public void sendBackToModuleList(AbstractModule module) { + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).resetColor = false; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).scrollableElement = this.scrollableElement; + ((ModuleListElement) HudLayoutEditorGui.instance.settingsElement).module = module; + (HudLayoutEditorGui.instance.settingsElement).scrollAmount = CheatBreaker.getInstance().getModuleManager().lastSettingScrollPos; + HudLayoutEditorGui.instance.currentScrollableElement = HudLayoutEditorGui.instance.settingsElement; + } + + private void applyDefaultColor() { + if (this.module == CheatBreaker.getInstance().getModuleManager().directionHUDMod + || this.module == CheatBreaker.getInstance().getModuleManager().playerListMod + || this.module == CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod + || this.module == CheatBreaker.getInstance().getModuleManager().packTweaksMod + || this.module == CheatBreaker.getInstance().getModuleManager().blockOverlayMod + || this.module == CheatBreaker.getInstance().getModuleManager().hitColorMod + || this.module == CheatBreaker.getInstance().getModuleManager().crosshairMod + || this.module == CheatBreaker.getInstance().getModuleManager().scoreboardMod + || !(Boolean) CheatBreaker.getInstance().getGlobalSettings().resetColors.getValue()) { + return; + } + for (Setting setting : this.module.getSettingsList()) { + if (setting.getType() != SettingType.INTEGER || !setting.getSettingName().toLowerCase().contains("color") || setting.getSettingName().toLowerCase().contains("background") || setting.getSettingName().toLowerCase().contains("border") || setting.getSettingName().toLowerCase().contains("pressed") || setting.getSettingName().toLowerCase().contains("amount") || setting.getSettingName().toLowerCase().contains("line")) + continue; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + setting.setValue(CheatBreaker.getInstance().getGlobalSettings().defaultColor.getColorValue()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleSettingsElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleSettingsElement.java new file mode 100644 index 0000000..98a1fd5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModuleSettingsElement.java @@ -0,0 +1,72 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ModuleSettingsElement extends AbstractModulesGuiElement { + private final int highlightColor; + public final AbstractModule module; + public final AbstractScrollableElement scrollbar; + private int progressiveRect = 0; + private final ResourceLocation arrowIcon = new ResourceLocation("client/icons/right.png"); + + public ModuleSettingsElement(AbstractScrollableElement scrollbar, int highlightColor, AbstractModule module, float scale) { + super(scale); + this.scrollbar = scrollbar; + this.highlightColor = highlightColor; + this.module = module; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean bl = this.isMouseInside(mouseX, mouseY); + int n3 = 75; + Gui.drawRect(this.x, this.y + this.height - 1, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + if (this.scrollbar.hasSettings(this.module)) { + float f2; + if (bl) { + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + if ((float)this.progressiveRect + f2 < (float)n3) { + this.progressiveRect = (int)((float)this.progressiveRect + f2); + if (this.progressiveRect > n3) { + this.progressiveRect = n3; + } + } + } else if (this.progressiveRect > 0) { + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.progressiveRect = (float)this.progressiveRect - f2 < 0.0f ? 0 : (int)((float)this.progressiveRect - f2); + } + if (this.progressiveRect > 0) { + f2 = (float)this.progressiveRect / (float)n3 * 100.0F; + Gui.drawRect(this.x, (int)((float)this.y + ((float)this.height - (float)this.height * f2 / 100.0F)), this.x + this.width, this.y + this.height, this.highlightColor); + } + } + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.35f); + RenderUtil.renderIcon(this.arrowIcon, 2.5F, (float)(this.x + 6), (float)this.y + 6.0F); + CheatBreaker.getInstance().playBold18px.drawString(this.module.getName().toUpperCase(), (float)this.x + 14.0F, (float)this.y + 3.0F, this.scrollbar.hasSettings(this.module) ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + double d = this.height - 10; + double d3 = d / this.scrollbar.scrollHeight * (double)100; + double d4 = d / (double)100 * d3; + double d5 = (double)this.scrollbar.scrollAmount / 100.0 * d3; + boolean bl4 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (double)mouseY > ((double)(this.y + 11) - d5) * (double)this.scale && (double)mouseY < ((double)(this.y + 8) + d4 - d5) * (double)this.scale; + boolean bl3 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (float)mouseY > (float)(this.y + 11) * this.scale && (double)mouseY < ((double)(this.y + 6) + d - (double)3) * (double)this.scale; + if (button == 0 && bl3 || bl4) { + this.scrollbar.hovering = true; + } + this.scrollbar.handleModuleMouseClick(this.module); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulesGuiButtonElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulesGuiButtonElement.java new file mode 100644 index 0000000..40ec261 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/module/ModulesGuiButtonElement.java @@ -0,0 +1,104 @@ +package com.cheatbreaker.client.ui.element.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import lombok.Setter; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ModulesGuiButtonElement extends AbstractModulesGuiElement { + public int color; + @Setter public boolean conflict; + @Setter public boolean smallIcon; + @Setter public boolean mediumIcon; + public String optionString; + public final AbstractScrollableElement scrollableElement; + private final CBFontRenderer font; + public boolean moduleAllowedToAddToHud = true; + private int timing = 0; + private boolean background; + + public ModulesGuiButtonElement(CBFontRenderer font, AbstractScrollableElement scroll, String string, int x, int y, int x2, int y2, int color, float scale) { + super(scale); + this.optionString = string; + this.setDimensions(x, y, x2, y2); + this.color = color; + this.scrollableElement = scroll; + this.font = font; + this.background = true; + } + + public ModulesGuiButtonElement(AbstractScrollableElement scroll, String string, int x, int y, int x2, int y2, int color, float scale) { + this(CheatBreaker.getInstance().playBold22px, scroll, string, x, y, x2, y2, color, scale); + this.background = true; + } + + public ModulesGuiButtonElement(AbstractScrollableElement scroll, String string, int x, int y, int x2, int y2, int color, float scale, boolean background) { + this(CheatBreaker.getInstance().playBold22px, scroll, string, x, y, x2, y2, color, scale); + this.background = background; + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + boolean bl = this.isMouseInside(mouseX, n2); + int n3 = 120; + if (bl && this.moduleAllowedToAddToHud) { + if (this.background) { + Gui.drawRect(this.x - 2, this.y - 2, this.x + this.width + 2, this.y + this.height + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor3 : CBTheme.lightBackgroundColor3); + } + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.timing = (float)this.timing + f2 < (float)n3 ? (int)((float)this.timing + f2) : n3; + } else if (this.timing > 0) { + f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.timing = (float)this.timing - f2 < 0.0f ? 0 : (int)((float)this.timing - f2); + } + + if (this.background) { + if (this.moduleAllowedToAddToHud) { + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor : CBTheme.lightBackgroundColor); + } else { + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor2 : CBTheme.lightBackgroundColor2); + } + } + + if (this.timing > 0) { + f2 = (float)this.timing / (float)n3 * 100.0F; + Gui.drawRect(this.x, (int)((float)this.y + ((float)this.height - (float)this.height * f2 / 100.0F)), this.x + this.width, this.y + this.height, this.color); + } + + if (this.optionString.contains(".png")) { + float iconScale = this.smallIcon ? 3.5F : 8F; + float iconX = this.mediumIcon ? (this.x + 2F) : this.smallIcon ? (float)(this.x + 1.6) : (float)(this.x + 6); + float iconY = this.mediumIcon ? (this.y + 2F) : this.smallIcon ? (float)(this.y + 1.7) : (float)(this.y + 6); + + GL11.glPushMatrix(); + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.47368422f * 0.9499999f); + RenderUtil.renderIcon(new ResourceLocation("client/icons/" + this.optionString), iconScale, iconX, iconY); + GL11.glPopMatrix(); + } else { + f2 = this.font == CheatBreaker.getInstance().playBold22px ? 2.0f : 0.54545456f * 0.9166667f; + this.font.drawCenteredString(this.optionString.toUpperCase(), this.x + this.width / 2, (float)(this.y + this.height / 2 - this.font.getHeight()) + f2, (this.conflict ? 11141120 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor)); + } + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } + + public int getWidth() { + return this.width; + } + + public void allowAddToHud(boolean module) { + this.moduleAllowedToAddToHud = module; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfileElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfileElement.java new file mode 100644 index 0000000..d0d500c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfileElement.java @@ -0,0 +1,165 @@ +package com.cheatbreaker.client.ui.element.profile; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ProfileCreatorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.File; +import java.util.Collections; + +public class ProfileElement extends AbstractModulesGuiElement { + private final int highlightColor; + public final Profile profile; + private final AbstractScrollableElement scrollableElement; + private int animationSpeed = 0; + private final ResourceLocation deleteIcon = new ResourceLocation("client/icons/delete-64.png"); + private final ResourceLocation checkmarkIcon = new ResourceLocation("client/icons/checkmark-64.png"); + private final ResourceLocation arrowIcon = new ResourceLocation("client/icons/right.png"); + private final ResourceLocation pencilIcon = new ResourceLocation("client/icons/pencil-64.png"); + + public ProfileElement(AbstractScrollableElement abstractScrollableElement, int highlightColor, Profile profile, float scale) { + super(scale); + this.scrollableElement = abstractScrollableElement; + this.highlightColor = highlightColor; + this.profile = profile; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean bl; + boolean bl2; + float animationSpeed; + boolean hoverCondition = mouseX > (this.x + 12) * 1.0F / CheatBreaker.getScaleFactor() && mouseX < (this.x + this.width - (this.profile.isNotEditable() ? 0 : 30)) * 1.0F / CheatBreaker.getScaleFactor() && this.isMouseInside(mouseX, mouseY); + int n3 = 75; + Gui.drawRect(this.x, this.y + this.height - 1, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + + if (hoverCondition) { + if (this.animationSpeed < n3) { + animationSpeed = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.animationSpeed = (int)((float)this.animationSpeed + animationSpeed); + if (this.animationSpeed > n3) { + this.animationSpeed = n3; + } + } + } else if (this.animationSpeed > 0) { + animationSpeed = HudLayoutEditorGui.getFPSTransitionSpeed(790); + this.animationSpeed = (float)this.animationSpeed - animationSpeed < 0.0f ? 0 : (int)((float)this.animationSpeed - animationSpeed); + } + if (this.animationSpeed > 0) { + animationSpeed = (float)this.animationSpeed / (float)n3 * 100.0F; + Gui.drawRect(this.x + 12, (int)((float)this.y + ((float)this.height - (float)this.height * animationSpeed / 100.0F)), this.x + this.width - (this.profile.isNotEditable() ? 0 : 30), this.y + this.height, this.highlightColor); + } + boolean bl4 = (float) mouseX > (float)this.x * this.scale && (float) mouseX < (float)(this.x + 12) * this.scale && (float)mouseY >= (float)(this.y + this.yOffset) * this.scale && (float)mouseY <= (float)(this.y + this.height / 2 + this.yOffset) * this.scale; + boolean bl5 = (float) mouseX > (float)this.x * this.scale && (float) mouseX < (float)(this.x + 12) * this.scale && (float)mouseY > (float)(this.y + this.height / 2 + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + this.height + this.yOffset) * this.scale; + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.35f); + float f3 = 2.5f; + if (!this.profile.isNotEditable()) { + bl2 = false; + bl = false; + ProfilesListElement profilesListElement = (ProfilesListElement)this.scrollableElement; + if (profilesListElement.profileList.indexOf(this) != 0 && profilesListElement.profileList.indexOf(this) > 1) { + bl2 = true; + GL11.glPushMatrix(); + if (bl4) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.65f); + } + GL11.glTranslatef((float)(this.x + 6) - f3, (float)this.y + 7.0F, 0.0f); + GL11.glRotatef(-90, 0.0f, 0.0f, 1.0f); + RenderUtil.renderIcon(this.arrowIcon, f3, (float)-1, 0.0f); + GL11.glPopMatrix(); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.35f); + } + if (profilesListElement.profileList.indexOf(this) != profilesListElement.profileList.size() - 1) { + bl = true; + GL11.glPushMatrix(); + if (bl5) { + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.65f); + } + GL11.glTranslatef((float)(this.x + 6) + f3, (float)this.y + 7.0F, 0.0f); + GL11.glRotatef(90, 0.0f, 0.0f, 1.0f); + RenderUtil.renderIcon(this.arrowIcon, f3, 2.0f, 0.0f); + GL11.glPopMatrix(); + } + if (!bl2 && !bl) { + RenderUtil.renderIcon(this.arrowIcon, 2.5f, (float)(this.x + 4), (float)this.y + 6.0f); + } + } else { + RenderUtil.renderIcon(this.arrowIcon, 2.5f, (float)(this.x + 4), (float)this.y + 6.0f); + } + if (CheatBreaker.getInstance().activeProfile == this.profile) { + CheatBreaker.getInstance().playBold18px.drawString(this.profile.getName().toUpperCase(), (float)this.x + 16.0f, (float)(this.y + 3), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2); + } else { + CheatBreaker.getInstance().playRegular16px.drawString(this.profile.getName().toUpperCase(), (float)this.x + 16.0f, (float)this.y + 3.5f, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2); + } + if (CheatBreaker.getInstance().activeProfile == this.profile) { + CheatBreaker.getInstance().playRegular14px.drawString(" (Active)", (float)this.x + (float)17 + (float)CheatBreaker.getInstance().playBold18px.getStringWidth(this.profile.getName().toUpperCase()), (float)this.y + (float)4, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor4 : CBTheme.lightDullTextColor4); + } + if (!this.profile.isNotEditable()) { + bl2 = (float) mouseX > (float)(this.x + this.width - 30) * this.scale && (float) mouseX < (float)(this.x + this.width - 13) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + this.height + this.yOffset) * this.scale; + GL11.glColor4f(bl2 ? 0.0f : 1.1707317f * 0.21354167f, bl2 ? 0.0f : 0.101648346f * 2.4594595f, bl2 ? 0.48876402f * 1.0229886f : 0.5647059f * 0.4427083f, 0.5675676f * 1.145238f); + RenderUtil.renderIcon(this.pencilIcon, (float)5, (float)(this.x + this.width - 26), (float)this.y + 5.1916666f * 0.6741573f); + bl = (float) mouseX > (float)(this.x + this.width - 17) * this.scale && (float) mouseX < (float)(this.x + this.width - 2) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + this.height + this.yOffset) * this.scale; + GL11.glColor4f(bl ? 1.4181818f * 0.5641026f : 0.96875f * 0.2580645f, bl ? 0.0f : 0.17553192f * 1.4242424f, bl ? 0.0f : 15.250001f * 0.016393442f, 0.44444445f * 1.4625f); + RenderUtil.renderIcon(this.deleteIcon, (float)5, (float)(this.x + this.width - 13), (float)this.y + 0.7653061f * 4.5733333f); + } + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl = (float) mouseX > (float)(this.x + this.width - 17) * this.scale && (float) mouseX < (float)(this.x + this.width - 2) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + this.height + this.yOffset) * this.scale; + boolean bl2 = (float) mouseX > (float)(this.x + this.width - 30) * this.scale && (float) mouseX < (float)(this.x + this.width - 13) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + this.height + this.yOffset) * this.scale; + boolean bl3 = (float) mouseX > (float)this.x * this.scale && (float) mouseX < (float)(this.x + 12) * this.scale && (float) mouseY >= (float)(this.y + this.yOffset) * this.scale && (float) mouseY <= (float)(this.y + this.height / 2 + this.yOffset) * this.scale; + boolean bl4 = (float) mouseX > (float)this.x * this.scale && (float) mouseX < (float)(this.x + 12) * this.scale && (float) mouseY > (float)(this.y + this.height / 2 + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + this.height + this.yOffset) * this.scale; + ProfilesListElement profilesListElement = (ProfilesListElement)this.scrollableElement; + if (!this.profile.isNotEditable() && (bl3 || bl4)) { + if (bl3 && ((ProfilesListElement)this.scrollableElement).profileList.indexOf(this) != 0 && ((ProfilesListElement)this.scrollableElement).profileList.indexOf(this) > 1) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.profile.index = profilesListElement.profileList.indexOf(this) - 1; + profilesListElement.profileList.get(profilesListElement.profileList.indexOf(this) - 1).profile.index = profilesListElement.profileList.indexOf(this); + Collections.swap(profilesListElement.profileList, profilesListElement.profileList.indexOf(this), profilesListElement.profileList.indexOf(this) - 1); + } + if (bl4 && profilesListElement.profileList.indexOf(this) != profilesListElement.profileList.size() - 1) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.profile.index = profilesListElement.profileList.indexOf(this) + 1; + profilesListElement.profileList.get(profilesListElement.profileList.indexOf(this) + 1).profile.index = profilesListElement.profileList.indexOf(this); + Collections.swap(profilesListElement.profileList, profilesListElement.profileList.indexOf(this), profilesListElement.profileList.indexOf(this) + 1); + } + } else if (!this.profile.isNotEditable() && bl) { + File file; + File file2; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + if (CheatBreaker.getInstance().activeProfile == this.profile) { + CheatBreaker.getInstance().activeProfile = CheatBreaker.getInstance().profiles.get(0); + CheatBreaker.getInstance().configManager.readProfile(CheatBreaker.getInstance().activeProfile.getName()); + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + } + if (!this.profile.isNotEditable() && (file2 = (file = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch() + File.separator + "profiles")).exists() || file.mkdirs() ? new File(file + File.separator + this.profile.getName().toLowerCase() + ".cfg") : null).exists() && file2.delete()) { + CheatBreaker.getInstance().profiles.removeIf(profile -> profile == this.profile); + profilesListElement.profileList.removeIf(profileElement -> profileElement == this); + } + } else if (!this.profile.isNotEditable() && bl2) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + Minecraft.getMinecraft().displayGuiScreen(new ProfileCreatorGui(this.profile, HudLayoutEditorGui.instance, (ProfilesListElement)this.scrollableElement, this.highlightColor, this.scale)); + } else if (CheatBreaker.getInstance().activeProfile != this.profile) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().configManager.writeProfile(CheatBreaker.getInstance().activeProfile.getName()); + CheatBreaker.getInstance().activeProfile = this.profile; + CheatBreaker.getInstance().configManager.readProfile(CheatBreaker.getInstance().activeProfile.getName()); + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfilesListElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfilesListElement.java new file mode 100644 index 0000000..47ef14d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/profile/ProfilesListElement.java @@ -0,0 +1,138 @@ +package com.cheatbreaker.client.ui.element.profile; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ProfileCreatorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import lombok.SneakyThrows; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class ProfilesListElement extends AbstractScrollableElement { + private final int highlightColor; + public final List profileList = new ArrayList<>(); + private final ResourceLocation plusIcon = new ResourceLocation("client/icons/plus-64.png"); + private final ModulesGuiButtonElement openProfilesFolderButton; + + public ProfilesListElement(float scale, int x, int y, int width, int height) { + super(scale, x, y, width, height); + this.highlightColor = -12418828; + this.openProfilesFolderButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, "Open Profiles Folder", this.x + width - 120, this.y + height + 4, 110, 28, -12418828, scale); + this.loadProfiles(); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + int hovering; + RenderUtil.drawRoundedRect(this.x, this.y, this.x + this.width, this.y + this.height + 2, 8, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor4); + + this.onScroll(mouseX, mouseY); + this.scrollHeight = 15; + for (hovering = 0; hovering < this.profileList.size(); ++hovering) { + ProfileElement object = this.profileList.get(hovering); + object.setDimensions(this.x + 4, this.y + 4 + hovering * 18, this.width - 12, 18); + object.yOffset = this.scrollAmount; + object.handleDrawElement(mouseX, mouseY, partialTicks); + this.scrollHeight += object.getHeight(); + } + hovering = (float) mouseX > (float)(this.x + this.width - 92) * this.scale && (float) mouseX < (float)(this.x + this.width - 6) * this.scale && (float)mouseY > (float)(this.y + this.scrollHeight - 10 + this.scrollAmount) * this.scale && (float)mouseY < (float)(this.y + this.scrollHeight + 3 + this.scrollAmount) * this.scale ? 1 : 0; + GL11.glColor4f(hovering != 0 ? 0.0f : 0.25f, hovering != 0 ? 0.8f : 0.25f, hovering != 0 ? 0.0f : 0.25f, 0.65f); + RenderUtil.renderIcon(this.plusIcon, 3.5f, (float)(this.x + this.width - 15), (float)(this.y + this.scrollHeight) - 6.5f); + String addNewProfile = (hovering != 0 ? "(COPIES CURRENT PROFILE) " : "") + "ADD NEW PROFILE"; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(addNewProfile, this.x + this.width - 17 - CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(addNewProfile), (float)(this.y + this.scrollHeight) - 7.5f, hovering != 0 ? 0x7F007F00 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor6 : CBTheme.lightTextColor6); + this.scrollHeight += 10; + this.openProfilesFolderButton.yOffset = this.scrollAmount; + this.openProfilesFolderButton.setDimensions(this.x + this.width - 130, this.y + this.scrollHeight, 125, 20); + this.openProfilesFolderButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.onGuiDraw(mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.openProfilesFolderButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + try { + Desktop.getDesktop().open(CheatBreaker.getInstance().getConfigManager().profileDir); + } catch (IllegalArgumentException | IOException e) { + e.printStackTrace(); + } + return; + } + + for (ProfileElement profileElement : this.profileList) { + if (!profileElement.isMouseInside(mouseX, mouseY)) continue; + profileElement.handleMouseClick(mouseX, mouseY, button); + return; + } + boolean bl = (float) mouseX > (float)(this.x + this.width - 92) * this.scale && (float) mouseX < (float)(this.x + this.width - 6) * this.scale && (float) mouseY > (float)(this.y + this.scrollHeight - 20 + this.scrollAmount) * this.scale && (float) mouseY < (float)(this.y + this.scrollHeight - 7 + this.scrollAmount) * this.scale; + if (bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + Minecraft.getMinecraft().displayGuiScreen(new ProfileCreatorGui(HudLayoutEditorGui.instance, this, this.highlightColor, this.scale)); + } + double d = this.height - 10; + double d2 = this.scrollHeight; + double d3 = d / d2 * (double)100; + double d4 = d / (double)100 * d3; + double d5 = (double)this.scrollAmount / 100.0 * d3; + boolean bl43 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (double)mouseY > ((double)(this.y + 11) - d5) * (double)this.scale && (double)mouseY < ((double)(this.y + 8) + d4 - d5) * (double)this.scale; + boolean bl33 = (float)mouseX > (float)(this.x + this.width - 9) * this.scale && (float)mouseX < (float)(this.x + this.width - 3) * this.scale && (float)mouseY > (float)(this.y + 11) * this.scale && (double)mouseY < ((double)(this.y + 6) + d - (double)3) * (double)this.scale; + if (button == 0 && bl33 || bl43) { + this.hovering = true; + } + } + + @Override + public boolean hasSettings(AbstractModule module) { + return true; + } + + @Override + public void handleModuleMouseClick(AbstractModule abstractModule) { + } + + public void loadProfiles() { + new Thread(() -> { + this.profileList.clear(); + File file = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch() + File.separator + "profiles"); + if (file.exists()) { + for (File file2 : file.listFiles()) { + if (!file2.getName().endsWith(".cfg")) continue; + Profile profile = null; + for (Profile profile2 : CheatBreaker.getInstance().profiles) { + if (!file2.getName().equals(profile2.getName() + ".cfg")) continue; + profile = profile2; + } + if (profile != null) continue; + CheatBreaker.getInstance().profiles.add(new Profile(file2.getName().replace(".cfg", ""), false)); + } + } + for (Profile profile : CheatBreaker.getInstance().profiles) { + this.profileList.add(new ProfileElement(this, this.highlightColor, profile, this.scale)); + } + this.profileList.sort((profileElement, profileElement2) -> { + if (profileElement.profile.getName().equalsIgnoreCase("default")) { + return 0; + } + if (profileElement.profile.index < profileElement2.profile.index) { + return -1; + } + return 1; + }); + }).start(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ChoiceElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ChoiceElement.java new file mode 100644 index 0000000..a22a661 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ChoiceElement.java @@ -0,0 +1,140 @@ +package com.cheatbreaker.client.ui.element.type; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ChoiceElement extends AbstractModulesGuiElement { +// private final Setting setting; + private final ResourceLocation leftArrowIcon = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation rightArrowIcon = new ResourceLocation("client/icons/right.png"); + private int optionValueIndex = 0; // From what I can tell, this only matters in terms of showing the new option value + private float animationSpeed = 0.0f; + private String optionValue; + + public ChoiceElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.height = 12; +// if (this.shouldHide(this.setting)) { +// this.height = 0; +// } else { +// this.height = 12; +// } + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { +// if (!this.shouldHide(this.setting)) { + boolean yrrr = (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + boolean isXHovering = (float) mouseX > (float)(this.x + this.width - 48) * this.scale && (float) mouseX < (float)(this.x + this.width - 10) * this.scale && yrrr; + boolean isYHovering = (float) mouseX > (float)(this.x + this.width - 92) * this.scale && (float) mouseX < (float)(this.x + this.width - 48) * this.scale && yrrr; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), isYHovering || isXHovering ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor3 : CBTheme.lightTextColor3 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + boolean endsWithColor = this.setting.getSettingName().toLowerCase().endsWith("color"); + +// if (this.optionValue != null) { +// System.out.println(this.optionValueIndex); +// System.out.println(this.optionValue); +// } + + if (!endsWithColor) { + if (this.optionValueIndex == 0) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((String)this.setting.getValue(), this.x + this.width - 48, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + boolean valIsOne = this.optionValueIndex == 1; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.optionValue, (float)(this.x + this.width - 48) - (valIsOne ? -this.animationSpeed : this.animationSpeed), this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + if (valIsOne) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((String)this.setting.getValue(), (float)(this.x + this.width - 98) + this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((String)this.setting.getValue(), (float)(this.x + this.width + 2) - this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + if (this.animationSpeed >= (float)50) { + this.optionValueIndex = 0; + this.animationSpeed = 0.0f; + } else { + float speed = HudLayoutEditorGui.getFPSTransitionSpeed((float)50 + this.animationSpeed * (float)15); + this.animationSpeed = Math.min(this.animationSpeed + speed, (float) 50); + } + + Gui.drawRect(this.x + this.width - 130, this.y + 2, this.x + this.width - 72, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + Gui.drawRect(this.x + this.width - 22, this.y + 2, this.x + this.width + 4, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + } + } else if (this.optionValueIndex == 0) { + float f3 = CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth((String)this.setting.getValue()); + CheatBreaker.getInstance().ubuntuMedium16px.drawString((String)this.setting.getValue(), (float)(this.x + this.width) - 44.738373f * 1.0617284f - f3 / 2.0f, (float)this.y + 1.74f * 1.4367816f, -16777216); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("§" + this.setting.getValue() + this.setting.getValue(), (float)(this.x + this.width - 48) - f3 / 2.0f, (float)(this.y + 2), -16777216); + } else { + boolean bl5 = this.optionValueIndex == 1; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.optionValue, (float)(this.x + this.width - 48) - (bl5 ? -this.animationSpeed : this.animationSpeed), this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + float f4 = CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth((String)this.setting.getValue()); + if (bl5) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString((String)this.setting.getValue(), (float)(this.x + this.width) - 110.21739f * 0.88461536f - f4 / 2.0f + this.animationSpeed, (float)this.y + 0.8095238f * 3.0882351f, -16777216); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("§" + this.setting.getValue() + this.setting.getValue(), (float)(this.x + this.width - 98) - f4 / 2.0f + this.animationSpeed, (float)(this.y + 2), -16777216); + } else { + CheatBreaker.getInstance().ubuntuMedium16px.drawString((String)this.setting.getValue(), (float)(this.x + this.width) - 2.6296296f * 0.57042253f - f4 / 2.0f - this.animationSpeed, (float)this.y + 0.040983606f * 61.0f, -16777216); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("§" + this.setting.getValue() + this.setting.getValue(), (float)(this.x + this.width - 2) - f4 / 2.0f - this.animationSpeed, (float)(this.y + 2), -16777216); + } + if (this.animationSpeed >= (float)50) { + this.optionValueIndex = 0; + this.animationSpeed = 0.0f; + } else { + float animationSpeed = HudLayoutEditorGui.getFPSTransitionSpeed((float)50 + this.animationSpeed * (float)15); + this.animationSpeed = Math.min(this.animationSpeed + animationSpeed, (float) 50); + } + Gui.drawRect(this.x + this.width - 130, this.y + 2, this.x + this.width - 72, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + Gui.drawRect(this.x + this.width - 22, this.y + 2, this.x + this.width + 4, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + } + + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isYHovering ? 0.6857143f * 1.1666666f : 0.5416667f * 0.8307692f); + RenderUtil.renderIcon(this.leftArrowIcon, (float)4, (float)(this.x + this.width - 82), (float)(this.y + 3)); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isXHovering ? 0.82580644f * 0.96875f : 3.3793104f * 0.13316326f); + RenderUtil.renderIcon(this.rightArrowIcon, (float)4, (float)(this.x + this.width - 22), (float)(this.y + 3)); + drawDescription(this.setting, mouseX, mouseY); +// } + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl2 = (float) mouseX > (float)(this.x + this.width - 48) * this.scale && (float) mouseX < (float)(this.x + this.width - 10) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + boolean bl = (float) mouseX > (float)(this.x + this.width - 92) * this.scale && (float) mouseX < (float)(this.x + this.width - 48) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + if ((bl || bl2) && this.optionValueIndex == 0) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + for (int i = 0; i < this.setting.getAcceptedStringValues().length; ++i) { + if (!((String[])this.setting.getAcceptedStringValues())[i].toLowerCase().equalsIgnoreCase((String)this.setting.getValue())) continue; + this.optionValue = (String)this.setting.getValue(); + if (bl2) { + if (i + 1 >= this.setting.getAcceptedStringValues().length) { + this.optionValueIndex = 2; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[0]); + break; + } + this.optionValueIndex = 2; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[i + 1]); + break; + } + if (!bl) continue; + if (i - 1 < 0) { + this.optionValueIndex = 1; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[this.setting.getAcceptedStringValues().length - 1]); + break; + } + this.optionValueIndex = 1; + this.setting.setValue(((String[])this.setting.getAcceptedStringValues())[i - 1]); + break; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerColorElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerColorElement.java new file mode 100644 index 0000000..306145e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerColorElement.java @@ -0,0 +1,27 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import net.minecraft.client.gui.Gui; + +public class ColorPickerColorElement extends AbstractModulesGuiElement { + public int color; + private final float scaleFactor; + + public ColorPickerColorElement(float scaleFactor, int color, float scale) { + super(scaleFactor); + this.color = color; + this.scaleFactor = scale; + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + Gui.drawRectWithOutline(this.x, this.y, this.x + this.width, this.y + this.height, 1, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4, 0); + Gui.drawRect(this.x + 1, this.y + 1, this.x + this.width - 1, this.y + this.height - 1, this.color | 0xFF000000); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerElement.java new file mode 100644 index 0000000..2ffbed3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorPickerElement.java @@ -0,0 +1,348 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +public class ColorPickerElement extends AbstractModulesGuiElement { +// private final Setting setting; + private final List colors; + private boolean expanded = false; + private boolean IlllIllIlIIIIlIIlIIllIIIl = false; + private boolean IlIlllIIIIllIllllIllIIlIl = false; + private boolean llIIlllIIIIlllIllIlIlllIl = false; + private final ColorPickerColorElement colorPickerColorElement; + private float IIIlllIIIllIllIlIIIIIIlII = 1.0f; + private float llIlIIIlIIIIlIlllIlIIIIll = 1.0f; + private float pickerX; + private float pickerY; + private float pickerX2; + private float pickerY2; + private float pickerXDiff; + private float pickerYDiff; + private int lIIlIIllIIIIIlIllIIIIllII; + private int lIIlllIIlIlllllllllIIIIIl; + private int lIllIllIlIIllIllIlIlIIlIl; + private int llIlIIIllIIIIlllIlIIIIIlI; + + public ColorPickerElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.colorPickerColorElement = new ColorPickerColorElement(scaleFactor, (Integer) setting.getValue(), 1.0f); + this.colors = new ArrayList<>(); + for (int i = 0; i < 16; ++i) { + int color = Minecraft.getMinecraft().fontRenderer.colorCode[i]; + this.colors.add(new ColorPickerColorElement(scaleFactor, color, 1.0f)); + } + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + this.height = this.expanded ? 130 : 18; + this.pickerX = this.x + 56; + this.pickerX2 = this.x + 176; + this.pickerY = this.y + 25; + this.pickerY2 = this.y + 119; + this.pickerXDiff = this.pickerX2 - this.pickerX; + this.pickerYDiff = this.pickerY2 - this.pickerY; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + this.colorPickerColorElement.color = this.setting.getColorValue(); + this.colorPickerColorElement.setDimensions(this.x + 160, this.y + 3, 14, 14); + this.colorPickerColorElement.yOffset = this.yOffset; + this.colorPickerColorElement.handleDrawElement(mouseX, mouseY, partialTicks); + Gui.drawRect(this.x + 186, this.y + 16, this.x + this.width - 16, this.y + 17, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor6 : CBTheme.lightTextColor6); + CheatBreaker.getInstance().playBold18px.drawString("#", this.x + 188, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + CheatBreaker.getInstance().playBold18px.drawString(Integer.toHexString(this.setting.getColorValue()), this.x + 194, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + boolean hovering = (float) mouseX > (float)(this.x + this.width - 40) * this.scale && (float) mouseX < (float)(this.x + this.width - 12) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + 18 + this.yOffset) * this.scale; + String favoriteString = hovering ? "(Favorite)" : "(+)"; + if (CheatBreaker.getInstance().getGlobalSettings().isFavouriteColor((Integer)this.setting.getValue())) { + favoriteString = hovering ? "(Un-favorite)" : "(-)"; + } + CheatBreaker.getInstance().playBold18px.drawString(favoriteString, this.x + this.width - 16 - CheatBreaker.getInstance().playBold18px.getStringWidth(favoriteString), (float)(this.y + 4), hovering ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + drawDescription(this.setting, mouseX, mouseY); + if (this.expanded) { + if (this.IlllIllIlIIIIlIIlIIllIIIl && !Mouse.isButtonDown(0)) { + this.IlllIllIlIIIIlIIlIIllIIIl = false; + this.addRecentColor(); + } + if (this.IlIlllIIIIllIllllIllIIlIl && !Mouse.isButtonDown(0)) { + this.IlIlllIIIIllIllllIllIIlIl = false; + this.addRecentColor(); + } + if (this.llIIlllIIIIlllIllIlIlllIl && !Mouse.isButtonDown(0)) { + this.llIIlllIIIIlllIllIlIlllIl = false; + this.addRecentColor(); + } + Gui.drawRect(this.x + 55, this.y + 24, this.x + 177, this.y + 120, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5); + + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(3553); + tessellator.startDrawingQuads(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + tessellator.addVertex(this.pickerX, this.pickerY2, 0.0); + tessellator.addVertex(this.pickerX2, this.pickerY2, 0.0); + tessellator.addVertex(this.pickerX2, this.pickerY, 0.0); + tessellator.addVertex(this.pickerX, this.pickerY, 0.0); + tessellator.draw(); + int[] arrn = null; + int n3 = 0; + while ((float)n3 < this.pickerXDiff) { + int n4 = 0; + while ((float)n4 < this.pickerYDiff) { + float f2 = (float)n3 / this.pickerXDiff; + float f3 = 1.0f - (float)n4 / this.pickerYDiff; + int rgb = Color.HSBtoRGB(this.IIIlllIIIllIllIlIIIIIIlII, f2, f3); + int color = new Color(rgb >> 16 & 0xFF, rgb >> 8 & 0xFF, rgb & 0xFF, this.setting.getIntegerValue() >> 24 & 0xFF).getRGB(); + boolean bl3 = (float) mouseX >= (this.pickerX + (float)n3) * this.scale && (float) mouseX <= (this.pickerX + (float)n3 + 1.0f) * this.scale; + boolean bl4 = (float)mouseY <= (this.pickerY + (float)n4 + 1.0f + (float)this.yOffset) * this.scale && (float)mouseY > (this.pickerY + (float)n4 + (float)this.yOffset) * this.scale; + boolean bl5 = bl3 && bl4; + boolean bl6 = n3 == 0 && (float) mouseX < this.pickerX * this.scale && bl4; + boolean bl7 = n4 == 0 && (float)mouseY < (this.pickerY + (float)this.yOffset) * this.scale && bl3; + boolean bl8 = (float)n3 == this.pickerXDiff - 1.0f && (float) mouseX > (this.pickerX + this.pickerXDiff) * this.scale && bl4; + boolean bl2 = (float)n4 == this.pickerYDiff - 1.0f && (float)mouseY > (this.pickerY + this.pickerYDiff + (float)this.yOffset) * this.scale && bl3; + if (this.IlllIllIlIIIIlIIlIIllIIIl && (bl5 || bl6 || bl7 || bl8 || bl2)) { + this.setting.setValue(color); + this.setting.color = new int[]{n3, n4}; + } + if (this.setting.color != null) { + arrn = this.setting.color; + } else if (color == (Integer)this.setting.getValue()) { + arrn = new int[]{n3, n4}; + } + tessellator.startDrawingQuads(); + GL11.glColor4f((float)(color >> 16 & 0xFF) / (float)255, (float)(color >> 8 & 0xFF) / (float)255, (float)(color & 0xFF) / (float)255, 1.0f); + tessellator.addVertex(this.pickerX + (float)n3, this.pickerY + (float)n4 + 1.0f, 0.0); + tessellator.addVertex(this.pickerX + (float)n3 + 1.0f, this.pickerY + (float)n4 + 1.0f, 0.0); + tessellator.addVertex(this.pickerX + (float)n3 + 1.0f, this.pickerY + (float)n4, 0.0); + tessellator.addVertex(this.pickerX + (float)n3, this.pickerY + (float)n4, 0.0); + tessellator.draw(); + ++n4; + } + ++n3; + } + if (arrn != null) { + GL11.glPushMatrix(); + GL11.glColor4f(0.0f, 0.0f, 0.0f, 3.0f * 0.25f); + RenderUtil.drawCircle(this.pickerX + (float)arrn[0] + 1.2205882f * 0.913494f, this.pickerY + (float)arrn[1] + 0.097222224f * 11.468572f, 4); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.drawCircle(this.pickerX + (float)arrn[0] + 0.24193548f * 4.608667f, this.pickerY + (float)arrn[1] + 0.23157895f * 4.8147726f, 2.7D); + GL11.glPopMatrix(); + } + Gui.drawRect(this.pickerX - (float)51, this.pickerY + 1.0f, this.pickerX - 43.0F, this.pickerY + (float)9, -16777216); + Gui.drawRect(this.pickerX - (float)50, this.pickerY + 2.0f, this.pickerX - 44.0F, this.pickerY + (float)8, this.setting.rainbow ? -13369549 : -1); + CheatBreaker.getInstance().playRegular16px.drawString("CHROMA", this.pickerX - 40.0F, this.pickerY, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + if(this.setting.rainbow) { + Gui.drawRect(this.pickerX - (float) 51, this.pickerY + 10.0f, this.pickerX - (float) 43, this.pickerY + (float) 18, -16777216); + Gui.drawRect(this.pickerX - (float) 50, this.pickerY + 11.0f, this.pickerX - (float) 44, this.pickerY + (float) 17, this.setting.speed ? -13369549 : -1); + CheatBreaker.getInstance().playRegular16px.drawString("SPEED", this.pickerX - (float)40, this.pickerY + 10, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor4 : CBTheme.lightTextColor4); + } + this.drawHueSlider(mouseX, mouseY); + this.drawOpacitySlider(mouseX, mouseY); + this.lIIlIIllIIIIIlIllIIIIllII = (int)(this.pickerX + this.pickerXDiff + (float)64); + this.lIIlllIIlIlllllllllIIIIIl = (int)this.pickerY; + this.drawInstantColorSelectionBoxes(CheatBreaker.getInstance().getGlobalSettings().recentColors, this.lIIlIIllIIIIIlIllIIIIllII, this.lIIlllIIlIlllllllllIIIIIl, mouseX, mouseY, (int) partialTicks); + this.lIllIllIlIIllIllIlIlIIlIl = (int)(this.pickerX + this.pickerXDiff + (float)94); + this.llIlIIIllIIIIlllIlIIIIIlI = (int)this.pickerY; + this.drawInstantColorSelectionBoxes(CheatBreaker.getInstance().getGlobalSettings().favouriteColors, this.lIllIllIlIIllIllIlIlIIlIl, this.llIlIIIllIIIIlllIlIIIIIlI, mouseX, mouseY, (int) partialTicks); + this.drawInstantColorSelectionBoxes(this.colors, (int)(this.pickerX + this.pickerXDiff + (float)34), (int)this.pickerY, mouseX, mouseY, (int) partialTicks); + } + } + + private void addRecentColor() { + if (CheatBreaker.getInstance().getGlobalSettings().recentColors.size() >= 16) { + CheatBreaker.getInstance().getGlobalSettings().recentColors.remove(0); + } + CheatBreaker.getInstance().getGlobalSettings().recentColors.add(new ColorPickerColorElement(this.scale, (Integer)this.setting.getValue(), 1.0f)); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + + private void drawOpacitySlider(int n, int n2) { + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)18, this.pickerY - 1.0f, this.pickerX + this.pickerXDiff + 28.0F, this.pickerY + 1.0f + this.pickerYDiff, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5); + + this.drawOpacityCheckerboard(); + int n3 = 0; + while ((float)n3 < this.pickerYDiff) { + int n4 = (Integer)this.setting.getValue(); + int n5 = new Color(n4 >> 16 & 0xFF, n4 >> 8 & 0xFF, n4 & 0xFF, Math.round(255.0F - (float)n3 / this.pickerYDiff * 255.0F)).getRGB(); + if (this.llIIlllIIIIlllIllIlIlllIl && (float)n2 >= ((float)this.yOffset + this.pickerY + (float)n3) * this.scale && (float)n2 <= ((float)this.yOffset + this.pickerY + (float)n3 + 1.0f) * this.scale) { + this.llIlIIIlIIIIlIlllIlIIIIll = (float)n3 / this.pickerYDiff; + this.setting.setValue(n5); + } + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)19, this.pickerY + (float)n3, this.pickerX + this.pickerXDiff + (float)27, this.pickerY + (float)n3 + 1.0f, n5); + ++n3; + } + float f = (float)-1 + this.pickerYDiff * this.llIlIIIlIIIIlIlllIlIIIIll; + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)18, this.pickerY + f, this.pickerX + this.pickerXDiff + (float)28, this.pickerY + f + (float)3, -822083584); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)18, this.pickerY + f + 1.0f, this.pickerX + this.pickerXDiff + (float)28, this.pickerY + f + 2.0f, -805306369); + } + + private void drawHueSlider(int x, int y) { + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)4, this.pickerY - 1.0f, this.pickerX + this.pickerXDiff + (float)14, this.pickerY + 1.0f + this.pickerYDiff, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor5 : CBTheme.lightTextColor5); + + int n3 = 0; + while ((float)n3 < this.pickerYDiff) { + int n4; + if (this.IlIlllIIIIllIllllIllIIlIl && (float)y >= ((float)this.yOffset + this.pickerY + (float)n3) * this.scale && (float)y <= ((float)this.yOffset + this.pickerY + (float)n3 + 1.0f) * this.scale) { + n4 = (Integer)this.setting.getValue(); + float[] arrf = Color.RGBtoHSB(n4 >> 16 & 0xFF, n4 >> 8 & 0xFF, n4 & 0xFF, null); + int color = new Color(Color.HSBtoRGB(this.IIIlllIIIllIllIlIIIIIIlII, arrf[1], arrf[2]) >> 16 & 0xFF, Color.HSBtoRGB(this.IIIlllIIIllIllIlIIIIIIlII, arrf[1], arrf[2]) >> 8 & 0xFF, Color.HSBtoRGB(this.IIIlllIIIllIllIlIIIIIIlII, arrf[1], arrf[2]) & 0xFF, n4 >> 24 & 0xFF).getRGB(); + this.setting.setValue(color); + this.IIIlllIIIllIllIlIIIIIIlII = (float)n3 / this.pickerYDiff; + } + n4 = Color.HSBtoRGB((float)n3 / this.pickerYDiff, 1.0f, 1.0f); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)5, this.pickerY + (float)n3, this.pickerX + this.pickerXDiff + (float)13, this.pickerY + (float)n3 + 1.0f, n4); + ++n3; + } + float f = (float)-1 + this.pickerYDiff * this.IIIlllIIIllIllIlIIIIIIlII; + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)4, this.pickerY + f, this.pickerX + this.pickerXDiff + (float)14, this.pickerY + f + (float)3, -822083584); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)4, this.pickerY + f + 1.0f, this.pickerX + this.pickerXDiff + (float)14, this.pickerY + f + 2.0f, -805306369); + } + + private void drawOpacityCheckerboard() { + boolean bl = true; + int n = 2; + while ((float)n < this.pickerYDiff - (float)4) { + if (!bl) { + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)19, this.pickerY + (float)n, this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n + (float)4, -1); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n + (float)4, this.pickerX + this.pickerXDiff + (float)27, this.pickerY + (float)n + (float)8, -1); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n, this.pickerX + this.pickerXDiff + (float)27, this.pickerY + (float)n + (float)4, 0xFF909090); + Gui.drawRect(this.pickerX + this.pickerXDiff + (float)19, this.pickerY + (float)n + (float)4, this.pickerX + this.pickerXDiff + (float)23, this.pickerY + (float)n + (float)8, -7303024); + } + bl = !bl; + n += 4; + } + } + + private void drawInstantColorSelectionBoxes(List list, int n, int n2, int n3, int n4, int n5) { + int n6 = 0; + int n7 = 0; + int n8 = 8; + for (ColorPickerColorElement colorPickerColorElementObj : list) { + colorPickerColorElementObj.scale = this.scale; + if (n6 == n8) { + ++n7; + n6 = 0; + } + if (list == this.colors) { + int n9 = n8 * 2 / 8 * 12; + int var12_12 = n + n9 - n7 * 12 - 12; + int var13_13 = n2 + n6 * n9 - n6 * 12; + colorPickerColorElementObj.yOffset = this.yOffset; + colorPickerColorElementObj.setDimensions(var12_12, var13_13, 10, 10); + String string = "0123456789abcdefklmnor"; + int n10 = n6 + n7 * n8; + String string2 = string.substring(n10, n10 + 1); + if (colorPickerColorElementObj.isMouseInside(n3, n4)) { + Gui.drawRect(var12_12 + 12, var13_13 - 1, var12_12 + 26, var13_13 + 11, -1087492562); + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow("&" + string2, var12_12 + 14, var13_13, -1); + } + } else { + int var12_12 = n + n7 * 12; + int var13_13 = n2 + n6 * 12; + colorPickerColorElementObj.yOffset = this.yOffset; + colorPickerColorElementObj.setDimensions(var12_12, var13_13, 10, 10); + } + colorPickerColorElementObj.handleDrawElement(n3, n4, (float)n5); + ++n6; + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(List list, int n, int n2, int n3, int n4) { + int n5 = 0; + int n6 = 0; + int n7 = 8; + for (ColorPickerColorElement colorPickerColorElementObj : list) { + int n8; + if (list != this.colors) { + if (n5 == n7) { + ++n6; + n5 = 0; + } + int n9 = n + n6 * 12; + n8 = n2 + n5 * 12; + colorPickerColorElementObj.yOffset = this.yOffset; + colorPickerColorElementObj.setDimensions(n9, n8, 10, 10); + } + if (colorPickerColorElementObj.isMouseInside(n3, n4)) { + int color = colorPickerColorElementObj.color; + if (list == this.colors) { + this.setting.setValue(new Color(color >> 16 & 0xFF, color >> 8 & 0xFF, color & 0xFF, this.setting.getIntegerValue() >> 24 & 0xFF).getRGB()); + } else { + this.setting.setValue(new Color(colorPickerColorElementObj.color, true).getRGB()); + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + float[] arrf = Color.RGBtoHSB(colorPickerColorElementObj.color >> 16 & 0xFF, colorPickerColorElementObj.color >> 8 & 0xFF, colorPickerColorElementObj.color & 0xFF, null); + this.IIIlllIIIllIllIlIIIIIIlII = arrf[0]; + n8 = (int)(arrf[1] * this.pickerXDiff); + int n10 = (int)(this.pickerYDiff - arrf[2] * this.pickerYDiff); + this.setting.color = new int[]{n8, n10}; + } + ++n5; + } + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl2 = (float) mouseX > (float)(this.x + this.width - 40) * this.scale && (float) mouseX < (float)(this.x + this.width - 12) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 18 + this.yOffset) * this.scale; + boolean bl = (float) mouseX > (float)this.x * this.scale && (float) mouseX < (float)(this.x + this.width - 40) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 18 + this.yOffset) * this.scale; + if (bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + float[] arrf = Color.RGBtoHSB((Integer)this.setting.getValue() >> 16 & 0xFF, (Integer)this.setting.getValue() >> 8 & 0xFF, (Integer)this.setting.getValue() & 0xFF, null); + this.IIIlllIIIllIllIlIIIIIIlII = arrf[0]; + int n4 = (int)(arrf[1] * this.pickerXDiff); + int n5 = (int)(this.pickerYDiff - arrf[2] * this.pickerYDiff); + this.setting.color = new int[]{n4, n5}; + this.expanded = !this.expanded; + } else if (bl2) { + if (CheatBreaker.getInstance().getGlobalSettings().isFavouriteColor((Integer)this.setting.getValue())) { + CheatBreaker.getInstance().getGlobalSettings().removeFavouriteColor((Integer)this.setting.getValue()); + } else { + if (CheatBreaker.getInstance().getGlobalSettings().favouriteColors.size() >= 16) { + CheatBreaker.getInstance().getGlobalSettings().favouriteColors.remove(0); + } + CheatBreaker.getInstance().getGlobalSettings().favouriteColors.add(new ColorPickerColorElement(this.scale, (Integer)this.setting.getValue(), 1.0f)); + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (this.expanded) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.colors, 0, 0, mouseX, mouseY); + this.lIIIIlIIllIIlIIlIIIlIIllI(CheatBreaker.getInstance().getGlobalSettings().recentColors, this.lIIlIIllIIIIIlIllIIIIllII, this.lIIlllIIlIlllllllllIIIIIl, mouseX, mouseY); + this.lIIIIlIIllIIlIIlIIIlIIllI(CheatBreaker.getInstance().getGlobalSettings().favouriteColors, this.lIllIllIlIIllIllIlIlIIlIl, this.llIlIIIllIIIIlllIlIIIIIlI, mouseX, mouseY); + boolean bl4 = (float) mouseX > (this.pickerX - (float)51) * this.scale && (float) mouseY > (this.pickerY + 1.0f + (float)this.yOffset) * this.scale && (float) mouseX < (this.pickerX - (float)43) * this.scale && (float) mouseY < (this.pickerY + (float)9 + (float)this.yOffset) * this.scale; + boolean bl5 = (float) mouseX > (this.pickerX - (float)51) * this.scale && (float) mouseY > (this.pickerY + 10.0f + (float)this.yOffset) * this.scale && (float) mouseX < (this.pickerX - (float)43) * this.scale && (float) mouseY < (this.pickerY + (float)19 + (float)this.yOffset) * this.scale; + if ((float) mouseX > this.pickerX * this.scale && (float) mouseX < (this.pickerX + this.pickerXDiff) * this.scale && (float) mouseY > (this.pickerY + (float)this.yOffset) * this.scale && (float) mouseY < (this.pickerY + this.pickerYDiff + (float)this.yOffset) * this.scale) { + this.IlllIllIlIIIIlIIlIIllIIIl = true; + } + if ((float) mouseX > (this.pickerX + this.pickerXDiff + (float)4) * this.scale && (float) mouseX < (this.pickerX + this.pickerXDiff + (float)14) * this.scale && (float) mouseY > (this.pickerY - 1.0f + (float)this.yOffset) * this.scale && (float) mouseY < (this.pickerY + 1.0f + this.pickerYDiff + (float)this.yOffset) * this.scale) { + this.IlIlllIIIIllIllllIllIIlIl = true; + } + if ((float) mouseX > (this.pickerX + this.pickerXDiff + (float)18) * this.scale && (float) mouseX < (this.pickerX + this.pickerXDiff + (float)28) * this.scale && (float) mouseY > (this.pickerY - 1.0f + (float)this.yOffset) * this.scale && (float) mouseY < (this.pickerY + 1.0f + this.pickerYDiff + (float)this.yOffset) * this.scale) { + this.llIIlllIIIIlllIllIlIlllIl = true; + } + if (bl4) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.setting.rainbow = !this.setting.rainbow; + } + if (bl5) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.setting.speed = !this.setting.speed; + } + } + if (this.setting == CheatBreaker.getInstance().getModuleManager().packTweaksMod.coloredStringColor) { + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorSliderElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorSliderElement.java new file mode 100644 index 0000000..e8cecbc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ColorSliderElement.java @@ -0,0 +1,100 @@ +package com.cheatbreaker.client.ui.element.type; + +import java.awt.Color; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.Minecraft; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +/** This shouldn't be called Old Slider element for a few reasons: + * This is merely a color rainbow slider - probably used for testing + * This only allowed floats. + */ +public class ColorSliderElement extends AbstractModulesGuiElement { + private final Setting lIIIIlIIllIIlIIlIIIlIIllI; + private float IllIIIIIIIlIlIllllIIllIII = -1; + private float lIIIIllIIlIlIllIIIlIllIlI; + private boolean IlllIllIlIIIIlIIlIIllIIIl = false; + + public ColorSliderElement(Setting setting, float f) { + super(f); + this.lIIIIlIIllIIlIIlIIIlIIllI = setting; + this.height = 14; + this.IllIIIIIIIlIlIllllIIllIII = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + int n4 = 170; + boolean bl = (float) mouseX > (float)(this.x + 170) * this.scale && (float) mouseX < (float)(this.x + 170 + n4 - 2) * this.scale && (float) mouseY > (float)(this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + if (button == 0 && bl) { + this.IlllIllIlIIIIlIIlIIllIIIl = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + float f3; + int n3 = 148; + float f4 = n3 - 18; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.lIIIIlIIllIIlIIlIIIlIIllI.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), -1895825408); + if (this.IlllIllIlIIIIlIIlIIllIIIl && !Mouse.isButtonDown(0)) { + this.IlllIllIlIIIIlIIlIIllIIIl = false; + } + Gui.drawRect((float)this.x + 0.13043478f * 1376.1666f, (float)this.y + 2.2962964f * 2.3951612f, (float)this.x + 0.28169015f * 640.77496f + f4, (float)this.y + 1.4333333f * 5.930233f, -822083584); + int n4 = 0; + while ((float)n4 < f4) { + int n5 = Color.HSBtoRGB((float)n4 / f4, 1.0f, 1.0f); + Gui.drawRect(this.x + 180 + n4, this.y + 6, this.x + 181 + n4, this.y + 8, n5); + ++n4; + } + float f5 = Float.parseFloat("" + this.lIIIIlIIllIIlIIlIIIlIIllI.getMinimumValue()); + float f6 = Float.parseFloat("" + this.lIIIIlIIllIIlIIlIIIlIIllI.getMaximumValue()); + if (this.IlllIllIlIIIIlIIlIIllIIIl) { + this.lIIIIllIIlIlIllIIIlIllIlI = (float)((double)(f5 + ((float) mouseX - (float)(this.x + 180) * this.scale) * ((f6 - f5) / (f4 * this.scale))) * (double)100) / (float)100; + if (this.lIIIIlIIllIIlIIlIIIlIIllI.getType().equals(SettingType.INTEGER)) { + this.lIIIIllIIlIlIllIIIlIllIlI = Math.round(this.lIIIIllIIlIlIllIIIlIllIlI); + } + if (this.lIIIIllIIlIlIllIIIlIllIlI < f5) { + this.lIIIIllIIlIlIllIIIlIllIlI = f5; + } else if (this.lIIIIllIIlIlIllIIIlIllIlI > f6) { + this.lIIIIllIIlIlIllIIIlIllIlI = f6; + } + switch (this.lIIIIlIIllIIlIIlIIIlIIllI.getType()) { + case INTEGER: + this.lIIIIlIIllIIlIIlIIIlIIllI.setValue(Integer.parseInt((int)this.lIIIIllIIlIlIllIIIlIllIlI + "")); + break; + case FLOAT: + this.lIIIIlIIllIIlIIlIIIlIIllI.setValue(Float.valueOf(this.lIIIIllIIlIlIllIIIlIllIlI)); + break; + case DOUBLE: + this.lIIIIlIIllIIlIIlIIIlIIllI.setValue(Double.parseDouble(this.lIIIIllIIlIlIllIIIlIllIlI + "")); + } + } + f3 = (f3 = Float.parseFloat(this.lIIIIlIIllIIlIIlIIIlIIllI.getValue() + "")) < this.IllIIIIIIIlIlIllllIIllIII ? this.IllIIIIIIIlIlIllllIIllIII - f3 : (f3 -= this.IllIIIIIIIlIlIllllIIllIII); + float f7 = ((f6 - f5) / (float)20 + f3 * (float)8) / (float)(Minecraft.debugFPS + 1); + if ((double)f7 < (double)0.1590909f * 6.285714392759364E-4) { + f7 = 3.163265E-5f * 3.1612904f; + } + if (this.IllIIIIIIIlIlIllllIIllIII < (f2 = Float.parseFloat(this.lIIIIlIIllIIlIIlIIIlIIllI.getValue() + ""))) { + this.IllIIIIIIIlIlIllllIIllIII = this.IllIIIIIIIlIlIllllIIllIII + f7 <= f2 ? (this.IllIIIIIIIlIlIllllIIllIII += f7) : f2; + } else if (this.IllIIIIIIIlIlIllllIIllIII > f2) { + this.IllIIIIIIIlIlIllllIIllIII = this.IllIIIIIIIlIlIllllIIllIII - f7 >= f2 ? (this.IllIIIIIIIlIlIllllIIllIII -= f7) : f2; + } + double d = (float)100 * ((this.IllIIIIIIIlIlIllllIIllIII - f5) / (f6 - f5)); + GL11.glColor4f(0.38f * 0.65789473f, 0.4318182f * 1.0421052f, 1.0f, 1.0f); + RenderUtil.drawCircle((double)((float)this.x + 0.90217394f * 200.90361f) + (double)f4 * d / (double)100, (float)this.y + 1.5890411f * 4.5625f, 6.333333492279053 * 0.7105262979576137); + float f8 = (Float) this.lIIIIlIIllIIlIIlIIIlIIllI.getValue(); + int n6 = f8 == 0.0f ? -1 : Color.HSBtoRGB(f8, 1.0f, 1.0f); + GL11.glColor4f((float)(n6 >> 16 & 0xFF) / (float)255, (float)(n6 >> 8 & 0xFF) / (float)255, (float)(n6 & 0xFF) / (float)255, 1.0f); + RenderUtil.drawCircle((double)((float)this.x + 1.5f * 120.833336f) + (double)f4 * d / 100.0, (float)this.y + 0.2962963f * 24.46875f, 11.137499864771966 * 0.24242424964904785); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ElementListElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ElementListElement.java new file mode 100644 index 0000000..a61c274 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ElementListElement.java @@ -0,0 +1,66 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; + +import java.util.ArrayList; +import java.util.List; + +public class ElementListElement extends AbstractElement { + protected final List elements = new ArrayList(); + + public ElementListElement(List list) { + this.elements.addAll(list); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + for (AbstractElement abstractElement : this.elements) { + abstractElement.drawElementHover(f, f2, bl); + } + } + + @Override + public void handleElementClose() { + this.elements.forEach(AbstractElement::handleElementClose); + } + + @Override + public void handleElementUpdate() { + this.elements.forEach(AbstractElement::handleElementUpdate); + } + + @Override + public void keyTyped(char c, int n) { + this.elements.forEach(abstractElement -> abstractElement.keyTyped(c, n)); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + boolean bl2 = false; + for (AbstractElement abstractElement : this.elements) { + if (bl2) break; + bl2 = abstractElement.handleElementMouseClicked(f, f2, n, bl); + } + return bl2; + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + boolean bl2 = false; + for (AbstractElement abstractElement : this.elements) { + if (bl2) break; + bl2 = abstractElement.onMouseMoved(f, f2, n, bl); + } + return bl2; + } + + public List getElements() { + return this.elements; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/FlatButtonElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/FlatButtonElement.java new file mode 100644 index 0000000..4f8dff7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/FlatButtonElement.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import net.minecraft.client.gui.Gui; + +public class FlatButtonElement extends AbstractElement { + private String string; + + public FlatButtonElement(String string) { + this.string = string; + } + + @Override + public void handleElementDraw(float f, float f2, boolean hovering) { + this.drawButton(this.string, f, f2, hovering); + } + + public void drawButton(String string, float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, bl && this.isMouseInside(f, f2) ? -16747106 : -13158601); + CheatBreaker.getInstance().playRegular14px.drawCenteredString(string, this.xPosition + this.width / 2.0f, this.yPosition + this.height / 2.0f - (float)5, -1); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } + + public String getString() { + return this.string; + } + + public void setText(String string) { + this.string = string; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/HorizontalSliderElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/HorizontalSliderElement.java new file mode 100644 index 0000000..234e4c0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/HorizontalSliderElement.java @@ -0,0 +1,70 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.ui.fading.AbstractFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import net.minecraft.client.gui.Gui; +import com.cheatbreaker.client.module.data.Setting; +import org.lwjgl.input.Mouse; + +public class HorizontalSliderElement extends AbstractElement { + private final Setting setting; + private final AbstractFade fadeTime; + private Number value; + + public HorizontalSliderElement(Setting setting) { + this.setting = setting; + this.fadeTime = new MinMaxFade(300L); + this.value = (Number)setting.getValue(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + if (!this.fadeTime.isTimeNotAtZero()) { + this.value = (Number)this.setting.getValue(); + } + float f3 = ((Number)this.setting.getValue()).floatValue(); + float f4 = ((Number)this.setting.getMinimumValue()).floatValue(); + float f5 = ((Number)this.setting.getMaximumValue()).floatValue(); + float f6 = f3 - this.value.floatValue(); + float f7 = (float)100 * ((this.value.floatValue() + f6 * this.fadeTime.getFadeAmount() - f4) / (f5 - f4)); + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width / (float)100 * f7, this.yPosition + this.height, -52429); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + if (Mouse.isButtonDown(0) && this.isMouseInside(f, f2)) { + this.fadeTime.startAnimation(); + this.value = (Number)this.setting.getValue(); + float f3 = ((Number)this.setting.getMinimumValue()).floatValue(); + float f4 = ((Number)this.setting.getMaximumValue()).floatValue(); + if (f - this.xPosition > this.width / 2.0f) { + f += 2.0f; + } + float f5 = f3 + (f - this.xPosition) * ((f4 - f3) / this.width); + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(this.setValue(Integer.parseInt((int)f5 + ""))); + break; + case FLOAT: + this.setting.setValue(this.setValue(f5)); + break; + case DOUBLE: + this.setting.setValue(this.setValue(Double.parseDouble((double)f5 + ""))); + } + } + return super.handleElementMouseClicked(f, f2, n, bl); + } + + private Object setValue(Object object) { + try { + return object; + } catch (ClassCastException classCastException) { + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ImageButtonElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ImageButtonElement.java new file mode 100644 index 0000000..c33943e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ImageButtonElement.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.ui.element.type; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ImageButtonElement extends GuiButton { + private boolean lIIIIlIIllIIlIIlIIIlIIllI = true; + private ResourceLocation image; + + public ImageButtonElement(int n, ResourceLocation image, int n2, int n3, int n4, int n5, String string, boolean bl) { + this(n, n2, n3, n4, n5, string); + this.lIIIIlIIllIIlIIlIIIlIIllI = bl; + this.image = image; + } + + public ImageButtonElement(int n, int n2, int n3, int n4, int n5, String string) { + super(n, n2, n3, n4, n5, string); + } + + @Override + public void drawButton(Minecraft mc, int n, int n2) { + if (this.field_146125_m) { + FontRenderer fontRenderer = mc.fontRenderer; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.field_146123_n = n >= this.field_146128_h && n2 >= this.field_146129_i && n < this.field_146128_h + this.field_146120_f && n2 < this.field_146129_i + this.field_146121_g; + int n3 = this.getHoverState(this.field_146123_n); + if (this.lIIIIlIIllIIlIIlIIIlIIllI) { + Gui.drawRect(this.field_146128_h, this.field_146129_i, this.field_146128_h + this.field_146120_f, this.field_146129_i + this.field_146121_g, this.field_146123_n ? -15395563 : -14540254); + } + this.mouseDragged(mc, n, n2); + int n4 = -3092272; + if (!this.enabled) { + n4 = -986896; + } else if (this.field_146123_n) { + n4 = -1; + } + CheatBreaker.getInstance().playRegular16px.drawCenteredString(this.displayString, this.field_146128_h + this.field_146120_f / 2, this.field_146129_i + this.field_146121_g / 2 - (this.lIIIIlIIllIIlIIlIIIlIIllI ? 6 : 5), n4); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0363636f * 0.2894737f); + RenderUtil.renderIcon(this.image, 7.0F, (float)(this.field_146128_h + this.field_146120_f - 20), (float)(this.field_146129_i + 5)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/InputFieldElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/InputFieldElement.java new file mode 100644 index 0000000..7ff4efd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/InputFieldElement.java @@ -0,0 +1,485 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.client.renderer.Tessellator; +import org.lwjgl.opengl.GL11; + +public class InputFieldElement extends AbstractElement { + private final CBFontRenderer font; + private String text = ""; + private int maxStringLength = 32; + private int cursorCounter; + private boolean enableBackgroundDrawing = true; + private boolean canLoseFocus = true; + private boolean isFocused; + private boolean isEnabled = true; + private int lineScrollOffset; + private int cursorPosition; + private int selectionEnd; + private int enabledColor = 0xE0E0E0; + private int disabledColor = 0x707070; + private boolean visible = true; + private final int color1; + private final int color2; + private final String label; + + public InputFieldElement(CBFontRenderer font, String label, int color1, int color2) { + this.font = font; + this.label = label; + this.color1 = color1; + this.color2 = color2; + } + + public void updateCursorCounter() { + ++this.cursorCounter; + } + + public void setText(String string) { + this.text = string.length() > this.maxStringLength ? string.substring(0, this.maxStringLength) : string; + this.setCursorPositionEnd(); + } + + public String getText() { + return this.text; + } + + public String getSelectedText() { + int n = Math.min(this.cursorPosition, this.selectionEnd); + int n2 = Math.max(this.cursorPosition, this.selectionEnd); + return this.text.substring(n, n2); + } + + public void writeText(String string) { + int n; + String string2 = ""; + String string3 = ChatAllowedCharacters.filerAllowedCharacters(string); + int n2 = Math.min(this.cursorPosition, this.selectionEnd); + int n3 = Math.max(this.cursorPosition, this.selectionEnd); + int n4 = this.maxStringLength - this.text.length() - (n2 - this.selectionEnd); + boolean bl = false; + if (this.text.length() > 0) { + string2 = string2 + this.text.substring(0, n2); + } + if (n4 < string3.length()) { + string2 = string2 + string3.substring(0, n4); + n = n4; + } else { + string2 = string2 + string3; + n = string3.length(); + } + if (this.text.length() > 0 && n3 < this.text.length()) { + string2 = string2 + this.text.substring(n3); + } + this.text = string2; + this.moveCursorBy(n2 - this.selectionEnd + n); + } + + public void deleteWords(int n) { + if (this.text.length() != 0) { + if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { + this.deleteFromCursor(this.getNthWordFromCursor(n) - this.cursorPosition); + } + } + } + + public void deleteFromCursor(int n) { + if (this.text.length() != 0) { + if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { + boolean bl = n < 0; + int n2 = bl ? this.cursorPosition + n : this.cursorPosition; + int n3 = bl ? this.cursorPosition : this.cursorPosition + n; + String string = ""; + if (n2 >= 0) { + string = this.text.substring(0, n2); + } + if (n3 < this.text.length()) { + string = string + this.text.substring(n3); + } + this.text = string; + if (bl) { + this.moveCursorBy(n); + } + } + } + } + + public int getNthWordFromCursor(int n) { + return this.getNthWordFromPos(n, this.getCursorPosition()); + } + + public int getNthWordFromPos(int n, int n2) { + return this.func_146197_a(n, this.getCursorPosition(), true); + } + + public int func_146197_a(int n, int n2, boolean bl) { + int n3 = n2; + boolean bl2 = n < 0; + int n4 = Math.abs(n); + for (int i = 0; i < n4; ++i) { + if (bl2) { + while (bl && n3 > 0 && this.text.charAt(n3 - 1) == ' ') { + --n3; + } + while (n3 > 0 && this.text.charAt(n3 - 1) != ' ') { + --n3; + } + continue; + } + int n5 = this.text.length(); + if ((n3 = this.text.indexOf(32, n3)) == -1) { + n3 = n5; + continue; + } + while (bl && n3 < n5 && this.text.charAt(n3) == ' ') { + ++n3; + } + } + return n3; + } + + public void moveCursorBy(int n) { + this.setCursorPosition(this.selectionEnd + n); + } + + public void setCursorPosition(int n) { + this.cursorPosition = n; + int n2 = this.text.length(); + if (this.cursorPosition < 0) { + this.cursorPosition = 0; + } + if (this.cursorPosition > n2) { + this.cursorPosition = n2; + } + this.setSelectionPos(this.cursorPosition); + } + + public void setCursorPositionZero() { + this.setCursorPosition(0); + } + + public void setCursorPositionEnd() { + this.setCursorPosition(this.text.length()); + } + + public boolean textboxKeyTyped(char c, int n) { + if (!this.isFocused) { + return false; + } + switch (c) { + case '\u0001': + this.setCursorPositionEnd(); + this.setSelectionPos(0); + return true; + case '\u0003': + GuiScreen.setClipboardString(this.getSelectedText()); + return true; + case '\u0016': + if (this.isEnabled) { + this.writeText(GuiScreen.getClipboardString()); + } + return true; + case '\u0018': + GuiScreen.setClipboardString(this.getSelectedText()); + if (this.isEnabled) { + this.writeText(""); + } + return true; + } + switch (n) { + case 14: + if (GuiScreen.isCtrlKeyDown()) { + if (this.isEnabled) { + this.deleteWords(-1); + } + } else if (this.isEnabled) { + this.deleteFromCursor(-1); + } + return true; + case 199: + if (GuiScreen.isShiftKeyDown()) { + this.setSelectionPos(0); + } else { + this.setCursorPositionZero(); + } + return true; + case 203: //work? + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); + } else { + this.setSelectionPos(this.getSelectionEnd() - 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.setCursorPosition(this.getNthWordFromCursor(-1)); + } else { + this.moveCursorBy(-1); + } + return true; + case 205: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); + } else { + this.setSelectionPos(this.getSelectionEnd() + 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.setCursorPosition(this.getNthWordFromCursor(1)); + } else { + this.moveCursorBy(1); + } + return true; + case 207: + if (GuiScreen.isShiftKeyDown()) { + this.setSelectionPos(this.text.length()); + } else { + this.setCursorPositionEnd(); + } + return true; + case 211: + if (GuiScreen.isCtrlKeyDown()) { + if (this.isEnabled) { + this.deleteWords(1); + } + } else if (this.isEnabled) { + this.deleteFromCursor(1); + } + return true; + } + if (ChatAllowedCharacters.isAllowedCharacter(c)) { + if (this.isEnabled) { + this.writeText(Character.toString(c)); + } + return true; + } + return false; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + boolean bl2; + if (!bl) { + this.setFocused(false); + return true; + } + if (n == 1 && this.isMouseInside(f, f2)) { + this.setText(""); + } + boolean bl3 = bl2 = f >= this.xPosition && f < this.xPosition + this.width && f2 >= this.yPosition && f2 < this.yPosition + this.height; + + if (this.canLoseFocus) { + this.setFocused(bl2); + } + if (this.isFocused && n == 0) { + float f3 = f - this.xPosition; + if (this.enableBackgroundDrawing) { + f3 -= (float)4; + } + String string = this.font.setWrapWords(this.text.substring(this.lineScrollOffset), this.IIIIIIlIlIlIllllllIlllIlI()); + this.setCursorPosition(this.font.setWrapWords(string, f3).length() + this.lineScrollOffset); + } + return false; + } + + public void drawElement() { + if (this.getVisible()) { + if (this.getEnableBackgroundDrawing()) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.color1); + } + int n = this.isEnabled ? this.enabledColor : this.disabledColor; + int n2 = this.cursorPosition - this.lineScrollOffset; + int n3 = this.selectionEnd - this.lineScrollOffset; + String string = this.font.setWrapWords(this.text.substring(this.lineScrollOffset), this.IIIIIIlIlIlIllllllIlllIlI()); + boolean bl = n2 >= 0 && n2 <= string.length(); + boolean bl2 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && bl; + float f = this.enableBackgroundDrawing ? this.xPosition + (float)4 : this.xPosition; + float f2 = this.enableBackgroundDrawing ? this.yPosition + (this.height - (float)8) / 2.0f : this.yPosition; + float f3 = f; + if (n3 > string.length()) { + n3 = string.length(); + } + if (string.length() > 0) { + String string2 = bl ? string.substring(0, n2) : string; + f3 = this.font.drawString(string2, f, f2, n); + } else if (!this.isFocused()) { + this.font.drawString(this.label, f, f2, n); + } + boolean bl3 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); + float f4 = f3; + if (!bl) { + f4 = n2 > 0 ? f + this.width : f; + } else if (bl3) { + f4 = f3 - 1.0f; + f3 -= 1.0f; + } + if (string.length() > 0 && bl && n2 < string.length()) { + this.font.drawString(string.substring(n2), f3, f2, n); + } + if (bl2) { + if (bl3) { + Gui.drawRect(f4, f2 - 1.0f, f4 + 1.0f, f2 + 1.0f + (float)this.font.getHeight(), -3092272); + } else { + this.font.drawString("_", f4, f2, n); + } + } + if (n3 != n2) { + float f5 = f + (float)this.font.getStringWidth(string.substring(0, n3)); + this.drawCursorVertical(f4, f2 - 1.0f + 2.0f, f5 - 1.0f, f2 + 1.0f + (float)this.font.getHeight() + 2.0f); + } + } + } + + private void drawCursorVertical(float f, float f2, float f3, float f4) { + float f5; + if (f < f3) { + f5 = f; + f = f3; + f3 = f5; + } + if (f2 < f4) { + f5 = f2; + f2 = f4; + f4 = f5; + } + if (f3 > this.xPosition + this.width) { + f3 = this.xPosition + this.width; + } + if (f > this.xPosition + this.width) { + f = this.xPosition + this.width; + } + Tessellator tessellator = Tessellator.instance; + GL11.glColor4f(0.0f, 0.0f, 255, 255); + GL11.glDisable(3553); + GL11.glEnable(3058); + GL11.glLogicOp(5387); + tessellator.startDrawingQuads(); + tessellator.addVertex(f, f4, 0.0); + tessellator.addVertex(f3, f4, 0.0); + tessellator.addVertex(f3, f2, 0.0); + tessellator.addVertex(f, f2, 0.0); + tessellator.draw(); + GL11.glDisable(3058); + GL11.glEnable(3553); + } + + public void setMaxStringLength(int limit) { + this.maxStringLength = limit; + if (this.text.length() > limit) { + this.text = this.text.substring(0, limit); + } + } + + public int getMaxStringLength() { + return this.maxStringLength; + } + + public int getCursorPosition() { + return this.cursorPosition; + } + + public boolean getEnableBackgroundDrawing() { + return this.enableBackgroundDrawing; + } + + public void setEnableBackgroundDrawing(boolean bl) { + this.enableBackgroundDrawing = bl; + } + + public void setTextColor(int color) { + this.enabledColor = color; + } + + public void setDisabledTextColour(int color) { + this.disabledColor = color; + } + + public void setFocused(boolean bl) { + if (bl && !this.isFocused) { + this.cursorCounter = 0; + } + this.isFocused = bl; + } + + public boolean isFocused() { + return this.isFocused; + } + + public void setEnabled(boolean bl) { + this.isEnabled = bl; + } + + public int getSelectionEnd() { + return this.selectionEnd; + } + + public float IIIIIIlIlIlIllllllIlllIlI() { + return this.getEnableBackgroundDrawing() ? this.width - (float)8 : this.width; + } + + public void setSelectionPos(int n) { + int n2 = this.text.length(); + if (n > n2) { + n = n2; + } + if (n < 0) { + n = 0; + } + this.selectionEnd = n; + if (this.font != null) { + if (this.lineScrollOffset > n2) { + this.lineScrollOffset = n2; + } + float f = this.IIIIIIlIlIlIllllllIlllIlI(); + String string = this.font.setWrapWords(this.text.substring(this.lineScrollOffset), f); + int n3 = string.length() + this.lineScrollOffset; + if (n == this.lineScrollOffset) { + this.lineScrollOffset -= this.font.wrapWords(this.text, f, true).length(); + } + if (n > n3) { + this.lineScrollOffset += n - n3; + } else if (n <= this.lineScrollOffset) { + this.lineScrollOffset -= this.lineScrollOffset - n; + } + if (this.lineScrollOffset < 0) { + this.lineScrollOffset = 0; + } + if (this.lineScrollOffset > n2) { + this.lineScrollOffset = n2; + } + } + } + + public void setCanLoseFocus(boolean bl) { + this.canLoseFocus = bl; + } + + public boolean getVisible() { + return this.visible; + } + + public void setVisible(boolean bl) { + this.visible = bl; + } + + @Override + public void handleElementUpdate() { + this.updateCursorCounter(); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + this.drawElement(); + } + + @Override + public void keyTyped(char c, int n) { + this.textboxKeyTyped(c, n); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/LabelElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/LabelElement.java new file mode 100644 index 0000000..0b11fc2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/LabelElement.java @@ -0,0 +1,27 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import net.minecraft.client.gui.Gui; +import com.cheatbreaker.client.module.data.Setting; + +public class LabelElement extends AbstractModulesGuiElement { + + public LabelElement(Setting label, float scaleFactor) { + super(scaleFactor); + this.setting = label; + this.height = 12; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(((String)this.setting.getValue()).toUpperCase(), this.x + 2, (float)(this.y + 2), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + Gui.drawRect(this.x + 2, this.y + this.height - 1, this.x + this.width / 2 - 20, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor3 : CBTheme.lightDullTextColor3); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ScrollableElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ScrollableElement.java new file mode 100644 index 0000000..80697d0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ScrollableElement.java @@ -0,0 +1,221 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.gui.Gui; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class ScrollableElement extends AbstractElement { + @Getter protected final AbstractElement abstractElement; + protected double internalScrollAmount; + @Getter protected float position; + @Setter protected float scrollAmount; + @Getter protected boolean hovering; + protected boolean drawing; // only gets set to true when its actually drawing + protected float oldTranslateY; + @Getter private boolean buttonHeld; + + public ScrollableElement(AbstractElement var1) { + this.abstractElement = var1; + } + + public boolean isMouseInside(float var1, float var2) { + return var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition && var2 < this.yPosition + this.height; + } + + public void handleElementDraw(float var1, float var2, boolean var3) { + this.drawing = true; + GL11.glPopMatrix(); + boolean var4 = this.isAtBottom(); + if (this.hovering && (!Mouse.isButtonDown(0) || !this.isMouseInside(var1, var2) || !var3)) { + this.hovering = false; + } + + if (this.buttonHeld && !Mouse.isButtonDown(0)) { + this.buttonHeld = false; + } + + float var5 = this.height; + float var6 = this.scrollAmount; + float var7 = var5 / var6 * (float)100; + float var8 = var5 / (float)100 * var7; + float var9 = this.position / (float)100 * var7; + float yPos; + if (Mouse.isButtonDown(0) && this.buttonHeld) { + yPos = var2 - this.yPosition; + float var11 = yPos / this.height; + this.position = -(this.scrollAmount * var11) + var8 / 2.0F; + } + + if (var4) { + yPos = this.height; + boolean var13 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition - var9 && var2 < this.yPosition + var8 - var9; + boolean var12 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition && var2 < this.yPosition + var5 - (float)3; + if (Mouse.isButtonDown(0) && !this.hovering && var12) { + // ??? + } + + if (this.hovering) { + if (this.position != this.oldTranslateY && this.oldTranslateY != var8 / 2.0F && this.oldTranslateY != var8 / 2.0F + -this.scrollAmount + yPos) { + if (var2 > this.yPosition + var8 - var8 / (float)4 - var9) { + this.position -= var6 / (float)7; + } else if (var2 < this.yPosition + var8 / (float)4 - var9) { + this.position += var6 / (float)7; + } + + this.oldTranslateY = this.position; + } else if (var2 > this.yPosition + var8 - var8 / (float)4 - var9 || var2 < this.yPosition + var8 / (float)4 - var9) { + this.oldTranslateY = 1.0F; + } + } + + if (this.position < -this.scrollAmount + yPos) { + this.position = -this.scrollAmount + yPos; + this.internalScrollAmount = 0.0D; + } + + if (this.position > 0.0F) { + this.position = 0.0F; + this.internalScrollAmount = 0.0D; + } + + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + Gui.drawRect(this.xPosition, this.yPosition - var9, this.xPosition + this.width, this.yPosition + var8 - var9, !var13 && !this.hovering ? -4180940 : -52429); + } + + if (!var4 && this.position != 0.0F) { + this.position = 0.0F; + } + + } + + public void drawScrollable(float f, float f2, boolean bl) { + if (bl && (this.abstractElement == null || this.abstractElement.isMouseInside(f, f2)) && this.internalScrollAmount != 0.0) { + this.position = (float)((double)this.position + this.internalScrollAmount / (double)8); + this.internalScrollAmount = 0.0; + } + + if (this.drawing) { + if (this.position < -this.scrollAmount + this.height) { + this.position = -this.scrollAmount + this.height; + this.internalScrollAmount = 0.0; + } + if (this.position > 0.0f) { + this.position = 0.0f; + this.internalScrollAmount = 0.0; + } + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0f, this.position, 0.0f); + } + + // Naming is temporary. This is checking for a specific issue. + public void drawElementHoverNotOverride(float var1, float var2, boolean var3) { + this.drawing = true; + GL11.glPopMatrix(); + boolean var4 = this.isAtBottom(); + if (this.hovering && (!Mouse.isButtonDown(0) || !this.isMouseInside(var1, var2) || !var3)) { + this.hovering = false; + } + + if (this.buttonHeld && !Mouse.isButtonDown(0)) { + this.buttonHeld = false; + } + + float var5 = this.height; + float var6 = this.scrollAmount; + float var7 = var5 / var6 * (float)100; + float var8 = var5 / (float)100 * var7; + float var9 = this.position / (float)100 * var7; + float var10; + if (Mouse.isButtonDown(0) && this.buttonHeld) { + var10 = var2 - this.yPosition; + float var11 = var10 / this.height; + this.position = -(this.scrollAmount - this.height / 2.0F) + this.scrollAmount * var11 + var8 / 2.0F; + } + + if (var4) { + var10 = this.height; + boolean var13 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition - var9 && var2 < this.yPosition + var8 - var9; + boolean var12 = var1 >= this.xPosition && var1 <= this.xPosition + this.width && var2 > this.yPosition && var2 < this.yPosition + var5 - (float)3; + if (Mouse.isButtonDown(0) && !this.hovering && var12) { + // ??? + } + + if (this.hovering) { + if (this.position != this.oldTranslateY && this.oldTranslateY != var8 / 2.0F && this.oldTranslateY != var8 / 2.0F + -this.scrollAmount + var10) { + if (var2 > this.yPosition + this.height - var8 - var8 / (float)4 + var9) { + this.position = var6 / (float)7; + } else if (var2 < this.yPosition + this.height - var8 / (float)4 + var9) { + this.position += var6 / (float)7; + } + + this.oldTranslateY = this.position; + } else if (var2 > this.yPosition + this.height - var8 - var8 / (float)4 + var9 || var2 < this.yPosition + this.height - var8 / (float)4 - var9) { + this.oldTranslateY = 1.0F; + } + } + + if (this.position < -this.scrollAmount + var10) { + this.position = -this.scrollAmount + var10; + this.internalScrollAmount = 0.0D; + } + + if (this.position > 0.0F) { + this.position = 0.0F; + this.internalScrollAmount = 0.0D; + } + + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13158601); + Gui.drawRect(this.xPosition, this.yPosition + this.height + var9, this.xPosition + this.width, this.yPosition + this.height - var8 + var9, !var13 && !this.hovering ? -4180940 : -52429); + } + + if (!var4 && this.position != 0.0F) { + this.position = 0.0F; + } + } + + public void onScroll(float var1, float var2, boolean var3) { + if (var3 && (this.abstractElement == null || this.abstractElement.isMouseInside(var1, var2)) && this.internalScrollAmount != 0.0D) { + this.position = (float)((double)this.position - this.internalScrollAmount / (double)8); + this.internalScrollAmount = 0.0D; + } + + if (this.drawing) { + if (this.position < -this.scrollAmount + this.height) { + this.position = -this.scrollAmount + this.height; + this.internalScrollAmount = 0.0D; + } + + if (this.position > 0.0F) { + this.position = 0.0F; + this.internalScrollAmount = 0.0D; + } + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -this.position, 0.0F); + } + + public boolean isAtBottom() { + return this.scrollAmount > this.height; + } + + public boolean handleElementMouseClicked(float var1, float var2, int var3, boolean var4) { + if (this.isMouseInside(var1, var2) && var4) { + this.buttonHeld = true; + } + return false; + } + + public void handleElementMouse() { + int var1 = Mouse.getEventDWheel(); + if (var1 != 0 && this.scrollAmount >= this.height) { + this.internalScrollAmount += (float)var1 / (0.48387095F * 3.6166668F); + } + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/SliderElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/SliderElement.java new file mode 100644 index 0000000..6dde9c0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/SliderElement.java @@ -0,0 +1,91 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class SliderElement extends AbstractModulesGuiElement { + private final Setting setting; + private float settingValue = -1; + private float value; + private boolean interacting = false; + + public SliderElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.height = 14; + this.settingValue = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl = (float) mouseX > (float)(this.x + 170) * this.scale && (float) mouseX < (float)(this.x + 170 + 170 - 2) * this.scale && (float) mouseY > (float)(this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + if (button == 0 && bl) { + this.interacting = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + float f2; + float f3; + int n3 = 148; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), -1895825408); + if (this.interacting && !Mouse.isButtonDown(0)) { + this.interacting = false; + } + String string = this.setting.getValue().toString(); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(string, this.x + 169 - (float)CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(string), (float)(this.y + 2), -1895825408); + boolean bl = (float) mouseX > (float)(this.x + 172) * this.scale && (float) mouseX < (float)(this.x + 172 + n3 - 2) * this.scale && (float)mouseY > (float)(this.y + 4 + this.yOffset) * this.scale && (float)mouseY < (float)(this.y + 10 + this.yOffset) * this.scale; + RenderUtil.drawRoundedRect(this.x + 174, this.y + 6, this.x + 170 + n3 - 4, this.y + 8, 1.0, bl ? -1895825408 : 0x6F000000); + double d = n3 - 18; + float minimumValue = Float.parseFloat("" + this.setting.getMinimumValue()); + float maximumValue = Float.parseFloat("" + this.setting.getMaximumValue()); + if (this.interacting) { + this.value = (float)Math.round(((double)minimumValue + (double)((float) mouseX - (float)(this.x + 180) * this.scale) * ((double)(maximumValue - minimumValue) / (d * (double)this.scale))) * (double)100) / (float)100; + if (this.setting.getType().equals(SettingType.INTEGER) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + this.value = Math.round(this.value); + } + if (this.value < minimumValue) { + this.value = minimumValue; + } else if (this.value > maximumValue) { + this.value = maximumValue; + } + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(Integer.parseInt((int)this.value + "")); + break; + case FLOAT: + this.setting.setValue(this.value); + break; + case DOUBLE: + this.setting.setValue(Double.parseDouble(this.value + "")); + } + CheatBreaker.getInstance().getModuleManager().keystrokesMod.updateKeyElements(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146245_b(); + } + f3 = (f3 = Float.parseFloat(this.setting.getValue() + "")) < this.settingValue ? this.settingValue - f3 : (f3 -= this.settingValue); + float f6 = ((maximumValue - minimumValue) / (float)20 + f3 * (float)8) / (float)(Minecraft.debugFPS + 1); + if ((double)f6 < 43.5 * 2.2988505747126437E-6) { + f6 = 1.9523809f * 5.121951E-5f; + } + if (this.settingValue < (f2 = Float.parseFloat(this.setting.getValue() + ""))) { + this.settingValue = Math.min(this.settingValue + f6, f2); + } else if (this.settingValue > f2) { + this.settingValue = Math.max(this.settingValue - f6, f2); + } + double d2 = (float)100 * ((this.settingValue - minimumValue) / (maximumValue - minimumValue)); + RenderUtil.drawRoundedRect(this.x + 174, this.y + 6, (double)(this.x + 180) + d * d2 / (double)100, this.y + 8, 4, -12418828); + GL11.glColor4f(0.5714286f * 0.4375f, 0.45849055f * 0.9814815f, 1.0f, 1.0f); + RenderUtil.drawCircle((double)((float)this.x + 543.75f * 0.33333334f) + d * d2 / (double)100, (float)this.y + 0.6666667f * 10.875f, 2.531249981140718 * 1.7777777910232544); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.drawCircle((double)((float)this.x + 0.8804348f * 205.8642f) + d * d2 / (double)100, (float)this.y + 0.13043478f * 55.583332f, 2.639325754971479 * 1.0229885578155518); + drawDescription(this.setting, mouseX, mouseY); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/TextFieldElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/TextFieldElement.java new file mode 100644 index 0000000..efb4852 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/TextFieldElement.java @@ -0,0 +1,188 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.InputFieldElementPromptGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +public class TextFieldElement extends AbstractModulesGuiElement { + + @Getter private final ModulesGuiButtonElement keybindButton; + private boolean usingKeybind = false; + private boolean showKeybind = false; + @Getter private final InputFieldElement textInputBar; + + public TextFieldElement(Setting setting, float scaleFactor) { + super(scaleFactor); + this.setting = setting; + this.textInputBar = new InputFieldElement(CheatBreaker.getInstance().playBold18px, this.setting.getValue().toString(), 0, 0); + this.textInputBar.setMaxStringLength(256); + this.keybindButton = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, setting.isHasMouseBind() ? "Button " + (setting.getKeyCode() + 1) : Keyboard.getKeyName(setting.getKeyCode()), this.x + this.width - 100, this.y, 50, 18, -9442858, scale); + this.height = 18; + + if (setting.getSettingName().startsWith("Hotkey")) { + this.showKeybind = true; + } + } + + public void setDimensions(int x, int y, int width, int height) { + super.setDimensions(x, y, width, height); + this.textInputBar.setElementSize(this.x + (showKeybind ? 65 : 150), y + height - 14.0f, 166, 13.0f); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + if (this.usingKeybind && this.showKeybind && Keyboard.getEventKeyState()) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(this.setting.getSettingName()); + + for (Setting setting : CheatBreaker.getInstance().getModuleManager().autoTextMod.hotkeys) { + // Check if the key bind is already bound to another. + if (Keyboard.getEventKey() == setting.getKeyCode() || CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Keyboard.getEventKey())) { + this.clearKeybind(); + break; + } + } + + // Backspace clears the key bind. + if (Keyboard.getEventKey() == 14) { + this.clearKeybind(); + } + + // Set the key bind. + if (!this.keybindButton.optionString.equals("NONE")) { + if (this.keybindButton.conflict) + this.keybindButton.setConflict(false); + + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(Keyboard.getEventKey()); + this.keybindButton.optionString = Keyboard.getKeyName(this.setting.getKeyCode()); + this.usingKeybind = false; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + } + } + + if (this.usingKeybind && this.showKeybind && Mouse.getEventButton() != 0 && Mouse.getEventButtonState()) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(this.setting.getSettingName()); + + for (Setting setting : CheatBreaker.getInstance().getModuleManager().autoTextMod.hotkeys) { + // Check if the key bind is already bound to another. + if (Mouse.getEventButton() == setting.getKeyCode() || CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Mouse.getEventButton())) { + this.keybindButton.optionString = "NONE"; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(0); + this.usingKeybind = false; + break; + } + } + + // Backspace clears the key bind. + if (Keyboard.getEventKey() == 14) { + this.keybindButton.optionString = "NONE"; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(0); + this.usingKeybind = false; + } + + // Set the key bind. + if (!this.keybindButton.optionString.equals("NONE")) { + if (this.keybindButton.conflict) + this.keybindButton.setConflict(false); + this.setting.setKeyCode(Mouse.getEventButton()); + this.setting.setHasMouseBind(true); + this.keybindButton.optionString = "Button " + (this.setting.getKeyCode() + 1); + this.usingKeybind = false; + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + } + } + + if (this.showKeybind) { + this.keybindButton.yOffset = this.yOffset; + this.keybindButton.setDimensions(this.x + this.width - 110, this.y, 96, 18); + this.keybindButton.handleDrawElement(mouseX, mouseY, partialTicks); + } + + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + Gui.drawRect(this.x + (showKeybind ? 65 : 148), this.y + 16, this.x + this.width - (showKeybind ? 120 : 16), this.y + 17, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + this.textInputBar.setTextColor(GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + this.textInputBar.setEnableBackgroundDrawing(false); + this.textInputBar.drawElementHover(mouseX, mouseY, true); + + drawDescription(this.setting, mouseX, mouseY); + handleElementUpdate(); + } + + private void clearKeybind() { + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(""); + this.keybindButton.optionString = "NONE"; + this.setting.setHasMouseBind(false); + this.setting.setKeyCode(0); + this.usingKeybind = false; + } + + @Override + public void handleElementUpdate() { + this.textInputBar.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.textInputBar.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + + if (n == 1) { + this.textInputBar.setFocused(false); + return; + } + + super.keyTyped(c, n); + this.textInputBar.keyTyped(c, n); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.handleElementUpdate(); + this.textInputBar.handleElementMouseClicked(f, f2, n, bl); + return false; + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.keybindButton.isMouseInside(mouseX, mouseY) && this.showKeybind) { + if (!CheatBreaker.getInstance().getModuleManager().autoTextMod.getActiveKeybindName().equals("")) { + return; + } + + CheatBreaker.getInstance().getModuleManager().autoTextMod.setActiveKeybindName(this.setting.getSettingName()); + + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.usingKeybind = true; + this.keybindButton.optionString = ""; + } + + boolean hoveringOnTextElement = (float) mouseX > (float) this.x * this.scale && (float) mouseX < (float) (this.x + this.width - (showKeybind ? 120 : 40)) * this.scale && (float) mouseY > (float) (this.y + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + 18 + this.yOffset) * this.scale; + if (hoveringOnTextElement) { + Minecraft.getMinecraft().displayGuiScreen(new InputFieldElementPromptGui(this.setting, HudLayoutEditorGui.instance, this.scale)); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ToggleElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ToggleElement.java new file mode 100644 index 0000000..b813040 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/ToggleElement.java @@ -0,0 +1,83 @@ +package com.cheatbreaker.client.ui.element.type; + +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ToggleElement extends AbstractModulesGuiElement { +// private final Setting setting; + private final ResourceLocation rightArrowIcon = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation leftArrowIcon = new ResourceLocation("client/icons/right.png"); + private int optionValueIndex = 0; + private float animationSpeed = 0.0f; + private String optionValue; + + public ToggleElement(Setting setting, float scale) { + super(scale); + this.setting = setting; + this.height = 12; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean isXHovering = (float) mouseX > (this.x + this.width - 48.0f) * this.scale && (float) mouseX < (this.x + this.width - 10.0f) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + boolean isYHovering = (float) mouseX > (this.x + this.width - 92.0f) * this.scale && (float) mouseX < (this.x + this.width - 48.0f) * this.scale && (float)mouseY > (float)(this.y + this.yOffset) * this.scale && (float)mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), isYHovering || isXHovering ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor3 : CBTheme.lightTextColor3 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + if (this.optionValueIndex == 0) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((Boolean) this.setting.getValue() ? "ON" : "OFF", this.x + this.width - 48, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + boolean isOne = this.optionValueIndex == 1; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.optionValue, this.x + this.width - 48.0f - (isOne ? -this.animationSpeed : this.animationSpeed), this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + if (isOne) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((Boolean) this.setting.getValue() ? "ON" : "OFF", (float)(this.x + this.width - 98) + this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } else { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString((Boolean) this.setting.getValue() ? "ON" : "OFF", (float)(this.x + this.width + 2) - this.animationSpeed, this.y + 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + if (this.animationSpeed >= 50.0f) { + this.optionValueIndex = 0; + this.animationSpeed = 0.0f; + } else { + float f2 = HudLayoutEditorGui.getFPSTransitionSpeed(50.0f + this.animationSpeed * 15.0f); + this.animationSpeed = Math.min(this.animationSpeed + f2, 50.0f); + } + + Gui.drawRect(this.x + this.width - 130, this.y + 2, this.x + this.width - 72, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + Gui.drawRect(this.x + this.width - 22, this.y + 2, this.x + this.width + 4, this.y + 12, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkBackgroundColor4 : CBTheme.lightBackgroundColor); + } + + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isYHovering ? 0.8f : 0.45f); + RenderUtil.renderIcon(this.rightArrowIcon, 4.0f, this.x + this.width - 82.0f, this.y + 3.0f); + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, isXHovering ? 0.8f : 0.45f); + RenderUtil.renderIcon(this.leftArrowIcon, 4.0f, this.x + this.width - 22.0f, this.y + 3.0f); + drawDescription(this.setting, mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean bl = (float) mouseX > (this.x + this.width - 92.0f) * this.scale && (float) mouseX < (this.x + this.width - 48.0f) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + boolean bl2 = (float) mouseX > (this.x + this.width - 48.0f) * this.scale && (float) mouseX < (this.x + this.width - 10.0f) * this.scale && (float) mouseY > (float)(this.y + this.yOffset) * this.scale && (float) mouseY < (this.y + 10.0f + this.yOffset) * this.scale; + + if ((bl || bl2) && this.optionValueIndex == 0) { + this.optionValueIndex = bl ? 1 : 2; + this.animationSpeed = 0.0f; + this.optionValue = (Boolean) this.setting.getValue() ? "ON" : "OFF"; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.setting.setValue(!((Boolean) this.setting.getValue())); + if (this.setting == CheatBreaker.getInstance().getGlobalSettings().enableTeamView && !(Boolean) CheatBreaker.getInstance().getGlobalSettings().enableTeamView.getValue()) { + CheatBreaker.getInstance().getModuleManager().teammatesMod.setEnabled(false); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/CrosshairElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/CrosshairElement.java new file mode 100644 index 0000000..00edcf0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/CrosshairElement.java @@ -0,0 +1,28 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class CrosshairElement extends AbstractModulesGuiElement { + public CrosshairElement(float scaleFactor) { + super(scaleFactor); + this.height = 50; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + Gui.drawRect(this.x + (this.width / 2 - 15) - 41, this.y + 4, this.x + (this.width / 2 - 15) + 41, this.y + 51, -16777216); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(new ResourceLocation("client/defaults/crosshair_" + CheatBreaker.getInstance().getModuleManager().crosshairMod.previewBackground.getStringValue().toLowerCase() + ".png"), (float)(this.x + (this.width / 2 - 15) - 40), (float)(this.y + 5), (float)80, 45); + Gui.zLevel = 0; + CheatBreaker.getInstance().getModuleManager().crosshairMod.drawCrosshair(this.x + this.width / 2 - 15, this.y + this.height / 2 + 3, false); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/ExcludePotionsElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/ExcludePotionsElement.java new file mode 100644 index 0000000..02ade1b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/ExcludePotionsElement.java @@ -0,0 +1,120 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.potion.Potion; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +public class ExcludePotionsElement extends AbstractModulesGuiElement { + private final List list2 = new ArrayList<>(); + + public ExcludePotionsElement(Setting setting, float scale) { + super(scale); + this.height = 50; + this.setting = setting; + list(); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 2), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + Minecraft mc = Minecraft.getMinecraft(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + int n3 = 0; + int n4 = 0; + for (Potion item : list2) { +// Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n3 >= 15) { + n3 = 0; + ++n4; + } + int n5 = this.x + 12 + n3 * 20; + int n6 = this.y + 14 + n4 * 20; + boolean hovering = (float) mouseX > (float)(n5 - 2) * this.scale && (float) mouseX < (float)(n5 + 18) * this.scale && (float)mouseY > (float)(n6 - 2 + this.yOffset) * this.scale && (float)mouseY < (float)(n6 + 18 + this.yOffset) * this.scale; + if (this.setting.getArrayListValue().contains(item.id)) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x7F00FF00); + } else if (hovering) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x4F0000FF); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/inventory.png")); + int n7 = item.getStatusIconIndex(); + RenderUtil.drawTexturedModalRect(n5 - 1, (float) n6 - 1, (float) (n7 % 8 * 18), (float) (198 + n7 / 8 * 18), 18, 18); + ++n3; + } + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GL11.glDisable(3042); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + try { + int n5 = 0; + int n6 = 0; + for (Integer item : (Integer[]) setting.getAcceptedValues()) { +// Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n5 >= 15) { + n5 = 0; + ++n6; + } + int n7 = this.x + 12 + n5 * 20; + int n8 = this.y + 14 + n6 * 20; + boolean bl = (float) mouseX > (float)(n7 - 2) * this.scale && (float) mouseX < (float)(n7 + 18) * this.scale && (float) mouseY > (float)(n8 - 2 + this.yOffset) * this.scale && (float) mouseY < (float)(n8 + 18 + this.yOffset) * this.scale; + if (bl && button == 0) { + int n9 = item; + if (((List) this.setting.getValue()).contains(n9)) { + ((List) this.setting.getValue()).removeIf(n2 -> n2 == n9); + } else { + this.setting.getArrayListValue().add(n9); + } + setting.setValue(this.setting.getArrayListValue()); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + ++n5; + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + public void list() { + list2.add(Potion.moveSpeed); + list2.add(Potion.moveSlowdown); + list2.add(Potion.digSpeed); + list2.add(Potion.digSlowdown); + list2.add(Potion.damageBoost); + list2.add(Potion.jump); + list2.add(Potion.confusion); + list2.add(Potion.regeneration); + list2.add(Potion.resistance); + list2.add(Potion.fireResistance); + list2.add(Potion.waterBreathing); + list2.add(Potion.invisibility); + list2.add(Potion.blindness); + list2.add(Potion.nightVision); + list2.add(Potion.hunger); + list2.add(Potion.weakness); + list2.add(Potion.poison); + list2.add(Potion.wither); + list2.add(Potion.field_76444_x); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/GlobalSettingsElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/GlobalSettingsElement.java new file mode 100644 index 0000000..c14c91a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/GlobalSettingsElement.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GlobalSettingsElement extends AbstractModulesGuiElement { + private final int highlightColor; + private final AbstractScrollableElement scrollbar; + private int progressiveRect = 0; + private final ResourceLocation arrowIcon = new ResourceLocation("client/icons/right.png"); + + public GlobalSettingsElement(AbstractScrollableElement scrollbar, int highlightColor, float scale) { + super(scale); + this.scrollbar = scrollbar; + this.highlightColor = highlightColor; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + boolean bl = this.isMouseInside(mouseX, mouseY); + int n3 = 75; + Gui.drawRect(this.x, this.y + this.height - 1, this.x + this.width, this.y + this.height, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor : CBTheme.lightDullTextColor); + float f2 = HudLayoutEditorGui.getFPSTransitionSpeed(790); + if (bl) { + if (this.progressiveRect < n3) { + this.progressiveRect = (int)((float)this.progressiveRect + f2); + if (this.progressiveRect > n3) { + this.progressiveRect = n3; + } + } + } else if (this.progressiveRect > 0) { + this.progressiveRect = (float)this.progressiveRect - f2 < 0.0f ? 0 : (int)((float)this.progressiveRect - f2); + } + if (this.progressiveRect > 0) { + float f3 = (float)this.progressiveRect / (float)n3 * 100.0F; + Gui.drawRect(this.x, (int)((float)this.y + ((float)this.height - (float)this.height * f3 / (float)100)), this.x + this.width, this.y + this.height, this.highlightColor); + } + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 1.4666667f * 0.23863636f); + RenderUtil.renderIcon(this.arrowIcon, 2.2f * 1.1363636f, (float)(this.x + 6), (float)this.y + (float)6); + CheatBreaker.getInstance().playBold18px.drawString("CheatBreaker Settings".toUpperCase(), (float)this.x + 14.0F, (float)this.y + 3.0F, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkDullTextColor2 : CBTheme.lightDullTextColor2); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/KeybindElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/KeybindElement.java new file mode 100644 index 0000000..3c8bbe1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/KeybindElement.java @@ -0,0 +1,83 @@ +package com.cheatbreaker.client.ui.element.type.custom; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import com.cheatbreaker.client.module.data.Setting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import javax.management.Notification; +import java.util.Set; + +public class KeybindElement extends AbstractModulesGuiElement { +// private final Setting setting; + @Getter private final ModulesGuiButtonElement button; + private boolean using = false; + + public KeybindElement(Setting setting, float scale) { + super(scale); + this.setting = setting; + this.height = 15; + this.button = new ModulesGuiButtonElement(CheatBreaker.getInstance().playBold18px, null, setting.isHasMouseBind() ? "Button " + (setting.getIntegerValue() + 1) : Keyboard.getKeyName(setting.getIntegerValue()), this.x + this.width - 100, this.y, 96, 18, -9442858, scale); + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float)(this.y + 4), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + + if (this.using && Keyboard.getEventKeyState()) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + + if (Keyboard.getKeyName(Keyboard.getEventKey()).equalsIgnoreCase("Back") || CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Keyboard.getEventKey())) { + this.setting.setValue(0); + this.button.optionString = "NONE"; + this.setting.setHasMouseBind(false); + this.using = false; + return; + } + + this.setting.setValue(Keyboard.getEventKey()); + this.setting.setHasMouseBind(false); + this.button.optionString = Keyboard.getKeyName((Integer)this.setting.getValue()); + this.using = false; + } + + if (this.using && Mouse.getEventButton() != 0 && Mouse.getEventButtonState()) { + if (CheatBreaker.getInstance().getModuleManager().isBoundToAnother(this.setting, Mouse.getEventButton())) { + this.setting.setValue(0); + this.button.optionString = "NONE"; + this.setting.setHasMouseBind(false); + this.using = false; + return; + } + + this.setting.setValue(Mouse.getEventButton()); + this.setting.setHasMouseBind(true); + this.button.optionString = "Button " + (this.setting.getIntegerValue() + 1); + this.using = false; + } + + this.button.yOffset = this.yOffset; + this.button.setDimensions(this.x + this.width - 110, this.y, 96, 18); + this.button.handleDrawElement(mouseX, mouseY, partialTicks); + drawDescription(this.setting, mouseX, mouseY); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + if (this.button.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.using = true; + this.button.optionString = ""; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/NewSliderElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/NewSliderElement.java new file mode 100644 index 0000000..96e3cc5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/NewSliderElement.java @@ -0,0 +1,167 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class NewSliderElement extends AbstractModulesGuiElement { +// private final Setting setting; + private float settingValue = -1; + private float value; + private boolean interacting = false; + private final ResourceLocation sunIcon = new ResourceLocation("client/icons/sun-64.png"); + private final ResourceLocation moonIcon = new ResourceLocation("client/icons/moon-64.png"); + + private final ResourceLocation volumeMuteIcon = new ResourceLocation("client/icons/volume-mute-64.png"); + private final ResourceLocation volumeUpIcon = new ResourceLocation("client/icons/volume-up-64.png"); + + private final ResourceLocation circleIcon = new ResourceLocation("client/icons/circle-64.png"); + private final ResourceLocation circleHollowIcon = new ResourceLocation("client/icons/circle-hollow-64.png"); + + private final ResourceLocation letterIcon = new ResourceLocation("client/icons/letter-t-64.png"); + + private boolean hasIcon = false; + private boolean hasCenterLabel = false; + + public NewSliderElement(Setting setting, float f) { + super(f); + this.setting = setting; + this.height = 22; + this.settingValue = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + int n4 = 170; + int ff = 20; + if (this.height == 12) ff = 10; + boolean hovering = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + 148 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + ff + this.yOffset) * this.scale; + if (button == 0 && hovering) { + this.interacting = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + float f2; + float f3; + int n3 = 148; + if (this.interacting && !Mouse.isButtonDown(0)) { + this.interacting = false; + } + float yPos = 8; + float yPos2 = 16; + float yPos3 = 17.25f; + int ff = 20; + + + if (!this.setting.getCenterLabel().isEmpty()) { + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString(this.setting.getCenterLabel(), this.x + 172 + n3 / 2, this.y - 2, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + Gui.drawRect((float) (this.x + 172 + n3 / 2) - 0.5f, this.y + 8, (float) (this.x + 172 + n3 / 2) + 0.5f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasCenterLabel = true; + } + float darkOrLight = GlobalSettings.darkMode.getBooleanValue() ? 1.0F : 0.0F; + GL11.glColor4f(darkOrLight, darkOrLight, darkOrLight, 0.43f); + if (!this.setting.getLeftIcon().isEmpty() && !this.setting.getRightIcon().isEmpty()) { + RenderUtil.renderIcon(new ResourceLocation("client/icons/" + this.setting.getLeftIcon() + ".png"), (float) (this.x + 180) - 5.0F, (float) (this.y + 3), 10.0f, 10.0f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + RenderUtil.renderIcon(new ResourceLocation("client/icons/" + this.setting.getRightIcon() + ".png"), (float) (this.x + 170 + n3 - 10.0f) - (float) 5, (float) (this.y + 3), (float) 10.0f, 10.0f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } else if (this.setting.getSettingName().endsWith("Opacity")) { + RenderUtil.renderIcon(this.circleHollowIcon, (float) (this.x + 180) - 4.0f, (float) (this.y + 3), 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + RenderUtil.renderIcon(this.circleIcon, (float) (this.x + 170 + n3 - 7.5f) - (float) 6.5f, (float) (this.y + 3), (float) 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } else if (this.setting.getSettingName().endsWith("Volume")) { + RenderUtil.renderIcon(this.volumeMuteIcon, (float) (this.x + 180) - 3.25f, (float) (this.y + 3), 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + RenderUtil.renderIcon(this.volumeUpIcon, (float) (this.x + 170 + n3 - 7.5f) - (float) 5, (float) (this.y + 3), (float) 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } else if (this.setting.getSettingName().equals("World Time")) { + RenderUtil.renderIcon(this.moonIcon, (float) (this.x + 180) - 3.25f, (float) (this.y + 3), 7.5f, 7.5f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + RenderUtil.renderIcon(this.sunIcon, (float) (this.x + 170 + n3 - 10) - (float) 5, (float) (this.y + 2), (float) 10, 10); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } if (this.setting.getSettingName().endsWith("Scale") || this.setting.getSettingName().endsWith("Scale Multiplier")) { + RenderUtil.renderIcon(this.letterIcon, (float) (this.x + 180) - 3.0f, (float) (this.y + 4), 6.0f, 6.0f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + RenderUtil.renderIcon(this.letterIcon, (float) (this.x + 170 + n3 - 10) - (float) 4, (float) (this.y + 2.5f), (float) 8.0f, 8.0f); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + this.hasIcon = true; + } + if (!this.hasIcon && !this.hasCenterLabel) { + this.height = 12; + yPos = 2; + yPos2 = 6; + yPos3 = 7.25f; + ff = 10; + } + + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + yPos), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + if (this.setting.isShowValue()) { + String string = this.setting.getValue().toString() + this.setting.getUnit(); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(string, this.x + 169 - (float)CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(string), (float)(this.y + yPos), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + } + + boolean bl = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + n3 - 2) * this.scale && (float) mouseY > (float) (this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float) (this.y + ff + this.yOffset) * this.scale; + RenderUtil.drawRoundedRect(this.x + 174, this.y + yPos2, this.x + 170 + n3 - 4, this.y + yPos2 + 2, 1.0, bl ? GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2 : GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor : CBTheme.lightTextColor); + double d = n3 - 18; + if (this.setting.getMinimumValue() != null && this.setting.getMaximumValue() != null) { + float f4 = Float.parseFloat("" + this.setting.getMinimumValue()); + float f5 = Float.parseFloat("" + this.setting.getMaximumValue()); + if (this.interacting) { + this.value = (float) Math.round(((double) f4 + (double) ((float) mouseX - (float) (this.x + 180) * this.scale) * ((double) (f5 - f4) / (d * (double) this.scale))) * (double) 100) / (float) 100; + if (this.setting.getType().equals(SettingType.INTEGER) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + this.value = Math.round(this.value); + } + if (this.value < f4) { + this.value = f4; + } else if (this.value > f5) { + this.value = f5; + } + + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(Integer.parseInt((int) this.value + "")); + break; + case FLOAT: + this.setting.setValue(this.value); + break; + case DOUBLE: + this.setting.setValue(Double.parseDouble(this.value + "")); + } + } + f3 = (f3 = Float.parseFloat(this.setting.getValue() + "")) < this.settingValue ? this.settingValue - f3 : (f3 -= this.settingValue); + float f6 = ((f5 - f4) / (float) 20 + f3 * (float) 8) / (float) (Minecraft.debugFPS + 1); + if ((double) f6 < (double) 0.18f * 5.555555334797621E-4) { + f6 = 2.1333334f * 4.6874997E-5f; + } + if (this.settingValue < (f2 = Float.parseFloat(this.setting.getValue() + ""))) { + this.settingValue = this.settingValue + f6 <= f2 ? (this.settingValue += f6) : f2; + } else if (this.settingValue > f2) { + this.settingValue = this.settingValue - f6 >= f2 ? (this.settingValue -= f6) : f2; + } + double d2 = (float) 100 * ((this.settingValue - f4) / (f5 - f4)); + RenderUtil.drawRoundedRect(this.x + 174, this.y + yPos2, (double) (this.x + 180) + d * d2 / (double) 100, this.y + yPos2 + 2, 4, -12418828); + GL11.glColor4f(0.6666667f * 0.375f, 0.45f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 1359.3749f * 0.13333334f) + d * d2 / (double) 100, (float) this.y + yPos3, 31.125001159496648 * 0.14457830786705017); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 39.5f * 4.588608f) + d * d2 / (double) 100, (float) this.y + yPos3, 1.6875000046566129 * (double) 1.6f); + this.drawDescription(this.setting, mouseX, mouseY); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/WorldTimeElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/WorldTimeElement.java new file mode 100644 index 0000000..5da1882 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/WorldTimeElement.java @@ -0,0 +1,109 @@ +package com.cheatbreaker.client.ui.element.type.custom; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.data.SettingType; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class WorldTimeElement extends AbstractModulesGuiElement { + private final Setting setting; + private float settingValue = -1; + private float value; + private boolean interacting = false; + private final ResourceLocation sunIcon = new ResourceLocation("client/icons/sun-64.png"); + private final ResourceLocation moonIcon = new ResourceLocation("client/icons/moon-64.png"); + + public WorldTimeElement(Setting setting, float f) { + super(f); + this.setting = setting; + this.height = 22; + this.settingValue = Float.parseFloat("" + setting.getValue()); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + int n4 = 170; + boolean bl = (float) mouseX > (float)(this.x + 170) * this.scale && (float) mouseX < (float)(this.x + 170 + n4 - 2) * this.scale && (float) mouseY > (float)(this.y + 4 + this.yOffset) * this.scale && (float) mouseY < (float)(this.y + 20 + this.yOffset) * this.scale; + if (button == 0 && bl) { + this.interacting = true; + } + } + + @Override + public void handleDrawElement(int mouseX, int n2, float partialTicks) { + float f2; + float f3; + int n3 = 148; + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName().toUpperCase(), this.x + 10, (float) (this.y + 8), -1895825408); + if (this.interacting && !Mouse.isButtonDown(0)) { + this.interacting = false; + } + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString("SERVER", this.x + 172 + n3 / 2F, this.y - 2, -1895825408); + Gui.drawRect((float) (this.x + 172 + n3 / 2) - 1.2580645f * 0.3974359f, this.y + 8, (float) (this.x + 172 + n3 / 2) + 0.33333334f * 1.5f, this.y + 14, 0x6F000000); + RenderUtil.renderIcon(this.moonIcon, (float) (this.x + 180) - 1.3170732f * 2.4675925f, (float) (this.y + 3), 6.346154f * 1.1818181f, 47.307693f * 0.15853658f); + Gui.drawRect((float) (this.x + 180) - 0.4509804f * 1.1086956f, this.y + 12, (float) (this.x + 180) + 0.45652175f * 1.0952381f, this.y + 14, 0x6F000000); + RenderUtil.renderIcon(this.sunIcon, (float) (this.x + 170 + n3 - 10) - (float) 5, (float) (this.y + 2), (float) 10, 10); + Gui.drawRect((float) (this.x + 170 + n3 - 10) - 1.1875f * 0.42105263f, this.y + 12, (float) (this.x + 170 + n3 - 10) + 0.4673913f * 1.0697675f, this.y + 14, 0x6F000000); + boolean bl = (float) mouseX > (float) (this.x + 170) * this.scale && (float) mouseX < (float) (this.x + 170 + n3 - 2) * this.scale && (float) n2 > (float) (this.y + 4 + this.yOffset) * this.scale && (float) n2 < (float) (this.y + 20 + this.yOffset) * this.scale; + RenderUtil.drawRoundedRect(this.x + 174, this.y + 16, this.x + 170 + n3 - 4, this.y + 18, 1.0, bl ? -1895825408 : 0x6F000000); + double d = n3 - 18; + if (this.setting.getMinimumValue() != null && this.setting.getMaximumValue() != null) { + float f4 = Float.parseFloat("" + this.setting.getMinimumValue()); + float f5 = Float.parseFloat("" + this.setting.getMaximumValue()); + + if (this.interacting) { + this.value = (float) Math.round(((double) f4 + (double) ((float) mouseX - (float) (this.x + 180) * this.scale) * ((double) (f5 - f4) / (d * (double) this.scale))) * (double) 100) / (float) 100; + if (this.value < (float) -13490 && this.value > (float) -15490) { + this.value = -14490; + } + if (this.setting.getType().equals(SettingType.INTEGER)) { + this.value = Math.round(this.value); + } + + if (this.value < f4) { + this.value = f4; + } else if (this.value > f5) { + this.value = f5; + } + + switch (this.setting.getType()) { + case INTEGER: + this.setting.setValue(Integer.parseInt((int) this.value + "")); + break; + case FLOAT: + this.setting.setValue(this.value); + break; + case DOUBLE: + this.setting.setValue(Double.parseDouble(this.value + "")); + } + } + f3 = (f3 = Float.parseFloat(this.setting.getValue() + "")) < this.settingValue ? this.settingValue - f3 : (f3 -= this.settingValue); + float f6 = ((f5 - f4) / (float) 20 + f3 * (float) 8) / (float) (Minecraft.debugFPS + 1); + if ((double) f6 < (double) 0.18f * 5.555555334797621E-4) { + f6 = 2.1333334f * 4.6874997E-5f; + } + if (this.settingValue < (f2 = Float.parseFloat(this.setting.getValue() + ""))) { + this.settingValue = this.settingValue + f6 <= f2 ? (this.settingValue += f6) : f2; + } else if (this.settingValue > f2) { + this.settingValue = this.settingValue - f6 >= f2 ? (this.settingValue -= f6) : f2; + } + double d2 = (float) 100 * ((this.settingValue - f4) / (f5 - f4)); + RenderUtil.drawRoundedRect(this.x + 174, this.y + 16, (double) (this.x + 180) + d * d2 / (double) 100, this.y + 18, 4, -12418828); + GL11.glColor4f(0.6666667f * 0.375f, 0.45f, 1.0f, 1.0f); + RenderUtil.drawCircle((double) ((float) this.x + 1359.3749f * 0.13333334f) + d * d2 / (double) 100, (float) this.y + 18.818182f * 0.9166667f, 31.125001159496648 * 0.14457830786705017); + if (this.settingValue == (float) -14490) { + GL11.glColor4f(0.7738095f * 0.32307693f, 0.037499998f * 12.0f, 1.0f, 1.0f); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + RenderUtil.drawCircle((double) ((float) this.x + 39.5f * 4.588608f) + d * d2 / (double) 100, (float) this.y + 1.2763158f * 13.515464f, 1.6875000046566129 * (double) 1.6f); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/XRayOptionsElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/XRayOptionsElement.java new file mode 100644 index 0000000..d380300 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/element/type/custom/XRayOptionsElement.java @@ -0,0 +1,98 @@ +package com.cheatbreaker.client.ui.element.type.custom; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.GlobalSettings; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.theme.CBTheme; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.List; + +public class XRayOptionsElement extends AbstractModulesGuiElement { + private final String label; + private final List blocksList; + private final RenderItem renderItem = new RenderItem(); + + public XRayOptionsElement(List list, String label, float scale) { + super(scale); + this.height = 220; + this.blocksList = list; + this.label = label; + } + + @Override + public void handleDrawElement(int mouseX, int mouseY, float partialTicks) { + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.label.toUpperCase(), this.x + 10, (float)(this.y + 2), GlobalSettings.darkMode.getBooleanValue() ? CBTheme.darkTextColor2 : CBTheme.lightTextColor2); + Minecraft mc = Minecraft.getMinecraft(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + int n3 = 0; + int n4 = 0; + for (Block block : Block.blockRegistry) { + Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n3 >= 15) { + n3 = 0; + ++n4; + } + int n5 = this.x + 12 + n3 * 20; + int n6 = this.y + 14 + n4 * 20; + boolean hovering = (float) mouseX > (float)(n5 - 2) * this.scale && (float) mouseX < (float)(n5 + 18) * this.scale && (float)mouseY > (float)(n6 - 2 + this.yOffset) * this.scale && (float)mouseY < (float)(n6 + 18 + this.yOffset) * this.scale; + if (blocksList.contains(Item.getIdFromItem(item))) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x7F00FF00); + } else if (hovering) { + Gui.drawRect(n5 - 2, n6 - 2, n5 + 18, n6 + 18, 0x4F0000FF); + } + this.renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(item), n5, n6); + ++n3; + } + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(32826); + GL11.glDisable(3042); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + try { + int n5 = 0; + int n6 = 0; + for (Block block : Block.blockRegistry) { + Item item = Item.getItemFromBlock(block); + if (item == null) continue; + if (n5 >= 15) { + n5 = 0; + ++n6; + } + int n7 = this.x + 12 + n5 * 20; + int n8 = this.y + 14 + n6 * 20; + boolean bl = (float) mouseX > (float)(n7 - 2) * this.scale && (float) mouseX < (float)(n7 + 18) * this.scale && (float) mouseY > (float)(n8 - 2 + this.yOffset) * this.scale && (float) mouseY < (float)(n8 + 18 + this.yOffset) * this.scale; + if (bl && button == 0) { + int n9 = Item.getIdFromItem(item); + if (blocksList.contains(n9)) { + blocksList.removeIf(n2 -> n2 == n9); + } else { + blocksList.add(n9); + } + if (CheatBreaker.getInstance().getModuleManager().staffModuleXray.isEnabled()) { + Minecraft.getMinecraft().renderGlobal.loadRenderers(); + } + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + ++n5; + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/AbstractFade.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/AbstractFade.java new file mode 100644 index 0000000..5598652 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/AbstractFade.java @@ -0,0 +1,132 @@ +package com.cheatbreaker.client.ui.fading; + +import lombok.Getter; +import lombok.Setter; + +/** + * ENTIRE CLASS MAPPINGS IS TEMPORARILY LIKE THIS - HAVEN'T FIGURED OUT EVERYTHING + */ +@Getter @Setter +public abstract class AbstractFade { + protected long time; + protected long duration; + protected boolean running = true; + protected float amount; + protected long unknownLong; + protected final float color; + private boolean loopAnimation; + private int runTime = 1; + private int runLength = 1; + private long unknownLong2; + private boolean hovered; + + public AbstractFade(long duration, float color) { + this.duration = duration; + this.color = color; + } + + protected abstract float getValue(); + + public void startAnimation() { + this.time = System.currentTimeMillis(); + this.running = true; + this.unknownLong2 = 0L; + } + + public void startAnimationFromStartOrEnd(float f) { + this.time = System.currentTimeMillis(); + this.unknownLong2 = f == 0.0f ? 0L : (long)((float)this.duration * (1.0f - f)); + this.running = true; + } + + public void loopAnimation() { + this.loopAnimation = true; + } + + public boolean isTimeNotAtZero() { + return this.time != 0L; + } + + public boolean isOver() { + return this.timeLeft() <= 0L && this.running; + } + + public void reset() { + this.time = 0L; + this.runTime = 1; + } + + public float inOutFade(boolean hovering) { + if (hovering && !this.hovered) { + this.hovered = true; + this.startAnimationFromStartOrEnd(this.getFinalizedValue()); + } else if (this.hovered && !hovering) { + this.hovered = false; + this.startAnimationFromStartOrEnd(this.getFinalizedValue()); + } + if (this.time == 0L) { + return 0.0f; + } + float f = this.getFinalizedValue(); + return this.hovered ? f : 1.0f - f; + } + + public boolean isZeroOrLess() { + return this.time != 0L && this.timeLeft() > 0L; + } + + private float getFinalizedValue() { + if (this.time == 0L) { + return 0.0f; + } + if (this.timeLeft() <= 0L) { + return 1.0f; + } + return this.getValue(); + } + + public float getFadeAmount() { + if (this.time == 0L) { + return 0.0f; + } + if (this.isOver()) { + if (this.loopAnimation || this.runLength >= 1 && this.runTime < this.runLength) { + this.startAnimation(); + ++this.runTime; + } + return this.color; + } + if (this.running) { + return this.getValue(); + } + return this.amount; + } + + public void lIIIIllIIlIlIllIIIlIllIlI() { + this.running = false; + this.amount = this.getValue(); + this.unknownLong = System.currentTimeMillis() - this.time; + } + + public void IlllIllIlIIIIlIIlIIllIIIl() { + this.time = System.currentTimeMillis() - this.unknownLong; + this.running = true; + } + + public long IlIlllIIIIllIllllIllIIlIl() { + long l = this.running ? this.timeLeft() : System.currentTimeMillis() - this.unknownLong + this.duration - System.currentTimeMillis(); + return Math.min(this.duration, Math.max(0L, l)); + } + + protected long timeLeft() { + return this.time + this.duration - this.unknownLong2 - System.currentTimeMillis(); + } + + public long llIIllIlIlllllIlIllIIlIll() { + return this.duration - this.IlIlllIIIIllIllllIllIIlIl(); + } + + public long getUnknownLong() { + return this.unknownLong; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/ColorFade.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/ColorFade.java new file mode 100644 index 0000000..d48f565 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/ColorFade.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.ui.fading; + +import java.awt.Color; + +public class ColorFade extends ExponentialFade { + private int startColor; + private int endColor; + private boolean started; + private Color endColorObj; + private Color startColorObj; + + public ColorFade(long fadeDuration, int startColor, int endColor) { + super(fadeDuration); + this.startColor = startColor; + this.endColor = endColor; + } + + public ColorFade(int startColor, int endColor) { + this(175L, startColor, endColor); + } + + public Color getColor(boolean criteria) { + Color color = new Color(criteria ? this.endColor : this.startColor, true); + if (criteria && !this.started) { + this.started = true; + this.endColorObj = new Color(this.startColor, true); + this.startColorObj = new Color(this.endColor, true); + this.startAnimation(); + } else if (this.started && !criteria) { + this.started = false; + this.endColorObj = new Color(this.endColor, true); + this.startColorObj = new Color(this.startColor, true); + this.startAnimation(); + } + if (this.isZeroOrLess()) { + float f = super.getFadeAmount(); + int n = (int)Math.abs(f * (float)this.startColorObj.getRed() + (1.0f - f) * (float)this.endColorObj.getRed()); + int n2 = (int)Math.abs(f * (float)this.startColorObj.getGreen() + (1.0f - f) * (float)this.endColorObj.getGreen()); + int n3 = (int)Math.abs(f * (float)this.startColorObj.getBlue() + (1.0f - f) * (float)this.endColorObj.getBlue()); + int n4 = (int)Math.abs(f * (float)this.startColorObj.getAlpha() + (1.0f - f) * (float)this.endColorObj.getAlpha()); + color = new Color(n, n2, n3, n4); + } + return color; + } + + public void setStartColor(int color) { + this.startColor = color; + } + + public void setEndColor(int color) { + this.endColor = color; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/CosineFade.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/CosineFade.java new file mode 100644 index 0000000..81f199b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/CosineFade.java @@ -0,0 +1,14 @@ +package com.cheatbreaker.client.ui.fading; + +public class CosineFade extends FloatFade { + public CosineFade(long duration) { + super(duration, 0.0f); + } + + @Override + protected float getValue() { + float f = super.getValue(); + float f2 = f * 2.0f - 1.0f; + return (float)(Math.cos((double)f2 * Math.PI) + 1.0) / 2.0f; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/ExponentialFade.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/ExponentialFade.java new file mode 100644 index 0000000..e523c5a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/ExponentialFade.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.ui.fading; + +public class ExponentialFade extends FloatFade { + public ExponentialFade(long duration) { + super(duration); + } + + @Override + public float getValue() { + float f = super.getValue(); + return (float)Math.pow(f * (2.0f - f), 1.0); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/FloatFade.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/FloatFade.java new file mode 100644 index 0000000..1e3c294 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/FloatFade.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.ui.fading; + +public class FloatFade extends AbstractFade { + public FloatFade(long duration) { + super(duration, 1.0f); + } + + public FloatFade(long duration, float f) { + super(duration, f); + } + + @Override + protected float getValue() { + return (float)(this.duration - this.timeLeft()) / (float)this.duration; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/MinMaxFade.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/MinMaxFade.java new file mode 100644 index 0000000..a788bff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/fading/MinMaxFade.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.ui.fading; + +import com.cheatbreaker.client.ui.fading.FloatFade; + +public class MinMaxFade extends FloatFade { + public MinMaxFade(long l) { + super(l); + } + + @Override + protected float getValue() { + float value = super.getValue(); + return (double)value < 0.2558139478148095 * 1.954545497894287 ? 2.0f * value * value : (float)-1 + ((float)4 - 2.0f * value) * value; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/AbstractElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/AbstractElement.java new file mode 100644 index 0000000..f89073a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/AbstractElement.java @@ -0,0 +1,56 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import lombok.Getter; +import net.minecraft.client.Minecraft; + +public abstract class AbstractElement { + @Getter protected float xPosition; + @Getter protected float yPosition; + @Getter protected float width; + @Getter protected float height; + protected final Minecraft mc = Minecraft.getMinecraft(); + protected final CheatBreaker cb = CheatBreaker.getInstance(); + + public boolean isMouseInside(float f, float f2) { + return f > this.xPosition && f < this.xPosition + this.width && f2 > this.yPosition && f2 < this.yPosition + this.height; + } + + public boolean drawElementHover(float f, float f2, boolean bl) { + this.handleElementDraw(f, f2, bl); + return this.isMouseInside(f, f2); + } + + public void setElementSize(float x, float y, float width, float height) { + this.xPosition = x; + this.yPosition = y; + this.width = width; + this.height = height; + } + + public void handleElementUpdate() { + } + + public void handleElementClose() { + } + + public void keyTyped(char c, int n) { + } + + public void handleElementMouse() { + } + + protected abstract void handleElementDraw(float var1, float var2, boolean var3); + + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + return false; + } + + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + return false; + } + + public boolean onMouseClick(float f, float f2, int n) { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/AccountList.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/AccountList.java new file mode 100644 index 0000000..3355f88 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/AccountList.java @@ -0,0 +1,135 @@ +package com.cheatbreaker.client.ui.mainmenu; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class AccountList extends AbstractElement { + private ResourceLocation resourceLocation; + private String username; + private final ColorFade outline = new ColorFade(0x4FFFFFFF, -1353670564); + private final ColorFade topGradient = new ColorFade(444958085, 1063565678); + private final ColorFade bottomGradient = new ColorFade(444958085, 1062577506); + private final MinMaxFade fadeTime = new MinMaxFade(300L); + private float height2; + private boolean interacting; + private final MainMenuBase mainMenuBase; + private final ScrollableElement scrollbar = new ScrollableElement(this); + private float accountSelectionBoxHeight; + + public AccountList(MainMenuBase mainMenuBase, String username, ResourceLocation resourceLocation) { + this.mainMenuBase = mainMenuBase; + this.resourceLocation = resourceLocation; + this.username = username; + } + + public void updateElementSize() { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + if (this.height2 == 0.0f) { + this.height2 = height; + } + this.accountSelectionBoxHeight = Math.min(this.mainMenuBase.getAccounts().size() * 16 + 12, 120); + this.scrollbar.setElementSize(f + width - 5.0f, y + this.height2 + 6.0f, 4.0f, this.accountSelectionBoxHeight - 7.0F); + this.scrollbar.setScrollAmount(this.mainMenuBase.getAccounts().size() * 16 + 4); + } + + @Override + public void handleElementMouse() { + this.scrollbar.handleElementMouse(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + boolean bl2 = bl && this.isMouseInside(f, f2); + RenderUtil.drawGradientRectWithOutline(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height2, this.outline.getColor(bl2).getRGB(), this.topGradient.getColor(bl2).getRGB(), this.bottomGradient.getColor(bl2).getRGB()); + float f3 = 6; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.resourceLocation, f3, this.xPosition + 4.0f, this.yPosition + this.height2 / 2.0f - f3); + CheatBreaker.getInstance().robotoRegular13px.drawString(this.username, this.xPosition + 22.0f, this.yPosition + 4.5f, -1342177281); + float f4 = this.fadeTime.inOutFade(this.isMouseInside(f, f2) && bl); + if (this.fadeTime.isZeroOrLess()) { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height2 + this.accountSelectionBoxHeight * f4); + this.interacting = true; + } else if (!this.fadeTime.isZeroOrLess() && !this.isMouseInside(f, f2)) { + this.interacting = false; + } + if (this.interacting) { + float f5 = 0.5f; + float f6 = this.yPosition + this.height + f5; + float f7 = this.yPosition + 5.0f + this.height2; + if (f6 > f7) { + Gui.drawBoxWithOutLine(this.xPosition + 1.0f, f7, this.xPosition + this.width - 1.0f, f6, f5, 0x4FFFFFFF, 444958085); + } + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int)this.xPosition, (int)(this.yPosition + this.height2), (int)(this.xPosition + this.width), (int)(this.yPosition + this.height2 + 7.0f + (this.height - this.height2 - 6.0f) * f4), (float)((int)((float)this.mainMenuBase.getScaledResolution().getScaleFactor() * this.mainMenuBase.getScaleFactor())), (int)this.mainMenuBase.getScaledHeight()); + this.scrollbar.drawScrollable(f, f2, bl); + int n = 1; + for (CBAccount account : this.mainMenuBase.getAccounts()) { + float f8 = this.xPosition; + float f9 = this.xPosition + this.width; + float f10 = this.yPosition + this.height2 + (float)(n * 16) - 8.0f; + float f11 = f10 + 16.0f; + boolean bl3 = f > f8 && f < f9 && f2 - this.scrollbar.getPosition() > + f10 && f2 - this.scrollbar.getPosition() < f11 && bl && + !this.scrollbar.isMouseInside(f, f2) && !this.scrollbar.isButtonHeld(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, bl3 ? 1.0f : 0.8148148f * 0.8590909f); + RenderUtil.renderIcon(account.getHeadIcon(), f3, this.xPosition + 4.0f, f10 + 8.0f - f3); + CheatBreaker.getInstance().robotoRegular13px.drawString(account.getDisplayName(), this.xPosition + 22.0f, f10 + 4.0f, bl3 ? -1 : -1342177281); + ++n; + } + this.scrollbar.handleElementDraw(f, f2, bl); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + } + + public float setWidthFromAccountString(float stringWidth) { + return 22.0F + stringWidth + 10.0F; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + if (this.fadeTime.isHovered()) { + this.scrollbar.handleElementMouseClicked(f, f2, n, bl); + int n2 = 1; + for (CBAccount account : this.mainMenuBase.getAccounts()) { + float f3 = this.xPosition; + float f4 = this.xPosition + this.width; + float f5 = this.yPosition + this.height2 + (float)(n2 * 16) - 8.0f; + float f6 = f5 + 16.0f; + boolean bl2 = f > f3 && f < f4 && f2 - this.scrollbar.getPosition() > f5 && f2 - this.scrollbar.getPosition() < f6 && bl && !this.scrollbar.isMouseInside(f, f2) && !this.scrollbar.isButtonHeld(); + if (bl2) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mainMenuBase.writeStringToBuffer(account.getDisplayName()); + } + ++n2; + } + } + return false; + } + + public void setResourceLocation(ResourceLocation resourceLocation) { + this.resourceLocation = resourceLocation; + } + + public void setUsername(String username) { + this.username = username; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/CBAccount.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/CBAccount.java new file mode 100644 index 0000000..2a68be2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/CBAccount.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.ResourceLocation; + +@AllArgsConstructor @Getter +public class CBAccount { + private String clientToken; + private String username; + private String accessToken; + private String displayName; + private String uuid; + private final ResourceLocation headIcon; + + public CBAccount(String username, String clientToken, String accessToken, String displayName, String uuid) { + this.username = username; + this.clientToken = clientToken; + this.accessToken = accessToken; + this.displayName = displayName; + this.uuid = uuid; + this.headIcon = CheatBreaker.getInstance().getHeadIcon(displayName, uuid); + } + + public void setAccessToken(String string) { + this.accessToken = string; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/GradientTextButton.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/GradientTextButton.java new file mode 100644 index 0000000..799bee3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/GradientTextButton.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.fading.ColorFade; + +public class GradientTextButton extends AbstractElement { + private String string; + private final ColorFade outlineColor; + private final ColorFade topGradientColor; + private final ColorFade bottomGradientColor; + private int[] colorArray; + + public GradientTextButton(String string) { + this.string = string; + this.outlineColor = new ColorFade(-14277082, -11493284); + this.topGradientColor = new ColorFade(-13487566, -10176146); + this.bottomGradientColor = new ColorFade(-14013910, -11164318); + } + + // These names are not finalized. These will be named at another time. This is only to ensure that the obfuscation namings are dealt with first. + public void buttonColor1() { + this.setColorArray(new int[]{-11119018, -11493284, -10329502, -10176146, -11579569, -11164318}); + } + + public void buttonColor2() { + this.setColorArray(new int[]{-11493284, -11493284, -10176146, -10176146, -11164318, -11164318}); + } + + public void buttonColor3() { + this.setColorArray(new int[]{-14277082, -11493284, -13487566, -10176146, -14013910, -11164318}); + } + + private void setColorArray(int[] colorArray) { + this.colorArray = colorArray; + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + boolean bl2 = bl && this.isMouseInside(f, f2); + if (this.colorArray != null && this.outlineColor.isOver()) { + this.outlineColor.setStartColor(this.colorArray[0]); + this.outlineColor.setEndColor(this.colorArray[1]); + this.topGradientColor.setStartColor(this.colorArray[2]); + this.topGradientColor.setEndColor(this.colorArray[3]); + this.bottomGradientColor.setStartColor(this.colorArray[4]); + this.bottomGradientColor.setEndColor(this.colorArray[5]); + this.colorArray = null; + } + RenderUtil.drawGradientRectWithOutline(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.outlineColor.getColor(bl2).getRGB(), this.topGradientColor.getColor(bl2).getRGB(), this.bottomGradientColor.getColor(bl2).getRGB()); + CheatBreaker.getInstance().robotoRegular13px.drawCenteredString(this.string, this.xPosition + this.width / 2.0f, this.yPosition + 2.0f, -1); + } + + public void drawElement(float f, float f2, boolean hovering) { + this.handleElementDraw(f, f2, hovering); + } + + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } + + public String getString() { + return this.string; + } + + public void setString(String string) { + this.string = string; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LoadingScreen.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LoadingScreen.java new file mode 100644 index 0000000..21f8a7b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LoadingScreen.java @@ -0,0 +1,134 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import com.cheatbreaker.client.ui.util.RenderUtil; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.shader.FrameBuffer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class LoadingScreen extends AbstractGui {//TODO: Finish mapping this class + private final ResourceLocation logo = new ResourceLocation("client/logo_108.png"); + private final CBFontRenderer font = new CBFontRenderer(new ResourceLocation("client/font/Ubuntu-M.ttf"), 14.0f); + + private final FrameBuffer framebuffer; + + private String currentPhaseString; + + public int totalPhases; + @Getter private int currentPhase; + + /** + * Initial setup. + */ + public LoadingScreen(int phases) { + this.totalPhases = phases; + this.mc = Minecraft.getMinecraft(); + this.scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + this.framebuffer = new FrameBuffer(this.scaledResolution.getScaledWidth() * this.scaledResolution.getScaleFactor(), this.scaledResolution.getScaledHeight() * this.scaledResolution.getScaleFactor(), true); + } + + /** + * Updates the text and percentage bar. + */ + public void updatePhase(String phase) { + this.currentPhaseString = phase; + this.addPhase(); + } + + /** + * Updates the percentage bar. + */ + public void addPhase() { + ++this.currentPhase; + if (this.totalPhases <= this.currentPhase) { + this.totalPhases = this.currentPhase + 1; + } + this.drawMenu(0.0f, 0.0f); + } + + /** + * Draws the logo. + */ + private void drawLogo(float resWidth, float resHeight) { + float size = 27.0f; + float x = resWidth / 2.0f - size; + float y = resHeight / 2.0f - size; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderEIcon(this.logo, size, x, y); + } + + /** + * Sets the frame buffer. + */ + private void setFrameBuffer() { + try { + this.framebuffer.bindFramebuffer(false); + GL11.glMatrixMode(5889); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0, this.scaledResolution.getScaledWidth(), this.scaledResolution.getScaledHeight(), 0.0, 1000.0, 3000.0); + GL11.glMatrixMode(5888); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0f, 0.0f, -2000.0f); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } catch (RuntimeException ignored) {} + } + + /** + * Initializes the frame buffer renderer. + */ + private void initFrameBufferRenderer() { + int scaleFactor = this.scaledResolution.getScaleFactor(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + this.framebuffer.unbindFramebuffer(); + this.framebuffer.framebufferRender(this.scaledResolution.getScaledWidth() * scaleFactor, this.scaledResolution.getScaledHeight() * scaleFactor); + GL11.glAlphaFunc(516, 0.1f); + GL11.glFlush(); + } + + /** + * Draws the menu. + */ + @Override + public void drawMenu(float x, float y) { + this.setFrameBuffer(); + + float scale = this.getScaleFactor(); + float resolutionWidth = this.scaledResolution.getScaledWidth() / scale; + float resolutionHeight = this.scaledResolution.getScaledHeight() / scale; + + GL11.glScaled(scale, scale, scale); + Gui.drawRect(0.0f, 0.0f, resolutionWidth, resolutionHeight, -1); + + this.drawLogo(resolutionWidth, resolutionHeight); + + float barWidth = 160.0f; + float barX = resolutionWidth / 2.0f - 80.0f; + float barY = resolutionHeight - 40.0f; + RenderUtil.drawRoundedRect(barX, barY, barX + barWidth, barY + 10.0f, 8.0, -657931); + + float phaseBar = barWidth * ((float) this.currentPhase / (float) this.totalPhases); + if (this.currentPhaseString != null) this.font.drawCenteredString(this.currentPhaseString.toLowerCase(), resolutionWidth / 2.0f, barY - 11.0f, -3092272); + + RenderUtil.drawRoundedRect(barX, barY, barX + Math.max(phaseBar, 8.0F), barY + 10.0f, 8.0, -2473389); + this.initFrameBufferRenderer(); + this.mc.func_147120_f(); + } + + @Override + protected void mouseClicked(float var1, float var2, int var3) { + } + + @Override + public void mouseMovedOrUp(float var1, float var2, int var3) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarClientLogoElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarClientLogoElement.java new file mode 100644 index 0000000..a083655 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarClientLogoElement.java @@ -0,0 +1,132 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.concurrent.ThreadLocalRandom; + +public final class LunarClientLogoElement extends AbstractElement { + private final ResourceLocation origLunarLogo = new ResourceLocation("client/animatedlogo/128/logo_128_no_stars.png"); + private static final ResourceLocation[] logoLocations = new ResourceLocation[8]; + private final TwinklingLunarLogo[] logos = new TwinklingLunarLogo[8]; + private boolean someBoolean = true; + private final float[] someIntArray = new float[8]; + private final boolean shadow; + + public LunarClientLogoElement() { + this(true); + } + + public LunarClientLogoElement(boolean shadow) { + for (int frame = 1; frame <= 8; ++frame) { + if (logoLocations[frame - 1] != null) continue; + LunarClientLogoElement.logoLocations[frame - 1] = new ResourceLocation("client/animatedlogo/128/logo_128_star_" + frame + ".png"); + } + this.updateLogo(); + this.shadow = shadow; + } + + private void updateLogo() { + for (int i = 1; i <= 8; ++i) { + if (this.logos[i - 1] != null && !this.logos[i - 1].isZeroOrLess()) { + this.someBoolean = false; + } + if (this.logos[i - 1] != null && this.logos[i - 1].isZeroOrLess()) continue; + long l = ThreadLocalRandom.current().nextLong(4000L, 12000L); + if (this.someBoolean) { + this.someIntArray[i - 1] = Math.max(ThreadLocalRandom.current().nextFloat(), 0.8f); + } + this.logos[i - 1] = new TwinklingLunarLogo(this, l); + } + } + + @Override + public void setElementSize(float f, float f2, float f3, float f4) { + super.setElementSize(f, f2, f3, f4); + } + + @Override + public void handleElementUpdate() { + this.updateLogo(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + GL11.glPushMatrix(); + if (this.shadow) { + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.2f); + RenderUtil.renderIcon(this.origLunarLogo, this.xPosition + 1.0f, this.yPosition + 1.0f, this.width, this.height); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.origLunarLogo, this.xPosition, this.yPosition, this.width, this.height); + for (int i = 0; i < 8; ++i) { + TwinklingLunarLogo twinklingLunarLogo = this.logos[i]; + if (!twinklingLunarLogo.isTimeNotAtZero()) { + twinklingLunarLogo.startAnimation(); + } + GL11.glPushMatrix(); + if (!twinklingLunarLogo.isZeroOrLess()) { + this.updateLogo(); + } + float f3 = twinklingLunarLogo.getRunTimeFadeLength(); + if (twinklingLunarLogo.isRunTimeOver() && this.someBoolean) { + this.someBoolean = false; + } + if (this.someBoolean) { + f3 = Math.max(f3, this.someIntArray[i]); + } + if (this.shadow) { + GL11.glColor4f(0.0f, 0.0f, 0.0f, f3 / 5.0f); + RenderUtil.renderIcon(logoLocations[i], this.xPosition + 1.0f, this.yPosition + 1.0f, this.width, this.height); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, f3); + RenderUtil.renderIcon(logoLocations[i], this.xPosition, this.yPosition, this.width, this.height); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + static class TwinklingLunarLogo extends FloatFade { + private final MinMaxFade runTime; + private final MinMaxFade runLength; + final LunarClientLogoElement loopAnimation; + + private TwinklingLunarLogo(LunarClientLogoElement lunarLogoElement, long l) { + super((long) ((float) l)); + this.loopAnimation = lunarLogoElement; + this.runTime = new MinMaxFade(Math.min((long) Math.min((float) l * 0.2f, 3000.0f), 1500L)); + this.runLength = new MinMaxFade(Math.min((long) ((float) l * 0.4f), 5000L)); + } + + @Override + public void startAnimation() { + super.startAnimation(); + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + } + + boolean isRunTimeOver() { + return this.runTime.isOver(); + } + + float getRunTimeFadeLength() { + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + if (this.runTime.isZeroOrLess()) { + return Math.max(this.runTime.getFadeAmount(), 0.15f); + } + if (this.IlIlllIIIIllIllllIllIIlIl() <= this.runLength.getDuration()) { + if (!this.runLength.isTimeNotAtZero()) { + this.runLength.startAnimation(); + } + return 1.0f - 0.85f * this.runLength.getFadeAmount(); + } + return 1.0f; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarNetworkLogoElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarNetworkLogoElement.java new file mode 100644 index 0000000..df2e5f7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/LunarNetworkLogoElement.java @@ -0,0 +1,121 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import java.util.concurrent.ThreadLocalRandom; + +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public final class LunarNetworkLogoElement extends AbstractElement { + private final ResourceLocation baseLogo; + private final ResourceLocation[] star = new ResourceLocation[8]; + private final IIlllIIIlllIlIlIlllllIIIl[] IlIIIIIIIlIlllIIIlIlIIIIl = new IIlllIIIlllIlIlIlllllIIIl[8]; + private boolean llIIllIlIlllllIlIllIIlIll = true; + private final float[] lIllllIllIIIlIlllIIlIllll = new float[8]; + public transient int llIlIIlIIlIIIlIIIllIIllIl; + + public LunarNetworkLogoElement() { + this.baseLogo = new ResourceLocation("client/animatedlogo/64/logo_64_no_stars.png"); + for (int i = 1; i <= 8; ++i) { + this.star[i - 1] = new ResourceLocation("client/animatedlogo/64/logo_64_star_" + i + ".png"); + } + this.IllIIIlIllIllIIlIIIlllIII(); + } + + private void IllIIIlIllIllIIlIIIlllIII() { + for (int i = 1; i <= 8; ++i) { + if (this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1] != null && !this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1].isZeroOrLess()) { + this.llIIllIlIlllllIlIllIIlIll = false; + } + if (this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1] != null && this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1].isZeroOrLess()) continue; + long l = ThreadLocalRandom.current().nextLong(4000L, 12000L); + if (this.llIIllIlIlllllIlIllIIlIll) { + this.lIllllIllIIIlIlllIIlIllll[i - 1] = Math.max(ThreadLocalRandom.current().nextFloat(), 0.8f); + } + this.IlIIIIIIIlIlllIIIlIlIIIIl[i - 1] = new IIlllIIIlllIlIlIlllllIIIl(this, l); + } + } + + @Override + public void setElementSize(float f, float f2, float f3, float f4) { + super.setElementSize(f, f2, f3, f4); + } + + @Override + public void handleElementUpdate() { + ++this.llIlIIlIIlIIIlIIIllIIllIl; + this.IllIIIlIllIllIIlIIIlllIII(); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.baseLogo, this.xPosition, this.yPosition, this.width, this.height); + for (int i = 0; i < 8; ++i) { + IIlllIIIlllIlIlIlllllIIIl iIlllIIIlllIlIlIlllllIIIl = this.IlIIIIIIIlIlllIIIlIlIIIIl[i]; + if (!iIlllIIIlllIlIlIlllllIIIl.isTimeNotAtZero()) { + iIlllIIIlllIlIlIlllllIIIl.startAnimation(); + } + GL11.glPushMatrix(); + if (!iIlllIIIlllIlIlIlllllIIIl.isZeroOrLess()) { + this.IllIIIlIllIllIIlIIIlllIII(); + } + float f3 = iIlllIIIlllIlIlIlllllIIIl.lIlIlllllIllIllIIlIllIIll(); + if (iIlllIIIlllIlIlIlllllIIIl.IllIlIlIIIIIlllllllllIlII() && this.llIIllIlIlllllIlIllIIlIll) { + this.llIIllIlIlllllIlIllIIlIll = false; + } + if (this.llIIllIlIlllllIlIllIIlIll) { + f3 = Math.max(f3, this.lIllllIllIIIlIlllIIlIllll[i]); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, f3); + RenderUtil.renderIcon(this.star[i], this.xPosition, this.yPosition, this.width, this.height); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + class IIlllIIIlllIlIlIlllllIIIl + extends FloatFade { + private MinMaxFade runTime; + private MinMaxFade runLength; + final LunarNetworkLogoElement loopAnimation; + + private IIlllIIIlllIlIlIlllllIIIl(LunarNetworkLogoElement lunarNetworkLogoElement, long duration) { + super(duration); + this.loopAnimation = lunarNetworkLogoElement; + this.runTime = new MinMaxFade(Math.min((long)Math.min((float)duration * 0.2f, 3000.0f), 1500L)); + this.runLength = new MinMaxFade(Math.min((long)((float)duration * 0.4f), 5000L)); + } + + @Override + public void startAnimation() { + super.startAnimation(); + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + } + + boolean IllIlIlIIIIIlllllllllIlII() { + return this.runTime.isOver(); + } + + float lIlIlllllIllIllIIlIllIIll() { + if (!this.runTime.isTimeNotAtZero()) { + this.runTime.startAnimation(); + } + if (this.runTime.isZeroOrLess()) { + return Math.max(1.0f * this.runTime.getFadeAmount(), 0.15f); + } + if (this.IlIlllIIIIllIllllIllIIlIl() <= this.runLength.getDuration()) { + if (!this.runLength.isTimeNotAtZero()) { + this.runLength.startAnimation(); + } + return 1.0f - 0.85f * this.runLength.getFadeAmount(); + } + return 1.0f; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/MainMenuBase.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/MainMenuBase.java new file mode 100644 index 0000000..39c0d7b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/MainMenuBase.java @@ -0,0 +1,568 @@ +package com.cheatbreaker.client.ui.mainmenu; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.cosmetics.GuiCosmetics; +import com.cheatbreaker.client.ui.mainmenu.element.IconButtonElement; +import com.cheatbreaker.client.ui.mainmenu.element.TextButtonElement; +import com.cheatbreaker.client.ui.mainmenu.element.TextWithShadowButton; +import com.cheatbreaker.client.ui.mainmenu.menus.*; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableList; +import com.google.gson.*; +import com.mojang.authlib.Agent; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import lombok.Getter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiLanguage; +import net.minecraft.client.gui.GuiOptions; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Session; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.Project; + +import java.awt.*; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.net.Proxy; +import java.net.URI; +import java.util.List; +import java.util.*; + +public class MainMenuBase extends AbstractGui { // TODO: Finish mapping this class + @Getter private final List accounts = new ArrayList<>(); + + private final ResourceLocation logo = new ResourceLocation("client/logo_42.png"); + private DynamicTexture viewportTexture; + private final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("client/panorama/0.png"), new ResourceLocation("client/panorama/1.png"), new ResourceLocation("client/panorama/2.png"), new ResourceLocation("client/panorama/3.png"), new ResourceLocation("client/panorama/4.png"), new ResourceLocation("client/panorama/5.png")}; + private ResourceLocation backgroundTexture; + private static int rotationAngle = 4100; + private float sessionNameWidth = CheatBreaker.getInstance().robotoRegular13px.getStringWidth(Minecraft.getMinecraft().getSession().getUsername()); + + private final IconButtonElement exitButton = new IconButtonElement(new ResourceLocation("client/icons/delete-64.png")); + private final IconButtonElement languageButton = new IconButtonElement(6.0f, new ResourceLocation("client/icons/globe-24.png")); + private final AccountList accountsButton = new AccountList(this, Minecraft.getMinecraft().getSession().getUsername(), + CheatBreaker.getInstance().getHeadIcon(Minecraft.getMinecraft().getSession().getUsername(), + Minecraft.getMinecraft().getSession().getPlayerID())); + + private final TextButtonElement optionsButton = new TextButtonElement("OPTIONS"); + private final TextButtonElement changelogButton = new TextButtonElement("CHANGELOG"); + private final TextButtonElement cosmeticsButton = new TextButtonElement("COSMETICS"); + + private final List horizontalButtonList = ImmutableList.of(this.optionsButton, this.changelogButton , this.cosmeticsButton); + + private final String summaryBuildInfo = CheatBreaker.getInstance().getGitBuildVersion().isEmpty() + || CheatBreaker.getInstance().getGitBuildVersion().equals("Production") + || CheatBreaker.getInstance().getGitBuildVersion().toLowerCase().equals(CheatBreaker.getInstance().getGitBranch()) ? "CheatBreaker (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")" : "CheatBreaker " + CheatBreaker.getInstance().getGitBuildVersion() + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")"; + private final String copyright = "Copyright Mojang AB. Do not distribute!"; + private final String confidentialNoticeString = "Unauthorized disclosure of this build in any manner may result in disciplinary action up to and including termination of an assignment."; + private String clientToken = ""; + + + private final TextWithShadowButton commitButton = new TextWithShadowButton(summaryBuildInfo); + private final TextWithShadowButton creditsButton = new TextWithShadowButton(copyright); + private final TextWithShadowButton confidentialButton = new TextWithShadowButton(confidentialNoticeString, 50); + private final ColorFade overlayGradient = new ColorFade(0xF000000, -16777216); + private final File launcherAccounts = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + + public MainMenuBase() { + this.loadAccounts(); + } + + private void loadAccounts() { + Minecraft mc = Minecraft.getMinecraft(); + ArrayList> var2 = new ArrayList<>(); + if (this.launcherAccounts.exists()) { + try { + FileReader launcherProfiles = new FileReader(this.launcherAccounts); + JsonParser parser = new JsonParser(); + JsonElement elements = parser.parse(launcherProfiles); + Iterator> iterator = elements.getAsJsonObject().entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + for (Map.Entry var4 : entry.getValue().getAsJsonObject().entrySet()) { + HashMap var5 = new HashMap<>(); + for (Map.Entry var7 : var4.getValue().getAsJsonObject().entrySet()) { + if (var7.getKey().equalsIgnoreCase("minecraftProfile")) { + for (Map.Entry o1 : var7.getValue().getAsJsonObject().entrySet()) { + if (o1.getKey().equals("id")) { + var5.put("uuid", o1.getValue().getAsString()); + } + if (o1.getKey().equals("name")) { + var5.put("displayName", o1.getValue().getAsString()); + } + } + } else { + if (!var7.getKey().equalsIgnoreCase("username") && !var7.getKey().equalsIgnoreCase("name") && !var7.getKey().equalsIgnoreCase("id") && !var7.getKey().equalsIgnoreCase("accessToken")) { + continue; + } + var5.put(var7.getKey(), var7.getValue().getAsString()); + } + } + var2.add(var5); + } + while (iterator.hasNext()) { + Object o2 = iterator.next(); + Map.Entry var10 = (Map.Entry)o2; + if (var10.getKey().equals("mojangClientToken")) { + JsonPrimitive clientTokenPrim = (JsonPrimitive) var10.getValue(); + this.clientToken = clientTokenPrim.getAsString(); + } + } + } + } catch (Exception ignored) {} + } + this.accounts.clear(); + this.sessionNameWidth = (float)CheatBreaker.getInstance().robotoRegular13px.getStringWidth(Minecraft.getMinecraft().getSession().getUsername()); + for (Map var11 : var2) { + CBAccount var22 = new CBAccount(var11.get("username"), this.clientToken, var11.get("accessToken"), var11.get("displayName"), var11.get("uuid")); + this.accounts.add(var22); + float var13 = (float)CheatBreaker.getInstance().robotoRegular13px.getStringWidth(var22.getDisplayName()); + if (var13 > this.sessionNameWidth) { + this.sessionNameWidth = var13; + } + if (mc.getSession() != null && clientToken.equalsIgnoreCase(mc.getSession().getUsername())) { + this.accountsButton.setUsername(var22.getDisplayName()); + this.accountsButton.setResourceLocation(CheatBreaker.getInstance().getHeadIcon(var22.getDisplayName(), var22.getDisplayName())); + this.getAccountListElementSize(); + } + } + } + + @Override + protected void keyTyped(char c, int n) { + if (n == 1 && Minecraft.getMinecraft().currentScreen instanceof MainMenu) { + return; + } + super.keyTyped(c, n); + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + if (this.accountsButton != null) { + this.accountsButton.handleElementMouse(); + } + } + + @Override + public void updateScreen() { + super.updateScreen(); + ++rotationAngle; + } + + @Override + public void initGui() { + super.initGui(); + this.viewportTexture = new DynamicTexture(256, 256); + this.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); + + float horizontalButtonXPosition = 0; + for (TextButtonElement button : this.horizontalButtonList) { + button.setElementSize(124.0f + horizontalButtonXPosition, 6.0f, CheatBreaker.getInstance().robotoBold14px.getStringWidth(button.string) * 1.14F, 20.0f); + horizontalButtonXPosition += CheatBreaker.getInstance().robotoBold14px.getStringWidth(button.string) + 12.0F; + } + + this.exitButton.setElementSize(this.getScaledWidth() - 30.0f, 7.0f, 23.0f, 17.0f); + this.languageButton.setElementSize(this.getScaledWidth() / 2.0f - 13.0f, this.getScaledHeight() - 17.0f, 26.0f, 18.0f); + this.commitButton.setElementSize(5.0f, this.getScaledHeight() - 14.0f, CheatBreaker.getInstance().playRegular18px.getStringWidth(summaryBuildInfo), 18.0f); + this.creditsButton.setElementSize(this.getScaledWidth() - (float)CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright) - 5.0f, this.getScaledHeight() - 14.0f, CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright), 18.0F); + if (CheatBreaker.getInstance().isConfidentialBuild()) { + this.confidentialButton.setElementSize(this.getScaledWidth() - (float)CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright) - 5.0f, this.getScaledHeight() - 30.0F, CheatBreaker.getInstance().playRegular18px.getStringWidth(copyright), 20.0F); + } + this.getAccountListElementSize(); + } + + public void getAccountListElementSize() { + this.accountsButton.setElementSize(this.getScaledWidth() - 35.0f - this.accountsButton.setWidthFromAccountString(this.sessionNameWidth), 7.0f, this.accountsButton.setWidthFromAccountString(this.sessionNameWidth), 17.0f); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GL11.glDisable(3008); + this.lIIIIIIIIIlIllIIllIlIIlIl(mouseX, mouseY, 1.0f); + GL11.glEnable(3008); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void drawMenu(float x, float y) { + MainMenuBase.drawGradientRect(0.0f, 0.0f, this.getScaledWidth(), this.getScaledHeight(), 0x5FFFFFFF, 0x2FFFFFFF); + MainMenuBase.drawGradientRect(0.0f, 0.0f, this.getScaledWidth(), 160.0f, -553648128, 0); + boolean var3 = x < this.optionsButton.getXPosition() && y < 30.0f; + Color var4 = this.overlayGradient.getColor(var3); + CheatBreaker.getInstance().robotoRegular24px.drawString("CheatBreaker", 37.0f, 9.0f, var4.getRGB()); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.logo, 10.0f, 8.0f, 6.0f); + CheatBreaker.getInstance().robotoRegular24px.drawString("CheatBreaker", 36.0f, 8.0f, -1); + this.exitButton.drawElementHover(x, y, true); + this.languageButton.drawElementHover(x, y, true); + this.accountsButton.drawElementHover(x, y, true); + for (TextButtonElement button : this.horizontalButtonList) { + button.drawElementHover(x, y, true); + } + this.commitButton.drawElementHover(x, y, true); + this.creditsButton.drawElementHover(x, y, true); + if (CheatBreaker.getInstance().isConfidentialBuild()) { + this.confidentialButton.drawElementHover(x, y, true); + } + } + + @Override + protected void mouseClicked(float var1, float var2, int var3) { + this.exitButton.handleElementMouseClicked(var1, var2, var3, true); + this.accountsButton.handleElementMouseClicked(var1, var2, var3, true); + if (this.exitButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.shutdown(); + } else if (this.optionsButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } else if (this.languageButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } else if (this.cosmeticsButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiCosmetics()); + } else if (this.commitButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new BuildMenu()); + } else if (this.creditsButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiCreditsMenu()); + } else if (this.changelogButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new ChangelogMenu()); + } else if (this.confidentialButton.isMouseInside(var1, var2) && CheatBreaker.getInstance().isConfidentialBuild()) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new ConfidentialBuildNoticeMenu()); + } else if (var1 >= 8 && var1 <= 26 && var2 >= 6 && var2 <= 26) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + switchMenu(); + } else { + boolean var4 = var1 < this.optionsButton.getXPosition() && var2 < 30.0f; + if (var4 && !(this.mc.currentScreen instanceof MainMenu)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } + } + } + + @Override + public void mouseMovedOrUp(float var1, float var2, int var3) { + } + + private void lIIIIIIIIIlIllIIllIlIIlIl(int var1, int var2, float var3) { + this.mc.getFramebuffer().unbindFramebuffer(); + GL11.glViewport(0, 0, 256, 256); + this.IlllIIIlIlllIllIlIIlllIlI(var1, var2, var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.mc.getFramebuffer().bindFramebuffer(true); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + Tessellator var4 = Tessellator.instance; + var4.startDrawingQuads(); + float var5 = this.width > this.height ? 120.0f / (float)this.width : 120.0f / (float)this.height; + float var6 = (float)this.height * var5 / 256.0f; + float var7 = (float)this.width * var5 / 256.0f; + var4.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f); + float var8 = this.width; + float var9 = this.height; + var4.addVertexWithUV(0.0, var9, zLevel, 0.5f - var6, 0.5f + var7); + var4.addVertexWithUV(var8, var9, zLevel, 0.5f - var6, 0.5f - var7); + var4.addVertexWithUV(var8, 0.0, zLevel, 0.5f + var6, 0.5f - var7); + var4.addVertexWithUV(0.0, 0.0, zLevel, 0.5f + var6, 0.5f + var7); + var4.draw(); + } + + private void IlllIIIlIlllIllIlIIlllIlI(int var1, int var2, float var3) { + Tessellator var4 = Tessellator.instance; + GL11.glMatrixMode(5889); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + Project.gluPerspective(120.0f, 1.0f, 0.05f, 10.0f); + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + GL11.glEnable(3042); + GL11.glDisable(3008); + GL11.glDisable(2884); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + int var5 = 8; + for (int var6 = 0; var6 < var5 * var5; ++var6) { + GL11.glPushMatrix(); + float var7 = ((float)(var6 % var5) / (float)var5 - 0.5f) / 64.0f; + float var8 = ((float)(var6 / var5) / (float)var5 - 0.5f) / 64.0f; + float var9 = 0.0f; + GL11.glTranslatef(var7, var8, var9); + GL11.glRotatef(MathHelper.sin(((float) rotationAngle + var3) / 400.0f) * 25.0f + 20.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(-((float) rotationAngle + var3) * 0.39240506f * 0.2548387f, 0.0f, 1.0f, 0.0f); + for (int var10 = 0; var10 < 6; ++var10) { + GL11.glPushMatrix(); + if (var10 == 1) { + GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 2) { + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 3) { + GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 4) { + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + } + if (var10 == 5) { + GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); + } + this.mc.getTextureManager().bindTexture(this.titlePanoramaPaths[var10]); + var4.startDrawingQuads(); + var4.setColorRGBA_I(0xFFFFFF, 255 / (var6 + 1)); + float var11 = 0.0f; + var4.addVertexWithUV(-1.0, -1.0, 1.0, 0.0f + var11, 0.0f + var11); + var4.addVertexWithUV(1.0, -1.0, 1.0, 1.0f - var11, 0.0f + var11); + var4.addVertexWithUV(1.0, 1.0, 1.0, 1.0f - var11, 1.0f - var11); + var4.addVertexWithUV(-1.0, 1.0, 1.0, 0.0f + var11, 1.0f - var11); + var4.draw(); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + GL11.glColorMask(true, true, true, false); + } + var4.setTranslation(0.0, 0.0, 0.0); + GL11.glColorMask(true, true, true, true); + GL11.glMatrixMode(5889); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glEnable(2884); + GL11.glEnable(2929); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(float var1) { + this.mc.getTextureManager().bindTexture(this.backgroundTexture); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColorMask(true, true, true, false); + Tessellator var2 = Tessellator.instance; + var2.startDrawingQuads(); + GL11.glDisable(3008); + int var3 = 3; + for (int var4 = 0; var4 < var3; ++var4) { + var2.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f / (float)(var4 + 1)); + float var5 = this.width; + float var6 = this.height; + float var7 = (float)(var4 - var3 / 2) / 256.0f; + var2.addVertexWithUV(var5, var6, zLevel, 0.0f + var7, 1.0); + var2.addVertexWithUV(var5, 0.0, zLevel, 1.0f + var7, 1.0); + var2.addVertexWithUV(0.0, 0.0, zLevel, 1.0f + var7, 0.0); + var2.addVertexWithUV(0.0, var6, zLevel, 0.0f + var7, 0.0); + } + var2.draw(); + GL11.glEnable(3008); + GL11.glColorMask(true, true, true, true); + } + + public String getAccessToken(String shit) { + String token = ""; + String decoded = new String(Base64.getDecoder().decode(shit.split("\\.")[1]), Charsets.UTF_8); + JsonObject jsonObject = new JsonParser().parse(decoded).getAsJsonObject(); + if (jsonObject.get("yggt").getAsString() != null) { + token = jsonObject.get("yggt").getAsString(); + } + return token; + } + + /* + * Exception decompiling + */ + public void writeStringToBuffer(String var1) { + try { + CBAccount var2 = null; + + for (CBAccount account : this.accounts) { + if (account.getDisplayName().equals(var1)) { + var2 = account; + } + } + + if (var2 != null) { + if (var2.getUuid().equalsIgnoreCase(Minecraft.getMinecraft().getSession().getPlayerID())) { + return; + } + + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + + for (Session session : CheatBreaker.getInstance().sessions) { + if (session.func_148256_e().getId().toString().replaceAll("-", "").equalsIgnoreCase(var2.getUuid().replaceAll("-", ""))) { + Minecraft.getMinecraft().setSession(session); + this.accountsButton.setUsername(var2.getDisplayName()); + this.accountsButton.setResourceLocation(var2.getHeadIcon()); + this.getAccountListElementSize(); + return; + } + } + + YggdrasilAuthenticationService var26 = new YggdrasilAuthenticationService(Proxy.NO_PROXY, this.clientToken); + YggdrasilUserAuthentication var28 = (YggdrasilUserAuthentication)var26.createUserAuthentication(Agent.MINECRAFT); + HashMap var5 = new HashMap<>(); + var5.put("uuid", var2.getUuid()); + var5.put("displayName", var2.getDisplayName()); + var5.put("username", var2.getUsername()); + var5.put("accessToken", var2.getAccessToken()); + var28.loadFromStorage(var5); + + Session session; + try { + var28.logIn(); + session = new Session(var28.getSelectedProfile().getName(), var28.getSelectedProfile().getId().toString(), var28.getAuthenticatedToken(), "mojang"); + } catch (AuthenticationException var21) { + var21.printStackTrace(); + return; + } + + File launcherAccountsFile = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + if (launcherAccountsFile.exists() && !var28.getAuthenticatedToken().equals(var2.getAccessToken())) { + try { + FileReader fileReader = new FileReader(launcherAccountsFile); + JsonParser var9 = new JsonParser(); + JsonElement var10 = var9.parse(fileReader); + Map.Entry var11 = null; + Iterator> var12 = var10.getAsJsonObject().entrySet().iterator(); + + label106: + while(true) { + Map.Entry var13; + do { + if (!var12.hasNext()) { + if (var11 != null) { + var2.setAccessToken(var28.getAuthenticatedToken()); + var11.getValue().getAsJsonObject().remove("accessToken"); + var11.getValue().getAsJsonObject().addProperty("accessToken", var28.getAuthenticatedToken()); + } + + Gson var29 = (new GsonBuilder()).setPrettyPrinting().create(); + + try { + DataOutputStream var30 = new DataOutputStream(new FileOutputStream(launcherAccountsFile)); + var30.writeBytes(var29.toJson(var10).replace("\n", "\r\n")); + var30.flush(); + var30.close(); + break label106; + } catch (Exception var20) { + var20.printStackTrace(); + return; + } + } + + var13 = var12.next(); + } while(!var13.getKey().equalsIgnoreCase("authenticationDatabase")); + + Iterator> var14 = var13.getValue().getAsJsonObject().entrySet().iterator(); + + label104: + while(var14.hasNext()) { + Map.Entry var15 = var14.next(); + Iterator> var16 = var15.getValue().getAsJsonObject().entrySet().iterator(); + + while(true) { + Map.Entry var17; + do { + if (!var16.hasNext()) { + continue label104; + } + + var17 = var16.next(); + } while(!var17.getKey().equalsIgnoreCase("profiles")); + + for (Map.Entry var19 : var17.getValue().getAsJsonObject().entrySet()) { + if (var19.getKey().replaceAll("-", "").equalsIgnoreCase(session.getPlayerID().replaceAll("-", ""))) { + var11 = var15; + } + } + } + } + } + } catch (Exception var22) { + var22.printStackTrace(); + return; + } + } + + System.out.println("Updated accessToken and logged user in."); + this.accountsButton.setUsername(var2.getDisplayName()); + this.accountsButton.setResourceLocation(var2.getHeadIcon()); + this.getAccountListElementSize(); + CheatBreaker.getInstance().sessions.add(session); + Minecraft.getMinecraft().setSession(session); + CheatBreaker.getInstance().getWSNetHandler().close(); + } + } catch (Exception var23) { + var23.printStackTrace(); + } + + } + + protected void openLink(URI p_146407_1_) { + try { + Class var2 = Class.forName("java.awt.Desktop"); + Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke(null); + var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, p_146407_1_); + } catch (Throwable e) { + CheatBreaker.getInstance().getLogger().error("Couldn't open link", e); + } + } + + public static void switchMenu() { + int next = CheatBreaker.getInstance().getGlobalSettings().getCurrentMenu().ordinal() + 1; + MenuTypes menu; + if (next == 3) { + menu = MenuTypes.OLD; + } else { + menu = MenuTypes.values()[next]; + } + CheatBreaker.getInstance().getGlobalSettings().getCurrentMenuSetting().setValue(menu.ordinal()); + Minecraft.getMinecraft().displayGuiScreen(MenuTypes.getMenu(menu)); + } + + public enum MenuTypes { + OLD, + MAIN, + VANILLA; + + public static GuiScreen getMenu(MenuTypes menuTypes) { + switch (menuTypes) { + case OLD: + return new CBOldMenu(); + case VANILLA: + return new VanillaMenu(); + default: + return new MainMenu(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/CB2018OldMenuButton.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/CB2018OldMenuButton.java new file mode 100644 index 0000000..af0d682 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/CB2018OldMenuButton.java @@ -0,0 +1,26 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.fading.ColorFade; +import net.minecraft.client.gui.Gui; + +public class CB2018OldMenuButton extends AbstractElement { + private final ColorFade buttonColor = new ColorFade(0x1F000000, 0x3F000000); + private final ColorFade IllIIIIIIIlIlIllllIIllIII = new ColorFade(0, -1073741825); + private final MinMaxFade lIIIIllIIlIlIllIIIlIllIlI = new MinMaxFade(750L); + private boolean IlllIllIlIIIIlIIlIIllIIIl; + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.buttonColor.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/ChangeLogButton.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/ChangeLogButton.java new file mode 100644 index 0000000..59ef5e7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/ChangeLogButton.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.mainmenu.menus.ChangelogDetailMenu; +import com.cheatbreaker.client.util.render.wordwrap.WordWrap; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +public class ChangeLogButton extends AbstractElement { + private final ColorFade backgroundFade = new ColorFade(0x1F000000, 0x3F000000); + private final String title; + private final String author; + private final String description; + + public ChangeLogButton(String title, String author, String description) { + this.title = title; + this.author = author; + this.description = description; + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.backgroundFade.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + String wrapped = WordWrap.from(description).maxWidth(60).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + + int index = 2; + float yOffset = CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f; + + CheatBreaker.getInstance().playRegular14px.drawString(EnumChatFormatting.BOLD + this.title, 1.0f + xPosition, yPosition, -1); + CheatBreaker.getInstance().playRegular12px.drawString(EnumChatFormatting.ITALIC + "Posted by " + EnumChatFormatting.BOLD + this.author, 1.0f + xPosition, yPosition + yOffset, -1); + + for (String line : lines) { + if (index < 3) { + if (index == 2) line += "..."; + CheatBreaker.getInstance().playRegular14px.drawString(line, 1.0f + xPosition, yPosition + (index * yOffset) - 1, -1); + } + index++; + } + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (this.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new ChangelogDetailMenu(this.title, this.author, this.description)); + } + return false; + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuAccountButton.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuAccountButton.java new file mode 100644 index 0000000..c9ac49c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuAccountButton.java @@ -0,0 +1,183 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.mojang.authlib.Agent; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Session; +import org.lwjgl.opengl.GL11; + +import java.io.*; +import java.net.Proxy; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +public class MainMenuAccountButton extends GuiButton { + private final boolean lIIIIlIIllIIlIIlIIIlIIllI = true; + private final String displayName; + private final ResourceLocation headIcon; + private final Map lIIIIIllllIIIIlIlIIIIlIlI; + private final String clientToken; + + public MainMenuAccountButton(int var1, Map var2, int var3, int var4, int var5, int var6) { + super(var1, var3, var4, var5, var6, (String)var2.get("displayName")); + this.displayName = (String)var2.get("displayName"); + this.clientToken = (String)var2.get("clientToken"); + this.lIIIIIllllIIIIlIlIIIIlIlI = var2; + this.headIcon = CheatBreaker.getInstance().getHeadIcon(this.displayName, (String)var2.get("uuid")); + } + + @Override + public void drawButton(Minecraft var1, int var2, int var3) { + if (this.field_146125_m) { + FontRenderer var4 = var1.fontRenderer; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.field_146123_n = var2 >= this.field_146128_h && var3 >= this.field_146129_i && var2 < this.field_146128_h + this.field_146120_f && var3 < this.field_146129_i + this.field_146121_g; + int var5 = this.getHoverState(this.field_146123_n); + if (this.lIIIIlIIllIIlIIlIIIlIIllI) { + Gui.drawRect(this.field_146128_h, this.field_146129_i, this.field_146128_h + this.field_146120_f, this.field_146129_i + this.field_146121_g, this.field_146123_n ? -15395563 : -14540254); + } + this.mouseDragged(var1, var2, var3); + int var6 = -1; + if (!this.enabled) { + var6 = -986896; + } else if (this.field_146123_n) { + var6 = -3092272; + } + if (this.displayName.length() > 9) { + float var10002 = this.field_146128_h + this.field_146120_f / 2 + 12; + float var10003 = this.field_146129_i + this.field_146121_g / 2 - (this.lIIIIlIIllIIlIIlIIIlIIllI ? 4 : 3); + CheatBreaker.getInstance().playRegular14px.drawCenteredString(this.displayName, var10002, var10003, var6); + } else { + float var10002 = this.field_146128_h + this.field_146120_f / 2 + 12; + float var10003 = this.field_146129_i + this.field_146121_g / 2 - (this.lIIIIlIIllIIlIIlIIIlIIllI ? 5 : 4); + CheatBreaker.getInstance().playRegular16px.drawCenteredString(this.displayName, var10002, var10003, var6); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(this.headIcon, 7.0f, (float)(this.field_146128_h + 10), (float)(this.field_146129_i + 5)); + } + } + + /* + * Exception decompiling + */ + public boolean lIIIIlIIllIIlIIlIIIlIIllI() { + if (((String) this.lIIIIIllllIIIIlIlIIIIlIlI.get("uuid")).equalsIgnoreCase(Minecraft.getMinecraft().getSession().getPlayerID())) { + return false; + } else { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + Iterator var1 = CheatBreaker.getInstance().sessions.iterator(); + + while (var1.hasNext()) { + Session session = (Session) var1.next(); + if (session.func_148256_e().getId().toString().replaceAll("-", "").equalsIgnoreCase(((String) this.lIIIIIllllIIIIlIlIIIIlIlI.get("uuid")).replaceAll("-", ""))) { + Minecraft.getMinecraft().setSession(session); + return true; + } + } + + YggdrasilAuthenticationService var21 = new YggdrasilAuthenticationService(Proxy.NO_PROXY, this.clientToken); + YggdrasilUserAuthentication var22 = (YggdrasilUserAuthentication) var21.createUserAuthentication(Agent.MINECRAFT); + var22.loadFromStorage(this.lIIIIIllllIIIIlIlIIIIlIlI); + + Session var3; + try { + var22.logIn(); + var3 = new Session(var22.getSelectedProfile().getName(), var22.getSelectedProfile().getId().toString(), var22.getAuthenticatedToken(), "mojang"); + } catch (AuthenticationException var18) { + var18.printStackTrace(); + return false; + } + + File var4 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + if (var4.exists() && !var22.getAuthenticatedToken().equals(this.lIIIIIllllIIIIlIlIIIIlIlI.get("accessToken"))) { + try { + FileReader var5 = new FileReader(var4); + JsonParser var6 = new JsonParser(); + JsonElement var7 = var6.parse(var5); + Entry var8 = null; + Iterator var9 = var7.getAsJsonObject().entrySet().iterator(); + + label84: + while (true) { + Entry var10; + do { + if (!var9.hasNext()) { + if (var8 != null) { + this.lIIIIIllllIIIIlIlIIIIlIlI.put("accessToken", var22.getAuthenticatedToken()); + ((JsonElement) var8.getValue()).getAsJsonObject().remove("accessToken"); + ((JsonElement) var8.getValue()).getAsJsonObject().addProperty("accessToken", var22.getAuthenticatedToken()); + System.out.println("Updated accessToken and logged user in."); + } + + Gson var23 = (new GsonBuilder()).setPrettyPrinting().create(); + + try { + DataOutputStream var24 = new DataOutputStream(new FileOutputStream(var4)); + var24.writeBytes(var23.toJson(var7).replace("\n", "\r\n")); + var24.flush(); + var24.close(); + break label84; + } catch (Exception var17) { + var17.printStackTrace(); + return false; + } + } + + var10 = (Entry) var9.next(); + } while (!((String) var10.getKey()).equalsIgnoreCase("authenticationDatabase")); + + Iterator var11 = ((JsonElement) var10.getValue()).getAsJsonObject().entrySet().iterator(); + + label82: + while (var11.hasNext()) { + Entry var12 = (Entry) var11.next(); + Iterator var13 = ((JsonElement) var12.getValue()).getAsJsonObject().entrySet().iterator(); + + while (true) { + Entry var14; + do { + if (!var13.hasNext()) { + continue label82; + } + + var14 = (Entry) var13.next(); + } while (!((String) var14.getKey()).equalsIgnoreCase("profiles")); + + Iterator var15 = ((JsonElement) var14.getValue()).getAsJsonObject().entrySet().iterator(); + + while (var15.hasNext()) { + Entry var16 = (Entry) var15.next(); + if (((String) var16.getKey()).replaceAll("-", "").equalsIgnoreCase(var3.getPlayerID().replaceAll("-", ""))) { + var8 = var12; + } + } + } + } + } + } catch (Exception var19) { + var19.printStackTrace(); + return false; + } + } + + CheatBreaker.getInstance().sessions.add(var3); + Minecraft.getMinecraft().setSession(var3); + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuButton.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuButton.java new file mode 100644 index 0000000..8518e68 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuButton.java @@ -0,0 +1,46 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +public class MainMenuButton extends GuiButton { + private boolean lIIIIlIIllIIlIIlIIIlIIllI = true; + + public MainMenuButton(int n, int n2, int n3, int n4, int n5, String string, boolean bl) { + this(n, n2, n3, n4, n5, string); + this.lIIIIlIIllIIlIIlIIIlIIllI = bl; + } + + public MainMenuButton(int n, int n2, int n3, int n4, int n5, String string) { + super(n, n2, n3, n4, n5, string); + } + + @Override + public void drawButton(Minecraft mc, int n, int n2) { + if (this.field_146125_m) { + FontRenderer fontRenderer = mc.fontRenderer; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.field_146123_n = n >= this.field_146128_h && n2 >= this.field_146129_i && n < + this.field_146128_h + this.field_146120_f && n2 < this.field_146129_i + this.field_146121_g; + int n3 = this.getHoverState(this.field_146123_n); + if (this.lIIIIlIIllIIlIIlIIIlIIllI) { + Gui.drawRect(this.field_146128_h, this.field_146129_i, + this.field_146128_h + this.field_146120_f, this.field_146129_i + + this.field_146121_g, this.field_146123_n ? -15395563 : -14540254); + } + this.mouseDragged(mc, n, n2); + int n4 = -3092272; + if (!this.enabled) { + n4 = -986896; + } else if (this.field_146123_n) { + n4 = -1; + } + CheatBreaker.getInstance().playRegular16px.drawCenteredString(this.displayString, this.field_146128_h + + this.field_146120_f / 2, this.field_146129_i + this.field_146121_g / 2 - (this.lIIIIlIIllIIlIIlIIIlIIllI ? 5 : 4), n4); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuCosmeticsMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuCosmeticsMenu.java new file mode 100644 index 0000000..4446202 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/buttons/MainMenuCosmeticsMenu.java @@ -0,0 +1,88 @@ +package com.cheatbreaker.client.ui.mainmenu.buttons; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.cosmetics.element.CosmeticElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; + +public class MainMenuCosmeticsMenu extends GuiMainMenu { + private final List cosmetics = new ArrayList(); + private final ResourceLocation lastMouseEvent = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation field_146298_h = new ResourceLocation("client/icons/right.png"); + private int IIIIllIIllIIIIllIllIIIlIl = 0; + + public MainMenuCosmeticsMenu() { + for (Cosmetic cosmetic : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + this.cosmetics.add(new CosmeticElement(cosmetic, 1.0f)); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + if (!CheatBreaker.getInstance().getWSNetHandler().isOpen()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Unable to connect to the server.", this.width / 2, this.height / 2 - 10, -1); + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Please try again later.", this.width / 2, this.height / 2 + 4, -1); + } else { + RenderUtil.drawRoundedRect(this.width / 2 - 80, this.height / 2 - 78, this.width / 2 + 80, this.height / 2 + 100, 14, -1342177281); + if (this.cosmetics.isEmpty()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredString("You don't own any cosmetics.", this.width / 2, this.height / 2 + 4, -6381922); + } else { + float f2 = this.height / 2 - 68; + float f3 = this.height / 2 + 92; + float f4 = this.width / 2 + 68; + float f5 = this.width / 2 + 74; + CheatBreaker.getInstance().playBold18px.drawCenteredString("Cosmetics (" + this.cosmetics.size() + ")", this.width / 2, this.height / 2 - 90, -1); + int n3 = 0; + float f6 = 0.0f; + for (Object cosmeticListElementObj : this.cosmetics) { + CosmeticElement cosmeticListElement = (CosmeticElement) cosmeticListElementObj; + if (++n3 - 1 < this.IIIIllIIllIIIIllIllIIIlIl * 5 || n3 - 1 >= (this.IIIIllIIllIIIIllIllIIIlIl + 1) * 5) continue; + cosmeticListElement.setDimensions(this.width / 2 - 76, (int)((float)(this.height / 2 - 72) + f6), 152, cosmeticListElement.getHeight()); + cosmeticListElement.handleDrawElement(mouseX, mouseY, partialTicks); + f6 += (float)cosmeticListElement.getHeight(); + } + if (this.cosmetics.size() > 5) { + boolean bl = mouseX > this.width / 2 - 40 && mouseX < this.width / 2 - 1 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100; + GL11.glColor4f(0.0f, 0.0f, 0.0f, bl ? 0.20624998f * 2.1818182f : 7.111111f * 0.03515625f); + RenderUtil.renderIcon(this.lastMouseEvent, (float)4, (float)(this.width / 2 - 10), (float)(this.height / 2 + 84)); + boolean bl2 = mouseX > this.width / 2 + 1 && mouseX < this.width / 2 + 40 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100; + GL11.glColor4f(0.0f, 0.0f, 0.0f, bl2 ? 0.6042857f * 0.7446808f : 0.041666668f * 6.0f); + RenderUtil.renderIcon(this.field_146298_h, (float)4, (float)(this.width / 2 + 10), (float)(this.height / 2 + 84)); + } + } + } + this.lIIIIIIIIIlIllIIllIlIIlIl(mouseX, mouseY); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + int n4; + super.mouseClicked(mouseX, mouseY, mouseButton); + if (this.cosmetics.size() > 5) { + boolean bl; + n4 = mouseX > this.width / 2 - 40 && mouseX < this.width / 2 - 1 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100 ? 1 : 0; + boolean bl2 = bl = mouseX > this.width / 2 + 1 && mouseX < this.width / 2 + 40 && mouseY > this.height / 2 + 80 && mouseY < this.height / 2 + 100; + if (this.IIIIllIIllIIIIllIllIIIlIl > 0 && n4 != 0) { + --this.IIIIllIIllIIIIllIllIIIlIl; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl && (float)(this.IIIIllIIllIIIIllIllIIIlIl + 1) < (float)this.cosmetics.size() / (float)5) { + ++this.IIIIllIIllIIIIllIllIIIlIl; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + } + n4 = 0; + for (Object cosmeticListElement : this.cosmetics) { + if (++n4 - 1 < this.IIIIllIIllIIIIllIllIIIlIl * 5 || n4 - 1 >= (this.IIIIllIIllIIIIllIllIIIlIl + 1) * 5) continue; + ((CosmeticElement)cosmeticListElement).handleMouseClick(mouseX, mouseY, mouseButton); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/GuiCosmetics.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/GuiCosmetics.java new file mode 100644 index 0000000..2176d74 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/GuiCosmetics.java @@ -0,0 +1,110 @@ +package com.cheatbreaker.client.ui.mainmenu.cosmetics; + +import java.util.ArrayList; +import java.util.List; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.ui.mainmenu.cosmetics.element.CosmeticElement; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.menus.MainMenu; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiCosmetics extends MainMenuBase { + private final List cosmeticList = new ArrayList(); + private final ResourceLocation leftArrowIcon = new ResourceLocation("client/icons/left.png"); + private final ResourceLocation rightArrowIcon = new ResourceLocation("client/icons/right.png"); + private final GradientTextButton backButton = new GradientTextButton("BACK"); + private final GradientTextButton claimButton = new GradientTextButton("CLAIM"); + private int parsedCosmetics = 0; + + public GuiCosmetics() { + for (Cosmetic cosmetic : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + this.cosmeticList.add(new CosmeticElement(cosmetic, 1.0f)); + } + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + if (CheatBreaker.getInstance().isAprilFools()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Click below for " + EnumChatFormatting.GREEN + "free cosmetics!", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f - 10.0f, -1); + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Limited time only....", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f, -1); + this.claimButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() / 2.0f + 28.0f, 60.0f, 12.0f); + this.claimButton.drawElementHover(x, y, true); + } else if (!CheatBreaker.getInstance().getWSNetHandler().isOpen()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Unable to connect to the server.", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f - 10.0f, -1); + CheatBreaker.getInstance().playRegular16px.drawCenteredStringWithShadow("Please try again later.", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f, -1); + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() / 2.0f + 28.0f, 60.0f, 12.0f); + this.backButton.drawElementHover(x, y, true); + } else { + Gui.drawRect(this.getScaledWidth() / 2.0f - 80.0f, this.getScaledHeight() / 2.0f - 78.0f, this.getScaledWidth() / 2.0f + 80.0f, this.getScaledHeight() / 2.0f + 100.0f, 0x2F000000); + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() / 2.0f + 105.0f, 60.0f, 12.0f); + this.backButton.drawElementHover(x, y, true); + if (this.cosmeticList.isEmpty()) { + CheatBreaker.getInstance().playRegular16px.drawCenteredString("You don't own any cosmetics.", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f, -6381922); + } else { + float var3 = this.getScaledHeight() / 2.0f - 68.0f; + float var4 = this.getScaledHeight() / 2.0f + 92.0f; + float var5 = this.getScaledWidth() / 2.0f + 68.0f; + float var6 = this.getScaledWidth() / 2.0f + 74.0f; + CheatBreaker.getInstance().playBold18px.drawCenteredString("Cosmetics (" + this.cosmeticList.size() + ")", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f - 90.0f, -1); + int var7 = 0; + float var8 = 0.0f; + for (CosmeticElement cosmetic : this.cosmeticList) { + if (++var7 - 1 < this.parsedCosmetics * 5 || var7 - 1 >= (this.parsedCosmetics + 1) * 5) continue; + cosmetic.setDimensions((int)this.getScaledWidth() / 2 - 76, (int)(this.getScaledHeight() + / 2.0f - 72.0f + var8), 152, cosmetic.getHeight()); + cosmetic.handleDrawElement((int) x, (int) y, 1.0f); + var8 += (float)cosmetic.getHeight(); + } + if (this.cosmeticList.size() > 5) { + boolean var11 = x > this.getScaledWidth() / 2.0f - 40.0f && x < this.getScaledWidth() / 2.0f - 1.0f && y > this.getScaledHeight() / 2.0f + 80.0f && y < this.getScaledHeight() / 2.0f + 100.0f; + GL11.glColor4f(0.0f, 0.0f, 0.0f, var11 ? 0.45f : 0.25f); + RenderUtil.renderIcon(this.leftArrowIcon, 4.0f, this.getScaledWidth() / 2.0f - 10.0f, this.getScaledHeight() / 2.0f + 84.0f); + boolean var12 = x > this.getScaledWidth() / 2.0f + 1.0f && x < this.getScaledWidth() / 2.0f + 40.0f && y > this.getScaledHeight() / 2.0f + 80.0f && y < this.getScaledHeight() / 2.0f + 100.0f; + GL11.glColor4f(0.0f, 0.0f, 0.0f, var12 ? 0.45f : 0.25f); + RenderUtil.renderIcon(this.rightArrowIcon, 4.0f, this.getScaledWidth() / 2.0f + 10.0f, this.getScaledHeight() / 2.0f + 84.0f); + } + } + } + } + + @Override + public void mouseClicked(float var1, float var2, int var3) { + super.mouseClicked(var1, var2, var3); + if (this.claimButton.isMouseInside(var1, var2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } else if (this.backButton.isMouseInside(var1, var2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } else { + if (this.cosmeticList.size() > 5) { + boolean var5; + boolean var4 = var1 > this.getScaledWidth() / 2.0f - 40.0f && var1 < this.getScaledWidth() / 2.0f - 1.0f && var2 > this.getScaledHeight() / 2.0f + 80.0f && var2 < this.getScaledHeight() / 2.0f + 100.0f; + boolean bl = var5 = var1 > this.getScaledWidth() / 2.0f + 1.0f && var1 < this.getScaledWidth() / 2.0f + 40.0f && var2 > this.getScaledHeight() / 2.0f + 80.0f && var2 < this.getScaledHeight() / 2.0f + 100.0f; + if (this.parsedCosmetics > 0 && var4) { + --this.parsedCosmetics; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (var5 && (float)(this.parsedCosmetics + 1) < (float)this.cosmeticList.size() / 5.0f) { + ++this.parsedCosmetics; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + } + int var7 = 0; + for (CosmeticElement var6 : this.cosmeticList) { + if (++var7 - 1 < this.parsedCosmetics * 5 || var7 - 1 >= (this.parsedCosmetics + 1) * 5) continue; + var6.handleMouseClick((int)var1, (int)var2, var3); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/element/CosmeticElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/element/CosmeticElement.java new file mode 100644 index 0000000..23c6c21 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/cosmetics/element/CosmeticElement.java @@ -0,0 +1,78 @@ +package com.cheatbreaker.client.ui.mainmenu.cosmetics.element; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class CosmeticElement extends AbstractModulesGuiElement { + private final Cosmetic cosmetic; + private final ResourceLocation checkMark = new ResourceLocation("client/icons/checkmark-32.png"); + + public CosmeticElement(Cosmetic var1, float var2) { + super(var2); + this.height = 30; + this.cosmetic = var1; + } + + @Override + public void handleDrawElement(int mouseX, int var2, float partialTicks) { + boolean var4; + boolean bl = var4 = mouseX > this.x && mouseX < this.x + this.width && var2 > this.y && var2 < this.y + this.height; + if (var4) { + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, 0x2F000000); + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + if (this.cosmetic.getType().getTypeName().equals("cape")) { + Minecraft.getMinecraft().renderEngine.bindTexture(this.cosmetic.getLocation()); + GL11.glPushMatrix(); + GL11.glTranslatef(this.x + 20, this.y + 7, 0.0f); + GL11.glScalef(0.25f, 0.13f, 0.25f); + RenderUtil.drawTexturedModalRect(0.0f, 0.0f, 2.0f, 7.0f, 44, 120); + GL11.glPopMatrix(); + } else { + RenderUtil.renderIcon(this.cosmetic.getPreviewLocation(), 8.0f, (float) (this.x + 20), (float) (this.y + 7)); + } + CheatBreaker.getInstance().playRegular16px.drawString(this.cosmetic.getName().replace("_", " "), this.x + 42, (float) (this.y + this.height / 2 - 5), -1342177281); + if (this.cosmetic.isEquipped()) { + GL11.glColor4f(0.0f, 0.8f, 0.0f, 0.45f); + } else { + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.25f); + } + RenderUtil.drawCircle(this.x + 8, this.y + this.height / 2, 3.0); + } + + @Override + public void handleMouseClick(int mouseX, int mouseY, int button) { + boolean mouseHovered = mouseX > this.x && mouseX < this.x + this.width && mouseY > this.y && mouseY < this.y + this.height; + if (mouseHovered) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + if (this.cosmetic.isEquipped()) { + this.cosmetic.setEquipped(false); + } else if (this.cosmetic.getType() == Cosmetic.CosmeticType.CAPE) { + this.cosmetic.setEquipped(true); + for (Cosmetic var6 : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + if (var6 == this.cosmetic || !var6.getType().equals(Cosmetic.CosmeticType.CAPE)) continue; + var6.setEquipped(false); + } + this.cosmetic.setEquipped(true); + } else { + this.cosmetic.setEquipped(true); + for (Cosmetic var6 : CheatBreaker.getInstance().getCosmeticManager().getFullCosmeticList()) { + if (var6 == this.cosmetic || var6.getType() == Cosmetic.CosmeticType.CAPE) continue; + var6.setEquipped(false); + } + this.cosmetic.setEquipped(true); + } + + CheatBreaker.getInstance().getWSNetHandler().sendClientCosmetics(); + } + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/IconButtonElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/IconButtonElement.java new file mode 100644 index 0000000..17e411e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/IconButtonElement.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.ui.mainmenu.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.fading.ColorFade; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class IconButtonElement extends AbstractElement { + private ResourceLocation resourceLocation; + private String string; + private boolean isString; + private final ColorFade outline; + private final ColorFade topGradient; + private final ColorFade bottomGradient; + private float iconSize = 4; + + public IconButtonElement(ResourceLocation resourceLocation) { + this.resourceLocation = resourceLocation; + this.iconSize = 4; + this.outline = new ColorFade(0x4FFFFFFF, -1353670564); + this.topGradient = new ColorFade(444958085, 1063565678); + this.bottomGradient = new ColorFade(444958085, 1062577506); + } + + public IconButtonElement(float iconSize, ResourceLocation resourceLocation) { + this.resourceLocation = resourceLocation; + this.iconSize = iconSize; + this.outline = new ColorFade(0x4FFFFFFF, -1353670564); + this.topGradient = new ColorFade(444958085, 1063565678); + this.bottomGradient = new ColorFade(444958085, 1062577506); + } + + public IconButtonElement(String string) { + this.string = string; + this.isString = true; + this.outline = new ColorFade(0x4FFFFFFF, -1353670564); + this.topGradient = new ColorFade(444958085, 1063565678); + this.bottomGradient = new ColorFade(444958085, 1062577506); + } + + @Override + protected void handleElementDraw(float mouseX, float mouseY, boolean bl) { + boolean hovering = bl && this.isMouseInside(mouseX, mouseY); + RenderUtil.drawGradientRectWithOutline(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, this.outline.getColor(hovering).getRGB(), this.topGradient.getColor(hovering).getRGB(), this.bottomGradient.getColor(hovering).getRGB()); + if (this.isString) { + CheatBreaker.getInstance().robotoRegular13px.drawCenteredString(this.string, this.xPosition + this.width / 2.0f, this.yPosition + 2.0f, -1); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.4444444f * 0.5538462f); + RenderUtil.renderIcon(this.resourceLocation, this.iconSize, this.xPosition + this.width / 2.0f - this.iconSize, this.yPosition + this.height / 2.0f - this.iconSize); + } + } + + public float getLongerTextWidth() { + return 22 + CheatBreaker.getInstance().robotoRegular13px.getStringWidth(this.string) + 6; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + return false; + } + + public void setResourceLocation(ResourceLocation resourceLocation) { + this.resourceLocation = resourceLocation; + } + + public void setString(String string) { + this.string = string; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextButtonElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextButtonElement.java new file mode 100644 index 0000000..2121f02 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextButtonElement.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.ui.mainmenu.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.fading.ColorFade; + +public class TextButtonElement extends AbstractElement { + public final String string; + private final ColorFade color; + + public TextButtonElement(String string) { + this.string = string; + this.color = new ColorFade(-1879048193, -1); + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + CheatBreaker.getInstance().robotoBold14px.drawString(this.string, this.xPosition + 6.0F, this.yPosition + (float)6, this.color.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextWithShadowButton.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextWithShadowButton.java new file mode 100644 index 0000000..7dfe476 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/element/TextWithShadowButton.java @@ -0,0 +1,40 @@ +package com.cheatbreaker.client.ui.mainmenu.element; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.util.render.wordwrap.WordWrap; + +public class TextWithShadowButton extends AbstractElement { + private final String string; + private final ColorFade color; + private boolean multipleLines = false; + private int maxStringWidth; + + public TextWithShadowButton(String string) { + this.string = string; + this.color = new ColorFade(-1879048193, 0xCFEEEEEE); + } + + public TextWithShadowButton(String string, int maxStringWidth) { + this(string); + this.multipleLines = true; + this.maxStringWidth = maxStringWidth; + } + + @Override + protected void handleElementDraw(float f, float f2, boolean bl) { + if (this.multipleLines) { + String wrapped = WordWrap.from(this.string).maxWidth(50).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + for(String line : lines) { + CheatBreaker.getInstance().playRegular14px.drawStringWithShadow(line, this.xPosition, this.yPosition - CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f + (index * CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f), this.color.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + index++; + } + } else { + CheatBreaker.getInstance().playRegular18px.drawStringWithShadow(this.string, this.xPosition, this.yPosition, this.color.getColor(this.isMouseInside(f, f2) && bl).getRGB()); + } + + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/BuildMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/BuildMenu.java new file mode 100644 index 0000000..7b54ab9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/BuildMenu.java @@ -0,0 +1,62 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.util.render.wordwrap.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; + +public class BuildMenu extends MainMenuBase { + private final GradientTextButton backButton = new GradientTextButton("BACK"); + + @Override + public void initGui() { + super.initGui(); + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() / 2.0f + 55.0f, 60.0f, 12.0f); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + Gui.drawRect(this.getScaledWidth() / 2.0f - 80.0f, this.getScaledHeight() / 2.0f - 40.0f, this.getScaledWidth() / 2.0f + 80.0f, this.getScaledHeight() / 2.0f + 50.0f, 0x2F000000); + this.backButton.drawElementHover(x, y, true); + String buildInfo = ""; + switch (CheatBreaker.getInstance().getGitBuildVersion()) { + case "Dev": + buildInfo = "Development builds are not intended for bug testing purposes; however, expect bugs to appear."; + break; + case "Beta": + buildInfo = "Beta builds are used to test for potential issues. Expect bugs to occur over time."; + break; + case "Preview": + buildInfo = "Preview builds are intended to become the next stable build. Bugs should be less prominent."; + break; + case "Special Edition": + buildInfo = "Special Edition builds are used for very special events. Treat them with care."; + break; + } + String buildType = CheatBreaker.getInstance().getGitBuildVersion().isEmpty() ? "Production" : CheatBreaker.getInstance().getGitBuildVersion(); + String wrapped = WordWrap.from(buildInfo).maxWidth(40).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + for(String line : lines) { + CheatBreaker.getInstance().playRegular14px.drawCenteredString(line, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 14.0f + (index * CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f), 0xFFDDDDDD); + index++; + } + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Commit: " + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch(), this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 14.0f - (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), 0xFFEEEEEE); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Minecraft Version: " + Config.MC_VERSION, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f - 6.0f - (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), 0xFFEEEEEE); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Build Version: " + buildType, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f - (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), 0xFFEEEEEE); + } + + public void mouseClicked(float var1, float var2, int var3) { + super.mouseClicked(var1, var2, var3); + if (this.backButton.isMouseInside(var1, var2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/CBOldMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/CBOldMenu.java new file mode 100644 index 0000000..46c4d37 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/CBOldMenu.java @@ -0,0 +1,80 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + + +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + + +public class CBOldMenu extends GuiMainMenu { + private double eventButton; + private float lastMouseEvent = 0.0f; + private final ResourceLocation logoOuter = new ResourceLocation("client/logo_outer.png"); + private final ResourceLocation logoInner = new ResourceLocation("client/logo_inner.png"); + + @Override + public void initGui() { + int n = this.height / 4 + 48; + this.addSingleplayerMultiplayerButtons(n, 24); + super.initGui(); + } + + @Override + public void updateScreen() { + super.updateScreen(); + this.eventButton += 0.06283185307179587; + this.lastMouseEvent = (float)((Math.sin(this.eventButton) / 2.0 + 0.5) * 180.0); + } + + @Override + protected void keyTyped(char c, int n) { + + if (n == 1 && Minecraft.getMinecraft().currentScreen instanceof CBOldMenu) { + return; + } + + super.keyTyped(c, n); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + Tessellator tessellator = Tessellator.instance; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0f, 20, 0.0f); + Gui.drawRect(this.width / 2F - 71, this.height / 4F - 40, this.width / 2F + 71, this.height / 4F + 110, -1342177281); + Gui.drawRect(this.width / 2F - 73, this.height / 4F - 42, this.width / 2F - 71, this.height / 4F + 112, 0x3FFFFFFF); + Gui.drawRect(this.width / 2F + 71, this.height / 4F - 42, this.width / 2F + 73, this.height / 4F + 112, 0x3FFFFFFF); + Gui.drawRect(this.width / 2F - 71, this.height / 4F + 110, this.width / 2F + 71, this.height / 4F + 112, 0x3FFFFFFF); + Gui.drawRect(this.width / 2F - 71, this.height / 4F - 42, this.width / 2F + 71, this.height / 4F - 40, 0x3FFFFFFF); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.9f); + GL11.glPushMatrix(); + float f2 = 0.8648649f * 0.7515625f; + GL11.glScalef(f2, f2, f2); + GL11.glPushMatrix(); + GL11.glTranslatef(((float)(this.width / 2) - 40.0F * f2) / f2, ((float)(this.height / 4) - 40.0F * f2) / f2, 0.0f); + int n3 = 40; + GL11.glTranslatef(n3, n3, n3); + GL11.glRotatef(this.lastMouseEvent, 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-n3, -n3, -n3); + RenderUtil.renderIcon(this.logoOuter, (float)n3, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderIcon(this.logoInner, 40.0F, ((float)(this.width / 2) - 40.0F * f2) / f2, ((float)(this.height / 4) - 39.0F * f2) / f2); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + tessellator.setColorOpaque_I(-1); + super.lIIIIIIIIIlIllIIllIlIIlIl(mouseX, mouseY); + } + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + if (mouseX >= 7 && mouseX <= 39 && mouseY >= 5 && mouseY <= 20) { + MainMenuBase.switchMenu(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogDetailMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogDetailMenu.java new file mode 100644 index 0000000..38b622c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogDetailMenu.java @@ -0,0 +1,96 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.render.wordwrap.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class ChangelogDetailMenu extends MainMenuBase { + private final String title; + private final String author; + private final String description; + + private final GradientTextButton backButton; + private final ScrollableElement scrollableElement; + + public ChangelogDetailMenu(String title, String author, String description) { + this.title = title; + this.author = author; + this.description = description; + + this.backButton = new GradientTextButton("BACK"); + this.scrollableElement = new ScrollableElement(null); + } + + @Override + public void initGui() { + super.initGui(); + float f = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f3 = this.getScaledWidth() / 2.0f + f / 2.0f; + float f4 = 40; + float f5 = this.getScaledHeight() - 40.0f; + this.scrollableElement.setElementSize(f3 - 8.0f, f4 + 18.0f, 4.0f, f5 - f4 - 28.0f); + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + this.scrollableElement.handleElementMouse(); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + float f3 = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float leftPos = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float rightPos = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float topPos = 40; + float bottomPos = this.getScaledHeight() - 40.0f; + Gui.drawRect(leftPos, topPos, rightPos, bottomPos, 0x2F000000); + Gui.drawRect(leftPos + 8.0F, topPos + 22F, rightPos - 8.0F, topPos + 22.5F, 0x1AFFFFFF); + + CheatBreaker.getInstance().playRegular16px.drawString(this.title, leftPos + 8.0f, topPos + 5.0f, -1); + CheatBreaker.getInstance().playRegular14px.drawString(EnumChatFormatting.ITALIC + "Posted by " + EnumChatFormatting.BOLD + this.author, leftPos + 8.0f, topPos + 13.0f, -1); + String wrapped = WordWrap.from(this.description).maxWidth(60).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + + int index = 0; + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() - 35.0f, 60.0f, 12); + this.backButton.drawElementHover(x, y, true); + this.scrollableElement.drawScrollable(x, y, true); + GL11.glPushMatrix(); + GL11.glEnable(3089); + + RenderUtil.startScissorBox((int) leftPos, (int) topPos + 18, (int) rightPos, (int) bottomPos - 8, (float) ((int) ((float) this.getScaledResolution().getScaleFactor() * this.getScaleFactor())), (int) this.getScaledHeight()); + for (String line : lines) { + CheatBreaker.getInstance().playRegular14px.drawString(line, leftPos + 8.0f, topPos + 24.0f + (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), -1); + index++; + } + + this.scrollableElement.setScrollAmount(index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f) + 2.0f); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.drawElementHover(x, y, true); + } + + @Override + public void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + if (this.backButton.isMouseInside(f, f2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(this.mc.lastScreen); + } else if (this.scrollableElement.isMouseInside(f, f2)) { + this.scrollableElement.handleElementMouseClicked(f, f2, n, true); + } + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogMenu.java new file mode 100644 index 0000000..6243ba7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ChangelogMenu.java @@ -0,0 +1,128 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.mainmenu.buttons.ChangeLogButton; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableList; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import lombok.SneakyThrows; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class ChangelogMenu extends MainMenuBase { + private final GradientTextButton backButton; + private final ScrollableElement scrollableElement; + private final List changeLogButtonList = new ArrayList<>(); + public static JsonObject changelogObject; + + public ChangelogMenu() { + this.backButton = new GradientTextButton("BACK"); + this.scrollableElement = new ScrollableElement(null); + this.loadChangelog(); + } + + @Override + public void initGui() { + super.initGui(); + float f = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f2 = this.getScaledWidth() / 2.0f - f / 2.0f; + float f3 = this.getScaledWidth() / 2.0f + f / 2.0f; + float f4 = 40; + float f5 = this.getScaledHeight() - 40.0f; + this.scrollableElement.setElementSize(f3 - 8.0f, f4 + 18.0f, 4.0f, f5 - f4 - 28.0f); + int n = 0; + float f6 = 22; + for (ChangeLogButton button : this.changeLogButtonList) { + button.setElementSize(f2 + 8.0f, f4 + 20.0f + (float) n * (f6 + 1.0f), f - 16.0f, f6); + ++n; + } + this.scrollableElement.setScrollAmount((float) this.changeLogButtonList.size() * (f6 + 1.0f) + 2.0f); + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + this.scrollableElement.handleElementMouse(); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + float f3 = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f4 = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float f5 = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float f6 = 40; + float f7 = this.getScaledHeight() - 40.0f; + Gui.drawRect(f4, f6, f5, f7, 0x2F000000); + Gui.drawRect(f4 + 8.0f, f6 + 16.0f, f5 - 8.0f, f6 + 0.15789473f * 104.50001f, 0x1AFFFFFF); + CheatBreaker.getInstance().playRegular16px.drawString("CHANGELOG", f4 + 8.0f, f6 + 5.0f, -1); + if (this.changeLogButtonList.size() < 1) { + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Nothing has changed in the client, that's odd!", this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 4.0f, -6381922); + } + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() - 35.0f, 60.0f, 12); + this.backButton.drawElementHover(x, y, true); + this.scrollableElement.drawScrollable(x, y, true); + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int) f4, (int) f6 + 18, (int) f5, (int) f7 - 8, (float) ((int) ((float) this.getScaledResolution().getScaleFactor() * this.getScaleFactor())), (int) this.getScaledHeight()); + for (ChangeLogButton changeLogButton : this.changeLogButtonList) { + changeLogButton.drawElementHover(x, y - this.scrollableElement.getPosition(), !this.scrollableElement.isButtonHeld()); + } + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.drawElementHover(x, y, true); + } + + @Override + public void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + if (this.backButton.isMouseInside(f, f2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } else if (this.scrollableElement.isMouseInside(f, f2)) { + this.scrollableElement.handleElementMouseClicked(f, f2, n, true); + } else { + float f3 = Math.min((float) 240, this.getScaledWidth() - (float) 10); + float f4 = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float f5 = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float f6 = 40; + float f7 = this.getScaledHeight() - (float) 40; + if (f > f4 && f < f5 && f2 > f6 && f2 < f7) { + for (ChangeLogButton button : this.changeLogButtonList) { + button.handleElementMouseClicked(f, f2 - this.scrollableElement.getPosition(), n, button.isMouseInside(f, f2 - this.scrollableElement.getPosition()) && !this.scrollableElement.isButtonHeld()); + } + } + } + } + + @SneakyThrows + private void loadChangelog() { + String branchToCheck = CheatBreaker.getInstance().getGitBranch(); + if (changelogObject.toString().contains("\"?\"") && CheatBreaker.getInstance().getGitBranch().equalsIgnoreCase("dev")) { + branchToCheck = "?"; + } else if (changelogObject == null || !changelogObject.toString().contains("\"" + CheatBreaker.getInstance().getGitBranch() + "\"")) return; + + Set> entries = changelogObject.getAsJsonObject(branchToCheck).entrySet(); + for (Map.Entry changelog : entries) { + JsonObject changelogObject = changelog.getValue().getAsJsonObject(); + String title = changelog.getKey(); + String author = changelogObject.get("author").getAsString(); + String description = changelogObject.get("description").getAsString(); + + this.changeLogButtonList.add(new ChangeLogButton(title, author, description)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ConfidentialBuildNoticeMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ConfidentialBuildNoticeMenu.java new file mode 100644 index 0000000..b6c5192 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/ConfidentialBuildNoticeMenu.java @@ -0,0 +1,96 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.render.wordwrap.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ConfidentialBuildNoticeMenu extends MainMenuBase { + private final GradientTextButton backButton; + private final ScrollableElement scrollableElement; + private final boolean skipFirstLine = false; + + public ConfidentialBuildNoticeMenu() { + this.backButton = new GradientTextButton("BACK"); + this.scrollableElement = new ScrollableElement(null); + } + + @Override + public void initGui() { + super.initGui(); + float f = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float f3 = this.getScaledWidth() / 2.0f + f / 2.0f; + float f4 = 40; + float f5 = this.getScaledHeight() - 40.0f; + this.scrollableElement.setElementSize(f3 - 8.0f, f4 + 18.0f, 4.0f, f5 - f4 - 28.0f); + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + this.scrollableElement.handleElementMouse(); + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + float f3 = Math.min(240.0f, this.getScaledWidth() - 10.0f); + float leftPos = this.getScaledWidth() / 2.0f - f3 / 2.0f; + float rightPos = this.getScaledWidth() / 2.0f + f3 / 2.0f; + float topPos = 40; + float bottomPos = this.getScaledHeight() - 40.0f; + Gui.drawRect(leftPos, topPos, rightPos, bottomPos, 0x2F000000); + Gui.drawRect(leftPos + 8.0f, topPos + 16.0f, rightPos - 8.0f, topPos + 0.15789473f * 104.50001f, 0x1AFFFFFF); + String title = "About confidential builds"; + CheatBreaker.getInstance().playRegular16px.drawString(title.toUpperCase(), leftPos + 8.0f, topPos + 5.0f, -1); + String description = "PLEASE READ THIS SECTION CAREFULLY." + + "\n\n" + + "You are currently using a private CheatBreaker build. Private builds have certain restrictions in place which are described below:" + + "\n\n" + + "Branch " + CheatBreaker.getInstance().getGitBranch() + " restrictions:" + + "\n- Disclosure to any user below the lowest authorized ranking is prohibited. This includes but is not limited to new changes inside the build such as new features, fixes, and improvements." + + "\n- Recording/streaming on this build is not recommended, but allowed to a certain extent. If any capturing software is showing this build, do not show any changes from this build that differ from the master branch. If, however, you are recording to submit a bug report, these restrictions do not apply." + + "\n\n" + + "Management reserves the rights to restrict your access to future builds if you violate any restrictions applied."; + String wrapped = WordWrap.from(description).maxWidth(60).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + int currentLine = 0; + this.backButton.setElementSize(this.getScaledWidth() / 2.0f - 30.0f, this.getScaledHeight() - 35.0f, 60.0f, 12); + this.backButton.drawElementHover(x, y, true); + this.scrollableElement.drawScrollable(x, y, true); + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int)leftPos, (int)topPos + 18, (int)rightPos, (int)bottomPos - 8, (float)((int)((float)this.getScaledResolution().getScaleFactor() * this.getScaleFactor())), (int)this.getScaledHeight()); + for (String line : lines) { + if (this.skipFirstLine && currentLine == 0) { + currentLine++; + continue; + } + CheatBreaker.getInstance().playRegular14px.drawString(line, leftPos + 8.0f, topPos + 18.0f + (index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f)), -1); + index++; + } + this.scrollableElement.setScrollAmount(index * (CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f) + 2.0f); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.drawElementHover(x, y, true); + } + + @Override + public void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + if (this.backButton.isMouseInside(f, f2)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new MainMenu()); + } else if (this.scrollableElement.isMouseInside(f, f2)) { + this.scrollableElement.handleElementMouseClicked(f, f2, n, true); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/GuiCreditsMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/GuiCreditsMenu.java new file mode 100644 index 0000000..8b4c7c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/GuiCreditsMenu.java @@ -0,0 +1,171 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +public class GuiCreditsMenu extends GuiScreen { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146576_f = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation field_146577_g = new ResourceLocation("textures/misc/vignette.png"); + private int field_146581_h; + private List field_146582_i; + private int field_146579_r; + private final float field_146578_s = 0.5F; + + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + ++this.field_146581_h; + float var1 = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + + if ((float)this.field_146581_h > var1) { + this.func_146574_g(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (p_73869_2_ == 1) { + this.func_146574_g(); + } + } + + private void func_146574_g() { + this.mc.displayGuiScreen(this.mc.lastScreen); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + if (this.field_146582_i == null) { + this.field_146582_i = new ArrayList(); + + try { + String var1; + short var3 = 274; + + BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); + + while ((var1 = var4.readLine()) != null) { + var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); + var1 = var1.replaceAll("\t", " "); + this.field_146582_i.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); + this.field_146582_i.add(""); + } + + this.field_146579_r = this.field_146582_i.size() * 12; + } catch (Exception var9) { + logger.error("Couldn't load credits", var9); + } + } + } + + private void func_146575_b(int p_146575_1_, int p_146575_2_, float p_146575_3_) { + Tessellator var4 = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + var4.startDrawingQuads(); + var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + int var5 = this.width; + float var6 = 0.0F - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float var7 = (float)this.height - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float var8 = 0.015625F; + float var9 = ((float)this.field_146581_h + p_146575_3_ - 0.0F) * 0.02F; + float var10 = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + float var11 = (var10 - 20.0F - ((float)this.field_146581_h + p_146575_3_)) * 0.005F; + + if (var11 < var9) { + var9 = var11; + } + + if (var9 > 1.0F) { + var9 = 1.0F; + } + + var9 *= var9; + var9 = var9 * 96.0F / 255.0F; + var4.setColorOpaque_F(var9, var9, var9); + var4.addVertexWithUV(0.0D, this.height, zLevel, 0.0D, var6 * var8); + var4.addVertexWithUV(var5, this.height, zLevel, (float)var5 * var8, var6 * var8); + var4.addVertexWithUV(var5, 0.0D, zLevel, (float)var5 * var8, var7 * var8); + var4.addVertexWithUV(0.0D, 0.0D, zLevel, 0.0D, var7 * var8); + var4.draw(); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.func_146575_b(p_73863_1_, p_73863_2_, p_73863_3_); + Tessellator var4 = Tessellator.instance; + short var5 = 274; + int var6 = this.width / 2 - var5 / 2; + int var7 = this.height + 50; + float var8 = -((float)this.field_146581_h + p_73863_3_) * this.field_146578_s; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, var8, 0.0F); + this.mc.getTextureManager().bindTexture(field_146576_f); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + drawTexturedModalRect(var6, var7, 0, 0, 155, 44); + drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44); + GL11.glDisable(GL11.GL_ALPHA_TEST); + int var9 = var7 + 200; + int var10; + + for (var10 = 0; var10 < this.field_146582_i.size(); ++var10) { + if (var10 == this.field_146582_i.size() - 1) { + float var11 = (float)var9 + var8 - (float)(this.height / 2 - 6); + + if (var11 < 0.0F) { + GL11.glTranslatef(0.0F, -var11, 0.0F); + } + } + + if ((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) { + String var12 = (String)this.field_146582_i.get(var10); + + if (var12.startsWith("[C]")) { + this.fontRendererObj.drawStringWithShadow(var12.substring(3), var6 + (var5 - this.fontRendererObj.getStringWidth(var12.substring(3))) / 2, var9, 16777215); + } else { + this.fontRendererObj.fontRandom.setSeed((long)var10 * 4238972211L + (long)(this.field_146581_h / 4)); + this.fontRendererObj.drawStringWithShadow(var12, var6, var9, 16777215); + } + } + + var9 += 12; + } + + GL11.glPopMatrix(); + this.mc.getTextureManager().bindTexture(field_146577_g); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); + var4.startDrawingQuads(); + var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + var10 = this.width; + int var13 = this.height; + var4.addVertexWithUV(0.0D, var13, zLevel, 0.0D, 1.0D); + var4.addVertexWithUV(var10, var13, zLevel, 1.0D, 1.0D); + var4.addVertexWithUV(var10, 0.0D, zLevel, 1.0D, 0.0D); + var4.addVertexWithUV(0.0D, 0.0D, zLevel, 0.0D, 0.0D); + var4.draw(); + GL11.glDisable(GL11.GL_BLEND); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/MainMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/MainMenu.java new file mode 100644 index 0000000..472a3f4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/MainMenu.java @@ -0,0 +1,143 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.MinMaxFade; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiMultiplayer; +import net.minecraft.client.gui.GuiSelectWorld; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import javax.swing.*; +import java.awt.*; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +public class MainMenu extends MainMenuBase { + private final ResourceLocation outerLogo = new ResourceLocation("client/logo_255_outer.png"); + private final ResourceLocation innerLogo = new ResourceLocation("client/logo_108_inner.png"); + private final GradientTextButton singleplayerButton = new GradientTextButton("SINGLEPLAYER"); + private final GradientTextButton multiplayerButton = new GradientTextButton("MULTIPLAYER"); + private final GradientTextButton unlockTheCodeButton = new GradientTextButton("RETRIEVE SOURCE CODE"); + private final MinMaxFade logoMoveUpTime = new MinMaxFade(750L); + private final CosineFade outerLogoRotationTime = new CosineFade(4000L); + private final MinMaxFade backgroundFadeOutTime = new MinMaxFade(400L); + public static int menuCounter; + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + } + + @Override + public void updateScreen() { + super.updateScreen(); + if (this.isFromLoadingScreen() && !this.logoMoveUpTime.isTimeNotAtZero()) { + this.logoMoveUpTime.startAnimation(); + } + if (!(this.isFromLoadingScreen() && !this.logoMoveUpTime.isOver() || this.outerLogoRotationTime.isTimeNotAtZero())) { + this.backgroundFadeOutTime.startAnimation(); + this.outerLogoRotationTime.startAnimation(); + this.outerLogoRotationTime.loopAnimation(); + } + } + + @Override + public void initGui() { + super.initGui(); + this.singleplayerButton.setElementSize(this.getScaledWidth() / 2.0f - (float) 50, this.getScaledHeight() / 2.0f + 5.0F, 100.0F, 12); + this.multiplayerButton.setElementSize(this.getScaledWidth() / 2.0f - 50.0F, this.getScaledHeight() / 2.0f + 24.0F, 100.0F, 12); +// this.unlockTheCodeButton.setElementSize(this.getScaledWidth() / 2.0f - 50.0F, this.getScaledHeight() / 2.0f + 43.0F, 100.0F, 12); + ++menuCounter; + } + + @Override + public void drawMenu(float x, float y) { + super.drawMenu(x, y); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.singleplayerButton.drawElementHover(x, y, true); + this.multiplayerButton.drawElementHover(x, y, true); +// this.unlockTheCodeButton.drawElementHover(x, y, true); + Gui.drawRect(this.singleplayerButton.getXPosition() - (float) 20, this.getScaledHeight() / 2.0f - (float) 80, this.singleplayerButton.getXPosition() + this.singleplayerButton.getWidth() + (float) 20, this.multiplayerButton.getYPosition() + this.multiplayerButton.getHeight() + (float) 14, 0x2F000000); + float f3 = this.isFromLoadingScreen() ? this.logoMoveUpTime.getFadeAmount() : 1.0f; + if (this.isFromLoadingScreen()) { + Gui.drawRect(0.0f, 0.0f, this.getScaledWidth(), this.getScaledHeight(), new Color(1.0f, 1.0f, 1.0f, 1.0f - this.backgroundFadeOutTime.getFadeAmount()).getRGB()); + } + this.drawLogo(this.getScaledWidth(), this.getScaledHeight(), f3); + float f5 = this.getScaledWidth() / 2.0f - 80.0F; + float f6 = this.getScaledHeight() - 40.0F; + CheatBreaker.getInstance().ubuntuMedium14px.drawCenteredString("finished", this.getScaledWidth() / 2.0f, f6 - 11.0f, new Color(208, 208, 208, (int) ((float) 255 * (1.0f - Math.min(f3, 0.984f)))).getRGB()); + RenderUtil.drawRoundedRect(f5, f6, f5 + (float) 160, f6 + (float) 10, 8, new Color(218, 66, 83, (int) ((float) 255 * (1.0f - f3))).getRGB()); + } + + private void drawLogo(double x, double y, float yPosMover) { + float size = 27; + double x2 = x / 2.0 - (double) size; + double y2 = y / 2.0 - (double) size - (double) (35.0F * yPosMover); + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glTranslatef((float) x2, (float) y2, 1.0f); + GL11.glTranslatef(size, size, size); + GL11.glRotatef(180.0F * this.outerLogoRotationTime.getFadeAmount(), 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-size, -size, -size); + RenderUtil.renderEIcon(this.outerLogo, size, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderEIcon(this.innerLogo, size, (float) x2, (float) y2); + } + + @Override + protected void mouseClicked(float f, float f2, int n) { + super.mouseClicked(f, f2, n); + this.singleplayerButton.handleElementMouseClicked(f, f2, n, true); + this.multiplayerButton.handleElementMouseClicked(f, f2, n, true); + if (this.singleplayerButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } else if (this.multiplayerButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } else if (this.unlockTheCodeButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + new Thread(() -> JOptionPane.showMessageDialog( + null, + "Retreiving CheatBreaker Source Code...." + + "\n\nThis may take a moment." + , "Please wait", 1 + )).start(); + new Thread(() -> { + try { + Thread.sleep(10000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + for (int var4 = 0; var4 < 50; ++var4) { + try { + this.openLink(new URI("https://www.youtube.com/watch?v=dQw4w9WgXcQ")); + try { + Thread.sleep(50L); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } catch (URISyntaxException e) { + CheatBreaker.getInstance().getLogger().error("Couldn't open link", e); + } + } + }).start(); + } + } + + public boolean isFromLoadingScreen() { + return menuCounter == 1; + } + + public MinMaxFade getBackgroundFadeOutTime() { + return this.backgroundFadeOutTime; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/VanillaMenu.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/VanillaMenu.java new file mode 100644 index 0000000..bf80f57 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/mainmenu/menus/VanillaMenu.java @@ -0,0 +1,415 @@ +package com.cheatbreaker.client.ui.mainmenu.menus; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.*; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.resources.I18n; +import net.minecraft.realms.RealmsBridge; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Random; + +public class VanillaMenu extends GuiScreen implements GuiYesNoCallback { + private static final Logger eventButton = LogManager.getLogger(); + private static final Random lastMouseEvent = new Random(); + private final float field_146298_h; + private String splashText = "missingno"; + private GuiButton buttonResetDemo; + private int panoramaTimer; + private DynamicTexture viewportTexture; + private final Object threadLock = new Object(); + private String field_92025_p; + private String field_146972_A; + private String field_104024_v; + private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); + private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; + public static final String selectedButton = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; + private int field_92024_r; + private int field_92023_s; + private int field_92022_t; + private int field_92021_u; + private int field_92020_v; + private int field_92019_w; + private ResourceLocation backgroundTexture; + private double lllIlIIllllIIIIlIllIlIIII; + private float lIIIIlllIIlIlllllIlIllIII = 0.0f; + private final ResourceLocation logoOuter = new ResourceLocation("client/logo_outer.png"); + private final ResourceLocation logoInner = new ResourceLocation("client/logo_inner.png"); + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public VanillaMenu() { + this.field_146972_A = selectedButton; + BufferedReader var1 = null; + try { + String var3; + ArrayList var2 = new ArrayList(); + var1 = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); + while ((var3 = var1.readLine()) != null) { + if ((var3 = var3.trim()).isEmpty()) continue; + var2.add(var3); + } + if (!var2.isEmpty()) { + do { + this.splashText = var2.get(lastMouseEvent.nextInt(var2.size())); + } while (this.splashText.hashCode() == 125780783); + } + } catch (IOException ignored) {} + finally { + if (var1 != null) { + try { + var1.close(); + } catch (IOException ignored) {} + } + } + this.field_146298_h = lastMouseEvent.nextFloat(); + this.field_92025_p = ""; + if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.func_153193_b()) { + this.field_92025_p = I18n.format("title.oldgl1"); + this.field_146972_A = I18n.format("title.oldgl2"); + this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game"; + } + } + + @Override + public void updateScreen() { + ++this.panoramaTimer; + this.lllIlIIllllIIIIlIllIlIIII += 0.06283185307179587; + this.lIIIIlllIIlIlllllIlIllIII = (float)((Math.sin(this.lllIlIIllllIIIIlIllIlIIII) / 2.0 + 0.5) * 180.0); + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + protected void keyTyped(char var1, int var2) { + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + @Override + public void initGui() { + this.viewportTexture = new DynamicTexture(256, 256); + this.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); + Calendar var1 = Calendar.getInstance(); + var1.setTime(new Date()); + if (var1.get(2) + 1 == 11 && var1.get(5) == 9) { + this.splashText = "Happy birthday, ez!"; + } else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) { + this.splashText = "Happy birthday, Notch!"; + } else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) { + this.splashText = "Merry X-mas!"; + } else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) { + this.splashText = "Happy new year!"; + } else if (var1.get(2) + 1 == 10 && var1.get(5) == 31) { + this.splashText = "OOoooOOOoooo! Spooky!"; + } + boolean var2 = true; + int var3 = this.height / 4 + 48; + if (this.mc.isDemo()) { + this.lIIIIIIIIIlIllIIllIlIIlIl(var3, 24); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI(var3, 24); + } + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, var3 + 48, 98, 20, I18n.format("menu.options"))); + this.buttonList.add(new GuiButton(4, this.width / 2 + 2, var3 + 48, 98, 20, I18n.format("menu.quit"))); + this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 48)); + Object var4 = this.threadLock; + Object var5 = this.threadLock; + Object object = this.threadLock; + synchronized (object) { + this.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p); + this.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A); + int var6 = Math.max(this.field_92023_s, this.field_92024_r); + this.field_92022_t = (this.width - var6) / 2; + this.field_92021_u = this.buttonList.get(0).field_146129_i - 24; + this.field_92020_v = this.field_92022_t + var6; + this.field_92019_w = this.field_92021_u + 24; + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(int var1, int var2) { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, var1, I18n.format("menu.singleplayer"))); + this.buttonList.add(new GuiButton(2, this.width / 2 - 100, var1 + var2 * 1, I18n.format("menu.multiplayer"))); + } + + private void lIIIIIIIIIlIllIIllIlIIlIl(int var1, int var2) { + this.buttonList.add(new GuiButton(11, this.width / 2 - 100, var1, I18n.format("menu.playdemo"))); + this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, var1 + var2 * 1, I18n.format("menu.resetdemo")); + this.buttonList.add(this.buttonResetDemo); + ISaveFormat var3 = this.mc.getSaveLoader(); + WorldInfo var4 = var3.getWorldInfo("Demo_World"); + if (var4 == null) { + this.buttonResetDemo.enabled = false; + } + } + + @Override + protected void actionPerformed(GuiButton var1) { + ISaveFormat var2; + WorldInfo var3; + if (var1.id == 0) { + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } + if (var1.id == 5) { + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } + if (var1.id == 1) { + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } + if (var1.id == 2) { + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } + if (var1.id == 14) { + this.IlIlIIIlllIIIlIlllIlIllIl(); + } + if (var1.id == 4) { + this.mc.shutdown(); + } + if (var1.id == 11) { + this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); + } + if (var1.id == 12 && (var3 = (var2 = this.mc.getSaveLoader()).getWorldInfo("Demo_World")) != null) { + GuiYesNo var4 = GuiSelectWorld.func_152129_a(this, var3.getWorldName(), 12); + this.mc.displayGuiScreen(var4); + } + } + + private void IlIlIIIlllIIIlIlllIlIllIl() { + RealmsBridge var1 = new RealmsBridge(); + var1.switchToRealms(this); + } + + @Override + public void confirmClicked(boolean var1, int var2) { + if (var1 && var2 == 12) { + ISaveFormat var6 = this.mc.getSaveLoader(); + var6.flushCache(); + var6.deleteWorldDirectory("Demo_World"); + this.mc.displayGuiScreen(this); + } else if (var2 == 13) { + if (var1) { + try { + Class var3 = Class.forName("java.awt.Desktop"); + Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke(null); + var3.getMethod("browse", URI.class).invoke(var4, new URI(this.field_104024_v)); + } catch (Throwable var5) { + eventButton.error("Couldn't open link", var5); + } + } + this.mc.displayGuiScreen(this); + } + } + + private void lIIIIIIIIIlIllIIllIlIIlIl(int var1, int var2, float var3) { + Tessellator var4 = Tessellator.instance; + GL11.glMatrixMode(5889); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + Project.gluPerspective(120.0f, 1.0f, 0.05f, 10.0f); + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + GL11.glEnable(3042); + GL11.glDisable(3008); + GL11.glDisable(2884); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + int var5 = 8; + for (int var6 = 0; var6 < var5 * var5; ++var6) { + GL11.glPushMatrix(); + float var7 = ((float)(var6 % var5) / (float)var5 - 0.5f) / 64.0f; + float var8 = ((float)(var6 / var5) / (float)var5 - 0.5f) / 64.0f; + float var9 = 0.0f; + GL11.glTranslatef(var7, var8, var9); + GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + var3) / 400.0f) * 25.0f + 20.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(-((float)this.panoramaTimer + var3) * 0.055882353f * 1.7894737f, 0.0f, 1.0f, 0.0f); + for (int var10 = 0; var10 < 6; ++var10) { + GL11.glPushMatrix(); + if (var10 == 1) { + GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 2) { + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 3) { + GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); + } + if (var10 == 4) { + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + } + if (var10 == 5) { + GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); + } + this.mc.getTextureManager().bindTexture(titlePanoramaPaths[var10]); + var4.startDrawingQuads(); + var4.setColorRGBA_I(0xFFFFFF, 255 / (var6 + 1)); + float var11 = 0.0f; + var4.addVertexWithUV(-1.0, -1.0, 1.0, 0.0f + var11, 0.0f + var11); + var4.addVertexWithUV(1.0, -1.0, 1.0, 1.0f - var11, 0.0f + var11); + var4.addVertexWithUV(1.0, 1.0, 1.0, 1.0f - var11, 1.0f - var11); + var4.addVertexWithUV(-1.0, 1.0, 1.0, 0.0f + var11, 1.0f - var11); + var4.draw(); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + GL11.glColorMask(true, true, true, false); + } + var4.setTranslation(0.0, 0.0, 0.0); + GL11.glColorMask(true, true, true, true); + GL11.glMatrixMode(5889); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glEnable(2884); + GL11.glEnable(2929); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(float var1) { + this.mc.getTextureManager().bindTexture(this.backgroundTexture); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColorMask(true, true, true, false); + Tessellator var2 = Tessellator.instance; + var2.startDrawingQuads(); + GL11.glDisable(3008); + int var3 = 3; + for (int var4 = 0; var4 < var3; ++var4) { + var2.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f / (float)(var4 + 1)); + int var5 = this.width; + int var6 = this.height; + float var7 = (float)(var4 - var3 / 2) / 256.0f; + var2.addVertexWithUV(var5, var6, zLevel, 0.0f + var7, 1.0); + var2.addVertexWithUV(var5, 0.0, zLevel, 1.0f + var7, 1.0); + var2.addVertexWithUV(0.0, 0.0, zLevel, 1.0f + var7, 0.0); + var2.addVertexWithUV(0.0, var6, zLevel, 0.0f + var7, 0.0); + } + var2.draw(); + GL11.glEnable(3008); + GL11.glColorMask(true, true, true, true); + } + + private void IlllIIIlIlllIllIlIIlllIlI(int var1, int var2, float var3) { + this.mc.getFramebuffer().unbindFramebuffer(); + GL11.glViewport(0, 0, 256, 256); + this.lIIIIIIIIIlIllIIllIlIIlIl(var1, var2, var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3); + this.mc.getFramebuffer().bindFramebuffer(true); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + Tessellator var4 = Tessellator.instance; + var4.startDrawingQuads(); + float var5 = this.width > this.height ? 120.0f / (float)this.width : 120.0f / (float)this.height; + float var6 = (float)this.height * var5 / 256.0f; + float var7 = (float)this.width * var5 / 256.0f; + var4.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f); + int var8 = this.width; + int var9 = this.height; + var4.addVertexWithUV(0.0, var9, zLevel, 0.5f - var6, 0.5f + var7); + var4.addVertexWithUV(var8, var9, zLevel, 0.5f - var6, 0.5f - var7); + var4.addVertexWithUV(var8, 0.0, zLevel, 0.5f + var6, 0.5f - var7); + var4.addVertexWithUV(0.0, 0.0, zLevel, 0.5f + var6, 0.5f + var7); + var4.draw(); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GL11.glDisable(3008); + this.IlllIIIlIlllIllIlIIlllIlI(mouseX, mouseY, partialTicks); + GL11.glEnable(3008); + Tessellator var4 = Tessellator.instance; + int var5 = 274; + int var6 = this.width / 2 - var5 / 2; + boolean var7 = true; + VanillaMenu.drawGradientRect(0.0f, 0.0f, (float)this.width, (float)this.height, -2130706433, 0xFFFFFF); + VanillaMenu.drawGradientRect(0.0f, 0.0f, (float)this.width, (float)this.height, 0, Integer.MIN_VALUE); + GL11.glPushMatrix(); + GL11.glTranslatef(this.width / 2 - 40, this.height / 4 - 40, 0.0f); + int var8 = 40; + GL11.glTranslatef(var8, var8, var8); + GL11.glRotatef(this.lIIIIlllIIlIlllllIlIllIII, 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-var8, -var8, -var8); + RenderUtil.renderIcon(this.logoOuter, (float)var8, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderIcon(this.logoInner, 40.0f, (float)(this.width / 2 - 40), (float)(this.height / 4 - 38)); + var4.setColorOpaque_I(-1); + GL11.glPushMatrix(); + GL11.glTranslatef(this.width / 2 + 90, 70.0f, 0.0f); + GL11.glRotatef(-20.0f, 0.0f, 0.0f, 1.0f); + float var9 = 1.8f - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0f * 3.998391f * 0.78571427f * 2.0f) * 0.09589041f * 1.0428572f); + var9 = var9 * 100.0f / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32); + GL11.glScalef(var9, var9, var9); + GL11.glPopMatrix(); + String commitText = "CheatBreaker " + CheatBreaker.getInstance().getGitBuildVersion() + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")"; + this.drawString(this.fontRendererObj, commitText, 2, this.height - 10, -1); + String var11 = "Copyright Mojang AB. Do not distribute!"; + this.drawString(this.fontRendererObj, var11, this.width - this.fontRendererObj.getStringWidth(var11) - 2, this.height - 10, -1); + if (this.field_92025_p != null && this.field_92025_p.length() > 0) { + VanillaMenu.drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 0x55200000); + this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1); + this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, this.buttonList.get(0).field_146129_i - 12, -1); + } + super.drawScreen(mouseX, mouseY, partialTicks); + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + Object var4 = this.threadLock; + Object var5 = this.threadLock; + Object object = this.threadLock; + if (mouseX >= 7 && mouseX <= 39 && mouseY >= 5 && mouseY <= 20) { + MainMenuBase.switchMenu(); + } + synchronized (object) { + if (this.field_92025_p.length() > 0 && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w) { + GuiConfirmOpenLink var6 = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); + var6.func_146358_g(); + this.mc.displayGuiScreen(var6); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/AnchorHelper.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/AnchorHelper.java new file mode 100644 index 0000000..f92b88f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/AnchorHelper.java @@ -0,0 +1,246 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.AbstractModule; +import net.minecraft.client.gui.ScaledResolution; + +public class AnchorHelper {//TODO: Map this class + public static GuiAnchor getAnchor(float f, float f2, ScaledResolution scaledResolution) { + int n = scaledResolution.getScaledWidth(); + int n2 = scaledResolution.getScaledHeight(); + if (f < (float)(n / 3) && f2 < (float)(n2 / 3)) { + return GuiAnchor.LEFT_TOP; + } + if (f > (float)(n / 3 * 2) && f2 < (float)(n2 / 3)) { + return GuiAnchor.RIGHT_TOP; + } + if (f2 < (float)(n2 / 3)) { + return GuiAnchor.MIDDLE_TOP; + } + if (f < (float)(n / 3) && f2 < (float)(n2 / 3 * 2)) { + return GuiAnchor.LEFT_MIDDLE; + } + if (f > (float)(n / 3 * 2) && f2 < (float)(n2 / 3 * 2)) { + return GuiAnchor.RIGHT_MIDDLE; + } + if (f2 < (float)(n2 / 3 * 2)) { + return GuiAnchor.MIDDLE_MIDDLE; + } + if (f < (float)(n / 3)) { + return GuiAnchor.LEFT_BOTTOM; + } + if (f < (float)(n / 3 * 2)) { + if (f > (float)(n / 3 + n / 6)) { + return GuiAnchor.MIDDLE_BOTTOM_RIGHT; + } + return GuiAnchor.MIDDLE_BOTTOM_LEFT; + } + return GuiAnchor.RIGHT_BOTTOM; + } + + public static float[] getPositions(float f, float f2, ScaledResolution scaledResolution) { + float f3 = scaledResolution.getScaledWidth(); + float f4 = scaledResolution.getScaledHeight(); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(f, f2, scaledResolution); + float f5 = 0.0f; + float f6 = 0.0f; + switch (cBGuiAnchor) { + case LEFT_TOP: + f5 = 0.0f; + f6 = 0.0f; + break; + case RIGHT_TOP: + f5 = f3 / 3.0F * 2.0f; + f6 = 0.0f; + break; + case MIDDLE_TOP: + f5 = f3 / 3.0F; + f6 = 0.0f; + break; + case LEFT_MIDDLE: + f5 = 0.0f; + f6 = f4 / 3.0F; + break; + case RIGHT_MIDDLE: + f5 = f3 / 3.0F * 2.0f; + f6 = f4 / 3.0F; + break; + case MIDDLE_MIDDLE: + f5 = f3 / 3.0F; + f6 = f4 / 3.0F; + break; + case LEFT_BOTTOM: + f5 = 0.0f; + f6 = f4 / 3.0F * 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f5 = f3 / 3.0F + f3 / (float)6; + f6 = f4 / 3.0F * 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f5 = f3 / 3.0F; + f6 = f4 / 3.0F * 2.0f; + break; + case RIGHT_BOTTOM: + f5 = f3 / 3.0F * 2.0f; + f6 = f4 / 3.0F * 2.0f; + } + return new float[]{f5, f6}; + } + + public static float[] getPositions(GuiAnchor anchor, ScaledResolution scaledResolution, float f, float f2, float f3) { + float f4 = 0.0f; + float f5 = 0.0f; + f *= f3; + f2 *= f3; + switch (anchor) { + case LEFT_TOP: + f4 = 2.0f; + f5 = 2.0f; + break; + case LEFT_MIDDLE: + f4 = 2.0f; + f5 = (float) (scaledResolution.getScaledHeight() / 2) - f2 / 2.0f; + break; + case LEFT_BOTTOM: + f5 = (float) scaledResolution.getScaledHeight() - f2 - 2.0f; + f4 = 2.0f; + break; + case MIDDLE_TOP: + f4 = (float) (scaledResolution.getScaledWidth() / 2) - f / 2.0f; + f5 = 2.0f; + break; + case MIDDLE_MIDDLE: + f4 = (float) (scaledResolution.getScaledWidth() / 2) - f / 2.0f; + f5 = (float) (scaledResolution.getScaledHeight() / 2) - f2 / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f4 = (float) (scaledResolution.getScaledWidth() / 2) - f; + f5 = (float) scaledResolution.getScaledHeight() - f2 - 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f4 = scaledResolution.getScaledWidth() / 2; + f5 = (float) scaledResolution.getScaledHeight() - f2 - 2.0f; + break; + case RIGHT_TOP: + f4 = (float) scaledResolution.getScaledWidth() - f - 2.0f; + f5 = 2.0f; + break; + case RIGHT_MIDDLE: + f4 = (float) scaledResolution.getScaledWidth() - f; + f5 = (float) (scaledResolution.getScaledHeight() / 2) - f2 / 2.0f; + break; + case RIGHT_BOTTOM: + f4 = (float) scaledResolution.getScaledWidth() - f; + f5 = (float) scaledResolution.getScaledHeight() - f2; + } + return new float[]{f4, f5}; + } + + public static float[] getPositions(AbstractModule module, float f, float f2, ScaledResolution scaledResolution) { + float f3 = scaledResolution.getScaledWidth(); + float f4 = scaledResolution.getScaledHeight(); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(f, f2, scaledResolution); + float f5 = module.width * (Float) module.masterScale(); + float f6 = module.height * (Float) module.masterScale(); + float f7 = 0.0f; + float f8 = 0.0f; + switch (cBGuiAnchor) { + case LEFT_TOP: + f7 = f5 / 2.0f; + f8 = f6 / 2.0f; + break; + case RIGHT_TOP: + f7 = f3 / 3.0F - f5 / 2.0f; + f8 = f6 / 2.0f; + break; + case MIDDLE_TOP: + f7 = f3 / 6.0F; + f8 = f6 / 2.0f; + break; + case LEFT_MIDDLE: + f7 = f5 / 2.0f; + f8 = f4 / (float)6; + break; + case RIGHT_MIDDLE: + f7 = f3 / 3.0F - f5 / 2.0f; + f8 = f4 / 6.0F; + break; + case MIDDLE_MIDDLE: + f7 = f3 / 6.0F; + f8 = f4 / 6.0F; + break; + case LEFT_BOTTOM: + f7 = f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + break; + case MIDDLE_BOTTOM_RIGHT: + f7 = f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + break; + case MIDDLE_BOTTOM_LEFT: + f7 = f3 / 6.0F - f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + break; + case RIGHT_BOTTOM: + f7 = f3 / 3.0F - f5 / 2.0f; + f8 = f4 / 3.0F - f6 / 2.0f; + } + return new float[]{f7, f8}; + } + + public static float[] getSnapPositions(GuiAnchor anchor) { + float f = 0.0f; + float f2 = 0.0f; + switch (anchor) { + case RIGHT_MIDDLE: + f = -2; + break; + case LEFT_BOTTOM: + f = 2.0f; + f2 = -34; + break; + case MIDDLE_MIDDLE: + f2 = -50; + f = 0.0f; + } + return new float[]{f, f2}; + } + + public static Position getVerticalPositionEnum(GuiAnchor cBGuiAnchor) { + switch (cBGuiAnchor) { + case LEFT_TOP: + case RIGHT_TOP: + case MIDDLE_TOP: + return Position.TOP; + case LEFT_MIDDLE: + case RIGHT_MIDDLE: + case MIDDLE_MIDDLE: + return Position.CENTER; + case LEFT_BOTTOM: + case MIDDLE_BOTTOM_RIGHT: + case MIDDLE_BOTTOM_LEFT: + case RIGHT_BOTTOM: + return Position.BOTTOM; + } + return null; + } + + public static Position getHorizontalPositionEnum(GuiAnchor cBGuiAnchor) { + switch (cBGuiAnchor) { + case LEFT_TOP: + case LEFT_MIDDLE: + case LEFT_BOTTOM: + case MIDDLE_BOTTOM_RIGHT: + return Position.LEFT; + case MIDDLE_TOP: + case MIDDLE_MIDDLE: + return Position.CENTER; + case RIGHT_TOP: + case RIGHT_MIDDLE: + case MIDDLE_BOTTOM_LEFT: + case RIGHT_BOTTOM: + return Position.RIGHT; + } + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/GuiAnchor.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/GuiAnchor.java new file mode 100644 index 0000000..1bbfb56 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/GuiAnchor.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.ui.module; + +import lombok.AllArgsConstructor; + +@AllArgsConstructor +public enum GuiAnchor { + LEFT_TOP("LEFT_TOP"), + LEFT_MIDDLE("LEFT_MIDDLE"), + LEFT_BOTTOM("LEFT_BOTTOM"), + MIDDLE_TOP("MIDDLE_TOP"), + MIDDLE_MIDDLE("MIDDLE_MIDDLE"), + MIDDLE_BOTTOM_LEFT("MIDDLE_BOTTOM_LEFT"), + MIDDLE_BOTTOM_RIGHT("MIDDLE_BOTTOM_RIGHT"), + RIGHT_TOP("RIGHT_TOP"), + RIGHT_MIDDLE("RIGHT_MIDDLE"), + RIGHT_BOTTOM("RIGHT_BOTTOM"); + + private final String label; + + /* + * WARNING - Possible parameter corruption + * WARNING - void declaration + */ + + + public String getLabel() { + return this.label; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/HudLayoutEditorGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/HudLayoutEditorGui.java new file mode 100644 index 0000000..3959cd2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/HudLayoutEditorGui.java @@ -0,0 +1,1187 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.ScreenLocation; +import com.cheatbreaker.client.module.impl.staff.StaffMod; +import com.cheatbreaker.client.ui.element.AbstractModulesGuiElement; +import com.cheatbreaker.client.ui.element.AbstractScrollableElement; +import com.cheatbreaker.client.ui.element.module.ModuleListElement; +import com.cheatbreaker.client.ui.element.module.ModulePreviewContainer; +import com.cheatbreaker.client.ui.element.module.ModulesGuiButtonElement; +import com.cheatbreaker.client.ui.element.profile.ProfilesListElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.util.font.CBFontRenderer; +import com.cheatbreaker.client.util.manager.DebugInfoHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +public class HudLayoutEditorGui extends GuiScreen { + public static HudLayoutEditorGui instance; + private final ResourceLocation settingsIcon = new ResourceLocation("client/icons/cog-64.png"); + private final ResourceLocation deleteIcon = new ResourceLocation("client/icons/delete-64.png"); + private final List positions = new ArrayList<>(); + private final List guiElements = new ArrayList<>(); + private final List buttons = new ArrayList<>(); + private List modules; + private ModulesGuiButtonElement showGuidesButton; + public ModulesGuiButtonElement helpButton; + private ModulesGuiButtonElement bugReportButton; + @Deprecated + protected AbstractScrollableElement lastMouseEvent; + @Deprecated + protected AbstractScrollableElement field_146298_h; + public AbstractScrollableElement settingsElement; + public AbstractScrollableElement profilesElement; + public AbstractScrollableElement modulesElement; + protected AbstractScrollableElement staffModulesElement; + protected AbstractScrollableElement allElements = null; + public AbstractScrollableElement currentScrollableElement = null; + private static AbstractModule draggingModule; + private boolean IlIlIIIlllllIIIlIlIlIllII = false; + private float mouseX2; + private float mouseY2; + private List undoList; + private List redo; + private int mouseX; + private int mouseY; + private boolean showModSizeOutline = false; + private ModuleDataHolder dataHolder; + private boolean isBugReportOpen = false; + public static boolean allMenusClosed = false; + private int arrowKeyMoves; + private GuiTextField bugReportTextField; + private float animationPhase = 0; + private final boolean notExperimentalBuild = !CheatBreaker.getInstance().getGitBuildVersion().equals("Production") && !CheatBreaker.getInstance().getGitBuildVersion().equals("Preview"); + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void initGui() { + this.blurGui(); + Keyboard.enableRepeatEvents(true); + this.modules = new ArrayList<>(); + this.modules.addAll(CheatBreaker.getInstance().getModuleManager().playerMods); + this.undoList = new ArrayList<>(); + this.redo = new ArrayList<>(); + this.mouseX = -1; + this.mouseY = -1; + this.arrowKeyMoves = 0; + instance = this; + draggingModule = null; + this.allElements = null; + this.currentScrollableElement = null; + this.dataHolder = null; + allMenusClosed = false; + float scale = 1.0f / CheatBreaker.getScaleFactor(); + int scaledWidth = (int)((float)this.width / scale); + int scaledHeight = (int)((float)this.height / scale); + this.guiElements.clear(); + this.buttons.clear(); + List moduleList = CheatBreaker.getInstance().getModuleManager().playerMods; + List staffModList = CheatBreaker.getInstance().getModuleManager().staffMods; + this.modulesElement = new ModulePreviewContainer(scale, scaledWidth / 2 - 565, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.modulesElement); + + this.staffModulesElement = new ModuleListElement(staffModList, scale, scaledWidth / 2 + 195, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.staffModulesElement); + this.settingsElement = new ModuleListElement(moduleList, scale, scaledWidth / 2 + 195, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.settingsElement); + this.profilesElement = new ProfilesListElement(scale, scaledWidth / 2 - 565, scaledHeight / 2 + 14, 370, scaledHeight / 2 - 35); + this.guiElements.add(this.profilesElement); + this.showGuidesButton = new ModulesGuiButtonElement(null, "eye-64.png", 4, scaledHeight - 32, 28, 28, -12418828, scale); + this.helpButton = new ModulesGuiButtonElement(null, "?", 36, scaledHeight - 32, 28, 28, -12418828, scale); + this.bugReportButton = new ModulesGuiButtonElement(null, "Bug report", 68, scaledHeight - 32, 140, 28, -12418828, scale); + this.bugReportTextField = new GuiTextField(this.mc.fontRenderer, 68, scaledHeight - 58, 140, 20); + if (CheatBreaker.getInstance().getModuleManager().isUsingStaffModules()) { + this.buttons.add(new ModulesGuiButtonElement(this.staffModulesElement, "Staff Mods", scaledWidth / 2 - 50, scaledHeight / 2 - 44, 100, 20, -9442858, scale)); + } + this.buttons.add(new ModulesGuiButtonElement(this.modulesElement, "Mods", scaledWidth / 2 - 50, scaledHeight / 2 - 19, 100, 28, -13916106, scale)); + this.buttons.add(new ModulesGuiButtonElement(this.settingsElement, "cog-64.png", scaledWidth / 2 + 54, scaledHeight / 2 - 19, 28, 28, -12418828, scale)); + this.buttons.add(new ModulesGuiButtonElement(this.profilesElement, "profiles-64.png", scaledWidth / 2 - 82, scaledHeight / 2 - 19, 28, 28, -12418828, scale)); + allMenusClosed = false; + this.allElements = null; + this.animationPhase = 5; + } + + @Override + public void updateScreen() { + float f = 1.0f / CheatBreaker.getScaleFactor(); + int n = (int)((float)this.width / f); + int n2 = (int)((float)this.height / f); + this.setDirection(n); + if (this.isBugReportOpen) { + this.bugReportTextField.updateCursorCounter(); + } + if (!this.positions.isEmpty()) { + boolean leftKeyPressed = Keyboard.isKeyDown(203); + boolean rightKeyPressed = Keyboard.isKeyDown(205); + boolean downKeyPressed = Keyboard.isKeyDown(200); + boolean upKeyPressed = Keyboard.isKeyDown(208); + if (leftKeyPressed || rightKeyPressed || downKeyPressed || upKeyPressed) { + ++this.arrowKeyMoves; + if (this.arrowKeyMoves > 10) { + for (ModulePosition position : this.positions) { + AbstractModule module = position.module; + if (module == null) continue; + if (leftKeyPressed) { + module.setTranslations((int)module.getXTranslation() - 1, (float)((int)module.getYTranslation())); + continue; + } + if (rightKeyPressed) { + module.setTranslations((int)module.getXTranslation() + 1, (float)((int)module.getYTranslation())); + continue; + } + if (downKeyPressed) { + module.setTranslations((int)module.getXTranslation(), (float)((int)module.getYTranslation() - 1)); + continue; + } + if (upKeyPressed) { + module.setTranslations((int)module.getXTranslation(), (float)((int)module.getYTranslation() + 1)); + } + + } + } + } + } + float f2 = this.animationPhase > 30 ? 2.0f + this.animationPhase / 2.0f : (float)4; + this.animationPhase = this.animationPhase + f2 >= (float)255 ? 255 : (int)(this.animationPhase + f2); + } + + private float lIIIIlIIllIIlIIlIIIlIIllI(Rectangle rectangle, Rectangle rectangle2) { + float f = Math.max(Math.abs(rectangle.x - rectangle2.x) - rectangle2.width / 2, 0); + float f2 = Math.max(Math.abs(rectangle.y - rectangle2.y) - rectangle2.height / 2, 0); + return f * f + f2 * f2; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + float f2; + float f3; + Rectangle object; + super.drawScreen(mouseX, mouseY, partialTicks); + this.renderBlur(); + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + float scale = 1.0f / CheatBreaker.getScaleFactor(); + if (draggingModule != null) { + if (CheatBreaker.getInstance().getGlobalSettings().showDebugOutput.getBooleanValue()) { + this.debugOutputHud(scaledResolution); + } + if (!Mouse.isButtonDown(1)) { + RenderUtil.drawRoundedRect(2.0, 2.0, 2.5D, this.height - 2, 0.0, -15599126); + RenderUtil.drawRoundedRect((float)this.width - 2.5F, 2.0, this.width - 2, this.height - 2, 0.0, -15599126); + RenderUtil.drawRoundedRect(2.0, 2, this.width - 2, 2.5, 0.0, -15599126); + RenderUtil.drawRoundedRect(2.0, (float)this.height - 2.5F, this.width - 2, this.height - 2, 0.0, -15599126); + } + // Temporarily Try-Catching this until me or someone else figures out how to fix this *without* the need to reset profiles - Tellinq + try { + this.modules.sort((module, module1) -> { + if (module == draggingModule || module1 == draggingModule || module.getGuiAnchor() == null || module1.getGuiAnchor() == null) { + return 0; + } + float[] arrf = module.getScaledPoints(scaledResolution, true); + float[] arrf2 = module1.getScaledPoints(scaledResolution, true); + float[] arrf3 = draggingModule.getScaledPoints(scaledResolution, true); + Rectangle rectangle = new Rectangle((int)(arrf[0] * module.masterScale()), (int)(arrf[1] * module.masterScale()), (int)(module.height * module.masterScale()), (int)(module.width * module.masterScale())); + Rectangle rectangle2 = new Rectangle((int)(arrf2[0] * module1.masterScale()), (int)(arrf2[1] * module1.masterScale()), (int)(module1.height * module1.masterScale()), (int)(module1.width * module1.masterScale())); + Rectangle rectangle3 = new Rectangle((int)(arrf3[0] * HudLayoutEditorGui.draggingModule.masterScale()), (int)(arrf3[1] * HudLayoutEditorGui.draggingModule.masterScale()), (int)(HudLayoutEditorGui.draggingModule.width * HudLayoutEditorGui.draggingModule.masterScale()), (int)(HudLayoutEditorGui.draggingModule.height * HudLayoutEditorGui.draggingModule.masterScale())); + try { + if (this.lIIIIlIIllIIlIIlIIIlIIllI(rectangle, rectangle3) > this.lIIIIlIIllIIlIIlIIIlIIllI(rectangle2, rectangle3)) { + return -1; + } + return 1; + } catch (Exception exception) { + return 0; + } + }); + } catch (Exception ex) { + ex.printStackTrace(); + } + + ModulePosition modulePosition = this.getSelectedModules(draggingModule); + if (modulePosition != null) { + this.positions.remove(modulePosition); + this.positions.add(modulePosition); + } + for (ModulePosition position : this.positions) { + this.dragModule(position, mouseX, mouseY, scaledResolution); + if (!(Boolean) CheatBreaker.getInstance().getGlobalSettings().snapModules.getValue() || !this.IlIlIIIlllllIIIlIlIlIllII || Mouse.isButtonDown(1) || position.module != draggingModule) continue; + for (AbstractModule module : this.modules) { + float[] positionScaledPoints = position.module.getScaledPoints(scaledResolution, true); + float centerVerticalSnap = this.height / 2 - (positionScaledPoints[1] + position.module.height / 2) * position.module.masterScale(); + float centerHorizontalSnap = this.width / 2 - (positionScaledPoints[0] + position.module.width / 2) * position.module.masterScale(); + float snappingStrength = (float)CheatBreaker.getInstance().getGlobalSettings().snappingStrength.getValue(); + if (centerHorizontalSnap >= (float)(-snappingStrength) && centerHorizontalSnap <= (float)snappingStrength) { + this.snapHorizontalPosition(centerHorizontalSnap); + } + if (centerVerticalSnap >= (float)(-snappingStrength) && centerVerticalSnap <= (float)snappingStrength) { + this.snapVerticalPosition(centerVerticalSnap); + } + if (this.getSelectedModules(module) != null || module.getGuiAnchor() == null || !module.isRenderHud() || !module.isEnabled() || module.getName().contains("Zans") && CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().hide) continue; + float[] moduleScaledPoints = module.getScaledPoints(scaledResolution, true); + boolean bl = true; + boolean bl2 = true; + float f6 = moduleScaledPoints[0] * module.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f7 = (moduleScaledPoints[0] + module.width) * module.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f8 = (moduleScaledPoints[0] + module.width) * module.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f9 = moduleScaledPoints[0] * module.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f10 = moduleScaledPoints[1] * module.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + f3 = (moduleScaledPoints[1] + module.height) * module.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + f2 = (moduleScaledPoints[1] + module.height) * module.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + float f11 = moduleScaledPoints[1] * module.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + + if (f6 >= (float)(-snappingStrength) && f6 <= (float)snappingStrength) { + bl = false; + this.snapHorizontalPosition(f6); + } + if (f7 >= (float)(-snappingStrength) && f7 <= (float)snappingStrength && bl) { + bl = false; + this.snapHorizontalPosition(f7); + } + if (f9 >= (float)(-snappingStrength) && f9 <= (float)snappingStrength && bl) { + bl = false; + this.snapHorizontalPosition(f9); + } + if (f8 >= (float)(-snappingStrength) && f8 <= (float)snappingStrength && bl) { + this.snapHorizontalPosition(f8); + } + if (f10 >= (float)(-snappingStrength) && f10 <= (float)snappingStrength) { + bl2 = false; + this.snapVerticalPosition(f10); + } + if (f3 >= (float)(-snappingStrength) && f3 <= (float)snappingStrength && bl2) { + bl2 = false; + this.snapVerticalPosition(f3); + } + if (f11 >= (float)(-snappingStrength) && f11 <= (float)snappingStrength && bl2) { + bl2 = false; + this.snapVerticalPosition(f11); + } + if (!(f2 >= (float)(-snappingStrength)) || !(f2 <= (float)snappingStrength) || !bl2) continue; + this.snapVerticalPosition(f2); + } + } + } else if (this.dataHolder != null) { + float f12 = 1.0f; + int n4; + switch (this.dataHolder.screenLocation) { + case RIGHT_BOTTOM: + n4 = mouseY - this.dataHolder.mouseY + (mouseX - this.dataHolder.mouseX); + f12 = this.dataHolder.scale - (float)n4 / (float)115; + break; + case LEFT_TOP: + n4 = mouseY - this.dataHolder.mouseY + (mouseX - this.dataHolder.mouseX); + f12 = this.dataHolder.scale + (float)n4 / (float)115; + break; + case RIGHT_TOP: + n4 = mouseX - this.dataHolder.mouseX - (mouseY - this.dataHolder.mouseY); + f12 = this.dataHolder.scale - (float)n4 / (float)115; + break; + case LEFT_BOTTOM: + n4 = mouseX - this.dataHolder.mouseX - (mouseY - this.dataHolder.mouseY); + f12 = this.dataHolder.scale + (float)n4 / (float)115; + } + if (f12 >= 1.0421053f * 0.47979796f && f12 <= 1.8962264f * 0.7910448f) { + this.dataHolder.module.scale.setValue((float) ((double) Math.round((double) f12 * (double) 100) / (double) 100)); + } + } + this.lIIIIlIIllIIlIIlIIIlIIllI(scaledResolution); + boolean bl = true; + for (AbstractModule module : this.modules) { + boolean bl3 = this.lIIIIlIIllIIlIIlIIIlIIllI(scale, module, scaledResolution, mouseX, mouseY, bl); + if (bl3) continue; + bl = false; + } + GL11.glPushMatrix(); + GL11.glScalef(scale, scale, scale); + int n5 = (int)((float)this.width / scale); + int n6 = (int)((float)this.height / scale); + this.showGuidesButton.handleDrawElement(mouseX, mouseY, partialTicks); + this.helpButton.handleDrawElement(mouseX, mouseY, partialTicks); + if (notExperimentalBuild) this.bugReportButton.handleDrawElement(mouseX, mouseY, partialTicks); + if (this.isBugReportOpen) { + this.mc.fontRenderer.drawString("Bug Description (Press ENTER to send)", 39, n6 - 70, -1); + this.bugReportTextField.setMaxStringLength(180); + this.bugReportTextField.drawTextBox(); + } + float f13 = (this.animationPhase * 8) / (float)255; + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, f13); + int n7 = 0xFFFFFF; + if (f13 / (float)4 > 0.0f && f13 / (float)4 < 1.0f) { + n7 = new Color(1.0f, 1.0f, 1.0f, f13 / (float)4).getRGB(); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, f13); + if (f13 > 1.0f) { + GL11.glTranslatef(-((this.animationPhase * 2) - (float)32) / (float)12 - 1.0f, 0.0f, 0.0f); + } + RenderUtil.renderIcon(new ResourceLocation("client/logo_white.png"), (float)(n5 / 2 - 14), (float)(n6 / 2 - 47 - (CheatBreaker.getInstance().getModuleManager().isUsingStaffModules() ? 22 : 0)), (float)28, 15); + if (f13 > 1.0f) { + CheatBreaker.getInstance().playBold18px.drawString("| CHEAT", n5 / 2.0f + 18.0f, (float)(n6 / 2 - 45 - (CheatBreaker.getInstance().getModuleManager().isUsingStaffModules() ? 22 : 0)), n7); + CheatBreaker.getInstance().playRegular18px.drawString("BREAKER", n5 / 2.0f + 53.0f, (float)(n6 / 2 - 45 - (CheatBreaker.getInstance().getModuleManager().isUsingStaffModules() ? 22 : 0)), n7); + } + GL11.glPopMatrix(); + for (ModulesGuiButtonElement modulesGuiButtonElement : this.buttons) { + modulesGuiButtonElement.handleDrawElement(mouseX, mouseY, partialTicks); + } + if (draggingModule == null) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox(n5 / 2 - 185, n6 / 2 + 15, n5 / 2 + 185, n6 - 20, (float)scaledResolution.getScaleFactor() * scale, n6); + for (AbstractScrollableElement abstractScrollableElement : this.guiElements) { + if (abstractScrollableElement != this.allElements && abstractScrollableElement != this.currentScrollableElement) continue; + abstractScrollableElement.handleDrawElement(mouseX, mouseY, partialTicks); + } + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + if (this.mouseX != -1) { + if (Mouse.isButtonDown(0)) { + if (this.mouseX != mouseX && this.mouseY != mouseY) { + HudLayoutEditorGui.drawRectWithOutline(this.mouseX, this.mouseY, mouseX, mouseY, 0.49f, -1358888961, 0x1F00FFFF); + } + } else { + this.positions.clear(); + for (AbstractModule module : this.modules) { + int n8; + int n9; + int n10; + int n11; + Rectangle rectangle; + if (module.getGuiAnchor() == null || !module.isEnabled() || module.getName().contains("Zans") && CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().hide) continue; + float[] arrf = module.getScaledPoints(scaledResolution, true); + float f14 = scale / module.masterScale(); + object = new Rectangle((int)(arrf[0] * module.masterScale() - 2.0f), (int)(arrf[1] * module.masterScale() - 2.0f), (int)(module.width * module.masterScale() + (float)4), (int)(module.height * module.masterScale() + (float)4)); + if (!object.intersects(rectangle = new Rectangle(n11 = Math.min(this.mouseX, mouseX), n10 = Math.min(this.mouseY, mouseY), n9 = Math.max(this.mouseX, mouseX) - n11, n8 = Math.max(this.mouseY, mouseY) - n10))) continue; + f3 = (float) mouseX - module.getXTranslation(); + f2 = (float) mouseY - module.getYTranslation(); + this.positions.add(new ModulePosition(module, f3, f2)); + } + this.mouseX = -1; + this.mouseY = -1; + } + } + if (this.helpButton.isMouseInside(mouseX, mouseY) && (this.allElements == null || !this.allElements.isMouseInside(mouseX, mouseY))) { + this.drawShortcutHints(scale); + } + } + + private void drawShortcutHints(float scale) { + GL11.glPushMatrix(); + GL11.glTranslatef(4, (float)this.height - 245.0f * scale, 0.0f); + GL11.glScalef(scale, scale, scale); + Gui.drawRect(0.0f, 0.0f, 240, 200, -1895825408); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("Shortcuts & Movement", 4, 2.0f, -1); + Gui.drawRect(4, 12, 234, 2.5815217f * 4.8421054f, 0x4FFFFFFF); + int n = 16; + String ctrlOrCmd = Minecraft.isRunningOnMac ? "CMD" : "CTRL"; + int ctrlOrCmdPos = Minecraft.isRunningOnMac ? 2 : 0; + this.drawShortcutString("Mouse1", 6, n); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "HOLD" + EnumChatFormatting.RESET + " Add mods to selected region", 80, (float)n, -1); + this.drawShortcutString("Mouse1", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "HOLD" + EnumChatFormatting.RESET + " Select & drag mods", 80, (float)n, -1); + this.drawShortcutString("Mouse2", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "CLICK" + EnumChatFormatting.RESET + " Reset mod to closest position", 80, (float)n, -1); + this.drawShortcutString("Mouse2", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("| " + EnumChatFormatting.AQUA + "HOLD" + EnumChatFormatting.RESET + " Don't lock mods while dragging", 80, (float)n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float)n, -1); + this.drawShortcutString("Mouse1", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Toggle (multiple) mod selection", 80, (float)n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float)n, -1); + this.drawShortcutString("A", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Select all mods", 80, (float)n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float)n, -1); + this.drawShortcutString("X", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Remove selected mod(s) from HUD", 80, (float)n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float)n, -1); + this.drawShortcutString("R", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Reset selected mod(s) scale", 80, (float)n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float)n, -1); + this.drawShortcutString("Z", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Undo mod movements", 80, (float)n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float)n, -1); + this.drawShortcutString("Y", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Redo mod movements", 80, (float)n, -1); + this.drawShortcutString("SHIFT", 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 32, (float)n, -1); + this.drawShortcutString("Arrows", 38, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Smaller mod movements", 80, (float)n, -1); + this.drawShortcutString(ctrlOrCmd, 6, n += 12); + CheatBreaker.getInstance().playRegular14px.drawString("+", 30 - ctrlOrCmdPos, (float)n, -1); + this.drawShortcutString("Arrows", 36 - ctrlOrCmdPos, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Larger mod movements", 80, (float)n, -1); + n = 172; + this.drawShortcutString("Up", 31, n); + this.drawShortcutString("Left", 6, n += 12); + this.drawShortcutString("Down", 26, n); + this.drawShortcutString("Right", 51, n); + CheatBreaker.getInstance().playRegular14px.drawString("| Move selected mod(s) with precision", 80, (float)n, -1); + GL11.glPopMatrix(); + } + + private void drawShortcutString(String string, int x, int y) { + CBFontRenderer font = CheatBreaker.getInstance().playRegular14px; + float width = font.getStringWidth(string); + RenderUtil.drawRoundedRect(x, y, (float)x + width + 4.0f, y + 10, 2, -1073741825); + font.drawString(string, x + 2, (float)y, -16777216); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + if (this.allElements != null && this.allElements.isMouseInside(mouseX, mouseY)) { + this.allElements.handleMouseClick(mouseX, mouseY, mouseButton); + //System.out.println("mouseX=" + mouseX + " mouseY=" + mouseY + " mouseButton=" + mouseButton); + } else { + AbstractModule module1 = this.lIIIIlIIllIIlIIlIIIlIIllI(scaledResolution, mouseX, mouseY); + if (!(draggingModule != null && this.IlIlIIIlllllIIIlIlIlIllII || module1 == null)) { + float[] scaledPoints = module1.getScaledPoints(scaledResolution, true); + boolean isModSizeSmall = module1.width < 22 || module1.height < 8; + boolean hoveringSettingsIcon = !isModSizeSmall && module1.isEnabled() && !module1.getSettingsList().isEmpty() && + (float)mouseX >= scaledPoints[0] * module1.masterScale() && + (float)mouseX <= (scaledPoints[0] + 10.0F) * module1.masterScale() && + (float)mouseY >= (scaledPoints[1] + module1.height - 10.0F) * module1.masterScale() && + (float)mouseY <= (scaledPoints[1] + module1.height + 2.0f) * module1.masterScale(); + boolean hoveringDeleteIcon = !isModSizeSmall && module1.isEnabled() && + (float)mouseX > (scaledPoints[0] + module1.width - 10.0F) * module1.masterScale() && + (float)mouseX < (scaledPoints[0] + module1.width + 2.0f) * module1.masterScale() && + (float)mouseY > (scaledPoints[1] + module1.height - 10.0F) * module1.masterScale() && + (float)mouseY < (scaledPoints[1] + module1.height + 2.0f) * module1.masterScale(); + boolean hoveringSettingsShiftedIcon = isModSizeSmall && module1.isEnabled() && !module1.getSettingsList().isEmpty() && + (float)mouseX >= (scaledPoints[0] + module1.width / 2 - 10.0f) * module1.masterScale() && + (float)mouseX <= (scaledPoints[0] + module1.width / 2 - 2.0F) * module1.masterScale() && + (float)mouseY >= (scaledPoints[1] + module1.height + 2.0F) * module1.masterScale() && + (float)mouseY <= (scaledPoints[1] + module1.height + 12.0f) * module1.masterScale(); + boolean hoveringDeleteShiftedIcon = isModSizeSmall && module1.isEnabled() && + (float)mouseX > (scaledPoints[0] + module1.width / 2 + 0.0F) * module1.masterScale() && + (float)mouseX < (scaledPoints[0] + module1.width / 2 + 8.0f) * module1.masterScale() && + (float)mouseY > (scaledPoints[1] + module1.height + 2.0F) * module1.masterScale() && + (float)mouseY < (scaledPoints[1] + module1.height + 12.0f) * module1.masterScale(); + if (hoveringSettingsIcon || hoveringSettingsShiftedIcon) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + ((ModuleListElement)this.settingsElement).resetColor = false; + ((ModuleListElement)this.settingsElement).module = module1; + this.currentScrollableElement = this.settingsElement; + } else if (hoveringDeleteIcon || hoveringDeleteShiftedIcon) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + module1.setState(false); + } + if (!isModSizeSmall) { + return; + } + + } + for (AbstractModule module : this.modules) { + GuiAnchor anchor; + ScreenLocation screenLocation; + if (module.getGuiAnchor() == null || !module.isEnabled() || module == CheatBreaker.getInstance().getModuleManager().miniMapMod) continue; + float[] arrf = module.getScaledPoints(scaledResolution, true); + boolean bl4 = (float)mouseX > arrf[0] * module.masterScale() && (float)mouseX < (arrf[0] + module.width) * module.masterScale() && (float)mouseY > arrf[1] * module.masterScale() && (float)mouseY < (arrf[1] + module.height) * module.masterScale(); + boolean bl5 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_BOTTOM || !bl4 && (float)mouseX >= (arrf[0] + module.width - (float)5) * module.masterScale() && (float)mouseX <= (arrf[0] + module.width + (float)5) * module.masterScale() && (float)mouseY >= (arrf[1] - (float)5) * module.masterScale() && (float)mouseY <= (arrf[1] + (float)5) * module.masterScale(); + boolean bl6 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_TOP || !bl4 && (float)mouseX >= (arrf[0] - (float)5) * module.masterScale() && (float)mouseX <= (arrf[0] + (float)5) * module.masterScale() && (float)mouseY >= (arrf[1] + module.height - (float)5) * module.masterScale() && (float)mouseY <= (arrf[1] + module.height + (float)5) * module.masterScale(); + boolean bl7 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_BOTTOM || !bl4 && (float)mouseX >= (arrf[0] - (float)5) * module.masterScale() && (float)mouseX <= (arrf[0] + (float)5) * module.masterScale() && (float)mouseY >= (arrf[1] - (float)5) * module.masterScale() && (float)mouseY <= (arrf[1] + (float)5) * module.masterScale(); + boolean bl = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_TOP || !bl4 && (float)mouseX >= (arrf[0] + module.width - (float)5) * module.masterScale() && (float)mouseX <= (arrf[0] + module.width + (float)5) * module.masterScale() && (float)mouseY >= (arrf[1] + module.height - (float)5) * module.masterScale() && (float)mouseY <= (arrf[1] + module.height + (float)5) * module.masterScale(); + if (this.mouseX != -1 || !bl5 && !bl6 && !bl7 && !bl) continue; + if (bl5) { + screenLocation = ScreenLocation.LEFT_BOTTOM; + anchor = GuiAnchor.LEFT_BOTTOM; + } else if (bl6) { + screenLocation = ScreenLocation.RIGHT_TOP; + anchor = GuiAnchor.RIGHT_TOP; + } else if (bl7) { + screenLocation = ScreenLocation.RIGHT_BOTTOM; + anchor = GuiAnchor.RIGHT_BOTTOM; + } else { + screenLocation = ScreenLocation.LEFT_TOP; + anchor = GuiAnchor.LEFT_TOP; + } + + if (this.lIIIIIIIIIlIllIIllIlIIlIl(scaledResolution, mouseX, mouseY)) continue; + if (mouseButton == 0) { + this.undoList.add(new ModuleActionData(this, this.positions)); + this.dataHolder = new ModuleDataHolder(this, module, screenLocation, mouseX, mouseY); + this.lIIIIlIIllIIlIIlIIIlIIllI(module, anchor, mouseX, mouseY, scaledResolution); + } else if (mouseButton == 1) { + GuiAnchor cBGuiAnchor2 = module.getGuiAnchor(); + this.lIIIIlIIllIIlIIlIIIlIIllI(module, anchor, mouseX, mouseY, scaledResolution); + module.scale.setValue(1.0f); + this.lIIIIlIIllIIlIIlIIIlIIllI(module, cBGuiAnchor2, mouseX, mouseY, scaledResolution); + } + return; + } + if (draggingModule == null) { + if (this.showGuidesButton.isMouseInside(mouseX, mouseY)) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.showModSizeOutline = !this.showModSizeOutline; + } else if (this.bugReportButton.isMouseInside(mouseX, mouseY) && notExperimentalBuild) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + this.isBugReportOpen = !this.isBugReportOpen; + if (this.isBugReportOpen) { + this.bugReportTextField.setFocused(true); + } + } + this.handleMainButtonPress(mouseX, mouseY, mouseButton); + this.lIIIIlIIllIIlIIlIIIlIIllI(scaledResolution, mouseX, mouseY, mouseButton); + } + for (AbstractModulesGuiElement abstractModulesGuiElement : this.buttons) { + if (!abstractModulesGuiElement.isMouseInside(mouseX, mouseY)) continue; + return; + } + boolean bl = this.lIIIIIIIIIlIllIIllIlIIlIl(scaledResolution, mouseX, mouseY); + if (bl) { + return; + } + if (!this.positions.isEmpty()) { + this.positions.clear(); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + this.mouseX = mouseX; + this.mouseY = mouseY; + } + if (!this.positions.isEmpty()) { + this.arrowKeyMoves = 0; + } + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + int n = Mouse.getEventDWheel(); + if (this.allElements != null) { + this.allElements.onScroll(n); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(AbstractModule module, GuiAnchor anchor, int n, int n2, ScaledResolution resolution) { + if (anchor != module.getGuiAnchor()) { + float[] arrf = module.getScaledPoints(resolution, true); + module.setAnchor(anchor); + float[] arrf2 = module.getScaledPoints(resolution, false); + module.setTranslations(arrf[0] * module.masterScale() - arrf2[0] * module.masterScale(), arrf[1] * module.masterScale() - arrf2[1] * module.masterScale()); + } + } + + @Override + public void mouseMovedOrUp(int mouseX, int mouseY, int partialTicks) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + if (this.dataHolder != null && partialTicks == 0) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.dataHolder.module, this.dataHolder.anchor, mouseX, mouseY, scaledResolution); + this.dataHolder = null; + } + if (draggingModule != null && partialTicks == 0) { + if (this.IlIlIIIlllllIIIlIlIlIllII) { + for (ModulePosition position : this.positions) { + GuiAnchor anchor = AnchorHelper.getAnchor(mouseX, mouseY, scaledResolution); + if (anchor == GuiAnchor.MIDDLE_MIDDLE || anchor == position.module.getGuiAnchor() || !this.IlIlIIIlllllIIIlIlIlIllII) continue; + this.lIIIIlIIllIIlIIlIIIlIIllI(position.module, anchor, mouseX, mouseY, scaledResolution); + position.x = (float)mouseX - position.module.getXTranslation(); + position.y = (float)mouseY - position.module.getYTranslation(); + } + if (this.getSelectedModules(draggingModule) == null) { + Object object = draggingModule.getScaledPoints(scaledResolution, true); + float x = (float)mouseX - draggingModule.getXTranslation(); + float y = (float)mouseY - draggingModule.getYTranslation(); + this.positions.add(new ModulePosition(draggingModule, x, y)); + } + + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + draggingModule = null; + } + } + + @Override + public void keyTyped(char c, int n) { + if (n == 1) { + CheatBreaker.getInstance().configManager.write(); + } + super.keyTyped(c, n); + if (this.isBugReportOpen) { + if (n == 28) { + DebugInfoHandler.ReportThatBug(this.bugReportTextField.getText()); + } + this.bugReportTextField.keyTyped(c, n); + } + if (n == 30 && HudLayoutEditorGui.isCtrlKeyDown()) { + for (AbstractModule module : this.modules) { + if (module.isEnabled() && module.getGuiAnchor() != null && this.getSelectedModules(module) == null) { + float f4 = (float)mouseX - module.getXTranslation() * module.masterScale(); + float f5 = (float)mouseY - module.getYTranslation() * module.masterScale(); + this.positions.add(new ModulePosition(module, f4, f5)); + } + } + } + if (n == 45 && HudLayoutEditorGui.isCtrlKeyDown()) { + for (AbstractModule module : this.modules) { + if (this.getSelectedModules(module) != null) { + module.setState(false); + } + } + } + if (n == 19 && HudLayoutEditorGui.isCtrlKeyDown()) { + for (AbstractModule module : this.modules) { + if (this.getSelectedModules(module) != null) { + module.scale.setValue(1.0F); + } + } + } + + if (n == 44 && HudLayoutEditorGui.isCtrlKeyDown()) { + if (!this.undoList.isEmpty()) { + int n2 = this.undoList.size() - 1; + ModuleActionData moduleActionData = this.undoList.get(this.undoList.size() - 1); + for (int i = 0; i < moduleActionData.moduleList.size(); ++i) { + AbstractModule abstractModule = moduleActionData.moduleList.get(i); + float f = moduleActionData.xTranslationList.get(i); + float f2 = moduleActionData.yTranslationList.get(i); + GuiAnchor cBGuiAnchor = moduleActionData.guiAnchorList.get(i); + Float f3 = (Float)moduleActionData.valueList.get(i); + abstractModule.setAnchor(cBGuiAnchor); + abstractModule.setTranslations(f, f2); + abstractModule.scale.setValue(f3); + } + if (this.redo.size() > 50) { + this.redo.remove(0); + } + this.redo.add(moduleActionData); + this.undoList.remove(n2); + } + } else if (n == 21 && HudLayoutEditorGui.isCtrlKeyDown()) { + if (!this.redo.isEmpty()) { + int n3 = this.redo.size() - 1; + ModuleActionData moduleActionData = this.redo.get(this.redo.size() - 1); + for (int i = 0; i < moduleActionData.moduleList.size(); ++i) { + AbstractModule abstractModule = moduleActionData.moduleList.get(i); + float f = moduleActionData.xTranslationList.get(i); + float f4 = moduleActionData.yTranslationList.get(i); + GuiAnchor cBGuiAnchor = moduleActionData.guiAnchorList.get(i); + Float f5 = (Float)moduleActionData.valueList.get(i); + abstractModule.setAnchor(cBGuiAnchor); + abstractModule.setTranslations(f, f4); + abstractModule.scale.setValue(f5); + } + if (this.redo.size() > 50) { + this.redo.remove(0); + } + this.undoList.add(moduleActionData); + this.redo.remove(n3); + } + } else { + this.arrowKeyMoves = 0; + for (ModulePosition cBModulePosition : this.positions) { + AbstractModule abstractModule = cBModulePosition.module; + if (abstractModule == null) continue; + float amount = 1.0f; + if (HudLayoutEditorGui.isCtrlKeyDown() && HudLayoutEditorGui.isShiftKeyDown()) { + amount = 1.0f / CheatBreaker.getScaleFactor() / 4; + } else if (HudLayoutEditorGui.isCtrlKeyDown()) { + amount = 4.0f; + } else if (HudLayoutEditorGui.isShiftKeyDown()) { + amount = 1.0f / CheatBreaker.getScaleFactor() / 2; + } + switch (n) { + case 203: + abstractModule.setTranslations(abstractModule.getXTranslation() - amount, abstractModule.getYTranslation()); + break; + case 205: + abstractModule.setTranslations(abstractModule.getXTranslation() + amount, abstractModule.getYTranslation()); + break; + case 200: + abstractModule.setTranslations(abstractModule.getXTranslation(), abstractModule.getYTranslation() - amount); + break; + case 208: + abstractModule.setTranslations(abstractModule.getXTranslation(), abstractModule.getYTranslation() + amount); + } + } + } + } + + private void snapHorizontalPosition(float currentPos) { + for (ModulePosition position : this.positions) { + position.module.setTranslations(position.module.getXTranslation() + currentPos, position.module.getYTranslation()); + } + } + + private void snapVerticalPosition(float currentPos) { + for (ModulePosition position : this.positions) { + position.module.setTranslations(position.module.getXTranslation(), position.module.getYTranslation() + currentPos); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ScaledResolution scaledResolution, int mouseX, int mouseY, int n3) { + for (AbstractModule module : this.modules) { + float[] scaledPoints; + if (module.getGuiAnchor() == null || !module.isEnabled() || module.getName().contains("Zans") && CheatBreaker.getInstance().getModuleManager().miniMapMod.getVoxelMap().getMapOptions().hide) continue; +// float f = module.width; +// float f2 = module.height; +// float f3 = 18; +// if (f < f3) { +// module.width = f3; +// } +// if (f2 < (float)18) { +// module.height = 18; +// } + if (!((float)mouseX > (scaledPoints = module.getScaledPoints(scaledResolution, true))[0] * module.masterScale() && + (float)mouseX < (scaledPoints[0] + module.width) * module.masterScale() && + (float)mouseY > scaledPoints[1] * module.masterScale() && + (float)mouseY < (scaledPoints[1] + module.height) * module.masterScale())) continue; + //Mark + boolean bl3 = !module.getSettingsList().isEmpty() && + (float)mouseX >= scaledPoints[0] * module.masterScale() && + (float)mouseX <= (scaledPoints[0] + (float)10) * module.masterScale() && + (float)mouseY >= (scaledPoints[1] + module.height - (float)10) * module.masterScale() && + (float)mouseY <= (scaledPoints[1] + module.height + 2.0f) * module.masterScale(); + boolean bl = (float)mouseX > (scaledPoints[0] + module.width - (float)10) * module.masterScale() && + (float)mouseX < (scaledPoints[0] + module.width + 2.0f) * module.masterScale() && + (float)mouseY > (scaledPoints[1] + module.height - (float)10) * module.masterScale() && + (float)mouseY < (scaledPoints[1] + module.height + 2.0f) * module.masterScale(); + boolean bl57 = !module.getSettingsList().isEmpty() && + (float)mouseX >= (scaledPoints[0] + module.width / 2 - 10.0f) * module.masterScale() && + (float)mouseX <= (scaledPoints[0] + module.width / 2 - 2.0F) * module.masterScale() && + (float)mouseY >= (scaledPoints[1] + module.height + 2.0F) * module.masterScale() && + (float)mouseY <= (scaledPoints[1] + module.height + 12.0f) * module.masterScale(); + boolean bl4 = + (float)mouseX > (scaledPoints[0] + module.width / 2 + 0.0f) * module.masterScale() && + (float)mouseX < (scaledPoints[0] + module.width / 2 + 8.0f) * module.masterScale() && + (float)mouseY > (scaledPoints[1] + module.height + 2.0F) * module.masterScale() && + (float)mouseY < (scaledPoints[1] + module.height + 12.0f) * module.masterScale(); + boolean isModSizeSmall = module.width < 22 || module.height < 8; + boolean d = isModSizeSmall ? !bl57 && !bl4 : !bl3 && !bl; + if (n3 == 0 && d && module != CheatBreaker.getInstance().getModuleManager().miniMapMod) { + boolean bl5 = true; + if (this.getSelectedModules(module) != null) { + this.removeModuleFromPositions(module); + bl5 = false; + } + float f4 = (float)mouseX - module.getXTranslation() * module.masterScale(); + float f5 = (float)mouseY - module.getYTranslation() * module.masterScale(); + this.mouseX2 = mouseX; + this.mouseY2 = mouseY; + this.IlIlIIIlllllIIIlIlIlIllII = false; + draggingModule = module; + if (this.getSelectedModules(module) == null) { + if (!HudLayoutEditorGui.isCtrlKeyDown() && bl5) { + this.positions.clear(); + } + if (bl5 || !HudLayoutEditorGui.isCtrlKeyDown()) { + this.positions.add(new ModulePosition(module, f4, f5)); + } + } + this.setSelectedModulesPosition(scaledResolution, mouseX, mouseY); + } + if (!(n3 != 0 || this.allElements != null && this.allElements.isMouseInside(mouseX, mouseY))) { + if (isModSizeSmall ? bl57 : bl3) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + ((ModuleListElement)this.settingsElement).resetColor = false; + ((ModuleListElement)this.settingsElement).module = module; + this.currentScrollableElement = this.settingsElement; + } else if (isModSizeSmall ? bl4 : bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + module.setState(false); + } + } else if (n3 == 1) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.undoList.add(new ModuleActionData(this, this.positions)); + float[] snapPositions = AnchorHelper.getSnapPositions(module.getGuiAnchor()); + if ((module == CheatBreaker.getInstance().getModuleManager().chatMod || module == CheatBreaker.getInstance().getModuleManager().playerListMod) && module.getGuiAnchor() == module.getDefaultGuiAnchor()) { + module.setTranslations(module.defaultXTranslation, module.defaultYTranslation); + } else { + module.setTranslations(snapPositions[0], snapPositions[1]); + } + + } + if (module == CheatBreaker.getInstance().getModuleManager().miniMapMod) continue; + break; + } + } + + private void handleMainButtonPress(int n, int n2, int n3) { + for (ModulesGuiButtonElement button : this.buttons) { + if (n3 != 0 || !button.isMouseInside(n, n2) || allMenusClosed) continue; + if (button.scrollableElement != null && this.allElements != button.scrollableElement && this.currentScrollableElement == null) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.currentScrollableElement = button.scrollableElement; + continue; + } + if (button.scrollableElement == null || this.currentScrollableElement != null) continue; + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + allMenusClosed = true; + } + } + + private AbstractModule lIIIIlIIllIIlIIlIIIlIIllI(ScaledResolution scaledResolution, int n, int n2) { + for (AbstractModule module : this.modules) { + if (module.getGuiAnchor() == null) continue; + float[] arrf = module.getScaledPoints(scaledResolution, true); + boolean bl2 = !module.getSettingsList().isEmpty() && + (float)n >= arrf[0] * module.masterScale() && + (float)n <= (arrf[0] + (float)10) * module.masterScale() && + (float)n2 >= (arrf[1] + module.height - (float)10) * module.masterScale() && + (float)n2 <= (arrf[1] + module.height + 2.0f) * module.masterScale(); + boolean bl = + (float)n > (arrf[0] + module.width - (float)10) * module.masterScale() && + (float)n < (arrf[0] + module.width + 2.0f) * module.masterScale() && + (float)n2 > (arrf[1] + module.height - (float)10) * module.masterScale() && + (float)n2 < (arrf[1] + module.height + 2.0f) * module.masterScale(); + boolean bl3 = !module.getSettingsList().isEmpty() && + (float)n >= (arrf[0] + module.width / 2 - 10.0f) * module.masterScale() && + (float)n <= (arrf[0] + module.width / 2 - 2.0F) * module.masterScale() && + (float)n2 >= (arrf[1] + module.height + 2.0F) * module.masterScale() && + (float)n2 <= (arrf[1] + module.height + 12.0f) * module.masterScale(); + boolean bl4 = + (float)n > (arrf[0] + module.width / 2 + 0.0f) * module.masterScale() && + (float)n < (arrf[0] + module.width / 2 + 8.0f) * module.masterScale() && + (float)n2 > (arrf[1] + module.height + 2.0F) * module.masterScale() && + (float)n2 < (arrf[1] + module.height + 12.0f) * module.masterScale(); + if (!bl && !bl2 && !bl3 && !bl4) continue; + return module; + } + return null; + } + + private boolean lIIIIIIIIIlIllIIllIlIIlIl(ScaledResolution scaledResolution, int n, int n2) { + boolean bl = false; + for (AbstractModule abstractModule : this.modules) { + if (abstractModule.getGuiAnchor() == null) continue; + float[] arrf = abstractModule.getScaledPoints(scaledResolution, true); + boolean bl2 = (float)n > arrf[0] * abstractModule.masterScale() && (float)n < (arrf[0] + abstractModule.width) * abstractModule.masterScale() && (float)n2 > arrf[1] * abstractModule.masterScale() && (float)n2 < (arrf[1] + abstractModule.height) * abstractModule.masterScale(); + bl = bl || bl2; + } + return bl; + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI(float scale, AbstractModule module, ScaledResolution scaledResolution, int mouseX, int mouseY, boolean bl) { + int n3; + int n4; + int n5; + int n6 = 0; + float[] object; + if (module.getGuiAnchor() == null || !module.isEnabled() || module == CheatBreaker.getInstance().getModuleManager().miniMapMod || !module.notRenderHUD && !module.isRenderHud()) { + return true; + } + boolean bl3 = false; +// float f2 = 18.0F; +// if (module.width < f2) { +// module.width = (int)f2; +// } +// if (module.height < 18.0F) { +// module.height = 18; +// } + GL11.glPushMatrix(); + float[] arrf = module.getScaledPoints(scaledResolution, true); + module.scaleAndTranslate(scaledResolution); + boolean bl2 = this.mouseX != -1; + if (bl2) { + Rectangle rec = new Rectangle((int)(arrf[0] * module.masterScale() - 2.0f), (int)(arrf[1] * module.masterScale() - 2.0f), (int)(module.width * module.masterScale() + (float)4), (int)(module.height * module.masterScale() + (float)4)); + n6 = Math.min(this.mouseX, mouseX); + n5 = Math.min(this.mouseY, mouseY); + n4 = Math.max(this.mouseX, mouseX) - n6; + n3 = Math.max(this.mouseY, mouseY) - n5; + Rectangle rectangle = new Rectangle(n6, n5, n4, n3); + bl2 = rec.intersects(rectangle); + } + object = module.getScaledPoints(scaledResolution, true); + boolean isModSizeSmall = module.width < 22 || module.height < 8; + boolean isHoveringOverMod = + (float) mouseX > object[0] * module.masterScale() && + (float) mouseX < (object[0] + module.width) * module.masterScale() && + (float) mouseY > object[1] * module.masterScale() && + (float) mouseY < (object[1] + module.height) * module.masterScale(); + boolean hasHoveredOverMod = + (float) mouseX > object[0] * module.masterScale() && + (float) mouseX < (object[0] + module.width) * module.masterScale() && + (float) mouseY > object[1] * module.masterScale() && + (float) mouseY < (object[1] + module.height + 10.0F) * module.masterScale(); + if (!this.showModSizeOutline && !(this.mc.currentScreen instanceof ProfileCreatorGui)) { + if (this.getSelectedModules(module) != null || bl2) { + Gui.drawRectWithOutline(0.0f, 0.0f, module.width, module.height, 0.4f, 0x9F00FFFF, isHoveringOverMod ? 0x2aFFFFFF : 0x1AFFFFFF); + } else { + Gui.drawRectWithOutline(0.0f, 0.0f, module.width, module.height, 0.4f, isHoveringOverMod ? 0x80FFFFFF : 0x6FFFFFFF, isHoveringOverMod ? 0x3aFFFFFF : 0x1AFFFFFF); + } + } + if (!this.showModSizeOutline && (isHoveringOverMod || isModSizeSmall && hasHoveredOverMod)) { + n5 = !module.getSettingsList().isEmpty() && + (float)mouseX >= (object[0] + 2.0f) * module.masterScale() && + (float)mouseX <= (object[0] + (float)10) * module.masterScale() && + (float)mouseY >= (object[1] + module.height - (float)8) * module.masterScale() && + (float)mouseY <= (object[1] + module.height - 2.0f) * module.masterScale() ? 1 : 0; + n4 = (float)mouseX > (object[0] + module.width - (float)10) * module.masterScale() && + (float)mouseX < (object[0] + module.width - 2.0f) * module.masterScale() && + (float)mouseY > (object[1] + module.height - (float)8) * module.masterScale() && + (float)mouseY < (object[1] + module.height - 2.0f) * module.masterScale() ? 1 : 0; + int n53 = !module.getSettingsList().isEmpty() && + (float)mouseX >= (object[0] + module.width / 2 - 10.0f) * module.masterScale() && + (float)mouseX <= (object[0] + module.width / 2 - 2.0F) * module.masterScale() && + (float)mouseY >= (object[1] + module.height + 2.0F) * module.masterScale() && + (float)mouseY <= (object[1] + module.height + 10.0f) * module.masterScale() ? 1 : 0; + int n43 = (float)mouseX > (object[0] + module.width / 2 + 0.0F) * module.masterScale() && + (float)mouseX < (object[0] + module.width / 2 + 8.0f) * module.masterScale() && + (float)mouseY > (object[1] + module.height + 2.0F) * module.masterScale() && + (float)mouseY < (object[1] + module.height + 10.0f) * module.masterScale() ? 1 : 0; + float cogXPos = isModSizeSmall ? module.width / 2 - 7.0F : 2.0f; + float deleteXPos = isModSizeSmall ? module.width / 2 + 1 : module.width - 8.0F; + float yPos = isModSizeSmall ? module.height + 2.0F : module.height - 7.5f; + if (!module.getSettingsList().isEmpty()) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, (isModSizeSmall ? n53 != 0 : n5 != 0) ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.settingsIcon, 3.0F, cogXPos, yPos); + } + GL11.glColor4f(0.8f, 0.2f, 0.2f, (isModSizeSmall ? n43 != 0 : n4 != 0) ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.deleteIcon, 3.0F, deleteXPos, yPos); + } + GL11.glPushMatrix(); + float f3 = scale / module.masterScale(); + GL11.glScalef(f3, f3, f3); + if (bl) { + n4 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_BOTTOM || n6 == 0 && (float)mouseX >= (object[0] + module.width - (float)5) * module.masterScale() && (float)mouseX <= (object[0] + module.width + (float)5) * module.masterScale() && (float)mouseY >= (object[1] - (float)5) * module.masterScale() && (float)mouseY <= (object[1] + (float)5) * module.masterScale() ? 1 : 0; + n3 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_TOP || n6 == 0 && (float)mouseX >= (object[0] - (float)5) * module.masterScale() && (float)mouseX <= (object[0] + (float)5) * module.masterScale() && (float)mouseY >= (object[1] + module.height - (float)5) * module.masterScale() && (float)mouseY <= (object[1] + module.height + (float)5) * module.masterScale() ? 1 : 0; + boolean bl5 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.RIGHT_BOTTOM || n6 == 0 && (float)mouseX >= (object[0] - (float)5) * module.masterScale() && (float)mouseX <= (object[0] + (float)5) * module.masterScale() && (float)mouseY >= (object[1] - (float)5) * module.masterScale() && (float)mouseY <= (object[1] + (float)5) * module.masterScale(); + boolean bl6 = this.dataHolder != null && this.dataHolder.module == module && this.dataHolder.screenLocation == ScreenLocation.LEFT_TOP || n6 == 0 && (float)mouseX >= (object[0] + module.width - (float)5) * module.masterScale() && (float)mouseX <= (object[0] + module.width + (float)5) * module.masterScale() && (float)mouseY >= (object[1] + module.height - (float)5) * module.masterScale() && (float)mouseY <= (object[1] + module.height + (float)5) * module.masterScale(); + GL11.glPushMatrix(); + float f4 = 4; + if (this.mouseX == -1 && bl5) { + GL11.glTranslatef(0.0f, 0.0f, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } else if (this.mouseX == -1 && n4 != 0) { + GL11.glTranslatef(module.width / f3, 0.0f, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } else if (this.mouseX == -1 && bl6) { + GL11.glTranslatef(module.width / f3, module.height / f3, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } else if (this.mouseX == -1 && n3 != 0) { + GL11.glTranslatef(0.0f, module.height / f3, 0.0f); + Gui.drawRect(-f4 / 2.0f, -f4 / 2.0f, f4 / 2.0f, f4 / 2.0f, 0xFF00FF00); + } + GL11.glPopMatrix(); + bl3 = this.mouseX == -1 && (bl5 || n4 != 0 || n3 != 0 || bl6); + } + n4 = arrf[1] - (float)CheatBreaker.getInstance().ubuntuMedium16px.getHeight() - (float)6 < 0.0f ? 1 : 0; + float f5 = n4 != 0 ? module.height * module.masterScale() / scale : (float)(-CheatBreaker.getInstance().ubuntuMedium16px.getHeight() - 4); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showModName.getValue()) { + String name = module.getName() + (module.hiddenFromHud ? EnumChatFormatting.GRAY + " (Hidden)" : ""); + switch (module.getPosition()) { + case LEFT: + float f6 = 0.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(name, f6, f5, -1); + break; + case CENTER: + float f7 = module.width * module.masterScale() / scale / 2.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredStringWithShadow(name, f7, f5, -1); + break; + case RIGHT: + float f8 = module.width * module.masterScale() / scale - (float)CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(name); + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(name, f8, f5, -1); + } + } + GL11.glPopMatrix(); + GL11.glPopMatrix(); + return !bl3; + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ScaledResolution scaledResolution) { + if (!Mouse.isButtonDown(1) && draggingModule != null) { + for (ModulePosition position : this.positions) { + if (position.module != draggingModule || !(Boolean) CheatBreaker.getInstance().getGlobalSettings().snapModules.getValue()) continue; + Object var5_5 = null; + for (AbstractModule abstractModule : this.modules) { + float[] positionScaledPoints = position.module.getScaledPoints(scaledResolution, true); + float centerHorizontalSnap = this.width / 2 - (positionScaledPoints[0] + position.module.width / 2) * position.module.masterScale(); + float centerVerticalSnap = this.height / 2 - (positionScaledPoints[1] + position.module.height / 2) * position.module.masterScale(); + float snappingStrength = (float)CheatBreaker.getInstance().getGlobalSettings().snappingStrength.getValue(); + if (centerVerticalSnap >= (float)(-snappingStrength) && centerVerticalSnap <= (float)snappingStrength) { + RenderUtil.drawRoundedRect(0.0, this.height / 2 - 0.25f, this.width, this.height / 2 + 0.25f, 0.0, -3596854); + } + if (centerHorizontalSnap >= (float)(-snappingStrength) && centerHorizontalSnap <= (float)snappingStrength) { + RenderUtil.drawRoundedRect(this.width / 2 - 0.25f, 0.0, this.width / 2 + 0.25f, this.height, 0.0, -3596854); + } + if (this.getSelectedModules(abstractModule) != null || abstractModule.getGuiAnchor() == null || !abstractModule.isEnabled() || abstractModule == CheatBreaker.getInstance().getModuleManager().miniMapMod || !abstractModule.notRenderHUD && !abstractModule.isRenderHud() || var5_5 != null && var5_5 != abstractModule) continue; + float[] moduleScaledPoints = abstractModule.getScaledPoints(scaledResolution, true); + boolean highlightNeighborMods = false; + float f2 = moduleScaledPoints[0] * abstractModule.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f3 = (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f4 = (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() - positionScaledPoints[0] * position.module.masterScale(); + float f5 = moduleScaledPoints[0] * abstractModule.masterScale() - (positionScaledPoints[0] + position.module.width) * position.module.masterScale(); + float f6 = moduleScaledPoints[1] * abstractModule.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + float f7 = (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + float f8 = (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() - positionScaledPoints[1] * position.module.masterScale(); + float f9 = moduleScaledPoints[1] * abstractModule.masterScale() - (positionScaledPoints[1] + position.module.height) * position.module.masterScale(); + if (f2 >= (float)(-snappingStrength) && f2 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(moduleScaledPoints[0] * abstractModule.masterScale() - 0.6666667f * 0.75f, 0.0, moduleScaledPoints[0] * abstractModule.masterScale(), this.height, 0.0, -3596854); + } + if (f3 >= (float)(-snappingStrength) && f3 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect((moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale(), 0.0, (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() + 1.7272727f * 0.28947368f, this.height, 0.0, -3596854); + } + if (f5 >= (float)(-snappingStrength) && f5 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(moduleScaledPoints[0] * abstractModule.masterScale(), 0.0, moduleScaledPoints[0] * abstractModule.masterScale() + 0.29775283f * 1.6792452f, this.height, 0.0, 0xFFC91DCA); + } + if (f4 >= (float)(-snappingStrength) && f4 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect((moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale(), 0.0, (moduleScaledPoints[0] + abstractModule.width) * abstractModule.masterScale() + 1.5238096f * 0.328125f, this.height, 0.0, -3596854); + } + if (f6 >= (float)(-snappingStrength) && f6 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, moduleScaledPoints[1] * abstractModule.masterScale(), this.width, moduleScaledPoints[1] * abstractModule.masterScale() + 0.3888889f * 1.2857143f, 0.0, -3596854); + } + if (f7 >= (float)(-snappingStrength) && f7 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale(), this.width, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() + 0.51724136f * 0.9666667f, 0.0, -3596854); + } + if (f9 >= (float)(-snappingStrength) && f9 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, moduleScaledPoints[1] * abstractModule.masterScale(), this.width, moduleScaledPoints[1] * abstractModule.masterScale() + 0.16666667f * 3.0f, 0.0, -3596854); + } + if (f8 >= (float)(-snappingStrength) && f8 <= (float)snappingStrength) { + highlightNeighborMods = true; + RenderUtil.drawRoundedRect(0.0, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale() - 0.5810811f * 0.8604651f, this.width, (moduleScaledPoints[1] + abstractModule.height) * abstractModule.masterScale(), 0.0, -3596854); + } + if (!highlightNeighborMods) continue; + GL11.glPushMatrix(); + abstractModule.scaleAndTranslate(scaledResolution); + Gui.drawRectWithOutline(0.0f, 0.0f, abstractModule.width, abstractModule.height, 0.01923077f * 26.0f, 0, 449387978); + GL11.glPopMatrix(); + } + } + } + } + + private float lIIIIlIIllIIlIIlIIIlIIllI(AbstractModule abstractModule, float f, float[] arrf, int n) { + float f2 = f; + float f3 = 2.0f; + if (f2 + arrf[0] * abstractModule.masterScale() < f3) { + f2 = -arrf[0] * abstractModule.masterScale() + f3; + } else if (f2 + arrf[0] * abstractModule.masterScale() + (float)n > (float)this.width - f3) { + f2 = (float)this.width - arrf[0] * abstractModule.masterScale() - (float)n - f3; + } + return f2; + } + + private float lIIIIIIIIIlIllIIllIlIIlIl(AbstractModule abstractModule, float f, float[] arrf, int n) { + float f2 = f; + float f3 = 2.0f; + if (f2 + arrf[1] * abstractModule.masterScale() < f3) { + f2 = -arrf[1] * abstractModule.masterScale() + f3; + } else if (f2 + arrf[1] * abstractModule.masterScale() + (float)n > (float)this.height - f3) { + f2 = (float)this.height - arrf[1] * abstractModule.masterScale() - (float)n - f3; + } + return f2; + } + + private void dragModule(ModulePosition modulePosition, int n, int n2, ScaledResolution scaledResolution) { + if (modulePosition.module.getGuiAnchor() == null || !modulePosition.module.isEnabled() || modulePosition.module == CheatBreaker.getInstance().getModuleManager().miniMapMod || !modulePosition.module.notRenderHUD && !modulePosition.module.isRenderHud()) { + return; + } + float f = (float)n - modulePosition.x; + float f2 = (float)n2 - modulePosition.y; + if (!(this.IlIlIIIlllllIIIlIlIlIllII || modulePosition.module != draggingModule || (float)n == this.mouseX2 && (float)n2 == this.mouseY2)) { + if (this.undoList.size() > 50) { + this.undoList.remove(0); + } + this.undoList.add(new ModuleActionData(this, this.positions)); + CheatBreaker.getInstance().createNewProfile(); + this.IlIlIIIlllllIIIlIlIlIllII = true; + } + float[] arrf = modulePosition.module.getScaledPoints(scaledResolution, false); + if (!Mouse.isButtonDown(1) && this.IlIlIIIlllllIIIlIlIlIllII && modulePosition.module == draggingModule) { + float f3 = f; + float f4 = f2; + f = this.lIIIIlIIllIIlIIlIIIlIIllI(modulePosition.module, f, arrf, (int)(modulePosition.module.width * modulePosition.module.masterScale())); + f2 = this.lIIIIIIIIIlIllIIllIlIIlIl(modulePosition.module, f2, arrf, (int)(modulePosition.module.height * modulePosition.module.masterScale())); + float f5 = f3 - f; + float f6 = f4 - f2; + for (ModulePosition positions : this.positions) { + if (positions == modulePosition) continue; + arrf = positions.module.getScaledPoints(scaledResolution, false); + float f7 = this.lIIIIlIIllIIlIIlIIIlIIllI(positions.module, positions.module.getXTranslation() - f5, arrf, (int)(positions.module.width * positions.module.masterScale())); + float f8 = this.lIIIIIIIIIlIllIIllIlIIlIl(positions.module, positions.module.getYTranslation() - f6, arrf, (int)(positions.module.height * positions.module.masterScale())); + positions.module.setTranslations(f7, f8); + } + } + if (this.IlIlIIIlllllIIIlIlIlIllII) { + modulePosition.module.setTranslations(f, f2); + } + } + + private void setDirection(int n) { + if (allMenusClosed) { + if (this.allElements != null) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.allElements, true, n); + } + } else if (this.currentScrollableElement != null) { + if (this.allElements != null) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.allElements, true, n); + } + this.lIIIIlIIllIIlIIlIIIlIIllI(this.currentScrollableElement, false, n); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(AbstractScrollableElement abstractScrollableElement, boolean bl, int n) { + if (bl) { + abstractScrollableElement.x = abstractScrollableElement.x2; + allMenusClosed = false; + this.allElements = null; + } else { + abstractScrollableElement.x = n / 2 - 185; + this.currentScrollableElement = null; + this.allElements = abstractScrollableElement; + } + } + + public static float getFPSTransitionSpeed(float f) { + float f2 = f / (float)(Minecraft.debugFPS + 1); + return Math.max(f2, 1.0f); + } + + private ModulePosition getSelectedModules(AbstractModule module) { + for (ModulePosition position : this.positions) { + if (module != position.module) continue; + return position; + } + return null; + } + + private void setSelectedModulesPosition(ScaledResolution scaledResolution, int n, int n2) { + for (ModulePosition position : this.positions) { + if (position.module == null || position.module.getGuiAnchor() == null) continue; + position.x = (float)n - position.module.getXTranslation(); + position.y = (float)n2 - position.module.getYTranslation(); + } + } + + private void removeModuleFromPositions(AbstractModule abstractModule) { + this.positions.removeIf(cBModulePosition -> cBModulePosition.module == abstractModule); + } + + private void debugOutputHud(ScaledResolution res) { + for (AbstractModule module : this.modules) { + if (this.getSelectedModules(module) != null) { + this.mc.fontRenderer.drawString(module.getGuiAnchor() + ", " + module.getXTranslation() + ", " + module.getYTranslation(), module.getScaledPoints(res, true)[0] * module.masterScale(), module.getScaledPoints(res, true)[1] * module.masterScale() + module.height * module.masterScale() + 1.0f, -1, true); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/InputFieldElementPromptGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/InputFieldElementPromptGui.java new file mode 100644 index 0000000..38e8996 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/InputFieldElementPromptGui.java @@ -0,0 +1,113 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.ModuleManager; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.ui.element.module.ModulePreviewElement; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.io.IOException; + +public class InputFieldElementPromptGui extends GuiScreen { + private final GuiScreen selectedButton; + + private GuiTextField textField = null; + + private final float scale; + + private boolean showGui; + + private Setting setting; + + public InputFieldElementPromptGui(Setting setting, GuiScreen guiScreen, float scale) { + this(guiScreen, scale); + this.setting = setting; + } + + public InputFieldElementPromptGui(GuiScreen guiScreen, float scale) { + this.selectedButton = guiScreen; + this.scale = scale; + this.showGui = true; + } + + @Override + public void updateScreen() { + this.textField.updateCursorCounter(); + } + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + @Override + public void initGui() { + Keyboard.enableRepeatEvents(true); + if (!this.showGui) { + this.mc.displayGuiScreen(this.selectedButton); + } else { + this.showGui = false; + this.textField = new GuiTextField(this.mc.fontRenderer, this.width / 2 - 70, this.height / 2 - 6, 140, 10); + if (this.setting != null) { + this.textField.setText(this.setting.getStringValue()); + } + this.textField.setFocused(true); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.selectedButton.drawScreen(mouseX, mouseY, partialTicks); + this.drawDefaultBackground(); + + drawRect(this.width / 2 - 73, this.height / 2 - 19, this.width / 2 + 73, this.height / 2 + 8, -11250604); + drawRect(this.width / 2 - 72, this.height / 2 - 18, this.width / 2 + 72, this.height / 2 + 7, -3881788); + + GL11.glPushMatrix(); + GL11.glScalef(this.scale, this.scale, this.scale); + + int n3 = (int) ((float) this.width / this.scale); + int n4 = (int) ((float) this.height / this.scale); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.setting.getSettingName(), (float) (n3 / 2) - (float) 70 / this.scale, (float) (n4 / 2) - (float) 17 / this.scale, 0x6F000000); + + GL11.glPopMatrix(); + + this.textField.setMaxStringLength(64); + this.textField.drawTextBox(); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.textField.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + public void keyTyped(char c, int n) { + ModuleManager moduleManager = CheatBreaker.getInstance().getModuleManager(); + + switch (n) { + case 1: + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).modulesElement; + ModulePreviewElement.instance.sendBackToModuleList(moduleManager.getModByName(moduleManager.currentModule)); + break; + + case 28: + this.setting.setValue(this.textField.getText()); + this.mc.displayGuiScreen(this.selectedButton); + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("info", EnumChatFormatting.GREEN + "Updated custom string value successfully.", 5000L); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).modulesElement; + ModulePreviewElement.instance.sendBackToModuleList(moduleManager.getModByName(moduleManager.currentModule)); + break; + + default: + this.textField.keyTyped(c, n); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModuleActionData.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModuleActionData.java new file mode 100644 index 0000000..8f113f9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModuleActionData.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.AbstractModule; + +import java.util.ArrayList; +import java.util.List; + +public class ModuleActionData { + protected List moduleList; + List guiAnchorList; + List xTranslationList; + List yTranslationList; + List valueList; + final HudLayoutEditorGui hudEditorGui; + + ModuleActionData(HudLayoutEditorGui hudEditorGui, List positions) { + this.hudEditorGui = hudEditorGui; + ArrayList moduleList = new ArrayList(); + ArrayList guiAnchorList = new ArrayList(); + ArrayList xTranslationList = new ArrayList(); + ArrayList yTranslationList = new ArrayList(); + ArrayList valueList = new ArrayList(); + for (ModulePosition position : positions) { + if (position.module.getGuiAnchor() == null) continue; + moduleList.add(position.module); + guiAnchorList.add(position.module.getGuiAnchor()); + xTranslationList.add(position.module.getXTranslation()); + yTranslationList.add(position.module.getYTranslation()); + valueList.add(position.module.masterScale()); + } + this.moduleList = moduleList; + this.guiAnchorList = guiAnchorList; + this.xTranslationList = xTranslationList; + this.yTranslationList = yTranslationList; + this.valueList = valueList; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModuleDataHolder.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModuleDataHolder.java new file mode 100644 index 0000000..e4f75d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModuleDataHolder.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.data.ScreenLocation; +import com.cheatbreaker.client.module.AbstractModule; + +public class ModuleDataHolder { + public AbstractModule module; + public float xTranslation; + public float yTranslation; + public float scale; + public float width; + public float height; + public int mouseY; + public int mouseX; + public ScreenLocation screenLocation; + public GuiAnchor anchor; + public HudLayoutEditorGui layoutEditorGui; + + public ModuleDataHolder(HudLayoutEditorGui layoutEditorGui, AbstractModule module, ScreenLocation screenLocation, int mouseX, int mouseY) { + this.layoutEditorGui = layoutEditorGui; + this.module = module; + this.xTranslation = module.getXTranslation(); + this.yTranslation = module.getYTranslation(); + this.width = module.width * (Float) module.masterScale(); + this.height = module.height * (Float) module.masterScale(); + this.mouseX = mouseX; + this.mouseY = mouseY; + this.screenLocation = screenLocation; + this.scale = (Float) module.scale.getValue(); + this.anchor = module.getGuiAnchor(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModulePlaceGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModulePlaceGui.java new file mode 100644 index 0000000..5033eab --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModulePlaceGui.java @@ -0,0 +1,159 @@ +package com.cheatbreaker.client.ui.module; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class ModulePlaceGui extends GuiScreen { + private final AbstractModule module; + private final HudLayoutEditorGui eventButton; + + public ModulePlaceGui(HudLayoutEditorGui cBModulesGui, AbstractModule abstractModule) { + abstractModule.setState(true); + this.module = abstractModule; + this.eventButton = cBModulesGui; + } + + @Override + public void updateScreen() { + } + + @Override + public void initGui() { + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { +// if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().useBackgroundOverlay.getValue()) { +// this.drawDefaultBackground(); +// } else { + this.renderBlur(); +// } + RenderUtil.drawRoundedRect(0.0, this.height / 3, this.width, (float)(this.height / 3) + 2.1086957f * 0.23711339f, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(0.0, this.height / 3 * 2, this.width, (float)(this.height / 3 * 2) + 1.1388888f * 0.43902442f, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(this.width / 3, 0.0, (float)(this.width / 3) + 0.42073172f * 1.1884058f, this.height, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(this.width / 3 * 2, 0.0, (float)(this.width / 3 * 2) + 0.28070176f * 1.78125f, this.height, 0.0, 0x6F000000); + RenderUtil.drawRoundedRect(this.width / 3 + this.width / 6, this.height / 3 * 2, (float)(this.width / 3 + this.width / 6) + 6.7000003f * 0.07462686f, this.height, 0.0, 0x6F000000); + float f2 = 1.0f / CheatBreaker.getScaleFactor() / this.module.masterScale(); +// float f3 = (float)(CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(this.selectedButton.getName()) + 6) * f2; +// if (this.selectedButton.width < f3) { +// this.selectedButton.width = (int)f3; +// } +// if (this.selectedButton.height < (float)18) { +// this.selectedButton.height = 18; +// } + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + float[] arrf = AnchorHelper.getPositions(mouseX, mouseY, scaledResolution); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(mouseX, mouseY, scaledResolution); + if (cBGuiAnchor != GuiAnchor.MIDDLE_MIDDLE) { + if (cBGuiAnchor == GuiAnchor.MIDDLE_BOTTOM_LEFT || cBGuiAnchor == GuiAnchor.MIDDLE_BOTTOM_RIGHT) { + Gui.drawRect(arrf[0], arrf[1], arrf[0] + (float)(scaledResolution.getScaledWidth() / 6), arrf[1] + (float)(scaledResolution.getScaledHeight() / 3), 0x2F000000); + } else { + Gui.drawRect(arrf[0], arrf[1], arrf[0] + (float)(scaledResolution.getScaledWidth() / 3), arrf[1] + (float)(scaledResolution.getScaledHeight() / 3), 0x2F000000); + } + } + int n3 = scaledResolution.getScaledWidth(); + int n4 = scaledResolution.getScaledHeight(); + float[] arrf2 = AnchorHelper.getPositions(this.module, mouseX, mouseY, scaledResolution); + if (cBGuiAnchor != this.module.getGuiAnchor()) { + this.module.setAnchor(cBGuiAnchor); + this.module.setTranslations(0.0f, 0.0f); + } + if (!Mouse.isButtonDown(1)) { + RenderUtil.drawRoundedRect(2, 0.0, 1.8636363192038112 * 1.3414634466171265, n4, 0.0, -15599126); + RenderUtil.drawRoundedRect((float)n3 - 1.1197916f * 2.2325583f, 0.0, n3 - 2, n4, 0.0, -15599126); + RenderUtil.drawRoundedRect(0.0, 2, n3, 0.4375 * 5.714285714285714, 0.0, -15599126); + RenderUtil.drawRoundedRect(0.0, (float)n4 - 0.557971f * 6.2727275f, n3, n4 - 3, 0.0, -15599126); + } + float f4 = (float) mouseX - arrf[0] - arrf2[0]; + float f5 = (float) mouseY - arrf[1] - arrf2[1]; + if (!Mouse.isButtonDown(1)) { + float[] arrf3 = this.module.getScaledPoints(scaledResolution, false); + f4 = this.lIIIIlIIllIIlIIlIIIlIIllI(this.module, f4, arrf3, (float)((int)(this.module.width * (Float) this.module.masterScale())), false); + f5 = this.lIIIIIIIIIlIllIIllIlIIlIl(this.module, f5, arrf3, (float)((int)(this.module.height * (Float) this.module.masterScale())), false); + } + this.module.setTranslations(f4, f5); + GL11.glPushMatrix(); + this.module.scaleAndTranslate(scaledResolution); + RenderUtil.drawRoundedRect(-2, -2, this.module.width + 2.0f, this.module.height + 2.0f, 4, 551805923); + GL11.glPushMatrix(); + GL11.glScalef(f2, f2, f2); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showModName.getValue()) { + float v = mouseY < 9 ? module.height / f2 : (float)(-CheatBreaker.getInstance().ubuntuMedium16px.getHeight() - 4); + switch (module.getPosition()) { + case LEFT: + float f6 = 0.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(module.getName(), f6, v, -1); + break; + case CENTER: + float f7 = module.width / f2 / 2.0f; + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredStringWithShadow(module.getName(), f7, v, -1); + break; + case RIGHT: + float f8 = module.width / f2 - (float)CheatBreaker.getInstance().ubuntuMedium16px.getStringWidth(module.getName()); + CheatBreaker.getInstance().ubuntuMedium16px.drawStringWithShadow(module.getName(), f8, v, -1); + } + } + GL11.glPopMatrix(); + GL11.glPopMatrix(); + } + + private float lIIIIlIIllIIlIIlIIIlIIllI(AbstractModule abstractModule, float f, float[] arrf, float f2, boolean bl) { + int n; + float f3 = f; + int n2 = n = bl ? 0 : 3; + if (f3 + arrf[0] < (float)n) { + f3 = -arrf[0] + (float)n; + } else if (f3 + arrf[0] * (Float) abstractModule.masterScale() + f2 > (float)(this.width - n)) { + f3 = (int)((float)this.width - arrf[0] * (Float) abstractModule.masterScale() - f2 - (float)n); + } + return f3; + } + + private float lIIIIIIIIIlIllIIllIlIIlIl(AbstractModule abstractModule, float f, float[] arrf, float f2, boolean bl) { + int n; + float f3 = f; + int n2 = n = bl ? 0 : 2; + if (f3 + arrf[1] < (float)n) { + f3 = -arrf[1] + (float)n; + } else if (f3 + arrf[1] * (Float) abstractModule.masterScale() + f2 > (float)(this.height - n)) { + f3 = (int)((float)this.height - arrf[1] * (Float) abstractModule.masterScale() - f2 - (float)n); + } + return f3; + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + if (mouseButton != 0) { + return; + } + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + GuiAnchor cBGuiAnchor = AnchorHelper.getAnchor(mouseX, mouseY, scaledResolution); + this.module.setAnchor(cBGuiAnchor); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.module.setState(true); + HudLayoutEditorGui editorGui = new HudLayoutEditorGui(); + this.mc.displayGuiScreen(editorGui); + editorGui.currentScrollableElement = editorGui.modulesElement; + editorGui.currentScrollableElement.bottom = false; + editorGui.currentScrollableElement.scrollAmount = this.eventButton.modulesElement.scrollAmount; + editorGui.currentScrollableElement.yOffset = 0; + } + + @Override + public void mouseMovedOrUp(int n, int n2, int n3) { + } + + @Override + public void keyTyped(char c, int n) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModulePosition.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModulePosition.java new file mode 100644 index 0000000..02cccce --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ModulePosition.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.module.AbstractModule; + +public class ModulePosition { + protected AbstractModule module; + protected float x; + protected float y; + + ModulePosition(AbstractModule abstractModule, float f, float f2) { + this.module = abstractModule; + this.x = f; + this.y = f2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/Position.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/Position.java new file mode 100644 index 0000000..6c5aeff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/Position.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.ui.module; + +public enum Position { + BOTTOM("BOTTOM"), + TOP("TOP"), + CENTER("CENTER"), + LEFT("LEFT"), + RIGHT("RIGHT"); + + private final String identifier; + + Position(String identifier) { + this.identifier = identifier; + } + + + public String getIdentifier() { + return this.identifier; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ProfileCreatorGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ProfileCreatorGui.java new file mode 100644 index 0000000..28b558a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/module/ProfileCreatorGui.java @@ -0,0 +1,155 @@ +package com.cheatbreaker.client.ui.module; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.config.Profile; +import com.cheatbreaker.client.ui.element.profile.ProfileElement; +import com.cheatbreaker.client.ui.element.profile.ProfilesListElement; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.src.Config; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.io.File; +import java.nio.file.CopyOption; +import java.nio.file.Files; + +public class ProfileCreatorGui extends GuiScreen { + private final GuiScreen selectedButton; + private GuiTextField textField = null; + private final float scale; + private final int highlightColor; + private final ProfilesListElement profileList; + private String errorString = ""; + private boolean showGui = false; + private Profile profile; + + public ProfileCreatorGui(Profile profile, GuiScreen guiScreen, ProfilesListElement list, int highlightColor, float scale) { + this(guiScreen, list, highlightColor, scale); + this.profile = profile; + } + + public ProfileCreatorGui(GuiScreen guiScreen, ProfilesListElement list, int highlightColor, float scale) { + this.selectedButton = guiScreen; + this.scale = scale; + this.profileList = list; + this.highlightColor = highlightColor; + this.showGui = true; + } + + @Override + public void updateScreen() { + this.textField.updateCursorCounter(); + } + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + @Override + public void initGui() { + Keyboard.enableRepeatEvents(true); + if (!this.showGui) { + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).profilesElement; + } else { + this.showGui = false; + this.textField = new GuiTextField(this.mc.fontRenderer, this.width / 2 - 70, this.height / 2 - 6, 140, 10); + if (this.profile != null) { + this.textField.setText(this.profile.getName()); + } + this.textField.setFocused(true); + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.selectedButton.drawScreen(mouseX, mouseY, partialTicks); + this.drawDefaultBackground(); + ProfileCreatorGui.drawRect(this.width / 2 - 73, this.height / 2 - 19, this.width / 2 + 73, this.height / 2 + 8, -11250604); + ProfileCreatorGui.drawRect(this.width / 2 - 72, this.height / 2 - 18, this.width / 2 + 72, this.height / 2 + 7, -3881788); + GL11.glPushMatrix(); + GL11.glScalef(this.scale, this.scale, this.scale); + int n3 = (int)((float)this.width / this.scale); + int n4 = (int)((float)this.height / this.scale); + CheatBreaker.getInstance().ubuntuMedium16px.drawString("Profile Name: ", (float)(n3 / 2) - (float)70 / this.scale, (float)(n4 / 2) - (float)17 / this.scale, 0x6F000000); + CheatBreaker.getInstance().ubuntuMedium16px.drawString(this.errorString, (float)(n3 / 2) - (float)72 / this.scale, (float)(n4 / 2) + (float)8 / this.scale, -1358954496); + GL11.glPopMatrix(); + this.textField.drawTextBox(); + } + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.textField.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + public void mouseMovedOrUp(int n, int n2, int n3) { + super.mouseMovedOrUp(n, n2, n3); + } + + @Override + public void keyTyped(char c, int n) { + switch (n) { + case 1: + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).profilesElement; + break; + case 28: + if (this.textField.getText().length() < 3) { + this.errorString = EnumChatFormatting.RED + "Name must be at least 3 characters long."; + break; + } + if (this.textField.getText().equalsIgnoreCase("default")) { + this.errorString = EnumChatFormatting.RED + "That name is already in use."; + break; + } + if (!this.textField.getText().matches("([a-zA-Z0-9-_ \\]\\[]+)")) { + this.errorString = EnumChatFormatting.RED + "Illegal characters in name."; + break; + } + if (this.profile != null && !this.profile.isNotEditable()) { + File file = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch() + File.separator + "profiles" + File.separator + this.profile.getName() + ".cfg"); + File file2 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "config" + File.separator + "cheatbreaker-client-" + Config.MC_VERSION + "-" + CheatBreaker.getInstance().getGitBranch() + File.separator + "profiles" + File.separator + this.textField.getText() + ".cfg"); + if (!file.exists()) break; + try { + Files.copy(file.toPath(), file2.toPath()); + Files.delete(file.toPath()); + this.profile.setName(this.textField.getText()); + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).profilesElement; + } + catch (Exception exception) { + this.errorString = EnumChatFormatting.RED + "Could not save profile."; + exception.printStackTrace(); + } + break; + } + Profile profile = null; + for (Profile profile2 : CheatBreaker.getInstance().profiles) { + if (!profile2.getName().toLowerCase().equalsIgnoreCase(this.textField.getText())) continue; + profile = profile2; + break; + } + if (profile == null) { + CheatBreaker.getInstance().configManager.writeProfile(CheatBreaker.getInstance().activeProfile.getName()); + Profile profile3 = new Profile(this.textField.getText(), false); + CheatBreaker.getInstance().profiles.add(profile3); + CheatBreaker.getInstance().activeProfile = profile3; + this.profileList.profileList.add(new ProfileElement(this.profileList, this.highlightColor, profile3, this.scale)); + CheatBreaker.getInstance().configManager.writeProfile(CheatBreaker.getInstance().activeProfile.getName()); + this.mc.displayGuiScreen(this.selectedButton); + ((HudLayoutEditorGui)this.selectedButton).currentScrollableElement = ((HudLayoutEditorGui)this.selectedButton).profilesElement; + break; + } + this.errorString = EnumChatFormatting.RED + "That name is already in use."; + break; + default: + this.textField.keyTyped(c, n); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/CBAlert.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/CBAlert.java new file mode 100644 index 0000000..9c5109f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/CBAlert.java @@ -0,0 +1,101 @@ +package com.cheatbreaker.client.ui.overlay; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.AbstractFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; + +public class CBAlert { + private final AbstractFade fadeTime = new FloatFade(275L); + private static final float alertWidth = 140F; + private static final float alertHeight = 55F; + private boolean titleBar; + private float lastHeight; + private float height; + private final String title; + private final String[] message; + private final long openTime; + + public CBAlert(String string, String[] stringArray, float f2) { + this.title = string; + this.message = stringArray; + this.height = f2; + this.lastHeight = f2; + this.openTime = System.currentTimeMillis(); + } + + public void render() { + float f = this.lastHeight - (this.lastHeight - this.height) * this.fadeTime.getFadeAmount(); + + Gui.drawGradientRect(this.lastHeight, f, this.lastHeight + alertWidth, f + alertHeight, -819057106, -822083584); + if (!this.titleBar) { + CheatBreaker.getInstance().playRegular14px.drawStringWithShadow(this.title, this.lastHeight + (float) 4, f + (float) 4, -1); + Gui.drawRect(this.lastHeight + (float) 4, f + 14.5f, this.lastHeight + alertWidth - (float) 5, f + (float) 15, 0x2E5E5E5E); + } + for (int i = 0; i < this.message.length && i <= 2; ++i) { + CheatBreaker.getInstance().playRegular14px.drawString(this.message[i], this.lastHeight + (float) 4, f + (float) 17 + (float) (i * 10), -1); + } + + if (!(Minecraft.getMinecraft().currentScreen instanceof OverlayGui)) + CheatBreaker.getInstance().playRegular14px.drawString("Press Shift + Tab", this.lastHeight + (float) 4, f + (float) CBAlert.getHeight() - (float) 12, 0x6FFFFFFF); + } + + public void setMaxHeight(float f) { + this.lastHeight = this.height; + this.height = f; + this.fadeTime.startAnimation(); + } + + public boolean isFading() { + return !this.fadeTime.isTimeNotAtZero() || this.fadeTime.isOver(); + } + + public boolean shouldDisplay() { + return System.currentTimeMillis() - this.openTime > 3500L; + } + + public static void displayMessage(String string, String string2) { + OverlayGui.getInstance().displayMessage(string, string2); + } + + public static void displayMessage(String string) { + OverlayGui.getInstance().displayMessage(string); + } + + public static int getWidth() { + return 140; + } + + public static int getHeight() { + return 55; + } + + public void showTitleBar(boolean bl) { + this.titleBar = bl; + } + + public float getCurrentHeight() { + return this.lastHeight; + } + + public float getLastHeight() { + return this.lastHeight; + } + + public float getMaxHeight() { + return this.height; + } + + public void setCurrentHeight(float f) { + this.lastHeight = f; + } + + public void setWidth(float f) { + } + + public void setHeight(float f) { + this.height = f; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/ConsoleElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/ConsoleElement.java new file mode 100644 index 0000000..c42c3e6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/ConsoleElement.java @@ -0,0 +1,202 @@ +package com.cheatbreaker.client.ui.overlay; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.shared.WSPacketConsoleMessage; +import com.cheatbreaker.client.ui.element.DraggableElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.MessageUtils; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; + +public class ConsoleElement extends DraggableElement { + + private final List sentCommands = new ArrayList<>(); + private int commandIndex = 0; + + private final InputFieldElement textInputBar; + private final ScrollableElement scrollBar; + private final FlatButtonElement sendButton; + private final FlatButtonElement closeButton; + + public ConsoleElement() { + this.textInputBar = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "", 0x2FFFFFFF, 0x6FFFFFFF); + this.textInputBar.setMaxStringLength(256); + this.scrollBar = new ScrollableElement(this); + this.sendButton = new FlatButtonElement("SEND"); + this.closeButton = new FlatButtonElement("X"); + } + + @Override + public void setElementSize(float x, float y, float width, float height) { + super.setElementSize(x, y, width, height); + this.textInputBar.setElementSize(x + 2.0f, y + height - 15.0f, width - 40.0f, 13.0f); + this.scrollBar.setElementSize(x + width - 6.0f, y + 12.0f + 3.0f, 4.0f, height - 32.0f); + this.sendButton.setElementSize(x + width - 37.0f, y + height - 15.0f, 35.0f, 13.0f); + this.closeButton.setElementSize(x + width - 12.0f, y + 2.0f, 10.0f, 10.0f); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + this.onDrag(f, f2); + Gui.drawBoxWithOutLine(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0.5f, -16777216, -15395563); + GL11.glPushMatrix(); + Gui.drawRect(this.xPosition, this.yPosition - 0.5f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 0.5f, -1357572843); + + CheatBreaker.getInstance().playRegular14px.drawString("Console", this.xPosition + (float)4, this.yPosition + (float)3, -1); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + Gui.drawRect(this.xPosition + 2.0f, this.yPosition + (float)12 + (float)3, this.xPosition + this.width - 2.0f, this.yPosition + this.height - (float)17, -1356783327); + this.scrollBar.onScroll(f, f2, bl); + try { + if (CheatBreaker.getInstance().isConsoleAccess()) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui overlayGui = OverlayGui.getInstance(); + RenderUtil.startScissorBox((int)(this.xPosition + 2.0f), (int)(this.yPosition + (float)12 + (float)3), (int)(this.xPosition + this.width - 2.0f), (int)(this.yPosition + this.height - (float)17), (float)((int)((float)overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int)overlayGui.getScaledHeight()); + List list = CheatBreaker.getInstance().getConsoleLines(); + int n = 0; + for (int i = list.size() - 1; i >= 0; --i) { + String string = list.get(i); + String[] arrstring = CheatBreaker.getInstance().playRegular14px.formatText(string, this.width - 10.0F).split("\n"); + n += arrstring.length * 10; + int n2 = 0; + for (String string2 : arrstring) { + CheatBreaker.getInstance().playRegular14px.drawString(string2, this.xPosition + (float)6, this.yPosition + this.height - (float)19 - (float)n + (float)(n2 * 10), -1); + ++n2; + } + } + this.scrollBar.setScrollAmount(n + 4); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + this.scrollBar.drawElementHover(f, f2, bl); + GL11.glPopMatrix(); + this.textInputBar.drawElementHover(f, f2, bl); + this.sendButton.drawElementHover(f, f2, bl); + this.closeButton.drawElementHover(f, f2, bl); + } + + @Override + public void handleElementUpdate() { + this.textInputBar.handleElementUpdate(); + this.sendButton.handleElementUpdate(); + this.scrollBar.handleElementUpdate(); + this.closeButton.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.textInputBar.handleElementClose(); + this.sendButton.handleElementClose(); + this.scrollBar.handleElementClose(); + this.closeButton.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + if (this.textInputBar.isFocused() && !this.textInputBar.getText().equals("") && n == 28) { + this.handleElementKeyTyped(); + } + + try { + if (this.textInputBar.isFocused() && n == 200 && this.sentCommands.size() != 0) { + if (this.commandIndex != 0) this.commandIndex--; + this.textInputBar.setText(this.sentCommands.get(this.commandIndex)); + } else if (this.textInputBar.isFocused() && n == 208 && this.sentCommands.size() != 0) { + if (this.commandIndex != this.sentCommands.size() - 1) this.commandIndex++; + this.textInputBar.setText(this.sentCommands.get(this.commandIndex)); + } + } catch (IndexOutOfBoundsException ignored) { + /* Set it to the first one... */ + this.commandIndex = 0; + } + + + this.textInputBar.keyTyped(c, n); + this.sendButton.keyTyped(c, n); + this.scrollBar.keyTyped(c, n); + this.closeButton.keyTyped(c, n); + } + + @Override + public boolean onMouseClick(float f, float f2, int n) { + if (!this.textInputBar.isMouseInside(f, f2) && this.textInputBar.isFocused()) { + this.textInputBar.setFocused(false); + } + return false; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.textInputBar.handleElementMouseClicked(f, f2, n, bl); + this.scrollBar.handleElementMouseClicked(f, f2, n, bl); + if (!bl) { + return false; + } + + if (!this.textInputBar.getText().equals("") && this.sendButton.isMouseInside(f, f2)) { + this.handleElementKeyTyped(); + } + this.sendButton.handleElementMouseClicked(f, f2, n, bl); + if (this.isMouseInside(f, f2) && f2 < this.yPosition + (float)12) { + this.setPosition(f, f2); + } + if (this.closeButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().removeElement(this); + return true; + } + return false; + } + + @Override + public void handleElementMouse() { + this.scrollBar.handleElementMouse(); + } + + private void handleElementKeyTyped() { + String consoleText = this.textInputBar.getText(); + if (consoleText.equals("ban")) { + MessageUtils.sendBan("Test", 1); + } else if (consoleText.equals("clear") || consoleText.equals("cls")) { + CheatBreaker.getInstance().getConsoleLines().clear(); + CheatBreaker.getInstance().getGlobalSettings().SHOW_MODIFIERS = false; + } else if (consoleText.equalsIgnoreCase("wsReconnect") && CheatBreaker.getInstance().getWSNetHandler().isClosed()) { + try { + CheatBreaker.getInstance().connectToAssetServer(); + } catch (URISyntaxException e) { + CheatBreaker.getInstance().getConsoleLines().add("Invalid URL: " + e.getInput()); + e.printStackTrace(); + } + } else { + CheatBreaker.getInstance().getConsoleLines().add(EnumChatFormatting.GRAY + "> " + consoleText); + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketConsoleMessage(consoleText)); + this.sentCommands.add(consoleText); + this.commandIndex = this.sentCommands.size(); + } + this.textInputBar.setText(""); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + this.textInputBar.onMouseMoved(f, f2, n, bl); + this.sendButton.onMouseMoved(f, f2, n, bl); + this.scrollBar.onMouseMoved(f, f2, n, bl); + this.closeButton.onMouseMoved(f, f2, n, bl); + return false; + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/OverlayGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/OverlayGui.java new file mode 100644 index 0000000..f1693c8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/OverlayGui.java @@ -0,0 +1,326 @@ +package com.cheatbreaker.client.ui.overlay; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.audio.music.elements.RadioElement; +import com.cheatbreaker.client.audio.music.util.DashUtil; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.element.type.ElementListElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.friend.*; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.Friend; +import com.cheatbreaker.client.util.friend.FriendRequest; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +public class OverlayGui extends AbstractGui { + private static OverlayGui instance; + private final FriendsListElement friendsListElement; + private final FriendRequestListElement friendRequestsElement; + private final FlatButtonElement friendsButton; + private final FlatButtonElement requestsButton; + private ElementListElement selectedFriendElement; + private final RadioElement radioButton; + private MessagesElement messages; + private long openTime; + private final Queue alertQueue = new LinkedList(); + private final List alertList = new ArrayList(); + private GuiScreen context; + private long lastTyped; + + public OverlayGui() { + ArrayList friendElements = new ArrayList<>(); + CheatBreaker.getInstance().getFriendsManager().getFriends().forEach((string, friend) -> friendElements.add(new FriendElement(friend))); + AbstractElement[] arrabstractElement = new AbstractElement[5]; + this.friendsListElement = new FriendsListElement(friendElements); + arrabstractElement[0] = this.friendsListElement; + this.friendRequestsElement = new FriendRequestListElement(new ArrayList()); + arrabstractElement[1] = this.friendRequestsElement; + this.requestsButton = new FlatButtonElement("REQUESTS"); + arrabstractElement[2] = this.requestsButton; + this.friendsButton = new FlatButtonElement("FRIENDS"); + arrabstractElement[3] = this.friendsButton; + this.radioButton = new RadioElement(); + arrabstractElement[4] = this.radioButton; + this.setElements(arrabstractElement); + this.addElements(this.friendsListElement, this.friendRequestsElement, this.requestsButton, this.friendsButton); + this.selectedFriendElement = this.friendsListElement; + } + + public void setMessages(Friend friend) { + try { + MessagesElement messagesElement = null; + for (AbstractElement abstractElement : this.selectedButton) { + if (!(abstractElement instanceof MessagesElement)) continue; + messagesElement = (MessagesElement)abstractElement; + } + if (messagesElement == null) { + this.messages = new MessagesElement(friend); + this.selectedButton.add(this.messages); + this.messages.setElementSize(170.0f, 30.0f, 245.0f, 150); + } else { + this.selectedButton.add(this.selectedButton.remove(this.selectedButton.indexOf(messagesElement))); + messagesElement.handleElementUpdate(friend); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + @Override + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.openTime = System.currentTimeMillis(); + if (this.mc.lastScreen != this) { + this.blurGui(); + } + friendsListElement.getElements().clear(); + for(Friend friend : CheatBreaker.getInstance().getFriendsManager().getFriends().values()) { + friendsListElement.getElements().add(new FriendElement(friend)); + } + this.friendsButton.setElementSize(0.0f, 28.0f, 96.976746f * 0.71666664f, 20); + this.requestsButton.setElementSize(55.315384f * 1.2745098f, 28.0f, 0.5588235f * 124.36842f, 20); + float f = (float)28 + this.friendsButton.getHeight() + 1.0f; + this.friendsListElement.setElementSize(0.0f, f, 140.0f, this.getScaledHeight() - f); + this.friendRequestsElement.setElementSize(0.0f, f, 140.0f, this.getScaledHeight() - f); + float f2 = 190; + this.radioButton.setElementSize(this.getScaledWidth() - f2 - 20.0f, 20.0f, f2, 28); + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + this.handleElementMouse(); + } + + @Override + public void drawMenu(float f, float f2) { + GL11.glClear(256); + this.renderBlur(this.getScaledWidth(), this.getScaledHeight()); + OverlayGui.drawRect(0.0f, 0.0f, 140, this.getScaledHeight(), -14671840); + OverlayGui.drawRect(140, 0.0f, 141, this.getScaledHeight(), -15395563); + OverlayGui.drawRect(0.0f, 0.0f, 140, 28, -15395563); + OverlayGui.drawRect(6, 6, 22, 22, Friend.getStatusColor(CheatBreaker.getInstance().getPlayerStatus())); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(this.mc.getSession().getUsername(), this.mc.getSession().getPlayerID()); + RenderUtil.renderIcon(resourceLocation, 7.0F, 7.0F, 7.0F); + CheatBreaker.getInstance().playRegular16px.drawString(this.mc.getSession().getUsername(), 28, 6.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(CheatBreaker.getInstance().getStatusString(), 28, 15.0f, -5460820); + boolean bl = f > 6.0F && f < 134.0F && f2 > 6.0F && f2 < 22.0F; + if (this.mouseClicked(this.friendsButton, f, f2) && bl && CheatBreaker.getInstance().getWSNetHandler().isOpen()) { + OverlayGui.drawRect(22, 0.0f, 140, 28, -15395563); + OverlayGui.drawRect(24, 6, 40, 22, Friend.getStatusColor(Friend.Status.ONLINE)); + OverlayGui.drawRect(42, 6, 58, 22, Friend.getStatusColor(Friend.Status.AWAY)); + OverlayGui.drawRect(60, 6, 76, 22, Friend.getStatusColor(Friend.Status.BUSY)); + OverlayGui.drawRect(78, 6, 94, 22, Friend.getStatusColor(Friend.Status.OFFLINE)); + GL11.glColor4f(1.2553191f * 0.11949153f, 0.30555555f * 0.4909091f, 0.885f * 0.16949153f, 1.0f); + RenderUtil.renderIcon(resourceLocation, 7.0F, 25.0F, 7.0F); + RenderUtil.renderIcon(resourceLocation, 7.0F, 43.0f, 7.0F); + RenderUtil.renderIcon(resourceLocation, 7.0F, 61.0f, 7.0F); + RenderUtil.renderIcon(resourceLocation, 7.0F, 79.0f, 7.0F); + } + this.selectedFriendElement.drawElementHover(f, f2, this.mouseClicked(this.requestsButton, f, f2)); + OverlayGui.drawRect(51.369568f * 1.3529412f, 28, 0.74025977f * 95.23684f, 28.0f + this.friendsButton.getHeight(), -14869219); + OverlayGui.drawRect(0.0f, 28.0f + this.friendsButton.getHeight(), 140, 28.0f + this.friendsButton.getHeight() + 1.0f, -15395563); + this.drawElementHover(f, f2, this.friendsListElement, this.friendRequestsElement); + } + + @Override + public void keyTyped(char c, int n) { + if (n == 15 && Keyboard.isKeyDown(42) && System.currentTimeMillis() - this.openTime > 200L || n == 1) { + this.lastTyped = System.currentTimeMillis(); + this.mc.displayGuiScreen(this.context); + } + this.handleElementKeyTyped(c, n); + if (n == 59 && CheatBreaker.getInstance().isConsoleAccess()) { + boolean bl = true; + for (AbstractElement abstractElement : this.selectedButton) { + if (!(abstractElement instanceof ConsoleElement)) continue; + bl = false; + } + if (bl) { + AbstractElement[] arrabstractElement = new AbstractElement[1]; + ConsoleElement consoleElement = new ConsoleElement(); + arrabstractElement[0] = consoleElement; + this.addElement(arrabstractElement); + consoleElement.setElementSize(60.0f, 30.0f, 300.0f, 145); + } + } + } + + @Override + protected void mouseClicked(float mouseX, float mouseY, int n) { + this.selectedFriendElement.handleElementMouseClicked(mouseX, mouseY, n, this.mouseClicked(this.requestsButton, mouseX, mouseY)); + this.swapElement(mouseX, mouseY, n, this.friendsListElement, this.friendRequestsElement); + boolean bl2 = this.mouseClicked(this.friendsButton, mouseX, mouseY); + if (bl2 && this.friendsButton.isMouseInside(mouseX, mouseY) && this.selectedFriendElement != this.friendsListElement) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.selectedFriendElement = this.friendsListElement; + } else if (bl2 && this.requestsButton.isMouseInside(mouseX, mouseY) && this.selectedFriendElement != this.friendRequestsElement) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.selectedFriendElement = this.friendRequestsElement; + } + boolean bl = mouseX > 6.0f && mouseX < 134.0f && mouseY > 6.0f && mouseY < 22.0f; + if (bl2 && bl && CheatBreaker.getInstance().getWSNetHandler().isOpen()) { + boolean bl5 = mouseX > 24.0f && mouseX < 40.0f; + boolean bl6 = mouseX > 42.0f && mouseX < 58.0f; + boolean bl7 = mouseX > 60.0f && mouseX < 76.0f; + boolean bl4 = mouseX > 78.0f && mouseX < 94.0f; + if (bl5) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.ONLINE); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl6) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.AWAY); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl7) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.BUSY); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } else if (bl4) { + CheatBreaker.getInstance().setPlayerStatus(Friend.Status.OFFLINE); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + CheatBreaker.getInstance().getWSNetHandler().updateClientStatus(); + } + } + + @Override + public void mouseMovedOrUp(float f, float f2, int n) { + this.onMouseMoved(f, f2, n); + } + + @Override + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + this.context = null; + this.closeElements(); + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void updateScreen() { + if (this.context != null) { + this.context.updateScreen(); + } + this.friendsButton.setText("FRIENDS (" + this.friendsListElement.getElements().size() + ")"); + this.requestsButton.setText("REQUESTS (" + this.friendRequestsElement.getElements().stream().filter(friend -> !friend.getFriendRequest().isFriend()).count() + ")"); + this.updateElements(); + } + + public void pollNotifications() { + this.alertList.removeIf(CBAlert::shouldDisplay); + if (this.alertQueue.isEmpty()) { + return; + } + boolean bl = true; + for (CBAlert cBAlert2 : this.alertList) { + if (cBAlert2.isFading()) continue; + bl = false; + } + if (bl) { + CBAlert cBAlert3 = this.alertQueue.poll(); + cBAlert3.setMaxHeight(this.getScaledHeight() - (float)CBAlert.getHeight()); + this.alertList.forEach(cBAlert -> cBAlert.setMaxHeight(cBAlert.getMaxHeight() - (float)CBAlert.getHeight())); + this.alertList.add(cBAlert3); + } + } + + public void renderGameOverlay() { + this.alertList.forEach(CBAlert::render); + if (this.mc != null && this.mc.currentScreen == null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().pinRadio.getValue() && DashUtil.isActive()) { + this.radioButton.drawElementHover(0.0f, 0.0f, false); + } + } + + @Override + public void setWorldAndResolution(Minecraft mc, int n, int n2) { + if (this.context != null) { + this.context.setWorldAndResolution(mc, n, n2); + } + float f = this.getScaledHeight(); + super.setWorldAndResolution(mc, n, n2); + this.alertList.forEach(cBAlert -> this.setDimensions(cBAlert, this.getScaledHeight() + f)); + this.alertQueue.forEach(cBAlert -> this.setDimensions(cBAlert, this.getScaledHeight() + f)); + } + + private void setDimensions(CBAlert cBAlert, float f) { + cBAlert.setHeight(this.getScaledWidth() - (float)CBAlert.getWidth()); + cBAlert.setCurrentHeight(cBAlert.getLastHeight() - f); + cBAlert.setHeight(cBAlert.getMaxHeight() - f); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + if (this.context != null) { + this.context.drawScreen(-1, -1, partialTicks); + } + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void displayMessage(String string) { + this.displayMessage("", string); + } + + public void displayMessage(String title, String message) { + int width = CBAlert.getWidth(); + message = CheatBreaker.getInstance().playRegular14px.formatText(message, width - 10); + CBAlert cBAlert = new CBAlert(title, message.split("\n"), this.getScaledHeight()); + cBAlert.showTitleBar(title.equals("")); + this.alertQueue.add(cBAlert); + System.out.println(message); + } + + public void handleFriend(Friend friend, boolean bl) { + if (bl) { + this.friendsListElement.getElements().add(new FriendElement(friend)); + } else { + this.friendsListElement.getElements().removeIf(friendElement -> friendElement.getFriend() == friend); + } + this.friendsListElement.updateSize(); + } + + public void handleFriendRequest(FriendRequest friendRequest, boolean bl) { + if (bl) { + this.friendRequestsElement.getElements().add(new FriendRequestElement(friendRequest)); + } else { + this.friendRequestsElement.getElements().removeIf(friendRequestElement -> friendRequestElement.getFriendRequest() == friendRequest); + } + this.friendRequestsElement.setElementSize(); + } + + public static OverlayGui createInstance(GuiScreen guiScreen) { + if (guiScreen != instance) { + OverlayGui.getInstance().context = guiScreen; + } + return OverlayGui.getInstance(); + } + + public static OverlayGui getInstance() { + return instance; + } + + public static void setInstance(OverlayGui overlayGui) { + instance = overlayGui; + } + + public FriendsListElement getFriendsListElement() { + return this.friendsListElement; + } + + public FriendRequestListElement getFriendRequestsElement() { + return this.friendRequestsElement; + } + + public long getLastTyped() { + return this.lastTyped; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendElement.java new file mode 100644 index 0000000..6805f37 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendElement.java @@ -0,0 +1,108 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientFriendRemove; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.fading.FloatFade; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.Friend; +import com.cheatbreaker.client.util.friend.FriendsManager; +import lombok.Getter; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.List; + +public class FriendElement extends AbstractElement { + @Getter private final Friend friend; + private final CosineFade fade; + private final FloatFade removeFade; + private static final ResourceLocation removeIcon = new ResourceLocation("client/icons/garbage-26.png"); + private static final ResourceLocation cheatBreakerIcon = new ResourceLocation("client/logo_26.png"); + + public FriendElement(Friend friend) { + this.friend = friend; + this.fade = new CosineFade(1500L); + this.removeFade = new FloatFade(200L); + this.fade.loopAnimation(); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + List list; + if (bl && this.isMouseInside(f, f2)) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13750738); + } + + GL11.glPushMatrix(); + FriendsManager friendsManager = CheatBreaker.getInstance().getFriendsManager(); + + if (friendsManager.getMessage().containsKey(this.friend.getPlayerId())) { + list = friendsManager.getMessage().get(this.friend.getPlayerId()); + if (list != null && list.size() > 0) { + if (!this.fade.isTimeNotAtZero()) { + this.fade.startAnimation(); + } + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, new Color(0.20185566f * 4.409091f, 0.45f * 1.2f, 0.044696968f * 1.1186441f, 0.8933333f * 0.7276119f * (0.315f * 0.4888889f + this.fade.getFadeAmount())).getRGB()); + CheatBreaker.getInstance().playBold18px.drawCenteredString(2345345 + "", this.xPosition + this.width - (float)15, this.yPosition + (float)6, -1); + } else if (this.fade.isTimeNotAtZero() && this.fade.isOver()) { + this.fade.reset(); + } + } + Gui.drawRect(this.xPosition, this.yPosition - 0.09090909f * 5.5f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 9.9f * 0.050505053f, -1357572843); + Gui.drawRect(this.xPosition + (float)4, this.yPosition + (float)3, this.xPosition + (float)20, this.yPosition + (float)19, this.friend.isOnline() ? Friend.getStatusColor(this.friend.getOnlineStatus()) : -13158601); + + // Checks if the user has a red chat format in their name. If they do, it draws a CheatBreaker logo right next to their name. + if (this.friend.getName().startsWith(EnumChatFormatting.RED.toString())) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(cheatBreakerIcon, 7.7777777f * 0.8357143f, this.xPosition + (float)24, this.yPosition + (float)4); + CheatBreaker.getInstance().playRegular16px.drawString(this.friend.getName(), this.xPosition + (float)40, this.yPosition + 2.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(this.friend.getStatusString(), this.xPosition + (float)40, this.yPosition + (float)11, -5460820); + } else { + CheatBreaker.getInstance().playRegular16px.drawString(this.friend.getName(), this.xPosition + (float)24, this.yPosition + 2.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(this.friend.getStatusString(), this.xPosition + (float)24, this.yPosition + (float)11, -5460820); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation headIcon = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(this.friend.getName()), this.friend.getPlayerId()); + RenderUtil.renderIcon(headIcon, 7.0F, this.xPosition + (float)5, this.yPosition + (float)4); + boolean bl2 = bl && this.isMouseInside(f, f2) && f > this.xPosition + this.width - (float)20; + float f3 = this.removeFade.inOutFade(bl2); + float f4 = this.xPosition + this.width - 53.8125f * 0.3809524f * f3; + if (bl) { + Gui.drawRect(f4, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -52429); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.4470588f * 0.6219512f); + RenderUtil.renderIcon(removeIcon, f4 + (float) 4, this.yPosition + (float) 5, (float) 12, 12); + } + GL11.glPopMatrix(); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + boolean bl2; + if (!bl) { + return false; + } + boolean bl3 = bl2 = this.isMouseInside(f, f2) && f > this.xPosition + this.width - (float)20 && bl; + if (bl2 && this.removeFade.isOver()) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketClientFriendRemove(this.friend.getPlayerId())); + OverlayGui.getInstance().getFriendsListElement().getElements().add(this); + CheatBreaker.getInstance().getFriendsManager().getFriends().remove(this.friend.getPlayerId()); + return true; + } + if (!bl2 && this.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().setMessages(this.friend); + CheatBreaker.getInstance().getFriendsManager().readMessages(this.friend.getPlayerId()); + return true; + } + return super.handleElementMouseClicked(f, f2, n, bl); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestElement.java new file mode 100644 index 0000000..c4008a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestElement.java @@ -0,0 +1,82 @@ +package com.cheatbreaker.client.ui.overlay.friend; + + +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.websocket.shared.WSPacketFriendAcceptOrDeny; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.FriendRequest; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class FriendRequestElement extends AbstractElement { + private final FriendRequest friendRequest; + public static byte[] cbProcessBytes = new byte[]{107, -20, -16, 107, 16, 12, 30, 82, -34, -44, -106, 14, 91, -126, 45, -85, -63, 42, 106, -17, 19, 94, -92, -48, 91, 77, 116, -15, -116, 20, 36, -123}; + + public FriendRequestElement(FriendRequest friendRequest) { + this.friendRequest = friendRequest; + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + if (bl && this.isMouseInside(f, f2)) { + Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -13750738); + } + GL11.glPushMatrix(); + Gui.drawRect(this.xPosition, this.yPosition - 1.2982457f * 0.3851351f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 0.5125f * 0.9756098f, -1357572843); + Gui.drawRect(this.xPosition + (float)4, this.yPosition + (float)3, this.xPosition + (float)20, this.yPosition + (float)19, -16747106); + CheatBreaker.getInstance().playRegular16px.drawString(this.friendRequest.getUsername(), this.xPosition + (float)24, this.yPosition + 2.0f, -1); + if (this.friendRequest.isFriend()) { + boolean var4_4 = f > this.xPosition + (float)24 && f < this.xPosition + (float)84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float)10 && bl; + CheatBreaker.getInstance().playRegular14px.drawString("CANCEL", this.xPosition + (float)24, this.yPosition + (float)11, var4_4 ? -52429 : 0x7FFF3333); + } else { + boolean var4_4 = f > this.xPosition + (float)24 && f < this.xPosition + (float)52 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float)10 && bl; + boolean bl2 = f > this.xPosition + (float)52 && f < this.xPosition + (float)84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float)10 && bl; + CheatBreaker.getInstance().playRegular14px.drawString("ACCEPT", this.xPosition + (float)24, this.yPosition + (float)11, var4_4 ? -13369549 : 0x7F33FF33); + CheatBreaker.getInstance().playRegular14px.drawString("DENY", this.xPosition + (float)56, this.yPosition + (float)11, bl2 ? -52429 : 0x7FFF3333); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(this.friendRequest.getUsername()), this.friendRequest.getPlayerId()); + RenderUtil.renderIcon(resourceLocation, 7.0F, this.xPosition + (float)5, this.yPosition + (float)4); + GL11.glPopMatrix(); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + if (this.friendRequest.isFriend()) { + boolean bl2; + boolean bl3 = bl2 = f > this.xPosition + (float)24 && f < this.xPosition + (float)84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float)10 && bl; + if (bl2) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketFriendAcceptOrDeny(false, this.friendRequest.getPlayerId())); + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(this); + } + } else { + boolean bl4; + boolean bl5 = f > this.xPosition + (float)24 && f < this.xPosition + (float)52 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float)10; + boolean bl6 = bl4 = f > this.xPosition + (float)52 && f < this.xPosition + (float)84 && f2 < this.yPosition + this.height && f2 > this.yPosition + (float)10; + if (bl5) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketFriendAcceptOrDeny(true, this.friendRequest.getPlayerId())); + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(this); + } else if (bl4) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketFriendAcceptOrDeny(false, this.friendRequest.getPlayerId())); + OverlayGui.getInstance().getFriendRequestsElement().getElements().add(this); + } + } + return super.handleElementMouseClicked(f, f2, n, bl); + } + + public FriendRequest getFriendRequest() { + return this.friendRequest; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestListElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestListElement.java new file mode 100644 index 0000000..a44d2e3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendRequestListElement.java @@ -0,0 +1,215 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import com.cheatbreaker.client.*; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientRequestsStatus; +import com.cheatbreaker.client.network.websocket.shared.WSPacketFriendRequest; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.ElementListElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.overlay.CBAlert; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.List; + + +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class FriendRequestListElement extends ElementListElement { + private final InputFieldElement filterTextField; + private final InputFieldElement usernameTextField; + private final FlatButtonElement addButton; + private final FlatButtonElement toggleIncomingRequestsButton; + private final ScrollableElement scrollbar; + private final List requestElements = new ArrayList<>(); + + public FriendRequestListElement(List list) { + super(list); + this.filterTextField = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Filter", 0x2FFFFFFF, 0x6FFFFFFF); + this.usernameTextField = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Username", 0x2FFFFFFF, 0x6FFFFFFF); + this.addButton = new FlatButtonElement("ADD"); + this.toggleIncomingRequestsButton = new FlatButtonElement(""); + this.scrollbar = new ScrollableElement(this); + } + + public void setElementSize() { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + this.scrollbar.setElementSize(f + width - (float)4, y, (float)4, height); + int n = 22; + int n2 = 0; + for (FriendRequestElement friendRequestElement : this.elements) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + friendRequestElement.setElementSize(f, y + (float)14 + (float)(n2 * 22), width, 22); + ++n2; + } + float f5 = 14 + this.elements.size() * 22 + 30; + if (f5 < height) { + f5 = height; + } + this.filterTextField.setElementSize(0.0f, y, width, 13); + this.usernameTextField.setElementSize(0.0f, y + f5 - (float)13, width - (float)35, 13); + this.addButton.setElementSize(width - (float)35, y + f5 - (float)13, (float)35, 13); + this.toggleIncomingRequestsButton.setElementSize(0.0f, y + f5 - (float)26, width, 13); + this.scrollbar.setScrollAmount(f5); + } + + private boolean handleElementMouseClicked(FriendRequestElement friendRequestElement) { + return this.filterTextField.getText().equals("") || EnumChatFormatting.getTextWithoutFormattingCodes(friendRequestElement.getFriendRequest().getUsername()).toLowerCase().startsWith(this.filterTextField.getText().toLowerCase()); + } + + /* + * Iterators could be improved + */ + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + if (!this.requestElements.isEmpty()) { + this.elements.removeAll(this.requestElements); + OverlayGui.getInstance().getFriendRequestsElement().setElementSize(); + this.requestElements.clear(); + } + if (!CheatBreaker.getInstance().getWSNetHandler().isOpen()) { + CheatBreaker.getInstance().playBold18px.drawCenteredString("Connection lost", this.xPosition + this.width / 2.0f, this.yPosition + (float)10, -1); + CheatBreaker.getInstance().playRegular14px.drawCenteredString("Please try again later.", this.xPosition + this.width / 2.0f, this.yPosition + (float)22, -1); + } else { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui overlayGui = OverlayGui.getInstance(); + this.scrollbar.drawScrollable(f, f2, bl); + RenderUtil.startScissorBox((int)this.xPosition, (int)this.yPosition, (int)(this.xPosition + this.width), (int)(this.yPosition + this.height), + (float)((int)((float)overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int)overlayGui.getScaledHeight()); + GL11.glDisable(3089); + GL11.glPopMatrix(); + ImmutableList friendList = ImmutableList.copyOf(this.elements); + for (FriendRequestElement friendRequestElement : friendList) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + friendRequestElement.drawElementHover(f, f2 - this.scrollbar.getHeight(), bl); + } + if (friendList.isEmpty()) { + CheatBreaker.getInstance().playBold18px.drawCenteredString("No friend requests", this.xPosition + this.width / 2.0f, this.yPosition + (float)30, -1); + } + this.filterTextField.drawElementHover(f, f2 - this.scrollbar.getHeight(), true); + this.usernameTextField.drawElementHover(f, f2, true); + this.addButton.drawElementHover(f, f2, true); + this.toggleIncomingRequestsButton.drawButton((CheatBreaker.getInstance().isAcceptingFriendRequests() ? "Disable" : "Enable") + " incoming friend requests", f, f2, true); + + this.scrollbar.handleElementDraw(f, f2, bl); + } + } + + @Override + public void handleElementMouse() { + this.scrollbar.handleElementMouse(); + } + + @Override + public void handleElementUpdate() { + this.filterTextField.handleElementUpdate(); + this.usernameTextField.handleElementUpdate(); + this.toggleIncomingRequestsButton.handleElementUpdate(); + this.addButton.handleElementUpdate(); + this.scrollbar.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.filterTextField.handleElementClose(); + this.scrollbar.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + super.keyTyped(c, n); + this.filterTextField.keyTyped(c, n); + this.usernameTextField.keyTyped(c, n); + this.toggleIncomingRequestsButton.keyTyped(c, n); + this.addButton.keyTyped(c, n); + this.scrollbar.keyTyped(c, n); + if (this.usernameTextField.isFocused() && n == 28) { + this.sendRequest(); + } + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.filterTextField.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + this.usernameTextField.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + if (this.filterTextField.isFocused() && n == 1 && this.filterTextField.getText().equals("")) { + this.setElementSize(); + } + if (!bl) { + return false; + } + this.addButton.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + this.toggleIncomingRequestsButton.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + this.scrollbar.handleElementMouseClicked(f, f2, n, bl); + if (this.addButton.isMouseInside(f, f2 - this.scrollbar.getPosition())) { + this.sendRequest(); + } + if (this.toggleIncomingRequestsButton.isMouseInside(f, f2 - this.scrollbar.getPosition())) { + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketClientRequestsStatus(!CheatBreaker.getInstance().isAcceptingFriendRequests())); + CheatBreaker.getInstance().setAcceptingFriendRequests(!CheatBreaker.getInstance().isAcceptingFriendRequests()); + return false; + } + boolean bl2 = false; + for (FriendRequestElement friendRequestElement : this.elements) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + if (bl2) break; + bl2 = friendRequestElement.handleElementMouseClicked(f, f2 - this.scrollbar.getPosition(), n, bl); + } + return bl2; + } + + private void sendRequest() { + if (!this.usernameTextField.getText().isEmpty()) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + String string = this.usernameTextField.getText(); + if (string.matches("([a-zA-Z0-9_]+)") && string.length() <= 16) { + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketFriendRequest("", this.usernameTextField.getText())); + this.usernameTextField.setText(""); + } else { + CBAlert.displayMessage(EnumChatFormatting.RED + "Error!", "Incorrect username."); + } + } + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + this.filterTextField.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + this.usernameTextField.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + this.addButton.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + this.scrollbar.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + boolean bl2 = false; + for (FriendRequestElement friendRequestElement : this.elements) { + if (!this.handleElementMouseClicked(friendRequestElement)) continue; + if (bl2) break; + bl2 = friendRequestElement.onMouseMoved(f, f2 - this.scrollbar.getHeight(), n, bl); + } + return bl2; + } + + public FlatButtonElement getAddButton() { + return this.addButton; + } + + public FlatButtonElement getToggleRequestsButton() { + return this.toggleIncomingRequestsButton; + } + + public List getElements() { + return this.requestElements; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendsListElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendsListElement.java new file mode 100644 index 0000000..8f21d4a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/FriendsListElement.java @@ -0,0 +1,190 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.ElementListElement; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + + +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +public class FriendsListElement extends ElementListElement { + private final InputFieldElement filterElement; + private final ScrollableElement scrollableElement; + private final List friendElements = new ArrayList<>(); + + public FriendsListElement(List list) { + super(list); + this.filterElement = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Filter", 0x2FFFFFFF, 0x6FFFFFFF); + this.scrollableElement = new ScrollableElement(this); + } + + public void updateSize() { + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + @Override + public void setElementSize(float var1, float var2, float var3, float var4) { + super.setElementSize(var1, var2, var3, var4); + this.filterElement.setElementSize(0.0F, var2, var3, (float)13); + this.scrollableElement.setElementSize(var1 + var3 - (float)4, var2, (float)4, var4); + this.elements.sort((var0, var1x) -> { + String var22 = EnumChatFormatting.getTextWithoutFormattingCodes(var0.getFriend().getName()); + String var32 = EnumChatFormatting.getTextWithoutFormattingCodes(var1x.getFriend().getName()); + if (var0.getFriend().isOnline() == var1x.getFriend().isOnline()) { + return var22.compareTo(var32); + } else { + return var0.getFriend().isOnline() ? -1 : 1; + } + }); + boolean var5 = true; + int var6 = 0; + + for (FriendElement var8 : this.elements) { + if (this.isFilterMatch(var8)) { + var8.setElementSize(var1, var2 + (float) 14 + (float) (var6 * 22), var3, (float) 22); + ++var6; + } + } + + this.scrollableElement.setScrollAmount((float)(14 + this.elements.size() * 22)); + } + + private boolean isFilterMatch(FriendElement var1) { + return this.filterElement.getText().equals("") || EnumChatFormatting.getTextWithoutFormattingCodes(var1.getFriend().getName()).toLowerCase().startsWith(this.filterElement.getText().toLowerCase()); + } + + public void handleElementDraw(float var1, float var2, boolean var3) { + if (!this.friendElements.isEmpty()) { + this.elements.removeAll(this.friendElements); + OverlayGui.getInstance().getFriendsListElement().updateSize(); + } + + float var10002; + float var10003; + if (!CheatBreaker.getInstance().getWSNetHandler().isOpen()) { + var10002 = this.xPosition + this.width / 2.0F; + var10003 = this.yPosition + (float)10; + CheatBreaker.getInstance().playBold18px.drawCenteredString("Connection lost", var10002, var10003, -1); + var10002 = this.xPosition + this.width / 2.0F; + var10003 = this.yPosition + (float)22; + CheatBreaker.getInstance().playRegular14px.drawCenteredString("Please try again later.", var10002, var10003, -1); + } else { + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui var4 = OverlayGui.getInstance(); + this.scrollableElement.drawScrollable(var1, var2, var3); + RenderUtil.startScissorBox((int)this.xPosition, (int)this.yPosition, (int)(this.xPosition + this.width), (int)(this.yPosition + this.height), (float)((int)((float)var4.getScaledResolution().getScaleFactor() * var4.getScaleFactor())), (int)var4.getScaledHeight()); + ImmutableList var5 = ImmutableList.copyOf((Collection)this.elements); + Iterator var6 = var5.iterator(); + + while(true) { + FriendElement var7; + do { + if (!var6.hasNext()) { + if (var5.isEmpty()) { + var10002 = this.xPosition + this.width / 2.0F; + var10003 = this.yPosition + (float)30; + CheatBreaker.getInstance().playBold18px.drawCenteredString("No friends", var10002, var10003, -1); + } + + this.filterElement.drawElementHover(var1, var2 - this.scrollableElement.getPosition(), var3); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollableElement.handleElementDraw(var1, var2, var3); + return; + } + + var7 = (FriendElement)var6.next(); + } while(!this.isFilterMatch(var7)); + + var7.drawElementHover(var1, var2 - this.scrollableElement.getPosition(), var3 && !this.scrollableElement.isMouseInside(var1, var2)); + } + } + } + + public void handleElementMouse() { + this.scrollableElement.handleElementMouse(); + } + + public void handleElementUpdate() { + this.filterElement.handleElementUpdate(); + this.scrollableElement.handleElementUpdate(); + } + + public void handleElementClose() { + this.filterElement.handleElementClose(); + this.scrollableElement.handleElementClose(); + } + + public void keyTyped(char c, int n) { + super.keyTyped(c, n); + this.filterElement.keyTyped(c, n); + this.scrollableElement.keyTyped(c, n); + this.setElementSize(this.xPosition, this.yPosition, this.width, this.height); + } + + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.filterElement.handleElementMouseClicked(f, f2 - this.scrollableElement.getPosition(), n, bl); + if (this.filterElement.isFocused() && n == 1 && this.filterElement.getText().equals("")) { + this.updateSize(); + } + + if (!bl) { + return false; + } else { + this.scrollableElement.handleElementMouseClicked(f, f2, n, bl); + boolean var5 = false; + Iterator var6 = this.elements.iterator(); + + while(var6.hasNext()) { + FriendElement var7 = (FriendElement)var6.next(); + if (this.isFilterMatch(var7)) { + if (var5) { + break; + } + + var5 = var7.handleElementMouseClicked(f, f2 - this.scrollableElement.getPosition(), n, bl && !this.scrollableElement.isMouseInside(f, f2)); + } + } + + return var5; + } + } + + public boolean onMouseMoved(float var1, float var2, int var3, boolean var4) { + this.filterElement.onMouseMoved(var1, var2 - this.scrollableElement.getPosition(), var3, var4); + this.scrollableElement.onMouseMoved(var1, var2, var3, var4); + if (!var4) { + return false; + } else { + boolean var5 = false; + Iterator var6 = this.elements.iterator(); + + while(var6.hasNext()) { + FriendElement var7 = (FriendElement)var6.next(); + if (this.isFilterMatch(var7)) { + if (var5) { + break; + } + + var5 = var7.onMouseMoved(var1, var2, var3, var4); + } + } + + return var5; + } + } + + public List getElements() { + return this.friendElements; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/MessagesElement.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/MessagesElement.java new file mode 100644 index 0000000..abfbbac --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/overlay/friend/MessagesElement.java @@ -0,0 +1,259 @@ +package com.cheatbreaker.client.ui.overlay.friend; + +import java.util.List; +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.element.type.InputFieldElement; +import com.cheatbreaker.client.network.websocket.shared.WSPacketFriendMessage; +import com.cheatbreaker.client.ui.element.AliasesElement; +import com.cheatbreaker.client.ui.element.DraggableElement; +import com.cheatbreaker.client.ui.element.type.FlatButtonElement; +import com.cheatbreaker.client.ui.element.type.ScrollableElement; +import com.cheatbreaker.client.ui.mainmenu.AbstractElement; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.friend.Friend; +import lombok.SneakyThrows; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class MessagesElement extends DraggableElement { + private Friend friend; + private final InputFieldElement messageElement; + private final FlatButtonElement sendButton; + private final ScrollableElement scrollBar; + private final ScrollableElement scrollDraw; + private final FlatButtonElement aliasesButton; + private final FlatButtonElement closeButton; + private final int widthElements = 22; + + public MessagesElement(Friend friend) { + this.friend = friend; + this.messageElement = new InputFieldElement(CheatBreaker.getInstance().playRegular14px, "Message", 0x2FFFFFFF, 0x6FFFFFFF); + this.messageElement.setMaxStringLength(256); + this.sendButton = new FlatButtonElement("SEND"); + this.scrollBar = new ScrollableElement(this); + this.scrollDraw = new ScrollableElement(this); + this.aliasesButton = new FlatButtonElement("Aliases"); + this.closeButton = new FlatButtonElement("X"); + } + + @Override + public void setElementSize(float f, float y, float width, float height) { + super.setElementSize(f, y, width, height); + this.messageElement.setElementSize(f + (float)26, y + height - (float)15, width - (float)62, 13); + this.sendButton.setElementSize(f + width - (float)37, y + height - (float)15, (float)35, 13); + this.scrollBar.setElementSize(f + width - (float)6, y + (float)22, (float)4, height - (float)39); + this.scrollDraw.setElementSize(f + 2.0f, y + 2.0f, 0.0f, height - (float)4); + this.aliasesButton.setElementSize(f + width - (float)54, y + 2.0f, (float)40, 16); + this.closeButton.setElementSize(f + width - (float)12, y + 2.0f, (float)10, 16); + } + + @SneakyThrows + public static String handleCBProcessBytes(byte[] arrby) { + SecretKeySpec secretKeySpec = new SecretKeySpec(CheatBreaker.processlistbytes, "AES"); + Cipher cipher = Cipher.getInstance("AES"); + cipher.init(2, secretKeySpec); + return new String(cipher.doFinal(arrby)); + } + + @Override + public void handleElementDraw(float f, float f2, boolean bl) { + String[] arrstring; + this.onDrag(f, f2); + Gui.drawBoxWithOutLine(this.xPosition, this.yPosition, this.xPosition + (float)23, this.yPosition + this.height, 0.074324325f * 6.7272725f, -16777216, -14869219); + Gui.drawBoxWithOutLine(this.xPosition + (float)23, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 0.7132353f * 0.7010309f, -16777216, -15395563); + GL11.glPushMatrix(); + Gui.drawRect(this.xPosition + 25.0F, this.yPosition - 1.9285715f * 0.25925925f, this.xPosition + this.width, this.yPosition, -1357572843); + Gui.drawRect(this.xPosition + 25.0F, this.yPosition + this.height, this.xPosition + this.width, this.yPosition + this.height + 0.25f * 2.0f, -1357572843); + Gui.drawRect(this.xPosition + (float)27, this.yPosition + (float)3, this.xPosition + (float)43, this.yPosition + (float)19, this.friend.isOnline() ? Friend.getStatusColor(this.friend.getOnlineStatus()) : -13158601); + CheatBreaker.getInstance().playRegular16px.drawString(this.friend.getName(), this.xPosition + (float)52, this.yPosition + 2.0f, -1); + CheatBreaker.getInstance().playRegular12px.drawString(this.friend.getStatusString(), this.xPosition + (float)52, this.yPosition + (float)11, -5460820); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(this.friend.getName()), this.friend.getPlayerId()); + RenderUtil.renderIcon(resourceLocation, 7.0F, this.xPosition + (float)28, this.yPosition + (float)4); + Gui.drawRect(this.xPosition + (float)27, this.yPosition + (float)22, this.xPosition + this.width - 2.0f, this.yPosition + this.height - (float)17, -1356783327); + this.scrollDraw.drawScrollable(f, f2, bl); + GL11.glPushMatrix(); + GL11.glEnable(3089); + OverlayGui overlayGui = OverlayGui.getInstance(); + RenderUtil.startScissorBox(0, (int)(this.yPosition + 2.0f), (int)overlayGui.getScaledWidth(), (int)(this.yPosition + this.height - 2.0f), (float)((int)((float)overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int)overlayGui.getScaledHeight()); + int n = 18; + int n2 = 0; + for (Friend friend : this.cb.getFriendsManager().getFriends().values()) { + if (friend != this.friend && !this.cb.getFriendsManager().getReadMessages().containsKey(friend.getPlayerId()) && !friend.isOnline()) continue; + float f3 = this.yPosition + (float)3 + (float)n2; + boolean bl2 = f > this.xPosition && f < this.xPosition + (float)25 && f2 > f3 - this.scrollDraw.getPosition() && f2 < f3 + (float)16 - this.scrollDraw.getPosition() && f2 > this.yPosition && f2 < this.yPosition + this.height; + Gui.drawRect(this.xPosition + (float)3, f3, this.xPosition + (float)19, f3 + (float)16, friend.isOnline() ? Friend.getStatusColor(friend.getOnlineStatus()) : -13158601); + GL11.glColor4f(1.0f, 1.0f, 1.0f, bl2 ? 1.0f : 0.6016854f * 1.4126984f); + ResourceLocation resourceLoc = CheatBreaker.getInstance().getHeadIcon(EnumChatFormatting.getTextWithoutFormattingCodes(friend.getName()), friend.getPlayerId()); + RenderUtil.renderIcon(resourceLoc, 7.0F, this.xPosition + (float)4, this.yPosition + (float)4 + (float)n2); + if (bl2) { + float f4 = this.cb.robotoRegular13px.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(friend.getName())); + RenderUtil.drawRoundedRect(this.xPosition - (float)10 - f4, f3 + 2.0f, this.xPosition - 2.0f, f3 + (float)14, 6, -1895825408); + this.cb.robotoRegular13px.drawString(friend.getName(), this.xPosition - (float)6 - f4, f3 + (float)4, -1); + if (Mouse.isButtonDown(0) && this.friend != friend) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.friend = friend; + } + } + n2 += 18; + } + this.scrollDraw.setScrollAmount(n2); + GL11.glDisable(3089); + GL11.glPopMatrix(); + this.scrollDraw.handleElementDraw(f, f2, bl); + this.scrollBar.onScroll(f, f2, bl); + try { + if (CheatBreaker.getInstance().getFriendsManager().getReadMessages().containsKey(this.friend.getPlayerId())) { + GL11.glPushMatrix(); + GL11.glEnable(3089); + RenderUtil.startScissorBox((int)(this.xPosition + 2.0f), (int)(this.yPosition + (float)22), (int)(this.xPosition + this.width - 2.0f), (int)(this.yPosition + this.height - (float)17), (float)((int)((float)overlayGui.getScaledResolution().getScaleFactor() * overlayGui.getScaleFactor())), (int)overlayGui.getScaledHeight()); + List list = CheatBreaker.getInstance().getFriendsManager().getReadMessages().get(this.friend.getPlayerId()); + int n3 = 0; + for (int i = list.size() - 1; i >= 0; --i) { + String string = list.get(i); + arrstring = CheatBreaker.getInstance().playRegular14px.formatText(string, this.width - (float)25).split("\n"); + n3 += arrstring.length * 10; + int n4 = 0; + for (String string2 : arrstring) { + CheatBreaker.getInstance().playRegular14px.drawString(string2, this.xPosition + (float)31, this.yPosition + this.height - (float)19 - (float)n3 + (float)(n4 * 10), -1); + ++n4; + } + } + this.scrollBar.setScrollAmount(n3 + 4); + GL11.glDisable(3089); + GL11.glPopMatrix(); + } + } catch (Exception exception) { + exception.printStackTrace(); + } + this.scrollBar.drawElementHoverNotOverride(f, f2, bl); + GL11.glPopMatrix(); + this.messageElement.drawElementHover(f, f2, bl); + this.sendButton.drawElementHover(f, f2, bl); + this.aliasesButton.drawElementHover(f, f2, bl); + this.closeButton.drawElementHover(f, f2, bl); + } + + @Override + public void handleElementUpdate() { + this.messageElement.handleElementUpdate(); + this.sendButton.handleElementUpdate(); + this.scrollBar.handleElementUpdate(); + this.aliasesButton.handleElementUpdate(); + this.closeButton.handleElementUpdate(); + } + + @Override + public void handleElementClose() { + this.messageElement.handleElementClose(); + this.sendButton.handleElementClose(); + this.scrollBar.handleElementClose(); + this.aliasesButton.handleElementClose(); + this.closeButton.handleElementClose(); + } + + @Override + public void keyTyped(char c, int n) { + if (this.messageElement.isFocused() && !this.messageElement.getText().equals("") && n == 28) { + this.sendMessage(); + } + this.messageElement.keyTyped(c, n); + this.sendButton.keyTyped(c, n); + this.scrollBar.keyTyped(c, n); + this.aliasesButton.keyTyped(c, n); + this.closeButton.keyTyped(c, n); + } + + @Override + public boolean onMouseClick(float f, float f2, int n) { + if (!this.messageElement.isMouseInside(f, f2) && this.messageElement.isFocused()) { + this.messageElement.setFocused(false); + } + return false; + } + + @Override + public boolean handleElementMouseClicked(float f, float f2, int n, boolean bl) { + this.messageElement.handleElementMouseClicked(f, f2, n, bl); + if (!bl) { + return false; + } + if (!this.messageElement.getText().equals("") && this.sendButton.isMouseInside(f, f2)) { + this.sendMessage(); + } + this.sendButton.handleElementMouseClicked(f, f2, n, bl); + this.scrollBar.handleElementMouseClicked(f, f2, n, bl); + this.aliasesButton.handleElementMouseClicked(f, f2, n, bl); + if (!this.aliasesButton.isMouseInside(f, f2) && this.isMouseInside(f, f2) && f2 < this.yPosition + (float)22) { + this.setPosition(f, f2); + } + if (this.closeButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + OverlayGui.getInstance().removeElement(this); + return true; + } + if (this.aliasesButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + AbstractElement[] arrabstractElement = new AbstractElement[1]; + AliasesElement aliasesElement = new AliasesElement(this.friend); + arrabstractElement[0] = aliasesElement; + OverlayGui.getInstance().addElement(arrabstractElement); + aliasesElement.setElementSize((float)60, (float)30, (float)140, 30); + return true; + } + return false; + } + + @Override + public void handleElementMouse() { + this.scrollBar.handleElementMouse(); + this.scrollDraw.handleElementMouse(); + } + + private void sendMessage() { + String string = this.messageElement.getText(); + + CheatBreaker.getInstance().getFriendsManager().addOutgoingMessage(friend.getPlayerId(), string); + CheatBreaker.getInstance().getWSNetHandler().sendPacket(new WSPacketFriendMessage(friend.getPlayerId(), string)); + + + + // CheatBreaker.getInstance().getAudioManager().playSound("short_whoosh1"); + this.messageElement.setText(""); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + } + + @Override + public boolean onMouseMoved(float f, float f2, int n, boolean bl) { + if (!bl) { + return false; + } + this.messageElement.onMouseMoved(f, f2, n, bl); + this.sendButton.onMouseMoved(f, f2, n, bl); + this.scrollBar.onMouseMoved(f, f2, n, bl); + this.aliasesButton.onMouseMoved(f, f2, n, bl); + this.closeButton.onMouseMoved(f, f2, n, bl); + return false; + } + + public void handleElementUpdate(Friend friend) { + this.friend = friend; + } + + public Friend getFriend() { + return this.friend; + } + + public InputFieldElement getMssageElement() { + return this.messageElement; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/theme/CBTheme.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/theme/CBTheme.java new file mode 100644 index 0000000..ad4035f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/theme/CBTheme.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.ui.theme; + +public class CBTheme { + public static int lightBackgroundColor = -723724; + public static int lightBackgroundColor2 = 0x9FF4F4F4; + public static int lightBackgroundColor3 = 0xFFF2F7F7; + public static int lightBackgroundColor4 = 0xFFF5F5F5; + public static int lightEnabledBackgroundColor = 0xFF2BA836; + public static int lightDisabledBackgroundColor = 0xFFA82B2B; + public static int lightInactiveBackgroundColor = 0xAFB0B0B0; + public static int lightTextColor = 0x6F000000; + public static int lightTextColor2 = 0x8F000000; + public static int lightTextColor3 = 0xBF000000; + public static int lightTextColor4 = 0xAF000000; + public static int lightTextColor5 = 0xCF000000; + public static int lightTextColor6 = 0x7F000000; + public static int lightDullTextColor = 0x2f2f2f2f; + public static int lightDullTextColor2 = 0xCf2f2f2f; + public static int lightDullTextColor3 = 0x1f2f2f2f; + public static int lightDullTextColor4 = 0x6f2f2f2f; + + public static int darkBackgroundColor = 0xFF141414; + public static int darkBackgroundColor2 = 0x94141414; + public static int darkBackgroundColor3 = 0xFF121717; + public static int darkBackgroundColor4 = 0xFF151515; + public static int darkEnabledBackgroundColor = 0xFF248c2d; + public static int darkDisabledBackgroundColor = 0xFF8c2424; + public static int darkInactiveBackgroundColor = 0xAF4d4d4d; + public static int darkTextColor = 0x8FFFFFFF; + public static int darkTextColor2 = 0xAFFFFFFF; + public static int darkTextColor3 = 0xDFFFFFFF; + public static int darkTextColor4 = 0xCFFFFFFF; + public static int darkTextColor5 = 0xEFFFFFFF; + public static int darkTextColor6 = 0x9FFFFFFF; + public static int darkDullTextColor = 0x4fdfdfdf; + public static int darkDullTextColor2 = 0xefdfdfdf; + public static int darkDullTextColor3 = 0x3fdfdfdf; + public static int darkDullTextColor4 = 0x8fdfdfdf; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/HudUtil.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/HudUtil.java new file mode 100644 index 0000000..0d388d5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/HudUtil.java @@ -0,0 +1,147 @@ +package com.cheatbreaker.client.ui.util; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public final class HudUtil { + private static final int[] colorCodes = new int[]{0, 170, 43520, 43690, 0xAA0000, 0xAA00AA, 0xFFAA00, 0xAAAAAA, 0x555555, 0x5555FF, 0x55FF55, 0x55FFFF, 0xFF5555, 0xFF55FF, 0xFFFF55, 0xFFFFFF, 0, 42, 10752, 10794, 0x2A0000, 0x2A002A, 0x2A2A00, 0x2A2A2A, 0x151515, 1381695, 1392405, 1392447, 4134165, 4134207, 4144917, 0x3F3F3F}; + + public static int getColorCode(char c, boolean bl) { + return colorCodes[bl ? "0123456789abcdef".indexOf(c) : "0123456789abcdef".indexOf(c) + 16]; + } + + public static void drawContinuousTexturedBox(int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, float f) { + HudUtil.drawContinuousTexturedBox(n, n2, n3, n4, n5, n6, n7, n8, n9, n9, n9, n9, f); + } + + public static void drawContinuousTexturedBox(ResourceLocation resourceLocation, int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, float f) { + HudUtil.drawContinuousTexturedBox(resourceLocation, n, n2, n3, n4, n5, n6, n7, n8, n9, n9, n9, n9, f); + } + + public static void drawContinuousTexturedBox(ResourceLocation resourceLocation, int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, float f) { + Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); + HudUtil.drawContinuousTexturedBox(n, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, f); + } + + public static void drawContinuousTexturedBox(int n, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int n11, int n12, float f) { + int n13; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(770, 771); + int n14 = n7 - n11 - n12; + int n15 = n8 - n9 - n10; + int n16 = n5 - n11 - n12; + int n17 = n6 - n9 - n10; + int n18 = n16 / n14; + int n19 = n16 % n14; + int n20 = n17 / n15; + int n21 = n17 % n15; + HudUtil.drawTexturedModalRect(n, n2, n3, n4, n11, n9, f); + HudUtil.drawTexturedModalRect(n + n11 + n16, n2, n3 + n11 + n14, n4, n12, n9, f); + HudUtil.drawTexturedModalRect(n, n2 + n9 + n17, n3, n4 + n9 + n15, n11, n10, f); + HudUtil.drawTexturedModalRect(n + n11 + n16, n2 + n9 + n17, n3 + n11 + n14, n4 + n9 + n15, n12, n10, f); + for (n13 = 0; n13 < n18 + (n19 > 0 ? 1 : 0); ++n13) { + HudUtil.drawTexturedModalRect(n + n11 + n13 * n14, n2, n3 + n11, n4, n13 == n18 ? n19 : n14, n9, f); + HudUtil.drawTexturedModalRect(n + n11 + n13 * n14, n2 + n9 + n17, n3 + n11, n4 + n9 + n15, n13 == n18 ? n19 : n14, n10, f); + for (int i = 0; i < n20 + (n21 > 0 ? 1 : 0); ++i) { + HudUtil.drawTexturedModalRect(n + n11 + n13 * n14, n2 + n9 + i * n15, n3 + n11, n4 + n9, n13 == n18 ? n19 : n14, i == n20 ? n21 : n15, f); + } + } + for (n13 = 0; n13 < n20 + (n21 > 0 ? 1 : 0); ++n13) { + HudUtil.drawTexturedModalRect(n, n2 + n9 + n13 * n15, n3, n4 + n9, n11, n13 == n20 ? n21 : n15, f); + HudUtil.drawTexturedModalRect(n + n11 + n16, n2 + n9 + n13 * n15, n3 + n11 + n14, n4 + n9, n12, n13 == n20 ? n21 : n15, f); + } + } + + public static void drawTexturedModalRect(int n, int n2, int n3, int n4, int n5, int n6, float f) { + float f2 = 1.1355932f * 0.0034398322f; + float f3 = 0.0015345983f * 2.5454545f; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(n + 0, n2 + n6, f, (float)(n3 + 0) * f2, (float)(n4 + n6) * f3); + tessellator.addVertexWithUV(n + n5, n2 + n6, f, (float)(n3 + n5) * f2, (float)(n4 + n6) * f3); + tessellator.addVertexWithUV(n + n5, n2 + 0, f, (float)(n3 + n5) * f2, (float)(n4 + 0) * f3); + tessellator.addVertexWithUV(n + 0, n2 + 0, f, (float)(n3 + 0) * f2, (float)(n4 + 0) * f3); + tessellator.draw(); + } + + public static void renderItemOverlayIntoGUI(FontRenderer fontRenderer, ItemStack itemStack, int n, int n2) { + renderItemOverlayIntoGUI(fontRenderer, itemStack, n, n2, true, true); + } + + public static void renderItemOverlayIntoGUI(FontRenderer fontRenderer, ItemStack itemStack, int n, int n2, boolean bl, boolean bl2) { + if (itemStack != null && (bl || bl2)) { + int n3; + if (itemStack.isItemDamaged() && bl) { + n3 = (int)Math.round((double)13 - (double)itemStack.getItemDamageForDisplay() * (double)13 / (double)itemStack.getMaxDamage()); + int n4 = (int)Math.round((double)255 - (double)itemStack.getItemDamageForDisplay() * (double)255 / (double)itemStack.getMaxDamage()); + GL11.glDisable(2896); + GL11.glDisable(2929); + GL11.glDisable(3553); + Tessellator tessellator = Tessellator.instance; + int n5 = 255 - n4 << 16 | n4 << 8; + int n6 = (255 - n4) / 4 << 16 | 0x3F00; + HudUtil.renderQuad(tessellator, n + 2, n2 + 13, 13, 2, 0); + HudUtil.renderQuad(tessellator, n + 2, n2 + 13, 12, 1, n6); + HudUtil.renderQuad(tessellator, n + 2, n2 + 13, n3, 1, n5); + GL11.glEnable(3553); + GL11.glEnable(2896); + GL11.glEnable(2929); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + if (bl2) { + n3 = 0; + if (itemStack.getMaxStackSize() > 1) { + n3 = HudUtil.countInInventory(Minecraft.getMinecraft().thePlayer, itemStack.getItem(), itemStack.getItemDamage()); + } else if (itemStack.getItem().equals(Items.bow)) { + n3 = HudUtil.countInInventory(Minecraft.getMinecraft().thePlayer, Items.arrow); + } + if (n3 > 1) { + String string = "" + n3; + GL11.glDisable(2896); + GL11.glDisable(2929); + fontRenderer.drawStringWithShadow(string, (float)(n + 19 - 2 - fontRenderer.getStringWidth(string)), (float)(n2 + 6 + 3), 0xFFFFFF); + GL11.glEnable(2896); + GL11.glEnable(2929); + } + } + } + } + + public static void renderQuad(Tessellator tessellator, int n, int n2, int n3, int n4, int n5) { + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(n5); + tessellator.addVertex(n + 0, n2 + 0, 0.0); + tessellator.addVertex(n + 0, n2 + n4, 0.0); + tessellator.addVertex(n + n3, n2 + n4, 0.0); + tessellator.addVertex(n + n3, n2 + 0, 0.0); + tessellator.draw(); + } + + public static int countInInventory(EntityPlayer entityPlayer, Item item) { + return HudUtil.countInInventory(entityPlayer, item, -1); + } + + public static int countInInventory(EntityPlayer entityPlayer, Item item, int n) { + int n2 = 0; + for (int i = 0; i < entityPlayer.inventory.mainInventory.length; ++i) { + if (entityPlayer.inventory.mainInventory[i] == null || !item.equals(entityPlayer.inventory.mainInventory[i].getItem()) || n != -1 && entityPlayer.inventory.mainInventory[i].getItemDamage() != n) continue; + n2 += entityPlayer.inventory.mainInventory[i].stackSize; + } + return n2; + } + + public static String getColorCode(String string) { + return string.replaceAll("(?i)§[0-9a-fklmnor]", ""); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/RenderUtil.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/RenderUtil.java new file mode 100644 index 0000000..b9db96f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/RenderUtil.java @@ -0,0 +1,258 @@ +package com.cheatbreaker.client.ui.util; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class RenderUtil {//TODO: Finish mapping this class + protected static float zero = 0.0f; + private static final double thirty = 30.0; + + public static void drawTexturedModalRect(float f, float f2, float f3, float f4, int n, int n2) { + float f5 = 0.00390625f; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(f, f2 + (float)n2, zero, f3 * f5, (f4 + (float)n2) * f5); + tessellator.addVertexWithUV(f + (float)n, f2 + (float)n2, zero, (f3 + (float)n) * f5, (f4 + (float)n2) * f5); + tessellator.addVertexWithUV(f + (float)n, f2, zero, (f3 + (float)n) * f5, f4 * f5); + tessellator.addVertexWithUV(f, f2, zero, f3 * f5, f4 * f5); + tessellator.draw(); + } + + public static void startMCScaledScissorBox(int n, int n2, int n3, int n4, ScaledResolution scaledResolution) { + int scaleFactor = scaledResolution.getScaleFactor(); + int n6 = n4 - n2; + int n7 = n3 - n; + int n8 = scaledResolution.getScaledHeight() - n4; + GL11.glScissor(n * scaleFactor, n8 * scaleFactor, n7 * scaleFactor, n6 * scaleFactor); + } + + public static void renderIcon(ResourceLocation resourceLocation, float size, float x, float y) { + float f4 = size * 2.0f; + float f5 = size * 2.0f; + float f6 = 0.0f; + float f7 = 0.0f; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation); + GL11.glBegin(7); + GL11.glTexCoord2d(f6 / size, f7 / size); + GL11.glVertex2d(x, y); + GL11.glTexCoord2d(f6 / size, (f7 + size) / size); + GL11.glVertex2d(x, y + f5); + GL11.glTexCoord2d((f6 + size) / size, (f7 + size) / size); + GL11.glVertex2d(x + f4, y + f5); + GL11.glTexCoord2d((f6 + size) / size, f7 / size); + GL11.glVertex2d(x + f4, y); + GL11.glEnd(); + GL11.glDisable(3042); + } + + public static void renderEIcon(ResourceLocation resourceLocation, float f, float f2, float f3) { + float f4 = f * 2.0f; + float f5 = f * 2.0f; + float f6 = 0.0f; + float f7 = 0.0f; + GL11.glEnable(3042); + Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation); + GL11.glBegin(7); + GL11.glTexCoord2d(f6 / f, f7 / f); + GL11.glVertex2d(f2, f3); + GL11.glTexCoord2d(f6 / f, (f7 + f) / f); + GL11.glVertex2d(f2, f3 + f5); + GL11.glTexCoord2d((f6 + f) / f, (f7 + f) / f); + GL11.glVertex2d(f2 + f4, f3 + f5); + GL11.glTexCoord2d((f6 + f) / f, f7 / f); + GL11.glVertex2d(f2 + f4, f3); + GL11.glEnd(); + GL11.glDisable(3042); + } + + public static void renderIcon(ResourceLocation resourceLocation, float f, float f2, float f3, float f4) { + float f5 = f3 / 2.0f; + float f6 = 0.0f; + float f7 = 0.0f; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(resourceLocation); + GL11.glBegin(7); + GL11.glTexCoord2d(f6 / f5, f7 / f5); + GL11.glVertex2d(f, f2); + GL11.glTexCoord2d(f6 / f5, (f7 + f5) / f5); + GL11.glVertex2d(f, f2 + f4); + GL11.glTexCoord2d((f6 + f5) / f5, (f7 + f5) / f5); + GL11.glVertex2d(f + f3, f2 + f4); + GL11.glTexCoord2d((f6 + f5) / f5, f7 / f5); + GL11.glVertex2d(f + f3, f2); + GL11.glEnd(); + GL11.glDisable(3042); + } + + public static void startScissorBox(int n, int n2, int n3, int n4, float f, int n5) { + int n6 = n4 - n2; + int n7 = n3 - n; + int n8 = n5 - n4; + GL11.glScissor((int)((float)n * f), (int)((float)n8 * f), (int)((float)n7 * f), (int)((float)n6 * f)); + } + + public static void drawRoundedRect(double d, double d2, double d3, double d4, double d5, int color) { + int n2; + float f = (float)(color >> 24 & 0xFF) / 255.0F; + float f2 = (float)(color >> 16 & 0xFF) / 255.0F; + float f3 = (float)(color >> 8 & 0xFF) / 255.0F; + float f4 = (float)(color & 0xFF) / 255.0F; + GL11.glPushAttrib(0); + GL11.glScaled(0.5D, 0.5D, 0.5D); + d *= 2.0; + d2 *= 2.0; + d3 *= 2.0; + d4 *= 2.0; + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glColor4f(f2, f3, f4, f); + GL11.glEnable(2848); + GL11.glBegin(9); + for (n2 = 0; n2 <= 90; n2 += 3) { + GL11.glVertex2d(d + d5 + Math.sin((double)n2 * Math.PI / 180.0) * (d5 * -1.0), d2 + d5 + Math.cos((double)n2 * Math.PI / 180.0) * (d5 * -1.0)); + } + for (n2 = 90; n2 <= 180; n2 += 3) { + GL11.glVertex2d(d + d5 + Math.sin((double)n2 * Math.PI / 180.0) * (d5 * -1.0), d4 - d5 + Math.cos((double)n2 * Math.PI / 180.0) * (d5 * -1.0)); + } + for (n2 = 0; n2 <= 90; n2 += 3) { + GL11.glVertex2d(d3 - d5 + Math.sin((double)n2 * Math.PI / 180.0) * d5, d4 - d5 + Math.cos((double)n2 * Math.PI / 180.0) * d5); + } + for (n2 = 90; n2 <= 180; n2 += 3) { + GL11.glVertex2d(d3 - d5 + Math.sin((double)n2 * Math.PI / 180.0) * d5, d2 + d5 + Math.cos((double)n2 * Math.PI / 180.0) * d5); + } + GL11.glEnd(); + GL11.glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + GL11.glDisable(3042); + GL11.glEnable(3553); + GL11.glScaled(2.0, 2.0, 2.0); + GL11.glPopAttrib(); + } + + public static void drawCircle(double d, double d2, double d3) { + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawing(6); + tessellator.addVertex(d, d2, zero); + double d4 = Math.PI * 2; + double d5 = d4 / 30.0; + for (double d6 = -d5; d6 < d4; d6 += d5) { + tessellator.addVertex(d + d3 * Math.cos(-d6), d2 + d3 * Math.sin(-d6), zero); + } + tessellator.draw(); + GL11.glEnable(3553); + GL11.glDisable(3042); + } + + public static void drawCircleWithOutLine(double d, double d2, double d3, double d4, double d5, int n, double d6) { + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glEnable(2848); + d5 = (d5 + (double)n) % (double)n; + Tessellator tessellator = Tessellator.instance; + for (double d7 = (double)360 / (double)n * d5; d7 < 360.0 / (double)n * (d5 + d6); d7 += 1.0) { + double d8 = d7 * Math.PI / 180.0; + double d9 = (d7 - 1.0) * Math.PI / 180.0; + double[] arrd = new double[]{Math.cos(d8) * d3, -Math.sin(d8) * d3, Math.cos(d9) * d3, -Math.sin(d9) * d3}; + double[] arrd2 = new double[]{Math.cos(d8) * d4, -Math.sin(d8) * d4, Math.cos(d9) * d4, -Math.sin(d9) * d4}; + tessellator.startDrawing(7); + tessellator.addVertex(d + arrd2[0], d2 + arrd2[1], 0.0); + tessellator.addVertex(d + arrd2[2], d2 + arrd2[3], 0.0); + tessellator.addVertex(d + arrd[2], d2 + arrd[3], 0.0); + tessellator.addVertex(d + arrd[0], d2 + arrd[1], 0.0); + tessellator.draw(); + } + GL11.glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + GL11.glDisable(3042); + GL11.glEnable(3553); + } + public static void drawRadial(double d, double d2, double d3, double d4, double d5, double d6) { + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glEnable(2848); + Tessellator tezzellator = Tessellator.instance; + for (double d7 = d5; d7 < d6; d7 += 0.5) { + double d8 = d7 * Math.PI / 180.0; + double d9 = (d7 - 1.0) * Math.PI / 180.0; + double[] arrd = new double[]{Math.cos(d8) * d3, -Math.sin(d8) * d3, Math.cos(d9) * d3, -Math.sin(d9) * d3}; + double[] arrd2 = new double[]{Math.cos(d8) * d4, -Math.sin(d8) * d4, Math.cos(d9) * d4, -Math.sin(d9) * d4}; + tezzellator.startDrawingQuads(); + tezzellator.addVertex(d + arrd2[0], d2 + arrd2[1], 0.0); + tezzellator.addVertex(d + arrd2[2], d2 + arrd2[3], 0.0); + tezzellator.addVertex(d + arrd[2], d2 + arrd[3], 0.0); + tezzellator.addVertex(d + arrd[0], d2 + arrd[1], 0.0); + tezzellator.draw(); + } + GL11.glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + GL11.glDisable(3042); + GL11.glEnable(3553); + } + + public static void drawHorizontalLine(float f, float f2, float f3, int color) { + if (f2 < f) { + float f4 = f; + f = f2; + f2 = f4; + } + Gui.drawRect(f, f3, f2 + 1.0f, f3 + 1.0f, color); + } + + public static void drawVerticalLine(float f, float f2, float f3, int color) { + if (f3 < f2) { + float f4 = f2; + f2 = f3; + f3 = f4; + } + Gui.drawRect(f, f2 + 1.0f, f + 1.0f, f3, color); + } + + public static void drawRectWithOutline(float left, float top, float right, float bottom, int outlineColor, int rectColor) { + GL11.glScalef(0.5f, 0.5f, 0.5f); + Gui.drawRect((left *= 2.0f) + 1.0f, (top *= 2.0f) + 1.0f, (right *= 2.0f) - 1.0f, (bottom *= 2.0f) - 1.0f, rectColor); + RenderUtil.drawVerticalLine(left, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawVerticalLine(right - 1.0f, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, top, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, bottom - 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, bottom - 2.0f, outlineColor); + GL11.glScalef(2.0f, 2.0f, 2.0f); + } + + public static void drawGradientRectWithOutline(float left, float top, float right, float bottom, int outlineColor, int startColor, int endColor) { + GL11.glScalef(0.5f, 0.5f, 0.5f); + Gui.drawGradientRect((left *= 2.0f) + 1.0f, (top *= 2.0f) + 1.0f, (right *= 2.0f) - 1.0f, (bottom *= 2.0f) - 1.0f, startColor, endColor); + RenderUtil.drawVerticalLine(left, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawVerticalLine(right - 1.0f, top + 1.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, top, outlineColor); + RenderUtil.drawHorizontalLine(left + 2.0f, right - 3.0f, bottom - 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, top + 1.0f, outlineColor); + RenderUtil.drawHorizontalLine(right - 2.0f, right - 2.0f, bottom - 2.0f, outlineColor); + RenderUtil.drawHorizontalLine(left + 1.0f, left + 1.0f, bottom - 2.0f, outlineColor); + GL11.glScalef(2.0f, 2.0f, 2.0f); + } + + public static void drawRectWithShadow(float x, float y, float x2, float y2, int color, boolean shadow) { + if (shadow) { + Gui.drawRect(x + 1.0F, y + 1.0F, x2 + 1.0F, y2 + 1.0F, new Color((color >> 16 & 255) / 4, (color >> 8 & 255) / 4, (color & 255) / 4, color >> 24 & 255).getRGB()); + } + Gui.drawRect(x, y, x2, y2, color); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CBFont.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CBFont.java new file mode 100644 index 0000000..65f2170 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CBFont.java @@ -0,0 +1,150 @@ +package com.cheatbreaker.client.ui.util.font; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.InputStream; + +public class CBFont { + private final float imgSize = 1048; + protected CharData[] charData = new CharData[256]; + protected Font font; + protected boolean antiAlias; + protected boolean fractionalMetrics; + protected int fontHeight = -1; + protected int charOffset = 0; + protected DynamicTexture tex; + + public CBFont(ResourceLocation resourceLocation, float size) { + Font font; + try { + InputStream inputStream = Minecraft.getMinecraft() == null || Minecraft.getMinecraft().getResourceManager() == null ? Minecraft.getMinecraft().getDefaultResourcePack().getResourceStream(resourceLocation) : Minecraft.getMinecraft().getResourceManager().getResource(resourceLocation).getInputStream(); + font = Font.createFont(0, inputStream).deriveFont(size); + } catch (Exception exception) { + font = new Font("Arial", 0, (int)size); + } + this.font = font; + this.antiAlias = true; + this.fractionalMetrics = true; + this.tex = this.setupTexture(this.font, this.antiAlias, this.fractionalMetrics, this.charData); + } + + protected DynamicTexture setupTexture(Font font, boolean bl, boolean bl2, CharData[] arrcharData) { + BufferedImage bufferedImage = this.generateFontImage(font, bl, bl2, arrcharData); + try { + return new DynamicTexture(bufferedImage); + } catch (Exception exception) { + exception.printStackTrace(); + return null; + } + } + + private BufferedImage generateFontImage(Font font, boolean bl, boolean bl2, CharData[] arrcharData) { + int n = (int)this.imgSize; + BufferedImage bufferedImage = new BufferedImage(n, n, 2); + Graphics2D graphics2D = (Graphics2D)bufferedImage.getGraphics(); + graphics2D.setFont(font); + graphics2D.setColor(new Color(255, 255, 255, 0)); + graphics2D.fillRect(0, 0, n, n); + graphics2D.setColor(Color.WHITE); + graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, bl2 ? RenderingHints.VALUE_FRACTIONALMETRICS_ON : RenderingHints.VALUE_FRACTIONALMETRICS_OFF); + graphics2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, bl ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); + graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, bl ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF); + FontMetrics fontMetrics = graphics2D.getFontMetrics(); + int n2 = 0; + int n3 = 0; + int n4 = 1; + for (int i = 0; i < arrcharData.length; ++i) { + char c = (char)i; + CharData charData = new CharData(this); + Rectangle2D rectangle2D = fontMetrics.getStringBounds(String.valueOf(c), graphics2D); + charData.width = rectangle2D.getBounds().width + 8; + charData.height = rectangle2D.getBounds().height; + if (n3 + charData.width >= n) { + n3 = 0; + n4 += n2; + n2 = 0; + } + if (charData.height > n2) { + n2 = charData.height; + } + charData.storedX = n3; + charData.storedY = n4; + if (charData.height > this.fontHeight) { + this.fontHeight = charData.height; + } + arrcharData[i] = charData; + graphics2D.drawString(String.valueOf(c), n3 + 2, n4 + fontMetrics.getAscent()); + n3 += charData.width; + } + return bufferedImage; + } + + protected void drawChar(CharData[] arrcharData, char c, float f, float f2) { + try { + this.drawQuad(f, f2, arrcharData[c].width, arrcharData[c].height, arrcharData[c].storedX, arrcharData[c].storedY, arrcharData[c].width, arrcharData[c].height); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + + private void drawQuad(float f, float f2, float f3, float f4, float f5, float f6, float f7, float f8) { + float f9 = f5 / this.imgSize; + float f10 = f6 / this.imgSize; + float f11 = f7 / this.imgSize; + float f12 = f8 / this.imgSize; + GL11.glTexCoord2f(f9 + f11, f10); + GL11.glVertex2d(f + f3, f2); + GL11.glTexCoord2f(f9, f10); + GL11.glVertex2d(f, f2); + GL11.glTexCoord2f(f9, f10 + f12); + GL11.glVertex2d(f, f2 + f4); + GL11.glTexCoord2f(f9, f10 + f12); + GL11.glVertex2d(f, f2 + f4); + GL11.glTexCoord2f(f9 + f11, f10 + f12); + GL11.glVertex2d(f + f3, f2 + f4); + GL11.glTexCoord2f(f9 + f11, f10); + GL11.glVertex2d(f + f3, f2); + } + + public int getHeight() { + return (this.fontHeight - 8) / 2; + } + + public int getStringWidth(String string) { + int n = 0; + for (char c : string.toCharArray()) { + if (c >= this.charData.length || c < '\u0000') continue; + n += this.charData[c].width - 8 + this.charOffset; + } + return n / 2; + } + + public void setAntiAlias(boolean bl) { + if (this.antiAlias != bl) { + this.antiAlias = bl; + this.tex = this.setupTexture(this.font, bl, this.fractionalMetrics, this.charData); + } + } + + public void setFractionalMetrics(boolean bl) { + if (this.fractionalMetrics != bl) { + this.fractionalMetrics = bl; + this.tex = this.setupTexture(this.font, this.antiAlias, bl, this.charData); + } + } + + public Font getFont() { + return this.font; + } + + public void setFont(Font font) { + this.font = font; + this.tex = this.setupTexture(font, this.antiAlias, this.fractionalMetrics, this.charData); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CBFontRenderer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CBFontRenderer.java new file mode 100644 index 0000000..d78168b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CBFontRenderer.java @@ -0,0 +1,398 @@ +package com.cheatbreaker.client.ui.util.font; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.lwjgl.opengl.GL11; + +public class CBFontRenderer extends CBFont { + private final char COLOR_CODE_START = (char)167; + protected CharData[] boldItalicChars = new CharData[256]; + protected CharData[] italicChars = new CharData[256]; + protected CharData[] boldChars = new CharData[256]; + private final int[] colorCode = new int[32]; + private final String validColorCodes = "0123456789abcdefklmnor"; + protected DynamicTexture texBold; + protected DynamicTexture texItalic; + protected DynamicTexture texItalicBold; + + public CBFontRenderer(ResourceLocation resourceLocation, float size) { + super(resourceLocation, size); + try { + Minecraft.getMinecraft().cbLoadingScreen.addPhase(); + } catch (NullPointerException ignored) {} + this.setupMinecraftColorCodes(); + this.setupBoldItalicIDs(); + } + + public float drawCenteredStringWithShadow(String var1, double var2, double var4, int var6, int var7) { + float shadowWidth = this.drawString(var1, var2 + 1.0, var4 + 1.0, var7, false); + return Math.max(shadowWidth, this.drawString(var1, var2, var4, var6, false)); + } + + public float drawStringWithShadow(String var1, double var2, double var4, int var6) { + float shadowWidth = this.drawString(var1, var2 + 1.0, var4 + 1.0, var6, true); + return Math.max(shadowWidth, this.drawString(var1, var2, var4, var6, false)); + } + + public float drawString(String var1, float var2, float var3, int var4) { + return this.drawString(var1, var2, var3, var4, false); + } + + public float drawCenteredString(String var1, float var2, float var3, int var4) { + return this.drawString(var1, var2 - (float)(this.getStringWidth(var1) / 2), var3, var4); + } + + public float drawCenteredStringWithShadow(String var1, float var2, float var3, int var4) { + this.drawString(var1, (double)(var2 - (float)(this.getStringWidth(var1) / 2)) + 1.0, (double)var3 + 1.0, var4, true); + return this.drawString(var1, var2 - (float)(this.getStringWidth(var1) / 2), var3, var4); + } + + public float drawString(String var1, double var2, double var4, int var6, boolean var7) { + var2 -= 1.0; + if (var1 == null) { + return 0.0f; + } + if (var6 == 0x20FFFFFF) { + var6 = 0xFFFFFF; + } + if ((var6 & 0xFC000000) == 0) { + var6 |= 0xFF000000; + } + if (var7) { + var6 = (var6 & 0xFCFCFC) >> 2 | var6 & 0xFF000000; + } + CharData[] var8 = this.charData; + float var9 = (float)(var6 >> 24 & 0xFF) / 255.0f; + boolean var10 = false; + boolean var11 = false; + boolean var12 = false; + boolean var13 = false; + boolean var14 = false; + boolean var15 = true; + var2 *= 2.0; + var4 = (var4 - 3.0) * 2.0; + if (var15) { + GL11.glPushMatrix(); + GL11.glScaled(0.5, 0.5, 0.5); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glColor4f((float)(var6 >> 16 & 0xFF) / 255.0f, (float)(var6 >> 8 & 0xFF) / 255.0f, (float)(var6 & 0xFF) / 255.0f, var9); + int var16 = var1.length(); + GL11.glEnable(3553); + GL11.glBindTexture(3553, this.tex.getGlTextureId()); + for (int var17 = 0; var17 < var16; ++var17) { + char var18 = var1.charAt(var17); + if (var18 == this.COLOR_CODE_START && var17 < var16) { + int var19 = 21; + try { + var19 = "0123456789abcdefklmnor".indexOf(var1.charAt(var17 + 1)); + } + catch (Exception var21) { + var21.printStackTrace(); + } + if (var19 < 16) { + var11 = false; + var12 = false; + var10 = false; + var14 = false; + var13 = false; + GL11.glBindTexture(3553, this.tex.getGlTextureId()); + var8 = this.charData; + if (var19 < 0 || var19 > 15) { + var19 = 15; + } + if (var7) { + var19 += 16; + } + int var20 = this.colorCode[var19]; + GL11.glColor4f((float)(var20 >> 16 & 0xFF) / 255.0f, (float)(var20 >> 8 & 0xFF) / 255.0f, (float)(var20 & 0xFF) / 255.0f, var9); + } else if (var19 == 16) { + var10 = true; + } else if (var19 == 17) { + var11 = true; + if (var12) { + GL11.glBindTexture(3553, this.texItalicBold.getGlTextureId()); + var8 = this.boldChars; + } else { + GL11.glBindTexture(3553, this.texBold.getGlTextureId()); + var8 = this.boldItalicChars; + } + } else if (var19 == 18) { + var13 = true; + } else if (var19 == 19) { + var14 = true; + } else if (var19 == 20) { + var12 = true; + if (var11) { + GL11.glBindTexture(3553, this.texItalicBold.getGlTextureId()); + var8 = this.boldChars; + } else { + GL11.glBindTexture(3553, this.texItalic.getGlTextureId()); + var8 = this.italicChars; + } + } else if (var19 == 21) { + var11 = false; + var12 = false; + var10 = false; + var14 = false; + var13 = false; + GL11.glColor4f((float)(var6 >> 16 & 0xFF) / 255.0f, (float)(var6 >> 8 & 0xFF) / 255.0f, (float)(var6 & 0xFF) / 255.0f, var9); + GL11.glBindTexture(3553, this.tex.getGlTextureId()); + var8 = this.charData; + } + ++var17; + continue; + } + if (var18 >= var8.length || var18 < '\u0000') continue; + GL11.glBegin(4); + this.drawChar(var8, var18, (float)var2, (float)var4 + 6.0f); + GL11.glEnd(); + if (var13) { + this.drawLine(var2, var4 + (double)(var8[var18].height / 2), + var2 + (double)var8[var18].width - 8.0, var4 + + (double)(var8[var18].height / 2), 1.0f); + } + if (var14) { + this.drawLine(var2, var4 + (double)var8[var18].height - 2.0, + var2 + (double)var8[var18].width - 8.0, var4 + + (double)var8[var18].height - 2.0, 1.0f); + } + var2 += var8[var18].width - 8 + this.charOffset; + } + GL11.glHint(3155, 4352); + GL11.glPopMatrix(); + } + return (float)var2 / 2.0f; + } + + public String setWrapWords(String string, double width) { + return this.wrapWords(string, width, false); + } + + public String wrapWords(String var1, double width, boolean var4) { + StringBuilder var5 = new StringBuilder(); + float var6 = 0.0f; + int var7 = var4 ? var1.length() - 1 : 0; + int var8 = var4 ? -1 : 1; + boolean var9 = false; + boolean var10 = false; + for (int var11 = var7; var11 >= 0 && var11 < var1.length() && var6 < (float)width; var11 += var8) { + char var12 = var1.charAt(var11); + double var13 = this.getStringWidth(String.valueOf(var12)); + if (var9) { + var9 = false; + if (var12 != 'l' && var12 != 'L') { + if (var12 == 'r' || var12 == 'R') { + var10 = false; + } + } else { + var10 = true; + } + } else if (var13 < 0.0) { + var9 = true; + } else { + var6 = (float)((double)var6 + var13); + if (var10) { + var6 += 1.0f; + } + } + if (var6 > (float)width) break; + if (var4) { + var5.insert(0, var12); + continue; + } + var5.append(var12); + } + return var5.toString(); + } + + @Override + public int getStringWidth(String var1) { + if (var1 == null) { + return 0; + } + int var2 = 0; + CharData[] var3 = this.charData; + boolean var4 = false; + boolean var5 = false; + int var6 = var1.length(); + for (int var7 = 0; var7 < var6; ++var7) { + char var8 = var1.charAt(var7); + if (var8 == this.COLOR_CODE_START && var7 < var6) { + int var9 = "0123456789abcdefklmnor".indexOf(var8); + if (var9 < 16) { + var4 = false; + var5 = false; + } else if (var9 == 17) { + var4 = true; + var3 = var5 ? this.boldChars : this.boldItalicChars; + } else if (var9 == 20) { + var5 = true; + var3 = var4 ? this.boldChars : this.italicChars; + } else if (var9 == 21) { + var4 = false; + var5 = false; + var3 = this.charData; + } + ++var7; + continue; + } + if (var8 >= var3.length || var8 < '\u0000') continue; + var2 += var3[var8].width - 8 + this.charOffset; + } + return var2 / 2; + } + + @Override + public void setAntiAlias(boolean var1) { + super.setAntiAlias(var1); + this.setupBoldItalicIDs(); + } + + @Override + public void setFractionalMetrics(boolean var1) { + super.setFractionalMetrics(var1); + this.setupBoldItalicIDs(); + } + + private void setupBoldItalicIDs() { + this.texBold = this.setupTexture(this.font.deriveFont(1), this.antiAlias, this.fractionalMetrics, this.boldItalicChars); + this.texItalic = this.setupTexture(this.font.deriveFont(2), this.antiAlias, this.fractionalMetrics, this.italicChars); + this.texItalicBold = this.setupTexture(this.font.deriveFont(3), this.antiAlias, this.fractionalMetrics, this.boldChars); + } + + private void drawLine(double var1, double var3, double var5, double var7, float var9) { + GL11.glDisable(3553); + GL11.glLineWidth(var9); + GL11.glBegin(1); + GL11.glVertex2d(var1, var3); + GL11.glVertex2d(var5, var7); + GL11.glEnd(); + GL11.glEnable(3553); + } + + public String formatText(String var1, double var2) { + StringBuilder var4 = new StringBuilder(); + StringBuilder var5 = new StringBuilder(); + boolean var6 = false; + for (char var10 : var1.toCharArray()) { + String var14; + String var13; + if (var6) { + var4.append(var10); + var6 = false; + continue; + } + if (var10 == '§') { + var4.append(var10); + var6 = true; + continue; + } + var4.append(var10); + int var11 = this.getStringWidth(var4.toString()); + if (!((double)var11 >= var2)) continue; + String var12 = var4.toString(); + if (var12.contains(" ")) { + var13 = var12.substring(0, var12.lastIndexOf(" ")); + var14 = var12.substring(var12.lastIndexOf(" ")); + if (var14.startsWith(" ")) { + var14 = var14.replaceFirst(" ", ""); + } + } else { + var13 = var12.substring(0, var12.length() - 1); + var14 = var12.substring(var12.length() - 1); + } + var5.append(var13).append("\n"); + String var15 = EnumChatFormatting.formatColor(var4.toString()); + var4.setLength(0); + var4.append(var14).append(var15); + } + var5.append(var4); + return var5.length() == 0 ? var1 : var5.toString(); + } + + public List wrapWords(String text, double width) { + ArrayList finalWords = new ArrayList(); + if ((double)this.getStringWidth(text) > width) { + String[] words = text.split(" "); + String currentWord = ""; + int lastColorCode = 65535; + for (int i = 0; i < words.length; ++i) { + String word = words[i]; + for (int var12 = 0; var12 < word.toCharArray().length; ++var12) { + char var13 = word.toCharArray()[var12]; + if (var13 != this.COLOR_CODE_START || var12 >= word.toCharArray().length - 1) continue; + lastColorCode = word.toCharArray()[var12 + 1]; + } + StringBuilder stringBuilder = new StringBuilder(); + if ((double)this.getStringWidth(stringBuilder.append(currentWord).append(word).append(" ").toString()) < width) { + currentWord = currentWord + word + " "; + continue; + } + finalWords.add(currentWord); + currentWord = this.COLOR_CODE_START + lastColorCode + word + " "; + } + if (currentWord.length() > 0) { + if ((double)this.getStringWidth(currentWord) < width) { + finalWords.add(this.COLOR_CODE_START + lastColorCode + currentWord + " "); + currentWord = ""; + } else { + for (String s : this.formatString(currentWord, width)) { + finalWords.add(s); + } + } + } + } else { + finalWords.add(text); + } + return finalWords; + } + + public List formatString(String var1, double var2) { + ArrayList finalWords = new ArrayList(); + String currentWord = ""; + int lastColorCode = 65535; + char[] chars = var1.toCharArray(); + for (int i = 0; i < chars.length; ++i) { + char c = chars[i]; + if (c == this.COLOR_CODE_START && i < chars.length - 1) { + lastColorCode = chars[i + 1]; + } + StringBuilder stringBuilder = new StringBuilder(); + if ((double)this.getStringWidth(stringBuilder.append(currentWord).append(c).toString()) < var2) { + currentWord = currentWord + c; + continue; + } + finalWords.add(currentWord); + currentWord = this.COLOR_CODE_START + lastColorCode + String.valueOf(c); + } + if (currentWord.length() > 0) { + finalWords.add(currentWord); + } + return finalWords; + } + + private void setupMinecraftColorCodes() { + for (int var1 = 0; var1 < 32; ++var1) { + int var2 = (var1 >> 3 & 1) * 85; + int var3 = (var1 >> 2 & 1) * 170 + var2; + int var4 = (var1 >> 1 & 1) * 170 + var2; + int var5 = (var1 & 1) * 170 + var2; + if (var1 == 6) { + var3 += 85; + } + if (var1 >= 16) { + var3 /= 4; + var4 /= 4; + var5 /= 4; + } + this.colorCode[var1] = (var3 & 0xFF) << 16 | (var4 & 0xFF) << 8 | var5 & 0xFF; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CharData.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CharData.java new file mode 100644 index 0000000..7ec5cc5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/util/font/CharData.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.ui.util.font; + +public class CharData { + public int width; + public int height; + public int storedX; + public int storedY; + final CBFont font; + + protected CharData(CBFont cBFont) { + this.font = cBFont; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/warning/CompetitiveGameWarningGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/warning/CompetitiveGameWarningGui.java new file mode 100644 index 0000000..0f25463 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/warning/CompetitiveGameWarningGui.java @@ -0,0 +1,76 @@ +package com.cheatbreaker.client.ui.warning; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.ResourceLocation; + +public class CompetitiveGameWarningGui extends AbstractGui { + private final GuiScreen field_146298_h; + private final GradientTextButton cancelButton; + private final GradientTextButton continueButton; + private final ColorFade warningTextFade; + private boolean ended; + + public CompetitiveGameWarningGui(GuiScreen guiScreen) { + this.field_146298_h = guiScreen; + this.warningTextFade = new ColorFade(2000L, -1, -52429); + this.cancelButton = new GradientTextButton("Cancel"); + this.continueButton = new GradientTextButton("I understand, continue"); + } + + @Override + public void initGui() { + this.blurGui(); + this.ended = true; + float f = this.getScaledWidth() / 2.0f; + float f2 = this.getScaledHeight() / 2.0f - (float)50; + this.continueButton.setElementSize(f - (float)75, f2 + (float)50, (float)150, 12); + this.cancelButton.setElementSize(f - (float)75, f2 + (float)64, (float)150, 12); + this.cancelButton.buttonColor1(); + } + + @Override + public void onGuiClosed() { + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void drawMenu(float x, float y) { + if (this.ended && this.warningTextFade.isOver()) { + this.ended = false; + } else if (!this.ended && this.warningTextFade.isOver()) { + this.ended = true; + } + this.renderBlur(this.getScaledWidth(), this.getScaledHeight()); + float centeredX = this.getScaledWidth() / 2.0f; + float centeredY = this.getScaledHeight() / 2.0f - (float)50; + CheatBreaker.getInstance().playBold18px.drawCenteredString("WARNING!", centeredX, centeredY, this.warningTextFade.getColor(this.ended).getRGB()); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("Leaving competitive games may result in penalties.", centeredX, centeredY + (float)15, -1); + CheatBreaker.getInstance().playRegular16px.drawCenteredString("You may be suspended from competitive games if you continue leaving games!", centeredX, centeredY + 25.0F, -1); + this.cancelButton.drawElementHover(x, y, true); + this.continueButton.drawElementHover(x, y, true); + } + + @Override + protected void mouseClicked(float f, float f2, int n) { + if (this.cancelButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(this.field_146298_h); + } else if (this.continueButton.isMouseInside(f, f2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld(null); + this.mc.displayGuiScreen(new VanillaMenu()); + } + } + + @Override + public void mouseMovedOrUp(float f, float f2, int n) { + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/warning/UnsafeServerWarningGUI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/warning/UnsafeServerWarningGUI.java new file mode 100644 index 0000000..b6f1c0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/ui/warning/UnsafeServerWarningGUI.java @@ -0,0 +1,101 @@ +package com.cheatbreaker.client.ui.warning; + + +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.render.wordwrap.WordWrap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class UnsafeServerWarningGUI extends GuiScreen { + private final ServerData selectedButton; + private final GuiScreen eventButton; + private final long currentTime; + private final String reason; + private final boolean blocked; + + public UnsafeServerWarningGUI(GuiScreen guiScreen, ServerData serverData, String reason, boolean block) { + this.eventButton = guiScreen; + this.selectedButton = serverData; + this.currentTime = System.currentTimeMillis(); + this.reason = reason; + this.blocked = block; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + super.drawScreen(mouseX, mouseY, partialTicks); + this.drawDefaultBackground(); + float f2 = 0.52F; + int n3 = this.currentTime == 0L ? 10 : (int)((10999L - (System.currentTimeMillis() - this.currentTime)) / 1000L); + String leaveString = this.blocked ? "Leave" : "Get me out of here!"; + String continueString = "I understand the risk, continue anyways " + (n3 > 0 ? "(" + n3 + ")" : ""); + String title = this.blocked ? "THIS SERVER IS " + EnumChatFormatting.RED + "BLOCKED" : "WARNING!"; + float f3 = this.mc.fontRenderer.getStringWidth(leaveString); + boolean bl = mouseX > this.width / 2 + 20 && mouseX < this.width / 2 + 140 && mouseY > this.height / 2 + 40 && mouseY < this.height / 2 + 50; + boolean bl2 = (this.blocked ? mouseX > this.width / 2 - 20 : mouseX > this.width / 2 - 130) && (this.blocked ? (float) mouseX < (float)(this.width / 2 - 20) + f3 / f2 : (float) mouseX < (float)(this.width / 2 - 130) + f3 / f2) && mouseY > this.height / 2 + 30 && mouseY < this.height / 2 + 42; + RenderUtil.drawRoundedRect(this.width / 2 - 140, this.height / 2 - 100, this.width / 2 + 140, this.height / 2 + 50, 8, 0x4FFF0000); + GL11.glPushMatrix(); + GL11.glScalef(f2, f2, f2); + if (!this.blocked) { + this.mc.fontRenderer.drawStringWithShadow(continueString, (float)((int)((float)(this.width / 2 + 20) / f2)), (float)((int)((float)(this.height / 2 + 40) / f2)), bl ? -1 : (n3 <= 0 ? -1907998 : -5066062)); + } + GL11.glPopMatrix(); + GL11.glPushMatrix(); + f2 = 1.0f; + GL11.glScalef(f2, f2, f2); + String wrapped = WordWrap.from(this.reason).maxWidth(50).insertHyphens(false).wrap(); + String[] lines = wrapped.split("\n"); + int index = 0; + for(String line : lines) { +// CheatBreaker.getInstance().playRegular14px.drawCenteredString(line, this.getScaledWidth() / 2.0f, this.getScaledHeight() / 2.0f + 14.0f + (index * CheatBreaker.getInstance().playRegular14px.getFont().getSize() / 2.0f), 0xFFDDDDDD); + this.mc.fontRenderer.drawCenteredStringWithShadow(line, (int)((float)(this.width / 2) / f2), (int)((float)(this.height / 2 - 70 + (index * 20)) / f2), -1); + index++; + } + if (!this.blocked) { + this.mc.fontRenderer.drawCenteredStringWithShadow("Join at " + EnumChatFormatting.BOLD + "your own" + EnumChatFormatting.RESET + " risk!", (int)((float)(this.width / 2) / f2), (int)((float)(this.height / 2 - 70 + (index * 20)) / f2), -1); + } +// this.mc.fontRenderer.drawCenteredStringWithShadow(!this.blockedwarn ? "This is a test message." : "You cannot join this server", (int)((float)(this.width / 2) / f2), (int)((float)(this.height / 2 - 70) / f2), -1); +// this.mc.fontRenderer.drawCenteredStringWithShadow(!this.blockedwarn ? "This is a test message 2." : "", (int)((float)(this.width / 2) / f2), ((int)((float)(this.height / 2 - 50) / f2)), -1); +// this.mc.fontRenderer.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2 - 40) / f2)), -1); +// this.mc.fontRenderer.drawCenteredStringWithShadow(!this.blockedwarn ? "Join at " + EnumChatFormatting.BOLD + "your own" + EnumChatFormatting.RESET + " risk!" : "", (int)((float)(this.width / 2) / f2), (int)((float)(this.height / 2 - 30) / f2), -1); +// this.mc.fontRenderer.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2 - 20) / f2)), -1); +// this.mc.fontRenderer.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2 - 10) / f2)), -1); +// this.mc.fontRenderer.drawStringWithShadow(" ", (float)((int)((float)(this.width / 2 - 130) / f2)), (float)((int)((float)(this.height / 2) / f2)), -1); + GL11.glPopMatrix(); + this.mc.fontRenderer.drawCenteredStringWithShadow(title, this.width / 2, this.height / 2 - 90, -1); + if (this.blocked) { + this.mc.fontRenderer.drawCenteredStringWithShadow(leaveString, this.width / 2, this.height / 2 + 30, bl2 ? -1 : -1907998); + } else { + this.mc.fontRenderer.drawStringWithShadow(leaveString, (float)(this.width / 2 - 130), (float)(this.height / 2 + 30), bl2 ? -1 : -1907998); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + float f = 0.5F; + String leaveString = this.blocked ? "Leave" : "Get me out of here!"; + float f2 = this.mc.fontRenderer.getStringWidth(leaveString); + boolean bl2 = mouseX > this.width / 2 + 20 && mouseX < this.width / 2 + 140 && mouseY > this.height / 2 + 40 && mouseY < this.height / 2 + 50; + boolean bl = (this.blocked ? mouseX > this.width / 2 - 20 : mouseX > this.width / 2 - 130) && + (this.blocked ? (float) mouseX < (float)(this.width / 2 - 20) + f2 / f : (float) mouseX < (float)(this.width / 2 - 130) + f2 / f) + && mouseY > this.height / 2 + 30 && mouseY < this.height / 2 + 42; + if (bl) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.mc.displayGuiScreen(this.eventButton); + } + if (bl2 && !this.blocked) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + int n4 = this.currentTime == 0L ? 10 : (int)((10999L - (System.currentTimeMillis() - this.currentTime)) / 1000L); + if (n4 <= 0) { + this.mc.displayGuiScreen(new GuiConnecting(this.eventButton, this.mc, this.selectedButton)); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/CBDebugOutput.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/CBDebugOutput.java new file mode 100644 index 0000000..4c6e2dc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/CBDebugOutput.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.util; + +import com.google.common.collect.Sets; + +import java.util.Set; +import java.util.UUID; + +public class CBDebugOutput { + // This will eventually be replaced with a permission from the Player Asset Server + public static final Set uuids = + Sets.newHashSet( + UUID.fromString("d8f72541-823d-4ded-9f7f-b67fdb34f43c"), + UUID.fromString("285c25e3-74f6-47e0-81a6-4e74ceb54ed3"), + UUID.fromString("2beaac97-f357-493a-9b8c-f7f1976a8f0d"), + UUID.fromString("d9c7b72a-d236-484a-b622-ddf6edea6d79") + ); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/ClientCredits.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/ClientCredits.java new file mode 100644 index 0000000..051c190 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/ClientCredits.java @@ -0,0 +1,30 @@ +package com.cheatbreaker.client.util; + +import com.google.common.collect.Sets; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.client.Minecraft; + +import java.util.Set; +import java.util.UUID; + +public class ClientCredits { + private static final Set uuids = Sets.newHashSet( + UUID.fromString("d8f72541-823d-4ded-9f7f-b67fdb34f43c"), + UUID.fromString("285c25e3-74f6-47e0-81a6-4e74ceb54ed3") + ); + + public static boolean isCreditedUser(UUID uuid) { + System.out.println("You are using TellinqBreaker!"); + return uuids.contains(uuid); + } + + public static void sendCredits() { + ChatComponentText prefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + "Credits: "); + String listPrefix = EnumChatFormatting.RED + "- " + EnumChatFormatting.WHITE; + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(prefix); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(new ChatComponentText(listPrefix + "CheatBreaker LLC for the original client.")); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(new ChatComponentText(listPrefix + "Tellinq and Moose1301 for managing this version.")); + + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/GlStateManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/GlStateManager.java new file mode 100644 index 0000000..93aad9e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/GlStateManager.java @@ -0,0 +1,111 @@ +package com.cheatbreaker.client.util; + +import net.minecraft.client.renderer.OpenGlHelper; +import org.lwjgl.opengl.GL11; + +public class GlStateManager { + private static final GlStateManager.Color colorState = new GlStateManager.Color(); + private static final GlStateManager.BlendState blendState = new GlStateManager.BlendState(); + + private static int activeShadeModel = 7425; + public static void color(float colorRed, float colorGreen, float colorBlue, float colorAlpha) { + if (colorRed != colorState.red || colorGreen != colorState.green || colorBlue != colorState.blue || colorAlpha != colorState.alpha) { + colorState.red = colorRed; + colorState.green = colorGreen; + colorState.blue = colorBlue; + colorState.alpha = colorAlpha; + GL11.glColor4f(colorRed, colorGreen, colorBlue, colorAlpha); + } + } + public static void shadeModel(int mode) { + if (mode != activeShadeModel) { + activeShadeModel = mode; + GL11.glShadeModel(mode); + } + } + + public static void disableBlend() { + blendState.field_179213_a.setDisabled(); + } + + public static void enableBlend() { + blendState.field_179213_a.setEnabled(); + } + + public static void blendFunc(int srcFactor, int dstFactor) { + if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor) { + blendState.srcFactor = srcFactor; + blendState.dstFactor = dstFactor; + GL11.glBlendFunc(srcFactor, dstFactor); + } + } + + public static void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) { + if (srcFactor != blendState.srcFactor || dstFactor != blendState.dstFactor || srcFactorAlpha != blendState.srcFactorAlpha || dstFactorAlpha != blendState.dstFactorAlpha) { + blendState.srcFactor = srcFactor; + blendState.dstFactor = dstFactor; + blendState.srcFactorAlpha = srcFactorAlpha; + blendState.dstFactorAlpha = dstFactorAlpha; + OpenGlHelper.glBlendFunc(srcFactor, dstFactor, srcFactorAlpha, dstFactorAlpha); + } + } + static class Color { + public float red = 1.0F; + public float green = 1.0F; + public float blue = 1.0F; + public float alpha = 1.0F; + + public Color() { + } + + public Color(float redIn, float greenIn, float blueIn, float alphaIn) { + this.red = redIn; + this.green = greenIn; + this.blue = blueIn; + this.alpha = alphaIn; + } + } + static class BlendState { + public GlStateManager.BooleanState field_179213_a; + public int srcFactor; + public int dstFactor; + public int srcFactorAlpha; + public int dstFactorAlpha; + + private BlendState() { + this.field_179213_a = new GlStateManager.BooleanState(3042); + this.srcFactor = 1; + this.dstFactor = 0; + this.srcFactorAlpha = 1; + this.dstFactorAlpha = 0; + } + } + static class BooleanState { + private final int capability; + private boolean currentState = false; + + public BooleanState(int capabilityIn) { + this.capability = capabilityIn; + } + + public void setDisabled() { + this.setState(false); + } + + public void setEnabled() { + this.setState(true); + } + + public void setState(boolean state) { + if (state != this.currentState) { + this.currentState = state; + + if (state) { + GL11.glEnable(this.capability); + } else { + GL11.glDisable(this.capability); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/LunarClientJsonThing.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/LunarClientJsonThing.java new file mode 100644 index 0000000..7e634d4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/LunarClientJsonThing.java @@ -0,0 +1,54 @@ +package com.cheatbreaker.client.util; + +import com.google.gson.*; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; + +import java.lang.reflect.Type; + +public class LunarClientJsonThing implements JsonDeserializer, JsonSerializer { + public ServerStatusResponse deserialize(JsonElement object, Type type, JsonDeserializationContext context) { + JsonObject jsonObject = JsonUtils.getJsonElementAsJsonObject(object, "status"); + ServerStatusResponse serverStatusResponse = new ServerStatusResponse(); + if (jsonObject.has("description")) { + serverStatusResponse.func_151315_a(context.deserialize(jsonObject.get("description"), IChatComponent.class)); + } + if (jsonObject.has("players")) { + serverStatusResponse.func_151319_a(context.deserialize(jsonObject.get("players"), ServerStatusResponse.PlayerCountData.class)); + } + if (jsonObject.has("version")) { + serverStatusResponse.func_151321_a(context.deserialize(jsonObject.get("version"), ServerStatusResponse.MinecraftProtocolVersionIdentifier.class)); + } + if (jsonObject.has("favicon")) { + serverStatusResponse.func_151320_a(JsonUtils.getJsonObjectStringFieldValue(jsonObject, "favicon")); + } + if (jsonObject.has("lcServer")) { + serverStatusResponse.lcString = jsonObject.get("lcServer").getAsString(); + } + return serverStatusResponse; + } + + public JsonElement serialize(ServerStatusResponse src, Type type, JsonSerializationContext context) { + JsonObject jsonObject = new JsonObject(); + if (src.func_151317_a() != null) { + jsonObject.add("description", context.serialize(src.func_151317_a())); + } + if (src.func_151318_b() != null) { + jsonObject.add("players", context.serialize(src.func_151318_b())); + } + if (src.func_151322_c() != null) { + jsonObject.add("version", context.serialize(src.func_151322_c())); + } + if (src.func_151316_d() != null) { + jsonObject.addProperty("favicon", src.func_151316_d()); + } + return jsonObject; + } + + + @Override + public JsonElement serialize(Object src, Type typeOfSrc, JsonSerializationContext context) { + return serialize((ServerStatusResponse) src, typeOfSrc, context); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/MessageUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/MessageUtils.java new file mode 100644 index 0000000..0156ef7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/MessageUtils.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.util; + +import net.minecraft.util.ChatComponentText; +import net.minecraft.client.Minecraft; + +public class MessageUtils { + + public static void sendBan(String user, int num) { + Minecraft minecraft = Minecraft.getMinecraft(); + if (minecraft != null && minecraft.ingameGUI != null && minecraft.ingameGUI.getChatGUI() != null) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(new ChatComponentText("(CB) " + user + " has been CheatBreaker banned.")); + } + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/chat/ChatHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/chat/ChatHandler.java new file mode 100644 index 0000000..c84ac22 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/chat/ChatHandler.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.util.chat; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; + +public class ChatHandler { + + public static void sendBrandedChatMessage(String message) { + Minecraft minecraft = Minecraft.getMinecraft(); + + if (minecraft != null && minecraft.ingameGUI != null && minecraft.ingameGUI.getChatGUI() != null) { + ChatComponentText textComponent = new ChatComponentText(message); + textComponent.setBranded(true); + minecraft.ingameGUI.getChatGUI().func_146227_a(textComponent); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/chat/ChatLineWrapper.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/chat/ChatLineWrapper.java new file mode 100644 index 0000000..984b787 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/chat/ChatLineWrapper.java @@ -0,0 +1,18 @@ +package com.cheatbreaker.client.util.chat; + +import lombok.*; +import net.minecraft.client.gui.ChatLine; +import net.minecraft.util.IChatComponent; + +public class ChatLineWrapper extends ChatLine { + @Getter @Setter + private boolean branded; + + public ChatLineWrapper(int i, IChatComponent chatComponent, int i1) { + super(i, chatComponent, i1); + } + + public static ChatLineWrapper of(ChatLine chatLine) { + return new ChatLineWrapper(chatLine.getUpdatedCounter(), chatLine.func_151461_a(), chatLine.getChatLineID()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/DataTransformer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/DataTransformer.java new file mode 100644 index 0000000..6569d52 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/DataTransformer.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.util.data; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +public class DataTransformer { + + public static Map hexBinValues = new HashMap<>(); + + public static String getASCIIFromHex(String hexIn) { + return convertBinaryToASCII(getBinaryFromHexData(hexIn)); + } + + public static String getBinaryFromHexData(String hexIn) { + char character; + StringBuilder translatedHex = new StringBuilder(); + hexIn = hexIn.toUpperCase(); + + for (int i = 0; i < hexIn.length(); i++) { + character = hexIn.charAt(i); + if (hexBinValues.containsKey(character)) { + translatedHex.append(hexBinValues.get(character)); + } + } + + return translatedHex.toString(); + } + + public static String convertBinaryToASCII(String binaryIn) { + return Arrays.stream(binaryIn.split("(?<=\\G.{8})")) + .parallel() + .map(eightBits -> (char) Integer.parseInt(eightBits, 2)) + .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString(); + } + + static { + hexBinValues.put('0', "0000"); + hexBinValues.put('1', "0001"); + hexBinValues.put('2', "0010"); + hexBinValues.put('3', "0011"); + hexBinValues.put('4', "0100"); + hexBinValues.put('5', "0101"); + hexBinValues.put('6', "0110"); + hexBinValues.put('7', "0111"); + hexBinValues.put('8', "1000"); + hexBinValues.put('9', "1001"); + hexBinValues.put('A', "1010"); + hexBinValues.put('B', "1011"); + hexBinValues.put('C', "1100"); + hexBinValues.put('D', "1101"); + hexBinValues.put('E', "1110"); + hexBinValues.put('F', "1111"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/DataUtil.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/DataUtil.java new file mode 100644 index 0000000..f510d08 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/DataUtil.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.util.data; + +import com.cheatbreaker.client.CheatBreaker; + +import java.security.MessageDigest; + +public class DataUtil { + + public static String getHWID() { + try { + String toEncrypt = System.getenv("COMPUTERNAME") + System.getProperty("user.name") + System.getenv("PROCESSOR_IDENTIFIER") + System.getenv("PROCESSOR_LEVEL"); + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(toEncrypt.getBytes()); + StringBuffer hexString = new StringBuffer(); + byte[] byteData = md.digest(); + + for (byte aByteData : byteData) { + String hex = Integer.toHexString(-13569 & 4351 & aByteData); + if (hex.length() == (769 & -27583)) { + hexString.append((char) ('୸' & '䂴')); + } + + hexString.append(hex); + } + + return hexString.toString(); + } catch (Exception var9) { + var9.printStackTrace(); + return CheatBreaker.getInstance().getLoggerPrefix() + "Error retrieving Hardware ID"; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/JSONReader.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/JSONReader.java new file mode 100644 index 0000000..59f3197 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/data/JSONReader.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.util.data; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +public class JSONReader { + + private static String getContent(Reader fileReader) throws IOException { + int i; + StringBuilder sb = new StringBuilder(); + + while ((i = fileReader.read()) != -1) { + sb.append((char) i); + } + + return sb.toString(); + } + + public static JSONObject getJSONObjectFromURL(String url) throws IOException, JSONException { + BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream(), StandardCharsets.UTF_8)); + return new JSONObject(getContent(reader)); + } + + public void test() { + + } + + public static JSONArray getJSONArrayFromURL(String url) throws IOException, JSONException { + BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream(), StandardCharsets.UTF_8)); + return new JSONArray(getContent(reader)); + } + + public static InputStream readAsBrowser(URL url, boolean useCustomAgent) { + try { + HttpURLConnection httpcon = (HttpURLConnection) url.openConnection(); + httpcon.addRequestProperty("User-Agent", (useCustomAgent ? "CheatBreaker-Client" : "Mozilla/4.0")); + + return httpcon.getInputStream(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/discord/DiscordRPCHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/discord/DiscordRPCHandler.java new file mode 100644 index 0000000..94885e1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/discord/DiscordRPCHandler.java @@ -0,0 +1,56 @@ +package com.cheatbreaker.client.util.discord; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.client.Minecraft; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +public class DiscordRPCHandler { + private static String serversURL = "https://raw.githubusercontent.com/LunarClient/ServerMappings/master/servers.json"; + + public static String[] getServerName(String name) { + if (Minecraft.getMinecraft().isSingleplayer()) { + return new String[]{"Singleplayer", "cb", "Playing in Singleplayer", null}; + } else if (name == "" || name == null) { + return new String[]{"In Menus", "cb", "In the menus", null}; + } + // Checks if the server is on the unsafe server list. + for (String[] string : CheatBreaker.getInstance().getGlobalSettings().getUnsafeServers()) { + if (name.endsWith(string[0].toLowerCase())) { + return new String[]{"Unsafe Server", "unsafeserver", "Playing on an unsafe server", "Risking my security"}; + } + } + String serverName = getServerNameFromMapping(name, "name"); + if (serverName != null) { + String isNetwork = serverName.endsWith("Network") ? "the " : ""; + return new String[]{serverName, getServerNameFromMapping(name, "id"), "Playing on " + isNetwork + serverName, null}; + } else if (name.contains("localhost") || name.equals("127.0.0.1") || name.startsWith("192.168")) { + return new String[]{"Local Server", "cb", "Playing on a local server", null}; + } + return new String[]{"Private Server", "cb", "Playing on a private server", null}; + } + + private static String getServerNameFromMapping(String ip, String object) { + try { + JsonArray jsonObject = new JsonParser().parse(new BufferedReader(new InputStreamReader(new URL(serversURL).openStream(), StandardCharsets.UTF_8))).getAsJsonArray(); + for (JsonElement s2 : jsonObject) { + String s3 = s2.getAsJsonObject().get(object).toString().replaceAll("\"", ""); + JsonArray jsonArray = (JsonArray) s2.getAsJsonObject().get("addresses"); + for (JsonElement s : jsonArray) { + if (ip.endsWith(s.toString().replaceAll("\"", ""))) return s3; + } + } + + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractClassThree.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractClassThree.java new file mode 100644 index 0000000..97e4448 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractClassThree.java @@ -0,0 +1,48 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Set; + +public abstract class AbstractClassThree + extends AbstractTestClassTwo + implements ITestClassSeven, + Cloneable { + protected AbstractClassThree() { + } + + @Override + public abstract ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(); + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (!(object instanceof Set)) { + return false; + } + Set set = (Set)object; + if (set.size() != this.size()) { + return false; + } + return this.containsAll((Collection)set); + } + + @Override + public int hashCode() { + int n = 0; + int n2 = this.size(); + ITestClassFive iTestClassFive = this.lIIIIlIIllIIlIIlIIIlIIllI(); + while (n2-- != 0) { + Object e = iTestClassFive.next(); + n += e == null ? 0 : e.hashCode(); + } + return n; + } + + @Override + public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractTestClassOne.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractTestClassOne.java new file mode 100644 index 0000000..c227eaa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractTestClassOne.java @@ -0,0 +1,38 @@ +package com.cheatbreaker.client.util.font; + +import java.io.Serializable; + +public abstract class AbstractTestClassOne + implements Serializable, + ITestClassThree { + private static final long lIIIIIIIIIlIllIIllIlIIlIl = -4940583368468432370L; + protected Object a_; + + protected AbstractTestClassOne() { + } + + @Override + public void lIIIIlIIllIIlIIlIIIlIIllI(Object object) { + this.a_ = object; + } + + @Override + public Object lIIIIlIIllIIlIIlIIIlIIllI() { + return this.a_; + } + + @Override + public Object put(Object object, Object object2) { + throw new UnsupportedOperationException(); + } + + @Override + public Object remove(Object object) { + throw new UnsupportedOperationException(); + } + + @Override + public void clear() { + throw new UnsupportedOperationException(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractTestClassTwo.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractTestClassTwo.java new file mode 100644 index 0000000..e149e48 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/AbstractTestClassTwo.java @@ -0,0 +1,139 @@ +package com.cheatbreaker.client.util.font; + +import java.lang.reflect.Array; +import java.util.AbstractCollection; +import java.util.Collection; +import java.util.Iterator; + +public abstract class AbstractTestClassTwo + extends AbstractCollection + implements ITestClassEight { + protected AbstractTestClassTwo() { + } + + @Override + public Object[] toArray() { + Object[] objectArray = new Object[this.size()]; + lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI((Iterator)this.lIIIIlIIllIIlIIlIIIlIIllI(), objectArray); + return objectArray; + } + + @Override + public Object[] toArray(Object[] objectArray) { + int n = this.size(); + if (objectArray.length < n) { + objectArray = (Object[])Array.newInstance(objectArray.getClass().getComponentType(), n); + } + lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI((Iterator)this.lIIIIlIIllIIlIIlIIIlIIllI(), objectArray); + if (n < objectArray.length) { + objectArray[n] = null; + } + return objectArray; + } + + public boolean addAll(Collection collection) { + boolean bl = false; + Iterator iterator = collection.iterator(); + int n = collection.size(); + while (n-- != 0) { + if (!this.add(iterator.next())) continue; + bl = true; + } + return bl; + } + + public boolean add(Object object) { + throw new UnsupportedOperationException(); + } + + @Override + @Deprecated + public ITestClassFive IlllIIIlIlllIllIlIIlllIlI() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } + + @Override + public abstract ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(); + + @Override + public boolean remove(Object object) { + return this.lIIIIIIIIIlIllIIllIlIIlIl(object); + } + + public boolean lIIIIIIIIIlIllIIllIlIIlIl(Object object) { + ITestClassFive iTestClassFive = this.lIIIIlIIllIIlIIlIIIlIIllI(); + while (iTestClassFive.hasNext()) { + if (object != iTestClassFive.next()) continue; + iTestClassFive.remove(); + return true; + } + return false; + } + + public boolean containsAll(Collection collection) { + int n = collection.size(); + Iterator iterator = collection.iterator(); + while (n-- != 0) { + if (this.contains(iterator.next())) continue; + return false; + } + return true; + } + + public boolean retainAll(Collection collection) { + boolean bl = false; + int n = this.size(); + ITestClassFive iTestClassFive = this.lIIIIlIIllIIlIIlIIIlIIllI(); + while (n-- != 0) { + if (collection.contains(iTestClassFive.next())) continue; + iTestClassFive.remove(); + bl = true; + } + return bl; + } + + public boolean removeAll(Collection collection) { + boolean bl = false; + int n = collection.size(); + Iterator iterator = collection.iterator(); + while (n-- != 0) { + if (!this.remove(iterator.next())) continue; + bl = true; + } + return bl; + } + + @Override + public boolean isEmpty() { + return this.size() == 0; + } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + ITestClassFive iTestClassFive = this.lIIIIlIIllIIlIIlIIIlIIllI(); + int n = this.size(); + boolean bl = true; + stringBuilder.append("{"); + while (n-- != 0) { + if (bl) { + bl = false; + } else { + stringBuilder.append(", "); + } + Object e = iTestClassFive.next(); + if (this == e) { + stringBuilder.append("(this collection)"); + continue; + } + stringBuilder.append(String.valueOf(e)); + } + stringBuilder.append("}"); + return stringBuilder.toString(); + } + + @Override + public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIIlIllIIIIlllIlllIIIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIIlIllIIIIlllIlllIIIIII.java new file mode 100644 index 0000000..aab7aa0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIIlIllIIIIlllIlllIIIIII.java @@ -0,0 +1,76 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class IIIIlIllIIIIlllIlllIIIIII + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final Object[] IIIIllIlIIIllIlllIlllllIl; + private final Object[] IIIIllIIllIIIIllIllIIIlIl; + + public IIIIlIllIIIIlllIlllIIIIII(Object[] objectArray, Object[] objectArray2, int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIlIIIllIlllIlllllIl = objectArray; + this.IIIIllIIllIIIIllIllIIIlIl = objectArray2; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + Object[] objectArray = this.IIIIllIlIIIllIlllIlllllIl; + Object[] objectArray2 = this.IIIIllIIllIIIIllIllIIIlIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, n6, n6 + n8, n6 + 2 * n8); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, n5 - n8, n5, n5 + n8); + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, n7 - 2 * n8, n7 - n8, n7); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, n6, n5, n7); + Object object = objectArray[n5]; + Object object2 = objectArray2[n5]; + int n9 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n10 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + int n11; + if (n9 <= n2 && (n = (n11 = ((Comparable)objectArray[n9]).compareTo(object)) == 0 ? ((Comparable)objectArray2[n9]).compareTo(object2) : n11) <= 0) { + if (n == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n3++, n9); + } + ++n9; + continue; + } + while (n2 >= n9 && (n = (n11 = ((Comparable)objectArray[n2]).compareTo(object)) == 0 ? ((Comparable)objectArray2[n2]).compareTo(object2) : n11) >= 0) { + if (n == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n2, n10--); + } + --n2; + } + if (n9 > n2) break; + IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n9++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n3); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, objectArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n8, n8); + n8 = Math.min(n10 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n10 - 1); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, objectArray2, n9, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n9 - n3; + n = n10 - n2; + if (n8 > 1 && n > 1) { + IIIIlIllIIIIlllIlllIIIIII.invokeAll(new IIIIlIllIIIIlllIlllIIIIII(objectArray, objectArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8), new IIIIlIllIIIIlllIlllIIIIII(objectArray, objectArray2, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } else if (n8 > 1) { + IIIIlIllIIIIlllIlllIIIIII.invokeAll(new IIIIlIllIIIIlllIlllIIIIII(objectArray, objectArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8)); + } else { + IIIIlIllIIIIlllIlllIIIIII.invokeAll(new IIIIlIllIIIIlllIlllIIIIII(objectArray, objectArray2, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIIllIIIlllIlIIllIIlllll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIIllIIIlllIlIIllIIlllll.java new file mode 100644 index 0000000..43703c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIIllIIIlllIlIIllIIlllll.java @@ -0,0 +1,50 @@ +package com.cheatbreaker.client.util.font; + +import java.util.NoSuchElementException; + +class IIIIllIIIlllIlIIllIIlllll + extends IllIlIllllllIIIIIllIllIlI { + private final Object lIIIIlIIllIIlIIlIIIlIIllI; + private int lIIIIIIIIIlIllIIllIlIIlIl; + + public IIIIllIIIlllIlIIllIIlllll(Object object) { + this.lIIIIlIIllIIlIIlIIIlIIllI = object; + } + + @Override + public boolean hasNext() { + return this.lIIIIIIIIIlIllIIllIlIIlIl == 0; + } + + @Override + public boolean hasPrevious() { + return this.lIIIIIIIIIlIllIIllIlIIlIl == 1; + } + + public Object next() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = 1; + return this.lIIIIlIIllIIlIIlIIIlIIllI; + } + + @Override + public Object previous() { + if (!this.hasPrevious()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = 0; + return this.lIIIIlIIllIIlIIlIIIlIIllI; + } + + @Override + public int nextIndex() { + return this.lIIIIIIIIIlIllIIllIlIIlIl; + } + + @Override + public int previousIndex() { + return this.lIIIIIIIIIlIllIIllIlIIlIl - 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIIlIIlIIIIlIlIllIlIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIIlIIlIIIIlIlIllIlIl.java new file mode 100644 index 0000000..43f583f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIIlIIlIIIIlIlIllIlIl.java @@ -0,0 +1,39 @@ +package com.cheatbreaker.client.util.font; + +public class IIIlIIIlIIlIIIIlIlIllIlIl + extends IllIlIllllllIIIIIllIllIlI { + protected final llllllllllllIlIIIIIIIIlll lIIIIlIIllIIlIIlIIIlIIllI; + + public IIIlIIIlIIlIIIIlIlIllIlIl(llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2) { + this.lIIIIlIIllIIlIIlIIIlIIllI = llllllllllllIlIIIIIIIIlll2; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasNext(); + } + + @Override + public boolean hasPrevious() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasPrevious(); + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.next(); + } + + @Override + public Object previous() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.previous(); + } + + @Override + public int nextIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.nextIndex(); + } + + @Override + public int previousIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.previousIndex(); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIlllIlIIlIIIllIIlIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIlllIlIIlIIIllIIlIII.java new file mode 100644 index 0000000..d183386 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIlllIlIIlIIIllIIlIII.java @@ -0,0 +1,56 @@ +package com.cheatbreaker.client.util.font; + +import java.util.ListIterator; + +class IIIlIIlllIlIIlIIIllIIlIII + extends IllIlIllllllIIIIIllIllIlI { + final ListIterator lIIIIlIIllIIlIIlIIIlIIllI; + + public IIIlIIlllIlIIlIIIllIIlIII(ListIterator listIterator) { + this.lIIIIlIIllIIlIIlIIIlIIllI = listIterator; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasNext(); + } + + @Override + public boolean hasPrevious() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasPrevious(); + } + + @Override + public int nextIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.nextIndex(); + } + + @Override + public int previousIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.previousIndex(); + } + + @Override + public void set(Object object) { + this.lIIIIlIIllIIlIIlIIIlIIllI.set(object); + } + + @Override + public void add(Object object) { + this.lIIIIlIIllIIlIIlIIIlIIllI.add(object); + } + + @Override + public void remove() { + this.lIIIIlIIllIIlIIlIIIlIIllI.remove(); + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.next(); + } + + @Override + public Object previous() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.previous(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIlllllIllIIllIllllIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIlllllIllIIllIllllIl.java new file mode 100644 index 0000000..1816005 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIIlllllIllIIllIllllIl.java @@ -0,0 +1,27 @@ +package com.cheatbreaker.client.util.font; + +class IIIlIIlllllIllIIllIllllIl + extends llIllIIllIllIIlIIIIllIIII + implements ITestClassFive { + private final IllIIIlIIIllIIIlIIIllIIll IllIIIIIIIlIlIllllIIllIII; + final TestClassFour lIIIIlIIllIIlIIlIIIlIIllI; + + private IIIlIIlllllIllIIllIllllIl(TestClassFour testClassFour) { + super(testClassFour, null); + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFour; + this.IllIIIIIIIlIlIllllIIllIII = new IllIIIlIIIllIIIlIIIllIIll(this.lIIIIlIIllIIlIIlIIIlIIllI); + } + + public IllIIIlIIIllIIIlIIIllIIll lIIIIlIIllIIlIIlIIIlIIllI() { + this.IllIIIIIIIlIlIllllIIllIII.lIIIIlIIllIIlIIlIIIlIIllI = this.lIIIIIIIIIlIllIIllIlIIlIl(); + return this.IllIIIIIIIlIlIllllIIllIII; + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } + + IIIlIIlllllIllIIllIllllIl(TestClassFour testClassFour, IlIlIllIIllllIlllIlllIlII ilIlIllIIllllIlllIlllIlII) { + this(testClassFour); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIllIIIlIIIIIIIIIIIlII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIllIIIlIIIIIIIIIIIlII.java new file mode 100644 index 0000000..fc473f7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIllIIIlIIIIIIIIIIIlII.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.util.font; + +import java.util.NoSuchElementException; + +class IIIlIllIIIlIIIIIIIIIIIlII + extends IllIlIllllllIIIIIllIllIlI { + private final Object[] lIIIIlIIllIIlIIlIIIlIIllI; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private int IIIIllIlIIIllIlllIlllllIl; + + public IIIlIllIIIlIIIIIIIIIIIlII(Object[] objectArray, int n, int n2) { + this.lIIIIlIIllIIlIIlIIIlIIllI = objectArray; + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + } + + @Override + public boolean hasNext() { + return this.IIIIllIlIIIllIlllIlllllIl < this.IlllIIIlIlllIllIlIIlllIlI; + } + + @Override + public boolean hasPrevious() { + return this.IIIIllIlIIIllIlllIlllllIl > 0; + } + + public Object next() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } + return this.lIIIIlIIllIIlIIlIIIlIIllI[this.lIIIIIIIIIlIllIIllIlIIlIl + this.IIIIllIlIIIllIlllIlllllIl++]; + } + + @Override + public Object previous() { + if (!this.hasPrevious()) { + throw new NoSuchElementException(); + } + return this.lIIIIlIIllIIlIIlIIIlIIllI[this.lIIIIIIIIIlIllIIllIlIIlIl + --this.IIIIllIlIIIllIlllIlllllIl]; + } + + @Override + public int lIIIIIIIIIlIllIIllIlIIlIl(int n) { + if (n <= this.IlllIIIlIlllIllIlIIlllIlI - this.IIIIllIlIIIllIlllIlllllIl) { + this.IIIIllIlIIIllIlllIlllllIl += n; + return n; + } + n = this.IlllIIIlIlllIllIlIIlllIlI - this.IIIIllIlIIIllIlllIlllllIl; + this.IIIIllIlIIIllIlllIlllllIl = this.IlllIIIlIlllIllIlIIlllIlI; + return n; + } + + @Override + public int lIIIIlIIllIIlIIlIIIlIIllI(int n) { + if (n <= this.IIIIllIlIIIllIlllIlllllIl) { + this.IIIIllIlIIIllIlllIlllllIl -= n; + return n; + } + n = this.IIIIllIlIIIllIlllIlllllIl; + this.IIIIllIlIIIllIlllIlllllIl = 0; + return n; + } + + @Override + public int nextIndex() { + return this.IIIIllIlIIIllIlllIlllllIl; + } + + @Override + public int previousIndex() { + return this.IIIIllIlIIIllIlllIlllllIl - 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIllllllllIllIlIlIIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIllllllllIllIlIlIIIII.java new file mode 100644 index 0000000..6d302ef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIlIllllllllIllIlIlIIIII.java @@ -0,0 +1,26 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +class IIIlIllllllllIllIlIlIIIII + extends lllllIlIIllIllIIIIllIIlIl { + final Iterator lIIIIlIIllIIlIIlIIIlIIllI; + + public IIIlIllllllllIllIlIlIIIII(Iterator iterator) { + this.lIIIIlIIllIIlIIlIIIlIIllI = iterator; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasNext(); + } + + @Override + public void remove() { + this.lIIIIlIIllIIlIIlIIIlIIllI.remove(); + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.next(); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIllIIlIIlIIIIIlIllIIIIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIllIIlIIlIIIIIlIllIIIIl.java new file mode 100644 index 0000000..368636e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIIllIIlIIlIIIIIlIllIIIIl.java @@ -0,0 +1,76 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class IIIllIIlIIlIIIIIlIllIIIIl + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final int[] IIIIllIlIIIllIlllIlllllIl; + private final int[] IIIIllIIllIIIIllIllIIIlIl; + + public IIIllIIlIIlIIIIIlIllIIIIl(int[] nArray, int[] nArray2, int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + this.IIIIllIIllIIIIllIllIIIlIl = nArray2; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + int[] nArray = this.IIIIllIlIIIllIlllIlllllIl; + int[] nArray2 = this.IIIIllIIllIIIIllIllIIIlIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2, n6, n6 + n8, n6 + 2 * n8); + n5 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2, n5 - n8, n5, n5 + n8); + n7 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2, n7 - 2 * n8, n7 - n8, n7); + n5 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2, n6, n5, n7); + int n9 = nArray[n5]; + int n10 = nArray2[n5]; + int n11 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n12 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + int n13; + if (n11 <= n2 && (n = (n13 = Integer.compare(nArray[n11], n9)) == 0 ? Integer.compare(nArray2[n11], n10) : n13) <= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, nArray2, n3++, n11); + } + ++n11; + continue; + } + while (n2 >= n11 && (n = (n13 = Integer.compare(nArray[n2], n9)) == 0 ? Integer.compare(nArray2[n2], n10) : n13) >= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, nArray2, n2, n12--); + } + --n2; + } + if (n11 > n2) break; + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, nArray2, n11++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n11 - n3); + IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, nArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, n11 - n8, n8); + n8 = Math.min(n12 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n12 - 1); + IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, nArray2, n11, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n11 - n3; + n = n12 - n2; + if (n8 > 1 && n > 1) { + IIIllIIlIIlIIIIIlIllIIIIl.invokeAll(new IIIllIIlIIlIIIIIlIllIIIIl(nArray, nArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8), new IIIllIIlIIlIIIIIlIllIIIIl(nArray, nArray2, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } else if (n8 > 1) { + IIIllIIlIIlIIIIIlIllIIIIl.invokeAll(new IIIllIIlIIlIIIIIlIllIIIIl(nArray, nArray2, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8)); + } else { + IIIllIIlIIlIIIIIlIllIIIIl.invokeAll(new IIIllIIlIIlIIIIIlIllIIIIl(nArray, nArray2, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIIIlIIIIIlIllIlIIlllII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIIIlIIIIIlIllIlIIlllII.java new file mode 100644 index 0000000..18c7638 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIIIlIIIIIlIllIlIIlllII.java @@ -0,0 +1,71 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class IIlIIIlIIIIIlIllIlIIlllII + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final int[] IIIIllIlIIIllIlllIlllllIl; + + public IIlIIIlIIIIIlIllIlIIlllII(int[] nArray, int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + int[] nArray = this.IIIIllIlIIIllIlllIlllllIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, n6, n6 + n8, n6 + 2 * n8); + n5 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, n5 - n8, n5, n5 + n8); + n7 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, n7 - 2 * n8, n7 - n8, n7); + n5 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, n6, n5, n7); + int n9 = nArray[n5]; + int n10 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n11 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + if (n10 <= n2 && (n = Integer.compare(nArray[n10], n9)) <= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n3++, n10); + } + ++n10; + continue; + } + while (n2 >= n10 && (n = Integer.compare(nArray[n2], n9)) >= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n2, n11--); + } + --n2; + } + if (n10 > n2) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n10++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n10 - n3); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, n10 - n8, n8); + n8 = Math.min(n11 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n11 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n10, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n10 - n3; + n = n11 - n2; + if (n8 > 1 && n > 1) { + IIlIIIlIIIIIlIllIlIIlllII.invokeAll(new IIlIIIlIIIIIlIllIlIIlllII(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8), new IIlIIIlIIIIIlIllIlIIlllII(nArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } else if (n8 > 1) { + IIlIIIlIIIIIlIllIlIIlllII.invokeAll(new IIlIIIlIIIIIlIllIlIIlllII(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8)); + } else { + IIlIIIlIIIIIlIllIlIIlllII.invokeAll(new IIlIIIlIIIIIlIllIlIIlllII(nArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIIlIIlIlIllIIIIlIIIIIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIIlIIlIlIllIIIIlIIIIIl.java new file mode 100644 index 0000000..8e43587 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIIlIIlIlIllIIIIlIIIIIl.java @@ -0,0 +1,360 @@ +package com.cheatbreaker.client.util.font; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.ListIterator; +import java.util.RandomAccess; + +public class IIlIIlIIlIlIllIIIIlIIIIIl + extends lIIllIIlIIIIIllIlIIllIIIl + implements Serializable, + Cloneable, + RandomAccess { + private static final long IIIIllIIllIIIIllIllIIIlIl = -7046029254386353131L; + public static final int lIIIIlIIllIIlIIlIIIlIIllI = 16; + protected final boolean lIIIIIIIIIlIllIIllIlIIlIl; + protected transient Object[] IlllIIIlIlllIllIlIIlllIlI; + protected int IIIIllIlIIIllIlllIlllllIl; + private static final boolean IlIlIIIlllIIIlIlllIlIllIl = false; + + protected IIlIIlIIlIlIllIIIIlIIIIIl(Object[] objectArray, boolean bl) { + this.IlllIIIlIlllIllIlIIlllIlI = objectArray; + this.lIIIIIIIIIlIllIIllIlIIlIl = true; + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(int n) { + if (n < 0) { + throw new IllegalArgumentException("Initial capacity (" + n + ") is negative"); + } + this.IlllIIIlIlllIllIlIIlllIlI = new Object[n]; + this.lIIIIIIIIIlIllIIllIlIIlIl = false; + } + + public IIlIIlIIlIlIllIIIIlIIIIIl() { + this(16); + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(Collection collection) { + this(collection.size()); + this.IIIIllIlIIIllIlllIlllllIl = lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI(collection.iterator(), this.IlllIIIlIlllIllIlIIlllIlI); + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(ITestClassEight iTestClassEight) { + this(iTestClassEight.size()); + this.IIIIllIlIIIllIlllIlllllIl = lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI((Iterator)iTestClassEight.lIIIIlIIllIIlIIlIIIlIIllI(), this.IlllIIIlIlllIllIlIIlllIlI); + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(lIlllIllIlllIlllIlIIIlIIl lIlllIllIlllIlllIlIIIlIIl2) { + this(lIlllIllIlllIlllIlIIIlIIl2.size()); + this.IIIIllIlIIIllIlllIlllllIl = lIlllIllIlllIlllIlIIIlIIl2.size(); + lIlllIllIlllIlllIlIIIlIIl2.lIIIIIIIIIlIllIIllIlIIlIl(0, this.IlllIIIlIlllIllIlIIlllIlI, 0, this.IIIIllIlIIIllIlllIlllllIl); + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(Object[] objectArray) { + this(objectArray, 0, objectArray.length); + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(Object[] objectArray, int n, int n2) { + this(n2); + System.arraycopy(objectArray, n, this.IlllIIIlIlllIllIlIIlllIlI, 0, n2); + this.IIIIllIlIIIllIlllIlllllIl = n2; + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(Iterator iterator) { + this(); + while (iterator.hasNext()) { + this.add(iterator.next()); + } + } + + public IIlIIlIIlIlIllIIIIlIIIIIl(ITestClassFive iTestClassFive) { + this(); + while (iTestClassFive.hasNext()) { + this.add(iTestClassFive.next()); + } + } + + public Object[] IIIllIllIlIlllllllIlIlIII() { + return this.IlllIIIlIlllIllIlIIlllIlI; + } + + public static IIlIIlIIlIlIllIIIIlIIIIIl lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n) { + if (n > objectArray.length) { + throw new IllegalArgumentException("The specified length (" + n + ") is greater than the array size (" + objectArray.length + ")"); + } + IIlIIlIIlIlIllIIIIlIIIIIl iIlIIlIIlIlIllIIIIlIIIIIl = new IIlIIlIIlIlIllIIIIlIIIIIl(objectArray, false); + iIlIIlIIlIlIllIIIIlIIIIIl.IIIIllIlIIIllIlllIlllllIl = n; + return iIlIIlIIlIlIllIIIIlIIIIIl; + } + + public static IIlIIlIIlIlIllIIIIlIIIIIl lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray) { + return IIlIIlIIlIlIllIIIIlIIIIIl.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray.length); + } + + public void IIIllIllIlIlllllllIlIlIII(int n) { + if (this.lIIIIIIIIIlIllIIllIlIIlIl) { + this.IlllIIIlIlllIllIlIIlllIlI = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(this.IlllIIIlIlllIllIlIIlllIlI, n, this.IIIIllIlIIIllIlllIlllllIl); + } else if (n > this.IlllIIIlIlllIllIlIIlllIlI.length) { + Object[] objectArray = new Object[n]; + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, 0, objectArray, 0, this.IIIIllIlIIIllIlllIlllllIl); + this.IlllIIIlIlllIllIlIIlllIlI = objectArray; + } + } + + private void lIIIIllIIlIlIllIIIlIllIlI(int n) { + if (this.lIIIIIIIIIlIllIIllIlIIlIl) { + this.IlllIIIlIlllIllIlIIlllIlI = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(this.IlllIIIlIlllIllIlIIlllIlI, n, this.IIIIllIlIIIllIlllIlllllIl); + } else if (n > this.IlllIIIlIlllIllIlIIlllIlI.length) { + int n2 = (int)Math.max(Math.min(2L * (long)this.IlllIIIlIlllIllIlIIlllIlI.length, 0x7FFFFFF7L), (long)n); + Object[] objectArray = new Object[n2]; + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, 0, objectArray, 0, this.IIIIllIlIIIllIlllIlllllIl); + this.IlllIIIlIlllIllIlIIlllIlI = objectArray; + } + } + + @Override + public void add(int n, Object object) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + this.lIIIIllIIlIlIllIIIlIllIlI(this.IIIIllIlIIIllIlllIlllllIl + 1); + if (n != this.IIIIllIlIIIllIlllIlllllIl) { + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, n, this.IlllIIIlIlllIllIlIIlllIlI, n + 1, this.IIIIllIlIIIllIlllIlllllIl - n); + } + this.IlllIIIlIlllIllIlIIlllIlI[n] = object; + ++this.IIIIllIlIIIllIlllIlllllIl; + } + + @Override + public boolean add(Object object) { + this.lIIIIllIIlIlIllIIIlIllIlI(this.IIIIllIlIIIllIlllIlllllIl + 1); + this.IlllIIIlIlllIllIlIIlllIlI[this.IIIIllIlIIIllIlllIlllllIl++] = object; + return true; + } + + public Object get(int n) { + if (n >= this.IIIIllIlIIIllIlllIlllllIl) { + throw new IndexOutOfBoundsException("Index (" + n + ") is greater than or equal to list size (" + this.IIIIllIlIIIllIlllIlllllIl + ")"); + } + return this.IlllIIIlIlllIllIlIIlllIlI[n]; + } + + @Override + public int indexOf(Object object) { + for (int i = 0; i < this.IIIIllIlIIIllIlllIlllllIl; ++i) { + if (!(object == null ? this.IlllIIIlIlllIllIlIIlllIlI[i] == null : object.equals(this.IlllIIIlIlllIllIlIIlllIlI[i]))) continue; + return i; + } + return -1; + } + + @Override + public int lastIndexOf(Object object) { + int n = this.IIIIllIlIIIllIlllIlllllIl; + while (n-- != 0) { + if (!(object == null ? this.IlllIIIlIlllIllIlIIlllIlI[n] == null : object.equals(this.IlllIIIlIlllIllIlIIlllIlI[n]))) continue; + return n; + } + return -1; + } + + @Override + public Object remove(int n) { + if (n >= this.IIIIllIlIIIllIlllIlllllIl) { + throw new IndexOutOfBoundsException("Index (" + n + ") is greater than or equal to list size (" + this.IIIIllIlIIIllIlllIlllllIl + ")"); + } + Object object = this.IlllIIIlIlllIllIlIIlllIlI[n]; + --this.IIIIllIlIIIllIlllIlllllIl; + if (n != this.IIIIllIlIIIllIlllIlllllIl) { + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, n + 1, this.IlllIIIlIlllIllIlIIlllIlI, n, this.IIIIllIlIIIllIlllIlllllIl - n); + } + this.IlllIIIlIlllIllIlIIlllIlI[this.IIIIllIlIIIllIlllIlllllIl] = null; + return object; + } + + @Override + public boolean lIIIIIIIIIlIllIIllIlIIlIl(Object object) { + int n = this.indexOf(object); + if (n == -1) { + return false; + } + this.remove(n); + return true; + } + + @Override + public boolean remove(Object object) { + return this.lIIIIIIIIIlIllIIllIlIIlIl(object); + } + + @Override + public Object set(int n, Object object) { + if (n >= this.IIIIllIlIIIllIlllIlllllIl) { + throw new IndexOutOfBoundsException("Index (" + n + ") is greater than or equal to list size (" + this.IIIIllIlIIIllIlllIlllllIl + ")"); + } + Object object2 = this.IlllIIIlIlllIllIlIIlllIlI[n]; + this.IlllIIIlIlllIllIlIIlllIlI[n] = object; + return object2; + } + + @Override + public void clear() { + Arrays.fill(this.IlllIIIlIlllIllIlIIlllIlI, 0, this.IIIIllIlIIIllIlllIlllllIl, null); + this.IIIIllIlIIIllIlllIlllllIl = 0; + } + + @Override + public int size() { + return this.IIIIllIlIIIllIlllIlllllIl; + } + + @Override + public void IlIlIIIlllIIIlIlllIlIllIl(int n) { + if (n > this.IlllIIIlIlllIllIlIIlllIlI.length) { + this.IIIllIllIlIlllllllIlIlIII(n); + } + if (n > this.IIIIllIlIIIllIlllIlllllIl) { + Arrays.fill(this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIlIIIllIlllIlllllIl, n, null); + } else { + Arrays.fill(this.IlllIIIlIlllIllIlIIlllIlI, n, this.IIIIllIlIIIllIlllIlllllIl, null); + } + this.IIIIllIlIIIllIlllIlllllIl = n; + } + + @Override + public boolean isEmpty() { + return this.IIIIllIlIIIllIlllIlllllIl == 0; + } + + public void IllIIIIIIIlIlIllllIIllIII() { + this.IllIIIIIIIlIlIllllIIllIII(0); + } + + public void IllIIIIIIIlIlIllllIIllIII(int n) { + if (n >= this.IlllIIIlIlllIllIlIIlllIlI.length || this.IIIIllIlIIIllIlllIlllllIl == this.IlllIIIlIlllIllIlIIlllIlI.length) { + return; + } + Object[] objectArray = new Object[Math.max(n, this.IIIIllIlIIIllIlllIlllllIl)]; + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, 0, objectArray, 0, this.IIIIllIlIIIllIlllIlllllIl); + this.IlllIIIlIlllIllIlIIlllIlI = objectArray; + } + + @Override + public void lIIIIIIIIIlIllIIllIlIIlIl(int n, Object[] objectArray, int n2, int n3) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n2, n3); + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, n, objectArray, n2, n3); + } + + @Override + public void IlllIIIlIlllIllIlIIlllIlI(int n, int n2) { + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, n, n2); + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, n2, this.IlllIIIlIlllIllIlIIlllIlI, n, this.IIIIllIlIIIllIlllIlllllIl - n2); + this.IIIIllIlIIIllIlllIlllllIl -= n2 - n; + int n3 = n2 - n; + while (n3-- != 0) { + this.IlllIIIlIlllIllIlIIlllIlI[this.IIIIllIlIIIllIlllIlllllIl + n3] = null; + } + } + + @Override + public void lIIIIlIIllIIlIIlIIIlIIllI(int n, Object[] objectArray, int n2, int n3) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n2, n3); + this.lIIIIllIIlIlIllIIIlIllIlI(this.IIIIllIlIIIllIlllIlllllIl + n3); + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, n, this.IlllIIIlIlllIllIlIIlllIlI, n + n3, this.IIIIllIlIIIllIlllIlllllIl - n); + System.arraycopy(objectArray, n2, this.IlllIIIlIlllIllIlIIlllIlI, n, n3); + this.IIIIllIlIIIllIlllIlllllIl += n3; + } + + @Override + public boolean removeAll(Collection collection) { + int n; + Object[] objectArray = this.IlllIIIlIlllIllIlIIlllIlI; + int n2 = 0; + for (n = 0; n < this.IIIIllIlIIIllIlllIlllllIl; n += 1) { + if (collection.contains(objectArray[n])) continue; + objectArray[n2++] = objectArray[n]; + } + Arrays.fill(objectArray, n2, this.IIIIllIlIIIllIlllIlllllIl, null); + n = this.IIIIllIlIIIllIlllIlllllIl != n2 ? 1 : 0; + this.IIIIllIlIIIllIlllIlllllIl = n2; + return n != 0; + } + + @Override + public llllllllllllIlIIIIIIIIlll IIIIllIIllIIIIllIllIIIlIl(int n) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + return new llIIlIlIIIlIlIIlIllllIllI(this, n); + } + + public IIlIIlIIlIlIllIIIIlIIIIIl lIIIIllIIlIlIllIIIlIllIlI() { + IIlIIlIIlIlIllIIIIlIIIIIl iIlIIlIIlIlIllIIIIlIIIIIl = new IIlIIlIIlIlIllIIIIlIIIIIl(this.IIIIllIlIIIllIlllIlllllIl); + System.arraycopy(this.IlllIIIlIlllIllIlIIlllIlI, 0, iIlIIlIIlIlIllIIIIlIIIIIl.IlllIIIlIlllIllIlIIlllIlI, 0, this.IIIIllIlIIIllIlllIlllllIl); + iIlIIlIIlIlIllIIIIlIIIIIl.IIIIllIlIIIllIlllIlllllIl = this.IIIIllIlIIIllIlllIlllllIl; + return iIlIIlIIlIlIllIIIIlIIIIIl; + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI(Object object, Object object2) { + return object == null ? object2 == null : object.equals(object2); + } + + public boolean lIIIIlIIllIIlIIlIIIlIIllI(IIlIIlIIlIlIllIIIIlIIIIIl iIlIIlIIlIlIllIIIIlIIIIIl) { + if (iIlIIlIIlIlIllIIIIlIIIIIl == this) { + return true; + } + int n = this.size(); + if (n != iIlIIlIIlIlIllIIIIlIIIIIl.size()) { + return false; + } + Object[] objectArray = this.IlllIIIlIlllIllIlIIlllIlI; + Object[] objectArray2 = iIlIIlIIlIlIllIIIIlIIIIIl.IlllIIIlIlllIllIlIIlllIlI; + while (n-- != 0) { + if (this.lIIIIlIIllIIlIIlIIIlIIllI(objectArray[n], objectArray2[n])) continue; + return false; + } + return true; + } + + public int lIIIIIIIIIlIllIIllIlIIlIl(IIlIIlIIlIlIllIIIIlIIIIIl iIlIIlIIlIlIllIIIIlIIIIIl) { + int n; + int n2 = this.size(); + int n3 = iIlIIlIIlIlIllIIIIlIIIIIl.size(); + Object[] objectArray = this.IlllIIIlIlllIllIlIIlllIlI; + Object[] objectArray2 = iIlIIlIIlIlIllIIIIlIIIIIl.IlllIIIlIlllIllIlIIlllIlI; + for (n = 0; n < n2 && n < n3; ++n) { + Object object = objectArray[n]; + Object object2 = objectArray2[n]; + int n4 = ((Comparable)object).compareTo(object2); + if (n4 == 0) continue; + return n4; + } + return n < n3 ? -1 : (n < n2 ? 1 : 0); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ObjectOutputStream objectOutputStream) throws IOException { + objectOutputStream.defaultWriteObject(); + for (int i = 0; i < this.IIIIllIlIIIllIlllIlllllIl; ++i) { + objectOutputStream.writeObject(this.IlllIIIlIlllIllIlIIlllIlI[i]); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { + objectInputStream.defaultReadObject(); + this.IlllIIIlIlllIllIlIIlllIlI = new Object[this.IIIIllIlIIIllIlllIlllllIl]; + for (int i = 0; i < this.IIIIllIlIIIllIlllIlllllIl; ++i) { + this.IlllIIIlIlllIllIlIIlllIlI[i] = objectInputStream.readObject(); + } + } + + @Override + public ListIterator listIterator(int n) { + return this.IIIIllIIllIIIIllIllIIIlIl(n); + } + + public Object clone() { + return this.lIIIIllIIlIlIllIIIlIllIlI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIllllIllllllIIllIllIIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIllllIllllllIIllIllIIl.java new file mode 100644 index 0000000..5e6bff3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlIllllIllllllIIllIllIIl.java @@ -0,0 +1,81 @@ +package com.cheatbreaker.client.util.font; + +import java.util.NoSuchElementException; + +class IIlIllllIllllllIIllIllIIl + extends IllIlIllllllIIIIIllIllIlI { + int lIIIIlIIllIIlIIlIIIlIIllI; + int lIIIIIIIIIlIllIIllIlIIlIl; + final int IlllIIIlIlllIllIlIIlllIlI; + final lIIllIIlIIIIIllIlIIllIIIl IIIIllIlIIIllIlllIlllllIl; + + IIlIllllIllllllIIllIllIIl(lIIllIIlIIIIIllIlIIllIIIl lIIllIIlIIIIIllIlIIllIIIl2, int n) { + this.IIIIllIlIIIllIlllIlllllIl = lIIllIIlIIIIIllIlIIllIIIl2; + this.IlllIIIlIlllIllIlIIlllIlI = n; + this.lIIIIlIIllIIlIIlIIIlIIllI = this.IlllIIIlIlllIllIlIIlllIlI; + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI < this.IIIIllIlIIIllIlllIlllllIl.size(); + } + + @Override + public boolean hasPrevious() { + return this.lIIIIlIIllIIlIIlIIIlIIllI > 0; + } + + public Object next() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = this.lIIIIlIIllIIlIIlIIIlIIllI++; + return this.IIIIllIlIIIllIlllIlllllIl.get(this.lIIIIIIIIIlIllIIllIlIIlIl); + } + + @Override + public Object previous() { + if (!this.hasPrevious()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = --this.lIIIIlIIllIIlIIlIIIlIIllI; + return this.IIIIllIlIIIllIlllIlllllIl.get(this.lIIIIlIIllIIlIIlIIIlIIllI); + } + + @Override + public int nextIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI; + } + + @Override + public int previousIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI - 1; + } + + @Override + public void add(Object object) { + this.IIIIllIlIIIllIlllIlllllIl.add(this.lIIIIlIIllIIlIIlIIIlIIllI++, object); + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } + + @Override + public void set(Object object) { + if (this.lIIIIIIIIIlIllIIllIlIIlIl == -1) { + throw new IllegalStateException(); + } + this.IIIIllIlIIIllIlllIlllllIl.set(this.lIIIIIIIIIlIllIIllIlIIlIl, object); + } + + @Override + public void remove() { + if (this.lIIIIIIIIIlIllIIllIlIIlIl == -1) { + throw new IllegalStateException(); + } + this.IIIIllIlIIIllIlllIlllllIl.remove(this.lIIIIIIIIIlIllIIllIlIIlIl); + if (this.lIIIIIIIIIlIllIIllIlIIlIl < this.lIIIIlIIllIIlIIlIIIlIIllI) { + --this.lIIIIlIIllIIlIIlIIIlIIllI; + } + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIIIIlllllIllIIllIllIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIIIIlllllIllIIllIllIl.java new file mode 100644 index 0000000..16fbb06 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIIIIlllllIllIIllIllIl.java @@ -0,0 +1,5 @@ +package com.cheatbreaker.client.util.font; + +public interface IIllIIIIlllllIllIIllIllIl { + public void lIIIIlIIllIIlIIlIIIlIIllI(int var1, int var2); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIlIIIlllllIIllllIllll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIlIIIlllllIIllllIllll.java new file mode 100644 index 0000000..23d0cfc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIlIIIlllllIIllllIllll.java @@ -0,0 +1,74 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Comparator; +import java.util.concurrent.RecursiveAction; + +public class IIllIlIIIlllllIIllllIllll + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final Object[] IIIIllIlIIIllIlllIlllllIl; + private final Comparator IIIIllIIllIIIIllIllIIIlIl; + + public IIllIlIIIlllllIIllllIllll(Object[] objectArray, int n, int n2, Comparator comparator) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIlIIIllIlllIlllllIl = objectArray; + this.IIIIllIIllIIIIllIllIIIlIl = comparator; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + Object[] objectArray = this.IIIIllIlIIIllIlllIlllllIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIIllIIIIllIllIIIlIl); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n6, n6 + n8, n6 + 2 * n8, this.IIIIllIIllIIIIllIllIIIlIl); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n5 - n8, n5, n5 + n8, this.IIIIllIIllIIIIllIllIIIlIl); + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n7 - 2 * n8, n7 - n8, n7, this.IIIIllIIllIIIIllIllIIIlIl); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n6, n5, n7, this.IIIIllIIllIIIIllIllIIIlIl); + Object object = objectArray[n5]; + int n9 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n10 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + if (n9 <= n2 && (n = this.IIIIllIIllIIIIllIllIIIlIl.compare(objectArray[n9], object)) <= 0) { + if (n == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n3++, n9); + } + ++n9; + continue; + } + while (n2 >= n9 && (n = this.IIIIllIIllIIIIllIllIIIlIl.compare(objectArray[n2], object)) >= 0) { + if (n == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n2, n10--); + } + --n2; + } + if (n9 > n2) break; + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n9++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n3); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n8, n8); + n8 = Math.min(n10 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n10 - 1); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n9, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n9 - n3; + n = n10 - n2; + if (n8 > 1 && n > 1) { + IIllIlIIIlllllIIllllIllll.invokeAll(new IIllIlIIIlllllIIllllIllll(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8, this.IIIIllIIllIIIIllIllIIIlIl), new IIllIlIIIlllllIIllllIllll(objectArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIIllIIIIllIllIIIlIl)); + } else if (n8 > 1) { + IIllIlIIIlllllIIllllIllll.invokeAll(new IIllIlIIIlllllIIllllIllll(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8, this.IIIIllIIllIIIIllIllIIIlIl)); + } else { + IIllIlIIIlllllIIllllIllll.invokeAll(new IIllIlIIIlllllIIllllIllll(objectArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIIllIIIIllIllIIIlIl)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIlllIIlllllIllIIIllII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIlllIIlllllIllIIIllII.java new file mode 100644 index 0000000..bde1ebb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIllIlllIIlllllIllIIIllII.java @@ -0,0 +1,73 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class IIllIlllIIlllllIllIIIllII + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final int[] IIIIllIlIIIllIlllIlllllIl; + private final lIlIIIIlIlIlllIlIIllIlIll IIIIllIIllIIIIllIllIIIlIl; + + public IIllIlllIIlllllIllIIIllII(int[] nArray, int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + this.IIIIllIIllIIIIllIllIIIlIl = lIlIIIIlIlIlllIlIIllIlIll2; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + int[] nArray = this.IIIIllIlIIIllIlllIlllllIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIIllIIIIllIllIIIlIl); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n6, n6 + n8, n6 + 2 * n8, this.IIIIllIIllIIIIllIllIIIlIl); + n5 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n5 - n8, n5, n5 + n8, this.IIIIllIIllIIIIllIllIIIlIl); + n7 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n7 - 2 * n8, n7 - n8, n7, this.IIIIllIIllIIIIllIllIIIlIl); + n5 = IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n6, n5, n7, this.IIIIllIIllIIIIllIllIIIlIl); + int n9 = nArray[n5]; + int n10 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n11 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + if (n10 <= n2 && (n = this.IIIIllIIllIIIIllIllIIIlIl.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n10], n9)) <= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n3++, n10); + } + ++n10; + continue; + } + while (n2 >= n10 && (n = this.IIIIllIIllIIIIllIllIIIlIl.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n2], n9)) >= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n2, n11--); + } + --n2; + } + if (n10 > n2) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n10++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n10 - n3); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, n10 - n8, n8); + n8 = Math.min(n11 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n11 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n10, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n10 - n3; + n = n11 - n2; + if (n8 > 1 && n > 1) { + IIllIlllIIlllllIllIIIllII.invokeAll(new IIllIlllIIlllllIllIIIllII(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8, this.IIIIllIIllIIIIllIllIIIlIl), new IIllIlllIIlllllIllIIIllII(nArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIIllIIIIllIllIIIlIl)); + } else if (n8 > 1) { + IIllIlllIIlllllIllIIIllII.invokeAll(new IIllIlllIIlllllIllIIIllII(nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8, this.IIIIllIIllIIIIllIllIIIlIl)); + } else { + IIllIlllIIlllllIllIIIllII.invokeAll(new IIllIlllIIlllllIllIIIllII(nArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIIllIIIIllIllIIIlIl)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlllIllllllIlIIllIIlllII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlllIllllllIlIIllIIlllII.java new file mode 100644 index 0000000..fc0de0c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IIlllIllllllIlIIllIIlllII.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.util.font; + +public abstract class IIlllIllllllIlIIllIIlllII + extends lllllIlIIllIllIIIIllIIlIl + implements llIIIIlllIIIIIIIllIllllll { + protected IIlllIllllllIlIIllIIlllII() { + } + + @Override + public int lIIIIlIIllIIlIIlIIIlIIllI(int n) { + int n2 = n; + while (n2-- != 0 && this.hasPrevious()) { + this.previous(); + } + return n - n2 - 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClass.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClass.java new file mode 100644 index 0000000..a8fddba --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClass.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.util.font; + +// Decompiled with: CFR 0.152 +// Class Version: 8 +public interface ITestClass { + public static final int lIIIIlIIllIIlIIlIIIlIIllI = 16; + public static final float lIIIIIIIIIlIllIIllIlIIlIl = 0.75f; + public static final float IlllIIIlIlllIllIlIIlllIlI = 0.5f; + public static final float IIIIllIlIIIllIlllIlllllIl = 0.25f; + public static final int IIIIllIIllIIIIllIllIIIlIl = 16; + public static final byte IlIlIIIlllIIIlIlllIlIllIl = 0; + public static final byte IIIllIllIlIlllllllIlIlIII = -1; + public static final byte IllIIIIIIIlIlIllllIIllIII = 1; + public static final int[] lIIIIllIIlIlIllIIIlIllIlI = new int[]{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 13, 13, 13, 13, 13, 13, 13, 13, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 31, 31, 31, 31, 31, 31, 31, 43, 43, 43, 43, 43, 43, 43, 43, 61, 61, 61, 61, 61, 73, 73, 73, 73, 73, 73, 73, 103, 103, 109, 109, 109, 109, 109, 139, 139, 151, 151, 151, 151, 181, 181, 193, 199, 199, 199, 229, 241, 241, 241, 271, 283, 283, 313, 313, 313, 349, 349, 349, 349, 421, 433, 463, 463, 463, 523, 523, 571, 601, 619, 661, 661, 661, 661, 661, 823, 859, 883, 883, 883, 1021, 1063, 1093, 1153, 1153, 1231, 1321, 1321, 1429, 1489, 1489, 1621, 1699, 1789, 1873, 1951, 2029, 2131, 2143, 2311, 2383, 2383, 2593, 2731, 2803, 3001, 3121, 3259, 3391, 3583, 3673, 3919, 4093, 4273, 4423, 4651, 4801, 5023, 5281, 5521, 5743, 5881, 6301, 6571, 6871, 7129, 7489, 7759, 8089, 8539, 8863, 9283, 9721, 10141, 10531, 11071, 11551, 12073, 12613, 13009, 13759, 14323, 14869, 15649, 16363, 17029, 17839, 18541, 19471, 20233, 21193, 22159, 23059, 24181, 25171, 26263, 27541, 28753, 30013, 31321, 32719, 34213, 35731, 37309, 38923, 40639, 42463, 44281, 46309, 48313, 50461, 52711, 55051, 57529, 60091, 62299, 65521, 68281, 71413, 74611, 77713, 81373, 84979, 88663, 92671, 96739, 100801, 105529, 109849, 115021, 120079, 125509, 131011, 136861, 142873, 149251, 155863, 162751, 169891, 177433, 185071, 193381, 202129, 211063, 220021, 229981, 240349, 250969, 262111, 273643, 285841, 298411, 311713, 325543, 339841, 355009, 370663, 386989, 404269, 422113, 440809, 460081, 480463, 501829, 524221, 547399, 571603, 596929, 623353, 651019, 679909, 709741, 741343, 774133, 808441, 844201, 881539, 920743, 961531, 1004119, 1048573, 1094923, 1143283, 1193911, 1246963, 1302181, 1359733, 1420039, 1482853, 1548541, 1616899, 1688413, 1763431, 1841293, 1922773, 2008081, 2097133, 2189989, 2286883, 2388163, 2493853, 2604013, 2719669, 2840041, 2965603, 3097123, 3234241, 3377191, 3526933, 3682363, 3845983, 4016041, 4193803, 4379719, 4573873, 4776223, 4987891, 5208523, 5439223, 5680153, 5931313, 6194191, 6468463, 6754879, 7053331, 7366069, 7692343, 8032639, 8388451, 8759953, 9147661, 9552733, 9975193, 10417291, 10878619, 11360203, 11863153, 12387841, 12936529, 13509343, 14107801, 14732413, 15384673, 16065559, 0xFFFFB5, 17519893, 18295633, 19105483, 19951231, 20834689, 21757291, 22720591, 23726449, 24776953, 25873963, 27018853, 28215619, 29464579, 30769093, 32131711, 33554011, 35039911, 36591211, 38211163, 39903121, 41669479, 43514521, 45441199, 47452879, 49553941, 51747991, 54039079, 56431513, 58930021, 61539091, 64263571, 0x3FFFF3D, 70079959, 73182409, 76422793, 79806229, 83339383, 87029053, 90881083, 94906249, 99108043, 103495879, 108077731, 112863013, 117860053, 123078019, 128526943, 134217439, 140159911, 146365159, 152845393, 159612601, 166679173, 174058849, 181765093, 189812341, 198216103, 206991601, 216156043, 225726379, 235720159, 246156271, 257054491, 268435009, 280319203, 292730833, 305691181, 319225021, 333358513, 348117151, 363529759, 379624279, 396432481, 413983771, 432312511, 451452613, 471440161, 492312523, 514109251, 536870839, 560640001, 585461743, 611382451, 638450569, 666717199, 696235363, 727060069, 759249643, 792864871, 827967631, 864625033, 902905501, 942880663, 984625531, 1028218189, 1073741719, 1121280091, 1170923713, 1222764841, 1276901371, 1333434301, 1392470281, 1454120779, 1518500173, 1585729993, 1655935399, 1729249999, 1805811253, 1885761133, 1969251079, 2056437379, 2147482951}; +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassEight.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassEight.java new file mode 100644 index 0000000..765b592 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassEight.java @@ -0,0 +1,21 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Collection; +import java.util.Iterator; + +public interface ITestClassEight + extends ITestClassNine, + Collection { + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(); + + @Deprecated + public ITestClassFive IlllIIIlIlllIllIlIIlllIlI(); + + public Object[] toArray(Object[] var1); + + @Override + default public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassFive.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassFive.java new file mode 100644 index 0000000..01afdc5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassFive.java @@ -0,0 +1,8 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +public interface ITestClassFive + extends Iterator { + public int lIIIIIIIIIlIllIIllIlIIlIl(int var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassFour.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassFour.java new file mode 100644 index 0000000..8f77826 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassFour.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +public interface ITestClassFour + extends Map, + ITestClassThree { + public ITestClassSeven IIIIllIlIIIllIlllIlllllIl(); + + public ITestClassSeven IIIIllIIllIIIIllIllIIIlIl(); + + public ITestClassSeven lIIIIIIIIIlIllIIllIlIIlIl(); + + public ITestClassEight IlllIIIlIlllIllIlIIlllIlI(); + + default public Set entrySet() { + return this.IIIIllIlIIIllIlllIlllllIl(); + } + + default public Collection values() { + return this.IlllIIIlIlllIllIlIIlllIlI(); + } + + default public Set keySet() { + return this.lIIIIIIIIIlIllIIllIlIIlIl(); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassNine.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassNine.java new file mode 100644 index 0000000..cd74733 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassNine.java @@ -0,0 +1,12 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +public interface ITestClassNine + extends Iterable { + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(); + + default public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassSeven.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassSeven.java new file mode 100644 index 0000000..671b1ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassSeven.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; +import java.util.Set; + +public interface ITestClassSeven + extends ITestClassEight, + Set { + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(); + + @Override + public boolean remove(Object var1); + + @Override + default public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassSix.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassSix.java new file mode 100644 index 0000000..4a3cf35 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassSix.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.util.font; + +public interface ITestClassSix + extends ITestClassSeven { + public ITestClassFive lIIIIIIIIIlIllIIllIlIIlIl(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassThree.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassThree.java new file mode 100644 index 0000000..a50e843 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassThree.java @@ -0,0 +1,8 @@ +package com.cheatbreaker.client.util.font; + +public interface ITestClassThree + extends ITestClassTwo { + public void lIIIIlIIllIIlIIlIIIlIIllI(Object var1); + + public Object lIIIIlIIllIIlIIlIIIlIIllI(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassTwo.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassTwo.java new file mode 100644 index 0000000..f79635d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/ITestClassTwo.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.util.font; + +public interface ITestClassTwo { + public Object put(Object var1, Object var2); + + public Object get(Object var1); + + public boolean containsKey(Object var1); + + public Object remove(Object var1); + + public int size(); + + public void clear(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIIlIlIlIIlllIIIllIIIlII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIIlIlIlIIlllIIIllIIIlII.java new file mode 100644 index 0000000..af1e4ab --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIIlIlIlIIlllIIIllIIIlII.java @@ -0,0 +1,784 @@ +package com.cheatbreaker.client.util.font; + +import java.lang.reflect.Array; +import java.util.Comparator; +import java.util.Random; +import java.util.concurrent.ForkJoinPool; + +public class IlIIlIlIlIIlllIIIllIIIlII { + public static final Object[] lIIIIlIIllIIlIIlIIIlIIllI = new Object[0]; + private static final int IlllIIIlIlllIllIlIIlllIlI = 16; + private static final int IIIIllIlIIIllIlllIlllllIl = 8192; + private static final int IIIIllIIllIIIIllIllIIIlIl = 128; + private static final int IlIlIIIlllIIIlIlllIlIllIl = 16; + public static final lllIIIIIIllIlllIlIIlIlIll lIIIIIIIIIlIllIIllIlIIlIl = new IlllllIlIIIIllIIIlIlIlIII(null); + + private IlIIlIlIlIIlllIIIllIIIlII() { + } + + private static Object[] IIIIllIIllIIIIllIllIIIlIl(Object[] objectArray, int n) { + Class clazz = objectArray.getClass(); + if (clazz == Object[].class) { + return n == 0 ? lIIIIlIIllIIlIIlIIIlIIllI : new Object[n]; + } + return (Object[])Array.newInstance(clazz.getComponentType(), n); + } + + public static Object[] lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n) { + if (n > objectArray.length) { + Object[] objectArray2 = IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n); + System.arraycopy(objectArray, 0, objectArray2, 0, objectArray.length); + return objectArray2; + } + return objectArray; + } + + public static Object[] lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2) { + if (n > objectArray.length) { + Object[] objectArray2 = IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n); + System.arraycopy(objectArray, 0, objectArray2, 0, n2); + return objectArray2; + } + return objectArray; + } + + public static Object[] lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, int n) { + if (n > objectArray.length) { + int n2 = (int)Math.max(Math.min(2L * (long)objectArray.length, 0x7FFFFFF7L), (long)n); + Object[] objectArray2 = IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n2); + System.arraycopy(objectArray, 0, objectArray2, 0, objectArray.length); + return objectArray2; + } + return objectArray; + } + + public static Object[] lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, int n, int n2) { + if (n > objectArray.length) { + int n3 = (int)Math.max(Math.min(2L * (long)objectArray.length, 0x7FFFFFF7L), (long)n); + Object[] objectArray2 = IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n3); + System.arraycopy(objectArray, 0, objectArray2, 0, n2); + return objectArray2; + } + return objectArray; + } + + public static Object[] IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, int n) { + if (n >= objectArray.length) { + return objectArray; + } + Object[] objectArray2 = IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n); + System.arraycopy(objectArray, 0, objectArray2, 0, n); + return objectArray2; + } + + public static Object[] IIIIllIlIIIllIlllIlllllIl(Object[] objectArray, int n) { + if (n == objectArray.length) { + return objectArray; + } + if (n < objectArray.length) { + return IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, n); + } + return IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n); + } + + public static Object[] IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, int n, int n2) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n, n2); + Object[] objectArray2 = IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n2); + System.arraycopy(objectArray, n, objectArray2, 0, n2); + return objectArray2; + } + + public static Object[] lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray) { + return (Object[])objectArray.clone(); + } + + @Deprecated + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Object object) { + int n = objectArray.length; + while (n-- != 0) { + objectArray[n] = object; + } + } + + @Deprecated + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, Object object) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, n, n2); + if (n == 0) { + while (n2-- != 0) { + objectArray[n2] = object; + } + } else { + for (int i = n; i < n2; ++i) { + objectArray[i] = object; + } + } + } + + @Deprecated + public static boolean lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Object[] objectArray2) { + int n = objectArray.length; + if (n != objectArray2.length) { + return false; + } + while (n-- != 0) { + if (objectArray[n] != null ? objectArray[n].equals(objectArray2[n]) : objectArray2[n] == null) continue; + return false; + } + return true; + } + + public static void IIIIllIlIIIllIlllIlllllIl(Object[] objectArray, int n, int n2) { + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray.length, n, n2); + } + + public static void IIIIllIIllIIIIllIllIIIlIl(Object[] objectArray, int n, int n2) { + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray.length, n, n2); + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, Object[] objectArray2) { + if (objectArray.length != objectArray2.length) { + throw new IllegalArgumentException("Array size mismatch: " + objectArray.length + " != " + objectArray2.length); + } + } + + public static void IlIlIIIlllIIIlIlllIlIllIl(Object[] objectArray, int n, int n2) { + Object object = objectArray[n]; + objectArray[n] = objectArray[n2]; + objectArray[n2] = object; + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, int n3) { + int n4 = 0; + while (n4 < n3) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n, n2); + ++n4; + ++n; + ++n2; + } + } + + private static int lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, int n, int n2, int n3, Comparator comparator) { + int n4 = comparator.compare(objectArray[n], objectArray[n2]); + int n5 = comparator.compare(objectArray[n], objectArray[n3]); + int n6 = comparator.compare(objectArray[n2], objectArray[n3]); + return n4 < 0 ? (n6 < 0 ? n2 : (n5 < 0 ? n3 : n)) : (n6 > 0 ? n2 : (n5 > 0 ? n3 : n)); + } + + private static void IIIIllIlIIIllIlllIlllllIl(Object[] objectArray, int n, int n2, Comparator comparator) { + for (int i = n; i < n2 - 1; ++i) { + int n3 = i; + for (int j = i + 1; j < n2; ++j) { + if (comparator.compare(objectArray[j], objectArray[n3]) >= 0) continue; + n3 = j; + } + if (n3 == i) continue; + Object object = objectArray[i]; + objectArray[i] = objectArray[n3]; + objectArray[n3] = object; + } + } + + private static void IIIIllIIllIIIIllIllIIIlIl(Object[] objectArray, int n, int n2, Comparator comparator) { + int n3 = n; + while (++n3 < n2) { + Object object = objectArray[n3]; + int n4 = n3; + Object object2 = objectArray[n4 - 1]; + while (comparator.compare(object, object2) < 0) { + objectArray[n4] = object2; + if (n == n4 - 1) { + --n4; + break; + } + object2 = objectArray[--n4 - 1]; + } + objectArray[n4] = object; + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, Comparator comparator) { + int n3; + int n4; + int n5; + int n6 = n2 - n; + if (n6 < 16) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, n, n2, comparator); + return; + } + int n7 = n + n6 / 2; + int n8 = n; + int n9 = n2 - 1; + if (n6 > 128) { + int n10 = n6 / 8; + n8 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n8, n8 + n10, n8 + 2 * n10, comparator); + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n7 - n10, n7, n7 + n10, comparator); + n9 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n9 - 2 * n10, n9 - n10, n9, comparator); + } + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n8, n7, n9, comparator); + Object object = objectArray[n7]; + int n11 = n5 = n; + int n12 = n4 = n2 - 1; + while (true) { + if (n11 <= n4 && (n3 = comparator.compare(objectArray[n11], object)) <= 0) { + if (n3 == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n5++, n11); + } + ++n11; + continue; + } + while (n4 >= n11 && (n3 = comparator.compare(objectArray[n4], object)) >= 0) { + if (n3 == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n4, n12--); + } + --n4; + } + if (n11 > n4) break; + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n11++, n4--); + } + n3 = Math.min(n5 - n, n11 - n5); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n, n11 - n3, n3); + n3 = Math.min(n12 - n4, n2 - n12 - 1); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n11, n2 - n3, n3); + n3 = n11 - n5; + if (n3 > 1) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n, n + n3, comparator); + } + if ((n3 = n12 - n4) > 1) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n2 - n3, n2, comparator); + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Comparator comparator) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, 0, objectArray.length, comparator); + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, int n, int n2, Comparator comparator) { + if (n2 - n < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n, n2, comparator); + } else { + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new IIllIlIIIlllllIIllllIllll(objectArray, n, n2, comparator)); + forkJoinPool.shutdown(); + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, Comparator comparator) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, 0, objectArray.length, comparator); + } + + private static int IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, int n, int n2, int n3) { + int n4 = ((Comparable)objectArray[n]).compareTo(objectArray[n2]); + int n5 = ((Comparable)objectArray[n]).compareTo(objectArray[n3]); + int n6 = ((Comparable)objectArray[n2]).compareTo(objectArray[n3]); + return n4 < 0 ? (n6 < 0 ? n2 : (n5 < 0 ? n3 : n)) : (n6 > 0 ? n2 : (n5 > 0 ? n3 : n)); + } + + private static void IlIlllIIIIllIllllIllIIlIl(Object[] objectArray, int n, int n2) { + for (int i = n; i < n2 - 1; ++i) { + int n3 = i; + for (int j = i + 1; j < n2; ++j) { + if (((Comparable)objectArray[j]).compareTo(objectArray[n3]) >= 0) continue; + n3 = j; + } + if (n3 == i) continue; + Object object = objectArray[i]; + objectArray[i] = objectArray[n3]; + objectArray[n3] = object; + } + } + + private static void llIIlllIIIIlllIllIlIlllIl(Object[] objectArray, int n, int n2) { + int n3 = n; + while (++n3 < n2) { + Object object = objectArray[n3]; + int n4 = n3; + Object object2 = objectArray[n4 - 1]; + while (((Comparable)object).compareTo(object2) < 0) { + objectArray[n4] = object2; + if (n == n4 - 1) { + --n4; + break; + } + object2 = objectArray[--n4 - 1]; + } + objectArray[n4] = object; + } + } + + public static void IIIllIllIlIlllllllIlIlIII(Object[] objectArray, int n, int n2) { + int n3; + int n4; + int n5; + int n6 = n2 - n; + if (n6 < 16) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlllIIIIllIllllIllIIlIl(objectArray, n, n2); + return; + } + int n7 = n + n6 / 2; + int n8 = n; + int n9 = n2 - 1; + if (n6 > 128) { + int n10 = n6 / 8; + n8 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, n8, n8 + n10, n8 + 2 * n10); + n7 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, n7 - n10, n7, n7 + n10); + n9 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, n9 - 2 * n10, n9 - n10, n9); + } + n7 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, n8, n7, n9); + Object object = objectArray[n7]; + int n11 = n5 = n; + int n12 = n4 = n2 - 1; + while (true) { + if (n11 <= n4 && (n3 = ((Comparable)objectArray[n11]).compareTo(object)) <= 0) { + if (n3 == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n5++, n11); + } + ++n11; + continue; + } + while (n4 >= n11 && (n3 = ((Comparable)objectArray[n4]).compareTo(object)) >= 0) { + if (n3 == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n4, n12--); + } + --n4; + } + if (n11 > n4) break; + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n11++, n4--); + } + n3 = Math.min(n5 - n, n11 - n5); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n, n11 - n3, n3); + n3 = Math.min(n12 - n4, n2 - n12 - 1); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n11, n2 - n3, n3); + n3 = n11 - n5; + if (n3 > 1) { + IlIIlIlIlIIlllIIIllIIIlII.IIIllIllIlIlllllllIlIlIII(objectArray, n, n + n3); + } + if ((n3 = n12 - n4) > 1) { + IlIIlIlIlIIlllIIIllIIIlII.IIIllIllIlIlllllllIlIlIII(objectArray, n2 - n3, n2); + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray) { + IlIIlIlIlIIlllIIIllIIIlII.IIIllIllIlIlllllllIlIlIII(objectArray, 0, objectArray.length); + } + + public static void IllIIIIIIIlIlIllllIIllIII(Object[] objectArray, int n, int n2) { + if (n2 - n < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.IIIllIllIlIlllllllIlIlIII(objectArray, n, n2); + } else { + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new lllllllIllIIlIlIlIllIIlII(objectArray, n, n2)); + forkJoinPool.shutdown(); + } + } + + public static void IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray) { + IlIIlIlIlIIlllIIIllIIIlII.IllIIIIIIIlIlIllllIIllIII(objectArray, 0, objectArray.length); + } + + private static int lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, Object[] objectArray, int n, int n2, int n3) { + Object object = objectArray[nArray[n]]; + Object object2 = objectArray[nArray[n2]]; + Object object3 = objectArray[nArray[n3]]; + int n4 = ((Comparable)object).compareTo(object2); + int n5 = ((Comparable)object).compareTo(object3); + int n6 = ((Comparable)object2).compareTo(object3); + return n4 < 0 ? (n6 < 0 ? n2 : (n5 < 0 ? n3 : n)) : (n6 > 0 ? n2 : (n5 > 0 ? n3 : n)); + } + + private static void IIIIllIlIIIllIlllIlllllIl(int[] nArray, Object[] objectArray, int n, int n2) { + int n3 = n; + while (++n3 < n2) { + int n4 = nArray[n3]; + int n5 = n3; + int n6 = nArray[n5 - 1]; + while (((Comparable)objectArray[n4]).compareTo(objectArray[n6]) < 0) { + nArray[n5] = n6; + if (n == n5 - 1) { + --n5; + break; + } + n6 = nArray[--n5 - 1]; + } + nArray[n5] = n4; + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, Object[] objectArray, int n, int n2) { + int n3; + int n4; + int n5; + int n6 = n2 - n; + if (n6 < 16) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(nArray, objectArray, n, n2); + return; + } + int n7 = n + n6 / 2; + int n8 = n; + int n9 = n2 - 1; + if (n6 > 128) { + int n10 = n6 / 8; + n8 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(nArray, objectArray, n8, n8 + n10, n8 + 2 * n10); + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(nArray, objectArray, n7 - n10, n7, n7 + n10); + n9 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(nArray, objectArray, n9 - 2 * n10, n9 - n10, n9); + } + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(nArray, objectArray, n8, n7, n9); + Object object = objectArray[nArray[n7]]; + int n11 = n5 = n; + int n12 = n4 = n2 - 1; + while (true) { + if (n11 <= n4 && (n3 = ((Comparable)objectArray[nArray[n11]]).compareTo(object)) <= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n5++, n11); + } + ++n11; + continue; + } + while (n4 >= n11 && (n3 = ((Comparable)objectArray[nArray[n4]]).compareTo(object)) >= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n4, n12--); + } + --n4; + } + if (n11 > n4) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n11++, n4--); + } + n3 = Math.min(n5 - n, n11 - n5); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n, n11 - n3, n3); + n3 = Math.min(n12 - n4, n2 - n12 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n11, n2 - n3, n3); + n3 = n11 - n5; + if (n3 > 1) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(nArray, objectArray, n, n + n3); + } + if ((n3 = n12 - n4) > 1) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(nArray, objectArray, n2 - n3, n2); + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, Object[] objectArray) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(nArray, objectArray, 0, objectArray.length); + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, Object[] objectArray, int n, int n2) { + if (n2 - n < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(nArray, objectArray, n, n2); + } else { + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new IlIlIIlIllllIllIIlIlIllII(nArray, objectArray, n, n2)); + forkJoinPool.shutdown(); + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, Object[] objectArray) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(nArray, objectArray, 0, objectArray.length); + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray, Object[] objectArray, int n, int n2) { + int n3 = n; + for (int i = n + 1; i < n2; ++i) { + if (objectArray[nArray[i]] == objectArray[nArray[n3]]) continue; + if (i - n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, n3, i); + } + n3 = i; + } + if (n2 - n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, n3, n2); + } + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray, Object[] objectArray) { + IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(nArray, objectArray, 0, nArray.length); + } + + private static int IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, Object[] objectArray2, int n, int n2, int n3) { + int n4; + int n5 = ((Comparable)objectArray[n]).compareTo(objectArray[n2]); + int n6 = n5 == 0 ? ((Comparable)objectArray2[n]).compareTo(objectArray2[n2]) : n5; + n5 = ((Comparable)objectArray[n]).compareTo(objectArray[n3]); + int n7 = n5 == 0 ? ((Comparable)objectArray2[n]).compareTo(objectArray2[n3]) : n5; + n5 = ((Comparable)objectArray[n2]).compareTo(objectArray[n3]); + int n8 = n4 = n5 == 0 ? ((Comparable)objectArray2[n2]).compareTo(objectArray2[n3]) : n5; + return n6 < 0 ? (n4 < 0 ? n2 : (n7 < 0 ? n3 : n)) : (n4 > 0 ? n2 : (n7 > 0 ? n3 : n)); + } + + private static void IIIIllIlIIIllIlllIlllllIl(Object[] objectArray, Object[] objectArray2, int n, int n2) { + Object object = objectArray[n]; + Object object2 = objectArray2[n]; + objectArray[n] = objectArray[n2]; + objectArray2[n] = objectArray2[n2]; + objectArray[n2] = object; + objectArray2[n2] = object2; + } + + private static void IIIIllIlIIIllIlllIlllllIl(Object[] objectArray, Object[] objectArray2, int n, int n2, int n3) { + int n4 = 0; + while (n4 < n3) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n, n2); + ++n4; + ++n; + ++n2; + } + } + + private static void IIIIllIIllIIIIllIllIIIlIl(Object[] objectArray, Object[] objectArray2, int n, int n2) { + for (int i = n; i < n2 - 1; ++i) { + int n3 = i; + for (int j = i + 1; j < n2; ++j) { + int n4 = ((Comparable)objectArray[j]).compareTo(objectArray[n3]); + if (n4 >= 0 && (n4 != 0 || ((Comparable)objectArray2[j]).compareTo(objectArray2[n3]) >= 0)) continue; + n3 = j; + } + if (n3 == i) continue; + Object object = objectArray[i]; + objectArray[i] = objectArray[n3]; + objectArray[n3] = object; + object = objectArray2[i]; + objectArray2[i] = objectArray2[n3]; + objectArray2[n3] = object; + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Object[] objectArray2, int n, int n2) { + int n3; + int n4; + int n5; + int n6 = n2 - n; + if (n6 < 16) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, objectArray2, n, n2); + return; + } + int n7 = n + n6 / 2; + int n8 = n; + int n9 = n2 - 1; + if (n6 > 128) { + int n10 = n6 / 8; + n8 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n8, n8 + n10, n8 + 2 * n10); + n7 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n7 - n10, n7, n7 + n10); + n9 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n9 - 2 * n10, n9 - n10, n9); + } + n7 = IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n8, n7, n9); + Object object = objectArray[n7]; + Object object2 = objectArray2[n7]; + int n11 = n5 = n; + int n12 = n4 = n2 - 1; + while (true) { + int n13; + if (n11 <= n4 && (n3 = (n13 = ((Comparable)objectArray[n11]).compareTo(object)) == 0 ? ((Comparable)objectArray2[n11]).compareTo(object2) : n13) <= 0) { + if (n3 == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n5++, n11); + } + ++n11; + continue; + } + while (n4 >= n11 && (n3 = (n13 = ((Comparable)objectArray[n4]).compareTo(object)) == 0 ? ((Comparable)objectArray2[n4]).compareTo(object2) : n13) >= 0) { + if (n3 == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n4, n12--); + } + --n4; + } + if (n11 > n4) break; + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n11++, n4--); + } + n3 = Math.min(n5 - n, n11 - n5); + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n, n11 - n3, n3); + n3 = Math.min(n12 - n4, n2 - n12 - 1); + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n11, n2 - n3, n3); + n3 = n11 - n5; + if (n3 > 1) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, n, n + n3); + } + if ((n3 = n12 - n4) > 1) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, n2 - n3, n2); + } + } + + public static void IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, Object[] objectArray2) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, objectArray2); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, 0, objectArray.length); + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, Object[] objectArray2, int n, int n2) { + if (n2 - n < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, objectArray2, n, n2); + } + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new IIIIlIllIIIIlllIlllIIIIII(objectArray, objectArray2, n, n2)); + forkJoinPool.shutdown(); + } + + public static void IIIIllIlIIIllIlllIlllllIl(Object[] objectArray, Object[] objectArray2) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, objectArray2); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, objectArray2, 0, objectArray.length); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, Object[] objectArray2) { + int n3 = n2 - n; + if (n3 < 16) { + IlIIlIlIlIIlllIIIllIIIlII.llIIlllIIIIlllIllIlIlllIl(objectArray, n, n2); + return; + } + int n4 = n + n2 >>> 1; + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray2, n, n4, objectArray); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray2, n4, n2, objectArray); + if (((Comparable)objectArray2[n4 - 1]).compareTo(objectArray2[n4]) <= 0) { + System.arraycopy(objectArray2, n, objectArray, n, n3); + return; + } + int n5 = n; + int n6 = n4; + for (int i = n; i < n2; ++i) { + objectArray[i] = n6 >= n2 || n5 < n4 && ((Comparable)objectArray2[n5]).compareTo(objectArray2[n6]) <= 0 ? objectArray2[n5++] : objectArray2[n6++]; + } + } + + public static void lIIIIllIIlIlIllIIIlIllIlI(Object[] objectArray, int n, int n2) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n, n2, (Object[])objectArray.clone()); + } + + public static void IIIIllIlIIIllIlllIlllllIl(Object[] objectArray) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIllIIlIlIllIIIlIllIlI(objectArray, 0, objectArray.length); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, Comparator comparator, Object[] objectArray2) { + int n3 = n2 - n; + if (n3 < 16) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n, n2, comparator); + return; + } + int n4 = n + n2 >>> 1; + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray2, n, n4, comparator, objectArray); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray2, n4, n2, comparator, objectArray); + if (comparator.compare(objectArray2[n4 - 1], objectArray2[n4]) <= 0) { + System.arraycopy(objectArray2, n, objectArray, n, n3); + return; + } + int n5 = n; + int n6 = n4; + for (int i = n; i < n2; ++i) { + objectArray[i] = n6 >= n2 || n5 < n4 && comparator.compare(objectArray2[n5], objectArray2[n6]) <= 0 ? objectArray2[n5++] : objectArray2[n6++]; + } + } + + public static void IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, int n, int n2, Comparator comparator) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n, n2, comparator, (Object[])objectArray.clone()); + } + + public static void IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, Comparator comparator) { + IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, 0, objectArray.length, comparator); + } + + public static int lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, int n, int n2, Object object) { + --n2; + while (n <= n2) { + int n3 = n + n2 >>> 1; + Object object2 = objectArray[n3]; + int n4 = ((Comparable)object2).compareTo(object); + if (n4 < 0) { + n = n3 + 1; + continue; + } + if (n4 > 0) { + n2 = n3 - 1; + continue; + } + return n3; + } + return -(n + 1); + } + + public static int lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, Object object) { + return IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, 0, objectArray.length, object); + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, Object object, Comparator comparator) { + --n2; + while (n <= n2) { + int n3 = n + n2 >>> 1; + Object object2 = objectArray[n3]; + int n4 = comparator.compare(object2, object); + if (n4 < 0) { + n = n3 + 1; + continue; + } + if (n4 > 0) { + n2 = n3 - 1; + continue; + } + return n3; + } + return -(n + 1); + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Object object, Comparator comparator) { + return IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, 0, objectArray.length, object, comparator); + } + + public static Object[] lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, Random random) { + int n3 = n2 - n; + while (n3-- != 0) { + int n4 = random.nextInt(n3 + 1); + Object object = objectArray[n + n3]; + objectArray[n + n3] = objectArray[n + n4]; + objectArray[n + n4] = object; + } + return objectArray; + } + + public static Object[] lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Random random) { + int n = objectArray.length; + while (n-- != 0) { + int n2 = random.nextInt(n + 1); + Object object = objectArray[n]; + objectArray[n] = objectArray[n2]; + objectArray[n2] = object; + } + return objectArray; + } + + public static Object[] IIIIllIIllIIIIllIllIIIlIl(Object[] objectArray) { + int n = objectArray.length; + int n2 = n / 2; + while (n2-- != 0) { + Object object = objectArray[n - n2 - 1]; + objectArray[n - n2 - 1] = objectArray[n2]; + objectArray[n2] = object; + } + return objectArray; + } + + public static Object[] IlllIllIlIIIIlIIlIIllIIIl(Object[] objectArray, int n, int n2) { + int n3 = n2 - n; + int n4 = n3 / 2; + while (n4-- != 0) { + Object object = objectArray[n + n3 - n4 - 1]; + objectArray[n + n3 - n4 - 1] = objectArray[n + n4]; + objectArray[n + n4] = object; + } + return objectArray; + } + + static int lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2, int n3, Comparator comparator) { + return IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n, n2, n3, comparator); + } + + static int lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, int n, int n2, int n3) { + return IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, n, n2, n3); + } + + static int lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, Object[] objectArray, int n, int n2, int n3) { + return IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(nArray, objectArray, n, n2, n3); + } + + static int lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Object[] objectArray2, int n, int n2, int n3) { + return IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, objectArray2, n, n2, n3); + } + + static void IlllIIIlIlllIllIlIIlllIlI(Object[] objectArray, Object[] objectArray2, int n, int n2) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n, n2); + } + + static void lIIIIIIIIIlIllIIllIlIIlIl(Object[] objectArray, Object[] objectArray2, int n, int n2, int n3) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIlIIIllIlllIlllllIl(objectArray, objectArray2, n, n2, n3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIIllllIIllllIIllIIlIIlI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIIllllIIllllIIllIIlIIlI.java new file mode 100644 index 0000000..e60a510 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIIllllIIllllIIllIIlIIlI.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.util.font; + +final class IlIIllllIIllllIIllIIlIIlI + extends llIllIIllIllIIlIIIIllIIII + implements ITestClassFive { + final TestClassFour lIIIIlIIllIIlIIlIIIlIIllI; + + public IlIIllllIIllllIIllIIlIIlI(TestClassFour testClassFour) { + super(testClassFour, null); + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFour; + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.IlllIllIlIIIIlIIlIIllIIIl[this.lIIIIIIIIIlIllIIllIlIIlIl()]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIIIIIIlIIllIIIIllIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIIIIIIlIIllIIIIllIII.java new file mode 100644 index 0000000..287f9a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIIIIIIlIIllIIIIllIII.java @@ -0,0 +1,26 @@ +package com.cheatbreaker.client.util.font; + +class IlIlIIIIIIIlIIllIIIIllIII + extends lllllIlIIllIllIIIIllIIlIl { + final ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI; + final TestClassEleven lIIIIIIIIIlIllIIllIlIIlIl; + + IlIlIIIIIIIlIIllIIIIllIII(TestClassEleven testClassEleven) { + this.lIIIIIIIIIlIllIIllIlIIlIl = testClassEleven; + this.lIIIIlIIllIIlIIlIIIlIIllI = this.lIIIIIIIIIlIllIIllIlIIlIl.lIIIIlIIllIIlIIlIIIlIIllI.IIIIllIlIIIllIlllIlllllIl().lIIIIlIIllIIlIIlIIIlIIllI(); + } + + public Object next() { + return ((llIlIlIlIIlIIllIllIIlllIl)this.lIIIIlIIllIIlIIlIIIlIIllI.next()).getKey(); + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasNext(); + } + + @Override + public void remove() { + this.lIIIIlIIllIIlIIlIIIlIIllI.remove(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIlIIlllIlIlllIIlIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIlIIlllIlIlllIIlIIII.java new file mode 100644 index 0000000..6222e44 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIlIIlllIlIlllIIlIIII.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.util.font; + +class IlIlIIlIIlllIlIlllIIlIIII + extends llIllIIllIllIIlIIIIllIIII + implements ITestClassFive { + private IllIIIlIIIllIIIlIIIllIIll IllIIIIIIIlIlIllllIIllIII; + final TestClassFour lIIIIlIIllIIlIIlIIIlIIllI; + + private IlIlIIlIIlllIlIlllIIlIIII(TestClassFour testClassFour) { + super(testClassFour, null); + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFour; + } + + public llIlIlIlIIlIIllIllIIlllIl lIIIIlIIllIIlIIlIIIlIIllI() { + this.IllIIIIIIIlIlIllllIIllIII = new IllIIIlIIIllIIIlIIIllIIll(this.lIIIIlIIllIIlIIlIIIlIIllI, this.lIIIIIIIIIlIllIIllIlIIlIl()); + return this.IllIIIIIIIlIlIllllIIllIII; + } + + @Override + public void remove() { + super.remove(); + this.IllIIIIIIIlIlIllllIIllIII.lIIIIlIIllIIlIIlIIIlIIllI = -1; + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } + + IlIlIIlIIlllIlIlllIIlIIII(TestClassFour testClassFour, IlIlIllIIllllIlllIlllIlII ilIlIllIIllllIlllIlllIlII) { + this(testClassFour); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIlIllllIllIIlIlIllII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIlIllllIllIIlIlIllII.java new file mode 100644 index 0000000..8c105f1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIIlIllllIllIIlIlIllII.java @@ -0,0 +1,73 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class IlIlIIlIllllIllIIlIlIllII + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final int[] IIIIllIlIIIllIlllIlllllIl; + private final Object[] IIIIllIIllIIIIllIllIIIlIl; + + public IlIlIIlIllllIllIIlIlIllII(int[] nArray, Object[] objectArray, int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIIllIIIIllIllIIIlIl = objectArray; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + Object[] objectArray = this.IIIIllIIllIIIIllIllIIIlIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, objectArray, n6, n6 + n8, n6 + 2 * n8); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, objectArray, n5 - n8, n5, n5 + n8); + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, objectArray, n7 - 2 * n8, n7 - n8, n7); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, objectArray, n6, n5, n7); + Object object = objectArray[this.IIIIllIlIIIllIlllIlllllIl[n5]]; + int n9 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n10 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + if (n9 <= n2 && (n = ((Comparable)objectArray[this.IIIIllIlIIIllIlllIlllllIl[n9]]).compareTo(object)) <= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(this.IIIIllIlIIIllIlllIlllllIl, n3++, n9); + } + ++n9; + continue; + } + while (n2 >= n9 && (n = ((Comparable)objectArray[this.IIIIllIlIIIllIlllIlllllIl[n2]]).compareTo(object)) >= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(this.IIIIllIlIIIllIlllIlllllIl, n2, n10--); + } + --n2; + } + if (n9 > n2) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(this.IIIIllIlIIIllIlllIlllllIl, n9++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n3); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(this.IIIIllIlIIIllIlllIlllllIl, this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n8, n8); + n8 = Math.min(n10 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n10 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(this.IIIIllIlIIIllIlllIlllllIl, n9, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n9 - n3; + n = n10 - n2; + if (n8 > 1 && n > 1) { + IlIlIIlIllllIllIIlIlIllII.invokeAll(new IlIlIIlIllllIllIIlIlIllII(this.IIIIllIlIIIllIlllIlllllIl, objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8), new IlIlIIlIllllIllIIlIlIllII(this.IIIIllIlIIIllIlllIlllllIl, objectArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } else if (n8 > 1) { + IlIlIIlIllllIllIIlIlIllII.invokeAll(new IlIlIIlIllllIllIIlIlIllII(this.IIIIllIlIIIllIlllIlllllIl, objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8)); + } else { + IlIlIIlIllllIllIIlIlIllII.invokeAll(new IlIlIIlIllllIllIIlIlIllII(this.IIIIllIlIIIllIlllIlllllIl, objectArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIllIIllllIlllIlllIlII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIllIIllllIlllIlllIlII.java new file mode 100644 index 0000000..30c7d62 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlIllIIllllIlllIlllIlII.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +class IlIlIllIIllllIlllIlllIlII + extends AbstractTestClassTwo { + final TestClassFour lIIIIlIIllIIlIIlIIIlIIllI; + + IlIlIllIIllllIlllIlllIlII(TestClassFour testClassFour) { + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFour; + } + + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return new lllllIlIlIlIllIIlllIIIIll(this.lIIIIlIIllIIlIIlIIIlIIllI); + } + + @Override + public int size() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlIIllllIIllllllIlIIIll; + } + + @Override + public boolean contains(Object object) { + return this.lIIIIlIIllIIlIIlIIIlIIllI.containsValue(object); + } + + @Override + public void clear() { + this.lIIIIlIIllIIlIIlIIIlIIllI.clear(); + } + + @Override + public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlllIlIIIllIIIlIIllllIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlllIlIIIllIIIlIIllllIl.java new file mode 100644 index 0000000..8bfb146 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlIlllIlIIIllIIIlIIllllIl.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.util.font; + +import java.io.Serializable; +import java.util.NoSuchElementException; + +public class IlIlllIlIIIllIIIlIIllllIl + extends IllIlIllllllIIIIIllIllIlI + implements Serializable, + Cloneable { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = -7046029254386353129L; + + protected IlIlllIlIIIllIIIlIIllllIl() { + } + + @Override + public boolean hasNext() { + return false; + } + + @Override + public boolean hasPrevious() { + return false; + } + + public Object next() { + throw new NoSuchElementException(); + } + + @Override + public Object previous() { + throw new NoSuchElementException(); + } + + @Override + public int nextIndex() { + return 0; + } + + @Override + public int previousIndex() { + return -1; + } + + @Override + public int lIIIIIIIIIlIllIIllIlIIlIl(int n) { + return 0; + } + + @Override + public int lIIIIlIIllIIlIIlIIIlIIllI(int n) { + return 0; + } + + public Object clone() { + return lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI; + } + + private Object lIIIIlIIllIIlIIlIIIlIIllI() { + return lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIIIlIIIllIIIlIIIllIIll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIIIlIIIllIIIlIIIllIIll.java new file mode 100644 index 0000000..29b4300 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIIIlIIIllIIIlIIIllIIll.java @@ -0,0 +1,51 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Map; + +final class IllIIIlIIIllIIIlIIIllIIll + implements Map.Entry, + llIlIlIlIIlIIllIllIIlllIl { + int lIIIIlIIllIIlIIlIIIlIIllI; + final TestClassFour lIIIIIIIIIlIllIIllIlIIlIl; + + IllIIIlIIIllIIIlIIIllIIll(TestClassFour testClassFour, int n) { + this.lIIIIIIIIIlIllIIllIlIIlIl = testClassFour; + this.lIIIIlIIllIIlIIlIIIlIIllI = n; + } + + IllIIIlIIIllIIIlIIIllIIll(TestClassFour testClassFour) { + this.lIIIIIIIIIlIllIIllIlIIlIl = testClassFour; + } + + public Object getKey() { + return this.lIIIIIIIIIlIllIIllIlIIlIl.IlllIllIlIIIIlIIlIIllIIIl[this.lIIIIlIIllIIlIIlIIIlIIllI]; + } + + public Object getValue() { + return this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI]; + } + + public Object setValue(Object object) { + Object object2 = this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI]; + this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI] = object; + return object2; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof Map.Entry)) { + return false; + } + Map.Entry entry = (Map.Entry)object; + return (this.lIIIIIIIIIlIllIIllIlIIlIl.IlllIllIlIIIIlIIlIIllIIIl[this.lIIIIlIIllIIlIIlIIIlIIllI] == null ? entry.getKey() == null : this.lIIIIIIIIIlIllIIllIlIIlIl.IlllIllIlIIIIlIIlIIllIIIl[this.lIIIIlIIllIIlIIlIIIlIIllI].equals(entry.getKey())) && (this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI] == null ? entry.getValue() == null : this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI].equals(entry.getValue())); + } + + @Override + public int hashCode() { + return (this.lIIIIIIIIIlIllIIllIlIIlIl.IlllIllIlIIIIlIIlIIllIIIl[this.lIIIIlIIllIIlIIlIIIlIIllI] == null ? 0 : this.lIIIIIIIIIlIllIIllIlIIlIl.IlllIllIlIIIIlIIlIIllIIIl[this.lIIIIlIIllIIlIIlIIIlIIllI].hashCode()) ^ (this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI] == null ? 0 : this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI].hashCode()); + } + + public String toString() { + return this.lIIIIIIIIIlIllIIllIlIIlIl.IlllIllIlIIIIlIIlIIllIIIl[this.lIIIIlIIllIIlIIlIIIlIIllI] + "=>" + this.lIIIIIIIIIlIllIIllIlIIlIl.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIIIlIIllIllIlIlllIllIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIIIlIIllIllIlIlllIllIl.java new file mode 100644 index 0000000..ce91e18 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIIIlIIllIllIlIlllIllIl.java @@ -0,0 +1,10 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +public interface IllIIIlIIllIllIlIlllIllIl + extends Iterator { + public Object previous(); + + public boolean hasPrevious(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIlIIIIIlIlllllIllIllII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIlIIIIIlIlllllIllIllII.java new file mode 100644 index 0000000..2d0f819 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIlIIIIIlIlllllIllIllII.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.util.font; + +import java.io.Serializable; +import java.util.Arrays; + +final class IllIlIIIIIlIlllllIllIllII + implements Serializable, + lllIIIIIIllIlllIlIIlIlIll { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = -7046029254386353129L; + + private IllIlIIIIIlIlllllIllIllII() { + } + + public int lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray) { + return Arrays.hashCode(nArray); + } + + public boolean lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2) { + return Arrays.equals(nArray, nArray2); + } + + IllIlIIIIIlIlllllIllIllII(lllllllllIllllIIllIIlIIII lllllllllIllllIIllIIlIIII2) { + this(); + } + + @Override + public int lIIIIlIIllIIlIIlIIIlIIllI(Object var1) { + return 0; + } + + @Override + public boolean lIIIIlIIllIIlIIlIIIlIIllI(Object var1, Object var2) { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIlIllllllIIIIIllIllIlI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIlIllllllIIIIIllIllIlI.java new file mode 100644 index 0000000..306bb85 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IllIlIllllllIIIIIllIllIlI.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.util.font; + +public abstract class IllIlIllllllIIIIIllIllIlI + extends IIlllIllllllIlIIllIIlllII + implements llllllllllllIlIIIIIIIIlll { + protected IllIlIllllllIIIIIllIllIlI() { + } + + public void set(Object object) { + throw new UnsupportedOperationException(); + } + + public void add(Object object) { + throw new UnsupportedOperationException(); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlIlIlIIIllIIllIlIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlIlIlIIIllIIllIlIIII.java new file mode 100644 index 0000000..48f534f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlIlIlIIIllIIllIlIIII.java @@ -0,0 +1,84 @@ +package com.cheatbreaker.client.util.font; + +import java.util.NoSuchElementException; + +class IlllIlIlIlIIIllIIllIlIIII + extends IllIlIllllllIIIIIllIllIlI { + int lIIIIlIIllIIlIIlIIIlIIllI; + int lIIIIIIIIIlIllIIllIlIIlIl; + final int IlllIIIlIlllIllIlIIlllIlI; + final lIllIlllllIlIlIIllIIIllII IIIIllIlIIIllIlllIlllllIl; + + IlllIlIlIlIIIllIIllIlIIII(lIllIlllllIlIlIIllIIIllII lIllIlllllIlIlIIllIIIllII2, int n) { + this.IIIIllIlIIIllIlllIlllllIl = lIllIlllllIlIlIIllIIIllII2; + this.IlllIIIlIlllIllIlIIlllIlI = n; + this.lIIIIlIIllIIlIIlIIIlIIllI = this.IlllIIIlIlllIllIlIIlllIlI; + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI < this.IIIIllIlIIIllIlllIlllllIl.size(); + } + + @Override + public boolean hasPrevious() { + return this.lIIIIlIIllIIlIIlIIIlIIllI > 0; + } + + public Object next() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = this.lIIIIlIIllIIlIIlIIIlIIllI++; + return this.IIIIllIlIIIllIlllIlllllIl.lIIIIlIIllIIlIIlIIIlIIllI.get(this.IIIIllIlIIIllIlllIlllllIl.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIIIIIIlIllIIllIlIIlIl); + } + + @Override + public Object previous() { + if (!this.hasPrevious()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = --this.lIIIIlIIllIIlIIlIIIlIIllI; + return this.IIIIllIlIIIllIlllIlllllIl.lIIIIlIIllIIlIIlIIIlIIllI.get(this.IIIIllIlIIIllIlllIlllllIl.lIIIIIIIIIlIllIIllIlIIlIl + this.lIIIIlIIllIIlIIlIIIlIIllI); + } + + @Override + public int nextIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI; + } + + @Override + public int previousIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI - 1; + } + + @Override + public void add(Object object) { + if (this.lIIIIIIIIIlIllIIllIlIIlIl == -1) { + throw new IllegalStateException(); + } + this.IIIIllIlIIIllIlllIlllllIl.add(this.lIIIIlIIllIIlIIlIIIlIIllI++, object); + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } + + @Override + public void set(Object object) { + if (this.lIIIIIIIIIlIllIIllIlIIlIl == -1) { + throw new IllegalStateException(); + } + this.IIIIllIlIIIllIlllIlllllIl.set(this.lIIIIIIIIIlIllIIllIlIIlIl, object); + } + + @Override + public void remove() { + if (this.lIIIIIIIIIlIllIIllIlIIlIl == -1) { + throw new IllegalStateException(); + } + this.IIIIllIlIIIllIlllIlllllIl.remove(this.lIIIIIIIIIlIllIIllIlIIlIl); + if (this.lIIIIIIIIIlIllIIllIlIIlIl < this.lIIIIlIIllIIlIIlIIIlIIllI) { + --this.lIIIIlIIllIIlIIlIIIlIIllI; + } + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlIllIlllIlIIlIlllIll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlIllIlllIlIIlIlllIll.java new file mode 100644 index 0000000..1158eab --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlIllIlllIlIIlIlllIll.java @@ -0,0 +1,1398 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Arrays; +import java.util.Random; +import java.util.concurrent.ExecutorCompletionService; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.atomic.AtomicInteger; + +public class IlllIlIllIlllIlIIlIlllIll { + public static final int[] lIIIIlIIllIIlIIlIIIlIIllI = new int[0]; + private static final int IIIIllIlIIIllIlllIlllllIl = 16; + private static final int IIIIllIIllIIIIllIllIIIlIl = 8192; + private static final int IlIlIIIlllIIIlIlllIlIllIl = 128; + private static final int IIIllIllIlIlllllllIlIlIII = 16; + private static final int IllIIIIIIIlIlIllllIIllIII = 8; + private static final int lIIIIllIIlIlIllIIIlIllIlI = 255; + private static final int IlllIllIlIIIIlIIlIIllIIIl = 4; + private static final int IlIlllIIIIllIllllIllIIlIl = 1024; + private static final int llIIlllIIIIlllIllIlIlllIl = 1024; + protected static final lIIllIlIIlIIIIIlIIlIlIIll lIIIIIIIIIlIllIIllIlIIlIl = new lIIllIlIIlIIIIIlIIlIlIIll(-1, -1, -1); + public static final lllIIIIIIllIlllIlIIlIlIll IlllIIIlIlllIllIlIIlllIlI = new IllIlIIIIIlIlllllIllIllII(null); + + private IlllIlIllIlllIlIIlIlllIll() { + } + + public static int[] lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n) { + if (n > nArray.length) { + int[] nArray2 = new int[n]; + System.arraycopy(nArray, 0, nArray2, 0, nArray.length); + return nArray2; + } + return nArray; + } + + public static int[] lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, int n2) { + if (n > nArray.length) { + int[] nArray2 = new int[n]; + System.arraycopy(nArray, 0, nArray2, 0, n2); + return nArray2; + } + return nArray; + } + + public static int[] lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int n) { + if (n > nArray.length) { + int n2 = (int)Math.max(Math.min(2L * (long)nArray.length, 0x7FFFFFF7L), (long)n); + int[] nArray2 = new int[n2]; + System.arraycopy(nArray, 0, nArray2, 0, nArray.length); + return nArray2; + } + return nArray; + } + + public static int[] lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int n, int n2) { + if (n > nArray.length) { + int n3 = (int)Math.max(Math.min(2L * (long)nArray.length, 0x7FFFFFF7L), (long)n); + int[] nArray2 = new int[n3]; + System.arraycopy(nArray, 0, nArray2, 0, n2); + return nArray2; + } + return nArray; + } + + public static int[] IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int n) { + if (n >= nArray.length) { + return nArray; + } + int[] nArray2 = n == 0 ? lIIIIlIIllIIlIIlIIIlIIllI : new int[n]; + System.arraycopy(nArray, 0, nArray2, 0, n); + return nArray2; + } + + public static int[] IIIIllIlIIIllIlllIlllllIl(int[] nArray, int n) { + if (n == nArray.length) { + return nArray; + } + if (n < nArray.length) { + return IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, n); + } + return IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n); + } + + public static int[] IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int n, int n2) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, n, n2); + int[] nArray2 = n2 == 0 ? lIIIIlIIllIIlIIlIIIlIIllI : new int[n2]; + System.arraycopy(nArray, n, nArray2, 0, n2); + return nArray2; + } + + public static int[] lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray) { + return (int[])nArray.clone(); + } + + @Deprecated + public static void IIIIllIIllIIIIllIllIIIlIl(int[] nArray, int n) { + int n2 = nArray.length; + while (n2-- != 0) { + nArray[n2] = n; + } + } + + @Deprecated + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, int n2, int n3) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, n, n2); + if (n == 0) { + while (n2-- != 0) { + nArray[n2] = n3; + } + } else { + for (int i = n; i < n2; ++i) { + nArray[i] = n3; + } + } + } + + @Deprecated + public static boolean lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2) { + int n = nArray.length; + if (n != nArray2.length) { + return false; + } + while (n-- != 0) { + if (nArray[n] == nArray2[n]) continue; + return false; + } + return true; + } + + public static void IIIIllIlIIIllIlllIlllllIl(int[] nArray, int n, int n2) { + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(nArray.length, n, n2); + } + + public static void IIIIllIIllIIIIllIllIIIlIl(int[] nArray, int n, int n2) { + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIIIIIIlIllIIllIlIIlIl(nArray.length, n, n2); + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int[] nArray2) { + if (nArray.length != nArray2.length) { + throw new IllegalArgumentException("Array size mismatch: " + nArray.length + " != " + nArray2.length); + } + } + + public static void IlIlIIIlllIIIlIlllIlIllIl(int[] nArray, int n, int n2) { + int n3 = nArray[n]; + nArray[n] = nArray[n2]; + nArray[n2] = n3; + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int n, int n2, int n3) { + int n4 = 0; + while (n4 < n3) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n, n2); + ++n4; + ++n; + ++n2; + } + } + + private static int IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + int n4 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n], nArray[n2]); + int n5 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n], nArray[n3]); + int n6 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n2], nArray[n3]); + return n4 < 0 ? (n6 < 0 ? n2 : (n5 < 0 ? n3 : n)) : (n6 > 0 ? n2 : (n5 > 0 ? n3 : n)); + } + + private static void IIIIllIlIIIllIlllIlllllIl(int[] nArray, int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + for (int i = n; i < n2 - 1; ++i) { + int n3; + int n4 = i; + for (n3 = i + 1; n3 < n2; ++n3) { + if (lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n3], nArray[n4]) >= 0) continue; + n4 = n3; + } + if (n4 == i) continue; + n3 = nArray[i]; + nArray[i] = nArray[n4]; + nArray[n4] = n3; + } + } + + private static void IIIIllIIllIIIIllIllIIIlIl(int[] nArray, int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + int n3 = n; + while (++n3 < n2) { + int n4 = nArray[n3]; + int n5 = n3; + int n6 = nArray[n5 - 1]; + while (lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n4, n6) < 0) { + nArray[n5] = n6; + if (n == n5 - 1) { + --n5; + break; + } + n6 = nArray[--n5 - 1]; + } + nArray[n5] = n4; + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + int n3; + int n4; + int n5; + int n6; + int n7 = n2 - n; + if (n7 < 16) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, n, n2, lIlIIIIlIlIlllIlIIllIlIll2); + return; + } + int n8 = n + n7 / 2; + int n9 = n; + int n10 = n2 - 1; + if (n7 > 128) { + n6 = n7 / 8; + n9 = IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, n9, n9 + n6, n9 + 2 * n6, lIlIIIIlIlIlllIlIIllIlIll2); + n8 = IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, n8 - n6, n8, n8 + n6, lIlIIIIlIlIlllIlIIllIlIll2); + n10 = IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, n10 - 2 * n6, n10 - n6, n10, lIlIIIIlIlIlllIlIIllIlIll2); + } + n8 = IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, n9, n8, n10, lIlIIIIlIlIlllIlIIllIlIll2); + n6 = nArray[n8]; + int n11 = n5 = n; + int n12 = n4 = n2 - 1; + while (true) { + if (n11 <= n4 && (n3 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n11], n6)) <= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n5++, n11); + } + ++n11; + continue; + } + while (n4 >= n11 && (n3 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray[n4], n6)) >= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n4, n12--); + } + --n4; + } + if (n11 > n4) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n11++, n4--); + } + n3 = Math.min(n5 - n, n11 - n5); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n, n11 - n3, n3); + n3 = Math.min(n12 - n4, n2 - n12 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n11, n2 - n3, n3); + n3 = n11 - n5; + if (n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n, n + n3, lIlIIIIlIlIlllIlIIllIlIll2); + } + if ((n3 = n12 - n4) > 1) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n2 - n3, n2, lIlIIIIlIlIlllIlIIllIlIll2); + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, 0, nArray.length, lIlIIIIlIlIlllIlIIllIlIll2); + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + if (n2 - n < 8192) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n, n2, lIlIIIIlIlIlllIlIIllIlIll2); + } else { + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new IIllIlllIIlllllIllIIIllII(nArray, n, n2, lIlIIIIlIlIlllIlIIllIlIll2)); + forkJoinPool.shutdown(); + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, 0, nArray.length, lIlIIIIlIlIlllIlIIllIlIll2); + } + + private static int IIIIllIIllIIIIllIllIIIlIl(int[] nArray, int n, int n2, int n3) { + int n4 = Integer.compare(nArray[n], nArray[n2]); + int n5 = Integer.compare(nArray[n], nArray[n3]); + int n6 = Integer.compare(nArray[n2], nArray[n3]); + return n4 < 0 ? (n6 < 0 ? n2 : (n5 < 0 ? n3 : n)) : (n6 > 0 ? n2 : (n5 > 0 ? n3 : n)); + } + + private static void lIIlIlIllIIlIIIlIIIlllIII(int[] nArray, int n, int n2) { + for (int i = n; i < n2 - 1; ++i) { + int n3; + int n4 = i; + for (n3 = i + 1; n3 < n2; ++n3) { + if (nArray[n3] >= nArray[n4]) continue; + n4 = n3; + } + if (n4 == i) continue; + n3 = nArray[i]; + nArray[i] = nArray[n4]; + nArray[n4] = n3; + } + } + + private static void IIIlllIIIllIllIlIIIIIIlII(int[] nArray, int n, int n2) { + int n3 = n; + while (++n3 < n2) { + int n4 = nArray[n3]; + int n5 = n3; + int n6 = nArray[n5 - 1]; + while (n4 < n6) { + nArray[n5] = n6; + if (n == n5 - 1) { + --n5; + break; + } + n6 = nArray[--n5 - 1]; + } + nArray[n5] = n4; + } + } + + public static void IIIllIllIlIlllllllIlIlIII(int[] nArray, int n, int n2) { + int n3; + int n4; + int n5; + int n6; + int n7 = n2 - n; + if (n7 < 16) { + IlllIlIllIlllIlIIlIlllIll.lIIlIlIllIIlIIIlIIIlllIII(nArray, n, n2); + return; + } + int n8 = n + n7 / 2; + int n9 = n; + int n10 = n2 - 1; + if (n7 > 128) { + n6 = n7 / 8; + n9 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, n9, n9 + n6, n9 + 2 * n6); + n8 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, n8 - n6, n8, n8 + n6); + n10 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, n10 - 2 * n6, n10 - n6, n10); + } + n8 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, n9, n8, n10); + n6 = nArray[n8]; + int n11 = n5 = n; + int n12 = n4 = n2 - 1; + while (true) { + if (n11 <= n4 && (n3 = Integer.compare(nArray[n11], n6)) <= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n5++, n11); + } + ++n11; + continue; + } + while (n4 >= n11 && (n3 = Integer.compare(nArray[n4], n6)) >= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n4, n12--); + } + --n4; + } + if (n11 > n4) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n11++, n4--); + } + n3 = Math.min(n5 - n, n11 - n5); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n, n11 - n3, n3); + n3 = Math.min(n12 - n4, n2 - n12 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n11, n2 - n3, n3); + n3 = n11 - n5; + if (n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, n, n + n3); + } + if ((n3 = n12 - n4) > 1) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, n2 - n3, n2); + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, 0, nArray.length); + } + + public static void IllIIIIIIIlIlIllllIIllIII(int[] nArray, int n, int n2) { + if (n2 - n < 8192) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, n, n2); + } else { + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new IIlIIIlIIIIIlIllIlIIlllII(nArray, n, n2)); + forkJoinPool.shutdown(); + } + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray) { + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, 0, nArray.length); + } + + private static int IIIIllIlIIIllIlllIlllllIl(int[] nArray, int[] nArray2, int n, int n2, int n3) { + int n4 = nArray2[nArray[n]]; + int n5 = nArray2[nArray[n2]]; + int n6 = nArray2[nArray[n3]]; + int n7 = Integer.compare(n4, n5); + int n8 = Integer.compare(n4, n6); + int n9 = Integer.compare(n5, n6); + return n7 < 0 ? (n9 < 0 ? n2 : (n8 < 0 ? n3 : n)) : (n9 > 0 ? n2 : (n8 > 0 ? n3 : n)); + } + + private static void lIIIIllIIlIlIllIIIlIllIlI(int[] nArray, int[] nArray2, int n, int n2) { + int n3 = n; + while (++n3 < n2) { + int n4 = nArray[n3]; + int n5 = n3; + int n6 = nArray[n5 - 1]; + while (nArray2[n4] < nArray2[n6]) { + nArray[n5] = n6; + if (n == n5 - 1) { + --n5; + break; + } + n6 = nArray[--n5 - 1]; + } + nArray[n5] = n4; + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2, int n, int n2) { + int n3; + int n4; + int n5; + int n6; + int n7 = n2 - n; + if (n7 < 16) { + IlllIlIllIlllIlIIlIlllIll.lIIIIllIIlIlIllIIIlIllIlI(nArray, nArray2, n, n2); + return; + } + int n8 = n + n7 / 2; + int n9 = n; + int n10 = n2 - 1; + if (n7 > 128) { + n6 = n7 / 8; + n9 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n9, n9 + n6, n9 + 2 * n6); + n8 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n8 - n6, n8, n8 + n6); + n10 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n10 - 2 * n6, n10 - n6, n10); + } + n8 = IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n9, n8, n10); + n6 = nArray2[nArray[n8]]; + int n11 = n5 = n; + int n12 = n4 = n2 - 1; + while (true) { + if (n11 <= n4 && (n3 = Integer.compare(nArray2[nArray[n11]], n6)) <= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n5++, n11); + } + ++n11; + continue; + } + while (n4 >= n11 && (n3 = Integer.compare(nArray2[nArray[n4]], n6)) >= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n4, n12--); + } + --n4; + } + if (n11 > n4) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, n11++, n4--); + } + n3 = Math.min(n5 - n, n11 - n5); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n, n11 - n3, n3); + n3 = Math.min(n12 - n4, n2 - n12 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, n11, n2 - n3, n3); + n3 = n11 - n5; + if (n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, n, n + n3); + } + if ((n3 = n12 - n4) > 1) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, n2 - n3, n2); + } + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int[] nArray2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, 0, nArray2.length); + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int[] nArray2, int n, int n2) { + if (n2 - n < 8192) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, n, n2); + } else { + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new llllIllllIlIIllIIIIIIIIll(nArray, nArray2, n, n2)); + forkJoinPool.shutdown(); + } + } + + public static void IIIIllIlIIIllIlllIlllllIl(int[] nArray, int[] nArray2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2, 0, nArray2.length); + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int[] nArray2, int n, int n2) { + int n3 = n; + for (int i = n + 1; i < n2; ++i) { + if (nArray2[nArray[i]] == nArray2[nArray[n3]]) continue; + if (i - n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, n3, i); + } + n3 = i; + } + if (n2 - n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.IllIIIIIIIlIlIllllIIllIII(nArray, n3, n2); + } + } + + public static void IIIIllIIllIIIIllIllIIIlIl(int[] nArray, int[] nArray2) { + IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, nArray2, 0, nArray.length); + } + + private static int IIIIllIIllIIIIllIllIIIlIl(int[] nArray, int[] nArray2, int n, int n2, int n3) { + int n4; + int n5 = Integer.compare(nArray[n], nArray[n2]); + int n6 = n5 == 0 ? Integer.compare(nArray2[n], nArray2[n2]) : n5; + n5 = Integer.compare(nArray[n], nArray[n3]); + int n7 = n5 == 0 ? Integer.compare(nArray2[n], nArray2[n3]) : n5; + n5 = Integer.compare(nArray[n2], nArray[n3]); + int n8 = n4 = n5 == 0 ? Integer.compare(nArray2[n2], nArray2[n3]) : n5; + return n6 < 0 ? (n4 < 0 ? n2 : (n7 < 0 ? n3 : n)) : (n4 > 0 ? n2 : (n7 > 0 ? n3 : n)); + } + + private static void IlllIllIlIIIIlIIlIIllIIIl(int[] nArray, int[] nArray2, int n, int n2) { + int n3 = nArray[n]; + int n4 = nArray2[n]; + nArray[n] = nArray[n2]; + nArray2[n] = nArray2[n2]; + nArray[n2] = n3; + nArray2[n2] = n4; + } + + private static void IlIlIIIlllIIIlIlllIlIllIl(int[] nArray, int[] nArray2, int n, int n2, int n3) { + int n4 = 0; + while (n4 < n3) { + IlllIlIllIlllIlIIlIlllIll.IlllIllIlIIIIlIIlIIllIIIl(nArray, nArray2, n, n2); + ++n4; + ++n; + ++n2; + } + } + + private static void IlIlllIIIIllIllllIllIIlIl(int[] nArray, int[] nArray2, int n, int n2) { + for (int i = n; i < n2 - 1; ++i) { + int n3; + int n4 = i; + for (n3 = i + 1; n3 < n2; ++n3) { + int n5 = Integer.compare(nArray[n3], nArray[n4]); + if (n5 >= 0 && (n5 != 0 || nArray2[n3] >= nArray2[n4])) continue; + n4 = n3; + } + if (n4 == i) continue; + n3 = nArray[i]; + nArray[i] = nArray[n4]; + nArray[n4] = n3; + n3 = nArray2[i]; + nArray2[i] = nArray2[n4]; + nArray2[n4] = n3; + } + } + + public static void IIIIllIlIIIllIlllIlllllIl(int[] nArray, int[] nArray2, int n, int n2) { + int n3; + int n4; + int n5; + int n6; + int n7 = n2 - n; + if (n7 < 16) { + IlllIlIllIlllIlIIlIlllIll.IlIlllIIIIllIllllIllIIlIl(nArray, nArray2, n, n2); + return; + } + int n8 = n + n7 / 2; + int n9 = n; + int n10 = n2 - 1; + if (n7 > 128) { + n6 = n7 / 8; + n9 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, nArray2, n9, n9 + n6, n9 + 2 * n6); + n8 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, nArray2, n8 - n6, n8, n8 + n6); + n10 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, nArray2, n10 - 2 * n6, n10 - n6, n10); + } + n8 = IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, nArray2, n9, n8, n10); + n6 = nArray[n8]; + int n11 = nArray2[n8]; + int n12 = n5 = n; + int n13 = n4 = n2 - 1; + while (true) { + int n14; + if (n12 <= n4 && (n3 = (n14 = Integer.compare(nArray[n12], n6)) == 0 ? Integer.compare(nArray2[n12], n11) : n14) <= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlllIllIlIIIIlIIlIIllIIIl(nArray, nArray2, n5++, n12); + } + ++n12; + continue; + } + while (n4 >= n12 && (n3 = (n14 = Integer.compare(nArray[n4], n6)) == 0 ? Integer.compare(nArray2[n4], n11) : n14) >= 0) { + if (n3 == 0) { + IlllIlIllIlllIlIIlIlllIll.IlllIllIlIIIIlIIlIIllIIIl(nArray, nArray2, n4, n13--); + } + --n4; + } + if (n12 > n4) break; + IlllIlIllIlllIlIIlIlllIll.IlllIllIlIIIIlIIlIIllIIIl(nArray, nArray2, n12++, n4--); + } + n3 = Math.min(n5 - n, n12 - n5); + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, nArray2, n, n12 - n3, n3); + n3 = Math.min(n13 - n4, n2 - n13 - 1); + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, nArray2, n12, n2 - n3, n3); + n3 = n12 - n5; + if (n3 > 1) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n, n + n3); + } + if ((n3 = n13 - n4) > 1) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n2 - n3, n2); + } + } + + public static void IlIlIIIlllIIIlIlllIlIllIl(int[] nArray, int[] nArray2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2); + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, 0, nArray.length); + } + + public static void IIIIllIIllIIIIllIllIIIlIl(int[] nArray, int[] nArray2, int n, int n2) { + if (n2 - n < 8192) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n, n2); + } + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new IIIllIIlIIlIIIIIlIllIIIIl(nArray, nArray2, n, n2)); + forkJoinPool.shutdown(); + } + + public static void IIIllIllIlIlllllllIlIlIII(int[] nArray, int[] nArray2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2); + IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, nArray2, 0, nArray.length); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, int n2, int[] nArray2) { + int n3 = n2 - n; + if (n3 < 16) { + IlllIlIllIlllIlIIlIlllIll.IIIlllIIIllIllIlIIIIIIlII(nArray, n, n2); + return; + } + int n4 = n + n2 >>> 1; + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray2, n, n4, nArray); + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray2, n4, n2, nArray); + if (nArray2[n4 - 1] <= nArray2[n4]) { + System.arraycopy(nArray2, n, nArray, n, n3); + return; + } + int n5 = n; + int n6 = n4; + for (int i = n; i < n2; ++i) { + nArray[i] = n6 >= n2 || n5 < n4 && nArray2[n5] <= nArray2[n6] ? nArray2[n5++] : nArray2[n6++]; + } + } + + public static void lIIIIllIIlIlIllIIIlIllIlI(int[] nArray, int n, int n2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n, n2, (int[])nArray.clone()); + } + + public static void IIIIllIlIIIllIlllIlllllIl(int[] nArray) { + IlllIlIllIlllIlIIlIlllIll.lIIIIllIIlIlIllIIIlIllIlI(nArray, 0, nArray.length); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2, int[] nArray2) { + int n3 = n2 - n; + if (n3 < 16) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, n, n2, lIlIIIIlIlIlllIlIIllIlIll2); + return; + } + int n4 = n + n2 >>> 1; + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray2, n, n4, lIlIIIIlIlIlllIlIIllIlIll2, nArray); + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray2, n4, n2, lIlIIIIlIlIlllIlIIllIlIll2, nArray); + if (lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray2[n4 - 1], nArray2[n4]) <= 0) { + System.arraycopy(nArray2, n, nArray, n, n3); + return; + } + int n5 = n; + int n6 = n4; + for (int i = n; i < n2; ++i) { + nArray[i] = n6 >= n2 || n5 < n4 && lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(nArray2[n5], nArray2[n6]) <= 0 ? nArray2[n5++] : nArray2[n6++]; + } + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n, n2, lIlIIIIlIlIlllIlIIllIlIll2, (int[])nArray.clone()); + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, 0, nArray.length, lIlIIIIlIlIlllIlIIllIlIll2); + } + + public static int IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int n, int n2, int n3) { + --n2; + while (n <= n2) { + int n4 = n + n2 >>> 1; + int n5 = nArray[n4]; + if (n5 < n3) { + n = n4 + 1; + continue; + } + if (n5 > n3) { + n2 = n4 - 1; + continue; + } + return n4; + } + return -(n + 1); + } + + public static int IlIlIIIlllIIIlIlllIlIllIl(int[] nArray, int n) { + return IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, 0, nArray.length, n); + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + --n2; + while (n <= n2) { + int n4 = n + n2 >>> 1; + int n5 = nArray[n4]; + int n6 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n5, n3); + if (n6 < 0) { + n = n4 + 1; + continue; + } + if (n6 > 0) { + n2 = n4 - 1; + continue; + } + return n4; + } + return -(n + 1); + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + return IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, 0, nArray.length, n, lIlIIIIlIlIlllIlIIllIlIll2); + } + + public static void IIIIllIIllIIIIllIllIIIlIl(int[] nArray) { + IlllIlIllIlllIlIIlIlllIll.IlllIllIlIIIIlIIlIIllIIIl(nArray, 0, nArray.length); + } + + public static void IlllIllIlIIIIlIIlIIllIIIl(int[] nArray, int n, int n2) { + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, n, n2); + return; + } + int n3 = 3; + int n4 = 766; + int n5 = 0; + int[] nArray2 = new int[766]; + int[] nArray3 = new int[766]; + int[] nArray4 = new int[766]; + nArray2[n5] = n; + nArray3[n5] = n2 - n; + nArray4[n5++] = 0; + int[] nArray5 = new int[256]; + int[] nArray6 = new int[256]; + while (n5 > 0) { + int n6; + int n7 = nArray2[--n5]; + int n8 = nArray3[n5]; + int n9 = nArray4[n5]; + int n10 = n9 % 4 == 0 ? 128 : 0; + int n11 = (3 - n9 % 4) * 8; + int n12 = n7 + n8; + while (n12-- != n7) { + int n13 = nArray[n12] >>> n11 & 0xFF ^ n10; + nArray5[n13] = nArray5[n13] + 1; + } + n12 = -1; + int n14 = n7; + for (n6 = 0; n6 < 256; ++n6) { + if (nArray5[n6] != 0) { + n12 = n6; + } + nArray6[n6] = n14 += nArray5[n6]; + } + n6 = n7 + n8 - nArray5[n12]; + int n15 = -1; + for (n14 = n7; n14 <= n6; n14 += nArray5[n15]) { + int n16 = nArray[n14]; + n15 = n16 >>> n11 & 0xFF ^ n10; + if (n14 < n6) { + while (true) { + int n17 = n15; + int n18 = nArray6[n17] - 1; + nArray6[n17] = n18; + int n19 = n18; + if (n18 <= n14) break; + int n20 = n16; + n16 = nArray[n19]; + nArray[n19] = n20; + n15 = n16 >>> n11 & 0xFF ^ n10; + } + nArray[n14] = n16; + } + if (n9 < 3 && nArray5[n15] > 1) { + if (nArray5[n15] < 1024) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, n14, n14 + nArray5[n15]); + } else { + nArray2[n5] = n14; + nArray3[n5] = nArray5[n15]; + nArray4[n5++] = n9 + 1; + } + } + nArray5[n15] = 0; + } + } + } + + public static void IlIlllIIIIllIllllIllIIlIl(int[] nArray, int n, int n2) { + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, n, n2); + return; + } + int n3 = 3; + LinkedBlockingQueue linkedBlockingQueue = new LinkedBlockingQueue(); + linkedBlockingQueue.add(new lIIllIlIIlIIIIIlIIlIlIIll(n, n2 - n, 0)); + AtomicInteger atomicInteger = new AtomicInteger(1); + int n4 = Runtime.getRuntime().availableProcessors(); + ExecutorService executorService = Executors.newFixedThreadPool(n4, Executors.defaultThreadFactory()); + ExecutorCompletionService executorCompletionService = new ExecutorCompletionService(executorService); + int n5 = n4; + while (n5-- != 0) { + executorCompletionService.submit(new lllllllllIllllIIllIIlIIII(atomicInteger, n4, linkedBlockingQueue, nArray)); + } + Throwable throwable = null; + int n6 = n4; + while (n6-- != 0) { + try { + executorCompletionService.take().get(); + } catch (Exception exception) { + throwable = exception.getCause(); + } + } + executorService.shutdown(); + if (throwable != null) { + throw throwable instanceof RuntimeException ? (RuntimeException)throwable : new RuntimeException(throwable); + } + } + + public static void IlIlIIIlllIIIlIlllIlIllIl(int[] nArray) { + IlllIlIllIlllIlIIlIlllIll.IlIlllIIIIllIllllIllIIlIl(nArray, 0, nArray.length); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2, boolean bl) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, 0, nArray.length, bl); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2, int n, int n2, boolean bl) { + int[] nArray3; + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIllIIlIlIllIIIlIllIlI(nArray, nArray2, n, n2); + return; + } + int n3 = 3; + int n4 = 766; + int n5 = 0; + int[] nArray4 = new int[766]; + int[] nArray5 = new int[766]; + int[] nArray6 = new int[766]; + nArray4[n5] = n; + nArray5[n5] = n2 - n; + nArray6[n5++] = 0; + int[] nArray7 = new int[256]; + int[] nArray8 = new int[256]; + int[] nArray9 = nArray3 = bl ? new int[nArray.length] : null; + while (n5 > 0) { + int n6; + int n7; + int n8 = nArray4[--n5]; + int n9 = nArray5[n5]; + int n10 = nArray6[n5]; + int n11 = n10 % 4 == 0 ? 128 : 0; + int n12 = (3 - n10 % 4) * 8; + int n13 = n8 + n9; + while (n13-- != n8) { + int n14 = nArray2[nArray[n13]] >>> n12 & 0xFF ^ n11; + nArray7[n14] = nArray7[n14] + 1; + } + n13 = -1; + int n15 = n7 = bl ? 0 : n8; + for (n6 = 0; n6 < 256; ++n6) { + if (nArray7[n6] != 0) { + n13 = n6; + } + nArray8[n6] = n7 += nArray7[n6]; + } + if (bl) { + n6 = n8 + n9; + while (n6-- != n8) { + int n16 = nArray2[nArray[n6]] >>> n12 & 0xFF ^ n11; + int n17 = nArray8[n16] - 1; + nArray8[n16] = n17; + nArray3[n17] = nArray[n6]; + } + System.arraycopy(nArray3, 0, nArray, n8, n9); + n7 = n8; + for (n6 = 0; n6 <= n13; ++n6) { + if (n10 < 3 && nArray7[n6] > 1) { + if (nArray7[n6] < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIllIIlIlIllIIIlIllIlI(nArray, nArray2, n7, n7 + nArray7[n6]); + } else { + nArray4[n5] = n7; + nArray5[n5] = nArray7[n6]; + nArray6[n5++] = n10 + 1; + } + } + n7 += nArray7[n6]; + } + Arrays.fill(nArray7, 0); + continue; + } + n6 = n8 + n9 - nArray7[n13]; + int n18 = -1; + for (n7 = n8; n7 <= n6; n7 += nArray7[n18]) { + int n19 = nArray[n7]; + n18 = nArray2[n19] >>> n12 & 0xFF ^ n11; + if (n7 < n6) { + while (true) { + int n20 = n18; + int n21 = nArray8[n20] - 1; + nArray8[n20] = n21; + int n22 = n21; + if (n21 <= n7) break; + int n23 = n19; + n19 = nArray[n22]; + nArray[n22] = n23; + n18 = nArray2[n19] >>> n12 & 0xFF ^ n11; + } + nArray[n7] = n19; + } + if (n10 < 3 && nArray7[n18] > 1) { + if (nArray7[n18] < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIllIIlIlIllIIIlIllIlI(nArray, nArray2, n7, n7 + nArray7[n18]); + } else { + nArray4[n5] = n7; + nArray5[n5] = nArray7[n18]; + nArray6[n5++] = n10 + 1; + } + } + nArray7[n18] = 0; + } + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int[] nArray2, int n, int n2, boolean bl) { + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, n, n2, bl); + return; + } + int n3 = 3; + LinkedBlockingQueue linkedBlockingQueue = new LinkedBlockingQueue(); + linkedBlockingQueue.add(new lIIllIlIIlIIIIIlIIlIlIIll(n, n2 - n, 0)); + AtomicInteger atomicInteger = new AtomicInteger(1); + int n4 = Runtime.getRuntime().availableProcessors(); + ExecutorService executorService = Executors.newFixedThreadPool(n4, Executors.defaultThreadFactory()); + ExecutorCompletionService executorCompletionService = new ExecutorCompletionService(executorService); + int[] nArray3 = bl ? new int[nArray.length] : null; + int n5 = n4; + while (n5-- != 0) { + executorCompletionService.submit(new lIlllIIllIIIlIIlIIIIIIlIl(atomicInteger, n4, linkedBlockingQueue, nArray2, nArray, bl, nArray3)); + } + Throwable throwable = null; + int n6 = n4; + while (n6-- != 0) { + try { + executorCompletionService.take().get(); + } catch (Exception exception) { + throwable = exception.getCause(); + } + } + executorService.shutdown(); + if (throwable != null) { + throw throwable instanceof RuntimeException ? (RuntimeException)throwable : new RuntimeException(throwable); + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int[] nArray2, boolean bl) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2, 0, nArray2.length, bl); + } + + public static void IllIIIIIIIlIlIllllIIllIII(int[] nArray, int[] nArray2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2); + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, nArray2, 0, nArray.length); + } + + public static void IlIlIIIlllIIIlIlllIlIllIl(int[] nArray, int[] nArray2, int n, int n2) { + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.IlIlllIIIIllIllllIllIIlIl(nArray, nArray2, n, n2); + return; + } + int n3 = 2; + int n4 = 7; + int n5 = 1786; + int n6 = 0; + int[] nArray3 = new int[1786]; + int[] nArray4 = new int[1786]; + int[] nArray5 = new int[1786]; + nArray3[n6] = n; + nArray4[n6] = n2 - n; + nArray5[n6++] = 0; + int[] nArray6 = new int[256]; + int[] nArray7 = new int[256]; + while (n6 > 0) { + int n7; + int n8 = nArray3[--n6]; + int n9 = nArray4[n6]; + int n10 = nArray5[n6]; + int n11 = n10 % 4 == 0 ? 128 : 0; + int[] nArray8 = n10 < 4 ? nArray : nArray2; + int n12 = (3 - n10 % 4) * 8; + int n13 = n8 + n9; + while (n13-- != n8) { + int n14 = nArray8[n13] >>> n12 & 0xFF ^ n11; + nArray6[n14] = nArray6[n14] + 1; + } + n13 = -1; + int n15 = n8; + for (n7 = 0; n7 < 256; ++n7) { + if (nArray6[n7] != 0) { + n13 = n7; + } + nArray7[n7] = n15 += nArray6[n7]; + } + n7 = n8 + n9 - nArray6[n13]; + int n16 = -1; + for (n15 = n8; n15 <= n7; n15 += nArray6[n16]) { + int n17 = nArray[n15]; + int n18 = nArray2[n15]; + n16 = nArray8[n15] >>> n12 & 0xFF ^ n11; + if (n15 < n7) { + while (true) { + int n19 = n16; + int n20 = nArray7[n19] - 1; + nArray7[n19] = n20; + int n21 = n20; + if (n20 <= n15) break; + n16 = nArray8[n21] >>> n12 & 0xFF ^ n11; + int n22 = n17; + n17 = nArray[n21]; + nArray[n21] = n22; + n22 = n18; + n18 = nArray2[n21]; + nArray2[n21] = n22; + } + nArray[n15] = n17; + nArray2[n15] = n18; + } + if (n10 < 7 && nArray6[n16] > 1) { + if (nArray6[n16] < 1024) { + IlllIlIllIlllIlIIlIlllIll.IlIlllIIIIllIllllIllIIlIl(nArray, nArray2, n15, n15 + nArray6[n16]); + } else { + nArray3[n6] = n15; + nArray4[n6] = nArray6[n16]; + nArray5[n6++] = n10 + 1; + } + } + nArray6[n16] = 0; + } + } + } + + public static void IIIllIllIlIlllllllIlIlIII(int[] nArray, int[] nArray2, int n, int n2) { + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n, n2); + return; + } + int n3 = 2; + if (nArray.length != nArray2.length) { + throw new IllegalArgumentException("Array size mismatch."); + } + int n4 = 7; + LinkedBlockingQueue linkedBlockingQueue = new LinkedBlockingQueue(); + linkedBlockingQueue.add(new lIIllIlIIlIIIIIlIIlIlIIll(n, n2 - n, 0)); + AtomicInteger atomicInteger = new AtomicInteger(1); + int n5 = Runtime.getRuntime().availableProcessors(); + ExecutorService executorService = Executors.newFixedThreadPool(n5, Executors.defaultThreadFactory()); + ExecutorCompletionService executorCompletionService = new ExecutorCompletionService(executorService); + int n6 = n5; + while (n6-- != 0) { + executorCompletionService.submit(new lIlIllIlIllIlllIIIIllIlII(atomicInteger, n5, linkedBlockingQueue, nArray, nArray2)); + } + Throwable throwable = null; + int n7 = n5; + while (n7-- != 0) { + try { + executorCompletionService.take().get(); + } catch (Exception exception) { + throwable = exception.getCause(); + } + } + executorService.shutdown(); + if (throwable != null) { + throw throwable instanceof RuntimeException ? (RuntimeException)throwable : new RuntimeException(throwable); + } + } + + public static void lIIIIllIIlIlIllIIIlIllIlI(int[] nArray, int[] nArray2) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray, nArray2); + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(nArray, nArray2, 0, nArray.length); + } + + private static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2, int[] nArray3, int n, int n2) { + int n3 = n; + while (++n3 < n2) { + int n4 = nArray[n3]; + int n5 = n3; + int n6 = nArray[n5 - 1]; + while (nArray2[n4] < nArray2[n6] || nArray2[n4] == nArray2[n6] && nArray3[n4] < nArray3[n6]) { + nArray[n5] = n6; + if (n == n5 - 1) { + --n5; + break; + } + n6 = nArray[--n5 - 1]; + } + nArray[n5] = n4; + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2, int[] nArray3, boolean bl) { + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(nArray2, nArray3); + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, nArray3, 0, nArray2.length, bl); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2, int[] nArray3, int n, int n2, boolean bl) { + int[] nArray4; + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, nArray3, n, n2); + return; + } + int n3 = 2; + int n4 = 7; + int n5 = 1786; + int n6 = 0; + int[] nArray5 = new int[1786]; + int[] nArray6 = new int[1786]; + int[] nArray7 = new int[1786]; + nArray5[n6] = n; + nArray6[n6] = n2 - n; + nArray7[n6++] = 0; + int[] nArray8 = new int[256]; + int[] nArray9 = new int[256]; + int[] nArray10 = nArray4 = bl ? new int[nArray.length] : null; + while (n6 > 0) { + int n7; + int n8; + int n9 = nArray5[--n6]; + int n10 = nArray6[n6]; + int n11 = nArray7[n6]; + int n12 = n11 % 4 == 0 ? 128 : 0; + int[] nArray11 = n11 < 4 ? nArray2 : nArray3; + int n13 = (3 - n11 % 4) * 8; + int n14 = n9 + n10; + while (n14-- != n9) { + int n15 = nArray11[nArray[n14]] >>> n13 & 0xFF ^ n12; + nArray8[n15] = nArray8[n15] + 1; + } + n14 = -1; + int n16 = n8 = bl ? 0 : n9; + for (n7 = 0; n7 < 256; ++n7) { + if (nArray8[n7] != 0) { + n14 = n7; + } + nArray9[n7] = n8 += nArray8[n7]; + } + if (bl) { + n7 = n9 + n10; + while (n7-- != n9) { + int n17 = nArray11[nArray[n7]] >>> n13 & 0xFF ^ n12; + int n18 = nArray9[n17] - 1; + nArray9[n17] = n18; + nArray4[n18] = nArray[n7]; + } + System.arraycopy(nArray4, 0, nArray, n9, n10); + n8 = n9; + for (n7 = 0; n7 < 256; ++n7) { + if (n11 < 7 && nArray8[n7] > 1) { + if (nArray8[n7] < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, nArray3, n8, n8 + nArray8[n7]); + } else { + nArray5[n6] = n8; + nArray6[n6] = nArray8[n7]; + nArray7[n6++] = n11 + 1; + } + } + n8 += nArray8[n7]; + } + Arrays.fill(nArray8, 0); + continue; + } + n7 = n9 + n10 - nArray8[n14]; + int n19 = -1; + for (n8 = n9; n8 <= n7; n8 += nArray8[n19]) { + int n20 = nArray[n8]; + n19 = nArray11[n20] >>> n13 & 0xFF ^ n12; + if (n8 < n7) { + while (true) { + int n21 = n19; + int n22 = nArray9[n21] - 1; + nArray9[n21] = n22; + int n23 = n22; + if (n22 <= n8) break; + int n24 = n20; + n20 = nArray[n23]; + nArray[n23] = n24; + n19 = nArray11[n20] >>> n13 & 0xFF ^ n12; + } + nArray[n8] = n20; + } + if (n11 < 7 && nArray8[n19] > 1) { + if (nArray8[n19] < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, nArray2, nArray3, n8, n8 + nArray8[n19]); + } else { + nArray5[n6] = n8; + nArray6[n6] = nArray8[n19]; + nArray7[n6++] = n11 + 1; + } + } + nArray8[n19] = 0; + } + } + } + + private static void lIIIIlIIllIIlIIlIIIlIIllI(int[][] nArray, int n, int n2, int n3) { + int n4 = nArray.length; + int n5 = n3 / 4; + for (int i = n; i < n2 - 1; ++i) { + int n6; + int n7; + int n8 = i; + block1: for (n7 = i + 1; n7 < n2; ++n7) { + for (n6 = n5; n6 < n4; ++n6) { + if (nArray[n6][n7] < nArray[n6][n8]) { + n8 = n7; + continue block1; + } + if (nArray[n6][n7] > nArray[n6][n8]) continue block1; + } + } + if (n8 == i) continue; + n7 = n4; + while (n7-- != 0) { + n6 = nArray[n7][i]; + nArray[n7][i] = nArray[n7][n8]; + nArray[n7][n8] = n6; + } + } + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[][] nArray) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, 0, nArray[0].length); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int[][] nArray, int n, int n2) { + if (n2 - n < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n, n2, 0); + return; + } + int n3 = nArray.length; + int n4 = 4 * n3 - 1; + int n5 = n3; + int n6 = nArray[0].length; + while (n5-- != 0) { + if (nArray[n5].length == n6) continue; + throw new IllegalArgumentException("The array of index " + n5 + " has not the same length of the array of index 0."); + } + n5 = 255 * (n3 * 4 - 1) + 1; + n6 = 0; + int[] nArray2 = new int[n5]; + int[] nArray3 = new int[n5]; + int[] nArray4 = new int[n5]; + nArray2[n6] = n; + nArray3[n6] = n2 - n; + nArray4[n6++] = 0; + int[] nArray5 = new int[256]; + int[] nArray6 = new int[256]; + int[] nArray7 = new int[n3]; + while (n6 > 0) { + int n7; + int n8 = nArray2[--n6]; + int n9 = nArray3[n6]; + int n10 = nArray4[n6]; + int n11 = n10 % 4 == 0 ? 128 : 0; + int[] nArray8 = nArray[n10 / 4]; + int n12 = (3 - n10 % 4) * 8; + int n13 = n8 + n9; + while (n13-- != n8) { + int n14 = nArray8[n13] >>> n12 & 0xFF ^ n11; + nArray5[n14] = nArray5[n14] + 1; + } + n13 = -1; + int n15 = n8; + for (n7 = 0; n7 < 256; ++n7) { + if (nArray5[n7] != 0) { + n13 = n7; + } + nArray6[n7] = n15 += nArray5[n7]; + } + n7 = n8 + n9 - nArray5[n13]; + int n16 = -1; + for (n15 = n8; n15 <= n7; n15 += nArray5[n16]) { + int n17 = n3; + while (n17-- != 0) { + nArray7[n17] = nArray[n17][n15]; + } + n16 = nArray8[n15] >>> n12 & 0xFF ^ n11; + if (n15 < n7) { + block6: while (true) { + int n18 = n16; + int n19 = nArray6[n18] - 1; + nArray6[n18] = n19; + int n20 = n19; + if (n19 <= n15) break; + n16 = nArray8[n20] >>> n12 & 0xFF ^ n11; + n17 = n3; + while (true) { + if (n17-- == 0) continue block6; + int n21 = nArray7[n17]; + nArray7[n17] = nArray[n17][n20]; + nArray[n17][n20] = n21; + } + } + n17 = n3; + while (n17-- != 0) { + nArray[n17][n15] = nArray7[n17]; + } + } + if (n10 < n4 && nArray5[n16] > 1) { + if (nArray5[n16] < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(nArray, n15, n15 + nArray5[n16], n10 + 1); + } else { + nArray2[n6] = n15; + nArray3[n6] = nArray5[n16]; + nArray4[n6++] = n10 + 1; + } + } + nArray5[n16] = 0; + } + } + } + + public static int[] lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int n, int n2, Random random) { + int n3 = n2 - n; + while (n3-- != 0) { + int n4 = random.nextInt(n3 + 1); + int n5 = nArray[n + n3]; + nArray[n + n3] = nArray[n + n4]; + nArray[n + n4] = n5; + } + return nArray; + } + + public static int[] lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, Random random) { + int n = nArray.length; + while (n-- != 0) { + int n2 = random.nextInt(n + 1); + int n3 = nArray[n]; + nArray[n] = nArray[n2]; + nArray[n2] = n3; + } + return nArray; + } + + public static int[] IIIllIllIlIlllllllIlIlIII(int[] nArray) { + int n = nArray.length; + int n2 = n / 2; + while (n2-- != 0) { + int n3 = nArray[n - n2 - 1]; + nArray[n - n2 - 1] = nArray[n2]; + nArray[n2] = n3; + } + return nArray; + } + + public static int[] llIIlllIIIIlllIllIlIlllIl(int[] nArray, int n, int n2) { + int n3 = n2 - n; + int n4 = n3 / 2; + while (n4-- != 0) { + int n5 = nArray[n + n3 - n4 - 1]; + nArray[n + n3 - n4 - 1] = nArray[n + n4]; + nArray[n + n4] = n5; + } + return nArray; + } + + static int lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + return IlllIlIllIlllIlIIlIlllIll.IlllIIIlIlllIllIlIIlllIlI(nArray, n, n2, n3, lIlIIIIlIlIlllIlIIllIlIll2); + } + + static int IIIIllIlIIIllIlllIlllllIl(int[] nArray, int n, int n2, int n3) { + return IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, n, n2, n3); + } + + static int lIIIIlIIllIIlIIlIIIlIIllI(int[] nArray, int[] nArray2, int n, int n2, int n3) { + return IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(nArray, nArray2, n, n2, n3); + } + + static int lIIIIIIIIIlIllIIllIlIIlIl(int[] nArray, int[] nArray2, int n, int n2, int n3) { + return IlllIlIllIlllIlIIlIlllIll.IIIIllIIllIIIIllIllIIIlIl(nArray, nArray2, n, n2, n3); + } + + static void IllIIIIIIIlIlIllllIIllIII(int[] nArray, int[] nArray2, int n, int n2) { + IlllIlIllIlllIlIIlIlllIll.IlllIllIlIIIIlIIlIIllIIIl(nArray, nArray2, n, n2); + } + + static void IlllIIIlIlllIllIlIIlllIlI(int[] nArray, int[] nArray2, int n, int n2, int n3) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(nArray, nArray2, n, n2, n3); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlllIlIlIllIIlIIIIlIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlllIlIlIllIIlIIIIlIl.java new file mode 100644 index 0000000..c59b046 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllIlllIlIlIllIIlIIIIlIl.java @@ -0,0 +1,5 @@ +package com.cheatbreaker.client.util.font; + +class IlllIlllIlIlIllIIlIIIIlIl { +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllllIlIIIIllIIIlIlIlIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllllIlIIIIllIIIlIlIlIII.java new file mode 100644 index 0000000..16d3875 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/IlllllIlIIIIllIIIlIlIlIII.java @@ -0,0 +1,35 @@ +package com.cheatbreaker.client.util.font; + +import java.io.Serializable; +import java.util.Arrays; + +final class IlllllIlIIIIllIIIlIlIlIII + implements Serializable, + lllIIIIIIllIlllIlIIlIlIll { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = -7046029254386353129L; + + private IlllllIlIIIIllIIIlIlIlIII() { + } + + public int lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray) { + return Arrays.hashCode(objectArray); + } + + public boolean lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, Object[] objectArray2) { + return Arrays.equals(objectArray, objectArray2); + } + + IlllllIlIIIIllIIIlIlIlIII(IlllIlllIlIlIllIIlIIIIlIl illlIlllIlIlIllIIlIIIIlIl) { + this(); + } + + @Override + public int lIIIIlIIllIIlIIlIIIlIIllI(Object var1) { + return 0; + } + + @Override + public boolean lIIIIlIIllIIlIIlIIIlIIllI(Object var1, Object var2) { + return false; + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassEleven.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassEleven.java new file mode 100644 index 0000000..f732dd4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassEleven.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +class TestClassEleven + extends AbstractClassThree { + final TestClassFive lIIIIlIIllIIlIIlIIIlIIllI; + + TestClassEleven(TestClassFive testClassFive) { + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFive; + } + + @Override + public boolean contains(Object object) { + return this.lIIIIlIIllIIlIIlIIIlIIllI.containsKey(object); + } + + @Override + public int size() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.size(); + } + + @Override + public void clear() { + this.lIIIIlIIllIIlIIlIIIlIIllI.clear(); + } + + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return new IlIlIIIIIIIlIIllIIIIllIII(this); + } + + @Override + public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassFive.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassFive.java new file mode 100644 index 0000000..4c42630 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassFive.java @@ -0,0 +1,132 @@ +package com.cheatbreaker.client.util.font; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +public abstract class TestClassFive + extends AbstractTestClassOne + implements Serializable, + ITestClassFour { + private static final long lIIIIIIIIIlIllIIllIlIIlIl = -4940583368468432370L; + + protected TestClassFive() { + } + + @Override + public boolean containsValue(Object object) { + return this.IlllIIIlIlllIllIlIIlllIlI().contains(object); + } + + @Override + public boolean containsKey(Object object) { + return this.lIIIIIIIIIlIllIIllIlIIlIl().contains(object); + } + + public void putAll(Map map) { + int n = map.size(); + Iterator iterator = map.entrySet().iterator(); + if (map instanceof ITestClassFour) { + while (n-- != 0) { + llIlIlIlIIlIIllIllIIlllIl llIlIlIlIIlIIllIllIIlllIl2 = (llIlIlIlIIlIIllIllIIlllIl)iterator.next(); + this.put(llIlIlIlIIlIIllIllIIlllIl2.getKey(), llIlIlIlIIlIIllIllIIlllIl2.getValue()); + } + } else { + while (n-- != 0) { + Map.Entry entry = (Entry) iterator.next(); + this.put(entry.getKey(), entry.getValue()); + } + } + } + + @Override + public boolean isEmpty() { + return this.size() == 0; + } + + @Override + public ITestClassSeven lIIIIIIIIIlIllIIllIlIIlIl() { + return new TestClassEleven(this); + } + + @Override + public ITestClassEight IlllIIIlIlllIllIlIIlllIlI() { + return new lllIIIIIlIIIIIIIIlllIIIII(this); + } + + @Override + public ITestClassSeven IIIIllIlIIIllIlllIlllllIl() { + return this.IIIIllIIllIIIIllIllIIIlIl(); + } + + @Override + public int hashCode() { + int n = 0; + int n2 = this.size(); + ITestClassFive iTestClassFive = this.IIIIllIlIIIllIlllIlllllIl().lIIIIlIIllIIlIIlIIIlIIllI(); + while (n2-- != 0) { + n += ((Map.Entry)iTestClassFive.next()).hashCode(); + } + return n; + } + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (!(object instanceof Map)) { + return false; + } + Map map = (Map)object; + if (map.size() != this.size()) { + return false; + } + return this.IIIIllIlIIIllIlllIlllllIl().containsAll(map.entrySet()); + } + + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + ITestClassFive iTestClassFive = this.IIIIllIlIIIllIlllIlllllIl().lIIIIlIIllIIlIIlIIIlIIllI(); + int n = this.size(); + boolean bl = true; + stringBuilder.append("{"); + while (n-- != 0) { + if (bl) { + bl = false; + } else { + stringBuilder.append(", "); + } + llIlIlIlIIlIIllIllIIlllIl llIlIlIlIIlIIllIllIIlllIl2 = (llIlIlIlIIlIIllIllIIlllIl)iTestClassFive.next(); + if (this == llIlIlIlIIlIIllIllIIlllIl2.getKey()) { + stringBuilder.append("(this map)"); + } else { + stringBuilder.append(String.valueOf(llIlIlIlIIlIIllIllIIlllIl2.getKey())); + } + stringBuilder.append("=>"); + if (this == llIlIlIlIIlIIllIllIIlllIl2.getValue()) { + stringBuilder.append("(this map)"); + continue; + } + stringBuilder.append(String.valueOf(llIlIlIlIIlIIllIllIIlllIl2.getValue())); + } + stringBuilder.append("}"); + return stringBuilder.toString(); + } + + @Override + public Set entrySet() { + return this.IIIIllIlIIIllIlllIlllllIl(); + } + + @Override + public Collection values() { + return this.IlllIIIlIlllIllIlIIlllIlI(); + } + + @Override + public Set keySet() { + return this.lIIIIIIIIIlIllIIllIlIIlIl(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassFour.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassFour.java new file mode 100644 index 0000000..45a3567 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassFour.java @@ -0,0 +1,502 @@ +package com.cheatbreaker.client.util.font; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +public class TestClassFour + extends TestClassFive + implements ITestClass, + Serializable, + Cloneable { + private static final long IlIIlIIIIlIIIIllllIIlIllI = 0L; + private static final boolean lIIlIIllIIIIIlIllIIIIllII = false; + protected transient Object[] IlllIllIlIIIIlIIlIIllIIIl; + protected transient Object[] IlIlllIIIIllIllllIllIIlIl; + protected transient int llIIlllIIIIlllIllIlIlllIl; + protected transient boolean lIIlIlIllIIlIIIlIIIlllIII; + protected transient int IIIlllIIIllIllIlIIIIIIlII; + protected transient int llIlIIIlIIIIlIlllIlIIIIll; + protected int IIIlIIllllIIllllllIlIIIll; + protected final float lllIIIIIlIllIlIIIllllllII; + protected transient ITestClassSix lIIIIIllllIIIIlIlIIIIlIlI; + protected transient ITestClassSeven IIIIIIlIlIlIllllllIlllIlI; + protected transient ITestClassEight IllIllIIIlIIlllIIIllIllII; + + public TestClassFour(int n, float f) { + if (f <= 0.0f || f > 1.0f) { + throw new IllegalArgumentException("Load factor must be greater than 0 and smaller than or equal to 1"); + } + if (n < 0) { + throw new IllegalArgumentException("The expected number of elements must be nonnegative"); + } + this.lllIIIIIlIllIlIIIllllllII = f; + this.IIIlllIIIllIllIlIIIIIIlII = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(n, f); + this.llIIlllIIIIlllIllIlIlllIl = this.IIIlllIIIllIllIlIIIIIIlII - 1; + this.llIlIIIlIIIIlIlllIlIIIIll = TestClassSeven.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIlllIIIllIllIlIIIIIIlII, f); + this.IlllIllIlIIIIlIIlIIllIIIl = new Object[this.IIIlllIIIllIllIlIIIIIIlII + 1]; + this.IlIlllIIIIllIllllIllIIlIl = new Object[this.IIIlllIIIllIllIlIIIIIIlII + 1]; + } + + public TestClassFour(int n) { + this(n, 2.55f * 0.29411766f); + } + + public TestClassFour() { + this(16, 3.0f * 0.25f); + } + + public TestClassFour(Map map, float f) { + this(map.size(), f); + this.putAll(map); + } + + public TestClassFour(Map map) { + this(map, 0.25252524f * 2.97f); + } + + public TestClassFour(ITestClassFour iTestClassFour, float f) { + this(iTestClassFour.size(), f); + this.putAll((Map)iTestClassFour); + } + + public TestClassFour(ITestClassFour iTestClassFour) { + this(iTestClassFour, 0.28723404f * 2.6111112f); + } + + public TestClassFour(Object[] objectArray, Object[] objectArray2, float f) { + this(objectArray.length, f); + if (objectArray.length != objectArray2.length) { + throw new IllegalArgumentException("The key array and the value array have different lengths (" + objectArray.length + " and " + objectArray2.length + ")"); + } + for (int i = 0; i < objectArray.length; ++i) { + this.put(objectArray[i], objectArray2[i]); + } + } + + public TestClassFour(Object[] objectArray, Object[] objectArray2) { + this(objectArray, objectArray2, 7.285714f * 0.10294118f); + } + + private int IlIlllIIIIllIllllIllIIlIl() { + return this.lIIlIlIllIIlIIIlIIIlllIII ? this.IIIlIIllllIIllllllIlIIIll - 1 : this.IIIlIIllllIIllllllIlIIIll; + } + + private void IIIIllIIllIIIIllIllIIIlIl(int n) { + int n2 = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(n, this.lllIIIIIlIllIlIIIllllllII); + if (n2 > this.IIIlllIIIllIllIlIIIIIIlII) { + this.IIIIllIlIIIllIlllIlllllIl(n2); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(long l) { + int n = (int)Math.min(0x40000000L, Math.max(2L, TestClassSeven.IIIIllIIllIIIIllIllIIIlIl((long)Math.ceil((float)l / this.lllIIIIIlIllIlIIIllllllII)))); + if (n > this.IIIlllIIIllIllIlIIIIIIlII) { + this.IIIIllIlIIIllIlllIlllllIl(n); + } + } + + private Object IlIlIIIlllIIIlIlllIlIllIl(int n) { + Object object = this.IlIlllIIIIllIllllIllIIlIl[n]; + this.IlIlllIIIIllIllllIllIIlIl[n] = null; + --this.IIIlIIllllIIllllllIlIIIll; + this.lIIIIlIIllIIlIIlIIIlIIllI(n); + if (this.IIIlIIllllIIllllllIlIIIll < this.llIlIIIlIIIIlIlllIlIIIIll / 4 && this.IIIlllIIIllIllIlIIIIIIlII > 16) { + this.IIIIllIlIIIllIlllIlllllIl(this.IIIlllIIIllIllIlIIIIIIlII / 2); + } + return object; + } + + private Object llIIlllIIIIlllIllIlIlllIl() { + this.lIIlIlIllIIlIIIlIIIlllIII = false; + this.IlllIllIlIIIIlIIlIIllIIIl[this.IIIlllIIIllIllIlIIIIIIlII] = null; + Object object = this.IlIlllIIIIllIllllIllIIlIl[this.IIIlllIIIllIllIlIIIIIIlII]; + this.IlIlllIIIIllIllllIllIIlIl[this.IIIlllIIIllIllIlIIIIIIlII] = null; + --this.IIIlIIllllIIllllllIlIIIll; + if (this.IIIlIIllllIIllllllIlIIIll < this.llIlIIIlIIIIlIlllIlIIIIll / 4 && this.IIIlllIIIllIllIlIIIIIIlII > 16) { + this.IIIIllIlIIIllIlllIlllllIl(this.IIIlllIIIllIllIlIIIIIIlII / 2); + } + return object; + } + + @Override + public void putAll(Map map) { + if ((double)this.lllIIIIIlIllIlIIIllllllII <= 1.4347826272868933 * 0.3484848439693451) { + this.IIIIllIIllIIIIllIllIIIlIl(map.size()); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI((long)(this.size() + map.size())); + } + super.putAll(map); + } + + private int lIIIIlIIllIIlIIlIIIlIIllI(Object object, Object object2) { + int n; + if (object == null) { + if (this.lIIlIlIllIIlIIIlIIIlllIII) { + return this.IIIlllIIIllIllIlIIIIIIlII; + } + this.lIIlIlIllIIlIIIlIIIlllIII = true; + n = this.IIIlllIIIllIllIlIIIIIIlII; + } else { + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.llIIlllIIIIlllIllIlIlllIl; + Object object3 = objectArray[n]; + if (object3 != null) { + if (object3.equals(object)) { + return n; + } + while ((object3 = objectArray[n = n + 1 & this.llIIlllIIIIlllIllIlIlllIl]) != null) { + if (!object3.equals(object)) continue; + return n; + } + } + } + this.IlllIllIlIIIIlIIlIIllIIIl[n] = object; + this.IlIlllIIIIllIllllIllIIlIl[n] = object2; + if (this.IIIlIIllllIIllllllIlIIIll++ >= this.llIlIIIlIIIIlIlllIlIIIIll) { + this.IIIIllIlIIIllIlllIlllllIl(TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(this.IIIlIIllllIIllllllIlIIIll + 1, this.lllIIIIIlIllIlIIIllllllII)); + } + return -1; + } + + @Override + public Object put(Object object, Object object2) { + int n = this.lIIIIlIIllIIlIIlIIIlIIllI(object, object2); + if (n < 0) { + return this.a_; + } + Object object3 = this.IlIlllIIIIllIllllIllIIlIl[n]; + this.IlIlllIIIIllIllllIllIIlIl[n] = object2; + return object3; + } + + protected final void lIIIIlIIllIIlIIlIIIlIIllI(int n) { + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + while (true) { + Object object; + int n2 = n; + n = n2 + 1 & this.llIIlllIIIIlllIllIlIlllIl; + while (true) { + if ((object = objectArray[n]) == null) { + objectArray[n2] = null; + this.IlIlllIIIIllIllllIllIIlIl[n2] = null; + return; + } + int n3 = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.llIIlllIIIIlllIllIlIlllIl; + if (n2 <= n ? n2 >= n3 || n3 > n : n2 >= n3 && n3 > n) break; + n = n + 1 & this.llIIlllIIIIlllIllIlIlllIl; + } + objectArray[n2] = object; + this.IlIlllIIIIllIllllIllIIlIl[n2] = this.IlIlllIIIIllIllllIllIIlIl[n]; + } + } + + @Override + public Object remove(Object object) { + if (object == null) { + if (this.lIIlIlIllIIlIIIlIIIlllIII) { + return this.llIIlllIIIIlllIllIlIlllIl(); + } + return this.a_; + } + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + int n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.llIIlllIIIIlllIllIlIlllIl; + Object object2 = objectArray[n]; + if (object2 == null) { + return this.a_; + } + if (object.equals(object2)) { + return this.IlIlIIIlllIIIlIlllIlIllIl(n); + } + do { + if ((object2 = objectArray[n = n + 1 & this.llIIlllIIIIlllIllIlIlllIl]) != null) continue; + return this.a_; + } while (!object.equals(object2)); + return this.IlIlIIIlllIIIlIlllIlIllIl(n); + } + + @Override + public Object get(Object object) { + if (object == null) { + return this.lIIlIlIllIIlIIIlIIIlllIII ? this.IlIlllIIIIllIllllIllIIlIl[this.IIIlllIIIllIllIlIIIIIIlII] : this.a_; + } + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + int n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.llIIlllIIIIlllIllIlIlllIl; + Object object2 = objectArray[n]; + if (object2 == null) { + return this.a_; + } + if (object.equals(object2)) { + return this.IlIlllIIIIllIllllIllIIlIl[n]; + } + do { + if ((object2 = objectArray[n = n + 1 & this.llIIlllIIIIlllIllIlIlllIl]) != null) continue; + return this.a_; + } while (!object.equals(object2)); + return this.IlIlllIIIIllIllllIllIIlIl[n]; + } + + @Override + public boolean containsKey(Object object) { + if (object == null) { + return this.lIIlIlIllIIlIIIlIIIlllIII; + } + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + int n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.llIIlllIIIIlllIllIlIlllIl; + Object object2 = objectArray[n]; + if (object2 == null) { + return false; + } + if (object.equals(object2)) { + return true; + } + do { + if ((object2 = objectArray[n = n + 1 & this.llIIlllIIIIlllIllIlIlllIl]) != null) continue; + return false; + } while (!object.equals(object2)); + return true; + } + + @Override + public boolean containsValue(Object object) { + Object[] objectArray = this.IlIlllIIIIllIllllIllIIlIl; + Object[] objectArray2 = this.IlllIllIlIIIIlIIlIIllIIIl; + if (this.lIIlIlIllIIlIIIlIIIlllIII && (objectArray[this.IIIlllIIIllIllIlIIIIIIlII] == null ? object == null : objectArray[this.IIIlllIIIllIllIlIIIIIIlII].equals(object))) { + return true; + } + int n = this.IIIlllIIIllIllIlIIIIIIlII; + while (n-- != 0) { + if (objectArray2[n] == null || !(objectArray[n] == null ? object == null : objectArray[n].equals(object))) continue; + return true; + } + return false; + } + + @Override + public void clear() { + if (this.IIIlIIllllIIllllllIlIIIll == 0) { + return; + } + this.IIIlIIllllIIllllllIlIIIll = 0; + this.lIIlIlIllIIlIIIlIIIlllIII = false; + Arrays.fill(this.IlllIllIlIIIIlIIlIIllIIIl, null); + Arrays.fill(this.IlIlllIIIIllIllllIllIIlIl, null); + } + + @Override + public int size() { + return this.IIIlIIllllIIllllllIlIIIll; + } + + @Override + public boolean isEmpty() { + return this.IIIlIIllllIIllllllIlIIIll == 0; + } + + @Deprecated + public void lIIIIIIIIIlIllIIllIlIIlIl(int n) { + } + + @Deprecated + public int IlIlIIIlllIIIlIlllIlIllIl() { + return 16; + } + + public ITestClassSix IIIllIllIlIlllllllIlIlIII() { + if (this.lIIIIIllllIIIIlIlIIIIlIlI == null) { + this.lIIIIIllllIIIIlIlIIIIlIlI = new TestClassTen(this, null); + } + return this.lIIIIIllllIIIIlIlIIIIlIlI; + } + + @Override + public ITestClassSeven lIIIIIIIIIlIllIIllIlIIlIl() { + if (this.IIIIIIlIlIlIllllllIlllIlI == null) { + this.IIIIIIlIlIlIllllllIlllIlI = new llIIIIlIlIlIlllIIIlllllIl(this, null); + } + return this.IIIIIIlIlIlIllllllIlllIlI; + } + + @Override + public ITestClassEight IlllIIIlIlllIllIlIIlllIlI() { + if (this.IllIllIIIlIIlllIIIllIllII == null) { + this.IllIllIIIlIIlllIIIllIllII = new IlIlIllIIllllIlllIlllIlII(this); + } + return this.IllIllIIIlIIlllIIIllIllII; + } + + @Deprecated + public boolean IllIIIIIIIlIlIllllIIllIII() { + return true; + } + + public boolean lIIIIllIIlIlIllIIIlIllIlI() { + int n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(this.IIIlIIllllIIllllllIlIIIll, this.lllIIIIIlIllIlIIIllllllII); + if (n >= this.IIIlllIIIllIllIlIIIIIIlII || this.IIIlIIllllIIllllllIlIIIll > TestClassSeven.lIIIIlIIllIIlIIlIIIlIIllI(n, this.lllIIIIIlIllIlIIIllllllII)) { + return true; + } + try { + this.IIIIllIlIIIllIlllIlllllIl(n); + } catch (OutOfMemoryError outOfMemoryError) { + return false; + } + return true; + } + + public boolean IlllIIIlIlllIllIlIIlllIlI(int n) { + int n2 = TestClassSeven.IIIIllIlIIIllIlllIlllllIl((int)Math.ceil((float)n / this.lllIIIIIlIllIlIIIllllllII)); + if (n2 >= n || this.IIIlIIllllIIllllllIlIIIll > TestClassSeven.lIIIIlIIllIIlIIlIIIlIIllI(n2, this.lllIIIIIlIllIlIIIllllllII)) { + return true; + } + try { + this.IIIIllIlIIIllIlllIlllllIl(n2); + } catch (OutOfMemoryError outOfMemoryError) { + return false; + } + return true; + } + + protected void IIIIllIlIIIllIlllIlllllIl(int n) { + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + Object[] objectArray2 = this.IlIlllIIIIllIllllIllIIlIl; + int n2 = n - 1; + Object[] objectArray3 = new Object[n + 1]; + Object[] objectArray4 = new Object[n + 1]; + int n3 = this.IIIlllIIIllIllIlIIIIIIlII; + int n4 = this.IlIlllIIIIllIllllIllIIlIl(); + while (n4-- != 0) { + while (objectArray[--n3] == null) { + } + int n5 = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(objectArray[n3].hashCode()) & n2; + if (objectArray3[n5] != null) { + while (objectArray3[n5 = n5 + 1 & n2] != null) { + } + } + objectArray3[n5] = objectArray[n3]; + objectArray4[n5] = objectArray2[n3]; + } + objectArray4[n] = objectArray2[this.IIIlllIIIllIllIlIIIIIIlII]; + this.IIIlllIIIllIllIlIIIIIIlII = n; + this.llIIlllIIIIlllIllIlIlllIl = n2; + this.llIlIIIlIIIIlIlllIlIIIIll = TestClassSeven.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIlllIIIllIllIlIIIIIIlII, this.lllIIIIIlIllIlIIIllllllII); + this.IlllIllIlIIIIlIIlIIllIIIl = objectArray3; + this.IlIlllIIIIllIllllIllIIlIl = objectArray4; + } + + public TestClassFour IlllIllIlIIIIlIIlIIllIIIl() { + TestClassFour testClassFour; + try { + testClassFour = (TestClassFour)super.clone(); + } catch (CloneNotSupportedException cloneNotSupportedException) { + throw new InternalError(); + } + testClassFour.IIIIIIlIlIlIllllllIlllIlI = null; + testClassFour.IllIllIIIlIIlllIIIllIllII = null; + testClassFour.lIIIIIllllIIIIlIlIIIIlIlI = null; + testClassFour.lIIlIlIllIIlIIIlIIIlllIII = this.lIIlIlIllIIlIIIlIIIlllIII; + testClassFour.IlllIllIlIIIIlIIlIIllIIIl = (Object[])this.IlllIllIlIIIIlIIlIIllIIIl.clone(); + testClassFour.IlIlllIIIIllIllllIllIIlIl = (Object[])this.IlIlllIIIIllIllllIllIIlIl.clone(); + return testClassFour; + } + + @Override + public int hashCode() { + int n = 0; + int n2 = this.IlIlllIIIIllIllllIllIIlIl(); + int n3 = 0; + int n4 = 0; + while (n2-- != 0) { + while (this.IlllIllIlIIIIlIIlIIllIIIl[n3] == null) { + ++n3; + } + if (this != this.IlllIllIlIIIIlIIlIIllIIIl[n3]) { + n4 = this.IlllIllIlIIIIlIIlIIllIIIl[n3].hashCode(); + } + if (this != this.IlIlllIIIIllIllllIllIIlIl[n3]) { + n4 ^= this.IlIlllIIIIllIllllIllIIlIl[n3] == null ? 0 : this.IlIlllIIIIllIllllIllIIlIl[n3].hashCode(); + } + n += n4; + ++n3; + } + if (this.lIIlIlIllIIlIIIlIIIlllIII) { + n += this.IlIlllIIIIllIllllIllIIlIl[this.IIIlllIIIllIllIlIIIIIIlII] == null ? 0 : this.IlIlllIIIIllIllllIllIIlIl[this.IIIlllIIIllIllIlIIIIIIlII].hashCode(); + } + return n; + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ObjectOutputStream objectOutputStream) throws IOException { + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + Object[] objectArray2 = this.IlIlllIIIIllIllllIllIIlIl; + llIllIIllIllIIlIIIIllIIII llIllIIllIllIIlIIIIllIIII2 = new llIllIIllIllIIlIIIIllIIII(this, null); + objectOutputStream.defaultWriteObject(); + int n = this.IIIlIIllllIIllllllIlIIIll; + while (n-- != 0) { + int n2 = llIllIIllIllIIlIIIIllIIII2.lIIIIIIIIIlIllIIllIlIIlIl(); + objectOutputStream.writeObject(objectArray[n2]); + objectOutputStream.writeObject(objectArray2[n2]); + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { + objectInputStream.defaultReadObject(); + this.IIIlllIIIllIllIlIIIIIIlII = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(this.IIIlIIllllIIllllllIlIIIll, this.lllIIIIIlIllIlIIIllllllII); + this.llIlIIIlIIIIlIlllIlIIIIll = TestClassSeven.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIlllIIIllIllIlIIIIIIlII, this.lllIIIIIlIllIlIIIllllllII); + this.llIIlllIIIIlllIllIlIlllIl = this.IIIlllIIIllIllIlIIIIIIlII - 1; + this.IlllIllIlIIIIlIIlIIllIIIl = new Object[this.IIIlllIIIllIllIlIIIIIIlII + 1]; + Object[] objectArray = this.IlllIllIlIIIIlIIlIIllIIIl; + this.IlIlllIIIIllIllllIllIIlIl = new Object[this.IIIlllIIIllIllIlIIIIIIlII + 1]; + Object[] objectArray2 = this.IlIlllIIIIllIllllIllIIlIl; + int n = this.IIIlIIllllIIllllllIlIIIll; + while (n-- != 0) { + int n2; + Object object = objectInputStream.readObject(); + Object object2 = objectInputStream.readObject(); + if (object == null) { + n2 = this.IIIlllIIIllIllIlIIIIIIlII; + this.lIIlIlIllIIlIIIlIIIlllIII = true; + } else { + n2 = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.llIIlllIIIIlllIllIlIlllIl; + while (objectArray[n2] != null) { + n2 = n2 + 1 & this.llIIlllIIIIlllIllIlIlllIl; + } + } + objectArray[n2] = object; + objectArray2[n2] = object2; + } + } + + private void lIIlIlIllIIlIIIlIIIlllIII() { + } + + @Override + public ITestClassSeven IIIIllIIllIIIIllIllIIIlIl() { + return this.IIIllIllIlIlllllllIlIlIII(); + } + + @Override + public Collection values() { + return this.IlllIIIlIlllIllIlIIlllIlI(); + } + + @Override + public Set keySet() { + return this.lIIIIIIIIIlIllIIllIlIIlIl(); + } + + public Object clone() { + return this.IlllIllIlIIIIlIIlIIllIIIl(); + } + + static Object lIIIIlIIllIIlIIlIIIlIIllI(TestClassFour testClassFour) { + return testClassFour.llIIlllIIIIlllIllIlIlllIl(); + } + + static Object lIIIIlIIllIIlIIlIIIlIIllI(TestClassFour testClassFour, int n) { + return testClassFour.IlIlIIIlllIIIlIlllIlIllIl(n); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassOne.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassOne.java new file mode 100644 index 0000000..489441e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassOne.java @@ -0,0 +1,33 @@ +package com.cheatbreaker.client.util.font; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class TestClassOne { + private static final TextureManager renderEngine = Minecraft.getMinecraft().renderEngine; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final ResourceLocation resourceLocation; + + public TestClassOne(int n, ResourceLocation resourceLocation) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.resourceLocation = resourceLocation; + } + + public void lIIIIlIIllIIlIIlIIIlIIllI() { + if (this.resourceLocation == null) { + GL11.glDisable(3553); + } else { + renderEngine.bindTexture(this.resourceLocation); + } + GL11.glCallList(this.lIIIIIIIIIlIllIIllIlIIlIl); + if (this.resourceLocation == null) { + GL11.glEnable(3553); + } + } + + public void lIIIIIIIIIlIllIIllIlIIlIl() { + GL11.glDeleteLists(this.lIIIIIIIIIlIllIIllIlIIlIl, 1); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassSeven.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassSeven.java new file mode 100644 index 0000000..4202bd2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassSeven.java @@ -0,0 +1,109 @@ +package com.cheatbreaker.client.util.font; + +public class TestClassSeven { + public static final Object lIIIIlIIllIIlIIlIIIlIIllI = new Object(); + private static final int lIIIIIIIIIlIllIIllIlIIlIl = -1640531527; + private static final int IlllIIIlIlllIllIlIIlllIlI = 340573321; + private static final long IIIIllIlIIIllIlllIlllllIl = -7046029254386353131L; + private static final long IIIIllIIllIIIIllIllIIIlIl = -1018231460777725123L; + + protected TestClassSeven() { + } + + public static final int lIIIIlIIllIIlIIlIIIlIIllI(int n) { + n ^= n >>> 16; + n *= -2048144789; + n ^= n >>> 13; + n *= -1028477387; + n ^= n >>> 16; + return n; + } + + public static final long lIIIIlIIllIIlIIlIIIlIIllI(long l) { + l ^= l >>> 33; + l *= -49064778989728563L; + l ^= l >>> 33; + l *= -4265267296055464877L; + l ^= l >>> 33; + return l; + } + + public static final int lIIIIIIIIIlIllIIllIlIIlIl(int n) { + int n2 = n * -1640531527; + return n2 ^ n2 >>> 16; + } + + public static final int IlllIIIlIlllIllIlIIlllIlI(int n) { + return (n ^ n >>> 16) * 340573321; + } + + public static final long lIIIIIIIIIlIllIIllIlIIlIl(long l) { + long l2 = l * -7046029254386353131L; + l2 ^= l2 >>> 32; + return l2 ^ l2 >>> 16; + } + + public static final long IlllIIIlIlllIllIlIIlllIlI(long l) { + l ^= l >>> 32; + l ^= l >>> 16; + return (l ^ l >>> 32) * -1018231460777725123L; + } + + public static final int lIIIIlIIllIIlIIlIIIlIIllI(float f) { + return Float.floatToRawIntBits(f); + } + + public static final int lIIIIlIIllIIlIIlIIIlIIllI(double d) { + long l = Double.doubleToRawLongBits(d); + return (int)(l ^ l >>> 32); + } + + public static final int IIIIllIlIIIllIlllIlllllIl(long l) { + return (int)(l ^ l >>> 32); + } + + public static int IIIIllIlIIIllIlllIlllllIl(int n) { + if (n == 0) { + return 1; + } + --n; + n |= n >> 1; + n |= n >> 2; + n |= n >> 4; + n |= n >> 8; + return (n | n >> 16) + 1; + } + + public static long IIIIllIIllIIIIllIllIIIlIl(long l) { + if (l == 0L) { + return 1L; + } + --l; + l |= l >> 1; + l |= l >> 2; + l |= l >> 4; + l |= l >> 8; + l |= l >> 16; + return (l | l >> 32) + 1L; + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(int n, float f) { + return Math.min((int)Math.ceil((float)n * f), n - 1); + } + + public static long lIIIIlIIllIIlIIlIIIlIIllI(long l, float f) { + return Math.min((long)Math.ceil((float)l * f), l - 1L); + } + + public static int lIIIIIIIIIlIllIIllIlIIlIl(int n, float f) { + long l = Math.max(2L, TestClassSeven.IIIIllIIllIIIIllIllIIIlIl((long)Math.ceil((float)n / f))); + if (l > 0x40000000L) { + throw new IllegalArgumentException("Too large (" + n + " expected elements with load factor " + f + ")"); + } + return (int)l; + } + + public static long lIIIIIIIIIlIllIIllIlIIlIl(long l, float f) { + return TestClassSeven.IIIIllIIllIIIIllIllIIIlIl((long)Math.ceil((float)l / f)); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassSix.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassSix.java new file mode 100644 index 0000000..9931549 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassSix.java @@ -0,0 +1,45 @@ +package com.cheatbreaker.client.util.font; + +import java.util.List; + +public class TestClassSix { + private final List lIIIIlIIllIIlIIlIIIlIIllI; + private final float lIIIIIIIIIlIllIIllIlIIlIl; + private long IlllIIIlIlllIllIlIIlllIlI; + private final boolean IIIIllIlIIIllIlllIlllllIl; + + public TestClassSix(List list, float f, long l, boolean bl) { + this.lIIIIlIIllIIlIIlIIIlIIllI = list; + this.lIIIIIIIIIlIllIIllIlIIlIl = f; + this.IlllIIIlIlllIllIlIIlllIlI = l; + this.IIIIllIlIIIllIlllIlllllIl = bl; + } + + public void lIIIIlIIllIIlIIlIIIlIIllI() { + for (TestClassOne testClassOne : this.lIIIIlIIllIIlIIlIIIlIIllI) { + testClassOne.lIIIIlIIllIIlIIlIIIlIIllI(); + } + } + + public void lIIIIIIIIIlIllIIllIlIIlIl() { + for (TestClassOne testClassOne : this.lIIIIlIIllIIlIIlIIIlIIllI) { + testClassOne.lIIIIIIIIIlIllIIllIlIIlIl(); + } + } + + public float IlllIIIlIlllIllIlIIlllIlI() { + return this.lIIIIIIIIIlIllIIllIlIIlIl; + } + + public long IIIIllIlIIIllIlllIlllllIl() { + return this.IlllIIIlIlllIllIlIIlllIlI; + } + + public void lIIIIlIIllIIlIIlIIIlIIllI(long l) { + this.IlllIIIlIlllIllIlIIlllIlI = l; + } + + public boolean IIIIllIIllIIIIllIllIIIlIl() { + return this.IIIIllIlIIIllIlllIlllllIl; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassTen.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassTen.java new file mode 100644 index 0000000..2271937 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassTen.java @@ -0,0 +1,106 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; +import java.util.Map; + +final class TestClassTen + extends AbstractClassThree + implements ITestClassSix { + final TestClassFour lIIIIlIIllIIlIIlIIIlIIllI; + + private TestClassTen(TestClassFour testClassFour) { + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFour; + } + + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return new IlIlIIlIIlllIlIlllIIlIIII(this.lIIIIlIIllIIlIIlIIIlIIllI, null); + } + + @Override + public ITestClassFive lIIIIIIIIIlIllIIllIlIIlIl() { + return new IIIlIIlllllIllIIllIllllIl(this.lIIIIlIIllIIlIIlIIIlIIllI, null); + } + + @Override + public boolean contains(Object object) { + if (!(object instanceof Map.Entry)) { + return false; + } + Map.Entry entry = (Map.Entry)object; + Object k = entry.getKey(); + Object v = entry.getValue(); + if (k == null) { + return this.lIIIIlIIllIIlIIlIIIlIIllI.lIIlIlIllIIlIIIlIIIlllIII && (this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlllIIIllIllIlIIIIIIlII] == null ? v == null : this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlllIIIllIllIlIIIIIIlII].equals(v)); + } + Object[] objectArray = this.lIIIIlIIllIIlIIlIIIlIIllI.IlllIllIlIIIIlIIlIIllIIIl; + int n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(k.hashCode()) & this.lIIIIlIIllIIlIIlIIIlIIllI.llIIlllIIIIlllIllIlIlllIl; + Object object2 = objectArray[n]; + if (object2 == null) { + return false; + } + if (k.equals(object2)) { + return this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n] == null ? v == null : this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n].equals(v); + } + do { + if ((object2 = objectArray[n = n + 1 & this.lIIIIlIIllIIlIIlIIIlIIllI.llIIlllIIIIlllIllIlIlllIl]) != null) continue; + return false; + } while (!k.equals(object2)); + return this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n] == null ? v == null : this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n].equals(v); + } + + @Override + public boolean lIIIIIIIIIlIllIIllIlIIlIl(Object object) { + if (!(object instanceof Map.Entry)) { + return false; + } + Map.Entry entry = (Map.Entry)object; + Object k = entry.getKey(); + Object v = entry.getValue(); + if (k == null) { + if (this.lIIIIlIIllIIlIIlIIIlIIllI.lIIlIlIllIIlIIIlIIIlllIII && (this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlllIIIllIllIlIIIIIIlII] == null ? v == null : this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlllIIIllIllIlIIIIIIlII].equals(v))) { + TestClassFour.lIIIIlIIllIIlIIlIIIlIIllI(this.lIIIIlIIllIIlIIlIIIlIIllI); + return true; + } + return false; + } + Object[] objectArray = this.lIIIIlIIllIIlIIlIIIlIIllI.IlllIllIlIIIIlIIlIIllIIIl; + int n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(k.hashCode()) & this.lIIIIlIIllIIlIIlIIIlIIllI.llIIlllIIIIlllIllIlIlllIl; + Object object2 = objectArray[n]; + if (object2 == null) { + return false; + } + if (object2.equals(k)) { + if (this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n] == null ? v == null : this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n].equals(v)) { + TestClassFour.lIIIIlIIllIIlIIlIIIlIIllI(this.lIIIIlIIllIIlIIlIIIlIIllI, n); + return true; + } + return false; + } + do { + if ((object2 = objectArray[n = n + 1 & this.lIIIIlIIllIIlIIlIIIlIIllI.llIIlllIIIIlllIllIlIlllIl]) != null) continue; + return false; + } while (!object2.equals(k) || !(this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n] == null ? v == null : this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[n].equals(v))); + TestClassFour.lIIIIlIIllIIlIIlIIIlIIllI(this.lIIIIlIIllIIlIIlIIIlIIllI, n); + return true; + } + + @Override + public int size() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlIIllllIIllllllIlIIIll; + } + + @Override + public void clear() { + this.lIIIIlIIllIIlIIlIIIlIIllI.clear(); + } + + @Override + public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } + + TestClassTen(TestClassFour testClassFour, IlIlIllIIllllIlllIlllIlII ilIlIllIIllllIlllIlllIlII) { + this(testClassFour); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassThree.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassThree.java new file mode 100644 index 0000000..ebc7f8c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassThree.java @@ -0,0 +1,49 @@ +package com.cheatbreaker.client.util.font; + +// Decompiled with: CFR 0.152 +// Class Version: 8 +public class TestClassThree { + private String lIIIIlIIllIIlIIlIIIlIIllI; + private int lIIIIIIIIIlIllIIllIlIIlIl; + private boolean IlllIIIlIlllIllIlIIlllIlI; + + public TestClassThree(String string, int n, boolean bl) { + this.lIIIIlIIllIIlIIlIIIlIIllI = string; + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = bl; + } + + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (object == null || this.getClass() != object.getClass()) { + return false; + } + TestClassThree testClassThree = (TestClassThree)object; + return this.lIIIIIIIIIlIllIIllIlIIlIl == testClassThree.lIIIIIIIIIlIllIIllIlIIlIl && this.IlllIIIlIlllIllIlIIlllIlI == testClassThree.IlllIIIlIlllIllIlIIlllIlI && this.lIIIIlIIllIIlIIlIIIlIIllI.equals(testClassThree.lIIIIlIIllIIlIIlIIIlIIllI); + } + + public int hashCode() { + int n = this.lIIIIlIIllIIlIIlIIIlIIllI.hashCode(); + n = 31 * n + this.lIIIIIIIIIlIllIIllIlIIlIl; + n = 31 * n + (this.IlllIIIlIlllIllIlIIlllIlI ? 1 : 0); + return n; + } + + static String lIIIIlIIllIIlIIlIIIlIIllI(TestClassThree testClassThree, String string) { + testClassThree.lIIIIlIIllIIlIIlIIIlIIllI = string; + return testClassThree.lIIIIlIIllIIlIIlIIIlIIllI; + } + + static int lIIIIlIIllIIlIIlIIIlIIllI(TestClassThree testClassThree, int n) { + testClassThree.lIIIIIIIIIlIllIIllIlIIlIl = n; + return testClassThree.lIIIIIIIIIlIllIIllIlIIlIl; + } + + static boolean lIIIIlIIllIIlIIlIIIlIIllI(TestClassThree testClassThree, boolean bl) { + testClassThree.IlllIIIlIlllIllIlIIlllIlI = bl; + return testClassThree.IlllIIIlIlllIllIlIIlllIlI; + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassTwo.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassTwo.java new file mode 100644 index 0000000..45ee589 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/TestClassTwo.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.util.font; + +public class TestClassTwo + extends TestClassFour { + private TestClassThree IlIIlIIIIlIIIIllllIIlIllI = new TestClassThree(null, 0, false); + + public TestClassSix lIIIIlIIllIIlIIlIIIlIIllI(String string, int n, boolean bl) { + TestClassThree.lIIIIlIIllIIlIIlIIIlIIllI(this.IlIIlIIIIlIIIIllllIIlIllI, string); + TestClassThree.lIIIIlIIllIIlIIlIIIlIIllI(this.IlIIlIIIIlIIIIllllIIlIllI, n); + TestClassThree.lIIIIlIIllIIlIIlIIIlIIllI(this.IlIIlIIIIlIIIIllllIIlIllI, bl); + return (TestClassSix)this.get(this.IlIIlIIIIlIIIIllllIIlIllI); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIIIlIlIllIIIIIIIlIlIIIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIIIlIlIllIIIIIIIlIlIIIl.java new file mode 100644 index 0000000..d1cd127 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIIIlIlIllIIIIIIIlIlIIIl.java @@ -0,0 +1,141 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; +import java.util.ListIterator; + +public class lIIIIlIlIllIIIIIIIlIlIIIl { + public static final IlIlllIlIIIllIIIlIIllllIl lIIIIlIIllIIlIIlIIIlIIllI = new IlIlllIlIIIllIIIlIIllllIl(); + + private lIIIIlIlIllIIIIIIIlIlIIIl() { + } + + public static llllllllllllIlIIIIIIIIlll lIIIIlIIllIIlIIlIIIlIIllI(Object object) { + return new IIIIllIIIlllIlIIllIIlllll(object); + } + + public static llllllllllllIlIIIIIIIIlll lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray, int n, int n2) { + IlIIlIlIlIIlllIIIllIIIlII.IIIIllIIllIIIIllIllIIIlIl(objectArray, n, n2); + return new IIIlIllIIIlIIIIIIIIIIIlII(objectArray, n, n2); + } + + public static llllllllllllIlIIIIIIIIlll lIIIIlIIllIIlIIlIIIlIIllI(Object[] objectArray) { + return new IIIlIllIIIlIIIIIIIIIIIlII(objectArray, 0, objectArray.length); + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(Iterator iterator, Object[] objectArray, int n, int n2) { + if (n2 < 0) { + throw new IllegalArgumentException("The maximum number of elements (" + n2 + ") is negative"); + } + if (n < 0 || n + n2 > objectArray.length) { + throw new IllegalArgumentException(); + } + int n3 = n2; + while (n3-- != 0 && iterator.hasNext()) { + objectArray[n++] = iterator.next(); + } + return n2 - n3 - 1; + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(Iterator iterator, Object[] objectArray) { + return lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI(iterator, objectArray, 0, objectArray.length); + } + + public static Object[] lIIIIlIIllIIlIIlIIIlIIllI(Iterator iterator, int n) { + if (n < 0) { + throw new IllegalArgumentException("The maximum number of elements (" + n + ") is negative"); + } + Object[] objectArray = new Object[16]; + int n2 = 0; + while (n-- != 0 && iterator.hasNext()) { + if (n2 == objectArray.length) { + objectArray = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n2 + 1); + } + objectArray[n2++] = iterator.next(); + } + return IlIIlIlIlIIlllIIIllIIIlII.IlllIIIlIlllIllIlIIlllIlI(objectArray, n2); + } + + public static Object[] lIIIIlIIllIIlIIlIIIlIIllI(Iterator iterator) { + return lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI(iterator, Integer.MAX_VALUE); + } + + public static int lIIIIlIIllIIlIIlIIIlIIllI(Iterator iterator, ITestClassEight iTestClassEight, int n) { + if (n < 0) { + throw new IllegalArgumentException("The maximum number of elements (" + n + ") is negative"); + } + int n2 = n; + while (n2-- != 0 && iterator.hasNext()) { + iTestClassEight.add(iterator.next()); + } + return n - n2 - 1; + } + + public static long lIIIIlIIllIIlIIlIIIlIIllI(Iterator iterator, ITestClassEight iTestClassEight) { + long l = 0L; + while (iterator.hasNext()) { + iTestClassEight.add(iterator.next()); + ++l; + } + return l; + } + + public static int lIIIIIIIIIlIllIIllIlIIlIl(Iterator iterator, ITestClassEight iTestClassEight, int n) { + if (n < 0) { + throw new IllegalArgumentException("The maximum number of elements (" + n + ") is negative"); + } + int n2 = n; + while (n2-- != 0 && iterator.hasNext()) { + iTestClassEight.add(iterator.next()); + } + return n - n2 - 1; + } + + public static int lIIIIIIIIIlIllIIllIlIIlIl(Iterator iterator, ITestClassEight iTestClassEight) { + return lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIIIIIIlIllIIllIlIIlIl(iterator, iTestClassEight, Integer.MAX_VALUE); + } + + public static lIlllIllIlllIlllIlIIIlIIl lIIIIIIIIIlIllIIllIlIIlIl(Iterator iterator, int n) { + IIlIIlIIlIlIllIIIIlIIIIIl iIlIIlIIlIlIllIIIIlIIIIIl = new IIlIIlIIlIlIllIIIIlIIIIIl(); + lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIIIIIIlIllIIllIlIIlIl(iterator, iIlIIlIIlIlIllIIIIlIIIIIl, n); + iIlIIlIIlIlIllIIIIlIIIIIl.IllIIIIIIIlIlIllllIIllIII(); + return iIlIIlIIlIlIllIIIIlIIIIIl; + } + + public static lIlllIllIlllIlllIlIIIlIIl lIIIIIIIIIlIllIIllIlIIlIl(Iterator iterator) { + return lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIIIIIIlIllIIllIlIIlIl(iterator, Integer.MAX_VALUE); + } + + public static ITestClassFive IlllIIIlIlllIllIlIIlllIlI(Iterator iterator) { + if (iterator instanceof ITestClassFive) { + return (ITestClassFive)iterator; + } + return new IIIlIllllllllIllIlIlIIIII(iterator); + } + + public static llllllllllllIlIIIIIIIIlll lIIIIlIIllIIlIIlIIIlIIllI(ListIterator listIterator) { + if (listIterator instanceof llllllllllllIlIIIIIIIIlll) { + return (llllllllllllIlIIIIIIIIlll)listIterator; + } + return new IIIlIIlllIlIIlIIIllIIlIII(listIterator); + } + + public static ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(ITestClassFive[] iTestClassFiveArray) { + return lIIIIlIlIllIIIIIIIlIlIIIl.lIIIIlIIllIIlIIlIIIlIIllI(iTestClassFiveArray, 0, iTestClassFiveArray.length); + } + + public static ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(ITestClassFive[] iTestClassFiveArray, int n, int n2) { + return new lllIlIllllllIIIIlIIIIIllI(iTestClassFiveArray, n, n2); + } + + public static ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI(ITestClassFive iTestClassFive) { + return new llllIIIllIlIIIIIllIlllllI(iTestClassFive); + } + + public static llIIIIlllIIIIIIIllIllllll lIIIIlIIllIIlIIlIIIlIIllI(llIIIIlllIIIIIIIllIllllll llIIIIlllIIIIIIIllIllllll2) { + return new llIlIIIlIIIlIIIIllllIlIII(llIIIIlllIIIIIIIllIllllll2); + } + + public static llllllllllllIlIIIIIIIIlll lIIIIlIIllIIlIIlIIIlIIllI(llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2) { + return new IIIlIIIlIIlIIIIlIlIllIlIl(llllllllllllIlIIIIIIIIlll2); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIlIIlllIIlIIlIIIlIIIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIlIIlllIIlIIlIIIlIIIIII.java new file mode 100644 index 0000000..93a61a7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIlIIlllIIlIIlIIIlIIIIII.java @@ -0,0 +1,231 @@ +package com.cheatbreaker.client.util.font; + +// Decompiled with: CFR 0.152 +// Class Version: 8 +import java.util.concurrent.ForkJoinPool; + +public class lIIlIIlllIIlIIlIIIlIIIIII { + public static final int lIIIIlIIllIIlIIlIIIlIIllI = 0x7FFFFFF7; + private static final int lIIIIIIIIIlIllIIllIlIIlIl = 16; + private static final int IlllIIIlIlllIllIlIIlllIlI = 16; + private static final int IIIIllIlIIIllIlllIlllllIl = 8192; + private static final int IIIIllIIllIIIIllIllIIIlIl = 128; + + private lIIlIIlllIIlIIlIIIlIIIIII() { + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int n, int n2, int n3) { + if (n2 < 0) { + throw new ArrayIndexOutOfBoundsException("Start index (" + n2 + ") is negative"); + } + if (n2 > n3) { + throw new IllegalArgumentException("Start index (" + n2 + ") is greater than end index (" + n3 + ")"); + } + if (n3 > n) { + throw new ArrayIndexOutOfBoundsException("End index (" + n3 + ") is greater than array length (" + n + ")"); + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int n, int n2, int n3) { + if (n2 < 0) { + throw new ArrayIndexOutOfBoundsException("Offset (" + n2 + ") is negative"); + } + if (n3 < 0) { + throw new IllegalArgumentException("Length (" + n3 + ") is negative"); + } + if (n2 + n3 > n) { + throw new ArrayIndexOutOfBoundsException("Last index (" + (n2 + n3) + ") is greater than array length (" + n + ")"); + } + } + + private static void lIIIIlIIllIIlIIlIIIlIIllI(int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2, IIllIIIIlllllIllIIllIllIl iIllIIIIlllllIllIIllIllIl) { + int n4; + int n5; + if (n >= n2 || n2 >= n3) { + return; + } + if (n3 - n == 2) { + if (lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n2, n) < 0) { + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n, n2); + } + return; + } + if (n2 - n > n3 - n2) { + n5 = n + (n2 - n) / 2; + n4 = lIIlIIlllIIlIIlIIIlIIIIII.lIIIIIIIIIlIllIIllIlIIlIl(n2, n3, n5, lIlIIIIlIlIlllIlIIllIlIll2); + } else { + n4 = n2 + (n3 - n2) / 2; + n5 = lIIlIIlllIIlIIlIIIlIIIIII.IlllIIIlIlllIllIlIIlllIlI(n, n2, n4, lIlIIIIlIlIlllIlIIllIlIll2); + } + int n6 = n5; + int n7 = n2; + int n8 = n4; + if (n7 != n6 && n7 != n8) { + int n9 = n6; + int n10 = n7; + while (n9 < --n10) { + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n9++, n10); + } + n9 = n7; + n10 = n8; + while (n9 < --n10) { + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n9++, n10); + } + n9 = n6; + n10 = n8; + while (n9 < --n10) { + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n9++, n10); + } + } + n2 = n5 + (n4 - n2); + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n, n5, n2, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl); + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n2, n4, n3, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl); + } + + private static int lIIIIIIIIIlIllIIllIlIIlIl(int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + int n4 = n2 - n; + while (n4 > 0) { + int n5 = n4 / 2; + int n6 = n + n5; + if (lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n6, n3) < 0) { + n = n6 + 1; + n4 -= n5 + 1; + continue; + } + n4 = n5; + } + return n; + } + + private static int IlllIIIlIlllIllIlIIlllIlI(int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + int n4 = n2 - n; + while (n4 > 0) { + int n5 = n4 / 2; + int n6 = n + n5; + if (lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n3, n6) < 0) { + n4 = n5; + continue; + } + n = n6 + 1; + n4 -= n5 + 1; + } + return n; + } + + private static int IIIIllIlIIIllIlllIlllllIl(int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + int n4 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n, n2); + int n5 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n, n3); + int n6 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n2, n3); + return n4 < 0 ? (n6 < 0 ? n2 : (n5 < 0 ? n3 : n)) : (n6 > 0 ? n2 : (n5 > 0 ? n3 : n)); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2, IIllIIIIlllllIllIIllIllIl iIllIIIIlllllIllIIllIllIl) { + int n3 = n2 - n; + if (n3 < 16) { + for (int i = n; i < n2; ++i) { + for (int j = i; j > n && lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(j - 1, j) > 0; --j) { + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(j, j - 1); + } + } + return; + } + int n4 = n + n2 >>> 1; + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n, n4, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl); + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n4, n2, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl); + if (lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n4 - 1, n4) <= 0) { + return; + } + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n, n4, n2, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl); + } + + protected static void lIIIIlIIllIIlIIlIIIlIIllI(IIllIIIIlllllIllIIllIllIl iIllIIIIlllllIllIIllIllIl, int n, int n2, int n3) { + int n4 = 0; + while (n4 < n3) { + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n, n2); + ++n4; + ++n; + ++n2; + } + } + + public static void lIIIIIIIIIlIllIIllIlIIlIl(int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2, IIllIIIIlllllIllIIllIllIl iIllIIIIlllllIllIIllIllIl) { + ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); + forkJoinPool.invoke(new llllIllIlllIIIlIIllIIIlII(n, n2, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl)); + forkJoinPool.shutdown(); + } + + public static void IlllIIIlIlllIllIlIIlllIlI(int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2, IIllIIIIlllllIllIIllIllIl iIllIIIIlllllIllIIllIllIl) { + int n3; + int n4; + int n5; + int n6 = n2 - n; + if (n6 < 16) { + for (int i = n; i < n2; ++i) { + for (int j = i; j > n && lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(j - 1, j) > 0; --j) { + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(j, j - 1); + } + } + return; + } + int n7 = n + n6 / 2; + int n8 = n; + int n9 = n2 - 1; + if (n6 > 128) { + n5 = n6 / 8; + n8 = lIIlIIlllIIlIIlIIIlIIIIII.IIIIllIlIIIllIlllIlllllIl(n8, n8 + n5, n8 + 2 * n5, lIlIIIIlIlIlllIlIIllIlIll2); + n7 = lIIlIIlllIIlIIlIIIlIIIIII.IIIIllIlIIIllIlllIlllllIl(n7 - n5, n7, n7 + n5, lIlIIIIlIlIlllIlIIllIlIll2); + n9 = lIIlIIlllIIlIIlIIIlIIIIII.IIIIllIlIIIllIlllIlllllIl(n9 - 2 * n5, n9 - n5, n9, lIlIIIIlIlIlllIlIIllIlIll2); + } + n7 = lIIlIIlllIIlIIlIIIlIIIIII.IIIIllIlIIIllIlllIlllllIl(n8, n7, n9, lIlIIIIlIlIlllIlIIllIlIll2); + int n10 = n5 = n; + int n11 = n4 = n2 - 1; + while (true) { + if (n10 <= n4 && (n3 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n10, n7)) <= 0) { + if (n3 == 0) { + if (n5 == n7) { + n7 = n10; + } else if (n10 == n7) { + n7 = n5; + } + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n5++, n10); + } + ++n10; + continue; + } + while (n4 >= n10 && (n3 = lIlIIIIlIlIlllIlIIllIlIll2.lIIIIlIIllIIlIIlIIIlIIllI(n4, n7)) >= 0) { + if (n3 == 0) { + if (n4 == n7) { + n7 = n11; + } else if (n11 == n7) { + n7 = n4; + } + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n4, n11--); + } + --n4; + } + if (n10 > n4) break; + if (n10 == n7) { + n7 = n11; + } else if (n4 == n7) { + n7 = n4; + } + iIllIIIIlllllIllIIllIllIl.lIIIIlIIllIIlIIlIIIlIIllI(n10++, n4--); + } + n3 = Math.min(n5 - n, n10 - n5); + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(iIllIIIIlllllIllIIllIllIl, n, n10 - n3, n3); + n3 = Math.min(n11 - n4, n2 - n11 - 1); + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(iIllIIIIlllllIllIIllIllIl, n10, n2 - n3, n3); + n3 = n10 - n5; + if (n3 > 1) { + lIIlIIlllIIlIIlIIIlIIIIII.IlllIIIlIlllIllIlIIlllIlI(n, n + n3, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl); + } + if ((n3 = n11 - n4) > 1) { + lIIlIIlllIIlIIlIIIlIIIIII.IlllIIIlIlllIllIlIIlllIlI(n2 - n3, n2, lIlIIIIlIlIlllIlIIllIlIll2, iIllIIIIlllllIllIIllIllIl); + } + } + + static int lIIIIlIIllIIlIIlIIIlIIllI(int n, int n2, int n3, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2) { + return lIIlIIlllIIlIIlIIIlIIIIII.IIIIllIlIIIllIlllIlllllIl(n, n2, n3, lIlIIIIlIlIlllIlIIllIlIll2); + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIllIIlIIIIIllIlIIllIIIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIllIIlIIIIIllIlIIllIIIl.java new file mode 100644 index 0000000..78a9774 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIllIIlIIIIIllIlIIllIIIl.java @@ -0,0 +1,347 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.NoSuchElementException; + +public abstract class lIIllIIlIIIIIllIlIIllIIIl + extends AbstractTestClassTwo + implements lIlllIllIlllIlllIlIIIlIIl, + llIlIIllIIlIIIllIlIIIllII { + protected lIIllIIlIIIIIllIlIIllIIIl() { + } + + protected void lIIIIIIIIIlIllIIllIlIIlIl(int n) { + if (n < 0) { + throw new IndexOutOfBoundsException("Index (" + n + ") is negative"); + } + if (n > this.size()) { + throw new IndexOutOfBoundsException("Index (" + n + ") is greater than list size (" + this.size() + ")"); + } + } + + protected void IlllIIIlIlllIllIlIIlllIlI(int n) { + if (n < 0) { + throw new IndexOutOfBoundsException("Index (" + n + ") is negative"); + } + if (n >= this.size()) { + throw new IndexOutOfBoundsException("Index (" + n + ") is greater than or equal to list size (" + this.size() + ")"); + } + } + + public void add(int n, Object object) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean add(Object object) { + this.add(this.size(), object); + return true; + } + + public Object remove(int n) { + throw new UnsupportedOperationException(); + } + + public Object set(int n, Object object) { + throw new UnsupportedOperationException(); + } + + public boolean addAll(int n, Collection collection) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + int n2 = collection.size(); + if (n2 == 0) { + return false; + } + Iterator iterator = collection.iterator(); + while (n2-- != 0) { + this.add(n++, iterator.next()); + } + return true; + } + + @Override + public boolean addAll(Collection collection) { + return this.addAll(this.size(), collection); + } + + @Override + @Deprecated + public llllllllllllIlIIIIIIIIlll IIIIllIlIIIllIlllIlllllIl() { + return this.IlIlIIIlllIIIlIlllIlIllIl(); + } + + @Override + @Deprecated + public llllllllllllIlIIIIIIIIlll IIIIllIlIIIllIlllIlllllIl(int n) { + return this.IIIIllIIllIIIIllIllIIIlIl(n); + } + + @Override + public llllllllllllIlIIIIIIIIlll IIIIllIIllIIIIllIllIIIlIl() { + return this.IlIlIIIlllIIIlIlllIlIllIl(); + } + + @Override + public llllllllllllIlIIIIIIIIlll IlIlIIIlllIIIlIlllIlIllIl() { + return this.IIIIllIIllIIIIllIllIIIlIl(0); + } + + @Override + public llllllllllllIlIIIIIIIIlll IIIIllIIllIIIIllIllIIIlIl(int n) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + return new IIlIllllIllllllIIllIllIIl(this, n); + } + + @Override + public boolean contains(Object object) { + return this.indexOf(object) >= 0; + } + + @Override + public int indexOf(Object object) { + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IlIlIIIlllIIIlIlllIlIllIl(); + while (llllllllllllIlIIIIIIIIlll2.hasNext()) { + Object e = llllllllllllIlIIIIIIIIlll2.next(); + if (!(object == null ? e == null : object.equals(e))) continue; + return llllllllllllIlIIIIIIIIlll2.previousIndex(); + } + return -1; + } + + @Override + public int lastIndexOf(Object object) { + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IIIIllIIllIIIIllIllIIIlIl(this.size()); + while (llllllllllllIlIIIIIIIIlll2.hasPrevious()) { + Object e = llllllllllllIlIIIIIIIIlll2.previous(); + if (!(object == null ? e == null : object.equals(e))) continue; + return llllllllllllIlIIIIIIIIlll2.nextIndex(); + } + return -1; + } + + @Override + public void IlIlIIIlllIIIlIlllIlIllIl(int n) { + int n2 = this.size(); + if (n > n2) { + while (n2++ < n) { + this.add((Object)null); + } + } else { + while (n2-- != n) { + this.remove(n2); + } + } + } + + @Override + public lIlllIllIlllIlllIlIIIlIIl lIIIIlIIllIIlIIlIIIlIIllI(int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + this.lIIIIIIIIIlIllIIllIlIIlIl(n2); + if (n > n2) { + throw new IndexOutOfBoundsException("Start index (" + n + ") is greater than end index (" + n2 + ")"); + } + return new lIllIlllllIlIlIIllIIIllII(this, n, n2); + } + + @Override + @Deprecated + public lIlllIllIlllIlllIlIIIlIIl lIIIIIIIIIlIllIIllIlIIlIl(int n, int n2) { + return this.lIIIIlIIllIIlIIlIIIlIIllI(n, n2); + } + + @Override + public void IlllIIIlIlllIllIlIIlllIlI(int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n2); + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IIIIllIIllIIIIllIllIIIlIl(n); + int n3 = n2 - n; + if (n3 < 0) { + throw new IllegalArgumentException("Start index (" + n + ") is greater than end index (" + n2 + ")"); + } + while (n3-- != 0) { + llllllllllllIlIIIIIIIIlll2.next(); + llllllllllllIlIIIIIIIIlll2.remove(); + } + } + + @Override + public void lIIIIlIIllIIlIIlIIIlIIllI(int n, Object[] objectArray, int n2, int n3) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + if (n2 < 0) { + throw new ArrayIndexOutOfBoundsException("Offset (" + n2 + ") is negative"); + } + if (n2 + n3 > objectArray.length) { + throw new ArrayIndexOutOfBoundsException("End index (" + (n2 + n3) + ") is greater than array length (" + objectArray.length + ")"); + } + while (n3-- != 0) { + this.add(n++, objectArray[n2++]); + } + } + + @Override + public void lIIIIlIIllIIlIIlIIIlIIllI(int n, Object[] objectArray) { + this.lIIIIlIIllIIlIIlIIIlIIllI(n, objectArray, 0, objectArray.length); + } + + @Override + public void lIIIIIIIIIlIllIIllIlIIlIl(int n, Object[] objectArray, int n2, int n3) { + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IIIIllIIllIIIIllIllIIIlIl(n); + if (n2 < 0) { + throw new ArrayIndexOutOfBoundsException("Offset (" + n2 + ") is negative"); + } + if (n2 + n3 > objectArray.length) { + throw new ArrayIndexOutOfBoundsException("End index (" + (n2 + n3) + ") is greater than array length (" + objectArray.length + ")"); + } + if (n + n3 > this.size()) { + throw new IndexOutOfBoundsException("End index (" + (n + n3) + ") is greater than list size (" + this.size() + ")"); + } + while (n3-- != 0) { + objectArray[n2++] = llllllllllllIlIIIIIIIIlll2.next(); + } + } + + private boolean lIIIIlIIllIIlIIlIIIlIIllI(Object object, Object object2) { + return object == null ? object2 == null : object.equals(object2); + } + + @Override + public boolean equals(Object object) { + if (object == this) { + return true; + } + if (!(object instanceof List)) { + return false; + } + List list = (List)object; + int n = this.size(); + if (n != list.size()) { + return false; + } + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IlIlIIIlllIIIlIlllIlIllIl(); + ListIterator listIterator = list.listIterator(); + while (n-- != 0) { + if (this.lIIIIlIIllIIlIIlIIIlIIllI(llllllllllllIlIIIIIIIIlll2.next(), listIterator.next())) continue; + return false; + } + return true; + } + + public int lIIIIlIIllIIlIIlIIIlIIllI(List list) { + if (list == this) { + return 0; + } + if (list instanceof lIlllIllIlllIlllIlIIIlIIl) { + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IlIlIIIlllIIIlIlllIlIllIl(); + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll3 = ((lIlllIllIlllIlllIlIIIlIIl)list).IlIlIIIlllIIIlIlllIlIllIl(); + while (llllllllllllIlIIIIIIIIlll2.hasNext() && llllllllllllIlIIIIIIIIlll3.hasNext()) { + Object e; + Object e2 = llllllllllllIlIIIIIIIIlll2.next(); + int n = ((Comparable)e2).compareTo(e = llllllllllllIlIIIIIIIIlll3.next()); + if (n == 0) continue; + return n; + } + return llllllllllllIlIIIIIIIIlll3.hasNext() ? -1 : (llllllllllllIlIIIIIIIIlll2.hasNext() ? 1 : 0); + } + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll4 = this.IlIlIIIlllIIIlIlllIlIllIl(); + ListIterator listIterator = list.listIterator(); + while (llllllllllllIlIIIIIIIIlll4.hasNext() && listIterator.hasNext()) { + int n = ((Comparable)llllllllllllIlIIIIIIIIlll4.next()).compareTo(listIterator.next()); + if (n == 0) continue; + return n; + } + return listIterator.hasNext() ? -1 : (llllllllllllIlIIIIIIIIlll4.hasNext() ? 1 : 0); + } + + @Override + public int hashCode() { + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IIIIllIIllIIIIllIllIIIlIl(); + int n = 1; + int n2 = this.size(); + while (n2-- != 0) { + Object e = llllllllllllIlIIIIIIIIlll2.next(); + n = 31 * n + (e == null ? 0 : e.hashCode()); + } + return n; + } + + @Override + public void lIIIIlIIllIIlIIlIIIlIIllI(Object object) { + this.add(object); + } + + @Override + public Object g_() { + if (this.isEmpty()) { + throw new NoSuchElementException(); + } + return this.remove(this.size() - 1); + } + + @Override + public Object lIIIIIIIIIlIllIIllIlIIlIl() { + if (this.isEmpty()) { + throw new NoSuchElementException(); + } + return this.get(this.size() - 1); + } + + @Override + public Object lIIIIlIIllIIlIIlIIIlIIllI(int n) { + return this.get(this.size() - 1 - n); + } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + llllllllllllIlIIIIIIIIlll llllllllllllIlIIIIIIIIlll2 = this.IIIIllIIllIIIIllIllIIIlIl(); + int n = this.size(); + boolean bl = true; + stringBuilder.append("["); + while (n-- != 0) { + if (bl) { + bl = false; + } else { + stringBuilder.append(", "); + } + Object e = llllllllllllIlIIIIIIIIlll2.next(); + if (this == e) { + stringBuilder.append("(this list)"); + continue; + } + stringBuilder.append(String.valueOf(e)); + } + stringBuilder.append("]"); + return stringBuilder.toString(); + } + + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return this.IIIIllIIllIIIIllIllIIIlIl(); + } + + @Override + public Iterator iterator() { + return this.IIIIllIIllIIIIllIllIIIlIl(); + } + + @Override + public List subList(int n, int n2) { + return this.lIIIIlIIllIIlIIlIIIlIIllI(n, n2); + } + + @Override + public ListIterator listIterator(int n) { + return this.IIIIllIIllIIIIllIllIIIlIl(n); + } + + @Override + public ListIterator listIterator() { + return this.IlIlIIIlllIIIlIlllIlIllIl(); + } + + public int compareTo(Object object) { + return this.lIIIIlIIllIIlIIlIIIlIIllI((List)object); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIllIlIIlIIIIIlIIlIlIIll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIllIlIIlIIIIIlIIlIlIIll.java new file mode 100644 index 0000000..9582e9d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIIllIlIIlIIIIIlIIlIlIIll.java @@ -0,0 +1,17 @@ +package com.cheatbreaker.client.util.font; + +public final class lIIllIlIIlIIIIIlIIlIlIIll { + protected final int lIIIIlIIllIIlIIlIIIlIIllI; + protected final int lIIIIIIIIIlIllIIllIlIIlIl; + protected final int IlllIIIlIlllIllIlIIlllIlI; + + protected lIIllIlIIlIIIIIlIIlIlIIll(int n, int n2, int n3) { + this.lIIIIlIIllIIlIIlIIIlIIllI = n; + this.lIIIIIIIIIlIllIIllIlIIlIl = n2; + this.IlllIIIlIlllIllIlIIlllIlI = n3; + } + + public String toString() { + return "Segment [offset=" + this.lIIIIlIIllIIlIIlIIIlIIllI + ", length=" + this.lIIIIIIIIIlIllIIllIlIIlIl + ", level=" + this.IlllIIIlIlllIllIlIIlllIlI + "]"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlIIIIlIlIlllIlIIllIlIll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlIIIIlIlIlllIlIIllIlIll.java new file mode 100644 index 0000000..43aa8cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlIIIIlIlIlllIlIIllIlIll.java @@ -0,0 +1,9 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Comparator; + +public interface lIlIIIIlIlIlllIlIIllIlIll + extends Comparator { + public int lIIIIlIIllIIlIIlIIIlIIllI(int var1, int var2); +} + diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlIllIlIllIlllIIIIllIlII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlIllIlIllIlllIIIIllIlII.java new file mode 100644 index 0000000..27aa2fb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlIllIlIllIlllIIIIllIlII.java @@ -0,0 +1,98 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.Callable; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.atomic.AtomicInteger; + +final class lIlIllIlIllIlllIIIIllIlII + implements Callable { + final AtomicInteger lIIIIlIIllIIlIIlIIIlIIllI; + final int lIIIIIIIIIlIllIIllIlIIlIl; + final LinkedBlockingQueue IlllIIIlIlllIllIlIIlllIlI; + final int[] IIIIllIlIIIllIlllIlllllIl; + final int[] IIIIllIIllIIIIllIllIIIlIl; + + lIlIllIlIllIlllIIIIllIlII(AtomicInteger atomicInteger, int n, LinkedBlockingQueue linkedBlockingQueue, int[] nArray, int[] nArray2) { + this.lIIIIlIIllIIlIIlIIIlIIllI = atomicInteger; + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = linkedBlockingQueue; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + this.IIIIllIIllIIIIllIllIIIlIl = nArray2; + } + + public Void lIIIIlIIllIIlIIlIIIlIIllI() throws InterruptedException { + int[] nArray = new int[256]; + int[] nArray2 = new int[256]; + while (true) { + int n; + lIIllIlIIlIIIIIlIIlIlIIll lIIllIlIIlIIIIIlIIlIlIIll2; + if (this.lIIIIlIIllIIlIIlIIIlIIllI.get() == 0) { + int n2 = this.lIIIIIIIIIlIllIIllIlIIlIl; + while (n2-- != 0) { + this.IlllIIIlIlllIllIlIIlllIlI.add(IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl); + } + } + if ((lIIllIlIIlIIIIIlIIlIlIIll2 = (lIIllIlIIlIIIIIlIIlIlIIll)this.IlllIIIlIlllIllIlIIlllIlI.take()) == IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl) { + return null; + } + int n3 = lIIllIlIIlIIIIIlIIlIlIIll2.lIIIIlIIllIIlIIlIIIlIIllI; + int n4 = lIIllIlIIlIIIIIlIIlIlIIll2.lIIIIIIIIIlIllIIllIlIIlIl; + int n5 = lIIllIlIIlIIIIIlIIlIlIIll2.IlllIIIlIlllIllIlIIlllIlI; + int n6 = n5 % 4 == 0 ? 128 : 0; + int[] nArray3 = n5 < 4 ? this.IIIIllIlIIIllIlllIlllllIl : this.IIIIllIIllIIIIllIllIIIlIl; + int n7 = (3 - n5 % 4) * 8; + int n8 = n3 + n4; + while (n8-- != n3) { + int n9 = nArray3[n8] >>> n7 & 0xFF ^ n6; + nArray[n9] = nArray[n9] + 1; + } + n8 = -1; + int n10 = n3; + for (n = 0; n < 256; ++n) { + if (nArray[n] != 0) { + n8 = n; + } + nArray2[n] = n10 += nArray[n]; + } + n = n3 + n4 - nArray[n8]; + int n11 = -1; + for (n10 = n3; n10 <= n; n10 += nArray[n11]) { + int n12 = this.IIIIllIlIIIllIlllIlllllIl[n10]; + int n13 = this.IIIIllIIllIIIIllIllIIIlIl[n10]; + n11 = nArray3[n10] >>> n7 & 0xFF ^ n6; + if (n10 < n) { + while (true) { + int n14 = n11; + int n15 = nArray2[n14] - 1; + nArray2[n14] = n15; + int n16 = n15; + if (n15 <= n10) break; + n11 = nArray3[n16] >>> n7 & 0xFF ^ n6; + int n17 = n12; + int n18 = n13; + n12 = this.IIIIllIlIIIllIlllIlllllIl[n16]; + n13 = this.IIIIllIIllIIIIllIllIIIlIl[n16]; + this.IIIIllIlIIIllIlllIlllllIl[n16] = n17; + this.IIIIllIIllIIIIllIllIIIlIl[n16] = n18; + } + this.IIIIllIlIIIllIlllIlllllIl[n10] = n12; + this.IIIIllIIllIIIIllIllIIIlIl[n10] = n13; + } + if (n5 < 7 && nArray[n11] > 1) { + if (nArray[n11] < 1024) { + IlllIlIllIlllIlIIlIlllIll.IIIIllIlIIIllIlllIlllllIl(this.IIIIllIlIIIllIlllIlllllIl, this.IIIIllIIllIIIIllIllIIIlIl, n10, n10 + nArray[n11]); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI.incrementAndGet(); + this.IlllIIIlIlllIllIlIIlllIlI.add(new lIIllIlIIlIIIIIlIIlIlIIll(n10, nArray[n11], n5 + 1)); + } + } + nArray[n11] = 0; + } + this.lIIIIlIIllIIlIIlIIIlIIllI.decrementAndGet(); + } + } + + public Object call() throws InterruptedException { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIllIlllllIlIlIIllIIIllII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIllIlllllIlIlIIllIIIllII.java new file mode 100644 index 0000000..080d9c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIllIlllllIlIlIIllIIIllII.java @@ -0,0 +1,155 @@ +package com.cheatbreaker.client.util.font; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +public class lIllIlllllIlIlIIllIIIllII + extends lIIllIIlIIIIIllIlIIllIIIl + implements Serializable { + private static final long IIIIllIlIIIllIlllIlllllIl = -7046029254386353129L; + protected final lIlllIllIlllIlllIlIIIlIIl lIIIIlIIllIIlIIlIIIlIIllI; + protected final int lIIIIIIIIIlIllIIllIlIIlIl; + protected int IlllIIIlIlllIllIlIIlllIlI; + private static final boolean IIIIllIIllIIIIllIllIIIlIl = false; + + public lIllIlllllIlIlIIllIIIllII(lIlllIllIlllIlllIlIIIlIIl lIlllIllIlllIlllIlIIIlIIl2, int n, int n2) { + this.lIIIIlIIllIIlIIlIIIlIIllI = lIlllIllIlllIlllIlIIIlIIl2; + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + } + + private void IIIllIllIlIlllllllIlIlIII() { + } + + @Override + public boolean add(Object object) { + this.lIIIIlIIllIIlIIlIIIlIIllI.add(this.IlllIIIlIlllIllIlIIlllIlI, object); + ++this.IlllIIIlIlllIllIlIIlllIlI; + return true; + } + + @Override + public void add(int n, Object object) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + this.lIIIIlIIllIIlIIlIIIlIIllI.add(this.lIIIIIIIIIlIllIIllIlIIlIl + n, object); + ++this.IlllIIIlIlllIllIlIIlllIlI; + } + + @Override + public boolean addAll(int n, Collection collection) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + this.IlllIIIlIlllIllIlIIlllIlI += collection.size(); + return this.lIIIIlIIllIIlIIlIIIlIIllI.addAll(this.lIIIIIIIIIlIllIIllIlIIlIl + n, collection); + } + + public Object get(int n) { + this.IlllIIIlIlllIllIlIIlllIlI(n); + return this.lIIIIlIIllIIlIIlIIIlIIllI.get(this.lIIIIIIIIIlIllIIllIlIIlIl + n); + } + + @Override + public Object remove(int n) { + this.IlllIIIlIlllIllIlIIlllIlI(n); + --this.IlllIIIlIlllIllIlIIlllIlI; + return this.lIIIIlIIllIIlIIlIIIlIIllI.remove(this.lIIIIIIIIIlIllIIllIlIIlIl + n); + } + + @Override + public Object set(int n, Object object) { + this.IlllIIIlIlllIllIlIIlllIlI(n); + return this.lIIIIlIIllIIlIIlIIIlIIllI.set(this.lIIIIIIIIIlIllIIllIlIIlIl + n, object); + } + + @Override + public void clear() { + this.IlllIIIlIlllIllIlIIlllIlI(0, this.size()); + } + + @Override + public int size() { + return this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + } + + @Override + public void lIIIIIIIIIlIllIIllIlIIlIl(int n, Object[] objectArray, int n2, int n3) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + if (n + n3 > this.size()) { + throw new IndexOutOfBoundsException("End index (" + n + n3 + ") is greater than list size (" + this.size() + ")"); + } + this.lIIIIlIIllIIlIIlIIIlIIllI.lIIIIIIIIIlIllIIllIlIIlIl(this.lIIIIIIIIIlIllIIllIlIIlIl + n, objectArray, n2, n3); + } + + @Override + public void IlllIIIlIlllIllIlIIlllIlI(int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + this.lIIIIIIIIIlIllIIllIlIIlIl(n2); + this.lIIIIlIIllIIlIIlIIIlIIllI.IlllIIIlIlllIllIlIIlllIlI(this.lIIIIIIIIIlIllIIllIlIIlIl + n, this.lIIIIIIIIIlIllIIllIlIIlIl + n2); + this.IlllIIIlIlllIllIlIIlllIlI -= n2 - n; + } + + @Override + public void lIIIIlIIllIIlIIlIIIlIIllI(int n, Object[] objectArray, int n2, int n3) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + this.lIIIIlIIllIIlIIlIIIlIIllI.lIIIIlIIllIIlIIlIIIlIIllI(this.lIIIIIIIIIlIllIIllIlIIlIl + n, objectArray, n2, n3); + this.IlllIIIlIlllIllIlIIlllIlI += n3; + } + + @Override + public llllllllllllIlIIIIIIIIlll IIIIllIIllIIIIllIllIIIlIl(int n) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + return new IlllIlIlIlIIIllIIllIlIIII(this, n); + } + + @Override + public lIlllIllIlllIlllIlIIIlIIl lIIIIlIIllIIlIIlIIIlIIllI(int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl(n); + this.lIIIIIIIIIlIllIIllIlIIlIl(n2); + if (n > n2) { + throw new IllegalArgumentException("Start index (" + n + ") is greater than end index (" + n2 + ")"); + } + return new lIllIlllllIlIlIIllIIIllII(this, n, n2); + } + + @Override + public boolean remove(Object object) { + int n = this.indexOf(object); + if (n == -1) { + return false; + } + this.remove(n); + return true; + } + + @Override + public List subList(int n, int n2) { + return this.lIIIIlIIllIIlIIlIIIlIIllI(n, n2); + } + + @Override + public ListIterator listIterator(int n) { + return this.IIIIllIIllIIIIllIllIIIlIl(n); + } + + @Override + public ListIterator listIterator() { + return super.IlIlIIIlllIIIlIlllIlIllIl(); + } + + @Override + public Iterator iterator() { + return super.IIIIllIIllIIIIllIllIIIlIl(); + } + + @Override + public int compareTo(Object object) { + return super.lIIIIlIIllIIlIIlIIIlIIllI((List)object); + } + + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return super.IIIIllIIllIIIIllIllIIIlIl(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlllIIllIIIlIIlIIIIIIlIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlllIIllIIIlIIlIIIIIIlIl.java new file mode 100644 index 0000000..242f668 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlllIIllIIIlIIlIIIIIIlIl.java @@ -0,0 +1,121 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Arrays; +import java.util.concurrent.Callable; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.atomic.AtomicInteger; + +final class lIlllIIllIIIlIIlIIIIIIlIl + implements Callable { + final AtomicInteger lIIIIlIIllIIlIIlIIIlIIllI; + final int lIIIIIIIIIlIllIIllIlIIlIl; + final LinkedBlockingQueue IlllIIIlIlllIllIlIIlllIlI; + final int[] IIIIllIlIIIllIlllIlllllIl; + final int[] IIIIllIIllIIIIllIllIIIlIl; + final boolean IlIlIIIlllIIIlIlllIlIllIl; + final int[] IIIllIllIlIlllllllIlIlIII; + + lIlllIIllIIIlIIlIIIIIIlIl(AtomicInteger atomicInteger, int n, LinkedBlockingQueue linkedBlockingQueue, int[] nArray, int[] nArray2, boolean bl, int[] nArray3) { + this.lIIIIlIIllIIlIIlIIIlIIllI = atomicInteger; + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = linkedBlockingQueue; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + this.IIIIllIIllIIIIllIllIIIlIl = nArray2; + this.IlIlIIIlllIIIlIlllIlIllIl = bl; + this.IIIllIllIlIlllllllIlIlIII = nArray3; + } + + public Void lIIIIlIIllIIlIIlIIIlIIllI() throws InterruptedException { + int[] nArray = new int[256]; + int[] nArray2 = new int[256]; + while (true) { + int n; + lIIllIlIIlIIIIIlIIlIlIIll lIIllIlIIlIIIIIlIIlIlIIll2; + if (this.lIIIIlIIllIIlIIlIIIlIIllI.get() == 0) { + int n2 = this.lIIIIIIIIIlIllIIllIlIIlIl; + while (n2-- != 0) { + this.IlllIIIlIlllIllIlIIlllIlI.add(IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl); + } + } + if ((lIIllIlIIlIIIIIlIIlIlIIll2 = (lIIllIlIIlIIIIIlIIlIlIIll)this.IlllIIIlIlllIllIlIIlllIlI.take()) == IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl) { + return null; + } + int n3 = lIIllIlIIlIIIIIlIIlIlIIll2.lIIIIlIIllIIlIIlIIIlIIllI; + int n4 = lIIllIlIIlIIIIIlIIlIlIIll2.lIIIIIIIIIlIllIIllIlIIlIl; + int n5 = lIIllIlIIlIIIIIlIIlIlIIll2.IlllIIIlIlllIllIlIIlllIlI; + int n6 = n5 % 4 == 0 ? 128 : 0; + int n7 = (3 - n5 % 4) * 8; + int n8 = n3 + n4; + while (n8-- != n3) { + int n9 = this.IIIIllIlIIIllIlllIlllllIl[this.IIIIllIIllIIIIllIllIIIlIl[n8]] >>> n7 & 0xFF ^ n6; + nArray[n9] = nArray[n9] + 1; + } + n8 = -1; + int n10 = n3; + for (n = 0; n < 256; ++n) { + if (nArray[n] != 0) { + n8 = n; + } + nArray2[n] = n10 += nArray[n]; + } + if (this.IlIlIIIlllIIIlIlllIlIllIl) { + n = n3 + n4; + while (n-- != n3) { + int n11 = this.IIIIllIlIIIllIlllIlllllIl[this.IIIIllIIllIIIIllIllIIIlIl[n]] >>> n7 & 0xFF ^ n6; + int n12 = nArray2[n11] - 1; + nArray2[n11] = n12; + this.IIIllIllIlIlllllllIlIlIII[n12] = this.IIIIllIIllIIIIllIllIIIlIl[n]; + } + System.arraycopy(this.IIIllIllIlIlllllllIlIlIII, n3, this.IIIIllIIllIIIIllIllIIIlIl, n3, n4); + n10 = n3; + for (n = 0; n <= n8; ++n) { + if (n5 < 3 && nArray[n] > 1) { + if (nArray[n] < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIIllIIIIllIllIIIlIl, this.IIIIllIlIIIllIlllIlllllIl, n10, n10 + nArray[n], this.IlIlIIIlllIIIlIlllIlIllIl); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI.incrementAndGet(); + this.IlllIIIlIlllIllIlIIlllIlI.add(new lIIllIlIIlIIIIIlIIlIlIIll(n10, nArray[n], n5 + 1)); + } + } + n10 += nArray[n]; + } + Arrays.fill(nArray, 0); + } else { + n = n3 + n4 - nArray[n8]; + int n13 = -1; + for (n10 = n3; n10 <= n; n10 += nArray[n13]) { + int n14 = this.IIIIllIIllIIIIllIllIIIlIl[n10]; + n13 = this.IIIIllIlIIIllIlllIlllllIl[n14] >>> n7 & 0xFF ^ n6; + if (n10 < n) { + while (true) { + int n15 = n13; + int n16 = nArray2[n15] - 1; + nArray2[n15] = n16; + int n17 = n16; + if (n16 <= n10) break; + int n18 = n14; + n14 = this.IIIIllIIllIIIIllIllIIIlIl[n17]; + this.IIIIllIIllIIIIllIllIIIlIl[n17] = n18; + n13 = this.IIIIllIlIIIllIlllIlllllIl[n14] >>> n7 & 0xFF ^ n6; + } + this.IIIIllIIllIIIIllIllIIIlIl[n10] = n14; + } + if (n5 < 3 && nArray[n13] > 1) { + if (nArray[n13] < 1024) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIIllIIIIllIllIIIlIl, this.IIIIllIlIIIllIlllIlllllIl, n10, n10 + nArray[n13], this.IlIlIIIlllIIIlIlllIlIllIl); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI.incrementAndGet(); + this.IlllIIIlIlllIllIlIIlllIlI.add(new lIIllIlIIlIIIIIlIIlIlIIll(n10, nArray[n13], n5 + 1)); + } + } + nArray[n13] = 0; + } + } + this.lIIIIlIIllIIlIIlIIIlIIllI.decrementAndGet(); + } + } + + public Object call() throws InterruptedException { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlllIllIlllIlllIlIIIlIIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlllIllIlllIlllIlIIIlIIl.java new file mode 100644 index 0000000..6724ccd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lIlllIllIlllIlllIlIIIlIIl.java @@ -0,0 +1,59 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +public interface lIlllIllIlllIlllIlIIIlIIl + extends ITestClassEight, + Comparable, + List { + public llllllllllllIlIIIIIIIIlll IIIIllIIllIIIIllIllIIIlIl(); + + @Deprecated + public llllllllllllIlIIIIIIIIlll IIIIllIlIIIllIlllIlllllIl(); + + @Deprecated + public llllllllllllIlIIIIIIIIlll IIIIllIlIIIllIlllIlllllIl(int var1); + + public llllllllllllIlIIIIIIIIlll IlIlIIIlllIIIlIlllIlIllIl(); + + public llllllllllllIlIIIIIIIIlll IIIIllIIllIIIIllIllIIIlIl(int var1); + + @Deprecated + public lIlllIllIlllIlllIlIIIlIIl lIIIIIIIIIlIllIIllIlIIlIl(int var1, int var2); + + public lIlllIllIlllIlllIlIIIlIIl lIIIIlIIllIIlIIlIIIlIIllI(int var1, int var2); + + public void IlIlIIIlllIIIlIlllIlIllIl(int var1); + + public void lIIIIIIIIIlIllIIllIlIIlIl(int var1, Object[] var2, int var3, int var4); + + public void IlllIIIlIlllIllIlIIlllIlI(int var1, int var2); + + public void lIIIIlIIllIIlIIlIIIlIIllI(int var1, Object[] var2); + + public void lIIIIlIIllIIlIIlIIIlIIllI(int var1, Object[] var2, int var3, int var4); + + default public List subList(int n, int n2) { + return this.lIIIIlIIllIIlIIlIIIlIIllI(n, n2); + } + + default public ListIterator listIterator(int n) { + return this.IIIIllIIllIIIIllIllIIIlIl(n); + } + + default public ListIterator listIterator() { + return this.IlIlIIIlllIIIlIlllIlIllIl(); + } + + @Override + default public Iterator iterator() { + return this.IIIIllIIllIIIIllIllIIIlIl(); + } + + @Override + default public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return this.IIIIllIIllIIIIllIllIIIlIl(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIIlIlIlIlllIIIlllllIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIIlIlIlIlllIIIlllllIl.java new file mode 100644 index 0000000..1939d5e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIIlIlIlIlllIIIlllllIl.java @@ -0,0 +1,48 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +final class llIIIIlIlIlIlllIIIlllllIl + extends AbstractClassThree { + final TestClassFour lIIIIlIIllIIlIIlIIIlIIllI; + + private llIIIIlIlIlIlllIIIlllllIl(TestClassFour testClassFour) { + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFour; + } + + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return new IlIIllllIIllllIIllIIlIIlI(this.lIIIIlIIllIIlIIlIIIlIIllI); + } + + @Override + public int size() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlIIllllIIllllllIlIIIll; + } + + @Override + public boolean contains(Object object) { + return this.lIIIIlIIllIIlIIlIIIlIIllI.containsKey(object); + } + + @Override + public boolean lIIIIIIIIIlIllIIllIlIIlIl(Object object) { + int n = this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlIIllllIIllllllIlIIIll; + this.lIIIIlIIllIIlIIlIIIlIIllI.remove(object); + return this.lIIIIlIIllIIlIIlIIIlIIllI.IIIlIIllllIIllllllIlIIIll != n; + } + + @Override + public void clear() { + this.lIIIIlIIllIIlIIlIIIlIIllI.clear(); + } + + @Override + public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } + + llIIIIlIlIlIlllIIIlllllIl(TestClassFour testClassFour, IlIlIllIIllllIlllIlllIlII ilIlIllIIllllIlllIlllIlII) { + this(testClassFour); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIIlllIIIIIIIllIllllll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIIlllIIIIIIIllIllllll.java new file mode 100644 index 0000000..ac0428e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIIlllIIIIIIIllIllllll.java @@ -0,0 +1,7 @@ +package com.cheatbreaker.client.util.font; + +public interface llIIIIlllIIIIIIIllIllllll + extends IllIIIlIIllIllIlIlllIllIl, + ITestClassFive { + public int lIIIIlIIllIIlIIlIIIlIIllI(int var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIlllIIlllIllllIlIllIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIlllIIlllIllllIlIllIl.java new file mode 100644 index 0000000..cd9976a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIIlllIIlllIllllIlIllIl.java @@ -0,0 +1,22 @@ +package com.cheatbreaker.client.util.font; + +class llIIIlllIIlllIllllIlIllIl + extends lllllIlIIllIllIIIIllIIlIl { + final ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI; + final lllIIIIIlIIIIIIIIlllIIIII lIIIIIIIIIlIllIIllIlIIlIl; + + llIIIlllIIlllIllllIlIllIl(lllIIIIIlIIIIIIIIlllIIIII lllIIIIIlIIIIIIIIlllIIIII2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = lllIIIIIlIIIIIIIIlllIIIII2; + this.lIIIIlIIllIIlIIlIIIlIIllI = this.lIIIIIIIIIlIllIIllIlIIlIl.lIIIIlIIllIIlIIlIIIlIIllI.IIIIllIlIIIllIlllIlllllIl().lIIIIlIIllIIlIIlIIIlIIllI(); + } + + @Deprecated + public Object next() { + return ((llIlIlIlIIlIIllIllIIlllIl)this.lIIIIlIIllIIlIIlIIIlIIllI.next()).getValue(); + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasNext(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIlIlIIIlIlIIlIllllIllI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIlIlIIIlIlIIlIllllIllI.java new file mode 100644 index 0000000..33d39bc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIIlIlIIIlIlIIlIllllIllI.java @@ -0,0 +1,81 @@ +package com.cheatbreaker.client.util.font; + +import java.util.NoSuchElementException; + +class llIIlIlIIIlIlIIlIllllIllI + extends IllIlIllllllIIIIIllIllIlI { + int lIIIIlIIllIIlIIlIIIlIIllI; + int lIIIIIIIIIlIllIIllIlIIlIl; + final int IlllIIIlIlllIllIlIIlllIlI; + final IIlIIlIIlIlIllIIIIlIIIIIl IIIIllIlIIIllIlllIlllllIl; + + llIIlIlIIIlIlIIlIllllIllI(IIlIIlIIlIlIllIIIIlIIIIIl iIlIIlIIlIlIllIIIIlIIIIIl, int n) { + this.IIIIllIlIIIllIlllIlllllIl = iIlIIlIIlIlIllIIIIlIIIIIl; + this.IlllIIIlIlllIllIlIIlllIlI = n; + this.lIIIIlIIllIIlIIlIIIlIIllI = this.IlllIIIlIlllIllIlIIlllIlI; + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI < this.IIIIllIlIIIllIlllIlllllIl.IIIIllIlIIIllIlllIlllllIl; + } + + @Override + public boolean hasPrevious() { + return this.lIIIIlIIllIIlIIlIIIlIIllI > 0; + } + + public Object next() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = this.lIIIIlIIllIIlIIlIIIlIIllI++; + return this.IIIIllIlIIIllIlllIlllllIl.IlllIIIlIlllIllIlIIlllIlI[this.lIIIIIIIIIlIllIIllIlIIlIl]; + } + + @Override + public Object previous() { + if (!this.hasPrevious()) { + throw new NoSuchElementException(); + } + this.lIIIIIIIIIlIllIIllIlIIlIl = --this.lIIIIlIIllIIlIIlIIIlIIllI; + return this.IIIIllIlIIIllIlllIlllllIl.IlllIIIlIlllIllIlIIlllIlI[this.lIIIIlIIllIIlIIlIIIlIIllI]; + } + + @Override + public int nextIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI; + } + + @Override + public int previousIndex() { + return this.lIIIIlIIllIIlIIlIIIlIIllI - 1; + } + + @Override + public void add(Object object) { + this.IIIIllIlIIIllIlllIlllllIl.add(this.lIIIIlIIllIIlIIlIIIlIIllI++, object); + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } + + @Override + public void set(Object object) { + if (this.lIIIIIIIIIlIllIIllIlIIlIl == -1) { + throw new IllegalStateException(); + } + this.IIIIllIlIIIllIlllIlllllIl.set(this.lIIIIIIIIIlIllIIllIlIIlIl, object); + } + + @Override + public void remove() { + if (this.lIIIIIIIIIlIllIIllIlIIlIl == -1) { + throw new IllegalStateException(); + } + this.IIIIllIlIIIllIlllIlllllIl.remove(this.lIIIIIIIIIlIllIIllIlIIlIl); + if (this.lIIIIIIIIIlIllIIllIlIIlIl < this.lIIIIlIIllIIlIIlIIIlIIllI) { + --this.lIIIIlIIllIIlIIlIIIlIIllI; + } + this.lIIIIIIIIIlIllIIllIlIIlIl = -1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIIIlIIIlIIIIllllIlIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIIIlIIIlIIIIllllIlIII.java new file mode 100644 index 0000000..9208172 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIIIlIIIlIIIIllllIlIII.java @@ -0,0 +1,29 @@ +package com.cheatbreaker.client.util.font; + +public class llIlIIIlIIIlIIIIllllIlIII + extends IIlllIllllllIlIIllIIlllII { + protected final llIIIIlllIIIIIIIllIllllll lIIIIlIIllIIlIIlIIIlIIllI; + + public llIlIIIlIIIlIIIIllllIlIII(llIIIIlllIIIIIIIllIllllll llIIIIlllIIIIIIIllIllllll2) { + this.lIIIIlIIllIIlIIlIIIlIIllI = llIIIIlllIIIIIIIllIllllll2; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasNext(); + } + + @Override + public boolean hasPrevious() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasPrevious(); + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.next(); + } + + @Override + public Object previous() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.previous(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIIllIIlIIIllIlIIIllII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIIllIIlIIIllIlIIIllII.java new file mode 100644 index 0000000..e30aaf0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIIllIIlIIIllIlIIIllII.java @@ -0,0 +1,13 @@ +package com.cheatbreaker.client.util.font; + +public interface llIlIIllIIlIIIllIlIIIllII { + public void lIIIIlIIllIIlIIlIIIlIIllI(Object var1); + + public Object g_(); + + public boolean isEmpty(); + + public Object lIIIIIIIIIlIllIIllIlIIlIl(); + + public Object lIIIIlIIllIIlIIlIIIlIIllI(int var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIlIlIIlIIllIllIIlllIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIlIlIIlIIllIllIIlllIl.java new file mode 100644 index 0000000..a702f2b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIlIlIlIIlIIllIllIIlllIl.java @@ -0,0 +1,7 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Map; + +public interface llIlIlIlIIlIIllIllIIlllIl + extends Map.Entry { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIllIIllIllIIlIIIIllIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIllIIllIllIIlIIIIllIIII.java new file mode 100644 index 0000000..7f2f11a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llIllIIllIllIIlIIIIllIIII.java @@ -0,0 +1,107 @@ +package com.cheatbreaker.client.util.font; + +import java.util.NoSuchElementException; + +class llIllIIllIllIIlIIIIllIIII { + int lIIIIIIIIIlIllIIllIlIIlIl; + int IlllIIIlIlllIllIlIIlllIlI; + int IIIIllIlIIIllIlllIlllllIl; + boolean IIIIllIIllIIIIllIllIIIlIl; + IIlIIlIIlIlIllIIIIlIIIIIl IlIlIIIlllIIIlIlllIlIllIl; + final TestClassFour IIIllIllIlIlllllllIlIlIII; + + private llIllIIllIllIIlIIIIllIIII(TestClassFour testClassFour) { + this.IIIllIllIlIlllllllIlIlIII = testClassFour; + this.lIIIIIIIIIlIllIIllIlIIlIl = this.IIIllIllIlIlllllllIlIlIII.IIIlllIIIllIllIlIIIIIIlII; + this.IlllIIIlIlllIllIlIIlllIlI = -1; + this.IIIIllIlIIIllIlllIlllllIl = this.IIIllIllIlIlllllllIlIlIII.IIIlIIllllIIllllllIlIIIll; + this.IIIIllIIllIIIIllIllIIIlIl = this.IIIllIllIlIlllllllIlIlIII.lIIlIlIllIIlIIIlIIIlllIII; + } + + public boolean hasNext() { + return this.IIIIllIlIIIllIlllIlllllIl != 0; + } + + public int lIIIIIIIIIlIllIIllIlIIlIl() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } + --this.IIIIllIlIIIllIlllIlllllIl; + if (this.IIIIllIIllIIIIllIllIIIlIl) { + this.IIIIllIIllIIIIllIllIIIlIl = false; + this.IlllIIIlIlllIllIlIIlllIlI = this.IIIllIllIlIlllllllIlIlIII.IIIlllIIIllIllIlIIIIIIlII; + return this.IlllIIIlIlllIllIlIIlllIlI; + } + Object[] objectArray = this.IIIllIllIlIlllllllIlIlIII.IlllIllIlIIIIlIIlIIllIIIl; + do { + if (--this.lIIIIIIIIIlIllIIllIlIIlIl >= 0) continue; + this.IlllIIIlIlllIllIlIIlllIlI = Integer.MIN_VALUE; + Object object = this.IlIlIIIlllIIIlIlllIlIllIl.get(-this.lIIIIIIIIIlIllIIllIlIIlIl - 1); + int n = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.IIIllIllIlIlllllllIlIlIII.llIIlllIIIIlllIllIlIlllIl; + while (!object.equals(objectArray[n])) { + n = n + 1 & this.IIIllIllIlIlllllllIlIlIII.llIIlllIIIIlllIllIlIlllIl; + } + return n; + } while (objectArray[this.lIIIIIIIIIlIllIIllIlIIlIl] == null); + this.IlllIIIlIlllIllIlIIlllIlI = this.lIIIIIIIIIlIllIIllIlIIlIl; + return this.IlllIIIlIlllIllIlIIlllIlI; + } + + private final void lIIIIlIIllIIlIIlIIIlIIllI(int n) { + Object[] objectArray = this.IIIllIllIlIlllllllIlIlIII.IlllIllIlIIIIlIIlIIllIIIl; + while (true) { + Object object; + int n2 = n; + n = n2 + 1 & this.IIIllIllIlIlllllllIlIlIII.llIIlllIIIIlllIllIlIlllIl; + while (true) { + if ((object = objectArray[n]) == null) { + objectArray[n2] = null; + this.IIIllIllIlIlllllllIlIlIII.IlIlllIIIIllIllllIllIIlIl[n2] = null; + return; + } + int n3 = TestClassSeven.lIIIIIIIIIlIllIIllIlIIlIl(object.hashCode()) & this.IIIllIllIlIlllllllIlIlIII.llIIlllIIIIlllIllIlIlllIl; + if (n2 <= n ? n2 >= n3 || n3 > n : n2 >= n3 && n3 > n) break; + n = n + 1 & this.IIIllIllIlIlllllllIlIlIII.llIIlllIIIIlllIllIlIlllIl; + } + if (n < n2) { + if (this.IlIlIIIlllIIIlIlllIlIllIl == null) { + this.IlIlIIIlllIIIlIlllIlIllIl = new IIlIIlIIlIlIllIIIIlIIIIIl(2); + } + this.IlIlIIIlllIIIlIlllIlIllIl.add(objectArray[n]); + } + objectArray[n2] = object; + this.IIIllIllIlIlllllllIlIlIII.IlIlllIIIIllIllllIllIIlIl[n2] = this.IIIllIllIlIlllllllIlIlIII.IlIlllIIIIllIllllIllIIlIl[n]; + } + } + + public void remove() { + if (this.IlllIIIlIlllIllIlIIlllIlI == -1) { + throw new IllegalStateException(); + } + if (this.IlllIIIlIlllIllIlIIlllIlI == this.IIIllIllIlIlllllllIlIlIII.IIIlllIIIllIllIlIIIIIIlII) { + this.IIIllIllIlIlllllllIlIlIII.lIIlIlIllIIlIIIlIIIlllIII = false; + this.IIIllIllIlIlllllllIlIlIII.IlllIllIlIIIIlIIlIIllIIIl[this.IIIllIllIlIlllllllIlIlIII.IIIlllIIIllIllIlIIIIIIlII] = null; + this.IIIllIllIlIlllllllIlIlIII.IlIlllIIIIllIllllIllIIlIl[this.IIIllIllIlIlllllllIlIlIII.IIIlllIIIllIllIlIIIIIIlII] = null; + } else if (this.lIIIIIIIIIlIllIIllIlIIlIl >= 0) { + this.lIIIIlIIllIIlIIlIIIlIIllI(this.IlllIIIlIlllIllIlIIlllIlI); + } else { + this.IIIllIllIlIlllllllIlIlIII.remove(this.IlIlIIIlllIIIlIlllIlIllIl.set(-this.lIIIIIIIIIlIllIIllIlIIlIl - 1, (Object)null)); + this.IlllIIIlIlllIllIlIIlllIlI = -1; + return; + } + --this.IIIllIllIlIlllllllIlIlIII.IIIlIIllllIIllllllIlIIIll; + this.IlllIIIlIlllIllIlIIlllIlI = -1; + } + + public int lIIIIIIIIIlIllIIllIlIIlIl(int n) { + int n2 = n; + while (n2-- != 0 && this.hasNext()) { + this.lIIIIIIIIIlIllIIllIlIIlIl(); + } + return n - n2 - 1; + } + + llIllIIllIllIIlIIIIllIIII(TestClassFour testClassFour, IlIlIllIIllllIlllIlllIlII ilIlIllIIllllIlllIlllIlII) { + this(testClassFour); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIIIIIIllIlllIlIIlIlIll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIIIIIIllIlllIlIIlIlIll.java new file mode 100644 index 0000000..e15a4b9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIIIIIIllIlllIlIIlIlIll.java @@ -0,0 +1,7 @@ +package com.cheatbreaker.client.util.font; + +public interface lllIIIIIIllIlllIlIIlIlIll { + public int lIIIIlIIllIIlIIlIIIlIIllI(Object var1); + + public boolean lIIIIlIIllIIlIIlIIIlIIllI(Object var1, Object var2); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIIIIIlIIIIIIIIlllIIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIIIIIlIIIIIIIIlllIIIII.java new file mode 100644 index 0000000..0392110 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIIIIIlIIIIIIIIlllIIIII.java @@ -0,0 +1,37 @@ +package com.cheatbreaker.client.util.font; + +import java.util.Iterator; + +class lllIIIIIlIIIIIIIIlllIIIII + extends AbstractTestClassTwo { + final TestClassFive lIIIIlIIllIIlIIlIIIlIIllI; + + lllIIIIIlIIIIIIIIlllIIIII(TestClassFive testClassFive) { + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFive; + } + + @Override + public boolean contains(Object object) { + return this.lIIIIlIIllIIlIIlIIIlIIllI.containsValue(object); + } + + @Override + public int size() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.size(); + } + + @Override + public void clear() { + this.lIIIIlIIllIIlIIlIIIlIIllI.clear(); + } + + @Override + public ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI() { + return new llIIIlllIIlllIllllIlIllIl(this); + } + + @Override + public Iterator iterator() { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIlIllllllIIIIlIIIIIllI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIlIllllllIIIIlIIIIIllI.java new file mode 100644 index 0000000..ef0596e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllIlIllllllIIIIlIIIIIllI.java @@ -0,0 +1,61 @@ +package com.cheatbreaker.client.util.font; + +import java.util.NoSuchElementException; + +class lllIlIllllllIIIIlIIIIIllI + extends lllllIlIIllIllIIIIllIIlIl { + final ITestClassFive[] lIIIIlIIllIIlIIlIIIlIIllI; + int lIIIIIIIIIlIllIIllIlIIlIl; + int IlllIIIlIlllIllIlIIlllIlI; + int IIIIllIlIIIllIlllIlllllIl = -1; + + public lllIlIllllllIIIIlIIIIIllI(ITestClassFive[] iTestClassFiveArray, int n, int n2) { + this.lIIIIlIIllIIlIIlIIIlIIllI = iTestClassFiveArray; + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.lIIIIlIIllIIlIIlIIIlIIllI(); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI() { + while (this.IlllIIIlIlllIllIlIIlllIlI != 0 && !this.lIIIIlIIllIIlIIlIIIlIIllI[this.lIIIIIIIIIlIllIIllIlIIlIl].hasNext()) { + --this.IlllIIIlIlllIllIlIIlllIlI; + ++this.lIIIIIIIIIlIllIIllIlIIlIl; + } + } + + @Override + public boolean hasNext() { + return this.IlllIIIlIlllIllIlIIlllIlI > 0; + } + + public Object next() { + if (!this.hasNext()) { + throw new NoSuchElementException(); + } + this.IIIIllIlIIIllIlllIlllllIl = this.lIIIIIIIIIlIllIIllIlIIlIl; + Object e = this.lIIIIlIIllIIlIIlIIIlIIllI[this.IIIIllIlIIIllIlllIlllllIl].next(); + this.lIIIIlIIllIIlIIlIIIlIIllI(); + return e; + } + + @Override + public void remove() { + if (this.IIIIllIlIIIllIlllIlllllIl == -1) { + throw new IllegalStateException(); + } + this.lIIIIlIIllIIlIIlIIIlIIllI[this.IIIIllIlIIIllIlllIlllllIl].remove(); + } + + @Override + public int lIIIIIIIIIlIllIIllIlIIlIl(int n) { + this.IIIIllIlIIIllIlllIlllllIl = -1; + int n2 = 0; + while (n2 < n && this.IlllIIIlIlllIllIlIIlllIlI != 0) { + n2 += this.lIIIIlIIllIIlIIlIIIlIIllI[this.lIIIIIIIIIlIllIIllIlIIlIl].lIIIIIIIIIlIllIIllIlIIlIl(n - n2); + if (this.lIIIIlIIllIIlIIlIIIlIIllI[this.lIIIIIIIIIlIllIIllIlIIlIl].hasNext()) break; + --this.IlllIIIlIlllIllIlIIlllIlI; + ++this.lIIIIIIIIIlIllIIllIlIIlIl; + } + return n2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIIIllIlIIIIIllIlllllI.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIIIllIlIIIIIllIlllllI.java new file mode 100644 index 0000000..89c8de3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIIIllIlIIIIIllIlllllI.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.util.font; + +public class llllIIIllIlIIIIIllIlllllI + extends lllllIlIIllIllIIIIllIIlIl { + protected final ITestClassFive lIIIIlIIllIIlIIlIIIlIIllI; + + public llllIIIllIlIIIIIllIlllllI(ITestClassFive iTestClassFive) { + this.lIIIIlIIllIIlIIlIIIlIIllI = iTestClassFive; + } + + @Override + public boolean hasNext() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.hasNext(); + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.next(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIllIlllIIIlIIllIIIlII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIllIlllIIIlIIllIIIlII.java new file mode 100644 index 0000000..31f44ef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIllIlllIIIlIIllIIIlII.java @@ -0,0 +1,86 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class llllIllIlllIIIlIIllIIIlII + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final lIlIIIIlIlIlllIlIIllIlIll IIIIllIlIIIllIlllIlllllIl; + private final IIllIIIIlllllIllIIllIllIl IIIIllIIllIIIIllIllIIIlIl; + + public llllIllIlllIIIlIIllIIIlII(int n, int n2, lIlIIIIlIlIlllIlIIllIlIll lIlIIIIlIlIlllIlIIllIlIll2, IIllIIIIlllllIllIIllIllIl iIllIIIIlllllIllIIllIllIl) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIlIIIllIlllIlllllIl = lIlIIIIlIlIlllIlIIllIlIll2; + this.IIIIllIIllIIIIllIllIIIlIl = iIllIIIIlllllIllIIllIllIl; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + lIIlIIlllIIlIIlIIIlIIIIII.IlllIIIlIlllIllIlIIlllIlI(this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIlIIIllIlllIlllllIl, this.IIIIllIIllIIIIllIllIIIlIl); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n6, n6 + n8, n6 + 2 * n8, this.IIIIllIlIIIllIlllIlllllIl); + n5 = lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n5 - n8, n5, n5 + n8, this.IIIIllIlIIIllIlllIlllllIl); + n7 = lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n7 - 2 * n8, n7 - n8, n7, this.IIIIllIlIIIllIlllIlllllIl); + n5 = lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(n6, n5, n7, this.IIIIllIlIIIllIlllIlllllIl); + int n9 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n10 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + if (n9 <= n2 && (n = this.IIIIllIlIIIllIlllIlllllIl.lIIIIlIIllIIlIIlIIIlIIllI(n9, n5)) <= 0) { + if (n == 0) { + if (n3 == n5) { + n5 = n9; + } else if (n9 == n5) { + n5 = n3; + } + this.IIIIllIIllIIIIllIllIIIlIl.lIIIIlIIllIIlIIlIIIlIIllI(n3++, n9); + } + ++n9; + continue; + } + while (n2 >= n9 && (n = this.IIIIllIlIIIllIlllIlllllIl.lIIIIlIIllIIlIIlIIIlIIllI(n2, n5)) >= 0) { + if (n == 0) { + if (n2 == n5) { + n5 = n10; + } else if (n10 == n5) { + n5 = n2; + } + this.IIIIllIIllIIIIllIllIIIlIl.lIIIIlIIllIIlIIlIIIlIIllI(n2, n10--); + } + --n2; + } + if (n9 > n2) break; + if (n9 == n5) { + n5 = n10; + } else if (n2 == n5) { + n5 = n2; + } + this.IIIIllIIllIIIIllIllIIIlIl.lIIIIlIIllIIlIIlIIIlIIllI(n9++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n3); + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIIllIIIIllIllIIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n8, n8); + n8 = Math.min(n10 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n10 - 1); + lIIlIIlllIIlIIlIIIlIIIIII.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIIllIIIIllIllIIIlIl, n9, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n9 - n3; + n = n10 - n2; + if (n8 > 1 && n > 1) { + llllIllIlllIIIlIIllIIIlII.invokeAll(new llllIllIlllIIIlIIllIIIlII(this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8, this.IIIIllIlIIIllIlllIlllllIl, this.IIIIllIIllIIIIllIllIIIlIl), new llllIllIlllIIIlIIllIIIlII(this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIlIIIllIlllIlllllIl, this.IIIIllIIllIIIIllIllIIIlIl)); + } else if (n8 > 1) { + llllIllIlllIIIlIIllIIIlII.invokeAll(new llllIllIlllIIIlIIllIIIlII(this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8, this.IIIIllIlIIIllIlllIlllllIl, this.IIIIllIIllIIIIllIllIIIlIl)); + } else { + llllIllIlllIIIlIIllIIIlII.invokeAll(new llllIllIlllIIIlIIllIIIlII(this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI, this.IIIIllIlIIIllIlllIlllllIl, this.IIIIllIIllIIIIllIllIIIlIl)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIllllIlIIllIIIIIIIIll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIllllIlIIllIIIIIIIIll.java new file mode 100644 index 0000000..79e790f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllIllllIlIIllIIIIIIIIll.java @@ -0,0 +1,73 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class llllIllllIlIIllIIIIIIIIll + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final int[] IIIIllIlIIIllIlllIlllllIl; + private final int[] IIIIllIIllIIIIllIllIIIlIl; + + public llllIllllIlIIllIIIIIIIIll(int[] nArray, int[] nArray2, int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIIllIIIIllIllIIIlIl = nArray2; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + int[] nArray = this.IIIIllIIllIIIIllIllIIIlIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, nArray, n6, n6 + n8, n6 + 2 * n8); + n5 = IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, nArray, n5 - n8, n5, n5 + n8); + n7 = IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, nArray, n7 - 2 * n8, n7 - n8, n7); + n5 = IlllIlIllIlllIlIIlIlllIll.lIIIIlIIllIIlIIlIIIlIIllI(this.IIIIllIlIIIllIlllIlllllIl, nArray, n6, n5, n7); + int n9 = nArray[this.IIIIllIlIIIllIlllIlllllIl[n5]]; + int n10 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n11 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + if (n10 <= n2 && (n = Integer.compare(nArray[this.IIIIllIlIIIllIlllIlllllIl[n10]], n9)) <= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(this.IIIIllIlIIIllIlllIlllllIl, n3++, n10); + } + ++n10; + continue; + } + while (n2 >= n10 && (n = Integer.compare(nArray[this.IIIIllIlIIIllIlllIlllllIl[n2]], n9)) >= 0) { + if (n == 0) { + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(this.IIIIllIlIIIllIlllIlllllIl, n2, n11--); + } + --n2; + } + if (n10 > n2) break; + IlllIlIllIlllIlIIlIlllIll.IlIlIIIlllIIIlIlllIlIllIl(this.IIIIllIlIIIllIlllIlllllIl, n10++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n10 - n3); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(this.IIIIllIlIIIllIlllIlllllIl, this.lIIIIIIIIIlIllIIllIlIIlIl, n10 - n8, n8); + n8 = Math.min(n11 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n11 - 1); + IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl(this.IIIIllIlIIIllIlllIlllllIl, n10, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n10 - n3; + n = n11 - n2; + if (n8 > 1 && n > 1) { + llllIllllIlIIllIIIIIIIIll.invokeAll(new llllIllllIlIIllIIIIIIIIll(this.IIIIllIlIIIllIlllIlllllIl, nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8), new llllIllllIlIIllIIIIIIIIll(this.IIIIllIlIIIllIlllIlllllIl, nArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } else if (n8 > 1) { + llllIllllIlIIllIIIIIIIIll.invokeAll(new llllIllllIlIIllIIIIIIIIll(this.IIIIllIlIIIllIlllIlllllIl, nArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8)); + } else { + llllIllllIlIIllIIIIIIIIll.invokeAll(new llllIllllIlIIllIIIIIIIIll(this.IIIIllIlIIIllIlllIlllllIl, nArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllIlIIllIllIIIIllIIlIl.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllIlIIllIllIIIIllIIlIl.java new file mode 100644 index 0000000..bb5d512 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllIlIIllIllIIIIllIIlIl.java @@ -0,0 +1,21 @@ +package com.cheatbreaker.client.util.font; + +public abstract class lllllIlIIllIllIIIIllIIlIl + implements ITestClassFive { + protected lllllIlIIllIllIIIIllIIlIl() { + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + @Override + public int lIIIIIIIIIlIllIIllIlIIlIl(int n) { + int n2 = n; + while (n2-- != 0 && this.hasNext()) { + this.next(); + } + return n - n2 - 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllIlIlIlIllIIlllIIIIll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllIlIlIlIllIIlllIIIIll.java new file mode 100644 index 0000000..a43547e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllIlIlIlIllIIlllIIIIll.java @@ -0,0 +1,16 @@ +package com.cheatbreaker.client.util.font; + +final class lllllIlIlIlIllIIlllIIIIll + extends llIllIIllIllIIlIIIIllIIII + implements ITestClassFive { + final TestClassFour lIIIIlIIllIIlIIlIIIlIIllI; + + public lllllIlIlIlIllIIlllIIIIll(TestClassFour testClassFour) { + super(testClassFour, null); + this.lIIIIlIIllIIlIIlIIIlIIllI = testClassFour; + } + + public Object next() { + return this.lIIIIlIIllIIlIIlIIIlIIllI.IlIlllIIIIllIllllIllIIlIl[this.lIIIIIIIIIlIllIIllIlIIlIl()]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllllIllIIlIlIlIllIIlII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllllIllIIlIlIlIllIIlII.java new file mode 100644 index 0000000..ff07a2b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllllIllIIlIlIlIllIIlII.java @@ -0,0 +1,71 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.RecursiveAction; + +public class lllllllIllIIlIlIlIllIIlII + extends RecursiveAction { + private static final long lIIIIlIIllIIlIIlIIIlIIllI = 1L; + private final int lIIIIIIIIIlIllIIllIlIIlIl; + private final int IlllIIIlIlllIllIlIIlllIlI; + private final Object[] IIIIllIlIIIllIlllIlllllIl; + + public lllllllIllIIlIlIlIllIIlII(Object[] objectArray, int n, int n2) { + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = n2; + this.IIIIllIlIIIllIlllIlllllIl = objectArray; + } + + @Override + protected void compute() { + int n; + int n2; + int n3; + Object[] objectArray = this.IIIIllIlIIIllIlllIlllllIl; + int n4 = this.IlllIIIlIlllIllIlIIlllIlI - this.lIIIIIIIIIlIllIIllIlIIlIl; + if (n4 < 8192) { + IlIIlIlIlIIlllIIIllIIIlII.IIIllIllIlIlllllllIlIlIII(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.IlllIIIlIlllIllIlIIlllIlI); + return; + } + int n5 = this.lIIIIIIIIIlIllIIllIlIIlIl + n4 / 2; + int n6 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n7 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + int n8 = n4 / 8; + n6 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n6, n6 + n8, n6 + 2 * n8); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n5 - n8, n5, n5 + n8); + n7 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n7 - 2 * n8, n7 - n8, n7); + n5 = IlIIlIlIlIIlllIIIllIIIlII.lIIIIIIIIIlIllIIllIlIIlIl(objectArray, n6, n5, n7); + Object object = objectArray[n5]; + int n9 = n3 = this.lIIIIIIIIIlIllIIllIlIIlIl; + int n10 = n2 = this.IlllIIIlIlllIllIlIIlllIlI - 1; + while (true) { + if (n9 <= n2 && (n = ((Comparable)objectArray[n9]).compareTo(object)) <= 0) { + if (n == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n3++, n9); + } + ++n9; + continue; + } + while (n2 >= n9 && (n = ((Comparable)objectArray[n2]).compareTo(object)) >= 0) { + if (n == 0) { + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n2, n10--); + } + --n2; + } + if (n9 > n2) break; + IlIIlIlIlIIlllIIIllIIIlII.IlIlIIIlllIIIlIlllIlIllIl(objectArray, n9++, n2--); + } + n8 = Math.min(n3 - this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n3); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, n9 - n8, n8); + n8 = Math.min(n10 - n2, this.IlllIIIlIlllIllIlIIlllIlI - n10 - 1); + IlIIlIlIlIIlllIIIllIIIlII.lIIIIlIIllIIlIIlIIIlIIllI(objectArray, n9, this.IlllIIIlIlllIllIlIIlllIlI - n8, n8); + n8 = n9 - n3; + n = n10 - n2; + if (n8 > 1 && n > 1) { + lllllllIllIIlIlIlIllIIlII.invokeAll(new lllllllIllIIlIlIlIllIIlII(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8), new lllllllIllIIlIlIlIllIIlII(objectArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } else if (n8 > 1) { + lllllllIllIIlIlIlIllIIlII.invokeAll(new lllllllIllIIlIlIlIllIIlII(objectArray, this.lIIIIIIIIIlIllIIllIlIIlIl, this.lIIIIIIIIIlIllIIllIlIIlIl + n8)); + } else { + lllllllIllIIlIlIlIllIIlII.invokeAll(new lllllllIllIIlIlIlIllIIlII(objectArray, this.IlllIIIlIlllIllIlIIlllIlI - n, this.IlllIIIlIlllIllIlIIlllIlI)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllllllIllllIIllIIlIIII.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllllllIllllIIllIIlIIII.java new file mode 100644 index 0000000..a6ae7e3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/lllllllllIllllIIllIIlIIII.java @@ -0,0 +1,90 @@ +package com.cheatbreaker.client.util.font; + +import java.util.concurrent.Callable; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.atomic.AtomicInteger; + +final class lllllllllIllllIIllIIlIIII + implements Callable { + final AtomicInteger lIIIIlIIllIIlIIlIIIlIIllI; + final int lIIIIIIIIIlIllIIllIlIIlIl; + final LinkedBlockingQueue IlllIIIlIlllIllIlIIlllIlI; + final int[] IIIIllIlIIIllIlllIlllllIl; + + lllllllllIllllIIllIIlIIII(AtomicInteger atomicInteger, int n, LinkedBlockingQueue linkedBlockingQueue, int[] nArray) { + this.lIIIIlIIllIIlIIlIIIlIIllI = atomicInteger; + this.lIIIIIIIIIlIllIIllIlIIlIl = n; + this.IlllIIIlIlllIllIlIIlllIlI = linkedBlockingQueue; + this.IIIIllIlIIIllIlllIlllllIl = nArray; + } + + public Void lIIIIlIIllIIlIIlIIIlIIllI() throws InterruptedException { + int[] nArray = new int[256]; + int[] nArray2 = new int[256]; + while (true) { + int n; + lIIllIlIIlIIIIIlIIlIlIIll lIIllIlIIlIIIIIlIIlIlIIll2; + if (this.lIIIIlIIllIIlIIlIIIlIIllI.get() == 0) { + int n2 = this.lIIIIIIIIIlIllIIllIlIIlIl; + while (n2-- != 0) { + this.IlllIIIlIlllIllIlIIlllIlI.add(IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl); + } + } + if ((lIIllIlIIlIIIIIlIIlIlIIll2 = (lIIllIlIIlIIIIIlIIlIlIIll)this.IlllIIIlIlllIllIlIIlllIlI.take()) == IlllIlIllIlllIlIIlIlllIll.lIIIIIIIIIlIllIIllIlIIlIl) { + return null; + } + int n3 = lIIllIlIIlIIIIIlIIlIlIIll2.lIIIIlIIllIIlIIlIIIlIIllI; + int n4 = lIIllIlIIlIIIIIlIIlIlIIll2.lIIIIIIIIIlIllIIllIlIIlIl; + int n5 = lIIllIlIIlIIIIIlIIlIlIIll2.IlllIIIlIlllIllIlIIlllIlI; + int n6 = n5 % 4 == 0 ? 128 : 0; + int n7 = (3 - n5 % 4) * 8; + int n8 = n3 + n4; + while (n8-- != n3) { + int n9 = this.IIIIllIlIIIllIlllIlllllIl[n8] >>> n7 & 0xFF ^ n6; + nArray[n9] = nArray[n9] + 1; + } + n8 = -1; + int n10 = n3; + for (n = 0; n < 256; ++n) { + if (nArray[n] != 0) { + n8 = n; + } + nArray2[n] = n10 += nArray[n]; + } + n = n3 + n4 - nArray[n8]; + int n11 = -1; + for (n10 = n3; n10 <= n; n10 += nArray[n11]) { + int n12 = this.IIIIllIlIIIllIlllIlllllIl[n10]; + n11 = n12 >>> n7 & 0xFF ^ n6; + if (n10 < n) { + while (true) { + int n13 = n11; + int n14 = nArray2[n13] - 1; + nArray2[n13] = n14; + int n15 = n14; + if (n14 <= n10) break; + int n16 = n12; + n12 = this.IIIIllIlIIIllIlllIlllllIl[n15]; + this.IIIIllIlIIIllIlllIlllllIl[n15] = n16; + n11 = n12 >>> n7 & 0xFF ^ n6; + } + this.IIIIllIlIIIllIlllIlllllIl[n10] = n12; + } + if (n5 < 3 && nArray[n11] > 1) { + if (nArray[n11] < 1024) { + IlllIlIllIlllIlIIlIlllIll.IIIllIllIlIlllllllIlIlIII(this.IIIIllIlIIIllIlllIlllllIl, n10, n10 + nArray[n11]); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI.incrementAndGet(); + this.IlllIIIlIlllIllIlIIlllIlI.add(new lIIllIlIIlIIIIIlIIlIlIIll(n10, nArray[n11], n5 + 1)); + } + } + nArray[n11] = 0; + } + this.lIIIIlIIllIIlIIlIIIlIIllI.decrementAndGet(); + } + } + + public Object call() throws InterruptedException { + return this.lIIIIlIIllIIlIIlIIIlIIllI(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllllllllllIlIIIIIIIIlll.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllllllllllIlIIIIIIIIlll.java new file mode 100644 index 0000000..92df3d3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/font/llllllllllllIlIIIIIIIIlll.java @@ -0,0 +1,8 @@ +package com.cheatbreaker.client.util.font; + +import java.util.ListIterator; + +public interface llllllllllllIlIIIIIIIIlll + extends ListIterator, + llIIIIlllIIIIIIIllIllllll { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/Friend.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/Friend.java new file mode 100644 index 0000000..07a1b76 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/Friend.java @@ -0,0 +1,202 @@ +package com.cheatbreaker.client.util.friend; + +import net.minecraft.util.EnumChatFormatting; + +import java.awt.*; +import java.beans.ConstructorProperties; +import java.util.Objects; + +public class Friend { + private final String playerId; + private String name; + private String status; + private String server; + private boolean online; + private long offlineSince; + private Status onlineStatus = Status.ONLINE; + + public static int getStatusColor(Status playerStatus) { + if (playerStatus == null) { + return -13158601; + } + int color; + switch (playerStatus) { + case AWAY: + color = new Color(-1722581).getRGB(); + break; + case BUSY: + color = new Color(-1758421).getRGB(); + break; + case OFFLINE: + color = new Color(-13158601).getRGB(); + break; + default: + color = -13369549; + break; + } + return color; + } + + public String getStatusString() { + String playingText; + if (this.online) { + if (this.server != null && !Objects.equals(this.server, "")) { + playingText = "Playing" + EnumChatFormatting.BOLD + " " + this.server; + } else { + switch (this.onlineStatus) { + case AWAY: + playingText = "Away"; + break; + case BUSY: + playingText = "Busy"; + break; + default: + playingText = "Online"; + break; + } + } + } else { + long timeDiff = this.offlineSince; + long seconds = 1000L; + long minutes = seconds * 60L; + long hours = minutes * 60L; + long day = hours * 24L; + long daysTime = timeDiff / day; + long hoursTime = (timeDiff %= day) / hours; + long minutesTime = (timeDiff %= hours) / minutes; + playingText = daysTime > 0L ? "Offline for " + daysTime + (daysTime == 1L ? " day" : " days") : + (hoursTime > 0L ? "Offline for " + hoursTime + (hoursTime == 1L ? " hour" : " hours") : "Offline for " + minutesTime + + (minutesTime == 1L ? " minute" : " minutes")); + } + return playingText; + } + + @ConstructorProperties(value={"playerId", "name", "status", "server", "online", "offlineSince", "onlineStatus"}) + Friend(String playerId, String name, String status, String server, boolean online, long offlineSince, Status onlineStatus) { + this.playerId = playerId; + this.name = name; + this.status = status; + this.server = server; + this.online = online; + this.offlineSince = offlineSince; + this.onlineStatus = onlineStatus; + } + + public static FriendBuilder builder() { + return new FriendBuilder(); + } + + public String getPlayerId() { + return this.playerId; + } + + public String getName() { + return this.name; + } + + public String getStatus() { + return this.status; + } + + public String getServer() { + return this.server; + } + + public boolean isOnline() { + return this.online; + } + + public long getOfflineSince() { + return this.offlineSince; + } + + public Status getOnlineStatus() { + return this.onlineStatus; + } + + public void setName(String string) { + this.name = string; + } + + public void setStatus(String string) { + this.status = string; + } + + public void setServer(String string) { + this.server = string; + } + + public void setOnline(boolean bl) { + this.online = bl; + } + + public void setOfflineSince(long l) { + this.offlineSince = l; + } + + public void setOnlineStatus(Status playerStatus) { + this.onlineStatus = playerStatus; + } + + public static class FriendBuilder { + private String playerId; + private String name; + private String status; + private String server; + private boolean online; + private long offlineSince; + private Status onlineStatus; + + FriendBuilder() { + } + + public FriendBuilder playerId(String string) { + this.playerId = string; + return this; + } + + public FriendBuilder name(String string) { + this.name = string; + return this; + } + + public FriendBuilder status(String string) { + this.status = string; + return this; + } + + public FriendBuilder server(String string) { + this.server = string; + return this; + } + + public FriendBuilder online(boolean bl) { + this.online = bl; + return this; + } + + public FriendBuilder offlineSince(long l) { + this.offlineSince = l; + return this; + } + + public FriendBuilder onlineStatus(Status playerStatus) { + this.onlineStatus = playerStatus; + return this; + } + + public Friend build() { + return new Friend(this.playerId, this.name, this.status, this.server, this.online, this.offlineSince, this.onlineStatus); + } + + public String toString() { + return "Friend.FriendBuilder(playerId=" + this.playerId + ", name=" + this.name + ", status=" + this.status + ", server=" + this.server + ", online=" + this.online + ", offlineSince=" + this.offlineSince + ", onlineStatus=" + this.onlineStatus + ")"; + } + } + public enum Status { + ONLINE, + AWAY, + BUSY, + OFFLINE + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/FriendRequest.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/FriendRequest.java new file mode 100644 index 0000000..6cb5583 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/FriendRequest.java @@ -0,0 +1,20 @@ +package com.cheatbreaker.client.util.friend; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor @Getter +public class FriendRequest { + private final String username; + private final String playerId; + private boolean friend; + + public FriendRequest(String username, String playerId) { + this.username = username; + this.playerId = playerId; + } + + public void setFriend(boolean friend) { + this.friend = friend; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/FriendsManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/FriendsManager.java new file mode 100644 index 0000000..893ed91 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/friend/FriendsManager.java @@ -0,0 +1,106 @@ +package com.cheatbreaker.client.util.friend; + +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.client.Minecraft; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +public class FriendsManager { + private final Map friendsMap = new HashMap(); + private final Map friendRequestsMap = new HashMap(); + private final Map> readMessages = new HashMap>(); + private final Map> messages = new HashMap>(); + private final Map> unreadMessages = new HashMap>(); + private final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss"); + + public void addUnreadMessage(String var1, String var2) { + Friend var3 = this.getFriend(var1); + if (var3 != null) { + if (!this.messages.containsKey(var1)) { + this.messages.put(var1, new ArrayList<>()); + } + String var4 = EnumChatFormatting.GRAY + LocalDateTime.now().format(this.timeFormatter); + String var5 = EnumChatFormatting.GREEN + var3.getName() + EnumChatFormatting.RESET; + String var6 = var4 + " " + var5 + ": " + var2; + this.messages.get(var1).add(var6); + } + } + + public void addMessage(String var1, String var2) { + Friend var3 = this.getFriend(var1); + if (var3 != null) { + if (!this.readMessages.containsKey(var1)) { + this.readMessages.put(var1, new ArrayList<>()); + } + this.readMessages.get(var1).add(var2); + } + } + + public void addOutgoingMessage(String playerId, String message) { + Friend friend = this.getFriend(playerId); + if (friend != null) { + if (!this.unreadMessages.containsKey(playerId)) { + this.unreadMessages.put(playerId, new ArrayList<>()); + } + this.unreadMessages.get(playerId).add(friend.getName() + ": " + message); + String time = EnumChatFormatting.GRAY + + LocalDateTime.now().format(this.timeFormatter); + String name = EnumChatFormatting.AQUA + + Minecraft.getMinecraft().getSession().getUsername() + EnumChatFormatting.RESET; + String var6 = time + " " + name + ": " + message; + this.addMessage(playerId, var6); + } + } + + public void readMessages(String var1) { + if (this.messages.containsKey(var1)) { + List var2 = this.messages.get(var1); + if (!this.readMessages.containsKey(var1)) { + this.readMessages.put(var1, new ArrayList<>()); + } + this.readMessages.get(var1).addAll(var2); + this.messages.remove(var1); + } + } + + public Friend getFriend(String var1) { + Iterator var2 = this.friendsMap.values().iterator(); + if (!var2.hasNext()) { + return null; + } + Friend var3 = var2.next(); + while (!var3.getPlayerId().equals(var1)) { + if (!var2.hasNext()) { + return null; + } + var3 = var2.next(); + } + return var3; + } + + public Map getFriends() { + return this.friendsMap; + } + + public Map getFriendRequests() { + return this.friendRequestsMap; + } + + public Map> getReadMessages() { + return this.readMessages; + } + + public Map> getMessage() { + return this.messages; + } + + public Map> getUnreadMessages() { + return this.unreadMessages; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/manager/CBCrashHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/manager/CBCrashHandler.java new file mode 100644 index 0000000..90a2894 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/manager/CBCrashHandler.java @@ -0,0 +1,121 @@ +package com.cheatbreaker.client.util.manager; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.src.HttpUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; + +@Deprecated +public class CBCrashHandler { + public static void handleCrash(StackTraceElement[] arrstackTraceElement) { + try { + GameSettings gameSettings = Config.getGameSettings(); + String string = CheatBreaker.getInstance().getGlobalSettings().webapiCrashReportUpload; + String string2 = CBCrashHandler.getPOSTData(arrstackTraceElement); + byte[] arrby = string2.getBytes(StandardCharsets.US_ASCII); + HashMap hashMap = new HashMap(); + System.out.println("[Crash Handler] Sending Post"); + String string3 = HttpUtils.post(string, hashMap, arrby); + System.out.println("[Crash Handler] Sent Post"); + if (string3 != null) { + StringSelection stringSelection = new StringSelection(string3); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(stringSelection, null); + new Thread(() -> JOptionPane.showMessageDialog(null, "Your client has crashed. \n\nPlease use the following code (also copied to your clipboard) when submitting a bug report: " + string3, "Something went wrong (Closing in 5 seconds)", 2)).start(); + } + Thread.sleep(6000L); + } catch (Exception exception) { + Config.dbg(exception.getClass().getName() + ": " + exception.getMessage()); + } + } + + + /* + * Could not resolve type clashes + */ + private static String getPOSTData(StackTraceElement[] arrstackTraceElement) { + BufferedReader bufferedReader; + StringBuilder builder = new StringBuilder(); + builder.append("CheatBreaker client Version: ").append(CheatBreaker.getInstance().getGitCommitId()).append("/").append(CheatBreaker.getInstance().getGitBranch()).append("\n\n"); + builder.append("\n"); + builder.append("\n\n"); + builder.append("= [ StackTrace ] =\n"); + for (StackTraceElement stackTraceElement : arrstackTraceElement) { + builder.append("\n").append(stackTraceElement); + } + builder.append("\n\n"); + GameSettings object = Minecraft.getMinecraft().gameSettings; + if (Minecraft.getMinecraft().getSession() != null) { + builder.append("= [ User Info ] =\n"); + builder.append("Username: ").append(Minecraft.getMinecraft().getSession().getUsername()).append("\n"); + builder.append("UUID: ").append(Minecraft.getMinecraft().getSession().getPlayerID()).append("\n\n"); + } + builder.append("= [ Options.txt ] =\n"); + try { + String string; + bufferedReader = new BufferedReader(new FileReader(object.optionsFile)); + while ((string = bufferedReader.readLine()) != null) { + if (string.startsWith("stream") || string.startsWith("key_") || string.startsWith("soundCategory")) continue; + builder.append(string).append("\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + builder.append("\n= [ OptionsOF.txt ] =\n"); + try { + String string; + bufferedReader = new BufferedReader(new FileReader(object.optionsFileOF)); + while ((string = bufferedReader.readLine()) != null) { + if (string.startsWith("ofAnimated")) continue; + builder.append(string + "\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + return builder.toString(); + } + + private static String makeSummary(CrashReport crashReport) { + return "Unknown"; + } + + /* + * Could not resolve type clashes + */ + public static void extendCrashReport(CrashReportCategory crashReportCategory) { + String string = "["; + for (Object object : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + if (((Setting)object).getSettingName().equals("label")) continue; + string = string + ((Setting)object).getSettingName() + "=" + ((Setting)object).getValue() + ", "; + } + crashReportCategory.addCrashSection("Global Settings", string + "]"); + for (Object object : CheatBreaker.getInstance().getModuleManager().playerMods) { + String string2 = "["; + for (Setting setting : ((AbstractModule)object).getSettingsList()) { + if (setting.getSettingName().equals("label")) continue; + string2 = string2 + setting.getSettingName() + "=" + setting.getValue() + (((AbstractModule)object).getSettingsList().indexOf(setting) == ((AbstractModule)object).getSettingsList().size() - 1 ? "" : ", "); + } + crashReportCategory.addCrashSection(((AbstractModule)object).getName() + " options", string2 + "]"); + } + crashReportCategory.addCrashSection("OpenGlVersion", "" + Config.openGlVersion); + crashReportCategory.addCrashSection("OpenGlRenderer", "" + Config.openGlRenderer); + crashReportCategory.addCrashSection("OpenGlVendor", "" + Config.openGlVendor); + crashReportCategory.addCrashSection("CpuCount", "" + Config.getAvailableProcessors()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/manager/DebugInfoHandler.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/manager/DebugInfoHandler.java new file mode 100644 index 0000000..feefd62 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/manager/DebugInfoHandler.java @@ -0,0 +1,143 @@ +package com.cheatbreaker.client.util.manager; + + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.FileUploadThread; +import net.minecraft.src.IFileUploadListener; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; + +public class DebugInfoHandler { + public static void ReportThatBug(String description) { + try { + String link = CheatBreaker.getInstance().getGlobalSettings().webapiDebugUpload; + String info = DebugInfoHandler.getWebAPIInfo(description); + byte[] intoToBytes = info.getBytes(StandardCharsets.US_ASCII); + IFileUploadListener webUploadType = (string, arrby, throwable) -> DebugInfoHandler.sendMessage(); + HashMap hashMap = new HashMap(); + hashMap.put("OF-Version", Config.getVersion()); + FileUploadThread sendWebAPIPostThread = new FileUploadThread(link, hashMap, intoToBytes, webUploadType); + sendWebAPIPostThread.setPriority(10); + sendWebAPIPostThread.start(); + Thread.sleep(1000L); + } catch (InterruptedException exception) { + exception.printStackTrace(); + } + } + + /* + * Could not resolve type clashes + */ + private static String getWebAPIInfo(String string) { + Runtime runtime = Runtime.getRuntime(); + long maxMemory = runtime.maxMemory(); + long totalMemory = runtime.totalMemory(); + long freeMemory = runtime.freeMemory(); + long maxMemDiv = maxMemory / 1024L / 1024L; + long totalMemDiv = totalMemory / 1024L / 1024L; + long freeMemDiv = freeMemory / 1024L / 1024L; + StringBuilder builder = new StringBuilder(); + builder.append("OptiFine Version: ").append(Config.getVersion()).append("\n\n"); + builder.append("CheatBreaker client Version: ").append(CheatBreaker.getInstance().getGitCommitId() + "/" + CheatBreaker.getInstance().getGitBranch()).append("\n\n"); + builder.append("= [ Description ] =\n"); + builder.append(string + "\n\n"); + builder.append("= [ User Info ] =\n"); + if (Minecraft.getMinecraft().getSession() != null) { + try { + builder.append("User: " + Minecraft.getMinecraft().getSession().getUsername() + "\n"); + builder.append("UUID: " + Minecraft.getMinecraft().getSession().getPlayerID() + "\n\n"); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + builder.append("= [ System Info ] =\n"); + builder.append("OpenGlVersion: " + Config.openGlVersion + "\n"); + builder.append("OpenGlRenderer: " + Config.openGlRenderer + "\n"); + builder.append("OpenGlVendor: " + Config.openGlVendor + "\n"); + builder.append("CpuCount: " + Config.getAvailableProcessors() + "\n"); + builder.append("OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n"); + builder.append("Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n"); + builder.append("Java VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor") + "\n"); + builder.append("Memory: " + freeMemory + " bytes (" + freeMemDiv + " MB) / " + totalMemory + " bytes (" + totalMemDiv + " MB) up to " + maxMemory + " bytes (" + maxMemDiv + " MB)" + "\n"); + builder.append("JVM Flags: " + jvmFlags() + "\n\n"); + builder.append("= [ Module Settings ] =").append("\n"); + for (AbstractModule module : CheatBreaker.getInstance().getModuleManager().playerMods) { + StringBuilder moduleSetting = new StringBuilder(); + for (Setting setting : module.getSettingsList()) { + if (setting.getSettingName().equals("label")) continue; + moduleSetting.append(setting.getSettingName()).append("=").append(setting.getValue()).append(module.getSettingsList().indexOf(setting) == module.getSettingsList().size() - 1 ? "" : ", "); + } + builder.append(module.getName() + ": [" + moduleSetting + "]\n"); + } + builder.append("\n= [ Global Settings ] =").append("\n"); + StringBuilder globalSetting = new StringBuilder(); + List settingsList = CheatBreaker.getInstance().getGlobalSettings().settingsList; + for (Setting theSetting : settingsList) { + if (theSetting.getSettingName().equals("label")) continue; + globalSetting.append(theSetting.getSettingName()).append("=").append(theSetting.getValue()).append(settingsList.indexOf(theSetting) == + settingsList.size() - 1 ? "" : ", "); + } + builder.append("Global: [" + globalSetting + "]\n\n"); + GameSettings gameSettings = Minecraft.getMinecraft().gameSettings; + builder.append("= [ Options.txt ] =\n"); + BufferedReader readFile; + String varString; + try { + readFile = new BufferedReader(new FileReader(gameSettings.optionsFile)); + while ((varString = readFile.readLine()) != null) { + if (varString.startsWith("stream") || varString.startsWith("key_") || varString.startsWith("soundCategory")) continue; + builder.append(varString + "\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + builder.append("\n= [ OptionsOF.txt ] =\n"); + try { + readFile = new BufferedReader(new FileReader(gameSettings.optionsFileOF)); + while ((varString = readFile.readLine()) != null) { + if (varString.startsWith("ofAnimated")) continue; + builder.append(varString + "\n"); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + return builder.toString(); + } + + private static void sendMessage() { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Uploaded debug info.")); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + Minecraft.getMinecraft().entityRenderer.stopUseShader(); + } + Minecraft.getMinecraft().displayGuiScreen(null); + } + + private static String jvmFlags() { + RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); + List list = runtimeMXBean.getInputArguments(); + int n = 0; + StringBuilder stringBuilder = new StringBuilder(); + for (String string : list) { + if (!string.startsWith("-X")) continue; + if (n++ > 0) { + stringBuilder.append(" "); + } + stringBuilder.append(string); + } + return String.format("%d total; %s", n, stringBuilder); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/hologram/Hologram.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/hologram/Hologram.java new file mode 100644 index 0000000..e0250df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/hologram/Hologram.java @@ -0,0 +1,105 @@ +package com.cheatbreaker.client.util.render.hologram; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import org.lwjgl.opengl.GL11; + +public class Hologram { + private final UUID uuid; + private String[] lines; + private final double xPos; + private final double yPos; + private final double zPos; + private static final List holograms = new ArrayList<>(); + + public Hologram(UUID uUID, double xPos, double yPos, double zPos) { + this.uuid = uUID; + this.xPos = xPos; + this.yPos = yPos; + this.zPos = zPos; + } + + public static void renderHologram() { + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + RenderManager renderManager = RenderManager.instance; + for (Hologram hologram : holograms) { + if (hologram.getLines() == null || hologram.getLines().length <= 0) continue; + for (int i = hologram.getLines().length - 1; i >= 0; --i) { + String line = hologram.getLines()[hologram.getLines().length - i - 1]; + float xPos = (float)(hologram.getXPos() - (double)((float)RenderManager.renderPosX)); + float yPos = (float)(hologram.getYPos() + 1.0 + (double)((float)i * (0.16049382f * 1.5576924f)) - + (double)((float)RenderManager.renderPosY)); + float zPos = (float)(hologram.getZPos() - (double)((float)RenderManager.renderPosZ)); + float scale = 1.6f; + float scaled = 0.016666668f * scale; + GL11.glPushMatrix(); + GL11.glTranslatef(xPos, yPos, zPos); + GL11.glNormal3f(0.0f, 1.0f, 0.0f); + GL11.glRotatef(-renderManager.playerViewY, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(renderManager.playerViewX, 1.0f, 0.0f, 0.0f); + GL11.glScalef(-scaled, -scaled, scaled); + GL11.glDisable(2896); + GL11.glDepthMask(false); + GL11.glDisable(2929); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Tessellator tessellator = Tessellator.instance; + int renderYPos = 0; + GL11.glDisable(3553); + tessellator.startDrawingQuads(); + int renderXPos = fontRenderer.getStringWidth(line) / 2; + tessellator.setColorRGBA_F(0.0f, 0.0f, 0.0f, 0.6875f * 0.36363637f); + tessellator.addVertex(-renderXPos - 1, -1 + renderYPos, 0.0); + tessellator.addVertex(-renderXPos - 1, 8 + renderYPos, 0.0); + tessellator.addVertex(renderXPos + 1, 8 + renderYPos, 0.0); + tessellator.addVertex(renderXPos + 1, -1 + renderYPos, 0.0); + tessellator.draw(); + GL11.glEnable(3553); + fontRenderer.drawString(line, -fontRenderer.getStringWidth(line) / 2, renderYPos, 0x20FFFFFF); + GL11.glEnable(2929); + GL11.glDepthMask(true); + fontRenderer.drawString(line, -fontRenderer.getStringWidth(line) / 2, renderYPos, -1); + GL11.glEnable(2896); + GL11.glDisable(3042); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glPopMatrix(); + } + } + } + + public UUID getUUID() { + return this.uuid; + } + + public String[] getLines() { + return this.lines; + } + + public void setLines(String[] lines) { + this.lines = lines; + } + + public double getXPos() { + return this.xPos; + } + + public double getYPos() { + return this.yPos; + } + + public double getZPos() { + return this.zPos; + } + + public static List getHolograms() { + return holograms; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/serverlist/ServerListEntryPinned.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/serverlist/ServerListEntryPinned.java new file mode 100644 index 0000000..15b16a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/serverlist/ServerListEntryPinned.java @@ -0,0 +1,250 @@ +package com.cheatbreaker.client.util.render.serverlist; + +import com.cheatbreaker.client.ui.mainmenu.LunarNetworkLogoElement; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.GlStateManager; +import com.google.common.base.Charsets; +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import java.awt.image.BufferedImage; +import java.util.List; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; +import javax.imageio.ImageIO; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.gui.GuiMultiplayer; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public class ServerListEntryPinned implements GuiListExtended.IGuiListEntry { + private static final ResourceLocation SERVER_SELECTION_BUTTONS = new ResourceLocation("textures/gui/resource_packs.png"); + private static final ResourceLocation UNKNOWN_SERVER = new ResourceLocation("textures/misc/unknown_pack.png"); + private static final Logger logger = LogManager.getLogger(); + private static final ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(5, new ThreadFactoryBuilder().setNameFormat("Server Pinger #%d").setDaemon(true).build()); + private final GuiMultiplayer guiMultiplayer; + private final Minecraft mc; + private final ServerData server; + private long field_148298_f; + private String lastIconB64; + private DynamicTexture icon; + private ResourceLocation serverIcon; + private ResourceLocation starIcon = new ResourceLocation("client/icons/star-64.png"); + private ResourceLocation cbIcon = new ResourceLocation("client/icons/cb.png"); + private LunarNetworkLogoElement lunarNetworkLogo; + + public ServerListEntryPinned(GuiMultiplayer p_i45048_1_, ServerData serverIn) { + this.guiMultiplayer = p_i45048_1_; + this.server = serverIn; + this.mc = Minecraft.getMinecraft(); + this.serverIcon = new ResourceLocation("servers/" + serverIn.serverIP + "/icon"); + this.icon = (DynamicTexture)this.mc.getTextureManager().getTexture(this.serverIcon); + if (serverIn.serverIP.toLowerCase().endsWith("lunar.gg")) { + this.lunarNetworkLogo = new LunarNetworkLogoElement(); + } + } + + @Override + public void func_148279_a(int n, int n2, int n3, int n4, int n5, Tessellator tessellator, int n6, int n7, boolean bl) { + String string; + int n8; + if (!this.server.field_78841_f) { + this.server.field_78841_f = true; + this.server.pingToServer = -2L; + this.server.serverMOTD = ""; + this.server.populationInfo = ""; + executor.submit(() -> { + try { + ServerListEntryPinned.getGuiMultiplayer(ServerListEntryPinned.this) + .func_146789_i().func_147224_a(ServerListEntryPinned + .setServer(ServerListEntryPinned.this)); + } catch (Exception exception) { + ServerListEntryPinned.setServer(ServerListEntryPinned.this).pingToServer = -1L; + ServerListEntryPinned.setServer(ServerListEntryPinned.this).serverMOTD + = EnumChatFormatting.DARK_RED + "Can't connect to server."; + } + }); + + } + GL11.glColor4f(1.0f, 0.40909088f * 2.2f, 0.0f, 1.0f); + RenderUtil.renderIcon(this.starIcon, (float)5, (float)(n2 - 17), (float)(n3 + (this.server.isCheatBreakerServer() ? 4 : 12))); + GL11.glColor4f(11.5f * 0.073913045f, 0.2857143f * 2.975f, 3.0f * 0.28333333f, 1.0f); + if (this.server.isCheatBreakerServer()) { + float f = 16; + float f2 = 8; + float f3 = 0.0f; + float f4 = 0.0f; + float f5 = n2 - 20; + float f6 = n3 + 20; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(this.cbIcon); + GL11.glBegin(7); + GL11.glTexCoord2d(f3 / (float)5, f4 / (float)5); + GL11.glVertex2d(f5, f6); + GL11.glTexCoord2d(f3 / (float)5, (f4 + (float)5) / (float)5); + GL11.glVertex2d(f5, f6 + f2); + GL11.glTexCoord2d((f3 + (float)5) / (float)5, (f4 + (float)5) / (float)5); + GL11.glVertex2d(f5 + f, f6 + f2); + GL11.glTexCoord2d((f3 + (float)5) / (float)5, f4 / (float)5); + GL11.glVertex2d(f5 + f, f6); + GL11.glEnd(); + GL11.glDisable(3042); + } + boolean outOfDateClient = this.server.version > 5; + boolean outOfDateServer = this.server.version < 5; + boolean outOfDate = (outOfDateClient || outOfDateServer) && this.server.version != -1332; + this.mc.fontRenderer.drawString(this.server.serverName, n2 + 32 + 3, n3 + 1, 0xFFFFFF); + List list = this.mc.fontRenderer.listFormattedStringToWidth(this.server.serverMOTD, n4 - 32 - 2); + for (int i = 0; i < Math.min(list.size(), 2); ++i) { + this.mc.fontRenderer.drawString((String)list.get(i), n2 + 32 + 3, n3 + 12 + this.mc.fontRenderer.FONT_HEIGHT * i, 0x808080); + } + String string2 = outOfDate ? (Object)((Object)EnumChatFormatting.DARK_RED) + this.server.gameVersion : this.server.populationInfo; + int n9 = this.mc.fontRenderer.getStringWidth(string2); + this.mc.fontRenderer.drawString(string2, n2 + n4 - n9 - 15 - 2, n3 + 1, 0x808080); + int n10 = 0; + String string3 = null; + if (outOfDate) { + n8 = 5; + string = outOfDateClient ? "Client out of date!" : "Server out of date!"; + string3 = this.server.playerList; + } else if (this.server.field_78841_f && this.server.pingToServer != -2L) { + n8 = this.server.pingToServer < 0L ? 5 : (this.server.pingToServer < 150L ? 0 : (this.server.pingToServer < 300L ? 1 : (this.server.pingToServer < 600L ? 2 : (this.server.pingToServer < 1000L ? 3 : 4)))); + if (this.server.pingToServer < 0L) { + string = "(no connection)"; + } else { + string = this.server.pingToServer + "ms"; + string3 = this.server.playerList; + } + } else { + n10 = 1; + n8 = (int)(Minecraft.getSystemTime() / 100L + (long)(n * 2) & 7L); + if (n8 > 4) { + n8 = 8 - n8; + } + string = "Pinging..."; + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.getTextureManager().bindTexture(Gui.icons); + Gui.drawModalRectWithCustomSizedTexture(n2 + n4 - 15, n3, n10 * 10, 176 + n8 * 8, 10, 8, 256, 256); + if (this.server.getBase64EncodedIconData() != null && !this.server.getBase64EncodedIconData().equals(this.lastIconB64)) { + this.lastIconB64 = this.server.getBase64EncodedIconData(); + this.prepareServerIcon(); + this.guiMultiplayer.getServerList().saveServerList(); + } + if (this.lunarNetworkLogo != null) { + this.lunarNetworkLogo.setElementSize(n2, n3, 32.0f, 29.5f); + this.lunarNetworkLogo.drawElementHover(0.0f, 0.0f, true); + } else { + if (this.icon != null) { + this.mc.getTextureManager().bindTexture(this.serverIcon); + } else { + this.mc.getTextureManager().bindTexture(UNKNOWN_SERVER); + } + GlStateManager.enableBlend(); + Gui.drawModalRectWithCustomSizedTexture(n2, n3, 0.0f, 0.0f, 32, 32, 32.0F, 32.0F); + GlStateManager.disableBlend(); + } + + int n11 = n6 - n2; + int n12 = n7 - n3; + if (n11 >= n4 - 15 && n11 <= n4 - 5 && n12 >= 0 && n12 <= 8) { + this.guiMultiplayer.writeStringToBuffer(string); + } else if (n11 >= n4 - n9 - 15 - 2 && n11 <= n4 - 15 - 2 && n12 >= 0 && n12 <= 8) { + this.guiMultiplayer.writeStringToBuffer(string3); + } + Minecraft minecraft = Minecraft.getMinecraft(); + if (minecraft.gameSettings.touchscreen || bl) { + minecraft.getTextureManager().bindTexture(SERVER_SELECTION_BUTTONS); + Gui.drawRect(n2, n3, n2 + 32, n3 + 32, -1601138544); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + int n13 = n6 - n2; + if (n13 < 32) { + Gui.drawModalRectWithCustomSizedTexture(n2, n3, 0.0f, 32, 32, 32, 256, 256); + } else { + Gui.drawModalRectWithCustomSizedTexture(n2, n3, 0.0f, 0.0f, 32, 32, 256, 256); + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + private void prepareServerIcon() { + if (this.server.getBase64EncodedIconData() == null) { + this.mc.getTextureManager().func_147645_c(this.serverIcon); + this.icon = null; + } else { + BufferedImage bufferedImage; + block8: { + ByteBuf byteBuf = Unpooled.copiedBuffer(this.server.getBase64EncodedIconData(), Charsets.UTF_8); + ByteBuf byteBuf2 = Base64.decode(byteBuf); + try { + bufferedImage = ImageIO.read(new ByteBufInputStream(byteBuf2)); + Validate.validState(bufferedImage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]); + Validate.validState(bufferedImage.getHeight() == 64, "Must be 64 pixels high", new Object[0]); + break block8; + } catch (Exception exception) { + logger.error("Invalid icon for server " + this.server.serverName + " (" + this.server.serverIP + ")", (Throwable)exception); + this.server.setBase64EncodedIconData((String)null); + } + finally { + byteBuf.release(); + byteBuf2.release(); + } + return; + } + if (this.icon == null) { + this.icon = new DynamicTexture(bufferedImage.getWidth(), bufferedImage.getHeight()); + this.mc.getTextureManager().loadTexture(this.serverIcon, (ITextureObject)this.icon); + } + bufferedImage.getRGB(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), this.icon.getTextureData(), 0, bufferedImage.getWidth()); + this.icon.updateDynamicTexture(); + } + } + + @Override + public boolean func_148278_a(int n, int n2, int n3, int n4, int n5, int n6) { + this.guiMultiplayer.func_146790_a(n); + if (Minecraft.getSystemTime() - this.field_148298_f < 250L) { + this.guiMultiplayer.func_146796_h(); + } + this.field_148298_f = Minecraft.getSystemTime(); + if (n5 <= 32) { + if (n5 < 32) { + this.guiMultiplayer.func_146796_h(); + return true; + } + } + return false; + } + + @Override + public void func_148277_b(int n, int n2, int n3, int n4, int n5, int n6) { + } + + public ServerData getServer() { + return this.server; + } + + static ServerData setServer(ServerListEntryPinned cBServerListEntryNormal) { + return cBServerListEntryNormal.server; + } + + static GuiMultiplayer getGuiMultiplayer(ServerListEntryPinned cBServerListEntryNormal) { + return cBServerListEntryNormal.guiMultiplayer; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/serverlist/UnsafeServerAction.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/serverlist/UnsafeServerAction.java new file mode 100644 index 0000000..7510368 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/serverlist/UnsafeServerAction.java @@ -0,0 +1,5 @@ +package com.cheatbreaker.client.util.render.serverlist; + +public enum UnsafeServerAction { + WARN, BLOCK +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/teammates/CBTeammate.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/teammates/CBTeammate.java new file mode 100644 index 0000000..f0cb9d5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/teammates/CBTeammate.java @@ -0,0 +1,32 @@ +package com.cheatbreaker.client.util.render.teammates; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.util.Vec3; + +import java.awt.Color; +import java.beans.ConstructorProperties; + +@AllArgsConstructor @Getter @Setter +public class CBTeammate { + private String uuid; + private boolean leader = false; + private Vec3 position; + private long lastUpdate; + private Color color; + private long lastMs; + + @ConstructorProperties({"uuid", "leader"}) + public CBTeammate(String uuid, boolean leader) { + this.uuid = uuid; + this.leader = leader; + this.lastUpdate = System.currentTimeMillis(); + } + + public void updateTeammate(double xPos, double yPos, double zPos, long lastMs) { + this.position = new Vec3(xPos, yPos, zPos); + this.lastUpdate = System.currentTimeMillis(); + this.lastMs = lastMs; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/CBTitle.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/CBTitle.java new file mode 100644 index 0000000..4ed4121 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/CBTitle.java @@ -0,0 +1,76 @@ +package com.cheatbreaker.client.util.render.title; + +public class CBTitle { + private final TitleType titletype; + private final String message; + private final float scale; + private final long displayTimeMs; + private final long fadeInTimeMs; + private final long fadeOutTimeMs; + protected final long currentTimeMillis = System.currentTimeMillis(); + + public CBTitle(String message, TitleType titleType, float scale, long displayTimeMs, long fadeInTimeMs, long fadeOutTimeMs) { + this.message = message; + this.scale = scale; + this.titletype = titleType; + this.displayTimeMs = displayTimeMs == 0L ? 5000L : displayTimeMs; + this.fadeInTimeMs = fadeInTimeMs; + this.fadeOutTimeMs = fadeOutTimeMs; + } + + public boolean isFading() { + return System.currentTimeMillis() < this.currentTimeMillis + this.fadeInTimeMs; + } + + public boolean shouldDisplay() { + return System.currentTimeMillis() > this.currentTimeMillis + this.displayTimeMs - this.fadeOutTimeMs; + } + + public TitleType getTitleType() { + return this.titletype; + } + + public String getMessage() { + return this.message; + } + + public float getScale() { + return this.scale; + } + + public long getDisplayTimeMs() { + return this.displayTimeMs; + } + + public long getFadeInTimeMs() { + return this.fadeInTimeMs; + } + + public long getFadeOutTimeMs() { + return this.fadeOutTimeMs; + } + + static TitleType getCBTitleType(CBTitle title) { + return title.titletype; + } + + static float getTitleScale(CBTitle title) { + return title.scale; + } + + static long getFadeInTimeMS(CBTitle title) { + return title.fadeInTimeMs; + } + + static long getDisplayTimeMs(CBTitle title) { + return title.displayTimeMs; + } + + static long getFadeOutTimeMs(CBTitle title) { + return title.fadeOutTimeMs; + } + + static String getTitleMessage(CBTitle title) { + return title.message; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/TitleManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/TitleManager.java new file mode 100644 index 0000000..2bab981 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/TitleManager.java @@ -0,0 +1,55 @@ +package com.cheatbreaker.client.util.render.title; + +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.google.common.collect.Lists; +import java.awt.Color; +import java.util.List; + +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +public class TitleManager { + private final Minecraft mc = Minecraft.getMinecraft(); + private final List titles = Lists.newArrayList(); + + public void onGuiDrawEvent(GuiDrawEvent event) { + if (this.titles.size() == 0) return; + + GL11.glEnable(3042); + for (CBTitle title : this.titles) { + boolean isSubTitle = CBTitle.getCBTitleType(title) == TitleType.SUBTITLE; + float height = isSubTitle ? (float)4 : 1.5f; + float width = isSubTitle ? (float)-30 : (float)10; + GL11.glScalef(height *= CBTitle.getTitleScale(title), height, height); + float f3 = 255; + if (title.isFading()) { + long titleTime = CBTitle.getFadeInTimeMS(title) - (System.currentTimeMillis() - title.currentTimeMillis); + f3 = 1.0f - titleTime / (float)CBTitle.getFadeInTimeMS(title); + } else if (title.shouldDisplay()) { + long titleTime = CBTitle.getDisplayTimeMs(title) - (System.currentTimeMillis() - title.currentTimeMillis); + f3 = titleTime <= 0.0f ? 0.0f : titleTime / (float)CBTitle.getFadeOutTimeMs(title); + } + f3 = Math.min(1.0f, Math.max(0.0f, f3)); + if ((double)f3 <= 0.15) { + f3 = 0.15f; + } + this.mc.fontRenderer.drawCenteredStringWithShadow(CBTitle.getTitleMessage(title), + (int)((float)(event.getScaledResolution().getScaledWidth() / 2) / height), + (int)(((float)(event.getScaledResolution().getScaledHeight() / 2 - this.mc.fontRenderer.FONT_HEIGHT / 2) + width) / height), + new Color(1.0f, 1.0f, 1.0f, f3).getRGB()); + GL11.glScalef(1.0f / height, 1.0f / height, 1.0f / height); + } + GL11.glDisable(3042); + } + + public void onTickEvent(TickEvent event) { + if (!this.titles.isEmpty()) { + this.titles.removeIf(cBTitle -> cBTitle.currentTimeMillis + CBTitle.getDisplayTimeMs(cBTitle) < System.currentTimeMillis()); + } + } + + public List getTitles() { + return this.titles; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/TitleType.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/TitleType.java new file mode 100644 index 0000000..5f404cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/title/TitleType.java @@ -0,0 +1,6 @@ +package com.cheatbreaker.client.util.render.title; + +public enum TitleType { + TITLE, + SUBTITLE +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/CharSequenceConcatRightTrim.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/CharSequenceConcatRightTrim.java new file mode 100644 index 0000000..4173ac7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/CharSequenceConcatRightTrim.java @@ -0,0 +1,78 @@ +package com.cheatbreaker.client.util.render.wordwrap; + +final class CharSequenceConcatRightTrim implements CharSequence { + + private final CharSequence a; + private final CharSequence b; + + CharSequenceConcatRightTrim(CharSequence a, CharSequence b) { + this.a = a; + this.b = b; + } + + @Override + public int length() { + int i = a.length() + b.length() - 1; + while (i > 0 && Character.isWhitespace(charAt(i))) { + i--; + } + return i + 1; + } + + @Override + public char charAt(int index) { + if (index < a.length()) { + return a.charAt(index); + } else { + return b.charAt(index - a.length()); + } + } + + @Override + public CharSequence subSequence(int start, int end) { + return new CharSequence() { + + @Override + public int length() { + return end - start; + } + + @Override + public char charAt(int index) { + return CharSequenceConcatRightTrim.this.charAt(start + index); + } + + @Override + public CharSequence subSequence(int start2, int end2) { + // only support one level of substring + StringBuilder s = new StringBuilder(end2 - start2); + for (int i = start2; i < end2; i++) { + s.append(charAt(i)); + } + return s; + } + + @Override + public String toString() { + StringBuilder s = new StringBuilder(); + int len = length(); + for (int i = 0; i < len; i++) { + s.append(charAt(i)); + } + return s.toString(); + } + + }; + } + + @Override + public String toString() { + StringBuilder s = new StringBuilder(); + int len = length(); + for (int i = 0; i < len; i++) { + s.append(charAt(i)); + } + return s.toString(); + } + +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/LineConsumer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/LineConsumer.java new file mode 100644 index 0000000..0addd7d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/LineConsumer.java @@ -0,0 +1,15 @@ +package com.cheatbreaker.client.util.render.wordwrap; + +import java.io.IOException; + +public interface LineConsumer { + + void write(char[] chars, int offset, int length) throws IOException; + + void writeNewLine() throws IOException; + + default void write(String s) throws IOException { + char[] chars = s.toCharArray(); + write(chars, 0, chars.length); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/StringWrapHelper.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/StringWrapHelper.java new file mode 100644 index 0000000..09f6289 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/StringWrapHelper.java @@ -0,0 +1,105 @@ +package com.cheatbreaker.client.util.render.wordwrap; + +import java.util.Arrays; + +final class StringWrapHelper implements CharSequence { + + private char[] chars; + private int length; + + StringWrapHelper(String s) { + this(s.toCharArray(), s.length()); + } + + StringWrapHelper() { + this(new char[16], 0); + } + + private StringWrapHelper(char[] chars, int length) { + this.chars = chars; + this.length = length; + } + + char[] internalArray() { + return chars; + } + + @Override + public int length() { + return length; + } + + @Override + public char charAt(int index) { + return chars[index]; + } + + @Override + public CharSequence subSequence(int start, int end) { + char[] chars2 = new char[end - start]; + System.arraycopy(chars, start, chars2, 0, end - start); + return new StringWrapHelper(chars2, chars2.length); + } + + public void append(StringWrapHelper s) { + int len = s.length(); + checkSize(len); + System.arraycopy(s.chars, 0, chars, length, len); + length += len; + } + + private void checkSize(int len) { + if (length + len > chars.length) { + chars = Arrays.copyOf(chars, newSize(len)); + } + } + + private int newSize(int len) { + int newSize = chars.length * 2; + if (newSize < length + len) { + newSize = length + len; + } + return newSize; + } + + public void setLength(int length) { + this.length = length; + } + + public void append(char ch) { + checkSize(1); + chars[length] = ch; + length++; + } + + public void delete(int start, int end) { + System.arraycopy(chars, end, chars, start, length - end); + length -= end - start; + } + + public String substring(int start, int end) { + return new String(chars, start, end - start); + } + + @Override + public String toString() { + return new String(chars, 0, length); + } + + /** + * Trims right space from this and returns {@code this}. + * + * @return this + */ + StringWrapHelper rightTrim() { + int i = length(); + while (i > 0) { + if (!Character.isWhitespace(charAt(i - 1))) { + break; + } + i--; + } + length = i; + return this; + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/WordWrap.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/WordWrap.java new file mode 100644 index 0000000..5299b1f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/wordwrap/WordWrap.java @@ -0,0 +1,621 @@ +package com.cheatbreaker.client.util.render.wordwrap; + + +import com.google.common.base.Preconditions; +import org.apache.commons.io.input.CharSequenceReader; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.StringWriter; +import java.io.Writer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Function; + + +public final class WordWrap { + + private WordWrap() { + // prevent instantiation + } + + private static final String SPECIAL_WORD_CHARS = "\"'\u2018\u2019\u201C\u201D?./!,;:_"; + + public static final Set SPECIAL_WORD_CHARS_SET_DEFAULT = toSet(SPECIAL_WORD_CHARS); + + private static final Function STRING_WIDTH_DEFAULT = s -> s.length(); + + private static final String PUNCTUATION = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; + + /** + * Sets the source to be wrapped and returns a builder to specify more + * parameters. + * + * @param reader source to be wrapped + * @return builder + */ + public static Builder from(Reader reader) { + return from(reader, false); + } + + /** + * Sets the source to be wrapped as a classpath resource which will be read + * using the UTF-8 character set. Returns a builder to specify more parameters. + * Uses an 8192 byte buffer for reading. + * + * @param resource source to be wrapped as a classpath resource + * @return builder + */ + public static Builder fromClasspathUtf8(String resource) { + return fromClasspath(resource, StandardCharsets.UTF_8); + } + + /** + * Sets the source to be wrapped as a classpath resource to be read using the + * given character set. Returns a builder to specify more parameters. Uses an + * 8192 byte buffer for reading. + * + * @param resource classpath resource name + * @param charset charset to use for reading + * @return builder + */ + public static Builder fromClasspath(String resource, Charset charset) { + return new Builder(new BufferedReader( + new InputStreamReader(WordWrap.class.getResourceAsStream(resource), charset)), + true); + } + + /** + * Sets the the source to be wrapped and returns a builder to specify more + * parameters. Uses an 8192 byte buffer for reading. + * + * @param text text to be wrapped + * @return builder + */ + public static Builder from(CharSequence text) { + return from(new BufferedReader(new CharSequenceReader(text)), true); + } + + /** + * Sets the source to be wrapped. Returns a builder to specify more parameters. + * Uses an 8192 byte buffer for reading.s + * + * @param in source to be wrapped + * @return builder + */ + public static Builder fromUtf8(InputStream in) { + return from(in, StandardCharsets.UTF_8); + } + + /** + * Sets the source to be wrapped and the character set to be used to read it. + * Uses an 8192 byte buffer for reading. Returns a builder to specify more + * parameters. + * + * @param in source to be wrapped + * @param charset encoding + * @return builder + */ + public static Builder from(InputStream in, Charset charset) { + return from(new BufferedReader(new InputStreamReader(in, charset))); + } + + /** + * Sets the source to be wrapped and the character set to be used to read it. + * Uses an 8192 byte buffer for reading. Returns a builder to specify more + * parameters. + * + * @param file file to be read + * @param charset charset of the text in the source file + * @return builder + */ + public static Builder from(File file, Charset charset) { + try { + return from( + new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)), + true); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } + } + + private static Builder from(Reader reader, boolean close) { + return new Builder(reader, close); + } + + /** + * Provides method chaining for specifying parameters to word wrap. + */ + public static final class Builder { + + private final Reader reader; + private final boolean closeReader; + private Number maxWidth = 80; + private Function stringWidth = STRING_WIDTH_DEFAULT; + private Set extraWordChars = SPECIAL_WORD_CHARS_SET_DEFAULT; + private String newLine = "\n"; + private boolean insertHyphens = true; + private boolean breakWords = true; + + Builder(Reader reader, boolean closeReader) { + this.reader = reader; + this.closeReader = closeReader; + } + + /** + * Sets the maximum width of a line using the {@code stringWidth} function. Word + * wrapping/splitting will be attempted for lines with greater than + * {@code maxWidth}. If not set the default is 80. + * + * @param maxWidth maximum width of a line using the {@code stringWidth} + * function. + * @return this + * @throws IllegalArgumentException if {@code maxWidth} is less than or equal to + * zero + */ + public Builder maxWidth(Number maxWidth) { + Preconditions.checkArgument(maxWidth.doubleValue() > 0); + this.maxWidth = maxWidth; + return this; + } + + /** + * Sets the string width function used to determine if a line is at maximum + * width (and therefore needing wrapping or splitting). If not set the string + * width function is the number of characters. + * + * @param stringWidth function that returns the width of a sequence of + * characters + * @return this + */ + public Builder stringWidth(Function stringWidth) { + this.stringWidth = stringWidth; + return this; + } + + /** + * Sets the newLine string to be used. If not set the default is '\n' (line feed + * character). + * + * @param newLine string to be output on for a new line delimiter + * @return this + */ + public Builder newLine(String newLine) { + this.newLine = newLine; + return this; + } + + /** + * Sets all extra word characters (characters that will be treated like normal + * alphabetic characters for defining word boundaries). + * + * @param extraWordChars extra word characters (in addtion to alphabetic + * characters) + * @return this + */ + public Builder extraWordChars(Set extraWordChars) { + this.extraWordChars = extraWordChars; + return this; + } + + /** + * Sets all extra word characters (characters that will be treated like normal + * alphabetic characters for defining word boundaries). + * + * @param extraWordChars extra word characters (in addtion to alphabetic + * characters) + * @return this + */ + public Builder extraWordChars(String extraWordChars) { + return extraWordChars(toSet(extraWordChars)); + } + + /** + * Adds more word characters (characters that will be treated like normal + * alphabetic characters for defining word boundaries). + * + * @param includeWordChars more word characters + * @return this + */ + public Builder includeExtraWordChars(String includeWordChars) { + Set set = toSet(includeWordChars); + this.extraWordChars.addAll(set); + return this; + } + + /** + * Adds extra word characters to be excluded. Alphabetic characters are always + * word characters and thus will be ignored here. + * + * @param excludeWordChars extra word characters to be excluded + * @return this + */ + public Builder excludeExtraWordChars(String excludeWordChars) { + Set set = toSet(excludeWordChars); + this.extraWordChars.removeAll(set); + return this; + } + + /** + * Sets if to break words using a hyphen character. If set to false then no + * breaking character will be used. + * + * @param insertHyphens whether to break hyphens + * @return this + */ + public Builder insertHyphens(boolean insertHyphens) { + this.insertHyphens = insertHyphens; + return this; + } + + /** + * If a word is longer than {@code maxWidth} and {@code breakWords} is true then + * such a word will be broken across two or more lines (with or without a hyphen + * according to {@link Builder#insertHyphens(boolean)}). + * + * @param breakWords if true then break words across lines + * @return this + */ + public Builder breakWords(boolean breakWords) { + this.breakWords = breakWords; + return this; + } + + /** + * Performs the wrapping of the source text and writes output to the given + * {@link Writer}. + * + * @param out output for wrapped text + */ + public void wrap(Writer out) { + try { + wordWrap(reader, out, newLine, maxWidth, stringWidth, extraWordChars, insertHyphens, + breakWords); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (closeReader) { + close(reader); + } + } + } + + public List wrapToList() { + List lines = new ArrayList<>(); + StringBuilder b = new StringBuilder(); + boolean[] building = new boolean[1]; + wrap(new LineConsumer() { + + @Override + public void write(char[] chars, int offset, int length) throws IOException { + building[0] = true; + b.append(chars, offset, length); + } + + @Override + public void writeNewLine() throws IOException { + lines.add(b.toString()); + b.setLength(0); + building[0] = false; + } + }); + if (building[0]) { + lines.add(b.toString()); + } + return lines; + } + + public void wrap(LineConsumer consumer) { + try { + wordWrap(reader, consumer, maxWidth, stringWidth, extraWordChars, insertHyphens, + breakWords); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (closeReader) { + close(reader); + } + } + } + + /** + * Performs the wrapping of the source text and writes output to the given file + * with the given character set encoding. + * + * @param file file to receive wrapped output + * @param charset encoding to use for output + */ + public void wrap(File file, Charset charset) { + try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), charset)) { + wrap(writer); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Performs the wrapping of the source text and writes the output to the given + * file using UTF-8 encoding. + * + * @param file output file for wrapped text + */ + public void wrapUtf8(File file) { + wrap(file, StandardCharsets.UTF_8); + } + + /** + * Performs the wrapping of the source text and writes the output to a file with + * the given filename. + * + * @param filename output file for wrapped text + */ + public void wrapUtf8(String filename) { + wrapUtf8(new File(filename)); + } + + /** + * Performs the wrapping of the source text and writes the output to a file with + * the given filename using the given encoding. + * + * @param filename output file for the wrapped text + * @param charset encoding to use for output + */ + public void wrap(String filename, Charset charset) { + wrap(new File(filename), charset); + } + + /** + * Performs the wrapping of the source text and returns output as a String. + * + * @return wrapped text + */ + public String wrap() { + try (StringWriter out = new StringWriter()) { + wrap(out); + return out.toString(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + + static void close(Reader reader) { + try { + reader.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static Set toSet(String chars) { + Set set = new HashSet(); + for (int i = 0; i < chars.length(); i++) { + set.add(chars.charAt(i)); + } + return set; + } + + static void wordWrap(Reader in, Writer out, String newLine, Number maxWidth, + Function stringWidth, + Set extraWordChars, boolean insertHyphens, boolean breakWords) + throws IOException { + LineConsumer consumer = new LineConsumer() { + + @Override + public void write(String s) throws IOException { + out.write(s); + } + + @Override + public void write(char[] chars, int start, int length) throws IOException { + out.write(chars, start, length); + } + + @Override + public void writeNewLine() throws IOException { + out.write(newLine); + } + + }; + wordWrap(in, consumer, maxWidth, stringWidth, extraWordChars, insertHyphens, breakWords); + } + + static void wordWrap(Reader in, LineConsumer out, Number maxWidth, + Function stringWidth, + Set extraWordChars, boolean insertHyphens, boolean breakWords) + throws IOException { + StringWrapHelper line = new StringWrapHelper(); + StringWrapHelper word = new StringWrapHelper(); + CharSequence lineAndWordRightTrim = concatRightTrim(line, word); + double maxWidthDouble = maxWidth.doubleValue(); + boolean broken = false; + boolean isWordCharacter = false; + boolean previousWasPunctuation = false; + while (true) { + int c = in.read(); + if (c == -1) { + break; + } + char ch = (char) c; + isWordCharacter = Character.isLetter(ch) || extraWordChars.contains(ch); + if (ch == '\n') { + line.append(word); + if (tooLong(stringWidth, line, maxWidthDouble)) { + line.rightTrim(); + } + if (!isWhitespace(line)) { + out.write(line.internalArray(), 0, line.length()); + } + out.writeNewLine(); + word.setLength(0); + line.setLength(0); + broken = false; + } else if (ch == '\r') { + // ignore carriage return + } else if (isWordCharacter && !previousWasPunctuation) { + word.append(ch); + if (broken && line.length() == 0) { + leftTrim(word); + } + if (tooLong(stringWidth, lineAndWordRightTrim, maxWidthDouble)) { + if (line.length() > 0) { + writeLine(out, line); + leftTrim(word); + if (tooLong(stringWidth, word, maxWidthDouble)) { + if (breakWords) { + writeBrokenWord(out, word, insertHyphens); + } else { + broken = true; + } + } else { + broken = true; + } + } else { + if (breakWords) { + writeBrokenWord(out, word, insertHyphens); + } else { + broken = true; + } + } + } + } else { + if (word.length() > 0 && !isWhitespace(word)) { + appendWordToLine(line, word); + if (broken) { + leftTrim(line); + } + } + word.append(ch); + if (tooLong(stringWidth, lineAndWordRightTrim, maxWidthDouble)) { + Preconditions.checkArgument(line.length() > 0, + "line length was zero. If this happens please" // + + " contribute unit test that provokes this failure to the project!"); + if (!isWhitespace(line)) { + writeLine(out, line); + } else { + line.setLength(0); + } + broken = true; + } + } + previousWasPunctuation = isPunctuation(ch) && !extraWordChars.contains(ch); + } + if (line.length() > 0) { + String s = line.toString() + word; + if (broken) { + s = leftTrim(s); + } + out.write(s); + } else { + if (broken) { + leftTrim(word); + } + if (!isWhitespace(word)) { + out.write(word.internalArray(), 0, word.length()); + } + } + } + + private static CharSequence concatRightTrim(CharSequence a, CharSequence b) { + return new CharSequenceConcatRightTrim(a, b); + } + + private static boolean isPunctuation(char ch) { + return PUNCTUATION.indexOf(ch) != -1; + } + + private static boolean tooLong(Function stringWidth, + CharSequence s, double maxWidthDouble) { + return stringWidth.apply(s).doubleValue() > maxWidthDouble; + } + + static CharSequence rightTrim(CharSequence s) { + int i = s.length(); + while (i > 0) { + if (Character.isWhitespace(s.charAt(i - 1))) { + i--; + } else { + break; + } + } + if (i != s.length()) { + return s.subSequence(0, i); + } else { + return s; + } + } + + static boolean isWhitespace(CharSequence s) { + for (int i = 0; i < s.length(); i++) { + if (!Character.isWhitespace(s.charAt(i))) { + return false; + } + } + return true; + } + + static void leftTrim(StringWrapHelper word) { + // trim leading spaces on the word + // because we have inserted a new line + int i; + for (i = 0; i < word.length(); i++) { + if (!Character.isWhitespace(word.charAt(i))) { + break; + } + } + if (i < word.length() && i > 0) { + word.delete(0, i); + } + } + + private static String leftTrim(String s) { + StringWrapHelper b = new StringWrapHelper(s); + leftTrim(b); + return b.toString(); + } + + private static void appendWordToLine(StringWrapHelper line, StringWrapHelper word) { + line.append(word); + word.setLength(0); + } + + private static void writeBrokenWord(LineConsumer out, StringWrapHelper word, boolean insertHyphens) throws IOException { + // to be really thorough we'd check the new stringWidth with '-' but let's not + // bother for now + String x; + if (insertHyphens && word.length() > 2 + && !isWhitespace((x = word.substring(0, word.length() - 2)))) { + out.write(x); + out.write("-"); + out.writeNewLine(); + word.delete(0, word.length() - 2); + } else { + String prefix = word.substring(0, word.length() - 1); + if (!isWhitespace(prefix)) { + out.write(prefix); + } + out.writeNewLine(); + word.delete(0, word.length() - 1); + } + } + + private static void writeLine(LineConsumer out, StringWrapHelper line) + throws IOException { + out.write(line.internalArray(), 0, line.length()); + out.writeNewLine(); + line.setLength(0); + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorder.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorder.java new file mode 100644 index 0000000..7d8c635 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorder.java @@ -0,0 +1,189 @@ +package com.cheatbreaker.client.util.render.worldborder; + +import com.cheatbreaker.client.CheatBreaker; +import com.sun.javafx.geom.Vec2d; +import net.minecraft.entity.Entity; + +import java.awt.Color; + +public class WorldBorder { + private final String id; + private final String world; + private final Color color; + private Vec2d currentMin; + private Vec2d currentMax; + private Vec2d lastMin; + private Vec2d lastMax; + private Vec2d newMin; + private Vec2d newMax; + private final boolean canShrinkExpand; + private final boolean cancelExit; + private int moveTicks; + private int durationTicks; + final WorldBorderManager manager; + + WorldBorder(WorldBorderManager manager, String id, String world, int color, double minX, double minZ, + double maxX, double maxZ, boolean canShrinkExpand, boolean cancelExit) { + this.manager = manager; + this.id = id; + this.world = world; + this.color = new Color(color, true); + this.canShrinkExpand = canShrinkExpand; + this.cancelExit = cancelExit; + this.lastMin = this.currentMin = new Vec2d(minX, minZ); + this.lastMax = this.currentMax = new Vec2d(maxX, maxZ); + } + + boolean shouldMove() { + return this.canShrinkExpand && this.durationTicks != 0 && this.moveTicks < this.durationTicks; + } + + + void tick() { + if (this.shouldMove()) { + double d = this.currentMin.x - this.newMin.x; + double d2 = this.currentMax.x - this.newMax.x; + double d3 = this.currentMin.y - this.newMin.y; + double d4 = this.currentMax.y - this.newMax.y; + double d5 = (float)this.moveTicks / (float)this.durationTicks; + double d6 = this.currentMin.x - d * d5; + double d7 = this.currentMax.x - d2 * d5; + double d8 = this.currentMin.y - d3 * d5; + double d9 = this.currentMax.y - d4 * d5; + this.lastMin = new Vec2d(d6, d8); + this.lastMax = new Vec2d(d7, d9); + ++this.moveTicks; + } else if (this.currentMax != this.lastMax || this.currentMin != this.lastMin) { + this.currentMin = this.lastMin; + this.currentMax = this.lastMax; + this.lastMax = this.newMax; + this.lastMin = this.newMin; + this.durationTicks = 0; + this.moveTicks = 0; + } + } + + boolean worldEqualsWorld() { + return CheatBreaker.getInstance().getCbNetHandler().getWorldUID().equals(this.world); + } + + double getStartingMaxX() { + return this.lastMax.x; + } + + double getStartingMaxZ() { + return this.lastMax.y; + } + + double getStartingMinX() { + return this.lastMin.x; + } + + double getStartingMinZ() { + return this.lastMin.y; + } + + double getClosestDistance(Entity entity) { + return this.getClosestDistance(entity.posX, entity.posZ); + } + + double getClosestDistance(double x, double z) { + double d3 = z - this.getStartingMinZ(); + double d4 = this.getStartingMaxZ() - z; + double d5 = x - this.getStartingMinX(); + double d6 = this.getStartingMaxX() - x; + double d7 = Math.min(d5, d6); + d7 = Math.min(d7, d3); + return Math.min(d7, d4); + } + boolean doesCollide(double d, double d2) { + return !this.cancelExit || + !this.world.equals(WorldBorderManager.getCheatBreaker(this.manager).getCbNetHandler().getWorldUID()) || + d + 1.0 > this.getStartingMinX() && d < this.getStartingMaxX() && d2 + 1.0 > this.getStartingMinZ() && d2 < this.getStartingMaxZ(); + } + + + public String getId() { + return this.id; + } + + public String getWorld() { + return this.world; + } + + public Color getColor() { + return this.color; + } + + public Vec2d getCurrentMin() { + return this.currentMin; + } + + public Vec2d getCurrentMax() { + return this.currentMax; + } + + public Vec2d getStartingMin() { + return this.lastMin; + } + + public Vec2d getStartingMax() { + return this.lastMax; + } + + public Vec2d getNewMin() { + return this.newMin; + } + + public Vec2d getNewMax() { + return this.newMax; + } + + public boolean canShrinkExpand() { + return this.canShrinkExpand; + } + + public boolean doesCancelExit() { + return this.cancelExit; + } + + public int getMoveTicks() { + return this.moveTicks; + } + + public int getDurationTicks() { + return this.durationTicks; + } + + static String getId(WorldBorder worldBorder) { + return worldBorder.id; + } + + static Vec2d setNewMin(WorldBorder worldBorder, Vec2d vec2d) { + worldBorder.newMin = vec2d; + return worldBorder.newMin; + } + + static Vec2d setNewMax(WorldBorder worldBorder, Vec2d vec2d) { + worldBorder.newMax = vec2d; + return worldBorder.newMax; + } + + static int setMoveTicks(WorldBorder worldBorder, int n) { + worldBorder.moveTicks = n; + return worldBorder.moveTicks; + } + + static int setDurationTicks(WorldBorder worldBorder, int durationTicks) { + worldBorder.durationTicks = durationTicks; + return worldBorder.durationTicks; + } + + static boolean canShrinkExpand(WorldBorder worldBorder) { + return worldBorder.canShrinkExpand; + } + + static Color getColor(WorldBorder worldBorder) { + return worldBorder.color; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorderManager.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorderManager.java new file mode 100644 index 0000000..7eaa113 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/render/worldborder/WorldBorderManager.java @@ -0,0 +1,185 @@ +package com.cheatbreaker.client.util.render.worldborder; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.CollisionEvent; +import com.cheatbreaker.client.event.impl.RenderWorldEvent; +import com.cheatbreaker.client.event.impl.TickEvent; +import com.sun.javafx.geom.Vec2d; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class WorldBorderManager { + private final Minecraft mc = Minecraft.getMinecraft(); + private final CheatBreaker cb = CheatBreaker.getInstance(); + private static final ResourceLocation forceFieldTexture = new ResourceLocation("textures/misc/forcefield.png"); + private final List borderList = new ArrayList<>(); + + public WorldBorderManager() { + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + CheatBreaker.getInstance().getEventBus().addEvent(RenderWorldEvent.class, this::onWorldRender); + CheatBreaker.getInstance().getEventBus().addEvent(CollisionEvent.class, this::onCollision); + } + + private void onCollision(CollisionEvent event) { + for (WorldBorder worldBorder : this.borderList) { + if (worldBorder.doesCollide(event.getX(), event.getZ())) continue; + event.getBoxes().add(new AxisAlignedBB(event.getX(), event.getY(), event.getZ(), event.getX() + 1.0, event.getY() + 1.0, event.getZ() + 1.0)); + } + } + + private void onTick(TickEvent tickEvent) { + this.borderList.forEach(WorldBorder::tick); + } + + private void onWorldRender(RenderWorldEvent event) { + if (!this.borderList.isEmpty()) { + EntityClientPlayerMP entityClientPlayerMP = this.mc.thePlayer; + float f = event.getPartialTicks(); + this.borderList.stream().filter(WorldBorder::worldEqualsWorld).forEach(worldBorder -> { + Tessellator tessellator = Tessellator.instance; + double d = this.mc.gameSettings.renderDistanceChunks * 16; + if (entityClientPlayerMP.posX >= worldBorder.getStartingMaxX() - d || + entityClientPlayerMP.posX <= worldBorder.getStartingMinX() + d || + entityClientPlayerMP.posZ >= worldBorder.getStartingMaxZ() - d || + entityClientPlayerMP.posZ <= worldBorder.getStartingMinZ() + d) { + float f2; + double d2; + double d3; + float f3; + double d4 = 1.0 - worldBorder.getClosestDistance(entityClientPlayerMP) / d; + d4 = Math.pow(d4, 4); + double d5 = entityClientPlayerMP.lastTickPosX + (entityClientPlayerMP.posX - entityClientPlayerMP.lastTickPosX) * (double)f; + double d6 = entityClientPlayerMP.lastTickPosY + (entityClientPlayerMP.posY - entityClientPlayerMP.lastTickPosY) * (double)f; + double d7 = entityClientPlayerMP.lastTickPosZ + (entityClientPlayerMP.posZ - entityClientPlayerMP.lastTickPosZ) * (double)f; + GL11.glEnable(3042); + GL11.glBlendFunc(770, 1); + this.mc.renderEngine.bindTexture(forceFieldTexture); + GL11.glDepthMask(false); + GL11.glPushMatrix(); + boolean bl = true; + float f4 = (float)(WorldBorder.getColor(worldBorder).getRed() & 0xFF) / (float)255; + float f5 = (float)(WorldBorder.getColor(worldBorder).getGreen() & 0xFF) / (float)255; + float f6 = (float)(WorldBorder.getColor(worldBorder).getBlue() & 0xFF) / (float)255; + GL11.glPolygonOffset(-3, -3); + GL11.glEnable(32823); + GL11.glAlphaFunc(516, 0.097260274f * 1.028169f); + GL11.glEnable(3008); + GL11.glDisable(2884); + float f7 = (float)(Minecraft.getSystemTime() % 3000L) / (float)3000; + tessellator.startDrawingQuads(); + GL11.glTranslated(-d5, -d6, -d7); + tessellator.setColorRGBA_F(f4, f5, f6, 1.0f); + double d8 = Math.max(MathHelper.floor_double(d7 - d), worldBorder.getStartingMinZ()); + double d9 = Math.min(MathHelper.ceiling_double_int(d7 + d), worldBorder.getStartingMaxZ()); + if (d5 > worldBorder.getStartingMaxX() - d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float)d2 * (0.04054054f * 12.333334f); + tessellator.addVertexWithUV(worldBorder.getStartingMaxX(), 256, d3, f7 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(worldBorder.getStartingMaxX(), 256, d3 + d2, f7 + f2 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(worldBorder.getStartingMaxX(), 0.0, d3 + d2, f7 + f2 + f3, f7 + (float)128); + tessellator.addVertexWithUV(worldBorder.getStartingMaxX(), 0.0, d3, f7 + f3, f7 + (float)128); + d3 += 1.0; + f3 += 0.16463414f * 3.0370371f; + } + } + if (d5 < worldBorder.getStartingMinX() + d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float)d2 * (0.3611111f * 1.3846154f); + tessellator.addVertexWithUV(worldBorder.getStartingMinX(), 256, d3, f7 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(worldBorder.getStartingMinX(), 256, d3 + d2, f7 + f2 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(worldBorder.getStartingMinX(), 0.0, d3 + d2, f7 + f2 + f3, f7 + (float)128); + tessellator.addVertexWithUV(worldBorder.getStartingMinX(), 0.0, d3, f7 + f3, f7 + (float)128); + d3 += 1.0; + f3 += 1.25f * 0.4f; + } + } + d8 = Math.max(MathHelper.floor_double(d5 - d), worldBorder.getStartingMinX()); + d9 = Math.min(MathHelper.ceiling_double_int(d5 + d), worldBorder.getStartingMaxX()); + if (d7 > worldBorder.getStartingMaxZ() - d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float)d2 * (0.3115942f * 1.6046512f); + tessellator.addVertexWithUV(d3, 256, worldBorder.getStartingMaxZ(), f7 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(d3 + d2, 256, worldBorder.getStartingMaxZ(), f7 + f2 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(d3 + d2, 0.0, worldBorder.getStartingMaxZ(), f7 + f2 + f3, f7 + (float)128); + tessellator.addVertexWithUV(d3, 0.0, worldBorder.getStartingMaxZ(), f7 + f3, f7 + (float)128); + d3 += 1.0; + f3 += 1.5882353f * 0.31481484f; + } + } + if (d7 < worldBorder.getStartingMinZ() + d) { + f3 = 0.0f; + d3 = d8; + while (d3 < d9) { + d2 = Math.min(1.0, d9 - d3); + f2 = (float)d2 * (1.6071428f * 0.31111112f); + tessellator.addVertexWithUV(d3, 256, worldBorder.getStartingMinZ(), f7 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(d3 + d2, 256, worldBorder.getStartingMinZ(), f7 + f2 + f3, f7 + 0.0f); + tessellator.addVertexWithUV(d3 + d2, 0.0, worldBorder.getStartingMinZ(), f7 + f2 + f3, f7 + (float)128); + tessellator.addVertexWithUV(d3, 0.0, worldBorder.getStartingMinZ(), f7 + f3, f7 + (float)128); + d3 += 1.0; + f3 += 2.2820513f * 0.21910112f; + } + } + tessellator.draw(); + GL11.glTranslated(0.0, 0.0, 0.0); + GL11.glEnable(2884); + GL11.glDisable(3008); + GL11.glPolygonOffset(0.0f, 0.0f); + GL11.glDisable(32823); + GL11.glEnable(3008); + GL11.glDisable(3042); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + } + }); + } + } + + public void createBorder(String id, String world, int color, double minX, double minZ, double maxX, double maxZ, boolean canShrinkExpand, boolean cancelExit) { + this.borderList.add(new WorldBorder(this, id, world, color, minX, minZ, maxX, maxZ, canShrinkExpand, cancelExit)); + } + + public void updateBorder(String id, double minX, double minZ, double maxX, double maxZ, int durationTick) { + this.borderList.stream().filter(worldBorder -> Objects.equals(WorldBorder.getId(worldBorder), id) + && WorldBorder.canShrinkExpand(worldBorder)).findFirst().ifPresent(worldBorder -> { + WorldBorder.setNewMin(worldBorder, new Vec2d(minX, minZ)); + WorldBorder.setNewMax(worldBorder, new Vec2d(maxX, maxZ)); + WorldBorder.setMoveTicks(worldBorder, 0); + WorldBorder.setDurationTicks(worldBorder, durationTick); + }); + } + + public void removeBorder(String string) { + this.borderList.removeIf(worldBorder -> Objects.equals(WorldBorder.getId(worldBorder), string)); + } + + public void clearBorders() { + this.borderList.clear(); + } + + public List getBorders() { + return this.borderList; + } + + static CheatBreaker getCheatBreaker(WorldBorderManager worldBorderManager) { + return worldBorderManager.cb; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/sessionserver/SessionServer.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/sessionserver/SessionServer.java new file mode 100644 index 0000000..bcf5122 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/sessionserver/SessionServer.java @@ -0,0 +1,53 @@ +package com.cheatbreaker.client.util.sessionserver; + +public class SessionServer { + private final String name; + private final String url; + private StatusColor status = StatusColor.UNKNOWN; + + public SessionServer(String name, String url) { + this.name = name; + this.url = url; + } + + public StatusColor getStatus() { + return this.status; + } + + public void setStatus(StatusColor sessionServerStatusColor) { + this.status = sessionServerStatusColor; + } + + public String getName() { + return this.name; + } + + public String getURL() { + return this.url; + } + + public enum StatusColor { + UP("green"), + DOWN("red"), + BUSY("yellow"), + UNKNOWN("unknown"); + + private final String color; + + public String getIdentifier() { + return this.color; + } + + StatusColor(final String color) { + this.color = color; + } + + public static StatusColor getStatusByName(String string) { + for (StatusColor status : StatusColor.values()) { + if (!status.getIdentifier().equalsIgnoreCase(string)) continue; + return status; + } + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/AliasesThread.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/AliasesThread.java new file mode 100644 index 0000000..b6df97d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/AliasesThread.java @@ -0,0 +1,58 @@ +package com.cheatbreaker.client.util.thread; + +import com.cheatbreaker.client.ui.element.AliasesElement; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.util.EnumChatFormatting; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Collections; +import java.util.Map; + +public class AliasesThread extends Thread { + private final AliasesElement aliasesElement; + private final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); + + public AliasesThread(AliasesElement aliasesElement) { + this.aliasesElement = aliasesElement; + } + + @Override + public void run() { + try { + URL uRL = new URL("https://api.mojang.com/user/profiles/" + + this.aliasesElement.getFriend().getPlayerId().replaceAll("-", "") + "/names"); + URLConnection uRLConnection = uRL.openConnection(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream())); + String string = bufferedReader.readLine(); + JsonParser jsonParser = new JsonParser(); + JsonElement jsonElement = jsonParser.parse("{\"Names\": " + string + "}"); + for (Map.Entry entry : jsonElement.getAsJsonObject().entrySet()) { + if (!entry.getKey().equalsIgnoreCase("Names")) continue; + for (JsonElement jsonElement2 : entry.getValue().getAsJsonArray()) { + String string2 = jsonElement2.getAsJsonObject().get("name").getAsString(); + if (jsonElement2.getAsJsonObject().has("changedToAt")) { + long l = jsonElement2.getAsJsonObject().get("changedToAt").getAsLong(); + LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(l), ZoneId.systemDefault()); + this.aliasesElement.getAliases().add(EnumChatFormatting.GRAY + localDateTime.format(this.dateFormatter) + EnumChatFormatting.RESET + " " + string2); + continue; + } + this.aliasesElement.getAliases().add(string2); + } + } + Collections.reverse(this.aliasesElement.getAliases()); + this.aliasesElement.setElementSize(this.aliasesElement.getXPosition(), this.aliasesElement.getYPosition(), + this.aliasesElement.getWidth(), this.aliasesElement.getHeight() + + (float)(this.aliasesElement.getAliases().size() * 10) - (float)10); + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/CBAssestConnThread.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/CBAssestConnThread.java new file mode 100644 index 0000000..eb6c7a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/CBAssestConnThread.java @@ -0,0 +1,19 @@ +package com.cheatbreaker.client.util.thread; + +import com.cheatbreaker.client.CheatBreaker; + +import java.net.URISyntaxException; + +public class CBAssestConnThread extends Thread { + private final long reconnectTime = 25000L; + + @Override + public void run() { + try { + Thread.sleep(this.reconnectTime); + CheatBreaker.getInstance().connectToAssetServer(); + } catch (InterruptedException | URISyntaxException exception) { + exception.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/LoginThread.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/LoginThread.java new file mode 100644 index 0000000..be8e392 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/LoginThread.java @@ -0,0 +1,78 @@ +package com.cheatbreaker.client.util.thread; + + +import com.mojang.authlib.Agent; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; + +import java.net.Proxy; +import java.util.concurrent.CompletableFuture; + +@Getter +@Setter +public class LoginThread extends Thread { + + private String password; + private String username; + + private Minecraft mc; + public boolean loggedIn; + public boolean playSound = false; + + public LoginThread() { + this.mc = Minecraft.getMinecraft(); + loggedIn = false; + } + + public LoginThread(String username, String password) { + super("Alt Login Thread"); + this.mc = Minecraft.getMinecraft(); + this.username = username; + this.password = password; + loggedIn = false; + } + + public LoginThread(String alt) { + super("Alt Login Thread"); + this.mc = Minecraft.getMinecraft(); + this.username = alt.split(":")[0]; + this.password = alt.split(":")[1]; + loggedIn = false; + } + + + public Session createSession(String username, String password) { + YggdrasilAuthenticationService service = new YggdrasilAuthenticationService(Proxy.NO_PROXY, ""); + YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) service.createUserAuthentication(Agent.MINECRAFT); + auth.setUsername(username); + auth.setPassword(password); + try { + auth.logIn(); + loggedIn = true; + return new Session(auth.getSelectedProfile().getName(), auth.getSelectedProfile().getId().toString(), auth.getAuthenticatedToken(), "mojang"); + } catch (com.mojang.authlib.exceptions.AuthenticationException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void run() { + if (this.password == null || this.password.equals("")) { + this.mc.setSession(new Session(this.username, "", "", "mojang")); + loggedIn = true; + return; + } + Session auth = createSession(this.username, this.password); + if (auth == null) { + loggedIn = false; + } else { + this.mc.setSession(auth); + loggedIn = true; + } + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/ServerStatusThread.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/ServerStatusThread.java new file mode 100644 index 0000000..0dd3089 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/thread/ServerStatusThread.java @@ -0,0 +1,57 @@ +package com.cheatbreaker.client.util.thread; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.client.Minecraft; +import com.cheatbreaker.client.util.sessionserver.SessionServer; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Map; + +public class ServerStatusThread extends Thread { + @Override + public void run() { + try { + URL uRL = new URL(CheatBreaker.getInstance().getGlobalSettings().mojangStatusURL); + URLConnection uRLConnection = uRL.openConnection(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream())); + JsonParser jsonParser = new JsonParser(); + JsonElement jsonElement = jsonParser.parse(bufferedReader); + JsonArray jsonArray = jsonElement.getAsJsonArray(); + for (int i = 0; i < jsonArray.size(); ++i) { + JsonElement jsonElement2 = jsonArray.get(i); + for (Map.Entry entry : jsonElement2.getAsJsonObject().entrySet()) { + for (SessionServer sessionServer : CheatBreaker.getInstance().sessionServers) { + SessionServer.StatusColor sessionServerStatusColor; + if (!sessionServer.getURL().equalsIgnoreCase(entry.getKey()) || (sessionServerStatusColor = SessionServer.StatusColor.getStatusByName(entry.getValue().getAsString())) == null) continue; + if (sessionServerStatusColor != sessionServer.getStatus() && sessionServer.getStatus() != + SessionServer.StatusColor.UNKNOWN && sessionServer.getStatus() != SessionServer.StatusColor.BUSY && + (sessionServerStatusColor == SessionServer.StatusColor.DOWN || sessionServerStatusColor == SessionServer.StatusColor.UP)) { + + EnumChatFormatting enumChatFormatting = sessionServerStatusColor == SessionServer.StatusColor.UP ? EnumChatFormatting.GREEN : EnumChatFormatting.RED; + + String string = sessionServerStatusColor == SessionServer.StatusColor.UP ? "online" : "offline"; + if (Minecraft.getMinecraft().theWorld != null) { + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("info", "Minecraft " + + EnumChatFormatting.AQUA + sessionServer.getName() + + EnumChatFormatting.RESET + " server is now " + + enumChatFormatting + string + EnumChatFormatting.RESET + ".", 7500L); + } + } + sessionServer.setStatus(sessionServerStatusColor); + } + } + } + + bufferedReader.close(); + } catch (Exception exception) { + exception.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/ModuleVoiceChat.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/ModuleVoiceChat.java new file mode 100644 index 0000000..2bb2aaa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/ModuleVoiceChat.java @@ -0,0 +1,113 @@ +package com.cheatbreaker.client.util.voicechat; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.TickEvent; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import com.cheatbreaker.client.ui.util.RenderUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class ModuleVoiceChat { + Minecraft mc = Minecraft.getMinecraft(); + CheatBreaker cb = CheatBreaker.getInstance(); + private final ResourceLocation microphone = new ResourceLocation("client/icons/microphone-64.png"); + private final Map users = new HashMap(); + private boolean talking; + + public ModuleVoiceChat() { + CheatBreaker.getInstance().getEventBus().addEvent(GuiDrawEvent.class, this::onGuiDraw); + CheatBreaker.getInstance().getEventBus().addEvent(TickEvent.class, this::onTick); + } + + public void updateUser(UUID uUID) { + VoiceUser voiceUser = this.cb.getCbNetHandler().getVoiceUser(uUID); + if (voiceUser != null) { + this.users.put(voiceUser, System.currentTimeMillis() + 250L); + } + } + + public void onGuiDraw(GuiDrawEvent event) { + if (this.cb.getCbNetHandler().isVoiceChatEnabled() && this.cb.getCbNetHandler().getVoiceChannels() != null && (!this.users.isEmpty() || this.talking)) { + float spacing = 20; + float width = (float)event.getScaledResolution().getScaledWidth_double() - (float)120; + float[] height = new float[]{10}; + if (this.talking) { + this.renderHead(this.mc.thePlayer.getCommandSenderName(), + this.mc.getSession().getPlayerID(), width, height[0], true); + height[0] = height[0] + spacing; + } + this.users.forEach((voiceUser, l) -> { + this.renderHead(voiceUser.getPlayerName(), voiceUser.getPlayerUUID().toString(), width, height[0], false); + height[0] = height[0] + spacing; + }); + } + } + + private void renderHead(String name, String uuid, float width, float height, boolean self) { + if (self) { + RenderUtil.drawGradientRectWithOutline(width, height, width + (float)110, height + (float)18, -11493284, -10176146, -11164318); + } else { + RenderUtil.drawGradientRectWithOutline(width, height, width + (float)110, height + (float)18, -1356454362, -1355664846, -1356191190); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + ResourceLocation resourceLocation = CheatBreaker.getInstance().getHeadIcon(name, uuid); + RenderUtil.renderIcon(resourceLocation, 7.0F, width + 2.0f, height + 2.0f); + this.cb.playRegular16px.drawString(name, width + (float)22, height + (float)4, -1); + } + + public void onTick(TickEvent tickEvent) { + if (!this.users.isEmpty()) { + ArrayList arrayList = new ArrayList<>(); + for (Map.Entry entry : this.users.entrySet()) { + if (System.currentTimeMillis() - (Long)entry.getValue() < 0L) continue; + arrayList.add(entry.getKey()); + } + arrayList.forEach(voiceUser -> { + Long cfr_ignored_0 = (Long)this.users.remove(voiceUser); + }); + } + if (!this.cb.getCbNetHandler().isVoiceChatEnabled() && this.cb.getCbNetHandler().getVoiceChannels() != null) { + return; + } + /*if (this.talking && !this.mc.inGameHasFocus) { + this.talking = false; + try { + Message.e(false); + } catch (UnsatisfiedLinkError unsatisfiedLinkError) { + + } + CheatBreaker.getInstance().getAudioManager().playSound("voice_up"); + } + if (!this.talking && this.mc.inGameHasFocus && this.isButtonDown(this.cb.getGlobalSettings().keyBindVoicePushToTalk.getKeyCode())) { + this.talking = true; + try { + Message.e(true); + } catch (UnsatisfiedLinkError unsatisfiedLinkError) { + + } + CheatBreaker.getInstance().getAudioManager().playSound("voice_down"); + } else if (this.talking && this.mc.inGameHasFocus && + !this.isButtonDown(this.cb.getGlobalSettings().keyBindVoicePushToTalk.getKeyCode())) { + this.talking = false; + try { + Message.e(false); + } catch (UnsatisfiedLinkError unsatisfiedLinkError) { + + } + CheatBreaker.getInstance().getAudioManager().playSound("voice_up"); + }*/ + } + + private boolean isButtonDown(int n) { + return n != 0 && (n < 0 ? Mouse.isButtonDown(n + 100) : Keyboard.isKeyDown(n)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceChannel.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceChannel.java new file mode 100644 index 0000000..073a534 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceChannel.java @@ -0,0 +1,47 @@ +package com.cheatbreaker.client.util.voicechat; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.minecraft.util.EnumChatFormatting; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +@AllArgsConstructor @Getter +public class VoiceChannel { + private final UUID uuid; + private final String name; + private final List users = new ArrayList(); + private final List listeners = new ArrayList(); + + public VoiceUser createUser(UUID uuid, String name) { + VoiceUser user = new VoiceUser(uuid, EnumChatFormatting.getTextWithoutFormattingCodes(name)); + if (!this.isUser(uuid)) { + this.users.add(user); + } + return user; + } + + public boolean removeUser(UUID var1) { + return this.users.removeIf(var1x -> var1x.getPlayerUUID().equals(var1)); + } + + public void addListener(UUID uuid, String name) { + if (this.isUser(uuid)) { + this.listeners.add(uuid); + } + } + + public boolean removeListeners(UUID uuid) { + return this.listeners.removeIf(var1x -> var1x.equals(uuid)); + } + + public boolean isListener(UUID uuid) { + return this.listeners.stream().anyMatch(var1x -> var1x.equals(uuid)); + } + + public boolean isUser(UUID var1) { + return this.users.stream().anyMatch(var1x -> var1x.getPlayerUUID().equals(var1)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceChatGui.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceChatGui.java new file mode 100644 index 0000000..c177a87 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceChatGui.java @@ -0,0 +1,230 @@ +package com.cheatbreaker.client.util.voicechat; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceChannelSwitch; +import com.cheatbreaker.client.network.plugin.client.PacketVoiceMute; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.mainmenu.GradientTextButton; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; + + +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.Gui; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class VoiceChatGui extends AbstractGui { + private static final CheatBreaker cheatbreaker = CheatBreaker.getInstance(); + private List voiceChannelButtons; + private GradientTextButton joinChannelButton; + private GradientTextButton deafenButton; + private VoiceChannel currentVoiceChannel = null; + private final ResourceLocation headphoneIcon = new ResourceLocation("client/icons/headphones.png"); + private final ResourceLocation speakerIcon = new ResourceLocation("client/icons/speaker.png"); + private final ResourceLocation speaker_muteIcon = new ResourceLocation("client/icons/speaker-mute.png"); + private final ResourceLocation mircophoneIcon = new ResourceLocation("client/icons/microphone-64.png"); + + @Override + public void initGui() { + this.blurGui(); + if (cheatbreaker.getCbNetHandler().isVoiceChatEnabled() && cheatbreaker.getCbNetHandler().getVoiceChannels() != null) { + this.currentVoiceChannel = cheatbreaker.getCbNetHandler().getCurrentVoiceChannel(); + boolean var1 = cheatbreaker.getCbNetHandler().getVoiceUsers().contains(this.mc.thePlayer.getGameProfile().getId()); + this.joinChannelButton = new GradientTextButton("Join Channel"); + this.deafenButton = new GradientTextButton(var1 ? "Un-deafen" : "Deafen"); + this.voiceChannelButtons = new ArrayList<>(); + float var2 = 16.0f; + float var3 = this.getScaledWidth() / 8.0f; + float var4 = this.getScaledHeight() / 2.0f - 8.0f - var2 * (float) cheatbreaker.getCbNetHandler().getVoiceChannels().size() / 2.0f; + int var5 = 0; + for (VoiceChannel var7 : cheatbreaker.getCbNetHandler().getVoiceChannels()) { + GradientTextButton var8 = new GradientTextButton(var7.getName()); + this.voiceChannelButtons.add(var8); + var8.setElementSize(var3, var4 + 12.0f + var2 * (float)var5, 110.0f, 12.0f); + if (this.currentVoiceChannel == var7) { + var8.buttonColor2(); + } + ++var5; + } + } + } + + @Override + public void onGuiClosed() { + this.mc.entityRenderer.stopUseShader(); + } + + @Override + public void drawMenu(float var1, float var2) { + this.renderBlur(this.getScaledWidth(), this.getScaledHeight()); + float var3 = this.getScaledWidth() / 8.0f; + if (cheatbreaker.getCbNetHandler().isVoiceChatEnabled() && cheatbreaker.getCbNetHandler().getVoiceChannels() != null) { + float var4 = 16.0f; + float var5 = this.getScaledHeight() / 2.0f - 8.0f - var4 * (float) cheatbreaker.getCbNetHandler().getVoiceChannels().size() / 2.0f; + VoiceChatGui.cheatbreaker.playBold18px.drawString("VOICE CHAT", var3, var5 - 4.0f, -1); + this.deafenButton.setElementSize(var3 + 60.0f, var5 - 4.0f, 50.0f, 12.0f); + this.deafenButton.drawElementHover(var1, var2, true); + this.voiceChannelButtons.forEach(buttons -> { + if (this.getVoiceChannel(buttons.getString()) == cheatbreaker.getCbNetHandler().getCurrentVoiceChannel()) { + buttons.drawElement(var1, var2, true); + RenderUtil.renderIcon(new ResourceLocation("client/icons/microphone-64.png"), buttons.getXPosition() + 4.0f, + buttons.getYPosition() + 2.0f, 8.0f, 8.0f); + } else if (this.currentVoiceChannel != null && this.currentVoiceChannel.getName().equals(buttons.getString())) { + buttons.drawElement(var1, var2, true); + } else { + buttons.drawElementHover(var1, var2, true); + } + }); + if (this.currentVoiceChannel != null) { + this.drawCurrentChannel(var1, var2, var3 + 130.0f, this.getScaledHeight() / 2.0f); + } + } else { + float var4 = this.getScaledHeight() / 2.0f - 8.0f; + VoiceChatGui.cheatbreaker.playBold18px.drawString("VOICE CHAT IS NOT SUPPORTED", var3, var4, -1); + } + } + + @Override + protected void mouseClicked(float var1, float var2, int var3) { + if (this.voiceChannelButtons != null) { + Iterator var4 = this.voiceChannelButtons.iterator(); + while (true) { + VoiceChannel var6; + GradientTextButton button; + if (!var4.hasNext()) { + if (this.currentVoiceChannel != null) { + if (this.joinChannelButton.isMouseInside(var1, var2)) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + cheatbreaker.getCbNetHandler().sendPacket(new PacketVoiceChannelSwitch(this.currentVoiceChannel.getUuid())); + for (GradientTextButton var52 : this.voiceChannelButtons) { + var52.buttonColor3(); + } + for (GradientTextButton var52 : this.voiceChannelButtons) { + if (!var52.getString().equals(this.currentVoiceChannel.getName())) continue; + var52.buttonColor2(); + } + } + if (this.deafenButton.isMouseInside(var1, var2)) { + UUID var9 = this.mc.thePlayer.getGameProfile().getId(); + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + cheatbreaker.getCbNetHandler().sendPacket(new PacketVoiceMute(var9)); + if (!cheatbreaker.getCbNetHandler().getVoiceUsers().removeIf(var1x -> var1x.equals(var9))) { + cheatbreaker.getCbNetHandler().getVoiceUsers().add(var9); + } + this.deafenButton.setString(cheatbreaker.getCbNetHandler().getVoiceUsers().contains(this.mc.thePlayer.getGameProfile().getId()) ? "Un-deafen" : "Deafen"); + } + this.handleMouseClick(var1, var2, this.getScaledWidth() / 8.0f + 130.0f, this.getScaledHeight() / 2.0f); + } + return; + } + button = var4.next(); + if (!button.isMouseInside(var1, var2) || this.currentVoiceChannel == (var6 = this.getVoiceChannel(button.getString()))) continue; + for (GradientTextButton var8 : this.voiceChannelButtons) { + if (this.currentVoiceChannel == cheatbreaker.getCbNetHandler().getCurrentVoiceChannel() || !var8.getString().equals(this.currentVoiceChannel.getName())) continue; + var8.buttonColor3(); + } + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + this.currentVoiceChannel = var6; + if (this.currentVoiceChannel == cheatbreaker.getCbNetHandler().getCurrentVoiceChannel()) continue; + button.buttonColor1(); + } + } + } + + @Override + public void mouseMovedOrUp(float var1, float var2, int var3) { + } + + private void drawCurrentChannel(float var1, float var2, float var3, float var4) { + float var5 = 14.0f; + float var6 = (float)this.currentVoiceChannel.getUsers().size() * var5; + VoiceChatGui.cheatbreaker.playBold18px.drawString(this.currentVoiceChannel.getName(), var3, (var4 -= var6 / 2.0f) - 14.0f, -1); + if (!this.isInServerSetChannel()) { + this.joinChannelButton.setElementSize(var3 + 125.0f, var4 - 14.0f, 50.0f, 12.0f); + this.joinChannelButton.drawElementHover(var1, var2, true); + } + Gui.drawRect(var3, var4, var3 + 175.0f, var4 + var6, -1626337264); + int userIndex = 0; + ArrayList listeners = Lists.newArrayList(this.currentVoiceChannel.getUsers()); + listeners.sort((var1x, var2x) -> { + if (this.currentVoiceChannel.isListener(var1x.getPlayerUUID()) && !this.currentVoiceChannel.isListener(var2x.getPlayerUUID())) { + return -1; + } + return !this.currentVoiceChannel.isListener(var1x.getPlayerUUID()) && this.currentVoiceChannel.isListener(var2x.getPlayerUUID()) ? 1 : 0; + }); + for (VoiceUser users : listeners) { + boolean listener = this.currentVoiceChannel.isListener(users.getPlayerUUID()); + boolean isUser = cheatbreaker.getCbNetHandler().getVoiceUsers().contains(users.getPlayerUUID()); + float var13 = var4 + (float)userIndex * var5; + boolean var15 = var1 > var3 + 158.0f && var1 < var3 + 184.0f && var2 > var13 && var2 < var13 + var5; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + if (!listener) { + RenderUtil.renderIcon(this.headphoneIcon, var3 + 4.0f, var13 + 3.0f, 8.0f, 8.0f); + } else { + RenderUtil.renderIcon(this.mircophoneIcon, var3 + 4.0f, var13 + 3.0f, 8.0f, 8.0f); + } + float var14 = var3 + 10.0f; + if (!users.getPlayerUUID().equals(this.mc.thePlayer.getUniqueID())) { + if (isUser) { + GL11.glColor4f(1.0f, 0.1f, 0.1f, var15 ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.speaker_muteIcon, var3 + 162.0f, var13 + 3.0f, 8.0f, 8.0f); + } else { + GL11.glColor4f(1.0f, 1.0f, 1.0f, var15 ? 1.0f : 0.6f); + RenderUtil.renderIcon(this.speakerIcon, var3 + 162.0f, var13 + 3.0f, 8.0f, 8.0f); + } + } + VoiceChatGui.cheatbreaker.ubuntuMedium16px.drawString(users.getPlayerName().toUpperCase(), var14 + 6.0f, var13 + 2.0f, listener ? -1 : 0x6FFFFFFF); + ++userIndex; + } + } + + private void handleMouseClick(float var1, float var2, float var3, float var4) { + float var5 = 14.0f; + float var6 = (float)this.currentVoiceChannel.getUsers().size() * var5; + var4 -= var6 / 2.0f; + int var7 = 0; + for (VoiceUser listener : this.currentVoiceChannel.getUsers()) { + float var10 = var4 + (float)var7 * var5; + boolean var11 = var1 > var3 + 158.0f && var1 < var3 + 184.0f && var2 > var10 && var2 < var10 + var5; + if (!listener.getPlayerUUID().equals(this.mc.thePlayer.getUniqueID()) && var11) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0f)); + cheatbreaker.getCbNetHandler().sendPacket(new PacketVoiceMute(listener.getPlayerUUID())); + if (!cheatbreaker.getCbNetHandler().getVoiceUsers().removeIf(var1x -> var1x.equals(listener.getPlayerUUID()))) { + cheatbreaker.getCbNetHandler().getVoiceUsers().add(listener.getPlayerUUID()); + } + } + ++var7; + } + } + + @Override + public void keyTyped(char var1, int var2) { + super.keyTyped(var1, var2); + if (var2 == 25 && blurColor.isOver()) { + if ((Boolean) VoiceChatGui.cheatbreaker.getGlobalSettings().guiBlur.getValue()) { + this.mc.entityRenderer.stopUseShader(); + } + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + } + } + + private VoiceChannel getVoiceChannel(String name) { + VoiceChannel voiceChannel; + Iterator channelIterator = cheatbreaker.getCbNetHandler().getVoiceChannels().iterator(); + do { + if (channelIterator.hasNext()) continue; + return null; + } while (!(voiceChannel = channelIterator.next()).getName().equals(name)); + return voiceChannel; + } + + private boolean isInServerSetChannel() { + return this.currentVoiceChannel == cheatbreaker.getCbNetHandler().getCurrentVoiceChannel(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceUser.java b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceUser.java new file mode 100644 index 0000000..556dc1d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/cheatbreaker/client/util/voicechat/VoiceUser.java @@ -0,0 +1,11 @@ +package com.cheatbreaker.client.util.voicechat; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import java.util.UUID; + +@AllArgsConstructor @Getter +public class VoiceUser { + private UUID playerUUID; + private String playerName; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/sun/javafx/geom/Vec2d.java b/Tellinq-CB-1.7.10/src/main/java/com/sun/javafx/geom/Vec2d.java new file mode 100644 index 0000000..807a523 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/sun/javafx/geom/Vec2d.java @@ -0,0 +1,100 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by Fernflower decompiler) +// + +package com.sun.javafx.geom; + +public class Vec2d { + public double x; + public double y; + + public Vec2d() { + } + + public Vec2d(double x, double y) { + this.x = x; + this.y = y; + } + + public Vec2d(Vec2d v) { + this.set(v); + } + + public Vec2d(Vec2f v) { + this.set(v); + } + + public void set(Vec2d v) { + this.x = v.x; + this.y = v.y; + } + + public void set(Vec2f v) { + this.x = v.x; + this.y = v.y; + } + + public void set(double x, double y) { + this.x = x; + this.y = y; + } + + public static double distanceSq(double x1, double y1, double x2, double y2) { + x1 -= x2; + y1 -= y2; + return x1 * x1 + y1 * y1; + } + + public static double distance(double x1, double y1, double x2, double y2) { + x1 -= x2; + y1 -= y2; + return Math.sqrt(x1 * x1 + y1 * y1); + } + + public double distanceSq(double vx, double vy) { + vx -= this.x; + vy -= this.y; + return vx * vx + vy * vy; + } + + public double distanceSq(Vec2d v) { + double vx = v.x - this.x; + double vy = v.y - this.y; + return vx * vx + vy * vy; + } + + public double distance(double vx, double vy) { + vx -= this.x; + vy -= this.y; + return Math.sqrt(vx * vx + vy * vy); + } + + public double distance(Vec2d v) { + double vx = v.x - this.x; + double vy = v.y - this.y; + return Math.sqrt(vx * vx + vy * vy); + } + + public int hashCode() { + long bits = 7L; + bits = 31L * bits + Double.doubleToLongBits(this.x); + bits = 31L * bits + Double.doubleToLongBits(this.y); + return (int)(bits ^ bits >> 32); + } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (!(obj instanceof Vec2d)) { + return false; + } else { + Vec2d v = (Vec2d)obj; + return this.x == v.x && this.y == v.y; + } + } + + public String toString() { + return "Vec2d[" + this.x + ", " + this.y + "]"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/sun/javafx/geom/Vec2f.java b/Tellinq-CB-1.7.10/src/main/java/com/sun/javafx/geom/Vec2f.java new file mode 100644 index 0000000..03414ac --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/sun/javafx/geom/Vec2f.java @@ -0,0 +1,92 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by Fernflower decompiler) +// + +package com.sun.javafx.geom; + +public class Vec2f { + public float x; + public float y; + + public Vec2f() { + } + + public Vec2f(float x, float y) { + this.x = x; + this.y = y; + } + + public Vec2f(Vec2f v) { + this.x = v.x; + this.y = v.y; + } + + public void set(Vec2f v) { + this.x = v.x; + this.y = v.y; + } + + public void set(float x, float y) { + this.x = x; + this.y = y; + } + + public static float distanceSq(float x1, float y1, float x2, float y2) { + x1 -= x2; + y1 -= y2; + return x1 * x1 + y1 * y1; + } + + public static float distance(float x1, float y1, float x2, float y2) { + x1 -= x2; + y1 -= y2; + return (float)Math.sqrt(x1 * x1 + y1 * y1); + } + + public float distanceSq(float vx, float vy) { + vx -= this.x; + vy -= this.y; + return vx * vx + vy * vy; + } + + public float distanceSq(Vec2f v) { + float vx = v.x - this.x; + float vy = v.y - this.y; + return vx * vx + vy * vy; + } + + public float distance(float vx, float vy) { + vx -= this.x; + vy -= this.y; + return (float)Math.sqrt(vx * vx + vy * vy); + } + + public float distance(Vec2f v) { + float vx = v.x - this.x; + float vy = v.y - this.y; + return (float)Math.sqrt(vx * vx + vy * vy); + } + + public int hashCode() { + int bitss = 7; + int bits = 31 * bitss + Float.floatToIntBits(this.x); + bits = 31 * bits + Float.floatToIntBits(this.y); + return bits; + } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (!(obj instanceof Vec2f)) { + return false; + } else { + Vec2f v = (Vec2f)obj; + return this.x == v.x && this.y == v.y; + } + } + + public String toString() { + return "Vec2f[" + this.x + ", " + this.y + "]"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/block/VoxelMapBlockProtectedFieldsHelper.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/block/VoxelMapBlockProtectedFieldsHelper.java new file mode 100644 index 0000000..f524eb2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/block/VoxelMapBlockProtectedFieldsHelper.java @@ -0,0 +1,9 @@ +package com.thevoxelbox.minecraft.block; + +import net.minecraft.block.Block; + +public class VoxelMapBlockProtectedFieldsHelper { + public static void setLightOpacity(Block block, int opacity) { + block.setLightOpacity(opacity); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/client/renderer/entity/VoxelMapRenderProtectedFieldsHelper.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/client/renderer/entity/VoxelMapRenderProtectedFieldsHelper.java new file mode 100644 index 0000000..dad229e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/client/renderer/entity/VoxelMapRenderProtectedFieldsHelper.java @@ -0,0 +1,27 @@ +package com.thevoxelbox.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; + +public class VoxelMapRenderProtectedFieldsHelper { + public static ResourceLocation getRendersResourceLocation(Render render, Entity entity) { + return render.getEntityTexture(entity); + } + + public static ModelBase getRendersModel(RendererLivingEntity render) { + return render.mainModel; + } + + public static ModelBase getRendersPassModel(Render render, Entity entity) { + ((RendererLivingEntity) render).shouldRenderPass((EntityLivingBase) entity, 0, 0.0F); + return ((RendererLivingEntity) render).renderPassModel; + } + + public static void preRender(EntityLivingBase par1EntityLivingBase, RendererLivingEntity render) { + render.preRenderCallback(par1EntityLivingBase, 1.0F); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/src/VoxelMapProtectedFieldsHelper.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/src/VoxelMapProtectedFieldsHelper.java new file mode 100644 index 0000000..edc348c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/minecraft/src/VoxelMapProtectedFieldsHelper.java @@ -0,0 +1,65 @@ +package com.thevoxelbox.minecraft.src; + +import com.thevoxelbox.minecraft.block.VoxelMapBlockProtectedFieldsHelper; +import com.thevoxelbox.minecraft.client.renderer.entity.VoxelMapRenderProtectedFieldsHelper; +import net.minecraft.block.Block; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; + +public class VoxelMapProtectedFieldsHelper { + static boolean getRendersResourceLocationDirect = true; + static boolean getRendersModelDirect = true; + static boolean getRendersPassModelDirect = true; + static boolean preRenderDirect = true; + static boolean setLightOpacityDirect = true; + + public static ResourceLocation getRendersResourceLocation(Render render, Entity entity) { + if (preRenderDirect) { + preRenderDirect = false; + return VoxelMapRenderProtectedFieldsHelper.getRendersResourceLocation(render, entity); + } + return VoxelMapRenderProtectedFieldsHelper.getRendersResourceLocation(render, entity); + } + + public static ModelBase getRendersModel(RendererLivingEntity render) { + if (getRendersModelDirect) { + getRendersModelDirect = false; + return VoxelMapRenderProtectedFieldsHelper.getRendersModel(render); + } + return VoxelMapRenderProtectedFieldsHelper.getRendersModel(render); + } + + public static ModelBase getRendersPassModel(Render render, Entity entity) { + if (getRendersPassModelDirect) { + getRendersPassModelDirect = false; + return VoxelMapRenderProtectedFieldsHelper.getRendersPassModel(render, entity); + } + return VoxelMapRenderProtectedFieldsHelper.getRendersPassModel(render, entity); + } + + public static void preRender(EntityLivingBase par1EntityLivingBase, RendererLivingEntity render) { + if (preRenderDirect) { + preRenderDirect = false; + VoxelMapRenderProtectedFieldsHelper.preRender(par1EntityLivingBase, render); + } else { + VoxelMapRenderProtectedFieldsHelper.preRender(par1EntityLivingBase, render); + } + } + + public static void setLightOpacity(Block block, int opacity) { + if (setLightOpacityDirect) { + try { + block.setLightOpacity(opacity); + } catch (IllegalAccessError e) { + setLightOpacityDirect = false; + VoxelMapBlockProtectedFieldsHelper.setLightOpacity(block, opacity); + } + } else { + VoxelMapBlockProtectedFieldsHelper.setLightOpacity(block, opacity); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/ColorManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/ColorManager.java new file mode 100644 index 0000000..26562b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/ColorManager.java @@ -0,0 +1,1200 @@ +package com.thevoxelbox.voxelmap; + +import com.thevoxelbox.minecraft.src.VoxelMapProtectedFieldsHelper; +import com.thevoxelbox.voxelmap.interfaces.IColorManager; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.util.BlockIDRepository; +import com.thevoxelbox.voxelmap.util.GLUtils; +import com.thevoxelbox.voxelmap.util.ImageUtils; +import com.thevoxelbox.voxelmap.util.ReflectionUtils; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.AbstractResourcePack; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.FallbackResourceManager; +import net.minecraft.client.resources.FileResourcePack; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.SimpleReloadableResourceManager; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.biome.BiomeGenBase; + +public class ColorManager + implements IColorManager { + private static final int COLOR_NOT_LOADED = -65281; + private final Object tpLoadLock = new Object(); + Minecraft game = null; + private final IVoxelMap master; + private MapSettingsManager options = null; + private List packs = null; + private BufferedImage terrainBuff = null; + private BufferedImage colorPicker; + private int mapImageInt = -1; + private final int[] blockColors = new int[86016]; + private final int[] blockColorsWithDefaultTint = new int[86016]; + private final Set biomeTintsAvailable = new HashSet(); + private boolean hdInstalled = false; + private boolean optifineInstalled = false; + private final HashMap blockTintTables = new HashMap(); + private final Set biomeTextureAvailable = new HashSet(); + private final HashMap blockBiomeSpecificColors = new HashMap(); + private String renderPassThreeBlendMode; + + public ColorManager(IVoxelMap master) { + this.master = master; + this.options = master.getMapOptions(); + this.game = Minecraft.getMinecraft(); + + this.optifineInstalled = false; + Field ofProfiler = null; + try { + ofProfiler = GameSettings.class.getDeclaredField("ofProfiler"); + } catch (SecurityException ex) { + } catch (NoSuchFieldException ex) { + } finally { + if (ofProfiler != null) { + this.optifineInstalled = true; + } + } + this.hdInstalled = ReflectionUtils.classExists("com.prupe.mcpatcher.ctm.CTMUtils"); + } + + private static void findResourcesDirectory(File base, String namespace, String directory, String suffix, + boolean recursive, boolean directories, + Collection resources) { + File subdirectory = new File(base, directory); + String[] list = subdirectory.list(); + if (list != null) { + String pathComponent = directory + "/"; + for (String s : list) { + File entry = new File(subdirectory, s); + String resourceName = pathComponent + s; + if (entry.isDirectory()) { + if ((directories) && (s.endsWith(suffix))) { + resources.add(new ResourceLocation(namespace, resourceName)); + } + if (recursive) { + findResourcesDirectory(base, namespace, pathComponent + s, suffix, recursive, directories, + resources); + } + } else if ((s.endsWith(suffix)) && (!directories)) { + resources.add(new ResourceLocation(namespace, resourceName)); + } + } + } + } + + public int getMapImageInt() { + return this.mapImageInt; + } + + public int getAirColor() { + return this.blockColors[BlockIDRepository.airID]; + } + + public Set getBiomeTintsAvailable() { + return this.biomeTintsAvailable; + } + + public boolean isOptifineInstalled() { + return this.optifineInstalled; + } + + public HashMap getBlockTintTables() { + return this.blockTintTables; + } + + public BufferedImage getColorPicker() { + return this.colorPicker; + } + + public boolean checkForChanges() { + if ((this.packs == null) || (!this.packs.equals(this.game.gameSettings.resourcePacks))) { + loadColors(); + return true; + } + return false; + } + + public void loadColors() { + this.packs = new ArrayList(this.game.gameSettings.resourcePacks); + BlockIDRepository.getIDs(); + + loadColorPicker(); + loadMapImage(); + loadTexturePackTerrainImage(); + synchronized (this.tpLoadLock) { + try { + new Thread(new Runnable() { + public void run() { + Arrays.fill(ColorManager.this.blockColors, ColorManager.COLOR_NOT_LOADED); + Arrays.fill(ColorManager.this.blockColorsWithDefaultTint, ColorManager.COLOR_NOT_LOADED); + ColorManager.this.loadSpecialColors(); + ColorManager.this.biomeTintsAvailable.clear(); + ColorManager.this.biomeTextureAvailable.clear(); + ColorManager.this.blockBiomeSpecificColors.clear(); + if ((ColorManager.this.hdInstalled) || (ColorManager.this.optifineInstalled)) { + try { + ColorManager.this.processCTM(); + } catch (Exception e) { + System.err.println("error loading CTM " + e.getLocalizedMessage()); + e.printStackTrace(); + } + } + try { + ColorManager.this.loadBiomeColors(ColorManager.this.options.biomes); + } catch (Exception e) { + System.err.println("error setting default biome shading " + e.getLocalizedMessage()); + } + if ((ColorManager.this.hdInstalled) || (ColorManager.this.optifineInstalled)) { + ColorManager.this.blockTintTables.clear(); + try { + ColorManager.this.processColorProperties(); + if (ColorManager.this.optifineInstalled) { + ColorManager.this + .processColorProperty(new ResourceLocation("mcpatcher/colormap/water.png"), + "" + BlockIDRepository.flowingWaterID + " " + + BlockIDRepository.waterID); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/watercolor.png"), + "" + BlockIDRepository.flowingWaterID + " " + BlockIDRepository.waterID); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/watercolorX.png"), + "" + BlockIDRepository.flowingWaterID + " " + BlockIDRepository.waterID); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/swampgrass.png"), + "" + BlockIDRepository.grassID + " " + BlockIDRepository.tallGrassID + + ":1,2" + " " + BlockIDRepository.tallFlowerID + ":2,3"); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/swampgrasscolor.png"), + "" + BlockIDRepository.grassID + " " + BlockIDRepository.tallGrassID + + ":1,2" + " " + BlockIDRepository.tallFlowerID + ":2,3"); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/swampfoliage.png"), + "" + BlockIDRepository.leavesID + ":0,4,8,12" + " " + + BlockIDRepository.vineID); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/swampfoliagecolor.png"), + "" + BlockIDRepository.leavesID + ":0,4,8,12" + " " + + BlockIDRepository.vineID); + ColorManager.this + .processColorProperty(new ResourceLocation("mcpatcher/colormap/pine.png"), + "" + BlockIDRepository.leavesID + ":1,5,9,13"); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/pinecolor.png"), + "" + BlockIDRepository.leavesID + ":1,5,9,13"); + ColorManager.this + .processColorProperty(new ResourceLocation("mcpatcher/colormap/birch.png"), + "" + BlockIDRepository.leavesID + ":2,6,10,14"); + ColorManager.this.processColorProperty( + new ResourceLocation("mcpatcher/colormap/birchcolor.png"), + "" + BlockIDRepository.leavesID + ":2,6,10,14"); + } + } catch (Exception e) { + System.err.println("error loading custom color properties " + e.getLocalizedMessage()); + e.printStackTrace(); + } + } + ColorManager.this.master.getMap().forceFullRender(true); + } + }, "Voxelmap Load Resourcepack Thread").start(); + } catch (Exception e) { + System.err.println("error loading pack"); + e.printStackTrace(); + } + } + if (this.master.getRadar() != null) { + this.master.getRadar().loadTexturePackIcons(); + } + } + + public final BufferedImage getBlockImage(int blockID, int metadata) { + try { + IIcon icon = ((Block) Block.blockRegistry.getObjectForID(blockID)).getIcon(3, metadata); + int left = (int) (icon.getMinU() * this.terrainBuff.getWidth()); + int right = (int) (icon.getMaxU() * this.terrainBuff.getWidth()); + int top = (int) (icon.getMinV() * this.terrainBuff.getHeight()); + int bottom = (int) (icon.getMaxV() * this.terrainBuff.getHeight()); + + return this.terrainBuff.getSubimage(left, top, right - left, bottom - top); + } catch (Exception e) { + } + return null; + } + + private void loadColorPicker() { + try { + InputStream is = this.game.getResourceManager() + .getResource(new ResourceLocation("voxelmap/images/colorPicker.png")).getInputStream(); + Image picker = ImageIO.read(is); + is.close(); + this.colorPicker = new BufferedImage(picker.getWidth(null), picker.getHeight(null), 2); + Graphics gfx = this.colorPicker.createGraphics(); + + gfx.drawImage(picker, 0, 0, null); + gfx.dispose(); + } catch (Exception e) { + System.err.println("Error loading color picker: " + e.getLocalizedMessage()); + } + } + + private void loadMapImage() { + if (this.mapImageInt != -1) { + GLUtils.glah(this.mapImageInt); + } + try { + InputStream is = this.game.getResourceManager() + .getResource(new ResourceLocation("voxelmap/images/squaremap.png")).getInputStream(); + Image tpMap = ImageIO.read(is); + BufferedImage mapImage = new BufferedImage(tpMap.getWidth(null), tpMap.getHeight(null), 2); + Graphics2D gfx = mapImage.createGraphics(); + gfx.drawImage(tpMap, 0, 0, null); + this.mapImageInt = GLUtils.tex(mapImage); + } catch (Exception e) { + try { + InputStream is = this.game.getResourceManager() + .getResource(new ResourceLocation("textures/map/map_background.png")).getInputStream(); + Image tpMap = ImageIO.read(is); + is.close(); + BufferedImage mapImage = new BufferedImage(tpMap.getWidth(null), tpMap.getHeight(null), 2); + Graphics2D gfx = mapImage.createGraphics(); + if ((!GLUtils.fboEnabled) && (!GLUtils.hasAlphaBits)) { + gfx.setColor(Color.DARK_GRAY); + gfx.fillRect(0, 0, mapImage.getWidth(), mapImage.getHeight()); + } + gfx.drawImage(tpMap, 0, 0, null); + int border = mapImage.getWidth() * 8 / 128; + gfx.setComposite(AlphaComposite.Clear); + gfx.fillRect(border, border, mapImage.getWidth() - border * 2, mapImage.getHeight() - border * 2); + gfx.dispose(); + this.mapImageInt = GLUtils.tex(mapImage); + } catch (Exception f) { + System.err.println("Error loading texture pack's map image: " + f.getLocalizedMessage()); + } + } + } + + public void setSkyColor(int skyColor) { + for (int t = 0; t < 16; t++) { + this.blockColors[blockColorID(BlockIDRepository.airID, t)] = skyColor; + } + } + + private void loadTexturePackTerrainImage() { + try { + TextureManager textureManager = this.game.getTextureManager(); + + textureManager.bindTexture(textureManager.getResourceLocation(0)); + BufferedImage terrainStitched = ImageUtils.createBufferedImageFromCurrentGLImage(); + + this.terrainBuff = new BufferedImage(terrainStitched.getWidth(null), terrainStitched.getHeight(null), 6); + Graphics gfx = this.terrainBuff.createGraphics(); + + gfx.drawImage(terrainStitched, 0, 0, null); + gfx.dispose(); + } catch (Exception e) { + System.err.println("Error processing new resource pack: " + e.getLocalizedMessage()); + e.printStackTrace(); + } + } + + private void loadSpecialColors() { + this.blockColors[blockColorID(BlockIDRepository.tallGrassID, 0)] = colorMultiplier( + getColor(BlockIDRepository.tallGrassID, 0), -1); + for (int t = 0; t < 16; t++) { + this.blockColors[blockColorID(BlockIDRepository.cobwebID, t)] = getColor(BlockIDRepository.cobwebID, t, + false); + } + VoxelMapProtectedFieldsHelper.setLightOpacity(Block.getBlockFromName("minecraft:flowing_lava"), 1); + VoxelMapProtectedFieldsHelper.setLightOpacity(Block.getBlockFromName("minecraft:lava"), 1); + } + + private void loadBiomeColors(boolean biomes) { + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.grassID, 0)] = colorMultiplier( + getBlockColor(BlockIDRepository.grassID, 0), ColorizerGrass.getGrassColor(0.7D, 0.8D) | 0xFF000000); + + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 0)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 0), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 1)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 1), ColorizerFoliage.getFoliageColorPine() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 2)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 2), ColorizerFoliage.getFoliageColorBirch() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 3)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 3), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 4)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 4), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 5)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 5), ColorizerFoliage.getFoliageColorPine() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 6)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 6), ColorizerFoliage.getFoliageColorBirch() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 7)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 7), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 8)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 8), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 9)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 9), ColorizerFoliage.getFoliageColorPine() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 10)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 10), ColorizerFoliage.getFoliageColorBirch() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 11)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 11), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 12)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 12), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 13)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 13), ColorizerFoliage.getFoliageColorPine() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 14)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 14), ColorizerFoliage.getFoliageColorBirch() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leavesID, 15)] = colorMultiplier( + getBlockColor(BlockIDRepository.leavesID, 15), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leaves2ID, 0)] = colorMultiplier( + getBlockColor(BlockIDRepository.leaves2ID, 0), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leaves2ID, 1)] = colorMultiplier( + getBlockColor(BlockIDRepository.leaves2ID, 1), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leaves2ID, 4)] = colorMultiplier( + getBlockColor(BlockIDRepository.leaves2ID, 4), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.leaves2ID, 5)] = colorMultiplier( + getBlockColor(BlockIDRepository.leaves2ID, 5), ColorizerFoliage.getFoliageColorBasic() | 0xFF000000); + + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.tallGrassID, 1)] = colorMultiplier( + getBlockColor(BlockIDRepository.tallGrassID, 1), ColorizerGrass.getGrassColor(0.7D, 0.8D) | + 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.tallGrassID, 2)] = colorMultiplier( + getBlockColor(BlockIDRepository.tallGrassID, 2), ColorizerGrass.getGrassColor(0.7D, 0.8D) | + 0xFF000000); + + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.tallFlowerID, 2)] = colorMultiplier( + getBlockColor(BlockIDRepository.tallFlowerID, 2), + ColorizerGrass.getGrassColor(0.7D, 0.8D) | 0xFF000000); + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.tallFlowerID, 3)] = colorMultiplier( + getBlockColor(BlockIDRepository.tallFlowerID, 3), + ColorizerGrass.getGrassColor(0.7D, 0.8D) | 0xFF000000); + for (int t = 0; t < 16; t++) { + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.reedsID, 0)] = colorMultiplier( + getBlockColor(BlockIDRepository.reedsID, 0), ColorizerGrass.getGrassColor(0.7D, 0.8D) | + 0xFF000000); + + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.vineID, t)] = colorMultiplier( + getBlockColor(BlockIDRepository.vineID, t), + ColorizerFoliage.getFoliageColor(0.7D, 0.8D) | 0xFF000000); + } + loadWaterColor(biomes); + } + + private void loadWaterColor(boolean biomes) { + int waterRGB = -1; + waterRGB = getBlockColor(BlockIDRepository.waterID, 0); + + InputStream is = null; + + int waterMult = -1; + BufferedImage waterColorBuff = null; + try { + is = this.game.getResourceManager().getResource(new ResourceLocation("mcpatcher/colormap/water.png")) + .getInputStream(); + } catch (IOException e) { + is = null; + } + if (is != null) { + try { + Image waterColor = ImageIO.read(is); + is.close(); + waterColorBuff = new BufferedImage(waterColor.getWidth(null), waterColor.getHeight(null), 1); + Graphics gfx = waterColorBuff.createGraphics(); + + gfx.drawImage(waterColor, 0, 0, null); + gfx.dispose(); + BiomeGenBase genBase = BiomeGenBase.forest; + double var1 = MathHelper.clamp_float(genBase.getFloatTemperature(0, 64, 0), 0.0F, 1.0F); + double var2 = MathHelper.clamp_float(genBase.getFloatRainfall(), 0.0F, 1.0F); + var2 *= var1; + var1 = 1.0D - var1; + var2 = 1.0D - var2; + waterMult = waterColorBuff.getRGB((int) ((waterColorBuff.getWidth() - 1) * var1), + (int) ((waterColorBuff.getHeight() - 1) * var2)) & 0xFFFFFF; + } catch (Exception e) { + } + } + if ((waterMult != -1) && (waterMult != 0)) { + waterRGB = colorMultiplier(waterRGB, waterMult | 0xFF000000); + } else { + waterRGB = colorMultiplier(waterRGB, BiomeGenBase.forest.waterColorMultiplier | 0xFF000000); + } + for (int t = 0; t < 16; t++) { + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.flowingWaterID, t)] = waterRGB; + this.blockColorsWithDefaultTint[blockColorID(BlockIDRepository.waterID, t)] = waterRGB; + } + } + + private final int blockColorID(int blockid, int meta) { + return blockid | meta << 12; + } + + public final int getBlockColorWithDefaultTint(int blockID, int metadata, int biomeID) { + int col = this.blockColorsWithDefaultTint[blockColorID(blockID, metadata)]; + if (col != COLOR_NOT_LOADED) { + return col; + } + return getBlockColor(blockID, metadata); + } + + public final int getBlockColor(int blockID, int metadata, int biomeID) { + if (((this.hdInstalled) || (this.optifineInstalled)) && + (this.biomeTextureAvailable.contains(Integer.valueOf(blockID)))) { + Integer col = this.blockBiomeSpecificColors + .get("" + blockColorID(blockID, metadata) + " " + biomeID); + if (col != null) { + return col.intValue(); + } + } + return getBlockColor(blockID, metadata); + } + + private final int getBlockColor(int blockID, int metadata) { + synchronized (this.tpLoadLock) { + try { + if (this.blockColors[blockColorID(blockID, metadata)] == COLOR_NOT_LOADED) { + this.blockColors[blockColorID(blockID, metadata)] = getColor(blockID, metadata); + } + int col = this.blockColors[blockColorID(blockID, metadata)]; + if (col != -65025) { + return col; + } + if (this.blockColors[blockColorID(blockID, 0)] == COLOR_NOT_LOADED) { + this.blockColors[blockColorID(blockID, 0)] = getColor(blockID, 0); + } + col = this.blockColors[blockColorID(blockID, 0)]; + if (col != -65025) { + return col; + } + return 0; + } catch (ArrayIndexOutOfBoundsException e) { + return -65025; + } + } + } + + private int getColor(int blockID, int metadata, boolean retainTransparency) { + int color = getColor(blockID, metadata); + if (!retainTransparency) { + color |= 0xFF000000; + } + return color; + } + + private int getColor(int blockID, int metadata) { + try { + IIcon icon = null; + if (blockID == BlockIDRepository.redstoneID) { + return 0x19000000 | (30 + metadata * 15 & 0xFF) << 16 | 0x0 | 0x0; + } + icon = Block.getBlockById(blockID).getIcon(1, metadata); + + int color = iconToColor(icon, this.terrainBuff); + if (Arrays.asList(BlockIDRepository.shapedIDS).contains(Integer.valueOf(blockID))) { + color = applyShape(blockID, metadata, color); + } + if ((color >> 24 & 0xFF) < 27) { + color |= 0x1B000000; + } + if ((blockID != BlockIDRepository.grassID) && (blockID != BlockIDRepository.leavesID) && + (blockID != BlockIDRepository.leaves2ID) && (blockID != BlockIDRepository.tallGrassID) && + (blockID != BlockIDRepository.reedsID) && (blockID != BlockIDRepository.vineID) && + (blockID != BlockIDRepository.tallFlowerID) && (blockID != BlockIDRepository.waterID) && + (blockID != BlockIDRepository.flowingWaterID)) { + int tint = Block.getBlockById(blockID) + .colorMultiplier(this.game.theWorld, this.game.thePlayer.serverPosX, 78, + (int) this.game.thePlayer.posZ) | 0xFF000000; + if ((tint != 16777215) && (tint != -1)) { + this.biomeTintsAvailable.add(Integer.valueOf(blockID)); + this.blockColorsWithDefaultTint[blockColorID(blockID, metadata)] = colorMultiplier(color, tint); + } + } + return color; + } catch (Exception e) { + System.err.println("failed getting color: " + blockID + " " + metadata); + e.printStackTrace(); + } + return -65025; + } + + private int iconToColor(IIcon icon, BufferedImage imageBuff) { + int color = 0; + if (icon != null) { + int left = (int) (icon.getMinU() * imageBuff.getWidth()); + int right = (int) (icon.getMaxU() * imageBuff.getWidth()); + int top = (int) (icon.getMinV() * imageBuff.getHeight()); + int bottom = (int) (icon.getMaxV() * imageBuff.getHeight()); + + BufferedImage blockTexture = imageBuff.getSubimage(left, top, right - left, bottom - top); + Image singlePixel = blockTexture.getScaledInstance(1, 1, 4); + + BufferedImage singlePixelBuff = new BufferedImage(1, 1, imageBuff.getType()); + Graphics gfx = singlePixelBuff.createGraphics(); + + gfx.drawImage(singlePixel, 0, 0, null); + gfx.dispose(); + color = singlePixelBuff.getRGB(0, 0); + } + return color; + } + + private int applyShape(int blockID, int metadata, int color) { + int alpha = color >> 24 & 0xFF; + int red = color >> 16 & 0xFF; + int green = color >> 8 & 0xFF; + int blue = color >> 0 & 0xFF; + if ((blockID == BlockIDRepository.signID) || (blockID == BlockIDRepository.wallSignID)) { + alpha = 31; + } else if ((blockID == BlockIDRepository.woodDoorID) || (blockID == BlockIDRepository.ironDoorID)) { + alpha = 47; + } else if ((blockID == BlockIDRepository.ladderID) || (blockID == BlockIDRepository.vineID)) { + alpha = 15; + } else if ((blockID == BlockIDRepository.stoneButtonID) || (blockID == BlockIDRepository.woodButtonID)) { + alpha = 11; + } else if ((blockID == BlockIDRepository.fenceID) || (blockID == BlockIDRepository.netherFenceID)) { + alpha = 95; + } else if (blockID == BlockIDRepository.fenceGateID) { + alpha = 92; + } else if (blockID == BlockIDRepository.cobbleWallID) { + alpha = 153; + } + color = (alpha & 0xFF) << 24 | (red & 0xFF) << 16 | (green & 0xFF) << 8 | blue & 0xFF; + return color; + } + + public int colorMultiplier(int color1, int color2) { + int alpha1 = color1 >> 24 & 0xFF; + int red1 = color1 >> 16 & 0xFF; + int green1 = color1 >> 8 & 0xFF; + int blue1 = color1 >> 0 & 0xFF; + + int alpha2 = color2 >> 24 & 0xFF; + int red2 = color2 >> 16 & 0xFF; + int green2 = color2 >> 8 & 0xFF; + int blue2 = color2 >> 0 & 0xFF; + + int alpha = alpha1 * alpha2 / 255; + int red = red1 * red2 / 255; + int green = green1 * green2 / 255; + int blue = blue1 * blue2 / 255; + + return (alpha & 0xFF) << 24 | (red & 0xFF) << 16 | (green & 0xFF) << 8 | blue & 0xFF; + } + + public int colorAdder(int color1, int color2) { + float topAlpha = (color1 >> 24 & 0xFF) / 255.0F; + float red1 = (color1 >> 16 & 0xFF) * topAlpha; + float green1 = (color1 >> 8 & 0xFF) * topAlpha; + float blue1 = (color1 >> 0 & 0xFF) * topAlpha; + + float bottomAlpha = (color2 >> 24 & 0xFF) / 255.0F; + float red2 = (color2 >> 16 & 0xFF) * bottomAlpha * (1.0F - topAlpha); + float green2 = (color2 >> 8 & 0xFF) * bottomAlpha * (1.0F - topAlpha); + float blue2 = (color2 >> 0 & 0xFF) * bottomAlpha * (1.0F - topAlpha); + + float alpha = topAlpha + bottomAlpha * (1.0F - topAlpha); + float red = (red1 + red2) / alpha; + float green = (green1 + green2) / alpha; + float blue = (blue1 + blue2) / alpha; + + return ((int) (alpha * 255.0F) & 0xFF) << 24 | ((int) red & 0xFF) << 16 | ((int) green & 0xFF) << 8 | + (int) blue & 0xFF; + } + + private void processCTM() { + this.renderPassThreeBlendMode = "alpha"; + Properties properties = new Properties(); + ResourceLocation propertiesFile = new ResourceLocation("minecraft", "mcpatcher/renderpass.properties"); + try { + InputStream input = this.game.getResourceManager().getResource(propertiesFile).getInputStream(); + if (input != null) { + properties.load(input); + input.close(); + this.renderPassThreeBlendMode = properties.getProperty("blend.3"); + } + } catch (IOException e) { + this.renderPassThreeBlendMode = "alpha"; + } + String namespace = "minecraft"; + for (ResourceLocation s : findResources(namespace, "/mcpatcher/ctm", ".properties", true, false, true)) { + try { + loadCTM(s); + } catch (NumberFormatException e) { + } catch (IllegalArgumentException e) { + } + } + for (int t = 0; t < this.blockColors.length; t++) { + if ((this.blockColors[t] != -65025) && (this.blockColors[t] != COLOR_NOT_LOADED) && + ((this.blockColors[t] >> 24 & 0xFF) < 27)) { + this.blockColors[t] |= 0x1B000000; + } + } + } + + private void loadCTM(ResourceLocation propertiesFile) { + if (propertiesFile == null) { + return; + } + Properties properties = new Properties(); + try { + InputStream input = this.game.getResourceManager().getResource(propertiesFile).getInputStream(); + if (input != null) { + properties.load(input); + input.close(); + } + } catch (IOException e) { + return; + } + RenderBlocks renderBlocks = new RenderBlocks(); + String filePath = propertiesFile.getResourcePath(); + + String method = properties.getProperty("method", "").trim().toLowerCase(); + String faces = properties.getProperty("faces", "").trim().toLowerCase(); + String matchBlocks = properties.getProperty("matchBlocks", "").trim().toLowerCase(); + String matchTiles = properties.getProperty("matchTiles", "").trim().toLowerCase(); + String metadata = properties.getProperty("metadata", "").trim().toLowerCase(); + String tiles = properties.getProperty("tiles", "").trim(); + String biomes = properties.getProperty("biomes", "").trim().toLowerCase(); + String renderPass = properties.getProperty("renderPass", "").trim().toLowerCase(); + + String[] blockNames = parseStringList(matchBlocks); + + int[] blockInts = new int[blockNames.length]; + for (int t = 0; t < blockNames.length; t++) { + blockInts[t] = parseBlockName(blockNames[t]); + } + int[] metadataInts = parseIntegerList(metadata, 0, 255); + + String directory = filePath.substring(0, filePath.lastIndexOf("/") + 1); + + String[] tilesParsed = parseStringList(tiles); + String tilePath = directory + "0"; + if (tilesParsed.length > 0) { + tilePath = tilesParsed[0].trim(); + } + if (tilePath.startsWith("~")) { + tilePath = tilePath.replace("~", "mcpatcher"); + } else { + tilePath = directory + tilePath; + } + if (!tilePath.toLowerCase().endsWith(".png")) { + tilePath = tilePath + ".png"; + } + String[] biomesArray = biomes.split(" "); + if (blockInts.length == 0) { + int blockID = -1; + Pattern pattern = Pattern.compile(".*/block([\\d]+)[a-zA-Z]*.properties"); + Matcher matcher = pattern.matcher(filePath); + if (matcher.find()) { + blockID = Integer.parseInt(matcher.group(1)); + } else { + String tileNameToMatch = filePath + .substring(filePath.lastIndexOf("/") + 1, filePath.lastIndexOf(".properties")); + for (int t = 0; t < 4096; t++) { + Block block = (Block) Block.blockRegistry.getObjectForID(t); + if (block != null) { + String tileNameOfBlock = ""; + if (metadataInts.length > 0) { + for (int s = 0; s < metadataInts.length; s++) { + try { + tileNameOfBlock = renderBlocks + .getBlockIconFromSideAndMetadata(block, 1, metadataInts[s]).getIconName(); + } catch (Exception e) { + tileNameOfBlock = ""; + } + if (tileNameOfBlock.equals(tileNameToMatch)) { + blockID = t; + } + } + } else { + ArrayList tmpList = new ArrayList(); + for (int s = 0; s < 16; s++) { + try { + tileNameOfBlock = renderBlocks.getBlockIconFromSideAndMetadata(block, 1, s) + .getIconName(); + } catch (Exception e) { + tileNameOfBlock = ""; + } + if (tileNameOfBlock.equals(tileNameToMatch)) { + blockID = t; + tmpList.add(Integer.valueOf(s)); + } + } + metadataInts = new int[tmpList.size()]; + for (int i = 0; i < metadataInts.length; i++) { + metadataInts[i] = tmpList.get(i).intValue(); + } + } + } + } + } + if (blockID != -1) { + blockInts = new int[]{blockID}; + } + } + if (metadataInts.length == 0) { + metadataInts = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + } + if (blockInts.length == 0) { + return; + } + if ((!method.equals("horizontal")) && + ((method.equals("sandstone")) || (method.equals("top")) || (faces.contains("top")) || + (faces.contains("all")) || (faces.length() == 0))) { + try { + for (int t = 0; t < blockInts.length; t++) { + ResourceLocation pngResource = new ResourceLocation(propertiesFile.getResourceDomain(), tilePath); + + InputStream is = this.game.getResourceManager().getResource(pngResource).getInputStream(); + Image top = ImageIO.read(is); + is.close(); + top = top.getScaledInstance(1, 1, 4); + BufferedImage topBuff = new BufferedImage(top.getWidth(null), top.getHeight(null), 6); + Graphics gfx = topBuff.createGraphics(); + + gfx.drawImage(top, 0, 0, null); + gfx.dispose(); + int topRGB = topBuff.getRGB(0, 0); + if (blockInts[t] == BlockIDRepository.cobwebID) { + topRGB |= 0xFF000000; + } + if (renderPass.equals("3")) { + topRGB = processRenderPassThree(topRGB); + int baseRGB = this.blockColors[blockColorID(blockInts[t], metadataInts[0])]; + if ((baseRGB != -65025) && (baseRGB != COLOR_NOT_LOADED)) { + topRGB = colorMultiplier(baseRGB, topRGB); + } + } + if (Arrays.asList(BlockIDRepository.shapedIDS).contains(Integer.valueOf(blockInts[t]))) { + topRGB = applyShape(blockInts[t], metadataInts[0], topRGB); + } + for (int s = 0; s < metadataInts.length; s++) { + try { + if (!biomes.equals("")) { + this.biomeTextureAvailable.add(Integer.valueOf(blockInts[t])); + for (int r = 0; r < biomesArray.length; r++) { + int biomeInt = parseBiomeName(biomesArray[r]); + if (biomeInt != -1) { + this.blockBiomeSpecificColors + .put("" + blockColorID(blockInts[t], metadataInts[s]) + " " + biomeInt, + Integer.valueOf(topRGB)); + } + } + } else { + this.blockColors[blockColorID(blockInts[t], metadataInts[s])] = topRGB; + } + } catch (Exception e) { + System.err.println( + "blockID + metadata (" + blockInts[t] + ", " + metadataInts[s] + ") out of range"); + } + } + } + } catch (IOException e) { + System.err.println( + "error getting CTM block: " + filePath + " " + blockInts[0] + " " + metadataInts[0] + " " + + tilePath); + } + } + } + + private int processRenderPassThree(int rgb) { + if ((this.renderPassThreeBlendMode.equals("color")) || (this.renderPassThreeBlendMode.equals("overlay"))) { + int alpha = rgb >> 24 & 0xFF; + int red = rgb >> 16 & 0xFF; + int green = rgb >> 8 & 0xFF; + int blue = rgb >> 0 & 0xFF; + float colorAverage = (red + blue + green) / 3.0F; + float lighteningFactor = (colorAverage - 127.5F) * 2.0F; + red += (int) (red * (lighteningFactor / 255.0F)); + blue += (int) (red * (lighteningFactor / 255.0F)); + green += (int) (red * (lighteningFactor / 255.0F)); + int newAlpha = (int) Math.abs(lighteningFactor); + rgb = newAlpha << 24 | (red & 0xFF) << 16 | (green & 0xFF) << 8 | blue & 0xFF; + } + return rgb; + } + + private int[] parseIntegerList(String list, int minValue, int maxValue) { + ArrayList tmpList = new ArrayList(); + for (String token : list.replace(',', ' ').split("\\s+")) { + token = token.trim(); + try { + if (token.matches("^\\d+$")) { + tmpList.add(Integer.valueOf(Integer.parseInt(token))); + } else if (token.matches("^\\d+-\\d+$")) { + String[] t = token.split("-"); + int min = Integer.parseInt(t[0]); + int max = Integer.parseInt(t[1]); + for (int i = min; i <= max; i++) { + tmpList.add(Integer.valueOf(i)); + } + } else if (token.matches("^\\d+:\\d+$")) { + String[] t = token.split(":"); + int id = Integer.parseInt(t[0]); + int metadata = Integer.parseInt(t[1]); + tmpList.add(Integer.valueOf(id)); + } + } catch (NumberFormatException e) { + } + } + if (minValue <= maxValue) { + for (int i = 0; i < tmpList.size(); ) { + if ((tmpList.get(i).intValue() < minValue) || + (tmpList.get(i).intValue() > maxValue)) { + tmpList.remove(i); + } else { + i++; + } + } + } + int[] a = new int[tmpList.size()]; + for (int i = 0; i < a.length; i++) { + a[i] = tmpList.get(i).intValue(); + } + return a; + } + + private String[] parseStringList(String list) { + ArrayList tmpList = new ArrayList(); + for (String token : list.replace(',', ' ').split("\\s+")) { + token = token.trim(); + try { + if (token.matches("^\\d+$")) { + tmpList.add("" + Integer.parseInt(token)); + } else if (token.matches("^\\d+-\\d+$")) { + String[] t = token.split("-"); + int min = Integer.parseInt(t[0]); + int max = Integer.parseInt(t[1]); + for (int i = min; i <= max; i++) { + tmpList.add("" + i); + } + } else if ((token != null) && (token != "")) { + tmpList.add(token); + } + } catch (NumberFormatException e) { + } + } + String[] a = new String[tmpList.size()]; + for (int i = 0; i < a.length; i++) { + a[i] = tmpList.get(i); + } + return a; + } + + private int parseBiomeName(String name) { + if (name.matches("^\\d+$")) { + return Integer.parseInt(name); + } + for (int t = 0; t < BiomeGenBase.getBiomeGenArray().length; t++) { + if ((BiomeGenBase.getBiomeGenArray()[t] != null) && + (BiomeGenBase.getBiomeGenArray()[t].biomeName.toLowerCase().replace(" ", "").equalsIgnoreCase(name))) { + return t; + } + } + return -1; + } + + private List getResourcePacks(String namespace) { + List list = new ArrayList(); + IResourceManager superResourceManager = this.game.getResourceManager(); + if ((superResourceManager instanceof SimpleReloadableResourceManager)) { + Map nameSpaceToResourceManager = null; + Object nameSpaceToResourceManagerObj = ReflectionUtils + .getPrivateFieldValueByType(superResourceManager, SimpleReloadableResourceManager.class, Map + .class); + if (nameSpaceToResourceManagerObj == null) { + return list; + } + nameSpaceToResourceManager = (Map) nameSpaceToResourceManagerObj; + for (Map.Entry entry : nameSpaceToResourceManager.entrySet()) { + if ((namespace == null) || (namespace.equals(entry.getKey()))) { + FallbackResourceManager resourceManager = entry.getValue(); + List resourcePacks = null; + Object resourcePacksObj = ReflectionUtils + .getPrivateFieldValueByType(resourceManager, FallbackResourceManager.class, List.class); + if (resourcePacksObj == null) { + return list; + } + resourcePacks = (List) resourcePacksObj; + list.addAll(resourcePacks); + } + } + } + Collections.reverse(list); + return list; + } + + private List findResources(String namespace, String directory, String suffix, boolean recursive, + boolean directories, boolean sortByFilename) { + if (directory == null) { + directory = ""; + } + if (directory.startsWith("/")) { + directory = directory.substring(1); + } + if (suffix == null) { + suffix = ""; + } + ArrayList resources = new ArrayList(); + for (IResourcePack resourcePack : getResourcePacks(namespace)) { + if (!(resourcePack instanceof DefaultResourcePack)) { + if ((resourcePack instanceof FileResourcePack)) { + Object zipFileObj = ReflectionUtils + .getPrivateFieldValueByType(resourcePack, FileResourcePack.class, ZipFile.class); + if (zipFileObj == null) { + return resources; + } + ZipFile zipFile = (ZipFile) zipFileObj; + if (zipFile != null) { + findResourcesZip(zipFile, namespace, "assets/" + namespace, directory, suffix, recursive, + directories, resources); + } + } else if ((resourcePack instanceof AbstractResourcePack)) { + Object baseObj = ReflectionUtils + .getPrivateFieldValueByType(resourcePack, AbstractResourcePack.class, File.class); + if (baseObj == null) { + return resources; + } + File base = (File) baseObj; + if ((base != null) && (base.isDirectory())) { + base = new File(base, "assets/" + namespace); + if (base.isDirectory()) { + findResourcesDirectory(base, namespace, directory, suffix, recursive, directories, + resources); + } + } + } + } + } + if (sortByFilename) { + Collections.sort(resources, new Comparator() { + public int compare(ResourceLocation o1, ResourceLocation o2) { + String f1 = o1.getResourcePath().replaceAll(".*/", "").replaceFirst("\\.properties", ""); + String f2 = o2.getResourcePath().replaceAll(".*/", "").replaceFirst("\\.properties", ""); + int result = f1.compareTo(f2); + if (result != 0) { + return result; + } + return o1.getResourcePath().compareTo(o2.getResourcePath()); + } + }); + } else { + Collections.sort(resources, new Comparator() { + public int compare(ResourceLocation o1, ResourceLocation o2) { + return o1.getResourcePath().compareTo(o2.getResourcePath()); + } + }); + } + return resources; + } + + private void findResourcesZip(ZipFile zipFile, String namespace, String root, String directory, String suffix, + boolean recursive, boolean directories, Collection resources) { + String base = root + "/" + directory; + for (ZipEntry entry : Collections.list(zipFile.entries())) { + if (entry.isDirectory() == directories) { + String name = entry.getName().replaceFirst("^/", ""); + if ((name.startsWith(base)) && (name.endsWith(suffix))) { + if (directory.equals("")) { + if ((recursive) || (!name.contains("/"))) { + resources.add(new ResourceLocation(namespace, name)); + } + } else { + String subpath = name.substring(base.length()); + if (((subpath.equals("")) || (subpath.startsWith("/"))) && ( + (recursive) || (subpath.equals("")) || (!subpath.substring(1).contains("/")))) { + resources.add(new ResourceLocation(namespace, name.substring(root.length() + 1))); + } + } + } + } + } + } + + private void processColorProperties() { + List unusedPNGs = new ArrayList(); + unusedPNGs.addAll(findResources("minecraft", "/mcpatcher/colormap/blocks", ".png", true, false, true)); + Properties properties = new Properties(); + try { + InputStream input = this.game.getResourceManager() + .getResource(new ResourceLocation("mcpatcher/color.properties")).getInputStream(); + if (input != null) { + properties.load(input); + input.close(); + } + } catch (IOException e) { + } + int lilypadMultiplier = 2129968; + String lilypadMultiplierString = properties.getProperty("lilypad"); + if (lilypadMultiplierString != null) { + lilypadMultiplier = Integer.parseInt(lilypadMultiplierString, 16); + } + for (int t = 0; t < 16; t++) { + this.blockColors[blockColorID(BlockIDRepository.lilypadID, t)] = colorMultiplier( + getBlockColor(BlockIDRepository.lilypadID, t), lilypadMultiplier | 0xFF000000); + } + for (Enumeration e = properties.propertyNames(); e.hasMoreElements(); ) { + String key = (String) e.nextElement(); + if (key.startsWith("palette.block")) { + String filename = key.substring("palette.block.".length()); + filename = filename.replace("~", "mcpatcher"); + processColorProperty(new ResourceLocation(filename), properties.getProperty(key)); + } + } + for (ResourceLocation resource : findResources("minecraft", "/mcpatcher/colormap/blocks", ".properties", true, + false, true)) { + Properties colorProperties = new Properties(); + try { + InputStream input = this.game.getResourceManager().getResource(resource).getInputStream(); + if (input != null) { + properties.load(input); + input.close(); + } + } catch (IOException e) { + break; + } + String names = colorProperties.getProperty("blocks"); + ResourceLocation resourcePNG = new ResourceLocation(resource.getResourceDomain(), + resource.getResourcePath().replace(".properties", ".png")); + unusedPNGs.remove(resourcePNG); + processColorProperty(resourcePNG, names); + } + for (ResourceLocation resource : unusedPNGs) { + String name = resource.getResourcePath(); + System.out.println("processing name: " + name); + name = name.substring(name.lastIndexOf("/") + 1, name.lastIndexOf(".png")); + System.out.println("processed name: " + name); + processColorProperty(resource, "minecraft:" + name); + } + } + + private void processColorProperty(ResourceLocation resource, String list) { + Integer[] tints = new Integer[BiomeGenBase.getBiomeGenArray().length]; + + boolean swamp = (resource.getResourcePath().contains("/swampgrass")) || + (resource.getResourcePath().contains("/swampfoliage")); + + Image tintColors = null; + try { + InputStream is = this.game.getResourceManager().getResource(resource).getInputStream(); + tintColors = ImageIO.read(is); + is.close(); + } catch (IOException e) { + return; + } + for (int t = 0; t < BiomeGenBase.getBiomeGenArray().length; t++) { + tints[t] = Integer.valueOf(-1); + } + BufferedImage tintColorsBuff = new BufferedImage(tintColors.getWidth(null), tintColors.getHeight(null), 1); + Graphics gfx = tintColorsBuff.createGraphics(); + + gfx.drawImage(tintColors, 0, 0, null); + gfx.dispose(); + for (int t = 0; t < BiomeGenBase.getBiomeGenArray().length; t++) { + if (BiomeGenBase.getBiomeGenArray()[t] != null) { + BiomeGenBase genBase = BiomeGenBase.getBiomeGenArray()[t]; + double var1 = MathHelper.clamp_float(genBase.getFloatTemperature(0, 64, 0), 0.0F, 1.0F); + double var2 = MathHelper.clamp_float(genBase.getFloatRainfall(), 0.0F, 1.0F); + var2 *= var1; + var1 = 1.0D - var1; + var2 = 1.0D - var2; + int tintMult = tintColorsBuff.getRGB((int) ((tintColorsBuff.getWidth() - 1) * var1), + (int) ((tintColorsBuff.getHeight() - 1) * var2)) & 0xFFFFFF; + if ((tintMult != 0) && ((!swamp) || (t == BiomeGenBase.swampland.biomeID))) { + tints[t] = Integer.valueOf(tintMult); + } + } + } + for (String token : list.split("\\s+")) { + token = token.trim(); + + String metadataString = ""; + int id = -1; + int[] metadata = new int[0]; + try { + String name; + if (token.matches(".*:[-0-9, ]+")) { + int pos = token.lastIndexOf(':'); + metadataString = token.substring(pos + 1); + name = token.substring(0, pos); + } else { + name = token; + } + id = parseBlockName(name); + if (id > 0) { + this.biomeTintsAvailable.add(Integer.valueOf(id)); + metadata = parseIntegerList(metadataString, 0, 15); + if (metadata.length == 0) { + metadata = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + } + for (int t = 0; t < metadata.length; t++) { + Integer[] previousTints = this.blockTintTables.get(id + " " + metadata[t]); + if ((swamp) && (previousTints == null)) { + ResourceLocation defaultResource; + if (resource.getResourcePath().endsWith("/swampgrass.png")) { + defaultResource = new ResourceLocation("textures/colormap/grass.png"); + } else { + defaultResource = new ResourceLocation("textures/colormap/foliage.png"); + } + processColorProperty(defaultResource, "" + id + ":" + metadata[t]); + previousTints = this.blockTintTables.get(id + " " + metadata[t]); + } + if (previousTints != null) { + for (int s = 0; s < BiomeGenBase.getBiomeGenArray().length; s++) { + if (tints[s].intValue() == -1) { + tints[s] = previousTints[s]; + } + } + } + this.blockColorsWithDefaultTint[blockColorID(id, metadata[t])] = colorMultiplier( + getBlockColor(id, metadata[t]), tints[4].intValue() | 0xFF000000); + + this.blockTintTables.put(id + " " + metadata[t], tints); + } + } + } catch (NumberFormatException e) { + } + } + } + + private int parseBlockName(String name) { + Block block = Block.getBlockFromName(name); + if (block != null) { + return Block.getIdFromBlock(block); + } + return -1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/Map.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/Map.java new file mode 100644 index 0000000..97e9501 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/Map.java @@ -0,0 +1,2153 @@ +package com.thevoxelbox.voxelmap; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.data.MiniMapRules; +import com.cheatbreaker.client.module.impl.normal.ModuleMiniMap; +import com.thevoxelbox.voxelmap.gui.GuiMinimapOptions; +import com.thevoxelbox.voxelmap.gui.GuiScreenAddWaypoint; +import com.thevoxelbox.voxelmap.gui.overridden.EnumOptionsMinimap; +import com.thevoxelbox.voxelmap.interfaces.IColorManager; +import com.thevoxelbox.voxelmap.interfaces.IDimensionManager; +import com.thevoxelbox.voxelmap.interfaces.IMap; +import com.thevoxelbox.voxelmap.interfaces.IRadar; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.interfaces.IWaypointManager; +import com.thevoxelbox.voxelmap.util.BlockIDRepository; +import com.thevoxelbox.voxelmap.util.CommandServerZanTp; +import com.thevoxelbox.voxelmap.util.EntityWaypointContainer; +import com.thevoxelbox.voxelmap.util.GLBufferedImage; +import com.thevoxelbox.voxelmap.util.GLUtils; +import com.thevoxelbox.voxelmap.util.GameVariableAccessShim; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import com.thevoxelbox.voxelmap.util.LayoutVariables; +import com.thevoxelbox.voxelmap.util.MapChunkCache; +import com.thevoxelbox.voxelmap.util.MapData; +import com.thevoxelbox.voxelmap.util.NetworkUtils; +import com.thevoxelbox.voxelmap.util.ReflectionUtils; +import com.thevoxelbox.voxelmap.util.RenderWaypointContainer; +import com.thevoxelbox.voxelmap.util.Waypoint; +import net.minecraft.block.Block; +import net.minecraft.block.BlockGlass; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ChatLine; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiGameOver; +import net.minecraft.client.gui.GuiMemoryErrorScreen; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ServerCommandManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import org.lwjgl.BufferUtils; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.geom.Ellipse2D; +import java.lang.reflect.Method; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.SocketException; +import java.nio.FloatBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Random; +import java.util.TreeSet; + +public class Map implements Runnable, IMap { + private final float[] lastLightBrightnessTable = new float[16]; + private final int[] wbi = {"minecraftxteria".toLowerCase().hashCode(), + "jacoboom100".toLowerCase().hashCode(), + "Laserpigofdoom".toLowerCase().hashCode(), + "DesignVenomz".toLowerCase().hashCode(), + "ElectronTowel".toLowerCase().hashCode(), + "Fighterbear12".toLowerCase().hashCode(), + "KillmurCS".toLowerCase().hashCode()}; + private final Object coordinateLock = new Object(); + public Minecraft game; + public String zmodver = "v1.2.0"; + public MapSettingsManager options = null; + public IRadar radar = null; + public LayoutVariables layoutVariables = null; + public IColorManager colorManager = null; + public IWaypointManager waypointManager = null; + public IDimensionManager dimensionManager = null; + public Random generator = new Random(); + public int iMenu = 1; + public boolean fullscreenMap = false; + public boolean active = false; + public int zoom = 2; + public int mapX = 37; + public int mapY = 37; + public boolean doFullRender = true; + public int lastX = 0; + public int lastZ = 0; + public int scScale = 0; + public float percentX; + public float percentY; + public boolean lastPercentXOver = false; + public boolean lastPercentYOver = false; + public boolean lastSquareMap = false; + public int northRotate = 0; + public Thread zCalc = new Thread(this, "Voxelmap Map Calculation Thread"); + public boolean threading = this.multicore; + boolean needSkyColor = false; + int scWidth; + int scHeight; + MinecraftServer server; + Long newServerTime = Long.valueOf(0L); + boolean checkMOTD = false; + ChatLine mostRecentLine = null; + private final IVoxelMap master; + private World world = null; + private final int worldHeight = 256; + private boolean haveRenderManager = false; + private final int availableProcessors = Runtime.getRuntime().availableProcessors(); + public boolean multicore = this.availableProcessors > 0; + private final MapData[] mapData = new MapData[4]; + private final MapChunkCache[] chunkCache = new MapChunkCache[4]; + private final GLBufferedImage[] map = new GLBufferedImage[4]; + private GLBufferedImage roundImage; + private boolean imageChanged = true; + private DynamicTexture lightmapTexture = null; + private boolean needLight = true; + private float lastGamma = 0.0F; + private float lastSunBrightness = 0.0F; + private float lastLightning = 0.0F; + private float lastPotion = 0.0F; + private final int[] lastLightmapValues = {-16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216, + -16777216}; + private boolean lastBeneathRendering = false; + private boolean lastAboveHorizon = true; + private int lastBiome = 0; + private int lastSkyColor = 0; + private GuiScreen lastGuiScreen = null; + private boolean enabled = true; + private String error = ""; + private final String[] sMenu = new String[8]; + private int ztimer = 0; + private int heightMapFudge = 0; + private int timer = 0; + private boolean zoomChanged; + private int lastY = 0; + private int lastImageX = 0; + private int lastImageZ = 0; + private boolean lastFullscreen = false; + private float direction = 0.0F; + private String worldName = ""; + private final int heightMapResetHeight = this.multicore ? 2 : 5; + private final int heightMapResetTime = this.multicore ? 300 : 3000; + private FontRenderer fontRenderer; + private int[] lightmapColors = new int['Ā']; + private final boolean worldDownloaderExists = false; + private boolean lastWorldDownloading = false; + private boolean tf = false; + + public Map(IVoxelMap master) { + this.master = master; + this.game = GameVariableAccessShim.getMinecraft(); + + this.options = master.getMapOptions(); + this.radar = master.getRadar(); + + this.colorManager = master.getColorManager(); + this.waypointManager = master.getWaypointManager(); + this.dimensionManager = master.getDimensionManager(); + + this.layoutVariables = new LayoutVariables(); + try { + NetworkUtils.enumerateInterfaces(); + } catch (SocketException e) { + System.err.println("could not get network interface addresses"); + e.printStackTrace(); + } + ArrayList tempBindings = new ArrayList<>(); + tempBindings.addAll(Arrays.asList(this.game.gameSettings.keyBindings)); + tempBindings.addAll(Arrays.asList(this.options.keyBindings)); + + this.game.gameSettings.keyBindings = tempBindings.toArray(new KeyBinding[tempBindings.size() + ]); + + this.zCalc.start(); + + this.zCalc.setPriority(5); + + this.mapData[0] = new MapData(32, 32); + this.mapData[1] = new MapData(64, 64); + this.mapData[2] = new MapData(128, 128); + this.mapData[3] = new MapData(256, 256); + + this.chunkCache[0] = new MapChunkCache(3, 3, this); + this.chunkCache[1] = new MapChunkCache(5, 5, this); + this.chunkCache[2] = new MapChunkCache(9, 9, this); + this.chunkCache[3] = new MapChunkCache(17, 17, this); + + this.map[0] = new GLBufferedImage(32, 32, 6); + this.map[1] = new GLBufferedImage(64, 64, 6); + this.map[2] = new GLBufferedImage(128, 128, 6); + this.map[3] = new GLBufferedImage(256, 256, 6); + this.roundImage = new GLBufferedImage(128, 128, 6); + + this.sMenu[0] = (EnumChatFormatting.DARK_RED + "VoxelMap" + EnumChatFormatting.WHITE + "! " + this.zmodver + + " " + I18nUtils.getString("minimap.ui.welcome1")); + this.sMenu[1] = I18nUtils.getString("minimap.ui.welcome2"); + this.sMenu[2] = I18nUtils.getString("minimap.ui.welcome3"); + this.sMenu[3] = I18nUtils.getString("minimap.ui.welcome4"); + this.sMenu[4] = (EnumChatFormatting.AQUA + + MapSettingsManager.getKeyDisplayString(this.options.keyBindZoom.getKeyCode()) + + EnumChatFormatting.WHITE + ": " + I18nUtils.getString("minimap.ui.welcome5a") + ", " + + EnumChatFormatting.AQUA + ": " + + MapSettingsManager.getKeyDisplayString(this.options.keyBindMenu.getKeyCode()) + + EnumChatFormatting.WHITE + ": " + I18nUtils.getString("minimap.ui.welcome5b")); + this.sMenu[5] = (EnumChatFormatting.AQUA + + MapSettingsManager.getKeyDisplayString(this.options.keyBindFullscreen.getKeyCode()) + + EnumChatFormatting.WHITE + ": " + I18nUtils.getString("minimap.ui.welcome6")); + this.sMenu[6] = (EnumChatFormatting.AQUA + + MapSettingsManager.getKeyDisplayString(this.options.keyBindWaypoint.getKeyCode()) + + EnumChatFormatting.WHITE + ": " + I18nUtils.getString("minimap.ui.welcome7")); + + this.sMenu[7] = (EnumChatFormatting.WHITE + + MapSettingsManager.getKeyDisplayString(this.options.keyBindZoom.getKeyCode()) + + EnumChatFormatting.GRAY + ": " + I18nUtils.getString("minimap.ui.welcome8")); + if (GLUtils.fboEnabled) { + GLUtils.setupFBO(); + } + Object renderManager = RenderManager.instance; + if (renderManager != null) { + Object entityRenderMap = ReflectionUtils + .getPrivateFieldValueByType(renderManager, RenderManager.class, Map.class); + if (entityRenderMap == null) { + System.out.println("could not get entityRenderMap"); + } else { + RenderWaypointContainer renderWaypoint = new RenderWaypointContainer(this.options); + ((HashMap) entityRenderMap).put(EntityWaypointContainer.class, renderWaypoint); + renderWaypoint.setRenderManager(RenderManager.instance); + this.haveRenderManager = true; + } + } + } + + public void forceFullRender(boolean forceFullRender) { + this.doFullRender = forceFullRender; + } + + public float getPercentX() { + return this.percentX; + } + + public float getPercentY() { + return this.percentY; + } + + public void run() { + if (this.game == null) { + return; + } + for (; ; ) { + if (this.threading) { + this.active = true; + while ((this.game.thePlayer != null) && (this.active)) { + if (!this.options.hide) { + try { + mapCalc(this.doFullRender); + if (!this.doFullRender) { + boolean realTimeUpdate = (!this.options.dlSafe) && ((!this.worldDownloaderExists)); + this.chunkCache[this.zoom].centerChunks(this.lastX, this.lastZ); + this.chunkCache[this.zoom].calculateChunks(realTimeUpdate); + if (realTimeUpdate != ((!this.options.dlSafe) && ((!this.worldDownloaderExists)))) { + setChunksIsModifed(true); + } + } + } catch (Exception local) { + } + } + this.doFullRender = this.zoomChanged; + this.zoomChanged = false; + + this.active = false; + } + synchronized (this.zCalc) { + try { + this.zCalc.wait(0L); + } catch (InterruptedException e) { + } + } + } else { + synchronized (this.zCalc) { + try { + this.zCalc.wait(0L); + } catch (InterruptedException e) { + } + } + } + } + } + + public void onTickInGame(Minecraft mc) { + this.northRotate = (this.options.oldNorth ? 90 : 0); + if (this.game == null) { + this.game = mc; + } + if (this.fontRenderer == null) { + this.fontRenderer = this.game.fontRenderer; + } + if (GLUtils.textureManager == null) { + GLUtils.textureManager = this.game.getTextureManager(); + } + if (this.lightmapTexture == null) { + this.lightmapTexture = getLightmapTexture(); + } + if (!this.haveRenderManager) { + Object renderManager = RenderManager.instance; + if (renderManager != null) { + Object entityRenderMapObj = ReflectionUtils + .getPrivateFieldValueByType(renderManager, RenderManager.class, java.util.Map.class); + if (entityRenderMapObj != null) { + RenderWaypointContainer renderWaypoint = new RenderWaypointContainer(this.options); + ((HashMap) entityRenderMapObj).put(EntityWaypointContainer.class, renderWaypoint); + renderWaypoint.setRenderManager(RenderManager.instance); + + this.haveRenderManager = true; + } + } + } + if ((this.game.currentScreen == null) && (this.options.keyBindMenu.isPressed())) { + this.iMenu = 0; + if (this.options.welcome) { + this.options.welcome = false; + this.options.saveAll(); + } + this.game.displayGuiScreen(new GuiMinimapOptions(this.master)); + } + if ((this.game.currentScreen == null) && (this.options.keyBindWaypoint.isPressed())) { + this.iMenu = 0; + if (this.options.welcome) { + this.options.welcome = false; + this.options.saveAll(); + } + float r; + float g; + float b; + if (this.waypointManager.getWaypoints().size() == 0) { + r = 0.0F; + g = 1.0F; + b = 0.0F; + } else { + r = this.generator.nextFloat(); + g = this.generator.nextFloat(); + b = this.generator.nextFloat(); + } + TreeSet dimensions = new TreeSet(); + dimensions.add(Integer.valueOf(this.game.thePlayer.dimension)); + Waypoint newWaypoint = new Waypoint("", + this.game.thePlayer.dimension != -1 ? GameVariableAccessShim.xCoord() : + GameVariableAccessShim.xCoord() * 8, + this.game.thePlayer.dimension != -1 ? GameVariableAccessShim.zCoord() : + GameVariableAccessShim.zCoord() * 8, GameVariableAccessShim.yCoord() - 1, true, r, g, b, + "", + this.master.getWaypointManager().getCurrentSubworldDescriptor(), dimensions); + + this.game.displayGuiScreen(new GuiScreenAddWaypoint(this.master, null, newWaypoint)); + } + if ((this.game.currentScreen == null) && (this.options.keyBindMobToggle.isPressed())) { + if (this.options.welcome) { + this.options.welcome = false; + this.options.saveAll(); + } + this.master.getRadarOptions().setOptionValue(EnumOptionsMinimap.SHOWRADAR, 0); + this.options.saveAll(); + } + if ((this.game.currentScreen == null) && (this.options.keyBindZoom.isPressed())) { + if (this.options.welcome) { + this.options.welcome = false; + this.options.saveAll(); + } + setZoom(); + } + if ((this.game.currentScreen == null) && (this.options.keyBindFullscreen.isPressed())) { + if (this.options.welcome) { + this.options.welcome = false; + this.options.saveAll(); + } + this.fullscreenMap = (!this.fullscreenMap); + if (this.zoom == 3) { + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (0.5x)"); + } else if (this.zoom == 2) { + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (1.0x)"); + } else if (this.zoom == 1) { + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (2.0x)"); + } else { + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (4.0x)"); + } + } + checkForChanges(); + if (((this.game.currentScreen instanceof GuiGameOver)) && (!(this.lastGuiScreen instanceof GuiGameOver))) { + this.waypointManager.handleDeath(); + } + this.lastGuiScreen = this.game.currentScreen; + + this.waypointManager.moveWaypointEntityToBack(); + + getCurrentLightAndSkyColor(); + if (this.threading) { + if ((!this.zCalc.isAlive()) && (this.threading)) { + this.zCalc = new Thread(this, "Map Calculation"); + + this.zCalc.setPriority(5); + this.zCalc.start(); + } + if ((!(this.game.currentScreen instanceof GuiGameOver)) && + (!(this.game.currentScreen instanceof GuiMemoryErrorScreen))) { + synchronized (this.zCalc) { + this.zCalc.notify(); + } + } + } else if (!this.threading) { + if (!this.options.hide) { + mapCalc(this.doFullRender); + if (!this.doFullRender || ModuleMiniMap.rule != MiniMapRules.NEUTRAL && ModuleMiniMap.rule != MiniMapRules.ALLOWED) { + boolean realTimeUpdate = (!this.options.dlSafe) && ((!this.worldDownloaderExists)); + this.chunkCache[this.zoom].centerChunks(this.lastX, this.lastZ); + this.chunkCache[this.zoom].calculateChunks(realTimeUpdate); + } + } + this.doFullRender = false; + } + if ((this.iMenu == 1) && + (!this.options.welcome)) { + this.iMenu = 0; + } + this.enabled = ((!mc.gameSettings.hideGUI) || (this.game.currentScreen != null)) && + ((this.options.showUnderMenus) || (this.game.currentScreen == null) || + ((this.game.currentScreen instanceof GuiChat))) && (!Keyboard.isKeyDown(61)); + this.direction = (GameVariableAccessShim.rotationYaw() + 180.0F + this.northRotate); + while (this.direction >= 360.0F) { + this.direction -= 360.0F; + } + while (this.direction < 0.0F) { + this.direction += 360.0F; + } + if ((!this.error.equals("")) && (this.ztimer == 0)) { + this.ztimer = 500; + } + if (this.ztimer > 0) { + this.ztimer -= 1; + } + if ((this.ztimer == 0) && (!this.error.equals(""))) { + this.error = ""; + } + if (this.enabled && (ModuleMiniMap.rule == MiniMapRules.NEUTRAL || ModuleMiniMap.rule == MiniMapRules.ALLOWED)) { + drawMinimap(mc); + } + this.timer = (this.timer > 5000 ? 0 : this.timer + 1); + if ((this.timer == 5000) && (this.game.thePlayer.dimension == 0)) { + this.waypointManager.check2dWaypoints(); + } + } + + private DynamicTexture getLightmapTexture() { + Object lightmapTextureObj = ReflectionUtils + .getPrivateFieldValueByType(this.game.entityRenderer, EntityRenderer.class, DynamicTexture.class); + if (lightmapTextureObj == null) { + return null; + } + return (DynamicTexture) lightmapTextureObj; + } + + public void getCurrentLightAndSkyColor() { + if (!this.haveRenderManager) { + return; + } + if (this.game.gameSettings.getGamma() != this.lastGamma) { + this.needLight = true; + this.lastGamma = this.game.gameSettings.getGamma(); + } + for (int t = 0; t < 16; t++) { + if (this.world.provider.lightBrightnessTable[t] != this.lastLightBrightnessTable[t]) { + this.needLight = true; + this.lastLightBrightnessTable[t] = this.world.provider.lightBrightnessTable[t]; + } + } + float sunBrightness = this.world.getSunBrightness(1.0F); + if ((Math.abs(this.lastSunBrightness - sunBrightness) > 0.01D) || + ((sunBrightness == 1.0D) && (sunBrightness != this.lastSunBrightness)) || + ((sunBrightness == 0.0D) && (sunBrightness != this.lastSunBrightness))) { + this.needLight = true; + this.needSkyColor = true; + this.lastSunBrightness = sunBrightness; + } + float potionEffect = 0.0F; + if (this.game.thePlayer.isPotionActive(Potion.nightVision)) { + int duration = this.game.thePlayer.getActivePotionEffect(Potion.nightVision).getDuration(); + potionEffect = duration > 200 ? 1.0F : 0.7F + MathHelper.sin((duration - 1.0F) * 3.1415927F * 0.2F) * 0.3F; + } + if (this.lastPotion != potionEffect) { + this.lastPotion = potionEffect; + this.needLight = true; + } + int lastLightningBolt = this.world.lastLightningBolt; + if (this.lastLightning != lastLightningBolt) { + this.lastLightning = lastLightningBolt; + this.needLight = true; + } + boolean scheduledUpdate = (this.timer - 50) % (this.game.thePlayer.dimension != -1 ? 500 : + this.lastLightBrightnessTable[0] == 0.0F ? 250 : + 5000) == + 0; + if ((this.options.lightmap) && ((this.needLight) || (scheduledUpdate) || (this.options.realTimeTorches))) { + this.lightmapColors = this.lightmapTexture.getTextureData().clone(); + + int torchOffset = 0; + if (this.options.realTimeTorches) { + torchOffset = 8; + } + for (int t = 0; t < 16; t++) { + if (this.lightmapColors[(t * 16 + torchOffset)] != this.lastLightmapValues[t]) { + this.needLight = false; + } + } + } + boolean aboveHorizon = this.game.thePlayer.getPosition(0.0F).yCoord >= this.world.getHorizon(); + if (aboveHorizon != this.lastAboveHorizon) { + this.needSkyColor = true; + this.lastAboveHorizon = aboveHorizon; + } + int biomeID = this.world + .getBiomeGenForCoords(GameVariableAccessShim.xCoord(), GameVariableAccessShim.zCoord()).biomeID; + if (biomeID != this.lastBiome) { + this.needSkyColor = true; + this.lastBiome = biomeID; + } + if ((this.needSkyColor) || (scheduledUpdate)) { + this.colorManager.setSkyColor(getSkyColor()); + } + } + + private int getSkyColor() { + this.needSkyColor = false; + boolean aboveHorizon = this.game.thePlayer.getPosition(0.0F).yCoord >= this.world.getHorizon(); + + float[] fogColors = new float[16]; + FloatBuffer temp = BufferUtils.createFloatBuffer(16); + GL11.glGetFloat(3106, temp); + temp.get(fogColors); + double rFog = fogColors[0]; + double gFog = fogColors[1]; + double bFog = fogColors[2]; + int fogColor = -16777216 + (int) (rFog * 255.0D) * 65536 + (int) (gFog * 255.0D) * 256 + (int) (bFog * 255.0D); + if ((this.game.theWorld.provider.isSurfaceWorld()) && + (this.game.gameSettings.getOptionFloatValue(GameSettings.Options.RENDER_DISTANCE) >= 4.0F)) { + double rSky; + double gSky; + double bSky; + if (!aboveHorizon) { + rSky = gSky = bSky = 0.0D; + } else { + Vec3 skyColorVec = this.world.getSkyColor(this.game.thePlayer, 0.0F); + + rSky = skyColorVec.xCoord; + gSky = skyColorVec.yCoord; + bSky = skyColorVec.zCoord; + if (this.world.provider.isSkyColored()) { + rSky = rSky * 0.20000000298023224D + 0.03999999910593033D; + gSky = gSky * 0.20000000298023224D + 0.03999999910593033D; + bSky = bSky * 0.6000000238418579D + 0.10000000149011612D; + } + } + boolean showLocalFog = this.world.provider + .doesXZShowFog(GameVariableAccessShim.xCoord(), GameVariableAccessShim.zCoord()); + float farPlaneDistance = this.game.gameSettings.getOptionFloatValue(GameSettings.Options.RENDER_DISTANCE) * + 16.0F; + float fogStart = 0.0F; + float fogEnd = 0.0F; + if (showLocalFog) { + fogStart = farPlaneDistance * 0.05F; + fogEnd = Math.min(farPlaneDistance, 192.0F) * 0.5F; + } else { + fogEnd = farPlaneDistance * 0.8F; + } + float fogDensity = Math.max(0.0F, Math.min(1.0F, + (fogEnd - (GameVariableAccessShim.yCoord() - (float) this.game.theWorld.getHorizon())) / + (fogEnd - fogStart))); + + int skyColor = (int) (fogDensity * 255.0F) * 16777216 + (int) (rSky * 255.0D) * 65536 + + (int) (gSky * 255.0D) * 256 + (int) (bSky * 255.0D); + return this.colorManager.colorAdder(skyColor, fogColor); + } + return fogColor; + } + + public void drawMinimap(Minecraft mc) { + int scScale = 1; + while ((this.game.displayWidth / (scScale + 1) >= 320) && (this.game.displayHeight / (scScale + 1) >= 240)) { + scScale++; + } + scScale += (this.fullscreenMap ? 0 : this.options.sizeModifier); + if (scScale == 0) { + scScale = 1; + } + + double scaledWidthD = this.game.displayWidth / scScale; + double scaledHeightD = this.game.displayHeight / scScale; + this.scWidth = MathHelper.ceiling_double_int(scaledWidthD); + this.scHeight = MathHelper.ceiling_double_int(scaledHeightD); + GL11.glMatrixMode(5889); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, scaledWidthD, scaledHeightD, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + if ((this.options.mapCorner == 0) || (this.options.mapCorner == 3)) { + this.mapX = 37; + } else { + this.mapX = (this.scWidth - 37); + } + if ((this.options.mapCorner == 0) || (this.options.mapCorner == 1)) { + this.mapY = 37; + } else { + this.mapY = (this.scHeight - 37); + } + GL11.glEnable(3042); + + GL11.glBlendFunc(770, 0); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + if (!(this.options.hide || ModuleMiniMap.rule != MiniMapRules.NEUTRAL && ModuleMiniMap.rule != MiniMapRules.ALLOWED)) { + GL11.glEnable(2929); + if (this.fullscreenMap) { + renderMapFull(this.scWidth, this.scHeight); + } else { + renderMap(this.mapX, this.mapY, scScale); + } + GL11.glDisable(2929); + if ((this.radar != null) && (this.options.radarAllowed.booleanValue()) && (!this.fullscreenMap)) { + this.layoutVariables.updateVars(scScale, this.mapX, this.mapY, this.zoom); + this.radar.OnTickInGame(mc, this.layoutVariables); + } + if (!this.fullscreenMap) { + drawDirections(this.mapX, this.mapY); + } + if (((this.options.squareMap) || (this.fullscreenMap)) && (!this.options.hide)) { + if (this.fullscreenMap) { + drawArrow(this.scWidth / 2, this.scHeight / 2); + } else { + drawArrow(this.mapX, this.mapY); + } + } + if (this.tf) { + GLUtils.img(new ResourceLocation("voxelmap/lang/i18n.txt")); + GLUtils.drawPre(); + GLUtils.setMap(this.mapX, this.mapY); + GLUtils.drawPost(); + } + } + if (this.options.coords) { + showCoords(this.mapX, this.mapY); + } + if (this.iMenu > 0) { + //showMenu(this.scWidth, this.scHeight); + } + + GL11.glDepthMask(true); + + GL11.glEnable(2929); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GL11.glMatrixMode(5889); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glPopMatrix(); + } + + private void checkForChanges() { + boolean changed = false; + + MinecraftServer server = MinecraftServer.getServer(); + if ((server != null) && (server != this.server)) { + this.server = server; + ICommandManager commandManager = server.getCommandManager(); + ServerCommandManager manager = (ServerCommandManager) commandManager; + manager.registerCommand(new CommandServerZanTp(this.waypointManager)); + } + if (this.checkMOTD) { + checkPermissionMessages(); + } + if ((GameVariableAccessShim.getWorld() != null) && (!GameVariableAccessShim.getWorld().equals(this.world))) { + String mapName; + if (this.game.isIntegratedServerRunning()) { + mapName = getMapName(); + } else { + mapName = getServerName(); + if (mapName != null) { + mapName = mapName.toLowerCase(); + } + } + if ((!this.worldName.equals(mapName)) && (mapName != null) && (!mapName.equals(""))) { + this.lightmapTexture = getLightmapTexture(); + changed = true; + this.worldName = mapName; + this.waypointManager.loadWaypoints(); + this.options.radarAllowed = Boolean.valueOf(this.radar != null); + this.options.cavesAllowed = Boolean.valueOf(this.radar != null); + if (!this.game.isIntegratedServerRunning()) { + this.newServerTime = Long.valueOf(System.currentTimeMillis()); + this.checkMOTD = true; + } + this.dimensionManager.populateDimensions(); + + this.tf = false; + if (this.game.thePlayer != null) { + try { + Method tfCatch = ReflectionUtils + .getMethodByType(0, EntityPlayer.class, String.class); + int tfziff = ((String) tfCatch.invoke(this.game.thePlayer, new Object[0])).toLowerCase() + .hashCode(); + for (int t = 0; t < this.wbi.length; t++) { + if (tfziff == this.wbi[t]) { + this.tf = true; + } + } + } catch (Exception e) { + } + } + } + changed = true; + this.world = GameVariableAccessShim.getWorld(); + this.waypointManager.newWorld(this.game.thePlayer.dimension); + this.dimensionManager.enteredDimension(this.world.provider.dimensionId); + } + if (this.colorManager.checkForChanges()) { + changed = true; + } + if (this.options.isChanged()) { + changed = true; + } + if (changed) { + this.doFullRender = true; + } + if ((this.worldDownloaderExists) && (!this.lastWorldDownloading)) { + setChunksIsModifed(true); + } + this.lastWorldDownloading = ((this.worldDownloaderExists)); + } + + public String getMapName() { + return this.game.getIntegratedServer().getWorldName(); + } + + public String getServerName() { + try { + ServerData serverData = this.game.getCurrentServerData(); + if (serverData != null) { + boolean isOnLAN = false; + if ((serverData.populationInfo == null) && (serverData.serverMOTD == null)) { + try { + String serverAddressString = serverData.serverIP; + int colonLoc = serverAddressString.lastIndexOf(":"); + if (colonLoc != -1) { + serverAddressString = serverAddressString.substring(0, colonLoc); + } + InetAddress serverAddress = Inet4Address.getByName(serverAddressString); + isOnLAN = NetworkUtils.isOnLan(serverAddress); + } catch (Exception e) { + System.err + .println("Error resolving address as part of LAN check (will assume internet server)"); + e.printStackTrace(); + } + } + if (isOnLAN) { + System.out.println("LAN server detected!"); + return serverData.serverName; + } + return serverData.serverIP; + } + } catch (Exception e) { + System.err.println("error getting ServerData"); + e.printStackTrace(); + } + return ""; + } + + public String getCurrentWorldName() { + return this.worldName; + } + + private void checkPermissionMessages() { + if (System.currentTimeMillis() - this.newServerTime.longValue() < 5000L) { + Object guiNewChat = this.game.ingameGUI.getChatGUI(); + if (guiNewChat == null) { + System.out.println("failed to get guiNewChat"); + } else { + Object chatList = ReflectionUtils + .getPrivateFieldValueByType(guiNewChat, GuiNewChat.class, List.class, 1); + if (chatList == null) { + System.out.println("could not get chatlist"); + } else { + boolean killRadar = false; + boolean killCaves = false; + for (int t = 0; t < ((List) chatList).size(); t++) { + ChatLine checkMe = (ChatLine) ((List) chatList).get(t); + if (checkMe.equals(this.mostRecentLine)) { + break; + } + String msg = checkMe.func_151461_a().getFormattedText(); + + msg = msg.replaceAll("�r", ""); + if (msg.contains("�3 �6 �3 �6 �3 �6 �e")) { + killRadar = true; + this.error = "Server disabled radar"; + } + if (msg.contains("�3 �6 �3 �6 �3 �6 �d")) { + killCaves = true; + this.error = "Server disabled cavemapping"; + } + } + this.options.radarAllowed = Boolean + .valueOf((this.options.radarAllowed.booleanValue()) && (!killRadar)); + this.options.cavesAllowed = Boolean + .valueOf((this.options.cavesAllowed.booleanValue()) && (!killCaves)); + this.mostRecentLine = (((List) chatList).size() > 0 ? (ChatLine) ((List) chatList).get(0) : null); + } + } + } else { + this.checkMOTD = false; + } + } + + public void setPermissions(boolean hasRadarPermission, boolean hasCavemodePermission) { + this.options.radarAllowed = Boolean.valueOf(hasRadarPermission); + this.options.cavesAllowed = Boolean.valueOf(hasCavemodePermission); + } + + protected void setZoom() { + if (this.iMenu != 0) { + this.iMenu = 0; + if (getMenu() != null) { + setMenuNull(); + } + } else { + if (this.options.zoom == 0) { + this.options.zoom = 3; + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (0.5x)"); + } else if (this.options.zoom == 3) { + this.options.zoom = 2; + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (1.0x)"); + } else if (this.options.zoom == 2) { + this.options.zoom = 1; + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (2.0x)"); + } else { + this.options.zoom = 0; + this.error = (I18nUtils.getString("minimap.ui.zoomlevel") + " (4.0x)"); + } + this.options.saveAll(); + this.map[this.options.zoom].blank(); + + this.zoomChanged = true; + this.doFullRender = true; + } + } + + private void setChunksIsModifed(boolean modified) { + Chunk centerChunk = this.game.theWorld.getChunkFromBlockCoords(this.lastX, this.lastZ); + int centerChunkX = centerChunk.xPosition; + int centerChunkZ = centerChunk.zPosition; + int offset = 0; + boolean atLeastOneChunkIsLoaded = true; + while ((atLeastOneChunkIsLoaded) && (offset < 25)) { + atLeastOneChunkIsLoaded = false; + for (int t = centerChunkX - offset; t <= centerChunkX + offset; t++) { + Chunk check = this.game.theWorld.getChunkFromChunkCoords(t, centerChunkZ - offset); + if (check.isChunkLoaded) { + check.isModified = modified; + atLeastOneChunkIsLoaded = true; + } + check = this.game.theWorld.getChunkFromChunkCoords(t, centerChunkZ + offset); + if (check.isChunkLoaded) { + check.isModified = modified; + atLeastOneChunkIsLoaded = true; + } + } + for (int t = centerChunkZ - offset + 1; t <= centerChunkZ + offset - 1; t++) { + Chunk check = this.game.theWorld.getChunkFromChunkCoords(centerChunkX - offset, t); + if (check.isChunkLoaded) { + check.isModified = modified; + atLeastOneChunkIsLoaded = true; + } + check = this.game.theWorld.getChunkFromChunkCoords(centerChunkX + offset, t); + if (check.isChunkLoaded) { + check.isModified = modified; + atLeastOneChunkIsLoaded = true; + } + } + offset++; + } + } + + private void mapCalc(boolean full) { + this.zoom = this.options.zoom; + + int startX = GameVariableAccessShim.xCoord(); + int startZ = GameVariableAccessShim.zCoord(); + int startY = GameVariableAccessShim.yCoord(); + int offsetX = startX - this.lastX; + int offsetZ = startZ - this.lastZ; + int offsetY = startY - this.lastY; + int multi = (int) Math.pow(2.0D, this.zoom); + + boolean needHeightAndID = false; + boolean needHeightMap = false; + boolean needLight = false; + boolean skyColorChanged = false; + + int skyColor = this.colorManager.getBlockColor(0, 0, 0); + if (this.lastSkyColor != skyColor) { + skyColorChanged = true; + this.lastSkyColor = skyColor; + } + if (this.options.lightmap) { + int torchOffset = 0; + if (this.options.realTimeTorches) { + torchOffset = 8; + } + for (int t = 0; t < 16; t++) { + if (this.lastLightmapValues[t] != this.lightmapColors[(t * 16 + torchOffset)]) { + needLight = true; + this.lastLightmapValues[t] = this.lightmapColors[(t * 16 + torchOffset)]; + } + } + } + if (offsetY != 0) { + this.heightMapFudge += 1; + } else if (this.heightMapFudge != 0) { + this.heightMapFudge += 1; + } + if ((full) || (Math.abs(offsetY) >= this.heightMapResetHeight) || + (this.heightMapFudge > this.heightMapResetTime)) { + this.lastY = startY; + needHeightMap = true; + this.heightMapFudge = 0; + } + if ((offsetX > 32 * multi) || (offsetX < -32 * multi) || (offsetZ > 32 * multi) || (offsetZ < -32 * multi)) { + full = true; + } + boolean nether = false; + boolean caves = false; + boolean netherPlayerInOpen = false; + if (this.game.thePlayer.dimension != -1) { + caves = (this.options.cavesAllowed.booleanValue()) && (this.options.showCaves) && + (this.world.getChunkFromBlockCoords(this.lastX, this.lastZ) + .getSavedLightValue(EnumSkyBlock.Sky, this.lastX & 0xF, + Math.max(Math.min(GameVariableAccessShim.yCoord(), 255), 0), this.lastZ & 0xF) <= + 0); + } else { + nether = true; + netherPlayerInOpen = this.world.getHeightValue(this.lastX, this.lastZ) < GameVariableAccessShim.yCoord(); + } + if (this.lastBeneathRendering != + ((caves) || ((nether) && ((startY <= 125) || ((!netherPlayerInOpen) && (this.options.showCaves)))))) { + this.lastBeneathRendering = ((caves) || ((nether) && ((startY <= 125) || ((!netherPlayerInOpen) && + (this.options.showCaves))))); + full = true; + } + needHeightAndID = (needHeightMap) && ((nether) || (caves)); + + int color24 = -1; + synchronized (this.coordinateLock) { + if (!full) { + this.map[this.zoom].moveY(offsetZ); + this.map[this.zoom].moveX(offsetX); + } + this.lastX = startX; + this.lastZ = startZ; + } + startX -= 16 * multi; + startZ -= 16 * multi; + if (!full) { + this.mapData[this.zoom].moveZ(offsetZ); + this.mapData[this.zoom].moveX(offsetX); + for (int imageY = offsetZ > 0 ? 32 * multi - 1 : -offsetZ - 1; + imageY >= (offsetZ > 0 ? 32 * multi - offsetZ : 0); imageY--) { + for (int imageX = 0; imageX < 32 * multi; imageX++) { + color24 = getPixelColor(true, true, true, true, nether, netherPlayerInOpen, caves, this.world, + multi, startX, startZ, imageX, imageY); + this.map[this.zoom].setRGB(imageX, imageY, color24); + } + } + for (int imageY = 32 * multi - 1; imageY >= 0; imageY--) { + for (int imageX = offsetX > 0 ? 32 * multi - offsetX : 0; + imageX < (offsetX > 0 ? 32 * multi : -offsetX); imageX++) { + color24 = getPixelColor(true, true, true, true, nether, netherPlayerInOpen, caves, this.world, + multi, startX, startZ, imageX, imageY); + this.map[this.zoom].setRGB(imageX, imageY, color24); + } + } + } + if ((full) || ((this.options.heightmap) && (needHeightMap)) || (needHeightAndID) || + ((this.options.lightmap) && (needLight)) || (skyColorChanged)) { + for (int imageY = 32 * multi - 1; imageY >= 0; imageY--) { + for (int imageX = 0; imageX < 32 * multi; imageX++) { + color24 = getPixelColor(full, (full) || (needHeightAndID), full, + (full) || (needLight) || (needHeightAndID), nether, netherPlayerInOpen, caves, this.world, + multi, startX, startZ, imageX, imageY); + this.map[this.zoom].setRGB(imageX, imageY, color24); + } + } + } + if (((full) || (offsetX != 0) || (offsetZ != 0) || (!this.lastFullscreen)) && (this.fullscreenMap) && + (this.options.biomeOverlay > 0)) { + this.mapData[this.zoom].segmentBiomes(); + this.mapData[this.zoom].findCenterOfSegments(); + } + this.lastFullscreen = this.fullscreenMap; + if ((full) || (offsetX != 0) || (offsetZ != 0) || (needHeightMap) || (needLight) || (skyColorChanged)) { + this.imageChanged = true; + } + } + + public void chunkCalc(Chunk chunk) { + this.master.getNotifier().chunkChanged(chunk); + rectangleCalc(chunk.xPosition * 16, chunk.zPosition * 16, chunk.xPosition * 16 + 15, chunk.zPosition * 16 + + 15); + } + + private void rectangleCalc(int left, int top, int right, int bottom) { + boolean nether = false; + boolean caves = false; + boolean netherPlayerInOpen = false; + if (this.game.thePlayer.dimension != -1) { + caves = (this.options.cavesAllowed.booleanValue()) && (this.options.showCaves) && + (this.world.getChunkFromBlockCoords(this.lastX, this.lastZ) + .getSavedLightValue(EnumSkyBlock.Sky, this.lastX & 0xF, + Math.max(Math.min(GameVariableAccessShim.yCoord(), 255), 0), this.lastZ & 0xF) <= + 0); + } else { + nether = true; + netherPlayerInOpen = this.world.getHeightValue(this.lastX, this.lastZ) < GameVariableAccessShim.yCoord(); + } + int startX = this.lastX; + int startZ = this.lastZ; + int multi = (int) Math.pow(2.0D, this.zoom); + startX -= 16 * multi; + startZ -= 16 * multi; + + left = left - startX - 1; + right = right - startX + 1; + top = top - startZ - 1; + bottom = bottom - startZ + 1; + + left = Math.max(0, left); + right = Math.min(32 * multi - 1, right); + top = Math.max(0, top); + bottom = Math.min(32 * multi - 1, bottom); + + int color24 = 0; + for (int imageY = bottom; imageY >= top; imageY--) { + for (int imageX = left; imageX <= right; imageX++) { + color24 = getPixelColor(true, true, true, true, nether, netherPlayerInOpen, caves, this.world, multi, + startX, startZ, imageX, imageY); + this.map[this.zoom].setRGB(imageX, imageY, color24); + } + } + this.imageChanged = true; + } + + private int getPixelColor(boolean needBiome, boolean needHeightAndID, boolean needTint, boolean needLight, + boolean nether, boolean netherPlayerInOpen, boolean caves, World world, int multi, + int startX, int startZ, int imageX, int imageY) { + int color24 = 0; + int biomeID = 0; + if (needBiome) { + if (world.getChunkFromBlockCoords(startX + imageX, startZ + imageY).isChunkLoaded) { + biomeID = world.getBiomeGenForCoords(startX + imageX, startZ + imageY).biomeID; + } else { + biomeID = -1; + } + this.mapData[this.zoom].setBiomeID(imageX, imageY, biomeID); + } else { + biomeID = this.mapData[this.zoom].getBiomeID(imageX, imageY); + } + if (this.options.biomeOverlay == 1) { + if (biomeID >= 0) { + color24 = BiomeGenBase.getBiomeGenArray()[biomeID].color | 0xFF000000; + } else { + color24 = 0; + } + if ((this.options.chunkGrid) && ( + ((startX + imageX) % 16 == 0) || ((startZ + imageY) % 16 == 0))) { + color24 = this.colorManager.colorAdder(2097152000, color24); + } + return color24; + } + int height = 0; + boolean blockChangeForcedTint = false; + boolean solid = false; + if (needHeightAndID) { + height = getBlockHeight(nether, netherPlayerInOpen, caves, world, startX + imageX, startZ + imageY, + GameVariableAccessShim.yCoord()); + + this.mapData[this.zoom].setHeight(imageX, imageY, height); + } else { + height = this.mapData[this.zoom].getHeight(imageX, imageY); + } + if (height == -1) { + height = this.lastY + 1; + solid = true; + } + int blockID = -1; + int metadata = 0; + if (needHeightAndID) { + Block blockAbove = world.getBlock(startX + imageX, height, startZ + imageY); + if (blockAbove.getMaterial() == Material.field_151597_y) { + blockID = Block.blockRegistry.getIDForObject(blockAbove); + metadata = world.getBlockMetadata(startX + imageX, height, startZ + imageY); + } else { + Block block = world.getBlock(startX + imageX, height - 1, startZ + imageY); + blockID = Block.blockRegistry.getIDForObject(block); + metadata = world.getBlockMetadata(startX + imageX, height - 1, startZ + imageY); + } + if ((this.options.biomes) && (blockID != this.mapData[this.zoom].getMaterial(imageX, imageY))) { + blockChangeForcedTint = true; + } + this.mapData[this.zoom].setMaterial(imageX, imageY, blockID); + this.mapData[this.zoom].setMetadata(imageX, imageY, metadata); + } else { + blockID = this.mapData[this.zoom].getMaterial(imageX, imageY); + metadata = this.mapData[this.zoom].getMetadata(imageX, imageY); + } + if (blockID == BlockIDRepository.lavaID) { + solid = false; + } + if (this.options.biomes) { + color24 = this.colorManager.getBlockColor(blockID, metadata, biomeID); + } else { + color24 = this.colorManager.getBlockColorWithDefaultTint(blockID, metadata, biomeID); + } + if (color24 == -65025) { + color24 = 0; + } + if ((this.options.biomes) && (blockID != -1)) { + int tint = -1; + if ((needTint) || (blockChangeForcedTint)) { + tint = getBiomeTint(blockID, metadata, startX + imageX, height - 1, startZ + imageY); + this.mapData[this.zoom].setBiomeTint(imageX, imageY, tint); + } else { + tint = this.mapData[this.zoom].getBiomeTint(imageX, imageY); + } + if (tint != -1) { + color24 = this.colorManager.colorMultiplier(color24, tint); + } + } + color24 = applyHeight(color24, nether, netherPlayerInOpen, caves, world, multi, startX, startZ, imageX, imageY, + height, solid, 1); + + int light = solid ? 0 : 255; + if (needLight) { + light = getLight(color24, blockID, world, startX + imageX, startZ + imageY, height, solid); + this.mapData[this.zoom].setLight(imageX, imageY, light); + } else { + light = this.mapData[this.zoom].getLight(imageX, imageY); + } + if (light == 0) { + color24 = 0; + } else if (light != 255) { + color24 = this.colorManager.colorMultiplier(color24, light); + } + if (this.options.waterTransparency) { + Material material = ((Block) Block.blockRegistry.getObjectForID(blockID)).getMaterial(); + if ((material == Material.water) || (material == Material.ice)) { + int seafloorHeight; + if (needHeightAndID) { + seafloorHeight = getSeafloorHeight(world, startX + imageX, startZ + imageY, height); + this.mapData[this.zoom].setOceanFloorHeight(imageX, imageY, seafloorHeight); + } else { + seafloorHeight = this.mapData[this.zoom].getOceanFloorHeight(imageX, imageY); + } + int seafloorColor = 0; + if (needHeightAndID) { + Block block = world.getBlock(startX + imageX, seafloorHeight - 1, startZ + imageY); + blockID = Block.blockRegistry.getIDForObject(block); + metadata = world.getBlockMetadata(startX + imageX, seafloorHeight - 1, startZ + imageY); + if (block.getMaterial() == Material.water) { + blockID = BlockIDRepository.airID; + metadata = 0; + } + if ((this.options.biomes) && + (blockID != this.mapData[this.zoom].getOceanFloorMaterial(imageX, imageY))) { + blockChangeForcedTint = true; + } + this.mapData[this.zoom].setOceanFloorMaterial(imageX, imageY, blockID); + this.mapData[this.zoom].setOceanFloorMetadata(imageX, imageY, metadata); + } else { + blockID = this.mapData[this.zoom].getOceanFloorMaterial(imageX, imageY); + metadata = this.mapData[this.zoom].getOceanFloorMetadata(imageX, imageY); + } + if (this.options.biomes) { + seafloorColor = this.colorManager.getBlockColor(blockID, metadata, biomeID); + } else { + seafloorColor = this.colorManager.getBlockColorWithDefaultTint(blockID, metadata, biomeID); + } + if ((this.options.biomes) && (blockID != -1)) { + int tint = -1; + if ((needTint) || (blockChangeForcedTint)) { + tint = getBiomeTint(blockID, metadata, startX + imageX, seafloorHeight - 1, startZ + imageY); + this.mapData[this.zoom].setOceanFloorBiomeTint(imageX, imageY, tint); + } else { + tint = this.mapData[this.zoom].getOceanFloorBiomeTint(imageX, imageY); + } + if (tint != -1) { + seafloorColor = this.colorManager.colorMultiplier(seafloorColor, tint); + } + } + seafloorColor = applyHeight(seafloorColor, nether, netherPlayerInOpen, caves, world, multi, startX, + startZ, imageX, imageY, seafloorHeight, solid, 0); + int seafloorLight = 255; + if (needLight) { + seafloorLight = getLight(seafloorColor, blockID, world, startX + imageX, startZ + imageY, + seafloorHeight, solid); + if ((this.options.lightmap) && (material == Material.ice) && ((seafloorHeight == height - 1) || + (world.getBlock(startX + imageX, + seafloorHeight, + startZ + imageY) + .getMaterial() == + Material.ice))) { + seafloorLight = this.colorManager.colorMultiplier(seafloorLight, 5592405); + } + this.mapData[this.zoom].setOceanFloorLight(imageX, imageY, seafloorLight); + } else { + seafloorLight = this.mapData[this.zoom].getOceanFloorLight(imageX, imageY); + } + if (seafloorLight == 0) { + seafloorColor = 0; + } else if (seafloorLight != 255) { + seafloorColor = this.colorManager.colorMultiplier(seafloorColor, seafloorLight); + } + color24 = this.colorManager.colorAdder(color24, seafloorColor); + } + } + if (this.options.blockTransparency) { + int transparentHeight = -1; + if (needHeightAndID) { + transparentHeight = getTransparentHeight(nether, netherPlayerInOpen, caves, world, startX + imageX, + startZ + imageY, height); + this.mapData[this.zoom].setTransparentHeight(imageX, imageY, transparentHeight); + } else { + transparentHeight = this.mapData[this.zoom].getTransparentHeight(imageX, imageY); + } + if (needHeightAndID) { + if ((transparentHeight != -1) && (transparentHeight > height)) { + Block block = world.getBlock(startX + imageX, transparentHeight - 1, startZ + imageY); + blockID = Block.blockRegistry.getIDForObject(block); + metadata = world.getBlockMetadata(startX + imageX, transparentHeight - 1, startZ + imageY); + } else { + blockID = 0; + metadata = 0; + } + if ((this.options.biomes) && (blockID != this.mapData[this.zoom].getTransparentId(imageX, imageY))) { + blockChangeForcedTint = true; + } + this.mapData[this.zoom].setTransparentId(imageX, imageY, blockID); + this.mapData[this.zoom].setTransparentMetadata(imageX, imageY, metadata); + } else { + blockID = this.mapData[this.zoom].getTransparentId(imageX, imageY); + metadata = this.mapData[this.zoom].getTransparentMetadata(imageX, imageY); + } + if (blockID != 0) { + int transparentColor = 0; + if (this.options.biomes) { + transparentColor = this.colorManager.getBlockColor(blockID, metadata, biomeID); + } else { + transparentColor = this.colorManager.getBlockColorWithDefaultTint(blockID, metadata, biomeID); + } + if (this.options.biomes) { + int tint = -1; + if ((needTint) || (blockChangeForcedTint)) { + tint = getBiomeTint(blockID, metadata, startX + imageX, height, startZ + imageY); + this.mapData[this.zoom].setTransparentBiomeTint(imageX, imageY, tint); + } else { + tint = this.mapData[this.zoom].getTransparentBiomeTint(imageX, imageY); + } + if (tint != -1) { + transparentColor = this.colorManager.colorMultiplier(transparentColor, tint); + } + } + transparentColor = applyHeight(transparentColor, nether, netherPlayerInOpen, caves, world, multi, + startX, startZ, imageX, imageY, transparentHeight, solid, 2); + int transparentLight = 255; + if (needLight) { + transparentLight = getLight(transparentColor, blockID, world, startX + imageX, startZ + imageY, + transparentHeight, solid); + this.mapData[this.zoom].setTransparentLight(imageX, imageY, transparentLight); + } else { + transparentLight = this.mapData[this.zoom].getTransparentLight(imageX, imageY); + } + if (transparentLight == 0) { + transparentColor = 0; + } else if (transparentLight != 255) { + transparentColor = this.colorManager.colorMultiplier(transparentColor, transparentLight); + } + color24 = this.colorManager.colorAdder(transparentColor, color24); + } + } + if (this.options.biomeOverlay == 2) { + int bc = 0; + if (biomeID >= 0) { + bc = BiomeGenBase.getBiomeGenArray()[biomeID].color; + } + int red1 = bc >> 16 & 0xFF; + int green1 = bc >> 8 & 0xFF; + int blue1 = bc >> 0 & 0xFF; + bc = 0x7F000000 | (red1 & 0xFF) << 16 | (green1 & 0xFF) << 8 | blue1 & 0xFF; + color24 = this.colorManager.colorAdder(bc, color24); + } + if ((this.options.chunkGrid) && ( + ((startX + imageX) % 16 == 0) || ((startZ + imageY) % 16 == 0))) { + color24 = this.colorManager.colorAdder(2097152000, color24); + } + return color24; + } + + private int getBiomeTint(int id, int metadata, int x, int y, int z) { + int tint = -1; + if (this.colorManager.isOptifineInstalled()) { + try { + Integer[] tints = this.colorManager.getBlockTintTables().get(id + " " + metadata); + if (tints != null) { + int r = 0; + int g = 0; + int b = 0; + for (int t = -1; t <= 1; t++) { + for (int s = -1; s <= 1; s++) { + int biomeTint = tints[this.world.getBiomeGenForCoords(x + s, z + t).biomeID].intValue(); + r += ((biomeTint & 0xFF0000) >> 16); + g += ((biomeTint & 0xFF00) >> 8); + b += (biomeTint & 0xFF); + } + } + tint = 0xFF000000 | (r / 9 & 0xFF) << 16 | (g / 9 & 0xFF) << 8 | b / 9 & 0xFF; + } else { + tint = getBuiltInBiomeTint(id, metadata, x, y, z); + } + } catch (Exception e) { + tint = getBuiltInBiomeTint(id, metadata, x, y, z); + } + } else { + tint = getBuiltInBiomeTint(id, metadata, x, y, z); + } + return tint; + } + + private int getBuiltInBiomeTint(int id, int metadata, int x, int y, int z) { + int tint = -1; + if ((id == BlockIDRepository.grassID) || (id == BlockIDRepository.leavesID) || + (id == BlockIDRepository.leaves2ID) || (id == BlockIDRepository.tallGrassID) || + (id == BlockIDRepository.vineID) || (id == BlockIDRepository.tallFlowerID) || + (id == BlockIDRepository.waterID) || (id == BlockIDRepository.flowingWaterID) || + (this.colorManager.getBiomeTintsAvailable().contains(Integer.valueOf(id)))) { + tint = ((Block) Block.blockRegistry.getObjectForID(id)).colorMultiplier(this.world, x, y, z) | 0xFF000000; + } + return tint; + } + + private final int getBlockHeight(boolean nether, boolean netherPlayerInOpen, boolean caves, World world, int x, + int z, int starty) { + int height = world.getHeightValue(x, z); + if (((!nether) && (!caves)) || (height < starty) || + ((nether) && (starty > 125) && ((!this.options.showCaves) || (netherPlayerInOpen)))) { + int transHeight = world.getPrecipitationHeight(x, z); + if (transHeight != height) { + Block block = world.getBlock(x, transHeight - 1, z); + if (block.getMaterial() == Material.lava) { + height = transHeight; + } + } + int heightCheck = (height >> 4) * 16 + 15; + while (heightCheck < this.worldHeight) { + Block block = world.getBlock(x, heightCheck, z); + if (block.getLightOpacity() > 0) { + height = heightCheck + 1; + } + heightCheck += 16; + } + return height; + } + int y = this.lastY; + + Block block = world.getBlock(x, y, z); + if ((block.getLightOpacity() == 0) && (block.getMaterial() != Material.lava)) { + while (y > 0) { + y--; + block = world.getBlock(x, y, z); + if ((block.getLightOpacity() > 0) || (block.getMaterial() == Material.lava)) { + return y + 1; + } + } + return y; + } + while (y <= starty + 10) { + if (y < ((nether) && (starty < 126) ? 127 : 255)) { + y++; + block = world.getBlock(x, y, z); + if ((block.getLightOpacity() == 0) && (block.getMaterial() != Material.lava)) { + return y; + } + } + } + return -1; + } + + private final int getSeafloorHeight(World world, int x, int z, int height) { + int seafloorHeight = height; + Block block = world.getBlock(x, seafloorHeight - 1, z); + while ((block.getLightOpacity() < 5) && (block.getMaterial() != Material.leaves) && (seafloorHeight > 1)) { + seafloorHeight--; + block = world.getBlock(x, seafloorHeight - 1, z); + } + return seafloorHeight; + } + + private final int getTransparentHeight(boolean nether, boolean netherPlayerInOpen, boolean caves, World world, + int x, int z, int height) { + int transHeight = -1; + if (((caves) || (nether)) && + ((!nether) || (height <= 125) || ((this.options.showCaves) && (!netherPlayerInOpen)))) { + transHeight = height + 1; + } else { + int precipHeight = world.getPrecipitationHeight(x, z); + if (precipHeight <= height) { + transHeight = height + 1; + } else { + transHeight = precipHeight; + } + } + Material material = world.getBlock(x, transHeight - 1, z).getMaterial(); + if ((material == Material.field_151597_y) || (material == Material.air)) { + transHeight = -1; + } + return transHeight; + } + + private int applyHeight(int color24, boolean nether, boolean netherPlayerInOpen, boolean caves, World world, + int multi, int startX, int startZ, int imageX, int imageY, int height, boolean solid, + int layer) { + if ((color24 != this.colorManager.getAirColor()) && (color24 != 0)) { + int heightComp = 0; + if (((this.options.heightmap) || (this.options.slopemap)) && (!solid)) { + int diff = 0; + double sc = 0.0D; + if (this.options.slopemap) { + if ((imageX > 0) && (imageY < 32 * multi - 1)) { + if (layer == 0) { + heightComp = this.mapData[this.zoom].getOceanFloorHeight(imageX - 1, imageY + 1); + } + if (layer == 1) { + heightComp = this.mapData[this.zoom].getHeight(imageX - 1, imageY + 1); + } + if (layer == 2) { + heightComp = this.mapData[this.zoom].getTransparentHeight(imageX - 1, imageY + 1); + if (heightComp == -1) { + Block block = Block + .getBlockById(this.mapData[this.zoom].getTransparentId(imageX, imageY)); + if (((block instanceof BlockGlass)) || ((block instanceof BlockStainedGlass))) { + heightComp = this.mapData[this.zoom].getHeight(imageX - 1, imageY + 1); + } + } + } + } else { + if (layer == 0) { + int baseHeight = getBlockHeight(nether, netherPlayerInOpen, caves, world, + startX + imageX - 1, startZ + imageY + 1, this.lastY); + heightComp = getSeafloorHeight(world, startX + imageX - 1, startZ + imageY + 1, + baseHeight); + } + if (layer == 1) { + heightComp = getBlockHeight(nether, netherPlayerInOpen, caves, world, startX + imageX - 1, + startZ + imageY + 1, this.lastY); + } + if (layer == 2) { + int baseHeight = getBlockHeight(nether, netherPlayerInOpen, caves, world, + startX + imageX - 1, startZ + imageY + 1, this.lastY); + heightComp = getTransparentHeight(nether, netherPlayerInOpen, caves, world, + startX + imageX - 1, startZ + imageY + 1, baseHeight); + if (heightComp == -1) { + Block block = world.getBlock(startX + imageX, height - 1, startZ + imageY); + if (((block instanceof BlockGlass)) || ((block instanceof BlockStainedGlass))) { + heightComp = baseHeight; + } + } + } + } + if (heightComp == -1) { + heightComp = height; + } + diff = heightComp - height; + if (diff != 0) { + sc = diff < 0 ? -1.0D : diff > 0 ? 1.0D : 0.0D; + sc /= 8.0D; + } + if (this.options.heightmap) { + diff = height - this.lastY; + double heightsc = Math.log10(Math.abs(diff) / 8.0D + 1.0D) / 3.0D; + sc = diff > 0 ? sc + heightsc : sc - heightsc; + } + } else if (this.options.heightmap) { + diff = height - this.lastY; + + sc = Math.log10(Math.abs(diff) / 8.0D + 1.0D) / 1.8D; + if (diff < 0) { + sc = 0.0D - sc; + } + } + int alpha = color24 >> 24 & 0xFF; + int r = color24 >> 16 & 0xFF; + int g = color24 >> 8 & 0xFF; + int b = color24 >> 0 & 0xFF; + if (sc > 0.0D) { + r = (int) (sc * (255 - r)) + r; + g = (int) (sc * (255 - g)) + g; + b = (int) (sc * (255 - b)) + b; + } else if (sc < 0.0D) { + sc = Math.abs(sc); + r -= (int) (sc * r); + g -= (int) (sc * g); + b -= (int) (sc * b); + } + color24 = alpha * 16777216 + r * 65536 + g * 256 + b; + } + } + return color24; + } + + private int getLight(int color24, int blockID, World world, int x, int z, int height, boolean solid) { + int i3 = 255; + if (solid) { + i3 = 0; + } else if ((color24 != this.colorManager.getAirColor()) && (color24 != 0) && + (this.options.lightmap) || (Boolean) CheatBreaker.getInstance().getGlobalSettings().enableFpsBoost.getValue() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().fullBright.getValue()) { + Chunk chunk = world.getChunkFromBlockCoords(x, z); + int blockLight = chunk + .getSavedLightValue(EnumSkyBlock.Block, x & 0xF, Math.max(Math.min(height, 255), 0), z & 0xF); + int skyLight = chunk + .getSavedLightValue(EnumSkyBlock.Sky, x & 0xF, Math.max(Math.min(height, 255), 0), z & 0xF); + if ((blockID == BlockIDRepository.lavaID) && (blockLight < 14)) { + blockLight = 14; + } + i3 = this.lightmapColors[(blockLight + skyLight * 16)]; + } + return i3; + } + + private void renderMap(int x, int y, int scScale) { + boolean scaleChanged = (this.scScale != scScale) || (this.options.squareMap != this.lastSquareMap); + this.scScale = scScale; + this.lastSquareMap = this.options.squareMap; + if (GLUtils.hasAlphaBits) { + GL11.glColorMask(false, false, false, true); + + GL11.glBindTexture(3553, 0); + GL11.glBlendFunc(0, 0); + GL11.glColor3f(0.0F, 0.0F, 255.0F); + + GL11.glBegin(7); + GL11.glVertex2f(x - 47, y + 47); + GL11.glVertex2f(x + 47, y + 47); + GL11.glVertex2f(x + 47, y - 47); + GL11.glVertex2f(x - 47, y - 47); + GL11.glEnd(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GL11.glColorMask(true, true, true, true); + GL11.glBlendFunc(770, 771); + GLUtils.img(new ResourceLocation( + "voxelmap/" + (this.options.squareMap ? "images/square.png" : "images/circle.png"))); + GLUtils.drawPre(); + GLUtils.setMap(x, y); + GLUtils.drawPost(); + + GL11.glColorMask(true, true, true, true); + GL11.glBlendFunc(772, 773); + synchronized (this.coordinateLock) { + if (this.imageChanged) { + this.imageChanged = false; + this.map[this.zoom].write(); + this.lastImageX = this.lastX; + this.lastImageZ = this.lastZ; + } + } + float multi = 2.0F / (float) Math.pow(2.0D, this.zoom); + this.percentX = ((float) (GameVariableAccessShim.xCoordDouble() - this.lastImageX)); + this.percentY = ((float) (GameVariableAccessShim.zCoordDouble() - this.lastImageZ)); + this.percentX *= multi; + this.percentY *= multi; + if (this.zoom == 3) { + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + GLUtils.disp(this.map[this.zoom].index); + GL11.glPopMatrix(); + } else { + GLUtils.disp(this.map[this.zoom].index); + } + GL11.glPushMatrix(); + GL11.glTranslatef(x, y, 0.0F); + GL11.glRotatef(this.options.squareMap ? this.northRotate : -this.direction + this.northRotate, 0.0F, 0.0F, + 1.0F); + GL11.glTranslatef(-x, -y, 0.0F); + + GL11.glTranslatef(-this.percentX, -this.percentY, 0.0F); + if (this.options.filtering) { + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + } + } else if (GLUtils.fboEnabled) { + GL11.glBindTexture(3553, 0); + + GL11.glPushAttrib(22528); + GL11.glViewport(0, 0, 256, 256); + GL11.glMatrixMode(5889); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, 256.0D, 256.0D, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + + GLUtils.bindFrameBuffer(); + + GL11.glDepthMask(false); + GL11.glDisable(2929); + if (scaleChanged) { + GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F); + GL11.glClear(16384); + } + GL11.glBlendFunc(770, 0); + GLUtils.img(new ResourceLocation( + "voxelmap/" + (this.options.squareMap ? "images/square.png" : "images/circle.png"))); + GLUtils.drawPre(); + GLUtils.ldrawthree(0.0D, 256.0D, 1.0D, 0.0D, 0.0D); + GLUtils.ldrawthree(256.0D, 256.0D, 1.0D, 1.0D, 0.0D); + GLUtils.ldrawthree(256.0D, 0.0D, 1.0D, 1.0D, 1.0D); + GLUtils.ldrawthree(0.0D, 0.0D, 1.0D, 0.0D, 1.0D); + GLUtils.drawPost(); + + GL14.glBlendFuncSeparate(1, 0, 774, 0); + synchronized (this.coordinateLock) { + if (this.imageChanged) { + this.imageChanged = false; + this.map[this.zoom].write(); + this.lastImageX = this.lastX; + this.lastImageZ = this.lastZ; + } + } + float multi = 2.0F / (float) Math.pow(2.0D, this.zoom); + this.percentX = ((float) (GameVariableAccessShim.xCoordDouble() - this.lastImageX)); + this.percentY = ((float) (GameVariableAccessShim.zCoordDouble() - this.lastImageZ)); + this.percentX *= multi; + this.percentY *= multi; + if (this.zoom == 3) { + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + GLUtils.disp(this.map[this.zoom].index); + GL11.glPopMatrix(); + } else { + GLUtils.disp(this.map[this.zoom].index); + } + if (this.options.filtering) { + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + } + GL11.glTranslatef(128.0F, 128.0F, 0.0F); + if (this.options.squareMap) { + GL11.glRotatef(-this.northRotate, 0.0F, 0.0F, 1.0F); + } else { + GL11.glRotatef(this.direction - this.northRotate, 0.0F, 0.0F, 1.0F); + } + GL11.glTranslatef(-128.0F, -128.0F, 0.0F); + + GL11.glTranslatef(-this.percentX * 4.0F, this.percentY * 4.0F, 0.0F); + + GLUtils.drawPre(); + + GLUtils.ldrawthree(0.0D, 256.0D, 1.0D, 0.0D, 0.0D); + GLUtils.ldrawthree(256.0D, 256.0D, 1.0D, 1.0D, 0.0D); + GLUtils.ldrawthree(256.0D, 0.0D, 1.0D, 1.0D, 1.0D); + GLUtils.ldrawthree(0.0D, 0.0D, 1.0D, 0.0D, 1.0D); + GLUtils.drawPost(); + + GL11.glDepthMask(true); + GL11.glEnable(2929); + + GLUtils.unbindFrameBuffer(); + + GL11.glMatrixMode(5889); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glPopMatrix(); + GL11.glPopAttrib(); + + GL11.glPushMatrix(); + GL11.glBlendFunc(770, 0); + GL11.glEnable(3008); + GLUtils.disp(GLUtils.fboTextureID); + } else { + if (this.options.squareMap) { + if ((this.options.filtering) && (this.zoom == 0)) { + if (this.lastPercentXOver != this.percentX > 1.0F) { + this.lastPercentXOver = (this.percentX > 1.0F); + this.imageChanged = true; + } + } + if ((this.options.filtering) && (this.zoom == 0)) { + if (this.lastPercentYOver != this.percentY > 1.0F) { + this.lastPercentYOver = (this.percentY > 1.0F); + this.imageChanged = true; + } + } + } + if (this.imageChanged) { + this.imageChanged = false; + if (this.options.squareMap) { + synchronized (this.coordinateLock) { + this.map[this.zoom].write(); + this.lastImageX = this.lastX; + this.lastImageZ = this.lastZ; + } + } else { + int diameter = this.map[this.zoom].getWidth(); + if (this.roundImage != null) { + this.roundImage.baleet(); + } + this.roundImage = new GLBufferedImage(diameter, diameter, 6); + Ellipse2D.Double ellipse = new Ellipse2D.Double(this.zoom * 10 / 6, this.zoom * 10 / 6, + diameter - this.zoom * 2, diameter - this.zoom * 2); + + Graphics2D gfx = this.roundImage.createGraphics(); + gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + gfx.setClip(ellipse); + gfx.setColor(new Color(0.1F, 0.0F, 0.0F, 0.1F)); + gfx.fillRect(0, 0, diameter, diameter); + synchronized (this.coordinateLock) { + gfx.drawImage(this.map[this.zoom], 0, 0, null); + this.lastImageX = this.lastX; + this.lastImageZ = this.lastZ; + } + gfx.dispose(); + this.roundImage.write(); + } + } + float multi = 2.0F / (float) Math.pow(2.0D, this.zoom); + this.percentX = ((float) (GameVariableAccessShim.xCoordDouble() - this.lastImageX)); + this.percentY = ((float) (GameVariableAccessShim.zCoordDouble() - this.lastImageZ)); + this.percentX *= multi; + this.percentY *= multi; + GL11.glBlendFunc(770, 0); + if (this.zoom == 3) { + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + GLUtils.disp(this.options.squareMap ? this.map[this.zoom].index : this.roundImage.index); + GL11.glPopMatrix(); + } else { + GLUtils.disp(this.options.squareMap ? this.map[this.zoom].index : this.roundImage.index); + } + if (this.options.filtering) { + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + } + GL11.glPushMatrix(); + GL11.glTranslatef(x, y, 0.0F); + GL11.glRotatef(this.options.squareMap ? this.northRotate : -this.direction + this.northRotate, 0.0F, 0.0F, + 1.0F); + GL11.glTranslatef(-x, -y, 0.0F); + + GL11.glTranslatef(-this.percentX, -this.percentY, 0.0F); + } + GLUtils.drawPre(); + GLUtils.setMap(x, y); + GLUtils.drawPost(); + + GL11.glPopMatrix(); + GL11.glBlendFunc(770, 771); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + if (this.options.squareMap) { + drawSquareMapFrame(x, y); + } else { + drawRoundMapFrame(x, y); + } + double lastXDouble = GameVariableAccessShim.xCoordDouble(); + double lastZDouble = GameVariableAccessShim.zCoordDouble(); + for (Waypoint pt : this.waypointManager.getWaypoints()) { + if (pt.isActive()) { + double wayX = lastXDouble - pt.getX() - 0.5D; + double wayY = lastZDouble - pt.getZ() - 0.5D; + float locate = (float) Math.toDegrees(Math.atan2(wayX, wayY)); + double hypot = Math.sqrt(wayX * wayX + wayY * wayY); + boolean far = false; + if (this.options.squareMap) { + far = (Math.abs(wayX) / (Math.pow(2.0D, this.zoom) / 2.0D) > 28.5D) || + (Math.abs(wayY) / (Math.pow(2.0D, this.zoom) / 2.0D) > 28.5D); + if (far) { + hypot = hypot / Math.max(Math.abs(wayX), Math.abs(wayY)) * 30.0D; + } else { + hypot /= Math.pow(2.0D, this.zoom) / 2.0D; + } + } else { + locate += this.direction; + hypot /= Math.pow(2.0D, this.zoom) / 2.0D; + far = hypot >= 31.0D; + if (far) { + hypot = 34.0D; + } + } + if (far) { + try { + GL11.glPushMatrix(); + GL11.glColor3f(pt.red, pt.green, pt.blue); + if (scScale >= 3) { + GLUtils.img(new ResourceLocation("voxelmap/images/marker" + pt.imageSuffix + ".png")); + } else { + GLUtils.img(new ResourceLocation("voxelmap/images/marker" + pt.imageSuffix + "Small.png")); + } + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glTranslatef(x, y, 0.0F); + GL11.glRotatef(-locate + this.northRotate, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-x, -y, 0.0F); + GL11.glTranslated(0.0D, -hypot, 0.0D); + GLUtils.drawPre(); + GLUtils.setMap(x, y, 16); + GLUtils.drawPost(); + } catch (Exception localException) { + this.error = "Error: marker overlay not found!"; + } finally { + GL11.glPopMatrix(); + } + } else { + try { + GL11.glPushMatrix(); + GL11.glColor3f(pt.red, pt.green, pt.blue); + if (scScale >= 3) { + GLUtils.img(new ResourceLocation("voxelmap/images/waypoint" + pt.imageSuffix + ".png")); + } else { + GLUtils.img( + new ResourceLocation("voxelmap/images/waypoint" + pt.imageSuffix + "Small.png")); + } + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + + GL11.glRotatef(-locate + this.northRotate, 0.0F, 0.0F, 1.0F); + GL11.glTranslated(0.0D, -hypot, 0.0D); + GL11.glRotatef(-(-locate + this.northRotate), 0.0F, 0.0F, 1.0F); + + GLUtils.drawPre(); + GLUtils.setMap(x, y, 16); + GLUtils.drawPost(); + } catch (Exception localException) { + this.error = "Error: waypoint overlay not found!"; + } finally { + GL11.glPopMatrix(); + } + } + } + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + private void drawArrow(int x, int y) { + try { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glBlendFunc(770, 771); + GL11.glPushMatrix(); + + GLUtils.img(new ResourceLocation("voxelmap/images/mmarrow.png")); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glTranslatef(x, y, 0.0F); + GL11.glRotatef(this.direction, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-x, -y, 0.0F); + GLUtils.drawPre(); + GLUtils.setMap(x, y, 16); + GLUtils.drawPost(); + } catch (Exception localException) { + this.error = "Error: minimap arrow not found!"; + } finally { + GL11.glPopMatrix(); + } + } + + private void renderMapFull(int scWidth, int scHeight) { + synchronized (this.coordinateLock) { + if (this.imageChanged) { + this.imageChanged = false; + this.map[this.zoom].write(); + this.lastImageX = this.lastX; + this.lastImageZ = this.lastZ; + } + } + GLUtils.disp(this.map[this.zoom].index); + if (this.options.filtering) { + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + } + GL11.glPushMatrix(); + + GL11.glTranslatef(scWidth / 2.0F, scHeight / 2.0F, 0.0F); + GL11.glRotatef(this.northRotate, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-(scWidth / 2.0F), -(scHeight / 2.0F), 0.0F); + + GLUtils.drawPre(); + + int left = scWidth / 2 - 128; + int top = scHeight / 2 - 128; + GLUtils.ldrawone(left, top + 256, 67.0D, 0.0D, 1.0D); + GLUtils.ldrawone(left + 256, top + 256, 67.0D, 1.0D, 1.0D); + GLUtils.ldrawone(left + 256, top, 67.0D, 1.0D, 0.0D); + GLUtils.ldrawone(left, top, 67.0D, 0.0D, 0.0D); + GLUtils.drawPost(); + GL11.glPopMatrix(); + if (this.options.biomeOverlay > 0) { + int factor = (int) Math.pow(2.0D, 3 - this.zoom); + int minimumSize = (int) Math.pow(2.0D, this.zoom); + minimumSize *= minimumSize; + ArrayList labels = this.mapData[this.zoom].getBiomeLabels(); + GL11.glDisable(2929); + for (int t = 0; t < labels.size(); t++) { + MapData.BiomeLabel label = labels.get(t); + if (label.size > minimumSize) { + String name = BiomeGenBase.getBiomeGenArray()[label.biomeInt].biomeName; + int nameWidth = chkLen(name); + int x = label.x * factor; + int z = label.z * factor; + if (this.options.oldNorth) { + write(name, left + 256 - z - nameWidth / 2, top + x - 3, 16777215); + } else { + write(name, left + x - nameWidth / 2, top + z - 3, 16777215); + } + } + } + GL11.glEnable(2929); + } + } + + private void drawSquareMapFrame(int x, int y) { + try { + GLUtils.disp(this.colorManager.getMapImageInt()); + + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glTexParameteri(3553, 10242, 10496); + GL11.glTexParameteri(3553, 10243, 10496); + GLUtils.drawPre(); + GLUtils.setMap(x, y); + GLUtils.drawPost(); + } catch (Exception localException) { + this.error = "error: minimap overlay not found!"; + } + } + + private void drawRoundMapFrame(int x, int y) { + try { + GLUtils.img(new ResourceLocation("voxelmap/images/roundmap.png")); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GLUtils.drawPre(); + GLUtils.setMap(x, y); + GLUtils.drawPost(); + } catch (Exception localException) { + this.error = "Error: minimap overlay not found!"; + } + } + + private void drawDirections(int x, int y) { + float rotate; + float distance; + if (this.options.squareMap) { + rotate = -90.0F; + distance = 67.0F; + } else { + rotate = -this.direction - 90.0F; + distance = 64.0F; + } + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + GL11.glTranslated(distance * Math.sin(Math.toRadians(-(rotate - 90.0D))), + distance * Math.cos(Math.toRadians(-(rotate - 90.0D))), 0.0D); + write("N", x * 2 - 2, y * 2 - 4, 16777215); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + GL11.glTranslated(distance * Math.sin(Math.toRadians(-rotate)), distance * Math.cos(Math.toRadians(-rotate)), + 0.0D); + write("E", x * 2 - 2, y * 2 - 4, 16777215); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + GL11.glTranslated(distance * Math.sin(Math.toRadians(-(rotate + 90.0D))), + distance * Math.cos(Math.toRadians(-(rotate + 90.0D))), 0.0D); + write("S", x * 2 - 2, y * 2 - 4, 16777215); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + GL11.glTranslated(distance * Math.sin(Math.toRadians(-(rotate + 180.0D))), + distance * Math.cos(Math.toRadians(-(rotate + 180.0D))), 0.0D); + write("W", x * 2 - 2, y * 2 - 4, 16777215); + GL11.glPopMatrix(); + } + + private void showCoords(int x, int y) { + int textStart; + if (y > this.scHeight - 37 - 32 - 4 - 15) { + textStart = y - 32 - 4 - 9; + } else { + textStart = y + 32 + 4; + } + if ((!this.options.hide) && (!this.fullscreenMap)) { + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 1.0F); + String xy = ""; + + xy = dCoord(GameVariableAccessShim.xCoord()) + ", " + dCoord(GameVariableAccessShim.zCoord()); + int m = chkLen(xy) / 2; + write(xy, x * 2 - m, textStart * 2, 16777215); + xy = Integer.toString(GameVariableAccessShim.yCoord()); + m = chkLen(xy) / 2; + + write(xy, x * 2 - m, textStart * 2 + 10, 16777215); + if (this.ztimer > 0) { + m = chkLen(this.error) / 2; + write(this.error, x * 2 - m, textStart * 2 + 19, 16777215); + } + GL11.glPopMatrix(); + } else { + String stats = ""; + + stats = "(" + dCoord(GameVariableAccessShim.xCoord()) + ", " + GameVariableAccessShim.yCoord() + ", " + + dCoord(GameVariableAccessShim.zCoord()) + ") " + (int) this.direction + "'"; + int m = chkLen(stats) / 2; + write(stats, this.scWidth / 2 - m, 5, 16777215); + if (this.ztimer > 0) { + m = chkLen(this.error) / 2; + write(this.error, this.scWidth / 2 - m, 15, 16777215); + } + } + } + + private String dCoord(int paramInt1) { + if (paramInt1 < 0) { + return "-" + Math.abs(paramInt1); + } + if (paramInt1 > 0) { + return "+" + paramInt1; + } + return " " + paramInt1; + } + + private int chkLen(String paramStr) { + return this.fontRenderer.getStringWidth(paramStr); + } + + private void write(String paramStr, int paramInt1, int paramInt2, int paramInt3) { + this.fontRenderer.drawStringWithShadow(paramStr, paramInt1, paramInt2, paramInt3); + } + + public void setMenuNull() { + this.game.currentScreen = null; + } + + public Object getMenu() { + return this.game.currentScreen; + } + + private void showMenu(int scWidth, int scHeight) { + GL11.glBlendFunc(770, 771); + + int maxSize = 0; + int border = 2; + + String head = this.sMenu[0]; + int height; + for (height = 1; height < this.sMenu.length - 1; height++) { + if (chkLen(this.sMenu[height]) > maxSize) { + maxSize = chkLen(this.sMenu[height]); + } + } + int title = chkLen(head); + int centerX = (int) ((scWidth + 5) / 2.0D); + int centerY = (int) ((scHeight + 5) / 2.0D); + String hide = this.sMenu[(this.sMenu.length - 1)]; + int footer = chkLen(hide); + GL11.glDisable(3553); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.7F); + double leftX = centerX - title / 2.0D - border; + double rightX = centerX + title / 2.0D + border; + double topY = centerY - (height - 1) / 2.0D * 10.0D - border - 20.0D; + double botY = centerY - (height - 1) / 2.0D * 10.0D + border - 10.0D; + drawBox(leftX, rightX, topY, botY); + + leftX = centerX - maxSize / 2.0D - border; + rightX = centerX + maxSize / 2.0D + border; + topY = centerY - (height - 1) / 2.0D * 10.0D - border; + botY = centerY + (height - 1) / 2.0D * 10.0D + border; + drawBox(leftX, rightX, topY, botY); + leftX = centerX - footer / 2.0D - border; + rightX = centerX + footer / 2.0D + border; + topY = centerY + (height - 1) / 2.0D * 10.0D - border + 10.0D; + botY = centerY + (height - 1) / 2.0D * 10.0D + border + 20.0D; + drawBox(leftX, rightX, topY, botY); + + GL11.glEnable(3553); + write(head, centerX - title / 2, centerY - (height - 1) * 10 / 2 - 19, 16777215); + for (int n = 1; n < height; n++) { + write(this.sMenu[n], centerX - maxSize / 2, centerY - (height - 1) * 10 / 2 + n * 10 - 9, 16777215); + } + write(hide, centerX - footer / 2, (scHeight + 5) / 2 + (height - 1) * 10 / 2 + 11, 16777215); + } + + private void drawBox(double leftX, double rightX, double topY, double botY) { + GLUtils.drawPre(); + GLUtils.ldrawtwo(leftX, botY, 0.0D); + GLUtils.ldrawtwo(rightX, botY, 0.0D); + GLUtils.ldrawtwo(rightX, topY, 0.0D); + GLUtils.ldrawtwo(leftX, topY, 0.0D); + GLUtils.drawPost(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/MapSettingsManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/MapSettingsManager.java new file mode 100644 index 0000000..5d8ee1a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/MapSettingsManager.java @@ -0,0 +1,497 @@ +package com.thevoxelbox.voxelmap; + +import com.thevoxelbox.voxelmap.gui.overridden.EnumOptionsMinimap; +import com.thevoxelbox.voxelmap.util.ChatUtils; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.PrintWriter; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; + +public class MapSettingsManager { + public static MapSettingsManager instance; + public final int SORT_DATE = 1; + public final int SORT_NAME = 2; + public final int SORT_DISTANCE = 3; + public final int SORT_COLOR = 4; + public RadarSettingsManager radarOptions = null; + public boolean showUnderMenus; + public boolean hide = false; + public boolean waterTransparency = this.multicore; + public boolean blockTransparency = this.multicore; + public boolean squareMap = false; + public boolean showBeacons = true; + public boolean showWaypoints = true; + public int deathpoints = 1; + public int maxWaypointDisplayDistance = 1000; + public int zoom = 2; + public int sizeModifier = 0; + public int mapCorner = 1; + public Boolean radarAllowed = Boolean.valueOf(true); + public Boolean cavesAllowed = Boolean.valueOf(true); + public int sort = 1; + public boolean dlSafe = false; + public KeyBinding keyBindZoom = new KeyBinding("key.minimap.zoom", 44, "controls.minimap.title"); + public KeyBinding keyBindFullscreen = new KeyBinding("key.minimap.togglefullscreen", 45, "controls.minimap.title"); + public KeyBinding keyBindMenu = new KeyBinding("key.minimap.voxelmapmenu", 50, "controls.minimap.title"); + public KeyBinding keyBindWaypointMenu = new KeyBinding("key.minimap.waypointmenu", 0, "controls.minimap.title"); + public KeyBinding keyBindWaypoint = new KeyBinding("key.minimap.waypointhotkey", 48, "controls.minimap.title"); + public KeyBinding keyBindMobToggle = new KeyBinding("key.minimap.togglemobs", 0, "controls.minimap.title"); + public KeyBinding[] keyBindings; + public Minecraft game = null; + protected boolean coords = true; + protected boolean showCaves = true; + protected boolean lightmap = true; + protected boolean heightmap = this.multicore; + protected boolean slopemap = true; + protected boolean filtering = true; + protected boolean biomes = this.multicore; + protected int biomeOverlay = 0; + protected boolean chunkGrid = false; + protected boolean oldNorth = false; + protected boolean welcome = true; + protected int regularZoom = 2; + protected boolean realTimeTorches = false; + private File settingsFile; + private final int availableProcessors = Runtime.getRuntime().availableProcessors(); + public boolean multicore = this.availableProcessors > 0; + private boolean somethingChanged; + + public MapSettingsManager() { + instance = this; + this.game = Minecraft.getMinecraft(); + this.keyBindings = new KeyBinding[]{this.keyBindMenu, + this.keyBindWaypoint, + this.keyBindZoom, + this.keyBindFullscreen, + this.keyBindMobToggle}; + } + + public static String getKeyDisplayString(int par0) { + return par0 < 0 ? I18n.format("key.mouseButton", Integer.valueOf(par0 + 101)) : + Keyboard.getKeyName(par0); + } + + public void setRadarSettings(RadarSettingsManager radarSettings) { + this.radarOptions = radarSettings; + } + + public void loadAll() { + this.settingsFile = new File(this.game.mcDataDir, "mods/VoxelMods/voxelmap.properties"); + try { + if (this.settingsFile.exists()) { + BufferedReader in = new BufferedReader(new FileReader(this.settingsFile)); + String sCurrentLine; + while ((sCurrentLine = in.readLine()) != null) { + String[] curLine = sCurrentLine.split(":"); + if (curLine[0].equals("Zoom Level")) { + this.zoom = Integer.parseInt(curLine[1]); + } else if (curLine[0].equals("Hide Minimap")) { + this.hide = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Show Coordinates")) { + this.coords = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Enable Cave Mode")) { + this.showCaves = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Dynamic Lighting")) { + this.lightmap = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Height Map")) { + this.heightmap = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Slope Map")) { + this.slopemap = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Filtering")) { + this.filtering = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Water Transparency")) { + this.waterTransparency = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Block Transparency")) { + this.blockTransparency = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Biomes")) { + this.biomes = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Biome Overlay")) { + this.biomeOverlay = Integer.parseInt(curLine[1]); + } else if (curLine[0].equals("Chunk Grid")) { + this.chunkGrid = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Square Map")) { + this.squareMap = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Old North")) { + this.oldNorth = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Waypoint Beacons")) { + this.showBeacons = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Waypoint Signs")) { + this.showWaypoints = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Deathpoints")) { + this.deathpoints = Integer.parseInt(curLine[1]); + } else if (curLine[0].equals("Waypoint Max Distance")) { + this.maxWaypointDisplayDistance = Integer.parseInt(curLine[1]); + } else if (curLine[0].equals("Waypoint Sort By")) { + this.sort = Integer.parseInt(curLine[1]); + } else if (curLine[0].equals("Welcome Message")) { + this.welcome = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("World Download Compatibility")) { + this.dlSafe = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Real Time Torch Flicker")) { + this.realTimeTorches = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Map Corner")) { + this.mapCorner = Integer.parseInt(curLine[1]); + } else if (curLine[0].equals("Map Size")) { + this.sizeModifier = Integer.parseInt(curLine[1]); + } else if (curLine[0].equals("Zoom Key")) { + this.keyBindZoom.setKeyCode(Keyboard.getKeyIndex(curLine[1])); + } else if (curLine[0].equals("Fullscreen Key")) { + this.keyBindFullscreen.setKeyCode(Keyboard.getKeyIndex(curLine[1])); + } else if (curLine[0].equals("Menu Key")) { + this.keyBindMenu.setKeyCode(Keyboard.getKeyIndex(curLine[1])); + } else if (curLine[0].equals("Waypoint Key")) { + this.keyBindWaypoint.setKeyCode(Keyboard.getKeyIndex(curLine[1])); + } else if (curLine[0].equals("Mob Key")) { + this.keyBindMobToggle.setKeyCode(Keyboard.getKeyIndex(curLine[1])); + } + KeyBinding.resetKeyBindingArrayAndHash(); + } + if (this.radarOptions != null) { + this.radarOptions.loadSettings(this.settingsFile); + } + in.close(); + } + saveAll(); + } catch (Exception e) { + } + } + + public void saveAll() { + File settingsFileDir = new File(this.game.mcDataDir, "/mods/VoxelMods/"); + if (!settingsFileDir.exists()) { + settingsFileDir.mkdirs(); + } + this.settingsFile = new File(settingsFileDir, "voxelmap.properties"); + try { + PrintWriter out = new PrintWriter(new FileWriter(this.settingsFile)); + out.println("Zoom Level:" + this.zoom); + out.println("Hide Minimap:" + this.hide); + out.println("Show Coordinates:" + this.coords); + out.println("Enable Cave Mode:" + this.showCaves); + out.println("Dynamic Lighting:" + this.lightmap); + out.println("Height Map:" + this.heightmap); + out.println("Slope Map:" + this.slopemap); + out.println("Filtering:" + this.filtering); + out.println("Water Transparency:" + this.waterTransparency); + out.println("Block Transparency:" + this.blockTransparency); + out.println("Biomes:" + this.biomes); + out.println("Biome Overlay:" + this.biomeOverlay); + out.println("Chunk Grid:" + this.chunkGrid); + out.println("Square Map:" + this.squareMap); + out.println("Old North:" + this.oldNorth); + out.println("Waypoint Beacons:" + this.showBeacons); + out.println("Waypoint Signs:" + this.showWaypoints); + out.println("Deathpoints:" + this.deathpoints); + out.println("Waypoint Max Distance:" + this.maxWaypointDisplayDistance); + out.println("Waypoint Sort By:" + this.sort); + out.println("Welcome Message:" + this.welcome); + out.println("Map Corner:" + this.mapCorner); + out.println("Map Size:" + this.sizeModifier); + + out.println("Zoom Key:" + getKeyDisplayString(this.keyBindZoom.getKeyCode())); + out.println("Fullscreen Key:" + getKeyDisplayString(this.keyBindFullscreen.getKeyCode())); + out.println("Menu Key:" + getKeyDisplayString(this.keyBindMenu.getKeyCode())); + out.println("Waypoint Key:" + getKeyDisplayString(this.keyBindWaypoint.getKeyCode())); + out.println("Mob Key:" + getKeyDisplayString(this.keyBindMobToggle.getKeyCode())); + if (this.radarOptions != null) { + this.radarOptions.saveAll(out); + } + out.close(); + } catch (Exception local) { + ChatUtils.chatInfo(EnumChatFormatting.YELLOW + "Error Saving Settings " + local.getLocalizedMessage()); + } + } + + public String getKeyText(EnumOptionsMinimap par1EnumOptions) { + String s = I18nUtils.getString(par1EnumOptions.getEnumString()) + ": "; + if (par1EnumOptions.getEnumFloat()) { + float f = getOptionFloatValue(par1EnumOptions); + if (par1EnumOptions == EnumOptionsMinimap.ZOOM) { + return s + (int) f; + } + if (par1EnumOptions == EnumOptionsMinimap.WAYPOINTDISTANCE) { + if (f < 0.0F) { + return s + I18nUtils.getString("options.minimap.waypoints.infinite"); + } + return s + (int) f; + } + if (f == 0.0F) { + return s + I18nUtils.getString("options.off"); + } + return s + (int) f + "%"; + } + if (par1EnumOptions.getEnumBoolean()) { + boolean flag = getOptionBooleanValue(par1EnumOptions); + if (flag) { + return s + I18nUtils.getString("options.on"); + } + return s + I18nUtils.getString("options.off"); + } + if (par1EnumOptions.getEnumList()) { + String state = getOptionListValue(par1EnumOptions); + + return s + state; + } + return s; + } + + public float getOptionFloatValue(EnumOptionsMinimap par1EnumOptions) { + if (par1EnumOptions == EnumOptionsMinimap.ZOOM) { + return this.zoom; + } + if (par1EnumOptions == EnumOptionsMinimap.WAYPOINTDISTANCE) { + return this.maxWaypointDisplayDistance; + } + return 0.0F; + } + + public boolean getOptionBooleanValue(EnumOptionsMinimap par1EnumOptions) { + switch (par1EnumOptions) { + case COORDS: + return this.coords; + case HIDE: + return this.hide; + case CAVEMODE: + return (this.cavesAllowed.booleanValue()) && (this.showCaves); + case LIGHTING: + return this.lightmap; + case SQUARE: + return this.squareMap; + case OLDNORTH: + return this.oldNorth; + case WELCOME: + return this.welcome; + case FILTERING: + return this.filtering; + case WATERTRANSPARENCY: + return this.waterTransparency; + case BLOCKTRANSPARENCY: + return this.blockTransparency; + case BIOMES: + return this.biomes; + case CHUNKGRID: + return this.chunkGrid; + } + throw new IllegalArgumentException("Add code to handle EnumOptionMinimap: " + par1EnumOptions.getEnumString() + + ". (possibly not a boolean)"); + } + + public String getOptionListValue(EnumOptionsMinimap par1EnumOptions) { + switch (par1EnumOptions) { + case TERRAIN: + if ((this.slopemap) && (this.heightmap)) { + return I18nUtils.getString("options.minimap.terrain.both"); + } + if (this.heightmap) { + return I18nUtils.getString("options.minimap.terrain.height"); + } + if (this.slopemap) { + return I18nUtils.getString("options.minimap.terrain.slope"); + } + return I18nUtils.getString("options.off"); + case BEACONS: + if ((this.showBeacons) && (this.showWaypoints)) { + return I18nUtils.getString("options.minimap.ingamewaypoints.both"); + } + if (this.showBeacons) { + return I18nUtils.getString("options.minimap.ingamewaypoints.beacons"); + } + if (this.showWaypoints) { + return I18nUtils.getString("options.minimap.ingamewaypoints.signs"); + } + return I18nUtils.getString("options.off"); + case LOCATION: + if (this.mapCorner == 0) { + return I18nUtils.getString("options.minimap.location.topleft"); + } + if (this.mapCorner == 1) { + return I18nUtils.getString("options.minimap.location.topright"); + } + if (this.mapCorner == 2) { + return I18nUtils.getString("options.minimap.location.bottomright"); + } + if (this.mapCorner == 3) { + return I18nUtils.getString("options.minimap.location.bottomleft"); + } + return "Error"; + case SIZE: + if (this.sizeModifier == -1) { + return I18nUtils.getString("options.minimap.size.small"); + } + if (this.sizeModifier == 0) { + return I18nUtils.getString("options.minimap.size.medium"); + } + if (this.sizeModifier == 1) { + return I18nUtils.getString("options.minimap.size.large"); + } + return "error"; + case BIOMEOVERLAY: + if (this.biomeOverlay == 0) { + return I18nUtils.getString("options.off"); + } + if (this.biomeOverlay == 1) { + return I18nUtils.getString("options.minimap.biomeoverlay.solid"); + } + if (this.biomeOverlay == 2) { + return I18nUtils.getString("options.minimap.biomeoverlay.transparent"); + } + return "error"; + case DEATHPOINTS: + if (this.deathpoints == 0) { + return I18nUtils.getString("options.off"); + } + if (this.deathpoints == 1) { + return I18nUtils.getString("options.minimap.waypoints.deathpoints.mostrecent"); + } + if (this.deathpoints == 2) { + return I18nUtils.getString("options.minimap.waypoints.deathpoints.all"); + } + return "error"; + } + throw new IllegalArgumentException("Add code to handle EnumOptionMinimap: " + par1EnumOptions.getEnumString() + + ". (possibly not a list value)"); + } + + public void setOptionFloatValue(EnumOptionsMinimap par1EnumOptions, float par2) { + if (par1EnumOptions == EnumOptionsMinimap.WAYPOINTDISTANCE) { + float distance = par2 * 9951.0F + 50.0F; + if (distance > 10000.0F) { + distance = -1.0F; + } + this.maxWaypointDisplayDistance = ((int) distance); + } + } + + public void setOptionValue(EnumOptionsMinimap par1EnumOptions, int i) { + switch (par1EnumOptions) { + case COORDS: + this.coords = (!this.coords); + break; + case HIDE: + this.hide = (!this.hide); + break; + case CAVEMODE: + this.showCaves = (!this.showCaves); + break; + case LIGHTING: + this.lightmap = (!this.lightmap); + break; + case TERRAIN: + if ((this.slopemap) && (this.heightmap)) { + this.slopemap = false; + this.heightmap = false; + } else if (this.slopemap) { + this.slopemap = false; + this.heightmap = true; + } else if (this.heightmap) { + this.slopemap = true; + this.heightmap = true; + } else { + this.slopemap = true; + this.heightmap = false; + } + break; + case SQUARE: + this.squareMap = (!this.squareMap); + break; + case OLDNORTH: + this.oldNorth = (!this.oldNorth); + break; + case BEACONS: + if ((this.showBeacons) && (this.showWaypoints)) { + this.showBeacons = false; + this.showWaypoints = false; + } else if (this.showBeacons) { + this.showBeacons = false; + this.showWaypoints = true; + } else if (this.showWaypoints) { + this.showWaypoints = true; + this.showBeacons = true; + } else { + this.showBeacons = true; + this.showWaypoints = false; + } + break; + case WELCOME: + this.welcome = (!this.welcome); + break; + case LOCATION: + this.mapCorner = (this.mapCorner >= 3 ? 0 : this.mapCorner + 1); + break; + case SIZE: + this.sizeModifier = (this.sizeModifier >= 1 ? -1 : this.sizeModifier + 1); + break; + case FILTERING: + this.filtering = (!this.filtering); + break; + case WATERTRANSPARENCY: + this.waterTransparency = (!this.waterTransparency); + break; + case BLOCKTRANSPARENCY: + this.blockTransparency = (!this.blockTransparency); + break; + case BIOMES: + this.biomes = (!this.biomes); + break; + case BIOMEOVERLAY: + this.biomeOverlay += 1; + if (this.biomeOverlay > 2) { + this.biomeOverlay = 0; + } + break; + case CHUNKGRID: + this.chunkGrid = (!this.chunkGrid); + break; + case DEATHPOINTS: + this.deathpoints += 1; + if (this.deathpoints > 2) { + this.deathpoints = 0; + } + break; + default: + throw new IllegalArgumentException( + "Add code to handle EnumOptionMinimap: " + par1EnumOptions.getEnumString()); + } + this.somethingChanged = true; + } + + public String getKeyBindingDescription(int par1) { + if (this.keyBindings[par1].getKeyDescription().equals("key.minimap.voxelmapmenu")) { + return I18nUtils.getString("key.minimap.menu"); + } + return I18nUtils.getString(this.keyBindings[par1].getKeyDescription()); + } + + public String getOptionDisplayString(int par1) { + int var2 = this.keyBindings[par1].getKeyCode(); + return getKeyDisplayString(var2); + } + + public void setKeyBinding(int par1, int par2) { + this.keyBindings[par1].setKeyCode(par2); + saveAll(); + } + + public void setSort(int sort) { + if ((sort == this.sort) || (sort == -this.sort)) { + this.sort = (-this.sort); + } else { + this.sort = sort; + } + } + + public boolean isChanged() { + if (this.somethingChanged) { + this.somethingChanged = false; + return true; + } + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/RadarSettingsManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/RadarSettingsManager.java new file mode 100644 index 0000000..4d2f597 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/RadarSettingsManager.java @@ -0,0 +1,193 @@ +package com.thevoxelbox.voxelmap; + +import com.thevoxelbox.voxelmap.gui.overridden.EnumOptionsMinimap; +import com.thevoxelbox.voxelmap.util.CustomMob; +import com.thevoxelbox.voxelmap.util.CustomMobsManager; +import com.thevoxelbox.voxelmap.util.EnumMobs; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.PrintWriter; +import net.minecraft.client.Minecraft; + +public class RadarSettingsManager { + public Minecraft game; + public boolean show = true; + public boolean showHostiles = true; + public boolean showPlayers = true; + public boolean showNeutrals = false; + public boolean showPlayerNames = true; + public boolean outlines = true; + public boolean filtering = true; + public boolean showHelmetsPlayers = true; + public boolean showHelmetsMobs = true; + public boolean randomobs = true; + float fontScale = 1.0F; + private boolean somethingChanged; + + public RadarSettingsManager() { + this.game = Minecraft.getMinecraft(); + } + + public void loadSettings(File settingsFile) { + try { + BufferedReader in = new BufferedReader(new FileReader(settingsFile)); + String sCurrentLine; + while ((sCurrentLine = in.readLine()) != null) { + String[] curLine = sCurrentLine.split(":"); + if (curLine[0].equals("Show Radar")) { + this.show = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Show Hostiles")) { + this.showHostiles = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Show Players")) { + this.showPlayers = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Show Neutrals")) { + this.showNeutrals = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Filter Mob Icons")) { + this.filtering = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Outline Mob Icons")) { + this.outlines = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Show Player Helmets")) { + this.showHelmetsPlayers = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Show Mob Helmets")) { + this.showHelmetsMobs = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Show Player Names")) { + this.showPlayerNames = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Font Scale")) { + this.fontScale = Float.parseFloat(curLine[1]); + } else if (curLine[0].equals("Randomobs")) { + this.randomobs = Boolean.parseBoolean(curLine[1]); + } else if (curLine[0].equals("Hidden Mobs")) { + applyHiddenMobSettings(curLine[1]); + } + } + in.close(); + } catch (Exception e) { + } + } + + private void applyHiddenMobSettings(String hiddenMobs) { + String[] mobs = hiddenMobs.split(","); + for (int t = 0; t < mobs.length; t++) { + EnumMobs mob = EnumMobs.getMobByName(mobs[t]); + if (mob != null) { + mob.enabled = false; + } else { + CustomMobsManager.add(mobs[t], false); + } + } + } + + public void saveAll(PrintWriter out) { + out.println("Show Radar:" + this.show); + out.println("Show Hostiles:" + this.showHostiles); + out.println("Show Players:" + this.showPlayers); + out.println("Show Neutrals:" + this.showNeutrals); + out.println("Filter Mob Icons:" + this.filtering); + out.println("Outline Mob Icons:" + this.outlines); + out.println("Show Player Helmets:" + this.showHelmetsPlayers); + out.println("Show Mob Helmets:" + this.showHelmetsMobs); + out.println("Show Player Names:" + this.showPlayerNames); + out.println("Font Scale:" + this.fontScale); + out.println("Randomobs:" + this.randomobs); + out.print("Hidden Mobs:"); + for (EnumMobs mob : EnumMobs.values()) { + if ((mob.isTopLevelUnit) && (!mob.enabled)) { + out.print(mob.name + ","); + } + } + for (CustomMob mob : CustomMobsManager.mobs) { + if (!mob.enabled) { + out.print(mob.name + ","); + } + } + out.println(); + } + + public String getKeyText(EnumOptionsMinimap par1EnumOptions) { + String s = I18nUtils.getString(par1EnumOptions.getEnumString()) + ": "; + if (par1EnumOptions.getEnumBoolean()) { + boolean flag = getOptionBooleanValue(par1EnumOptions); + if (flag) { + return s + I18nUtils.getString("options.on"); + } + return s + I18nUtils.getString("options.off"); + } + return s; + } + + public boolean getOptionBooleanValue(EnumOptionsMinimap par1EnumOptions) { + switch (par1EnumOptions) { + case SHOWRADAR: + return this.show; + case SHOWHOSTILES: + return this.showHostiles; + case SHOWPLAYERS: + return this.showPlayers; + case SHOWNEUTRALS: + return this.showNeutrals; + case SHOWPLAYERHELMETS: + return this.showHelmetsPlayers; + case SHOWMOBHELMETS: + return this.showHelmetsMobs; + case SHOWPLAYERNAMES: + return this.showPlayerNames; + case RADAROUTLINES: + return this.outlines; + case RADARFILTERING: + return this.filtering; + case RANDOMOBS: + return this.randomobs; + } + throw new IllegalArgumentException("Add code to handle EnumOptionMinimap: " + par1EnumOptions.getEnumString() + + ". (possibly not a boolean)"); + } + + public void setOptionValue(EnumOptionsMinimap par1EnumOptions, int i) { + switch (par1EnumOptions) { + case SHOWRADAR: + this.show = (!this.show); + break; + case SHOWHOSTILES: + this.showHostiles = (!this.showHostiles); + break; + case SHOWPLAYERS: + this.showPlayers = (!this.showPlayers); + break; + case SHOWNEUTRALS: + this.showNeutrals = (!this.showNeutrals); + break; + case SHOWPLAYERHELMETS: + this.showHelmetsPlayers = (!this.showHelmetsPlayers); + break; + case SHOWMOBHELMETS: + this.showHelmetsMobs = (!this.showHelmetsMobs); + break; + case SHOWPLAYERNAMES: + this.showPlayerNames = (!this.showPlayerNames); + break; + case RADAROUTLINES: + this.outlines = (!this.outlines); + break; + case RADARFILTERING: + this.filtering = (!this.filtering); + break; + case RANDOMOBS: + this.randomobs = (!this.randomobs); + break; + default: + throw new IllegalArgumentException( + "Add code to handle EnumOptionMinimap: " + par1EnumOptions.getEnumString()); + } + this.somethingChanged = true; + } + + public boolean isChanged() { + if (this.somethingChanged) { + this.somethingChanged = false; + return true; + } + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/VoxelMap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/VoxelMap.java new file mode 100644 index 0000000..cf6229f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/VoxelMap.java @@ -0,0 +1,96 @@ +package com.thevoxelbox.voxelmap; + +import com.thevoxelbox.voxelmap.interfaces.AbstractVoxelMap; +import com.thevoxelbox.voxelmap.interfaces.IColorManager; +import com.thevoxelbox.voxelmap.interfaces.IDimensionManager; +import com.thevoxelbox.voxelmap.interfaces.IMap; +import com.thevoxelbox.voxelmap.interfaces.IObservableChunkChangeNotifier; +import com.thevoxelbox.voxelmap.interfaces.IRadar; +import com.thevoxelbox.voxelmap.interfaces.IWaypointManager; +import com.thevoxelbox.voxelmap.util.AddonResourcePack; +import com.thevoxelbox.voxelmap.util.DimensionManager; +import com.thevoxelbox.voxelmap.util.ObservableChunkChangeNotifier; +import com.thevoxelbox.voxelmap.util.ReflectionUtils; +import java.util.List; +import net.minecraft.client.Minecraft; + +public class VoxelMap + extends AbstractVoxelMap { + private MapSettingsManager mapOptions = null; + private RadarSettingsManager radarOptions = null; + private IMap map = null; + private final IRadar radar = null; + private IColorManager colorManager = null; + private IWaypointManager waypointManager = null; + private IDimensionManager dimensionManager = null; + private final ObservableChunkChangeNotifier chunkChangeNotifier = new ObservableChunkChangeNotifier(); + + public VoxelMap(boolean showUnderMenus, boolean isFair) { + AbstractVoxelMap.instance = this; + if (!Minecraft.getMinecraft().getResourceManager().getResourceDomains().contains("voxelmap")) { + AddonResourcePack voxelMapResourcePack = new AddonResourcePack("voxelmap"); + List defaultResourcePacks = (List) ReflectionUtils + .getPrivateFieldValueByType(Minecraft.getMinecraft(), Minecraft.class, List.class, 1); + defaultResourcePacks.add(voxelMapResourcePack); + Minecraft.getMinecraft().refreshResources(); + } + this.mapOptions = new MapSettingsManager(); + this.mapOptions.showUnderMenus = showUnderMenus; + this.radarOptions = new RadarSettingsManager(); + this.mapOptions.setRadarSettings(this.radarOptions); + + this.colorManager = new ColorManager(this); + this.waypointManager = new WaypointManager(this); + this.dimensionManager = new DimensionManager(this); + this.map = new Map(this); + this.mapOptions.loadAll(); + } + + public void onTickInGame(Minecraft mc) { + this.map.onTickInGame(mc); + } + + public IObservableChunkChangeNotifier getNotifier() { + return this.chunkChangeNotifier; + } + + public MapSettingsManager getMapOptions() { + return this.mapOptions; + } + + public RadarSettingsManager getRadarOptions() { + return this.radarOptions; + } + + public IMap getMap() { + return this.map; + } + + public IRadar getRadar() { + return this.radar; + } + + public IColorManager getColorManager() { + return this.colorManager; + } + + public IWaypointManager getWaypointManager() { + return this.waypointManager; + } + + public IDimensionManager getDimensionManager() { + return this.dimensionManager; + } + + public void setPermissions(boolean hasRadarPermission, boolean hasCavemodePermission) { + this.map.setPermissions(hasRadarPermission, hasCavemodePermission); + } + + public void newSubWorldName(String name) { + this.waypointManager.newSubWorldName(name); + } + + public void newSubWorldHash(String hash) { + this.waypointManager.newSubWorldHash(hash); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/WaypointManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/WaypointManager.java new file mode 100644 index 0000000..43c2572 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/WaypointManager.java @@ -0,0 +1,602 @@ +package com.thevoxelbox.voxelmap; + +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.interfaces.IWaypointManager; +import com.thevoxelbox.voxelmap.util.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.entity.Entity; +import net.minecraft.util.EnumChatFormatting; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; + +public class WaypointManager implements IWaypointManager { + public MapSettingsManager options = null; + IVoxelMap master; + private ArrayList wayPts = new ArrayList(); + public ArrayList old2dWayPts = new ArrayList(); + private ArrayList updatedPts; + private String currentSubWorldName = ""; + private String currentSubWorldHash = ""; + private String currentSubWorldDescriptor = ""; + public EntityWaypointContainer entityWaypointContainer = null; + private File settingsFile; + private final Object lock = new Object(); + + public WaypointManager(IVoxelMap master) { + this.master = master; + this.options = master.getMapOptions(); + } + + public ArrayList getWaypoints() { + return this.wayPts; + } + + public void handleDeath() { + TreeSet toDel = new TreeSet(); + for (Waypoint pt : this.wayPts) { + if (pt.name.equals("Latest Death")) { + pt.name = "Previous Death"; + } + if (pt.name.startsWith("Previous Death")) { + if (this.options.deathpoints > 1) { + int num = 0; + try { + if (pt.name.length() > 15) { + num = Integer.parseInt(pt.name.substring(15)); + } + } catch (Exception e) { + num = 0; + } + pt.red -= (pt.red - 0.5F) / 8.0F; + pt.green -= (pt.green - 0.5F) / 8.0F; + pt.blue -= (pt.blue - 0.5F) / 8.0F; + pt.name = ("Previous Death " + (num + 1)); + } else { + toDel.add(Integer.valueOf(this.wayPts.indexOf(pt))); + } + } + } + if ((this.options.deathpoints < 2) && (toDel.size() > 0)) { + TreeSet toDelReverse = (TreeSet) toDel.descendingSet(); + for (Integer index : toDelReverse) { + deleteWaypoint(index.intValue()); + } + } + if (this.options.deathpoints > 0) { + EntityClientPlayerMP thePlayer = Minecraft.getMinecraft().thePlayer; + TreeSet dimensions = new TreeSet(); + dimensions.add(Integer.valueOf(Minecraft.getMinecraft().thePlayer.dimension)); + addWaypoint(new Waypoint("Latest Death", + thePlayer.dimension != -1 ? GameVariableAccessShim.xCoord() : GameVariableAccessShim.xCoord() * 8, + thePlayer.dimension != -1 ? GameVariableAccessShim.zCoord() : GameVariableAccessShim.zCoord() * 8, + GameVariableAccessShim.yCoord() - 1, true, 1.0F, 1.0F, 1.0F, "skull", this.currentSubWorldName, + dimensions)); + } + } + + public void newWorld(int dimension) { + synchronized (this.lock) { + for (Waypoint pt : this.wayPts) { + pt.inDimension = (pt.dimensions.size() == 0) || (pt.dimensions.contains(Integer.valueOf(dimension))); + } + injectWaypointEntity(); + } + } + + public void newSubWorldDescriptor(String descriptor) { + this.currentSubWorldDescriptor = descriptor; + String currentSubWorldDescriptorScrubbed; + synchronized (this.lock) { + currentSubWorldDescriptorScrubbed = scrubName(descriptor); + for (Waypoint pt : this.wayPts) { + pt.inWorld = (currentSubWorldDescriptorScrubbed == "") || (pt.world == "") || + (currentSubWorldDescriptorScrubbed.equals(pt.world)); + } + } + } + + public void newSubWorldName(String name) { + this.currentSubWorldName = name; + newSubWorldDescriptor(this.currentSubWorldName); + } + + public void newSubWorldHash(String hash) { + this.currentSubWorldHash = hash; + if (this.currentSubWorldName.equals("")) { + newSubWorldDescriptor(this.currentSubWorldHash); + } + } + + public String getCurrentSubworldDescriptor() { + return this.currentSubWorldDescriptor; + } + + public void saveWaypoints() { + String worldNameSave = this.master.getMap().getCurrentWorldName(); + if (worldNameSave.endsWith(":25565")) { + int portSepLoc = worldNameSave.lastIndexOf(":"); + if (portSepLoc != -1) { + worldNameSave = worldNameSave.substring(0, portSepLoc); + } + } + worldNameSave = scrubFileName(worldNameSave); + + File homeDir = FilesystemUtils.getAppDir("minecraft", true).getAbsoluteFile(); + File mcDir = Minecraft.getMinecraft().mcDataDir.getAbsoluteFile(); + if (!homeDir.equals(mcDir)) { + String localDirName = ""; + if (Minecraft.getMinecraft().isIntegratedServerRunning()) { + localDirName = mcDir.getName(); + if (((localDirName.equalsIgnoreCase("minecraft")) || (localDirName.equalsIgnoreCase("."))) && + (mcDir.getParentFile() != null)) { + localDirName = mcDir.getParentFile().getName(); + } + localDirName = "~" + localDirName; + } + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/VoxelMods/voxelMap", true), + worldNameSave + localDirName + ".points"); + saveWaypointsTo(this.settingsFile); + homeDir = new File(Minecraft.getMinecraft().mcDataDir, "/mods/VoxelMods/voxelMap/"); + if (!homeDir.exists()) { + homeDir.mkdirs(); + } + this.settingsFile = new File(Minecraft.getMinecraft().mcDataDir, + "/mods/VoxelMods/voxelMap/" + worldNameSave + ".points"); + saveWaypointsTo(this.settingsFile); + } else { + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/VoxelMods/voxelMap", true), + worldNameSave + ".points"); + saveWaypointsTo(this.settingsFile); + } + } + + public void saveWaypointsTo(File settingsFile) { + try { + PrintWriter out = new PrintWriter(new FileWriter(settingsFile)); + + Date now = new Date(); + String timestamp = new SimpleDateFormat("yyyyMMddHHmm").format(now); + out.println("filetimestamp:" + timestamp); + for (Waypoint pt : this.wayPts) { + if (pt.isAutomated) { + continue; + } + if (!pt.name.startsWith("^")) { + String dimensionsString = ""; + for (Integer dimension : pt.dimensions) { + dimensionsString = dimensionsString + "" + dimension + "#"; + } + if (dimensionsString.equals("")) { + dimensionsString = "-1#0#"; + } + out.println( + "name:" + scrubName(pt.name) + ",x:" + pt.x + ",z:" + pt.z + ",y:" + pt.y + ",enabled:" + + pt.enabled + ",red:" + pt.red + ",green:" + pt.green + ",blue:" + + pt.blue + ",suffix:" + pt.imageSuffix + ",world:" + scrubName(pt.world) + ",dimensions:" + + dimensionsString); + } + } + out.close(); + } catch (Exception local) { + ChatUtils.chatInfo(EnumChatFormatting.YELLOW + "Error Saving Waypoints"); + } + } + + public String scrubName(String input) { + input = input.replace(":", "~colon~"); + input = input.replace(",", "~comma~"); + return input; + } + + private String descrubName(String input) { + input = input.replace("~colon~", ":"); + input = input.replace("~comma~", ","); + return input; + } + + public String scrubFileName(String input) { + input = input.replace("<", "~less~"); + input = input.replace(">", "~greater~"); + input = input.replace(":", "~colon~"); + input = input.replace("\"", "~quote~"); + input = input.replace("/", "~slash~"); + input = input.replace("\\", "~backslash~"); + input = input.replace("|", "~pipe~"); + input = input.replace("?", "~question~"); + input = input.replace("*", "~star~"); + return input; + } + + public void loadWaypoints() { + synchronized (this.lock) { + boolean loaded = false; + this.wayPts = new ArrayList(); + String worldNameStandard = this.master.getMap().getCurrentWorldName(); + if (worldNameStandard.endsWith(":25565")) { + int portSepLoc = worldNameStandard.lastIndexOf(":"); + if (portSepLoc != -1) { + worldNameStandard = worldNameStandard.substring(0, portSepLoc); + } + } + worldNameStandard = scrubFileName(worldNameStandard); + + String worldNameWithPort = scrubFileName(this.master.getMap().getCurrentWorldName()); + + String worldNameWithoutPort = this.master.getMap().getCurrentWorldName(); + int portSepLoc = worldNameWithoutPort.lastIndexOf(":"); + if (portSepLoc != -1) { + worldNameWithoutPort = worldNameWithoutPort.substring(0, portSepLoc); + } + worldNameWithoutPort = scrubFileName(worldNameWithoutPort); + + String worldNameWithDefaultPort = scrubFileName(worldNameWithoutPort + "~colon~25565"); + + loaded = loadWaypointsExtensible(worldNameStandard); + if (!loaded) { + loaded = loadOldWaypoints(worldNameWithoutPort, worldNameWithDefaultPort, worldNameWithPort); + } + if (!loaded) { + loaded = findReiWaypoints(worldNameWithoutPort); + } + if (!loaded) { + ChatUtils.chatInfo("§ENo waypoints exist for this world/server."); + } else { + populateOld2dWaypoints(); + } + } + newSubWorldDescriptor(this.currentSubWorldDescriptor); + } + + private boolean loadWaypointsExtensible(String worldNameStandard) { + File homeDir = FilesystemUtils.getAppDir("minecraft", false).getAbsoluteFile(); + File mcDir = Minecraft.getMinecraft().mcDataDir.getAbsoluteFile(); + if (!homeDir.equals(mcDir)) { + long homeDate = -1L; + long localDate = -1L; + String localDirName = ""; + if (Minecraft.getMinecraft().isIntegratedServerRunning()) { + localDirName = mcDir.getName(); + if (((localDirName.equalsIgnoreCase("minecraft")) || (localDirName.equalsIgnoreCase("."))) && + (mcDir.getParentFile() != null)) { + localDirName = mcDir.getParentFile().getName(); + } + localDirName = "~" + localDirName; + } + File settingsFileLocal = new File(Minecraft.getMinecraft().mcDataDir, + "/mods/VoxelMods/voxelMap/" + worldNameStandard + ".points"); + localDate = getDateFromSave(settingsFileLocal); + File settingsFileHome = new File(FilesystemUtils.getAppDir("minecraft/mods/VoxelMods/voxelMap", false), + worldNameStandard + localDirName + ".points"); + if ((!settingsFileHome.exists()) && (!settingsFileLocal.exists())) { + settingsFileHome = new File(FilesystemUtils.getAppDir("minecraft/mods/VoxelMods/voxelMap", false), + worldNameStandard + ".points"); + } + homeDate = getDateFromSave(settingsFileHome); + if ((!settingsFileHome.exists()) && (!settingsFileLocal.exists())) { + return false; + } + if (!settingsFileHome.exists()) { + this.settingsFile = settingsFileLocal; + } else if (!settingsFileLocal.exists()) { + this.settingsFile = settingsFileHome; + } else { + this.settingsFile = (homeDate > localDate ? settingsFileHome : settingsFileLocal); + } + } else { + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/VoxelMods/voxelMap", false), + worldNameStandard + ".points"); + } + if (this.settingsFile.exists()) { + try { + BufferedReader in = new BufferedReader(new FileReader(this.settingsFile)); + String sCurrentLine; + while ((sCurrentLine = in.readLine()) != null) { + if (!sCurrentLine.startsWith("filetimestamp")) { + String[] curLine = sCurrentLine.split(","); + String name = ""; + int x = 0; + int z = 0; + int y = -1; + boolean enabled = false; + float red = 0.5F; + float green = 0.0F; + float blue = 0.0F; + String suffix = ""; + String world = ""; + TreeSet dimensions = new TreeSet(); + for (int t = 0; t < curLine.length; t++) { + String[] keyValuePair = curLine[t].split(":"); + if (keyValuePair.length == 2) { + String key = keyValuePair[0]; + String value = keyValuePair[1]; + if (key.equals("name")) { + name = descrubName(value); + } else if (key.equals("x")) { + x = Integer.parseInt(value); + } else if (key.equals("z")) { + z = Integer.parseInt(value); + } else if (key.equals("y")) { + y = Integer.parseInt(value); + } else if (key.equals("enabled")) { + enabled = Boolean.parseBoolean(value); + } else if (key.equals("red")) { + red = Float.parseFloat(value); + } else if (key.equals("green")) { + green = Float.parseFloat(value); + } else if (key.equals("blue")) { + blue = Float.parseFloat(value); + } else if (key.equals("suffix")) { + suffix = value; + } else if (key.equals("world")) { + world = descrubName(value); + } else if (key.equals("dimensions")) { + String[] dimensionStrings = value.split("#"); + for (int s = 0; s < dimensionStrings.length; s++) { + dimensions.add(Integer.valueOf(Integer.parseInt(dimensionStrings[s]))); + } + if (dimensions.size() == 0) { + dimensions.add(Integer.valueOf(0)); + dimensions.add(Integer.valueOf(-1)); + } + } + } + } + if (!name.equals("")) { + loadWaypoint(name, x, z, y, enabled, red, green, blue, suffix, world, dimensions); + } + } + } + in.close(); + } catch (Exception local) { + ChatUtils.chatInfo(EnumChatFormatting.YELLOW + "Error Loading Waypoints"); + System.err.println("waypoint load error: " + local.getLocalizedMessage()); + return false; + } + return true; + } + return false; + } + + private long getDateFromSave(File settingsFile) { + if (settingsFile.exists()) { + try { + BufferedReader in = new BufferedReader(new FileReader(settingsFile)); + String sCurrentLine = in.readLine(); + String[] curLine = sCurrentLine.split(":"); + in.close(); + if (curLine[0].equals("filetimestamp")) { + return Long.parseLong(curLine[1]); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return -1L; + } + + private boolean loadOldWaypoints(String worldNameWithPort, String worldNameWithDefaultPort, + String worldNameWithoutPort) { + try { + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/zan", false), + worldNameWithPort + ".points"); + if (!this.settingsFile.exists()) { + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/zan", false), + worldNameWithDefaultPort + ".points"); + } + if (!this.settingsFile.exists()) { + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/zan", false), + worldNameWithoutPort + ".points"); + } + if (!this.settingsFile.exists()) { + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft", false), + worldNameWithoutPort + ".points"); + } + if (this.settingsFile.exists()) { + TreeSet dimensions = new TreeSet(); + dimensions.add(Integer.valueOf(-1)); + dimensions.add(Integer.valueOf(0)); + BufferedReader in = new BufferedReader(new FileReader(this.settingsFile)); + String sCurrentLine; + while ((sCurrentLine = in.readLine()) != null) { + String[] curLine = sCurrentLine.split(":"); + if (curLine.length == 4) { + loadWaypoint(curLine[0], Integer.parseInt(curLine[1]), Integer.parseInt(curLine[2]), -1, + Boolean.parseBoolean(curLine[3]), 0.0F, 1.0F, 0.0F, "", "", dimensions); + } else if (curLine.length == 7) { + loadWaypoint(curLine[0], Integer.parseInt(curLine[1]), Integer.parseInt(curLine[2]), -1, + Boolean.parseBoolean(curLine[3]), Float.parseFloat(curLine[4]), + Float.parseFloat(curLine[5]), Float.parseFloat(curLine[6]), "", "", dimensions); + } else if (curLine.length == 8) { + if ((curLine[3].contains("true")) || (curLine[3].contains("false"))) { + loadWaypoint(curLine[0], Integer.parseInt(curLine[1]), Integer.parseInt(curLine[2]), -1, + Boolean.parseBoolean(curLine[3]), Float.parseFloat(curLine[4]), + Float.parseFloat(curLine[5]), Float.parseFloat(curLine[6]), curLine[7], "", + dimensions); + } else { + loadWaypoint(curLine[0], Integer.parseInt(curLine[1]), Integer.parseInt(curLine[2]), + Integer.parseInt(curLine[3]), Boolean.parseBoolean(curLine[4]), + Float.parseFloat(curLine[5]), Float.parseFloat(curLine[6]), + Float.parseFloat(curLine[7]), "", "", dimensions); + } + } else if (curLine.length == 9) { + loadWaypoint(curLine[0], Integer.parseInt(curLine[1]), Integer.parseInt(curLine[2]), + Integer.parseInt(curLine[3]), Boolean.parseBoolean(curLine[4]), + Float.parseFloat(curLine[5]), Float.parseFloat(curLine[6]), + Float.parseFloat(curLine[7]), curLine[8], "", dimensions); + } + } + in.close(); + return true; + } + return false; + } catch (Exception local) { + ChatUtils.chatInfo(EnumChatFormatting.YELLOW + "Error Loading Waypoints"); + System.err.println("waypoint load error: " + local.getLocalizedMessage()); + } + return false; + } + + private boolean findReiWaypoints(String worldNameWithoutPort) { + boolean foundSome = false; + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/rei_minimap", false), + worldNameWithoutPort + ".points"); + if (!this.settingsFile.exists()) { + this.settingsFile = new File(Minecraft.getMinecraft().mcDataDir, + "/mods/rei_minimap/" + worldNameWithoutPort + ".points"); + } + if (this.settingsFile.exists()) { + loadReiWaypoints(this.settingsFile, 0); + foundSome = true; + } else { + for (int t = -25; t < 25; t++) { + this.settingsFile = new File(FilesystemUtils.getAppDir("minecraft/mods/rei_minimap", false), + worldNameWithoutPort + ".DIM" + t + ".points"); + if (!this.settingsFile.exists()) { + this.settingsFile = new File(Minecraft.getMinecraft().mcDataDir, + "/mods/rei_minimap/" + worldNameWithoutPort + ".DIM" + t + ".points"); + } + if (this.settingsFile.exists()) { + foundSome = true; + loadReiWaypoints(this.settingsFile, t); + } + } + } + return foundSome; + } + + private void loadReiWaypoints(File settingsFile, int dimension) { + try { + if (settingsFile.exists()) { + TreeSet dimensions = new TreeSet(); + dimensions.add(Integer.valueOf(dimension)); + BufferedReader in = new BufferedReader(new FileReader(settingsFile)); + String sCurrentLine; + while ((sCurrentLine = in.readLine()) != null) { + String[] curLine = sCurrentLine.split(":"); + if (curLine.length == 6) { + int color = Integer.parseInt(curLine[5], 16); + float red = (color >> 16 & 0xFF) / 255.0F; + float green = (color >> 8 & 0xFF) / 255.0F; + float blue = (color >> 0 & 0xFF) / 255.0F; + + int x = Integer.parseInt(curLine[1]); + int z = Integer.parseInt(curLine[3]); + if (dimension == -1) { + x *= 8; + z *= 8; + } + loadWaypoint(curLine[0], x, z, Integer.parseInt(curLine[2]), Boolean.parseBoolean(curLine[4]), + red, green, blue, "", "", dimensions); + } + } + in.close(); + } + } catch (Exception e) { + ChatUtils.chatInfo(EnumChatFormatting.YELLOW + "Error Loading Old Rei Waypoints"); + System.err.println("waypoint load error: " + e.getLocalizedMessage()); + } + } + + public void loadWaypoint(String name, int x, int z, int y, boolean enabled, float red, float green, float blue, + String suffix, String world, TreeSet dimensions) { + Waypoint newWaypoint = new Waypoint(name, x, z, y, enabled, red, green, blue, suffix, world, dimensions); + this.wayPts.add(newWaypoint); + } + + public void populateOld2dWaypoints() { + this.old2dWayPts = new ArrayList(); + for (Waypoint wpt : this.wayPts) { + if (wpt.getY() <= 0) { + this.old2dWayPts.add(wpt); + } + } + } + + public void check2dWaypoints() { + if ((Minecraft.getMinecraft().thePlayer.dimension == 0) && + (this.old2dWayPts.size() > 0)) { + this.updatedPts = new ArrayList(); + for (Waypoint pt : this.old2dWayPts) { + if ((Math.abs(pt.getX() - GameVariableAccessShim.xCoord()) < 400) && + (Math.abs(pt.getZ() - GameVariableAccessShim.zCoord()) < 400) && + (Minecraft.getMinecraft().thePlayer.worldObj + .getChunkFromBlockCoords(pt.getX(), pt.getZ()).isChunkLoaded)) { + pt.setY(Minecraft.getMinecraft().thePlayer.worldObj.getHeightValue(pt.getX(), pt.getZ())); + this.updatedPts.add(pt); + saveWaypoints(); + } + } + this.old2dWayPts.removeAll(this.updatedPts); + System.out.println("remaining old 2d waypoints: " + this.old2dWayPts.size()); + } + } + + private void deleteWaypoint(int i) { + this.old2dWayPts.remove(this.wayPts.get(i)); + this.entityWaypointContainer.removeWaypoint(this.wayPts.get(i)); + this.wayPts.remove(i); + saveWaypoints(); + } + + public void deleteWaypoint(Waypoint point) { + this.old2dWayPts.remove(point); + this.entityWaypointContainer.removeWaypoint(point); + this.wayPts.remove(point); + saveWaypoints(); + } + + public void addWaypoint(Waypoint newWaypoint) { + this.wayPts.add(newWaypoint); + this.entityWaypointContainer.addWaypoint(newWaypoint); + saveWaypoints(); + } + + private void purgeWaypointEntity() { + List entities = Minecraft.getMinecraft().theWorld.getLoadedEntityList(); + for (int t = 0; t < entities.size(); t++) { + Entity entity = (Entity) entities.get(t); + if ((entity instanceof EntityWaypointContainer)) { + entity.setDead(); + } + } + } + + public void injectWaypointEntity() { + this.entityWaypointContainer = new EntityWaypointContainer(Minecraft.getMinecraft().theWorld); + for (Waypoint wpt : this.wayPts) { + this.entityWaypointContainer.addWaypoint(wpt); + } + Minecraft.getMinecraft().theWorld.spawnEntityInWorld(this.entityWaypointContainer); + } + + public void moveWaypointEntityToBack() { + List entities = Minecraft.getMinecraft().theWorld.getLoadedEntityList(); + synchronized (entities) { + int t = entities.indexOf(this.entityWaypointContainer); + if (t == -1) { + purgeWaypointEntity(); + + injectWaypointEntity(); + return; + } + if (t != entities.size() - 1) { + Collections.swap(entities, t, entities.size() - 1); + } + } + } + + public ArrayList getWaypts() { + return this.wayPts; + } + + public ArrayList getOld2dWayPts() { + return this.old2dWayPts; + } + + public EntityWaypointContainer getEntityWaypointContainer() { + return this.entityWaypointContainer; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapControls.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapControls.java new file mode 100644 index 0000000..c566dc1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapControls.java @@ -0,0 +1,142 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.gui.overridden.GuiOptionButtonMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.settings.KeyBinding; + +public class GuiMinimapControls + extends GuiScreenMinimap { + protected String screenTitle = "Controls"; + private IVoxelMap master; + private final GuiScreen parentScreen; + private final MapSettingsManager options; + private int buttonId = -1; + + public GuiMinimapControls(GuiScreen par1GuiScreen, IVoxelMap master) { + this.parentScreen = par1GuiScreen; + this.options = master.getMapOptions(); + } + + private int getLeftBorder() { + return getWidth() / 2 - 155; + } + + public void initGui() { + int var2 = getLeftBorder(); + for (int var3 = 0; var3 < this.options.keyBindings.length; var3++) { + getButtonList() + .add(new GuiOptionButtonMinimap(var3, var2 + var3 % 2 * 160, getHeight() / 6 + 24 * (var3 >> 1), + 70, + 20, this.options.getOptionDisplayString(var3))); + } + getButtonList() + .add(new GuiButton(200, getWidth() / 2 - 100, getHeight() / 6 + 168, I18nUtils.getString("gui.done"))); + this.screenTitle = I18nUtils.getString("controls.minimap.title"); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + for (int var2 = 0; var2 < this.options.keyBindings.length; var2++) { + ((GuiButton) getButtonList().get(var2)).displayString = this.options.getOptionDisplayString(var2); + } + if (par1GuiButton.id == 200) { + getMinecraft().displayGuiScreen(this.parentScreen); + } else { + this.buttonId = par1GuiButton.id; + par1GuiButton.displayString = ("> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <"); + } + } + + protected void mouseClicked(int par1, int par2, int mouseButton) { + if (this.buttonId >= 0) { + this.buttonId = -1; + } else { + super.mouseClicked(par1, par2, mouseButton); + } + } + + protected void keyTyped(char par1, int par2) { + if (this.buttonId >= 0) { + if (par2 != 1) { + this.options.setKeyBinding(this.buttonId, par2); + } else if (this.buttonId != 0) { + this.options.setKeyBinding(this.buttonId, 0); + } + ((GuiButton) getButtonList().get(this.buttonId)).displayString = this.options + .getOptionDisplayString(this.buttonId); + this.buttonId = -1; + KeyBinding.resetKeyBindingArrayAndHash(); + } else { + super.keyTyped(par1, par2); + } + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + drawDefaultBackground(); + drawCenteredString(getFontRenderer(), this.screenTitle, getWidth() / 2, 20, 16777215); + int var4 = getLeftBorder(); + int var5 = 0; + while (var5 < this.options.keyBindings.length) { + boolean var6 = false; + int var7 = 0; + for (; ; ) { + if (var7 < this.options.keyBindings.length) { + if ((this.options.keyBindings[var5].getKeyCode() == 0) || (((var7 == var5) || + (this.options.keyBindings[var5] + .getKeyCode() != + this.options.keyBindings[var7] + .getKeyCode())) && + ((this.options.keyBindings[var5] + .getKeyCode() != + this.options.game.gameSettings + .keyBindings[var7] + .getKeyCode()) || + (this.options.keyBindings[var5] + .equals(this.options.game + .gameSettings + .keyBindings[var7]))) + )) { + var7++; + } else { + var6 = true; + } + } else { + if (var7 >= this.options.game.gameSettings.keyBindings.length) { + break; + } + if ((this.options.keyBindings[var5].getKeyCode() != 0) && + (this.options.keyBindings[var5].getKeyCode() == + this.options.game.gameSettings.keyBindings[var7].getKeyCode()) && + (!this.options.keyBindings[var5].equals(this.options.game.gameSettings.keyBindings[var7]))) { + break; + } + var7++; + } + } + var6 = true; + label310: + if (this.buttonId == var5) { + ((GuiButton) getButtonList().get(var5)).displayString = "§f> §e??? §f<"; + } else if (var6) { + ((GuiButton) getButtonList().get(var5)).displayString = ("§c" + + this.options.getOptionDisplayString(var5)); + } else { + ((GuiButton) getButtonList().get(var5)).displayString = this.options.getOptionDisplayString(var5); + } + drawString(getFontRenderer(), this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, + getHeight() / 6 + 24 * (var5 >> 1) + 7, -1); + var5++; + } + drawCenteredString(getFontRenderer(), I18nUtils.getString("controls.minimap.unbind1"), getWidth() / 2, + getHeight() / 6 + 115, 16777215); + drawCenteredString(getFontRenderer(), I18nUtils.getString("controls.minimap.unbind2"), getWidth() / 2, + getHeight() / 6 + 129, 16777215); + + super.drawScreen(par1, par2, par3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapOptions.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapOptions.java new file mode 100644 index 0000000..eb20617 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapOptions.java @@ -0,0 +1,95 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.gui.overridden.EnumOptionsMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiOptionButtonMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class GuiMinimapOptions + extends GuiScreenMinimap { + private static EnumOptionsMinimap[] relevantOptions; + private final MapSettingsManager options; + protected String screenTitle = "Minimap Options"; + private final IVoxelMap master; + + public GuiMinimapOptions(IVoxelMap master) { + this.master = master; + this.options = master.getMapOptions(); + } + + public void initGui() { + relevantOptions = new EnumOptionsMinimap[]{EnumOptionsMinimap.COORDS, + EnumOptionsMinimap.HIDE, + EnumOptionsMinimap.LOCATION, + EnumOptionsMinimap.SIZE, + EnumOptionsMinimap.SQUARE, + EnumOptionsMinimap.OLDNORTH, + EnumOptionsMinimap.BEACONS, + EnumOptionsMinimap.CAVEMODE}; + + int var2 = 0; + + this.screenTitle = I18nUtils.getString("options.minimap.title"); + for (int t = 0; t < relevantOptions.length; t++) { + EnumOptionsMinimap option = relevantOptions[t]; + + GuiOptionButtonMinimap var7 = new GuiOptionButtonMinimap(option.returnEnumOrdinal(), + getWidth() / 2 - 155 + var2 % 2 * 160, getHeight() / 6 + 24 * (var2 >> 1), option, + this.options.getKeyText(option)); + + getButtonList().add(var7); + if (option.equals(EnumOptionsMinimap.CAVEMODE)) { + var7.enabled = ((this.options.cavesAllowed.booleanValue()) && (this.master.getRadar() != null)); + } + var2++; + } + GuiOptionButtonMinimap radarOptionsButton = new GuiOptionButtonMinimap(101, getWidth() / 2 - 155, + getHeight() / 6 + 120 - 6, 150, 20, I18nUtils.getString("options.minimap.radar")); + radarOptionsButton.enabled = ((this.options.radarAllowed.booleanValue()) && (this.master.getRadar() != null)); + getButtonList().add(radarOptionsButton); + getButtonList().add(new GuiButton(103, getWidth() / 2 + 5, getHeight() / 6 + 120 - 6, 150, 20, + I18nUtils.getString("options.minimap.detailsperformance"))); + getButtonList().add(new GuiButton(102, getWidth() / 2 - 155, getHeight() / 6 + 144 - 6, 150, 20, + I18nUtils.getString("options.controls"))); + getButtonList().add(new GuiButton(100, getWidth() / 2 + 5, getHeight() / 6 + 144 - 6, 150, 20, + I18nUtils.getString("options.minimap.waypoints"))); + getButtonList().add(new GuiButton(200, getWidth() / 2 - 100, getHeight() / 6 + 168, + I18nUtils.getString("menu.returnToGame"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if ((par1GuiButton.id < 100) && ((par1GuiButton instanceof GuiOptionButtonMinimap))) { + this.options.setOptionValue(((GuiOptionButtonMinimap) par1GuiButton).returnEnumOptions(), 1); + par1GuiButton.displayString = this.options + .getKeyText(EnumOptionsMinimap.getEnumOptions(par1GuiButton.id)); + } + if (par1GuiButton.id == 103) { + getMinecraft().displayGuiScreen(new GuiMinimapPerformance(this, this.master)); + } + if (par1GuiButton.id == 102) { + getMinecraft().displayGuiScreen(new GuiMinimapControls(this, this.master)); + } + if (par1GuiButton.id == 101) { + getMinecraft().displayGuiScreen(new GuiRadarOptions(this, this.master)); + } + if (par1GuiButton.id == 100) { + getMinecraft().displayGuiScreen(new GuiWaypoints(this, this.master)); + } + if (par1GuiButton.id == 200) { + getMinecraft().displayGuiScreen(null); + } + } + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + drawDefaultBackground(); + drawCenteredString(getFontRenderer(), this.screenTitle, getWidth() / 2, 20, 16777215); + super.drawScreen(par1, par2, par3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapPerformance.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapPerformance.java new file mode 100644 index 0000000..b16a887 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMinimapPerformance.java @@ -0,0 +1,87 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.gui.overridden.EnumOptionsMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiOptionButtonMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class GuiMinimapPerformance + extends GuiScreenMinimap { + private static final EnumOptionsMinimap[] relevantOptions = {EnumOptionsMinimap.LIGHTING, + EnumOptionsMinimap.TERRAIN, + EnumOptionsMinimap.WATERTRANSPARENCY, + EnumOptionsMinimap.BLOCKTRANSPARENCY, + EnumOptionsMinimap.BIOMES, + EnumOptionsMinimap.FILTERING, + EnumOptionsMinimap.CHUNKGRID, + EnumOptionsMinimap.BIOMEOVERLAY}; + protected String screenTitle = "Details / Performance"; + private IVoxelMap master; + private final GuiScreen parentScreen; + private final MapSettingsManager options; + private final int buttonId = -1; + + public GuiMinimapPerformance(GuiScreen par1GuiScreen, IVoxelMap master) { + this.parentScreen = par1GuiScreen; + this.options = master.getMapOptions(); + } + + private int getLeftBorder() { + return getWidth() / 2 - 155; + } + + public void initGui() { + this.screenTitle = I18nUtils.getString("options.minimap.detailsperformance"); + + int var1 = getLeftBorder(); + int var2 = 0; + for (int t = 0; t < relevantOptions.length; t++) { + EnumOptionsMinimap option = relevantOptions[t]; + + String text = this.options.getKeyText(option); + if (((option == EnumOptionsMinimap.WATERTRANSPARENCY) || (option == EnumOptionsMinimap + .BLOCKTRANSPARENCY) || + (option == EnumOptionsMinimap.BIOMES)) && (!this.options.multicore) && + (this.options.getOptionBooleanValue(option))) { + text = "§c" + text; + } + GuiOptionButtonMinimap var7 = new GuiOptionButtonMinimap(option.returnEnumOrdinal(), var1 + var2 % 2 * 160, + getHeight() / 6 + 24 * (var2 >> 1), option, text); + + this.buttonList.add(var7); + + var2++; + } + this.buttonList + .add(new GuiButton(200, getWidth() / 2 - 100, getHeight() / 6 + 168, I18nUtils.getString("gui.done"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if ((par1GuiButton.id < 100) && ((par1GuiButton instanceof GuiOptionButtonMinimap))) { + this.options.setOptionValue(((GuiOptionButtonMinimap) par1GuiButton).returnEnumOptions(), 1); + String perfBomb = ""; + if (((par1GuiButton.id == EnumOptionsMinimap.WATERTRANSPARENCY.ordinal()) || + (par1GuiButton.id == EnumOptionsMinimap.BLOCKTRANSPARENCY.ordinal()) || + (par1GuiButton.id == EnumOptionsMinimap.BIOMES.ordinal())) && (!this.options.multicore) && + (this.options.getOptionBooleanValue(EnumOptionsMinimap.getEnumOptions(par1GuiButton.id)))) { + perfBomb = "§c"; + } + par1GuiButton.displayString = (perfBomb + this.options + .getKeyText(EnumOptionsMinimap.getEnumOptions(par1GuiButton.id))); + } + if (par1GuiButton.id == 200) { + getMinecraft().displayGuiScreen(this.parentScreen); + } + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + drawDefaultBackground(); + drawCenteredString(getFontRenderer(), this.screenTitle, getWidth() / 2, 20, 16777215); + super.drawScreen(par1, par2, par3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMobs.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMobs.java new file mode 100644 index 0000000..0f19d97 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiMobs.java @@ -0,0 +1,129 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.RadarSettingsManager; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.util.CustomMob; +import com.thevoxelbox.voxelmap.util.CustomMobsManager; +import com.thevoxelbox.voxelmap.util.EnumMobs; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class GuiMobs + extends GuiScreenMinimap { + protected final RadarSettingsManager options; + private final GuiScreen parentScreen; + protected String screenTitle = "Select Mobs"; + protected String selectedMobName = null; + private GuiSlotMobs mobsList; + private GuiButton buttonEnable; + private GuiButton buttonDisable; + private String tooltip = null; + + public GuiMobs(GuiScreen parentScreen, RadarSettingsManager options) { + this.parentScreen = parentScreen; + this.options = options; + } + + static String setTooltip(GuiMobs par0GuiWaypoints, String par1Str) { + return par0GuiWaypoints.tooltip = par1Str; + } + + public void initGui() { + int var2 = 0; + this.screenTitle = I18nUtils.getString("options.minimap.mobs.title"); + + this.mobsList = new GuiSlotMobs(this); + this.mobsList.func_148134_d(7, 8); + + getButtonList().add(this.buttonEnable = new GuiButton(-1, getWidth() / 2 - 154, getHeight() - 28, 100, 20, + I18nUtils.getString("options.minimap.mobs.enable"))); + getButtonList().add(this.buttonDisable = new GuiButton(-2, getWidth() / 2 - 50, getHeight() - 28, 100, 20, + I18nUtils.getString("options.minimap.mobs.disable"))); + getButtonList().add(new GuiButton(65336, getWidth() / 2 + 4 + 50, getHeight() - 28, 100, 20, + I18nUtils.getString("gui.done"))); + + boolean isSomethingSelected = this.selectedMobName != null; + this.buttonEnable.enabled = isSomethingSelected; + this.buttonDisable.enabled = isSomethingSelected; + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if (par1GuiButton.id == -1) { + setMobEnabled(this.selectedMobName, true); + } + if (par1GuiButton.id == -2) { + setMobEnabled(this.selectedMobName, false); + } + if (par1GuiButton.id == 65336) { + getMinecraft().displayGuiScreen(this.parentScreen); + } + } + } + + protected void setSelectedMob(String mob) { + this.selectedMobName = mob; + } + + private boolean isMobEnabled(String selectedMobName2) { + EnumMobs mob = EnumMobs.getMobByName(this.selectedMobName); + if (mob != null) { + return mob.enabled; + } + CustomMob customMob = CustomMobsManager.getCustomMobByName(this.selectedMobName); + if (customMob != null) { + return customMob.enabled; + } + return false; + } + + private void setMobEnabled(String selectedMobName, boolean enabled) { + for (EnumMobs mob : EnumMobs.values()) { + if (mob.name.equals(selectedMobName)) { + mob.enabled = enabled; + } + } + for (CustomMob mob : CustomMobsManager.mobs) { + if (mob.name.equals(selectedMobName)) { + mob.enabled = enabled; + } + } + } + + protected void toggleMobVisibility() { + EnumMobs mob = EnumMobs.getMobByName(this.selectedMobName); + if (mob != null) { + setMobEnabled(this.selectedMobName, !mob.enabled); + } else { + CustomMob customMob = CustomMobsManager.getCustomMobByName(this.selectedMobName); + if (customMob != null) { + setMobEnabled(this.selectedMobName, !customMob.enabled); + } + } + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + this.tooltip = null; + this.mobsList.func_148128_a(par1, par2, par3); + drawCenteredString(getFontRenderer(), this.screenTitle, getWidth() / 2, 20, 16777215); + boolean isSomethingSelected = this.selectedMobName != null; + this.buttonEnable.enabled = ((isSomethingSelected) && (!isMobEnabled(this.selectedMobName))); + this.buttonDisable.enabled = ((isSomethingSelected) && (isMobEnabled(this.selectedMobName))); + super.drawScreen(par1, par2, par3); + if (this.tooltip != null) { + drawTooltip(this.tooltip, par1, par2); + } + } + + protected void drawTooltip(String par1Str, int par2, int par3) { + if (par1Str != null) { + int var4 = par2 + 12; + int var5 = par3 - 12; + int var6 = getFontRenderer().getStringWidth(par1Str); + drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); + getFontRenderer().drawStringWithShadow(par1Str, var4, var5, -1); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiRadarOptions.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiRadarOptions.java new file mode 100644 index 0000000..db43db3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiRadarOptions.java @@ -0,0 +1,112 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.RadarSettingsManager; +import com.thevoxelbox.voxelmap.gui.overridden.EnumOptionsMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiOptionButtonMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class GuiRadarOptions + extends GuiScreenMinimap { + private static final EnumOptionsMinimap[] relevantOptions = {EnumOptionsMinimap.SHOWRADAR, + EnumOptionsMinimap.RANDOMOBS, + EnumOptionsMinimap.SHOWHOSTILES, + EnumOptionsMinimap.SHOWNEUTRALS, + EnumOptionsMinimap.SHOWPLAYERS, + EnumOptionsMinimap.SHOWPLAYERNAMES, + EnumOptionsMinimap.SHOWPLAYERHELMETS, + EnumOptionsMinimap.SHOWMOBHELMETS, + EnumOptionsMinimap.RADARFILTERING, + EnumOptionsMinimap.RADAROUTLINES}; + private final GuiScreen parent; + private final RadarSettingsManager options; + protected String screenTitle = "Radar Options"; + private IVoxelMap master; + + public GuiRadarOptions(GuiScreen parent, IVoxelMap master) { + this.parent = parent; + this.options = master.getRadarOptions(); + } + + public void initGui() { + int var2 = 0; + + this.screenTitle = I18nUtils.getString("options.minimap.radar.title"); + for (int t = 0; t < relevantOptions.length; t++) { + EnumOptionsMinimap option = relevantOptions[t]; + + GuiOptionButtonMinimap var7 = new GuiOptionButtonMinimap(option.returnEnumOrdinal(), + getWidth() / 2 - 155 + var2 % 2 * 160, getHeight() / 6 + 24 * (var2 >> 1), option, + this.options.getKeyText(option)); + + getButtonList().add(var7); + + var2++; + } + for (Object buttonObj : getButtonList()) { + if ((buttonObj instanceof GuiOptionButtonMinimap)) { + GuiOptionButtonMinimap button = (GuiOptionButtonMinimap) buttonObj; + if (!button.returnEnumOptions().equals(EnumOptionsMinimap.SHOWRADAR)) { + button.enabled = this.options.show; + } + if ((button.returnEnumOptions().equals(EnumOptionsMinimap.SHOWPLAYERHELMETS)) || + (button.returnEnumOptions().equals(EnumOptionsMinimap.SHOWPLAYERNAMES))) { + button.enabled = ((button.enabled) && (this.options.showPlayers)); + } else if (button.returnEnumOptions().equals(EnumOptionsMinimap.SHOWMOBHELMETS)) { + button.enabled = ((button.enabled) && ((this.options.showNeutrals) || (this.options + .showHostiles))); + } + } + } + getButtonList().add(new GuiButton(101, getWidth() / 2 - 155, getHeight() / 6 + 144 - 6, 150, 20, + I18nUtils.getString("options.minimap.radar.selectmobs"))); + getButtonList() + .add(new GuiButton(200, getWidth() / 2 - 100, getHeight() / 6 + 168, I18nUtils.getString("gui.done"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if ((par1GuiButton.id < 100) && ((par1GuiButton instanceof GuiOptionButtonMinimap))) { + this.options.setOptionValue(((GuiOptionButtonMinimap) par1GuiButton).returnEnumOptions(), 1); + par1GuiButton.displayString = this.options + .getKeyText(EnumOptionsMinimap.getEnumOptions(par1GuiButton.id)); + for (Object buttonObj : getButtonList()) { + if ((buttonObj instanceof GuiOptionButtonMinimap)) { + GuiOptionButtonMinimap button = (GuiOptionButtonMinimap) buttonObj; + if (!button.returnEnumOptions().equals(EnumOptionsMinimap.SHOWRADAR)) { + button.enabled = this.options.show; + } + if ((button.returnEnumOptions() == EnumOptionsMinimap.SHOWPLAYERHELMETS) || + (button.returnEnumOptions() == EnumOptionsMinimap.SHOWPLAYERNAMES)) { + button.enabled = ((button.enabled) && (this.options.showPlayers)); + } else if (button.returnEnumOptions().equals(EnumOptionsMinimap.SHOWMOBHELMETS)) { + button.enabled = ((button.enabled) && + ((this.options.showNeutrals) || (this.options.showHostiles))); + } + } else if ((buttonObj instanceof GuiButton)) { + GuiButton button = (GuiButton) buttonObj; + if (button.id == 101) { + button.enabled = this.options.show; + } + } + } + } + if (par1GuiButton.id == 101) { + getMinecraft().displayGuiScreen(new GuiMobs(this, this.options)); + } + if (par1GuiButton.id == 200) { + getMinecraft().displayGuiScreen(this.parent); + } + } + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + drawDefaultBackground(); + drawCenteredString(getFontRenderer(), this.screenTitle, getWidth() / 2, 20, 16777215); + super.drawScreen(par1, par2, par3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiScreenAddWaypoint.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiScreenAddWaypoint.java new file mode 100644 index 0000000..118394f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiScreenAddWaypoint.java @@ -0,0 +1,279 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.interfaces.IColorManager; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.interfaces.IWaypointManager; +import com.thevoxelbox.voxelmap.util.Dimension; +import com.thevoxelbox.voxelmap.util.GLUtils; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import com.thevoxelbox.voxelmap.util.Waypoint; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import java.util.Random; + +public class GuiScreenAddWaypoint + extends GuiScreenMinimap { + protected Dimension selectedDimension = null; + protected Waypoint waypoint; + IVoxelMap master; + IWaypointManager waypointManager; + IColorManager colorManager; + private final GuiWaypoints parentGui; + private GuiSlotDimensions dimensionList; + private String tooltip = null; + private GuiTextField waypointName; + private GuiTextField waypointX; + private GuiTextField waypointZ; + private GuiTextField waypointY; + private GuiButton buttonEnabled; + private boolean choosingColor = false; + private final float red; + private final float green; + private final float blue; + private final boolean enabled; + private final Random generator = new Random(); + + public GuiScreenAddWaypoint(IVoxelMap master, GuiWaypoints par1GuiScreen, Waypoint par2Waypoint) { + this.master = master; + this.waypointManager = master.getWaypointManager(); + this.colorManager = master.getColorManager(); + this.parentGui = par1GuiScreen; + this.waypoint = par2Waypoint; + + this.red = this.waypoint.red; + this.green = this.waypoint.green; + this.blue = this.waypoint.blue; + this.enabled = this.waypoint.enabled; + } + + static String setTooltip(GuiScreenAddWaypoint par0GuiWaypoint, String par1Str) { + return par0GuiWaypoint.tooltip = par1Str; + } + + public void updateScreen() { + this.waypointName.updateCursorCounter(); + this.waypointX.updateCursorCounter(); + } + + public void initGui() { + Keyboard.enableRepeatEvents(true); + getButtonList().clear(); + + getButtonList().add(new GuiButton(0, getWidth() / 2 - 155, getHeight() / 6 + 168, 150, 20, + I18nUtils.getString("addServer.add"))); + getButtonList().add(new GuiButton(1, getWidth() / 2 + 5, getHeight() / 6 + 168, 150, 20, + I18nUtils.getString("gui.cancel"))); + this.waypointName = new GuiTextField(getFontRenderer(), getWidth() / 2 - 100, getHeight() / 6 + 0 + 13, 200, + 20); + this.waypointName.setFocused(true); + + this.waypointName.setText(this.waypoint.name); + this.waypointX = new GuiTextField(getFontRenderer(), getWidth() / 2 - 100, getHeight() / 6 + 41 + 13, 56, 20); + this.waypointX.setMaxStringLength(128); + this.waypointX.setText("" + this.waypoint.getX()); + this.waypointZ = new GuiTextField(getFontRenderer(), getWidth() / 2 - 28, getHeight() / 6 + 41 + 13, 56, 20); + this.waypointZ.setMaxStringLength(128); + this.waypointZ.setText("" + this.waypoint.getZ()); + this.waypointY = new GuiTextField(getFontRenderer(), getWidth() / 2 + 44, getHeight() / 6 + 41 + 13, 56, 20); + this.waypointY.setMaxStringLength(128); + this.waypointY.setText("" + this.waypoint.getY()); + getButtonList().add( + this.buttonEnabled = new GuiButton(2, getWidth() / 2 - 101, getHeight() / 6 + 82 + 6, 100, 20, + "Enabled: " + (this.waypoint.enabled ? "On" : "Off"))); + ((GuiButton) getButtonList().get(0)).enabled = (this.waypointName.getText().length() > 0); + + this.dimensionList = new GuiSlotDimensions(this); + this.dimensionList.registerScrollButtons(7, 8); + } + + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if (par1GuiButton.id == 2) { + this.waypoint.enabled = (!this.waypoint.enabled); + } + if (par1GuiButton.id == 1) { + this.waypoint.red = this.red; + this.waypoint.green = this.green; + this.waypoint.blue = this.blue; + this.waypoint.enabled = this.enabled; + if (this.parentGui != null) { + this.parentGui.confirmClicked(false, 0); + } else { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + this.mc.entityRenderer.stopUseShader(); + } + getMinecraft().displayGuiScreen(null); + } + } else if (par1GuiButton.id == 0) { + this.waypoint.name = this.waypointName.getText(); + this.waypoint.setX(Integer.parseInt(this.waypointX.getText())); + this.waypoint.setZ(Integer.parseInt(this.waypointZ.getText())); + this.waypoint.setY(Integer.parseInt(this.waypointY.getText())); + if (this.parentGui != null) { + this.parentGui.confirmClicked(true, 0); + } else { + this.waypointManager.addWaypoint(this.waypoint); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + Minecraft.getMinecraft().entityRenderer.stopUseShader(); + } + getMinecraft().displayGuiScreen(null); + } + } + } + } + + protected void keyTyped(char par1, int par2) { + this.waypointName.keyTyped(par1, par2); + this.waypointX.keyTyped(par1, par2); + this.waypointZ.keyTyped(par1, par2); + this.waypointY.keyTyped(par1, par2); + if (par1 == '\t') { + if (this.waypointName.isFocused()) { + this.waypointName.setFocused(false); + this.waypointX.setFocused(true); + this.waypointZ.setFocused(false); + this.waypointY.setFocused(false); + } else if (this.waypointX.isFocused()) { + this.waypointName.setFocused(false); + this.waypointX.setFocused(false); + this.waypointZ.setFocused(true); + this.waypointY.setFocused(false); + } else if (this.waypointZ.isFocused()) { + this.waypointName.setFocused(false); + this.waypointX.setFocused(false); + this.waypointZ.setFocused(false); + this.waypointY.setFocused(true); + } else if (this.waypointY.isFocused()) { + this.waypointName.setFocused(true); + this.waypointX.setFocused(false); + this.waypointZ.setFocused(false); + this.waypointY.setFocused(false); + } + } + if (par1 == '\r') { + actionPerformed((GuiButton) getButtonList().get(0)); + } + boolean acceptable = this.waypointName.getText().length() > 0; + try { + int x = Integer.parseInt(this.waypointX.getText()); + acceptable = acceptable; + } catch (NumberFormatException e) { + acceptable = false; + } + try { + int z = Integer.parseInt(this.waypointZ.getText()); + acceptable = acceptable; + } catch (NumberFormatException e) { + acceptable = false; + } + try { + int y = Integer.parseInt(this.waypointY.getText()); + acceptable = acceptable; + } catch (NumberFormatException e) { + acceptable = false; + } + ((GuiButton) getButtonList().get(0)).enabled = acceptable; + if (par2 == 1) { + this.waypoint.red = this.red; + this.waypoint.green = this.green; + this.waypoint.blue = this.blue; + this.waypoint.enabled = this.enabled; + } + super.keyTyped(par1, par2); + } + + protected void mouseClicked(int par1, int par2, int mouseButton) { + if (!this.choosingColor) { + super.mouseClicked(par1, par2, mouseButton); + this.waypointName.mouseClicked(par1, par2, mouseButton); + this.waypointX.mouseClicked(par1, par2, mouseButton); + this.waypointZ.mouseClicked(par1, par2, mouseButton); + this.waypointY.mouseClicked(par1, par2, mouseButton); + if ((par1 >= getWidth() / 2 + 85) && (par1 <= getWidth() / 2 + 101) && + (par2 >= getHeight() / 6 + 82 + 11) && (par2 <= getHeight() / 6 + 82 + 21)) { + this.choosingColor = true; + } + } else if ((par1 >= getWidth() / 2 - 128) && (par1 <= getWidth() / 2 + 128) && + (par2 >= getHeight() / 2 - 128) && (par2 <= getHeight() / 2 + 128)) { + int color = this.colorManager.getColorPicker() + .getRGB(par1 - (getWidth() / 2 - 128), par2 - (getHeight() / 2 - 128)); + this.waypoint.red = ((color >> 16 & 0xFF) / 255.0F); + this.waypoint.green = ((color >> 8 & 0xFF) / 255.0F); + this.waypoint.blue = ((color >> 0 & 0xFF) / 255.0F); + this.choosingColor = false; + } + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + this.tooltip = null; + this.buttonEnabled.displayString = (I18nUtils.getString("minimap.waypoints.enabled") + " " + + (this.waypoint.enabled ? I18nUtils.getString("options.on") : + I18nUtils.getString("options.off"))); + drawDefaultBackground(); + this.dimensionList.drawScreen(par1, par2, par3); + + drawCenteredString(getFontRenderer(), (this.parentGui != null) && (this.parentGui.editClicked) ? + I18nUtils.getString("minimap.waypoints.edit") : I18nUtils.getString("minimap.waypoints.new"), + getWidth() / 2, 20, 16777215); + + drawString(getFontRenderer(), I18nUtils.getString("minimap.waypoints.name"), getWidth() / 2 - 100, + getHeight() / 6 + 0, 10526880); + drawString(getFontRenderer(), I18nUtils.getString("X"), getWidth() / 2 - 100, getHeight() / 6 + 41, 10526880); + drawString(getFontRenderer(), I18nUtils.getString("Z"), getWidth() / 2 - 28, getHeight() / 6 + 41, 10526880); + drawString(getFontRenderer(), I18nUtils.getString("Y"), getWidth() / 2 + 44, getHeight() / 6 + 41, 10526880); + drawString(getFontRenderer(), I18nUtils.getString("minimap.waypoints.choosecolor"), getWidth() / 2 + 10, + getHeight() / 6 + 82 + 11, 10526880); + + this.waypointName.drawTextBox(); + this.waypointX.drawTextBox(); + this.waypointZ.drawTextBox(); + this.waypointY.drawTextBox(); + GL11.glColor4f(this.waypoint.red, this.waypoint.green, this.waypoint.blue, 1.0F); + + GLUtils.disp(-1); + drawTexturedModalRect(getWidth() / 2 + 85, getHeight() / 6 + 82 + 11, 0, 0, 16, 10); + super.drawScreen(par1, par2, par3); + if (this.choosingColor) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GLUtils.img(new ResourceLocation("voxelmap/images/colorPicker.png")); + drawTexturedModalRect(getWidth() / 2 - 128, getHeight() / 2 - 128, 0, 0, 256, 256); + } + drawTooltip(this.tooltip, par1, par2); + } + + public void setSelectedDimension(Dimension dimension) { + this.selectedDimension = dimension; + } + + public void toggleDimensionSelected() { + if ((this.waypoint.dimensions.size() > 1) && + (this.waypoint.dimensions.contains(Integer.valueOf(this.selectedDimension.ID))) && + (this.selectedDimension.ID != Minecraft.getMinecraft().thePlayer.dimension)) { + this.waypoint.dimensions.remove(new Integer(this.selectedDimension.ID)); + } else if (!this.waypoint.dimensions.contains(Integer.valueOf(this.selectedDimension.ID))) { + this.waypoint.dimensions.add(new Integer(this.selectedDimension.ID)); + } + } + + protected void drawTooltip(String par1Str, int par2, int par3) { + if (par1Str != null) { + int var4 = par2 + 12; + int var5 = par3 - 12; + int var6 = getFontRenderer().getStringWidth(par1Str); + drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); + getFontRenderer().drawStringWithShadow(par1Str, var4, var5, -1); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotDimensions.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotDimensions.java new file mode 100644 index 0000000..a7668ee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotDimensions.java @@ -0,0 +1,106 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.gui.overridden.GuiSlotMinimap; +import com.thevoxelbox.voxelmap.interfaces.IDimensionManager; +import com.thevoxelbox.voxelmap.util.Dimension; +import com.thevoxelbox.voxelmap.util.GLUtils; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.Tessellator; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +class GuiSlotDimensions + extends GuiSlotMinimap { + final GuiScreenAddWaypoint parentGui; + private final IDimensionManager dimensionManager; + + public GuiSlotDimensions(GuiScreenAddWaypoint par1GuiWaypoints) { + super(Minecraft.getMinecraft(), par1GuiWaypoints.getWidth(), par1GuiWaypoints.getHeight(), + par1GuiWaypoints.getHeight() / 6 + 123 - 14, par1GuiWaypoints.getHeight() / 6 + 164 + 3, 18); + this.parentGui = par1GuiWaypoints; + setSlotWidth(175); + setSlotXBoundsFromLeft((this.parentGui.getWidth() - this.slotWidth) / 2); + + setShowSelectionBox(false); + setShowTopBottomBG(false); + setShowSlotBG(false); + this.dimensionManager = this.parentGui.master.getDimensionManager(); + scrollBy(this.dimensionManager.getDimensions().indexOf(this.dimensionManager + .getDimensionByID(this.parentGui.waypoint.dimensions.first().intValue())) * + this.slotHeight); + } + + protected int getSize() { + return this.dimensionManager.getDimensions().size(); + } + + protected void elementClicked(int par1, boolean par2, int x, int y) { + this.parentGui.setSelectedDimension(this.dimensionManager.getDimensions().get(par1)); + + int leftEdge = this.parentGui.getWidth() / 2 - this.slotWidth / 2; + byte padding = 4; + byte iconWidth = 16; + + int width = this.slotWidth; + if ((this.mouseX >= leftEdge + width - iconWidth - padding) && (this.mouseX <= leftEdge + width)) { + this.parentGui.toggleDimensionSelected(); + } else if (par2) { + Mouse.next(); + this.parentGui.toggleDimensionSelected(); + return; + } + } + + protected boolean isSelected(int par1) { + return this.dimensionManager.getDimensions().get(par1).equals(this.parentGui.selectedDimension); + } + + protected int getContentHeight() { + return getSize() * 18; + } + + protected void drawBackground() { + } + + protected void overlayBackground(int par1, int par2, int par3, int par4) { + } + + protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator, int x, int y) { + Dimension dim = this.dimensionManager.getDimensions().get(par1); + String name = dim.name; + if ((name.equals("notLoaded")) || (name.equals("failedToLoad"))) { + name = "dimension " + dim.ID + "(" + Minecraft.getMinecraft().theWorld.provider.getClass().getSimpleName + () + + ")"; + } + this.parentGui + .drawCenteredString(this.parentGui.getFontRenderer(), dim.name, this.parentGui.getWidth() / 2, par3 + + 3, + 16777215); + + byte padding = 4; + byte iconWidth = 16; + par2 = this.parentGui.getWidth() / 2 - this.slotWidth / 2; + int width = this.slotWidth; + if ((this.mouseX >= par2 + padding) && (this.mouseY >= par3) && (this.mouseX <= par2 + width + padding) && + (this.mouseY <= par3 + this.slotHeight)) { + String tooltip = null; + if ((this.mouseX >= par2 + width - iconWidth - padding) && (this.mouseX <= par2 + width)) { + tooltip = this.parentGui.waypoint.dimensions.contains(Integer.valueOf(dim.ID)) ? + I18nUtils.getString("minimap.waypoints.dimension.applies") : + I18nUtils.getString("minimap.waypoints.dimension.notapplies"); + } else { + tooltip = null; + } + GuiScreenAddWaypoint.setTooltip(this.parentGui, tooltip); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GLUtils.img("textures/gui/container/beacon.png"); + int xOffset = this.parentGui.waypoint.dimensions.contains(Integer.valueOf(dim.ID)) ? 91 : 113; + int yOffset = 222; + Gui.drawTexturedModalRect(par2 + width - iconWidth, par3 - 2, xOffset, yOffset, 16, 16); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotMobs.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotMobs.java new file mode 100644 index 0000000..39fef35 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotMobs.java @@ -0,0 +1,139 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.RadarSettingsManager; +import com.thevoxelbox.voxelmap.util.CustomMob; +import com.thevoxelbox.voxelmap.util.CustomMobsManager; +import com.thevoxelbox.voxelmap.util.EnumMobs; +import com.thevoxelbox.voxelmap.util.GLUtils; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import java.text.Collator; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.StatCollector; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +class GuiSlotMobs + extends GuiSlot { + final GuiMobs parentGui; + private final ArrayList mobNames; + private final RadarSettingsManager options; + + public GuiSlotMobs(GuiMobs par1GuiMobs) { + super(par1GuiMobs.options.game, par1GuiMobs.getWidth(), par1GuiMobs.getHeight(), 32, + par1GuiMobs.getHeight() - 41 + 4, 18); + this.parentGui = par1GuiMobs; + this.options = this.parentGui.options; + this.mobNames = new ArrayList(); + for (EnumMobs mob : EnumMobs.values()) { + if ((mob.isTopLevelUnit) && (((mob.isHostile) && (this.options.showHostiles)) || + ((mob.isNeutral) && (this.options.showNeutrals)))) { + this.mobNames.add(mob.name); + } + } + for (CustomMob mob : CustomMobsManager.mobs) { + if (((mob.isHostile) && (this.options.showHostiles)) || ((mob.isNeutral) && (this.options.showNeutrals))) { + this.mobNames.add(mob.name); + } + } + final Collator collator = I18nUtils.getLocaleAwareCollator(); + Collections.sort(this.mobNames, new Comparator() { + public int compare(String name1, String name2) { + name1 = GuiSlotMobs.getTranslatedName(name1); + name2 = GuiSlotMobs.getTranslatedName(name2); + + return collator.compare(name1, name2); + } + }); + } + + private static String getTranslatedName(String name) { + name = StatCollector.translateToLocal("entity." + name + ".name"); + + name = name.replaceAll("^entity.", "").replaceAll(".name$", ""); + return name; + } + + protected int getSize() { + return this.mobNames.size(); + } + + protected void elementClicked(int par1, boolean par2, int par3, int par4) { + this.parentGui.setSelectedMob(this.mobNames.get(par1)); + + int leftEdge = this.parentGui.getWidth() / 2 - 92 - 16; + byte padding = 3; + + int width = 215; + if ((this.field_148150_g >= leftEdge + width - 16 - padding) && + (this.field_148150_g <= leftEdge + width + padding)) { + this.parentGui.toggleMobVisibility(); + } else if (par2) { + Mouse.next(); + this.parentGui.toggleMobVisibility(); + return; + } + } + + protected boolean isSelected(int par1) { + return this.mobNames.get(par1).equals(this.parentGui.selectedMobName); + } + + protected int func_148138_e() { + return getSize() * 18; + } + + protected void drawBackground() { + this.parentGui.drawDefaultBackground(); + } + + protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator, int par6, int par7) { + String name = this.mobNames.get(par1); + boolean isHostile = false; + boolean isNeutral = false; + boolean isEnabled = true; + EnumMobs mob = EnumMobs.getMobByName(name); + if (mob != null) { + isHostile = mob.isHostile; + isNeutral = mob.isNeutral; + isEnabled = mob.enabled; + } else { + CustomMob customMob = CustomMobsManager.getCustomMobByName(name); + if (customMob != null) { + isHostile = customMob.isHostile; + isNeutral = customMob.isNeutral; + isEnabled = customMob.enabled; + } + } + int red = isHostile ? 255 : 0; + int green = isNeutral ? 255 : 0; + int color = -16777216 + (red << 16) + (green << 8) + 0; + this.parentGui.drawCenteredString(this.parentGui.getFontRenderer(), getTranslatedName(name), + this.parentGui.getWidth() / 2, par3 + 3, color); + + byte padding = 3; + if ((this.field_148150_g >= par2 - padding) && (this.field_148162_h >= par3) && + (this.field_148150_g <= par2 + 215 + padding) && (this.field_148162_h <= par3 + this.field_148149_f)) { + String tooltip; + if ((this.field_148150_g >= par2 + 215 - 16 - padding) && (this.field_148150_g <= par2 + 215 + padding)) { + tooltip = isEnabled ? I18nUtils.getString("options.minimap.mobs.disable") : + I18nUtils.getString("options.minimap.mobs.enable"); + } else { + tooltip = isEnabled ? I18nUtils.getString("options.minimap.mobs.enabled") : + I18nUtils.getString("options.minimap.mobs.disabled"); + } + GuiMobs.setTooltip(this.parentGui, tooltip); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GLUtils.img("textures/gui/container/inventory.png"); + int xOffset = isEnabled ? 72 : 90; + int yOffset = 216; + Gui.drawTexturedModalRect(par2 + 198, par3 - 2, xOffset, yOffset, 16, 16); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotWaypoints.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotWaypoints.java new file mode 100644 index 0000000..7b4fdde --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiSlotWaypoints.java @@ -0,0 +1,145 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.util.GLUtils; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import com.thevoxelbox.voxelmap.util.Waypoint; +import java.text.Collator; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +class GuiSlotWaypoints + extends GuiSlot { + final GuiWaypoints parentGui; + private final ArrayList waypoints; + + public GuiSlotWaypoints(GuiWaypoints par1GuiWaypoints) { + super(par1GuiWaypoints.options.game, par1GuiWaypoints.getWidth(), par1GuiWaypoints.getHeight(), 54, + par1GuiWaypoints.getHeight() - 65 + 4, 18); + this.parentGui = par1GuiWaypoints; + this.waypoints = new ArrayList(); + for (Waypoint pt : this.parentGui.waypointManager.getWaypoints()) { + if ((pt.inWorld) && (pt.inDimension)) { + this.waypoints.add(pt); + } + } + } + + protected int getSize() { + return this.waypoints.size(); + } + + protected void elementClicked(int par1, boolean par2, int par3, int par4) { + this.parentGui.setSelectedWaypoint(this.waypoints.get(par1)); + + int leftEdge = this.parentGui.getWidth() / 2 - 92 - 16; + byte padding = 3; + + int width = 215; + if ((this.field_148150_g >= leftEdge + width - 16 - padding) && + (this.field_148150_g <= leftEdge + width + padding)) { + this.parentGui.toggleWaypointVisibility(); + } else if (par2) { + Mouse.next(); + this.parentGui.editWaypoint(this.parentGui.selectedWaypoint); + return; + } + } + + protected boolean isSelected(int par1) { + return this.waypoints.get(par1).equals(this.parentGui.selectedWaypoint); + } + + protected int func_148138_e() { + return getSize() * 18; + } + + protected void drawBackground() { + this.parentGui.drawDefaultBackground(); + } + + protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator, int par6, int par7) { + Waypoint waypoint = this.waypoints.get(par1); + this.parentGui.drawCenteredString(this.parentGui.getFontRenderer(), waypoint.isAutomated ? + EnumChatFormatting.GRAY + "(Server) " + EnumChatFormatting.RESET + waypoint.name : waypoint + .name, + this.parentGui.getWidth() / 2, par3 + 3, waypoint.getUnified()); + + byte padding = 3; + if ((this.field_148150_g >= par2 - padding) && (this.field_148162_h >= par3) && + (this.field_148150_g <= par2 + 215 + padding) && (this.field_148162_h <= par3 + this.field_148149_f)) { + String tooltip; + if ((this.field_148150_g >= par2 + 215 - 16 - padding) && (this.field_148150_g <= par2 + 215 + padding)) { + tooltip = waypoint.enabled ? I18nUtils.getString("minimap.waypoints.disable") : + I18nUtils.getString("minimap.waypoints.enable"); + } else { + tooltip = "X: " + waypoint.getX() + " Z: " + waypoint.getZ(); + if (waypoint.getY() > 0) { + tooltip = tooltip + " Y: " + waypoint.getY(); + } + } + GuiWaypoints.setTooltip(this.parentGui, tooltip); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + GLUtils.img("textures/gui/container/inventory.png"); + int xOffset = waypoint.enabled ? 72 : 90; + int yOffset = 216; + Gui.drawTexturedModalRect(par2 + 198, par3 - 2, xOffset, yOffset, 16, 16); + } + + protected void sortBy(int sortKey, boolean ascending) { + final int order = ascending ? 1 : -1; + this.parentGui.options.getClass(); + if (sortKey == 1) { + final ArrayList masterWaypointsList = this.parentGui.waypointManager.getWaypoints(); + Collections.sort(this.waypoints, new Comparator() { + public int compare(Waypoint waypoint1, Waypoint waypoint2) { + return Double.compare(masterWaypointsList.indexOf(waypoint1), + masterWaypointsList.indexOf(waypoint2)) * order; + } + }); + } else { + this.parentGui.options.getClass(); + if (sortKey == 3) { + if (ascending) { + Collections.sort(this.waypoints); + } else { + Collections.sort(this.waypoints, Collections.reverseOrder()); + } + } else { + this.parentGui.options.getClass(); + if (sortKey == 2) { + final Collator collator = I18nUtils.getLocaleAwareCollator(); + Collections.sort(this.waypoints, new Comparator() { + public int compare(Waypoint waypoint1, Waypoint waypoint2) { + return collator.compare(waypoint1.name, waypoint2.name) * order; + } + }); + } else { + this.parentGui.options.getClass(); + if (sortKey == 4) { + Collections.sort(this.waypoints, new Comparator() { + public int compare(Waypoint waypoint1, Waypoint waypoint2) { + float hue1 = java.awt.Color + .RGBtoHSB((int) (waypoint1.red * 255.0F), (int) (waypoint1.green * 255.0F), + (int) (waypoint1.blue * 255.0F), null)[0]; + float hue2 = java.awt.Color + .RGBtoHSB((int) (waypoint2.red * 255.0F), (int) (waypoint2.green * 255.0F), + (int) (waypoint2.blue * 255.0F), null)[0]; + return Double.compare(hue1, hue2) * order; + } + }); + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiWaypoints.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiWaypoints.java new file mode 100644 index 0000000..6282e30 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiWaypoints.java @@ -0,0 +1,309 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import com.thevoxelbox.voxelmap.interfaces.IWaypointManager; +import com.thevoxelbox.voxelmap.util.GameVariableAccessShim; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import com.thevoxelbox.voxelmap.util.Waypoint; +import java.util.Random; +import java.util.TreeSet; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; + +public class GuiWaypoints extends GuiScreenMinimap implements GuiYesNoCallback { + protected final MapSettingsManager options; + protected final IWaypointManager waypointManager; + private final GuiScreen parentScreen; + protected String screenTitle = "Waypoints"; + protected boolean editClicked = false; + protected Waypoint selectedWaypoint = null; + protected Waypoint newWaypoint = null; + private final IVoxelMap master; + private GuiSlotWaypoints waypointList; + private GuiButton buttonEdit; + private GuiButton buttonDelete; + private boolean deleteClicked = false; + private GuiButton buttonTeleport; + private GuiButton buttonSortName; + private GuiButton buttonSortCreated; + private GuiButton buttonSortDistance; + private GuiButton buttonSortColor; + private boolean addClicked = false; + private String tooltip = null; + private final Random generator = new Random(); + private boolean changedSort = false; + + public GuiWaypoints(GuiScreen parentScreen, IVoxelMap master) { + this.master = master; + this.parentScreen = parentScreen; + this.options = master.getMapOptions(); + this.waypointManager = master.getWaypointManager(); + } + + static String setTooltip(GuiWaypoints par0GuiWaypoints, String par1Str) { + return par0GuiWaypoints.tooltip = par1Str; + } + + static GuiButton getButtonEdit(GuiWaypoints par0GuiWaypoints) { + return par0GuiWaypoints.buttonEdit; + } + + static GuiButton getButtonDelete(GuiWaypoints par0GuiWaypoints) { + return par0GuiWaypoints.buttonDelete; + } + + static GuiButton getButtonTeleport(GuiWaypoints par0GuiWaypoints) { + return par0GuiWaypoints.buttonTeleport; + } + + public void initGui() { + int var2 = 0; + this.screenTitle = I18nUtils.getString("minimap.waypoints.title"); + + this.waypointList = new GuiSlotWaypoints(this); + this.waypointList.func_148134_d(7, 8); + + this.options.getClass(); + getButtonList().add(this.buttonSortName = new GuiButton(2, getWidth() / 2 - 154, 34, 77, 20, + I18nUtils.getString("minimap.waypoints.sortbyname"))); + this.options.getClass(); + getButtonList().add(this.buttonSortDistance = new GuiButton(3, getWidth() / 2 - 77, 34, 77, 20, + I18nUtils.getString("minimap.waypoints.sortbydistance"))); + this.options.getClass(); + getButtonList().add(this.buttonSortCreated = new GuiButton(1, getWidth() / 2, 34, 77, 20, + I18nUtils.getString("minimap.waypoints.sortbycreated"))); + this.options.getClass(); + getButtonList().add(this.buttonSortColor = new GuiButton(4, getWidth() / 2 + 77, 34, 77, 20, + I18nUtils.getString("minimap.waypoints.sortbycolor"))); + + getButtonList().add(this.buttonEdit = new GuiButton(-1, getWidth() / 2 - 154, getHeight() - 52, 100, 20, + I18nUtils.getString("selectServer.edit"))); + getButtonList().add(this.buttonDelete = new GuiButton(-2, getWidth() / 2 - 50, getHeight() - 52, 100, 20, + I18nUtils.getString("selectServer.delete"))); + getButtonList().add(this.buttonTeleport = new GuiButton(-3, getWidth() / 2 + 4 + 50, getHeight() - 52, 100, 20, + I18nUtils.getString("minimap.waypoints.teleportto"))); + + getButtonList().add(new GuiButton(-4, getWidth() / 2 - 154, getHeight() - 28, 100, 20, + I18nUtils.getString("minimap.waypoints.newwaypoint"))); + getButtonList().add(new GuiButton(-5, getWidth() / 2 - 50, getHeight() - 28, 100, 20, + I18nUtils.getString("menu.options"))); + getButtonList().add(new GuiButton(65336, getWidth() / 2 + 4 + 50, getHeight() - 28, 100, 20, + I18nUtils.getString("gui.done"))); + + boolean isSomethingSelected = this.selectedWaypoint != null; + this.buttonEdit.enabled = isSomethingSelected; + this.buttonDelete.enabled = isSomethingSelected; + this.buttonTeleport.enabled = ((isSomethingSelected) && (canTeleport())); + + sort(); + } + + private void sort() { + int sortKey = Math.abs(this.options.sort); + boolean ascending = this.options.sort > 0; + this.waypointList.sortBy(sortKey, ascending); + String arrow = ascending ? "↑" : "↓"; + this.options.getClass(); + if (sortKey == 2) { + this.buttonSortName.displayString = (arrow + " " + I18nUtils.getString("mco.configure.world.name") + " " + + arrow); + } else { + this.buttonSortName.displayString = I18nUtils.getString("mco.configure.world.name"); + } + this.options.getClass(); + if (sortKey == 3) { + this.buttonSortDistance.displayString = (arrow + " " + + I18nUtils.getString("minimap.waypoints.sortbydistance") + " " + + arrow); + } else { + this.buttonSortDistance.displayString = I18nUtils.getString("minimap.waypoints.sortbydistance"); + } + this.options.getClass(); + if (sortKey == 1) { + this.buttonSortCreated.displayString = (arrow + " " + + I18nUtils.getString("minimap.waypoints.sortbycreated") + " " + + arrow); + } else { + this.buttonSortCreated.displayString = I18nUtils.getString("minimap.waypoints.sortbycreated"); + } + this.options.getClass(); + if (sortKey == 4) { + this.buttonSortColor.displayString = (arrow + " " + I18nUtils.getString("minimap.waypoints.sortbycolor") + + " " + arrow); + } else { + this.buttonSortColor.displayString = I18nUtils.getString("minimap.waypoints.sortbycolor"); + } + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if (par1GuiButton.id > 0) { + this.options.setSort(par1GuiButton.id); + this.changedSort = true; + sort(); + } + if (par1GuiButton.id == -1) { + editWaypoint(this.selectedWaypoint); + } + if (par1GuiButton.id == -2) { + String var2 = this.selectedWaypoint.name; + if (var2 != null) { + this.deleteClicked = true; + String var4 = I18nUtils.getString("minimap.waypoints.deleteconfirm"); + String var5 = "'" + var2 + "' " + I18nUtils.getString("selectServer.deleteWarning"); + String var6 = I18nUtils.getString("selectServer.deleteButton"); + String var7 = I18nUtils.getString("gui.cancel"); + GuiYesNo var8 = new GuiYesNo(this, var4, var5, var6, var7, + this.waypointManager.getWaypoints().indexOf(this.selectedWaypoint)); + getMinecraft().displayGuiScreen(var8); + } + } + if (par1GuiButton.id == -3) { + if (this.options.game.isIntegratedServerRunning()) { + this.options.game.thePlayer.sendChatMessage("/ztp " + this.selectedWaypoint.name); + getMinecraft().displayGuiScreen(null); + } else { + if (this.selectedWaypoint.getY() > 0) { + this.options.game.thePlayer.sendChatMessage( + "/tp " + this.options.game.thePlayer.getCommandSenderName() + " " + + this.selectedWaypoint.getX() + " " + this.selectedWaypoint.getY() + " " + + this.selectedWaypoint.getZ()); + this.options.game.thePlayer.sendChatMessage( + "/tppos " + this.selectedWaypoint.getX() + " " + this.selectedWaypoint.getY() + " " + + this.selectedWaypoint.getZ()); + } else { + this.options.game.thePlayer.sendChatMessage( + "/tp " + this.options.game.thePlayer.getCommandSenderName() + " " + + this.selectedWaypoint.getX() + " " + + (this.options.game.thePlayer.dimension != -1 ? "128" : "64") + " " + + this.selectedWaypoint.getZ()); + this.options.game.thePlayer.sendChatMessage("/tppos " + this.selectedWaypoint.getX() + " " + + (this.options.game.thePlayer.dimension != -1 ? + "256" : "64") + " " + + this.selectedWaypoint.getZ()); + } + getMinecraft().displayGuiScreen(null); + } + } + if (par1GuiButton.id == -4) { + addWaypoint(); + } + if (par1GuiButton.id == -5) { + getMinecraft().displayGuiScreen(new GuiWaypointsOptions(this, this.options)); + } + if (par1GuiButton.id == 65336) { + getMinecraft().displayGuiScreen(this.parentScreen); + } + } + } + + public void confirmClicked(boolean par1, int par2) { + if (this.deleteClicked) { + this.deleteClicked = false; + if (par1) { + this.waypointManager.deleteWaypoint(this.selectedWaypoint); + this.selectedWaypoint = null; + } + getMinecraft().displayGuiScreen(this); + } + if (this.editClicked) { + this.editClicked = false; + if (par1) { + this.waypointManager.saveWaypoints(); + } + getMinecraft().displayGuiScreen(this); + } + if (this.addClicked) { + this.addClicked = false; + if (par1) { + this.waypointManager.addWaypoint(this.newWaypoint); + setSelectedWaypoint(this.newWaypoint); + } + getMinecraft().displayGuiScreen(this); + } + } + + protected void setSelectedWaypoint(Waypoint waypoint) { + this.selectedWaypoint = waypoint; + boolean isSomethingSelected = this.selectedWaypoint != null; + this.buttonEdit.enabled = isSomethingSelected; + this.buttonDelete.enabled = isSomethingSelected; + this.buttonTeleport.enabled = ((isSomethingSelected) && (canTeleport())); + } + + protected void editWaypoint(Waypoint waypoint) { + this.editClicked = true; + getMinecraft().displayGuiScreen(new GuiScreenAddWaypoint(this.master, this, waypoint)); + } + + protected void addWaypoint() { + this.addClicked = true; + float r; + float g; + float b; + if (this.waypointManager.getWaypoints().size() == 0) { + r = 0.0F; + g = 1.0F; + b = 0.0F; + } else { + r = this.generator.nextFloat(); + g = this.generator.nextFloat(); + b = this.generator.nextFloat(); + } + TreeSet dimensions = new TreeSet(); + dimensions.add(Integer.valueOf(this.options.game.thePlayer.dimension)); + this.newWaypoint = new Waypoint("", + this.options.game.thePlayer.dimension != -1 ? GameVariableAccessShim.xCoord() : + GameVariableAccessShim.xCoord() * 8, + this.options.game.thePlayer.dimension != -1 ? GameVariableAccessShim.zCoord() : + GameVariableAccessShim.zCoord() * 8, GameVariableAccessShim.yCoord() - 1, true, r, g, b, "", + this.master.getWaypointManager().getCurrentSubworldDescriptor(), dimensions); + getMinecraft().displayGuiScreen(new GuiScreenAddWaypoint(this.master, this, this.newWaypoint)); + } + + protected void toggleWaypointVisibility() { + this.selectedWaypoint.enabled = (!this.selectedWaypoint.enabled); + this.waypointManager.saveWaypoints(); + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + this.tooltip = null; + this.waypointList.func_148128_a(par1, par2, par3); + + drawCenteredString(getFontRenderer(), this.screenTitle, getWidth() / 2, 20, 16777215); + super.drawScreen(par1, par2, par3); + if (this.tooltip != null) { + drawTooltip(this.tooltip, par1, par2); + } + } + + protected void drawTooltip(String par1Str, int par2, int par3) { + if (par1Str != null) { + int var4 = par2 + 12; + int var5 = par3 - 12; + int var6 = getFontRenderer().getStringWidth(par1Str); + drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); + getFontRenderer().drawStringWithShadow(par1Str, var4, var5, -1); + } + } + + public boolean canTeleport() { + boolean singlePlayer = this.options.game.isIntegratedServerRunning(); + if (singlePlayer) { + return net.minecraft.server.MinecraftServer.getServer().worldServers[0].getWorldInfo() + .areCommandsAllowed(); + } + return true; + } + + public void onGuiClosed() { + if (this.changedSort) { + super.onGuiClosed(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiWaypointsOptions.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiWaypointsOptions.java new file mode 100644 index 0000000..3f325cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/GuiWaypointsOptions.java @@ -0,0 +1,72 @@ +package com.thevoxelbox.voxelmap.gui; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.gui.overridden.EnumOptionsMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiOptionButtonMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiOptionSliderMinimap; +import com.thevoxelbox.voxelmap.gui.overridden.GuiScreenMinimap; +import com.thevoxelbox.voxelmap.util.I18nUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class GuiWaypointsOptions + extends GuiScreenMinimap { + private static final EnumOptionsMinimap[] relevantOptions = {EnumOptionsMinimap.WAYPOINTDISTANCE, + EnumOptionsMinimap.DEATHPOINTS}; + private final GuiScreen parent; + private final MapSettingsManager options; + protected String screenTitle = "Radar Options"; + + public GuiWaypointsOptions(GuiScreen parent, MapSettingsManager options) { + this.parent = parent; + this.options = options; + } + + public void initGui() { + int var2 = 0; + + this.screenTitle = I18nUtils.getString("options.minimap.waypoints.title"); + for (int t = 0; t < relevantOptions.length; t++) { + EnumOptionsMinimap option = relevantOptions[t]; + if (option.getEnumFloat()) { + float distance = this.options.getOptionFloatValue(option); + if (distance < 0.0F) { + distance = 10001.0F; + } + distance = (distance - 50.0F) / 9951.0F; + getButtonList().add(new GuiOptionSliderMinimap(option.returnEnumOrdinal(), + getWidth() / 2 - 155 + var2 % 2 * 160, getHeight() / 6 + 24 * (var2 >> 1), option, distance, + this.options)); + } else { + GuiOptionButtonMinimap var7 = new GuiOptionButtonMinimap(option.returnEnumOrdinal(), + getWidth() / 2 - 155 + var2 % 2 * 160, getHeight() / 6 + 24 * (var2 >> 1), option, + this.options.getKeyText(option)); + + getButtonList().add(var7); + } + var2++; + } + getButtonList() + .add(new GuiButton(200, getWidth() / 2 - 100, getHeight() / 6 + 168, I18nUtils.getString("gui.done"))); + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if ((par1GuiButton.id < 100) && ((par1GuiButton instanceof GuiOptionButtonMinimap))) { + this.options.setOptionValue(((GuiOptionButtonMinimap) par1GuiButton).returnEnumOptions(), 1); + par1GuiButton.displayString = this.options + .getKeyText(EnumOptionsMinimap.getEnumOptions(par1GuiButton.id)); + } + if (par1GuiButton.id == 200) { + getMinecraft().displayGuiScreen(this.parent); + } + } + } + + public void drawScreen(int par1, int par2, float par3) { + super.drawMap(); + drawDefaultBackground(); + drawCenteredString(this.fontRendererObj, this.screenTitle, getWidth() / 2, 20, 16777215); + super.drawScreen(par1, par2, par3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/EnumOptionsMinimap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/EnumOptionsMinimap.java new file mode 100644 index 0000000..b3314e8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/EnumOptionsMinimap.java @@ -0,0 +1,78 @@ +package com.thevoxelbox.voxelmap.gui.overridden; + +public enum EnumOptionsMinimap { + COORDS("options.minimap.showcoordinates", false, true, false), + HIDE("options.minimap.hideminimap", false, true, false), + CAVEMODE("options.minimap.cavemode", false, true, false), + LIGHTING("options.minimap.dynamiclighting", false, true, false), + TERRAIN("options.minimap.terraindepth", false, false, true), + SQUARE("options.minimap.squaremap", false, true, false), + OLDNORTH("options.minimap.oldnorth", false, true, false), + BEACONS("options.minimap.ingamewaypoints", false, false, true), + WELCOME("Welcome Screen", false, true, false), + ZOOM("option.minimapZoom", false, true, false), + LOCATION("options.minimap.location", false, false, true), + SIZE("options.minimap.size", false, false, true), + FILTERING("options.minimap.filtering", false, true, false), + WATERTRANSPARENCY("options.minimap.watertransparency", false, true, false), + BLOCKTRANSPARENCY("options.minimap.blocktransparency", false, true, false), + BIOMES("options.minimap.biomes", false, true, false), + BIOMEOVERLAY("options.minimap.biomeoverlay", false, false, true), + CHUNKGRID("options.minimap.chunkgrid", false, true, false), + SHOWRADAR("options.minimap.radar.showradar", false, true, false), + SHOWHOSTILES("options.minimap.radar.showhostiles", false, true, false), + SHOWPLAYERS("options.minimap.radar.showplayers", false, true, false), + SHOWNEUTRALS("options.minimap.radar.showneutrals", false, true, false), + SHOWPLAYERHELMETS("options.minimap.radar.showplayerhelmets", false, true, false), + SHOWMOBHELMETS("options.minimap.radar.showmobhelmets", false, true, false), + SHOWPLAYERNAMES("options.minimap.radar.showplayernames", false, true, false), + RADAROUTLINES("options.minimap.radar.iconoutlines", false, true, false), + RADARFILTERING("options.minimap.radar.iconfiltering", false, true, false), + RANDOMOBS("options.minimap.radar.randomobs", false, true, false), + WAYPOINTDISTANCE("options.minimap.waypoints.distance", true, false, false), + DEATHPOINTS("options.minimap.waypoints.deathpoints", false, false, true); + + private final boolean enumFloat; + private final boolean enumBoolean; + private final boolean enumList; + private final String enumString; + + EnumOptionsMinimap(String par3Str, boolean par4, boolean par5, boolean par6) { + this.enumString = par3Str; + this.enumFloat = par4; + this.enumBoolean = par5; + this.enumList = par6; + } + + public static EnumOptionsMinimap getEnumOptions(int par0) { + EnumOptionsMinimap[] var1 = values(); + int var2 = var1.length; + for (int var3 = 0; var3 < var2; var3++) { + EnumOptionsMinimap var4 = var1[var3]; + if (var4.returnEnumOrdinal() == par0) { + return var4; + } + } + return null; + } + + public boolean getEnumFloat() { + return this.enumFloat; + } + + public boolean getEnumBoolean() { + return this.enumBoolean; + } + + public boolean getEnumList() { + return this.enumList; + } + + public int returnEnumOrdinal() { + return ordinal(); + } + + public String getEnumString() { + return this.enumString; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiOptionButtonMinimap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiOptionButtonMinimap.java new file mode 100644 index 0000000..45540fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiOptionButtonMinimap.java @@ -0,0 +1,26 @@ +package com.thevoxelbox.voxelmap.gui.overridden; + +import net.minecraft.client.gui.GuiButton; + +public class GuiOptionButtonMinimap + extends GuiButton { + private final EnumOptionsMinimap enumOptions; + + public GuiOptionButtonMinimap(int par1, int par2, int par3, String par4Str) { + this(par1, par2, par3, null, par4Str); + } + + public GuiOptionButtonMinimap(int par1, int par2, int par3, int par4, int par5, String par6Str) { + super(par1, par2, par3, par4, par5, par6Str); + this.enumOptions = null; + } + + public GuiOptionButtonMinimap(int par1, int par2, int par3, EnumOptionsMinimap par4EnumOptions, String par5Str) { + super(par1, par2, par3, 150, 20, par5Str); + this.enumOptions = par4EnumOptions; + } + + public EnumOptionsMinimap returnEnumOptions() { + return this.enumOptions; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiOptionSliderMinimap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiOptionSliderMinimap.java new file mode 100644 index 0000000..f59db1a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiOptionSliderMinimap.java @@ -0,0 +1,67 @@ +package com.thevoxelbox.voxelmap.gui.overridden; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import org.lwjgl.opengl.GL11; + +public class GuiOptionSliderMinimap + extends GuiButton { + public float sliderValue = 1.0F; + public boolean dragging = false; + private final MapSettingsManager options; + private EnumOptionsMinimap idFloat = null; + + public GuiOptionSliderMinimap(int par1, int par2, int par3, EnumOptionsMinimap par4EnumOptions, float par6, + MapSettingsManager options) { + super(par1, par2, par3, 150, 20, ""); + this.options = options; + this.idFloat = par4EnumOptions; + this.sliderValue = par6; + this.displayString = this.options.getKeyText(par4EnumOptions); + } + + public int getHoverState(boolean par1) { + return 0; + } + + protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) { + if (this.field_146125_m) { + if (this.dragging) { + this.sliderValue = ((par2 - (this.field_146128_h + 4)) / (this.field_146120_f - 8)); + if (this.sliderValue < 0.0F) { + this.sliderValue = 0.0F; + } + if (this.sliderValue > 1.0F) { + this.sliderValue = 1.0F; + } + this.options.setOptionFloatValue(this.idFloat, this.sliderValue); + this.displayString = this.options.getKeyText(this.idFloat); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + drawTexturedModalRect(this.field_146128_h + (int) (this.sliderValue * (this.field_146120_f - 8)), this.field_146129_i, 0, 66, 4, 20); + drawTexturedModalRect(this.field_146128_h + (int) (this.sliderValue * (this.field_146120_f - 8)) + 4, this.field_146129_i, 196, 66, 4, 20); + } + } + + public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { + if (super.mousePressed(par1Minecraft, par2, par3)) { + this.sliderValue = ((par2 - (this.field_146128_h + 4)) / (this.field_146120_f - 8)); + if (this.sliderValue < 0.0F) { + this.sliderValue = 0.0F; + } + if (this.sliderValue > 1.0F) { + this.sliderValue = 1.0F; + } + this.options.setOptionFloatValue(this.idFloat, this.sliderValue); + this.displayString = this.options.getKeyText(this.idFloat); + this.dragging = true; + return true; + } + return false; + } + + public void mouseReleased(int par1, int par2) { + this.dragging = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiScreenMinimap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiScreenMinimap.java new file mode 100644 index 0000000..09e6e1f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiScreenMinimap.java @@ -0,0 +1,44 @@ +package com.thevoxelbox.voxelmap.gui.overridden; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.interfaces.AbstractVoxelMap; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiScreen; +import org.lwjgl.opengl.GL11; + +public class GuiScreenMinimap + extends GuiScreen { + public void drawMap() { + if (!AbstractVoxelMap.instance.getMapOptions().showUnderMenus) { + AbstractVoxelMap.instance.getMap().drawMinimap(this.mc); + + GL11.glClear(256); + } + } + + public void onGuiClosed() { + MapSettingsManager.instance.saveAll(); + } + + public Minecraft getMinecraft() { + return this.mc; + } + + public int getWidth() { + return this.width; + } + + public int getHeight() { + return this.height; + } + + public List getButtonList() { + return this.buttonList; + } + + public FontRenderer getFontRenderer() { + return this.fontRendererObj; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiSlotMinimap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiSlotMinimap.java new file mode 100644 index 0000000..6f12be0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/gui/overridden/GuiSlotMinimap.java @@ -0,0 +1,410 @@ +package com.thevoxelbox.voxelmap.gui.overridden; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public abstract class GuiSlotMinimap { + protected final int slotHeight; + private final Minecraft mc; + protected int width; + protected int top; + protected int bottom; + protected int right; + protected int left; + protected int slotWidth = 220; + protected int mouseX; + protected int mouseY; + protected boolean field_148163_i = true; + protected int headerPadding; + private int height; + private int scrollUpButtonID; + private int scrollDownButtonID; + private float initialClickY = -2.0F; + private float scrollMultiplier; + private float amountScrolled; + private int selectedElement = -1; + private long lastClicked; + private boolean showSelectionBox = true; + private boolean showTopBottomBG = true; + private boolean showSlotBG = true; + private boolean hasListHeader; + private boolean field_148164_v = true; + + public GuiSlotMinimap(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) { + this.mc = par1Minecraft; + this.width = par2; + this.height = par3; + this.top = par4; + this.bottom = par5; + this.slotHeight = par6; + this.left = 0; + this.right = par2; + } + + public void func_148122_a(int p_148122_1_, int p_148122_2_, int p_148122_3_, int p_148122_4_) { + this.width = p_148122_1_; + this.height = p_148122_2_; + this.top = p_148122_3_; + this.bottom = p_148122_4_; + this.left = 0; + this.right = p_148122_1_; + } + + public void setShowSelectionBox(boolean p_148130_1_) { + this.showSelectionBox = p_148130_1_; + } + + public void setShowTopBottomBG(boolean par1) { + this.showTopBottomBG = par1; + } + + public void setShowSlotBG(boolean par1) { + this.showSlotBG = par1; + } + + protected void setHasListHeader(boolean p_148133_1_, int p_148133_2_) { + this.hasListHeader = p_148133_1_; + this.headerPadding = p_148133_2_; + if (!p_148133_1_) { + this.headerPadding = 0; + } + } + + protected abstract int getSize(); + + protected abstract void elementClicked(int paramInt1, boolean paramBoolean, int paramInt2, int paramInt3); + + protected abstract boolean isSelected(int paramInt); + + protected int getContentHeight() { + return getSize() * this.slotHeight + this.headerPadding; + } + + protected abstract void drawBackground(); + + protected abstract void drawSlot(int paramInt1, int paramInt2, int paramInt3, int paramInt4, + Tessellator paramTessellator, int paramInt5, int paramInt6); + + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) { + } + + protected void func_148132_a(int p_148132_1_, int p_148132_2_) { + } + + protected void func_148142_b(int p_148142_1_, int p_148142_2_) { + } + + public int func_148124_c(int p_148124_1_, int p_148124_2_) { + int var3 = this.left + this.width / 2 - getListWidth() / 2; + int var4 = this.left + this.width / 2 + getListWidth() / 2; + int var5 = p_148124_2_ - this.top - this.headerPadding + (int) this.amountScrolled - 4; + int var6 = var5 / this.slotHeight; + return (p_148124_1_ < getScrollBarX()) && (p_148124_1_ >= var3) && (p_148124_1_ <= var4) && (var6 >= 0) && + (var5 >= 0) && (var6 < getSize()) ? var6 : -1; + } + + public void registerScrollButtons(int p_148134_1_, int p_148134_2_) { + this.scrollUpButtonID = p_148134_1_; + this.scrollDownButtonID = p_148134_2_; + } + + private void bindAmountScrolled() { + int var1 = func_148135_f(); + if (var1 < 0) { + var1 /= 2; + } + if ((!this.field_148163_i) && (var1 < 0)) { + var1 = 0; + } + if (this.amountScrolled < 0.0F) { + this.amountScrolled = 0.0F; + } + if (this.amountScrolled > var1) { + this.amountScrolled = var1; + } + } + + public int func_148135_f() { + return getContentHeight() - (this.bottom - this.top - 4); + } + + public int getAmountScrolled() { + return (int) this.amountScrolled; + } + + public boolean func_148141_e(int p_148141_1_) { + return (p_148141_1_ >= this.top) && (p_148141_1_ <= this.bottom); + } + + public void scrollBy(int p_148145_1_) { + this.amountScrolled += p_148145_1_; + bindAmountScrolled(); + this.initialClickY = -2.0F; + } + + public void actionPerformed(GuiButton p_148147_1_) { + if (p_148147_1_.enabled) { + if (p_148147_1_.id == this.scrollUpButtonID) { + this.amountScrolled -= this.slotHeight * 2 / 3; + this.initialClickY = -2.0F; + bindAmountScrolled(); + } else if (p_148147_1_.id == this.scrollDownButtonID) { + this.amountScrolled += this.slotHeight * 2 / 3; + this.initialClickY = -2.0F; + bindAmountScrolled(); + } + } + } + + public void drawScreen(int p_148128_1_, int p_148128_2_, float p_148128_3_) { + this.mouseX = p_148128_1_; + this.mouseY = p_148128_2_; + drawBackground(); + int var4 = getSize(); + int var5 = getScrollBarX(); + int var6 = var5 + 6; + if ((p_148128_1_ > this.left) && (p_148128_1_ < this.right) && (p_148128_2_ > this.top) && + (p_148128_2_ < this.bottom)) { + if ((Mouse.isButtonDown(0)) && (func_148125_i())) { + if (this.initialClickY == -1.0F) { + boolean var15 = true; + if ((p_148128_2_ >= this.top) && (p_148128_2_ <= this.bottom)) { + int var8 = this.width / 2 - getListWidth() / 2; + int var9 = this.width / 2 + getListWidth() / 2; + int var10 = p_148128_2_ - this.top - this.headerPadding + (int) this.amountScrolled - 4; + int var11 = var10 / this.slotHeight; + if ((p_148128_1_ >= var8) && (p_148128_1_ <= var9) && (var11 >= 0) && (var10 >= 0) && + (var11 < var4)) { + boolean var12 = (var11 == this.selectedElement) && + (Minecraft.getSystemTime() - this.lastClicked < 250L); + elementClicked(var11, var12, p_148128_1_, p_148128_2_); + this.selectedElement = var11; + this.lastClicked = Minecraft.getSystemTime(); + } else if ((p_148128_1_ >= var8) && (p_148128_1_ <= var9) && (var10 < 0)) { + func_148132_a(p_148128_1_ - var8, p_148128_2_ - this.top + (int) this.amountScrolled - 4); + var15 = false; + } + if ((p_148128_1_ >= var5) && (p_148128_1_ <= var6)) { + this.scrollMultiplier = -1.0F; + int var19 = func_148135_f(); + if (var19 < 1) { + var19 = 1; + } + int var13 = (this.bottom - this.top) * (this.bottom - this.top) / + getContentHeight(); + if (var13 < 32) { + var13 = 32; + } + if (var13 > this.bottom - this.top - 8) { + var13 = this.bottom - this.top - 8; + } + this.scrollMultiplier /= (this.bottom - this.top - var13) / var19; + } else { + this.scrollMultiplier = 1.0F; + } + if (var15) { + this.initialClickY = p_148128_2_; + } else { + this.initialClickY = -2.0F; + } + } else { + this.initialClickY = -2.0F; + } + } else if (this.initialClickY >= 0.0F) { + this.amountScrolled -= (p_148128_2_ - this.initialClickY) * this.scrollMultiplier; + this.initialClickY = p_148128_2_; + } + } else { + for (; (!this.mc.gameSettings.touchscreen) && (Mouse.next()); + this.mc.currentScreen.handleMouseInput()) { + int var7 = Mouse.getEventDWheel(); + if (var7 != 0) { + if (var7 > 0) { + var7 = -1; + } else if (var7 < 0) { + var7 = 1; + } + this.amountScrolled += var7 * this.slotHeight / 2; + } + } + this.initialClickY = -1.0F; + } + } + bindAmountScrolled(); + GL11.glDisable(2896); + GL11.glDisable(2912); + Tessellator var17 = Tessellator.instance; + if (this.showSlotBG) { + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var16 = 32.0F; + var17.startDrawingQuads(); + var17.setColorOpaque_I(2105376); + var17.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var16, + (this.bottom + (int) this.amountScrolled) / var16); + var17.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var16, + (this.bottom + (int) this.amountScrolled) / var16); + var17.addVertexWithUV(this.right, this.top, 0.0D, this.right / var16, + (this.top + (int) this.amountScrolled) / var16); + var17.addVertexWithUV(this.left, this.top, 0.0D, this.left / var16, + (this.top + (int) this.amountScrolled) / var16); + var17.draw(); + } + int var9 = this.left + this.width / 2 - getListWidth() / 2 + 2; + int var10 = this.top + 4 - (int) this.amountScrolled; + if (this.hasListHeader) { + drawListHeader(var9, var10, var17); + } + drawSelectionBox(var9, var10, p_148128_1_, p_148128_2_); + GL11.glDisable(2929); + byte var18 = 4; + if (this.showTopBottomBG) { + overlayBackground(0, this.top, 255, 255); + overlayBackground(this.bottom, this.height, 255, 255); + } + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 0, 1); + GL11.glDisable(3008); + GL11.glShadeModel(7425); + GL11.glDisable(3553); + if (this.showTopBottomBG) { + var17.startDrawingQuads(); + var17.setColorRGBA_I(0, 0); + var17.addVertexWithUV(this.left, this.top + var18, 0.0D, 0.0D, 1.0D); + var17.addVertexWithUV(this.right, this.top + var18, 0.0D, 1.0D, 1.0D); + var17.setColorRGBA_I(0, 255); + var17.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); + var17.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); + var17.draw(); + var17.startDrawingQuads(); + var17.setColorRGBA_I(0, 255); + var17.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); + var17.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); + var17.setColorRGBA_I(0, 0); + var17.addVertexWithUV(this.right, this.bottom - var18, 0.0D, 1.0D, 0.0D); + var17.addVertexWithUV(this.left, this.bottom - var18, 0.0D, 0.0D, 0.0D); + var17.draw(); + } + int var19 = func_148135_f(); + if (var19 > 0) { + int var13 = (this.bottom - this.top) * (this.bottom - this.top) / getContentHeight(); + if (var13 < 32) { + var13 = 32; + } + if (var13 > this.bottom - this.top - 8) { + var13 = this.bottom - this.top - 8; + } + int var14 = (int) this.amountScrolled * (this.bottom - this.top - var13) / var19 + this.top; + if (var14 < this.top) { + var14 = this.top; + } + var17.startDrawingQuads(); + var17.setColorRGBA_I(0, 255); + var17.addVertexWithUV(var5, this.bottom, 0.0D, 0.0D, 1.0D); + var17.addVertexWithUV(var6, this.bottom, 0.0D, 1.0D, 1.0D); + var17.addVertexWithUV(var6, this.top, 0.0D, 1.0D, 0.0D); + var17.addVertexWithUV(var5, this.top, 0.0D, 0.0D, 0.0D); + var17.draw(); + var17.startDrawingQuads(); + var17.setColorRGBA_I(8421504, 255); + var17.addVertexWithUV(var5, var14 + var13, 0.0D, 0.0D, 1.0D); + var17.addVertexWithUV(var6, var14 + var13, 0.0D, 1.0D, 1.0D); + var17.addVertexWithUV(var6, var14, 0.0D, 1.0D, 0.0D); + var17.addVertexWithUV(var5, var14, 0.0D, 0.0D, 0.0D); + var17.draw(); + var17.startDrawingQuads(); + var17.setColorRGBA_I(12632256, 255); + var17.addVertexWithUV(var5, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); + var17.addVertexWithUV(var6 - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); + var17.addVertexWithUV(var6 - 1, var14, 0.0D, 1.0D, 0.0D); + var17.addVertexWithUV(var5, var14, 0.0D, 0.0D, 0.0D); + var17.draw(); + } + func_148142_b(p_148128_1_, p_148128_2_); + GL11.glEnable(3553); + GL11.glShadeModel(7424); + GL11.glEnable(3008); + GL11.glDisable(3042); + } + + public void func_148143_b(boolean p_148143_1_) { + this.field_148164_v = p_148143_1_; + } + + public boolean func_148125_i() { + return this.field_148164_v; + } + + public int getListWidth() { + return this.slotWidth; + } + + public void setSlotWidth(int slotWidth) { + this.slotWidth = slotWidth; + } + + protected void drawSelectionBox(int p_148120_1_, int p_148120_2_, int p_148120_3_, int p_148120_4_) { + int var5 = getSize(); + Tessellator var6 = Tessellator.instance; + for (int var7 = 0; var7 < var5; var7++) { + int var8 = p_148120_2_ + var7 * this.slotHeight + this.headerPadding; + int topFudge = this.showTopBottomBG ? this.slotHeight - 4 : 0; + int bottomFudge = this.showTopBottomBG ? 0 : this.slotHeight - 4; + if ((var8 + bottomFudge <= this.bottom) && (var8 + topFudge >= this.top)) { + if ((this.showSelectionBox) && (isSelected(var7))) { + int var10 = this.left + (this.width / 2 - getListWidth() / 2); + int var11 = this.left + this.width / 2 + getListWidth() / 2; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(3553); + var6.startDrawingQuads(); + var6.setColorOpaque_I(8421504); + var6.addVertexWithUV(var10, var8 + topFudge + 2, 0.0D, 0.0D, 1.0D); + var6.addVertexWithUV(var11, var8 + topFudge + 2, 0.0D, 1.0D, 1.0D); + var6.addVertexWithUV(var11, var8 - 2, 0.0D, 1.0D, 0.0D); + var6.addVertexWithUV(var10, var8 - 2, 0.0D, 0.0D, 0.0D); + var6.setColorOpaque_I(0); + var6.addVertexWithUV(var10 + 1, var8 + topFudge + 1, 0.0D, 0.0D, 1.0D); + var6.addVertexWithUV(var11 - 1, var8 + topFudge + 1, 0.0D, 1.0D, 1.0D); + var6.addVertexWithUV(var11 - 1, var8 - 1, 0.0D, 1.0D, 0.0D); + var6.addVertexWithUV(var10 + 1, var8 - 1, 0.0D, 0.0D, 0.0D); + var6.draw(); + GL11.glEnable(3553); + } + drawSlot(var7, p_148120_1_, var8, topFudge, var6, p_148120_3_, p_148120_4_); + } + } + } + + protected int getScrollBarX() { + return this.width / 2 + 124; + } + + protected void overlayBackground(int p_148136_1_, int p_148136_2_, int p_148136_3_, int p_148136_4_) { + Tessellator var5 = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var6 = 32.0F; + var5.startDrawingQuads(); + var5.setColorRGBA_I(4210752, p_148136_4_); + var5.addVertexWithUV(this.left, p_148136_2_, 0.0D, 0.0D, p_148136_2_ / var6); + var5.addVertexWithUV(this.left + this.width, p_148136_2_, 0.0D, this.width / var6, p_148136_2_ / var6); + var5.setColorRGBA_I(4210752, p_148136_3_); + var5.addVertexWithUV(this.left + this.width, p_148136_1_, 0.0D, this.width / var6, p_148136_1_ / var6); + var5.addVertexWithUV(this.left, p_148136_1_, 0.0D, 0.0D, p_148136_1_ / var6); + var5.draw(); + } + + public void setSlotXBoundsFromLeft(int p_148140_1_) { + this.left = p_148140_1_; + this.right = (p_148140_1_ + this.width); + } + + public int getSlotHeight() { + return this.slotHeight; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/AbstractVoxelMap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/AbstractVoxelMap.java new file mode 100644 index 0000000..735a97b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/AbstractVoxelMap.java @@ -0,0 +1,10 @@ +package com.thevoxelbox.voxelmap.interfaces; + +public abstract class AbstractVoxelMap + implements IVoxelMap { + public static AbstractVoxelMap instance = null; + + public static AbstractVoxelMap getInstance() { + return instance; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IColorManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IColorManager.java new file mode 100644 index 0000000..e877ee6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IColorManager.java @@ -0,0 +1,35 @@ +package com.thevoxelbox.voxelmap.interfaces; + +import java.awt.image.BufferedImage; +import java.util.HashMap; +import java.util.Set; + +public interface IColorManager { + int COLOR_FAILED_LOAD = -65025; + + BufferedImage getColorPicker(); + + BufferedImage getBlockImage(int paramInt1, int paramInt2); + + boolean checkForChanges(); + + int colorAdder(int paramInt1, int paramInt2); + + int colorMultiplier(int paramInt1, int paramInt2); + + int getBlockColorWithDefaultTint(int paramInt1, int paramInt2, int paramInt3); + + int getBlockColor(int paramInt1, int paramInt2, int paramInt3); + + void setSkyColor(int paramInt); + + int getMapImageInt(); + + Set getBiomeTintsAvailable(); + + boolean isOptifineInstalled(); + + HashMap getBlockTintTables(); + + int getAirColor(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IDimensionManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IDimensionManager.java new file mode 100644 index 0000000..c5c4236 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IDimensionManager.java @@ -0,0 +1,14 @@ +package com.thevoxelbox.voxelmap.interfaces; + +import com.thevoxelbox.voxelmap.util.Dimension; +import java.util.ArrayList; + +public interface IDimensionManager { + ArrayList getDimensions(); + + Dimension getDimensionByID(int paramInt); + + void enteredDimension(int paramInt); + + void populateDimensions(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IMap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IMap.java new file mode 100644 index 0000000..d4d5362 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IMap.java @@ -0,0 +1,22 @@ +package com.thevoxelbox.voxelmap.interfaces; + +import net.minecraft.client.Minecraft; +import net.minecraft.world.chunk.Chunk; + +public interface IMap { + String getCurrentWorldName(); + + void forceFullRender(boolean paramBoolean); + + void drawMinimap(Minecraft paramMinecraft); + + void chunkCalc(Chunk paramChunk); + + float getPercentX(); + + float getPercentY(); + + void onTickInGame(Minecraft paramMinecraft); + + void setPermissions(boolean paramBoolean1, boolean paramBoolean2); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IObservableChunkChangeNotifier.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IObservableChunkChangeNotifier.java new file mode 100644 index 0000000..2c596b5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IObservableChunkChangeNotifier.java @@ -0,0 +1,10 @@ +package com.thevoxelbox.voxelmap.interfaces; + +import java.util.Observer; +import net.minecraft.world.chunk.Chunk; + +public interface IObservableChunkChangeNotifier { + void chunkChanged(Chunk paramChunk); + + void addObserver(Observer paramObserver); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IRadar.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IRadar.java new file mode 100644 index 0000000..4cd0735 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IRadar.java @@ -0,0 +1,10 @@ +package com.thevoxelbox.voxelmap.interfaces; + +import com.thevoxelbox.voxelmap.util.LayoutVariables; +import net.minecraft.client.Minecraft; + +public interface IRadar { + void loadTexturePackIcons(); + + void OnTickInGame(Minecraft paramMinecraft, LayoutVariables paramLayoutVariables); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IVoxelMap.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IVoxelMap.java new file mode 100644 index 0000000..ecf8a24 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IVoxelMap.java @@ -0,0 +1,28 @@ +package com.thevoxelbox.voxelmap.interfaces; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.RadarSettingsManager; + +public interface IVoxelMap { + IObservableChunkChangeNotifier getNotifier(); + + MapSettingsManager getMapOptions(); + + RadarSettingsManager getRadarOptions(); + + IMap getMap(); + + IRadar getRadar(); + + IColorManager getColorManager(); + + IWaypointManager getWaypointManager(); + + IDimensionManager getDimensionManager(); + + void setPermissions(boolean paramBoolean1, boolean paramBoolean2); + + void newSubWorldName(String paramString); + + void newSubWorldHash(String paramString); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IWaypointManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IWaypointManager.java new file mode 100644 index 0000000..45a2a67 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/interfaces/IWaypointManager.java @@ -0,0 +1,30 @@ +package com.thevoxelbox.voxelmap.interfaces; + +import com.thevoxelbox.voxelmap.util.Waypoint; +import java.util.ArrayList; + +public interface IWaypointManager { + ArrayList getWaypoints(); + + void deleteWaypoint(Waypoint var1); + + void saveWaypoints(); + + void addWaypoint(Waypoint var1); + + void check2dWaypoints(); + + void handleDeath(); + + void loadWaypoints(); + + void moveWaypointEntityToBack(); + + void newSubWorldName(String var1); + + void newSubWorldHash(String var1); + + void newWorld(int var1); + + String getCurrentSubworldDescriptor(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/AddonDefaultResourcePack.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/AddonDefaultResourcePack.java new file mode 100644 index 0000000..7e9c306 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/AddonDefaultResourcePack.java @@ -0,0 +1,18 @@ +package com.thevoxelbox.voxelmap.util; + +import com.google.common.collect.ImmutableSet; +import java.util.Map; +import java.util.Set; +import net.minecraft.client.resources.DefaultResourcePack; + +public class AddonDefaultResourcePack + extends DefaultResourcePack { + public static Set defaultResourceDomains = null; + private final Map mapResourceFiles; + + public AddonDefaultResourcePack(Map map, String domain) { + super(map); + defaultResourceDomains = ImmutableSet.of(domain); + this.mapResourceFiles = map; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/AddonResourcePack.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/AddonResourcePack.java new file mode 100644 index 0000000..7f26b80 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/AddonResourcePack.java @@ -0,0 +1,75 @@ +package com.thevoxelbox.voxelmap.util; + +import com.google.common.collect.ImmutableSet; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.FileResourcePack; +import net.minecraft.client.resources.FolderResourcePack; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.ResourceIndex; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +public class AddonResourcePack + implements IResourcePack { + public static Set defaultResourceDomains = null; + private final AddonDefaultResourcePack defaultResourcePack; + private final FileResourcePack fileResourcePack; + private final FolderResourcePack folderResourcePack; + private final String domain; + + public AddonResourcePack(String domain) { + this.domain = domain; + defaultResourceDomains = ImmutableSet.of(domain); + File fileAssets = (File) ReflectionUtils + .getPrivateFieldValueByType(Minecraft.getMinecraft(), Minecraft.class, File.class, 2); + this.defaultResourcePack = new AddonDefaultResourcePack(new ResourceIndex(fileAssets, domain).func_152782_a(), + domain); + this.fileResourcePack = new FileResourcePack(Minecraft.getMinecraft().mcDataDir); + this.folderResourcePack = new FolderResourcePack(Minecraft.getMinecraft().mcDataDir); + } + + public Set getResourceDomains() { + return defaultResourceDomains; + } + + public InputStream getInputStream(ResourceLocation var1) + throws IOException { + try { + return this.defaultResourcePack.getInputStream(var1); + } catch (IOException e) { + try { + return this.fileResourcePack.getInputStream(var1); + } catch (IOException iooe) { + try { + return this.folderResourcePack.getInputStream(var1); + } catch (IOException ioe) { + throw ioe; + } + } + } + } + + public boolean resourceExists(ResourceLocation var1) { + return (this.defaultResourcePack.resourceExists(var1)) || (this.fileResourcePack.resourceExists(var1)) || + (this.folderResourcePack.resourceExists(var1)); + } + + public IMetadataSection getPackMetadata(IMetadataSerializer var1, String var2) + throws IOException { + return null; + } + + public BufferedImage getPackImage() { + return null; + } + + public String getPackName() { + return this.domain + "ResourcePack"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/BlockIDRepository.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/BlockIDRepository.java new file mode 100644 index 0000000..1b3e1cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/BlockIDRepository.java @@ -0,0 +1,91 @@ +package com.thevoxelbox.voxelmap.util; + +import net.minecraft.block.Block; + +public class BlockIDRepository { + public static int airID = 0; + public static int waterID = 9; + public static int flowingWaterID = 8; + public static int lavaID = 11; + public static int flowingLavaID = 10; + public static int iceID = 79; + public static int grassID = 2; + public static int leavesID = 18; + public static int tallGrassID = 31; + public static int reedsID = 83; + public static int vineID = 106; + public static int lilypadID = 111; + public static int leaves2ID = 161; + public static int tallFlowerID = 175; + public static int cobwebID = 30; + public static int redstoneID = 55; + public static int signID = 63; + public static int woodDoorID = 64; + public static int ladderID = 65; + public static int wallSignID = 68; + public static int ironDoorID = 71; + public static int stoneButtonID = 77; + public static int fenceID = 85; + public static int fenceGateID = 107; + public static int netherFenceID = 113; + public static int cobbleWallID = 139; + public static int woodButtonID = 143; + public static Integer[] shapedIDS = {Integer.valueOf(signID), + Integer.valueOf(woodDoorID), + Integer.valueOf(ladderID), + Integer.valueOf(wallSignID), + Integer.valueOf(ironDoorID), + Integer.valueOf(stoneButtonID), + Integer.valueOf(fenceID), + Integer.valueOf(vineID), + Integer.valueOf(fenceGateID), + Integer.valueOf(netherFenceID), + Integer.valueOf(cobbleWallID), + Integer.valueOf(woodButtonID)}; + + public static void getIDs() { + airID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:air")); + + waterID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:water")); + flowingWaterID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:flowing_water")); + lavaID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:lava")); + flowingLavaID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:flowing_lava")); + iceID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:ice")); + + grassID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:grass")); + leavesID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:leaves")); + tallGrassID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:tallgrass")); + reedsID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:reeds")); + vineID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:vine")); + lilypadID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:waterlily")); + leaves2ID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:leaves2")); + tallFlowerID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:double_plant")); + + cobwebID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:web")); + + signID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:standing_sign")); + woodDoorID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:wooden_door")); + ladderID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:ladder")); + wallSignID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:wall_sign")); + ironDoorID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:iron_door")); + stoneButtonID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:stone_button")); + fenceID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:fence")); + fenceGateID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:fence_gate")); + netherFenceID = Block.blockRegistry + .getIDForObject(Block.blockRegistry.getObject("minecraft:nether_brick_fence")); + cobbleWallID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:cobblestone_wall")); + woodButtonID = Block.blockRegistry.getIDForObject(Block.blockRegistry.getObject("minecraft:wooden_button")); + shapedIDS = new Integer[]{Integer.valueOf(signID), + Integer.valueOf(woodDoorID), + Integer.valueOf(ladderID), + Integer.valueOf(wallSignID), + Integer.valueOf(ironDoorID), + Integer.valueOf(stoneButtonID), + Integer.valueOf(fenceID), + Integer.valueOf(vineID), + Integer.valueOf(fenceGateID), + Integer.valueOf(netherFenceID), + Integer.valueOf(cobbleWallID), + Integer.valueOf(woodButtonID)}; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ChatUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ChatUtils.java new file mode 100644 index 0000000..c094b90 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ChatUtils.java @@ -0,0 +1,10 @@ +package com.thevoxelbox.voxelmap.util; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; + +public class ChatUtils { + public static void chatInfo(String s) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(s)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CommandServerZanTp.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CommandServerZanTp.java new file mode 100644 index 0000000..cc04cf2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CommandServerZanTp.java @@ -0,0 +1,119 @@ +package com.thevoxelbox.voxelmap.util; + +import com.thevoxelbox.voxelmap.interfaces.IWaypointManager; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFence; +import net.minecraft.block.material.Material; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public class CommandServerZanTp + extends CommandBase { + private final IWaypointManager waypointManager; + + public CommandServerZanTp(IWaypointManager waypointManager) { + this.waypointManager = waypointManager; + } + + public String getCommandName() { + return "ztp"; + } + + public String getCommandUsage(ICommandSender par1ICommandSender) { + return "/ztp [waypointName]"; + } + + public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + if (par2ArrayOfStr.length < 1) { + throw new WrongUsageException("/ztp [waypointName]"); + } + MinecraftServer server = MinecraftServer.getServer(); + EntityPlayerMP player = null; + if (player == null) { + player = getCommandSenderAsPlayer(par1ICommandSender); + } + if (player == null) { + throw new PlayerNotFoundException(); + } + String waypointName = par2ArrayOfStr[0]; + for (int t = 1; t < par2ArrayOfStr.length; t++) { + waypointName = waypointName + " "; + waypointName = waypointName + par2ArrayOfStr[t]; + } + ArrayList waypoints = this.waypointManager.getWaypoints(); + Waypoint waypoint = null; + for (Waypoint wpt : waypoints) { + if (wpt.name.equalsIgnoreCase(waypointName)) { + waypoint = wpt; + } + } + boolean inNether = player.dimension == -1; + if ((waypoint != null) && (player.worldObj != null)) { + int bound = 30000000; + int x = parseIntBounded(par1ICommandSender, "" + waypoint.getX(), -bound, bound); + int z = parseIntBounded(par1ICommandSender, "" + waypoint.getZ(), -bound, bound); + int y = waypoint.getY(); + if (inNether) { + Chunk chunk = player.worldObj.getChunkFromBlockCoords(x, z); + player.worldObj.getChunkProvider().loadChunk(x, z); + int safeY = -1; + for (int t = 0; t < 127; t++) { + if ((y + t < 127) && (isBlockStandable(player.worldObj, x, y + t, z)) && + (isBlockOpen(player.worldObj, x, y + t + 1, z)) && + (isBlockOpen(player.worldObj, x, y + t + 2, z))) { + safeY = y + t + 1; + t = 128; + } + if ((y - t > 0) && (isBlockStandable(player.worldObj, x, y - t, z)) && + (isBlockOpen(player.worldObj, x, y - t + 1, z)) && + (isBlockOpen(player.worldObj, x, y - t + 2, z))) { + safeY = y - t + 1; + t = 128; + } + } + if (safeY == -1) { + return; + } + y = safeY; + } else { + if (waypoint.getY() == -1) { + y = player.worldObj.getHeightValue(x, z); + } + if (y == 0) { + Chunk chunk = player.worldObj.getChunkFromBlockCoords(x, z); + y = player.worldObj.getHeightValue(x, z); + } + } + player.setPositionAndUpdate(x + 0.5F, y, z + 0.5F); + } + } + + public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + return (par2ArrayOfStr.length != 1) && (par2ArrayOfStr.length != 2) ? null : + getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); + } + + private boolean isBlockStandable(World worldObj, int par1, int par2, int par3) { + Block block = worldObj.getBlock(par1, par2, par3); + if (block.getMaterial() == Material.air) { + return block instanceof BlockFence; + } + return block != null && block.getMaterial().isOpaque(); + } + + private boolean isBlockOpen(World worldObj, int par1, int par2, int par3) { + Block block = worldObj.getBlock(par1, par2, par3); + if (block.getMaterial() == Material.air) { + return !(block instanceof BlockFence); + } + return block == null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Contact.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Contact.java new file mode 100644 index 0000000..62389a7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Contact.java @@ -0,0 +1,55 @@ +package com.thevoxelbox.voxelmap.util; + +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; + +public class Contact { + public double x; + public double z; + public int y; + public int yFudge = 0; + public float angle; + public double distance; + public float brightness; + public EnumMobs type; + public String name = "_"; + public String skinURL = ""; + public Entity entity = null; + public int armorValue = -1; + public int armorColor = -1; + public Item helmet = null; + public int blockOnHead = -1; + public int blockOnHeadMetadata = -1; + public int[] refs; + + public Contact(Entity entity, EnumMobs type) { + this.entity = entity; + this.type = type; + } + + public void setName(String name) { + this.name = name; + } + + public void setBlockOnHead(int blockOnHead) { + this.blockOnHead = blockOnHead; + } + + public void setBlockOnHeadMetadata(int blockOnHeadMetadata) { + this.blockOnHeadMetadata = blockOnHeadMetadata; + } + + public void setArmor(int armorValue) { + this.armorValue = armorValue; + } + + public void setArmorColor(int armorColor) { + this.armorColor = armorColor; + } + + public void updateLocation() { + this.x = this.entity.posX; + this.y = ((int) this.entity.posY + this.yFudge); + this.z = this.entity.posZ; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CustomMob.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CustomMob.java new file mode 100644 index 0000000..ba66d62 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CustomMob.java @@ -0,0 +1,19 @@ +package com.thevoxelbox.voxelmap.util; + +public class CustomMob { + public String name = "notLoaded"; + public boolean enabled = true; + public boolean isHostile = false; + public boolean isNeutral = false; + + public CustomMob(String name, boolean enabled) { + this.name = name; + this.enabled = enabled; + } + + public CustomMob(String name, boolean isHostile, boolean isNeutral) { + this.name = name; + this.isHostile = isHostile; + this.isNeutral = isNeutral; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CustomMobsManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CustomMobsManager.java new file mode 100644 index 0000000..9363fec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/CustomMobsManager.java @@ -0,0 +1,35 @@ +package com.thevoxelbox.voxelmap.util; + +import java.util.ArrayList; + +public class CustomMobsManager { + public static ArrayList mobs = new ArrayList(); + + public static void add(String name, boolean enabled) { + CustomMob mob = getCustomMobByName(name); + if (mob != null) { + mob.enabled = enabled; + } else { + mobs.add(new CustomMob(name, enabled)); + } + } + + public static void add(String name, boolean isHostile, boolean isNeutral) { + CustomMob mob = getCustomMobByName(name); + if (mob != null) { + mob.isHostile = isHostile; + mob.isNeutral = isNeutral; + } else { + mobs.add(new CustomMob(name, isHostile, isNeutral)); + } + } + + public static CustomMob getCustomMobByName(String name) { + for (CustomMob mob : mobs) { + if (mob.name.equals(name)) { + return mob; + } + } + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Dimension.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Dimension.java new file mode 100644 index 0000000..93cdcb8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Dimension.java @@ -0,0 +1,11 @@ +package com.thevoxelbox.voxelmap.util; + +public class Dimension { + public String name = "notLoaded"; + public int ID = -10; + + public Dimension(String name, int ID) { + this.name = name; + this.ID = ID; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/DimensionManager.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/DimensionManager.java new file mode 100644 index 0000000..5f679c0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/DimensionManager.java @@ -0,0 +1,112 @@ +package com.thevoxelbox.voxelmap.util; + +import com.thevoxelbox.voxelmap.interfaces.IDimensionManager; +import com.thevoxelbox.voxelmap.interfaces.IVoxelMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import net.minecraft.client.Minecraft; +import net.minecraft.world.WorldProvider; + +public class DimensionManager + implements IDimensionManager { + public ArrayList dimensions; + IVoxelMap master; + + public DimensionManager(IVoxelMap master) { + this.master = master; + this.dimensions = new ArrayList(); + } + + public ArrayList getDimensions() { + return this.dimensions; + } + + public void populateDimensions() { + this.dimensions.clear(); + for (int t = -1; t <= 1; t++) { + String name = "notLoaded"; + WorldProvider provider = null; + try { + provider = WorldProvider.getProviderForDimension(t); + } catch (Exception e) { + provider = null; + } + if (provider != null) { + try { + name = provider.getDimensionName(); + } catch (Exception e) { + name = "failedToLoad"; + } + Dimension dim = new Dimension(name, t); + this.dimensions.add(dim); + } + } + for (Waypoint pt : this.master.getWaypointManager().getWaypoints()) { + for (Integer t : pt.dimensions) { + if (getDimensionByID(t.intValue()) == null) { + String name = "notLoaded"; + WorldProvider provider = null; + try { + provider = WorldProvider.getProviderForDimension(t.intValue()); + } catch (Exception e) { + provider = null; + } + if (provider != null) { + try { + name = provider.getDimensionName(); + } catch (Exception e) { + name = "failedToLoad"; + } + Dimension dim = new Dimension(name, t.intValue()); + this.dimensions.add(dim); + } + } + } + } + Collections.sort(this.dimensions, new Comparator() { + public int compare(Dimension dim1, Dimension dim2) { + return dim1.ID - dim2.ID; + } + }); + } + + public void enteredDimension(int ID) { + Dimension dim = getDimensionByID(ID); + if (dim == null) { + dim = new Dimension("notLoaded", ID); + this.dimensions.add(dim); + Collections.sort(this.dimensions, new Comparator() { + public int compare(Dimension dim1, Dimension dim2) { + return dim1.ID - dim2.ID; + } + }); + } + if ((dim.name.equals("notLoaded")) || (dim.name.equals("failedToLoad"))) { + try { + dim.name = Minecraft.getMinecraft().theWorld.provider.getDimensionName(); + } catch (Exception e) { + dim.name = ("dimension " + ID + "(" + + Minecraft.getMinecraft().theWorld.provider.getClass().getSimpleName() + ")"); + } + } + } + + public Dimension getDimensionByID(int ID) { + for (Dimension dim : this.dimensions) { + if (dim.ID == ID) { + return dim; + } + } + return null; + } + + public Dimension getDimensionByName(String name) { + for (Dimension dim : this.dimensions) { + if (dim.name.equals(name)) { + return dim; + } + } + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/EntityWaypointContainer.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/EntityWaypointContainer.java new file mode 100644 index 0000000..8c0d800 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/EntityWaypointContainer.java @@ -0,0 +1,56 @@ +package com.thevoxelbox.voxelmap.util; + +import java.util.ArrayList; +import java.util.Collections; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class EntityWaypointContainer + extends Entity { + public ArrayList wayPts = new ArrayList(); + private Waypoint waypoint; + private final boolean inNether = false; + + public EntityWaypointContainer(World par1World) { + super(par1World); + this.ignoreFrustumCheck = true; + } + + public void onUpdate() { + sortWaypoints(); + } + + protected void entityInit() { + } + + protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + } + + protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + } + + public boolean isInRangeToRender3d(double x, double y, double z) { + return true; + } + + public int getBrightnessForRender(float par1) { + return 15728880; + } + + public float getBrightness(float par1) { + return 1.0F; + } + + public void addWaypoint(Waypoint newWaypoint) { + this.wayPts.add(newWaypoint); + } + + public void removeWaypoint(Waypoint point) { + this.wayPts.remove(point); + } + + public void sortWaypoints() { + Collections.sort(this.wayPts, Collections.reverseOrder()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/EnumMobs.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/EnumMobs.java new file mode 100644 index 0000000..ba86df0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/EnumMobs.java @@ -0,0 +1,93 @@ +package com.thevoxelbox.voxelmap.util; + +import net.minecraft.util.ResourceLocation; + +public enum EnumMobs { + BLANK("Blank", false, 2, 4, "textures/entity/bat.png", "", false, false), + BLANKHOSTILE("Monster", false, 8, 16, "textures/entity/zombie/zombie.png", "", true, false), + BLANKNEUTRAL("Mob", false, 8, 16, "textures/entity/pig/pig.png", "", false, true), + BLANKTAME("Unknown Tame", false, 8, 16, "textures/entity/wolf/wolf.png", "", false, true), + BAT("Bat", true, 8, 32, "textures/entity/bat.png", "", false, true), + BLAZE("Blaze", true, 8, 16, "textures/entity/blaze.png", "", true, false), + CAT("Cat", true, 5, 16, "textures/entity/cat/siamese.png", "", false, true), + CAVESPIDER("CaveSpider", true, 8, 16, "textures/entity/spider/cave_spider.png", "", true, false), + CHICKEN("Chicken", true, 6, 16, "textures/entity/chicken.png", "", false, true), + COW("Cow", true, 10, 32, "textures/entity/cow/cow.png", "", false, true), + CREEPER("Creeper", true, 8, 16, "textures/entity/creeper/creeper.png", "", true, false), + ENDERDRAGON("EnderDragon", true, 16, 32, "textures/entity/enderdragon/dragon.png", "", true, false), + ENDERMAN("Enderman", true, 8, 16, "textures/entity/enderman/enderman.png", "", true, false), + GHAST("Ghast", true, 16, 32, "textures/entity/ghast/ghast.png", "", true, false), + GHASTATTACKING("Ghast", false, 16, 32, "textures/entity/ghast/ghast_shooting.png", "", true, false), + HORSE("EntityHorse", true, 8, 32, "textures/entity/horse/horse_creamy.png", "", false, true), + IRONGOLEM("VillagerGolem", true, 8, 32, "textures/entity/iron_golem.png", "", false, true), + MAGMA("LavaSlime", true, 8, 16, "textures/entity/slime/magmacube.png", "", true, false), + MOOSHROOM("MushroomCow", true, 40, 128, "textures/entity/cow/mooshroom.png", "", false, true), + OCELOT("Ozelot", true, 5, 16, "textures/entity/cat/ocelot.png", "", false, true), + PIG("Pig", true, 8, 16, "textures/entity/pig/pig.png", "", false, true), + PIGZOMBIE("PigZombie", true, 8, 16, "textures/entity/zombie_pigman.png", "", true, true), + PLAYER("Player", false, 8, 16, "textures/entity/steve.png", "", false, false), + SHEEP("Sheep", true, 6, 16, "textures/entity/sheep/sheep.png", "", false, true), + SILVERFISH("Silverfish", true, 6, 16, "textures/entity/silverfish.png", "", true, false), + SKELETON("Skeleton", true, 8, 16, "textures/entity/skeleton/skeleton.png", "", true, false), + SKELETONWITHER("Skeleton", false, 8, 16, "textures/entity/skeleton/wither_skeleton.png", "", true, false), + SLIME("Slime", true, 8, 16, "textures/entity/slime/slime.png", "", true, false), + SNOWGOLEM("SnowMan", true, 8, 16, "textures/entity/snowman.png", "", false, true), + SPIDER("Spider", true, 8, 16, "textures/entity/spider/spider.png", "", true, false), + SPIDERJOCKEY("Skeleton", false, 8, 32, "textures/entity/skeleton/skeleton.png", "textures/entity/spider/spider" + + ".png", + true, false), + SPIDERJOCKEYWITHER("Skeleton", false, 8, 32, "textures/entity/skeleton/wither_skeleton.png", + "textures/entity/spider/spider.png", true, false), + SQUID("Squid", true, 6, 16, "textures/entity/squid.png", "", false, true), + VILLAGER("Villager", true, 8, 32, "textures/entity/villager/farmer.png", "", false, true), + WITCH("Witch", true, 10, 32, "textures/entity/witch.png", "", true, false), + WITHER("WitherBoss", true, 24, 64, "textures/entity/wither/wither.png", "", true, false), + WITHERINVULNERABLE("WitherBoss", false, 24, 64, "textures/entity/wither/wither_invulnerable.png", "", true, false), + WOLF("Wolf", true, 6, 16, "textures/entity/wolf/wolf.png", "", true, true), + WOLFANGRY("Wolf", false, 6, 16, "textures/entity/wolf/wolf_angry.png", "", true, false), + WOLFTAME("Wolf", false, 6, 16, "textures/entity/wolf/wolf_tame.png", "", false, true), + ZOMBIE("Zombie", true, 8, 16, "textures/entity/zombie/zombie.png", "", true, false), + ZOMBIEVILLAGER("Zombie", false, 8, 32, "textures/entity/zombie/zombie_villager.png", "", true, false), + UNKNOWN("Unknown", false, 8, 16, "/mob/UNKNOWN.png", "", true, true), + CUSTOM("Custom", false, 8, 16, "/mob/UNKNOWN.png", "", true, true), + AUTO("Auto", false, 8, 16, "/mob/UNKNOWN.png", "", true, true); + + public final String name; + public final boolean isTopLevelUnit; + public final int expectedWidth; + public final int squaredSize; + public final ResourceLocation resourceLocation; + public final boolean isHostile; + public final boolean isNeutral; + public ResourceLocation secondaryResourceLocation; + public boolean enabled; + + EnumMobs(String name, boolean topLevelUnit, int expectedWidth, int squaredSize, String path, + String secondaryPath, boolean isHostile, boolean isNeutral) { + this.name = name; + this.isTopLevelUnit = topLevelUnit; + this.expectedWidth = expectedWidth; + this.squaredSize = squaredSize; + this.resourceLocation = new ResourceLocation(path); + this.secondaryResourceLocation = (secondaryPath.equals("") ? null : new ResourceLocation(secondaryPath)); + this.isHostile = isHostile; + this.isNeutral = isNeutral; + this.enabled = true; + } + + public static EnumMobs getMobByName(String par0) { + EnumMobs[] var1 = values(); + int var2 = var1.length; + for (int var3 = 0; var3 < var2; var3++) { + EnumMobs var4 = var1[var3]; + if (var4.name.equals(par0)) { + return var4; + } + } + return null; + } + + public int returnEnumOrdinal() { + return ordinal(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/FilesystemUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/FilesystemUtils.java new file mode 100644 index 0000000..4126f54 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/FilesystemUtils.java @@ -0,0 +1,43 @@ +package com.thevoxelbox.voxelmap.util; + +import java.io.File; +import net.minecraft.util.Util; + +public class FilesystemUtils { + public static File getAppDir(String par0Str, boolean createIfNotExist) { + String var1 = System.getProperty("user.home", "."); + File var2; + switch (getOs().ordinal()) { + case 0: + case 1: + var2 = new File(var1, '.' + par0Str + '/'); + break; + case 2: + String var3 = System.getenv("APPDATA"); + if (var3 != null) { + var2 = new File(var3, "." + par0Str + '/'); + } else { + var2 = new File(var1, '.' + par0Str + '/'); + } + break; + case 3: + var2 = new File(var1, "Library/Application Support/" + par0Str); + break; + default: + var2 = new File(var1, par0Str + '/'); + } + if ((createIfNotExist) && + (!var2.exists()) && (!var2.mkdirs())) { + throw new RuntimeException("The working directory could not be created: " + var2); + } + return var2; + } + + public static Util.EnumOS getOs() { + String var0 = System.getProperty("os.name").toLowerCase(); + return var0.contains("unix") ? Util.EnumOS.LINUX : var0.contains("linux") ? Util.EnumOS.LINUX : + var0.contains("sunos") ? Util.EnumOS.SOLARIS : var0.contains("solaris") ? Util.EnumOS.SOLARIS : + var0.contains("mac") ? Util.EnumOS.OSX : + var0.contains("win") ? Util.EnumOS.WINDOWS : Util.EnumOS.UNKNOWN; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GLBufferedImage.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GLBufferedImage.java new file mode 100644 index 0000000..9b37e4d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GLBufferedImage.java @@ -0,0 +1,110 @@ +package com.thevoxelbox.voxelmap.util; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import com.thevoxelbox.voxelmap.interfaces.AbstractVoxelMap; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferByte; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import org.lwjgl.opengl.GL11; + +public class GLBufferedImage + extends BufferedImage { + public byte[] bytes; + public int index = 0; + private final ByteBuffer buffer; + private final Object bufferLock = new Object(); + + public GLBufferedImage(int width, int height, int imageType) { + super(width, height, imageType); + this.bytes = ((DataBufferByte) getRaster().getDataBuffer()).getData(); + this.buffer = ByteBuffer.allocateDirect(this.bytes.length).order(ByteOrder.nativeOrder()); + } + + public void baleet() { + if (this.index != 0) { + GL11.glDeleteTextures(this.index); + } + } + + public void write() { + if (this.index != 0) { + GL11.glDeleteTextures(this.index); + } else { + this.index = GL11.glGenTextures(); + } + this.buffer.clear(); + synchronized (this.bufferLock) { + this.buffer.put(this.bytes); + } + this.buffer.position(0).limit(this.bytes.length); + if ((!GLUtils.hasAlphaBits) && (!GLUtils.fboEnabled)) { + if (MapSettingsManager.instance.squareMap) { + for (int t = 0; t < getWidth(); t++) { + this.buffer.put(t * 4 + 3, (byte) 0); + this.buffer.put(t * getWidth() * 4 + 3, (byte) 0); + } + } + if ((MapSettingsManager.instance.squareMap) && + ((MapSettingsManager.instance.zoom > 0) || (AbstractVoxelMap.instance.getMap().getPercentX() > 1.0F) + )) { + for (int t = 0; t < getWidth(); t++) { + this.buffer.put(t * getWidth() * 4 + 7, (byte) 0); + } + } + if ((MapSettingsManager.instance.squareMap) && + ((MapSettingsManager.instance.zoom > 0) || (AbstractVoxelMap.instance.getMap().getPercentY() > 1.0F) + )) { + for (int t = 0; t < getWidth(); t++) { + this.buffer.put(t * 4 + 3 + getWidth() * 4, (byte) 0); + } + } + } + GL11.glBindTexture(3553, this.index); + GL11.glTexParameteri(3553, 10241, 9728); + GL11.glTexParameteri(3553, 10240, 9728); + GL11.glTexParameteri(3553, 10242, 33071); + GL11.glTexParameteri(3553, 10243, 33071); + GL11.glTexImage2D(3553, 0, 6408, getWidth(), getHeight(), 0, 32993, 5121, this.buffer); + } + + public void blank() { + for (int t = 0; t < this.bytes.length; t++) { + this.bytes[t] = 0; + } + write(); + } + + public void setRGB(int x, int y, int color24) { + int index = (x + y * getWidth()) * 4; + synchronized (this.bufferLock) { + int alpha = color24 >> 24 & 0xFF; + this.bytes[index] = ((byte) ((color24 >> 0 & 0xFF) * alpha / 255)); + this.bytes[(index + 1)] = ((byte) ((color24 >> 8 & 0xFF) * alpha / 255)); + this.bytes[(index + 2)] = ((byte) ((color24 >> 16 & 0xFF) * alpha / 255)); + this.bytes[(index + 3)] = -1; + } + } + + public void moveX(int offset) { + synchronized (this.bufferLock) { + if (offset > 0) { + System.arraycopy(this.bytes, offset * 4, this.bytes, 0, this.bytes.length - offset * 4); + } else if (offset < 0) { + System.arraycopy(this.bytes, 0, this.bytes, -offset * 4, this.bytes.length + offset * 4); + } + } + } + + public void moveY(int offset) { + synchronized (this.bufferLock) { + if (offset > 0) { + System.arraycopy(this.bytes, offset * getWidth() * 4, this.bytes, 0, + this.bytes.length - offset * getWidth() * 4); + } else if (offset < 0) { + System.arraycopy(this.bytes, 0, this.bytes, -offset * getWidth() * 4, + this.bytes.length + offset * getWidth() * 4); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GLUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GLUtils.java new file mode 100644 index 0000000..423be3c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GLUtils.java @@ -0,0 +1,124 @@ +package com.thevoxelbox.voxelmap.util; + +import java.awt.image.BufferedImage; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.EXTFramebufferObject; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; + +public class GLUtils { + private static final IntBuffer dataBuffer = GLAllocation.createDirectIntBuffer(4194304); + public static TextureManager textureManager; + public static int fboID = 0; + public static boolean fboEnabled = (GLContext.getCapabilities().GL_EXT_framebuffer_object) && + (GLContext.getCapabilities().OpenGL14); + public static int fboTextureID = 0; + public static boolean hasAlphaBits = GL11.glGetInteger(3413) > 0; + private static final Tessellator tesselator = Tessellator.instance; + private static int previousFBOID = 0; + + public static void setupFBO() { + previousFBOID = GL11.glGetInteger(36006); + fboID = EXTFramebufferObject.glGenFramebuffersEXT(); + fboTextureID = GL11.glGenTextures(); + int width = 256; + int height = 256; + EXTFramebufferObject.glBindFramebufferEXT(36160, fboID); + ByteBuffer byteBuffer = BufferUtils.createByteBuffer(4 * width * height); + + GL11.glBindTexture(3553, fboTextureID); + GL11.glTexParameteri(3553, 10242, 10496); + GL11.glTexParameteri(3553, 10243, 10496); + + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glTexImage2D(3553, 0, 6408, width, height, 0, 6408, 5120, byteBuffer); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064, 3553, fboTextureID, 0); + + int depthRenderBufferID = EXTFramebufferObject.glGenRenderbuffersEXT(); + EXTFramebufferObject.glBindRenderbufferEXT(36161, depthRenderBufferID); + EXTFramebufferObject.glRenderbufferStorageEXT(36161, 33190, 256, 256); + EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, 36096, 36161, depthRenderBufferID); + EXTFramebufferObject.glBindRenderbufferEXT(36161, 0); + + EXTFramebufferObject.glBindFramebufferEXT(36160, previousFBOID); + } + + public static void bindFrameBuffer() { + previousFBOID = GL11.glGetInteger(36006); + EXTFramebufferObject.glBindFramebufferEXT(36160, fboID); + } + + public static void unbindFrameBuffer() { + EXTFramebufferObject.glBindFramebufferEXT(36160, previousFBOID); + } + + public static void setMap(int x, int y) { + setMap(x, y, 128); + } + + public static void setMap(int x, float y, int imageSize) { + int scale = imageSize / 4; + + ldrawthree(x - scale, y + scale, 1.0D, 0.0D, 1.0D); + ldrawthree(x + scale, y + scale, 1.0D, 1.0D, 1.0D); + ldrawthree(x + scale, y - scale, 1.0D, 1.0D, 0.0D); + ldrawthree(x - scale, y - scale, 1.0D, 0.0D, 0.0D); + } + + public static int tex(BufferedImage paramImg) { + int glid = GL11.glGenTextures(); + int width = paramImg.getWidth(); + int height = paramImg.getHeight(); + int[] imageData = new int[width * height]; + paramImg.getRGB(0, 0, width, height, imageData, 0, width); + GL11.glBindTexture(3553, glid); + dataBuffer.clear(); + dataBuffer.put(imageData, 0, width * height); + dataBuffer.position(0).limit(width * height); + GL11.glTexImage2D(3553, 0, 6408, width, height, 0, 32993, 33639, dataBuffer); + return glid; + } + + public static void img(String paramStr) { + textureManager.bindTexture(new ResourceLocation(paramStr)); + } + + public static void img(ResourceLocation paramResourceLocation) { + textureManager.bindTexture(paramResourceLocation); + } + + public static void disp(int paramInt) { + GL11.glBindTexture(3553, paramInt); + } + + public static void drawPre() { + tesselator.startDrawingQuads(); + } + + public static void drawPost() { + tesselator.draw(); + } + + public static void glah(int g) { + GL11.glDeleteTextures(g); + } + + public static void ldrawone(int a, int b, double c, double d, double e) { + tesselator.addVertexWithUV(a, b, c, d, e); + } + + public static void ldrawtwo(double a, double b, double c) { + tesselator.addVertex(a, b, c); + } + + public static void ldrawthree(double a, double b, double c, double d, double e) { + tesselator.addVertexWithUV(a, b, c, d, e); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GameVariableAccessShim.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GameVariableAccessShim.java new file mode 100644 index 0000000..9fdd6ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/GameVariableAccessShim.java @@ -0,0 +1,45 @@ +package com.thevoxelbox.voxelmap.util; + +import java.io.File; +import net.minecraft.client.Minecraft; +import net.minecraft.world.World; + +public class GameVariableAccessShim { + private static final Minecraft minecraft = Minecraft.getMinecraft(); + + public static Minecraft getMinecraft() { + return minecraft; + } + + public static World getWorld() { + return minecraft.theWorld; + } + + public static File getDataDir() { + return minecraft.mcDataDir; + } + + public static int xCoord() { + return (int) (minecraft.thePlayer.posX < 0.0D ? minecraft.thePlayer.posX - 1.0D : minecraft.thePlayer.posX); + } + + public static int zCoord() { + return (int) (minecraft.thePlayer.posZ < 0.0D ? minecraft.thePlayer.posZ - 1.0D : minecraft.thePlayer.posZ); + } + + public static int yCoord() { + return (int) minecraft.thePlayer.posY; + } + + public static double xCoordDouble() { + return minecraft.thePlayer.posX; + } + + public static double zCoordDouble() { + return minecraft.thePlayer.posZ; + } + + public static float rotationYaw() { + return minecraft.thePlayer.rotationYaw; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/I18nUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/I18nUtils.java new file mode 100644 index 0000000..e167ea3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/I18nUtils.java @@ -0,0 +1,23 @@ +package com.thevoxelbox.voxelmap.util; + +import java.text.Collator; +import java.util.Locale; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; + +public class I18nUtils { + public static String getString(String translateMe) { + return I18n.format(translateMe); + } + + public static Collator getLocaleAwareCollator() { + String mcLocale = "en_US"; + try { + mcLocale = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode(); + } catch (NullPointerException e) { + } + String[] bits = mcLocale.split("_"); + Locale locale = new Locale(bits[0], bits.length > 1 ? bits[1] : ""); + return Collator.getInstance(locale); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ImageUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ImageUtils.java new file mode 100644 index 0000000..c802557 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ImageUtils.java @@ -0,0 +1,393 @@ +package com.thevoxelbox.voxelmap.util; + +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.geom.AffineTransform; +import java.awt.image.AffineTransformOp; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class ImageUtils { + public static BufferedImage createBufferedImageFromGLID(int id) { + GL11.glBindTexture(3553, id); + return createBufferedImageFromCurrentGLImage(); + } + + public static BufferedImage createBufferedImageFromCurrentGLImage() { + int width = GL11.glGetTexLevelParameteri(3553, 0, 4096); + int height = GL11.glGetTexLevelParameteri(3553, 0, 4097); + ByteBuffer byteBuffer = ByteBuffer.allocateDirect(width * height * 4).order(ByteOrder.nativeOrder()); + + GL11.glGetTexImage(3553, 0, 6408, 5121, byteBuffer); + BufferedImage image = new BufferedImage(width, height, 6); + byteBuffer.position(0); + byte[] var4 = new byte[byteBuffer.remaining()]; + byteBuffer.get(var4); + for (int var5 = 0; var5 < width; var5++) { + for (int var6 = 0; var6 < height; var6++) { + int var7 = var6 * width * 4 + var5 * 4; + byte var8 = 0; + int var10 = var8 | (var4[(var7 + 2)] & 0xFF) << 0; + var10 |= (var4[(var7 + 1)] & 0xFF) << 8; + var10 |= (var4[(var7 + 0)] & 0xFF) << 16; + var10 |= (var4[(var7 + 3)] & 0xFF) << 24; + image.setRGB(var5, var6, var10); + } + } + return image; + } + + public static BufferedImage blankImage(String path, int w, int h) { + return blankImage(path, w, h, 64, 32); + } + + public static BufferedImage blankImage(String path, int w, int h, int imageWidth, int imageHeight) { + return blankImage(path, w, h, imageWidth, imageHeight, 0, 0, 0, 0); + } + + public static BufferedImage blankImage(String path, int w, int h, int r, int g, int b, int a) { + return blankImage(path, w, h, 64, 32, r, g, b, a); + } + + public static BufferedImage blankImage(String path, int w, int h, int imageWidth, int imageHeight, int r, int g, + int b, int a) { + try { + InputStream is = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation(path)) + .getInputStream(); + + BufferedImage mobSkin = ImageIO.read(is); + is.close(); + BufferedImage temp = new BufferedImage(w * mobSkin.getWidth() / imageWidth, + h * mobSkin.getWidth() / imageWidth, 6); + Graphics2D g2 = temp.createGraphics(); + g2.setColor(new Color(r, g, b, a)); + g2.fillRect(0, 0, temp.getWidth(), temp.getHeight()); + g2.dispose(); + return temp; + } catch (Exception e) { + System.err.println("Failed getting mob: " + path + " - " + e.getLocalizedMessage()); + e.printStackTrace(); + } + return null; + } + + public static BufferedImage blankImage(BufferedImage mobSkin, int w, int h) { + return blankImage(mobSkin, w, h, 64, 32); + } + + public static BufferedImage blankImage(BufferedImage mobSkin, int w, int h, int imageWidth, int imageHeight) { + return blankImage(mobSkin, w, h, imageWidth, imageHeight, 0, 0, 0, 0); + } + + public static BufferedImage blankImage(BufferedImage mobSkin, int w, int h, int r, int g, int b, int a) { + return blankImage(mobSkin, w, h, 64, 32, r, g, b, a); + } + + public static BufferedImage blankImage(BufferedImage mobSkin, int w, int h, int imageWidth, int imageHeight, int r, + int g, int b, int a) { + BufferedImage temp = new BufferedImage(w * mobSkin.getWidth() / imageWidth, h * mobSkin.getWidth() / + imageWidth, + 6); + Graphics2D g2 = temp.createGraphics(); + g2.setColor(new Color(r, g, b, a)); + g2.fillRect(0, 0, temp.getWidth(), temp.getHeight()); + g2.dispose(); + return temp; + } + + public static BufferedImage addCharacter(BufferedImage image, String character) { + Graphics2D g2 = image.createGraphics(); + g2.setColor(new Color(0, 0, 0, 255)); + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2.setFont(new Font("Arial", 0, image.getHeight())); + FontMetrics fm = g2.getFontMetrics(); + int x = (image.getWidth() - fm.stringWidth("?")) / 2; + int y = fm.getAscent() + (image.getHeight() - (fm.getAscent() + fm.getDescent())) / 2; + g2.drawString("?", x, y); + g2.dispose(); + return image; + } + + public static BufferedImage loadImage(ResourceLocation resourceLocation, int x, int y, int w, int h) { + return loadImage(resourceLocation, x, y, w, h, 64, 32); + } + + public static BufferedImage loadImage(ResourceLocation resourceLocation, int x, int y, int w, int h, int + imageWidth, + int imageHeight) { + try { + InputStream is = Minecraft.getMinecraft().getResourceManager().getResource(resourceLocation) + .getInputStream(); + + BufferedImage mobSkin = ImageIO.read(is); + is.close(); + + return loadImage(mobSkin, x, y, w, h, imageWidth, imageHeight); + } catch (Exception e) { + System.err.println("Failed getting mob: " + resourceLocation.toString() + " - " + e.getLocalizedMessage()); + } + return null; + } + + public static BufferedImage loadImage(BufferedImage mobSkin, int x, int y, int w, int h) { + return loadImage(mobSkin, x, y, w, h, 64, 32); + } + + public static BufferedImage loadImage(BufferedImage mobSkin, int x, int y, int w, int h, int imageWidth, + int imageHeight) { + if (mobSkin.getType() != 6) { + BufferedImage temp = new BufferedImage(mobSkin.getWidth(), mobSkin.getHeight(), 6); + Graphics2D g2 = temp.createGraphics(); + g2.drawImage(mobSkin, 0, 0, mobSkin.getWidth(), mobSkin.getHeight(), null); + g2.dispose(); + mobSkin = temp; + } + float scale = mobSkin.getWidth(null) / imageWidth; + + BufferedImage base = mobSkin + .getSubimage((int) (x * scale), (int) (y * scale), (int) (w * scale), (int) (h * scale)); + + return base; + } + + public static BufferedImage addImages(BufferedImage base, BufferedImage overlay, float x, int y, int baseWidth, + int baseHeight) { + int scale = base.getWidth() / baseWidth; + Graphics gfx = base.getGraphics(); + gfx.drawImage(overlay, (int) (x * scale), y * scale, null); + gfx.dispose(); + return base; + } + + public static BufferedImage scaleImage(BufferedImage image, float scaleBy) { + BufferedImage tmp = new BufferedImage((int) (image.getWidth() * scaleBy), (int) (image.getHeight() * scaleBy), + image.getType()); + Graphics2D g2 = tmp.createGraphics(); + + g2.drawImage(image, 0, 0, (int) (image.getWidth() * scaleBy), (int) (image.getHeight() * scaleBy), null); + g2.dispose(); + image = tmp; + return image; + } + + public static BufferedImage flipHorizontal(BufferedImage image) { + AffineTransform tx = AffineTransform.getScaleInstance(-1.0D, 1.0D); + tx.translate(-image.getWidth(null), 0.0D); + AffineTransformOp op = new AffineTransformOp(tx, 1); + return op.filter(image, null); + } + + public static BufferedImage into128(BufferedImage base) { + BufferedImage frame = new BufferedImage(128, 128, base.getType()); + Graphics gfx = frame.getGraphics(); + gfx.drawImage(base, 64 - base.getWidth() / 2, 64 - base.getHeight() / 2, base.getWidth(), base.getHeight(), + null); + gfx.dispose(); + return frame; + } + + public static BufferedImage intoSquare(BufferedImage base) { + int dim = Math.max(base.getWidth(), base.getHeight()); + int t = 1; + while (Math.pow(2.0D, t - 1) < dim) { + t++; + } + int size = (int) Math.pow(2.0D, t); + + BufferedImage frame = new BufferedImage(size, size, base.getType()); + Graphics gfx = frame.getGraphics(); + gfx.drawImage(base, (size - base.getWidth()) / 2, (size - base.getHeight()) / 2, base.getWidth(), + base.getHeight(), null); + gfx.dispose(); + return frame; + } + + public static BufferedImage fillOutline(BufferedImage image, boolean outline) { + return fillOutline(image, outline, false, false, 0); + } + + public static BufferedImage fillOutline(BufferedImage image, boolean outline, boolean armor, boolean isCustomModel, + int entry) { + if ((outline) && (entry != 2) && (entry != 3) && (entry != -1)) { + image = fillOutline(image, true, armor, isCustomModel); + } + image = fillOutline(image, false, armor, isCustomModel); + return image; + } + + public static BufferedImage fillOutline(BufferedImage image, boolean solid, boolean armor, boolean isCustomModel) { + float armorOutlineFraction = isCustomModel ? 2.29F : 4.0F; + BufferedImage temp = new BufferedImage(image.getWidth(), image.getHeight(), image.getType()); + Graphics gfx = temp.getGraphics(); + gfx.drawImage(image, 0, 0, null); + gfx.dispose(); + int imageWidth = image.getWidth(); + int imageHeight = image.getHeight(); + for (int t = 0; t < image.getWidth(); t++) { + for (int s = 0; s < image.getHeight(); s++) { + int color = image.getRGB(s, t); + if ((color >> 24 & 0xFF) == 0) { + int newColor = getNonTransparentPixel(s, t, image); + if (newColor != 65116) { + if (solid) { + if ((!armor) || (t <= imageWidth / armorOutlineFraction) || + (t >= imageWidth - 1 - imageWidth / armorOutlineFraction) || + (s <= imageHeight / armorOutlineFraction) || + (s >= imageHeight - 1 - imageHeight / armorOutlineFraction)) { + newColor = -16777216; + } else { + newColor = 0; + } + } else { + int red = newColor >> 16 & 0xFF; + int green = newColor >> 8 & 0xFF; + int blue = newColor >> 0 & 0xFF; + newColor = 0x0 | (red & 0xFF) << 16 | (green & 0xFF) << 8 | blue & 0xFF; + } + temp.setRGB(s, t, newColor); + } + } + } + } + return temp; + } + + public static int getNonTransparentPixel(int x, int y, BufferedImage image) { + if (x > 0) { + int color = image.getRGB(x - 1, y); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + if (x < image.getWidth() - 1) { + int color = image.getRGB(x + 1, y); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + if (y > 0) { + int color = image.getRGB(x, y - 1); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + if (y < image.getHeight() - 1) { + int color = image.getRGB(x, y + 1); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + if ((x > 0) && (y > 0)) { + int color = image.getRGB(x - 1, y - 1); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + if ((x > 0) && (y < image.getHeight() - 1)) { + int color = image.getRGB(x - 1, y + 1); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + if ((x < image.getWidth() - 1) && (y > 0)) { + int color = image.getRGB(x + 1, y - 1); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + if ((x < image.getWidth() - 1) && (y < image.getHeight() - 1)) { + int color = image.getRGB(x + 1, y + 1); + if ((color >> 24 & 0xFF) > 50) { + return color; + } + } + return 65116; + } + + public static BufferedImage trim(BufferedImage image) { + int left = -1; + int right = image.getWidth(); + int top = -1; + int bottom = image.getHeight(); + boolean foundColor = false; + int color = 0; + while (!foundColor) { + left++; + for (int t = 0; t < image.getHeight(); t++) { + color = image.getRGB(left, t); + if (color >> 24 != 0) { + foundColor = true; + } + } + } + foundColor = false; + while (!foundColor) { + right--; + for (int t = 0; t < image.getHeight(); t++) { + color = image.getRGB(right, t); + if (color >> 24 != 0) { + foundColor = true; + } + } + } + foundColor = false; + while (!foundColor) { + top++; + for (int t = 0; t < image.getWidth(); t++) { + color = image.getRGB(t, top); + if (color >> 24 != 0) { + foundColor = true; + } + } + } + foundColor = false; + while (!foundColor) { + bottom--; + for (int t = 0; t < image.getWidth(); t++) { + color = image.getRGB(t, bottom); + if (color >> 24 != 0) { + foundColor = true; + } + } + } + image = image.getSubimage(left, top, right - left + 1, bottom - top + 1); + return image; + } + + public static float percentageOfEdgePixelsThatAreSolid(BufferedImage image) { + int edgePixels = image.getWidth() * 2 + image.getHeight() * 2 - 2; + int edgePixelsWithColor = 0; + int color = 0; + for (int t = 0; t < image.getHeight(); t++) { + color = image.getRGB(0, t); + if (color >> 24 != 0) { + edgePixelsWithColor++; + } + color = image.getRGB(image.getWidth() - 1, t); + if (color >> 24 != 0) { + edgePixelsWithColor++; + } + } + for (int t = 1; t < image.getWidth() - 1; t++) { + color = image.getRGB(t, 0); + if (color >> 24 != 0) { + edgePixelsWithColor++; + } + color = image.getRGB(t, image.getHeight() - 1); + if (color >> 24 != 0) { + edgePixelsWithColor++; + } + } + return edgePixelsWithColor / edgePixels; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/LayoutVariables.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/LayoutVariables.java new file mode 100644 index 0000000..0efa406 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/LayoutVariables.java @@ -0,0 +1,15 @@ +package com.thevoxelbox.voxelmap.util; + +public class LayoutVariables { + public int scScale = 0; + public int mapX = 0; + public int mapY = 0; + public int zoom = 0; + + public void updateVars(int scScale, int mapX, int mapY, int zoom) { + this.scScale = scScale; + this.mapX = mapX; + this.mapY = mapY; + this.zoom = zoom; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapChunk.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapChunk.java new file mode 100644 index 0000000..2395a65 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapChunk.java @@ -0,0 +1,51 @@ +package com.thevoxelbox.voxelmap.util; + +import com.thevoxelbox.voxelmap.interfaces.IMap; +import net.minecraft.client.Minecraft; +import net.minecraft.world.chunk.Chunk; + +public class MapChunk { + private int x = 0; + private int z = 0; + private int width; + private int height; + private Chunk chunk; + private boolean isLoaded = false; + + public MapChunk(int x, int z) { + this.x = x; + this.z = z; + this.chunk = Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(x, z); + this.isLoaded = this.chunk.isChunkLoaded; + } + + public void calculateChunk(IMap minimap, boolean realTimeUpdate) { + if ((hasChunkLoadedOrUnloaded()) || ((realTimeUpdate) && (hasChunkChanged()))) { + minimap.chunkCalc(this.chunk); + if (realTimeUpdate) { + this.chunk.isModified = false; + } + } + } + + private boolean hasChunkLoadedOrUnloaded() { + boolean hasChanged = false; + if (!this.isLoaded) { + this.chunk = Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(this.x, this.z); + if (this.chunk.isChunkLoaded) { + this.isLoaded = true; + hasChanged = true; + } + } else if ((this.isLoaded) && + (!this.chunk.isChunkLoaded)) { + this.isLoaded = false; + hasChanged = true; + } + return hasChanged; + } + + private boolean hasChunkChanged() { + boolean hasChanged = (this.chunk.isChunkLoaded) && (this.chunk.isModified); + return hasChanged; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapChunkCache.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapChunkCache.java new file mode 100644 index 0000000..666c135 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapChunkCache.java @@ -0,0 +1,98 @@ +package com.thevoxelbox.voxelmap.util; + +import com.thevoxelbox.voxelmap.interfaces.IMap; +import net.minecraft.client.Minecraft; +import net.minecraft.world.chunk.Chunk; + +public class MapChunkCache { + private final int width; + private final int height; + private Chunk lastPlayerChunk = null; + private final MapChunk[] mapChunks; + private boolean loaded = false; + private final IMap minimap; + + public MapChunkCache(int width, int height, IMap minimap) { + this.width = width; + this.height = height; + this.mapChunks = new MapChunk[width * height]; + this.minimap = minimap; + } + + public void centerChunks(int playerX, int playerZ) { + Chunk currentChunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(playerX, playerZ); + if (currentChunk != this.lastPlayerChunk) { + if (this.lastPlayerChunk == null) { + fillAllChunks(playerX, playerZ); + this.lastPlayerChunk = currentChunk; + return; + } + int middleX = this.width / 2; + int middleZ = this.height / 2; + int movedX = currentChunk.xPosition - this.lastPlayerChunk.xPosition; + int movedZ = currentChunk.zPosition - this.lastPlayerChunk.zPosition; + if ((Math.abs(movedX) < this.width) && (Math.abs(movedZ) < this.height) && + (currentChunk.worldObj.equals(this.lastPlayerChunk.worldObj))) { + moveX(movedX); + moveZ(movedZ); + for (int z = movedZ > 0 ? this.height - movedZ : 0; z < (movedZ > 0 ? this.height : -movedZ); z++) { + for (int x = 0; x < this.width; x++) { + this.mapChunks[(x + z * this.width)] = new MapChunk(currentChunk.xPosition - (middleX - x), + currentChunk.zPosition - (middleZ - z)); + } + } + for (int z = 0; z < this.height; z++) { + for (int x = movedX > 0 ? this.width - movedX : 0; x < (movedX > 0 ? this.width : -movedX); x++) { + this.mapChunks[(x + z * this.width)] = new MapChunk(currentChunk.xPosition - (middleX - x), + currentChunk.zPosition - (middleZ - z)); + } + } + } else { + fillAllChunks(playerX, playerZ); + } + this.lastPlayerChunk = currentChunk; + } + } + + public void fillAllChunks(int playerX, int playerZ) { + Chunk currentChunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(playerX, playerZ); + int middleX = this.width / 2; + int middleZ = this.height / 2; + for (int z = 0; z < this.height; z++) { + for (int x = 0; x < this.width; x++) { + this.mapChunks[(x + z * this.width)] = new MapChunk(currentChunk.xPosition - (middleX - x), + currentChunk.zPosition - (middleZ - z)); + } + } + this.loaded = true; + } + + public void moveX(int offset) { + if (offset > 0) { + System.arraycopy(this.mapChunks, offset, this.mapChunks, 0, this.mapChunks.length - offset); + } else if (offset < 0) { + System.arraycopy(this.mapChunks, 0, this.mapChunks, -offset, this.mapChunks.length + offset); + } + } + + public void moveZ(int offset) { + if (offset > 0) { + System.arraycopy(this.mapChunks, offset * this.width, this.mapChunks, 0, + this.mapChunks.length - offset * this.width); + } else if (offset < 0) { + System.arraycopy(this.mapChunks, 0, this.mapChunks, -offset * this.width, + this.mapChunks.length + offset * this.width); + } + } + + public void calculateChunks(boolean realTimeUpdate) { + if (!this.loaded) { + return; + } + for (int z = this.height - 1; z >= 0; z--) { + for (int x = 0; x < this.width; x++) { + this.mapChunks[(x + z * this.width)].calculateChunk(this.minimap, realTimeUpdate); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapData.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapData.java new file mode 100644 index 0000000..0723d7c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/MapData.java @@ -0,0 +1,482 @@ +package com.thevoxelbox.voxelmap.util; + +import java.util.ArrayList; +import java.util.Collection; +import net.minecraft.client.Minecraft; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapData { + private static final int DATABITS = 16; + private static final int HEIGHTPOS = 0; + private static final int MATERIALPOS = 1; + private static final int METADATAPOS = 2; + private static final int TINTPOS = 3; + private static final int LIGHTPOS = 4; + private static final int OCEANFLOORHEIGHTPOS = 5; + private static final int OCEANFLOORMATERIALPOS = 6; + private static final int OCEANFLOORMETADATAPOS = 7; + private static final int OCEANFLOORTINTPOS = 8; + private static final int OCEANFLOORLIGHTPOS = 9; + private static final int TRANSPARENTHEIGHTPOS = 10; + private static final int TRANSPARENTIDPOS = 11; + private static final int TRANSPARENTMETADATAPOS = 12; + private static final int TRANSPARENTTINTPOS = 13; + private static final int TRANSPARENTLIGHTPOS = 14; + private static final int BIOMEIDPOS = 15; + public Point[][] points; + public ArrayList segments; + private final int width; + private final int height; + private final Object dataLock = new Object(); + private final Object labelLock = new Object(); + private final int[] data; + private final ArrayList labels = new ArrayList(); + + public MapData(int width, int height) { + this.width = width; + this.height = height; + this.data = new int[width * height * DATABITS]; + } + + public int getHeight(int x, int z) { + return getData(x, z, HEIGHTPOS); + } + + public int getMaterial(int x, int z) { + return getData(x, z, MATERIALPOS); + } + + public int getMetadata(int x, int z) { + return getData(x, z, METADATAPOS); + } + + public int getBiomeTint(int x, int z) { + return getData(x, z, TINTPOS); + } + + public int getLight(int x, int z) { + return getData(x, z, LIGHTPOS); + } + + public int getOceanFloorHeight(int x, int z) { + return getData(x, z, OCEANFLOORHEIGHTPOS); + } + + public int getOceanFloorMaterial(int x, int z) { + return getData(x, z, OCEANFLOORMATERIALPOS); + } + + public int getOceanFloorMetadata(int x, int z) { + return getData(x, z, OCEANFLOORMETADATAPOS); + } + + public int getOceanFloorBiomeTint(int x, int z) { + return getData(x, z, OCEANFLOORTINTPOS); + } + + public int getOceanFloorLight(int x, int z) { + return getData(x, z, OCEANFLOORLIGHTPOS); + } + + public int getTransparentHeight(int x, int z) { + return getData(x, z, TRANSPARENTHEIGHTPOS); + } + + public int getTransparentId(int x, int z) { + return getData(x, z, TRANSPARENTIDPOS); + } + + public int getTransparentMetadata(int x, int z) { + return getData(x, z, TRANSPARENTMETADATAPOS); + } + + public int getTransparentBiomeTint(int x, int z) { + return getData(x, z, TRANSPARENTTINTPOS); + } + + public int getTransparentLight(int x, int z) { + return getData(x, z, TRANSPARENTLIGHTPOS); + } + + public int getBiomeID(int x, int z) { + return getData(x, z, BIOMEIDPOS); + } + + public int getData(int x, int z, int bit) { + int index = (x + z * this.width) * DATABITS + bit; + return this.data[index]; + } + + public void setHeight(int x, int z, int value) { + setData(x, z, HEIGHTPOS, value); + } + + public void setMaterial(int x, int z, int value) { + setData(x, z, MATERIALPOS, value); + } + + public void setMetadata(int x, int z, int value) { + setData(x, z, METADATAPOS, value); + } + + public void setBiomeTint(int x, int z, int value) { + setData(x, z, TINTPOS, value); + } + + public void setLight(int x, int z, int value) { + setData(x, z, LIGHTPOS, value); + } + + public void setOceanFloorHeight(int x, int z, int value) { + setData(x, z, OCEANFLOORHEIGHTPOS, value); + } + + public void setOceanFloorMaterial(int x, int z, int value) { + setData(x, z, OCEANFLOORMATERIALPOS, value); + } + + public void setOceanFloorMetadata(int x, int z, int value) { + setData(x, z, OCEANFLOORMETADATAPOS, value); + } + + public void setOceanFloorBiomeTint(int x, int z, int value) { + setData(x, z, OCEANFLOORTINTPOS, value); + } + + public void setOceanFloorLight(int x, int z, int value) { + setData(x, z, OCEANFLOORLIGHTPOS, value); + } + + public void setTransparentHeight(int x, int z, int value) { + setData(x, z, TRANSPARENTHEIGHTPOS, value); + } + + public void setTransparentId(int x, int z, int value) { + setData(x, z, TRANSPARENTIDPOS, value); + } + + public void setTransparentMetadata(int x, int z, int value) { + setData(x, z, TRANSPARENTMETADATAPOS, value); + } + + public void setTransparentBiomeTint(int x, int z, int value) { + setData(x, z, TRANSPARENTTINTPOS, value); + } + + public void setTransparentLight(int x, int z, int value) { + setData(x, z, TRANSPARENTLIGHTPOS, value); + } + + public void setBiomeID(int x, int z, int value) { + setData(x, z, BIOMEIDPOS, value); + } + + public void setData(int x, int z, int bit, int value) { + int index = (x + z * this.width) * DATABITS + bit; + this.data[index] = value; + } + + public void moveX(int offset) { + synchronized (this.dataLock) { + if (offset > 0) { + System.arraycopy(this.data, offset * DATABITS, this.data, 0, this.data.length - offset * DATABITS); + } else if (offset < 0) { + System.arraycopy(this.data, 0, this.data, -offset * DATABITS, this.data.length + offset * DATABITS); + } + } + } + + public void moveZ(int offset) { + synchronized (this.dataLock) { + if (offset > 0) { + System.arraycopy(this.data, offset * this.width * DATABITS, this.data, 0, + this.data.length - offset * this.width * DATABITS); + } else if (offset < 0) { + System.arraycopy(this.data, 0, this.data, -offset * this.width * DATABITS, + this.data.length + offset * this.width * DATABITS); + } + } + } + + public void segmentBiomes() { + this.points = new Point[this.width][this.height]; + this.segments = new ArrayList(); + for (int x = 0; x < this.width; x++) { + for (int z = 0; z < this.height; z++) { + this.points[x][z] = new Point(x, z, getBiomeID(x, z)); + } + } + synchronized (this.dataLock) { + for (int x = 0; x < this.width; x++) { + for (int z = 0; z < this.height; z++) { + if (!this.points[x][z].inSegment) { + Segment segment = new Segment(this.points[x][z]); + this.segments.add(segment); + segment.flood(); + } + } + } + } + } + + public void findCenterOfSegments() { + if (this.segments != null) { + for (int t = 0; t < this.segments.size(); t++) { + Segment segment = this.segments.get(t); + if (segment.biome != -1) { + segment.calculateCenter(); + } + } + } + synchronized (this.labelLock) { + this.labels.clear(); + if (this.segments != null) { + for (int t = 0; t < this.segments.size(); t++) { + Segment segment = this.segments.get(t); + if (segment.biome != -1) { + BiomeLabel label = new BiomeLabel(); + label.biomeInt = segment.biome; + label.size = segment.memberPoints.size(); + label.x = segment.centerX; + label.z = segment.centerZ; + this.labels.add(label); + } + } + } + } + } + + public ArrayList getBiomeLabels() { + ArrayList labelsToReturn = new ArrayList(); + synchronized (this.labelLock) { + labelsToReturn.addAll(this.labels); + } + return labelsToReturn; + } + + private class Point { + public int x; + public int z; + public boolean inSegment = false; + public boolean isCandidate = false; + public boolean isEroded = false; + public int layer = -1; + public int biome = -1; + + public Point(int x, int z, int biome) { + this.x = x; + this.z = z; + this.biome = biome; + } + } + + public class Segment { + public ArrayList memberPoints; + public int biome; + public int centerX = 0; + public int centerZ = 0; + ArrayList currentShell; + + public Segment(MapData.Point point) { + this.biome = point.biome; + this.memberPoints = new ArrayList(); + this.memberPoints.add(point); + this.currentShell = new ArrayList(); + } + + public void flood() { + ArrayList candidatePoints = new ArrayList(); + candidatePoints.add(this.memberPoints.remove(0)); + while (candidatePoints.size() > 0) { + MapData.Point point = candidatePoints.remove(0); + point.isCandidate = false; + if (point.biome == this.biome) { + this.memberPoints.add(point); + point.inSegment = true; + boolean edge = false; + if (point.x < MapData.this.width - 1) { + MapData.Point neighbor = MapData.this.points[(point.x + 1)][point.z]; + if ((!neighbor.inSegment) && (!neighbor.isCandidate)) { + candidatePoints.add(neighbor); + neighbor.isCandidate = true; + } + if (neighbor.biome != point.biome) { + edge = true; + } + } else { + edge = true; + } + if (point.x > 0) { + MapData.Point neighbor = MapData.this.points[(point.x - 1)][point.z]; + if ((!neighbor.inSegment) && (!neighbor.isCandidate)) { + candidatePoints.add(neighbor); + neighbor.isCandidate = true; + } + if (neighbor.biome != point.biome) { + edge = true; + } + } else { + edge = true; + } + if (point.z < MapData.this.height - 1) { + MapData.Point neighbor = MapData.this.points[point.x][(point.z + 1)]; + if ((!neighbor.inSegment) && (!neighbor.isCandidate)) { + candidatePoints.add(neighbor); + neighbor.isCandidate = true; + } + if (neighbor.biome != point.biome) { + edge = true; + } + } else { + edge = true; + } + if (point.z > 0) { + MapData.Point neighbor = MapData.this.points[point.x][(point.z - 1)]; + if ((!neighbor.inSegment) && (!neighbor.isCandidate)) { + candidatePoints.add(neighbor); + neighbor.isCandidate = true; + } + if (neighbor.biome != point.biome) { + edge = true; + } + } else { + edge = true; + } + if (edge) { + point.layer = 0; + this.currentShell.add(point); + } + } + } + } + + public void calculateCenter() { + calculateCenterOfMass(); + + morphologicallyErode(); + } + + public void calculateCenterOfMass() { + calculateCenterOfMass(this.memberPoints); + } + + public void calculateCenterOfMass(Collection points) { + this.centerX = 0; + this.centerZ = 0; + for (MapData.Point point : points) { + this.centerX += point.x; + this.centerZ += point.z; + } + this.centerX /= points.size(); + this.centerZ /= points.size(); + } + + public void calculateClosestPointToCenter(Collection points) { + int distanceSquared = 131072; + MapData.Point centerPoint = null; + for (MapData.Point point : points) { + int pointDistanceSquared = (point.x - this.centerX) * (point.x - this.centerX) + + (point.z - this.centerZ) * (point.z - this.centerZ); + if (pointDistanceSquared < distanceSquared) { + distanceSquared = pointDistanceSquared; + centerPoint = point; + } + } + this.centerX = centerPoint.x; + this.centerZ = centerPoint.z; + } + + public void morphologicallyErode() { + float labelWidth = Minecraft.getMinecraft().fontRenderer + .getStringWidth(BiomeGenBase.getBiomeGenArray()[this.biome].biomeName) + 8; + float multi = MapData.this.width / 32; + float shellWidth = 2.0F; + float labelPadding = labelWidth / 16.0F * multi / shellWidth; + + int layer = 0; + while ((this.currentShell.size() > 0) && (layer < labelPadding)) { + layer++; + this.currentShell = getNextShell(this.currentShell, layer); + } + if (this.currentShell.size() > 0) { + ArrayList remainingPoints = new ArrayList(); + for (MapData.Point point : this.memberPoints) { + if ((point.layer < 0) || (point.layer == layer)) { + remainingPoints.add(point); + } + } + calculateClosestPointToCenter(remainingPoints); + } + } + + public ArrayList getNextShell(Collection pointsToCheck, int layer) { + ArrayList nextShell = new ArrayList(); + for (MapData.Point point : pointsToCheck) { + if (point.x < MapData.this.width - 2) { + MapData.Point neighbor1 = MapData.this.points[(point.x + 1)][point.z]; + MapData.Point neighbor2 = MapData.this.points[(point.x + 2)][point.z]; + if ((neighbor1.biome == point.biome) && (neighbor1.layer < 0) && (neighbor2.biome == point + .biome) && + (neighbor2.layer < 0)) { + neighbor1.layer = layer; + neighbor2.layer = layer; + nextShell.add(neighbor2); + } else if ((neighbor1.biome == point.biome) && (neighbor1.layer < 0)) { + neighbor1.layer = layer; + nextShell.add(neighbor1); + } else if ((neighbor2.biome == point.biome) && (neighbor2.layer < 0)) { + neighbor2.layer = layer; + nextShell.add(neighbor2); + } + } + if (point.x > 1) { + MapData.Point neighbor1 = MapData.this.points[(point.x - 1)][point.z]; + MapData.Point neighbor2 = MapData.this.points[(point.x - 2)][point.z]; + if ((neighbor1.biome == point.biome) && (neighbor1.layer < 0) && (neighbor2.biome == point + .biome) && + (neighbor2.layer < 0)) { + neighbor1.layer = layer; + neighbor2.layer = layer; + nextShell.add(neighbor2); + } else if ((neighbor1.biome == point.biome) && (neighbor1.layer < 0)) { + neighbor1.layer = layer; + nextShell.add(neighbor1); + } else if ((neighbor2.biome == point.biome) && (neighbor2.layer < 0)) { + neighbor2.layer = layer; + nextShell.add(neighbor2); + } + } + if (point.z < MapData.this.height - 1) { + MapData.Point neighbor = MapData.this.points[point.x][(point.z + 1)]; + if ((neighbor.biome == point.biome) && (neighbor.layer < 0)) { + neighbor.layer = layer; + nextShell.add(neighbor); + } + } + if (point.z > 0) { + MapData.Point neighbor = MapData.this.points[point.x][(point.z - 1)]; + if ((neighbor.biome == point.biome) && (neighbor.layer < 0)) { + neighbor.layer = layer; + nextShell.add(neighbor); + } + } + } + if (nextShell.size() > 0) { + return nextShell; + } + calculateCenterOfMass(pointsToCheck); + calculateClosestPointToCenter(pointsToCheck); + return nextShell; + } + } + + public class BiomeLabel { + public int biomeInt = -1; + public int size = 0; + public int x = 0; + public int z = 0; + + public BiomeLabel() { + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/NetworkUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/NetworkUtils.java new file mode 100644 index 0000000..fd4b8db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/NetworkUtils.java @@ -0,0 +1,80 @@ +package com.thevoxelbox.voxelmap.util; + +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.InterfaceAddress; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.util.ArrayList; +import java.util.Enumeration; + +public class NetworkUtils { + private static ArrayList localAddresses; + private static ArrayList netmasks; + + public static void enumerateInterfaces() + throws SocketException { + localAddresses = new ArrayList(); + netmasks = new ArrayList(); + for (Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); + interfaces.hasMoreElements(); ) { + NetworkInterface networkInterface = interfaces.nextElement(); + if ((networkInterface != null) && (!networkInterface.isLoopback()) && (networkInterface.isUp())) { + for (InterfaceAddress interfaceAddress : networkInterface.getInterfaceAddresses()) { + if (interfaceAddress != null) { + InetAddress inetAddress = interfaceAddress.getAddress(); + if ((inetAddress instanceof Inet4Address)) { + InetAddress subnetMask = convertNetPrefixToNetmask( + interfaceAddress.getNetworkPrefixLength()); + if (subnetMask != null) { + localAddresses.add(inetAddress); + netmasks.add(subnetMask); + } + } + } + } + } + } + } + + private static InetAddress convertNetPrefixToNetmask(int netPrefix) { + try { + int shiftby = Integer.MIN_VALUE; + for (int i = netPrefix - 1; i > 0; i--) { + shiftby >>= 1; + } + String maskString = (shiftby >> 24 & 0xFF) + "." + (shiftby >> 16 & 0xFF) + + "." + (shiftby >> 8 & 0xFF) + "." + (shiftby & 0xFF); + + return InetAddress.getByName(maskString); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + private static boolean onSameNetwork(InetAddress ip1, InetAddress ip2, InetAddress mask) + throws Exception { + byte[] a1 = ip1.getAddress(); + byte[] a2 = ip2.getAddress(); + byte[] m = mask.getAddress(); + for (int i = 0; i < a1.length; i++) { + if ((a1[i] & m[i]) != (a2[i] & m[i])) { + return false; + } + } + return true; + } + + public static boolean isOnLan(InetAddress serverAddress) { + try { + for (int t = 0; t < localAddresses.size(); t++) { + if (onSameNetwork(localAddresses.get(t), serverAddress, netmasks.get(t))) { + return true; + } + } + } catch (Exception e) { + } + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ObservableChunkChangeNotifier.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ObservableChunkChangeNotifier.java new file mode 100644 index 0000000..97639f0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ObservableChunkChangeNotifier.java @@ -0,0 +1,14 @@ +package com.thevoxelbox.voxelmap.util; + +import com.thevoxelbox.voxelmap.interfaces.IObservableChunkChangeNotifier; +import java.util.Observable; +import net.minecraft.world.chunk.Chunk; + +public class ObservableChunkChangeNotifier + extends Observable + implements IObservableChunkChangeNotifier { + public void chunkChanged(Chunk chunk) { + setChanged(); + notifyObservers(chunk); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ReflectionUtils.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ReflectionUtils.java new file mode 100644 index 0000000..9710dd7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/ReflectionUtils.java @@ -0,0 +1,123 @@ +package com.thevoxelbox.voxelmap.util; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.ArrayList; + +public class ReflectionUtils { + public static Object getPrivateFieldValueByType(Object o, Class objectClasstype, Class fieldClasstype) { + return getPrivateFieldValueByType(o, objectClasstype, fieldClasstype, 0); + } + + public static Object getPrivateFieldValueByType(Object o, Class objectClasstype, Class fieldClasstype, int index) { + Class objectClass = o.getClass(); + while ((!objectClass.equals(objectClasstype)) && (objectClass.getSuperclass() != null)) { + objectClass = objectClass.getSuperclass(); + } + int counter = 0; + Field[] fields = objectClass.getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + if (fieldClasstype.equals(fields[i].getType())) { + if (counter == index) { + try { + fields[i].setAccessible(true); + return fields[i].get(o); + } catch (IllegalAccessException ex) { + } + } + counter++; + } + } + return null; + } + + public static Object getFieldValueByName(Object o, String fieldName) { + Field[] fields = o.getClass().getFields(); + for (int i = 0; i < fields.length; i++) { + if (fieldName.equals(fields[i].getName())) { + try { + fields[i].setAccessible(true); + return fields[i].get(o); + } catch (IllegalAccessException ex) { + } + } + } + return null; + } + + public static ArrayList getFieldsByType(Object o, Class objectClassBaseType, Class fieldClasstype) { + ArrayList matches = new ArrayList(); + Class objectClass = o.getClass(); + while ((!objectClass.equals(objectClassBaseType)) && (objectClass.getSuperclass() != null)) { + Field[] fields = objectClass.getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + if (fieldClasstype.equals(fields[i].getType())) { + fields[i].setAccessible(true); + matches.add(fields[i]); + } + } + objectClass = objectClass.getSuperclass(); + } + return matches; + } + + public static Field getFieldByType(Object o, Class objectClasstype, Class fieldClasstype) { + return getFieldByType(o, objectClasstype, fieldClasstype, 0); + } + + public static Field getFieldByType(Object o, Class objectClasstype, Class fieldClasstype, int index) { + Class objectClass = o.getClass(); + while ((!objectClass.equals(objectClasstype)) && (objectClass.getSuperclass() != null)) { + objectClass = objectClass.getSuperclass(); + } + int counter = 0; + Field[] fields = objectClass.getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + if (fieldClasstype.equals(fields[i].getType())) { + if (counter == index) { + fields[i].setAccessible(true); + return fields[i]; + } + counter++; + } + } + return null; + } + + public static Method getMethodByType(Class objectType, Class returnType, Class... parameterTypes) { + return getMethodByType(0, objectType, returnType, parameterTypes); + } + + public static Method getMethodByType(int index, Class objectType, Class returnType, Class... parameterTypes) { + Method[] methods = objectType.getDeclaredMethods(); + int counter = 0; + for (int i = 0; i < methods.length; i++) { + if (returnType.equals(methods[i].getReturnType())) { + Class[] methodParameterTypes = methods[i].getParameterTypes(); + if (parameterTypes.length == methodParameterTypes.length) { + boolean match = true; + for (int t = 0; t < parameterTypes.length; t++) { + if (parameterTypes[t] != methodParameterTypes[t]) { + match = false; + } + } + if (counter == index) { + methods[i].setAccessible(true); + return methods[i]; + } + } + counter++; + } + } + return null; + } + + public static boolean classExists(String className) { + try { + Class.forName(className); + return true; + } catch (ClassNotFoundException exception) { + } + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/RenderWaypointContainer.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/RenderWaypointContainer.java new file mode 100644 index 0000000..bd98c7e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/RenderWaypointContainer.java @@ -0,0 +1,219 @@ +package com.thevoxelbox.voxelmap.util; + +import com.thevoxelbox.voxelmap.MapSettingsManager; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderWaypointContainer + extends Render { + MapSettingsManager options = null; + + public RenderWaypointContainer(MapSettingsManager options) { + this.options = options; + } + + public ResourceLocation getEntityTexture(Entity par1Entity) { + return new ResourceLocation("", ""); + } + + public void doRenderWaypoints(EntityWaypointContainer par1EntityWaypointContainer, double baseX, double baseY, + double baseZ, float par8, float par9) { + for (Waypoint pt : par1EntityWaypointContainer.wayPts) { + if (pt.isActive()) { + int x = pt.getX(); + int z = pt.getZ(); + int y = pt.getY(); + + double distance = Math.sqrt(pt.getDistanceSqToEntity(this.renderManager.livingPlayer)); + + if ((this.options.showBeacons) && + (par1EntityWaypointContainer.worldObj.getChunkFromBlockCoords(x, z).isChunkLoaded)) { + double bottomOfWorld = 0.0D - RenderManager.renderPosY; + renderBeam(pt, x - RenderManager.renderPosX, bottomOfWorld, z - RenderManager.renderPosZ, 64.0F, + distance); + } + if ((this.options.showWaypoints) && (!this.options.game.gameSettings.hideGUI)) { + String label = pt.name; + renderLabel(pt, label, baseX + x, baseY + y + 1.0D, baseZ + z, 64, distance); + } + } + } + } + + public void renderBeam(Waypoint par1EntityWaypoint, double baseX, double baseY, double baseZ, float par8, + double distance) { + Tessellator tesselator = Tessellator.instance; + GL11.glDisable(3553); + GL11.glDisable(2896); + GL11.glDisable(2912); + GL11.glDepthMask(false); + + GL11.glEnable(3042); + GL11.glBlendFunc(770, 1); + int height = 256; + float brightness = 0.06F; + double topWidthFactor = 1.05D; + double bottomWidthFactor = 1.05D; + float r = par1EntityWaypoint.red; + float b = par1EntityWaypoint.blue; + float g = par1EntityWaypoint.green; + + float alphaMultiplier = distance < 30F ? (float) distance / 30F : 1; + if (alphaMultiplier < 0.2F) { + alphaMultiplier = 0.2F; + } + + for (int width = 0; width < 4; width++) { + tesselator.startDrawing(5); + tesselator.setColorRGBA_F(r * brightness, g * brightness, b * brightness, 0.8F * alphaMultiplier); + + double var32 = 0.1D + width * 0.2D; + var32 *= topWidthFactor; + + double var34 = 0.1D + width * 0.2D; + var34 *= bottomWidthFactor; + for (int side = 0; side < 5; side++) { + double vertX2 = baseX + 0.5D - var32; + double vertZ2 = baseZ + 0.5D - var32; + if ((side == 1) || (side == 2)) { + vertX2 += var32 * 2.0D; + } + if ((side == 2) || (side == 3)) { + vertZ2 += var32 * 2.0D; + } + double vertX1 = baseX + 0.5D - var34; + double vertZ1 = baseZ + 0.5D - var34; + if ((side == 1) || (side == 2)) { + vertX1 += var34 * 2.0D; + } + if ((side == 2) || (side == 3)) { + vertZ1 += var34 * 2.0D; + } + tesselator.addVertex(vertX1, baseY + 0.0D, vertZ1); + tesselator.addVertex(vertX2, baseY + height, vertZ2); + } + tesselator.draw(); + } + GL11.glDisable(3042); + GL11.glEnable(2912); + GL11.glEnable(2896); + GL11.glEnable(3553); + GL11.glDepthMask(true); + } + + protected void renderLabel(Waypoint par1EntityWaypoint, String par2Str, double par3, double par5, double par7, + int par9, double distance) { + GL11.glAlphaFunc(516, 0.1F); + if ((distance <= this.options.maxWaypointDisplayDistance) || (this.options.maxWaypointDisplayDistance < 0)) { + par2Str = par2Str + " (" + (int) distance + "m)"; + + double maxDistance = + this.options.game.gameSettings.getOptionFloatValue(GameSettings.Options.RENDER_DISTANCE) * 16.0F * + 0.75D; + double adjustedDistance = distance; + if (distance > maxDistance) { + par3 = par3 / distance * maxDistance; + par5 = par5 / distance * maxDistance; + par7 = par7 / distance * maxDistance; + adjustedDistance = maxDistance; + } + FontRenderer fontRenderer = getFontRendererFromRenderManager(); + float var14 = ((float) adjustedDistance * 0.1F + 1.0F) * 0.0266F; + GL11.glPushMatrix(); + GL11.glTranslatef((float) par3 + 0.5F, (float) par5 + 1.3F, (float) par7 + 0.5F); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-var14, -var14, var14); + GL11.glDisable(2896); + GL11.glDisable(2912); + GL11.glDepthMask(false); + GL11.glDisable(2929); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + Tessellator var15 = Tessellator.instance; + byte var16 = 0; + GL11.glDisable(3553); + int var17 = fontRenderer.getStringWidth(par2Str) / 2; + + GL11.glEnable(2929); + if (distance < maxDistance) { + GL11.glDepthMask(true); + } + + float alphaMultiplier = distance < 30F ? (float) distance / 30F : 1; + if (alphaMultiplier < 0.2F) { + alphaMultiplier = 0.2F; + } + + GL11.glEnable(32823); + GL11.glPolygonOffset(1.0F, 3.0F); + var15.startDrawingQuads(); + var15.setColorRGBA_F(par1EntityWaypoint.red, par1EntityWaypoint.green, par1EntityWaypoint.blue, + 0.6F * alphaMultiplier); + var15.addVertex(-var17 - 2, -2 + var16, 0.0D); + var15.addVertex(-var17 - 2, 9 + var16, 0.0D); + var15.addVertex(var17 + 2, 9 + var16, 0.0D); + var15.addVertex(var17 + 2, -2 + var16, 0.0D); + var15.draw(); + GL11.glPolygonOffset(1.0F, 1.0F); + var15.startDrawingQuads(); + var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.15F); + + var15.addVertex(-var17 - 1, -1 + var16, 0.0D); + var15.addVertex(-var17 - 1, 8 + var16, 0.0D); + var15.addVertex(var17 + 1, 8 + var16, 0.0D); + var15.addVertex(var17 + 1, -1 + var16, 0.0D); + var15.draw(); + GL11.glDisable(2929); + GL11.glDepthMask(false); + GL11.glPolygonOffset(1.0F, 7.0F); + var15.startDrawingQuads(); + + var15.setColorRGBA_F(par1EntityWaypoint.red, par1EntityWaypoint.green, par1EntityWaypoint.blue, + 0.15F * alphaMultiplier); + + var15.addVertex(-var17 - 2, -2 + var16, 0.0D); + var15.addVertex(-var17 - 2, 9 + var16, 0.0D); + var15.addVertex(var17 + 2, 9 + var16, 0.0D); + var15.addVertex(var17 + 2, -2 + var16, 0.0D); + var15.draw(); + GL11.glPolygonOffset(1.0F, 5.0F); + + var15.startDrawingQuads(); + var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.15F * alphaMultiplier); + + var15.addVertex(-var17 - 1, -1 + var16, 0.0D); + var15.addVertex(-var17 - 1, 8 + var16, 0.0D); + var15.addVertex(var17 + 1, 8 + var16, 0.0D); + var15.addVertex(var17 + 1, -1 + var16, 0.0D); + var15.draw(); + GL11.glDisable(32823); + GL11.glEnable(3553); + int font = -3355444 & 0x00FFFFFF; + int fontwhite = 0x00FFFFFF; + fontRenderer.drawString(par2Str, -fontRenderer.getStringWidth(par2Str) / 2, var16, + font | ((int) (255 * alphaMultiplier) << 24)); + GL11.glEnable(2929); + fontRenderer.drawString(par2Str, -fontRenderer.getStringWidth(par2Str) / 2, var16, + fontwhite | ((int) (255 * alphaMultiplier) << 24)); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glEnable(2912); + GL11.glEnable(2896); + GL11.glDisable(3042); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + } + + public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { + doRenderWaypoints((EntityWaypointContainer) par1Entity, par2, par4, par6, par8, par9); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Waypoint.java b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Waypoint.java new file mode 100644 index 0000000..02efe55 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/com/thevoxelbox/voxelmap/util/Waypoint.java @@ -0,0 +1,113 @@ +package com.thevoxelbox.voxelmap.util; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; + +import java.io.Serializable; +import java.util.TreeSet; + +public class Waypoint + implements Serializable, Comparable { + private static final long serialVersionUID = 8136790917447997951L; + public String name; + public String imageSuffix = ""; + public String world = ""; + public boolean isAutomated = false; + public String sWorld = ""; + public boolean packetWaypoint; + public boolean dontSave; + public TreeSet dimensions = new TreeSet(); + public int x; + public int z; + public int y; + public boolean enabled; + public boolean forced; + public boolean inWorld = true; + public boolean inDimension = true; + public float red = 0.0F; + public float green = 1.0F; + public float blue = 0.0F; + + public Waypoint(String name, int x, int z, int y, boolean enabled, float red, float green, float blue, + String suffix, String world, TreeSet dimensions, boolean isAutomated) { + this(name, x, z, y, enabled, red, green, blue, suffix, world, dimensions); + this.isAutomated = isAutomated; + + if (!dimensions.contains(Minecraft.getMinecraft().thePlayer.dimension)) { + inDimension = false; + } + } + + public Waypoint(String string, int x, int y, int z, boolean enabled, float red, float green, + float blue, String imageSuffix, String world, TreeSet dimensions, boolean automated, + boolean bl3) { + this(string, x, y, z, enabled, red, green, blue, imageSuffix, world, dimensions); + this.isAutomated = automated; + this.dontSave = bl3; + if (!dimensions.contains(Minecraft.getMinecraft().thePlayer.dimension)) { + this.inDimension = false; + } + } + + public Waypoint(String name, int x, int z, int y, boolean enabled, float red, float green, float blue, + String suffix, String world, TreeSet dimensions) { + this.name = name; + this.x = x; + this.z = z; + this.y = y; + this.enabled = enabled; + this.red = red; + this.green = green; + this.blue = blue; + this.imageSuffix = suffix; + this.world = world; + this.dimensions = dimensions; + } + + public int getUnified() { + return -16777216 + ((int) (this.red * 255.0F) << 16) + ((int) (this.green * 255.0F) << 8) + + (int) (this.blue * 255.0F); + } + + public boolean isActive() { + return (this.enabled) && (this.inWorld) && (this.inDimension); + } + + public int getX() { + return Minecraft.getMinecraft().thePlayer.dimension == -1 ? this.x / 8 : this.x; + } + + public void setX(int x) { + this.x = (Minecraft.getMinecraft().thePlayer.dimension == -1 ? x * 8 : x); + } + + public int getZ() { + return Minecraft.getMinecraft().thePlayer.dimension == -1 ? this.z / 8 : this.z; + } + + public void setZ(int z) { + this.z = (Minecraft.getMinecraft().thePlayer.dimension == -1 ? z * 8 : z); + } + + public int getY() { + return this.y; + } + + public void setY(int y) { + this.y = y; + } + + public int compareTo(Object arg0) { + double myDistance = getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer); + double comparedDistance = ((Waypoint) arg0).getDistanceSqToEntity(Minecraft.getMinecraft().thePlayer); + + return Double.compare(myDistance, comparedDistance); + } + + public double getDistanceSqToEntity(Entity par1Entity) { + double var2 = getX() - par1Entity.posX; + double var4 = getY() - par1Entity.posY; + double var6 = getZ() - par1Entity.posZ; + return var2 * var2 + var4 * var4 + var6 * var6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/MinecraftMovementInputHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/MinecraftMovementInputHelper.java new file mode 100644 index 0000000..5466172 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/MinecraftMovementInputHelper.java @@ -0,0 +1,135 @@ +package net.minecraft; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.ModuleToggleSprint; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.MovementInputFromOptions; + +import java.text.DecimalFormat; + +public class MinecraftMovementInputHelper extends MovementInputFromOptions { + public static boolean lIIIIlIIllIIlIIlIIIlIIllI; + public static boolean lIIIIIIIIIlIllIIllIlIIlIl; + public static boolean isSprinting = true; + public static boolean superSusBoolean = false; + public static boolean aSusBoolean = false; + private static long IlIlllIIIIllIllllIllIIlIl; + private static long llIIlllIIIIlllIllIlIlllIl; + private static boolean lIIlIlIllIIlIIIlIIIlllIII; + private static boolean IIIlllIIIllIllIlIIIIIIlII; + private static boolean llIlIIIlIIIIlIlllIlIIIIll; + private static boolean IIIlIIllllIIllllllIlIIIll; + private static boolean lllIIIIIlIllIlIIIllllllII; + public static String toggleSprintString = ""; + + public MinecraftMovementInputHelper(GameSettings gameSettings) { + super(gameSettings); + } + + public static void lIIIIlIIllIIlIIlIIIlIIllI(Minecraft minecraft, MovementInputFromOptions movementInputFromOptions, EntityPlayerSP entityPlayerSP) { + movementInputFromOptions.moveStrafe = 0.0f; + movementInputFromOptions.moveForward = 0.0f; + GameSettings gameSettings = minecraft.gameSettings; + if (gameSettings.keyBindForward.getIsKeyPressed()) { + movementInputFromOptions.moveForward += 1.0f; + } + if (gameSettings.keyBindBack.getIsKeyPressed()) { + movementInputFromOptions.moveForward -= 1.0f; + } + if (gameSettings.keyBindLeft.getIsKeyPressed()) { + movementInputFromOptions.moveStrafe += 1.0f; + } + if (gameSettings.keyBindRight.getIsKeyPressed()) { + movementInputFromOptions.moveStrafe -= 1.0f; + } + if (entityPlayerSP.isRiding() && !IIIlIIllllIIllllllIlIIIll) { + IIIlIIllllIIllllllIlIIIll = true; + lllIIIIIlIllIlIIIllllllII = isSprinting; + } else if (IIIlIIllllIIllllllIlIIIll && !entityPlayerSP.isRiding()) { + IIIlIIllllIIllllllIlIIIll = false; + if (lllIIIIIlIllIlIIIllllllII && !isSprinting) { + isSprinting = true; + llIIlllIIIIlllIllIlIlllIl = System.currentTimeMillis(); + IIIlllIIIllIllIlIIIIIIlII = true; + superSusBoolean = false; + } + } + movementInputFromOptions.jump = gameSettings.keyBindJump.getIsKeyPressed(); + if ((Boolean) ModuleToggleSprint.toggleSneak.getValue() && CheatBreaker.getInstance().getModuleManager().toggleSprintMod.isEnabled()) { + if (gameSettings.keyBindSneak.getIsKeyPressed() && !lIIlIlIllIIlIIIlIIIlllIII) { + if (entityPlayerSP.isRiding() || entityPlayerSP.capabilities.isFlying) { + movementInputFromOptions.sneak = true; + llIlIIIlIIIIlIlllIlIIIIll = entityPlayerSP.isRiding(); + } else { + movementInputFromOptions.sneak = !movementInputFromOptions.sneak; + } + IlIlllIIIIllIllllIllIIlIl = System.currentTimeMillis(); + lIIlIlIllIIlIIIlIIIlllIII = true; + } + if (!gameSettings.keyBindSneak.getIsKeyPressed() && lIIlIlIllIIlIIIlIIIlllIII) { + if (entityPlayerSP.capabilities.isFlying || llIlIIIlIIIIlIlllIlIIIIll) { + movementInputFromOptions.sneak = false; + } else if (System.currentTimeMillis() - IlIlllIIIIllIllllIllIIlIl > 300L) { + movementInputFromOptions.sneak = false; + } + lIIlIlIllIIlIIIlIIIlllIII = false; + } + } else { + movementInputFromOptions.sneak = gameSettings.keyBindSneak.getIsKeyPressed(); + } + if (movementInputFromOptions.sneak) { + movementInputFromOptions.moveStrafe = (float)((double)movementInputFromOptions.moveStrafe * ((double)1.7f * 0.17647058328542756)); + movementInputFromOptions.moveForward = (float)((double)movementInputFromOptions.moveForward * (0.19999999999999998 * 1.5)); + } + boolean bl = (float)entityPlayerSP.getFoodStats().getFoodLevel() > (float)6 || entityPlayerSP.capabilities.isFlying; + boolean bl2 = !movementInputFromOptions.sneak && !entityPlayerSP.capabilities.isFlying && bl; + lIIIIlIIllIIlIIlIIIlIIllI = !((Boolean) ModuleToggleSprint.toggleSprint.getValue()); + lIIIIIIIIIlIllIIllIlIIlIl = (Boolean) ModuleToggleSprint.doubleTap.getValue(); + if ((bl2 || lIIIIlIIllIIlIIlIIIlIIllI) && gameSettings.keyBindSprint.getIsKeyPressed() && !IIIlllIIIllIllIlIIIIIIlII && !entityPlayerSP.capabilities.isFlying && !lIIIIlIIllIIlIIlIIIlIIllI) { + isSprinting = !isSprinting; + llIIlllIIIIlllIllIlIlllIl = System.currentTimeMillis(); + IIIlllIIIllIllIlIIIIIIlII = true; + superSusBoolean = false; + } + if ((bl2 || lIIIIlIIllIIlIIlIIIlIIllI) && !gameSettings.keyBindSprint.getIsKeyPressed() && IIIlllIIIllIllIlIIIIIIlII) { + if (System.currentTimeMillis() - llIIlllIIIIlllIllIlIlllIl > 300L) { + superSusBoolean = true; + } + IIIlllIIIllIllIlIIIIIIlII = false; + } + MinecraftMovementInputHelper.lIIIIlIIllIIlIIlIIIlIIllI(movementInputFromOptions, entityPlayerSP, gameSettings); + } + + public void setSprintState(boolean bl, boolean bl2) { + isSprinting = bl; + aSusBoolean = bl2; + } + + private static void lIIIIlIIllIIlIIlIIIlIIllI(MovementInputFromOptions movementInputFromOptions, EntityPlayerSP entityPlayerSP, GameSettings gameSettings) { +// toggleSprintString = ""; + String string = ""; + boolean flying = entityPlayerSP.capabilities.isFlying; + boolean riding = entityPlayerSP.isRiding(); + boolean sneakHeld = gameSettings.keyBindSneak.getIsKeyPressed(); + boolean sprintHeld = gameSettings.keyBindSprint.getIsKeyPressed(); + if (flying) { + DecimalFormat decimalFormat = new DecimalFormat("#.00"); + string = (Boolean) ModuleToggleSprint.flyBoost.getValue() && sprintHeld && entityPlayerSP.capabilities.isCreativeMode ? string + ((String)CheatBreaker.getInstance().getModuleManager().toggleSprintMod.flyBoostString.getValue()).replaceAll("%BOOST%", decimalFormat.format(ModuleToggleSprint.flyBoostAmount.getValue())) : string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.flyString.getValue(); + } + if (riding) { + string = string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.ridingString.getValue(); + } + if (movementInputFromOptions.sneak) { + string = flying ? CheatBreaker.getInstance().getModuleManager().toggleSprintMod.decendString.getValue().toString() : + (riding ? CheatBreaker.getInstance().getModuleManager().toggleSprintMod.dismountString.getValue().toString() : + (sneakHeld ? string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sneakHeldString.getValue() : + string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sneakToggledString.getValue())); + } else if (isSprinting && !flying && !riding) { + boolean bl5 = superSusBoolean || lIIIIlIIllIIlIIlIIIlIIllI || aSusBoolean; + string = sprintHeld ? string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sprintHeldString.getValue() : (bl5 ? string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sprintVanillaString.getValue() : string + CheatBreaker.getInstance().getModuleManager().toggleSprintMod.sprintToggledString.getValue()); + } + toggleSprintString = string; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/Block.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/Block.java new file mode 100644 index 0000000..7346d8e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/Block.java @@ -0,0 +1,1183 @@ +package net.minecraft.block; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.CollisionEvent; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.*; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.Random; + +public class Block { + public static final RegistryNamespaced blockRegistry = new RegistryNamespacedDefaultedByKey("air"); + private CreativeTabs displayOnCreativeTab; + protected String textureName; + public static final Block.SoundType soundTypeStone = new Block.SoundType("stone", 1.0F, 1.0F); + + /** the wood sound type */ + public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F); + + /** the gravel sound type */ + public static final Block.SoundType soundTypeGravel = new Block.SoundType("gravel", 1.0F, 1.0F); + public static final Block.SoundType soundTypeGrass = new Block.SoundType("grass", 1.0F, 1.0F); + + /** The piston step sound */ + public static final Block.SoundType soundTypePiston = new Block.SoundType("stone", 1.0F, 1.0F); + + /** The metal sound type */ + public static final Block.SoundType soundTypeMetal = new Block.SoundType("stone", 1.0F, 1.5F); + + /** Glass footsteps */ + public static final Block.SoundType soundTypeGlass = new Block.SoundType("stone", 1.0F, 1.0F) { + + public String func_150495_a() { + return "dig.glass"; + } + public String func_150496_b() { + return "step.stone"; + } + }; + + /** Sound for cloth and carpets */ + public static final Block.SoundType soundTypeCloth = new Block.SoundType("cloth", 1.0F, 1.0F); + public static final Block.SoundType field_149776_m = new Block.SoundType("sand", 1.0F, 1.0F); + public static final Block.SoundType soundTypeSnow = new Block.SoundType("snow", 1.0F, 1.0F); + + /** The ladder sound type */ + public static final Block.SoundType soundTypeLadder = new Block.SoundType("ladder", 1.0F, 1.0F) { + + public String func_150495_a() { + return "dig.wood"; + } + }; + + /** The anvil sound type */ + public static final Block.SoundType soundTypeAnvil = new Block.SoundType("anvil", 0.3F, 1.0F) { + + public String func_150495_a() { + return "dig.stone"; + } + public String func_150496_b() { + return "random.anvil_land"; + } + }; + protected boolean opaque; + + /** How much light is subtracted for going through this block */ + protected int lightOpacity; + protected boolean canBlockGrass; + + /** Amount of light emitted */ + protected int lightValue; + protected boolean field_149783_u; + + /** Indicates how many hits it takes to break a block. */ + protected float blockHardness; + protected float blockResistance; + protected boolean field_149791_x = true; + protected boolean enableStats = true; + + /** + * Flags whether or not this block is of a type that needs random ticking. Ref-counted by ExtendedBlockStorage in + * order to broadly cull a chunk from the random chunk update list for efficiency's sake. + */ + protected boolean needsRandomTick; + + /** true if the Block contains a Tile Entity */ + protected boolean isBlockContainer; + protected double field_149759_B; + protected double field_149760_C; + protected double field_149754_D; + protected double field_149755_E; + protected double field_149756_F; + protected double field_149757_G; + + /** Sound of stepping on the block */ + public Block.SoundType stepSound; + public float blockParticleGravity; + protected final Material blockMaterial; + + /** + * Determines how much velocity is maintained while moving on top of this block + */ + public float slipperiness; + private String unlocalizedNameBlock; + protected IIcon blockIcon; + public static IIcon renderBlockIcon; + + + public static int getIdFromBlock(Block p_149682_0_) { + return blockRegistry.getIDForObject(p_149682_0_); + } + + public static Block getBlockById(int p_149729_0_) { + return (Block)blockRegistry.getObjectForID(p_149729_0_); + } + + public static Block getBlockFromItem(Item p_149634_0_) { + return getBlockById(Item.getIdFromItem(p_149634_0_)); + } + + public static Block getBlockFromName(String p_149684_0_) { + if (blockRegistry.containsKey(p_149684_0_)) { + return (Block)blockRegistry.getObject(p_149684_0_); + } else { + try { + return (Block)blockRegistry.getObjectForID(Integer.parseInt(p_149684_0_)); + } catch (NumberFormatException var2) { + return null; + } + } + } + + public boolean func_149730_j() { + return this.opaque; + } + + public int getLightOpacity() { + return this.lightOpacity; + } + + public boolean getCanBlockGrass() { + return this.canBlockGrass; + } + + public int getLightValue() { + return CheatBreaker.getInstance().getModuleManager().staffModuleXray.shouldRender(Block.getIdFromBlock(this), true) ? this.lightValue : 15; + } + + public boolean func_149710_n() { + return this.field_149783_u; + } + + public Material getMaterial() { + return this.blockMaterial; + } + + public MapColor getMapColor(int p_149728_1_) { + return this.getMaterial().getMaterialMapColor(); + } + + public static void registerBlocks() { + blockRegistry.addObject(0, "air", (new BlockAir()).setBlockName("air")); + blockRegistry.addObject(1, "stone", (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stone").setBlockTextureName("stone")); + blockRegistry.addObject(2, "grass", (new BlockGrass()).setHardness(0.6F).setStepSound(soundTypeGrass).setBlockName("grass").setBlockTextureName("grass")); + blockRegistry.addObject(3, "dirt", (new BlockDirt()).setHardness(0.5F).setStepSound(soundTypeGravel).setBlockName("dirt").setBlockTextureName("dirt")); + Block var0 = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stonebrick").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("cobblestone"); + blockRegistry.addObject(4, "cobblestone", var0); + Block var1 = (new BlockWood()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("wood").setBlockTextureName("planks"); + blockRegistry.addObject(5, "planks", var1); + blockRegistry.addObject(6, "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("sapling").setBlockTextureName("sapling")); + blockRegistry.addObject(7, "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setBlockName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("bedrock")); + blockRegistry.addObject(8, "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setBlockName("water").disableStats().setBlockTextureName("water_flow")); + blockRegistry.addObject(9, "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setBlockName("water").disableStats().setBlockTextureName("water_still")); + blockRegistry.addObject(10, "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setBlockName("lava").disableStats().setBlockTextureName("lava_flow")); + blockRegistry.addObject(11, "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setBlockName("lava").disableStats().setBlockTextureName("lava_still")); + blockRegistry.addObject(12, "sand", (new BlockSand()).setHardness(0.5F).setStepSound(field_149776_m).setBlockName("sand").setBlockTextureName("sand")); + blockRegistry.addObject(13, "gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setBlockName("gravel").setBlockTextureName("gravel")); + blockRegistry.addObject(14, "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreGold").setBlockTextureName("gold_ore")); + blockRegistry.addObject(15, "iron_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreIron").setBlockTextureName("iron_ore")); + blockRegistry.addObject(16, "coal_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreCoal").setBlockTextureName("coal_ore")); + blockRegistry.addObject(17, "log", (new BlockOldLog()).setBlockName("log").setBlockTextureName("log")); + blockRegistry.addObject(18, "leaves", (new BlockOldLeaf()).setBlockName("leaves").setBlockTextureName("leaves")); + blockRegistry.addObject(19, "sponge", (new BlockSponge()).setHardness(0.6F).setStepSound(soundTypeGrass).setBlockName("sponge").setBlockTextureName("sponge")); + blockRegistry.addObject(20, "glass", (new BlockGlass(Material.glass, false)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("glass").setBlockTextureName("glass")); + blockRegistry.addObject(21, "lapis_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreLapis").setBlockTextureName("lapis_ore")); + blockRegistry.addObject(22, "lapis_block", (new BlockCompressed(MapColor.field_151652_H)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("blockLapis").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("lapis_block")); + blockRegistry.addObject(23, "dispenser", (new BlockDispenser()).setHardness(3.5F).setStepSound(soundTypePiston).setBlockName("dispenser").setBlockTextureName("dispenser")); + Block var2 = (new BlockSandStone()).setStepSound(soundTypePiston).setHardness(0.8F).setBlockName("sandStone").setBlockTextureName("sandstone"); + blockRegistry.addObject(24, "sandstone", var2); + blockRegistry.addObject(25, "noteblock", (new BlockNote()).setHardness(0.8F).setBlockName("musicBlock").setBlockTextureName("noteblock")); + blockRegistry.addObject(26, "bed", (new BlockBed()).setHardness(0.2F).setBlockName("bed").disableStats().setBlockTextureName("bed")); + blockRegistry.addObject(27, "golden_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("goldenRail").setBlockTextureName("rail_golden")); + blockRegistry.addObject(28, "detector_rail", (new BlockRailDetector()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("detectorRail").setBlockTextureName("rail_detector")); + blockRegistry.addObject(29, "sticky_piston", (new BlockPistonBase(true)).setBlockName("pistonStickyBase")); + blockRegistry.addObject(30, "web", (new BlockWeb()).setLightOpacity(1).setHardness(4.0F).setBlockName("web").setBlockTextureName("web")); + blockRegistry.addObject(31, "tallgrass", (new BlockTallGrass()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("tallgrass")); + blockRegistry.addObject(32, "deadbush", (new BlockDeadBush()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("deadbush").setBlockTextureName("deadbush")); + blockRegistry.addObject(33, "piston", (new BlockPistonBase(false)).setBlockName("pistonBase")); + blockRegistry.addObject(34, "piston_head", new BlockPistonExtension()); + blockRegistry.addObject(35, "wool", (new BlockColored(Material.cloth)).setHardness(0.8F).setStepSound(soundTypeCloth).setBlockName("cloth").setBlockTextureName("wool_colored")); + blockRegistry.addObject(36, "piston_extension", new BlockPistonMoving()); + blockRegistry.addObject(37, "yellow_flower", (new BlockFlower(0)).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("flower1").setBlockTextureName("flower_dandelion")); + blockRegistry.addObject(38, "red_flower", (new BlockFlower(1)).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("flower2").setBlockTextureName("flower_rose")); + blockRegistry.addObject(39, "brown_mushroom", (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setLightLevel(0.125F).setBlockName("mushroom").setBlockTextureName("mushroom_brown")); + blockRegistry.addObject(40, "red_mushroom", (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("mushroom").setBlockTextureName("mushroom_red")); + blockRegistry.addObject(41, "gold_block", (new BlockCompressed(MapColor.field_151647_F)).setHardness(3.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockGold").setBlockTextureName("gold_block")); + blockRegistry.addObject(42, "iron_block", (new BlockCompressed(MapColor.field_151668_h)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockIron").setBlockTextureName("iron_block")); + blockRegistry.addObject(43, "double_stone_slab", (new BlockStoneSlab(true)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stoneSlab")); + blockRegistry.addObject(44, "stone_slab", (new BlockStoneSlab(false)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stoneSlab")); + Block var3 = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("brick").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("brick"); + blockRegistry.addObject(45, "brick_block", var3); + blockRegistry.addObject(46, "tnt", (new BlockTNT()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("tnt").setBlockTextureName("tnt")); + blockRegistry.addObject(47, "bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(soundTypeWood).setBlockName("bookshelf").setBlockTextureName("bookshelf")); + blockRegistry.addObject(48, "mossy_cobblestone", (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stoneMoss").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("cobblestone_mossy")); + blockRegistry.addObject(49, "obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setStepSound(soundTypePiston).setBlockName("obsidian").setBlockTextureName("obsidian")); + blockRegistry.addObject(50, "torch", (new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(soundTypeWood).setBlockName("torch").setBlockTextureName("torch_on")); + blockRegistry.addObject(51, "fire", (new BlockFire()).setHardness(0.0F).setLightLevel(1.0F).setStepSound(soundTypeWood).setBlockName("fire").disableStats().setBlockTextureName("fire")); + blockRegistry.addObject(52, "mob_spawner", (new BlockMobSpawner()).setHardness(5.0F).setStepSound(soundTypeMetal).setBlockName("mobSpawner").disableStats().setBlockTextureName("mob_spawner")); + blockRegistry.addObject(53, "oak_stairs", (new BlockStairs(var1, 0)).setBlockName("stairsWood")); + blockRegistry.addObject(54, "chest", (new BlockChest(0)).setHardness(2.5F).setStepSound(soundTypeWood).setBlockName("chest")); + blockRegistry.addObject(55, "redstone_wire", (new BlockRedstoneWire()).setHardness(0.0F).setStepSound(soundTypeStone).setBlockName("redstoneDust").disableStats().setBlockTextureName("redstone_dust")); + blockRegistry.addObject(56, "diamond_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreDiamond").setBlockTextureName("diamond_ore")); + blockRegistry.addObject(57, "diamond_block", (new BlockCompressed(MapColor.field_151648_G)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockDiamond").setBlockTextureName("diamond_block")); + blockRegistry.addObject(58, "crafting_table", (new BlockWorkbench()).setHardness(2.5F).setStepSound(soundTypeWood).setBlockName("workbench").setBlockTextureName("crafting_table")); + blockRegistry.addObject(59, "wheat", (new BlockCrops()).setBlockName("crops").setBlockTextureName("wheat")); + Block var4 = (new BlockFarmland()).setHardness(0.6F).setStepSound(soundTypeGravel).setBlockName("farmland").setBlockTextureName("farmland"); + blockRegistry.addObject(60, "farmland", var4); + blockRegistry.addObject(61, "furnace", (new BlockFurnace(false)).setHardness(3.5F).setStepSound(soundTypePiston).setBlockName("furnace").setCreativeTab(CreativeTabs.tabDecorations)); + blockRegistry.addObject(62, "lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(soundTypePiston).setLightLevel(0.875F).setBlockName("furnace")); + blockRegistry.addObject(63, "standing_sign", (new BlockSign(TileEntitySign.class, true)).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("sign").disableStats()); + blockRegistry.addObject(64, "wooden_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setBlockName("doorWood").disableStats().setBlockTextureName("door_wood")); + blockRegistry.addObject(65, "ladder", (new BlockLadder()).setHardness(0.4F).setStepSound(soundTypeLadder).setBlockName("ladder").setBlockTextureName("ladder")); + blockRegistry.addObject(66, "rail", (new BlockRail()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("rail").setBlockTextureName("rail_normal")); + blockRegistry.addObject(67, "stone_stairs", (new BlockStairs(var0, 0)).setBlockName("stairsStone")); + blockRegistry.addObject(68, "wall_sign", (new BlockSign(TileEntitySign.class, false)).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("sign").disableStats()); + blockRegistry.addObject(69, "lever", (new BlockLever()).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("lever").setBlockTextureName("lever")); + blockRegistry.addObject(70, "stone_pressure_plate", (new BlockPressurePlate("stone", Material.rock, BlockPressurePlate.Sensitivity.mobs)).setHardness(0.5F).setStepSound(soundTypePiston).setBlockName("pressurePlate")); + blockRegistry.addObject(71, "iron_door", (new BlockDoor(Material.iron)).setHardness(5.0F).setStepSound(soundTypeMetal).setBlockName("doorIron").disableStats().setBlockTextureName("door_iron")); + blockRegistry.addObject(72, "wooden_pressure_plate", (new BlockPressurePlate("planks_oak", Material.wood, BlockPressurePlate.Sensitivity.everything)).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("pressurePlate")); + blockRegistry.addObject(73, "redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreRedstone").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("redstone_ore")); + blockRegistry.addObject(74, "lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreRedstone").setBlockTextureName("redstone_ore")); + blockRegistry.addObject(75, "unlit_redstone_torch", (new BlockRedstoneTorch(false)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("notGate").setBlockTextureName("redstone_torch_off")); + blockRegistry.addObject(76, "redstone_torch", (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(soundTypeWood).setBlockName("notGate").setCreativeTab(CreativeTabs.tabRedstone).setBlockTextureName("redstone_torch_on")); + blockRegistry.addObject(77, "stone_button", (new BlockButtonStone()).setHardness(0.5F).setStepSound(soundTypePiston).setBlockName("button")); + blockRegistry.addObject(78, "snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(soundTypeSnow).setBlockName("snow").setLightOpacity(0).setBlockTextureName("snow")); + blockRegistry.addObject(79, "ice", (new BlockIce()).setHardness(0.5F).setLightOpacity(3).setStepSound(soundTypeGlass).setBlockName("ice").setBlockTextureName("ice")); + blockRegistry.addObject(80, "snow", (new BlockSnowBlock()).setHardness(0.2F).setStepSound(soundTypeSnow).setBlockName("snow").setBlockTextureName("snow")); + blockRegistry.addObject(81, "cactus", (new BlockCactus()).setHardness(0.4F).setStepSound(soundTypeCloth).setBlockName("cactus").setBlockTextureName("cactus")); + blockRegistry.addObject(82, "clay", (new BlockClay()).setHardness(0.6F).setStepSound(soundTypeGravel).setBlockName("clay").setBlockTextureName("clay")); + blockRegistry.addObject(83, "reeds", (new BlockReed()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("reeds").disableStats().setBlockTextureName("reeds")); + blockRegistry.addObject(84, "jukebox", (new BlockJukebox()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("jukebox").setBlockTextureName("jukebox")); + blockRegistry.addObject(85, "fence", (new BlockFence("planks_oak", Material.wood)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("fence")); + Block var5 = (new BlockPumpkin(false)).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("pumpkin").setBlockTextureName("pumpkin"); + blockRegistry.addObject(86, "pumpkin", var5); + blockRegistry.addObject(87, "netherrack", (new BlockNetherrack()).setHardness(0.4F).setStepSound(soundTypePiston).setBlockName("hellrock").setBlockTextureName("netherrack")); + blockRegistry.addObject(88, "soul_sand", (new BlockSoulSand()).setHardness(0.5F).setStepSound(field_149776_m).setBlockName("hellsand").setBlockTextureName("soul_sand")); + blockRegistry.addObject(89, "glowstone", (new BlockGlowstone(Material.glass)).setHardness(0.3F).setStepSound(soundTypeGlass).setLightLevel(1.0F).setBlockName("lightgem").setBlockTextureName("glowstone")); + blockRegistry.addObject(90, "portal", (new BlockPortal()).setHardness(-1.0F).setStepSound(soundTypeGlass).setLightLevel(0.75F).setBlockName("portal").setBlockTextureName("portal")); + blockRegistry.addObject(91, "lit_pumpkin", (new BlockPumpkin(true)).setHardness(1.0F).setStepSound(soundTypeWood).setLightLevel(1.0F).setBlockName("litpumpkin").setBlockTextureName("pumpkin")); + blockRegistry.addObject(92, "cake", (new BlockCake()).setHardness(0.5F).setStepSound(soundTypeCloth).setBlockName("cake").disableStats().setBlockTextureName("cake")); + blockRegistry.addObject(93, "unpowered_repeater", (new BlockRedstoneRepeater(false)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("diode").disableStats().setBlockTextureName("repeater_off")); + blockRegistry.addObject(94, "powered_repeater", (new BlockRedstoneRepeater(true)).setHardness(0.0F).setLightLevel(0.625F).setStepSound(soundTypeWood).setBlockName("diode").disableStats().setBlockTextureName("repeater_on")); + blockRegistry.addObject(95, "stained_glass", (new BlockStainedGlass(Material.glass)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("stainedGlass").setBlockTextureName("glass")); + blockRegistry.addObject(96, "trapdoor", (new BlockTrapDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setBlockName("trapdoor").disableStats().setBlockTextureName("trapdoor")); + blockRegistry.addObject(97, "monster_egg", (new BlockSilverfish()).setHardness(0.75F).setBlockName("monsterStoneEgg")); + Block var6 = (new BlockStoneBrick()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stonebricksmooth").setBlockTextureName("stonebrick"); + blockRegistry.addObject(98, "stonebrick", var6); + blockRegistry.addObject(99, "brown_mushroom_block", (new BlockHugeMushroom(Material.wood, 0)).setHardness(0.2F).setStepSound(soundTypeWood).setBlockName("mushroom").setBlockTextureName("mushroom_block")); + blockRegistry.addObject(100, "red_mushroom_block", (new BlockHugeMushroom(Material.wood, 1)).setHardness(0.2F).setStepSound(soundTypeWood).setBlockName("mushroom").setBlockTextureName("mushroom_block")); + blockRegistry.addObject(101, "iron_bars", (new BlockPane("iron_bars", "iron_bars", Material.iron, true)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("fenceIron")); + blockRegistry.addObject(102, "glass_pane", (new BlockPane("glass", "glass_pane_top", Material.glass, false)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("thinGlass")); + Block var7 = (new BlockMelon()).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("melon").setBlockTextureName("melon"); + blockRegistry.addObject(103, "melon_block", var7); + blockRegistry.addObject(104, "pumpkin_stem", (new BlockStem(var5)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("pumpkinStem").setBlockTextureName("pumpkin_stem")); + blockRegistry.addObject(105, "melon_stem", (new BlockStem(var7)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("pumpkinStem").setBlockTextureName("melon_stem")); + blockRegistry.addObject(106, "vine", (new BlockVine()).setHardness(0.2F).setStepSound(soundTypeGrass).setBlockName("vine").setBlockTextureName("vine")); + blockRegistry.addObject(107, "fence_gate", (new BlockFenceGate()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("fenceGate")); + blockRegistry.addObject(108, "brick_stairs", (new BlockStairs(var3, 0)).setBlockName("stairsBrick")); + blockRegistry.addObject(109, "stone_brick_stairs", (new BlockStairs(var6, 0)).setBlockName("stairsStoneBrickSmooth")); + blockRegistry.addObject(110, "mycelium", (new BlockMycelium()).setHardness(0.6F).setStepSound(soundTypeGrass).setBlockName("mycel").setBlockTextureName("mycelium")); + blockRegistry.addObject(111, "waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("waterlily").setBlockTextureName("waterlily")); + Block var8 = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("netherBrick").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("nether_brick"); + blockRegistry.addObject(112, "nether_brick", var8); + blockRegistry.addObject(113, "nether_brick_fence", (new BlockFence("nether_brick", Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("netherFence")); + blockRegistry.addObject(114, "nether_brick_stairs", (new BlockStairs(var8, 0)).setBlockName("stairsNetherBrick")); + blockRegistry.addObject(115, "nether_wart", (new BlockNetherWart()).setBlockName("netherStalk").setBlockTextureName("nether_wart")); + blockRegistry.addObject(116, "enchanting_table", (new BlockEnchantmentTable()).setHardness(5.0F).setResistance(2000.0F).setBlockName("enchantmentTable").setBlockTextureName("enchanting_table")); + blockRegistry.addObject(117, "brewing_stand", (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setBlockName("brewingStand").setBlockTextureName("brewing_stand")); + blockRegistry.addObject(118, "cauldron", (new BlockCauldron()).setHardness(2.0F).setBlockName("cauldron").setBlockTextureName("cauldron")); + blockRegistry.addObject(119, "end_portal", (new BlockEndPortal(Material.Portal)).setHardness(-1.0F).setResistance(6000000.0F)); + blockRegistry.addObject(120, "end_portal_frame", (new BlockEndPortalFrame()).setStepSound(soundTypeGlass).setLightLevel(0.125F).setHardness(-1.0F).setBlockName("endPortalFrame").setResistance(6000000.0F).setCreativeTab(CreativeTabs.tabDecorations).setBlockTextureName("endframe")); + blockRegistry.addObject(121, "end_stone", (new Block(Material.rock)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundTypePiston).setBlockName("whiteStone").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("end_stone")); + blockRegistry.addObject(122, "dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(soundTypePiston).setLightLevel(0.125F).setBlockName("dragonEgg").setBlockTextureName("dragon_egg")); + blockRegistry.addObject(123, "redstone_lamp", (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("redstoneLight").setCreativeTab(CreativeTabs.tabRedstone).setBlockTextureName("redstone_lamp_off")); + blockRegistry.addObject(124, "lit_redstone_lamp", (new BlockRedstoneLight(true)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("redstoneLight").setBlockTextureName("redstone_lamp_on")); + blockRegistry.addObject(125, "double_wooden_slab", (new BlockWoodSlab(true)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("woodSlab")); + blockRegistry.addObject(126, "wooden_slab", (new BlockWoodSlab(false)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("woodSlab")); + blockRegistry.addObject(127, "cocoa", (new BlockCocoa()).setHardness(0.2F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("cocoa").setBlockTextureName("cocoa")); + blockRegistry.addObject(128, "sandstone_stairs", (new BlockStairs(var2, 0)).setBlockName("stairsSandStone")); + blockRegistry.addObject(129, "emerald_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreEmerald").setBlockTextureName("emerald_ore")); + blockRegistry.addObject(130, "ender_chest", (new BlockEnderChest()).setHardness(22.5F).setResistance(1000.0F).setStepSound(soundTypePiston).setBlockName("enderChest").setLightLevel(0.5F)); + blockRegistry.addObject(131, "tripwire_hook", (new BlockTripWireHook()).setBlockName("tripWireSource").setBlockTextureName("trip_wire_source")); + blockRegistry.addObject(132, "tripwire", (new BlockTripWire()).setBlockName("tripWire").setBlockTextureName("trip_wire")); + blockRegistry.addObject(133, "emerald_block", (new BlockCompressed(MapColor.field_151653_I)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockEmerald").setBlockTextureName("emerald_block")); + blockRegistry.addObject(134, "spruce_stairs", (new BlockStairs(var1, 1)).setBlockName("stairsWoodSpruce")); + blockRegistry.addObject(135, "birch_stairs", (new BlockStairs(var1, 2)).setBlockName("stairsWoodBirch")); + blockRegistry.addObject(136, "jungle_stairs", (new BlockStairs(var1, 3)).setBlockName("stairsWoodJungle")); + blockRegistry.addObject(137, "command_block", (new BlockCommandBlock()).setBlockUnbreakable().setResistance(6000000.0F).setBlockName("commandBlock").setBlockTextureName("command_block")); + blockRegistry.addObject(138, "beacon", (new BlockBeacon()).setBlockName("beacon").setLightLevel(1.0F).setBlockTextureName("beacon")); + blockRegistry.addObject(139, "cobblestone_wall", (new BlockWall(var0)).setBlockName("cobbleWall")); + blockRegistry.addObject(140, "flower_pot", (new BlockFlowerPot()).setHardness(0.0F).setStepSound(soundTypeStone).setBlockName("flowerPot").setBlockTextureName("flower_pot")); + blockRegistry.addObject(141, "carrots", (new BlockCarrot()).setBlockName("carrots").setBlockTextureName("carrots")); + blockRegistry.addObject(142, "potatoes", (new BlockPotato()).setBlockName("potatoes").setBlockTextureName("potatoes")); + blockRegistry.addObject(143, "wooden_button", (new BlockButtonWood()).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("button")); + blockRegistry.addObject(144, "skull", (new BlockSkull()).setHardness(1.0F).setStepSound(soundTypePiston).setBlockName("skull").setBlockTextureName("skull")); + blockRegistry.addObject(145, "anvil", (new BlockAnvil()).setHardness(5.0F).setStepSound(soundTypeAnvil).setResistance(2000.0F).setBlockName("anvil")); + blockRegistry.addObject(146, "trapped_chest", (new BlockChest(1)).setHardness(2.5F).setStepSound(soundTypeWood).setBlockName("chestTrap")); + blockRegistry.addObject(147, "light_weighted_pressure_plate", (new BlockPressurePlateWeighted("gold_block", Material.iron, 15)).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("weightedPlate_light")); + blockRegistry.addObject(148, "heavy_weighted_pressure_plate", (new BlockPressurePlateWeighted("iron_block", Material.iron, 150)).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("weightedPlate_heavy")); + blockRegistry.addObject(149, "unpowered_comparator", (new BlockRedstoneComparator(false)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("comparator").disableStats().setBlockTextureName("comparator_off")); + blockRegistry.addObject(150, "powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F).setLightLevel(0.625F).setStepSound(soundTypeWood).setBlockName("comparator").disableStats().setBlockTextureName("comparator_on")); + blockRegistry.addObject(151, "daylight_detector", (new BlockDaylightDetector()).setHardness(0.2F).setStepSound(soundTypeWood).setBlockName("daylightDetector").setBlockTextureName("daylight_detector")); + blockRegistry.addObject(152, "redstone_block", (new BlockCompressedPowered(MapColor.field_151656_f)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockRedstone").setBlockTextureName("redstone_block")); + blockRegistry.addObject(153, "quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("netherquartz").setBlockTextureName("quartz_ore")); + blockRegistry.addObject(154, "hopper", (new BlockHopper()).setHardness(3.0F).setResistance(8.0F).setStepSound(soundTypeWood).setBlockName("hopper").setBlockTextureName("hopper")); + Block var9 = (new BlockQuartz()).setStepSound(soundTypePiston).setHardness(0.8F).setBlockName("quartzBlock").setBlockTextureName("quartz_block"); + blockRegistry.addObject(155, "quartz_block", var9); + blockRegistry.addObject(156, "quartz_stairs", (new BlockStairs(var9, 0)).setBlockName("stairsQuartz")); + blockRegistry.addObject(157, "activator_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("activatorRail").setBlockTextureName("rail_activator")); + blockRegistry.addObject(158, "dropper", (new BlockDropper()).setHardness(3.5F).setStepSound(soundTypePiston).setBlockName("dropper").setBlockTextureName("dropper")); + blockRegistry.addObject(159, "stained_hardened_clay", (new BlockColored(Material.rock)).setHardness(1.25F).setResistance(7.0F).setStepSound(soundTypePiston).setBlockName("clayHardenedStained").setBlockTextureName("hardened_clay_stained")); + blockRegistry.addObject(160, "stained_glass_pane", (new BlockStainedGlassPane()).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("thinStainedGlass").setBlockTextureName("glass")); + blockRegistry.addObject(161, "leaves2", (new BlockNewLeaf()).setBlockName("leaves").setBlockTextureName("leaves")); + blockRegistry.addObject(162, "log2", (new BlockNewLog()).setBlockName("log").setBlockTextureName("log")); + blockRegistry.addObject(163, "acacia_stairs", (new BlockStairs(var1, 4)).setBlockName("stairsWoodAcacia")); + blockRegistry.addObject(164, "dark_oak_stairs", (new BlockStairs(var1, 5)).setBlockName("stairsWoodDarkOak")); + blockRegistry.addObject(170, "hay_block", (new BlockHay()).setHardness(0.5F).setStepSound(soundTypeGrass).setBlockName("hayBlock").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("hay_block")); + blockRegistry.addObject(171, "carpet", (new BlockCarpet()).setHardness(0.1F).setStepSound(soundTypeCloth).setBlockName("woolCarpet").setLightOpacity(0)); + blockRegistry.addObject(172, "hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(soundTypePiston).setBlockName("clayHardened").setBlockTextureName("hardened_clay")); + blockRegistry.addObject(173, "coal_block", (new Block(Material.rock)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("blockCoal").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("coal_block")); + blockRegistry.addObject(174, "packed_ice", (new BlockPackedIce()).setHardness(0.5F).setStepSound(soundTypeGlass).setBlockName("icePacked").setBlockTextureName("ice_packed")); + blockRegistry.addObject(175, "double_plant", new BlockDoublePlant()); + Iterator var10 = blockRegistry.iterator(); + + while (var10.hasNext()) { + Block var11 = (Block)var10.next(); + + if (var11.blockMaterial == Material.air) { + var11.field_149783_u = false; + } else { + boolean var12 = false; + boolean var13 = var11.getRenderType() == 10; + boolean var14 = var11 instanceof BlockSlab; + boolean var15 = var11 == var4; + boolean var16 = var11.canBlockGrass; + boolean var17 = var11.lightOpacity == 0; + + if (var13 || var14 || var15 || var16 || var17) { + var12 = true; + } + + var11.field_149783_u = var12; + } + } + } + + protected Block(Material p_i45394_1_) { + this.stepSound = soundTypeStone; + this.blockParticleGravity = 1.0F; + this.slipperiness = 0.6F; + this.blockMaterial = p_i45394_1_; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.opaque = this.isOpaqueCube(); + this.lightOpacity = this.isOpaqueCube() ? 255 : 0; + this.canBlockGrass = !p_i45394_1_.getCanBlockGrass(); + } + + /** + * Sets the footstep sound for the block. Returns the object for convenience in constructing. + */ + protected Block setStepSound(Block.SoundType p_149672_1_) { + this.stepSound = p_149672_1_; + return this; + } + + /** + * Sets how much light is blocked going through this block. Returns the object for convenience in constructing. + */ + public Block setLightOpacity(int p_149713_1_) { + this.lightOpacity = p_149713_1_; + return this; + } + + /** + * Sets the light value that the block emits. Returns resulting block instance for constructing convenience. Args: + * level + */ + protected Block setLightLevel(float p_149715_1_) { + this.lightValue = (int)(15.0F * p_149715_1_); + return this; + } + + /** + * Sets the the blocks resistance to explosions. Returns the object for convenience in constructing. + */ + protected Block setResistance(float p_149752_1_) { + this.blockResistance = p_149752_1_ * 3.0F; + return this; + } + + /** + * Indicate if a material is a normal solid opaque cube + */ + public boolean isBlockNormalCube() { + return this.blockMaterial.blocksMovement() && this.renderAsNormalBlock(); + } + + public boolean isNormalCube() { + return this.blockMaterial.isOpaque() && this.renderAsNormalBlock() && !this.canProvidePower(); + } + + public boolean renderAsNormalBlock() { + return true; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return !this.blockMaterial.blocksMovement(); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 0; + } + + /** + * Sets how many hits it takes to break a block. + */ + protected Block setHardness(float p_149711_1_) { + this.blockHardness = p_149711_1_; + + if (this.blockResistance < p_149711_1_ * 5.0F) { + this.blockResistance = p_149711_1_ * 5.0F; + } + + return this; + } + + protected Block setBlockUnbreakable() { + this.setHardness(-1.0F); + return this; + } + + public float getBlockHardness(World p_149712_1_, int p_149712_2_, int p_149712_3_, int p_149712_4_) { + return this.blockHardness; + } + + /** + * Sets whether this block type will receive random update ticks + */ + protected Block setTickRandomly(boolean p_149675_1_) { + this.needsRandomTick = p_149675_1_; + return this; + } + + /** + * Returns whether or not this block is of a type that needs random ticking. Called for ref-counting purposes by + * ExtendedBlockStorage in order to broadly cull a chunk from the random chunk update list for efficiency's sake. + */ + public boolean getTickRandomly() { + return this.needsRandomTick; + } + + public boolean hasTileEntity() { + return this.isBlockContainer; + } + + protected final void setBlockBounds(float p_149676_1_, float p_149676_2_, float p_149676_3_, float p_149676_4_, float p_149676_5_, float p_149676_6_) { + this.field_149759_B = p_149676_1_; + this.field_149760_C = p_149676_2_; + this.field_149754_D = p_149676_3_; + this.field_149755_E = p_149676_4_; + this.field_149756_F = p_149676_5_; + this.field_149757_G = p_149676_6_; + } + + public int getBlockBrightness(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) { + Block var5 = p_149677_1_.getBlock(p_149677_2_, p_149677_3_, p_149677_4_); + int var6 = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, var5.getLightValue()); + + if (var6 == 0 && var5 instanceof BlockSlab) { + --p_149677_3_; + var5 = p_149677_1_.getBlock(p_149677_2_, p_149677_3_, p_149677_4_); + return p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, var5.getLightValue()); + } else { + return var6; + } + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return p_149646_5_ == 0 && this.field_149760_C > 0.0D || (p_149646_5_ == 1 && this.field_149756_F < 1.0D || (p_149646_5_ == 2 && this.field_149754_D > 0.0D || (p_149646_5_ == 3 && this.field_149757_G < 1.0D || (p_149646_5_ == 4 && this.field_149759_B > 0.0D || (p_149646_5_ == 5 && this.field_149755_E < 1.0D || !p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_).isOpaqueCube()))))); + } + + public boolean isBlockSolid(IBlockAccess p_149747_1_, int p_149747_2_, int p_149747_3_, int p_149747_4_, int p_149747_5_) { + return p_149747_1_.getBlock(p_149747_2_, p_149747_3_, p_149747_4_).getMaterial().isSolid(); + } + + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return this.getIcon(p_149673_5_, p_149673_1_.getBlockMetadata(p_149673_2_, p_149673_3_, p_149673_4_)); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return this.blockIcon; + } + + /** + * Returns the block texture based on the side being looked at. Args: side + */ + public final IIcon getBlockTextureFromSide(int p_149733_1_) { + return this.getIcon(p_149733_1_, 0); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + return AxisAlignedBB.getBoundingBox((double)p_149633_2_ + this.field_149759_B, (double)p_149633_3_ + this.field_149760_C, (double)p_149633_4_ + this.field_149754_D, (double)p_149633_2_ + this.field_149755_E, (double)p_149633_3_ + this.field_149756_F, (double)p_149633_4_ + this.field_149757_G); + } + + public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { + AxisAlignedBB var8 = this.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); + CollisionEvent var9 = new CollisionEvent(var6, var2, var3, var4); + CheatBreaker.getInstance().getEventBus().handleEvent(var9); + if (!var9.isCanceled() && var8 != null && var5.intersectsWith(var8)) { + var6.add(var8); + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return AxisAlignedBB.getBoundingBox((double)p_149668_2_ + this.field_149759_B, (double)p_149668_3_ + this.field_149760_C, (double)p_149668_4_ + this.field_149754_D, (double)p_149668_2_ + this.field_149755_E, (double)p_149668_3_ + this.field_149756_F, (double)p_149668_4_ + this.field_149757_G); + } + + public boolean isOpaqueCube() { + return true; + } + + /** + * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param + * par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int p_149678_1_, boolean p_149678_2_) { + return this.isCollidable(); + } + + public boolean isCollidable() { + return true; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {} + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) {} + + public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_) {} + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) {} + + public int func_149738_a(World p_149738_1_) { + return 10; + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {} + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(this); + } + + public float getPlayerRelativeBlockHardness(EntityPlayer p_149737_1_, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) { + float var6 = this.getBlockHardness(p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); + return var6 < 0.0F ? 0.0F : (!p_149737_1_.canHarvestBlock(this) ? p_149737_1_.getCurrentPlayerStrVsBlock(this, false) / var6 / 100.0F : p_149737_1_.getCurrentPlayerStrVsBlock(this, true) / var6 / 30.0F); + } + + /** + * Drops the specified block items + */ + public final void dropBlockAsItem(World p_149697_1_, int p_149697_2_, int p_149697_3_, int p_149697_4_, int p_149697_5_, int p_149697_6_) { + this.dropBlockAsItemWithChance(p_149697_1_, p_149697_2_, p_149697_3_, p_149697_4_, p_149697_5_, 1.0F, p_149697_6_); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + if (!p_149690_1_.isClient) { + int var8 = this.quantityDroppedWithBonus(p_149690_7_, p_149690_1_.rand); + + for (int var9 = 0; var9 < var8; ++var9) { + if (p_149690_1_.rand.nextFloat() <= p_149690_6_) { + Item var10 = this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_); + + if (var10 != null) { + this.dropBlockAsItem_do(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(var10, 1, this.damageDropped(p_149690_5_))); + } + } + } + } + } + + /** + * Spawns EntityItem in the world for the given ItemStack if the world is not remote. + */ + protected void dropBlockAsItem_do(World p_149642_1_, int p_149642_2_, int p_149642_3_, int p_149642_4_, ItemStack p_149642_5_) { + if (!p_149642_1_.isClient && p_149642_1_.getGameRules().getGameRuleBooleanValue("doTileDrops")) { + float var6 = 0.7F; + double var7 = (double)(p_149642_1_.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; + double var9 = (double)(p_149642_1_.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; + double var11 = (double)(p_149642_1_.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; + EntityItem var13 = new EntityItem(p_149642_1_, (double)p_149642_2_ + var7, (double)p_149642_3_ + var9, (double)p_149642_4_ + var11, p_149642_5_); + var13.delayBeforeCanPickup = 10; + p_149642_1_.spawnEntityInWorld(var13); + } + } + + protected void dropXpOnBlockBreak(World p_149657_1_, int p_149657_2_, int p_149657_3_, int p_149657_4_, int p_149657_5_) { + if (!p_149657_1_.isClient) { + while (p_149657_5_ > 0) { + int var6 = EntityXPOrb.getXPSplit(p_149657_5_); + p_149657_5_ -= var6; + p_149657_1_.spawnEntityInWorld(new EntityXPOrb(p_149657_1_, (double)p_149657_2_ + 0.5D, (double)p_149657_3_ + 0.5D, (double)p_149657_4_ + 0.5D, var6)); + } + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return 0; + } + + /** + * Returns how much this block can resist explosions from the passed in entity. + */ + public float getExplosionResistance(Entity p_149638_1_) { + return this.blockResistance / 5.0F; + } + + public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) { + this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_); + p_149731_5_ = p_149731_5_.addVector(-p_149731_2_, -p_149731_3_, -p_149731_4_); + p_149731_6_ = p_149731_6_.addVector(-p_149731_2_, -p_149731_3_, -p_149731_4_); + Vec3 var7 = p_149731_5_.getIntermediateWithXValue(p_149731_6_, this.field_149759_B); + Vec3 var8 = p_149731_5_.getIntermediateWithXValue(p_149731_6_, this.field_149755_E); + Vec3 var9 = p_149731_5_.getIntermediateWithYValue(p_149731_6_, this.field_149760_C); + Vec3 var10 = p_149731_5_.getIntermediateWithYValue(p_149731_6_, this.field_149756_F); + Vec3 var11 = p_149731_5_.getIntermediateWithZValue(p_149731_6_, this.field_149754_D); + Vec3 var12 = p_149731_5_.getIntermediateWithZValue(p_149731_6_, this.field_149757_G); + + if (!this.isVecInsideYZBounds(var7)) { + var7 = null; + } + + if (!this.isVecInsideYZBounds(var8)) { + var8 = null; + } + + if (!this.isVecInsideXZBounds(var9)) { + var9 = null; + } + + if (!this.isVecInsideXZBounds(var10)) { + var10 = null; + } + + if (!this.isVecInsideXYBounds(var11)) { + var11 = null; + } + + if (!this.isVecInsideXYBounds(var12)) { + var12 = null; + } + + Vec3 var13 = null; + + if (var7 != null && (var13 == null || p_149731_5_.squareDistanceTo(var7) < p_149731_5_.squareDistanceTo(var13))) { + var13 = var7; + } + + if (var8 != null && (var13 == null || p_149731_5_.squareDistanceTo(var8) < p_149731_5_.squareDistanceTo(var13))) { + var13 = var8; + } + + if (var9 != null && (var13 == null || p_149731_5_.squareDistanceTo(var9) < p_149731_5_.squareDistanceTo(var13))) { + var13 = var9; + } + + if (var10 != null && (var13 == null || p_149731_5_.squareDistanceTo(var10) < p_149731_5_.squareDistanceTo(var13))) { + var13 = var10; + } + + if (var11 != null && (var13 == null || p_149731_5_.squareDistanceTo(var11) < p_149731_5_.squareDistanceTo(var13))) { + var13 = var11; + } + + if (var12 != null && (var13 == null || p_149731_5_.squareDistanceTo(var12) < p_149731_5_.squareDistanceTo(var13))) { + var13 = var12; + } + + if (var13 == null) { + return null; + } else { + byte var14 = -1; + + if (var13 == var7) { + var14 = 4; + } + + if (var13 == var8) { + var14 = 5; + } + + if (var13 == var9) { + var14 = 0; + } + + if (var13 == var10) { + var14 = 1; + } + + if (var13 == var11) { + var14 = 2; + } + + if (var13 == var12) { + var14 = 3; + } + + return new MovingObjectPosition(p_149731_2_, p_149731_3_, p_149731_4_, var14, var13.addVector(p_149731_2_, p_149731_3_, p_149731_4_)); + } + } + + /** + * Checks if a vector is within the Y and Z bounds of the block. + */ + private boolean isVecInsideYZBounds(Vec3 p_149654_1_) { + return p_149654_1_ != null && p_149654_1_.yCoord >= this.field_149760_C && p_149654_1_.yCoord <= this.field_149756_F && p_149654_1_.zCoord >= this.field_149754_D && p_149654_1_.zCoord <= this.field_149757_G; + } + + /** + * Checks if a vector is within the X and Z bounds of the block. + */ + private boolean isVecInsideXZBounds(Vec3 p_149687_1_) { + return p_149687_1_ != null && p_149687_1_.xCoord >= this.field_149759_B && p_149687_1_.xCoord <= this.field_149755_E && p_149687_1_.zCoord >= this.field_149754_D && p_149687_1_.zCoord <= this.field_149757_G; + } + + /** + * Checks if a vector is within the X and Y bounds of the block. + */ + private boolean isVecInsideXYBounds(Vec3 p_149661_1_) { + return p_149661_1_ != null && p_149661_1_.xCoord >= this.field_149759_B && p_149661_1_.xCoord <= this.field_149755_E && p_149661_1_.yCoord >= this.field_149760_C && p_149661_1_.yCoord <= this.field_149756_F; + } + + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) {} + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return CheatBreaker.getInstance().getModuleManager().staffModuleXray.shouldRender(Block.getIdFromBlock(this), true) ? 0 : 1; + } + + public boolean canReplace(World p_149705_1_, int p_149705_2_, int p_149705_3_, int p_149705_4_, int p_149705_5_, ItemStack p_149705_6_) { + return this.canPlaceBlockOnSide(p_149705_1_, p_149705_2_, p_149705_3_, p_149705_4_, p_149705_5_); + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + return this.canPlaceBlockAt(p_149707_1_, p_149707_2_, p_149707_3_, p_149707_4_); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).blockMaterial.isReplaceable(); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + return false; + } + + public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity p_149724_5_) {} + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + return p_149660_9_; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) {} + + public void velocityToAddToEntity(World p_149640_1_, int p_149640_2_, int p_149640_3_, int p_149640_4_, Entity p_149640_5_, Vec3 p_149640_6_) {} + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) {} + + /** + * returns the block bounderies minX value + */ + public final double getBlockBoundsMinX() { + return this.field_149759_B; + } + + /** + * returns the block bounderies maxX value + */ + public final double getBlockBoundsMaxX() { + return this.field_149755_E; + } + + /** + * returns the block bounderies minY value + */ + public final double getBlockBoundsMinY() { + return this.field_149760_C; + } + + /** + * returns the block bounderies maxY value + */ + public final double getBlockBoundsMaxY() { + return this.field_149756_F; + } + + /** + * returns the block bounderies minZ value + */ + public final double getBlockBoundsMinZ() { + return this.field_149754_D; + } + + /** + * returns the block bounderies maxZ value + */ + public final double getBlockBoundsMaxZ() { + return this.field_149757_G; + } + + public int getBlockColor() { + return 16777215; + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + return 16777215; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + return 16777215; + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return 0; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return false; + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) {} + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + return 0; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() {} + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + p_149636_2_.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1); + p_149636_2_.addExhaustion(0.025F); + + if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) { + ItemStack var8 = this.createStackedBlock(p_149636_6_); + + if (var8 != null) { + this.dropBlockAsItem_do(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, var8); + } + } else { + int var7 = EnchantmentHelper.getFortuneModifier(p_149636_2_); + this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, var7); + } + } + + protected boolean canSilkHarvest() { + return this.renderAsNormalBlock() && !this.isBlockContainer; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + int var2 = 0; + Item var3 = Item.getItemFromBlock(this); + + if (var3 != null && var3.getHasSubtypes()) { + var2 = p_149644_1_; + } + + return new ItemStack(var3, 1, var2); + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int p_149679_1_, Random p_149679_2_) { + return this.quantityDropped(p_149679_2_); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return true; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {} + + /** + * Called after a block is placed + */ + public void onPostBlockPlaced(World p_149714_1_, int p_149714_2_, int p_149714_3_, int p_149714_4_, int p_149714_5_) {} + + /** + * Sets the mod-specific block name + */ + public Block setBlockName(String p_149663_1_) { + this.unlocalizedNameBlock = p_149663_1_; + return this; + } + + /** + * Gets the localized name of this block. Used for the statistics page. + */ + public String getLocalizedName() { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); + } + + /** + * Returns the unlocalized name of the block with "tile." appended to the front. + */ + public String getUnlocalizedName() { + return "tile." + this.unlocalizedNameBlock; + } + + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + return false; + } + + /** + * Return the state of blocks statistics flags - if the block is counted for mined and placed. + */ + public boolean getEnableStats() { + return this.enableStats; + } + + protected Block disableStats() { + this.enableStats = false; + return this; + } + + public int getMobilityFlag() { + return this.blockMaterial.getMaterialMobility(); + } + + /** + * Returns the default ambient occlusion value based on block opacity + */ + public float getAmbientOcclusionLightValue() { + return this.isBlockNormalCube() ? 0.2F : 1.0F; + } + + /** + * Block's chance to react to an entity falling on it. + */ + public void onFallenUpon(World p_149746_1_, int p_149746_2_, int p_149746_3_, int p_149746_4_, Entity p_149746_5_, float p_149746_6_) {} + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemFromBlock(this); + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + return this.damageDropped(p_149643_1_.getBlockMetadata(p_149643_2_, p_149643_3_, p_149643_4_)); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + } + + /** + * Returns the CreativeTab to display the given block on. + */ + public CreativeTabs getCreativeTabToDisplayOn() { + return this.displayOnCreativeTab; + } + + public Block setCreativeTab(CreativeTabs p_149647_1_) { + this.displayOnCreativeTab = p_149647_1_; + return this; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) {} + + public void onBlockPreDestroy(World p_149725_1_, int p_149725_2_, int p_149725_3_, int p_149725_4_, int p_149725_5_) {} + + /** + * currently only used by BlockCauldron to incrament meta-data during rain + */ + public void fillWithRain(World p_149639_1_, int p_149639_2_, int p_149639_3_, int p_149639_4_) {} + + /** + * Returns true only if block is flowerPot + */ + public boolean isFlowerPot() { + return false; + } + + public boolean func_149698_L() { + return true; + } + + /** + * Return whether this block can drop from an explosion. + */ + public boolean canDropFromExplosion(Explosion p_149659_1_) { + return true; + } + + public boolean func_149667_c(Block p_149667_1_) { + return this == p_149667_1_; + } + + public static boolean isEqualTo(Block p_149680_0_, Block p_149680_1_) { + return p_149680_0_ != null && p_149680_1_ != null && (p_149680_0_ == p_149680_1_ || p_149680_0_.func_149667_c(p_149680_1_)); + } + + public boolean hasComparatorInputOverride() { + return false; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + return 0; + } + + protected Block setBlockTextureName(String p_149658_1_) { + this.textureName = p_149658_1_; + return this; + } + + protected String getTextureName() { + return this.textureName == null ? "MISSING_ICON_BLOCK_" + getIdFromBlock(this) + "_" + this.unlocalizedNameBlock : this.textureName; + } + + public IIcon func_149735_b(int p_149735_1_, int p_149735_2_) { + return this.getIcon(p_149735_1_, p_149735_2_); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + if (Objects.equals(this.textureName, "trip_wire")) { + renderBlockIcon = p_149651_1_.registerIcon("trip_wire_full"); + } + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName()); + } + + /** + * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. + */ + public String getItemIconName() { + return null; + } + + public static class SoundType { + public final String field_150501_a; + public final float field_150499_b; + public final float field_150500_c; + + + public SoundType(String p_i45393_1_, float p_i45393_2_, float p_i45393_3_) { + this.field_150501_a = p_i45393_1_; + this.field_150499_b = p_i45393_2_; + this.field_150500_c = p_i45393_3_; + } + + public float func_150497_c() { + return this.field_150499_b; + } + + public float func_150494_d() { + return this.field_150500_c; + } + + public String func_150495_a() { + return "dig." + this.field_150501_a; + } + + public String func_150498_e() { + return "step." + this.field_150501_a; + } + + public String func_150496_b() { + return this.func_150495_a(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockAir.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockAir.java new file mode 100644 index 0000000..320e330 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockAir.java @@ -0,0 +1,45 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlockAir extends Block { + + + protected BlockAir() { + super(Material.air); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return -1; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param + * par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int p_149678_1_, boolean p_149678_2_) { + return false; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockAnvil.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockAnvil.java new file mode 100644 index 0000000..bd27318 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockAnvil.java @@ -0,0 +1,138 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockAnvil extends BlockFalling { + public static final String[] field_149834_a = new String[] {"intact", "slightlyDamaged", "veryDamaged"}; + private static final String[] field_149835_N = new String[] {"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"}; + public int field_149833_b; + private IIcon[] field_149836_O; + + + protected BlockAnvil() { + super(Material.anvil); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (this.field_149833_b == 3 && p_149691_1_ == 1) { + int var3 = (p_149691_2_ >> 2) % this.field_149836_O.length; + return this.field_149836_O[var3]; + } else { + return this.blockIcon; + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("anvil_base"); + this.field_149836_O = new IIcon[field_149835_N.length]; + + for (int var2 = 0; var2 < this.field_149836_O.length; ++var2) { + this.field_149836_O[var2] = p_149651_1_.registerIcon(field_149835_N[var2]); + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int var8 = p_149689_1_.getBlockMetadata(p_149689_2_, p_149689_3_, p_149689_4_) >> 2; + ++var7; + var7 %= 4; + + if (var7 == 0) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 2 | var8 << 2, 2); + } + + if (var7 == 1) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 3 | var8 << 2, 2); + } + + if (var7 == 2) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 0 | var8 << 2, 2); + } + + if (var7 == 3) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 1 | var8 << 2, 2); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + p_149727_5_.displayGUIAnvil(p_149727_2_, p_149727_3_, p_149727_4_); + return true; + } + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 35; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_ >> 2; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_) & 3; + + if (var5 != 3 && var5 != 1) { + this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); + } + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2)); + } + + protected void func_149829_a(EntityFallingBlock p_149829_1_) { + p_149829_1_.func_145806_a(true); + } + + public void func_149828_a(World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_) { + p_149828_1_.playAuxSFX(1022, p_149828_2_, p_149828_3_, p_149828_4_, 0); + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBasePressurePlate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBasePressurePlate.java new file mode 100644 index 0000000..7fe7a23 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBasePressurePlate.java @@ -0,0 +1,177 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockBasePressurePlate extends Block { + private final String field_150067_a; + + + protected BlockBasePressurePlate(String p_i45387_1_, Material p_i45387_2_) { + super(p_i45387_2_); + this.field_150067_a = p_i45387_1_; + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + this.func_150063_b(this.func_150066_d(15)); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.func_150063_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_)); + } + + protected void func_150063_b(int p_150063_1_) { + boolean var2 = this.func_150060_c(p_150063_1_) > 0; + float var3 = 0.0625F; + + if (var2) { + this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 0.03125F, 1.0F - var3); + } else { + this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 0.0625F, 1.0F - var3); + } + } + + public int func_149738_a(World p_149738_1_) { + return 20; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return true; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) || BlockFence.func_149825_a(p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_)); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + boolean var6 = !World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && !BlockFence.func_149825_a(p_149695_1_.getBlock(p_149695_2_, p_149695_3_ - 1, p_149695_4_)); + + if (var6) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + int var6 = this.func_150060_c(p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_)); + + if (var6 > 0) { + this.func_150062_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, var6); + } + } + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + if (!p_149670_1_.isClient) { + int var6 = this.func_150060_c(p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_)); + + if (var6 == 0) { + this.func_150062_a(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, var6); + } + } + } + + protected void func_150062_a(World p_150062_1_, int p_150062_2_, int p_150062_3_, int p_150062_4_, int p_150062_5_) { + int var6 = this.func_150065_e(p_150062_1_, p_150062_2_, p_150062_3_, p_150062_4_); + boolean var7 = p_150062_5_ > 0; + boolean var8 = var6 > 0; + + if (p_150062_5_ != var6) { + p_150062_1_.setBlockMetadataWithNotify(p_150062_2_, p_150062_3_, p_150062_4_, this.func_150066_d(var6), 2); + this.func_150064_a_(p_150062_1_, p_150062_2_, p_150062_3_, p_150062_4_); + p_150062_1_.markBlockRangeForRenderUpdate(p_150062_2_, p_150062_3_, p_150062_4_, p_150062_2_, p_150062_3_, p_150062_4_); + } + + if (!var8 && var7) { + p_150062_1_.playSoundEffect((double)p_150062_2_ + 0.5D, (double)p_150062_3_ + 0.1D, (double)p_150062_4_ + 0.5D, "random.click", 0.3F, 0.5F); + } else if (var8 && !var7) { + p_150062_1_.playSoundEffect((double)p_150062_2_ + 0.5D, (double)p_150062_3_ + 0.1D, (double)p_150062_4_ + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (var8) { + p_150062_1_.scheduleBlockUpdate(p_150062_2_, p_150062_3_, p_150062_4_, this, this.func_149738_a(p_150062_1_)); + } + } + + protected AxisAlignedBB func_150061_a(int p_150061_1_, int p_150061_2_, int p_150061_3_) { + float var4 = 0.125F; + return AxisAlignedBB.getBoundingBox((float)p_150061_1_ + var4, p_150061_2_, (float)p_150061_3_ + var4, (float)(p_150061_1_ + 1) - var4, (double)p_150061_2_ + 0.25D, (float)(p_150061_3_ + 1) - var4); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + if (this.func_150060_c(p_149749_6_) > 0) { + this.func_150064_a_(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_); + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + protected void func_150064_a_(World p_150064_1_, int p_150064_2_, int p_150064_3_, int p_150064_4_) { + p_150064_1_.notifyBlocksOfNeighborChange(p_150064_2_, p_150064_3_, p_150064_4_, this); + p_150064_1_.notifyBlocksOfNeighborChange(p_150064_2_, p_150064_3_ - 1, p_150064_4_, this); + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return this.func_150060_c(p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_)); + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + return p_149748_5_ == 1 ? this.func_150060_c(p_149748_1_.getBlockMetadata(p_149748_2_, p_149748_3_, p_149748_4_)) : 0; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float var1 = 0.5F; + float var2 = 0.125F; + float var3 = 0.5F; + this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3); + } + + public int getMobilityFlag() { + return 1; + } + + protected abstract int func_150065_e(World p_150065_1_, int p_150065_2_, int p_150065_3_, int p_150065_4_); + + protected abstract int func_150060_c(int p_150060_1_); + + protected abstract int func_150066_d(int p_150066_1_); + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.field_150067_a); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBeacon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBeacon.java new file mode 100644 index 0000000..e31b059 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBeacon.java @@ -0,0 +1,75 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.world.World; + +public class BlockBeacon extends BlockContainer { + + + public BlockBeacon() { + super(Material.glass); + this.setHardness(3.0F); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityBeacon(); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + TileEntityBeacon var10 = (TileEntityBeacon)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + p_149727_5_.func_146104_a(var10); + } + + return true; + } + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 34; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + super.registerBlockIcons(p_149651_1_); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + super.onBlockPlacedBy(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_, p_149689_6_); + + if (p_149689_6_.hasDisplayName()) { + ((TileEntityBeacon)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_)).func_145999_a(p_149689_6_.getDisplayName()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBed.java new file mode 100644 index 0000000..3d96cde --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBed.java @@ -0,0 +1,258 @@ +package net.minecraft.block; + +import java.util.Iterator; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class BlockBed extends BlockDirectional { + public static final int[][] field_149981_a = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}}; + private IIcon[] field_149980_b; + private IIcon[] field_149982_M; + private IIcon[] field_149983_N; + + + public BlockBed() { + super(Material.cloth); + this.func_149978_e(); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + int var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + + if (!func_149975_b(var10)) { + int var11 = func_149895_l(var10); + p_149727_2_ += field_149981_a[var11][0]; + p_149727_4_ += field_149981_a[var11][1]; + + if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) != this) { + return true; + } + + var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + } + + if (p_149727_1_.provider.canRespawnHere() && p_149727_1_.getBiomeGenForCoords(p_149727_2_, p_149727_4_) != BiomeGenBase.hell) { + if (func_149976_c(var10)) { + EntityPlayer var19 = null; + Iterator var12 = p_149727_1_.playerEntities.iterator(); + + while (var12.hasNext()) { + EntityPlayer var21 = (EntityPlayer)var12.next(); + + if (var21.isPlayerSleeping()) { + ChunkCoordinates var14 = var21.playerLocation; + + if (var14.posX == p_149727_2_ && var14.posY == p_149727_3_ && var14.posZ == p_149727_4_) { + var19 = var21; + } + } + } + + if (var19 != null) { + p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied")); + return true; + } + + func_149979_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, false); + } + + EntityPlayer.EnumStatus var20 = p_149727_5_.sleepInBedAt(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var20 == EntityPlayer.EnumStatus.OK) { + func_149979_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, true); + return true; + } else { + if (var20 == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) { + p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep")); + } else if (var20 == EntityPlayer.EnumStatus.NOT_SAFE) { + p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe")); + } + + return true; + } + } else { + double var18 = (double)p_149727_2_ + 0.5D; + double var13 = (double)p_149727_3_ + 0.5D; + double var15 = (double)p_149727_4_ + 0.5D; + p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_); + int var17 = func_149895_l(var10); + p_149727_2_ += field_149981_a[var17][0]; + p_149727_4_ += field_149981_a[var17][1]; + + if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) == this) { + p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_); + var18 = (var18 + (double)p_149727_2_ + 0.5D) / 2.0D; + var13 = (var13 + (double)p_149727_3_ + 0.5D) / 2.0D; + var15 = (var15 + (double)p_149727_4_ + 0.5D) / 2.0D; + } + + p_149727_1_.newExplosion(null, (float)p_149727_2_ + 0.5F, (float)p_149727_3_ + 0.5F, (float)p_149727_4_ + 0.5F, 5.0F, true, true); + return true; + } + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_1_ == 0) { + return Blocks.planks.getBlockTextureFromSide(p_149691_1_); + } else { + int var3 = func_149895_l(p_149691_2_); + int var4 = Direction.bedDirection[var3][p_149691_1_]; + int var5 = func_149975_b(p_149691_2_) ? 1 : 0; + return (var5 != 1 || var4 != 2) && (var5 != 0 || var4 != 3) ? (var4 != 5 && var4 != 4 ? this.field_149983_N[var5] : this.field_149982_M[var5]) : this.field_149980_b[var5]; + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149983_N = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_top"), p_149651_1_.registerIcon(this.getTextureName() + "_head_top")}; + this.field_149980_b = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_end"), p_149651_1_.registerIcon(this.getTextureName() + "_head_end")}; + this.field_149982_M = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_feet_side"), p_149651_1_.registerIcon(this.getTextureName() + "_head_side")}; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 14; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.func_149978_e(); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + int var7 = func_149895_l(var6); + + if (func_149975_b(var6)) { + if (p_149695_1_.getBlock(p_149695_2_ - field_149981_a[var7][0], p_149695_3_, p_149695_4_ - field_149981_a[var7][1]) != this) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } else if (p_149695_1_.getBlock(p_149695_2_ + field_149981_a[var7][0], p_149695_3_, p_149695_4_ + field_149981_a[var7][1]) != this) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + + if (!p_149695_1_.isClient) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var6, 0); + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return func_149975_b(p_149650_1_) ? Item.getItemById(0) : Items.bed; + } + + private void func_149978_e() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); + } + + public static boolean func_149975_b(int p_149975_0_) { + return (p_149975_0_ & 8) != 0; + } + + public static boolean func_149976_c(int p_149976_0_) { + return (p_149976_0_ & 4) != 0; + } + + public static void func_149979_a(World p_149979_0_, int p_149979_1_, int p_149979_2_, int p_149979_3_, boolean p_149979_4_) { + int var5 = p_149979_0_.getBlockMetadata(p_149979_1_, p_149979_2_, p_149979_3_); + + if (p_149979_4_) { + var5 |= 4; + } else { + var5 &= -5; + } + + p_149979_0_.setBlockMetadataWithNotify(p_149979_1_, p_149979_2_, p_149979_3_, var5, 4); + } + + public static ChunkCoordinates func_149977_a(World p_149977_0_, int p_149977_1_, int p_149977_2_, int p_149977_3_, int p_149977_4_) { + int var5 = p_149977_0_.getBlockMetadata(p_149977_1_, p_149977_2_, p_149977_3_); + int var6 = BlockDirectional.func_149895_l(var5); + + for (int var7 = 0; var7 <= 1; ++var7) { + int var8 = p_149977_1_ - field_149981_a[var6][0] * var7 - 1; + int var9 = p_149977_3_ - field_149981_a[var6][1] * var7 - 1; + int var10 = var8 + 2; + int var11 = var9 + 2; + + for (int var12 = var8; var12 <= var10; ++var12) { + for (int var13 = var9; var13 <= var11; ++var13) { + if (World.doesBlockHaveSolidTopSurface(p_149977_0_, var12, p_149977_2_ - 1, var13) && !p_149977_0_.getBlock(var12, p_149977_2_, var13).getMaterial().isOpaque() && !p_149977_0_.getBlock(var12, p_149977_2_ + 1, var13).getMaterial().isOpaque()) { + if (p_149977_4_ <= 0) { + return new ChunkCoordinates(var12, p_149977_2_, var13); + } + + --p_149977_4_; + } + } + } + } + + return null; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + if (!func_149975_b(p_149690_5_)) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); + } + } + + public int getMobilityFlag() { + return 1; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.bed; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + if (p_149681_6_.capabilities.isCreativeMode && func_149975_b(p_149681_5_)) { + int var7 = func_149895_l(p_149681_5_); + p_149681_2_ -= field_149981_a[var7][0]; + p_149681_4_ -= field_149981_a[var7][1]; + + if (p_149681_1_.getBlock(p_149681_2_, p_149681_3_, p_149681_4_) == this) { + p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_, p_149681_4_); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBookshelf.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBookshelf.java new file mode 100644 index 0000000..8f4f8b5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBookshelf.java @@ -0,0 +1,36 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; + +public class BlockBookshelf extends Block { + + + public BlockBookshelf() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ != 1 && p_149691_1_ != 0 ? super.getIcon(p_149691_1_, p_149691_2_) : Blocks.planks.getBlockTextureFromSide(p_149691_1_); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 3; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.book; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBreakable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBreakable.java new file mode 100644 index 0000000..62d6e87 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBreakable.java @@ -0,0 +1,43 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.util.Facing; +import net.minecraft.world.IBlockAccess; + +public class BlockBreakable extends Block { + private final boolean field_149996_a; + private final String field_149995_b; + + + protected BlockBreakable(String p_i45411_1_, Material p_i45411_2_, boolean p_i45411_3_) { + super(p_i45411_2_); + this.field_149996_a = p_i45411_3_; + this.field_149995_b = p_i45411_1_; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + Block var6 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_); + + if (this == Blocks.glass || this == Blocks.stained_glass) { + if (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) != p_149646_1_.getBlockMetadata(p_149646_2_ - Facing.offsetsXForSide[p_149646_5_], p_149646_3_ - Facing.offsetsYForSide[p_149646_5_], p_149646_4_ - Facing.offsetsZForSide[p_149646_5_])) { + return true; + } + + if (var6 == this) { + return false; + } + } + + return (this.field_149996_a || var6 != this) && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.field_149995_b); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBrewingStand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBrewingStand.java new file mode 100644 index 0000000..1f994d4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBrewingStand.java @@ -0,0 +1,166 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockBrewingStand extends BlockContainer { + private final Random field_149961_a = new Random(); + private IIcon field_149960_b; + + + public BlockBrewingStand() { + super(Material.iron); + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 25; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityBrewingStand(); + } + + public boolean renderAsNormalBlock() { + return false; + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBoundsForItemRender(); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + TileEntityBrewingStand var10 = (TileEntityBrewingStand)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + p_149727_5_.func_146098_a(var10); + } + + return true; + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + if (p_149689_6_.hasDisplayName()) { + ((TileEntityBrewingStand)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_)).func_145937_a(p_149689_6_.getDisplayName()); + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + double var6 = (float)p_149734_2_ + 0.4F + p_149734_5_.nextFloat() * 0.2F; + double var8 = (float)p_149734_3_ + 0.7F + p_149734_5_.nextFloat() * 0.3F; + double var10 = (float)p_149734_4_ + 0.4F + p_149734_5_.nextFloat() * 0.2F; + p_149734_1_.spawnParticle("smoke", var6, var8, var10, 0.0D, 0.0D, 0.0D); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + TileEntity var7 = p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var7 instanceof TileEntityBrewingStand) { + TileEntityBrewingStand var8 = (TileEntityBrewingStand)var7; + + for (int var9 = 0; var9 < var8.getSizeInventory(); ++var9) { + ItemStack var10 = var8.getStackInSlot(var9); + + if (var10 != null) { + float var11 = this.field_149961_a.nextFloat() * 0.8F + 0.1F; + float var12 = this.field_149961_a.nextFloat() * 0.8F + 0.1F; + float var13 = this.field_149961_a.nextFloat() * 0.8F + 0.1F; + + while (var10.stackSize > 0) { + int var14 = this.field_149961_a.nextInt(21) + 10; + + if (var14 > var10.stackSize) { + var14 = var10.stackSize; + } + + var10.stackSize -= var14; + EntityItem var15 = new EntityItem(p_149749_1_, (float)p_149749_2_ + var11, (float)p_149749_3_ + var12, (float)p_149749_4_ + var13, new ItemStack(var10.getItem(), var14, var10.getItemDamage())); + float var16 = 0.05F; + var15.motionX = (float)this.field_149961_a.nextGaussian() * var16; + var15.motionY = (float)this.field_149961_a.nextGaussian() * var16 + 0.2F; + var15.motionZ = (float)this.field_149961_a.nextGaussian() * var16; + p_149749_1_.spawnEntityInWorld(var15); + } + } + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.brewing_stand; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.brewing_stand; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + return Container.calcRedstoneFromInventory((IInventory)p_149736_1_.getTileEntity(p_149736_2_, p_149736_3_, p_149736_4_)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + super.registerBlockIcons(p_149651_1_); + this.field_149960_b = p_149651_1_.registerIcon(this.getTextureName() + "_base"); + } + + public IIcon func_149959_e() { + return this.field_149960_b; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBush.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBush.java new file mode 100644 index 0000000..4be994f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockBush.java @@ -0,0 +1,81 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlockBush extends Block { + + + protected BlockBush(Material p_i45395_1_) { + super(p_i45395_1_); + this.setTickRandomly(true); + float var2 = 0.2F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var2 * 3.0F, 0.5F + var2); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + protected BlockBush() { + this(Material.plants); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_)); + } + + protected boolean func_149854_a(Block p_149854_1_) { + return p_149854_1_ == Blocks.grass || p_149854_1_ == Blocks.dirt || p_149854_1_ == Blocks.farmland; + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + this.func_149855_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + this.func_149855_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + + protected void func_149855_e(World p_149855_1_, int p_149855_2_, int p_149855_3_, int p_149855_4_) { + if (!this.canBlockStay(p_149855_1_, p_149855_2_, p_149855_3_, p_149855_4_)) { + this.dropBlockAsItem(p_149855_1_, p_149855_2_, p_149855_3_, p_149855_4_, p_149855_1_.getBlockMetadata(p_149855_2_, p_149855_3_, p_149855_4_), 0); + p_149855_1_.setBlock(p_149855_2_, p_149855_3_, p_149855_4_, getBlockById(0), 0, 2); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return this.func_149854_a(p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButton.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButton.java new file mode 100644 index 0000000..20bc127 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButton.java @@ -0,0 +1,284 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockButton extends Block { + private final boolean field_150047_a; + + + protected BlockButton(boolean p_i45396_1_) { + super(Material.circuits); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.field_150047_a = p_i45396_1_; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public int func_149738_a(World p_149738_1_) { + return this.field_150047_a ? 30 : 20; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + return p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() || (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() || (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() || p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() || p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + int var10 = p_149660_1_.getBlockMetadata(p_149660_2_, p_149660_3_, p_149660_4_); + int var11 = var10 & 8; + var10 &= 7; + + if (p_149660_5_ == 2 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) { + var10 = 4; + } else if (p_149660_5_ == 3 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) { + var10 = 3; + } else if (p_149660_5_ == 4 && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) { + var10 = 2; + } else if (p_149660_5_ == 5 && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) { + var10 = 1; + } else { + var10 = this.func_150045_e(p_149660_1_, p_149660_2_, p_149660_3_, p_149660_4_); + } + + return var10 + var11; + } + + private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_) { + return p_150045_1_.getBlock(p_150045_2_ - 1, p_150045_3_, p_150045_4_).isNormalCube() ? 1 : (p_150045_1_.getBlock(p_150045_2_ + 1, p_150045_3_, p_150045_4_).isNormalCube() ? 2 : (p_150045_1_.getBlock(p_150045_2_, p_150045_3_, p_150045_4_ - 1).isNormalCube() ? 3 : (p_150045_1_.getBlock(p_150045_2_, p_150045_3_, p_150045_4_ + 1).isNormalCube() ? 4 : 1))); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (this.func_150044_m(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_) & 7; + boolean var7 = !p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && var6 == 1; + + if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && var6 == 2) { + var7 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && var6 == 3) { + var7 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && var6 == 4) { + var7 = true; + } + + if (var7) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + } + + private boolean func_150044_m(World p_150044_1_, int p_150044_2_, int p_150044_3_, int p_150044_4_) { + if (!this.canPlaceBlockAt(p_150044_1_, p_150044_2_, p_150044_3_, p_150044_4_)) { + this.dropBlockAsItem(p_150044_1_, p_150044_2_, p_150044_3_, p_150044_4_, p_150044_1_.getBlockMetadata(p_150044_2_, p_150044_3_, p_150044_4_), 0); + p_150044_1_.setBlockToAir(p_150044_2_, p_150044_3_, p_150044_4_); + return false; + } else { + return true; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + this.func_150043_b(var5); + } + + private void func_150043_b(int p_150043_1_) { + int var2 = p_150043_1_ & 7; + boolean var3 = (p_150043_1_ & 8) > 0; + float var4 = 0.375F; + float var5 = 0.625F; + float var6 = 0.1875F; + float var7 = 0.125F; + + if (var3) { + var7 = 0.0625F; + } + + if (var2 == 1) { + this.setBlockBounds(0.0F, var4, 0.5F - var6, var7, var5, 0.5F + var6); + } else if (var2 == 2) { + this.setBlockBounds(1.0F - var7, var4, 0.5F - var6, 1.0F, var5, 0.5F + var6); + } else if (var2 == 3) { + this.setBlockBounds(0.5F - var6, var4, 0.0F, 0.5F + var6, var5, var7); + } else if (var2 == 4) { + this.setBlockBounds(0.5F - var6, var4, 1.0F - var7, 0.5F + var6, var5, 1.0F); + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) {} + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + int var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + int var11 = var10 & 7; + int var12 = 8 - (var10 & 8); + + if (var12 == 0) { + return true; + } else { + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var11 + var12, 3); + p_149727_1_.markBlockRangeForRenderUpdate(p_149727_2_, p_149727_3_, p_149727_4_, p_149727_2_, p_149727_3_, p_149727_4_); + p_149727_1_.playSoundEffect((double)p_149727_2_ + 0.5D, (double)p_149727_3_ + 0.5D, (double)p_149727_4_ + 0.5D, "random.click", 0.3F, 0.6F); + this.func_150042_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, var11); + p_149727_1_.scheduleBlockUpdate(p_149727_2_, p_149727_3_, p_149727_4_, this, this.func_149738_a(p_149727_1_)); + return true; + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + if ((p_149749_6_ & 8) > 0) { + int var7 = p_149749_6_ & 7; + this.func_150042_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, var7); + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return (p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_) & 8) > 0 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + int var6 = p_149748_1_.getBlockMetadata(p_149748_2_, p_149748_3_, p_149748_4_); + + if ((var6 & 8) == 0) { + return 0; + } else { + int var7 = var6 & 7; + return var7 == 5 && p_149748_5_ == 1 ? 15 : (var7 == 4 && p_149748_5_ == 2 ? 15 : (var7 == 3 && p_149748_5_ == 3 ? 15 : (var7 == 2 && p_149748_5_ == 4 ? 15 : (var7 == 1 && p_149748_5_ == 5 ? 15 : 0)))); + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if ((var6 & 8) != 0) { + if (this.field_150047_a) { + this.func_150046_n(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } else { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var6 & 7, 3); + int var7 = var6 & 7; + this.func_150042_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, var7); + p_149674_1_.playSoundEffect((double)p_149674_2_ + 0.5D, (double)p_149674_3_ + 0.5D, (double)p_149674_4_ + 0.5D, "random.click", 0.3F, 0.5F); + p_149674_1_.markBlockRangeForRenderUpdate(p_149674_2_, p_149674_3_, p_149674_4_, p_149674_2_, p_149674_3_, p_149674_4_); + } + } + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float var1 = 0.1875F; + float var2 = 0.125F; + float var3 = 0.125F; + this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3); + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + if (!p_149670_1_.isClient) { + if (this.field_150047_a) { + if ((p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_) & 8) == 0) { + this.func_150046_n(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_); + } + } + } + } + + private void func_150046_n(World p_150046_1_, int p_150046_2_, int p_150046_3_, int p_150046_4_) { + int var5 = p_150046_1_.getBlockMetadata(p_150046_2_, p_150046_3_, p_150046_4_); + int var6 = var5 & 7; + boolean var7 = (var5 & 8) != 0; + this.func_150043_b(var5); + List var9 = p_150046_1_.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getBoundingBox((double)p_150046_2_ + this.field_149759_B, (double)p_150046_3_ + this.field_149760_C, (double)p_150046_4_ + this.field_149754_D, (double)p_150046_2_ + this.field_149755_E, (double)p_150046_3_ + this.field_149756_F, (double)p_150046_4_ + this.field_149757_G)); + boolean var8 = !var9.isEmpty(); + + if (var8 && !var7) { + p_150046_1_.setBlockMetadataWithNotify(p_150046_2_, p_150046_3_, p_150046_4_, var6 | 8, 3); + this.func_150042_a(p_150046_1_, p_150046_2_, p_150046_3_, p_150046_4_, var6); + p_150046_1_.markBlockRangeForRenderUpdate(p_150046_2_, p_150046_3_, p_150046_4_, p_150046_2_, p_150046_3_, p_150046_4_); + p_150046_1_.playSoundEffect((double)p_150046_2_ + 0.5D, (double)p_150046_3_ + 0.5D, (double)p_150046_4_ + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (!var8 && var7) { + p_150046_1_.setBlockMetadataWithNotify(p_150046_2_, p_150046_3_, p_150046_4_, var6, 3); + this.func_150042_a(p_150046_1_, p_150046_2_, p_150046_3_, p_150046_4_, var6); + p_150046_1_.markBlockRangeForRenderUpdate(p_150046_2_, p_150046_3_, p_150046_4_, p_150046_2_, p_150046_3_, p_150046_4_); + p_150046_1_.playSoundEffect((double)p_150046_2_ + 0.5D, (double)p_150046_3_ + 0.5D, (double)p_150046_4_ + 0.5D, "random.click", 0.3F, 0.5F); + } + + if (var8) { + p_150046_1_.scheduleBlockUpdate(p_150046_2_, p_150046_3_, p_150046_4_, this, this.func_149738_a(p_150046_1_)); + } + } + + private void func_150042_a(World p_150042_1_, int p_150042_2_, int p_150042_3_, int p_150042_4_, int p_150042_5_) { + p_150042_1_.notifyBlocksOfNeighborChange(p_150042_2_, p_150042_3_, p_150042_4_, this); + + if (p_150042_5_ == 1) { + p_150042_1_.notifyBlocksOfNeighborChange(p_150042_2_ - 1, p_150042_3_, p_150042_4_, this); + } else if (p_150042_5_ == 2) { + p_150042_1_.notifyBlocksOfNeighborChange(p_150042_2_ + 1, p_150042_3_, p_150042_4_, this); + } else if (p_150042_5_ == 3) { + p_150042_1_.notifyBlocksOfNeighborChange(p_150042_2_, p_150042_3_, p_150042_4_ - 1, this); + } else if (p_150042_5_ == 4) { + p_150042_1_.notifyBlocksOfNeighborChange(p_150042_2_, p_150042_3_, p_150042_4_ + 1, this); + } else { + p_150042_1_.notifyBlocksOfNeighborChange(p_150042_2_, p_150042_3_ - 1, p_150042_4_, this); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButtonStone.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButtonStone.java new file mode 100644 index 0000000..c11091f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButtonStone.java @@ -0,0 +1,19 @@ +package net.minecraft.block; + +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + +public class BlockButtonStone extends BlockButton { + + + protected BlockButtonStone() { + super(false); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return Blocks.stone.getBlockTextureFromSide(1); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButtonWood.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButtonWood.java new file mode 100644 index 0000000..0e1189e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockButtonWood.java @@ -0,0 +1,19 @@ +package net.minecraft.block; + +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + +public class BlockButtonWood extends BlockButton { + + + protected BlockButtonWood() { + super(true); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return Blocks.planks.getBlockTextureFromSide(1); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCactus.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCactus.java new file mode 100644 index 0000000..df812e8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCactus.java @@ -0,0 +1,125 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockCactus extends Block { + private IIcon field_150041_a; + private IIcon field_150040_b; + + + protected BlockCactus() { + super(Material.field_151570_A); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (p_149674_1_.isAirBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_)) { + int var6; + + for (var6 = 1; p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - var6, p_149674_4_) == this; ++var6) { + } + + if (var6 < 3) { + int var7 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var7 == 15) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_, this); + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, 0, 4); + this.onNeighborBlockChange(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, this); + } else { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var7 + 1, 4); + } + } + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + float var5 = 0.0625F; + return AxisAlignedBB.getBoundingBox((float)p_149668_2_ + var5, p_149668_3_, (float)p_149668_4_ + var5, (float)(p_149668_2_ + 1) - var5, (float)(p_149668_3_ + 1) - var5, (float)(p_149668_4_ + 1) - var5); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + float var5 = 0.0625F; + return AxisAlignedBB.getBoundingBox((float)p_149633_2_ + var5, p_149633_3_, (float)p_149633_4_ + var5, (float)(p_149633_2_ + 1) - var5, p_149633_3_ + 1, (float)(p_149633_4_ + 1) - var5); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_150041_a : (p_149691_1_ == 0 ? this.field_150040_b : this.blockIcon); + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 13; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!this.canBlockStay(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + p_149695_1_.func_147480_a(p_149695_2_, p_149695_3_, p_149695_4_, true); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + if (p_149718_1_.getBlock(p_149718_2_ - 1, p_149718_3_, p_149718_4_).getMaterial().isSolid()) { + return false; + } else if (p_149718_1_.getBlock(p_149718_2_ + 1, p_149718_3_, p_149718_4_).getMaterial().isSolid()) { + return false; + } else if (p_149718_1_.getBlock(p_149718_2_, p_149718_3_, p_149718_4_ - 1).getMaterial().isSolid()) { + return false; + } else if (p_149718_1_.getBlock(p_149718_2_, p_149718_3_, p_149718_4_ + 1).getMaterial().isSolid()) { + return false; + } else { + Block var5 = p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); + return var5 == Blocks.cactus || var5 == Blocks.sand; + } + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + p_149670_5_.attackEntityFrom(DamageSource.cactus, 1.0F); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_150041_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150040_b = p_149651_1_.registerIcon(this.getTextureName() + "_bottom"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCake.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCake.java new file mode 100644 index 0000000..8fa8c84 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCake.java @@ -0,0 +1,149 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCake extends Block { + private IIcon field_150038_a; + private IIcon field_150037_b; + private IIcon field_150039_M; + + + protected BlockCake() { + super(Material.field_151568_F); + this.setTickRandomly(true); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + float var6 = 0.0625F; + float var7 = (float)(1 + var5 * 2) / 16.0F; + float var8 = 0.5F; + this.setBlockBounds(var7, 0.0F, var6, 1.0F - var6, var8, 1.0F - var6); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float var1 = 0.0625F; + float var2 = 0.5F; + this.setBlockBounds(var1, 0.0F, var1, 1.0F - var1, var2, 1.0F - var1); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + int var5 = p_149668_1_.getBlockMetadata(p_149668_2_, p_149668_3_, p_149668_4_); + float var6 = 0.0625F; + float var7 = (float)(1 + var5 * 2) / 16.0F; + float var8 = 0.5F; + return AxisAlignedBB.getBoundingBox((float)p_149668_2_ + var7, p_149668_3_, (float)p_149668_4_ + var6, (float)(p_149668_2_ + 1) - var6, (float)p_149668_3_ + var8 - var6, (float)(p_149668_4_ + 1) - var6); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + int var5 = p_149633_1_.getBlockMetadata(p_149633_2_, p_149633_3_, p_149633_4_); + float var6 = 0.0625F; + float var7 = (float)(1 + var5 * 2) / 16.0F; + float var8 = 0.5F; + return AxisAlignedBB.getBoundingBox((float)p_149633_2_ + var7, p_149633_3_, (float)p_149633_4_ + var6, (float)(p_149633_2_ + 1) - var6, (float)p_149633_3_ + var8, (float)(p_149633_4_ + 1) - var6); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_150038_a : (p_149691_1_ == 0 ? this.field_150037_b : (p_149691_2_ > 0 && p_149691_1_ == 4 ? this.field_150039_M : this.blockIcon)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_150039_M = p_149651_1_.registerIcon(this.getTextureName() + "_inner"); + this.field_150038_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150037_b = p_149651_1_.registerIcon(this.getTextureName() + "_bottom"); + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + this.func_150036_b(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_); + return true; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) { + this.func_150036_b(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_); + } + + private void func_150036_b(World p_150036_1_, int p_150036_2_, int p_150036_3_, int p_150036_4_, EntityPlayer p_150036_5_) { + if (p_150036_5_.canEat(false)) { + p_150036_5_.getFoodStats().addStats(2, 0.1F); + int var6 = p_150036_1_.getBlockMetadata(p_150036_2_, p_150036_3_, p_150036_4_) + 1; + + if (var6 >= 6) { + p_150036_1_.setBlockToAir(p_150036_2_, p_150036_3_, p_150036_4_); + } else { + p_150036_1_.setBlockMetadataWithNotify(p_150036_2_, p_150036_3_, p_150036_4_, var6, 2); + } + } + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!this.canBlockStay(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_).getMaterial().isSolid(); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.cake; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCarpet.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCarpet.java new file mode 100644 index 0000000..b0b9b30 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCarpet.java @@ -0,0 +1,111 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCarpet extends Block { + + + protected BlockCarpet() { + super(Material.carpet); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.func_150089_b(0); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return Blocks.wool.getIcon(p_149691_1_, p_149691_2_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + byte var5 = 0; + float var6 = 0.0625F; + return AxisAlignedBB.getBoundingBox((double)p_149668_2_ + this.field_149759_B, (double)p_149668_3_ + this.field_149760_C, (double)p_149668_4_ + this.field_149754_D, (double)p_149668_2_ + this.field_149755_E, (float)p_149668_3_ + (float)var5 * var6, (double)p_149668_4_ + this.field_149757_G); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.func_150089_b(0); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.func_150089_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_)); + } + + protected void func_150089_b(int p_150089_1_) { + byte var2 = 0; + float var3 = (float)(1 * (1 + var2)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var3, 1.0F); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + this.func_150090_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + private boolean func_150090_e(World p_150090_1_, int p_150090_2_, int p_150090_3_, int p_150090_4_) { + if (!this.canBlockStay(p_150090_1_, p_150090_2_, p_150090_3_, p_150090_4_)) { + this.dropBlockAsItem(p_150090_1_, p_150090_2_, p_150090_3_, p_150090_4_, p_150090_1_.getBlockMetadata(p_150090_2_, p_150090_3_, p_150090_4_), 0); + p_150090_1_.setBlockToAir(p_150090_2_, p_150090_3_, p_150090_4_); + return false; + } else { + return true; + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return !p_149718_1_.isAirBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return p_149646_5_ == 1 || super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < 16; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCarrot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCarrot.java new file mode 100644 index 0000000..413cda0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCarrot.java @@ -0,0 +1,42 @@ +package net.minecraft.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; + +public class BlockCarrot extends BlockCrops { + private IIcon[] field_149868_a; + + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ < 7) { + if (p_149691_2_ == 6) { + p_149691_2_ = 5; + } + + return this.field_149868_a[p_149691_2_ >> 1]; + } else { + return this.field_149868_a[3]; + } + } + + protected Item func_149866_i() { + return Items.carrot; + } + + protected Item func_149865_P() { + return Items.carrot; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149868_a = new IIcon[4]; + + for (int var2 = 0; var2 < this.field_149868_a.length; ++var2) { + this.field_149868_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + var2); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCauldron.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCauldron.java new file mode 100644 index 0000000..69181cb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCauldron.java @@ -0,0 +1,201 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockCauldron extends Block { + private IIcon field_150029_a; + private IIcon field_150028_b; + private IIcon field_150030_M; + + + public BlockCauldron() { + super(Material.iron); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_150028_b : (p_149691_1_ == 0 ? this.field_150030_M : this.blockIcon); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150029_a = p_149651_1_.registerIcon(this.getTextureName() + "_" + "inner"); + this.field_150028_b = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150030_M = p_149651_1_.registerIcon(this.getTextureName() + "_" + "bottom"); + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + } + + public static IIcon func_150026_e(String p_150026_0_) { + return p_150026_0_.equals("inner") ? Blocks.cauldron.field_150029_a : (p_150026_0_.equals("bottom") ? Blocks.cauldron.field_150030_M : null); + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + float var8 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, var8, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var8); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(1.0F - var8, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.0F, 1.0F - var8, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBoundsForItemRender(); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 24; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + int var6 = func_150027_b(p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_)); + float var7 = (float)p_149670_3_ + (6.0F + (float)(3 * var6)) / 16.0F; + + if (!p_149670_1_.isClient && p_149670_5_.isBurning() && var6 > 0 && p_149670_5_.boundingBox.minY <= (double)var7) { + p_149670_5_.extinguish(); + this.func_150024_a(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, var6 - 1); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + ItemStack var10 = p_149727_5_.inventory.getCurrentItem(); + + if (var10 == null) { + return true; + } else { + int var11 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + int var12 = func_150027_b(var11); + + if (var10.getItem() == Items.water_bucket) { + if (var12 < 3) { + if (!p_149727_5_.capabilities.isCreativeMode) { + p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, new ItemStack(Items.bucket)); + } + + this.func_150024_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, 3); + } + + return true; + } else { + if (var10.getItem() == Items.glass_bottle) { + if (var12 > 0) { + if (!p_149727_5_.capabilities.isCreativeMode) { + ItemStack var13 = new ItemStack(Items.potionitem, 1, 0); + + if (!p_149727_5_.inventory.addItemStackToInventory(var13)) { + p_149727_1_.spawnEntityInWorld(new EntityItem(p_149727_1_, (double)p_149727_2_ + 0.5D, (double)p_149727_3_ + 1.5D, (double)p_149727_4_ + 0.5D, var13)); + } else if (p_149727_5_ instanceof EntityPlayerMP) { + ((EntityPlayerMP)p_149727_5_).sendContainerToPlayer(p_149727_5_.inventoryContainer); + } + + --var10.stackSize; + + if (var10.stackSize <= 0) { + p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, null); + } + } + + this.func_150024_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, var12 - 1); + } + } else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) { + ItemArmor var14 = (ItemArmor)var10.getItem(); + var14.removeColor(var10); + this.func_150024_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, var12 - 1); + return true; + } + + return false; + } + } + } + } + + public void func_150024_a(World p_150024_1_, int p_150024_2_, int p_150024_3_, int p_150024_4_, int p_150024_5_) { + p_150024_1_.setBlockMetadataWithNotify(p_150024_2_, p_150024_3_, p_150024_4_, MathHelper.clamp_int(p_150024_5_, 0, 3), 2); + p_150024_1_.func_147453_f(p_150024_2_, p_150024_3_, p_150024_4_, this); + } + + /** + * currently only used by BlockCauldron to incrament meta-data during rain + */ + public void fillWithRain(World p_149639_1_, int p_149639_2_, int p_149639_3_, int p_149639_4_) { + if (p_149639_1_.rand.nextInt(20) == 1) { + int var5 = p_149639_1_.getBlockMetadata(p_149639_2_, p_149639_3_, p_149639_4_); + + if (var5 < 3) { + p_149639_1_.setBlockMetadataWithNotify(p_149639_2_, p_149639_3_, p_149639_4_, var5 + 1, 2); + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.cauldron; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.cauldron; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + int var6 = p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_); + return func_150027_b(var6); + } + + public static int func_150027_b(int p_150027_0_) { + return p_150027_0_; + } + + public static float func_150025_c(int p_150025_0_) { + int var1 = MathHelper.clamp_int(p_150025_0_, 0, 3); + return (float)(6 + 3 * var1) / 16.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockChest.java new file mode 100644 index 0000000..2c9144a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockChest.java @@ -0,0 +1,423 @@ +package net.minecraft.block; + +import java.util.Iterator; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryLargeChest; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockChest extends BlockContainer { + private final Random field_149955_b = new Random(); + public final int field_149956_a; + + + protected BlockChest(int p_i45397_1_) { + super(Material.wood); + this.field_149956_a = p_i45397_1_; + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 22; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ - 1) == this) { + this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F); + } else if (p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ + 1) == this) { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F); + } else if (p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_) == this) { + this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } else if (p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_) == this) { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F); + } else { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + this.func_149954_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + Block var5 = p_149726_1_.getBlock(p_149726_2_, p_149726_3_, p_149726_4_ - 1); + Block var6 = p_149726_1_.getBlock(p_149726_2_, p_149726_3_, p_149726_4_ + 1); + Block var7 = p_149726_1_.getBlock(p_149726_2_ - 1, p_149726_3_, p_149726_4_); + Block var8 = p_149726_1_.getBlock(p_149726_2_ + 1, p_149726_3_, p_149726_4_); + + if (var5 == this) { + this.func_149954_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_ - 1); + } + + if (var6 == this) { + this.func_149954_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_ + 1); + } + + if (var7 == this) { + this.func_149954_e(p_149726_1_, p_149726_2_ - 1, p_149726_3_, p_149726_4_); + } + + if (var8 == this) { + this.func_149954_e(p_149726_1_, p_149726_2_ + 1, p_149726_3_, p_149726_4_); + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + Block var7 = p_149689_1_.getBlock(p_149689_2_, p_149689_3_, p_149689_4_ - 1); + Block var8 = p_149689_1_.getBlock(p_149689_2_, p_149689_3_, p_149689_4_ + 1); + Block var9 = p_149689_1_.getBlock(p_149689_2_ - 1, p_149689_3_, p_149689_4_); + Block var10 = p_149689_1_.getBlock(p_149689_2_ + 1, p_149689_3_, p_149689_4_); + byte var11 = 0; + int var12 = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var12 == 0) { + var11 = 2; + } + + if (var12 == 1) { + var11 = 5; + } + + if (var12 == 2) { + var11 = 3; + } + + if (var12 == 3) { + var11 = 4; + } + + if (var7 != this && var8 != this && var9 != this && var10 != this) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var11, 3); + } else { + if ((var7 == this || var8 == this) && (var11 == 4 || var11 == 5)) { + if (var7 == this) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_ - 1, var11, 3); + } else { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_ + 1, var11, 3); + } + + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var11, 3); + } + + if ((var9 == this || var10 == this) && (var11 == 2 || var11 == 3)) { + if (var9 == this) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_ - 1, p_149689_3_, p_149689_4_, var11, 3); + } else { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_ + 1, p_149689_3_, p_149689_4_, var11, 3); + } + + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var11, 3); + } + } + + if (p_149689_6_.hasDisplayName()) { + ((TileEntityChest)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_)).func_145976_a(p_149689_6_.getDisplayName()); + } + } + + public void func_149954_e(World p_149954_1_, int p_149954_2_, int p_149954_3_, int p_149954_4_) { + if (!p_149954_1_.isClient) { + Block var5 = p_149954_1_.getBlock(p_149954_2_, p_149954_3_, p_149954_4_ - 1); + Block var6 = p_149954_1_.getBlock(p_149954_2_, p_149954_3_, p_149954_4_ + 1); + Block var7 = p_149954_1_.getBlock(p_149954_2_ - 1, p_149954_3_, p_149954_4_); + Block var8 = p_149954_1_.getBlock(p_149954_2_ + 1, p_149954_3_, p_149954_4_); + boolean var9 = true; + int var10; + Block var11; + int var12; + Block var13; + boolean var14; + byte var15; + int var16; + + if (var5 != this && var6 != this) { + if (var7 != this && var8 != this) { + var15 = 3; + + if (var5.func_149730_j() && !var6.func_149730_j()) { + var15 = 3; + } + + if (var6.func_149730_j() && !var5.func_149730_j()) { + var15 = 2; + } + + if (var7.func_149730_j() && !var8.func_149730_j()) { + var15 = 5; + } + + if (var8.func_149730_j() && !var7.func_149730_j()) { + var15 = 4; + } + } else { + var10 = var7 == this ? p_149954_2_ - 1 : p_149954_2_ + 1; + var11 = p_149954_1_.getBlock(var10, p_149954_3_, p_149954_4_ - 1); + var12 = var7 == this ? p_149954_2_ - 1 : p_149954_2_ + 1; + var13 = p_149954_1_.getBlock(var12, p_149954_3_, p_149954_4_ + 1); + var15 = 3; + var14 = true; + + if (var7 == this) { + var16 = p_149954_1_.getBlockMetadata(p_149954_2_ - 1, p_149954_3_, p_149954_4_); + } else { + var16 = p_149954_1_.getBlockMetadata(p_149954_2_ + 1, p_149954_3_, p_149954_4_); + } + + if (var16 == 2) { + var15 = 2; + } + + if ((var5.func_149730_j() || var11.func_149730_j()) && !var6.func_149730_j() && !var13.func_149730_j()) { + var15 = 3; + } + + if ((var6.func_149730_j() || var13.func_149730_j()) && !var5.func_149730_j() && !var11.func_149730_j()) { + var15 = 2; + } + } + } else { + var10 = var5 == this ? p_149954_4_ - 1 : p_149954_4_ + 1; + var11 = p_149954_1_.getBlock(p_149954_2_ - 1, p_149954_3_, var10); + var12 = var5 == this ? p_149954_4_ - 1 : p_149954_4_ + 1; + var13 = p_149954_1_.getBlock(p_149954_2_ + 1, p_149954_3_, var12); + var15 = 5; + var14 = true; + + if (var5 == this) { + var16 = p_149954_1_.getBlockMetadata(p_149954_2_, p_149954_3_, p_149954_4_ - 1); + } else { + var16 = p_149954_1_.getBlockMetadata(p_149954_2_, p_149954_3_, p_149954_4_ + 1); + } + + if (var16 == 4) { + var15 = 4; + } + + if ((var7.func_149730_j() || var11.func_149730_j()) && !var8.func_149730_j() && !var13.func_149730_j()) { + var15 = 5; + } + + if ((var8.func_149730_j() || var13.func_149730_j()) && !var7.func_149730_j() && !var11.func_149730_j()) { + var15 = 4; + } + } + + p_149954_1_.setBlockMetadataWithNotify(p_149954_2_, p_149954_3_, p_149954_4_, var15, 3); + } + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + int var5 = 0; + + if (p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_) == this) { + ++var5; + } + + if (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_) == this) { + ++var5; + } + + if (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1) == this) { + ++var5; + } + + if (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1) == this) { + ++var5; + } + + return var5 <= 1 && (!this.func_149952_n(p_149742_1_, p_149742_2_ - 1, p_149742_3_, p_149742_4_) && (!this.func_149952_n(p_149742_1_, p_149742_2_ + 1, p_149742_3_, p_149742_4_) && (!this.func_149952_n(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_ - 1) && !this.func_149952_n(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_ + 1)))); + } + + private boolean func_149952_n(World p_149952_1_, int p_149952_2_, int p_149952_3_, int p_149952_4_) { + return p_149952_1_.getBlock(p_149952_2_, p_149952_3_, p_149952_4_) == this && (p_149952_1_.getBlock(p_149952_2_ - 1, p_149952_3_, p_149952_4_) == this || (p_149952_1_.getBlock(p_149952_2_ + 1, p_149952_3_, p_149952_4_) == this || (p_149952_1_.getBlock(p_149952_2_, p_149952_3_, p_149952_4_ - 1) == this || p_149952_1_.getBlock(p_149952_2_, p_149952_3_, p_149952_4_ + 1) == this))); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + TileEntityChest var6 = (TileEntityChest)p_149695_1_.getTileEntity(p_149695_2_, p_149695_3_, p_149695_4_); + + if (var6 != null) { + var6.updateContainingBlockInfo(); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + TileEntityChest var7 = (TileEntityChest)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var7 != null) { + for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); + + if (var9 != null) { + float var10 = this.field_149955_b.nextFloat() * 0.8F + 0.1F; + float var11 = this.field_149955_b.nextFloat() * 0.8F + 0.1F; + EntityItem var14; + + for (float var12 = this.field_149955_b.nextFloat() * 0.8F + 0.1F; var9.stackSize > 0; p_149749_1_.spawnEntityInWorld(var14)) { + int var13 = this.field_149955_b.nextInt(21) + 10; + + if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; + var14 = new EntityItem(p_149749_1_, (float)p_149749_2_ + var10, (float)p_149749_3_ + var11, (float)p_149749_4_ + var12, new ItemStack(var9.getItem(), var13, var9.getItemDamage())); + float var15 = 0.05F; + var14.motionX = (float)this.field_149955_b.nextGaussian() * var15; + var14.motionY = (float)this.field_149955_b.nextGaussian() * var15 + 0.2F; + var14.motionZ = (float)this.field_149955_b.nextGaussian() * var15; + + if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + IInventory var10 = this.func_149951_m(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + p_149727_5_.displayGUIChest(var10); + } + + return true; + } + } + + public IInventory func_149951_m(World p_149951_1_, int p_149951_2_, int p_149951_3_, int p_149951_4_) { + Object var5 = p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_); + + if (var5 == null) { + return null; + } else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_).isNormalCube()) { + return null; + } else if (func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_)) { + return null; + } else if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) { + return null; + } else if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) { + return null; + } else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) { + return null; + } else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) { + return null; + } else { + if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this) { + var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_ - 1, p_149951_3_, p_149951_4_), (IInventory)var5); + } + + if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this) { + var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_ + 1, p_149951_3_, p_149951_4_)); + } + + if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this) { + var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_ - 1), (IInventory)var5); + } + + if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this) { + var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_ + 1)); + } + + return (IInventory)var5; + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + TileEntityChest var3 = new TileEntityChest(); + return var3; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return this.field_149956_a == 1; + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + if (!this.canProvidePower()) { + return 0; + } else { + int var6 = ((TileEntityChest)p_149709_1_.getTileEntity(p_149709_2_, p_149709_3_, p_149709_4_)).field_145987_o; + return MathHelper.clamp_int(var6, 0, 15); + } + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + return p_149748_5_ == 1 ? this.isProvidingWeakPower(p_149748_1_, p_149748_2_, p_149748_3_, p_149748_4_, p_149748_5_) : 0; + } + + private static boolean func_149953_o(World p_149953_0_, int p_149953_1_, int p_149953_2_, int p_149953_3_) { + Iterator var4 = p_149953_0_.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(p_149953_1_, p_149953_2_ + 1, p_149953_3_, p_149953_1_ + 1, p_149953_2_ + 2, p_149953_3_ + 1)).iterator(); + EntityOcelot var6; + + do { + if (!var4.hasNext()) { + return false; + } + + Entity var5 = (Entity)var4.next(); + var6 = (EntityOcelot)var5; + } + while (!var6.isSitting()); + + return true; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + return Container.calcRedstoneFromInventory(this.func_149951_m(p_149736_1_, p_149736_2_, p_149736_3_, p_149736_4_)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("planks_oak"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockClay.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockClay.java new file mode 100644 index 0000000..9d10b63 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockClay.java @@ -0,0 +1,27 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockClay extends Block { + + + public BlockClay() { + super(Material.field_151571_B); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.clay_ball; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCocoa.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCocoa.java new file mode 100644 index 0000000..6b16d99 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCocoa.java @@ -0,0 +1,211 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCocoa extends BlockDirectional implements IGrowable { + private IIcon[] field_149989_a; + + + public BlockCocoa() { + super(Material.plants); + this.setTickRandomly(true); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return this.field_149989_a[2]; + } + + public IIcon func_149988_b(int p_149988_1_) { + if (p_149988_1_ < 0 || p_149988_1_ >= this.field_149989_a.length) { + p_149988_1_ = this.field_149989_a.length - 1; + } + + return this.field_149989_a[p_149988_1_]; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!this.canBlockStay(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { + this.dropBlockAsItem(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0); + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, getBlockById(0), 0, 2); + } else if (p_149674_1_.rand.nextInt(5) == 0) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + int var7 = func_149987_c(var6); + + if (var7 < 2) { + ++var7; + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var7 << 2 | func_149895_l(var6), 2); + } + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + int var5 = func_149895_l(p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_, p_149718_4_)); + p_149718_2_ += Direction.offsetX[var5]; + p_149718_4_ += Direction.offsetZ[var5]; + Block var6 = p_149718_1_.getBlock(p_149718_2_, p_149718_3_, p_149718_4_); + return var6 == Blocks.log && BlockLog.func_150165_c(p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_, p_149718_4_)) == 3; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 28; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + this.setBlockBoundsBasedOnState(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + return super.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + int var6 = func_149895_l(var5); + int var7 = func_149987_c(var5); + int var8 = 4 + var7 * 2; + int var9 = 5 + var7 * 2; + float var10 = (float)var8 / 2.0F; + + switch (var6) { + case 0: + this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, (15.0F - (float)var8) / 16.0F, (8.0F + var10) / 16.0F, 0.75F, 0.9375F); + break; + + case 1: + this.setBlockBounds(0.0625F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + (float)var8) / 16.0F, 0.75F, (8.0F + var10) / 16.0F); + break; + + case 2: + this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, (1.0F + (float)var8) / 16.0F); + break; + + case 3: + this.setBlockBounds((15.0F - (float)var8) / 16.0F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, (8.0F + var10) / 16.0F); + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + if (p_149660_5_ == 1 || p_149660_5_ == 0) { + p_149660_5_ = 2; + } + + return Direction.rotateOpposite[Direction.facingToDirection[p_149660_5_]]; + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!this.canBlockStay(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, getBlockById(0), 0, 2); + } + } + + public static int func_149987_c(int p_149987_0_) { + return (p_149987_0_ & 12) >> 2; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + int var8 = func_149987_c(p_149690_5_); + byte var9 = 1; + + if (var8 >= 2) { + var9 = 3; + } + + for (int var10 = 0; var10 < var9; ++var10) { + this.dropBlockAsItem_do(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.dye, 1, 3)); + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.dye; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + return 3; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149989_a = new IIcon[3]; + + for (int var2 = 0; var2 < this.field_149989_a.length; ++var2) { + this.field_149989_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + var2); + } + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + int var6 = p_149851_1_.getBlockMetadata(p_149851_2_, p_149851_3_, p_149851_4_); + int var7 = func_149987_c(var6); + return var7 < 2; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + int var6 = p_149853_1_.getBlockMetadata(p_149853_3_, p_149853_4_, p_149853_5_); + int var7 = BlockDirectional.func_149895_l(var6); + int var8 = func_149987_c(var6); + ++var8; + p_149853_1_.setBlockMetadataWithNotify(p_149853_3_, p_149853_4_, p_149853_5_, var8 << 2 | var7, 2); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockColored.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockColored.java new file mode 100644 index 0000000..ba4a124 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockColored.java @@ -0,0 +1,61 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockColored extends Block { + private IIcon[] field_150033_a; + + + public BlockColored(Material p_i45398_1_) { + super(p_i45398_1_); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return this.field_150033_a[p_149691_2_ % this.field_150033_a.length]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public static int func_150032_b(int p_150032_0_) { + return func_150031_c(p_150032_0_); + } + + public static int func_150031_c(int p_150031_0_) { + return ~p_150031_0_ & 15; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < 16; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150033_a = new IIcon[16]; + + for (int var2 = 0; var2 < this.field_150033_a.length; ++var2) { + this.field_150033_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_150031_c(var2)]); + } + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.func_151644_a(p_149728_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCommandBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCommandBlock.java new file mode 100644 index 0000000..9a2cc6e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCommandBlock.java @@ -0,0 +1,98 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.world.World; + +public class BlockCommandBlock extends BlockContainer { + + + public BlockCommandBlock() { + super(Material.iron); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityCommandBlock(); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + boolean var6 = p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_); + int var7 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + boolean var8 = (var7 & 1) != 0; + + if (var6 && !var8) { + p_149695_1_.setBlockMetadataWithNotify(p_149695_2_, p_149695_3_, p_149695_4_, var7 | 1, 4); + p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.func_149738_a(p_149695_1_)); + } else if (!var6 && var8) { + p_149695_1_.setBlockMetadataWithNotify(p_149695_2_, p_149695_3_, p_149695_4_, var7 & -2, 4); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + TileEntity var6 = p_149674_1_.getTileEntity(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var6 != null && var6 instanceof TileEntityCommandBlock) { + CommandBlockLogic var7 = ((TileEntityCommandBlock)var6).func_145993_a(); + var7.func_145755_a(p_149674_1_); + p_149674_1_.func_147453_f(p_149674_2_, p_149674_3_, p_149674_4_, this); + } + } + + public int func_149738_a(World p_149738_1_) { + return 1; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + TileEntityCommandBlock var10 = (TileEntityCommandBlock)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + p_149727_5_.func_146100_a(var10); + } + + return true; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + TileEntity var6 = p_149736_1_.getTileEntity(p_149736_2_, p_149736_3_, p_149736_4_); + return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).func_145993_a().func_145760_g() : 0; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + TileEntityCommandBlock var7 = (TileEntityCommandBlock)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_); + + if (p_149689_6_.hasDisplayName()) { + var7.func_145993_a().func_145754_b(p_149689_6_.getDisplayName()); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCompressed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCompressed.java new file mode 100644 index 0000000..cc2c0de --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCompressed.java @@ -0,0 +1,20 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockCompressed extends Block { + private final MapColor field_150202_a; + + + public BlockCompressed(MapColor p_i45414_1_) { + super(Material.iron); + this.field_150202_a = p_i45414_1_; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(int p_149728_1_) { + return this.field_150202_a; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCompressedPowered.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCompressedPowered.java new file mode 100644 index 0000000..8265597 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCompressedPowered.java @@ -0,0 +1,25 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.world.IBlockAccess; + +public class BlockCompressedPowered extends BlockCompressed { + + + public BlockCompressedPowered(MapColor p_i45416_1_) { + super(p_i45416_1_); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return 15; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockContainer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockContainer.java new file mode 100644 index 0000000..7a483cb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockContainer.java @@ -0,0 +1,29 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public abstract class BlockContainer extends Block implements ITileEntityProvider { + + + protected BlockContainer(Material p_i45386_1_) { + super(p_i45386_1_); + this.isBlockContainer = true; + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + } + + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); + TileEntity var7 = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); + return var7 != null && var7.receiveClientEvent(p_149696_5_, p_149696_6_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCrops.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCrops.java new file mode 100644 index 0000000..b399863 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockCrops.java @@ -0,0 +1,185 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockCrops extends BlockBush implements IGrowable { + private IIcon[] field_149867_a; + + + protected BlockCrops() { + this.setTickRandomly(true); + float var1 = 0.5F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 0.25F, 0.5F + var1); + this.setCreativeTab(null); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.disableStats(); + } + + protected boolean func_149854_a(Block p_149854_1_) { + return p_149854_1_ == Blocks.farmland; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + + if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var6 < 7) { + float var7 = this.func_149864_n(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + + if (p_149674_5_.nextInt((int)(25.0F / var7) + 1) == 0) { + ++var6; + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var6, 2); + } + } + } + } + + public void func_149863_m(World p_149863_1_, int p_149863_2_, int p_149863_3_, int p_149863_4_) { + int var5 = p_149863_1_.getBlockMetadata(p_149863_2_, p_149863_3_, p_149863_4_) + MathHelper.getRandomIntegerInRange(p_149863_1_.rand, 2, 5); + + if (var5 > 7) { + var5 = 7; + } + + p_149863_1_.setBlockMetadataWithNotify(p_149863_2_, p_149863_3_, p_149863_4_, var5, 2); + } + + private float func_149864_n(World p_149864_1_, int p_149864_2_, int p_149864_3_, int p_149864_4_) { + float var5 = 1.0F; + Block var6 = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ - 1); + Block var7 = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ + 1); + Block var8 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_); + Block var9 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_); + Block var10 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ - 1); + Block var11 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ - 1); + Block var12 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ + 1); + Block var13 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ + 1); + boolean var14 = var8 == this || var9 == this; + boolean var15 = var6 == this || var7 == this; + boolean var16 = var10 == this || var11 == this || var12 == this || var13 == this; + + for (int var17 = p_149864_2_ - 1; var17 <= p_149864_2_ + 1; ++var17) { + for (int var18 = p_149864_4_ - 1; var18 <= p_149864_4_ + 1; ++var18) { + float var19 = 0.0F; + + if (p_149864_1_.getBlock(var17, p_149864_3_ - 1, var18) == Blocks.farmland) { + var19 = 1.0F; + + if (p_149864_1_.getBlockMetadata(var17, p_149864_3_ - 1, var18) > 0) { + var19 = 3.0F; + } + } + + if (var17 != p_149864_2_ || var18 != p_149864_4_) { + var19 /= 4.0F; + } + + var5 += var19; + } + } + + if (var16 || var14 && var15) { + var5 /= 2.0F; + } + + return var5; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ < 0 || p_149691_2_ > 7) { + p_149691_2_ = 7; + } + + return this.field_149867_a[p_149691_2_]; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 6; + } + + protected Item func_149866_i() { + return Items.wheat_seeds; + } + + protected Item func_149865_P() { + return Items.wheat; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); + + if (!p_149690_1_.isClient) { + if (p_149690_5_ >= 7) { + int var8 = 3 + p_149690_7_; + + for (int var9 = 0; var9 < var8; ++var9) { + if (p_149690_1_.rand.nextInt(15) <= p_149690_5_) { + this.dropBlockAsItem_do(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0)); + } + } + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return p_149650_1_ == 7 ? this.func_149865_P() : this.func_149866_i(); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return this.func_149866_i(); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149867_a = new IIcon[8]; + + for (int var2 = 0; var2 < this.field_149867_a.length; ++var2) { + this.field_149867_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + var2); + } + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + return p_149851_1_.getBlockMetadata(p_149851_2_, p_149851_3_, p_149851_4_) != 7; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDaylightDetector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDaylightDetector.java new file mode 100644 index 0000000..b28e311 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDaylightDetector.java @@ -0,0 +1,103 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDaylightDetector; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDaylightDetector extends BlockContainer { + private final IIcon[] field_149958_a = new IIcon[2]; + + + public BlockDaylightDetector() { + super(Material.wood); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {} + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) {} + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} + + public void func_149957_e(World p_149957_1_, int p_149957_2_, int p_149957_3_, int p_149957_4_) { + if (!p_149957_1_.provider.hasNoSky) { + int var5 = p_149957_1_.getBlockMetadata(p_149957_2_, p_149957_3_, p_149957_4_); + int var6 = p_149957_1_.getSavedLightValue(EnumSkyBlock.Sky, p_149957_2_, p_149957_3_, p_149957_4_) - p_149957_1_.skylightSubtracted; + float var7 = p_149957_1_.getCelestialAngleRadians(1.0F); + + if (var7 < (float)Math.PI) { + var7 += (0.0F - var7) * 0.2F; + } else { + var7 += (((float)Math.PI * 2F) - var7) * 0.2F; + } + + var6 = Math.round((float)var6 * MathHelper.cos(var7)); + + if (var6 < 0) { + var6 = 0; + } + + if (var6 > 15) { + var6 = 15; + } + + if (var5 != var6) { + p_149957_1_.setBlockMetadataWithNotify(p_149957_2_, p_149957_3_, p_149957_4_, var6, 3); + } + } + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityDaylightDetector(); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_149958_a[0] : this.field_149958_a[1]; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149958_a[0] = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_149958_a[1] = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDeadBush.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDeadBush.java new file mode 100644 index 0000000..3b85ac6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDeadBush.java @@ -0,0 +1,38 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class BlockDeadBush extends BlockBush { + + + protected BlockDeadBush() { + super(Material.vine); + float var1 = 0.4F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 0.8F, 0.5F + var1); + } + + protected boolean func_149854_a(Block p_149854_1_) { + return p_149854_1_ == Blocks.sand || p_149854_1_ == Blocks.hardened_clay || p_149854_1_ == Blocks.stained_hardened_clay || p_149854_1_ == Blocks.dirt; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + if (!p_149636_1_.isClient && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) { + p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + this.dropBlockAsItem_do(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.deadbush, 1, p_149636_6_)); + } else { + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDirectional.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDirectional.java new file mode 100644 index 0000000..c90e399 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDirectional.java @@ -0,0 +1,15 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; + +public abstract class BlockDirectional extends Block { + + + protected BlockDirectional(Material p_i45401_1_) { + super(p_i45401_1_); + } + + public static int func_149895_l(int p_149895_0_) { + return p_149895_0_ & 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDirt.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDirt.java new file mode 100644 index 0000000..577008f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDirt.java @@ -0,0 +1,110 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDirt extends Block { + public static final String[] field_150009_a = new String[] {"default", "default", "podzol"}; + private IIcon field_150008_b; + private IIcon field_150010_M; + + + protected BlockDirt() { + super(Material.ground); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ == 2) { + if (p_149691_1_ == 1) { + return this.field_150008_b; + } + + if (p_149691_1_ != 0) { + return this.field_150010_M; + } + } + + return this.blockIcon; + } + + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + int var6 = p_149673_1_.getBlockMetadata(p_149673_2_, p_149673_3_, p_149673_4_); + + if (var6 == 2) { + if (p_149673_5_ == 1) { + return this.field_150008_b; + } + + if (p_149673_5_ != 0) { + Material var7 = p_149673_1_.getBlock(p_149673_2_, p_149673_3_ + 1, p_149673_4_).getMaterial(); + + if (var7 == Material.field_151597_y || var7 == Material.craftedSnow) { + return Blocks.grass.getIcon(p_149673_1_, p_149673_2_, p_149673_3_, p_149673_4_, p_149673_5_); + } + + Block var8 = p_149673_1_.getBlock(p_149673_2_, p_149673_3_ + 1, p_149673_4_); + + if (var8 != Blocks.dirt && var8 != Blocks.grass) { + return this.field_150010_M; + } + } + } + + return this.blockIcon; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return 0; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + if (p_149644_1_ == 1) { + p_149644_1_ = 0; + } + + return super.createStackedBlock(p_149644_1_); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(this, 1, 0)); + p_149666_3_.add(new ItemStack(this, 1, 2)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + super.registerBlockIcons(p_149651_1_); + this.field_150008_b = p_149651_1_.registerIcon(this.getTextureName() + "_" + "podzol_top"); + this.field_150010_M = p_149651_1_.registerIcon(this.getTextureName() + "_" + "podzol_side"); + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + int var5 = p_149643_1_.getBlockMetadata(p_149643_2_, p_149643_3_, p_149643_4_); + + if (var5 == 1) { + var5 = 0; + } + + return var5; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDispenser.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDispenser.java new file mode 100644 index 0000000..f982e6c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDispenser.java @@ -0,0 +1,235 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.dispenser.PositionImpl; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; +import net.minecraft.util.IRegistry; +import net.minecraft.util.RegistryDefaulted; +import net.minecraft.world.World; + +public class BlockDispenser extends BlockContainer { + public static final IRegistry dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem()); + protected Random field_149942_b = new Random(); + protected IIcon field_149944_M; + protected IIcon field_149945_N; + protected IIcon field_149946_O; + + + protected BlockDispenser() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public int func_149738_a(World p_149738_1_) { + return 4; + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + this.func_149938_m(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + private void func_149938_m(World p_149938_1_, int p_149938_2_, int p_149938_3_, int p_149938_4_) { + if (!p_149938_1_.isClient) { + Block var5 = p_149938_1_.getBlock(p_149938_2_, p_149938_3_, p_149938_4_ - 1); + Block var6 = p_149938_1_.getBlock(p_149938_2_, p_149938_3_, p_149938_4_ + 1); + Block var7 = p_149938_1_.getBlock(p_149938_2_ - 1, p_149938_3_, p_149938_4_); + Block var8 = p_149938_1_.getBlock(p_149938_2_ + 1, p_149938_3_, p_149938_4_); + byte var9 = 3; + + if (var5.func_149730_j() && !var6.func_149730_j()) { + var9 = 3; + } + + if (var6.func_149730_j() && !var5.func_149730_j()) { + var9 = 2; + } + + if (var7.func_149730_j() && !var8.func_149730_j()) { + var9 = 5; + } + + if (var8.func_149730_j() && !var7.func_149730_j()) { + var9 = 4; + } + + p_149938_1_.setBlockMetadataWithNotify(p_149938_2_, p_149938_3_, p_149938_4_, var9, 2); + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + int var3 = p_149691_2_ & 7; + return p_149691_1_ == var3 ? (var3 != 1 && var3 != 0 ? this.field_149945_N : this.field_149946_O) : (var3 != 1 && var3 != 0 ? (p_149691_1_ != 1 && p_149691_1_ != 0 ? this.blockIcon : this.field_149944_M) : this.field_149944_M); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("furnace_side"); + this.field_149944_M = p_149651_1_.registerIcon("furnace_top"); + this.field_149945_N = p_149651_1_.registerIcon(this.getTextureName() + "_front_horizontal"); + this.field_149946_O = p_149651_1_.registerIcon(this.getTextureName() + "_front_vertical"); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + TileEntityDispenser var10 = (TileEntityDispenser)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + p_149727_5_.func_146102_a(var10); + } + + return true; + } + } + + protected void func_149941_e(World p_149941_1_, int p_149941_2_, int p_149941_3_, int p_149941_4_) { + BlockSourceImpl var5 = new BlockSourceImpl(p_149941_1_, p_149941_2_, p_149941_3_, p_149941_4_); + TileEntityDispenser var6 = (TileEntityDispenser)var5.getBlockTileEntity(); + + if (var6 != null) { + int var7 = var6.func_146017_i(); + + if (var7 < 0) { + p_149941_1_.playAuxSFX(1001, p_149941_2_, p_149941_3_, p_149941_4_, 0); + } else { + ItemStack var8 = var6.getStackInSlot(var7); + IBehaviorDispenseItem var9 = this.func_149940_a(var8); + + if (var9 != IBehaviorDispenseItem.itemDispenseBehaviorProvider) { + ItemStack var10 = var9.dispense(var5, var8); + var6.setInventorySlotContents(var7, var10.stackSize == 0 ? null : var10); + } + } + } + } + + protected IBehaviorDispenseItem func_149940_a(ItemStack p_149940_1_) { + return (IBehaviorDispenseItem)dispenseBehaviorRegistry.getObject(p_149940_1_.getItem()); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + boolean var6 = p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_) || p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_ + 1, p_149695_4_); + int var7 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + boolean var8 = (var7 & 8) != 0; + + if (var6 && !var8) { + p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.func_149738_a(p_149695_1_)); + p_149695_1_.setBlockMetadataWithNotify(p_149695_2_, p_149695_3_, p_149695_4_, var7 | 8, 4); + } else if (!var6 && var8) { + p_149695_1_.setBlockMetadataWithNotify(p_149695_2_, p_149695_3_, p_149695_4_, var7 & -9, 4); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + this.func_149941_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityDispenser(); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = BlockPistonBase.func_150071_a(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_); + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + + if (p_149689_6_.hasDisplayName()) { + ((TileEntityDispenser)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_)).func_146018_a(p_149689_6_.getDisplayName()); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + TileEntityDispenser var7 = (TileEntityDispenser)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var7 != null) { + for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); + + if (var9 != null) { + float var10 = this.field_149942_b.nextFloat() * 0.8F + 0.1F; + float var11 = this.field_149942_b.nextFloat() * 0.8F + 0.1F; + float var12 = this.field_149942_b.nextFloat() * 0.8F + 0.1F; + + while (var9.stackSize > 0) { + int var13 = this.field_149942_b.nextInt(21) + 10; + + if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; + EntityItem var14 = new EntityItem(p_149749_1_, (float)p_149749_2_ + var10, (float)p_149749_3_ + var11, (float)p_149749_4_ + var12, new ItemStack(var9.getItem(), var13, var9.getItemDamage())); + + if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + + float var15 = 0.05F; + var14.motionX = (float)this.field_149942_b.nextGaussian() * var15; + var14.motionY = (float)this.field_149942_b.nextGaussian() * var15 + 0.2F; + var14.motionZ = (float)this.field_149942_b.nextGaussian() * var15; + p_149749_1_.spawnEntityInWorld(var14); + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + public static IPosition func_149939_a(IBlockSource p_149939_0_) { + EnumFacing var1 = func_149937_b(p_149939_0_.getBlockMetadata()); + double var2 = p_149939_0_.getX() + 0.7D * (double)var1.getFrontOffsetX(); + double var4 = p_149939_0_.getY() + 0.7D * (double)var1.getFrontOffsetY(); + double var6 = p_149939_0_.getZ() + 0.7D * (double)var1.getFrontOffsetZ(); + return new PositionImpl(var2, var4, var6); + } + + public static EnumFacing func_149937_b(int p_149937_0_) { + return EnumFacing.getFront(p_149937_0_ & 7); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + return Container.calcRedstoneFromInventory((IInventory)p_149736_1_.getTileEntity(p_149736_2_, p_149736_3_, p_149736_4_)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDoor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDoor.java new file mode 100644 index 0000000..f9bdc63 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDoor.java @@ -0,0 +1,325 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.IconFlipped; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDoor extends Block { + private IIcon[] field_150017_a; + private IIcon[] field_150016_b; + + + protected BlockDoor(Material p_i45402_1_) { + super(p_i45402_1_); + float var2 = 0.5F; + float var3 = 1.0F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var3, 0.5F + var2); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return this.field_150016_b[0]; + } + + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + if (p_149673_5_ != 1 && p_149673_5_ != 0) { + int var6 = this.func_150012_g(p_149673_1_, p_149673_2_, p_149673_3_, p_149673_4_); + int var7 = var6 & 3; + boolean var8 = (var6 & 4) != 0; + boolean var9 = false; + boolean var10 = (var6 & 8) != 0; + + if (var8) { + if (var7 == 0 && p_149673_5_ == 2) { + var9 = !var9; + } else if (var7 == 1 && p_149673_5_ == 5) { + var9 = !var9; + } else if (var7 == 2 && p_149673_5_ == 3) { + var9 = !var9; + } else if (var7 == 3 && p_149673_5_ == 4) { + var9 = !var9; + } + } else { + if (var7 == 0 && p_149673_5_ == 5) { + var9 = !var9; + } else if (var7 == 1 && p_149673_5_ == 3) { + var9 = !var9; + } else if (var7 == 2 && p_149673_5_ == 4) { + var9 = !var9; + } else if (var7 == 3 && p_149673_5_ == 2) { + var9 = !var9; + } + + if ((var6 & 16) != 0) { + var9 = !var9; + } + } + + return var10 ? this.field_150017_a[var9 ? 1 : 0] : this.field_150016_b[var9 ? 1 : 0]; + } else { + return this.field_150016_b[0]; + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150017_a = new IIcon[2]; + this.field_150016_b = new IIcon[2]; + this.field_150017_a[0] = p_149651_1_.registerIcon(this.getTextureName() + "_upper"); + this.field_150016_b[0] = p_149651_1_.registerIcon(this.getTextureName() + "_lower"); + this.field_150017_a[1] = new IconFlipped(this.field_150017_a[0], true, false); + this.field_150016_b[1] = new IconFlipped(this.field_150016_b[0], true, false); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + int var5 = this.func_150012_g(p_149655_1_, p_149655_2_, p_149655_3_, p_149655_4_); + return (var5 & 4) != 0; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 7; + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + this.setBlockBoundsBasedOnState(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + return super.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.func_150011_b(this.func_150012_g(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_)); + } + + public int func_150013_e(IBlockAccess p_150013_1_, int p_150013_2_, int p_150013_3_, int p_150013_4_) { + return this.func_150012_g(p_150013_1_, p_150013_2_, p_150013_3_, p_150013_4_) & 3; + } + + public boolean func_150015_f(IBlockAccess p_150015_1_, int p_150015_2_, int p_150015_3_, int p_150015_4_) { + return (this.func_150012_g(p_150015_1_, p_150015_2_, p_150015_3_, p_150015_4_) & 4) != 0; + } + + private void func_150011_b(int p_150011_1_) { + float var2 = 0.1875F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); + int var3 = p_150011_1_ & 3; + boolean var4 = (p_150011_1_ & 4) != 0; + boolean var5 = (p_150011_1_ & 16) != 0; + + if (var3 == 0) { + if (var4) { + if (!var5) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); + } else { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); + } + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); + } + } else if (var3 == 1) { + if (var4) { + if (!var5) { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); + } + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); + } + } else if (var3 == 2) { + if (var4) { + if (!var5) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); + } + } else { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } else if (var3 == 3) { + if (var4) { + if (!var5) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); + } else { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } else { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) {} + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (this.blockMaterial == Material.iron) { + return true; + } else { + int var10 = this.func_150012_g(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + int var11 = var10 & 7; + var11 ^= 4; + + if ((var10 & 8) == 0) { + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var11, 2); + p_149727_1_.markBlockRangeForRenderUpdate(p_149727_2_, p_149727_3_, p_149727_4_, p_149727_2_, p_149727_3_, p_149727_4_); + } else { + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_ - 1, p_149727_4_, var11, 2); + p_149727_1_.markBlockRangeForRenderUpdate(p_149727_2_, p_149727_3_ - 1, p_149727_4_, p_149727_2_, p_149727_3_, p_149727_4_); + } + + p_149727_1_.playAuxSFXAtEntity(p_149727_5_, 1003, p_149727_2_, p_149727_3_, p_149727_4_, 0); + return true; + } + } + + public void func_150014_a(World p_150014_1_, int p_150014_2_, int p_150014_3_, int p_150014_4_, boolean p_150014_5_) { + int var6 = this.func_150012_g(p_150014_1_, p_150014_2_, p_150014_3_, p_150014_4_); + boolean var7 = (var6 & 4) != 0; + + if (var7 != p_150014_5_) { + int var8 = var6 & 7; + var8 ^= 4; + + if ((var6 & 8) == 0) { + p_150014_1_.setBlockMetadataWithNotify(p_150014_2_, p_150014_3_, p_150014_4_, var8, 2); + p_150014_1_.markBlockRangeForRenderUpdate(p_150014_2_, p_150014_3_, p_150014_4_, p_150014_2_, p_150014_3_, p_150014_4_); + } else { + p_150014_1_.setBlockMetadataWithNotify(p_150014_2_, p_150014_3_ - 1, p_150014_4_, var8, 2); + p_150014_1_.markBlockRangeForRenderUpdate(p_150014_2_, p_150014_3_ - 1, p_150014_4_, p_150014_2_, p_150014_3_, p_150014_4_); + } + + p_150014_1_.playAuxSFXAtEntity(null, 1003, p_150014_2_, p_150014_3_, p_150014_4_, 0); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + + if ((var6 & 8) == 0) { + boolean var7 = false; + + if (p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_) != this) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + var7 = true; + } + + if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_)) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + var7 = true; + + if (p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_) == this) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_ + 1, p_149695_4_); + } + } + + if (var7) { + if (!p_149695_1_.isClient) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var6, 0); + } + } else { + boolean var8 = p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_) || p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_ + 1, p_149695_4_); + + if ((var8 || p_149695_5_.canProvidePower()) && p_149695_5_ != this) { + this.func_150014_a(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var8); + } + } + } else { + if (p_149695_1_.getBlock(p_149695_2_, p_149695_3_ - 1, p_149695_4_) != this) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + + if (p_149695_5_ != this) { + this.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_, p_149695_5_); + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return (p_149650_1_ & 8) != 0 ? null : (this.blockMaterial == Material.iron ? Items.iron_door : Items.wooden_door); + } + + public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) { + this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_); + return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_3_ < 255 && World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_); + } + + public int getMobilityFlag() { + return 1; + } + + public int func_150012_g(IBlockAccess p_150012_1_, int p_150012_2_, int p_150012_3_, int p_150012_4_) { + int var5 = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_, p_150012_4_); + boolean var6 = (var5 & 8) != 0; + int var7; + int var8; + + if (var6) { + var7 = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_ - 1, p_150012_4_); + var8 = var5; + } else { + var7 = var5; + var8 = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_ + 1, p_150012_4_); + } + + boolean var9 = (var8 & 1) != 0; + return var7 & 7 | (var6 ? 8 : 0) | (var9 ? 16 : 0); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return this.blockMaterial == Material.iron ? Items.iron_door : Items.wooden_door; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + if (p_149681_6_.capabilities.isCreativeMode && (p_149681_5_ & 8) != 0 && p_149681_1_.getBlock(p_149681_2_, p_149681_3_ - 1, p_149681_4_) == this) { + p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDoublePlant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDoublePlant.java new file mode 100644 index 0000000..af1fbae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDoublePlant.java @@ -0,0 +1,230 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDoublePlant extends BlockBush implements IGrowable { + public static final String[] field_149892_a = new String[] {"sunflower", "syringa", "grass", "fern", "rose", "paeonia"}; + private IIcon[] field_149893_M; + private IIcon[] field_149894_N; + public IIcon[] field_149891_b; + + + public BlockDoublePlant() { + super(Material.plants); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.setBlockName("doublePlant"); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 40; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public int func_149885_e(IBlockAccess p_149885_1_, int p_149885_2_, int p_149885_3_, int p_149885_4_) { + int var5 = p_149885_1_.getBlockMetadata(p_149885_2_, p_149885_3_, p_149885_4_); + return !func_149887_c(var5) ? var5 & 7 : p_149885_1_.getBlockMetadata(p_149885_2_, p_149885_3_ - 1, p_149885_4_) & 7; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && p_149742_1_.isAirBlock(p_149742_2_, p_149742_3_ + 1, p_149742_4_); + } + + protected void func_149855_e(World p_149855_1_, int p_149855_2_, int p_149855_3_, int p_149855_4_) { + if (!this.canBlockStay(p_149855_1_, p_149855_2_, p_149855_3_, p_149855_4_)) { + int var5 = p_149855_1_.getBlockMetadata(p_149855_2_, p_149855_3_, p_149855_4_); + + if (!func_149887_c(var5)) { + this.dropBlockAsItem(p_149855_1_, p_149855_2_, p_149855_3_, p_149855_4_, var5, 0); + + if (p_149855_1_.getBlock(p_149855_2_, p_149855_3_ + 1, p_149855_4_) == this) { + p_149855_1_.setBlock(p_149855_2_, p_149855_3_ + 1, p_149855_4_, Blocks.air, 0, 2); + } + } + + p_149855_1_.setBlock(p_149855_2_, p_149855_3_, p_149855_4_, Blocks.air, 0, 2); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + int var5 = p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_, p_149718_4_); + return func_149887_c(var5) ? p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.getBlock(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + if (func_149887_c(p_149650_1_)) { + return null; + } else { + int var4 = func_149890_d(p_149650_1_); + return var4 != 3 && var4 != 2 ? Item.getItemFromBlock(this) : null; + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return func_149887_c(p_149692_1_) ? 0 : p_149692_1_ & 7; + } + + public static boolean func_149887_c(int p_149887_0_) { + return (p_149887_0_ & 8) != 0; + } + + public static int func_149890_d(int p_149890_0_) { + return p_149890_0_ & 7; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return func_149887_c(p_149691_2_) ? this.field_149893_M[0] : this.field_149893_M[p_149691_2_ & 7]; + } + + public IIcon func_149888_a(boolean p_149888_1_, int p_149888_2_) { + return p_149888_1_ ? this.field_149894_N[p_149888_2_] : this.field_149893_M[p_149888_2_]; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + int var5 = this.func_149885_e(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_); + return var5 != 2 && var5 != 3 ? 16777215 : p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).getBiomeGrassColor(p_149720_2_, p_149720_3_, p_149720_4_); + } + + public void func_149889_c(World p_149889_1_, int p_149889_2_, int p_149889_3_, int p_149889_4_, int p_149889_5_, int p_149889_6_) { + p_149889_1_.setBlock(p_149889_2_, p_149889_3_, p_149889_4_, this, p_149889_5_, p_149889_6_); + p_149889_1_.setBlock(p_149889_2_, p_149889_3_ + 1, p_149889_4_, this, 8, p_149889_6_); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; + p_149689_1_.setBlock(p_149689_2_, p_149689_3_ + 1, p_149689_4_, this, 8 | var7, 2); + } + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + if (p_149636_1_.isClient || p_149636_2_.getCurrentEquippedItem() == null || p_149636_2_.getCurrentEquippedItem().getItem() != Items.shears || func_149887_c(p_149636_6_) || !this.func_149886_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, p_149636_2_)) { + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + if (func_149887_c(p_149681_5_)) { + if (p_149681_1_.getBlock(p_149681_2_, p_149681_3_ - 1, p_149681_4_) == this) { + if (!p_149681_6_.capabilities.isCreativeMode) { + int var7 = p_149681_1_.getBlockMetadata(p_149681_2_, p_149681_3_ - 1, p_149681_4_); + int var8 = func_149890_d(var7); + + if (var8 != 3 && var8 != 2) { + p_149681_1_.func_147480_a(p_149681_2_, p_149681_3_ - 1, p_149681_4_, true); + } else { + if (!p_149681_1_.isClient && p_149681_6_.getCurrentEquippedItem() != null && p_149681_6_.getCurrentEquippedItem().getItem() == Items.shears) { + this.func_149886_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, var7, p_149681_6_); + } + + p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_); + } + } else { + p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_ - 1, p_149681_4_); + } + } + } else if (p_149681_6_.capabilities.isCreativeMode && p_149681_1_.getBlock(p_149681_2_, p_149681_3_ + 1, p_149681_4_) == this) { + p_149681_1_.setBlock(p_149681_2_, p_149681_3_ + 1, p_149681_4_, Blocks.air, 0, 2); + } + + super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + } + + private boolean func_149886_b(World p_149886_1_, int p_149886_2_, int p_149886_3_, int p_149886_4_, int p_149886_5_, EntityPlayer p_149886_6_) { + int var7 = func_149890_d(p_149886_5_); + + if (var7 != 3 && var7 != 2) { + return false; + } else { + p_149886_6_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + byte var8 = 1; + + if (var7 == 3) { + var8 = 2; + } + + this.dropBlockAsItem_do(p_149886_1_, p_149886_2_, p_149886_3_, p_149886_4_, new ItemStack(Blocks.tallgrass, 2, var8)); + return true; + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149893_M = new IIcon[field_149892_a.length]; + this.field_149894_N = new IIcon[field_149892_a.length]; + + for (int var2 = 0; var2 < this.field_149893_M.length; ++var2) { + this.field_149893_M[var2] = p_149651_1_.registerIcon("double_plant_" + field_149892_a[var2] + "_bottom"); + this.field_149894_N[var2] = p_149651_1_.registerIcon("double_plant_" + field_149892_a[var2] + "_top"); + } + + this.field_149891_b = new IIcon[2]; + this.field_149891_b[0] = p_149651_1_.registerIcon("double_plant_sunflower_front"); + this.field_149891_b[1] = p_149651_1_.registerIcon("double_plant_sunflower_back"); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < this.field_149893_M.length; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + int var5 = p_149643_1_.getBlockMetadata(p_149643_2_, p_149643_3_, p_149643_4_); + return func_149887_c(var5) ? func_149890_d(p_149643_1_.getBlockMetadata(p_149643_2_, p_149643_3_ - 1, p_149643_4_)) : func_149890_d(var5); + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + int var6 = this.func_149885_e(p_149851_1_, p_149851_2_, p_149851_3_, p_149851_4_); + return var6 != 2 && var6 != 3; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + int var6 = this.func_149885_e(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); + this.dropBlockAsItem_do(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, new ItemStack(this, 1, var6)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDragonEgg.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDragonEgg.java new file mode 100644 index 0000000..f88a049 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDragonEgg.java @@ -0,0 +1,131 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDragonEgg extends Block { + + + public BlockDragonEgg() { + super(Material.dragonEgg); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, this.func_149738_a(p_149726_1_)); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.func_149738_a(p_149695_1_)); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + this.func_150018_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + + private void func_150018_e(World p_150018_1_, int p_150018_2_, int p_150018_3_, int p_150018_4_) { + if (BlockFalling.func_149831_e(p_150018_1_, p_150018_2_, p_150018_3_ - 1, p_150018_4_) && p_150018_3_ >= 0) { + byte var5 = 32; + + if (!BlockFalling.field_149832_M && p_150018_1_.checkChunksExist(p_150018_2_ - var5, p_150018_3_ - var5, p_150018_4_ - var5, p_150018_2_ + var5, p_150018_3_ + var5, p_150018_4_ + var5)) { + EntityFallingBlock var6 = new EntityFallingBlock(p_150018_1_, (float)p_150018_2_ + 0.5F, (float)p_150018_3_ + 0.5F, (float)p_150018_4_ + 0.5F, this); + p_150018_1_.spawnEntityInWorld(var6); + } else { + p_150018_1_.setBlockToAir(p_150018_2_, p_150018_3_, p_150018_4_); + + while (BlockFalling.func_149831_e(p_150018_1_, p_150018_2_, p_150018_3_ - 1, p_150018_4_) && p_150018_3_ > 0) { + --p_150018_3_; + } + + if (p_150018_3_ > 0) { + p_150018_1_.setBlock(p_150018_2_, p_150018_3_, p_150018_4_, this, 0, 2); + } + } + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + this.func_150019_m(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + return true; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) { + this.func_150019_m(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_); + } + + private void func_150019_m(World p_150019_1_, int p_150019_2_, int p_150019_3_, int p_150019_4_) { + if (p_150019_1_.getBlock(p_150019_2_, p_150019_3_, p_150019_4_) == this) { + for (int var5 = 0; var5 < 1000; ++var5) { + int var6 = p_150019_2_ + p_150019_1_.rand.nextInt(16) - p_150019_1_.rand.nextInt(16); + int var7 = p_150019_3_ + p_150019_1_.rand.nextInt(8) - p_150019_1_.rand.nextInt(8); + int var8 = p_150019_4_ + p_150019_1_.rand.nextInt(16) - p_150019_1_.rand.nextInt(16); + + if (p_150019_1_.getBlock(var6, var7, var8).blockMaterial == Material.air) { + if (!p_150019_1_.isClient) { + p_150019_1_.setBlock(var6, var7, var8, this, p_150019_1_.getBlockMetadata(p_150019_2_, p_150019_3_, p_150019_4_), 2); + p_150019_1_.setBlockToAir(p_150019_2_, p_150019_3_, p_150019_4_); + } else { + short var9 = 128; + + for (int var10 = 0; var10 < var9; ++var10) { + double var11 = p_150019_1_.rand.nextDouble(); + float var13 = (p_150019_1_.rand.nextFloat() - 0.5F) * 0.2F; + float var14 = (p_150019_1_.rand.nextFloat() - 0.5F) * 0.2F; + float var15 = (p_150019_1_.rand.nextFloat() - 0.5F) * 0.2F; + double var16 = (double)var6 + (double)(p_150019_2_ - var6) * var11 + (p_150019_1_.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + double var18 = (double)var7 + (double)(p_150019_3_ - var7) * var11 + p_150019_1_.rand.nextDouble() * 1.0D - 0.5D; + double var20 = (double)var8 + (double)(p_150019_4_ - var8) * var11 + (p_150019_1_.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + p_150019_1_.spawnParticle("portal", var16, var18, var20, var13, var14, var15); + } + } + + return; + } + } + } + } + + public int func_149738_a(World p_149738_1_) { + return 5; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return true; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 27; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemById(0); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDropper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDropper.java new file mode 100644 index 0000000..2f67b61 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDropper.java @@ -0,0 +1,76 @@ +package net.minecraft.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.Facing; +import net.minecraft.world.World; + +public class BlockDropper extends BlockDispenser { + private final IBehaviorDispenseItem field_149947_P = new BehaviorDefaultDispenseItem(); + + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("furnace_side"); + this.field_149944_M = p_149651_1_.registerIcon("furnace_top"); + this.field_149945_N = p_149651_1_.registerIcon(this.getTextureName() + "_front_horizontal"); + this.field_149946_O = p_149651_1_.registerIcon(this.getTextureName() + "_front_vertical"); + } + + protected IBehaviorDispenseItem func_149940_a(ItemStack p_149940_1_) { + return this.field_149947_P; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityDropper(); + } + + protected void func_149941_e(World p_149941_1_, int p_149941_2_, int p_149941_3_, int p_149941_4_) { + BlockSourceImpl var5 = new BlockSourceImpl(p_149941_1_, p_149941_2_, p_149941_3_, p_149941_4_); + TileEntityDispenser var6 = (TileEntityDispenser)var5.getBlockTileEntity(); + + if (var6 != null) { + int var7 = var6.func_146017_i(); + + if (var7 < 0) { + p_149941_1_.playAuxSFX(1001, p_149941_2_, p_149941_3_, p_149941_4_, 0); + } else { + ItemStack var8 = var6.getStackInSlot(var7); + int var9 = p_149941_1_.getBlockMetadata(p_149941_2_, p_149941_3_, p_149941_4_) & 7; + IInventory var10 = TileEntityHopper.func_145893_b(p_149941_1_, p_149941_2_ + Facing.offsetsXForSide[var9], p_149941_3_ + Facing.offsetsYForSide[var9], p_149941_4_ + Facing.offsetsZForSide[var9]); + ItemStack var11; + + if (var10 != null) { + var11 = TileEntityHopper.func_145889_a(var10, var8.copy().splitStack(1), Facing.oppositeSide[var9]); + + if (var11 == null) { + var11 = var8.copy(); + + if (--var11.stackSize == 0) { + var11 = null; + } + } else { + var11 = var8.copy(); + } + } else { + var11 = this.field_149947_P.dispense(var5, var8); + + if (var11 != null && var11.stackSize == 0) { + var11 = null; + } + } + + var6.setInventorySlotContents(var7, var11); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDynamicLiquid.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDynamicLiquid.java new file mode 100644 index 0000000..8f90a6b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockDynamicLiquid.java @@ -0,0 +1,279 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class BlockDynamicLiquid extends BlockLiquid { + int field_149815_a; + boolean[] field_149814_b = new boolean[4]; + int[] field_149816_M = new int[4]; + + + protected BlockDynamicLiquid(Material p_i45403_1_) { + super(p_i45403_1_); + } + + private void func_149811_n(World p_149811_1_, int p_149811_2_, int p_149811_3_, int p_149811_4_) { + int var5 = p_149811_1_.getBlockMetadata(p_149811_2_, p_149811_3_, p_149811_4_); + p_149811_1_.setBlock(p_149811_2_, p_149811_3_, p_149811_4_, Block.getBlockById(Block.getIdFromBlock(this) + 1), var5, 2); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + int var6 = this.func_149804_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + byte var7 = 1; + + if (this.blockMaterial == Material.lava && !p_149674_1_.provider.isHellWorld) { + var7 = 2; + } + + boolean var8 = true; + int var9 = this.func_149738_a(p_149674_1_); + int var11; + + if (var6 > 0) { + byte var10 = -100; + this.field_149815_a = 0; + int var13 = this.func_149810_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, var10); + var13 = this.func_149810_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, var13); + var13 = this.func_149810_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, var13); + var13 = this.func_149810_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, var13); + var11 = var13 + var7; + + if (var11 >= 8 || var13 < 0) { + var11 = -1; + } + + if (this.func_149804_e(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 0) { + int var12 = this.func_149804_e(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_); + + if (var12 >= 8) { + var11 = var12; + } else { + var11 = var12 + 8; + } + } + + if (this.field_149815_a >= 2 && this.blockMaterial == Material.water) { + if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial().isSolid()) { + var11 = 0; + } else if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == this.blockMaterial && p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == 0) { + var11 = 0; + } + } + + if (this.blockMaterial == Material.lava && var6 < 8 && var11 < 8 && var11 > var6 && p_149674_5_.nextInt(4) != 0) { + var9 *= 4; + } + + if (var11 == var6) { + if (var8) { + this.func_149811_n(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + } else { + var6 = var11; + + if (var11 < 0) { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } else { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var11, 2); + p_149674_1_.scheduleBlockUpdate(p_149674_2_, p_149674_3_, p_149674_4_, this, var9); + p_149674_1_.notifyBlocksOfNeighborChange(p_149674_2_, p_149674_3_, p_149674_4_, this); + } + } + } else { + this.func_149811_n(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + + if (this.func_149809_q(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_)) { + if (this.blockMaterial == Material.lava && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).getMaterial() == Material.water) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_, Blocks.stone); + this.func_149799_m(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_); + return; + } + + if (var6 >= 8) { + this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, var6); + } else { + this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, var6 + 8); + } + } else if (var6 >= 0 && (var6 == 0 || this.func_149807_p(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_))) { + boolean[] var14 = this.func_149808_o(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + var11 = var6 + var7; + + if (var6 >= 8) { + var11 = 1; + } + + if (var11 >= 8) { + return; + } + + if (var14[0]) { + this.func_149813_h(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, var11); + } + + if (var14[1]) { + this.func_149813_h(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, var11); + } + + if (var14[2]) { + this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, var11); + } + + if (var14[3]) { + this.func_149813_h(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, var11); + } + } + } + + private void func_149813_h(World p_149813_1_, int p_149813_2_, int p_149813_3_, int p_149813_4_, int p_149813_5_) { + if (this.func_149809_q(p_149813_1_, p_149813_2_, p_149813_3_, p_149813_4_)) { + Block var6 = p_149813_1_.getBlock(p_149813_2_, p_149813_3_, p_149813_4_); + + if (this.blockMaterial == Material.lava) { + this.func_149799_m(p_149813_1_, p_149813_2_, p_149813_3_, p_149813_4_); + } else { + var6.dropBlockAsItem(p_149813_1_, p_149813_2_, p_149813_3_, p_149813_4_, p_149813_1_.getBlockMetadata(p_149813_2_, p_149813_3_, p_149813_4_), 0); + } + + p_149813_1_.setBlock(p_149813_2_, p_149813_3_, p_149813_4_, this, p_149813_5_, 3); + } + } + + private int func_149812_c(World p_149812_1_, int p_149812_2_, int p_149812_3_, int p_149812_4_, int p_149812_5_, int p_149812_6_) { + int var7 = 1000; + + for (int var8 = 0; var8 < 4; ++var8) { + if ((var8 != 0 || p_149812_6_ != 1) && (var8 != 1 || p_149812_6_ != 0) && (var8 != 2 || p_149812_6_ != 3) && (var8 != 3 || p_149812_6_ != 2)) { + int var9 = p_149812_2_; + int var11 = p_149812_4_; + + if (var8 == 0) { + var9 = p_149812_2_ - 1; + } + + if (var8 == 1) { + ++var9; + } + + if (var8 == 2) { + var11 = p_149812_4_ - 1; + } + + if (var8 == 3) { + ++var11; + } + + if (!this.func_149807_p(p_149812_1_, var9, p_149812_3_, var11) && (p_149812_1_.getBlock(var9, p_149812_3_, var11).getMaterial() != this.blockMaterial || p_149812_1_.getBlockMetadata(var9, p_149812_3_, var11) != 0)) { + if (!this.func_149807_p(p_149812_1_, var9, p_149812_3_ - 1, var11)) { + return p_149812_5_; + } + + if (p_149812_5_ < 4) { + int var12 = this.func_149812_c(p_149812_1_, var9, p_149812_3_, var11, p_149812_5_ + 1, var8); + + if (var12 < var7) { + var7 = var12; + } + } + } + } + } + + return var7; + } + + private boolean[] func_149808_o(World p_149808_1_, int p_149808_2_, int p_149808_3_, int p_149808_4_) { + int var5; + int var6; + + for (var5 = 0; var5 < 4; ++var5) { + this.field_149816_M[var5] = 1000; + var6 = p_149808_2_; + int var8 = p_149808_4_; + + if (var5 == 0) { + var6 = p_149808_2_ - 1; + } + + if (var5 == 1) { + ++var6; + } + + if (var5 == 2) { + var8 = p_149808_4_ - 1; + } + + if (var5 == 3) { + ++var8; + } + + if (!this.func_149807_p(p_149808_1_, var6, p_149808_3_, var8) && (p_149808_1_.getBlock(var6, p_149808_3_, var8).getMaterial() != this.blockMaterial || p_149808_1_.getBlockMetadata(var6, p_149808_3_, var8) != 0)) { + if (this.func_149807_p(p_149808_1_, var6, p_149808_3_ - 1, var8)) { + this.field_149816_M[var5] = this.func_149812_c(p_149808_1_, var6, p_149808_3_, var8, 1, var5); + } else { + this.field_149816_M[var5] = 0; + } + } + } + + var5 = this.field_149816_M[0]; + + for (var6 = 1; var6 < 4; ++var6) { + if (this.field_149816_M[var6] < var5) { + var5 = this.field_149816_M[var6]; + } + } + + for (var6 = 0; var6 < 4; ++var6) { + this.field_149814_b[var6] = this.field_149816_M[var6] == var5; + } + + return this.field_149814_b; + } + + private boolean func_149807_p(World p_149807_1_, int p_149807_2_, int p_149807_3_, int p_149807_4_) { + Block var5 = p_149807_1_.getBlock(p_149807_2_, p_149807_3_, p_149807_4_); + return var5 == Blocks.wooden_door || var5 == Blocks.iron_door || var5 == Blocks.standing_sign || var5 == Blocks.ladder || var5 == Blocks.reeds || (var5.blockMaterial == Material.Portal || var5.blockMaterial.blocksMovement()); + } + + protected int func_149810_a(World p_149810_1_, int p_149810_2_, int p_149810_3_, int p_149810_4_, int p_149810_5_) { + int var6 = this.func_149804_e(p_149810_1_, p_149810_2_, p_149810_3_, p_149810_4_); + + if (var6 < 0) { + return p_149810_5_; + } else { + if (var6 == 0) { + ++this.field_149815_a; + } + + if (var6 >= 8) { + var6 = 0; + } + + return p_149810_5_ >= 0 && var6 >= p_149810_5_ ? p_149810_5_ : var6; + } + } + + private boolean func_149809_q(World p_149809_1_, int p_149809_2_, int p_149809_3_, int p_149809_4_) { + Material var5 = p_149809_1_.getBlock(p_149809_2_, p_149809_3_, p_149809_4_).getMaterial(); + return var5 != this.blockMaterial && (var5 != Material.lava && !this.func_149807_p(p_149809_1_, p_149809_2_, p_149809_3_, p_149809_4_)); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + + if (p_149726_1_.getBlock(p_149726_2_, p_149726_3_, p_149726_4_) == this) { + p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, this.func_149738_a(p_149726_1_)); + } + } + + public boolean func_149698_L() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEnchantmentTable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEnchantmentTable.java new file mode 100644 index 0000000..371149d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEnchantmentTable.java @@ -0,0 +1,106 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockEnchantmentTable extends BlockContainer { + private IIcon field_149950_a; + private IIcon field_149949_b; + + + protected BlockEnchantmentTable() { + super(Material.rock); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_); + + for (int var6 = p_149734_2_ - 2; var6 <= p_149734_2_ + 2; ++var6) { + for (int var7 = p_149734_4_ - 2; var7 <= p_149734_4_ + 2; ++var7) { + if (var6 > p_149734_2_ - 2 && var6 < p_149734_2_ + 2 && var7 == p_149734_4_ - 1) { + var7 = p_149734_4_ + 2; + } + + if (p_149734_5_.nextInt(16) == 0) { + for (int var8 = p_149734_3_; var8 <= p_149734_3_ + 1; ++var8) { + if (p_149734_1_.getBlock(var6, var8, var7) == Blocks.bookshelf) { + if (!p_149734_1_.isAirBlock((var6 - p_149734_2_) / 2 + p_149734_2_, var8, (var7 - p_149734_4_) / 2 + p_149734_4_)) { + break; + } + + p_149734_1_.spawnParticle("enchantmenttable", (double)p_149734_2_ + 0.5D, (double)p_149734_3_ + 2.0D, (double)p_149734_4_ + 0.5D, (double)((float)(var6 - p_149734_2_) + p_149734_5_.nextFloat()) - 0.5D, (float)(var8 - p_149734_3_) - p_149734_5_.nextFloat() - 1.0F, (double)((float)(var7 - p_149734_4_) + p_149734_5_.nextFloat()) - 0.5D); + } + } + } + } + } + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 0 ? this.field_149949_b : (p_149691_1_ == 1 ? this.field_149950_a : this.blockIcon); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityEnchantmentTable(); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + TileEntityEnchantmentTable var10 = (TileEntityEnchantmentTable)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + p_149727_5_.displayGUIEnchantment(p_149727_2_, p_149727_3_, p_149727_4_, var10.func_145921_b() ? var10.func_145919_a() : null); + return true; + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + super.onBlockPlacedBy(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_, p_149689_6_); + + if (p_149689_6_.hasDisplayName()) { + ((TileEntityEnchantmentTable)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_)).func_145920_a(p_149689_6_.getDisplayName()); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_" + "side"); + this.field_149950_a = p_149651_1_.registerIcon(this.getTextureName() + "_" + "top"); + this.field_149949_b = p_149651_1_.registerIcon(this.getTextureName() + "_" + "bottom"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEndPortal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEndPortal.java new file mode 100644 index 0000000..0a56e7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEndPortal.java @@ -0,0 +1,106 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockEndPortal extends BlockContainer { + public static boolean field_149948_a; + + + protected BlockEndPortal(Material p_i45404_1_) { + super(p_i45404_1_); + this.setLightLevel(1.0F); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityEndPortal(); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + float var5 = 0.0625F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var5, 1.0F); + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return p_149646_5_ == 0 && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) {} + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + if (p_149670_5_.ridingEntity == null && p_149670_5_.riddenByEntity == null && !p_149670_1_.isClient) { + p_149670_5_.travelToDimension(1); + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + double var6 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + double var8 = (float)p_149734_3_ + 0.8F; + double var10 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + double var12 = 0.0D; + double var14 = 0.0D; + double var16 = 0.0D; + p_149734_1_.spawnParticle("smoke", var6, var8, var10, var12, var14, var16); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return -1; + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + if (!field_149948_a) { + if (p_149726_1_.provider.dimensionId != 0) { + p_149726_1_.setBlockToAir(p_149726_2_, p_149726_3_, p_149726_4_); + } + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemById(0); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("portal"); + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.field_151654_J; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEndPortalFrame.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEndPortalFrame.java new file mode 100644 index 0000000..028af6e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEndPortalFrame.java @@ -0,0 +1,98 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockEndPortalFrame extends Block { + private IIcon field_150023_a; + private IIcon field_150022_b; + + + public BlockEndPortalFrame() { + super(Material.rock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_150023_a : (p_149691_1_ == 0 ? Blocks.end_stone.getBlockTextureFromSide(p_149691_1_) : this.blockIcon); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_150023_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150022_b = p_149651_1_.registerIcon(this.getTextureName() + "_eye"); + } + + public IIcon func_150021_e() { + return this.field_150022_b; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 26; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + int var8 = p_149743_1_.getBlockMetadata(p_149743_2_, p_149743_3_, p_149743_4_); + + if (func_150020_b(var8)) { + this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + this.setBlockBoundsForItemRender(); + } + + public static boolean func_150020_b(int p_150020_0_) { + return (p_150020_0_ & 4) != 0; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + int var6 = p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_); + return func_150020_b(var6) ? 15 : 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEnderChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEnderChest.java new file mode 100644 index 0000000..6e299f9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEnderChest.java @@ -0,0 +1,139 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.InventoryEnderChest; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockEnderChest extends BlockContainer { + + + protected BlockEnderChest() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 22; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.obsidian); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 8; + } + + protected boolean canSilkHarvest() { + return true; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + byte var7 = 0; + int var8 = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var8 == 0) { + var7 = 2; + } + + if (var8 == 1) { + var7 = 5; + } + + if (var8 == 2) { + var7 = 3; + } + + if (var8 == 3) { + var7 = 4; + } + + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + InventoryEnderChest var10 = p_149727_5_.getInventoryEnderChest(); + TileEntityEnderChest var11 = (TileEntityEnderChest)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null && var11 != null) { + if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_ + 1, p_149727_4_).isNormalCube()) { + return true; + } else if (p_149727_1_.isClient) { + return true; + } else { + var10.func_146031_a(var11); + p_149727_5_.displayGUIChest(var10); + return true; + } + } else { + return true; + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityEnderChest(); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + for (int var6 = 0; var6 < 3; ++var6) { + double var10000 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + double var9 = (float)p_149734_3_ + p_149734_5_.nextFloat(); + var10000 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + double var13 = 0.0D; + double var15 = 0.0D; + double var17 = 0.0D; + int var19 = p_149734_5_.nextInt(2) * 2 - 1; + int var20 = p_149734_5_.nextInt(2) * 2 - 1; + var13 = ((double)p_149734_5_.nextFloat() - 0.5D) * 0.125D; + var15 = ((double)p_149734_5_.nextFloat() - 0.5D) * 0.125D; + var17 = ((double)p_149734_5_.nextFloat() - 0.5D) * 0.125D; + double var11 = (double)p_149734_4_ + 0.5D + 0.25D * (double)var20; + var17 = p_149734_5_.nextFloat() * 1.0F * (float)var20; + double var7 = (double)p_149734_2_ + 0.5D + 0.25D * (double)var19; + var13 = p_149734_5_.nextFloat() * 1.0F * (float)var19; + p_149734_1_.spawnParticle("portal", var7, var9, var11, var13, var15, var17); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("obsidian"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEventData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEventData.java new file mode 100644 index 0000000..a9f7b05 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockEventData.java @@ -0,0 +1,62 @@ +package net.minecraft.block; + +public class BlockEventData { + private final int coordX; + private final int coordY; + private final int coordZ; + private final Block field_151344_d; + + /** Different for each blockID */ + private final int eventID; + private final int eventParameter; + + + public BlockEventData(int p_i45362_1_, int p_i45362_2_, int p_i45362_3_, Block p_i45362_4_, int p_i45362_5_, int p_i45362_6_) { + this.coordX = p_i45362_1_; + this.coordY = p_i45362_2_; + this.coordZ = p_i45362_3_; + this.eventID = p_i45362_5_; + this.eventParameter = p_i45362_6_; + this.field_151344_d = p_i45362_4_; + } + + public int func_151340_a() { + return this.coordX; + } + + public int func_151342_b() { + return this.coordY; + } + + public int func_151341_c() { + return this.coordZ; + } + + /** + * Get the Event ID (different for each BlockID) + */ + public int getEventID() { + return this.eventID; + } + + public int getEventParameter() { + return this.eventParameter; + } + + public Block getBlock() { + return this.field_151344_d; + } + + public boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof BlockEventData)) { + return false; + } else { + BlockEventData var2 = (BlockEventData)p_equals_1_; + return this.coordX == var2.coordX && this.coordY == var2.coordY && this.coordZ == var2.coordZ && this.eventID == var2.eventID && this.eventParameter == var2.eventParameter && this.field_151344_d == var2.field_151344_d; + } + } + + public String toString() { + return "TE(" + this.coordX + "," + this.coordY + "," + this.coordZ + ")," + this.eventID + "," + this.eventParameter + "," + this.field_151344_d; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFalling.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFalling.java new file mode 100644 index 0000000..387f1b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFalling.java @@ -0,0 +1,84 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class BlockFalling extends Block { + public static boolean field_149832_M; + + + public BlockFalling() { + super(Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public BlockFalling(Material p_i45405_1_) { + super(p_i45405_1_); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, this.func_149738_a(p_149726_1_)); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.func_149738_a(p_149695_1_)); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + this.func_149830_m(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + } + + private void func_149830_m(World p_149830_1_, int p_149830_2_, int p_149830_3_, int p_149830_4_) { + if (func_149831_e(p_149830_1_, p_149830_2_, p_149830_3_ - 1, p_149830_4_) && p_149830_3_ >= 0) { + byte var8 = 32; + + if (!field_149832_M && p_149830_1_.checkChunksExist(p_149830_2_ - var8, p_149830_3_ - var8, p_149830_4_ - var8, p_149830_2_ + var8, p_149830_3_ + var8, p_149830_4_ + var8)) { + if (!p_149830_1_.isClient) { + EntityFallingBlock var9 = new EntityFallingBlock(p_149830_1_, (float)p_149830_2_ + 0.5F, (float)p_149830_3_ + 0.5F, (float)p_149830_4_ + 0.5F, this, p_149830_1_.getBlockMetadata(p_149830_2_, p_149830_3_, p_149830_4_)); + this.func_149829_a(var9); + p_149830_1_.spawnEntityInWorld(var9); + } + } else { + p_149830_1_.setBlockToAir(p_149830_2_, p_149830_3_, p_149830_4_); + + while (func_149831_e(p_149830_1_, p_149830_2_, p_149830_3_ - 1, p_149830_4_) && p_149830_3_ > 0) { + --p_149830_3_; + } + + if (p_149830_3_ > 0) { + p_149830_1_.setBlock(p_149830_2_, p_149830_3_, p_149830_4_, this); + } + } + } + } + + protected void func_149829_a(EntityFallingBlock p_149829_1_) {} + + public int func_149738_a(World p_149738_1_) { + return 2; + } + + public static boolean func_149831_e(World p_149831_0_, int p_149831_1_, int p_149831_2_, int p_149831_3_) { + Block var4 = p_149831_0_.getBlock(p_149831_1_, p_149831_2_, p_149831_3_); + + if (var4.blockMaterial == Material.air) { + return true; + } else if (var4 == Blocks.fire) { + return true; + } else { + Material var5 = var4.blockMaterial; + return var5 == Material.water || var5 == Material.lava; + } + } + + public void func_149828_a(World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFarmland.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFarmland.java new file mode 100644 index 0000000..77c01fb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFarmland.java @@ -0,0 +1,133 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockFarmland extends Block { + private IIcon field_149824_a; + private IIcon field_149823_b; + + + protected BlockFarmland() { + super(Material.ground); + this.setTickRandomly(true); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F); + this.setLightOpacity(255); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return AxisAlignedBB.getBoundingBox(p_149668_2_ + 0, p_149668_3_ + 0, p_149668_4_ + 0, p_149668_2_ + 1, p_149668_3_ + 1, p_149668_4_ + 1); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? (p_149691_2_ > 0 ? this.field_149824_a : this.field_149823_b) : Blocks.dirt.getBlockTextureFromSide(p_149691_1_); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!this.func_149821_m(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_) && !p_149674_1_.canLightningStrikeAt(p_149674_2_, p_149674_3_ + 1, p_149674_4_)) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var6 > 0) { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var6 - 1, 2); + } else if (!this.func_149822_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); + } + } else { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, 7, 2); + } + } + + /** + * Block's chance to react to an entity falling on it. + */ + public void onFallenUpon(World p_149746_1_, int p_149746_2_, int p_149746_3_, int p_149746_4_, Entity p_149746_5_, float p_149746_6_) { + if (!p_149746_1_.isClient && p_149746_1_.rand.nextFloat() < p_149746_6_ - 0.5F) { + if (!(p_149746_5_ instanceof EntityPlayer) && !p_149746_1_.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + return; + } + + p_149746_1_.setBlock(p_149746_2_, p_149746_3_, p_149746_4_, Blocks.dirt); + } + } + + private boolean func_149822_e(World p_149822_1_, int p_149822_2_, int p_149822_3_, int p_149822_4_) { + byte var5 = 0; + + for (int var6 = p_149822_2_ - var5; var6 <= p_149822_2_ + var5; ++var6) { + for (int var7 = p_149822_4_ - var5; var7 <= p_149822_4_ + var5; ++var7) { + Block var8 = p_149822_1_.getBlock(var6, p_149822_3_ + 1, var7); + + if (var8 == Blocks.wheat || var8 == Blocks.melon_stem || var8 == Blocks.pumpkin_stem || var8 == Blocks.potatoes || var8 == Blocks.carrots) { + return true; + } + } + } + + return false; + } + + private boolean func_149821_m(World p_149821_1_, int p_149821_2_, int p_149821_3_, int p_149821_4_) { + for (int var5 = p_149821_2_ - 4; var5 <= p_149821_2_ + 4; ++var5) { + for (int var6 = p_149821_3_; var6 <= p_149821_3_ + 1; ++var6) { + for (int var7 = p_149821_4_ - 4; var7 <= p_149821_4_ + 4; ++var7) { + if (p_149821_1_.getBlock(var5, var6, var7).getMaterial() == Material.water) { + return true; + } + } + } + } + + return false; + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + Material var6 = p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_).getMaterial(); + + if (var6.isSolid()) { + p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, Blocks.dirt); + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemFromBlock(Blocks.dirt); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149824_a = p_149651_1_.registerIcon(this.getTextureName() + "_wet"); + this.field_149823_b = p_149651_1_.registerIcon(this.getTextureName() + "_dry"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFence.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFence.java new file mode 100644 index 0000000..cae76ef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFence.java @@ -0,0 +1,146 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemLead; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFence extends Block { + private final String field_149827_a; + + + public BlockFence(String p_i45406_1_, Material p_i45406_2_) { + super(p_i45406_2_); + this.field_149827_a = p_i45406_1_; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + boolean var8 = this.func_149826_e(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1); + boolean var9 = this.func_149826_e(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1); + boolean var10 = this.func_149826_e(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_); + boolean var11 = this.func_149826_e(p_149743_1_, p_149743_2_ + 1, p_149743_3_, p_149743_4_); + float var12 = 0.375F; + float var13 = 0.625F; + float var14 = 0.375F; + float var15 = 0.625F; + + if (var8) { + var14 = 0.0F; + } + + if (var9) { + var15 = 1.0F; + } + + if (var8 || var9) { + this.setBlockBounds(var12, 0.0F, var14, var13, 1.5F, var15); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + var14 = 0.375F; + var15 = 0.625F; + + if (var10) { + var12 = 0.0F; + } + + if (var11) { + var13 = 1.0F; + } + + if (var10 || var11 || !var8 && !var9) { + this.setBlockBounds(var12, 0.0F, var14, var13, 1.5F, var15); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + if (var8) { + var14 = 0.0F; + } + + if (var9) { + var15 = 1.0F; + } + + this.setBlockBounds(var12, 0.0F, var14, var13, 1.0F, var15); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + boolean var5 = this.func_149826_e(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1); + boolean var6 = this.func_149826_e(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1); + boolean var7 = this.func_149826_e(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_); + boolean var8 = this.func_149826_e(p_149719_1_, p_149719_2_ + 1, p_149719_3_, p_149719_4_); + float var9 = 0.375F; + float var10 = 0.625F; + float var11 = 0.375F; + float var12 = 0.625F; + + if (var5) { + var11 = 0.0F; + } + + if (var6) { + var12 = 1.0F; + } + + if (var7) { + var9 = 0.0F; + } + + if (var8) { + var10 = 1.0F; + } + + this.setBlockBounds(var9, 0.0F, var11, var10, 1.0F, var12); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 11; + } + + public boolean func_149826_e(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_) { + Block var5 = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_); + return var5 == this || var5 == Blocks.fence_gate || (var5.blockMaterial.isOpaque() && var5.renderAsNormalBlock() && var5.blockMaterial != Material.field_151572_C); + } + + public static boolean func_149825_a(Block p_149825_0_) { + return p_149825_0_ == Blocks.fence || p_149825_0_ == Blocks.nether_brick_fence; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return true; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.field_149827_a); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + return p_149727_1_.isClient || ItemLead.func_150909_a(p_149727_5_, p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFenceGate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFenceGate.java new file mode 100644 index 0000000..b00b99f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFenceGate.java @@ -0,0 +1,133 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFenceGate extends BlockDirectional { + + + public BlockFenceGate() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return Blocks.planks.getBlockTextureFromSide(p_149691_1_); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_).getMaterial().isSolid() && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + int var5 = p_149668_1_.getBlockMetadata(p_149668_2_, p_149668_3_, p_149668_4_); + return isFenceGateOpen(var5) ? null : (var5 != 2 && var5 != 0 ? AxisAlignedBB.getBoundingBox((float)p_149668_2_ + 0.375F, p_149668_3_, p_149668_4_, (float)p_149668_2_ + 0.625F, (float)p_149668_3_ + 1.5F, p_149668_4_ + 1) : AxisAlignedBB.getBoundingBox(p_149668_2_, p_149668_3_, (float)p_149668_4_ + 0.375F, p_149668_2_ + 1, (float)p_149668_3_ + 1.5F, (float)p_149668_4_ + 0.625F)); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = func_149895_l(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_)); + + if (var5 != 2 && var5 != 0) { + this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F); + } + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return isFenceGateOpen(p_149655_1_.getBlockMetadata(p_149655_2_, p_149655_3_, p_149655_4_)); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 21; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = (MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + int var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + + if (isFenceGateOpen(var10)) { + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var10 & -5, 2); + } else { + int var11 = (MathHelper.floor_double((double)(p_149727_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; + int var12 = func_149895_l(var10); + + if (var12 == (var11 + 2) % 4) { + var10 = var11; + } + + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var10 | 4, 2); + } + + p_149727_1_.playAuxSFXAtEntity(p_149727_5_, 1003, p_149727_2_, p_149727_3_, p_149727_4_, 0); + return true; + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + boolean var7 = p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_); + + if (var7 || p_149695_5_.canProvidePower()) { + if (var7 && !isFenceGateOpen(var6)) { + p_149695_1_.setBlockMetadataWithNotify(p_149695_2_, p_149695_3_, p_149695_4_, var6 | 4, 2); + p_149695_1_.playAuxSFXAtEntity(null, 1003, p_149695_2_, p_149695_3_, p_149695_4_, 0); + } else if (!var7 && isFenceGateOpen(var6)) { + p_149695_1_.setBlockMetadataWithNotify(p_149695_2_, p_149695_3_, p_149695_4_, var6 & -5, 2); + p_149695_1_.playAuxSFXAtEntity(null, 1003, p_149695_2_, p_149695_3_, p_149695_4_, 0); + } + } + } + } + + /** + * Returns if the fence gate is open according to its metadata. + */ + public static boolean isFenceGateOpen(int p_149896_0_) { + return (p_149896_0_ & 4) != 0; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return true; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFire.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFire.java new file mode 100644 index 0000000..c3e9574 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFire.java @@ -0,0 +1,343 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderEnd; + +public class BlockFire extends Block { + private final int[] field_149849_a = new int[256]; + private final int[] field_149848_b = new int[256]; + private IIcon[] field_149850_M; + + + protected BlockFire() { + super(Material.fire); + this.setTickRandomly(true); + } + + public static void func_149843_e() { + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.planks), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.double_wooden_slab), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.wooden_slab), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.fence), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.oak_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.birch_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.spruce_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.jungle_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.log), 5, 5); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.log2), 5, 5); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.leaves), 30, 60); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.leaves2), 30, 60); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.bookshelf), 30, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.tnt), 15, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.tallgrass), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.double_plant), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.yellow_flower), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.red_flower), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.wool), 30, 60); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.vine), 15, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.coal_block), 5, 5); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.hay_block), 60, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.carpet), 60, 20); + } + + public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_) { + this.field_149849_a[p_149842_1_] = p_149842_2_; + this.field_149848_b[p_149842_1_] = p_149842_3_; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 3; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + public int func_149738_a(World p_149738_1_) { + return 30; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (p_149674_1_.getGameRules().getGameRuleBooleanValue("doFireTick")) { + boolean var6 = p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.netherrack; + + if (p_149674_1_.provider instanceof WorldProviderEnd && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.bedrock) { + var6 = true; + } + + if (!this.canPlaceBlockAt(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + + if (!var6 && p_149674_1_.isRaining() && (p_149674_1_.canLightningStrikeAt(p_149674_2_, p_149674_3_, p_149674_4_) || p_149674_1_.canLightningStrikeAt(p_149674_2_ - 1, p_149674_3_, p_149674_4_) || p_149674_1_.canLightningStrikeAt(p_149674_2_ + 1, p_149674_3_, p_149674_4_) || p_149674_1_.canLightningStrikeAt(p_149674_2_, p_149674_3_, p_149674_4_ - 1) || p_149674_1_.canLightningStrikeAt(p_149674_2_, p_149674_3_, p_149674_4_ + 1))) { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } else { + int var7 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var7 < 15) { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var7 + p_149674_5_.nextInt(3) / 2, 4); + } + + p_149674_1_.scheduleBlockUpdate(p_149674_2_, p_149674_3_, p_149674_4_, this, this.func_149738_a(p_149674_1_) + p_149674_5_.nextInt(10)); + + if (!var6 && !this.func_149847_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { + if (!World.doesBlockHaveSolidTopSurface(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) || var7 > 3) { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + } else if (!var6 && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && var7 == 15 && p_149674_5_.nextInt(4) == 0) { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } else { + boolean var8 = p_149674_1_.isBlockHighHumidity(p_149674_2_, p_149674_3_, p_149674_4_); + byte var9 = 0; + + if (var8) { + var9 = -50; + } + + this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + var9, p_149674_5_, var7); + this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + var9, p_149674_5_, var7); + this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + var9, p_149674_5_, var7); + this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + var9, p_149674_5_, var7); + this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + var9, p_149674_5_, var7); + this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + var9, p_149674_5_, var7); + + for (int var10 = p_149674_2_ - 1; var10 <= p_149674_2_ + 1; ++var10) { + for (int var11 = p_149674_4_ - 1; var11 <= p_149674_4_ + 1; ++var11) { + for (int var12 = p_149674_3_ - 1; var12 <= p_149674_3_ + 4; ++var12) { + if (var10 != p_149674_2_ || var12 != p_149674_3_ || var11 != p_149674_4_) { + int var13 = 100; + + if (var12 > p_149674_3_ + 1) { + var13 += (var12 - (p_149674_3_ + 1)) * 100; + } + + int var14 = this.func_149845_m(p_149674_1_, var10, var12, var11); + + if (var14 > 0) { + int var15 = (var14 + 40 + p_149674_1_.difficultySetting.getDifficultyId() * 7) / (var7 + 30); + + if (var8) { + var15 /= 2; + } + + if (var15 > 0 && p_149674_5_.nextInt(var13) <= var15 && (!p_149674_1_.isRaining() || !p_149674_1_.canLightningStrikeAt(var10, var12, var11)) && !p_149674_1_.canLightningStrikeAt(var10 - 1, var12, p_149674_4_) && !p_149674_1_.canLightningStrikeAt(var10 + 1, var12, var11) && !p_149674_1_.canLightningStrikeAt(var10, var12, var11 - 1) && !p_149674_1_.canLightningStrikeAt(var10, var12, var11 + 1)) { + int var16 = var7 + p_149674_5_.nextInt(5) / 4; + + if (var16 > 15) + { + var16 = 15; + } + + p_149674_1_.setBlock(var10, var12, var11, this, var16, 3); + } + } + } + } + } + } + } + } + } + } + + public boolean func_149698_L() { + return false; + } + + private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_) { + int var8 = this.field_149848_b[Block.getIdFromBlock(p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_))]; + + if (p_149841_6_.nextInt(p_149841_5_) < var8) { + boolean var9 = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt; + + if (p_149841_6_.nextInt(p_149841_7_ + 10) < 5 && !p_149841_1_.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) { + int var10 = p_149841_7_ + p_149841_6_.nextInt(5) / 4; + + if (var10 > 15) { + var10 = 15; + } + + p_149841_1_.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, this, var10, 3); + } else { + p_149841_1_.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_); + } + + if (var9) { + Blocks.tnt.onBlockDestroyedByPlayer(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, 1); + } + } + } + + private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) { + return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) || (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) || (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) || (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) || (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) || this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1))))); + } + + private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_) { + byte var5 = 0; + + if (!p_149845_1_.isAirBlock(p_149845_2_, p_149845_3_, p_149845_4_)) { + return 0; + } else { + int var6 = this.func_149846_a(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, var5); + var6 = this.func_149846_a(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, var6); + var6 = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, var6); + var6 = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, var6); + var6 = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, var6); + var6 = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, var6); + return var6; + } + } + + public boolean isCollidable() { + return false; + } + + public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) { + return this.field_149849_a[Block.getIdFromBlock(p_149844_1_.getBlock(p_149844_2_, p_149844_3_, p_149844_4_))] > 0; + } + + public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) { + int var6 = this.field_149849_a[Block.getIdFromBlock(p_149846_1_.getBlock(p_149846_2_, p_149846_3_, p_149846_4_))]; + return var6 > p_149846_5_ ? var6 : p_149846_5_; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) || this.func_149847_e(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && !this.func_149847_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + if (p_149726_1_.provider.dimensionId > 0 || !Blocks.portal.func_150000_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_)) { + if (!World.doesBlockHaveSolidTopSurface(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_) && !this.func_149847_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_)) { + p_149726_1_.setBlockToAir(p_149726_2_, p_149726_3_, p_149726_4_); + } else { + p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, this.func_149738_a(p_149726_1_) + p_149726_1_.rand.nextInt(10)); + } + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + if (p_149734_5_.nextInt(24) == 0) { + p_149734_1_.playSound((float)p_149734_2_ + 0.5F, (float)p_149734_3_ + 0.5F, (float)p_149734_4_ + 0.5F, "fire.fire", 1.0F + p_149734_5_.nextFloat(), p_149734_5_.nextFloat() * 0.7F + 0.3F, false); + } + + int var6; + float var7; + float var8; + float var9; + + if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)) { + if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_)) { + for (var6 = 0; var6 < 2; ++var6) { + var7 = (float)p_149734_2_ + p_149734_5_.nextFloat() * 0.1F; + var8 = (float)p_149734_3_ + p_149734_5_.nextFloat(); + var9 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_)) { + for (var6 = 0; var6 < 2; ++var6) { + var7 = (float)(p_149734_2_ + 1) - p_149734_5_.nextFloat() * 0.1F; + var8 = (float)p_149734_3_ + p_149734_5_.nextFloat(); + var9 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1)) { + for (var6 = 0; var6 < 2; ++var6) { + var7 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + var8 = (float)p_149734_3_ + p_149734_5_.nextFloat(); + var9 = (float)p_149734_4_ + p_149734_5_.nextFloat() * 0.1F; + p_149734_1_.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1)) { + for (var6 = 0; var6 < 2; ++var6) { + var7 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + var8 = (float)p_149734_3_ + p_149734_5_.nextFloat(); + var9 = (float)(p_149734_4_ + 1) - p_149734_5_.nextFloat() * 0.1F; + p_149734_1_.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_)) { + for (var6 = 0; var6 < 2; ++var6) { + var7 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + var8 = (float)(p_149734_3_ + 1) - p_149734_5_.nextFloat() * 0.1F; + var9 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); + } + } + } else { + for (var6 = 0; var6 < 3; ++var6) { + var7 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + var8 = (float)p_149734_3_ + p_149734_5_.nextFloat() * 0.5F + 0.5F; + var9 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); + } + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149850_M = new IIcon[] {p_149651_1_.registerIcon(this.getTextureName() + "_layer_0"), p_149651_1_.registerIcon(this.getTextureName() + "_layer_1")}; + } + + public IIcon func_149840_c(int p_149840_1_) { + return this.field_149850_M[p_149840_1_]; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return this.field_149850_M[0]; + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.field_151656_f; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFlower.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFlower.java new file mode 100644 index 0000000..f2e0d1b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFlower.java @@ -0,0 +1,102 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockFlower extends BlockBush { + private static final String[][] field_149860_M = new String[][] {{"flower_dandelion"}, {"flower_rose", "flower_blue_orchid", "flower_allium", "flower_houstonia", "flower_tulip_red", "flower_tulip_orange", "flower_tulip_white", "flower_tulip_pink", "flower_oxeye_daisy"}}; + public static final String[] field_149859_a = new String[] {"poppy", "blueOrchid", "allium", "houstonia", "tulipRed", "tulipOrange", "tulipWhite", "tulipPink", "oxeyeDaisy"}; + public static final String[] field_149858_b = new String[] {"dandelion"}; + private IIcon[] field_149861_N; + private final int field_149862_O; + + + protected BlockFlower(int p_i2173_1_) { + super(Material.plants); + this.field_149862_O = p_i2173_1_; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ >= this.field_149861_N.length) { + p_149691_2_ = 0; + } + + return this.field_149861_N[p_149691_2_]; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149861_N = new IIcon[field_149860_M[this.field_149862_O].length]; + + for (int var2 = 0; var2 < this.field_149861_N.length; ++var2) { + this.field_149861_N[var2] = p_149651_1_.registerIcon(field_149860_M[this.field_149862_O][var2]); + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < this.field_149861_N.length; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + public static BlockFlower func_149857_e(String p_149857_0_) { + String[] var1 = field_149858_b; + int var2 = var1.length; + int var3; + String var4; + + for (var3 = 0; var3 < var2; ++var3) { + var4 = var1[var3]; + + if (var4.equals(p_149857_0_)) { + return Blocks.yellow_flower; + } + } + + var1 = field_149859_a; + var2 = var1.length; + + for (var3 = 0; var3 < var2; ++var3) { + var4 = var1[var3]; + + if (var4.equals(p_149857_0_)) { + return Blocks.red_flower; + } + } + + return null; + } + + public static int func_149856_f(String p_149856_0_) { + int var1; + + for (var1 = 0; var1 < field_149858_b.length; ++var1) { + if (field_149858_b[var1].equals(p_149856_0_)) { + return var1; + } + } + + for (var1 = 0; var1 < field_149859_a.length; ++var1) { + if (field_149859_a[var1].equals(p_149856_0_)) { + return var1; + } + } + + return 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFlowerPot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFlowerPot.java new file mode 100644 index 0000000..f4ac56e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFlowerPot.java @@ -0,0 +1,229 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.world.World; + +public class BlockFlowerPot extends BlockContainer { + + + public BlockFlowerPot() { + super(Material.circuits); + this.setBlockBoundsForItemRender(); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float var1 = 0.375F; + float var2 = var1 / 2.0F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 33; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + ItemStack var10 = p_149727_5_.inventory.getCurrentItem(); + + if (var10 != null && var10.getItem() instanceof ItemBlock) { + TileEntityFlowerPot var11 = this.func_149929_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + + if (var11 != null) { + if (var11.func_145965_a() != null) { + return false; + } else { + Block var12 = Block.getBlockFromItem(var10.getItem()); + + if (!this.func_149928_a(var12, var10.getItemDamage())) { + return false; + } else { + var11.func_145964_a(var10.getItem(), var10.getItemDamage()); + var11.onInventoryChanged(); + + if (!p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var10.getItemDamage(), 2)) { + p_149727_1_.func_147471_g(p_149727_2_, p_149727_3_, p_149727_4_); + } + + if (!p_149727_5_.capabilities.isCreativeMode && --var10.stackSize <= 0) { + p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, null); + } + + return true; + } + } + } else { + return false; + } + } else { + return false; + } + } + + private boolean func_149928_a(Block p_149928_1_, int p_149928_2_) { + return p_149928_1_ == Blocks.yellow_flower || p_149928_1_ == Blocks.red_flower || p_149928_1_ == Blocks.cactus || p_149928_1_ == Blocks.brown_mushroom || p_149928_1_ == Blocks.red_mushroom || p_149928_1_ == Blocks.sapling || p_149928_1_ == Blocks.deadbush || p_149928_1_ == Blocks.tallgrass && p_149928_2_ == 2; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + TileEntityFlowerPot var5 = this.func_149929_e(p_149694_1_, p_149694_2_, p_149694_3_, p_149694_4_); + return var5 != null && var5.func_145965_a() != null ? var5.func_145965_a() : Items.flower_pot; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + TileEntityFlowerPot var5 = this.func_149929_e(p_149643_1_, p_149643_2_, p_149643_3_, p_149643_4_); + return var5 != null && var5.func_145965_a() != null ? var5.func_145966_b() : 0; + } + + /** + * Returns true only if block is flowerPot + */ + public boolean isFlowerPot() { + return true; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_)) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + TileEntityFlowerPot var7 = this.func_149929_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_); + + if (var7 != null && var7.func_145965_a() != null) { + this.dropBlockAsItem_do(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, new ItemStack(var7.func_145965_a(), 1, var7.func_145966_b())); + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + + if (p_149681_6_.capabilities.isCreativeMode) { + TileEntityFlowerPot var7 = this.func_149929_e(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_); + + if (var7 != null) { + var7.func_145964_a(Item.getItemById(0), 0); + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.flower_pot; + } + + private TileEntityFlowerPot func_149929_e(World p_149929_1_, int p_149929_2_, int p_149929_3_, int p_149929_4_) { + TileEntity var5 = p_149929_1_.getTileEntity(p_149929_2_, p_149929_3_, p_149929_4_); + return var5 != null && var5 instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)var5 : null; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + Object var3 = null; + byte var4 = 0; + + switch (p_149915_2_) { + case 1: + var3 = Blocks.red_flower; + var4 = 0; + break; + + case 2: + var3 = Blocks.yellow_flower; + break; + + case 3: + var3 = Blocks.sapling; + var4 = 0; + break; + + case 4: + var3 = Blocks.sapling; + var4 = 1; + break; + + case 5: + var3 = Blocks.sapling; + var4 = 2; + break; + + case 6: + var3 = Blocks.sapling; + var4 = 3; + break; + + case 7: + var3 = Blocks.red_mushroom; + break; + + case 8: + var3 = Blocks.brown_mushroom; + break; + + case 9: + var3 = Blocks.cactus; + break; + + case 10: + var3 = Blocks.deadbush; + break; + + case 11: + var3 = Blocks.tallgrass; + var4 = 2; + break; + + case 12: + var3 = Blocks.sapling; + var4 = 4; + break; + + case 13: + var3 = Blocks.sapling; + var4 = 5; + } + + return new TileEntityFlowerPot(Item.getItemFromBlock((Block)var3), var4); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFurnace.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFurnace.java new file mode 100644 index 0000000..6a310fe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockFurnace.java @@ -0,0 +1,240 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockFurnace extends BlockContainer { + private final Random field_149933_a = new Random(); + private final boolean field_149932_b; + private static boolean field_149934_M; + private IIcon field_149935_N; + private IIcon field_149936_O; + + + protected BlockFurnace(boolean p_i45407_1_) { + super(Material.rock); + this.field_149932_b = p_i45407_1_; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.furnace); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + this.func_149930_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + private void func_149930_e(World p_149930_1_, int p_149930_2_, int p_149930_3_, int p_149930_4_) { + if (!p_149930_1_.isClient) { + Block var5 = p_149930_1_.getBlock(p_149930_2_, p_149930_3_, p_149930_4_ - 1); + Block var6 = p_149930_1_.getBlock(p_149930_2_, p_149930_3_, p_149930_4_ + 1); + Block var7 = p_149930_1_.getBlock(p_149930_2_ - 1, p_149930_3_, p_149930_4_); + Block var8 = p_149930_1_.getBlock(p_149930_2_ + 1, p_149930_3_, p_149930_4_); + byte var9 = 3; + + if (var5.func_149730_j() && !var6.func_149730_j()) { + var9 = 3; + } + + if (var6.func_149730_j() && !var5.func_149730_j()) { + var9 = 2; + } + + if (var7.func_149730_j() && !var8.func_149730_j()) { + var9 = 5; + } + + if (var8.func_149730_j() && !var7.func_149730_j()) { + var9 = 4; + } + + p_149930_1_.setBlockMetadataWithNotify(p_149930_2_, p_149930_3_, p_149930_4_, var9, 2); + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_149935_N : (p_149691_1_ == 0 ? this.field_149935_N : (p_149691_1_ != p_149691_2_ ? this.blockIcon : this.field_149936_O)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("furnace_side"); + this.field_149936_O = p_149651_1_.registerIcon(this.field_149932_b ? "furnace_front_on" : "furnace_front_off"); + this.field_149935_N = p_149651_1_.registerIcon("furnace_top"); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + if (this.field_149932_b) { + int var6 = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + float var7 = (float)p_149734_2_ + 0.5F; + float var8 = (float)p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float var9 = (float)p_149734_4_ + 0.5F; + float var10 = 0.52F; + float var11 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + if (var6 == 4) { + p_149734_1_.spawnParticle("smoke", var7 - var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7 - var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D); + } else if (var6 == 5) { + p_149734_1_.spawnParticle("smoke", var7 + var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7 + var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D); + } else if (var6 == 2) { + p_149734_1_.spawnParticle("smoke", var7 + var11, var8, var9 - var10, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7 + var11, var8, var9 - var10, 0.0D, 0.0D, 0.0D); + } else if (var6 == 3) { + p_149734_1_.spawnParticle("smoke", var7 + var11, var8, var9 + var10, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7 + var11, var8, var9 + var10, 0.0D, 0.0D, 0.0D); + } + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + TileEntityFurnace var10 = (TileEntityFurnace)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + p_149727_5_.func_146101_a(var10); + } + + return true; + } + } + + public static void func_149931_a(boolean p_149931_0_, World p_149931_1_, int p_149931_2_, int p_149931_3_, int p_149931_4_) { + int var5 = p_149931_1_.getBlockMetadata(p_149931_2_, p_149931_3_, p_149931_4_); + TileEntity var6 = p_149931_1_.getTileEntity(p_149931_2_, p_149931_3_, p_149931_4_); + field_149934_M = true; + + if (p_149931_0_) { + p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.lit_furnace); + } else { + p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.furnace); + } + + field_149934_M = false; + p_149931_1_.setBlockMetadataWithNotify(p_149931_2_, p_149931_3_, p_149931_4_, var5, 2); + + if (var6 != null) { + var6.validate(); + p_149931_1_.setTileEntity(p_149931_2_, p_149931_3_, p_149931_4_, var6); + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityFurnace(); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var7 == 0) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 2, 2); + } + + if (var7 == 1) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 5, 2); + } + + if (var7 == 2) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 3, 2); + } + + if (var7 == 3) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 4, 2); + } + + if (p_149689_6_.hasDisplayName()) { + ((TileEntityFurnace)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_)).func_145951_a(p_149689_6_.getDisplayName()); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + if (!field_149934_M) { + TileEntityFurnace var7 = (TileEntityFurnace)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var7 != null) { + for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); + + if (var9 != null) { + float var10 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float var11 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float var12 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + + while (var9.stackSize > 0) { + int var13 = this.field_149933_a.nextInt(21) + 10; + + if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; + EntityItem var14 = new EntityItem(p_149749_1_, (float)p_149749_2_ + var10, (float)p_149749_3_ + var11, (float)p_149749_4_ + var12, new ItemStack(var9.getItem(), var13, var9.getItemDamage())); + + if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + + float var15 = 0.05F; + var14.motionX = (float)this.field_149933_a.nextGaussian() * var15; + var14.motionY = (float)this.field_149933_a.nextGaussian() * var15 + 0.2F; + var14.motionZ = (float)this.field_149933_a.nextGaussian() * var15; + p_149749_1_.spawnEntityInWorld(var14); + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + return Container.calcRedstoneFromInventory((IInventory)p_149736_1_.getTileEntity(p_149736_2_, p_149736_3_, p_149736_4_)); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemFromBlock(Blocks.furnace); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGlass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGlass.java new file mode 100644 index 0000000..e556770 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGlass.java @@ -0,0 +1,36 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockGlass extends BlockBreakable { + + + public BlockGlass(Material p_i45408_1_, boolean p_i45408_2_) { + super("glass", p_i45408_1_, p_i45408_2_); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return 0; + } + + public boolean renderAsNormalBlock() { + return false; + } + + protected boolean canSilkHarvest() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGlowstone.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGlowstone.java new file mode 100644 index 0000000..66f8b88 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGlowstone.java @@ -0,0 +1,40 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.MathHelper; + +public class BlockGlowstone extends Block { + + + public BlockGlowstone(Material p_i45409_1_) { + super(p_i45409_1_); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int p_149679_1_, Random p_149679_2_) { + return MathHelper.clamp_int(this.quantityDropped(p_149679_2_) + p_149679_2_.nextInt(p_149679_1_ + 1), 1, 4); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 2 + p_149745_1_.nextInt(3); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.glowstone_dust; + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.field_151658_d; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGrass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGrass.java new file mode 100644 index 0000000..c6c6d1a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGrass.java @@ -0,0 +1,167 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class BlockGrass extends Block implements IGrowable { + private static final Logger logger = LogManager.getLogger(); + private IIcon field_149991_b; + private IIcon field_149993_M; + private IIcon field_149994_N; + + + protected BlockGrass() { + super(Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_149991_b : (p_149691_1_ == 0 ? Blocks.dirt.getBlockTextureFromSide(p_149691_1_) : this.blockIcon); + } + + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + if (p_149673_5_ == 1) { + return this.field_149991_b; + } else if (p_149673_5_ == 0) { + return Blocks.dirt.getBlockTextureFromSide(p_149673_5_); + } else { + Material var6 = p_149673_1_.getBlock(p_149673_2_, p_149673_3_ + 1, p_149673_4_).getMaterial(); + return var6 != Material.field_151597_y && var6 != Material.craftedSnow ? this.blockIcon : this.field_149993_M; + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_149991_b = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_149993_M = p_149651_1_.registerIcon(this.getTextureName() + "_side_snowed"); + this.field_149994_N = p_149651_1_.registerIcon(this.getTextureName() + "_side_overlay"); + } + + public int getBlockColor() { + double var1 = 0.5D; + double var3 = 1.0D; + return ColorizerGrass.getGrassColor(var1, var3); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + return this.getBlockColor(); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + int var5 = 0; + int var6 = 0; + int var7 = 0; + + for (int var8 = -1; var8 <= 1; ++var8) { + for (int var9 = -1; var9 <= 1; ++var9) { + int var10 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + var9, p_149720_4_ + var8).getBiomeGrassColor(p_149720_2_ + var9, p_149720_3_, p_149720_4_ + var8); + var5 += (var10 & 16711680) >> 16; + var6 += (var10 & 65280) >> 8; + var7 += var10 & 255; + } + } + + return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_).getLightOpacity() > 2) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); + } else if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9) { + for (int var6 = 0; var6 < 4; ++var6) { + int var7 = p_149674_2_ + p_149674_5_.nextInt(3) - 1; + int var8 = p_149674_3_ + p_149674_5_.nextInt(5) - 3; + int var9 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; + Block var10 = p_149674_1_.getBlock(var7, var8 + 1, var9); + + if (p_149674_1_.getBlock(var7, var8, var9) == Blocks.dirt && p_149674_1_.getBlockMetadata(var7, var8, var9) == 0 && p_149674_1_.getBlockLightValue(var7, var8 + 1, var9) >= 4 && var10.getLightOpacity() <= 2) { + p_149674_1_.setBlock(var7, var8, var9, Blocks.grass); + } + } + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_); + } + + public static IIcon func_149990_e() { + return Blocks.grass.field_149994_N; + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + return true; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + int var6 = 0; + + while (var6 < 128) { + int var7 = p_149853_3_; + int var8 = p_149853_4_ + 1; + int var9 = p_149853_5_; + int var10 = 0; + + while (true) { + if (var10 < var6 / 16) { + var7 += p_149853_2_.nextInt(3) - 1; + var8 += (p_149853_2_.nextInt(3) - 1) * p_149853_2_.nextInt(3) / 2; + var9 += p_149853_2_.nextInt(3) - 1; + + if (p_149853_1_.getBlock(var7, var8 - 1, var9) == Blocks.grass && !p_149853_1_.getBlock(var7, var8, var9).isNormalCube()) { + ++var10; + continue; + } + } else if (p_149853_1_.getBlock(var7, var8, var9).blockMaterial == Material.air) { + if (p_149853_2_.nextInt(8) != 0) { + if (Blocks.tallgrass.canBlockStay(p_149853_1_, var7, var8, var9)) { + p_149853_1_.setBlock(var7, var8, var9, Blocks.tallgrass, 1, 3); + } + } else { + String var13 = p_149853_1_.getBiomeGenForCoords(var7, var9).func_150572_a(p_149853_2_, var7, var8, var9); + logger.debug("Flower in " + p_149853_1_.getBiomeGenForCoords(var7, var9).biomeName + ": " + var13); + BlockFlower var11 = BlockFlower.func_149857_e(var13); + + if (var11 != null && var11.canBlockStay(p_149853_1_, var7, var8, var9)) { + int var12 = BlockFlower.func_149856_f(var13); + p_149853_1_.setBlock(var7, var8, var9, var11, var12, 3); + } + } + } + + ++var6; + break; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGravel.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGravel.java new file mode 100644 index 0000000..ce4d7c6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockGravel.java @@ -0,0 +1,17 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockGravel extends BlockFalling { + + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + if (p_149650_3_ > 3) { + p_149650_3_ = 3; + } + + return p_149650_2_.nextInt(10 - p_149650_3_ * 3) == 0 ? Items.flint : Item.getItemFromBlock(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHardenedClay.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHardenedClay.java new file mode 100644 index 0000000..433a752 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHardenedClay.java @@ -0,0 +1,18 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockHardenedClay extends Block { + + + public BlockHardenedClay() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.field_151676_q; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHay.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHay.java new file mode 100644 index 0000000..dcee8c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHay.java @@ -0,0 +1,24 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.IIcon; + +public class BlockHay extends BlockRotatedPillar { + + + public BlockHay() { + super(Material.grass); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + protected IIcon func_150163_b(int p_150163_1_) { + return this.blockIcon; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150164_N = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHopper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHopper.java new file mode 100644 index 0000000..47c2738 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHopper.java @@ -0,0 +1,225 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockHopper extends BlockContainer { + private final Random field_149922_a = new Random(); + private IIcon field_149921_b; + private IIcon field_149923_M; + private IIcon field_149924_N; + + + public BlockHopper() { + super(Material.iron); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + float var8 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, var8, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var8); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(1.0F - var8, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.0F, 1.0F - var8, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + int var10 = Facing.oppositeSide[p_149660_5_]; + + if (var10 == 1) { + var10 = 0; + } + + return var10; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityHopper(); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + super.onBlockPlacedBy(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_, p_149689_6_); + + if (p_149689_6_.hasDisplayName()) { + TileEntityHopper var7 = func_149920_e(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_); + var7.func_145886_a(p_149689_6_.getDisplayName()); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + this.func_149919_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + TileEntityHopper var10 = func_149920_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + p_149727_5_.func_146093_a(var10); + } + + return true; + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + this.func_149919_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + private void func_149919_e(World p_149919_1_, int p_149919_2_, int p_149919_3_, int p_149919_4_) { + int var5 = p_149919_1_.getBlockMetadata(p_149919_2_, p_149919_3_, p_149919_4_); + int var6 = func_149918_b(var5); + boolean var7 = !p_149919_1_.isBlockIndirectlyGettingPowered(p_149919_2_, p_149919_3_, p_149919_4_); + boolean var8 = func_149917_c(var5); + + if (var7 != var8) { + p_149919_1_.setBlockMetadataWithNotify(p_149919_2_, p_149919_3_, p_149919_4_, var6 | (var7 ? 0 : 8), 4); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + TileEntityHopper var7 = (TileEntityHopper)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var7 != null) { + for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); + + if (var9 != null) { + float var10 = this.field_149922_a.nextFloat() * 0.8F + 0.1F; + float var11 = this.field_149922_a.nextFloat() * 0.8F + 0.1F; + float var12 = this.field_149922_a.nextFloat() * 0.8F + 0.1F; + + while (var9.stackSize > 0) { + int var13 = this.field_149922_a.nextInt(21) + 10; + + if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; + EntityItem var14 = new EntityItem(p_149749_1_, (float)p_149749_2_ + var10, (float)p_149749_3_ + var11, (float)p_149749_4_ + var12, new ItemStack(var9.getItem(), var13, var9.getItemDamage())); + + if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + + float var15 = 0.05F; + var14.motionX = (float)this.field_149922_a.nextGaussian() * var15; + var14.motionY = (float)this.field_149922_a.nextGaussian() * var15 + 0.2F; + var14.motionZ = (float)this.field_149922_a.nextGaussian() * var15; + p_149749_1_.spawnEntityInWorld(var14); + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 38; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return true; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_149923_M : this.field_149921_b; + } + + public static int func_149918_b(int p_149918_0_) { + return p_149918_0_ & 7; + } + + public static boolean func_149917_c(int p_149917_0_) { + return (p_149917_0_ & 8) != 8; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + return Container.calcRedstoneFromInventory(func_149920_e(p_149736_1_, p_149736_2_, p_149736_3_, p_149736_4_)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149921_b = p_149651_1_.registerIcon("hopper_outside"); + this.field_149923_M = p_149651_1_.registerIcon("hopper_top"); + this.field_149924_N = p_149651_1_.registerIcon("hopper_inside"); + } + + public static IIcon func_149916_e(String p_149916_0_) { + return p_149916_0_.equals("hopper_outside") ? Blocks.hopper.field_149921_b : (p_149916_0_.equals("hopper_inside") ? Blocks.hopper.field_149924_N : null); + } + + /** + * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. + */ + public String getItemIconName() { + return "hopper"; + } + + public static TileEntityHopper func_149920_e(IBlockAccess p_149920_0_, int p_149920_1_, int p_149920_2_, int p_149920_3_) { + return (TileEntityHopper)p_149920_0_.getTileEntity(p_149920_1_, p_149920_2_, p_149920_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHugeMushroom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHugeMushroom.java new file mode 100644 index 0000000..a817c26 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockHugeMushroom.java @@ -0,0 +1,65 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockHugeMushroom extends Block { + private static final String[] field_149793_a = new String[] {"skin_brown", "skin_red"}; + private final int field_149792_b; + private IIcon[] field_149794_M; + private IIcon field_149795_N; + private IIcon field_149796_O; + + + public BlockHugeMushroom(Material p_i45412_1_, int p_i45412_2_) { + super(p_i45412_1_); + this.field_149792_b = p_i45412_2_; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_2_ == 10 && p_149691_1_ > 1 ? this.field_149795_N : (p_149691_2_ >= 1 && p_149691_2_ <= 9 && p_149691_1_ == 1 ? this.field_149794_M[this.field_149792_b] : (p_149691_2_ >= 1 && p_149691_2_ <= 3 && p_149691_1_ == 2 ? this.field_149794_M[this.field_149792_b] : (p_149691_2_ >= 7 && p_149691_2_ <= 9 && p_149691_1_ == 3 ? this.field_149794_M[this.field_149792_b] : ((p_149691_2_ == 1 || p_149691_2_ == 4 || p_149691_2_ == 7) && p_149691_1_ == 4 ? this.field_149794_M[this.field_149792_b] : ((p_149691_2_ == 3 || p_149691_2_ == 6 || p_149691_2_ == 9) && p_149691_1_ == 5 ? this.field_149794_M[this.field_149792_b] : (p_149691_2_ == 14 ? this.field_149794_M[this.field_149792_b] : (p_149691_2_ == 15 ? this.field_149795_N : this.field_149796_O))))))); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + int var2 = p_149745_1_.nextInt(10) - 7; + + if (var2 < 0) { + var2 = 0; + } + + return var2; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemById(Block.getIdFromBlock(Blocks.brown_mushroom) + this.field_149792_b); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemById(Block.getIdFromBlock(Blocks.brown_mushroom) + this.field_149792_b); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149794_M = new IIcon[field_149793_a.length]; + + for (int var2 = 0; var2 < this.field_149794_M.length; ++var2) { + this.field_149794_M[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_149793_a[var2]); + } + + this.field_149796_O = p_149651_1_.registerIcon(this.getTextureName() + "_" + "inside"); + this.field_149795_N = p_149651_1_.registerIcon(this.getTextureName() + "_" + "skin_stem"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockIce.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockIce.java new file mode 100644 index 0000000..6c63a17 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockIce.java @@ -0,0 +1,87 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockIce extends BlockBreakable { + + + public BlockIce() { + super("ice", Material.ice, false); + this.slipperiness = 0.98F; + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return 1; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_); + } + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + p_149636_2_.addExhaustion(0.025F); + + if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) { + ItemStack var9 = this.createStackedBlock(p_149636_6_); + + if (var9 != null) { + this.dropBlockAsItem_do(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, var9); + } + } else { + if (p_149636_1_.provider.isHellWorld) { + p_149636_1_.setBlockToAir(p_149636_3_, p_149636_4_, p_149636_5_); + return; + } + + int var7 = EnchantmentHelper.getFortuneModifier(p_149636_2_); + this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, var7); + Material var8 = p_149636_1_.getBlock(p_149636_3_, p_149636_4_ - 1, p_149636_5_).getMaterial(); + + if (var8.blocksMovement() || var8.isLiquid()) { + p_149636_1_.setBlock(p_149636_3_, p_149636_4_, p_149636_5_, Blocks.flowing_water); + } + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11 - this.getLightOpacity()) { + if (p_149674_1_.provider.isHellWorld) { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + return; + } + + this.dropBlockAsItem(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0); + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.water); + } + } + + public int getMobilityFlag() { + return 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockJukebox.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockJukebox.java new file mode 100644 index 0000000..83c7728 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockJukebox.java @@ -0,0 +1,147 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockJukebox extends BlockContainer { + private IIcon field_149927_a; + + + protected BlockJukebox() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_149927_a : this.blockIcon; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_) == 0) { + return false; + } else { + this.func_149925_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + return true; + } + } + + public void func_149926_b(World p_149926_1_, int p_149926_2_, int p_149926_3_, int p_149926_4_, ItemStack p_149926_5_) { + if (!p_149926_1_.isClient) { + BlockJukebox.TileEntityJukebox var6 = (BlockJukebox.TileEntityJukebox)p_149926_1_.getTileEntity(p_149926_2_, p_149926_3_, p_149926_4_); + + if (var6 != null) { + var6.func_145857_a(p_149926_5_.copy()); + p_149926_1_.setBlockMetadataWithNotify(p_149926_2_, p_149926_3_, p_149926_4_, 1, 2); + } + } + } + + public void func_149925_e(World p_149925_1_, int p_149925_2_, int p_149925_3_, int p_149925_4_) { + if (!p_149925_1_.isClient) { + BlockJukebox.TileEntityJukebox var5 = (BlockJukebox.TileEntityJukebox)p_149925_1_.getTileEntity(p_149925_2_, p_149925_3_, p_149925_4_); + + if (var5 != null) { + ItemStack var6 = var5.func_145856_a(); + + if (var6 != null) { + p_149925_1_.playAuxSFX(1005, p_149925_2_, p_149925_3_, p_149925_4_, 0); + p_149925_1_.playRecord(null, p_149925_2_, p_149925_3_, p_149925_4_); + var5.func_145857_a(null); + p_149925_1_.setBlockMetadataWithNotify(p_149925_2_, p_149925_3_, p_149925_4_, 0, 2); + float var7 = 0.7F; + double var8 = (double)(p_149925_1_.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; + double var10 = (double)(p_149925_1_.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; + double var12 = (double)(p_149925_1_.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; + ItemStack var14 = var6.copy(); + EntityItem var15 = new EntityItem(p_149925_1_, (double)p_149925_2_ + var8, (double)p_149925_3_ + var10, (double)p_149925_4_ + var12, var14); + var15.delayBeforeCanPickup = 10; + p_149925_1_.spawnEntityInWorld(var15); + } + } + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + this.func_149925_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_); + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + if (!p_149690_1_.isClient) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new BlockJukebox.TileEntityJukebox(); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_149927_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + ItemStack var6 = ((BlockJukebox.TileEntityJukebox)p_149736_1_.getTileEntity(p_149736_2_, p_149736_3_, p_149736_4_)).func_145856_a(); + return var6 == null ? 0 : Item.getIdFromItem(var6.getItem()) + 1 - Item.getIdFromItem(Items.record_13); + } + + public static class TileEntityJukebox extends TileEntity { + private ItemStack field_145858_a; + + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + + if (p_145839_1_.func_150297_b("RecordItem", 10)) { + this.func_145857_a(ItemStack.loadItemStackFromNBT(p_145839_1_.getCompoundTag("RecordItem"))); + } else if (p_145839_1_.getInteger("Record") > 0) { + this.func_145857_a(new ItemStack(Item.getItemById(p_145839_1_.getInteger("Record")), 1, 0)); + } + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + + if (this.func_145856_a() != null) { + p_145841_1_.setTag("RecordItem", this.func_145856_a().writeToNBT(new NBTTagCompound())); + p_145841_1_.setInteger("Record", Item.getIdFromItem(this.func_145856_a().getItem())); + } + } + + public ItemStack func_145856_a() { + return this.field_145858_a; + } + + public void func_145857_a(ItemStack p_145857_1_) { + this.field_145858_a = p_145857_1_; + this.onInventoryChanged(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLadder.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLadder.java new file mode 100644 index 0000000..c3b6766 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLadder.java @@ -0,0 +1,130 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockLadder extends Block { + + + protected BlockLadder() { + super(Material.circuits); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + this.setBlockBoundsBasedOnState(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + return super.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.func_149797_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_)); + } + + public void func_149797_b(int p_149797_1_) { + float var3 = 0.125F; + + if (p_149797_1_ == 2) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var3, 1.0F, 1.0F, 1.0F); + } + + if (p_149797_1_ == 3) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var3); + } + + if (p_149797_1_ == 4) { + this.setBlockBounds(1.0F - var3, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + if (p_149797_1_ == 5) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var3, 1.0F, 1.0F); + } + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 8; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() || p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + int var10 = p_149660_9_; + + if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) { + var10 = 2; + } + + if ((var10 == 0 || p_149660_5_ == 3) && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) { + var10 = 3; + } + + if ((var10 == 0 || p_149660_5_ == 4) && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) { + var10 = 4; + } + + if ((var10 == 0 || p_149660_5_ == 5) && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) { + var10 = 5; + } + + return var10; + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + boolean var7 = var6 == 2 && p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube(); + + if (var6 == 3 && p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube()) { + var7 = true; + } + + if (var6 == 4 && p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube()) { + var7 = true; + } + + if (var6 == 5 && p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube()) { + var7 = true; + } + + if (!var7) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var6, 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLeaves.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLeaves.java new file mode 100644 index 0000000..e3863b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLeaves.java @@ -0,0 +1,280 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockLeaves extends BlockLeavesBase { + int[] field_150128_a; + protected int field_150127_b; + protected IIcon[][] field_150129_M = new IIcon[2][]; + + + public BlockLeaves() { + super(Material.leaves, false); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setHardness(0.2F); + this.setLightOpacity(1); + this.setStepSound(soundTypeGrass); + } + + public int getBlockColor() { + double var1 = 0.5D; + double var3 = 1.0D; + return ColorizerFoliage.getFoliageColor(var1, var3); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + return ColorizerFoliage.getFoliageColorBasic(); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + int var5 = 0; + int var6 = 0; + int var7 = 0; + + for (int var8 = -1; var8 <= 1; ++var8) { + for (int var9 = -1; var9 <= 1; ++var9) { + int var10 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + var9, p_149720_4_ + var8).getBiomeFoliageColor(p_149720_2_ + var9, p_149720_3_, p_149720_4_ + var8); + var5 += (var10 & 16711680) >> 16; + var6 += (var10 & 65280) >> 8; + var7 += var10 & 255; + } + } + + return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255; + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + byte var7 = 1; + int var8 = var7 + 1; + + if (p_149749_1_.checkChunksExist(p_149749_2_ - var8, p_149749_3_ - var8, p_149749_4_ - var8, p_149749_2_ + var8, p_149749_3_ + var8, p_149749_4_ + var8)) { + for (int var9 = -var7; var9 <= var7; ++var9) { + for (int var10 = -var7; var10 <= var7; ++var10) { + for (int var11 = -var7; var11 <= var7; ++var11) { + if (p_149749_1_.getBlock(p_149749_2_ + var9, p_149749_3_ + var10, p_149749_4_ + var11).getMaterial() == Material.leaves) { + int var12 = p_149749_1_.getBlockMetadata(p_149749_2_ + var9, p_149749_3_ + var10, p_149749_4_ + var11); + p_149749_1_.setBlockMetadataWithNotify(p_149749_2_ + var9, p_149749_3_ + var10, p_149749_4_ + var11, var12 | 8, 4); + } + } + } + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if ((var6 & 8) != 0 && (var6 & 4) == 0) { + byte var7 = 4; + int var8 = var7 + 1; + byte var9 = 32; + int var10 = var9 * var9; + int var11 = var9 / 2; + + if (this.field_150128_a == null) { + this.field_150128_a = new int[var9 * var9 * var9]; + } + + int var12; + + if (p_149674_1_.checkChunksExist(p_149674_2_ - var8, p_149674_3_ - var8, p_149674_4_ - var8, p_149674_2_ + var8, p_149674_3_ + var8, p_149674_4_ + var8)) { + int var13; + int var14; + + for (var12 = -var7; var12 <= var7; ++var12) { + for (var13 = -var7; var13 <= var7; ++var13) { + for (var14 = -var7; var14 <= var7; ++var14) { + Block var15 = p_149674_1_.getBlock(p_149674_2_ + var12, p_149674_3_ + var13, p_149674_4_ + var14); + + if (var15 != Blocks.log && var15 != Blocks.log2) { + if (var15.getMaterial() == Material.leaves) { + this.field_150128_a[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; + } + else { + this.field_150128_a[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; + } + } else { + this.field_150128_a[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; + } + } + } + } + + for (var12 = 1; var12 <= 4; ++var12) { + for (var13 = -var7; var13 <= var7; ++var13) { + for (var14 = -var7; var14 <= var7; ++var14) { + for (int var16 = -var7; var16 <= var7; ++var16) { + if (this.field_150128_a[(var13 + var11) * var10 + (var14 + var11) * var9 + var16 + var11] == var12 - 1) { + if (this.field_150128_a[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var16 + var11] == -2) { + this.field_150128_a[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var16 + var11] = var12; + } + + if (this.field_150128_a[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var16 + var11] == -2) { + this.field_150128_a[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var16 + var11] = var12; + } + + if (this.field_150128_a[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var16 + var11] == -2) { + this.field_150128_a[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var16 + var11] = var12; + } + + if (this.field_150128_a[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var16 + var11] == -2) { + this.field_150128_a[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var16 + var11] = var12; + } + + if (this.field_150128_a[(var13 + var11) * var10 + (var14 + var11) * var9 + (var16 + var11 - 1)] == -2) { + this.field_150128_a[(var13 + var11) * var10 + (var14 + var11) * var9 + (var16 + var11 - 1)] = var12; + } + + if (this.field_150128_a[(var13 + var11) * var10 + (var14 + var11) * var9 + var16 + var11 + 1] == -2) { + this.field_150128_a[(var13 + var11) * var10 + (var14 + var11) * var9 + var16 + var11 + 1] = var12; + } + } + } + } + } + } + } + + var12 = this.field_150128_a[var11 * var10 + var11 * var9 + var11]; + + if (var12 >= 0) { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var6 & -9, 4); + } else { + this.func_150126_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + } + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + if (p_149734_1_.canLightningStrikeAt(p_149734_2_, p_149734_3_ + 1, p_149734_4_) && !World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && p_149734_5_.nextInt(15) == 1) { + double var6 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + double var8 = (double)p_149734_3_ - 0.05D; + double var10 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); + } + } + + private void func_150126_e(World p_150126_1_, int p_150126_2_, int p_150126_3_, int p_150126_4_) { + this.dropBlockAsItem(p_150126_1_, p_150126_2_, p_150126_3_, p_150126_4_, p_150126_1_.getBlockMetadata(p_150126_2_, p_150126_3_, p_150126_4_), 0); + p_150126_1_.setBlockToAir(p_150126_2_, p_150126_3_, p_150126_4_); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return p_149745_1_.nextInt(20) == 0 ? 1 : 0; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.sapling); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + if (!p_149690_1_.isClient) { + int var8 = this.func_150123_b(p_149690_5_); + + if (p_149690_7_ > 0) { + var8 -= 2 << p_149690_7_; + + if (var8 < 10) { + var8 = 10; + } + } + + if (p_149690_1_.rand.nextInt(var8) == 0) { + Item var9 = this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_); + this.dropBlockAsItem_do(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(var9, 1, this.damageDropped(p_149690_5_))); + } + + var8 = 200; + + if (p_149690_7_ > 0) { + var8 -= 10 << p_149690_7_; + + if (var8 < 40) { + var8 = 40; + } + } + + this.func_150124_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, var8); + } + } + + protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {} + + protected int func_150123_b(int p_150123_1_) { + return 20; + } + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + if (!p_149636_1_.isClient && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) { + p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + this.dropBlockAsItem_do(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.getItemFromBlock(this), 1, p_149636_6_ & 3)); + } else { + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_ & 3; + } + + public boolean isOpaqueCube() { + return !this.field_150121_P; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public abstract IIcon getIcon(int p_149691_1_, int p_149691_2_); + + public void func_150122_b(boolean p_150122_1_) { + this.field_150121_P = p_150122_1_; + this.field_150127_b = p_150122_1_ ? 0 : 1; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return new ItemStack(Item.getItemFromBlock(this), 1, p_149644_1_ & 3); + } + + public abstract String[] func_150125_e(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLeavesBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLeavesBase.java new file mode 100644 index 0000000..38ad1ef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLeavesBase.java @@ -0,0 +1,23 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.world.IBlockAccess; + +public class BlockLeavesBase extends Block { + protected boolean field_150121_P; + + + protected BlockLeavesBase(Material p_i45433_1_, boolean p_i45433_2_) { + super(p_i45433_1_); + this.field_150121_P = p_i45433_2_; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + Block var6 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_); + return (this.field_150121_P || var6 != this) && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLever.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLever.java new file mode 100644 index 0000000..b542788 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLever.java @@ -0,0 +1,288 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockLever extends Block { + + + protected BlockLever() { + super(Material.circuits); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 12; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + return p_149707_5_ == 0 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_ + 1, p_149707_4_).isNormalCube() || (p_149707_5_ == 1 && World.doesBlockHaveSolidTopSurface(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) || (p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() || (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() || (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() || p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())))); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube() || (World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) || p_149742_1_.getBlock(p_149742_2_, p_149742_3_ + 1, p_149742_4_).isNormalCube())))); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + int var11 = p_149660_9_ & 8; + int var10 = p_149660_9_ & 7; + byte var12 = -1; + + if (p_149660_5_ == 0 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_ + 1, p_149660_4_).isNormalCube()) { + var12 = 0; + } + + if (p_149660_5_ == 1 && World.doesBlockHaveSolidTopSurface(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_)) { + var12 = 5; + } + + if (p_149660_5_ == 2 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) { + var12 = 4; + } + + if (p_149660_5_ == 3 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) { + var12 = 3; + } + + if (p_149660_5_ == 4 && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) { + var12 = 2; + } + + if (p_149660_5_ == 5 && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) { + var12 = 1; + } + + return var12 + var11; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = p_149689_1_.getBlockMetadata(p_149689_2_, p_149689_3_, p_149689_4_); + int var8 = var7 & 7; + int var9 = var7 & 8; + + if (var8 == func_149819_b(1)) { + if ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 5 | var9, 2); + } else { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 6 | var9, 2); + } + } else if (var8 == func_149819_b(0)) { + if ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 7 | var9, 2); + } else { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 0 | var9, 2); + } + } + } + + public static int func_149819_b(int p_149819_0_) { + switch (p_149819_0_) { + case 0: + return 0; + + case 1: + return 5; + + case 2: + return 4; + + case 3: + return 3; + + case 4: + return 2; + + case 5: + return 1; + + default: + return -1; + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (this.func_149820_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_) & 7; + boolean var7 = !p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && var6 == 1; + + if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && var6 == 2) { + var7 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && var6 == 3) { + var7 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && var6 == 4) { + var7 = true; + } + + if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && var6 == 5) { + var7 = true; + } + + if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && var6 == 6) { + var7 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_).isNormalCube() && var6 == 0) { + var7 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_).isNormalCube() && var6 == 7) { + var7 = true; + } + + if (var7) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + } + + private boolean func_149820_e(World p_149820_1_, int p_149820_2_, int p_149820_3_, int p_149820_4_) { + if (!this.canPlaceBlockAt(p_149820_1_, p_149820_2_, p_149820_3_, p_149820_4_)) { + this.dropBlockAsItem(p_149820_1_, p_149820_2_, p_149820_3_, p_149820_4_, p_149820_1_.getBlockMetadata(p_149820_2_, p_149820_3_, p_149820_4_), 0); + p_149820_1_.setBlockToAir(p_149820_2_, p_149820_3_, p_149820_4_); + return false; + } else { + return true; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_) & 7; + float var6 = 0.1875F; + + if (var5 == 1) { + this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6); + } else if (var5 == 2) { + this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6); + } else if (var5 == 3) { + this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F); + } else if (var5 == 4) { + this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F); + } else if (var5 != 5 && var5 != 6) { + if (var5 == 0 || var5 == 7) { + var6 = 0.25F; + this.setBlockBounds(0.5F - var6, 0.4F, 0.5F - var6, 0.5F + var6, 1.0F, 0.5F + var6); + } + } else { + var6 = 0.25F; + this.setBlockBounds(0.5F - var6, 0.0F, 0.5F - var6, 0.5F + var6, 0.6F, 0.5F + var6); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + int var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + int var11 = var10 & 7; + int var12 = 8 - (var10 & 8); + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var11 + var12, 3); + p_149727_1_.playSoundEffect((double)p_149727_2_ + 0.5D, (double)p_149727_3_ + 0.5D, (double)p_149727_4_ + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F); + p_149727_1_.notifyBlocksOfNeighborChange(p_149727_2_, p_149727_3_, p_149727_4_, this); + + if (var11 == 1) { + p_149727_1_.notifyBlocksOfNeighborChange(p_149727_2_ - 1, p_149727_3_, p_149727_4_, this); + } else if (var11 == 2) { + p_149727_1_.notifyBlocksOfNeighborChange(p_149727_2_ + 1, p_149727_3_, p_149727_4_, this); + } else if (var11 == 3) { + p_149727_1_.notifyBlocksOfNeighborChange(p_149727_2_, p_149727_3_, p_149727_4_ - 1, this); + } else if (var11 == 4) { + p_149727_1_.notifyBlocksOfNeighborChange(p_149727_2_, p_149727_3_, p_149727_4_ + 1, this); + } else if (var11 != 5 && var11 != 6) { + if (var11 == 0 || var11 == 7) { + p_149727_1_.notifyBlocksOfNeighborChange(p_149727_2_, p_149727_3_ + 1, p_149727_4_, this); + } + } else { + p_149727_1_.notifyBlocksOfNeighborChange(p_149727_2_, p_149727_3_ - 1, p_149727_4_, this); + } + + return true; + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + if ((p_149749_6_ & 8) > 0) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_, this); + int var7 = p_149749_6_ & 7; + + if (var7 == 1) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ - 1, p_149749_3_, p_149749_4_, this); + } else if (var7 == 2) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ + 1, p_149749_3_, p_149749_4_, this); + } else if (var7 == 3) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ - 1, this); + } else if (var7 == 4) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ + 1, this); + } else if (var7 != 5 && var7 != 6) { + if (var7 == 0 || var7 == 7) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ + 1, p_149749_4_, this); + } + } else { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ - 1, p_149749_4_, this); + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return (p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_) & 8) > 0 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + int var6 = p_149748_1_.getBlockMetadata(p_149748_2_, p_149748_3_, p_149748_4_); + + if ((var6 & 8) == 0) { + return 0; + } else { + int var7 = var6 & 7; + return var7 == 0 && p_149748_5_ == 0 ? 15 : (var7 == 7 && p_149748_5_ == 0 ? 15 : (var7 == 6 && p_149748_5_ == 1 ? 15 : (var7 == 5 && p_149748_5_ == 1 ? 15 : (var7 == 4 && p_149748_5_ == 2 ? 15 : (var7 == 3 && p_149748_5_ == 3 ? 15 : (var7 == 2 && p_149748_5_ == 4 ? 15 : (var7 == 1 && p_149748_5_ == 5 ? 15 : 0))))))); + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLilyPad.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLilyPad.java new file mode 100644 index 0000000..dba9591 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLilyPad.java @@ -0,0 +1,73 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockLilyPad extends BlockBush { + + + protected BlockLilyPad() { + float var1 = 0.5F; + float var2 = 0.015625F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, var2, 0.5F + var1); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 23; + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + if (p_149743_7_ == null || !(p_149743_7_ instanceof EntityBoat)) { + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return AxisAlignedBB.getBoundingBox((double)p_149668_2_ + this.field_149759_B, (double)p_149668_3_ + this.field_149760_C, (double)p_149668_4_ + this.field_149754_D, (double)p_149668_2_ + this.field_149755_E, (double)p_149668_3_ + this.field_149756_F, (double)p_149668_4_ + this.field_149757_G); + } + + public int getBlockColor() { + return 2129968; + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + return 2129968; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + return 2129968; + } + + protected boolean func_149854_a(Block p_149854_1_) { + return p_149854_1_ == Blocks.water; + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return p_149718_3_ >= 0 && p_149718_3_ < 256 && p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_).getMaterial() == Material.water && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLiquid.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLiquid.java new file mode 100644 index 0000000..f4f958d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLiquid.java @@ -0,0 +1,461 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockLiquid extends Block { + private IIcon[] field_149806_a; + + + protected BlockLiquid(Material p_i45413_1_) { + super(p_i45413_1_); + float var2 = 0.0F; + float var3 = 0.0F; + this.setBlockBounds(0.0F + var3, 0.0F + var2, 0.0F + var3, 1.0F + var3, 1.0F + var2, 1.0F + var3); + this.setTickRandomly(true); + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return this.blockMaterial != Material.lava; + } + + public int getBlockColor() { + return 16777215; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + if (this.blockMaterial != Material.water) { + return 16777215; + } else { + int var5 = 0; + int var6 = 0; + int var7 = 0; + + for (int var8 = -1; var8 <= 1; ++var8) { + for (int var9 = -1; var9 <= 1; ++var9) { + int var10 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + var9, p_149720_4_ + var8).waterColorMultiplier; + var5 += (var10 & 16711680) >> 16; + var6 += (var10 & 65280) >> 8; + var7 += var10 & 255; + } + } + + return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255; + } + } + + public static float func_149801_b(int p_149801_0_) { + if (p_149801_0_ >= 8) { + p_149801_0_ = 0; + } + + return (float)(p_149801_0_ + 1) / 9.0F; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ != 0 && p_149691_1_ != 1 ? this.field_149806_a[1] : this.field_149806_a[0]; + } + + protected int func_149804_e(World p_149804_1_, int p_149804_2_, int p_149804_3_, int p_149804_4_) { + return p_149804_1_.getBlock(p_149804_2_, p_149804_3_, p_149804_4_).getMaterial() == this.blockMaterial ? p_149804_1_.getBlockMetadata(p_149804_2_, p_149804_3_, p_149804_4_) : -1; + } + + protected int func_149798_e(IBlockAccess p_149798_1_, int p_149798_2_, int p_149798_3_, int p_149798_4_) { + if (p_149798_1_.getBlock(p_149798_2_, p_149798_3_, p_149798_4_).getMaterial() != this.blockMaterial) { + return -1; + } else { + int var5 = p_149798_1_.getBlockMetadata(p_149798_2_, p_149798_3_, p_149798_4_); + + if (var5 >= 8) { + var5 = 0; + } + + return var5; + } + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param + * par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int p_149678_1_, boolean p_149678_2_) { + return p_149678_2_ && p_149678_1_ == 0; + } + + public boolean isBlockSolid(IBlockAccess p_149747_1_, int p_149747_2_, int p_149747_3_, int p_149747_4_, int p_149747_5_) { + Material var6 = p_149747_1_.getBlock(p_149747_2_, p_149747_3_, p_149747_4_).getMaterial(); + return var6 != this.blockMaterial && (p_149747_5_ == 1 || (var6 != Material.ice && super.isBlockSolid(p_149747_1_, p_149747_2_, p_149747_3_, p_149747_4_, p_149747_5_))); + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + Material var6 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_).getMaterial(); + return var6 != this.blockMaterial && (p_149646_5_ == 1 || super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_)); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 4; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + private Vec3 func_149800_f(IBlockAccess p_149800_1_, int p_149800_2_, int p_149800_3_, int p_149800_4_) { + Vec3 var5 = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + int var6 = this.func_149798_e(p_149800_1_, p_149800_2_, p_149800_3_, p_149800_4_); + + for (int var7 = 0; var7 < 4; ++var7) { + int var8 = p_149800_2_; + int var10 = p_149800_4_; + + if (var7 == 0) { + var8 = p_149800_2_ - 1; + } + + if (var7 == 1) { + var10 = p_149800_4_ - 1; + } + + if (var7 == 2) { + ++var8; + } + + if (var7 == 3) { + ++var10; + } + + int var11 = this.func_149798_e(p_149800_1_, var8, p_149800_3_, var10); + int var12; + + if (var11 < 0) { + if (!p_149800_1_.getBlock(var8, p_149800_3_, var10).getMaterial().blocksMovement()) { + var11 = this.func_149798_e(p_149800_1_, var8, p_149800_3_ - 1, var10); + + if (var11 >= 0) { + var12 = var11 - (var6 - 8); + var5 = var5.addVector((var8 - p_149800_2_) * var12, (p_149800_3_ - p_149800_3_) * var12, (var10 - p_149800_4_) * var12); + } + } + } else if (var11 >= 0) { + var12 = var11 - var6; + var5 = var5.addVector((var8 - p_149800_2_) * var12, (p_149800_3_ - p_149800_3_) * var12, (var10 - p_149800_4_) * var12); + } + } + + if (p_149800_1_.getBlockMetadata(p_149800_2_, p_149800_3_, p_149800_4_) >= 8) { + boolean var13 = false; + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_, p_149800_4_ - 1, 2)) { + var13 = true; + } + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_, p_149800_4_ + 1, 3)) { + var13 = true; + } + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_ - 1, p_149800_3_, p_149800_4_, 4)) { + var13 = true; + } + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_ + 1, p_149800_3_, p_149800_4_, 5)) { + var13 = true; + } + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_ + 1, p_149800_4_ - 1, 2)) { + var13 = true; + } + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_ + 1, p_149800_4_ + 1, 3)) { + var13 = true; + } + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_ - 1, p_149800_3_ + 1, p_149800_4_, 4)) { + var13 = true; + } + + if (var13 || this.isBlockSolid(p_149800_1_, p_149800_2_ + 1, p_149800_3_ + 1, p_149800_4_, 5)) { + var13 = true; + } + + if (var13) { + var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D); + } + } + + var5 = var5.normalize(); + return var5; + } + + public void velocityToAddToEntity(World p_149640_1_, int p_149640_2_, int p_149640_3_, int p_149640_4_, Entity p_149640_5_, Vec3 p_149640_6_) { + Vec3 var7 = this.func_149800_f(p_149640_1_, p_149640_2_, p_149640_3_, p_149640_4_); + p_149640_6_.xCoord += var7.xCoord; + p_149640_6_.yCoord += var7.yCoord; + p_149640_6_.zCoord += var7.zCoord; + } + + public int func_149738_a(World p_149738_1_) { + return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (p_149738_1_.provider.hasNoSky ? 10 : 30) : 0); + } + + public int getBlockBrightness(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) { + int var5 = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, 0); + int var6 = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_ + 1, p_149677_4_, 0); + int var7 = var5 & 255; + int var8 = var6 & 255; + int var9 = var5 >> 16 & 255; + int var10 = var6 >> 16 & 255; + return (var7 > var8 ? var7 : var8) | (var9 > var10 ? var9 : var10) << 16; + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return this.blockMaterial == Material.water ? 1 : 0; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + int var6; + + if (this.blockMaterial == Material.water) { + if (p_149734_5_.nextInt(10) == 0) { + var6 = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + + if (var6 <= 0 || var6 >= 8) { + p_149734_1_.spawnParticle("suspended", (float)p_149734_2_ + p_149734_5_.nextFloat(), (float)p_149734_3_ + p_149734_5_.nextFloat(), (float)p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D); + } + } + + for (var6 = 0; var6 < 0; ++var6) { + int var7 = p_149734_5_.nextInt(4); + int var8 = p_149734_2_; + int var9 = p_149734_4_; + + if (var7 == 0) { + var8 = p_149734_2_ - 1; + } + + if (var7 == 1) { + ++var8; + } + + if (var7 == 2) { + var9 = p_149734_4_ - 1; + } + + if (var7 == 3) { + ++var9; + } + + if (p_149734_1_.getBlock(var8, p_149734_3_, var9).getMaterial() == Material.air && (p_149734_1_.getBlock(var8, p_149734_3_ - 1, var9).getMaterial().blocksMovement() || p_149734_1_.getBlock(var8, p_149734_3_ - 1, var9).getMaterial().isLiquid())) { + float var10 = 0.0625F; + double var11 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + double var13 = (float)p_149734_3_ + p_149734_5_.nextFloat(); + double var15 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + + if (var7 == 0) { + var11 = (float)p_149734_2_ - var10; + } + + if (var7 == 1) { + var11 = (float)(p_149734_2_ + 1) + var10; + } + + if (var7 == 2) { + var15 = (float)p_149734_4_ - var10; + } + + if (var7 == 3) { + var15 = (float)(p_149734_4_ + 1) + var10; + } + + double var17 = 0.0D; + double var19 = 0.0D; + + if (var7 == 0) { + var17 = -var10; + } + + if (var7 == 1) { + var17 = var10; + } + + if (var7 == 2) { + var19 = -var10; + } + + if (var7 == 3) { + var19 = var10; + } + + p_149734_1_.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19); + } + } + } + + if (this.blockMaterial == Material.water && p_149734_5_.nextInt(64) == 0) { + var6 = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + + if (var6 > 0 && var6 < 8) { + p_149734_1_.playSound((float)p_149734_2_ + 0.5F, (float)p_149734_3_ + 0.5F, (float)p_149734_4_ + 0.5F, "liquid.water", p_149734_5_.nextFloat() * 0.25F + 0.75F, p_149734_5_.nextFloat() * 1.0F + 0.5F, false); + } + } + + double var21; + double var22; + double var23; + + if (this.blockMaterial == Material.lava && p_149734_1_.getBlock(p_149734_2_, p_149734_3_ + 1, p_149734_4_).getMaterial() == Material.air && !p_149734_1_.getBlock(p_149734_2_, p_149734_3_ + 1, p_149734_4_).isOpaqueCube()) { + if (p_149734_5_.nextInt(100) == 0) { + var21 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + var22 = (double)p_149734_3_ + this.field_149756_F; + var23 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D); + p_149734_1_.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + p_149734_5_.nextFloat() * 0.2F, 0.9F + p_149734_5_.nextFloat() * 0.15F, false); + } + + if (p_149734_5_.nextInt(200) == 0) { + p_149734_1_.playSound(p_149734_2_, p_149734_3_, p_149734_4_, "liquid.lava", 0.2F + p_149734_5_.nextFloat() * 0.2F, 0.9F + p_149734_5_.nextFloat() * 0.15F, false); + } + } + + if (p_149734_5_.nextInt(10) == 0 && World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !p_149734_1_.getBlock(p_149734_2_, p_149734_3_ - 2, p_149734_4_).getMaterial().blocksMovement()) { + var21 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + var22 = (double)p_149734_3_ - 1.05D; + var23 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + + if (this.blockMaterial == Material.water) { + p_149734_1_.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D); + } else { + p_149734_1_.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D); + } + } + } + + public static double func_149802_a(IBlockAccess p_149802_0_, int p_149802_1_, int p_149802_2_, int p_149802_3_, Material p_149802_4_) { + Vec3 var5 = null; + + if (p_149802_4_ == Material.water) { + var5 = Blocks.flowing_water.func_149800_f(p_149802_0_, p_149802_1_, p_149802_2_, p_149802_3_); + } + + if (p_149802_4_ == Material.lava) { + var5 = Blocks.flowing_lava.func_149800_f(p_149802_0_, p_149802_1_, p_149802_2_, p_149802_3_); + } + + return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - (Math.PI / 2D); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + this.func_149805_n(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + this.func_149805_n(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + private void func_149805_n(World p_149805_1_, int p_149805_2_, int p_149805_3_, int p_149805_4_) { + if (p_149805_1_.getBlock(p_149805_2_, p_149805_3_, p_149805_4_) == this) { + if (this.blockMaterial == Material.lava) { + boolean var5 = false; + + if (var5 || p_149805_1_.getBlock(p_149805_2_, p_149805_3_, p_149805_4_ - 1).getMaterial() == Material.water) { + var5 = true; + } + + if (var5 || p_149805_1_.getBlock(p_149805_2_, p_149805_3_, p_149805_4_ + 1).getMaterial() == Material.water) { + var5 = true; + } + + if (var5 || p_149805_1_.getBlock(p_149805_2_ - 1, p_149805_3_, p_149805_4_).getMaterial() == Material.water) { + var5 = true; + } + + if (var5 || p_149805_1_.getBlock(p_149805_2_ + 1, p_149805_3_, p_149805_4_).getMaterial() == Material.water) { + var5 = true; + } + + if (var5 || p_149805_1_.getBlock(p_149805_2_, p_149805_3_ + 1, p_149805_4_).getMaterial() == Material.water) { + var5 = true; + } + + if (var5) { + int var6 = p_149805_1_.getBlockMetadata(p_149805_2_, p_149805_3_, p_149805_4_); + + if (var6 == 0) { + p_149805_1_.setBlock(p_149805_2_, p_149805_3_, p_149805_4_, Blocks.obsidian); + } else if (var6 <= 4) { + p_149805_1_.setBlock(p_149805_2_, p_149805_3_, p_149805_4_, Blocks.cobblestone); + } + + this.func_149799_m(p_149805_1_, p_149805_2_, p_149805_3_, p_149805_4_); + } + } + } + } + + protected void func_149799_m(World p_149799_1_, int p_149799_2_, int p_149799_3_, int p_149799_4_) { + p_149799_1_.playSoundEffect((float)p_149799_2_ + 0.5F, (float)p_149799_3_ + 0.5F, (float)p_149799_4_ + 0.5F, "random.fizz", 0.5F, 2.6F + (p_149799_1_.rand.nextFloat() - p_149799_1_.rand.nextFloat()) * 0.8F); + + for (int var5 = 0; var5 < 8; ++var5) { + p_149799_1_.spawnParticle("largesmoke", (double)p_149799_2_ + Math.random(), (double)p_149799_3_ + 1.2D, (double)p_149799_4_ + Math.random(), 0.0D, 0.0D, 0.0D); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + if (this.blockMaterial == Material.lava) { + this.field_149806_a = new IIcon[] {p_149651_1_.registerIcon("lava_still"), p_149651_1_.registerIcon("lava_flow")}; + } else { + this.field_149806_a = new IIcon[] {p_149651_1_.registerIcon("water_still"), p_149651_1_.registerIcon("water_flow")}; + } + } + + public static IIcon func_149803_e(String p_149803_0_) { + return p_149803_0_ == "water_still" ? Blocks.flowing_water.field_149806_a[0] : (p_149803_0_ == "water_flow" ? Blocks.flowing_water.field_149806_a[1] : (p_149803_0_ == "lava_still" ? Blocks.flowing_lava.field_149806_a[0] : (p_149803_0_ == "lava_flow" ? Blocks.flowing_lava.field_149806_a[1] : null))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLog.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLog.java new file mode 100644 index 0000000..105a1e7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockLog.java @@ -0,0 +1,65 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public abstract class BlockLog extends BlockRotatedPillar { + protected IIcon[] field_150167_a; + protected IIcon[] field_150166_b; + + + public BlockLog() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + this.setHardness(2.0F); + this.setStepSound(soundTypeWood); + } + + public static int func_150165_c(int p_150165_0_) { + return p_150165_0_ & 3; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(this); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + byte var7 = 4; + int var8 = var7 + 1; + + if (p_149749_1_.checkChunksExist(p_149749_2_ - var8, p_149749_3_ - var8, p_149749_4_ - var8, p_149749_2_ + var8, p_149749_3_ + var8, p_149749_4_ + var8)) { + for (int var9 = -var7; var9 <= var7; ++var9) { + for (int var10 = -var7; var10 <= var7; ++var10) { + for (int var11 = -var7; var11 <= var7; ++var11) { + if (p_149749_1_.getBlock(p_149749_2_ + var9, p_149749_3_ + var10, p_149749_4_ + var11).getMaterial() == Material.leaves) { + int var12 = p_149749_1_.getBlockMetadata(p_149749_2_ + var9, p_149749_3_ + var10, p_149749_4_ + var11); + + if ((var12 & 8) == 0) { + p_149749_1_.setBlockMetadataWithNotify(p_149749_2_ + var9, p_149749_3_ + var10, p_149749_4_ + var11, var12 | 8, 4); + } + } + } + } + } + } + } + + protected IIcon func_150163_b(int p_150163_1_) { + return this.field_150167_a[p_150163_1_ % this.field_150167_a.length]; + } + + protected IIcon func_150161_d(int p_150161_1_) { + return this.field_150166_b[p_150161_1_ % this.field_150166_b.length]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMelon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMelon.java new file mode 100644 index 0000000..796f739 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMelon.java @@ -0,0 +1,55 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; + +public class BlockMelon extends Block { + private IIcon field_150201_a; + + + protected BlockMelon() { + super(Material.field_151572_C); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ != 1 && p_149691_1_ != 0 ? this.blockIcon : this.field_150201_a; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.melon; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 3 + p_149745_1_.nextInt(5); + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int p_149679_1_, Random p_149679_2_) { + int var3 = this.quantityDropped(p_149679_2_) + p_149679_2_.nextInt(1 + p_149679_1_); + + if (var3 > 9) { + var3 = 9; + } + + return var3; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_150201_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMobSpawner.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMobSpawner.java new file mode 100644 index 0000000..6707cdd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMobSpawner.java @@ -0,0 +1,54 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.world.World; + +public class BlockMobSpawner extends BlockContainer { + + + protected BlockMobSpawner() { + super(Material.rock); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityMobSpawner(); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + int var8 = 15 + p_149690_1_.rand.nextInt(15) + p_149690_1_.rand.nextInt(15); + this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, var8); + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemById(0); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMushroom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMushroom.java new file mode 100644 index 0000000..397f409 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMushroom.java @@ -0,0 +1,114 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; + +public class BlockMushroom extends BlockBush implements IGrowable { + + + protected BlockMushroom() { + float var1 = 0.2F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, var1 * 2.0F, 0.5F + var1); + this.setTickRandomly(true); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (p_149674_5_.nextInt(25) == 0) { + byte var6 = 4; + int var7 = 5; + int var8; + int var9; + int var10; + + for (var8 = p_149674_2_ - var6; var8 <= p_149674_2_ + var6; ++var8) { + for (var9 = p_149674_4_ - var6; var9 <= p_149674_4_ + var6; ++var9) { + for (var10 = p_149674_3_ - 1; var10 <= p_149674_3_ + 1; ++var10) { + if (p_149674_1_.getBlock(var8, var10, var9) == this) { + --var7; + + if (var7 <= 0) { + return; + } + } + } + } + } + + var8 = p_149674_2_ + p_149674_5_.nextInt(3) - 1; + var9 = p_149674_3_ + p_149674_5_.nextInt(2) - p_149674_5_.nextInt(2); + var10 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; + + for (int var11 = 0; var11 < 4; ++var11) { + if (p_149674_1_.isAirBlock(var8, var9, var10) && this.canBlockStay(p_149674_1_, var8, var9, var10)) { + p_149674_2_ = var8; + p_149674_3_ = var9; + p_149674_4_ = var10; + } + + var8 = p_149674_2_ + p_149674_5_.nextInt(3) - 1; + var9 = p_149674_3_ + p_149674_5_.nextInt(2) - p_149674_5_.nextInt(2); + var10 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; + } + + if (p_149674_1_.isAirBlock(var8, var9, var10) && this.canBlockStay(p_149674_1_, var8, var9, var10)) { + p_149674_1_.setBlock(var8, var9, var10, this, 0, 2); + } + } + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + protected boolean func_149854_a(Block p_149854_1_) { + return p_149854_1_.func_149730_j(); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + if (p_149718_3_ >= 0 && p_149718_3_ < 256) { + Block var5 = p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); + return var5 == Blocks.mycelium || var5 == Blocks.dirt && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.getFullBlockLightValue(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(var5); + } else { + return false; + } + } + + public boolean func_149884_c(World p_149884_1_, int p_149884_2_, int p_149884_3_, int p_149884_4_, Random p_149884_5_) { + int var6 = p_149884_1_.getBlockMetadata(p_149884_2_, p_149884_3_, p_149884_4_); + p_149884_1_.setBlockToAir(p_149884_2_, p_149884_3_, p_149884_4_); + WorldGenBigMushroom var7 = null; + + if (this == Blocks.brown_mushroom) { + var7 = new WorldGenBigMushroom(0); + } else if (this == Blocks.red_mushroom) { + var7 = new WorldGenBigMushroom(1); + } + + if (var7 != null && var7.generate(p_149884_1_, p_149884_5_, p_149884_2_, p_149884_3_, p_149884_4_)) { + return true; + } else { + p_149884_1_.setBlock(p_149884_2_, p_149884_3_, p_149884_4_, this, var6, 3); + return false; + } + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + return true; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return (double)p_149852_2_.nextFloat() < 0.4D; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + this.func_149884_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, p_149853_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMycelium.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMycelium.java new file mode 100644 index 0000000..18266c9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockMycelium.java @@ -0,0 +1,84 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockMycelium extends Block { + private IIcon field_150200_a; + private IIcon field_150199_b; + + + protected BlockMycelium() { + super(Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_150200_a : (p_149691_1_ == 0 ? Blocks.dirt.getBlockTextureFromSide(p_149691_1_) : this.blockIcon); + } + + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + if (p_149673_5_ == 1) { + return this.field_150200_a; + } else if (p_149673_5_ == 0) { + return Blocks.dirt.getBlockTextureFromSide(p_149673_5_); + } else { + Material var6 = p_149673_1_.getBlock(p_149673_2_, p_149673_3_ + 1, p_149673_4_).getMaterial(); + return var6 != Material.field_151597_y && var6 != Material.craftedSnow ? this.blockIcon : this.field_150199_b; + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_150200_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150199_b = p_149651_1_.registerIcon("grass_side_snowed"); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_).getLightOpacity() > 2) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); + } else if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9) { + for (int var6 = 0; var6 < 4; ++var6) { + int var7 = p_149674_2_ + p_149674_5_.nextInt(3) - 1; + int var8 = p_149674_3_ + p_149674_5_.nextInt(5) - 3; + int var9 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; + Block var10 = p_149674_1_.getBlock(var7, var8 + 1, var9); + + if (p_149674_1_.getBlock(var7, var8, var9) == Blocks.dirt && p_149674_1_.getBlockMetadata(var7, var8, var9) == 0 && p_149674_1_.getBlockLightValue(var7, var8 + 1, var9) >= 4 && var10.getLightOpacity() <= 2) { + p_149674_1_.setBlock(var7, var8, var9, this); + } + } + } + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + super.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_); + + if (p_149734_5_.nextInt(10) == 0) { + p_149734_1_.spawnParticle("townaura", (float)p_149734_2_ + p_149734_5_.nextFloat(), (float)p_149734_3_ + 1.1F, (float)p_149734_4_ + p_149734_5_.nextFloat(), 0.0D, 0.0D, 0.0D); + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNetherWart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNetherWart.java new file mode 100644 index 0000000..8f0494b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNetherWart.java @@ -0,0 +1,109 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockNetherWart extends BlockBush { + private IIcon[] field_149883_a; + + + protected BlockNetherWart() { + this.setTickRandomly(true); + float var1 = 0.5F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 0.25F, 0.5F + var1); + this.setCreativeTab(null); + } + + protected boolean func_149854_a(Block p_149854_1_) { + return p_149854_1_ == Blocks.soul_sand; + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return this.func_149854_a(p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var6 < 3 && p_149674_5_.nextInt(10) == 0) { + ++var6; + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var6, 2); + } + + super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_2_ >= 3 ? this.field_149883_a[2] : (p_149691_2_ > 0 ? this.field_149883_a[1] : this.field_149883_a[0]); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 6; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + if (!p_149690_1_.isClient) { + int var8 = 1; + + if (p_149690_5_ >= 3) { + var8 = 2 + p_149690_1_.rand.nextInt(3); + + if (p_149690_7_ > 0) { + var8 += p_149690_1_.rand.nextInt(p_149690_7_ + 1); + } + } + + for (int var9 = 0; var9 < var8; ++var9) { + this.dropBlockAsItem_do(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.nether_wart)); + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.nether_wart; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149883_a = new IIcon[3]; + + for (int var2 = 0; var2 < this.field_149883_a.length; ++var2) { + this.field_149883_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + var2); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNetherrack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNetherrack.java new file mode 100644 index 0000000..8bb84e5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNetherrack.java @@ -0,0 +1,18 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockNetherrack extends Block { + + + public BlockNetherrack() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.field_151655_K; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNewLeaf.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNewLeaf.java new file mode 100644 index 0000000..827c52f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNewLeaf.java @@ -0,0 +1,62 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockNewLeaf extends BlockLeaves { + public static final String[][] field_150132_N = new String[][] {{"leaves_acacia", "leaves_big_oak"}, {"leaves_acacia_opaque", "leaves_big_oak_opaque"}}; + public static final String[] field_150133_O = new String[] {"acacia", "big_oak"}; + + + protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) { + if ((p_150124_5_ & 3) == 1 && p_150124_1_.rand.nextInt(p_150124_6_) == 0) { + this.dropBlockAsItem_do(p_150124_1_, p_150124_2_, p_150124_3_, p_150124_4_, new ItemStack(Items.apple, 1, 0)); + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return super.damageDropped(p_149692_1_) + 4; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + return p_149643_1_.getBlockMetadata(p_149643_2_, p_149643_3_, p_149643_4_) & 3; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return (p_149691_2_ & 3) == 1 ? this.field_150129_M[this.field_150127_b][1] : this.field_150129_M[this.field_150127_b][0]; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + for (int var2 = 0; var2 < field_150132_N.length; ++var2) { + this.field_150129_M[var2] = new IIcon[field_150132_N[var2].length]; + + for (int var3 = 0; var3 < field_150132_N[var2].length; ++var3) { + this.field_150129_M[var2][var3] = p_149651_1_.registerIcon(field_150132_N[var2][var3]); + } + } + } + + public String[] func_150125_e() { + return field_150133_O; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNewLog.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNewLog.java new file mode 100644 index 0000000..076eb38 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNewLog.java @@ -0,0 +1,28 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockNewLog extends BlockLog { + public static final String[] field_150169_M = new String[] {"acacia", "big_oak"}; + + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150167_a = new IIcon[field_150169_M.length]; + this.field_150166_b = new IIcon[field_150169_M.length]; + + for (int var2 = 0; var2 < this.field_150167_a.length; ++var2) { + this.field_150167_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_150169_M[var2]); + this.field_150166_b[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_150169_M[var2] + "_top"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNote.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNote.java new file mode 100644 index 0000000..209e954 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockNote.java @@ -0,0 +1,93 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityNote; +import net.minecraft.world.World; + +public class BlockNote extends BlockContainer { + + + public BlockNote() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + boolean var6 = p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_); + TileEntityNote var7 = (TileEntityNote)p_149695_1_.getTileEntity(p_149695_2_, p_149695_3_, p_149695_4_); + + if (var7 != null && var7.field_145880_i != var6) { + if (var6) { + var7.func_145878_a(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + var7.field_145880_i = var6; + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + TileEntityNote var10 = (TileEntityNote)p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_); + + if (var10 != null) { + var10.func_145877_a(); + var10.func_145878_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + } + + return true; + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) { + if (!p_149699_1_.isClient) { + TileEntityNote var6 = (TileEntityNote)p_149699_1_.getTileEntity(p_149699_2_, p_149699_3_, p_149699_4_); + + if (var6 != null) { + var6.func_145878_a(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_); + } + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityNote(); + } + + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + float var7 = (float)Math.pow(2.0D, (double)(p_149696_6_ - 12) / 12.0D); + String var8 = "harp"; + + if (p_149696_5_ == 1) { + var8 = "bd"; + } + + if (p_149696_5_ == 2) { + var8 = "snare"; + } + + if (p_149696_5_ == 3) { + var8 = "hat"; + } + + if (p_149696_5_ == 4) { + var8 = "bassattack"; + } + + p_149696_1_.playSoundEffect((double)p_149696_2_ + 0.5D, (double)p_149696_3_ + 0.5D, (double)p_149696_4_ + 0.5D, "note." + var8, 3.0F, var7); + p_149696_1_.spawnParticle("note", (double)p_149696_2_ + 0.5D, (double)p_149696_3_ + 1.2D, (double)p_149696_4_ + 0.5D, (double)p_149696_6_ / 24.0D, 0.0D, 0.0D); + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockObsidian.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockObsidian.java new file mode 100644 index 0000000..6953373 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockObsidian.java @@ -0,0 +1,25 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; + +public class BlockObsidian extends BlockStone { + + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.obsidian); + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.field_151654_J; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOldLeaf.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOldLeaf.java new file mode 100644 index 0000000..ea47d55 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOldLeaf.java @@ -0,0 +1,78 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockOldLeaf extends BlockLeaves { + public static final String[][] field_150130_N = new String[][] {{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}}; + public static final String[] field_150131_O = new String[] {"oak", "spruce", "birch", "jungle"}; + + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + return (p_149741_1_ & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((p_149741_1_ & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : super.getRenderColor(p_149741_1_)); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + int var5 = p_149720_1_.getBlockMetadata(p_149720_2_, p_149720_3_, p_149720_4_); + return (var5 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((var5 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_)); + } + + protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) { + if ((p_150124_5_ & 3) == 0 && p_150124_1_.rand.nextInt(p_150124_6_) == 0) { + this.dropBlockAsItem_do(p_150124_1_, p_150124_2_, p_150124_3_, p_150124_4_, new ItemStack(Items.apple, 1, 0)); + } + } + + protected int func_150123_b(int p_150123_1_) { + int var2 = super.func_150123_b(p_150123_1_); + + if ((p_150123_1_ & 3) == 3) { + var2 = 40; + } + + return var2; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return (p_149691_2_ & 3) == 1 ? this.field_150129_M[this.field_150127_b][1] : ((p_149691_2_ & 3) == 3 ? this.field_150129_M[this.field_150127_b][3] : ((p_149691_2_ & 3) == 2 ? this.field_150129_M[this.field_150127_b][2] : this.field_150129_M[this.field_150127_b][0])); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 3)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + for (int var2 = 0; var2 < field_150130_N.length; ++var2) { + this.field_150129_M[var2] = new IIcon[field_150130_N[var2].length]; + + for (int var3 = 0; var3 < field_150130_N[var2].length; ++var3) { + this.field_150129_M[var2][var3] = p_149651_1_.registerIcon(field_150130_N[var2][var3]); + } + } + } + + public String[] func_150125_e() { + return field_150131_O; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOldLog.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOldLog.java new file mode 100644 index 0000000..a9aff74 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOldLog.java @@ -0,0 +1,30 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockOldLog extends BlockLog { + public static final String[] field_150168_M = new String[] {"oak", "spruce", "birch", "jungle"}; + + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 3)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150167_a = new IIcon[field_150168_M.length]; + this.field_150166_b = new IIcon[field_150168_M.length]; + + for (int var2 = 0; var2 < this.field_150167_a.length; ++var2) { + this.field_150167_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_150168_M[var2]); + this.field_150166_b[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_150168_M[var2] + "_top"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOre.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOre.java new file mode 100644 index 0000000..47158ee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockOre.java @@ -0,0 +1,79 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockOre extends Block { + + + public BlockOre() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return this == Blocks.coal_ore ? Items.coal : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this))))); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return this == Blocks.lapis_ore ? 4 + p_149745_1_.nextInt(5) : 1; + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int p_149679_1_, Random p_149679_2_) { + if (p_149679_1_ > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, p_149679_2_, p_149679_1_)) { + int var3 = p_149679_2_.nextInt(p_149679_1_ + 2) - 1; + + if (var3 < 0) { + var3 = 0; + } + + return this.quantityDropped(p_149679_2_) * (var3 + 1); + } else { + return this.quantityDropped(p_149679_2_); + } + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + + if (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this)) { + int var8 = 0; + + if (this == Blocks.coal_ore) { + var8 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 0, 2); + } else if (this == Blocks.diamond_ore) { + var8 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 3, 7); + } else if (this == Blocks.emerald_ore) { + var8 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 3, 7); + } else if (this == Blocks.lapis_ore) { + var8 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 2, 5); + } else if (this == Blocks.quartz_ore) { + var8 = MathHelper.getRandomIntegerInRange(p_149690_1_.rand, 2, 5); + } + + this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, var8); + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return this == Blocks.lapis_ore ? 4 : 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPackedIce.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPackedIce.java new file mode 100644 index 0000000..aad977f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPackedIce.java @@ -0,0 +1,22 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockPackedIce extends Block { + + + public BlockPackedIce() { + super(Material.field_151598_x); + this.slipperiness = 0.98F; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPane.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPane.java new file mode 100644 index 0000000..a64802a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPane.java @@ -0,0 +1,154 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPane extends Block { + private final String field_150100_a; + private final boolean field_150099_b; + private final String field_150101_M; + private IIcon field_150102_N; + + + protected BlockPane(String p_i45432_1_, String p_i45432_2_, Material p_i45432_3_, boolean p_i45432_4_) { + super(p_i45432_3_); + this.field_150100_a = p_i45432_2_; + this.field_150099_b = p_i45432_4_; + this.field_150101_M = p_i45432_1_; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return !this.field_150099_b ? null : super.getItemDropped(p_149650_1_, p_149650_2_, p_149650_3_); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return this.blockMaterial == Material.glass ? 41 : 18; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_) != this && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + boolean var8 = this.func_150098_a(p_149743_1_.getBlock(p_149743_2_, p_149743_3_, p_149743_4_ - 1)); + boolean var9 = this.func_150098_a(p_149743_1_.getBlock(p_149743_2_, p_149743_3_, p_149743_4_ + 1)); + boolean var10 = this.func_150098_a(p_149743_1_.getBlock(p_149743_2_ - 1, p_149743_3_, p_149743_4_)); + boolean var11 = this.func_150098_a(p_149743_1_.getBlock(p_149743_2_ + 1, p_149743_3_, p_149743_4_)); + + if ((!var10 || !var11) && (var10 || var11 || var8 || var9)) { + if (var10 && !var11) { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } else if (!var10 && var11) { + this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + } else { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + if ((!var8 || !var9) && (var10 || var11 || var8 || var9)) { + if (var8 && !var9) { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } else if (!var8 && var9) { + this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + } else { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + float var5 = 0.4375F; + float var6 = 0.5625F; + float var7 = 0.4375F; + float var8 = 0.5625F; + boolean var9 = this.func_150098_a(p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ - 1)); + boolean var10 = this.func_150098_a(p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ + 1)); + boolean var11 = this.func_150098_a(p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_)); + boolean var12 = this.func_150098_a(p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_)); + + if ((!var11 || !var12) && (var11 || var12 || var9 || var10)) { + if (var11 && !var12) { + var5 = 0.0F; + } else if (!var11 && var12) { + var6 = 1.0F; + } + } else { + var5 = 0.0F; + var6 = 1.0F; + } + + if ((!var9 || !var10) && (var11 || var12 || var9 || var10)) { + if (var9 && !var10) { + var7 = 0.0F; + } else if (!var9 && var10) { + var8 = 1.0F; + } + } else { + var7 = 0.0F; + var8 = 1.0F; + } + + this.setBlockBounds(var5, 0.0F, var7, var6, 1.0F, var8); + } + + public IIcon func_150097_e() { + return this.field_150102_N; + } + + public final boolean func_150098_a(Block p_150098_1_) { + return p_150098_1_.func_149730_j() || p_150098_1_ == this || p_150098_1_ == Blocks.glass || p_150098_1_ == Blocks.stained_glass || p_150098_1_ == Blocks.stained_glass_pane || p_150098_1_ instanceof BlockPane; + } + + protected boolean canSilkHarvest() { + return true; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return new ItemStack(Item.getItemFromBlock(this), 1, p_149644_1_); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.field_150101_M); + this.field_150102_N = p_149651_1_.registerIcon(this.field_150100_a); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonBase.java new file mode 100644 index 0000000..4ec4ed0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonBase.java @@ -0,0 +1,428 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonBase extends Block { + private final boolean field_150082_a; + private IIcon field_150081_b; + private IIcon field_150083_M; + private IIcon field_150084_N; + + + public BlockPistonBase(boolean p_i45443_1_) { + super(Material.piston); + this.field_150082_a = p_i45443_1_; + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public IIcon func_150073_e() { + return this.field_150084_N; + } + + public void func_150070_b(float p_150070_1_, float p_150070_2_, float p_150070_3_, float p_150070_4_, float p_150070_5_, float p_150070_6_) { + this.setBlockBounds(p_150070_1_, p_150070_2_, p_150070_3_, p_150070_4_, p_150070_5_, p_150070_6_); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + int var3 = func_150076_b(p_149691_2_); + return var3 > 5 ? this.field_150084_N : (p_149691_1_ == var3 ? (!func_150075_c(p_149691_2_) && this.field_149759_B <= 0.0D && this.field_149760_C <= 0.0D && this.field_149754_D <= 0.0D && this.field_149755_E >= 1.0D && this.field_149756_F >= 1.0D && this.field_149757_G >= 1.0D ? this.field_150084_N : this.field_150081_b) : (p_149691_1_ == Facing.oppositeSide[var3] ? this.field_150083_M : this.blockIcon)); + } + + public static IIcon func_150074_e(String p_150074_0_) { + return p_150074_0_ == "piston_side" ? Blocks.piston.blockIcon : (p_150074_0_ == "piston_top_normal" ? Blocks.piston.field_150084_N : (p_150074_0_ == "piston_top_sticky" ? Blocks.sticky_piston.field_150084_N : (p_150074_0_ == "piston_inner" ? Blocks.piston.field_150081_b : null))); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("piston_side"); + this.field_150084_N = p_149651_1_.registerIcon(this.field_150082_a ? "piston_top_sticky" : "piston_top_normal"); + this.field_150081_b = p_149651_1_.registerIcon("piston_inner"); + this.field_150083_M = p_149651_1_.registerIcon("piston_bottom"); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 16; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + return false; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = func_150071_a(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_); + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + + if (!p_149689_1_.isClient) { + this.func_150078_e(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + this.func_150078_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + if (!p_149726_1_.isClient && p_149726_1_.getTileEntity(p_149726_2_, p_149726_3_, p_149726_4_) == null) { + this.func_150078_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + } + + private void func_150078_e(World p_150078_1_, int p_150078_2_, int p_150078_3_, int p_150078_4_) { + int var5 = p_150078_1_.getBlockMetadata(p_150078_2_, p_150078_3_, p_150078_4_); + int var6 = func_150076_b(var5); + + if (var6 != 7) { + boolean var7 = this.func_150072_a(p_150078_1_, p_150078_2_, p_150078_3_, p_150078_4_, var6); + + if (var7 && !func_150075_c(var5)) { + if (func_150077_h(p_150078_1_, p_150078_2_, p_150078_3_, p_150078_4_, var6)) { + p_150078_1_.func_147452_c(p_150078_2_, p_150078_3_, p_150078_4_, this, 0, var6); + } + } else if (!var7 && func_150075_c(var5)) { + p_150078_1_.setBlockMetadataWithNotify(p_150078_2_, p_150078_3_, p_150078_4_, var6, 2); + p_150078_1_.func_147452_c(p_150078_2_, p_150078_3_, p_150078_4_, this, 1, var6); + } + } + } + + private boolean func_150072_a(World p_150072_1_, int p_150072_2_, int p_150072_3_, int p_150072_4_, int p_150072_5_) { + return p_150072_5_ != 0 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ - 1, p_150072_4_, 0) || (p_150072_5_ != 1 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 1, p_150072_4_, 1) || (p_150072_5_ != 2 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_, p_150072_4_ - 1, 2) || (p_150072_5_ != 3 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_, p_150072_4_ + 1, 3) || (p_150072_5_ != 5 && p_150072_1_.getIndirectPowerOutput(p_150072_2_ + 1, p_150072_3_, p_150072_4_, 5) || (p_150072_5_ != 4 && p_150072_1_.getIndirectPowerOutput(p_150072_2_ - 1, p_150072_3_, p_150072_4_, 4) || (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_, p_150072_4_, 0) || (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 2, p_150072_4_, 1) || (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 1, p_150072_4_ - 1, 2) || (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 1, p_150072_4_ + 1, 3) || (p_150072_1_.getIndirectPowerOutput(p_150072_2_ - 1, p_150072_3_ + 1, p_150072_4_, 4) || p_150072_1_.getIndirectPowerOutput(p_150072_2_ + 1, p_150072_3_ + 1, p_150072_4_, 5))))))))))); + } + + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + if (!p_149696_1_.isClient) { + boolean var7 = this.func_150072_a(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_6_); + + if (var7 && p_149696_5_ == 1) { + p_149696_1_.setBlockMetadataWithNotify(p_149696_2_, p_149696_3_, p_149696_4_, p_149696_6_ | 8, 2); + return false; + } + + if (!var7 && p_149696_5_ == 0) { + return false; + } + } + + if (p_149696_5_ == 0) { + if (!this.func_150079_i(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_6_)) { + return false; + } + + p_149696_1_.setBlockMetadataWithNotify(p_149696_2_, p_149696_3_, p_149696_4_, p_149696_6_ | 8, 2); + p_149696_1_.playSoundEffect((double)p_149696_2_ + 0.5D, (double)p_149696_3_ + 0.5D, (double)p_149696_4_ + 0.5D, "tile.piston.out", 0.5F, p_149696_1_.rand.nextFloat() * 0.25F + 0.6F); + } else if (p_149696_5_ == 1) { + TileEntity var16 = p_149696_1_.getTileEntity(p_149696_2_ + Facing.offsetsXForSide[p_149696_6_], p_149696_3_ + Facing.offsetsYForSide[p_149696_6_], p_149696_4_ + Facing.offsetsZForSide[p_149696_6_]); + + if (var16 instanceof TileEntityPiston) { + ((TileEntityPiston)var16).func_145866_f(); + } + + p_149696_1_.setBlock(p_149696_2_, p_149696_3_, p_149696_4_, Blocks.piston_extension, p_149696_6_, 3); + p_149696_1_.setTileEntity(p_149696_2_, p_149696_3_, p_149696_4_, BlockPistonMoving.func_149962_a(this, p_149696_6_, p_149696_6_, false, true)); + + if (this.field_150082_a) { + int var8 = p_149696_2_ + Facing.offsetsXForSide[p_149696_6_] * 2; + int var9 = p_149696_3_ + Facing.offsetsYForSide[p_149696_6_] * 2; + int var10 = p_149696_4_ + Facing.offsetsZForSide[p_149696_6_] * 2; + Block var11 = p_149696_1_.getBlock(var8, var9, var10); + int var12 = p_149696_1_.getBlockMetadata(var8, var9, var10); + boolean var13 = false; + + if (var11 == Blocks.piston_extension) { + TileEntity var14 = p_149696_1_.getTileEntity(var8, var9, var10); + + if (var14 instanceof TileEntityPiston) { + TileEntityPiston var15 = (TileEntityPiston)var14; + + if (var15.func_145864_c() == p_149696_6_ && var15.func_145868_b()) { + var15.func_145866_f(); + var11 = var15.func_145861_a(); + var12 = var15.getBlockMetadata(); + var13 = true; + } + } + } + + if (!var13 && var11.getMaterial() != Material.air && func_150080_a(var11, p_149696_1_, var8, var9, var10, false) && (var11.getMobilityFlag() == 0 || var11 == Blocks.piston || var11 == Blocks.sticky_piston)) { + p_149696_2_ += Facing.offsetsXForSide[p_149696_6_]; + p_149696_3_ += Facing.offsetsYForSide[p_149696_6_]; + p_149696_4_ += Facing.offsetsZForSide[p_149696_6_]; + p_149696_1_.setBlock(p_149696_2_, p_149696_3_, p_149696_4_, Blocks.piston_extension, var12, 3); + p_149696_1_.setTileEntity(p_149696_2_, p_149696_3_, p_149696_4_, BlockPistonMoving.func_149962_a(var11, var12, p_149696_6_, false, false)); + p_149696_1_.setBlockToAir(var8, var9, var10); + } else if (!var13) { + p_149696_1_.setBlockToAir(p_149696_2_ + Facing.offsetsXForSide[p_149696_6_], p_149696_3_ + Facing.offsetsYForSide[p_149696_6_], p_149696_4_ + Facing.offsetsZForSide[p_149696_6_]); + } + } else { + p_149696_1_.setBlockToAir(p_149696_2_ + Facing.offsetsXForSide[p_149696_6_], p_149696_3_ + Facing.offsetsYForSide[p_149696_6_], p_149696_4_ + Facing.offsetsZForSide[p_149696_6_]); + } + + p_149696_1_.playSoundEffect((double)p_149696_2_ + 0.5D, (double)p_149696_3_ + 0.5D, (double)p_149696_4_ + 0.5D, "tile.piston.in", 0.5F, p_149696_1_.rand.nextFloat() * 0.15F + 0.6F); + } + + return true; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + + if (func_150075_c(var5)) { + float var6 = 0.25F; + + switch (func_150076_b(var5)) { + case 0: + this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + + case 1: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + break; + + case 2: + this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); + break; + + case 3: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F); + break; + + case 4: + this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + + case 5: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F); + } + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + } + + public boolean renderAsNormalBlock() { + return false; + } + + public static int func_150076_b(int p_150076_0_) { + return p_150076_0_ & 7; + } + + public static boolean func_150075_c(int p_150075_0_) { + return (p_150075_0_ & 8) != 0; + } + + public static int func_150071_a(World p_150071_0_, int p_150071_1_, int p_150071_2_, int p_150071_3_, EntityLivingBase p_150071_4_) { + if (MathHelper.abs((float)p_150071_4_.posX - (float)p_150071_1_) < 2.0F && MathHelper.abs((float)p_150071_4_.posZ - (float)p_150071_3_) < 2.0F) { + double var5 = p_150071_4_.posY + 1.82D - (double)p_150071_4_.yOffset; + + if (var5 - (double)p_150071_2_ > 2.0D) { + return 1; + } + + if ((double)p_150071_2_ - var5 > 0.0D) { + return 0; + } + } + + int var7 = MathHelper.floor_double((double)(p_150071_4_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + return var7 == 0 ? 2 : (var7 == 1 ? 5 : (var7 == 2 ? 3 : (var7 == 3 ? 4 : 0))); + } + + private static boolean func_150080_a(Block p_150080_0_, World p_150080_1_, int p_150080_2_, int p_150080_3_, int p_150080_4_, boolean p_150080_5_) { + if (p_150080_0_ == Blocks.obsidian) { + return false; + } else { + if (p_150080_0_ != Blocks.piston && p_150080_0_ != Blocks.sticky_piston) { + if (p_150080_0_.getBlockHardness(p_150080_1_, p_150080_2_, p_150080_3_, p_150080_4_) == -1.0F) { + return false; + } + + if (p_150080_0_.getMobilityFlag() == 2) { + return false; + } + + if (p_150080_0_.getMobilityFlag() == 1) { + return p_150080_5_; + } + } else if (func_150075_c(p_150080_1_.getBlockMetadata(p_150080_2_, p_150080_3_, p_150080_4_))) { + return false; + } + + return !(p_150080_0_ instanceof ITileEntityProvider); + } + } + + private static boolean func_150077_h(World p_150077_0_, int p_150077_1_, int p_150077_2_, int p_150077_3_, int p_150077_4_) { + int var5 = p_150077_1_ + Facing.offsetsXForSide[p_150077_4_]; + int var6 = p_150077_2_ + Facing.offsetsYForSide[p_150077_4_]; + int var7 = p_150077_3_ + Facing.offsetsZForSide[p_150077_4_]; + int var8 = 0; + + while (true) { + if (var8 < 13) { + if (var6 <= 0 || var6 >= 255) { + return false; + } + + Block var9 = p_150077_0_.getBlock(var5, var6, var7); + + if (var9.getMaterial() != Material.air) { + if (!func_150080_a(var9, p_150077_0_, var5, var6, var7, true)) { + return false; + } + + if (var9.getMobilityFlag() != 1) { + if (var8 == 12) { + return false; + } + + var5 += Facing.offsetsXForSide[p_150077_4_]; + var6 += Facing.offsetsYForSide[p_150077_4_]; + var7 += Facing.offsetsZForSide[p_150077_4_]; + ++var8; + continue; + } + } + } + + return true; + } + } + + private boolean func_150079_i(World p_150079_1_, int p_150079_2_, int p_150079_3_, int p_150079_4_, int p_150079_5_) { + int var6 = p_150079_2_ + Facing.offsetsXForSide[p_150079_5_]; + int var7 = p_150079_3_ + Facing.offsetsYForSide[p_150079_5_]; + int var8 = p_150079_4_ + Facing.offsetsZForSide[p_150079_5_]; + int var9 = 0; + + while (true) { + if (var9 < 13) { + if (var7 <= 0 || var7 >= 255) { + return false; + } + + Block var10 = p_150079_1_.getBlock(var6, var7, var8); + + if (var10.getMaterial() != Material.air) { + if (!func_150080_a(var10, p_150079_1_, var6, var7, var8, true)) { + return false; + } + + if (var10.getMobilityFlag() != 1) { + if (var9 == 12) { + return false; + } + + var6 += Facing.offsetsXForSide[p_150079_5_]; + var7 += Facing.offsetsYForSide[p_150079_5_]; + var8 += Facing.offsetsZForSide[p_150079_5_]; + ++var9; + continue; + } + + var10.dropBlockAsItem(p_150079_1_, var6, var7, var8, p_150079_1_.getBlockMetadata(var6, var7, var8), 0); + p_150079_1_.setBlockToAir(var6, var7, var8); + } + } + + var9 = var6; + int var19 = var7; + int var11 = var8; + int var12 = 0; + Block[] var13; + int var14; + int var15; + int var16 = 0; + + for (var13 = new Block[13]; var6 != p_150079_2_ || var7 != p_150079_3_ || var8 != p_150079_4_; var8 = var16) { + var14 = var6 - Facing.offsetsXForSide[p_150079_5_]; + var15 = var7 - Facing.offsetsYForSide[p_150079_5_]; + var16 = var8 - Facing.offsetsZForSide[p_150079_5_]; + Block var17 = p_150079_1_.getBlock(var14, var15, var16); + int var18 = p_150079_1_.getBlockMetadata(var14, var15, var16); + + if (var17 == this && var14 == p_150079_2_ && var15 == p_150079_3_ && var16 == p_150079_4_) { + p_150079_1_.setBlock(var6, var7, var8, Blocks.piston_extension, p_150079_5_ | (this.field_150082_a ? 8 : 0), 4); + p_150079_1_.setTileEntity(var6, var7, var8, BlockPistonMoving.func_149962_a(Blocks.piston_head, p_150079_5_ | (this.field_150082_a ? 8 : 0), p_150079_5_, true, false)); + } else { + p_150079_1_.setBlock(var6, var7, var8, Blocks.piston_extension, var18, 4); + p_150079_1_.setTileEntity(var6, var7, var8, BlockPistonMoving.func_149962_a(var17, var18, p_150079_5_, true, false)); + } + + var13[var12++] = var17; + var6 = var14; + var7 = var15; + } + + var6 = var9; + var7 = var19; + var8 = var11; + + for (var12 = 0; var6 != p_150079_2_ || var7 != p_150079_3_ || var8 != p_150079_4_; var8 = var16) { + var14 = var6 - Facing.offsetsXForSide[p_150079_5_]; + var15 = var7 - Facing.offsetsYForSide[p_150079_5_]; + var16 = var8 - Facing.offsetsZForSide[p_150079_5_]; + p_150079_1_.notifyBlocksOfNeighborChange(var14, var15, var16, var13[var12++]); + var6 = var14; + var7 = var15; + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonExtension.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonExtension.java new file mode 100644 index 0000000..48a8f8f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonExtension.java @@ -0,0 +1,219 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonExtension extends Block { + private IIcon field_150088_a; + + + public BlockPistonExtension() { + super(Material.piston); + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + } + + public void func_150086_a(IIcon p_150086_1_) { + this.field_150088_a = p_150086_1_; + } + + public void func_150087_e() { + this.field_150088_a = null; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + if (p_149681_6_.capabilities.isCreativeMode) { + int var7 = func_150085_b(p_149681_5_); + Block var8 = p_149681_1_.getBlock(p_149681_2_ - Facing.offsetsXForSide[var7], p_149681_3_ - Facing.offsetsYForSide[var7], p_149681_4_ - Facing.offsetsZForSide[var7]); + + if (var8 == Blocks.piston || var8 == Blocks.sticky_piston) { + p_149681_1_.setBlockToAir(p_149681_2_ - Facing.offsetsXForSide[var7], p_149681_3_ - Facing.offsetsYForSide[var7], p_149681_4_ - Facing.offsetsZForSide[var7]); + } + } + + super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + int var7 = Facing.oppositeSide[func_150085_b(p_149749_6_)]; + p_149749_2_ += Facing.offsetsXForSide[var7]; + p_149749_3_ += Facing.offsetsYForSide[var7]; + p_149749_4_ += Facing.offsetsZForSide[var7]; + Block var8 = p_149749_1_.getBlock(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var8 == Blocks.piston || var8 == Blocks.sticky_piston) { + p_149749_6_ = p_149749_1_.getBlockMetadata(p_149749_2_, p_149749_3_, p_149749_4_); + + if (BlockPistonBase.func_150075_c(p_149749_6_)) { + var8.dropBlockAsItem(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_6_, 0); + p_149749_1_.setBlockToAir(p_149749_2_, p_149749_3_, p_149749_4_); + } + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + int var3 = func_150085_b(p_149691_2_); + return p_149691_1_ == var3 ? (this.field_150088_a != null ? this.field_150088_a : ((p_149691_2_ & 8) != 0 ? BlockPistonBase.func_150074_e("piston_top_sticky") : BlockPistonBase.func_150074_e("piston_top_normal"))) : (var3 < 6 && p_149691_1_ == Facing.oppositeSide[var3] ? BlockPistonBase.func_150074_e("piston_top_normal") : BlockPistonBase.func_150074_e("piston_side")); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 17; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return false; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + return false; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + int var8 = p_149743_1_.getBlockMetadata(p_149743_2_, p_149743_3_, p_149743_4_); + float var9 = 0.25F; + float var10 = 0.375F; + float var11 = 0.625F; + float var12 = 0.25F; + float var13 = 0.75F; + + switch (func_150085_b(var8)) { + case 0: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.375F, 0.25F, 0.375F, 0.625F, 1.0F, 0.625F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + break; + + case 1: + this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.75F, 0.625F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + break; + + case 2: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.25F, 0.375F, 0.25F, 0.75F, 0.625F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + break; + + case 3: + this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.25F, 0.375F, 0.0F, 0.75F, 0.625F, 0.75F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + break; + + case 4: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.375F, 0.25F, 0.25F, 0.625F, 0.75F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + break; + + case 5: + this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.375F, 0.25F, 0.75F, 0.625F, 0.75F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + float var6 = 0.25F; + + switch (func_150085_b(var5)) { + case 0: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); + break; + + case 1: + this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + + case 2: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); + break; + + case 3: + this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); + break; + + case 4: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); + break; + + case 5: + this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + int var6 = func_150085_b(p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_)); + Block var7 = p_149695_1_.getBlock(p_149695_2_ - Facing.offsetsXForSide[var6], p_149695_3_ - Facing.offsetsYForSide[var6], p_149695_4_ - Facing.offsetsZForSide[var6]); + + if (var7 != Blocks.piston && var7 != Blocks.sticky_piston) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } else { + var7.onNeighborBlockChange(p_149695_1_, p_149695_2_ - Facing.offsetsXForSide[var6], p_149695_3_ - Facing.offsetsYForSide[var6], p_149695_4_ - Facing.offsetsZForSide[var6], p_149695_5_); + } + } + + public static int func_150085_b(int p_150085_0_) { + return MathHelper.clamp_int(p_150085_0_ & 7, 0, Facing.offsetsXForSide.length - 1); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + int var5 = p_149694_1_.getBlockMetadata(p_149694_2_, p_149694_3_, p_149694_4_); + return (var5 & 8) != 0 ? Item.getItemFromBlock(Blocks.sticky_piston) : Item.getItemFromBlock(Blocks.piston); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonMoving.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonMoving.java new file mode 100644 index 0000000..b948604 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPistonMoving.java @@ -0,0 +1,201 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonMoving extends BlockContainer { + + + public BlockPistonMoving() { + super(Material.piston); + this.setHardness(-1.0F); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return null; + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + TileEntity var7 = p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var7 instanceof TileEntityPiston) { + ((TileEntityPiston)var7).func_145866_f(); + } else { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return false; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return -1; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (!p_149727_1_.isClient && p_149727_1_.getTileEntity(p_149727_2_, p_149727_3_, p_149727_4_) == null) { + p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_); + return true; + } else { + return false; + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + if (!p_149690_1_.isClient) { + TileEntityPiston var8 = this.func_149963_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_); + + if (var8 != null) { + var8.func_145861_a().dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, var8.getBlockMetadata(), 0); + } + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + p_149695_1_.getTileEntity(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + public static TileEntity func_149962_a(Block p_149962_0_, int p_149962_1_, int p_149962_2_, boolean p_149962_3_, boolean p_149962_4_) { + return new TileEntityPiston(p_149962_0_, p_149962_1_, p_149962_2_, p_149962_3_, p_149962_4_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + TileEntityPiston var5 = this.func_149963_e(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + + if (var5 == null) { + return null; + } else { + float var6 = var5.func_145860_a(0.0F); + + if (var5.func_145868_b()) { + var6 = 1.0F - var6; + } + + return this.func_149964_a(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_, var5.func_145861_a(), var6, var5.func_145864_c()); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + TileEntityPiston var5 = this.func_149963_e(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_); + + if (var5 != null) { + Block var6 = var5.func_145861_a(); + + if (var6 == this || var6.getMaterial() == Material.air) { + return; + } + + var6.setBlockBoundsBasedOnState(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_); + float var7 = var5.func_145860_a(0.0F); + + if (var5.func_145868_b()) { + var7 = 1.0F - var7; + } + + int var8 = var5.func_145864_c(); + this.field_149759_B = var6.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.field_149760_C = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.field_149754_D = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); + this.field_149755_E = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.field_149756_F = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.field_149757_G = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); + } + } + + public AxisAlignedBB func_149964_a(World p_149964_1_, int p_149964_2_, int p_149964_3_, int p_149964_4_, Block p_149964_5_, float p_149964_6_, int p_149964_7_) { + if (p_149964_5_ != this && p_149964_5_.getMaterial() != Material.air) { + AxisAlignedBB var8 = p_149964_5_.getCollisionBoundingBoxFromPool(p_149964_1_, p_149964_2_, p_149964_3_, p_149964_4_); + + if (var8 == null) { + return null; + } else { + if (Facing.offsetsXForSide[p_149964_7_] < 0) { + var8.minX -= (float)Facing.offsetsXForSide[p_149964_7_] * p_149964_6_; + } else { + var8.maxX -= (float)Facing.offsetsXForSide[p_149964_7_] * p_149964_6_; + } + + if (Facing.offsetsYForSide[p_149964_7_] < 0) { + var8.minY -= (float)Facing.offsetsYForSide[p_149964_7_] * p_149964_6_; + } else { + var8.maxY -= (float)Facing.offsetsYForSide[p_149964_7_] * p_149964_6_; + } + + if (Facing.offsetsZForSide[p_149964_7_] < 0) { + var8.minZ -= (float)Facing.offsetsZForSide[p_149964_7_] * p_149964_6_; + } else { + var8.maxZ -= (float)Facing.offsetsZForSide[p_149964_7_] * p_149964_6_; + } + + return var8; + } + } else { + return null; + } + } + + private TileEntityPiston func_149963_e(IBlockAccess p_149963_1_, int p_149963_2_, int p_149963_3_, int p_149963_4_) { + TileEntity var5 = p_149963_1_.getTileEntity(p_149963_2_, p_149963_3_, p_149963_4_); + return var5 instanceof TileEntityPiston ? (TileEntityPiston)var5 : null; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemById(0); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("piston_top_normal"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPortal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPortal.java new file mode 100644 index 0000000..c5aceb4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPortal.java @@ -0,0 +1,348 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMonsterPlacer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Direction; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPortal extends BlockBreakable { + public static final int[][] field_150001_a = new int[][] {new int[0], {3, 1}, {2, 0}}; + + + public BlockPortal() { + super("portal", Material.Portal, false); + this.setTickRandomly(true); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + + if (p_149674_1_.provider.isSurfaceWorld() && p_149674_1_.getGameRules().getGameRuleBooleanValue("doMobSpawning") && p_149674_5_.nextInt(2000) < p_149674_1_.difficultySetting.getDifficultyId()) { + int var6; + + for (var6 = p_149674_3_; !World.doesBlockHaveSolidTopSurface(p_149674_1_, p_149674_2_, var6, p_149674_4_) && var6 > 0; --var6) { + } + + if (var6 > 0 && !p_149674_1_.getBlock(p_149674_2_, var6 + 1, p_149674_4_).isNormalCube()) { + Entity var7 = ItemMonsterPlacer.spawnCreature(p_149674_1_, 57, (double)p_149674_2_ + 0.5D, (double)var6 + 1.1D, (double)p_149674_4_ + 0.5D); + + if (var7 != null) { + var7.timeUntilPortal = var7.getPortalCooldown(); + } + } + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = func_149999_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_)); + + if (var5 == 0) { + if (p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_) != this && p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_) != this) { + var5 = 2; + } else { + var5 = 1; + } + + if (p_149719_1_ instanceof World && !((World)p_149719_1_).isClient) { + ((World)p_149719_1_).setBlockMetadataWithNotify(p_149719_2_, p_149719_3_, p_149719_4_, var5, 2); + } + } + + float var6 = 0.125F; + float var7 = 0.125F; + + if (var5 == 1) { + var6 = 0.5F; + } + + if (var5 == 2) { + var7 = 0.5F; + } + + this.setBlockBounds(0.5F - var6, 0.0F, 0.5F - var7, 0.5F + var6, 1.0F, 0.5F + var7); + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean func_150000_e(World p_150000_1_, int p_150000_2_, int p_150000_3_, int p_150000_4_) { + BlockPortal.Size var5 = new BlockPortal.Size(p_150000_1_, p_150000_2_, p_150000_3_, p_150000_4_, 1); + BlockPortal.Size var6 = new BlockPortal.Size(p_150000_1_, p_150000_2_, p_150000_3_, p_150000_4_, 2); + + if (var5.func_150860_b() && var5.field_150864_e == 0) { + var5.func_150859_c(); + return true; + } else if (var6.func_150860_b() && var6.field_150864_e == 0) { + var6.func_150859_c(); + return true; + } else { + return false; + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + int var6 = func_149999_b(p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_)); + BlockPortal.Size var7 = new BlockPortal.Size(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, 1); + BlockPortal.Size var8 = new BlockPortal.Size(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, 2); + + if (var6 == 1 && (!var7.func_150860_b() || var7.field_150864_e < var7.field_150868_h * var7.field_150862_g)) { + p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, Blocks.air); + } else if (var6 == 2 && (!var8.func_150860_b() || var8.field_150864_e < var8.field_150868_h * var8.field_150862_g)) { + p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, Blocks.air); + } else if (var6 == 0 && !var7.func_150860_b() && !var8.func_150860_b()) { + p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, Blocks.air); + } + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + int var6 = 0; + + if (p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_) == this) { + var6 = func_149999_b(p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_)); + + if (var6 == 0) { + return false; + } + + if (var6 == 2 && p_149646_5_ != 5 && p_149646_5_ != 4) { + return false; + } + + if (var6 == 1 && p_149646_5_ != 3 && p_149646_5_ != 2) { + return false; + } + } + + boolean var7 = p_149646_1_.getBlock(p_149646_2_ - 1, p_149646_3_, p_149646_4_) == this && p_149646_1_.getBlock(p_149646_2_ - 2, p_149646_3_, p_149646_4_) != this; + boolean var8 = p_149646_1_.getBlock(p_149646_2_ + 1, p_149646_3_, p_149646_4_) == this && p_149646_1_.getBlock(p_149646_2_ + 2, p_149646_3_, p_149646_4_) != this; + boolean var9 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ - 1) == this && p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ - 2) != this; + boolean var10 = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ + 1) == this && p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_ + 2) != this; + boolean var11 = var7 || var8 || var6 == 1; + boolean var12 = var9 || var10 || var6 == 2; + return var11 && p_149646_5_ == 4 || (var11 && p_149646_5_ == 5 || (var12 && p_149646_5_ == 2 || var12 && p_149646_5_ == 3)); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return 1; + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + if (p_149670_5_.ridingEntity == null && p_149670_5_.riddenByEntity == null) { + p_149670_5_.setInPortal(); + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + if (p_149734_5_.nextInt(100) == 0) { + p_149734_1_.playSound((double)p_149734_2_ + 0.5D, (double)p_149734_3_ + 0.5D, (double)p_149734_4_ + 0.5D, "portal.portal", 0.5F, p_149734_5_.nextFloat() * 0.4F + 0.8F, false); + } + + for (int var6 = 0; var6 < 4; ++var6) { + double var7 = (float)p_149734_2_ + p_149734_5_.nextFloat(); + double var9 = (float)p_149734_3_ + p_149734_5_.nextFloat(); + double var11 = (float)p_149734_4_ + p_149734_5_.nextFloat(); + double var13 = 0.0D; + double var15 = 0.0D; + double var17 = 0.0D; + int var19 = p_149734_5_.nextInt(2) * 2 - 1; + var13 = ((double)p_149734_5_.nextFloat() - 0.5D) * 0.5D; + var15 = ((double)p_149734_5_.nextFloat() - 0.5D) * 0.5D; + var17 = ((double)p_149734_5_.nextFloat() - 0.5D) * 0.5D; + + if (p_149734_1_.getBlock(p_149734_2_ - 1, p_149734_3_, p_149734_4_) != this && p_149734_1_.getBlock(p_149734_2_ + 1, p_149734_3_, p_149734_4_) != this) { + var7 = (double)p_149734_2_ + 0.5D + 0.25D * (double)var19; + var13 = p_149734_5_.nextFloat() * 2.0F * (float)var19; + } else { + var11 = (double)p_149734_4_ + 0.5D + 0.25D * (double)var19; + var17 = p_149734_5_.nextFloat() * 2.0F * (float)var19; + } + + p_149734_1_.spawnParticle("portal", var7, var9, var11, var13, var15, var17); + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemById(0); + } + + public static int func_149999_b(int p_149999_0_) { + return p_149999_0_ & 3; + } + + public static class Size { + private final World field_150867_a; + private final int field_150865_b; + private final int field_150866_c; + private final int field_150863_d; + private int field_150864_e = 0; + private ChunkCoordinates field_150861_f; + private int field_150862_g; + private int field_150868_h; + + + public Size(World p_i45415_1_, int p_i45415_2_, int p_i45415_3_, int p_i45415_4_, int p_i45415_5_) { + this.field_150867_a = p_i45415_1_; + this.field_150865_b = p_i45415_5_; + this.field_150863_d = BlockPortal.field_150001_a[p_i45415_5_][0]; + this.field_150866_c = BlockPortal.field_150001_a[p_i45415_5_][1]; + + for (int var6 = p_i45415_3_; p_i45415_3_ > var6 - 21 && p_i45415_3_ > 0 && this.func_150857_a(p_i45415_1_.getBlock(p_i45415_2_, p_i45415_3_ - 1, p_i45415_4_)); --p_i45415_3_) { + } + + int var7 = this.func_150853_a(p_i45415_2_, p_i45415_3_, p_i45415_4_, this.field_150863_d) - 1; + + if (var7 >= 0) { + this.field_150861_f = new ChunkCoordinates(p_i45415_2_ + var7 * Direction.offsetX[this.field_150863_d], p_i45415_3_, p_i45415_4_ + var7 * Direction.offsetZ[this.field_150863_d]); + this.field_150868_h = this.func_150853_a(this.field_150861_f.posX, this.field_150861_f.posY, this.field_150861_f.posZ, this.field_150866_c); + + if (this.field_150868_h < 2 || this.field_150868_h > 21) { + this.field_150861_f = null; + this.field_150868_h = 0; + } + } + + if (this.field_150861_f != null) { + this.field_150862_g = this.func_150858_a(); + } + } + + protected int func_150853_a(int p_150853_1_, int p_150853_2_, int p_150853_3_, int p_150853_4_) { + int var6 = Direction.offsetX[p_150853_4_]; + int var7 = Direction.offsetZ[p_150853_4_]; + int var5; + Block var8; + + for (var5 = 0; var5 < 22; ++var5) { + var8 = this.field_150867_a.getBlock(p_150853_1_ + var6 * var5, p_150853_2_, p_150853_3_ + var7 * var5); + + if (!this.func_150857_a(var8)) { + break; + } + + Block var9 = this.field_150867_a.getBlock(p_150853_1_ + var6 * var5, p_150853_2_ - 1, p_150853_3_ + var7 * var5); + + if (var9 != Blocks.obsidian) { + break; + } + } + + var8 = this.field_150867_a.getBlock(p_150853_1_ + var6 * var5, p_150853_2_, p_150853_3_ + var7 * var5); + return var8 == Blocks.obsidian ? var5 : 0; + } + + protected int func_150858_a() { + int var1; + int var2; + int var3; + int var4; + label56: + + for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g) { + var1 = this.field_150861_f.posY + this.field_150862_g; + + for (var2 = 0; var2 < this.field_150868_h; ++var2) { + var3 = this.field_150861_f.posX + var2 * Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][1]]; + var4 = this.field_150861_f.posZ + var2 * Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][1]]; + Block var5 = this.field_150867_a.getBlock(var3, var1, var4); + + if (!this.func_150857_a(var5)) { + break label56; + } + + if (var5 == Blocks.portal) { + ++this.field_150864_e; + } + + if (var2 == 0) { + var5 = this.field_150867_a.getBlock(var3 + Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][0]], var1, var4 + Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][0]]); + + if (var5 != Blocks.obsidian) { + break label56; + } + } else if (var2 == this.field_150868_h - 1) { + var5 = this.field_150867_a.getBlock(var3 + Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][1]], var1, var4 + Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][1]]); + + if (var5 != Blocks.obsidian) { + break label56; + } + } + } + } + + for (var1 = 0; var1 < this.field_150868_h; ++var1) { + var2 = this.field_150861_f.posX + var1 * Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][1]]; + var3 = this.field_150861_f.posY + this.field_150862_g; + var4 = this.field_150861_f.posZ + var1 * Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][1]]; + + if (this.field_150867_a.getBlock(var2, var3, var4) != Blocks.obsidian) { + this.field_150862_g = 0; + break; + } + } + + if (this.field_150862_g <= 21 && this.field_150862_g >= 3) { + return this.field_150862_g; + } else { + this.field_150861_f = null; + this.field_150868_h = 0; + this.field_150862_g = 0; + return 0; + } + } + + protected boolean func_150857_a(Block p_150857_1_) { + return p_150857_1_.blockMaterial == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Blocks.portal; + } + + public boolean func_150860_b() { + return this.field_150861_f != null && this.field_150868_h >= 2 && this.field_150868_h <= 21 && this.field_150862_g >= 3 && this.field_150862_g <= 21; + } + + public void func_150859_c() { + for (int var1 = 0; var1 < this.field_150868_h; ++var1) { + int var2 = this.field_150861_f.posX + Direction.offsetX[this.field_150866_c] * var1; + int var3 = this.field_150861_f.posZ + Direction.offsetZ[this.field_150866_c] * var1; + + for (int var4 = 0; var4 < this.field_150862_g; ++var4) { + int var5 = this.field_150861_f.posY + var4; + this.field_150867_a.setBlock(var2, var5, var3, Blocks.portal, this.field_150865_b, 2); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPotato.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPotato.java new file mode 100644 index 0000000..527c217 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPotato.java @@ -0,0 +1,57 @@ +package net.minecraft.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockPotato extends BlockCrops { + private IIcon[] field_149869_a; + + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ < 7) { + if (p_149691_2_ == 6) { + p_149691_2_ = 5; + } + + return this.field_149869_a[p_149691_2_ >> 1]; + } else { + return this.field_149869_a[3]; + } + } + + protected Item func_149866_i() { + return Items.potato; + } + + protected Item func_149865_P() { + return Items.potato; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + + if (!p_149690_1_.isClient) { + if (p_149690_5_ >= 7 && p_149690_1_.rand.nextInt(50) == 0) { + this.dropBlockAsItem_do(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.poisonous_potato)); + } + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149869_a = new IIcon[4]; + + for (int var2 = 0; var2 < this.field_149869_a.length; ++var2) { + this.field_149869_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + var2); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPressurePlate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPressurePlate.java new file mode 100644 index 0000000..b45c723 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPressurePlate.java @@ -0,0 +1,68 @@ +package net.minecraft.block; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class BlockPressurePlate extends BlockBasePressurePlate { + private final BlockPressurePlate.Sensitivity field_150069_a; + + + protected BlockPressurePlate(String p_i45418_1_, Material p_i45418_2_, BlockPressurePlate.Sensitivity p_i45418_3_) { + super(p_i45418_1_, p_i45418_2_); + this.field_150069_a = p_i45418_3_; + } + + protected int func_150066_d(int p_150066_1_) { + return p_150066_1_ > 0 ? 1 : 0; + } + + protected int func_150060_c(int p_150060_1_) { + return p_150060_1_ == 1 ? 15 : 0; + } + + protected int func_150065_e(World p_150065_1_, int p_150065_2_, int p_150065_3_, int p_150065_4_) { + List var5 = null; + + if (this.field_150069_a == BlockPressurePlate.Sensitivity.everything) { + var5 = p_150065_1_.getEntitiesWithinAABBExcludingEntity(null, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)); + } + + if (this.field_150069_a == BlockPressurePlate.Sensitivity.mobs) { + var5 = p_150065_1_.getEntitiesWithinAABB(EntityLivingBase.class, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)); + } + + if (this.field_150069_a == BlockPressurePlate.Sensitivity.players) { + var5 = p_150065_1_.getEntitiesWithinAABB(EntityPlayer.class, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)); + } + + if (var5 != null && !var5.isEmpty()) { + Iterator var6 = var5.iterator(); + + while (var6.hasNext()) { + Entity var7 = (Entity)var6.next(); + + if (!var7.doesEntityNotTriggerPressurePlate()) { + return 15; + } + } + } + + return 0; + } + + public enum Sensitivity { + everything("everything", 0), + mobs("mobs", 1), + players("players", 2); + + private static final BlockPressurePlate.Sensitivity[] $VALUES = new BlockPressurePlate.Sensitivity[]{everything, mobs, players}; + + + Sensitivity(String p_i45417_1_, int p_i45417_2_) {} + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java new file mode 100644 index 0000000..b2ce485 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPressurePlateWeighted.java @@ -0,0 +1,39 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockPressurePlateWeighted extends BlockBasePressurePlate { + private final int field_150068_a; + + + protected BlockPressurePlateWeighted(String p_i45436_1_, Material p_i45436_2_, int p_i45436_3_) { + super(p_i45436_1_, p_i45436_2_); + this.field_150068_a = p_i45436_3_; + } + + protected int func_150065_e(World p_150065_1_, int p_150065_2_, int p_150065_3_, int p_150065_4_) { + int var5 = Math.min(p_150065_1_.getEntitiesWithinAABB(Entity.class, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)).size(), this.field_150068_a); + + if (var5 <= 0) { + return 0; + } else { + float var6 = (float)Math.min(this.field_150068_a, var5) / (float)this.field_150068_a; + return MathHelper.ceiling_float_int(var6 * 15.0F); + } + } + + protected int func_150060_c(int p_150060_1_) { + return p_150060_1_; + } + + protected int func_150066_d(int p_150066_1_) { + return p_150066_1_; + } + + public int func_149738_a(World p_149738_1_) { + return 10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPumpkin.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPumpkin.java new file mode 100644 index 0000000..a80abd3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockPumpkin.java @@ -0,0 +1,112 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockPumpkin extends BlockDirectional { + private final boolean field_149985_a; + private IIcon field_149984_b; + private IIcon field_149986_M; + + + protected BlockPumpkin(boolean p_i45419_1_) { + super(Material.field_151572_C); + this.setTickRandomly(true); + this.field_149985_a = p_i45419_1_; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_149984_b : (p_149691_1_ == 0 ? this.field_149984_b : (p_149691_2_ == 2 && p_149691_1_ == 2 ? this.field_149986_M : (p_149691_2_ == 3 && p_149691_1_ == 5 ? this.field_149986_M : (p_149691_2_ == 0 && p_149691_1_ == 3 ? this.field_149986_M : (p_149691_2_ == 1 && p_149691_1_ == 4 ? this.field_149986_M : this.blockIcon))))); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + + if (p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_) == Blocks.snow && p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_) == Blocks.snow) { + if (!p_149726_1_.isClient) { + p_149726_1_.setBlock(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0), 0, 2); + p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0), 0, 2); + p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0), 0, 2); + EntitySnowman var9 = new EntitySnowman(p_149726_1_); + var9.setLocationAndAngles((double)p_149726_2_ + 0.5D, (double)p_149726_3_ - 1.95D, (double)p_149726_4_ + 0.5D, 0.0F, 0.0F); + p_149726_1_.spawnEntityInWorld(var9); + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0)); + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0)); + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0)); + } + + for (int var10 = 0; var10 < 120; ++var10) { + p_149726_1_.spawnParticle("snowshovel", (double)p_149726_2_ + p_149726_1_.rand.nextDouble(), (double)(p_149726_3_ - 2) + p_149726_1_.rand.nextDouble() * 2.5D, (double)p_149726_4_ + p_149726_1_.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + } else if (p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_) == Blocks.iron_block && p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_) == Blocks.iron_block) { + boolean var5 = p_149726_1_.getBlock(p_149726_2_ - 1, p_149726_3_ - 1, p_149726_4_) == Blocks.iron_block && p_149726_1_.getBlock(p_149726_2_ + 1, p_149726_3_ - 1, p_149726_4_) == Blocks.iron_block; + boolean var6 = p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_ - 1) == Blocks.iron_block && p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_ + 1) == Blocks.iron_block; + + if (var5 || var6) { + p_149726_1_.setBlock(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0), 0, 2); + p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0), 0, 2); + p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0), 0, 2); + + if (var5) { + p_149726_1_.setBlock(p_149726_2_ - 1, p_149726_3_ - 1, p_149726_4_, getBlockById(0), 0, 2); + p_149726_1_.setBlock(p_149726_2_ + 1, p_149726_3_ - 1, p_149726_4_, getBlockById(0), 0, 2); + } else { + p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_ - 1, getBlockById(0), 0, 2); + p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_ + 1, getBlockById(0), 0, 2); + } + + EntityIronGolem var7 = new EntityIronGolem(p_149726_1_); + var7.setPlayerCreated(true); + var7.setLocationAndAngles((double)p_149726_2_ + 0.5D, (double)p_149726_3_ - 1.95D, (double)p_149726_4_ + 0.5D, 0.0F, 0.0F); + p_149726_1_.spawnEntityInWorld(var7); + + for (int var8 = 0; var8 < 120; ++var8) { + p_149726_1_.spawnParticle("snowballpoof", (double)p_149726_2_ + p_149726_1_.rand.nextDouble(), (double)(p_149726_3_ - 2) + p_149726_1_.rand.nextDouble() * 3.9D, (double)p_149726_4_ + p_149726_1_.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0)); + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0)); + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0)); + + if (var5) { + p_149726_1_.notifyBlockChange(p_149726_2_ - 1, p_149726_3_ - 1, p_149726_4_, getBlockById(0)); + p_149726_1_.notifyBlockChange(p_149726_2_ + 1, p_149726_3_ - 1, p_149726_4_, getBlockById(0)); + } else { + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_ - 1, getBlockById(0)); + p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_ + 1, getBlockById(0)); + } + } + } + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).blockMaterial.isReplaceable() && World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149986_M = p_149651_1_.registerIcon(this.getTextureName() + "_face_" + (this.field_149985_a ? "on" : "off")); + this.field_149984_b = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockQuartz.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockQuartz.java new file mode 100644 index 0000000..ba120a1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockQuartz.java @@ -0,0 +1,121 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockQuartz extends Block { + public static final String[] field_150191_a = new String[] {"default", "chiseled", "lines"}; + private static final String[] field_150189_b = new String[] {"side", "chiseled", "lines", null, null}; + private IIcon[] field_150192_M; + private IIcon field_150193_N; + private IIcon field_150194_O; + private IIcon field_150190_P; + private IIcon field_150188_Q; + + + public BlockQuartz() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ != 2 && p_149691_2_ != 3 && p_149691_2_ != 4) { + if (p_149691_1_ != 1 && (p_149691_1_ != 0 || p_149691_2_ != 1)) { + if (p_149691_1_ == 0) { + return this.field_150188_Q; + } else { + if (p_149691_2_ < 0 || p_149691_2_ >= this.field_150192_M.length) { + p_149691_2_ = 0; + } + + return this.field_150192_M[p_149691_2_]; + } + } else { + return p_149691_2_ == 1 ? this.field_150193_N : this.field_150190_P; + } + } else { + return p_149691_2_ == 2 && (p_149691_1_ == 1 || p_149691_1_ == 0) ? this.field_150194_O : (p_149691_2_ == 3 && (p_149691_1_ == 5 || p_149691_1_ == 4) ? this.field_150194_O : (p_149691_2_ == 4 && (p_149691_1_ == 2 || p_149691_1_ == 3) ? this.field_150194_O : this.field_150192_M[p_149691_2_])); + } + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + if (p_149660_9_ == 2) { + switch (p_149660_5_) { + case 0: + case 1: + p_149660_9_ = 2; + break; + + case 2: + case 3: + p_149660_9_ = 4; + break; + + case 4: + case 5: + p_149660_9_ = 3; + } + } + + return p_149660_9_; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_ != 3 && p_149692_1_ != 4 ? p_149692_1_ : 2; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return p_149644_1_ != 3 && p_149644_1_ != 4 ? super.createStackedBlock(p_149644_1_) : new ItemStack(Item.getItemFromBlock(this), 1, 2); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 39; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150192_M = new IIcon[field_150189_b.length]; + + for (int var2 = 0; var2 < this.field_150192_M.length; ++var2) { + if (field_150189_b[var2] == null) { + this.field_150192_M[var2] = this.field_150192_M[var2 - 1]; + } else { + this.field_150192_M[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_150189_b[var2]); + } + } + + this.field_150190_P = p_149651_1_.registerIcon(this.getTextureName() + "_" + "top"); + this.field_150193_N = p_149651_1_.registerIcon(this.getTextureName() + "_" + "chiseled_top"); + this.field_150194_O = p_149651_1_.registerIcon(this.getTextureName() + "_" + "lines_top"); + this.field_150188_Q = p_149651_1_.registerIcon(this.getTextureName() + "_" + "bottom"); + } + + public MapColor getMapColor(int p_149728_1_) { + return MapColor.field_151677_p; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRail.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRail.java new file mode 100644 index 0000000..683f52d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRail.java @@ -0,0 +1,32 @@ +package net.minecraft.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockRail extends BlockRailBase { + private IIcon field_150056_b; + + + protected BlockRail() { + super(false); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_2_ >= 6 ? this.field_150056_b : this.blockIcon; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + super.registerBlockIcons(p_149651_1_); + this.field_150056_b = p_149651_1_.registerIcon(this.getTextureName() + "_turned"); + } + + protected void func_150048_a(World p_150048_1_, int p_150048_2_, int p_150048_3_, int p_150048_4_, int p_150048_5_, int p_150048_6_, Block p_150048_7_) { + if (p_150048_7_.canProvidePower() && (new BlockRailBase.Rail(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_)).func_150650_a() == 3) { + this.func_150052_a(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_, false); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailBase.java new file mode 100644 index 0000000..61e7885 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailBase.java @@ -0,0 +1,503 @@ +package net.minecraft.block; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockRailBase extends Block { + protected final boolean field_150053_a; + + + public static final boolean func_150049_b_(World p_150049_0_, int p_150049_1_, int p_150049_2_, int p_150049_3_) { + return func_150051_a(p_150049_0_.getBlock(p_150049_1_, p_150049_2_, p_150049_3_)); + } + + public static final boolean func_150051_a(Block p_150051_0_) { + return p_150051_0_ == Blocks.rail || p_150051_0_ == Blocks.golden_rail || p_150051_0_ == Blocks.detector_rail || p_150051_0_ == Blocks.activator_rail; + } + + protected BlockRailBase(boolean p_i45389_1_) { + super(Material.circuits); + this.field_150053_a = p_i45389_1_; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setCreativeTab(CreativeTabs.tabTransport); + } + + public boolean func_150050_e() { + return this.field_150053_a; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) { + this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_); + return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + + if (var5 >= 2 && var5 <= 5) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 9; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + if (!p_149726_1_.isClient) { + this.func_150052_a(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, true); + + if (this.field_150053_a) { + this.onNeighborBlockChange(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, this); + } + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + int var7 = var6; + + if (this.field_150053_a) { + var7 = var6 & 7; + } + + boolean var8 = !World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_); + + if (var7 == 2 && !World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_ + 1, p_149695_3_, p_149695_4_)) { + var8 = true; + } + + if (var7 == 3 && !World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_ - 1, p_149695_3_, p_149695_4_)) { + var8 = true; + } + + if (var7 == 4 && !World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_ - 1)) { + var8 = true; + } + + if (var7 == 5 && !World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_ + 1)) { + var8 = true; + } + + if (var8) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } else { + this.func_150048_a(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var6, var7, p_149695_5_); + } + } + } + + protected void func_150048_a(World p_150048_1_, int p_150048_2_, int p_150048_3_, int p_150048_4_, int p_150048_5_, int p_150048_6_, Block p_150048_7_) {} + + protected void func_150052_a(World p_150052_1_, int p_150052_2_, int p_150052_3_, int p_150052_4_, boolean p_150052_5_) { + if (!p_150052_1_.isClient) { + (new BlockRailBase.Rail(p_150052_1_, p_150052_2_, p_150052_3_, p_150052_4_)).func_150655_a(p_150052_1_.isBlockIndirectlyGettingPowered(p_150052_2_, p_150052_3_, p_150052_4_), p_150052_5_); + } + } + + public int getMobilityFlag() { + return 0; + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + int var7 = p_149749_6_; + + if (this.field_150053_a) { + var7 = p_149749_6_ & 7; + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + + if (var7 == 2 || var7 == 3 || var7 == 4 || var7 == 5) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ + 1, p_149749_4_, p_149749_5_); + } + + if (this.field_150053_a) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ - 1, p_149749_4_, p_149749_5_); + } + } + + public class Rail { + private final World field_150660_b; + private final int field_150661_c; + private final int field_150658_d; + private final int field_150659_e; + private final boolean field_150656_f; + private final List field_150657_g = new ArrayList(); + + + public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_) { + this.field_150660_b = p_i45388_2_; + this.field_150661_c = p_i45388_3_; + this.field_150658_d = p_i45388_4_; + this.field_150659_e = p_i45388_5_; + Block var6 = p_i45388_2_.getBlock(p_i45388_3_, p_i45388_4_, p_i45388_5_); + int var7 = p_i45388_2_.getBlockMetadata(p_i45388_3_, p_i45388_4_, p_i45388_5_); + + if (((BlockRailBase)var6).field_150053_a) { + this.field_150656_f = true; + var7 &= -9; + } else { + this.field_150656_f = false; + } + + this.func_150648_a(var7); + } + + private void func_150648_a(int p_150648_1_) { + this.field_150657_g.clear(); + + if (p_150648_1_ == 0) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } else if (p_150648_1_ == 1) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + } else if (p_150648_1_ == 2) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)); + } else if (p_150648_1_ == 3) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d + 1, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + } else if (p_150648_1_ == 4) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } else if (p_150648_1_ == 5) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d + 1, this.field_150659_e + 1)); + } else if (p_150648_1_ == 6) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } else if (p_150648_1_ == 7) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } else if (p_150648_1_ == 8) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + } else if (p_150648_1_ == 9) { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + } + } + + private void func_150651_b() { + for (int var1 = 0; var1 < this.field_150657_g.size(); ++var1) { + BlockRailBase.Rail var2 = this.func_150654_a((ChunkPosition)this.field_150657_g.get(var1)); + + if (var2 != null && var2.func_150653_a(this)) { + this.field_150657_g.set(var1, new ChunkPosition(var2.field_150661_c, var2.field_150658_d, var2.field_150659_e)); + } else { + this.field_150657_g.remove(var1--); + } + } + } + + private boolean func_150646_a(int p_150646_1_, int p_150646_2_, int p_150646_3_) { + return BlockRailBase.func_150049_b_(this.field_150660_b, p_150646_1_, p_150646_2_, p_150646_3_) || (BlockRailBase.func_150049_b_(this.field_150660_b, p_150646_1_, p_150646_2_ + 1, p_150646_3_) || BlockRailBase.func_150049_b_(this.field_150660_b, p_150646_1_, p_150646_2_ - 1, p_150646_3_)); + } + + private BlockRailBase.Rail func_150654_a(ChunkPosition p_150654_1_) { + return BlockRailBase.func_150049_b_(this.field_150660_b, p_150654_1_.field_151329_a, p_150654_1_.field_151327_b, p_150654_1_.field_151328_c) ? BlockRailBase.this.new Rail(this.field_150660_b, p_150654_1_.field_151329_a, p_150654_1_.field_151327_b, p_150654_1_.field_151328_c) : (BlockRailBase.func_150049_b_(this.field_150660_b, p_150654_1_.field_151329_a, p_150654_1_.field_151327_b + 1, p_150654_1_.field_151328_c) ? BlockRailBase.this.new Rail(this.field_150660_b, p_150654_1_.field_151329_a, p_150654_1_.field_151327_b + 1, p_150654_1_.field_151328_c) : (BlockRailBase.func_150049_b_(this.field_150660_b, p_150654_1_.field_151329_a, p_150654_1_.field_151327_b - 1, p_150654_1_.field_151328_c) ? BlockRailBase.this.new Rail(this.field_150660_b, p_150654_1_.field_151329_a, p_150654_1_.field_151327_b - 1, p_150654_1_.field_151328_c) : null)); + } + + private boolean func_150653_a(BlockRailBase.Rail p_150653_1_) { + for (int var2 = 0; var2 < this.field_150657_g.size(); ++var2) { + ChunkPosition var3 = (ChunkPosition)this.field_150657_g.get(var2); + + if (var3.field_151329_a == p_150653_1_.field_150661_c && var3.field_151328_c == p_150653_1_.field_150659_e) { + return true; + } + } + + return false; + } + + private boolean func_150652_b(int p_150652_1_, int p_150652_2_, int p_150652_3_) { + for (int var4 = 0; var4 < this.field_150657_g.size(); ++var4) { + ChunkPosition var5 = (ChunkPosition)this.field_150657_g.get(var4); + + if (var5.field_151329_a == p_150652_1_ && var5.field_151328_c == p_150652_3_) { + return true; + } + } + + return false; + } + + protected int func_150650_a() { + int var1 = 0; + + if (this.func_150646_a(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)) { + ++var1; + } + + if (this.func_150646_a(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)) { + ++var1; + } + + if (this.func_150646_a(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)) { + ++var1; + } + + if (this.func_150646_a(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)) { + ++var1; + } + + return var1; + } + + private boolean func_150649_b(BlockRailBase.Rail p_150649_1_) { + return this.func_150653_a(p_150649_1_) || (this.field_150657_g.size() != 2); + } + + private void func_150645_c(BlockRailBase.Rail p_150645_1_) { + this.field_150657_g.add(new ChunkPosition(p_150645_1_.field_150661_c, p_150645_1_.field_150658_d, p_150645_1_.field_150659_e)); + boolean var2 = this.func_150652_b(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1); + boolean var3 = this.func_150652_b(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1); + boolean var4 = this.func_150652_b(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e); + boolean var5 = this.func_150652_b(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e); + byte var6 = -1; + + if (var2 || var3) { + var6 = 0; + } + + if (var4 || var5) { + var6 = 1; + } + + if (!this.field_150656_f) { + if (var3 && var5 && !var2 && !var4) { + var6 = 6; + } + + if (var3 && var4 && !var2 && !var5) { + var6 = 7; + } + + if (var2 && var4 && !var3 && !var5) { + var6 = 8; + } + + if (var2 && var5 && !var3 && !var4) { + var6 = 9; + } + } + + if (var6 == 0) { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) { + var6 = 4; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e + 1)) { + var6 = 5; + } + } + + if (var6 == 1) { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) { + var6 = 2; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c - 1, this.field_150658_d + 1, this.field_150659_e)) { + var6 = 3; + } + } + + if (var6 < 0) { + var6 = 0; + } + + int var7 = var6; + + if (this.field_150656_f) { + var7 = this.field_150660_b.getBlockMetadata(this.field_150661_c, this.field_150658_d, this.field_150659_e) & 8 | var6; + } + + this.field_150660_b.setBlockMetadataWithNotify(this.field_150661_c, this.field_150658_d, this.field_150659_e, var7, 3); + } + + private boolean func_150647_c(int p_150647_1_, int p_150647_2_, int p_150647_3_) { + BlockRailBase.Rail var4 = this.func_150654_a(new ChunkPosition(p_150647_1_, p_150647_2_, p_150647_3_)); + + if (var4 == null) { + return false; + } else { + var4.func_150651_b(); + return var4.func_150649_b(this); + } + } + + public void func_150655_a(boolean p_150655_1_, boolean p_150655_2_) { + boolean var3 = this.func_150647_c(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1); + boolean var4 = this.func_150647_c(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1); + boolean var5 = this.func_150647_c(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e); + boolean var6 = this.func_150647_c(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e); + byte var7 = -1; + + if ((var3 || var4) && !var5 && !var6) { + var7 = 0; + } + + if ((var5 || var6) && !var3 && !var4) { + var7 = 1; + } + + if (!this.field_150656_f) { + if (var4 && var6 && !var3 && !var5) { + var7 = 6; + } + + if (var4 && var5 && !var3 && !var6) { + var7 = 7; + } + + if (var3 && var5 && !var4 && !var6) { + var7 = 8; + } + + if (var3 && var6 && !var4 && !var5) { + var7 = 9; + } + } + + if (var7 == -1) { + if (var3 || var4) { + var7 = 0; + } + + if (var5 || var6) { + var7 = 1; + } + + if (!this.field_150656_f) { + if (p_150655_1_) { + if (var4 && var6) { + var7 = 6; + } + + if (var5 && var4) { + var7 = 7; + } + + if (var6 && var3) { + var7 = 9; + } + + if (var3 && var5) { + var7 = 8; + } + } else { + if (var3 && var5) { + var7 = 8; + } + + if (var6 && var3) { + var7 = 9; + } + + if (var5 && var4) { + var7 = 7; + } + + if (var4 && var6) { + var7 = 6; + } + } + } + } + + if (var7 == 0) { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) { + var7 = 4; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e + 1)) { + var7 = 5; + } + } + + if (var7 == 1) { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) { + var7 = 2; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c - 1, this.field_150658_d + 1, this.field_150659_e)) { + var7 = 3; + } + } + + if (var7 < 0) { + var7 = 0; + } + + this.func_150648_a(var7); + int var8 = var7; + + if (this.field_150656_f) { + var8 = this.field_150660_b.getBlockMetadata(this.field_150661_c, this.field_150658_d, this.field_150659_e) & 8 | var7; + } + + if (p_150655_2_ || this.field_150660_b.getBlockMetadata(this.field_150661_c, this.field_150658_d, this.field_150659_e) != var8) { + this.field_150660_b.setBlockMetadataWithNotify(this.field_150661_c, this.field_150658_d, this.field_150659_e, var8, 3); + + for (int var9 = 0; var9 < this.field_150657_g.size(); ++var9) { + BlockRailBase.Rail var10 = this.func_150654_a((ChunkPosition)this.field_150657_g.get(var9)); + + if (var10 != null) { + var10.func_150651_b(); + + if (var10.func_150649_b(this)) { + var10.func_150645_c(this); + } + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailDetector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailDetector.java new file mode 100644 index 0000000..f09c385 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailDetector.java @@ -0,0 +1,139 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRailDetector extends BlockRailBase { + private IIcon[] field_150055_b; + + + public BlockRailDetector() { + super(true); + this.setTickRandomly(true); + } + + public int func_149738_a(World p_149738_1_) { + return 20; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + if (!p_149670_1_.isClient) { + int var6 = p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_); + + if ((var6 & 8) == 0) { + this.func_150054_a(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, var6); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if ((var6 & 8) != 0) { + this.func_150054_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, var6); + } + } + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return (p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_) & 8) != 0 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + return (p_149748_1_.getBlockMetadata(p_149748_2_, p_149748_3_, p_149748_4_) & 8) == 0 ? 0 : (p_149748_5_ == 1 ? 15 : 0); + } + + private void func_150054_a(World p_150054_1_, int p_150054_2_, int p_150054_3_, int p_150054_4_, int p_150054_5_) { + boolean var6 = (p_150054_5_ & 8) != 0; + boolean var7 = false; + float var8 = 0.125F; + List var9 = p_150054_1_.getEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((float)p_150054_2_ + var8, p_150054_3_, (float)p_150054_4_ + var8, (float)(p_150054_2_ + 1) - var8, (float)(p_150054_3_ + 1) - var8, (float)(p_150054_4_ + 1) - var8)); + + if (!var9.isEmpty()) { + var7 = true; + } + + if (var7 && !var6) { + p_150054_1_.setBlockMetadataWithNotify(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_5_ | 8, 3); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_, p_150054_4_, this); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_ - 1, p_150054_4_, this); + p_150054_1_.markBlockRangeForRenderUpdate(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_2_, p_150054_3_, p_150054_4_); + } + + if (!var7 && var6) { + p_150054_1_.setBlockMetadataWithNotify(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_5_ & 7, 3); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_, p_150054_4_, this); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_ - 1, p_150054_4_, this); + p_150054_1_.markBlockRangeForRenderUpdate(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_2_, p_150054_3_, p_150054_4_); + } + + if (var7) { + p_150054_1_.scheduleBlockUpdate(p_150054_2_, p_150054_3_, p_150054_4_, this, this.func_149738_a(p_150054_1_)); + } + + p_150054_1_.func_147453_f(p_150054_2_, p_150054_3_, p_150054_4_, this); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + this.func_150054_a(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, p_149726_1_.getBlockMetadata(p_149726_2_, p_149726_3_, p_149726_4_)); + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { + if ((p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_) & 8) > 0) { + float var6 = 0.125F; + List var7 = p_149736_1_.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getBoundingBox((float)p_149736_2_ + var6, p_149736_3_, (float)p_149736_4_ + var6, (float)(p_149736_2_ + 1) - var6, (float)(p_149736_3_ + 1) - var6, (float)(p_149736_4_ + 1) - var6)); + + if (var7.size() > 0) { + return ((EntityMinecartCommandBlock)var7.get(0)).func_145822_e().func_145760_g(); + } + + List var8 = p_149736_1_.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((float)p_149736_2_ + var6, p_149736_3_, (float)p_149736_4_ + var6, (float)(p_149736_2_ + 1) - var6, (float)(p_149736_3_ + 1) - var6, (float)(p_149736_4_ + 1) - var6), IEntitySelector.selectInventories); + + if (var8.size() > 0) { + return Container.calcRedstoneFromInventory((IInventory)var8.get(0)); + } + } + + return 0; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150055_b = new IIcon[2]; + this.field_150055_b[0] = p_149651_1_.registerIcon(this.getTextureName()); + this.field_150055_b[1] = p_149651_1_.registerIcon(this.getTextureName() + "_powered"); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return (p_149691_2_ & 8) != 0 ? this.field_150055_b[1] : this.field_150055_b[0]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailPowered.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailPowered.java new file mode 100644 index 0000000..24679dd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRailPowered.java @@ -0,0 +1,153 @@ +package net.minecraft.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockRailPowered extends BlockRailBase { + protected IIcon field_150059_b; + + + protected BlockRailPowered() { + super(true); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return (p_149691_2_ & 8) == 0 ? this.blockIcon : this.field_150059_b; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + super.registerBlockIcons(p_149651_1_); + this.field_150059_b = p_149651_1_.registerIcon(this.getTextureName() + "_powered"); + } + + protected boolean func_150058_a(World p_150058_1_, int p_150058_2_, int p_150058_3_, int p_150058_4_, int p_150058_5_, boolean p_150058_6_, int p_150058_7_) { + if (p_150058_7_ >= 8) { + return false; + } else { + int var8 = p_150058_5_ & 7; + boolean var9 = true; + + switch (var8) { + case 0: + if (p_150058_6_) { + ++p_150058_4_; + } else { + --p_150058_4_; + } + + break; + + case 1: + if (p_150058_6_) { + --p_150058_2_; + } else { + ++p_150058_2_; + } + + break; + + case 2: + if (p_150058_6_) { + --p_150058_2_; + } else { + ++p_150058_2_; + ++p_150058_3_; + var9 = false; + } + + var8 = 1; + break; + + case 3: + if (p_150058_6_) { + --p_150058_2_; + ++p_150058_3_; + var9 = false; + } else { + ++p_150058_2_; + } + + var8 = 1; + break; + + case 4: + if (p_150058_6_) { + ++p_150058_4_; + } else { + --p_150058_4_; + ++p_150058_3_; + var9 = false; + } + + var8 = 0; + break; + + case 5: + if (p_150058_6_) { + ++p_150058_4_; + ++p_150058_3_; + var9 = false; + } else { + --p_150058_4_; + } + + var8 = 0; + } + + return this.func_150057_a(p_150058_1_, p_150058_2_, p_150058_3_, p_150058_4_, p_150058_6_, p_150058_7_, var8) || var9 && this.func_150057_a(p_150058_1_, p_150058_2_, p_150058_3_ - 1, p_150058_4_, p_150058_6_, p_150058_7_, var8); + } + } + + protected boolean func_150057_a(World p_150057_1_, int p_150057_2_, int p_150057_3_, int p_150057_4_, boolean p_150057_5_, int p_150057_6_, int p_150057_7_) { + Block var8 = p_150057_1_.getBlock(p_150057_2_, p_150057_3_, p_150057_4_); + + if (var8 == this) { + int var9 = p_150057_1_.getBlockMetadata(p_150057_2_, p_150057_3_, p_150057_4_); + int var10 = var9 & 7; + + if (p_150057_7_ == 1 && (var10 == 0 || var10 == 4 || var10 == 5)) { + return false; + } + + if (p_150057_7_ == 0 && (var10 == 1 || var10 == 2 || var10 == 3)) { + return false; + } + + if ((var9 & 8) != 0) { + if (p_150057_1_.isBlockIndirectlyGettingPowered(p_150057_2_, p_150057_3_, p_150057_4_)) { + return true; + } + + return this.func_150058_a(p_150057_1_, p_150057_2_, p_150057_3_, p_150057_4_, var9, p_150057_5_, p_150057_6_ + 1); + } + } + + return false; + } + + protected void func_150048_a(World p_150048_1_, int p_150048_2_, int p_150048_3_, int p_150048_4_, int p_150048_5_, int p_150048_6_, Block p_150048_7_) { + boolean var8 = p_150048_1_.isBlockIndirectlyGettingPowered(p_150048_2_, p_150048_3_, p_150048_4_); + var8 = var8 || this.func_150058_a(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_, p_150048_5_, true, 0) || this.func_150058_a(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_, p_150048_5_, false, 0); + boolean var9 = false; + + if (var8 && (p_150048_5_ & 8) == 0) { + p_150048_1_.setBlockMetadataWithNotify(p_150048_2_, p_150048_3_, p_150048_4_, p_150048_6_ | 8, 3); + var9 = true; + } else if (!var8 && (p_150048_5_ & 8) != 0) { + p_150048_1_.setBlockMetadataWithNotify(p_150048_2_, p_150048_3_, p_150048_4_, p_150048_6_, 3); + var9 = true; + } + + if (var9) { + p_150048_1_.notifyBlocksOfNeighborChange(p_150048_2_, p_150048_3_ - 1, p_150048_4_, this); + + if (p_150048_6_ == 2 || p_150048_6_ == 3 || p_150048_6_ == 4 || p_150048_6_ == 5) { + p_150048_1_.notifyBlocksOfNeighborChange(p_150048_2_, p_150048_3_ + 1, p_150048_4_, this); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneComparator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneComparator.java new file mode 100644 index 0000000..e736dbb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneComparator.java @@ -0,0 +1,202 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityComparator; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider { + + + public BlockRedstoneComparator(boolean p_i45399_1_) { + super(p_i45399_1_); + this.isBlockContainer = true; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.comparator; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.comparator; + } + + protected int func_149901_b(int p_149901_1_) { + return 2; + } + + protected BlockRedstoneDiode func_149906_e() { + return Blocks.powered_comparator; + } + + protected BlockRedstoneDiode func_149898_i() { + return Blocks.unpowered_comparator; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 37; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + boolean var3 = this.field_149914_a || (p_149691_2_ & 8) != 0; + return p_149691_1_ == 0 ? (var3 ? Blocks.redstone_torch.getBlockTextureFromSide(p_149691_1_) : Blocks.unlit_redstone_torch.getBlockTextureFromSide(p_149691_1_)) : (p_149691_1_ == 1 ? (var3 ? Blocks.powered_comparator.blockIcon : this.blockIcon) : Blocks.double_stone_slab.getBlockTextureFromSide(1)); + } + + protected boolean func_149905_c(int p_149905_1_) { + return this.field_149914_a || (p_149905_1_ & 8) != 0; + } + + protected int func_149904_f(IBlockAccess p_149904_1_, int p_149904_2_, int p_149904_3_, int p_149904_4_, int p_149904_5_) { + return this.func_149971_e(p_149904_1_, p_149904_2_, p_149904_3_, p_149904_4_).func_145996_a(); + } + + private int func_149970_j(World p_149970_1_, int p_149970_2_, int p_149970_3_, int p_149970_4_, int p_149970_5_) { + return !this.func_149969_d(p_149970_5_) ? this.func_149903_h(p_149970_1_, p_149970_2_, p_149970_3_, p_149970_4_, p_149970_5_) : Math.max(this.func_149903_h(p_149970_1_, p_149970_2_, p_149970_3_, p_149970_4_, p_149970_5_) - this.func_149902_h(p_149970_1_, p_149970_2_, p_149970_3_, p_149970_4_, p_149970_5_), 0); + } + + public boolean func_149969_d(int p_149969_1_) { + return (p_149969_1_ & 4) == 4; + } + + protected boolean func_149900_a(World p_149900_1_, int p_149900_2_, int p_149900_3_, int p_149900_4_, int p_149900_5_) { + int var6 = this.func_149903_h(p_149900_1_, p_149900_2_, p_149900_3_, p_149900_4_, p_149900_5_); + + if (var6 >= 15) { + return true; + } else if (var6 == 0) { + return false; + } else { + int var7 = this.func_149902_h(p_149900_1_, p_149900_2_, p_149900_3_, p_149900_4_, p_149900_5_); + return var7 == 0 || var6 >= var7; + } + } + + protected int func_149903_h(World p_149903_1_, int p_149903_2_, int p_149903_3_, int p_149903_4_, int p_149903_5_) { + int var6 = super.func_149903_h(p_149903_1_, p_149903_2_, p_149903_3_, p_149903_4_, p_149903_5_); + int var7 = func_149895_l(p_149903_5_); + int var8 = p_149903_2_ + Direction.offsetX[var7]; + int var9 = p_149903_4_ + Direction.offsetZ[var7]; + Block var10 = p_149903_1_.getBlock(var8, p_149903_3_, var9); + + if (var10.hasComparatorInputOverride()) { + var6 = var10.getComparatorInputOverride(p_149903_1_, var8, p_149903_3_, var9, Direction.rotateOpposite[var7]); + } else if (var6 < 15 && var10.isNormalCube()) { + var8 += Direction.offsetX[var7]; + var9 += Direction.offsetZ[var7]; + var10 = p_149903_1_.getBlock(var8, p_149903_3_, var9); + + if (var10.hasComparatorInputOverride()) { + var6 = var10.getComparatorInputOverride(p_149903_1_, var8, p_149903_3_, var9, Direction.rotateOpposite[var7]); + } + } + + return var6; + } + + public TileEntityComparator func_149971_e(IBlockAccess p_149971_1_, int p_149971_2_, int p_149971_3_, int p_149971_4_) { + return (TileEntityComparator)p_149971_1_.getTileEntity(p_149971_2_, p_149971_3_, p_149971_4_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + int var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + boolean var11 = this.field_149914_a | (var10 & 8) != 0; + boolean var12 = !this.func_149969_d(var10); + int var13 = var12 ? 4 : 0; + var13 |= var11 ? 8 : 0; + p_149727_1_.playSoundEffect((double)p_149727_2_ + 0.5D, (double)p_149727_3_ + 0.5D, (double)p_149727_4_ + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F); + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var13 | var10 & 3, 2); + this.func_149972_c(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_1_.rand); + return true; + } + + protected void func_149897_b(World p_149897_1_, int p_149897_2_, int p_149897_3_, int p_149897_4_, Block p_149897_5_) { + if (!p_149897_1_.func_147477_a(p_149897_2_, p_149897_3_, p_149897_4_, this)) { + int var6 = p_149897_1_.getBlockMetadata(p_149897_2_, p_149897_3_, p_149897_4_); + int var7 = this.func_149970_j(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, var6); + int var8 = this.func_149971_e(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_).func_145996_a(); + + if (var7 != var8 || this.func_149905_c(var6) != this.func_149900_a(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, var6)) { + if (this.func_149912_i(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, var6)) { + p_149897_1_.func_147454_a(p_149897_2_, p_149897_3_, p_149897_4_, this, this.func_149901_b(0), -1); + } else { + p_149897_1_.func_147454_a(p_149897_2_, p_149897_3_, p_149897_4_, this, this.func_149901_b(0), 0); + } + } + } + } + + private void func_149972_c(World p_149972_1_, int p_149972_2_, int p_149972_3_, int p_149972_4_, Random p_149972_5_) { + int var6 = p_149972_1_.getBlockMetadata(p_149972_2_, p_149972_3_, p_149972_4_); + int var7 = this.func_149970_j(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_, var6); + int var8 = this.func_149971_e(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_).func_145996_a(); + this.func_149971_e(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_).func_145995_a(var7); + + if (var8 != var7 || !this.func_149969_d(var6)) { + boolean var9 = this.func_149900_a(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_, var6); + boolean var10 = this.field_149914_a || (var6 & 8) != 0; + + if (var10 && !var9) { + p_149972_1_.setBlockMetadataWithNotify(p_149972_2_, p_149972_3_, p_149972_4_, var6 & -9, 2); + } else if (!var10 && var9) { + p_149972_1_.setBlockMetadataWithNotify(p_149972_2_, p_149972_3_, p_149972_4_, var6 | 8, 2); + } + + this.func_149911_e(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (this.field_149914_a) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, this.func_149898_i(), var6 | 8, 4); + } + + this.func_149972_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + p_149726_1_.setTileEntity(p_149726_2_, p_149726_3_, p_149726_4_, this.createNewTileEntity(p_149726_1_, 0)); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + this.func_149911_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_); + } + + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); + TileEntity var7 = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); + return var7 != null && var7.receiveClientEvent(p_149696_5_, p_149696_6_); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityComparator(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneDiode.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneDiode.java new file mode 100644 index 0000000..a9b5d7f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneDiode.java @@ -0,0 +1,276 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockRedstoneDiode extends BlockDirectional { + protected final boolean field_149914_a; + + + protected BlockRedstoneDiode(boolean p_i45400_1_) { + super(Material.circuits); + this.field_149914_a = p_i45400_1_; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return World.doesBlockHaveSolidTopSurface(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_) && super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + int var6 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (!this.func_149910_g(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, var6)) { + boolean var7 = this.func_149900_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, var6); + + if (this.field_149914_a && !var7) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, this.func_149898_i(), var6, 2); + } else if (!this.field_149914_a) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, this.func_149906_e(), var6, 2); + + if (!var7) { + p_149674_1_.func_147454_a(p_149674_2_, p_149674_3_, p_149674_4_, this.func_149906_e(), this.func_149899_k(var6), -1); + } + } + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 0 ? (this.field_149914_a ? Blocks.redstone_torch.getBlockTextureFromSide(p_149691_1_) : Blocks.unlit_redstone_torch.getBlockTextureFromSide(p_149691_1_)) : (p_149691_1_ == 1 ? this.blockIcon : Blocks.double_stone_slab.getBlockTextureFromSide(1)); + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return p_149646_5_ != 0 && p_149646_5_ != 1; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 36; + } + + protected boolean func_149905_c(int p_149905_1_) { + return this.field_149914_a; + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + return this.isProvidingWeakPower(p_149748_1_, p_149748_2_, p_149748_3_, p_149748_4_, p_149748_5_); + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + int var6 = p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_); + + if (!this.func_149905_c(var6)) { + return 0; + } else { + int var7 = func_149895_l(var6); + return var7 == 0 && p_149709_5_ == 3 ? this.func_149904_f(p_149709_1_, p_149709_2_, p_149709_3_, p_149709_4_, var6) : (var7 == 1 && p_149709_5_ == 4 ? this.func_149904_f(p_149709_1_, p_149709_2_, p_149709_3_, p_149709_4_, var6) : (var7 == 2 && p_149709_5_ == 2 ? this.func_149904_f(p_149709_1_, p_149709_2_, p_149709_3_, p_149709_4_, var6) : (var7 == 3 && p_149709_5_ == 5 ? this.func_149904_f(p_149709_1_, p_149709_2_, p_149709_3_, p_149709_4_, var6) : 0))); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!this.canBlockStay(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + p_149695_1_.notifyBlocksOfNeighborChange(p_149695_2_ + 1, p_149695_3_, p_149695_4_, this); + p_149695_1_.notifyBlocksOfNeighborChange(p_149695_2_ - 1, p_149695_3_, p_149695_4_, this); + p_149695_1_.notifyBlocksOfNeighborChange(p_149695_2_, p_149695_3_, p_149695_4_ + 1, this); + p_149695_1_.notifyBlocksOfNeighborChange(p_149695_2_, p_149695_3_, p_149695_4_ - 1, this); + p_149695_1_.notifyBlocksOfNeighborChange(p_149695_2_, p_149695_3_ - 1, p_149695_4_, this); + p_149695_1_.notifyBlocksOfNeighborChange(p_149695_2_, p_149695_3_ + 1, p_149695_4_, this); + } else { + this.func_149897_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + } + } + + protected void func_149897_b(World p_149897_1_, int p_149897_2_, int p_149897_3_, int p_149897_4_, Block p_149897_5_) { + int var6 = p_149897_1_.getBlockMetadata(p_149897_2_, p_149897_3_, p_149897_4_); + + if (!this.func_149910_g(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, var6)) { + boolean var7 = this.func_149900_a(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, var6); + + if ((this.field_149914_a && !var7 || !this.field_149914_a && var7) && !p_149897_1_.func_147477_a(p_149897_2_, p_149897_3_, p_149897_4_, this)) { + byte var8 = -1; + + if (this.func_149912_i(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, var6)) { + var8 = -3; + } else if (this.field_149914_a) { + var8 = -2; + } + + p_149897_1_.func_147454_a(p_149897_2_, p_149897_3_, p_149897_4_, this, this.func_149901_b(var6), var8); + } + } + } + + public boolean func_149910_g(IBlockAccess p_149910_1_, int p_149910_2_, int p_149910_3_, int p_149910_4_, int p_149910_5_) { + return false; + } + + protected boolean func_149900_a(World p_149900_1_, int p_149900_2_, int p_149900_3_, int p_149900_4_, int p_149900_5_) { + return this.func_149903_h(p_149900_1_, p_149900_2_, p_149900_3_, p_149900_4_, p_149900_5_) > 0; + } + + protected int func_149903_h(World p_149903_1_, int p_149903_2_, int p_149903_3_, int p_149903_4_, int p_149903_5_) { + int var6 = func_149895_l(p_149903_5_); + int var7 = p_149903_2_ + Direction.offsetX[var6]; + int var8 = p_149903_4_ + Direction.offsetZ[var6]; + int var9 = p_149903_1_.getIndirectPowerLevelTo(var7, p_149903_3_, var8, Direction.directionToFacing[var6]); + return var9 >= 15 ? var9 : Math.max(var9, p_149903_1_.getBlock(var7, p_149903_3_, var8) == Blocks.redstone_wire ? p_149903_1_.getBlockMetadata(var7, p_149903_3_, var8) : 0); + } + + protected int func_149902_h(IBlockAccess p_149902_1_, int p_149902_2_, int p_149902_3_, int p_149902_4_, int p_149902_5_) { + int var6 = func_149895_l(p_149902_5_); + + switch (var6) { + case 0: + case 2: + return Math.max(this.func_149913_i(p_149902_1_, p_149902_2_ - 1, p_149902_3_, p_149902_4_, 4), this.func_149913_i(p_149902_1_, p_149902_2_ + 1, p_149902_3_, p_149902_4_, 5)); + + case 1: + case 3: + return Math.max(this.func_149913_i(p_149902_1_, p_149902_2_, p_149902_3_, p_149902_4_ + 1, 3), this.func_149913_i(p_149902_1_, p_149902_2_, p_149902_3_, p_149902_4_ - 1, 2)); + + default: + return 0; + } + } + + protected int func_149913_i(IBlockAccess p_149913_1_, int p_149913_2_, int p_149913_3_, int p_149913_4_, int p_149913_5_) { + Block var6 = p_149913_1_.getBlock(p_149913_2_, p_149913_3_, p_149913_4_); + return this.func_149908_a(var6) ? (var6 == Blocks.redstone_wire ? p_149913_1_.getBlockMetadata(p_149913_2_, p_149913_3_, p_149913_4_) : p_149913_1_.isBlockProvidingPowerTo(p_149913_2_, p_149913_3_, p_149913_4_, p_149913_5_)) : 0; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 3); + boolean var8 = this.func_149900_a(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, var7); + + if (var8) { + p_149689_1_.scheduleBlockUpdate(p_149689_2_, p_149689_3_, p_149689_4_, this, 1); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + this.func_149911_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + protected void func_149911_e(World p_149911_1_, int p_149911_2_, int p_149911_3_, int p_149911_4_) { + int var5 = func_149895_l(p_149911_1_.getBlockMetadata(p_149911_2_, p_149911_3_, p_149911_4_)); + + if (var5 == 1) { + p_149911_1_.func_147460_e(p_149911_2_ + 1, p_149911_3_, p_149911_4_, this); + p_149911_1_.func_147441_b(p_149911_2_ + 1, p_149911_3_, p_149911_4_, this, 4); + } + + if (var5 == 3) { + p_149911_1_.func_147460_e(p_149911_2_ - 1, p_149911_3_, p_149911_4_, this); + p_149911_1_.func_147441_b(p_149911_2_ - 1, p_149911_3_, p_149911_4_, this, 5); + } + + if (var5 == 2) { + p_149911_1_.func_147460_e(p_149911_2_, p_149911_3_, p_149911_4_ + 1, this); + p_149911_1_.func_147441_b(p_149911_2_, p_149911_3_, p_149911_4_ + 1, this, 2); + } + + if (var5 == 0) { + p_149911_1_.func_147460_e(p_149911_2_, p_149911_3_, p_149911_4_ - 1, this); + p_149911_1_.func_147441_b(p_149911_2_, p_149911_3_, p_149911_4_ - 1, this, 3); + } + } + + public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_) { + if (this.field_149914_a) { + p_149664_1_.notifyBlocksOfNeighborChange(p_149664_2_ + 1, p_149664_3_, p_149664_4_, this); + p_149664_1_.notifyBlocksOfNeighborChange(p_149664_2_ - 1, p_149664_3_, p_149664_4_, this); + p_149664_1_.notifyBlocksOfNeighborChange(p_149664_2_, p_149664_3_, p_149664_4_ + 1, this); + p_149664_1_.notifyBlocksOfNeighborChange(p_149664_2_, p_149664_3_, p_149664_4_ - 1, this); + p_149664_1_.notifyBlocksOfNeighborChange(p_149664_2_, p_149664_3_ - 1, p_149664_4_, this); + p_149664_1_.notifyBlocksOfNeighborChange(p_149664_2_, p_149664_3_ + 1, p_149664_4_, this); + } + + super.onBlockDestroyedByPlayer(p_149664_1_, p_149664_2_, p_149664_3_, p_149664_4_, p_149664_5_); + } + + public boolean isOpaqueCube() { + return false; + } + + protected boolean func_149908_a(Block p_149908_1_) { + return p_149908_1_.canProvidePower(); + } + + protected int func_149904_f(IBlockAccess p_149904_1_, int p_149904_2_, int p_149904_3_, int p_149904_4_, int p_149904_5_) { + return 15; + } + + public static boolean func_149909_d(Block p_149909_0_) { + return Blocks.unpowered_repeater.func_149907_e(p_149909_0_) || Blocks.unpowered_comparator.func_149907_e(p_149909_0_); + } + + public boolean func_149907_e(Block p_149907_1_) { + return p_149907_1_ == this.func_149906_e() || p_149907_1_ == this.func_149898_i(); + } + + public boolean func_149912_i(World p_149912_1_, int p_149912_2_, int p_149912_3_, int p_149912_4_, int p_149912_5_) { + int var6 = func_149895_l(p_149912_5_); + + if (func_149909_d(p_149912_1_.getBlock(p_149912_2_ - Direction.offsetX[var6], p_149912_3_, p_149912_4_ - Direction.offsetZ[var6]))) { + int var7 = p_149912_1_.getBlockMetadata(p_149912_2_ - Direction.offsetX[var6], p_149912_3_, p_149912_4_ - Direction.offsetZ[var6]); + int var8 = func_149895_l(var7); + return var8 != var6; + } else { + return false; + } + } + + protected int func_149899_k(int p_149899_1_) { + return this.func_149901_b(p_149899_1_); + } + + protected abstract int func_149901_b(int p_149901_1_); + + protected abstract BlockRedstoneDiode func_149906_e(); + + protected abstract BlockRedstoneDiode func_149898_i(); + + public boolean func_149667_c(Block p_149667_1_) { + return this.func_149907_e(p_149667_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneLight.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneLight.java new file mode 100644 index 0000000..9f73e7f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneLight.java @@ -0,0 +1,70 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BlockRedstoneLight extends Block { + private final boolean field_150171_a; + + + public BlockRedstoneLight(boolean p_i45421_1_) { + super(Material.redstoneLight); + this.field_150171_a = p_i45421_1_; + + if (p_i45421_1_) { + this.setLightLevel(1.0F); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + if (!p_149726_1_.isClient) { + if (this.field_150171_a && !p_149726_1_.isBlockIndirectlyGettingPowered(p_149726_2_, p_149726_3_, p_149726_4_)) { + p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, 4); + } else if (!this.field_150171_a && p_149726_1_.isBlockIndirectlyGettingPowered(p_149726_2_, p_149726_3_, p_149726_4_)) { + p_149726_1_.setBlock(p_149726_2_, p_149726_3_, p_149726_4_, Blocks.lit_redstone_lamp, 0, 2); + } + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + if (this.field_150171_a && !p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_)) { + p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, 4); + } else if (!this.field_150171_a && p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_)) { + p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, Blocks.lit_redstone_lamp, 0, 2); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient && this.field_150171_a && !p_149674_1_.isBlockIndirectlyGettingPowered(p_149674_2_, p_149674_3_, p_149674_4_)) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.redstone_lamp, 0, 2); + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return new ItemStack(Blocks.redstone_lamp); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneOre.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneOre.java new file mode 100644 index 0000000..3548383 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneOre.java @@ -0,0 +1,154 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BlockRedstoneOre extends Block { + private final boolean field_150187_a; + + + public BlockRedstoneOre(boolean p_i45420_1_) { + super(Material.rock); + + if (p_i45420_1_) { + this.setTickRandomly(true); + } + + this.field_150187_a = p_i45420_1_; + } + + public int func_149738_a(World p_149738_1_) { + return 30; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) { + this.func_150185_e(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_); + super.onBlockClicked(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_); + } + + public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity p_149724_5_) { + this.func_150185_e(p_149724_1_, p_149724_2_, p_149724_3_, p_149724_4_); + super.onEntityWalking(p_149724_1_, p_149724_2_, p_149724_3_, p_149724_4_, p_149724_5_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + this.func_150185_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + return super.onBlockActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); + } + + private void func_150185_e(World p_150185_1_, int p_150185_2_, int p_150185_3_, int p_150185_4_) { + this.func_150186_m(p_150185_1_, p_150185_2_, p_150185_3_, p_150185_4_); + + if (this == Blocks.redstone_ore) { + p_150185_1_.setBlock(p_150185_2_, p_150185_3_, p_150185_4_, Blocks.lit_redstone_ore); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (this == Blocks.lit_redstone_ore) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.redstone_ore); + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.redstone; + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int p_149679_1_, Random p_149679_2_) { + return this.quantityDropped(p_149679_2_) + p_149679_2_.nextInt(p_149679_1_ + 1); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 4 + p_149745_1_.nextInt(2); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + + if (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this)) { + int var8 = 1 + p_149690_1_.rand.nextInt(5); + this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, var8); + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + if (this.field_150187_a) { + this.func_150186_m(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_); + } + } + + private void func_150186_m(World p_150186_1_, int p_150186_2_, int p_150186_3_, int p_150186_4_) { + Random var5 = p_150186_1_.rand; + double var6 = 0.0625D; + + for (int var8 = 0; var8 < 6; ++var8) { + double var9 = (float)p_150186_2_ + var5.nextFloat(); + double var11 = (float)p_150186_3_ + var5.nextFloat(); + double var13 = (float)p_150186_4_ + var5.nextFloat(); + + if (var8 == 0 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_ + 1, p_150186_4_).isOpaqueCube()) { + var11 = (double)(p_150186_3_ + 1) + var6; + } + + if (var8 == 1 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_ - 1, p_150186_4_).isOpaqueCube()) { + var11 = (double)(p_150186_3_ + 0) - var6; + } + + if (var8 == 2 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_, p_150186_4_ + 1).isOpaqueCube()) { + var13 = (double)(p_150186_4_ + 1) + var6; + } + + if (var8 == 3 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_, p_150186_4_ - 1).isOpaqueCube()) { + var13 = (double)(p_150186_4_ + 0) - var6; + } + + if (var8 == 4 && !p_150186_1_.getBlock(p_150186_2_ + 1, p_150186_3_, p_150186_4_).isOpaqueCube()) { + var9 = (double)(p_150186_2_ + 1) + var6; + } + + if (var8 == 5 && !p_150186_1_.getBlock(p_150186_2_ - 1, p_150186_3_, p_150186_4_).isOpaqueCube()) { + var9 = (double)(p_150186_2_ + 0) - var6; + } + + if (var9 < (double)p_150186_2_ || var9 > (double)(p_150186_2_ + 1) || var11 < 0.0D || var11 > (double)(p_150186_3_ + 1) || var13 < (double)p_150186_4_ || var13 > (double)(p_150186_4_ + 1)) { + p_150186_1_.spawnParticle("reddust", var9, var11, var13, 0.0D, 0.0D, 0.0D); + } + } + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return new ItemStack(Blocks.redstone_ore); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java new file mode 100644 index 0000000..0936262 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneRepeater.java @@ -0,0 +1,128 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneRepeater extends BlockRedstoneDiode { + public static final double[] field_149973_b = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D}; + private static final int[] field_149974_M = new int[] {1, 2, 3, 4}; + + + protected BlockRedstoneRepeater(boolean p_i45424_1_) { + super(p_i45424_1_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + int var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + int var11 = (var10 & 12) >> 2; + var11 = var11 + 1 << 2 & 12; + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var11 | var10 & 3, 3); + return true; + } + + protected int func_149901_b(int p_149901_1_) { + return field_149974_M[(p_149901_1_ & 12) >> 2] * 2; + } + + protected BlockRedstoneDiode func_149906_e() { + return Blocks.powered_repeater; + } + + protected BlockRedstoneDiode func_149898_i() { + return Blocks.unpowered_repeater; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.repeater; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.repeater; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 15; + } + + public boolean func_149910_g(IBlockAccess p_149910_1_, int p_149910_2_, int p_149910_3_, int p_149910_4_, int p_149910_5_) { + return this.func_149902_h(p_149910_1_, p_149910_2_, p_149910_3_, p_149910_4_, p_149910_5_) > 0; + } + + protected boolean func_149908_a(Block p_149908_1_) { + return func_149909_d(p_149908_1_); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + if (this.field_149914_a) { + int var6 = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + int var7 = func_149895_l(var6); + double var8 = (double)((float)p_149734_2_ + 0.5F) + (double)(p_149734_5_.nextFloat() - 0.5F) * 0.2D; + double var10 = (double)((float)p_149734_3_ + 0.4F) + (double)(p_149734_5_.nextFloat() - 0.5F) * 0.2D; + double var12 = (double)((float)p_149734_4_ + 0.5F) + (double)(p_149734_5_.nextFloat() - 0.5F) * 0.2D; + double var14 = 0.0D; + double var16 = 0.0D; + + if (p_149734_5_.nextInt(2) == 0) { + switch (var7) { + case 0: + var16 = -0.3125D; + break; + + case 1: + var14 = 0.3125D; + break; + + case 2: + var16 = 0.3125D; + break; + + case 3: + var14 = -0.3125D; + } + } else { + int var18 = (var6 & 12) >> 2; + + switch (var7) { + case 0: + var16 = field_149973_b[var18]; + break; + + case 1: + var14 = -field_149973_b[var18]; + break; + + case 2: + var16 = -field_149973_b[var18]; + break; + + case 3: + var14 = field_149973_b[var18]; + } + } + + p_149734_1_.spawnParticle("reddust", var8 + var14, var10, var12 + var16, 0.0D, 0.0D, 0.0D); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + this.func_149911_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneTorch.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneTorch.java new file mode 100644 index 0000000..5c77793 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneTorch.java @@ -0,0 +1,204 @@ +package net.minecraft.block; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneTorch extends BlockTorch { + private final boolean field_150113_a; + private static final Map field_150112_b = new HashMap(); + + + private boolean func_150111_a(World p_150111_1_, int p_150111_2_, int p_150111_3_, int p_150111_4_, boolean p_150111_5_) { + if (!field_150112_b.containsKey(p_150111_1_)) { + field_150112_b.put(p_150111_1_, new ArrayList()); + } + + List var6 = (List)field_150112_b.get(p_150111_1_); + + if (p_150111_5_) { + var6.add(new BlockRedstoneTorch.Toggle(p_150111_2_, p_150111_3_, p_150111_4_, p_150111_1_.getTotalWorldTime())); + } + + int var7 = 0; + + for (int var8 = 0; var8 < var6.size(); ++var8) { + BlockRedstoneTorch.Toggle var9 = (BlockRedstoneTorch.Toggle)var6.get(var8); + + if (var9.field_150847_a == p_150111_2_ && var9.field_150845_b == p_150111_3_ && var9.field_150846_c == p_150111_4_) { + ++var7; + + if (var7 >= 8) { + return true; + } + } + } + + return false; + } + + protected BlockRedstoneTorch(boolean p_i45423_1_) { + this.field_150113_a = p_i45423_1_; + this.setTickRandomly(true); + this.setCreativeTab(null); + } + + public int func_149738_a(World p_149738_1_) { + return 2; + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + if (p_149726_1_.getBlockMetadata(p_149726_2_, p_149726_3_, p_149726_4_) == 0) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + if (this.field_150113_a) { + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_, this); + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_, p_149726_3_ + 1, p_149726_4_, this); + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_ - 1, p_149726_3_, p_149726_4_, this); + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_ + 1, p_149726_3_, p_149726_4_, this); + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_, p_149726_3_, p_149726_4_ - 1, this); + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_, p_149726_3_, p_149726_4_ + 1, this); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + if (this.field_150113_a) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ - 1, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ + 1, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ - 1, p_149749_3_, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ + 1, p_149749_3_, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ - 1, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ + 1, this); + } + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + if (!this.field_150113_a) { + return 0; + } else { + int var6 = p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_); + return var6 == 5 && p_149709_5_ == 1 ? 0 : (var6 == 3 && p_149709_5_ == 3 ? 0 : (var6 == 4 && p_149709_5_ == 2 ? 0 : (var6 == 1 && p_149709_5_ == 5 ? 0 : (var6 == 2 && p_149709_5_ == 4 ? 0 : 15)))); + } + } + + private boolean func_150110_m(World p_150110_1_, int p_150110_2_, int p_150110_3_, int p_150110_4_) { + int var5 = p_150110_1_.getBlockMetadata(p_150110_2_, p_150110_3_, p_150110_4_); + return var5 == 5 && p_150110_1_.getIndirectPowerOutput(p_150110_2_, p_150110_3_ - 1, p_150110_4_, 0) || (var5 == 3 && p_150110_1_.getIndirectPowerOutput(p_150110_2_, p_150110_3_, p_150110_4_ - 1, 2) || (var5 == 4 && p_150110_1_.getIndirectPowerOutput(p_150110_2_, p_150110_3_, p_150110_4_ + 1, 3) || (var5 == 1 && p_150110_1_.getIndirectPowerOutput(p_150110_2_ - 1, p_150110_3_, p_150110_4_, 4) || var5 == 2 && p_150110_1_.getIndirectPowerOutput(p_150110_2_ + 1, p_150110_3_, p_150110_4_, 5)))); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + boolean var6 = this.func_150110_m(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + List var7 = (List)field_150112_b.get(p_149674_1_); + + while (var7 != null && !var7.isEmpty() && p_149674_1_.getTotalWorldTime() - ((BlockRedstoneTorch.Toggle)var7.get(0)).field_150844_d > 60L) { + var7.remove(0); + } + + if (this.field_150113_a) { + if (var6) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.unlit_redstone_torch, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 3); + + if (this.func_150111_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, true)) { + p_149674_1_.playSoundEffect((float)p_149674_2_ + 0.5F, (float)p_149674_3_ + 0.5F, (float)p_149674_4_ + 0.5F, "random.fizz", 0.5F, 2.6F + (p_149674_1_.rand.nextFloat() - p_149674_1_.rand.nextFloat()) * 0.8F); + + for (int var8 = 0; var8 < 5; ++var8) { + double var9 = (double)p_149674_2_ + p_149674_5_.nextDouble() * 0.6D + 0.2D; + double var11 = (double)p_149674_3_ + p_149674_5_.nextDouble() * 0.6D + 0.2D; + double var13 = (double)p_149674_4_ + p_149674_5_.nextDouble() * 0.6D + 0.2D; + p_149674_1_.spawnParticle("smoke", var9, var11, var13, 0.0D, 0.0D, 0.0D); + } + } + } + } else if (!var6 && !this.func_150111_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, false)) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.redstone_torch, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 3); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!this.func_150108_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_)) { + boolean var6 = this.func_150110_m(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + + if (this.field_150113_a && var6 || !this.field_150113_a && !var6) { + p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.func_149738_a(p_149695_1_)); + } + } + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + return p_149748_5_ == 0 ? this.isProvidingWeakPower(p_149748_1_, p_149748_2_, p_149748_3_, p_149748_4_, p_149748_5_) : 0; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + if (this.field_150113_a) { + int var6 = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + double var7 = (double)((float)p_149734_2_ + 0.5F) + (double)(p_149734_5_.nextFloat() - 0.5F) * 0.2D; + double var9 = (double)((float)p_149734_3_ + 0.7F) + (double)(p_149734_5_.nextFloat() - 0.5F) * 0.2D; + double var11 = (double)((float)p_149734_4_ + 0.5F) + (double)(p_149734_5_.nextFloat() - 0.5F) * 0.2D; + double var13 = 0.2199999988079071D; + double var15 = 0.27000001072883606D; + + if (var6 == 1) { + p_149734_1_.spawnParticle("reddust", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); + } else if (var6 == 2) { + p_149734_1_.spawnParticle("reddust", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); + } else if (var6 == 3) { + p_149734_1_.spawnParticle("reddust", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); + } else if (var6 == 4) { + p_149734_1_.spawnParticle("reddust", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); + } else { + p_149734_1_.spawnParticle("reddust", var7, var9, var11, 0.0D, 0.0D, 0.0D); + } + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + public boolean func_149667_c(Block p_149667_1_) { + return p_149667_1_ == Blocks.unlit_redstone_torch || p_149667_1_ == Blocks.redstone_torch; + } + + static class Toggle { + int field_150847_a; + int field_150845_b; + int field_150846_c; + long field_150844_d; + + + public Toggle(int p_i45422_1_, int p_i45422_2_, int p_i45422_3_, long p_i45422_4_) { + this.field_150847_a = p_i45422_1_; + this.field_150845_b = p_i45422_2_; + this.field_150846_c = p_i45422_3_; + this.field_150844_d = p_i45422_4_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneWire.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneWire.java new file mode 100644 index 0000000..06b8cc9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRedstoneWire.java @@ -0,0 +1,394 @@ +package net.minecraft.block; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneWire extends Block { + private boolean field_150181_a = true; + private final Set field_150179_b = new HashSet(); + private IIcon field_150182_M; + private IIcon field_150183_N; + private IIcon field_150184_O; + private IIcon field_150180_P; + + + public BlockRedstoneWire() { + super(Material.circuits); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 5; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + return 8388608; + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) || p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_) == Blocks.glowstone; + } + + private void func_150177_e(World p_150177_1_, int p_150177_2_, int p_150177_3_, int p_150177_4_) { + this.func_150175_a(p_150177_1_, p_150177_2_, p_150177_3_, p_150177_4_, p_150177_2_, p_150177_3_, p_150177_4_); + ArrayList var5 = new ArrayList(this.field_150179_b); + this.field_150179_b.clear(); + + for (int var6 = 0; var6 < var5.size(); ++var6) { + ChunkPosition var7 = (ChunkPosition)var5.get(var6); + p_150177_1_.notifyBlocksOfNeighborChange(var7.field_151329_a, var7.field_151327_b, var7.field_151328_c, this); + } + } + + private void func_150175_a(World p_150175_1_, int p_150175_2_, int p_150175_3_, int p_150175_4_, int p_150175_5_, int p_150175_6_, int p_150175_7_) { + int var8 = p_150175_1_.getBlockMetadata(p_150175_2_, p_150175_3_, p_150175_4_); + byte var9 = 0; + int var15 = this.func_150178_a(p_150175_1_, p_150175_5_, p_150175_6_, p_150175_7_, var9); + this.field_150181_a = false; + int var10 = p_150175_1_.getStrongestIndirectPower(p_150175_2_, p_150175_3_, p_150175_4_); + this.field_150181_a = true; + + if (var10 > 0 && var10 > var15 - 1) { + var15 = var10; + } + + int var11 = 0; + + for (int var12 = 0; var12 < 4; ++var12) { + int var13 = p_150175_2_; + int var14 = p_150175_4_; + + if (var12 == 0) { + var13 = p_150175_2_ - 1; + } + + if (var12 == 1) { + ++var13; + } + + if (var12 == 2) { + var14 = p_150175_4_ - 1; + } + + if (var12 == 3) { + ++var14; + } + + if (var13 != p_150175_5_ || var14 != p_150175_7_) { + var11 = this.func_150178_a(p_150175_1_, var13, p_150175_3_, var14, var11); + } + + if (p_150175_1_.getBlock(var13, p_150175_3_, var14).isNormalCube() && !p_150175_1_.getBlock(p_150175_2_, p_150175_3_ + 1, p_150175_4_).isNormalCube()) { + if ((var13 != p_150175_5_ || var14 != p_150175_7_) && p_150175_3_ >= p_150175_6_) { + var11 = this.func_150178_a(p_150175_1_, var13, p_150175_3_ + 1, var14, var11); + } + } else if (!p_150175_1_.getBlock(var13, p_150175_3_, var14).isNormalCube() && (var13 != p_150175_5_ || var14 != p_150175_7_) && p_150175_3_ <= p_150175_6_) { + var11 = this.func_150178_a(p_150175_1_, var13, p_150175_3_ - 1, var14, var11); + } + } + + if (var11 > var15) { + var15 = var11 - 1; + } else if (var15 > 0) { + --var15; + } else { + var15 = 0; + } + + if (var10 > var15 - 1) { + var15 = var10; + } + + if (var8 != var15) { + p_150175_1_.setBlockMetadataWithNotify(p_150175_2_, p_150175_3_, p_150175_4_, var15, 2); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_ - 1, p_150175_3_, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_ + 1, p_150175_3_, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_ - 1, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_ + 1, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_ - 1)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_ + 1)); + } + } + + private void func_150172_m(World p_150172_1_, int p_150172_2_, int p_150172_3_, int p_150172_4_) { + if (p_150172_1_.getBlock(p_150172_2_, p_150172_3_, p_150172_4_) == this) { + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_ - 1, p_150172_3_, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_ + 1, p_150172_3_, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_, p_150172_4_ - 1, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_, p_150172_4_ + 1, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_ - 1, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_ + 1, p_150172_4_, this); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + + if (!p_149726_1_.isClient) { + this.func_150177_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_, p_149726_3_ + 1, p_149726_4_, this); + p_149726_1_.notifyBlocksOfNeighborChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_, this); + this.func_150172_m(p_149726_1_, p_149726_2_ - 1, p_149726_3_, p_149726_4_); + this.func_150172_m(p_149726_1_, p_149726_2_ + 1, p_149726_3_, p_149726_4_); + this.func_150172_m(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_ - 1); + this.func_150172_m(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_ + 1); + + if (p_149726_1_.getBlock(p_149726_2_ - 1, p_149726_3_, p_149726_4_).isNormalCube()) { + this.func_150172_m(p_149726_1_, p_149726_2_ - 1, p_149726_3_ + 1, p_149726_4_); + } else { + this.func_150172_m(p_149726_1_, p_149726_2_ - 1, p_149726_3_ - 1, p_149726_4_); + } + + if (p_149726_1_.getBlock(p_149726_2_ + 1, p_149726_3_, p_149726_4_).isNormalCube()) { + this.func_150172_m(p_149726_1_, p_149726_2_ + 1, p_149726_3_ + 1, p_149726_4_); + } else { + this.func_150172_m(p_149726_1_, p_149726_2_ + 1, p_149726_3_ - 1, p_149726_4_); + } + + if (p_149726_1_.getBlock(p_149726_2_, p_149726_3_, p_149726_4_ - 1).isNormalCube()) { + this.func_150172_m(p_149726_1_, p_149726_2_, p_149726_3_ + 1, p_149726_4_ - 1); + } else { + this.func_150172_m(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_ - 1); + } + + if (p_149726_1_.getBlock(p_149726_2_, p_149726_3_, p_149726_4_ + 1).isNormalCube()) { + this.func_150172_m(p_149726_1_, p_149726_2_, p_149726_3_ + 1, p_149726_4_ + 1); + } else { + this.func_150172_m(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_ + 1); + } + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + + if (!p_149749_1_.isClient) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ + 1, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_ - 1, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ + 1, p_149749_3_, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ - 1, p_149749_3_, p_149749_4_, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ + 1, this); + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ - 1, this); + this.func_150177_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_); + this.func_150172_m(p_149749_1_, p_149749_2_ - 1, p_149749_3_, p_149749_4_); + this.func_150172_m(p_149749_1_, p_149749_2_ + 1, p_149749_3_, p_149749_4_); + this.func_150172_m(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_ - 1); + this.func_150172_m(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_ + 1); + + if (p_149749_1_.getBlock(p_149749_2_ - 1, p_149749_3_, p_149749_4_).isNormalCube()) { + this.func_150172_m(p_149749_1_, p_149749_2_ - 1, p_149749_3_ + 1, p_149749_4_); + } else { + this.func_150172_m(p_149749_1_, p_149749_2_ - 1, p_149749_3_ - 1, p_149749_4_); + } + + if (p_149749_1_.getBlock(p_149749_2_ + 1, p_149749_3_, p_149749_4_).isNormalCube()) { + this.func_150172_m(p_149749_1_, p_149749_2_ + 1, p_149749_3_ + 1, p_149749_4_); + } else { + this.func_150172_m(p_149749_1_, p_149749_2_ + 1, p_149749_3_ - 1, p_149749_4_); + } + + if (p_149749_1_.getBlock(p_149749_2_, p_149749_3_, p_149749_4_ - 1).isNormalCube()) { + this.func_150172_m(p_149749_1_, p_149749_2_, p_149749_3_ + 1, p_149749_4_ - 1); + } else { + this.func_150172_m(p_149749_1_, p_149749_2_, p_149749_3_ - 1, p_149749_4_ - 1); + } + + if (p_149749_1_.getBlock(p_149749_2_, p_149749_3_, p_149749_4_ + 1).isNormalCube()) { + this.func_150172_m(p_149749_1_, p_149749_2_, p_149749_3_ + 1, p_149749_4_ + 1); + } else { + this.func_150172_m(p_149749_1_, p_149749_2_, p_149749_3_ - 1, p_149749_4_ + 1); + } + } + } + + private int func_150178_a(World p_150178_1_, int p_150178_2_, int p_150178_3_, int p_150178_4_, int p_150178_5_) { + if (p_150178_1_.getBlock(p_150178_2_, p_150178_3_, p_150178_4_) != this) { + return p_150178_5_; + } else { + int var6 = p_150178_1_.getBlockMetadata(p_150178_2_, p_150178_3_, p_150178_4_); + return var6 > p_150178_5_ ? var6 : p_150178_5_; + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + boolean var6 = this.canPlaceBlockAt(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + + if (var6) { + this.func_150177_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } else { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, 0, 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.redstone; + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + return !this.field_150181_a ? 0 : this.isProvidingWeakPower(p_149748_1_, p_149748_2_, p_149748_3_, p_149748_4_, p_149748_5_); + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + if (!this.field_150181_a) { + return 0; + } else { + int var6 = p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_); + + if (var6 == 0) { + return 0; + } else if (p_149709_5_ == 1) { + return var6; + } else { + boolean var7 = func_150176_g(p_149709_1_, p_149709_2_ - 1, p_149709_3_, p_149709_4_, 1) || !p_149709_1_.getBlock(p_149709_2_ - 1, p_149709_3_, p_149709_4_).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_ - 1, p_149709_3_ - 1, p_149709_4_, -1); + boolean var8 = func_150176_g(p_149709_1_, p_149709_2_ + 1, p_149709_3_, p_149709_4_, 3) || !p_149709_1_.getBlock(p_149709_2_ + 1, p_149709_3_, p_149709_4_).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_ + 1, p_149709_3_ - 1, p_149709_4_, -1); + boolean var9 = func_150176_g(p_149709_1_, p_149709_2_, p_149709_3_, p_149709_4_ - 1, 2) || !p_149709_1_.getBlock(p_149709_2_, p_149709_3_, p_149709_4_ - 1).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_, p_149709_3_ - 1, p_149709_4_ - 1, -1); + boolean var10 = func_150176_g(p_149709_1_, p_149709_2_, p_149709_3_, p_149709_4_ + 1, 0) || !p_149709_1_.getBlock(p_149709_2_, p_149709_3_, p_149709_4_ + 1).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_, p_149709_3_ - 1, p_149709_4_ + 1, -1); + + if (!p_149709_1_.getBlock(p_149709_2_, p_149709_3_ + 1, p_149709_4_).isNormalCube()) { + if (p_149709_1_.getBlock(p_149709_2_ - 1, p_149709_3_, p_149709_4_).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_ - 1, p_149709_3_ + 1, p_149709_4_, -1)) { + var7 = true; + } + + if (p_149709_1_.getBlock(p_149709_2_ + 1, p_149709_3_, p_149709_4_).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_ + 1, p_149709_3_ + 1, p_149709_4_, -1)) { + var8 = true; + } + + if (p_149709_1_.getBlock(p_149709_2_, p_149709_3_, p_149709_4_ - 1).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_, p_149709_3_ + 1, p_149709_4_ - 1, -1)) { + var9 = true; + } + + if (p_149709_1_.getBlock(p_149709_2_, p_149709_3_, p_149709_4_ + 1).isNormalCube() && func_150176_g(p_149709_1_, p_149709_2_, p_149709_3_ + 1, p_149709_4_ + 1, -1)) { + var10 = true; + } + } + + return !var9 && !var8 && !var7 && !var10 && p_149709_5_ >= 2 && p_149709_5_ <= 5 ? var6 : (p_149709_5_ == 2 && var9 && !var7 && !var8 ? var6 : (p_149709_5_ == 3 && var10 && !var7 && !var8 ? var6 : (p_149709_5_ == 4 && var7 && !var9 && !var10 ? var6 : (p_149709_5_ == 5 && var8 && !var9 && !var10 ? var6 : 0)))); + } + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return this.field_150181_a; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + int var6 = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + + if (var6 > 0) { + double var7 = (double)p_149734_2_ + 0.5D + ((double)p_149734_5_.nextFloat() - 0.5D) * 0.2D; + double var9 = (float)p_149734_3_ + 0.0625F; + double var11 = (double)p_149734_4_ + 0.5D + ((double)p_149734_5_.nextFloat() - 0.5D) * 0.2D; + float var13 = (float)var6 / 15.0F; + float var14 = var13 * 0.6F + 0.4F; + + if (var6 == 0) { + var14 = 0.0F; + } + + float var15 = var13 * var13 * 0.7F - 0.5F; + float var16 = var13 * var13 * 0.6F - 0.7F; + + if (var15 < 0.0F) { + var15 = 0.0F; + } + + if (var16 < 0.0F) { + var16 = 0.0F; + } + + p_149734_1_.spawnParticle("reddust", var7, var9, var11, var14, var15, var16); + } + } + + public static boolean func_150174_f(IBlockAccess p_150174_0_, int p_150174_1_, int p_150174_2_, int p_150174_3_, int p_150174_4_) { + Block var5 = p_150174_0_.getBlock(p_150174_1_, p_150174_2_, p_150174_3_); + + if (var5 == Blocks.redstone_wire) { + return true; + } else if (!Blocks.unpowered_repeater.func_149907_e(var5)) { + return var5.canProvidePower() && p_150174_4_ != -1; + } else { + int var6 = p_150174_0_.getBlockMetadata(p_150174_1_, p_150174_2_, p_150174_3_); + return p_150174_4_ == (var6 & 3) || p_150174_4_ == Direction.rotateOpposite[var6 & 3]; + } + } + + public static boolean func_150176_g(IBlockAccess p_150176_0_, int p_150176_1_, int p_150176_2_, int p_150176_3_, int p_150176_4_) { + if (func_150174_f(p_150176_0_, p_150176_1_, p_150176_2_, p_150176_3_, p_150176_4_)) { + return true; + } else if (p_150176_0_.getBlock(p_150176_1_, p_150176_2_, p_150176_3_) == Blocks.powered_repeater) { + int var5 = p_150176_0_.getBlockMetadata(p_150176_1_, p_150176_2_, p_150176_3_); + return p_150176_4_ == (var5 & 3); + } else { + return false; + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.redstone; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150182_M = p_149651_1_.registerIcon(this.getTextureName() + "_" + "cross"); + this.field_150183_N = p_149651_1_.registerIcon(this.getTextureName() + "_" + "line"); + this.field_150184_O = p_149651_1_.registerIcon(this.getTextureName() + "_" + "cross_overlay"); + this.field_150180_P = p_149651_1_.registerIcon(this.getTextureName() + "_" + "line_overlay"); + this.blockIcon = this.field_150182_M; + } + + public static IIcon func_150173_e(String p_150173_0_) { + return p_150173_0_.equals("cross") ? Blocks.redstone_wire.field_150182_M : (p_150173_0_.equals("line") ? Blocks.redstone_wire.field_150183_N : (p_150173_0_.equals("cross_overlay") ? Blocks.redstone_wire.field_150184_O : (p_150173_0_.equals("line_overlay") ? Blocks.redstone_wire.field_150180_P : null))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockReed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockReed.java new file mode 100644 index 0000000..d77b7d8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockReed.java @@ -0,0 +1,114 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockReed extends Block { + + + protected BlockReed() { + super(Material.plants); + float var1 = 0.375F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 1.0F, 0.5F + var1); + this.setTickRandomly(true); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.reeds || this.func_150170_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { + if (p_149674_1_.isAirBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_)) { + int var6; + + for (var6 = 1; p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - var6, p_149674_4_) == this; ++var6) { + } + + if (var6 < 3) { + int var7 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var7 == 15) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_, this); + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, 0, 4); + } else { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var7 + 1, 4); + } + } + } + } + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + Block var5 = p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_); + return var5 == this || ((var5 == Blocks.grass || var5 == Blocks.dirt || var5 == Blocks.sand) && (p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).getMaterial() == Material.water || (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).getMaterial() == Material.water || (p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).getMaterial() == Material.water || p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).getMaterial() == Material.water)))); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + this.func_150170_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + protected final boolean func_150170_e(World p_150170_1_, int p_150170_2_, int p_150170_3_, int p_150170_4_) { + if (!this.canBlockStay(p_150170_1_, p_150170_2_, p_150170_3_, p_150170_4_)) { + this.dropBlockAsItem(p_150170_1_, p_150170_2_, p_150170_3_, p_150170_4_, p_150170_1_.getBlockMetadata(p_150170_2_, p_150170_3_, p_150170_4_), 0); + p_150170_1_.setBlockToAir(p_150170_2_, p_150170_3_, p_150170_4_); + return false; + } else { + return true; + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return this.canPlaceBlockAt(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.reeds; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 1; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.reeds; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + return p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).getBiomeGrassColor(p_149720_2_, p_149720_3_, p_149720_4_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRotatedPillar.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRotatedPillar.java new file mode 100644 index 0000000..b27db46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockRotatedPillar.java @@ -0,0 +1,80 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public abstract class BlockRotatedPillar extends Block { + protected IIcon field_150164_N; + + + protected BlockRotatedPillar(Material p_i45425_1_) { + super(p_i45425_1_); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 31; + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + int var10 = p_149660_9_ & 3; + byte var11 = 0; + + switch (p_149660_5_) { + case 0: + case 1: + var11 = 0; + break; + + case 2: + case 3: + var11 = 8; + break; + + case 4: + case 5: + var11 = 4; + } + + return var10 | var11; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + int var3 = p_149691_2_ & 12; + int var4 = p_149691_2_ & 3; + return var3 == 0 && (p_149691_1_ == 1 || p_149691_1_ == 0) ? this.func_150161_d(var4) : (var3 == 4 && (p_149691_1_ == 5 || p_149691_1_ == 4) ? this.func_150161_d(var4) : (var3 == 8 && (p_149691_1_ == 2 || p_149691_1_ == 3) ? this.func_150161_d(var4) : this.func_150163_b(var4))); + } + + protected abstract IIcon func_150163_b(int p_150163_1_); + + protected IIcon func_150161_d(int p_150161_1_) { + return this.field_150164_N; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_ & 3; + } + + public int func_150162_k(int p_150162_1_) { + return p_150162_1_ & 3; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return new ItemStack(Item.getItemFromBlock(this), 1, this.func_150162_k(p_149644_1_)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSand.java new file mode 100644 index 0000000..025b120 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSand.java @@ -0,0 +1,44 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockSand extends BlockFalling { + public static final String[] field_149838_a = new String[] {"default", "red"}; + private static IIcon field_149837_b; + private static IIcon field_149839_N; + + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_2_ == 1 ? field_149839_N : field_149837_b; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + field_149837_b = p_149651_1_.registerIcon("sand"); + field_149839_N = p_149651_1_.registerIcon("red_sand"); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + } + + public MapColor getMapColor(int p_149728_1_) { + return p_149728_1_ == 1 ? MapColor.field_151664_l : MapColor.field_151658_d; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSandStone.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSandStone.java new file mode 100644 index 0000000..60fb05f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSandStone.java @@ -0,0 +1,66 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockSandStone extends Block { + public static final String[] field_150157_a = new String[] {"default", "chiseled", "smooth"}; + private static final String[] field_150156_b = new String[] {"normal", "carved", "smooth"}; + private IIcon[] field_150158_M; + private IIcon field_150159_N; + private IIcon field_150160_O; + + + public BlockSandStone() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_1_ != 1 && (p_149691_1_ != 0 || p_149691_2_ != 1 && p_149691_2_ != 2)) { + if (p_149691_1_ == 0) { + return this.field_150160_O; + } else { + if (p_149691_2_ < 0 || p_149691_2_ >= this.field_150158_M.length) { + p_149691_2_ = 0; + } + + return this.field_150158_M[p_149691_2_]; + } + } else { + return this.field_150159_N; + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150158_M = new IIcon[field_150156_b.length]; + + for (int var2 = 0; var2 < this.field_150158_M.length; ++var2) { + this.field_150158_M[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_150156_b[var2]); + } + + this.field_150159_N = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150160_O = p_149651_1_.registerIcon(this.getTextureName() + "_bottom"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSapling.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSapling.java new file mode 100644 index 0000000..8ea7c94 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSapling.java @@ -0,0 +1,202 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BlockSapling extends BlockBush implements IGrowable { + public static final String[] field_149882_a = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "roofed_oak"}; + private static final IIcon[] field_149881_b = new IIcon[field_149882_a.length]; + + + protected BlockSapling() { + float var1 = 0.4F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, var1 * 2.0F, 0.5F + var1); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + + if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9 && p_149674_5_.nextInt(7) == 0) { + this.func_149879_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + } + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + p_149691_2_ &= 7; + return field_149881_b[MathHelper.clamp_int(p_149691_2_, 0, 5)]; + } + + public void func_149879_c(World p_149879_1_, int p_149879_2_, int p_149879_3_, int p_149879_4_, Random p_149879_5_) { + int var6 = p_149879_1_.getBlockMetadata(p_149879_2_, p_149879_3_, p_149879_4_); + + if ((var6 & 8) == 0) { + p_149879_1_.setBlockMetadataWithNotify(p_149879_2_, p_149879_3_, p_149879_4_, var6 | 8, 4); + } else { + this.func_149878_d(p_149879_1_, p_149879_2_, p_149879_3_, p_149879_4_, p_149879_5_); + } + } + + public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_) { + int var6 = p_149878_1_.getBlockMetadata(p_149878_2_, p_149878_3_, p_149878_4_) & 7; + Object var7 = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); + int var8 = 0; + int var9 = 0; + boolean var10 = false; + + switch (var6) { + case 0: + default: + break; + + case 1: + label78: + for (var8 = 0; var8 >= -1; --var8) { + for (var9 = 0; var9 >= -1; --var9) { + if (this.func_149880_a(p_149878_1_, p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9, 1) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9, 1) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9 + 1, 1) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9 + 1, 1)) { + var7 = new WorldGenMegaPineTree(false, p_149878_5_.nextBoolean()); + var10 = true; + break label78; + } + } + } + + if (!var10) { + var9 = 0; + var8 = 0; + var7 = new WorldGenTaiga2(true); + } + + break; + + case 2: + var7 = new WorldGenForest(true, false); + break; + + case 3: + label93: + for (var8 = 0; var8 >= -1; --var8) { + for (var9 = 0; var9 >= -1; --var9) { + if (this.func_149880_a(p_149878_1_, p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9 + 1, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9 + 1, 3)) { + var7 = new WorldGenMegaJungle(true, 10, 20, 3, 3); + var10 = true; + break label93; + } + } + } + + if (!var10) { + var9 = 0; + var8 = 0; + var7 = new WorldGenTrees(true, 4 + p_149878_5_.nextInt(7), 3, 3, false); + } + + break; + + case 4: + var7 = new WorldGenSavannaTree(true); + break; + + case 5: + label108: + for (var8 = 0; var8 >= -1; --var8) { + for (var9 = 0; var9 >= -1; --var9) { + if (this.func_149880_a(p_149878_1_, p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9 + 1, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9 + 1, 5)) { + var7 = new WorldGenCanopyTree(true); + var10 = true; + break label108; + } + } + } + + if (!var10) { + return; + } + } + + Block var11 = Blocks.air; + + if (var10) { + p_149878_1_.setBlock(p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9, var11, 0, 4); + p_149878_1_.setBlock(p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9, var11, 0, 4); + p_149878_1_.setBlock(p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9 + 1, var11, 0, 4); + p_149878_1_.setBlock(p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9 + 1, var11, 0, 4); + } else { + p_149878_1_.setBlock(p_149878_2_, p_149878_3_, p_149878_4_, var11, 0, 4); + } + + if (!((WorldGenerator)var7).generate(p_149878_1_, p_149878_5_, p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9)) { + if (var10) { + p_149878_1_.setBlock(p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9, this, var6, 4); + p_149878_1_.setBlock(p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9, this, var6, 4); + p_149878_1_.setBlock(p_149878_2_ + var8, p_149878_3_, p_149878_4_ + var9 + 1, this, var6, 4); + p_149878_1_.setBlock(p_149878_2_ + var8 + 1, p_149878_3_, p_149878_4_ + var9 + 1, this, var6, 4); + } else { + p_149878_1_.setBlock(p_149878_2_, p_149878_3_, p_149878_4_, this, var6, 4); + } + } + } + + public boolean func_149880_a(World p_149880_1_, int p_149880_2_, int p_149880_3_, int p_149880_4_, int p_149880_5_) { + return p_149880_1_.getBlock(p_149880_2_, p_149880_3_, p_149880_4_) == this && (p_149880_1_.getBlockMetadata(p_149880_2_, p_149880_3_, p_149880_4_) & 7) == p_149880_5_; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return MathHelper.clamp_int(p_149692_1_ & 7, 0, 5); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 3)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 4)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 5)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + for (int var2 = 0; var2 < field_149881_b.length; ++var2) { + field_149881_b[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_149882_a[var2]); + } + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + return true; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return (double)p_149852_1_.rand.nextFloat() < 0.45D; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + this.func_149879_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, p_149853_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSign.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSign.java new file mode 100644 index 0000000..14b91c8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSign.java @@ -0,0 +1,155 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSign extends BlockContainer { + private final Class field_149968_a; + private final boolean field_149967_b; + + + protected BlockSign(Class p_i45426_1_, boolean p_i45426_2_) { + super(Material.wood); + this.field_149967_b = p_i45426_2_; + this.field_149968_a = p_i45426_1_; + float var3 = 0.25F; + float var4 = 1.0F; + this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var4, 0.5F + var3); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return Blocks.planks.getBlockTextureFromSide(p_149691_1_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + this.setBlockBoundsBasedOnState(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + return super.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + if (!this.field_149967_b) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + float var6 = 0.28125F; + float var7 = 0.78125F; + float var8 = 0.0F; + float var9 = 1.0F; + float var10 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + + if (var5 == 2) { + this.setBlockBounds(var8, var6, 1.0F - var10, var9, var7, 1.0F); + } + + if (var5 == 3) { + this.setBlockBounds(var8, var6, 0.0F, var9, var7, var10); + } + + if (var5 == 4) { + this.setBlockBounds(1.0F - var10, var6, var8, 1.0F, var7, var9); + } + + if (var5 == 5) { + this.setBlockBounds(0.0F, var6, var8, var10, var7, var9); + } + } + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return -1; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return true; + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + try { + return (TileEntity)this.field_149968_a.newInstance(); + } catch (Exception var4) { + throw new RuntimeException(var4); + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.sign; + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + boolean var6 = false; + + if (this.field_149967_b) { + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_ - 1, p_149695_4_).getMaterial().isSolid()) { + var6 = true; + } + } else { + int var7 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + + var6 = var7 != 2 || !p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).getMaterial().isSolid(); + + if (var7 == 3 && p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).getMaterial().isSolid()) { + var6 = false; + } + + if (var7 == 4 && p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).getMaterial().isSolid()) { + var6 = false; + } + + if (var7 == 5 && p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).getMaterial().isSolid()) { + var6 = false; + } + } + + if (var6) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.sign; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSilverfish.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSilverfish.java new file mode 100644 index 0000000..5784acd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSilverfish.java @@ -0,0 +1,172 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import org.apache.commons.lang3.tuple.ImmutablePair; + +public class BlockSilverfish extends Block { + public static final String[] field_150198_a = new String[] {"stone", "cobble", "brick", "mossybrick", "crackedbrick", "chiseledbrick"}; + + + public BlockSilverfish() { + super(Material.field_151571_B); + this.setHardness(0.0F); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + switch (p_149691_2_) { + case 1: + return Blocks.cobblestone.getBlockTextureFromSide(p_149691_1_); + + case 2: + return Blocks.stonebrick.getBlockTextureFromSide(p_149691_1_); + + case 3: + return Blocks.stonebrick.getIcon(p_149691_1_, 1); + + case 4: + return Blocks.stonebrick.getIcon(p_149691_1_, 2); + + case 5: + return Blocks.stonebrick.getIcon(p_149691_1_, 3); + + default: + return Blocks.stone.getBlockTextureFromSide(p_149691_1_); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} + + public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_) { + if (!p_149664_1_.isClient) { + EntitySilverfish var6 = new EntitySilverfish(p_149664_1_); + var6.setLocationAndAngles((double)p_149664_2_ + 0.5D, p_149664_3_, (double)p_149664_4_ + 0.5D, 0.0F, 0.0F); + p_149664_1_.spawnEntityInWorld(var6); + var6.spawnExplosionParticle(); + } + + super.onBlockDestroyedByPlayer(p_149664_1_, p_149664_2_, p_149664_3_, p_149664_4_, p_149664_5_); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + public static boolean func_150196_a(Block p_150196_0_) { + return p_150196_0_ == Blocks.stone || p_150196_0_ == Blocks.cobblestone || p_150196_0_ == Blocks.stonebrick; + } + + public static int func_150195_a(Block p_150195_0_, int p_150195_1_) { + if (p_150195_1_ == 0) { + if (p_150195_0_ == Blocks.cobblestone) { + return 1; + } + + if (p_150195_0_ == Blocks.stonebrick) { + return 2; + } + } else if (p_150195_0_ == Blocks.stonebrick) { + switch (p_150195_1_) { + case 1: + return 3; + + case 2: + return 4; + + case 3: + return 5; + } + } + + return 0; + } + + public static ImmutablePair func_150197_b(int p_150197_0_) { + switch (p_150197_0_) { + case 1: + return new ImmutablePair(Blocks.cobblestone, Integer.valueOf(0)); + + case 2: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(0)); + + case 3: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(1)); + + case 4: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(2)); + + case 5: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(3)); + + default: + return new ImmutablePair(Blocks.stone, Integer.valueOf(0)); + } + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + switch (p_149644_1_) { + case 1: + return new ItemStack(Blocks.cobblestone); + + case 2: + return new ItemStack(Blocks.stonebrick); + + case 3: + return new ItemStack(Blocks.stonebrick, 1, 1); + + case 4: + return new ItemStack(Blocks.stonebrick, 1, 2); + + case 5: + return new ItemStack(Blocks.stonebrick, 1, 3); + + default: + return new ItemStack(Blocks.stone); + } + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + if (!p_149690_1_.isClient) { + EntitySilverfish var8 = new EntitySilverfish(p_149690_1_); + var8.setLocationAndAngles((double)p_149690_2_ + 0.5D, p_149690_3_, (double)p_149690_4_ + 0.5D, 0.0F, 0.0F); + p_149690_1_.spawnEntityInWorld(var8); + var8.spawnExplosionParticle(); + } + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + return p_149643_1_.getBlockMetadata(p_149643_2_, p_149643_3_, p_149643_4_); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < field_150198_a.length; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSkull.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSkull.java new file mode 100644 index 0000000..c69939e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSkull.java @@ -0,0 +1,288 @@ +package net.minecraft.block; + +import java.util.Iterator; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemSkull; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSkull extends BlockContainer { + + + protected BlockSkull() { + super(Material.circuits); + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return -1; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_) & 7; + + switch (var5) { + case 1: + default: + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + break; + + case 2: + this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); + break; + + case 3: + this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); + break; + + case 4: + this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); + break; + + case 5: + this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntitySkull(); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.skull; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + TileEntity var5 = p_149643_1_.getTileEntity(p_149643_2_, p_149643_3_, p_149643_4_); + return var5 != null && var5 instanceof TileEntitySkull ? ((TileEntitySkull)var5).func_145904_a() : super.getDamageValue(p_149643_1_, p_149643_2_, p_149643_3_, p_149643_4_); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {} + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + if (p_149681_6_.capabilities.isCreativeMode) { + p_149681_5_ |= 8; + p_149681_1_.setBlockMetadataWithNotify(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4); + } + + super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + if (!p_149749_1_.isClient) { + if ((p_149749_6_ & 8) == 0) { + ItemStack var7 = new ItemStack(Items.skull, 1, this.getDamageValue(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); + TileEntitySkull var8 = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (var8.func_145904_a() == 3 && var8.func_152108_a() != null) { + var7.setTagCompound(new NBTTagCompound()); + NBTTagCompound var9 = new NBTTagCompound(); + NBTUtil.func_152460_a(var9, var8.func_152108_a()); + var7.getTagCompound().setTag("SkullOwner", var9); + } + + this.dropBlockAsItem_do(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, var7); + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.skull; + } + + public void func_149965_a(World p_149965_1_, int p_149965_2_, int p_149965_3_, int p_149965_4_, TileEntitySkull p_149965_5_) { + if (p_149965_5_.func_145904_a() == 1 && p_149965_3_ >= 2 && p_149965_1_.difficultySetting != EnumDifficulty.PEACEFUL && !p_149965_1_.isClient) { + int var6; + EntityWither var7; + Iterator var8; + EntityPlayer var9; + int var10; + + for (var6 = -2; var6 <= 0; ++var6) { + if (p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6 + 1) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 2, p_149965_4_ + var6 + 1) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6 + 2) == Blocks.soul_sand && this.func_149966_a(p_149965_1_, p_149965_2_, p_149965_3_, p_149965_4_ + var6, 1) && this.func_149966_a(p_149965_1_, p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 1, 1) && this.func_149966_a(p_149965_1_, p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 2, 1)) { + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_, p_149965_3_, p_149965_4_ + var6, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 1, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 2, 8, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_, p_149965_4_ + var6, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 1, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 2, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6 + 1, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6 + 2, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 2, p_149965_4_ + var6 + 1, getBlockById(0), 0, 2); + + if (!p_149965_1_.isClient) { + var7 = new EntityWither(p_149965_1_); + var7.setLocationAndAngles((double)p_149965_2_ + 0.5D, (double)p_149965_3_ - 1.45D, (double)(p_149965_4_ + var6) + 1.5D, 90.0F, 0.0F); + var7.renderYawOffset = 90.0F; + var7.func_82206_m(); + + if (!p_149965_1_.isClient) { + var8 = p_149965_1_.getEntitiesWithinAABB(EntityPlayer.class, var7.boundingBox.expand(50.0D, 50.0D, 50.0D)).iterator(); + + while (var8.hasNext()) { + var9 = (EntityPlayer)var8.next(); + var9.triggerAchievement(AchievementList.field_150963_I); + } + } + + p_149965_1_.spawnEntityInWorld(var7); + } + + for (var10 = 0; var10 < 120; ++var10) { + p_149965_1_.spawnParticle("snowballpoof", (double)p_149965_2_ + p_149965_1_.rand.nextDouble(), (double)(p_149965_3_ - 2) + p_149965_1_.rand.nextDouble() * 3.9D, (double)(p_149965_4_ + var6 + 1) + p_149965_1_.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_, p_149965_4_ + var6, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 1, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_, p_149965_4_ + var6 + 2, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6 + 1, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + var6 + 2, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 2, p_149965_4_ + var6 + 1, getBlockById(0)); + return; + } + } + + for (var6 = -2; var6 <= 0; ++var6) { + if (p_149965_1_.getBlock(p_149965_2_ + var6, p_149965_3_ - 1, p_149965_4_) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_ + var6 + 1, p_149965_3_ - 1, p_149965_4_) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_ + var6 + 1, p_149965_3_ - 2, p_149965_4_) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_ + var6 + 2, p_149965_3_ - 1, p_149965_4_) == Blocks.soul_sand && this.func_149966_a(p_149965_1_, p_149965_2_ + var6, p_149965_3_, p_149965_4_, 1) && this.func_149966_a(p_149965_1_, p_149965_2_ + var6 + 1, p_149965_3_, p_149965_4_, 1) && this.func_149966_a(p_149965_1_, p_149965_2_ + var6 + 2, p_149965_3_, p_149965_4_, 1)) { + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_ + var6, p_149965_3_, p_149965_4_, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_ + var6 + 1, p_149965_3_, p_149965_4_, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_ + var6 + 2, p_149965_3_, p_149965_4_, 8, 2); + p_149965_1_.setBlock(p_149965_2_ + var6, p_149965_3_, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + var6 + 1, p_149965_3_, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + var6 + 2, p_149965_3_, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + var6, p_149965_3_ - 1, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + var6 + 1, p_149965_3_ - 1, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + var6 + 2, p_149965_3_ - 1, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + var6 + 1, p_149965_3_ - 2, p_149965_4_, getBlockById(0), 0, 2); + + if (!p_149965_1_.isClient) { + var7 = new EntityWither(p_149965_1_); + var7.setLocationAndAngles((double)(p_149965_2_ + var6) + 1.5D, (double)p_149965_3_ - 1.45D, (double)p_149965_4_ + 0.5D, 0.0F, 0.0F); + var7.func_82206_m(); + + if (!p_149965_1_.isClient) { + var8 = p_149965_1_.getEntitiesWithinAABB(EntityPlayer.class, var7.boundingBox.expand(50.0D, 50.0D, 50.0D)).iterator(); + + while (var8.hasNext()) { + var9 = (EntityPlayer)var8.next(); + var9.triggerAchievement(AchievementList.field_150963_I); + } + } + + p_149965_1_.spawnEntityInWorld(var7); + } + + for (var10 = 0; var10 < 120; ++var10) { + p_149965_1_.spawnParticle("snowballpoof", (double)(p_149965_2_ + var6 + 1) + p_149965_1_.rand.nextDouble(), (double)(p_149965_3_ - 2) + p_149965_1_.rand.nextDouble() * 3.9D, (double)p_149965_4_ + p_149965_1_.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + + p_149965_1_.notifyBlockChange(p_149965_2_ + var6, p_149965_3_, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + var6 + 1, p_149965_3_, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + var6 + 2, p_149965_3_, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + var6, p_149965_3_ - 1, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + var6 + 1, p_149965_3_ - 1, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + var6 + 2, p_149965_3_ - 1, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + var6 + 1, p_149965_3_ - 2, p_149965_4_, getBlockById(0)); + return; + } + } + } + } + + private boolean func_149966_a(World p_149966_1_, int p_149966_2_, int p_149966_3_, int p_149966_4_, int p_149966_5_) { + if (p_149966_1_.getBlock(p_149966_2_, p_149966_3_, p_149966_4_) != this) { + return false; + } else { + TileEntity var6 = p_149966_1_.getTileEntity(p_149966_2_, p_149966_3_, p_149966_4_); + return var6 != null && var6 instanceof TileEntitySkull && ((TileEntitySkull) var6).func_145904_a() == p_149966_5_; + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return Blocks.soul_sand.getBlockTextureFromSide(p_149691_1_); + } + + /** + * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. + */ + public String getItemIconName() { + return this.getTextureName() + "_" + ItemSkull.field_94587_a[0]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSlab.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSlab.java new file mode 100644 index 0000000..8b18c33 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSlab.java @@ -0,0 +1,120 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockSlab extends Block { + protected final boolean field_150004_a; + + + public BlockSlab(boolean p_i45410_1_, Material p_i45410_2_) { + super(p_i45410_2_); + this.field_150004_a = p_i45410_1_; + + if (p_i45410_1_) { + this.opaque = true; + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + + this.setLightOpacity(255); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + if (this.field_150004_a) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + boolean var5 = (p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_) & 8) != 0; + + if (var5) { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + if (this.field_150004_a) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + this.setBlockBoundsBasedOnState(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + public boolean isOpaqueCube() { + return this.field_150004_a; + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + return this.field_150004_a ? p_149660_9_ : (p_149660_5_ != 0 && (p_149660_5_ == 1 || (double)p_149660_7_ <= 0.5D) ? p_149660_9_ : p_149660_9_ | 8); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return this.field_150004_a ? 2 : 1; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_ & 7; + } + + public boolean renderAsNormalBlock() { + return this.field_150004_a; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + if (this.field_150004_a) { + return super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } else if (p_149646_5_ != 1 && p_149646_5_ != 0 && !super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_)) { + return false; + } else { + int var6 = p_149646_2_ + Facing.offsetsXForSide[Facing.oppositeSide[p_149646_5_]]; + int var7 = p_149646_3_ + Facing.offsetsYForSide[Facing.oppositeSide[p_149646_5_]]; + int var8 = p_149646_4_ + Facing.offsetsZForSide[Facing.oppositeSide[p_149646_5_]]; + boolean var9 = (p_149646_1_.getBlockMetadata(var6, var7, var8) & 8) != 0; + return var9 ? (p_149646_5_ == 0 || (p_149646_5_ == 1 && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_) || !func_150003_a(p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_)) || (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) & 8) == 0)) : (p_149646_5_ == 1 || (p_149646_5_ == 0 && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_) || !func_150003_a(p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_)) || (p_149646_1_.getBlockMetadata(p_149646_2_, p_149646_3_, p_149646_4_) & 8) != 0)); + } + } + + private static boolean func_150003_a(Block p_150003_0_) { + return p_150003_0_ == Blocks.stone_slab || p_150003_0_ == Blocks.wooden_slab; + } + + public abstract String func_150002_b(int p_150002_1_); + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + return super.getDamageValue(p_149643_1_, p_149643_2_, p_149643_3_, p_149643_4_) & 7; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return func_150003_a(this) ? Item.getItemFromBlock(this) : (this == Blocks.double_stone_slab ? Item.getItemFromBlock(Blocks.stone_slab) : (this == Blocks.double_wooden_slab ? Item.getItemFromBlock(Blocks.wooden_slab) : Item.getItemFromBlock(Blocks.stone_slab))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSnow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSnow.java new file mode 100644 index 0000000..054d5b6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSnow.java @@ -0,0 +1,118 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSnow extends Block { + + + protected BlockSnow() { + super(Material.field_151597_y); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.func_150154_b(0); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("snow"); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + int var5 = p_149668_1_.getBlockMetadata(p_149668_2_, p_149668_3_, p_149668_4_) & 7; + float var6 = 0.125F; + return AxisAlignedBB.getBoundingBox((double)p_149668_2_ + this.field_149759_B, (double)p_149668_3_ + this.field_149760_C, (double)p_149668_4_ + this.field_149754_D, (double)p_149668_2_ + this.field_149755_E, (float)p_149668_3_ + (float)var5 * var6, (double)p_149668_4_ + this.field_149757_G); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.func_150154_b(0); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.func_150154_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_)); + } + + protected void func_150154_b(int p_150154_1_) { + int var2 = p_150154_1_ & 7; + float var3 = (float)(2 * (1 + var2)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var3, 1.0F); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + Block var5 = p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_); + return var5 != Blocks.ice && var5 != Blocks.packed_ice && (var5.getMaterial() == Material.leaves || (var5 == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 || var5.isOpaqueCube() && var5.blockMaterial.blocksMovement())); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + this.func_150155_m(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + private boolean func_150155_m(World p_150155_1_, int p_150155_2_, int p_150155_3_, int p_150155_4_) { + if (!this.canPlaceBlockAt(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) { + this.dropBlockAsItem(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.getBlockMetadata(p_150155_2_, p_150155_3_, p_150155_4_), 0); + p_150155_1_.setBlockToAir(p_150155_2_, p_150155_3_, p_150155_4_); + return false; + } else { + return true; + } + } + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + int var7 = p_149636_6_ & 7; + this.dropBlockAsItem_do(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.snowball, var7 + 1, 0)); + p_149636_1_.setBlockToAir(p_149636_3_, p_149636_4_, p_149636_5_); + p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.snowball; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) { + this.dropBlockAsItem(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0); + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return p_149646_5_ == 1 || super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSnowBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSnowBlock.java new file mode 100644 index 0000000..6c051ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSnowBlock.java @@ -0,0 +1,40 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public class BlockSnowBlock extends Block { + + + protected BlockSnowBlock() { + super(Material.craftedSnow); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.snowball; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 4; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) { + this.dropBlockAsItem(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0); + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSoulSand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSoulSand.java new file mode 100644 index 0000000..206061f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSoulSand.java @@ -0,0 +1,30 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlockSoulSand extends Block { + + + public BlockSoulSand() { + super(Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + float var5 = 0.125F; + return AxisAlignedBB.getBoundingBox(p_149668_2_, p_149668_3_, p_149668_4_, p_149668_2_ + 1, (float)(p_149668_3_ + 1) - var5, p_149668_4_ + 1); + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + p_149670_5_.motionX *= 0.4D; + p_149670_5_.motionZ *= 0.4D; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSourceImpl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSourceImpl.java new file mode 100644 index 0000000..4087486 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSourceImpl.java @@ -0,0 +1,56 @@ +package net.minecraft.block; + +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class BlockSourceImpl implements IBlockSource { + private final World worldObj; + private final int xPos; + private final int yPos; + private final int zPos; + + + public BlockSourceImpl(World p_i1365_1_, int p_i1365_2_, int p_i1365_3_, int p_i1365_4_) { + this.worldObj = p_i1365_1_; + this.xPos = p_i1365_2_; + this.yPos = p_i1365_3_; + this.zPos = p_i1365_4_; + } + + public World getWorld() { + return this.worldObj; + } + + public double getX() { + return (double)this.xPos + 0.5D; + } + + public double getY() { + return (double)this.yPos + 0.5D; + } + + public double getZ() { + return (double)this.zPos + 0.5D; + } + + public int getXInt() { + return this.xPos; + } + + public int getYInt() { + return this.yPos; + } + + public int getZInt() { + return this.zPos; + } + + public int getBlockMetadata() { + return this.worldObj.getBlockMetadata(this.xPos, this.yPos, this.zPos); + } + + public TileEntity getBlockTileEntity() { + return this.worldObj.getTileEntity(this.xPos, this.yPos, this.zPos); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSponge.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSponge.java new file mode 100644 index 0000000..cbf7b20 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockSponge.java @@ -0,0 +1,13 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockSponge extends Block { + + + protected BlockSponge() { + super(Material.sponge); + this.setCreativeTab(CreativeTabs.tabBlock); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStainedGlass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStainedGlass.java new file mode 100644 index 0000000..7c4c738 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStainedGlass.java @@ -0,0 +1,73 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStainedGlass extends BlockBreakable { + private static final IIcon[] field_149998_a = new IIcon[16]; + + + public BlockStainedGlass(Material p_i45427_1_) { + super("glass", p_i45427_1_, false); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return field_149998_a[p_149691_2_ % field_149998_a.length]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public static int func_149997_b(int p_149997_0_) { + return ~p_149997_0_ & 15; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < field_149998_a.length; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return 1; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + for (int var2 = 0; var2 < field_149998_a.length; ++var2) { + field_149998_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_149997_b(var2)]); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + protected boolean canSilkHarvest() { + return true; + } + + public boolean renderAsNormalBlock() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStainedGlassPane.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStainedGlassPane.java new file mode 100644 index 0000000..ccfafb0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStainedGlassPane.java @@ -0,0 +1,69 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStainedGlassPane extends BlockPane { + private static final IIcon[] field_150106_a = new IIcon[16]; + private static final IIcon[] field_150105_b = new IIcon[16]; + + + public BlockStainedGlassPane() { + super("glass", "glass_pane_top", Material.glass, false); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public IIcon func_149735_b(int p_149735_1_, int p_149735_2_) { + return field_150106_a[p_149735_2_ % field_150106_a.length]; + } + + public IIcon func_150104_b(int p_150104_1_) { + return field_150105_b[~p_150104_1_ & 15]; + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return this.func_149735_b(p_149691_1_, ~p_149691_2_ & 15); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public static int func_150103_c(int p_150103_0_) { + return p_150103_0_ & 15; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < field_150106_a.length; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return 1; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + super.registerBlockIcons(p_149651_1_); + + for (int var2 = 0; var2 < field_150106_a.length; ++var2) { + field_150106_a[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_150103_c(var2)]); + field_150105_b[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_pane_top_" + ItemDye.field_150921_b[func_150103_c(var2)]); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStairs.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStairs.java new file mode 100644 index 0000000..f8d3a9c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStairs.java @@ -0,0 +1,481 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockStairs extends Block { + private static final int[][] field_150150_a = new int[][] {{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}}; + private final Block field_150149_b; + private final int field_150151_M; + private boolean field_150152_N; + private int field_150153_O; + + + protected BlockStairs(Block p_i45428_1_, int p_i45428_2_) { + super(p_i45428_1_.blockMaterial); + this.field_150149_b = p_i45428_1_; + this.field_150151_M = p_i45428_2_; + this.setHardness(p_i45428_1_.blockHardness); + this.setResistance(p_i45428_1_.blockResistance / 3.0F); + this.setStepSound(p_i45428_1_.stepSound); + this.setLightOpacity(255); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + if (this.field_150152_N) { + this.setBlockBounds(0.5F * (float)(this.field_150153_O % 2), 0.5F * (float)(this.field_150153_O / 2 % 2), 0.5F * (float)(this.field_150153_O / 4 % 2), 0.5F + 0.5F * (float)(this.field_150153_O % 2), 0.5F + 0.5F * (float)(this.field_150153_O / 2 % 2), 0.5F + 0.5F * (float)(this.field_150153_O / 4 % 2)); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 10; + } + + public void func_150147_e(IBlockAccess p_150147_1_, int p_150147_2_, int p_150147_3_, int p_150147_4_) { + int var5 = p_150147_1_.getBlockMetadata(p_150147_2_, p_150147_3_, p_150147_4_); + + if ((var5 & 4) != 0) { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + + public static boolean func_150148_a(Block p_150148_0_) { + return p_150148_0_ instanceof BlockStairs; + } + + private boolean func_150146_f(IBlockAccess p_150146_1_, int p_150146_2_, int p_150146_3_, int p_150146_4_, int p_150146_5_) { + Block var6 = p_150146_1_.getBlock(p_150146_2_, p_150146_3_, p_150146_4_); + return func_150148_a(var6) && p_150146_1_.getBlockMetadata(p_150146_2_, p_150146_3_, p_150146_4_) == p_150146_5_; + } + + public boolean func_150145_f(IBlockAccess p_150145_1_, int p_150145_2_, int p_150145_3_, int p_150145_4_) { + int var5 = p_150145_1_.getBlockMetadata(p_150145_2_, p_150145_3_, p_150145_4_); + int var6 = var5 & 3; + float var7 = 0.5F; + float var8 = 1.0F; + + if ((var5 & 4) != 0) { + var7 = 0.0F; + var8 = 0.5F; + } + + float var9 = 0.0F; + float var10 = 1.0F; + float var11 = 0.0F; + float var12 = 0.5F; + boolean var13 = true; + Block var14; + int var15; + int var16; + + if (var6 == 0) { + var9 = 0.5F; + var12 = 1.0F; + var14 = p_150145_1_.getBlock(p_150145_2_ + 1, p_150145_3_, p_150145_4_); + var15 = p_150145_1_.getBlockMetadata(p_150145_2_ + 1, p_150145_3_, p_150145_4_); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; + + if (var16 == 3 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ + 1, var5)) { + var12 = 0.5F; + var13 = false; + } else if (var16 == 2 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ - 1, var5)) { + var11 = 0.5F; + var13 = false; + } + } + } else if (var6 == 1) { + var10 = 0.5F; + var12 = 1.0F; + var14 = p_150145_1_.getBlock(p_150145_2_ - 1, p_150145_3_, p_150145_4_); + var15 = p_150145_1_.getBlockMetadata(p_150145_2_ - 1, p_150145_3_, p_150145_4_); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; + + if (var16 == 3 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ + 1, var5)) { + var12 = 0.5F; + var13 = false; + } else if (var16 == 2 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ - 1, var5)) { + var11 = 0.5F; + var13 = false; + } + } + } else if (var6 == 2) { + var11 = 0.5F; + var12 = 1.0F; + var14 = p_150145_1_.getBlock(p_150145_2_, p_150145_3_, p_150145_4_ + 1); + var15 = p_150145_1_.getBlockMetadata(p_150145_2_, p_150145_3_, p_150145_4_ + 1); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; + + if (var16 == 1 && !this.func_150146_f(p_150145_1_, p_150145_2_ + 1, p_150145_3_, p_150145_4_, var5)) { + var10 = 0.5F; + var13 = false; + } else if (var16 == 0 && !this.func_150146_f(p_150145_1_, p_150145_2_ - 1, p_150145_3_, p_150145_4_, var5)) { + var9 = 0.5F; + var13 = false; + } + } + } else if (var6 == 3) { + var14 = p_150145_1_.getBlock(p_150145_2_, p_150145_3_, p_150145_4_ - 1); + var15 = p_150145_1_.getBlockMetadata(p_150145_2_, p_150145_3_, p_150145_4_ - 1); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; + + if (var16 == 1 && !this.func_150146_f(p_150145_1_, p_150145_2_ + 1, p_150145_3_, p_150145_4_, var5)) { + var10 = 0.5F; + var13 = false; + } else if (var16 == 0 && !this.func_150146_f(p_150145_1_, p_150145_2_ - 1, p_150145_3_, p_150145_4_, var5)) { + var9 = 0.5F; + var13 = false; + } + } + } + + this.setBlockBounds(var9, var7, var11, var10, var8, var12); + return var13; + } + + public boolean func_150144_g(IBlockAccess p_150144_1_, int p_150144_2_, int p_150144_3_, int p_150144_4_) { + int var5 = p_150144_1_.getBlockMetadata(p_150144_2_, p_150144_3_, p_150144_4_); + int var6 = var5 & 3; + float var7 = 0.5F; + float var8 = 1.0F; + + if ((var5 & 4) != 0) { + var7 = 0.0F; + var8 = 0.5F; + } + + float var9 = 0.0F; + float var10 = 0.5F; + float var11 = 0.5F; + float var12 = 1.0F; + boolean var13 = false; + Block var14; + int var15; + int var16; + + if (var6 == 0) { + var14 = p_150144_1_.getBlock(p_150144_2_ - 1, p_150144_3_, p_150144_4_); + var15 = p_150144_1_.getBlockMetadata(p_150144_2_ - 1, p_150144_3_, p_150144_4_); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; + + if (var16 == 3 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ - 1, var5)) { + var11 = 0.0F; + var12 = 0.5F; + var13 = true; + } else if (var16 == 2 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ + 1, var5)) { + var11 = 0.5F; + var12 = 1.0F; + var13 = true; + } + } + } else if (var6 == 1) { + var14 = p_150144_1_.getBlock(p_150144_2_ + 1, p_150144_3_, p_150144_4_); + var15 = p_150144_1_.getBlockMetadata(p_150144_2_ + 1, p_150144_3_, p_150144_4_); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var9 = 0.5F; + var10 = 1.0F; + var16 = var15 & 3; + + if (var16 == 3 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ - 1, var5)) { + var11 = 0.0F; + var12 = 0.5F; + var13 = true; + } else if (var16 == 2 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ + 1, var5)) { + var11 = 0.5F; + var12 = 1.0F; + var13 = true; + } + } + } else if (var6 == 2) { + var14 = p_150144_1_.getBlock(p_150144_2_, p_150144_3_, p_150144_4_ - 1); + var15 = p_150144_1_.getBlockMetadata(p_150144_2_, p_150144_3_, p_150144_4_ - 1); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var11 = 0.0F; + var12 = 0.5F; + var16 = var15 & 3; + + if (var16 == 1 && !this.func_150146_f(p_150144_1_, p_150144_2_ - 1, p_150144_3_, p_150144_4_, var5)) { + var13 = true; + } else if (var16 == 0 && !this.func_150146_f(p_150144_1_, p_150144_2_ + 1, p_150144_3_, p_150144_4_, var5)) { + var9 = 0.5F; + var10 = 1.0F; + var13 = true; + } + } + } else if (var6 == 3) { + var14 = p_150144_1_.getBlock(p_150144_2_, p_150144_3_, p_150144_4_ + 1); + var15 = p_150144_1_.getBlockMetadata(p_150144_2_, p_150144_3_, p_150144_4_ + 1); + + if (func_150148_a(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; + + if (var16 == 1 && !this.func_150146_f(p_150144_1_, p_150144_2_ - 1, p_150144_3_, p_150144_4_, var5)) { + var13 = true; + } else if (var16 == 0 && !this.func_150146_f(p_150144_1_, p_150144_2_ + 1, p_150144_3_, p_150144_4_, var5)) { + var9 = 0.5F; + var10 = 1.0F; + var13 = true; + } + } + } + + if (var13) { + this.setBlockBounds(var9, var7, var11, var10, var8, var12); + } + + return var13; + } + + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { + this.func_150147_e(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + boolean var8 = this.func_150145_f(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + + if (var8 && this.func_150144_g(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_)) { + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + this.field_150149_b.randomDisplayTick(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_, p_149734_5_); + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) { + this.field_150149_b.onBlockClicked(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_); + } + + public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_) { + this.field_150149_b.onBlockDestroyedByPlayer(p_149664_1_, p_149664_2_, p_149664_3_, p_149664_4_, p_149664_5_); + } + + public int getBlockBrightness(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) { + return this.field_150149_b.getBlockBrightness(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_); + } + + /** + * Returns how much this block can resist explosions from the passed in entity. + */ + public float getExplosionResistance(Entity p_149638_1_) { + return this.field_150149_b.getExplosionResistance(p_149638_1_); + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return this.field_150149_b.getRenderBlockPass(); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return this.field_150149_b.getIcon(p_149691_1_, this.field_150151_M); + } + + public int func_149738_a(World p_149738_1_) { + return this.field_150149_b.func_149738_a(p_149738_1_); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + return this.field_150149_b.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + } + + public void velocityToAddToEntity(World p_149640_1_, int p_149640_2_, int p_149640_3_, int p_149640_4_, Entity p_149640_5_, Vec3 p_149640_6_) { + this.field_150149_b.velocityToAddToEntity(p_149640_1_, p_149640_2_, p_149640_3_, p_149640_4_, p_149640_5_, p_149640_6_); + } + + public boolean isCollidable() { + return this.field_150149_b.isCollidable(); + } + + /** + * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param + * par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int p_149678_1_, boolean p_149678_2_) { + return this.field_150149_b.canCollideCheck(p_149678_1_, p_149678_2_); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return this.field_150149_b.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + this.onNeighborBlockChange(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, Blocks.air); + this.field_150149_b.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + this.field_150149_b.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity p_149724_5_) { + this.field_150149_b.onEntityWalking(p_149724_1_, p_149724_2_, p_149724_3_, p_149724_4_, p_149724_5_); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + this.field_150149_b.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + return this.field_150149_b.onBlockActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_, 0, 0.0F, 0.0F, 0.0F); + } + + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) { + this.field_150149_b.onBlockDestroyedByExplosion(p_149723_1_, p_149723_2_, p_149723_3_, p_149723_4_, p_149723_5_); + } + + public MapColor getMapColor(int p_149728_1_) { + return this.field_150149_b.getMapColor(this.field_150151_M); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { + int var7 = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int var8 = p_149689_1_.getBlockMetadata(p_149689_2_, p_149689_3_, p_149689_4_) & 4; + + if (var7 == 0) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 2 | var8, 2); + } + + if (var7 == 1) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 1 | var8, 2); + } + + if (var7 == 2) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 3 | var8, 2); + } + + if (var7 == 3) { + p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 0 | var8, 2); + } + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + return p_149660_5_ != 0 && (p_149660_5_ == 1 || (double)p_149660_7_ <= 0.5D) ? p_149660_9_ : p_149660_9_ | 4; + } + + public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) { + MovingObjectPosition[] var7 = new MovingObjectPosition[8]; + int var8 = p_149731_1_.getBlockMetadata(p_149731_2_, p_149731_3_, p_149731_4_); + int var9 = var8 & 3; + boolean var10 = (var8 & 4) == 4; + int[] var11 = field_150150_a[var9 + (var10 ? 4 : 0)]; + this.field_150152_N = true; + int var14; + int var15; + int var16; + + for (int var12 = 0; var12 < 8; ++var12) { + this.field_150153_O = var12; + int[] var13 = var11; + var14 = var11.length; + + for (var15 = 0; var15 < var14; ++var15) { + var16 = var13[var15]; + + if (var16 == var12) { + } + } + + var7[var12] = super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_); + } + + int[] var21 = var11; + int var23 = var11.length; + + for (var14 = 0; var14 < var23; ++var14) { + var15 = var21[var14]; + var7[var15] = null; + } + + MovingObjectPosition var22 = null; + double var24 = 0.0D; + MovingObjectPosition[] var25 = var7; + var16 = var7.length; + + for (int var17 = 0; var17 < var16; ++var17) { + MovingObjectPosition var18 = var25[var17]; + + if (var18 != null) { + double var19 = var18.hitVec.squareDistanceTo(p_149731_6_); + + if (var19 > var24) { + var22 = var18; + var24 = var19; + } + } + } + + return var22; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStaticLiquid.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStaticLiquid.java new file mode 100644 index 0000000..9852c15 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStaticLiquid.java @@ -0,0 +1,77 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class BlockStaticLiquid extends BlockLiquid { + + + protected BlockStaticLiquid(Material p_i45429_1_) { + super(p_i45429_1_); + this.setTickRandomly(false); + + if (p_i45429_1_ == Material.lava) { + this.setTickRandomly(true); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + + if (p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_) == this) { + this.setNotStationary(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + private void setNotStationary(World p_149818_1_, int p_149818_2_, int p_149818_3_, int p_149818_4_) { + int var5 = p_149818_1_.getBlockMetadata(p_149818_2_, p_149818_3_, p_149818_4_); + p_149818_1_.setBlock(p_149818_2_, p_149818_3_, p_149818_4_, Block.getBlockById(Block.getIdFromBlock(this) - 1), var5, 2); + p_149818_1_.scheduleBlockUpdate(p_149818_2_, p_149818_3_, p_149818_4_, Block.getBlockById(Block.getIdFromBlock(this) - 1), this.func_149738_a(p_149818_1_)); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (this.blockMaterial == Material.lava) { + int var6 = p_149674_5_.nextInt(3); + int var7; + + for (var7 = 0; var7 < var6; ++var7) { + p_149674_2_ += p_149674_5_.nextInt(3) - 1; + ++p_149674_3_; + p_149674_4_ += p_149674_5_.nextInt(3) - 1; + Block var8 = p_149674_1_.getBlock(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var8.blockMaterial == Material.air) { + if (this.isFlammable(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_) || this.isFlammable(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) || this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_)) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.fire); + return; + } + } else if (var8.blockMaterial.blocksMovement()) { + return; + } + } + + if (var6 == 0) { + var7 = p_149674_2_; + int var10 = p_149674_4_; + + for (int var9 = 0; var9 < 3; ++var9) { + p_149674_2_ = var7 + p_149674_5_.nextInt(3) - 1; + p_149674_4_ = var10 + p_149674_5_.nextInt(3) - 1; + + if (p_149674_1_.isAirBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_) && this.isFlammable(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_, Blocks.fire); + } + } + } + } + } + + private boolean isFlammable(World p_149817_1_, int p_149817_2_, int p_149817_3_, int p_149817_4_) { + return p_149817_1_.getBlock(p_149817_2_, p_149817_3_, p_149817_4_).getMaterial().getCanBurn(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStem.java new file mode 100644 index 0000000..435fddd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStem.java @@ -0,0 +1,254 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockStem extends BlockBush implements IGrowable { + private final Block field_149877_a; + private IIcon field_149876_b; + + + protected BlockStem(Block p_i45430_1_) { + this.field_149877_a = p_i45430_1_; + this.setTickRandomly(true); + float var2 = 0.125F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.25F, 0.5F + var2); + this.setCreativeTab(null); + } + + protected boolean func_149854_a(Block p_149854_1_) { + return p_149854_1_ == Blocks.farmland; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + + if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) >= 9) { + float var6 = this.func_149875_n(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + + if (p_149674_5_.nextInt((int)(25.0F / var6) + 1) == 0) { + int var7 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (var7 < 7) { + ++var7; + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var7, 2); + } else { + if (p_149674_1_.getBlock(p_149674_2_ - 1, p_149674_3_, p_149674_4_) == this.field_149877_a) { + return; + } + + if (p_149674_1_.getBlock(p_149674_2_ + 1, p_149674_3_, p_149674_4_) == this.field_149877_a) { + return; + } + + if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_, p_149674_4_ - 1) == this.field_149877_a) { + return; + } + + if (p_149674_1_.getBlock(p_149674_2_, p_149674_3_, p_149674_4_ + 1) == this.field_149877_a) { + return; + } + + int var8 = p_149674_5_.nextInt(4); + int var9 = p_149674_2_; + int var10 = p_149674_4_; + + if (var8 == 0) { + var9 = p_149674_2_ - 1; + } + + if (var8 == 1) { + ++var9; + } + + if (var8 == 2) { + var10 = p_149674_4_ - 1; + } + + if (var8 == 3) { + ++var10; + } + + Block var11 = p_149674_1_.getBlock(var9, p_149674_3_ - 1, var10); + + if (p_149674_1_.getBlock(var9, p_149674_3_, var10).blockMaterial == Material.air && (var11 == Blocks.farmland || var11 == Blocks.dirt || var11 == Blocks.grass)) { + p_149674_1_.setBlock(var9, p_149674_3_, var10, this.field_149877_a); + } + } + } + } + } + + public void func_149874_m(World p_149874_1_, int p_149874_2_, int p_149874_3_, int p_149874_4_) { + int var5 = p_149874_1_.getBlockMetadata(p_149874_2_, p_149874_3_, p_149874_4_) + MathHelper.getRandomIntegerInRange(p_149874_1_.rand, 2, 5); + + if (var5 > 7) { + var5 = 7; + } + + p_149874_1_.setBlockMetadataWithNotify(p_149874_2_, p_149874_3_, p_149874_4_, var5, 2); + } + + private float func_149875_n(World p_149875_1_, int p_149875_2_, int p_149875_3_, int p_149875_4_) { + float var5 = 1.0F; + Block var6 = p_149875_1_.getBlock(p_149875_2_, p_149875_3_, p_149875_4_ - 1); + Block var7 = p_149875_1_.getBlock(p_149875_2_, p_149875_3_, p_149875_4_ + 1); + Block var8 = p_149875_1_.getBlock(p_149875_2_ - 1, p_149875_3_, p_149875_4_); + Block var9 = p_149875_1_.getBlock(p_149875_2_ + 1, p_149875_3_, p_149875_4_); + Block var10 = p_149875_1_.getBlock(p_149875_2_ - 1, p_149875_3_, p_149875_4_ - 1); + Block var11 = p_149875_1_.getBlock(p_149875_2_ + 1, p_149875_3_, p_149875_4_ - 1); + Block var12 = p_149875_1_.getBlock(p_149875_2_ + 1, p_149875_3_, p_149875_4_ + 1); + Block var13 = p_149875_1_.getBlock(p_149875_2_ - 1, p_149875_3_, p_149875_4_ + 1); + boolean var14 = var8 == this || var9 == this; + boolean var15 = var6 == this || var7 == this; + boolean var16 = var10 == this || var11 == this || var12 == this || var13 == this; + + for (int var17 = p_149875_2_ - 1; var17 <= p_149875_2_ + 1; ++var17) { + for (int var18 = p_149875_4_ - 1; var18 <= p_149875_4_ + 1; ++var18) { + Block var19 = p_149875_1_.getBlock(var17, p_149875_3_ - 1, var18); + float var20 = 0.0F; + + if (var19 == Blocks.farmland) { + var20 = 1.0F; + + if (p_149875_1_.getBlockMetadata(var17, p_149875_3_ - 1, var18) > 0) { + var20 = 3.0F; + } + } + + if (var17 != p_149875_2_ || var18 != p_149875_4_) { + var20 /= 4.0F; + } + + var5 += var20; + } + } + + if (var16 || var14 && var15) { + var5 /= 2.0F; + } + + return var5; + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + int var2 = p_149741_1_ * 32; + int var3 = 255 - p_149741_1_ * 8; + int var4 = p_149741_1_ * 4; + return var2 << 16 | var3 << 8 | var4; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + return this.getRenderColor(p_149720_1_.getBlockMetadata(p_149720_2_, p_149720_3_, p_149720_4_)); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float var1 = 0.125F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 0.25F, 0.5F + var1); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.field_149756_F = (float)(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_) * 2 + 2) / 16.0F; + float var5 = 0.125F; + this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var5, 0.5F + var5, (float)this.field_149756_F, 0.5F + var5); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 19; + } + + public int func_149873_e(IBlockAccess p_149873_1_, int p_149873_2_, int p_149873_3_, int p_149873_4_) { + int var5 = p_149873_1_.getBlockMetadata(p_149873_2_, p_149873_3_, p_149873_4_); + return var5 < 7 ? -1 : (p_149873_1_.getBlock(p_149873_2_ - 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 0 : (p_149873_1_.getBlock(p_149873_2_ + 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 1 : (p_149873_1_.getBlock(p_149873_2_, p_149873_3_, p_149873_4_ - 1) == this.field_149877_a ? 2 : (p_149873_1_.getBlock(p_149873_2_, p_149873_3_, p_149873_4_ + 1) == this.field_149877_a ? 3 : -1)))); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + + if (!p_149690_1_.isClient) { + Item var8 = null; + + if (this.field_149877_a == Blocks.pumpkin) { + var8 = Items.pumpkin_seeds; + } + + if (this.field_149877_a == Blocks.melon_block) { + var8 = Items.melon_seeds; + } + + for (int var9 = 0; var9 < 3; ++var9) { + if (p_149690_1_.rand.nextInt(15) <= p_149690_5_) { + this.dropBlockAsItem_do(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(var8)); + } + } + } + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return this.field_149877_a == Blocks.pumpkin ? Items.pumpkin_seeds : (this.field_149877_a == Blocks.melon_block ? Items.melon_seeds : Item.getItemById(0)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_disconnected"); + this.field_149876_b = p_149651_1_.registerIcon(this.getTextureName() + "_connected"); + } + + public IIcon func_149872_i() { + return this.field_149876_b; + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + return p_149851_1_.getBlockMetadata(p_149851_2_, p_149851_3_, p_149851_4_) != 7; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStone.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStone.java new file mode 100644 index 0000000..91b1511 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStone.java @@ -0,0 +1,20 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; + +public class BlockStone extends Block { + + + public BlockStone() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.cobblestone); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStoneBrick.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStoneBrick.java new file mode 100644 index 0000000..0d0e6b6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStoneBrick.java @@ -0,0 +1,59 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStoneBrick extends Block { + public static final String[] field_150142_a = new String[] {"default", "mossy", "cracked", "chiseled"}; + public static final String[] field_150141_b = new String[] {null, "mossy", "cracked", "carved"}; + private IIcon[] field_150143_M; + + + public BlockStoneBrick() { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ < 0 || p_149691_2_ >= field_150141_b.length) { + p_149691_2_ = 0; + } + + return this.field_150143_M[p_149691_2_]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 0; var4 < 4; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150143_M = new IIcon[field_150141_b.length]; + + for (int var2 = 0; var2 < this.field_150143_M.length; ++var2) { + String var3 = this.getTextureName(); + + if (field_150141_b[var2] != null) { + var3 = var3 + "_" + field_150141_b[var2]; + } + + this.field_150143_M[var2] = p_149651_1_.registerIcon(var3); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStoneSlab.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStoneSlab.java new file mode 100644 index 0000000..9b1c3ee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockStoneSlab.java @@ -0,0 +1,70 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStoneSlab extends BlockSlab { + public static final String[] field_150006_b = new String[] {"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; + private IIcon field_150007_M; + + + public BlockStoneSlab(boolean p_i45431_1_) { + super(p_i45431_1_, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + int var3 = p_149691_2_ & 7; + + if (this.field_150004_a && (p_149691_2_ & 8) != 0) { + p_149691_1_ = 1; + } + + return var3 == 0 ? (p_149691_1_ != 1 && p_149691_1_ != 0 ? this.field_150007_M : this.blockIcon) : (var3 == 1 ? Blocks.sandstone.getBlockTextureFromSide(p_149691_1_) : (var3 == 2 ? Blocks.planks.getBlockTextureFromSide(p_149691_1_) : (var3 == 3 ? Blocks.cobblestone.getBlockTextureFromSide(p_149691_1_) : (var3 == 4 ? Blocks.brick_block.getBlockTextureFromSide(p_149691_1_) : (var3 == 5 ? Blocks.stonebrick.getIcon(p_149691_1_, 0) : (var3 == 6 ? Blocks.nether_brick.getBlockTextureFromSide(1) : (var3 == 7 ? Blocks.quartz_block.getBlockTextureFromSide(p_149691_1_) : this.blockIcon))))))); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon("stone_slab_top"); + this.field_150007_M = p_149651_1_.registerIcon("stone_slab_side"); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.stone_slab); + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return new ItemStack(Item.getItemFromBlock(Blocks.stone_slab), 2, p_149644_1_ & 7); + } + + public String func_150002_b(int p_150002_1_) { + if (p_150002_1_ < 0 || p_150002_1_ >= field_150006_b.length) { + p_150002_1_ = 0; + } + + return super.getUnlocalizedName() + "." + field_150006_b[p_150002_1_]; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + if (p_149666_1_ != Item.getItemFromBlock(Blocks.double_stone_slab)) { + for (int var4 = 0; var4 <= 7; ++var4) { + if (var4 != 2) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTNT.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTNT.java new file mode 100644 index 0000000..18477a6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTNT.java @@ -0,0 +1,119 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class BlockTNT extends Block { + private IIcon field_150116_a; + private IIcon field_150115_b; + + + public BlockTNT() { + super(Material.tnt); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 0 ? this.field_150115_b : (p_149691_1_ == 1 ? this.field_150116_a : this.blockIcon); + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + + if (p_149726_1_.isBlockIndirectlyGettingPowered(p_149726_2_, p_149726_3_, p_149726_4_)) { + this.onBlockDestroyedByPlayer(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, 1); + p_149726_1_.setBlockToAir(p_149726_2_, p_149726_3_, p_149726_4_); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_)) { + this.onBlockDestroyedByPlayer(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, 1); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 1; + } + + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) { + if (!p_149723_1_.isClient) { + EntityTNTPrimed var6 = new EntityTNTPrimed(p_149723_1_, (float)p_149723_2_ + 0.5F, (float)p_149723_3_ + 0.5F, (float)p_149723_4_ + 0.5F, p_149723_5_.getExplosivePlacedBy()); + var6.fuse = p_149723_1_.rand.nextInt(var6.fuse / 4) + var6.fuse / 8; + p_149723_1_.spawnEntityInWorld(var6); + } + } + + public void onBlockDestroyedByPlayer(World p_149664_1_, int p_149664_2_, int p_149664_3_, int p_149664_4_, int p_149664_5_) { + this.func_150114_a(p_149664_1_, p_149664_2_, p_149664_3_, p_149664_4_, p_149664_5_, null); + } + + public void func_150114_a(World p_150114_1_, int p_150114_2_, int p_150114_3_, int p_150114_4_, int p_150114_5_, EntityLivingBase p_150114_6_) { + if (!p_150114_1_.isClient) { + if ((p_150114_5_ & 1) == 1) { + EntityTNTPrimed var7 = new EntityTNTPrimed(p_150114_1_, (float)p_150114_2_ + 0.5F, (float)p_150114_3_ + 0.5F, (float)p_150114_4_ + 0.5F, p_150114_6_); + p_150114_1_.spawnEntityInWorld(var7); + p_150114_1_.playSoundAtEntity(var7, "game.tnt.primed", 1.0F, 1.0F); + } + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_5_.getCurrentEquippedItem() != null && p_149727_5_.getCurrentEquippedItem().getItem() == Items.flint_and_steel) { + this.func_150114_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, 1, p_149727_5_); + p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_); + p_149727_5_.getCurrentEquippedItem().damageItem(1, p_149727_5_); + return true; + } else { + return super.onBlockActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); + } + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + if (p_149670_5_ instanceof EntityArrow && !p_149670_1_.isClient) { + EntityArrow var6 = (EntityArrow)p_149670_5_; + + if (var6.isBurning()) { + this.func_150114_a(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, 1, var6.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)var6.shootingEntity : null); + p_149670_1_.setBlockToAir(p_149670_2_, p_149670_3_, p_149670_4_); + } + } + } + + /** + * Return whether this block can drop from an explosion. + */ + public boolean canDropFromExplosion(Explosion p_149659_1_) { + return false; + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_150116_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150115_b = p_149651_1_.registerIcon(this.getTextureName() + "_bottom"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTallGrass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTallGrass.java new file mode 100644 index 0000000..c0f7370 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTallGrass.java @@ -0,0 +1,132 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTallGrass extends BlockBush implements IGrowable { + private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"}; + private IIcon[] field_149870_b; + + + protected BlockTallGrass() { + super(Material.vine); + float var1 = 0.4F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 0.8F, 0.5F + var1); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ >= this.field_149870_b.length) { + p_149691_2_ = 0; + } + + return this.field_149870_b[p_149691_2_]; + } + + public int getBlockColor() { + double var1 = 0.5D; + double var3 = 1.0D; + return ColorizerGrass.getGrassColor(var1, var3); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { + return this.func_149854_a(p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + return p_149741_1_ == 0 ? 16777215 : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + int var5 = p_149720_1_.getBlockMetadata(p_149720_2_, p_149720_3_, p_149720_4_); + return var5 == 0 ? 16777215 : p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).getBiomeGrassColor(p_149720_2_, p_149720_3_, p_149720_4_); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return p_149650_2_.nextInt(8) == 0 ? Items.wheat_seeds : null; + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int p_149679_1_, Random p_149679_2_) { + return 1 + p_149679_2_.nextInt(p_149679_1_ * 2 + 1); + } + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + if (!p_149636_1_.isClient && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) { + p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + this.dropBlockAsItem_do(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.tallgrass, 1, p_149636_6_)); + } else { + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) { + return p_149643_1_.getBlockMetadata(p_149643_2_, p_149643_3_, p_149643_4_); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + for (int var4 = 1; var4 < 3; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_149870_b = new IIcon[field_149871_a.length]; + + for (int var2 = 0; var2 < this.field_149870_b.length; ++var2) { + this.field_149870_b[var2] = p_149651_1_.registerIcon(field_149871_a[var2]); + } + } + + public boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_) { + int var6 = p_149851_1_.getBlockMetadata(p_149851_2_, p_149851_3_, p_149851_4_); + return var6 != 0; + } + + public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + public void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_) { + int var6 = p_149853_1_.getBlockMetadata(p_149853_3_, p_149853_4_, p_149853_5_); + byte var7 = 2; + + if (var6 == 2) { + var7 = 3; + } + + if (Blocks.double_plant.canPlaceBlockAt(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_)) { + Blocks.double_plant.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, var7, 2); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTorch.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTorch.java new file mode 100644 index 0000000..62921ee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTorch.java @@ -0,0 +1,210 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class BlockTorch extends Block { + + + protected BlockTorch() { + super(Material.circuits); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 2; + } + + private boolean func_150107_m(World p_150107_1_, int p_150107_2_, int p_150107_3_, int p_150107_4_) { + if (World.doesBlockHaveSolidTopSurface(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_)) { + return true; + } else { + Block var5 = p_150107_1_.getBlock(p_150107_2_, p_150107_3_, p_150107_4_); + return var5 == Blocks.fence || var5 == Blocks.nether_brick_fence || var5 == Blocks.glass || var5 == Blocks.cobblestone_wall; + } + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.isBlockNormalCubeDefault(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) || (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) || (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) || (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) || this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_)))); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + int var10 = p_149660_9_; + + if (p_149660_5_ == 1 && this.func_150107_m(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_)) { + var10 = 5; + } + + if (p_149660_5_ == 2 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) { + var10 = 4; + } + + if (p_149660_5_ == 3 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) { + var10 = 3; + } + + if (p_149660_5_ == 4 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) { + var10 = 2; + } + + if (p_149660_5_ == 5 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) { + var10 = 1; + } + + return var10; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + + if (p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_) == 0) { + this.onBlockAdded(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + if (p_149726_1_.getBlockMetadata(p_149726_2_, p_149726_3_, p_149726_4_) == 0) { + if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true)) { + p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2); + } else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true)) { + p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2); + } else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true)) { + p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2); + } else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true)) { + p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2); + } else if (this.func_150107_m(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_)) { + p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 5, 2); + } + } + + this.func_150109_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + this.func_150108_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + } + + protected boolean func_150108_b(World p_150108_1_, int p_150108_2_, int p_150108_3_, int p_150108_4_, Block p_150108_5_) { + if (this.func_150109_e(p_150108_1_, p_150108_2_, p_150108_3_, p_150108_4_)) { + int var6 = p_150108_1_.getBlockMetadata(p_150108_2_, p_150108_3_, p_150108_4_); + boolean var7 = !p_150108_1_.isBlockNormalCubeDefault(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && var6 == 1; + + if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && var6 == 2) { + var7 = true; + } + + if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && var6 == 3) { + var7 = true; + } + + if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && var6 == 4) { + var7 = true; + } + + if (!this.func_150107_m(p_150108_1_, p_150108_2_, p_150108_3_ - 1, p_150108_4_) && var6 == 5) { + var7 = true; + } + + if (var7) { + this.dropBlockAsItem(p_150108_1_, p_150108_2_, p_150108_3_, p_150108_4_, p_150108_1_.getBlockMetadata(p_150108_2_, p_150108_3_, p_150108_4_), 0); + p_150108_1_.setBlockToAir(p_150108_2_, p_150108_3_, p_150108_4_); + return true; + } else { + return false; + } + } else { + return true; + } + } + + protected boolean func_150109_e(World p_150109_1_, int p_150109_2_, int p_150109_3_, int p_150109_4_) { + if (!this.canPlaceBlockAt(p_150109_1_, p_150109_2_, p_150109_3_, p_150109_4_)) { + if (p_150109_1_.getBlock(p_150109_2_, p_150109_3_, p_150109_4_) == this) { + this.dropBlockAsItem(p_150109_1_, p_150109_2_, p_150109_3_, p_150109_4_, p_150109_1_.getBlockMetadata(p_150109_2_, p_150109_3_, p_150109_4_), 0); + p_150109_1_.setBlockToAir(p_150109_2_, p_150109_3_, p_150109_4_); + } + + return false; + } else { + return true; + } + } + + public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) { + int var7 = p_149731_1_.getBlockMetadata(p_149731_2_, p_149731_3_, p_149731_4_) & 7; + float var8 = 0.15F; + + if (var7 == 1) { + this.setBlockBounds(0.0F, 0.2F, 0.5F - var8, var8 * 2.0F, 0.8F, 0.5F + var8); + } else if (var7 == 2) { + this.setBlockBounds(1.0F - var8 * 2.0F, 0.2F, 0.5F - var8, 1.0F, 0.8F, 0.5F + var8); + } else if (var7 == 3) { + this.setBlockBounds(0.5F - var8, 0.2F, 0.0F, 0.5F + var8, 0.8F, var8 * 2.0F); + } else if (var7 == 4) { + this.setBlockBounds(0.5F - var8, 0.2F, 1.0F - var8 * 2.0F, 0.5F + var8, 0.8F, 1.0F); + } else { + var8 = 0.1F; + this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, 0.6F, 0.5F + var8); + } + + return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { + int var6 = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + double var7 = (float)p_149734_2_ + 0.5F; + double var9 = (float)p_149734_3_ + 0.7F; + double var11 = (float)p_149734_4_ + 0.5F; + double var13 = 0.2199999988079071D; + double var15 = 0.27000001072883606D; + + if (var6 == 1) { + p_149734_1_.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); + } else if (var6 == 2) { + p_149734_1_.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); + } else if (var6 == 3) { + p_149734_1_.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); + } else if (var6 == 4) { + p_149734_1_.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); + } else { + p_149734_1_.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTrapDoor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTrapDoor.java new file mode 100644 index 0000000..29044b7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTrapDoor.java @@ -0,0 +1,231 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTrapDoor extends Block { + + + protected BlockTrapDoor(Material p_i45434_1_) { + super(p_i45434_1_); + float var2 = 0.5F; + float var3 = 1.0F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var3, 0.5F + var2); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return !func_150118_d(p_149655_1_.getBlockMetadata(p_149655_2_, p_149655_3_, p_149655_4_)); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 0; + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_) { + this.setBlockBoundsBasedOnState(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + return super.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + this.func_150117_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_)); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + float var1 = 0.1875F; + this.setBlockBounds(0.0F, 0.5F - var1 / 2.0F, 0.0F, 1.0F, 0.5F + var1 / 2.0F, 1.0F); + } + + public void func_150117_b(int p_150117_1_) { + float var2 = 0.1875F; + + if ((p_150117_1_ & 8) != 0) { + this.setBlockBounds(0.0F, 1.0F - var2, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var2, 1.0F); + } + + if (func_150118_d(p_150117_1_)) { + if ((p_150117_1_ & 3) == 0) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); + } + + if ((p_150117_1_ & 3) == 1) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); + } + + if ((p_150117_1_ & 3) == 2) { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + if ((p_150117_1_ & 3) == 3) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); + } + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) {} + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (this.blockMaterial == Material.iron) { + return true; + } else { + int var10 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var10 ^ 4, 2); + p_149727_1_.playAuxSFXAtEntity(p_149727_5_, 1003, p_149727_2_, p_149727_3_, p_149727_4_, 0); + return true; + } + } + + public void func_150120_a(World p_150120_1_, int p_150120_2_, int p_150120_3_, int p_150120_4_, boolean p_150120_5_) { + int var6 = p_150120_1_.getBlockMetadata(p_150120_2_, p_150120_3_, p_150120_4_); + boolean var7 = (var6 & 4) > 0; + + if (var7 != p_150120_5_) { + p_150120_1_.setBlockMetadataWithNotify(p_150120_2_, p_150120_3_, p_150120_4_, var6 ^ 4, 2); + p_150120_1_.playAuxSFXAtEntity(null, 1003, p_150120_2_, p_150120_3_, p_150120_4_, 0); + } + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + int var7 = p_149695_2_; + int var8 = p_149695_4_; + + if ((var6 & 3) == 0) { + var8 = p_149695_4_ + 1; + } + + if ((var6 & 3) == 1) { + --var8; + } + + if ((var6 & 3) == 2) { + var7 = p_149695_2_ + 1; + } + + if ((var6 & 3) == 3) { + --var7; + } + + if (!func_150119_a(p_149695_1_.getBlock(var7, p_149695_3_, var8))) { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var6, 0); + } + + boolean var9 = p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_); + + if (var9 || p_149695_5_.canProvidePower()) { + this.func_150120_a(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var9); + } + } + } + + public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) { + this.setBlockBoundsBasedOnState(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_); + return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + int var10 = 0; + + if (p_149660_5_ == 2) { + var10 = 0; + } + + if (p_149660_5_ == 3) { + var10 = 1; + } + + if (p_149660_5_ == 4) { + var10 = 2; + } + + if (p_149660_5_ == 5) { + var10 = 3; + } + + if (p_149660_5_ != 1 && p_149660_5_ != 0 && p_149660_7_ > 0.5F) { + var10 |= 8; + } + + return var10; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + if (p_149707_5_ == 0) { + return false; + } else if (p_149707_5_ == 1) { + return false; + } else { + if (p_149707_5_ == 2) { + ++p_149707_4_; + } + + if (p_149707_5_ == 3) { + --p_149707_4_; + } + + if (p_149707_5_ == 4) { + ++p_149707_2_; + } + + if (p_149707_5_ == 5) { + --p_149707_2_; + } + + return func_150119_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_)); + } + } + + public static boolean func_150118_d(int p_150118_0_) { + return (p_150118_0_ & 4) != 0; + } + + private static boolean func_150119_a(Block p_150119_0_) { + return p_150119_0_.blockMaterial.isOpaque() && p_150119_0_.renderAsNormalBlock() || p_150119_0_ == Blocks.glowstone || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTripWire.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTripWire.java new file mode 100644 index 0000000..7157c8d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTripWire.java @@ -0,0 +1,222 @@ +package net.minecraft.block; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTripWire extends Block { + + + public BlockTripWire() { + super(Material.circuits); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F); + this.setTickRandomly(true); + } + + public int func_149738_a(World p_149738_1_) { + return 10; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + public int getRenderBlockPass() { + return 1; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 30; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.string; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { + return Items.string; + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + boolean var7 = (var6 & 2) == 2; + boolean var8 = !World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_); + + if (var7 != var8) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var6, 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + boolean var6 = (var5 & 4) == 4; + boolean var7 = (var5 & 2) == 2; + + if (!var7) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F); + } else if (!var6) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F); + } + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { + int var5 = World.doesBlockHaveSolidTopSurface(p_149726_1_, p_149726_2_, p_149726_3_ - 1, p_149726_4_) ? 0 : 2; + p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, var5, 3); + this.func_150138_a(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_, var5); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + this.func_150138_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_6_ | 1); + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + if (!p_149681_1_.isClient) { + if (p_149681_6_.getCurrentEquippedItem() != null && p_149681_6_.getCurrentEquippedItem().getItem() == Items.shears) { + p_149681_1_.setBlockMetadataWithNotify(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_ | 8, 4); + } + } + } + + private void func_150138_a(World p_150138_1_, int p_150138_2_, int p_150138_3_, int p_150138_4_, int p_150138_5_) { + int var6 = 0; + + while (var6 < 2) { + int var7 = 1; + + while (true) { + if (var7 < 42) { + int var8 = p_150138_2_ + Direction.offsetX[var6] * var7; + int var9 = p_150138_4_ + Direction.offsetZ[var6] * var7; + Block var10 = p_150138_1_.getBlock(var8, p_150138_3_, var9); + + if (var10 == Blocks.tripwire_hook) { + int var11 = p_150138_1_.getBlockMetadata(var8, p_150138_3_, var9) & 3; + + if (var11 == Direction.rotateOpposite[var6]) { + Blocks.tripwire_hook.func_150136_a(p_150138_1_, var8, p_150138_3_, var9, false, p_150138_1_.getBlockMetadata(var8, p_150138_3_, var9), true, var7, p_150138_5_); + } + } else if (var10 == Blocks.tripwire) { + ++var7; + continue; + } + } + + ++var6; + break; + } + } + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + if (!p_149670_1_.isClient) { + if ((p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_) & 1) != 1) { + this.func_150140_e(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient) { + if ((p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_) & 1) == 1) { + this.func_150140_e(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + } + } + + private void func_150140_e(World p_150140_1_, int p_150140_2_, int p_150140_3_, int p_150140_4_) { + int var5 = p_150140_1_.getBlockMetadata(p_150140_2_, p_150140_3_, p_150140_4_); + boolean var6 = (var5 & 1) == 1; + boolean var7 = false; + List var8 = p_150140_1_.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox((double)p_150140_2_ + this.field_149759_B, (double)p_150140_3_ + this.field_149760_C, (double)p_150140_4_ + this.field_149754_D, (double)p_150140_2_ + this.field_149755_E, (double)p_150140_3_ + this.field_149756_F, (double)p_150140_4_ + this.field_149757_G)); + + if (!var8.isEmpty()) { + Iterator var9 = var8.iterator(); + + while (var9.hasNext()) { + Entity var10 = (Entity)var9.next(); + + if (!var10.doesEntityNotTriggerPressurePlate()) { + var7 = true; + break; + } + } + } + + if (var7 && !var6) { + var5 |= 1; + } + + if (!var7 && var6) { + var5 &= -2; + } + + if (var7 != var6) { + p_150140_1_.setBlockMetadataWithNotify(p_150140_2_, p_150140_3_, p_150140_4_, var5, 3); + this.func_150138_a(p_150140_1_, p_150140_2_, p_150140_3_, p_150140_4_, var5); + } + + if (var7) { + p_150140_1_.scheduleBlockUpdate(p_150140_2_, p_150140_3_, p_150140_4_, this, this.func_149738_a(p_150140_1_)); + } + } + + public static boolean func_150139_a(IBlockAccess p_150139_0_, int p_150139_1_, int p_150139_2_, int p_150139_3_, int p_150139_4_, int p_150139_5_) { + int var6 = p_150139_1_ + Direction.offsetX[p_150139_5_]; + int var8 = p_150139_3_ + Direction.offsetZ[p_150139_5_]; + Block var9 = p_150139_0_.getBlock(var6, p_150139_2_, var8); + boolean var10 = (p_150139_4_ & 2) == 2; + int var11; + + if (var9 == Blocks.tripwire_hook) { + var11 = p_150139_0_.getBlockMetadata(var6, p_150139_2_, var8); + int var13 = var11 & 3; + return var13 == Direction.rotateOpposite[p_150139_5_]; + } else if (var9 == Blocks.tripwire) { + var11 = p_150139_0_.getBlockMetadata(var6, p_150139_2_, var8); + boolean var12 = (var11 & 2) == 2; + return var10 == var12; + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTripWireHook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTripWireHook.java new file mode 100644 index 0000000..e61b0e8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockTripWireHook.java @@ -0,0 +1,314 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTripWireHook extends Block { + + + public BlockTripWireHook() { + super(Material.circuits); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 29; + } + + public int func_149738_a(World p_149738_1_) { + return 10; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + return p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() || (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() || (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() || p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { + return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() || (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() || p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + byte var10 = 0; + + if (p_149660_5_ == 2 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) { + var10 = 2; + } + + if (p_149660_5_ == 3 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) { + var10 = 0; + } + + if (p_149660_5_ == 4 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) { + var10 = 1; + } + + if (p_149660_5_ == 5 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) { + var10 = 3; + } + + return var10; + } + + /** + * Called after a block is placed + */ + public void onPostBlockPlaced(World p_149714_1_, int p_149714_2_, int p_149714_3_, int p_149714_4_, int p_149714_5_) { + this.func_150136_a(p_149714_1_, p_149714_2_, p_149714_3_, p_149714_4_, false, p_149714_5_, false, -1, 0); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (p_149695_5_ != this) { + if (this.func_150137_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + int var6 = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + int var7 = var6 & 3; + boolean var8 = !p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && var7 == 3; + + if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && var7 == 1) { + var8 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && var7 == 0) { + var8 = true; + } + + if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && var7 == 2) { + var8 = true; + } + + if (var8) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, var6, 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + } + } + + public void func_150136_a(World p_150136_1_, int p_150136_2_, int p_150136_3_, int p_150136_4_, boolean p_150136_5_, int p_150136_6_, boolean p_150136_7_, int p_150136_8_, int p_150136_9_) { + int var10 = p_150136_6_ & 3; + boolean var11 = (p_150136_6_ & 4) == 4; + boolean var12 = (p_150136_6_ & 8) == 8; + boolean var13 = !p_150136_5_; + boolean var14 = false; + boolean var15 = !World.doesBlockHaveSolidTopSurface(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_); + int var16 = Direction.offsetX[var10]; + int var17 = Direction.offsetZ[var10]; + int var18 = 0; + int[] var19 = new int[42]; + int var20; + int var21; + int var22; + int var24; + + for (var20 = 1; var20 < 42; ++var20) { + var21 = p_150136_2_ + var16 * var20; + var22 = p_150136_4_ + var17 * var20; + Block var23 = p_150136_1_.getBlock(var21, p_150136_3_, var22); + + if (var23 == Blocks.tripwire_hook) { + var24 = p_150136_1_.getBlockMetadata(var21, p_150136_3_, var22); + + if ((var24 & 3) == Direction.rotateOpposite[var10]) { + var18 = var20; + } + + break; + } + + if (var23 != Blocks.tripwire && var20 != p_150136_8_) { + var19[var20] = -1; + var13 = false; + } else { + var24 = var20 == p_150136_8_ ? p_150136_9_ : p_150136_1_.getBlockMetadata(var21, p_150136_3_, var22); + boolean var25 = (var24 & 8) != 8; + boolean var26 = (var24 & 1) == 1; + boolean var27 = (var24 & 2) == 2; + var13 &= var27 == var15; + var14 |= var25 && var26; + var19[var20] = var24; + + if (var20 == p_150136_8_) { + p_150136_1_.scheduleBlockUpdate(p_150136_2_, p_150136_3_, p_150136_4_, this, this.func_149738_a(p_150136_1_)); + var13 &= var25; + } + } + } + + var13 &= var18 > 1; + var14 &= var13; + var20 = (var13 ? 4 : 0) | (var14 ? 8 : 0); + p_150136_6_ = var10 | var20; + int var28; + + if (var18 > 0) { + var21 = p_150136_2_ + var16 * var18; + var22 = p_150136_4_ + var17 * var18; + var28 = Direction.rotateOpposite[var10]; + p_150136_1_.setBlockMetadataWithNotify(var21, p_150136_3_, var22, var28 | var20, 3); + this.func_150134_a(p_150136_1_, var21, p_150136_3_, var22, var28); + this.func_150135_a(p_150136_1_, var21, p_150136_3_, var22, var13, var14, var11, var12); + } + + this.func_150135_a(p_150136_1_, p_150136_2_, p_150136_3_, p_150136_4_, var13, var14, var11, var12); + + if (!p_150136_5_) { + p_150136_1_.setBlockMetadataWithNotify(p_150136_2_, p_150136_3_, p_150136_4_, p_150136_6_, 3); + + if (p_150136_7_) { + this.func_150134_a(p_150136_1_, p_150136_2_, p_150136_3_, p_150136_4_, var10); + } + } + + if (var11 != var13) { + for (var21 = 1; var21 < var18; ++var21) { + var22 = p_150136_2_ + var16 * var21; + var28 = p_150136_4_ + var17 * var21; + var24 = var19[var21]; + + if (var24 >= 0) { + if (var13) { + var24 |= 4; + } else { + var24 &= -5; + } + + p_150136_1_.setBlockMetadataWithNotify(var22, p_150136_3_, var28, var24, 3); + } + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + this.func_150136_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, false, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), true, -1, 0); + } + + private void func_150135_a(World p_150135_1_, int p_150135_2_, int p_150135_3_, int p_150135_4_, boolean p_150135_5_, boolean p_150135_6_, boolean p_150135_7_, boolean p_150135_8_) { + if (p_150135_6_ && !p_150135_8_) { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.click", 0.4F, 0.6F); + } else if (!p_150135_6_ && p_150135_8_) { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.click", 0.4F, 0.5F); + } else if (p_150135_5_ && !p_150135_7_) { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.click", 0.4F, 0.7F); + } else if (!p_150135_5_ && p_150135_7_) { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.bowhit", 0.4F, 1.2F / (p_150135_1_.rand.nextFloat() * 0.2F + 0.9F)); + } + } + + private void func_150134_a(World p_150134_1_, int p_150134_2_, int p_150134_3_, int p_150134_4_, int p_150134_5_) { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_, p_150134_3_, p_150134_4_, this); + + if (p_150134_5_ == 3) { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_ - 1, p_150134_3_, p_150134_4_, this); + } else if (p_150134_5_ == 1) { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_ + 1, p_150134_3_, p_150134_4_, this); + } else if (p_150134_5_ == 0) { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_, p_150134_3_, p_150134_4_ - 1, this); + } else if (p_150134_5_ == 2) { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_, p_150134_3_, p_150134_4_ + 1, this); + } + } + + private boolean func_150137_e(World p_150137_1_, int p_150137_2_, int p_150137_3_, int p_150137_4_) { + if (!this.canPlaceBlockAt(p_150137_1_, p_150137_2_, p_150137_3_, p_150137_4_)) { + this.dropBlockAsItem(p_150137_1_, p_150137_2_, p_150137_3_, p_150137_4_, p_150137_1_.getBlockMetadata(p_150137_2_, p_150137_3_, p_150137_4_), 0); + p_150137_1_.setBlockToAir(p_150137_2_, p_150137_3_, p_150137_4_); + return false; + } else { + return true; + } + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + int var5 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_) & 3; + float var6 = 0.1875F; + + if (var5 == 3) { + this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6); + } else if (var5 == 1) { + this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6); + } else if (var5 == 0) { + this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F); + } else if (var5 == 2) { + this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F); + } + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + boolean var7 = (p_149749_6_ & 4) == 4; + boolean var8 = (p_149749_6_ & 8) == 8; + + if (var7 || var8) { + this.func_150136_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, true, p_149749_6_, false, -1, 0); + } + + if (var8) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_, this); + int var9 = p_149749_6_ & 3; + + if (var9 == 3) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ - 1, p_149749_3_, p_149749_4_, this); + } else if (var9 == 1) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_ + 1, p_149749_3_, p_149749_4_, this); + } else if (var9 == 0) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ - 1, this); + } else if (var9 == 2) { + p_149749_1_.notifyBlocksOfNeighborChange(p_149749_2_, p_149749_3_, p_149749_4_ + 1, this); + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + public int isProvidingWeakPower(IBlockAccess p_149709_1_, int p_149709_2_, int p_149709_3_, int p_149709_4_, int p_149709_5_) { + return (p_149709_1_.getBlockMetadata(p_149709_2_, p_149709_3_, p_149709_4_) & 8) == 8 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess p_149748_1_, int p_149748_2_, int p_149748_3_, int p_149748_4_, int p_149748_5_) { + int var6 = p_149748_1_.getBlockMetadata(p_149748_2_, p_149748_3_, p_149748_4_); + + if ((var6 & 8) != 8) { + return 0; + } else { + int var7 = var6 & 3; + return var7 == 2 && p_149748_5_ == 2 ? 15 : (var7 == 0 && p_149748_5_ == 3 ? 15 : (var7 == 1 && p_149748_5_ == 4 ? 15 : (var7 == 3 && p_149748_5_ == 5 ? 15 : 0))); + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockVine.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockVine.java new file mode 100644 index 0000000..8a4522b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockVine.java @@ -0,0 +1,344 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockVine extends Block { + + + public BlockVine() { + super(Material.vine); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 20; + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + float var5 = 0.0625F; + int var6 = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_); + float var7 = 1.0F; + float var8 = 1.0F; + float var9 = 1.0F; + float var10 = 0.0F; + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = var6 > 0; + + if ((var6 & 2) != 0) { + var10 = Math.max(var10, 0.0625F); + var7 = 0.0F; + var8 = 0.0F; + var11 = 1.0F; + var9 = 0.0F; + var12 = 1.0F; + var13 = true; + } + + if ((var6 & 8) != 0) { + var7 = Math.min(var7, 0.9375F); + var10 = 1.0F; + var8 = 0.0F; + var11 = 1.0F; + var9 = 0.0F; + var12 = 1.0F; + var13 = true; + } + + if ((var6 & 4) != 0) { + var12 = Math.max(var12, 0.0625F); + var9 = 0.0F; + var7 = 0.0F; + var10 = 1.0F; + var8 = 0.0F; + var11 = 1.0F; + var13 = true; + } + + if ((var6 & 1) != 0) { + var9 = Math.min(var9, 0.9375F); + var12 = 1.0F; + var7 = 0.0F; + var10 = 1.0F; + var8 = 0.0F; + var11 = 1.0F; + var13 = true; + } + + if (!var13 && this.func_150093_a(p_149719_1_.getBlock(p_149719_2_, p_149719_3_ + 1, p_149719_4_))) { + var8 = Math.min(var8, 0.9375F); + var11 = 1.0F; + var7 = 0.0F; + var10 = 1.0F; + var9 = 0.0F; + var12 = 1.0F; + } + + this.setBlockBounds(var7, var8, var9, var10, var11, var12); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + switch (p_149707_5_) { + case 1: + return this.func_150093_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_ + 1, p_149707_4_)); + + case 2: + return this.func_150093_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1)); + + case 3: + return this.func_150093_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1)); + + case 4: + return this.func_150093_a(p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_)); + + case 5: + return this.func_150093_a(p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_)); + + default: + return false; + } + } + + private boolean func_150093_a(Block p_150093_1_) { + return p_150093_1_.renderAsNormalBlock() && p_150093_1_.blockMaterial.blocksMovement(); + } + + private boolean func_150094_e(World p_150094_1_, int p_150094_2_, int p_150094_3_, int p_150094_4_) { + int var5 = p_150094_1_.getBlockMetadata(p_150094_2_, p_150094_3_, p_150094_4_); + int var6 = var5; + + if (var5 > 0) { + for (int var7 = 0; var7 <= 3; ++var7) { + int var8 = 1 << var7; + + if ((var5 & var8) != 0 && !this.func_150093_a(p_150094_1_.getBlock(p_150094_2_ + Direction.offsetX[var7], p_150094_3_, p_150094_4_ + Direction.offsetZ[var7])) && (p_150094_1_.getBlock(p_150094_2_, p_150094_3_ + 1, p_150094_4_) != this || (p_150094_1_.getBlockMetadata(p_150094_2_, p_150094_3_ + 1, p_150094_4_) & var8) == 0)) { + var6 &= ~var8; + } + } + } + + if (var6 == 0 && !this.func_150093_a(p_150094_1_.getBlock(p_150094_2_, p_150094_3_ + 1, p_150094_4_))) { + return false; + } else { + if (var6 != var5) { + p_150094_1_.setBlockMetadataWithNotify(p_150094_2_, p_150094_3_, p_150094_4_, var6, 2); + } + + return true; + } + } + + public int getBlockColor() { + return ColorizerFoliage.getFoliageColorBasic(); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + public int getRenderColor(int p_149741_1_) { + return ColorizerFoliage.getFoliageColorBasic(); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { + return p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).getBiomeFoliageColor(p_149720_2_, p_149720_3_, p_149720_4_); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { + if (!p_149695_1_.isClient && !this.func_150094_e(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_)) { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_), 0); + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { + if (!p_149674_1_.isClient && p_149674_1_.rand.nextInt(4) == 0) { + byte var6 = 4; + int var7 = 5; + boolean var8 = false; + int var9; + int var10; + int var11; + label134: + + for (var9 = p_149674_2_ - var6; var9 <= p_149674_2_ + var6; ++var9) { + for (var10 = p_149674_4_ - var6; var10 <= p_149674_4_ + var6; ++var10) { + for (var11 = p_149674_3_ - 1; var11 <= p_149674_3_ + 1; ++var11) { + if (p_149674_1_.getBlock(var9, var11, var10) == this) { + --var7; + + if (var7 <= 0) { + var8 = true; + break label134; + } + } + } + } + } + + var9 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + var10 = p_149674_1_.rand.nextInt(6); + var11 = Direction.facingToDirection[var10]; + int var13; + + if (var10 == 1 && p_149674_3_ < 255 && p_149674_1_.isAirBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_)) { + if (var8) { + return; + } + + int var15 = p_149674_1_.rand.nextInt(16) & var9; + + if (var15 > 0) { + for (var13 = 0; var13 <= 3; ++var13) { + if (!this.func_150093_a(p_149674_1_.getBlock(p_149674_2_ + Direction.offsetX[var13], p_149674_3_ + 1, p_149674_4_ + Direction.offsetZ[var13]))) { + var15 &= ~(1 << var13); + } + } + + if (var15 > 0) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_, this, var15, 2); + } + } + } else { + Block var12; + int var14; + + if (var10 >= 2 && var10 <= 5 && (var9 & 1 << var11) == 0) { + if (var8) { + return; + } + + var12 = p_149674_1_.getBlock(p_149674_2_ + Direction.offsetX[var11], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11]); + + if (var12.blockMaterial == Material.air) { + var13 = var11 + 1 & 3; + var14 = var11 + 3 & 3; + + if ((var9 & 1 << var13) != 0 && this.func_150093_a(p_149674_1_.getBlock(p_149674_2_ + Direction.offsetX[var11] + Direction.offsetX[var13], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11] + Direction.offsetZ[var13]))) { + p_149674_1_.setBlock(p_149674_2_ + Direction.offsetX[var11], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11], this, 1 << var13, 2); + } else if ((var9 & 1 << var14) != 0 && this.func_150093_a(p_149674_1_.getBlock(p_149674_2_ + Direction.offsetX[var11] + Direction.offsetX[var14], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11] + Direction.offsetZ[var14]))) { + p_149674_1_.setBlock(p_149674_2_ + Direction.offsetX[var11], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11], this, 1 << var14, 2); + } else if ((var9 & 1 << var13) != 0 && p_149674_1_.isAirBlock(p_149674_2_ + Direction.offsetX[var11] + Direction.offsetX[var13], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11] + Direction.offsetZ[var13]) && this.func_150093_a(p_149674_1_.getBlock(p_149674_2_ + Direction.offsetX[var13], p_149674_3_, p_149674_4_ + Direction.offsetZ[var13]))) { + p_149674_1_.setBlock(p_149674_2_ + Direction.offsetX[var11] + Direction.offsetX[var13], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11] + Direction.offsetZ[var13], this, 1 << (var11 + 2 & 3), 2); + } else if ((var9 & 1 << var14) != 0 && p_149674_1_.isAirBlock(p_149674_2_ + Direction.offsetX[var11] + Direction.offsetX[var14], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11] + Direction.offsetZ[var14]) && this.func_150093_a(p_149674_1_.getBlock(p_149674_2_ + Direction.offsetX[var14], p_149674_3_, p_149674_4_ + Direction.offsetZ[var14]))) { + p_149674_1_.setBlock(p_149674_2_ + Direction.offsetX[var11] + Direction.offsetX[var14], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11] + Direction.offsetZ[var14], this, 1 << (var11 + 2 & 3), 2); + } else if (this.func_150093_a(p_149674_1_.getBlock(p_149674_2_ + Direction.offsetX[var11], p_149674_3_ + 1, p_149674_4_ + Direction.offsetZ[var11]))) { + p_149674_1_.setBlock(p_149674_2_ + Direction.offsetX[var11], p_149674_3_, p_149674_4_ + Direction.offsetZ[var11], this, 0, 2); + } + } else if (var12.blockMaterial.isOpaque() && var12.renderAsNormalBlock()) { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, var9 | 1 << var11, 2); + } + } else if (p_149674_3_ > 1) { + var12 = p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_); + + if (var12.blockMaterial == Material.air) { + var13 = p_149674_1_.rand.nextInt(16) & var9; + + if (var13 > 0) { + p_149674_1_.setBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_, this, var13, 2); + } + } else if (var12 == this) { + var13 = p_149674_1_.rand.nextInt(16) & var9; + var14 = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_ - 1, p_149674_4_); + + if (var14 != (var14 | var13)) { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_ - 1, p_149674_4_, var14 | var13, 2); + } + } + } + } + } + } + + public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) { + byte var10 = 0; + + switch (p_149660_5_) { + case 2: + var10 = 1; + break; + + case 3: + var10 = 4; + break; + + case 4: + var10 = 8; + break; + + case 5: + var10 = 2; + } + + return var10 != 0 ? var10 : p_149660_9_; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random p_149745_1_) { + return 0; + } + + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { + if (!p_149636_1_.isClient && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) { + p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + this.dropBlockAsItem_do(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.vine, 1, 0)); + } else { + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWall.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWall.java new file mode 100644 index 0000000..a25668b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWall.java @@ -0,0 +1,125 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockWall extends Block { + public static final String[] field_150092_a = new String[] {"normal", "mossy"}; + + + public BlockWall(Block p_i45435_1_) { + super(p_i45435_1_.blockMaterial); + this.setHardness(p_i45435_1_.blockHardness); + this.setResistance(p_i45435_1_.blockResistance / 3.0F); + this.setStepSound(p_i45435_1_.stepSound); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_2_ == 1 ? Blocks.mossy_cobblestone.getBlockTextureFromSide(p_149691_1_) : Blocks.cobblestone.getBlockTextureFromSide(p_149691_1_); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 32; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) { + return false; + } + + public boolean isOpaqueCube() { + return false; + } + + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) { + boolean var5 = this.func_150091_e(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1); + boolean var6 = this.func_150091_e(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1); + boolean var7 = this.func_150091_e(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_); + boolean var8 = this.func_150091_e(p_149719_1_, p_149719_2_ + 1, p_149719_3_, p_149719_4_); + float var9 = 0.25F; + float var10 = 0.75F; + float var11 = 0.25F; + float var12 = 0.75F; + float var13 = 1.0F; + + if (var5) { + var11 = 0.0F; + } + + if (var6) { + var12 = 1.0F; + } + + if (var7) { + var9 = 0.0F; + } + + if (var8) { + var10 = 1.0F; + } + + if (var5 && var6 && !var7 && !var8) { + var13 = 0.8125F; + var9 = 0.3125F; + var10 = 0.6875F; + } else if (!var5 && !var6 && var7 && var8) { + var13 = 0.8125F; + var11 = 0.3125F; + var12 = 0.6875F; + } + + this.setBlockBounds(var9, 0.0F, var11, var10, var13, var12); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + this.field_149756_F = 1.5D; + return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_); + } + + public boolean func_150091_e(IBlockAccess p_150091_1_, int p_150091_2_, int p_150091_3_, int p_150091_4_) { + Block var5 = p_150091_1_.getBlock(p_150091_2_, p_150091_3_, p_150091_4_); + return var5 == this || var5 == Blocks.fence_gate || (var5.blockMaterial.isOpaque() && var5.renderAsNormalBlock() && var5.blockMaterial != Material.field_151572_C); + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return p_149646_5_ != 0 || super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWeb.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWeb.java new file mode 100644 index 0000000..4fc74db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWeb.java @@ -0,0 +1,54 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlockWeb extends Block { + + + public BlockWeb() { + super(Material.field_151569_G); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { + p_149670_5_.setInWeb(); + } + + public boolean isOpaqueCube() { + return false; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + return null; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() { + return 1; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Items.string; + } + + protected boolean canSilkHarvest() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWood.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWood.java new file mode 100644 index 0000000..fc414be --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWood.java @@ -0,0 +1,55 @@ +package net.minecraft.block; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockWood extends Block { + public static final String[] field_150096_a = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "big_oak"}; + private IIcon[] field_150095_b; + + + public BlockWood() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if (p_149691_2_ < 0 || p_149691_2_ >= this.field_150095_b.length) { + p_149691_2_ = 0; + } + + return this.field_150095_b[p_149691_2_]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int p_149692_1_) { + return p_149692_1_; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 3)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 4)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 5)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.field_150095_b = new IIcon[field_150096_a.length]; + + for (int var2 = 0; var2 < this.field_150095_b.length; ++var2) { + this.field_150095_b[var2] = p_149651_1_.registerIcon(this.getTextureName() + "_" + field_150096_a[var2]); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWoodSlab.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWoodSlab.java new file mode 100644 index 0000000..7403457 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWoodSlab.java @@ -0,0 +1,58 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockWoodSlab extends BlockSlab { + public static final String[] field_150005_b = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "big_oak"}; + + + public BlockWoodSlab(boolean p_i45437_1_) { + super(p_i45437_1_, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return Blocks.planks.getIcon(p_149691_1_, p_149691_2_ & 7); + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return Item.getItemFromBlock(Blocks.wooden_slab); + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int p_149644_1_) { + return new ItemStack(Item.getItemFromBlock(Blocks.wooden_slab), 2, p_149644_1_ & 7); + } + + public String func_150002_b(int p_150002_1_) { + if (p_150002_1_ < 0 || p_150002_1_ >= field_150005_b.length) { + p_150002_1_ = 0; + } + + return super.getUnlocalizedName() + "." + field_150005_b[p_150002_1_]; + } + + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + if (p_149666_1_ != Item.getItemFromBlock(Blocks.double_wooden_slab)) { + for (int var4 = 0; var4 < field_150005_b.length; ++var4) { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, var4)); + } + } + } + + public void registerBlockIcons(IIconRegister p_149651_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWorkbench.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWorkbench.java new file mode 100644 index 0000000..499c71d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/BlockWorkbench.java @@ -0,0 +1,45 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockWorkbench extends Block { + private IIcon field_150035_a; + private IIcon field_150034_b; + + + protected BlockWorkbench() { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Gets the block's texture. Args: side, meta + */ + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return p_149691_1_ == 1 ? this.field_150035_a : (p_149691_1_ == 0 ? Blocks.planks.getBlockTextureFromSide(p_149691_1_) : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.field_150034_b)); + } + + public void registerBlockIcons(IIconRegister p_149651_1_) { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + this.field_150035_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_front"); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + if (p_149727_1_.isClient) { + return true; + } else { + p_149727_5_.displayGUIWorkbench(p_149727_2_, p_149727_3_, p_149727_4_); + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/IGrowable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/IGrowable.java new file mode 100644 index 0000000..ffa7021 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/IGrowable.java @@ -0,0 +1,12 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.world.World; + +public interface IGrowable { + boolean func_149851_a(World p_149851_1_, int p_149851_2_, int p_149851_3_, int p_149851_4_, boolean p_149851_5_); + + boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_); + + void func_149853_b(World p_149853_1_, Random p_149853_2_, int p_149853_3_, int p_149853_4_, int p_149853_5_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/ITileEntityProvider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/ITileEntityProvider.java new file mode 100644 index 0000000..ea744ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/ITileEntityProvider.java @@ -0,0 +1,11 @@ +package net.minecraft.block; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public interface ITileEntityProvider { + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MapColor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MapColor.java new file mode 100644 index 0000000..32613d3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MapColor.java @@ -0,0 +1,143 @@ +package net.minecraft.block.material; + +import net.minecraft.block.BlockColored; + +public class MapColor { + /** + * Holds all the 16 colors used on maps, very similar of a pallete system. + */ + public static final MapColor[] mapColorArray = new MapColor[64]; + public static final MapColor field_151660_b = new MapColor(0, 0); + public static final MapColor field_151661_c = new MapColor(1, 8368696); + public static final MapColor field_151658_d = new MapColor(2, 16247203); + public static final MapColor field_151659_e = new MapColor(3, 10987431); + public static final MapColor field_151656_f = new MapColor(4, 16711680); + public static final MapColor field_151657_g = new MapColor(5, 10526975); + public static final MapColor field_151668_h = new MapColor(6, 10987431); + public static final MapColor field_151669_i = new MapColor(7, 31744); + public static final MapColor field_151666_j = new MapColor(8, 16777215); + public static final MapColor field_151667_k = new MapColor(9, 10791096); + public static final MapColor field_151664_l = new MapColor(10, 12020271); + public static final MapColor field_151665_m = new MapColor(11, 7368816); + public static final MapColor field_151662_n = new MapColor(12, 4210943); + public static final MapColor field_151663_o = new MapColor(13, 6837042); + public static final MapColor field_151677_p = new MapColor(14, 16776437); + public static final MapColor field_151676_q = new MapColor(15, 14188339); + public static final MapColor field_151675_r = new MapColor(16, 11685080); + public static final MapColor field_151674_s = new MapColor(17, 6724056); + public static final MapColor field_151673_t = new MapColor(18, 15066419); + public static final MapColor field_151672_u = new MapColor(19, 8375321); + public static final MapColor field_151671_v = new MapColor(20, 15892389); + public static final MapColor field_151670_w = new MapColor(21, 5000268); + public static final MapColor field_151680_x = new MapColor(22, 10066329); + public static final MapColor field_151679_y = new MapColor(23, 5013401); + public static final MapColor field_151678_z = new MapColor(24, 8339378); + public static final MapColor field_151649_A = new MapColor(25, 3361970); + public static final MapColor field_151650_B = new MapColor(26, 6704179); + public static final MapColor field_151651_C = new MapColor(27, 6717235); + public static final MapColor field_151645_D = new MapColor(28, 10040115); + public static final MapColor field_151646_E = new MapColor(29, 1644825); + public static final MapColor field_151647_F = new MapColor(30, 16445005); + public static final MapColor field_151648_G = new MapColor(31, 6085589); + public static final MapColor field_151652_H = new MapColor(32, 4882687); + public static final MapColor field_151653_I = new MapColor(33, 55610); + public static final MapColor field_151654_J = new MapColor(34, 1381407); + public static final MapColor field_151655_K = new MapColor(35, 7340544); + + /** Holds the color in RGB value that will be rendered on maps. */ + public final int colorValue; + + /** Holds the index of the color used on map. */ + public final int colorIndex; + + + private MapColor(int p_i2117_1_, int p_i2117_2_) { + if (p_i2117_1_ >= 0 && p_i2117_1_ <= 63) { + this.colorIndex = p_i2117_1_; + this.colorValue = p_i2117_2_; + mapColorArray[p_i2117_1_] = this; + } else { + throw new IndexOutOfBoundsException("Map colour ID must be between 0 and 63 (inclusive)"); + } + } + + public static MapColor func_151644_a(int p_151644_0_) { + switch (BlockColored.func_150031_c(p_151644_0_)) { + case 0: + return field_151646_E; + + case 1: + return field_151645_D; + + case 2: + return field_151651_C; + + case 3: + return field_151650_B; + + case 4: + return field_151649_A; + + case 5: + return field_151678_z; + + case 6: + return field_151679_y; + + case 7: + return field_151680_x; + + case 8: + return field_151670_w; + + case 9: + return field_151671_v; + + case 10: + return field_151672_u; + + case 11: + return field_151673_t; + + case 12: + return field_151674_s; + + case 13: + return field_151675_r; + + case 14: + return field_151676_q; + + case 15: + return field_151666_j; + + default: + return field_151660_b; + } + } + + public int func_151643_b(int p_151643_1_) { + short var2 = 220; + + if (p_151643_1_ == 3) { + var2 = 135; + } + + if (p_151643_1_ == 2) { + var2 = 255; + } + + if (p_151643_1_ == 1) { + var2 = 220; + } + + if (p_151643_1_ == 0) { + var2 = 180; + } + + int var3 = (this.colorValue >> 16 & 255) * var2 / 255; + int var4 = (this.colorValue >> 8 & 255) * var2 / 255; + int var5 = (this.colorValue & 255) * var2 / 255; + return -16777216 | var3 << 16 | var4 << 8 | var5; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/Material.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/Material.java new file mode 100644 index 0000000..a4d2a0a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/Material.java @@ -0,0 +1,207 @@ +package net.minecraft.block.material; + +public class Material { + public static final Material air = new MaterialTransparent(MapColor.field_151660_b); + public static final Material grass = new Material(MapColor.field_151661_c); + public static final Material ground = new Material(MapColor.field_151664_l); + public static final Material wood = (new Material(MapColor.field_151663_o)).setBurning(); + public static final Material rock = (new Material(MapColor.field_151665_m)).setRequiresTool(); + public static final Material iron = (new Material(MapColor.field_151668_h)).setRequiresTool(); + public static final Material anvil = (new Material(MapColor.field_151668_h)).setRequiresTool().setImmovableMobility(); + public static final Material water = (new MaterialLiquid(MapColor.field_151662_n)).setNoPushMobility(); + public static final Material lava = (new MaterialLiquid(MapColor.field_151656_f)).setNoPushMobility(); + public static final Material leaves = (new Material(MapColor.field_151669_i)).setBurning().setTranslucent().setNoPushMobility(); + public static final Material plants = (new MaterialLogic(MapColor.field_151669_i)).setNoPushMobility(); + public static final Material vine = (new MaterialLogic(MapColor.field_151669_i)).setBurning().setNoPushMobility().setReplaceable(); + public static final Material sponge = new Material(MapColor.field_151659_e); + public static final Material cloth = (new Material(MapColor.field_151659_e)).setBurning(); + public static final Material fire = (new MaterialTransparent(MapColor.field_151660_b)).setNoPushMobility(); + public static final Material sand = new Material(MapColor.field_151658_d); + public static final Material circuits = (new MaterialLogic(MapColor.field_151660_b)).setNoPushMobility(); + public static final Material carpet = (new MaterialLogic(MapColor.field_151659_e)).setBurning(); + public static final Material glass = (new Material(MapColor.field_151660_b)).setTranslucent().setAdventureModeExempt(); + public static final Material redstoneLight = (new Material(MapColor.field_151660_b)).setAdventureModeExempt(); + public static final Material tnt = (new Material(MapColor.field_151656_f)).setBurning().setTranslucent(); + public static final Material coral = (new Material(MapColor.field_151669_i)).setNoPushMobility(); + public static final Material ice = (new Material(MapColor.field_151657_g)).setTranslucent().setAdventureModeExempt(); + public static final Material field_151598_x = (new Material(MapColor.field_151657_g)).setAdventureModeExempt(); + public static final Material field_151597_y = (new MaterialLogic(MapColor.field_151666_j)).setReplaceable().setTranslucent().setRequiresTool().setNoPushMobility(); + + /** The material for crafted snow. */ + public static final Material craftedSnow = (new Material(MapColor.field_151666_j)).setRequiresTool(); + public static final Material field_151570_A = (new Material(MapColor.field_151669_i)).setTranslucent().setNoPushMobility(); + public static final Material field_151571_B = new Material(MapColor.field_151667_k); + public static final Material field_151572_C = (new Material(MapColor.field_151669_i)).setNoPushMobility(); + public static final Material dragonEgg = (new Material(MapColor.field_151669_i)).setNoPushMobility(); + public static final Material Portal = (new MaterialPortal(MapColor.field_151660_b)).setImmovableMobility(); + public static final Material field_151568_F = (new Material(MapColor.field_151660_b)).setNoPushMobility(); + public static final Material field_151569_G = (new Material(MapColor.field_151659_e) { + + public boolean blocksMovement() { + return false; + } + }).setRequiresTool().setNoPushMobility(); + + /** Pistons' material. */ + public static final Material piston = (new Material(MapColor.field_151665_m)).setImmovableMobility(); + + /** Bool defining if the block can burn or not. */ + private boolean canBurn; + + /** + * Determines whether blocks with this material can be "overwritten" by other blocks when placed - eg snow, vines + * and tall grass. + */ + private boolean replaceable; + + /** Indicates if the material is translucent */ + private boolean isTranslucent; + + /** The color index used to draw the blocks of this material on maps. */ + private final MapColor materialMapColor; + + /** + * Determines if the material can be harvested without a tool (or with the wrong tool) + */ + private boolean requiresNoTool = true; + + /** + * Mobility information flag. 0 indicates that this block is normal, 1 indicates that it can't push other blocks, 2 + * indicates that it can't be pushed. + */ + private int mobilityFlag; + private boolean isAdventureModeExempt; + + + public Material(MapColor p_i2116_1_) { + this.materialMapColor = p_i2116_1_; + } + + /** + * Returns if blocks of these materials are liquids. + */ + public boolean isLiquid() { + return false; + } + + public boolean isSolid() { + return true; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() { + return true; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return true; + } + + /** + * Marks the material as translucent + */ + private Material setTranslucent() { + this.isTranslucent = true; + return this; + } + + /** + * Makes blocks with this material require the correct tool to be harvested. + */ + protected Material setRequiresTool() { + this.requiresNoTool = false; + return this; + } + + /** + * Set the canBurn bool to True and return the current object. + */ + protected Material setBurning() { + this.canBurn = true; + return this; + } + + /** + * Returns if the block can burn or not. + */ + public boolean getCanBurn() { + return this.canBurn; + } + + /** + * Sets {@link #replaceable} to true. + */ + public Material setReplaceable() { + this.replaceable = true; + return this; + } + + /** + * Returns whether the material can be replaced by other blocks when placed - eg snow, vines and tall grass. + */ + public boolean isReplaceable() { + return this.replaceable; + } + + /** + * Indicate if the material is opaque + */ + public boolean isOpaque() { + return !this.isTranslucent && this.blocksMovement(); + } + + /** + * Returns true if the material can be harvested without a tool (or with the wrong tool) + */ + public boolean isToolNotRequired() { + return this.requiresNoTool; + } + + /** + * Returns the mobility information of the material, 0 = free, 1 = can't push but can move over, 2 = total + * immobility and stop pistons. + */ + public int getMaterialMobility() { + return this.mobilityFlag; + } + + /** + * This type of material can't be pushed, but pistons can move over it. + */ + protected Material setNoPushMobility() { + this.mobilityFlag = 1; + return this; + } + + /** + * This type of material can't be pushed, and pistons are blocked to move. + */ + protected Material setImmovableMobility() { + this.mobilityFlag = 2; + return this; + } + + /** + * @see #isAdventureModeExempt() + */ + protected Material setAdventureModeExempt() { + this.isAdventureModeExempt = true; + return this; + } + + /** + * Returns true if blocks with this material can always be mined in adventure mode. + */ + public boolean isAdventureModeExempt() { + return this.isAdventureModeExempt; + } + + public MapColor getMaterialMapColor() { + return this.materialMapColor; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialLiquid.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialLiquid.java new file mode 100644 index 0000000..e0d7edc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialLiquid.java @@ -0,0 +1,29 @@ +package net.minecraft.block.material; + +public class MaterialLiquid extends Material { + + + public MaterialLiquid(MapColor p_i2114_1_) { + super(p_i2114_1_); + this.setReplaceable(); + this.setNoPushMobility(); + } + + /** + * Returns if blocks of these materials are liquids. + */ + public boolean isLiquid() { + return true; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } + + public boolean isSolid() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialLogic.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialLogic.java new file mode 100644 index 0000000..f169dc9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialLogic.java @@ -0,0 +1,28 @@ +package net.minecraft.block.material; + +public class MaterialLogic extends Material { + + + public MaterialLogic(MapColor p_i2112_1_) { + super(p_i2112_1_); + this.setAdventureModeExempt(); + } + + public boolean isSolid() { + return false; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() { + return false; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialPortal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialPortal.java new file mode 100644 index 0000000..d1435e7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialPortal.java @@ -0,0 +1,27 @@ +package net.minecraft.block.material; + +public class MaterialPortal extends Material { + + + public MaterialPortal(MapColor p_i2118_1_) { + super(p_i2118_1_); + } + + public boolean isSolid() { + return false; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() { + return false; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialTransparent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialTransparent.java new file mode 100644 index 0000000..434fe09 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/block/material/MaterialTransparent.java @@ -0,0 +1,28 @@ +package net.minecraft.block.material; + +public class MaterialTransparent extends Material { + + + public MaterialTransparent(MapColor p_i2113_1_) { + super(p_i2113_1_); + this.setReplaceable(); + } + + public boolean isSolid() { + return false; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() { + return false; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/AnvilConverterException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/AnvilConverterException.java new file mode 100644 index 0000000..653a39e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/AnvilConverterException.java @@ -0,0 +1,9 @@ +package net.minecraft.client; + +public class AnvilConverterException extends Exception { + + + public AnvilConverterException(String p_i2160_1_) { + super(p_i2160_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/ClientBrandRetriever.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/ClientBrandRetriever.java new file mode 100644 index 0000000..d21df37 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/ClientBrandRetriever.java @@ -0,0 +1,9 @@ +package net.minecraft.client; + +public class ClientBrandRetriever { + + + public static String getClientModName() { + return "vanilla"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/LoadingScreenRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/LoadingScreenRenderer.java new file mode 100644 index 0000000..be90961 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/LoadingScreenRenderer.java @@ -0,0 +1,183 @@ +package net.minecraft.client; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.shader.FrameBuffer; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MinecraftError; +import org.lwjgl.opengl.GL11; + +public class LoadingScreenRenderer implements IProgressUpdate { + private String field_73727_a = ""; + + /** A reference to the Minecraft object. */ + private final Minecraft mc; + + /** + * The text currently displayed (i.e. the argument to the last call to printText or func_73722_d) + */ + private String currentlyDisplayedText = ""; + private long field_73723_d = Minecraft.getSystemTime(); + private boolean field_73724_e; + private final ScaledResolution field_146587_f; + private final FrameBuffer field_146588_g; + + + public LoadingScreenRenderer(Minecraft p_i1017_1_) { + this.mc = p_i1017_1_; + this.field_146587_f = new ScaledResolution(p_i1017_1_, p_i1017_1_.displayWidth, p_i1017_1_.displayHeight); + this.field_146588_g = new FrameBuffer(p_i1017_1_.displayWidth, p_i1017_1_.displayHeight, false); + this.field_146588_g.setFramebufferFilter(9728); + } + + /** + * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, + * and the WorkingString to "working...". + */ + public void resetProgressAndMessage(String p_73721_1_) { + this.field_73724_e = false; + this.func_73722_d(p_73721_1_); + } + + /** + * "Saving level", or the loading,or downloading equivelent + */ + public void displayProgressMessage(String p_73720_1_) { + this.field_73724_e = true; + this.func_73722_d(p_73720_1_); + } + + public void func_73722_d(String p_73722_1_) { + this.currentlyDisplayedText = p_73722_1_; + + if (!this.mc.running) { + if (!this.field_73724_e) { + throw new MinecraftError(); + } + } else { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + + if (OpenGlHelper.isFramebufferEnabled()) { + int var2 = this.field_146587_f.getScaleFactor(); + GL11.glOrtho(0.0D, this.field_146587_f.getScaledWidth() * var2, this.field_146587_f.getScaledHeight() * var2, 0.0D, 100.0D, 300.0D); + } else { + ScaledResolution var3 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + GL11.glOrtho(0.0D, var3.getScaledWidth_double(), var3.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -200.0F); + } + } + + /** + * This is called with "Working..." by resetProgressAndMessage + */ + public void resetProgresAndWorkingMessage(String p_73719_1_) { + if (!this.mc.running) { + if (!this.field_73724_e) { + throw new MinecraftError(); + } + } else { + this.field_73723_d = 0L; + this.field_73727_a = p_73719_1_; + this.setLoadingProgress(-1); + this.field_73723_d = 0L; + } + } + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + public void setLoadingProgress(int p_73718_1_) { + if (!this.mc.running) { + if (!this.field_73724_e) { + throw new MinecraftError(); + } + } else { + long var2 = Minecraft.getSystemTime(); + + if (var2 - this.field_73723_d >= 100L) { + this.field_73723_d = var2; + ScaledResolution var4 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var5 = var4.getScaleFactor(); + int var6 = var4.getScaledWidth(); + int var7 = var4.getScaledHeight(); + + if (OpenGlHelper.isFramebufferEnabled()) { + this.field_146588_g.framebufferClear(); + } else { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + } + + this.field_146588_g.bindFramebuffer(false); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, var4.getScaledWidth_double(), var4.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -200.0F); + + if (!OpenGlHelper.isFramebufferEnabled()) { + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + } + + Tessellator var8 = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + float var9 = 32.0F; + var8.startDrawingQuads(); + var8.setColorOpaque_I(4210752); + var8.addVertexWithUV(0.0D, var7, 0.0D, 0.0D, (float)var7 / var9); + var8.addVertexWithUV(var6, var7, 0.0D, (float)var6 / var9, (float)var7 / var9); + var8.addVertexWithUV(var6, 0.0D, 0.0D, (float)var6 / var9, 0.0D); + var8.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + var8.draw(); + + if (p_73718_1_ >= 0) { + byte var10 = 100; + byte var11 = 2; + int var12 = var6 / 2 - var10 / 2; + int var13 = var7 / 2 + 16; + GL11.glDisable(GL11.GL_TEXTURE_2D); + var8.startDrawingQuads(); + var8.setColorOpaque_I(8421504); + var8.addVertex(var12, var13, 0.0D); + var8.addVertex(var12, var13 + var11, 0.0D); + var8.addVertex(var12 + var10, var13 + var11, 0.0D); + var8.addVertex(var12 + var10, var13, 0.0D); + var8.setColorOpaque_I(8454016); + var8.addVertex(var12, var13, 0.0D); + var8.addVertex(var12, var13 + var11, 0.0D); + var8.addVertex(var12 + p_73718_1_, var13 + var11, 0.0D); + var8.addVertex(var12 + p_73718_1_, var13, 0.0D); + var8.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (var6 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, var7 / 2 - 4 - 16, 16777215); + this.mc.fontRenderer.drawStringWithShadow(this.field_73727_a, (var6 - this.mc.fontRenderer.getStringWidth(this.field_73727_a)) / 2, var7 / 2 - 4 + 8, 16777215); + this.field_146588_g.unbindFramebuffer(); + + if (OpenGlHelper.isFramebufferEnabled()) { + this.field_146588_g.framebufferRender(var6 * var5, var7 * var5); + } + + this.mc.func_147120_f(); + + try { + Thread.yield(); + } catch (Exception var14) { + } + } + } + } + + public void func_146586_a() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/Minecraft.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/Minecraft.java new file mode 100644 index 0000000..dfd3ada --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/Minecraft.java @@ -0,0 +1,2578 @@ +package net.minecraft.client; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.*; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleAutoText; +import com.cheatbreaker.client.ui.AbstractGui; +import com.cheatbreaker.client.ui.mainmenu.LoadingScreen; +import com.cheatbreaker.client.ui.mainmenu.MainMenuBase; +import com.cheatbreaker.client.ui.mainmenu.menus.MainMenu; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import com.google.common.collect.Queues; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListenableFutureTask; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.audio.MusicTicker; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.gui.*; +import net.minecraft.client.gui.achievement.GuiAchievement; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.*; +import net.minecraft.client.resources.data.*; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.shader.FrameBuffer; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Bootstrap; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.profiler.IPlayerUsage; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.Timer; +import net.minecraft.util.Util; +import net.minecraft.util.*; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldProviderEnd; +import net.minecraft.world.WorldProviderHell; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.storage.AnvilSaveConverter; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.*; +import org.lwjgl.util.glu.GLU; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.Proxy; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.Queue; +import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; + +public class Minecraft implements IPlayerUsage { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); + public static final boolean isRunningOnMac = Util.getOSType() == Util.EnumOS.OSX; + public static byte[] memoryReserve = new byte[10485760]; + private static final List macDisplayModes = Lists.newArrayList(new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)); + private final File fileResourcepacks; + private final Multimap field_152356_J; + public ServerData currentServerData; //CheatBreaker + public ServerData playerServerData; //CheatBreaker + public TextureManager renderEngine; + private static Minecraft theMinecraft; + public PlayerControllerMP playerController; + private boolean fullscreen; + private boolean hasCrashed; + private CrashReport crashReporter; + public int displayWidth; + public int displayHeight; + public Timer timer = new Timer(20.0F); + private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getSystemTimeMillis()); + public WorldClient theWorld; + public RenderGlobal renderGlobal; + public EntityClientPlayerMP thePlayer; + public EntityLivingBase renderViewEntity; + public Entity pointedEntity; + public EffectRenderer effectRenderer; + private Session session; + private boolean isGamePaused; + public FontRenderer fontRenderer; + public FontRenderer standardGalacticFontRenderer; + public GuiScreen currentScreen; + public LoadingScreenRenderer loadingScreen; + public EntityRenderer entityRenderer; + private int leftClickCounter; + private final int tempDisplayWidth; + private final int tempDisplayHeight; + private IntegratedServer theIntegratedServer; + public GuiAchievement guiAchievement; + public GuiIngame ingameGUI; + public boolean skipRenderWorld; + public MovingObjectPosition objectMouseOver; + public GameSettings gameSettings; + public MouseHelper mouseHelper; + public final File mcDataDir; + private final File fileAssets; + private final String launchedVersion; + private final Proxy proxy; + private ISaveFormat saveLoader; + public static int debugFPS; + private int rightClickDelayTimer; + private boolean refreshTexturePacksScheduled; + private String serverName; + private int serverPort; + public boolean inGameHasFocus; + long systemTime = getSystemTime(); + private int joinPlayerCounter; + public final FrameTimer frameTimer = new FrameTimer(); + long startNanoTime = System.nanoTime(); + private final boolean jvm64bit; + private final boolean isDemo; + private NetworkManager myNetworkManager; + private boolean integratedServerIsRunning; + public final Profiler mcProfiler = new Profiler(); + private long field_83002_am = -1L; + private IReloadableResourceManager mcResourceManager; + private final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer(); + private final List defaultResourcePacks = Lists.newArrayList(); + private final DefaultResourcePack mcDefaultResourcePack; + private ResourcePackRepository mcResourcePackRepository; + private LanguageManager mcLanguageManager; + private FrameBuffer mcFrameBuffer; + private TextureMap textureMapBlocks; + private SoundHandler mcSoundHandler; + private MusicTicker mcMusicTicker; + private ResourceLocation field_152354_ay; + private final MinecraftSessionService field_152355_az; + private SkinManager field_152350_aA; + private final Queue field_152351_aB = Queues.newArrayDeque(); + private final Thread field_152352_aC = Thread.currentThread(); + volatile boolean running = true; + public String debug = ""; + + long debugUpdateTime = getSystemTime(); + int fpsCounter; + long prevFrameTime = -1L; + + private String debugProfilerName = "root"; + + public LoadingScreen cbLoadingScreen; // CB + public boolean hideNametags = false; + public boolean forceCrash; + public GuiScreen lastScreen = null; + private boolean currentlyBorderless; + + + public Minecraft(Session p_i1103_1_, int p_i1103_2_, int p_i1103_3_, boolean p_i1103_4_, boolean p_i1103_5_, File p_i1103_6_, File p_i1103_7_, File p_i1103_8_, Proxy p_i1103_9_, String p_i1103_10_, Multimap p_i1103_11_, String p_i1103_12_) { + theMinecraft = this; + this.mcDataDir = p_i1103_6_; + this.fileAssets = p_i1103_7_; + this.fileResourcepacks = p_i1103_8_; + this.launchedVersion = p_i1103_10_; + this.field_152356_J = p_i1103_11_; + this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(p_i1103_7_, p_i1103_12_)).func_152782_a()); + this.addDefaultResourcePack(); + this.proxy = p_i1103_9_ == null ? Proxy.NO_PROXY : p_i1103_9_; + this.field_152355_az = (new YggdrasilAuthenticationService(p_i1103_9_, UUID.randomUUID().toString())).createMinecraftSessionService(); + this.startTimerHackThread(); + this.session = p_i1103_1_; + logger.info("Setting user: " + p_i1103_1_.getUsername()); + logger.info("Setting UUID: " + p_i1103_1_.getPlayerID()); + this.isDemo = p_i1103_5_; + this.displayWidth = p_i1103_2_; + this.displayHeight = p_i1103_3_; + this.tempDisplayWidth = p_i1103_2_; + this.tempDisplayHeight = p_i1103_3_; + this.fullscreen = p_i1103_4_; + this.jvm64bit = isJvm64bit(); + ImageIO.setUseCache(false); + Bootstrap.func_151354_b(); + } + + private static boolean isJvm64bit() { + String[] var0 = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; + String[] var1 = var0; + int var2 = var0.length; + + for (int var3 = 0; var3 < var2; ++var3) { + String var4 = var1[var3]; + String var5 = System.getProperty(var4); + + if (var5 != null && var5.contains("64")) { + return true; + } + } + + return false; + } + + public FrameBuffer getFramebuffer() { + return this.mcFrameBuffer; + } + + private void startTimerHackThread() { + Thread var1 = new Thread("Timer hack thread") { + + public void run() { + while (Minecraft.this.running) { + try { + Thread.sleep(2147483647L); + } catch (InterruptedException var2) { + } + } + } + }; + var1.setDaemon(true); + var1.start(); + } + + public void crashed(CrashReport p_71404_1_) { + this.hasCrashed = true; + this.crashReporter = p_71404_1_; + } + + /** + * Wrapper around displayCrashReportInternal + */ + public void displayCrashReport(CrashReport p_71377_1_) { + File var2 = new File(getMinecraft().mcDataDir, "crash-reports"); + File var3 = new File(var2, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-com.cheatbreaker.client.txt"); + System.out.println(p_71377_1_.getCompleteReport()); + + if (p_71377_1_.getFile() != null) { + System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.getFile()); + System.exit(-1); + } else if (p_71377_1_.saveToFile(var3)) { + System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + var3.getAbsolutePath()); + System.exit(-1); + } else { + System.out.println("#@?@# Game crashed! Crash report could not be saved. #@?@#"); + System.exit(-2); + } + } + + public void setServer(String p_71367_1_, int p_71367_2_) { + this.serverName = p_71367_1_; + this.serverPort = p_71367_2_; + } + + /** + * Starts the game: initializes the canvas, the title, the settings, etcetera. + */ + private void startGame() throws LWJGLException, IOException { + this.gameSettings = new GameSettings(this, this.mcDataDir); + + if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { + this.displayWidth = this.gameSettings.overrideWidth; + this.displayHeight = this.gameSettings.overrideHeight; + } + + if (this.fullscreen) { + Display.setFullscreen(true); + this.displayWidth = Display.getDisplayMode().getWidth(); + this.displayHeight = Display.getDisplayMode().getHeight(); + + if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + } else { + Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); + } + + Display.setResizable(true); + Display.setTitle("Minecraft 1.7.10"); + logger.info("LWJGL Version: " + Sys.getVersion()); + Util.EnumOS var1 = Util.getOSType(); + + if (var1 != Util.EnumOS.OSX) { + try { + InputStream var2 = this.mcDefaultResourcePack.getInputStream(new ResourceLocation("client/icon-1.png")); + InputStream var3 = this.mcDefaultResourcePack.getInputStream(new ResourceLocation("client/icon-2.png")); + + if (var2 != null && var3 != null) { + Display.setIcon(new ByteBuffer[]{this.func_152340_a(var2), this.func_152340_a(var3)}); + } + } catch (IOException var8) { + logger.error("Couldn't set icon", var8); + } + } + + try { + Display.create((new PixelFormat()).withDepthBits(24)); + } catch (LWJGLException var7) { + logger.error("Couldn't set pixel format", var7); + + try { + Thread.sleep(1000L); + } catch (InterruptedException var6) { + } + + if (this.fullscreen) { + this.updateDisplayMode(); + } + + Display.create(); + } + + OpenGlHelper.initializeTextures(); + + this.mcFrameBuffer = new FrameBuffer(this.displayWidth, this.displayHeight, true); + this.mcFrameBuffer.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F); + this.guiAchievement = new GuiAchievement(this); + this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); + this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); + this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, new File(this.mcDataDir, "server-resource-packs"), this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); + this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); + this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); + this.mcResourceManager.registerReloadListener(this.mcLanguageManager); + this.refreshResources(); + this.renderEngine = new TextureManager(this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.renderEngine); + this.field_152350_aA = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.field_152355_az); + this.cbLoadingScreen = new LoadingScreen(114); // CB + this.cbLoadingScreen.drawMenu(0.0f, 0.0f); // CB + this.cbLoadingScreen.updatePhase("Sound Handler"); // CB + this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings); + this.mcResourceManager.registerReloadListener(this.mcSoundHandler); + this.mcMusicTicker = new MusicTicker(this); + this.cbLoadingScreen.updatePhase("Font Renderers"); // CB + this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); + + if (this.gameSettings.language != null) { + this.fontRenderer.setUnicodeFlag(this.func_152349_b()); + this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); + } + + this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false); + this.mcResourceManager.registerReloadListener(this.fontRenderer); + this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); + this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); + this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); + this.cbLoadingScreen.updatePhase("Items"); // CB + RenderManager.instance.itemRenderer = new ItemRenderer(this); + this.cbLoadingScreen.updatePhase("Entities"); // CB + this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.entityRenderer); + AchievementList.openInventory.setStatStringFormatter(p_74535_1_ -> { + try { + return String.format(p_74535_1_, GameSettings.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode())); + } catch (Exception var3) { + return "Error: " + var3.getLocalizedMessage(); + } + }); + this.mouseHelper = new MouseHelper(); + this.checkGLError("Pre startup"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glClearDepth(1.0D); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glCullFace(GL11.GL_BACK); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.checkGLError("Startup"); + this.cbLoadingScreen.updatePhase("World"); // CB + this.renderGlobal = new RenderGlobal(this); + this.cbLoadingScreen.updatePhase("Blocks"); // CB + this.textureMapBlocks = new TextureMap(0, "textures/blocks"); + this.cbLoadingScreen.updatePhase("Anisotropic Filtering"); // CB + this.textureMapBlocks.func_147632_b(this.gameSettings.anisotropicFiltering); + this.cbLoadingScreen.updatePhase("Mipmaps"); // CB + this.textureMapBlocks.func_147633_a(this.gameSettings.mipmapLevels); + this.cbLoadingScreen.updatePhase("Textures"); // CB + this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, this.textureMapBlocks); + this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items")); + GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); + this.cbLoadingScreen.updatePhase("Effects"); // CB + this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); + this.checkGLError("Post startup"); + this.ingameGUI = new GuiIngame(this); + new CheatBreaker().initialize(); // CB + if (this.serverName != null) { + this.displayGuiScreen(new GuiConnecting(new VanillaMenu(), this, this.serverName, this.serverPort)); + ++MainMenu.menuCounter; + } else { + this.displayGuiScreen(new VanillaMenu()); + } + + this.cbLoadingScreen = null; + this.renderEngine.func_147645_c(this.field_152354_ay); + this.field_152354_ay = null; + this.loadingScreen = new LoadingScreenRenderer(this); + + if (this.gameSettings.fullScreen && !this.fullscreen) { + this.toggleFullscreen(); + } + + try { + Display.setVSyncEnabled(this.gameSettings.enableVsync); + } catch (OpenGLException var4) { + this.gameSettings.enableVsync = false; + this.gameSettings.saveOptions(); + } + } + + public boolean func_152349_b() { + return this.mcLanguageManager.isCurrentLocaleUnicode() || this.gameSettings.forceUnicodeFont; + } + + public void refreshResources() { + ArrayList var1 = Lists.newArrayList(this.defaultResourcePacks); + Iterator var2 = this.mcResourcePackRepository.getRepositoryEntries().iterator(); + + while (var2.hasNext()) { + ResourcePackRepository.Entry var3 = (ResourcePackRepository.Entry) var2.next(); + var1.add(var3.getResourcePack()); + } + + if (this.mcResourcePackRepository.func_148530_e() != null) { + var1.add(this.mcResourcePackRepository.func_148530_e()); + } + + try { + this.mcResourceManager.reloadResources(var1); + } catch (RuntimeException var4) { + logger.info("Caught error stitching, removing all assigned resourcepacks", var4); + var1.clear(); + var1.addAll(this.defaultResourcePacks); + this.mcResourcePackRepository.setRepositories(Collections.emptyList()); + this.mcResourceManager.reloadResources(var1); + this.gameSettings.resourcePacks.clear(); + this.gameSettings.saveOptions(); + } + + this.mcLanguageManager.parseLanguageMetadata(var1); + + if (this.renderGlobal != null) { + this.renderGlobal.loadRenderers(); + } + } + + private void addDefaultResourcePack() { + this.defaultResourcePacks.add(this.mcDefaultResourcePack); + } + + private ByteBuffer func_152340_a(InputStream p_152340_1_) throws IOException { + BufferedImage var2 = ImageIO.read(p_152340_1_); + int[] var3 = var2.getRGB(0, 0, var2.getWidth(), var2.getHeight(), null, 0, var2.getWidth()); + ByteBuffer var4 = ByteBuffer.allocate(4 * var3.length); + int[] var5 = var3; + int var6 = var3.length; + + for (int var7 = 0; var7 < var6; ++var7) { + int var8 = var5[var7]; + var4.putInt(var8 << 8 | var8 >> 24 & 255); + } + + var4.flip(); + return var4; + } + + private void updateDisplayMode() throws LWJGLException { + HashSet var1 = new HashSet(); + Collections.addAll(var1, Display.getAvailableDisplayModes()); + DisplayMode var2 = Display.getDesktopDisplayMode(); + + if (!var1.contains(var2) && Util.getOSType() == Util.EnumOS.OSX) { + Iterator var3 = macDisplayModes.iterator(); + + while (var3.hasNext()) { + DisplayMode var4 = (DisplayMode) var3.next(); + boolean var5 = true; + Iterator var6 = var1.iterator(); + DisplayMode var7; + + while (var6.hasNext()) { + var7 = (DisplayMode) var6.next(); + + if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() && var7.getHeight() == var4.getHeight()) { + var5 = false; + break; + } + } + + if (!var5) { + var6 = var1.iterator(); + + while (var6.hasNext()) { + var7 = (DisplayMode) var6.next(); + + if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() / 2 && var7.getHeight() == var4.getHeight() / 2) { + var2 = var7; + break; + } + } + } + } + } + + Display.setDisplayMode(var2); + this.displayWidth = var2.getWidth(); + this.displayHeight = var2.getHeight(); + } + + /** + * Displays a new screen. + */ + private void loadScreen() throws LWJGLException { + ScaledResolution var1 = new ScaledResolution(this, this.displayWidth, this.displayHeight); + int var2 = var1.getScaleFactor(); + FrameBuffer var3 = new FrameBuffer(var1.getScaledWidth() * var2, var1.getScaledHeight() * var2, true); + var3.bindFramebuffer(false); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, var1.getScaledWidth(), var1.getScaledHeight(), 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + try { + this.field_152354_ay = this.renderEngine.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(this.mcDefaultResourcePack.getInputStream(locationMojangPng)))); + this.renderEngine.bindTexture(this.field_152354_ay); + } catch (IOException var7) { + logger.error("Unable to load logo: " + locationMojangPng, var7); + } + + Tessellator var4 = Tessellator.instance; + var4.startDrawingQuads(); + var4.setColorOpaque_I(16777215); + var4.addVertexWithUV(0.0D, this.displayHeight, 0.0D, 0.0D, 0.0D); + var4.addVertexWithUV(this.displayWidth, this.displayHeight, 0.0D, 0.0D, 0.0D); + var4.addVertexWithUV(this.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D); + var4.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + var4.draw(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + var4.setColorOpaque_I(16777215); + short var5 = 256; + short var6 = 256; + this.scaledTessellator((var1.getScaledWidth() - var5) / 2, (var1.getScaledHeight() - var6) / 2, 0, 0, var5, var6); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + var3.unbindFramebuffer(); + var3.framebufferRender(var1.getScaledWidth() * var2, var1.getScaledHeight() * var2); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glFlush(); + this.func_147120_f(); + } + + /** + * Loads Tessellator with a scaled resolution + */ + public void scaledTessellator(int p_71392_1_, int p_71392_2_, int p_71392_3_, int p_71392_4_, int p_71392_5_, int p_71392_6_) { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(p_71392_1_ + 0, p_71392_2_ + p_71392_6_, 0.0D, (float) (p_71392_3_ + 0) * var7, (float) (p_71392_4_ + p_71392_6_) * var8); + var9.addVertexWithUV(p_71392_1_ + p_71392_5_, p_71392_2_ + p_71392_6_, 0.0D, (float) (p_71392_3_ + p_71392_5_) * var7, (float) (p_71392_4_ + p_71392_6_) * var8); + var9.addVertexWithUV(p_71392_1_ + p_71392_5_, p_71392_2_ + 0, 0.0D, (float) (p_71392_3_ + p_71392_5_) * var7, (float) (p_71392_4_ + 0) * var8); + var9.addVertexWithUV(p_71392_1_ + 0, p_71392_2_ + 0, 0.0D, (float) (p_71392_3_ + 0) * var7, (float) (p_71392_4_ + 0) * var8); + var9.draw(); + } + + /** + * Returns the save loader that is currently being used + */ + public ISaveFormat getSaveLoader() { + return this.saveLoader; + } + + /** + * Sets the argument GuiScreen as the main (topmost visible) screen. + */ + public void displayGuiScreen(GuiScreen p_147108_1_) { + this.lastScreen = this.currentScreen; + if (this.currentScreen != null) { + if (this.entityRenderer.isShaderActive()) { + try { + if (CheatBreaker.getInstance().getGlobalSettings().guiBlur.getBooleanValue()) { + this.entityRenderer.stopUseShader(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + this.currentScreen.onGuiClosed(); + } + + if (p_147108_1_ == null && this.theWorld == null) { + p_147108_1_ = new VanillaMenu(); + } else if (p_147108_1_ == null && this.thePlayer.getHealth() <= 0.0F) { + p_147108_1_ = new GuiGameOver(); + } + + if (p_147108_1_ instanceof VanillaMenu) { + this.gameSettings.showDebugInfo = false; + if (CheatBreaker.getInstance().getModuleManager().chatMod.isEnabled() && (Boolean) CheatBreaker.getInstance().getModuleManager().chatMod.clearChatOnRelog.getValue()) { + this.ingameGUI.getChatGUI().func_146231_a(); + } + } + if (p_147108_1_ instanceof VanillaMenu) { + p_147108_1_ = MainMenuBase.MenuTypes.getMenu(CheatBreaker.getInstance().getGlobalSettings().getCurrentMenu()); + + } + + this.currentScreen = p_147108_1_; + + if (p_147108_1_ != null) { + this.setIngameNotInFocus(); + ScaledResolution var2 = new ScaledResolution(this, this.displayWidth, this.displayHeight); + int var3 = var2.getScaledWidth(); + int var4 = var2.getScaledHeight(); + p_147108_1_.setWorldAndResolution(this, var3, var4); + this.skipRenderWorld = false; + } else { + this.mcSoundHandler.func_147687_e(); + this.setIngameFocus(); + } + } + + /** + * Checks for an OpenGL error. If there is one, prints the error ID and error string. + */ + private void checkGLError(String p_71361_1_) { + int var2 = GL11.glGetError(); + + if (var2 != 0) { + String var3 = GLU.gluErrorString(var2); + logger.error("########## GL ERROR ##########"); + logger.error("@ " + p_71361_1_); + logger.error(var2 + ": " + var3); + } + } + + /** + * Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the + * application (or web page) is exited. + */ + public void shutdownMinecraftApplet() { + try { + this.gameSettings.saveOptions(); + CheatBreaker.getInstance().configManager.write(); + CheatBreaker.getInstance().getWSNetHandler().close(); + logger.info("Stopping!"); + + try { + this.loadWorld(null); + } catch (Throwable ignored) { + } + + try { + GLAllocation.deleteTexturesAndDisplayLists(); + } catch (Throwable ignored) { + } + + this.mcSoundHandler.func_147685_d(); + } finally { + Display.destroy(); + + if (!this.hasCrashed) { + System.exit(0); + } + } + + System.gc(); + } + + public void run() { + this.running = true; + CrashReport var2; + + try { + this.startGame(); + } catch (Throwable var11) { + var2 = CrashReport.makeCrashReport(var11, "Initializing game"); + var2.makeCategory("Initialization"); + this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(var2)); + return; + } + + while (true) { + try { + while (this.running) { + if (!this.hasCrashed || this.crashReporter == null) { + try { + this.runGameLoop(); + } catch (OutOfMemoryError var10) { + this.freeMemory(); + this.displayGuiScreen(new GuiMemoryErrorScreen()); + System.gc(); + } + + continue; + } + + this.displayCrashReport(this.crashReporter); + return; + } + } catch (MinecraftError var12) { + } catch (ReportedException var13) { + this.addGraphicsAndWorldToCrashReport(var13.getCrashReport()); + this.freeMemory(); + logger.fatal("Reported exception thrown!", var13); + this.displayCrashReport(var13.getCrashReport()); + } catch (Throwable var14) { + var2 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", var14)); + this.freeMemory(); + logger.fatal("Unreported exception thrown!", var14); + this.displayCrashReport(var2); + } finally { + this.shutdownMinecraftApplet(); + } + + return; + } + } + + /** + * Called repeatedly from run() + */ + private void runGameLoop() { + this.mcProfiler.startSection("root"); + + if (Display.isCreated() && Display.isCloseRequested()) { + this.shutdown(); + } + + if (this.isGamePaused && this.theWorld != null) { + float var1 = this.timer.renderPartialTicks; + this.timer.updateTimer(); + this.timer.renderPartialTicks = var1; + } else { + this.timer.updateTimer(); + } + + if ((this.theWorld == null || this.currentScreen == null) && this.refreshTexturePacksScheduled) { + this.refreshTexturePacksScheduled = false; + this.refreshResources(); + } + + long var5 = System.nanoTime(); + this.mcProfiler.startSection("tick"); + + for (int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) { + this.runTick(); + } + + this.mcProfiler.endStartSection("preRenderErrors"); + long var6 = System.nanoTime() - var5; + this.checkGLError("Pre render"); + RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; + this.mcProfiler.endStartSection("sound"); + this.mcSoundHandler.func_147691_a(this.thePlayer, this.timer.renderPartialTicks); + this.mcProfiler.endSection(); + this.mcProfiler.startSection("render"); + GL11.glPushMatrix(); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + this.mcFrameBuffer.bindFramebuffer(true); + this.mcProfiler.startSection("display"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { + this.gameSettings.thirdPersonView = 0; + } + + this.mcProfiler.endSection(); + + if (!this.skipRenderWorld) { + this.mcProfiler.endStartSection("gameRenderer"); + this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); + this.mcProfiler.endSection(); + } + + GL11.glFlush(); + this.mcProfiler.endSection(); + + if (!Display.isActive() && this.fullscreen && (Boolean) CheatBreaker.getInstance().getGlobalSettings().unfullscreenWhenUnfocused.getValue()) { + this.toggleFullscreen(); + } + + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { + if (!this.mcProfiler.profilingEnabled) { + this.mcProfiler.clearProfiling(); + } + + this.mcProfiler.profilingEnabled = true; + this.displayDebugInfo(var6); + } else { + this.mcProfiler.profilingEnabled = false; + this.prevFrameTime = System.nanoTime(); + } + + this.guiAchievement.func_146254_a(); + this.mcFrameBuffer.unbindFramebuffer(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + this.mcFrameBuffer.framebufferRender(this.displayWidth, this.displayHeight); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + this.entityRenderer.func_152430_c(this.timer.renderPartialTicks); + GL11.glPopMatrix(); + this.mcProfiler.startSection("root"); + this.func_147120_f(); + Thread.yield(); + this.mcProfiler.startSection("stream"); + this.mcProfiler.startSection("update"); + this.mcProfiler.endStartSection("submit"); + this.mcProfiler.endSection(); + this.mcProfiler.endSection(); + this.checkGLError("Post render"); + ++this.fpsCounter; + this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic(); + long k = System.nanoTime(); + this.frameTimer.addFrame(k - this.startNanoTime); + this.startNanoTime = k; + + while (getSystemTime() >= this.debugUpdateTime + 1000L) { + debugFPS = this.fpsCounter; + this.debug = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; + WorldRenderer.chunksUpdated = 0; + this.debugUpdateTime += 1000L; + this.fpsCounter = 0; + this.usageSnooper.addMemoryStatsToSnooper(); + + if (!this.usageSnooper.isSnooperRunning()) { + this.usageSnooper.startSnooper(); + } + } + + this.mcProfiler.endSection(); + + if (this.isFramerateLimitBelowMax() || (Boolean) CheatBreaker.getInstance().getGlobalSettings().useCustomFPSLimiter.getValue() || (!Display.isActive() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().limitWhenUnfocused.getValue()) || (this.theWorld == null && this.currentScreen != null)) { + Display.sync(this.getLimitFramerate()); + } + } + + public void func_147120_f() { + Display.update(); + + if (!this.fullscreen && Display.wasResized()) { + int var1 = this.displayWidth; + int var2 = this.displayHeight; + this.displayWidth = Display.getWidth(); + this.displayHeight = Display.getHeight(); + + if (this.displayWidth != var1 || this.displayHeight != var2) { + if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + + this.resize(this.displayWidth, this.displayHeight); + } + } + } + + public int getLimitFramerate() { + return (this.theWorld == null && this.currentScreen != null) ? CheatBreaker.getInstance().getGlobalSettings().mainMenuFPS.getIntegerValue() : Display.isActive() || !(Boolean) CheatBreaker.getInstance().getGlobalSettings().limitWhenUnfocused.getValue() ? (Boolean) CheatBreaker.getInstance().getGlobalSettings().useCustomFPSLimiter.getValue() ? (Integer) CheatBreaker.getInstance().getGlobalSettings().customFPSLimit.getValue() : this.gameSettings.limitFramerate : (Integer) CheatBreaker.getInstance().getGlobalSettings().unfocusedFPS.getValue(); + } + + public boolean isFramerateLimitBelowMax() { + return (float) this.getLimitFramerate() < GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + } + + public void freeMemory() { + try { + memoryReserve = new byte[0]; + this.renderGlobal.deleteAllDisplayLists(); + } catch (Throwable var4) { + } + + try { + System.gc(); + } catch (Throwable var3) { + } + + try { + System.gc(); + this.loadWorld(null); + } catch (Throwable var2) { + } + + System.gc(); + } + + /** + * Update debugProfilerName in response to number keys in debug screen + */ + private void updateDebugProfilerName(int p_71383_1_) { + List var2 = this.mcProfiler.getProfilingData(this.debugProfilerName); + + if (var2 != null && !var2.isEmpty()) { + Profiler.Result var3 = (Profiler.Result) var2.remove(0); + + if (p_71383_1_ == 0) { + if (var3.field_76331_c.length() > 0) { + int var4 = this.debugProfilerName.lastIndexOf("."); + + if (var4 >= 0) { + this.debugProfilerName = this.debugProfilerName.substring(0, var4); + } + } + } else { + --p_71383_1_; + + if (p_71383_1_ < var2.size() && !((Profiler.Result) var2.get(p_71383_1_)).field_76331_c.equals("unspecified")) { + if (this.debugProfilerName.length() > 0) { + this.debugProfilerName = this.debugProfilerName + "."; + } + + this.debugProfilerName = this.debugProfilerName + ((Profiler.Result) var2.get(p_71383_1_)).field_76331_c; + } + } + } + } + + private void displayDebugInfo(long p_71366_1_) { + if (this.mcProfiler.profilingEnabled) { + List var3 = this.mcProfiler.getProfilingData(this.debugProfilerName); + Profiler.Result var4 = (Profiler.Result) var3.remove(0); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, this.displayWidth, this.displayHeight, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glLineWidth(1.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator var5 = Tessellator.instance; + short var6 = 160; + int var7 = this.displayWidth - var6 - 10; + int var8 = this.displayHeight - var6 * 2; + GL11.glEnable(GL11.GL_BLEND); + var5.startDrawingQuads(); + var5.setColorRGBA_I(0, 200); + var5.addVertex((float) var7 - (float) var6 * 1.1F, (float) var8 - (float) var6 * 0.6F - 16.0F, 0.0D); + var5.addVertex((float) var7 - (float) var6 * 1.1F, var8 + var6 * 2, 0.0D); + var5.addVertex((float) var7 + (float) var6 * 1.1F, var8 + var6 * 2, 0.0D); + var5.addVertex((float) var7 + (float) var6 * 1.1F, (float) var8 - (float) var6 * 0.6F - 16.0F, 0.0D); + var5.draw(); + GL11.glDisable(GL11.GL_BLEND); + double var9 = 0.0D; + int var13; + + for (int var11 = 0; var11 < var3.size(); ++var11) { + Profiler.Result var12 = (Profiler.Result) var3.get(var11); + var13 = MathHelper.floor_double(var12.field_76332_a / 4.0D) + 1; + var5.startDrawing(6); + var5.setColorOpaque_I(var12.func_76329_a()); + var5.addVertex(var7, var8, 0.0D); + int var14; + float var15; + float var16; + float var17; + + for (var14 = var13; var14 >= 0; --var14) { + var15 = (float) ((var9 + var12.field_76332_a * (double) var14 / (double) var13) * Math.PI * 2.0D / 100.0D); + var16 = MathHelper.sin(var15) * (float) var6; + var17 = MathHelper.cos(var15) * (float) var6 * 0.5F; + var5.addVertex((float) var7 + var16, (float) var8 - var17, 0.0D); + } + + var5.draw(); + var5.startDrawing(5); + var5.setColorOpaque_I((var12.func_76329_a() & 16711422) >> 1); + + for (var14 = var13; var14 >= 0; --var14) { + var15 = (float) ((var9 + var12.field_76332_a * (double) var14 / (double) var13) * Math.PI * 2.0D / 100.0D); + var16 = MathHelper.sin(var15) * (float) var6; + var17 = MathHelper.cos(var15) * (float) var6 * 0.5F; + var5.addVertex((float) var7 + var16, (float) var8 - var17, 0.0D); + var5.addVertex((float) var7 + var16, (float) var8 - var17 + 10.0F, 0.0D); + } + + var5.draw(); + var9 += var12.field_76332_a; + } + + DecimalFormat var18 = new DecimalFormat("##0.00"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + String var19 = ""; + + if (!var4.field_76331_c.equals("unspecified")) { + var19 = var19 + "[0] "; + } + + if (var4.field_76331_c.length() == 0) { + var19 = var19 + "ROOT "; + } else { + var19 = var19 + var4.field_76331_c + " "; + } + + var13 = 16777215; + this.fontRenderer.drawStringWithShadow(var19, var7 - var6, var8 - var6 / 2 - 16, var13); + this.fontRenderer.drawStringWithShadow(var19 = var18.format(var4.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var19), var8 - var6 / 2 - 16, var13); + + for (int var20 = 0; var20 < var3.size(); ++var20) { + Profiler.Result var21 = (Profiler.Result) var3.get(var20); + String var22 = ""; + + if (var21.field_76331_c.equals("unspecified")) { + var22 = var22 + "[?] "; + } else { + var22 = var22 + "[" + (var20 + 1) + "] "; + } + + var22 = var22 + var21.field_76331_c; + this.fontRenderer.drawStringWithShadow(var22, var7 - var6, var8 + var6 / 2 + var20 * 8 + 20, var21.func_76329_a()); + this.fontRenderer.drawStringWithShadow(var22 = var18.format(var21.field_76332_a) + "%", var7 + var6 - 50 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var20 * 8 + 20, var21.func_76329_a()); + this.fontRenderer.drawStringWithShadow(var22 = var18.format(var21.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var20 * 8 + 20, var21.func_76329_a()); + } + } + } + + /** + * Called when the window is closing. Sets 'running' to false which allows the game loop to exit cleanly. + */ + public void shutdown() { + this.running = false; + } + + /** + * Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen + * currently displayed + */ + public void setIngameFocus() { + if (Display.isActive()) { + if (!this.inGameHasFocus) { + this.inGameHasFocus = true; + this.mouseHelper.grabMouseCursor(); + this.displayGuiScreen(null); + this.leftClickCounter = 10000; + } + } + } + + /** + * Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor. + */ + public void setIngameNotInFocus() { + if (this.inGameHasFocus) { + KeyBinding.unPressAllKeys(); + this.inGameHasFocus = false; + this.mouseHelper.ungrabMouseCursor(); + } + } + + /** + * Displays the ingame menu + */ + public void displayInGameMenu() { + if (this.currentScreen == null) { + this.displayGuiScreen(new GuiIngameMenu()); + + if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { + this.mcSoundHandler.func_147689_b(); + } + } + } + + private void func_147115_a(boolean p_147115_1_) { + if (!p_147115_1_) { + this.leftClickCounter = 0; + } + + if (this.leftClickCounter <= 0) { + if (p_147115_1_ && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int var2 = this.objectMouseOver.blockX; + int var3 = this.objectMouseOver.blockY; + int var4 = this.objectMouseOver.blockZ; + + if (this.theWorld.getBlock(var2, var3, var4).getMaterial() != Material.air) { + this.playerController.onPlayerDamageBlock(var2, var3, var4, this.objectMouseOver.sideHit); + + if (this.thePlayer.isCurrentToolAdventureModeExempt(var2, var3, var4)) { + this.effectRenderer.addBlockHitEffects(var2, var3, var4, this.objectMouseOver.sideHit); + this.thePlayer.swingItem(); + } + } + } else { + this.playerController.resetBlockRemoving(); + } + } + } + + private void func_147116_af() { + if (this.leftClickCounter <= 0) { + this.thePlayer.swingItem(); + + if (this.objectMouseOver == null) { + logger.error("Null returned as 'hitResult', this shouldn't happen!"); + + if (this.playerController.isNotCreative()) { + this.leftClickCounter = 10; + } + } else { + switch (Minecraft.SwitchMovingObjectType.field_152390_a[this.objectMouseOver.typeOfHit.ordinal()]) { + case 1: + this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); + break; + + case 2: + int var1 = this.objectMouseOver.blockX; + int var2 = this.objectMouseOver.blockY; + int var3 = this.objectMouseOver.blockZ; + + if (this.theWorld.getBlock(var1, var2, var3).getMaterial() == Material.air) { + if (this.playerController.isNotCreative()) { + this.leftClickCounter = 10; + } + } else { + this.playerController.clickBlock(var1, var2, var3, this.objectMouseOver.sideHit); + } + } + } + } + } + + private void func_147121_ag() { + this.rightClickDelayTimer = 4; + boolean var1 = true; + ItemStack var2 = this.thePlayer.inventory.getCurrentItem(); + + if (this.objectMouseOver == null) { + logger.warn("Null returned as 'hitResult', this shouldn't happen!"); + } else { + switch (Minecraft.SwitchMovingObjectType.field_152390_a[this.objectMouseOver.typeOfHit.ordinal()]) { + case 1: + if (this.playerController.interactWithEntitySendPacket(this.thePlayer, this.objectMouseOver.entityHit)) { + var1 = false; + } + + break; + + case 2: + int var3 = this.objectMouseOver.blockX; + int var4 = this.objectMouseOver.blockY; + int var5 = this.objectMouseOver.blockZ; + + if (this.theWorld.getBlock(var3, var4, var5).getMaterial() != Material.air) { + int var6 = var2 != null ? var2.stackSize : 0; + + if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var2, var3, var4, var5, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) { + var1 = false; + this.thePlayer.swingItem(); + } + + if (var2 == null) { + return; + } + + if (var2.stackSize == 0) { + this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; + } else if (var2.stackSize != var6 || this.playerController.isInCreativeMode()) { + this.entityRenderer.itemRenderer.resetEquippedProgress(); + } + } + } + } + + if (var1) { + ItemStack var7 = this.thePlayer.inventory.getCurrentItem(); + + if (var7 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var7)) { + this.entityRenderer.itemRenderer.resetEquippedProgress2(); + } + } + } + + /** + * Toggles fullscreen mode. + */ + public void toggleFullscreen() { + try { + this.fullscreen = !this.fullscreen; + if (this.fullscreen) { + this.updateDisplayMode(); + this.displayWidth = Display.getDisplayMode().getWidth(); + this.displayHeight = Display.getDisplayMode().getHeight(); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().borderlessFullscreen.getValue()) { + this.currentlyBorderless = true; + System.setProperty("org.lwjgl.opengl.Window.undecorated", "true"); + GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); + Rectangle rectangle = graphicsEnvironment.getDefaultScreenDevice().getDefaultConfiguration().getBounds(); + this.displayWidth = (int) rectangle.getWidth(); + this.displayHeight = (int) rectangle.getHeight(); + Display.setLocation(rectangle.x, rectangle.y); + Display.setResizable(false); + Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); + } else { + this.currentlyBorderless = false; + } + if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + } else { + if (this.currentlyBorderless) { + System.setProperty("org.lwjgl.opengl.Window.undecorated", "false"); + Display.setResizable(true); + Display.setLocation(Display.getWidth() / 4, Display.getHeight() / 4); + } + this.currentlyBorderless = false; + Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); + this.displayWidth = this.tempDisplayWidth; + this.displayHeight = this.tempDisplayHeight; + if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + } + if (this.currentScreen != null) { + this.resize(this.displayWidth, this.displayHeight); + } else { + this.updateFramebufferSize(); + } + Display.setFullscreen(this.fullscreen); + Display.setVSyncEnabled(this.gameSettings.enableVsync); + this.func_147120_f(); + } catch (Exception exception) { + logger.error("Couldn't toggle fullscreen", (Throwable) exception); + } + + } + + /** + * Called to resize the current screen. + */ + private void resize(int p_71370_1_, int p_71370_2_) { + this.displayWidth = p_71370_1_ <= 0 ? 1 : p_71370_1_; + this.displayHeight = p_71370_2_ <= 0 ? 1 : p_71370_2_; + + if (this.currentScreen != null) { + ScaledResolution var3 = new ScaledResolution(this, p_71370_1_, p_71370_2_); + int var4 = var3.getScaledWidth(); + int var5 = var3.getScaledHeight(); + this.currentScreen.setWorldAndResolution(this, var4, var5); + } + + this.loadingScreen = new LoadingScreenRenderer(this); + this.updateFramebufferSize(); + } + + private void updateFramebufferSize() { + this.mcFrameBuffer.createBindFramebuffer(this.displayWidth, this.displayHeight); + + if (this.entityRenderer != null) { + this.entityRenderer.updateShaderGroupSize(this.displayWidth, this.displayHeight); + } + } + + /** + * Runs the current tick. + */ + public void runTick() { + this.mcProfiler.startSection("scheduledExecutables"); + Queue var1 = this.field_152351_aB; + + synchronized (this.field_152351_aB) { + while (!this.field_152351_aB.isEmpty()) { + ((FutureTask) this.field_152351_aB.poll()).run(); + } + } + + if (this.forceCrash) { + Object object; + int n = new Random().nextInt(4); + switch (n) { + case 0: { + object = null; + (object).toString(); + break; + } + case 1: { + break; + } + case 2: { + ArrayList arrayList = new ArrayList(); + arrayList.get(-97); + break; + } + case 3: { + List list = null; + list.get(0); + } + } + } + + this.mcProfiler.endSection(); + + if (this.rightClickDelayTimer > 0) { + --this.rightClickDelayTimer; + } + + this.mcProfiler.startSection("gui"); + + if (!this.isGamePaused) { + this.ingameGUI.updateTick(); + } + + this.mcProfiler.endStartSection("pick"); + this.entityRenderer.getMouseOver(1.0F); + this.mcProfiler.endStartSection("gameMode"); + + if (!this.isGamePaused && this.theWorld != null) { + this.playerController.updateController(); + } + + this.mcProfiler.endStartSection("textures"); + + if (!this.isGamePaused) { + this.renderEngine.tick(); + } + + if (this.currentScreen == null && this.thePlayer != null) { + if (this.thePlayer.getHealth() <= 0.0F) { + this.displayGuiScreen(null); + } else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) { + this.displayGuiScreen(new GuiSleepMP()); + } + } else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) { + this.displayGuiScreen(null); + } + + if (this.currentScreen != null) { + this.leftClickCounter = 10000; + } + + // CB + CheatBreaker.getInstance().getEventBus().handleEvent(new TickEvent()); + + CrashReport var2; + CrashReportCategory var3; + + if (this.currentScreen != null) { + try { + this.currentScreen.handleInput(); + //CB + OverlayGui.getInstance().pollNotifications(); + } catch (Throwable var6) { + var2 = CrashReport.makeCrashReport(var6, "Updating screen events"); + var3 = var2.makeCategory("Affected screen"); + var3.addCrashSectionCallable("Screen name", new Callable() { + + public String call() { + return Minecraft.this.currentScreen.getClass().getCanonicalName(); + } + }); + throw new ReportedException(var2); + } + + if (this.currentScreen != null) { + try { + this.currentScreen.updateScreen(); + } catch (Throwable var5) { + var2 = CrashReport.makeCrashReport(var5, "Ticking screen"); + var3 = var2.makeCategory("Affected screen"); + var3.addCrashSectionCallable("Screen name", new Callable() { + + public String call() { + return Minecraft.this.currentScreen.getClass().getCanonicalName(); + } + }); + throw new ReportedException(var2); + } + } + } + + if (this.currentScreen == null || this.currentScreen.field_146291_p) { + OverlayGui.getInstance().pollNotifications(); + this.mcProfiler.endStartSection("mouse"); + int var9; + ArrayList object = new ArrayList(); + while (Mouse.next()) { + var9 = Mouse.getEventButton(); + KeyBinding.setKeyBindState(var9 - 100, Mouse.getEventButtonState()); + + if (Mouse.getEventButtonState()) { + CheatBreaker.getInstance().getEventBus().handleEvent(new ClickEvent(var9)); + int n2 = var9 - 100; + KeyBinding.onTick(n2); + // Lunar Client code. Not sure if it was for a CPS capper? - Tellinq + /*if (n2 == this.gameSettings.keyBindAttack.getKeyCode()) { + object.add(Mouse.getEventNanoseconds()); + }*/ + } + + // mice button + ModuleAutoText autoHotKeyText = CheatBreaker.getInstance().getModuleManager().autoTextMod; + if (autoHotKeyText.isEnabled()) { + for (Setting setting : autoHotKeyText.hotkeys) { + if (setting.getSettingName() != null && Mouse.getButtonName(setting.getKeyCode()) != null && Mouse.isButtonDown(setting.getKeyCode())) { + if (setting.isHasMouseBind() && setting.getKeyCode() != 0 && var9 == setting.getKeyCode() && autoHotKeyText.messageCount.size() < 5) { + Minecraft.getMinecraft().thePlayer.sendChatMessage(setting.getStringValue()); + autoHotKeyText.messageCount.add(System.currentTimeMillis()); + } else { + autoHotKeyText.messageCount.removeIf(n -> n < System.currentTimeMillis() - 2000L); + } + } + } + } + + + CheatBreaker.getInstance().getEventBus().handleEvent(new ClickStateEvent(var9, Mouse.getEventButtonState())); + long var11 = getSystemTime() - this.systemTime; + + if (var11 <= 200L) { + int var4 = Mouse.getEventDWheel(); + + if (var4 != 0) { + this.thePlayer.inventory.changeCurrentItem(var4); + + if (this.gameSettings.noclip) { + if (var4 > 0) { + var4 = 1; + } + + if (var4 < 0) { + var4 = -1; + } + + this.gameSettings.noclipRate += (float) var4 * 0.25F; + } + } + + if (this.currentScreen == null) { + if (!this.inGameHasFocus && Mouse.getEventButtonState()) { + this.setIngameFocus(); + } + } else if (this.currentScreen != null) { + this.currentScreen.handleMouseInput(); + } + } + } + + if (this.leftClickCounter > 0) { + --this.leftClickCounter; + } + + this.mcProfiler.endStartSection("keyboard"); + this.runTickKeyboard(); + boolean var10; + + while (Keyboard.next()) { + KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState()); + + if (Keyboard.getEventKeyState()) { + KeyBinding.onTick(Keyboard.getEventKey()); + } + + if (this.field_83002_am > 0L) { + if (getSystemTime() - this.field_83002_am >= 6000L) { + throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); + } + + if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) { + this.field_83002_am = -1L; + } + } else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) { + this.field_83002_am = getSystemTime(); + } + + this.func_152348_aa(); + + if (Keyboard.getEventKeyState()) { + + CheatBreaker.getInstance().getEventBus().handleEvent(new KeyboardEvent(Keyboard.getEventKey())); + + if (Keyboard.isKeyDown(42) && Keyboard.getEventKey() == 15) { + this.displayGuiScreen(OverlayGui.createInstance(this.currentScreen)); + } + + ModuleAutoText autoHotKeyText = CheatBreaker.getInstance().getModuleManager().autoTextMod; + if (autoHotKeyText.isEnabled()) { + for (Setting setting : autoHotKeyText.hotkeys) { + if (setting.getSettingName() != null && Keyboard.getKeyName(setting.getKeyCode()) != null && Keyboard.getEventKey() == setting.getKeyCode() && autoHotKeyText.messageCount.size() < 5) { + Minecraft.getMinecraft().thePlayer.sendChatMessage(setting.getStringValue()); + autoHotKeyText.messageCount.add(System.currentTimeMillis()); + } else { + autoHotKeyText.messageCount.removeIf(n -> n < System.currentTimeMillis() - 2000L); + } + } + } + + if (Keyboard.getEventKey() == 62 && this.entityRenderer != null) { + this.entityRenderer.stopUseShader(); + } + + if (this.currentScreen != null) { + this.currentScreen.handleKeyboardInput(); + } else { + if (Keyboard.getEventKey() == 1) { + this.displayInGameMenu(); + } + + if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61)) { + this.refreshResources(); + } + + if (Keyboard.getEventKey() == 20 && Keyboard.isKeyDown(61)) { + this.refreshResources(); + } + + if (Keyboard.getEventKey() == 33 && Keyboard.isKeyDown(61)) { + var10 = Keyboard.isKeyDown(42) | Keyboard.isKeyDown(54); + this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, var10 ? -1 : 1); + } + + if (Keyboard.getEventKey() == 30 && Keyboard.isKeyDown(61)) { + this.renderGlobal.loadRenderers(); + } + + if (Keyboard.getEventKey() == 35 && Keyboard.isKeyDown(61)) { + this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; + this.gameSettings.saveOptions(); + } + + if (Keyboard.getEventKey() == 48 && Keyboard.isKeyDown(61)) { + RenderManager.field_85095_o = !RenderManager.field_85095_o; + } + + if (Keyboard.getEventKey() == 25 && Keyboard.isKeyDown(61)) { + this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; + this.gameSettings.saveOptions(); + } + + if (Keyboard.getEventKey() == 59) { + this.gameSettings.hideGUI = !this.gameSettings.hideGUI; + } + + if (Keyboard.getEventKey() == 61) { + this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; + this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); + } + +// if (this.gameSettings.keyBindTogglePerspective.isPressed()) { +// ++this.gameSettings.thirdPersonView; +// +// if (this.gameSettings.thirdPersonView > 2) { +// this.gameSettings.thirdPersonView = 0; +// } +// } + + if (this.gameSettings.keyBindSmoothCamera.isPressed()) { + this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; + } + } + + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { + if (Keyboard.getEventKey() == 11) { + this.updateDebugProfilerName(0); + } + + for (var9 = 0; var9 < 9; ++var9) { + if (Keyboard.getEventKey() == 2 + var9) { + this.updateDebugProfilerName(var9 + 1); + } + } + } + } + } + + for (var9 = 0; var9 < 9; ++var9) { + if (this.gameSettings.keyBindsHotbar[var9].isPressed()) { + this.thePlayer.inventory.currentItem = var9; + } + } + + var10 = this.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN; + + while (this.gameSettings.keyBindInventory.isPressed()) { + if (this.playerController.func_110738_j()) { + this.thePlayer.func_110322_i(); + } else { + this.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT)); + this.displayGuiScreen(new GuiInventory(this.thePlayer)); + } + } + + while (this.gameSettings.keyBindDrop.isPressed()) { + this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); + } + + while (this.gameSettings.keyBindChat.isPressed() && var10) { + this.displayGuiScreen(new GuiChat()); + } + + if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && var10) { + this.displayGuiScreen(new GuiChat("/")); + } + + if (this.thePlayer.isUsingItem()) { + if (!this.gameSettings.keyBindUseItem.getIsKeyPressed()) { + this.playerController.onStoppedUsingItem(this.thePlayer); + } + + label391: + + while (true) { + if (!this.gameSettings.keyBindAttack.isPressed()) { + while (this.gameSettings.keyBindUseItem.isPressed()) { + } + + while (true) { + if (this.gameSettings.keyBindPickBlock.isPressed()) { + continue; + } + + break label391; + } + } + } + } else { + while (this.gameSettings.keyBindAttack.isPressed()) { + this.func_147116_af(); + } + + while (this.gameSettings.keyBindUseItem.isPressed()) { + this.func_147121_ag(); + } + + while (this.gameSettings.keyBindPickBlock.isPressed()) { + this.func_147112_ai(); + } + } + + if (this.gameSettings.keyBindUseItem.getIsKeyPressed() && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) { + this.func_147121_ag(); + } + + this.func_147115_a(this.currentScreen == null && this.gameSettings.keyBindAttack.getIsKeyPressed() && this.inGameHasFocus); + } + + if (this.theWorld != null) { + if (this.thePlayer != null) { + ++this.joinPlayerCounter; + + if (this.joinPlayerCounter == 30) { + this.joinPlayerCounter = 0; + this.theWorld.joinEntityInSurroundings(this.thePlayer); + } + } + + this.mcProfiler.endStartSection("gameRenderer"); + + if (!this.isGamePaused) { + this.entityRenderer.updateRenderer(); + } + + this.mcProfiler.endStartSection("levelRenderer"); + + if (!this.isGamePaused) { + this.renderGlobal.updateClouds(); + } + + this.mcProfiler.endStartSection("level"); + + if (!this.isGamePaused) { + if (this.theWorld.lastLightningBolt > 0) { + --this.theWorld.lastLightningBolt; + } + + this.theWorld.updateEntities(); + } + } + + if (!this.isGamePaused) { + this.mcMusicTicker.update(); + this.mcSoundHandler.update(); + } + + if (this.theWorld != null) { + if (!this.isGamePaused) { + this.theWorld.setAllowedSpawnTypes(this.theWorld.difficultySetting != EnumDifficulty.PEACEFUL, true); + + try { + this.theWorld.tick(); + } catch (Throwable var7) { + var2 = CrashReport.makeCrashReport(var7, "Exception in world tick"); + + if (this.theWorld == null) { + var3 = var2.makeCategory("Affected level"); + var3.addCrashSection("Problem", "Level is null!"); + } else { + this.theWorld.addWorldInfoToCrashReport(var2); + } + + throw new ReportedException(var2); + } + } + + this.mcProfiler.endStartSection("animateTick"); + + if (!this.isGamePaused && this.theWorld != null) { + this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); + } + + this.mcProfiler.endStartSection("particles"); + + if (!this.isGamePaused) { + this.effectRenderer.updateEffects(); + } + } else if (this.myNetworkManager != null) { + this.mcProfiler.endStartSection("pendingConnection"); + this.myNetworkManager.processReceivedPackets(); + } + + this.mcProfiler.endSection(); + this.systemTime = getSystemTime(); + } + + private void runTickKeyboard() { + while (this.gameSettings.keyBindTogglePerspective.isPressed()) { + ++this.gameSettings.thirdPersonView; + + if (this.gameSettings.thirdPersonView > 2) { + this.gameSettings.thirdPersonView = 0; + } + } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindOpenMenu.isPressed()) { + if (CheatBreaker.getInstance().getGlobalSettings().streamerMode.getBooleanValue() && CheatBreaker.getInstance().getGlobalSettings().disableModMenuKeybind.getBooleanValue()) { + if (CheatBreaker.getInstance().getGlobalSettings().notifyWhenModMenuKeybindPressed.getBooleanValue()) { + String instruction = CheatBreaker.getInstance().getGlobalSettings().holdDownModsGameMenuButton.getBooleanValue() ? "hold " + EnumChatFormatting.GOLD + "Mods" + EnumChatFormatting.RESET + " for " + EnumChatFormatting.AQUA + CheatBreaker.getInstance().getGlobalSettings().holdDuration.getFloatValue() + " seconds" : "click " + EnumChatFormatting.GOLD + "Mods"; + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("info", "Streamer mode is " + EnumChatFormatting.GREEN + "enabled" + EnumChatFormatting.RESET + "! Press escape and " + instruction + EnumChatFormatting.RESET + " to open the Mod Menu.", 5000L); + } + } else { + this.displayGuiScreen(new HudLayoutEditorGui()); + } + } + +// while (CheatBreaker.getInstance().getGlobalSettings().keyBindOpenVoiceMenu.isPressed()) { +// this.displayGuiScreen(new VoiceChatGui()); +// } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindDragToLook.isPressed()) { + CheatBreaker.getInstance().getModuleManager().dragToLook.toggle(); + } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindBackLook.isPressed()) { + CheatBreaker.getInstance().getModuleManager().snapLook.toggle(1); + } + + while (CheatBreaker.getInstance().getGlobalSettings().keyBindFrontLook.isPressed()) { + CheatBreaker.getInstance().getModuleManager().snapLook.toggle(2); + } + } + + /** + * Arguments: World foldername, World ingame name, WorldSettings + */ + public void launchIntegratedServer(String p_71371_1_, String p_71371_2_, WorldSettings p_71371_3_) { + this.loadWorld(null); + System.gc(); + ISaveHandler var4 = this.saveLoader.getSaveLoader(p_71371_1_, false); + WorldInfo var5 = var4.loadWorldInfo(); + + if (var5 == null && p_71371_3_ != null) { + var5 = new WorldInfo(p_71371_3_, p_71371_1_); + var4.saveWorldInfo(var5); + } + + if (p_71371_3_ == null) { + p_71371_3_ = new WorldSettings(var5); + } + + try { + this.theIntegratedServer = new IntegratedServer(this, p_71371_1_, p_71371_2_, p_71371_3_); + this.theIntegratedServer.startServerThread(); + this.integratedServerIsRunning = true; + } catch (Throwable var10) { + CrashReport var7 = CrashReport.makeCrashReport(var10, "Starting integrated server"); + CrashReportCategory var8 = var7.makeCategory("Starting integrated server"); + var8.addCrashSection("Level ID", p_71371_1_); + var8.addCrashSection("Level Name", p_71371_2_); + throw new ReportedException(var7); + } + + this.loadingScreen.displayProgressMessage(I18n.format("menu.loadingLevel")); + + while (!this.theIntegratedServer.serverIsInRunLoop()) { + String var6 = this.theIntegratedServer.getUserMessage(); + + if (var6 != null) { + this.loadingScreen.resetProgresAndWorkingMessage(I18n.format(var6)); + } else { + this.loadingScreen.resetProgresAndWorkingMessage(""); + } + + try { + Thread.sleep(200L); + } catch (InterruptedException var9) { + } + } + + this.displayGuiScreen(null); + SocketAddress var11 = this.theIntegratedServer.func_147137_ag().addLocalEndpoint(); + NetworkManager var12 = NetworkManager.provideLocalClient(var11); + var12.setNetHandler(new NetHandlerLoginClient(var12, this, null)); + var12.scheduleOutboundPacket(new C00Handshake(5, var11.toString(), 0, EnumConnectionState.LOGIN)); + var12.scheduleOutboundPacket(new C00PacketLoginStart(this.getSession().func_148256_e())); + this.myNetworkManager = var12; + } + + /** + * unloads the current world first + */ + public void loadWorld(WorldClient p_71403_1_) { + this.loadWorld(p_71403_1_, ""); + } + + /** + * par2Str is displayed on the loading screen to the user unloads the current world first + */ + public void loadWorld(WorldClient p_71353_1_, String p_71353_2_) { + if (p_71353_1_ == null) { + NetHandlerPlayClient var3 = this.getNetHandler(); + + if (var3 != null) { + var3.cleanup(); + } + + if (this.theIntegratedServer != null) { + this.theIntegratedServer.initiateShutdown(); + } + + this.theIntegratedServer = null; + this.guiAchievement.func_146257_b(); + this.entityRenderer.getMapItemRenderer().func_148249_a(); + } + + this.renderViewEntity = null; + this.myNetworkManager = null; + + if (this.loadingScreen != null) { + this.loadingScreen.resetProgressAndMessage(p_71353_2_); + this.loadingScreen.resetProgresAndWorkingMessage(""); + } + + if (p_71353_1_ == null && this.theWorld != null) { + if (this.mcResourcePackRepository.func_148530_e() != null) { + this.scheduleResourcesRefresh(); + } + + this.mcResourcePackRepository.func_148529_f(); + this.setServerData(null); + this.integratedServerIsRunning = false; + } + + this.mcSoundHandler.func_147690_c(); + this.theWorld = p_71353_1_; + + if (p_71353_1_ != null) { + CheatBreaker.getInstance().getEventBus().handleEvent(new LoadWorldEvent(p_71353_1_)); + CheatBreaker.getInstance().getCbNetHandler().getNametagsMap().clear(); + if (this.renderGlobal != null) { + this.renderGlobal.setWorldAndLoadRenderers(p_71353_1_); + } + + if (this.effectRenderer != null) { + this.effectRenderer.clearEffects(p_71353_1_); + } + + if (this.thePlayer == null) { + this.thePlayer = this.playerController.func_147493_a(p_71353_1_, new StatFileWriter()); + this.playerController.flipPlayer(this.thePlayer); + } + + this.thePlayer.preparePlayerToSpawn(); + p_71353_1_.spawnEntityInWorld(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.playerController.setPlayerCapabilities(this.thePlayer); + this.renderViewEntity = this.thePlayer; + } else { + this.saveLoader.flushCache(); + this.thePlayer = null; + } + + System.gc(); + this.systemTime = 0L; + CheatBreaker.getInstance().getEventBus().handleEvent(new ConnectEvent()); + } + + /** + * A String of renderGlobal.getDebugInfoRenders + */ + public String debugInfoRenders() { + return this.renderGlobal.getDebugInfoRenders(); + } + + /** + * Gets the information in the F3 menu about how many entities are infront/around you + */ + public String getEntityDebug() { + return this.renderGlobal.getDebugInfoEntities(); + } + + /** + * Gets the name of the world's current chunk provider + */ + public String getWorldProviderName() { + return this.theWorld.getProviderName(); + } + + /** + * A String of how many entities are in the world + */ + public String debugInfoEntities() { + return "P: " + this.effectRenderer.getStatistics() + ". T: " + this.theWorld.getDebugLoadedEntities(); + } + + public void setDimensionAndSpawnPlayer(int p_71354_1_) { + this.theWorld.setSpawnLocation(); + this.theWorld.removeAllEntities(); + int var2 = 0; + String var3 = null; + + if (this.thePlayer != null) { + var2 = this.thePlayer.getEntityId(); + this.theWorld.removeEntity(this.thePlayer); + var3 = this.thePlayer.func_142021_k(); + } + + this.renderViewEntity = null; + this.thePlayer = this.playerController.func_147493_a(this.theWorld, this.thePlayer == null ? new StatFileWriter() : this.thePlayer.func_146107_m()); + this.thePlayer.dimension = p_71354_1_; + this.renderViewEntity = this.thePlayer; + this.thePlayer.preparePlayerToSpawn(); + this.thePlayer.func_142020_c(var3); + this.theWorld.spawnEntityInWorld(this.thePlayer); + this.playerController.flipPlayer(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.thePlayer.setEntityId(var2); + this.playerController.setPlayerCapabilities(this.thePlayer); + + if (this.currentScreen instanceof GuiGameOver) { + this.displayGuiScreen(null); + } + } + + /** + * Gets whether this is a demo or not. + */ + public final boolean isDemo() { + return this.isDemo; + } + + public NetHandlerPlayClient getNetHandler() { + return this.thePlayer != null ? this.thePlayer.sendQueue : null; + } + + public static boolean isGuiEnabled() { + return theMinecraft == null || !theMinecraft.gameSettings.hideGUI; + } + + public static boolean isFancyGraphicsEnabled() { + return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; + } + + /** + * Returns if ambient occlusion is enabled + */ + public static boolean isAmbientOcclusionEnabled() { + return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; + } + + private void func_147112_ai() { + if (this.objectMouseOver != null) { + boolean var1 = this.thePlayer.capabilities.isCreativeMode; + int var3 = 0; + boolean var4 = false; + Item var2; + int var5; + + if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + var5 = this.objectMouseOver.blockX; + int var6 = this.objectMouseOver.blockY; + int var7 = this.objectMouseOver.blockZ; + Block var8 = this.theWorld.getBlock(var5, var6, var7); + + if (var8.getMaterial() == Material.air) { + return; + } + + var2 = var8.getItem(this.theWorld, var5, var6, var7); + + if (var2 == null) { + return; + } + + var4 = var2.getHasSubtypes(); + Block var9 = var2 instanceof ItemBlock && !var8.isFlowerPot() ? Block.getBlockFromItem(var2) : var8; + var3 = var9.getDamageValue(this.theWorld, var5, var6, var7); + } else { + if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) { + return; + } + + if (this.objectMouseOver.entityHit instanceof EntityPainting) { + var2 = Items.painting; + } else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) { + var2 = Items.lead; + } else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) { + EntityItemFrame var10 = (EntityItemFrame) this.objectMouseOver.entityHit; + ItemStack var12 = var10.getDisplayedItem(); + + if (var12 == null) { + var2 = Items.item_frame; + } else { + var2 = var12.getItem(); + var3 = var12.getItemDamage(); + var4 = true; + } + } else if (this.objectMouseOver.entityHit instanceof EntityMinecart) { + EntityMinecart var11 = (EntityMinecart) this.objectMouseOver.entityHit; + + if (var11.getMinecartType() == 2) { + var2 = Items.furnace_minecart; + } else if (var11.getMinecartType() == 1) { + var2 = Items.chest_minecart; + } else if (var11.getMinecartType() == 3) { + var2 = Items.tnt_minecart; + } else if (var11.getMinecartType() == 5) { + var2 = Items.hopper_minecart; + } else if (var11.getMinecartType() == 6) { + var2 = Items.command_block_minecart; + } else { + var2 = Items.minecart; + } + } else if (this.objectMouseOver.entityHit instanceof EntityBoat) { + var2 = Items.boat; + } else { + var2 = Items.spawn_egg; + var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); + var4 = true; + + if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) { + return; + } + } + } + + this.thePlayer.inventory.func_146030_a(var2, var3, var4, var1); + + if (var1) { + var5 = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; + this.playerController.sendSlotPacket(this.thePlayer.inventory.getStackInSlot(this.thePlayer.inventory.currentItem), var5); + } + } + } + + /** + * adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report + */ + public CrashReport addGraphicsAndWorldToCrashReport(CrashReport p_71396_1_) { + p_71396_1_.getCategory().addCrashSectionCallable("Launched Version", new Callable() { + + public String call() { + return Minecraft.this.launchedVersion; + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("LWJGL", new Callable() { + + public String call() { + return Sys.getVersion(); + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("OpenGL", new Callable() { + + public String call() { + return GL11.glGetString(GL11.GL_RENDERER) + " GL version " + GL11.glGetString(GL11.GL_VERSION) + ", " + GL11.glGetString(GL11.GL_VENDOR); + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("GL Caps", new Callable() { + + public String call() { + return OpenGlHelper.func_153172_c(); + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("Is Modded", new Callable() { + + public String call() { + String var1 = ClientBrandRetriever.getClientModName(); + return !var1.equals("vanilla") ? "Definitely; Client brand changed to '" + var1 + "'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and com.cheatbreaker.client brand is untouched."); + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("Type", new Callable() { + + public String call() { + return "Client (map_client.txt)"; + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("Resource Packs", new Callable() { + + public String call() { + return Minecraft.this.gameSettings.resourcePacks.toString(); + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("Current Language", new Callable() { + + public String call() { + return Minecraft.this.mcLanguageManager.getCurrentLanguage().toString(); + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("Profiler Position", new Callable() { + + public String call() { + return Minecraft.this.mcProfiler.profilingEnabled ? Minecraft.this.mcProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("Vec3 Pool Size", new Callable() { + + public String call() { + byte var1 = 0; + int var2 = 56 * var1; + int var3 = var2 / 1024 / 1024; + byte var4 = 0; + int var5 = 56 * var4; + int var6 = var5 / 1024 / 1024; + return var1 + " (" + var2 + " bytes; " + var3 + " MB) allocated, " + var4 + " (" + var5 + " bytes; " + var6 + " MB) used"; + } + }); + p_71396_1_.getCategory().addCrashSectionCallable("Anisotropic Filtering", new Callable() { + + public String func_152388_a() { + return Minecraft.this.gameSettings.anisotropicFiltering == 1 ? "Off (1)" : "On (" + Minecraft.this.gameSettings.anisotropicFiltering + ")"; + } + + public Object call() { + return this.func_152388_a(); + } + }); + + if (this.theWorld != null) { + this.theWorld.addWorldInfoToCrashReport(p_71396_1_); + } + + return p_71396_1_; + } + + /** + * Return the singleton Minecraft instance for the game + */ + public static Minecraft getMinecraft() { + return theMinecraft; + } + + public void scheduleResourcesRefresh() { + this.refreshTexturePacksScheduled = true; + } + + public void addServerStatsToSnooper(PlayerUsageSnooper p_70000_1_) { + p_70000_1_.func_152768_a("fps", Integer.valueOf(debugFPS)); + p_70000_1_.func_152768_a("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); + p_70000_1_.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); + p_70000_1_.func_152768_a("display_type", this.fullscreen ? "fullscreen" : "windowed"); + p_70000_1_.func_152768_a("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - p_70000_1_.getMinecraftStartTimeMillis()) / 60L * 1000L)); + p_70000_1_.func_152768_a("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size())); + int var2 = 0; + Iterator var3 = this.mcResourcePackRepository.getRepositoryEntries().iterator(); + + while (var3.hasNext()) { + ResourcePackRepository.Entry var4 = (ResourcePackRepository.Entry) var3.next(); + p_70000_1_.func_152768_a("resource_pack[" + var2++ + "]", var4.getResourcePackName()); + } + + if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) { + p_70000_1_.func_152768_a("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); + } + } + + public void addServerTypeToSnooper(PlayerUsageSnooper p_70001_1_) { + p_70001_1_.func_152767_b("opengl_version", GL11.glGetString(GL11.GL_VERSION)); + p_70001_1_.func_152767_b("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); + p_70001_1_.func_152767_b("client_brand", ClientBrandRetriever.getClientModName()); + p_70001_1_.func_152767_b("launched_version", this.launchedVersion); + ContextCapabilities var2 = GLContext.getCapabilities(); + p_70001_1_.func_152767_b("gl_caps[ARB_arrays_of_arrays]", Boolean.valueOf(var2.GL_ARB_arrays_of_arrays)); + p_70001_1_.func_152767_b("gl_caps[ARB_base_instance]", Boolean.valueOf(var2.GL_ARB_base_instance)); + p_70001_1_.func_152767_b("gl_caps[ARB_blend_func_extended]", Boolean.valueOf(var2.GL_ARB_blend_func_extended)); + p_70001_1_.func_152767_b("gl_caps[ARB_clear_buffer_object]", Boolean.valueOf(var2.GL_ARB_clear_buffer_object)); + p_70001_1_.func_152767_b("gl_caps[ARB_color_buffer_float]", Boolean.valueOf(var2.GL_ARB_color_buffer_float)); + p_70001_1_.func_152767_b("gl_caps[ARB_compatibility]", Boolean.valueOf(var2.GL_ARB_compatibility)); + p_70001_1_.func_152767_b("gl_caps[ARB_compressed_texture_pixel_storage]", Boolean.valueOf(var2.GL_ARB_compressed_texture_pixel_storage)); + p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(var2.GL_ARB_compute_shader)); + p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(var2.GL_ARB_copy_buffer)); + p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(var2.GL_ARB_copy_image)); + p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(var2.GL_ARB_depth_buffer_float)); + p_70001_1_.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(var2.GL_ARB_compute_shader)); + p_70001_1_.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(var2.GL_ARB_copy_buffer)); + p_70001_1_.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(var2.GL_ARB_copy_image)); + p_70001_1_.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(var2.GL_ARB_depth_buffer_float)); + p_70001_1_.func_152767_b("gl_caps[ARB_depth_clamp]", Boolean.valueOf(var2.GL_ARB_depth_clamp)); + p_70001_1_.func_152767_b("gl_caps[ARB_depth_texture]", Boolean.valueOf(var2.GL_ARB_depth_texture)); + p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers]", Boolean.valueOf(var2.GL_ARB_draw_buffers)); + p_70001_1_.func_152767_b("gl_caps[ARB_draw_buffers_blend]", Boolean.valueOf(var2.GL_ARB_draw_buffers_blend)); + p_70001_1_.func_152767_b("gl_caps[ARB_draw_elements_base_vertex]", Boolean.valueOf(var2.GL_ARB_draw_elements_base_vertex)); + p_70001_1_.func_152767_b("gl_caps[ARB_draw_indirect]", Boolean.valueOf(var2.GL_ARB_draw_indirect)); + p_70001_1_.func_152767_b("gl_caps[ARB_draw_instanced]", Boolean.valueOf(var2.GL_ARB_draw_instanced)); + p_70001_1_.func_152767_b("gl_caps[ARB_explicit_attrib_location]", Boolean.valueOf(var2.GL_ARB_explicit_attrib_location)); + p_70001_1_.func_152767_b("gl_caps[ARB_explicit_uniform_location]", Boolean.valueOf(var2.GL_ARB_explicit_uniform_location)); + p_70001_1_.func_152767_b("gl_caps[ARB_fragment_layer_viewport]", Boolean.valueOf(var2.GL_ARB_fragment_layer_viewport)); + p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program]", Boolean.valueOf(var2.GL_ARB_fragment_program)); + p_70001_1_.func_152767_b("gl_caps[ARB_fragment_shader]", Boolean.valueOf(var2.GL_ARB_fragment_shader)); + p_70001_1_.func_152767_b("gl_caps[ARB_fragment_program_shadow]", Boolean.valueOf(var2.GL_ARB_fragment_program_shadow)); + p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(var2.GL_ARB_framebuffer_object)); + p_70001_1_.func_152767_b("gl_caps[ARB_framebuffer_sRGB]", Boolean.valueOf(var2.GL_ARB_framebuffer_sRGB)); + p_70001_1_.func_152767_b("gl_caps[ARB_geometry_shader4]", Boolean.valueOf(var2.GL_ARB_geometry_shader4)); + p_70001_1_.func_152767_b("gl_caps[ARB_gpu_shader5]", Boolean.valueOf(var2.GL_ARB_gpu_shader5)); + p_70001_1_.func_152767_b("gl_caps[ARB_half_float_pixel]", Boolean.valueOf(var2.GL_ARB_half_float_pixel)); + p_70001_1_.func_152767_b("gl_caps[ARB_half_float_vertex]", Boolean.valueOf(var2.GL_ARB_half_float_vertex)); + p_70001_1_.func_152767_b("gl_caps[ARB_instanced_arrays]", Boolean.valueOf(var2.GL_ARB_instanced_arrays)); + p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_alignment]", Boolean.valueOf(var2.GL_ARB_map_buffer_alignment)); + p_70001_1_.func_152767_b("gl_caps[ARB_map_buffer_range]", Boolean.valueOf(var2.GL_ARB_map_buffer_range)); + p_70001_1_.func_152767_b("gl_caps[ARB_multisample]", Boolean.valueOf(var2.GL_ARB_multisample)); + p_70001_1_.func_152767_b("gl_caps[ARB_multitexture]", Boolean.valueOf(var2.GL_ARB_multitexture)); + p_70001_1_.func_152767_b("gl_caps[ARB_occlusion_query2]", Boolean.valueOf(var2.GL_ARB_occlusion_query2)); + p_70001_1_.func_152767_b("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(var2.GL_ARB_pixel_buffer_object)); + p_70001_1_.func_152767_b("gl_caps[ARB_seamless_cube_map]", Boolean.valueOf(var2.GL_ARB_seamless_cube_map)); + p_70001_1_.func_152767_b("gl_caps[ARB_shader_objects]", Boolean.valueOf(var2.GL_ARB_shader_objects)); + p_70001_1_.func_152767_b("gl_caps[ARB_shader_stencil_export]", Boolean.valueOf(var2.GL_ARB_shader_stencil_export)); + p_70001_1_.func_152767_b("gl_caps[ARB_shader_texture_lod]", Boolean.valueOf(var2.GL_ARB_shader_texture_lod)); + p_70001_1_.func_152767_b("gl_caps[ARB_shadow]", Boolean.valueOf(var2.GL_ARB_shadow)); + p_70001_1_.func_152767_b("gl_caps[ARB_shadow_ambient]", Boolean.valueOf(var2.GL_ARB_shadow_ambient)); + p_70001_1_.func_152767_b("gl_caps[ARB_stencil_texturing]", Boolean.valueOf(var2.GL_ARB_stencil_texturing)); + p_70001_1_.func_152767_b("gl_caps[ARB_sync]", Boolean.valueOf(var2.GL_ARB_sync)); + p_70001_1_.func_152767_b("gl_caps[ARB_tessellation_shader]", Boolean.valueOf(var2.GL_ARB_tessellation_shader)); + p_70001_1_.func_152767_b("gl_caps[ARB_texture_border_clamp]", Boolean.valueOf(var2.GL_ARB_texture_border_clamp)); + p_70001_1_.func_152767_b("gl_caps[ARB_texture_buffer_object]", Boolean.valueOf(var2.GL_ARB_texture_buffer_object)); + p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(var2.GL_ARB_texture_cube_map)); + p_70001_1_.func_152767_b("gl_caps[ARB_texture_cube_map_array]", Boolean.valueOf(var2.GL_ARB_texture_cube_map_array)); + p_70001_1_.func_152767_b("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(var2.GL_ARB_texture_non_power_of_two)); + p_70001_1_.func_152767_b("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(var2.GL_ARB_uniform_buffer_object)); + p_70001_1_.func_152767_b("gl_caps[ARB_vertex_blend]", Boolean.valueOf(var2.GL_ARB_vertex_blend)); + p_70001_1_.func_152767_b("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(var2.GL_ARB_vertex_buffer_object)); + p_70001_1_.func_152767_b("gl_caps[ARB_vertex_program]", Boolean.valueOf(var2.GL_ARB_vertex_program)); + p_70001_1_.func_152767_b("gl_caps[ARB_vertex_shader]", Boolean.valueOf(var2.GL_ARB_vertex_shader)); + p_70001_1_.func_152767_b("gl_caps[EXT_bindable_uniform]", Boolean.valueOf(var2.GL_EXT_bindable_uniform)); + p_70001_1_.func_152767_b("gl_caps[EXT_blend_equation_separate]", Boolean.valueOf(var2.GL_EXT_blend_equation_separate)); + p_70001_1_.func_152767_b("gl_caps[EXT_blend_func_separate]", Boolean.valueOf(var2.GL_EXT_blend_func_separate)); + p_70001_1_.func_152767_b("gl_caps[EXT_blend_minmax]", Boolean.valueOf(var2.GL_EXT_blend_minmax)); + p_70001_1_.func_152767_b("gl_caps[EXT_blend_subtract]", Boolean.valueOf(var2.GL_EXT_blend_subtract)); + p_70001_1_.func_152767_b("gl_caps[EXT_draw_instanced]", Boolean.valueOf(var2.GL_EXT_draw_instanced)); + p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_multisample]", Boolean.valueOf(var2.GL_EXT_framebuffer_multisample)); + p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_object]", Boolean.valueOf(var2.GL_EXT_framebuffer_object)); + p_70001_1_.func_152767_b("gl_caps[EXT_framebuffer_sRGB]", Boolean.valueOf(var2.GL_EXT_framebuffer_sRGB)); + p_70001_1_.func_152767_b("gl_caps[EXT_geometry_shader4]", Boolean.valueOf(var2.GL_EXT_geometry_shader4)); + p_70001_1_.func_152767_b("gl_caps[EXT_gpu_program_parameters]", Boolean.valueOf(var2.GL_EXT_gpu_program_parameters)); + p_70001_1_.func_152767_b("gl_caps[EXT_gpu_shader4]", Boolean.valueOf(var2.GL_EXT_gpu_shader4)); + p_70001_1_.func_152767_b("gl_caps[EXT_multi_draw_arrays]", Boolean.valueOf(var2.GL_EXT_multi_draw_arrays)); + p_70001_1_.func_152767_b("gl_caps[EXT_packed_depth_stencil]", Boolean.valueOf(var2.GL_EXT_packed_depth_stencil)); + p_70001_1_.func_152767_b("gl_caps[EXT_paletted_texture]", Boolean.valueOf(var2.GL_EXT_paletted_texture)); + p_70001_1_.func_152767_b("gl_caps[EXT_rescale_normal]", Boolean.valueOf(var2.GL_EXT_rescale_normal)); + p_70001_1_.func_152767_b("gl_caps[EXT_separate_shader_objects]", Boolean.valueOf(var2.GL_EXT_separate_shader_objects)); + p_70001_1_.func_152767_b("gl_caps[EXT_shader_image_load_store]", Boolean.valueOf(var2.GL_EXT_shader_image_load_store)); + p_70001_1_.func_152767_b("gl_caps[EXT_shadow_funcs]", Boolean.valueOf(var2.GL_EXT_shadow_funcs)); + p_70001_1_.func_152767_b("gl_caps[EXT_shared_texture_palette]", Boolean.valueOf(var2.GL_EXT_shared_texture_palette)); + p_70001_1_.func_152767_b("gl_caps[EXT_stencil_clear_tag]", Boolean.valueOf(var2.GL_EXT_stencil_clear_tag)); + p_70001_1_.func_152767_b("gl_caps[EXT_stencil_two_side]", Boolean.valueOf(var2.GL_EXT_stencil_two_side)); + p_70001_1_.func_152767_b("gl_caps[EXT_stencil_wrap]", Boolean.valueOf(var2.GL_EXT_stencil_wrap)); + p_70001_1_.func_152767_b("gl_caps[EXT_texture_3d]", Boolean.valueOf(var2.GL_EXT_texture_3d)); + p_70001_1_.func_152767_b("gl_caps[EXT_texture_array]", Boolean.valueOf(var2.GL_EXT_texture_array)); + p_70001_1_.func_152767_b("gl_caps[EXT_texture_buffer_object]", Boolean.valueOf(var2.GL_EXT_texture_buffer_object)); + p_70001_1_.func_152767_b("gl_caps[EXT_texture_filter_anisotropic]", Boolean.valueOf(var2.GL_EXT_texture_filter_anisotropic)); + p_70001_1_.func_152767_b("gl_caps[EXT_texture_integer]", Boolean.valueOf(var2.GL_EXT_texture_integer)); + p_70001_1_.func_152767_b("gl_caps[EXT_texture_lod_bias]", Boolean.valueOf(var2.GL_EXT_texture_lod_bias)); + p_70001_1_.func_152767_b("gl_caps[EXT_texture_sRGB]", Boolean.valueOf(var2.GL_EXT_texture_sRGB)); + p_70001_1_.func_152767_b("gl_caps[EXT_vertex_shader]", Boolean.valueOf(var2.GL_EXT_vertex_shader)); + p_70001_1_.func_152767_b("gl_caps[EXT_vertex_weighting]", Boolean.valueOf(var2.GL_EXT_vertex_weighting)); + p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); + GL11.glGetError(); + p_70001_1_.func_152767_b("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); + GL11.glGetError(); + p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_attribs]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_ATTRIBS))); + GL11.glGetError(); + p_70001_1_.func_152767_b("gl_caps[gl_max_vertex_texture_image_units]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS))); + GL11.glGetError(); + p_70001_1_.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_TEXTURE_IMAGE_UNITS))); + GL11.glGetError(); + p_70001_1_.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GL11.glGetInteger(35071))); + GL11.glGetError(); + p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); + } + + /** + * Used in the usage snooper. + */ + public static int getGLMaximumTextureSize() { + for (int var0 = 16384; var0 > 0; var0 >>= 1) { + GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer) null); + int var1 = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); + + if (var1 != 0) { + return var0; + } + } + + return -1; + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() { + return this.gameSettings.snooperEnabled; + } + + /** + * Set the current ServerData instance. + */ + public void setServerData(ServerData p_71351_1_) { + this.playerServerData = this.currentServerData; + this.currentServerData = p_71351_1_; + } + + public ServerData getCurrentServerData() { + return this.currentServerData; + } + + public boolean isIntegratedServerRunning() { + return this.integratedServerIsRunning; + } + + /** + * Returns true if there is only one player playing, and the current server is the integrated one. + */ + public boolean isSingleplayer() { + return this.integratedServerIsRunning && this.theIntegratedServer != null; + } + + /** + * Returns the currently running integrated server + */ + public IntegratedServer getIntegratedServer() { + return this.theIntegratedServer; + } + + public static void stopIntegratedServer() { + if (theMinecraft != null) { + IntegratedServer var0 = theMinecraft.getIntegratedServer(); + + if (var0 != null) { + var0.stopServer(); + } + } + } + + /** + * Returns the PlayerUsageSnooper instance. + */ + public PlayerUsageSnooper getPlayerUsageSnooper() { + return this.usageSnooper; + } + + /** + * Gets the system time in milliseconds. + */ + public static long getSystemTime() { + return Sys.getTime() * 1000L / Sys.getTimerResolution(); + } + + /** + * Returns whether we're in full screen or not. + */ + public boolean isFullScreen() { + return this.fullscreen; + } + + public Session getSession() { + return this.session; + } + + public Multimap func_152341_N() { + return this.field_152356_J; + } + + public Proxy getProxy() { + return this.proxy; + } + + public TextureManager getTextureManager() { + return this.renderEngine; + } + + public IResourceManager getResourceManager() { + return this.mcResourceManager; + } + + public ResourcePackRepository getResourcePackRepository() { + return this.mcResourcePackRepository; + } + + public LanguageManager getLanguageManager() { + return this.mcLanguageManager; + } + + public TextureMap getTextureMapBlocks() { + return this.textureMapBlocks; + } + + public boolean isJava64bit() { + return this.jvm64bit; + } + + public boolean func_147113_T() { + return this.isGamePaused; + } + + public SoundHandler getSoundHandler() { + return this.mcSoundHandler; + } + + public MusicTicker.MusicType func_147109_W() { + return this.currentScreen instanceof GuiWinGame ? MusicTicker.MusicType.CREDITS : (this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU); + } + + public void func_152348_aa() { + int var1 = Keyboard.getEventKey(); + + if (var1 != 0 && !Keyboard.isRepeatEvent()) { + if (!(this.currentScreen instanceof GuiControls) || ((GuiControls) this.currentScreen).field_152177_g <= getSystemTime() - 20L) { + if (Keyboard.getEventKeyState()) { + if (var1 == this.gameSettings.field_152395_am.getKeyCode()) { + this.toggleFullscreen(); + } else if (var1 == this.gameSettings.keyBindScreenshot.getKeyCode()) { +// this.ingameGUI.getChatGUI().func_146227_a(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.mcFrameBuffer)); + ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.mcFrameBuffer); + } + } + } + } + } + + public ListenableFuture func_152343_a(Callable p_152343_1_) { + Validate.notNull(p_152343_1_); + + if (!this.func_152345_ab()) { + ListenableFutureTask var2 = ListenableFutureTask.create(p_152343_1_); + Queue var3 = this.field_152351_aB; + + synchronized (this.field_152351_aB) { + this.field_152351_aB.add(var2); + return var2; + } + } else { + try { + return Futures.immediateFuture(p_152343_1_.call()); + } catch (Exception var6) { + return Futures.immediateFailedCheckedFuture(var6); + } + } + } + + public ListenableFuture func_152344_a(Runnable p_152344_1_) { + Validate.notNull(p_152344_1_); + return this.func_152343_a(Executors.callable(p_152344_1_)); + } + + public boolean func_152345_ab() { + return Thread.currentThread() == this.field_152352_aC; + } + + public MinecraftSessionService func_152347_ac() { + return this.field_152355_az; + } + + public SkinManager func_152342_ad() { + return this.field_152350_aA; + } + + public FrameTimer getFrameTimer() { + return this.frameTimer; + } + + public void setSession(Session session) { + this.session = session; + } + + static final class SwitchMovingObjectType { + static final int[] field_152390_a = new int[MovingObjectPosition.MovingObjectType.values().length]; + + + static { + try { + field_152390_a[MovingObjectPosition.MovingObjectType.ENTITY.ordinal()] = 1; + } catch (NoSuchFieldError var2) { + } + + try { + field_152390_a[MovingObjectPosition.MovingObjectType.BLOCK.ordinal()] = 2; + } catch (NoSuchFieldError var1) { + } + } + } + + public DefaultResourcePack getDefaultResourcePack() { + return this.mcDefaultResourcePack; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ISound.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ISound.java new file mode 100644 index 0000000..9497c26 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ISound.java @@ -0,0 +1,40 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public interface ISound { + ResourceLocation func_147650_b(); + + boolean func_147657_c(); + + int func_147652_d(); + + float func_147653_e(); + + float func_147655_f(); + + float func_147649_g(); + + float func_147654_h(); + + float func_147651_i(); + + ISound.AttenuationType func_147656_j(); + + enum AttenuationType { + NONE("NONE", 0, 0), + LINEAR("LINEAR", 1, 2); + private final int field_148589_c; + + private static final ISound.AttenuationType[] $VALUES = new ISound.AttenuationType[]{NONE, LINEAR}; + + + AttenuationType(String p_i45110_1_, int p_i45110_2_, int p_i45110_3_) { + this.field_148589_c = p_i45110_3_; + } + + public int func_148586_a() { + return this.field_148589_c; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java new file mode 100644 index 0000000..5176cf1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ISoundEventAccessor.java @@ -0,0 +1,7 @@ +package net.minecraft.client.audio; + +public interface ISoundEventAccessor { + int func_148721_a(); + + Object func_148720_g(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ITickableSound.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ITickableSound.java new file mode 100644 index 0000000..677b5f2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/ITickableSound.java @@ -0,0 +1,7 @@ +package net.minecraft.client.audio; + +import net.minecraft.server.gui.IUpdatePlayerListBox; + +public interface ITickableSound extends ISound, IUpdatePlayerListBox { + boolean func_147667_k(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSound.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSound.java new file mode 100644 index 0000000..0a29b17 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSound.java @@ -0,0 +1,16 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public abstract class MovingSound extends PositionedSound implements ITickableSound { + protected boolean field_147668_j = false; + + + protected MovingSound(ResourceLocation p_i45104_1_) { + super(p_i45104_1_); + } + + public boolean func_147667_k() { + return this.field_147668_j; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java new file mode 100644 index 0000000..db95403 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSoundMinecart.java @@ -0,0 +1,40 @@ +package net.minecraft.client.audio; + +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class MovingSoundMinecart extends MovingSound { + private final EntityMinecart field_147670_k; + private float field_147669_l = 0.0F; + + + public MovingSoundMinecart(EntityMinecart p_i45105_1_) { + super(new ResourceLocation("minecraft:minecart.base")); + this.field_147670_k = p_i45105_1_; + this.field_147659_g = true; + this.field_147665_h = 0; + } + + /** + * Updates the JList with a new model. + */ + public void update() { + if (this.field_147670_k.isDead) { + this.field_147668_j = true; + } else { + this.field_147660_d = (float)this.field_147670_k.posX; + this.field_147661_e = (float)this.field_147670_k.posY; + this.field_147658_f = (float)this.field_147670_k.posZ; + float var1 = MathHelper.sqrt_double(this.field_147670_k.motionX * this.field_147670_k.motionX + this.field_147670_k.motionZ * this.field_147670_k.motionZ); + + if ((double)var1 >= 0.01D) { + this.field_147669_l = MathHelper.clamp_float(this.field_147669_l + 0.0025F, 0.0F, 1.0F); + this.field_147662_b = 0.0F + MathHelper.clamp_float(var1, 0.0F, 0.5F) * 0.7F; + } else { + this.field_147669_l = 0.0F; + this.field_147662_b = 0.0F; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java new file mode 100644 index 0000000..a3e1245 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java @@ -0,0 +1,38 @@ +package net.minecraft.client.audio; + +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class MovingSoundMinecartRiding extends MovingSound { + private final EntityPlayer field_147672_k; + private final EntityMinecart field_147671_l; + + + public MovingSoundMinecartRiding(EntityPlayer p_i45106_1_, EntityMinecart p_i45106_2_) { + super(new ResourceLocation("minecraft:minecart.inside")); + this.field_147672_k = p_i45106_1_; + this.field_147671_l = p_i45106_2_; + this.field_147666_i = ISound.AttenuationType.NONE; + this.field_147659_g = true; + this.field_147665_h = 0; + } + + /** + * Updates the JList with a new model. + */ + public void update() { + if (!this.field_147671_l.isDead && this.field_147672_k.isRiding() && this.field_147672_k.ridingEntity == this.field_147671_l) { + float var1 = MathHelper.sqrt_double(this.field_147671_l.motionX * this.field_147671_l.motionX + this.field_147671_l.motionZ * this.field_147671_l.motionZ); + + if ((double)var1 >= 0.01D) { + this.field_147662_b = 0.0F + MathHelper.clamp_float(var1, 0.0F, 1.0F) * 0.75F; + } else { + this.field_147662_b = 0.0F; + } + } else { + this.field_147668_j = true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MusicTicker.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MusicTicker.java new file mode 100644 index 0000000..610a502 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/MusicTicker.java @@ -0,0 +1,78 @@ +package net.minecraft.client.audio; + +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.server.gui.IUpdatePlayerListBox; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +public class MusicTicker implements IUpdatePlayerListBox { + private final Random field_147679_a = new Random(); + private final Minecraft field_147677_b; + private ISound field_147678_c; + private int field_147676_d = 100; + + + public MusicTicker(Minecraft p_i45112_1_) { + this.field_147677_b = p_i45112_1_; + } + + /** + * Updates the JList with a new model. + */ + public void update() { + MusicTicker.MusicType var1 = this.field_147677_b.func_147109_W(); + + if (this.field_147678_c != null) { + if (!var1.func_148635_a().equals(this.field_147678_c.func_147650_b())) { + this.field_147677_b.getSoundHandler().func_147683_b(this.field_147678_c); + this.field_147676_d = MathHelper.getRandomIntegerInRange(this.field_147679_a, 0, var1.func_148634_b() / 2); + } + + if (!this.field_147677_b.getSoundHandler().func_147692_c(this.field_147678_c)) { + this.field_147678_c = null; + this.field_147676_d = Math.min(MathHelper.getRandomIntegerInRange(this.field_147679_a, var1.func_148634_b(), var1.func_148633_c()), this.field_147676_d); + } + } + + if (this.field_147678_c == null && this.field_147676_d-- <= 0) { + this.field_147678_c = PositionedSoundRecord.func_147673_a(var1.func_148635_a()); + this.field_147677_b.getSoundHandler().playSound(this.field_147678_c); + this.field_147676_d = Integer.MAX_VALUE; + } + } + + public enum MusicType { + MENU("MENU", 0, new ResourceLocation("minecraft:music.menu"), 20, 600), + GAME("GAME", 1, new ResourceLocation("minecraft:music.game"), 12000, 24000), + CREATIVE("CREATIVE", 2, new ResourceLocation("minecraft:music.game.creative"), 1200, 3600), + CREDITS("CREDITS", 3, new ResourceLocation("minecraft:music.game.end.credits"), Integer.MAX_VALUE, Integer.MAX_VALUE), + NETHER("NETHER", 4, new ResourceLocation("minecraft:music.game.nether"), 1200, 3600), + END_BOSS("END_BOSS", 5, new ResourceLocation("minecraft:music.game.end.dragon"), 0, 0), + END("END", 6, new ResourceLocation("minecraft:music.game.end"), 6000, 24000); + private final ResourceLocation field_148645_h; + private final int field_148646_i; + private final int field_148643_j; + + private static final MusicTicker.MusicType[] $VALUES = new MusicTicker.MusicType[]{MENU, GAME, CREATIVE, CREDITS, NETHER, END_BOSS, END}; + + + MusicType(String p_i45111_1_, int p_i45111_2_, ResourceLocation p_i45111_3_, int p_i45111_4_, int p_i45111_5_) { + this.field_148645_h = p_i45111_3_; + this.field_148646_i = p_i45111_4_; + this.field_148643_j = p_i45111_5_; + } + + public ResourceLocation func_148635_a() { + return this.field_148645_h; + } + + public int func_148634_b() { + return this.field_148646_i; + } + + public int func_148633_c() { + return this.field_148643_j; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/PositionedSound.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/PositionedSound.java new file mode 100644 index 0000000..f150806 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/PositionedSound.java @@ -0,0 +1,57 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public abstract class PositionedSound implements ISound { + protected final ResourceLocation field_147664_a; + protected float field_147662_b = 1.0F; + protected float field_147663_c = 1.0F; + protected float field_147660_d; + protected float field_147661_e; + protected float field_147658_f; + protected boolean field_147659_g = false; + protected int field_147665_h = 0; + protected ISound.AttenuationType field_147666_i; + + + protected PositionedSound(ResourceLocation p_i45103_1_) { + this.field_147666_i = ISound.AttenuationType.LINEAR; + this.field_147664_a = p_i45103_1_; + } + + public ResourceLocation func_147650_b() { + return this.field_147664_a; + } + + public boolean func_147657_c() { + return this.field_147659_g; + } + + public int func_147652_d() { + return this.field_147665_h; + } + + public float func_147653_e() { + return this.field_147662_b; + } + + public float func_147655_f() { + return this.field_147663_c; + } + + public float func_147649_g() { + return this.field_147660_d; + } + + public float func_147654_h() { + return this.field_147661_e; + } + + public float func_147651_i() { + return this.field_147658_f; + } + + public ISound.AttenuationType func_147656_j() { + return this.field_147666_i; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java new file mode 100644 index 0000000..b4870cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/PositionedSoundRecord.java @@ -0,0 +1,35 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public class PositionedSoundRecord extends PositionedSound { + + + public static PositionedSoundRecord func_147674_a(ResourceLocation p_147674_0_, float p_147674_1_) { + return new PositionedSoundRecord(p_147674_0_, 0.25F, p_147674_1_, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F, 0.0F); + } + + public static PositionedSoundRecord func_147673_a(ResourceLocation p_147673_0_) { + return new PositionedSoundRecord(p_147673_0_, 1.0F, 1.0F, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F, 0.0F); + } + + public static PositionedSoundRecord func_147675_a(ResourceLocation p_147675_0_, float p_147675_1_, float p_147675_2_, float p_147675_3_) { + return new PositionedSoundRecord(p_147675_0_, 4.0F, 1.0F, false, 0, ISound.AttenuationType.LINEAR, p_147675_1_, p_147675_2_, p_147675_3_); + } + + public PositionedSoundRecord(ResourceLocation p_i45107_1_, float p_i45107_2_, float p_i45107_3_, float p_i45107_4_, float p_i45107_5_, float p_i45107_6_) { + this(p_i45107_1_, p_i45107_2_, p_i45107_3_, false, 0, ISound.AttenuationType.LINEAR, p_i45107_4_, p_i45107_5_, p_i45107_6_); + } + + private PositionedSoundRecord(ResourceLocation p_i45108_1_, float p_i45108_2_, float p_i45108_3_, boolean p_i45108_4_, int p_i45108_5_, ISound.AttenuationType p_i45108_6_, float p_i45108_7_, float p_i45108_8_, float p_i45108_9_) { + super(p_i45108_1_); + this.field_147662_b = p_i45108_2_; + this.field_147663_c = p_i45108_3_; + this.field_147660_d = p_i45108_7_; + this.field_147661_e = p_i45108_8_; + this.field_147658_f = p_i45108_9_; + this.field_147659_g = p_i45108_4_; + this.field_147665_h = p_i45108_5_; + this.field_147666_i = p_i45108_6_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundCategory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundCategory.java new file mode 100644 index 0000000..f6762b7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundCategory.java @@ -0,0 +1,43 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Maps; +import lombok.Getter; + +import java.util.Map; + +public enum SoundCategory { + MASTER("master", 0), + MUSIC("music", 1), + RECORDS("record", 2), + WEATHER("weather", 3), + BLOCKS("block", 4), + MOBS("hostile", 5), + ANIMALS("neutral", 6), + PLAYERS("player", 7), + AMBIENT("ambient", 8); + private static final Map field_147168_j = Maps.newHashMap(); + private static final Map field_147169_k = Maps.newHashMap(); + @Getter private final String categoryName; + @Getter private final int categoryId; + + + SoundCategory(String p_i45126_3_, int p_i45126_4_) { + this.categoryName = p_i45126_3_; + this.categoryId = p_i45126_4_; + } + + public static SoundCategory func_147154_a(String p_147154_0_) { + return (SoundCategory)field_147168_j.get(p_147154_0_); + } + + static { + for (SoundCategory var3 : values()) { + if (field_147168_j.containsKey(var3.getCategoryName()) || field_147169_k.containsKey(Integer.valueOf(var3.getCategoryId()))) { + throw new Error("Clash in Sound Category ID & Name pools! Cannot insert " + var3); + } + + field_147168_j.put(var3.getCategoryName(), var3); + field_147169_k.put(Integer.valueOf(var3.getCategoryId()), var3); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java new file mode 100644 index 0000000..937107e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundEventAccessor.java @@ -0,0 +1,20 @@ +package net.minecraft.client.audio; + +public class SoundEventAccessor implements ISoundEventAccessor { + private final SoundPoolEntry field_148739_a; + private final int field_148738_b; + + + SoundEventAccessor(SoundPoolEntry p_i45123_1_, int p_i45123_2_) { + this.field_148739_a = p_i45123_1_; + this.field_148738_b = p_i45123_2_; + } + + public int func_148721_a() { + return this.field_148738_b; + } + + public SoundPoolEntry func_148720_g() { + return new SoundPoolEntry(this.field_148739_a); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java new file mode 100644 index 0000000..c012437 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundEventAccessorComposite.java @@ -0,0 +1,74 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.util.ResourceLocation; + +public class SoundEventAccessorComposite implements ISoundEventAccessor { + private final List field_148736_a = Lists.newArrayList(); + private final Random field_148734_b = new Random(); + private final ResourceLocation field_148735_c; + private final SoundCategory field_148732_d; + private final double field_148733_e; + private final double field_148731_f; + + + public SoundEventAccessorComposite(ResourceLocation p_i45120_1_, double p_i45120_2_, double p_i45120_4_, SoundCategory p_i45120_6_) { + this.field_148735_c = p_i45120_1_; + this.field_148731_f = p_i45120_4_; + this.field_148733_e = p_i45120_2_; + this.field_148732_d = p_i45120_6_; + } + + public int func_148721_a() { + int var1 = 0; + ISoundEventAccessor var3; + + for (Iterator var2 = this.field_148736_a.iterator(); var2.hasNext(); var1 += var3.func_148721_a()) { + var3 = (ISoundEventAccessor)var2.next(); + } + + return var1; + } + + public SoundPoolEntry func_148720_g() { + int var1 = this.func_148721_a(); + + if (!this.field_148736_a.isEmpty() && var1 != 0) { + int var2 = this.field_148734_b.nextInt(var1); + Iterator var3 = this.field_148736_a.iterator(); + ISoundEventAccessor var4; + + do { + if (!var3.hasNext()) { + return SoundHandler.field_147700_a; + } + + var4 = (ISoundEventAccessor)var3.next(); + var2 -= var4.func_148721_a(); + } + while (var2 >= 0); + + SoundPoolEntry var5 = (SoundPoolEntry)var4.func_148720_g(); + var5.func_148651_a(var5.func_148650_b() * this.field_148733_e); + var5.func_148647_b(var5.func_148649_c() * this.field_148731_f); + return var5; + } else { + return SoundHandler.field_147700_a; + } + } + + public void func_148727_a(ISoundEventAccessor p_148727_1_) { + this.field_148736_a.add(p_148727_1_); + } + + public ResourceLocation func_148729_c() { + return this.field_148735_c; + } + + public SoundCategory func_148728_d() { + return this.field_148732_d; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundHandler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundHandler.java new file mode 100644 index 0000000..9e5165e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundHandler.java @@ -0,0 +1,243 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.gui.IUpdatePlayerListBox; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SoundHandler implements IResourceManagerReloadListener, IUpdatePlayerListBox { + private static final Logger logger = LogManager.getLogger(); + private static final Gson field_147699_c = (new GsonBuilder()).registerTypeAdapter(SoundList.class, new SoundListSerializer()).create(); + private static final ParameterizedType field_147696_d = new ParameterizedType() { + + public Type[] getActualTypeArguments() { + return new Type[] {String.class, SoundList.class}; + } + public Type getRawType() { + return Map.class; + } + public Type getOwnerType() { + return null; + } + }; + public static final SoundPoolEntry field_147700_a = new SoundPoolEntry(new ResourceLocation("meta:missing_sound"), 0.0D, 0.0D, false); + private final SoundRegistry field_147697_e = new SoundRegistry(); + public final SoundManager field_147694_f; + private final IResourceManager field_147695_g; + + + public SoundHandler(IResourceManager p_i45122_1_, GameSettings p_i45122_2_) { + this.field_147695_g = p_i45122_1_; + this.field_147694_f = new SoundManager(this, p_i45122_2_); + } + + public void onResourceManagerReload(IResourceManager p_110549_1_) { + this.field_147694_f.func_148596_a(); + this.field_147697_e.func_148763_c(); + Iterator var2 = p_110549_1_.getResourceDomains().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + + try { + List var4 = p_110549_1_.getAllResources(new ResourceLocation(var3, "sounds.json")); + Iterator var5 = var4.iterator(); + + while (var5.hasNext()) { + IResource var6 = (IResource)var5.next(); + + try { + Map var7 = field_147699_c.fromJson(new InputStreamReader(var6.getInputStream()), field_147696_d); + Iterator var8 = var7.entrySet().iterator(); + + while (var8.hasNext()) { + Entry var9 = (Entry)var8.next(); + this.func_147693_a(new ResourceLocation(var3, (String)var9.getKey()), (SoundList)var9.getValue()); + } + } catch (RuntimeException var10) { + logger.warn("Invalid sounds.json", var10); + } + } + } catch (IOException var11) { + } + } + } + + private void func_147693_a(ResourceLocation p_147693_1_, SoundList p_147693_2_) { + SoundEventAccessorComposite var3; + + if (this.field_147697_e.containsKey(p_147693_1_) && !p_147693_2_.func_148574_b()) { + var3 = (SoundEventAccessorComposite)this.field_147697_e.getObject(p_147693_1_); + } else { + logger.debug("Registered/replaced new sound event location {}", p_147693_1_); + var3 = new SoundEventAccessorComposite(p_147693_1_, 1.0D, 1.0D, p_147693_2_.func_148573_c()); + this.field_147697_e.func_148762_a(var3); + } + + Iterator var4 = p_147693_2_.func_148570_a().iterator(); + + while (var4.hasNext()) { + final SoundList.SoundEntry var5 = (SoundList.SoundEntry)var4.next(); + String var6 = var5.func_148556_a(); + ResourceLocation var7 = new ResourceLocation(var6); + final String var8 = var6.contains(":") ? var7.getResourceDomain() : p_147693_1_.getResourceDomain(); + Object var9; + + switch (SoundHandler.SwitchType.field_148765_a[var5.func_148563_e().ordinal()]) { + case 1: + ResourceLocation var10 = new ResourceLocation(var8, "sounds/" + var7.getResourcePath() + ".ogg"); + + try { + this.field_147695_g.getResource(var10); + } catch (FileNotFoundException var12) { + logger.warn("File {} does not exist, cannot add it to event {}", var10, p_147693_1_); + continue; + } catch (IOException var13) { + logger.warn("Could not load sound file " + var10 + ", cannot add it to event " + p_147693_1_, var13); + continue; + } + + var9 = new SoundEventAccessor(new SoundPoolEntry(var10, var5.func_148560_c(), var5.func_148558_b(), var5.func_148552_f()), var5.func_148555_d()); + break; + + case 2: + var9 = new ISoundEventAccessor() { + final ResourceLocation field_148726_a = new ResourceLocation(var8, var5.func_148556_a()); + + public int func_148721_a() { + SoundEventAccessorComposite var1 = (SoundEventAccessorComposite)SoundHandler.this.field_147697_e.getObject(this.field_148726_a); + return var1 == null ? 0 : var1.func_148721_a(); + } + public SoundPoolEntry func_148720_g() { + SoundEventAccessorComposite var1 = (SoundEventAccessorComposite)SoundHandler.this.field_147697_e.getObject(this.field_148726_a); + return var1 == null ? SoundHandler.field_147700_a : var1.func_148720_g(); + } + }; + + break; + default: + throw new IllegalStateException("IN YOU FACE"); + } + + var3.func_148727_a((ISoundEventAccessor)var9); + } + } + + public SoundEventAccessorComposite func_147680_a(ResourceLocation p_147680_1_) { + return (SoundEventAccessorComposite)this.field_147697_e.getObject(p_147680_1_); + } + + /** + * Play a sound + */ + public void playSound(ISound p_147682_1_) { + this.field_147694_f.func_148611_c(p_147682_1_); + } + + /** + * Plays the sound in n ticks + */ + public void playDelayedSound(ISound p_147681_1_, int p_147681_2_) { + this.field_147694_f.func_148599_a(p_147681_1_, p_147681_2_); + } + + public void func_147691_a(EntityPlayer p_147691_1_, float p_147691_2_) { + this.field_147694_f.func_148615_a(p_147691_1_, p_147691_2_); + } + + public void func_147689_b() { + this.field_147694_f.func_148610_e(); + } + + public void func_147690_c() { + this.field_147694_f.func_148614_c(); + } + + public void func_147685_d() { + this.field_147694_f.func_148613_b(); + } + + /** + * Updates the JList with a new model. + */ + public void update() { + this.field_147694_f.func_148605_d(); + } + + public void func_147687_e() { + this.field_147694_f.func_148604_f(); + } + + public void setSoundLevel(SoundCategory p_147684_1_, float p_147684_2_) { + if (p_147684_1_ == SoundCategory.MASTER && p_147684_2_ <= 0.0F) { + this.func_147690_c(); + } + + this.field_147694_f.func_148601_a(p_147684_1_, p_147684_2_); + } + + public void func_147683_b(ISound p_147683_1_) { + this.field_147694_f.func_148602_b(p_147683_1_); + } + + public SoundEventAccessorComposite func_147686_a(SoundCategory ... p_147686_1_) { + ArrayList var2 = Lists.newArrayList(); + Iterator var3 = this.field_147697_e.getKeys().iterator(); + + while (var3.hasNext()) { + ResourceLocation var4 = (ResourceLocation)var3.next(); + SoundEventAccessorComposite var5 = (SoundEventAccessorComposite)this.field_147697_e.getObject(var4); + + if (ArrayUtils.contains(p_147686_1_, var5.func_148728_d())) { + var2.add(var5); + } + } + + if (var2.isEmpty()) { + return null; + } else { + return (SoundEventAccessorComposite)var2.get((new Random()).nextInt(var2.size())); + } + } + + public boolean func_147692_c(ISound p_147692_1_) { + return this.field_147694_f.func_148597_a(p_147692_1_); + } + + static final class SwitchType { + static final int[] field_148765_a = new int[SoundList.SoundEntry.Type.values().length]; + + + static { + try { + field_148765_a[SoundList.SoundEntry.Type.FILE.ordinal()] = 1; + } catch (NoSuchFieldError var2) { + } + + try { + field_148765_a[SoundList.SoundEntry.Type.SOUND_EVENT.ordinal()] = 2; + } catch (NoSuchFieldError var1) { + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundList.java new file mode 100644 index 0000000..638eef9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundList.java @@ -0,0 +1,122 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import java.util.List; + +public class SoundList { + private final List field_148577_a = Lists.newArrayList(); + private boolean field_148575_b; + private SoundCategory field_148576_c; + + + public List func_148570_a() { + return this.field_148577_a; + } + + public boolean func_148574_b() { + return this.field_148575_b; + } + + public void func_148572_a(boolean p_148572_1_) { + this.field_148575_b = p_148572_1_; + } + + public SoundCategory func_148573_c() { + return this.field_148576_c; + } + + public void func_148571_a(SoundCategory p_148571_1_) { + this.field_148576_c = p_148571_1_; + } + + public static class SoundEntry { + private String field_148569_a; + private float field_148567_b = 1.0F; + private float field_148568_c = 1.0F; + private int field_148565_d = 1; + private SoundList.SoundEntry.Type field_148566_e; + private boolean field_148564_f; + + + public SoundEntry() { + this.field_148566_e = SoundList.SoundEntry.Type.FILE; + this.field_148564_f = false; + } + + public String func_148556_a() { + return this.field_148569_a; + } + + public void func_148561_a(String p_148561_1_) { + this.field_148569_a = p_148561_1_; + } + + public float func_148558_b() { + return this.field_148567_b; + } + + public void func_148553_a(float p_148553_1_) { + this.field_148567_b = p_148553_1_; + } + + public float func_148560_c() { + return this.field_148568_c; + } + + public void func_148559_b(float p_148559_1_) { + this.field_148568_c = p_148559_1_; + } + + public int func_148555_d() { + return this.field_148565_d; + } + + public void func_148554_a(int p_148554_1_) { + this.field_148565_d = p_148554_1_; + } + + public SoundList.SoundEntry.Type func_148563_e() { + return this.field_148566_e; + } + + public void func_148562_a(SoundList.SoundEntry.Type p_148562_1_) { + this.field_148566_e = p_148562_1_; + } + + public boolean func_148552_f() { + return this.field_148564_f; + } + + public void func_148557_a(boolean p_148557_1_) { + this.field_148564_f = p_148557_1_; + } + + public enum Type { + FILE("FILE", 0, "file"), + SOUND_EVENT("SOUND_EVENT", 1, "event"); + private final String field_148583_c; + + private static final SoundList.SoundEntry.Type[] $VALUES = new SoundList.SoundEntry.Type[]{FILE, SOUND_EVENT}; + + + Type(String p_i45109_1_, int p_i45109_2_, String p_i45109_3_) { + this.field_148583_c = p_i45109_3_; + } + + public static SoundList.SoundEntry.Type func_148580_a(String p_148580_0_) { + SoundList.SoundEntry.Type[] var1 = values(); + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + SoundList.SoundEntry.Type var4 = var1[var3]; + + if (var4.field_148583_c.equals(p_148580_0_)) { + return var4; + } + } + + return null; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundListSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundListSerializer.java new file mode 100644 index 0000000..6e3d708 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundListSerializer.java @@ -0,0 +1,73 @@ +package net.minecraft.client.audio; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +public class SoundListSerializer implements JsonDeserializer { + + + public SoundList deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "entry"); + SoundList var5 = new SoundList(); + var5.func_148572_a(JsonUtils.getJsonObjectBooleanFieldValueOrDefault(var4, "replace", false)); + SoundCategory var6 = SoundCategory.func_147154_a(JsonUtils.getJsonObjectStringFieldValueOrDefault(var4, "category", SoundCategory.MASTER.getCategoryName())); + var5.func_148571_a(var6); + Validate.notNull(var6, "Invalid category"); + + if (var4.has("sounds")) { + JsonArray var7 = JsonUtils.getJsonObjectJsonArrayField(var4, "sounds"); + + for (int var8 = 0; var8 < var7.size(); ++var8) { + JsonElement var9 = var7.get(var8); + SoundList.SoundEntry var10 = new SoundList.SoundEntry(); + + if (JsonUtils.jsonElementTypeIsString(var9)) { + var10.func_148561_a(JsonUtils.getJsonElementStringValue(var9, "sound")); + } else { + JsonObject var11 = JsonUtils.getJsonElementAsJsonObject(var9, "sound"); + var10.func_148561_a(JsonUtils.getJsonObjectStringFieldValue(var11, "name")); + + if (var11.has("type")) { + SoundList.SoundEntry.Type var12 = SoundList.SoundEntry.Type.func_148580_a(JsonUtils.getJsonObjectStringFieldValue(var11, "type")); + Validate.notNull(var12, "Invalid type"); + var10.func_148562_a(var12); + } + + float var13; + + if (var11.has("volume")) { + var13 = JsonUtils.getJsonObjectFloatFieldValue(var11, "volume"); + Validate.isTrue(var13 > 0.0F, "Invalid volume"); + var10.func_148553_a(var13); + } + + if (var11.has("pitch")) { + var13 = JsonUtils.getJsonObjectFloatFieldValue(var11, "pitch"); + Validate.isTrue(var13 > 0.0F, "Invalid pitch"); + var10.func_148559_b(var13); + } + + if (var11.has("weight")) { + int var14 = JsonUtils.getJsonObjectIntegerFieldValue(var11, "weight"); + Validate.isTrue(var14 > 0, "Invalid weight"); + var10.func_148554_a(var14); + } + + if (var11.has("stream")) { + var10.func_148557_a(JsonUtils.getJsonObjectBooleanFieldValue(var11, "stream")); + } + } + + var5.func_148570_a().add(var10); + } + } + + return var5; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundManager.java new file mode 100644 index 0000000..7ee9531 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundManager.java @@ -0,0 +1,410 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; +import paulscode.sound.SoundSystem; +import paulscode.sound.SoundSystemConfig; +import paulscode.sound.SoundSystemException; +import paulscode.sound.Source; +import paulscode.sound.codecs.CodecJOrbis; +import paulscode.sound.libraries.LibraryLWJGLOpenAL; + +public class SoundManager { + private static final Marker field_148623_a = MarkerManager.getMarker("SOUNDS"); + private static final Logger logger = LogManager.getLogger(); + private final SoundHandler field_148622_c; + private final GameSettings field_148619_d; + public SoundManager.SoundSystemStarterThread field_148620_e; + private boolean field_148617_f; + private int field_148618_g = 0; + private final Map field_148629_h = HashBiMap.create(); + private final Map field_148630_i; + private final Map field_148627_j; + private final Multimap field_148628_k; + private final List field_148625_l; + private final Map field_148626_m; + private final Map field_148624_n; + + public void playSound(String string, float f) { + if (this.field_148617_f) { + ResourceLocation resourceLocation = new ResourceLocation("client/sound/" + string + ".ogg"); + String string2 = UUID.randomUUID().toString(); + this.field_148620_e.newStreamingSource(false, string2, func_148612_a(resourceLocation), resourceLocation.toString(), false, 0.0f, 0.0f, 0.0f, 0, SoundSystemConfig.getDefaultRolloff()); + this.field_148620_e.setPitch(string2, 1.0f); + this.field_148620_e.setVolume(string2, 1.0f * f); + this.field_148620_e.play(string2); + } + } + + + public SoundManager(SoundHandler p_i45119_1_, GameSettings p_i45119_2_) { + this.field_148630_i = ((BiMap)this.field_148629_h).inverse(); + this.field_148627_j = Maps.newHashMap(); + this.field_148628_k = HashMultimap.create(); + this.field_148625_l = Lists.newArrayList(); + this.field_148626_m = Maps.newHashMap(); + this.field_148624_n = Maps.newHashMap(); + this.field_148622_c = p_i45119_1_; + this.field_148619_d = p_i45119_2_; + + try { + SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); + SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); + } catch (SoundSystemException var4) { + logger.error(field_148623_a, "Error linking with the LibraryJavaSound plug-in", var4); + } + } + + public void func_148596_a() { + this.func_148613_b(); + this.func_148608_i(); + } + + private synchronized void func_148608_i() { + if (!this.field_148617_f) { + try { + (new Thread(new Runnable() { + + public void run() { + SoundManager.this.field_148620_e = SoundManager.this.new SoundSystemStarterThread(null); + SoundManager.this.field_148617_f = true; + SoundManager.this.field_148620_e.setMasterVolume(SoundManager.this.field_148619_d.getSoundLevel(SoundCategory.MASTER)); + SoundManager.logger.info(SoundManager.field_148623_a, "Sound engine started"); + } + }, "Sound Library Loader")).start(); + } catch (RuntimeException var2) { + logger.error(field_148623_a, "Error starting SoundSystem. Turning off sounds & music", var2); + this.field_148619_d.setSoundLevel(SoundCategory.MASTER, 0.0F); + this.field_148619_d.saveOptions(); + } + } + } + + private float func_148595_a(SoundCategory p_148595_1_) { + return p_148595_1_ != null && p_148595_1_ != SoundCategory.MASTER ? this.field_148619_d.getSoundLevel(p_148595_1_) : 1.0F; + } + + public void func_148601_a(SoundCategory p_148601_1_, float p_148601_2_) { + if (this.field_148617_f) { + if (p_148601_1_ == SoundCategory.MASTER) { + this.field_148620_e.setMasterVolume(p_148601_2_); + } else { + Iterator var3 = this.field_148628_k.get(p_148601_1_).iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + ISound var5 = (ISound)this.field_148629_h.get(var4); + float var6 = this.func_148594_a(var5, (SoundPoolEntry)this.field_148627_j.get(var5), p_148601_1_); + + if (var6 <= 0.0F) { + this.func_148602_b(var5); + } else { + this.field_148620_e.setVolume(var4, var6); + } + } + } + } + } + + public void func_148613_b() { + if (this.field_148617_f) { + this.func_148614_c(); + this.field_148620_e.cleanup(); + this.field_148617_f = false; + } + } + + public void func_148614_c() { + if (this.field_148617_f) { + Iterator var1 = this.field_148629_h.keySet().iterator(); + + while (var1.hasNext()) { + String var2 = (String)var1.next(); + this.field_148620_e.stop(var2); + } + + this.field_148629_h.clear(); + this.field_148626_m.clear(); + this.field_148625_l.clear(); + this.field_148628_k.clear(); + this.field_148627_j.clear(); + this.field_148624_n.clear(); + } + } + + public void func_148605_d() { + ++this.field_148618_g; + Iterator var1 = this.field_148625_l.iterator(); + String var3; + + while (var1.hasNext()) { + ITickableSound var2 = (ITickableSound)var1.next(); + var2.update(); + + if (var2.func_147667_k()) { + this.func_148602_b(var2); + } else { + var3 = (String)this.field_148630_i.get(var2); + this.field_148620_e.setVolume(var3, this.func_148594_a(var2, (SoundPoolEntry)this.field_148627_j.get(var2), this.field_148622_c.func_147680_a(var2.func_147650_b()).func_148728_d())); + this.field_148620_e.setPitch(var3, this.func_148606_a(var2, (SoundPoolEntry)this.field_148627_j.get(var2))); + this.field_148620_e.setPosition(var3, var2.func_147649_g(), var2.func_147654_h(), var2.func_147651_i()); + } + } + + var1 = this.field_148629_h.entrySet().iterator(); + ISound var4; + + while (var1.hasNext()) { + Entry var9 = (Entry)var1.next(); + var3 = (String)var9.getKey(); + var4 = (ISound)var9.getValue(); + + if (!this.field_148620_e.playing(var3)) { + int var5 = ((Integer)this.field_148624_n.get(var3)).intValue(); + + if (var5 <= this.field_148618_g) { + int var6 = var4.func_147652_d(); + + if (var4.func_147657_c() && var6 > 0) { + this.field_148626_m.put(var4, Integer.valueOf(this.field_148618_g + var6)); + } + + var1.remove(); + logger.debug(field_148623_a, "Removed channel {} because it's not playing anymore", var3); + this.field_148620_e.removeSource(var3); + this.field_148624_n.remove(var3); + this.field_148627_j.remove(var4); + + try { + this.field_148628_k.remove(this.field_148622_c.func_147680_a(var4.func_147650_b()).func_148728_d(), var3); + } catch (RuntimeException var8) { + } + + if (var4 instanceof ITickableSound) { + this.field_148625_l.remove(var4); + } + } + } + } + + Iterator var10 = this.field_148626_m.entrySet().iterator(); + + while (var10.hasNext()) { + Entry var11 = (Entry)var10.next(); + + if (this.field_148618_g >= ((Integer)var11.getValue()).intValue()) { + var4 = (ISound)var11.getKey(); + + if (var4 instanceof ITickableSound) { + ((ITickableSound)var4).update(); + } + + this.func_148611_c(var4); + var10.remove(); + } + } + } + + public boolean func_148597_a(ISound p_148597_1_) { + if (!this.field_148617_f) { + return false; + } else { + String var2 = (String)this.field_148630_i.get(p_148597_1_); + return var2 != null && (this.field_148620_e.playing(var2) || this.field_148624_n.containsKey(var2) && ((Integer) this.field_148624_n.get(var2)).intValue() <= this.field_148618_g); + } + } + + public void func_148602_b(ISound p_148602_1_) { + if (this.field_148617_f) { + String var2 = (String)this.field_148630_i.get(p_148602_1_); + + if (var2 != null) { + this.field_148620_e.stop(var2); + } + } + } + + public void func_148611_c(ISound p_148611_1_) { + if (this.field_148617_f) { + if (this.field_148620_e.getMasterVolume() <= 0.0F) { + logger.debug(field_148623_a, "Skipped playing soundEvent: {}, master volume was zero", p_148611_1_.func_147650_b()); + } else { + SoundEventAccessorComposite var2 = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b()); + + if (var2 == null) { + logger.warn(field_148623_a, "Unable to play unknown soundEvent: {}", p_148611_1_.func_147650_b()); + } else { + SoundPoolEntry var3 = var2.func_148720_g(); + + if (var3 == SoundHandler.field_147700_a) { + logger.warn(field_148623_a, "Unable to play empty soundEvent: {}", var2.func_148729_c()); + } else { + float var4 = p_148611_1_.func_147653_e(); + float var5 = 16.0F; + + if (var4 > 1.0F) { + var5 *= var4; + } + + SoundCategory var6 = var2.func_148728_d(); + float var7 = this.func_148594_a(p_148611_1_, var3, var6); + double var8 = this.func_148606_a(p_148611_1_, var3); + ResourceLocation var10 = var3.func_148652_a(); + + if (var7 == 0.0F) { + logger.debug(field_148623_a, "Skipped playing sound {}, volume was zero.", var10); + } else { + boolean var11 = p_148611_1_.func_147657_c() && p_148611_1_.func_147652_d() == 0; + String var12 = UUID.randomUUID().toString(); + + if (var3.func_148648_d()) { + this.field_148620_e.newStreamingSource(false, var12, func_148612_a(var10), var10.toString(), var11, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), var5); + } else { + this.field_148620_e.newSource(false, var12, func_148612_a(var10), var10.toString(), var11, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), var5); + } + + logger.debug(field_148623_a, "Playing sound {} for event {} as channel {}", var3.func_148652_a(), var2.func_148729_c(), var12); + this.field_148620_e.setPitch(var12, (float)var8); + this.field_148620_e.setVolume(var12, var7); + this.field_148620_e.play(var12); + this.field_148624_n.put(var12, Integer.valueOf(this.field_148618_g + 20)); + this.field_148629_h.put(var12, p_148611_1_); + this.field_148627_j.put(p_148611_1_, var3); + + if (var6 != SoundCategory.MASTER) { + this.field_148628_k.put(var6, var12); + } + + if (p_148611_1_ instanceof ITickableSound) { + this.field_148625_l.add(p_148611_1_); + } + } + } + } + } + } + } + + private float func_148606_a(ISound p_148606_1_, SoundPoolEntry p_148606_2_) { + return (float)MathHelper.clamp_double((double)p_148606_1_.func_147655_f() * p_148606_2_.func_148650_b(), 0.5D, 2.0D); + } + + private float func_148594_a(ISound p_148594_1_, SoundPoolEntry p_148594_2_, SoundCategory p_148594_3_) { + return (float)MathHelper.clamp_double((double)p_148594_1_.func_147653_e() * p_148594_2_.func_148649_c() * (double)this.func_148595_a(p_148594_3_), 0.0D, 1.0D); + } + + public void func_148610_e() { + Iterator var1 = this.field_148629_h.keySet().iterator(); + + while (var1.hasNext()) { + String var2 = (String)var1.next(); + logger.debug(field_148623_a, "Pausing channel {}", var2); + this.field_148620_e.pause(var2); + } + } + + public void func_148604_f() { + Iterator var1 = this.field_148629_h.keySet().iterator(); + + while (var1.hasNext()) { + String var2 = (String)var1.next(); + logger.debug(field_148623_a, "Resuming channel {}", var2); + this.field_148620_e.play(var2); + } + } + + public void func_148599_a(ISound p_148599_1_, int p_148599_2_) { + this.field_148626_m.put(p_148599_1_, Integer.valueOf(this.field_148618_g + p_148599_2_)); + } + + private static URL func_148612_a(final ResourceLocation p_148612_0_) { + String var1 = String.format("%s:%s:%s", "mcsounddomain", p_148612_0_.getResourceDomain(), p_148612_0_.getResourcePath()); + URLStreamHandler var2 = new URLStreamHandler() { + + protected URLConnection openConnection(final URL p_openConnection_1_) { + return new URLConnection(p_openConnection_1_) { + + public void connect() {} + public InputStream getInputStream() throws IOException { + return Minecraft.getMinecraft().getResourceManager().getResource(p_148612_0_).getInputStream(); + } + }; + } + }; + + try { + return new URL(null, var1, var2); + } catch (MalformedURLException var4) { + throw new Error("TODO: Sanely handle url exception! :D"); + } + } + + public void func_148615_a(EntityPlayer p_148615_1_, float p_148615_2_) { + if (this.field_148617_f && p_148615_1_ != null) { + float var3 = p_148615_1_.prevRotationPitch + (p_148615_1_.rotationPitch - p_148615_1_.prevRotationPitch) * p_148615_2_; + float var4 = p_148615_1_.prevRotationYaw + (p_148615_1_.rotationYaw - p_148615_1_.prevRotationYaw) * p_148615_2_; + double var5 = p_148615_1_.prevPosX + (p_148615_1_.posX - p_148615_1_.prevPosX) * (double)p_148615_2_; + double var7 = p_148615_1_.prevPosY + (p_148615_1_.posY - p_148615_1_.prevPosY) * (double)p_148615_2_; + double var9 = p_148615_1_.prevPosZ + (p_148615_1_.posZ - p_148615_1_.prevPosZ) * (double)p_148615_2_; + float var11 = MathHelper.cos((var4 + 90.0F) * 0.017453292F); + float var12 = MathHelper.sin((var4 + 90.0F) * 0.017453292F); + float var13 = MathHelper.cos(-var3 * 0.017453292F); + float var14 = MathHelper.sin(-var3 * 0.017453292F); + float var15 = MathHelper.cos((-var3 + 90.0F) * 0.017453292F); + float var16 = MathHelper.sin((-var3 + 90.0F) * 0.017453292F); + float var17 = var11 * var13; + float var19 = var12 * var13; + float var20 = var11 * var15; + float var22 = var12 * var15; + this.field_148620_e.setListenerPosition((float)var5, (float)var7, (float)var9); + this.field_148620_e.setListenerOrientation(var17, var14, var19, var20, var16, var22); + } + } + + class SoundSystemStarterThread extends SoundSystem { + + + private SoundSystemStarterThread() {} + + public boolean playing(String p_playing_1_) { + Object var2 = SoundSystemConfig.THREAD_SYNC; + + synchronized (SoundSystemConfig.THREAD_SYNC) { + if (this.soundLibrary == null) { + return false; + } else { + Source var3 = this.soundLibrary.getSources().get(p_playing_1_); + return var3 != null && (var3.playing() || var3.paused() || var3.preLoad); + } + } + } + + SoundSystemStarterThread(Object p_i45118_2_) { + this(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java new file mode 100644 index 0000000..f73ee7f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundPoolEntry.java @@ -0,0 +1,49 @@ +package net.minecraft.client.audio; + +import net.minecraft.util.ResourceLocation; + +public class SoundPoolEntry { + private final ResourceLocation field_148656_a; + private final boolean field_148654_b; + private double field_148655_c; + private double field_148653_d; + + + public SoundPoolEntry(ResourceLocation p_i45113_1_, double p_i45113_2_, double p_i45113_4_, boolean p_i45113_6_) { + this.field_148656_a = p_i45113_1_; + this.field_148655_c = p_i45113_2_; + this.field_148653_d = p_i45113_4_; + this.field_148654_b = p_i45113_6_; + } + + public SoundPoolEntry(SoundPoolEntry p_i45114_1_) { + this.field_148656_a = p_i45114_1_.field_148656_a; + this.field_148655_c = p_i45114_1_.field_148655_c; + this.field_148653_d = p_i45114_1_.field_148653_d; + this.field_148654_b = p_i45114_1_.field_148654_b; + } + + public ResourceLocation func_148652_a() { + return this.field_148656_a; + } + + public double func_148650_b() { + return this.field_148655_c; + } + + public void func_148651_a(double p_148651_1_) { + this.field_148655_c = p_148651_1_; + } + + public double func_148649_c() { + return this.field_148653_d; + } + + public void func_148647_b(double p_148647_1_) { + this.field_148653_d = p_148647_1_; + } + + public boolean func_148648_d() { + return this.field_148654_b; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundRegistry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundRegistry.java new file mode 100644 index 0000000..f25dc0c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/audio/SoundRegistry.java @@ -0,0 +1,26 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.util.RegistrySimple; + +public class SoundRegistry extends RegistrySimple { + private Map field_148764_a; + + + /** + * Creates the Map we will use to map keys to their registered values. + */ + protected Map createUnderlyingMap() { + this.field_148764_a = Maps.newHashMap(); + return this.field_148764_a; + } + + public void func_148762_a(SoundEventAccessorComposite p_148762_1_) { + this.putObject(p_148762_1_.func_148729_c(), p_148762_1_); + } + + public void func_148763_c() { + this.field_148764_a.clear(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java new file mode 100644 index 0000000..e35d3ed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/AbstractClientPlayer.java @@ -0,0 +1,147 @@ +package net.minecraft.client.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleNickHider; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.SkinManager; +import net.minecraft.client.resources.SkinManager.SkinAvailableCallback; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.src.CapeUtils; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; + +import java.io.File; +import java.util.UUID; + +public abstract class AbstractClientPlayer extends EntityPlayer implements SkinAvailableCallback { + public static final ResourceLocation locationStevePng = new ResourceLocation("textures/entity/steve.png"); + private ResourceLocation locationSkin; + private ResourceLocation locationCape; + private ResourceLocation locationOfCape = null; + private String nameClear = null; + + public AbstractClientPlayer(World p_i45074_1_, GameProfile p_i45074_2_) { + super(p_i45074_1_, p_i45074_2_); + String var3 = this.getCommandSenderName(); + + if (!var3.isEmpty()) { + SkinManager var4 = Minecraft.getMinecraft().func_152342_ad(); + var4.func_152790_a(p_i45074_2_, this, true); + } + + this.nameClear = p_i45074_2_.getName(); + + if (this.nameClear != null && !this.nameClear.isEmpty()) { + this.nameClear = StringUtils.stripControlCodes(this.nameClear); + } + + Cosmetic activeCape = CheatBreaker.getInstance().getCosmeticManager().getActiveCape(UUID.fromString(CheatBreaker.getInstance().getProfileHandler().recompileUUID(this.getUniqueID().toString()))); + Cosmetic activeWings = CheatBreaker.getInstance().getCosmeticManager().getActiveWings(UUID.fromString(CheatBreaker.getInstance().getProfileHandler().recompileUUID(this.getUniqueID().toString()))); + CheatBreaker.getInstance().getWSNetHandler().handlePlayer(this); + + if (activeCape != null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showCheatBreakerCapes.getValue()) { + this.setLocationOfCape(activeCape.getLocation()); + this.setCBCape(activeCape); + } else if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().showOptifineCapes.getValue()) { + CapeUtils.downloadCape(this, this.getGameProfile().getId()); + } + + if (activeWings != null) { + this.setCBWings(activeWings); + } + } + + public boolean func_152122_n() { + return Config.isShowCapes() && (this.locationOfCape != null || this.locationCape != null); + } + + public boolean func_152123_o() { + return this.locationSkin != null; + } + + public ResourceLocation getLocationSkin() { + ModuleNickHider nickHiderMod = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHiderMod.isEnabled() && nickHiderMod.hideOtherSkins.getBooleanValue()) { + if (!nickHiderMod.hideSkin.getBooleanValue() && Minecraft.getMinecraft().getSession().getUsername().equals(this.getNameClear())) { + return this.locationSkin == null ? locationStevePng : this.locationSkin; + } else { + return locationStevePng; + } + } else if (nickHiderMod.isEnabled() && nickHiderMod.hideSkin.getBooleanValue() + && Minecraft.getMinecraft().getSession().getUsername().equals(this.getNameClear())) { + return locationStevePng; + } + + return this.locationSkin == null ? locationStevePng : this.locationSkin; + } + + public ResourceLocation getLocationCape() { + return !Config.isShowCapes() ? null : (this.locationOfCape != null ? this.locationOfCape : this.locationCape); + } + + public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str) { + TextureManager var2 = Minecraft.getMinecraft().getTextureManager(); + Object var3 = var2.getTexture(par0ResourceLocation); + + if (var3 == null) { + var3 = new ThreadDownloadImageData((File)null, String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[] {StringUtils.stripControlCodes(par1Str)}), locationStevePng, new ImageBufferDownload()); + var2.loadTexture(par0ResourceLocation, (ITextureObject)var3); + } + + return (ThreadDownloadImageData)var3; + } + + public static ResourceLocation getLocationSkin(String par0Str) { + return new ResourceLocation("skins/" + StringUtils.stripControlCodes(par0Str)); + } + + public void func_152121_a(Type p_152121_1_, ResourceLocation p_152121_2_) { + switch (AbstractClientPlayer.SwitchType.field_152630_a[p_152121_1_.ordinal()]) { + case 1: + this.locationSkin = p_152121_2_; + break; + + case 2: + this.locationCape = p_152121_2_; + } + } + + public String getNameClear() { + return this.nameClear; + } + + public ResourceLocation getLocationOfCape() { + return this.locationOfCape; + } + + public void setLocationOfCape(ResourceLocation locationOfCape) { + this.locationOfCape = locationOfCape; + } + + static final class SwitchType { + static final int[] field_152630_a = new int[Type.values().length]; + + static { + try { + field_152630_a[Type.SKIN.ordinal()] = 1; + } catch (NoSuchFieldError var2) { + ; + } + + try { + field_152630_a[Type.CAPE.ordinal()] = 2; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityClientPlayerMP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityClientPlayerMP.java new file mode 100644 index 0000000..9d3d7bb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityClientPlayerMP.java @@ -0,0 +1,832 @@ +package net.minecraft.client.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.module.impl.staff.impl.StaffModuleBunnyhop; +import com.cheatbreaker.client.ui.overlay.CBAlert; +import com.cheatbreaker.client.util.chat.ChatHandler; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.MovingSoundMinecartRiding; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.network.play.client.*; +import net.minecraft.src.Config; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.*; +import net.minecraft.world.World; +import org.lwjgl.opengl.Display; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +public class EntityClientPlayerMP extends EntityPlayerSP { + public final NetHandlerPlayClient sendQueue; + private final StatFileWriter field_146108_bO; + private double oldPosX; + + /** + * Old Minimum Y of the bounding box + */ + private double oldMinY; + private double oldPosY; + private double oldPosZ; + private float oldRotationYaw; + private float oldRotationPitch; + + /** + * Check if was on ground last update + */ + private boolean wasOnGround; + + /** + * should the player stop sneaking? + */ + private boolean shouldStopSneaking; + private boolean wasSneaking; + + /** + * Counter used to ensure that the server sends a move packet (Packet11, 12 or 13) to the com.cheatbreaker.client at least once a + * second. + */ + private int ticksSinceMovePacket; + + /** + * has the com.cheatbreaker.client player's health been set? + */ + private boolean hasSetHealth; + private String field_142022_ce; + + List IlllIIIlIlllIllIlIIlllIlI = new ArrayList(); + private boolean lIllIlllIIllIllllIllIIlll; + + + public EntityClientPlayerMP(Minecraft p_i45064_1_, World p_i45064_2_, Session p_i45064_3_, NetHandlerPlayClient p_i45064_4_, StatFileWriter p_i45064_5_) { + super(p_i45064_1_, p_i45064_2_, p_i45064_3_, 0); + this.sendQueue = p_i45064_4_; + this.field_146108_bO = p_i45064_5_; + } + + @Override + public void moveEntityWithHeading(float f, float f2) { + if (StaffModuleBunnyhop.canUse()) { + double d = this.posX; + double d2 = this.posY; + double d3 = this.posZ; + if (this.capabilities.isFlying && this.ridingEntity == null) { + super.moveEntityWithHeading(f, f2); + } else { + this.IIIIllIlIIIllIlllIlllllIl(f, f2); + } + this.addMovementStat(this.posX - d, this.posY - d2, this.posZ - d3); + } else { + super.moveEntityWithHeading(f, f2); + } + } + + public void lIIIIllIIlIlIllIIIlIllIlI() { + this.isJumping = false; + if (!this.IlllIIIlIlllIllIlIIlllIlI.isEmpty()) { + this.IlllIIIlIlllIllIlIIlllIlI.clear(); + } + } + + @Override + public void onLivingUpdate() { + if (StaffModuleBunnyhop.canUse()) { + this.lIIIIllIIlIlIllIIIlIllIlI(); + } + super.onLivingUpdate(); + } + + @Override + public void moveFlying(float f, float f2, float f3) { + if (StaffModuleBunnyhop.canUse()) { + if (this.capabilities.isFlying && this.ridingEntity == null || this.isInWater()) { + super.moveFlying(f, f2, f3); + return; + } + float[] arrf = this.a_(f, f2); + float[] arrf2 = new float[]{arrf[0] * (f3 *= 1.5438596f * 1.3926138f), arrf[1] * f3}; + this.IlllIIIlIlllIllIlIIlllIlI.add(arrf2); + } else { + super.moveFlying(f, f2, f3); + } + } + + @Override + public void jump() { + if (StaffModuleBunnyhop.canUse()) { + if (this.isSprinting()) { + float f = this.rotationYaw * (0.016018774f * 1.0895523f); + this.motionX += (double) (MathHelper.sin(f) * (0.12380953f * 1.6153846f)); + this.motionZ -= (double) (MathHelper.cos(f) * (0.23611112f * 0.84705883f)); + } + this.lIllIlIlIIlIllIllllIllIIl(); + this.lIllIlllIIllIllllIllIIlll = true; + } + super.jump(); + } + + public double n_() { + return MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + } + + public float o_() { + float f = 1.0f; + if (this.onGround) { + Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); + f = 1.0f - block.slipperiness; + } + return f; + } + + public float p_() { + float f = 0.79505265f * 1.1445783f; + if (this.onGround) { + f = 19.4f * 0.028144334f; + Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); + if (block != null) { + f = block.slipperiness * (2.142857f * 0.4246667f); + } + } + return f; + } + + public float llIlIIIlIIIIlIlllIlIIIIll() { + float f = this.p_(); + float f2 = 0.5409836f * 0.30088037f / (f * f * f); + return this.getAIMoveSpeed() * f2; + } + + public float[] a_(float f, float f2) { + float f3 = f * f + f2 * f2; + float[] arrf = new float[]{0.0f, 0.0f}; + if (f3 >= 1.1111112f * 8.9999994E-5f) { + if ((f3 = MathHelper.sqrt_float(f3)) < 1.0f) { + f3 = 1.0f; + } + f3 = 1.0f / f3; + float f4 = MathHelper.sin(this.rotationYaw * (2.1470587f * 1.4632076f) / (float) 180); + float f5 = MathHelper.cos(this.rotationYaw * (9.74977f * 0.32222223f) / (float) 180); + arrf[0] = (f *= f3) * f5 - (f2 *= f3) * f4; + arrf[1] = f2 * f5 + f * f4; + } + return arrf; + } + + public float IIIlIIllllIIllllllIlIIIll() { + float f = this.getAIMoveSpeed(); + return !this.isSneaking() ? f * 2.15f : f * (2.1f * 0.5285715f); + } + + public float lllIIIIIlIllIlIIIllllllII() { + float f = this.getAIMoveSpeed(); + return f * (13.333333f * 0.16125001f); + } + + private void lIIlIIllIIIIIlIllIIIIllII(int n) { + int n2; + int n3; + int n4 = MathHelper.floor_double(this.posX); + Block block = this.worldObj.getBlock(n4, n3 = MathHelper.floor_double(this.posY - 3.133333387805356 * 0.06382978707551956 - (double) this.yOffset), n2 = MathHelper.floor_double(this.posZ)); + if (block != null && block.getMaterial() != Material.air) { + for (int i = 0; i < n; ++i) { + this.worldObj.spawnParticle("blockcrack_" + Block.getIdFromBlock(block) + "_" + this.worldObj.getBlockMetadata(n4, n3, n2), this.posX + ((double) new Random().nextFloat() - 0.41011236009987867 * 1.2191780805587769) * (double) this.width, this.boundingBox.minY + (double) 0.52f * 0.1923076993614967, this.posZ + ((double) new Random().nextFloat() - 0.7090908885002136 * 0.7051282256038316) * (double) this.width, -this.motionX * (double) 4, 1.4220778824487261 * 1.0547945499420166, -this.motionZ * (double) 4); + } + } + } + + private void lIlIlIIllIlIIIIIlllIllIII() { + this.motionY = !(!this.worldObj.isClient || this.worldObj.blockExists((int) this.posX, 0, (int) this.posZ) && this.worldObj.getChunkFromBlockCoords((int) ((int) this.posX), (int) ((int) this.posZ)).isChunkLoaded) ? (this.posY > 0.0 ? -0.17307691553817026 * 0.5777778029441833 : 0.0) : (this.motionY -= 0.12285714050336764 * 0.6511628031730652); + this.motionY *= 0.367499996200204 * 2.6666667461395264; + } + + private void IllIIIIIIIlIlIllllIIllIII(float f) { + this.motionX *= (double) f; + this.motionZ *= (double) f; + } + + private void lllIIlIlIllIIlIllIIIIIlII() { + if (this.isOnLadder()) { + boolean bl; + float f = 1.0819672f * 0.13863637f; + if (this.motionX < (double) (-f)) { + this.motionX = -f; + } + if (this.motionX > (double) f) { + this.motionX = f; + } + if (this.motionZ < (double) (-f)) { + this.motionZ = -f; + } + if (this.motionZ > (double) f) { + this.motionZ = f; + } + this.fallDistance = 0.0f; + if (this.motionY < -0.15937499940628186 * 0.9411764740943909) { + this.motionY = -0.024999999999999998 * 6.0; + } + if ((bl = this.isSneaking()) && this.motionY < 0.0) { + this.motionY = 0.0; + } + } + } + + private void IlIIIlIIllIIIIllllIlIlIlI() { + if (this.isCollidedHorizontally && this.isOnLadder()) { + this.motionY = 0.07111111111111111 * 2.8125; + } + } + + private void lIIIIlllIlIlllIIIlllllIlI() { + this.prevLimbSwingAmount = this.limbSwingAmount; + double d = this.posX - this.prevPosX; + double d2 = this.posZ - this.prevPosZ; + float f = MathHelper.sqrt_double(d * d + d2 * d2) * (float) 4; + if (f > 1.0f) { + f = 1.0f; + } + this.limbSwingAmount += (f - this.limbSwingAmount) * (0.45714286f * 0.875f); + this.limbSwing += this.limbSwingAmount; + } + + private void IllIIIIIIIlIlIllllIIllIII(float f, float f2) { + double d = this.posY; + this.moveFlying(f, f2, 0.040727273f * 0.98214287f); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 2.9090908893868948 * (double) 0.275f; + this.motionY *= 1.7407407760620117 * 0.4595744656081004; + this.motionZ *= 0.5797101259231567 * 1.38000006580353; + this.motionY -= 7.833333492279053 * 0.0025531914375550406; + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 3.21052622795105 * 0.18688525844088072 - this.posY + d, this.motionZ)) { + this.motionY = 1.7297297716140747 * 0.17343750269210426; + } + } + + public void IlllIIIlIlllIllIlIIlllIlI(float f, float f2) { + if (this.isInWater() && !this.capabilities.isFlying || this.handleLavaMovement() && !this.capabilities.isFlying) { + super.moveEntityWithHeading(f, f2); + } else { + float f3 = this.p_(); + this.moveFlying(f, f2, this.llIlIIIlIIIIlIlllIlIIIIll()); + this.lllIIlIlIllIIlIllIIIIIlII(); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.IlIIIlIIllIIIIllllIlIlIlI(); + this.lIlIlIIllIlIIIIIlllIllIII(); + this.IllIIIIIIIlIlIllllIIllIII(f3); + this.lIIIIlllIlIlllIIIlllllIlI(); + } + } + + /* + * Unable to fully structure code + */ + public void IIIIllIlIIIllIlllIlllllIl(float var1, float var2) { + if (this.handleLavaMovement() && !this.capabilities.isFlying) { + super.moveEntityWithHeading(var1, var2); + } else { + if (this.isInWater() && !this.capabilities.isFlying) { + if (!(Boolean) StaffModuleBunnyhop.sharking.getValue()) { + super.moveEntityWithHeading(var1, var2); + return; + } + + this.lIIIIllIIlIlIllIIIlIllIlI(var1, var2); + } else { + float var3 = var1 == 0.0F && var2 == 0.0F ? 0.0F : this.IIIlIIllllIIllllllIlIIIll(); + float[] var4 = this.a_(var1, var2); + boolean var5 = this.onGround && !this.isJumping; + float var6 = this.p_(); + double var7; + if (var5) { + this.IllIIIIIIIlIlIllllIIllIII(var6); + var7 = (Double) StaffModuleBunnyhop.accelerate.getValue(); + if (var3 != 0.0F) { + var7 *= (double) (this.llIlIIIlIIIIlIlllIlIIIIll() * 1.2989583F * 1.6551725F / var3); + this.lIIIIlIIllIIlIIlIIIlIIllI(var3, (double) var4[0], (double) var4[1], var7); + } + + if (!this.IlllIIIlIlllIllIlIIlllIlI.isEmpty()) { + float var12 = var3 / this.lllIIIIIlIllIlIIIllllllII(); + + float[] var11; + for (Iterator var13 = this.IlllIIIlIlllIllIlIIlllIlI.iterator(); var13.hasNext(); + this.motionX += (double) (var11[1] * var12)) { + var11 = (float[]) var13.next(); + this.motionY += (double) (var11[0] * var12); + } + } + } else { + var7 = (Double) StaffModuleBunnyhop.airAccelerate.getValue(); + this.lIIIIIIIIIlIllIIllIlIIlIl(var3, (double) var4[0], (double) var4[1], var7); + if ((Boolean) StaffModuleBunnyhop.sharking.getValue() && (Double) StaffModuleBunnyhop.sharkingSurfaceTension.getValue() > 0.0 && this.isJumping && this.motionY < 0.0) { + AxisAlignedBB var9 = this.boundingBox.getOffsetBoundingBox(this.motionX, this.motionY, this.motionZ); + boolean var10 = this.worldObj.isAnyLiquid(var9); + if (var10) { + this.motionY *= (Double) StaffModuleBunnyhop.sharkingSurfaceTension.getValue(); + } + } + } + + this.lllIIlIlIllIIlIllIIIIIlII(); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.IlIIIlIIllIIIIllllIlIlIlI(); + this.lIlIlIIllIlIIIIIlllIllIII(); + } + + this.lIIIIlllIlIlllIIIlllllIlI(); + } + } + + private void lIllIlIlIIlIllIllllIllIIl() { + this.IIIlIIllllIIllllllIlIIIll(this.lllIIIIIlIllIlIIIllllllII()); + boolean bl = this.IIIlllIllIIllIllIlIIIllII(); + if (!bl) { + this.lllIIIIIlIllIlIIIllllllII(this.lllIIIIIlIllIlIIIllllllII()); + } + } + + private boolean IIIlllIllIIllIllIlIIIllII() { + float f; + double d; + if ((Boolean) StaffModuleBunnyhop.trimp.getValue() && this.isSneaking() && (d = this.n_()) > (double) (f = this.lllIIIIIlIllIlIIIllllllII())) { + double d2 = d / (double) f * (0.4166666567325592 * 1.2000000286102301); + if (d2 > 1.0) { + d2 = 1.0; + } + this.motionY += d2 * d * (double) (Float) StaffModuleBunnyhop.trimpMultiplier.getValue(); + if ((Float) StaffModuleBunnyhop.trimpMultiplier.getValue() > 0.0f) { + float f2 = 1.0f / (Float) StaffModuleBunnyhop.trimpMultiplier.getValue(); + this.motionX *= (double) f2; + this.motionZ *= (double) f2; + } + this.lIIlIIllIIIIIlIllIIIIllII(30); + return true; + } + return false; + } + + private void lIIIIIIIIIlIllIIllIlIIlIl(double d) { + this.motionX *= d; + this.motionY *= d; + this.motionZ *= d; + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(float f, float f2, double d, double d2, double d3) { + float f3 = f - f2; + if (f3 > 0.0f) { + float f4 = (float) (d3 * (double) f * ((double) 6.071429f * 0.008235293963169974)); + if (f4 > f3) { + f4 = f3; + } + this.motionX += (double) f4 * d; + this.motionZ += (double) f4 * d2; + } + } + + private void lIIIIllIIlIlIllIIIlIllIlI(float f, float f2) { + double d = this.posY; + float f3 = f != 0.0f || f2 != 0.0f ? this.lllIIIIIlIllIlIIIllllllII() : 0.0f; + float[] arrf = this.a_(f, f2); + boolean bl = this.isJumping && this.isOffsetPositionInLiquid(0.0, 1.0, 0.0); + double d2 = this.n_(); + if (!bl || d2 < 0.0566526315393012 * 1.3768116235733032) { + this.IllIIIIIIIlIlIllllIIllIII(f, f2); + } else { + if (d2 > 0.03947368264198303 * 2.2800000905990636) { + this.lIIIIIIIIIlIllIIllIlIIlIl((double) StaffModuleBunnyhop.sharkingWaterFriction.getValue()); + } + if (d2 > (double) 0.1724138f * 0.5683999898362162) { + this.lIIIIIIIIIlIllIIllIlIIlIl(f3, arrf[0], arrf[1], (double) StaffModuleBunnyhop.accelerate.getValue()); + } else { + this.lIIIIlIIllIIlIIlIIIlIIllI(12.2f * 0.008032787f, (double) arrf[0], (double) arrf[1], (double) StaffModuleBunnyhop.accelerate.getValue()); + } + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionY = 0.0; + } + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 2.188235327364251 * 0.27419355511665344 - this.posY + d, this.motionZ)) { + this.motionY = (double) 1.6f * 0.18750000465661282; + } + if (!this.IlllIIIlIlllIllIlIIlllIlI.isEmpty()) { + float f4 = f3 / this.lllIIIIIlIllIlIIIllllllII(); + for (Object arrf2 : this.IlllIIIlIlllIllIlIIlllIlI) { + this.motionX += (double) ((Float[]) arrf2)[0] * f4; + this.motionZ += (double) ((Float[]) arrf2)[1] * f4; + } + } + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(float f, double d, double d2, double d3) { + double d4 = this.motionX * d + this.motionZ * d2; + double d5 = (double) f - d4; + if (d5 <= 0.0) { + return; + } + double d6 = d3 * (double) f / (double) this.p_() * (1.121212124824524 * 0.04459459511542773); + if (d6 > d5) { + d6 = d5; + } + this.motionX += d6 * d; + this.motionZ += d6 * d2; + } + + private void lIIIIIIIIIlIllIIllIlIIlIl(float f, double d, double d2, double d3) { + double d4; + double d5; + float f2 = f; + float f3 = (float) ((double) StaffModuleBunnyhop.maxAirAccelPerTick.getValue()); + if (f2 > f3) { + f2 = f3; + } + if ((d5 = (double) f2 - (d4 = this.motionX * d + this.motionZ * d2)) <= 0.0) { + return; + } + double d6 = d3 * (double) f * (0.4054054021835327 * 0.12333333615130851); + if (d6 > d5) { + d6 = d5; + } + this.motionX += d6 * d; + this.motionZ += d6 * d2; + } + + private void lllIlIIIllIIlIIlIlIllIIlI() { + float f; + float f2; + float f3; + double d = this.n_(); + if (d <= 0.0) { + return; + } + float f4 = 0.0f; + float f5 = 1.7560976f * 0.0028472221f; + double d2 = Math.max(d, (double) f5); + double d3 = d - (double) (f4 = (float) ((double) f4 + d2 * (double) (f3 = (f2 = 1.0f) * (f = this.o_())) * (0.0026666667064030964 * 18.75))); + if (d3 < 0.0) { + d3 = 0.0; + } + if (d3 != d) { + this.motionX *= (d3 /= d); + this.motionZ *= d3; + } + } + + private void IIIlIIllllIIllllllIlIIIll(float f) { + float f2; + float f3; + float f4 = (Float) StaffModuleBunnyhop.softCap.getValue(); + float f5 = (Float) StaffModuleBunnyhop.softCapDegen.getValue(); + if ((Boolean) StaffModuleBunnyhop.uncappedBHop.getValue()) { + f4 = 1.0f; + f5 = 1.0f; + } + if ((f3 = (float) this.n_()) > (f2 = f * f4)) { + if (f5 != 1.0f) { + float f6 = (f3 - f2) * f5 + f2; + float f7 = f6 / f3; + this.motionX *= (double) f7; + this.motionZ *= (double) f7; + } + this.lIIlIIllIIIIIlIllIIIIllII(10); + } + } + + private void lllIIIIIlIllIlIIIllllllII(float f) { + float f2; + if ((Boolean) StaffModuleBunnyhop.uncappedBHop.getValue()) { + return; + } + float f3 = (Float) StaffModuleBunnyhop.hardCap.getValue(); + float f4 = (float) this.n_(); + if (f4 > (f2 = f * f3) && f2 != 0.0f) { + float f5 = f2 / f4; + this.motionX *= (double) f5; + this.motionZ *= (double) f5; + this.lIIlIIllIIIIIlIllIIIIllII(30); + } + } + + private void IIlIIlIlIlIlllIIlIIlIIlII() { + this.lIllIlllIIllIllllIllIIlll = false; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + return false; + } + + /** + * Heal living entity (param: amount of half-hearts) + */ + public void heal(float p_70691_1_) { + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity p_70078_1_) { + super.mountEntity(p_70078_1_); + + if (p_70078_1_ instanceof EntityMinecart) { + this.mc.getSoundHandler().playSound(new MovingSoundMinecartRiding(this, (EntityMinecart) p_70078_1_)); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { + super.onUpdate(); + + if (this.isRiding()) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); + } else { + this.sendMotionUpdates(); + } + } + } + + /** + * Send updated motion and position information to the server + */ + public void sendMotionUpdates() { + boolean var1 = this.isSprinting(); + + if (var1 != this.wasSneaking) { + if (var1) { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 4)); + } else { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 5)); + } + + this.wasSneaking = var1; + } + + boolean var2 = this.isSneaking(); + + if (var2 != this.shouldStopSneaking) { + if (var2) { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 1)); + } else { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 2)); + } + + this.shouldStopSneaking = var2; + } + + double var3 = this.posX - this.oldPosX; + double var5 = this.boundingBox.minY - this.oldMinY; + double var7 = this.posZ - this.oldPosZ; + double var9 = this.rotationYaw - this.oldRotationYaw; + double var11 = this.rotationPitch - this.oldRotationPitch; + boolean var13 = var3 * var3 + var5 * var5 + var7 * var7 > 9.0E-4D || this.ticksSinceMovePacket >= 20; + boolean var14 = var9 != 0.0D || var11 != 0.0D; + + if (this.ridingEntity != null) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, this.onGround)); + var13 = false; + } else if (var13 && var14) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround)); + } else if (var13) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.onGround)); + } else if (var14) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + } else { + this.sendQueue.addToSendQueue(new C03PacketPlayer(this.onGround)); + } + + ++this.ticksSinceMovePacket; + this.wasOnGround = this.onGround; + + if (var13) { + this.oldPosX = this.posX; + this.oldMinY = this.boundingBox.minY; + this.oldPosY = this.posY; + this.oldPosZ = this.posZ; + this.ticksSinceMovePacket = 0; + } + + if (var14) { + this.oldRotationYaw = this.rotationYaw; + this.oldRotationPitch = this.rotationPitch; + } + } + + /** + * Called when player presses the drop item key + */ + public EntityItem dropOneItem(boolean p_71040_1_) { + int var2 = p_71040_1_ ? 3 : 4; + this.sendQueue.addToSendQueue(new C07PacketPlayerDigging(var2, 0, 0, 0, 0)); + return null; + } + + /** + * Joins the passed in entity item with the world. Args: entityItem + */ + protected void joinEntityItemWithWorld(EntityItem p_71012_1_) { + } + + /** + * Sends a chat message from the player. Args: chatMessage + */ + public void sendChatMessage(String p_71165_1_) { + /*if (p_71165_1_.equals("/cb changes")) { + for (AbstractModule mod : CheatBreaker.getInstance().getModuleManager().playerMods) { + System.out.println("Mod: " + mod.getName()); + System.out.println(" - Options:"); + for (int i = 0; i < mod.getSettingsList().size(); i++) { + System.out.println(" - " + mod.getSettingsList().get(i).getSettingName()); + } + } + }*/ + + /*if (p_71165_1_.equals("/cb changes settings")) { + for (Setting setting : CheatBreaker.getInstance().getGlobalSettings().settingsList) { + boolean hasNoDescription = setting.getSettingDescription().length() == 0; + if (!setting.getSettingName().equals("label")) { + System.out.println("- " + setting.getSettingName() + (hasNoDescription ? "" : " (" + EnumChatFormatting.getTextWithoutFormattingCodes(setting.getSettingDescription().replaceAll("\n", ", ")) + ")")); + } + } + }*/ + + if (p_71165_1_.equals("/cb chat")) { + ChatHandler.sendBrandedChatMessage("Nox has been CheatBreaker Bunned!"); + return; + } + + if (p_71165_1_.equals("/cb debug")) { + CheatBreaker.getInstance().getGlobalSettings().isDebug = !CheatBreaker.getInstance().getGlobalSettings().isDebug; + if (CheatBreaker.getInstance().getGlobalSettings().isDebug) { + Display.setTitle("Minecraft " + Config.MC_VERSION + " - " + + CheatBreaker.getInstance().getGitBuildVersion() + + " Build (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + + "/" + CheatBreaker.getInstance().getGitBranch() + ")"); + } else { + Display.setTitle("Minecraft " + Config.MC_VERSION); + } + + if (Minecraft.getMinecraft().getSession().getUsername().equalsIgnoreCase("Noxiuam") && !CheatBreaker.getInstance().getGlobalSettings().isDebug) { + CheatBreaker.getInstance().getCosmeticManager().getWings().add(new Cosmetic(Minecraft.getMinecraft().getSession().getPlayerID(), "Black_Wings", Cosmetic.CosmeticType.WINGS, 0.13F, true, "client/wings/black.png")); + CheatBreaker.getInstance().getCosmeticManager().getCapes().add(new Cosmetic(Minecraft.getMinecraft().getSession().getPlayerID(), "CheatBreaker", Cosmetic.CosmeticType.CAPE, 0.16F, true, "client/capes/cb2.png")); + } + + ChatComponentText prefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " + EnumChatFormatting.RESET); + ChatComponentText status = new ChatComponentText(EnumChatFormatting.GRAY + "Debug: " + CheatBreaker.getInstance().getGlobalSettings().isDebug); + prefix.appendSibling(status); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(prefix); + }/* else if(p_71165_1_.equals("/cb credits")) { + if (!ClientCredits.isCreditedUser(this.mc.getSession().getUniqueID())) ClientCredits.sendCredits(); + } else if(p_71165_1_.startsWith("/cb emote")) { + String[] args = p_71165_1_.split(" "); + if(args.length != 3) { + ChatComponentText prefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " +EnumChatFormatting.RESET); + ChatComponentText arguments = new ChatComponentText(EnumChatFormatting.RED + "Usage: /cb emote "); + prefix.appendSibling(arguments); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(prefix); + return; + } + if(args[2].equals("list")) { + ChatComponentText prefix = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " +EnumChatFormatting.RESET); + StringBuilder emotes = new StringBuilder(); + for (int id : CheatBreaker.getInstance().getEmoteManager().getEmotes()) { + Emote emote = CheatBreaker.getInstance().getEmoteManager().getEmote(id); + if (!emotes.toString().equals("")) { + emotes.append(", "); + } + emotes.append(emote.getName()).append(" (ID: ").append(id).append(")"); + } + ChatComponentText chatComponentText2 = new ChatComponentText(EnumChatFormatting.GRAY + "Emotes: " + emotes); + + prefix.appendSibling(chatComponentText2); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(prefix); + return; + } + int id = Integer.parseInt(args[2]); + Emote emote =CheatBreaker.getInstance().getEmoteManager().getEmote(id); + ChatComponentText chatComponentText = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " +EnumChatFormatting.RESET); + ChatComponentText chatComponentText2 = new ChatComponentText(EnumChatFormatting.GRAY + "Doing emote: " + emote.getName()); + chatComponentText.appendSibling(chatComponentText2); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(chatComponentText); + CheatBreaker.getInstance().getEmoteManager().playEmote(Minecraft.getMinecraft().thePlayer, emote); + } else if(p_71165_1_.equals("/cb everything chroma")) { + ChatComponentText chatComponentText = new ChatComponentText(EnumChatFormatting.RED + "[C" + EnumChatFormatting.WHITE + "B" + EnumChatFormatting.RED + "] " +EnumChatFormatting.RESET); + ChatComponentText chatComponentText2 = new ChatComponentText(EnumChatFormatting.GRAY + ":)"); + chatComponentText.appendSibling(chatComponentText2); + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(chatComponentText); + for(AbstractModule module : CheatBreaker.getInstance().getModuleManager().staffMods) { + module.getSettingsList().forEach(setting -> { + setting.rainbow = true; + setting.speed = true; + }); + } + for(AbstractModule module : CheatBreaker.getInstance().getModuleManager().playerMods) { + module.getSettingsList().forEach(setting -> { + setting.rainbow = true; + setting.speed = true; + }); + } + } */ else { + this.sendQueue.addToSendQueue(new C01PacketChatMessage(p_71165_1_)); + CheatBreaker.getInstance().getModuleManager().chatMod.dingCooldown.add(System.currentTimeMillis()); + } + } + + /** + * Swings the item the player is holding. + */ + public void swingItem() { + super.swingItem(); + this.sendQueue.addToSendQueue(new C0APacketAnimation(this, 1)); + } + + public void respawnPlayer() { + this.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN)); + } + + /** + * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health + * second with the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource p_70665_1_, float p_70665_2_) { + if (!this.isEntityInvulnerable()) { + this.setHealth(this.getHealth() - p_70665_2_); + } + } + + /** + * set current crafting inventory back to the 2x2 square + */ + public void closeScreen() { + this.sendQueue.addToSendQueue(new C0DPacketCloseWindow(this.openContainer.windowId)); + this.closeScreenNoPacket(); + } + + /** + * Closes the GUI screen without sending a packet to the server + */ + public void closeScreenNoPacket() { + this.inventory.setItemStack(null); + super.closeScreen(); + } + + /** + * Updates health locally. + */ + public void setPlayerSPHealth(float p_71150_1_) { + if (this.hasSetHealth) { + super.setPlayerSPHealth(p_71150_1_); + } else { + this.setHealth(p_71150_1_); + this.hasSetHealth = true; + } + } + + /** + * Adds a value to a statistic field. + */ + public void addStat(StatBase p_71064_1_, int p_71064_2_) { + if (p_71064_1_ != null) { + if (p_71064_1_.isIndependent) { + super.addStat(p_71064_1_, p_71064_2_); + } + } + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() { + this.sendQueue.addToSendQueue(new C13PacketPlayerAbilities(this.capabilities)); + } + + protected void func_110318_g() { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 6, (int) (this.getHorseJumpPower() * 100.0F))); + } + + public void func_110322_i() { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 7)); + } + + public void func_142020_c(String p_142020_1_) { + this.field_142022_ce = p_142020_1_; + } + + public String func_142021_k() { + return this.field_142022_ce; + } + + public StatFileWriter func_146107_m() { + return this.field_146108_bO; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java new file mode 100644 index 0000000..850fd63 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityOtherPlayerMP.java @@ -0,0 +1,175 @@ +package net.minecraft.client.entity; + +import com.mojang.authlib.GameProfile; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityOtherPlayerMP extends AbstractClientPlayer { + private boolean isItemInUse; + private int otherPlayerMPPosRotationIncrements; + private double otherPlayerMPX; + private double otherPlayerMPY; + private double otherPlayerMPZ; + private double otherPlayerMPYaw; + private double otherPlayerMPPitch; + + + public EntityOtherPlayerMP(World p_i45075_1_, GameProfile p_i45075_2_) { + super(p_i45075_1_, p_i45075_2_); + this.yOffset = 0.0F; + this.stepHeight = 0.0F; + this.noClip = true; + this.field_71082_cx = 0.25F; + this.renderDistanceWeight = 10.0D; + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ + protected void resetHeight() { + this.yOffset = 0.0F; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + return true; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.otherPlayerMPX = p_70056_1_; + this.otherPlayerMPY = p_70056_3_; + this.otherPlayerMPZ = p_70056_5_; + this.otherPlayerMPYaw = p_70056_7_; + this.otherPlayerMPPitch = p_70056_8_; + this.otherPlayerMPPosRotationIncrements = p_70056_9_; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.field_71082_cx = 0.0F; + super.onUpdate(); + this.prevLimbSwingAmount = this.limbSwingAmount; + double var1 = this.posX - this.prevPosX; + double var3 = this.posZ - this.prevPosZ; + float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3) * 4.0F; + + if (var5 > 1.0F) { + var5 = 1.0F; + } + + this.limbSwingAmount += (var5 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + + if (!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) { + ItemStack var6 = this.inventory.mainInventory[this.inventory.currentItem]; + this.setItemInUse(this.inventory.mainInventory[this.inventory.currentItem], var6.getItem().getMaxItemUseDuration(var6)); + this.isItemInUse = true; + } else if (this.isItemInUse && !this.isEating()) { + this.clearItemInUse(); + this.isItemInUse = false; + } + } + + public float getShadowSize() { + return 0.0F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.updateEntityActionState(); + + if (this.otherPlayerMPPosRotationIncrements > 0) { + double var1 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; + double var3 = this.posY + (this.otherPlayerMPY - this.posY) / (double)this.otherPlayerMPPosRotationIncrements; + double var5 = this.posZ + (this.otherPlayerMPZ - this.posZ) / (double)this.otherPlayerMPPosRotationIncrements; + double var7; + + for (var7 = this.otherPlayerMPYaw - (double)this.rotationYaw; var7 < -180.0D; var7 += 360.0D) { + } + + while (var7 >= 180.0D) { + var7 -= 360.0D; + } + + this.rotationYaw = (float)((double)this.rotationYaw + var7 / (double)this.otherPlayerMPPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.otherPlayerMPPitch - (double)this.rotationPitch) / (double)this.otherPlayerMPPosRotationIncrements); + --this.otherPlayerMPPosRotationIncrements; + this.setPosition(var1, var3, var5); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + + this.prevCameraYaw = this.cameraYaw; + float var9 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float var2 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; + + if (var9 > 0.1F) { + var9 = 0.1F; + } + + if (!this.onGround || this.getHealth() <= 0.0F) { + var9 = 0.0F; + } + + if (this.onGround || this.getHealth() <= 0.0F) { + var2 = 0.0F; + } + + this.cameraYaw += (var9 - this.cameraYaw) * 0.4F; + this.cameraPitch += (var2 - this.cameraPitch) * 0.8F; + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int p_70062_1_, ItemStack p_70062_2_) { + if (p_70062_1_ == 0) { + this.inventory.mainInventory[this.inventory.currentItem] = p_70062_2_; + } else { + this.inventory.armorInventory[p_70062_1_ - 1] = p_70062_2_; + } + } + + public float getEyeHeight() { + return 1.82F; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent p_145747_1_) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(p_145747_1_); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_) { + return false; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java new file mode 100644 index 0000000..d51e9ac --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java @@ -0,0 +1,730 @@ +package net.minecraft.client.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.ModuleToggleSprint; +import com.cheatbreaker.client.module.impl.normal.perspective.ModulePerspective; +import net.minecraft.MinecraftMovementInputHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiCommandBlock; +import net.minecraft.client.gui.GuiEnchantment; +import net.minecraft.client.gui.GuiHopper; +import net.minecraft.client.gui.GuiMerchant; +import net.minecraft.client.gui.GuiRepair; +import net.minecraft.client.gui.GuiScreenBook; +import net.minecraft.client.gui.inventory.*; +import net.minecraft.client.particle.EntityCrit2FX; +import net.minecraft.client.particle.EntityPickupFX; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.potion.Potion; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.*; +import net.minecraft.world.World; + +public class EntityPlayerSP extends AbstractClientPlayer { + public MovementInput movementInput; + protected Minecraft mc; + + /** + * Used to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to + * sprint, aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable + * sprinting. + */ + protected int sprintToggleTimer; + + /** Ticks left before sprinting is disabled. */ + public int sprintingTicksLeft; + public float renderArmYaw; + public float renderArmPitch; + public float prevRenderArmYaw; + public float prevRenderArmPitch; + private int horseJumpPowerCounter; + private float horseJumpPower; + private final MouseFilter field_71162_ch = new MouseFilter(); + private final MouseFilter field_71160_ci = new MouseFilter(); + private final MouseFilter field_71161_cj = new MouseFilter(); + + /** The amount of time an entity has been in a Portal */ + public float timeInPortal; + + /** The amount of time an entity has been in a Portal the previous tick */ + public float prevTimeInPortal; + + private final MinecraftMovementInputHelper minecraftMovementInputHelper; + + + public EntityPlayerSP(Minecraft p_i1238_1_, World p_i1238_2_, Session p_i1238_3_, int p_i1238_4_) { + super(p_i1238_2_, p_i1238_3_.func_148256_e()); + this.minecraftMovementInputHelper = new MinecraftMovementInputHelper(Minecraft.getMinecraft().gameSettings); + this.mc = p_i1238_1_; + this.dimension = p_i1238_4_; + } + + public void updateEntityActionState() { + super.updateEntityActionState(); + this.moveStrafing = this.movementInput.moveStrafe; + this.moveForward = this.movementInput.moveForward; + this.isJumping = this.movementInput.jump; + this.prevRenderArmYaw = this.renderArmYaw; + this.prevRenderArmPitch = this.renderArmPitch; + this.renderArmPitch = (float)((double)this.renderArmPitch + (double)(this.rotationPitch - this.renderArmPitch) * 0.5D); + this.renderArmYaw = (float)((double)this.renderArmYaw + (double)(this.rotationYaw - this.renderArmYaw) * 0.5D); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (CheatBreaker.getInstance().getModuleManager().toggleSprintMod.isEnabled()) { + this.toggleSprintVersionOnLivingUpdate(); + } else { + if (this.sprintingTicksLeft > 0) { + --this.sprintingTicksLeft; + + if (this.sprintingTicksLeft == 0) { + this.setSprinting(false); + } + } + + if (this.sprintToggleTimer > 0) { + --this.sprintToggleTimer; + } + + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { + this.posX = this.posZ = 0.5D; + this.posX = 0.0D; + this.posZ = 0.0D; + this.rotationYaw = (float)this.ticksExisted / 12.0F; + this.rotationPitch = 10.0F; + this.posY = 68.5D; + } else { + this.prevTimeInPortal = this.timeInPortal; + + if (this.inPortal) { + if (this.mc.currentScreen != null) { + this.mc.displayGuiScreen(null); + } + + if (this.timeInPortal == 0.0F) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("portal.trigger"), this.rand.nextFloat() * 0.4F + 0.8F)); + } + + this.timeInPortal += 0.0125F; + + if (this.timeInPortal >= 1.0F) { + this.timeInPortal = 1.0F; + } + + this.inPortal = false; + } else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { + this.timeInPortal += 0.006666667F; + + if (this.timeInPortal > 1.0F) { + this.timeInPortal = 1.0F; + } + } else { + if (this.timeInPortal > 0.0F) { + this.timeInPortal -= 0.05F; + } + + if (this.timeInPortal < 0.0F) { + this.timeInPortal = 0.0F; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + boolean var1 = this.movementInput.jump; + float var2 = 0.8F; + boolean var3 = this.movementInput.moveForward >= var2; + this.movementInput.updatePlayerMoveState(); + + if (this.isUsingItem() && !this.isRiding()) { + this.movementInput.moveStrafe *= 0.2F; + this.movementInput.moveForward *= 0.2F; + this.sprintToggleTimer = 0; + } + + if (this.movementInput.sneak && this.ySize < 0.2F) { + this.ySize = 0.2F; + } + + this.func_145771_j(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); + this.func_145771_j(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); + this.func_145771_j(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); + this.func_145771_j(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); + boolean var4 = (float)this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; + + if (this.onGround && !var3 && this.movementInput.moveForward >= var2 && !this.isSprinting() && var4 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { + if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.getIsKeyPressed()) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); + } + } + + if (!this.isSprinting() && this.movementInput.moveForward >= var2 && var4 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness) && this.mc.gameSettings.keyBindSprint.getIsKeyPressed()) { + this.setSprinting(true); + } + + if (this.isSprinting() && (this.movementInput.moveForward < var2 || this.isCollidedHorizontally || !var4)) { + this.setSprinting(false); + } + + if (this.capabilities.allowFlying && !var1 && this.movementInput.jump) { + if (this.flyToggleTimer == 0) { + this.flyToggleTimer = 7; + } else { + this.capabilities.isFlying = !this.capabilities.isFlying; + this.sendPlayerAbilities(); + this.flyToggleTimer = 0; + } + } + + if (this.capabilities.isFlying) { + if (this.movementInput.sneak) { + this.motionY -= 0.15D; + } + + if (this.movementInput.jump) { + this.motionY += 0.15D; + } + } + + if (this.isRidingHorse()) { + if (this.horseJumpPowerCounter < 0) { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter == 0) { + this.horseJumpPower = 0.0F; + } + } + + if (var1 && !this.movementInput.jump) { + this.horseJumpPowerCounter = -10; + this.func_110318_g(); + } else if (!var1 && this.movementInput.jump) { + this.horseJumpPowerCounter = 0; + this.horseJumpPower = 0.0F; + } else if (var1) { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter < 10) { + this.horseJumpPower = (float)this.horseJumpPowerCounter * 0.1F; + } else { + this.horseJumpPower = 0.8F + 2.0F / (float)(this.horseJumpPowerCounter - 9) * 0.1F; + } + } + } else { + this.horseJumpPower = 0.0F; + } + + super.onLivingUpdate(); + + if (this.onGround && this.capabilities.isFlying) { + this.capabilities.isFlying = false; + this.sendPlayerAbilities(); + } + } + } + } + + public void toggleSprintVersionOnLivingUpdate() { + if (this.sprintingTicksLeft > 0) { + --this.sprintingTicksLeft; + if (this.sprintingTicksLeft == 0) { + this.setSprinting(false); + } + } + if (this.sprintToggleTimer > 0) { + --this.sprintToggleTimer; + } + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { + this.posX = this.posZ = 0.4137931168079376 * 1.2083332943212668; + this.posX = 0.0; + this.posZ = 0.0; + this.rotationYaw = (float)this.ticksExisted / (float)12; + this.rotationPitch = 10; + this.posY = 44.2395846517757 * 1.548387050628662; + } else { + this.prevTimeInPortal = this.timeInPortal; + if (this.inPortal) { + if (this.mc.currentScreen != null) { + this.mc.displayGuiScreen(null); + } + if (this.timeInPortal == 0.0f) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("portal.trigger"), this.getRNG().nextFloat() * (0.627907f * 0.63703704f) + 1.1750001f * 0.68085104f)); + } + this.timeInPortal += 0.007142857f * 1.75f; + if (this.timeInPortal >= 1.0f) { + this.timeInPortal = 1.0f; + } + this.inPortal = false; + } else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { + this.timeInPortal += 9.803922E-5f * 68.0f; + if (this.timeInPortal > 1.0f) { + this.timeInPortal = 1.0f; + } + } else { + if (this.timeInPortal > 0.0f) { + this.timeInPortal -= 0.92391306f * 0.054117646f; + } + if (this.timeInPortal < 0.0f) { + this.timeInPortal = 0.0f; + } + } + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + boolean bl = this.movementInput.jump; + float f = 0.4848485f * 1.65f; + boolean bl2 = this.movementInput.moveForward >= f; + MinecraftMovementInputHelper.lIIIIlIIllIIlIIlIIIlIIllI(this.mc, (MovementInputFromOptions)this.movementInput, this); + if (this.isUsingItem() && !this.isRiding()) { + this.movementInput.moveStrafe *= 2.2380953f * 0.089361705f; + this.movementInput.moveForward *= 0.44444445f * 0.45000002f; + this.sprintToggleTimer = 0; + } + if (this.movementInput.sneak && this.ySize < 0.114583336f * 1.7454545f) { + this.ySize = 0.2037037f * 0.9818182f; + } + this.func_145771_j(this.posX - (double)this.width * (1.3176470588235294 * 0.265625), this.boundingBox.minY + (double)1.3f * 0.3846153987229934, this.posZ + (double)this.width * (0.6499999667916996 * 0.5384615659713745)); + this.func_145771_j(this.posX - (double)this.width * (0.6369999688661113 * 0.5494505763053894), this.boundingBox.minY + 0.19135803257686843 * 2.612903118133545, this.posZ - (double)this.width * (5.692307472229004 * 0.061486488863706154)); + this.func_145771_j(this.posX + (double)this.width * (3.2666666507720947 * 0.10714285766418057), this.boundingBox.minY + 0.3421052695971778 * 1.4615384340286255, this.posZ - (double)this.width * ((double)0.8875f * 0.39436620248023824)); + this.func_145771_j(this.posX + (double)this.width * (1.5106383562088013 * 0.23169013189787085), this.boundingBox.minY + 1.1034482717514038 * 0.45312500168802217, this.posZ + (double)this.width * (0.0517241396009922 * 6.766666448199094)); + boolean bl3 = (float)this.getFoodStats().getFoodLevel() > (float)6 || this.capabilities.isFlying; + boolean bl4 = !CheatBreaker.getInstance().getModuleManager().toggleSprintMod.isEnabled() || !((Boolean) ModuleToggleSprint.toggleSprint.getValue()); + boolean bl5 = (Boolean) ModuleToggleSprint.doubleTap.getValue(); + if (ModuleToggleSprint.buggedSprint) { + this.setSprinting(false); + this.minecraftMovementInputHelper.setSprintState(false, false); + ModuleToggleSprint.buggedSprint = false; + } + if (bl4) { + if ((Boolean) ModuleToggleSprint.doubleTap.getValue() && this.onGround + && !bl2 && this.movementInput.moveForward >= f && !this.isSprinting() + && bl3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { + if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.getIsKeyPressed()) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); + this.minecraftMovementInputHelper.setSprintState(true, false); + } + } + if (!this.isSprinting() && this.movementInput.moveForward >= f && bl3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness) && this.mc.gameSettings.keyBindSprint.getIsKeyPressed()) { + this.setSprinting(true); + this.minecraftMovementInputHelper.setSprintState(true, false); + } + } else { + boolean bl6 = MinecraftMovementInputHelper.isSprinting; + if (!(!bl3 || this.isUsingItem() || this.isPotionActive(Potion.blindness) || MinecraftMovementInputHelper.superSusBoolean || bl5 && this.isSprinting())) { + this.setSprinting(bl6); + } + if (bl5 && !bl6 && this.onGround && !bl2 && this.movementInput.moveForward >= f && !this.isSprinting() && bl3 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { + if (this.sprintToggleTimer == 0) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); + this.minecraftMovementInputHelper.setSprintState(true, true); + this.sprintToggleTimer = 0; + } + } + } + if (this.isSprinting() && (this.movementInput.moveForward < f || this.isCollidedHorizontally || !bl3)) { + this.setSprinting(false); + if (MinecraftMovementInputHelper.superSusBoolean || bl4 || MinecraftMovementInputHelper.aSusBoolean || this.isRiding()) { + this.minecraftMovementInputHelper.setSprintState(false, false); + + } + } + if ((Boolean) ModuleToggleSprint.flyBoost.getValue() && this.capabilities.isFlying && this.mc.gameSettings.keyBindSprint.getIsKeyPressed() && this.capabilities.isCreativeMode) { + this.capabilities.setFlySpeed(0.027272727f * 1.8333334f * (Float) ModuleToggleSprint.flyBoostAmount.getValue()); + if (this.movementInput.sneak) { + this.motionY -= 0.6526315808296204 * 0.2298387090145425 * (double) (Float) ModuleToggleSprint.flyBoostAmount.getValue(); + } + if (this.movementInput.jump) { + this.motionY += 0.01084337374315776 * 13.833333015441895 * (double) (Float) ModuleToggleSprint.flyBoostAmount.getValue(); + } + } else if (this.capabilities.getFlySpeed() != 0.0129629625f * 3.857143f) { + this.capabilities.setFlySpeed(4.714286f * 0.010606061f); + } + if (this.capabilities.allowFlying && !bl && this.movementInput.jump) { + if (this.flyToggleTimer == 0) { + this.flyToggleTimer = 7; + } else { + this.capabilities.isFlying = !this.capabilities.isFlying; + this.sendPlayerAbilities(); + this.flyToggleTimer = 0; + } + } + if (this.capabilities.isFlying) { + if (this.movementInput.sneak) { + this.motionY -= 0.33387095875472134 * 0.4492753744125366; + } + if (this.movementInput.jump) { + this.motionY += 0.12826086912203224 * 1.1694915294647217; + } + } + if (this.isRidingHorse()) { + if (this.horseJumpPowerCounter < 0) { + ++this.horseJumpPowerCounter; + if (this.horseJumpPowerCounter == 0) { + this.horseJumpPower = 0.0f; + } + } + if (bl && !this.movementInput.jump) { + this.horseJumpPowerCounter -= 10; + this.horseJumpPowerCounter = -10; + ((EntityClientPlayerMP)this).sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 6, (int)(this.getHorseJumpPower() * (float)100))); + } else if (!bl && this.movementInput.jump) { + this.horseJumpPowerCounter = 0; + this.horseJumpPower = 0.0f; + } else if (bl) { + ++this.horseJumpPowerCounter; + this.horseJumpPower = this.horseJumpPowerCounter < 10 ? (float)this.horseJumpPowerCounter * (0.84615386f * 0.11818182f) : 2.2272727f * 0.35918367f + 2.0f / (float)(this.horseJumpPowerCounter - 9) * (0.54651165f * 0.18297872f); + } + } else { + this.horseJumpPower = 0.0f; + } + super.onLivingUpdate(); + if (this.onGround && this.capabilities.isFlying) { + this.capabilities.isFlying = false; + this.sendPlayerAbilities(); + } + } + } + + /** + * Gets the player's field of view multiplier. (ex. when flying) + */ + public float getFOVMultiplier() { + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + + float var1 = 1.0F; + + if (this.capabilities.isFlying) { + var1 *= 1.1F; + } + + IAttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (perspectiveMod.isEnabled()) { + if (!perspectiveMod.staticSwiftness.getBooleanValue()) { + var1 = (float)((double)var1 * ((var2.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); + } + } else { + var1 = (float)((double)var1 * ((var2.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); + } + + if (this.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(var1) || Float.isInfinite(var1)) { + var1 = 1.0F; + } + + if (this.isUsingItem() && this.getItemInUse().getItem() == Items.bow) { + int var3 = this.getItemInUseDuration(); + float var4 = (float)var3 / 20.0F; + + if (var4 > 1.0F) { + var4 = 1.0F; + } else { + var4 *= var4; + } + + if (perspectiveMod.isEnabled()) { + var1 *= 1.0F - var4 * perspectiveMod.aimingMultiplier.getFloatValue(); + } else { + var1 *= 1.0F - var4 * 0.15F; + } + } + + return var1; + } + + /** + * set current crafting inventory back to the 2x2 square + */ + public void closeScreen() { + super.closeScreen(); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + Minecraft.getMinecraft().entityRenderer.stopUseShader(); + } + this.mc.displayGuiScreen(null); + } + + public void func_146100_a(TileEntity p_146100_1_) { + if (p_146100_1_ instanceof TileEntitySign) { + this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)p_146100_1_)); + } else if (p_146100_1_ instanceof TileEntityCommandBlock) { + this.mc.displayGuiScreen(new GuiCommandBlock(((TileEntityCommandBlock)p_146100_1_).func_145993_a())); + } + } + + public void func_146095_a(CommandBlockLogic p_146095_1_) { + this.mc.displayGuiScreen(new GuiCommandBlock(p_146095_1_)); + } + + /** + * Displays the GUI for interacting with a book. + */ + public void displayGUIBook(ItemStack p_71048_1_) { + Item var2 = p_71048_1_.getItem(); + + if (var2 == Items.written_book) { + this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, false)); + } else if (var2 == Items.writable_book) { + this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, true)); + } + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ + public void displayGUIChest(IInventory p_71007_1_) { + this.mc.displayGuiScreen(new GuiChest(this.inventory, p_71007_1_)); + } + + public void func_146093_a(TileEntityHopper p_146093_1_) { + this.mc.displayGuiScreen(new GuiHopper(this.inventory, p_146093_1_)); + } + + public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) { + this.mc.displayGuiScreen(new GuiHopper(this.inventory, p_96125_1_)); + } + + public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) { + this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, p_110298_2_, p_110298_1_)); + } + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int p_71058_1_, int p_71058_2_, int p_71058_3_) { + this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj, p_71058_1_, p_71058_2_, p_71058_3_)); + } + + public void displayGUIEnchantment(int p_71002_1_, int p_71002_2_, int p_71002_3_, String p_71002_4_) { + this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, p_71002_1_, p_71002_2_, p_71002_3_, p_71002_4_)); + } + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) { + this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_)); + } + + public void func_146101_a(TileEntityFurnace p_146101_1_) { + this.mc.displayGuiScreen(new GuiFurnace(this.inventory, p_146101_1_)); + } + + public void func_146098_a(TileEntityBrewingStand p_146098_1_) { + this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, p_146098_1_)); + } + + public void func_146104_a(TileEntityBeacon p_146104_1_) { + this.mc.displayGuiScreen(new GuiBeacon(this.inventory, p_146104_1_)); + } + + public void func_146102_a(TileEntityDispenser p_146102_1_) { + this.mc.displayGuiScreen(new GuiDispenser(this.inventory, p_146102_1_)); + } + + public void displayGUIMerchant(IMerchant p_71030_1_, String p_71030_2_) { + this.mc.displayGuiScreen(new GuiMerchant(this.inventory, p_71030_1_, this.worldObj, p_71030_2_)); + } + + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity p_71009_1_) { + this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, p_71009_1_)); + } + + public void onEnchantmentCritical(Entity p_71047_1_) { + EntityCrit2FX var2 = new EntityCrit2FX(this.mc.theWorld, p_71047_1_, "magicCrit"); + this.mc.effectRenderer.addEffect(var2); + } + + /** + * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) { + this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, p_71001_1_, this, -0.5F)); + } + + /** + * Returns if this entity is sneaking. + */ + public boolean isSneaking() { + return this.movementInput.sneak && !this.sleeping; + } + + /** + * Updates health locally. + */ + public void setPlayerSPHealth(float p_71150_1_) { + float var2 = this.getHealth() - p_71150_1_; + + if (var2 <= 0.0F) { + this.setHealth(p_71150_1_); + + if (var2 < 0.0F) { + this.hurtResistantTime = this.maxHurtResistantTime / 2; + } + } else { + this.lastDamage = var2; + this.setHealth(this.getHealth()); + this.hurtResistantTime = this.maxHurtResistantTime; + this.damageEntity(DamageSource.generic, var2); + this.hurtTime = this.maxHurtTime = 10; + } + } + + public void addChatComponentMessage(IChatComponent p_146105_1_) { + this.mc.ingameGUI.getChatGUI().func_146227_a(p_146105_1_); + } + + private boolean isBlockTranslucent(int p_71153_1_, int p_71153_2_, int p_71153_3_) { + return this.worldObj.getBlock(p_71153_1_, p_71153_2_, p_71153_3_).isNormalCube(); + } + + protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) { + int var7 = MathHelper.floor_double(p_145771_1_); + int var8 = MathHelper.floor_double(p_145771_3_); + int var9 = MathHelper.floor_double(p_145771_5_); + double var10 = p_145771_1_ - (double)var7; + double var12 = p_145771_5_ - (double)var9; + + if (this.isBlockTranslucent(var7, var8, var9) || this.isBlockTranslucent(var7, var8 + 1, var9)) { + boolean var14 = !this.isBlockTranslucent(var7 - 1, var8, var9) && !this.isBlockTranslucent(var7 - 1, var8 + 1, var9); + boolean var15 = !this.isBlockTranslucent(var7 + 1, var8, var9) && !this.isBlockTranslucent(var7 + 1, var8 + 1, var9); + boolean var16 = !this.isBlockTranslucent(var7, var8, var9 - 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 - 1); + boolean var17 = !this.isBlockTranslucent(var7, var8, var9 + 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 + 1); + byte var18 = -1; + double var19 = 9999.0D; + + if (var14 && var10 < var19) { + var19 = var10; + var18 = 0; + } + + if (var15 && 1.0D - var10 < var19) { + var19 = 1.0D - var10; + var18 = 1; + } + + if (var16 && var12 < var19) { + var19 = var12; + var18 = 4; + } + + if (var17 && 1.0D - var12 < var19) { + var19 = 1.0D - var12; + var18 = 5; + } + + float var21 = 0.1F; + + if (var18 == 0) { + this.motionX = -var21; + } + + if (var18 == 1) { + this.motionX = var21; + } + + if (var18 == 4) { + this.motionZ = -var21; + } + + if (var18 == 5) { + this.motionZ = var21; + } + } + + return false; + } + + /** + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean p_70031_1_) { + super.setSprinting(p_70031_1_); + this.sprintingTicksLeft = p_70031_1_ ? 600 : 0; + } + + /** + * Sets the current XP, total XP, and level number. + */ + public void setXPStats(float p_71152_1_, int p_71152_2_, int p_71152_3_) { + this.experience = p_71152_1_; + this.experienceTotal = p_71152_2_; + this.experienceLevel = p_71152_3_; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent p_145747_1_) { + this.mc.ingameGUI.getChatGUI().func_146227_a(p_145747_1_); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_) { + return p_70003_1_ <= 0; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); + } + + public void playSound(String p_85030_1_, float p_85030_2_, float p_85030_3_) { + this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, p_85030_1_, p_85030_2_, p_85030_3_, false); + } + + /** + * Returns whether the entity is in a local (com.cheatbreaker.client) world + */ + public boolean isClientWorld() { + return true; + } + + public boolean isRidingHorse() { + return this.ridingEntity != null && this.ridingEntity instanceof EntityHorse; + } + + public float getHorseJumpPower() { + return this.horseJumpPower; + } + + protected void func_110318_g() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ChatLine.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ChatLine.java new file mode 100644 index 0000000..46daa83 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ChatLine.java @@ -0,0 +1,33 @@ +package net.minecraft.client.gui; + +import net.minecraft.util.IChatComponent; + +public class ChatLine { + /** GUI Update Counter value this Line was created at */ + private final int updateCounterCreated; + private final IChatComponent lineString; + + /** + * int value to refer to existing Chat Lines, can be 0 which means unreferrable + */ + private final int chatLineID; + + + public ChatLine(int p_i45000_1_, IChatComponent p_i45000_2_, int p_i45000_3_) { + this.lineString = p_i45000_2_; + this.updateCounterCreated = p_i45000_1_; + this.chatLineID = p_i45000_3_; + } + + public IChatComponent func_151461_a() { + return this.lineString; + } + + public int getUpdatedCounter() { + return this.updateCounterCreated; + } + + public int getChatLineID() { + return this.chatLineID; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/FontRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/FontRenderer.java new file mode 100644 index 0000000..334c65a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/FontRenderer.java @@ -0,0 +1,810 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.util.font.*; +import com.ibm.icu.text.ArabicShaping; +import com.ibm.icu.text.ArabicShapingException; +import com.ibm.icu.text.Bidi; +import me.tellinq.testing.font.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.CustomColorizer; +import net.minecraft.src.FontUtils; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; +import java.util.List; + +public class FontRenderer implements IResourceManagerReloadListener { + private static final ResourceLocation[] unicodePageLocations = new ResourceLocation[256]; + + /** Array of width of all the characters in default.png */ + private final float[] charWidth = new float[256]; + + /** the height in pixels of default text */ + public int FONT_HEIGHT = 9; + public Random fontRandom = new Random(); + + /** + * Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory. + */ + private final byte[] glyphWidth = new byte[65536]; + + /** + * Array of RGB triplets defining the 16 standard chat colors followed by 16 darker version of the same colors for + * drop shadows. + */ + public int[] colorCode = new int[32]; + private ResourceLocation locationFontTexture; + + /** The RenderEngine used to load and setup glyph textures. */ + private final TextureManager renderEngine; + + /** Current X coordinate at which to draw the next character. */ + private float posX; + + /** Current Y coordinate at which to draw the next character. */ + private float posY; + + /** + * If true, strings should be rendered with Unicode fonts instead of the default.png font + */ + private boolean unicodeFlag; + + /** + * If true, the Unicode Bidirectional Algorithm should be run before rendering any string. + */ + private boolean bidiFlag; + + /** Used to specify new red value for the current color. */ + private float red; + + /** Used to specify new blue value for the current color. */ + private float blue; + + /** Used to specify new green value for the current color. */ + private float green; + + /** Used to speify new alpha value for the current color. */ + private float alpha; + + /** Text color of the currently rendering string. */ + private int textColor; + + /** Set if the "k" style (random) is active in currently rendering string */ + private boolean randomStyle; + + /** Set if the "l" style (bold) is active in currently rendering string */ + private boolean boldStyle; + + /** Set if the "o" style (italic) is active in currently rendering string */ + private boolean italicStyle; + + /** + * Set if the "n" style (underlined) is active in currently rendering string + */ + private boolean underlineStyle; + + /** + * Set if the "m" style (strikethrough) is active in currently rendering string + */ + private boolean strikethroughStyle; + + public GameSettings gameSettings; + public ResourceLocation locationFontTextureBase; + public boolean enabled = true; + public float offsetBold = 1.0F; + private ResourceLocation resourceLocation; + private int var3; + private int IllIlIlIllllIlIIllllIIlll; + private boolean[] IllIIlIIlllllIllIIIlllIII; + private final TestClassTwo lIlIlIllIIIIIIIIllllIIllI = new TestClassTwo(); + private List IlllIIlllIIIIllIIllllIlIl; + private long IllllIllllIlIIIlIIIllllll; + + + public FontRenderer(GameSettings var1, ResourceLocation var2, TextureManager var3, boolean var4) { + this.gameSettings = var1; + this.locationFontTextureBase = var2; + this.locationFontTexture = var2; + this.renderEngine = var3; + this.unicodeFlag = var4; + this.locationFontTexture = FontUtils.getHdFontLocation(this.locationFontTextureBase); + for (int var5 = 0; var5 < 32; ++var5) { + Minecraft.getMinecraft().cbLoadingScreen.addPhase(); + int var6 = (var5 >> 3 & 1) * 85; + int var7 = (var5 >> 2 & 1) * 170 + var6; + int var8 = (var5 >> 1 & 1) * 170 + var6; + int var9 = (var5 >> 0 & 1) * 170 + var6; + if (var5 == 6) { + var7 += 85; + } + if (var1.anaglyph) { + int var10 = (var7 * 30 + var8 * 59 + var9 * 11) / 100; + int var11 = (var7 * 30 + var8 * 70) / 100; + int var12 = (var7 * 30 + var9 * 70) / 100; + var7 = var10; + var8 = var11; + var9 = var12; + } + if (var5 >= 16) { + var7 /= 4; + var8 /= 4; + var9 /= 4; + } + this.colorCode[var5] = (var7 & 0xFF) << 16 | (var8 & 0xFF) << 8 | var9 & 0xFF; + } + this.readGlyphSizes(); + } + + @Override + public void onResourceManagerReload(IResourceManager var1) { + this.lIlIlIllIIIIIIIIllllIIllI.clear(); + this.locationFontTexture = FontUtils.getHdFontLocation(this.locationFontTextureBase); + for (int var2 = 0; var2 < unicodePageLocations.length; ++var2) { + FontRenderer.unicodePageLocations[var2] = null; + } + this.readFontTexture(); + this.readGlyphSizes(); + } + + private void readFontTexture() { + BufferedImage var1; + try { + var1 = ImageIO.read(this.getResourceInputStream(this.locationFontTexture)); + } catch (IOException var22) { + throw new RuntimeException(var22); + } + Properties var2 = FontUtils.readFontProperties(this.locationFontTexture); + int var3 = var1.getWidth(); + int var4 = var1.getHeight(); + int var5 = var3 / 16; + int var6 = var4 / 16; + float var7 = (float)var3 / 128.0f; + float var8 = Config.limit(var7, 1.0f, 2.0f); + this.offsetBold = 1.0f / var8; + float var9 = FontUtils.readFloat(var2, "offsetBold", -1.0f); + if (var9 >= 0.0f) { + this.offsetBold = var9; + } + int[] var10 = new int[var3 * var4]; + var1.getRGB(0, 0, var3, var4, var10, 0, var3); + for (int var11 = 0; var11 < 256; ++var11) { + int var15; + int var12 = var11 % 16; + int var13 = var11 / 16; + boolean var14 = false; + for (var15 = var5 - 1; var15 >= 0; --var15) { + int var16 = var12 * var5 + var15; + boolean var17 = true; + for (int var18 = 0; var18 < var6 && var17; ++var18) { + int var19 = (var13 * var6 + var18) * var3; + int var20 = var10[var16 + var19]; + int var21 = var20 >> 24 & 0xFF; + if (var21 <= 16) continue; + var17 = false; + } + if (!var17) break; + } + if (var11 == 65) { + // empty if block + } + if (var11 == 32) { + var15 = var5 <= 8 ? (int)(2.0f * var7) : (int)(1.5f * var7); + } + this.charWidth[var11] = (float)(var15 + 1) / var7 + 1.0f; + } + FontUtils.readCustomCharWidths(var2, this.charWidth); + } + + private void readGlyphSizes() { + try { + InputStream var1 = this.getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); + var1.read(this.glyphWidth); + } catch (IOException var2) { + throw new RuntimeException(var2); + } + } + + private float renderCharAtPos(int var1, char var2, boolean var3) { + if (var2 == ' ') { + this.IllIIIIIIIlIlIllllIIllIII(); + return !this.unicodeFlag ? this.charWidth[var2] : 4.0f; + } + int i = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(var2); + return i != -1 && !this.unicodeFlag ? this.renderDefaultChar(var1, var3) : this.renderUnicodeChar(var2, var3); + } + + private float renderDefaultChar(int var1, boolean var2) { + if (this.resourceLocation == null && !this.IllIIlIIlllllIllIIIlllIII[this.var3]) { + this.resourceLocation = this.locationFontTexture; + if (!Tessellator.instance.isDrawing) { + int var3 = GL11.glGenLists(1); + this.IlllIIlllIIIIllIIllllIlIl.add(new TestClassOne(var3, this.resourceLocation)); + GL11.glNewList(var3, 4864); + Tessellator.instance.startDrawingQuads(); + } + } + if (this.resourceLocation == this.locationFontTexture) { + float var7 = var1 % 16 * 8; + float var4 = var1 / 16 * 8; + float var5 = var2 ? 1.0f : 0.0f; + float var6 = 7.99f; + this.lIIIIllIIlIlIllIIIlIllIlI(); + Tessellator.instance.setTextureUV(var7 / 128.0f, var4 / 128.0f); + Tessellator.instance.addVertex(this.posX + var5, this.posY, 0.0); + Tessellator.instance.setTextureUV(var7 / 128.0f, (var4 + 7.99f) / 128.0f); + Tessellator.instance.addVertex(this.posX - var5, this.posY + 7.99f, 0.0); + Tessellator.instance.setTextureUV((var7 + var6 - 1.0f) / 128.0f, (var4 + 7.99f) / 128.0f); + Tessellator.instance.addVertex(this.posX + var6 - 1.0f - var5, this.posY + 7.99f, 0.0); + Tessellator.instance.setTextureUV((var7 + var6 - 1.0f) / 128.0f, var4 / 128.0f); + Tessellator.instance.addVertex(this.posX + var6 - 1.0f + var5, this.posY, 0.0); + this.IllIIIIIIIlIlIllllIIllIII(); + } + return this.charWidth[var1]; + } + + private ResourceLocation getUnicodePageLocation(int var1) { + if (unicodePageLocations[var1] == null) { + FontRenderer.unicodePageLocations[var1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", var1)); + FontRenderer.unicodePageLocations[var1] = FontUtils.getHdFontLocation(unicodePageLocations[var1]); + } + return unicodePageLocations[var1]; + } + + private float renderUnicodeChar(char var1, boolean var2) { + if (this.glyphWidth[var1] == 0) { + this.IllIIIIIIIlIlIllllIIllIII(); + return 0.0f; + } + ResourceLocation var3 = this.getUnicodePageLocation(var1 / 256); + int var4 = this.glyphWidth[var1] >>> 4; + int var5 = this.glyphWidth[var1] & 0xF; + float var6 = var4 &= 0xF; + float var7 = var5 + 1; + if (this.resourceLocation == null && !this.IllIIlIIlllllIllIIIlllIII[this.var3]) { + this.resourceLocation = var3; + if (!Tessellator.instance.isDrawing) { + int var8 = GL11.glGenLists(1); + this.IlllIIlllIIIIllIIllllIlIl.add(new TestClassOne(var8, this.resourceLocation)); + GL11.glNewList(var8, 4864); + Tessellator.instance.startDrawingQuads(); + } + } + if (this.resourceLocation == var3) { + float var12 = (float)(var1 % 16 * 16) + var6; + float var9 = (var1 & 0xFF) / 16 * 16; + float var10 = var7 - var6 - 0.02f; + float var11 = var2 ? 1.0f : 0.0f; + this.lIIIIllIIlIlIllIIIlIllIlI(); + Tessellator.instance.setTextureUV(var12 / 256.0f, var9 / 256.0f); + Tessellator.instance.addVertex(this.posX + var11, this.posY, 0.0); + Tessellator.instance.setTextureUV(var12 / 256.0f, (var9 + 15.98f) / 256.0f); + Tessellator.instance.addVertex(this.posX - var11, this.posY + 7.99f, 0.0); + Tessellator.instance.setTextureUV((var12 + var10) / 256.0f, (var9 + 15.98f) / 256.0f); + Tessellator.instance.addVertex(this.posX + var10 / 2.0f - var11, this.posY + 7.99f, 0.0); + Tessellator.instance.setTextureUV((var12 + var10) / 256.0f, var9 / 256.0f); + Tessellator.instance.addVertex(this.posX + var10 / 2.0f + var11, this.posY, 0.0); + this.IllIIIIIIIlIlIllllIIllIII(); + } + return (var7 - var6) / 2.0f + 1.0f; + } + + public int drawStringWithShadow(String var1, float var2, float var3, int var4) { + return this.drawString(var1, var2, var3, var4, true); + } + + public int drawCenteredStringWithShadow(String var1, int var2, int var3, int var4) { + int var5 = this.getStringWidth(var1); + return this.drawString(var1, var2 - var5 / 2, var3, var4, true); + } + + public int drawCenteredStringWithShadow(String var1, float var2, float var3, int var4) { + int var5 = this.getStringWidth(var1); + return this.drawString(var1, var2 - (float)(var5 / 2), var3, var4, false); + } + + public int drawString(String var1, int var2, int var3, int var4) { + return !this.enabled ? 0 : this.drawString(var1, var2, var3, var4, false); + } + + public int drawString(String text, float x, float y, int color, boolean dropShadow) { +// GL11.glEnable(GL11.GL_BLEND); + + this.enableAlpha(); + this.resetStyles(); + int i; + if (dropShadow) { + i = this.renderString(text, x + 1.0f, y + 1.0f, color, true); + i = Math.max(i, this.renderString(text, x, y, color, false)); + } else { + i = this.renderString(text, x, y, color, false); + } + return i; + } + + public void drawChromaString(String text, float xIn, float y) { + float x = xIn; + for (char textChar : text.toCharArray()) { + long l = System.currentTimeMillis() - (long)(x * 50.0f - y * 50.0f); + int i = Color.HSBtoRGB((float)(l % 10000L) / 10000.0f, 1.0f, 1.0f); + String tmp = String.valueOf(textChar); + this.drawString(tmp, x, y, i, true); + x += (float)((int)((float)this.getCharWidth(textChar) * 1.0f)); + } + } + + private String func_147647_b(String var1) { + try { + Bidi var2 = new Bidi(new ArabicShaping(8).shape(var1), 127); + var2.setReorderingMode(0); + return var2.writeReordered(2); + } catch (ArabicShapingException var3) { + return var1; + } + } + + private void resetStyles() { + this.randomStyle = false; + this.boldStyle = false; + this.italicStyle = false; + this.underlineStyle = false; + this.strikethroughStyle = false; + } + + private void renderStringAtPos(String p_78255_1_, boolean p_78255_2_, int var3) { + TestClassSix var4 = this.lIlIlIllIIIIIIIIllllIIllI.lIIIIlIIllIIlIIlIIIlIIllI(p_78255_1_, var3, p_78255_2_); + + if (var4 != null) { + var4.lIIIIlIIllIIlIIlIIIlIIllI(this.IllllIllllIlIIIlIIIllllll); + GL11.glPushMatrix(); + GL11.glTranslatef(this.posX, this.posY, 0.0f); + var4.lIIIIlIIllIIlIIlIIIlIIllI(); + GL11.glPopMatrix(); + this.posX += var4.IlllIIIlIlllIllIlIIlllIlI(); + } else { + float var5 = this.posX; + float var6 = this.posY; + this.posX = 0.0f; + this.posY = 0.0f; + this.IlllIIlllIIIIllIIllllIlIl = new ArrayList(); + this.IllIIlIIlllllIllIIIlllIII = new boolean[p_78255_1_.length()]; + this.IllIlIlIllllIlIIllllIIlll = p_78255_1_.length(); + boolean var7 = false; + while (this.IllIlIlIllllIlIIllllIIlll >= 0) { + if (this.IllIlIlIllllIlIIllllIIlll == 0) { + this.IllIlIlIllllIlIIllllIIlll = -1; + } + this.posX = 0.0f; + this.resourceLocation = null; + this.textColor = -1; + this.resetStyles(); + this.var3 = 0; + while (this.var3 < p_78255_1_.length()) { + int var10; + int var9; + char var8 = p_78255_1_.charAt(this.var3); + if (var8 == '§' && this.var3 + 1 < p_78255_1_.length()) { + var9 = "0123456789abcdefklmnor".indexOf(Character.toLowerCase(p_78255_1_.charAt(this.var3 + 1))); + if (var9 < 16) { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; + this.underlineStyle = false; + this.italicStyle = false; + if (var9 < 0 || var9 > 15) { + var9 = 15; + } + if (p_78255_2_) { + var9 += 16; + } + var10 = this.colorCode[var9]; + if (Config.isCustomColors()) { + var10 = CustomColorizer.getTextColor(var9, var10); + } + this.textColor = var10; + } else if (var9 == 16) { + this.randomStyle = true; + var7 = true; + } else if (var9 == 17) { + this.boldStyle = true; + } else if (var9 == 18) { + this.strikethroughStyle = true; + } else if (var9 == 19) { + this.underlineStyle = true; + } else if (var9 == 20) { + this.italicStyle = true; + } else if (var9 == 21) { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; + this.underlineStyle = false; + this.italicStyle = false; + this.textColor = -1; + } + this.IllIIIIIIIlIlIllllIIllIII(); + ++this.var3; + this.IllIIIIIIIlIlIllllIIllIII(); + } else { + boolean var12; + var9 = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(var8); + if (this.randomStyle && var9 != -1) { + while ((int)this.charWidth[var9] != (int)this.charWidth[var10 = this.fontRandom.nextInt(this.charWidth.length)]) { + } + var9 = var10; + } + float var11 = var9 != -1 && !this.unicodeFlag ? this.offsetBold : 0.5f; + boolean bl = var12 = (var8 == '\u0000' || var9 == -1 || this.unicodeFlag) && p_78255_2_; + if (var12) { + this.posX -= var11; + this.posY -= var11; + } + float var13 = this.renderCharAtPos(var9, var8, this.italicStyle); + if (var12) { + this.posX += var11; + this.posY += var11; + } + if (this.boldStyle) { + this.posX += var11; + if (var12) { + this.posX -= var11; + this.posY -= var11; + } + this.renderCharAtPos(var9, var8, this.italicStyle); + this.posX -= var11; + if (var12) { + this.posX += var11; + this.posY += var11; + } + var13 += var11; + } + if (this.IllIlIlIllllIlIIllllIIlll == -1 && (this.strikethroughStyle || this.underlineStyle)) { + if (!Tessellator.instance.isDrawing) { + int var14 = GL11.glGenLists(1); + this.IlllIIlllIIIIllIIllllIlIl.add(new TestClassOne(var14, null)); + GL11.glNewList(var14, 4864); + Tessellator.instance.startDrawingQuads(); + } + this.lIIIIllIIlIlIllIIIlIllIlI(); + if (this.strikethroughStyle) { + Tessellator.instance.addVertex(this.posX, this.posY + (float)(this.FONT_HEIGHT / 2), 0.0); + Tessellator.instance.addVertex(this.posX + var13, this.posY + (float)(this.FONT_HEIGHT / 2), 0.0); + Tessellator.instance.addVertex(this.posX + var13, this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0f, 0.0); + Tessellator.instance.addVertex(this.posX, this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0f, 0.0); + } + if (this.underlineStyle) { + Tessellator.instance.addVertex(this.posX - 1.0f, this.posY + (float)this.FONT_HEIGHT, 0.0); + Tessellator.instance.addVertex(this.posX + var13, this.posY + (float)this.FONT_HEIGHT, 0.0); + Tessellator.instance.addVertex(this.posX + var13, this.posY + (float)this.FONT_HEIGHT - 1.0f, 0.0); + Tessellator.instance.addVertex(this.posX - 1.0f, this.posY + (float)this.FONT_HEIGHT - 1.0f, 0.0); + } + } + this.posX += var13; + } + ++this.var3; + } + if (!Tessellator.instance.isDrawing) continue; + Tessellator.instance.draw(); + GL11.glEndList(); + } + var4 = new TestClassSix(this.IlllIIlllIIIIllIIllllIlIl, this.posX, this.IllllIllllIlIIIlIIIllllll, var7); + this.lIlIlIllIIIIIIIIllllIIllI.put(new TestClassThree(p_78255_1_, var3, p_78255_2_), var4); + GL11.glPushMatrix(); + GL11.glTranslatef(var5, var6, 0.0f); + var4.lIIIIlIIllIIlIIlIIIlIIllI(); + GL11.glPopMatrix(); + this.IlllIIlllIIIIllIIllllIlIl = null; + this.posX += var5; + } + } + + private void IllIIIIIIIlIlIllllIIllIII() { + if (!this.IllIIlIIlllllIllIIIlllIII[this.var3]) { + this.IllIIlIIlllllIllIIIlllIII[this.var3] = true; + --this.IllIlIlIllllIlIIllllIIlll; + } + } + + private void lIIIIllIIlIlIllIIIlIllIlI() { + if (this.textColor == -1) { + Tessellator.instance.setColorRGBA_F(this.red, this.blue, this.green, this.alpha); + } else { + Tessellator.instance.setColorRGBA_F((float)(this.textColor >> 16) / 255.0f, (float)(this.textColor >> 8 & 0xFF) / 255.0f, (float)(this.textColor & 0xFF) / 255.0f, this.alpha); + } + } + + private int renderStringAligned(String text, int x, int y, int p_78274_4_, int color, boolean dropShadow) { + if (this.bidiFlag) { + int i = this.getStringWidth(this.func_147647_b(text)); + x = x + p_78274_4_ - i; + } + return this.renderString(text, x, y, color, dropShadow); + } + + private int renderString(String text, float x, float y, int color, boolean dropShadow) { + if (text == null) { + return 0; + } + if (this.bidiFlag) { + text = this.func_147647_b(text); + } + if ((color & 0xFC000000) == 0) { + color |= 0xFF000000; + } + if (dropShadow) { + color = (color & 0xFCFCFC) >> 2 | color & 0xFF000000; + } + this.red = (float)(color >> 16 & 0xFF) / 255.0f; + this.blue = (float)(color >> 8 & 0xFF) / 255.0f; + this.green = (float)(color & 0xFF) / 255.0f; + this.alpha = (float)(color >> 24 & 0xFF) / 255.0f; + this.posX = x; + this.posY = y; + this.renderStringAtPos(text, dropShadow, color); + return (int)this.posX; + } + + public int getStringWidth(String text) { + if (text == null) { + return 0; + } + float f = 0.0f; + boolean flag = false; + for (int i = 0; i < text.length(); ++i) { + char var5 = text.charAt(i); + float var6 = this.getCharWidthFloat(var5); + if (var6 < 0.0f && i < text.length() - 1) { + if ((var5 = text.charAt(++i)) != 'l' && var5 != 'L') { + if (var5 == 'r' || var5 == 'R') { + flag = false; + } + } else { + flag = true; + } + var6 = 0.0f; + } + f += var6; + if (!flag || !(var6 > 0.0f)) continue; + f += this.unicodeFlag ? 1.0f : this.offsetBold; + } + return (int)f; + } + + public int getCharWidth(char var1) { + return Math.round(this.getCharWidthFloat(var1)); + } + + private float getCharWidthFloat(char p_getCharWidthFloat_1_) { + if (p_getCharWidthFloat_1_ == 167) { + return -1.0F; + } else if (p_getCharWidthFloat_1_ == 32) { + return this.charWidth[32]; + } else { + int i = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(p_getCharWidthFloat_1_); + + if (p_getCharWidthFloat_1_ > 0 && i != -1 && !this.unicodeFlag) { + return this.charWidth[i]; + } else if (this.glyphWidth[p_getCharWidthFloat_1_] != 0) { + int j = this.glyphWidth[p_getCharWidthFloat_1_] >>> 4; + int k = this.glyphWidth[p_getCharWidthFloat_1_] & 15; + j = j & 15; + ++k; + return (float) ((k - j) / 2 + 1); + } else { + return 0.0F; + } + } + } + + public String trimStringToWidth(String var1, int var2) { + return this.trimStringToWidth(var1, var2, false); + } + + public String trimStringToWidth(String var1, int var2, boolean var3) { + StringBuilder var4 = new StringBuilder(); + float var5 = 0.0f; + int var6 = var3 ? var1.length() - 1 : 0; + int var7 = var3 ? -1 : 1; + boolean var8 = false; + boolean var9 = false; + for (int var10 = var6; var10 >= 0 && var10 < var1.length() && var5 < (float)var2; var10 += var7) { + char var11 = var1.charAt(var10); + float var12 = this.getCharWidthFloat(var11); + if (var8) { + var8 = false; + if (var11 != 'l' && var11 != 'L') { + if (var11 == 'r' || var11 == 'R') { + var9 = false; + } + } else { + var9 = true; + } + } else if (var12 < 0.0f) { + var8 = true; + } else { + var5 += var12; + if (var9) { + var5 += 1.0f; + } + } + if (var5 > (float)var2) break; + if (var3) { + var4.insert(0, var11); + continue; + } + var4.append(var11); + } + return var4.toString(); + } + + private String trimStringNewline(String var1) { + while (var1 != null && var1.endsWith("\n")) { + var1 = var1.substring(0, var1.length() - 1); + } + return var1; + } + + public void drawSplitString(String var1, int var2, int var3, int var4, int var5) { + this.resetStyles(); + this.textColor = var5; + var1 = this.trimStringNewline(var1); + this.renderSplitString(var1, var2, var3, var4, false); + } + + private void renderSplitString(String var1, int var2, int var3, int var4, boolean var5) { + List var6 = this.listFormattedStringToWidth(var1, var4); + for (Object var8 : var6) { + this.renderStringAligned((String) var8, var2, var3, var4, this.textColor, var5); + var3 += this.FONT_HEIGHT; + } + } + + public int splitStringWidth(String var1, int var2) { + return this.FONT_HEIGHT * this.listFormattedStringToWidth(var1, var2).size(); + } + + public void setUnicodeFlag(boolean var1) { + this.unicodeFlag = var1; + } + + public boolean getUnicodeFlag() { + return this.unicodeFlag; + } + + public void setBidiFlag(boolean var1) { + this.bidiFlag = var1; + } + + public List listFormattedStringToWidth(String var1, int var2) { + return Arrays.asList(this.wrapFormattedStringToWidth(var1, var2).split("\n")); + } + + String wrapFormattedStringToWidth(String var1, int var2) { + int var3 = this.sizeStringToWidth(var1, var2); + if (var1.length() <= var3) { + return var1; + } + String var4 = var1.substring(0, var3); + char var5 = var1.charAt(var3); + boolean var6 = var5 == ' ' || var5 == '\n'; + String var7 = FontRenderer.getFormatFromString(var4) + var1.substring(var3 + (var6 ? 1 : 0)); + return var4 + "\n" + this.wrapFormattedStringToWidth(var7, var2); + } + + private int sizeStringToWidth(String var1, int var2) { + int var5; + int var3 = var1.length(); + float var4 = 0.0f; + int var6 = -1; + boolean var7 = false; + for (var5 = 0; var5 < var3; ++var5) { + char var8 = var1.charAt(var5); + switch (var8) { + case '\n': { + --var5; + break; + } + case ' ': { + var6 = var5; + } + default: { + var4 += this.getCharWidthFloat(var8); + if (!var7) break; + var4 += 1.0f; + break; + } + case '§': { + char var9; + if (var5 >= var3 - 1) break; + if ((var9 = var1.charAt(++var5)) != 'l' && var9 != 'L') { + if (var9 != 'r' && var9 != 'R' && !FontRenderer.isFormatColor(var9)) break; + var7 = false; + break; + } + var7 = true; + } + } + if (var8 == '\n') { + var6 = ++var5; + break; + } + if (var4 > (float)var2) break; + } + return var5 != var3 && var6 != -1 && var6 < var5 ? var6 : var5; + } + + /** + * Checks if the char code is a hexadecimal character, used to set colour. + */ + private static boolean isFormatColor(char var0) { + return var0 >= '0' && var0 <= '9' || var0 >= 'a' && var0 <= 'f' || var0 >= 'A' && var0 <= 'F'; + } + + /** + * Checks if the char code is O-K...lLrRk-o... used to set special formatting. + */ + private static boolean isFormatSpecial(char var0) { + return var0 >= 'k' && var0 <= 'o' || var0 >= 'K' && var0 <= 'O' || var0 == 'r' || var0 == 'R'; + } + + /** + * Digests a string for nonprinting formatting characters then returns a string containing only that formatting. + */ + private static String getFormatFromString(String var0) { + String var1 = ""; + int var2 = -1; + int var3 = var0.length(); + while ((var2 = var0.indexOf(167, var2 + 1)) != -1) { + if (var2 >= var3 - 1) continue; + char var4 = var0.charAt(var2 + 1); + if (FontRenderer.isFormatColor(var4)) { + var1 = "§" + var4; + continue; + } + if (!FontRenderer.isFormatSpecial(var4)) continue; + var1 = var1 + "§" + var4; + } + return var1; + } + + public boolean getBidiFlag() { + return this.bidiFlag; + } + + protected void enableAlpha() { + GL11.glEnable(3008); + } + + protected InputStream getResourceInputStream(ResourceLocation var1) throws IOException { + return Minecraft.getMinecraft().getResourceManager().getResource(var1).getInputStream(); + } + + public void IIIIllIlIIIllIlllIlllllIl() { + int var1 = 10; + long var2 = this.IllllIllllIlIIIlIIIllllll - (long)(20 * var1); + ITestClassFive var4 = this.lIlIlIllIIIIIIIIllllIIllI.IlllIIIlIlllIllIlIIlllIlI().lIIIIlIIllIIlIIlIIIlIIllI(); + while (true) { + if (!var4.hasNext()) { + if (this.IllllIllllIlIIIlIIIllllll % 50L == 0L) { + this.lIlIlIllIIIIIIIIllllIIllI.lIIIIllIIlIlIllIIIlIllIlI(); + } + ++this.IllllIllllIlIIIlIIIllllll; + return; + } + TestClassSix var5 = (TestClassSix)var4.next(); + if (!var5.IIIIllIIllIIIIllIllIIIlIl() && var5.IIIIllIlIIIllIlllIlllllIl() >= var2) continue; + var5.lIIIIIIIIIlIllIIllIlIIlIl(); + var4.remove(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/FontRenderer.~ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/FontRenderer.~ new file mode 100644 index 0000000..7d77f60 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/FontRenderer.~ @@ -0,0 +1,710 @@ +package net.minecraft.client.gui; + +import com.ibm.icu.text.ArabicShaping; +import com.ibm.icu.text.ArabicShapingException; +import com.ibm.icu.text.Bidi; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import java.util.Random; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.CustomColorizer; +import net.minecraft.src.FontUtils; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class FontRenderer implements IResourceManagerReloadListener { + + private static final ResourceLocation[] field_111274_c = new ResourceLocation[256]; + private float[] field_78286_d = new float[256]; + public int field_78288_b = 9; + public Random field_78289_c = new Random(); + private byte[] field_78287_e = new byte[65536]; + private int[] field_78285_g = new int[32]; + private ResourceLocation field_111273_g; + private final TextureManager field_78298_i; + private float field_78295_j; + private float field_78296_k; + private boolean field_78293_l; + private boolean field_78294_m; + private float field_78291_n; + private float field_78292_o; + private float field_78306_p; + private float field_78305_q; + private int field_78304_r; + private boolean field_78303_s; + private boolean field_78302_t; + private boolean field_78301_u; + private boolean field_78300_v; + private boolean field_78299_w; + private static final String __OBFID = "CL_00000660"; + public GameSettings gameSettings; + public ResourceLocation locationFontTextureBase; + public boolean enabled = true; + public float offsetBold = 1.0F; + private static final String __OBFID = "CL_00000660"; + + public FontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4) { + this.gameSettings = par1GameSettings; + this.locationFontTextureBase = par2ResourceLocation; + this.field_111273_g = par2ResourceLocation; + this.field_78298_i = par3TextureManager; + this.field_78293_l = par4; + this.field_111273_g = FontUtils.getHdFontLocation(this.locationFontTextureBase); + this.bindTexture(this.field_111273_g); + + for(int var5 = 0; var5 < 32; ++var5) { + int var6 = (var5 >> 3 & 1) * 85; + int var7 = (var5 >> 2 & 1) * 170 + var6; + int var8 = (var5 >> 1 & 1) * 170 + var6; + int var9 = (var5 >> 0 & 1) * 170 + var6; + if(var5 == 6) { + var7 += 85; + } + + if(par1GameSettings.field_74337_g) { + int var10 = (var7 * 30 + var8 * 59 + var9 * 11) / 100; + int var11 = (var7 * 30 + var8 * 70) / 100; + int var12 = (var7 * 30 + var9 * 70) / 100; + var7 = var10; + var8 = var11; + var9 = var12; + } + + if(var5 >= 16) { + var7 /= 4; + var8 /= 4; + var9 /= 4; + } + + this.field_78285_g[var5] = (var7 & 255) << 16 | (var8 & 255) << 8 | var9 & 255; + } + + this.func_98306_d(); + } + + public void func_110549_a(IResourceManager par1ResourceManager) { + this.field_111273_g = FontUtils.getHdFontLocation(this.locationFontTextureBase); + + for(int i = 0; i < field_111274_c.length; ++i) { + field_111274_c[i] = null; + } + + this.func_111272_d(); + this.func_98306_d(); + } + + private void func_111272_d() { + BufferedImage bufferedimage; + try { + bufferedimage = ImageIO.read(this.getResourceInputStream(this.field_111273_g)); + } catch (IOException var21) { + throw new RuntimeException(var21); + } + + Properties props = FontUtils.readFontProperties(this.field_111273_g); + int imgWidth = bufferedimage.getWidth(); + int imgHeight = bufferedimage.getHeight(); + int charW = imgWidth / 16; + int charH = imgHeight / 16; + float kx = (float)imgWidth / 128.0F; + float boldScaleFactor = Config.limit(kx, 1.0F, 2.0F); + this.offsetBold = 1.0F / boldScaleFactor; + float offsetBoldConfig = FontUtils.readFloat(props, "offsetBold", -1.0F); + if(offsetBoldConfig >= 0.0F) { + this.offsetBold = offsetBoldConfig; + } + + int[] ai = new int[imgWidth * imgHeight]; + bufferedimage.getRGB(0, 0, imgWidth, imgHeight, ai, 0, imgWidth); + int k = 0; + + while(k < 256) { + int cx = k % 16; + int cy = k / 16; + boolean px = false; + int var22 = charW - 1; + + while(true) { + if(var22 >= 0) { + int x = cx * charW + var22; + boolean flag = true; + + for(int py = 0; py < charH && flag; ++py) { + int ypos = (cy * charH + py) * imgWidth; + int col = ai[x + ypos]; + int al = col >> 24 & 255; + if(al > 16) { + flag = false; + } + } + + if(flag) { + --var22; + continue; + } + } + + if(k == 65) { + k = k; + } + + if(k == 32) { + if(charW <= 8) { + var22 = (int)(2.0F * kx); + } else { + var22 = (int)(1.5F * kx); + } + } + + this.field_78286_d[k] = (float)(var22 + 1) / kx + 1.0F; + ++k; + break; + } + } + + FontUtils.readCustomCharWidths(props, this.field_78286_d); + } + + private void func_98306_d() { + try { + InputStream var2 = this.getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); + var2.read(this.field_78287_e); + } catch (IOException var21) { + throw new RuntimeException(var21); + } + } + + private float func_78278_a(int par1, char par2, boolean par3) { + return par2 == 32?(!this.field_78293_l?this.field_78286_d[par2]:4.0F):(par2 == 32?4.0F:("\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(par2) != -1 && !this.field_78293_l?this.func_78266_a(par1, par3):this.func_78277_a(par2, par3))); + } + + private float func_78266_a(int par1, boolean par2) { + float var3 = (float)(par1 % 16 * 8); + float var4 = (float)(par1 / 16 * 8); + float var5 = par2?1.0F:0.0F; + this.bindTexture(this.field_111273_g); + float var6 = 7.99F; + GL11.glBegin(5); + GL11.glTexCoord2f(var3 / 128.0F, var4 / 128.0F); + GL11.glVertex3f(this.field_78295_j + var5, this.field_78296_k, 0.0F); + GL11.glTexCoord2f(var3 / 128.0F, (var4 + 7.99F) / 128.0F); + GL11.glVertex3f(this.field_78295_j - var5, this.field_78296_k + 7.99F, 0.0F); + GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, var4 / 128.0F); + GL11.glVertex3f(this.field_78295_j + var6 - 1.0F + var5, this.field_78296_k, 0.0F); + GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, (var4 + 7.99F) / 128.0F); + GL11.glVertex3f(this.field_78295_j + var6 - 1.0F - var5, this.field_78296_k + 7.99F, 0.0F); + GL11.glEnd(); + return this.field_78286_d[par1]; + } + + private ResourceLocation func_111271_a(int par1) { + if(field_111274_c[par1] == null) { + field_111274_c[par1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[]{Integer.valueOf(par1)})); + field_111274_c[par1] = FontUtils.getHdFontLocation(field_111274_c[par1]); + } + + return field_111274_c[par1]; + } + + private void func_78257_a(int par1) { + this.bindTexture(this.func_111271_a(par1)); + } + + private float func_78277_a(char par1, boolean par2) { + if(this.field_78287_e[par1] == 0) { + return 0.0F; + } else { + int var3 = par1 / 256; + this.func_78257_a(var3); + int var4 = this.field_78287_e[par1] >>> 4; + int var5 = this.field_78287_e[par1] & 15; + var4 &= 15; + float var6 = (float)var4; + float var7 = (float)(var5 + 1); + float var8 = (float)(par1 % 16 * 16) + var6; + float var9 = (float)((par1 & 255) / 16 * 16); + float var10 = var7 - var6 - 0.02F; + float var11 = par2?1.0F:0.0F; + GL11.glBegin(5); + GL11.glTexCoord2f(var8 / 256.0F, var9 / 256.0F); + GL11.glVertex3f(this.field_78295_j + var11, this.field_78296_k, 0.0F); + GL11.glTexCoord2f(var8 / 256.0F, (var9 + 15.98F) / 256.0F); + GL11.glVertex3f(this.field_78295_j - var11, this.field_78296_k + 7.99F, 0.0F); + GL11.glTexCoord2f((var8 + var10) / 256.0F, var9 / 256.0F); + GL11.glVertex3f(this.field_78295_j + var10 / 2.0F + var11, this.field_78296_k, 0.0F); + GL11.glTexCoord2f((var8 + var10) / 256.0F, (var9 + 15.98F) / 256.0F); + GL11.glVertex3f(this.field_78295_j + var10 / 2.0F - var11, this.field_78296_k + 7.99F, 0.0F); + GL11.glEnd(); + return (var7 - var6) / 2.0F + 1.0F; + } + } + + public int func_78261_a(String par1Str, int par2, int par3, int par4) { + return this.func_85187_a(par1Str, par2, par3, par4, true); + } + + public int func_78276_b(String par1Str, int par2, int par3, int par4) { + return !this.enabled?0:this.func_85187_a(par1Str, par2, par3, par4, false); + } + + public int func_85187_a(String par1Str, int par2, int par3, int par4, boolean par5) { + this.enableAlpha(); + this.func_78265_b(); + int var6; + if(par5) { + var6 = this.func_78258_a(par1Str, par2 + 1, par3 + 1, par4, true); + var6 = Math.max(var6, this.func_78258_a(par1Str, par2, par3, par4, false)); + } else { + var6 = this.func_78258_a(par1Str, par2, par3, par4, false); + } + + return var6; + } + + private String func_147647_b(String p_147647_1_) { + try { + Bidi var3 = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127); + var3.setReorderingMode(0); + return var3.writeReordered(2); + } catch (ArabicShapingException var31) { + return p_147647_1_; + } + } + + private void func_78265_b() { + this.field_78303_s = false; + this.field_78302_t = false; + this.field_78301_u = false; + this.field_78300_v = false; + this.field_78299_w = false; + } + + private void func_78255_a(String par1Str, boolean par2) { + for(int var3 = 0; var3 < par1Str.length(); ++var3) { + char var4 = par1Str.charAt(var3); + int var5; + int var6; + if(var4 == 167 && var3 + 1 < par1Str.length()) { + var5 = "0123456789abcdefklmnor".indexOf(par1Str.toLowerCase().charAt(var3 + 1)); + if(var5 < 16) { + this.field_78303_s = false; + this.field_78302_t = false; + this.field_78299_w = false; + this.field_78300_v = false; + this.field_78301_u = false; + if(var5 < 0 || var5 > 15) { + var5 = 15; + } + + if(par2) { + var5 += 16; + } + + var6 = this.field_78285_g[var5]; + if(Config.isCustomColors()) { + var6 = CustomColorizer.getTextColor(var5, var6); + } + + this.field_78304_r = var6; + this.setColor((float)(var6 >> 16) / 255.0F, (float)(var6 >> 8 & 255) / 255.0F, (float)(var6 & 255) / 255.0F, this.field_78305_q); + } else if(var5 == 16) { + this.field_78303_s = true; + } else if(var5 == 17) { + this.field_78302_t = true; + } else if(var5 == 18) { + this.field_78299_w = true; + } else if(var5 == 19) { + this.field_78300_v = true; + } else if(var5 == 20) { + this.field_78301_u = true; + } else if(var5 == 21) { + this.field_78303_s = false; + this.field_78302_t = false; + this.field_78299_w = false; + this.field_78300_v = false; + this.field_78301_u = false; + this.setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); + } + + ++var3; + } else { + var5 = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(var4); + if(this.field_78303_s && var5 != -1) { + do { + var6 = this.field_78289_c.nextInt(this.field_78286_d.length); + } while((int)this.field_78286_d[var5] != (int)this.field_78286_d[var6]); + + var5 = var6; + } + + float var11 = var5 != -1 && !this.field_78293_l?this.offsetBold:0.5F; + boolean var7 = (var4 == 0 || var5 == -1 || this.field_78293_l) && par2; + if(var7) { + this.field_78295_j -= var11; + this.field_78296_k -= var11; + } + + float var8 = this.func_78278_a(var5, var4, this.field_78301_u); + if(var7) { + this.field_78295_j += var11; + this.field_78296_k += var11; + } + + if(this.field_78302_t) { + this.field_78295_j += var11; + if(var7) { + this.field_78295_j -= var11; + this.field_78296_k -= var11; + } + + this.func_78278_a(var5, var4, this.field_78301_u); + this.field_78295_j -= var11; + if(var7) { + this.field_78295_j += var11; + this.field_78296_k += var11; + } + + var8 += var11; + } + + Tessellator var9; + if(this.field_78299_w) { + var9 = Tessellator.field_78398_a; + GL11.glDisable(3553); + var9.func_78382_b(); + var9.func_78377_a((double)this.field_78295_j, (double)(this.field_78296_k + (float)(this.field_78288_b / 2)), 0.0D); + var9.func_78377_a((double)(this.field_78295_j + var8), (double)(this.field_78296_k + (float)(this.field_78288_b / 2)), 0.0D); + var9.func_78377_a((double)(this.field_78295_j + var8), (double)(this.field_78296_k + (float)(this.field_78288_b / 2) - 1.0F), 0.0D); + var9.func_78377_a((double)this.field_78295_j, (double)(this.field_78296_k + (float)(this.field_78288_b / 2) - 1.0F), 0.0D); + var9.func_78381_a(); + GL11.glEnable(3553); + } + + if(this.field_78300_v) { + var9 = Tessellator.field_78398_a; + GL11.glDisable(3553); + var9.func_78382_b(); + int var10 = this.field_78300_v?-1:0; + var9.func_78377_a((double)(this.field_78295_j + (float)var10), (double)(this.field_78296_k + (float)this.field_78288_b), 0.0D); + var9.func_78377_a((double)(this.field_78295_j + var8), (double)(this.field_78296_k + (float)this.field_78288_b), 0.0D); + var9.func_78377_a((double)(this.field_78295_j + var8), (double)(this.field_78296_k + (float)this.field_78288_b - 1.0F), 0.0D); + var9.func_78377_a((double)(this.field_78295_j + (float)var10), (double)(this.field_78296_k + (float)this.field_78288_b - 1.0F), 0.0D); + var9.func_78381_a(); + GL11.glEnable(3553); + } + + this.field_78295_j += var8; + } + } + + } + + private int func_78274_b(String par1Str, int par2, int par3, int par4, int par5, boolean par6) { + if(this.field_78294_m) { + int var7 = this.func_78256_a(this.func_147647_b(par1Str)); + par2 = par2 + par4 - var7; + } + + return this.func_78258_a(par1Str, par2, par3, par5, par6); + } + + private int func_78258_a(String par1Str, int par2, int par3, int par4, boolean par5) { + if(par1Str == null) { + return 0; + } else { + if(this.field_78294_m) { + par1Str = this.func_147647_b(par1Str); + } + + if((par4 & -67108864) == 0) { + par4 |= -16777216; + } + + if(par5) { + par4 = (par4 & 16579836) >> 2 | par4 & -16777216; + } + + this.field_78291_n = (float)(par4 >> 16 & 255) / 255.0F; + this.field_78292_o = (float)(par4 >> 8 & 255) / 255.0F; + this.field_78306_p = (float)(par4 & 255) / 255.0F; + this.field_78305_q = (float)(par4 >> 24 & 255) / 255.0F; + this.setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); + this.field_78295_j = (float)par2; + this.field_78296_k = (float)par3; + this.func_78255_a(par1Str, par5); + return (int)this.field_78295_j; + } + } + + public int func_78256_a(String par1Str) { + if(par1Str == null) { + return 0; + } else { + float var2 = 0.0F; + boolean var3 = false; + + for(int var4 = 0; var4 < par1Str.length(); ++var4) { + char var5 = par1Str.charAt(var4); + float var6 = this.getCharWidthFloat(var5); + if(var6 < 0.0F && var4 < par1Str.length() - 1) { + ++var4; + var5 = par1Str.charAt(var4); + if(var5 != 108 && var5 != 76) { + if(var5 == 114 || var5 == 82) { + var3 = false; + } + } else { + var3 = true; + } + + var6 = 0.0F; + } + + var2 += var6; + if(var3 && var6 > 0.0F) { + var2 += this.field_78293_l?1.0F:this.offsetBold; + } + } + + return (int)var2; + } + } + + public int func_78263_a(char par1) { + return Math.round(this.getCharWidthFloat(par1)); + } + + private float getCharWidthFloat(char par1) { + if(par1 == 167) { + return -1.0F; + } else if(par1 == 32) { + return this.field_78286_d[32]; + } else { + int var2 = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(par1); + if(par1 > 0 && var2 != -1 && !this.field_78293_l) { + return this.field_78286_d[var2]; + } else if(this.field_78287_e[par1] != 0) { + int var3 = this.field_78287_e[par1] >>> 4; + int var4 = this.field_78287_e[par1] & 15; + var3 &= 15; + ++var4; + return (float)((var4 - var3) / 2 + 1); + } else { + return 0.0F; + } + } + } + + public String func_78269_a(String par1Str, int par2) { + return this.func_78262_a(par1Str, par2, false); + } + + public String func_78262_a(String par1Str, int par2, boolean par3) { + StringBuilder var4 = new StringBuilder(); + float var5 = 0.0F; + int var6 = par3?par1Str.length() - 1:0; + int var7 = par3?-1:1; + boolean var8 = false; + boolean var9 = false; + + for(int var10 = var6; var10 >= 0 && var10 < par1Str.length() && var5 < (float)par2; var10 += var7) { + char var11 = par1Str.charAt(var10); + float var12 = this.getCharWidthFloat(var11); + if(var8) { + var8 = false; + if(var11 != 108 && var11 != 76) { + if(var11 == 114 || var11 == 82) { + var9 = false; + } + } else { + var9 = true; + } + } else if(var12 < 0.0F) { + var8 = true; + } else { + var5 += var12; + if(var9) { + ++var5; + } + } + + if(var5 > (float)par2) { + break; + } + + if(par3) { + var4.insert(0, var11); + } else { + var4.append(var11); + } + } + + return var4.toString(); + } + + private String func_78273_d(String par1Str) { + while(par1Str != null && par1Str.endsWith("\n")) { + par1Str = par1Str.substring(0, par1Str.length() - 1); + } + + return par1Str; + } + + public void func_78279_b(String par1Str, int par2, int par3, int par4, int par5) { + this.func_78265_b(); + this.field_78304_r = par5; + par1Str = this.func_78273_d(par1Str); + this.func_78268_b(par1Str, par2, par3, par4, false); + } + + private void func_78268_b(String par1Str, int par2, int par3, int par4, boolean par5) { + List var6 = this.func_78271_c(par1Str, par4); + + for(Iterator var7 = var6.iterator(); var7.hasNext(); par3 += this.field_78288_b) { + String var8 = (String)var7.next(); + this.func_78274_b(var8, par2, par3, par4, this.field_78304_r, par5); + } + + } + + public int func_78267_b(String par1Str, int par2) { + return this.field_78288_b * this.func_78271_c(par1Str, par2).size(); + } + + public void func_78264_a(boolean par1) { + this.field_78293_l = par1; + } + + public boolean func_82883_a() { + return this.field_78293_l; + } + + public void func_78275_b(boolean par1) { + this.field_78294_m = par1; + } + + public List func_78271_c(String par1Str, int par2) { + return Arrays.asList(this.func_78280_d(par1Str, par2).split("\n")); + } + + String func_78280_d(String par1Str, int par2) { + int var3 = this.func_78259_e(par1Str, par2); + if(par1Str.length() <= var3) { + return par1Str; + } else { + String var4 = par1Str.substring(0, var3); + char var5 = par1Str.charAt(var3); + boolean var6 = var5 == 32 || var5 == 10; + String var7 = func_78282_e(var4) + par1Str.substring(var3 + (var6?1:0)); + return var4 + "\n" + this.func_78280_d(var7, par2); + } + } + + private int func_78259_e(String par1Str, int par2) { + int var3 = par1Str.length(); + float var4 = 0.0F; + int var5 = 0; + int var6 = -1; + + for(boolean var7 = false; var5 < var3; ++var5) { + char var8 = par1Str.charAt(var5); + switch(var8) { + case 10: + --var5; + break; + case 32: + var6 = var5; + case 167: + if(var5 < var3 - 1) { + ++var5; + char var9 = par1Str.charAt(var5); + if(var9 != 108 && var9 != 76) { + if(var9 == 114 || var9 == 82 || func_78272_b(var9)) { + var7 = false; + } + } else { + var7 = true; + } + } + break; + default: + var4 += this.getCharWidthFloat(var8); + if(var7) { + ++var4; + } + } + + if(var8 == 10) { + ++var5; + var6 = var5; + break; + } + + if(var4 > (float)par2) { + break; + } + } + + return var5 != var3 && var6 != -1 && var6 < var5?var6:var5; + } + + private static boolean func_78272_b(char par0) { + return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70; + } + + private static boolean func_78270_c(char par0) { + return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82; + } + + private static String func_78282_e(String par0Str) { + String var1 = ""; + int var2 = -1; + int var3 = par0Str.length(); + + while((var2 = par0Str.indexOf(167, var2 + 1)) != -1) { + if(var2 < var3 - 1) { + char var4 = par0Str.charAt(var2 + 1); + if(func_78272_b(var4)) { + var1 = "\u00a7" + var4; + } else if(func_78270_c(var4)) { + var1 = var1 + "\u00a7" + var4; + } + } + } + + return var1; + } + + public boolean func_78260_a() { + return this.field_78294_m; + } + + protected void setColor(float r, float g, float b, float a) { + GL11.glColor4f(r, g, b, a); + } + + protected void enableAlpha() { + GL11.glEnable(3008); + } + + protected void bindTexture(ResourceLocation location) { + this.field_78298_i.func_110577_a(location); + } + + protected InputStream getResourceInputStream(ResourceLocation location) throws IOException { + return Minecraft.func_71410_x().func_110442_L().func_110536_a(location).func_110527_b(); + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/Gui.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/Gui.java new file mode 100644 index 0000000..68d0d68 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/Gui.java @@ -0,0 +1,194 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class Gui { + public static final ResourceLocation optionsBackground = new ResourceLocation("textures/gui/options_background.png"); + public static final ResourceLocation statIcons = new ResourceLocation("textures/gui/container/stats_icons.png"); + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + public static float zLevel; + + + protected void drawHorizontalLine(int p_73730_1_, int p_73730_2_, int p_73730_3_, int p_73730_4_) { + if (p_73730_2_ < p_73730_1_) { + int var5 = p_73730_1_; + p_73730_1_ = p_73730_2_; + p_73730_2_ = var5; + } + + drawRect(p_73730_1_, p_73730_3_, p_73730_2_ + 1, p_73730_3_ + 1, p_73730_4_); + } + + protected void drawVerticalLine(int p_73728_1_, int p_73728_2_, int p_73728_3_, int p_73728_4_) { + if (p_73728_3_ < p_73728_2_) { + int var5 = p_73728_2_; + p_73728_2_ = p_73728_3_; + p_73728_3_ = var5; + } + + drawRect(p_73728_1_, p_73728_2_ + 1, p_73728_1_ + 1, p_73728_3_, p_73728_4_); + } + + /** + * Draws a solid color rectangle with the specified coordinates and color. Args: x1, y1, x2, y2, color + */ + public static void drawRect(float p_73734_0_, float p_73734_1_, float p_73734_2_, float p_73734_3_, int p_73734_4_) { + float var5; + + if (p_73734_0_ < p_73734_2_) { + var5 = p_73734_0_; + p_73734_0_ = p_73734_2_; + p_73734_2_ = var5; + } + + if (p_73734_1_ < p_73734_3_) { + var5 = p_73734_1_; + p_73734_1_ = p_73734_3_; + p_73734_3_ = var5; + } + + float var10 = (float)(p_73734_4_ >> 24 & 255) / 255.0F; + float var6 = (float)(p_73734_4_ >> 16 & 255) / 255.0F; + float var7 = (float)(p_73734_4_ >> 8 & 255) / 255.0F; + float var8 = (float)(p_73734_4_ & 255) / 255.0F; + Tessellator var9 = Tessellator.instance; + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(var6, var7, var8, var10); + var9.startDrawingQuads(); + var9.addVertex(p_73734_0_, p_73734_3_, 0.0D); + var9.addVertex(p_73734_2_, p_73734_3_, 0.0D); + var9.addVertex(p_73734_2_, p_73734_1_, 0.0D); + var9.addVertex(p_73734_0_, p_73734_1_, 0.0D); + var9.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawRectWithOutline(float f, float f2, float f3, float f4, float f5, int n, int n2) { + Gui.drawRect(f + f5, f2 + f5, f3 - f5, f4 - f5, n2); + Gui.drawRect(f, f2 + f5, f + f5, f4 - f5, n); + Gui.drawRect(f3 - f5, f2 + f5, f3, f4 - f5, n); + Gui.drawRect(f, f2, f3, f2 + f5, n); + Gui.drawRect(f, f4 - f5, f3, f4, n); + } + + public static void drawBoxWithOutLine(float f, float f2, float f3, float f4, float f5, int n, int n2) { + Gui.drawRect(f, f2, f3, f4, n2); + Gui.drawRect(f - f5, f2 - f5, f, f4 + f5, n); + Gui.drawRect(f3, f2 - f5, f3 + f5, f4 + f5, n); + Gui.drawRect(f, f2 - f5, f3, f2, n); + Gui.drawRect(f, f4, f3, f4 + f5, n); + } + + /** + * Draws an outline + * This is mainly used in CheatBreaker mods. Not from MCP. + */ + public static void drawOutline(float x1, float y1, float x2, float y2, float thickness, int color) { + drawRect(x1, y1 + thickness, x1 + thickness, y2 - thickness, color); + drawRect(x2 - thickness, y1 + thickness, x2, y2 - thickness, color); + drawRect(x1, y1, x2, y1 + thickness, color); + drawRect(x1, y2 - thickness, x2, y2, color); + } + + /** + * Draws a rectangle with a vertical gradient between the specified colors. + */ + public static void drawGradientRect(float p_73733_1_, float p_73733_2_, float p_73733_3_, float p_73733_4_, int p_73733_5_, int p_73733_6_) { + float var7 = (float)(p_73733_5_ >> 24 & 255) / 255.0F; + float var8 = (float)(p_73733_5_ >> 16 & 255) / 255.0F; + float var9 = (float)(p_73733_5_ >> 8 & 255) / 255.0F; + float var10 = (float)(p_73733_5_ & 255) / 255.0F; + float var11 = (float)(p_73733_6_ >> 24 & 255) / 255.0F; + float var12 = (float)(p_73733_6_ >> 16 & 255) / 255.0F; + float var13 = (float)(p_73733_6_ >> 8 & 255) / 255.0F; + float var14 = (float)(p_73733_6_ & 255) / 255.0F; + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glShadeModel(GL11.GL_SMOOTH); + Tessellator var15 = Tessellator.instance; + var15.startDrawingQuads(); + var15.setColorRGBA_F(var8, var9, var10, var7); + var15.addVertex(p_73733_3_, p_73733_2_, zLevel); + var15.addVertex(p_73733_1_, p_73733_2_, zLevel); + var15.setColorRGBA_F(var12, var13, var14, var11); + var15.addVertex(p_73733_1_, p_73733_4_, zLevel); + var15.addVertex(p_73733_3_, p_73733_4_, zLevel); + var15.draw(); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + /** + * Renders the specified text to the screen, center-aligned. + */ + public void drawCenteredString(FontRenderer p_73732_1_, String p_73732_2_, int p_73732_3_, int p_73732_4_, int p_73732_5_) { + p_73732_1_.drawStringWithShadow(p_73732_2_, p_73732_3_ - p_73732_1_.getStringWidth(p_73732_2_) / 2, p_73732_4_, p_73732_5_); + } + + /** + * Renders the specified text to the screen. + */ + public void drawString(FontRenderer p_73731_1_, String p_73731_2_, int p_73731_3_, int p_73731_4_, int p_73731_5_) { + p_73731_1_.drawStringWithShadow(p_73731_2_, p_73731_3_, p_73731_4_, p_73731_5_); + } + + /** + * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height + */ + public static void drawTexturedModalRect(float p_73729_1_, float p_73729_2_, float p_73729_3_, float p_73729_4_, int p_73729_5_, int p_73729_6_) { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(p_73729_1_ + 0, p_73729_2_ + p_73729_6_, zLevel, (p_73729_3_ + 0) * var7, (p_73729_4_ + p_73729_6_) * var8); + var9.addVertexWithUV(p_73729_1_ + p_73729_5_, p_73729_2_ + p_73729_6_, zLevel, (p_73729_3_ + p_73729_5_) * var7, (p_73729_4_ + p_73729_6_) * var8); + var9.addVertexWithUV(p_73729_1_ + p_73729_5_, p_73729_2_ + 0, zLevel, (p_73729_3_ + p_73729_5_) * var7, (p_73729_4_ + 0) * var8); + var9.addVertexWithUV(p_73729_1_ + 0, p_73729_2_ + 0, zLevel, (p_73729_3_ + 0) * var7, (p_73729_4_ + 0) * var8); + var9.draw(); + } + + public void drawTexturedModelRectFromIcon(int p_94065_1_, int p_94065_2_, IIcon p_94065_3_, int p_94065_4_, int p_94065_5_) { + Tessellator var6 = Tessellator.instance; + var6.startDrawingQuads(); + var6.addVertexWithUV(p_94065_1_ + 0, p_94065_2_ + p_94065_5_, zLevel, p_94065_3_.getMinU(), p_94065_3_.getMaxV()); + var6.addVertexWithUV(p_94065_1_ + p_94065_4_, p_94065_2_ + p_94065_5_, zLevel, p_94065_3_.getMaxU(), p_94065_3_.getMaxV()); + var6.addVertexWithUV(p_94065_1_ + p_94065_4_, p_94065_2_ + 0, zLevel, p_94065_3_.getMaxU(), p_94065_3_.getMinV()); + var6.addVertexWithUV(p_94065_1_ + 0, p_94065_2_ + 0, zLevel, p_94065_3_.getMinU(), p_94065_3_.getMinV()); + var6.draw(); + } + + public static void drawModalRectWithCustomSizedTexture(int p_146110_0_, int p_146110_1_, float p_146110_2_, float p_146110_3_, int p_146110_4_, int p_146110_5_, float p_146110_6_, float p_146110_7_) { + float var8 = 1.0F / p_146110_6_; + float var9 = 1.0F / p_146110_7_; + Tessellator var10 = Tessellator.instance; + var10.startDrawingQuads(); + var10.addVertexWithUV(p_146110_0_, p_146110_1_ + p_146110_5_, 0.0D, p_146110_2_ * var8, (p_146110_3_ + (float)p_146110_5_) * var9); + var10.addVertexWithUV(p_146110_0_ + p_146110_4_, p_146110_1_ + p_146110_5_, 0.0D, (p_146110_2_ + (float)p_146110_4_) * var8, (p_146110_3_ + (float)p_146110_5_) * var9); + var10.addVertexWithUV(p_146110_0_ + p_146110_4_, p_146110_1_, 0.0D, (p_146110_2_ + (float)p_146110_4_) * var8, p_146110_3_ * var9); + var10.addVertexWithUV(p_146110_0_, p_146110_1_, 0.0D, p_146110_2_ * var8, p_146110_3_ * var9); + var10.draw(); + } + + public static void drawScaledCustomSizeModalRect(int p_152125_0_, int p_152125_1_, float p_152125_2_, float p_152125_3_, int p_152125_4_, int p_152125_5_, int p_152125_6_, int p_152125_7_, float p_152125_8_, float p_152125_9_) { + float var10 = 1.0F / p_152125_8_; + float var11 = 1.0F / p_152125_9_; + Tessellator var12 = Tessellator.instance; + var12.startDrawingQuads(); + var12.addVertexWithUV(p_152125_0_, p_152125_1_ + p_152125_7_, 0.0D, p_152125_2_ * var10, (p_152125_3_ + (float)p_152125_5_) * var11); + var12.addVertexWithUV(p_152125_0_ + p_152125_6_, p_152125_1_ + p_152125_7_, 0.0D, (p_152125_2_ + (float)p_152125_4_) * var10, (p_152125_3_ + (float)p_152125_5_) * var11); + var12.addVertexWithUV(p_152125_0_ + p_152125_6_, p_152125_1_, 0.0D, (p_152125_2_ + (float)p_152125_4_) * var10, p_152125_3_ * var11); + var12.addVertexWithUV(p_152125_0_, p_152125_1_, 0.0D, p_152125_2_ * var10, p_152125_3_ * var11); + var12.draw(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButton.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButton.java new file mode 100644 index 0000000..4bad110 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButton.java @@ -0,0 +1,124 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiButton extends Gui { + protected static final ResourceLocation field_146122_a = new ResourceLocation("textures/gui/widgets.png"); + protected int field_146120_f; + protected int field_146121_g; + public int field_146128_h; + public int field_146129_i; + + /** The string displayed on this control. */ + public String displayString; + public int id; + public boolean enabled; + public boolean field_146125_m; + protected boolean field_146123_n; + + public int getWidth() { + return this.field_146120_f; + } + + public int getHeight() { + return this.field_146121_g; + } + + public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) { + this(p_i1020_1_, p_i1020_2_, p_i1020_3_, 200, 20, p_i1020_4_); + } + + public GuiButton(int p_i46323_1_, int p_i46323_2_, int p_i46323_3_, int p_i46323_4_, int p_i46323_5_, String p_i46323_6_) { + this.field_146120_f = 200; + this.field_146121_g = 20; + this.enabled = true; + this.field_146125_m = true; + this.id = p_i46323_1_; + this.field_146128_h = p_i46323_2_; + this.field_146129_i = p_i46323_3_; + this.field_146120_f = p_i46323_4_; + this.field_146121_g = p_i46323_5_; + this.displayString = p_i46323_6_; + } + + public int getHoverState(boolean p_146114_1_) { + byte var2 = 1; + + if (!this.enabled) { + var2 = 0; + } else if (p_146114_1_) { + var2 = 2; + } + + return var2; + } + + /** + * Draws this button to the screen. + */ + public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) { + if (this.field_146125_m) { + FontRenderer var4 = p_146112_1_.fontRenderer; + p_146112_1_.getTextureManager().bindTexture(field_146122_a); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_146123_n = p_146112_2_ >= this.field_146128_h && p_146112_3_ >= this.field_146129_i && p_146112_2_ < this.field_146128_h + this.field_146120_f && p_146112_3_ < this.field_146129_i + this.field_146121_g; + int var5 = this.getHoverState(this.field_146123_n); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + drawTexturedModalRect(this.field_146128_h, this.field_146129_i, 0, 46 + var5 * 20, this.field_146120_f / 2, this.field_146121_g); + drawTexturedModalRect(this.field_146128_h + this.field_146120_f / 2, this.field_146129_i, 200 - this.field_146120_f / 2, 46 + var5 * 20, this.field_146120_f / 2, this.field_146121_g); + this.mouseDragged(p_146112_1_, p_146112_2_, p_146112_3_); + int var6 = 14737632; + + if (!this.enabled) { + var6 = 10526880; + } else if (this.field_146123_n) { + var6 = 16777120; + } + + this.drawCenteredString(var4, this.displayString, this.field_146128_h + this.field_146120_f / 2, this.field_146129_i + (this.field_146121_g - 8) / 2, var6); + } + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + protected void mouseDragged(Minecraft p_146119_1_, int p_146119_2_, int p_146119_3_) {} + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int p_146118_1_, int p_146118_2_) {} + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + public boolean mousePressed(Minecraft p_146116_1_, int p_146116_2_, int p_146116_3_) { + return this.enabled && this.field_146125_m && p_146116_2_ >= this.field_146128_h && p_146116_3_ >= this.field_146129_i && p_146116_2_ < this.field_146128_h + this.field_146120_f && p_146116_3_ < this.field_146129_i + this.field_146121_g; + } + + public boolean func_146115_a() { + return this.field_146123_n; + } + + public void func_146111_b(int p_146111_1_, int p_146111_2_) {} + + public void func_146113_a(SoundHandler p_146113_1_) { + p_146113_1_.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + } + + public int func_146117_b() { + return this.field_146120_f; + } + + public int func_154310_c() { + return this.field_146121_g; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java new file mode 100644 index 0000000..75f7ed9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButtonLanguage.java @@ -0,0 +1,30 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +public class GuiButtonLanguage extends GuiButton { + + + public GuiButtonLanguage(int p_i1041_1_, int p_i1041_2_, int p_i1041_3_) { + super(p_i1041_1_, p_i1041_2_, p_i1041_3_, 20, 20, ""); + } + + /** + * Draws this button to the screen. + */ + public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) { + if (this.field_146125_m) { + p_146112_1_.getTextureManager().bindTexture(GuiButton.field_146122_a); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + boolean var4 = p_146112_2_ >= this.field_146128_h && p_146112_3_ >= this.field_146129_i && p_146112_2_ < this.field_146128_h + this.field_146120_f && p_146112_3_ < this.field_146129_i + this.field_146121_g; + int var5 = 106; + + if (var4) { + var5 += this.field_146121_g; + } + + drawTexturedModalRect(this.field_146128_h, this.field_146129_i, 0, var5, this.field_146120_f, this.field_146121_g); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java new file mode 100644 index 0000000..808dfe5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java @@ -0,0 +1,81 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.realms.RealmsButton; + +public class GuiButtonRealmsProxy extends GuiButton { + private final RealmsButton field_154318_o; + + + public GuiButtonRealmsProxy(RealmsButton p_i46321_1_, int p_i46321_2_, int p_i46321_3_, int p_i46321_4_, String p_i46321_5_) { + super(p_i46321_2_, p_i46321_3_, p_i46321_4_, p_i46321_5_); + this.field_154318_o = p_i46321_1_; + } + + public GuiButtonRealmsProxy(RealmsButton p_i1090_1_, int p_i1090_2_, int p_i1090_3_, int p_i1090_4_, String p_i1090_5_, int p_i1090_6_, int p_i1090_7_) { + super(p_i1090_2_, p_i1090_3_, p_i1090_4_, p_i1090_6_, p_i1090_7_, p_i1090_5_); + this.field_154318_o = p_i1090_1_; + } + + public int func_154314_d() { + return super.id; + } + + public boolean func_154315_e() { + return super.enabled; + } + + public void func_154313_b(boolean p_154313_1_) { + super.enabled = p_154313_1_; + } + + public void func_154311_a(String p_154311_1_) { + super.displayString = p_154311_1_; + } + + public int func_146117_b() { + return super.func_146117_b(); + } + + public int func_154316_f() { + return super.field_146129_i; + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + public boolean mousePressed(Minecraft p_146116_1_, int p_146116_2_, int p_146116_3_) { + if (super.mousePressed(p_146116_1_, p_146116_2_, p_146116_3_)) { + this.field_154318_o.clicked(p_146116_2_, p_146116_3_); + } + + return super.mousePressed(p_146116_1_, p_146116_2_, p_146116_3_); + } + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int p_146118_1_, int p_146118_2_) { + this.field_154318_o.released(p_146118_1_, p_146118_2_); + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + public void mouseDragged(Minecraft p_146119_1_, int p_146119_2_, int p_146119_3_) { + this.field_154318_o.renderBg(p_146119_2_, p_146119_3_); + } + + public RealmsButton func_154317_g() { + return this.field_154318_o; + } + + public int getHoverState(boolean p_146114_1_) { + return this.field_154318_o.getYImage(p_146114_1_); + } + + public int func_154312_c(boolean p_154312_1_) { + return super.getHoverState(p_154312_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiChat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiChat.java new file mode 100644 index 0000000..d87b822 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiChat.java @@ -0,0 +1,446 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.util.*; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +public class GuiChat extends GuiScreen implements GuiYesNoCallback { + private static final Set field_152175_f = Sets.newHashSet("http", "https"); + private static final Logger logger = LogManager.getLogger(); + private String field_146410_g = ""; + private int field_146416_h = -1; + private boolean field_146417_i; + private boolean field_146414_r; + private int field_146413_s; + private final List field_146412_t = new ArrayList(); + private URI field_146411_u; + protected GuiTextField field_146415_a; + private String field_146409_v = ""; + + + public GuiChat() {} + + public GuiChat(String p_i1024_1_) { + this.field_146409_v = p_i1024_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.field_146416_h = this.mc.ingameGUI.getChatGUI().func_146238_c().size(); + this.field_146415_a = new GuiTextField(this.fontRendererObj, 4, this.height - 12, this.width - 4, 12); + this.field_146415_a.setMaxStringLength(100); + this.field_146415_a.func_146185_a(false); + this.field_146415_a.setFocused(true); + this.field_146415_a.setText(this.field_146409_v); + this.field_146415_a.func_146205_d(false); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146415_a.updateCursorCounter(); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + this.field_146414_r = false; + + if (p_73869_2_ == 15) { + this.func_146404_p_(); + } else { + this.field_146417_i = false; + } + + if (p_73869_2_ == 1) { + this.mc.displayGuiScreen(null); + } else if (p_73869_2_ != 28 && p_73869_2_ != 156) { + if (p_73869_2_ == 200) { + this.func_146402_a(-1); + } else if (p_73869_2_ == 208) { + this.func_146402_a(1); + } else if (p_73869_2_ == 201) { + this.mc.ingameGUI.getChatGUI().func_146229_b(this.mc.ingameGUI.getChatGUI().func_146232_i() - 1); + } else if (p_73869_2_ == 209) { + this.mc.ingameGUI.getChatGUI().func_146229_b(-this.mc.ingameGUI.getChatGUI().func_146232_i() + 1); + } else { + this.field_146415_a.keyTyped(p_73869_1_, p_73869_2_); + } + } else { + String var3 = this.field_146415_a.getText().trim(); + + if (var3.length() > 0) { + this.func_146403_a(var3); + } + + this.mc.displayGuiScreen(null); + } + } + + public void func_146403_a(String p_146403_1_) { + this.mc.ingameGUI.getChatGUI().func_146239_a(p_146403_1_); + this.mc.thePlayer.sendChatMessage(p_146403_1_); + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() { + super.handleMouseInput(); + int var1 = Mouse.getEventDWheel(); + + if (var1 != 0) { + if (var1 > 1) { + var1 = 1; + } + + if (var1 < -1) { + var1 = -1; + } + + if (!isShiftKeyDown()) { + var1 *= 7; + } + + this.mc.ingameGUI.getChatGUI().func_146229_b(var1); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + if (mouseButton == 0 && this.mc.gameSettings.chatLinks) { + IChatComponent var4 = this.mc.ingameGUI.getChatGUI().func_146236_a(Mouse.getX(), Mouse.getY()); + + if (var4 != null) { + ClickEvent var5 = var4.getChatStyle().getChatClickEvent(); + + if (var5 != null) { + if (isShiftKeyDown()) { + this.field_146415_a.func_146191_b(var4.getUnformattedTextForChat()); + } else { + URI var6; + + if (var5.getAction() == ClickEvent.Action.OPEN_URL) { + try { + var6 = new URI(var5.getValue()); + + if (!field_152175_f.contains(var6.getScheme().toLowerCase())) { + throw new URISyntaxException(var5.getValue(), "Unsupported protocol: " + var6.getScheme().toLowerCase()); + } + + if (this.mc.gameSettings.chatLinksPrompt) { + this.field_146411_u = var6; + this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, var5.getValue(), 0, false)); + } else { + this.func_146407_a(var6); + } + } catch (URISyntaxException var7) { + logger.error("Can't open url for " + var5, var7); + } + } else if (var5.getAction() == ClickEvent.Action.OPEN_FILE) { + var6 = (new File(var5.getValue())).toURI(); + this.func_146407_a(var6); + } else if (var5.getAction() == ClickEvent.Action.SUGGEST_COMMAND) { + this.field_146415_a.setText(var5.getValue()); + } else if (var5.getAction() == ClickEvent.Action.RUN_COMMAND) { + this.func_146403_a(var5.getValue()); + } else if (var5.getAction() == ClickEvent.Action.UPLOAD_SCREENSHOT) { + this.sendUpdateServer(var5.getValue()); + } else if (var5.getAction() == ClickEvent.Action.COPY_SCREENSHOT) { + ScreenShotHelper.IllIlIIIllllIIllIIlllIIlI(var5.getValue()); + } else { + logger.error("Don't know how to handle " + var5); + } + } + + return; + } + } + } + + this.field_146415_a.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + private void sendUpdateServer(String var1) { + File var2 = new File(this.mc.mcDataDir + File.separator + "screenshots" + File.separator + var1); + if (var2.exists()) { + GuiIngame.uploadingScreenshot = true; + new Thread(() -> { + try { + String var10; + BufferedImage var2x = ImageIO.read(var2); + ByteArrayOutputStream var3 = new ByteArrayOutputStream(); + ImageIO.write(var2x, "png", var3); + URL var4 = new URL("https://api.imgur.com/3/image"); + String var5 = URLEncoder.encode("image", "UTF-8") + "=" + URLEncoder.encode(Base64.encodeBase64String(var3.toByteArray()), "UTF-8"); + var5 = var5 + "&" + URLEncoder.encode("key", "UTF-8") + "=" + URLEncoder.encode("7fd132c453b5486", "UTF-8"); + URLConnection var6 = var4.openConnection(); + var6.setDoOutput(true); + var6.setDoInput(true); + var6.setRequestProperty("Authorization", "Client-ID 7fd132c453b5486"); + var6.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + OutputStreamWriter var7 = new OutputStreamWriter(var6.getOutputStream()); + var7.write(var5); + var7.flush(); + BufferedReader var8 = new BufferedReader(new InputStreamReader(var6.getInputStream())); + StringBuilder var9 = new StringBuilder(); + while ((var10 = var8.readLine()) != null) { + var9.append(var10).append(System.lineSeparator()); + } + var8.close(); + GuiIngame.uploadingScreenshot = false; + Gson var11 = new GsonBuilder().create(); + JsonObject var12 = var11.fromJson(var9.toString(), JsonObject.class); + String var13 = "https://i.imgur.com/" + var12.get("data").getAsJsonObject().get("id").getAsString() + ".png"; + this.field_146411_u = new URI(var13); + GuiConfirmOpenLink var14 = new GuiConfirmOpenLink(this, var13, 0, false); + var14.func_146358_g(); + this.mc.displayGuiScreen(var14); +// CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Info", "&aSuccessfully &fuploaded screenshot!", 3000L); + } catch (Exception var15) { + GuiIngame.uploadingScreenshot = false; +// CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Error", "&fScreenshot upload &cfailed!", 3000L); + var15.printStackTrace(); + } + }).start(); + } + } + + public void confirmClicked(boolean p_73878_1_, int p_73878_2_) { + if (p_73878_2_ == 0) { + if (p_73878_1_) { + this.func_146407_a(this.field_146411_u); + } + + this.field_146411_u = null; + this.mc.displayGuiScreen(this); + } + } + + private void func_146407_a(URI p_146407_1_) { + try { + Class var2 = Class.forName("java.awt.Desktop"); + Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke(null); + var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, p_146407_1_); + } catch (Throwable var4) { + logger.error("Couldn't open link", var4); + } + } + + public void func_146404_p_() { + String var3; + + if (this.field_146417_i) { + this.field_146415_a.func_146175_b(this.field_146415_a.func_146197_a(-1, this.field_146415_a.func_146198_h(), false) - this.field_146415_a.func_146198_h()); + + if (this.field_146413_s >= this.field_146412_t.size()) { + this.field_146413_s = 0; + } + } else { + int var1 = this.field_146415_a.func_146197_a(-1, this.field_146415_a.func_146198_h(), false); + this.field_146412_t.clear(); + this.field_146413_s = 0; + String var2 = this.field_146415_a.getText().substring(var1).toLowerCase(); + var3 = this.field_146415_a.getText().substring(0, this.field_146415_a.func_146198_h()); + this.func_146405_a(var3, var2); + + if (this.field_146412_t.isEmpty()) { + return; + } + + this.field_146417_i = true; + this.field_146415_a.func_146175_b(var1 - this.field_146415_a.func_146198_h()); + } + + if (this.field_146412_t.size() > 1) { + StringBuilder var4 = new StringBuilder(); + + for (Iterator var5 = this.field_146412_t.iterator(); var5.hasNext(); var4.append(var3)) { + var3 = (String)var5.next(); + + if (var4.length() > 0) { + var4.append(", "); + } + } + + this.mc.ingameGUI.getChatGUI().func_146234_a(new ChatComponentText(var4.toString()), 1); + } + + this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++)); + } + + private void func_146405_a(String p_146405_1_, String p_146405_2_) { + if (p_146405_1_.length() >= 1) { + this.mc.thePlayer.sendQueue.addToSendQueue(new C14PacketTabComplete(p_146405_1_)); + this.field_146414_r = true; + } + } + + public void func_146402_a(int p_146402_1_) { + int var2 = this.field_146416_h + p_146402_1_; + int var3 = this.mc.ingameGUI.getChatGUI().func_146238_c().size(); + + if (var2 < 0) { + var2 = 0; + } + + if (var2 > var3) { + var2 = var3; + } + + if (var2 != this.field_146416_h) { + if (var2 == var3) { + this.field_146416_h = var3; + this.field_146415_a.setText(this.field_146410_g); + } else { + if (this.field_146416_h == var3) { + this.field_146410_g = this.field_146415_a.getText(); + } + + this.field_146415_a.setText((String)this.mc.ingameGUI.getChatGUI().func_146238_c().get(var2)); + this.field_146416_h = var2; + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + if (!CheatBreaker.getInstance().getModuleManager().chatMod.isEnabled() || (Boolean) CheatBreaker.getInstance().getModuleManager().chatMod.inputFieldBackground.getValue()) { + drawRect(2, this.height - 14, this.width - 2, this.height - 2, CheatBreaker.getInstance().getModuleManager().chatMod.backgroundColor.getColorValue()); + } + this.field_146415_a.drawTextBox(); + IChatComponent var4 = this.mc.ingameGUI.getChatGUI().func_146236_a(Mouse.getX(), Mouse.getY()); + + if (var4 != null && var4.getChatStyle().getChatHoverEvent() != null) { + HoverEvent var5 = var4.getChatStyle().getChatHoverEvent(); + + if (var5.getAction() == HoverEvent.Action.SHOW_ITEM) { + ItemStack var6 = null; + + try { + NBTBase var7 = JsonToNBT.func_150315_a(var5.getValue().getUnformattedText()); + + if (var7 != null && var7 instanceof NBTTagCompound) { + var6 = ItemStack.loadItemStackFromNBT((NBTTagCompound)var7); + } + } catch (NBTException var11) { + } + + if (var6 != null) { + this.func_146285_a(var6, p_73863_1_, p_73863_2_); + } else { + this.func_146279_a(EnumChatFormatting.RED + "Invalid Item!", p_73863_1_, p_73863_2_); + } + } else if (var5.getAction() == HoverEvent.Action.SHOW_TEXT) { + this.func_146283_a(Splitter.on("\n").splitToList(var5.getValue().getFormattedText()), p_73863_1_, p_73863_2_); + } else if (var5.getAction() == HoverEvent.Action.SHOW_ACHIEVEMENT) { + StatBase var12 = StatList.func_151177_a(var5.getValue().getUnformattedText()); + + if (var12 != null) { + IChatComponent var13 = var12.func_150951_e(); + ChatComponentTranslation var8 = new ChatComponentTranslation("stats.tooltip.type." + (var12.isAchievement() ? "achievement" : "statistic")); + var8.getChatStyle().setItalic(Boolean.valueOf(true)); + String var9 = var12 instanceof Achievement ? ((Achievement)var12).getDescription() : null; + ArrayList var10 = Lists.newArrayList(var13.getFormattedText(), var8.getFormattedText()); + + if (var9 != null) { + var10.addAll(this.fontRendererObj.listFormattedStringToWidth(var9, 150)); + } + + this.func_146283_a(var10, p_73863_1_, p_73863_2_); + } else { + this.func_146279_a(EnumChatFormatting.RED + "Invalid statistic/achievement!", p_73863_1_, p_73863_2_); + } + } + + GL11.glDisable(GL11.GL_LIGHTING); + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + public void func_146406_a(String[] p_146406_1_) { + if (this.field_146414_r) { + this.field_146417_i = false; + this.field_146412_t.clear(); + String[] var2 = p_146406_1_; + int var3 = p_146406_1_.length; + + for (int var4 = 0; var4 < var3; ++var4) { + String var5 = var2[var4]; + + if (var5.length() > 0) { + this.field_146412_t.add(var5); + } + } + + String var6 = this.field_146415_a.getText().substring(this.field_146415_a.func_146197_a(-1, this.field_146415_a.func_146198_h(), false)); + String var7 = StringUtils.getCommonPrefix(p_146406_1_); + + if (var7.length() > 0 && !var6.equalsIgnoreCase(var7)) { + this.field_146415_a.func_146175_b(this.field_146415_a.func_146197_a(-1, this.field_146415_a.func_146198_h(), false) - this.field_146415_a.func_146198_h()); + this.field_146415_a.func_146191_b(var7); + } else if (this.field_146412_t.size() > 0) { + this.field_146417_i = true; + this.func_146404_p_(); + } + } + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java new file mode 100644 index 0000000..78a45e8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCommandBlock.java @@ -0,0 +1,147 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; + +public class GuiCommandBlock extends GuiScreen { + private static final Logger field_146488_a = LogManager.getLogger(); + private GuiTextField field_146485_f; + private GuiTextField field_146486_g; + private final CommandBlockLogic field_146489_h; + private GuiButton field_146490_i; + private GuiButton field_146487_r; + + + public GuiCommandBlock(CommandBlockLogic p_i45032_1_) { + this.field_146489_h = p_i45032_1_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146485_f.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(this.field_146490_i = new GuiButton(0, this.width / 2 - 4 - 150, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.done"))); + this.buttonList.add(this.field_146487_r = new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel"))); + this.field_146485_f = new GuiTextField(this.fontRendererObj, this.width / 2 - 150, 50, 300, 20); + this.field_146485_f.setMaxStringLength(32767); + this.field_146485_f.setFocused(true); + this.field_146485_f.setText(this.field_146489_h.func_145753_i()); + this.field_146486_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 150, 135, 300, 20); + this.field_146486_g.setMaxStringLength(32767); + this.field_146486_g.func_146184_c(false); + this.field_146486_g.setText(this.field_146489_h.func_145753_i()); + + if (this.field_146489_h.func_145749_h() != null) { + this.field_146486_g.setText(this.field_146489_h.func_145749_h().getUnformattedText()); + } + + this.field_146490_i.enabled = this.field_146485_f.getText().trim().length() > 0; + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 1) { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + Minecraft.getMinecraft().entityRenderer.stopUseShader(); + } + this.mc.displayGuiScreen(null); + } else if (p_146284_1_.id == 0) { + PacketBuffer var2 = new PacketBuffer(Unpooled.buffer()); + + try { + var2.writeByte(this.field_146489_h.func_145751_f()); + this.field_146489_h.func_145757_a(var2); + var2.writeStringToBuffer(this.field_146485_f.getText()); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|AdvCdm", var2)); + } catch (Exception var7) { + field_146488_a.error("Couldn't send command block info", var7); + } + finally { + var2.release(); + } + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + Minecraft.getMinecraft().entityRenderer.stopUseShader(); + } + + this.mc.displayGuiScreen(null); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + this.field_146485_f.keyTyped(p_73869_1_, p_73869_2_); + this.field_146486_g.keyTyped(p_73869_1_, p_73869_2_); + this.field_146490_i.enabled = this.field_146485_f.getText().trim().length() > 0; + + if (p_73869_2_ != 28 && p_73869_2_ != 156) { + if (p_73869_2_ == 1) { + this.actionPerformed(this.field_146487_r); + } + } else { + this.actionPerformed(this.field_146490_i); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146485_f.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146486_g.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("advMode.setCommand"), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("advMode.command"), this.width / 2 - 150, 37, 10526880); + this.field_146485_f.drawTextBox(); + byte var4 = 75; + byte var5 = 0; + FontRenderer var10001 = this.fontRendererObj; + String var10002 = I18n.format("advMode.nearestPlayer"); + int var10003 = this.width / 2 - 150; + int var7 = var5 + 1; + this.drawString(var10001, var10002, var10003, var4 + var5 * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, I18n.format("advMode.randomPlayer"), this.width / 2 - 150, var4 + var7++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, I18n.format("advMode.allPlayers"), this.width / 2 - 150, var4 + var7++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + + if (this.field_146486_g.getText().length() > 0) { + int var6 = var4 + var7 * this.fontRendererObj.FONT_HEIGHT + 20; + this.drawString(this.fontRendererObj, I18n.format("advMode.previousOutput"), this.width / 2 - 150, var6, 10526880); + this.field_146486_g.drawTextBox(); + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java new file mode 100644 index 0000000..7917081 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiConfirmOpenLink.java @@ -0,0 +1,56 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.resources.I18n; + +public class GuiConfirmOpenLink extends GuiYesNo { + private final String field_146363_r; + private final String field_146362_s; + private final String field_146361_t; + private boolean field_146360_u = true; + + + public GuiConfirmOpenLink(GuiYesNoCallback p_i1084_1_, String p_i1084_2_, int p_i1084_3_, boolean p_i1084_4_) { + super(p_i1084_1_, I18n.format(p_i1084_4_ ? "chat.link.confirmTrusted" : "chat.link.confirm"), p_i1084_2_, p_i1084_3_); + this.field_146352_g = I18n.format(p_i1084_4_ ? "chat.link.open" : "gui.yes"); + this.field_146356_h = I18n.format(p_i1084_4_ ? "gui.cancel" : "gui.no"); + this.field_146362_s = I18n.format("chat.copy"); + this.field_146363_r = I18n.format("chat.link.warning"); + this.field_146361_t = p_i1084_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height / 6 + 96, 100, 20, this.field_146352_g)); + this.buttonList.add(new GuiButton(2, this.width / 2 - 50, this.height / 6 + 96, 100, 20, this.field_146362_s)); + this.buttonList.add(new GuiButton(1, this.width / 2 + 55, this.height / 6 + 96, 100, 20, this.field_146356_h)); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 2) { + this.func_146359_e(); + } + + this.field_146355_a.confirmClicked(p_146284_1_.id == 0, this.field_146357_i); + } + + public void func_146359_e() { + setClipboardString(this.field_146361_t); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + + if (this.field_146360_u) { + this.drawCenteredString(this.fontRendererObj, this.field_146363_r, this.width / 2, 110, 16764108); + } + } + + public void func_146358_g() { + this.field_146360_u = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiControls.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiControls.java new file mode 100644 index 0000000..a73d1ab --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiControls.java @@ -0,0 +1,129 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; + +public class GuiControls extends GuiScreen { + private static final GameSettings.Options[] field_146492_g = new GameSettings.Options[] {GameSettings.Options.INVERT_MOUSE, GameSettings.Options.SENSITIVITY, GameSettings.Options.TOUCHSCREEN}; + private final GuiScreen field_146496_h; + protected String field_146495_a = "Controls"; + private final GameSettings field_146497_i; + public KeyBinding field_146491_f = null; + public long field_152177_g; + private GuiKeyBindingList field_146494_r; + private GuiButton field_146493_s; + + + public GuiControls(GuiScreen p_i1027_1_, GameSettings p_i1027_2_) { + this.field_146496_h = p_i1027_1_; + this.field_146497_i = p_i1027_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.field_146494_r = new GuiKeyBindingList(this, this.mc); + this.buttonList.add(new GuiButton(200, this.width / 2 - 155, this.height - 29, 150, 20, I18n.format("gui.done"))); + this.buttonList.add(this.field_146493_s = new GuiButton(201, this.width / 2 - 155 + 160, this.height - 29, 150, 20, I18n.format("controls.resetAll"))); + this.field_146495_a = I18n.format("controls.title"); + int var1 = 0; + GameSettings.Options[] var2 = field_146492_g; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + GameSettings.Options var5 = var2[var4]; + + if (var5.getEnumFloat()) { + this.buttonList.add(new GuiOptionSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, 18 + 24 * (var1 >> 1), var5)); + } else { + this.buttonList.add(new GuiOptionButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, 18 + 24 * (var1 >> 1), var5, this.field_146497_i.getKeyBinding(var5))); + } + + ++var1; + } + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 200) { + this.mc.displayGuiScreen(this.field_146496_h); + } else if (p_146284_1_.id == 201) { + KeyBinding[] var2 = this.mc.gameSettings.keyBindings; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + KeyBinding var5 = var2[var4]; + var5.setKeyCode(var5.getKeyCodeDefault()); + } + + KeyBinding.resetKeyBindingArrayAndHash(); + } else if (p_146284_1_.id < 100 && p_146284_1_ instanceof GuiOptionButton) { + this.field_146497_i.setOptionValue(((GuiOptionButton)p_146284_1_).func_146136_c(), 1); + p_146284_1_.displayString = this.field_146497_i.getKeyBinding(GameSettings.Options.getEnumOptions(p_146284_1_.id)); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + if (this.field_146491_f != null) { + this.field_146497_i.setKeyCodeSave(this.field_146491_f, -100 + mouseButton); + this.field_146491_f = null; + KeyBinding.resetKeyBindingArrayAndHash(); + } else if (mouseButton != 0 || !this.field_146494_r.func_148179_a(p_73864_1_, p_73864_2_, mouseButton)) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + } + + protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) { + if (p_146286_3_ != 0 || !this.field_146494_r.func_148181_b(p_146286_1_, p_146286_2_, p_146286_3_)) { + super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (this.field_146491_f != null) { + if (p_73869_2_ == 1) { + this.field_146497_i.setKeyCodeSave(this.field_146491_f, 0); + } else { + this.field_146497_i.setKeyCodeSave(this.field_146491_f, p_73869_2_); + } + + this.field_146491_f = null; + this.field_152177_g = Minecraft.getSystemTime(); + KeyBinding.resetKeyBindingArrayAndHash(); + } else { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.field_146494_r.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, this.field_146495_a, this.width / 2, 8, 16777215); + boolean var4 = true; + KeyBinding[] var5 = this.field_146497_i.keyBindings; + int var6 = var5.length; + + for (int var7 = 0; var7 < var6; ++var7) { + KeyBinding var8 = var5[var7]; + + if (var8.getKeyCode() != var8.getKeyCodeDefault()) { + var4 = false; + break; + } + } + + this.field_146493_s.enabled = !var4; + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java new file mode 100644 index 0000000..5c398de --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCreateFlatWorld.java @@ -0,0 +1,185 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiCreateFlatWorld extends GuiScreen { + private static final RenderItem field_146392_a = new RenderItem(); + private final GuiCreateWorld field_146385_f; + private FlatGeneratorInfo field_146387_g = FlatGeneratorInfo.getDefaultFlatGenerator(); + private String field_146393_h; + private String field_146394_i; + private String field_146391_r; + private GuiCreateFlatWorld.Details field_146390_s; + private GuiButton field_146389_t; + private GuiButton field_146388_u; + private GuiButton field_146386_v; + + + public GuiCreateFlatWorld(GuiCreateWorld p_i1029_1_, String p_i1029_2_) { + this.field_146385_f = p_i1029_1_; + this.func_146383_a(p_i1029_2_); + } + + public String func_146384_e() { + return this.field_146387_g.toString(); + } + + public void func_146383_a(String p_146383_1_) { + this.field_146387_g = FlatGeneratorInfo.createFlatGeneratorFromString(p_146383_1_); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + this.field_146393_h = I18n.format("createWorld.customize.flat.title"); + this.field_146394_i = I18n.format("createWorld.customize.flat.tile"); + this.field_146391_r = I18n.format("createWorld.customize.flat.height"); + this.field_146390_s = new GuiCreateFlatWorld.Details(); + this.buttonList.add(this.field_146389_t = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.format("createWorld.customize.flat.addLayer") + " (NYI)")); + this.buttonList.add(this.field_146388_u = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.format("createWorld.customize.flat.editLayer") + " (NYI)")); + this.buttonList.add(this.field_146386_v = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.format("createWorld.customize.flat.removeLayer"))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("gui.done"))); + this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.format("createWorld.customize.presets"))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel"))); + this.field_146389_t.field_146125_m = this.field_146388_u.field_146125_m = false; + this.field_146387_g.func_82645_d(); + this.func_146375_g(); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + int var2 = this.field_146387_g.getFlatLayers().size() - this.field_146390_s.field_148228_k - 1; + + if (p_146284_1_.id == 1) { + this.mc.displayGuiScreen(this.field_146385_f); + } else if (p_146284_1_.id == 0) { + this.field_146385_f.field_146334_a = this.func_146384_e(); + this.mc.displayGuiScreen(this.field_146385_f); + } else if (p_146284_1_.id == 5) { + this.mc.displayGuiScreen(new GuiFlatPresets(this)); + } else if (p_146284_1_.id == 4 && this.func_146382_i()) { + this.field_146387_g.getFlatLayers().remove(var2); + this.field_146390_s.field_148228_k = Math.min(this.field_146390_s.field_148228_k, this.field_146387_g.getFlatLayers().size() - 1); + } + + this.field_146387_g.func_82645_d(); + this.func_146375_g(); + } + + public void func_146375_g() { + boolean var1 = this.func_146382_i(); + this.field_146386_v.enabled = var1; + this.field_146388_u.enabled = var1; + this.field_146388_u.enabled = false; + this.field_146389_t.enabled = false; + } + + private boolean func_146382_i() { + return this.field_146390_s.field_148228_k > -1 && this.field_146390_s.field_148228_k < this.field_146387_g.getFlatLayers().size(); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.field_146390_s.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, this.field_146393_h, this.width / 2, 8, 16777215); + int var4 = this.width / 2 - 92 - 16; + this.drawString(this.fontRendererObj, this.field_146394_i, var4, 32, 16777215); + this.drawString(this.fontRendererObj, this.field_146391_r, var4 + 2 + 213 - this.fontRendererObj.getStringWidth(this.field_146391_r), 32, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + class Details extends GuiSlot { + public int field_148228_k = -1; + + + public Details() { + super(GuiCreateFlatWorld.this.mc, GuiCreateFlatWorld.this.width, GuiCreateFlatWorld.this.height, 43, GuiCreateFlatWorld.this.height - 60, 24); + } + + private void func_148225_a(int p_148225_1_, int p_148225_2_, ItemStack p_148225_3_) { + this.func_148226_e(p_148225_1_ + 1, p_148225_2_ + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + + if (p_148225_3_ != null) { + RenderHelper.enableGUIStandardItemLighting(); + GuiCreateFlatWorld.field_146392_a.renderItemIntoGUI(GuiCreateFlatWorld.this.fontRendererObj, GuiCreateFlatWorld.this.mc.getTextureManager(), p_148225_3_, p_148225_1_ + 2, p_148225_2_ + 2); + RenderHelper.disableStandardItemLighting(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + private void func_148226_e(int p_148226_1_, int p_148226_2_) { + this.func_148224_c(p_148226_1_, p_148226_2_, 0, 0); + } + + private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiCreateFlatWorld.this.mc.getTextureManager().bindTexture(Gui.statIcons); + float var5 = 0.0078125F; + float var6 = 0.0078125F; + boolean var7 = true; + boolean var8 = true; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(p_148224_1_ + 0, p_148224_2_ + 18, zLevel, (float)(p_148224_3_ + 0) * 0.0078125F, (float)(p_148224_4_ + 18) * 0.0078125F); + var9.addVertexWithUV(p_148224_1_ + 18, p_148224_2_ + 18, zLevel, (float)(p_148224_3_ + 18) * 0.0078125F, (float)(p_148224_4_ + 18) * 0.0078125F); + var9.addVertexWithUV(p_148224_1_ + 18, p_148224_2_ + 0, zLevel, (float)(p_148224_3_ + 18) * 0.0078125F, (float)(p_148224_4_ + 0) * 0.0078125F); + var9.addVertexWithUV(p_148224_1_ + 0, p_148224_2_ + 0, zLevel, (float)(p_148224_3_ + 0) * 0.0078125F, (float)(p_148224_4_ + 0) * 0.0078125F); + var9.draw(); + } + + protected int getSize() { + return GuiCreateFlatWorld.this.field_146387_g.getFlatLayers().size(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) { + this.field_148228_k = p_148144_1_; + GuiCreateFlatWorld.this.func_146375_g(); + } + + protected boolean isSelected(int p_148131_1_) { + return p_148131_1_ == this.field_148228_k; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + FlatLayerInfo var8 = (FlatLayerInfo)GuiCreateFlatWorld.this.field_146387_g.getFlatLayers().get(GuiCreateFlatWorld.this.field_146387_g.getFlatLayers().size() - p_148126_1_ - 1); + Item var9 = Item.getItemFromBlock(var8.func_151536_b()); + ItemStack var10 = var8.func_151536_b() == Blocks.air ? null : new ItemStack(var9, 1, var8.getFillBlockMeta()); + String var11 = var10 != null && var9 != null ? var9.getItemStackDisplayName(var10) : "Air"; + this.func_148225_a(p_148126_2_, p_148126_3_, var10); + GuiCreateFlatWorld.this.fontRendererObj.drawString(var11, p_148126_2_ + 18 + 5, p_148126_3_ + 3, 16777215); + String var12; + + if (p_148126_1_ == 0) { + var12 = I18n.format("createWorld.customize.flat.layer.top", Integer.valueOf(var8.getLayerCount())); + } else if (p_148126_1_ == GuiCreateFlatWorld.this.field_146387_g.getFlatLayers().size() - 1) { + var12 = I18n.format("createWorld.customize.flat.layer.bottom", Integer.valueOf(var8.getLayerCount())); + } else { + var12 = I18n.format("createWorld.customize.flat.layer", Integer.valueOf(var8.getLayerCount())); + } + + GuiCreateFlatWorld.this.fontRendererObj.drawString(var12, p_148126_2_ + 2 + 213 - GuiCreateFlatWorld.this.fontRendererObj.getStringWidth(var12), p_148126_3_ + 3, 16777215); + } + + protected int func_148137_d() { + return this.field_148155_a - 70; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java new file mode 100644 index 0000000..2f051c8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiCreateWorld.java @@ -0,0 +1,369 @@ +package net.minecraft.client.gui; + +import java.util.Random; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.MathHelper; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.lwjgl.input.Keyboard; + +public class GuiCreateWorld extends GuiScreen { + private final GuiScreen field_146332_f; + private GuiTextField field_146333_g; + private GuiTextField field_146335_h; + private String field_146336_i; + private String field_146342_r = "survival"; + private boolean field_146341_s = true; + private boolean field_146340_t; + private boolean field_146339_u; + private boolean field_146338_v; + private boolean field_146337_w; + private boolean field_146345_x; + private boolean field_146344_y; + private GuiButton field_146343_z; + private GuiButton field_146324_A; + private GuiButton field_146325_B; + private GuiButton field_146326_C; + private GuiButton field_146320_D; + private GuiButton field_146321_E; + private GuiButton field_146322_F; + private String field_146323_G; + private String field_146328_H; + private String field_146329_I; + private String field_146330_J; + private int field_146331_K; + public String field_146334_a = ""; + private static final String[] field_146327_L = new String[] {"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; + + + public GuiCreateWorld(GuiScreen p_i46320_1_) { + this.field_146332_f = p_i46320_1_; + this.field_146329_I = ""; + this.field_146330_J = I18n.format("selectWorld.newWorld"); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146333_g.updateCursorCounter(); + this.field_146335_h.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("selectWorld.create"))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel"))); + this.buttonList.add(this.field_146343_z = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.format("selectWorld.gameMode"))); + this.buttonList.add(this.field_146324_A = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.format("selectWorld.moreWorldOptions"))); + this.buttonList.add(this.field_146325_B = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.format("selectWorld.mapFeatures"))); + this.field_146325_B.field_146125_m = false; + this.buttonList.add(this.field_146326_C = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.format("selectWorld.bonusItems"))); + this.field_146326_C.field_146125_m = false; + this.buttonList.add(this.field_146320_D = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.format("selectWorld.mapType"))); + this.field_146320_D.field_146125_m = false; + this.buttonList.add(this.field_146321_E = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.format("selectWorld.allowCommands"))); + this.field_146321_E.field_146125_m = false; + this.buttonList.add(this.field_146322_F = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.format("selectWorld.customizeType"))); + this.field_146322_F.field_146125_m = false; + this.field_146333_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146333_g.setFocused(true); + this.field_146333_g.setText(this.field_146330_J); + this.field_146335_h = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146335_h.setText(this.field_146329_I); + this.func_146316_a(this.field_146344_y); + this.func_146314_g(); + this.func_146319_h(); + } + + private void func_146314_g() { + this.field_146336_i = this.field_146333_g.getText().trim(); + char[] var1 = ChatAllowedCharacters.allowedCharacters; + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + char var4 = var1[var3]; + this.field_146336_i = this.field_146336_i.replace(var4, '_'); + } + + if (MathHelper.stringNullOrLengthZero(this.field_146336_i)) { + this.field_146336_i = "World"; + } + + this.field_146336_i = func_146317_a(this.mc.getSaveLoader(), this.field_146336_i); + } + + private void func_146319_h() { + this.field_146343_z.displayString = I18n.format("selectWorld.gameMode") + " " + I18n.format("selectWorld.gameMode." + this.field_146342_r); + this.field_146323_G = I18n.format("selectWorld.gameMode." + this.field_146342_r + ".line1"); + this.field_146328_H = I18n.format("selectWorld.gameMode." + this.field_146342_r + ".line2"); + this.field_146325_B.displayString = I18n.format("selectWorld.mapFeatures") + " "; + + if (this.field_146341_s) { + this.field_146325_B.displayString = this.field_146325_B.displayString + I18n.format("options.on"); + } else { + this.field_146325_B.displayString = this.field_146325_B.displayString + I18n.format("options.off"); + } + + this.field_146326_C.displayString = I18n.format("selectWorld.bonusItems") + " "; + + if (this.field_146338_v && !this.field_146337_w) { + this.field_146326_C.displayString = this.field_146326_C.displayString + I18n.format("options.on"); + } else { + this.field_146326_C.displayString = this.field_146326_C.displayString + I18n.format("options.off"); + } + + this.field_146320_D.displayString = I18n.format("selectWorld.mapType") + " " + I18n.format(WorldType.worldTypes[this.field_146331_K].getTranslateName()); + this.field_146321_E.displayString = I18n.format("selectWorld.allowCommands") + " "; + + if (this.field_146340_t && !this.field_146337_w) { + this.field_146321_E.displayString = this.field_146321_E.displayString + I18n.format("options.on"); + } else { + this.field_146321_E.displayString = this.field_146321_E.displayString + I18n.format("options.off"); + } + } + + public static String func_146317_a(ISaveFormat p_146317_0_, String p_146317_1_) { + p_146317_1_ = p_146317_1_.replaceAll("[\\./\"]", "_"); + String[] var2 = field_146327_L; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + String var5 = var2[var4]; + + if (p_146317_1_.equalsIgnoreCase(var5)) { + p_146317_1_ = "_" + p_146317_1_ + "_"; + } + } + + while (p_146317_0_.getWorldInfo(p_146317_1_) != null) { + p_146317_1_ = p_146317_1_ + "-"; + } + + return p_146317_1_; + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 1) { + this.mc.displayGuiScreen(this.field_146332_f); + } else if (p_146284_1_.id == 0) { + this.mc.displayGuiScreen(null); + + if (this.field_146345_x) { + return; + } + + this.field_146345_x = true; + long var2 = (new Random()).nextLong(); + String var4 = this.field_146335_h.getText(); + + if (!MathHelper.stringNullOrLengthZero(var4)) { + try { + long var5 = Long.parseLong(var4); + + if (var5 != 0L) { + var2 = var5; + } + } catch (NumberFormatException var7) { + var2 = var4.hashCode(); + } + } + + WorldSettings.GameType var8 = WorldSettings.GameType.getByName(this.field_146342_r); + WorldSettings var6 = new WorldSettings(var2, var8, this.field_146341_s, this.field_146337_w, WorldType.worldTypes[this.field_146331_K]); + var6.func_82750_a(this.field_146334_a); + + if (this.field_146338_v && !this.field_146337_w) { + var6.enableBonusChest(); + } + + if (this.field_146340_t && !this.field_146337_w) { + var6.enableCommands(); + } + + this.mc.launchIntegratedServer(this.field_146336_i, this.field_146333_g.getText().trim(), var6); + } else if (p_146284_1_.id == 3) { + this.func_146315_i(); + } else if (p_146284_1_.id == 2) { + if (this.field_146342_r.equals("survival")) { + if (!this.field_146339_u) { + this.field_146340_t = false; + } + + this.field_146337_w = false; + this.field_146342_r = "hardcore"; + this.field_146337_w = true; + this.field_146321_E.enabled = false; + this.field_146326_C.enabled = false; + this.func_146319_h(); + } else if (this.field_146342_r.equals("hardcore")) { + if (!this.field_146339_u) { + this.field_146340_t = true; + } + + this.field_146337_w = false; + this.field_146342_r = "creative"; + this.func_146319_h(); + this.field_146337_w = false; + this.field_146321_E.enabled = true; + this.field_146326_C.enabled = true; + } else { + if (!this.field_146339_u) { + this.field_146340_t = false; + } + + this.field_146342_r = "survival"; + this.func_146319_h(); + this.field_146321_E.enabled = true; + this.field_146326_C.enabled = true; + this.field_146337_w = false; + } + + this.func_146319_h(); + } else if (p_146284_1_.id == 4) { + this.field_146341_s = !this.field_146341_s; + this.func_146319_h(); + } else if (p_146284_1_.id == 7) { + this.field_146338_v = !this.field_146338_v; + this.func_146319_h(); + } else if (p_146284_1_.id == 5) { + ++this.field_146331_K; + + if (this.field_146331_K >= WorldType.worldTypes.length) { + this.field_146331_K = 0; + } + + while (WorldType.worldTypes[this.field_146331_K] == null || !WorldType.worldTypes[this.field_146331_K].getCanBeCreated()) { + ++this.field_146331_K; + + if (this.field_146331_K >= WorldType.worldTypes.length) { + this.field_146331_K = 0; + } + } + + this.field_146334_a = ""; + this.func_146319_h(); + this.func_146316_a(this.field_146344_y); + } else if (p_146284_1_.id == 6) { + this.field_146339_u = true; + this.field_146340_t = !this.field_146340_t; + this.func_146319_h(); + } else if (p_146284_1_.id == 8) { + this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.field_146334_a)); + } + } + } + + private void func_146315_i() { + this.func_146316_a(!this.field_146344_y); + } + + private void func_146316_a(boolean p_146316_1_) { + this.field_146344_y = p_146316_1_; + this.field_146343_z.field_146125_m = !this.field_146344_y; + this.field_146325_B.field_146125_m = this.field_146344_y; + this.field_146326_C.field_146125_m = this.field_146344_y; + this.field_146320_D.field_146125_m = this.field_146344_y; + this.field_146321_E.field_146125_m = this.field_146344_y; + this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.worldTypes[this.field_146331_K] == WorldType.FLAT; + + if (this.field_146344_y) { + this.field_146324_A.displayString = I18n.format("gui.done"); + } else { + this.field_146324_A.displayString = I18n.format("selectWorld.moreWorldOptions"); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (this.field_146333_g.isFocused() && !this.field_146344_y) { + this.field_146333_g.keyTyped(p_73869_1_, p_73869_2_); + this.field_146330_J = this.field_146333_g.getText(); + } else if (this.field_146335_h.isFocused() && this.field_146344_y) { + this.field_146335_h.keyTyped(p_73869_1_, p_73869_2_); + this.field_146329_I = this.field_146335_h.getText(); + } + + if (p_73869_2_ == 28 || p_73869_2_ == 156) { + this.actionPerformed(this.buttonList.get(0)); + } + + this.buttonList.get(0).enabled = this.field_146333_g.getText().length() > 0; + this.func_146314_g(); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + + if (this.field_146344_y) { + this.field_146335_h.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } else { + this.field_146333_g.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.create"), this.width / 2, 20, -1); + + if (this.field_146344_y) { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterSeed"), this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.seedInfo"), this.width / 2 - 100, 85, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.mapFeatures.info"), this.width / 2 - 150, 122, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.allowCommands.info"), this.width / 2 - 150, 172, -6250336); + this.field_146335_h.drawTextBox(); + + if (WorldType.worldTypes[this.field_146331_K].func_151357_h()) { + this.fontRendererObj.drawSplitString(I18n.format(WorldType.worldTypes[this.field_146331_K].func_151359_c()), this.field_146320_D.field_146128_h + 2, this.field_146320_D.field_146129_i + 22, this.field_146320_D.func_146117_b(), 10526880); + } + } else { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName"), this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.resultFolder") + " " + this.field_146336_i, this.width / 2 - 100, 85, -6250336); + this.field_146333_g.drawTextBox(); + this.drawString(this.fontRendererObj, this.field_146323_G, this.width / 2 - 100, 137, -6250336); + this.drawString(this.fontRendererObj, this.field_146328_H, this.width / 2 - 100, 149, -6250336); + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + public void func_146318_a(WorldInfo p_146318_1_) { + this.field_146330_J = I18n.format("selectWorld.newWorld.copyOf", p_146318_1_.getWorldName()); + this.field_146329_I = p_146318_1_.getSeed() + ""; + this.field_146331_K = p_146318_1_.getTerrainType().getWorldTypeID(); + this.field_146334_a = p_146318_1_.getGeneratorOptions(); + this.field_146341_s = p_146318_1_.isMapFeaturesEnabled(); + this.field_146340_t = p_146318_1_.areCommandsAllowed(); + + if (p_146318_1_.isHardcoreModeEnabled()) { + this.field_146342_r = "hardcore"; + } else if (p_146318_1_.getGameType().isSurvivalOrAdventure()) { + this.field_146342_r = "survival"; + } else if (p_146318_1_.getGameType().isCreative()) { + this.field_146342_r = "creative"; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiDisconnected.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiDisconnected.java new file mode 100644 index 0000000..18a4b8c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiDisconnected.java @@ -0,0 +1,77 @@ +package net.minecraft.client.gui; + +import java.util.Iterator; +import java.util.List; + +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.IChatComponent; + +public class GuiDisconnected extends GuiScreen { + private final String field_146306_a; + private final IChatComponent field_146304_f; + private List field_146305_g; + private final GuiScreen field_146307_h; + + + public GuiDisconnected(GuiScreen p_i45020_1_, String p_i45020_2_, IChatComponent p_i45020_3_) { + this.field_146307_h = p_i45020_1_; + this.field_146306_a = I18n.format(p_i45020_2_); + this.field_146304_f = p_i45020_3_; + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) {} + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + int n = this.height / 2 - 30 + (this.field_146305_g != null ? (this.field_146305_g.size() + 1) * this.fontRendererObj.FONT_HEIGHT : 40); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, n + 12, I18n.format("gui.toMenu", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, n + 36, "Reconnect")); + this.field_146305_g = this.fontRendererObj.listFormattedStringToWidth(this.field_146304_f.getFormattedText(), this.width - 50); + } + + protected void actionPerformed(GuiButton guiButton) { + if (guiButton.id == 0) { + this.mc.displayGuiScreen(this.field_146307_h); + } + if (guiButton.id == 0) { + if (this.field_146307_h instanceof GuiDisconnected) { + this.mc.displayGuiScreen(new GuiMultiplayer(new VanillaMenu())); + } else { + this.mc.displayGuiScreen(this.field_146307_h); + } + } + if (guiButton.id == 1) { + if (this.mc.playerServerData != null) { + this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, this.mc.playerServerData)); + } else if (this.mc.currentServerData != null) { + this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, this.mc.currentServerData)); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146306_a, this.width / 2, this.height / 2 - 50, 11184810); + int var4 = this.height / 2 - 30; + + if (this.field_146305_g != null) { + for (Iterator var5 = this.field_146305_g.iterator(); var5.hasNext(); var4 += this.fontRendererObj.FONT_HEIGHT) { + String var6 = (String)var5.next(); + this.drawCenteredString(this.fontRendererObj, var6, this.width / 2, var4, 16777215); + } + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java new file mode 100644 index 0000000..1f1cb64 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java @@ -0,0 +1,83 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.play.client.C00PacketKeepAlive; + +public class GuiDownloadTerrain extends GuiScreen { + private final NetHandlerPlayClient field_146594_a; + private int field_146593_f; + private long lastMouseEvent; + + + public GuiDownloadTerrain(NetHandlerPlayClient p_i45023_1_) { + this.field_146594_a = p_i45023_1_; + this.lastMouseEvent = System.currentTimeMillis(); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) {} + + protected void actionPerformed(GuiButton guiButton) { + if (this.mc.currentServerData != null && this.mc.theWorld != null) { + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld((WorldClient)null); + } + if (guiButton.id == 1) { + this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, this.mc.playerServerData)); + } + if (guiButton.id == 2) { + this.mc.displayGuiScreen(new VanillaMenu()); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + ++this.field_146593_f; + + if (this.field_146594_a == null) { + return; + } + if (System.currentTimeMillis() - this.lastMouseEvent >= 5000L && this.buttonList.isEmpty()) { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 36, 99, 20, "Reconnect")); + this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 4 + 120 + 36, 99, 20, "Disconnect")); + } + if (this.field_146593_f % 20 == 0) { + this.field_146594_a.addToSendQueue(new C00PacketKeepAlive()); + } + + if (this.field_146594_a != null) { + this.field_146594_a.onNetworkTick(); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.func_146278_c(0); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 50, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiEnchantment.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiEnchantment.java new file mode 100644 index 0000000..ac91ecc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiEnchantment.java @@ -0,0 +1,228 @@ +package net.minecraft.client.gui; + +import java.util.Random; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerEnchantment; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnchantmentNameParts; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.lwjgl.util.glu.Project; + +public class GuiEnchantment extends GuiContainer { + private static final ResourceLocation field_147078_C = new ResourceLocation("textures/gui/container/enchanting_table.png"); + private static final ResourceLocation field_147070_D = new ResourceLocation("textures/entity/enchanting_table_book.png"); + private static final ModelBook field_147072_E = new ModelBook(); + private final Random field_147074_F = new Random(); + private final ContainerEnchantment field_147075_G; + public int field_147073_u; + public float field_147071_v; + public float field_147069_w; + public float field_147082_x; + public float field_147081_y; + public float field_147080_z; + public float field_147076_A; + ItemStack field_147077_B; + private final String field_147079_H; + + + public GuiEnchantment(InventoryPlayer p_i46398_1_, World p_i46398_2_, int p_i46398_3_, int p_i46398_4_, int p_i46398_5_, String p_i46398_6_) { + super(new ContainerEnchantment(p_i46398_1_, p_i46398_2_, p_i46398_3_, p_i46398_4_, p_i46398_5_)); + this.field_147075_G = (ContainerEnchantment)this.field_147002_h; + this.field_147079_H = p_i46398_6_; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(this.field_147079_H == null ? I18n.format("container.enchant") : this.field_147079_H, 12, 5, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.field_147000_g - 96 + 2, 4210752); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + this.func_147068_g(); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + + for (int var6 = 0; var6 < 3; ++var6) { + int var7 = p_73864_1_ - (var4 + 60); + int var8 = p_73864_2_ - (var5 + 14 + 19 * var6); + + if (var7 >= 0 && var8 >= 0 && var7 < 108 && var8 < 19 && this.field_147075_G.enchantItem(this.mc.thePlayer, var6)) { + this.mc.playerController.sendEnchantPacket(this.field_147075_G.windowId, var6); + } + } + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147078_C); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + ScaledResolution var6 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + GL11.glViewport((var6.getScaledWidth() - 320) / 2 * var6.getScaleFactor(), (var6.getScaledHeight() - 240) / 2 * var6.getScaleFactor(), 320 * var6.getScaleFactor(), 240 * var6.getScaleFactor()); + GL11.glTranslatef(-0.34F, 0.23F, 0.0F); + Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); + float var7 = 1.0F; + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + RenderHelper.enableStandardItemLighting(); + GL11.glTranslatef(0.0F, 3.3F, -16.0F); + GL11.glScalef(var7, var7, var7); + float var8 = 5.0F; + GL11.glScalef(var8, var8, var8); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147070_D); + GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); + float var9 = this.field_147076_A + (this.field_147080_z - this.field_147076_A) * p_146976_1_; + GL11.glTranslatef((1.0F - var9) * 0.2F, (1.0F - var9) * 0.1F, (1.0F - var9) * 0.25F); + GL11.glRotatef(-(1.0F - var9) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + float var10 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * p_146976_1_ + 0.25F; + float var11 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * p_146976_1_ + 0.75F; + var10 = (var10 - (float)MathHelper.truncateDoubleToInt(var10)) * 1.6F - 0.3F; + var11 = (var11 - (float)MathHelper.truncateDoubleToInt(var11)) * 1.6F - 0.3F; + + if (var10 < 0.0F) { + var10 = 0.0F; + } + + if (var11 < 0.0F) { + var11 = 0.0F; + } + + if (var10 > 1.0F) { + var10 = 1.0F; + } + + if (var11 > 1.0F) { + var11 = 1.0F; + } + + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + field_147072_E.render(null, 0.0F, var10, var11, var9, 0.0F, 0.0625F); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + RenderHelper.disableStandardItemLighting(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + EnchantmentNameParts.instance.reseedRandomGenerator(this.field_147075_G.nameSeed); + + for (int var12 = 0; var12 < 3; ++var12) { + String var13 = EnchantmentNameParts.instance.generateNewRandomName(); + zLevel = 0.0F; + this.mc.getTextureManager().bindTexture(field_147078_C); + int var14 = this.field_147075_G.enchantLevels[var12]; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (var14 == 0) { + drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); + } else { + String var15 = "" + var14; + FontRenderer var16 = this.mc.standardGalacticFontRenderer; + int var17 = 6839882; + + if (this.mc.thePlayer.experienceLevel < var14 && !this.mc.thePlayer.capabilities.isCreativeMode) { + drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); + var16.drawSplitString(var13, var4 + 62, var5 + 16 + 19 * var12, 104, (var17 & 16711422) >> 1); + var16 = this.mc.fontRenderer; + var17 = 4226832; + var16.drawStringWithShadow(var15, var4 + 62 + 104 - var16.getStringWidth(var15), var5 + 16 + 19 * var12 + 7, var17); + } else { + int var18 = p_146976_2_ - (var4 + 60); + int var19 = p_146976_3_ - (var5 + 14 + 19 * var12); + + if (var18 >= 0 && var19 >= 0 && var18 < 108 && var19 < 19) { + drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 204, 108, 19); + var17 = 16777088; + } else { + drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 166, 108, 19); + } + + var16.drawSplitString(var13, var4 + 62, var5 + 16 + 19 * var12, 104, var17); + var16 = this.mc.fontRenderer; + var17 = 8453920; + var16.drawStringWithShadow(var15, var4 + 62 + 104 - var16.getStringWidth(var15), var5 + 16 + 19 * var12 + 7, var17); + } + } + } + } + + public void func_147068_g() { + ItemStack var1 = this.field_147002_h.getSlot(0).getStack(); + + if (!ItemStack.areItemStacksEqual(var1, this.field_147077_B)) { + this.field_147077_B = var1; + + do { + this.field_147082_x += (float)(this.field_147074_F.nextInt(4) - this.field_147074_F.nextInt(4)); + } + while (this.field_147071_v <= this.field_147082_x + 1.0F && this.field_147071_v >= this.field_147082_x - 1.0F); + } + + ++this.field_147073_u; + this.field_147069_w = this.field_147071_v; + this.field_147076_A = this.field_147080_z; + boolean var2 = false; + + for (int var3 = 0; var3 < 3; ++var3) { + if (this.field_147075_G.enchantLevels[var3] != 0) { + var2 = true; + } + } + + if (var2) { + this.field_147080_z += 0.2F; + } else { + this.field_147080_z -= 0.2F; + } + + if (this.field_147080_z < 0.0F) { + this.field_147080_z = 0.0F; + } + + if (this.field_147080_z > 1.0F) { + this.field_147080_z = 1.0F; + } + + float var5 = (this.field_147082_x - this.field_147071_v) * 0.4F; + float var4 = 0.2F; + + if (var5 < -var4) { + var5 = -var4; + } + + if (var5 > var4) { + var5 = var4; + } + + this.field_147081_y += (var5 - this.field_147081_y) * 0.9F; + this.field_147071_v += this.field_147081_y; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java new file mode 100644 index 0000000..dbe0587 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiErrorScreen.java @@ -0,0 +1,41 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.resources.I18n; + +public class GuiErrorScreen extends GuiScreen { + private final String field_146313_a; + private final String field_146312_f; + + + public GuiErrorScreen(String p_i46319_1_, String p_i46319_2_) { + this.field_146313_a = p_i46319_1_; + this.field_146312_f = p_i46319_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + super.initGui(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.format("gui.cancel"))); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224); + this.drawCenteredString(this.fontRendererObj, this.field_146313_a, this.width / 2, 90, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146312_f, this.width / 2, 110, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) {} + + protected void actionPerformed(GuiButton p_146284_1_) { + this.mc.displayGuiScreen(null); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java new file mode 100644 index 0000000..1b99b65 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiFlatPresets.java @@ -0,0 +1,229 @@ +package net.minecraft.client.gui; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiFlatPresets extends GuiScreen { + private static final RenderItem field_146437_a = new RenderItem(); + private static final List field_146431_f = new ArrayList(); + private final GuiCreateFlatWorld field_146432_g; + private String field_146438_h; + private String field_146439_i; + private String field_146436_r; + private GuiFlatPresets.ListSlot field_146435_s; + private GuiButton field_146434_t; + private GuiTextField field_146433_u; + + + public GuiFlatPresets(GuiCreateFlatWorld p_i46378_1_) { + this.field_146432_g = p_i46378_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.field_146438_h = I18n.format("createWorld.customize.presets.title"); + this.field_146439_i = I18n.format("createWorld.customize.presets.share"); + this.field_146436_r = I18n.format("createWorld.customize.presets.list"); + this.field_146433_u = new GuiTextField(this.fontRendererObj, 50, 40, this.width - 100, 20); + this.field_146435_s = new GuiFlatPresets.ListSlot(); + this.field_146433_u.setMaxStringLength(1230); + this.field_146433_u.setText(this.field_146432_g.func_146384_e()); + this.buttonList.add(this.field_146434_t = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("createWorld.customize.presets.select"))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel"))); + this.func_146426_g(); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + this.field_146433_u.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (!this.field_146433_u.keyTyped(p_73869_1_, p_73869_2_)) { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 0 && this.func_146430_p()) { + this.field_146432_g.func_146383_a(this.field_146433_u.getText()); + this.mc.displayGuiScreen(this.field_146432_g); + } else if (p_146284_1_.id == 1) { + this.mc.displayGuiScreen(this.field_146432_g); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.field_146435_s.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, this.field_146438_h, this.width / 2, 8, 16777215); + this.drawString(this.fontRendererObj, this.field_146439_i, 50, 30, 10526880); + this.drawString(this.fontRendererObj, this.field_146436_r, 50, 70, 10526880); + this.field_146433_u.drawTextBox(); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146433_u.updateCursorCounter(); + super.updateScreen(); + } + + public void func_146426_g() { + boolean var1 = this.func_146430_p(); + this.field_146434_t.enabled = var1; + } + + private boolean func_146430_p() { + return this.field_146435_s.field_148175_k > -1 && this.field_146435_s.field_148175_k < field_146431_f.size() || this.field_146433_u.getText().length() > 1; + } + + private static void func_146425_a(String p_146425_0_, Item p_146425_1_, BiomeGenBase p_146425_2_, FlatLayerInfo ... p_146425_3_) { + func_146421_a(p_146425_0_, p_146425_1_, p_146425_2_, null, p_146425_3_); + } + + private static void func_146421_a(String p_146421_0_, Item p_146421_1_, BiomeGenBase p_146421_2_, List p_146421_3_, FlatLayerInfo ... p_146421_4_) { + FlatGeneratorInfo var5 = new FlatGeneratorInfo(); + + for (int var6 = p_146421_4_.length - 1; var6 >= 0; --var6) { + var5.getFlatLayers().add(p_146421_4_[var6]); + } + + var5.setBiome(p_146421_2_.biomeID); + var5.func_82645_d(); + + if (p_146421_3_ != null) { + Iterator var8 = p_146421_3_.iterator(); + + while (var8.hasNext()) { + String var7 = (String)var8.next(); + var5.getWorldFeatures().put(var7, new HashMap()); + } + } + + field_146431_f.add(new GuiFlatPresets.LayerItem(p_146421_1_, p_146421_0_, var5.toString())); + } + + static { + func_146421_a("Classic Flat", Item.getItemFromBlock(Blocks.grass), BiomeGenBase.plains, Arrays.asList("village"), new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(2, Blocks.dirt), new FlatLayerInfo(1, Blocks.bedrock)); + func_146421_a("Tunnelers' Dream", Item.getItemFromBlock(Blocks.stone), BiomeGenBase.extremeHills, Arrays.asList("biome_1", "dungeon", "decoration", "stronghold", "mineshaft"), new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(5, Blocks.dirt), new FlatLayerInfo(230, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)); + func_146421_a("Water World", Item.getItemFromBlock(Blocks.flowing_water), BiomeGenBase.plains, Arrays.asList("village", "biome_1"), new FlatLayerInfo(90, Blocks.water), new FlatLayerInfo(5, Blocks.sand), new FlatLayerInfo(5, Blocks.dirt), new FlatLayerInfo(5, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)); + func_146421_a("Overworld", Item.getItemFromBlock(Blocks.tallgrass), BiomeGenBase.plains, Arrays.asList("village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"), new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(59, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)); + func_146421_a("Snowy Kingdom", Item.getItemFromBlock(Blocks.snow_layer), BiomeGenBase.icePlains, Arrays.asList("village", "biome_1"), new FlatLayerInfo(1, Blocks.snow_layer), new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(59, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)); + func_146421_a("Bottomless Pit", Items.feather, BiomeGenBase.plains, Arrays.asList("village", "biome_1"), new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(2, Blocks.cobblestone)); + func_146421_a("Desert", Item.getItemFromBlock(Blocks.sand), BiomeGenBase.desert, Arrays.asList("village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"), new FlatLayerInfo(8, Blocks.sand), new FlatLayerInfo(52, Blocks.sandstone), new FlatLayerInfo(3, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)); + func_146425_a("Redstone Ready", Items.redstone, BiomeGenBase.desert, new FlatLayerInfo(52, Blocks.sandstone), new FlatLayerInfo(3, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)); + } + + static class LayerItem { + public Item field_148234_a; + public String field_148232_b; + public String field_148233_c; + + + public LayerItem(Item p_i45022_1_, String p_i45022_2_, String p_i45022_3_) { + this.field_148234_a = p_i45022_1_; + this.field_148232_b = p_i45022_2_; + this.field_148233_c = p_i45022_3_; + } + } + + class ListSlot extends GuiSlot { + public int field_148175_k = -1; + + + public ListSlot() { + super(GuiFlatPresets.this.mc, GuiFlatPresets.this.width, GuiFlatPresets.this.height, 80, GuiFlatPresets.this.height - 37, 24); + } + + private void func_148172_a(int p_148172_1_, int p_148172_2_, Item p_148172_3_) { + this.func_148173_e(p_148172_1_ + 1, p_148172_2_ + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + GuiFlatPresets.field_146437_a.renderItemIntoGUI(GuiFlatPresets.this.fontRendererObj, GuiFlatPresets.this.mc.getTextureManager(), new ItemStack(p_148172_3_, 1, 0), p_148172_1_ + 2, p_148172_2_ + 2); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + private void func_148173_e(int p_148173_1_, int p_148173_2_) { + this.func_148171_c(p_148173_1_, p_148173_2_, 0, 0); + } + + private void func_148171_c(int p_148171_1_, int p_148171_2_, int p_148171_3_, int p_148171_4_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiFlatPresets.this.mc.getTextureManager().bindTexture(Gui.statIcons); + float var5 = 0.0078125F; + float var6 = 0.0078125F; + boolean var7 = true; + boolean var8 = true; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(p_148171_1_ + 0, p_148171_2_ + 18, zLevel, (float)(p_148171_3_ + 0) * 0.0078125F, (float)(p_148171_4_ + 18) * 0.0078125F); + var9.addVertexWithUV(p_148171_1_ + 18, p_148171_2_ + 18, zLevel, (float)(p_148171_3_ + 18) * 0.0078125F, (float)(p_148171_4_ + 18) * 0.0078125F); + var9.addVertexWithUV(p_148171_1_ + 18, p_148171_2_ + 0, zLevel, (float)(p_148171_3_ + 18) * 0.0078125F, (float)(p_148171_4_ + 0) * 0.0078125F); + var9.addVertexWithUV(p_148171_1_ + 0, p_148171_2_ + 0, zLevel, (float)(p_148171_3_ + 0) * 0.0078125F, (float)(p_148171_4_ + 0) * 0.0078125F); + var9.draw(); + } + + protected int getSize() { + return GuiFlatPresets.field_146431_f.size(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) { + this.field_148175_k = p_148144_1_; + GuiFlatPresets.this.func_146426_g(); + GuiFlatPresets.this.field_146433_u.setText(((GuiFlatPresets.LayerItem)GuiFlatPresets.field_146431_f.get(GuiFlatPresets.this.field_146435_s.field_148175_k)).field_148233_c); + } + + protected boolean isSelected(int p_148131_1_) { + return p_148131_1_ == this.field_148175_k; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + GuiFlatPresets.LayerItem var8 = (GuiFlatPresets.LayerItem)GuiFlatPresets.field_146431_f.get(p_148126_1_); + this.func_148172_a(p_148126_2_, p_148126_3_, var8.field_148234_a); + GuiFlatPresets.this.fontRendererObj.drawString(var8.field_148232_b, p_148126_2_ + 18 + 5, p_148126_3_ + 6, 16777215); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiGameOver.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiGameOver.java new file mode 100644 index 0000000..669c07c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiGameOver.java @@ -0,0 +1,115 @@ +package net.minecraft.client.gui; + +import java.util.Iterator; + +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +public class GuiGameOver extends GuiScreen implements GuiYesNoCallback { + private int field_146347_a; + private final boolean field_146346_f = false; + + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + + if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { + if (this.mc.isIntegratedServerRunning()) { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.deleteWorld"))); + } else { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.leaveServer"))); + } + } else { + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 72, I18n.format("deathScreen.respawn"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.titleScreen"))); + + if (this.mc.getSession() == null) { + this.buttonList.get(1).enabled = false; + } + } + + GuiButton var2; + + for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = false) { + var2 = (GuiButton)var1.next(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) {} + + protected void actionPerformed(GuiButton p_146284_1_) { + switch (p_146284_1_.id) { + case 0: + this.mc.thePlayer.respawnPlayer(); + this.mc.displayGuiScreen(null); + break; + + case 1: + GuiYesNo var2 = new GuiYesNo(this, I18n.format("deathScreen.quit.confirm"), "", I18n.format("deathScreen.titleScreen"), I18n.format("deathScreen.respawn"), 0); + this.mc.displayGuiScreen(var2); + var2.func_146350_a(20); + } + } + + public void confirmClicked(boolean p_73878_1_, int p_73878_2_) { + if (p_73878_1_) { + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld(null); + this.mc.displayGuiScreen(new VanillaMenu()); + } else { + this.mc.thePlayer.respawnPlayer(); + this.mc.displayGuiScreen(null); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792); + GL11.glPushMatrix(); + GL11.glScalef(2.0F, 2.0F, 2.0F); + boolean var4 = this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(); + String var5 = var4 ? I18n.format("deathScreen.title.hardcore") : I18n.format("deathScreen.title"); + this.drawCenteredString(this.fontRendererObj, var5, this.width / 2 / 2, 30, 16777215); + GL11.glPopMatrix(); + + if (var4) { + this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.hardcoreInfo"), this.width / 2, 144, 16777215); + } + + this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.score") + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return false; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + ++this.field_146347_a; + GuiButton var2; + + if (this.field_146347_a == 20) { + for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) { + var2 = (GuiButton)var1.next(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiHopper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiHopper.java new file mode 100644 index 0000000..06312d8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiHopper.java @@ -0,0 +1,37 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerHopper; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiHopper extends GuiContainer { + private static final ResourceLocation field_147085_u = new ResourceLocation("textures/gui/container/hopper.png"); + private final IInventory field_147084_v; + private final IInventory field_147083_w; + + + public GuiHopper(InventoryPlayer p_i1092_1_, IInventory p_i1092_2_) { + super(new ContainerHopper(p_i1092_1_, p_i1092_2_)); + this.field_147084_v = p_i1092_1_; + this.field_147083_w = p_i1092_2_; + this.field_146291_p = false; + this.field_147000_g = 133; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(this.field_147083_w.isInventoryNameLocalized() ? this.field_147083_w.getInventoryName() : I18n.format(this.field_147083_w.getInventoryName()), 8, 6, 4210752); + this.fontRendererObj.drawString(this.field_147084_v.isInventoryNameLocalized() ? this.field_147084_v.getInventoryName() : I18n.format(this.field_147084_v.getInventoryName()), 8, this.field_147000_g - 96 + 2, 4210752); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147085_u); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiIngame.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiIngame.java new file mode 100644 index 0000000..144aa9f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiIngame.java @@ -0,0 +1,967 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.GuiDrawBypassDebugEvent; +import com.cheatbreaker.client.event.impl.GuiDrawEvent; +import com.cheatbreaker.client.event.impl.PreviewDrawEvent; +import com.cheatbreaker.client.module.impl.normal.ModulePackTweaks; +import com.cheatbreaker.client.module.impl.normal.hud.cooldowns.ModuleCooldowns; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleNickHider; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.module.ModulePlaceGui; +import com.cheatbreaker.client.ui.module.ProfileCreatorGui; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.*; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.chunk.Chunk; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import java.awt.*; +import java.util.List; +import java.util.Random; + +public class GuiIngame extends Gui { + private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); + private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); + private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); + private static final RenderItem itemRenderer = new RenderItem(); + private final Random rand = new Random(); + private final Minecraft mc; + + /** ChatGUI instance that retains all previous chat data */ + private final GuiNewChat persistantChatGUI; + private int updateCounter; + + /** The string specifying which record music is playing */ + private String recordPlaying = ""; + + /** How many ticks the record playing message will be displayed */ + private int recordPlayingUpFor; + private boolean recordIsPlaying; + + /** Previous frame vignette brightness (slowly changes by 1% each frame) */ + public float prevVignetteBrightness = 1.0F; + + /** Remaining ticks the item highlight should be visible */ + private int remainingHighlightTicks; + + /** The ItemStack that is currently being highlighted */ + private ItemStack highlightingItemStack; + public static boolean uploadingScreenshot = false; + + + public GuiIngame(Minecraft p_i46379_1_) { + this.mc = p_i46379_1_; + this.persistantChatGUI = new GuiNewChat(p_i46379_1_); + } + + /** + * Render the ingame overlay with quick icon bar, ... + */ + public void renderGameOverlay(float p_73830_1_, boolean p_73830_2_, int p_73830_3_, int p_73830_4_) { + ScaledResolution var5 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var6 = var5.getScaledWidth(); + int var7 = var5.getScaledHeight(); + FontRenderer var8 = this.mc.fontRenderer; + this.mc.entityRenderer.setupOverlayRendering(); + GL11.glEnable(GL11.GL_BLEND); + + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + boolean ptIsEnabled = pt.isEnabled(); + + if (Minecraft.isFancyGraphicsEnabled() || (pt.forceVignette.getValue().equals("Static") && ptIsEnabled)) { + this.renderVignette(this.mc.thePlayer.getBrightness(p_73830_1_), var6, var7); + } else { + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3); + + boolean showPumpOverlay = !ptIsEnabled || (boolean) pt.pumpkinOverlay.getValue(); + if (this.mc.gameSettings.thirdPersonView == 0 && var9 != null && var9.getItem() == Item.getItemFromBlock(Blocks.pumpkin) && showPumpOverlay) { + this.renderPumpkinBlur(var6, var7); + } + + if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) { + float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * p_73830_1_; + + if (var10 > 0.0F) { + this.func_130015_b(var10, var6, var7); + } + } + + int var11; + int var12; + int var13; + + float hotbarScaleModifier = 1.0F; + switch (CheatBreaker.getInstance().getGlobalSettings().hotbarScale.getStringValue()) { + case "Small": + hotbarScaleModifier *= 0.5F / CheatBreaker.getScaleFactor(); + break; + case "Normal": + hotbarScaleModifier /= CheatBreaker.getScaleFactor(); + break; + case "Large": + hotbarScaleModifier *= 1.5F / CheatBreaker.getScaleFactor(); + break; + case "Auto": + hotbarScaleModifier *= 2.0F / CheatBreaker.getScaleFactor(); + } + hotbarScaleModifier *= CheatBreaker.getInstance().getGlobalSettings().hotbarScaleMultiplier.getFloatValue(); + + if (!this.mc.playerController.enableEverythingIsScrewedUpMode()) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(widgetsTexPath); + InventoryPlayer var31 = this.mc.thePlayer.inventory; + zLevel = -90.0F; + GL11.glPushMatrix(); + GL11.glScalef(hotbarScaleModifier, hotbarScaleModifier, hotbarScaleModifier); + drawTexturedModalRect(var6 / 2 / hotbarScaleModifier - 91, var7 / hotbarScaleModifier - 22, 0, 0, 182, 22); + drawTexturedModalRect(var6 / 2 / hotbarScaleModifier - 91 - 1 + var31.currentItem * 20, var7 / hotbarScaleModifier - 22 - 1, 0, 22, 24, 22); + GL11.glPopMatrix(); + if (CheatBreaker.getInstance().getModuleManager().crosshairMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().crosshairMod.drawCrosshair(var6 / 2, var7 / 2, true); + } else { + this.mc.getTextureManager().bindTexture(icons); + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + this.mc.mcProfiler.startSection("bossHealth"); + if (!CheatBreaker.getInstance().getModuleManager().bossBarMod.isRenderHud() && CheatBreaker.getInstance().getModuleManager().bossBarMod.isEnabled()) { + ScaledResolution sr = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + CheatBreaker.getInstance().getModuleManager().bossBarMod.render(BossStatus.bossName, BossStatus.healthScale, sr.getScaledWidth() / 2 - 91, 12); + } + + this.mc.mcProfiler.endSection(); + GL11.glPushMatrix(); + if (this.mc.playerController.shouldDrawHUD()) { + this.func_110327_a(var6, var7, hotbarScaleModifier); + } + GL11.glPopMatrix(); + + this.mc.mcProfiler.startSection("actionBar"); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + + GL11.glPushMatrix(); + GL11.glScalef(hotbarScaleModifier, hotbarScaleModifier, hotbarScaleModifier); + for (var11 = 0; var11 < 9; ++var11) { + var12 = (int)(var6 / 2 / hotbarScaleModifier) - 90 + var11 * 20 + 2; + var13 = (int)(var7 / hotbarScaleModifier) - 16 - 3; + this.renderInventorySlot(var11, var12, var13, p_73830_1_); + } + GL11.glPopMatrix(); + + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + this.mc.mcProfiler.endSection(); + GL11.glDisable(GL11.GL_BLEND); + } + + int var32; + + if (this.mc.thePlayer.getSleepTimer() > 0) { + this.mc.mcProfiler.startSection("sleep"); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_ALPHA_TEST); + var32 = this.mc.thePlayer.getSleepTimer(); + float var33 = (float)var32 / 100.0F; + + if (var33 > 1.0F) { + var33 = 1.0F - (float)(var32 - 100) / 10.0F; + } + + var12 = (int)(220.0F * var33) << 24 | 1052704; + drawRect(0, 0, var6, var7, var12); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_DEPTH_TEST); + this.mc.mcProfiler.endSection(); + } + + var32 = 16777215; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + var11 = (int)(var6 / 2 / hotbarScaleModifier) - 91; + int var14; + int var15; + int var16; + int var17; + float var34; + short var38; + GL11.glPushMatrix(); + GL11.glScalef(hotbarScaleModifier, hotbarScaleModifier, hotbarScaleModifier); + if (this.mc.thePlayer.isRidingHorse()) { + + this.mc.mcProfiler.startSection("jumpBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); + var34 = this.mc.thePlayer.getHorseJumpPower(); + var38 = 182; + var14 = (int)(var34 * (float)(var38 + 1)); + var15 = (int)(var7 / hotbarScaleModifier) - 32 + 3; + drawTexturedModalRect(var11, var15, 0, 84, var38, 5); + + if (var14 > 0) { + drawTexturedModalRect(var11, var15, 0, 89, var14, 5); + } + + this.mc.mcProfiler.endSection(); + } else if (this.mc.playerController.gameIsSurvivalOrAdventure()) { + this.mc.mcProfiler.startSection("expBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); + var12 = this.mc.thePlayer.xpBarCap(); + + if (this.mc.thePlayer.experience >= 0.992F && !this.mc.isIntegratedServerRunning() && this.mc.theWorld != null && CheatBreaker.getInstance().getModuleManager().cooldownsMod.useEXP.getBooleanValue()) { + ModuleCooldowns.addCooldown("EnderPearl", (long) (this.mc.thePlayer.experience * 15900L), 368); + //System.out.println(this.IllIIIIIIIlIlIllllIIllIII.IlIlllIIIIllIllllIllIIlIl.lllIIlIIIllIIlllIlIIIllIl); + } + + if (var12 > 0) { + var38 = 182; + var14 = (int)(this.mc.thePlayer.experience * (float)(var38 + 1)); + var15 = (int)(var7 / hotbarScaleModifier) - 32 + 3; + drawTexturedModalRect(var11, var15, 0, 64, var38, 5); + + if (var14 > 0) { + drawTexturedModalRect(var11, var15, 0, 69, var14, 5); + } + } + + this.mc.mcProfiler.endSection(); + + if (this.mc.thePlayer.experienceLevel > 0) { + this.mc.mcProfiler.startSection("expLevel"); + boolean var39 = false; + var14 = var39 ? 16777215 : 8453920; + String var43 = "" + this.mc.thePlayer.experienceLevel; + var16 = ((int)(var6 / hotbarScaleModifier) - var8.getStringWidth(var43)) / 2; + var17 = (int)(var7 / hotbarScaleModifier) - 31 - 4; + boolean var18 = false; + var8.drawString(var43, var16 + 1, var17, 0); + var8.drawString(var43, var16 - 1, var17, 0); + var8.drawString(var43, var16, var17 + 1, 0); + var8.drawString(var43, var16, var17 - 1, 0); + var8.drawString(var43, var16, var17, var14); + this.mc.mcProfiler.endSection(); + } + } + GL11.glPopMatrix(); + + String var35; + + + if (this.mc.gameSettings.heldItemTooltips) { + GL11.glPushMatrix(); + GL11.glScalef(hotbarScaleModifier, hotbarScaleModifier, hotbarScaleModifier); + this.mc.mcProfiler.startSection("toolHighlight"); + + if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) { + var35 = this.highlightingItemStack.getDisplayName(); + var13 = ((int)(var6 / hotbarScaleModifier) - var8.getStringWidth(var35)) / 2; + var14 = (int)(var7 / hotbarScaleModifier) - 59; + + if (!this.mc.playerController.shouldDrawHUD()) { + var14 += 14; + } + + var15 = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); + + if (var15 > 255) { + var15 = 255; + } + + if (var15 > 0) { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + var8.drawStringWithShadow(var35, var13, var14, 16777215 + (var15 << 24)); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + + this.mc.mcProfiler.endSection(); + } + GL11.glPopMatrix(); + + if (this.mc.isDemo()) { + this.mc.mcProfiler.startSection("demo"); + var35 = ""; + + if (this.mc.theWorld.getTotalWorldTime() >= 120500L) { + var35 = I18n.format("demo.demoExpired"); + } else { + var35 = I18n.format("demo.remainingTime", StringUtils.ticksToElapsedTime((int)(120500L - this.mc.theWorld.getTotalWorldTime()))); + } + + var13 = var8.getStringWidth(var35); + var8.drawStringWithShadow(var35, var6 - var13 - 10, 5, 16777215); + this.mc.mcProfiler.endSection(); + } + + int var21; + int var22; + int var23; + + if (this.mc.gameSettings.showDebugInfo) { + this.mc.mcProfiler.startSection("debug"); + GL11.glPushMatrix(); + var8.drawStringWithShadow("Minecraft 1.7.10 (" + this.mc.debug + ")", 2, 2, 16777215); + var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215); + var8.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215); + var8.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215); + var8.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215); + long var36 = Runtime.getRuntime().maxMemory(); + long var41 = Runtime.getRuntime().totalMemory(); + long var44 = Runtime.getRuntime().freeMemory(); + long var45 = var41 - var44; + String var20 = "Used memory: " + var45 * 100L / var36 + "% (" + var45 / 1024L / 1024L + "MB) of " + var36 / 1024L / 1024L + "MB"; + var21 = 14737632; + this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 2, 14737632); + var20 = "Allocated memory: " + var41 * 100L / var36 + "% (" + var41 / 1024L / 1024L + "MB)"; + this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 12, 14737632); + var22 = MathHelper.floor_double(this.mc.thePlayer.posX); + var23 = MathHelper.floor_double(this.mc.thePlayer.posY); + int var24 = MathHelper.floor_double(this.mc.thePlayer.posZ); + this.drawString(var8, String.format("x: %.5f (%d) // c: %d (%d)", Double.valueOf(this.mc.thePlayer.posX), Integer.valueOf(var22), Integer.valueOf(var22 >> 4), Integer.valueOf(var22 & 15)), 2, 64, 14737632); + this.drawString(var8, String.format("y: %.3f (feet pos, %.3f eyes pos)", Double.valueOf(this.mc.thePlayer.boundingBox.minY), Double.valueOf(this.mc.thePlayer.posY)), 2, 72, 14737632); + this.drawString(var8, String.format("z: %.5f (%d) // c: %d (%d)", Double.valueOf(this.mc.thePlayer.posZ), Integer.valueOf(var24), Integer.valueOf(var24 >> 4), Integer.valueOf(var24 & 15)), 2, 80, 14737632); + int var25 = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + this.drawString(var8, "f: " + var25 + " (" + Direction.directions[var25] + ") / " + MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw), 2, 88, 14737632); + + if (this.mc.theWorld != null && this.mc.theWorld.blockExists(var22, var23, var24)) { + Chunk var26 = this.mc.theWorld.getChunkFromBlockCoords(var22, var24); + this.drawString(var8, "lc: " + (var26.getTopFilledSegment() + 15) + " b: " + var26.getBiomeGenForWorldCoords(var22 & 15, var24 & 15, this.mc.theWorld.getWorldChunkManager()).biomeName + " bl: " + var26.getSavedLightValue(EnumSkyBlock.Block, var22 & 15, var23, var24 & 15) + " sl: " + var26.getSavedLightValue(EnumSkyBlock.Sky, var22 & 15, var23, var24 & 15) + " rl: " + var26.getBlockLightValue(var22 & 15, var23, var24 & 15, 0), 2, 96, 14737632); + } + + this.drawString(var8, String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()), Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()), Boolean.valueOf(this.mc.thePlayer.onGround), Integer.valueOf(this.mc.theWorld.getHeightValue(var22, var24))), 2, 104, 14737632); + + if (this.mc.entityRenderer != null && this.mc.entityRenderer.isShaderActive()) { + this.drawString(var8, String.format("shader: %s", this.mc.entityRenderer.getShaderGroup().getShaderGroupName()), 2, 112, 14737632); + } + + GL11.glPopMatrix(); + this.mc.mcProfiler.endSection(); + } + + if (uploadingScreenshot) { + this.mc.fontRenderer.drawStringWithShadow("Uploading screenshot...", 4.0f, (float)(var5.getScaledHeight() - 24), -1); + } + if (CheatBreaker.getInstance().getModuleManager().chatMod.hiddenFromHud && this.mc.currentScreen instanceof GuiChat) { + this.mc.fontRenderer.drawStringWithShadow("Chat is hidden", 4.0f, (float)(var5.getScaledHeight() - 24), 0xFF777777); + } + + if (this.mc.currentScreen instanceof HudLayoutEditorGui || this.mc.currentScreen instanceof ModulePlaceGui || this.mc.currentScreen instanceof ProfileCreatorGui) { + CheatBreaker.getInstance().getEventBus().handleEvent(new PreviewDrawEvent(var5)); + } + CheatBreaker.getInstance().getEventBus().handleEvent(new GuiDrawBypassDebugEvent(var5)); + if (!this.mc.gameSettings.showDebugInfo || CheatBreaker.getInstance().getGlobalSettings().showHudInDebug.getBooleanValue()) { + CheatBreaker.getInstance().getEventBus().handleEvent(new GuiDrawEvent(var5)); + } else { + if (this.mc.currentScreen instanceof HudLayoutEditorGui || this.mc.currentScreen instanceof ModulePlaceGui || this.mc.currentScreen instanceof ProfileCreatorGui) { + CheatBreaker.getInstance().getEventBus().handleEvent(new GuiDrawEvent(var5)); + } + } + + if (mc.currentScreen == null) { + OverlayGui.getInstance().renderGameOverlay(); + } + + if (this.recordPlayingUpFor > 0) { + this.mc.mcProfiler.startSection("overlayMessage"); + var34 = (float)this.recordPlayingUpFor - p_73830_1_; + var13 = (int)(var34 * 255.0F / 20.0F); + + if (var13 > 255) { + var13 = 255; + } + + if (var13 > 8) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)(var6 / 2), (float)(var7 - 68), 0.0F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + var14 = 16777215; + + if (this.recordIsPlaying) { + var14 = Color.HSBtoRGB(var34 / 50.0F, 0.7F, 0.6F) & 16777215; + } + + var8.drawString(this.recordPlaying, -var8.getStringWidth(this.recordPlaying) / 2, -4, var14 + (var13 << 24 & -16777216)); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + + this.mc.mcProfiler.endSection(); + } + + this.mc.theWorld.getScoreboard().func_96539_a(1); + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, (float)(var7 - 48), 0.0F); + if (!CheatBreaker.getInstance().getModuleManager().chatMod.isRenderHud() || !CheatBreaker.getInstance().getModuleManager().chatMod.isEnabled()) { + this.mc.mcProfiler.startSection("chat"); + if (CheatBreaker.getInstance().getModuleManager().chatMod.isEnabled()) { + this.persistantChatGUI.drawCustomChat(this.updateCounter, CheatBreaker.getInstance().getModuleManager().chatMod.smoothChat.getBooleanValue()); + } else { + this.persistantChatGUI.func_146230_a(this.updateCounter); + } + this.mc.mcProfiler.endSection(); + } + GL11.glPopMatrix(); + ScoreObjective var37 = this.mc.theWorld.getScoreboard().func_96539_a(0); + if (!CheatBreaker.getInstance().getModuleManager().playerListMod.isRenderHud() || !CheatBreaker.getInstance().getModuleManager().playerListMod.isEnabled()) { + if (this.mc.gameSettings.keyBindPlayerList.getIsKeyPressed() && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1 || var37 != null)) { + this.mc.mcProfiler.startSection("playerList"); + NetHandlerPlayClient var40 = this.mc.thePlayer.sendQueue; + List var42 = var40.playerInfoList; + var15 = var40.currentServerMaxPlayers; + var16 = var15; + + for (var17 = 1; var16 > 20; var16 = (var15 + var17 - 1) / var17) { + ++var17; + } + + int var46 = 300 / var17; + + if (var46 > 150) { + var46 = 150; + } + + int var19 = (var6 - var17 * var46) / 2; + if (CheatBreaker.getInstance().getModuleManager().playerListMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().playerListMod.render(var19 - 1, 9); + } else { + byte var47 = 10; + drawRect(var19 - 1, var47 - 1, var19 + var46 * var17, var47 + 9 * var16, Integer.MIN_VALUE); + + for (var21 = 0; var21 < var15; ++var21) { + var22 = var19 + var21 % var17 * var46; + var23 = var47 + var21 / var17 * 9; + drawRect(var22, var23, var22 + var46 - 1, var23 + 8, 553648127); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + if (var21 < var42.size()) { + GuiPlayerInfo var48 = (GuiPlayerInfo)var42.get(var21); + ScorePlayerTeam var49 = this.mc.theWorld.getScoreboard().getPlayersTeam(var48.name); + String var50 = ScorePlayerTeam.formatPlayerName(var49, var48.name); + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + var50 = var50.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + var50 = var50.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + var8.drawStringWithShadow(var50, var22, var23, 16777215); + + if (var37 != null) { + int var27 = var22 + var8.getStringWidth(var50) + 5; + int var28 = var22 + var46 - 12 - 5; + + if (var28 - var27 > 5) { + Score var29 = var37.getScoreboard().func_96529_a(var48.name, var37); + String var30 = EnumChatFormatting.YELLOW + "" + var29.getScorePoints(); + var8.drawStringWithShadow(var30, var28 - var8.getStringWidth(var30), var23, 16777215); + } + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + byte var51 = 0; + boolean var52 = false; + byte var53; + + if (var48.responseTime < 0) { + var53 = 5; + } else if (var48.responseTime < 150) { + var53 = 0; + } else if (var48.responseTime < 300) { + var53 = 1; + } else if (var48.responseTime < 600) { + var53 = 2; + } else if (var48.responseTime < 1000) { + var53 = 3; + } else { + var53 = 4; + } + if (var48.responseTime != -1 && var48.responseTime != 0) { + zLevel += 100.0F; + drawTexturedModalRect(var22 + var46 - 12, var23, var51 * 10, 176 + var53 * 8, 10, 8); + zLevel -= 100.0F; + } + } + } + } + } + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + private void func_110327_a(int p_110327_1_, int p_110327_2_, float scale) { + boolean var3 = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1; + GL11.glScalef(scale, scale, scale); + + if (this.mc.thePlayer.hurtResistantTime < 10) { + var3 = false; + } + + int var4 = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth()); + int var5 = MathHelper.ceiling_float_int(this.mc.thePlayer.prevHealth); + this.rand.setSeed(this.updateCounter * 312871); + boolean var6 = false; + FoodStats var7 = this.mc.thePlayer.getFoodStats(); + int var8 = var7.getFoodLevel(); + int var9 = var7.getPrevFoodLevel(); + IAttributeInstance var10 = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth); + int var11 = (int)(p_110327_1_ / 2 / scale) - 91; + int var12 = (int)(p_110327_1_ / 2 / scale) + 91; + int var13 = (int)(p_110327_2_ / scale) - 39; + float var14 = (float)var10.getAttributeValue(); + float var15 = this.mc.thePlayer.getAbsorptionAmount(); + int var16 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F / 10.0F); + int var17 = Math.max(10 - (var16 - 2), 3); + int var18 = var13 - (var16 - 1) * var17 - 10; + float var19 = var15; + int var20 = this.mc.thePlayer.getTotalArmorValue(); + int var21 = -1; + + if (this.mc.thePlayer.isPotionActive(Potion.regeneration)) { + var21 = this.updateCounter % MathHelper.ceiling_float_int(var14 + 5.0F); + } + + this.mc.mcProfiler.startSection("armor"); + int var22; + int var23; + + for (var22 = 0; var22 < 10; ++var22) { + if (var20 > 0) { + var23 = var11 + var22 * 8; + + if (var22 * 2 + 1 < var20) { + drawTexturedModalRect(var23, var18, 34, 9, 9, 9); + } + + if (var22 * 2 + 1 == var20) { + drawTexturedModalRect(var23, var18, 25, 9, 9, 9); + } + + if (var22 * 2 + 1 > var20) { + drawTexturedModalRect(var23, var18, 16, 9, 9, 9); + } + } + } + + this.mc.mcProfiler.endStartSection("health"); + int var25; + int var26; + int var27; + + for (var22 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F) - 1; var22 >= 0; --var22) { + var23 = 16; + + if (this.mc.thePlayer.isPotionActive(Potion.poison)) { + var23 += 36; + } else if (this.mc.thePlayer.isPotionActive(Potion.wither)) { + var23 += 72; + } + + byte var24 = 0; + + if (var3) { + var24 = 1; + } + + var25 = MathHelper.ceiling_float_int((float)(var22 + 1) / 10.0F) - 1; + var26 = var11 + var22 % 10 * 8; + var27 = var13 - var25 * var17; + + if (var4 <= 4) { + var27 += this.rand.nextInt(2); + } + + if (var22 == var21) { + var27 -= 2; + } + + byte var28 = 0; + + if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { + var28 = 5; + } + + drawTexturedModalRect(var26, var27, 16 + var24 * 9, 9 * var28, 9, 9); + + if (var3) { + if (var22 * 2 + 1 < var5) { + drawTexturedModalRect(var26, var27, var23 + 54, 9 * var28, 9, 9); + } + + if (var22 * 2 + 1 == var5) { + drawTexturedModalRect(var26, var27, var23 + 63, 9 * var28, 9, 9); + } + } + + if (var19 > 0.0F) { + if (var19 == var15 && var15 % 2.0F == 1.0F) { + drawTexturedModalRect(var26, var27, var23 + 153, 9 * var28, 9, 9); + } else { + drawTexturedModalRect(var26, var27, var23 + 144, 9 * var28, 9, 9); + } + + var19 -= 2.0F; + } else { + if (var22 * 2 + 1 < var4) { + drawTexturedModalRect(var26, var27, var23 + 36, 9 * var28, 9, 9); + } + + if (var22 * 2 + 1 == var4) { + drawTexturedModalRect(var26, var27, var23 + 45, 9 * var28, 9, 9); + } + } + } + + Entity var34 = this.mc.thePlayer.ridingEntity; + int var36; + + if (var34 == null) { + this.mc.mcProfiler.endStartSection("food"); + + for (var23 = 0; var23 < 10; ++var23) { + var36 = var13; + var25 = 16; + byte var38 = 0; + + if (this.mc.thePlayer.isPotionActive(Potion.hunger)) { + var25 += 36; + var38 = 13; + } + + if (this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (var8 * 3 + 1) == 0) { + var36 = var13 + (this.rand.nextInt(3) - 1); + } + + if (var6) { + var38 = 1; + } + + var27 = var12 - var23 * 8 - 9; + drawTexturedModalRect(var27, var36, 16 + var38 * 9, 27, 9, 9); + + if (var6) { + if (var23 * 2 + 1 < var9) { + drawTexturedModalRect(var27, var36, var25 + 54, 27, 9, 9); + } + + if (var23 * 2 + 1 == var9) { + drawTexturedModalRect(var27, var36, var25 + 63, 27, 9, 9); + } + } + + if (var23 * 2 + 1 < var8) { + drawTexturedModalRect(var27, var36, var25 + 36, 27, 9, 9); + } + + if (var23 * 2 + 1 == var8) { + drawTexturedModalRect(var27, var36, var25 + 45, 27, 9, 9); + } + } + } else if (var34 instanceof EntityLivingBase) { + this.mc.mcProfiler.endStartSection("mountHealth"); + EntityLivingBase var35 = (EntityLivingBase)var34; + var36 = (int)Math.ceil(var35.getHealth()); + float var37 = var35.getMaxHealth(); + var26 = (int)(var37 + 0.5F) / 2; + + if (var26 > 30) { + var26 = 30; + } + + var27 = var13; + + for (int var39 = 0; var26 > 0; var39 += 20) { + int var29 = Math.min(var26, 10); + var26 -= var29; + + for (int var30 = 0; var30 < var29; ++var30) { + byte var31 = 52; + byte var32 = 0; + + if (var6) { + var32 = 1; + } + + int var33 = var12 - var30 * 8 - 9; + drawTexturedModalRect(var33, var27, var31 + var32 * 9, 9, 9, 9); + + if (var30 * 2 + 1 + var39 < var36) { + drawTexturedModalRect(var33, var27, var31 + 36, 9, 9, 9); + } + + if (var30 * 2 + 1 + var39 == var36) { + drawTexturedModalRect(var33, var27, var31 + 45, 9, 9, 9); + } + } + + var27 -= 10; + } + } + + this.mc.mcProfiler.endStartSection("air"); + + if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { + var23 = this.mc.thePlayer.getAir(); + var36 = MathHelper.ceiling_double_int((double)(var23 - 2) * 10.0D / 300.0D); + var25 = MathHelper.ceiling_double_int((double)var23 * 10.0D / 300.0D) - var36; + + for (var26 = 0; var26 < var36 + var25; ++var26) { + if (var26 < var36) { + drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 16, 18, 9, 9); + } else { + drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 25, 18, 9, 9); + } + } + } + + this.mc.mcProfiler.endSection(); + } + + /** + * Renders dragon's (boss) health on the HUD + */ + private void renderBossHealth() { + if (BossStatus.bossName != null && BossStatus.statusBarTime > 0) { + --BossStatus.statusBarTime; + FontRenderer var1 = this.mc.fontRenderer; + ScaledResolution var2 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var3 = var2.getScaledWidth(); + short var4 = 182; + int var5 = var3 / 2 - var4 / 2; + int var6 = (int)(BossStatus.healthScale * (float)(var4 + 1)); + byte var7 = 12; + drawTexturedModalRect(var5, var7, 0, 74, var4, 5); + drawTexturedModalRect(var5, var7, 0, 74, var4, 5); + + if (var6 > 0) { + drawTexturedModalRect(var5, var7, 0, 79, var6, 5); + } + + String var8 = BossStatus.bossName; + var1.drawStringWithShadow(var8, var3 / 2 - var1.getStringWidth(var8) / 2, var7 - 10, 16777215); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + } + } + + private void renderPumpkinBlur(int p_73836_1_, int p_73836_2_) { + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + if (CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, (float) CheatBreaker.getInstance().getModuleManager().packTweaksMod.pumpkinOverlayOpacity.getValue() / 100.0F); + } else { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath); + Tessellator var3 = Tessellator.instance; + var3.startDrawingQuads(); + var3.addVertexWithUV(0.0D, p_73836_2_, -90.0D, 0.0D, 1.0D); + var3.addVertexWithUV(p_73836_1_, p_73836_2_, -90.0D, 1.0D, 1.0D); + var3.addVertexWithUV(p_73836_1_, 0.0D, -90.0D, 1.0D, 0.0D); + var3.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); + var3.draw(); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Renders the vignette. Args: vignetteBrightness, width, height + */ + private void renderVignette(float p_73829_1_, int p_73829_2_, int p_73829_3_) { + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + float customVig = (Float) pt.vignetteOpacity.getValue() / 100.0F; + if (pt.forceVignette.getValue().equals("Static") && pt.isEnabled()) { + p_73829_1_ = customVig; + } else { + p_73829_1_ = 1.0F - p_73829_1_; + } + + float min = 0.0F; + float max = 1.0F; + if (pt.forceVignette.getValue().equals("Amplified") && pt.isEnabled()) { + min = pt.vignetteMinOpacity.getFloatValue() / 100.0F; + max = pt.vignetteMaxOpacity.getFloatValue() / 100.0F; + if (min > max) { + pt.vignetteMaxOpacity.setValue(pt.vignetteMinOpacity.getFloatValue()); + } + p_73829_1_ *= pt.vignetteOpacityMultiplier.getFloatValue(); + } + + if (p_73829_1_ < min) { + p_73829_1_ = min; + } + + if (p_73829_1_ > max) { + p_73829_1_ = max; + } + + this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(p_73829_1_ - this.prevVignetteBrightness) * 0.01D); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(0, 769, 1, 0); + GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F); + this.mc.getTextureManager().bindTexture(vignetteTexPath); + Tessellator var4 = Tessellator.instance; + var4.startDrawingQuads(); + var4.addVertexWithUV(0.0D, p_73829_3_, -90.0D, 0.0D, 1.0D); + var4.addVertexWithUV(p_73829_2_, p_73829_3_, -90.0D, 1.0D, 1.0D); + var4.addVertexWithUV(p_73829_2_, 0.0D, -90.0D, 1.0D, 0.0D); + var4.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); + var4.draw(); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + private void func_130015_b(float p_130015_1_, int p_130015_2_, int p_130015_3_) { + if (p_130015_1_ < 1.0F) { + p_130015_1_ *= p_130015_1_; + p_130015_1_ *= p_130015_1_; + p_130015_1_ = p_130015_1_ * 0.8F + 0.2F; + } + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(1.0F, 1.0F, 1.0F, p_130015_1_); + IIcon var4 = Blocks.portal.getBlockTextureFromSide(1); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + float var5 = var4.getMinU(); + float var6 = var4.getMinV(); + float var7 = var4.getMaxU(); + float var8 = var4.getMaxV(); + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(0.0D, p_130015_3_, -90.0D, var5, var8); + var9.addVertexWithUV(p_130015_2_, p_130015_3_, -90.0D, var7, var8); + var9.addVertexWithUV(p_130015_2_, 0.0D, -90.0D, var7, var6); + var9.addVertexWithUV(0.0D, 0.0D, -90.0D, var5, var6); + var9.draw(); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Renders the specified item of the inventory slot at the specified location. Args: slot, x, y, partialTick + */ + private void renderInventorySlot(int p_73832_1_, int p_73832_2_, int p_73832_3_, float p_73832_4_) { + ItemStack var5 = this.mc.thePlayer.inventory.mainInventory[p_73832_1_]; + + if (var5 != null) { + float var6 = (float)var5.animationsToGo - p_73832_4_; + + if (var6 > 0.0F) { + GL11.glPushMatrix(); + float var7 = 1.0F + var6 / 5.0F; + GL11.glTranslatef((float)(p_73832_2_ + 8), (float)(p_73832_3_ + 12), 0.0F); + GL11.glScalef(1.0F / var7, (var7 + 1.0F) / 2.0F, 1.0F); + GL11.glTranslatef((float)(-(p_73832_2_ + 8)), (float)(-(p_73832_3_ + 12)), 0.0F); + } + + itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, p_73832_2_, p_73832_3_); + + if (var6 > 0.0F) { + GL11.glPopMatrix(); + } + + itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, p_73832_2_, p_73832_3_); + } + } + + /** + * The update tick for the ingame UI + */ + public void updateTick() { + if (this.recordPlayingUpFor > 0) { + --this.recordPlayingUpFor; + } + + ++this.updateCounter; + + if (this.mc.thePlayer != null) { + ItemStack var1 = this.mc.thePlayer.inventory.getCurrentItem(); + + if (var1 == null) { + this.remainingHighlightTicks = 0; + } else if (this.highlightingItemStack != null && var1.getItem() == this.highlightingItemStack.getItem() && ItemStack.areItemStackTagsEqual(var1, this.highlightingItemStack) && (var1.isItemStackDamageable() || var1.getItemDamage() == this.highlightingItemStack.getItemDamage())) { + if (this.remainingHighlightTicks > 0) { + --this.remainingHighlightTicks; + } + } else { + this.remainingHighlightTicks = 40; + } + + this.highlightingItemStack = var1; + } + } + + public void setRecordPlayingMessage(String p_73833_1_) { + this.func_110326_a(I18n.format("record.nowPlaying", p_73833_1_), true); + } + + public void func_110326_a(String p_110326_1_, boolean p_110326_2_) { + this.recordPlaying = p_110326_1_; + this.recordPlayingUpFor = 60; + this.recordIsPlaying = p_110326_2_; + } + + public GuiNewChat getChatGUI() { + return this.persistantChatGUI; + } + + public int getUpdateCounter() { + return this.updateCounter; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java new file mode 100644 index 0000000..877ae77 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiIngameMenu.java @@ -0,0 +1,176 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.CosineFade; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.ui.warning.CompetitiveGameWarningGui; +import com.cheatbreaker.client.util.sessionserver.SessionServer; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class GuiIngameMenu extends GuiScreen { + private int selectedButton; + private int eventButton; + private GuiButton modsButton; + private final ResourceLocation logo = new ResourceLocation("client/logo_white.png"); + private final ResourceLocation outerLogo = new ResourceLocation("client/logo_255_outer.png"); + private final ResourceLocation innerLogo = new ResourceLocation("client/logo_108_inner.png"); + private final CosineFade logoRotationTime = new CosineFade(4000L); + private long currentTime; + private boolean modsButtonHeldDown = false; + private final CosineFade loginServicesFadeTime = new CosineFade(1500L); + + @Override + public void initGui() { + this.selectedButton = 0; + this.buttonList.clear(); + int n = -16; + boolean bl = true; + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + n, I18n.format("menu.returnToMenu"))); + if (!this.mc.isIntegratedServerRunning()) { + this.buttonList.get(0).displayString = I18n.format("menu.disconnect"); + } + this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + n, I18n.format("menu.returnToGame"))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + n, 98, 20, I18n.format("menu.options"))); + GuiButton guiButton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + n, 98, 20, I18n.format("menu.shareToLan")); + guiButton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); + this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + n, 98, 20, I18n.format("gui.achievements"))); + this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + n, 98, 20, I18n.format("gui.stats"))); + if (!guiButton.enabled) { + this.modsButton = new GuiButton(10, this.width / 2 + 2, this.height / 4 + 96 + n, 98, 20, "Mods"); + this.buttonList.add(this.modsButton); + this.buttonList.add(new GuiButton(16, this.width / 2 - 100, this.height / 4 + 72 + n, 200, 20, "Server List")); + } else { + this.buttonList.add(guiButton); + this.buttonList.add(new GuiButton(16, this.width / 2 - 100, this.height / 4 + 72 + n, 98, 20, "Server List")); + this.modsButton = new GuiButton(10, this.width / 2 + 2, this.height / 4 + 72 + n, 98, 20, "Mods"); + this.buttonList.add(this.modsButton); + } + } + + private void drawLogo(double d, double d2) { + try { + if (!this.logoRotationTime.isTimeNotAtZero()) { + this.logoRotationTime.startAnimation(); + this.logoRotationTime.loopAnimation(); + } + float f = 18; + double d3 = d / (double)2 - (double)f; + double d4 = this.buttonList.size() > 2 ? (double)((float) this.buttonList.get(1).field_146129_i - f - (float)32) : (double)-100; + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glTranslatef((float)d3, (float)d4, 1.0f); + GL11.glTranslatef(f, f, f); + GL11.glRotatef((float)180 * this.logoRotationTime.getFadeAmount(), 0.0f, 0.0f, 1.0f); + GL11.glTranslatef(-f, -f, -f); + RenderUtil.renderEIcon(this.outerLogo, f, 0.0f, 0.0f); + GL11.glPopMatrix(); + RenderUtil.renderEIcon(this.innerLogo, f, (float)d3, (float)d4); + } catch (Exception exception) { + + } + } + + @Override + protected void actionPerformed(GuiButton guiButton) { + this.modsButtonHeldDown = false; + switch (guiButton.id) { + case 16: + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + break; + case 0: + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + break; + case 1: + if (CheatBreaker.getInstance().getCbNetHandler().isCompetitveGamemode()) { + this.mc.displayGuiScreen(new CompetitiveGameWarningGui(this)); + break; + } + guiButton.enabled = false; + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld(null); + this.mc.displayGuiScreen(new VanillaMenu()); + default: + break; + case 4: + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + break; + case 5: + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.func_146107_m())); + break; + case 6: + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.func_146107_m())); + break; + case 7: + this.mc.displayGuiScreen(new GuiShareToLan(this)); + break; + case 10: + if (CheatBreaker.getInstance().getGlobalSettings().streamerMode.getBooleanValue() && CheatBreaker.getInstance().getGlobalSettings().holdDownModsGameMenuButton.getBooleanValue()) { + this.modsButtonHeldDown = true; + this.currentTime = System.currentTimeMillis(); + } else{ + this.mc.displayGuiScreen(new HudLayoutEditorGui()); + } + } + } + + @Override + public void updateScreen() { + super.updateScreen(); + ++this.eventButton; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + int n3 = 600; + int n4 = 356; + double d = (double)Math.min(this.width, this.height) / ((double)n3 * (double)9); + int n5 = (int)((double)n3 * d); + int n6 = (int)((double)n4 * d); + if (CheatBreaker.getInstance().getGlobalSettings().getCurrentMenuSetting().getIntegerValue() == 1) { + this.drawLogo(this.width, this.height); + } else { + RenderUtil.renderIcon(this.logo, this.width / 2 - n5 / 2, n6 * 2, n5, n6); + } + + + boolean bl = false; + for (SessionServer sessionServer : CheatBreaker.getInstance().sessionServers) { + if (sessionServer.getStatus() != SessionServer.StatusColor.DOWN) continue; + bl = true; + } + if (this.modsButtonHeldDown && Mouse.isButtonDown(0) && CheatBreaker.getInstance().getGlobalSettings().streamerMode.getBooleanValue() && CheatBreaker.getInstance().getGlobalSettings().holdDownModsGameMenuButton.getBooleanValue()) { + int countdown = this.currentTime == 0L ? (int) CheatBreaker.getInstance().getGlobalSettings().holdDuration.getFloatValue() : (int)((CheatBreaker.getInstance().getGlobalSettings().holdDuration.getFloatValue() * 1000.0f + 999L - (System.currentTimeMillis() - this.currentTime)) / 1000L); + this.modsButton.displayString = "Mods (" + countdown + ")"; + if (countdown <= 0) { + this.mc.displayGuiScreen(new HudLayoutEditorGui()); + } + } else { + this.modsButton.displayString = "Mods"; + this.currentTime = -0L; + this.modsButtonHeldDown = false; + } + + + if (bl) { + if (!this.loginServicesFadeTime.isTimeNotAtZero()) { + this.loginServicesFadeTime.startAnimation(); + } + this.loginServicesFadeTime.loopAnimation(); + drawRect(this.width / 2 - 100, this.height / 4 + 128, this.width / 2 + 100, this.height / 4 + 142, 0x6F000000); + drawRect(this.width / 2 - 100, this.height / 4 + 128, this.width / 2 + 100, this.height / 4 + 142, new Color(1.0f, 0.2f * 0.75f, 10.6f * 0.014150944f, 1.4142857f * 0.45959595f * this.loginServicesFadeTime.getFadeAmount()).getRGB()); + CheatBreaker.getInstance().ubuntuMedium16px.drawCenteredString("Some login services might be offline".toUpperCase(), this.width / 2, this.height / 4 + 130, -1); + } + super.drawScreen(mouseX, mouseY, partialTicks); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java new file mode 100644 index 0000000..38a2af5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiKeyBindingList.java @@ -0,0 +1,160 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.util.EnumChatFormatting; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.Arrays; + +public class GuiKeyBindingList extends GuiListExtended { + private final GuiControls field_148191_k; + private final Minecraft field_148189_l; + private final GuiListExtended.IGuiListEntry[] field_148190_m; + private int field_148188_n = 0; + + + public GuiKeyBindingList(GuiControls p_i45031_1_, Minecraft p_i45031_2_) { + super(p_i45031_2_, p_i45031_1_.width, p_i45031_1_.height, 63, p_i45031_1_.height - 32, 20); + this.field_148191_k = p_i45031_1_; + this.field_148189_l = p_i45031_2_; + KeyBinding[] var3 = ArrayUtils.clone(p_i45031_2_.gameSettings.keyBindings); + this.field_148190_m = new GuiListExtended.IGuiListEntry[var3.length + KeyBinding.func_151467_c().size()]; + Arrays.sort(var3); + int var4 = 0; + String var5 = null; + KeyBinding[] var6 = var3; + int var7 = var3.length; + + for (int var8 = 0; var8 < var7; ++var8) { + KeyBinding var9 = var6[var8]; + String var10 = var9.getKeyCategory(); + + if (!var10.equals(var5)) { + var5 = var10; + this.field_148190_m[var4++] = new GuiKeyBindingList.CategoryEntry(var10); + } + + int var11 = p_i45031_2_.fontRenderer.getStringWidth(I18n.format(var9.getKeyDescription())); + + if (var11 > this.field_148188_n) { + this.field_148188_n = var11; + } + + this.field_148190_m[var4++] = new GuiKeyBindingList.KeyEntry(var9, null); + } + } + + protected int getSize() { + return this.field_148190_m.length; + } + + public GuiListExtended.IGuiListEntry func_148180_b(int p_148180_1_) { + return this.field_148190_m[p_148180_1_]; + } + + protected int func_148137_d() { + return super.func_148137_d() + 15; + } + + public int func_148139_c() { + return super.func_148139_c() + 32; + } + + public class CategoryEntry implements GuiListExtended.IGuiListEntry { + private final String field_148285_b; + private final int field_148286_c; + + + public CategoryEntry(String p_i45028_2_) { + this.field_148285_b = I18n.format(p_i45028_2_); + this.field_148286_c = GuiKeyBindingList.this.field_148189_l.fontRenderer.getStringWidth(this.field_148285_b); + } + + public void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) { + GuiKeyBindingList.this.field_148189_l.fontRenderer.drawString(this.field_148285_b, GuiKeyBindingList.this.field_148189_l.currentScreen.width / 2 - this.field_148286_c / 2, p_148279_3_ + p_148279_5_ - GuiKeyBindingList.this.field_148189_l.fontRenderer.FONT_HEIGHT - 1, 16777215); + } + + public boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + return false; + } + + public void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} + } + + public class KeyEntry implements GuiListExtended.IGuiListEntry { + private final KeyBinding field_148282_b; + private final String field_148283_c; + private final GuiButton field_148280_d; + private final GuiButton field_148281_e; + + + private KeyEntry(KeyBinding p_i45029_2_) { + this.field_148282_b = p_i45029_2_; + this.field_148283_c = I18n.format(p_i45029_2_.getKeyDescription()); + this.field_148280_d = new GuiButton(0, 0, 0, 75, 18, I18n.format(p_i45029_2_.getKeyDescription())); + this.field_148281_e = new GuiButton(0, 0, 0, 50, 18, I18n.format("controls.reset")); + } + + public void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) { + boolean var10 = GuiKeyBindingList.this.field_148191_k.field_146491_f == this.field_148282_b; + GuiKeyBindingList.this.field_148189_l.fontRenderer.drawString(this.field_148283_c, p_148279_2_ + 90 - GuiKeyBindingList.this.field_148188_n, p_148279_3_ + p_148279_5_ / 2 - GuiKeyBindingList.this.field_148189_l.fontRenderer.FONT_HEIGHT / 2, 16777215); + this.field_148281_e.field_146128_h = p_148279_2_ + 190; + this.field_148281_e.field_146129_i = p_148279_3_; + this.field_148281_e.enabled = this.field_148282_b.getKeyCode() != this.field_148282_b.getKeyCodeDefault(); + Gui.zLevel = 0; + this.field_148281_e.drawButton(GuiKeyBindingList.this.field_148189_l, p_148279_7_, p_148279_8_); + this.field_148280_d.field_146128_h = p_148279_2_ + 105; + this.field_148280_d.field_146129_i = p_148279_3_; + this.field_148280_d.displayString = GameSettings.getKeyDisplayString(this.field_148282_b.getKeyCode()); + boolean var11 = false; + + if (this.field_148282_b.getKeyCode() != 0) { + KeyBinding[] var12 = GuiKeyBindingList.this.field_148189_l.gameSettings.keyBindings; + int var13 = var12.length; + + for (int var14 = 0; var14 < var13; ++var14) { + KeyBinding var15 = var12[var14]; + + if (var15 != this.field_148282_b && var15.getKeyCode() == this.field_148282_b.getKeyCode()) { + var11 = true; + break; + } + } + } + + if (var10) { + this.field_148280_d.displayString = EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + this.field_148280_d.displayString + EnumChatFormatting.WHITE + " <"; + } else if (var11) { + this.field_148280_d.displayString = EnumChatFormatting.RED + this.field_148280_d.displayString; + } + + this.field_148280_d.drawButton(GuiKeyBindingList.this.field_148189_l, p_148279_7_, p_148279_8_); + } + + public boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + if (this.field_148280_d.mousePressed(GuiKeyBindingList.this.field_148189_l, p_148278_2_, p_148278_3_)) { + GuiKeyBindingList.this.field_148191_k.field_146491_f = this.field_148282_b; + return true; + } else if (this.field_148281_e.mousePressed(GuiKeyBindingList.this.field_148189_l, p_148278_2_, p_148278_3_)) { + GuiKeyBindingList.this.field_148189_l.gameSettings.setKeyCodeSave(this.field_148282_b, this.field_148282_b.getKeyCodeDefault()); + KeyBinding.resetKeyBindingArrayAndHash(); + return true; + } else { + return false; + } + } + + public void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) { + this.field_148280_d.mouseReleased(p_148277_2_, p_148277_3_); + this.field_148281_e.mouseReleased(p_148277_2_, p_148277_3_); + } + + KeyEntry(KeyBinding p_i45030_2_, Object p_i45030_3_) { + this(p_i45030_2_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiLabel.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiLabel.java new file mode 100644 index 0000000..2d047d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiLabel.java @@ -0,0 +1,57 @@ +package net.minecraft.client.gui; + +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import org.lwjgl.opengl.GL11; + +public class GuiLabel extends Gui { + protected int field_146167_a; + protected int field_146161_f; + public int field_146162_g; + public int field_146174_h; + private ArrayList field_146173_k; + private boolean field_146170_l; + public boolean field_146172_j; + private boolean field_146171_m; + private int field_146168_n; + private int field_146169_o; + private int field_146166_p; + private int field_146165_q; + private FontRenderer field_146164_r; + private int field_146163_s; + + + public void func_146159_a(Minecraft p_146159_1_, int p_146159_2_, int p_146159_3_) { + if (this.field_146172_j) { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.func_146160_b(p_146159_1_, p_146159_2_, p_146159_3_); + int var4 = this.field_146174_h + this.field_146161_f / 2 + this.field_146163_s / 2; + int var5 = var4 - this.field_146173_k.size() * 10 / 2; + + for (int var6 = 0; var6 < this.field_146173_k.size(); ++var6) { + if (this.field_146170_l) { + this.drawCenteredString(this.field_146164_r, (String)this.field_146173_k.get(var6), this.field_146162_g + this.field_146167_a / 2, var5 + var6 * 10, this.field_146168_n); + } else { + this.drawString(this.field_146164_r, (String)this.field_146173_k.get(var6), this.field_146162_g, var5 + var6 * 10, this.field_146168_n); + } + } + } + } + + protected void func_146160_b(Minecraft p_146160_1_, int p_146160_2_, int p_146160_3_) { + if (this.field_146171_m) { + int var4 = this.field_146167_a + this.field_146163_s * 2; + int var5 = this.field_146161_f + this.field_146163_s * 2; + int var6 = this.field_146162_g - this.field_146163_s; + int var7 = this.field_146174_h - this.field_146163_s; + drawRect(var6, var7, var6 + var4, var7 + var5, this.field_146169_o); + this.drawHorizontalLine(var6, var6 + var4, var7, this.field_146166_p); + this.drawHorizontalLine(var6, var6 + var4, var7 + var5, this.field_146165_q); + this.drawVerticalLine(var6, var7, var7 + var5, this.field_146166_p); + this.drawVerticalLine(var6 + var4, var7, var7 + var5, this.field_146165_q); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiLanguage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiLanguage.java new file mode 100644 index 0000000..4871794 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiLanguage.java @@ -0,0 +1,131 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.Language; +import net.minecraft.client.resources.LanguageManager; +import net.minecraft.client.settings.GameSettings; + +public class GuiLanguage extends GuiScreen { + protected GuiScreen field_146453_a; + private GuiLanguage.List field_146450_f; + private final GameSettings field_146451_g; + private final LanguageManager field_146454_h; + private GuiOptionButton field_146455_i; + private GuiOptionButton field_146452_r; + + + public GuiLanguage(GuiScreen p_i1043_1_, GameSettings p_i1043_2_, LanguageManager p_i1043_3_) { + this.field_146453_a = p_i1043_1_; + this.field_146451_g = p_i1043_2_; + this.field_146454_h = p_i1043_3_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + boolean var1 = false; + + if (this.field_146455_i != null) { + } + + this.buttonList.add(this.field_146455_i = new GuiOptionButton(100, this.width / 2 - 155, this.height - 38, GameSettings.Options.FORCE_UNICODE_FONT, this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT))); + this.buttonList.add(this.field_146452_r = new GuiOptionButton(6, this.width / 2 - 155 + 160, this.height - 38, I18n.format("gui.done"))); + this.field_146450_f = new GuiLanguage.List(); + this.field_146450_f.func_148134_d(7, 8); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + switch (p_146284_1_.id) { + case 5: + break; + + case 6: + this.mc.displayGuiScreen(this.field_146453_a); + break; + + case 100: + if (p_146284_1_ instanceof GuiOptionButton) { + this.field_146451_g.setOptionValue(((GuiOptionButton)p_146284_1_).func_146136_c(), 1); + p_146284_1_.displayString = this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); + ScaledResolution var2 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var3 = var2.getScaledWidth(); + int var4 = var2.getScaledHeight(); + this.setWorldAndResolution(this.mc, var3, var4); + } + + break; + + default: + this.field_146450_f.func_148147_a(p_146284_1_); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.field_146450_f.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, I18n.format("options.language"), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRendererObj, "(" + I18n.format("options.languageWarning") + ")", this.width / 2, this.height - 56, 8421504); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + class List extends GuiSlot { + private final java.util.List field_148176_l = Lists.newArrayList(); + private final Map field_148177_m = Maps.newHashMap(); + + + public List() { + super(GuiLanguage.this.mc, GuiLanguage.this.width, GuiLanguage.this.height, 32, GuiLanguage.this.height - 65 + 4, 18); + Iterator var2 = GuiLanguage.this.field_146454_h.getLanguages().iterator(); + + while (var2.hasNext()) { + Language var3 = (Language)var2.next(); + this.field_148177_m.put(var3.getLanguageCode(), var3); + this.field_148176_l.add(var3.getLanguageCode()); + } + } + + protected int getSize() { + return this.field_148176_l.size(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) { + Language var5 = (Language)this.field_148177_m.get(this.field_148176_l.get(p_148144_1_)); + GuiLanguage.this.field_146454_h.setCurrentLanguage(var5); + GuiLanguage.this.field_146451_g.language = var5.getLanguageCode(); + GuiLanguage.this.mc.refreshResources(); + GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.field_146454_h.isCurrentLocaleUnicode() || GuiLanguage.this.field_146451_g.forceUnicodeFont); + GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.field_146454_h.isCurrentLanguageBidirectional()); + GuiLanguage.this.field_146452_r.displayString = I18n.format("gui.done"); + GuiLanguage.this.field_146455_i.displayString = GuiLanguage.this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); + GuiLanguage.this.field_146451_g.saveOptions(); + } + + protected boolean isSelected(int p_148131_1_) { + return this.field_148176_l.get(p_148131_1_).equals(GuiLanguage.this.field_146454_h.getCurrentLanguage().getLanguageCode()); + } + + protected int func_148138_e() { + return this.getSize() * 18; + } + + protected void drawBackground() { + GuiLanguage.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + GuiLanguage.this.fontRendererObj.setBidiFlag(true); + GuiLanguage.this.drawCenteredString(GuiLanguage.this.fontRendererObj, this.field_148177_m.get(this.field_148176_l.get(p_148126_1_)).toString(), this.field_148155_a / 2, p_148126_3_ + 1, 16777215); + GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.field_146454_h.getCurrentLanguage().isBidirectional()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiListExtended.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiListExtended.java new file mode 100644 index 0000000..a00cd0d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiListExtended.java @@ -0,0 +1,67 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; + +public abstract class GuiListExtended extends GuiSlot { + + + public GuiListExtended(Minecraft p_i45010_1_, int p_i45010_2_, int p_i45010_3_, int p_i45010_4_, int p_i45010_5_, int p_i45010_6_) { + super(p_i45010_1_, p_i45010_2_, p_i45010_3_, p_i45010_4_, p_i45010_5_, p_i45010_6_); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + protected boolean isSelected(int p_148131_1_) { + return false; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + this.func_148180_b(p_148126_1_).func_148279_a(p_148126_1_, p_148126_2_, p_148126_3_, this.func_148139_c(), p_148126_4_, p_148126_5_, p_148126_6_, p_148126_7_, this.func_148124_c(p_148126_6_, p_148126_7_) == p_148126_1_); + } + + public boolean func_148179_a(int p_148179_1_, int p_148179_2_, int p_148179_3_) { + if (this.func_148141_e(p_148179_2_)) { + int var4 = this.func_148124_c(p_148179_1_, p_148179_2_); + + if (var4 >= 0) { + int var5 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; + int var6 = this.field_148153_b + 4 - this.func_148148_g() + var4 * this.field_148149_f + this.field_148160_j; + int var7 = p_148179_1_ - var5; + int var8 = p_148179_2_ - var6; + + if (this.func_148180_b(var4).func_148278_a(var4, p_148179_1_, p_148179_2_, p_148179_3_, var7, var8)) { + this.func_148143_b(false); + return true; + } + } + } + + return false; + } + + public boolean func_148181_b(int p_148181_1_, int p_148181_2_, int p_148181_3_) { + for (int var4 = 0; var4 < this.getSize(); ++var4) { + int var5 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; + int var6 = this.field_148153_b + 4 - this.func_148148_g() + var4 * this.field_148149_f + this.field_148160_j; + int var7 = p_148181_1_ - var5; + int var8 = p_148181_2_ - var6; + this.func_148180_b(var4).func_148277_b(var4, p_148181_1_, p_148181_2_, p_148181_3_, var7, var8); + } + + this.func_148143_b(true); + return false; + } + + public abstract GuiListExtended.IGuiListEntry func_148180_b(int p_148180_1_); + + public interface IGuiListEntry { + void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_); + + boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_); + + void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMainMenu.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMainMenu.java new file mode 100644 index 0000000..a6ec31e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMainMenu.java @@ -0,0 +1,507 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.cosmetic.EmoteGUI; +import com.cheatbreaker.client.ui.element.type.ImageButtonElement; +import com.cheatbreaker.client.ui.mainmenu.buttons.MainMenuAccountButton; +import com.cheatbreaker.client.ui.mainmenu.buttons.MainMenuButton; +import com.cheatbreaker.client.ui.mainmenu.buttons.MainMenuCosmeticsMenu; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.resources.I18n; +import net.minecraft.realms.RealmsBridge; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +import java.io.*; +import java.net.URI; +import java.util.*; + +public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback { + private static final Logger logger = LogManager.getLogger(); + private static final Random RANDOM = new Random(); + private float updateCounter; + private String splashText = "missingno"; + private GuiButton buttonResetDemo; + private static int panoramaTimer; + private DynamicTexture viewportTexture; + private final Object threadLock = new Object(); + private String openGLWarning1; + private String openGLWarning2 = field_96138_a; + private String openGLWarningLink; + private static final ResourceLocation splashTexts; + private static final ResourceLocation minecraftTitleTextures; + private static final ResourceLocation[] titlePanoramaPaths; + public static final String field_96138_a; + private int field_92024_r; + private int field_92023_s; + private int field_92022_t; + private int field_92021_u; + private int field_92020_v; + private int field_92019_w; + private ResourceLocation backgroundTexture; + private final List mainButtons = new ArrayList(); + private MainMenuAccountButton accountButton; + private boolean lIIIlllIlIlllIIIIIIIIIlII = false; + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + public GuiMainMenu() { + BufferedReader bufferedReader = null; + try { + String s; + ArrayList list = new ArrayList(); + bufferedReader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); + while ((s = bufferedReader.readLine()) != null) { + if ((s = s.trim()).isEmpty()) continue; + list.add(s); + } + if (!list.isEmpty()) { + do { + this.splashText = list.get(RANDOM.nextInt(list.size())); + } while (this.splashText.hashCode() == 125780783); + } + } catch (IOException ignored) {} + finally { + if (bufferedReader != null) { + try { + bufferedReader.close(); + } catch (IOException ignored) {} + } + } + this.updateCounter = RANDOM.nextFloat(); + this.openGLWarning1 = ""; + if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.func_153193_b()) { + this.openGLWarning1 = I18n.format("title.oldgl1"); + this.openGLWarning2 = I18n.format("title.oldgl2"); + this.openGLWarningLink = "https://help.mojang.com/customer/portal/articles/325948?ref=game"; + } + } + + @Override + public void updateScreen() { + ++panoramaTimer; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + protected void keyTyped(char c, int n) { + this.mc.func_152348_aa(); + if (n == 1) { + this.mc.displayGuiScreen(new VanillaMenu()); + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + * Could not resolve type clashes + */ + @Override + public void initGui() { + String string; + Object object3; + Object object2; + this.viewportTexture = new DynamicTexture(256, 256); + this.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + this.buttonList.add(new MainMenuButton(0, 45, 0, 50, 25, "OPTIONS", false)); + this.buttonList.add(new MainMenuButton(5, 95, 0, 50, 25, "LANGUAGE", false)); + this.buttonList.add(new MainMenuButton(66, 145, 0, 65, 25, "COSMETICS", false)); +// this.buttonList.add(new MainMenuButton(67, 195, 0, 65, 25, "EMOTES", false)); + this.buttonList.add(new ImageButtonElement(4, new ResourceLocation("client/icons/exit-64.png"), this.width - 65, 0, 65, 25, "EXIT", false)); + File file = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "launcher_accounts.json"); + ArrayList> accountList = new ArrayList<>(); + if (file.exists()) { + try { + FileReader fileReader = new FileReader(file); + object2 = new JsonParser(); + object3 = ((JsonParser)object2).parse(fileReader); + string = ""; + for (Map.Entry entry : ((JsonElement)object3).getAsJsonObject().entrySet()) { + if (entry.getKey().equalsIgnoreCase("clientToken")) { + string = entry.getValue().getAsString(); + } + if (!entry.getKey().equalsIgnoreCase("authenticationDatabase")) continue; + for (Map.Entry entry2 : entry.getValue().getAsJsonObject().entrySet()) { + HashMap hashMap = new HashMap(); + hashMap.put("clientToken", string); + for (Map.Entry entry3 : entry2.getValue().getAsJsonObject().entrySet()) { + if (entry3.getKey().equalsIgnoreCase("profiles")) { + for (Map.Entry entry4 : entry3.getValue().getAsJsonObject().entrySet()) { + hashMap.put("uuid", entry4.getKey()); + for (Map.Entry entry5 : entry4.getValue().getAsJsonObject().entrySet()) { + hashMap.put("displayName", entry5.getValue().getAsString()); + } + } + continue; + } + if (!entry3.getKey().equalsIgnoreCase("username") && + !entry3.getKey().equalsIgnoreCase("displayName") && !entry3.getKey().equalsIgnoreCase("uuid") && !entry3.getKey().equalsIgnoreCase("accessToken")) continue; + hashMap.put(entry3.getKey(), entry3.getValue().getAsString()); + } + accountList.add(hashMap); + } + } + } catch (Exception exception) { + exception.printStackTrace(); + } + } + this.accountButton = null; + this.mainButtons.clear(); + int n = 0; + for (Map accountMap : accountList) { + String accountName = accountMap.get("displayName"); + MainMenuAccountButton mainMenuAccountButton = new MainMenuAccountButton(50, accountMap, this.width - 200, n * 25, 130, 25); + this.mainButtons.add(mainMenuAccountButton); + if (this.mc.getSession() != null && accountName.equalsIgnoreCase(this.mc.getSession().getUsername())) { + this.accountButton = mainMenuAccountButton; + if (n != 0) { + MainMenuAccountButton entry = (MainMenuAccountButton)this.mainButtons.get(0); + entry.field_146129_i = n * 25; + this.accountButton.field_146129_i = 0; + } + } + ++n; + } + if (this.accountButton == null && !this.mainButtons.isEmpty()) { + this.accountButton = (MainMenuAccountButton)this.mainButtons.get(0); + } + object2 = this.threadLock; + object3 = this.threadLock; + synchronized (object3) { + this.field_92023_s = this.fontRendererObj.getStringWidth(this.openGLWarning1); + this.field_92024_r = this.fontRendererObj.getStringWidth(this.openGLWarning2); + int n2 = Math.max(this.field_92023_s, this.field_92024_r); + this.field_92022_t = (this.width - n2) / 2; + this.field_92021_u = this.buttonList.get(0).field_146129_i - 24; + this.field_92020_v = this.field_92022_t + n2; + this.field_92019_w = this.field_92021_u + 24; + } + } + /** + * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. + */ + protected void addSingleplayerMultiplayerButtons(int n, int n2) { + this.buttonList.add(new MainMenuButton(1, this.width / 2 - 65, n + 24, 130, 24, I18n.format("menu.singleplayer"))); + this.buttonList.add(new MainMenuButton(2, this.width / 2 - 65, n + 52, 130, 24, I18n.format("menu.multiplayer"))); + } + + @Override + protected void actionPerformed(GuiButton guiButton) { + ISaveFormat iSaveFormat; + WorldInfo worldInfo; + if (guiButton.id == 0) { + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } + if (guiButton.id == 5) { + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } + if (guiButton.id == 66) { + this.mc.displayGuiScreen(new MainMenuCosmeticsMenu()); + } + if (guiButton.id == 67) { + this.mc.displayGuiScreen(new EmoteGUI(8)); + } + if (guiButton.id == 67) { + } + if (guiButton.id == 1) { + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } + if (guiButton.id == 2) { + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } + if (guiButton.id == 14) { + this.IlIlIIIlllIIIlIlllIlIllIl(); + } + if (guiButton.id == 4) { + this.mc.shutdown(); + } + if (guiButton.id == 11) { + this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); + } + if (guiButton.id == 12 && (worldInfo = (iSaveFormat = this.mc.getSaveLoader()).getWorldInfo("Demo_World")) != null) { + GuiYesNo guiYesNo = GuiSelectWorld.func_152129_a(this, worldInfo.getWorldName(), 12); + this.mc.displayGuiScreen(guiYesNo); + } + } + + private void IlIlIIIlllIIIlIlllIlIllIl() { + RealmsBridge realmsBridge = new RealmsBridge(); + realmsBridge.switchToRealms(this); + } + + @Override + public void confirmClicked(boolean bl, int n) { + if (bl && n == 12) { + ISaveFormat iSaveFormat = this.mc.getSaveLoader(); + iSaveFormat.flushCache(); + iSaveFormat.deleteWorldDirectory("Demo_World"); + this.mc.displayGuiScreen(this); + } else if (n == 13) { + if (bl) { + try { + Class class_ = Class.forName("java.awt.Desktop"); + Object object = class_.getMethod("getDesktop", new Class[0]).invoke(null); + class_.getMethod("browse", URI.class).invoke(object, new URI(this.openGLWarningLink)); + } catch (Throwable throwable) { + logger.error("Couldn't open link", throwable); + } + } + this.mc.displayGuiScreen(this); + } + } + + private void lIIIIIIIIIlIllIIllIlIIlIl(int n, int n2, float f) { + Tessellator tessellator = Tessellator.instance; + GL11.glMatrixMode(5889); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + Project.gluPerspective(120, 1.0f, 0.026190476f * 1.9090909f, 10); + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glRotatef(180, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(90, 0.0f, 0.0f, 1.0f); + GL11.glEnable(3042); + GL11.glDisable(3008); + GL11.glDisable(2884); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + int n3 = 8; + for (int i = 0; i < n3 * n3; ++i) { + GL11.glPushMatrix(); + float f2 = ((float)(i % n3) / (float)n3 - 0.2840909f * 1.76f) / (float)64; + float f3 = ((float)(i / n3) / (float)n3 - 0.6666667f * 0.75f) / (float)64; + float f4 = 0.0f; + GL11.glTranslatef(f2, f3, f4); + GL11.glRotatef(MathHelper.sin(((float) panoramaTimer + f) / (float)400) * (float)25 + (float)20, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(-((float) panoramaTimer + f) * (0.10666667f * 0.9375f), 0.0f, 1.0f, 0.0f); + for (int j = 0; j < 6; ++j) { + GL11.glPushMatrix(); + if (j == 1) { + GL11.glRotatef(90, 0.0f, 1.0f, 0.0f); + } + if (j == 2) { + GL11.glRotatef(180, 0.0f, 1.0f, 0.0f); + } + if (j == 3) { + GL11.glRotatef(-90, 0.0f, 1.0f, 0.0f); + } + if (j == 4) { + GL11.glRotatef(90, 1.0f, 0.0f, 0.0f); + } + if (j == 5) { + GL11.glRotatef(-90, 1.0f, 0.0f, 0.0f); + } + this.mc.getTextureManager().bindTexture(titlePanoramaPaths[j]); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(0xFFFFFF, 255 / (i + 1)); + float f5 = 0.0f; + tessellator.addVertexWithUV(-1, -1, 1.0, 0.0f + f5, 0.0f + f5); + tessellator.addVertexWithUV(1.0, -1, 1.0, 1.0f - f5, 0.0f + f5); + tessellator.addVertexWithUV(1.0, 1.0, 1.0, 1.0f - f5, 1.0f - f5); + tessellator.addVertexWithUV(-1, 1.0, 1.0, 0.0f + f5, 1.0f - f5); + tessellator.draw(); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + GL11.glColorMask(true, true, true, false); + } + tessellator.setTranslation(0.0, 0.0, 0.0); + GL11.glColorMask(true, true, true, true); + GL11.glMatrixMode(5889); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glEnable(2884); + GL11.glEnable(2929); + } + + private void lIIIIlIIllIIlIIlIIIlIIllI(float f) { + this.mc.getTextureManager().bindTexture(this.backgroundTexture); + GL11.glTexParameteri(3553, 10241, 9729); + GL11.glTexParameteri(3553, 10240, 9729); + GL11.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256); + GL11.glEnable(3042); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColorMask(true, true, true, false); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + GL11.glDisable(3008); + int n = 3; + for (int i = 0; i < n; ++i) { + tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f / (float)(i + 1)); + int n2 = this.width; + int n3 = this.height; + float f2 = (float)(i - n / 2) / (float)256; + tessellator.addVertexWithUV(n2, n3, zLevel, 0.0f + f2, 1.0); + tessellator.addVertexWithUV(n2, 0.0, zLevel, 1.0f + f2, 1.0); + tessellator.addVertexWithUV(0.0, 0.0, zLevel, 1.0f + f2, 0.0); + tessellator.addVertexWithUV(0.0, n3, zLevel, 0.0f + f2, 0.0); + } + tessellator.draw(); + GL11.glEnable(3008); + GL11.glColorMask(true, true, true, true); + } + + private void IlllIIIlIlllIllIlIIlllIlI(int n, int n2, float f) { + this.mc.getFramebuffer().unbindFramebuffer(); + GL11.glViewport(0, 0, 256, 256); + this.lIIIIIIIIIlIllIIllIlIIlIl(n, n2, f); + this.lIIIIlIIllIIlIIlIIIlIIllI(f); + this.lIIIIlIIllIIlIIlIIIlIIllI(f); + this.lIIIIlIIllIIlIIlIIIlIIllI(f); + this.lIIIIlIIllIIlIIlIIIlIIllI(f); + this.lIIIIlIIllIIlIIlIIIlIIllI(f); + this.lIIIIlIIllIIlIIlIIIlIIllI(f); + this.lIIIIlIIllIIlIIlIIIlIIllI(f); + this.mc.getFramebuffer().bindFramebuffer(true); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + float f2 = this.width > this.height ? (float)120 / (float)this.width : (float)120 / (float)this.height; + float f3 = (float)this.height * f2 / (float)256; + float f4 = (float)this.width * f2 / (float)256; + tessellator.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f); + int n3 = this.width; + int n4 = this.height; + tessellator.addVertexWithUV(0.0, n4, zLevel, 0.021052632f * 23.75f - f3, 2.0666666f * 0.24193549f + f4); + tessellator.addVertexWithUV(n3, n4, zLevel, 24.5f * 0.020408163f - f3, 0.12962963f * 3.857143f - f4); + tessellator.addVertexWithUV(n3, 0.0, zLevel, 1.1315789f * 0.44186047f + f3, 11.5f * 0.04347826f - f4); + tessellator.addVertexWithUV(0.0, 0.0, zLevel, 0.050847456f * 9.833334f + f3, 0.45918366f * 1.0888889f + f4); + tessellator.draw(); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GL11.glDisable(3008); + this.IlllIIIlIlllIllIlIIlllIlI(mouseX, mouseY, partialTicks); + GL11.glEnable(3008); + int n3 = 274; + int n4 = this.width / 2 - n3 / 2; + int n5 = 30; + drawGradientRect(0.0f, 0.0f, (float)this.width, (float)this.height, 0x5FFFFFFF, 0x2FFFFFFF); + drawRect(0.0f, 0.0f, this.width, 25, -819846622); + String string = "CheatBreaker " + CheatBreaker.getInstance().getGitBuildVersion() + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")"; + this.drawString(this.fontRendererObj, string, 2, this.height - 10, -1); + String string2 = "Copyright Mojang AB. Do not distribute!"; + this.drawString(this.fontRendererObj, string2, this.width - this.fontRendererObj.getStringWidth(string2) - 2, this.height - 10, -1); + if (this.openGLWarning1 != null && this.openGLWarning1.length() > 0) { + drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 0x55200000); + this.drawString(this.fontRendererObj, this.openGLWarning1, this.field_92022_t, this.field_92021_u, -1); + this.drawString(this.fontRendererObj, this.openGLWarning2, (this.width - this.field_92024_r) / 2, this.buttonList.get(0).field_146129_i - 12, -1); + } + GL11.glPushMatrix(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + float f2 = 30; + float f3 = 15; + float f4 = 0.0f; + float f5 = 0.0f; + float f6 = 10; + float f7 = 5; + GL11.glEnable(3042); + this.mc.renderEngine.bindTexture(new ResourceLocation("client/icons/cb.png")); + GL11.glBegin(7); + GL11.glTexCoord2d(f4 / (float)5, f5 / (float)5); + GL11.glVertex2d(f6, f7); + GL11.glTexCoord2d(f4 / (float)5, (f5 + (float)5) / (float)5); + GL11.glVertex2d(f6, f7 + f3); + GL11.glTexCoord2d((f4 + (float)5) / (float)5, (f5 + (float)5) / (float)5); + GL11.glVertex2d(f6 + f2, f7 + f3); + GL11.glTexCoord2d((f4 + (float)5) / (float)5, f5 / (float)5); + GL11.glVertex2d(f6 + f2, f7); + GL11.glEnd(); + GL11.glDisable(3042); + GL11.glPopMatrix(); + } + + protected void lIIIIIIIIIlIllIIllIlIIlIl(int n, int n2) { + int n3; + for (n3 = 0; n3 < this.buttonList.size(); ++n3) { + this.buttonList.get(n3).drawButton(this.mc, n, n2); + } + for (n3 = 0; n3 < this.labelList.size(); ++n3) { + ((GuiLabel)this.labelList.get(n3)).func_146159_a(this.mc, n, n2); + } + if (this.accountButton != null) { + this.lIIIlllIlIlllIIIIIIIIIlII = !this.lIIIlllIlIlllIIIIIIIIIlII ? n > this.accountButton.field_146128_h && n < this.accountButton.field_146128_h + this.accountButton.getWidth() && n2 > this.accountButton.field_146129_i && n2 < this.accountButton.field_146129_i + this.accountButton.getHeight() : n > this.accountButton.field_146128_h && n < this.accountButton.field_146128_h + this.accountButton.getWidth() && n2 > this.accountButton.field_146129_i && n2 < this.accountButton.field_146129_i + 25 * this.mainButtons.size(); + this.accountButton.drawButton(this.mc, n, n2); + if (this.lIIIlllIlIlllIIIIIIIIIlII) { + int n4 = this.mainButtons.size(); + int n5 = this.accountButton.getHeight(); + for (int i = 0; i < n4; ++i) { + MainMenuAccountButton mainMenuAccountButton = (MainMenuAccountButton)this.mainButtons.get(i); + if (mainMenuAccountButton != this.accountButton) { + mainMenuAccountButton.drawButton(this.mc, n, n2); + } + n5 += mainMenuAccountButton.getHeight(); + } + } + } + } + + /* + * WARNING - Removed try catching itself - possible behaviour change. + */ + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + Object object = this.threadLock; + if (mouseX <= 45 && mouseY <= 25) { + this.mc.displayGuiScreen(new VanillaMenu()); + } + if (this.lIIIlllIlIlllIIIIIIIIIlII) { + int n4 = this.mainButtons.size(); + int n5 = this.accountButton.getHeight(); + for (int i = 0; i < n4; ++i) { + MainMenuAccountButton mainMenuAccountButton = (MainMenuAccountButton)this.mainButtons.get(i); + if (mainMenuAccountButton != this.accountButton && mouseX < mainMenuAccountButton.field_146128_h + mainMenuAccountButton.getWidth() && mouseY > mainMenuAccountButton.field_146129_i && mouseY < mainMenuAccountButton.field_146129_i + mainMenuAccountButton.getHeight()) { + if (!mainMenuAccountButton.lIIIIlIIllIIlIIlIIIlIIllI() || mainMenuAccountButton == this.accountButton) break; + this.accountButton.field_146129_i = mainMenuAccountButton.field_146129_i; + mainMenuAccountButton.field_146129_i = 0; + this.accountButton = mainMenuAccountButton; + break; + } + n5 += mainMenuAccountButton.getHeight(); + } + } + Object object2 = this.threadLock; + synchronized (object2) { + if (this.openGLWarning1.length() > 0 && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w) { + GuiConfirmOpenLink guiConfirmOpenLink = new GuiConfirmOpenLink(this, this.openGLWarningLink, 13, true); + guiConfirmOpenLink.func_146358_g(); + this.mc.displayGuiScreen(guiConfirmOpenLink); + } + } + } + + static { + splashTexts = new ResourceLocation("texts/splashes.txt"); + minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); + titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; + field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java new file mode 100644 index 0000000..6a36095 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java @@ -0,0 +1,47 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import net.minecraft.client.resources.I18n; + +public class GuiMemoryErrorScreen extends GuiScreen { + + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.format("gui.toMenu"))); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.format("menu.quit"))); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 0) { + this.mc.displayGuiScreen(new VanillaMenu()); + } else if (p_146284_1_.id == 1) { + this.mc.shutdown(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) {} + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, "Out of memory!", this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.drawString(this.fontRendererObj, "Minecraft has run out of memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 0, 10526880); + this.drawString(this.fontRendererObj, "This could be caused by a bug in the game or by the", this.width / 2 - 140, this.height / 4 - 60 + 60 + 18, 10526880); + this.drawString(this.fontRendererObj, "Java Virtual Machine not being allocated enough", this.width / 2 - 140, this.height / 4 - 60 + 60 + 27, 10526880); + this.drawString(this.fontRendererObj, "memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 36, 10526880); + this.drawString(this.fontRendererObj, "To prevent level corruption, the current game has quit.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 54, 10526880); + this.drawString(this.fontRendererObj, "We've tried to free up enough memory to let you go back to", this.width / 2 - 140, this.height / 4 - 60 + 60 + 63, 10526880); + this.drawString(this.fontRendererObj, "the main menu and back to playing, but this may not have worked.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 72, 10526880); + this.drawString(this.fontRendererObj, "Please restart the game if you see this message again.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 81, 10526880); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMerchant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMerchant.java new file mode 100644 index 0000000..752b54f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMerchant.java @@ -0,0 +1,203 @@ +package net.minecraft.client.gui; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ResourceLocation; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiMerchant extends GuiContainer { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_147038_v = new ResourceLocation("textures/gui/container/villager.png"); + private final IMerchant field_147037_w; + private GuiMerchant.MerchantButton field_147043_x; + private GuiMerchant.MerchantButton field_147042_y; + private int field_147041_z; + private final String field_147040_A; + + + public GuiMerchant(InventoryPlayer p_i46380_1_, IMerchant p_i46380_2_, World p_i46380_3_, String p_i46380_4_) { + super(new ContainerMerchant(p_i46380_1_, p_i46380_2_, p_i46380_3_)); + this.field_147037_w = p_i46380_2_; + this.field_147040_A = p_i46380_4_ != null && p_i46380_4_.length() >= 1 ? p_i46380_4_ : I18n.format("entity.Villager.name"); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + super.initGui(); + int var1 = (this.width - this.field_146999_f) / 2; + int var2 = (this.height - this.field_147000_g) / 2; + this.buttonList.add(this.field_147043_x = new GuiMerchant.MerchantButton(1, var1 + 120 + 27, var2 + 24 - 1, true)); + this.buttonList.add(this.field_147042_y = new GuiMerchant.MerchantButton(2, var1 + 36 - 19, var2 + 24 - 1, false)); + this.field_147043_x.enabled = false; + this.field_147042_y.enabled = false; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(this.field_147040_A, this.field_146999_f / 2 - this.fontRendererObj.getStringWidth(this.field_147040_A) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.field_147000_g - 96 + 2, 4210752); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + MerchantRecipeList var1 = this.field_147037_w.getRecipes(this.mc.thePlayer); + + if (var1 != null) { + this.field_147043_x.enabled = this.field_147041_z < var1.size() - 1; + this.field_147042_y.enabled = this.field_147041_z > 0; + } + } + + protected void actionPerformed(GuiButton p_146284_1_) { + boolean var2 = false; + + if (p_146284_1_ == this.field_147043_x) { + ++this.field_147041_z; + var2 = true; + } else if (p_146284_1_ == this.field_147042_y) { + --this.field_147041_z; + var2 = true; + } + + if (var2) { + ((ContainerMerchant)this.field_147002_h).setCurrentRecipeIndex(this.field_147041_z); + ByteBuf var3 = Unpooled.buffer(); + + try { + var3.writeInt(this.field_147041_z); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|TrSel", var3)); + } catch (Exception var8) { + logger.error("Couldn't send trade info", var8); + } finally { + var3.release(); + } + } + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147038_v); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + MerchantRecipeList var6 = this.field_147037_w.getRecipes(this.mc.thePlayer); + + if (var6 != null && !var6.isEmpty()) { + int var7 = this.field_147041_z; + MerchantRecipe var8 = (MerchantRecipe)var6.get(var7); + + if (var8.isRecipeDisabled()) { + this.mc.getTextureManager().bindTexture(field_147038_v); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + drawTexturedModalRect(this.field_147003_i + 83, this.field_147009_r + 21, 212, 0, 28, 21); + drawTexturedModalRect(this.field_147003_i + 83, this.field_147009_r + 51, 212, 0, 28, 21); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + MerchantRecipeList var4 = this.field_147037_w.getRecipes(this.mc.thePlayer); + + if (var4 != null && !var4.isEmpty()) { + int var5 = (this.width - this.field_146999_f) / 2; + int var6 = (this.height - this.field_147000_g) / 2; + int var7 = this.field_147041_z; + MerchantRecipe var8 = (MerchantRecipe)var4.get(var7); + GL11.glPushMatrix(); + ItemStack var9 = var8.getItemToBuy(); + ItemStack var10 = var8.getSecondItemToBuy(); + ItemStack var11 = var8.getItemToSell(); + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_LIGHTING); + itemRender.zLevel = 100.0F; + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); + + if (var10 != null) { + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); + } + + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var11, var5 + 120, var6 + 24); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var11, var5 + 120, var6 + 24); + itemRender.zLevel = 0.0F; + GL11.glDisable(GL11.GL_LIGHTING); + + if (this.func_146978_c(36, 24, 16, 16, p_73863_1_, p_73863_2_)) { + this.func_146285_a(var9, p_73863_1_, p_73863_2_); + } else if (var10 != null && this.func_146978_c(62, 24, 16, 16, p_73863_1_, p_73863_2_)) { + this.func_146285_a(var10, p_73863_1_, p_73863_2_); + } else if (this.func_146978_c(120, 24, 16, 16, p_73863_1_, p_73863_2_)) { + this.func_146285_a(var11, p_73863_1_, p_73863_2_); + } + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } + } + + public IMerchant func_147035_g() { + return this.field_147037_w; + } + + static class MerchantButton extends GuiButton { + private final boolean field_146157_o; + + + public MerchantButton(int p_i1095_1_, int p_i1095_2_, int p_i1095_3_, boolean p_i1095_4_) { + super(p_i1095_1_, p_i1095_2_, p_i1095_3_, 12, 19, ""); + this.field_146157_o = p_i1095_4_; + } + + public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) { + if (this.field_146125_m) { + p_146112_1_.getTextureManager().bindTexture(GuiMerchant.field_147038_v); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + boolean var4 = p_146112_2_ >= this.field_146128_h && p_146112_3_ >= this.field_146129_i && p_146112_2_ < this.field_146128_h + this.field_146120_f && p_146112_3_ < this.field_146129_i + this.field_146121_g; + int var5 = 0; + int var6 = 176; + + if (!this.enabled) { + var6 += this.field_146120_f * 2; + } else if (var4) { + var6 += this.field_146120_f; + } + + if (!this.field_146157_o) { + var5 += this.field_146121_g; + } + + drawTexturedModalRect(this.field_146128_h, this.field_146129_i, var6, var5, this.field_146120_f, this.field_146121_g); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java new file mode 100644 index 0000000..0a021fa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiMultiplayer.java @@ -0,0 +1,405 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.mainmenu.menus.VanillaMenu; +import com.cheatbreaker.client.ui.warning.UnsafeServerWarningGUI; +import com.cheatbreaker.client.util.render.serverlist.ServerListEntryPinned; +import com.cheatbreaker.client.util.render.serverlist.UnsafeServerAction; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.LanServerDetector; +import net.minecraft.client.network.OldServerPinger; +import net.minecraft.client.resources.I18n; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; + +import java.util.List; + +public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback { + private static final Logger logger = LogManager.getLogger(); + private final OldServerPinger field_146797_f = new OldServerPinger(); + private final GuiScreen field_146798_g; + private ServerSelectionList field_146803_h; + private ServerList field_146804_i; + private GuiButton field_146810_r; + private GuiButton field_146809_s; + private GuiButton field_146808_t; + private boolean field_146807_u; + private boolean field_146806_v; + private boolean field_146805_w; + private boolean field_146813_x; + private String field_146812_y; + private ServerData field_146811_z; + private LanServerDetector.LanServerList field_146799_A; + private LanServerDetector.ThreadLanServerFind field_146800_B; + private boolean field_146801_C; + + public void lIIIIlIIllIIlIIlIIIlIIllI(ServerListEntryNormal serverListEntryNormal) { + this.func_146791_a(serverListEntryNormal.func_148296_a()); + } + + public boolean lIIIIIIIIIlIllIIllIlIIlIl(ServerListEntryNormal serverListEntryNormal) { + int n = this.field_146803_h.lIIIIlIIllIIlIIlIIIlIIllI(serverListEntryNormal); + GuiListExtended.IGuiListEntry guiListExtendedIGuiListEntry = n < 0 ? null : this.field_146803_h.func_148180_b(n + 1); + return n > 0 && guiListExtendedIGuiListEntry instanceof ServerListEntryNormal; + } + + public void IlllIIIlIlllIllIlIIlllIlI(ServerListEntryNormal serverListEntryNormal) { + int n = this.field_146803_h.lIIIIlIIllIIlIIlIIIlIIllI(serverListEntryNormal); + GuiListExtended.IGuiListEntry guiListExtendedIGuiListEntry = n < 0 ? null : this.field_146803_h.func_148180_b(n - 1); + if (n > 0 && guiListExtendedIGuiListEntry instanceof ServerListEntryNormal) { + this.field_146804_i.swapServers(n, n - 1); + this.func_146790_a(this.field_146803_h.func_148193_k() - 1); + this.field_146803_h.func_148145_f(-this.field_146803_h.func_148146_j()); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + } + + public void IIIIllIlIIIllIlllIlllllIl(ServerListEntryNormal serverListEntryNormal) { + int n = this.field_146803_h.lIIIIlIIllIIlIIlIIIlIIllI(serverListEntryNormal); + GuiListExtended.IGuiListEntry guiListExtendedIGuiListEntry = n < 0 ? null : this.field_146803_h.func_148180_b(n + 1); + if (n > 0 && guiListExtendedIGuiListEntry instanceof ServerListEntryNormal) { + this.field_146804_i.swapServers(n, n + 1); + this.func_146790_a(this.field_146803_h.func_148193_k() + 1); + this.field_146803_h.func_148145_f(-this.field_146803_h.func_148146_j()); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + } + + public boolean IIIIllIIllIIIIllIllIIIlIl(ServerListEntryNormal serverListEntryNormal) { + try { + int n = this.field_146803_h.lIIIIlIIllIIlIIlIIIlIIllI(serverListEntryNormal); + GuiListExtended.IGuiListEntry guiListExtendedIGuiListEntry = n < 0 ? null : this.field_146803_h.func_148180_b(n - 1); + if (n > 0 && guiListExtendedIGuiListEntry != null && guiListExtendedIGuiListEntry instanceof ServerListEntryNormal) { + return true; + } + } catch (Exception exception) { + + } + return false; + } + + public GuiMultiplayer(GuiScreen p_i1040_1_) { + this.field_146798_g = p_i1040_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + + if (!this.field_146801_C) { + this.field_146801_C = true; + this.field_146804_i = new ServerList(this.mc); + this.field_146804_i.loadServerList(); + this.field_146799_A = new LanServerDetector.LanServerList(); + + try { + this.field_146800_B = new LanServerDetector.ThreadLanServerFind(this.field_146799_A); + this.field_146800_B.start(); + } catch (Exception var2) { + logger.warn("Unable to start LAN server detection: " + var2.getMessage()); + } + + this.field_146803_h = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36); + this.field_146803_h.func_148195_a(this.field_146804_i); + } else { + this.field_146803_h.func_148122_a(this.width, this.height, 32, this.height - 64); + } + + this.func_146794_g(); + } + + public void func_146794_g() { + this.buttonList.add(this.field_146810_r = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.format("selectServer.edit"))); + this.buttonList.add(this.field_146808_t = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.format("selectServer.delete"))); + this.buttonList.add(this.field_146809_s = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.format("selectServer.select"))); + this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.format("selectServer.direct"))); + this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.format("selectServer.add"))); + this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.format("selectServer.refresh"))); + this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.format("gui.cancel"))); + this.func_146790_a(this.field_146803_h.func_148193_k()); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + + if (this.field_146799_A.getWasUpdated()) { + List var1 = this.field_146799_A.getLanServers(); + this.field_146799_A.setWasNotUpdated(); + this.field_146803_h.func_148194_a(var1); + } + + this.field_146797_f.func_147223_a(); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + + if (this.field_146800_B != null) { + this.field_146800_B.interrupt(); + this.field_146800_B = null; + } + + this.field_146797_f.func_147226_b(); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + GuiListExtended.IGuiListEntry var2 = this.field_146803_h.func_148193_k() < 0 ? null : this.field_146803_h.func_148180_b(this.field_146803_h.func_148193_k()); + + if (p_146284_1_.id == 2 && var2 instanceof ServerListEntryNormal) { + String var9 = ((ServerListEntryNormal)var2).func_148296_a().serverName; + + if (var9 != null) { + this.field_146807_u = true; + String var4 = I18n.format("selectServer.deleteQuestion"); + String var5 = "'" + var9 + "' " + I18n.format("selectServer.deleteWarning"); + String var6 = I18n.format("selectServer.deleteButton"); + String var7 = I18n.format("gui.cancel"); + GuiYesNo var8 = new GuiYesNo(this, var4, var5, var6, var7, this.field_146803_h.func_148193_k()); + this.mc.displayGuiScreen(var8); + } + } else if (p_146284_1_.id == 1) { + this.func_146796_h(); + } else if (p_146284_1_.id == 4) { + this.field_146813_x = true; + this.mc.displayGuiScreen(new GuiScreenServerList(this, this.field_146811_z = new ServerData(I18n.format("selectServer.defaultName"), ""))); + } else if (p_146284_1_.id == 3) { + this.field_146806_v = true; + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.field_146811_z = new ServerData(I18n.format("selectServer.defaultName"), ""))); + } else if (p_146284_1_.id == 7 && var2 instanceof ServerListEntryNormal) { + this.field_146805_w = true; + ServerData var3 = ((ServerListEntryNormal)var2).func_148296_a(); + this.field_146811_z = new ServerData(var3.serverName, var3.serverIP); + this.field_146811_z.func_152583_a(var3); + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.field_146811_z)); + } else if (p_146284_1_.id == 0) { + if (this.mc.isSingleplayer() || (!this.mc.isIntegratedServerRunning() && this.mc.theWorld != null)) { + this.mc.displayGuiScreen(this.field_146798_g); + } else { + this.mc.displayGuiScreen(new VanillaMenu()); + } + } else if (p_146284_1_.id == 8) { + this.func_146792_q(); + } + } + } + + private void func_146792_q() { + this.mc.displayGuiScreen(new GuiMultiplayer(this.field_146798_g)); + } + + public void confirmClicked(boolean p_73878_1_, int p_73878_2_) { + GuiListExtended.IGuiListEntry var3 = this.field_146803_h.func_148193_k() < 0 ? null : this.field_146803_h.func_148180_b(this.field_146803_h.func_148193_k()); + + if (this.field_146807_u) { + this.field_146807_u = false; + + if (p_73878_1_ && var3 instanceof ServerListEntryNormal) { + this.field_146804_i.removeServerData(this.field_146803_h.func_148193_k()); + this.field_146804_i.saveServerList(); + this.field_146803_h.func_148192_c(-1); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + + this.mc.displayGuiScreen(this); + } else if (this.field_146813_x) { + this.field_146813_x = false; + + if (p_73878_1_) { + this.func_146791_a(this.field_146811_z); + } else { + this.mc.displayGuiScreen(this); + } + } else if (this.field_146806_v) { + this.field_146806_v = false; + + if (p_73878_1_) { + this.field_146804_i.addServerData(this.field_146811_z); + this.field_146804_i.saveServerList(); + this.field_146803_h.func_148192_c(-1); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + + this.mc.displayGuiScreen(this); + } else if (this.field_146805_w) { + this.field_146805_w = false; + + if (p_73878_1_ && (var3 instanceof ServerListEntryNormal || var3 instanceof ServerListEntryPinned)) { + ServerData var4 = ((ServerListEntryNormal)var3).func_148296_a(); + var4.serverName = this.field_146811_z.serverName; + var4.serverIP = this.field_146811_z.serverIP; + var4.func_152583_a(this.field_146811_z); + this.field_146804_i.saveServerList(); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + + this.mc.displayGuiScreen(this); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + int var3 = this.field_146803_h.func_148193_k(); + GuiListExtended.IGuiListEntry var4 = var3 < 0 ? null : this.field_146803_h.func_148180_b(var3); + + if (p_73869_2_ == 63) { + this.func_146792_q(); + } else { + if (var3 >= 0) { + if (p_73869_2_ == 200) { + if (isShiftKeyDown()) { + if (var3 > 0 && var4 instanceof ServerListEntryNormal) { + this.field_146804_i.swapServers(var3, var3 - 1); + this.func_146790_a(this.field_146803_h.func_148193_k() - 1); + this.field_146803_h.func_148145_f(-this.field_146803_h.func_148146_j()); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + } else if (var3 > 0) { + this.func_146790_a(this.field_146803_h.func_148193_k() - 1); + this.field_146803_h.func_148145_f(-this.field_146803_h.func_148146_j()); + + if (this.field_146803_h.func_148180_b(this.field_146803_h.func_148193_k()) instanceof ServerListEntryLanScan) { + if (this.field_146803_h.func_148193_k() > 0) { + this.func_146790_a(this.field_146803_h.getSize() - 1); + this.field_146803_h.func_148145_f(-this.field_146803_h.func_148146_j()); + } else { + this.func_146790_a(-1); + } + } + } else { + this.func_146790_a(-1); + } + } else if (p_73869_2_ == 208) { + if (isShiftKeyDown()) { + if (var3 < this.field_146804_i.countServers() - 1) { + this.field_146804_i.swapServers(var3, var3 + 1); + this.func_146790_a(var3 + 1); + this.field_146803_h.func_148145_f(this.field_146803_h.func_148146_j()); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + } else if (var3 < this.field_146803_h.getSize()) { + this.func_146790_a(this.field_146803_h.func_148193_k() + 1); + this.field_146803_h.func_148145_f(this.field_146803_h.func_148146_j()); + + if (this.field_146803_h.func_148180_b(this.field_146803_h.func_148193_k()) instanceof ServerListEntryLanScan) { + if (this.field_146803_h.func_148193_k() < this.field_146803_h.getSize() - 1) { + this.func_146790_a(this.field_146803_h.getSize() + 1); + this.field_146803_h.func_148145_f(this.field_146803_h.func_148146_j()); + } else { + this.func_146790_a(-1); + } + } + } else { + this.func_146790_a(-1); + } + } else if (p_73869_2_ != 28 && p_73869_2_ != 156) { + super.keyTyped(p_73869_1_, p_73869_2_); + } else { + this.actionPerformed(this.buttonList.get(2)); + } + } else { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.field_146812_y = null; + this.drawDefaultBackground(); + this.field_146803_h.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.title"), this.width / 2, 20, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + + if (this.field_146812_y != null) { + this.func_146283_a(Lists.newArrayList(Splitter.on("\n").split(this.field_146812_y)), p_73863_1_, p_73863_2_); + } + } + + public void func_146796_h() { + GuiListExtended.IGuiListEntry var1 = this.field_146803_h.func_148193_k() < 0 ? null : this.field_146803_h.func_148180_b(this.field_146803_h.func_148193_k()); + + if (var1 instanceof ServerListEntryNormal) { + this.func_146791_a(((ServerListEntryNormal)var1).func_148296_a()); + } else if (var1 instanceof ServerListEntryPinned) { + this.func_146791_a(((ServerListEntryPinned)var1).getServer()); + } else if (var1 instanceof ServerListEntryLanDetected) { + LanServerDetector.LanServer var2 = ((ServerListEntryLanDetected)var1).func_148289_a(); + this.func_146791_a(new ServerData(var2.getServerMotd(), var2.getServerIpPort(), true)); + } + } + + private void func_146791_a(ServerData data) { + if (this.mc.currentServerData != null && this.mc.theWorld != null) { + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld((WorldClient)null); + } + for (String[] string : CheatBreaker.getInstance().getGlobalSettings().getUnsafeServers()) { + if (!data.serverIP.toLowerCase().startsWith(string[0].toLowerCase()) && !data.serverIP.toLowerCase().matches("([a-zA-Z0-9]+)" + string[0].toLowerCase() + "([a-zA-Z0-9]+)")) continue; + this.mc.displayGuiScreen(new UnsafeServerWarningGUI(this, data, string[1], string[2].equals(String.valueOf(UnsafeServerAction.BLOCK)))); + return; + } + this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, data)); + } + + public void func_146790_a(int p_146790_1_) { + this.field_146803_h.func_148192_c(p_146790_1_); + GuiListExtended.IGuiListEntry var2 = p_146790_1_ < 0 ? null : this.field_146803_h.func_148180_b(p_146790_1_); + this.field_146809_s.enabled = false; + this.field_146810_r.enabled = false; + this.field_146808_t.enabled = false; + + if (var2 != null && !(var2 instanceof ServerListEntryLanScan)) { + this.field_146809_s.enabled = true; + + if (var2 instanceof ServerListEntryNormal) { + this.field_146810_r.enabled = true; + this.field_146808_t.enabled = true; + } + } + } + + public OldServerPinger func_146789_i() { + return this.field_146797_f; + } + + public void writeStringToBuffer(String p_146793_1_) { + this.field_146812_y = p_146793_1_; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146803_h.func_148179_a(p_73864_1_, p_73864_2_, mouseButton); + } + + protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) { + super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_); + this.field_146803_h.func_148181_b(p_146286_1_, p_146286_2_, p_146286_3_); + } + + public ServerList getServerList() { + return this.field_146804_i; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiNewChat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiNewChat.java new file mode 100644 index 0000000..0d3eeb2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiNewChat.java @@ -0,0 +1,618 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.hud.chat.ModuleChat; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleNickHider; +import com.cheatbreaker.client.ui.module.HudLayoutEditorGui; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.util.chat.ChatLineWrapper; +import com.google.common.collect.Lists; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class GuiNewChat extends Gui { + private static final Logger logger = LogManager.getLogger(); + private final Minecraft mc; + public final List sentMessages = new ArrayList<>(); + public final List chatLines = new ArrayList<>(); + public final List drawnChatLines = new ArrayList<>(); + public final List brandedLines = new ArrayList<>(); + public int scrollPos; + public boolean isScrolled; + + private boolean smoothChat = false; + public int newLines; + public float percentComplete; + public long prevMillis = System.currentTimeMillis(); + public float animationPercent; + public int lineBeingDrawn; + + + public GuiNewChat(Minecraft p_i1022_1_) { + this.mc = p_i1022_1_; + } + + public void func_146230_a(int p_146230_1_) { + if (this.mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int scaledWidth = scaledResolution.getScaledWidth(); + int scaledHeight = scaledResolution.getScaledHeight(); + GuiScreen currentScreen = this.mc.currentScreen; + if ((currentScreen instanceof HudLayoutEditorGui && ((HudLayoutEditorGui)currentScreen).helpButton.isMouseInside(Mouse.getX() * scaledWidth / this.mc.displayWidth, scaledHeight - Mouse.getY() * scaledHeight / this.mc.displayHeight - 1)) || (CheatBreaker.getInstance().getModuleManager().chatMod.hiddenFromHud && !(currentScreen instanceof GuiChat))) { + return; + } + + int var2 = this.func_146232_i(); + boolean var3 = false; + int var4 = 0; + int var5 = this.drawnChatLines.size(); + float var6 = this.mc.gameSettings.chatOpacity * 0.9F + 0.1F; + + if (var5 > 0) { + if (this.getChatOpen()) { + var3 = true; + } + + float var7 = this.func_146244_h(); + int var8 = MathHelper.ceiling_float_int((float)this.func_146228_f() / var7); + GL11.glPushMatrix(); + GL11.glTranslatef(2.0F, 20.0f, 0.0F); + GL11.glScalef(var7, var7, 1.0F); + int var9; + int var11; + int var14; + + for (var9 = 0; var9 + this.scrollPos < this.drawnChatLines.size() && var9 < var2; ++var9) { + ChatLine var10 = this.drawnChatLines.get(var9 + this.scrollPos); + + if (var10 != null) { + var11 = p_146230_1_ - var10.getUpdatedCounter(); + + if (var11 < 200 || var3) { + double var12 = (double)var11 / 200.0D; + var12 = 1.0D - var12; + var12 *= 10.0D; + + if (var12 < 0.0D) { + var12 = 0.0D; + } + + if (var12 > 1.0D) { + var12 = 1.0D; + } + + var12 *= var12; + var14 = (int)(255.0D * var12); + + if (var3) { + var14 = 255; + } + + var14 = (int)((float)var14 * var6); + ++var4; + + if (var14 > 3) { + byte var15 = 0; + int var16 = -var9 * 9; + drawRect(var15, var16 - 9, var15 + var8 + 4, var16, var14 / 2 << 24); + String var17 = var10.func_151461_a().getFormattedText(); + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + var17 = var17.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } + + this.mc.fontRenderer.drawStringWithShadow(var17, var15, var16 - 8, 16777215 + (var14 << 24)); + GL11.glDisable(GL11.GL_ALPHA_TEST); + } + } + } + } + + if (var3) { + var9 = this.mc.fontRenderer.FONT_HEIGHT; + GL11.glTranslatef(-3.0F, 0.0F, 0.0F); + int var18 = var5 * var9 + var5; + var11 = var4 * var9 + var4; + int var19 = this.scrollPos * var11 / var5; + int var13 = var11 * var11 / var18; + + if (var18 != var11) { + var14 = var19 > 0 ? 170 : 96; + int var20 = this.isScrolled ? 13382451 : 3355562; + drawRect(0, -var19, 2, -var19 - var13, var20 + (var14 << 24)); + drawRect(2, -var19, 1, -var19 - var13, 13421772 + (var14 << 24)); + } + } + + GL11.glPopMatrix(); + } + } + } + + public void drawCustomChat(int p_146230_1_, boolean smoothChat) { + this.smoothChat = smoothChat; + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + + if (this.mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN) { + ScaledResolution scaledResolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int scaledWidth = scaledResolution.getScaledWidth(); + int scaledHeight = scaledResolution.getScaledHeight(); + GuiScreen currentScreen = this.mc.currentScreen; + boolean showInHudEditor = !CheatBreaker.getInstance().getModuleManager().chatMod.isRenderHud() || !(currentScreen instanceof HudLayoutEditorGui); + boolean showWhenHidden = CheatBreaker.getInstance().getModuleManager().chatMod.hiddenFromHud && !(currentScreen instanceof GuiChat) && showInHudEditor; + if ((currentScreen instanceof HudLayoutEditorGui && ((HudLayoutEditorGui)currentScreen).helpButton.isMouseInside(Mouse.getX() * scaledWidth / this.mc.displayWidth, scaledHeight - Mouse.getY() * scaledHeight / this.mc.displayHeight - 1)) || showWhenHidden) { + return; + } + + int var2 = this.func_146232_i(); + boolean var3 = false; + int var4 = 0; + int var5 = this.drawnChatLines.size(); + float var6 = this.mc.gameSettings.chatOpacity * chatMod.masterOpacity.getFloatValue() / 100.0F * 0.9F + 0.1F; + + long current = System.currentTimeMillis(); + long diff = current - this.prevMillis; + this.prevMillis = current; + this.updatePercentage(diff); + float t = this.percentComplete; + this.animationPercent = clamp(1.0f - (t -= 1.0f) * t * t * t, 0.0f, 1.0f); + + if (var5 > 0) { + if (this.getChatOpen()) { + var3 = true; + } + + float var7 = this.func_146244_h(); + int var8 = MathHelper.ceiling_float_int((float)this.func_146228_f() / var7); + GL11.glPushMatrix(); + float y = chatMod.isRenderHud() ? chatMod.height : 20.0F - chatMod.chatHeightFix.getFloatValue(); + if (this.smoothChat && !this.isScrolled) { + y += (9.0f - 9.0f * this.animationPercent) * this.func_146244_h(); + } + GL11.glTranslatef(chatMod.isRenderHud() ? 0.0F : 2.0F, y, 0.0F); + GL11.glScalef(var7, var7, 1.0F); + int var9; + int var11; + int var14; + + for (var9 = 0; var9 + this.scrollPos < this.drawnChatLines.size() && var9 < var2; ++var9) { + ChatLine var10 = this.drawnChatLines.get(this.getLineBeingDrawn(var9 + this.scrollPos)); + + if (var10 != null) { + var11 = p_146230_1_ - var10.getUpdatedCounter(); + if (var11 < 200 || var3) { + double var12 = (double)var11 / 200.0D; + var12 = 1.0D - var12; + var12 *= 10.0D; + + if (var12 < 0.0D) { + var12 = 0.0D; + } + + if (var12 > 1.0D) { + var12 = 1.0D; + } + + var12 *= var12; + var14 = (int)(255.0D * var12); + + if (var3) { + var14 = 255; + } + + var14 = (int)((float)var14 * var6); + ++var4; + + if (var14 > 3) { + byte var15 = 0; + int var16 = -var9 * 9; + + String var17 = var10.func_151461_a().getFormattedText(); + if (this.mc.currentScreen instanceof GuiChat && chatMod.background.getValue().equals("While Typing") || chatMod.background.getValue().equals("ON")) { + int bga = (int) ((chatMod.backgroundColor.getColorValue() >> 24 & 255) * ((float)var14 / 255.0F)); + int bgr = chatMod.backgroundColor.getColorValue() >> 16 & 255; + int bgg = chatMod.backgroundColor.getColorValue() >> 8 & 255; + int bgb = chatMod.backgroundColor.getColorValue() & 255; + int width = chatMod.backgroundWidthType.getValue().equals("Full") ? var8 + 4 : this.mc.fontRenderer.getStringWidth(var17); + drawRect(var15, var16 - 9, var15 + width, var16, modifyBackgroundOpacity(new Color(bgr, bgg, bgb, bga).getRGB())); + } + + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + var17 = var17.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + var17 = var17.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + boolean strip = chatMod.stripFormattingColors.getBooleanValue(); + GL11.glEnable(3042); + + boolean nickHiderName = CheatBreaker.getInstance().getModuleManager().nickHiderMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().nickHiderMod.hideRealName.getBooleanValue(); + String nickHiderNameString = CheatBreaker.getInstance().getModuleManager().nickHiderMod.customNameString.getStringValue(); + + if (var17.contains(Minecraft.getMinecraft().getSession().getUsername()) || var17.contains(nickHiderNameString)) { + if (!chatMod.highlightColor.getStringValue().equalsIgnoreCase("None") && chatMod.highlightOwnName.getBooleanValue()) { + var17 = var17.replaceAll((nickHiderName ? nickHiderNameString : Minecraft.getMinecraft().getSession().getUsername()), chatMod.getHighlightColor() + (nickHiderName ? nickHiderNameString : Minecraft.getMinecraft().getSession().getUsername()) + EnumChatFormatting.RESET); + } + } + + for (int n7 = 0; n7 + this.scrollPos < this.drawnChatLines.size() && n7 < this.func_146232_i(); ++n7) { + ChatLine chatLine = this.drawnChatLines.get(n7 + this.scrollPos); + if (!var3 && !(10.0 - (double)(p_146230_1_ - chatLine.getUpdatedCounter()) / 20.0 > 1.0)) continue; + if (chatLine instanceof ChatLineWrapper) { + ChatLineWrapper chatLineWrapper = (ChatLineWrapper)chatLine; + if (chatLineWrapper.isBranded()) { + this.brandedLines.add(chatLine); + } + } + } + + this.mc.fontRenderer.drawString(strip ? chatMod.stripColor(var17) : var17, var15 + (this.brandedLines.contains(var10) ? 14.5F : 0), var16 - 8, modifyTextOpacity(strip ? chatMod.textColor.getColorValue() : 16777215 + (var14 << 24)), chatMod.textShadow.getBooleanValue()); + GL11.glDisable(GL11.GL_ALPHA_TEST); + } + } + } + } + + if (var3) { + var9 = this.mc.fontRenderer.FONT_HEIGHT; + GL11.glTranslatef(-3.0F, 0.0F, 0.0F); + int var18 = var5 * var9 + var5; + var11 = var4 * var9 + var4; + int var19 = this.scrollPos * var11 / var5; + int var13 = var11 * var11 / var18; + + if (var18 != var11) { + var14 = var19 > 0 ? 170 : 96; + int var20 = this.isScrolled ? 13382451 : 3355562; + drawRect(0, -var19, 2, -var19 - var13, var20 + (var14 << 24)); + drawRect(2, -var19, 1, -var19 - var13, 13421772 + (var14 << 24)); + } + } + + int n6 = 0; + for (int n7 = 0; n7 + this.scrollPos < this.drawnChatLines.size() && n7 < this.func_146232_i(); ++n7) { + ChatLine chatLine = this.drawnChatLines.get(n7 + this.scrollPos); + if (!var3 && !(10.0 - (double)(p_146230_1_ - chatLine.getUpdatedCounter()) / 20.0 > 1.0)) continue; + n6 -= Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; + if (!(chatLine instanceof ChatLineWrapper)) continue; + ChatLineWrapper chatLineWrapper = (ChatLineWrapper)chatLine; + if (!chatLineWrapper.isBranded()) continue; + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + RenderUtil.renderIcon(new ResourceLocation("client/logo_white.png"), (getChatOpen() ? 4.305F : 1.3F), (float)n6 + 1.5f, 12.0f, 6.0f); + } + + GL11.glPopMatrix(); + } + } + } + + private int modifyTextOpacity(int original) { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + if (this.smoothChat && this.lineBeingDrawn <= this.newLines) { + int opacity = original >> 24 & 0xFF; + opacity = (int)((float)opacity * this.animationPercent * chatMod.textOpacity.getFloatValue() / 100.0F); + return original & 0xFFFFFF | opacity << 24; + } + int a = (int)((original >> 24 & 255) * chatMod.textOpacity.getFloatValue() / 100.0F); + return new Color(original >> 16 & 255, original >> 8 & 255, original & 255, a).getRGB(); + } + + private int modifyBackgroundOpacity(int original) { + if (this.smoothChat && this.lineBeingDrawn <= this.newLines) { + int opacity = original >> 24 & 0xFF; + opacity = (int)((float)opacity * this.animationPercent); + return original & 0xFFFFFF | opacity << 24; + } + return original; + } + + private int getLineBeingDrawn(int line) { + this.lineBeingDrawn = line; + return line; + } + + private void updatePercentage(long diff) { + if (this.percentComplete < 1.0f) { + this.percentComplete += 0.001f * CheatBreaker.getInstance().getModuleManager().chatMod.smoothChatSpeed.getFloatValue() / 2.0f * (float)diff; + } + this.percentComplete = clamp(this.percentComplete, 0.0f, 1.0f); + } + + public static float clamp(float number, float min, float max) { + return number < min ? min : Math.min(number, max); + } + + public void func_146231_a() { + this.drawnChatLines.clear(); + this.chatLines.clear(); + this.sentMessages.clear(); + } + + public void func_146227_a(IChatComponent p_146227_1_) { + this.func_146234_a(p_146227_1_, 0); + } + + public void func_146234_av(IChatComponent p_146234_1_) { + this.percentComplete = 0.0f; + this.func_146237_a(p_146234_1_, 0, this.mc.ingameGUI.getUpdateCounter(), false); + } + + public void func_146234_a(IChatComponent p_146234_1_, int p_146234_2_) { + this.percentComplete = 0.0f; + this.func_146237_a(p_146234_1_, p_146234_2_, this.mc.ingameGUI.getUpdateCounter(), false); + logger.info("[CHAT] " + p_146234_1_.getUnformattedText()); + } + + private String func_146235_b(String p_146235_1_) { + return Minecraft.getMinecraft().gameSettings.chatColours ? p_146235_1_ : EnumChatFormatting.getTextWithoutFormattingCodes(p_146235_1_); + } + + private void func_146237_a(IChatComponent p_146237_1_, int p_146237_2_, int p_146237_3_, boolean p_146237_4_) { + if (p_146237_2_ != 0) { + this.func_146242_c(p_146237_2_); + } + + int var5 = MathHelper.floor_float((float)this.func_146228_f() / this.func_146244_h()); + int var6 = 0; + ChatComponentText var7 = new ChatComponentText(""); + List var8 = Lists.newArrayList(); + ArrayList var9 = Lists.newArrayList(p_146237_1_); + + if (p_146237_1_ instanceof ChatComponentText && ((ChatComponentText)p_146237_1_).isBranded()) { + var7.setBranded(true); + } + + for (int var10 = 0; var10 < var9.size(); ++var10) { + IChatComponent var11 = (IChatComponent)var9.get(var10); + String var12 = this.func_146235_b(var11.getChatStyle().getFormattingCode() + var11.getUnformattedTextForChat()); + int var13 = this.mc.fontRenderer.getStringWidth(var12); + ChatComponentText var14 = new ChatComponentText(var12); + var14.setChatStyle(var11.getChatStyle().createShallowCopy()); + boolean var15 = false; + + if (var6 + var13 > var5) { + String var16 = this.mc.fontRenderer.trimStringToWidth(var12, var5 - var6, false); + String var17 = var16.length() < var12.length() ? var12.substring(var16.length()) : null; + + if (var17 != null && var17.length() > 0) { + int var18 = var16.lastIndexOf(" "); + + if (var18 >= 0 && this.mc.fontRenderer.getStringWidth(var12.substring(0, var18)) > 0) { + var16 = var12.substring(0, var18); + var17 = var12.substring(var18); + } + + ChatComponentText var19 = new ChatComponentText(var17); + var19.setChatStyle(var11.getChatStyle().createShallowCopy()); + var9.add(var10 + 1, var19); + } + + var13 = this.mc.fontRenderer.getStringWidth(var16); + var14 = new ChatComponentText(var16); + var14.setChatStyle(var11.getChatStyle().createShallowCopy()); + var15 = true; + } + + if (var6 + var13 <= var5) { + var6 += var13; + var7.appendSibling(var14); + } else { + var15 = true; + } + + if (var15) { + var8.add(var7); + var6 = 0; + var7 = new ChatComponentText(""); + } + } + + var8.add(var7); + boolean var20 = this.getChatOpen(); + IChatComponent var22; + + for (ChatComponentText chatComponentText5 : var8) { + ChatLine chatLine = new ChatLine(p_146237_3_, chatComponentText5, p_146237_2_); + ChatLineWrapper of = ChatLineWrapper.of(chatLine); + if (chatComponentText5.isBranded()) { + of.setBranded(true); + this.drawnChatLines.add(0, of); + } + + if (!chatComponentText5.isBranded()) { + this.drawnChatLines.add(0, new ChatLine(p_146237_3_, chatComponentText5, p_146237_2_)); + } + + if (var20 && this.scrollPos > 0) { + this.isScrolled = true; + this.func_146229_b(1); + } + } + + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + while (this.drawnChatLines.size() > 100 && !chatMod.unlimitedChat.getBooleanValue()) { + this.drawnChatLines.remove(this.drawnChatLines.size() - 1); + } + + if (!p_146237_4_) { + this.chatLines.add(0, new ChatLine(p_146237_3_, p_146237_1_, p_146237_2_)); + + while (this.chatLines.size() > 100 && !chatMod.unlimitedChat.getBooleanValue()) { + this.chatLines.remove(this.chatLines.size() - 1); + } + } + + setNewLines(var8); + } + + public void func_146245_b() { + this.drawnChatLines.clear(); + this.resetScroll(); + + for (int var1 = this.chatLines.size() - 1; var1 >= 0; --var1) { + ChatLine var2 = this.chatLines.get(var1); + this.func_146237_a(var2.func_151461_a(), var2.getChatLineID(), var2.getUpdatedCounter(), true); + } + } + + private List setNewLines(List original) { + this.newLines = original.size() - 1; + return original; + } + + public List func_146238_c() { + return this.sentMessages; + } + + public void func_146239_a(String p_146239_1_) { + if (this.sentMessages.isEmpty() || !this.sentMessages.get(this.sentMessages.size() - 1).equals(p_146239_1_)) { + this.sentMessages.add(p_146239_1_); + } + } + + public void resetScroll() { + this.scrollPos = 0; + this.isScrolled = false; + } + + public void func_146229_b(int p_146229_1_) { + this.scrollPos += p_146229_1_; + int var2 = this.drawnChatLines.size(); + + if (this.scrollPos > var2 - this.func_146232_i()) { + this.scrollPos = var2 - this.func_146232_i(); + } + + if (this.scrollPos <= 0) { + this.scrollPos = 0; + this.isScrolled = false; + } + } + + public IChatComponent func_146236_a(int mouseX, int mouseY) { + if (!this.getChatOpen()) { + return null; + } else { + ScaledResolution var3 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var4 = var3.getScaleFactor(); + float var5 = this.func_146244_h(); + int var6 = mouseX / var4 - 2; + int var7 = mouseY / var4 - 28; + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + if (chatMod.isRenderHud() && chatMod.isEnabled()) { + float[] scaledPoints = chatMod.getScaledPoints(var3, true); + var6 = (int)(mouseX / var4 / chatMod.masterScale() - scaledPoints[0]); + var7 = (int)(mouseY / var4 / chatMod.masterScale() - this.mc.displayHeight / var4 / chatMod.masterScale() + chatMod.height + scaledPoints[1]); + } else if (!chatMod.isRenderHud() && chatMod.isEnabled()) { + var7 = (int)(var7 - chatMod.chatHeightFix.getFloatValue()); + } + var6 = MathHelper.floor_float((float)var6 / var5); + var7 = MathHelper.floor_float((float)var7 / var5); + + if (var6 >= 0 && var7 >= 0) { + int var8 = Math.min(this.func_146232_i(), this.drawnChatLines.size()); + + if (var6 <= MathHelper.floor_float((float)this.func_146228_f() / this.func_146244_h()) && var7 < this.mc.fontRenderer.FONT_HEIGHT * var8 + var8) { + int var9 = var7 / this.mc.fontRenderer.FONT_HEIGHT + this.scrollPos; + + if (var9 >= 0 && var9 < this.drawnChatLines.size()) { + ChatLine var10 = this.drawnChatLines.get(var9); + int var11 = 0; + + for (Object o : var10.func_151461_a()) { + IChatComponent var13 = (IChatComponent) o; + + if (var13 instanceof ChatComponentText) { + var11 += this.mc.fontRenderer.getStringWidth(this.func_146235_b(((ChatComponentText) var13).getChatComponentText_TextValue())); + + if (var11 > var6) { + return var13; + } + } + } + } + + return null; + } else { + return null; + } + } else { + return null; + } + } + } + + public boolean getChatOpen() { + return this.mc.currentScreen instanceof GuiChat; + } + + public void func_146242_c(int p_146242_1_) { + Iterator var2 = this.drawnChatLines.iterator(); + ChatLine var3; + + while (var2.hasNext()) { + var3 = (ChatLine)var2.next(); + + if (var3.getChatLineID() == p_146242_1_) { + var2.remove(); + } + } + + var2 = this.chatLines.iterator(); + + while (var2.hasNext()) { + var3 = (ChatLine)var2.next(); + + if (var3.getChatLineID() == p_146242_1_) { + var2.remove(); + break; + } + } + } + + public int func_146228_f() { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + return !chatMod.isRenderHud() || !chatMod.isEnabled() ? func_146233_a(this.mc.gameSettings.chatWidth) : chatMod.backgroundWidth.getIntegerValue(); + } + + public int func_146246_g() { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + return !chatMod.isRenderHud() || !chatMod.isEnabled() ? func_146243_b(this.getChatOpen() ? this.mc.gameSettings.chatHeightFocused : this.mc.gameSettings.chatHeightUnfocused) : this.getChatOpen() ? chatMod.focusedBackgroundHeight.getIntegerValue() : chatMod.unfocusedBackgroundHeight.getIntegerValue(); + } + + public float func_146244_h() { + ModuleChat chatMod = CheatBreaker.getInstance().getModuleManager().chatMod; + return !chatMod.isRenderHud() || !chatMod.isEnabled() ? this.mc.gameSettings.chatScale : chatMod.textSize.getFloatValue() / 100.0F; + } + + public static int func_146233_a(float p_146233_0_) { + short var1 = 320; + byte var2 = 40; + return MathHelper.floor_float(p_146233_0_ * (float)(var1 - var2) + (float)var2); + } + + public static int func_146243_b(float p_146243_0_) { + short var1 = 180; + byte var2 = 20; + return MathHelper.floor_float(p_146243_0_ * (float)(var1 - var2) + (float)var2); + } + + public int func_146232_i() { + return this.func_146246_g() / 9; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionButton.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionButton.java new file mode 100644 index 0000000..7d0247e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionButton.java @@ -0,0 +1,26 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionButton extends GuiButton { + private final GameSettings.Options field_146137_o; + + + public GuiOptionButton(int p_i45011_1_, int p_i45011_2_, int p_i45011_3_, String p_i45011_4_) { + this(p_i45011_1_, p_i45011_2_, p_i45011_3_, null, p_i45011_4_); + } + + public GuiOptionButton(int p_i45012_1_, int p_i45012_2_, int p_i45012_3_, int p_i45012_4_, int p_i45012_5_, String p_i45012_6_) { + super(p_i45012_1_, p_i45012_2_, p_i45012_3_, p_i45012_4_, p_i45012_5_, p_i45012_6_); + this.field_146137_o = null; + } + + public GuiOptionButton(int p_i45013_1_, int p_i45013_2_, int p_i45013_3_, GameSettings.Options p_i45013_4_, String p_i45013_5_) { + super(p_i45013_1_, p_i45013_2_, p_i45013_3_, 150, 20, p_i45013_5_); + this.field_146137_o = p_i45013_4_; + } + + public GameSettings.Options func_146136_c() { + return this.field_146137_o; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java new file mode 100644 index 0000000..bd7ce71 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionSlider.java @@ -0,0 +1,93 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import org.lwjgl.opengl.GL11; + +public class GuiOptionSlider extends GuiButton { + private float field_146134_p; + public boolean field_146135_o; + private final GameSettings.Options field_146133_q; + private final float field_146132_r; + private final float field_146131_s; + + + public GuiOptionSlider(int p_i45016_1_, int p_i45016_2_, int p_i45016_3_, GameSettings.Options p_i45016_4_) { + this(p_i45016_1_, p_i45016_2_, p_i45016_3_, p_i45016_4_, 0.0F, 1.0F); + } + + public GuiOptionSlider(int p_i45017_1_, int p_i45017_2_, int p_i45017_3_, GameSettings.Options p_i45017_4_, float p_i45017_5_, float p_i45017_6_) { + super(p_i45017_1_, p_i45017_2_, p_i45017_3_, 150, 20, ""); + this.field_146134_p = 1.0F; + this.field_146133_q = p_i45017_4_; + this.field_146132_r = p_i45017_5_; + this.field_146131_s = p_i45017_6_; + Minecraft var7 = Minecraft.getMinecraft(); + this.field_146134_p = p_i45017_4_.normalizeValue(var7.gameSettings.getOptionFloatValue(p_i45017_4_)); + this.displayString = var7.gameSettings.getKeyBinding(p_i45017_4_); + } + + public int getHoverState(boolean p_146114_1_) { + return 0; + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + protected void mouseDragged(Minecraft p_146119_1_, int p_146119_2_, int p_146119_3_) { + if (this.field_146125_m) { + if (this.field_146135_o) { + this.field_146134_p = (float)(p_146119_2_ - (this.field_146128_h + 4)) / (float)(this.field_146120_f - 8); + + if (this.field_146134_p < 0.0F) { + this.field_146134_p = 0.0F; + } + + if (this.field_146134_p > 1.0F) { + this.field_146134_p = 1.0F; + } + + float var4 = this.field_146133_q.denormalizeValue(this.field_146134_p); + p_146119_1_.gameSettings.setOptionFloatValue(this.field_146133_q, var4); + this.field_146134_p = this.field_146133_q.normalizeValue(var4); + this.displayString = p_146119_1_.gameSettings.getKeyBinding(this.field_146133_q); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + drawTexturedModalRect(this.field_146128_h + (int)(this.field_146134_p * (float)(this.field_146120_f - 8)), this.field_146129_i, 0, 66, 4, 20); + drawTexturedModalRect(this.field_146128_h + (int)(this.field_146134_p * (float)(this.field_146120_f - 8)) + 4, this.field_146129_i, 196, 66, 4, 20); + } + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + public boolean mousePressed(Minecraft p_146116_1_, int p_146116_2_, int p_146116_3_) { + if (super.mousePressed(p_146116_1_, p_146116_2_, p_146116_3_)) { + this.field_146134_p = (float)(p_146116_2_ - (this.field_146128_h + 4)) / (float)(this.field_146120_f - 8); + + if (this.field_146134_p < 0.0F) { + this.field_146134_p = 0.0F; + } + + if (this.field_146134_p > 1.0F) { + this.field_146134_p = 1.0F; + } + + p_146116_1_.gameSettings.setOptionFloatValue(this.field_146133_q, this.field_146133_q.denormalizeValue(this.field_146134_p)); + this.displayString = p_146116_1_.gameSettings.getKeyBinding(this.field_146133_q); + this.field_146135_o = true; + return true; + } else { + return false; + } + } + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int p_146118_1_, int p_146118_2_) { + this.field_146135_o = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptions.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptions.java new file mode 100644 index 0000000..842c9c6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptions.java @@ -0,0 +1,120 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.module.impl.packmanager.gui.screen.GuiResourcePacks; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.audio.SoundEventAccessorComposite; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiOptions extends GuiScreen implements GuiYesNoCallback { + private static final GameSettings.Options[] field_146440_f = new GameSettings.Options[] {GameSettings.Options.FOV, GameSettings.Options.DIFFICULTY}; + private final GuiScreen field_146441_g; + private final GameSettings field_146443_h; + protected String field_146442_a = "Options"; + + + public GuiOptions(GuiScreen p_i1046_1_, GameSettings p_i1046_2_) { + this.field_146441_g = p_i1046_1_; + this.field_146443_h = p_i1046_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + int var1 = 0; + this.field_146442_a = I18n.format("options.title"); + + for (GameSettings.Options var5 : field_146440_f) { + if (var5.getEnumFloat()) { + this.buttonList.add(new GuiOptionSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 12 + 24 * (var1 >> 1), var5)); + } else { + GuiOptionButton var6 = new GuiOptionButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 12 + 24 * (var1 >> 1), var5, this.field_146443_h.getKeyBinding(var5)); + + if (var5 == GameSettings.Options.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { + var6.enabled = false; + var6.displayString = I18n.format("options.difficulty") + ": " + I18n.format("options.difficulty.hardcore"); + } + + this.buttonList.add(var6); + } + + ++var1; + } + + this.buttonList.add(new GuiButton(106, this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20, I18n.format("options.sounds", new Object[0]))); + this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height / 6 + 96 - 6, 150, 20, I18n.format("options.video", new Object[0]))); + this.buttonList.add(new GuiButton(100, this.width / 2 + 5, this.height / 6 + 96 - 6, 150, 20, I18n.format("options.controls", new Object[0]))); + this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height / 6 + 72 - 6, 150, 20, I18n.format("options.language", new Object[0]))); + this.buttonList.add(new GuiButton(103, this.width / 2 + 5, this.height / 6 + 120 - 6, 150, 20, I18n.format("options.multiplayer.title", new Object[0]))); + this.buttonList.add(new GuiButton(105, this.width / 2 - 155, this.height / 6 + 120 - 6, 150, 20, I18n.format("options.resourcepack", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id < 100 && p_146284_1_ instanceof GuiOptionButton) { + this.field_146443_h.setOptionValue(((GuiOptionButton)p_146284_1_).func_146136_c(), 1); + p_146284_1_.displayString = this.field_146443_h.getKeyBinding(GameSettings.Options.getEnumOptions(p_146284_1_.id)); + } + + if (p_146284_1_.id == 8675309) { + this.mc.entityRenderer.activateNextShader(); + } + + if (p_146284_1_.id == 101) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiVideoSettings(this, this.field_146443_h)); + } + + if (p_146284_1_.id == 100) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiControls(this, this.field_146443_h)); + } + + if (p_146284_1_.id == 102) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiLanguage(this, this.field_146443_h, this.mc.getLanguageManager())); + } + + if (p_146284_1_.id == 103) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new ScreenChatOptions(this, this.field_146443_h)); + } + + if (p_146284_1_.id == 104) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiSnooper(this, this.field_146443_h)); + } + + if (p_146284_1_.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146441_g); + } + + if (p_146284_1_.id == 105) { + this.mc.gameSettings.saveOptions(); +// this.mc.displayGuiScreen(new GuiScreenResourcePacks(this)); + this.mc.displayGuiScreen(new GuiResourcePacks(Minecraft.getMinecraft().currentScreen)); + } + + if (p_146284_1_.id == 106) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiScreenOptionsSounds(this, this.field_146443_h)); + } + + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146442_a, this.width / 2, 15, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java new file mode 100644 index 0000000..b063e9a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiOptionsRowList.java @@ -0,0 +1,104 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionsRowList extends GuiListExtended { + private final List field_148184_k = Lists.newArrayList(); + + + public GuiOptionsRowList(Minecraft p_i45015_1_, int p_i45015_2_, int p_i45015_3_, int p_i45015_4_, int p_i45015_5_, int p_i45015_6_, GameSettings.Options ... p_i45015_7_) { + super(p_i45015_1_, p_i45015_2_, p_i45015_3_, p_i45015_4_, p_i45015_5_, p_i45015_6_); + this.field_148163_i = false; + + for (int var8 = 0; var8 < p_i45015_7_.length; var8 += 2) { + GameSettings.Options var9 = p_i45015_7_[var8]; + GameSettings.Options var10 = var8 < p_i45015_7_.length - 1 ? p_i45015_7_[var8 + 1] : null; + GuiButton var11 = this.func_148182_a(p_i45015_1_, p_i45015_2_ / 2 - 155, 0, var9); + GuiButton var12 = this.func_148182_a(p_i45015_1_, p_i45015_2_ / 2 - 155 + 160, 0, var10); + this.field_148184_k.add(new GuiOptionsRowList.Row(var11, var12)); + } + } + + private GuiButton func_148182_a(Minecraft p_148182_1_, int p_148182_2_, int p_148182_3_, GameSettings.Options p_148182_4_) { + if (p_148182_4_ == null) { + return null; + } else { + int var5 = p_148182_4_.returnEnumOrdinal(); + return p_148182_4_.getEnumFloat() ? new GuiOptionSlider(var5, p_148182_2_, p_148182_3_, p_148182_4_) : new GuiOptionButton(var5, p_148182_2_, p_148182_3_, p_148182_4_, p_148182_1_.gameSettings.getKeyBinding(p_148182_4_)); + } + } + + public GuiOptionsRowList.Row func_148180_b(int p_148180_1_) { + return (GuiOptionsRowList.Row)this.field_148184_k.get(p_148180_1_); + } + + protected int getSize() { + return this.field_148184_k.size(); + } + + public int func_148139_c() { + return 400; + } + + protected int func_148137_d() { + return super.func_148137_d() + 32; + } + + public static class Row implements GuiListExtended.IGuiListEntry { + private final Minecraft field_148325_a = Minecraft.getMinecraft(); + private final GuiButton field_148323_b; + private final GuiButton field_148324_c; + + + public Row(GuiButton p_i45014_1_, GuiButton p_i45014_2_) { + this.field_148323_b = p_i45014_1_; + this.field_148324_c = p_i45014_2_; + } + + public void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) { + if (this.field_148323_b != null) { + this.field_148323_b.field_146129_i = p_148279_3_; + this.field_148323_b.drawButton(this.field_148325_a, p_148279_7_, p_148279_8_); + } + + if (this.field_148324_c != null) { + this.field_148324_c.field_146129_i = p_148279_3_; + this.field_148324_c.drawButton(this.field_148325_a, p_148279_7_, p_148279_8_); + } + } + + public boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + if (this.field_148323_b.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) { + if (this.field_148323_b instanceof GuiOptionButton) { + this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton)this.field_148323_b).func_146136_c(), 1); + this.field_148323_b.displayString = this.field_148325_a.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.field_148323_b.id)); + } + + return true; + } else if (this.field_148324_c != null && this.field_148324_c.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) { + if (this.field_148324_c instanceof GuiOptionButton) { + this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton)this.field_148324_c).func_146136_c(), 1); + this.field_148324_c.displayString = this.field_148325_a.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.field_148324_c.id)); + } + + return true; + } else { + return false; + } + } + + public void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) { + if (this.field_148323_b != null) { + this.field_148323_b.mouseReleased(p_148277_2_, p_148277_3_); + } + + if (this.field_148324_c != null) { + this.field_148324_c.mouseReleased(p_148277_2_, p_148277_3_); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiPlayerInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiPlayerInfo.java new file mode 100644 index 0000000..8957bb3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiPlayerInfo.java @@ -0,0 +1,18 @@ +package net.minecraft.client.gui; + +public class GuiPlayerInfo { + /** The string value of the object */ + public final String name; + + /** Player name in lowercase. */ + private final String nameinLowerCase; + + /** Player response time to server in milliseconds */ + public int responseTime; + + + public GuiPlayerInfo(String p_i1190_1_) { + this.name = p_i1190_1_; + this.nameinLowerCase = p_i1190_1_.toLowerCase(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java new file mode 100644 index 0000000..6b6a525 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiRenameWorld.java @@ -0,0 +1,91 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.resources.I18n; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.lwjgl.input.Keyboard; + +public class GuiRenameWorld extends GuiScreen { + private final GuiScreen field_146585_a; + private GuiTextField field_146583_f; + private final String field_146584_g; + + + public GuiRenameWorld(GuiScreen p_i46317_1_, String p_i46317_2_) { + this.field_146585_a = p_i46317_1_; + this.field_146584_g = p_i46317_2_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146583_f.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.renameButton"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel"))); + ISaveFormat var1 = this.mc.getSaveLoader(); + WorldInfo var2 = var1.getWorldInfo(this.field_146584_g); + String var3 = var2.getWorldName(); + this.field_146583_f = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146583_f.setFocused(true); + this.field_146583_f.setText(var3); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 1) { + this.mc.displayGuiScreen(this.field_146585_a); + } else if (p_146284_1_.id == 0) { + ISaveFormat var2 = this.mc.getSaveLoader(); + var2.renameWorld(this.field_146584_g, this.field_146583_f.getText().trim()); + this.mc.displayGuiScreen(this.field_146585_a); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + this.field_146583_f.keyTyped(p_73869_1_, p_73869_2_); + this.buttonList.get(0).enabled = this.field_146583_f.getText().trim().length() > 0; + + if (p_73869_2_ == 28 || p_73869_2_ == 156) { + this.actionPerformed(this.buttonList.get(0)); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146583_f.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.renameTitle"), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880); + this.field_146583_f.drawTextBox(); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiRepair.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiRepair.java new file mode 100644 index 0000000..ae3ef69 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiRepair.java @@ -0,0 +1,178 @@ +package net.minecraft.client.gui; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.apache.commons.io.Charsets; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +public class GuiRepair extends GuiContainer implements ICrafting { + private static final ResourceLocation field_147093_u = new ResourceLocation("textures/gui/container/anvil.png"); + private final ContainerRepair field_147092_v; + private GuiTextField field_147091_w; + private final InventoryPlayer field_147094_x; + + + public GuiRepair(InventoryPlayer p_i46381_1_, World p_i46381_2_, int p_i46381_3_, int p_i46381_4_, int p_i46381_5_) { + super(new ContainerRepair(p_i46381_1_, p_i46381_2_, p_i46381_3_, p_i46381_4_, p_i46381_5_, Minecraft.getMinecraft().thePlayer)); + this.field_147094_x = p_i46381_1_; + this.field_147092_v = (ContainerRepair)this.field_147002_h; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + super.initGui(); + Keyboard.enableRepeatEvents(true); + int var1 = (this.width - this.field_146999_f) / 2; + int var2 = (this.height - this.field_147000_g) / 2; + this.field_147091_w = new GuiTextField(this.fontRendererObj, var1 + 62, var2 + 24, 103, 12); + this.field_147091_w.func_146193_g(-1); + this.field_147091_w.func_146204_h(-1); + this.field_147091_w.func_146185_a(false); + this.field_147091_w.setMaxStringLength(40); + this.field_147002_h.removeCraftingFromCrafters(this); + this.field_147002_h.addCraftingToCrafters(this); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + super.onGuiClosed(); + Keyboard.enableRepeatEvents(false); + this.field_147002_h.removeCraftingFromCrafters(this); + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + this.fontRendererObj.drawString(I18n.format("container.repair"), 60, 6, 4210752); + + if (this.field_147092_v.maximumCost > 0) { + int var3 = 8453920; + boolean var4 = true; + String var5 = I18n.format("container.repair.cost", Integer.valueOf(this.field_147092_v.maximumCost)); + + if (this.field_147092_v.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) { + var5 = I18n.format("container.repair.expensive"); + var3 = 16736352; + } else if (!this.field_147092_v.getSlot(2).getHasStack()) { + var4 = false; + } else if (!this.field_147092_v.getSlot(2).canTakeStack(this.field_147094_x.player)) { + var3 = 16736352; + } + + if (var4) { + int var6 = -16777216 | (var3 & 16579836) >> 2 | var3 & -16777216; + int var7 = this.field_146999_f - 8 - this.fontRendererObj.getStringWidth(var5); + byte var8 = 67; + + if (this.fontRendererObj.getUnicodeFlag()) { + drawRect(var7 - 3, var8 - 2, this.field_146999_f - 7, var8 + 10, -16777216); + drawRect(var7 - 2, var8 - 1, this.field_146999_f - 8, var8 + 9, -12895429); + } else { + this.fontRendererObj.drawString(var5, var7, var8 + 1, var6); + this.fontRendererObj.drawString(var5, var7 + 1, var8, var6); + this.fontRendererObj.drawString(var5, var7 + 1, var8 + 1, var6); + } + + this.fontRendererObj.drawString(var5, var7, var8, var3); + } + } + + GL11.glEnable(GL11.GL_LIGHTING); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (this.field_147091_w.keyTyped(p_73869_1_, p_73869_2_)) { + this.func_147090_g(); + } else { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } + + private void func_147090_g() { + String var1 = this.field_147091_w.getText(); + Slot var2 = this.field_147092_v.getSlot(0); + + if (var2 != null && var2.getHasStack() && !var2.getStack().hasDisplayName() && var1.equals(var2.getStack().getDisplayName())) { + var1 = ""; + } + + this.field_147092_v.updateItemName(var1); + this.mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", var1.getBytes(Charsets.UTF_8))); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_147091_w.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + this.field_147091_w.drawTextBox(); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147093_u); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + drawTexturedModalRect(var4 + 59, var5 + 20, 0, this.field_147000_g + (this.field_147092_v.getSlot(0).getHasStack() ? 0 : 16), 110, 16); + + if ((this.field_147092_v.getSlot(0).getHasStack() || this.field_147092_v.getSlot(1).getHasStack()) && !this.field_147092_v.getSlot(2).getHasStack()) { + drawTexturedModalRect(var4 + 99, var5 + 45, this.field_146999_f, 0, 28, 21); + } + } + + public void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_) { + this.sendSlotContents(p_71110_1_, 0, p_71110_1_.getSlot(0).getStack()); + } + + /** + * Sends the contents of an inventory slot to the com.cheatbreaker.client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) { + if (p_71111_2_ == 0) { + this.field_147091_w.setText(p_71111_3_ == null ? "" : p_71111_3_.getDisplayName()); + this.field_147091_w.func_146184_c(p_71111_3_ != null); + + if (p_71111_3_ != null) { + this.func_147090_g(); + } + } + } + + /** + * Sends two ints to the com.cheatbreaker.client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java new file mode 100644 index 0000000..4ba7286 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackAvailable.java @@ -0,0 +1,17 @@ +package net.minecraft.client.gui; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; + +public class GuiResourcePackAvailable extends GuiResourcePackList { + + + public GuiResourcePackAvailable(Minecraft p_i45054_1_, int p_i45054_2_, int p_i45054_3_, List p_i45054_4_) { + super(p_i45054_1_, p_i45054_2_, p_i45054_3_, p_i45054_4_); + } + + protected String func_148202_k() { + return I18n.format("resourcePack.available.title"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java new file mode 100644 index 0000000..498696a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackList.java @@ -0,0 +1,48 @@ +package net.minecraft.client.gui; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.ResourcePackListEntry; +import net.minecraft.util.EnumChatFormatting; + +public abstract class GuiResourcePackList extends GuiListExtended { + protected final Minecraft field_148205_k; + protected final List field_148204_l; + + + public GuiResourcePackList(Minecraft p_i45055_1_, int p_i45055_2_, int p_i45055_3_, List p_i45055_4_) { + super(p_i45055_1_, p_i45055_2_, p_i45055_3_, 32, p_i45055_3_ - 55 + 4, 36); + this.field_148205_k = p_i45055_1_; + this.field_148204_l = p_i45055_4_; + this.field_148163_i = false; + this.func_148133_a(true, (int)((float)p_i45055_1_.fontRenderer.FONT_HEIGHT * 1.5F)); + } + + protected void func_148129_a(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) { + String var4 = EnumChatFormatting.UNDERLINE + "" + EnumChatFormatting.BOLD + this.func_148202_k(); + this.field_148205_k.fontRenderer.drawString(var4, p_148129_1_ + this.field_148155_a / 2 - this.field_148205_k.fontRenderer.getStringWidth(var4) / 2, Math.min(this.field_148153_b + 3, p_148129_2_), 16777215); + } + + protected abstract String func_148202_k(); + + public List func_148201_l() { + return this.field_148204_l; + } + + protected int getSize() { + return this.func_148201_l().size(); + } + + public ResourcePackListEntry func_148180_b(int p_148180_1_) { + return (ResourcePackListEntry)this.func_148201_l().get(p_148180_1_); + } + + public int func_148139_c() { + return this.field_148155_a; + } + + protected int func_148137_d() { + return this.field_148151_d - 6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java new file mode 100644 index 0000000..4235c49 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiResourcePackSelected.java @@ -0,0 +1,17 @@ +package net.minecraft.client.gui; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; + +public class GuiResourcePackSelected extends GuiResourcePackList { + + + public GuiResourcePackSelected(Minecraft p_i45056_1_, int p_i45056_2_, int p_i45056_3_, List p_i45056_4_) { + super(p_i45056_1_, p_i45056_2_, p_i45056_3_, p_i45056_4_); + } + + protected String func_148202_k() { + return I18n.format("resourcePack.selected.title"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreen.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreen.java new file mode 100644 index 0000000..c063c74 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreen.java @@ -0,0 +1,352 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.ui.fading.ColorFade; +import com.cheatbreaker.client.ui.overlay.OverlayGui; +import com.google.common.base.Throwables; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.shader.Shader; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderUniform; +import net.minecraft.item.ItemStack; +import net.minecraft.src.Config; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class GuiScreen extends Gui { + protected static RenderItem itemRender = new RenderItem(); + public Minecraft mc; + public int width; + public int height; + protected List buttonList = new ArrayList(); + protected List labelList = new ArrayList(); + public boolean field_146291_p; + protected FontRenderer fontRendererObj; + private GuiButton selectedButton; + private int eventButton; + private long lastMouseEvent; + private int field_146298_h; + protected static ColorFade blurColor = new ColorFade(0, -553648128); + protected static ColorFade blurColorOffSet = new ColorFade(0, 1243487774); + + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + + int n3; + for (n3 = 0; n3 < this.buttonList.size(); ++n3) { + this.buttonList.get(n3).drawButton(this.mc, mouseX, mouseY); + } + for (n3 = 0; n3 < this.labelList.size(); ++n3) { + ((GuiLabel)this.labelList.get(n3)).func_146159_a(this.mc, mouseX, mouseY); + } + } + + protected void keyTyped(char c, int n) { + if (Keyboard.isKeyDown(42) && n == 15) { + this.mc.displayGuiScreen(OverlayGui.createInstance(this.mc.currentScreen)); + } + if (n == 1) { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + this.mc.entityRenderer.stopUseShader(); + } + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + } + } + + public static String getClipboardString() { + try { + Transferable transferable = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); + if (transferable != null && transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) { + return (String)transferable.getTransferData(DataFlavor.stringFlavor); + } + } catch (Exception exception) { + + } + return ""; + } + + public static void setClipboardString(String string) { + try { + StringSelection stringSelection = new StringSelection(string); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, null); + } catch (Exception exception) { + + } + } + + protected void func_146285_a(ItemStack itemStack, int n, int n2) { + List list = itemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + for (int i = 0; i < list.size(); ++i) { + if (i == 0) { + list.set(i, itemStack.getRarity().rarityColor + (String)list.get(i)); + continue; + } + list.set(i, EnumChatFormatting.GRAY + (String)list.get(i)); + } + this.func_146283_a(list, n, n2); + } + + protected void func_146279_a(String string, int n, int n2) { + this.func_146283_a(Arrays.asList(string), n, n2); + } + + protected void func_146283_a(List list, int n, int n2) { + if (!list.isEmpty()) { + int n3; + GL11.glDisable(32826); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(2896); + GL11.glDisable(2929); + int n4 = 0; + for (Object string : list) { + n3 = this.fontRendererObj.getStringWidth((String) string); + if (n3 <= n4) continue; + n4 = n3; + } + int n5 = n + 12; + n3 = n2 - 12; + int n6 = 8; + if (list.size() > 1) { + n6 += 2 + (list.size() - 1) * 10; + } + if (n5 + n4 > this.width) { + n5 -= 28 + n4; + } + if (n3 + n6 + 6 > this.height) { + n3 = this.height - n6 - 6; + } + zLevel = 300; + GuiScreen.itemRender.zLevel = 300; + int n7 = -267386864; + GuiScreen.drawGradientRect((float)(n5 - 3), (float)(n3 - 4), (float)(n5 + n4 + 3), (float)(n3 - 3), n7, n7); + GuiScreen.drawGradientRect((float)(n5 - 3), (float)(n3 + n6 + 3), (float)(n5 + n4 + 3), (float)(n3 + n6 + 4), n7, n7); + GuiScreen.drawGradientRect((float)(n5 - 3), (float)(n3 - 3), (float)(n5 + n4 + 3), (float)(n3 + n6 + 3), n7, n7); + GuiScreen.drawGradientRect((float)(n5 - 4), (float)(n3 - 3), (float)(n5 - 3), (float)(n3 + n6 + 3), n7, n7); + GuiScreen.drawGradientRect((float)(n5 + n4 + 3), (float)(n3 - 3), (float)(n5 + n4 + 4), (float)(n3 + n6 + 3), n7, n7); + int n8 = 0x505000FF; + int n9 = (n8 & 0xFEFEFE) >> 1 | n8 & 0xFF000000; + GuiScreen.drawGradientRect((float)(n5 - 3), (float)(n3 - 3 + 1), (float)(n5 - 3 + 1), (float)(n3 + n6 + 3 - 1), n8, n9); + GuiScreen.drawGradientRect((float)(n5 + n4 + 2), (float)(n3 - 3 + 1), (float)(n5 + n4 + 3), (float)(n3 + n6 + 3 - 1), n8, n9); + GuiScreen.drawGradientRect((float)(n5 - 3), (float)(n3 - 3), (float)(n5 + n4 + 3), (float)(n3 - 3 + 1), n8, n8); + GuiScreen.drawGradientRect((float)(n5 - 3), (float)(n3 + n6 + 2), (float)(n5 + n4 + 3), (float)(n3 + n6 + 3), n9, n9); + for (int i = 0; i < list.size(); ++i) { + String string = (String)list.get(i); + this.fontRendererObj.drawStringWithShadow(string, (float)n5, (float)n3, -1); + if (i == 0) { + n3 += 2; + } + n3 += 10; + } + zLevel = 0.0f; + GuiScreen.itemRender.zLevel = 0.0f; + GL11.glEnable(2896); + GL11.glEnable(2929); + RenderHelper.enableStandardItemLighting(); + GL11.glEnable(32826); + } + } + + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + if (mouseButton == 0) { + for (int i = 0; i < this.buttonList.size(); ++i) { + GuiButton guiButton = this.buttonList.get(i); + if (!guiButton.mousePressed(this.mc, mouseX, mouseY)) continue; + this.selectedButton = guiButton; + guiButton.func_146113_a(this.mc.getSoundHandler()); + this.actionPerformed(guiButton); + } + } + } + + protected void mouseMovedOrUp(int n, int n2, int n3) { + if (this.selectedButton != null && n3 == 0) { + this.selectedButton.mouseReleased(n, n2); + this.selectedButton = null; + } + } + + protected void mouseClickMove(int n, int n2, int n3, long l) { + } + + protected void actionPerformed(GuiButton guiButton) { + } + + public void setWorldAndResolution(Minecraft minecraft, int n, int n2) { + this.mc = minecraft; + this.fontRendererObj = minecraft.fontRenderer; + this.width = n; + this.height = n2; + this.buttonList.clear(); + this.initGui(); + this.blurGui(); + } + + public void initGui() { + } + + public void blurGui() { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue() && this.mc.theWorld != null && this.mc.thePlayer != null) { + this.mc.entityRenderer.loadGuiBlurShader(); + } + if (this.mc.lastScreen == null) { + blurColor.startAnimation(); + blurColorOffSet.startAnimation(); + } + } + + public void handleInput() { + if (Mouse.isCreated()) { + while (Mouse.next()) { + this.handleMouseInput(); + } + } + if (Keyboard.isCreated()) { + while (Keyboard.next()) { + this.handleKeyboardInput(); + } + } + } + + public void handleMouseInput() { + int n = Mouse.getEventX() * this.width / this.mc.displayWidth; + int n2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; + int n3 = Mouse.getEventButton(); + if (Mouse.getEventButtonState()) { + if (this.mc.gameSettings.touchscreen && this.field_146298_h++ > 0) { + return; + } + this.eventButton = n3; + this.lastMouseEvent = Minecraft.getSystemTime(); + this.mouseClicked(n, n2, this.eventButton); + } else if (n3 != -1) { + if (this.mc.gameSettings.touchscreen && --this.field_146298_h > 0) { + return; + } + this.eventButton = -1; + this.mouseMovedOrUp(n, n2, n3); + } else if (this.eventButton != -1 && this.lastMouseEvent > 0L) { + long l = Minecraft.getSystemTime() - this.lastMouseEvent; + this.mouseClickMove(n, n2, this.eventButton, l); + } + } + + public void handleKeyboardInput() { + if (Keyboard.getEventKeyState()) { + this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey()); + } + + this.mc.func_152348_aa(); + } + + public void updateScreen() { + } + + public void onGuiClosed() { + } + + public void renderBlur() { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().guiBlur.getValue()) { + try { + if (this.mc.entityRenderer.isShaderActive()) { + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + for (Shader shader : shaderGroup.getShaders()) { + ShaderUniform shaderUniform = shader.getShaderManager().func_147991_a("Progress"); + if (shaderUniform == null) continue; + shaderUniform.func_148090_a(blurColor.getFadeAmount()); + } + } + GL11.glEnable(2929); + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + } + } + + public void drawDefaultBackground() { + if (this.mc.theWorld != null) { + this.renderBlur(); + if (CheatBreaker.getInstance().getGlobalSettings().containerBackground.getStringValue().equals("CheatBreaker")) { + GuiScreen.drawGradientRect(0.0f, 0.0f, (float)this.width, (float)this.height, blurColor.getColor(true).getRGB(), blurColorOffSet.getColor(true).getRGB()); + } else if (CheatBreaker.getInstance().getGlobalSettings().containerBackground.getStringValue().equals("Vanilla")) { + this.func_146270_b(0); + } + if (this.mc.isFullScreen() && CheatBreaker.getInstance().getGlobalSettings().isDebug) { + String debug = Config.MC_VERSION + " (" + CheatBreaker.getInstance().getGitCommitIdAbbrev() + "/" + CheatBreaker.getInstance().getGitBranch() + ")"; + CheatBreaker.getInstance().playRegular18px.drawStringWithShadow(debug, 5.0, this.height - 14.0f, -1879048193); + } + } else { + this.func_146270_b(0); + } + + } + + public void renderBlur(float f, float f2) { + ShaderGroup shaderGroup = Minecraft.getMinecraft().entityRenderer.getShaderGroup(); + try { + if (this.mc.entityRenderer.isShaderActive()) { + for (Shader shader : shaderGroup.getShaders()) { + ShaderUniform shaderUniform = shader.getShaderManager().func_147991_a("Progress"); + if (shaderUniform == null) continue; + shaderUniform.func_148090_a(0.75555557f * 0.6617647f); + } + } + } catch (IllegalArgumentException illegalArgumentException) { + Throwables.propagate(illegalArgumentException); + } + GuiScreen.drawGradientRect(0.0f, 0.0f, f, f2, + blurColor.getColor(true).getRGB(), + blurColorOffSet.getColor(true).getRGB()); + } + + public void func_146270_b(int n) { + if (this.mc.theWorld != null) { + GuiScreen.drawGradientRect(0.0f, 0.0f, (float)this.width, (float)this.height, -1072689136, -804253680); + } else { + this.func_146278_c(n); + } + } + + public void func_146278_c(int n) { + GL11.glDisable(2896); + GL11.glDisable(2912); + Tessellator tessellator = Tessellator.instance; + this.mc.getTextureManager().bindTexture(optionsBackground); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + float f = 32; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(0x404040); + tessellator.addVertexWithUV(0.0, this.height, 0.0, 0.0, (float)this.height / f + (float)n); + tessellator.addVertexWithUV(this.width, this.height, 0.0, (float)this.width / f, (float)this.height / f + (float)n); + tessellator.addVertexWithUV(this.width, 0.0, 0.0, (float)this.width / f, n); + tessellator.addVertexWithUV(0.0, 0.0, 0.0, 0.0, n); + tessellator.draw(); + } + + public boolean doesGuiPauseGame() { + return true; + } + + public void confirmClicked(boolean bl, int n) { + } + + public static boolean isCtrlKeyDown() { + return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(219) || Keyboard.isKeyDown(220) : Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157); + } + + public static boolean isShiftKeyDown() { + return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java new file mode 100644 index 0000000..3e401f0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenAddServer.java @@ -0,0 +1,108 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.resources.I18n; +import org.lwjgl.input.Keyboard; + +public class GuiScreenAddServer extends GuiScreen { + private final GuiScreen field_146310_a; + private final ServerData field_146311_h; + private GuiTextField field_146308_f; + private GuiTextField field_146309_g; + private GuiButton field_152176_i; + + + public GuiScreenAddServer(GuiScreen p_i1033_1_, ServerData p_i1033_2_) { + this.field_146310_a = p_i1033_1_; + this.field_146311_h = p_i1033_2_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146309_g.updateCursorCounter(); + this.field_146308_f.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 18, I18n.format("addServer.add"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 18, I18n.format("gui.cancel"))); + this.buttonList.add(this.field_152176_i = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 72, I18n.format("addServer.resourcePack") + ": " + this.field_146311_h.func_152586_b().func_152589_a().getFormattedText())); + this.field_146309_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 66, 200, 20); + this.field_146309_g.setFocused(true); + this.field_146309_g.setText(this.field_146311_h.serverName); + this.field_146308_f = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 106, 200, 20); + this.field_146308_f.setMaxStringLength(128); + this.field_146308_f.setText(this.field_146311_h.serverIP); + this.buttonList.get(0).enabled = this.field_146308_f.getText().length() > 0 && this.field_146308_f.getText().split(":").length > 0 && this.field_146309_g.getText().length() > 0; + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 2) { + this.field_146311_h.func_152584_a(ServerData.ServerResourceMode.values()[(this.field_146311_h.func_152586_b().ordinal() + 1) % ServerData.ServerResourceMode.values().length]); + this.field_152176_i.displayString = I18n.format("addServer.resourcePack") + ": " + this.field_146311_h.func_152586_b().func_152589_a().getFormattedText(); + } else if (p_146284_1_.id == 1) { + this.field_146310_a.confirmClicked(false, 0); + } else if (p_146284_1_.id == 0) { + this.field_146311_h.serverName = this.field_146309_g.getText(); + this.field_146311_h.serverIP = this.field_146308_f.getText(); + this.field_146310_a.confirmClicked(true, 0); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + this.field_146309_g.keyTyped(p_73869_1_, p_73869_2_); + this.field_146308_f.keyTyped(p_73869_1_, p_73869_2_); + + if (p_73869_2_ == 15) { + this.field_146309_g.setFocused(!this.field_146309_g.isFocused()); + this.field_146308_f.setFocused(!this.field_146308_f.isFocused()); + } + + if (p_73869_2_ == 28 || p_73869_2_ == 156) { + this.actionPerformed(this.buttonList.get(0)); + } + + this.buttonList.get(0).enabled = this.field_146308_f.getText().length() > 0 && this.field_146308_f.getText().split(":").length > 0 && this.field_146309_g.getText().length() > 0; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146308_f.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146309_g.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("addServer.title"), this.width / 2, 17, 16777215); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterName"), this.width / 2 - 100, 53, 10526880); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterIp"), this.width / 2 - 100, 94, 10526880); + this.field_146309_g.drawTextBox(); + this.field_146308_f.drawTextBox(); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenBook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenBook.java new file mode 100644 index 0000000..4bc6f25 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenBook.java @@ -0,0 +1,392 @@ +package net.minecraft.client.gui; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +public class GuiScreenBook extends GuiScreen { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146466_f = new ResourceLocation("textures/gui/book.png"); + private final EntityPlayer field_146468_g; + private final ItemStack field_146474_h; + private final boolean field_146475_i; + private boolean field_146481_r; + private boolean field_146480_s; + private int field_146479_t; + private final int field_146478_u = 192; + private final int field_146477_v = 192; + private int field_146476_w = 1; + private int field_146484_x; + private NBTTagList field_146483_y; + private String field_146482_z = ""; + private GuiScreenBook.NextPageButton field_146470_A; + private GuiScreenBook.NextPageButton field_146471_B; + private GuiButton field_146472_C; + private GuiButton field_146465_D; + private GuiButton field_146467_E; + private GuiButton field_146469_F; + + + public GuiScreenBook(EntityPlayer p_i1080_1_, ItemStack p_i1080_2_, boolean p_i1080_3_) { + this.field_146468_g = p_i1080_1_; + this.field_146474_h = p_i1080_2_; + this.field_146475_i = p_i1080_3_; + + if (p_i1080_2_.hasTagCompound()) { + NBTTagCompound var4 = p_i1080_2_.getTagCompound(); + this.field_146483_y = var4.getTagList("pages", 8); + + if (this.field_146483_y != null) { + this.field_146483_y = (NBTTagList)this.field_146483_y.copy(); + this.field_146476_w = this.field_146483_y.tagCount(); + + if (this.field_146476_w < 1) { + this.field_146476_w = 1; + } + } + } + + if (this.field_146483_y == null && p_i1080_3_) { + this.field_146483_y = new NBTTagList(); + this.field_146483_y.appendTag(new NBTTagString("")); + this.field_146476_w = 1; + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + ++this.field_146479_t; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + + if (this.field_146475_i) { + this.buttonList.add(this.field_146465_D = new GuiButton(3, this.width / 2 - 100, 4 + this.field_146477_v, 98, 20, I18n.format("book.signButton"))); + this.buttonList.add(this.field_146472_C = new GuiButton(0, this.width / 2 + 2, 4 + this.field_146477_v, 98, 20, I18n.format("gui.done"))); + this.buttonList.add(this.field_146467_E = new GuiButton(5, this.width / 2 - 100, 4 + this.field_146477_v, 98, 20, I18n.format("book.finalizeButton"))); + this.buttonList.add(this.field_146469_F = new GuiButton(4, this.width / 2 + 2, 4 + this.field_146477_v, 98, 20, I18n.format("gui.cancel"))); + } else { + this.buttonList.add(this.field_146472_C = new GuiButton(0, this.width / 2 - 100, 4 + this.field_146477_v, 200, 20, I18n.format("gui.done"))); + } + + int var1 = (this.width - this.field_146478_u) / 2; + byte var2 = 2; + this.buttonList.add(this.field_146470_A = new GuiScreenBook.NextPageButton(1, var1 + 120, var2 + 154, true)); + this.buttonList.add(this.field_146471_B = new GuiScreenBook.NextPageButton(2, var1 + 38, var2 + 154, false)); + this.func_146464_h(); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + + private void func_146464_h() { + this.field_146470_A.field_146125_m = !this.field_146480_s && (this.field_146484_x < this.field_146476_w - 1 || this.field_146475_i); + this.field_146471_B.field_146125_m = !this.field_146480_s && this.field_146484_x > 0; + this.field_146472_C.field_146125_m = !this.field_146475_i || !this.field_146480_s; + + if (this.field_146475_i) { + this.field_146465_D.field_146125_m = !this.field_146480_s; + this.field_146469_F.field_146125_m = this.field_146480_s; + this.field_146467_E.field_146125_m = this.field_146480_s; + this.field_146467_E.enabled = this.field_146482_z.trim().length() > 0; + } + } + + private void func_146462_a(boolean p_146462_1_) { + if (this.field_146475_i && this.field_146481_r) { + if (this.field_146483_y != null) { + String var2; + + while (this.field_146483_y.tagCount() > 1) { + var2 = this.field_146483_y.getStringTagAt(this.field_146483_y.tagCount() - 1); + + if (var2.length() != 0) { + break; + } + + this.field_146483_y.removeTag(this.field_146483_y.tagCount() - 1); + } + + if (this.field_146474_h.hasTagCompound()) { + NBTTagCompound var10 = this.field_146474_h.getTagCompound(); + var10.setTag("pages", this.field_146483_y); + } else { + this.field_146474_h.setTagInfo("pages", this.field_146483_y); + } + + var2 = "MC|BEdit"; + + if (p_146462_1_) { + var2 = "MC|BSign"; + this.field_146474_h.setTagInfo("author", new NBTTagString(this.field_146468_g.getCommandSenderName())); + this.field_146474_h.setTagInfo("title", new NBTTagString(this.field_146482_z.trim())); + this.field_146474_h.func_150996_a(Items.written_book); + } + + ByteBuf var3 = Unpooled.buffer(); + + try { + (new PacketBuffer(var3)).writeItemStackToBuffer(this.field_146474_h); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(var2, var3)); + } catch (Exception var8) { + logger.error("Couldn't send book info", var8); + } + finally { + var3.release(); + } + } + } + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 0) { + this.mc.displayGuiScreen(null); + this.func_146462_a(false); + } else if (p_146284_1_.id == 3 && this.field_146475_i) { + this.field_146480_s = true; + } else if (p_146284_1_.id == 1) { + if (this.field_146484_x < this.field_146476_w - 1) { + ++this.field_146484_x; + } else if (this.field_146475_i) { + this.func_146461_i(); + + if (this.field_146484_x < this.field_146476_w - 1) { + ++this.field_146484_x; + } + } + } else if (p_146284_1_.id == 2) { + if (this.field_146484_x > 0) { + --this.field_146484_x; + } + } else if (p_146284_1_.id == 5 && this.field_146480_s) { + this.func_146462_a(true); + this.mc.displayGuiScreen(null); + } else if (p_146284_1_.id == 4 && this.field_146480_s) { + this.field_146480_s = false; + } + + this.func_146464_h(); + } + } + + private void func_146461_i() { + if (this.field_146483_y != null && this.field_146483_y.tagCount() < 50) { + this.field_146483_y.appendTag(new NBTTagString("")); + ++this.field_146476_w; + this.field_146481_r = true; + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + super.keyTyped(p_73869_1_, p_73869_2_); + + if (this.field_146475_i) { + if (this.field_146480_s) { + this.func_146460_c(p_73869_1_, p_73869_2_); + } else { + this.func_146463_b(p_73869_1_, p_73869_2_); + } + } + } + + private void func_146463_b(char p_146463_1_, int p_146463_2_) { + switch (p_146463_1_) { + case 22: + this.func_146459_b(GuiScreen.getClipboardString()); + return; + + default: + switch (p_146463_2_) { + case 14: + String var3 = this.func_146456_p(); + + if (var3.length() > 0) { + this.func_146457_a(var3.substring(0, var3.length() - 1)); + } + + return; + + case 28: + case 156: + this.func_146459_b("\n"); + return; + + default: + if (ChatAllowedCharacters.isAllowedCharacter(p_146463_1_)) { + this.func_146459_b(Character.toString(p_146463_1_)); + } + } + } + } + + private void func_146460_c(char p_146460_1_, int p_146460_2_) { + switch (p_146460_2_) { + case 14: + if (!this.field_146482_z.isEmpty()) { + this.field_146482_z = this.field_146482_z.substring(0, this.field_146482_z.length() - 1); + this.func_146464_h(); + } + + return; + + case 28: + case 156: + if (!this.field_146482_z.isEmpty()) { + this.func_146462_a(true); + this.mc.displayGuiScreen(null); + } + + return; + + default: + if (this.field_146482_z.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) { + this.field_146482_z = this.field_146482_z + p_146460_1_; + this.func_146464_h(); + this.field_146481_r = true; + } + } + } + + private String func_146456_p() { + return this.field_146483_y != null && this.field_146484_x >= 0 && this.field_146484_x < this.field_146483_y.tagCount() ? this.field_146483_y.getStringTagAt(this.field_146484_x) : ""; + } + + private void func_146457_a(String p_146457_1_) { + if (this.field_146483_y != null && this.field_146484_x >= 0 && this.field_146484_x < this.field_146483_y.tagCount()) { + this.field_146483_y.func_150304_a(this.field_146484_x, new NBTTagString(p_146457_1_)); + this.field_146481_r = true; + } + } + + private void func_146459_b(String p_146459_1_) { + String var2 = this.func_146456_p(); + String var3 = var2 + p_146459_1_; + int var4 = this.fontRendererObj.splitStringWidth(var3 + "" + EnumChatFormatting.BLACK + "_", 118); + + if (var4 <= 118 && var3.length() < 256) { + this.func_146457_a(var3); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_146466_f); + int var4 = (this.width - this.field_146478_u) / 2; + byte var5 = 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146478_u, this.field_146477_v); + String var6; + String var7; + int var8; + + if (this.field_146480_s) { + var6 = this.field_146482_z; + + if (this.field_146475_i) { + if (this.field_146479_t / 6 % 2 == 0) { + var6 = var6 + "" + EnumChatFormatting.BLACK + "_"; + } else { + var6 = var6 + "" + EnumChatFormatting.GRAY + "_"; + } + } + + var7 = I18n.format("book.editTitle"); + var8 = this.fontRendererObj.getStringWidth(var7); + this.fontRendererObj.drawString(var7, var4 + 36 + (116 - var8) / 2, var5 + 16 + 16, 0); + int var9 = this.fontRendererObj.getStringWidth(var6); + this.fontRendererObj.drawString(var6, var4 + 36 + (116 - var9) / 2, var5 + 48, 0); + String var10 = I18n.format("book.byAuthor", this.field_146468_g.getCommandSenderName()); + int var11 = this.fontRendererObj.getStringWidth(var10); + this.fontRendererObj.drawString(EnumChatFormatting.DARK_GRAY + var10, var4 + 36 + (116 - var11) / 2, var5 + 48 + 10, 0); + String var12 = I18n.format("book.finalizeWarning"); + this.fontRendererObj.drawSplitString(var12, var4 + 36, var5 + 80, 116, 0); + } else { + var6 = I18n.format("book.pageIndicator", Integer.valueOf(this.field_146484_x + 1), Integer.valueOf(this.field_146476_w)); + var7 = ""; + + if (this.field_146483_y != null && this.field_146484_x >= 0 && this.field_146484_x < this.field_146483_y.tagCount()) { + var7 = this.field_146483_y.getStringTagAt(this.field_146484_x); + } + + if (this.field_146475_i) { + if (this.fontRendererObj.getBidiFlag()) { + var7 = var7 + "_"; + } else if (this.field_146479_t / 6 % 2 == 0) { + var7 = var7 + "" + EnumChatFormatting.BLACK + "_"; + } else { + var7 = var7 + "" + EnumChatFormatting.GRAY + "_"; + } + } + + var8 = this.fontRendererObj.getStringWidth(var6); + this.fontRendererObj.drawString(var6, var4 - var8 + this.field_146478_u - 44, var5 + 16, 0); + this.fontRendererObj.drawSplitString(var7, var4 + 36, var5 + 16 + 16, 116, 0); + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + static class NextPageButton extends GuiButton { + private final boolean field_146151_o; + + + public NextPageButton(int p_i46316_1_, int p_i46316_2_, int p_i46316_3_, boolean p_i46316_4_) { + super(p_i46316_1_, p_i46316_2_, p_i46316_3_, 23, 13, ""); + this.field_146151_o = p_i46316_4_; + } + + public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) { + if (this.field_146125_m) { + boolean var4 = p_146112_2_ >= this.field_146128_h && p_146112_3_ >= this.field_146129_i && p_146112_2_ < this.field_146128_h + this.field_146120_f && p_146112_3_ < this.field_146129_i + this.field_146121_g; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + p_146112_1_.getTextureManager().bindTexture(GuiScreenBook.field_146466_f); + int var5 = 0; + int var6 = 192; + + if (var4) { + var5 += 23; + } + + if (!this.field_146151_o) { + var6 += 13; + } + + drawTexturedModalRect(this.field_146128_h, this.field_146129_i, var5, var6, 23, 13); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenDemo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenDemo.java new file mode 100644 index 0000000..9297938 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenDemo.java @@ -0,0 +1,80 @@ +package net.minecraft.client.gui; + +import java.net.URI; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public class GuiScreenDemo extends GuiScreen { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146348_f = new ResourceLocation("textures/gui/demo_background.png"); + + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + byte var1 = -16; + this.buttonList.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + var1, 114, 20, I18n.format("demo.help.buy"))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + var1, 114, 20, I18n.format("demo.help.later"))); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + switch (p_146284_1_.id) { + case 1: + p_146284_1_.enabled = false; + + try { + Class var2 = Class.forName("java.awt.Desktop"); + Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke(null); + var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new URI("http://www.minecraft.net/store?source=demo")); + } catch (Throwable var4) { + logger.error("Couldn't open link", var4); + } + + break; + + case 2: + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + } + + public void drawDefaultBackground() { + super.drawDefaultBackground(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_146348_f); + int var1 = (this.width - 248) / 2; + int var2 = (this.height - 166) / 2; + drawTexturedModalRect(var1, var2, 0, 0, 248, 166); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + int var4 = (this.width - 248) / 2 + 10; + int var5 = (this.height - 166) / 2 + 8; + this.fontRendererObj.drawString(I18n.format("demo.help.title"), var4, var5, 2039583); + var5 += 12; + GameSettings var6 = this.mc.gameSettings; + this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", GameSettings.getKeyDisplayString(var6.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindRight.getKeyCode())), var4, var5, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse"), var4, var5 + 12, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.jump", GameSettings.getKeyDisplayString(var6.keyBindJump.getKeyCode())), var4, var5 + 24, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.inventory", GameSettings.getKeyDisplayString(var6.keyBindInventory.getKeyCode())), var4, var5 + 36, 5197647); + this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped"), var4, var5 + 68, 218, 2039583); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java new file mode 100644 index 0000000..ceb5e60 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java @@ -0,0 +1,152 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiScreenOptionsSounds extends GuiScreen { + private final GuiScreen field_146505_f; + private final GameSettings field_146506_g; + protected String field_146507_a = "Options"; + private String field_146508_h; + + + public GuiScreenOptionsSounds(GuiScreen p_i45025_1_, GameSettings p_i45025_2_) { + this.field_146505_f = p_i45025_1_; + this.field_146506_g = p_i45025_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + byte var1 = 0; + this.field_146507_a = I18n.format("options.sounds.title"); + this.field_146508_h = I18n.format("options.off"); + this.buttonList.add(new GuiScreenOptionsSounds.Button(SoundCategory.MASTER.getCategoryId(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), SoundCategory.MASTER, true)); + int var6 = var1 + 2; + SoundCategory[] var2 = SoundCategory.values(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + SoundCategory var5 = var2[var4]; + + if (var5 != SoundCategory.MASTER) { + this.buttonList.add(new GuiScreenOptionsSounds.Button(var5.getCategoryId(), this.width / 2 - 155 + var6 % 2 * 160, this.height / 6 - 12 + 24 * (var6 >> 1), var5, false)); + ++var6; + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done"))); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146505_f); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146507_a, this.width / 2, 15, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + protected String func_146504_a(SoundCategory p_146504_1_) { + float var2 = this.field_146506_g.getSoundLevel(p_146504_1_); + return var2 == 0.0F ? this.field_146508_h : (int)(var2 * 100.0F) + "%"; + } + + class Button extends GuiButton { + private final SoundCategory field_146153_r; + private final String field_146152_s; + public float field_146156_o = 1.0F; + public boolean field_146155_p; + + + public Button(int p_i45024_2_, int p_i45024_3_, int p_i45024_4_, SoundCategory p_i45024_5_, boolean p_i45024_6_) { + super(p_i45024_2_, p_i45024_3_, p_i45024_4_, p_i45024_6_ ? 310 : 150, 20, ""); + this.field_146153_r = p_i45024_5_; + this.field_146152_s = I18n.format("soundCategory." + p_i45024_5_.getCategoryName()); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.func_146504_a(p_i45024_5_); + this.field_146156_o = GuiScreenOptionsSounds.this.field_146506_g.getSoundLevel(p_i45024_5_); + } + + public int getHoverState(boolean p_146114_1_) { + return 0; + } + + protected void mouseDragged(Minecraft p_146119_1_, int p_146119_2_, int p_146119_3_) { + if (this.field_146125_m) { + if (this.field_146155_p) { + this.field_146156_o = (float)(p_146119_2_ - (this.field_146128_h + 4)) / (float)(this.field_146120_f - 8); + + if (this.field_146156_o < 0.0F) { + this.field_146156_o = 0.0F; + } + + if (this.field_146156_o > 1.0F) { + this.field_146156_o = 1.0F; + } + + p_146119_1_.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o); + p_146119_1_.gameSettings.saveOptions(); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.func_146504_a(this.field_146153_r); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + drawTexturedModalRect(this.field_146128_h + (int)(this.field_146156_o * (float)(this.field_146120_f - 8)), this.field_146129_i, 0, 66, 4, 20); + drawTexturedModalRect(this.field_146128_h + (int)(this.field_146156_o * (float)(this.field_146120_f - 8)) + 4, this.field_146129_i, 196, 66, 4, 20); + } + } + + public boolean mousePressed(Minecraft p_146116_1_, int p_146116_2_, int p_146116_3_) { + if (super.mousePressed(p_146116_1_, p_146116_2_, p_146116_3_)) { + this.field_146156_o = (float)(p_146116_2_ - (this.field_146128_h + 4)) / (float)(this.field_146120_f - 8); + + if (this.field_146156_o < 0.0F) { + this.field_146156_o = 0.0F; + } + + if (this.field_146156_o > 1.0F) { + this.field_146156_o = 1.0F; + } + + p_146116_1_.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o); + p_146116_1_.gameSettings.saveOptions(); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.func_146504_a(this.field_146153_r); + this.field_146155_p = true; + return true; + } else { + return false; + } + } + + public void func_146113_a(SoundHandler p_146113_1_) {} + + public void mouseReleased(int p_146118_1_, int p_146118_2_) { + if (this.field_146155_p) { + if (this.field_146153_r == SoundCategory.MASTER) { + float var10000 = 1.0F; + } else { + GuiScreenOptionsSounds.this.field_146506_g.getSoundLevel(this.field_146153_r); + } + + GuiScreenOptionsSounds.this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + } + + this.field_146155_p = false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java new file mode 100644 index 0000000..bc9f4b1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java @@ -0,0 +1,191 @@ +package net.minecraft.client.gui; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.realms.RealmsButton; +import net.minecraft.realms.RealmsScreen; + +public class GuiScreenRealmsProxy extends GuiScreen { + private final RealmsScreen field_154330_a; + + + public GuiScreenRealmsProxy(RealmsScreen p_i1087_1_) { + this.field_154330_a = p_i1087_1_; + super.buttonList = Collections.synchronizedList(new ArrayList()); + } + + public RealmsScreen func_154321_a() { + return this.field_154330_a; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.field_154330_a.init(); + super.initGui(); + } + + public void func_154325_a(String p_154325_1_, int p_154325_2_, int p_154325_3_, int p_154325_4_) { + super.drawCenteredString(this.fontRendererObj, p_154325_1_, p_154325_2_, p_154325_3_, p_154325_4_); + } + + public void func_154322_b(String p_154322_1_, int p_154322_2_, int p_154322_3_, int p_154322_4_) { + super.drawString(this.fontRendererObj, p_154322_1_, p_154322_2_, p_154322_3_, p_154322_4_); + } + + /** + * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height + */ + public void drawTexturedModalRect(int p_73729_1_, int p_73729_2_, int p_73729_3_, int p_73729_4_, int p_73729_5_, int p_73729_6_) { + this.field_154330_a.blit(p_73729_1_, p_73729_2_, p_73729_3_, p_73729_4_, p_73729_5_, p_73729_6_); + Gui.drawTexturedModalRect(p_73729_1_, p_73729_2_, p_73729_3_, p_73729_4_, p_73729_5_, p_73729_6_); + } + + /** + * Draws a rectangle with a vertical gradient between the specified colors. + */ + public void drawGradientRect(int p_73733_1_, int p_73733_2_, int p_73733_3_, int p_73733_4_, int p_73733_5_, int p_73733_6_) { + Gui.drawGradientRect(p_73733_1_, p_73733_2_, p_73733_3_, p_73733_4_, p_73733_5_, p_73733_6_); + } + + public void drawDefaultBackground() { + super.drawDefaultBackground(); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return super.doesGuiPauseGame(); + } + + public void func_146270_b(int p_146270_1_) { + super.func_146270_b(p_146270_1_); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.field_154330_a.render(p_73863_1_, p_73863_2_, p_73863_3_); + } + + public void func_146285_a(ItemStack p_146285_1_, int p_146285_2_, int p_146285_3_) { + super.func_146285_a(p_146285_1_, p_146285_2_, p_146285_3_); + } + + public void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_) { + super.func_146279_a(p_146279_1_, p_146279_2_, p_146279_3_); + } + + public void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_) { + super.func_146283_a(p_146283_1_, p_146283_2_, p_146283_3_); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_154330_a.tick(); + super.updateScreen(); + } + + public int func_154329_h() { + return this.fontRendererObj.FONT_HEIGHT; + } + + public int func_154326_c(String p_154326_1_) { + return this.fontRendererObj.getStringWidth(p_154326_1_); + } + + public void func_154319_c(String p_154319_1_, int p_154319_2_, int p_154319_3_, int p_154319_4_) { + this.fontRendererObj.drawStringWithShadow(p_154319_1_, p_154319_2_, p_154319_3_, p_154319_4_); + } + + public List func_154323_a(String p_154323_1_, int p_154323_2_) { + return this.fontRendererObj.listFormattedStringToWidth(p_154323_1_, p_154323_2_); + } + + public final void actionPerformed(GuiButton p_146284_1_) { + this.field_154330_a.buttonClicked(((GuiButtonRealmsProxy)p_146284_1_).func_154317_g()); + } + + public void func_154324_i() { + super.buttonList.clear(); + } + + public void func_154327_a(RealmsButton p_154327_1_) { + super.buttonList.add(p_154327_1_.getProxy()); + } + + public List func_154320_j() { + ArrayList var1 = new ArrayList(super.buttonList.size()); + Iterator var2 = super.buttonList.iterator(); + + while (var2.hasNext()) { + GuiButton var3 = (GuiButton)var2.next(); + var1.add(((GuiButtonRealmsProxy)var3).func_154317_g()); + } + + return var1; + } + + public void func_154328_b(RealmsButton p_154328_1_) { + super.buttonList.remove(p_154328_1_); + } + + /** + * Called when the mouse is clicked. + */ + public void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + this.field_154330_a.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() { + this.field_154330_a.mouseEvent(); + super.handleMouseInput(); + } + + /** + * Handles keyboard input. + */ + public void handleKeyboardInput() { + this.field_154330_a.keyboardEvent(); + super.handleKeyboardInput(); + } + + public void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) { + this.field_154330_a.mouseReleased(p_146286_1_, p_146286_2_, p_146286_3_); + } + + public void mouseClickMove(int p_146273_1_, int p_146273_2_, int p_146273_3_, long p_146273_4_) { + this.field_154330_a.mouseDragged(p_146273_1_, p_146273_2_, p_146273_3_, p_146273_4_); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + public void keyTyped(char p_73869_1_, int p_73869_2_) { + this.field_154330_a.keyPressed(p_73869_1_, p_73869_2_); + } + + public void confirmClicked(boolean p_73878_1_, int p_73878_2_) { + this.field_154330_a.confirmResult(p_73878_1_, p_73878_2_); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + this.field_154330_a.removed(); + super.onGuiClosed(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java new file mode 100644 index 0000000..fadfa8d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenResourcePacks.java @@ -0,0 +1,176 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import net.minecraft.client.resources.*; +import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.Sys; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +public class GuiScreenResourcePacks extends GuiScreen { + private static final Logger logger = LogManager.getLogger(); + private final GuiScreen field_146965_f; + private List field_146966_g; + private List field_146969_h; + private GuiResourcePackAvailable field_146970_i; + private GuiResourcePackSelected field_146967_r; + + + public GuiScreenResourcePacks(GuiScreen p_i45050_1_) { + this.field_146965_f = p_i45050_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder"))); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done"))); + this.field_146966_g = new ArrayList(); + this.field_146969_h = new ArrayList(); + ResourcePackRepository var1 = this.mc.getResourcePackRepository(); + var1.updateRepositoryEntriesAll(); + ArrayList var2 = Lists.newArrayList(var1.getRepositoryEntriesAll()); + var2.removeAll(var1.getRepositoryEntries()); + Iterator var3 = var2.iterator(); + ResourcePackRepository.Entry var4; + + while (var3.hasNext()) { + var4 = (ResourcePackRepository.Entry)var3.next(); + this.field_146966_g.add(new ResourcePackListEntryFound(this, var4)); + } + + var3 = Lists.reverse(var1.getRepositoryEntries()).iterator(); + + while (var3.hasNext()) { + var4 = (ResourcePackRepository.Entry)var3.next(); + this.field_146969_h.add(new ResourcePackListEntryFound(this, var4)); + } + + this.field_146969_h.add(new ResourcePackListEntryDefault(this)); + this.field_146970_i = new GuiResourcePackAvailable(this.mc, 200, this.height, this.field_146966_g); + this.field_146970_i.func_148140_g(this.width / 2 - 4 - 200); + this.field_146970_i.func_148134_d(7, 8); + this.field_146967_r = new GuiResourcePackSelected(this.mc, 200, this.height, this.field_146969_h); + this.field_146967_r.func_148140_g(this.width / 2 + 4); + this.field_146967_r.func_148134_d(7, 8); + } + + public boolean func_146961_a(ResourcePackListEntry p_146961_1_) { + return this.field_146969_h.contains(p_146961_1_); + } + + public List func_146962_b(ResourcePackListEntry p_146962_1_) { + return this.func_146961_a(p_146962_1_) ? this.field_146969_h : this.field_146966_g; + } + + public List func_146964_g() { + return this.field_146966_g; + } + + public List func_146963_h() { + return this.field_146969_h; + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 2) { + File var2 = this.mc.getResourcePackRepository().getDirResourcepacks(); + String var3 = var2.getAbsolutePath(); + + if (Util.getOSType() == Util.EnumOS.OSX) { + try { + logger.info(var3); + Runtime.getRuntime().exec(new String[] {"/usr/bin/open", var3}); + return; + } catch (IOException var9) { + logger.error("Couldn't open file", var9); + } + } else if (Util.getOSType() == Util.EnumOS.WINDOWS) { + String var4 = String.format("cmd.exe /C start \"Open file\" \"%s\"", var3); + + try { + Runtime.getRuntime().exec(var4); + return; + } catch (IOException var8) { + logger.error("Couldn't open file", var8); + } + } + + boolean var12 = false; + + try { + Class var5 = Class.forName("java.awt.Desktop"); + Object var6 = var5.getMethod("getDesktop", new Class[0]).invoke(null); + var5.getMethod("browse", new Class[] {URI.class}).invoke(var6, var2.toURI()); + } catch (Throwable var7) { + logger.error("Couldn't open link", var7); + var12 = true; + } + + if (var12) { + logger.info("Opening via system class!"); + Sys.openURL("file://" + var3); + } + } else if (p_146284_1_.id == 1) { + ArrayList var10 = Lists.newArrayList(); + Iterator var11 = this.field_146969_h.iterator(); + + while (var11.hasNext()) { + ResourcePackListEntry var13 = (ResourcePackListEntry)var11.next(); + + if (var13 instanceof ResourcePackListEntryFound) { + var10.add(((ResourcePackListEntryFound)var13).func_148318_i()); + } + } + + Collections.reverse(var10); + this.mc.getResourcePackRepository().setRepositories(var10); + this.mc.gameSettings.resourcePacks.clear(); + var11 = var10.iterator(); + + while (var11.hasNext()) { + ResourcePackRepository.Entry var14 = (ResourcePackRepository.Entry)var11.next(); + this.mc.gameSettings.resourcePacks.add(var14.getResourcePackName()); + } + + this.mc.gameSettings.saveOptions(); + this.mc.refreshResources(); + this.mc.displayGuiScreen(this.field_146965_f); + } + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146970_i.func_148179_a(p_73864_1_, p_73864_2_, mouseButton); + this.field_146967_r.func_148179_a(p_73864_1_, p_73864_2_, mouseButton); + } + + protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) { + super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.func_146278_c(0); + this.field_146970_i.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.field_146967_r.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.title"), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.folderInfo"), this.width / 2 - 77, this.height - 26, 8421504); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java new file mode 100644 index 0000000..d3f2faf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenServerList.java @@ -0,0 +1,89 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.resources.I18n; +import org.lwjgl.input.Keyboard; + +public class GuiScreenServerList extends GuiScreen { + private final GuiScreen field_146303_a; + private final ServerData field_146301_f; + private GuiTextField field_146302_g; + + + public GuiScreenServerList(GuiScreen p_i1031_1_, ServerData p_i1031_2_) { + this.field_146303_a = p_i1031_1_; + this.field_146301_f = p_i1031_2_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + this.field_146302_g.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectServer.select"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel"))); + this.field_146302_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 116, 200, 20); + this.field_146302_g.setMaxStringLength(128); + this.field_146302_g.setFocused(true); + this.field_146302_g.setText(this.mc.gameSettings.lastServer); + this.buttonList.get(0).enabled = this.field_146302_g.getText().length() > 0 && this.field_146302_g.getText().split(":").length > 0; + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + this.mc.gameSettings.lastServer = this.field_146302_g.getText(); + this.mc.gameSettings.saveOptions(); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 1) { + this.field_146303_a.confirmClicked(false, 0); + } else if (p_146284_1_.id == 0) { + this.field_146301_f.serverIP = this.field_146302_g.getText(); + this.field_146303_a.confirmClicked(true, 0); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (this.field_146302_g.keyTyped(p_73869_1_, p_73869_2_)) { + this.buttonList.get(0).enabled = this.field_146302_g.getText().length() > 0 && this.field_146302_g.getText().split(":").length > 0; + } else if (p_73869_2_ == 28 || p_73869_2_ == 156) { + this.actionPerformed(this.buttonList.get(0)); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + this.field_146302_g.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectServer.direct"), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterIp"), this.width / 2 - 100, 100, 10526880); + this.field_146302_g.drawTextBox(); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java new file mode 100644 index 0000000..f576e0f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiScreenWorking.java @@ -0,0 +1,60 @@ +package net.minecraft.client.gui; + +import net.minecraft.util.IProgressUpdate; + +public class GuiScreenWorking extends GuiScreen implements IProgressUpdate { + private String field_146591_a = ""; + private String field_146589_f = ""; + private int field_146590_g; + private boolean field_146592_h; + + + /** + * "Saving level", or the loading,or downloading equivelent + */ + public void displayProgressMessage(String p_73720_1_) { + this.resetProgressAndMessage(p_73720_1_); + } + + /** + * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, + * and the WorkingString to "working...". + */ + public void resetProgressAndMessage(String p_73721_1_) { + this.field_146591_a = p_73721_1_; + this.resetProgresAndWorkingMessage("Working..."); + } + + /** + * This is called with "Working..." by resetProgressAndMessage + */ + public void resetProgresAndWorkingMessage(String p_73719_1_) { + this.field_146589_f = p_73719_1_; + this.setLoadingProgress(0); + } + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + public void setLoadingProgress(int p_73718_1_) { + this.field_146590_g = p_73718_1_; + } + + public void func_146586_a() { + this.field_146592_h = true; + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + if (this.field_146592_h) { + this.mc.displayGuiScreen(null); + } else { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146591_a, this.width / 2, 70, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146589_f + " " + this.field_146590_g + "%", this.width / 2, 90, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java new file mode 100644 index 0000000..c6b91be --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSelectWorld.java @@ -0,0 +1,261 @@ +package net.minecraft.client.gui; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.WorldInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GuiSelectWorld extends GuiScreen implements GuiYesNoCallback { + private static final Logger logger = LogManager.getLogger(); + private final DateFormat field_146633_h = new SimpleDateFormat(); + protected GuiScreen field_146632_a; + protected String field_146628_f = "Select world"; + private boolean field_146634_i; + private int field_146640_r; + private java.util.List field_146639_s; + private GuiSelectWorld.List field_146638_t; + private String field_146637_u; + private String field_146636_v; + private final String[] field_146635_w = new String[3]; + private boolean field_146643_x; + private GuiButton field_146642_y; + private GuiButton field_146641_z; + private GuiButton field_146630_A; + private GuiButton field_146631_B; + + + public GuiSelectWorld(GuiScreen p_i1054_1_) { + this.field_146632_a = p_i1054_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.field_146628_f = I18n.format("selectWorld.title"); + + try { + this.func_146627_h(); + } catch (AnvilConverterException var2) { + logger.error("Couldn't load level list", var2); + this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", var2.getMessage())); + return; + } + + this.field_146637_u = I18n.format("selectWorld.world"); + this.field_146636_v = I18n.format("selectWorld.conversion"); + this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival"); + this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative"); + this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure"); + this.field_146638_t = new GuiSelectWorld.List(); + this.field_146638_t.func_148134_d(4, 5); + this.func_146618_g(); + } + + private void func_146627_h() throws AnvilConverterException { + ISaveFormat var1 = this.mc.getSaveLoader(); + this.field_146639_s = var1.getSaveList(); + Collections.sort(this.field_146639_s); + this.field_146640_r = -1; + } + + protected String func_146621_a(int p_146621_1_) { + return ((SaveFormatComparator)this.field_146639_s.get(p_146621_1_)).getFileName(); + } + + protected String func_146614_d(int p_146614_1_) { + String var2 = ((SaveFormatComparator)this.field_146639_s.get(p_146614_1_)).getDisplayName(); + + if (var2 == null || MathHelper.stringNullOrLengthZero(var2)) { + var2 = I18n.format("selectWorld.world") + " " + (p_146614_1_ + 1); + } + + return var2; + } + + public void func_146618_g() { + this.buttonList.add(this.field_146641_z = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.format("selectWorld.select"))); + this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.format("selectWorld.create"))); + this.buttonList.add(this.field_146630_A = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.format("selectWorld.rename"))); + this.buttonList.add(this.field_146642_y = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.format("selectWorld.delete"))); + this.buttonList.add(this.field_146631_B = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.format("selectWorld.recreate"))); + this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.format("gui.cancel"))); + this.field_146641_z.enabled = false; + this.field_146642_y.enabled = false; + this.field_146630_A.enabled = false; + this.field_146631_B.enabled = false; + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 2) { + String var2 = this.func_146614_d(this.field_146640_r); + + if (var2 != null) { + this.field_146643_x = true; + GuiYesNo var3 = func_152129_a(this, var2, this.field_146640_r); + this.mc.displayGuiScreen(var3); + } + } else if (p_146284_1_.id == 1) { + this.func_146615_e(this.field_146640_r); + } else if (p_146284_1_.id == 3) { + this.mc.displayGuiScreen(new GuiCreateWorld(this)); + } else if (p_146284_1_.id == 6) { + this.mc.displayGuiScreen(new GuiRenameWorld(this, this.func_146621_a(this.field_146640_r))); + } else if (p_146284_1_.id == 0) { + this.mc.displayGuiScreen(this.field_146632_a); + } else if (p_146284_1_.id == 7) { + GuiCreateWorld var5 = new GuiCreateWorld(this); + ISaveHandler var6 = this.mc.getSaveLoader().getSaveLoader(this.func_146621_a(this.field_146640_r), false); + WorldInfo var4 = var6.loadWorldInfo(); + var6.flush(); + var5.func_146318_a(var4); + this.mc.displayGuiScreen(var5); + } else { + this.field_146638_t.func_148147_a(p_146284_1_); + } + } + } + + public void func_146615_e(int p_146615_1_) { + this.mc.displayGuiScreen(null); + + if (!this.field_146634_i) { + this.field_146634_i = true; + String var2 = this.func_146621_a(p_146615_1_); + + if (var2 == null) { + var2 = "World" + p_146615_1_; + } + + String var3 = this.func_146614_d(p_146615_1_); + + if (var3 == null) { + var3 = "World" + p_146615_1_; + } + + if (this.mc.getSaveLoader().canLoadWorld(var2)) { + this.mc.launchIntegratedServer(var2, var3, null); + } + } + } + + public void confirmClicked(boolean p_73878_1_, int p_73878_2_) { + if (this.field_146643_x) { + this.field_146643_x = false; + + if (p_73878_1_) { + ISaveFormat var3 = this.mc.getSaveLoader(); + var3.flushCache(); + var3.deleteWorldDirectory(this.func_146621_a(p_73878_2_)); + + try { + this.func_146627_h(); + } catch (AnvilConverterException var5) { + logger.error("Couldn't load level list", var5); + } + } + + this.mc.displayGuiScreen(this); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.field_146638_t.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, this.field_146628_f, this.width / 2, 20, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + public static GuiYesNo func_152129_a(GuiYesNoCallback p_152129_0_, String p_152129_1_, int p_152129_2_) { + String var3 = I18n.format("selectWorld.deleteQuestion"); + String var4 = "'" + p_152129_1_ + "' " + I18n.format("selectWorld.deleteWarning"); + String var5 = I18n.format("selectWorld.deleteButton"); + String var6 = I18n.format("gui.cancel"); + GuiYesNo var7 = new GuiYesNo(p_152129_0_, var3, var4, var5, var6, p_152129_2_); + return var7; + } + + class List extends GuiSlot { + + + public List() { + super(GuiSelectWorld.this.mc, GuiSelectWorld.this.width, GuiSelectWorld.this.height, 32, GuiSelectWorld.this.height - 64, 36); + } + + protected int getSize() { + return GuiSelectWorld.this.field_146639_s.size(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) { + GuiSelectWorld.this.field_146640_r = p_148144_1_; + boolean var5 = GuiSelectWorld.this.field_146640_r >= 0 && GuiSelectWorld.this.field_146640_r < this.getSize(); + GuiSelectWorld.this.field_146641_z.enabled = var5; + GuiSelectWorld.this.field_146642_y.enabled = var5; + GuiSelectWorld.this.field_146630_A.enabled = var5; + GuiSelectWorld.this.field_146631_B.enabled = var5; + + if (p_148144_2_ && var5) { + GuiSelectWorld.this.func_146615_e(p_148144_1_); + } + } + + protected boolean isSelected(int p_148131_1_) { + return p_148131_1_ == GuiSelectWorld.this.field_146640_r; + } + + protected int func_148138_e() { + return GuiSelectWorld.this.field_146639_s.size() * 36; + } + + protected void drawBackground() { + GuiSelectWorld.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + SaveFormatComparator var8 = (SaveFormatComparator)GuiSelectWorld.this.field_146639_s.get(p_148126_1_); + String var9 = var8.getDisplayName(); + + if (var9 == null || MathHelper.stringNullOrLengthZero(var9)) { + var9 = GuiSelectWorld.this.field_146637_u + " " + (p_148126_1_ + 1); + } + + String var10 = var8.getFileName(); + var10 = var10 + " (" + GuiSelectWorld.this.field_146633_h.format(new Date(var8.getLastTimePlayed())); + var10 = var10 + ")"; + String var11 = ""; + + if (var8.requiresConversion()) { + var11 = GuiSelectWorld.this.field_146636_v + " " + var11; + } else { + var11 = GuiSelectWorld.this.field_146635_w[var8.getEnumGameType().getID()]; + + if (var8.isHardcoreModeEnabled()) { + var11 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + EnumChatFormatting.RESET; + } + + if (var8.getCheatsEnabled()) { + var11 = var11 + ", " + I18n.format("selectWorld.cheats"); + } + } + + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, var9, p_148126_2_ + 2, p_148126_3_ + 1, 16777215); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, var10, p_148126_2_ + 2, p_148126_3_ + 12, 8421504); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, var11, p_148126_2_ + 2, p_148126_3_ + 12 + 10, 8421504); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiShareToLan.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiShareToLan.java new file mode 100644 index 0000000..5fd84d4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiShareToLan.java @@ -0,0 +1,84 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.WorldSettings; + +public class GuiShareToLan extends GuiScreen { + private final GuiScreen field_146598_a; + private GuiButton field_146596_f; + private GuiButton field_146597_g; + private String field_146599_h = "survival"; + private boolean field_146600_i; + + + public GuiShareToLan(GuiScreen p_i1055_1_) { + this.field_146598_a = p_i1055_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("lanServer.start"))); + this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel"))); + this.buttonList.add(this.field_146597_g = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.format("selectWorld.gameMode"))); + this.buttonList.add(this.field_146596_f = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.format("selectWorld.allowCommands"))); + this.func_146595_g(); + } + + private void func_146595_g() { + this.field_146597_g.displayString = I18n.format("selectWorld.gameMode") + " " + I18n.format("selectWorld.gameMode." + this.field_146599_h); + this.field_146596_f.displayString = I18n.format("selectWorld.allowCommands") + " "; + + if (this.field_146600_i) { + this.field_146596_f.displayString = this.field_146596_f.displayString + I18n.format("options.on"); + } else { + this.field_146596_f.displayString = this.field_146596_f.displayString + I18n.format("options.off"); + } + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 102) { + this.mc.displayGuiScreen(this.field_146598_a); + } else if (p_146284_1_.id == 104) { + if (this.field_146599_h.equals("survival")) { + this.field_146599_h = "creative"; + } else if (this.field_146599_h.equals("creative")) { + this.field_146599_h = "adventure"; + } else { + this.field_146599_h = "survival"; + } + + this.func_146595_g(); + } else if (p_146284_1_.id == 103) { + this.field_146600_i = !this.field_146600_i; + this.func_146595_g(); + } else if (p_146284_1_.id == 101) { + this.mc.displayGuiScreen(null); + String var2 = this.mc.getIntegratedServer().shareToLAN(WorldSettings.GameType.getByName(this.field_146599_h), this.field_146600_i); + Object var3; + + if (var2 != null) { + var3 = new ChatComponentTranslation("commands.publish.started", var2); + } else { + var3 = new ChatComponentText("commands.publish.failed"); + } + + this.mc.ingameGUI.getChatGUI().func_146227_a((IChatComponent)var3); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.title"), this.width / 2, 50, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.otherPlayers"), this.width / 2, 82, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSleepMP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSleepMP.java new file mode 100644 index 0000000..137ba0c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSleepMP.java @@ -0,0 +1,50 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.play.client.C0BPacketEntityAction; + +public class GuiSleepMP extends GuiChat { + + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + super.initGui(); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.format("multiplayer.stopSleeping"))); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (p_73869_2_ == 1) { + this.func_146418_g(); + } else if (p_73869_2_ != 28 && p_73869_2_ != 156) { + super.keyTyped(p_73869_1_, p_73869_2_); + } else { + String var3 = this.field_146415_a.getText().trim(); + + if (!var3.isEmpty()) { + this.mc.thePlayer.sendChatMessage(var3); + } + + this.field_146415_a.setText(""); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 1) { + this.func_146418_g(); + } else { + super.actionPerformed(p_146284_1_); + } + } + + private void func_146418_g() { + NetHandlerPlayClient var1 = this.mc.thePlayer.sendQueue; + var1.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, 3)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSlot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSlot.java new file mode 100644 index 0000000..19c24d8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSlot.java @@ -0,0 +1,408 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public abstract class GuiSlot { + private final Minecraft field_148161_k; + protected int field_148155_a; + private int field_148158_l; + protected int field_148153_b; + protected int field_148154_c; + protected int field_148151_d; + protected int field_148152_e; + protected final int field_148149_f; + private int field_148159_m; + private int field_148156_n; + protected int field_148150_g; + protected int field_148162_h; + protected boolean field_148163_i = true; + private float field_148157_o = -2.0F; + private float field_148170_p; + private float field_148169_q; + private int field_148168_r = -1; + private long field_148167_s; + private boolean field_148166_t = true; + private boolean field_148165_u; + protected int field_148160_j; + private boolean field_148164_v = true; + + + public GuiSlot(Minecraft p_i1052_1_, int p_i1052_2_, int p_i1052_3_, int p_i1052_4_, int p_i1052_5_, int p_i1052_6_) { + this.field_148161_k = p_i1052_1_; + this.field_148155_a = p_i1052_2_; + this.field_148158_l = p_i1052_3_; + this.field_148153_b = p_i1052_4_; + this.field_148154_c = p_i1052_5_; + this.field_148149_f = p_i1052_6_; + this.field_148152_e = 0; + this.field_148151_d = p_i1052_2_; + } + + public void func_148122_a(int p_148122_1_, int p_148122_2_, int p_148122_3_, int p_148122_4_) { + this.field_148155_a = p_148122_1_; + this.field_148158_l = p_148122_2_; + this.field_148153_b = p_148122_3_; + this.field_148154_c = p_148122_4_; + this.field_148152_e = 0; + this.field_148151_d = p_148122_1_; + } + + public void func_148130_a(boolean p_148130_1_) { + this.field_148166_t = p_148130_1_; + } + + protected void func_148133_a(boolean p_148133_1_, int p_148133_2_) { + this.field_148165_u = p_148133_1_; + this.field_148160_j = p_148133_2_; + + if (!p_148133_1_) { + this.field_148160_j = 0; + } + } + + protected abstract int getSize(); + + protected abstract void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_); + + protected abstract boolean isSelected(int p_148131_1_); + + protected int func_148138_e() { + return this.getSize() * this.field_148149_f + this.field_148160_j; + } + + protected abstract void drawBackground(); + + protected abstract void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_); + + protected void func_148129_a(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) {} + + protected void func_148132_a(int p_148132_1_, int p_148132_2_) {} + + protected void func_148142_b(int p_148142_1_, int p_148142_2_) {} + + public int func_148124_c(int p_148124_1_, int p_148124_2_) { + int var3 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2; + int var4 = this.field_148152_e + this.field_148155_a / 2 + this.func_148139_c() / 2; + int var5 = p_148124_2_ - this.field_148153_b - this.field_148160_j + (int)this.field_148169_q - 4; + int var6 = var5 / this.field_148149_f; + return p_148124_1_ < this.func_148137_d() && p_148124_1_ >= var3 && p_148124_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; + } + + public void func_148134_d(int p_148134_1_, int p_148134_2_) { + this.field_148159_m = p_148134_1_; + this.field_148156_n = p_148134_2_; + } + + private void func_148121_k() { + int var1 = this.func_148135_f(); + + if (var1 < 0) { + var1 /= 2; + } + + if (!this.field_148163_i && var1 < 0) { + var1 = 0; + } + + if (this.field_148169_q < 0.0F) { + this.field_148169_q = 0.0F; + } + + if (this.field_148169_q > (float)var1) { + this.field_148169_q = (float)var1; + } + } + + public int func_148135_f() { + return this.func_148138_e() - (this.field_148154_c - this.field_148153_b - 4); + } + + public int func_148148_g() { + return (int)this.field_148169_q; + } + + public boolean func_148141_e(int p_148141_1_) { + return p_148141_1_ >= this.field_148153_b && p_148141_1_ <= this.field_148154_c; + } + + public void func_148145_f(int p_148145_1_) { + this.field_148169_q += (float)p_148145_1_; + this.func_148121_k(); + this.field_148157_o = -2.0F; + } + + public void func_148147_a(GuiButton p_148147_1_) { + if (p_148147_1_.enabled) { + if (p_148147_1_.id == this.field_148159_m) { + this.field_148169_q -= (float)(this.field_148149_f * 2 / 3); + this.field_148157_o = -2.0F; + this.func_148121_k(); + } else if (p_148147_1_.id == this.field_148156_n) { + this.field_148169_q += (float)(this.field_148149_f * 2 / 3); + this.field_148157_o = -2.0F; + this.func_148121_k(); + } + } + } + + public void func_148128_a(int p_148128_1_, int p_148128_2_, float p_148128_3_) { + this.field_148150_g = p_148128_1_; + this.field_148162_h = p_148128_2_; + this.drawBackground(); + int var4 = this.getSize(); + int var5 = this.func_148137_d(); + int var6 = var5 + 6; + int var9; + int var10; + int var13; + int var19; + + if (p_148128_1_ > this.field_148152_e && p_148128_1_ < this.field_148151_d && p_148128_2_ > this.field_148153_b && p_148128_2_ < this.field_148154_c) { + if (Mouse.isButtonDown(0) && this.func_148125_i()) { + if (this.field_148157_o == -1.0F) { + boolean var15 = true; + + if (p_148128_2_ >= this.field_148153_b && p_148128_2_ <= this.field_148154_c) { + int var8 = this.field_148155_a / 2 - this.func_148139_c() / 2; + var9 = this.field_148155_a / 2 + this.func_148139_c() / 2; + var10 = p_148128_2_ - this.field_148153_b - this.field_148160_j + (int)this.field_148169_q - 4; + int var11 = var10 / this.field_148149_f; + + if (p_148128_1_ >= var8 && p_148128_1_ <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { + boolean var12 = var11 == this.field_148168_r && Minecraft.getSystemTime() - this.field_148167_s < 250L; + this.elementClicked(var11, var12, p_148128_1_, p_148128_2_); + this.field_148168_r = var11; + this.field_148167_s = Minecraft.getSystemTime(); + } else if (p_148128_1_ >= var8 && p_148128_1_ <= var9 && var10 < 0) { + this.func_148132_a(p_148128_1_ - var8, p_148128_2_ - this.field_148153_b + (int)this.field_148169_q - 4); + var15 = false; + } + + if (p_148128_1_ >= var5 && p_148128_1_ <= var6) { + this.field_148170_p = -1.0F; + var19 = this.func_148135_f(); + + if (var19 < 1) { + var19 = 1; + } + + var13 = (int)((float)((this.field_148154_c - this.field_148153_b) * (this.field_148154_c - this.field_148153_b)) / (float)this.func_148138_e()); + + if (var13 < 32) { + var13 = 32; + } + + if (var13 > this.field_148154_c - this.field_148153_b - 8) { + var13 = this.field_148154_c - this.field_148153_b - 8; + } + + this.field_148170_p /= (float)(this.field_148154_c - this.field_148153_b - var13) / (float)var19; + } else { + this.field_148170_p = 1.0F; + } + + if (var15) { + this.field_148157_o = (float)p_148128_2_; + } else { + this.field_148157_o = -2.0F; + } + } else { + this.field_148157_o = -2.0F; + } + } else if (this.field_148157_o >= 0.0F) { + this.field_148169_q -= ((float)p_148128_2_ - this.field_148157_o) * this.field_148170_p; + this.field_148157_o = (float)p_148128_2_; + } + } else { + for (; !this.field_148161_k.gameSettings.touchscreen && Mouse.next(); this.field_148161_k.currentScreen.handleMouseInput()) { + int var7 = Mouse.getEventDWheel(); + + if (var7 != 0) { + if (var7 > 0) { + var7 = -1; + } else if (var7 < 0) { + var7 = 1; + } + + this.field_148169_q += (float)(var7 * this.field_148149_f / 2); + } + } + + this.field_148157_o = -1.0F; + } + } + + this.func_148121_k(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + Tessellator var16 = Tessellator.instance; + this.field_148161_k.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var17 = 32.0F; + var16.startDrawingQuads(); + var16.setColorOpaque_I(2105376); + var16.addVertexWithUV(this.field_148152_e, this.field_148154_c, 0.0D, (float)this.field_148152_e / var17, (float)(this.field_148154_c + (int)this.field_148169_q) / var17); + var16.addVertexWithUV(this.field_148151_d, this.field_148154_c, 0.0D, (float)this.field_148151_d / var17, (float)(this.field_148154_c + (int)this.field_148169_q) / var17); + var16.addVertexWithUV(this.field_148151_d, this.field_148153_b, 0.0D, (float)this.field_148151_d / var17, (float)(this.field_148153_b + (int)this.field_148169_q) / var17); + var16.addVertexWithUV(this.field_148152_e, this.field_148153_b, 0.0D, (float)this.field_148152_e / var17, (float)(this.field_148153_b + (int)this.field_148169_q) / var17); + var16.draw(); + var9 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; + var10 = this.field_148153_b + 4 - (int)this.field_148169_q; + + if (this.field_148165_u) { + this.func_148129_a(var9, var10, var16); + } + + this.func_148120_b(var9, var10, p_148128_1_, p_148128_2_); + GL11.glDisable(GL11.GL_DEPTH_TEST); + byte var18 = 4; + this.func_148136_c(0, this.field_148153_b, 255, 255); + this.func_148136_c(this.field_148154_c, this.field_148158_l, 255, 255); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 0, 1); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glDisable(GL11.GL_TEXTURE_2D); + var16.startDrawingQuads(); + var16.setColorRGBA_I(0, 0); + var16.addVertexWithUV(this.field_148152_e, this.field_148153_b + var18, 0.0D, 0.0D, 1.0D); + var16.addVertexWithUV(this.field_148151_d, this.field_148153_b + var18, 0.0D, 1.0D, 1.0D); + var16.setColorRGBA_I(0, 255); + var16.addVertexWithUV(this.field_148151_d, this.field_148153_b, 0.0D, 1.0D, 0.0D); + var16.addVertexWithUV(this.field_148152_e, this.field_148153_b, 0.0D, 0.0D, 0.0D); + var16.draw(); + var16.startDrawingQuads(); + var16.setColorRGBA_I(0, 255); + var16.addVertexWithUV(this.field_148152_e, this.field_148154_c, 0.0D, 0.0D, 1.0D); + var16.addVertexWithUV(this.field_148151_d, this.field_148154_c, 0.0D, 1.0D, 1.0D); + var16.setColorRGBA_I(0, 0); + var16.addVertexWithUV(this.field_148151_d, this.field_148154_c - var18, 0.0D, 1.0D, 0.0D); + var16.addVertexWithUV(this.field_148152_e, this.field_148154_c - var18, 0.0D, 0.0D, 0.0D); + var16.draw(); + var19 = this.func_148135_f(); + + if (var19 > 0) { + var13 = (this.field_148154_c - this.field_148153_b) * (this.field_148154_c - this.field_148153_b) / this.func_148138_e(); + + if (var13 < 32) { + var13 = 32; + } + + if (var13 > this.field_148154_c - this.field_148153_b - 8) { + var13 = this.field_148154_c - this.field_148153_b - 8; + } + + int var14 = (int)this.field_148169_q * (this.field_148154_c - this.field_148153_b - var13) / var19 + this.field_148153_b; + + if (var14 < this.field_148153_b) { + var14 = this.field_148153_b; + } + + var16.startDrawingQuads(); + var16.setColorRGBA_I(0, 255); + var16.addVertexWithUV(var5, this.field_148154_c, 0.0D, 0.0D, 1.0D); + var16.addVertexWithUV(var6, this.field_148154_c, 0.0D, 1.0D, 1.0D); + var16.addVertexWithUV(var6, this.field_148153_b, 0.0D, 1.0D, 0.0D); + var16.addVertexWithUV(var5, this.field_148153_b, 0.0D, 0.0D, 0.0D); + var16.draw(); + var16.startDrawingQuads(); + var16.setColorRGBA_I(8421504, 255); + var16.addVertexWithUV(var5, var14 + var13, 0.0D, 0.0D, 1.0D); + var16.addVertexWithUV(var6, var14 + var13, 0.0D, 1.0D, 1.0D); + var16.addVertexWithUV(var6, var14, 0.0D, 1.0D, 0.0D); + var16.addVertexWithUV(var5, var14, 0.0D, 0.0D, 0.0D); + var16.draw(); + var16.startDrawingQuads(); + var16.setColorRGBA_I(12632256, 255); + var16.addVertexWithUV(var5, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); + var16.addVertexWithUV(var6 - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); + var16.addVertexWithUV(var6 - 1, var14, 0.0D, 1.0D, 0.0D); + var16.addVertexWithUV(var5, var14, 0.0D, 0.0D, 0.0D); + var16.draw(); + } + + this.func_148142_b(p_148128_1_, p_148128_2_); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public void func_148143_b(boolean p_148143_1_) { + this.field_148164_v = p_148143_1_; + } + + public boolean func_148125_i() { + return this.field_148164_v; + } + + public int func_148139_c() { + return 220; + } + + protected void func_148120_b(int p_148120_1_, int p_148120_2_, int p_148120_3_, int p_148120_4_) { + int var5 = this.getSize(); + Tessellator var6 = Tessellator.instance; + + for (int var7 = 0; var7 < var5; ++var7) { + int var8 = p_148120_2_ + var7 * this.field_148149_f + this.field_148160_j; + int var9 = this.field_148149_f - 4; + + if (var8 <= this.field_148154_c && var8 + var9 >= this.field_148153_b) { + if (this.field_148166_t && this.isSelected(var7)) { + int var10 = this.field_148152_e + (this.field_148155_a / 2 - this.func_148139_c() / 2); + int var11 = this.field_148152_e + this.field_148155_a / 2 + this.func_148139_c() / 2; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + var6.startDrawingQuads(); + var6.setColorOpaque_I(8421504); + var6.addVertexWithUV(var10, var8 + var9 + 2, 0.0D, 0.0D, 1.0D); + var6.addVertexWithUV(var11, var8 + var9 + 2, 0.0D, 1.0D, 1.0D); + var6.addVertexWithUV(var11, var8 - 2, 0.0D, 1.0D, 0.0D); + var6.addVertexWithUV(var10, var8 - 2, 0.0D, 0.0D, 0.0D); + var6.setColorOpaque_I(0); + var6.addVertexWithUV(var10 + 1, var8 + var9 + 1, 0.0D, 0.0D, 1.0D); + var6.addVertexWithUV(var11 - 1, var8 + var9 + 1, 0.0D, 1.0D, 1.0D); + var6.addVertexWithUV(var11 - 1, var8 - 1, 0.0D, 1.0D, 0.0D); + var6.addVertexWithUV(var10 + 1, var8 - 1, 0.0D, 0.0D, 0.0D); + var6.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + this.drawSlot(var7, p_148120_1_, var8, var9, var6, p_148120_3_, p_148120_4_); + } + } + } + + protected int func_148137_d() { + return this.field_148155_a / 2 + 124; + } + + private void func_148136_c(int p_148136_1_, int p_148136_2_, int p_148136_3_, int p_148136_4_) { + Tessellator var5 = Tessellator.instance; + this.field_148161_k.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var6 = 32.0F; + var5.startDrawingQuads(); + var5.setColorRGBA_I(4210752, p_148136_4_); + var5.addVertexWithUV(this.field_148152_e, p_148136_2_, 0.0D, 0.0D, (float)p_148136_2_ / var6); + var5.addVertexWithUV(this.field_148152_e + this.field_148155_a, p_148136_2_, 0.0D, (float)this.field_148155_a / var6, (float)p_148136_2_ / var6); + var5.setColorRGBA_I(4210752, p_148136_3_); + var5.addVertexWithUV(this.field_148152_e + this.field_148155_a, p_148136_1_, 0.0D, (float)this.field_148155_a / var6, (float)p_148136_1_ / var6); + var5.addVertexWithUV(this.field_148152_e, p_148136_1_, 0.0D, 0.0D, (float)p_148136_1_ / var6); + var5.draw(); + } + + public void func_148140_g(int p_148140_1_) { + this.field_148152_e = p_148140_1_; + this.field_148151_d = p_148140_1_ + this.field_148155_a; + } + + public int func_148146_j() { + return this.field_148149_f; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java new file mode 100644 index 0000000..89d7881 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java @@ -0,0 +1,55 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.realms.RealmsScrolledSelectionList; + +public class GuiSlotRealmsProxy extends GuiSlot { + private final RealmsScrolledSelectionList field_154340_k; + + + public GuiSlotRealmsProxy(RealmsScrolledSelectionList p_i1085_1_, int p_i1085_2_, int p_i1085_3_, int p_i1085_4_, int p_i1085_5_, int p_i1085_6_) { + super(Minecraft.getMinecraft(), p_i1085_2_, p_i1085_3_, p_i1085_4_, p_i1085_5_, p_i1085_6_); + this.field_154340_k = p_i1085_1_; + } + + protected int getSize() { + return this.field_154340_k.getItemCount(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) { + this.field_154340_k.selectItem(p_148144_1_, p_148144_2_, p_148144_3_, p_148144_4_); + } + + protected boolean isSelected(int p_148131_1_) { + return this.field_154340_k.isSelectedItem(p_148131_1_); + } + + protected void drawBackground() { + this.field_154340_k.renderBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + this.field_154340_k.renderItem(p_148126_1_, p_148126_2_, p_148126_3_, p_148126_4_, p_148126_6_, p_148126_7_); + } + + public int func_154338_k() { + return super.field_148155_a; + } + + public int func_154339_l() { + return super.field_148162_h; + } + + public int func_154337_m() { + return super.field_148150_g; + } + + protected int func_148138_e() { + return this.field_154340_k.getMaxPosition(); + } + + protected int func_148137_d() { + return this.field_154340_k.getScrollbarPosition(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSnooper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSnooper.java new file mode 100644 index 0000000..066d6a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiSnooper.java @@ -0,0 +1,132 @@ +package net.minecraft.client.gui; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.TreeMap; +import java.util.Map.Entry; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiSnooper extends GuiScreen { + private final GuiScreen field_146608_a; + private final GameSettings field_146603_f; + private final java.util.List field_146604_g = new ArrayList(); + private final java.util.List field_146609_h = new ArrayList(); + private String field_146610_i; + private String[] field_146607_r; + private GuiSnooper.List field_146606_s; + private GuiButton field_146605_t; + + + public GuiSnooper(GuiScreen p_i1061_1_, GameSettings p_i1061_2_) { + this.field_146608_a = p_i1061_1_; + this.field_146603_f = p_i1061_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.field_146610_i = I18n.format("options.snooper.title"); + String var1 = I18n.format("options.snooper.desc"); + ArrayList var2 = new ArrayList(); + Iterator var3 = this.fontRendererObj.listFormattedStringToWidth(var1, this.width - 30).iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + var2.add(var4); + } + + this.field_146607_r = (String[])var2.toArray(new String[0]); + this.field_146604_g.clear(); + this.field_146609_h.clear(); + this.buttonList.add(this.field_146605_t = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.field_146603_f.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.format("gui.done"))); + boolean var6 = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; + Iterator var7 = (new TreeMap(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); + Entry var5; + + while (var7.hasNext()) { + var5 = (Entry)var7.next(); + this.field_146604_g.add((var6 ? "C " : "") + var5.getKey()); + this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)var5.getValue(), this.width - 220)); + } + + if (var6) { + var7 = (new TreeMap(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); + + while (var7.hasNext()) { + var5 = (Entry)var7.next(); + this.field_146604_g.add("S " + var5.getKey()); + this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)var5.getValue(), this.width - 220)); + } + } + + this.field_146606_s = new GuiSnooper.List(); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 2) { + this.field_146603_f.saveOptions(); + this.field_146603_f.saveOptions(); + this.mc.displayGuiScreen(this.field_146608_a); + } + + if (p_146284_1_.id == 1) { + this.field_146603_f.setOptionValue(GameSettings.Options.SNOOPER_ENABLED, 1); + this.field_146605_t.displayString = this.field_146603_f.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.field_146606_s.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, this.field_146610_i, this.width / 2, 8, 16777215); + int var4 = 22; + String[] var5 = this.field_146607_r; + int var6 = var5.length; + + for (int var7 = 0; var7 < var6; ++var7) { + String var8 = var5[var7]; + this.drawCenteredString(this.fontRendererObj, var8, this.width / 2, var4, 8421504); + var4 += this.fontRendererObj.FONT_HEIGHT; + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + class List extends GuiSlot { + + + public List() { + super(GuiSnooper.this.mc, GuiSnooper.this.width, GuiSnooper.this.height, 80, GuiSnooper.this.height - 40, GuiSnooper.this.fontRendererObj.FONT_HEIGHT + 1); + } + + protected int getSize() { + return GuiSnooper.this.field_146604_g.size(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + protected boolean isSelected(int p_148131_1_) { + return false; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + GuiSnooper.this.fontRendererObj.drawString((String)GuiSnooper.this.field_146604_g.get(p_148126_1_), 10, p_148126_3_, 16777215); + GuiSnooper.this.fontRendererObj.drawString((String)GuiSnooper.this.field_146609_h.get(p_148126_1_), 230, p_148126_3_, 16777215); + } + + protected int func_148137_d() { + return this.field_148155_a - 10; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiTextField.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiTextField.java new file mode 100644 index 0000000..71fbd70 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiTextField.java @@ -0,0 +1,555 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ChatAllowedCharacters; +import org.lwjgl.opengl.GL11; + +public class GuiTextField extends Gui { + private final FontRenderer field_146211_a; + private final int field_146209_f; + private final int field_146210_g; + private final int field_146218_h; + private final int field_146219_i; + private String field_146216_j = ""; + private int field_146217_k = 32; + private int field_146214_l; + private boolean field_146215_m = true; + private boolean field_146212_n = true; + private boolean field_146213_o; + private boolean field_146226_p = true; + private int field_146225_q; + private int field_146224_r; + private int field_146223_s; + private int field_146222_t = 14737632; + private int field_146221_u = 7368816; + private boolean field_146220_v = true; + + + public GuiTextField(FontRenderer p_i46392_1_, int p_i46392_2_, int p_i46392_3_, int p_i46392_4_, int p_i46392_5_) { + this.field_146211_a = p_i46392_1_; + this.field_146209_f = p_i46392_2_; + this.field_146210_g = p_i46392_3_; + this.field_146218_h = p_i46392_4_; + this.field_146219_i = p_i46392_5_; + } + + /** + * Increments the cursor counter + */ + public void updateCursorCounter() { + ++this.field_146214_l; + } + + /** + * Sets the text of the textbox + */ + public void setText(String p_146180_1_) { + if (p_146180_1_.length() > this.field_146217_k) { + this.field_146216_j = p_146180_1_.substring(0, this.field_146217_k); + } else { + this.field_146216_j = p_146180_1_; + } + + this.func_146202_e(); + } + + /** + * Returns the contents of the textbox + */ + public String getText() { + return this.field_146216_j; + } + + public String func_146207_c() { + int var1 = this.field_146224_r < this.field_146223_s ? this.field_146224_r : this.field_146223_s; + int var2 = this.field_146224_r < this.field_146223_s ? this.field_146223_s : this.field_146224_r; + return this.field_146216_j.substring(var1, var2); + } + + public void func_146191_b(String p_146191_1_) { + String var2 = ""; + String var3 = ChatAllowedCharacters.filerAllowedCharacters(p_146191_1_); + int var4 = this.field_146224_r < this.field_146223_s ? this.field_146224_r : this.field_146223_s; + int var5 = this.field_146224_r < this.field_146223_s ? this.field_146223_s : this.field_146224_r; + int var6 = this.field_146217_k - this.field_146216_j.length() - (var4 - this.field_146223_s); + boolean var7 = false; + + if (this.field_146216_j.length() > 0) { + var2 = var2 + this.field_146216_j.substring(0, var4); + } + + int var8; + + if (var6 < var3.length()) { + var2 = var2 + var3.substring(0, var6); + var8 = var6; + } else { + var2 = var2 + var3; + var8 = var3.length(); + } + + if (this.field_146216_j.length() > 0 && var5 < this.field_146216_j.length()) { + var2 = var2 + this.field_146216_j.substring(var5); + } + + this.field_146216_j = var2; + this.func_146182_d(var4 - this.field_146223_s + var8); + } + + public void func_146177_a(int p_146177_1_) { + if (this.field_146216_j.length() != 0) { + if (this.field_146223_s != this.field_146224_r) { + this.func_146191_b(""); + } else { + this.func_146175_b(this.func_146187_c(p_146177_1_) - this.field_146224_r); + } + } + } + + public void func_146175_b(int p_146175_1_) { + if (this.field_146216_j.length() != 0) { + if (this.field_146223_s != this.field_146224_r) { + this.func_146191_b(""); + } else { + boolean var2 = p_146175_1_ < 0; + int var3 = var2 ? this.field_146224_r + p_146175_1_ : this.field_146224_r; + int var4 = var2 ? this.field_146224_r : this.field_146224_r + p_146175_1_; + String var5 = ""; + + if (var3 >= 0) { + var5 = this.field_146216_j.substring(0, var3); + } + + if (var4 < this.field_146216_j.length()) { + var5 = var5 + this.field_146216_j.substring(var4); + } + + this.field_146216_j = var5; + + if (var2) { + this.func_146182_d(p_146175_1_); + } + } + } + } + + public int func_146187_c(int p_146187_1_) { + return this.func_146183_a(p_146187_1_, this.func_146198_h()); + } + + public int func_146183_a(int p_146183_1_, int p_146183_2_) { + return this.func_146197_a(p_146183_1_, this.func_146198_h(), true); + } + + public int func_146197_a(int p_146197_1_, int p_146197_2_, boolean p_146197_3_) { + int var4 = p_146197_2_; + boolean var5 = p_146197_1_ < 0; + int var6 = Math.abs(p_146197_1_); + + for (int var7 = 0; var7 < var6; ++var7) { + if (var5) { + while (p_146197_3_ && var4 > 0 && this.field_146216_j.charAt(var4 - 1) == 32) { + --var4; + } + + while (var4 > 0 && this.field_146216_j.charAt(var4 - 1) != 32) { + --var4; + } + } else { + int var8 = this.field_146216_j.length(); + var4 = this.field_146216_j.indexOf(32, var4); + + if (var4 == -1) { + var4 = var8; + } else { + while (p_146197_3_ && var4 < var8 && this.field_146216_j.charAt(var4) == 32) { + ++var4; + } + } + } + } + + return var4; + } + + public void func_146182_d(int p_146182_1_) { + this.func_146190_e(this.field_146223_s + p_146182_1_); + } + + public void func_146190_e(int p_146190_1_) { + this.field_146224_r = p_146190_1_; + int var2 = this.field_146216_j.length(); + + if (this.field_146224_r < 0) { + this.field_146224_r = 0; + } + + if (this.field_146224_r > var2) { + this.field_146224_r = var2; + } + + this.func_146199_i(this.field_146224_r); + } + + public void func_146196_d() { + this.func_146190_e(0); + } + + public void func_146202_e() { + this.func_146190_e(this.field_146216_j.length()); + } + + /** + * Call this method from your GuiScreen to process the keys into the textbox + */ + public boolean keyTyped(char p_146201_1_, int p_146201_2_) { + if (!this.field_146213_o) { + return false; + } else { + switch (p_146201_1_) { + case 1: + this.func_146202_e(); + this.func_146199_i(0); + return true; + + case 3: + GuiScreen.setClipboardString(this.func_146207_c()); + return true; + + case 22: + if (this.field_146226_p) { + this.func_146191_b(GuiScreen.getClipboardString()); + } + + return true; + + case 24: + GuiScreen.setClipboardString(this.func_146207_c()); + + if (this.field_146226_p) { + this.func_146191_b(""); + } + + return true; + + default: + switch (p_146201_2_) { + case 14: + if (GuiScreen.isCtrlKeyDown()) { + if (this.field_146226_p) { + this.func_146177_a(-1); + } + } else if (this.field_146226_p) { + this.func_146175_b(-1); + } + + return true; + + case 199: + if (GuiScreen.isShiftKeyDown()) { + this.func_146199_i(0); + } else { + this.func_146196_d(); + } + + return true; + + case 203: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.func_146199_i(this.func_146183_a(-1, this.func_146186_n())); + } else { + this.func_146199_i(this.func_146186_n() - 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.func_146190_e(this.func_146187_c(-1)); + } else { + this.func_146182_d(-1); + } + + return true; + + case 205: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.func_146199_i(this.func_146183_a(1, this.func_146186_n())); + } else { + this.func_146199_i(this.func_146186_n() + 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.func_146190_e(this.func_146187_c(1)); + } else { + this.func_146182_d(1); + } + + return true; + + case 207: + if (GuiScreen.isShiftKeyDown()) { + this.func_146199_i(this.field_146216_j.length()); + } else { + this.func_146202_e(); + } + + return true; + + case 211: + if (GuiScreen.isCtrlKeyDown()) { + if (this.field_146226_p) { + this.func_146177_a(1); + } + } else if (this.field_146226_p) { + this.func_146175_b(1); + } + + return true; + + default: + if (ChatAllowedCharacters.isAllowedCharacter(p_146201_1_)) { + if (this.field_146226_p) { + this.func_146191_b(Character.toString(p_146201_1_)); + } + + return true; + } else { + return false; + } + } + } + } + } + + /** + * Args: x, y, buttonClicked + */ + public void mouseClicked(int p_146192_1_, int p_146192_2_, int p_146192_3_) { + boolean var4 = p_146192_1_ >= this.field_146209_f && p_146192_1_ < this.field_146209_f + this.field_146218_h && p_146192_2_ >= this.field_146210_g && p_146192_2_ < this.field_146210_g + this.field_146219_i; + + if (this.field_146212_n) { + this.setFocused(var4); + } + + if (this.field_146213_o && p_146192_3_ == 0) { + int var5 = p_146192_1_ - this.field_146209_f; + + if (this.field_146215_m) { + var5 -= 4; + } + + String var6 = this.field_146211_a.trimStringToWidth(this.field_146216_j.substring(this.field_146225_q), this.func_146200_o()); + this.func_146190_e(this.field_146211_a.trimStringToWidth(var6, var5).length() + this.field_146225_q); + } + } + + /** + * Draws the textbox + */ + public void drawTextBox() { + if (this.isVisible()) { + if (this.func_146181_i()) { + drawRect(this.field_146209_f - 1, this.field_146210_g - 1, this.field_146209_f + this.field_146218_h + 1, this.field_146210_g + this.field_146219_i + 1, -6250336); + drawRect(this.field_146209_f, this.field_146210_g, this.field_146209_f + this.field_146218_h, this.field_146210_g + this.field_146219_i, -16777216); + } + + int var1 = this.field_146226_p ? this.field_146222_t : this.field_146221_u; + int var2 = this.field_146224_r - this.field_146225_q; + int var3 = this.field_146223_s - this.field_146225_q; + String var4 = this.field_146211_a.trimStringToWidth(this.field_146216_j.substring(this.field_146225_q), this.func_146200_o()); + boolean var5 = var2 >= 0 && var2 <= var4.length(); + boolean var6 = this.field_146213_o && this.field_146214_l / 6 % 2 == 0 && var5; + int var7 = this.field_146215_m ? this.field_146209_f + 4 : this.field_146209_f; + int var8 = this.field_146215_m ? this.field_146210_g + (this.field_146219_i - 8) / 2 : this.field_146210_g; + int var9 = var7; + + if (var3 > var4.length()) { + var3 = var4.length(); + } + + if (var4.length() > 0) { + String var10 = var5 ? var4.substring(0, var2) : var4; + var9 = this.field_146211_a.drawStringWithShadow(var10, var7, var8, var1); + } + + boolean var13 = this.field_146224_r < this.field_146216_j.length() || this.field_146216_j.length() >= this.func_146208_g(); + int var11 = var9; + + if (!var5) { + var11 = var2 > 0 ? var7 + this.field_146218_h : var7; + } else if (var13) { + var11 = var9 - 1; + --var9; + } + + if (var4.length() > 0 && var5 && var2 < var4.length()) { + this.field_146211_a.drawStringWithShadow(var4.substring(var2), var9, var8, var1); + } + + if (var6) { + if (var13) { + Gui.drawRect(var11, var8 - 1, var11 + 1, var8 + 1 + this.field_146211_a.FONT_HEIGHT, -3092272); + } else { + this.field_146211_a.drawStringWithShadow("_", var11, var8, var1); + } + } + + if (var3 != var2) { + int var12 = var7 + this.field_146211_a.getStringWidth(var4.substring(0, var3)); + this.func_146188_c(var11, var8 - 1, var12 - 1, var8 + 1 + this.field_146211_a.FONT_HEIGHT); + } + } + } + + private void func_146188_c(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) { + int var5; + + if (p_146188_1_ < p_146188_3_) { + var5 = p_146188_1_; + p_146188_1_ = p_146188_3_; + p_146188_3_ = var5; + } + + if (p_146188_2_ < p_146188_4_) { + var5 = p_146188_2_; + p_146188_2_ = p_146188_4_; + p_146188_4_ = var5; + } + + if (p_146188_3_ > this.field_146209_f + this.field_146218_h) { + p_146188_3_ = this.field_146209_f + this.field_146218_h; + } + + if (p_146188_1_ > this.field_146209_f + this.field_146218_h) { + p_146188_1_ = this.field_146209_f + this.field_146218_h; + } + + Tessellator var6 = Tessellator.instance; + GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); + GL11.glLogicOp(GL11.GL_OR_REVERSE); + var6.startDrawingQuads(); + var6.addVertex(p_146188_1_, p_146188_4_, 0.0D); + var6.addVertex(p_146188_3_, p_146188_4_, 0.0D); + var6.addVertex(p_146188_3_, p_146188_2_, 0.0D); + var6.addVertex(p_146188_1_, p_146188_2_, 0.0D); + var6.draw(); + GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + public void setMaxStringLength(int p_146203_1_) { + this.field_146217_k = p_146203_1_; + + if (this.field_146216_j.length() > p_146203_1_) { + this.field_146216_j = this.field_146216_j.substring(0, p_146203_1_); + } + } + + public int func_146208_g() { + return this.field_146217_k; + } + + public int func_146198_h() { + return this.field_146224_r; + } + + public boolean func_146181_i() { + return this.field_146215_m; + } + + public void func_146185_a(boolean p_146185_1_) { + this.field_146215_m = p_146185_1_; + } + + public void func_146193_g(int p_146193_1_) { + this.field_146222_t = p_146193_1_; + } + + public void func_146204_h(int p_146204_1_) { + this.field_146221_u = p_146204_1_; + } + + /** + * Sets focus to this gui element + */ + public void setFocused(boolean p_146195_1_) { + if (p_146195_1_ && !this.field_146213_o) { + this.field_146214_l = 0; + } + + this.field_146213_o = p_146195_1_; + } + + /** + * Getter for the focused field + */ + public boolean isFocused() { + return this.field_146213_o; + } + + public void func_146184_c(boolean p_146184_1_) { + this.field_146226_p = p_146184_1_; + } + + public int func_146186_n() { + return this.field_146223_s; + } + + public int func_146200_o() { + return this.func_146181_i() ? this.field_146218_h - 8 : this.field_146218_h; + } + + public void func_146199_i(int p_146199_1_) { + int var2 = this.field_146216_j.length(); + + if (p_146199_1_ > var2) { + p_146199_1_ = var2; + } + + if (p_146199_1_ < 0) { + p_146199_1_ = 0; + } + + this.field_146223_s = p_146199_1_; + + if (this.field_146211_a != null) { + if (this.field_146225_q > var2) { + this.field_146225_q = var2; + } + + int var3 = this.func_146200_o(); + String var4 = this.field_146211_a.trimStringToWidth(this.field_146216_j.substring(this.field_146225_q), var3); + int var5 = var4.length() + this.field_146225_q; + + if (p_146199_1_ == this.field_146225_q) { + this.field_146225_q -= this.field_146211_a.trimStringToWidth(this.field_146216_j, var3, true).length(); + } + + if (p_146199_1_ > var5) { + this.field_146225_q += p_146199_1_ - var5; + } else if (p_146199_1_ <= this.field_146225_q) { + this.field_146225_q -= this.field_146225_q - p_146199_1_; + } + + if (this.field_146225_q < 0) { + this.field_146225_q = 0; + } + + if (this.field_146225_q > var2) { + this.field_146225_q = var2; + } + } + } + + public void func_146205_d(boolean p_146205_1_) { + this.field_146212_n = p_146205_1_; + } + + public boolean isVisible() { + return this.field_146220_v; + } + + public void setVisible(boolean p_146189_1_) { + this.field_146220_v = p_146189_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiVideoSettings.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiVideoSettings.java new file mode 100644 index 0000000..726626a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiVideoSettings.java @@ -0,0 +1,206 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.GuiAnimationSettingsOF; +import net.minecraft.src.GuiDetailSettingsOF; +import net.minecraft.src.GuiOptionButtonOF; +import net.minecraft.src.GuiOptionSliderOF; +import net.minecraft.src.GuiOtherSettingsOF; +import net.minecraft.src.GuiPerformanceSettingsOF; +import net.minecraft.src.GuiQualitySettingsOF; +import net.minecraft.src.GuiScreenOF; +import net.minecraft.src.Lang; +import net.minecraft.src.TooltipManager; +import net.minecraft.src.TooltipProviderOptions; +import shadersmod.client.GuiShaders; + +public class GuiVideoSettings extends GuiScreenOF { + private GuiScreen field_146498_f; + protected String field_146500_a = "Video Settings"; + private GameSettings field_146499_g; + private static GameSettings.Options[] field_146502_i = new GameSettings.Options[] {GameSettings.Options.GRAPHICS, GameSettings.Options.RENDER_DISTANCE, GameSettings.Options.AMBIENT_OCCLUSION, GameSettings.Options.FRAMERATE_LIMIT, GameSettings.Options.AO_LEVEL, GameSettings.Options.VIEW_BOBBING, GameSettings.Options.GUI_SCALE, GameSettings.Options.ADVANCED_OPENGL, GameSettings.Options.GAMMA, GameSettings.Options.CHUNK_LOADING, GameSettings.Options.DYNAMIC_LIGHTS, GameSettings.Options.DYNAMIC_FOV}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiVideoSettings(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { + this.field_146498_f = par1GuiScreen; + this.field_146499_g = par2GameSettings; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.field_146500_a = I18n.format("options.videoTitle", new Object[0]); + this.buttonList.clear(); + int y; + + for (y = 0; y < field_146502_i.length; ++y) { + GameSettings.Options x = field_146502_i[y]; + + if (x != null) { + int x1 = this.width / 2 - 155 + y % 2 * 160; + int y1 = this.height / 6 + 21 * (y / 2) - 12; + + if (x.getEnumFloat()) { + this.buttonList.add(new GuiOptionSliderOF(x.returnEnumOrdinal(), x1, y1, x)); + } else { + this.buttonList.add(new GuiOptionButtonOF(x.returnEnumOrdinal(), x1, y1, x, this.field_146499_g.getKeyBinding(x))); + } + } + } + + y = this.height / 6 + 21 * (field_146502_i.length / 2) - 12; + boolean var5 = false; + int var6 = this.width / 2 - 155 + 0; + this.buttonList.add(new GuiOptionButton(231, var6, y, Lang.get("of.options.shaders"))); + var6 = this.width / 2 - 155 + 160; + this.buttonList.add(new GuiOptionButton(202, var6, y, Lang.get("of.options.quality"))); + y += 21; + var6 = this.width / 2 - 155 + 0; + this.buttonList.add(new GuiOptionButton(201, var6, y, Lang.get("of.options.details"))); + var6 = this.width / 2 - 155 + 160; + this.buttonList.add(new GuiOptionButton(212, var6, y, Lang.get("of.options.performance"))); + y += 21; + var6 = this.width / 2 - 155 + 0; + this.buttonList.add(new GuiOptionButton(211, var6, y, Lang.get("of.options.animations"))); + var6 = this.width / 2 - 155 + 160; + this.buttonList.add(new GuiOptionButton(222, var6, y, Lang.get("of.options.other"))); + y += 21; + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) { + this.actionPerformed(button, 1); + } + + protected void actionPerformedRightClick(GuiButton button) { + if (button.id == GameSettings.Options.GUI_SCALE.ordinal()) { + this.actionPerformed(button, -1); + } + } + + private void actionPerformed(GuiButton button, int val) { + if (button.enabled) { + if (button.id == GameSettings.Options.CHUNK_LOADING.ordinal()) { + return; + } + int guiScale = this.field_146499_g.guiScale; + + if (button.id < 200 && button instanceof GuiOptionButton) { + this.field_146499_g.setOptionValue(((GuiOptionButton)button).func_146136_c(), val); + button.displayString = this.field_146499_g.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + } + + if (button.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146498_f); + } + + if (this.field_146499_g.guiScale != guiScale) { + ScaledResolution scr = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var4 = scr.getScaledWidth(); + int var5 = scr.getScaledHeight(); + this.setWorldAndResolution(this.mc, var4, var5); + } + + if (button.id == 201) { + this.mc.gameSettings.saveOptions(); + GuiDetailSettingsOF scr1 = new GuiDetailSettingsOF(this, this.field_146499_g); + this.mc.displayGuiScreen(scr1); + } + + if (button.id == 202) { + this.mc.gameSettings.saveOptions(); + GuiQualitySettingsOF scr2 = new GuiQualitySettingsOF(this, this.field_146499_g); + this.mc.displayGuiScreen(scr2); + } + + if (button.id == 211) { + this.mc.gameSettings.saveOptions(); + GuiAnimationSettingsOF scr3 = new GuiAnimationSettingsOF(this, this.field_146499_g); + this.mc.displayGuiScreen(scr3); + } + + if (button.id == 212) { + this.mc.gameSettings.saveOptions(); + GuiPerformanceSettingsOF scr4 = new GuiPerformanceSettingsOF(this, this.field_146499_g); + this.mc.displayGuiScreen(scr4); + } + + if (button.id == 222) { + this.mc.gameSettings.saveOptions(); + GuiOtherSettingsOF scr5 = new GuiOtherSettingsOF(this, this.field_146499_g); + this.mc.displayGuiScreen(scr5); + } + + if (button.id == 231) { + if (Config.isAntialiasing() || Config.isAntialiasingConfigured()) { + Config.showGuiMessage(Lang.get("of.message.shaders.aa1"), Lang.get("of.message.shaders.aa2")); + return; + } + + if (Config.isAnisotropicFiltering()) { + Config.showGuiMessage(Lang.get("of.message.shaders.af1"), Lang.get("of.message.shaders.af2")); + return; + } + +// if (Config.isFastRender()) { +// Config.showGuiMessage(Lang.get("of.message.shaders.fr1"), Lang.get("of.message.shaders.fr2")); +// return; +// } + + if (Config.getGameSettings().anaglyph) { + Config.showGuiMessage(Lang.get("of.message.shaders.an1"), Lang.get("of.message.shaders.an2")); + return; + } + + this.mc.gameSettings.saveOptions(); + GuiShaders scr6 = new GuiShaders(this, this.field_146499_g); + this.mc.displayGuiScreen(scr6); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int x, int y, float z) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146500_a, this.width / 2, 15, 16777215); + String ver = Config.getVersion(); + String ed = "HD_U"; + + if (ed.equals("HD")) { + ver = "OptiFine HD E7"; + } + + if (ed.equals("HD_U")) { + ver = "OptiFine HD E7 Ultra"; + } + + if (ed.equals("L")) { + ver = "OptiFine E7 Light"; + } + + this.drawString(this.fontRendererObj, ver, 2, this.height - 10, 8421504); + String verMc = "Minecraft 1.7.10"; + int lenMc = this.fontRendererObj.getStringWidth(verMc); + this.drawString(this.fontRendererObj, verMc, this.width - lenMc - 2, this.height - 10, 8421504); + super.drawScreen(x, y, z); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } + + public static int getButtonWidth(GuiButton btn) { + return btn.field_146120_f; + } + + public static int getButtonHeight(GuiButton btn) { + return btn.field_146121_g; + } + + public static void drawGradientRect(GuiScreen guiScreen, int left, int top, int right, int bottom, int startColor, int endColor) { + guiScreen.drawGradientRect(left, top, right, bottom, startColor, endColor); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiWinGame.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiWinGame.java new file mode 100644 index 0000000..37a6208 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiWinGame.java @@ -0,0 +1,199 @@ +package net.minecraft.client.gui; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public class GuiWinGame extends GuiScreen { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146576_f = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation field_146577_g = new ResourceLocation("textures/misc/vignette.png"); + private int field_146581_h; + private List field_146582_i; + private int field_146579_r; + private final float field_146578_s = 0.5F; + + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + ++this.field_146581_h; + float var1 = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + + if ((float)this.field_146581_h > var1) { + this.func_146574_g(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (p_73869_2_ == 1) { + this.func_146574_g(); + } + } + + private void func_146574_g() { + this.mc.thePlayer.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN)); + this.mc.displayGuiScreen(null); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return true; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + if (this.field_146582_i == null) { + this.field_146582_i = new ArrayList(); + + try { + String var1 = ""; + String var2 = "" + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + EnumChatFormatting.GREEN + EnumChatFormatting.AQUA; + short var3 = 274; + BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/end.txt")).getInputStream(), Charsets.UTF_8)); + Random var5 = new Random(8124371L); + int var6; + + while ((var1 = var4.readLine()) != null) { + String var7; + String var8; + + for (var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); var1.contains(var2); var1 = var7 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, var5.nextInt(4) + 3) + var8) { + var6 = var1.indexOf(var2); + var7 = var1.substring(0, var6); + var8 = var1.substring(var6 + var2.length()); + } + + this.field_146582_i.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); + this.field_146582_i.add(""); + } + + for (var6 = 0; var6 < 8; ++var6) { + this.field_146582_i.add(""); + } + + var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); + + while ((var1 = var4.readLine()) != null) { + var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); + var1 = var1.replaceAll("\t", " "); + this.field_146582_i.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); + this.field_146582_i.add(""); + } + + this.field_146579_r = this.field_146582_i.size() * 12; + } catch (Exception var9) { + logger.error("Couldn't load credits", var9); + } + } + } + + private void func_146575_b(int p_146575_1_, int p_146575_2_, float p_146575_3_) { + Tessellator var4 = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + var4.startDrawingQuads(); + var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + int var5 = this.width; + float var6 = 0.0F - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float var7 = (float)this.height - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float var8 = 0.015625F; + float var9 = ((float)this.field_146581_h + p_146575_3_ - 0.0F) * 0.02F; + float var10 = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + float var11 = (var10 - 20.0F - ((float)this.field_146581_h + p_146575_3_)) * 0.005F; + + if (var11 < var9) { + var9 = var11; + } + + if (var9 > 1.0F) { + var9 = 1.0F; + } + + var9 *= var9; + var9 = var9 * 96.0F / 255.0F; + var4.setColorOpaque_F(var9, var9, var9); + var4.addVertexWithUV(0.0D, this.height, zLevel, 0.0D, var6 * var8); + var4.addVertexWithUV(var5, this.height, zLevel, (float)var5 * var8, var6 * var8); + var4.addVertexWithUV(var5, 0.0D, zLevel, (float)var5 * var8, var7 * var8); + var4.addVertexWithUV(0.0D, 0.0D, zLevel, 0.0D, var7 * var8); + var4.draw(); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.func_146575_b(p_73863_1_, p_73863_2_, p_73863_3_); + Tessellator var4 = Tessellator.instance; + short var5 = 274; + int var6 = this.width / 2 - var5 / 2; + int var7 = this.height + 50; + float var8 = -((float)this.field_146581_h + p_73863_3_) * this.field_146578_s; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, var8, 0.0F); + this.mc.getTextureManager().bindTexture(field_146576_f); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + drawTexturedModalRect(var6, var7, 0, 0, 155, 44); + drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44); + var4.setColorOpaque_I(16777215); + int var9 = var7 + 200; + int var10; + + for (var10 = 0; var10 < this.field_146582_i.size(); ++var10) { + if (var10 == this.field_146582_i.size() - 1) { + float var11 = (float)var9 + var8 - (float)(this.height / 2 - 6); + + if (var11 < 0.0F) { + GL11.glTranslatef(0.0F, -var11, 0.0F); + } + } + + if ((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) { + String var12 = (String)this.field_146582_i.get(var10); + + if (var12.startsWith("[C]")) { + this.fontRendererObj.drawStringWithShadow(var12.substring(3), var6 + (var5 - this.fontRendererObj.getStringWidth(var12.substring(3))) / 2, var9, 16777215); + } else { + this.fontRendererObj.fontRandom.setSeed((long)var10 * 4238972211L + (long)(this.field_146581_h / 4)); + this.fontRendererObj.drawStringWithShadow(var12, var6, var9, 16777215); + } + } + + var9 += 12; + } + + GL11.glPopMatrix(); + this.mc.getTextureManager().bindTexture(field_146577_g); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); + var4.startDrawingQuads(); + var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + var10 = this.width; + int var13 = this.height; + var4.addVertexWithUV(0.0D, var13, zLevel, 0.0D, 1.0D); + var4.addVertexWithUV(var10, var13, zLevel, 1.0D, 1.0D); + var4.addVertexWithUV(var10, 0.0D, zLevel, 1.0D, 0.0D); + var4.addVertexWithUV(0.0D, 0.0D, zLevel, 0.0D, 0.0D); + var4.draw(); + GL11.glDisable(GL11.GL_BLEND); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiYesNo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiYesNo.java new file mode 100644 index 0000000..42d01b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiYesNo.java @@ -0,0 +1,78 @@ +package net.minecraft.client.gui; + +import java.util.Iterator; +import net.minecraft.client.resources.I18n; + +public class GuiYesNo extends GuiScreen { + protected GuiYesNoCallback field_146355_a; + protected String field_146351_f; + private final String field_146354_r; + protected String field_146352_g; + protected String field_146356_h; + protected int field_146357_i; + private int field_146353_s; + + + public GuiYesNo(GuiYesNoCallback p_i1082_1_, String p_i1082_2_, String p_i1082_3_, int p_i1082_4_) { + this.field_146355_a = p_i1082_1_; + this.field_146351_f = p_i1082_2_; + this.field_146354_r = p_i1082_3_; + this.field_146357_i = p_i1082_4_; + this.field_146352_g = I18n.format("gui.yes"); + this.field_146356_h = I18n.format("gui.no"); + } + + public GuiYesNo(GuiYesNoCallback p_i1083_1_, String p_i1083_2_, String p_i1083_3_, String p_i1083_4_, String p_i1083_5_, int p_i1083_6_) { + this.field_146355_a = p_i1083_1_; + this.field_146351_f = p_i1083_2_; + this.field_146354_r = p_i1083_3_; + this.field_146352_g = p_i1083_4_; + this.field_146356_h = p_i1083_5_; + this.field_146357_i = p_i1083_6_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 155, this.height / 6 + 96, this.field_146352_g)); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.field_146356_h)); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + this.field_146355_a.confirmClicked(p_146284_1_.id == 0, this.field_146357_i); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146351_f, this.width / 2, 70, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146354_r, this.width / 2, 90, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + public void func_146350_a(int p_146350_1_) { + this.field_146353_s = p_146350_1_; + GuiButton var3; + + for (Iterator var2 = this.buttonList.iterator(); var2.hasNext(); var3.enabled = false) { + var3 = (GuiButton)var2.next(); + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + GuiButton var2; + + if (--this.field_146353_s == 0) { + for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) { + var2 = (GuiButton)var1.next(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java new file mode 100644 index 0000000..fe7279c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/GuiYesNoCallback.java @@ -0,0 +1,5 @@ +package net.minecraft.client.gui; + +public interface GuiYesNoCallback { + void confirmClicked(boolean p_73878_1_, int p_73878_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/IProgressMeter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/IProgressMeter.java new file mode 100644 index 0000000..96f5e9a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/IProgressMeter.java @@ -0,0 +1,7 @@ +package net.minecraft.client.gui; + +public interface IProgressMeter { + String[] field_146510_b_ = new String[] {"oooooo", "Oooooo", "oOoooo", "ooOooo", "oooOoo", "ooooOo", "oooooO"}; + + void func_146509_g(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/MapItemRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/MapItemRenderer.java new file mode 100644 index 0000000..43c838c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/MapItemRenderer.java @@ -0,0 +1,142 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import org.lwjgl.opengl.GL11; + +public class MapItemRenderer { + private static final ResourceLocation field_148253_a = new ResourceLocation("textures/map/map_icons.png"); + private final TextureManager field_148251_b; + private final Map field_148252_c = Maps.newHashMap(); + + + public MapItemRenderer(TextureManager p_i45009_1_) { + this.field_148251_b = p_i45009_1_; + } + + public void func_148246_a(MapData p_148246_1_) { + this.func_148248_b(p_148246_1_).func_148236_a(); + } + + public void func_148250_a(MapData p_148250_1_, boolean p_148250_2_) { + this.func_148248_b(p_148250_1_).func_148237_a(p_148250_2_); + } + + private MapItemRenderer.Instance func_148248_b(MapData p_148248_1_) { + MapItemRenderer.Instance var2 = (MapItemRenderer.Instance)this.field_148252_c.get(p_148248_1_.mapName); + + if (var2 == null) { + var2 = new MapItemRenderer.Instance(p_148248_1_, null); + this.field_148252_c.put(p_148248_1_.mapName, var2); + } + + return var2; + } + + public void func_148249_a() { + Iterator var1 = this.field_148252_c.values().iterator(); + + while (var1.hasNext()) { + MapItemRenderer.Instance var2 = (MapItemRenderer.Instance)var1.next(); + this.field_148251_b.func_147645_c(var2.field_148240_d); + } + + this.field_148252_c.clear(); + } + + class Instance { + private final MapData field_148242_b; + private final DynamicTexture field_148243_c; + private final ResourceLocation field_148240_d; + private final int[] field_148241_e; + + + private Instance(MapData p_i45007_2_) { + this.field_148242_b = p_i45007_2_; + this.field_148243_c = new DynamicTexture(128, 128); + this.field_148241_e = this.field_148243_c.getTextureData(); + this.field_148240_d = MapItemRenderer.this.field_148251_b.getDynamicTextureLocation("map/" + p_i45007_2_.mapName, this.field_148243_c); + + for (int var3 = 0; var3 < this.field_148241_e.length; ++var3) { + this.field_148241_e[var3] = 0; + } + } + + private void func_148236_a() { + for (int var1 = 0; var1 < 16384; ++var1) { + int var2 = this.field_148242_b.colors[var1] & 255; + + if (var2 / 4 == 0) { + this.field_148241_e[var1] = (var1 + var1 / 128 & 1) * 8 + 16 << 24; + } else { + this.field_148241_e[var1] = MapColor.mapColorArray[var2 / 4].func_151643_b(var2 & 3); + } + } + + this.field_148243_c.updateDynamicTexture(); + } + + private void func_148237_a(boolean p_148237_1_) { + byte var2 = 0; + byte var3 = 0; + Tessellator var4 = Tessellator.instance; + float var5 = 0.0F; + MapItemRenderer.this.field_148251_b.bindTexture(this.field_148240_d); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(1, 771, 0, 1); + GL11.glDisable(GL11.GL_ALPHA_TEST); + var4.startDrawingQuads(); + var4.addVertexWithUV((float)(var2 + 0) + var5, (float)(var3 + 128) - var5, -0.009999999776482582D, 0.0D, 1.0D); + var4.addVertexWithUV((float)(var2 + 128) - var5, (float)(var3 + 128) - var5, -0.009999999776482582D, 1.0D, 1.0D); + var4.addVertexWithUV((float)(var2 + 128) - var5, (float)(var3 + 0) + var5, -0.009999999776482582D, 1.0D, 0.0D); + var4.addVertexWithUV((float)(var2 + 0) + var5, (float)(var3 + 0) + var5, -0.009999999776482582D, 0.0D, 0.0D); + var4.draw(); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + MapItemRenderer.this.field_148251_b.bindTexture(MapItemRenderer.field_148253_a); + int var6 = 0; + Iterator var7 = this.field_148242_b.playersVisibleOnMap.values().iterator(); + + while (var7.hasNext()) { + MapData.MapCoord var8 = (MapData.MapCoord)var7.next(); + + if (!p_148237_1_ || var8.iconSize == 1) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)var2 + (float)var8.centerX / 2.0F + 64.0F, (float)var3 + (float)var8.centerZ / 2.0F + 64.0F, -0.02F); + GL11.glRotatef((float)(var8.iconRotation * 360) / 16.0F, 0.0F, 0.0F, 1.0F); + GL11.glScalef(4.0F, 4.0F, 3.0F); + GL11.glTranslatef(-0.125F, 0.125F, 0.0F); + float var9 = (float)(var8.iconSize % 4 + 0) / 4.0F; + float var10 = (float)(var8.iconSize / 4 + 0) / 4.0F; + float var11 = (float)(var8.iconSize % 4 + 1) / 4.0F; + float var12 = (float)(var8.iconSize / 4 + 1) / 4.0F; + var4.startDrawingQuads(); + var4.addVertexWithUV(-1.0D, 1.0D, (float)var6 * 0.001F, var9, var10); + var4.addVertexWithUV(1.0D, 1.0D, (float)var6 * 0.001F, var11, var10); + var4.addVertexWithUV(1.0D, -1.0D, (float)var6 * 0.001F, var11, var12); + var4.addVertexWithUV(-1.0D, -1.0D, (float)var6 * 0.001F, var9, var12); + var4.draw(); + GL11.glPopMatrix(); + ++var6; + } + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 0.0F, -0.04F); + GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + Instance(MapData p_i45008_2_, Object p_i45008_3_) { + this(p_i45008_2_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ScaledResolution.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ScaledResolution.java new file mode 100644 index 0000000..73a38b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ScaledResolution.java @@ -0,0 +1,62 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.MathHelper; + +public class ScaledResolution { + private int scaledWidth; + private int scaledHeight; + private double scaledWidthD; + private double scaledHeightD; + private int scaleFactor; + + + public ScaledResolution(Minecraft p_i46324_1_, int p_i46324_2_, int p_i46324_3_) { + this.scaledWidth = p_i46324_2_; + this.scaledHeight = p_i46324_3_; + this.scaleFactor = 1; + boolean var4 = p_i46324_1_.func_152349_b(); + int var5 = p_i46324_1_.gameSettings.guiScale; + + if (var5 == 0) { + var5 = 1000; + } + + while (this.scaleFactor < var5 && this.scaledWidth / (this.scaleFactor + 1) >= 320 && this.scaledHeight / (this.scaleFactor + 1) >= 240) { + ++this.scaleFactor; + } + + if (var4 && this.scaleFactor % 2 != 0 && this.scaleFactor != 1) { + --this.scaleFactor; + } + + this.scaledWidthD = (double)this.scaledWidth / (double)this.scaleFactor; + this.scaledHeightD = (double)this.scaledHeight / (double)this.scaleFactor; + this.scaledWidth = MathHelper.ceiling_double_int(this.scaledWidthD); + this.scaledHeight = MathHelper.ceiling_double_int(this.scaledHeightD); + } + + public ScaledResolution(Minecraft minecraft) { + + } + + public int getScaledWidth() { + return this.scaledWidth; + } + + public int getScaledHeight() { + return this.scaledHeight; + } + + public double getScaledWidth_double() { + return this.scaledWidthD; + } + + public double getScaledHeight_double() { + return this.scaledHeightD; + } + + public int getScaleFactor() { + return this.scaleFactor; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java new file mode 100644 index 0000000..e5c7562 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ScreenChatOptions.java @@ -0,0 +1,92 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class ScreenChatOptions extends GuiScreen { + private static final GameSettings.Options[] field_146399_a = new GameSettings.Options[] {GameSettings.Options.CHAT_VISIBILITY, GameSettings.Options.CHAT_COLOR, GameSettings.Options.CHAT_LINKS, GameSettings.Options.CHAT_OPACITY, GameSettings.Options.CHAT_LINKS_PROMPT, GameSettings.Options.CHAT_SCALE, GameSettings.Options.CHAT_HEIGHT_FOCUSED, GameSettings.Options.CHAT_HEIGHT_UNFOCUSED, GameSettings.Options.CHAT_WIDTH}; + private static final GameSettings.Options[] field_146395_f = new GameSettings.Options[] {GameSettings.Options.SHOW_CAPE}; + private final GuiScreen field_146396_g; + private final GameSettings field_146400_h; + private String field_146401_i; + private String field_146398_r; + private int field_146397_s; + + + public ScreenChatOptions(GuiScreen p_i1023_1_, GameSettings p_i1023_2_) { + this.field_146396_g = p_i1023_1_; + this.field_146400_h = p_i1023_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + int var1 = 0; + this.field_146401_i = I18n.format("options.chat.title"); + this.field_146398_r = I18n.format("options.multiplayer.title"); + GameSettings.Options[] var2 = field_146399_a; + int var3 = var2.length; + int var4; + GameSettings.Options var5; + + for (var4 = 0; var4 < var3; ++var4) { + var5 = var2[var4]; + + if (var5.getEnumFloat()) { + this.buttonList.add(new GuiOptionSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5)); + } else { + this.buttonList.add(new GuiOptionButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.field_146400_h.getKeyBinding(var5))); + } + + ++var1; + } + + if (var1 % 2 == 1) { + ++var1; + } + + this.field_146397_s = this.height / 6 + 24 * (var1 >> 1); + var1 += 2; + var2 = field_146395_f; + var3 = var2.length; + + for (var4 = 0; var4 < var3; ++var4) { + var5 = var2[var4]; + + if (var5.getEnumFloat()) { + this.buttonList.add(new GuiOptionSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5)); + } else { + this.buttonList.add(new GuiOptionButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.field_146400_h.getKeyBinding(var5))); + } + + ++var1; + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done"))); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id < 100 && p_146284_1_ instanceof GuiOptionButton) { + this.field_146400_h.setOptionValue(((GuiOptionButton)p_146284_1_).func_146136_c(), 1); + p_146284_1_.displayString = this.field_146400_h.getKeyBinding(GameSettings.Options.getEnumOptions(p_146284_1_.id)); + } + + if (p_146284_1_.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146396_g); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146401_i, this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146398_r, this.width / 2, this.field_146397_s + 7, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryLanDetected.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryLanDetected.java new file mode 100644 index 0000000..e4e374d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryLanDetected.java @@ -0,0 +1,48 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.LanServerDetector; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; + +public class ServerListEntryLanDetected implements GuiListExtended.IGuiListEntry { + private final GuiMultiplayer field_148292_c; + protected final Minecraft field_148293_a; + protected final LanServerDetector.LanServer field_148291_b; + private long field_148290_d = 0L; + + + protected ServerListEntryLanDetected(GuiMultiplayer p_i45046_1_, LanServerDetector.LanServer p_i45046_2_) { + this.field_148292_c = p_i45046_1_; + this.field_148291_b = p_i45046_2_; + this.field_148293_a = Minecraft.getMinecraft(); + } + + public void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) { + this.field_148293_a.fontRenderer.drawString(I18n.format("lanServer.title"), p_148279_2_ + 32 + 3, p_148279_3_ + 1, 16777215); + this.field_148293_a.fontRenderer.drawString(this.field_148291_b.getServerMotd(), p_148279_2_ + 32 + 3, p_148279_3_ + 12, 8421504); + + if (this.field_148293_a.gameSettings.hideServerAddress) { + this.field_148293_a.fontRenderer.drawString(I18n.format("selectServer.hiddenAddress"), p_148279_2_ + 32 + 3, p_148279_3_ + 12 + 11, 3158064); + } else { + this.field_148293_a.fontRenderer.drawString(this.field_148291_b.getServerIpPort(), p_148279_2_ + 32 + 3, p_148279_3_ + 12 + 11, 3158064); + } + } + + public boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + this.field_148292_c.func_146790_a(p_148278_1_); + + if (Minecraft.getSystemTime() - this.field_148290_d < 250L) { + this.field_148292_c.func_146796_h(); + } + + this.field_148290_d = Minecraft.getSystemTime(); + return false; + } + + public void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} + + public LanServerDetector.LanServer func_148289_a() { + return this.field_148291_b; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryLanScan.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryLanScan.java new file mode 100644 index 0000000..2a08bcd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryLanScan.java @@ -0,0 +1,39 @@ +package net.minecraft.client.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; + +public class ServerListEntryLanScan implements GuiListExtended.IGuiListEntry { + private final Minecraft field_148288_a = Minecraft.getMinecraft(); + + + public void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) { + int var10 = p_148279_3_ + p_148279_5_ / 2 - this.field_148288_a.fontRenderer.FONT_HEIGHT / 2; + this.field_148288_a.fontRenderer.drawString(I18n.format("lanServer.scanning"), this.field_148288_a.currentScreen.width / 2 - this.field_148288_a.fontRenderer.getStringWidth(I18n.format("lanServer.scanning")) / 2, var10, 16777215); + String var11; + + switch ((int)(Minecraft.getSystemTime() / 300L % 4L)) { + case 0: + default: + var11 = "O o o"; + break; + + case 1: + case 3: + var11 = "o O o"; + break; + + case 2: + var11 = "o o O"; + } + + this.field_148288_a.fontRenderer.drawString(var11, this.field_148288_a.currentScreen.width / 2 - this.field_148288_a.fontRenderer.getStringWidth(var11) / 2, var10 + this.field_148288_a.fontRenderer.FONT_HEIGHT, 8421504); + } + + public boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + return false; + } + + public void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java new file mode 100644 index 0000000..d281ec8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerListEntryNormal.java @@ -0,0 +1,293 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.ui.mainmenu.LunarClientLogoElement; +import com.cheatbreaker.client.ui.mainmenu.LunarNetworkLogoElement; +import com.cheatbreaker.client.util.GlStateManager; +import com.google.common.base.Charsets; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import java.awt.image.BufferedImage; +import java.net.UnknownHostException; +import java.util.List; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry { + private static final ResourceLocation SERVER_SELECTION_BUTTONS = new ResourceLocation("textures/gui/resource_packs.png"); + private static final ResourceLocation UNKNOWN_SERVER = new ResourceLocation("textures/misc/unknown_pack.png"); + private static final Logger logger = LogManager.getLogger(); + private static final ThreadPoolExecutor field_148302_b = new ScheduledThreadPoolExecutor(5, (new ThreadFactoryBuilder()).setNameFormat("Server Pinger #%d").setDaemon(true).build()); + private final GuiMultiplayer field_148303_c; + private final Minecraft field_148300_d; + private final ServerData field_148301_e; + private long field_148298_f; + private String field_148299_g; + private DynamicTexture field_148305_h; + private final ResourceLocation field_148306_i; + private LunarNetworkLogoElement lunarNetworkLogo; + private final LunarClientLogoElement lunarClientLogo = new LunarClientLogoElement(); + + + protected ServerListEntryNormal(GuiMultiplayer p_i45048_1_, ServerData p_i45048_2_) { + this.field_148303_c = p_i45048_1_; + this.field_148301_e = p_i45048_2_; + this.field_148300_d = Minecraft.getMinecraft(); + this.field_148306_i = new ResourceLocation("servers/" + p_i45048_2_.serverIP + "/icon"); + this.field_148305_h = (DynamicTexture)this.field_148300_d.getTextureManager().getTexture(this.field_148306_i); + if (p_i45048_2_.serverIP.toLowerCase().endsWith("lunar.gg")) { + this.lunarNetworkLogo = new LunarNetworkLogoElement(); + } + } + + public void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) { + if (!this.field_148301_e.field_78841_f) { + this.field_148301_e.field_78841_f = true; + this.field_148301_e.pingToServer = -2L; + this.field_148301_e.serverMOTD = ""; + this.field_148301_e.populationInfo = ""; + field_148302_b.submit(new Runnable() { + + public void run() { + try { + ServerListEntryNormal.this.field_148303_c.func_146789_i().func_147224_a(ServerListEntryNormal.this.field_148301_e); + } catch (UnknownHostException var2) { + ServerListEntryNormal.this.field_148301_e.pingToServer = -1L; + ServerListEntryNormal.this.field_148301_e.serverMOTD = EnumChatFormatting.DARK_RED + "Can't resolve hostname"; + } catch (Exception var3) { + ServerListEntryNormal.this.field_148301_e.pingToServer = -1L; + ServerListEntryNormal.this.field_148301_e.serverMOTD = EnumChatFormatting.DARK_RED + "Can't connect to server."; + } + } + }); + } + + GL11.glColor4f(0.2351064f * 3.6153846f, 1.8619047f * 0.45652175f, 0.22500001f * 3.7777777f, 1.0f); + if (this.field_148301_e.isCheatBreakerServer()) { + float f = 16; + float f2 = 8; + float f3 = 0.0f; + float f4 = 0.0f; + float f5 = p_148279_2_ - 20; + float f6 = p_148279_3_ + 14; + GL11.glEnable(3042); + Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("client/icons/cb.png")); + GL11.glBegin(7); + GL11.glTexCoord2d(f3 / (float) 5, f4 / (float) 5); + GL11.glVertex2d(f5, f6); + GL11.glTexCoord2d(f3 / (float) 5, (f4 + (float) 5) / (float) 5); + GL11.glVertex2d(f5, f6 + f2); + GL11.glTexCoord2d((f3 + (float) 5) / (float) 5, (f4 + (float) 5) / (float) 5); + GL11.glVertex2d(f5 + f, f6 + f2); + GL11.glTexCoord2d((f3 + (float) 5) / (float) 5, f4 / (float) 5); + GL11.glVertex2d(f5 + f, f6); + GL11.glEnd(); + GL11.glDisable(3042); + } + if (this.field_148301_e.lunarServer) { + this.lunarClientLogo.setElementSize(p_148279_2_ - 19.5f, p_148279_3_ + 10, 15.0f, 13.71f); + this.lunarClientLogo.drawElementHover(0.0f, 0.0f, true); + } + + boolean var10 = this.field_148301_e.version > 5; + boolean var11 = this.field_148301_e.version < 5; + boolean var12 = var10 || var11; + this.field_148300_d.fontRenderer.drawString(this.field_148301_e.serverName, p_148279_2_ + 32 + 3, p_148279_3_ + 1, 16777215); + List var13 = this.field_148300_d.fontRenderer.listFormattedStringToWidth(this.field_148301_e.serverMOTD, p_148279_4_ - 32 - 2); + + for (int var14 = 0; var14 < Math.min(var13.size(), 2); ++var14) { + this.field_148300_d.fontRenderer.drawString((String)var13.get(var14), p_148279_2_ + 32 + 3, p_148279_3_ + 12 + this.field_148300_d.fontRenderer.FONT_HEIGHT * var14, 8421504); + } + + String var22 = var12 ? EnumChatFormatting.DARK_RED + this.field_148301_e.gameVersion : this.field_148301_e.populationInfo; + int var15 = this.field_148300_d.fontRenderer.getStringWidth(var22); + this.field_148300_d.fontRenderer.drawString(var22, p_148279_2_ + p_148279_4_ - var15 - 15 - 2, p_148279_3_ + 1, 8421504); + byte var16 = 0; + String var18 = null; + int var17; + String var19; + + if (var12) { + var17 = 5; + var19 = var10 ? "Client out of date!" : "Server out of date!"; + var18 = this.field_148301_e.playerList; + } else if (this.field_148301_e.field_78841_f && this.field_148301_e.pingToServer != -2L) { + if (this.field_148301_e.pingToServer < 0L) { + var17 = 5; + } else if (this.field_148301_e.pingToServer < 150L) { + var17 = 0; + } else if (this.field_148301_e.pingToServer < 300L) { + var17 = 1; + } else if (this.field_148301_e.pingToServer < 600L) { + var17 = 2; + } else if (this.field_148301_e.pingToServer < 1000L) { + var17 = 3; + } else { + var17 = 4; + } + + if (this.field_148301_e.pingToServer < 0L) { + var19 = "(no connection)"; + } else { + var19 = this.field_148301_e.pingToServer + "ms"; + var18 = this.field_148301_e.playerList; + } + } else { + var16 = 1; + var17 = (int)(Minecraft.getSystemTime() / 100L + (long)(p_148279_1_ * 2) & 7L); + + if (var17 > 4) { + var17 = 8 - var17; + } + + var19 = "Pinging..."; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_148300_d.getTextureManager().bindTexture(Gui.icons); + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_ + p_148279_4_ - 15, p_148279_3_, (float)(var16 * 10), (float)(176 + var17 * 8), 10, 8, 256.0F, 256.0F); + + if (this.field_148301_e.getBase64EncodedIconData() != null && !this.field_148301_e.getBase64EncodedIconData().equals(this.field_148299_g)) { + this.field_148299_g = this.field_148301_e.getBase64EncodedIconData(); + this.func_148297_b(); + this.field_148303_c.getServerList().saveServerList(); + } + + if (this.lunarNetworkLogo != null) { + this.lunarNetworkLogo.setElementSize(p_148279_2_, p_148279_3_, 32.0f, 29.5f); + this.lunarNetworkLogo.drawElementHover(0.0f, 0.0f, true); + } else { + if (this.field_148305_h != null) { + this.field_148300_d.getTextureManager().bindTexture(this.field_148306_i); + } else { + this.field_148300_d.getTextureManager().bindTexture(UNKNOWN_SERVER); + } + GlStateManager.enableBlend(); + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 0.0f, 0.0f, 32, 32, 32.0F, 32.0F); + GlStateManager.disableBlend(); + } + + int var20 = p_148279_7_ - p_148279_2_; + int var21 = p_148279_8_ - p_148279_3_; + + if (var20 >= p_148279_4_ - 15 && var20 <= p_148279_4_ - 5 && var21 >= 0 && var21 <= 8) { + this.field_148303_c.writeStringToBuffer(var19); + } else if (var20 >= p_148279_4_ - var15 - 15 - 2 && var20 <= p_148279_4_ - 15 - 2 && var21 >= 0 && var21 <= 8) { + this.field_148303_c.writeStringToBuffer(var18); + } + Minecraft minecraft = Minecraft.getMinecraft(); + if (minecraft.gameSettings.touchscreen || p_148279_9_) { + minecraft.getTextureManager().bindTexture(SERVER_SELECTION_BUTTONS); + Gui.drawRect(p_148279_2_, p_148279_3_, p_148279_2_ + 32, p_148279_3_ + 32, -1601138544); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + int n13 = p_148279_7_ - p_148279_2_; + int n14 = p_148279_8_ - p_148279_3_; + boolean bl5 = this.field_148303_c.IIIIllIIllIIIIllIllIIIlIl(this); + boolean bl6 = this.field_148303_c.lIIIIIIIIIlIllIIllIlIIlIl(this); + boolean bl7 = bl5 || bl6; + if (n13 < (bl7 ? 16 : 32)) { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_ - (bl7 ? 6 : 0), p_148279_3_, 0.0f, 32, 32, 32, 256, 256); + } else { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_ - (bl7 ? 6 : 0), p_148279_3_, 0.0f, 0.0f, 32, 32, 256, 256); + } + if (bl5) { + if (n13 < 32 && n13 > 16 && n14 < 16) { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 96, 32, 32, 32, 256, 256); + } else { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 96, 0.0f, 32, 32, 256, 256); + } + } + if (bl6) { + if (n13 < 32 && n13 > 16 && n14 > 16) { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 64, 32, 32, 32, 256, 256); + } else { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 64, 0.0f, 32, 32, 256, 256); + } + } + } + } + + private void func_148297_b() { + if (this.field_148301_e.getBase64EncodedIconData() == null) { + this.field_148300_d.getTextureManager().func_147645_c(this.field_148306_i); + this.field_148305_h = null; + } else { + ByteBuf var2 = Unpooled.copiedBuffer(this.field_148301_e.getBase64EncodedIconData(), Charsets.UTF_8); + ByteBuf var3 = Base64.decode(var2); + BufferedImage var1; + label74: { + try { + var1 = ImageIO.read(new ByteBufInputStream(var3)); + Validate.validState(var1.getWidth() == 64, "Must be 64 pixels wide"); + Validate.validState(var1.getHeight() == 64, "Must be 64 pixels high"); + break label74; + } catch (Exception var8) { + logger.error("Invalid icon for server " + this.field_148301_e.serverName + " (" + this.field_148301_e.serverIP + ")", var8); + this.field_148301_e.setBase64EncodedIconData(null); + } + finally { + var2.release(); + var3.release(); + } + + return; + } + + if (this.field_148305_h == null) { + this.field_148305_h = new DynamicTexture(var1.getWidth(), var1.getHeight()); + this.field_148300_d.getTextureManager().loadTexture(this.field_148306_i, this.field_148305_h); + } + + var1.getRGB(0, 0, var1.getWidth(), var1.getHeight(), this.field_148305_h.getTextureData(), 0, var1.getWidth()); + this.field_148305_h.updateDynamicTexture(); + } + } + + public boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + this.field_148303_c.func_146790_a(p_148278_1_); + + if (Minecraft.getSystemTime() - this.field_148298_f < 250L) { + this.field_148303_c.func_146796_h(); + } + + this.field_148298_f = Minecraft.getSystemTime(); + Minecraft minecraft = Minecraft.getMinecraft(); + boolean bl2 = this.field_148303_c.IIIIllIIllIIIIllIllIIIlIl(this); + boolean bl3 = this.field_148303_c.lIIIIIIIIIlIllIIllIlIIlIl(this); + boolean bl = bl2 || bl3; + if (p_148278_5_ <= 32) { + if (p_148278_5_ < (bl ? 16 : 32)) { + this.field_148303_c.lIIIIlIIllIIlIIlIIIlIIllI(this); + return true; + } + if (p_148278_5_ > 16 && p_148278_6_ < 16 && bl2) { + this.field_148303_c.IlllIIIlIlllIllIlIIlllIlI(this); + return true; + } + if (p_148278_5_ > 16 && p_148278_6_ > 16 && bl3) { + this.field_148303_c.IIIIllIlIIIllIlllIlllllIl(this); + return true; + } + } + return false; + } + + public void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} + + public ServerData func_148296_a() { + return this.field_148301_e; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerSelectionList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerSelectionList.java new file mode 100644 index 0000000..ada0916 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/ServerSelectionList.java @@ -0,0 +1,99 @@ +package net.minecraft.client.gui; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.util.render.serverlist.ServerListEntryPinned; +import com.google.common.collect.Lists; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.network.LanServerDetector; + +import java.util.Iterator; +import java.util.List; + +public class ServerSelectionList extends GuiListExtended { + private final GuiMultiplayer field_148200_k; + private final List field_148198_l = Lists.newArrayList(); + private final List field_148199_m = Lists.newArrayList(); + private final GuiListExtended.IGuiListEntry field_148196_n = new ServerListEntryLanScan(); + private int field_148197_o = -1; + + public int lIIIIlIIllIIlIIlIIIlIIllI(ServerListEntryNormal serverListEntryNormal) { + if (this.field_148198_l.contains(serverListEntryNormal)) { + return this.field_148198_l.indexOf(serverListEntryNormal); + } + if (this.field_148199_m.contains(serverListEntryNormal)) { + return this.field_148199_m.indexOf(serverListEntryNormal); + } + return 0; + } + + public ServerSelectionList(GuiMultiplayer p_i45049_1_, Minecraft p_i45049_2_, int p_i45049_3_, int p_i45049_4_, int p_i45049_5_, int p_i45049_6_, int p_i45049_7_) { + super(p_i45049_2_, p_i45049_3_, p_i45049_4_, p_i45049_5_, p_i45049_6_, p_i45049_7_); + this.field_148200_k = p_i45049_1_; + } + + public GuiListExtended.IGuiListEntry func_148180_b(int p_148180_1_) { + if (p_148180_1_ < this.field_148198_l.size()) { + return (GuiListExtended.IGuiListEntry)this.field_148198_l.get(p_148180_1_); + } else { + p_148180_1_ -= this.field_148198_l.size(); + + if (p_148180_1_ == 0) { + return this.field_148196_n; + } else { + --p_148180_1_; + return (GuiListExtended.IGuiListEntry)this.field_148199_m.get(p_148180_1_); + } + } + } + + protected int getSize() { + return this.field_148198_l.size() + 1 + this.field_148199_m.size(); + } + + public void func_148192_c(int p_148192_1_) { + this.field_148197_o = p_148192_1_; + } + + protected boolean isSelected(int p_148131_1_) { + return p_148131_1_ == this.field_148197_o; + } + + public int func_148193_k() { + return this.field_148197_o; + } + + public void func_148195_a(ServerList p_148195_1_) { + this.field_148198_l.clear(); + for (int i = 0; i < p_148195_1_.countServers(); ++i) { + ServerData serverData = p_148195_1_.getServerData(i); + if (serverData.dontSave) { + this.field_148198_l.add(new ServerListEntryPinned(this.field_148200_k, serverData)); + continue; + } else if (!CheatBreaker.getInstance().getGlobalSettings().getPinnedServers().stream().anyMatch((var1x) -> { + return var1x[1].equalsIgnoreCase(serverData.serverIP); + })) { + this.field_148198_l.add(new ServerListEntryNormal(this.field_148200_k, serverData)); + } + } + } + + public void func_148194_a(List p_148194_1_) { + this.field_148199_m.clear(); + Iterator var2 = p_148194_1_.iterator(); + + while (var2.hasNext()) { + LanServerDetector.LanServer var3 = (LanServerDetector.LanServer)var2.next(); + this.field_148199_m.add(new ServerListEntryLanDetected(this.field_148200_k, var3)); + } + } + + protected int func_148137_d() { + return super.func_148137_d() + 30; + } + + public int func_148139_c() { + return super.func_148139_c() + 85; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java new file mode 100644 index 0000000..be1088f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiAchievement.java @@ -0,0 +1,131 @@ +package net.minecraft.client.gui.achievement; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.stats.Achievement; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiAchievement extends Gui { + private static final ResourceLocation field_146261_a = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + private final Minecraft field_146259_f; + private int field_146260_g; + private int field_146267_h; + private String field_146268_i; + private String field_146265_j; + private Achievement field_146266_k; + private long field_146263_l; + private final RenderItem field_146264_m; + private boolean field_146262_n; + + + public GuiAchievement(Minecraft p_i1063_1_) { + this.field_146259_f = p_i1063_1_; + this.field_146264_m = new RenderItem(); + } + + public void func_146256_a(Achievement p_146256_1_) { + this.field_146268_i = I18n.format("achievement.get"); + this.field_146265_j = p_146256_1_.func_150951_e().getUnformattedText(); + this.field_146263_l = Minecraft.getSystemTime(); + this.field_146266_k = p_146256_1_; + this.field_146262_n = false; + } + + public void func_146255_b(Achievement p_146255_1_) { + this.field_146268_i = p_146255_1_.func_150951_e().getUnformattedText(); + this.field_146265_j = p_146255_1_.getDescription(); + this.field_146263_l = Minecraft.getSystemTime() + 2500L; + this.field_146266_k = p_146255_1_; + this.field_146262_n = true; + } + + private void func_146258_c() { + GL11.glViewport(0, 0, this.field_146259_f.displayWidth, this.field_146259_f.displayHeight); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + this.field_146260_g = this.field_146259_f.displayWidth; + this.field_146267_h = this.field_146259_f.displayHeight; + ScaledResolution var1 = new ScaledResolution(this.field_146259_f, this.field_146259_f.displayWidth, this.field_146259_f.displayHeight); + this.field_146260_g = var1.getScaledWidth(); + this.field_146267_h = var1.getScaledHeight(); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, this.field_146260_g, this.field_146267_h, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } + + public void func_146254_a() { + if (this.field_146266_k != null && this.field_146263_l != 0L && Minecraft.getMinecraft().thePlayer != null && (Boolean) CheatBreaker.getInstance().getGlobalSettings().achievements.getValue()) { + double var1 = (double)(Minecraft.getSystemTime() - this.field_146263_l) / 3000.0D; + + if (!this.field_146262_n) { + if (var1 < 0.0D || var1 > 1.0D) { + this.field_146263_l = 0L; + return; + } + } else if (var1 > 0.5D) { + var1 = 0.5D; + } + + this.func_146258_c(); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + double var3 = var1 * 2.0D; + + if (var3 > 1.0D) { + var3 = 2.0D - var3; + } + + var3 *= 4.0D; + var3 = 1.0D - var3; + + if (var3 < 0.0D) { + var3 = 0.0D; + } + + var3 *= var3; + var3 *= var3; + int var5 = this.field_146260_g - 160; + int var6 = 0 - (int)(var3 * 36.0D); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + this.field_146259_f.getTextureManager().bindTexture(field_146261_a); + GL11.glDisable(GL11.GL_LIGHTING); + drawTexturedModalRect(var5, var6, 96, 202, 160, 32); + + if (this.field_146262_n) { + this.field_146259_f.fontRenderer.drawSplitString(this.field_146265_j, var5 + 30, var6 + 7, 120, -1); + } else { + this.field_146259_f.fontRenderer.drawString(this.field_146268_i, var5 + 30, var6 + 7, -256); + this.field_146259_f.fontRenderer.drawString(this.field_146265_j, var5 + 30, var6 + 18, -1); + } + + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_LIGHTING); + this.field_146264_m.renderItemAndEffectIntoGUI(this.field_146259_f.fontRenderer, this.field_146259_f.getTextureManager(), this.field_146266_k.theItemStack, var5 + 8, var6 + 8); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + + public void func_146257_b() { + this.field_146266_k = null; + this.field_146263_l = 0L; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java new file mode 100644 index 0000000..73f413b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiAchievements.java @@ -0,0 +1,470 @@ +package net.minecraft.client.gui.achievement; + +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.*; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiAchievements extends GuiScreen implements IProgressMeter { + private static final int field_146572_y = AchievementList.minDisplayColumn * 24 - 112; + private static final int field_146571_z = AchievementList.minDisplayRow * 24 - 112; + private static final int field_146559_A = AchievementList.maxDisplayColumn * 24 - 77; + private static final int field_146560_B = AchievementList.maxDisplayRow * 24 - 77; + private static final ResourceLocation field_146561_C = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + protected GuiScreen field_146562_a; + protected int field_146555_f = 256; + protected int field_146557_g = 202; + protected int field_146563_h; + protected int field_146564_i; + protected float field_146570_r = 1.0F; + protected double field_146569_s; + protected double field_146568_t; + protected double field_146567_u; + protected double field_146566_v; + protected double field_146565_w; + protected double field_146573_x; + private int field_146554_D; + private final StatFileWriter field_146556_E; + private boolean field_146558_F = true; + + + public GuiAchievements(GuiScreen p_i45026_1_, StatFileWriter p_i45026_2_) { + this.field_146562_a = p_i45026_1_; + this.field_146556_E = p_i45026_2_; + short var3 = 141; + short var4 = 141; + this.field_146569_s = this.field_146567_u = this.field_146565_w = AchievementList.openInventory.displayColumn * 24 - var3 / 2 - 12; + this.field_146568_t = this.field_146566_v = this.field_146573_x = AchievementList.openInventory.displayRow * 24 - var4 / 2; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done"))); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (!this.field_146558_F) { + if (p_146284_1_.id == 1) { + this.mc.displayGuiScreen(this.field_146562_a); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) { + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + } else { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + if (this.field_146558_F) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingStats"), this.width / 2, this.height / 2, 16777215); + this.drawCenteredString(this.fontRendererObj, field_146510_b_[(int)(Minecraft.getSystemTime() / 150L % (long)field_146510_b_.length)], this.width / 2, this.height / 2 + this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + } else { + int var4; + + if (Mouse.isButtonDown(0)) { + var4 = (this.width - this.field_146555_f) / 2; + int var5 = (this.height - this.field_146557_g) / 2; + int var6 = var4 + 8; + int var7 = var5 + 17; + + if ((this.field_146554_D == 0 || this.field_146554_D == 1) && p_73863_1_ >= var6 && p_73863_1_ < var6 + 224 && p_73863_2_ >= var7 && p_73863_2_ < var7 + 155) { + if (this.field_146554_D == 0) { + this.field_146554_D = 1; + } else { + this.field_146567_u -= (float)(p_73863_1_ - this.field_146563_h) * this.field_146570_r; + this.field_146566_v -= (float)(p_73863_2_ - this.field_146564_i) * this.field_146570_r; + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + this.field_146563_h = p_73863_1_; + this.field_146564_i = p_73863_2_; + } + } else { + this.field_146554_D = 0; + } + + var4 = Mouse.getDWheel(); + float var11 = this.field_146570_r; + + if (var4 < 0) { + this.field_146570_r += 0.25F; + } else if (var4 > 0) { + this.field_146570_r -= 0.25F; + } + + this.field_146570_r = MathHelper.clamp_float(this.field_146570_r, 1.0F, 2.0F); + + if (this.field_146570_r != var11) { + float var10000 = var11 - this.field_146570_r; + float var12 = var11 * (float)this.field_146555_f; + float var8 = var11 * (float)this.field_146557_g; + float var9 = this.field_146570_r * (float)this.field_146555_f; + float var10 = this.field_146570_r * (float)this.field_146557_g; + this.field_146567_u -= (var9 - var12) * 0.5F; + this.field_146566_v -= (var10 - var8) * 0.5F; + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + if (this.field_146565_w < (double)field_146572_y) { + this.field_146565_w = field_146572_y; + } + + if (this.field_146573_x < (double)field_146571_z) { + this.field_146573_x = field_146571_z; + } + + if (this.field_146565_w >= (double)field_146559_A) { + this.field_146565_w = field_146559_A - 1; + } + + if (this.field_146573_x >= (double)field_146560_B) { + this.field_146573_x = field_146560_B - 1; + } + + this.drawDefaultBackground(); + this.func_146552_b(p_73863_1_, p_73863_2_, p_73863_3_); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + this.func_146553_h(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + + public void func_146509_g() { + if (this.field_146558_F) { + this.field_146558_F = false; + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + if (!this.field_146558_F) { + this.field_146569_s = this.field_146567_u; + this.field_146568_t = this.field_146566_v; + double var1 = this.field_146565_w - this.field_146567_u; + double var3 = this.field_146573_x - this.field_146566_v; + + if (var1 * var1 + var3 * var3 < 4.0D) { + this.field_146567_u += var1; + this.field_146566_v += var3; + } else { + this.field_146567_u += var1 * 0.85D; + this.field_146566_v += var3 * 0.85D; + } + } + } + + protected void func_146553_h() { + int var1 = (this.width - this.field_146555_f) / 2; + int var2 = (this.height - this.field_146557_g) / 2; + this.fontRendererObj.drawString(I18n.format("gui.achievements"), var1 + 15, var2 + 5, 4210752); + } + + protected void func_146552_b(int p_146552_1_, int p_146552_2_, float p_146552_3_) { + int var4 = MathHelper.floor_double(this.field_146569_s + (this.field_146567_u - this.field_146569_s) * (double)p_146552_3_); + int var5 = MathHelper.floor_double(this.field_146568_t + (this.field_146566_v - this.field_146568_t) * (double)p_146552_3_); + + if (var4 < field_146572_y) { + var4 = field_146572_y; + } + + if (var5 < field_146571_z) { + var5 = field_146571_z; + } + + if (var4 >= field_146559_A) { + var4 = field_146559_A - 1; + } + + if (var5 >= field_146560_B) { + var5 = field_146560_B - 1; + } + + int var6 = (this.width - this.field_146555_f) / 2; + int var7 = (this.height - this.field_146557_g) / 2; + int var8 = var6 + 16; + int var9 = var7 + 17; + zLevel = 0.0F; + GL11.glDepthFunc(GL11.GL_GEQUAL); + GL11.glPushMatrix(); + GL11.glTranslatef((float)var8, (float)var9, -200.0F); + GL11.glScalef(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 0.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + int var10 = var4 + 288 >> 4; + int var11 = var5 + 288 >> 4; + int var12 = (var4 + 288) % 16; + int var13 = (var5 + 288) % 16; + boolean var14 = true; + boolean var15 = true; + boolean var16 = true; + boolean var17 = true; + boolean var18 = true; + Random var19 = new Random(); + float var20 = 16.0F / this.field_146570_r; + float var21 = 16.0F / this.field_146570_r; + int var22; + int var24; + int var25; + + for (var22 = 0; (float)var22 * var20 - (float)var13 < 155.0F; ++var22) { + float var23 = 0.6F - (float)(var11 + var22) / 25.0F * 0.3F; + GL11.glColor4f(var23, var23, var23, 1.0F); + + for (var24 = 0; (float)var24 * var21 - (float)var12 < 224.0F; ++var24) { + var19.setSeed(this.mc.getSession().getPlayerID().hashCode() + var10 + var24 + (var11 + var22) * 16); + var25 = var19.nextInt(1 + var11 + var22) + (var11 + var22) / 2; + IIcon var26 = Blocks.sand.getIcon(0, 0); + + if (var25 <= 37 && var11 + var22 != 35) { + if (var25 == 22) { + if (var19.nextInt(2) == 0) { + var26 = Blocks.diamond_ore.getIcon(0, 0); + } else { + var26 = Blocks.redstone_ore.getIcon(0, 0); + } + } else if (var25 == 10) { + var26 = Blocks.iron_ore.getIcon(0, 0); + } else if (var25 == 8) { + var26 = Blocks.coal_ore.getIcon(0, 0); + } else if (var25 > 4) { + var26 = Blocks.stone.getIcon(0, 0); + } else if (var25 > 0) { + var26 = Blocks.dirt.getIcon(0, 0); + } + } else { + var26 = Blocks.bedrock.getIcon(0, 0); + } + + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + this.drawTexturedModelRectFromIcon(var24 * 16 - var12, var22 * 16 - var13, var26, 16, 16); + } + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthFunc(GL11.GL_LEQUAL); + this.mc.getTextureManager().bindTexture(field_146561_C); + int var30; + int var31; + int var39; + + for (var22 = 0; var22 < AchievementList.achievementList.size(); ++var22) { + Achievement var35 = (Achievement)AchievementList.achievementList.get(var22); + + if (var35.parentAchievement != null) { + var24 = var35.displayColumn * 24 - var4 + 11; + var25 = var35.displayRow * 24 - var5 + 11; + var39 = var35.parentAchievement.displayColumn * 24 - var4 + 11; + int var27 = var35.parentAchievement.displayRow * 24 - var5 + 11; + boolean var28 = this.field_146556_E.hasAchievementUnlocked(var35); + boolean var29 = this.field_146556_E.canUnlockAchievement(var35); + var30 = this.field_146556_E.func_150874_c(var35); + + if (var30 <= 4) { + var31 = -16777216; + + if (var28) { + var31 = -6250336; + } else if (var29) { + var31 = -16711936; + } + + this.drawHorizontalLine(var24, var39, var25, var31); + this.drawVerticalLine(var39, var25, var27, var31); + + if (var24 > var39) { + drawTexturedModalRect(var24 - 11 - 7, var25 - 5, 114, 234, 7, 11); + } else if (var24 < var39) { + drawTexturedModalRect(var24 + 11, var25 - 5, 107, 234, 7, 11); + } else if (var25 > var27) { + drawTexturedModalRect(var24 - 5, var25 - 11 - 7, 96, 234, 11, 7); + } else if (var25 < var27) { + drawTexturedModalRect(var24 - 5, var25 + 11, 96, 241, 11, 7); + } + } + } + } + + Achievement var34 = null; + RenderItem var36 = new RenderItem(); + float var37 = (float)(p_146552_1_ - var8) * this.field_146570_r; + float var38 = (float)(p_146552_2_ - var9) * this.field_146570_r; + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + int var43; + int var44; + + for (var39 = 0; var39 < AchievementList.achievementList.size(); ++var39) { + Achievement var41 = (Achievement)AchievementList.achievementList.get(var39); + var43 = var41.displayColumn * 24 - var4; + var44 = var41.displayRow * 24 - var5; + + if (var43 >= -24 && var44 >= -24 && (float)var43 <= 224.0F * this.field_146570_r && (float)var44 <= 155.0F * this.field_146570_r) { + var30 = this.field_146556_E.func_150874_c(var41); + float var45; + + if (this.field_146556_E.hasAchievementUnlocked(var41)) { + var45 = 0.75F; + GL11.glColor4f(var45, var45, var45, 1.0F); + } else if (this.field_146556_E.canUnlockAchievement(var41)) { + var45 = 1.0F; + GL11.glColor4f(var45, var45, var45, 1.0F); + } else if (var30 < 3) { + var45 = 0.3F; + GL11.glColor4f(var45, var45, var45, 1.0F); + } else if (var30 == 3) { + var45 = 0.2F; + GL11.glColor4f(var45, var45, var45, 1.0F); + } else { + if (var30 != 4) { + continue; + } + + var45 = 0.1F; + GL11.glColor4f(var45, var45, var45, 1.0F); + } + + this.mc.getTextureManager().bindTexture(field_146561_C); + + if (var41.getSpecial()) { + drawTexturedModalRect(var43 - 2, var44 - 2, 26, 202, 26, 26); + } else { + drawTexturedModalRect(var43 - 2, var44 - 2, 0, 202, 26, 26); + } + + if (!this.field_146556_E.canUnlockAchievement(var41)) { + var45 = 0.1F; + GL11.glColor4f(var45, var45, var45, 1.0F); + var36.renderWithColor = false; + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + var36.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var41.theItemStack, var43 + 3, var44 + 3); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_LIGHTING); + + if (!this.field_146556_E.canUnlockAchievement(var41)) { + var36.renderWithColor = true; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (var37 >= (float)var43 && var37 <= (float)(var43 + 22) && var38 >= (float)var44 && var38 <= (float)(var44 + 22)) { + var34 = var41; + } + } + } + + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_146561_C); + drawTexturedModalRect(var6, var7, 0, 0, this.field_146555_f, this.field_146557_g); + zLevel = 0.0F; + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + super.drawScreen(p_146552_1_, p_146552_2_, p_146552_3_); + + if (var34 != null) { + String var40 = var34.func_150951_e().getUnformattedText(); + String var42 = var34.getDescription(); + var43 = p_146552_1_ + 12; + var44 = p_146552_2_ - 4; + var30 = this.field_146556_E.func_150874_c(var34); + + if (!this.field_146556_E.canUnlockAchievement(var34)) { + String var32; + int var33; + + if (var30 == 3) { + var40 = I18n.format("achievement.unknown"); + var31 = Math.max(this.fontRendererObj.getStringWidth(var40), 120); + var32 = (new ChatComponentTranslation("achievement.requires", var34.parentAchievement.func_150951_e())).getUnformattedText(); + var33 = this.fontRendererObj.splitStringWidth(var32, var31); + drawGradientRect(var43 - 3, var44 - 3, var43 + var31 + 3, var44 + var33 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(var32, var43, var44 + 12, var31, -9416624); + } else if (var30 < 3) { + var31 = Math.max(this.fontRendererObj.getStringWidth(var40), 120); + var32 = (new ChatComponentTranslation("achievement.requires", var34.parentAchievement.func_150951_e())).getUnformattedText(); + var33 = this.fontRendererObj.splitStringWidth(var32, var31); + drawGradientRect(var43 - 3, var44 - 3, var43 + var31 + 3, var44 + var33 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(var32, var43, var44 + 12, var31, -9416624); + } else { + var40 = null; + } + } else { + var31 = Math.max(this.fontRendererObj.getStringWidth(var40), 120); + int var46 = this.fontRendererObj.splitStringWidth(var42, var31); + + if (this.field_146556_E.hasAchievementUnlocked(var34)) { + var46 += 12; + } + + drawGradientRect(var43 - 3, var44 - 3, var43 + var31 + 3, var44 + var46 + 3 + 12, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(var42, var43, var44 + 12, var31, -6250336); + + if (this.field_146556_E.hasAchievementUnlocked(var34)) { + this.fontRendererObj.drawStringWithShadow(I18n.format("achievement.taken"), var43, var44 + var46 + 4, -7302913); + } + } + + if (var40 != null) { + this.fontRendererObj.drawStringWithShadow(var40, var43, var44, this.field_146556_E.canUnlockAchievement(var34) ? (var34.getSpecial() ? -128 : -1) : (var34.getSpecial() ? -8355776 : -8355712)); + } + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LIGHTING); + RenderHelper.disableStandardItemLighting(); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return !this.field_146558_F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java new file mode 100644 index 0000000..74e9536 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/achievement/GuiStats.java @@ -0,0 +1,639 @@ +package net.minecraft.client.gui.achievement; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.*; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityList; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatCrafting; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.stats.StatList; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiStats extends GuiScreen implements IProgressMeter { + private static final RenderItem field_146544_g = new RenderItem(); + protected GuiScreen field_146549_a; + protected String field_146542_f = "Select world"; + private GuiStats.StatsGeneral field_146550_h; + private GuiStats.StatsItem field_146551_i; + private GuiStats.StatsBlock field_146548_r; + private GuiStats.StatsMobsList field_146547_s; + private final StatFileWriter field_146546_t; + private GuiSlot field_146545_u; + private boolean field_146543_v = true; + + + public GuiStats(GuiScreen p_i1071_1_, StatFileWriter p_i1071_2_) { + this.field_146549_a = p_i1071_1_; + this.field_146546_t = p_i1071_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.field_146542_f = I18n.format("gui.stats"); + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + } + + public void func_146541_h() { + this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.format("gui.done"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 160, this.height - 52, 80, 20, I18n.format("stat.generalButton"))); + GuiButton var1; + GuiButton var2; + GuiButton var3; + this.buttonList.add(var1 = new GuiButton(2, this.width / 2 - 80, this.height - 52, 80, 20, I18n.format("stat.blocksButton"))); + this.buttonList.add(var2 = new GuiButton(3, this.width / 2, this.height - 52, 80, 20, I18n.format("stat.itemsButton"))); + this.buttonList.add(var3 = new GuiButton(4, this.width / 2 + 80, this.height - 52, 80, 20, I18n.format("stat.mobsButton"))); + + if (this.field_146548_r.getSize() == 0) { + var1.enabled = false; + } + + if (this.field_146551_i.getSize() == 0) { + var2.enabled = false; + } + + if (this.field_146547_s.getSize() == 0) { + var3.enabled = false; + } + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 0) { + this.mc.displayGuiScreen(this.field_146549_a); + } else if (p_146284_1_.id == 1) { + this.field_146545_u = this.field_146550_h; + } else if (p_146284_1_.id == 3) { + this.field_146545_u = this.field_146551_i; + } else if (p_146284_1_.id == 2) { + this.field_146545_u = this.field_146548_r; + } else if (p_146284_1_.id == 4) { + this.field_146545_u = this.field_146547_s; + } else { + this.field_146545_u.func_148147_a(p_146284_1_); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + if (this.field_146543_v) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingStats"), this.width / 2, this.height / 2, 16777215); + this.drawCenteredString(this.fontRendererObj, field_146510_b_[(int)(Minecraft.getSystemTime() / 150L % (long)field_146510_b_.length)], this.width / 2, this.height / 2 + this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + } else { + this.field_146545_u.func_148128_a(p_73863_1_, p_73863_2_, p_73863_3_); + this.drawCenteredString(this.fontRendererObj, this.field_146542_f, this.width / 2, 20, 16777215); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + } + + public void func_146509_g() { + if (this.field_146543_v) { + this.field_146550_h = new GuiStats.StatsGeneral(); + this.field_146550_h.func_148134_d(1, 1); + this.field_146551_i = new GuiStats.StatsItem(); + this.field_146551_i.func_148134_d(1, 1); + this.field_146548_r = new GuiStats.StatsBlock(); + this.field_146548_r.func_148134_d(1, 1); + this.field_146547_s = new GuiStats.StatsMobsList(); + this.field_146547_s.func_148134_d(1, 1); + this.field_146545_u = this.field_146550_h; + this.func_146541_h(); + this.field_146543_v = false; + } + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return !this.field_146543_v; + } + + private void func_146521_a(int p_146521_1_, int p_146521_2_, Item p_146521_3_) { + this.func_146531_b(p_146521_1_ + 1, p_146521_2_ + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + field_146544_g.renderItemIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(p_146521_3_, 1, 0), p_146521_1_ + 2, p_146521_2_ + 2); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + private void func_146531_b(int p_146531_1_, int p_146531_2_) { + this.func_146527_c(p_146531_1_, p_146531_2_, 0, 0); + } + + private void func_146527_c(int p_146527_1_, int p_146527_2_, int p_146527_3_, int p_146527_4_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(statIcons); + float var5 = 0.0078125F; + float var6 = 0.0078125F; + boolean var7 = true; + boolean var8 = true; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(p_146527_1_ + 0, p_146527_2_ + 18, zLevel, (float)(p_146527_3_ + 0) * 0.0078125F, (float)(p_146527_4_ + 18) * 0.0078125F); + var9.addVertexWithUV(p_146527_1_ + 18, p_146527_2_ + 18, zLevel, (float)(p_146527_3_ + 18) * 0.0078125F, (float)(p_146527_4_ + 18) * 0.0078125F); + var9.addVertexWithUV(p_146527_1_ + 18, p_146527_2_ + 0, zLevel, (float)(p_146527_3_ + 18) * 0.0078125F, (float)(p_146527_4_ + 0) * 0.0078125F); + var9.addVertexWithUV(p_146527_1_ + 0, p_146527_2_ + 0, zLevel, (float)(p_146527_3_ + 0) * 0.0078125F, (float)(p_146527_4_ + 0) * 0.0078125F); + var9.draw(); + } + + abstract class Stats extends GuiSlot { + protected int field_148218_l = -1; + protected List field_148219_m; + protected Comparator field_148216_n; + protected int field_148217_o = -1; + protected int field_148215_p; + + + protected Stats() { + super(GuiStats.this.mc, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, 20); + this.func_148130_a(false); + this.func_148133_a(true, 20); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + protected boolean isSelected(int p_148131_1_) { + return false; + } + + protected void drawBackground() { + GuiStats.this.drawDefaultBackground(); + } + + protected void func_148129_a(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) { + if (!Mouse.isButtonDown(0)) { + this.field_148218_l = -1; + } + + if (this.field_148218_l == 0) { + GuiStats.this.func_146527_c(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 0, 0); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148218_l == 1) { + GuiStats.this.func_146527_c(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 0, 0); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148218_l == 2) { + GuiStats.this.func_146527_c(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 0, 0); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148217_o != -1) { + short var4 = 79; + byte var5 = 18; + + if (this.field_148217_o == 1) { + var4 = 129; + } else if (this.field_148217_o == 2) { + var4 = 179; + } + + if (this.field_148215_p == 1) { + var5 = 36; + } + + GuiStats.this.func_146527_c(p_148129_1_ + var4, p_148129_2_ + 1, var5, 0); + } + } + + protected void func_148132_a(int p_148132_1_, int p_148132_2_) { + this.field_148218_l = -1; + + if (p_148132_1_ >= 79 && p_148132_1_ < 115) { + this.field_148218_l = 0; + } else if (p_148132_1_ >= 129 && p_148132_1_ < 165) { + this.field_148218_l = 1; + } else if (p_148132_1_ >= 179 && p_148132_1_ < 215) { + this.field_148218_l = 2; + } + + if (this.field_148218_l >= 0) { + this.func_148212_h(this.field_148218_l); + GuiStats.this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + } + } + + protected final int getSize() { + return this.field_148219_m.size(); + } + + protected final StatCrafting func_148211_c(int p_148211_1_) { + return (StatCrafting)this.field_148219_m.get(p_148211_1_); + } + + protected abstract String func_148210_b(int p_148210_1_); + + protected void func_148209_a(StatBase p_148209_1_, int p_148209_2_, int p_148209_3_, boolean p_148209_4_) { + String var5; + + if (p_148209_1_ != null) { + var5 = p_148209_1_.func_75968_a(GuiStats.this.field_146546_t.writeStat(p_148209_1_)); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, var5, p_148209_2_ - GuiStats.this.fontRendererObj.getStringWidth(var5), p_148209_3_ + 5, p_148209_4_ ? 16777215 : 9474192); + } else { + var5 = "-"; + GuiStats.this.drawString(GuiStats.this.fontRendererObj, var5, p_148209_2_ - GuiStats.this.fontRendererObj.getStringWidth(var5), p_148209_3_ + 5, p_148209_4_ ? 16777215 : 9474192); + } + } + + protected void func_148142_b(int p_148142_1_, int p_148142_2_) { + if (p_148142_2_ >= this.field_148153_b && p_148142_2_ <= this.field_148154_c) { + int var3 = this.func_148124_c(p_148142_1_, p_148142_2_); + int var4 = this.field_148155_a / 2 - 92 - 16; + + if (var3 >= 0) { + if (p_148142_1_ < var4 + 40 || p_148142_1_ > var4 + 40 + 20) { + return; + } + + StatCrafting var5 = this.func_148211_c(var3); + this.func_148213_a(var5, p_148142_1_, p_148142_2_); + } else { + String var9 = ""; + + if (p_148142_1_ >= var4 + 115 - 18 && p_148142_1_ <= var4 + 115) { + var9 = this.func_148210_b(0); + } else if (p_148142_1_ >= var4 + 165 - 18 && p_148142_1_ <= var4 + 165) { + var9 = this.func_148210_b(1); + } else { + if (p_148142_1_ < var4 + 215 - 18 || p_148142_1_ > var4 + 215) { + return; + } + + var9 = this.func_148210_b(2); + } + + var9 = ("" + I18n.format(var9)).trim(); + + if (var9.length() > 0) { + int var6 = p_148142_1_ + 12; + int var7 = p_148142_2_ - 12; + int var8 = GuiStats.this.fontRendererObj.getStringWidth(var9); + drawGradientRect(var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); + GuiStats.this.fontRendererObj.drawStringWithShadow(var9, var6, var7, -1); + } + } + } + } + + protected void func_148213_a(StatCrafting p_148213_1_, int p_148213_2_, int p_148213_3_) { + if (p_148213_1_ != null) { + Item var4 = p_148213_1_.func_150959_a(); + String var5 = ("" + I18n.format(var4.getUnlocalizedName() + ".name")).trim(); + + if (var5.length() > 0) { + int var6 = p_148213_2_ + 12; + int var7 = p_148213_3_ - 12; + int var8 = GuiStats.this.fontRendererObj.getStringWidth(var5); + drawGradientRect(var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); + GuiStats.this.fontRendererObj.drawStringWithShadow(var5, var6, var7, -1); + } + } + } + + protected void func_148212_h(int p_148212_1_) { + if (p_148212_1_ != this.field_148217_o) { + this.field_148217_o = p_148212_1_; + this.field_148215_p = -1; + } else if (this.field_148215_p == -1) { + this.field_148215_p = 1; + } else { + this.field_148217_o = -1; + this.field_148215_p = 0; + } + + Collections.sort(this.field_148219_m, this.field_148216_n); + } + } + + class StatsBlock extends GuiStats.Stats { + + + public StatsBlock() { + this.field_148219_m = new ArrayList(); + Iterator var2 = StatList.objectMineStats.iterator(); + + while (var2.hasNext()) { + StatCrafting var3 = (StatCrafting)var2.next(); + boolean var4 = false; + int var5 = Item.getIdFromItem(var3.func_150959_a()); + + if (GuiStats.this.field_146546_t.writeStat(var3) > 0) { + var4 = true; + } else if (StatList.objectUseStats[var5] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectUseStats[var5]) > 0) { + var4 = true; + } else if (StatList.objectCraftStats[var5] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectCraftStats[var5]) > 0) { + var4 = true; + } + + if (var4) { + this.field_148219_m.add(var3); + } + } + + this.field_148216_n = new Comparator() { + + public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) { + int var3 = Item.getIdFromItem(p_compare_1_.func_150959_a()); + int var4 = Item.getIdFromItem(p_compare_2_.func_150959_a()); + StatBase var5 = null; + StatBase var6 = null; + + if (StatsBlock.this.field_148217_o == 2) { + var5 = StatList.mineBlockStatArray[var3]; + var6 = StatList.mineBlockStatArray[var4]; + } else if (StatsBlock.this.field_148217_o == 0) { + var5 = StatList.objectCraftStats[var3]; + var6 = StatList.objectCraftStats[var4]; + } else if (StatsBlock.this.field_148217_o == 1) { + var5 = StatList.objectUseStats[var3]; + var6 = StatList.objectUseStats[var4]; + } + + if (var5 != null || var6 != null) { + if (var5 == null) { + return 1; + } + + if (var6 == null) { + return -1; + } + + int var7 = GuiStats.this.field_146546_t.writeStat(var5); + int var8 = GuiStats.this.field_146546_t.writeStat(var6); + + if (var7 != var8) { + return (var7 - var8) * StatsBlock.this.field_148215_p; + } + } + + return var3 - var4; + } + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((StatCrafting)p_compare_1_, (StatCrafting)p_compare_2_); + } + }; + } + + protected void func_148129_a(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) { + super.func_148129_a(p_148129_1_, p_148129_2_, p_148129_3_); + + if (this.field_148218_l == 0) { + GuiStats.this.func_146527_c(p_148129_1_ + 115 - 18 + 1, p_148129_2_ + 1 + 1, 18, 18); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 18, 18); + } + + if (this.field_148218_l == 1) { + GuiStats.this.func_146527_c(p_148129_1_ + 165 - 18 + 1, p_148129_2_ + 1 + 1, 36, 18); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 36, 18); + } + + if (this.field_148218_l == 2) { + GuiStats.this.func_146527_c(p_148129_1_ + 215 - 18 + 1, p_148129_2_ + 1 + 1, 54, 18); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 54, 18); + } + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + StatCrafting var8 = this.func_148211_c(p_148126_1_); + Item var9 = var8.func_150959_a(); + GuiStats.this.func_146521_a(p_148126_2_ + 40, p_148126_3_, var9); + int var10 = Item.getIdFromItem(var9); + this.func_148209_a(StatList.objectCraftStats[var10], p_148126_2_ + 115, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(StatList.objectUseStats[var10], p_148126_2_ + 165, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(var8, p_148126_2_ + 215, p_148126_3_, p_148126_1_ % 2 == 0); + } + + protected String func_148210_b(int p_148210_1_) { + return p_148210_1_ == 0 ? "stat.crafted" : (p_148210_1_ == 1 ? "stat.used" : "stat.mined"); + } + } + + class StatsGeneral extends GuiSlot { + + + public StatsGeneral() { + super(GuiStats.this.mc, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, 10); + this.func_148130_a(false); + } + + protected int getSize() { + return StatList.generalStats.size(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + protected boolean isSelected(int p_148131_1_) { + return false; + } + + protected int func_148138_e() { + return this.getSize() * 10; + } + + protected void drawBackground() { + GuiStats.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + StatBase var8 = (StatBase)StatList.generalStats.get(p_148126_1_); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, var8.func_150951_e().getUnformattedText(), p_148126_2_ + 2, p_148126_3_ + 1, p_148126_1_ % 2 == 0 ? 16777215 : 9474192); + String var9 = var8.func_75968_a(GuiStats.this.field_146546_t.writeStat(var8)); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, var9, p_148126_2_ + 2 + 213 - GuiStats.this.fontRendererObj.getStringWidth(var9), p_148126_3_ + 1, p_148126_1_ % 2 == 0 ? 16777215 : 9474192); + } + } + + class StatsItem extends GuiStats.Stats { + + + public StatsItem() { + this.field_148219_m = new ArrayList(); + Iterator var2 = StatList.itemStats.iterator(); + + while (var2.hasNext()) { + StatCrafting var3 = (StatCrafting)var2.next(); + boolean var4 = false; + int var5 = Item.getIdFromItem(var3.func_150959_a()); + + if (GuiStats.this.field_146546_t.writeStat(var3) > 0) { + var4 = true; + } else if (StatList.objectBreakStats[var5] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectBreakStats[var5]) > 0) { + var4 = true; + } else if (StatList.objectCraftStats[var5] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectCraftStats[var5]) > 0) { + var4 = true; + } + + if (var4) { + this.field_148219_m.add(var3); + } + } + + this.field_148216_n = new Comparator() { + + public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) { + int var3 = Item.getIdFromItem(p_compare_1_.func_150959_a()); + int var4 = Item.getIdFromItem(p_compare_2_.func_150959_a()); + StatBase var5 = null; + StatBase var6 = null; + + if (StatsItem.this.field_148217_o == 0) { + var5 = StatList.objectBreakStats[var3]; + var6 = StatList.objectBreakStats[var4]; + } else if (StatsItem.this.field_148217_o == 1) { + var5 = StatList.objectCraftStats[var3]; + var6 = StatList.objectCraftStats[var4]; + } else if (StatsItem.this.field_148217_o == 2) { + var5 = StatList.objectUseStats[var3]; + var6 = StatList.objectUseStats[var4]; + } + + if (var5 != null || var6 != null) { + if (var5 == null) { + return 1; + } + + if (var6 == null) { + return -1; + } + + int var7 = GuiStats.this.field_146546_t.writeStat(var5); + int var8 = GuiStats.this.field_146546_t.writeStat(var6); + + if (var7 != var8) { + return (var7 - var8) * StatsItem.this.field_148215_p; + } + } + + return var3 - var4; + } + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((StatCrafting)p_compare_1_, (StatCrafting)p_compare_2_); + } + }; + } + + protected void func_148129_a(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) { + super.func_148129_a(p_148129_1_, p_148129_2_, p_148129_3_); + + if (this.field_148218_l == 0) { + GuiStats.this.func_146527_c(p_148129_1_ + 115 - 18 + 1, p_148129_2_ + 1 + 1, 72, 18); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 72, 18); + } + + if (this.field_148218_l == 1) { + GuiStats.this.func_146527_c(p_148129_1_ + 165 - 18 + 1, p_148129_2_ + 1 + 1, 18, 18); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 18, 18); + } + + if (this.field_148218_l == 2) { + GuiStats.this.func_146527_c(p_148129_1_ + 215 - 18 + 1, p_148129_2_ + 1 + 1, 36, 18); + } else { + GuiStats.this.func_146527_c(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 36, 18); + } + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + StatCrafting var8 = this.func_148211_c(p_148126_1_); + Item var9 = var8.func_150959_a(); + GuiStats.this.func_146521_a(p_148126_2_ + 40, p_148126_3_, var9); + int var10 = Item.getIdFromItem(var9); + this.func_148209_a(StatList.objectBreakStats[var10], p_148126_2_ + 115, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(StatList.objectCraftStats[var10], p_148126_2_ + 165, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(var8, p_148126_2_ + 215, p_148126_3_, p_148126_1_ % 2 == 0); + } + + protected String func_148210_b(int p_148210_1_) { + return p_148210_1_ == 1 ? "stat.crafted" : (p_148210_1_ == 2 ? "stat.used" : "stat.depleted"); + } + } + + class StatsMobsList extends GuiSlot { + private final List field_148222_l = new ArrayList(); + + + public StatsMobsList() { + super(GuiStats.this.mc, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4); + this.func_148130_a(false); + Iterator var2 = EntityList.entityEggs.values().iterator(); + + while (var2.hasNext()) { + EntityList.EntityEggInfo var3 = (EntityList.EntityEggInfo)var2.next(); + + if (GuiStats.this.field_146546_t.writeStat(var3.field_151512_d) > 0 || GuiStats.this.field_146546_t.writeStat(var3.field_151513_e) > 0) { + this.field_148222_l.add(var3); + } + } + } + + protected int getSize() { + return this.field_148222_l.size(); + } + + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + protected boolean isSelected(int p_148131_1_) { + return false; + } + + protected int func_148138_e() { + return this.getSize() * GuiStats.this.fontRendererObj.FONT_HEIGHT * 4; + } + + protected void drawBackground() { + GuiStats.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) { + EntityList.EntityEggInfo var8 = (EntityList.EntityEggInfo)this.field_148222_l.get(p_148126_1_); + String var9 = I18n.format("entity." + EntityList.getStringFromID(var8.spawnedID) + ".name"); + int var10 = GuiStats.this.field_146546_t.writeStat(var8.field_151512_d); + int var11 = GuiStats.this.field_146546_t.writeStat(var8.field_151513_e); + String var12 = I18n.format("stat.entityKills", Integer.valueOf(var10), var9); + String var13 = I18n.format("stat.entityKilledBy", var9, Integer.valueOf(var11)); + + if (var10 == 0) { + var12 = I18n.format("stat.entityKills.none", var9); + } + + if (var11 == 0) { + var13 = I18n.format("stat.entityKilledBy.none", var9); + } + + GuiStats.this.drawString(GuiStats.this.fontRendererObj, var9, p_148126_2_ + 2 - 10, p_148126_3_ + 1, 16777215); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, var12, p_148126_2_ + 2, p_148126_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT, var10 == 0 ? 6316128 : 9474192); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, var13, p_148126_2_ + 2, p_148126_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT * 2, var11 == 0 ? 6316128 : 9474192); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java new file mode 100644 index 0000000..b01a973 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/CreativeCrafting.java @@ -0,0 +1,33 @@ +package net.minecraft.client.gui.inventory; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.item.ItemStack; + +public class CreativeCrafting implements ICrafting { + private final Minecraft field_146109_a; + + + public CreativeCrafting(Minecraft p_i46314_1_) { + this.field_146109_a = p_i46314_1_; + } + + public void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_) {} + + /** + * Sends the contents of an inventory slot to the com.cheatbreaker.client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) { + this.field_146109_a.playerController.sendSlotPacket(p_71111_3_, p_71111_2_); + } + + /** + * Sends two ints to the com.cheatbreaker.client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java new file mode 100644 index 0000000..d39e332 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiBeacon.java @@ -0,0 +1,277 @@ +package net.minecraft.client.gui.inventory; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import java.util.Iterator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.potion.Potion; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public class GuiBeacon extends GuiContainer { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_147025_v = new ResourceLocation("textures/gui/container/beacon.png"); + private final TileEntityBeacon field_147024_w; + private GuiBeacon.ConfirmButton field_147028_x; + private boolean field_147027_y; + + + public GuiBeacon(InventoryPlayer p_i1078_1_, TileEntityBeacon p_i1078_2_) { + super(new ContainerBeacon(p_i1078_1_, p_i1078_2_)); + this.field_147024_w = p_i1078_2_; + this.field_146999_f = 230; + this.field_147000_g = 219; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + super.initGui(); + this.buttonList.add(this.field_147028_x = new GuiBeacon.ConfirmButton(-1, this.field_147003_i + 164, this.field_147009_r + 107)); + this.buttonList.add(new GuiBeacon.CancelButton(-2, this.field_147003_i + 190, this.field_147009_r + 107)); + this.field_147027_y = true; + this.field_147028_x.enabled = false; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + + if (this.field_147027_y && this.field_147024_w.func_145998_l() >= 0) { + this.field_147027_y = false; + int var2; + int var3; + int var4; + int var5; + GuiBeacon.PowerButton var6; + + for (int var1 = 0; var1 <= 2; ++var1) { + var2 = TileEntityBeacon.field_146009_a[var1].length; + var3 = var2 * 22 + (var2 - 1) * 2; + + for (var4 = 0; var4 < var2; ++var4) { + var5 = TileEntityBeacon.field_146009_a[var1][var4].id; + var6 = new GuiBeacon.PowerButton(var1 << 8 | var5, this.field_147003_i + 76 + var4 * 24 - var3 / 2, this.field_147009_r + 22 + var1 * 25, var5, var1); + this.buttonList.add(var6); + + if (var1 >= this.field_147024_w.func_145998_l()) { + var6.enabled = false; + } else if (var5 == this.field_147024_w.func_146007_j()) { + var6.func_146140_b(true); + } + } + } + + byte var7 = 3; + var2 = TileEntityBeacon.field_146009_a[var7].length + 1; + var3 = var2 * 22 + (var2 - 1) * 2; + + for (var4 = 0; var4 < var2 - 1; ++var4) { + var5 = TileEntityBeacon.field_146009_a[var7][var4].id; + var6 = new GuiBeacon.PowerButton(var7 << 8 | var5, this.field_147003_i + 167 + var4 * 24 - var3 / 2, this.field_147009_r + 47, var5, var7); + this.buttonList.add(var6); + + if (var7 >= this.field_147024_w.func_145998_l()) { + var6.enabled = false; + } else if (var5 == this.field_147024_w.func_146006_k()) { + var6.func_146140_b(true); + } + } + + if (this.field_147024_w.func_146007_j() > 0) { + GuiBeacon.PowerButton var8 = new GuiBeacon.PowerButton(var7 << 8 | this.field_147024_w.func_146007_j(), this.field_147003_i + 167 + (var2 - 1) * 24 - var3 / 2, this.field_147009_r + 47, this.field_147024_w.func_146007_j(), var7); + this.buttonList.add(var8); + + if (var7 >= this.field_147024_w.func_145998_l()) { + var8.enabled = false; + } else if (this.field_147024_w.func_146007_j() == this.field_147024_w.func_146006_k()) { + var8.func_146140_b(true); + } + } + } + + this.field_147028_x.enabled = this.field_147024_w.getStackInSlot(0) != null && this.field_147024_w.func_146007_j() > 0; + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == -2) { + this.mc.displayGuiScreen(null); + } else if (p_146284_1_.id == -1) { + String var2 = "MC|Beacon"; + ByteBuf var3 = Unpooled.buffer(); + + try { + var3.writeInt(this.field_147024_w.func_146007_j()); + var3.writeInt(this.field_147024_w.func_146006_k()); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(var2, var3)); + } catch (Exception var8) { + logger.error("Couldn't send beacon info", var8); + } finally { + var3.release(); + } + + this.mc.displayGuiScreen(null); + } else if (p_146284_1_ instanceof GuiBeacon.PowerButton) { + if (((GuiBeacon.PowerButton)p_146284_1_).func_146141_c()) { + return; + } + + int var10 = p_146284_1_.id; + int var11 = var10 & 255; + int var4 = var10 >> 8; + + if (var4 < 3) { + this.field_147024_w.func_146001_d(var11); + } else { + this.field_147024_w.func_146004_e(var11); + } + + this.buttonList.clear(); + this.initGui(); + this.updateScreen(); + } + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + RenderHelper.disableStandardItemLighting(); + this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.primary"), 62, 10, 14737632); + this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.secondary"), 169, 10, 14737632); + Iterator var3 = this.buttonList.iterator(); + + while (var3.hasNext()) { + GuiButton var4 = (GuiButton)var3.next(); + + if (var4.func_146115_a()) { + var4.func_146111_b(p_146979_1_ - this.field_147003_i, p_146979_2_ - this.field_147009_r); + break; + } + } + + RenderHelper.enableGUIStandardItemLighting(); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147025_v); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + itemRender.zLevel = 100.0F; + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.emerald), var4 + 42, var5 + 109); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.diamond), var4 + 42 + 22, var5 + 109); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.gold_ingot), var4 + 42 + 44, var5 + 109); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.iron_ingot), var4 + 42 + 66, var5 + 109); + itemRender.zLevel = 0.0F; + } + + static class Button extends GuiButton { + private final ResourceLocation field_146145_o; + private final int field_146144_p; + private final int field_146143_q; + private boolean field_146142_r; + + + protected Button(int p_i1077_1_, int p_i1077_2_, int p_i1077_3_, ResourceLocation p_i1077_4_, int p_i1077_5_, int p_i1077_6_) { + super(p_i1077_1_, p_i1077_2_, p_i1077_3_, 22, 22, ""); + this.field_146145_o = p_i1077_4_; + this.field_146144_p = p_i1077_5_; + this.field_146143_q = p_i1077_6_; + } + + public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) { + if (this.field_146125_m) { + p_146112_1_.getTextureManager().bindTexture(GuiBeacon.field_147025_v); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_146123_n = p_146112_2_ >= this.field_146128_h && p_146112_3_ >= this.field_146129_i && p_146112_2_ < this.field_146128_h + this.field_146120_f && p_146112_3_ < this.field_146129_i + this.field_146121_g; + short var4 = 219; + int var5 = 0; + + if (!this.enabled) { + var5 += this.field_146120_f * 2; + } else if (this.field_146142_r) { + var5 += this.field_146120_f * 1; + } else if (this.field_146123_n) { + var5 += this.field_146120_f * 3; + } + + drawTexturedModalRect(this.field_146128_h, this.field_146129_i, var5, var4, this.field_146120_f, this.field_146121_g); + + if (!GuiBeacon.field_147025_v.equals(this.field_146145_o)) { + p_146112_1_.getTextureManager().bindTexture(this.field_146145_o); + } + + drawTexturedModalRect(this.field_146128_h + 2, this.field_146129_i + 2, this.field_146144_p, this.field_146143_q, 18, 18); + } + } + + public boolean func_146141_c() { + return this.field_146142_r; + } + + public void func_146140_b(boolean p_146140_1_) { + this.field_146142_r = p_146140_1_; + } + } + + class CancelButton extends GuiBeacon.Button { + + + public CancelButton(int p_i1074_2_, int p_i1074_3_, int p_i1074_4_) { + super(p_i1074_2_, p_i1074_3_, p_i1074_4_, GuiBeacon.field_147025_v, 112, 220); + } + + public void func_146111_b(int p_146111_1_, int p_146111_2_) { + GuiBeacon.this.func_146279_a(I18n.format("gui.cancel"), p_146111_1_, p_146111_2_); + } + } + + class ConfirmButton extends GuiBeacon.Button { + + + public ConfirmButton(int p_i1075_2_, int p_i1075_3_, int p_i1075_4_) { + super(p_i1075_2_, p_i1075_3_, p_i1075_4_, GuiBeacon.field_147025_v, 90, 220); + } + + public void func_146111_b(int p_146111_1_, int p_146111_2_) { + GuiBeacon.this.func_146279_a(I18n.format("gui.done"), p_146111_1_, p_146111_2_); + } + } + + class PowerButton extends GuiBeacon.Button { + private final int field_146149_p; + private final int field_146148_q; + + + public PowerButton(int p_i1076_2_, int p_i1076_3_, int p_i1076_4_, int p_i1076_5_, int p_i1076_6_) { + super(p_i1076_2_, p_i1076_3_, p_i1076_4_, GuiContainer.field_147001_a, 0 + Potion.potionTypes[p_i1076_5_].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[p_i1076_5_].getStatusIconIndex() / 8 * 18); + this.field_146149_p = p_i1076_5_; + this.field_146148_q = p_i1076_6_; + } + + public void func_146111_b(int p_146111_1_, int p_146111_2_) { + String var3 = I18n.format(Potion.potionTypes[this.field_146149_p].getName()); + + if (this.field_146148_q >= 3 && this.field_146149_p != Potion.regeneration.id) { + var3 = var3 + " II"; + } + + GuiBeacon.this.func_146279_a(var3, p_146111_1_, p_146111_2_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java new file mode 100644 index 0000000..127272e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java @@ -0,0 +1,78 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerBrewingStand; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiBrewingStand extends GuiContainer { + private static final ResourceLocation field_147014_u = new ResourceLocation("textures/gui/container/brewing_stand.png"); + private final TileEntityBrewingStand field_147013_v; + + + public GuiBrewingStand(InventoryPlayer p_i1081_1_, TileEntityBrewingStand p_i1081_2_) { + super(new ContainerBrewingStand(p_i1081_1_, p_i1081_2_)); + this.field_147013_v = p_i1081_2_; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + String var3 = this.field_147013_v.isInventoryNameLocalized() ? this.field_147013_v.getInventoryName() : I18n.format(this.field_147013_v.getInventoryName()); + this.fontRendererObj.drawString(var3, this.field_146999_f / 2 - this.fontRendererObj.getStringWidth(var3) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.field_147000_g - 96 + 2, 4210752); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147014_u); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + int var6 = this.field_147013_v.func_145935_i(); + + if (var6 > 0) { + int var7 = (int)(28.0F * (1.0F - (float)var6 / 400.0F)); + + if (var7 > 0) { + drawTexturedModalRect(var4 + 97, var5 + 16, 176, 0, 9, var7); + } + + int var8 = var6 / 2 % 7; + + switch (var8) { + case 0: + var7 = 29; + break; + + case 1: + var7 = 24; + break; + + case 2: + var7 = 20; + break; + + case 3: + var7 = 16; + break; + + case 4: + var7 = 11; + break; + + case 5: + var7 = 6; + break; + + case 6: + var7 = 0; + } + + if (var7 > 0) { + drawTexturedModalRect(var4 + 65, var5 + 14 + 29 - var7, 185, 29 - var7, 12, var7); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java new file mode 100644 index 0000000..50d6d4e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiChest.java @@ -0,0 +1,41 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiChest extends GuiContainer { + private static final ResourceLocation field_147017_u = new ResourceLocation("textures/gui/container/generic_54.png"); + private final IInventory field_147016_v; + private final IInventory field_147015_w; + private final int field_147018_x; + + + public GuiChest(IInventory p_i46315_1_, IInventory p_i46315_2_) { + super(new ContainerChest(p_i46315_1_, p_i46315_2_)); + this.field_147016_v = p_i46315_1_; + this.field_147015_w = p_i46315_2_; + this.field_146291_p = false; + short var3 = 222; + int var4 = var3 - 108; + this.field_147018_x = p_i46315_2_.getSizeInventory() / 9; + this.field_147000_g = var4 + this.field_147018_x * 18; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(this.field_147015_w.isInventoryNameLocalized() ? this.field_147015_w.getInventoryName() : I18n.format(this.field_147015_w.getInventoryName()), 8, 6, 4210752); + this.fontRendererObj.drawString(this.field_147016_v.isInventoryNameLocalized() ? this.field_147016_v.getInventoryName() : I18n.format(this.field_147016_v.getInventoryName()), 8, this.field_147000_g - 96 + 2, 4210752); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147017_u); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147018_x * 18 + 17); + drawTexturedModalRect(var4, var5 + this.field_147018_x * 18 + 17, 0, 126, this.field_146999_f, 96); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java new file mode 100644 index 0000000..77a1e4b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiContainer.java @@ -0,0 +1,592 @@ +package net.minecraft.client.gui.inventory; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.ClickEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public abstract class GuiContainer extends GuiScreen { + protected static final ResourceLocation field_147001_a = new ResourceLocation("textures/gui/container/inventory.png"); + protected int field_146999_f = 176; + protected int field_147000_g = 166; + public Container field_147002_h; + protected int field_147003_i; + protected int field_147009_r; + private Slot field_147006_u; + private Slot field_147005_v; + private boolean field_147004_w; + private ItemStack field_147012_x; + private int field_147011_y; + private int field_147010_z; + private Slot field_146989_A; + private long field_146990_B; + private ItemStack field_146991_C; + private Slot field_146985_D; + private long field_146986_E; + protected final Set field_147008_s = new HashSet(); + protected boolean field_147007_t; + private int field_146987_F; + private int field_146988_G; + private boolean field_146995_H; + private int field_146996_I; + private long field_146997_J; + private Slot field_146998_K; + private int field_146992_L; + private boolean field_146993_M; + private ItemStack field_146994_N; + + + public GuiContainer(Container p_i1072_1_) { + this.field_147002_h = p_i1072_1_; + this.field_146995_H = true; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + super.initGui(); + this.mc.thePlayer.openContainer = this.field_147002_h; + this.field_147003_i = (this.width - this.field_146999_f) / 2; + this.field_147009_r = (this.height - this.field_147000_g) / 2; + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + int var4 = this.field_147003_i; + int var5 = this.field_147009_r; + this.func_146976_a(p_73863_3_, p_73863_1_, p_73863_2_); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + RenderHelper.enableGUIStandardItemLighting(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)var4, (float)var5, 0.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.field_147006_u = null; + short var6 = 240; + short var7 = 240; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int var11; + + for (int var8 = 0; var8 < this.field_147002_h.inventorySlots.size(); ++var8) { + Slot var9 = (Slot)this.field_147002_h.inventorySlots.get(var8); + this.func_146977_a(var9); + + if (this.func_146981_a(var9, p_73863_1_, p_73863_2_) && var9.func_111238_b()) { + this.field_147006_u = var9; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + int var10 = var9.xDisplayPosition; + var11 = var9.yDisplayPosition; + GL11.glColorMask(true, true, true, false); + drawGradientRect(var10, var11, var10 + 16, var11 + 16, -2130706433, -2130706433); + GL11.glColorMask(true, true, true, true); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + + this.func_146979_b(p_73863_1_, p_73863_2_); + InventoryPlayer var15 = this.mc.thePlayer.inventory; + ItemStack var16 = this.field_147012_x == null ? var15.getItemStack() : this.field_147012_x; + + if (var16 != null) { + byte var17 = 8; + var11 = this.field_147012_x == null ? 8 : 16; + String var12 = null; + + if (this.field_147012_x != null && this.field_147004_w) { + var16 = var16.copy(); + var16.stackSize = MathHelper.ceiling_float_int((float)var16.stackSize / 2.0F); + } else if (this.field_147007_t && this.field_147008_s.size() > 1) { + var16 = var16.copy(); + var16.stackSize = this.field_146996_I; + + if (var16.stackSize == 0) { + var12 = "" + EnumChatFormatting.YELLOW + "0"; + } + } + + this.func_146982_a(var16, p_73863_1_ - var4 - var17, p_73863_2_ - var5 - var11, var12); + } + + if (this.field_146991_C != null) { + float var18 = (float)(Minecraft.getSystemTime() - this.field_146990_B) / 100.0F; + + if (var18 >= 1.0F) { + var18 = 1.0F; + this.field_146991_C = null; + } + + var11 = this.field_146989_A.xDisplayPosition - this.field_147011_y; + int var20 = this.field_146989_A.yDisplayPosition - this.field_147010_z; + int var13 = this.field_147011_y + (int)((float)var11 * var18); + int var14 = this.field_147010_z + (int)((float)var20 * var18); + this.func_146982_a(this.field_146991_C, var13, var14, null); + } + + GL11.glPopMatrix(); + + if (!CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled() || (Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.tooltips.getValue()) { + if (var15.getItemStack() == null && this.field_147006_u != null && this.field_147006_u.getHasStack()) { + ItemStack var19 = this.field_147006_u.getStack(); + this.func_146285_a(var19, p_73863_1_, p_73863_2_); + } + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } + + private void func_146982_a(ItemStack p_146982_1_, int p_146982_2_, int p_146982_3_, String p_146982_4_) { + GL11.glTranslatef(0.0F, 0.0F, 32.0F); + zLevel = 200.0F; + itemRender.zLevel = 200.0F; + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); + zLevel = 0.0F; + itemRender.zLevel = 0.0F; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) {} + + protected abstract void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_); + + private void func_146977_a(Slot p_146977_1_) { + int var2 = p_146977_1_.xDisplayPosition; + int var3 = p_146977_1_.yDisplayPosition; + ItemStack var4 = p_146977_1_.getStack(); + boolean var5 = false; + boolean var6 = p_146977_1_ == this.field_147005_v && this.field_147012_x != null && !this.field_147004_w; + ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); + String var8 = null; + + if (p_146977_1_ == this.field_147005_v && this.field_147012_x != null && this.field_147004_w && var4 != null) { + var4 = var4.copy(); + var4.stackSize /= 2; + } else if (this.field_147007_t && this.field_147008_s.contains(p_146977_1_) && var7 != null) { + if (this.field_147008_s.size() == 1) { + return; + } + + if (Container.func_94527_a(p_146977_1_, var7, true) && this.field_147002_h.canDragIntoSlot(p_146977_1_)) { + var4 = var7.copy(); + var5 = true; + Container.func_94525_a(this.field_147008_s, this.field_146987_F, var4, p_146977_1_.getStack() == null ? 0 : p_146977_1_.getStack().stackSize); + + if (var4.stackSize > var4.getMaxStackSize()) { + var8 = EnumChatFormatting.YELLOW + "" + var4.getMaxStackSize(); + var4.stackSize = var4.getMaxStackSize(); + } + + if (var4.stackSize > p_146977_1_.getSlotStackLimit()) { + var8 = EnumChatFormatting.YELLOW + "" + p_146977_1_.getSlotStackLimit(); + var4.stackSize = p_146977_1_.getSlotStackLimit(); + } + } else { + this.field_147008_s.remove(p_146977_1_); + this.func_146980_g(); + } + } + + zLevel = 100.0F; + itemRender.zLevel = 100.0F; + + if (var4 == null) { + IIcon var9 = p_146977_1_.getBackgroundIconIndex(); + + if (var9 != null) { + GL11.glDisable(GL11.GL_LIGHTING); + this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); + this.drawTexturedModelRectFromIcon(var2, var3, var9, 16, 16); + GL11.glEnable(GL11.GL_LIGHTING); + var6 = true; + } + } + + if (!var6) { + if (var5) { + drawRect(var2, var3, var2 + 16, var3 + 16, -2130706433); + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var4, var2, var3); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var4, var2, var3, var8); + } + + itemRender.zLevel = 0.0F; + zLevel = 0.0F; + } + + private void func_146980_g() { + ItemStack var1 = this.mc.thePlayer.inventory.getItemStack(); + + if (var1 != null && this.field_147007_t) { + this.field_146996_I = var1.stackSize; + ItemStack var4; + int var5; + + for (Iterator var2 = this.field_147008_s.iterator(); var2.hasNext(); this.field_146996_I -= var4.stackSize - var5) { + Slot var3 = (Slot)var2.next(); + var4 = var1.copy(); + var5 = var3.getStack() == null ? 0 : var3.getStack().stackSize; + Container.func_94525_a(this.field_147008_s, this.field_146987_F, var4, var5); + + if (var4.stackSize > var4.getMaxStackSize()) { + var4.stackSize = var4.getMaxStackSize(); + } + + if (var4.stackSize > var3.getSlotStackLimit()) { + var4.stackSize = var3.getSlotStackLimit(); + } + } + } + } + + private Slot func_146975_c(int p_146975_1_, int p_146975_2_) { + for (int var3 = 0; var3 < this.field_147002_h.inventorySlots.size(); ++var3) { + Slot var4 = (Slot)this.field_147002_h.inventorySlots.get(var3); + + if (this.func_146981_a(var4, p_146975_1_, p_146975_2_)) { + return var4; + } + } + + return null; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + this.func_146983_a(mouseButton - 100); + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + boolean var4 = mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100; + Slot var5 = this.func_146975_c(p_73864_1_, p_73864_2_); + long var6 = Minecraft.getSystemTime(); + this.field_146993_M = this.field_146998_K == var5 && var6 - this.field_146997_J < 250L && this.field_146992_L == mouseButton; + this.field_146995_H = false; + + if (mouseButton == 0 || mouseButton == 1 || var4) { + int var8 = this.field_147003_i; + int var9 = this.field_147009_r; + boolean var10 = p_73864_1_ < var8 || p_73864_2_ < var9 || p_73864_1_ >= var8 + this.field_146999_f || p_73864_2_ >= var9 + this.field_147000_g; + int var11 = -1; + if (var5 != null) { + var11 = var5.slotNumber; + } + + if (var10) { + var11 = -999; + } + + if (this.mc.gameSettings.touchscreen && var10 && this.mc.thePlayer.inventory.getItemStack() == null) { + this.mc.displayGuiScreen(null); + return; + } + + if (var11 != -1) { + if (this.mc.gameSettings.touchscreen) { + if (var5 != null && var5.getHasStack()) { + this.field_147005_v = var5; + this.field_147012_x = null; + this.field_147004_w = mouseButton == 1; + } else { + this.field_147005_v = null; + } + } else if (!this.field_147007_t) { + if (this.mc.thePlayer.inventory.getItemStack() == null) { + if (mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100) { + this.func_146984_a(var5, var11, mouseButton, 3); + } else { + boolean var12 = var11 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); + byte var13 = 0; + + if (var12) { + this.field_146994_N = var5 != null && var5.getHasStack() ? var5.getStack() : null; + var13 = 1; + } else if (var11 == -999) { + var13 = 4; + } + + this.func_146984_a(var5, var11, mouseButton, var13); + } + + this.field_146995_H = true; + } else { + this.field_147007_t = true; + this.field_146988_G = mouseButton; + this.field_147008_s.clear(); + + if (mouseButton == 0) { + this.field_146987_F = 0; + } else if (mouseButton == 1) { + this.field_146987_F = 1; + } + } + } + } + } + + this.field_146998_K = var5; + this.field_146997_J = var6; + this.field_146992_L = mouseButton; + } + + protected void mouseClickMove(int p_146273_1_, int p_146273_2_, int p_146273_3_, long p_146273_4_) { + Slot var6 = this.func_146975_c(p_146273_1_, p_146273_2_); + ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); + + if (this.field_147005_v != null && this.mc.gameSettings.touchscreen) { + if (p_146273_3_ == 0 || p_146273_3_ == 1) { + if (this.field_147012_x == null) { + if (var6 != this.field_147005_v) { + this.field_147012_x = this.field_147005_v.getStack().copy(); + } + } else if (this.field_147012_x.stackSize > 1 && var6 != null && Container.func_94527_a(var6, this.field_147012_x, false)) { + long var8 = Minecraft.getSystemTime(); + + if (this.field_146985_D == var6) { + if (var8 - this.field_146986_E > 500L) { + this.func_146984_a(this.field_147005_v, this.field_147005_v.slotNumber, 0, 0); + this.func_146984_a(var6, var6.slotNumber, 1, 0); + this.func_146984_a(this.field_147005_v, this.field_147005_v.slotNumber, 0, 0); + this.field_146986_E = var8 + 750L; + --this.field_147012_x.stackSize; + } + } else { + this.field_146985_D = var6; + this.field_146986_E = var8; + } + } + } + } else if (this.field_147007_t && var6 != null && var7 != null && var7.stackSize > this.field_147008_s.size() && Container.func_94527_a(var6, var7, true) && var6.isItemValid(var7) && this.field_147002_h.canDragIntoSlot(var6)) { + this.field_147008_s.add(var6); + this.func_146980_g(); + } + } + + protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) { + CheatBreaker.getInstance().getEventBus().handleEvent(new ClickEvent(p_146286_3_)); + Slot var4 = this.func_146975_c(p_146286_1_, p_146286_2_); + int var5 = this.field_147003_i; + int var6 = this.field_147009_r; + boolean var7 = p_146286_1_ < var5 || p_146286_2_ < var6 || p_146286_1_ >= var5 + this.field_146999_f || p_146286_2_ >= var6 + this.field_147000_g; + int var8 = -1; + + if (var4 != null) { + var8 = var4.slotNumber; + } + + if (var7) { + var8 = -999; + } + + Slot var10; + Iterator var11; + + if (this.field_146993_M && var4 != null && p_146286_3_ == 0 && this.field_147002_h.func_94530_a(null, var4)) { + if (isShiftKeyDown()) { + if (var4 != null && var4.inventory != null && this.field_146994_N != null) { + var11 = this.field_147002_h.inventorySlots.iterator(); + + while (var11.hasNext()) { + var10 = (Slot)var11.next(); + + if (var10 != null && var10.canTakeStack(this.mc.thePlayer) && var10.getHasStack() && var10.inventory == var4.inventory && Container.func_94527_a(var10, this.field_146994_N, true)) { + this.func_146984_a(var10, var10.slotNumber, p_146286_3_, 1); + } + } + } + } else { + this.func_146984_a(var4, var8, p_146286_3_, 6); + } + + this.field_146993_M = false; + this.field_146997_J = 0L; + } else { + if (this.field_147007_t && this.field_146988_G != p_146286_3_) { + this.field_147007_t = false; + this.field_147008_s.clear(); + this.field_146995_H = true; + return; + } + + if (this.field_146995_H) { + this.field_146995_H = false; + return; + } + + boolean var9; + + if (this.field_147005_v != null && this.mc.gameSettings.touchscreen) { + if (p_146286_3_ == 0 || p_146286_3_ == 1) { + if (this.field_147012_x == null && var4 != this.field_147005_v) { + this.field_147012_x = this.field_147005_v.getStack(); + } + + var9 = Container.func_94527_a(var4, this.field_147012_x, false); + + if (var8 != -1 && this.field_147012_x != null && var9) { + this.func_146984_a(this.field_147005_v, this.field_147005_v.slotNumber, p_146286_3_, 0); + this.func_146984_a(var4, var8, 0, 0); + + if (this.mc.thePlayer.inventory.getItemStack() != null) { + this.func_146984_a(this.field_147005_v, this.field_147005_v.slotNumber, p_146286_3_, 0); + this.field_147011_y = p_146286_1_ - var5; + this.field_147010_z = p_146286_2_ - var6; + this.field_146989_A = this.field_147005_v; + this.field_146991_C = this.field_147012_x; + this.field_146990_B = Minecraft.getSystemTime(); + } else { + this.field_146991_C = null; + } + } else if (this.field_147012_x != null) { + this.field_147011_y = p_146286_1_ - var5; + this.field_147010_z = p_146286_2_ - var6; + this.field_146989_A = this.field_147005_v; + this.field_146991_C = this.field_147012_x; + this.field_146990_B = Minecraft.getSystemTime(); + } + + this.field_147012_x = null; + this.field_147005_v = null; + } + } else if (this.field_147007_t && !this.field_147008_s.isEmpty()) { + this.func_146984_a(null, -999, Container.func_94534_d(0, this.field_146987_F), 5); + var11 = this.field_147008_s.iterator(); + + while (var11.hasNext()) { + var10 = (Slot)var11.next(); + this.func_146984_a(var10, var10.slotNumber, Container.func_94534_d(1, this.field_146987_F), 5); + } + + this.func_146984_a(null, -999, Container.func_94534_d(2, this.field_146987_F), 5); + } else if (this.mc.thePlayer.inventory.getItemStack() != null) { + if (p_146286_3_ == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100) { + this.func_146984_a(var4, var8, p_146286_3_, 3); + } else { + var9 = var8 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); + + if (var9) { + this.field_146994_N = var4 != null && var4.getHasStack() ? var4.getStack() : null; + } + + this.func_146984_a(var4, var8, p_146286_3_, var9 ? 1 : 0); + } + } + } + + if (this.mc.thePlayer.inventory.getItemStack() == null) { + this.field_146997_J = 0L; + } + + this.field_147007_t = false; + } + + private boolean func_146981_a(Slot p_146981_1_, int p_146981_2_, int p_146981_3_) { + return this.func_146978_c(p_146981_1_.xDisplayPosition, p_146981_1_.yDisplayPosition, 16, 16, p_146981_2_, p_146981_3_); + } + + protected boolean func_146978_c(int p_146978_1_, int p_146978_2_, int p_146978_3_, int p_146978_4_, int p_146978_5_, int p_146978_6_) { + int var7 = this.field_147003_i; + int var8 = this.field_147009_r; + p_146978_5_ -= var7; + p_146978_6_ -= var8; + return p_146978_5_ >= p_146978_1_ - 1 && p_146978_5_ < p_146978_1_ + p_146978_3_ + 1 && p_146978_6_ >= p_146978_2_ - 1 && p_146978_6_ < p_146978_2_ + p_146978_4_ + 1; + } + + protected void func_146984_a(Slot p_146984_1_, int p_146984_2_, int p_146984_3_, int p_146984_4_) { + if (p_146984_1_ != null) { + p_146984_2_ = p_146984_1_.slotNumber; + } + + this.mc.playerController.windowClick(this.field_147002_h.windowId, p_146984_2_, p_146984_3_, p_146984_4_, this.mc.thePlayer); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) { + this.mc.thePlayer.closeScreen(); + } + + this.func_146983_a(p_73869_2_); + + if (this.field_147006_u != null && this.field_147006_u.getHasStack()) { + if (p_73869_2_ == this.mc.gameSettings.keyBindPickBlock.getKeyCode()) { + this.func_146984_a(this.field_147006_u, this.field_147006_u.slotNumber, 0, 3); + } else if (p_73869_2_ == this.mc.gameSettings.keyBindDrop.getKeyCode()) { + this.func_146984_a(this.field_147006_u, this.field_147006_u.slotNumber, isCtrlKeyDown() ? 1 : 0, 4); + } + } + } + + protected boolean func_146983_a(int p_146983_1_) { + if (this.mc.thePlayer.inventory.getItemStack() == null && this.field_147006_u != null) { + for (int var2 = 0; var2 < 9; ++var2) { + if (p_146983_1_ == this.mc.gameSettings.keyBindsHotbar[var2].getKeyCode()) { + this.func_146984_a(this.field_147006_u, this.field_147006_u.slotNumber, var2, 2); + return true; + } + } + } + + return false; + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + if (this.mc.thePlayer != null) { + this.field_147002_h.onContainerClosed(this.mc.thePlayer); + } + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return false; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + + if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) { + this.mc.thePlayer.closeScreen(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java new file mode 100644 index 0000000..cef9cff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java @@ -0,0 +1,835 @@ +package net.minecraft.client.gui.inventory; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiContainerCreative extends InventoryEffectRenderer { + private static final ResourceLocation field_147061_u = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + private static final InventoryBasic field_147060_v = new InventoryBasic("tmp", true, 45); + private static int field_147058_w = CreativeTabs.tabBlock.getTabIndex(); + private float field_147067_x; + private boolean field_147066_y; + private boolean field_147065_z; + private GuiTextField field_147062_A; + private List field_147063_B; + private Slot field_147064_C; + private boolean field_147057_D; + private CreativeCrafting field_147059_E; + + + public GuiContainerCreative(EntityPlayer p_i1088_1_) { + super(new GuiContainerCreative.ContainerCreative(p_i1088_1_)); + p_i1088_1_.openContainer = this.field_147002_h; + this.field_146291_p = true; + this.field_147000_g = 136; + this.field_146999_f = 195; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + if (!this.mc.playerController.isInCreativeMode()) { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } + } + + protected void func_146984_a(Slot p_146984_1_, int p_146984_2_, int p_146984_3_, int p_146984_4_) { + this.field_147057_D = true; + boolean var5 = p_146984_4_ == 1; + p_146984_4_ = p_146984_2_ == -999 && p_146984_4_ == 0 ? 4 : p_146984_4_; + ItemStack var7; + InventoryPlayer var11; + + if (p_146984_1_ == null && field_147058_w != CreativeTabs.tabInventory.getTabIndex() && p_146984_4_ != 5) { + var11 = this.mc.thePlayer.inventory; + + if (var11.getItemStack() != null) { + if (p_146984_3_ == 0) { + this.mc.thePlayer.dropPlayerItemWithRandomChoice(var11.getItemStack(), true); + this.mc.playerController.sendPacketDropItem(var11.getItemStack()); + var11.setItemStack(null); + } + + if (p_146984_3_ == 1) { + var7 = var11.getItemStack().splitStack(1); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(var7, true); + this.mc.playerController.sendPacketDropItem(var7); + + if (var11.getItemStack().stackSize == 0) { + var11.setItemStack(null); + } + } + } + } else { + int var10; + + if (p_146984_1_ == this.field_147064_C && var5) { + for (var10 = 0; var10 < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++var10) { + this.mc.playerController.sendSlotPacket(null, var10); + } + } else { + ItemStack var6; + + if (field_147058_w == CreativeTabs.tabInventory.getTabIndex()) { + if (p_146984_1_ == this.field_147064_C) { + this.mc.thePlayer.inventory.setItemStack(null); + } else if (p_146984_4_ == 4 && p_146984_1_ != null && p_146984_1_.getHasStack()) { + var6 = p_146984_1_.decrStackSize(p_146984_3_ == 0 ? 1 : p_146984_1_.getStack().getMaxStackSize()); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(var6, true); + this.mc.playerController.sendPacketDropItem(var6); + } else if (p_146984_4_ == 4 && this.mc.thePlayer.inventory.getItemStack() != null) { + this.mc.thePlayer.dropPlayerItemWithRandomChoice(this.mc.thePlayer.inventory.getItemStack(), true); + this.mc.playerController.sendPacketDropItem(this.mc.thePlayer.inventory.getItemStack()); + this.mc.thePlayer.inventory.setItemStack(null); + } else { + this.mc.thePlayer.inventoryContainer.slotClick(p_146984_1_ == null ? p_146984_2_ : ((GuiContainerCreative.CreativeSlot)p_146984_1_).field_148332_b.slotNumber, p_146984_3_, p_146984_4_, this.mc.thePlayer); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } + } else if (p_146984_4_ != 5 && p_146984_1_.inventory == field_147060_v) { + var11 = this.mc.thePlayer.inventory; + var7 = var11.getItemStack(); + ItemStack var8 = p_146984_1_.getStack(); + ItemStack var9; + + if (p_146984_4_ == 2) { + if (var8 != null && p_146984_3_ >= 0 && p_146984_3_ < 9) { + var9 = var8.copy(); + var9.stackSize = var9.getMaxStackSize(); + this.mc.thePlayer.inventory.setInventorySlotContents(p_146984_3_, var9); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } + + return; + } + + if (p_146984_4_ == 3) { + if (var11.getItemStack() == null && p_146984_1_.getHasStack()) { + var9 = p_146984_1_.getStack().copy(); + var9.stackSize = var9.getMaxStackSize(); + var11.setItemStack(var9); + } + + return; + } + + if (p_146984_4_ == 4) { + if (var8 != null) { + var9 = var8.copy(); + var9.stackSize = p_146984_3_ == 0 ? 1 : var9.getMaxStackSize(); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(var9, true); + this.mc.playerController.sendPacketDropItem(var9); + } + + return; + } + + if (var7 != null && var8 != null && var7.isItemEqual(var8)) { + if (p_146984_3_ == 0) { + if (var5) { + var7.stackSize = var7.getMaxStackSize(); + } else if (var7.stackSize < var7.getMaxStackSize()) { + ++var7.stackSize; + } + } else if (var7.stackSize <= 1) { + var11.setItemStack(null); + } else { + --var7.stackSize; + } + } else if (var8 != null && var7 == null) { + var11.setItemStack(ItemStack.copyItemStack(var8)); + var7 = var11.getItemStack(); + + if (var5) { + var7.stackSize = var7.getMaxStackSize(); + } + } else { + var11.setItemStack(null); + } + } else { + this.field_147002_h.slotClick(p_146984_1_ == null ? p_146984_2_ : p_146984_1_.slotNumber, p_146984_3_, p_146984_4_, this.mc.thePlayer); + + if (Container.func_94532_c(p_146984_3_) == 2) { + for (var10 = 0; var10 < 9; ++var10) { + this.mc.playerController.sendSlotPacket(this.field_147002_h.getSlot(45 + var10).getStack(), 36 + var10); + } + } else if (p_146984_1_ != null) { + var6 = this.field_147002_h.getSlot(p_146984_1_.slotNumber).getStack(); + this.mc.playerController.sendSlotPacket(var6, p_146984_1_.slotNumber - this.field_147002_h.inventorySlots.size() + 9 + 36); + } + } + } + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + if (this.mc.playerController.isInCreativeMode()) { + super.initGui(); + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.field_147062_A = new GuiTextField(this.fontRendererObj, this.field_147003_i + 82, this.field_147009_r + 6, 89, this.fontRendererObj.FONT_HEIGHT); + this.field_147062_A.setMaxStringLength(15); + this.field_147062_A.func_146185_a(false); + this.field_147062_A.setVisible(false); + this.field_147062_A.func_146193_g(16777215); + int var1 = field_147058_w; + field_147058_w = -1; + this.func_147050_b(CreativeTabs.creativeTabArray[var1]); + this.field_147059_E = new CreativeCrafting(this.mc); + this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_147059_E); + } else { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + super.onGuiClosed(); + + if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) { + this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_147059_E); + } + + Keyboard.enableRepeatEvents(false); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (field_147058_w != CreativeTabs.tabAllSearch.getTabIndex()) { + if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) { + this.func_147050_b(CreativeTabs.tabAllSearch); + } else { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } else { + if (this.field_147057_D) { + this.field_147057_D = false; + this.field_147062_A.setText(""); + } + + if (!this.func_146983_a(p_73869_2_)) { + if (this.field_147062_A.keyTyped(p_73869_1_, p_73869_2_)) { + this.func_147053_i(); + } else { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } + } + } + + private void func_147053_i() { + GuiContainerCreative.ContainerCreative var1 = (GuiContainerCreative.ContainerCreative)this.field_147002_h; + var1.field_148330_a.clear(); + Iterator var2 = Item.itemRegistry.iterator(); + + while (var2.hasNext()) { + Item var3 = (Item)var2.next(); + + if (var3 != null && var3.getCreativeTab() != null) { + var3.getSubItems(var3, null, var1.field_148330_a); + } + } + + Enchantment[] var8 = Enchantment.enchantmentsList; + int var9 = var8.length; + + for (int var4 = 0; var4 < var9; ++var4) { + Enchantment var5 = var8[var4]; + + if (var5 != null && var5.type != null) { + Items.enchanted_book.func_92113_a(var5, var1.field_148330_a); + } + } + + var2 = var1.field_148330_a.iterator(); + String var10 = this.field_147062_A.getText().toLowerCase(); + + while (var2.hasNext()) { + ItemStack var11 = (ItemStack)var2.next(); + boolean var12 = false; + Iterator var6 = var11.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator(); + + while (true) { + if (var6.hasNext()) { + String var7 = (String)var6.next(); + + if (!var7.toLowerCase().contains(var10)) { + continue; + } + + var12 = true; + } + + if (!var12) { + var2.remove(); + } + + break; + } + } + + this.field_147067_x = 0.0F; + var1.func_148329_a(0.0F); + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + CreativeTabs var3 = CreativeTabs.creativeTabArray[field_147058_w]; + + if (var3.drawInForegroundOfTab()) { + GL11.glDisable(GL11.GL_BLEND); + this.fontRendererObj.drawString(I18n.format(var3.getTranslatedTabLabel()), 8, 6, 4210752); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int mouseButton) { + if (mouseButton == 0) { + int var4 = p_73864_1_ - this.field_147003_i; + int var5 = p_73864_2_ - this.field_147009_r; + CreativeTabs[] var6 = CreativeTabs.creativeTabArray; + int var7 = var6.length; + + for (int var8 = 0; var8 < var7; ++var8) { + CreativeTabs var9 = var6[var8]; + + if (this.func_147049_a(var9, var4, var5)) { + return; + } + } + } + + super.mouseClicked(p_73864_1_, p_73864_2_, mouseButton); + } + + protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) { + if (p_146286_3_ == 0) { + int var4 = p_146286_1_ - this.field_147003_i; + int var5 = p_146286_2_ - this.field_147009_r; + CreativeTabs[] var6 = CreativeTabs.creativeTabArray; + int var7 = var6.length; + + for (int var8 = 0; var8 < var7; ++var8) { + CreativeTabs var9 = var6[var8]; + + if (this.func_147049_a(var9, var4, var5)) { + this.func_147050_b(var9); + return; + } + } + } + + super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_); + } + + private boolean func_147055_p() { + return field_147058_w != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[field_147058_w].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148328_e(); + } + + private void func_147050_b(CreativeTabs p_147050_1_) { + int var2 = field_147058_w; + field_147058_w = p_147050_1_.getTabIndex(); + GuiContainerCreative.ContainerCreative var3 = (GuiContainerCreative.ContainerCreative)this.field_147002_h; + this.field_147008_s.clear(); + var3.field_148330_a.clear(); + p_147050_1_.displayAllReleventItems(var3.field_148330_a); + + if (p_147050_1_ == CreativeTabs.tabInventory) { + Container var4 = this.mc.thePlayer.inventoryContainer; + + if (this.field_147063_B == null) { + this.field_147063_B = var3.inventorySlots; + } + + var3.inventorySlots = new ArrayList(); + + for (int var5 = 0; var5 < var4.inventorySlots.size(); ++var5) { + GuiContainerCreative.CreativeSlot var6 = new GuiContainerCreative.CreativeSlot((Slot)var4.inventorySlots.get(var5), var5); + var3.inventorySlots.add(var6); + int var7; + int var8; + int var9; + + if (var5 >= 5 && var5 < 9) { + var7 = var5 - 5; + var8 = var7 / 2; + var9 = var7 % 2; + var6.xDisplayPosition = 9 + var8 * 54; + var6.yDisplayPosition = 6 + var9 * 27; + } else if (var5 >= 0 && var5 < 5) { + var6.yDisplayPosition = -2000; + var6.xDisplayPosition = -2000; + } else if (var5 < var4.inventorySlots.size()) { + var7 = var5 - 9; + var8 = var7 % 9; + var9 = var7 / 9; + var6.xDisplayPosition = 9 + var8 * 18; + + if (var5 >= 36) { + var6.yDisplayPosition = 112; + } else { + var6.yDisplayPosition = 54 + var9 * 18; + } + } + } + + this.field_147064_C = new Slot(field_147060_v, 0, 173, 112); + var3.inventorySlots.add(this.field_147064_C); + } else if (var2 == CreativeTabs.tabInventory.getTabIndex()) { + var3.inventorySlots = this.field_147063_B; + this.field_147063_B = null; + } + + if (this.field_147062_A != null) { + if (p_147050_1_ == CreativeTabs.tabAllSearch) { + this.field_147062_A.setVisible(true); + this.field_147062_A.func_146205_d(false); + this.field_147062_A.setFocused(true); + this.field_147062_A.setText(""); + this.func_147053_i(); + } else { + this.field_147062_A.setVisible(false); + this.field_147062_A.func_146205_d(true); + this.field_147062_A.setFocused(false); + } + } + + this.field_147067_x = 0.0F; + var3.func_148329_a(0.0F); + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() { + super.handleMouseInput(); + int var1 = Mouse.getEventDWheel(); + + if (var1 != 0 && this.func_147055_p()) { + int var2 = ((GuiContainerCreative.ContainerCreative)this.field_147002_h).field_148330_a.size() / 9 - 5 + 1; + + if (var1 > 0) { + var1 = 1; + } + + if (var1 < 0) { + var1 = -1; + } + + this.field_147067_x = (float)((double)this.field_147067_x - (double)var1 / (double)var2); + + if (this.field_147067_x < 0.0F) { + this.field_147067_x = 0.0F; + } + + if (this.field_147067_x > 1.0F) { + this.field_147067_x = 1.0F; + } + + ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148329_a(this.field_147067_x); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + boolean var4 = Mouse.isButtonDown(0); + int var5 = this.field_147003_i; + int var6 = this.field_147009_r; + int var7 = var5 + 175; + int var8 = var6 + 18; + int var9 = var7 + 14; + int var10 = var8 + 112; + + if (!this.field_147065_z && var4 && p_73863_1_ >= var7 && p_73863_2_ >= var8 && p_73863_1_ < var9 && p_73863_2_ < var10) { + this.field_147066_y = this.func_147055_p(); + } + + if (!var4) { + this.field_147066_y = false; + } + + this.field_147065_z = var4; + + if (this.field_147066_y) { + this.field_147067_x = ((float)(p_73863_2_ - var8) - 7.5F) / ((float)(var10 - var8) - 15.0F); + + if (this.field_147067_x < 0.0F) { + this.field_147067_x = 0.0F; + } + + if (this.field_147067_x > 1.0F) { + this.field_147067_x = 1.0F; + } + + ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148329_a(this.field_147067_x); + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + CreativeTabs[] var11 = CreativeTabs.creativeTabArray; + int var12 = var11.length; + + for (int var13 = 0; var13 < var12; ++var13) { + CreativeTabs var14 = var11[var13]; + + if (this.func_147052_b(var14, p_73863_1_, p_73863_2_)) { + break; + } + } + + if (this.field_147064_C != null && field_147058_w == CreativeTabs.tabInventory.getTabIndex() && this.func_146978_c(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, p_73863_1_, p_73863_2_)) { + this.func_146279_a(I18n.format("inventory.binSlot"), p_73863_1_, p_73863_2_); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + } + + protected void func_146285_a(ItemStack p_146285_1_, int p_146285_2_, int p_146285_3_) { + if (field_147058_w == CreativeTabs.tabAllSearch.getTabIndex()) { + List var4 = p_146285_1_.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + CreativeTabs var5 = p_146285_1_.getItem().getCreativeTab(); + + if (var5 == null && p_146285_1_.getItem() == Items.enchanted_book) { + Map var6 = EnchantmentHelper.getEnchantments(p_146285_1_); + + if (var6.size() == 1) { + Enchantment var7 = Enchantment.enchantmentsList[((Integer)var6.keySet().iterator().next()).intValue()]; + CreativeTabs[] var8 = CreativeTabs.creativeTabArray; + int var9 = var8.length; + + for (int var10 = 0; var10 < var9; ++var10) { + CreativeTabs var11 = var8[var10]; + + if (var11.func_111226_a(var7.type)) { + var5 = var11; + break; + } + } + } + } + + if (var5 != null) { + var4.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + I18n.format(var5.getTranslatedTabLabel())); + } + + for (int var12 = 0; var12 < var4.size(); ++var12) { + if (var12 == 0) { + var4.set(var12, p_146285_1_.getRarity().rarityColor + (String)var4.get(var12)); + } else { + var4.set(var12, EnumChatFormatting.GRAY + (String)var4.get(var12)); + } + } + + this.func_146283_a(var4, p_146285_2_, p_146285_3_); + } else { + super.func_146285_a(p_146285_1_, p_146285_2_, p_146285_3_); + } + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.enableGUIStandardItemLighting(); + CreativeTabs var4 = CreativeTabs.creativeTabArray[field_147058_w]; + CreativeTabs[] var5 = CreativeTabs.creativeTabArray; + int var6 = var5.length; + int var7; + + for (var7 = 0; var7 < var6; ++var7) { + CreativeTabs var8 = var5[var7]; + this.mc.getTextureManager().bindTexture(field_147061_u); + + if (var8.getTabIndex() != field_147058_w) { + this.func_147051_a(var8); + } + } + + this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + var4.getBackgroundImageName())); + drawTexturedModalRect(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g); + this.field_147062_A.drawTextBox(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int var9 = this.field_147003_i + 175; + var6 = this.field_147009_r + 18; + var7 = var6 + 112; + this.mc.getTextureManager().bindTexture(field_147061_u); + + if (var4.shouldHidePlayerInventory()) { + drawTexturedModalRect(var9, var6 + (int)((float)(var7 - var6 - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15); + } + + this.func_147051_a(var4); + + if (var4 == CreativeTabs.tabInventory) { + GuiInventory.func_147046_a(this.field_147003_i + 43, this.field_147009_r + 45, 20, (float)(this.field_147003_i + 43 - p_146976_2_), (float)(this.field_147009_r + 45 - 30 - p_146976_3_), this.mc.thePlayer); + } + } + + protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) { + int var4 = p_147049_1_.getTabColumn(); + int var5 = 28 * var4; + byte var6 = 0; + + if (var4 == 5) { + var5 = this.field_146999_f - 28 + 2; + } else if (var4 > 0) { + var5 += var4; + } + + int var7; + + if (p_147049_1_.isTabInFirstRow()) { + var7 = var6 - 32; + } else { + var7 = var6 + this.field_147000_g; + } + + return p_147049_2_ >= var5 && p_147049_2_ <= var5 + 28 && p_147049_3_ >= var7 && p_147049_3_ <= var7 + 32; + } + + protected boolean func_147052_b(CreativeTabs p_147052_1_, int p_147052_2_, int p_147052_3_) { + int var4 = p_147052_1_.getTabColumn(); + int var5 = 28 * var4; + byte var6 = 0; + + if (var4 == 5) { + var5 = this.field_146999_f - 28 + 2; + } else if (var4 > 0) { + var5 += var4; + } + + int var7; + + if (p_147052_1_.isTabInFirstRow()) { + var7 = var6 - 32; + } else { + var7 = var6 + this.field_147000_g; + } + + if (this.func_146978_c(var5 + 3, var7 + 3, 23, 27, p_147052_2_, p_147052_3_)) { + this.func_146279_a(I18n.format(p_147052_1_.getTranslatedTabLabel()), p_147052_2_, p_147052_3_); + return true; + } else { + return false; + } + } + + protected void func_147051_a(CreativeTabs p_147051_1_) { + boolean var2 = p_147051_1_.getTabIndex() == field_147058_w; + boolean var3 = p_147051_1_.isTabInFirstRow(); + int var4 = p_147051_1_.getTabColumn(); + int var5 = var4 * 28; + int var6 = 0; + int var7 = this.field_147003_i + 28 * var4; + int var8 = this.field_147009_r; + byte var9 = 32; + + if (var2) { + var6 += 32; + } + + if (var4 == 5) { + var7 = this.field_147003_i + this.field_146999_f - 28; + } else if (var4 > 0) { + var7 += var4; + } + + if (var3) { + var8 -= 28; + } else { + var6 += 64; + var8 += this.field_147000_g - 4; + } + + GL11.glDisable(GL11.GL_LIGHTING); + drawTexturedModalRect(var7, var8, var5, var6, 28, var9); + zLevel = 100.0F; + itemRender.zLevel = 100.0F; + var7 += 6; + var8 += 8 + (var3 ? 1 : -1); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + ItemStack var10 = p_147051_1_.getIconItemStack(); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var10, var7, var8); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), var10, var7, var8); + GL11.glDisable(GL11.GL_LIGHTING); + itemRender.zLevel = 0.0F; + zLevel = 0.0F; + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 0) { + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.func_146107_m())); + } + + if (p_146284_1_.id == 1) { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.func_146107_m())); + } + } + + public int func_147056_g() { + return field_147058_w; + } + + static class ContainerCreative extends Container { + public List field_148330_a = new ArrayList(); + + + public ContainerCreative(EntityPlayer p_i1086_1_) { + InventoryPlayer var2 = p_i1086_1_.inventory; + int var3; + + for (var3 = 0; var3 < 5; ++var3) { + for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(GuiContainerCreative.field_147060_v, var3 * 9 + var4, 9 + var4 * 18, 18 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer(new Slot(var2, var3, 9 + var3 * 18, 112)); + } + + this.func_148329_a(0.0F); + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + public void func_148329_a(float p_148329_1_) { + int var2 = this.field_148330_a.size() / 9 - 5 + 1; + int var3 = (int)((double)(p_148329_1_ * (float)var2) + 0.5D); + + if (var3 < 0) { + var3 = 0; + } + + for (int var4 = 0; var4 < 5; ++var4) { + for (int var5 = 0; var5 < 9; ++var5) { + int var6 = var5 + (var4 + var3) * 9; + + if (var6 >= 0 && var6 < this.field_148330_a.size()) { + GuiContainerCreative.field_147060_v.setInventorySlotContents(var5 + var4 * 9, (ItemStack)this.field_148330_a.get(var6)); + } else { + GuiContainerCreative.field_147060_v.setInventorySlotContents(var5 + var4 * 9, null); + } + } + } + } + + public boolean func_148328_e() { + return this.field_148330_a.size() > 45; + } + + protected void retrySlotClick(int p_75133_1_, int p_75133_2_, boolean p_75133_3_, EntityPlayer p_75133_4_) {} + + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + if (p_82846_2_ >= this.inventorySlots.size() - 9 && p_82846_2_ < this.inventorySlots.size()) { + Slot var3 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var3 != null && var3.getHasStack()) { + var3.putStack(null); + } + } + + return null; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) { + return p_94530_2_.yDisplayPosition > 90; + } + + public boolean canDragIntoSlot(Slot p_94531_1_) { + return p_94531_1_.inventory instanceof InventoryPlayer || p_94531_1_.yDisplayPosition > 90 && p_94531_1_.xDisplayPosition <= 162; + } + } + + class CreativeSlot extends Slot { + private final Slot field_148332_b; + + + public CreativeSlot(Slot p_i46313_2_, int p_i46313_3_) { + super(p_i46313_2_.inventory, p_i46313_3_, 0, 0); + this.field_148332_b = p_i46313_2_; + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { + this.field_148332_b.onPickupFromSlot(p_82870_1_, p_82870_2_); + } + + public boolean isItemValid(ItemStack p_75214_1_) { + return this.field_148332_b.isItemValid(p_75214_1_); + } + + public ItemStack getStack() { + return this.field_148332_b.getStack(); + } + + public boolean getHasStack() { + return this.field_148332_b.getHasStack(); + } + + public void putStack(ItemStack p_75215_1_) { + this.field_148332_b.putStack(p_75215_1_); + } + + public void onSlotChanged() { + this.field_148332_b.onSlotChanged(); + } + + public int getSlotStackLimit() { + return this.field_148332_b.getSlotStackLimit(); + } + + public IIcon getBackgroundIconIndex() { + return this.field_148332_b.getBackgroundIconIndex(); + } + + public ItemStack decrStackSize(int p_75209_1_) { + return this.field_148332_b.decrStackSize(p_75209_1_); + } + + public boolean isSlotInInventory(IInventory p_75217_1_, int p_75217_2_) { + return this.field_148332_b.isSlotInInventory(p_75217_1_, p_75217_2_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java new file mode 100644 index 0000000..4b761d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiCrafting.java @@ -0,0 +1,31 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +public class GuiCrafting extends GuiContainer { + private static final ResourceLocation field_147019_u = new ResourceLocation("textures/gui/container/crafting_table.png"); + + + public GuiCrafting(InventoryPlayer p_i46397_1_, World p_i46397_2_, int p_i46397_3_, int p_i46397_4_, int p_i46397_5_) { + super(new ContainerWorkbench(p_i46397_1_, p_i46397_2_, p_i46397_3_, p_i46397_4_, p_i46397_5_)); + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(I18n.format("container.crafting"), 28, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.field_147000_g - 96 + 2, 4210752); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147019_u); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java new file mode 100644 index 0000000..cb1c74e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiDispenser.java @@ -0,0 +1,34 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerDispenser; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiDispenser extends GuiContainer { + private static final ResourceLocation field_147088_v = new ResourceLocation("textures/gui/container/dispenser.png"); + public TileEntityDispenser field_147089_u; + + + public GuiDispenser(InventoryPlayer p_i46384_1_, TileEntityDispenser p_i46384_2_) { + super(new ContainerDispenser(p_i46384_1_, p_i46384_2_)); + this.field_147089_u = p_i46384_2_; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + String var3 = this.field_147089_u.isInventoryNameLocalized() ? this.field_147089_u.getInventoryName() : I18n.format(this.field_147089_u.getInventoryName()); + this.fontRendererObj.drawString(var3, this.field_146999_f / 2 - this.fontRendererObj.getStringWidth(var3) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.field_147000_g - 96 + 2, 4210752); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147088_v); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java new file mode 100644 index 0000000..fdcc28c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiEditSign.java @@ -0,0 +1,138 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.block.Block; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ChatAllowedCharacters; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +public class GuiEditSign extends GuiScreen { + private final TileEntitySign field_146848_f; + private int field_146849_g; + private int field_146851_h; + private GuiButton field_146852_i; + + + public GuiEditSign(TileEntitySign p_i1097_1_) { + this.field_146848_f = p_i1097_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.buttonList.add(this.field_146852_i = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, I18n.format("gui.done"))); + this.field_146848_f.func_145913_a(false); + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + NetHandlerPlayClient var1 = this.mc.getNetHandler(); + + if (var1 != null) { + var1.addToSendQueue(new C12PacketUpdateSign(this.field_146848_f.field_145851_c, this.field_146848_f.field_145848_d, this.field_146848_f.field_145849_e, this.field_146848_f.field_145915_a)); + } + + this.field_146848_f.func_145913_a(true); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + ++this.field_146849_g; + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.enabled) { + if (p_146284_1_.id == 0) { + this.field_146848_f.onInventoryChanged(); + this.mc.displayGuiScreen(null); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) { + if (p_73869_2_ == 200) { + this.field_146851_h = this.field_146851_h - 1 & 3; + } + + if (p_73869_2_ == 208 || p_73869_2_ == 28 || p_73869_2_ == 156) { + this.field_146851_h = this.field_146851_h + 1 & 3; + } + + if (p_73869_2_ == 14 && this.field_146848_f.field_145915_a[this.field_146851_h].length() > 0) { + this.field_146848_f.field_145915_a[this.field_146851_h] = this.field_146848_f.field_145915_a[this.field_146851_h].substring(0, this.field_146848_f.field_145915_a[this.field_146851_h].length() - 1); + } + + if (ChatAllowedCharacters.isAllowedCharacter(p_73869_1_) && this.field_146848_f.field_145915_a[this.field_146851_h].length() < 15) { + this.field_146848_f.field_145915_a[this.field_146851_h] = this.field_146848_f.field_145915_a[this.field_146851_h] + p_73869_1_; + } + + if (p_73869_2_ == 1) { + this.actionPerformed(this.field_146852_i); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("sign.edit"), this.width / 2, 40, 16777215); + GL11.glPushMatrix(); + GL11.glTranslatef((float)(this.width / 2), 0.0F, 50.0F); + float var4 = 93.75F; + GL11.glScalef(-var4, -var4, -var4); + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + Block var5 = this.field_146848_f.getBlockType(); + + if (var5 == Blocks.standing_sign) { + float var6 = (float)(this.field_146848_f.getBlockMetadata() * 360) / 16.0F; + GL11.glRotatef(var6, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, -1.0625F, 0.0F); + } else { + int var8 = this.field_146848_f.getBlockMetadata(); + float var7 = 0.0F; + + if (var8 == 2) { + var7 = 180.0F; + } + + if (var8 == 4) { + var7 = 90.0F; + } + + if (var8 == 5) { + var7 = -90.0F; + } + + GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, -1.0625F, 0.0F); + } + + if (this.field_146849_g / 6 % 2 == 0) { + this.field_146848_f.field_145918_i = this.field_146851_h; + } + + TileEntityRendererDispatcher.instance.func_147549_a(this.field_146848_f, -0.5D, -0.75D, -0.5D, 0.0F); + this.field_146848_f.field_145918_i = -1; + GL11.glPopMatrix(); + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java new file mode 100644 index 0000000..c57137b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiFurnace.java @@ -0,0 +1,41 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerFurnace; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiFurnace extends GuiContainer { + private static final ResourceLocation field_147087_u = new ResourceLocation("textures/gui/container/furnace.png"); + private final TileEntityFurnace field_147086_v; + + + public GuiFurnace(InventoryPlayer p_i1091_1_, TileEntityFurnace p_i1091_2_) { + super(new ContainerFurnace(p_i1091_1_, p_i1091_2_)); + this.field_147086_v = p_i1091_2_; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + String var3 = this.field_147086_v.isInventoryNameLocalized() ? this.field_147086_v.getInventoryName() : I18n.format(this.field_147086_v.getInventoryName()); + this.fontRendererObj.drawString(var3, this.field_146999_f / 2 - this.fontRendererObj.getStringWidth(var3) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.field_147000_g - 96 + 2, 4210752); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147087_u); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + + if (this.field_147086_v.func_145950_i()) { + int var6 = this.field_147086_v.func_145955_e(13); + drawTexturedModalRect(var4 + 56, var5 + 36 + 12 - var6, 176, 12 - var6, 14, var6 + 1); + var6 = this.field_147086_v.func_145953_d(24); + drawTexturedModalRect(var4 + 79, var5 + 34, 176, 14, var6 + 1, 16); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java new file mode 100644 index 0000000..35aae00 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiInventory.java @@ -0,0 +1,119 @@ +package net.minecraft.client.gui.inventory; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class GuiInventory extends InventoryEffectRenderer { + private float field_147048_u; + private float field_147047_v; + + + public GuiInventory(EntityPlayer p_i1094_1_) { + super(p_i1094_1_.inventoryContainer); + this.field_146291_p = true; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + if (this.mc.playerController.isInCreativeMode()) { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + + if (this.mc.playerController.isInCreativeMode()) { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } else { + super.initGui(); + } + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(I18n.format("container.crafting"), 86, 16, 4210752); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + this.field_147048_u = (float)p_73863_1_; + this.field_147047_v = (float)p_73863_2_; + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147001_a); + int var4 = this.field_147003_i; + int var5 = this.field_147009_r; + if (!(Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.transparentInventory.getValue() || !CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + } + func_147046_a(var4 + 51, var5 + 75, 30, (float)(var4 + 51) - this.field_147048_u, (float)(var5 + 75 - 50) - this.field_147047_v, this.mc.thePlayer); + } + + public static void func_147046_a(int p_147046_0_, int p_147046_1_, int p_147046_2_, float p_147046_3_, float p_147046_4_, EntityLivingBase p_147046_5_) { + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_147046_0_, (float)p_147046_1_, 50.0F); + GL11.glScalef((float)(-p_147046_2_), (float)p_147046_2_, (float)p_147046_2_); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + float var6 = p_147046_5_.renderYawOffset; + float var7 = p_147046_5_.rotationYaw; + float var8 = p_147046_5_.rotationPitch; + float var9 = p_147046_5_.prevRotationYawHead; + float var10 = p_147046_5_.rotationYawHead; + GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-((float)Math.atan(p_147046_4_ / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F); + p_147046_5_.renderYawOffset = (float)Math.atan(p_147046_3_ / 40.0F) * 20.0F; + p_147046_5_.rotationYaw = (float)Math.atan(p_147046_3_ / 40.0F) * 40.0F; + p_147046_5_.rotationPitch = -((float)Math.atan(p_147046_4_ / 40.0F)) * 20.0F; + p_147046_5_.rotationYawHead = p_147046_5_.rotationYaw; + p_147046_5_.prevRotationYawHead = p_147046_5_.rotationYaw; + GL11.glTranslatef(0.0F, p_147046_5_.yOffset, 0.0F); + RenderManager.instance.playerViewY = 180.0F; + RenderManager.instance.func_147940_a(p_147046_5_, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); + p_147046_5_.renderYawOffset = var6; + p_147046_5_.rotationYaw = var7; + p_147046_5_.rotationPitch = var8; + p_147046_5_.prevRotationYawHead = var9; + p_147046_5_.rotationYawHead = var10; + GL11.glPopMatrix(); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 0) { + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.func_146107_m())); + } + + if (p_146284_1_.id == 1) { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.func_146107_m())); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java new file mode 100644 index 0000000..198e8c4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java @@ -0,0 +1,59 @@ +package net.minecraft.client.gui.inventory; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiScreenHorseInventory extends GuiContainer { + private static final ResourceLocation field_147031_u = new ResourceLocation("textures/gui/container/horse.png"); + private final IInventory field_147030_v; + private final IInventory field_147029_w; + private final EntityHorse field_147034_x; + private float field_147033_y; + private float field_147032_z; + + + public GuiScreenHorseInventory(IInventory p_i1093_1_, IInventory p_i1093_2_, EntityHorse p_i1093_3_) { + super(new ContainerHorseInventory(p_i1093_1_, p_i1093_2_, p_i1093_3_)); + this.field_147030_v = p_i1093_1_; + this.field_147029_w = p_i1093_2_; + this.field_147034_x = p_i1093_3_; + this.field_146291_p = false; + } + + protected void func_146979_b(int p_146979_1_, int p_146979_2_) { + this.fontRendererObj.drawString(this.field_147029_w.isInventoryNameLocalized() ? this.field_147029_w.getInventoryName() : I18n.format(this.field_147029_w.getInventoryName()), 8, 6, 4210752); + this.fontRendererObj.drawString(this.field_147030_v.isInventoryNameLocalized() ? this.field_147030_v.getInventoryName() : I18n.format(this.field_147030_v.getInventoryName()), 8, this.field_147000_g - 96 + 2, 4210752); + } + + protected void func_146976_a(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147031_u); + int var4 = (this.width - this.field_146999_f) / 2; + int var5 = (this.height - this.field_147000_g) / 2; + drawTexturedModalRect(var4, var5, 0, 0, this.field_146999_f, this.field_147000_g); + + if (this.field_147034_x.isChested()) { + drawTexturedModalRect(var4 + 79, var5 + 17, 0, this.field_147000_g, 90, 54); + } + + if (this.field_147034_x.func_110259_cr()) { + drawTexturedModalRect(var4 + 7, var5 + 35, 0, this.field_147000_g + 54, 18, 18); + } + + GuiInventory.func_147046_a(var4 + 51, var5 + 60, 17, (float)(var4 + 51) - this.field_147033_y, (float)(var5 + 75 - 50) - this.field_147032_z, this.field_147034_x); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.field_147033_y = (float)p_73863_1_; + this.field_147032_z = (float)p_73863_2_; + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/main/Main.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/main/Main.java new file mode 100644 index 0000000..342e4a3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/main/Main.java @@ -0,0 +1,144 @@ +package net.minecraft.client.main; + +import com.google.common.collect.HashMultimap; +import com.google.gson.Gson; +import java.io.File; +import java.lang.reflect.ParameterizedType; +import java.net.Authenticator; +import java.net.InetSocketAddress; +import java.net.PasswordAuthentication; +import java.net.Proxy; +import java.net.Proxy.Type; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import joptsimple.ArgumentAcceptingOptionSpec; +import joptsimple.NonOptionArgumentSpec; +import joptsimple.OptionParser; +import joptsimple.OptionSet; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; + +public class Main { + private static final java.lang.reflect.Type field_152370_a = new ParameterizedType() { + + public java.lang.reflect.Type[] getActualTypeArguments() { + return new java.lang.reflect.Type[] {String.class, new ParameterizedType() { + + public java.lang.reflect.Type[] getActualTypeArguments() { + return new java.lang.reflect.Type[] {String.class}; + } + public java.lang.reflect.Type getRawType() { + return Collection.class; + } + public java.lang.reflect.Type getOwnerType() { + return null; + } + } + }; + } + public java.lang.reflect.Type getRawType() { + return Map.class; + } + public java.lang.reflect.Type getOwnerType() { + return null; + } + }; + + + public static void main(String[] p_main_0_) { + System.setProperty("java.net.preferIPv4Stack", "true"); + OptionParser var1 = new OptionParser(); + var1.allowsUnrecognizedOptions(); + var1.accepts("demo"); + var1.accepts("fullscreen"); + ArgumentAcceptingOptionSpec var2 = var1.accepts("server").withRequiredArg(); + ArgumentAcceptingOptionSpec var3 = var1.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(25565)); + ArgumentAcceptingOptionSpec var4 = var1.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File(".")); + ArgumentAcceptingOptionSpec var5 = var1.accepts("assetsDir").withRequiredArg().ofType(File.class); + ArgumentAcceptingOptionSpec var6 = var1.accepts("resourcePackDir").withRequiredArg().ofType(File.class); + ArgumentAcceptingOptionSpec var7 = var1.accepts("proxyHost").withRequiredArg(); + ArgumentAcceptingOptionSpec var8 = var1.accepts("proxyPort").withRequiredArg().defaultsTo("8080", new String[0]).ofType(Integer.class); + ArgumentAcceptingOptionSpec var9 = var1.accepts("proxyUser").withRequiredArg(); + ArgumentAcceptingOptionSpec var10 = var1.accepts("proxyPass").withRequiredArg(); + ArgumentAcceptingOptionSpec var11 = var1.accepts("username").withRequiredArg().defaultsTo("Player" + Minecraft.getSystemTime() % 1000L); + ArgumentAcceptingOptionSpec var12 = var1.accepts("uuid").withRequiredArg(); + ArgumentAcceptingOptionSpec var13 = var1.accepts("accessToken").withOptionalArg(); + ArgumentAcceptingOptionSpec var14 = var1.accepts("version").withRequiredArg().required(); + ArgumentAcceptingOptionSpec var15 = var1.accepts("width").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(854)); + ArgumentAcceptingOptionSpec var16 = var1.accepts("height").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(480)); + ArgumentAcceptingOptionSpec var17 = var1.accepts("userProperties").withRequiredArg().required(); + ArgumentAcceptingOptionSpec var18 = var1.accepts("assetIndex").withRequiredArg(); + ArgumentAcceptingOptionSpec var19 = var1.accepts("userType").withRequiredArg().defaultsTo("legacy"); + NonOptionArgumentSpec var20 = var1.nonOptions(); + OptionSet var21 = var1.parse(p_main_0_); + List var22 = var21.valuesOf(var20); + String var23 = (String)var21.valueOf(var7); + Proxy var24 = Proxy.NO_PROXY; + + if (var23 != null) { + try { + var24 = new Proxy(Type.SOCKS, new InetSocketAddress(var23, ((Integer)var21.valueOf(var8)).intValue())); + } catch (Exception ignored) { + } + } + + final String var25 = (String)var21.valueOf(var9); + final String var26 = (String)var21.valueOf(var10); + + if (!var24.equals(Proxy.NO_PROXY) && func_110121_a(var25) && func_110121_a(var26)) { + Authenticator.setDefault(new Authenticator() { + + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(var25, var26.toCharArray()); + } + }); + } + + int var27 = ((Integer)var21.valueOf(var15)).intValue(); + int var28 = ((Integer)var21.valueOf(var16)).intValue(); + boolean var29 = var21.has("fullscreen"); + boolean var30 = var21.has("demo"); + String var31 = (String)var21.valueOf(var14); + HashMultimap var32 = HashMultimap.create(); + Iterator var33 = ((Map)(new Gson()).fromJson((String)var21.valueOf(var17), field_152370_a)).entrySet().iterator(); + + while (var33.hasNext()) { + Entry var34 = (Entry)var33.next(); + var32.putAll(var34.getKey(), (Iterable)var34.getValue()); + } + + File var42 = (File)var21.valueOf(var4); + File var43 = var21.has(var5) ? (File)var21.valueOf(var5) : new File(var42, "assets/"); + File var35 = var21.has(var6) ? (File)var21.valueOf(var6) : new File(var42, "resourcepacks/"); + String var36 = var21.has(var12) ? (String)var12.value(var21) : (String)var11.value(var21); + String var37 = var21.has(var18) ? (String)var18.value(var21) : null; + Session var38 = new Session((String)var11.value(var21), var36, (String)var13.value(var21), (String)var19.value(var21)); + Minecraft var39 = new Minecraft(var38, var27, var28, var29, var30, var42, var43, var35, var24, var31, var32, var37); + String var40 = (String)var21.valueOf(var2); + + if (var40 != null) { + var39.setServer(var40, ((Integer)var21.valueOf(var3)).intValue()); + } + + Runtime.getRuntime().addShutdownHook(new Thread("Client Shutdown Thread") { + + public void run() { + Minecraft.stopIntegratedServer(); + } + }); + + if (!var22.isEmpty()) { + System.out.println("Completely ignored arguments: " + var22); + } + + Thread.currentThread().setName("Client thread"); + var39.run(); + } + + private static boolean func_110121_a(String p_110121_0_) { + return p_110121_0_ != null && !p_110121_0_.isEmpty(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBase.java new file mode 100644 index 0000000..cce7b22 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBase.java @@ -0,0 +1,56 @@ +package net.minecraft.client.model; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; + +public abstract class ModelBase { + public float onGround; + public boolean isRiding; + + /** + * This is a list of all the boxes (ModelRenderer.class) in the current model. + */ + public List boxList = new ArrayList(); + public boolean isChild = true; + + /** A mapping for all texture offsets */ + private final Map modelTextureMap = new HashMap(); + public int textureWidth = 64; + public int textureHeight = 32; + + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) {} + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {} + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) {} + + public ModelRenderer getRandomModelBox(Random p_85181_1_) { + return (ModelRenderer)this.boxList.get(p_85181_1_.nextInt(this.boxList.size())); + } + + protected void setTextureOffset(String p_78085_1_, int p_78085_2_, int p_78085_3_) { + this.modelTextureMap.put(p_78085_1_, new TextureOffset(p_78085_2_, p_78085_3_)); + } + + public TextureOffset getTextureOffset(String p_78084_1_) { + return (TextureOffset)this.modelTextureMap.get(p_78084_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBat.java new file mode 100644 index 0000000..59c67b6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBat.java @@ -0,0 +1,108 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.util.MathHelper; + +public class ModelBat extends ModelBase { + private final ModelRenderer batHead; + + /** The body box of the bat model. */ + private final ModelRenderer batBody; + + /** The inner right wing box of the bat model. */ + private final ModelRenderer batRightWing; + + /** The inner left wing box of the bat model. */ + private final ModelRenderer batLeftWing; + + /** The outer right wing box of the bat model. */ + private final ModelRenderer batOuterRightWing; + + /** The outer left wing box of the bat model. */ + private final ModelRenderer batOuterLeftWing; + + + public ModelBat() { + this.textureWidth = 64; + this.textureHeight = 64; + this.batHead = new ModelRenderer(this, 0, 0); + this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6); + ModelRenderer var1 = new ModelRenderer(this, 24, 0); + var1.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(var1); + ModelRenderer var2 = new ModelRenderer(this, 24, 0); + var2.mirror = true; + var2.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(var2); + this.batBody = new ModelRenderer(this, 0, 16); + this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6); + this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1); + this.batRightWing = new ModelRenderer(this, 42, 0); + this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterRightWing = new ModelRenderer(this, 24, 16); + this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F); + this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1); + this.batLeftWing = new ModelRenderer(this, 42, 0); + this.batLeftWing.mirror = true; + this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterLeftWing = new ModelRenderer(this, 24, 16); + this.batOuterLeftWing.mirror = true; + this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F); + this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1); + this.batBody.addChild(this.batRightWing); + this.batBody.addChild(this.batLeftWing); + this.batRightWing.addChild(this.batOuterRightWing); + this.batLeftWing.addChild(this.batOuterLeftWing); + } + + /** + * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and + * it seems a good match for a bats size + */ + public int getBatSize() { + return 36; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + EntityBat var8 = (EntityBat)p_78088_1_; + float var9; + + if (var8.getIsBatHanging()) { + var9 = (180F / (float)Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); + this.batHead.rotateAngleY = (float)Math.PI - p_78088_5_ / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = (float)Math.PI; + this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); + this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); + this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); + this.batBody.rotateAngleX = (float)Math.PI; + this.batRightWing.rotateAngleX = -0.15707964F; + this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); + this.batOuterRightWing.rotateAngleY = -1.7278761F; + this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; + } else { + var9 = (180F / (float)Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); + this.batHead.rotateAngleY = p_78088_5_ / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = 0.0F; + this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F; + this.batBody.rotateAngleY = 0.0F; + this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float)Math.PI * 0.25F; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; + this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; + } + + this.batHead.render(p_78088_7_); + this.batBody.render(p_78088_7_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBiped.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBiped.java new file mode 100644 index 0000000..e26b004 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBiped.java @@ -0,0 +1,256 @@ +package net.minecraft.client.model; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.cheatbreaker.client.event.impl.PlayerAnimationEvent; +import com.cheatbreaker.client.cosmetic.data.AnimationStage; +import com.cheatbreaker.client.cosmetic.type.model.CosmeticModelWings; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelBiped extends ModelBase { + public ModelRenderer bipedHead; + public ModelRenderer bipedHeadwear; + public ModelRenderer bipedBody; + public ModelRenderer bipedRightArm; + public ModelRenderer bipedLeftArm; + public ModelRenderer bipedRightLeg; + public ModelRenderer bipedLeftLeg; + public ModelRenderer bipedEars; + public ModelRenderer bipedCloak; + private CosmeticModelWings dragonWingsBiped; + + /** + * Records whether the model should be rendered holding an item in the left hand, and if that item is a block. + */ + public int heldItemLeft; + + /** + * Records whether the model should be rendered holding an item in the right hand, and if that item is a block. + */ + public int heldItemRight; + public boolean isSneak; + + /** Records whether the model should be rendered aiming a bow. */ + public boolean aimedBow; + + + public ModelBiped() { + this(0.0F); + } + + public ModelBiped(float p_i1148_1_) { + this(p_i1148_1_, 0.0F, 64, 32); + } + + public ModelBiped(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_) { + this.textureWidth = p_i1149_3_; + this.textureHeight = p_i1149_4_; + this.bipedCloak = new ModelRenderer(this, 0, 0); + this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, p_i1149_1_); + this.bipedEars = new ModelRenderer(this, 24, 0); + this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, p_i1149_1_); + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedHeadwear = new ModelRenderer(this, 32, 0); + this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_ + 0.5F); + this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedBody = new ModelRenderer(this, 16, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_); + this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F); + this.dragonWingsBiped = new CosmeticModelWings(0.0f); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + if (p_78088_1_ instanceof AbstractClientPlayer) { + CheatBreaker.getInstance().getEventBus().handleEvent(new PlayerAnimationEvent(AnimationStage.START, (AbstractClientPlayer)p_78088_1_, this, p_78088_7_)); + } + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); + GL11.glTranslatef(0.0F, 16.0F * p_78088_7_, 0.0F); + this.bipedHead.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.bipedBody.render(p_78088_7_); + this.bipedRightArm.render(p_78088_7_); + this.bipedLeftArm.render(p_78088_7_); + this.bipedRightLeg.render(p_78088_7_); + this.bipedLeftLeg.render(p_78088_7_); + this.bipedHeadwear.render(p_78088_7_); + GL11.glPopMatrix(); + } else { + this.bipedHead.render(p_78088_7_); + this.bipedBody.render(p_78088_7_); + this.bipedRightArm.render(p_78088_7_); + this.bipedLeftArm.render(p_78088_7_); + this.bipedRightLeg.render(p_78088_7_); + this.bipedLeftLeg.render(p_78088_7_); + this.bipedHeadwear.render(p_78088_7_); + } + + EntityPlayer entityPlayer; + if (!this.aimedBow && p_78088_1_ instanceof EntityPlayer && (entityPlayer = (EntityPlayer)p_78088_1_).hasWings()) { + if (entityPlayer.getWings().getType() == Cosmetic.CosmeticType.WINGS && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showCheatBreakerWings.getValue()) { + this.dragonWingsBiped.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, entityPlayer.getWings().getScale(), entityPlayer.getWings().getLocation()); + } + } + + if (p_78088_1_ instanceof AbstractClientPlayer) { + CheatBreaker.getInstance().getEventBus().handleEvent(new PlayerAnimationEvent(AnimationStage.END, (AbstractClientPlayer)p_78088_1_, this, p_78088_7_)); + this.bipedRightLeg.rotateAngleZ = 0; + this.bipedLeftLeg.rotateAngleZ = 0; + this.bipedLeftLeg.offsetX = 0; + this.bipedRightLeg.offsetX = 0; + this.bipedBody.rotateAngleZ = 0; + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F; + this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.bipedRightLeg.rotateAngleY = 0.0F; + this.bipedLeftLeg.rotateAngleY = 0.0F; + + if (this.isRiding) { + this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); + this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); + } + + if (this.heldItemLeft != 0) { + this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; + } + + if (this.heldItemRight != 0) { + this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; + } + + this.bipedRightArm.rotateAngleY = 0.0F; + this.bipedLeftArm.rotateAngleY = 0.0F; + float var8; + float var9; + + if (this.onGround > -9990.0F) { + var8 = this.onGround; + this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(var8) * (float)Math.PI * 2.0F) * 0.2F; + this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; + var8 = 1.0F - this.onGround; + var8 *= var8; + var8 *= var8; + var8 = 1.0F - var8; + var9 = MathHelper.sin(var8 * (float)Math.PI); + float var10 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)var9 * 1.2D + (double)var10)); + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; + this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F; + } + + if (this.isSneak) { + this.bipedBody.rotateAngleX = 0.5F; + this.bipedRightArm.rotateAngleX += 0.4F; + this.bipedLeftArm.rotateAngleX += 0.4F; + this.bipedRightLeg.rotationPointZ = 4.0F; + this.bipedLeftLeg.rotationPointZ = 4.0F; + this.bipedRightLeg.rotationPointY = 9.0F; + this.bipedLeftLeg.rotationPointY = 9.0F; + this.bipedHead.rotationPointY = 1.0F; + this.bipedHeadwear.rotationPointY = 1.0F; + } else { + this.bipedBody.rotateAngleX = 0.0F; + this.bipedRightLeg.rotationPointZ = 0.1F; + this.bipedLeftLeg.rotationPointZ = 0.1F; + this.bipedRightLeg.rotationPointY = 12.0F; + this.bipedLeftLeg.rotationPointY = 12.0F; + this.bipedHead.rotationPointY = 0.0F; + this.bipedHeadwear.rotationPointY = 0.0F; + } + + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + + if (this.aimedBow) { + var8 = 0.0F; + var9 = 0.0F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F) + this.bipedHead.rotateAngleY; + this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } + } + + /** + * renders the ears (specifically, deadmau5's) + */ + public void renderEars(float p_78110_1_) { + this.bipedEars.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedEars.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedEars.rotationPointX = 0.0F; + this.bipedEars.rotationPointY = 0.0F; + this.bipedEars.render(p_78110_1_); + } + + /** + * Renders the cloak of the current biped (in most cases, it's a player) + */ + public void renderCloak(float p_78111_1_) { + this.bipedCloak.render(p_78111_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBlaze.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBlaze.java new file mode 100644 index 0000000..238c7c1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBlaze.java @@ -0,0 +1,75 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelBlaze extends ModelBase { + /** The sticks that fly around the Blaze. */ + private final ModelRenderer[] blazeSticks = new ModelRenderer[12]; + private final ModelRenderer blazeHead; + + + public ModelBlaze() { + for (int var1 = 0; var1 < this.blazeSticks.length; ++var1) { + this.blazeSticks[var1] = new ModelRenderer(this, 0, 16); + this.blazeSticks[var1].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2); + } + + this.blazeHead = new ModelRenderer(this, 0, 0); + this.blazeHead.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + } + + public int func_78104_a() { + return 8; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.blazeHead.render(p_78088_7_); + + for (int var8 = 0; var8 < this.blazeSticks.length; ++var8) { + this.blazeSticks[var8].render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + float var8 = p_78087_3_ * (float)Math.PI * -0.1F; + int var9; + + for (var9 = 0; var9 < 4; ++var9) { + this.blazeSticks[var9].rotationPointY = -2.0F + MathHelper.cos(((float)(var9 * 2) + p_78087_3_) * 0.25F); + this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 9.0F; + this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 9.0F; + ++var8; + } + + var8 = ((float)Math.PI / 4F) + p_78087_3_ * (float)Math.PI * 0.03F; + + for (var9 = 4; var9 < 8; ++var9) { + this.blazeSticks[var9].rotationPointY = 2.0F + MathHelper.cos(((float)(var9 * 2) + p_78087_3_) * 0.25F); + this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 7.0F; + this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 7.0F; + ++var8; + } + + var8 = 0.47123894F + p_78087_3_ * (float)Math.PI * -0.05F; + + for (var9 = 8; var9 < 12; ++var9) { + this.blazeSticks[var9].rotationPointY = 11.0F + MathHelper.cos(((float)var9 * 1.5F + p_78087_3_) * 0.5F); + this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 5.0F; + this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 5.0F; + ++var8; + } + + this.blazeHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.blazeHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBoat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBoat.java new file mode 100644 index 0000000..fcce1ce --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBoat.java @@ -0,0 +1,43 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelBoat extends ModelBase { + public ModelRenderer[] boatSides = new ModelRenderer[5]; + + + public ModelBoat() { + this.boatSides[0] = new ModelRenderer(this, 0, 8); + this.boatSides[1] = new ModelRenderer(this, 0, 0); + this.boatSides[2] = new ModelRenderer(this, 0, 0); + this.boatSides[3] = new ModelRenderer(this, 0, 0); + this.boatSides[4] = new ModelRenderer(this, 0, 0); + byte var1 = 24; + byte var2 = 6; + byte var3 = 20; + byte var4 = 4; + this.boatSides[0].addBox((float)(-var1 / 2), (float)(-var3 / 2 + 2), -3.0F, var1, var3 - 4, 4, 0.0F); + this.boatSides[0].setRotationPoint(0.0F, var4, 0.0F); + this.boatSides[1].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.boatSides[1].setRotationPoint((float)(-var1 / 2 + 1), var4, 0.0F); + this.boatSides[2].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.boatSides[2].setRotationPoint((float)(var1 / 2 - 1), var4, 0.0F); + this.boatSides[3].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.boatSides[3].setRotationPoint(0.0F, var4, (float)(-var3 / 2 + 1)); + this.boatSides[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.boatSides[4].setRotationPoint(0.0F, var4, (float)(var3 / 2 - 1)); + this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F); + this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F); + this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F); + this.boatSides[3].rotateAngleY = (float)Math.PI; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + for (int var8 = 0; var8 < 5; ++var8) { + this.boatSides[var8].render(p_78088_7_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBook.java new file mode 100644 index 0000000..334cca2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBook.java @@ -0,0 +1,67 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelBook extends ModelBase { + /** Right cover renderer (when facing the book) */ + public ModelRenderer coverRight = (new ModelRenderer(this)).setTextureOffset(0, 0).addBox(-6.0F, -5.0F, 0.0F, 6, 10, 0); + + /** Left cover renderer (when facing the book) */ + public ModelRenderer coverLeft = (new ModelRenderer(this)).setTextureOffset(16, 0).addBox(0.0F, -5.0F, 0.0F, 6, 10, 0); + + /** The right pages renderer (when facing the book) */ + public ModelRenderer pagesRight = (new ModelRenderer(this)).setTextureOffset(0, 10).addBox(0.0F, -4.0F, -0.99F, 5, 8, 1); + + /** The left pages renderer (when facing the book) */ + public ModelRenderer pagesLeft = (new ModelRenderer(this)).setTextureOffset(12, 10).addBox(0.0F, -4.0F, -0.01F, 5, 8, 1); + + /** Right cover renderer (when facing the book) */ + public ModelRenderer flippingPageRight = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); + + /** Right cover renderer (when facing the book) */ + public ModelRenderer flippingPageLeft = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); + + /** The renderer of spine of the book */ + public ModelRenderer bookSpine = (new ModelRenderer(this)).setTextureOffset(12, 0).addBox(-1.0F, -5.0F, 0.0F, 2, 10, 0); + + + public ModelBook() { + this.coverRight.setRotationPoint(0.0F, 0.0F, -1.0F); + this.coverLeft.setRotationPoint(0.0F, 0.0F, 1.0F); + this.bookSpine.rotateAngleY = ((float)Math.PI / 2F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.coverRight.render(p_78088_7_); + this.coverLeft.render(p_78088_7_); + this.bookSpine.render(p_78088_7_); + this.pagesRight.render(p_78088_7_); + this.pagesLeft.render(p_78088_7_); + this.flippingPageRight.render(p_78088_7_); + this.flippingPageLeft.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + float var8 = (MathHelper.sin(p_78087_1_ * 0.02F) * 0.1F + 1.25F) * p_78087_4_; + this.coverRight.rotateAngleY = (float)Math.PI + var8; + this.coverLeft.rotateAngleY = -var8; + this.pagesRight.rotateAngleY = var8; + this.pagesLeft.rotateAngleY = -var8; + this.flippingPageRight.rotateAngleY = var8 - var8 * 2.0F * p_78087_2_; + this.flippingPageLeft.rotateAngleY = var8 - var8 * 2.0F * p_78087_3_; + this.pagesRight.rotationPointX = MathHelper.sin(var8); + this.pagesLeft.rotationPointX = MathHelper.sin(var8); + this.flippingPageRight.rotationPointX = MathHelper.sin(var8); + this.flippingPageLeft.rotationPointX = MathHelper.sin(var8); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBox.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBox.java new file mode 100644 index 0000000..cc7eab3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelBox.java @@ -0,0 +1,102 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.Tessellator; + +public class ModelBox { + /** + * The (x,y,z) vertex positions and (u,v) texture coordinates for each of the 8 points on a cube + */ + private final PositionTextureVertex[] vertexPositions; + + /** An array of 6 TexturedQuads, one for each face of a cube */ + private final TexturedQuad[] quadList; + + /** X vertex coordinate of lower box corner */ + public final float posX1; + + /** Y vertex coordinate of lower box corner */ + public final float posY1; + + /** Z vertex coordinate of lower box corner */ + public final float posZ1; + + /** X vertex coordinate of upper box corner */ + public final float posX2; + + /** Y vertex coordinate of upper box corner */ + public final float posY2; + + /** Z vertex coordinate of upper box corner */ + public final float posZ2; + public String field_78247_g; + + + public ModelBox(ModelRenderer p_i46359_1_, int p_i46359_2_, int p_i46359_3_, float p_i46359_4_, float p_i46359_5_, float p_i46359_6_, int p_i46359_7_, int p_i46359_8_, int p_i46359_9_, float p_i46359_10_) { + this.posX1 = p_i46359_4_; + this.posY1 = p_i46359_5_; + this.posZ1 = p_i46359_6_; + this.posX2 = p_i46359_4_ + (float)p_i46359_7_; + this.posY2 = p_i46359_5_ + (float)p_i46359_8_; + this.posZ2 = p_i46359_6_ + (float)p_i46359_9_; + this.vertexPositions = new PositionTextureVertex[8]; + this.quadList = new TexturedQuad[6]; + float var11 = p_i46359_4_ + (float)p_i46359_7_; + float var12 = p_i46359_5_ + (float)p_i46359_8_; + float var13 = p_i46359_6_ + (float)p_i46359_9_; + p_i46359_4_ -= p_i46359_10_; + p_i46359_5_ -= p_i46359_10_; + p_i46359_6_ -= p_i46359_10_; + var11 += p_i46359_10_; + var12 += p_i46359_10_; + var13 += p_i46359_10_; + + if (p_i46359_1_.mirror) { + float var14 = var11; + var11 = p_i46359_4_; + p_i46359_4_ = var14; + } + + PositionTextureVertex var23 = new PositionTextureVertex(p_i46359_4_, p_i46359_5_, p_i46359_6_, 0.0F, 0.0F); + PositionTextureVertex var15 = new PositionTextureVertex(var11, p_i46359_5_, p_i46359_6_, 0.0F, 8.0F); + PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, p_i46359_6_, 8.0F, 8.0F); + PositionTextureVertex var17 = new PositionTextureVertex(p_i46359_4_, var12, p_i46359_6_, 8.0F, 0.0F); + PositionTextureVertex var18 = new PositionTextureVertex(p_i46359_4_, p_i46359_5_, var13, 0.0F, 0.0F); + PositionTextureVertex var19 = new PositionTextureVertex(var11, p_i46359_5_, var13, 0.0F, 8.0F); + PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F); + PositionTextureVertex var21 = new PositionTextureVertex(p_i46359_4_, var12, var13, 8.0F, 0.0F); + this.vertexPositions[0] = var23; + this.vertexPositions[1] = var15; + this.vertexPositions[2] = var16; + this.vertexPositions[3] = var17; + this.vertexPositions[4] = var18; + this.vertexPositions[5] = var19; + this.vertexPositions[6] = var20; + this.vertexPositions[7] = var21; + this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {var19, var15, var16, var20}, p_i46359_2_ + p_i46359_9_ + p_i46359_7_, p_i46359_3_ + p_i46359_9_, p_i46359_2_ + p_i46359_9_ + p_i46359_7_ + p_i46359_9_, p_i46359_3_ + p_i46359_9_ + p_i46359_8_, p_i46359_1_.textureWidth, p_i46359_1_.textureHeight); + this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {var23, var18, var21, var17}, p_i46359_2_, p_i46359_3_ + p_i46359_9_, p_i46359_2_ + p_i46359_9_, p_i46359_3_ + p_i46359_9_ + p_i46359_8_, p_i46359_1_.textureWidth, p_i46359_1_.textureHeight); + this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {var19, var18, var23, var15}, p_i46359_2_ + p_i46359_9_, p_i46359_3_, p_i46359_2_ + p_i46359_9_ + p_i46359_7_, p_i46359_3_ + p_i46359_9_, p_i46359_1_.textureWidth, p_i46359_1_.textureHeight); + this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {var16, var17, var21, var20}, p_i46359_2_ + p_i46359_9_ + p_i46359_7_, p_i46359_3_ + p_i46359_9_, p_i46359_2_ + p_i46359_9_ + p_i46359_7_ + p_i46359_7_, p_i46359_3_, p_i46359_1_.textureWidth, p_i46359_1_.textureHeight); + this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {var15, var23, var17, var16}, p_i46359_2_ + p_i46359_9_, p_i46359_3_ + p_i46359_9_, p_i46359_2_ + p_i46359_9_ + p_i46359_7_, p_i46359_3_ + p_i46359_9_ + p_i46359_8_, p_i46359_1_.textureWidth, p_i46359_1_.textureHeight); + this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {var18, var19, var20, var21}, p_i46359_2_ + p_i46359_9_ + p_i46359_7_ + p_i46359_9_, p_i46359_3_ + p_i46359_9_, p_i46359_2_ + p_i46359_9_ + p_i46359_7_ + p_i46359_9_ + p_i46359_7_, p_i46359_3_ + p_i46359_9_ + p_i46359_8_, p_i46359_1_.textureWidth, p_i46359_1_.textureHeight); + + if (p_i46359_1_.mirror) { + for (int var22 = 0; var22 < this.quadList.length; ++var22) { + this.quadList[var22].flipFace(); + } + } + } + + /** + * Draw the six sided box defined by this ModelBox + */ + public void render(Tessellator p_78245_1_, float p_78245_2_) { + for (int var3 = 0; var3 < this.quadList.length; ++var3) { + this.quadList[var3].draw(p_78245_1_, p_78245_2_); + } + } + + public ModelBox func_78244_a(String p_78244_1_) { + this.field_78247_g = p_78244_1_; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelChest.java new file mode 100644 index 0000000..1043bd2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelChest.java @@ -0,0 +1,40 @@ +package net.minecraft.client.model; + +public class ModelChest extends ModelBase { + /** The chest lid in the chest's model. */ + public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + + /** The model of the bottom of the chest. */ + public ModelRenderer chestBelow; + + /** The chest's knob in the chest model. */ + public ModelRenderer chestKnob; + + + public ModelChest() { + this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F); + this.chestLid.rotationPointX = 1.0F; + this.chestLid.rotationPointY = 7.0F; + this.chestLid.rotationPointZ = 15.0F; + this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); + this.chestKnob.rotationPointX = 8.0F; + this.chestKnob.rotationPointY = 7.0F; + this.chestKnob.rotationPointZ = 15.0F; + this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(64, 64); + this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F); + this.chestBelow.rotationPointX = 1.0F; + this.chestBelow.rotationPointY = 6.0F; + this.chestBelow.rotationPointZ = 1.0F; + } + + /** + * This method renders out all parts of the chest model. + */ + public void renderAll() { + this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX; + this.chestLid.render(0.0625F); + this.chestKnob.render(0.0625F); + this.chestBelow.render(0.0625F); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelChicken.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelChicken.java new file mode 100644 index 0000000..5361604 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelChicken.java @@ -0,0 +1,99 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelChicken extends ModelBase { + public ModelRenderer head; + public ModelRenderer body; + public ModelRenderer rightLeg; + public ModelRenderer leftLeg; + public ModelRenderer rightWing; + public ModelRenderer leftWing; + public ModelRenderer bill; + public ModelRenderer chin; + + + public ModelChicken() { + byte var1 = 16; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F); + this.head.setRotationPoint(0.0F, (float)(-1 + var1), -4.0F); + this.bill = new ModelRenderer(this, 14, 0); + this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F); + this.bill.setRotationPoint(0.0F, (float)(-1 + var1), -4.0F); + this.chin = new ModelRenderer(this, 14, 4); + this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F); + this.chin.setRotationPoint(0.0F, (float)(-1 + var1), -4.0F); + this.body = new ModelRenderer(this, 0, 9); + this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F); + this.body.setRotationPoint(0.0F, var1, 0.0F); + this.rightLeg = new ModelRenderer(this, 26, 0); + this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.rightLeg.setRotationPoint(-2.0F, (float)(3 + var1), 1.0F); + this.leftLeg = new ModelRenderer(this, 26, 0); + this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.leftLeg.setRotationPoint(1.0F, (float)(3 + var1), 1.0F); + this.rightWing = new ModelRenderer(this, 24, 13); + this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6); + this.rightWing.setRotationPoint(-4.0F, (float)(-3 + var1), 0.0F); + this.leftWing = new ModelRenderer(this, 24, 13); + this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6); + this.leftWing.setRotationPoint(4.0F, (float)(-3 + var1), 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 5.0F * p_78088_7_, 2.0F * p_78088_7_); + this.head.render(p_78088_7_); + this.bill.render(p_78088_7_); + this.chin.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.body.render(p_78088_7_); + this.rightLeg.render(p_78088_7_); + this.leftLeg.render(p_78088_7_); + this.rightWing.render(p_78088_7_); + this.leftWing.render(p_78088_7_); + GL11.glPopMatrix(); + } else { + this.head.render(p_78088_7_); + this.bill.render(p_78088_7_); + this.chin.render(p_78088_7_); + this.body.render(p_78088_7_); + this.rightLeg.render(p_78088_7_); + this.leftLeg.render(p_78088_7_); + this.rightWing.render(p_78088_7_); + this.leftWing.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.bill.rotateAngleX = this.head.rotateAngleX; + this.bill.rotateAngleY = this.head.rotateAngleY; + this.chin.rotateAngleX = this.head.rotateAngleX; + this.chin.rotateAngleY = this.head.rotateAngleY; + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.rightWing.rotateAngleZ = p_78087_3_; + this.leftWing.rotateAngleZ = -p_78087_3_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelCow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelCow.java new file mode 100644 index 0000000..55bf85c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelCow.java @@ -0,0 +1,27 @@ +package net.minecraft.client.model; + +public class ModelCow extends ModelQuadruped { + + + public ModelCow() { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-4.0F, -4.0F, -6.0F, 8, 8, 6, 0.0F); + this.head.setRotationPoint(0.0F, 4.0F, -8.0F); + this.head.setTextureOffset(22, 0).addBox(-5.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); + this.head.setTextureOffset(22, 0).addBox(4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); + this.body = new ModelRenderer(this, 18, 4); + this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, 0.0F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + this.body.setTextureOffset(52, 0).addBox(-2.0F, 2.0F, -8.0F, 4, 6, 1); + --this.leg1.rotationPointX; + ++this.leg2.rotationPointX; + this.leg1.rotationPointZ += 0.0F; + this.leg2.rotationPointZ += 0.0F; + --this.leg3.rotationPointX; + ++this.leg4.rotationPointX; + --this.leg3.rotationPointZ; + --this.leg4.rotationPointZ; + this.field_78151_h += 2.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelCreeper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelCreeper.java new file mode 100644 index 0000000..df33c3d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelCreeper.java @@ -0,0 +1,71 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelCreeper extends ModelBase { + public ModelRenderer head; + public ModelRenderer field_78133_b; + public ModelRenderer body; + public ModelRenderer leg1; + public ModelRenderer leg2; + public ModelRenderer leg3; + public ModelRenderer leg4; + + + public ModelCreeper() { + this(0.0F); + } + + public ModelCreeper(float p_i46366_1_) { + byte var2 = 4; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46366_1_); + this.head.setRotationPoint(0.0F, var2, 0.0F); + this.field_78133_b = new ModelRenderer(this, 32, 0); + this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i46366_1_ + 0.5F); + this.field_78133_b.setRotationPoint(0.0F, var2, 0.0F); + this.body = new ModelRenderer(this, 16, 16); + this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i46366_1_); + this.body.setRotationPoint(0.0F, var2, 0.0F); + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg1.setRotationPoint(-2.0F, (float)(12 + var2), 4.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg2.setRotationPoint(2.0F, (float)(12 + var2), 4.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg3.setRotationPoint(-2.0F, (float)(12 + var2), -4.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i46366_1_); + this.leg4.setRotationPoint(2.0F, (float)(12 + var2), -4.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.head.render(p_78088_7_); + this.body.render(p_78088_7_); + this.leg1.render(p_78088_7_); + this.leg2.render(p_78088_7_); + this.leg3.render(p_78088_7_); + this.leg4.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.leg1.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leg2.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg3.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg4.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelDragon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelDragon.java new file mode 100644 index 0000000..7574e33 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelDragon.java @@ -0,0 +1,253 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragon; +import org.lwjgl.opengl.GL11; + +public class ModelDragon extends ModelBase { + /** The head Model renderer of the dragon */ + private final ModelRenderer head; + + /** The spine Model renderer of the dragon */ + private final ModelRenderer spine; + + /** The jaw Model renderer of the dragon */ + private final ModelRenderer jaw; + + /** The body Model renderer of the dragon */ + private final ModelRenderer body; + + /** The rear leg Model renderer of the dragon */ + private final ModelRenderer rearLeg; + + /** The front leg Model renderer of the dragon */ + private final ModelRenderer frontLeg; + + /** The rear leg tip Model renderer of the dragon */ + private final ModelRenderer rearLegTip; + + /** The front leg tip Model renderer of the dragon */ + private final ModelRenderer frontLegTip; + + /** The rear foot Model renderer of the dragon */ + private final ModelRenderer rearFoot; + + /** The front foot Model renderer of the dragon */ + private final ModelRenderer frontFoot; + + /** The wing Model renderer of the dragon */ + private final ModelRenderer wing; + + /** The wing tip Model renderer of the dragon */ + private final ModelRenderer wingTip; + private float partialTicks; + + + public ModelDragon(float p_i46360_1_) { + this.textureWidth = 256; + this.textureHeight = 256; + this.setTextureOffset("body.body", 0, 0); + this.setTextureOffset("wing.skin", -56, 88); + this.setTextureOffset("wingtip.skin", -56, 144); + this.setTextureOffset("rearleg.main", 0, 0); + this.setTextureOffset("rearfoot.main", 112, 0); + this.setTextureOffset("rearlegtip.main", 196, 0); + this.setTextureOffset("head.upperhead", 112, 30); + this.setTextureOffset("wing.bone", 112, 88); + this.setTextureOffset("head.upperlip", 176, 44); + this.setTextureOffset("jaw.jaw", 176, 65); + this.setTextureOffset("frontleg.main", 112, 104); + this.setTextureOffset("wingtip.bone", 112, 136); + this.setTextureOffset("frontfoot.main", 144, 104); + this.setTextureOffset("neck.box", 192, 104); + this.setTextureOffset("frontlegtip.main", 226, 138); + this.setTextureOffset("body.scale", 220, 53); + this.setTextureOffset("head.scale", 0, 0); + this.setTextureOffset("neck.scale", 48, 0); + this.setTextureOffset("head.nostril", 112, 0); + float var2 = -16.0F; + this.head = new ModelRenderer(this, "head"); + this.head.addBox("upperlip", -6.0F, -1.0F, -8.0F + var2, 12, 5, 16); + this.head.addBox("upperhead", -8.0F, -8.0F, 6.0F + var2, 16, 16, 16); + this.head.mirror = true; + this.head.addBox("scale", -5.0F, -12.0F, 12.0F + var2, 2, 4, 6); + this.head.addBox("nostril", -5.0F, -3.0F, -6.0F + var2, 2, 2, 4); + this.head.mirror = false; + this.head.addBox("scale", 3.0F, -12.0F, 12.0F + var2, 2, 4, 6); + this.head.addBox("nostril", 3.0F, -3.0F, -6.0F + var2, 2, 2, 4); + this.jaw = new ModelRenderer(this, "jaw"); + this.jaw.setRotationPoint(0.0F, 4.0F, 8.0F + var2); + this.jaw.addBox("jaw", -6.0F, 0.0F, -16.0F, 12, 4, 16); + this.head.addChild(this.jaw); + this.spine = new ModelRenderer(this, "neck"); + this.spine.addBox("box", -5.0F, -5.0F, -5.0F, 10, 10, 10); + this.spine.addBox("scale", -1.0F, -9.0F, -3.0F, 2, 4, 6); + this.body = new ModelRenderer(this, "body"); + this.body.setRotationPoint(0.0F, 4.0F, 8.0F); + this.body.addBox("body", -12.0F, 0.0F, -16.0F, 24, 24, 64); + this.body.addBox("scale", -1.0F, -6.0F, -10.0F, 2, 6, 12); + this.body.addBox("scale", -1.0F, -6.0F, 10.0F, 2, 6, 12); + this.body.addBox("scale", -1.0F, -6.0F, 30.0F, 2, 6, 12); + this.wing = new ModelRenderer(this, "wing"); + this.wing.setRotationPoint(-12.0F, 5.0F, 2.0F); + this.wing.addBox("bone", -56.0F, -4.0F, -4.0F, 56, 8, 8); + this.wing.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); + this.wingTip = new ModelRenderer(this, "wingtip"); + this.wingTip.setRotationPoint(-56.0F, 0.0F, 0.0F); + this.wingTip.addBox("bone", -56.0F, -2.0F, -2.0F, 56, 4, 4); + this.wingTip.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); + this.wing.addChild(this.wingTip); + this.frontLeg = new ModelRenderer(this, "frontleg"); + this.frontLeg.setRotationPoint(-12.0F, 20.0F, 2.0F); + this.frontLeg.addBox("main", -4.0F, -4.0F, -4.0F, 8, 24, 8); + this.frontLegTip = new ModelRenderer(this, "frontlegtip"); + this.frontLegTip.setRotationPoint(0.0F, 20.0F, -1.0F); + this.frontLegTip.addBox("main", -3.0F, -1.0F, -3.0F, 6, 24, 6); + this.frontLeg.addChild(this.frontLegTip); + this.frontFoot = new ModelRenderer(this, "frontfoot"); + this.frontFoot.setRotationPoint(0.0F, 23.0F, 0.0F); + this.frontFoot.addBox("main", -4.0F, 0.0F, -12.0F, 8, 4, 16); + this.frontLegTip.addChild(this.frontFoot); + this.rearLeg = new ModelRenderer(this, "rearleg"); + this.rearLeg.setRotationPoint(-16.0F, 16.0F, 42.0F); + this.rearLeg.addBox("main", -8.0F, -4.0F, -8.0F, 16, 32, 16); + this.rearLegTip = new ModelRenderer(this, "rearlegtip"); + this.rearLegTip.setRotationPoint(0.0F, 32.0F, -4.0F); + this.rearLegTip.addBox("main", -6.0F, -2.0F, 0.0F, 12, 32, 12); + this.rearLeg.addChild(this.rearLegTip); + this.rearFoot = new ModelRenderer(this, "rearfoot"); + this.rearFoot.setRotationPoint(0.0F, 31.0F, 4.0F); + this.rearFoot.addBox("main", -9.0F, 0.0F, -20.0F, 18, 6, 24); + this.rearLegTip.addChild(this.rearFoot); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + this.partialTicks = p_78086_4_; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + GL11.glPushMatrix(); + EntityDragon var8 = (EntityDragon)p_78088_1_; + float var9 = var8.prevAnimTime + (var8.animTime - var8.prevAnimTime) * this.partialTicks; + this.jaw.rotateAngleX = (float)(Math.sin(var9 * (float)Math.PI * 2.0F) + 1.0D) * 0.2F; + float var10 = (float)(Math.sin(var9 * (float)Math.PI * 2.0F - 1.0F) + 1.0D); + var10 = (var10 * var10 * 1.0F + var10 * 2.0F) * 0.05F; + GL11.glTranslatef(0.0F, var10 - 2.0F, -3.0F); + GL11.glRotatef(var10 * 2.0F, 1.0F, 0.0F, 0.0F); + float var11 = -30.0F; + float var13 = 0.0F; + float var14 = 1.5F; + double[] var15 = var8.getMovementOffsets(6, this.partialTicks); + float var16 = this.updateRotations(var8.getMovementOffsets(5, this.partialTicks)[0] - var8.getMovementOffsets(10, this.partialTicks)[0]); + float var17 = this.updateRotations(var8.getMovementOffsets(5, this.partialTicks)[0] + (double)(var16 / 2.0F)); + var11 += 2.0F; + float var18 = var9 * (float)Math.PI * 2.0F; + var11 = 20.0F; + float var12 = -12.0F; + float var21; + + for (int var19 = 0; var19 < 5; ++var19) { + double[] var20 = var8.getMovementOffsets(5 - var19, this.partialTicks); + var21 = (float)Math.cos((float)var19 * 0.45F + var18) * 0.15F; + this.spine.rotateAngleY = this.updateRotations(var20[0] - var15[0]) * (float)Math.PI / 180.0F * var14; + this.spine.rotateAngleX = var21 + (float)(var20[1] - var15[1]) * (float)Math.PI / 180.0F * var14 * 5.0F; + this.spine.rotateAngleZ = -this.updateRotations(var20[0] - (double)var17) * (float)Math.PI / 180.0F * var14; + this.spine.rotationPointY = var11; + this.spine.rotationPointZ = var12; + this.spine.rotationPointX = var13; + var11 = (float)((double)var11 + Math.sin(this.spine.rotateAngleX) * 10.0D); + var12 = (float)((double)var12 - Math.cos(this.spine.rotateAngleY) * Math.cos(this.spine.rotateAngleX) * 10.0D); + var13 = (float)((double)var13 - Math.sin(this.spine.rotateAngleY) * Math.cos(this.spine.rotateAngleX) * 10.0D); + this.spine.render(p_78088_7_); + } + + this.head.rotationPointY = var11; + this.head.rotationPointZ = var12; + this.head.rotationPointX = var13; + double[] var22 = var8.getMovementOffsets(0, this.partialTicks); + this.head.rotateAngleY = this.updateRotations(var22[0] - var15[0]) * (float)Math.PI / 180.0F * 1.0F; + this.head.rotateAngleZ = -this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * 1.0F; + this.head.render(p_78088_7_); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var16 * var14 * 1.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, -1.0F, 0.0F); + this.body.rotateAngleZ = 0.0F; + this.body.render(p_78088_7_); + + for (int var23 = 0; var23 < 2; ++var23) { + GL11.glEnable(GL11.GL_CULL_FACE); + var21 = var9 * (float)Math.PI * 2.0F; + this.wing.rotateAngleX = 0.125F - (float)Math.cos(var21) * 0.2F; + this.wing.rotateAngleY = 0.25F; + this.wing.rotateAngleZ = (float)(Math.sin(var21) + 0.125D) * 0.8F; + this.wingTip.rotateAngleZ = -((float)(Math.sin(var21 + 2.0F) + 0.5D)) * 0.75F; + this.rearLeg.rotateAngleX = 1.0F + var10 * 0.1F; + this.rearLegTip.rotateAngleX = 0.5F + var10 * 0.1F; + this.rearFoot.rotateAngleX = 0.75F + var10 * 0.1F; + this.frontLeg.rotateAngleX = 1.3F + var10 * 0.1F; + this.frontLegTip.rotateAngleX = -0.5F - var10 * 0.1F; + this.frontFoot.rotateAngleX = 0.75F + var10 * 0.1F; + this.wing.render(p_78088_7_); + this.frontLeg.render(p_78088_7_); + this.rearLeg.render(p_78088_7_); + GL11.glScalef(-1.0F, 1.0F, 1.0F); + + if (var23 == 0) { + GL11.glCullFace(GL11.GL_FRONT); + } + } + + GL11.glPopMatrix(); + GL11.glCullFace(GL11.GL_BACK); + GL11.glDisable(GL11.GL_CULL_FACE); + float var24 = -((float)Math.sin(var9 * (float)Math.PI * 2.0F)) * 0.0F; + var18 = var9 * (float)Math.PI * 2.0F; + var11 = 10.0F; + var12 = 60.0F; + var13 = 0.0F; + var15 = var8.getMovementOffsets(11, this.partialTicks); + + for (int var25 = 0; var25 < 12; ++var25) { + var22 = var8.getMovementOffsets(12 + var25, this.partialTicks); + var24 = (float)((double)var24 + Math.sin((float)var25 * 0.45F + var18) * 0.05000000074505806D); + this.spine.rotateAngleY = (this.updateRotations(var22[0] - var15[0]) * var14 + 180.0F) * (float)Math.PI / 180.0F; + this.spine.rotateAngleX = var24 + (float)(var22[1] - var15[1]) * (float)Math.PI / 180.0F * var14 * 5.0F; + this.spine.rotateAngleZ = this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * var14; + this.spine.rotationPointY = var11; + this.spine.rotationPointZ = var12; + this.spine.rotationPointX = var13; + var11 = (float)((double)var11 + Math.sin(this.spine.rotateAngleX) * 10.0D); + var12 = (float)((double)var12 - Math.cos(this.spine.rotateAngleY) * Math.cos(this.spine.rotateAngleX) * 10.0D); + var13 = (float)((double)var13 - Math.sin(this.spine.rotateAngleY) * Math.cos(this.spine.rotateAngleX) * 10.0D); + this.spine.render(p_78088_7_); + } + + GL11.glPopMatrix(); + } + + /** + * Updates the rotations in the parameters for rotations greater than 180 degrees or less than -180 degrees. It adds + * or subtracts 360 degrees, so that the appearance is the same, although the numbers are then simplified to range + * -180 to 180 + */ + private float updateRotations(double p_78214_1_) { + while (p_78214_1_ >= 180.0D) { + p_78214_1_ -= 360.0D; + } + + while (p_78214_1_ < -180.0D) { + p_78214_1_ += 360.0D; + } + + return (float)p_78214_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java new file mode 100644 index 0000000..bde1b88 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelEnderCrystal.java @@ -0,0 +1,55 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import org.lwjgl.opengl.GL11; + +public class ModelEnderCrystal extends ModelBase { + /** The cube model for the Ender Crystal. */ + private final ModelRenderer cube; + + /** The glass model for the Ender Crystal. */ + private final ModelRenderer glass = new ModelRenderer(this, "glass"); + + /** The base model for the Ender Crystal. */ + private ModelRenderer base; + + + public ModelEnderCrystal(float p_i1170_1_, boolean p_i1170_2_) { + this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + this.cube = new ModelRenderer(this, "cube"); + this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + + if (p_i1170_2_) { + this.base = new ModelRenderer(this, "base"); + this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12); + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + GL11.glPushMatrix(); + GL11.glScalef(2.0F, 2.0F, 2.0F); + GL11.glTranslatef(0.0F, -0.5F, 0.0F); + + if (this.base != null) { + this.base.render(p_78088_7_); + } + + GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.8F + p_78088_4_, 0.0F); + GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + this.glass.render(p_78088_7_); + float var8 = 0.875F; + GL11.glScalef(var8, var8, var8); + GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + this.glass.render(p_78088_7_); + GL11.glScalef(var8, var8, var8); + GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + this.cube.render(p_78088_7_); + GL11.glPopMatrix(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelEnderman.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelEnderman.java new file mode 100644 index 0000000..6f73f56 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelEnderman.java @@ -0,0 +1,118 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelEnderman extends ModelBiped { + /** Is the enderman carrying a block? */ + public boolean isCarrying; + + /** Is the enderman attacking an entity? */ + public boolean isAttacking; + + + public ModelEnderman() { + super(0.0F, -14.0F, 64, 32); + float var1 = -14.0F; + float var2 = 0.0F; + this.bipedHeadwear = new ModelRenderer(this, 0, 16); + this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var2 - 0.5F); + this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + var1, 0.0F); + this.bipedBody = new ModelRenderer(this, 32, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var2); + this.bipedBody.setRotationPoint(0.0F, 0.0F + var1, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 56, 0); + this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, var2); + this.bipedRightArm.setRotationPoint(-3.0F, 2.0F + var1, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 56, 0); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, var2); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + var1, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 56, 0); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, var2); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + var1, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 56, 0); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, var2); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + var1, 0.0F); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.bipedHead.showModel = true; + float var8 = -14.0F; + this.bipedBody.rotateAngleX = 0.0F; + this.bipedBody.rotationPointY = var8; + this.bipedBody.rotationPointZ = -0.0F; + this.bipedRightLeg.rotateAngleX -= 0.0F; + this.bipedLeftLeg.rotateAngleX -= 0.0F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX * 0.5D); + this.bipedLeftArm.rotateAngleX = (float)((double)this.bipedLeftArm.rotateAngleX * 0.5D); + this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D); + this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D); + float var9 = 0.4F; + + if (this.bipedRightArm.rotateAngleX > var9) { + this.bipedRightArm.rotateAngleX = var9; + } + + if (this.bipedLeftArm.rotateAngleX > var9) { + this.bipedLeftArm.rotateAngleX = var9; + } + + if (this.bipedRightArm.rotateAngleX < -var9) { + this.bipedRightArm.rotateAngleX = -var9; + } + + if (this.bipedLeftArm.rotateAngleX < -var9) { + this.bipedLeftArm.rotateAngleX = -var9; + } + + if (this.bipedRightLeg.rotateAngleX > var9) { + this.bipedRightLeg.rotateAngleX = var9; + } + + if (this.bipedLeftLeg.rotateAngleX > var9) { + this.bipedLeftLeg.rotateAngleX = var9; + } + + if (this.bipedRightLeg.rotateAngleX < -var9) { + this.bipedRightLeg.rotateAngleX = -var9; + } + + if (this.bipedLeftLeg.rotateAngleX < -var9) { + this.bipedLeftLeg.rotateAngleX = -var9; + } + + if (this.isCarrying) { + this.bipedRightArm.rotateAngleX = -0.5F; + this.bipedLeftArm.rotateAngleX = -0.5F; + this.bipedRightArm.rotateAngleZ = 0.05F; + this.bipedLeftArm.rotateAngleZ = -0.05F; + } + + this.bipedRightArm.rotationPointZ = 0.0F; + this.bipedLeftArm.rotationPointZ = 0.0F; + this.bipedRightLeg.rotationPointZ = 0.0F; + this.bipedLeftLeg.rotationPointZ = 0.0F; + this.bipedRightLeg.rotationPointY = 9.0F + var8; + this.bipedLeftLeg.rotationPointY = 9.0F + var8; + this.bipedHead.rotationPointZ = -0.0F; + this.bipedHead.rotationPointY = var8 + 1.0F; + this.bipedHeadwear.rotationPointX = this.bipedHead.rotationPointX; + this.bipedHeadwear.rotationPointY = this.bipedHead.rotationPointY; + this.bipedHeadwear.rotationPointZ = this.bipedHead.rotationPointZ; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ; + + if (this.isAttacking) { + float var10 = 1.0F; + this.bipedHead.rotationPointY -= var10 * 5.0F; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelGhast.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelGhast.java new file mode 100644 index 0000000..e2150e0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelGhast.java @@ -0,0 +1,61 @@ +package net.minecraft.client.model; + +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelGhast extends ModelBase { + ModelRenderer body; + ModelRenderer[] tentacles = new ModelRenderer[9]; + + + public ModelGhast() { + byte var1 = -16; + this.body = new ModelRenderer(this, 0, 0); + this.body.addBox(-8.0F, -8.0F, -8.0F, 16, 16, 16); + this.body.rotationPointY += (float)(24 + var1); + Random var2 = new Random(1660L); + + for (int var3 = 0; var3 < this.tentacles.length; ++var3) { + this.tentacles[var3] = new ModelRenderer(this, 0, 0); + float var4 = (((float)(var3 % 3) - (float)(var3 / 3 % 2) * 0.5F + 0.25F) / 2.0F * 2.0F - 1.0F) * 5.0F; + float var5 = ((float)(var3 / 3) / 2.0F * 2.0F - 1.0F) * 5.0F; + int var6 = var2.nextInt(7) + 8; + this.tentacles[var3].addBox(-1.0F, 0.0F, -1.0F, 2, var6, 2); + this.tentacles[var3].rotationPointX = var4; + this.tentacles[var3].rotationPointZ = var5; + this.tentacles[var3].rotationPointY = (float)(31 + var1); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + for (int var8 = 0; var8 < this.tentacles.length; ++var8) { + this.tentacles[var8].rotateAngleX = 0.2F * MathHelper.sin(p_78087_3_ * 0.3F + (float)var8) + 0.4F; + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 0.6F, 0.0F); + this.body.render(p_78088_7_); + ModelRenderer[] var8 = this.tentacles; + int var9 = var8.length; + + for (int var10 = 0; var10 < var9; ++var10) { + ModelRenderer var11 = var8[var10]; + var11.render(p_78088_7_); + } + + GL11.glPopMatrix(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelHorse.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelHorse.java new file mode 100644 index 0000000..d78ae48 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelHorse.java @@ -0,0 +1,541 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelHorse extends ModelBase { + private final ModelRenderer head; + private final ModelRenderer mouthTop; + private final ModelRenderer mouthBottom; + private final ModelRenderer horseLeftEar; + private final ModelRenderer horseRightEar; + + /** The left ear box for the mule model. */ + private final ModelRenderer muleLeftEar; + + /** The right ear box for the mule model. */ + private final ModelRenderer muleRightEar; + private final ModelRenderer neck; + + /** The box for the horse's ropes on its face. */ + private final ModelRenderer horseFaceRopes; + private final ModelRenderer mane; + private final ModelRenderer body; + private final ModelRenderer tailBase; + private final ModelRenderer tailMiddle; + private final ModelRenderer tailTip; + private final ModelRenderer backLeftLeg; + private final ModelRenderer backLeftShin; + private final ModelRenderer backLeftHoof; + private final ModelRenderer backRightLeg; + private final ModelRenderer backRightShin; + private final ModelRenderer backRightHoof; + private final ModelRenderer frontLeftLeg; + private final ModelRenderer frontLeftShin; + private final ModelRenderer frontLeftHoof; + private final ModelRenderer frontRightLeg; + private final ModelRenderer frontRightShin; + private final ModelRenderer frontRightHoof; + + /** The left chest box on the mule model. */ + private final ModelRenderer muleLeftChest; + + /** The right chest box on the mule model. */ + private final ModelRenderer muleRightChest; + private final ModelRenderer horseSaddleBottom; + private final ModelRenderer horseSaddleFront; + private final ModelRenderer horseSaddleBack; + private final ModelRenderer horseLeftSaddleRope; + private final ModelRenderer horseLeftSaddleMetal; + private final ModelRenderer horseRightSaddleRope; + private final ModelRenderer horseRightSaddleMetal; + + /** The left metal connected to the horse's face ropes. */ + private final ModelRenderer horseLeftFaceMetal; + + /** The right metal connected to the horse's face ropes. */ + private final ModelRenderer horseRightFaceMetal; + private final ModelRenderer horseLeftRein; + private final ModelRenderer horseRightRein; + + + public ModelHorse() { + this.textureWidth = 128; + this.textureHeight = 128; + this.body = new ModelRenderer(this, 0, 34); + this.body.addBox(-5.0F, -8.0F, -19.0F, 10, 10, 24); + this.body.setRotationPoint(0.0F, 11.0F, 9.0F); + this.tailBase = new ModelRenderer(this, 44, 0); + this.tailBase.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 3); + this.tailBase.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailBase, -1.134464F, 0.0F, 0.0F); + this.tailMiddle = new ModelRenderer(this, 38, 7); + this.tailMiddle.addBox(-1.5F, -2.0F, 3.0F, 3, 4, 7); + this.tailMiddle.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailMiddle, -1.134464F, 0.0F, 0.0F); + this.tailTip = new ModelRenderer(this, 24, 3); + this.tailTip.addBox(-1.5F, -4.5F, 9.0F, 3, 4, 7); + this.tailTip.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailTip, -1.40215F, 0.0F, 0.0F); + this.backLeftLeg = new ModelRenderer(this, 78, 29); + this.backLeftLeg.addBox(-2.5F, -2.0F, -2.5F, 4, 9, 5); + this.backLeftLeg.setRotationPoint(4.0F, 9.0F, 11.0F); + this.backLeftShin = new ModelRenderer(this, 78, 43); + this.backLeftShin.addBox(-2.0F, 0.0F, -1.5F, 3, 5, 3); + this.backLeftShin.setRotationPoint(4.0F, 16.0F, 11.0F); + this.backLeftHoof = new ModelRenderer(this, 78, 51); + this.backLeftHoof.addBox(-2.5F, 5.1F, -2.0F, 4, 3, 4); + this.backLeftHoof.setRotationPoint(4.0F, 16.0F, 11.0F); + this.backRightLeg = new ModelRenderer(this, 96, 29); + this.backRightLeg.addBox(-1.5F, -2.0F, -2.5F, 4, 9, 5); + this.backRightLeg.setRotationPoint(-4.0F, 9.0F, 11.0F); + this.backRightShin = new ModelRenderer(this, 96, 43); + this.backRightShin.addBox(-1.0F, 0.0F, -1.5F, 3, 5, 3); + this.backRightShin.setRotationPoint(-4.0F, 16.0F, 11.0F); + this.backRightHoof = new ModelRenderer(this, 96, 51); + this.backRightHoof.addBox(-1.5F, 5.1F, -2.0F, 4, 3, 4); + this.backRightHoof.setRotationPoint(-4.0F, 16.0F, 11.0F); + this.frontLeftLeg = new ModelRenderer(this, 44, 29); + this.frontLeftLeg.addBox(-1.9F, -1.0F, -2.1F, 3, 8, 4); + this.frontLeftLeg.setRotationPoint(4.0F, 9.0F, -8.0F); + this.frontLeftShin = new ModelRenderer(this, 44, 41); + this.frontLeftShin.addBox(-1.9F, 0.0F, -1.6F, 3, 5, 3); + this.frontLeftShin.setRotationPoint(4.0F, 16.0F, -8.0F); + this.frontLeftHoof = new ModelRenderer(this, 44, 51); + this.frontLeftHoof.addBox(-2.4F, 5.1F, -2.1F, 4, 3, 4); + this.frontLeftHoof.setRotationPoint(4.0F, 16.0F, -8.0F); + this.frontRightLeg = new ModelRenderer(this, 60, 29); + this.frontRightLeg.addBox(-1.1F, -1.0F, -2.1F, 3, 8, 4); + this.frontRightLeg.setRotationPoint(-4.0F, 9.0F, -8.0F); + this.frontRightShin = new ModelRenderer(this, 60, 41); + this.frontRightShin.addBox(-1.1F, 0.0F, -1.6F, 3, 5, 3); + this.frontRightShin.setRotationPoint(-4.0F, 16.0F, -8.0F); + this.frontRightHoof = new ModelRenderer(this, 60, 51); + this.frontRightHoof.addBox(-1.6F, 5.1F, -2.1F, 4, 3, 4); + this.frontRightHoof.setRotationPoint(-4.0F, 16.0F, -8.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-2.5F, -10.0F, -1.5F, 5, 5, 7); + this.head.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.head, 0.5235988F, 0.0F, 0.0F); + this.mouthTop = new ModelRenderer(this, 24, 18); + this.mouthTop.addBox(-2.0F, -10.0F, -7.0F, 4, 3, 6); + this.mouthTop.setRotationPoint(0.0F, 3.95F, -10.0F); + this.setBoxRotation(this.mouthTop, 0.5235988F, 0.0F, 0.0F); + this.mouthBottom = new ModelRenderer(this, 24, 27); + this.mouthBottom.addBox(-2.0F, -7.0F, -6.5F, 4, 2, 5); + this.mouthBottom.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.mouthBottom, 0.5235988F, 0.0F, 0.0F); + this.head.addChild(this.mouthTop); + this.head.addChild(this.mouthBottom); + this.horseLeftEar = new ModelRenderer(this, 0, 0); + this.horseLeftEar.addBox(0.45F, -12.0F, 4.0F, 2, 3, 1); + this.horseLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseLeftEar, 0.5235988F, 0.0F, 0.0F); + this.horseRightEar = new ModelRenderer(this, 0, 0); + this.horseRightEar.addBox(-2.45F, -12.0F, 4.0F, 2, 3, 1); + this.horseRightEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseRightEar, 0.5235988F, 0.0F, 0.0F); + this.muleLeftEar = new ModelRenderer(this, 0, 12); + this.muleLeftEar.addBox(-2.0F, -16.0F, 4.0F, 2, 7, 1); + this.muleLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.muleLeftEar, 0.5235988F, 0.0F, 0.2617994F); + this.muleRightEar = new ModelRenderer(this, 0, 12); + this.muleRightEar.addBox(0.0F, -16.0F, 4.0F, 2, 7, 1); + this.muleRightEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.muleRightEar, 0.5235988F, 0.0F, -0.2617994F); + this.neck = new ModelRenderer(this, 0, 12); + this.neck.addBox(-2.05F, -9.8F, -2.0F, 4, 14, 8); + this.neck.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.neck, 0.5235988F, 0.0F, 0.0F); + this.muleLeftChest = new ModelRenderer(this, 0, 34); + this.muleLeftChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.muleLeftChest.setRotationPoint(-7.5F, 3.0F, 10.0F); + this.setBoxRotation(this.muleLeftChest, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.muleRightChest = new ModelRenderer(this, 0, 47); + this.muleRightChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.muleRightChest.setRotationPoint(4.5F, 3.0F, 10.0F); + this.setBoxRotation(this.muleRightChest, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.horseSaddleBottom = new ModelRenderer(this, 80, 0); + this.horseSaddleBottom.addBox(-5.0F, 0.0F, -3.0F, 10, 1, 8); + this.horseSaddleBottom.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseSaddleFront = new ModelRenderer(this, 106, 9); + this.horseSaddleFront.addBox(-1.5F, -1.0F, -3.0F, 3, 1, 2); + this.horseSaddleFront.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseSaddleBack = new ModelRenderer(this, 80, 9); + this.horseSaddleBack.addBox(-4.0F, -1.0F, 3.0F, 8, 1, 2); + this.horseSaddleBack.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseLeftSaddleMetal = new ModelRenderer(this, 74, 0); + this.horseLeftSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); + this.horseLeftSaddleMetal.setRotationPoint(5.0F, 3.0F, 2.0F); + this.horseLeftSaddleRope = new ModelRenderer(this, 70, 0); + this.horseLeftSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); + this.horseLeftSaddleRope.setRotationPoint(5.0F, 3.0F, 2.0F); + this.horseRightSaddleMetal = new ModelRenderer(this, 74, 4); + this.horseRightSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); + this.horseRightSaddleMetal.setRotationPoint(-5.0F, 3.0F, 2.0F); + this.horseRightSaddleRope = new ModelRenderer(this, 80, 0); + this.horseRightSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); + this.horseRightSaddleRope.setRotationPoint(-5.0F, 3.0F, 2.0F); + this.horseLeftFaceMetal = new ModelRenderer(this, 74, 13); + this.horseLeftFaceMetal.addBox(1.5F, -8.0F, -4.0F, 1, 2, 2); + this.horseLeftFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseLeftFaceMetal, 0.5235988F, 0.0F, 0.0F); + this.horseRightFaceMetal = new ModelRenderer(this, 74, 13); + this.horseRightFaceMetal.addBox(-2.5F, -8.0F, -4.0F, 1, 2, 2); + this.horseRightFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseRightFaceMetal, 0.5235988F, 0.0F, 0.0F); + this.horseLeftRein = new ModelRenderer(this, 44, 10); + this.horseLeftRein.addBox(2.6F, -6.0F, -6.0F, 0, 3, 16); + this.horseLeftRein.setRotationPoint(0.0F, 4.0F, -10.0F); + this.horseRightRein = new ModelRenderer(this, 44, 5); + this.horseRightRein.addBox(-2.6F, -6.0F, -6.0F, 0, 3, 16); + this.horseRightRein.setRotationPoint(0.0F, 4.0F, -10.0F); + this.mane = new ModelRenderer(this, 58, 0); + this.mane.addBox(-1.0F, -11.5F, 5.0F, 2, 16, 4); + this.mane.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.mane, 0.5235988F, 0.0F, 0.0F); + this.horseFaceRopes = new ModelRenderer(this, 80, 12); + this.horseFaceRopes.addBox(-2.5F, -10.1F, -7.0F, 5, 5, 12, 0.2F); + this.horseFaceRopes.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseFaceRopes, 0.5235988F, 0.0F, 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + EntityHorse var8 = (EntityHorse)p_78088_1_; + int var9 = var8.getHorseType(); + float var10 = var8.getGrassEatingAmount(0.0F); + boolean var11 = var8.isAdultHorse(); + boolean var12 = var11 && var8.isHorseSaddled(); + boolean var13 = var11 && var8.isChested(); + boolean var14 = var9 == 1 || var9 == 2; + float var15 = var8.getHorseSize(); + boolean var16 = var8.riddenByEntity != null; + + if (var12) { + this.horseFaceRopes.render(p_78088_7_); + this.horseSaddleBottom.render(p_78088_7_); + this.horseSaddleFront.render(p_78088_7_); + this.horseSaddleBack.render(p_78088_7_); + this.horseLeftSaddleRope.render(p_78088_7_); + this.horseLeftSaddleMetal.render(p_78088_7_); + this.horseRightSaddleRope.render(p_78088_7_); + this.horseRightSaddleMetal.render(p_78088_7_); + this.horseLeftFaceMetal.render(p_78088_7_); + this.horseRightFaceMetal.render(p_78088_7_); + + if (var16) { + this.horseLeftRein.render(p_78088_7_); + this.horseRightRein.render(p_78088_7_); + } + } + + if (!var11) { + GL11.glPushMatrix(); + GL11.glScalef(var15, 0.5F + var15 * 0.5F, var15); + GL11.glTranslatef(0.0F, 0.95F * (1.0F - var15), 0.0F); + } + + this.backLeftLeg.render(p_78088_7_); + this.backLeftShin.render(p_78088_7_); + this.backLeftHoof.render(p_78088_7_); + this.backRightLeg.render(p_78088_7_); + this.backRightShin.render(p_78088_7_); + this.backRightHoof.render(p_78088_7_); + this.frontLeftLeg.render(p_78088_7_); + this.frontLeftShin.render(p_78088_7_); + this.frontLeftHoof.render(p_78088_7_); + this.frontRightLeg.render(p_78088_7_); + this.frontRightShin.render(p_78088_7_); + this.frontRightHoof.render(p_78088_7_); + + if (!var11) { + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(var15, var15, var15); + GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); + } + + this.body.render(p_78088_7_); + this.tailBase.render(p_78088_7_); + this.tailMiddle.render(p_78088_7_); + this.tailTip.render(p_78088_7_); + this.neck.render(p_78088_7_); + this.mane.render(p_78088_7_); + + if (!var11) { + GL11.glPopMatrix(); + GL11.glPushMatrix(); + float var17 = 0.5F + var15 * var15 * 0.5F; + GL11.glScalef(var17, var17, var17); + + if (var10 <= 0.0F) { + GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); + } else { + GL11.glTranslatef(0.0F, 0.9F * (1.0F - var15) * var10 + 1.35F * (1.0F - var15) * (1.0F - var10), 0.15F * (1.0F - var15) * var10); + } + } + + if (var14) { + this.muleLeftEar.render(p_78088_7_); + this.muleRightEar.render(p_78088_7_); + } else { + this.horseLeftEar.render(p_78088_7_); + this.horseRightEar.render(p_78088_7_); + } + + this.head.render(p_78088_7_); + + if (!var11) { + GL11.glPopMatrix(); + } + + if (var13) { + this.muleLeftChest.render(p_78088_7_); + this.muleRightChest.render(p_78088_7_); + } + } + + /** + * Sets the rotations for a ModelRenderer in the ModelHorse class. + */ + private void setBoxRotation(ModelRenderer p_110682_1_, float p_110682_2_, float p_110682_3_, float p_110682_4_) { + p_110682_1_.rotateAngleX = p_110682_2_; + p_110682_1_.rotateAngleY = p_110682_3_; + p_110682_1_.rotateAngleZ = p_110682_4_; + } + + /** + * Fixes and offsets a rotation in the ModelHorse class. + */ + private float updateHorseRotation(float p_110683_1_, float p_110683_2_, float p_110683_3_) { + float var4; + + for (var4 = p_110683_2_ - p_110683_1_; var4 < -180.0F; var4 += 360.0F) { + } + + while (var4 >= 180.0F) { + var4 -= 360.0F; + } + + return p_110683_1_ + p_110683_3_ * var4; + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + float var5 = this.updateHorseRotation(p_78086_1_.prevRenderYawOffset, p_78086_1_.renderYawOffset, p_78086_4_); + float var6 = this.updateHorseRotation(p_78086_1_.prevRotationYawHead, p_78086_1_.rotationYawHead, p_78086_4_); + float var7 = p_78086_1_.prevRotationPitch + (p_78086_1_.rotationPitch - p_78086_1_.prevRotationPitch) * p_78086_4_; + float var8 = var6 - var5; + float var9 = var7 / (180F / (float)Math.PI); + + if (var8 > 20.0F) { + var8 = 20.0F; + } + + if (var8 < -20.0F) { + var8 = -20.0F; + } + + if (p_78086_3_ > 0.2F) { + var9 += MathHelper.cos(p_78086_2_ * 0.4F) * 0.15F * p_78086_3_; + } + + EntityHorse var10 = (EntityHorse)p_78086_1_; + float var11 = var10.getGrassEatingAmount(p_78086_4_); + float var12 = var10.getRearingAmount(p_78086_4_); + float var13 = 1.0F - var12; + float var14 = var10.func_110201_q(p_78086_4_); + boolean var15 = var10.field_110278_bp != 0; + boolean var16 = var10.isHorseSaddled(); + boolean var17 = var10.riddenByEntity != null; + float var18 = (float)p_78086_1_.ticksExisted + p_78086_4_; + float var19 = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI); + float var20 = var19 * 0.8F * p_78086_3_; + this.head.rotationPointY = 4.0F; + this.head.rotationPointZ = -10.0F; + this.tailBase.rotationPointY = 3.0F; + this.tailMiddle.rotationPointZ = 14.0F; + this.muleRightChest.rotationPointY = 3.0F; + this.muleRightChest.rotationPointZ = 10.0F; + this.body.rotateAngleX = 0.0F; + this.head.rotateAngleX = 0.5235988F + var9; + this.head.rotateAngleY = var8 / (180F / (float)Math.PI); + this.head.rotateAngleX = var12 * (0.2617994F + var9) + var11 * 2.18166F + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleX; + this.head.rotateAngleY = var12 * (var8 / (180F / (float)Math.PI)) + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleY; + this.head.rotationPointY = var12 * -6.0F + var11 * 11.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointY; + this.head.rotationPointZ = var12 * -1.0F + var11 * -10.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointZ; + this.tailBase.rotationPointY = var12 * 9.0F + var13 * this.tailBase.rotationPointY; + this.tailMiddle.rotationPointZ = var12 * 18.0F + var13 * this.tailMiddle.rotationPointZ; + this.muleRightChest.rotationPointY = var12 * 5.5F + var13 * this.muleRightChest.rotationPointY; + this.muleRightChest.rotationPointZ = var12 * 15.0F + var13 * this.muleRightChest.rotationPointZ; + this.body.rotateAngleX = var12 * -((float)Math.PI / 4F) + var13 * this.body.rotateAngleX; + this.horseLeftEar.rotationPointY = this.head.rotationPointY; + this.horseRightEar.rotationPointY = this.head.rotationPointY; + this.muleLeftEar.rotationPointY = this.head.rotationPointY; + this.muleRightEar.rotationPointY = this.head.rotationPointY; + this.neck.rotationPointY = this.head.rotationPointY; + this.mouthTop.rotationPointY = 0.02F; + this.mouthBottom.rotationPointY = 0.0F; + this.mane.rotationPointY = this.head.rotationPointY; + this.horseLeftEar.rotationPointZ = this.head.rotationPointZ; + this.horseRightEar.rotationPointZ = this.head.rotationPointZ; + this.muleLeftEar.rotationPointZ = this.head.rotationPointZ; + this.muleRightEar.rotationPointZ = this.head.rotationPointZ; + this.neck.rotationPointZ = this.head.rotationPointZ; + this.mouthTop.rotationPointZ = 0.02F - var14 * 1.0F; + this.mouthBottom.rotationPointZ = 0.0F + var14 * 1.0F; + this.mane.rotationPointZ = this.head.rotationPointZ; + this.horseLeftEar.rotateAngleX = this.head.rotateAngleX; + this.horseRightEar.rotateAngleX = this.head.rotateAngleX; + this.muleLeftEar.rotateAngleX = this.head.rotateAngleX; + this.muleRightEar.rotateAngleX = this.head.rotateAngleX; + this.neck.rotateAngleX = this.head.rotateAngleX; + this.mouthTop.rotateAngleX = 0.0F - 0.09424778F * var14; + this.mouthBottom.rotateAngleX = 0.0F + 0.15707964F * var14; + this.mane.rotateAngleX = this.head.rotateAngleX; + this.horseLeftEar.rotateAngleY = this.head.rotateAngleY; + this.horseRightEar.rotateAngleY = this.head.rotateAngleY; + this.muleLeftEar.rotateAngleY = this.head.rotateAngleY; + this.muleRightEar.rotateAngleY = this.head.rotateAngleY; + this.neck.rotateAngleY = this.head.rotateAngleY; + this.mouthTop.rotateAngleY = 0.0F; + this.mouthBottom.rotateAngleY = 0.0F; + this.mane.rotateAngleY = this.head.rotateAngleY; + this.muleLeftChest.rotateAngleX = var20 / 5.0F; + this.muleRightChest.rotateAngleX = -var20 / 5.0F; + float var21 = ((float)Math.PI / 2F); + float var22 = ((float)Math.PI * 3F / 2F); + float var23 = -1.0471976F; + float var24 = 0.2617994F * var12; + float var25 = MathHelper.cos(var18 * 0.6F + (float)Math.PI); + this.frontLeftLeg.rotationPointY = -2.0F * var12 + 9.0F * var13; + this.frontLeftLeg.rotationPointZ = -2.0F * var12 + -8.0F * var13; + this.frontRightLeg.rotationPointY = this.frontLeftLeg.rotationPointY; + this.frontRightLeg.rotationPointZ = this.frontLeftLeg.rotationPointZ; + this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * -var19 * 0.5F * p_78086_3_) * 7.0F; + this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * -var19 * 0.5F * p_78086_3_) * 7.0F; + this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * var19 * 0.5F * p_78086_3_) * 7.0F; + this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * var19 * 0.5F * p_78086_3_) * 7.0F; + float var26 = (-1.0471976F + var25) * var12 + var20 * var13; + float var27 = (-1.0471976F + -var25) * var12 + -var20 * var13; + this.frontLeftShin.rotationPointY = this.frontLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var26) * 7.0F; + this.frontLeftShin.rotationPointZ = this.frontLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var26) * 7.0F; + this.frontRightShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var27) * 7.0F; + this.frontRightShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var27) * 7.0F; + this.backLeftLeg.rotateAngleX = var24 + -var19 * 0.5F * p_78086_3_ * var13; + this.backLeftShin.rotateAngleX = -0.08726646F * var12 + (-var19 * 0.5F * p_78086_3_ - Math.max(0.0F, var19 * 0.5F * p_78086_3_)) * var13; + this.backLeftHoof.rotateAngleX = this.backLeftShin.rotateAngleX; + this.backRightLeg.rotateAngleX = var24 + var19 * 0.5F * p_78086_3_ * var13; + this.backRightShin.rotateAngleX = -0.08726646F * var12 + (var19 * 0.5F * p_78086_3_ - Math.max(0.0F, -var19 * 0.5F * p_78086_3_)) * var13; + this.backRightHoof.rotateAngleX = this.backRightShin.rotateAngleX; + this.frontLeftLeg.rotateAngleX = var26; + this.frontLeftShin.rotateAngleX = (this.frontLeftLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + var25 * 0.2F)) * var12 + (var20 + Math.max(0.0F, var19 * 0.5F * p_78086_3_)) * var13; + this.frontLeftHoof.rotateAngleX = this.frontLeftShin.rotateAngleX; + this.frontRightLeg.rotateAngleX = var27; + this.frontRightShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - var25 * 0.2F)) * var12 + (-var20 + Math.max(0.0F, -var19 * 0.5F * p_78086_3_)) * var13; + this.frontRightHoof.rotateAngleX = this.frontRightShin.rotateAngleX; + this.backLeftHoof.rotationPointY = this.backLeftShin.rotationPointY; + this.backLeftHoof.rotationPointZ = this.backLeftShin.rotationPointZ; + this.backRightHoof.rotationPointY = this.backRightShin.rotationPointY; + this.backRightHoof.rotationPointZ = this.backRightShin.rotationPointZ; + this.frontLeftHoof.rotationPointY = this.frontLeftShin.rotationPointY; + this.frontLeftHoof.rotationPointZ = this.frontLeftShin.rotationPointZ; + this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY; + this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ; + + if (var16) { + this.horseSaddleBottom.rotationPointY = var12 * 0.5F + var13 * 2.0F; + this.horseSaddleBottom.rotationPointZ = var12 * 11.0F + var13 * 2.0F; + this.horseSaddleFront.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseSaddleBack.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseLeftSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseRightSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseLeftSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseRightSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.muleLeftChest.rotationPointY = this.muleRightChest.rotationPointY; + this.horseSaddleFront.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseSaddleBack.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseLeftSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseRightSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseLeftSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseRightSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.muleLeftChest.rotationPointZ = this.muleRightChest.rotationPointZ; + this.horseSaddleBottom.rotateAngleX = this.body.rotateAngleX; + this.horseSaddleFront.rotateAngleX = this.body.rotateAngleX; + this.horseSaddleBack.rotateAngleX = this.body.rotateAngleX; + this.horseLeftRein.rotationPointY = this.head.rotationPointY; + this.horseRightRein.rotationPointY = this.head.rotationPointY; + this.horseFaceRopes.rotationPointY = this.head.rotationPointY; + this.horseLeftFaceMetal.rotationPointY = this.head.rotationPointY; + this.horseRightFaceMetal.rotationPointY = this.head.rotationPointY; + this.horseLeftRein.rotationPointZ = this.head.rotationPointZ; + this.horseRightRein.rotationPointZ = this.head.rotationPointZ; + this.horseFaceRopes.rotationPointZ = this.head.rotationPointZ; + this.horseLeftFaceMetal.rotationPointZ = this.head.rotationPointZ; + this.horseRightFaceMetal.rotationPointZ = this.head.rotationPointZ; + this.horseLeftRein.rotateAngleX = var9; + this.horseRightRein.rotateAngleX = var9; + this.horseFaceRopes.rotateAngleX = this.head.rotateAngleX; + this.horseLeftFaceMetal.rotateAngleX = this.head.rotateAngleX; + this.horseRightFaceMetal.rotateAngleX = this.head.rotateAngleX; + this.horseFaceRopes.rotateAngleY = this.head.rotateAngleY; + this.horseLeftFaceMetal.rotateAngleY = this.head.rotateAngleY; + this.horseLeftRein.rotateAngleY = this.head.rotateAngleY; + this.horseRightFaceMetal.rotateAngleY = this.head.rotateAngleY; + this.horseRightRein.rotateAngleY = this.head.rotateAngleY; + + if (var17) { + this.horseLeftSaddleRope.rotateAngleX = -1.0471976F; + this.horseLeftSaddleMetal.rotateAngleX = -1.0471976F; + this.horseRightSaddleRope.rotateAngleX = -1.0471976F; + this.horseRightSaddleMetal.rotateAngleX = -1.0471976F; + this.horseLeftSaddleRope.rotateAngleZ = 0.0F; + this.horseLeftSaddleMetal.rotateAngleZ = 0.0F; + this.horseRightSaddleRope.rotateAngleZ = 0.0F; + this.horseRightSaddleMetal.rotateAngleZ = 0.0F; + } else { + this.horseLeftSaddleRope.rotateAngleX = var20 / 3.0F; + this.horseLeftSaddleMetal.rotateAngleX = var20 / 3.0F; + this.horseRightSaddleRope.rotateAngleX = var20 / 3.0F; + this.horseRightSaddleMetal.rotateAngleX = var20 / 3.0F; + this.horseLeftSaddleRope.rotateAngleZ = var20 / 5.0F; + this.horseLeftSaddleMetal.rotateAngleZ = var20 / 5.0F; + this.horseRightSaddleRope.rotateAngleZ = -var20 / 5.0F; + this.horseRightSaddleMetal.rotateAngleZ = -var20 / 5.0F; + } + } + + var21 = -1.3089F + p_78086_3_ * 1.5F; + + if (var21 > 0.0F) { + var21 = 0.0F; + } + + if (var15) { + this.tailBase.rotateAngleY = MathHelper.cos(var18 * 0.7F); + var21 = 0.0F; + } else { + this.tailBase.rotateAngleY = 0.0F; + } + + this.tailMiddle.rotateAngleY = this.tailBase.rotateAngleY; + this.tailTip.rotateAngleY = this.tailBase.rotateAngleY; + this.tailMiddle.rotationPointY = this.tailBase.rotationPointY; + this.tailTip.rotationPointY = this.tailBase.rotationPointY; + this.tailMiddle.rotationPointZ = this.tailBase.rotationPointZ; + this.tailTip.rotationPointZ = this.tailBase.rotationPointZ; + this.tailBase.rotateAngleX = var21; + this.tailMiddle.rotateAngleX = var21; + this.tailTip.rotateAngleX = -0.2618F + var21; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelIronGolem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelIronGolem.java new file mode 100644 index 0000000..1f06b5b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelIronGolem.java @@ -0,0 +1,115 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; + +public class ModelIronGolem extends ModelBase { + /** The head model for the iron golem. */ + public ModelRenderer ironGolemHead; + + /** The body model for the iron golem. */ + public ModelRenderer ironGolemBody; + + /** The right arm model for the iron golem. */ + public ModelRenderer ironGolemRightArm; + + /** The left arm model for the iron golem. */ + public ModelRenderer ironGolemLeftArm; + + /** The left leg model for the Iron Golem. */ + public ModelRenderer ironGolemLeftLeg; + + /** The right leg model for the Iron Golem. */ + public ModelRenderer ironGolemRightLeg; + + + public ModelIronGolem() { + this(0.0F); + } + + public ModelIronGolem(float p_i1161_1_) { + this(p_i1161_1_, -7.0F); + } + + public ModelIronGolem(float p_i46362_1_, float p_i46362_2_) { + short var3 = 128; + short var4 = 128; + this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(var3, var4); + this.ironGolemHead.setRotationPoint(0.0F, 0.0F + p_i46362_2_, -2.0F); + this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, p_i46362_1_); + this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, p_i46362_1_); + this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(var3, var4); + this.ironGolemBody.setRotationPoint(0.0F, 0.0F + p_i46362_2_, 0.0F); + this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, p_i46362_1_); + this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, p_i46362_1_ + 0.5F); + this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(var3, var4); + this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F); + this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_); + this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(var3, var4); + this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F); + this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, p_i46362_1_); + this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); + this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + p_i46362_2_, 0.0F); + this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_); + this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); + this.ironGolemRightLeg.mirror = true; + this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + p_i46362_2_, 0.0F); + this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i46362_1_); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.ironGolemHead.render(p_78088_7_); + this.ironGolemBody.render(p_78088_7_); + this.ironGolemLeftLeg.render(p_78088_7_); + this.ironGolemRightLeg.render(p_78088_7_); + this.ironGolemRightArm.render(p_78088_7_); + this.ironGolemLeftArm.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.ironGolemHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.ironGolemHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_; + this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_; + this.ironGolemLeftLeg.rotateAngleY = 0.0F; + this.ironGolemRightLeg.rotateAngleY = 0.0F; + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + EntityIronGolem var5 = (EntityIronGolem)p_78086_1_; + int var6 = var5.getAttackTimer(); + + if (var6 > 0) { + this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - p_78086_4_, 10.0F); + this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - p_78086_4_, 10.0F); + } else { + int var7 = var5.getHoldRoseTick(); + + if (var7 > 0) { + this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)var7, 70.0F); + this.ironGolemLeftArm.rotateAngleX = 0.0F; + } else { + this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_; + this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_; + } + } + } + + private float func_78172_a(float p_78172_1_, float p_78172_2_) { + return (Math.abs(p_78172_1_ % p_78172_2_ - p_78172_2_ * 0.5F) - p_78172_2_ * 0.25F) / (p_78172_2_ * 0.25F); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelLargeChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelLargeChest.java new file mode 100644 index 0000000..6a395bc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelLargeChest.java @@ -0,0 +1,23 @@ +package net.minecraft.client.model; + +public class ModelLargeChest extends ModelChest { + + + public ModelLargeChest() { + this.chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); + this.chestLid.addBox(0.0F, -5.0F, -14.0F, 30, 5, 14, 0.0F); + this.chestLid.rotationPointX = 1.0F; + this.chestLid.rotationPointY = 7.0F; + this.chestLid.rotationPointZ = 15.0F; + this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); + this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); + this.chestKnob.rotationPointX = 16.0F; + this.chestKnob.rotationPointY = 7.0F; + this.chestKnob.rotationPointZ = 15.0F; + this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(128, 64); + this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 30, 10, 14, 0.0F); + this.chestBelow.rotationPointX = 1.0F; + this.chestBelow.rotationPointY = 6.0F; + this.chestBelow.rotationPointZ = 1.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelLeashKnot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelLeashKnot.java new file mode 100644 index 0000000..f8c08b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelLeashKnot.java @@ -0,0 +1,39 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelLeashKnot extends ModelBase { + public ModelRenderer field_110723_a; + + + public ModelLeashKnot() { + this(0, 0, 32, 32); + } + + public ModelLeashKnot(int p_i46365_1_, int p_i46365_2_, int p_i46365_3_, int p_i46365_4_) { + this.textureWidth = p_i46365_3_; + this.textureHeight = p_i46365_4_; + this.field_110723_a = new ModelRenderer(this, p_i46365_1_, p_i46365_2_); + this.field_110723_a.addBox(-3.0F, -6.0F, -3.0F, 6, 8, 6, 0.0F); + this.field_110723_a.setRotationPoint(0.0F, 0.0F, 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.field_110723_a.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.field_110723_a.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.field_110723_a.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelMagmaCube.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelMagmaCube.java new file mode 100644 index 0000000..4c7d3b6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelMagmaCube.java @@ -0,0 +1,61 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityMagmaCube; + +public class ModelMagmaCube extends ModelBase { + ModelRenderer[] field_78109_a = new ModelRenderer[8]; + ModelRenderer field_78108_b; + + + public ModelMagmaCube() { + for (int var1 = 0; var1 < this.field_78109_a.length; ++var1) { + byte var2 = 0; + int var3 = var1; + + if (var1 == 2) { + var2 = 24; + var3 = 10; + } else if (var1 == 3) { + var2 = 24; + var3 = 19; + } + + this.field_78109_a[var1] = new ModelRenderer(this, var2, var3); + this.field_78109_a[var1].addBox(-4.0F, (float)(16 + var1), -4.0F, 8, 1, 8); + } + + this.field_78108_b = new ModelRenderer(this, 0, 16); + this.field_78108_b.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + EntityMagmaCube var5 = (EntityMagmaCube)p_78086_1_; + float var6 = var5.prevSquishFactor + (var5.squishFactor - var5.prevSquishFactor) * p_78086_4_; + + if (var6 < 0.0F) { + var6 = 0.0F; + } + + for (int var7 = 0; var7 < this.field_78109_a.length; ++var7) { + this.field_78109_a[var7].rotationPointY = (float)(-(4 - var7)) * var6 * 1.7F; + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.field_78108_b.render(p_78088_7_); + + for (int var8 = 0; var8 < this.field_78109_a.length; ++var8) { + this.field_78109_a[var8].render(p_78088_7_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelMinecart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelMinecart.java new file mode 100644 index 0000000..14a3f2a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelMinecart.java @@ -0,0 +1,49 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelMinecart extends ModelBase { + public ModelRenderer[] sideModels = new ModelRenderer[7]; + + + public ModelMinecart() { + this.sideModels[0] = new ModelRenderer(this, 0, 10); + this.sideModels[1] = new ModelRenderer(this, 0, 0); + this.sideModels[2] = new ModelRenderer(this, 0, 0); + this.sideModels[3] = new ModelRenderer(this, 0, 0); + this.sideModels[4] = new ModelRenderer(this, 0, 0); + this.sideModels[5] = new ModelRenderer(this, 44, 10); + byte var1 = 20; + byte var2 = 8; + byte var3 = 16; + byte var4 = 4; + this.sideModels[0].addBox((float)(-var1 / 2), (float)(-var3 / 2), -1.0F, var1, var3, 2, 0.0F); + this.sideModels[0].setRotationPoint(0.0F, var4, 0.0F); + this.sideModels[5].addBox((float)(-var1 / 2 + 1), (float)(-var3 / 2 + 1), -1.0F, var1 - 2, var3 - 2, 1, 0.0F); + this.sideModels[5].setRotationPoint(0.0F, var4, 0.0F); + this.sideModels[1].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.sideModels[1].setRotationPoint((float)(-var1 / 2 + 1), var4, 0.0F); + this.sideModels[2].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.sideModels[2].setRotationPoint((float)(var1 / 2 - 1), var4, 0.0F); + this.sideModels[3].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.sideModels[3].setRotationPoint(0.0F, var4, (float)(-var3 / 2 + 1)); + this.sideModels[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.sideModels[4].setRotationPoint(0.0F, var4, (float)(var3 / 2 - 1)); + this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F); + this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F); + this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F); + this.sideModels[3].rotateAngleY = (float)Math.PI; + this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.sideModels[5].rotationPointY = 4.0F - p_78088_4_; + + for (int var8 = 0; var8 < 6; ++var8) { + this.sideModels[var8].render(p_78088_7_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelOcelot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelOcelot.java new file mode 100644 index 0000000..976f239 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelOcelot.java @@ -0,0 +1,198 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelOcelot extends ModelBase { + /** The back left leg model for the Ocelot. */ + ModelRenderer ocelotBackLeftLeg; + + /** The back right leg model for the Ocelot. */ + ModelRenderer ocelotBackRightLeg; + + /** The front left leg model for the Ocelot. */ + ModelRenderer ocelotFrontLeftLeg; + + /** The front right leg model for the Ocelot. */ + ModelRenderer ocelotFrontRightLeg; + + /** The tail model for the Ocelot. */ + ModelRenderer ocelotTail; + + /** The second part of tail model for the Ocelot. */ + ModelRenderer ocelotTail2; + + /** The head model for the Ocelot. */ + ModelRenderer ocelotHead; + + /** The body model for the Ocelot. */ + ModelRenderer ocelotBody; + int field_78163_i = 1; + + + public ModelOcelot() { + this.setTextureOffset("head.main", 0, 0); + this.setTextureOffset("head.nose", 0, 24); + this.setTextureOffset("head.ear1", 0, 10); + this.setTextureOffset("head.ear2", 6, 10); + this.ocelotHead = new ModelRenderer(this, "head"); + this.ocelotHead.addBox("main", -2.5F, -2.0F, -3.0F, 5, 4, 5); + this.ocelotHead.addBox("nose", -1.5F, 0.0F, -4.0F, 3, 2, 2); + this.ocelotHead.addBox("ear1", -2.0F, -3.0F, 0.0F, 1, 1, 2); + this.ocelotHead.addBox("ear2", 1.0F, -3.0F, 0.0F, 1, 1, 2); + this.ocelotHead.setRotationPoint(0.0F, 15.0F, -9.0F); + this.ocelotBody = new ModelRenderer(this, 20, 0); + this.ocelotBody.addBox(-2.0F, 3.0F, -8.0F, 4, 16, 6, 0.0F); + this.ocelotBody.setRotationPoint(0.0F, 12.0F, -10.0F); + this.ocelotTail = new ModelRenderer(this, 0, 15); + this.ocelotTail.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); + this.ocelotTail.rotateAngleX = 0.9F; + this.ocelotTail.setRotationPoint(0.0F, 15.0F, 8.0F); + this.ocelotTail2 = new ModelRenderer(this, 4, 15); + this.ocelotTail2.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); + this.ocelotTail2.setRotationPoint(0.0F, 20.0F, 14.0F); + this.ocelotBackLeftLeg = new ModelRenderer(this, 8, 13); + this.ocelotBackLeftLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); + this.ocelotBackLeftLeg.setRotationPoint(1.1F, 18.0F, 5.0F); + this.ocelotBackRightLeg = new ModelRenderer(this, 8, 13); + this.ocelotBackRightLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); + this.ocelotBackRightLeg.setRotationPoint(-1.1F, 18.0F, 5.0F); + this.ocelotFrontLeftLeg = new ModelRenderer(this, 40, 0); + this.ocelotFrontLeftLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); + this.ocelotFrontLeftLeg.setRotationPoint(1.2F, 13.8F, -5.0F); + this.ocelotFrontRightLeg = new ModelRenderer(this, 40, 0); + this.ocelotFrontRightLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); + this.ocelotFrontRightLeg.setRotationPoint(-1.2F, 13.8F, -5.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); + GL11.glTranslatef(0.0F, 10.0F * p_78088_7_, 4.0F * p_78088_7_); + this.ocelotHead.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.ocelotBody.render(p_78088_7_); + this.ocelotBackLeftLeg.render(p_78088_7_); + this.ocelotBackRightLeg.render(p_78088_7_); + this.ocelotFrontLeftLeg.render(p_78088_7_); + this.ocelotFrontRightLeg.render(p_78088_7_); + this.ocelotTail.render(p_78088_7_); + this.ocelotTail2.render(p_78088_7_); + GL11.glPopMatrix(); + } else { + this.ocelotHead.render(p_78088_7_); + this.ocelotBody.render(p_78088_7_); + this.ocelotTail.render(p_78088_7_); + this.ocelotTail2.render(p_78088_7_); + this.ocelotBackLeftLeg.render(p_78088_7_); + this.ocelotBackRightLeg.render(p_78088_7_); + this.ocelotFrontLeftLeg.render(p_78088_7_); + this.ocelotFrontRightLeg.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.ocelotHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.ocelotHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + + if (this.field_78163_i != 3) { + this.ocelotBody.rotateAngleX = ((float)Math.PI / 2F); + + if (this.field_78163_i == 2) { + this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.0F * p_78087_2_; + this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + 0.3F) * 1.0F * p_78087_2_; + this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * p_78087_2_; + this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.0F * p_78087_2_; + this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 10F) * MathHelper.cos(p_78087_1_) * p_78087_2_; + } else { + this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.0F * p_78087_2_; + this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.0F * p_78087_2_; + this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.0F * p_78087_2_; + this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.0F * p_78087_2_; + + if (this.field_78163_i == 1) { + this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 4F) * MathHelper.cos(p_78087_1_) * p_78087_2_; + } else { + this.ocelotTail2.rotateAngleX = 1.7278761F + 0.47123894F * MathHelper.cos(p_78087_1_) * p_78087_2_; + } + } + } + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + EntityOcelot var5 = (EntityOcelot)p_78086_1_; + this.ocelotBody.rotationPointY = 12.0F; + this.ocelotBody.rotationPointZ = -10.0F; + this.ocelotHead.rotationPointY = 15.0F; + this.ocelotHead.rotationPointZ = -9.0F; + this.ocelotTail.rotationPointY = 15.0F; + this.ocelotTail.rotationPointZ = 8.0F; + this.ocelotTail2.rotationPointY = 20.0F; + this.ocelotTail2.rotationPointZ = 14.0F; + this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 13.8F; + this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -5.0F; + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 18.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 5.0F; + this.ocelotTail.rotateAngleX = 0.9F; + + if (var5.isSneaking()) { + ++this.ocelotBody.rotationPointY; + this.ocelotHead.rotationPointY += 2.0F; + ++this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointY += -4.0F; + this.ocelotTail2.rotationPointZ += 2.0F; + this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); + this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 0; + } else if (var5.isSprinting()) { + this.ocelotTail2.rotationPointY = this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointZ += 2.0F; + this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); + this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 2; + } else if (var5.isSitting()) { + this.ocelotBody.rotateAngleX = ((float)Math.PI / 4F); + this.ocelotBody.rotationPointY += -4.0F; + this.ocelotBody.rotationPointZ += 5.0F; + this.ocelotHead.rotationPointY += -3.3F; + ++this.ocelotHead.rotationPointZ; + this.ocelotTail.rotationPointY += 8.0F; + this.ocelotTail.rotationPointZ += -2.0F; + this.ocelotTail2.rotationPointY += 2.0F; + this.ocelotTail2.rotationPointZ += -0.8F; + this.ocelotTail.rotateAngleX = 1.7278761F; + this.ocelotTail2.rotateAngleX = 2.670354F; + this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = -0.15707964F; + this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 15.8F; + this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -7.0F; + this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = -((float)Math.PI / 2F); + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 21.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 1.0F; + this.field_78163_i = 3; + } else { + this.field_78163_i = 1; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelPig.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelPig.java new file mode 100644 index 0000000..3db842f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelPig.java @@ -0,0 +1,15 @@ +package net.minecraft.client.model; + +public class ModelPig extends ModelQuadruped { + + + public ModelPig() { + this(0.0F); + } + + public ModelPig(float p_i1151_1_) { + super(6, p_i1151_1_); + this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, p_i1151_1_); + this.field_78145_g = 4.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelQuadruped.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelQuadruped.java new file mode 100644 index 0000000..1229285 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelQuadruped.java @@ -0,0 +1,84 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelQuadruped extends ModelBase { + public ModelRenderer head = new ModelRenderer(this, 0, 0); + public ModelRenderer body; + public ModelRenderer leg1; + public ModelRenderer leg2; + public ModelRenderer leg3; + public ModelRenderer leg4; + protected float field_78145_g = 8.0F; + protected float field_78151_h = 4.0F; + + + public ModelQuadruped(int p_i1154_1_, float p_i1154_2_) { + this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, p_i1154_2_); + this.head.setRotationPoint(0.0F, (float)(18 - p_i1154_1_), -6.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, p_i1154_2_); + this.body.setRotationPoint(0.0F, (float)(17 - p_i1154_1_), 2.0F); + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg1.setRotationPoint(-3.0F, (float)(24 - p_i1154_1_), 7.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg2.setRotationPoint(3.0F, (float)(24 - p_i1154_1_), 7.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg3.setRotationPoint(-3.0F, (float)(24 - p_i1154_1_), -5.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg4.setRotationPoint(3.0F, (float)(24 - p_i1154_1_), -5.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, this.field_78145_g * p_78088_7_, this.field_78151_h * p_78088_7_); + this.head.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.body.render(p_78088_7_); + this.leg1.render(p_78088_7_); + this.leg2.render(p_78088_7_); + this.leg3.render(p_78088_7_); + this.leg4.render(p_78088_7_); + GL11.glPopMatrix(); + } else { + this.head.render(p_78088_7_); + this.body.render(p_78088_7_); + this.leg1.render(p_78088_7_); + this.leg2.render(p_78088_7_); + this.leg3.render(p_78088_7_); + this.leg4.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + float var8 = (180F / (float)Math.PI); + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.leg1.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leg2.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg3.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg4.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelRenderer.java new file mode 100644 index 0000000..bf67c99 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelRenderer.java @@ -0,0 +1,284 @@ +package net.minecraft.client.model; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.src.ModelSprite; +import org.lwjgl.opengl.GL11; + +public class ModelRenderer { + /** The size of the texture file's width in pixels. */ + public float textureWidth; + + /** The size of the texture file's height in pixels. */ + public float textureHeight; + + /** The X offset into the texture used for displaying this model */ + private int textureOffsetX; + + /** The Y offset into the texture used for displaying this model */ + private int textureOffsetY; + public float rotationPointX; + public float rotationPointY; + public float rotationPointZ; + public float rotateAngleX; + public float rotateAngleY; + public float rotateAngleZ; + private boolean compiled; + + /** The GL display list rendered by the Tessellator for this model */ + private int displayList; + public boolean mirror; + public boolean showModel; + + /** Hides the model. */ + public boolean isHidden; + public List cubeList; + public List childModels; + public final String boxName; + private ModelBase baseModel; + public float offsetX; + public float offsetY; + public float offsetZ; + public List spriteList; + public boolean mirrorV; + float savedScale; + + public ModelRenderer(ModelBase par1ModelBase, String par2Str) { + this.spriteList = new ArrayList(); + this.mirrorV = false; + this.textureWidth = 64.0F; + this.textureHeight = 32.0F; + this.showModel = true; + this.cubeList = new ArrayList(); + this.baseModel = par1ModelBase; + par1ModelBase.boxList.add(this); + this.boxName = par2Str; + this.setTextureSize(par1ModelBase.textureWidth, par1ModelBase.textureHeight); + } + + public ModelRenderer(ModelBase par1ModelBase) { + this(par1ModelBase, (String)null); + } + + public ModelRenderer(ModelBase par1ModelBase, int par2, int par3) { + this(par1ModelBase); + this.setTextureOffset(par2, par3); + } + + /** + * Sets the current box's rotation points and rotation angles to another box. + */ + public void addChild(ModelRenderer par1ModelRenderer) { + if (this.childModels == null) { + this.childModels = new ArrayList(); + } + + this.childModels.add(par1ModelRenderer); + } + + public ModelRenderer setTextureOffset(int par1, int par2) { + this.textureOffsetX = par1; + this.textureOffsetY = par2; + return this; + } + + public ModelRenderer addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7) { + par1Str = this.boxName + "." + par1Str; + TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); + this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); + this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F)).func_78244_a(par1Str)); + return this; + } + + public ModelRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) { + this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F)); + return this; + } + + /** + * Creates a textured box. Args: originX, originY, originZ, width, height, depth, scaleFactor. + */ + public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) { + this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7)); + } + + public void setRotationPoint(float par1, float par2, float par3) { + this.rotationPointX = par1; + this.rotationPointY = par2; + this.rotationPointZ = par3; + } + + public void render(float par1) { + if (!this.isHidden && this.showModel) { + if (!this.compiled) { + this.compileDisplayList(par1); + } + + GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); + int var2; + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { + if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) { + GL11.glCallList(this.displayList); + + if (this.childModels != null) { + for (var2 = 0; var2 < this.childModels.size(); ++var2) { + ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + } else { + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + GL11.glCallList(this.displayList); + + if (this.childModels != null) { + for (var2 = 0; var2 < this.childModels.size(); ++var2) { + ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + + GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1, -this.rotationPointZ * par1); + } + } else { + GL11.glPushMatrix(); + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + + if (this.rotateAngleZ != 0.0F) { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + GL11.glCallList(this.displayList); + + if (this.childModels != null) { + for (var2 = 0; var2 < this.childModels.size(); ++var2) { + ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + + GL11.glPopMatrix(); + } + + GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ); + } + } + + public void renderWithRotation(float par1) { + if (!this.isHidden && this.showModel) { + if (!this.compiled) { + this.compileDisplayList(par1); + } + + GL11.glPushMatrix(); + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + + if (this.rotateAngleY != 0.0F) { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (this.rotateAngleZ != 0.0F) { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + GL11.glCallList(this.displayList); + GL11.glPopMatrix(); + } + } + + /** + * Allows the changing of Angles after a box has been rendered + */ + public void postRender(float par1) { + if (!this.isHidden && this.showModel) { + if (!this.compiled) { + this.compileDisplayList(par1); + } + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { + if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + } + } else { + GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + + if (this.rotateAngleZ != 0.0F) { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + } + } + } + + /** + * Compiles a GL display list for this model + */ + private void compileDisplayList(float par1) { + if (this.displayList == 0) { + this.savedScale = par1; + this.displayList = GLAllocation.generateDisplayLists(1); + } + + GL11.glNewList(this.displayList, GL11.GL_COMPILE); + Tessellator var2 = Tessellator.instance; + int i; + + for (i = 0; i < this.cubeList.size(); ++i) { + ((ModelBox)this.cubeList.get(i)).render(var2, par1); + } + + for (i = 0; i < this.spriteList.size(); ++i) { + ModelSprite sprite = (ModelSprite)this.spriteList.get(i); + sprite.render(Tessellator.instance, par1); + } + + GL11.glEndList(); + this.compiled = true; + } + + /** + * Returns the model renderer with the new texture parameters. + */ + public ModelRenderer setTextureSize(int par1, int par2) { + this.textureWidth = (float)par1; + this.textureHeight = (float)par2; + return this; + } + + public void addSprite(float posX, float posY, float posZ, int sizeX, int sizeY, int sizeZ, float sizeAdd) { + this.spriteList.add(new ModelSprite(this, this.textureOffsetX, this.textureOffsetY, posX, posY, posZ, sizeX, sizeY, sizeZ, sizeAdd)); + } + + public boolean getCompiled() { + return this.compiled; + } + + public int getDisplayList() { + return this.displayList; + } + + public void resetDisplayList() { + if (this.compiled) { + this.compiled = false; + this.compileDisplayList(this.savedScale); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSheep1.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSheep1.java new file mode 100644 index 0000000..69e886a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSheep1.java @@ -0,0 +1,53 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; + +public class ModelSheep1 extends ModelQuadruped { + private float field_78152_i; + + + public ModelSheep1() { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F); + this.head.setRotationPoint(0.0F, 6.0F, -8.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 1.75F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + float var1 = 0.5F; + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); + this.leg1.setRotationPoint(-3.0F, 12.0F, 7.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); + this.leg2.setRotationPoint(3.0F, 12.0F, 7.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); + this.leg3.setRotationPoint(-3.0F, 12.0F, -5.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); + this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + this.head.rotationPointY = 6.0F + ((EntitySheep)p_78086_1_).func_70894_j(p_78086_4_) * 9.0F; + this.field_78152_i = ((EntitySheep)p_78086_1_).func_70890_k(p_78086_4_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.head.rotateAngleX = this.field_78152_i; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSheep2.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSheep2.java new file mode 100644 index 0000000..eac4e97 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSheep2.java @@ -0,0 +1,40 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; + +public class ModelSheep2 extends ModelQuadruped { + private float field_78153_i; + + + public ModelSheep2() { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F); + this.head.setRotationPoint(0.0F, 6.0F, -8.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + this.head.rotationPointY = 6.0F + ((EntitySheep)p_78086_1_).func_70894_j(p_78086_4_) * 9.0F; + this.field_78153_i = ((EntitySheep)p_78086_1_).func_70890_k(p_78086_4_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.head.rotateAngleX = this.field_78153_i; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSign.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSign.java new file mode 100644 index 0000000..83cc95a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSign.java @@ -0,0 +1,24 @@ +package net.minecraft.client.model; + +public class ModelSign extends ModelBase { + /** The board on a sign that has the writing on it. */ + public ModelRenderer signBoard = new ModelRenderer(this, 0, 0); + + /** The stick a sign stands on. */ + public ModelRenderer signStick; + + + public ModelSign() { + this.signBoard.addBox(-12.0F, -14.0F, -1.0F, 24, 12, 2, 0.0F); + this.signStick = new ModelRenderer(this, 0, 14); + this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F); + } + + /** + * Renders the sign model through TileEntitySignRenderer + */ + public void renderSign() { + this.signBoard.render(0.0625F); + this.signStick.render(0.0625F); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSilverfish.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSilverfish.java new file mode 100644 index 0000000..acecbc7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSilverfish.java @@ -0,0 +1,80 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelSilverfish extends ModelBase { + /** The body parts of the silverfish's model. */ + private final ModelRenderer[] silverfishBodyParts = new ModelRenderer[7]; + + /** The wings (dust-looking sprites) on the silverfish's model. */ + private final ModelRenderer[] silverfishWings; + private final float[] field_78170_c = new float[7]; + + /** The widths, heights, and lengths for the silverfish model boxes. */ + private static final int[][] silverfishBoxLength = new int[][] {{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; + + /** The texture positions for the silverfish's model's boxes. */ + private static final int[][] silverfishTexturePositions = new int[][] {{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; + + + public ModelSilverfish() { + float var1 = -3.5F; + + for (int var2 = 0; var2 < this.silverfishBodyParts.length; ++var2) { + this.silverfishBodyParts[var2] = new ModelRenderer(this, silverfishTexturePositions[var2][0], silverfishTexturePositions[var2][1]); + this.silverfishBodyParts[var2].addBox((float)silverfishBoxLength[var2][0] * -0.5F, 0.0F, (float)silverfishBoxLength[var2][2] * -0.5F, silverfishBoxLength[var2][0], silverfishBoxLength[var2][1], silverfishBoxLength[var2][2]); + this.silverfishBodyParts[var2].setRotationPoint(0.0F, (float)(24 - silverfishBoxLength[var2][1]), var1); + this.field_78170_c[var2] = var1; + + if (var2 < this.silverfishBodyParts.length - 1) { + var1 += (float)(silverfishBoxLength[var2][2] + silverfishBoxLength[var2 + 1][2]) * 0.5F; + } + } + + this.silverfishWings = new ModelRenderer[3]; + this.silverfishWings[0] = new ModelRenderer(this, 20, 0); + this.silverfishWings[0].addBox(-5.0F, 0.0F, (float)silverfishBoxLength[2][2] * -0.5F, 10, 8, silverfishBoxLength[2][2]); + this.silverfishWings[0].setRotationPoint(0.0F, 16.0F, this.field_78170_c[2]); + this.silverfishWings[1] = new ModelRenderer(this, 20, 11); + this.silverfishWings[1].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 4, silverfishBoxLength[4][2]); + this.silverfishWings[1].setRotationPoint(0.0F, 20.0F, this.field_78170_c[4]); + this.silverfishWings[2] = new ModelRenderer(this, 20, 18); + this.silverfishWings[2].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 5, silverfishBoxLength[1][2]); + this.silverfishWings[2].setRotationPoint(0.0F, 19.0F, this.field_78170_c[1]); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + int var8; + + for (var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { + this.silverfishBodyParts[var8].render(p_78088_7_); + } + + for (var8 = 0; var8 < this.silverfishWings.length; ++var8) { + this.silverfishWings[var8].render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + for (int var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { + this.silverfishBodyParts[var8].rotateAngleY = MathHelper.cos(p_78087_3_ * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(var8 - 2)); + this.silverfishBodyParts[var8].rotationPointX = MathHelper.sin(p_78087_3_ * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(var8 - 2); + } + + this.silverfishWings[0].rotateAngleY = this.silverfishBodyParts[2].rotateAngleY; + this.silverfishWings[1].rotateAngleY = this.silverfishBodyParts[4].rotateAngleY; + this.silverfishWings[1].rotationPointX = this.silverfishBodyParts[4].rotationPointX; + this.silverfishWings[2].rotateAngleY = this.silverfishBodyParts[1].rotateAngleY; + this.silverfishWings[2].rotationPointX = this.silverfishBodyParts[1].rotationPointX; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSkeleton.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSkeleton.java new file mode 100644 index 0000000..aaad2b2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSkeleton.java @@ -0,0 +1,49 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntitySkeleton; + +public class ModelSkeleton extends ModelZombie { + + + public ModelSkeleton() { + this(0.0F); + } + + public ModelSkeleton(float p_i1156_1_) { + super(p_i1156_1_, 0.0F, 64, 32); + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + this.aimedBow = ((EntitySkeleton)p_78086_1_).getSkeletonType() == 1; + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java new file mode 100644 index 0000000..a45880b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSkeletonHead.java @@ -0,0 +1,39 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelSkeletonHead extends ModelBase { + public ModelRenderer skeletonHead; + + + public ModelSkeletonHead() { + this(0, 35, 64, 64); + } + + public ModelSkeletonHead(int p_i1155_1_, int p_i1155_2_, int p_i1155_3_, int p_i1155_4_) { + this.textureWidth = p_i1155_3_; + this.textureHeight = p_i1155_4_; + this.skeletonHead = new ModelRenderer(this, p_i1155_1_, p_i1155_2_); + this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); + this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.skeletonHead.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.skeletonHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.skeletonHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSlime.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSlime.java new file mode 100644 index 0000000..efc9494 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSlime.java @@ -0,0 +1,48 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelSlime extends ModelBase { + /** The slime's bodies, both the inside box and the outside box */ + ModelRenderer slimeBodies; + + /** The slime's right eye */ + ModelRenderer slimeRightEye; + + /** The slime's left eye */ + ModelRenderer slimeLeftEye; + + /** The slime's mouth */ + ModelRenderer slimeMouth; + + + public ModelSlime(int p_i1157_1_) { + this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_); + this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); + + if (p_i1157_1_ > 0) { + this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_); + this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6); + this.slimeRightEye = new ModelRenderer(this, 32, 0); + this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeLeftEye = new ModelRenderer(this, 32, 4); + this.slimeLeftEye.addBox(1.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeMouth = new ModelRenderer(this, 32, 8); + this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1); + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.slimeBodies.render(p_78088_7_); + + if (this.slimeRightEye != null) { + this.slimeRightEye.render(p_78088_7_); + this.slimeLeftEye.render(p_78088_7_); + this.slimeMouth.render(p_78088_7_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSnowMan.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSnowMan.java new file mode 100644 index 0000000..e482516 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSnowMan.java @@ -0,0 +1,67 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelSnowMan extends ModelBase { + public ModelRenderer body; + public ModelRenderer bottomBody; + public ModelRenderer head; + public ModelRenderer rightHand; + public ModelRenderer leftHand; + + + public ModelSnowMan() { + float var1 = 4.0F; + float var2 = 0.0F; + this.head = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var2 - 0.5F); + this.head.setRotationPoint(0.0F, 0.0F + var1, 0.0F); + this.rightHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); + this.rightHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, var2 - 0.5F); + this.rightHand.setRotationPoint(0.0F, 0.0F + var1 + 9.0F - 7.0F, 0.0F); + this.leftHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); + this.leftHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, var2 - 0.5F); + this.leftHand.setRotationPoint(0.0F, 0.0F + var1 + 9.0F - 7.0F, 0.0F); + this.body = (new ModelRenderer(this, 0, 16)).setTextureSize(64, 64); + this.body.addBox(-5.0F, -10.0F, -5.0F, 10, 10, 10, var2 - 0.5F); + this.body.setRotationPoint(0.0F, 0.0F + var1 + 9.0F, 0.0F); + this.bottomBody = (new ModelRenderer(this, 0, 36)).setTextureSize(64, 64); + this.bottomBody.addBox(-6.0F, -12.0F, -6.0F, 12, 12, 12, var2 - 0.5F); + this.bottomBody.setRotationPoint(0.0F, 0.0F + var1 + 20.0F, 0.0F); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.body.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI) * 0.25F; + float var8 = MathHelper.sin(this.body.rotateAngleY); + float var9 = MathHelper.cos(this.body.rotateAngleY); + this.rightHand.rotateAngleZ = 1.0F; + this.leftHand.rotateAngleZ = -1.0F; + this.rightHand.rotateAngleY = 0.0F + this.body.rotateAngleY; + this.leftHand.rotateAngleY = (float)Math.PI + this.body.rotateAngleY; + this.rightHand.rotationPointX = var9 * 5.0F; + this.rightHand.rotationPointZ = -var8 * 5.0F; + this.leftHand.rotationPointX = -var9 * 5.0F; + this.leftHand.rotationPointZ = var8 * 5.0F; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.body.render(p_78088_7_); + this.bottomBody.render(p_78088_7_); + this.head.render(p_78088_7_); + this.rightHand.render(p_78088_7_); + this.leftHand.render(p_78088_7_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSpider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSpider.java new file mode 100644 index 0000000..5d4fcae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSpider.java @@ -0,0 +1,149 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelSpider extends ModelBase { + /** The spider's head box */ + public ModelRenderer spiderHead; + + /** The spider's neck box */ + public ModelRenderer spiderNeck; + + /** The spider's body box */ + public ModelRenderer spiderBody; + + /** Spider's first leg */ + public ModelRenderer spiderLeg1; + + /** Spider's second leg */ + public ModelRenderer spiderLeg2; + + /** Spider's third leg */ + public ModelRenderer spiderLeg3; + + /** Spider's fourth leg */ + public ModelRenderer spiderLeg4; + + /** Spider's fifth leg */ + public ModelRenderer spiderLeg5; + + /** Spider's sixth leg */ + public ModelRenderer spiderLeg6; + + /** Spider's seventh leg */ + public ModelRenderer spiderLeg7; + + /** Spider's eight leg */ + public ModelRenderer spiderLeg8; + + + public ModelSpider() { + float var1 = 0.0F; + byte var2 = 15; + this.spiderHead = new ModelRenderer(this, 32, 4); + this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, var1); + this.spiderHead.setRotationPoint(0.0F, var2, -3.0F); + this.spiderNeck = new ModelRenderer(this, 0, 0); + this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, var1); + this.spiderNeck.setRotationPoint(0.0F, var2, 0.0F); + this.spiderBody = new ModelRenderer(this, 0, 12); + this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, var1); + this.spiderBody.setRotationPoint(0.0F, var2, 9.0F); + this.spiderLeg1 = new ModelRenderer(this, 18, 0); + this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg1.setRotationPoint(-4.0F, var2, 2.0F); + this.spiderLeg2 = new ModelRenderer(this, 18, 0); + this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg2.setRotationPoint(4.0F, var2, 2.0F); + this.spiderLeg3 = new ModelRenderer(this, 18, 0); + this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg3.setRotationPoint(-4.0F, var2, 1.0F); + this.spiderLeg4 = new ModelRenderer(this, 18, 0); + this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg4.setRotationPoint(4.0F, var2, 1.0F); + this.spiderLeg5 = new ModelRenderer(this, 18, 0); + this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg5.setRotationPoint(-4.0F, var2, 0.0F); + this.spiderLeg6 = new ModelRenderer(this, 18, 0); + this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg6.setRotationPoint(4.0F, var2, 0.0F); + this.spiderLeg7 = new ModelRenderer(this, 18, 0); + this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg7.setRotationPoint(-4.0F, var2, -1.0F); + this.spiderLeg8 = new ModelRenderer(this, 18, 0); + this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1); + this.spiderLeg8.setRotationPoint(4.0F, var2, -1.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.spiderHead.render(p_78088_7_); + this.spiderNeck.render(p_78088_7_); + this.spiderBody.render(p_78088_7_); + this.spiderLeg1.render(p_78088_7_); + this.spiderLeg2.render(p_78088_7_); + this.spiderLeg3.render(p_78088_7_); + this.spiderLeg4.render(p_78088_7_); + this.spiderLeg5.render(p_78088_7_); + this.spiderLeg6.render(p_78088_7_); + this.spiderLeg7.render(p_78088_7_); + this.spiderLeg8.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.spiderHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.spiderHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + float var8 = ((float)Math.PI / 4F); + this.spiderLeg1.rotateAngleZ = -var8; + this.spiderLeg2.rotateAngleZ = var8; + this.spiderLeg3.rotateAngleZ = -var8 * 0.74F; + this.spiderLeg4.rotateAngleZ = var8 * 0.74F; + this.spiderLeg5.rotateAngleZ = -var8 * 0.74F; + this.spiderLeg6.rotateAngleZ = var8 * 0.74F; + this.spiderLeg7.rotateAngleZ = -var8; + this.spiderLeg8.rotateAngleZ = var8; + float var9 = -0.0F; + float var10 = 0.3926991F; + this.spiderLeg1.rotateAngleY = var10 * 2.0F + var9; + this.spiderLeg2.rotateAngleY = -var10 * 2.0F - var9; + this.spiderLeg3.rotateAngleY = var10 * 1.0F + var9; + this.spiderLeg4.rotateAngleY = -var10 * 1.0F - var9; + this.spiderLeg5.rotateAngleY = -var10 * 1.0F + var9; + this.spiderLeg6.rotateAngleY = var10 * 1.0F - var9; + this.spiderLeg7.rotateAngleY = -var10 * 2.0F + var9; + this.spiderLeg8.rotateAngleY = var10 * 2.0F - var9; + float var11 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + 0.0F) * 0.4F) * p_78087_2_; + float var12 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * p_78087_2_; + float var13 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * p_78087_2_; + float var14 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_; + float var15 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + 0.0F) * 0.4F) * p_78087_2_; + float var16 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + (float)Math.PI) * 0.4F) * p_78087_2_; + float var17 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * p_78087_2_; + float var18 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_; + this.spiderLeg1.rotateAngleY += var11; + this.spiderLeg2.rotateAngleY += -var11; + this.spiderLeg3.rotateAngleY += var12; + this.spiderLeg4.rotateAngleY += -var12; + this.spiderLeg5.rotateAngleY += var13; + this.spiderLeg6.rotateAngleY += -var13; + this.spiderLeg7.rotateAngleY += var14; + this.spiderLeg8.rotateAngleY += -var14; + this.spiderLeg1.rotateAngleZ += var15; + this.spiderLeg2.rotateAngleZ += -var15; + this.spiderLeg3.rotateAngleZ += var16; + this.spiderLeg4.rotateAngleZ += -var16; + this.spiderLeg5.rotateAngleZ += var17; + this.spiderLeg6.rotateAngleZ += -var17; + this.spiderLeg7.rotateAngleZ += var18; + this.spiderLeg8.rotateAngleZ += -var18; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSquid.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSquid.java new file mode 100644 index 0000000..ffa3e70 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelSquid.java @@ -0,0 +1,59 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; + +public class ModelSquid extends ModelBase { + /** The squid's body */ + ModelRenderer squidBody; + + /** The squid's tentacles */ + ModelRenderer[] squidTentacles = new ModelRenderer[8]; + + + public ModelSquid() { + byte var1 = -16; + this.squidBody = new ModelRenderer(this, 0, 0); + this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12); + this.squidBody.rotationPointY += (float)(24 + var1); + + for (int var2 = 0; var2 < this.squidTentacles.length; ++var2) { + this.squidTentacles[var2] = new ModelRenderer(this, 48, 0); + double var3 = (double)var2 * Math.PI * 2.0D / (double)this.squidTentacles.length; + float var5 = (float)Math.cos(var3) * 5.0F; + float var6 = (float)Math.sin(var3) * 5.0F; + this.squidTentacles[var2].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2); + this.squidTentacles[var2].rotationPointX = var5; + this.squidTentacles[var2].rotationPointZ = var6; + this.squidTentacles[var2].rotationPointY = (float)(31 + var1); + var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D); + this.squidTentacles[var2].rotateAngleY = (float)var3; + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + ModelRenderer[] var8 = this.squidTentacles; + int var9 = var8.length; + + for (int var10 = 0; var10 < var9; ++var10) { + ModelRenderer var11 = var8[var10]; + var11.rotateAngleX = p_78087_3_; + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.squidBody.render(p_78088_7_); + + for (int var8 = 0; var8 < this.squidTentacles.length; ++var8) { + this.squidTentacles[var8].render(p_78088_7_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelVillager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelVillager.java new file mode 100644 index 0000000..9d45133 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelVillager.java @@ -0,0 +1,82 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelVillager extends ModelBase { + /** The head box of the VillagerModel */ + public ModelRenderer villagerHead; + + /** The body of the VillagerModel */ + public ModelRenderer villagerBody; + + /** The arms of the VillagerModel */ + public ModelRenderer villagerArms; + + /** The right leg of the VillagerModel */ + public ModelRenderer rightVillagerLeg; + + /** The left leg of the VillagerModel */ + public ModelRenderer leftVillagerLeg; + public ModelRenderer villagerNose; + + + public ModelVillager(float p_i1163_1_) { + this(p_i1163_1_, 0.0F, 64, 64); + } + + public ModelVillager(float p_i1164_1_, float p_i1164_2_, int p_i1164_3_, int p_i1164_4_) { + this.villagerHead = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerHead.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F); + this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1164_1_); + this.villagerNose = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerNose.setRotationPoint(0.0F, p_i1164_2_ - 2.0F, 0.0F); + this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, p_i1164_1_); + this.villagerHead.addChild(this.villagerNose); + this.villagerBody = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerBody.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F); + this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, p_i1164_1_); + this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, p_i1164_1_ + 0.5F); + this.villagerArms = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerArms.setRotationPoint(0.0F, 0.0F + p_i1164_2_ + 2.0F, 0.0F); + this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, p_i1164_1_); + this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, p_i1164_1_); + this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, p_i1164_1_); + this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + p_i1164_2_, 0.0F); + this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1164_1_); + this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.leftVillagerLeg.mirror = true; + this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + p_i1164_2_, 0.0F); + this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1164_1_); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.villagerHead.render(p_78088_7_); + this.villagerBody.render(p_78088_7_); + this.rightVillagerLeg.render(p_78088_7_); + this.leftVillagerLeg.render(p_78088_7_); + this.villagerArms.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.villagerHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.villagerHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.villagerArms.rotationPointY = 3.0F; + this.villagerArms.rotationPointZ = -1.0F; + this.villagerArms.rotateAngleX = -0.75F; + this.rightVillagerLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_ * 0.5F; + this.leftVillagerLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_ * 0.5F; + this.rightVillagerLeg.rotateAngleY = 0.0F; + this.leftVillagerLeg.rotateAngleY = 0.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWitch.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWitch.java new file mode 100644 index 0000000..0a68b0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWitch.java @@ -0,0 +1,60 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelWitch extends ModelVillager { + public boolean field_82900_g; + private final ModelRenderer field_82901_h = (new ModelRenderer(this)).setTextureSize(64, 128); + private final ModelRenderer witchHat; + + + public ModelWitch(float p_i46361_1_) { + super(p_i46361_1_, 0.0F, 64, 128); + this.field_82901_h.setRotationPoint(0.0F, -2.0F, 0.0F); + this.field_82901_h.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F); + this.villagerNose.addChild(this.field_82901_h); + this.witchHat = (new ModelRenderer(this)).setTextureSize(64, 128); + this.witchHat.setRotationPoint(-5.0F, -10.03125F, -5.0F); + this.witchHat.setTextureOffset(0, 64).addBox(0.0F, 0.0F, 0.0F, 10, 2, 10); + this.villagerHead.addChild(this.witchHat); + ModelRenderer var2 = (new ModelRenderer(this)).setTextureSize(64, 128); + var2.setRotationPoint(1.75F, -4.0F, 2.0F); + var2.setTextureOffset(0, 76).addBox(0.0F, 0.0F, 0.0F, 7, 4, 7); + var2.rotateAngleX = -0.05235988F; + var2.rotateAngleZ = 0.02617994F; + this.witchHat.addChild(var2); + ModelRenderer var3 = (new ModelRenderer(this)).setTextureSize(64, 128); + var3.setRotationPoint(1.75F, -4.0F, 2.0F); + var3.setTextureOffset(0, 87).addBox(0.0F, 0.0F, 0.0F, 4, 4, 4); + var3.rotateAngleX = -0.10471976F; + var3.rotateAngleZ = 0.05235988F; + var2.addChild(var3); + ModelRenderer var4 = (new ModelRenderer(this)).setTextureSize(64, 128); + var4.setRotationPoint(1.75F, -2.0F, 2.0F); + var4.setTextureOffset(0, 95).addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.25F); + var4.rotateAngleX = -0.20943952F; + var4.rotateAngleZ = 0.10471976F; + var3.addChild(var4); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.villagerNose.offsetX = this.villagerNose.offsetY = this.villagerNose.offsetZ = 0.0F; + float var8 = 0.01F * (float)(p_78087_7_.getEntityId() % 10); + this.villagerNose.rotateAngleX = MathHelper.sin((float)p_78087_7_.ticksExisted * var8) * 4.5F * (float)Math.PI / 180.0F; + this.villagerNose.rotateAngleY = 0.0F; + this.villagerNose.rotateAngleZ = MathHelper.cos((float)p_78087_7_.ticksExisted * var8) * 2.5F * (float)Math.PI / 180.0F; + + if (this.field_82900_g) { + this.villagerNose.rotateAngleX = -0.9F; + this.villagerNose.offsetZ = -0.09375F; + this.villagerNose.offsetY = 0.1875F; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWither.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWither.java new file mode 100644 index 0000000..ae04e1f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWither.java @@ -0,0 +1,94 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.util.MathHelper; + +public class ModelWither extends ModelBase { + private final ModelRenderer[] field_82905_a; + private final ModelRenderer[] field_82904_b; + + + public ModelWither() { + this.textureWidth = 64; + this.textureHeight = 64; + this.field_82905_a = new ModelRenderer[3]; + this.field_82905_a[0] = new ModelRenderer(this, 0, 16); + this.field_82905_a[0].addBox(-10.0F, 3.9F, -0.5F, 20, 3, 3); + this.field_82905_a[1] = (new ModelRenderer(this)).setTextureSize(this.textureWidth, this.textureHeight); + this.field_82905_a[1].setRotationPoint(-2.0F, 6.9F, -0.5F); + this.field_82905_a[1].setTextureOffset(0, 22).addBox(0.0F, 0.0F, 0.0F, 3, 10, 3); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 1.5F, 0.5F, 11, 2, 2); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 4.0F, 0.5F, 11, 2, 2); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 6.5F, 0.5F, 11, 2, 2); + this.field_82905_a[2] = new ModelRenderer(this, 12, 22); + this.field_82905_a[2].addBox(0.0F, 0.0F, 0.0F, 3, 6, 3); + this.field_82904_b = new ModelRenderer[3]; + this.field_82904_b[0] = new ModelRenderer(this, 0, 0); + this.field_82904_b[0].addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + this.field_82904_b[1] = new ModelRenderer(this, 32, 0); + this.field_82904_b[1].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6); + this.field_82904_b[1].rotationPointX = -8.0F; + this.field_82904_b[1].rotationPointY = 4.0F; + this.field_82904_b[2] = new ModelRenderer(this, 32, 0); + this.field_82904_b[2].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6); + this.field_82904_b[2].rotationPointX = 10.0F; + this.field_82904_b[2].rotationPointY = 4.0F; + } + + public int func_82903_a() { + return 32; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + ModelRenderer[] var8 = this.field_82904_b; + int var9 = var8.length; + int var10; + ModelRenderer var11; + + for (var10 = 0; var10 < var9; ++var10) { + var11 = var8[var10]; + var11.render(p_78088_7_); + } + + var8 = this.field_82905_a; + var9 = var8.length; + + for (var10 = 0; var10 < var9; ++var10) { + var11 = var8[var10]; + var11.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + float var8 = MathHelper.cos(p_78087_3_ * 0.1F); + this.field_82905_a[1].rotateAngleX = (0.065F + 0.05F * var8) * (float)Math.PI; + this.field_82905_a[2].setRotationPoint(-2.0F, 6.9F + MathHelper.cos(this.field_82905_a[1].rotateAngleX) * 10.0F, -0.5F + MathHelper.sin(this.field_82905_a[1].rotateAngleX) * 10.0F); + this.field_82905_a[2].rotateAngleX = (0.265F + 0.1F * var8) * (float)Math.PI; + this.field_82904_b[0].rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.field_82904_b[0].rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + EntityWither var5 = (EntityWither)p_78086_1_; + + for (int var6 = 1; var6 < 3; ++var6) { + this.field_82904_b[var6].rotateAngleY = (var5.func_82207_a(var6 - 1) - p_78086_1_.renderYawOffset) / (180F / (float)Math.PI); + this.field_82904_b[var6].rotateAngleX = var5.func_82210_r(var6 - 1) / (180F / (float)Math.PI); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWolf.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWolf.java new file mode 100644 index 0000000..02d598b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelWolf.java @@ -0,0 +1,164 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelWolf extends ModelBase { + /** main box for the wolf head */ + public ModelRenderer wolfHeadMain; + + /** The wolf's body */ + public ModelRenderer wolfBody; + + /** Wolf'se first leg */ + public ModelRenderer wolfLeg1; + + /** Wolf's second leg */ + public ModelRenderer wolfLeg2; + + /** Wolf's third leg */ + public ModelRenderer wolfLeg3; + + /** Wolf's fourth leg */ + public ModelRenderer wolfLeg4; + + /** The wolf's tail */ + ModelRenderer wolfTail; + + /** The wolf's mane */ + ModelRenderer wolfMane; + + + public ModelWolf() { + float var1 = 0.0F; + float var2 = 13.5F; + this.wolfHeadMain = new ModelRenderer(this, 0, 0); + this.wolfHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, var1); + this.wolfHeadMain.setRotationPoint(-1.0F, var2, -7.0F); + this.wolfBody = new ModelRenderer(this, 18, 14); + this.wolfBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, var1); + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfMane = new ModelRenderer(this, 21, 0); + this.wolfMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, var1); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F); + this.wolfLeg1 = new ModelRenderer(this, 0, 18); + this.wolfLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2 = new ModelRenderer(this, 0, 18); + this.wolfLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3 = new ModelRenderer(this, 0, 18); + this.wolfLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4 = new ModelRenderer(this, 0, 18); + this.wolfLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfTail = new ModelRenderer(this, 9, 18); + this.wolfTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, var1); + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, var1); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, var1); + this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, var1); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 5.0F * p_78088_7_, 2.0F * p_78088_7_); + this.wolfHeadMain.renderWithRotation(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.wolfBody.render(p_78088_7_); + this.wolfLeg1.render(p_78088_7_); + this.wolfLeg2.render(p_78088_7_); + this.wolfLeg3.render(p_78088_7_); + this.wolfLeg4.render(p_78088_7_); + this.wolfTail.renderWithRotation(p_78088_7_); + this.wolfMane.render(p_78088_7_); + GL11.glPopMatrix(); + } else { + this.wolfHeadMain.renderWithRotation(p_78088_7_); + this.wolfBody.render(p_78088_7_); + this.wolfLeg1.render(p_78088_7_); + this.wolfLeg2.render(p_78088_7_); + this.wolfLeg3.render(p_78088_7_); + this.wolfLeg4.render(p_78088_7_); + this.wolfTail.renderWithRotation(p_78088_7_); + this.wolfMane.render(p_78088_7_); + } + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + EntityWolf var5 = (EntityWolf)p_78086_1_; + + if (var5.isAngry()) { + this.wolfTail.rotateAngleY = 0.0F; + } else { + this.wolfTail.rotateAngleY = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + } + + if (var5.isSitting()) { + this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F); + this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F); + this.wolfMane.rotateAngleY = 0.0F; + this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F); + this.wolfBody.rotateAngleX = ((float)Math.PI / 4F); + this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F); + this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F); + this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F); + this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F); + this.wolfLeg3.rotateAngleX = 5.811947F; + this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F); + this.wolfLeg4.rotateAngleX = 5.811947F; + this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F); + } else { + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfBody.rotateAngleX = ((float)Math.PI / 2F); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F); + this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX; + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfLeg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + this.wolfLeg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + } + + this.wolfHeadMain.rotateAngleZ = var5.getInterestedAngle(p_78086_4_) + var5.getShakeAngle(p_78086_4_, 0.0F); + this.wolfMane.rotateAngleZ = var5.getShakeAngle(p_78086_4_, -0.08F); + this.wolfBody.rotateAngleZ = var5.getShakeAngle(p_78086_4_, -0.16F); + this.wolfTail.rotateAngleZ = var5.getShakeAngle(p_78086_4_, -0.2F); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.wolfHeadMain.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.wolfHeadMain.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.wolfTail.rotateAngleX = p_78087_3_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelZombie.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelZombie.java new file mode 100644 index 0000000..57b6bec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelZombie.java @@ -0,0 +1,43 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelZombie extends ModelBiped { + + + public ModelZombie() { + this(0.0F, false); + } + + protected ModelZombie(float p_i1167_1_, float p_i1167_2_, int p_i1167_3_, int p_i1167_4_) { + super(p_i1167_1_, p_i1167_2_, p_i1167_3_, p_i1167_4_); + } + + public ModelZombie(float p_i1168_1_, boolean p_i1168_2_) { + super(p_i1168_1_, 0.0F, 64, p_i1168_2_ ? 32 : 64); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + float var8 = MathHelper.sin(this.onGround * (float)Math.PI); + float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelZombieVillager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelZombieVillager.java new file mode 100644 index 0000000..4f7585b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/ModelZombieVillager.java @@ -0,0 +1,54 @@ +package net.minecraft.client.model; + +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelZombieVillager extends ModelBiped { + + + public ModelZombieVillager() { + this(0.0F, 0.0F, false); + } + + public ModelZombieVillager(float p_i1165_1_, float p_i1165_2_, boolean p_i1165_3_) { + super(p_i1165_1_, 0.0F, 64, p_i1165_3_ ? 32 : 64); + + if (p_i1165_3_) { + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, p_i1165_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F); + } else { + this.bipedHead = new ModelRenderer(this); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F); + this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1165_1_); + this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, p_i1165_1_); + } + } + + public int func_82897_a() { + return 10; + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + float var8 = MathHelper.sin(this.onGround * (float)Math.PI); + float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/PositionTextureVertex.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/PositionTextureVertex.java new file mode 100644 index 0000000..f5e2a95 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/PositionTextureVertex.java @@ -0,0 +1,30 @@ +package net.minecraft.client.model; + +import net.minecraft.util.Vec3; + +public class PositionTextureVertex { + public Vec3 vector3D; + public float texturePositionX; + public float texturePositionY; + + + public PositionTextureVertex(float p_i1158_1_, float p_i1158_2_, float p_i1158_3_, float p_i1158_4_, float p_i1158_5_) { + this(Vec3.createVectorHelper(p_i1158_1_, p_i1158_2_, p_i1158_3_), p_i1158_4_, p_i1158_5_); + } + + public PositionTextureVertex setTexturePosition(float p_78240_1_, float p_78240_2_) { + return new PositionTextureVertex(this, p_78240_1_, p_78240_2_); + } + + public PositionTextureVertex(PositionTextureVertex p_i46363_1_, float p_i46363_2_, float p_i46363_3_) { + this.vector3D = p_i46363_1_.vector3D; + this.texturePositionX = p_i46363_2_; + this.texturePositionY = p_i46363_3_; + } + + public PositionTextureVertex(Vec3 p_i1160_1_, float p_i1160_2_, float p_i1160_3_) { + this.vector3D = p_i1160_1_; + this.texturePositionX = p_i1160_2_; + this.texturePositionY = p_i1160_3_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/TextureOffset.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/TextureOffset.java new file mode 100644 index 0000000..e0f90b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/TextureOffset.java @@ -0,0 +1,15 @@ +package net.minecraft.client.model; + +public class TextureOffset { + /** The x coordinate offset of the texture */ + public final int textureOffsetX; + + /** The y coordinate offset of the texture */ + public final int textureOffsetY; + + + public TextureOffset(int p_i1175_1_, int p_i1175_2_) { + this.textureOffsetX = p_i1175_1_; + this.textureOffsetY = p_i1175_2_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/TexturedQuad.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/TexturedQuad.java new file mode 100644 index 0000000..ca59f1d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/model/TexturedQuad.java @@ -0,0 +1,56 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.Vec3; + +public class TexturedQuad { + public PositionTextureVertex[] vertexPositions; + public int nVertices; + private boolean invertNormal; + + + public TexturedQuad(PositionTextureVertex[] p_i46364_1_) { + this.vertexPositions = p_i46364_1_; + this.nVertices = p_i46364_1_.length; + } + + public TexturedQuad(PositionTextureVertex[] p_i1153_1_, int p_i1153_2_, int p_i1153_3_, int p_i1153_4_, int p_i1153_5_, float p_i1153_6_, float p_i1153_7_) { + this(p_i1153_1_); + float var8 = 0.0F / p_i1153_6_; + float var9 = 0.0F / p_i1153_7_; + p_i1153_1_[0] = p_i1153_1_[0].setTexturePosition((float)p_i1153_4_ / p_i1153_6_ - var8, (float)p_i1153_3_ / p_i1153_7_ + var9); + p_i1153_1_[1] = p_i1153_1_[1].setTexturePosition((float)p_i1153_2_ / p_i1153_6_ + var8, (float)p_i1153_3_ / p_i1153_7_ + var9); + p_i1153_1_[2] = p_i1153_1_[2].setTexturePosition((float)p_i1153_2_ / p_i1153_6_ + var8, (float)p_i1153_5_ / p_i1153_7_ - var9); + p_i1153_1_[3] = p_i1153_1_[3].setTexturePosition((float)p_i1153_4_ / p_i1153_6_ - var8, (float)p_i1153_5_ / p_i1153_7_ - var9); + } + + public void flipFace() { + PositionTextureVertex[] var1 = new PositionTextureVertex[this.vertexPositions.length]; + + for (int var2 = 0; var2 < this.vertexPositions.length; ++var2) { + var1[var2] = this.vertexPositions[this.vertexPositions.length - var2 - 1]; + } + + this.vertexPositions = var1; + } + + public void draw(Tessellator p_78236_1_, float p_78236_2_) { + Vec3 var3 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D); + Vec3 var4 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D); + Vec3 var5 = var4.crossProduct(var3).normalize(); + p_78236_1_.startDrawingQuads(); + + if (this.invertNormal) { + p_78236_1_.setNormal(-((float)var5.xCoord), -((float)var5.yCoord), -((float)var5.zCoord)); + } else { + p_78236_1_.setNormal((float)var5.xCoord, (float)var5.yCoord, (float)var5.zCoord); + } + + for (int var6 = 0; var6 < 4; ++var6) { + PositionTextureVertex var7 = this.vertexPositions[var6]; + p_78236_1_.addVertexWithUV((float)var7.vector3D.xCoord * p_78236_2_, (float)var7.vector3D.yCoord * p_78236_2_, (float)var7.vector3D.zCoord * p_78236_2_, var7.texturePositionX, var7.texturePositionY); + } + + p_78236_1_.draw(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java new file mode 100644 index 0000000..f45ad3c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ChunkProviderClient.java @@ -0,0 +1,157 @@ +package net.minecraft.client.multiplayer; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.LongHashMap; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ChunkProviderClient implements IChunkProvider { + private static final Logger logger = LogManager.getLogger(); + + /** + * The completely empty chunk used by ChunkProviderClient when chunkMapping doesn't contain the requested + * coordinates. + */ + private final Chunk blankChunk; + + /** + * The mapping between ChunkCoordinates and Chunks that ChunkProviderClient maintains. + */ + private final LongHashMap chunkMapping = new LongHashMap(); + + /** + * This may have been intended to be an iterable version of all currently loaded chunks (MultiplayerChunkCache), + * with identical contents to chunkMapping's values. However it is never actually added to. + */ + private final List chunkListing = new ArrayList(); + + /** Reference to the World object. */ + private final World worldObj; + + + public ChunkProviderClient(World p_i1184_1_) { + this.blankChunk = new EmptyChunk(p_i1184_1_, 0, 0); + this.worldObj = p_i1184_1_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) { + return true; + } + + /** + * Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set + * to false + */ + public void unloadChunk(int p_73234_1_, int p_73234_2_) { + Chunk var3 = this.provideChunk(p_73234_1_, p_73234_2_); + + if (!var3.isEmpty()) { + var3.onChunkUnload(); + } + + this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(p_73234_1_, p_73234_2_)); + this.chunkListing.remove(var3); + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) { + Chunk var3 = new Chunk(this.worldObj, p_73158_1_, p_73158_2_); + this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), var3); + this.chunkListing.add(var3); + var3.isChunkLoaded = true; + return var3; + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP com.cheatbreaker.client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + Chunk var3 = (Chunk)this.chunkMapping.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(p_73154_1_, p_73154_2_)); + return var3 == null ? this.blankChunk : var3; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + long var1 = System.currentTimeMillis(); + Iterator var3 = this.chunkListing.iterator(); + + while (var3.hasNext()) { + Chunk var4 = (Chunk)var3.next(); + var4.func_150804_b(System.currentTimeMillis() - var1 > 5L); + } + + if (System.currentTimeMillis() - var1 > 100L) { + logger.info("Warning: Clientside chunk ticking took {} ms", Long.valueOf(System.currentTimeMillis() - var1)); + } + + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return false; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) {} + + /** + * Converts the instance data to a readable string. + */ + public String makeString() { + return "MultiplayerChunkCache: " + this.chunkMapping.getNumHashElements() + ", " + this.chunkListing.size(); + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + return null; + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + return null; + } + + public int getLoadedChunkCount() { + return this.chunkListing.size(); + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java new file mode 100644 index 0000000..7b37488 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/GuiConnecting.java @@ -0,0 +1,156 @@ +package net.minecraft.client.multiplayer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.ConnectEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.client.network.OldServerPinger; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.concurrent.atomic.AtomicInteger; + +public class GuiConnecting extends GuiScreen { + private static final AtomicInteger field_146372_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private NetworkManager field_146371_g; + private boolean field_146373_h; + private final GuiScreen field_146374_i; + private static OldServerPinger serverPinger = new OldServerPinger(); + + + public GuiConnecting(GuiScreen p_i1181_1_, Minecraft p_i1181_2_, ServerData p_i1181_3_) { + this.mc = p_i1181_2_; + this.field_146374_i = p_i1181_1_; + ServerAddress var4 = ServerAddress.func_78860_a(p_i1181_3_.serverIP); + p_i1181_2_.loadWorld(null); + p_i1181_2_.setServerData(p_i1181_3_); + this.func_146367_a(var4.getIP(), var4.getPort()); + } + + public GuiConnecting(GuiScreen p_i1182_1_, Minecraft p_i1182_2_, String p_i1182_3_, int p_i1182_4_) { + this.mc = p_i1182_2_; + this.field_146374_i = p_i1182_1_; + p_i1182_2_.loadWorld(null); + this.func_146367_a(p_i1182_3_, p_i1182_4_); + } + + private void func_146367_a(final String p_146367_1_, final int p_146367_2_) { + logger.info("Connecting to " + p_146367_1_ + ", " + p_146367_2_); + (new Thread("Server Connector #" + field_146372_a.incrementAndGet()) { + + public void run() { + InetAddress var1 = null; + + try { + if (GuiConnecting.this.field_146373_h) { + return; + } + + var1 = InetAddress.getByName(p_146367_1_); + Minecraft.getMinecraft().currentServerData.domain = var1.getHostAddress(); + Minecraft.getMinecraft().currentServerData.port = p_146367_2_; + GuiConnecting.serverPinger.func_147224_a(Minecraft.getMinecraft().currentServerData); + while (!Minecraft.getMinecraft().currentServerData.pinged) { + try { + Thread.sleep(100L); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + CheatBreaker.getInstance().getEventBus().handleEvent(new ConnectEvent()); + GuiConnecting.this.field_146371_g = NetworkManager.provideLanClient(var1, p_146367_2_); + GuiConnecting.this.field_146371_g.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.mc, GuiConnecting.this.field_146374_i)); + GuiConnecting.this.field_146371_g.scheduleOutboundPacket(new C00Handshake(Minecraft.getMinecraft().currentServerData.version == -1332 ? -1332 : 5, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN)); + GuiConnecting.this.field_146371_g.scheduleOutboundPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().func_148256_e())); + } catch (UnknownHostException var5) { + if (GuiConnecting.this.field_146373_h) { + return; + } + + GuiConnecting.logger.error("Couldn't connect to server", var5); + GuiConnecting.this.mc.displayGuiScreen(new GuiDisconnected(GuiConnecting.this.field_146374_i, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", "Unknown host"))); + } catch (Exception var6) { + if (GuiConnecting.this.field_146373_h) { + return; + } + + GuiConnecting.logger.error("Couldn't connect to server", var6); + String var3 = var6.toString(); + + if (var1 != null) { + String var4 = var1 + ":" + p_146367_2_; + var3 = var3.replaceAll(var4, ""); + } + + GuiConnecting.this.mc.displayGuiScreen(new GuiDisconnected(GuiConnecting.this.field_146374_i, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", var3))); + } + } + }).start(); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + if (this.field_146371_g != null) { + if (this.field_146371_g.isChannelOpen()) { + this.field_146371_g.processReceivedPackets(); + } else if (this.field_146371_g.getExitMessage() != null) { + this.field_146371_g.getNetHandler().onDisconnect(this.field_146371_g.getExitMessage()); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char p_73869_1_, int p_73869_2_) {} + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 2 + 50, I18n.format("gui.cancel"))); + } + + protected void actionPerformed(GuiButton p_146284_1_) { + if (p_146284_1_.id == 0) { + this.field_146373_h = true; + + if (this.field_146371_g != null) { + this.field_146371_g.closeChannel(new ChatComponentText("Aborted")); + } + + this.mc.displayGuiScreen(this.field_146374_i); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + this.drawDefaultBackground(); + + if (this.field_146371_g == null) { + this.drawCenteredString(this.fontRendererObj, I18n.format("connect.connecting"), this.width / 2, this.height / 2 - 50, 16777215); + } else { + this.drawCenteredString(this.fontRendererObj, I18n.format("connect.authorizing"), this.width / 2, this.height / 2 - 50, 16777215); + } + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java new file mode 100644 index 0000000..9530b48 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java @@ -0,0 +1,448 @@ +package net.minecraft.client.multiplayer; + +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat.ModuleReachDisplay; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.play.client.*; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; + +public class PlayerControllerMP { + /** The Minecraft instance. */ + private final Minecraft mc; + private final NetHandlerPlayClient netClientHandler; + + /** PosX of the current block being destroyed */ + private int currentBlockX = -1; + + /** PosY of the current block being destroyed */ + private int currentBlockY = -1; + + /** PosZ of the current block being destroyed */ + private int currentblockZ = -1; + + /** The Item currently being used to destroy a block */ + private ItemStack currentItemHittingBlock; + + /** Current block damage (MP) */ + private float curBlockDamageMP; + + /** + * Tick counter, when it hits 4 it resets back to 0 and plays the step sound + */ + private float stepSoundTickCounter; + + /** + * Delays the first damage on the block after the first click on the block + */ + private int blockHitDelay; + + /** Tells if the player is hitting a block */ + private boolean isHittingBlock; + + /** Current game type for the player */ + private WorldSettings.GameType currentGameType; + + /** Index of the current item held by the player in the inventory hotbar */ + private int currentPlayerItem; + + + public PlayerControllerMP(Minecraft p_i45062_1_, NetHandlerPlayClient p_i45062_2_) { + this.currentGameType = WorldSettings.GameType.SURVIVAL; + this.mc = p_i45062_1_; + this.netClientHandler = p_i45062_2_; + } + + /** + * Block dig operation in creative mode (instantly digs the block). + */ + public static void clickBlockCreative(Minecraft p_78744_0_, PlayerControllerMP p_78744_1_, int p_78744_2_, int p_78744_3_, int p_78744_4_, int p_78744_5_) { + if (!p_78744_0_.theWorld.extinguishFire(p_78744_0_.thePlayer, p_78744_2_, p_78744_3_, p_78744_4_, p_78744_5_)) { + p_78744_1_.onPlayerDestroyBlock(p_78744_2_, p_78744_3_, p_78744_4_, p_78744_5_); + } + } + + /** + * Sets player capabilities depending on current gametype. params: player + */ + public void setPlayerCapabilities(EntityPlayer p_78748_1_) { + this.currentGameType.configurePlayerCapabilities(p_78748_1_.capabilities); + } + + /** + * If modified to return true, the player spins around slowly around (0, 68.5, 0). The GUI is disabled, the view is + * set to first person, and both chat and menu are disabled. Unless the server is modified to ignore illegal + * stances, attempting to enter a world at all will result in an immediate kick due to an illegal stance. Appears to + * be left-over debug, or demo code. + */ + public boolean enableEverythingIsScrewedUpMode() { + return false; + } + + /** + * Sets the game type for the player. + */ + public void setGameType(WorldSettings.GameType p_78746_1_) { + this.currentGameType = p_78746_1_; + this.currentGameType.configurePlayerCapabilities(this.mc.thePlayer.capabilities); + } + + /** + * Flips the player around. Args: player + */ + public void flipPlayer(EntityPlayer p_78745_1_) { + p_78745_1_.rotationYaw = -180.0F; + } + + public boolean shouldDrawHUD() { + return this.currentGameType.isSurvivalOrAdventure(); + } + + /** + * Called when a player completes the destruction of a block + */ + public boolean onPlayerDestroyBlock(int p_78751_1_, int p_78751_2_, int p_78751_3_, int p_78751_4_) { + if (this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(p_78751_1_, p_78751_2_, p_78751_3_)) { + return false; + } else if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) { + return false; + } else { + WorldClient var5 = this.mc.theWorld; + Block var6 = var5.getBlock(p_78751_1_, p_78751_2_, p_78751_3_); + + if (var6.getMaterial() == Material.air) { + return false; + } else { + var5.playAuxSFX(2001, p_78751_1_, p_78751_2_, p_78751_3_, Block.getIdFromBlock(var6) + (var5.getBlockMetadata(p_78751_1_, p_78751_2_, p_78751_3_) << 12)); + int var7 = var5.getBlockMetadata(p_78751_1_, p_78751_2_, p_78751_3_); + boolean var8 = var5.setBlockToAir(p_78751_1_, p_78751_2_, p_78751_3_); + + if (var8) { + var6.onBlockDestroyedByPlayer(var5, p_78751_1_, p_78751_2_, p_78751_3_, var7); + } + + this.currentBlockY = -1; + + if (!this.currentGameType.isCreative()) { + ItemStack var9 = this.mc.thePlayer.getCurrentEquippedItem(); + + if (var9 != null) { + var9.func_150999_a(var5, var6, p_78751_1_, p_78751_2_, p_78751_3_, this.mc.thePlayer); + + if (var9.stackSize == 0) { + this.mc.thePlayer.destroyCurrentEquippedItem(); + } + } + } + + return var8; + } + } + } + + /** + * Called by Minecraft class when the player is hitting a block with an item. Args: x, y, z, side + */ + public void clickBlock(int p_78743_1_, int p_78743_2_, int p_78743_3_, int p_78743_4_) { + if (!this.currentGameType.isAdventure() || this.mc.thePlayer.isCurrentToolAdventureModeExempt(p_78743_1_, p_78743_2_, p_78743_3_)) { + if (this.currentGameType.isCreative()) { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(0, p_78743_1_, p_78743_2_, p_78743_3_, p_78743_4_)); + clickBlockCreative(this.mc, this, p_78743_1_, p_78743_2_, p_78743_3_, p_78743_4_); + this.blockHitDelay = 5; + } else if (!this.isHittingBlock || !this.sameToolAndBlock(p_78743_1_, p_78743_2_, p_78743_3_)) { + if (this.isHittingBlock) { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, p_78743_4_)); + } + + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(0, p_78743_1_, p_78743_2_, p_78743_3_, p_78743_4_)); + Block var5 = this.mc.theWorld.getBlock(p_78743_1_, p_78743_2_, p_78743_3_); + boolean var6 = var5.getMaterial() != Material.air; + + if (var6 && this.curBlockDamageMP == 0.0F) { + var5.onBlockClicked(this.mc.theWorld, p_78743_1_, p_78743_2_, p_78743_3_, this.mc.thePlayer); + } + + if (var6 && var5.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, p_78743_1_, p_78743_2_, p_78743_3_) >= 1.0F) { + this.onPlayerDestroyBlock(p_78743_1_, p_78743_2_, p_78743_3_, p_78743_4_); + } else { + this.isHittingBlock = true; + this.currentBlockX = p_78743_1_; + this.currentBlockY = p_78743_2_; + this.currentblockZ = p_78743_3_; + this.currentItemHittingBlock = this.mc.thePlayer.getHeldItem(); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.getEntityId(), this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); + } + } + } + } + + /** + * Resets current block damage and isHittingBlock + */ + public void resetBlockRemoving() { + if (this.isHittingBlock) { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1)); + } + + this.isHittingBlock = false; + this.curBlockDamageMP = 0.0F; + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.getEntityId(), this.currentBlockX, this.currentBlockY, this.currentblockZ, -1); + } + + /** + * Called when a player damages a block and updates damage counters + */ + public void onPlayerDamageBlock(int p_78759_1_, int p_78759_2_, int p_78759_3_, int p_78759_4_) { + this.syncCurrentPlayItem(); + + if (this.blockHitDelay > 0) { + --this.blockHitDelay; + } else if (this.currentGameType.isCreative()) { + this.blockHitDelay = 5; + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(0, p_78759_1_, p_78759_2_, p_78759_3_, p_78759_4_)); + clickBlockCreative(this.mc, this, p_78759_1_, p_78759_2_, p_78759_3_, p_78759_4_); + } else { + if (this.sameToolAndBlock(p_78759_1_, p_78759_2_, p_78759_3_)) { + Block var5 = this.mc.theWorld.getBlock(p_78759_1_, p_78759_2_, p_78759_3_); + + if (var5.getMaterial() == Material.air) { + this.isHittingBlock = false; + return; + } + + this.curBlockDamageMP += var5.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, p_78759_1_, p_78759_2_, p_78759_3_); + + if (this.stepSoundTickCounter % 4.0F == 0.0F) { + this.mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation(var5.stepSound.func_150498_e()), (var5.stepSound.func_150497_c() + 1.0F) / 8.0F, var5.stepSound.func_150494_d() * 0.5F, (float)p_78759_1_ + 0.5F, (float)p_78759_2_ + 0.5F, (float)p_78759_3_ + 0.5F)); + } + + ++this.stepSoundTickCounter; + + if (this.curBlockDamageMP >= 1.0F) { + this.isHittingBlock = false; + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(2, p_78759_1_, p_78759_2_, p_78759_3_, p_78759_4_)); + this.onPlayerDestroyBlock(p_78759_1_, p_78759_2_, p_78759_3_, p_78759_4_); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.blockHitDelay = 5; + } + + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.getEntityId(), this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); + } else { + this.clickBlock(p_78759_1_, p_78759_2_, p_78759_3_, p_78759_4_); + } + } + } + + /** + * player reach distance = 4F + */ + public float getBlockReachDistance() { + return this.currentGameType.isCreative() ? 5.0F : 4.5F; + } + + public void updateController() { + this.syncCurrentPlayItem(); + + if (this.netClientHandler.getNetworkManager().isChannelOpen()) { + this.netClientHandler.getNetworkManager().processReceivedPackets(); + } else if (this.netClientHandler.getNetworkManager().getExitMessage() != null) { + this.netClientHandler.getNetworkManager().getNetHandler().onDisconnect(this.netClientHandler.getNetworkManager().getExitMessage()); + } else { + this.netClientHandler.getNetworkManager().getNetHandler().onDisconnect(new ChatComponentText("Disconnected from server")); + } + } + + private boolean sameToolAndBlock(int p_85182_1_, int p_85182_2_, int p_85182_3_) { + ItemStack var4 = this.mc.thePlayer.getHeldItem(); + boolean var5 = this.currentItemHittingBlock == null && var4 == null; + + if (this.currentItemHittingBlock != null && var4 != null) { + var5 = var4.getItem() == this.currentItemHittingBlock.getItem() && ItemStack.areItemStackTagsEqual(var4, this.currentItemHittingBlock) && (var4.isItemStackDamageable() || var4.getItemDamage() == this.currentItemHittingBlock.getItemDamage()); + } + + return p_85182_1_ == this.currentBlockX && p_85182_2_ == this.currentBlockY && p_85182_3_ == this.currentblockZ && var5; + } + + /** + * Syncs the current player item with the server + */ + private void syncCurrentPlayItem() { + int var1 = this.mc.thePlayer.inventory.currentItem; + + if (var1 != this.currentPlayerItem) { + this.currentPlayerItem = var1; + this.netClientHandler.addToSendQueue(new C09PacketHeldItemChange(this.currentPlayerItem)); + } + } + + /** + * Handles a players right click. Args: player, world, x, y, z, side, hitVec + */ + public boolean onPlayerRightClick(EntityPlayer p_78760_1_, World p_78760_2_, ItemStack p_78760_3_, int p_78760_4_, int p_78760_5_, int p_78760_6_, int p_78760_7_, Vec3 p_78760_8_) { + this.syncCurrentPlayItem(); + float var9 = (float)p_78760_8_.xCoord - (float)p_78760_4_; + float var10 = (float)p_78760_8_.yCoord - (float)p_78760_5_; + float var11 = (float)p_78760_8_.zCoord - (float)p_78760_6_; + boolean var12 = (!p_78760_1_.isSneaking() || p_78760_1_.getHeldItem() == null) && p_78760_2_.getBlock(p_78760_4_, p_78760_5_, p_78760_6_).onBlockActivated(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, var9, var10, var11); + + if (!var12 && p_78760_3_ != null && p_78760_3_.getItem() instanceof ItemBlock) { + ItemBlock var13 = (ItemBlock)p_78760_3_.getItem(); + + if (!var13.func_150936_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, p_78760_1_, p_78760_3_)) { + return false; + } + } + + this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, p_78760_1_.inventory.getCurrentItem(), var9, var10, var11)); + + if (var12) { + return true; + } else if (p_78760_3_ == null) { + return false; + } else if (this.currentGameType.isCreative()) { + int var16 = p_78760_3_.getItemDamage(); + int var14 = p_78760_3_.stackSize; + boolean var15 = p_78760_3_.tryPlaceItemIntoWorld(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, var9, var10, var11); + p_78760_3_.setItemDamage(var16); + p_78760_3_.stackSize = var14; + return var15; + } else { + return p_78760_3_.tryPlaceItemIntoWorld(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, var9, var10, var11); + } + } + + /** + * Notifies the server of things like consuming food, etc... + */ + public boolean sendUseItem(EntityPlayer p_78769_1_, World p_78769_2_, ItemStack p_78769_3_) { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(-1, -1, -1, 255, p_78769_1_.inventory.getCurrentItem(), 0.0F, 0.0F, 0.0F)); + int var4 = p_78769_3_.stackSize; + ItemStack var5 = p_78769_3_.useItemRightClick(p_78769_2_, p_78769_1_); + + if (var5 == p_78769_3_ && (var5 == null || var5.stackSize == var4)) { + return false; + } else { + p_78769_1_.inventory.mainInventory[p_78769_1_.inventory.currentItem] = var5; + + if (var5.stackSize == 0) { + p_78769_1_.inventory.mainInventory[p_78769_1_.inventory.currentItem] = null; + } + + return true; + } + } + + public EntityClientPlayerMP func_147493_a(World p_147493_1_, StatFileWriter p_147493_2_) { + return new EntityClientPlayerMP(this.mc, p_147493_1_, this.mc.getSession(), this.netClientHandler, p_147493_2_); + } + + /** + * Attacks an entity + */ + public void attackEntity(EntityPlayer p_78764_1_, Entity p_78764_2_) { + if (p_78764_1_ == this.mc.thePlayer) { + Vec3 distance = this.mc.renderViewEntity.getPosition(1.0F); + ModuleReachDisplay.lastRange = this.mc.objectMouseOver.hitVec.distanceTo(distance); + ModuleReachDisplay.lastAttackTime = System.currentTimeMillis(); + } + + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78764_2_, C02PacketUseEntity.Action.ATTACK)); + p_78764_1_.attackTargetEntityWithCurrentItem(p_78764_2_); + } + + /** + * Send packet to server - player is interacting with another entity (left click) + */ + public boolean interactWithEntitySendPacket(EntityPlayer p_78768_1_, Entity p_78768_2_) { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C02PacketUseEntity(p_78768_2_, C02PacketUseEntity.Action.INTERACT)); + return p_78768_1_.interactWith(p_78768_2_); + } + + public ItemStack windowClick(int p_78753_1_, int p_78753_2_, int p_78753_3_, int p_78753_4_, EntityPlayer p_78753_5_) { + short var6 = p_78753_5_.openContainer.getNextTransactionID(p_78753_5_.inventory); + ItemStack var7 = p_78753_5_.openContainer.slotClick(p_78753_2_, p_78753_3_, p_78753_4_, p_78753_5_); + this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(p_78753_1_, p_78753_2_, p_78753_3_, p_78753_4_, var7, var6)); + return var7; + } + + /** + * GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the + * enchantment action the player has taken. + */ + public void sendEnchantPacket(int p_78756_1_, int p_78756_2_) { + this.netClientHandler.addToSendQueue(new C11PacketEnchantItem(p_78756_1_, p_78756_2_)); + } + + /** + * Used in PlayerControllerMP to update the server with an ItemStack in a slot. + */ + public void sendSlotPacket(ItemStack p_78761_1_, int p_78761_2_) { + if (this.currentGameType.isCreative()) { + this.netClientHandler.addToSendQueue(new C10PacketCreativeInventoryAction(p_78761_2_, p_78761_1_)); + } + } + + /** + * Sends a Packet107 to the server to drop the item on the ground + */ + public void sendPacketDropItem(ItemStack p_78752_1_) { + if (this.currentGameType.isCreative() && p_78752_1_ != null) { + this.netClientHandler.addToSendQueue(new C10PacketCreativeInventoryAction(-1, p_78752_1_)); + } + } + + public void onStoppedUsingItem(EntityPlayer p_78766_1_) { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(5, 0, 0, 0, 255)); + p_78766_1_.stopUsingItem(); + } + + public boolean gameIsSurvivalOrAdventure() { + return this.currentGameType.isSurvivalOrAdventure(); + } + + /** + * Checks if the player is not creative, used for checking if it should break a block instantly + */ + public boolean isNotCreative() { + return !this.currentGameType.isCreative(); + } + + /** + * returns true if player is in creative mode + */ + public boolean isInCreativeMode() { + return this.currentGameType.isCreative(); + } + + /** + * true for hitting entities far away. + */ + public boolean extendedReach() { + return this.currentGameType.isCreative(); + } + + public boolean func_110738_j() { + return this.mc.thePlayer.isRiding() && this.mc.thePlayer.ridingEntity instanceof EntityHorse; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java new file mode 100644 index 0000000..75f4dfe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerAddress.java @@ -0,0 +1,91 @@ +package net.minecraft.client.multiplayer; + +import java.util.Hashtable; +import javax.naming.directory.Attributes; +import javax.naming.directory.InitialDirContext; + +public class ServerAddress { + private final String ipAddress; + private final int serverPort; + + + protected ServerAddress(String p_i1192_1_, int p_i1192_2_) { + this.ipAddress = p_i1192_1_; + this.serverPort = p_i1192_2_; + } + + public String getIP() { + return this.ipAddress; + } + + public int getPort() { + return this.serverPort; + } + + public static ServerAddress func_78860_a(String p_78860_0_) { + if (p_78860_0_ == null) { + return null; + } else { + String[] var1 = p_78860_0_.split(":"); + + if (p_78860_0_.startsWith("[")) { + int var2 = p_78860_0_.indexOf("]"); + + if (var2 > 0) { + String var3 = p_78860_0_.substring(1, var2); + String var4 = p_78860_0_.substring(var2 + 1).trim(); + + if (var4.startsWith(":") && var4.length() > 0) { + var4 = var4.substring(1); + var1 = new String[] {var3, var4}; + } else { + var1 = new String[] {var3}; + } + } + } + + if (var1.length > 2) { + var1 = new String[] {p_78860_0_}; + } + + String var5 = var1[0]; + int var6 = var1.length > 1 ? parseIntWithDefault(var1[1], 25565) : 25565; + + if (var6 == 25565) { + String[] var7 = getServerAddress(var5); + var5 = var7[0]; + var6 = parseIntWithDefault(var7[1], 25565); + } + + return new ServerAddress(var5, var6); + } + } + + /** + * Returns a server's address and port for the specified hostname, looking up the SRV record if possible + */ + private static String[] getServerAddress(String p_78863_0_) { + try { + String var1 = "com.sun.jndi.dns.DnsContextFactory"; + Class.forName("com.sun.jndi.dns.DnsContextFactory"); + Hashtable var2 = new Hashtable(); + var2.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory"); + var2.put("java.naming.provider.url", "dns:"); + var2.put("com.sun.jndi.dns.timeout.retries", "1"); + InitialDirContext var3 = new InitialDirContext(var2); + Attributes var4 = var3.getAttributes("_minecraft._tcp." + p_78863_0_, new String[] {"SRV"}); + String[] var5 = var4.get("srv").get().toString().split(" ", 4); + return new String[] {var5[3], var5[2]}; + } catch (Throwable var6) { + return new String[] {p_78863_0_, Integer.toString(25565)}; + } + } + + private static int parseIntWithDefault(String p_78862_0_, int p_78862_1_) { + try { + return Integer.parseInt(p_78862_0_.trim()); + } catch (Exception var3) { + return p_78862_1_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerData.java new file mode 100644 index 0000000..1e849f4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerData.java @@ -0,0 +1,150 @@ +package net.minecraft.client.multiplayer; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class ServerData { + public String serverName; + public String serverIP; + + /** + * the string indicating number of players on and capacity of the server that is shown on the server browser (i.e. + * "5/20" meaning 5 slots used out of 20 slots total) + */ + public String populationInfo; + /** + * CheatBreaker Fields + */ + public String domain; + public int port; + + /** + * (better variable name would be 'hostname') server name as displayed in the server browser's second line (grey + * text) + */ + public String serverMOTD; + + /** last server ping that showed up in the server browser */ + public long pingToServer; + public int version = 5; + + /** Game version for this server. */ + public String gameVersion = "1.7.10";; + public boolean field_78841_f; + public String playerList; + private ServerData.ServerResourceMode resourceMode = ServerData.ServerResourceMode.PROMPT; + private String field_147411_m; + private boolean field_152588_l; + public boolean dontSave = false; + public boolean pinged = false; + public boolean lunarServer = false; + + public ServerData(boolean dontSave, String serverName, String serverIP) { + this(serverName, serverIP); + this.dontSave = dontSave; + } + + public ServerData(String p_i1193_1_, String p_i1193_2_) { + this.serverName = p_i1193_1_; + this.serverIP = p_i1193_2_; + } + + public boolean isCheatBreakerServer() { + return version == -1332; + } + + public ServerData(String p_i46395_1_, String p_i46395_2_, boolean p_i46395_3_) { + this(p_i46395_1_, p_i46395_2_); + this.field_152588_l = p_i46395_3_; + } + + /** + * Returns an NBTTagCompound with the server's name, IP and maybe acceptTextures. + */ + public NBTTagCompound getNBTCompound() { + NBTTagCompound var1 = new NBTTagCompound(); + var1.setString("name", this.serverName); + var1.setString("ip", this.serverIP); + + if (this.field_147411_m != null) { + var1.setString("icon", this.field_147411_m); + } + + if (this.resourceMode == ServerData.ServerResourceMode.ENABLED) { + var1.setBoolean("acceptTextures", true); + } else if (this.resourceMode == ServerData.ServerResourceMode.DISABLED) { + var1.setBoolean("acceptTextures", false); + } + + return var1; + } + + public ServerData.ServerResourceMode func_152586_b() { + return this.resourceMode; + } + + public void func_152584_a(ServerData.ServerResourceMode p_152584_1_) { + this.resourceMode = p_152584_1_; + } + + /** + * Takes an NBTTagCompound with 'name' and 'ip' keys, returns a ServerData instance. + */ + public static ServerData getServerDataFromNBTCompound(NBTTagCompound p_78837_0_) { + ServerData var1 = new ServerData(p_78837_0_.getString("name"), p_78837_0_.getString("ip")); + + if (p_78837_0_.func_150297_b("icon", 8)) { + var1.setBase64EncodedIconData(p_78837_0_.getString("icon")); + } + + if (p_78837_0_.func_150297_b("acceptTextures", 1)) { + if (p_78837_0_.getBoolean("acceptTextures")) { + var1.func_152584_a(ServerData.ServerResourceMode.ENABLED); + } else { + var1.func_152584_a(ServerData.ServerResourceMode.DISABLED); + } + } else { + var1.func_152584_a(ServerData.ServerResourceMode.PROMPT); + } + + return var1; + } + + public String getBase64EncodedIconData() { + return this.field_147411_m; + } + + public void setBase64EncodedIconData(String p_147407_1_) { + this.field_147411_m = p_147407_1_; + } + + public void func_152583_a(ServerData p_152583_1_) { + this.serverIP = p_152583_1_.serverIP; + this.serverName = p_152583_1_.serverName; + this.func_152584_a(p_152583_1_.func_152586_b()); + this.field_147411_m = p_152583_1_.field_147411_m; + } + + public boolean func_152585_d() { + return this.field_152588_l; + } + + public enum ServerResourceMode { + ENABLED("ENABLED", 0, "enabled"), + DISABLED("DISABLED", 1, "disabled"), + PROMPT("PROMPT", 2, "prompt"); + private final IChatComponent field_152594_d; + + private static final ServerData.ServerResourceMode[] $VALUES = new ServerData.ServerResourceMode[]{ENABLED, DISABLED, PROMPT}; + + + ServerResourceMode(String p_i1053_1_, int p_i1053_2_, String p_i1053_3_) { + this.field_152594_d = new ChatComponentTranslation("addServer.resourcePack." + p_i1053_3_); + } + + public IChatComponent func_152589_a() { + return this.field_152594_d; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerList.java new file mode 100644 index 0000000..8e394db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ServerList.java @@ -0,0 +1,139 @@ +package net.minecraft.client.multiplayer; + +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ServerList { + private static final Logger logger = LogManager.getLogger(); + + /** The Minecraft instance. */ + private final Minecraft mc; + + /** List of ServerData instances. */ + private final List servers = new ArrayList(); + + + public ServerList(Minecraft p_i1194_1_) { + this.mc = p_i1194_1_; + this.loadServerList(); + } + + /** + * Loads a list of servers from servers.dat, by running ServerData.getServerDataFromNBTCompound on each NBT compound + * found in the "servers" tag list. + */ + public void loadServerList() { + try { + this.servers.clear(); + NBTTagCompound var1 = CompressedStreamTools.read(new File(this.mc.mcDataDir, "servers.dat")); + + if (var1 == null) { + return; + } + + NBTTagList var2 = var1.getTagList("servers", 10); + for (String[] server : CheatBreaker.getInstance().getGlobalSettings().getPinnedServers()) { + this.servers.add(new ServerData(true, server[0], server[1])); + } + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + this.servers.add(ServerData.getServerDataFromNBTCompound(var2.getCompoundTagAt(var3))); + } + } catch (Exception var4) { + logger.error("Couldn't load server list", var4); + } + } + + /** + * Runs getNBTCompound on each ServerData instance, puts everything into a "servers" NBT list and writes it to + * servers.dat. + */ + public void saveServerList() { + try { + NBTTagList var1 = new NBTTagList(); + + for (ServerData server : this.servers) { + if (server.dontSave) continue; + var1.appendTag(server.getNBTCompound()); + } + + NBTTagCompound var5 = new NBTTagCompound(); + var5.setTag("servers", var1); + CompressedStreamTools.safeWrite(var5, new File(this.mc.mcDataDir, "servers.dat")); + } catch (Exception var4) { + logger.error("Couldn't save server list", var4); + } + } + + /** + * Gets the ServerData instance stored for the given index in the list. + */ + public ServerData getServerData(int p_78850_1_) { + return (ServerData)this.servers.get(p_78850_1_); + } + + /** + * Removes the ServerData instance stored for the given index in the list. + */ + public void removeServerData(int p_78851_1_) { + this.servers.remove(p_78851_1_); + } + + /** + * Adds the given ServerData instance to the list. + */ + public void addServerData(ServerData p_78849_1_) { + this.servers.add(p_78849_1_); + } + + /** + * Counts the number of ServerData instances in the list. + */ + public int countServers() { + return this.servers.size(); + } + + /** + * Takes two list indexes, and swaps their order around. + */ + public void swapServers(int p_78857_1_, int p_78857_2_) { + ServerData var4 = this.getServerData(p_78857_2_); + ServerData var3 = this.getServerData(p_78857_1_); + if (!var3.dontSave && !var4.dontSave) { + this.servers.set(p_78857_1_, var4); + this.servers.set(p_78857_2_, var3); + this.saveServerList(); + } + + } + + public void func_147413_a(int p_147413_1_, ServerData p_147413_2_) { + this.servers.set(p_147413_1_ -= CheatBreaker.getInstance().getGlobalSettings().getPinnedServers().size(), p_147413_2_); + } + + public static void func_147414_b(ServerData p_147414_0_) { + ServerList var1 = new ServerList(Minecraft.getMinecraft()); + var1.loadServerList(); + + for (int var2 = 0; var2 < var1.countServers(); ++var2) { + ServerData var3 = var1.getServerData(var2); + + if (var3.serverName.equals(p_147414_0_.serverName) && var3.serverIP.equals(p_147414_0_.serverIP)) { + var1.func_147413_a(var2, p_147414_0_); + break; + } + } + + var1.saveServerList(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java new file mode 100644 index 0000000..bda15d3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java @@ -0,0 +1,93 @@ +package net.minecraft.client.multiplayer; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ThreadLanServerPing extends Thread { + private static final AtomicInteger field_148658_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private final String motd; + + /** The socket we're using to send packets on. */ + private final DatagramSocket socket; + private boolean isStopping = true; + private final String address; + + + public ThreadLanServerPing(String p_i1321_1_, String p_i1321_2_) throws IOException { + super("LanServerPinger #" + field_148658_a.incrementAndGet()); + this.motd = p_i1321_1_; + this.address = p_i1321_2_; + this.setDaemon(true); + this.socket = new DatagramSocket(); + } + + public void run() { + String var1 = getPingResponse(this.motd, this.address); + byte[] var2 = var1.getBytes(); + + while (!this.isInterrupted() && this.isStopping) { + try { + InetAddress var3 = InetAddress.getByName("224.0.2.60"); + DatagramPacket var4 = new DatagramPacket(var2, var2.length, var3, 4445); + this.socket.send(var4); + } catch (IOException var6) { + logger.warn("LanServerPinger: " + var6.getMessage()); + break; + } + + try { + sleep(1500L); + } catch (InterruptedException var5) { + } + } + } + + public void interrupt() { + super.interrupt(); + this.isStopping = false; + } + + public static String getPingResponse(String p_77525_0_, String p_77525_1_) { + return "[MOTD]" + p_77525_0_ + "[/MOTD][AD]" + p_77525_1_ + "[/AD]"; + } + + public static String getMotdFromPingResponse(String p_77524_0_) { + int var1 = p_77524_0_.indexOf("[MOTD]"); + + if (var1 < 0) { + return "missing no"; + } else { + int var2 = p_77524_0_.indexOf("[/MOTD]", var1 + "[MOTD]".length()); + return var2 < var1 ? "missing no" : p_77524_0_.substring(var1 + "[MOTD]".length(), var2); + } + } + + public static String getAdFromPingResponse(String p_77523_0_) { + int var1 = p_77523_0_.indexOf("[/MOTD]"); + + if (var1 < 0) { + return null; + } else { + int var2 = p_77523_0_.indexOf("[/MOTD]", var1 + "[/MOTD]".length()); + + if (var2 >= 0) { + return null; + } else { + int var3 = p_77523_0_.indexOf("[AD]", var1 + "[/MOTD]".length()); + + if (var3 < 0) { + return null; + } else { + int var4 = p_77523_0_.indexOf("[/AD]", var3 + "[AD]".length()); + return var4 < var3 ? null : p_77523_0_.substring(var3 + "[AD]".length(), var4); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/WorldClient.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/WorldClient.java new file mode 100644 index 0000000..90d744e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/multiplayer/WorldClient.java @@ -0,0 +1,424 @@ +package net.minecraft.client.multiplayer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.DisconnectEvent; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.MovingSoundMinecart; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.particle.EntityFireworkStarterFX; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.src.Config; +import net.minecraft.src.DynamicLights; +import net.minecraft.src.Reflector; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.*; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.storage.SaveHandlerMP; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Random; +import java.util.Set; + +public class WorldClient extends World { + /** The packets that need to be sent to the server. */ + private NetHandlerPlayClient sendQueue; + + /** The ChunkProviderClient instance */ + private ChunkProviderClient clientChunkProvider; + + /** + * The hash set of entities handled by this client. Uses the entity's ID as the hash set's key. + */ + private IntHashMap entityHashSet = new IntHashMap(); + + /** Contains all entities for this client, both spawned and non-spawned. */ + private Set entityList = new HashSet(); + + /** + * Contains all entities for this client that were not spawned due to a non-present chunk. The game will attempt to + * spawn up to 10 pending entities with each subsequent tick until the spawn queue is empty. + */ + private Set entitySpawnQueue = new HashSet(); + private final Minecraft mc = Minecraft.getMinecraft(); + private final Set previousActiveChunkSet = new HashSet(); + public boolean renderItemInFirstPerson = false; + + public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_) { + super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_2_, p_i45063_5_); + this.sendQueue = p_i45063_1_; + this.difficultySetting = p_i45063_4_; + this.mapStorage = p_i45063_1_.mapStorageOrigin; + + if (Reflector.ForgeWorld_finishSetup.exists()) { + this.isClient = true; + Reflector.call(this, Reflector.ForgeWorld_finishSetup, new Object[0]); + } + + this.setSpawnLocation(8, 64, 8); + Reflector.postForgeBusEvent(Reflector.WorldEvent_Load_Constructor, new Object[] {this}); + } + + /** + * Runs a single tick for the world + */ + public void tick() { + super.tick(); + this.func_82738_a(this.getTotalWorldTime() + 1L); + + if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { + this.setWorldTime(this.getWorldTime() + 1L); + } + + this.theProfiler.startSection("reEntryProcessing"); + + for (int var1 = 0; var1 < 10 && !this.entitySpawnQueue.isEmpty(); ++var1) { + Entity var2 = (Entity)this.entitySpawnQueue.iterator().next(); + this.entitySpawnQueue.remove(var2); + + if (!this.loadedEntityList.contains(var2)) { + this.spawnEntityInWorld(var2); + } + } + + this.theProfiler.endStartSection("connection"); + this.sendQueue.onNetworkTick(); + this.theProfiler.endStartSection("chunkCache"); + this.clientChunkProvider.unloadQueuedChunks(); + this.theProfiler.endStartSection("blocks"); + this.func_147456_g(); + this.theProfiler.endSection(); + } + + /** + * Invalidates an AABB region of blocks from the receive queue, in the event that the block has been modified + * client-side in the intervening 80 receive ticks. + */ + public void invalidateBlockReceiveRegion(int par1, int par2, int par3, int par4, int par5, int par6) {} + + /** + * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? + */ + protected IChunkProvider createChunkProvider() { + this.clientChunkProvider = new ChunkProviderClient(this); + return this.clientChunkProvider; + } + + protected void func_147456_g() { + super.func_147456_g(); + this.previousActiveChunkSet.retainAll(this.activeChunkSet); + + if (this.previousActiveChunkSet.size() == this.activeChunkSet.size()) { + this.previousActiveChunkSet.clear(); + } + + int var1 = 0; + Iterator var2 = this.activeChunkSet.iterator(); + + while (var2.hasNext()) { + ChunkCoordIntPair var3 = (ChunkCoordIntPair)var2.next(); + + if (!this.previousActiveChunkSet.contains(var3)) { + int var4 = var3.chunkXPos * 16; + int var5 = var3.chunkZPos * 16; + this.theProfiler.startSection("getChunk"); + Chunk var6 = this.getChunkFromChunkCoords(var3.chunkXPos, var3.chunkZPos); + this.func_147467_a(var4, var5, var6); + this.theProfiler.endSection(); + this.previousActiveChunkSet.add(var3); + ++var1; + + if (var1 >= 10) { + return; + } + } + } + } + + public void doPreChunk(int par1, int par2, boolean par3) { + if (par3) { + this.clientChunkProvider.loadChunk(par1, par2); + } else { + this.clientChunkProvider.unloadChunk(par1, par2); + } + + if (!par3) { + this.markBlockRangeForRenderUpdate(par1 * 16, 0, par2 * 16, par1 * 16 + 15, 256, par2 * 16 + 15); + } + } + + /** + * Called to place all entities as part of a world + */ + public boolean spawnEntityInWorld(Entity par1Entity) { + boolean var2 = super.spawnEntityInWorld(par1Entity); + this.entityList.add(par1Entity); + + if (!var2) { + this.entitySpawnQueue.add(par1Entity); + } else if (par1Entity instanceof EntityMinecart) { + this.mc.getSoundHandler().playSound(new MovingSoundMinecart((EntityMinecart)par1Entity)); + } + + return var2; + } + + /** + * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation. + */ + public void removeEntity(Entity par1Entity) { + super.removeEntity(par1Entity); + this.entityList.remove(par1Entity); + } + + protected void onEntityAdded(Entity par1Entity) { + super.onEntityAdded(par1Entity); + + if (this.entitySpawnQueue.contains(par1Entity)) { + this.entitySpawnQueue.remove(par1Entity); + } + } + + protected void onEntityRemoved(Entity par1Entity) { + super.onEntityRemoved(par1Entity); + boolean var2 = false; + + if (this.entityList.contains(par1Entity)) { + if (par1Entity.isEntityAlive()) { + this.entitySpawnQueue.add(par1Entity); + var2 = true; + } else { + this.entityList.remove(par1Entity); + } + } + + if (RenderManager.instance.getEntityRenderObject(par1Entity).func_147905_a() && !var2) { + this.mc.renderGlobal.onStaticEntitiesChanged(); + } + } + + /** + * Add an ID to Entity mapping to entityHashSet + */ + public void addEntityToWorld(int par1, Entity par2Entity) { + Entity var3 = this.getEntityByID(par1); + + if (var3 != null) { + this.removeEntity(var3); + } + + this.entityList.add(par2Entity); + par2Entity.setEntityId(par1); + + if (!this.spawnEntityInWorld(par2Entity)) { + this.entitySpawnQueue.add(par2Entity); + } + + this.entityHashSet.addKey(par1, par2Entity); + + if (RenderManager.instance.getEntityRenderObject(par2Entity).func_147905_a()) { + this.mc.renderGlobal.onStaticEntitiesChanged(); + } + } + + /** + * Returns the Entity with the given ID, or null if it doesn't exist in this World. + */ + public Entity getEntityByID(int par1) { + return (Entity)(par1 == this.mc.thePlayer.getEntityId() ? this.mc.thePlayer : (Entity)this.entityHashSet.lookup(par1)); + } + + public Entity removeEntityFromWorld(int par1) { + Entity var2 = (Entity)this.entityHashSet.removeObject(par1); + + if (var2 != null) { + this.entityList.remove(var2); + this.removeEntity(var2); + } + + return var2; + } + + public boolean func_147492_c(int p_147492_1_, int p_147492_2_, int p_147492_3_, Block p_147492_4_, int p_147492_5_) { + this.invalidateBlockReceiveRegion(p_147492_1_, p_147492_2_, p_147492_3_, p_147492_1_, p_147492_2_, p_147492_3_); + return super.setBlock(p_147492_1_, p_147492_2_, p_147492_3_, p_147492_4_, p_147492_5_, 3); + } + + /** + * If on MP, sends a quitting packet. + */ + public void sendQuittingDisconnectingPacket() { + CheatBreaker.getInstance().getEventBus().handleEvent(new DisconnectEvent()); + this.sendQueue.getNetworkManager().closeChannel(new ChatComponentText("Quitting")); + } + + /** + * Updates all weather states. + */ + protected void updateWeather() { + super.updateWeather(); + } + + public void updateWeatherBody() { + if (!this.provider.hasNoSky) { + ; + } + } + + protected int func_152379_p() { + return this.mc.gameSettings.renderDistanceChunks; + } + + public void doVoidFogParticles(int par1, int par2, int par3) { + byte var4 = 16; + Random var5 = new Random(); + + for (int var6 = 0; var6 < 1000; ++var6) { + int var7 = par1 + this.rand.nextInt(var4) - this.rand.nextInt(var4); + int var8 = par2 + this.rand.nextInt(var4) - this.rand.nextInt(var4); + int var9 = par3 + this.rand.nextInt(var4) - this.rand.nextInt(var4); + Block var10 = this.getBlock(var7, var8, var9); + + if (var10.getMaterial() == Material.air) { + if (this.rand.nextInt(8) > var8 && this.provider.getWorldHasVoidParticles()) { + this.spawnParticle("depthsuspend", (double)((float)var7 + this.rand.nextFloat()), (double)((float)var8 + this.rand.nextFloat()), (double)((float)var9 + this.rand.nextFloat()), 0.0D, 0.0D, 0.0D); + } + } else { + var10.randomDisplayTick(this, var7, var8, var9, var5); + } + } + } + + /** + * also releases skins. + */ + public void removeAllEntities() { + this.loadedEntityList.removeAll(this.unloadedEntityList); + int var1; + Entity var2; + int var3; + int var4; + + for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { + var2 = (Entity)this.unloadedEntityList.get(var1); + var3 = var2.chunkCoordX; + var4 = var2.chunkCoordZ; + + if (var2.addedToChunk && this.chunkExists(var3, var4)) { + this.getChunkFromChunkCoords(var3, var4).removeEntity(var2); + } + } + + for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { + this.onEntityRemoved((Entity)this.unloadedEntityList.get(var1)); + } + + this.unloadedEntityList.clear(); + + for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1) { + var2 = (Entity)this.loadedEntityList.get(var1); + + if (var2.ridingEntity != null) { + if (!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) { + continue; + } + + var2.ridingEntity.riddenByEntity = null; + var2.ridingEntity = null; + } + + if (var2.isDead) { + var3 = var2.chunkCoordX; + var4 = var2.chunkCoordZ; + + if (var2.addedToChunk && this.chunkExists(var3, var4)) { + this.getChunkFromChunkCoords(var3, var4).removeEntity(var2); + } + + this.loadedEntityList.remove(var1--); + this.onEntityRemoved(var2); + } + } + } + + /** + * Adds some basic stats of the world to the given crash report. + */ + public CrashReportCategory addWorldInfoToCrashReport(CrashReport par1CrashReport) { + CrashReportCategory var2 = super.addWorldInfoToCrashReport(par1CrashReport); + var2.addCrashSectionCallable("Forced entities", () -> WorldClient.this.entityList.size() + " total; " + WorldClient.this.entityList.toString()); + var2.addCrashSectionCallable("Retry entities", () -> WorldClient.this.entitySpawnQueue.size() + " total; " + WorldClient.this.entitySpawnQueue.toString()); + var2.addCrashSectionCallable("Server brand", () -> WorldClient.this.mc.thePlayer.func_142021_k()); + var2.addCrashSectionCallable("Server type", () -> WorldClient.this.mc.getIntegratedServer() == null ? "Non-integrated multiplayer server" : "Integrated singleplayer server"); + return var2; + } + + /** + * par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound + */ + public void playSound(double par1, double par3, double par5, String par7Str, float par8, float par9, boolean par10) { + double var11 = this.mc.renderViewEntity.getDistanceSq(par1, par3, par5); + PositionedSoundRecord var13 = new PositionedSoundRecord(new ResourceLocation(par7Str), par8, par9, (float)par1, (float)par3, (float)par5); + + if (par10 && var11 > 100.0D) { + double var14 = Math.sqrt(var11) / 40.0D; + this.mc.getSoundHandler().playDelayedSound(var13, (int)(var14 * 20.0D)); + } else { + this.mc.getSoundHandler().playSound(var13); + } + } + + public void makeFireworks(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) { + this.mc.effectRenderer.addEffect(new EntityFireworkStarterFX(this, par1, par3, par5, par7, par9, par11, this.mc.effectRenderer, par13NBTTagCompound)); + } + + public void setWorldScoreboard(Scoreboard par1Scoreboard) { + this.worldScoreboard = par1Scoreboard; + } + + /** + * Sets the world time. + */ + public void setWorldTime(long par1) { + if (par1 < 0L) { + par1 = -par1; + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "false"); + } else { + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "true"); + } + + super.setWorldTime(par1); + } + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + public int getLightBrightnessForSkyBlocks(int x, int y, int z, int lightValue) { + int combinedLight = super.getLightBrightnessForSkyBlocks(x, y, z, lightValue); + + if (Config.isDynamicLights()) { + if (this.renderItemInFirstPerson) { + combinedLight = DynamicLights.getCombinedLight(this.mc.renderViewEntity, combinedLight); + } + + if (!this.getBlock(x, y, z).isOpaqueCube()) { + combinedLight = DynamicLights.getCombinedLight(x, y, z, combinedLight); + } + } + + return combinedLight; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/LanServerDetector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/LanServerDetector.java new file mode 100644 index 0000000..e8ad6b2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/LanServerDetector.java @@ -0,0 +1,136 @@ +package net.minecraft.client.network; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.InetAddress; +import java.net.MulticastSocket; +import java.net.SocketTimeoutException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ThreadLanServerPing; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class LanServerDetector { + private static final AtomicInteger field_148551_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + + + public static class LanServer { + private final String lanServerMotd; + private final String lanServerIpPort; + private long timeLastSeen; + + + public LanServer(String p_i1319_1_, String p_i1319_2_) { + this.lanServerMotd = p_i1319_1_; + this.lanServerIpPort = p_i1319_2_; + this.timeLastSeen = Minecraft.getSystemTime(); + } + + public String getServerMotd() { + return this.lanServerMotd; + } + + public String getServerIpPort() { + return this.lanServerIpPort; + } + + public void updateLastSeen() { + this.timeLastSeen = Minecraft.getSystemTime(); + } + } + + public static class LanServerList { + private final ArrayList listOfLanServers = new ArrayList(); + boolean wasUpdated; + + + public synchronized boolean getWasUpdated() { + return this.wasUpdated; + } + + public synchronized void setWasNotUpdated() { + this.wasUpdated = false; + } + + public synchronized List getLanServers() { + return Collections.unmodifiableList(this.listOfLanServers); + } + + public synchronized void func_77551_a(String p_77551_1_, InetAddress p_77551_2_) { + String var3 = ThreadLanServerPing.getMotdFromPingResponse(p_77551_1_); + String var4 = ThreadLanServerPing.getAdFromPingResponse(p_77551_1_); + + if (var4 != null) { + var4 = p_77551_2_.getHostAddress() + ":" + var4; + boolean var5 = false; + Iterator var6 = this.listOfLanServers.iterator(); + + while (var6.hasNext()) { + LanServerDetector.LanServer var7 = (LanServerDetector.LanServer)var6.next(); + + if (var7.getServerIpPort().equals(var4)) { + var7.updateLastSeen(); + var5 = true; + break; + } + } + + if (!var5) { + this.listOfLanServers.add(new LanServerDetector.LanServer(var3, var4)); + this.wasUpdated = true; + } + } + } + } + + public static class ThreadLanServerFind extends Thread { + private final LanServerDetector.LanServerList localServerList; + private final InetAddress broadcastAddress; + private final MulticastSocket socket; + + + public ThreadLanServerFind(LanServerDetector.LanServerList p_i1320_1_) throws IOException { + super("LanServerDetector #" + LanServerDetector.field_148551_a.incrementAndGet()); + this.localServerList = p_i1320_1_; + this.setDaemon(true); + this.socket = new MulticastSocket(4445); + this.broadcastAddress = InetAddress.getByName("224.0.2.60"); + this.socket.setSoTimeout(5000); + this.socket.joinGroup(this.broadcastAddress); + } + + public void run() { + byte[] var2 = new byte[1024]; + + while (!this.isInterrupted()) { + DatagramPacket var1 = new DatagramPacket(var2, var2.length); + + try { + this.socket.receive(var1); + } catch (SocketTimeoutException var5) { + continue; + } catch (IOException var6) { + LanServerDetector.logger.error("Couldn't ping server", var6); + break; + } + + String var3 = new String(var1.getData(), var1.getOffset(), var1.getLength()); + LanServerDetector.logger.debug(var1.getAddress() + ": " + var3); + this.localServerList.func_77551_a(var3, var1.getAddress()); + } + + try { + this.socket.leaveGroup(this.broadcastAddress); + } catch (IOException var4) { + } + + this.socket.close(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java new file mode 100644 index 0000000..f0ccbbb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java @@ -0,0 +1,77 @@ +package net.minecraft.client.network; + +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.NetHandlerLoginServer; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.Validate; + +public class NetHandlerHandshakeMemory implements INetHandlerHandshakeServer { + private final MinecraftServer field_147385_a; + private final NetworkManager field_147384_b; + + + public NetHandlerHandshakeMemory(MinecraftServer p_i45287_1_, NetworkManager p_i45287_2_) { + this.field_147385_a = p_i45287_1_; + this.field_147384_b = p_i45287_2_; + } + + /** + * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The + * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention + * must pass a versioncheck or receive a disconnect otherwise + */ + public void processHandshake(C00Handshake p_147383_1_) { + this.field_147384_b.setConnectionState(p_147383_1_.func_149594_c()); + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent p_147231_1_) {} + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + Validate.validState(p_147232_2_ == EnumConnectionState.LOGIN || p_147232_2_ == EnumConnectionState.STATUS, "Unexpected protocol " + p_147232_2_); + + switch (NetHandlerHandshakeMemory.SwitchEnumConnectionState.field_151263_a[p_147232_2_.ordinal()]) { + case 1: + this.field_147384_b.setNetHandler(new NetHandlerLoginServer(this.field_147385_a, this.field_147384_b)); + break; + + case 2: + throw new UnsupportedOperationException("NYI"); + + default: + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + static final class SwitchEnumConnectionState { + static final int[] field_151263_a = new int[EnumConnectionState.values().length]; + + + static { + try { + field_151263_a[EnumConnectionState.LOGIN.ordinal()] = 1; + } catch (NoSuchFieldError var2) { + } + + try { + field_151263_a[EnumConnectionState.STATUS.ordinal()] = 2; + } catch (NoSuchFieldError var1) { + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerLoginClient.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerLoginClient.java new file mode 100644 index 0000000..a98c8ca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerLoginClient.java @@ -0,0 +1,113 @@ +package net.minecraft.client.network; + +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; +import com.mojang.authlib.exceptions.InvalidCredentialsException; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.math.BigInteger; +import java.security.PublicKey; +import java.util.UUID; +import javax.crypto.SecretKey; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.CryptManager; +import net.minecraft.util.IChatComponent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetHandlerLoginClient implements INetHandlerLoginClient { + private static final Logger logger = LogManager.getLogger(); + private final Minecraft field_147394_b; + private final GuiScreen field_147395_c; + private final NetworkManager field_147393_d; + + + public NetHandlerLoginClient(NetworkManager p_i45059_1_, Minecraft p_i45059_2_, GuiScreen p_i45059_3_) { + this.field_147393_d = p_i45059_1_; + this.field_147394_b = p_i45059_2_; + this.field_147395_c = p_i45059_3_; + } + + public void handleEncryptionRequest(S01PacketEncryptionRequest p_147389_1_) { + final SecretKey var2 = CryptManager.createNewSharedKey(); + String var3 = p_147389_1_.func_149609_c(); + PublicKey var4 = p_147389_1_.func_149608_d(); + String var5 = (new BigInteger(CryptManager.getServerIdHash(var3, var4, var2))).toString(16); + boolean var6 = this.field_147394_b.getCurrentServerData() == null || !this.field_147394_b.getCurrentServerData().func_152585_d(); + + try { + this.func_147391_c().joinServer(this.field_147394_b.getSession().func_148256_e(), this.field_147394_b.getSession().getToken(), var5); + } catch (AuthenticationUnavailableException var8) { + if (var6) { + this.field_147393_d.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new ChatComponentTranslation("disconnect.loginFailedInfo.serversUnavailable"))); + return; + } + } catch (InvalidCredentialsException var9) { + if (var6) { + this.field_147393_d.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new ChatComponentTranslation("disconnect.loginFailedInfo.invalidSession"))); + return; + } + } catch (AuthenticationException var10) { + if (var6) { + this.field_147393_d.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", var10.getMessage())); + return; + } + } + + this.field_147393_d.scheduleOutboundPacket(new C01PacketEncryptionResponse(var2, var4, p_147389_1_.func_149607_e()), new GenericFutureListener() { + + public void operationComplete(Future p_operationComplete_1_) { + NetHandlerLoginClient.this.field_147393_d.enableEncryption(var2); + } + }); + } + + private MinecraftSessionService func_147391_c() { + return (new YggdrasilAuthenticationService(this.field_147394_b.getProxy(), UUID.randomUUID().toString())).createMinecraftSessionService(); + } + + public void handleLoginSuccess(S02PacketLoginSuccess p_147390_1_) { + this.field_147393_d.setConnectionState(EnumConnectionState.PLAY); + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent p_147231_1_) { + this.field_147394_b.displayGuiScreen(new GuiDisconnected(this.field_147395_c, "connect.failed", p_147231_1_)); + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + logger.debug("Switching protocol from " + p_147232_1_ + " to " + p_147232_2_); + + if (p_147232_2_ == EnumConnectionState.PLAY) { + this.field_147393_d.setNetHandler(new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d)); + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + public void handleDisconnect(S00PacketDisconnect p_147388_1_) { + this.field_147393_d.closeChannel(p_147388_1_.func_149603_c()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java new file mode 100644 index 0000000..07e7d3b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java @@ -0,0 +1,1524 @@ +package net.minecraft.client.network; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.event.impl.DisconnectEvent; +import com.cheatbreaker.client.event.impl.KeepAliveEvent; +import com.cheatbreaker.client.event.impl.PluginMessageEvent; +import com.cheatbreaker.client.module.impl.normal.hud.chat.ModuleChat; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat.ModuleComboCounter; +import com.cheatbreaker.client.module.impl.normal.hud.simple.impl.combat.ModuleSprintResetCounter; +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import net.minecraft.block.Block; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.client.gui.*; +import net.minecraft.client.gui.inventory.GuiContainerCreative; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityCrit2FX; +import net.minecraft.client.particle.EntityPickupFX; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.*; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.*; +import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.network.play.client.*; +import net.minecraft.network.play.server.*; +import net.minecraft.potion.PotionEffect; +import net.minecraft.realms.DisconnectedOnlineScreen; +import net.minecraft.scoreboard.*; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.tileentity.*; +import net.minecraft.util.*; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.Explosion; +import net.minecraft.world.WorldProviderSurface; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.MapData; +import net.minecraft.world.storage.MapStorage; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.util.*; +import java.util.Map.Entry; + +public class NetHandlerPlayClient implements INetHandlerPlayClient { + private static final Logger logger = LogManager.getLogger(); + + /** + * The NetworkManager instance used to communicate with the server (used only by handlePlayerPosLook to update + * positioning and handleJoinGame to inform the server of the com.cheatbreaker.client distribution/mods) + */ + private final NetworkManager netManager; + /** + * Origin of the central MapStorage serving as a public reference for WorldClient. Not used in this class + */ + public MapStorage mapStorageOrigin = new MapStorage(null); + /** + * An ArrayList of GuiPlayerInfo (includes all the players' GuiPlayerInfo on the current server) + */ + public List playerInfoList = new ArrayList(); + public int currentServerMaxPlayers = 20; + /** + * Reference to the Minecraft instance, which many handler methods operate on + */ + private Minecraft gameController; + /** + * Reference to the current ClientWorld instance, which many handler methods operate on + */ + private WorldClient clientWorldController; + /** + * True if the com.cheatbreaker.client has finished downloading terrain and may spawn. Set upon receipt of S08PacketPlayerPosLook, + * reset upon respawning + */ + private boolean doneLoadingTerrain; + /** + * A mapping from player names to their respective GuiPlayerInfo (specifies the clients response time to the server) + */ + private final Map playerInfoMap = new HashMap(); + /** + * Seems to be either null (integrated server) or an instance of either GuiMultiplayer (when connecting to a server) + * or GuiScreenReamlsTOS (when connecting to MCO server) + */ + private final GuiScreen guiScreenServer; + private boolean field_147308_k = false; + + /** + * Just an ordinary random number generator, used to randomize audio pitch of item/orb pickup and randomize both + * particlespawn offset and velocity + */ + private final Random avRandomizer = new Random(); + + + public NetHandlerPlayClient(Minecraft p_i45061_1_, GuiScreen p_i45061_2_, NetworkManager p_i45061_3_) { + this.gameController = p_i45061_1_; + this.guiScreenServer = p_i45061_2_; + this.netManager = p_i45061_3_; + } + + /** + * Clears the WorldClient instance associated with this NetHandlerPlayClient + */ + public void cleanup() { + this.clientWorldController = null; + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() { + } + + /** + * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new + * WorldClient and sets the player initial dimension + */ + public void handleJoinGame(S01PacketJoinGame p_147282_1_) { + this.gameController.playerController = new PlayerControllerMP(this.gameController, this); + this.clientWorldController = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), p_147282_1_.func_149194_f(), p_147282_1_.func_149192_g(), this.gameController.mcProfiler); + this.clientWorldController.isClient = true; + this.gameController.loadWorld(this.clientWorldController); + this.gameController.thePlayer.dimension = p_147282_1_.func_149194_f(); + this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); + this.gameController.thePlayer.setEntityId(p_147282_1_.func_149197_c()); + this.currentServerMaxPlayers = p_147282_1_.func_149193_h(); + this.gameController.playerController.setGameType(p_147282_1_.func_149198_e()); + this.gameController.gameSettings.sendSettingsToServer(); + this.netManager.scheduleOutboundPacket(new C17PacketCustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8))); + ServerData var2 = Minecraft.getMinecraft().currentServerData; + if (var2 != null) { + CheatBreaker.getInstance().updateWSServer(var2.serverIP, var2.domain, var2.port); + } + CheatBreaker.getInstance().getCbNetHandler().getNametagsMap().clear(); + } + + /** + * Spawns an instance of the objecttype indicated by the packet and sets its position and momentum + */ + public void handleSpawnObject(S0EPacketSpawnObject p_147235_1_) { + double var2 = (double) p_147235_1_.func_148997_d() / 32.0D; + double var4 = (double) p_147235_1_.func_148998_e() / 32.0D; + double var6 = (double) p_147235_1_.func_148994_f() / 32.0D; + Object var8 = null; + + if (p_147235_1_.func_148993_l() == 10) { + var8 = EntityMinecart.createMinecart(this.clientWorldController, var2, var4, var6, p_147235_1_.func_149009_m()); + } else if (p_147235_1_.func_148993_l() == 90) { + Entity var9 = this.clientWorldController.getEntityByID(p_147235_1_.func_149009_m()); + + if (var9 instanceof EntityPlayer) { + var8 = new EntityFishHook(this.clientWorldController, var2, var4, var6, (EntityPlayer) var9); + } + + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 60) { + var8 = new EntityArrow(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 61) { + var8 = new EntitySnowball(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 71) { + var8 = new EntityItemFrame(this.clientWorldController, (int) var2, (int) var4, (int) var6, p_147235_1_.func_149009_m()); + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 77) { + var8 = new EntityLeashKnot(this.clientWorldController, (int) var2, (int) var4, (int) var6); + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 65) { + var8 = new EntityEnderPearl(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 72) { + var8 = new EntityEnderEye(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 76) { + var8 = new EntityFireworkRocket(this.clientWorldController, var2, var4, var6, null); + } else if (p_147235_1_.func_148993_l() == 63) { + var8 = new EntityLargeFireball(this.clientWorldController, var2, var4, var6, (double) p_147235_1_.func_149010_g() / 8000.0D, (double) p_147235_1_.func_149004_h() / 8000.0D, (double) p_147235_1_.func_148999_i() / 8000.0D); + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 64) { + var8 = new EntitySmallFireball(this.clientWorldController, var2, var4, var6, (double) p_147235_1_.func_149010_g() / 8000.0D, (double) p_147235_1_.func_149004_h() / 8000.0D, (double) p_147235_1_.func_148999_i() / 8000.0D); + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 66) { + var8 = new EntityWitherSkull(this.clientWorldController, var2, var4, var6, (double) p_147235_1_.func_149010_g() / 8000.0D, (double) p_147235_1_.func_149004_h() / 8000.0D, (double) p_147235_1_.func_148999_i() / 8000.0D); + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 62) { + var8 = new EntityEgg(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 73) { + var8 = new EntityPotion(this.clientWorldController, var2, var4, var6, p_147235_1_.func_149009_m()); + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 75) { + var8 = new EntityExpBottle(this.clientWorldController, var2, var4, var6); + p_147235_1_.func_149002_g(0); + } else if (p_147235_1_.func_148993_l() == 1) { + var8 = new EntityBoat(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 50) { + var8 = new EntityTNTPrimed(this.clientWorldController, var2, var4, var6, null); + } else if (p_147235_1_.func_148993_l() == 51) { + var8 = new EntityEnderCrystal(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 2) { + var8 = new EntityItem(this.clientWorldController, var2, var4, var6); + } else if (p_147235_1_.func_148993_l() == 70) { + var8 = new EntityFallingBlock(this.clientWorldController, var2, var4, var6, Block.getBlockById(p_147235_1_.func_149009_m() & 65535), p_147235_1_.func_149009_m() >> 16); + p_147235_1_.func_149002_g(0); + } + + if (var8 != null) { + ((Entity) var8).serverPosX = p_147235_1_.func_148997_d(); + ((Entity) var8).serverPosY = p_147235_1_.func_148998_e(); + ((Entity) var8).serverPosZ = p_147235_1_.func_148994_f(); + ((Entity) var8).rotationPitch = (float) (p_147235_1_.func_149008_j() * 360) / 256.0F; + ((Entity) var8).rotationYaw = (float) (p_147235_1_.func_149006_k() * 360) / 256.0F; + Entity[] var12 = ((Entity) var8).getParts(); + + if (var12 != null) { + int var10 = p_147235_1_.func_149001_c() - ((Entity) var8).getEntityId(); + + for (int var11 = 0; var11 < var12.length; ++var11) { + var12[var11].setEntityId(var12[var11].getEntityId() + var10); + } + } + + ((Entity) var8).setEntityId(p_147235_1_.func_149001_c()); + this.clientWorldController.addEntityToWorld(p_147235_1_.func_149001_c(), (Entity) var8); + + if (p_147235_1_.func_149009_m() > 0) { + if (p_147235_1_.func_148993_l() == 60) { + Entity var13 = this.clientWorldController.getEntityByID(p_147235_1_.func_149009_m()); + + if (var13 instanceof EntityLivingBase) { + EntityArrow var14 = (EntityArrow) var8; + var14.shootingEntity = var13; + } + } + + ((Entity) var8).setVelocity((double) p_147235_1_.func_149010_g() / 8000.0D, (double) p_147235_1_.func_149004_h() / 8000.0D, (double) p_147235_1_.func_148999_i() / 8000.0D); + } + } + } + + /** + * Spawns an experience orb and sets its value (amount of XP) + */ + public void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb p_147286_1_) { + EntityXPOrb var2 = new EntityXPOrb(this.clientWorldController, p_147286_1_.func_148984_d(), p_147286_1_.func_148983_e(), p_147286_1_.func_148982_f(), p_147286_1_.func_148986_g()); + var2.serverPosX = p_147286_1_.func_148984_d(); + var2.serverPosY = p_147286_1_.func_148983_e(); + var2.serverPosZ = p_147286_1_.func_148982_f(); + var2.rotationYaw = 0.0F; + var2.rotationPitch = 0.0F; + var2.setEntityId(p_147286_1_.func_148985_c()); + this.clientWorldController.addEntityToWorld(p_147286_1_.func_148985_c(), var2); + } + + /** + * Handles globally visible entities. Used in vanilla for lightning bolts + */ + public void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity p_147292_1_) { + double var2 = (double) p_147292_1_.func_149051_d() / 32.0D; + double var4 = (double) p_147292_1_.func_149050_e() / 32.0D; + double var6 = (double) p_147292_1_.func_149049_f() / 32.0D; + EntityLightningBolt var8 = null; + + if (p_147292_1_.func_149053_g() == 1) { + var8 = new EntityLightningBolt(this.clientWorldController, var2, var4, var6); + } + + if (var8 != null) { + var8.serverPosX = p_147292_1_.func_149051_d(); + var8.serverPosY = p_147292_1_.func_149050_e(); + var8.serverPosZ = p_147292_1_.func_149049_f(); + var8.rotationYaw = 0.0F; + var8.rotationPitch = 0.0F; + var8.setEntityId(p_147292_1_.func_149052_c()); + this.clientWorldController.addWeatherEffect(var8); + } + } + + /** + * Handles the spawning of a painting object + */ + public void handleSpawnPainting(S10PacketSpawnPainting p_147288_1_) { + EntityPainting var2 = new EntityPainting(this.clientWorldController, p_147288_1_.func_148964_d(), p_147288_1_.func_148963_e(), p_147288_1_.func_148962_f(), p_147288_1_.func_148966_g(), p_147288_1_.func_148961_h()); + this.clientWorldController.addEntityToWorld(p_147288_1_.func_148965_c(), var2); + } + + /** + * Sets the velocity of the specified entity to the specified value + */ + public void handleEntityVelocity(S12PacketEntityVelocity p_147244_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147244_1_.func_149412_c()); + + if (var2 != null) { + var2.setVelocity((double) p_147244_1_.func_149411_d() / 8000.0D, (double) p_147244_1_.func_149410_e() / 8000.0D, (double) p_147244_1_.func_149409_f() / 8000.0D); + } + } + + /** + * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have + * changed -> Registers any changes locally + */ + public void handleEntityMetadata(S1CPacketEntityMetadata p_147284_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147284_1_.func_149375_d()); + + if (var2 != null && p_147284_1_.func_149376_c() != null) { + var2.getDataWatcher().updateWatchedObjectsFromList(p_147284_1_.func_149376_c()); + } + } + + /** + * Handles the creation of a nearby player entity, sets the position and held item + */ + public void handleSpawnPlayer(S0CPacketSpawnPlayer p_147237_1_) { + double var2 = (double) p_147237_1_.func_148942_f() / 32.0D; + double var4 = (double) p_147237_1_.func_148949_g() / 32.0D; + double var6 = (double) p_147237_1_.func_148946_h() / 32.0D; + float var8 = (float) (p_147237_1_.func_148941_i() * 360) / 256.0F; + float var9 = (float) (p_147237_1_.func_148945_j() * 360) / 256.0F; + GameProfile var10 = p_147237_1_.func_148948_e(); + EntityOtherPlayerMP var11 = new EntityOtherPlayerMP(this.gameController.theWorld, p_147237_1_.func_148948_e()); + var11.prevPosX = var11.lastTickPosX = var11.serverPosX = p_147237_1_.func_148942_f(); + var11.prevPosY = var11.lastTickPosY = var11.serverPosY = p_147237_1_.func_148949_g(); + var11.prevPosZ = var11.lastTickPosZ = var11.serverPosZ = p_147237_1_.func_148946_h(); + int var12 = p_147237_1_.func_148947_k(); + + if (var12 == 0) { + var11.inventory.mainInventory[var11.inventory.currentItem] = null; + } else { + var11.inventory.mainInventory[var11.inventory.currentItem] = new ItemStack(Item.getItemById(var12), 1, 0); + } + + var11.setPositionAndRotation(var2, var4, var6, var8, var9); + this.clientWorldController.addEntityToWorld(p_147237_1_.func_148943_d(), var11); + List var13 = p_147237_1_.func_148944_c(); + + if (var13 != null) { + var11.getDataWatcher().updateWatchedObjectsFromList(var13); + } + } + + /** + * Updates an entity's position and rotation as specified by the packet + */ + public void handleEntityTeleport(S18PacketEntityTeleport p_147275_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147275_1_.func_149451_c()); + + if (var2 != null) { + var2.serverPosX = p_147275_1_.func_149449_d(); + var2.serverPosY = p_147275_1_.func_149448_e(); + var2.serverPosZ = p_147275_1_.func_149446_f(); + double var3 = (double) var2.serverPosX / 32.0D; + double var5 = (double) var2.serverPosY / 32.0D + 0.015625D; + double var7 = (double) var2.serverPosZ / 32.0D; + float var9 = (float) (p_147275_1_.func_149450_g() * 360) / 256.0F; + float var10 = (float) (p_147275_1_.func_149447_h() * 360) / 256.0F; + var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); + } + } + + /** + * Updates which hotbar slot of the player is currently selected + */ + public void handleHeldItemChange(S09PacketHeldItemChange p_147257_1_) { + if (p_147257_1_.func_149385_c() >= 0 && p_147257_1_.func_149385_c() < InventoryPlayer.getHotbarSize()) { + this.gameController.thePlayer.inventory.currentItem = p_147257_1_.func_149385_c(); + } + } + + /** + * Updates the specified entity's position by the specified relative moment and absolute rotation. Note that + * subclassing of the packet allows for the specification of a subset of this data (e.g. only rel. position, abs. + * rotation or both). + */ + public void handleEntityMovement(S14PacketEntity p_147259_1_) { + Entity var2 = p_147259_1_.func_149065_a(this.clientWorldController); + + if (var2 != null) { + var2.serverPosX += p_147259_1_.func_149062_c(); + var2.serverPosY += p_147259_1_.func_149061_d(); + var2.serverPosZ += p_147259_1_.func_149064_e(); + double var3 = (double) var2.serverPosX / 32.0D; + double var5 = (double) var2.serverPosY / 32.0D; + double var7 = (double) var2.serverPosZ / 32.0D; + float var9 = p_147259_1_.func_149060_h() ? (float) (p_147259_1_.func_149066_f() * 360) / 256.0F : var2.rotationYaw; + float var10 = p_147259_1_.func_149060_h() ? (float) (p_147259_1_.func_149063_g() * 360) / 256.0F : var2.rotationPitch; + var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); + } + } + + /** + * Updates the direction in which the specified entity is looking, normally this head rotation is independent of the + * rotation of the entity itself + */ + public void handleEntityHeadLook(S19PacketEntityHeadLook p_147267_1_) { + Entity var2 = p_147267_1_.func_149381_a(this.clientWorldController); + + if (var2 != null) { + float var3 = (float) (p_147267_1_.func_149380_c() * 360) / 256.0F; + var2.setRotationYawHead(var3); + } + } + + /** + * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no + * longer registered as required to monitor them. The latter happens when distance between the player and item + * increases beyond a certain treshold (typically the viewing distance) + */ + public void handleDestroyEntities(S13PacketDestroyEntities p_147238_1_) { + for (int var2 = 0; var2 < p_147238_1_.func_149098_c().length; ++var2) { + this.clientWorldController.removeEntityFromWorld(p_147238_1_.func_149098_c()[var2]); + } + } + + /** + * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning, + * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the + * player positioning + */ + public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_) { + EntityClientPlayerMP var2 = this.gameController.thePlayer; + double var3 = p_147258_1_.func_148932_c(); + double var5 = p_147258_1_.func_148928_d(); + double var7 = p_147258_1_.func_148933_e(); + float var9 = p_147258_1_.func_148931_f(); + float var10 = p_147258_1_.func_148930_g(); + var2.ySize = 0.0F; + var2.motionX = var2.motionY = var2.motionZ = 0.0D; + var2.setPositionAndRotation(var3, var5, var7, var9, var10); + this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(var2.posX, var2.boundingBox.minY, var2.posY, var2.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h())); + + if (!this.doneLoadingTerrain) { + this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX; + this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY; + this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ; + this.doneLoadingTerrain = true; + this.gameController.displayGuiScreen(null); + } + } + + /** + * Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block + * requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends + * S21PacketChunkData + */ + public void handleMultiBlockChange(S22PacketMultiBlockChange p_147287_1_) { + int var2 = p_147287_1_.func_148920_c().chunkXPos * 16; + int var3 = p_147287_1_.func_148920_c().chunkZPos * 16; + + if (p_147287_1_.func_148921_d() != null) { + DataInputStream var4 = new DataInputStream(new ByteArrayInputStream(p_147287_1_.func_148921_d())); + + try { + for (int var5 = 0; var5 < p_147287_1_.func_148922_e(); ++var5) { + short var6 = var4.readShort(); + short var7 = var4.readShort(); + int var8 = var7 >> 4 & 4095; + int var9 = var7 & 15; + int var10 = var6 >> 12 & 15; + int var11 = var6 >> 8 & 15; + int var12 = var6 & 255; + this.clientWorldController.func_147492_c(var10 + var2, var12, var11 + var3, Block.getBlockById(var8), var9); + } + } catch (IOException var13) { + } + } + } + + /** + * Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation + */ + public void handleChunkData(S21PacketChunkData p_147263_1_) { + if (p_147263_1_.func_149274_i()) { + if (p_147263_1_.func_149276_g() == 0) { + this.clientWorldController.doPreChunk(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), false); + return; + } + + this.clientWorldController.doPreChunk(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f(), true); + } + + this.clientWorldController.invalidateBlockReceiveRegion(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15); + Chunk var2 = this.clientWorldController.getChunkFromChunkCoords(p_147263_1_.func_149273_e(), p_147263_1_.func_149271_f()); + var2.fillChunk(p_147263_1_.func_149272_d(), p_147263_1_.func_149276_g(), p_147263_1_.func_149270_h(), p_147263_1_.func_149274_i()); + this.clientWorldController.markBlockRangeForRenderUpdate(p_147263_1_.func_149273_e() << 4, 0, p_147263_1_.func_149271_f() << 4, (p_147263_1_.func_149273_e() << 4) + 15, 256, (p_147263_1_.func_149271_f() << 4) + 15); + + if (!p_147263_1_.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface)) { + var2.resetRelightChecks(); + } + } + + /** + * Updates the block and metadata and generates a blockupdate (and notify the clients) + */ + public void handleBlockChange(S23PacketBlockChange p_147234_1_) { + this.clientWorldController.func_147492_c(p_147234_1_.func_148879_d(), p_147234_1_.func_148878_e(), p_147234_1_.func_148877_f(), p_147234_1_.func_148880_c(), p_147234_1_.func_148881_g()); + } + + /** + * Closes the network channel + */ + public void handleDisconnect(S40PacketDisconnect p_147253_1_) { + this.netManager.closeChannel(p_147253_1_.func_149165_c()); + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent p_147231_1_) { + this.gameController.loadWorld(null); + + // CB + CheatBreaker.getInstance().getEventBus().handleEvent(new DisconnectEvent()); + + if (this.guiScreenServer != null) { + if (this.guiScreenServer instanceof GuiScreenRealmsProxy) { + this.gameController.displayGuiScreen((new DisconnectedOnlineScreen(((GuiScreenRealmsProxy) this.guiScreenServer).func_154321_a(), "disconnect.lost", p_147231_1_)).getProxy()); + } else { + this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", p_147231_1_)); + } + } else { + this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", p_147231_1_)); + } + } + + public void addToSendQueue(Packet p_147297_1_) { + if (p_147297_1_ instanceof C02PacketUseEntity) { + Entity entity = ((C02PacketUseEntity)p_147297_1_).func_149564_a(this.gameController.theWorld); + if (entity != null && ((C02PacketUseEntity)p_147297_1_).func_149565_c() == C02PacketUseEntity.Action.ATTACK) { + ModuleComboCounter.lastAttacked = entity.getEntityId(); + ModuleComboCounter.lastAttackTime = System.currentTimeMillis(); + ModuleSprintResetCounter.lastAttacked = entity.getEntityId(); + ModuleSprintResetCounter.lastAttackTime = System.currentTimeMillis(); + } + } + + this.netManager.scheduleOutboundPacket(p_147297_1_); + } + + public void handleCollectItem(S0DPacketCollectItem p_147246_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147246_1_.func_149354_c()); + Object var3 = this.clientWorldController.getEntityByID(p_147246_1_.func_149353_d()); + + if (var3 == null) { + var3 = this.gameController.thePlayer; + } + + if (var2 != null) { + if (var2 instanceof EntityXPOrb) { + this.clientWorldController.playSoundAtEntity(var2, "random.orb", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } else { + this.clientWorldController.playSoundAtEntity(var2, "random.pop", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } + + this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.gameController.theWorld, var2, (Entity) var3, -0.5F)); + this.clientWorldController.removeEntityFromWorld(p_147246_1_.func_149354_c()); + } + } + + /** + * Prints a chatmessage in the chat GUI + */ + public void handleChat(S02PacketChat p_147251_1_) { + ModuleChat chatModule = CheatBreaker.getInstance().getModuleManager().chatMod; + if (p_147251_1_.func_148915_c().getUnformattedText().contains(Minecraft.getMinecraft().getSession().getUsername())){ + if (chatModule.isEnabled() && + chatModule.highlightOwnName.getBooleanValue() && + chatModule.playDing.getBooleanValue() && + !CheatBreaker.getInstance().getGlobalSettings().muteCBSounds.getBooleanValue() && chatModule.dingCooldown.size() < 1) { + CheatBreaker.getInstance().getAudioManager().playSound("message"); + CheatBreaker.getInstance().getModuleManager().chatMod.dingCooldown.add(System.currentTimeMillis()); + } + } + + this.gameController.ingameGUI.getChatGUI().func_146227_a(p_147251_1_.func_148915_c()); + } + + /** + * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt + * or receiving a critical hit by normal or magical means + */ + public void handleAnimation(S0BPacketAnimation p_147279_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147279_1_.func_148978_c()); + boolean override = CheatBreaker.getInstance().getModuleManager().particlesMod.damaged.getValue().equals("Override"); + boolean vanilla = CheatBreaker.getInstance().getModuleManager().particlesMod.damaged.getValue().equals("Vanilla"); + + if (var2 != null) { + if (p_147279_1_.func_148977_d() == 0) { + EntityLivingBase var3 = (EntityLivingBase) var2; + var3.swingItem(); + } else if (p_147279_1_.func_148977_d() == 1) { + var2.performHurtAnimation(); + } else if (p_147279_1_.func_148977_d() == 2) { + EntityPlayer var4 = (EntityPlayer) var2; + var4.wakeUpPlayer(false, false, false); + } else if (p_147279_1_.func_148977_d() == 4) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && !vanilla) { + if (override && CheatBreaker.getInstance().getModuleManager().particlesMod.critParticles.getValue().equals("Vanilla")) { + EntityCrit2FX var5 = new EntityCrit2FX(this.gameController.theWorld, var2, "crit", (float) CheatBreaker.getInstance().getModuleManager().particlesMod.critParticlesMultiplier.getValue()); + this.gameController.effectRenderer.addEffect(var5); + } + } else { + EntityCrit2FX var5 = new EntityCrit2FX(this.gameController.theWorld, var2); + this.gameController.effectRenderer.addEffect(var5); + } + + } else if (p_147279_1_.func_148977_d() == 5) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && !vanilla) { + if (override && CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticles.getValue().equals("Vanilla")) { + EntityCrit2FX var5 = new EntityCrit2FX(this.gameController.theWorld, var2, "magicCrit", (float) CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticlesMultiplier.getValue()); + this.gameController.effectRenderer.addEffect(var5); + } + } else { + EntityCrit2FX var5 = new EntityCrit2FX(this.gameController.theWorld, var2, "magicCrit"); + this.gameController.effectRenderer.addEffect(var5); + } + } + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && override && (p_147279_1_.func_148977_d() == 4 || p_147279_1_.func_148977_d() == 5) && !vanilla) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.critParticles.getValue().equals("Always")) { + EntityCrit2FX var5 = new EntityCrit2FX(this.gameController.theWorld, var2, "crit", (float) CheatBreaker.getInstance().getModuleManager().particlesMod.critParticlesMultiplier.getValue()); + this.gameController.effectRenderer.addEffect(var5); + } + if (CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticles.getValue().equals("Always")) { + EntityCrit2FX var5 = new EntityCrit2FX(this.gameController.theWorld, var2, "magicCrit", (float) CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticlesMultiplier.getValue()); + this.gameController.effectRenderer.addEffect(var5); + } + } + } + } + + /** + * Retrieves the player identified by the packet, puts him to sleep if possible (and flags whether all players are + * asleep) + */ + public void handleUseBed(S0APacketUseBed p_147278_1_) { + p_147278_1_.func_149091_a(this.clientWorldController).sleepInBedAt(p_147278_1_.func_149092_c(), p_147278_1_.func_149090_d(), p_147278_1_.func_149089_e()); + } + + /** + * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the + * entities Datawatchers with the entity metadata specified in the packet + */ + public void handleSpawnMob(S0FPacketSpawnMob p_147281_1_) { + double var2 = (double) p_147281_1_.func_149023_f() / 32.0D; + double var4 = (double) p_147281_1_.func_149034_g() / 32.0D; + double var6 = (double) p_147281_1_.func_149029_h() / 32.0D; + float var8 = (float) (p_147281_1_.func_149028_l() * 360) / 256.0F; + float var9 = (float) (p_147281_1_.func_149030_m() * 360) / 256.0F; + EntityLivingBase var10 = (EntityLivingBase) EntityList.createEntityByID(p_147281_1_.func_149025_e(), this.gameController.theWorld); + var10.serverPosX = p_147281_1_.func_149023_f(); + var10.serverPosY = p_147281_1_.func_149034_g(); + var10.serverPosZ = p_147281_1_.func_149029_h(); + var10.rotationYawHead = (float) (p_147281_1_.func_149032_n() * 360) / 256.0F; + Entity[] var11 = var10.getParts(); + + if (var11 != null) { + int var12 = p_147281_1_.func_149024_d() - var10.getEntityId(); + + for (int var13 = 0; var13 < var11.length; ++var13) { + var11[var13].setEntityId(var11[var13].getEntityId() + var12); + } + } + + var10.setEntityId(p_147281_1_.func_149024_d()); + var10.setPositionAndRotation(var2, var4, var6, var8, var9); + var10.motionX = (float) p_147281_1_.func_149026_i() / 8000.0F; + var10.motionY = (float) p_147281_1_.func_149033_j() / 8000.0F; + var10.motionZ = (float) p_147281_1_.func_149031_k() / 8000.0F; + this.clientWorldController.addEntityToWorld(p_147281_1_.func_149024_d(), var10); + List var14 = p_147281_1_.func_149027_c(); + + if (var14 != null) { + var10.getDataWatcher().updateWatchedObjectsFromList(var14); + } + } + + public void handleTimeUpdate(S03PacketTimeUpdate p_147285_1_) { + this.gameController.theWorld.func_82738_a(p_147285_1_.func_149366_c()); + if (CheatBreaker.getInstance().getModuleManager().environmentChangerMod.timeType.getValue().equals("Server") || !CheatBreaker.getInstance().getModuleManager().environmentChangerMod.isEnabled()) { + this.gameController.theWorld.setWorldTime(p_147285_1_.func_149365_d()); + } + } + + public void handleSpawnPosition(S05PacketSpawnPosition p_147271_1_) { + this.gameController.thePlayer.setSpawnChunk(new ChunkCoordinates(p_147271_1_.func_149360_c(), p_147271_1_.func_149359_d(), p_147271_1_.func_149358_e()), true); + this.gameController.theWorld.getWorldInfo().setSpawnPosition(p_147271_1_.func_149360_c(), p_147271_1_.func_149359_d(), p_147271_1_.func_149358_e()); + } + + public void handleEntityAttach(S1BPacketEntityAttach p_147243_1_) { + Object var2 = this.clientWorldController.getEntityByID(p_147243_1_.func_149403_d()); + Entity var3 = this.clientWorldController.getEntityByID(p_147243_1_.func_149402_e()); + + if (p_147243_1_.func_149404_c() == 0) { + boolean var4 = false; + + if (p_147243_1_.func_149403_d() == this.gameController.thePlayer.getEntityId()) { + var2 = this.gameController.thePlayer; + + if (var3 instanceof EntityBoat) { + ((EntityBoat) var3).setIsBoatEmpty(false); + } + + var4 = ((Entity) var2).ridingEntity == null && var3 != null; + } else if (var3 instanceof EntityBoat) { + ((EntityBoat) var3).setIsBoatEmpty(true); + } + + if (var2 == null) { + return; + } + + ((Entity) var2).mountEntity(var3); + + if (var4) { + GameSettings var5 = this.gameController.gameSettings; + this.gameController.ingameGUI.func_110326_a(I18n.format("mount.onboard", GameSettings.getKeyDisplayString(var5.keyBindSneak.getKeyCode())), false); + } + } else if (p_147243_1_.func_149404_c() == 1 && var2 != null && var2 instanceof EntityLiving) { + if (var3 != null) { + ((EntityLiving) var2).setLeashedToEntity(var3, false); + } else { + ((EntityLiving) var2).clearLeashed(false, false); + } + } + } + + /** + * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), + * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch + * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke + * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) + */ + public void handleEntityStatus(S19PacketEntityStatus p_147236_1_) { + Entity var2 = p_147236_1_.func_149161_a(this.clientWorldController); + + if (var2 != null) { + var2.handleHealthUpdate(p_147236_1_.func_149160_c()); + if (p_147236_1_.func_149160_c() != 2) { + return; + } + + Minecraft mc = Minecraft.getMinecraft(); + EntityClientPlayerMP player = mc.thePlayer; + if (ModuleComboCounter.lastAttacked == var2.getEntityId()) { + ModuleComboCounter.lastAttacked = -1; + if (ModuleComboCounter.lastCombo != var2.getEntityId()) { + ModuleComboCounter.hits.clear(); + } + + ModuleComboCounter.hits.add(System.currentTimeMillis()); + ModuleComboCounter.lastComboTime = System.currentTimeMillis(); + ModuleComboCounter.lastCombo = var2.getEntityId(); + } else if (var2.getEntityId() == player.getEntityId()) { + ModuleComboCounter.hits.clear(); + } + if (ModuleSprintResetCounter.lastAttacked == var2.getEntityId()) { + ModuleSprintResetCounter.lastAttacked = -1; + if (ModuleSprintResetCounter.lastCombo != var2.getEntityId()) { + ModuleSprintResetCounter.temphits.clear(); + } + + if (mc.gameSettings.keyBindForward.getIsKeyPressed() && player.isSprinting()) { + ModuleSprintResetCounter.temphits.add(System.currentTimeMillis()); + } + ModuleSprintResetCounter.lastComboTime = System.currentTimeMillis(); + ModuleSprintResetCounter.lastCombo = var2.getEntityId(); + } + } + } + + public void handleUpdateHealth(S06PacketUpdateHealth p_147249_1_) { + this.gameController.thePlayer.setPlayerSPHealth(p_147249_1_.func_149332_c()); + this.gameController.thePlayer.getFoodStats().setFoodLevel(p_147249_1_.func_149330_d()); + this.gameController.thePlayer.getFoodStats().setFoodSaturationLevel(p_147249_1_.func_149331_e()); + } + + public void handleSetExperience(S1FPacketSetExperience p_147295_1_) { + this.gameController.thePlayer.setXPStats(p_147295_1_.func_149397_c(), p_147295_1_.func_149396_d(), p_147295_1_.func_149395_e()); + } + + public void handleRespawn(S07PacketRespawn p_147280_1_) { + if (p_147280_1_.func_149082_c() != this.gameController.thePlayer.dimension) { + this.doneLoadingTerrain = false; + Scoreboard var2 = this.clientWorldController.getScoreboard(); + this.clientWorldController = new WorldClient(this, new WorldSettings(0L, p_147280_1_.func_149083_e(), false, this.gameController.theWorld.getWorldInfo().isHardcoreModeEnabled(), p_147280_1_.func_149080_f()), p_147280_1_.func_149082_c(), p_147280_1_.func_149081_d(), this.gameController.mcProfiler); + this.clientWorldController.setWorldScoreboard(var2); + this.clientWorldController.isClient = true; + this.gameController.loadWorld(this.clientWorldController); + this.gameController.thePlayer.dimension = p_147280_1_.func_149082_c(); + this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); + } + + this.gameController.setDimensionAndSpawnPlayer(p_147280_1_.func_149082_c()); + this.gameController.playerController.setGameType(p_147280_1_.func_149083_e()); + } + + /** + * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. + */ + public void handleExplosion(S27PacketExplosion p_147283_1_) { + Explosion var2 = new Explosion(this.gameController.theWorld, null, p_147283_1_.func_149148_f(), p_147283_1_.func_149143_g(), p_147283_1_.func_149145_h(), p_147283_1_.func_149146_i()); + var2.affectedBlockPositions = p_147283_1_.func_149150_j(); + var2.doExplosionB(true); + this.gameController.thePlayer.motionX += p_147283_1_.func_149149_c(); + this.gameController.thePlayer.motionY += p_147283_1_.func_149144_d(); + this.gameController.thePlayer.motionZ += p_147283_1_.func_149147_e(); + } + + /** + * Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table, + * Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse + */ + public void handleOpenWindow(S2DPacketOpenWindow p_147265_1_) { + EntityClientPlayerMP var2 = this.gameController.thePlayer; + + switch (p_147265_1_.func_148899_d()) { + case 0: + var2.displayGUIChest(new InventoryBasic(p_147265_1_.func_148902_e(), p_147265_1_.func_148900_g(), p_147265_1_.func_148898_f())); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 1: + var2.displayGUIWorkbench(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 2: + TileEntityFurnace var4 = new TileEntityFurnace(); + + if (p_147265_1_.func_148900_g()) { + var4.func_145951_a(p_147265_1_.func_148902_e()); + } + + var2.func_146101_a(var4); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 3: + TileEntityDispenser var7 = new TileEntityDispenser(); + + if (p_147265_1_.func_148900_g()) { + var7.func_146018_a(p_147265_1_.func_148902_e()); + } + + var2.func_146102_a(var7); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 4: + var2.displayGUIEnchantment(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ), p_147265_1_.func_148900_g() ? p_147265_1_.func_148902_e() : null); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 5: + TileEntityBrewingStand var5 = new TileEntityBrewingStand(); + + if (p_147265_1_.func_148900_g()) { + var5.func_145937_a(p_147265_1_.func_148902_e()); + } + + var2.func_146098_a(var5); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 6: + var2.displayGUIMerchant(new NpcMerchant(var2), p_147265_1_.func_148900_g() ? p_147265_1_.func_148902_e() : null); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 7: + TileEntityBeacon var8 = new TileEntityBeacon(); + var2.func_146104_a(var8); + + if (p_147265_1_.func_148900_g()) { + var8.func_145999_a(p_147265_1_.func_148902_e()); + } + + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 8: + var2.displayGUIAnvil(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 9: + TileEntityHopper var3 = new TileEntityHopper(); + + if (p_147265_1_.func_148900_g()) { + var3.func_145886_a(p_147265_1_.func_148902_e()); + } + + var2.func_146093_a(var3); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 10: + TileEntityDropper var6 = new TileEntityDropper(); + + if (p_147265_1_.func_148900_g()) { + var6.func_146018_a(p_147265_1_.func_148902_e()); + } + + var2.func_146102_a(var6); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + break; + + case 11: + Entity var9 = this.clientWorldController.getEntityByID(p_147265_1_.func_148897_h()); + + if (var9 != null && var9 instanceof EntityHorse) { + var2.displayGUIHorse((EntityHorse) var9, new AnimalChest(p_147265_1_.func_148902_e(), p_147265_1_.func_148900_g(), p_147265_1_.func_148898_f())); + var2.openContainer.windowId = p_147265_1_.func_148901_c(); + } + } + } + + /** + * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container + */ + public void handleSetSlot(S2FPacketSetSlot p_147266_1_) { + EntityClientPlayerMP var2 = this.gameController.thePlayer; + + if (p_147266_1_.func_149175_c() == -1) { + var2.inventory.setItemStack(p_147266_1_.func_149174_e()); + } else { + boolean var3 = false; + + if (this.gameController.currentScreen instanceof GuiContainerCreative) { + GuiContainerCreative var4 = (GuiContainerCreative) this.gameController.currentScreen; + var3 = var4.func_147056_g() != CreativeTabs.tabInventory.getTabIndex(); + } + + if (p_147266_1_.func_149175_c() == 0 && p_147266_1_.func_149173_d() >= 36 && p_147266_1_.func_149173_d() < 45) { + ItemStack var5 = var2.inventoryContainer.getSlot(p_147266_1_.func_149173_d()).getStack(); + + if (p_147266_1_.func_149174_e() != null && (var5 == null || var5.stackSize < p_147266_1_.func_149174_e().stackSize)) { + p_147266_1_.func_149174_e().animationsToGo = 5; + } + + var2.inventoryContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e()); + } else if (p_147266_1_.func_149175_c() == var2.openContainer.windowId && (p_147266_1_.func_149175_c() != 0 || !var3)) { + var2.openContainer.putStackInSlot(p_147266_1_.func_149173_d(), p_147266_1_.func_149174_e()); + } + } + } + + /** + * Verifies that the server and com.cheatbreaker.client are synchronized with respect to the inventory/container opened by the player + * and confirms if it is the case. + */ + public void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_) { + Container var2 = null; + EntityClientPlayerMP var3 = this.gameController.thePlayer; + + if (p_147239_1_.func_148889_c() == 0) { + var2 = var3.inventoryContainer; + } else if (p_147239_1_.func_148889_c() == var3.openContainer.windowId) { + var2 = var3.openContainer; + } + + if (var2 != null && !p_147239_1_.func_148888_e()) { + this.addToSendQueue(new C0FPacketConfirmTransaction(p_147239_1_.func_148889_c(), p_147239_1_.func_148890_d(), true)); + } + } + + /** + * Handles the placement of a specified ItemStack in a specified container/inventory slot + */ + public void handleWindowItems(S30PacketWindowItems p_147241_1_) { + EntityClientPlayerMP var2 = this.gameController.thePlayer; + + if (p_147241_1_.func_148911_c() == 0) { + var2.inventoryContainer.putStacksInSlots(p_147241_1_.func_148910_d()); + } else if (p_147241_1_.func_148911_c() == var2.openContainer.windowId) { + var2.openContainer.putStacksInSlots(p_147241_1_.func_148910_d()); + } + } + + /** + * Creates a sign in the specified location if it didn't exist and opens the GUI to edit its text + */ + public void handleSignEditorOpen(S36PacketSignEditorOpen p_147268_1_) { + Object var2 = this.clientWorldController.getTileEntity(p_147268_1_.func_149129_c(), p_147268_1_.func_149128_d(), p_147268_1_.func_149127_e()); + + if (var2 == null) { + var2 = new TileEntitySign(); + ((TileEntity) var2).setWorldObj(this.clientWorldController); + ((TileEntity) var2).field_145851_c = p_147268_1_.func_149129_c(); + ((TileEntity) var2).field_145848_d = p_147268_1_.func_149128_d(); + ((TileEntity) var2).field_145849_e = p_147268_1_.func_149127_e(); + } + + this.gameController.thePlayer.func_146100_a((TileEntity) var2); + } + + /** + * Updates a specified sign with the specified text lines + */ + public void handleUpdateSign(S33PacketUpdateSign p_147248_1_) { + boolean var2 = false; + + if (this.gameController.theWorld.blockExists(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e())) { + TileEntity var3 = this.gameController.theWorld.getTileEntity(p_147248_1_.func_149346_c(), p_147248_1_.func_149345_d(), p_147248_1_.func_149344_e()); + + if (var3 instanceof TileEntitySign) { + TileEntitySign var4 = (TileEntitySign) var3; + + if (var4.func_145914_a()) { + for (int var5 = 0; var5 < 4; ++var5) { + var4.field_145915_a[var5] = p_147248_1_.func_149347_f()[var5]; + } + + var4.onInventoryChanged(); + } + + var2 = true; + } + } + + if (!var2 && this.gameController.thePlayer != null) { + this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + p_147248_1_.func_149346_c() + ", " + p_147248_1_.func_149345_d() + ", " + p_147248_1_.func_149344_e())); + } + } + + /** + * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks, + * beacons, skulls, flowerpot + */ + public void handleUpdateTileEntity(S35PacketUpdateTileEntity p_147273_1_) { + if (this.gameController.theWorld.blockExists(p_147273_1_.func_148856_c(), p_147273_1_.func_148855_d(), p_147273_1_.func_148854_e())) { + TileEntity var2 = this.gameController.theWorld.getTileEntity(p_147273_1_.func_148856_c(), p_147273_1_.func_148855_d(), p_147273_1_.func_148854_e()); + + if (var2 != null) { + if (p_147273_1_.func_148853_f() == 1 && var2 instanceof TileEntityMobSpawner) { + var2.readFromNBT(p_147273_1_.func_148857_g()); + } else if (p_147273_1_.func_148853_f() == 2 && var2 instanceof TileEntityCommandBlock) { + var2.readFromNBT(p_147273_1_.func_148857_g()); + } else if (p_147273_1_.func_148853_f() == 3 && var2 instanceof TileEntityBeacon) { + var2.readFromNBT(p_147273_1_.func_148857_g()); + } else if (p_147273_1_.func_148853_f() == 4 && var2 instanceof TileEntitySkull) { + var2.readFromNBT(p_147273_1_.func_148857_g()); + } else if (p_147273_1_.func_148853_f() == 5 && var2 instanceof TileEntityFlowerPot) { + var2.readFromNBT(p_147273_1_.func_148857_g()); + } + } + } + } + + /** + * Sets the progressbar of the opened window to the specified value + */ + public void handleWindowProperty(S31PacketWindowProperty p_147245_1_) { + EntityClientPlayerMP var2 = this.gameController.thePlayer; + + if (var2.openContainer != null && var2.openContainer.windowId == p_147245_1_.func_149182_c()) { + var2.openContainer.updateProgressBar(p_147245_1_.func_149181_d(), p_147245_1_.func_149180_e()); + } + } + + public void handleEntityEquipment(S04PacketEntityEquipment p_147242_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147242_1_.func_149389_d()); + + if (var2 != null) { + var2.setCurrentItemOrArmor(p_147242_1_.func_149388_e(), p_147242_1_.func_149390_c()); + } + } + + /** + * Resets the ItemStack held in hand and closes the window that is opened + */ + public void handleCloseWindow(S2EPacketCloseWindow p_147276_1_) { + this.gameController.thePlayer.closeScreenNoPacket(); + } + + /** + * Triggers Block.onBlockEventReceived, which is implemented in BlockPistonBase for extension/retraction, BlockNote + * for setting the instrument (including audiovisual feedback) and in BlockContainer to set the number of players + * accessing a (Ender)Chest + */ + public void handleBlockAction(S24PacketBlockAction p_147261_1_) { + this.gameController.theWorld.func_147452_c(p_147261_1_.func_148867_d(), p_147261_1_.func_148866_e(), p_147261_1_.func_148865_f(), p_147261_1_.func_148868_c(), p_147261_1_.func_148869_g(), p_147261_1_.func_148864_h()); + } + + /** + * Updates all registered IWorldAccess instances with destroyBlockInWorldPartially + */ + public void handleBlockBreakAnim(S25PacketBlockBreakAnim p_147294_1_) { + this.gameController.theWorld.destroyBlockInWorldPartially(p_147294_1_.func_148845_c(), p_147294_1_.func_148844_d(), p_147294_1_.func_148843_e(), p_147294_1_.func_148842_f(), p_147294_1_.func_148846_g()); + } + + public void handleMapChunkBulk(S26PacketMapChunkBulk p_147269_1_) { + for (int var2 = 0; var2 < p_147269_1_.func_149254_d(); ++var2) { + int var3 = p_147269_1_.func_149255_a(var2); + int var4 = p_147269_1_.func_149253_b(var2); + this.clientWorldController.doPreChunk(var3, var4, true); + this.clientWorldController.invalidateBlockReceiveRegion(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); + Chunk var5 = this.clientWorldController.getChunkFromChunkCoords(var3, var4); + var5.fillChunk(p_147269_1_.func_149256_c(var2), p_147269_1_.func_149252_e()[var2], p_147269_1_.func_149257_f()[var2], true); + this.clientWorldController.markBlockRangeForRenderUpdate(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); + + if (!(this.clientWorldController.provider instanceof WorldProviderSurface)) { + var5.resetRelightChecks(); + } + } + } + + public void handleChangeGameState(S2BPacketChangeGameState p_147252_1_) { + EntityClientPlayerMP var2 = this.gameController.thePlayer; + int var3 = p_147252_1_.func_149138_c(); + float var4 = p_147252_1_.func_149137_d(); + int var5 = MathHelper.floor_float(var4 + 0.5F); + + if (var3 >= 0 && var3 < S2BPacketChangeGameState.field_149142_a.length && S2BPacketChangeGameState.field_149142_a[var3] != null) { + var2.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.field_149142_a[var3])); + } + + if (var3 == 1) { + this.clientWorldController.getWorldInfo().setRaining(true); + this.clientWorldController.setRainStrength(0.0F); + } else if (var3 == 2) { + this.clientWorldController.getWorldInfo().setRaining(false); + this.clientWorldController.setRainStrength(1.0F); + } else if (var3 == 3) { + this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(var5)); + } else if (var3 == 4) { + this.gameController.displayGuiScreen(new GuiWinGame()); + } else if (var3 == 5) { + GameSettings var6 = this.gameController.gameSettings; + + if (var4 == 0.0F) { + this.gameController.displayGuiScreen(new GuiScreenDemo()); + } else if (var4 == 101.0F) { + this.gameController.ingameGUI.getChatGUI().func_146227_a(new ChatComponentTranslation("demo.help.movement", GameSettings.getKeyDisplayString(var6.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindRight.getKeyCode()))); + } else if (var4 == 102.0F) { + this.gameController.ingameGUI.getChatGUI().func_146227_a(new ChatComponentTranslation("demo.help.jump", GameSettings.getKeyDisplayString(var6.keyBindJump.getKeyCode()))); + } else if (var4 == 103.0F) { + this.gameController.ingameGUI.getChatGUI().func_146227_a(new ChatComponentTranslation("demo.help.inventory", GameSettings.getKeyDisplayString(var6.keyBindInventory.getKeyCode()))); + } + } else if (var3 == 6) { + this.clientWorldController.playSound(var2.posX, var2.posY + (double) var2.getEyeHeight(), var2.posZ, "random.successful_hit", 0.18F, 0.45F, false); + } else if (var3 == 7) { + this.clientWorldController.setRainStrength(var4); + } else if (var3 == 8) { + this.clientWorldController.setThunderStrength(var4); + } + } + + /** + * Updates the worlds MapStorage with the specified MapData for the specified map-identifier and invokes a + * MapItemRenderer for it + */ + public void handleMaps(S34PacketMaps p_147264_1_) { + MapData var2 = ItemMap.func_150912_a(p_147264_1_.func_149188_c(), this.gameController.theWorld); + var2.updateMPMapData(p_147264_1_.func_149187_d()); + this.gameController.entityRenderer.getMapItemRenderer().func_148246_a(var2); + } + + public void handleEffect(S28PacketEffect p_147277_1_) { + if (p_147277_1_.func_149244_c()) { + this.gameController.theWorld.playBroadcastSound(p_147277_1_.func_149242_d(), p_147277_1_.func_149240_f(), p_147277_1_.func_149243_g(), p_147277_1_.func_149239_h(), p_147277_1_.func_149241_e()); + } else { + this.gameController.theWorld.playAuxSFX(p_147277_1_.func_149242_d(), p_147277_1_.func_149240_f(), p_147277_1_.func_149243_g(), p_147277_1_.func_149239_h(), p_147277_1_.func_149241_e()); + } + } + + /** + * Updates the players statistics or achievements + */ + public void handleStatistics(S37PacketStatistics p_147293_1_) { + boolean var2 = false; + StatBase var5; + int var6; + + for (Iterator var3 = p_147293_1_.func_148974_c().entrySet().iterator(); var3.hasNext(); this.gameController.thePlayer.func_146107_m().func_150873_a(this.gameController.thePlayer, var5, var6)) { + Entry var4 = (Entry) var3.next(); + var5 = (StatBase) var4.getKey(); + var6 = ((Integer) var4.getValue()).intValue(); + + if (var5.isAchievement() && var6 > 0) { + if (this.field_147308_k && this.gameController.thePlayer.func_146107_m().writeStat(var5) == 0) { + Achievement var7 = (Achievement) var5; + this.gameController.guiAchievement.func_146256_a(var7); + if (var5 == AchievementList.openInventory) { + this.gameController.gameSettings.showInventoryAchievementHint = false; + this.gameController.gameSettings.saveOptions(); + } + } + + var2 = true; + } + } + + if (!this.field_147308_k && !var2 && this.gameController.gameSettings.showInventoryAchievementHint) { + this.gameController.guiAchievement.func_146255_b(AchievementList.openInventory); + } + + this.field_147308_k = true; + + if (this.gameController.currentScreen instanceof IProgressMeter) { + ((IProgressMeter) this.gameController.currentScreen).func_146509_g(); + } + } + + public void handleEntityEffect(S1DPacketEntityEffect p_147260_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147260_1_.func_149426_d()); + + if (var2 instanceof EntityLivingBase) { + PotionEffect var3 = new PotionEffect(p_147260_1_.func_149427_e(), p_147260_1_.func_149425_g(), p_147260_1_.func_149428_f()); + var3.setPotionDurationMax(p_147260_1_.func_149429_c()); + ((EntityLivingBase) var2).addPotionEffect(var3); + } + } + + public void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect p_147262_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147262_1_.func_149076_c()); + + if (var2 instanceof EntityLivingBase) { + ((EntityLivingBase) var2).removePotionEffectClient(p_147262_1_.func_149075_d()); + } + } + + public void handlePlayerListItem(S38PacketPlayerListItem p_147256_1_) { + GuiPlayerInfo var2 = (GuiPlayerInfo) this.playerInfoMap.get(p_147256_1_.func_149122_c()); + + if (var2 == null && p_147256_1_.func_149121_d()) { + var2 = new GuiPlayerInfo(p_147256_1_.func_149122_c()); + this.playerInfoMap.put(p_147256_1_.func_149122_c(), var2); + this.playerInfoList.add(var2); + } + + if (var2 != null && !p_147256_1_.func_149121_d()) { + this.playerInfoMap.remove(p_147256_1_.func_149122_c()); + this.playerInfoList.remove(var2); + } + + if (var2 != null && p_147256_1_.func_149121_d()) { + var2.responseTime = p_147256_1_.func_149120_e(); + } + } + + public void handleKeepAlive(S00PacketKeepAlive p_147272_1_) { + CheatBreaker.getInstance().getEventBus().handleEvent(new KeepAliveEvent()); + this.addToSendQueue(new C00PacketKeepAlive(p_147272_1_.func_149134_c())); + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + throw new IllegalStateException("Unexpected protocol change!"); + } + + public void handlePlayerAbilities(S39PacketPlayerAbilities p_147270_1_) { + EntityClientPlayerMP var2 = this.gameController.thePlayer; + var2.capabilities.isFlying = p_147270_1_.func_149106_d(); + var2.capabilities.isCreativeMode = p_147270_1_.func_149103_f(); + var2.capabilities.disableDamage = p_147270_1_.func_149112_c(); + var2.capabilities.allowFlying = p_147270_1_.func_149105_e(); + var2.capabilities.setFlySpeed(p_147270_1_.func_149101_g()); + var2.capabilities.setPlayerWalkSpeed(p_147270_1_.func_149107_h()); + } + + /** + * Displays the available command-completion options the server knows of + */ + public void handleTabComplete(S3APacketTabComplete p_147274_1_) { + String[] var2 = p_147274_1_.func_149630_c(); + + if (this.gameController.currentScreen instanceof GuiChat) { + GuiChat var3 = (GuiChat) this.gameController.currentScreen; + var3.func_146406_a(var2); + } + } + + public void handleSoundEffect(S29PacketSoundEffect p_147255_1_) { + this.gameController.theWorld.playSound(p_147255_1_.func_149207_d(), p_147255_1_.func_149211_e(), p_147255_1_.func_149210_f(), p_147255_1_.func_149212_c(), p_147255_1_.func_149208_g(), p_147255_1_.func_149209_h(), false); + } + + /** + * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to + * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the + * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server + * resourcepack for the com.cheatbreaker.client to load. + */ + public void handleCustomPayload(S3FPacketCustomPayload p_147240_1_) { + CheatBreaker.getInstance().getEventBus().handleEvent(new PluginMessageEvent(p_147240_1_.func_149169_c(), p_147240_1_.func_149168_d())); + if ("MC|TrList".equals(p_147240_1_.func_149169_c())) { + ByteBuf var2 = Unpooled.wrappedBuffer(p_147240_1_.func_149168_d()); + + try { + int var3 = var2.readInt(); + GuiScreen var4 = this.gameController.currentScreen; + + if (var4 != null && var4 instanceof GuiMerchant && var3 == this.gameController.thePlayer.openContainer.windowId) { + IMerchant var5 = ((GuiMerchant) var4).func_147035_g(); + MerchantRecipeList var6 = MerchantRecipeList.func_151390_b(new PacketBuffer(var2)); + var5.setRecipes(var6); + } + } catch (IOException var10) { + logger.error("Couldn't load trade info", var10); + } finally { + var2.release(); + } + } else if ("MC|Brand".equals(p_147240_1_.func_149169_c())) { + this.gameController.thePlayer.func_142020_c(new String(p_147240_1_.func_149168_d(), Charsets.UTF_8)); + } else if ("MC|RPack".equals(p_147240_1_.func_149169_c())) { + final String var12 = new String(p_147240_1_.func_149168_d(), Charsets.UTF_8); + + if (this.gameController.getCurrentServerData() != null && this.gameController.getCurrentServerData().func_152586_b() == ServerData.ServerResourceMode.ENABLED) { + this.gameController.getResourcePackRepository().func_148526_a(var12); + } else if (this.gameController.getCurrentServerData() == null || this.gameController.getCurrentServerData().func_152586_b() == ServerData.ServerResourceMode.PROMPT) { + this.gameController.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() { + + public void confirmClicked(boolean p_73878_1_, int p_73878_2_) { + NetHandlerPlayClient.this.gameController = Minecraft.getMinecraft(); + + if (NetHandlerPlayClient.this.gameController.getCurrentServerData() != null) { + NetHandlerPlayClient.this.gameController.getCurrentServerData().func_152584_a(ServerData.ServerResourceMode.ENABLED); + ServerList.func_147414_b(NetHandlerPlayClient.this.gameController.getCurrentServerData()); + } + + if (p_73878_1_) { + NetHandlerPlayClient.this.gameController.getResourcePackRepository().func_148526_a(var12); + } + + NetHandlerPlayClient.this.gameController.displayGuiScreen(null); + } + }, I18n.format("multiplayer.texturePrompt.line1"), I18n.format("multiplayer.texturePrompt.line2"), 0)); + } + } + } + + /** + * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname + */ + public void handleScoreboardObjective(S3BPacketScoreboardObjective p_147291_1_) { + Scoreboard var2 = this.clientWorldController.getScoreboard(); + ScoreObjective var3; + + if (p_147291_1_.func_149338_e() == 0) { + var3 = var2.addScoreObjective(p_147291_1_.func_149339_c(), IScoreObjectiveCriteria.field_96641_b); + var3.setDisplayName(p_147291_1_.func_149337_d()); + } else { + var3 = var2.getObjective(p_147291_1_.func_149339_c()); + + if (p_147291_1_.func_149338_e() == 1) { + var2.func_96519_k(var3); + } else if (p_147291_1_.func_149338_e() == 2) { + var3.setDisplayName(p_147291_1_.func_149337_d()); + } + } + } + + /** + * Either updates the score with a specified value or removes the score for an objective + */ + public void handleUpdateScore(S3CPacketUpdateScore p_147250_1_) { + Scoreboard var2 = this.clientWorldController.getScoreboard(); + ScoreObjective var3 = var2.getObjective(p_147250_1_.func_149321_d()); + + if (p_147250_1_.func_149322_f() == 0) { + Score var4 = var2.func_96529_a(p_147250_1_.func_149324_c(), var3); + var4.func_96647_c(p_147250_1_.func_149323_e()); + } else if (p_147250_1_.func_149322_f() == 1) { + var2.func_96515_c(p_147250_1_.func_149324_c()); + } + } + + /** + * Removes or sets the ScoreObjective to be displayed at a particular scoreboard position (list, sidebar, below + * name) + */ + public void handleDisplayScoreboard(S3DPacketDisplayScoreboard p_147254_1_) { + Scoreboard var2 = this.clientWorldController.getScoreboard(); + + if (p_147254_1_.func_149370_d().length() == 0) { + var2.func_96530_a(p_147254_1_.func_149371_c(), null); + } else { + ScoreObjective var3 = var2.getObjective(p_147254_1_.func_149370_d()); + var2.func_96530_a(p_147254_1_.func_149371_c(), var3); + } + } + + /** + * Updates a team managed by the scoreboard: Create/Remove the team registration, Register/Remove the player-team- + * memberships, Set team displayname/prefix/suffix and/or whether friendly fire is enabled + */ + public void handleTeams(S3EPacketTeams p_147247_1_) { + Scoreboard var2 = this.clientWorldController.getScoreboard(); + ScorePlayerTeam var3; + + if (p_147247_1_.func_149307_h() == 0) { + var3 = var2.createTeam(p_147247_1_.func_149312_c()); + } else { + var3 = var2.getTeam(p_147247_1_.func_149312_c()); + } + + if (p_147247_1_.func_149307_h() == 0 || p_147247_1_.func_149307_h() == 2) { + var3.setTeamName(p_147247_1_.func_149306_d()); + var3.setNamePrefix(p_147247_1_.func_149311_e()); + var3.setNameSuffix(p_147247_1_.func_149309_f()); + var3.func_98298_a(p_147247_1_.func_149308_i()); + } + + Iterator var4; + String var5; + + if (p_147247_1_.func_149307_h() == 0 || p_147247_1_.func_149307_h() == 3) { + var4 = p_147247_1_.func_149310_g().iterator(); + + while (var4.hasNext()) { + var5 = (String) var4.next(); + var2.func_151392_a(var5, p_147247_1_.func_149312_c()); + } + } + + if (p_147247_1_.func_149307_h() == 4) { + var4 = p_147247_1_.func_149310_g().iterator(); + + while (var4.hasNext()) { + var5 = (String) var4.next(); + var2.removePlayerFromTeam(var5, var3); + } + } + + if (p_147247_1_.func_149307_h() == 1) { + var2.removeTeam(var3); + } + } + + /** + * Spawns a specified number of particles at the specified location with a randomized displacement according to + * specified bounds + */ + public void handleParticles(S2APacketParticles p_147289_1_) { + if (p_147289_1_.func_149222_k() == 0) { + double var2 = p_147289_1_.func_149227_j() * p_147289_1_.func_149221_g(); + double var4 = p_147289_1_.func_149227_j() * p_147289_1_.func_149224_h(); + double var6 = p_147289_1_.func_149227_j() * p_147289_1_.func_149223_i(); + this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d(), p_147289_1_.func_149226_e(), p_147289_1_.func_149225_f(), var2, var4, var6); + } else { + for (int var15 = 0; var15 < p_147289_1_.func_149222_k(); ++var15) { + double var3 = this.avRandomizer.nextGaussian() * (double) p_147289_1_.func_149221_g(); + double var5 = this.avRandomizer.nextGaussian() * (double) p_147289_1_.func_149224_h(); + double var7 = this.avRandomizer.nextGaussian() * (double) p_147289_1_.func_149223_i(); + double var9 = this.avRandomizer.nextGaussian() * (double) p_147289_1_.func_149227_j(); + double var11 = this.avRandomizer.nextGaussian() * (double) p_147289_1_.func_149227_j(); + double var13 = this.avRandomizer.nextGaussian() * (double) p_147289_1_.func_149227_j(); + this.clientWorldController.spawnParticle(p_147289_1_.func_149228_c(), p_147289_1_.func_149220_d() + var3, p_147289_1_.func_149226_e() + var5, p_147289_1_.func_149225_f() + var7, var9, var11, var13); + } + } + } + + /** + * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player + * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie + * maxHealth and knockback resistance as well as reinforcement spawning chance. + */ + public void handleEntityProperties(S20PacketEntityProperties p_147290_1_) { + Entity var2 = this.clientWorldController.getEntityByID(p_147290_1_.func_149442_c()); + + if (var2 != null) { + if (!(var2 instanceof EntityLivingBase)) { + throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + var2 + ")"); + } else { + BaseAttributeMap var3 = ((EntityLivingBase) var2).getAttributeMap(); + Iterator var4 = p_147290_1_.func_149441_d().iterator(); + + while (var4.hasNext()) { + S20PacketEntityProperties.Snapshot var5 = (S20PacketEntityProperties.Snapshot) var4.next(); + IAttributeInstance var6 = var3.getAttributeInstanceByName(var5.func_151409_a()); + + if (var6 == null) { + var6 = var3.registerAttribute(new RangedAttribute(var5.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); + } + + var6.setBaseValue(var5.func_151410_b()); + var6.removeAllModifiers(); + Iterator var7 = var5.func_151408_c().iterator(); + + while (var7.hasNext()) { + AttributeModifier var8 = (AttributeModifier) var7.next(); + var6.applyModifier(var8); + } + } + } + } + } + + /** + * Returns this the NetworkManager instance registered with this NetworkHandlerPlayClient + */ + public NetworkManager getNetworkManager() { + return this.netManager; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/OldServerPinger.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/OldServerPinger.java new file mode 100644 index 0000000..899ebb0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/network/OldServerPinger.java @@ -0,0 +1,279 @@ +package net.minecraft.client.network; + +import com.google.common.base.Charsets; +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.mojang.authlib.GameProfile; +import io.netty.bootstrap.Bootstrap; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.*; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.util.concurrent.GenericFutureListener; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerAddress; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +public class OldServerPinger { + private static final Splitter field_147230_a = Splitter.on('\u0000').limit(6); + private static final Logger logger = LogManager.getLogger(); + private final List field_147229_c = Collections.synchronizedList(new ArrayList()); + + + public void func_147224_a(final ServerData p_147224_1_) throws UnknownHostException { + ServerAddress var2 = ServerAddress.func_78860_a(p_147224_1_.serverIP); + final NetworkManager var3 = NetworkManager.provideLanClient(InetAddress.getByName(var2.getIP()), var2.getPort()); + this.field_147229_c.add(var3); + p_147224_1_.serverMOTD = "Pinging..."; + p_147224_1_.pingToServer = -1L; + p_147224_1_.playerList = null; + var3.setNetHandler(new INetHandlerStatusClient() { + private boolean field_147403_d = false; + + public void handleServerInfo(S00PacketServerInfo p_147397_1_) { + ServerStatusResponse var2 = p_147397_1_.func_149294_c(); + p_147224_1_.lunarServer = var2.lcString != null; + + if (var2.func_151317_a() != null) { + p_147224_1_.serverMOTD = var2.func_151317_a().getFormattedText(); + } else { + p_147224_1_.serverMOTD = ""; + } + + if (var2.func_151322_c() != null) { + p_147224_1_.gameVersion = var2.func_151322_c().func_151303_a(); + p_147224_1_.version = var2.func_151322_c().func_151304_b(); + p_147224_1_.pinged = true; + } else { + p_147224_1_.gameVersion = "Old"; + p_147224_1_.version = 0; + } + + if (var2.func_151318_b() != null) { + p_147224_1_.populationInfo = EnumChatFormatting.GRAY + "" + var2.func_151318_b().func_151333_b() + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var2.func_151318_b().func_151332_a(); + + if (ArrayUtils.isNotEmpty(var2.func_151318_b().func_151331_c())) { + StringBuilder var3x = new StringBuilder(); + GameProfile[] var4 = var2.func_151318_b().func_151331_c(); + int var5 = var4.length; + + for (int var6 = 0; var6 < var5; ++var6) { + GameProfile var7 = var4[var6]; + + if (var3x.length() > 0) { + var3x.append("\n"); + } + + var3x.append(var7.getName()); + } + + if (var2.func_151318_b().func_151331_c().length < var2.func_151318_b().func_151333_b()) { + if (var3x.length() > 0) { + var3x.append("\n"); + } + + var3x.append("... and ").append(var2.func_151318_b().func_151333_b() - var2.func_151318_b().func_151331_c().length).append(" more ..."); + } + + p_147224_1_.playerList = var3x.toString(); + } + } else { + p_147224_1_.populationInfo = EnumChatFormatting.DARK_GRAY + "???"; + } + + if (var2.func_151316_d() != null) { + String var8 = var2.func_151316_d(); + + if (var8.startsWith("data:image/png;base64,")) { + p_147224_1_.setBase64EncodedIconData(var8.substring("data:image/png;base64,".length())); + } else { + OldServerPinger.logger.error("Invalid server icon (unknown format)"); + } + } else { + p_147224_1_.setBase64EncodedIconData(null); + } + + var3.scheduleOutboundPacket(new C01PacketPing(Minecraft.getSystemTime())); + this.field_147403_d = true; + } + public void handlePong(S01PacketPong p_147398_1_) { + long var2 = p_147398_1_.func_149292_c(); + long var4 = Minecraft.getSystemTime(); + p_147224_1_.pingToServer = var4 - var2; + var3.closeChannel(new ChatComponentText("Finished")); + } + public void onDisconnect(IChatComponent p_147231_1_) { + if (!this.field_147403_d) { + OldServerPinger.logger.error("Can't ping " + p_147224_1_.serverIP + ": " + p_147231_1_.getUnformattedText()); + p_147224_1_.serverMOTD = EnumChatFormatting.DARK_RED + "Can't connect to server."; + p_147224_1_.populationInfo = ""; + OldServerPinger.this.func_147225_b(p_147224_1_); + } + } + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + if (p_147232_2_ != EnumConnectionState.STATUS) { + throw new UnsupportedOperationException("Unexpected change in protocol to " + p_147232_2_); + } + } + public void onNetworkTick() {} + }); + + try { + var3.scheduleOutboundPacket(new C00Handshake(5, var2.getIP(), var2.getPort(), EnumConnectionState.STATUS)); + var3.scheduleOutboundPacket(new C00PacketServerQuery()); + } catch (Throwable var5) { + logger.error(var5); + } + } + + private void func_147225_b(final ServerData p_147225_1_) { + final ServerAddress var2 = ServerAddress.func_78860_a(p_147225_1_.serverIP); + (new Bootstrap()).group(NetworkManager.eventLoops).handler(new ChannelInitializer() { + + protected void initChannel(Channel p_initChannel_1_) { + try { + p_initChannel_1_.config().setOption(ChannelOption.IP_TOS, Integer.valueOf(24)); + } catch (ChannelException var4) { + } + + try { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, true); + } catch (ChannelException var3) { + } + + p_initChannel_1_.pipeline().addLast(new SimpleChannelInboundHandler() { + + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception { + super.channelActive(p_channelActive_1_); + ByteBuf var2x = Unpooled.buffer(); + + try { + var2x.writeByte(254); + var2x.writeByte(1); + var2x.writeByte(250); + char[] var3 = "MC|PingHost".toCharArray(); + var2x.writeShort(var3.length); + char[] var4 = var3; + int var5 = var3.length; + int var6; + char var7; + + for (var6 = 0; var6 < var5; ++var6) { + var7 = var4[var6]; + var2x.writeChar(var7); + } + + var2x.writeShort(7 + 2 * var2.getIP().length()); + var2x.writeByte(127); + var3 = var2.getIP().toCharArray(); + var2x.writeShort(var3.length); + var4 = var3; + var5 = var3.length; + + for (var6 = 0; var6 < var5; ++var6) { + var7 = var4[var6]; + var2x.writeChar(var7); + } + + var2x.writeInt(var2.getPort()); + p_channelActive_1_.channel().writeAndFlush(var2x).addListener(ChannelFutureListener.CLOSE_ON_FAILURE); + } + finally { + var2x.release(); + } + } + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, ByteBuf p_channelRead0_2_) { + short var3 = p_channelRead0_2_.readUnsignedByte(); + + if (var3 == 255) { + String var4 = new String(p_channelRead0_2_.readBytes(p_channelRead0_2_.readShort() * 2).array(), Charsets.UTF_16BE); + String[] var5 = Iterables.toArray(OldServerPinger.field_147230_a.split(var4), String.class); + + if ("\u00a71".equals(var5[0])) { + int var6 = MathHelper.parseIntWithDefault(var5[1], 0); + String var7 = var5[2]; + String var8 = var5[3]; + int var9 = MathHelper.parseIntWithDefault(var5[4], -1); + int var10 = MathHelper.parseIntWithDefault(var5[5], -1); + p_147225_1_.version = -1; + p_147225_1_.gameVersion = var7; + p_147225_1_.serverMOTD = var8; + p_147225_1_.populationInfo = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; + } + } + + p_channelRead0_1_.close(); + } + public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) { + p_exceptionCaught_1_.close(); + } + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Object p_channelRead0_2_) { + this.channelRead0(p_channelRead0_1_, (ByteBuf)p_channelRead0_2_); + } + }); + } + }).channel(NioSocketChannel.class).connect(var2.getIP(), var2.getPort()); + } + + public void func_147223_a() { + List var1 = this.field_147229_c; + + synchronized (this.field_147229_c) { + Iterator var2 = this.field_147229_c.iterator(); + + while (var2.hasNext()) { + NetworkManager var3 = (NetworkManager)var2.next(); + + if (var3.isChannelOpen()) { + var3.processReceivedPackets(); + } else { + var2.remove(); + + if (var3.getExitMessage() != null) { + var3.getNetHandler().onDisconnect(var3.getExitMessage()); + } + } + } + } + } + + public void func_147226_b() { + List var1 = this.field_147229_c; + + synchronized (this.field_147229_c) { + Iterator var2 = this.field_147229_c.iterator(); + + while (var2.hasNext()) { + NetworkManager var3 = (NetworkManager)var2.next(); + + if (var3.isChannelOpen()) { + var2.remove(); + var3.closeChannel(new ChatComponentText("Cancelled")); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EffectRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EffectRenderer.java new file mode 100644 index 0000000..6bf5aaf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EffectRenderer.java @@ -0,0 +1,264 @@ +package net.minecraft.client.particle; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleParticles; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; + +public class EffectRenderer { + private static final ResourceLocation particleTextures = new ResourceLocation("textures/particle/particles.png"); + + /** Reference to the World object. */ + protected World worldObj; + private final List[] fxLayers = new List[4]; + private final TextureManager renderer; + + /** RNG. */ + private final Random rand = new Random(); + + + public EffectRenderer(World p_i1220_1_, TextureManager p_i1220_2_) { + if (p_i1220_1_ != null) { + this.worldObj = p_i1220_1_; + } + + this.renderer = p_i1220_2_; + + for (int var3 = 0; var3 < 4; ++var3) { + this.fxLayers[var3] = new ArrayList(); + Minecraft.getMinecraft().cbLoadingScreen.addPhase(); + } + } + + public void addEffect(EntityFX p_78873_1_) { + int var2 = p_78873_1_.getFXLayer(); + + if (this.fxLayers[var2].size() >= 4000) { + this.fxLayers[var2].remove(0); + } + + this.fxLayers[var2].add(p_78873_1_); + } + + public void updateEffects() { + for (int var11 = 0; var11 < 4; ++var11) { + final int var1 = var11; + + for (int var2 = 0; var2 < this.fxLayers[var1].size(); ++var2) { + final EntityFX var3 = (EntityFX)this.fxLayers[var1].get(var2); + + try { + var3.onUpdate(); + } catch (Throwable var8) { + CrashReport var5 = CrashReport.makeCrashReport(var8, "Ticking Particle"); + CrashReportCategory var6 = var5.makeCategory("Particle being ticked"); + var6.addCrashSectionCallable("Particle", new Callable() { + + public String call() { + return var3.toString(); + } + }); + var6.addCrashSectionCallable("Particle Type", new Callable() { + + public String call() { + return var1 == 0 ? "MISC_TEXTURE" : (var1 == 1 ? "TERRAIN_TEXTURE" : (var1 == 2 ? "ITEM_TEXTURE" : (var1 == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + var1))); + } + }); + throw new ReportedException(var5); + } + + if (var3.isDead) { + this.fxLayers[var1].remove(var2--); + } + } + } + } + + /** + * Renders all current particles. Args player, partialTickTime + */ + public void renderParticles(Entity p_78874_1_, float p_78874_2_) { + float var3 = ActiveRenderInfo.rotationX; + float var4 = ActiveRenderInfo.rotationZ; + float var5 = ActiveRenderInfo.rotationYZ; + float var6 = ActiveRenderInfo.rotationXY; + float var7 = ActiveRenderInfo.rotationXZ; + EntityFX.interpPosX = p_78874_1_.lastTickPosX + (p_78874_1_.posX - p_78874_1_.lastTickPosX) * (double)p_78874_2_; + EntityFX.interpPosY = p_78874_1_.lastTickPosY + (p_78874_1_.posY - p_78874_1_.lastTickPosY) * (double)p_78874_2_; + EntityFX.interpPosZ = p_78874_1_.lastTickPosZ + (p_78874_1_.posZ - p_78874_1_.lastTickPosZ) * (double)p_78874_2_; + + for (int var88 = 0; var88 < 3; ++var88) { + final int var8 = var88; + + if (!this.fxLayers[var8].isEmpty()) { + switch (var8) { + case 0: + default: + this.renderer.bindTexture(particleTextures); + break; + + case 1: + this.renderer.bindTexture(TextureMap.locationBlocksTexture); + break; + + case 2: + this.renderer.bindTexture(TextureMap.locationItemsTexture); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + + for (int var10 = 0; var10 < this.fxLayers[var8].size(); ++var10) { + final EntityFX var11 = (EntityFX)this.fxLayers[var8].get(var10); + var9.setBrightness(var11.getBrightnessForRender(p_78874_2_)); + + try { + var11.renderParticle(var9, p_78874_2_, var3, var7, var4, var5, var6); + } catch (Throwable var16) { + CrashReport var13 = CrashReport.makeCrashReport(var16, "Rendering Particle"); + CrashReportCategory var14 = var13.makeCategory("Particle being rendered"); + var14.addCrashSectionCallable("Particle", new Callable() { + + public String call() { + return var11.toString(); + } + }); + var14.addCrashSectionCallable("Particle Type", new Callable() { + + public String call() { + return var8 == 0 ? "MISC_TEXTURE" : (var8 == 1 ? "TERRAIN_TEXTURE" : (var8 == 2 ? "ITEM_TEXTURE" : (var8 == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + var8))); + } + }); + throw new ReportedException(var13); + } + } + + var9.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + } + } + } + + public void renderLitParticles(Entity p_78872_1_, float p_78872_2_) { + float var3 = 0.017453292F; + float var4 = MathHelper.cos(p_78872_1_.rotationYaw * 0.017453292F); + float var5 = MathHelper.sin(p_78872_1_.rotationYaw * 0.017453292F); + float var6 = -var5 * MathHelper.sin(p_78872_1_.rotationPitch * 0.017453292F); + float var7 = var4 * MathHelper.sin(p_78872_1_.rotationPitch * 0.017453292F); + float var8 = MathHelper.cos(p_78872_1_.rotationPitch * 0.017453292F); + byte var9 = 3; + List var10 = this.fxLayers[var9]; + + if (!var10.isEmpty()) { + Tessellator var11 = Tessellator.instance; + + for (int var12 = 0; var12 < var10.size(); ++var12) { + EntityFX var13 = (EntityFX)var10.get(var12); + var11.setBrightness(var13.getBrightnessForRender(p_78872_2_)); + var13.renderParticle(var11, p_78872_2_, var4, var8, var5, var6, var7); + } + } + } + + public void clearEffects(World p_78870_1_) { + this.worldObj = p_78870_1_; + + for (int var2 = 0; var2 < 4; ++var2) { + this.fxLayers[var2].clear(); + } + } + + public void func_147215_a(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_) { + ModuleParticles mod = CheatBreaker.getInstance().getModuleManager().particlesMod; + if (mod.isEnabled() && !mod.blockBreakingParticles.getBooleanValue()) { + return; + } + if (p_147215_4_.getMaterial() != Material.air) { + byte var6 = 4; + + for (int var7 = 0; var7 < var6; ++var7) { + for (int var8 = 0; var8 < var6; ++var8) { + for (int var9 = 0; var9 < var6; ++var9) { + double var10 = (double)p_147215_1_ + ((double)var7 + 0.5D) / (double)var6; + double var12 = (double)p_147215_2_ + ((double)var8 + 0.5D) / (double)var6; + double var14 = (double)p_147215_3_ + ((double)var9 + 0.5D) / (double)var6; + this.addEffect((new EntityDiggingFX(this.worldObj, var10, var12, var14, var10 - (double)p_147215_1_ - 0.5D, var12 - (double)p_147215_2_ - 0.5D, var14 - (double)p_147215_3_ - 0.5D, p_147215_4_, p_147215_5_)).applyColourMultiplier(p_147215_1_, p_147215_2_, p_147215_3_)); + } + } + } + } + } + + /** + * Adds block hit particles for the specified block. Args: x, y, z, sideHit + */ + public void addBlockHitEffects(int p_78867_1_, int p_78867_2_, int p_78867_3_, int p_78867_4_) { + ModuleParticles mod = CheatBreaker.getInstance().getModuleManager().particlesMod; + if (mod.isEnabled() && !mod.blockBreakingParticles.getBooleanValue()) { + return; + } + Block var5 = this.worldObj.getBlock(p_78867_1_, p_78867_2_, p_78867_3_); + + if (var5.getMaterial() != Material.air) { + float var6 = 0.1F; + double var7 = (double)p_78867_1_ + this.rand.nextDouble() * (var5.getBlockBoundsMaxX() - var5.getBlockBoundsMinX() - (double)(var6 * 2.0F)) + (double)var6 + var5.getBlockBoundsMinX(); + double var9 = (double)p_78867_2_ + this.rand.nextDouble() * (var5.getBlockBoundsMaxY() - var5.getBlockBoundsMinY() - (double)(var6 * 2.0F)) + (double)var6 + var5.getBlockBoundsMinY(); + double var11 = (double)p_78867_3_ + this.rand.nextDouble() * (var5.getBlockBoundsMaxZ() - var5.getBlockBoundsMinZ() - (double)(var6 * 2.0F)) + (double)var6 + var5.getBlockBoundsMinZ(); + + if (p_78867_4_ == 0) { + var9 = (double)p_78867_2_ + var5.getBlockBoundsMinY() - (double)var6; + } + + if (p_78867_4_ == 1) { + var9 = (double)p_78867_2_ + var5.getBlockBoundsMaxY() + (double)var6; + } + + if (p_78867_4_ == 2) { + var11 = (double)p_78867_3_ + var5.getBlockBoundsMinZ() - (double)var6; + } + + if (p_78867_4_ == 3) { + var11 = (double)p_78867_3_ + var5.getBlockBoundsMaxZ() + (double)var6; + } + + if (p_78867_4_ == 4) { + var7 = (double)p_78867_1_ + var5.getBlockBoundsMinX() - (double)var6; + } + + if (p_78867_4_ == 5) { + var7 = (double)p_78867_1_ + var5.getBlockBoundsMaxX() + (double)var6; + } + + this.addEffect((new EntityDiggingFX(this.worldObj, var7, var9, var11, 0.0D, 0.0D, 0.0D, var5, this.worldObj.getBlockMetadata(p_78867_1_, p_78867_2_, p_78867_3_))).applyColourMultiplier(p_78867_1_, p_78867_2_, p_78867_3_).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); + } + } + + public String getStatistics() { + return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityAuraFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityAuraFX.java new file mode 100644 index 0000000..ab7b13e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityAuraFX.java @@ -0,0 +1,40 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityAuraFX extends EntityFX { + + + public EntityAuraFX(World p_i1232_1_, double p_i1232_2_, double p_i1232_4_, double p_i1232_6_, double p_i1232_8_, double p_i1232_10_, double p_i1232_12_) { + super(p_i1232_1_, p_i1232_2_, p_i1232_4_, p_i1232_6_, p_i1232_8_, p_i1232_10_, p_i1232_12_); + float var14 = this.rand.nextFloat() * 0.1F + 0.2F; + this.particleRed = var14; + this.particleGreen = var14; + this.particleBlue = var14; + this.setParticleTextureIndex(0); + this.setSize(0.02F, 0.02F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.5F; + this.motionX *= 0.019999999552965164D; + this.motionY *= 0.019999999552965164D; + this.motionZ *= 0.019999999552965164D; + this.particleMaxAge = (int)(20.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = true; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.99D; + this.motionY *= 0.99D; + this.motionZ *= 0.99D; + + if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java new file mode 100644 index 0000000..2e52b44 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBlockDustFX.java @@ -0,0 +1,15 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class EntityBlockDustFX extends EntityDiggingFX { + + + public EntityBlockDustFX(World p_i45072_1_, double p_i45072_2_, double p_i45072_4_, double p_i45072_6_, double p_i45072_8_, double p_i45072_10_, double p_i45072_12_, Block p_i45072_14_, int p_i45072_15_) { + super(p_i45072_1_, p_i45072_2_, p_i45072_4_, p_i45072_6_, p_i45072_8_, p_i45072_10_, p_i45072_12_, p_i45072_14_, p_i45072_15_); + this.motionX = p_i45072_8_; + this.motionY = p_i45072_10_; + this.motionZ = p_i45072_12_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java new file mode 100644 index 0000000..c13094c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBreakingFX.java @@ -0,0 +1,60 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.world.World; + +public class EntityBreakingFX extends EntityFX { + + + public EntityBreakingFX(World p_i1195_1_, double p_i1195_2_, double p_i1195_4_, double p_i1195_6_, Item p_i1195_8_) { + this(p_i1195_1_, p_i1195_2_, p_i1195_4_, p_i1195_6_, p_i1195_8_, 0); + } + + public EntityBreakingFX(World p_i1196_1_, double p_i1196_2_, double p_i1196_4_, double p_i1196_6_, Item p_i1196_8_, int p_i1196_9_) { + super(p_i1196_1_, p_i1196_2_, p_i1196_4_, p_i1196_6_, 0.0D, 0.0D, 0.0D); + this.setParticleIcon(p_i1196_8_.getIconFromDamage(p_i1196_9_)); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleGravity = Blocks.snow.blockParticleGravity; + this.particleScale /= 2.0F; + } + + public EntityBreakingFX(World p_i1197_1_, double p_i1197_2_, double p_i1197_4_, double p_i1197_6_, double p_i1197_8_, double p_i1197_10_, double p_i1197_12_, Item p_i1197_14_, int p_i1197_15_) { + this(p_i1197_1_, p_i1197_2_, p_i1197_4_, p_i1197_6_, p_i1197_14_, p_i1197_15_); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1197_8_; + this.motionY += p_i1197_10_; + this.motionZ += p_i1197_12_; + } + + public int getFXLayer() { + return 2; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float var9 = var8 + 0.015609375F; + float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float var11 = var10 + 0.015609375F; + float var12 = 0.1F * this.particleScale; + + if (this.particleIcon != null) { + var8 = this.particleIcon.getInterpolatedU(this.particleTextureJitterX / 4.0F * 16.0F); + var9 = this.particleIcon.getInterpolatedU((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F); + var10 = this.particleIcon.getInterpolatedV(this.particleTextureJitterY / 4.0F * 16.0F); + var11 = this.particleIcon.getInterpolatedV((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F); + } + + float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 - p_70539_5_ * var12 - p_70539_7_ * var12, var8, var11); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 - p_70539_5_ * var12 + p_70539_7_ * var12, var8, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 + p_70539_5_ * var12 + p_70539_7_ * var12, var9, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 + p_70539_5_ * var12 - p_70539_7_ * var12, var9, var11); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java new file mode 100644 index 0000000..8cdcf22 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityBubbleFX.java @@ -0,0 +1,45 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBubbleFX extends EntityFX { + + + public EntityBubbleFX(World p_i1198_1_, double p_i1198_2_, double p_i1198_4_, double p_i1198_6_, double p_i1198_8_, double p_i1198_10_, double p_i1198_12_) { + super(p_i1198_1_, p_i1198_2_, p_i1198_4_, p_i1198_6_, p_i1198_8_, p_i1198_10_, p_i1198_12_); + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(32); + this.setSize(0.02F, 0.02F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; + this.motionX = p_i1198_8_ * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); + this.motionY = p_i1198_10_ * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); + this.motionZ = p_i1198_12_ * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY += 0.002D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8500000238418579D; + this.motionY *= 0.8500000238418579D; + this.motionZ *= 0.8500000238418579D; + + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() != Material.water) { + this.setDead(); + } + + if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCloudFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCloudFX.java new file mode 100644 index 0000000..b77485b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCloudFX.java @@ -0,0 +1,74 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class EntityCloudFX extends EntityFX { + float field_70569_a; + + + public EntityCloudFX(World p_i1221_1_, double p_i1221_2_, double p_i1221_4_, double p_i1221_6_, double p_i1221_8_, double p_i1221_10_, double p_i1221_12_) { + super(p_i1221_1_, p_i1221_2_, p_i1221_4_, p_i1221_6_, 0.0D, 0.0D, 0.0D); + float var14 = 2.5F; + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1221_8_; + this.motionY += p_i1221_10_; + this.motionZ += p_i1221_12_; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= var14; + this.field_70569_a = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.3D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * var14); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.field_70569_a * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, 2.0D); + + if (var1 != null && this.posY > var1.boundingBox.minY) { + this.posY += (var1.boundingBox.minY - this.posY) * 0.2D; + this.motionY += (var1.motionY - this.motionY) * 0.2D; + this.setPosition(this.posX, this.posY, this.posZ); + } + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java new file mode 100644 index 0000000..c95ee74 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java @@ -0,0 +1,67 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public class EntityCrit2FX extends EntityFX { + /** Entity that had been hit and done the Critical hit on. */ + private final Entity theEntity; + private int currentLife; + private final int maximumLife; + private final String particleName; + private final float multiplier; + + + public EntityCrit2FX(World p_i1199_1_, Entity p_i1199_2_) { + this(p_i1199_1_, p_i1199_2_, "crit"); + } + + public EntityCrit2FX(World p_i1200_1_, Entity p_i1200_2_, String p_i1200_3_) { + super(p_i1200_1_, p_i1200_2_.posX, p_i1200_2_.boundingBox.minY + (double)(p_i1200_2_.height / 2.0F), p_i1200_2_.posZ, p_i1200_2_.motionX, p_i1200_2_.motionY, p_i1200_2_.motionZ); + this.theEntity = p_i1200_2_; + this.maximumLife = 3; + this.particleName = p_i1200_3_; + this.multiplier = 1.0F; + this.onUpdate(); + } + + public EntityCrit2FX(World p_i1200_1_, Entity p_i1200_2_, String p_i1200_3_, float multiplier) { + super(p_i1200_1_, p_i1200_2_.posX, p_i1200_2_.boundingBox.minY + (double)(p_i1200_2_.height / 2.0F), p_i1200_2_.posZ, p_i1200_2_.motionX, p_i1200_2_.motionY, p_i1200_2_.motionZ); + this.theEntity = p_i1200_2_; + this.maximumLife = 3; + this.particleName = p_i1200_3_; + this.multiplier = multiplier; + this.onUpdate(); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + for (int var1 = 0; var1 < (16.0F * this.multiplier); ++var1) { + double var2 = this.rand.nextFloat() * 2.0F - 1.0F; + double var4 = this.rand.nextFloat() * 2.0F - 1.0F; + double var6 = this.rand.nextFloat() * 2.0F - 1.0F; + + if (var2 * var2 + var4 * var4 + var6 * var6 <= 1.0D) { + double var8 = this.theEntity.posX + var2 * (double)this.theEntity.width / 4.0D; + double var10 = this.theEntity.boundingBox.minY + (double)(this.theEntity.height / 2.0F) + var4 * (double)this.theEntity.height / 4.0D; + double var12 = this.theEntity.posZ + var6 * (double)this.theEntity.width / 4.0D; + this.worldObj.spawnParticle(this.particleName, var8, var10, var12, var2, var4 + 0.2D, var6); + } + } + + ++this.currentLife; + + if (this.currentLife >= this.maximumLife) { + this.setDead(); + } + } + + public int getFXLayer() { + return 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCritFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCritFX.java new file mode 100644 index 0000000..d24701a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityCritFX.java @@ -0,0 +1,73 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntityCritFX extends EntityFX { + float initialParticleScale; + + + public EntityCritFX(World p_i1201_1_, double p_i1201_2_, double p_i1201_4_, double p_i1201_6_, double p_i1201_8_, double p_i1201_10_, double p_i1201_12_) { + this(p_i1201_1_, p_i1201_2_, p_i1201_4_, p_i1201_6_, p_i1201_8_, p_i1201_10_, p_i1201_12_, 1.0F); + } + + public EntityCritFX(World p_i1202_1_, double p_i1202_2_, double p_i1202_4_, double p_i1202_6_, double p_i1202_8_, double p_i1202_10_, double p_i1202_12_, float p_i1202_14_) { + super(p_i1202_1_, p_i1202_2_, p_i1202_4_, p_i1202_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1202_8_ * 0.4D; + this.motionY += p_i1202_10_ * 0.4D; + this.motionZ += p_i1202_12_ * 0.4D; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D); + this.particleScale *= 0.75F; + this.particleScale *= p_i1202_14_; + this.initialParticleScale = this.particleScale; + this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1202_14_); + this.noClip = false; + this.setParticleTextureIndex(65); + this.onUpdate(); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.initialParticleScale * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.particleGreen = (float)((double)this.particleGreen * 0.96D); + this.particleBlue = (float)((double)this.particleBlue * 0.9D); + this.motionX *= 0.699999988079071D; + this.motionY *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY -= 0.019999999552965164D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java new file mode 100644 index 0000000..5abd7ba --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityDiggingFX.java @@ -0,0 +1,78 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class EntityDiggingFX extends EntityFX { + private final Block field_145784_a; + + + public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_) { + super(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_); + this.field_145784_a = p_i1234_14_; + this.setParticleIcon(p_i1234_14_.getIcon(0, p_i1234_15_)); + this.particleGravity = p_i1234_14_.blockParticleGravity; + this.particleRed = this.particleGreen = this.particleBlue = 0.6F; + this.particleScale /= 2.0F; + } + + /** + * If the block has a colour multiplier, copies it to this particle and returns this particle. + */ + public EntityDiggingFX applyColourMultiplier(int p_70596_1_, int p_70596_2_, int p_70596_3_) { + if (this.field_145784_a == Blocks.grass) { + return this; + } else { + int var4 = this.field_145784_a.colorMultiplier(this.worldObj, p_70596_1_, p_70596_2_, p_70596_3_); + this.particleRed *= (float)(var4 >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(var4 >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(var4 & 255) / 255.0F; + return this; + } + } + + /** + * Creates a new EntityDiggingFX with the block render color applied to the base particle color + */ + public EntityDiggingFX applyRenderColor(int p_90019_1_) { + if (this.field_145784_a == Blocks.grass) { + return this; + } else { + int var2 = this.field_145784_a.getRenderColor(p_90019_1_); + this.particleRed *= (float)(var2 >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(var2 >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(var2 & 255) / 255.0F; + return this; + } + } + + public int getFXLayer() { + return 1; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float var9 = var8 + 0.015609375F; + float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float var11 = var10 + 0.015609375F; + float var12 = 0.1F * this.particleScale; + + if (this.particleIcon != null) { + var8 = this.particleIcon.getInterpolatedU(this.particleTextureJitterX / 4.0F * 16.0F); + var9 = this.particleIcon.getInterpolatedU((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F); + var10 = this.particleIcon.getInterpolatedV(this.particleTextureJitterY / 4.0F * 16.0F); + var11 = this.particleIcon.getInterpolatedV((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F); + } + + float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 - p_70539_5_ * var12 - p_70539_7_ * var12, var8, var11); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 - p_70539_5_ * var12 + p_70539_7_ * var12, var8, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 + p_70539_5_ * var12 + p_70539_7_ * var12, var9, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 + p_70539_5_ * var12 - p_70539_7_ * var12, var9, var11); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java new file mode 100644 index 0000000..e8f3ecf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityDropParticleFX.java @@ -0,0 +1,110 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityDropParticleFX extends EntityFX { + /** the material type for dropped items/blocks */ + private final Material materialType; + + /** The height of the current bob */ + private int bobTimer; + + + public EntityDropParticleFX(World p_i1203_1_, double p_i1203_2_, double p_i1203_4_, double p_i1203_6_, Material p_i1203_8_) { + super(p_i1203_1_, p_i1203_2_, p_i1203_4_, p_i1203_6_, 0.0D, 0.0D, 0.0D); + this.motionX = this.motionY = this.motionZ = 0.0D; + + if (p_i1203_8_ == Material.water) { + this.particleRed = 0.0F; + this.particleGreen = 0.0F; + this.particleBlue = 1.0F; + } else { + this.particleRed = 1.0F; + this.particleGreen = 0.0F; + this.particleBlue = 0.0F; + } + + this.setParticleTextureIndex(113); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; + this.materialType = p_i1203_8_; + this.bobTimer = 40; + this.particleMaxAge = (int)(64.0D / (Math.random() * 0.8D + 0.2D)); + this.motionX = this.motionY = this.motionZ = 0.0D; + } + + public int getBrightnessForRender(float p_70070_1_) { + return this.materialType == Material.water ? super.getBrightnessForRender(p_70070_1_) : 257; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return this.materialType == Material.water ? super.getBrightness(p_70013_1_) : 1.0F; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.materialType == Material.water) { + this.particleRed = 0.2F; + this.particleGreen = 0.3F; + this.particleBlue = 1.0F; + } else { + this.particleRed = 1.0F; + this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); + this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); + } + + this.motionY -= this.particleGravity; + + if (this.bobTimer-- > 0) { + this.motionX *= 0.02D; + this.motionY *= 0.02D; + this.motionZ *= 0.02D; + this.setParticleTextureIndex(113); + } else { + this.setParticleTextureIndex(112); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + + if (this.onGround) { + if (this.materialType == Material.water) { + this.setDead(); + this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } else { + this.setParticleTextureIndex(114); + } + + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + Material var1 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial(); + + if (var1.isLiquid() || var1.isSolid()) { + double var2 = (float)(MathHelper.floor_double(this.posY) + 1) - BlockLiquid.func_149801_b(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); + + if (this.posY < var2) { + this.setDead(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java new file mode 100644 index 0000000..ff773cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java @@ -0,0 +1,77 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityEnchantmentTableParticleFX extends EntityFX { + private final float field_70565_a; + private final double field_70568_aq; + private final double field_70567_ar; + private final double field_70566_as; + + + public EntityEnchantmentTableParticleFX(World p_i1204_1_, double p_i1204_2_, double p_i1204_4_, double p_i1204_6_, double p_i1204_8_, double p_i1204_10_, double p_i1204_12_) { + super(p_i1204_1_, p_i1204_2_, p_i1204_4_, p_i1204_6_, p_i1204_8_, p_i1204_10_, p_i1204_12_); + this.motionX = p_i1204_8_; + this.motionY = p_i1204_10_; + this.motionZ = p_i1204_12_; + this.field_70568_aq = this.posX = p_i1204_2_; + this.field_70567_ar = this.posY = p_i1204_4_; + this.field_70566_as = this.posZ = p_i1204_6_; + float var14 = this.rand.nextFloat() * 0.6F + 0.4F; + this.field_70565_a = this.particleScale = this.rand.nextFloat() * 0.5F + 0.2F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; + this.particleGreen *= 0.9F; + this.particleRed *= 0.9F; + this.particleMaxAge = (int)(Math.random() * 10.0D) + 30; + this.noClip = true; + this.setParticleTextureIndex((int)(Math.random() * 26.0D + 1.0D + 224.0D)); + } + + public int getBrightnessForRender(float p_70070_1_) { + int var2 = super.getBrightnessForRender(p_70070_1_); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 *= var3; + var3 *= var3; + int var4 = var2 & 255; + int var5 = var2 >> 16 & 255; + var5 += (int)(var3 * 15.0F * 16.0F); + + if (var5 > 240) { + var5 = 240; + } + + return var4 | var5 << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + float var2 = super.getBrightness(p_70013_1_); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 *= var3; + var3 *= var3; + return var2 * (1.0F - var3) + var3; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + float var1 = (float)this.particleAge / (float)this.particleMaxAge; + var1 = 1.0F - var1; + float var2 = 1.0F - var1; + var2 *= var2; + var2 *= var2; + this.posX = this.field_70568_aq + this.motionX * (double)var1; + this.posY = this.field_70567_ar + this.motionY * (double)var1 - (double)(var2 * 1.2F); + this.posZ = this.field_70566_as + this.motionZ * (double)var1; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java new file mode 100644 index 0000000..bdc1e7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityExplodeFX.java @@ -0,0 +1,42 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityExplodeFX extends EntityFX { + + + public EntityExplodeFX(World p_i1205_1_, double p_i1205_2_, double p_i1205_4_, double p_i1205_6_, double p_i1205_8_, double p_i1205_10_, double p_i1205_12_) { + super(p_i1205_1_, p_i1205_2_, p_i1205_4_, p_i1205_6_, p_i1205_8_, p_i1205_10_, p_i1205_12_); + this.motionX = p_i1205_8_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.motionY = p_i1205_10_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.motionZ = p_i1205_12_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; + this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; + this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8999999761581421D; + this.motionY *= 0.8999999761581421D; + this.motionZ *= 0.8999999761581421D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFX.java new file mode 100644 index 0000000..0276df1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFX.java @@ -0,0 +1,220 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFX extends Entity { + protected int particleTextureIndexX; + protected int particleTextureIndexY; + protected float particleTextureJitterX; + protected float particleTextureJitterY; + protected int particleAge; + protected int particleMaxAge; + protected float particleScale; + protected float particleGravity; + + /** The red amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. */ + protected float particleRed; + + /** + * The green amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. + */ + protected float particleGreen; + + /** + * The blue amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. + */ + protected float particleBlue; + + /** Particle alpha */ + protected float particleAlpha; + + /** The icon field from which the given particle pulls its texture. */ + protected IIcon particleIcon; + public static double interpPosX; + public static double interpPosY; + public static double interpPosZ; + + + protected EntityFX(World p_i46352_1_, double p_i46352_2_, double p_i46352_4_, double p_i46352_6_) { + super(p_i46352_1_); + this.particleAlpha = 1.0F; + this.setSize(0.2F, 0.2F); + this.yOffset = this.height / 2.0F; + this.setPosition(p_i46352_2_, p_i46352_4_, p_i46352_6_); + this.lastTickPosX = p_i46352_2_; + this.lastTickPosY = p_i46352_4_; + this.lastTickPosZ = p_i46352_6_; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleTextureJitterX = this.rand.nextFloat() * 3.0F; + this.particleTextureJitterY = this.rand.nextFloat() * 3.0F; + this.particleScale = (this.rand.nextFloat() * 0.5F + 0.5F) * 2.0F; + this.particleMaxAge = (int)(4.0F / (this.rand.nextFloat() * 0.9F + 0.1F)); + this.particleAge = 0; + } + + public EntityFX(World p_i1219_1_, double p_i1219_2_, double p_i1219_4_, double p_i1219_6_, double p_i1219_8_, double p_i1219_10_, double p_i1219_12_) { + this(p_i1219_1_, p_i1219_2_, p_i1219_4_, p_i1219_6_); + this.motionX = p_i1219_8_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); + this.motionY = p_i1219_10_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); + this.motionZ = p_i1219_12_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); + float var14 = (float)(Math.random() + Math.random() + 1.0D) * 0.15F; + float var15 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.motionX = this.motionX / (double)var15 * (double)var14 * 0.4000000059604645D; + this.motionY = this.motionY / (double)var15 * (double)var14 * 0.4000000059604645D + 0.10000000149011612D; + this.motionZ = this.motionZ / (double)var15 * (double)var14 * 0.4000000059604645D; + } + + public EntityFX multiplyVelocity(float p_70543_1_) { + this.motionX *= p_70543_1_; + this.motionY = (this.motionY - 0.10000000149011612D) * (double)p_70543_1_ + 0.10000000149011612D; + this.motionZ *= p_70543_1_; + return this; + } + + public EntityFX multipleParticleScaleBy(float p_70541_1_) { + this.setSize(0.2F * p_70541_1_, 0.2F * p_70541_1_); + this.particleScale *= p_70541_1_; + return this; + } + + public void setRBGColorF(float p_70538_1_, float p_70538_2_, float p_70538_3_) { + this.particleRed = p_70538_1_; + this.particleGreen = p_70538_2_; + this.particleBlue = p_70538_3_; + } + + /** + * Sets the particle alpha (float) + */ + public void setAlphaF(float p_82338_1_) { + this.particleAlpha = p_82338_1_; + } + + public float getRedColorF() { + return this.particleRed; + } + + public float getGreenColorF() { + return this.particleGreen; + } + + public float getBlueColorF() { + return this.particleBlue; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.motionY -= 0.04D * (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = (float)this.particleTextureIndexX / 16.0F; + float var9 = var8 + 0.0624375F; + float var10 = (float)this.particleTextureIndexY / 16.0F; + float var11 = var10 + 0.0624375F; + float var12 = 0.1F * this.particleScale; + + if (this.particleIcon != null) { + var8 = this.particleIcon.getMinU(); + var9 = this.particleIcon.getMaxU(); + var10 = this.particleIcon.getMinV(); + var11 = this.particleIcon.getMaxV(); + } + + float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 - p_70539_5_ * var12 - p_70539_7_ * var12, var9, var11); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 - p_70539_5_ * var12 + p_70539_7_ * var12, var9, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 + p_70539_5_ * var12 + p_70539_7_ * var12, var8, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 + p_70539_5_ * var12 - p_70539_7_ * var12, var8, var11); + } + + public int getFXLayer() { + return 0; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) {} + + public void setParticleIcon(IIcon p_110125_1_) { + if (this.getFXLayer() == 1) { + this.particleIcon = p_110125_1_; + } else { + if (this.getFXLayer() != 2) { + throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); + } + + this.particleIcon = p_110125_1_; + } + } + + /** + * Public method to set private field particleTextureIndex. + */ + public void setParticleTextureIndex(int p_70536_1_) { + if (this.getFXLayer() != 0) { + throw new RuntimeException("Invalid call to Particle.setMiscTex"); + } else { + this.particleTextureIndexX = p_70536_1_ % 16; + this.particleTextureIndexY = p_70536_1_ / 16; + } + } + + public void nextTextureIndexX() { + ++this.particleTextureIndexX; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() { + return false; + } + + public String toString() { + return this.getClass().getSimpleName() + ", Pos (" + this.posX + "," + this.posY + "," + this.posZ + "), RGBA (" + this.particleRed + "," + this.particleGreen + "," + this.particleBlue + "," + this.particleAlpha + "), Age " + this.particleAge; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkOverlayFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkOverlayFX.java new file mode 100644 index 0000000..43ed49e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkOverlayFX.java @@ -0,0 +1,31 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFireworkOverlayFX extends EntityFX { + + + protected EntityFireworkOverlayFX(World p_i46357_1_, double p_i46357_2_, double p_i46357_4_, double p_i46357_6_) { + super(p_i46357_1_, p_i46357_2_, p_i46357_4_, p_i46357_6_); + this.particleMaxAge = 4; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = 0.25F; + float var9 = var8 + 0.25F; + float var10 = 0.125F; + float var11 = var10 + 0.25F; + float var12 = 7.1F * MathHelper.sin(((float)this.particleAge + p_70539_2_ - 1.0F) * 0.25F * (float)Math.PI); + this.particleAlpha = 0.6F - ((float)this.particleAge + p_70539_2_ - 1.0F) * 0.25F * 0.5F; + float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 - p_70539_5_ * var12 - p_70539_7_ * var12, var9, var11); + p_70539_1_.addVertexWithUV(var13 - p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 - p_70539_5_ * var12 + p_70539_7_ * var12, var9, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 + p_70539_6_ * var12, var14 + p_70539_4_ * var12, var15 + p_70539_5_ * var12 + p_70539_7_ * var12, var8, var10); + p_70539_1_.addVertexWithUV(var13 + p_70539_3_ * var12 - p_70539_6_ * var12, var14 - p_70539_4_ * var12, var15 + p_70539_5_ * var12 - p_70539_7_ * var12, var8, var11); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkSparkFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkSparkFX.java new file mode 100644 index 0000000..c208893 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkSparkFX.java @@ -0,0 +1,133 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class EntityFireworkSparkFX extends EntityFX { + private final int baseTextureIndex = 160; + private boolean field_92054_ax; + private boolean field_92048_ay; + private final EffectRenderer field_92047_az; + private float fadeColourRed; + private float fadeColourGreen; + private float fadeColourBlue; + private boolean hasFadeColour; + + + public EntityFireworkSparkFX(World p_i46356_1_, double p_i46356_2_, double p_i46356_4_, double p_i46356_6_, double p_i46356_8_, double p_i46356_10_, double p_i46356_12_, EffectRenderer p_i46356_14_) { + super(p_i46356_1_, p_i46356_2_, p_i46356_4_, p_i46356_6_); + this.motionX = p_i46356_8_; + this.motionY = p_i46356_10_; + this.motionZ = p_i46356_12_; + this.field_92047_az = p_i46356_14_; + this.particleScale *= 0.75F; + this.particleMaxAge = 48 + this.rand.nextInt(12); + this.noClip = false; + } + + public void setTrail(boolean p_92045_1_) { + this.field_92054_ax = p_92045_1_; + } + + public void setTwinkle(boolean p_92043_1_) { + this.field_92048_ay = p_92043_1_; + } + + public void setColour(int p_92044_1_) { + float var2 = (float)((p_92044_1_ & 16711680) >> 16) / 255.0F; + float var3 = (float)((p_92044_1_ & 65280) >> 8) / 255.0F; + float var4 = (float)((p_92044_1_ & 255) >> 0) / 255.0F; + float var5 = 1.0F; + this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5); + } + + public void setFadeColour(int p_92046_1_) { + this.fadeColourRed = (float)((p_92046_1_ & 16711680) >> 16) / 255.0F; + this.fadeColourGreen = (float)((p_92046_1_ & 65280) >> 8) / 255.0F; + this.fadeColourBlue = (float)((p_92046_1_ & 255) >> 0) / 255.0F; + this.hasFadeColour = true; + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() { + return null; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() { + return false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) { + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + if (this.particleAge > this.particleMaxAge / 2) { + this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge); + + if (this.hasFadeColour) { + this.particleRed += (this.fadeColourRed - this.particleRed) * 0.2F; + this.particleGreen += (this.fadeColourGreen - this.particleGreen) * 0.2F; + this.particleBlue += (this.fadeColourBlue - this.particleBlue) * 0.2F; + } + } + + this.setParticleTextureIndex(this.baseTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY -= 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9100000262260437D; + this.motionY *= 0.9100000262260437D; + this.motionZ *= 0.9100000262260437D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) { + EntityFireworkSparkFX var1 = new EntityFireworkSparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az); + var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue); + var1.particleAge = var1.particleMaxAge / 2; + + if (this.hasFadeColour) { + var1.hasFadeColour = true; + var1.fadeColourRed = this.fadeColourRed; + var1.fadeColourGreen = this.fadeColourGreen; + var1.fadeColourBlue = this.fadeColourBlue; + } + + var1.field_92048_ay = this.field_92048_ay; + this.field_92047_az.addEffect(var1); + } + } + + public int getBrightnessForRender(float p_70070_1_) { + return 15728880; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return 1.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkStarterFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkStarterFX.java new file mode 100644 index 0000000..4a735a8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFireworkStarterFX.java @@ -0,0 +1,222 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFireworkStarterFX extends EntityFX { + private int fireworkAge; + private final EffectRenderer theEffectRenderer; + private NBTTagList fireworkExplosions; + boolean twinkle; + + + public EntityFireworkStarterFX(World p_i46355_1_, double p_i46355_2_, double p_i46355_4_, double p_i46355_6_, double p_i46355_8_, double p_i46355_10_, double p_i46355_12_, EffectRenderer p_i46355_14_, NBTTagCompound p_i46355_15_) { + super(p_i46355_1_, p_i46355_2_, p_i46355_4_, p_i46355_6_, 0.0D, 0.0D, 0.0D); + this.motionX = p_i46355_8_; + this.motionY = p_i46355_10_; + this.motionZ = p_i46355_12_; + this.theEffectRenderer = p_i46355_14_; + this.particleMaxAge = 8; + + if (p_i46355_15_ != null) { + this.fireworkExplosions = p_i46355_15_.getTagList("Explosions", 10); + + if (this.fireworkExplosions.tagCount() == 0) { + this.fireworkExplosions = null; + } else { + this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1; + + for (int var16 = 0; var16 < this.fireworkExplosions.tagCount(); ++var16) { + NBTTagCompound var17 = this.fireworkExplosions.getCompoundTagAt(var16); + + if (var17.getBoolean("Flicker")) { + this.twinkle = true; + this.particleMaxAge += 15; + break; + } + } + } + } + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + boolean var1; + + if (this.fireworkAge == 0 && this.fireworkExplosions != null) { + var1 = this.func_92037_i(); + boolean var2 = false; + + if (this.fireworkExplosions.tagCount() >= 3) { + var2 = true; + } else { + for (int var3 = 0; var3 < this.fireworkExplosions.tagCount(); ++var3) { + NBTTagCompound var4 = this.fireworkExplosions.getCompoundTagAt(var3); + + if (var4.getByte("Type") == 1) { + var2 = true; + break; + } + } + } + + String var16 = "fireworks." + (var2 ? "largeBlast" : "blast") + (var1 ? "_far" : ""); + this.worldObj.playSound(this.posX, this.posY, this.posZ, var16, 20.0F, 0.95F + this.rand.nextFloat() * 0.1F, true); + } + + if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) { + int var13 = this.fireworkAge / 2; + NBTTagCompound var14 = this.fireworkExplosions.getCompoundTagAt(var13); + byte var17 = var14.getByte("Type"); + boolean var18 = var14.getBoolean("Trail"); + boolean var5 = var14.getBoolean("Flicker"); + int[] var6 = var14.getIntArray("Colors"); + int[] var7 = var14.getIntArray("FadeColors"); + + if (var17 == 1) { + this.createBall(0.5D, 4, var6, var7, var18, var5); + } else if (var17 == 2) { + this.createShaped(0.5D, new double[][] {{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, var6, var7, var18, var5, false); + } else if (var17 == 3) { + this.createShaped(0.5D, new double[][] {{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, var6, var7, var18, var5, true); + } else if (var17 == 4) { + this.createBurst(var6, var7, var18, var5); + } else { + this.createBall(0.25D, 2, var6, var7, var18, var5); + } + + int var8 = var6[0]; + float var9 = (float)((var8 & 16711680) >> 16) / 255.0F; + float var10 = (float)((var8 & 65280) >> 8) / 255.0F; + float var11 = (float)((var8 & 255) >> 0) / 255.0F; + EntityFireworkOverlayFX var12 = new EntityFireworkOverlayFX(this.worldObj, this.posX, this.posY, this.posZ); + var12.setRBGColorF(var9, var10, var11); + this.theEffectRenderer.addEffect(var12); + } + + ++this.fireworkAge; + + if (this.fireworkAge > this.particleMaxAge) { + if (this.twinkle) { + var1 = this.func_92037_i(); + String var15 = "fireworks." + (var1 ? "twinkle_far" : "twinkle"); + this.worldObj.playSound(this.posX, this.posY, this.posZ, var15, 20.0F, 0.9F + this.rand.nextFloat() * 0.15F, true); + } + + this.setDead(); + } + } + + private boolean func_92037_i() { + Minecraft var1 = Minecraft.getMinecraft(); + return var1 == null || var1.renderViewEntity == null || var1.renderViewEntity.getDistanceSq(this.posX, this.posY, this.posZ) >= 256.0D; + } + + /** + * Creates a single particle. Args: x, y, z, x velocity, y velocity, z velocity, colours, fade colours, whether to + * trail, whether to twinkle + */ + private void createParticle(double p_92034_1_, double p_92034_3_, double p_92034_5_, double p_92034_7_, double p_92034_9_, double p_92034_11_, int[] p_92034_13_, int[] p_92034_14_, boolean p_92034_15_, boolean p_92034_16_) { + EntityFireworkSparkFX var17 = new EntityFireworkSparkFX(this.worldObj, p_92034_1_, p_92034_3_, p_92034_5_, p_92034_7_, p_92034_9_, p_92034_11_, this.theEffectRenderer); + var17.setTrail(p_92034_15_); + var17.setTwinkle(p_92034_16_); + int var18 = this.rand.nextInt(p_92034_13_.length); + var17.setColour(p_92034_13_[var18]); + + if (p_92034_14_ != null && p_92034_14_.length > 0) { + var17.setFadeColour(p_92034_14_[this.rand.nextInt(p_92034_14_.length)]); + } + + this.theEffectRenderer.addEffect(var17); + } + + /** + * Creates a small ball or large ball type explosion. Args: particle speed, size, colours, fade colours, whether to + * trail, whether to flicker + */ + private void createBall(double p_92035_1_, int p_92035_3_, int[] p_92035_4_, int[] p_92035_5_, boolean p_92035_6_, boolean p_92035_7_) { + double var8 = this.posX; + double var10 = this.posY; + double var12 = this.posZ; + + for (int var14 = -p_92035_3_; var14 <= p_92035_3_; ++var14) { + for (int var15 = -p_92035_3_; var15 <= p_92035_3_; ++var15) { + for (int var16 = -p_92035_3_; var16 <= p_92035_3_; ++var16) { + double var17 = (double)var15 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double var19 = (double)var14 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double var21 = (double)var16 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double var23 = (double)MathHelper.sqrt_double(var17 * var17 + var19 * var19 + var21 * var21) / p_92035_1_ + this.rand.nextGaussian() * 0.05D; + this.createParticle(var8, var10, var12, var17 / var23, var19 / var23, var21 / var23, p_92035_4_, p_92035_5_, p_92035_6_, p_92035_7_); + + if (var14 != -p_92035_3_ && var14 != p_92035_3_ && var15 != -p_92035_3_ && var15 != p_92035_3_) { + var16 += p_92035_3_ * 2 - 1; + } + } + } + } + } + + /** + * Creates a creeper-shaped or star-shaped explosion. Args: particle speed, shape, colours, fade colours, whether to + * trail, whether to flicker, unknown + */ + private void createShaped(double p_92038_1_, double[][] p_92038_3_, int[] p_92038_4_, int[] p_92038_5_, boolean p_92038_6_, boolean p_92038_7_, boolean p_92038_8_) { + double var9 = p_92038_3_[0][0]; + double var11 = p_92038_3_[0][1]; + this.createParticle(this.posX, this.posY, this.posZ, var9 * p_92038_1_, var11 * p_92038_1_, 0.0D, p_92038_4_, p_92038_5_, p_92038_6_, p_92038_7_); + float var13 = this.rand.nextFloat() * (float)Math.PI; + double var14 = p_92038_8_ ? 0.034D : 0.34D; + + for (int var16 = 0; var16 < 3; ++var16) { + double var17 = (double)var13 + (double)((float)var16 * (float)Math.PI) * var14; + double var19 = var9; + double var21 = var11; + + for (int var23 = 1; var23 < p_92038_3_.length; ++var23) { + double var24 = p_92038_3_[var23][0]; + double var26 = p_92038_3_[var23][1]; + + for (double var28 = 0.25D; var28 <= 1.0D; var28 += 0.25D) { + double var30 = (var19 + (var24 - var19) * var28) * p_92038_1_; + double var32 = (var21 + (var26 - var21) * var28) * p_92038_1_; + double var34 = var30 * Math.sin(var17); + var30 *= Math.cos(var17); + + for (double var36 = -1.0D; var36 <= 1.0D; var36 += 2.0D) { + this.createParticle(this.posX, this.posY, this.posZ, var30 * var36, var32, var34 * var36, p_92038_4_, p_92038_5_, p_92038_6_, p_92038_7_); + } + } + + var19 = var24; + var21 = var26; + } + } + } + + /** + * Creates a burst type explosion. Args: colours, fade colours, whether to trail, whether to flicker + */ + private void createBurst(int[] p_92036_1_, int[] p_92036_2_, boolean p_92036_3_, boolean p_92036_4_) { + double var5 = this.rand.nextGaussian() * 0.05D; + double var7 = this.rand.nextGaussian() * 0.05D; + + for (int var9 = 0; var9 < 70; ++var9) { + double var10 = this.motionX * 0.5D + this.rand.nextGaussian() * 0.15D + var5; + double var12 = this.motionZ * 0.5D + this.rand.nextGaussian() * 0.15D + var7; + double var14 = this.motionY * 0.5D + this.rand.nextDouble() * 0.5D; + this.createParticle(this.posX, this.posY, this.posZ, var10, var14, var12, p_92036_1_, p_92036_2_, p_92036_3_, p_92036_4_); + } + } + + public int getFXLayer() { + return 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java new file mode 100644 index 0000000..95fac76 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFishWakeFX.java @@ -0,0 +1,46 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntityFishWakeFX extends EntityFX { + + + public EntityFishWakeFX(World p_i45073_1_, double p_i45073_2_, double p_i45073_4_, double p_i45073_6_, double p_i45073_8_, double p_i45073_10_, double p_i45073_12_) { + super(p_i45073_1_, p_i45073_2_, p_i45073_4_, p_i45073_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.30000001192092896D; + this.motionY = (float)Math.random() * 0.2F + 0.1F; + this.motionZ *= 0.30000001192092896D; + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(19); + this.setSize(0.01F, 0.01F); + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleGravity = 0.0F; + this.motionX = p_i45073_8_; + this.motionY = p_i45073_10_; + this.motionZ = p_i45073_12_; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + int var1 = 60 - this.particleMaxAge; + float var2 = (float)var1 * 0.001F; + this.setSize(var2, var2); + this.setParticleTextureIndex(19 + var1 % 4); + + if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFlameFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFlameFX.java new file mode 100644 index 0000000..f184205 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFlameFX.java @@ -0,0 +1,95 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntityFlameFX extends EntityFX { + /** the scale of the flame FX */ + private final float flameScale; + + + public EntityFlameFX(World p_i1209_1_, double p_i1209_2_, double p_i1209_4_, double p_i1209_6_, double p_i1209_8_, double p_i1209_10_, double p_i1209_12_) { + super(p_i1209_1_, p_i1209_2_, p_i1209_4_, p_i1209_6_, p_i1209_8_, p_i1209_10_, p_i1209_12_); + this.motionX = this.motionX * 0.009999999776482582D + p_i1209_8_; + this.motionY = this.motionY * 0.009999999776482582D + p_i1209_10_; + this.motionZ = this.motionZ * 0.009999999776482582D + p_i1209_12_; + double var10000 = p_i1209_2_ + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + var10000 = p_i1209_4_ + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + var10000 = p_i1209_6_ + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + this.flameScale = this.particleScale; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)) + 4; + this.noClip = true; + this.setParticleTextureIndex(48); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge; + this.particleScale = this.flameScale * (1.0F - var8 * var8 * 0.5F); + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + public int getBrightnessForRender(float p_70070_1_) { + float var2 = ((float)this.particleAge + p_70070_1_) / (float)this.particleMaxAge; + + if (var2 < 0.0F) { + var2 = 0.0F; + } + + if (var2 > 1.0F) { + var2 = 1.0F; + } + + int var3 = super.getBrightnessForRender(p_70070_1_); + int var4 = var3 & 255; + int var5 = var3 >> 16 & 255; + var4 += (int)(var2 * 15.0F * 16.0F); + + if (var4 > 240) { + var4 = 240; + } + + return var4 | var5 << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + float var2 = ((float)this.particleAge + p_70013_1_) / (float)this.particleMaxAge; + + if (var2 < 0.0F) { + var2 = 0.0F; + } + + if (var2 > 1.0F) { + var2 = 1.0F; + } + + float var3 = super.getBrightness(p_70013_1_); + return var3 * var2 + (1.0F - var2); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java new file mode 100644 index 0000000..ae61b9e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityFootStepFX.java @@ -0,0 +1,68 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +public class EntityFootStepFX extends EntityFX { + private static final ResourceLocation field_110126_a = new ResourceLocation("textures/particle/footprint.png"); + private int footstepAge; + private final int footstepMaxAge; + private final TextureManager currentFootSteps; + + + public EntityFootStepFX(TextureManager p_i1210_1_, World p_i1210_2_, double p_i1210_3_, double p_i1210_5_, double p_i1210_7_) { + super(p_i1210_2_, p_i1210_3_, p_i1210_5_, p_i1210_7_, 0.0D, 0.0D, 0.0D); + this.currentFootSteps = p_i1210_1_; + this.motionX = this.motionY = this.motionZ = 0.0D; + this.footstepMaxAge = 200; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.footstepAge + p_70539_2_) / (float)this.footstepMaxAge; + var8 *= var8; + float var9 = 2.0F - var8 * 2.0F; + + if (var9 > 1.0F) { + var9 = 1.0F; + } + + var9 *= 0.2F; + GL11.glDisable(GL11.GL_LIGHTING); + float var10 = 0.125F; + float var11 = (float)(this.posX - interpPosX); + float var12 = (float)(this.posY - interpPosY); + float var13 = (float)(this.posZ - interpPosZ); + float var14 = this.worldObj.getLightBrightness(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + this.currentFootSteps.bindTexture(field_110126_a); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + p_70539_1_.startDrawingQuads(); + p_70539_1_.setColorRGBA_F(var14, var14, var14, var9); + p_70539_1_.addVertexWithUV(var11 - var10, var12, var13 + var10, 0.0D, 1.0D); + p_70539_1_.addVertexWithUV(var11 + var10, var12, var13 + var10, 1.0D, 1.0D); + p_70539_1_.addVertexWithUV(var11 + var10, var12, var13 - var10, 1.0D, 0.0D); + p_70539_1_.addVertexWithUV(var11 - var10, var12, var13 - var10, 0.0D, 0.0D); + p_70539_1_.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + ++this.footstepAge; + + if (this.footstepAge == this.footstepMaxAge) { + this.setDead(); + } + } + + public int getFXLayer() { + return 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityHeartFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityHeartFX.java new file mode 100644 index 0000000..90a3bdd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityHeartFX.java @@ -0,0 +1,71 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntityHeartFX extends EntityFX { + float particleScaleOverTime; + + + public EntityHeartFX(World p_i1211_1_, double p_i1211_2_, double p_i1211_4_, double p_i1211_6_, double p_i1211_8_, double p_i1211_10_, double p_i1211_12_) { + this(p_i1211_1_, p_i1211_2_, p_i1211_4_, p_i1211_6_, p_i1211_8_, p_i1211_10_, p_i1211_12_, 2.0F); + } + + public EntityHeartFX(World p_i46354_1_, double p_i46354_2_, double p_i46354_4_, double p_i46354_6_, double p_i46354_8_, double p_i46354_10_, double p_i46354_12_, float p_i46354_14_) { + super(p_i46354_1_, p_i46354_2_, p_i46354_4_, p_i46354_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.009999999776482582D; + this.motionY *= 0.009999999776482582D; + this.motionZ *= 0.009999999776482582D; + this.motionY += 0.1D; + this.particleScale *= 0.75F; + this.particleScale *= p_i46354_14_; + this.particleScaleOverTime = this.particleScale; + this.particleMaxAge = 16; + this.noClip = false; + this.setParticleTextureIndex(80); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.particleScaleOverTime * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.8600000143051147D; + this.motionY *= 0.8600000143051147D; + this.motionZ *= 0.8600000143051147D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java new file mode 100644 index 0000000..d5ad09e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityHugeExplodeFX.java @@ -0,0 +1,40 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntityHugeExplodeFX extends EntityFX { + private int timeSinceStart; + + /** the maximum time for the explosion */ + private final int maximumTime = 8; + + + public EntityHugeExplodeFX(World p_i1214_1_, double p_i1214_2_, double p_i1214_4_, double p_i1214_6_, double p_i1214_8_, double p_i1214_10_, double p_i1214_12_) { + super(p_i1214_1_, p_i1214_2_, p_i1214_4_, p_i1214_6_, 0.0D, 0.0D, 0.0D); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + for (int var1 = 0; var1 < 6; ++var1) { + double var2 = this.posX + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + double var4 = this.posY + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + double var6 = this.posZ + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + this.worldObj.spawnParticle("largeexplode", var2, var4, var6, (float)this.timeSinceStart / (float)this.maximumTime, 0.0D, 0.0D); + } + + ++this.timeSinceStart; + + if (this.timeSinceStart == this.maximumTime) { + this.setDead(); + } + } + + public int getFXLayer() { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java new file mode 100644 index 0000000..ae3aa47 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityLargeExplodeFX.java @@ -0,0 +1,79 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +public class EntityLargeExplodeFX extends EntityFX { + private static final ResourceLocation field_110127_a = new ResourceLocation("textures/entity/explosion.png"); + private int field_70581_a; + private final int field_70584_aq; + + /** The Rendering Engine. */ + private final TextureManager theRenderEngine; + private final float field_70582_as; + + + public EntityLargeExplodeFX(TextureManager p_i1213_1_, World p_i1213_2_, double p_i1213_3_, double p_i1213_5_, double p_i1213_7_, double p_i1213_9_, double p_i1213_11_, double p_i1213_13_) { + super(p_i1213_2_, p_i1213_3_, p_i1213_5_, p_i1213_7_, 0.0D, 0.0D, 0.0D); + this.theRenderEngine = p_i1213_1_; + this.field_70584_aq = 6 + this.rand.nextInt(4); + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.6F + 0.4F; + this.field_70582_as = 1.0F - (float)p_i1213_9_ * 0.5F; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + int var8 = (int)(((float)this.field_70581_a + p_70539_2_) * 15.0F / (float)this.field_70584_aq); + + if (var8 <= 15) { + this.theRenderEngine.bindTexture(field_110127_a); + float var9 = (float)(var8 % 4) / 4.0F; + float var10 = var9 + 0.24975F; + float var11 = (float)(var8 / 4) / 4.0F; + float var12 = var11 + 0.24975F; + float var13 = 2.0F * this.field_70582_as; + float var14 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float var15 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float var16 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + RenderHelper.disableStandardItemLighting(); + p_70539_1_.startDrawingQuads(); + p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); + p_70539_1_.setNormal(0.0F, 1.0F, 0.0F); + p_70539_1_.setBrightness(240); + p_70539_1_.addVertexWithUV(var14 - p_70539_3_ * var13 - p_70539_6_ * var13, var15 - p_70539_4_ * var13, var16 - p_70539_5_ * var13 - p_70539_7_ * var13, var10, var12); + p_70539_1_.addVertexWithUV(var14 - p_70539_3_ * var13 + p_70539_6_ * var13, var15 + p_70539_4_ * var13, var16 - p_70539_5_ * var13 + p_70539_7_ * var13, var10, var11); + p_70539_1_.addVertexWithUV(var14 + p_70539_3_ * var13 + p_70539_6_ * var13, var15 + p_70539_4_ * var13, var16 + p_70539_5_ * var13 + p_70539_7_ * var13, var9, var11); + p_70539_1_.addVertexWithUV(var14 + p_70539_3_ * var13 - p_70539_6_ * var13, var15 - p_70539_4_ * var13, var16 + p_70539_5_ * var13 - p_70539_7_ * var13, var9, var12); + p_70539_1_.draw(); + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + + public int getBrightnessForRender(float p_70070_1_) { + return 61680; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.field_70581_a; + + if (this.field_70581_a == this.field_70584_aq) { + this.setDead(); + } + } + + public int getFXLayer() { + return 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityLavaFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityLavaFX.java new file mode 100644 index 0000000..46b7427 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityLavaFX.java @@ -0,0 +1,83 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntityLavaFX extends EntityFX { + private final float lavaParticleScale; + + + public EntityLavaFX(World p_i1215_1_, double p_i1215_2_, double p_i1215_4_, double p_i1215_6_) { + super(p_i1215_1_, p_i1215_2_, p_i1215_4_, p_i1215_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + this.motionY = this.rand.nextFloat() * 0.4F + 0.05F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleScale *= this.rand.nextFloat() * 2.0F + 0.2F; + this.lavaParticleScale = this.particleScale; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + this.setParticleTextureIndex(49); + } + + public int getBrightnessForRender(float p_70070_1_) { + float var2 = ((float)this.particleAge + p_70070_1_) / (float)this.particleMaxAge; + + if (var2 < 0.0F) { + var2 = 0.0F; + } + + if (var2 > 1.0F) { + var2 = 1.0F; + } + + int var3 = super.getBrightnessForRender(p_70070_1_); + short var4 = 240; + int var5 = var3 >> 16 & 255; + return var4 | var5 << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return 1.0F; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge; + this.particleScale = this.lavaParticleScale * (1.0F - var8 * var8); + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + float var1 = (float)this.particleAge / (float)this.particleMaxAge; + + if (this.rand.nextFloat() > var1) { + this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); + } + + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9990000128746033D; + this.motionY *= 0.9990000128746033D; + this.motionZ *= 0.9990000128746033D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityNoteFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityNoteFX.java new file mode 100644 index 0000000..13fc575 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityNoteFX.java @@ -0,0 +1,75 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityNoteFX extends EntityFX { + float noteParticleScale; + + + public EntityNoteFX(World p_i46353_1_, double p_i46353_2_, double p_i46353_4_, double p_i46353_6_, double p_i46353_8_, double p_i46353_10_, double p_i46353_12_) { + this(p_i46353_1_, p_i46353_2_, p_i46353_4_, p_i46353_6_, p_i46353_8_, p_i46353_10_, p_i46353_12_, 2.0F); + } + + public EntityNoteFX(World p_i1217_1_, double p_i1217_2_, double p_i1217_4_, double p_i1217_6_, double p_i1217_8_, double p_i1217_10_, double p_i1217_12_, float p_i1217_14_) { + super(p_i1217_1_, p_i1217_2_, p_i1217_4_, p_i1217_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.009999999776482582D; + this.motionY *= 0.009999999776482582D; + this.motionZ *= 0.009999999776482582D; + this.motionY += 0.2D; + this.particleRed = MathHelper.sin(((float)p_i1217_8_ + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleGreen = MathHelper.sin(((float)p_i1217_8_ + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleBlue = MathHelper.sin(((float)p_i1217_8_ + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleScale *= 0.75F; + this.particleScale *= p_i1217_14_; + this.noteParticleScale = this.particleScale; + this.particleMaxAge = 6; + this.noClip = false; + this.setParticleTextureIndex(64); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.noteParticleScale * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.6600000262260437D; + this.motionY *= 0.6600000262260437D; + this.motionZ *= 0.6600000262260437D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityPickupFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityPickupFX.java new file mode 100644 index 0000000..860d837 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityPickupFX.java @@ -0,0 +1,77 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.src.Config; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import shadersmod.client.Shaders; + +public class EntityPickupFX extends EntityFX { + private Entity entityToPickUp; + private Entity entityPickingUp; + private int age; + private int maxAge; + + /** renamed from yOffset to fix shadowing Entity.yOffset */ + private float yOffs; + + public EntityPickupFX(World par1World, Entity par2Entity, Entity par3Entity, float par4) { + super(par1World, par2Entity.posX, par2Entity.posY, par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ); + this.entityToPickUp = par2Entity; + this.entityPickingUp = par3Entity; + this.maxAge = 3; + this.yOffs = par4; + } + + public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { + int oldShadersProgram = 0; + + if (Config.isShaders()) { + oldShadersProgram = Shaders.activeProgram; + Shaders.nextEntity(this.entityToPickUp); + } + + float var8 = ((float)this.age + par2) / (float)this.maxAge; + var8 *= var8; + double var9 = this.entityToPickUp.posX; + double var11 = this.entityToPickUp.posY; + double var13 = this.entityToPickUp.posZ; + double var15 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)par2; + double var17 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)par2 + (double)this.yOffs; + double var19 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)par2; + double var21 = var9 + (var15 - var9) * (double)var8; + double var23 = var11 + (var17 - var11) * (double)var8; + double var25 = var13 + (var19 - var13) * (double)var8; + int var27 = this.getBrightnessForRender(par2); + int var28 = var27 % 65536; + int var29 = var27 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var28 / 1.0F, (float)var29 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + var21 -= interpPosX; + var23 -= interpPosY; + var25 -= interpPosZ; + RenderManager.instance.func_147940_a(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, par2); + + if (Config.isShaders()) { + Shaders.useProgram(oldShadersProgram); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + ++this.age; + + if (this.age == this.maxAge) { + this.setDead(); + } + } + + public int getFXLayer() { + return 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityPortalFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityPortalFX.java new file mode 100644 index 0000000..d7b389b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityPortalFX.java @@ -0,0 +1,85 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntityPortalFX extends EntityFX { + private final float portalParticleScale; + private final double portalPosX; + private final double portalPosY; + private final double portalPosZ; + + + public EntityPortalFX(World p_i46351_1_, double p_i46351_2_, double p_i46351_4_, double p_i46351_6_, double p_i46351_8_, double p_i46351_10_, double p_i46351_12_) { + super(p_i46351_1_, p_i46351_2_, p_i46351_4_, p_i46351_6_, p_i46351_8_, p_i46351_10_, p_i46351_12_); + this.motionX = p_i46351_8_; + this.motionY = p_i46351_10_; + this.motionZ = p_i46351_12_; + this.portalPosX = this.posX = p_i46351_2_; + this.portalPosY = this.posY = p_i46351_4_; + this.portalPosZ = this.posZ = p_i46351_6_; + float var14 = this.rand.nextFloat() * 0.6F + 0.4F; + this.portalParticleScale = this.particleScale = this.rand.nextFloat() * 0.2F + 0.5F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; + this.particleGreen *= 0.3F; + this.particleRed *= 0.9F; + this.particleMaxAge = (int)(Math.random() * 10.0D) + 40; + this.noClip = true; + this.setParticleTextureIndex((int)(Math.random() * 8.0D)); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge; + var8 = 1.0F - var8; + var8 *= var8; + var8 = 1.0F - var8; + this.particleScale = this.portalParticleScale * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + public int getBrightnessForRender(float p_70070_1_) { + int var2 = super.getBrightnessForRender(p_70070_1_); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 *= var3; + var3 *= var3; + int var4 = var2 & 255; + int var5 = var2 >> 16 & 255; + var5 += (int)(var3 * 15.0F * 16.0F); + + if (var5 > 240) { + var5 = 240; + } + + return var4 | var5 << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + float var2 = super.getBrightness(p_70013_1_); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 = var3 * var3 * var3 * var3; + return var2 * (1.0F - var3) + var3; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + float var1 = (float)this.particleAge / (float)this.particleMaxAge; + float var2 = var1; + var1 = -var1 + var1 * var1 * 2.0F; + var1 = 1.0F - var1; + this.posX = this.portalPosX + this.motionX * (double)var1; + this.posY = this.portalPosY + this.motionY * (double)var1 + (double)(1.0F - var2); + this.posZ = this.portalPosZ + this.motionZ * (double)var1; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityRainFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityRainFX.java new file mode 100644 index 0000000..3156372 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityRainFX.java @@ -0,0 +1,61 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityRainFX extends EntityFX { + + + public EntityRainFX(World p_i1235_1_, double p_i1235_2_, double p_i1235_4_, double p_i1235_6_) { + super(p_i1235_1_, p_i1235_2_, p_i1235_4_, p_i1235_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.30000001192092896D; + this.motionY = (float)Math.random() * 0.2F + 0.1F; + this.motionZ *= 0.30000001192092896D; + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(19 + this.rand.nextInt(4)); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + + if (this.onGround) { + if (Math.random() < 0.5D) { + this.setDead(); + } + + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + Material var1 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial(); + + if (var1.isLiquid() || var1.isSolid()) { + double var2 = (float)(MathHelper.floor_double(this.posY) + 1) - BlockLiquid.func_149801_b(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); + + if (this.posY < var2) { + this.setDead(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityReddustFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityReddustFX.java new file mode 100644 index 0000000..d396a19 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntityReddustFX.java @@ -0,0 +1,80 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntityReddustFX extends EntityFX { + float reddustParticleScale; + + + public EntityReddustFX(World p_i46349_1_, double p_i46349_2_, double p_i46349_4_, double p_i46349_6_, float p_i46349_8_, float p_i46349_9_, float p_i46349_10_) { + this(p_i46349_1_, p_i46349_2_, p_i46349_4_, p_i46349_6_, 1.0F, p_i46349_8_, p_i46349_9_, p_i46349_10_); + } + + public EntityReddustFX(World p_i46350_1_, double p_i46350_2_, double p_i46350_4_, double p_i46350_6_, float p_i46350_8_, float p_i46350_9_, float p_i46350_10_, float p_i46350_11_) { + super(p_i46350_1_, p_i46350_2_, p_i46350_4_, p_i46350_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + + if (p_i46350_9_ == 0.0F) { + p_i46350_9_ = 1.0F; + } + + float var12 = (float)Math.random() * 0.4F + 0.6F; + this.particleRed = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i46350_9_ * var12; + this.particleGreen = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i46350_10_ * var12; + this.particleBlue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i46350_11_ * var12; + this.particleScale *= 0.75F; + this.particleScale *= p_i46350_8_; + this.reddustParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i46350_8_); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.reddustParticleScale * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java new file mode 100644 index 0000000..f784e21 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySmokeFX.java @@ -0,0 +1,76 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntitySmokeFX extends EntityFX { + float smokeParticleScale; + + + public EntitySmokeFX(World p_i46347_1_, double p_i46347_2_, double p_i46347_4_, double p_i46347_6_, double p_i46347_8_, double p_i46347_10_, double p_i46347_12_) { + this(p_i46347_1_, p_i46347_2_, p_i46347_4_, p_i46347_6_, p_i46347_8_, p_i46347_10_, p_i46347_12_, 1.0F); + } + + public EntitySmokeFX(World p_i46348_1_, double p_i46348_2_, double p_i46348_4_, double p_i46348_6_, double p_i46348_8_, double p_i46348_10_, double p_i46348_12_, float p_i46348_14_) { + super(p_i46348_1_, p_i46348_2_, p_i46348_4_, p_i46348_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i46348_8_; + this.motionY += p_i46348_10_; + this.motionZ += p_i46348_12_; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= p_i46348_14_; + this.smokeParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i46348_14_); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.smokeParticleScale * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java new file mode 100644 index 0000000..4484a79 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySnowShovelFX.java @@ -0,0 +1,70 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntitySnowShovelFX extends EntityFX { + float snowDigParticleScale; + + + public EntitySnowShovelFX(World p_i1227_1_, double p_i1227_2_, double p_i1227_4_, double p_i1227_6_, double p_i1227_8_, double p_i1227_10_, double p_i1227_12_) { + this(p_i1227_1_, p_i1227_2_, p_i1227_4_, p_i1227_6_, p_i1227_8_, p_i1227_10_, p_i1227_12_, 1.0F); + } + + public EntitySnowShovelFX(World p_i1228_1_, double p_i1228_2_, double p_i1228_4_, double p_i1228_6_, double p_i1228_8_, double p_i1228_10_, double p_i1228_12_, float p_i1228_14_) { + super(p_i1228_1_, p_i1228_2_, p_i1228_4_, p_i1228_6_, p_i1228_8_, p_i1228_10_, p_i1228_12_); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1228_8_; + this.motionY += p_i1228_10_; + this.motionZ += p_i1228_12_; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= p_i1228_14_; + this.snowDigParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1228_14_); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.snowDigParticleScale * var8; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.9900000095367432D; + this.motionZ *= 0.9900000095367432D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java new file mode 100644 index 0000000..549a7a7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySpellParticleFX.java @@ -0,0 +1,76 @@ +package net.minecraft.client.particle; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +public class EntitySpellParticleFX extends EntityFX { + /** Base spell texture index */ + private int baseSpellTextureIndex = 128; + + + public EntitySpellParticleFX(World p_i1229_1_, double p_i1229_2_, double p_i1229_4_, double p_i1229_6_, double p_i1229_8_, double p_i1229_10_, double p_i1229_12_) { + super(p_i1229_1_, p_i1229_2_, p_i1229_4_, p_i1229_6_, p_i1229_8_, p_i1229_10_, p_i1229_12_); + this.motionY *= 0.20000000298023224D; + + if (p_i1229_8_ == 0.0D && p_i1229_12_ == 0.0D) { + this.motionX *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + } + + this.particleScale *= 0.75F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + float var8 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (var8 < 0.0F) { + var8 = 0.0F; + } + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + /** + * Sets the base spell texture index + */ + public void setBaseSpellTextureIndex(int p_70589_1_) { + this.baseSpellTextureIndex = p_70589_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySplashFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySplashFX.java new file mode 100644 index 0000000..d0a002f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySplashFX.java @@ -0,0 +1,19 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class EntitySplashFX extends EntityRainFX { + + + public EntitySplashFX(World p_i1230_1_, double p_i1230_2_, double p_i1230_4_, double p_i1230_6_, double p_i1230_8_, double p_i1230_10_, double p_i1230_12_) { + super(p_i1230_1_, p_i1230_2_, p_i1230_4_, p_i1230_6_); + this.particleGravity = 0.04F; + this.nextTextureIndexX(); + + if (p_i1230_10_ == 0.0D && (p_i1230_8_ != 0.0D || p_i1230_12_ != 0.0D)) { + this.motionX = p_i1230_8_; + this.motionY = p_i1230_10_ + 0.1D; + this.motionZ = p_i1230_12_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java new file mode 100644 index 0000000..7217116 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/particle/EntitySuspendFX.java @@ -0,0 +1,41 @@ +package net.minecraft.client.particle; + +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySuspendFX extends EntityFX { + + + public EntitySuspendFX(World p_i1231_1_, double p_i1231_2_, double p_i1231_4_, double p_i1231_6_, double p_i1231_8_, double p_i1231_10_, double p_i1231_12_) { + super(p_i1231_1_, p_i1231_2_, p_i1231_4_ - 0.125D, p_i1231_6_, p_i1231_8_, p_i1231_10_, p_i1231_12_); + this.particleRed = 0.4F; + this.particleGreen = 0.4F; + this.particleBlue = 0.7F; + this.setParticleTextureIndex(0); + this.setSize(0.01F, 0.01F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; + this.motionX = p_i1231_8_ * 0.0D; + this.motionY = p_i1231_10_ * 0.0D; + this.motionZ = p_i1231_12_ * 0.0D; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() != Material.water) { + this.setDead(); + } + + if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java new file mode 100644 index 0000000..8a9128b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ActiveRenderInfo.java @@ -0,0 +1,114 @@ +package net.minecraft.client.renderer; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +public class ActiveRenderInfo { + /** The calculated view object X coordinate */ + public static float objectX; + + /** The calculated view object Y coordinate */ + public static float objectY; + + /** The calculated view object Z coordinate */ + public static float objectZ; + + /** The current GL viewport */ + private static final IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); + + /** The current GL modelview matrix */ + private static final FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); + + /** The current GL projection matrix */ + private static final FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); + + /** The computed view object coordinates */ + private static final FloatBuffer objectCoords = GLAllocation.createDirectFloatBuffer(3); + + /** The X component of the entity's yaw rotation */ + public static float rotationX; + + /** The combined X and Z components of the entity's pitch rotation */ + public static float rotationXZ; + + /** The Z component of the entity's yaw rotation */ + public static float rotationZ; + + /** + * The Y component (scaled along the Z axis) of the entity's pitch rotation + */ + public static float rotationYZ; + + /** + * The Y component (scaled along the X axis) of the entity's pitch rotation + */ + public static float rotationXY; + + + /** + * Updates the current render info and camera location based on entity look angles and 1st/3rd person view mode + */ + public static void updateRenderInfo(EntityPlayer p_74583_0_, boolean p_74583_1_) { + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection); + GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); + float var2 = (float)((viewport.get(0) + viewport.get(2)) / 2); + float var3 = (float)((viewport.get(1) + viewport.get(3)) / 2); + GLU.gluUnProject(var2, var3, 0.0F, modelview, projection, viewport, objectCoords); + objectX = objectCoords.get(0); + objectY = objectCoords.get(1); + objectZ = objectCoords.get(2); + float var5 = Minecraft.getMinecraft().currentScreen instanceof GuiContainer ? p_74583_0_.rotationPitch : RenderManager.instance.playerViewX; + float var6 = Minecraft.getMinecraft().currentScreen instanceof GuiContainer ? p_74583_0_.rotationYaw : RenderManager.instance.playerViewY; + rotationX = MathHelper.cos(var6 * (float) Math.PI / 180.0F); + rotationZ = MathHelper.sin(var6 * (float) Math.PI / 180.0F); + rotationYZ = -rotationZ * MathHelper.sin(var5 * (float)Math.PI / 180.0F); + rotationXY = rotationX * MathHelper.sin(var5 * (float)Math.PI / 180.0F); + rotationXZ = MathHelper.cos(var5 * (float)Math.PI / 180.0F); + } + + /** + * Returns a vector representing the projection along the given entity's view for the given distance + */ + public static Vec3 projectViewFromEntity(EntityLivingBase p_74585_0_, double p_74585_1_) { + double var3 = p_74585_0_.prevPosX + (p_74585_0_.posX - p_74585_0_.prevPosX) * p_74585_1_; + double var5 = p_74585_0_.prevPosY + (p_74585_0_.posY - p_74585_0_.prevPosY) * p_74585_1_ + (double)p_74585_0_.getEyeHeight(); + double var7 = p_74585_0_.prevPosZ + (p_74585_0_.posZ - p_74585_0_.prevPosZ) * p_74585_1_; + double var9 = var3 + (double)(objectX * 1.0F); + double var11 = var5 + (double)(objectY * 1.0F); + double var13 = var7 + (double)(objectZ * 1.0F); + return Vec3.createVectorHelper(var9, var11, var13); + } + + public static Block getBlockAtEntityViewpoint(World p_151460_0_, EntityLivingBase p_151460_1_, float p_151460_2_) { + Vec3 var3 = projectViewFromEntity(p_151460_1_, p_151460_2_); + ChunkPosition var4 = new ChunkPosition(var3); + Block var5 = p_151460_0_.getBlock(var4.field_151329_a, var4.field_151327_b, var4.field_151328_c); + + if (var5.getMaterial().isLiquid()) { + float var6 = BlockLiquid.func_149801_b(p_151460_0_.getBlockMetadata(var4.field_151329_a, var4.field_151327_b, var4.field_151328_c)) - 0.11111111F; + float var7 = (float)(var4.field_151327_b + 1) - var6; + + if (var3.yCoord >= (double)var7) { + var5 = p_151460_0_.getBlock(var4.field_151329_a, var4.field_151327_b + 1, var4.field_151328_c); + } + } + + return var5; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java new file mode 100644 index 0000000..26a879b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/DestroyBlockProgress.java @@ -0,0 +1,72 @@ +package net.minecraft.client.renderer; + +public class DestroyBlockProgress { + /** + * entity ID of the player associated with this partially destroyed Block. Used to identify the Blocks in the com.cheatbreaker.client + * Renderer, max 1 per player on a server + */ + private final int miningPlayerEntId; + private final int partialBlockX; + private final int partialBlockY; + private final int partialBlockZ; + + /** + * damage ranges from 1 to 10. -1 causes the com.cheatbreaker.client to delete the partial block renderer. + */ + private int partialBlockProgress; + + /** + * keeps track of how many ticks this PartiallyDestroyedBlock already exists + */ + private int createdAtCloudUpdateTick; + + + public DestroyBlockProgress(int p_i1511_1_, int p_i1511_2_, int p_i1511_3_, int p_i1511_4_) { + this.miningPlayerEntId = p_i1511_1_; + this.partialBlockX = p_i1511_2_; + this.partialBlockY = p_i1511_3_; + this.partialBlockZ = p_i1511_4_; + } + + public int getPartialBlockX() { + return this.partialBlockX; + } + + public int getPartialBlockY() { + return this.partialBlockY; + } + + public int getPartialBlockZ() { + return this.partialBlockZ; + } + + /** + * inserts damage value into this partially destroyed Block. -1 causes com.cheatbreaker.client renderer to delete it, otherwise + * ranges from 1 to 10 + */ + public void setPartialBlockDamage(int p_73107_1_) { + if (p_73107_1_ > 10) { + p_73107_1_ = 10; + } + + this.partialBlockProgress = p_73107_1_; + } + + public int getPartialBlockDamage() { + return this.partialBlockProgress; + } + + /** + * saves the current Cloud update tick into the PartiallyDestroyedBlock + */ + public void setCloudUpdateTick(int p_82744_1_) { + this.createdAtCloudUpdateTick = p_82744_1_; + } + + /** + * retrieves the 'date' at which the PartiallyDestroyedBlock was created + */ + public int getCreationCloudUpdateTick() { + return this.createdAtCloudUpdateTick; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/EntityRenderer.java new file mode 100644 index 0000000..1b8700d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -0,0 +1,2683 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleDragToLook; +import com.cheatbreaker.client.module.impl.normal.perspective.ModulePerspective; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnvironmentChanger; +import com.google.gson.JsonSyntaxException; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiDownloadTerrain; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.MapItemRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.particle.EntityRainFX; +import net.minecraft.client.particle.EntitySmokeFX; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustrum; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.src.*; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.biome.BiomeGenBase; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.GLU; +import org.lwjgl.util.glu.Project; +import shadersmod.client.Shaders; +import shadersmod.client.ShadersRender; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.nio.FloatBuffer; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Random; + +public class EntityRenderer implements IResourceManagerReloadListener { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); + private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); + public static boolean anaglyphEnable; + + /** Anaglyph field (0=R, 1=GB) */ + public static int anaglyphField; + + /** A reference to the Minecraft object. */ + private Minecraft mc; + private float farPlaneDistance; + public ItemRenderer itemRenderer; + private final MapItemRenderer theMapItemRenderer; + + /** Entity renderer update count */ + private int rendererUpdateCount; + + /** Pointed entity */ + private Entity pointedEntity; + private MouseFilter mouseFilterXAxis = new MouseFilter(); + private MouseFilter mouseFilterYAxis = new MouseFilter(); + + /** Mouse filter dummy 1 */ + private MouseFilter mouseFilterDummy1 = new MouseFilter(); + + /** Mouse filter dummy 2 */ + private MouseFilter mouseFilterDummy2 = new MouseFilter(); + + /** Mouse filter dummy 3 */ + private MouseFilter mouseFilterDummy3 = new MouseFilter(); + + /** Mouse filter dummy 4 */ + private MouseFilter mouseFilterDummy4 = new MouseFilter(); + private float thirdPersonDistance = 4.0F; + + /** Third person distance temp */ + private float thirdPersonDistanceTemp = 4.0F; + private float debugCamYaw; + private float prevDebugCamYaw; + private float debugCamPitch; + private float prevDebugCamPitch; + + /** Smooth cam yaw */ + private float smoothCamYaw; + + /** Smooth cam pitch */ + private float smoothCamPitch; + + /** Smooth cam filter X */ + private float smoothCamFilterX; + + /** Smooth cam filter Y */ + private float smoothCamFilterY; + + /** Smooth cam partial ticks */ + private float smoothCamPartialTicks; + private float debugCamFOV; + private float prevDebugCamFOV; + private float camRoll; + private float prevCamRoll; + + /** + * CheatBreaker - Counts up when Slow Chunk Loading is active and stops chunk loading from occurring when the timer is not 0. + */ + private float chunkLoadTimer = 0.0f; + + /** + * The texture id of the blocklight/skylight texture used for lighting effects + */ + private final DynamicTexture lightmapTexture; + + /** + * Colors computed in updateLightmap() and loaded into the lightmap emptyTexture + */ + private final int[] lightmapColors; + private final ResourceLocation locationLightMap; + + /** FOV modifier hand */ + private float fovModifierHand; + + /** FOV modifier hand prev */ + private float fovModifierHandPrev; + + /** FOV multiplier temp */ + private float fovMultiplierTemp; + private float bossColorModifier; + private float bossColorModifierPrev; + + /** Cloud fog mode */ + private boolean cloudFog; + private final IResourceManager resourceManager; + public ShaderGroup theShaderGroup; + private static final ResourceLocation[] shaderResourceLocations = new ResourceLocation[] {new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json")}; + private static final ResourceLocation guiBlurResourceLocation = new ResourceLocation("shaders/post/animblur.json"); + private static final ResourceLocation oldMotionBlurResourceLocation = new ResourceLocation("shaders/post/motionblur.json"); + private static final ResourceLocation lunarMotionBlurResourceLocation = new ResourceLocation("shaders/post/lunar_motionblur.json"); + public static final int shaderCount = shaderResourceLocations.length; + private int shaderIndex; + private double cameraZoom; + private double cameraYaw; + private double cameraPitch; + + /** Previous frame time in milliseconds */ + private long prevFrameTime; + + /** End time of last render (ns) */ + private long renderEndNanoTime; + + /** + * Is set, updateCameraAndRender() calls updateLightmap(); set by updateTorchFlicker() + */ + private boolean lightmapUpdateNeeded; + + /** Torch flicker X */ + float torchFlickerX; + + /** Torch flicker DX */ + float torchFlickerDX; + + /** Torch flicker Y */ + float torchFlickerY; + + /** Torch flicker DY */ + float torchFlickerDY; + private Random random; + + /** Rain sound counter */ + private int rainSoundCounter; + + /** Rain X coords */ + float[] rainXCoords; + + /** Rain Y coords */ + float[] rainYCoords; + + /** Fog color buffer */ + FloatBuffer fogColorBuffer; + + /** red component of the fog color */ + float fogColorRed; + + /** green component of the fog color */ + float fogColorGreen; + + /** blue component of the fog color */ + float fogColorBlue; + + /** Fog color 2 */ + private float fogColor2; + + /** Fog color 1 */ + private float fogColor1; + + /** + * Debug view direction (0=OFF, 1=Front, 2=Right, 3=Back, 4=Left, 5=TiltLeft, 6=TiltRight) + */ + public int debugViewDirection; + private boolean initialized = false; + private World updatedWorld = null; + private boolean showDebugInfo = false; + public boolean fogStandard = false; + private long lastServerTime = 0L; + private int lastServerTicks = 0; + private int serverWaitTime = 0; + private int serverWaitTimeCurrent = 0; + private float avgServerTimeDiff = 0.0F; + private float avgServerTickDiff = 0.0F; + public long[] frameTimes = new long[512]; + public long[] tickTimes = new long[512]; + public long[] chunkTimes = new long[512]; + public long[] serverTimes = new long[512]; + public int numRecordedFrameTimes = 0; + public long prevFrameTimeNano = -1L; + private boolean lastShowDebugInfo = false; + private boolean showExtendedDebugInfo = false; + private long lastErrorCheckTimeMs = 0L; + private ShaderGroup[] fxaaShaders = new ShaderGroup[10]; + public int frameCount; + + public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_) { + this.shaderIndex = shaderCount; + this.cameraZoom = 1.0D; + this.prevFrameTime = Minecraft.getSystemTime(); + this.random = new Random(); + this.fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); + this.mc = p_i45076_1_; + this.resourceManager = p_i45076_2_; + this.theMapItemRenderer = new MapItemRenderer(p_i45076_1_.getTextureManager()); + this.itemRenderer = new ItemRenderer(p_i45076_1_); + this.lightmapTexture = new DynamicTexture(16, 16); + this.locationLightMap = p_i45076_1_.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); + this.lightmapColors = this.lightmapTexture.getTextureData(); + this.theShaderGroup = null; + } + + public boolean isShaderActive() { + return OpenGlHelper.shadersSupported && this.theShaderGroup != null; + } + + public void stopUseShader() { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + + this.theShaderGroup = null; + this.shaderIndex = shaderCount; + } + + public void activateNextShader() { + if (OpenGlHelper.isFramebufferEnabled()) { + if (OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + + this.shaderIndex = (this.shaderIndex + 1) % (shaderResourceLocations.length + 1); + + if (this.shaderIndex != shaderCount) { + try { + logger.info("Selecting effect " + shaderResourceLocations[this.shaderIndex]); + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + } catch (IOException var2) { + logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], var2); + this.shaderIndex = shaderCount; + } catch (JsonSyntaxException var3) { + logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], var3); + this.shaderIndex = shaderCount; + } + } else { + this.theShaderGroup = null; + logger.info("No effect selected"); + } + } + } + } + + public void loadGuiBlurShader() { + if (OpenGlHelper.isFramebufferEnabled() && OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + try { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), guiBlurResourceLocation); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + } catch (Exception ignored) { + } + } + } + + public void loadMotionBlurShader() { + if (OpenGlHelper.isFramebufferEnabled() && OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + ResourceLocation motionBlurLocation = (Boolean) CheatBreaker.getInstance().getModuleManager().motionBlurMod.oldBlur.getValue() ? oldMotionBlurResourceLocation : lunarMotionBlurResourceLocation; + try { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), motionBlurLocation); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + } catch (Exception exception) { + logger.warn("Failed to load shader: " + motionBlurLocation, exception); + } + } + } + + public void onResourceManagerReload(IResourceManager par1ResourceManager) { + if (this.theShaderGroup != null) { + this.theShaderGroup.deleteShaderGroup(); + } + + if (OpenGlHelper.isFramebufferEnabled()) { + if (this.shaderIndex != shaderCount) { + try { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), par1ResourceManager, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + } catch (IOException var3) { + logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], var3); + this.shaderIndex = shaderCount; + } + } + } + } + + /** + * Updates the entity renderer + */ + public void updateRenderer() { + if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { + ShaderLinkHelper.setNewStaticShaderLinkHelper(); + } + + this.updateFovModifierHand(); + this.updateTorchFlicker(); + this.fogColor2 = this.fogColor1; + this.thirdPersonDistanceTemp = this.thirdPersonDistance; + this.prevDebugCamYaw = this.debugCamYaw; + this.prevDebugCamPitch = this.debugCamPitch; + this.prevDebugCamFOV = this.debugCamFOV; + this.prevCamRoll = this.camRoll; + float var1; + float var2; + + if (this.mc.gameSettings.smoothCamera) { + var1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + var2 = var1 * var1 * var1 * 8.0F; + this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * var2); + this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * var2); + this.smoothCamPartialTicks = 0.0F; + this.smoothCamYaw = 0.0F; + this.smoothCamPitch = 0.0F; + } + + if (this.mc.renderViewEntity == null) { + this.mc.renderViewEntity = this.mc.thePlayer; + } + + var1 = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(this.mc.renderViewEntity.posX), MathHelper.floor_double(this.mc.renderViewEntity.posY), MathHelper.floor_double(this.mc.renderViewEntity.posZ)); + var2 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; + float var3 = var1 * (1.0F - var2) + var2; + this.fogColor1 += (var3 - this.fogColor1) * 0.1F; + ++this.rendererUpdateCount; + this.itemRenderer.updateEquippedItem(); + this.addRainParticles(); + this.bossColorModifierPrev = this.bossColorModifier; + + if (BossStatus.hasColorModifier) { + this.bossColorModifier += 0.05F; + + if (this.bossColorModifier > 1.0F) { + this.bossColorModifier = 1.0F; + } + + BossStatus.hasColorModifier = false; + } else if (this.bossColorModifier > 0.0F) { + this.bossColorModifier -= 0.0125F; + } + } + + public ShaderGroup getShaderGroup() { + return this.theShaderGroup; + } + + public void updateShaderGroupSize(int p_147704_1_, int p_147704_2_) { + if (OpenGlHelper.shadersSupported && this.theShaderGroup != null) { + this.theShaderGroup.createBindFramebuffers(p_147704_1_, p_147704_2_); + } + } + + /** + * Finds what block or object the mouse is over at the specified partial tick time. Args: partialTickTime + */ + public void getMouseOver(float par1) { + if (this.mc.renderViewEntity != null && this.mc.theWorld != null) { + this.mc.pointedEntity = null; + double var2 = (double)this.mc.playerController.getBlockReachDistance(); + this.mc.objectMouseOver = this.mc.renderViewEntity.rayTrace(var2, par1); + double var4 = var2; + Vec3 var6 = this.mc.renderViewEntity.getPosition(par1); + + if (this.mc.playerController.extendedReach()) { + var2 = 6.0D; + var4 = 6.0D; + } else { + if (var2 > 3.0D) { + var4 = 3.0D; + } + + var2 = var4; + } + + if (this.mc.objectMouseOver != null) { + var4 = this.mc.objectMouseOver.hitVec.distanceTo(var6); + } + + Vec3 var7 = this.mc.renderViewEntity.getLook(par1); + Vec3 var8 = var6.addVector(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2); + this.pointedEntity = null; + Vec3 var9 = null; + float var10 = 1.0F; + List var11 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2).expand((double)var10, (double)var10, (double)var10)); + double var12 = var4; + + for (int var14 = 0; var14 < var11.size(); ++var14) { + Entity var15 = (Entity)var11.get(var14); + + if (var15.canBeCollidedWith()) { + float var16 = var15.getCollisionBorderSize(); + AxisAlignedBB var17 = var15.boundingBox.expand((double)var16, (double)var16, (double)var16); + MovingObjectPosition var18 = var17.calculateIntercept(var6, var8); + + if (var17.isVecInside(var6)) { + if (0.0D < var12 || var12 == 0.0D) { + this.pointedEntity = var15; + var9 = var18 == null ? var6 : var18.hitVec; + var12 = 0.0D; + } + } else if (var18 != null) { + double var19 = var6.distanceTo(var18.hitVec); + + if (var19 < var12 || var12 == 0.0D) { + boolean canRiderInteract = false; + + if (var15 == this.mc.renderViewEntity.ridingEntity && !canRiderInteract) { + if (var12 == 0.0D) { + this.pointedEntity = var15; + var9 = var18.hitVec; + } + } else { + this.pointedEntity = var15; + var9 = var18.hitVec; + var12 = var19; + } + } + } + } + } + + if (this.pointedEntity != null && (var12 < var4 || this.mc.objectMouseOver == null)) { + this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity, var9); + + if (this.pointedEntity instanceof EntityLivingBase || this.pointedEntity instanceof EntityItemFrame) { + this.mc.pointedEntity = this.pointedEntity; + } + } + } + } + + /** + * Update FOV modifier hand + */ + private void updateFovModifierHand() { + if (this.mc.renderViewEntity instanceof EntityPlayerSP) { + EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity; + this.fovMultiplierTemp = var1.getFOVMultiplier(); + } else { + this.fovMultiplierTemp = this.mc.thePlayer.getFOVMultiplier(); + } + + this.fovModifierHandPrev = this.fovModifierHand; + this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; + + if (this.fovModifierHand > 1.5F) { + this.fovModifierHand = 1.5F; + } + + if (this.fovModifierHand < 0.1F) { + this.fovModifierHand = 0.1F; + } + } + + /** + * Changes the field of view of the player depending on if they are underwater or not + */ + private float getFOVModifier(float par1, boolean par2) { + if (this.debugViewDirection > 0) { + return 90.0F; + } else { + EntityLivingBase var3 = this.mc.renderViewEntity; + float var4 = 70.0F; + + if (par2) { + var4 = this.mc.gameSettings.fovSetting; + + if (Config.isDynamicFov()) { + var4 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * par1; + } + } + + boolean zoomActive = false; + + if (this.mc.currentScreen == null) { + if (this.mc.gameSettings.ofKeyBindZoom.getKeyCode() < 0) { + zoomActive = Mouse.isButtonDown(this.mc.gameSettings.ofKeyBindZoom.getKeyCode() + 100); + } else { + zoomActive = Keyboard.isKeyDown(this.mc.gameSettings.ofKeyBindZoom.getKeyCode()); + } + } + + if (zoomActive) { + if (!Config.zoomMode) { + Config.zoomMode = true; + this.mc.gameSettings.smoothCamera = true; + } + + if (Config.zoomMode) { + var4 /= 4.0F; + } + } else if (Config.zoomMode) { + Config.zoomMode = false; + this.mc.gameSettings.smoothCamera = false; + this.mouseFilterXAxis = new MouseFilter(); + this.mouseFilterYAxis = new MouseFilter(); + } + + if (var3.getHealth() <= 0.0F) { + float var6 = (float)var3.deathTime + par1; + var4 /= (1.0F - 500.0F / (var6 + 500.0F)) * 2.0F + 1.0F; + } + + Block var61 = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, var3, par1); + + if (var61.getMaterial() == Material.water) { + var4 = var4 * 60.0F / 70.0F; + } + + return var4 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * par1; + } + } + + private void hurtCameraEffect(float par1) { + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + boolean disableHurtCam = perspectiveMod.isEnabled() && !perspectiveMod.damageAffectsCamera.getBooleanValue(); + float hurtCameraIntensity = perspectiveMod.hurtCameraIntensity.getFloatValue(); + + if (disableHurtCam) + return; + + EntityLivingBase var2 = this.mc.renderViewEntity; + float var3 = (float)var2.hurtTime - par1; + float var4; + + if (var2.getHealth() <= 0.0F) { + var4 = (float)var2.deathTime + par1; + GL11.glRotatef(40.0F - 8000.0F / (var4 + 200.0F), 0.0F, 0.0F, 1.0F); + } + + if (var3 >= 0.0F) { + var3 /= (float)var2.maxHurtTime; + var3 = MathHelper.sin(var3 * var3 * var3 * var3 * (float)Math.PI); + var4 = var2.attackedAtYaw; + GL11.glRotatef(-var4, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var3 * (perspectiveMod.isEnabled() ? hurtCameraIntensity : 14.0F), 0.0F, 0.0F, 1.0F); + GL11.glRotatef(var4, 0.0F, 1.0F, 0.0F); + } + } + + /** + * Setups all the GL settings for view bobbing. Args: partialTickTime + */ + private void setupViewBobbing(float par1) { + if (this.mc.renderViewEntity instanceof EntityPlayer) { + EntityPlayer var2 = (EntityPlayer)this.mc.renderViewEntity; + float var3 = var2.distanceWalkedModified - var2.prevDistanceWalkedModified; + float var4 = -(var2.distanceWalkedModified + var3 * par1); + float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * par1; + float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * par1; + GL11.glTranslatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 0.5F, -Math.abs(MathHelper.cos(var4 * (float)Math.PI) * var5), 0.0F); + GL11.glRotatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 3.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(Math.abs(MathHelper.cos(var4 * (float)Math.PI - 0.2F) * var5) * 5.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var6, 1.0F, 0.0F, 0.0F); + } + } + + private void freelookOrientCamera(float var1) { + ModuleDragToLook var2 = CheatBreaker.getInstance().getModuleManager().dragToLook; + EntityLivingBase var3 = this.mc.renderViewEntity; + float var4 = var3.yOffset - 1.62f; + double var5 = var3.prevPosX + (var3.posX - var3.prevPosX) * (double)var1; + double var7 = var3.prevPosY + (var3.posY - var3.prevPosY) * (double)var1 - (double)var4; + double var9 = var3.prevPosZ + (var3.posZ - var3.prevPosZ) * (double)var1; + GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * var1, 0.0f, 0.0f, 1.0f); + if (var3.isPlayerSleeping()) { + var4 = (float)((double)var4 + 1.0); + GL11.glTranslatef(0.0f, 0.3f, 0.0f); + if (!this.mc.gameSettings.debugCamEnable) { + Block var11 = this.mc.theWorld.getBlock(MathHelper.floor_double(var3.posX), MathHelper.floor_double(var3.posY), MathHelper.floor_double(var3.posZ)); + if (var11 == Blocks.bed) { + int var12 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var3.posX), MathHelper.floor_double(var3.posY), MathHelper.floor_double(var3.posZ)); + int var13 = var12 & 3; + GL11.glRotatef(var13 * 90, 0.0f, 1.0f, 0.0f); + } + GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1 + 180.0f, 0.0f, -1.0f, 0.0f); + GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1, -1.0f, 0.0f, 0.0f); + } + } else if (this.mc.gameSettings.thirdPersonView > 0) { + double var28 = this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * var1; + if (this.mc.gameSettings.debugCamEnable) { + float var29 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * var1; + float var14 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * var1; + GL11.glTranslatef(0.0f, 0.0f, (float)(-var28)); + GL11.glRotatef(var14, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(var29, 0.0f, 1.0f, 0.0f); + } else { + float var29 = var2.rotationYaw; + float var14 = var2.rotationPitch; + if (this.mc.gameSettings.thirdPersonView == 2) { + var14 += 180.0f; + } + double var15 = (double)(-MathHelper.sin(var29 / 180.0f * 1.4545455f * 2.1598449f) * MathHelper.cos(var14 / 180.0f * 15.315265f * 0.20512821f)) * var28; + double var17 = (double)(MathHelper.cos(var29 / 180.0f * 1.6923077f * 1.8563957f) * MathHelper.cos(var14 / 180.0f * 0.97590363f * 3.219163f)) * var28; + double var19 = (double)(-MathHelper.sin(var14 / 180.0f * 2.8235295f * 1.1126474f)) * var28; + for (int var21 = 0; var21 < 8; ++var21) { + double var26; + MovingObjectPosition var25; + float var22 = (var21 & 1) * 2 - 1; + float var23 = (var21 >> 1 & 1) * 2 - 1; + float var24 = (var21 >> 2 & 1) * 2 - 1; + if ((var25 = this.mc.theWorld.rayTraceBlocks(Vec3.createVectorHelper(var5 + (double)(var22 *= 0.1f), var7 + (double)(var23 *= 0.1f), var9 + (double)(var24 *= 0.1f)), Vec3.createVectorHelper(var5 - var15 + (double)var22 + (double)var24, var7 - var19 + (double)var23, var9 - var17 + (double)var24))) == null || !((var26 = var25.hitVec.distanceTo(Vec3.createVectorHelper(var5, var7, var9))) < var28)) continue; + var28 = var26; + } + if (this.mc.gameSettings.thirdPersonView == 2) { + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + } + GL11.glRotatef(var2.rotationPitch - var14, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(var2.rotationYaw - var29, 0.0f, 1.0f, 0.0f); + GL11.glTranslatef(0.0f, 0.0f, (float)(-var28)); + GL11.glRotatef(var29 - var2.rotationYaw, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(var14 - var2.rotationPitch, 1.0f, 0.0f, 0.0f); + } + } else { + GL11.glTranslatef(0.0f, 0.0f, -0.1f); + } + if (!this.mc.gameSettings.debugCamEnable) { + GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1 + 180.0f, 0.0f, 1.0f, 0.0f); + } + GL11.glTranslatef(0.0f, var4, 0.0f); + var5 = var3.prevPosX + (var3.posX - var3.prevPosX) * (double)var1; + var7 = var3.prevPosY + (var3.posY - var3.prevPosY) * (double)var1 - (double)var4; + var9 = var3.prevPosZ + (var3.posZ - var3.prevPosZ) * (double)var1; + this.cloudFog = this.mc.renderGlobal.hasCloudFog(var5, var7, var9, var1); + } + + /** + * sets up player's eye (or camera in third person mode) + */ + private void orientCamera(float par1) { + EntityLivingBase var2 = this.mc.renderViewEntity; + float var3 = var2.yOffset - 1.62F; + double var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; + double var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; + double var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; + GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * par1, 0.0F, 0.0F, 1.0F); + + if (var2.isPlayerSleeping()) { + var3 = (float)((double)var3 + 1.0D); + GL11.glTranslatef(0.0F, 0.3F, 0.0F); + + if (!this.mc.gameSettings.debugCamEnable) { + Block var27 = this.mc.theWorld.getBlock(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); + + if (var27 == Blocks.bed) { + int var11 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); + int var13 = var11 & 3; + GL11.glRotatef((float)(var13 * 90), 0.0F, 1.0F, 0.0F); + } + + GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0f, 0.0f, -1.0f, 0.0f); + GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, -1.0f, 0.0f, 0.0f); + } + } else if (this.mc.gameSettings.thirdPersonView > 0) { + double var271 = (double)(this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * par1); + float var28; + float var281; + + if (this.mc.gameSettings.debugCamEnable) { + var28 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * par1; + var281 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * par1; + GL11.glTranslatef(0.0F, 0.0F, (float)(-var271)); + GL11.glRotatef(var281, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var28, 0.0F, 1.0F, 0.0F); + } else { + var28 = var2.rotationYaw; + var281 = var2.rotationPitch; + + if (this.mc.gameSettings.thirdPersonView == 2) { + var281 += 180.0F; + } + + double var14 = (double)(-MathHelper.sin(var28 / 180.0F * (float)Math.PI) * MathHelper.cos(var281 / 180.0F * (float)Math.PI)) * var271; + double var16 = (double)(MathHelper.cos(var28 / 180.0F * (float)Math.PI) * MathHelper.cos(var281 / 180.0F * (float)Math.PI)) * var271; + double var18 = (double)(-MathHelper.sin(var281 / 180.0F * (float)Math.PI)) * var271; + + for (int var20 = 0; var20 < 8; ++var20) { + float var21 = (float)((var20 & 1) * 2 - 1); + float var22 = (float)((var20 >> 1 & 1) * 2 - 1); + float var23 = (float)((var20 >> 2 & 1) * 2 - 1); + var21 *= 0.1F; + var22 *= 0.1F; + var23 *= 0.1F; + MovingObjectPosition var24 = this.mc.theWorld.rayTraceBlocks(Vec3.createVectorHelper(var4 + (double)var21, var6 + (double)var22, var8 + (double)var23), Vec3.createVectorHelper(var4 - var14 + (double)var21 + (double)var23, var6 - var18 + (double)var22, var8 - var16 + (double)var23)); + + if (var24 != null) { + double var25 = var24.hitVec.distanceTo(Vec3.createVectorHelper(var4, var6, var8)); + + if (var25 < var271) { + var271 = var25; + } + } + } + + if (this.mc.gameSettings.thirdPersonView == 2) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + GL11.glRotatef(var2.rotationPitch - var281, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var2.rotationYaw - var28, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.0F, (float)(-var271)); + GL11.glRotatef(var28 - var2.rotationYaw, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var281 - var2.rotationPitch, 1.0F, 0.0F, 0.0F); + } + } else { + GL11.glTranslatef(0.0F, 0.0F, -0.1F); + } + + if (!this.mc.gameSettings.debugCamEnable) { + GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0f, 0.0f, 1.0f, 0.0f); + } + + GL11.glTranslatef(0.0F, var3, 0.0F); + var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; + var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; + var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; + this.cloudFog = this.mc.renderGlobal.hasCloudFog(var4, var6, var8, par1); + } + + /** + * sets up projection, view effects, camera position/rotation + */ + public void setupCameraTransform(float par1, int par2, boolean dragToLookEnabled) { + this.farPlaneDistance = (float)(this.mc.gameSettings.renderDistanceChunks * 16); + + if (Config.isFogFancy()) { + this.farPlaneDistance *= 0.95F; + } + + if (Config.isFogFast()) { + this.farPlaneDistance *= 0.83F; + } + + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + float var3 = 0.07F; + + if (this.mc.gameSettings.anaglyph) { + GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); + } + + float clipDistance = this.farPlaneDistance * 2.0F; + + if (clipDistance < 128.0F) { + clipDistance = 128.0F; + } + + if (this.mc.theWorld.provider.dimensionId == 1) { + clipDistance = 256.0F; + } + + if (this.cameraZoom != 1.0D) { + GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); + GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); + } + + Project.gluPerspective(this.getFOVModifier(par1, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, clipDistance); + float var4; + + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { + var4 = 0.6666667F; + GL11.glScalef(1.0F, var4, 1.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + + if (this.mc.gameSettings.anaglyph) { + GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + this.hurtCameraEffect(par1); + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + if (this.mc.gameSettings.viewBobbing) { + if (perspectiveMod.isEnabled()) { + perspectiveMod.setupViewBobbing(par1, perspectiveMod.bobScreen); + } else { + this.setupViewBobbing(par1); + } + } + + var4 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; + + if (var4 > 0.0F) { + int var7 = 20; + + if (this.mc.thePlayer.isPotionActive(Potion.confusion)) { + var7 = 7; + } + + float var6 = 5.0F / (var4 * var4 + 5.0F) - var4 * 0.04F; + var6 *= var6; + GL11.glRotatef(((float)this.rendererUpdateCount + par1) * (float)var7, 0.0F, 1.0F, 1.0F); + GL11.glScalef(1.0F / var6, 1.0F, 1.0F); + GL11.glRotatef(-((float)this.rendererUpdateCount + par1) * (float)var7, 0.0F, 1.0F, 1.0F); + } + + if (dragToLookEnabled) { + this.freelookOrientCamera(par1); + } else { + this.orientCamera(par1); + } + + if (this.debugViewDirection > 0) { + int var71 = this.debugViewDirection - 1; + + if (var71 == 1) { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + } + + if (var71 == 2) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + if (var71 == 3) { + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + + if (var71 == 4) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (var71 == 5) { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + } + } + + /** + * Render player hand + */ + public void renderHand(float partialTicks, int pass) { + this.renderHand(partialTicks, pass, true, true, false); + } + + public void renderHand(float par1, int par2, boolean renderItem, boolean renderOverlay, boolean renderTranslucent) { + if (this.debugViewDirection <= 0) { + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + float var3 = 0.07F; + + if (this.mc.gameSettings.anaglyph) { + GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); + } + + if (this.cameraZoom != 1.0D) { + GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); + GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); + } + + if (Config.isShaders()) { + Shaders.applyHandDepth(); + } + + Project.gluPerspective(this.getFOVModifier(par1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); + + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { + float shouldRenderHand = 0.6666667F; + GL11.glScalef(1.0F, shouldRenderHand, 1.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + + if (this.mc.gameSettings.anaglyph) { + GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + ModulePerspective perspectiveMod = CheatBreaker.getInstance().getModuleManager().perspectiveMod; + if (renderItem) { + GL11.glPushMatrix(); + this.hurtCameraEffect(par1); + + if (this.mc.gameSettings.viewBobbing) { + if (perspectiveMod.isEnabled()) { + perspectiveMod.setupViewBobbing(par1, perspectiveMod.bobHand); + } else { + this.setupViewBobbing(par1); + } + } + + boolean shouldRenderHand1 = !ReflectorForge.renderFirstPersonHand(this.mc.renderGlobal, par1, par2); + + if (shouldRenderHand1 && this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { + this.enableLightmap((double)par1); + + if (Config.isShaders()) { + ShadersRender.renderItemFP(this.itemRenderer, par1, renderTranslucent); + } else { + this.itemRenderer.renderItemInFirstPerson(par1); + } + + this.disableLightmap((double)par1); + } + + GL11.glPopMatrix(); + } + + if (!renderOverlay) { + return; + } + + this.disableLightmap((double)par1); + + if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { + this.itemRenderer.renderOverlays(par1); + this.hurtCameraEffect(par1); + } + + if (this.mc.gameSettings.viewBobbing) { + if (perspectiveMod.isEnabled()) { + perspectiveMod.setupViewBobbing(par1, perspectiveMod.bobHand); + } else { + this.setupViewBobbing(par1); + } + } + } + } + + /** + * Disable secondary texture unit used by lightmap + */ + public void disableLightmap(double par1) { + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + + if (Config.isShaders()) { + Shaders.disableLightmap(); + } + } + + /** + * Enable lightmap in secondary texture unit + */ + public void enableLightmap(double par1) { + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float var3 = 0.00390625F; + GL11.glScalef(var3, var3, var3); + GL11.glTranslatef(8.0F, 8.0F, 8.0F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.mc.getTextureManager().bindTexture(this.locationLightMap); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + + if (Config.isShaders()) { + Shaders.enableLightmap(); + } + } + + /** + * Recompute a random value that is applied to block color in updateLightmap() + */ + private void updateTorchFlicker() { + this.torchFlickerDX = (float)((double)this.torchFlickerDX + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.torchFlickerDY = (float)((double)this.torchFlickerDY + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.torchFlickerDX = (float)((double)this.torchFlickerDX * 0.9D); + this.torchFlickerDY = (float)((double)this.torchFlickerDY * 0.9D); + this.torchFlickerX += (this.torchFlickerDX - this.torchFlickerX) * 1.0F; + this.torchFlickerY += (this.torchFlickerDY - this.torchFlickerY) * 1.0F; + this.lightmapUpdateNeeded = true; + } + + private void updateLightmap(float par1) { + WorldClient var2 = this.mc.theWorld; + + if (var2 != null) { + if (CustomColorizer.updateLightmap(var2, this.torchFlickerX, this.lightmapColors, this.mc.thePlayer.isPotionActive(Potion.nightVision))) { + this.lightmapTexture.updateDynamicTexture(); + this.lightmapUpdateNeeded = false; + return; + } + + for (int var3 = 0; var3 < 256; ++var3) { + float var4 = var2.getSunBrightness(1.0F) * 0.95F + 0.05F; + float var5 = var2.provider.lightBrightnessTable[var3 / 16] * var4; + float var6 = var2.provider.lightBrightnessTable[var3 % 16] * (this.torchFlickerX * 0.1F + 1.5F); + + if (var2.lastLightningBolt > 0) { + var5 = var2.provider.lightBrightnessTable[var3 / 16]; + } + + float var7 = var5 * (var2.getSunBrightness(1.0F) * 0.65F + 0.35F); + float var8 = var5 * (var2.getSunBrightness(1.0F) * 0.65F + 0.35F); + float var11 = var6 * ((var6 * 0.6F + 0.4F) * 0.6F + 0.4F); + float var12 = var6 * (var6 * var6 * 0.6F + 0.4F); + float var13 = var7 + var6; + float var14 = var8 + var11; + float var15 = var5 + var12; + var13 = var13 * 0.96F + 0.03F; + var14 = var14 * 0.96F + 0.03F; + var15 = var15 * 0.96F + 0.03F; + float var16; + + if (this.bossColorModifier > 0.0F) { + var16 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * par1; + var13 = var13 * (1.0F - var16) + var13 * 0.7F * var16; + var14 = var14 * (1.0F - var16) + var14 * 0.6F * var16; + var15 = var15 * (1.0F - var16) + var15 * 0.6F * var16; + } + + if (var2.provider.dimensionId == 1) { + var13 = 0.22F + var6 * 0.75F; + var14 = 0.28F + var11 * 0.75F; + var15 = 0.25F + var12 * 0.75F; + } + + float var17; + + if (this.mc.thePlayer.isPotionActive(Potion.nightVision)) { + var16 = this.getNightVisionBrightness(this.mc.thePlayer, par1); + var17 = 1.0F / var13; + + if (var17 > 1.0F / var14) { + var17 = 1.0F / var14; + } + + if (var17 > 1.0F / var15) { + var17 = 1.0F / var15; + } + + var13 = var13 * (1.0F - var16) + var13 * var17 * var16; + var14 = var14 * (1.0F - var16) + var14 * var17 * var16; + var15 = var15 * (1.0F - var16) + var15 * var17 * var16; + } + + if (var13 > 1.0F) { + var13 = 1.0F; + } + + if (var14 > 1.0F) { + var14 = 1.0F; + } + + if (var15 > 1.0F) { + var15 = 1.0F; + } + + var16 = this.mc.gameSettings.getGamma(); + var17 = 1.0F - var13; + float var18 = 1.0F - var14; + float var19 = 1.0F - var15; + var17 = 1.0F - var17 * var17 * var17 * var17; + var18 = 1.0F - var18 * var18 * var18 * var18; + var19 = 1.0F - var19 * var19 * var19 * var19; + var13 = var13 * (1.0F - var16) + var17 * var16; + var14 = var14 * (1.0F - var16) + var18 * var16; + var15 = var15 * (1.0F - var16) + var19 * var16; + var13 = var13 * 0.96F + 0.03F; + var14 = var14 * 0.96F + 0.03F; + var15 = var15 * 0.96F + 0.03F; + + if (var13 > 1.0F) { + var13 = 1.0F; + } + + if (var14 > 1.0F) { + var14 = 1.0F; + } + + if (var15 > 1.0F) { + var15 = 1.0F; + } + + if (var13 < 0.0F) { + var13 = 0.0F; + } + + if (var14 < 0.0F) { + var14 = 0.0F; + } + + if (var15 < 0.0F) { + var15 = 0.0F; + } + + short var20 = 255; + int var21 = (int)(var13 * 255.0F); + int var22 = (int)(var14 * 255.0F); + int var23 = (int)(var15 * 255.0F); + this.lightmapColors[var3] = var20 << 24 | var21 << 16 | var22 << 8 | var23; + } + + this.lightmapTexture.updateDynamicTexture(); + this.lightmapUpdateNeeded = false; + } + } + + /** + * Gets the night vision brightness + */ + public float getNightVisionBrightness(EntityPlayer par1EntityPlayer, float par2) { + int var3 = par1EntityPlayer.getActivePotionEffect(Potion.nightVision).getDuration(); + return var3 > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)var3 - par2) * (float)Math.PI * 0.2F) * 0.3F; + } + + /** + * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI + */ + public void updateCameraAndRender(float par1) { + this.mc.mcProfiler.startSection("lightTex"); + + if (!this.initialized) { + TextureUtils.registerResourceListener(); + RenderPlayerOF.register(); + ItemRendererOF world = new ItemRendererOF(this.mc); + this.itemRenderer = world; + RenderManager.instance.itemRenderer = world; + + if (Config.getBitsOs() == 64 && Config.getBitsJre() == 32) { + Config.setNotify64BitJava(true); + } + + this.initialized = true; + } + + Config.checkDisplayMode(); + WorldClient world1 = this.mc.theWorld; + + if (world1 != null) { + if (Config.getNewRelease() != null) { + String var2 = "HD_U".replace("HD_U", "HD Ultra").replace("L", "Light"); + String var13 = var2 + " " + Config.getNewRelease(); + ChatComponentText var14 = new ChatComponentText(I18n.format("of.message.newVersion", new Object[] {var13})); + this.mc.ingameGUI.getChatGUI().func_146227_a(var14); + Config.setNewRelease((String)null); + } + + if (Config.isNotify64BitJava()) { + Config.setNotify64BitJava(false); + ChatComponentText var21 = new ChatComponentText(I18n.format("of.message.java64Bit", new Object[0])); + this.mc.ingameGUI.getChatGUI().func_146227_a(var21); + } + } + + if (this.mc.currentScreen instanceof GuiMainMenu) { + this.updateMainMenu((GuiMainMenu)this.mc.currentScreen); + } + + if (this.updatedWorld != world1) { + RandomMobs.worldChanged(this.updatedWorld, world1); + Config.updateThreadPriorities(); + this.lastServerTime = 0L; + this.lastServerTicks = 0; + this.updatedWorld = world1; + } + + if (ShaderLinkHelper.getStaticShaderLinkHelper() != null && !this.setFxaaShader(Shaders.configAntialiasingLevel)) { + Shaders.configAntialiasingLevel = 0; + } + + RenderBlocks.fancyGrass = Config.isGrassFancy() || Config.isBetterGrassFancy(); + Blocks.leaves.func_150122_b(Config.isTreesFancy()); + + if (this.lightmapUpdateNeeded) { + this.updateLightmap(par1); + } + + this.mc.mcProfiler.endSection(); + boolean var22 = Display.isActive(); + + if (!var22 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) { + if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) { + this.mc.displayInGameMenu(); + } + } else { + this.prevFrameTime = Minecraft.getSystemTime(); + } + + this.mc.mcProfiler.startSection("mouse"); + + if (this.mc.inGameHasFocus && var22) { + this.mc.mouseHelper.mouseXYChange(); + float var132 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + float var141 = var132 * var132 * var132 * 8.0F; + float var15 = (float)this.mc.mouseHelper.deltaX * var141; + float var16 = (float)this.mc.mouseHelper.deltaY * var141; + byte var17 = 1; + + if (this.mc.gameSettings.invertMouse) { + var17 = -1; + } + + ModuleDragToLook var9 = CheatBreaker.getInstance().getModuleManager().dragToLook; + if (!var9.enabled) { + if (this.mc.gameSettings.smoothCamera) { + this.smoothCamYaw += var15; + this.smoothCamPitch += var16; + float var10 = par1 - this.smoothCamPartialTicks; + this.smoothCamPartialTicks = par1; + var15 = this.smoothCamFilterX * var10; + var16 = this.smoothCamFilterY * var10; + this.mc.thePlayer.setAngles(var15, var16 * (float)var17); + } else { + this.mc.thePlayer.setAngles(var15, var16 * (float)var17); + } + } else if (this.mc.gameSettings.smoothCamera) { + this.smoothCamYaw += var15; + this.smoothCamPitch += var16; + float var18 = par1 - this.smoothCamPartialTicks; + this.smoothCamPartialTicks = par1; + var15 = this.smoothCamFilterX * var18; + var16 = this.smoothCamFilterY * var18; + var9.setAngles(var15, var16 * (float)var17); + } else { + var9.setAngles(var15, var16 * (float)var17); + } + } + + this.mc.mcProfiler.endSection(); + + if (!this.mc.skipRenderWorld) { + anaglyphEnable = this.mc.gameSettings.anaglyph; + final ScaledResolution var133 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int var142 = var133.getScaledWidth(); + int var151 = var133.getScaledHeight(); + final int var161 = Mouse.getX() * var142 / this.mc.displayWidth; + final int var171 = var151 - Mouse.getY() * var151 / this.mc.displayHeight - 1; + int var181 = this.mc.gameSettings.limitFramerate; + boolean var12; + + if (this.mc.theWorld != null) { + this.mc.mcProfiler.startSection("level"); + + if (this.mc.isFramerateLimitBelowMax()) { + this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var181)); + } else { + this.renderWorld(par1, 0L); + } + + if (OpenGlHelper.shadersSupported) { + if (this.theShaderGroup != null) { + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + this.theShaderGroup.loadShaderGroup(par1); + GL11.glPopMatrix(); + } + + this.mc.getFramebuffer().bindFramebuffer(true); + } + + this.renderEndNanoTime = System.nanoTime(); + this.mc.mcProfiler.endStartSection("gui"); + + if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + var12 = this.mc.gameSettings.fancyGraphics; + + if (!Config.isVignetteEnabled()) { + this.mc.gameSettings.fancyGraphics = false; + } + + this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var161, var171); + this.mc.gameSettings.fancyGraphics = var12; + + if (this.mc.gameSettings.ofShowFps && !this.mc.gameSettings.showDebugInfo) { + Config.drawFps(); + } + } + + this.mc.mcProfiler.endSection(); + } else { + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + this.setupOverlayRendering(); + this.renderEndNanoTime = System.nanoTime(); + } + + if (this.mc.currentScreen != null) { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + + try { + var12 = false; + + if (Reflector.EventBus_post.exists()) { + var12 = Reflector.postForgeBusEvent(Reflector.DrawScreenEvent_Pre_Constructor, new Object[] {this.mc.currentScreen, Integer.valueOf(var161), Integer.valueOf(var171), Float.valueOf(par1)}); + } + + if (!var12) { + this.mc.currentScreen.drawScreen(var161, var171, par1); + } + + Reflector.postForgeBusEvent(Reflector.DrawScreenEvent_Post_Constructor, new Object[] {this.mc.currentScreen, Integer.valueOf(var161), Integer.valueOf(var171), Float.valueOf(par1)}); + } catch (Throwable var131) { + CrashReport var10 = CrashReport.makeCrashReport(var131, "Rendering screen"); + CrashReportCategory var11 = var10.makeCategory("Screen render details"); + var11.addCrashSectionCallable("Screen name", () -> EntityRenderer.this.mc.currentScreen.getClass().getCanonicalName()); + var11.addCrashSectionCallable("Mouse location", () -> String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[] {Integer.valueOf(var161), Integer.valueOf(var171), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())})); + var11.addCrashSectionCallable("Screen size", () -> String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[] {Integer.valueOf(var133.getScaledWidth()), Integer.valueOf(var133.getScaledHeight()), Integer.valueOf(EntityRenderer.this.mc.displayWidth), Integer.valueOf(EntityRenderer.this.mc.displayHeight), Integer.valueOf(var133.getScaleFactor())})); + throw new ReportedException(var10); + } + } + } + + this.frameFinish(); + this.waitForServerThread(); + + if (this.mc.gameSettings.showDebugInfo != this.lastShowDebugInfo) { + this.showExtendedDebugInfo = this.mc.gameSettings.showDebugProfilerChart; + this.lastShowDebugInfo = this.mc.gameSettings.showDebugInfo; + } + + if (this.mc.gameSettings.showDebugInfo) { + this.showLagometer(this.mc.mcProfiler.timeTickNano, this.mc.mcProfiler.timeUpdateChunksNano); + } + + if (this.mc.gameSettings.ofProfiler) { + this.mc.gameSettings.showDebugProfilerChart = true; + } + } + + public void func_152430_c(float p_152430_1_) { + this.setupOverlayRendering(); + } + + public void renderWorld(float par1, long par2) { + boolean isShaders = Config.isShaders(); + + if (isShaders) { + Shaders.beginRender(this.mc, par1, par2); + } + + float slowChunkLoadingValue = (Float) CheatBreaker.getInstance().getGlobalSettings().slowChunkLoading.getValue(); + if (slowChunkLoadingValue == 0.0f || !(Boolean) CheatBreaker.getInstance().getGlobalSettings().enableFpsBoost.getValue()) { + this.chunkLoadTimer = 0.0f; + } + + float partialTicks = par1; + this.mc.mcProfiler.startSection("lightTex"); + + if (this.lightmapUpdateNeeded) { + this.updateLightmap(par1); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + + if (this.mc.renderViewEntity == null) { + this.mc.renderViewEntity = this.mc.thePlayer; + } + boolean dragToLookEnabled = CheatBreaker.getInstance().getModuleManager().dragToLook.enabled; + this.mc.mcProfiler.endStartSection("pick"); + this.getMouseOver(par1); + EntityLivingBase var4 = this.mc.renderViewEntity; + RenderGlobal var5 = this.mc.renderGlobal; + EffectRenderer var6 = this.mc.effectRenderer; + double var7 = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double) par1; + double var9 = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double) par1; + double var11 = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double) par1; + this.mc.mcProfiler.endStartSection("center"); + + for (int var13 = 0; var13 < 2; ++var13) { + if (this.mc.gameSettings.anaglyph) { + anaglyphField = var13; + + if (anaglyphField == 0) { + GL11.glColorMask(false, true, true, false); + } else { + GL11.glColorMask(true, false, false, false); + } + } + + if (isShaders) { + Shaders.beginRenderPass(2, par1, par2); + } + + this.mc.mcProfiler.endStartSection("clear"); + + if (isShaders) { + Shaders.setViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + } else { + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + } + + this.updateFogColor(par1); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + + if (isShaders) { + Shaders.clearRenderBuffer(); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + this.mc.mcProfiler.endStartSection("camera"); + this.setupCameraTransform(par1, var13, dragToLookEnabled); + + if (isShaders) { + Shaders.setCamera(par1); + } + + ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2); + this.mc.mcProfiler.endStartSection("frustrum"); + ClippingHelperImpl.getInstance(); + + if ((Config.isSkyEnabled() || Config.isSunMoonEnabled() || Config.isStarsEnabled()) && !Shaders.isShadowPass) { + this.setupFog(-1, par1); + this.mc.mcProfiler.endStartSection("sky"); + + if (isShaders) { + Shaders.beginSky(); + } + + var5.renderSky(par1); + + if (isShaders) { + Shaders.endSky(); + } + } else { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glEnable(GL11.GL_FOG); + this.setupFog(1, par1); + + if (this.mc.gameSettings.ambientOcclusion != 0) { + GL11.glShadeModel(GL11.GL_SMOOTH); + } + + this.mc.mcProfiler.endStartSection("culling"); + Frustrum var14 = new Frustrum(); + + if (isShaders) { + ShadersRender.setFrustrumPosition(var14, var7, var9, var11); + } + + var14.setPosition(var7, var9, var11); + this.mc.renderGlobal.clipRenderersByFrustum(var14, par1); + + if (var13 == 0) { + if (Config.isShaders()) { + Shaders.beginUpdateChunks(); + } + + ++this.frameCount; + this.mc.mcProfiler.endStartSection("updatechunks"); + if (this.chunkLoadTimer == 0.0f) { + while (!this.mc.renderGlobal.updateRenderers(var4, false) && par2 != 0L) { + long var17 = par2 - System.nanoTime(); + + if (var17 < 0L || var17 > 1000000000L) { + break; + } + } + + } + this.chunkLoadTimer += 1.0f; + if (this.chunkLoadTimer >= 100.0f / (100.0f - slowChunkLoadingValue * 0.995)) { + this.chunkLoadTimer = 0.0f; + } + + if (Config.isShaders()) { + Shaders.endUpdateChunks(); + } + } + + if (var4.posY < 128.0D) { + this.renderCloudsCheck(var5, par1); + } + + this.mc.mcProfiler.endStartSection("prepareterrain"); + this.setupFog(0, par1); + GL11.glEnable(GL11.GL_FOG); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("terrain"); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + + if (Config.isShaders()) { + Shaders.beginTerrain(); + } + + var5.sortAndRender(var4, 0, (double)par1); + + if (Config.isShaders()) { + Shaders.endTerrain(); + } + + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + boolean hasForge = Reflector.ForgeHooksClient.exists(); + EntityPlayer var21; + + if (this.debugViewDirection == 0) { + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + + if (hasForge) { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(0)}); + } + + var5.renderEntities(var4, var14, par1); + + if (hasForge) { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(-1)}); + } + + RenderHelper.disableStandardItemLighting(); + this.disableLightmap((double)par1); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + + if (this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) { + var21 = (EntityPlayer)var4; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.mcProfiler.endStartSection("outline"); + + if (!this.mc.gameSettings.hideGUI) { + if (CheatBreaker.getInstance().getModuleManager().blockOverlayMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().blockOverlayMod.drawSelectionBox(var21, this.mc.objectMouseOver, 0, par1, this.mc.theWorld); + } else { + var5.drawSelectionBox(var21, this.mc.objectMouseOver, 0, par1); + } + } + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + + if (this.cameraZoom == 1.0D && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !var4.isInsideOfMaterial(Material.water)) { + var21 = (EntityPlayer)var4; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.mcProfiler.endStartSection("outline"); + + if (!this.mc.gameSettings.hideGUI) { + if (CheatBreaker.getInstance().getModuleManager().blockOverlayMod.isEnabled()) { + CheatBreaker.getInstance().getModuleManager().blockOverlayMod.drawSelectionBox(var21, this.mc.objectMouseOver, 0, par1, this.mc.theWorld); + } else { + var5.drawSelectionBox(var21, this.mc.objectMouseOver, 0, par1); + } + + } + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + this.mc.mcProfiler.endStartSection("destroyProgress"); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + var5.drawBlockDamageTexture(Tessellator.instance, var4, par1); + GL11.glDisable(GL11.GL_BLEND); + + if (this.debugViewDirection == 0) { + this.enableLightmap((double)par1); + this.mc.mcProfiler.endStartSection("litParticles"); + + if (isShaders) { + Shaders.beginLitParticles(); + } + + var6.renderLitParticles(var4, par1); + RenderHelper.disableStandardItemLighting(); + this.setupFog(0, par1); + this.mc.mcProfiler.endStartSection("particles"); + + if (isShaders) { + Shaders.beginParticles(); + } + + var6.renderParticles(var4, par1); + + if (isShaders) { + Shaders.endParticles(); + } + + this.disableLightmap((double)par1); + } + + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_CULL_FACE); + this.mc.mcProfiler.endStartSection("weather"); + + if (isShaders) { + Shaders.beginWeather(); + } + + this.renderRainSnow(par1); + + if (isShaders) { + Shaders.endWeather(); + } + + GL11.glDepthMask(true); + + if (isShaders) { + ShadersRender.renderHand0(this, par1, 2); + Shaders.preWater(); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + this.setupFog(0, par1); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDepthMask(false); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + WrUpdates.resumeBackgroundUpdates(); + + if (Config.isWaterFancy()) { + this.mc.mcProfiler.endStartSection("water"); + + if (this.mc.gameSettings.ambientOcclusion != 0) { + GL11.glShadeModel(GL11.GL_SMOOTH); + } + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + + if (this.mc.gameSettings.anaglyph) { + if (anaglyphField == 0) { + GL11.glColorMask(false, true, true, true); + } else { + GL11.glColorMask(true, false, false, true); + } + + if (isShaders) { + Shaders.beginWater(); + } + + var5.renderAllSortedRenderers(1, (double)par1); + + if (isShaders) { + Shaders.endWater(); + } + } else { + if (isShaders) { + Shaders.beginWater(); + } + + var5.renderAllSortedRenderers(1, (double)par1); + + if (isShaders) { + Shaders.endWater(); + } + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glShadeModel(GL11.GL_FLAT); + } else { + this.mc.mcProfiler.endStartSection("water"); + + if (isShaders) { + Shaders.beginWater(); + } + + var5.renderAllSortedRenderers(1, (double)par1); + + if (isShaders) { + Shaders.endWater(); + } + } + + WrUpdates.pauseBackgroundUpdates(); + + if (hasForge && this.debugViewDirection == 0) { + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(1)}); + this.mc.renderGlobal.renderEntities(var4, var14, par1); + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(-1)}); + RenderHelper.disableStandardItemLighting(); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_FOG); + + if (var4.posY >= 128.0D + (double)(this.mc.gameSettings.ofCloudsHeight * 128.0F)) { + this.mc.mcProfiler.endStartSection("aboveClouds"); + this.renderCloudsCheck(var5, par1); + } + + if (hasForge) { + this.mc.mcProfiler.endStartSection("FRenderLast"); + Reflector.callVoid(Reflector.ForgeHooksClient_dispatchRenderLast, new Object[] {var5, Float.valueOf(par1)}); + } + + this.mc.mcProfiler.endStartSection("hand"); + boolean renderFirstPersonHand = Reflector.callBoolean(Reflector.ForgeHooksClient_renderFirstPersonHand, new Object[] {this.mc.renderGlobal, Float.valueOf(par1), Integer.valueOf(var13)}); + + if (!renderFirstPersonHand && this.cameraZoom == 1.0D && !Shaders.isShadowPass) { + if (isShaders) { + ShadersRender.renderHand1(this, par1, var13); + Shaders.renderCompositeFinal(); + } + + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + + if (isShaders) { + ShadersRender.renderFPOverlay(this, partialTicks, var13); + } else { + this.renderHand(par1, var13); + } + } + + if (isShaders) { + Shaders.endRender(); + } + + if (!this.mc.gameSettings.anaglyph) { + this.mc.mcProfiler.endSection(); + return; + } + } + + GL11.glColorMask(true, true, true, false); + this.mc.mcProfiler.endSection(); + } + + /** + * Render clouds if enabled + */ + private void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) { + if (this.mc.gameSettings.shouldRenderClouds() && Shaders.shouldRenderClouds(this.mc.gameSettings)) { + this.mc.mcProfiler.endStartSection("clouds"); + GL11.glPushMatrix(); + this.setupFog(0, par2); + GL11.glEnable(GL11.GL_FOG); + + if (Config.isShaders()) { + Shaders.beginClouds(); + } + + par1RenderGlobal.renderClouds(par2); + + if (Config.isShaders()) { + Shaders.endClouds(); + } + + GL11.glDisable(GL11.GL_FOG); + this.setupFog(1, par2); + GL11.glPopMatrix(); + } + } + + private void addRainParticles() { + ModuleEnvironmentChanger envChanger = CheatBreaker.getInstance().getModuleManager().environmentChangerMod; + if (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue() && envChanger.isSnowOrNone()) { + return; + } + + float var1 = this.mc.theWorld.getRainStrength(1.0F); + + if (!Config.isRainFancy()) { + var1 /= 2.0F; + } + + if (var1 != 0.0F && Config.isRainSplash()) { + this.random.setSeed((long)this.rendererUpdateCount * 312987231L); + EntityLivingBase var2 = this.mc.renderViewEntity; + WorldClient var3 = this.mc.theWorld; + int var4 = MathHelper.floor_double(var2.posX); + int var5 = MathHelper.floor_double(var2.posY); + int var6 = MathHelper.floor_double(var2.posZ); + byte var7 = 10; + double var8 = 0.0D; + double var10 = 0.0D; + double var12 = 0.0D; + int var14 = 0; + int var15 = (int)(100.0F * var1 * var1); + + if (this.mc.gameSettings.particleSetting == 1) { + var15 >>= 1; + } else if (this.mc.gameSettings.particleSetting == 2) { + var15 = 0; + } + + for (int var16 = 0; var16 < var15; ++var16) { + int var17 = var4 + this.random.nextInt(var7) - this.random.nextInt(var7); + int var18 = var6 + this.random.nextInt(var7) - this.random.nextInt(var7); + int var19 = var3.getPrecipitationHeight(var17, var18); + Block var20 = var3.getBlock(var17, var19 - 1, var18); + BiomeGenBase var21 = var3.getBiomeGenForCoords(var17, var18); + + if (var19 <= var5 + var7 && var19 >= var5 - var7 && var21.canSpawnLightningBolt() && var21.getFloatTemperature(var17, var19, var18) >= 0.15F || (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue() && envChanger.weatherType.getStringValue().equals("Rain"))) { + float var22 = this.random.nextFloat(); + float var23 = this.random.nextFloat(); + + if (var20.getMaterial() == Material.lava) { + this.mc.effectRenderer.addEffect(new EntitySmokeFX(var3, (double)((float)var17 + var22), (double)((float)var19 + 0.1F) - var20.getBlockBoundsMinY(), (double)((float)var18 + var23), 0.0D, 0.0D, 0.0D)); + } else if (var20.getMaterial() != Material.air) { + ++var14; + + if (this.random.nextInt(var14) == 0) { + var8 = (double)((float)var17 + var22); + var10 = (double)((float)var19 + 0.1F) - var20.getBlockBoundsMinY(); + var12 = (double)((float)var18 + var23); + } + + EntityRainFX fx = new EntityRainFX(var3, (double)((float)var17 + var22), (double)((float)var19 + 0.1F) - var20.getBlockBoundsMinY(), (double)((float)var18 + var23)); + CustomColorizer.updateWaterFX(fx, var3); + this.mc.effectRenderer.addEffect(fx); + } + } + } + + if (var14 > 0 && this.random.nextInt(3) < this.rainSoundCounter++) { + this.rainSoundCounter = 0; + + if (var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY)) { + this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.1F, 0.5F, false); + } else { + this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.2F, 1.0F, false); + } + } + } + } + + /** + * Render rain and snow + */ + protected void renderRainSnow(float par1) { + ModuleEnvironmentChanger envChanger = CheatBreaker.getInstance().getModuleManager().environmentChangerMod; + boolean allowThroughBlocks = envChanger.allowThroughBlocks.getBooleanValue(); + + if (Reflector.ForgeWorldProvider_getWeatherRenderer.exists()) { + WorldProvider var2 = this.mc.theWorld.provider; + Object var41 = Reflector.call(var2, Reflector.ForgeWorldProvider_getWeatherRenderer, new Object[0]); + + if (var41 != null) { + Reflector.callVoid(var41, Reflector.IRenderHandler_render, new Object[] {Float.valueOf(par1), this.mc.theWorld, this.mc}); + return; + } + } + + float var411 = this.mc.theWorld.getRainStrength(par1); + + if (var411 > 0.0F || envChanger.isEnabled()) { + this.enableLightmap(par1); + + if (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue() && !envChanger.weatherType.getStringValue().equalsIgnoreCase("None")) { + var411 = 1.0F; + } + + if (this.rainXCoords == null) { + this.rainXCoords = new float[1024]; + this.rainYCoords = new float[1024]; + + for (int var421 = 0; var421 < 32; ++var421) { + for (int var42 = 0; var42 < 32; ++var42) { + float var43 = (float)(var42 - 16); + float var44 = (float)(var421 - 16); + float var45 = MathHelper.sqrt_float(var43 * var43 + var44 * var44); + this.rainXCoords[var421 << 5 | var42] = -var44 / var45; + this.rainYCoords[var421 << 5 | var42] = var43 / var45; + } + } + } + + if (Config.isRainOff()) { + return; + } + + EntityLivingBase var431 = this.mc.renderViewEntity; + WorldClient var441 = this.mc.theWorld; + int var451 = MathHelper.floor_double(var431.posX); + int var461 = MathHelper.floor_double(var431.posY); + int var471 = MathHelper.floor_double(var431.posZ); + Tessellator var8 = Tessellator.instance; + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + double var9 = var431.lastTickPosX + (var431.posX - var431.lastTickPosX) * (double) par1; + double var11 = var431.lastTickPosY + (var431.posY - var431.lastTickPosY) * (double) par1; + double var13 = var431.lastTickPosZ + (var431.posZ - var431.lastTickPosZ) * (double) par1; + int var15 = MathHelper.floor_double(var11); + byte var16 = 5; + + if (Config.isRainFancy()) { + var16 = 10; + } + + byte var18 = -1; + float var19 = (float)this.rendererUpdateCount + par1; + + if (Config.isRainFancy()) { + var16 = 10; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + for (int var20 = var471 - var16; var20 <= var471 + var16; ++var20) { + for (int var21 = var451 - var16; var21 <= var451 + var16; ++var21) { + int var22 = (var20 - var471 + 16) * 32 + var21 - var451 + 16; + float var23 = this.rainXCoords[var22] * 0.5F; + float var24 = this.rainYCoords[var22] * 0.5F; + BiomeGenBase var25 = var441.getBiomeGenForCoords(var21, var20); + + if (var25.canSpawnLightningBolt() || var25.getEnableSnow()) { + int var26 = var441.getPrecipitationHeight(var21, var20); + int var27 = var461 - var16; + int var28 = var461 + var16; + + if (var27 < var26) { + // passing through blocks logic + var27 = (envChanger.isEnabled() && allowThroughBlocks ? 0 : var26); + } + + if (var28 < var26) { + var28 = var26; + } + + float var29 = 1.0F; + int var30 = var26; + + if (var26 < var15) { + var30 = var15; + } + + if (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue() && envChanger.weatherType.getStringValue().equals("Clear")) { + return; + } + + if (var27 != var28 || (envChanger.isEnabled() && envChanger.customWeather.getBooleanValue())) { + this.random.setSeed((long)(var21 * var21 * 3121 + var21 * 45238971 ^ var20 * var20 * 418711 + var20 * 13761)); + float var31 = var25.getFloatTemperature(var21, var27, var20); + float var32; + double var35; + + // Else if refused to work, so we got around it! + boolean shouldRain; + + if (envChanger.customWeather.getBooleanValue() && envChanger.isEnabled() && !envChanger.weatherType.getStringValue().equals("Clear")) + shouldRain = envChanger.weatherType.getStringValue().equals("Rain"); + else shouldRain = var441.getWorldChunkManager().getTemperatureAtHeight(var31, var26) >= 0.15F; + + if (shouldRain) { + if (var18 != 0) { + if (var18 >= 0) { + var8.draw(); + } + + var18 = 0; + this.mc.getTextureManager().bindTexture(locationRainPng); + var8.startDrawingQuads(); + } + + var32 = ((float)(this.rendererUpdateCount + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) + par1) / 32.0F * (3.0F + this.random.nextFloat()); + double var46 = (double)((float) var21 + 0.5F) - var431.posX; + var35 = (double)((float) var20 + 0.5F) - var431.posZ; + float var47 = MathHelper.sqrt_double(var46 * var46 + var35 * var35) / (float)var16; + float var38 = 1.0F; + var8.setBrightness(var441.getLightBrightnessForSkyBlocks(var21, var30, var20, 0)); + var8.setColorRGBA_F(var38, var38, var38, ((1.0F - var47 * var47) * 0.5F + 0.5F) * var411); + var8.setTranslation(-var9 * 1.0D, -var11 * 1.0D, -var13 * 1.0D); + var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var27, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29), (double)((float)var27 * var29 / 4.0F + var32 * var29)); + var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var27, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29), (double)((float)var27 * var29 / 4.0F + var32 * var29)); + var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var28, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29), (double)((float)var28 * var29 / 4.0F + var32 * var29)); + var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var28, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29), (double)((float)var28 * var29 / 4.0F + var32 * var29)); + var8.setTranslation(0.0D, 0.0D, 0.0D); + } else if (var441.getWorldChunkManager().getTemperatureAtHeight(var31, var26) < 0.15F || (envChanger.weatherType.getStringValue().equals("Snow") && envChanger.customWeather.getBooleanValue() && envChanger.isEnabled())) { + if (var18 != 1) { + if (var18 >= 0) { + var8.draw(); + } + + var18 = 1; + this.mc.getTextureManager().bindTexture(locationSnowPng); + var8.startDrawingQuads(); + } + + var32 = ((float)(this.rendererUpdateCount & 511) + par1) / 512.0F; + float var48 = this.random.nextFloat() + var19 * 0.01F * (float)this.random.nextGaussian(); + float var34 = this.random.nextFloat() + var19 * (float)this.random.nextGaussian() * 0.001F; + var35 = (double) ((float) var21 + 0.5F) - var431.posX; + double var49 = (double) ((float) var20 + 0.5F) - var431.posZ; + float var39 = MathHelper.sqrt_double(var35 * var35 + var49 * var49) / (float)var16; + float var40 = 1.0F; + var8.setBrightness((var441.getLightBrightnessForSkyBlocks(var21, var30, var20, 0) * 3 + 15728880) / 4); + var8.setColorRGBA_F(var40, var40, var40, ((1.0F - var39 * var39) * 0.3F + 0.5F) * var411); + var8.setTranslation(-var9 * 1.0D, -var11 * 1.0D, -var13 * 1.0D); + var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var27, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29 + var48), (double)((float)var27 * var29 / 4.0F + var32 * var29 + var34)); + var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var27, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29 + var48), (double)((float)var27 * var29 / 4.0F + var32 * var29 + var34)); + var8.addVertexWithUV((double)((float)var21 + var23) + 0.5D, (double)var28, (double)((float)var20 + var24) + 0.5D, (double)(1.0F * var29 + var48), (double)((float)var28 * var29 / 4.0F + var32 * var29 + var34)); + var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var28, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29 + var48), (double)((float)var28 * var29 / 4.0F + var32 * var29 + var34)); + var8.setTranslation(0.0D, 0.0D, 0.0D); + } + } + } + } + } + + if (var18 >= 0) { + var8.draw(); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + this.disableLightmap((double)par1); + } + } + + /** + * Setup orthogonal projection for rendering GUI screen overlays + */ + public void setupOverlayRendering() { + ScaledResolution var1 = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, var1.getScaledWidth_double(), var1.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } + + /** + * calculates fog and calls glClearColor + */ + private void updateFogColor(float par1) { + WorldClient var2 = this.mc.theWorld; + EntityLivingBase var3 = this.mc.renderViewEntity; + float var4 = 0.25F + 0.75F * (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; + var4 = 1.0F - (float)Math.pow((double)var4, 0.25D); + Vec3 var5 = var2.getSkyColor(this.mc.renderViewEntity, par1); + var5 = CustomColorizer.getWorldSkyColor(var5, var2, this.mc.renderViewEntity, par1); + float var6 = (float)var5.xCoord; + float var7 = (float)var5.yCoord; + float var8 = (float)var5.zCoord; + Vec3 var9 = var2.getFogColor(par1); + var9 = CustomColorizer.getWorldFogColor(var9, var2, par1); + this.fogColorRed = (float)var9.xCoord; + this.fogColorGreen = (float)var9.yCoord; + this.fogColorBlue = (float)var9.zCoord; + float var11; + + if (this.mc.gameSettings.renderDistanceChunks >= 4) { + Vec3 var19 = MathHelper.sin(var2.getCelestialAngleRadians(par1)) > 0.0F ? Vec3.createVectorHelper(-1.0D, 0.0D, 0.0D) : Vec3.createVectorHelper(1.0D, 0.0D, 0.0D); + var11 = (float)var3.getLook(par1).dotProduct(var19); + + if (var11 < 0.0F) { + var11 = 0.0F; + } + + if (var11 > 0.0F) { + float[] var20 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(par1), par1); + + if (var20 != null) { + var11 *= var20[3]; + this.fogColorRed = this.fogColorRed * (1.0F - var11) + var20[0] * var11; + this.fogColorGreen = this.fogColorGreen * (1.0F - var11) + var20[1] * var11; + this.fogColorBlue = this.fogColorBlue * (1.0F - var11) + var20[2] * var11; + } + } + } + + this.fogColorRed += (var6 - this.fogColorRed) * var4; + this.fogColorGreen += (var7 - this.fogColorGreen) * var4; + this.fogColorBlue += (var8 - this.fogColorBlue) * var4; + float var191 = var2.getRainStrength(par1); + float var201; + + if (var191 > 0.0F) { + var11 = 1.0F - var191 * 0.5F; + var201 = 1.0F - var191 * 0.4F; + this.fogColorRed *= var11; + this.fogColorGreen *= var11; + this.fogColorBlue *= var201; + } + + var11 = var2.getWeightedThunderStrength(par1); + + if (var11 > 0.0F) { + var201 = 1.0F - var11 * 0.5F; + this.fogColorRed *= var201; + this.fogColorGreen *= var201; + this.fogColorBlue *= var201; + } + + Block var21 = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, var3, par1); + float var22; + Vec3 fogYFactor; + + if (this.cloudFog) { + fogYFactor = var2.getCloudColour(par1); + this.fogColorRed = (float)fogYFactor.xCoord; + this.fogColorGreen = (float)fogYFactor.yCoord; + this.fogColorBlue = (float)fogYFactor.zCoord; + } else if (var21.getMaterial() == Material.water) { + var22 = (float)EnchantmentHelper.getRespiration(var3) * 0.2F; + this.fogColorRed = 0.02F + var22; + this.fogColorGreen = 0.02F + var22; + this.fogColorBlue = 0.2F + var22; + fogYFactor = CustomColorizer.getUnderwaterColor(this.mc.theWorld, this.mc.renderViewEntity.posX, this.mc.renderViewEntity.posY + 1.0D, this.mc.renderViewEntity.posZ); + + if (fogYFactor != null) { + this.fogColorRed = (float)fogYFactor.xCoord; + this.fogColorGreen = (float)fogYFactor.yCoord; + this.fogColorBlue = (float)fogYFactor.zCoord; + } + } else if (var21.getMaterial() == Material.lava) { + this.fogColorRed = 0.6F; + this.fogColorGreen = 0.1F; + this.fogColorBlue = 0.0F; + } + + var22 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * par1; + this.fogColorRed *= var22; + this.fogColorGreen *= var22; + this.fogColorBlue *= var22; + double fogYFactor1 = var2.provider.getVoidFogYFactor(); + + if (!Config.isDepthFog()) { + fogYFactor1 = 1.0D; + } + + double var14 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par1) * fogYFactor1; + + if (var3.isPotionActive(Potion.blindness)) { + int var23 = var3.getActivePotionEffect(Potion.blindness).getDuration(); + + if (var23 < 20) { + var14 *= (double)(1.0F - (float)var23 / 20.0F); + } else { + var14 = 0.0D; + } + } + + if (var14 < 1.0D) { + if (var14 < 0.0D) { + var14 = 0.0D; + } + + var14 *= var14; + this.fogColorRed = (float)((double)this.fogColorRed * var14); + this.fogColorGreen = (float)((double)this.fogColorGreen * var14); + this.fogColorBlue = (float)((double)this.fogColorBlue * var14); + } + + float var231; + + if (this.bossColorModifier > 0.0F) { + var231 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * par1; + this.fogColorRed = this.fogColorRed * (1.0F - var231) + this.fogColorRed * 0.7F * var231; + this.fogColorGreen = this.fogColorGreen * (1.0F - var231) + this.fogColorGreen * 0.6F * var231; + this.fogColorBlue = this.fogColorBlue * (1.0F - var231) + this.fogColorBlue * 0.6F * var231; + } + + float var17; + + if (var3.isPotionActive(Potion.nightVision)) { + var231 = this.getNightVisionBrightness(this.mc.thePlayer, par1); + var17 = 1.0F / this.fogColorRed; + + if (var17 > 1.0F / this.fogColorGreen) { + var17 = 1.0F / this.fogColorGreen; + } + + if (var17 > 1.0F / this.fogColorBlue) { + var17 = 1.0F / this.fogColorBlue; + } + + this.fogColorRed = this.fogColorRed * (1.0F - var231) + this.fogColorRed * var17 * var231; + this.fogColorGreen = this.fogColorGreen * (1.0F - var231) + this.fogColorGreen * var17 * var231; + this.fogColorBlue = this.fogColorBlue * (1.0F - var231) + this.fogColorBlue * var17 * var231; + } + + if (this.mc.gameSettings.anaglyph) { + var231 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; + var17 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; + float event = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; + this.fogColorRed = var231; + this.fogColorGreen = var17; + this.fogColorBlue = event; + } + + if (Reflector.EntityViewRenderEvent_FogColors_Constructor.exists()) { + Object event1 = Reflector.newInstance(Reflector.EntityViewRenderEvent_FogColors_Constructor, new Object[] {this, var3, var21, Float.valueOf(par1), Float.valueOf(this.fogColorRed), Float.valueOf(this.fogColorGreen), Float.valueOf(this.fogColorBlue)}); + Reflector.postForgeBusEvent(event1); + this.fogColorRed = Reflector.getFieldValueFloat(event1, Reflector.EntityViewRenderEvent_FogColors_red, this.fogColorRed); + this.fogColorGreen = Reflector.getFieldValueFloat(event1, Reflector.EntityViewRenderEvent_FogColors_green, this.fogColorGreen); + this.fogColorBlue = Reflector.getFieldValueFloat(event1, Reflector.EntityViewRenderEvent_FogColors_blue, this.fogColorBlue); + } + + if (Config.isShaders()) { + Shaders.setClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); + } else { + GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); + } + } + + /** + * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane + * distance and is used for sky rendering. + */ + private void setupFog(int par1, float par2) { + EntityLivingBase var3 = this.mc.renderViewEntity; + boolean var4 = false; + this.fogStandard = false; + + if (var3 instanceof EntityPlayer) { + var4 = ((EntityPlayer)var3).capabilities.isCreativeMode; + } + + if (par1 == 999) { + GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + + if (Config.isShaders()) { + Shaders.sglFogi(2917, 9729); + } else { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + } + + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, 8.0F); + + if (GLContext.getCapabilities().GL_NV_fog_distance) { + if (Config.isShaders()) { + Shaders.sglFogi(34138, 34139); + } else { + GL11.glFogi(34138, 34139); + } + } + + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + } else { + GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); + GL11.glNormal3f(0.0F, -1.0F, 0.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Block var5 = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, var3, par2); + Object event = Reflector.newInstance(Reflector.EntityViewRenderEvent_FogDensity_Constructor, new Object[] {this, var3, var5, Float.valueOf(par2), Float.valueOf(0.1F)}); + + if (Reflector.postForgeBusEvent(event)) { + float var10 = Reflector.getFieldValueFloat(event, Reflector.EntityViewRenderEvent_FogDensity_density, 0.0F); + GL11.glFogf(GL11.GL_FOG_DENSITY, var10); + } else { + float var6; + + if (var3.isPotionActive(Potion.blindness)) { + var6 = 5.0F; + int var101 = var3.getActivePotionEffect(Potion.blindness).getDuration(); + + if (var101 < 20) { + var6 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)var101 / 20.0F); + } + + if (Config.isShaders()) { + Shaders.sglFogi(2917, 9729); + } else { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + } + + if (par1 < 0) { + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); + } else { + GL11.glFogf(GL11.GL_FOG_START, var6 * 0.25F); + GL11.glFogf(GL11.GL_FOG_END, var6); + } + + if (Config.isFogFancy()) { + if (Config.isShaders()) { + Shaders.sglFogi(34138, 34139); + } else { + GL11.glFogi(34138, 34139); + } + } + } else if (this.cloudFog) { + if (Config.isShaders()) { + Shaders.sglFogi(2917, 2048); + } else { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); + } + + GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); + } else if (var5.getMaterial() == Material.water) { + if (Config.isShaders()) { + Shaders.sglFogi(2917, 2048); + } else { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); + } + + if (var3.isPotionActive(Potion.waterBreathing)) { + GL11.glFogf(GL11.GL_FOG_DENSITY, 0.05F); + } else { + GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F - (float)EnchantmentHelper.getRespiration(var3) * 0.03F); + } + + if (Config.isClearWater()) { + GL11.glFogf(GL11.GL_FOG_DENSITY, 0.02F); + } + } else if (var5.getMaterial() == Material.lava) { + if (Config.isShaders()) { + Shaders.sglFogi(2917, 2048); + } else { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); + } + + GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); + } else { + var6 = this.farPlaneDistance; + this.fogStandard = true; + + if (Config.isDepthFog() && this.mc.theWorld.provider.getWorldHasVoidParticles() && !var4) { + double var102 = (double)((var3.getBrightnessForRender(par2) & 15728640) >> 20) / 16.0D + (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par2 + 4.0D) / 32.0D; + + if (var102 < 1.0D) { + if (var102 < 0.0D) { + var102 = 0.0D; + } + + var102 *= var102; + float var9 = 100.0F * (float)var102; + + if (var9 < 5.0F) { + var9 = 5.0F; + } + + if (var6 > var9) { + var6 = var9; + } + } + } + + if (Config.isShaders()) { + Shaders.sglFogi(2917, 9729); + } else { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + } + + if (par1 < 0) { + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, var6); + } else { + GL11.glFogf(GL11.GL_FOG_START, var6 * Config.getFogStart()); + GL11.glFogf(GL11.GL_FOG_END, var6); + } + + if (GLContext.getCapabilities().GL_NV_fog_distance) { + if (Config.isFogFancy()) { + if (Config.isShaders()) { + Shaders.sglFogi(34138, 34139); + } else { + GL11.glFogi(34138, 34139); + } + } + + if (Config.isFogFast()) { + if (Config.isShaders()) { + Shaders.sglFogi(34138, 34140); + } else { + GL11.glFogi(34138, 34140); + } + } + } + + if (this.mc.theWorld.provider.doesXZShowFog((int)var3.posX, (int)var3.posZ)) { + var6 = this.farPlaneDistance; + GL11.glFogf(GL11.GL_FOG_START, var6 * 0.05F); + GL11.glFogf(GL11.GL_FOG_END, var6); + } + + Reflector.postForgeBusEvent(Reflector.newInstance(Reflector.EntityViewRenderEvent_RenderFogEvent_Constructor, new Object[] {this, var3, var5, Float.valueOf(par2), Integer.valueOf(par1), Float.valueOf(var6)})); + } + } + + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glColorMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT); + } + } + + /** + * Update and return fogColorBuffer with the RGBA values passed as arguments + */ + private FloatBuffer setFogColorBuffer(float par1, float par2, float par3, float par4) { + if (Config.isShaders()) { + Shaders.setFogColor(par1, par2, par3); + } + + this.fogColorBuffer.clear(); + this.fogColorBuffer.put(par1).put(par2).put(par3).put(par4); + this.fogColorBuffer.flip(); + return this.fogColorBuffer; + } + + public MapItemRenderer getMapItemRenderer() { + return this.theMapItemRenderer; + } + + private void waitForServerThread() { + this.serverWaitTimeCurrent = 0; + + if (!Config.isSmoothWorld()) { + this.lastServerTime = 0L; + this.lastServerTicks = 0; + } else if (this.mc.getIntegratedServer() != null) { + IntegratedServer srv = this.mc.getIntegratedServer(); + boolean paused = this.mc.func_147113_T(); + + if (!paused && !(this.mc.currentScreen instanceof GuiDownloadTerrain)) { + if (this.serverWaitTime > 0) { + Config.sleep((long)this.serverWaitTime); + this.serverWaitTimeCurrent = this.serverWaitTime; + } + + long timeNow = System.nanoTime() / 1000000L; + + if (this.lastServerTime != 0L && this.lastServerTicks != 0) { + long timeDiff = timeNow - this.lastServerTime; + + if (timeDiff < 0L) { + this.lastServerTime = timeNow; + timeDiff = 0L; + } + + if (timeDiff >= 50L) { + this.lastServerTime = timeNow; + int ticks = srv.getTickCounter(); + int tickDiff = ticks - this.lastServerTicks; + + if (tickDiff < 0) { + this.lastServerTicks = ticks; + tickDiff = 0; + } + + if (tickDiff < 1 && this.serverWaitTime < 100) { + this.serverWaitTime += 2; + } + + if (tickDiff > 1 && this.serverWaitTime > 0) { + --this.serverWaitTime; + } + + this.lastServerTicks = ticks; + } + } else { + this.lastServerTime = timeNow; + this.lastServerTicks = srv.getTickCounter(); + this.avgServerTickDiff = 1.0F; + this.avgServerTimeDiff = 50.0F; + } + } else { + if (this.mc.currentScreen instanceof GuiDownloadTerrain) { + Config.sleep(20L); + } + + this.lastServerTime = 0L; + this.lastServerTicks = 0; + } + } + } + + private void showLagometer(long tickTimeNano, long chunkTimeNano) { + if (this.mc.gameSettings.ofLagometer || this.showExtendedDebugInfo) { + if (this.prevFrameTimeNano == -1L) { + this.prevFrameTimeNano = System.nanoTime(); + } + + long timeNowNano = System.nanoTime(); + int currFrameIndex = this.numRecordedFrameTimes & this.frameTimes.length - 1; + this.tickTimes[currFrameIndex] = tickTimeNano; + this.chunkTimes[currFrameIndex] = chunkTimeNano; + this.serverTimes[currFrameIndex] = (long)this.serverWaitTimeCurrent; + this.frameTimes[currFrameIndex] = timeNowNano - this.prevFrameTimeNano; + ++this.numRecordedFrameTimes; + this.prevFrameTimeNano = timeNowNano; + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, (double)this.mc.displayWidth, (double)this.mc.displayHeight, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glLineWidth(1.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawing(1); + + for (int frameNum = 0; frameNum < this.frameTimes.length; ++frameNum) { + int lum = (frameNum - this.numRecordedFrameTimes & this.frameTimes.length - 1) * 255 / this.frameTimes.length; + long heightFrame = this.frameTimes[frameNum] / 200000L; + float baseHeight = (float)this.mc.displayHeight; + tessellator.setColorOpaque_I(-16777216 + lum * 256); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight - (float)heightFrame + 0.5F), 0.0D); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight + 0.5F), 0.0D); + baseHeight -= (float)heightFrame; + long heightTick = this.tickTimes[frameNum] / 200000L; + tessellator.setColorOpaque_I(-16777216 + lum * 65536 + lum * 256 + lum * 1); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight + 0.5F), 0.0D); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight + (float)heightTick + 0.5F), 0.0D); + baseHeight += (float)heightTick; + long heightChunk = this.chunkTimes[frameNum] / 200000L; + tessellator.setColorOpaque_I(-16777216 + lum * 65536); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight + 0.5F), 0.0D); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight + (float)heightChunk + 0.5F), 0.0D); + baseHeight += (float)heightChunk; + long srvTime = this.serverTimes[frameNum]; + + if (srvTime > 0L) { + long heightSrv = srvTime * 1000000L / 200000L; + tessellator.setColorOpaque_I(-16777216 + lum * 1); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight + 0.5F), 0.0D); + tessellator.addVertex((double)((float)frameNum + 0.5F), (double)(baseHeight + (float)heightSrv + 0.5F), 0.0D); + } + } + + tessellator.draw(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + } + + private void frameFinish() { + if (this.mc.theWorld != null) { + long now = System.currentTimeMillis(); + + if (now > this.lastErrorCheckTimeMs + 10000L) { + this.lastErrorCheckTimeMs = now; + int err = GL11.glGetError(); + + if (err != 0) { + String text = GLU.gluErrorString(err); + ChatComponentText msg = new ChatComponentText(I18n.format("of.message.openglError", new Object[] {Integer.valueOf(err), text})); + this.mc.ingameGUI.getChatGUI().func_146227_a(msg); + } + } + } + } + + private void updateMainMenu(GuiMainMenu mainGui) { + try { + String e = null; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + int day = calendar.get(5); + int month = calendar.get(2) + 1; + + if (day == 8 && month == 4) { + e = "Happy birthday, OptiFine!"; + } + + if (day == 14 && month == 8) { + e = "Happy birthday, sp614x!"; + } + + if (e == null) { + return; + } + + Field[] fs = GuiMainMenu.class.getDeclaredFields(); + + for (int i = 0; i < fs.length; ++i) { + if (fs[i].getType() == String.class) { + fs[i].setAccessible(true); + fs[i].set(mainGui, e); + break; + } + } + } catch (Throwable var8) { + ; + } + } + + public boolean setFxaaShader(int fxaaLevel) { + if (!OpenGlHelper.isFramebufferEnabled()) { + return false; + } else if (this.theShaderGroup != null && this.theShaderGroup != this.fxaaShaders[2] && this.theShaderGroup != this.fxaaShaders[4]) { + return true; + } else if (fxaaLevel != 2 && fxaaLevel != 4) { + if (this.theShaderGroup == null) { + return true; + } else { + this.theShaderGroup.deleteShaderGroup(); + this.theShaderGroup = null; + return true; + } + } else if (this.theShaderGroup != null && this.theShaderGroup == this.fxaaShaders[fxaaLevel]) { + return true; + } else if (this.mc.theWorld == null) { + return true; + } else { + this.loadShader(new ResourceLocation("shaders/post/fxaa_of_" + fxaaLevel + "x.json")); + this.fxaaShaders[fxaaLevel] = this.theShaderGroup; + return this.theShaderGroup != null; + } + } + + private void loadShader(ResourceLocation p_175069_1_) { + if (OpenGlHelper.isFramebufferEnabled()) { + try { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), p_175069_1_); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + } catch (IOException var3) { + logger.warn("Failed to load shader: " + p_175069_1_, var3); + this.shaderIndex = shaderCount; + } catch (JsonSyntaxException var4) { + logger.warn("Failed to load shader: " + p_175069_1_, var4); + this.shaderIndex = shaderCount; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/EntitySorter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/EntitySorter.java new file mode 100644 index 0000000..51d36be --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/EntitySorter.java @@ -0,0 +1,36 @@ +package net.minecraft.client.renderer; + +import java.util.Comparator; +import net.minecraft.entity.Entity; + +public class EntitySorter implements Comparator { + /** Entity position X */ + private final double entityPosX; + + /** Entity position Y */ + private final double entityPosY; + + /** Entity position Z */ + private final double entityPosZ; + + + public EntitySorter(Entity p_i1242_1_) { + this.entityPosX = -p_i1242_1_.posX; + this.entityPosY = -p_i1242_1_.posY; + this.entityPosZ = -p_i1242_1_.posZ; + } + + public int compare(WorldRenderer p_compare_1_, WorldRenderer p_compare_2_) { + double var3 = (double)p_compare_1_.posXPlus + this.entityPosX; + double var5 = (double)p_compare_1_.posYPlus + this.entityPosY; + double var7 = (double)p_compare_1_.posZPlus + this.entityPosZ; + double var9 = (double)p_compare_2_.posXPlus + this.entityPosX; + double var11 = (double)p_compare_2_.posYPlus + this.entityPosY; + double var13 = (double)p_compare_2_.posZPlus + this.entityPosZ; + return (int)((var3 * var3 + var5 * var5 + var7 * var7 - (var9 * var9 + var11 * var11 + var13 * var13)) * 1024.0D); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((WorldRenderer)p_compare_1_, (WorldRenderer)p_compare_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/GLAllocation.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/GLAllocation.java new file mode 100644 index 0000000..09209ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/GLAllocation.java @@ -0,0 +1,68 @@ +package net.minecraft.client.renderer; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import org.lwjgl.opengl.GL11; + +public class GLAllocation { + private static final Map mapDisplayLists = new HashMap(); + private static final List listDummy = new ArrayList(); + + + /** + * Generates the specified number of display lists and returns the first index. + */ + public static synchronized int generateDisplayLists(int p_74526_0_) { + int var1 = GL11.glGenLists(p_74526_0_); + mapDisplayLists.put(Integer.valueOf(var1), Integer.valueOf(p_74526_0_)); + return var1; + } + + public static synchronized void deleteDisplayLists(int p_74523_0_) { + GL11.glDeleteLists(p_74523_0_, ((Integer)mapDisplayLists.remove(Integer.valueOf(p_74523_0_))).intValue()); + } + + /** + * Deletes all textures and display lists. Called when Minecraft is shutdown to free up resources. + */ + public static synchronized void deleteTexturesAndDisplayLists() { + Iterator var0 = mapDisplayLists.entrySet().iterator(); + + while (var0.hasNext()) { + Entry var1 = (Entry)var0.next(); + GL11.glDeleteLists(((Integer)var1.getKey()).intValue(), ((Integer)var1.getValue()).intValue()); + } + + mapDisplayLists.clear(); + } + + /** + * Creates and returns a direct byte buffer with the specified capacity. Applies native ordering to speed up access. + */ + public static synchronized ByteBuffer createDirectByteBuffer(int p_74524_0_) { + return ByteBuffer.allocateDirect(p_74524_0_).order(ByteOrder.nativeOrder()); + } + + /** + * Creates and returns a direct int buffer with the specified capacity. Applies native ordering to speed up access. + */ + public static IntBuffer createDirectIntBuffer(int p_74527_0_) { + return createDirectByteBuffer(p_74527_0_ << 2).asIntBuffer(); + } + + /** + * Creates and returns a direct float buffer with the specified capacity. Applies native ordering to speed up + * access. + */ + public static FloatBuffer createDirectFloatBuffer(int p_74529_0_) { + return createDirectByteBuffer(p_74529_0_ << 2).asFloatBuffer(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/IImageBuffer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/IImageBuffer.java new file mode 100644 index 0000000..7326980 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/IImageBuffer.java @@ -0,0 +1,9 @@ +package net.minecraft.client.renderer; + +import java.awt.image.BufferedImage; + +public interface IImageBuffer { + BufferedImage parseUserSkin(BufferedImage p_78432_1_); + + void func_152634_a(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/IconFlipped.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/IconFlipped.java new file mode 100644 index 0000000..ced2f5d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/IconFlipped.java @@ -0,0 +1,78 @@ +package net.minecraft.client.renderer; + +import net.minecraft.util.IIcon; + +public class IconFlipped implements IIcon { + private final IIcon baseIcon; + private final boolean flipU; + private final boolean flipV; + + + public IconFlipped(IIcon p_i1560_1_, boolean p_i1560_2_, boolean p_i1560_3_) { + this.baseIcon = p_i1560_1_; + this.flipU = p_i1560_2_; + this.flipV = p_i1560_3_; + } + + /** + * Returns the width of the icon, in pixels. + */ + public int getIconWidth() { + return this.baseIcon.getIconWidth(); + } + + /** + * Returns the height of the icon, in pixels. + */ + public int getIconHeight() { + return this.baseIcon.getIconHeight(); + } + + /** + * Returns the minimum U coordinate to use when rendering with this icon. + */ + public float getMinU() { + return this.flipU ? this.baseIcon.getMaxU() : this.baseIcon.getMinU(); + } + + /** + * Returns the maximum U coordinate to use when rendering with this icon. + */ + public float getMaxU() { + return this.flipU ? this.baseIcon.getMinU() : this.baseIcon.getMaxU(); + } + + /** + * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. + */ + public float getInterpolatedU(double p_94214_1_) { + float var3 = this.getMaxU() - this.getMinU(); + return this.getMinU() + var3 * ((float)p_94214_1_ / 16.0F); + } + + /** + * Returns the minimum V coordinate to use when rendering with this icon. + */ + public float getMinV() { + return this.baseIcon.getMinV(); + } + + /** + * Returns the maximum V coordinate to use when rendering with this icon. + */ + public float getMaxV() { + return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMaxV(); + } + + /** + * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. + */ + public float getInterpolatedV(double p_94207_1_) { + float var3 = this.getMaxV() - this.getMinV(); + return this.getMinV() + var3 * ((float)p_94207_1_ / 16.0F); + } + + public String getIconName() { + return this.baseIcon.getIconName(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java new file mode 100644 index 0000000..25a8ec2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ImageBufferDownload.java @@ -0,0 +1,87 @@ +package net.minecraft.client.renderer; + +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferInt; +import java.awt.image.ImageObserver; + +public class ImageBufferDownload implements IImageBuffer { + private int[] imageData; + private int imageWidth; + private int imageHeight; + + public BufferedImage parseUserSkin(BufferedImage par1BufferedImage) { + if (par1BufferedImage == null) { + return null; + } else { + this.imageWidth = 64; + this.imageHeight = 32; + int srcWidth = par1BufferedImage.getWidth(); + int srcHeight = par1BufferedImage.getHeight(); + + if (srcWidth != 64 || srcHeight != 32 && srcHeight != 64) { + while (this.imageWidth < srcWidth || this.imageHeight < srcHeight) { + this.imageWidth *= 2; + this.imageHeight *= 2; + } + } + + BufferedImage bufferedimage = new BufferedImage(this.imageWidth, this.imageHeight, 2); + Graphics g = bufferedimage.getGraphics(); + g.drawImage(par1BufferedImage, 0, 0, (ImageObserver)null); + g.dispose(); + this.imageData = ((DataBufferInt)bufferedimage.getRaster().getDataBuffer()).getData(); + int w = this.imageWidth; + int h = this.imageHeight; + this.setAreaOpaque(0, 0, w / 2, h / 2); + this.setAreaTransparent(w / 2, 0, w, h); + this.setAreaOpaque(0, h / 2, w, h); + return bufferedimage; + } + } + + public void func_152634_a() {} + + /** + * Makes the given area of the image transparent if it was previously completely opaque (used to remove the outer + * layer of a skin around the head if it was saved all opaque; this would be redundant so it's assumed that the skin + * maker is just using an image editor without an alpha channel) + */ + private void setAreaTransparent(int par1, int par2, int par3, int par4) { + if (!this.hasTransparency(par1, par2, par3, par4)) { + for (int var5 = par1; var5 < par3; ++var5) { + for (int var6 = par2; var6 < par4; ++var6) { + this.imageData[var5 + var6 * this.imageWidth] &= 16777215; + } + } + } + } + + /** + * Makes the given area of the image opaque + */ + private void setAreaOpaque(int par1, int par2, int par3, int par4) { + for (int var5 = par1; var5 < par3; ++var5) { + for (int var6 = par2; var6 < par4; ++var6) { + this.imageData[var5 + var6 * this.imageWidth] |= -16777216; + } + } + } + + /** + * Returns true if the given area of the image contains transparent pixels + */ + private boolean hasTransparency(int par1, int par2, int par3, int par4) { + for (int var5 = par1; var5 < par3; ++var5) { + for (int var6 = par2; var6 < par4; ++var6) { + int var7 = this.imageData[var5 + var6 * this.imageWidth]; + + if ((var7 >> 24 & 255) < 128) { + return true; + } + } + } + + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java new file mode 100644 index 0000000..da1e14c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/InventoryEffectRenderer.java @@ -0,0 +1,91 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.inventory.Container; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import org.lwjgl.opengl.GL11; + +import java.util.Collection; +import java.util.Iterator; + +public abstract class InventoryEffectRenderer extends GuiContainer { + private boolean field_147045_u; + + + public InventoryEffectRenderer(Container p_i1089_1_) { + super(p_i1089_1_); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + super.initGui(); + boolean bl2 = CheatBreaker.getInstance().getModuleManager().potionEffectsMod.isEnabled() && (Boolean) CheatBreaker.getInstance().getModuleManager().potionEffectsMod.potionInfoInInventory.getValue(); + boolean bl = !CheatBreaker.getInstance().getModuleManager().potionEffectsMod.isEnabled() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showPotionInfo.getValue(); + if (!this.mc.thePlayer.getActivePotionEffects().isEmpty() && (bl2 || bl)) { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().shiftPotionInfo.getValue()) { + this.field_147003_i = 160 + (this.width - this.field_146999_f - 200) / 2; + } + this.field_147045_u = true; + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + + if (this.field_147045_u) { + this.func_147044_g(); + } + } + + private void func_147044_g() { + int var1 = this.field_147003_i - 124; + int var2 = this.field_147009_r; + boolean var3 = true; + Collection var4 = this.mc.thePlayer.getActivePotionEffects(); + + if (!var4.isEmpty()) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + int var5 = 33; + + if (var4.size() > 5) { + var5 = 132 / (var4.size() - 1); + } + + for (Iterator var6 = this.mc.thePlayer.getActivePotionEffects().iterator(); var6.hasNext(); var2 += var5) { + PotionEffect var7 = var6.next(); + Potion var8 = Potion.potionTypes[var7.getPotionID()]; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147001_a); + drawTexturedModalRect(var1, var2, 0, 166, 140, 32); + + if (var8.hasStatusIcon()) { + int var9 = var8.getStatusIconIndex(); + drawTexturedModalRect(var1 + 6, var2 + 7, 0 + var9 % 8 * 18, 198 + var9 / 8 * 18, 18, 18); + } + + String var11 = I18n.format(var8.getName()); + + if (var7.getAmplifier() == 1) { + var11 = var11 + " " + I18n.format("enchantment.level.2"); + } else if (var7.getAmplifier() == 2) { + var11 = var11 + " " + I18n.format("enchantment.level.3"); + } else if (var7.getAmplifier() == 3) { + var11 = var11 + " " + I18n.format("enchantment.level.4"); + } + + this.fontRendererObj.drawStringWithShadow(var11, var1 + 10 + 18, var2 + 6, 16777215); + String var10 = Potion.getDurationString(var7); + this.fontRendererObj.drawStringWithShadow(var10, var1 + 10 + 18, var2 + 6 + 10, 8355711); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ItemRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ItemRenderer.java new file mode 100644 index 0000000..b73dcf2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ItemRenderer.java @@ -0,0 +1,693 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.perspective.ModuleDragToLook; +import com.cheatbreaker.client.module.impl.normal.ModulePackTweaks; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnchantmentGlint; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemCloth; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class ItemRenderer { + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); + private static final ResourceLocation RES_UNDERWATER_OVERLAY = new ResourceLocation("textures/misc/underwater.png"); + + /** A reference to the Minecraft object. */ + private final Minecraft mc; + private ItemStack itemToRender; + + /** + * How far the current item has been equipped (0 disequipped and 1 fully up) + */ + private float equippedProgress; + private float prevEquippedProgress; + private final RenderBlocks renderBlocksIr = new RenderBlocks(); + + /** The index of the currently held item (0-8, or -1 if not yet updated) */ + private int equippedItemSlot = -1; + + + public ItemRenderer(Minecraft p_i1247_1_) { + this.mc = p_i1247_1_; + } + + /** + * Renders the item stack for being in an entity's hand Args: itemStack + */ + public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_) { + GL11.glPushMatrix(); + TextureManager var4 = this.mc.getTextureManager(); + Item var5 = p_78443_2_.getItem(); + Block var6 = Block.getBlockFromItem(var5); + + if (p_78443_2_ != null && var6 != null && var6.getRenderBlockPass() != 0) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + if (p_78443_2_.getItemSpriteNumber() == 0 && var5 instanceof ItemBlock && RenderBlocks.renderItemIn3d(var6.getRenderType())) { + var4.bindTexture(var4.getResourceLocation(0)); + + if (p_78443_2_ != null && var6 != null && var6.getRenderBlockPass() != 0) { + GL11.glDepthMask(false); + this.renderBlocksIr.renderBlockAsItem(var6, p_78443_2_.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + } else { + this.renderBlocksIr.renderBlockAsItem(var6, p_78443_2_.getItemDamage(), 1.0F); + } + } else { + IIcon var7 = p_78443_1_.getItemIcon(p_78443_2_, p_78443_3_); + + if (var7 == null) { + GL11.glPopMatrix(); + return; + } + + var4.bindTexture(var4.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator var8 = Tessellator.instance; + float var9 = var7.getMinU(); + float var10 = var7.getMaxU(); + float var11 = var7.getMinV(); + float var12 = var7.getMaxV(); + float var13 = 0.0F; + float var14 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glTranslatef(-var13, -var14, 0.0F); + float var15 = 1.5F; + GL11.glScalef(var15, var15, var15); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); + renderItemIn2D(var8, var10, var11, var9, var12, var7.getIconWidth(), var7.getIconHeight(), 0.0625F); + + ModuleEnchantmentGlint glintModule = CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod; + if (p_78443_2_.hasEffect() && p_78443_3_ == 0 && glintModule.isEnabled() && (Boolean)glintModule.heldItemGlint.getValue()) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + var4.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + int getGlintColor = glintModule.heldItemGlintColor.getColorValue(); + float glintA = (float)(getGlintColor >> 24 & 255) / 255.0F; + float glintR = (float)(getGlintColor >> 16 & 255) / 255.0F; + float glintG = (float)(getGlintColor >> 8 & 255) / 255.0F; + float glintB = (float)(getGlintColor & 255) / 255.0F; + float n5 = glintA * 0.76F; + GL11.glColor4f(glintR * n5, glintG * n5, glintB * n5, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float var17 = 0.125F; + GL11.glScalef(var17, var17, var17); + float var18 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(var18, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(var17, var17, var17); + var18 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-var18, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + var4.bindTexture(var4.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + + if (p_78443_2_ != null && var6 != null && var6.getRenderBlockPass() != 0) { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glPopMatrix(); + } + + /** + * Renders an item held in hand as a 2D texture with thickness + */ + public static void renderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_) { + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, 1.0F); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, 0.0D, p_78439_1_, p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, 0.0D, p_78439_3_, p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, 0.0D, p_78439_3_, p_78439_2_); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, 0.0D, p_78439_1_, p_78439_2_); + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, -1.0F); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, 0.0F - p_78439_7_, p_78439_1_, p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, 0.0F - p_78439_7_, p_78439_3_, p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, 0.0F - p_78439_7_, p_78439_3_, p_78439_4_); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, 0.0F - p_78439_7_, p_78439_1_, p_78439_4_); + p_78439_0_.draw(); + float var8 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)p_78439_5_; + float var9 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)p_78439_6_; + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(-1.0F, 0.0F, 0.0F); + int var10; + float var11; + float var12; + + for (var10 = 0; var10 < p_78439_5_; ++var10) { + var11 = (float)var10 / (float)p_78439_5_; + var12 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * var11 - var8; + p_78439_0_.addVertexWithUV(var11, 0.0D, 0.0F - p_78439_7_, var12, p_78439_4_); + p_78439_0_.addVertexWithUV(var11, 0.0D, 0.0D, var12, p_78439_4_); + p_78439_0_.addVertexWithUV(var11, 1.0D, 0.0D, var12, p_78439_2_); + p_78439_0_.addVertexWithUV(var11, 1.0D, 0.0F - p_78439_7_, var12, p_78439_2_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(1.0F, 0.0F, 0.0F); + float var13; + + for (var10 = 0; var10 < p_78439_5_; ++var10) { + var11 = (float)var10 / (float)p_78439_5_; + var12 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * var11 - var8; + var13 = var11 + 1.0F / (float)p_78439_5_; + p_78439_0_.addVertexWithUV(var13, 1.0D, 0.0F - p_78439_7_, var12, p_78439_2_); + p_78439_0_.addVertexWithUV(var13, 1.0D, 0.0D, var12, p_78439_2_); + p_78439_0_.addVertexWithUV(var13, 0.0D, 0.0D, var12, p_78439_4_); + p_78439_0_.addVertexWithUV(var13, 0.0D, 0.0F - p_78439_7_, var12, p_78439_4_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 1.0F, 0.0F); + + for (var10 = 0; var10 < p_78439_6_; ++var10) { + var11 = (float)var10 / (float)p_78439_6_; + var12 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * var11 - var9; + var13 = var11 + 1.0F / (float)p_78439_6_; + p_78439_0_.addVertexWithUV(0.0D, var13, 0.0D, p_78439_1_, var12); + p_78439_0_.addVertexWithUV(1.0D, var13, 0.0D, p_78439_3_, var12); + p_78439_0_.addVertexWithUV(1.0D, var13, 0.0F - p_78439_7_, p_78439_3_, var12); + p_78439_0_.addVertexWithUV(0.0D, var13, 0.0F - p_78439_7_, p_78439_1_, var12); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, -1.0F, 0.0F); + + for (var10 = 0; var10 < p_78439_6_; ++var10) { + var11 = (float)var10 / (float)p_78439_6_; + var12 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * var11 - var9; + p_78439_0_.addVertexWithUV(1.0D, var11, 0.0D, p_78439_3_, var12); + p_78439_0_.addVertexWithUV(0.0D, var11, 0.0D, p_78439_1_, var12); + p_78439_0_.addVertexWithUV(0.0D, var11, 0.0F - p_78439_7_, p_78439_1_, var12); + p_78439_0_.addVertexWithUV(1.0D, var11, 0.0F - p_78439_7_, p_78439_3_, var12); + } + + p_78439_0_.draw(); + } + + /** + * Renders the active item in the player's hand when in first person mode. Args: partialTickTime + */ + public void renderItemInFirstPerson(float p_78440_1_) { + ModuleDragToLook dragToLook = CheatBreaker.getInstance().getModuleManager().dragToLook; + float f5 = dragToLook.enabled ? this.mc.thePlayer.rotationYaw - dragToLook.rotationYaw : 0.0f; + float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * p_78440_1_; + EntityClientPlayerMP var3 = this.mc.thePlayer; + float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * p_78440_1_; + GL11.glPushMatrix(); + GL11.glRotatef(var4, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * p_78440_1_, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GL11.glPopMatrix(); + EntityPlayerSP var5 = var3; + float var6 = var5.prevRenderArmPitch + (var5.renderArmPitch - var5.prevRenderArmPitch) * p_78440_1_; + float var7 = var5.prevRenderArmYaw + (var5.renderArmYaw - var5.prevRenderArmYaw) * p_78440_1_ + f5 * (float)10; + GL11.glRotatef((var3.rotationPitch - var6) * 0.1F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef((var3.rotationYaw - var7) * 0.1F, 0.0F, 1.0F, 0.0F); + ItemStack var8 = this.itemToRender; + + if (var8 != null && var8.getItem() instanceof ItemCloth) { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + int var9 = this.mc.theWorld.getLightBrightnessForSkyBlocks(MathHelper.floor_double(var3.posX), MathHelper.floor_double(var3.posY), MathHelper.floor_double(var3.posZ), 0); + int var10 = var9 % 65536; + int var11 = var9 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var10 / 1.0F, (float)var11 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var13; + float var14; + float var15; + + if (var8 != null) { + int var12 = var8.getItem().getColorFromItemStack(var8, 0); + var13 = (float)(var12 >> 16 & 255) / 255.0F; + var14 = (float)(var12 >> 8 & 255) / 255.0F; + var15 = (float)(var12 & 255) / 255.0F; + GL11.glColor4f(var13, var14, var15, 1.0F); + } else { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + float var16; + float var17; + float var18; + float var22; + Render var26; + RenderPlayer var29; + + if (var8 != null && var8.getItem() == Items.filled_map) { + GL11.glPushMatrix(); + var22 = 0.8F; + var13 = var3.getSwingProgress(p_78440_1_); + var14 = MathHelper.sin(var13 * (float)Math.PI); + var15 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI); + GL11.glTranslatef(-var15 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI * 2.0F) * 0.2F, -var14 * 0.2F); + var13 = 1.0F - var4 / 45.0F + 0.1F; + + if (var13 < 0.0F) { + var13 = 0.0F; + } + + if (var13 > 1.0F) { + var13 = 1.0F; + } + + var13 = -MathHelper.cos(var13 * (float)Math.PI) * 0.5F + 0.5F; + GL11.glTranslatef(0.0F, 0.0F * var22 - (1.0F - var2) * 1.2F - var13 * 0.5F + 0.04F, -0.9F * var22); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var13 * -85.0F, 0.0F, 0.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); + + for (int var24 = 0; var24 < 2; ++var24) { + int var25 = var24 * 2 - 1; + GL11.glPushMatrix(); + GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float)var25); + GL11.glRotatef((float)(-45 * var25), 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef((float)(-65 * var25), 0.0F, 1.0F, 0.0F); + var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); + var29 = (RenderPlayer)var26; + var18 = 1.0F; + GL11.glScalef(var18, var18, var18); + var29.renderFirstPersonArm(this.mc.thePlayer); + GL11.glPopMatrix(); + } + + var14 = var3.getSwingProgress(p_78440_1_); + var15 = MathHelper.sin(var14 * var14 * (float)Math.PI); + var16 = MathHelper.sin(MathHelper.sqrt_float(var14) * (float)Math.PI); + GL11.glRotatef(-var15 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var16 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-var16 * 80.0F, 1.0F, 0.0F, 0.0F); + var17 = 0.38F; + GL11.glScalef(var17, var17, var17); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-1.0F, -1.0F, 0.0F); + var18 = 0.015625F; + GL11.glScalef(var18, var18, var18); + this.mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND); + Tessellator var30 = Tessellator.instance; + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + var30.startDrawingQuads(); + byte var31 = 7; + var30.addVertexWithUV(0 - var31, 128 + var31, 0.0D, 0.0D, 1.0D); + var30.addVertexWithUV(128 + var31, 128 + var31, 0.0D, 1.0D, 1.0D); + var30.addVertexWithUV(128 + var31, 0 - var31, 0.0D, 1.0D, 0.0D); + var30.addVertexWithUV(0 - var31, 0 - var31, 0.0D, 0.0D, 0.0D); + var30.draw(); + MapData var21 = Items.filled_map.getMapData(var8, this.mc.theWorld); + + if (var21 != null) { + this.mc.entityRenderer.getMapItemRenderer().func_148250_a(var21, false); + } + + GL11.glPopMatrix(); + } else if (var8 != null) { + GL11.glPushMatrix(); + var22 = 0.8F; + + if (var3.getItemInUseCount() > 0) { + EnumAction var23 = var8.getItemUseAction(); + + if (var23 == EnumAction.eat || var23 == EnumAction.drink) { + var14 = (float)var3.getItemInUseCount() - p_78440_1_ + 1.0F; + var15 = 1.0F - var14 / (float)var8.getMaxItemUseDuration(); + var16 = 1.0F - var15; + var16 = var16 * var16 * var16; + var16 = var16 * var16 * var16; + var16 = var16 * var16 * var16; + var17 = 1.0F - var16; + GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(var14 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)var15 > 0.2D ? 1 : 0), 0.0F); + GL11.glTranslatef(var17 * 0.6F, -var17 * 0.5F, 0.0F); + GL11.glRotatef(var17 * 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var17 * 10.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var17 * 30.0F, 0.0F, 0.0F, 1.0F); + } + } else { + var13 = var3.getSwingProgress(p_78440_1_); + var14 = MathHelper.sin(var13 * (float)Math.PI); + var15 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI); + GL11.glTranslatef(-var15 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI * 2.0F) * 0.2F, -var14 * 0.2F); + } + + GL11.glTranslatef(0.7F * var22, -0.65F * var22 - (1.0F - var2) * 0.6F, -0.9F * var22); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + var13 = var3.getSwingProgress(p_78440_1_); + var14 = MathHelper.sin(var13 * var13 * (float)Math.PI); + var15 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI); + GL11.glRotatef(-var14 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var15 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-var15 * 80.0F, 1.0F, 0.0F, 0.0F); + var16 = 0.4F; + GL11.glScalef(var16, var16, var16); + float var19; + float var20; + + if (var3.getItemInUseCount() > 0) { + EnumAction var27 = var8.getItemUseAction(); + + if (var27 == EnumAction.block) { + GL11.glTranslatef(-0.5F, 0.2F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); + } else if (var27 == EnumAction.bow) { + GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(-0.9F, 0.2F, 0.0F); + var18 = (float)var8.getMaxItemUseDuration() - ((float)var3.getItemInUseCount() - p_78440_1_ + 1.0F); + var19 = var18 / 20.0F; + var19 = (var19 * var19 + var19 * 2.0F) / 3.0F; + + if (var19 > 1.0F) { + var19 = 1.0F; + } + + if (var19 > 0.1F) { + GL11.glTranslatef(0.0F, MathHelper.sin((var18 - 0.1F) * 1.3F) * 0.01F * (var19 - 0.1F), 0.0F); + } + + GL11.glTranslatef(0.0F, 0.0F, var19 * 0.1F); + GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.5F, 0.0F); + var20 = 1.0F + var19 * 0.2F; + GL11.glScalef(1.0F, 1.0F, var20); + GL11.glTranslatef(0.0F, -0.5F, 0.0F); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + } + } + + if (var8.getItem().shouldRotateAroundWhenRendering()) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + if (var8.getItem().requiresMultipleRenderPasses()) { + this.renderItem(var3, var8, 0); + int var28 = var8.getItem().getColorFromItemStack(var8, 1); + var18 = (float)(var28 >> 16 & 255) / 255.0F; + var19 = (float)(var28 >> 8 & 255) / 255.0F; + var20 = (float)(var28 & 255) / 255.0F; + GL11.glColor4f(1.0F * var18, 1.0F * var19, 1.0F * var20, 1.0F); + this.renderItem(var3, var8, 1); + } else { + this.renderItem(var3, var8, 0); + } + + GL11.glPopMatrix(); + } else if (!var3.isInvisible()) { + GL11.glPushMatrix(); + var22 = 0.8F; + var13 = var3.getSwingProgress(p_78440_1_); + var14 = MathHelper.sin(var13 * (float)Math.PI); + var15 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI); + GL11.glTranslatef(-var15 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI * 2.0F) * 0.4F, -var14 * 0.4F); + GL11.glTranslatef(0.8F * var22, -0.75F * var22 - (1.0F - var2) * 0.6F, -0.9F * var22); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + var13 = var3.getSwingProgress(p_78440_1_); + var14 = MathHelper.sin(var13 * var13 * (float)Math.PI); + var15 = MathHelper.sin(MathHelper.sqrt_float(var13) * (float)Math.PI); + GL11.glRotatef(var15 * 70.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var14 * 20.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); + GL11.glTranslatef(-1.0F, 3.6F, 3.5F); + GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glTranslatef(5.6F, 0.0F, 0.0F); + var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); + var29 = (RenderPlayer)var26; + var18 = 1.0F; + GL11.glScalef(var18, var18, var18); + var29.renderFirstPersonArm(this.mc.thePlayer); + GL11.glPopMatrix(); + } + + if (var8 != null && var8.getItem() instanceof ItemCloth) { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + } + + /** + * Renders all the overlays that are in first person mode. Args: partialTickTime + */ + public void renderOverlays(float p_78447_1_) { + GL11.glDisable(GL11.GL_ALPHA_TEST); + + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + boolean ptIsEnabled = pt.isEnabled(); + boolean showFireOverlay = ptIsEnabled ? (Boolean) pt.firstPersonFire.getValue() : true; + if (this.mc.thePlayer.isBurning() && showFireOverlay) { + this.renderFireInFirstPerson(p_78447_1_); + } + + if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) { + int var2 = MathHelper.floor_double(this.mc.thePlayer.posX); + int var3 = MathHelper.floor_double(this.mc.thePlayer.posY); + int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ); + Block var5 = this.mc.theWorld.getBlock(var2, var3, var4); + + if (this.mc.theWorld.getBlock(var2, var3, var4).isNormalCube()) { + this.renderInsideOfBlock(p_78447_1_, var5.getBlockTextureFromSide(2)); + } else { + for (int var6 = 0; var6 < 8; ++var6) { + float var7 = ((float)((var6 >> 0) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; + float var8 = ((float)((var6 >> 1) % 2) - 0.5F) * this.mc.thePlayer.height * 0.2F; + float var9 = ((float)((var6 >> 2) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; + int var10 = MathHelper.floor_float((float)var2 + var7); + int var11 = MathHelper.floor_float((float)var3 + var8); + int var12 = MathHelper.floor_float((float)var4 + var9); + + if (this.mc.theWorld.getBlock(var10, var11, var12).isNormalCube()) { + var5 = this.mc.theWorld.getBlock(var10, var11, var12); + } + } + } + + if (var5.getMaterial() != Material.air) { + this.renderInsideOfBlock(p_78447_1_, var5.getBlockTextureFromSide(2)); + } + } + + if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { + this.renderWarpedTextureOverlay(p_78447_1_); + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + /** + * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, blockTextureIndex + */ + private void renderInsideOfBlock(float p_78446_1_, IIcon p_78446_2_) { + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + Tessellator var3 = Tessellator.instance; + float var4 = 0.1F; + GL11.glColor4f(var4, var4, var4, 0.5F); + GL11.glPushMatrix(); + float var5 = -1.0F; + float var6 = 1.0F; + float var7 = -1.0F; + float var8 = 1.0F; + float var9 = -0.5F; + float var10 = p_78446_2_.getMinU(); + float var11 = p_78446_2_.getMaxU(); + float var12 = p_78446_2_.getMinV(); + float var13 = p_78446_2_.getMaxV(); + var3.startDrawingQuads(); + var3.addVertexWithUV(var5, var7, var9, var11, var13); + var3.addVertexWithUV(var6, var7, var9, var10, var13); + var3.addVertexWithUV(var6, var8, var9, var10, var12); + var3.addVertexWithUV(var5, var8, var9, var11, var12); + var3.draw(); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Renders a texture that warps around based on the direction the player is looking. Texture needs to be bound + * before being called. Used for the water overlay. Args: parialTickTime + */ + private void renderWarpedTextureOverlay(float p_78448_1_) { + this.mc.getTextureManager().bindTexture(RES_UNDERWATER_OVERLAY); + Tessellator var2 = Tessellator.instance; + float var3 = this.mc.thePlayer.getBrightness(p_78448_1_); + GL11.glColor4f(var3, var3, var3, 0.5F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glPushMatrix(); + float var4 = 4.0F; + float var5 = -1.0F; + float var6 = 1.0F; + float var7 = -1.0F; + float var8 = 1.0F; + float var9 = -0.5F; + float var10 = -this.mc.thePlayer.rotationYaw / 64.0F; + float var11 = this.mc.thePlayer.rotationPitch / 64.0F; + var2.startDrawingQuads(); + var2.addVertexWithUV(var5, var7, var9, var4 + var10, var4 + var11); + var2.addVertexWithUV(var6, var7, var9, 0.0F + var10, var4 + var11); + var2.addVertexWithUV(var6, var8, var9, 0.0F + var10, 0.0F + var11); + var2.addVertexWithUV(var5, var8, var9, var4 + var10, 0.0F + var11); + var2.draw(); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * Renders the fire on the screen for first person mode. Arg: partialTickTime + */ + private void renderFireInFirstPerson(float p_78442_1_) { + Tessellator var2 = Tessellator.instance; + if (CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, (float) CheatBreaker.getInstance().getModuleManager().packTweaksMod.firstPersonFireOpacity.getValue() / 100.0F); + } else { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F); + } + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + float var3 = 1.0F; + + for (int var4 = 0; var4 < 2; ++var4) { + GL11.glPushMatrix(); + IIcon var5 = Blocks.fire.func_149840_c(1); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + float var6 = var5.getMinU(); + float var7 = var5.getMaxU(); + float var8 = var5.getMinV(); + float var9 = var5.getMaxV(); + float var10 = (0.0F - var3) / 2.0F; + float var11 = var10 + var3; + float var12 = 0.0F - var3 / 2.0F; + float var13 = var12 + var3; + float var14 = -0.5F; + if (CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GL11.glTranslatef((float)(-(var4 * 2 - 1)) * 0.24F, -1.3F + (float) CheatBreaker.getInstance().getModuleManager().packTweaksMod.firstPersonFireHeight.getValue(), 0.0F); + } else { + GL11.glTranslatef((float)(-(var4 * 2 - 1)) * 0.24F, -0.3F, 0.0F); + } + GL11.glRotatef((float)(var4 * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F); + var2.startDrawingQuads(); + var2.addVertexWithUV(var10, var12, var14, var7, var9); + var2.addVertexWithUV(var11, var12, var14, var6, var9); + var2.addVertexWithUV(var11, var13, var14, var6, var8); + var2.addVertexWithUV(var10, var13, var14, var7, var8); + var2.draw(); + GL11.glPopMatrix(); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + } + + public void updateEquippedItem() { + this.prevEquippedProgress = this.equippedProgress; + EntityClientPlayerMP var1 = this.mc.thePlayer; + ItemStack var2 = var1.inventory.getCurrentItem(); + boolean var3 = this.equippedItemSlot == var1.inventory.currentItem && var2 == this.itemToRender; + + if (this.itemToRender == null && var2 == null) { + var3 = true; + } + + if (var2 != null && this.itemToRender != null && var2 != this.itemToRender && var2.getItem() == this.itemToRender.getItem() && var2.getItemDamage() == this.itemToRender.getItemDamage()) { + this.itemToRender = var2; + var3 = true; + } + + float var4 = 0.4F; + float var5 = var3 ? 1.0F : 0.0F; + float var6 = var5 - this.equippedProgress; + + if (var6 < -var4) { + var6 = -var4; + } + + if (var6 > var4) { + var6 = var4; + } + + this.equippedProgress += var6; + + if (this.equippedProgress < 0.1F) { + this.itemToRender = var2; + this.equippedItemSlot = var1.inventory.currentItem; + } + } + + /** + * Resets equippedProgress + */ + public void resetEquippedProgress() { + this.equippedProgress = 0.0F; + } + + /** + * Resets equippedProgress + */ + public void resetEquippedProgress2() { + this.equippedProgress = 0.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/OpenGlCapsChecker.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/OpenGlCapsChecker.java new file mode 100644 index 0000000..318c6e1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/OpenGlCapsChecker.java @@ -0,0 +1,14 @@ +package net.minecraft.client.renderer; + +import org.lwjgl.opengl.GLContext; + +public class OpenGlCapsChecker { + + + /** + * Checks if we support OpenGL occlusion. + */ + public static boolean checkARBOcclusion() { + return GLContext.getCapabilities().GL_ARB_occlusion_query; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/OpenGlHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/OpenGlHelper.java new file mode 100644 index 0000000..4664372 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/OpenGlHelper.java @@ -0,0 +1,598 @@ +package net.minecraft.client.renderer; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.GlStateManager; +import org.lwjgl.opengl.*; + +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +public class OpenGlHelper { + public static boolean openGL21; + + /** + * An OpenGL constant corresponding to GL_TEXTURE0, used when setting data pertaining to auxiliary OpenGL texture + * units. + */ + public static int defaultTexUnit; + + /** + * An OpenGL constant corresponding to GL_TEXTURE1, used when setting data pertaining to auxiliary OpenGL texture + * units. + */ + public static int lightmapTexUnit; + public static boolean field_153197_d; + public static int field_153198_e; + public static int field_153199_f; + public static int field_153200_g; + public static int field_153201_h; + public static int field_153202_i; + public static int field_153203_j; + public static int field_153204_k; + public static int field_153205_l; + public static int field_153206_m; + private static int field_153212_w; + public static boolean framebufferSupported; + private static boolean field_153213_x; + private static boolean field_153214_y; + public static int field_153207_o; + public static int field_153208_p; + public static int field_153209_q; + public static int field_153210_r; + public static boolean anisotropicFilteringSupported; + public static int anisotropicFilteringMax; + private static boolean field_153215_z; + private static boolean openGL14; + public static boolean field_153211_u; + public static boolean shadersSupported; + private static String field_153196_B = ""; + public static float lastBrightnessX = 0.0F; + public static float lastBrightnessY = 0.0F; + public static boolean glBlendFuncZero = false; + + /** + * Initializes the texture constants to be used when rendering lightmap values + */ + public static void initializeTextures() { + Config.initDisplay(); + ContextCapabilities var0 = GLContext.getCapabilities(); + field_153215_z = var0.GL_ARB_multitexture && !var0.OpenGL13; + + if (field_153215_z) { + field_153196_B = field_153196_B + "Using multitexturing ARB.\n"; + defaultTexUnit = 33984; + lightmapTexUnit = 33985; + } else { + field_153196_B = field_153196_B + "Using GL 1.3 multitexturing.\n"; + defaultTexUnit = 33984; + lightmapTexUnit = 33985; + } + + field_153211_u = var0.GL_EXT_blend_func_separate && !var0.OpenGL14; + openGL14 = var0.OpenGL14 || var0.GL_EXT_blend_func_separate; + framebufferSupported = openGL14 && (var0.GL_ARB_framebuffer_object || var0.GL_EXT_framebuffer_object || var0.OpenGL30); + + if (framebufferSupported) { + field_153196_B = field_153196_B + "Using framebuffer objects because "; + + if (var0.OpenGL30) { + field_153196_B = field_153196_B + "OpenGL 3.0 is supported and separate blending is supported.\n"; + field_153212_w = 0; + field_153198_e = 36160; + field_153199_f = 36161; + field_153200_g = 36064; + field_153201_h = 36096; + field_153202_i = 36053; + field_153203_j = 36054; + field_153204_k = 36055; + field_153205_l = 36059; + field_153206_m = 36060; + } else if (var0.GL_ARB_framebuffer_object) { + field_153196_B = field_153196_B + "ARB_framebuffer_object is supported and separate blending is supported.\n"; + field_153212_w = 1; + field_153198_e = 36160; + field_153199_f = 36161; + field_153200_g = 36064; + field_153201_h = 36096; + field_153202_i = 36053; + field_153204_k = 36055; + field_153203_j = 36054; + field_153205_l = 36059; + field_153206_m = 36060; + } else if (var0.GL_EXT_framebuffer_object) { + field_153196_B = field_153196_B + "EXT_framebuffer_object is supported.\n"; + field_153212_w = 2; + field_153198_e = 36160; + field_153199_f = 36161; + field_153200_g = 36064; + field_153201_h = 36096; + field_153202_i = 36053; + field_153204_k = 36055; + field_153203_j = 36054; + field_153205_l = 36059; + field_153206_m = 36060; + } + } else { + field_153196_B = field_153196_B + "Not using framebuffer objects because "; + field_153196_B = field_153196_B + "OpenGL 1.4 is " + (var0.OpenGL14 ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "EXT_blend_func_separate is " + (var0.GL_EXT_blend_func_separate ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "OpenGL 3.0 is " + (var0.OpenGL30 ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "ARB_framebuffer_object is " + (var0.GL_ARB_framebuffer_object ? "" : "not ") + "supported, and "; + field_153196_B = field_153196_B + "EXT_framebuffer_object is " + (var0.GL_EXT_framebuffer_object ? "" : "not ") + "supported.\n"; + } + + anisotropicFilteringSupported = var0.GL_EXT_texture_filter_anisotropic; + anisotropicFilteringMax = (int)(anisotropicFilteringSupported ? GL11.glGetFloat(34047) : 0.0F); + field_153196_B = field_153196_B + "Anisotropic filtering is " + (anisotropicFilteringSupported ? "" : "not ") + "supported"; + + if (anisotropicFilteringSupported) { + field_153196_B = field_153196_B + " and maximum anisotropy is " + anisotropicFilteringMax + ".\n"; + } else { + field_153196_B = field_153196_B + ".\n"; + } + + GameSettings.Options.ANISOTROPIC_FILTERING.setValueMax((float)anisotropicFilteringMax); + openGL21 = var0.OpenGL21; + field_153213_x = openGL21 || var0.GL_ARB_vertex_shader && var0.GL_ARB_fragment_shader && var0.GL_ARB_shader_objects; + field_153196_B = field_153196_B + "Shaders are " + (field_153213_x ? "" : "not ") + "available because "; + + if (field_153213_x) { + if (var0.OpenGL21) { + field_153196_B = field_153196_B + "OpenGL 2.1 is supported.\n"; + field_153214_y = false; + field_153207_o = 35714; + field_153208_p = 35713; + field_153209_q = 35633; + field_153210_r = 35632; + } else { + field_153196_B = field_153196_B + "ARB_shader_objects, ARB_vertex_shader, and ARB_fragment_shader are supported.\n"; + field_153214_y = true; + field_153207_o = 35714; + field_153208_p = 35713; + field_153209_q = 35633; + field_153210_r = 35632; + } + } else { + field_153196_B = field_153196_B + "OpenGL 2.1 is " + (var0.OpenGL21 ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "ARB_shader_objects is " + (var0.GL_ARB_shader_objects ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "ARB_vertex_shader is " + (var0.GL_ARB_vertex_shader ? "" : "not ") + "supported, and "; + field_153196_B = field_153196_B + "ARB_fragment_shader is " + (var0.GL_ARB_fragment_shader ? "" : "not ") + "supported.\n"; + } + + shadersSupported = framebufferSupported && field_153213_x; + field_153197_d = GL11.glGetString(GL11.GL_VENDOR).toLowerCase().contains("nvidia"); + } + + public static boolean func_153193_b() { + return shadersSupported; + } + + public static String func_153172_c() { + return field_153196_B; + } + + public static int func_153175_a(int p_153175_0_, int p_153175_1_) { + return field_153214_y ? ARBShaderObjects.glGetObjectParameteriARB(p_153175_0_, p_153175_1_) : GL20.glGetProgrami(p_153175_0_, p_153175_1_); + } + + public static void func_153178_b(int p_153178_0_, int p_153178_1_) { + if (field_153214_y) { + ARBShaderObjects.glAttachObjectARB(p_153178_0_, p_153178_1_); + } else { + GL20.glAttachShader(p_153178_0_, p_153178_1_); + } + } + + public static void func_153180_a(int p_153180_0_) { + if (field_153214_y) { + ARBShaderObjects.glDeleteObjectARB(p_153180_0_); + } else { + GL20.glDeleteShader(p_153180_0_); + } + } + + public static int func_153195_b(int p_153195_0_) { + return field_153214_y ? ARBShaderObjects.glCreateShaderObjectARB(p_153195_0_) : GL20.glCreateShader(p_153195_0_); + } + + public static void func_153169_a(int p_153169_0_, ByteBuffer p_153169_1_) { + if (field_153214_y) { + ARBShaderObjects.glShaderSourceARB(p_153169_0_, p_153169_1_); + } else { + GL20.glShaderSource(p_153169_0_, p_153169_1_); + } + } + + public static void func_153170_c(int p_153170_0_) { + if (field_153214_y) { + ARBShaderObjects.glCompileShaderARB(p_153170_0_); + } else { + GL20.glCompileShader(p_153170_0_); + } + } + + public static int func_153157_c(int p_153157_0_, int p_153157_1_) { + return field_153214_y ? ARBShaderObjects.glGetObjectParameteriARB(p_153157_0_, p_153157_1_) : GL20.glGetShaderi(p_153157_0_, p_153157_1_); + } + + public static String func_153158_d(int p_153158_0_, int p_153158_1_) { + return field_153214_y ? ARBShaderObjects.glGetInfoLogARB(p_153158_0_, p_153158_1_) : GL20.glGetShaderInfoLog(p_153158_0_, p_153158_1_); + } + + public static String func_153166_e(int p_153166_0_, int p_153166_1_) { + return field_153214_y ? ARBShaderObjects.glGetInfoLogARB(p_153166_0_, p_153166_1_) : GL20.glGetProgramInfoLog(p_153166_0_, p_153166_1_); + } + + public static void func_153161_d(int p_153161_0_) { + if (field_153214_y) { + ARBShaderObjects.glUseProgramObjectARB(p_153161_0_); + } else { + GL20.glUseProgram(p_153161_0_); + } + } + + public static int func_153183_d() { + return field_153214_y ? ARBShaderObjects.glCreateProgramObjectARB() : GL20.glCreateProgram(); + } + + public static void func_153187_e(int p_153187_0_) { + if (field_153214_y) { + ARBShaderObjects.glDeleteObjectARB(p_153187_0_); + } else { + GL20.glDeleteProgram(p_153187_0_); + } + } + + public static void func_153179_f(int p_153179_0_) { + if (field_153214_y) { + ARBShaderObjects.glLinkProgramARB(p_153179_0_); + } else { + GL20.glLinkProgram(p_153179_0_); + } + } + + public static int func_153194_a(int p_153194_0_, CharSequence p_153194_1_) { + return field_153214_y ? ARBShaderObjects.glGetUniformLocationARB(p_153194_0_, p_153194_1_) : GL20.glGetUniformLocation(p_153194_0_, p_153194_1_); + } + + public static void func_153181_a(int p_153181_0_, IntBuffer p_153181_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform1ARB(p_153181_0_, p_153181_1_); + } else { + GL20.glUniform1(p_153181_0_, p_153181_1_); + } + } + + public static void func_153163_f(int p_153163_0_, int p_153163_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform1iARB(p_153163_0_, p_153163_1_); + } else { + GL20.glUniform1i(p_153163_0_, p_153163_1_); + } + } + + public static void func_153168_a(int p_153168_0_, FloatBuffer p_153168_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform1ARB(p_153168_0_, p_153168_1_); + } else { + GL20.glUniform1(p_153168_0_, p_153168_1_); + } + } + + public static void func_153182_b(int p_153182_0_, IntBuffer p_153182_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform2ARB(p_153182_0_, p_153182_1_); + } else { + GL20.glUniform2(p_153182_0_, p_153182_1_); + } + } + + public static void func_153177_b(int p_153177_0_, FloatBuffer p_153177_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform2ARB(p_153177_0_, p_153177_1_); + } else { + GL20.glUniform2(p_153177_0_, p_153177_1_); + } + } + + public static void func_153192_c(int p_153192_0_, IntBuffer p_153192_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform3ARB(p_153192_0_, p_153192_1_); + } else { + GL20.glUniform3(p_153192_0_, p_153192_1_); + } + } + + public static void func_153191_c(int p_153191_0_, FloatBuffer p_153191_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform3ARB(p_153191_0_, p_153191_1_); + } else { + GL20.glUniform3(p_153191_0_, p_153191_1_); + } + } + + public static void func_153162_d(int p_153162_0_, IntBuffer p_153162_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform4ARB(p_153162_0_, p_153162_1_); + } else { + GL20.glUniform4(p_153162_0_, p_153162_1_); + } + } + + public static void func_153159_d(int p_153159_0_, FloatBuffer p_153159_1_) { + if (field_153214_y) { + ARBShaderObjects.glUniform4ARB(p_153159_0_, p_153159_1_); + } else { + GL20.glUniform4(p_153159_0_, p_153159_1_); + } + } + + public static void func_153173_a(int p_153173_0_, boolean p_153173_1_, FloatBuffer p_153173_2_) { + if (field_153214_y) { + ARBShaderObjects.glUniformMatrix2ARB(p_153173_0_, p_153173_1_, p_153173_2_); + } else { + GL20.glUniformMatrix2(p_153173_0_, p_153173_1_, p_153173_2_); + } + } + + public static void func_153189_b(int p_153189_0_, boolean p_153189_1_, FloatBuffer p_153189_2_) { + if (field_153214_y) { + ARBShaderObjects.glUniformMatrix3ARB(p_153189_0_, p_153189_1_, p_153189_2_); + } else { + GL20.glUniformMatrix3(p_153189_0_, p_153189_1_, p_153189_2_); + } + } + + public static void func_153160_c(int p_153160_0_, boolean p_153160_1_, FloatBuffer p_153160_2_) { + if (field_153214_y) { + ARBShaderObjects.glUniformMatrix4ARB(p_153160_0_, p_153160_1_, p_153160_2_); + } else { + GL20.glUniformMatrix4(p_153160_0_, p_153160_1_, p_153160_2_); + } + } + + public static int func_153164_b(int p_153164_0_, CharSequence p_153164_1_) { + return field_153214_y ? ARBVertexShader.glGetAttribLocationARB(p_153164_0_, p_153164_1_) : GL20.glGetAttribLocation(p_153164_0_, p_153164_1_); + } + + public static void func_153171_g(int p_153171_0_, int p_153171_1_) { + if (framebufferSupported) { + switch (field_153212_w) { + case 0: + GL30.glBindFramebuffer(p_153171_0_, p_153171_1_); + break; + + case 1: + ARBFramebufferObject.glBindFramebuffer(p_153171_0_, p_153171_1_); + break; + + case 2: + EXTFramebufferObject.glBindFramebufferEXT(p_153171_0_, p_153171_1_); + } + } + } + + public static void func_153176_h(int p_153176_0_, int p_153176_1_) { + if (framebufferSupported) { + switch (field_153212_w) { + case 0: + GL30.glBindRenderbuffer(p_153176_0_, p_153176_1_); + break; + + case 1: + ARBFramebufferObject.glBindRenderbuffer(p_153176_0_, p_153176_1_); + break; + + case 2: + EXTFramebufferObject.glBindRenderbufferEXT(p_153176_0_, p_153176_1_); + } + } + } + + public static void func_153184_g(int p_153184_0_) { + if (framebufferSupported) { + switch (field_153212_w) { + case 0: + GL30.glDeleteRenderbuffers(p_153184_0_); + break; + + case 1: + ARBFramebufferObject.glDeleteRenderbuffers(p_153184_0_); + break; + + case 2: + EXTFramebufferObject.glDeleteRenderbuffersEXT(p_153184_0_); + } + } + } + + public static void func_153174_h(int p_153174_0_) { + if (framebufferSupported) { + switch (field_153212_w) { + case 0: + GL30.glDeleteFramebuffers(p_153174_0_); + break; + + case 1: + ARBFramebufferObject.glDeleteFramebuffers(p_153174_0_); + break; + + case 2: + EXTFramebufferObject.glDeleteFramebuffersEXT(p_153174_0_); + } + } + } + + public static int func_153165_e() { + if (!framebufferSupported) { + return -1; + } else { + switch (field_153212_w) { + case 0: + return GL30.glGenFramebuffers(); + + case 1: + return ARBFramebufferObject.glGenFramebuffers(); + + case 2: + return EXTFramebufferObject.glGenFramebuffersEXT(); + + default: + return -1; + } + } + } + + public static int func_153185_f() { + if (!framebufferSupported) { + return -1; + } else { + switch (field_153212_w) { + case 0: + return GL30.glGenRenderbuffers(); + + case 1: + return ARBFramebufferObject.glGenRenderbuffers(); + + case 2: + return EXTFramebufferObject.glGenRenderbuffersEXT(); + + default: + return -1; + } + } + } + + public static void func_153186_a(int p_153186_0_, int p_153186_1_, int p_153186_2_, int p_153186_3_) { + if (framebufferSupported) { + switch (field_153212_w) { + case 0: + GL30.glRenderbufferStorage(p_153186_0_, p_153186_1_, p_153186_2_, p_153186_3_); + break; + + case 1: + ARBFramebufferObject.glRenderbufferStorage(p_153186_0_, p_153186_1_, p_153186_2_, p_153186_3_); + break; + + case 2: + EXTFramebufferObject.glRenderbufferStorageEXT(p_153186_0_, p_153186_1_, p_153186_2_, p_153186_3_); + } + } + } + + public static void func_153190_b(int p_153190_0_, int p_153190_1_, int p_153190_2_, int p_153190_3_) { + if (framebufferSupported) { + switch (field_153212_w) { + case 0: + GL30.glFramebufferRenderbuffer(p_153190_0_, p_153190_1_, p_153190_2_, p_153190_3_); + break; + + case 1: + ARBFramebufferObject.glFramebufferRenderbuffer(p_153190_0_, p_153190_1_, p_153190_2_, p_153190_3_); + break; + + case 2: + EXTFramebufferObject.glFramebufferRenderbufferEXT(p_153190_0_, p_153190_1_, p_153190_2_, p_153190_3_); + } + } + } + + public static int func_153167_i(int p_153167_0_) { + if (!framebufferSupported) { + return -1; + } else { + switch (field_153212_w) { + case 0: + return GL30.glCheckFramebufferStatus(p_153167_0_); + + case 1: + return ARBFramebufferObject.glCheckFramebufferStatus(p_153167_0_); + + case 2: + return EXTFramebufferObject.glCheckFramebufferStatusEXT(p_153167_0_); + + default: + return -1; + } + } + } + + public static void func_153188_a(int p_153188_0_, int p_153188_1_, int p_153188_2_, int p_153188_3_, int p_153188_4_) { + if (framebufferSupported) { + switch (field_153212_w) { + case 0: + GL30.glFramebufferTexture2D(p_153188_0_, p_153188_1_, p_153188_2_, p_153188_3_, p_153188_4_); + break; + + case 1: + ARBFramebufferObject.glFramebufferTexture2D(p_153188_0_, p_153188_1_, p_153188_2_, p_153188_3_, p_153188_4_); + break; + + case 2: + EXTFramebufferObject.glFramebufferTexture2DEXT(p_153188_0_, p_153188_1_, p_153188_2_, p_153188_3_, p_153188_4_); + } + } + } + + /** + * Sets the current lightmap texture to the specified OpenGL constant + */ + public static void setActiveTexture(int par0) { + GlStateManager.activeTextureUnit = par0; + + if (field_153215_z) { + ARBMultitexture.glActiveTextureARB(par0); + } else { + GL13.glActiveTexture(par0); + } + } + + /** + * Sets the current lightmap texture to the specified OpenGL constant + */ + public static void setClientActiveTexture(int par0) { + if (field_153215_z) { + ARBMultitexture.glClientActiveTextureARB(par0); + } else { + GL13.glClientActiveTexture(par0); + } + } + + /** + * Sets the current coordinates of the given lightmap texture + */ + public static void setLightmapTextureCoords(int par0, float par1, float par2) { + if (field_153215_z) { + ARBMultitexture.glMultiTexCoord2fARB(par0, par1, par2); + } else { + GL13.glMultiTexCoord2f(par0, par1, par2); + } + + if (par0 == lightmapTexUnit) { + lastBrightnessX = par1; + lastBrightnessY = par2; + } + } + + public static void glBlendFunc(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) { + glBlendFuncZero = (p_148821_0_ | p_148821_1_ | p_148821_2_ | p_148821_3_) == 0; + + if (openGL14) { + if (field_153211_u) { + EXTBlendFuncSeparate.glBlendFuncSeparateEXT(p_148821_0_, p_148821_1_, p_148821_2_, p_148821_3_); + } else { + GL14.glBlendFuncSeparate(p_148821_0_, p_148821_1_, p_148821_2_, p_148821_3_); + } + } else { + GL11.glBlendFunc(p_148821_0_, p_148821_1_); + } + } + + public static boolean isFramebufferEnabled() { + return framebufferSupported && Minecraft.getMinecraft().gameSettings.fboEnable; +// return /*Config.isFastRender() ? false : (Config.isAntialiasing() ? false : */framebufferSupported && Minecraft.getMinecraft().gameSettings.fboEnable && CheatBreaker.getInstance().getGlobalSettings().disableFrameBuffers.getBooleanValue()/*)*/; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.# b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.# new file mode 100644 index 0000000..6c46fc2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.# @@ -0,0 +1,52 @@ +*************** +*** 1932,1947 **** + float var24 = (float)(p_147788_2_ + 1); + float var25 = (float)(p_147788_4_ + 0); + float var26 = (float)(p_147788_4_ + 1); +- boolean var27 = false; + if((var19 || var20) && !var21 && !var22) { +- var27 = true; + } + + if((var21 || var22) && !var20 && !var19) { +- var27 = true; + } + +- if(!var27) { + int var28 = 0; + int var29 = 0; + int var30 = 16; +--- 1932,1947 ---- + float var24 = (float)(p_147788_2_ + 1); + float var25 = (float)(p_147788_4_ + 0); + float var26 = (float)(p_147788_4_ + 1); ++ int var27 = 0; + if((var19 || var20) && !var21 && !var22) { ++ var27 = 1; + } + + if((var21 || var22) && !var20 && !var19) { ++ var27 = 2; + } + ++ if(var27 == 0) { + int var28 = 0; + int var29 = 0; + int var30 = 16; +*************** +*** 1988,1994 **** + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.func_94214_a((double)var30), (double)var9.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.func_94214_a((double)var28), (double)var9.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var9.func_94214_a((double)var28), (double)var9.func_94207_b((double)var31)); +- } else if(var27) { + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94209_e(), (double)var8.func_94206_g()); +--- 1988,1994 ---- + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.func_94214_a((double)var30), (double)var9.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.func_94214_a((double)var28), (double)var9.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var9.func_94214_a((double)var28), (double)var9.func_94207_b((double)var31)); ++ } else if(var27 == 1) { + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94209_e(), (double)var8.func_94206_g()); diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.java new file mode 100644 index 0000000..bcdc951 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.java @@ -0,0 +1,8452 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.ModulePackTweaks; +import net.minecraft.block.*; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.src.Config; +import net.minecraft.src.ConnectedTextures; +import net.minecraft.src.CustomColorizer; +import net.minecraft.src.NaturalProperties; +import net.minecraft.src.NaturalTextures; +import net.minecraft.src.Reflector; +import net.minecraft.src.TextureUtils; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import shadersmod.client.Shaders; + +import java.util.Objects; + +public class RenderBlocks { + /** The IBlockAccess used by this instance of RenderBlocks */ + public IBlockAccess blockAccess; + public IIcon overrideBlockTexture; + + /** + * Set to true if the texture should be flipped horizontally during render*Face + */ + public boolean flipTexture; + public boolean field_152631_f; + public boolean renderAllFaces; + public static boolean fancyGrass = true; + public static boolean cfgGrassFix = true; + public boolean useInventoryTint = true; + public boolean renderFromInside = false; + + /** The minimum X value for rendering (default 0.0). */ + public double renderMinX; + + /** The maximum X value for rendering (default 1.0). */ + public double renderMaxX; + + /** The minimum Y value for rendering (default 0.0). */ + public double renderMinY; + + /** The maximum Y value for rendering (default 1.0). */ + public double renderMaxY; + + /** The minimum Z value for rendering (default 0.0). */ + public double renderMinZ; + + /** The maximum Z value for rendering (default 1.0). */ + public double renderMaxZ; + public boolean lockBlockBounds; + public boolean partialRenderBounds; + public final Minecraft minecraftRB; + public int uvRotateEast; + public int uvRotateWest; + public int uvRotateSouth; + public int uvRotateNorth; + public int uvRotateTop; + public int uvRotateBottom; + public boolean enableAO; + public float aoLightValueScratchXYZNNN; + public float aoLightValueScratchXYNN; + public float aoLightValueScratchXYZNNP; + public float aoLightValueScratchYZNN; + public float aoLightValueScratchYZNP; + public float aoLightValueScratchXYZPNN; + public float aoLightValueScratchXYPN; + public float aoLightValueScratchXYZPNP; + public float aoLightValueScratchXYZNPN; + public float aoLightValueScratchXYNP; + public float aoLightValueScratchXYZNPP; + public float aoLightValueScratchYZPN; + public float aoLightValueScratchXYZPPN; + public float aoLightValueScratchXYPP; + public float aoLightValueScratchYZPP; + public float aoLightValueScratchXYZPPP; + public float aoLightValueScratchXZNN; + public float aoLightValueScratchXZPN; + public float aoLightValueScratchXZNP; + public float aoLightValueScratchXZPP; + public int aoBrightnessXYZNNN; + public int aoBrightnessXYNN; + public int aoBrightnessXYZNNP; + public int aoBrightnessYZNN; + public int aoBrightnessYZNP; + public int aoBrightnessXYZPNN; + public int aoBrightnessXYPN; + public int aoBrightnessXYZPNP; + public int aoBrightnessXYZNPN; + public int aoBrightnessXYNP; + public int aoBrightnessXYZNPP; + public int aoBrightnessYZPN; + public int aoBrightnessXYZPPN; + public int aoBrightnessXYPP; + public int aoBrightnessYZPP; + public int aoBrightnessXYZPPP; + public int aoBrightnessXZNN; + public int aoBrightnessXZPN; + public int aoBrightnessXZNP; + public int aoBrightnessXZPP; + public int brightnessTopLeft; + public int brightnessBottomLeft; + public int brightnessBottomRight; + public int brightnessTopRight; + public float colorRedTopLeft; + public float colorRedBottomLeft; + public float colorRedBottomRight; + public float colorRedTopRight; + public float colorGreenTopLeft; + public float colorGreenBottomLeft; + public float colorGreenBottomRight; + public float colorGreenTopRight; + public float colorBlueTopLeft; + public float colorBlueBottomLeft; + public float colorBlueBottomRight; + public float colorBlueTopRight; + public boolean aoLightValuesCalculated; + public float aoLightValueOpaque = 0.2F; + public boolean betterSnowEnabled = true; + private float lightLevel05 = 0.5F; + private float lightLevel06 = 0.6F; + private float lightLevel08 = 0.8F; + private static RenderBlocks instance; + + public RenderBlocks(IBlockAccess par1IBlockAccess) { + this.blockAccess = par1IBlockAccess; + this.field_152631_f = false; + this.flipTexture = false; + this.minecraftRB = Minecraft.getMinecraft(); + this.aoLightValueOpaque = 1.0F - Config.getAmbientOcclusionLevel() * 0.8F; + + if (Config.isShaders()) { + this.lightLevel08 = Shaders.blockLightLevel08; + this.lightLevel06 = Shaders.blockLightLevel06; + this.lightLevel05 = Shaders.blockLightLevel05; + } + } + + public RenderBlocks() { + this.minecraftRB = Minecraft.getMinecraft(); + } + + /** + * Sets overrideBlockTexture + */ + public void setOverrideBlockTexture(IIcon p_147757_1_) { + this.overrideBlockTexture = p_147757_1_; + } + + /** + * Clear override block texture + */ + public void clearOverrideBlockTexture() { + this.overrideBlockTexture = null; + } + + public boolean hasOverrideBlockTexture() { + return this.overrideBlockTexture != null; + } + + public void setRenderFromInside(boolean p_147786_1_) { + this.renderFromInside = p_147786_1_; + } + + public void setRenderAllFaces(boolean p_147753_1_) { + this.renderAllFaces = p_147753_1_; + } + + public void setRenderBounds(double p_147782_1_, double p_147782_3_, double p_147782_5_, double p_147782_7_, double p_147782_9_, double p_147782_11_) { + if (!this.lockBlockBounds) { + this.renderMinX = p_147782_1_; + this.renderMaxX = p_147782_7_; + this.renderMinY = p_147782_3_; + this.renderMaxY = p_147782_9_; + this.renderMinZ = p_147782_5_; + this.renderMaxZ = p_147782_11_; + this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); + } + } + + public void setRenderBoundsFromBlock(Block p_147775_1_) { + if (!this.lockBlockBounds) { + this.renderMinX = p_147775_1_.getBlockBoundsMinX(); + this.renderMaxX = p_147775_1_.getBlockBoundsMaxX(); + this.renderMinY = p_147775_1_.getBlockBoundsMinY(); + this.renderMaxY = p_147775_1_.getBlockBoundsMaxY(); + this.renderMinZ = p_147775_1_.getBlockBoundsMinZ(); + this.renderMaxZ = p_147775_1_.getBlockBoundsMaxZ(); + this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); + } + } + + public void overrideBlockBounds(double p_147770_1_, double p_147770_3_, double p_147770_5_, double p_147770_7_, double p_147770_9_, double p_147770_11_) { + this.renderMinX = p_147770_1_; + this.renderMaxX = p_147770_7_; + this.renderMinY = p_147770_3_; + this.renderMaxY = p_147770_9_; + this.renderMinZ = p_147770_5_; + this.renderMaxZ = p_147770_11_; + this.lockBlockBounds = true; + this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); + } + + /** + * Unlocks the visual bounding box so that RenderBlocks can change it again. + */ + public void unlockBlockBounds() { + this.lockBlockBounds = false; + } + + /** + * Renders a block using the given texture instead of the block's own default texture + */ + public void renderBlockUsingTexture(Block p_147792_1_, int p_147792_2_, int p_147792_3_, int p_147792_4_, IIcon p_147792_5_) { + this.setOverrideBlockTexture(p_147792_5_); + this.renderBlockByRenderType(p_147792_1_, p_147792_2_, p_147792_3_, p_147792_4_); + this.clearOverrideBlockTexture(); + } + + /** + * Render all faces of a block + */ + public void renderBlockAllFaces(Block p_147769_1_, int p_147769_2_, int p_147769_3_, int p_147769_4_) { + this.renderAllFaces = true; + this.renderBlockByRenderType(p_147769_1_, p_147769_2_, p_147769_3_, p_147769_4_); + this.renderAllFaces = false; + } + + public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4) { + int i = par1Block.getRenderType(); + + if (i == -1) { + return false; + } else { + try { + if (Config.isShaders()) { + Shaders.pushEntity(this, par1Block, par2, par3, par4); + } + + this.renderAllFaces = CheatBreaker.getInstance().getModuleManager().staffModuleXray.shouldRender(Block.getIdFromBlock(par1Block), this.renderAllFaces); + String string = (String) CheatBreaker.getInstance().getModuleManager().packTweaksMod.clearGlass.getValue(); + if (!Objects.equals(string, "NO") && (par1Block instanceof BlockGlass ? string.equals("REGULAR") || string.equals("ALL") : par1Block instanceof BlockStainedGlass && string.equals("ALL"))) { + return true; + } + + boolean foiliageEnabled = CheatBreaker.getInstance().getGlobalSettings().hideFoliage.getBooleanValue(); + + //if more things need to be added here then I'll add them but this looks pretty good + if (foiliageEnabled) { + if ( + par1Block instanceof BlockBush + ) + { + return false; + } + } + + par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); + + if (Config.isBetterSnow() && par1Block == Blocks.standing_sign && this.hasSnowNeighbours(par2, par3, par4)) { + this.renderSnow(par2, par3, par4, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + this.setRenderBoundsFromBlock(par1Block); + boolean var6; + + switch (i) { + case 0: + var6 = this.renderStandardBlock(par1Block, par2, par3, par4); + return var6; + + case 1: + var6 = this.renderCrossedSquares(par1Block, par2, par3, par4); + return var6; + + case 2: + var6 = this.renderBlockTorch(par1Block, par2, par3, par4); + return var6; + + case 3: + var6 = this.renderBlockFire((BlockFire)par1Block, par2, par3, par4); + return var6; + + case 4: + var6 = this.renderBlockFluids(par1Block, par2, par3, par4); + return var6; + + case 5: + var6 = this.renderBlockRedstoneWire(par1Block, par2, par3, par4); + return var6; + + case 6: + var6 = this.renderBlockCrops(par1Block, par2, par3, par4); + return var6; + + case 7: + var6 = this.renderBlockDoor(par1Block, par2, par3, par4); + return var6; + + case 8: + var6 = this.renderBlockLadder(par1Block, par2, par3, par4); + return var6; + + case 9: + var6 = this.renderBlockMinecartTrack((BlockRailBase)par1Block, par2, par3, par4); + return var6; + + case 10: + var6 = this.renderBlockStairs((BlockStairs)par1Block, par2, par3, par4); + return var6; + + case 11: + var6 = this.renderBlockFence((BlockFence)par1Block, par2, par3, par4); + return var6; + + case 12: + var6 = this.renderBlockLever(par1Block, par2, par3, par4); + return var6; + + case 13: + var6 = this.renderBlockCactus(par1Block, par2, par3, par4); + return var6; + + case 14: + var6 = this.renderBlockBed(par1Block, par2, par3, par4); + return var6; + + case 15: + var6 = this.renderBlockRepeater((BlockRedstoneRepeater)par1Block, par2, par3, par4); + return var6; + + case 16: + var6 = this.renderPistonBase(par1Block, par2, par3, par4, false); + return var6; + + case 17: + var6 = this.renderPistonExtension(par1Block, par2, par3, par4, true); + return var6; + + case 18: + var6 = this.renderBlockPane((BlockPane)par1Block, par2, par3, par4); + return var6; + + case 19: + var6 = this.renderBlockStem(par1Block, par2, par3, par4); + return var6; + + case 20: + var6 = this.renderBlockVine(par1Block, par2, par3, par4); + return var6; + + case 21: + var6 = this.renderBlockFenceGate((BlockFenceGate)par1Block, par2, par3, par4); + return var6; + + case 22: + default: + if (Reflector.ModLoader.exists()) { + var6 = Reflector.callBoolean(Reflector.ModLoader_renderWorldBlock, new Object[] {this, this.blockAccess, Integer.valueOf(par2), Integer.valueOf(par3), Integer.valueOf(par4), par1Block, Integer.valueOf(i)}); + return var6; + } else { + if (Reflector.FMLRenderAccessLibrary.exists()) { + var6 = Reflector.callBoolean(Reflector.FMLRenderAccessLibrary_renderWorldBlock, new Object[] {this, this.blockAccess, Integer.valueOf(par2), Integer.valueOf(par3), Integer.valueOf(par4), par1Block, Integer.valueOf(i)}); + return var6; + } + + var6 = false; + return var6; + } + + case 23: + var6 = this.renderBlockLilyPad(par1Block, par2, par3, par4); + return var6; + + case 24: + var6 = this.renderBlockCauldron((BlockCauldron)par1Block, par2, par3, par4); + return var6; + + case 25: + var6 = this.renderBlockBrewingStand((BlockBrewingStand)par1Block, par2, par3, par4); + return var6; + + case 26: + var6 = this.renderBlockEndPortalFrame((BlockEndPortalFrame)par1Block, par2, par3, par4); + return var6; + + case 27: + var6 = this.renderBlockDragonEgg((BlockDragonEgg)par1Block, par2, par3, par4); + return var6; + + case 28: + var6 = this.renderBlockCocoa((BlockCocoa)par1Block, par2, par3, par4); + return var6; + + case 29: + var6 = this.renderBlockTripWireSource(par1Block, par2, par3, par4); + return var6; + + case 30: + var6 = this.renderBlockTripWire(par1Block, par2, par3, par4); + return var6; + + case 31: + var6 = this.renderBlockLog(par1Block, par2, par3, par4); + return var6; + + case 32: + var6 = this.renderBlockWall((BlockWall)par1Block, par2, par3, par4); + return var6; + + case 33: + var6 = this.renderBlockFlowerpot((BlockFlowerPot)par1Block, par2, par3, par4); + return var6; + + case 34: + var6 = this.renderBlockBeacon((BlockBeacon)par1Block, par2, par3, par4); + return var6; + + case 35: + var6 = this.renderBlockAnvil((BlockAnvil)par1Block, par2, par3, par4); + return var6; + + case 36: + var6 = this.renderBlockRedstoneDiode((BlockRedstoneDiode)par1Block, par2, par3, par4); + return var6; + + case 37: + var6 = this.renderBlockRedstoneComparator((BlockRedstoneComparator)par1Block, par2, par3, par4); + return var6; + + case 38: + var6 = this.renderBlockHopper((BlockHopper)par1Block, par2, par3, par4); + return var6; + + case 39: + var6 = this.renderBlockQuartz(par1Block, par2, par3, par4); + return var6; + + case 40: + var6 = this.renderBlockDoublePlant((BlockDoublePlant)par1Block, par2, par3, par4); + return var6; + + case 41: + var6 = this.renderBlockStainedGlassPane(par1Block, par2, par3, par4); + return var6; + } + } finally { + if (Config.isShaders()) { + Shaders.popEntity(); + } + } + } + } + + /** + * Render BlockEndPortalFrame + */ + public boolean renderBlockEndPortalFrame(BlockEndPortalFrame p_147743_1_, int p_147743_2_, int p_147743_3_, int p_147743_4_) { + int var5 = this.blockAccess.getBlockMetadata(p_147743_2_, p_147743_3_, p_147743_4_); + int var6 = var5 & 3; + + if (var6 == 0) { + this.uvRotateTop = 3; + } else if (var6 == 3) { + this.uvRotateTop = 1; + } else if (var6 == 1) { + this.uvRotateTop = 2; + } + + if (!BlockEndPortalFrame.func_150020_b(var5)) { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.uvRotateTop = 0; + return true; + } else { + this.renderAllFaces = true; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.setOverrideBlockTexture(p_147743_1_.func_150021_e()); + this.setRenderBounds(0.25D, 0.8125D, 0.25D, 0.75D, 1.0D, 0.75D); + this.renderStandardBlock(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + this.uvRotateTop = 0; + return true; + } + } + + /** + * render a bed at the given coordinates + */ + public boolean renderBlockBed(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) { + Tessellator var5 = Tessellator.instance; + int var6 = this.blockAccess.getBlockMetadata(p_147773_2_, p_147773_3_, p_147773_4_); + int var7 = BlockBed.func_149895_l(var6); + boolean var8 = BlockBed.func_149975_b(var6); + + if (Reflector.ForgeBlock_getBedDirection.exists()) { + var7 = Reflector.callInt(p_147773_1_, Reflector.ForgeBlock_getBedDirection, new Object[] {this.blockAccess, Integer.valueOf(p_147773_2_), Integer.valueOf(p_147773_3_), Integer.valueOf(p_147773_4_)}); + } + + if (Reflector.ForgeBlock_isBedFoot.exists()) { + var8 = Reflector.callBoolean(p_147773_1_, Reflector.ForgeBlock_isBedFoot, new Object[] {this.blockAccess, Integer.valueOf(p_147773_2_), Integer.valueOf(p_147773_3_), Integer.valueOf(p_147773_4_)}); + } + + float var9 = 0.5F; + float var10 = 1.0F; + float var11 = 0.8F; + float var12 = 0.6F; + + if (Config.isShaders()) { + var9 = this.lightLevel05; + var11 = this.lightLevel08; + var12 = this.lightLevel06; + } + + int var25 = p_147773_1_.getBlockBrightness(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); + var5.setBrightness(var25); + var5.setColorOpaque_F(var9, var9, var9); + IIcon var26 = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 0); + + if (this.overrideBlockTexture != null) { + var26 = this.overrideBlockTexture; + } + + double var27 = (double)var26.getMinU(); + double var29 = (double)var26.getMaxU(); + double var31 = (double)var26.getMinV(); + double var33 = (double)var26.getMaxV(); + double var35 = (double)p_147773_2_ + this.renderMinX; + double var37 = (double)p_147773_2_ + this.renderMaxX; + double var39 = (double)p_147773_3_ + this.renderMinY + 0.1875D; + double var41 = (double)p_147773_4_ + this.renderMinZ; + double var43 = (double)p_147773_4_ + this.renderMaxZ; + var5.addVertexWithUV(var35, var39, var43, var27, var33); + var5.addVertexWithUV(var35, var39, var41, var27, var31); + var5.addVertexWithUV(var37, var39, var41, var29, var31); + var5.addVertexWithUV(var37, var39, var43, var29, var33); + var5.setBrightness(p_147773_1_.getBlockBrightness(this.blockAccess, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); + var5.setColorOpaque_F(var10, var10, var10); + var26 = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 1); + + if (this.overrideBlockTexture != null) { + var26 = this.overrideBlockTexture; + } + + var27 = (double)var26.getMinU(); + var29 = (double)var26.getMaxU(); + var31 = (double)var26.getMinV(); + var33 = (double)var26.getMaxV(); + var35 = var27; + var37 = var29; + var39 = var31; + var41 = var31; + var43 = var27; + double var45 = var29; + double var47 = var33; + double var49 = var33; + + if (var7 == 0) { + var37 = var27; + var39 = var33; + var43 = var29; + var49 = var31; + } else if (var7 == 2) { + var35 = var29; + var41 = var33; + var45 = var27; + var47 = var31; + } else if (var7 == 3) { + var35 = var29; + var41 = var33; + var45 = var27; + var47 = var31; + var37 = var27; + var39 = var33; + var43 = var29; + var49 = var31; + } + + double var51 = (double)p_147773_2_ + this.renderMinX; + double var53 = (double)p_147773_2_ + this.renderMaxX; + double var55 = (double)p_147773_3_ + this.renderMaxY; + double var57 = (double)p_147773_4_ + this.renderMinZ; + double var59 = (double)p_147773_4_ + this.renderMaxZ; + var5.addVertexWithUV(var53, var55, var59, var43, var47); + var5.addVertexWithUV(var53, var55, var57, var35, var39); + var5.addVertexWithUV(var51, var55, var57, var37, var41); + var5.addVertexWithUV(var51, var55, var59, var45, var49); + int var61 = Direction.directionToFacing[var7]; + + if (var8) { + var61 = Direction.directionToFacing[Direction.rotateOpposite[var7]]; + } + + byte var62 = 4; + + switch (var7) { + case 0: + var62 = 5; + break; + + case 1: + var62 = 3; + + case 2: + default: + break; + + case 3: + var62 = 2; + } + + if (var61 != 2 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ - 1, 2))) { + var5.setBrightness(this.renderMinZ > 0.0D ? var25 : p_147773_1_.getBlockBrightness(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ - 1)); + var5.setColorOpaque_F(var11, var11, var11); + this.flipTexture = var62 == 2; + this.renderFaceZNeg(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 2)); + } + + if (var61 != 3 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ + 1, 3))) { + var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : p_147773_1_.getBlockBrightness(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ + 1)); + var5.setColorOpaque_F(var11, var11, var11); + this.flipTexture = var62 == 3; + this.renderFaceZPos(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 3)); + } + + if (var61 != 4 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_ - 1, p_147773_3_, p_147773_4_, 4))) { + var5.setBrightness(this.renderMinZ > 0.0D ? var25 : p_147773_1_.getBlockBrightness(this.blockAccess, p_147773_2_ - 1, p_147773_3_, p_147773_4_)); + var5.setColorOpaque_F(var12, var12, var12); + this.flipTexture = var62 == 4; + this.renderFaceXNeg(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 4)); + } + + if (var61 != 5 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_ + 1, p_147773_3_, p_147773_4_, 5))) { + var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : p_147773_1_.getBlockBrightness(this.blockAccess, p_147773_2_ + 1, p_147773_3_, p_147773_4_)); + var5.setColorOpaque_F(var12, var12, var12); + this.flipTexture = var62 == 5; + this.renderFaceXPos(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 5)); + } + + this.flipTexture = false; + return true; + } + + /** + * Render BlockBrewingStand + */ + public boolean renderBlockBrewingStand(BlockBrewingStand p_147741_1_, int p_147741_2_, int p_147741_3_, int p_147741_4_) { + this.setRenderBounds(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.875D, 0.5625D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.setOverrideBlockTexture(p_147741_1_.func_149959_e()); + this.renderAllFaces = true; + this.setRenderBounds(0.5625D, 0.0D, 0.3125D, 0.9375D, 0.125D, 0.6875D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.setRenderBounds(0.125D, 0.0D, 0.0625D, 0.5D, 0.125D, 0.4375D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.setRenderBounds(0.125D, 0.0D, 0.5625D, 0.5D, 0.125D, 0.9375D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147741_1_.getBlockBrightness(this.blockAccess, p_147741_2_, p_147741_3_, p_147741_4_)); + int var6 = p_147741_1_.colorMultiplier(this.blockAccess, p_147741_2_, p_147741_3_, p_147741_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var31 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var32 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var12 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var31; + var8 = var32; + var9 = var12; + } + + var5.setColorOpaque_F(var7, var8, var9); + IIcon var311 = this.getBlockIconFromSideAndMetadata(p_147741_1_, 0, 0); + + if (this.hasOverrideBlockTexture()) { + var311 = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + var311 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_, -1, var311); + } + + double var321 = (double)var311.getMinV(); + double var13 = (double)var311.getMaxV(); + int var15 = this.blockAccess.getBlockMetadata(p_147741_2_, p_147741_3_, p_147741_4_); + + for (int var16 = 0; var16 < 3; ++var16) { + double var17 = (double)var16 * Math.PI * 2.0D / 3.0D + (Math.PI / 2D); + double var19 = (double)var311.getInterpolatedU(8.0D); + double var21 = (double)var311.getMaxU(); + + if ((var15 & 1 << var16) != 0) { + var21 = (double)var311.getMinU(); + } + + double var23 = (double)p_147741_2_ + 0.5D; + double var25 = (double)p_147741_2_ + 0.5D + Math.sin(var17) * 8.0D / 16.0D; + double var27 = (double)p_147741_4_ + 0.5D; + double var29 = (double)p_147741_4_ + 0.5D + Math.cos(var17) * 8.0D / 16.0D; + var5.addVertexWithUV(var23, (double)(p_147741_3_ + 1), var27, var19, var321); + var5.addVertexWithUV(var23, (double)(p_147741_3_ + 0), var27, var19, var13); + var5.addVertexWithUV(var25, (double)(p_147741_3_ + 0), var29, var21, var13); + var5.addVertexWithUV(var25, (double)(p_147741_3_ + 1), var29, var21, var321); + var5.addVertexWithUV(var25, (double)(p_147741_3_ + 1), var29, var21, var321); + var5.addVertexWithUV(var25, (double)(p_147741_3_ + 0), var29, var21, var13); + var5.addVertexWithUV(var23, (double)(p_147741_3_ + 0), var27, var19, var13); + var5.addVertexWithUV(var23, (double)(p_147741_3_ + 1), var27, var19, var321); + } + + p_147741_1_.setBlockBoundsForItemRender(); + return true; + } + + /** + * Render block cauldron + */ + public boolean renderBlockCauldron(BlockCauldron p_147785_1_, int p_147785_2_, int p_147785_3_, int p_147785_4_) { + this.renderStandardBlock(p_147785_1_, p_147785_2_, p_147785_3_, p_147785_4_); + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147785_1_.getBlockBrightness(this.blockAccess, p_147785_2_, p_147785_3_, p_147785_4_)); + int var6 = p_147785_1_.colorMultiplier(this.blockAccess, p_147785_2_, p_147785_3_, p_147785_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + float var11; + + if (EntityRenderer.anaglyphEnable) { + float var15 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var16 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var15; + var8 = var11; + var9 = var16; + } + + var5.setColorOpaque_F(var7, var8, var9); + IIcon var151 = p_147785_1_.getBlockTextureFromSide(2); + var11 = 0.125F; + this.renderFaceXPos(p_147785_1_, (double)((float)p_147785_2_ - 1.0F + var11), (double)p_147785_3_, (double)p_147785_4_, var151); + this.renderFaceXNeg(p_147785_1_, (double)((float)p_147785_2_ + 1.0F - var11), (double)p_147785_3_, (double)p_147785_4_, var151); + this.renderFaceZPos(p_147785_1_, (double)p_147785_2_, (double)p_147785_3_, (double)((float)p_147785_4_ - 1.0F + var11), var151); + this.renderFaceZNeg(p_147785_1_, (double)p_147785_2_, (double)p_147785_3_, (double)((float)p_147785_4_ + 1.0F - var11), var151); + IIcon var161 = BlockCauldron.func_150026_e("inner"); + this.renderFaceYPos(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ - 1.0F + 0.25F), (double)p_147785_4_, var161); + this.renderFaceYNeg(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ + 1.0F - 0.75F), (double)p_147785_4_, var161); + int var13 = this.blockAccess.getBlockMetadata(p_147785_2_, p_147785_3_, p_147785_4_); + + if (var13 > 0) { + IIcon var14 = BlockLiquid.func_149803_e("water_still"); + int wc = CustomColorizer.getFluidColor(Blocks.water, this.blockAccess, p_147785_2_, p_147785_3_, p_147785_4_); + float wr = (float)(wc >> 16 & 255) / 255.0F; + float wg = (float)(wc >> 8 & 255) / 255.0F; + float wb = (float)(wc & 255) / 255.0F; + var5.setColorOpaque_F(wr, wg, wb); + this.renderFaceYPos(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ - 1.0F + BlockCauldron.func_150025_c(var13)), (double)p_147785_4_, var14); + } + + return true; + } + + /** + * Renders flower pot + */ + public boolean renderBlockFlowerpot(BlockFlowerPot p_147752_1_, int p_147752_2_, int p_147752_3_, int p_147752_4_) { + if (Config.isShaders()) { + Shaders.pushEntity(this, p_147752_1_, p_147752_2_, p_147752_3_, p_147752_4_); + } + + this.renderStandardBlock(p_147752_1_, p_147752_2_, p_147752_3_, p_147752_4_); + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147752_1_.getBlockBrightness(this.blockAccess, p_147752_2_, p_147752_3_, p_147752_4_)); + int var6 = p_147752_1_.colorMultiplier(this.blockAccess, p_147752_2_, p_147752_3_, p_147752_4_); + IIcon var7 = this.getBlockIconFromSide(p_147752_1_, 0); + float var8 = (float)(var6 >> 16 & 255) / 255.0F; + float var9 = (float)(var6 >> 8 & 255) / 255.0F; + float var10 = (float)(var6 & 255) / 255.0F; + float var11; + + if (EntityRenderer.anaglyphEnable) { + var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var21 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var22 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var11; + var9 = var21; + var10 = var22; + } + + var5.setColorOpaque_F(var8, var9, var10); + var11 = 0.1865F; + this.renderFaceXPos(p_147752_1_, (double)((float)p_147752_2_ - 0.5F + var11), (double)p_147752_3_, (double)p_147752_4_, var7); + this.renderFaceXNeg(p_147752_1_, (double)((float)p_147752_2_ + 0.5F - var11), (double)p_147752_3_, (double)p_147752_4_, var7); + this.renderFaceZPos(p_147752_1_, (double)p_147752_2_, (double)p_147752_3_, (double)((float)p_147752_4_ - 0.5F + var11), var7); + this.renderFaceZNeg(p_147752_1_, (double)p_147752_2_, (double)p_147752_3_, (double)((float)p_147752_4_ + 0.5F - var11), var7); + this.renderFaceYPos(p_147752_1_, (double)p_147752_2_, (double)((float)p_147752_3_ - 0.5F + var11 + 0.1875F), (double)p_147752_4_, this.getBlockIcon(Blocks.dirt)); + TileEntity var211 = this.blockAccess.getTileEntity(p_147752_2_, p_147752_3_, p_147752_4_); + + if (var211 != null && var211 instanceof TileEntityFlowerPot) { + Item var221 = ((TileEntityFlowerPot)var211).func_145965_a(); + int var14 = ((TileEntityFlowerPot)var211).func_145966_b(); + + if (var221 instanceof ItemBlock) { + Block var15 = Block.getBlockFromItem(var221); + + if (Config.isShaders()) { + Shaders.pushEntity(var15); + } + + int var16 = var15.getRenderType(); + float var17 = 0.0F; + float var18 = 4.0F; + float var19 = 0.0F; + var5.addTranslation(var17 / 16.0F, var18 / 16.0F, var19 / 16.0F); + var6 = var15.colorMultiplier(this.blockAccess, p_147752_2_, p_147752_3_, p_147752_4_); + + if (var6 != 16777215) { + var8 = (float)(var6 >> 16 & 255) / 255.0F; + var9 = (float)(var6 >> 8 & 255) / 255.0F; + var10 = (float)(var6 & 255) / 255.0F; + var5.setColorOpaque_F(var8, var9, var10); + } + + if (var16 == 1) { + this.drawCrossedSquares(this.getBlockIconFromSideAndMetadata(var15, 0, var14), (double)p_147752_2_, (double)p_147752_3_, (double)p_147752_4_, 0.75F); + } else if (var16 == 13) { + this.renderAllFaces = true; + float var20 = 0.125F; + this.setRenderBounds((double)(0.5F - var20), 0.0D, (double)(0.5F - var20), (double)(0.5F + var20), 0.25D, (double)(0.5F + var20)); + this.renderStandardBlock(var15, p_147752_2_, p_147752_3_, p_147752_4_); + this.setRenderBounds((double)(0.5F - var20), 0.25D, (double)(0.5F - var20), (double)(0.5F + var20), 0.5D, (double)(0.5F + var20)); + this.renderStandardBlock(var15, p_147752_2_, p_147752_3_, p_147752_4_); + this.setRenderBounds((double)(0.5F - var20), 0.5D, (double)(0.5F - var20), (double)(0.5F + var20), 0.75D, (double)(0.5F + var20)); + this.renderStandardBlock(var15, p_147752_2_, p_147752_3_, p_147752_4_); + this.renderAllFaces = false; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } + + var5.addTranslation(-var17 / 16.0F, -var18 / 16.0F, -var19 / 16.0F); + + if (Config.isShaders()) { + Shaders.popEntity(); + } + } + } + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147752_2_, p_147752_3_, p_147752_4_)) { + this.renderSnow(p_147752_2_, p_147752_3_, p_147752_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + if (Config.isShaders()) { + Shaders.popEntity(); + } + + return true; + } + + /** + * Renders anvil + */ + public boolean renderBlockAnvil(BlockAnvil p_147725_1_, int p_147725_2_, int p_147725_3_, int p_147725_4_) { + return this.renderBlockAnvilMetadata(p_147725_1_, p_147725_2_, p_147725_3_, p_147725_4_, this.blockAccess.getBlockMetadata(p_147725_2_, p_147725_3_, p_147725_4_)); + } + + /** + * Renders anvil block with metadata + */ + public boolean renderBlockAnvilMetadata(BlockAnvil p_147780_1_, int p_147780_2_, int p_147780_3_, int p_147780_4_, int p_147780_5_) { + Tessellator var6 = Tessellator.instance; + var6.setBrightness(p_147780_1_.getBlockBrightness(this.blockAccess, p_147780_2_, p_147780_3_, p_147780_4_)); + int var7 = p_147780_1_.colorMultiplier(this.blockAccess, p_147780_2_, p_147780_3_, p_147780_4_); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var11; + var9 = var12; + var10 = var13; + } + + var6.setColorOpaque_F(var8, var9, var10); + return this.renderBlockAnvilOrient(p_147780_1_, p_147780_2_, p_147780_3_, p_147780_4_, p_147780_5_, false); + } + + /** + * Renders anvil block with orientation + */ + public boolean renderBlockAnvilOrient(BlockAnvil p_147728_1_, int p_147728_2_, int p_147728_3_, int p_147728_4_, int p_147728_5_, boolean p_147728_6_) { + int var7 = p_147728_6_ ? 0 : p_147728_5_ & 3; + boolean var8 = false; + float var9 = 0.0F; + + switch (var7) { + case 0: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + break; + + case 1: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + var8 = true; + break; + + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + break; + + case 3: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + var8 = true; + } + + var9 = this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 0, var9, 0.75F, 0.25F, 0.75F, var8, p_147728_6_, p_147728_5_); + var9 = this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 1, var9, 0.5F, 0.0625F, 0.625F, var8, p_147728_6_, p_147728_5_); + var9 = this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 2, var9, 0.25F, 0.3125F, 0.5F, var8, p_147728_6_, p_147728_5_); + this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 3, var9, 0.625F, 0.375F, 1.0F, var8, p_147728_6_, p_147728_5_); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + return true; + } + + /** + * Renders anvil block with rotation + */ + public float renderBlockAnvilRotate(BlockAnvil p_147737_1_, int p_147737_2_, int p_147737_3_, int p_147737_4_, int p_147737_5_, float p_147737_6_, float p_147737_7_, float p_147737_8_, float p_147737_9_, boolean p_147737_10_, boolean p_147737_11_, int p_147737_12_) { + if (p_147737_10_) { + float var14 = p_147737_7_; + p_147737_7_ = p_147737_9_; + p_147737_9_ = var14; + } + + p_147737_7_ /= 2.0F; + p_147737_9_ /= 2.0F; + p_147737_1_.field_149833_b = p_147737_5_; + this.setRenderBounds((double)(0.5F - p_147737_7_), (double)p_147737_6_, (double)(0.5F - p_147737_9_), (double)(0.5F + p_147737_7_), (double)(p_147737_6_ + p_147737_8_), (double)(0.5F + p_147737_9_)); + + if (p_147737_11_) { + Tessellator var141 = Tessellator.instance; + var141.startDrawingQuads(); + var141.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 0, p_147737_12_)); + var141.draw(); + var141.startDrawingQuads(); + var141.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 1, p_147737_12_)); + var141.draw(); + var141.startDrawingQuads(); + var141.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 2, p_147737_12_)); + var141.draw(); + var141.startDrawingQuads(); + var141.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 3, p_147737_12_)); + var141.draw(); + var141.startDrawingQuads(); + var141.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 4, p_147737_12_)); + var141.draw(); + var141.startDrawingQuads(); + var141.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 5, p_147737_12_)); + var141.draw(); + } else { + this.renderStandardBlock(p_147737_1_, p_147737_2_, p_147737_3_, p_147737_4_); + } + + return p_147737_6_ + p_147737_8_; + } + + /** + * Renders a torch block at the given coordinates + */ + public boolean renderBlockTorch(Block p_147791_1_, int p_147791_2_, int p_147791_3_, int p_147791_4_) { + int var5 = this.blockAccess.getBlockMetadata(p_147791_2_, p_147791_3_, p_147791_4_); + Tessellator var6 = Tessellator.instance; + var6.setBrightness(p_147791_1_.getBlockBrightness(this.blockAccess, p_147791_2_, p_147791_3_, p_147791_4_)); + var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double var7 = 0.4000000059604645D; + double var9 = 0.5D - var7; + double var11 = 0.20000000298023224D; + + if (var5 == 1) { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_ - var9, (double)p_147791_3_ + var11, (double)p_147791_4_, -var7, 0.0D, 0); + } else if (var5 == 2) { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_ + var9, (double)p_147791_3_ + var11, (double)p_147791_4_, var7, 0.0D, 0); + } else if (var5 == 3) { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_ + var11, (double)p_147791_4_ - var9, 0.0D, -var7, 0); + } else if (var5 == 4) { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_ + var11, (double)p_147791_4_ + var9, 0.0D, var7, 0); + } else { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_, (double)p_147791_4_, 0.0D, 0.0D, 0); + + if (p_147791_1_ != Blocks.torch && Config.isBetterSnow() && this.hasSnowNeighbours(p_147791_2_, p_147791_3_, p_147791_4_)) { + this.renderSnow(p_147791_2_, p_147791_3_, p_147791_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + } + + return true; + } + + /** + * render a redstone repeater at the given coordinates + */ + public boolean renderBlockRepeater(BlockRedstoneRepeater p_147759_1_, int p_147759_2_, int p_147759_3_, int p_147759_4_) { + int var5 = this.blockAccess.getBlockMetadata(p_147759_2_, p_147759_3_, p_147759_4_); + int var6 = var5 & 3; + int var7 = (var5 & 12) >> 2; + Tessellator var8 = Tessellator.instance; + var8.setBrightness(p_147759_1_.getBlockBrightness(this.blockAccess, p_147759_2_, p_147759_3_, p_147759_4_)); + var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double var9 = -0.1875D; + boolean var11 = p_147759_1_.func_149910_g(this.blockAccess, p_147759_2_, p_147759_3_, p_147759_4_, var5); + double var12 = 0.0D; + double var14 = 0.0D; + double var16 = 0.0D; + double var18 = 0.0D; + + switch (var6) { + case 0: + var18 = -0.3125D; + var14 = BlockRedstoneRepeater.field_149973_b[var7]; + break; + + case 1: + var16 = 0.3125D; + var12 = -BlockRedstoneRepeater.field_149973_b[var7]; + break; + + case 2: + var18 = 0.3125D; + var14 = -BlockRedstoneRepeater.field_149973_b[var7]; + break; + + case 3: + var16 = -0.3125D; + var12 = BlockRedstoneRepeater.field_149973_b[var7]; + } + + if (!var11) { + this.renderTorchAtAngle(p_147759_1_, (double)p_147759_2_ + var12, (double)p_147759_3_ + var9, (double)p_147759_4_ + var14, 0.0D, 0.0D, 0); + } else { + IIcon var20 = this.getBlockIcon(Blocks.bedrock); + this.setOverrideBlockTexture(var20); + float var21 = 2.0F; + float var22 = 14.0F; + float var23 = 7.0F; + float var24 = 9.0F; + + switch (var6) { + case 1: + case 3: + var21 = 7.0F; + var22 = 9.0F; + var23 = 2.0F; + var24 = 14.0F; + + case 0: + case 2: + default: + this.setRenderBounds((double)(var21 / 16.0F + (float)var12), 0.125D, (double)(var23 / 16.0F + (float)var14), (double)(var22 / 16.0F + (float)var12), 0.25D, (double)(var24 / 16.0F + (float)var14)); + double var25 = (double)var20.getInterpolatedU((double)var21); + double var27 = (double)var20.getInterpolatedV((double)var23); + double var29 = (double)var20.getInterpolatedU((double)var22); + double var31 = (double)var20.getInterpolatedV((double)var24); + var8.addVertexWithUV((double)((float)p_147759_2_ + var21 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var23 / 16.0F) + var14, var25, var27); + var8.addVertexWithUV((double)((float)p_147759_2_ + var21 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var24 / 16.0F) + var14, var25, var31); + var8.addVertexWithUV((double)((float)p_147759_2_ + var22 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var24 / 16.0F) + var14, var29, var31); + var8.addVertexWithUV((double)((float)p_147759_2_ + var22 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var23 / 16.0F) + var14, var29, var27); + this.renderStandardBlock(p_147759_1_, p_147759_2_, p_147759_3_, p_147759_4_); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); + this.clearOverrideBlockTexture(); + } + } + + var8.setBrightness(p_147759_1_.getBlockBrightness(this.blockAccess, p_147759_2_, p_147759_3_, p_147759_4_)); + var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); + this.renderTorchAtAngle(p_147759_1_, (double)p_147759_2_ + var16, (double)p_147759_3_ + var9, (double)p_147759_4_ + var18, 0.0D, 0.0D, 0); + this.renderBlockRedstoneDiode(p_147759_1_, p_147759_2_, p_147759_3_, p_147759_4_); + return true; + } + + public boolean renderBlockRedstoneComparator(BlockRedstoneComparator p_147781_1_, int p_147781_2_, int p_147781_3_, int p_147781_4_) { + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147781_1_.getBlockBrightness(this.blockAccess, p_147781_2_, p_147781_3_, p_147781_4_)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + int var6 = this.blockAccess.getBlockMetadata(p_147781_2_, p_147781_3_, p_147781_4_); + int var7 = var6 & 3; + double var8 = 0.0D; + double var10 = -0.1875D; + double var12 = 0.0D; + double var14 = 0.0D; + double var16 = 0.0D; + IIcon var18; + + if (p_147781_1_.func_149969_d(var6)) { + var18 = Blocks.redstone_torch.getBlockTextureFromSide(0); + } else { + var10 -= 0.1875D; + var18 = Blocks.unlit_redstone_torch.getBlockTextureFromSide(0); + } + + switch (var7) { + case 0: + var12 = -0.3125D; + var16 = 1.0D; + break; + + case 1: + var8 = 0.3125D; + var14 = -1.0D; + break; + + case 2: + var12 = 0.3125D; + var16 = -1.0D; + break; + + case 3: + var8 = -0.3125D; + var14 = 1.0D; + } + + this.renderTorchAtAngle(p_147781_1_, (double)p_147781_2_ + 0.25D * var14 + 0.1875D * var16, (double)((float)p_147781_3_ - 0.1875F), (double)p_147781_4_ + 0.25D * var16 + 0.1875D * var14, 0.0D, 0.0D, var6); + this.renderTorchAtAngle(p_147781_1_, (double)p_147781_2_ + 0.25D * var14 + -0.1875D * var16, (double)((float)p_147781_3_ - 0.1875F), (double)p_147781_4_ + 0.25D * var16 + -0.1875D * var14, 0.0D, 0.0D, var6); + this.setOverrideBlockTexture(var18); + this.renderTorchAtAngle(p_147781_1_, (double)p_147781_2_ + var8, (double)p_147781_3_ + var10, (double)p_147781_4_ + var12, 0.0D, 0.0D, var6); + this.clearOverrideBlockTexture(); + this.renderBlockRedstoneDiodeMetadata(p_147781_1_, p_147781_2_, p_147781_3_, p_147781_4_, var7); + return true; + } + + public boolean renderBlockRedstoneDiode(BlockRedstoneDiode p_147748_1_, int p_147748_2_, int p_147748_3_, int p_147748_4_) { + Tessellator var5 = Tessellator.instance; + this.renderBlockRedstoneDiodeMetadata(p_147748_1_, p_147748_2_, p_147748_3_, p_147748_4_, this.blockAccess.getBlockMetadata(p_147748_2_, p_147748_3_, p_147748_4_) & 3); + return true; + } + + public void renderBlockRedstoneDiodeMetadata(BlockRedstoneDiode p_147732_1_, int p_147732_2_, int p_147732_3_, int p_147732_4_, int p_147732_5_) { + this.renderStandardBlock(p_147732_1_, p_147732_2_, p_147732_3_, p_147732_4_); + Tessellator var6 = Tessellator.instance; + var6.setBrightness(p_147732_1_.getBlockBrightness(this.blockAccess, p_147732_2_, p_147732_3_, p_147732_4_)); + var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); + int var7 = this.blockAccess.getBlockMetadata(p_147732_2_, p_147732_3_, p_147732_4_); + IIcon var8 = this.getBlockIconFromSideAndMetadata(p_147732_1_, 1, var7); + double var9 = (double)var8.getMinU(); + double var11 = (double)var8.getMaxU(); + double var13 = (double)var8.getMinV(); + double var15 = (double)var8.getMaxV(); + double var17 = 0.125D; + double var19 = (double)(p_147732_2_ + 1); + double var21 = (double)(p_147732_2_ + 1); + double var23 = (double)(p_147732_2_ + 0); + double var25 = (double)(p_147732_2_ + 0); + double var27 = (double)(p_147732_4_ + 0); + double var29 = (double)(p_147732_4_ + 1); + double var31 = (double)(p_147732_4_ + 1); + double var33 = (double)(p_147732_4_ + 0); + double var35 = (double)p_147732_3_ + var17; + + if (p_147732_5_ == 2) { + var19 = var21 = (double)(p_147732_2_ + 0); + var23 = var25 = (double)(p_147732_2_ + 1); + var27 = var33 = (double)(p_147732_4_ + 1); + var29 = var31 = (double)(p_147732_4_ + 0); + } else if (p_147732_5_ == 3) { + var19 = var25 = (double)(p_147732_2_ + 0); + var21 = var23 = (double)(p_147732_2_ + 1); + var27 = var29 = (double)(p_147732_4_ + 0); + var31 = var33 = (double)(p_147732_4_ + 1); + } else if (p_147732_5_ == 1) { + var19 = var25 = (double)(p_147732_2_ + 1); + var21 = var23 = (double)(p_147732_2_ + 0); + var27 = var29 = (double)(p_147732_4_ + 1); + var31 = var33 = (double)(p_147732_4_ + 0); + } + + var6.addVertexWithUV(var25, var35, var33, var9, var13); + var6.addVertexWithUV(var23, var35, var31, var9, var15); + var6.addVertexWithUV(var21, var35, var29, var11, var15); + var6.addVertexWithUV(var19, var35, var27, var11, var13); + } + + public void renderPistonBaseAllFaces(Block p_147804_1_, int p_147804_2_, int p_147804_3_, int p_147804_4_) { + this.renderAllFaces = true; + this.renderPistonBase(p_147804_1_, p_147804_2_, p_147804_3_, p_147804_4_, true); + this.renderAllFaces = false; + } + + public boolean renderPistonBase(Block p_147731_1_, int p_147731_2_, int p_147731_3_, int p_147731_4_, boolean p_147731_5_) { + int var6 = this.blockAccess.getBlockMetadata(p_147731_2_, p_147731_3_, p_147731_4_); + boolean var7 = p_147731_5_ || (var6 & 8) != 0; + int var8 = BlockPistonBase.func_150076_b(var6); + float var9 = 0.25F; + + if (var7) { + switch (var8) { + case 0: + this.uvRotateEast = 3; + this.uvRotateWest = 3; + this.uvRotateSouth = 3; + this.uvRotateNorth = 3; + this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); + break; + + case 1: + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); + break; + + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + this.setRenderBounds(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); + break; + + case 3: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); + break; + + case 4: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + this.setRenderBounds(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + break; + + case 5: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); + } + + ((BlockPistonBase)p_147731_1_).func_150070_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); + this.renderStandardBlock(p_147731_1_, p_147731_2_, p_147731_3_, p_147731_4_); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + ((BlockPistonBase)p_147731_1_).func_150070_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); + } else { + switch (var8) { + case 0: + this.uvRotateEast = 3; + this.uvRotateWest = 3; + this.uvRotateSouth = 3; + this.uvRotateNorth = 3; + + case 1: + default: + break; + + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + break; + + case 3: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + break; + + case 4: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + break; + + case 5: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + } + + this.renderStandardBlock(p_147731_1_, p_147731_2_, p_147731_3_, p_147731_4_); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + } + + return true; + } + + public void renderPistonRodUD(double p_147763_1_, double p_147763_3_, double p_147763_5_, double p_147763_7_, double p_147763_9_, double p_147763_11_, float p_147763_13_, double p_147763_14_) { + IIcon var16 = BlockPistonBase.func_150074_e("piston_side"); + + if (this.hasOverrideBlockTexture()) { + var16 = this.overrideBlockTexture; + } + + Tessellator var17 = Tessellator.instance; + double var18 = (double)var16.getMinU(); + double var20 = (double)var16.getMinV(); + double var22 = (double)var16.getInterpolatedU(p_147763_14_); + double var24 = (double)var16.getInterpolatedV(4.0D); + var17.setColorOpaque_F(p_147763_13_, p_147763_13_, p_147763_13_); + var17.addVertexWithUV(p_147763_1_, p_147763_7_, p_147763_9_, var22, var20); + var17.addVertexWithUV(p_147763_1_, p_147763_5_, p_147763_9_, var18, var20); + var17.addVertexWithUV(p_147763_3_, p_147763_5_, p_147763_11_, var18, var24); + var17.addVertexWithUV(p_147763_3_, p_147763_7_, p_147763_11_, var22, var24); + } + + public void renderPistonRodSN(double p_147789_1_, double p_147789_3_, double p_147789_5_, double p_147789_7_, double p_147789_9_, double p_147789_11_, float p_147789_13_, double p_147789_14_) { + IIcon var16 = BlockPistonBase.func_150074_e("piston_side"); + + if (this.hasOverrideBlockTexture()) { + var16 = this.overrideBlockTexture; + } + + Tessellator var17 = Tessellator.instance; + double var18 = (double)var16.getMinU(); + double var20 = (double)var16.getMinV(); + double var22 = (double)var16.getInterpolatedU(p_147789_14_); + double var24 = (double)var16.getInterpolatedV(4.0D); + var17.setColorOpaque_F(p_147789_13_, p_147789_13_, p_147789_13_); + var17.addVertexWithUV(p_147789_1_, p_147789_5_, p_147789_11_, var22, var20); + var17.addVertexWithUV(p_147789_1_, p_147789_5_, p_147789_9_, var18, var20); + var17.addVertexWithUV(p_147789_3_, p_147789_7_, p_147789_9_, var18, var24); + var17.addVertexWithUV(p_147789_3_, p_147789_7_, p_147789_11_, var22, var24); + } + + public void renderPistonRodEW(double p_147738_1_, double p_147738_3_, double p_147738_5_, double p_147738_7_, double p_147738_9_, double p_147738_11_, float p_147738_13_, double p_147738_14_) { + IIcon var16 = BlockPistonBase.func_150074_e("piston_side"); + + if (this.hasOverrideBlockTexture()) { + var16 = this.overrideBlockTexture; + } + + Tessellator var17 = Tessellator.instance; + double var18 = (double)var16.getMinU(); + double var20 = (double)var16.getMinV(); + double var22 = (double)var16.getInterpolatedU(p_147738_14_); + double var24 = (double)var16.getInterpolatedV(4.0D); + var17.setColorOpaque_F(p_147738_13_, p_147738_13_, p_147738_13_); + var17.addVertexWithUV(p_147738_3_, p_147738_5_, p_147738_9_, var22, var20); + var17.addVertexWithUV(p_147738_1_, p_147738_5_, p_147738_9_, var18, var20); + var17.addVertexWithUV(p_147738_1_, p_147738_7_, p_147738_11_, var18, var24); + var17.addVertexWithUV(p_147738_3_, p_147738_7_, p_147738_11_, var22, var24); + } + + public void renderPistonExtensionAllFaces(Block p_147750_1_, int p_147750_2_, int p_147750_3_, int p_147750_4_, boolean p_147750_5_) { + this.renderAllFaces = true; + this.renderPistonExtension(p_147750_1_, p_147750_2_, p_147750_3_, p_147750_4_, p_147750_5_); + this.renderAllFaces = false; + } + + public boolean renderPistonExtension(Block p_147809_1_, int p_147809_2_, int p_147809_3_, int p_147809_4_, boolean p_147809_5_) { + int var6 = this.blockAccess.getBlockMetadata(p_147809_2_, p_147809_3_, p_147809_4_); + int var7 = BlockPistonExtension.func_150085_b(var6); + float var8 = 0.25F; + float var9 = 0.375F; + float var10 = 0.625F; + float var11 = p_147809_5_ ? 1.0F : 0.5F; + double var12 = p_147809_5_ ? 16.0D : 8.0D; + + switch (var7) { + case 0: + this.uvRotateEast = 3; + this.uvRotateWest = 3; + this.uvRotateSouth = 3; + this.uvRotateNorth = 3; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), this.lightLevel08, var12); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel08, var12); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), this.lightLevel06, var12); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel06, var12); + break; + + case 1: + this.setRenderBounds(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), this.lightLevel08, var12); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel08, var12); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), this.lightLevel06, var12); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel06, var12); + break; + + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), this.lightLevel06, var12); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), this.lightLevel06, var12); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), this.lightLevel05, var12); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), 1.0F, var12); + break; + + case 3: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + this.setRenderBounds(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), this.lightLevel06, var12); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), this.lightLevel06, var12); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), this.lightLevel05, var12); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), 1.0F, var12); + break; + + case 4: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel05, var12); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 1.0F, var12); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel06, var12); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), this.lightLevel06, var12); + break; + + case 5: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + this.setRenderBounds(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel05, var12); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 1.0F, var12); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), this.lightLevel06, var12); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), this.lightLevel06, var12); + } + + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return true; + } + + public boolean renderBlockLever(Block p_147790_1_, int p_147790_2_, int p_147790_3_, int p_147790_4_) { + int var5 = this.blockAccess.getBlockMetadata(p_147790_2_, p_147790_3_, p_147790_4_); + int var6 = var5 & 7; + boolean var7 = (var5 & 8) > 0; + Tessellator var8 = Tessellator.instance; + boolean var9 = this.hasOverrideBlockTexture(); + + if (!var9) { + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.cobblestone)); + } + + float var10 = 0.25F; + float var11 = 0.1875F; + float var12 = 0.1875F; + + if (var6 == 5) { + this.setRenderBounds((double)(0.5F - var11), 0.0D, (double)(0.5F - var10), (double)(0.5F + var11), (double)var12, (double)(0.5F + var10)); + } else if (var6 == 6) { + this.setRenderBounds((double)(0.5F - var10), 0.0D, (double)(0.5F - var11), (double)(0.5F + var10), (double)var12, (double)(0.5F + var11)); + } else if (var6 == 4) { + this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F + var11), (double)(0.5F + var10), 1.0D); + } else if (var6 == 3) { + this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), 0.0D, (double)(0.5F + var11), (double)(0.5F + var10), (double)var12); + } else if (var6 == 2) { + this.setRenderBounds((double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F - var11), 1.0D, (double)(0.5F + var10), (double)(0.5F + var11)); + } else if (var6 == 1) { + this.setRenderBounds(0.0D, (double)(0.5F - var10), (double)(0.5F - var11), (double)var12, (double)(0.5F + var10), (double)(0.5F + var11)); + } else if (var6 == 0) { + this.setRenderBounds((double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F - var11), (double)(0.5F + var10), 1.0D, (double)(0.5F + var11)); + } else if (var6 == 7) { + this.setRenderBounds((double)(0.5F - var11), (double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F + var11), 1.0D, (double)(0.5F + var10)); + } + + this.renderStandardBlock(p_147790_1_, p_147790_2_, p_147790_3_, p_147790_4_); + + if (!var9) { + this.clearOverrideBlockTexture(); + } + + var8.setBrightness(p_147790_1_.getBlockBrightness(this.blockAccess, p_147790_2_, p_147790_3_, p_147790_4_)); + var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); + IIcon var13 = this.getBlockIconFromSide(p_147790_1_, 0); + + if (this.hasOverrideBlockTexture()) { + var13 = this.overrideBlockTexture; + } + + double var14 = (double)var13.getMinU(); + double var16 = (double)var13.getMinV(); + double var18 = (double)var13.getMaxU(); + double var20 = (double)var13.getMaxV(); + Vec3[] var22 = new Vec3[8]; + float var23 = 0.0625F; + float var24 = 0.0625F; + float var25 = 0.625F; + var22[0] = Vec3.createVectorHelper((double)(-var23), 0.0D, (double)(-var24)); + var22[1] = Vec3.createVectorHelper((double)var23, 0.0D, (double)(-var24)); + var22[2] = Vec3.createVectorHelper((double)var23, 0.0D, (double)var24); + var22[3] = Vec3.createVectorHelper((double)(-var23), 0.0D, (double)var24); + var22[4] = Vec3.createVectorHelper((double)(-var23), (double)var25, (double)(-var24)); + var22[5] = Vec3.createVectorHelper((double)var23, (double)var25, (double)(-var24)); + var22[6] = Vec3.createVectorHelper((double)var23, (double)var25, (double)var24); + var22[7] = Vec3.createVectorHelper((double)(-var23), (double)var25, (double)var24); + + for (int var31 = 0; var31 < 8; ++var31) { + if (var7) { + var22[var31].zCoord -= 0.0625D; + var22[var31].rotateAroundX(((float)Math.PI * 2F / 9F)); + } else { + var22[var31].zCoord += 0.0625D; + var22[var31].rotateAroundX(-((float)Math.PI * 2F / 9F)); + } + + if (var6 == 0 || var6 == 7) { + var22[var31].rotateAroundZ((float)Math.PI); + } + + if (var6 == 6 || var6 == 0) { + var22[var31].rotateAroundY(((float)Math.PI / 2F)); + } + + if (var6 > 0 && var6 < 5) { + var22[var31].yCoord -= 0.375D; + var22[var31].rotateAroundX(((float)Math.PI / 2F)); + + if (var6 == 4) { + var22[var31].rotateAroundY(0.0F); + } + + if (var6 == 3) { + var22[var31].rotateAroundY((float)Math.PI); + } + + if (var6 == 2) { + var22[var31].rotateAroundY(((float)Math.PI / 2F)); + } + + if (var6 == 1) { + var22[var31].rotateAroundY(-((float)Math.PI / 2F)); + } + + var22[var31].xCoord += (double)p_147790_2_ + 0.5D; + var22[var31].yCoord += (double)((float)p_147790_3_ + 0.5F); + var22[var31].zCoord += (double)p_147790_4_ + 0.5D; + } else if (var6 != 0 && var6 != 7) { + var22[var31].xCoord += (double)p_147790_2_ + 0.5D; + var22[var31].yCoord += (double)((float)p_147790_3_ + 0.125F); + var22[var31].zCoord += (double)p_147790_4_ + 0.5D; + } else { + var22[var31].xCoord += (double)p_147790_2_ + 0.5D; + var22[var31].yCoord += (double)((float)p_147790_3_ + 0.875F); + var22[var31].zCoord += (double)p_147790_4_ + 0.5D; + } + } + + Vec3 var311 = null; + Vec3 var27 = null; + Vec3 var28 = null; + Vec3 var29 = null; + + for (int var30 = 0; var30 < 6; ++var30) { + if (var30 == 0) { + var14 = (double)var13.getInterpolatedU(7.0D); + var16 = (double)var13.getInterpolatedV(6.0D); + var18 = (double)var13.getInterpolatedU(9.0D); + var20 = (double)var13.getInterpolatedV(8.0D); + } else if (var30 == 2) { + var14 = (double)var13.getInterpolatedU(7.0D); + var16 = (double)var13.getInterpolatedV(6.0D); + var18 = (double)var13.getInterpolatedU(9.0D); + var20 = (double)var13.getMaxV(); + } + + if (var30 == 0) { + var311 = var22[0]; + var27 = var22[1]; + var28 = var22[2]; + var29 = var22[3]; + } else if (var30 == 1) { + var311 = var22[7]; + var27 = var22[6]; + var28 = var22[5]; + var29 = var22[4]; + } else if (var30 == 2) { + var311 = var22[1]; + var27 = var22[0]; + var28 = var22[4]; + var29 = var22[5]; + } else if (var30 == 3) { + var311 = var22[2]; + var27 = var22[1]; + var28 = var22[5]; + var29 = var22[6]; + } else if (var30 == 4) { + var311 = var22[3]; + var27 = var22[2]; + var28 = var22[6]; + var29 = var22[7]; + } else if (var30 == 5) { + var311 = var22[0]; + var27 = var22[3]; + var28 = var22[7]; + var29 = var22[4]; + } + + var8.addVertexWithUV(var311.xCoord, var311.yCoord, var311.zCoord, var14, var20); + var8.addVertexWithUV(var27.xCoord, var27.yCoord, var27.zCoord, var18, var20); + var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, var18, var16); + var8.addVertexWithUV(var29.xCoord, var29.yCoord, var29.zCoord, var14, var16); + } + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147790_2_, p_147790_3_, p_147790_4_)) { + this.renderSnow(p_147790_2_, p_147790_3_, p_147790_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + return true; + } + + public boolean renderBlockTripWireSource(Block p_147723_1_, int p_147723_2_, int p_147723_3_, int p_147723_4_) { + Tessellator var5 = Tessellator.instance; + int var6 = this.blockAccess.getBlockMetadata(p_147723_2_, p_147723_3_, p_147723_4_); + int var7 = var6 & 3; + boolean var8 = (var6 & 4) == 4; + boolean var9 = (var6 & 8) == 8; + boolean var10 = !World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147723_2_, p_147723_3_ - 1, p_147723_4_); + boolean var11 = this.hasOverrideBlockTexture(); + + if (!var11) { + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.planks)); + } + + float var12 = 0.25F; + float var13 = 0.125F; + float var14 = 0.125F; + float var15 = 0.3F - var12; + float var16 = 0.3F + var12; + + if (var7 == 2) { + this.setRenderBounds((double)(0.5F - var13), (double)var15, (double)(1.0F - var14), (double)(0.5F + var13), (double)var16, 1.0D); + } else if (var7 == 0) { + this.setRenderBounds((double)(0.5F - var13), (double)var15, 0.0D, (double)(0.5F + var13), (double)var16, (double)var14); + } else if (var7 == 1) { + this.setRenderBounds((double)(1.0F - var14), (double)var15, (double)(0.5F - var13), 1.0D, (double)var16, (double)(0.5F + var13)); + } else if (var7 == 3) { + this.setRenderBounds(0.0D, (double)var15, (double)(0.5F - var13), (double)var14, (double)var16, (double)(0.5F + var13)); + } + + this.renderStandardBlock(p_147723_1_, p_147723_2_, p_147723_3_, p_147723_4_); + + if (!var11) { + this.clearOverrideBlockTexture(); + } + + var5.setBrightness(p_147723_1_.getBlockBrightness(this.blockAccess, p_147723_2_, p_147723_3_, p_147723_4_)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + IIcon var17 = this.getBlockIconFromSide(p_147723_1_, 0); + + if (this.hasOverrideBlockTexture()) { + var17 = this.overrideBlockTexture; + } + + double var18 = (double)var17.getMinU(); + double var20 = (double)var17.getMinV(); + double var22 = (double)var17.getMaxU(); + double var24 = (double)var17.getMaxV(); + Vec3[] var26 = new Vec3[8]; + float var27 = 0.046875F; + float var28 = 0.046875F; + float var29 = 0.3125F; + var26[0] = Vec3.createVectorHelper((double)(-var27), 0.0D, (double)(-var28)); + var26[1] = Vec3.createVectorHelper((double)var27, 0.0D, (double)(-var28)); + var26[2] = Vec3.createVectorHelper((double)var27, 0.0D, (double)var28); + var26[3] = Vec3.createVectorHelper((double)(-var27), 0.0D, (double)var28); + var26[4] = Vec3.createVectorHelper((double)(-var27), (double)var29, (double)(-var28)); + var26[5] = Vec3.createVectorHelper((double)var27, (double)var29, (double)(-var28)); + var26[6] = Vec3.createVectorHelper((double)var27, (double)var29, (double)var28); + var26[7] = Vec3.createVectorHelper((double)(-var27), (double)var29, (double)var28); + + for (int var60 = 0; var60 < 8; ++var60) { + var26[var60].zCoord += 0.0625D; + + if (var9) { + var26[var60].rotateAroundX(0.5235988F); + var26[var60].yCoord -= 0.4375D; + } else if (var8) { + var26[var60].rotateAroundX(0.08726647F); + var26[var60].yCoord -= 0.4375D; + } else { + var26[var60].rotateAroundX(-((float)Math.PI * 2F / 9F)); + var26[var60].yCoord -= 0.375D; + } + + var26[var60].rotateAroundX(((float)Math.PI / 2F)); + + if (var7 == 2) { + var26[var60].rotateAroundY(0.0F); + } + + if (var7 == 0) { + var26[var60].rotateAroundY((float)Math.PI); + } + + if (var7 == 1) { + var26[var60].rotateAroundY(((float)Math.PI / 2F)); + } + + if (var7 == 3) { + var26[var60].rotateAroundY(-((float)Math.PI / 2F)); + } + + var26[var60].xCoord += (double)p_147723_2_ + 0.5D; + var26[var60].yCoord += (double)((float)p_147723_3_ + 0.3125F); + var26[var60].zCoord += (double)p_147723_4_ + 0.5D; + } + + Vec3 var601 = null; + Vec3 var31 = null; + Vec3 var32 = null; + Vec3 var33 = null; + byte var34 = 7; + byte var35 = 9; + byte var36 = 9; + byte var37 = 16; + + for (int var61 = 0; var61 < 6; ++var61) { + if (var61 == 0) { + var601 = var26[0]; + var31 = var26[1]; + var32 = var26[2]; + var33 = var26[3]; + var18 = (double)var17.getInterpolatedU((double)var34); + var20 = (double)var17.getInterpolatedV((double)var36); + var22 = (double)var17.getInterpolatedU((double)var35); + var24 = (double)var17.getInterpolatedV((double)(var36 + 2)); + } else if (var61 == 1) { + var601 = var26[7]; + var31 = var26[6]; + var32 = var26[5]; + var33 = var26[4]; + } else if (var61 == 2) { + var601 = var26[1]; + var31 = var26[0]; + var32 = var26[4]; + var33 = var26[5]; + var18 = (double)var17.getInterpolatedU((double)var34); + var20 = (double)var17.getInterpolatedV((double)var36); + var22 = (double)var17.getInterpolatedU((double)var35); + var24 = (double)var17.getInterpolatedV((double)var37); + } else if (var61 == 3) { + var601 = var26[2]; + var31 = var26[1]; + var32 = var26[5]; + var33 = var26[6]; + } else if (var61 == 4) { + var601 = var26[3]; + var31 = var26[2]; + var32 = var26[6]; + var33 = var26[7]; + } else if (var61 == 5) { + var601 = var26[0]; + var31 = var26[3]; + var32 = var26[7]; + var33 = var26[4]; + } + + var5.addVertexWithUV(var601.xCoord, var601.yCoord, var601.zCoord, var18, var24); + var5.addVertexWithUV(var31.xCoord, var31.yCoord, var31.zCoord, var22, var24); + var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var22, var20); + var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var18, var20); + } + + float var611 = 0.09375F; + float var39 = 0.09375F; + float var40 = 0.03125F; + var26[0] = Vec3.createVectorHelper((double)(-var611), 0.0D, (double)(-var39)); + var26[1] = Vec3.createVectorHelper((double)var611, 0.0D, (double)(-var39)); + var26[2] = Vec3.createVectorHelper((double)var611, 0.0D, (double)var39); + var26[3] = Vec3.createVectorHelper((double)(-var611), 0.0D, (double)var39); + var26[4] = Vec3.createVectorHelper((double)(-var611), (double)var40, (double)(-var39)); + var26[5] = Vec3.createVectorHelper((double)var611, (double)var40, (double)(-var39)); + var26[6] = Vec3.createVectorHelper((double)var611, (double)var40, (double)var39); + var26[7] = Vec3.createVectorHelper((double)(-var611), (double)var40, (double)var39); + + for (int var62 = 0; var62 < 8; ++var62) { + var26[var62].zCoord += 0.21875D; + + if (var9) { + var26[var62].yCoord -= 0.09375D; + var26[var62].zCoord -= 0.1625D; + var26[var62].rotateAroundX(0.0F); + } else if (var8) { + var26[var62].yCoord += 0.015625D; + var26[var62].zCoord -= 0.171875D; + var26[var62].rotateAroundX(0.17453294F); + } else { + var26[var62].rotateAroundX(0.87266463F); + } + + if (var7 == 2) { + var26[var62].rotateAroundY(0.0F); + } + + if (var7 == 0) { + var26[var62].rotateAroundY((float)Math.PI); + } + + if (var7 == 1) { + var26[var62].rotateAroundY(((float)Math.PI / 2F)); + } + + if (var7 == 3) { + var26[var62].rotateAroundY(-((float)Math.PI / 2F)); + } + + var26[var62].xCoord += (double)p_147723_2_ + 0.5D; + var26[var62].yCoord += (double)((float)p_147723_3_ + 0.3125F); + var26[var62].zCoord += (double)p_147723_4_ + 0.5D; + } + + byte var621 = 5; + byte var42 = 11; + byte var43 = 3; + byte var44 = 9; + + for (int var63 = 0; var63 < 6; ++var63) { + if (var63 == 0) { + var601 = var26[0]; + var31 = var26[1]; + var32 = var26[2]; + var33 = var26[3]; + var18 = (double)var17.getInterpolatedU((double)var621); + var20 = (double)var17.getInterpolatedV((double)var43); + var22 = (double)var17.getInterpolatedU((double)var42); + var24 = (double)var17.getInterpolatedV((double)var44); + } else if (var63 == 1) { + var601 = var26[7]; + var31 = var26[6]; + var32 = var26[5]; + var33 = var26[4]; + } else if (var63 == 2) { + var601 = var26[1]; + var31 = var26[0]; + var32 = var26[4]; + var33 = var26[5]; + var18 = (double)var17.getInterpolatedU((double)var621); + var20 = (double)var17.getInterpolatedV((double)var43); + var22 = (double)var17.getInterpolatedU((double)var42); + var24 = (double)var17.getInterpolatedV((double)(var43 + 2)); + } else if (var63 == 3) { + var601 = var26[2]; + var31 = var26[1]; + var32 = var26[5]; + var33 = var26[6]; + } else if (var63 == 4) { + var601 = var26[3]; + var31 = var26[2]; + var32 = var26[6]; + var33 = var26[7]; + } else if (var63 == 5) { + var601 = var26[0]; + var31 = var26[3]; + var32 = var26[7]; + var33 = var26[4]; + } + + var5.addVertexWithUV(var601.xCoord, var601.yCoord, var601.zCoord, var18, var24); + var5.addVertexWithUV(var31.xCoord, var31.yCoord, var31.zCoord, var22, var24); + var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var22, var20); + var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var18, var20); + } + + if (var8) { + double var631 = var26[0].yCoord; + float var47 = 0.03125F; + float var48 = 0.5F - var47 / 2.0F; + float var49 = var48 + var47; + double var50 = (double)var17.getMinU(); + double var52 = (double)var17.getInterpolatedV(var8 ? 2.0D : 0.0D); + double var54 = (double)var17.getMaxU(); + double var56 = (double)var17.getInterpolatedV(var8 ? 4.0D : 2.0D); + double var58 = (double)(var10 ? 3.5F : 1.5F) / 16.0D; + var5.setColorOpaque_F(0.75F, 0.75F, 0.75F); + + if (var7 == 2) { + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var50, var52); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var50, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_, var54, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_, var54, var52); + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), var631, (double)p_147723_4_ + 0.5D, var50, var52); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), var631, (double)p_147723_4_ + 0.5D, var50, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var54, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var54, var52); + } else if (var7 == 0) { + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var50, var52); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var50, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), var631, (double)p_147723_4_ + 0.5D, var54, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), var631, (double)p_147723_4_ + 0.5D, var54, var52); + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)(p_147723_4_ + 1), var50, var52); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)(p_147723_4_ + 1), var50, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var54, var56); + var5.addVertexWithUV((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var54, var52); + } else if (var7 == 1) { + var5.addVertexWithUV((double)p_147723_2_, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var50, var56); + var5.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var54, var56); + var5.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var54, var52); + var5.addVertexWithUV((double)p_147723_2_, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var50, var52); + var5.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var50, var56); + var5.addVertexWithUV((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var49), var54, var56); + var5.addVertexWithUV((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var48), var54, var52); + var5.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var50, var52); + } else { + var5.addVertexWithUV((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var49), var50, var56); + var5.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var54, var56); + var5.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var54, var52); + var5.addVertexWithUV((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var48), var50, var52); + var5.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var50, var56); + var5.addVertexWithUV((double)(p_147723_2_ + 1), (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var54, var56); + var5.addVertexWithUV((double)(p_147723_2_ + 1), (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var54, var52); + var5.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var50, var52); + } + } + + return true; + } + + public boolean renderBlockTripWire(Block block, int p_147756_2_, int p_147756_3_, int p_147756_4_) { + Tessellator var5 = Tessellator.instance; + IIcon var6 = this.getBlockIconFromSide(block, 0); + int var7 = this.blockAccess.getBlockMetadata(p_147756_2_, p_147756_3_, p_147756_4_); + boolean var8 = (var7 & 4) == 4; + boolean var9 = (var7 & 2) == 2; + + if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + if ((Boolean) pt.coloredString.getValue() && pt.isEnabled()) { + var6 = Block.renderBlockIcon; + float alpha = (pt.coloredStringColor.getColorValue() >> 24 & 255) / 255.0F; + float red = (pt.coloredStringColor.getColorValue() >> 16 & 255) / 255.0F; + float green = (pt.coloredStringColor.getColorValue() >> 8 & 255) / 255.0F; + float blue = (pt.coloredStringColor.getColorValue() & 255) / 255.0F; + var5.setColorRGBA_F(red, green, blue, alpha); + } else { + var5.setBrightness(block.getBlockBrightness(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_)); + var5.setColorOpaque_F(1.0f, 1.0f, 1.0f); + } + double var10 = (double)var6.getMinU(); + double var12 = (double)var6.getInterpolatedV(var8 ? 2.0D : 0.0D); + double var14 = (double)var6.getMaxU(); + double var16 = (double)var6.getInterpolatedV(var8 ? 4.0D : 2.0D); + double var18 = (double)(var9 ? 3.5F : 1.5F) / 16.0D; + boolean var20 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, var7, 1); + boolean var21 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, var7, 3); + boolean var22 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, var7, 2); + boolean var23 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, var7, 0); + float var24 = 0.03125F; + float var25 = 0.5F - var24 / 2.0F; + float var26 = var25 + var24; + + if (!var22 && !var21 && !var23 && !var20) { + var22 = true; + var23 = true; + } + + if (var22) { + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var12); + } + + if (var22 || var23 && !var21 && !var20) { + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var12); + } + + if (var23 || var22 && !var21 && !var20) { + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var12); + } + + if (var23) { + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var12); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var16); + var5.addVertexWithUV((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var12); + } + + if (var20) { + var5.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + if (var20 || var21 && !var22 && !var23) { + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + if (var21 || var20 && !var22 && !var23) { + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + if (var21) { + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + return true; + } + + public boolean renderBlockFire(BlockFire p_147801_1_, int p_147801_2_, int p_147801_3_, int p_147801_4_) { + Tessellator var5 = Tessellator.instance; + IIcon var6 = p_147801_1_.func_149840_c(0); + IIcon var7 = p_147801_1_.func_149840_c(1); + IIcon var8 = var6; + + if (this.hasOverrideBlockTexture()) { + var8 = this.overrideBlockTexture; + } + + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.setBrightness(p_147801_1_.getBlockBrightness(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_)); + double var9 = (double)var8.getMinU(); + double var11 = (double)var8.getMinV(); + double var13 = (double)var8.getMaxU(); + double var15 = (double)var8.getMaxV(); + float var17 = 1.4F; + double var20; + double var22; + double var24; + double var26; + double var28; + double var30; + double var32; + + if (!World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.func_149844_e(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_)) { + float var36 = 0.2F; + float var19 = 0.0625F; + + if ((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 1) { + var9 = (double)var7.getMinU(); + var11 = (double)var7.getMinV(); + var13 = (double)var7.getMaxU(); + var15 = (double)var7.getMaxV(); + } + + if ((p_147801_2_ / 2 + p_147801_3_ / 2 + p_147801_4_ / 2 & 1) == 1) { + var20 = var13; + var13 = var9; + var9 = var20; + } + + if (Blocks.fire.func_149844_e(this.blockAccess, p_147801_2_ - 1, p_147801_3_, p_147801_4_)) { + var5.addVertexWithUV((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + var5.addVertexWithUV((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.addVertexWithUV((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + } + + if (Blocks.fire.func_149844_e(this.blockAccess, p_147801_2_ + 1, p_147801_3_, p_147801_4_)) { + var5.addVertexWithUV((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.addVertexWithUV((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + var5.addVertexWithUV((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + } + + if (Blocks.fire.func_149844_e(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ - 1)) { + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var13, var11); + } + + if (Blocks.fire.func_149844_e(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ + 1)) { + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var9, var11); + } + + if (Blocks.fire.func_149844_e(this.blockAccess, p_147801_2_, p_147801_3_ + 1, p_147801_4_)) { + var20 = (double)p_147801_2_ + 0.5D + 0.5D; + var22 = (double)p_147801_2_ + 0.5D - 0.5D; + var24 = (double)p_147801_4_ + 0.5D + 0.5D; + var26 = (double)p_147801_4_ + 0.5D - 0.5D; + var28 = (double)p_147801_2_ + 0.5D - 0.5D; + var30 = (double)p_147801_2_ + 0.5D + 0.5D; + var32 = (double)p_147801_4_ + 0.5D - 0.5D; + double var34 = (double)p_147801_4_ + 0.5D + 0.5D; + var9 = (double)var6.getMinU(); + var11 = (double)var6.getMinV(); + var13 = (double)var6.getMaxU(); + var15 = (double)var6.getMaxV(); + ++p_147801_3_; + var17 = -0.2F; + + if ((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 0) { + var5.addVertexWithUV(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var13, var11); + var5.addVertexWithUV(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var13, var15); + var5.addVertexWithUV(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var9, var15); + var5.addVertexWithUV(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var9, var11); + var9 = (double)var7.getMinU(); + var11 = (double)var7.getMinV(); + var13 = (double)var7.getMaxU(); + var15 = (double)var7.getMaxV(); + var5.addVertexWithUV(var30, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var13, var11); + var5.addVertexWithUV(var22, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var13, var15); + var5.addVertexWithUV(var22, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV(var30, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var9, var11); + } else { + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var34, var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var26, var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var26, var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var34, var9, var11); + var9 = (double)var7.getMinU(); + var11 = (double)var7.getMinV(); + var13 = (double)var7.getMaxU(); + var15 = (double)var7.getMaxV(); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var32, var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var24, var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var24, var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var32, var9, var11); + } + } + } else { + double var18 = (double)p_147801_2_ + 0.5D + 0.2D; + var20 = (double)p_147801_2_ + 0.5D - 0.2D; + var22 = (double)p_147801_4_ + 0.5D + 0.2D; + var24 = (double)p_147801_4_ + 0.5D - 0.2D; + var26 = (double)p_147801_2_ + 0.5D - 0.3D; + var28 = (double)p_147801_2_ + 0.5D + 0.3D; + var30 = (double)p_147801_4_ + 0.5D - 0.3D; + var32 = (double)p_147801_4_ + 0.5D + 0.3D; + var5.addVertexWithUV(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var13, var11); + var5.addVertexWithUV(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var13, var15); + var5.addVertexWithUV(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var9, var11); + var5.addVertexWithUV(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var13, var11); + var5.addVertexWithUV(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var13, var15); + var5.addVertexWithUV(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var9, var15); + var5.addVertexWithUV(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var9, var11); + var9 = (double)var7.getMinU(); + var11 = (double)var7.getMinV(); + var13 = (double)var7.getMaxU(); + var15 = (double)var7.getMaxV(); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var32, var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var24, var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var24, var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var32, var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var30, var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var22, var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var22, var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var30, var9, var11); + var18 = (double)p_147801_2_ + 0.5D - 0.5D; + var20 = (double)p_147801_2_ + 0.5D + 0.5D; + var22 = (double)p_147801_4_ + 0.5D - 0.5D; + var24 = (double)p_147801_4_ + 0.5D + 0.5D; + var26 = (double)p_147801_2_ + 0.5D - 0.4D; + var28 = (double)p_147801_2_ + 0.5D + 0.4D; + var30 = (double)p_147801_4_ + 0.5D - 0.4D; + var32 = (double)p_147801_4_ + 0.5D + 0.4D; + var5.addVertexWithUV(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var9, var11); + var5.addVertexWithUV(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var9, var15); + var5.addVertexWithUV(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var13, var15); + var5.addVertexWithUV(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var13, var11); + var5.addVertexWithUV(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var9, var11); + var5.addVertexWithUV(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var9, var15); + var5.addVertexWithUV(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var13, var15); + var5.addVertexWithUV(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var13, var11); + var9 = (double)var6.getMinU(); + var11 = (double)var6.getMinV(); + var13 = (double)var6.getMaxU(); + var15 = (double)var6.getMaxV(); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var32, var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var24, var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var24, var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var32, var13, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var30, var9, var11); + var5.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var22, var9, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var22, var13, var15); + var5.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var30, var13, var11); + } + + return true; + } + + public boolean renderBlockRedstoneWire(Block p_147788_1_, int p_147788_2_, int p_147788_3_, int p_147788_4_) { + Tessellator var5 = Tessellator.instance; + int var6 = this.blockAccess.getBlockMetadata(p_147788_2_, p_147788_3_, p_147788_4_); + IIcon var7 = BlockRedstoneWire.func_150173_e("cross"); + IIcon var8 = BlockRedstoneWire.func_150173_e("line"); + IIcon var9 = BlockRedstoneWire.func_150173_e("cross_overlay"); + IIcon var10 = BlockRedstoneWire.func_150173_e("line_overlay"); + var5.setBrightness(p_147788_1_.getBlockBrightness(this.blockAccess, p_147788_2_, p_147788_3_, p_147788_4_)); + float var11 = (float)var6 / 15.0F; + float var12 = var11 * 0.6F + 0.4F; + + if (var6 == 0) { + var12 = 0.3F; + } + + float var13 = var11 * var11 * 0.7F - 0.5F; + float var14 = var11 * var11 * 0.6F - 0.7F; + + if (var13 < 0.0F) { + var13 = 0.0F; + } + + if (var14 < 0.0F) { + var14 = 0.0F; + } + + int rsColor = CustomColorizer.getRedstoneColor(var6); + + if (rsColor != -1) { + int var15 = rsColor >> 16 & 255; + int green = rsColor >> 8 & 255; + int var17 = rsColor & 255; + var12 = (float)var15 / 255.0F; + var13 = (float)green / 255.0F; + var14 = (float)var17 / 255.0F; + } + + var5.setColorOpaque_F(var12, var13, var14); + double var151 = 0.015625D; + double var171 = 0.015625D; + boolean var19 = BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_ - 1, p_147788_3_, p_147788_4_, 1) || !this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_ - 1, p_147788_3_ - 1, p_147788_4_, -1); + boolean var20 = BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_ + 1, p_147788_3_, p_147788_4_, 3) || !this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_ + 1, p_147788_3_ - 1, p_147788_4_, -1); + boolean var21 = BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_, p_147788_3_, p_147788_4_ - 1, 2) || !this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ - 1).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_, p_147788_3_ - 1, p_147788_4_ - 1, -1); + boolean var22 = BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_, p_147788_3_, p_147788_4_ + 1, 0) || !this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ + 1).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_, p_147788_3_ - 1, p_147788_4_ + 1, -1); + + if (!this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_).isBlockNormalCube()) { + if (this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_ - 1, p_147788_3_ + 1, p_147788_4_, -1)) { + var19 = true; + } + + if (this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_ + 1, p_147788_3_ + 1, p_147788_4_, -1)) { + var20 = true; + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ - 1).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_, p_147788_3_ + 1, p_147788_4_ - 1, -1)) { + var21 = true; + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ + 1).isBlockNormalCube() && BlockRedstoneWire.func_150174_f(this.blockAccess, p_147788_2_, p_147788_3_ + 1, p_147788_4_ + 1, -1)) { + var22 = true; + } + } + + float var23 = (float)(p_147788_2_ + 0); + float var24 = (float)(p_147788_2_ + 1); + float var25 = (float)(p_147788_4_ + 0); + float var26 = (float)(p_147788_4_ + 1); + boolean var27 = false; + + if ((var19 || var20) && !var21 && !var22) { + var27 = true; + } + + if ((var21 || var22) && !var20 && !var19) { + var27 = true; + } + + if (!var27) { + int var33 = 0; + int var29 = 0; + int var30 = 16; + int var31 = 16; + boolean var32 = true; + + if (!var19) { + var23 += 0.3125F; + } + + if (!var19) { + var33 += 5; + } + + if (!var20) { + var24 -= 0.3125F; + } + + if (!var20) { + var30 -= 5; + } + + if (!var21) { + var25 += 0.3125F; + } + + if (!var21) { + var29 += 5; + } + + if (!var22) { + var26 -= 0.3125F; + } + + if (!var22) { + var31 -= 5; + } + + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var30), (double)var7.getInterpolatedV((double)var31)); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var7.getInterpolatedU((double)var30), (double)var7.getInterpolatedV((double)var29)); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var7.getInterpolatedU((double)var33), (double)var7.getInterpolatedV((double)var29)); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var33), (double)var7.getInterpolatedV((double)var31)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var30), (double)var9.getInterpolatedV((double)var31)); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.getInterpolatedU((double)var30), (double)var9.getInterpolatedV((double)var29)); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.getInterpolatedU((double)var33), (double)var9.getInterpolatedV((double)var29)); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var33), (double)var9.getInterpolatedV((double)var31)); + } else if (var27) { + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.getMaxU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.getMaxU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.getMinU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMaxV()); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.getMaxU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.getMaxU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.getMinU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMaxV()); + } else { + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.getMaxU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.getMinU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.getMinU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.getMaxU(), (double)var8.getMinV()); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.getMaxU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.getMinU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.getMinU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.getMaxU(), (double)var10.getMinV()); + } + + if (!this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_).isBlockNormalCube()) { + float var331 = 0.021875F; + + if (this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_ + 1, p_147788_4_) == Blocks.redstone_wire) { + var5.setColorOpaque_F(var12, var13, var14); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var8.getMaxU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var8.getMinU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var8.getMinU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var8.getMaxU(), (double)var8.getMaxV()); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var10.getMaxU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var10.getMinU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var10.getMinU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var10.getMaxU(), (double)var10.getMaxV()); + } + + if (this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_ + 1, p_147788_4_) == Blocks.redstone_wire) { + var5.setColorOpaque_F(var12, var13, var14); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var8.getMinU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var8.getMaxU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var8.getMaxU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var8.getMinU(), (double)var8.getMinV()); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var10.getMinU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var10.getMaxU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var10.getMaxU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var10.getMinU(), (double)var10.getMinV()); + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ - 1).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_ - 1) == Blocks.redstone_wire) { + var5.setColorOpaque_F(var12, var13, var14); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ + 1).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_ + 1) == Blocks.redstone_wire) { + var5.setColorOpaque_F(var12, var13, var14); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); + var5.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); + } + } + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147788_2_, p_147788_3_, p_147788_4_)) { + this.renderSnow(p_147788_2_, p_147788_3_, p_147788_4_, 0.01D); + } + + return true; + } + + public boolean renderBlockMinecartTrack(BlockRailBase p_147766_1_, int p_147766_2_, int p_147766_3_, int p_147766_4_) { + Tessellator var5 = Tessellator.instance; + int var6 = this.blockAccess.getBlockMetadata(p_147766_2_, p_147766_3_, p_147766_4_); + IIcon var7 = this.getBlockIconFromSideAndMetadata(p_147766_1_, 0, var6); + + if (this.hasOverrideBlockTexture()) { + var7 = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + var7 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147766_1_, p_147766_2_, p_147766_3_, p_147766_4_, 1, var7); + } + + if (p_147766_1_.func_150050_e()) { + var6 &= 7; + } + + var5.setBrightness(p_147766_1_.getBlockBrightness(this.blockAccess, p_147766_2_, p_147766_3_, p_147766_4_)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double var8 = (double)var7.getMinU(); + double var10 = (double)var7.getMinV(); + double var12 = (double)var7.getMaxU(); + double var14 = (double)var7.getMaxV(); + double var16 = 0.0625D; + double var18 = (double)(p_147766_2_ + 1); + double var20 = (double)(p_147766_2_ + 1); + double var22 = (double)(p_147766_2_ + 0); + double var24 = (double)(p_147766_2_ + 0); + double var26 = (double)(p_147766_4_ + 0); + double var28 = (double)(p_147766_4_ + 1); + double var30 = (double)(p_147766_4_ + 1); + double var32 = (double)(p_147766_4_ + 0); + double var34 = (double)p_147766_3_ + var16; + double var36 = (double)p_147766_3_ + var16; + double var38 = (double)p_147766_3_ + var16; + double var40 = (double)p_147766_3_ + var16; + + if (var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) { + if (var6 == 8) { + var18 = var20 = (double)(p_147766_2_ + 0); + var22 = var24 = (double)(p_147766_2_ + 1); + var26 = var32 = (double)(p_147766_4_ + 1); + var28 = var30 = (double)(p_147766_4_ + 0); + } else if (var6 == 9) { + var18 = var24 = (double)(p_147766_2_ + 0); + var20 = var22 = (double)(p_147766_2_ + 1); + var26 = var28 = (double)(p_147766_4_ + 0); + var30 = var32 = (double)(p_147766_4_ + 1); + } + } else { + var18 = var24 = (double)(p_147766_2_ + 1); + var20 = var22 = (double)(p_147766_2_ + 0); + var26 = var28 = (double)(p_147766_4_ + 1); + var30 = var32 = (double)(p_147766_4_ + 0); + } + + if (var6 != 2 && var6 != 4) { + if (var6 == 3 || var6 == 5) { + ++var36; + ++var38; + } + } else { + ++var34; + ++var40; + } + + var5.addVertexWithUV(var18, var34, var26, var12, var10); + var5.addVertexWithUV(var20, var36, var28, var12, var14); + var5.addVertexWithUV(var22, var38, var30, var8, var14); + var5.addVertexWithUV(var24, var40, var32, var8, var10); + var5.addVertexWithUV(var24, var40, var32, var8, var10); + var5.addVertexWithUV(var22, var38, var30, var8, var14); + var5.addVertexWithUV(var20, var36, var28, var12, var14); + var5.addVertexWithUV(var18, var34, var26, var12, var10); + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147766_2_, p_147766_3_, p_147766_4_)) { + this.renderSnow(p_147766_2_, p_147766_3_, p_147766_4_, 0.05D); + } + + return true; + } + + public boolean renderBlockLadder(Block p_147794_1_, int p_147794_2_, int p_147794_3_, int p_147794_4_) { + Tessellator var5 = Tessellator.instance; + IIcon var6 = this.getBlockIconFromSide(p_147794_1_, 0); + + if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + + int var15 = this.blockAccess.getBlockMetadata(p_147794_2_, p_147794_3_, p_147794_4_); + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + var6 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147794_1_, p_147794_2_, p_147794_3_, p_147794_4_, var15, var6); + } + + var5.setBrightness(p_147794_1_.getBlockBrightness(this.blockAccess, p_147794_2_, p_147794_3_, p_147794_4_)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double var7 = (double)var6.getMinU(); + double var9 = (double)var6.getMinV(); + double var11 = (double)var6.getMaxU(); + double var13 = (double)var6.getMaxV(); + double var16 = 0.0D; + double var18 = 0.05000000074505806D; + + if (var15 == 5) { + var5.addVertexWithUV((double)p_147794_2_ + var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) + var16, var7, var9); + var5.addVertexWithUV((double)p_147794_2_ + var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) + var16, var7, var13); + var5.addVertexWithUV((double)p_147794_2_ + var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 0) - var16, var11, var13); + var5.addVertexWithUV((double)p_147794_2_ + var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 0) - var16, var11, var9); + } + + if (var15 == 4) { + var5.addVertexWithUV((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) + var16, var11, var13); + var5.addVertexWithUV((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) + var16, var11, var9); + var5.addVertexWithUV((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 0) - var16, var7, var9); + var5.addVertexWithUV((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 0) - var16, var7, var13); + } + + if (var15 == 3) { + var5.addVertexWithUV((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 0) - var16, (double)p_147794_4_ + var18, var11, var13); + var5.addVertexWithUV((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 1) + var16, (double)p_147794_4_ + var18, var11, var9); + var5.addVertexWithUV((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 1) + var16, (double)p_147794_4_ + var18, var7, var9); + var5.addVertexWithUV((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 0) - var16, (double)p_147794_4_ + var18, var7, var13); + } + + if (var15 == 2) { + var5.addVertexWithUV((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) - var18, var7, var9); + var5.addVertexWithUV((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) - var18, var7, var13); + var5.addVertexWithUV((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) - var18, var11, var13); + var5.addVertexWithUV((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) - var18, var11, var9); + } + + return true; + } + + public boolean renderBlockVine(Block p_147726_1_, int p_147726_2_, int p_147726_3_, int p_147726_4_) { + Tessellator var5 = Tessellator.instance; + IIcon var6 = this.getBlockIconFromSide(p_147726_1_, 0); + + if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + + int var17 = this.blockAccess.getBlockMetadata(p_147726_2_, p_147726_3_, p_147726_4_); + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + byte var7 = 0; + + if ((var17 & 1) != 0) { + var7 = 2; + } else if ((var17 & 2) != 0) { + var7 = 5; + } else if ((var17 & 4) != 0) { + var7 = 3; + } else if ((var17 & 8) != 0) { + var7 = 4; + } + + var6 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147726_1_, p_147726_2_, p_147726_3_, p_147726_4_, var7, var6); + } + + var5.setBrightness(p_147726_1_.getBlockBrightness(this.blockAccess, p_147726_2_, p_147726_3_, p_147726_4_)); + int var71 = CustomColorizer.getColorMultiplier(p_147726_1_, this.blockAccess, p_147726_2_, p_147726_3_, p_147726_4_); + float var8 = (float)(var71 >> 16 & 255) / 255.0F; + float var9 = (float)(var71 >> 8 & 255) / 255.0F; + float var10 = (float)(var71 & 255) / 255.0F; + var5.setColorOpaque_F(var8, var9, var10); + double var18 = (double)var6.getMinU(); + double var19 = (double)var6.getMinV(); + double var11 = (double)var6.getMaxU(); + double var13 = (double)var6.getMaxV(); + double var15 = 0.05000000074505806D; + + if ((var17 & 2) != 0) { + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var18, var19); + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var18, var13); + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var11, var13); + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var11, var19); + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var11, var19); + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var11, var13); + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var18, var13); + var5.addVertexWithUV((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var18, var19); + } + + if ((var17 & 8) != 0) { + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var11, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var11, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var18, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var18, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var18, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var18, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var11, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var11, var13); + } + + if ((var17 & 4) != 0) { + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var11, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var11, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var18, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var18, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var18, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var18, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var11, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var11, var13); + } + + if ((var17 & 1) != 0) { + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var18, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var18, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var11, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var11, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var11, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var11, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var18, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var18, var19); + } + + if (this.blockAccess.getBlock(p_147726_2_, p_147726_3_ + 1, p_147726_4_).isBlockNormalCube()) { + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 0), var18, var19); + var5.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 1), var18, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 1), var11, var13); + var5.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 0), var11, var19); + } + + return true; + } + + public boolean renderBlockStainedGlassPane(Block block, int x, int y, int z) { + int var5 = this.blockAccess.getHeight(); + Tessellator var6 = Tessellator.instance; + var6.setBrightness(block.getBlockBrightness(this.blockAccess, x, y, z)); + int var7 = block.colorMultiplier(this.blockAccess, x, y, z); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float isStainedGlass = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float iconGlass = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float iconGlassPaneTop = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = isStainedGlass; + var9 = iconGlass; + var10 = iconGlassPaneTop; + } + + var6.setColorOpaque_F(var8, var9, var10); + boolean isStainedGlass1 = block instanceof BlockStainedGlassPane; + int metadata = 0; + IIcon iconGlass1; + IIcon iconGlassPaneTop1; + + if (this.hasOverrideBlockTexture()) { + iconGlass1 = this.overrideBlockTexture; + iconGlassPaneTop1 = this.overrideBlockTexture; + } else { + metadata = this.blockAccess.getBlockMetadata(x, y, z); + iconGlass1 = this.getBlockIconFromSideAndMetadata(block, 0, metadata); + iconGlassPaneTop1 = isStainedGlass1 ? ((BlockStainedGlassPane)block).func_150104_b(metadata) : ((BlockPane)block).func_150097_e(); + } + + IIcon iconZ = iconGlass1; + boolean drawTop = true; + boolean drawBottom = true; + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + IIcon gMinU = ConnectedTextures.getConnectedTexture(this.blockAccess, block, x, y, z, 4, iconGlass1); + IIcon iz = ConnectedTextures.getConnectedTexture(this.blockAccess, block, x, y, z, 3, iconGlass1); + + if (gMinU != iconGlass1 || iz != iconGlass1) { + BlockPane gHalf7U = (BlockPane)block; + drawTop = this.blockAccess.getBlock(x, y + 1, z) != block || this.blockAccess.getBlockMetadata(x, y + 1, z) != metadata; + drawBottom = this.blockAccess.getBlock(x, y - 1, z) != block || this.blockAccess.getBlockMetadata(x, y - 1, z) != metadata; + } + + iconGlass1 = gMinU; + iconZ = iz; + } + + double gMinU1 = (double)iconGlass1.getMinU(); + double gHalf7U1 = (double)iconGlass1.getInterpolatedU(7.0D); + double gHalf9U = (double)iconGlass1.getInterpolatedU(9.0D); + double gMaxU = (double)iconGlass1.getMaxU(); + double gMinV = (double)iconGlass1.getMinV(); + double gMaxV = (double)iconGlass1.getMaxV(); + double gMinUz = (double)iconZ.getMinU(); + double gHalf7Uz = (double)iconZ.getInterpolatedU(7.0D); + double gHalf9Uz = (double)iconZ.getInterpolatedU(9.0D); + double gMaxUz = (double)iconZ.getMaxU(); + double gMinVz = (double)iconZ.getMinV(); + double gMaxVz = (double)iconZ.getMaxV(); + double var26 = (double)iconGlassPaneTop1.getInterpolatedU(7.0D); + double var28 = (double)iconGlassPaneTop1.getInterpolatedU(9.0D); + double var30 = (double)iconGlassPaneTop1.getMinV(); + double var32 = (double)iconGlassPaneTop1.getMaxV(); + double var34 = (double)iconGlassPaneTop1.getInterpolatedV(7.0D); + double var36 = (double)iconGlassPaneTop1.getInterpolatedV(9.0D); + double x0 = (double)x; + double x1 = (double)(x + 1); + double z0 = (double)z; + double z1 = (double)(z + 1); + double xHalfMin = (double)x + 0.5D - 0.0625D; + double xHalfMax = (double)x + 0.5D + 0.0625D; + double zHalfMin = (double)z + 0.5D - 0.0625D; + double zHalfMax = (double)z + 0.5D + 0.0625D; + boolean connZNeg = isStainedGlass1 ? ((BlockStainedGlassPane)block).func_150098_a(this.blockAccess.getBlock(x, y, z - 1)) : ((BlockPane)block).func_150098_a(this.blockAccess.getBlock(x, y, z - 1)); + boolean connZPos = isStainedGlass1 ? ((BlockStainedGlassPane)block).func_150098_a(this.blockAccess.getBlock(x, y, z + 1)) : ((BlockPane)block).func_150098_a(this.blockAccess.getBlock(x, y, z + 1)); + boolean connXNeg = isStainedGlass1 ? ((BlockStainedGlassPane)block).func_150098_a(this.blockAccess.getBlock(x - 1, y, z)) : ((BlockPane)block).func_150098_a(this.blockAccess.getBlock(x - 1, y, z)); + boolean connXPos = isStainedGlass1 ? ((BlockStainedGlassPane)block).func_150098_a(this.blockAccess.getBlock(x + 1, y, z)) : ((BlockPane)block).func_150098_a(this.blockAccess.getBlock(x + 1, y, z)); + double var58 = 0.001D; + double var60 = 0.999D; + double var62 = 0.001D; + boolean disconnected = !connZNeg && !connZPos && !connXNeg && !connXPos; + double yTop = (double)y + 0.999D; + double yBottom = (double)y + 0.001D; + + if (!drawTop) { + yTop = (double)(y + 1); + } + + if (!drawBottom) { + yBottom = (double)y; + } + + if (!connXNeg && !disconnected) { + if (!connZNeg && !connZPos) { + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + } + } else if (connXNeg && connXPos) { + if (!connZNeg) { + var6.addVertexWithUV(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.addVertexWithUV(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.addVertexWithUV(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.addVertexWithUV(x0, yTop, zHalfMin, gMinUz, gMinVz); + } else { + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.addVertexWithUV(x0, yTop, zHalfMin, gMinUz, gMinVz); + var6.addVertexWithUV(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.addVertexWithUV(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + } + + if (!connZPos) { + var6.addVertexWithUV(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.addVertexWithUV(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.addVertexWithUV(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.addVertexWithUV(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } else { + var6.addVertexWithUV(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.addVertexWithUV(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.addVertexWithUV(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } + + if (drawTop) { + var6.addVertexWithUV(x0, yTop, zHalfMax, var28, var30); + var6.addVertexWithUV(x1, yTop, zHalfMax, var28, var32); + var6.addVertexWithUV(x1, yTop, zHalfMin, var26, var32); + var6.addVertexWithUV(x0, yTop, zHalfMin, var26, var30); + } + + if (drawBottom) { + var6.addVertexWithUV(x1, yBottom, zHalfMax, var26, var32); + var6.addVertexWithUV(x0, yBottom, zHalfMax, var26, var30); + var6.addVertexWithUV(x0, yBottom, zHalfMin, var28, var30); + var6.addVertexWithUV(x1, yBottom, zHalfMin, var28, var32); + } + } else { + if (!connZNeg && !disconnected) { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.addVertexWithUV(x0, yTop, zHalfMin, gMinUz, gMinVz); + } else { + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.addVertexWithUV(x0, yTop, zHalfMin, gMinUz, gMinVz); + } + + if (!connZPos && !disconnected) { + var6.addVertexWithUV(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.addVertexWithUV(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + } else { + var6.addVertexWithUV(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.addVertexWithUV(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + } + + if (drawTop) { + var6.addVertexWithUV(x0, yTop, zHalfMax, var28, var30); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, var28, var34); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, var26, var34); + var6.addVertexWithUV(x0, yTop, zHalfMin, var26, var30); + } + + if (drawBottom) { + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, var26, var34); + var6.addVertexWithUV(x0, yBottom, zHalfMax, var26, var30); + var6.addVertexWithUV(x0, yBottom, zHalfMin, var28, var30); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, var28, var34); + } + } + + if ((connXPos || disconnected) && !connXNeg) { + if (!connZPos && !disconnected) { + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.addVertexWithUV(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } else { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.addVertexWithUV(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } + + if (!connZNeg && !disconnected) { + var6.addVertexWithUV(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.addVertexWithUV(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + } else { + var6.addVertexWithUV(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.addVertexWithUV(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + } + + if (drawTop) { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, var28, var36); + var6.addVertexWithUV(x1, yTop, zHalfMax, var28, var30); + var6.addVertexWithUV(x1, yTop, zHalfMin, var26, var30); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, var26, var36); + } + + if (drawBottom) { + var6.addVertexWithUV(x1, yBottom, zHalfMax, var26, var32); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, var26, var36); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, var28, var36); + var6.addVertexWithUV(x1, yBottom, zHalfMin, var28, var32); + } + } else if (!connXPos && !connZNeg && !connZPos) { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf7U1, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf9U, gMinV); + } + + if (!connZNeg && !disconnected) { + if (!connXPos && !connXNeg) { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + } + } else if (connZNeg && connZPos) { + if (!connXNeg) { + var6.addVertexWithUV(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, z1, gMaxU, gMinV); + } else { + var6.addVertexWithUV(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, z1, gMaxU, gMinV); + } + + if (!connXPos) { + var6.addVertexWithUV(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, z0, gMinU1, gMinV); + } else { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf7U1, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, z0, gMinU1, gMinV); + var6.addVertexWithUV(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf9U, gMinV); + } + + if (drawTop) { + var6.addVertexWithUV(xHalfMax, yTop, z0, var28, var30); + var6.addVertexWithUV(xHalfMin, yTop, z0, var26, var30); + var6.addVertexWithUV(xHalfMin, yTop, z1, var26, var32); + var6.addVertexWithUV(xHalfMax, yTop, z1, var28, var32); + } + + if (drawBottom) { + var6.addVertexWithUV(xHalfMin, yBottom, z0, var26, var30); + var6.addVertexWithUV(xHalfMax, yBottom, z0, var28, var30); + var6.addVertexWithUV(xHalfMax, yBottom, z1, var28, var32); + var6.addVertexWithUV(xHalfMin, yBottom, z1, var26, var32); + } + } else { + if (!connXNeg && !disconnected) { + var6.addVertexWithUV(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + } else { + var6.addVertexWithUV(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + } + + if (!connXPos && !disconnected) { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf9U, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, z0, gMinU1, gMinV); + } else { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf7U1, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, z0, gMinU1, gMinV); + } + + if (drawTop) { + var6.addVertexWithUV(xHalfMax, yTop, z0, var28, var30); + var6.addVertexWithUV(xHalfMin, yTop, z0, var26, var30); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, var26, var34); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, var28, var34); + } + + if (drawBottom) { + var6.addVertexWithUV(xHalfMin, yBottom, z0, var26, var30); + var6.addVertexWithUV(xHalfMax, yBottom, z0, var28, var30); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, var28, var34); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, var26, var34); + } + } + + if ((connZPos || disconnected) && !connZNeg) { + if (!connXNeg && !disconnected) { + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, z1, gMaxU, gMinV); + } else { + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMin, yTop, z1, gMaxU, gMinV); + } + + if (!connXPos && !disconnected) { + var6.addVertexWithUV(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, gHalf7U1, gMinV); + } else { + var6.addVertexWithUV(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.addVertexWithUV(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf9U, gMinV); + } + + if (drawTop) { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, var28, var36); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, var26, var36); + var6.addVertexWithUV(xHalfMin, yTop, z1, var26, var32); + var6.addVertexWithUV(xHalfMax, yTop, z1, var28, var32); + } + + if (drawBottom) { + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, var26, var36); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, var28, var36); + var6.addVertexWithUV(xHalfMax, yBottom, z1, var28, var32); + var6.addVertexWithUV(xHalfMin, yBottom, z1, var26, var32); + } + } else if (!connZPos && !connXPos && !connXNeg) { + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + } + + if (drawTop) { + var6.addVertexWithUV(xHalfMax, yTop, zHalfMin, var28, var34); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMin, var26, var34); + var6.addVertexWithUV(xHalfMin, yTop, zHalfMax, var26, var36); + var6.addVertexWithUV(xHalfMax, yTop, zHalfMax, var28, var36); + } + + if (drawBottom) { + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMin, var26, var34); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMin, var28, var34); + var6.addVertexWithUV(xHalfMax, yBottom, zHalfMax, var28, var36); + var6.addVertexWithUV(xHalfMin, yBottom, zHalfMax, var26, var36); + } + + if (disconnected) { + var6.addVertexWithUV(x0, yTop, zHalfMin, gHalf7U1, gMinV); + var6.addVertexWithUV(x0, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.addVertexWithUV(x0, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.addVertexWithUV(x0, yTop, zHalfMax, gHalf9U, gMinV); + var6.addVertexWithUV(x1, yTop, zHalfMax, gHalf7U1, gMinV); + var6.addVertexWithUV(x1, yBottom, zHalfMax, gHalf7U1, gMaxV); + var6.addVertexWithUV(x1, yBottom, zHalfMin, gHalf9U, gMaxV); + var6.addVertexWithUV(x1, yTop, zHalfMin, gHalf9U, gMinV); + var6.addVertexWithUV(xHalfMax, yTop, z0, gHalf9Uz, gMinVz); + var6.addVertexWithUV(xHalfMax, yBottom, z0, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yBottom, z0, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(xHalfMin, yTop, z0, gHalf7Uz, gMinVz); + var6.addVertexWithUV(xHalfMin, yTop, z1, gHalf7Uz, gMinVz); + var6.addVertexWithUV(xHalfMin, yBottom, z1, gHalf7Uz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yBottom, z1, gHalf9Uz, gMaxVz); + var6.addVertexWithUV(xHalfMax, yTop, z1, gHalf9Uz, gMinVz); + } + + return true; + } + + public boolean renderBlockPane(BlockPane p_147767_1_, int p_147767_2_, int p_147767_3_, int p_147767_4_) { + int var5 = this.blockAccess.getHeight(); + Tessellator var6 = Tessellator.instance; + var6.setBrightness(p_147767_1_.getBlockBrightness(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_)); + int var7 = p_147767_1_.colorMultiplier(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var63 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var64 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float kr = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var63; + var9 = var64; + var10 = kr; + } + + var6.setColorOpaque_F(var8, var9, var10); + IIcon var631; + IIcon var641; + + if (this.hasOverrideBlockTexture()) { + var631 = this.overrideBlockTexture; + var641 = this.overrideBlockTexture; + } else { + int kr1 = this.blockAccess.getBlockMetadata(p_147767_2_, p_147767_3_, p_147767_4_); + var631 = this.getBlockIconFromSideAndMetadata(p_147767_1_, 0, kr1); + var641 = p_147767_1_.func_150097_e(); + } + + IIcon kr2 = var631; + IIcon kz = var631; + IIcon kzr = var631; + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + var631 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 2, var631); + kr2 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 3, kr2); + kz = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 4, kz); + kzr = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 5, kzr); + } + + double var65 = (double)var631.getMinU(); + double var15 = (double)var631.getInterpolatedU(8.0D); + double var17 = (double)var631.getMaxU(); + double var19 = (double)var631.getMinV(); + double var21 = (double)var631.getMaxV(); + double dr = (double)kr2.getMinU(); + double d1r = (double)kr2.getInterpolatedU(8.0D); + double d2r = (double)kr2.getMaxU(); + double d3r = (double)kr2.getMinV(); + double d4r = (double)kr2.getMaxV(); + double dz = (double)kz.getMinU(); + double d1z = (double)kz.getInterpolatedU(8.0D); + double d2z = (double)kz.getMaxU(); + double d3z = (double)kz.getMinV(); + double d4z = (double)kz.getMaxV(); + double dzr = (double)kzr.getMinU(); + double d1zr = (double)kzr.getInterpolatedU(8.0D); + double d2zr = (double)kzr.getMaxU(); + double d3zr = (double)kzr.getMinV(); + double d4zr = (double)kzr.getMaxV(); + double var23 = (double)var641.getInterpolatedU(7.0D); + double var25 = (double)var641.getInterpolatedU(9.0D); + double var27 = (double)var641.getMinV(); + double var29 = (double)var641.getInterpolatedV(8.0D); + double var31 = (double)var641.getMaxV(); + double var33 = (double)p_147767_2_; + double var35 = (double)p_147767_2_ + 0.5D; + double var37 = (double)(p_147767_2_ + 1); + double var39 = (double)p_147767_4_; + double var41 = (double)p_147767_4_ + 0.5D; + double var43 = (double)(p_147767_4_ + 1); + double var45 = (double)p_147767_2_ + 0.5D - 0.0625D; + double var47 = (double)p_147767_2_ + 0.5D + 0.0625D; + double var49 = (double)p_147767_4_ + 0.5D - 0.0625D; + double var51 = (double)p_147767_4_ + 0.5D + 0.0625D; + boolean var53 = p_147767_1_.func_150098_a(this.blockAccess.getBlock(p_147767_2_, p_147767_3_, p_147767_4_ - 1)); + boolean var54 = p_147767_1_.func_150098_a(this.blockAccess.getBlock(p_147767_2_, p_147767_3_, p_147767_4_ + 1)); + boolean var55 = p_147767_1_.func_150098_a(this.blockAccess.getBlock(p_147767_2_ - 1, p_147767_3_, p_147767_4_)); + boolean var56 = p_147767_1_.func_150098_a(this.blockAccess.getBlock(p_147767_2_ + 1, p_147767_3_, p_147767_4_)); + boolean var57 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); + boolean var58 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); + double var59 = 0.01D; + double var61 = 0.005D; + + if ((!var55 || !var56) && (var55 || var56 || var53 || var54)) { + if (var55 && !var56) { + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1), var41, var65, var19); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 0), var41, var65, var21); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, var15, var21); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, var15, var19); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, d1r, d3r); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, d1r, d4r); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 0), var41, d2r, d4r); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1), var41, d2r, d3r); + + if (!var54 && !var53) { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var51, var23, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var51, var23, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var49, var25, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var49, var25, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var49, var23, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var49, var23, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var51, var25, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var51, var25, var27); + } + + if (var57 || p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ + 1, p_147767_4_)) { + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + } + + if (var58 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ - 1, p_147767_4_)) { + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + } + } else if (!var55 && var56) { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, var15, var19); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, var15, var21); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 0), var41, var17, var21); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1), var41, var17, var19); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1), var41, dr, d3r); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 0), var41, dr, d4r); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, d1r, d4r); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, d1r, d3r); + + if (!var54 && !var53) { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var49, var23, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var49, var23, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var51, var25, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var51, var25, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var51, var23, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var51, var23, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var49, var25, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var49, var25, var27); + } + + if (var57 || p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ + 1, p_147767_4_)) { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + } + + if (var58 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ - 1, p_147767_4_)) { + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var49, var23, var27); + } + } + } else { + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1), var41, var65, var19); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 0), var41, var65, var21); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 0), var41, var17, var21); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1), var41, var17, var19); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1), var41, dr, d3r); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 0), var41, dr, d4r); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 0), var41, d2r, d4r); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1), var41, d2r, d3r); + + if (var57) { + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + } else { + if (p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ + 1, p_147767_4_)) { + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.addVertexWithUV(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + } + + if (p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ + 1, p_147767_4_)) { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.addVertexWithUV(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + } + } + + if (var58) { + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var49, var23, var31); + } else { + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ - 1, p_147767_4_)) { + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.addVertexWithUV(var33, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + } + + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ - 1, p_147767_4_)) { + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.addVertexWithUV(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.addVertexWithUV(var37, (double)p_147767_3_ - 0.01D, var49, var23, var27); + } + } + } + + if ((!var53 || !var54) && (var55 || var56 || var53 || var54)) { + if (var53 && !var54) { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var39, dz, d3z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var39, dz, d4z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, d1z, d4z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, d1z, d3z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, d1zr, d3zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, d1zr, d4zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var39, d2zr, d4zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var39, d2zr, d3zr); + + if (!var56 && !var55) { + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1), var41, var25, var27); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1), var41, var25, var27); + } + + if (var57 || p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ - 1)) { + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var27); + } + + if (var58 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ - 1)) { + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var39, var25, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var39, var23, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var25, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var39, var25, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var39, var23, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var23, var27); + } + } else if (!var53 && var54) { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, d1z, d3z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, d1z, d4z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var43, d2z, d4z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var43, d2z, d3z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var43, dzr, d3zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var43, dzr, d4zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var41, d1zr, d4zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var41, d1zr, d3zr); + + if (!var56 && !var55) { + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1), var41, var25, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1), var41, var25, var27); + } + + if (var57 || p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ + 1)) { + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var29); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var29); + } + + if (var58 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ + 1)) { + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var43, var23, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var43, var25, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var43, var23, var29); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var23, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var25, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var43, var25, var29); + } + } + } else { + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var43, dzr, d3zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var43, dzr, d4zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var39, d2zr, d4zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var39, d2zr, d3zr); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var39, dz, d3z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var39, dz, d4z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 0), var43, d2z, d4z); + var6.addVertexWithUV(var35, (double)(p_147767_3_ + 1), var43, d2z, d3z); + + if (var57) { + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var31); + } else { + if (p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ - 1)) { + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var27); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var29); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var27); + } + + if (p_147767_3_ < var5 - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ + 1)) { + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var29); + var6.addVertexWithUV(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var31); + var6.addVertexWithUV(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var29); + } + } + + if (var58) { + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var43, var25, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var39, var25, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var39, var23, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var43, var23, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var39, var25, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var43, var25, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var43, var23, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var39, var23, var31); + } else { + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ - 1)) { + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var39, var25, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var39, var23, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var25, var27); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var39, var25, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var39, var23, var29); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var23, var27); + } + + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ + 1)) { + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var43, var23, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var43, var25, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var43, var23, var29); + var6.addVertexWithUV(var45, (double)p_147767_3_ - 0.005D, var41, var23, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var41, var25, var31); + var6.addVertexWithUV(var47, (double)p_147767_3_ - 0.005D, var43, var25, var29); + } + } + } + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147767_2_, p_147767_3_, p_147767_4_)) { + this.renderSnow(p_147767_2_, p_147767_3_, p_147767_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + return true; + } + + public boolean renderCrossedSquares(Block p_147746_1_, int p_147746_2_, int p_147746_3_, int p_147746_4_) { + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147746_1_.getBlockBrightness(this.blockAccess, p_147746_2_, p_147746_3_, p_147746_4_)); + int var6 = CustomColorizer.getColorMultiplier(p_147746_1_, this.blockAccess, p_147746_2_, p_147746_3_, p_147746_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var18 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var19 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var18; + var8 = var11; + var9 = var19; + } + + var5.setColorOpaque_F(var7, var8, var9); + double var181 = (double)p_147746_2_; + double var191 = (double)p_147746_3_; + double var14 = (double)p_147746_4_; + long var16; + + if (p_147746_1_ == Blocks.tallgrass) { + var16 = (long)(p_147746_2_ * 3129871) ^ (long)p_147746_4_ * 116129781L ^ (long)p_147746_3_; + var16 = var16 * var16 * 42317861L + var16 * 11L; + var181 += ((double)((float)(var16 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; + var191 += ((double)((float)(var16 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; + var14 += ((double)((float)(var16 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; + } else if (p_147746_1_ == Blocks.red_flower || p_147746_1_ == Blocks.yellow_flower) { + var16 = (long)(p_147746_2_ * 3129871) ^ (long)p_147746_4_ * 116129781L ^ (long)p_147746_3_; + var16 = var16 * var16 * 42317861L + var16 * 11L; + var181 += ((double)((float)(var16 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D; + var14 += ((double)((float)(var16 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D; + } + + IIcon var20 = this.getBlockIconFromSideAndMetadata(p_147746_1_, 0, this.blockAccess.getBlockMetadata(p_147746_2_, p_147746_3_, p_147746_4_)); + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + var20 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147746_1_, p_147746_2_, p_147746_3_, p_147746_4_, 2, var20); + } + + this.drawCrossedSquares(var20, var181, var191, var14, 1.0F); + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147746_2_, p_147746_3_, p_147746_4_)) { + this.renderSnow(p_147746_2_, p_147746_3_, p_147746_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + return true; + } + + public boolean renderBlockDoublePlant(BlockDoublePlant p_147774_1_, int p_147774_2_, int p_147774_3_, int p_147774_4_) { + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147774_1_.getBlockBrightness(this.blockAccess, p_147774_2_, p_147774_3_, p_147774_4_)); + int var6 = CustomColorizer.getColorMultiplier(p_147774_1_, this.blockAccess, p_147774_2_, p_147774_3_, p_147774_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var58 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var59 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var58; + var8 = var11; + var9 = var59; + } + + var5.setColorOpaque_F(var7, var8, var9); + long var581 = (long)(p_147774_2_ * 3129871) ^ (long)p_147774_4_ * 116129781L; + var581 = var581 * var581 * 42317861L + var581 * 11L; + double var591 = (double)p_147774_2_; + double var14 = (double)p_147774_3_; + double var16 = (double)p_147774_4_; + var591 += ((double)((float)(var581 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D; + var16 += ((double)((float)(var581 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D; + int var18 = this.blockAccess.getBlockMetadata(p_147774_2_, p_147774_3_, p_147774_4_); + boolean var19 = false; + boolean var20 = BlockDoublePlant.func_149887_c(var18); + int var60; + + if (var20) { + if (this.blockAccess.getBlock(p_147774_2_, p_147774_3_ - 1, p_147774_4_) != p_147774_1_) { + return false; + } + + var60 = BlockDoublePlant.func_149890_d(this.blockAccess.getBlockMetadata(p_147774_2_, p_147774_3_ - 1, p_147774_4_)); + } else { + var60 = BlockDoublePlant.func_149890_d(var18); + } + + IIcon var21 = p_147774_1_.func_149888_a(var20, var60); + this.drawCrossedSquares(var21, var591, var14, var16, 1.0F); + + if (var20 && var60 == 0) { + IIcon var22 = p_147774_1_.field_149891_b[0]; + double var23 = Math.cos((double)var581 * 0.8D) * Math.PI * 0.1D; + double var25 = Math.cos(var23); + double var27 = Math.sin(var23); + double var29 = (double)var22.getMinU(); + double var31 = (double)var22.getMinV(); + double var33 = (double)var22.getMaxU(); + double var35 = (double)var22.getMaxV(); + double var37 = 0.3D; + double var39 = -0.05D; + double var41 = 0.5D + 0.3D * var25 - 0.5D * var27; + double var43 = 0.5D + 0.5D * var25 + 0.3D * var27; + double var45 = 0.5D + 0.3D * var25 + 0.5D * var27; + double var47 = 0.5D + -0.5D * var25 + 0.3D * var27; + double var49 = 0.5D + -0.05D * var25 + 0.5D * var27; + double var51 = 0.5D + -0.5D * var25 + -0.05D * var27; + double var53 = 0.5D + -0.05D * var25 - 0.5D * var27; + double var55 = 0.5D + 0.5D * var25 + -0.05D * var27; + var5.addVertexWithUV(var591 + var49, var14 + 1.0D, var16 + var51, var29, var35); + var5.addVertexWithUV(var591 + var53, var14 + 1.0D, var16 + var55, var33, var35); + var5.addVertexWithUV(var591 + var41, var14 + 0.0D, var16 + var43, var33, var31); + var5.addVertexWithUV(var591 + var45, var14 + 0.0D, var16 + var47, var29, var31); + IIcon var57 = p_147774_1_.field_149891_b[1]; + var29 = (double)var57.getMinU(); + var31 = (double)var57.getMinV(); + var33 = (double)var57.getMaxU(); + var35 = (double)var57.getMaxV(); + var5.addVertexWithUV(var591 + var53, var14 + 1.0D, var16 + var55, var29, var35); + var5.addVertexWithUV(var591 + var49, var14 + 1.0D, var16 + var51, var33, var35); + var5.addVertexWithUV(var591 + var45, var14 + 0.0D, var16 + var47, var33, var31); + var5.addVertexWithUV(var591 + var41, var14 + 0.0D, var16 + var43, var29, var31); + } + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147774_2_, p_147774_3_, p_147774_4_)) { + this.renderSnow(p_147774_2_, p_147774_3_, p_147774_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + return true; + } + + public boolean renderBlockStem(Block p_147724_1_, int p_147724_2_, int p_147724_3_, int p_147724_4_) { + BlockStem var5 = (BlockStem)p_147724_1_; + Tessellator var6 = Tessellator.instance; + var6.setBrightness(var5.getBlockBrightness(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_)); + int var7 = CustomColorizer.getStemColorMultiplier(var5, this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var14 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var14; + var9 = var12; + var10 = var13; + } + + var6.setColorOpaque_F(var8, var9, var10); + var5.setBlockBoundsBasedOnState(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); + int var141 = var5.func_149873_e(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); + + if (var141 < 0) { + this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + } else { + this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), 0.5D, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), var141, this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + } + + return true; + } + + public boolean renderBlockCrops(Block p_147796_1_, int p_147796_2_, int p_147796_3_, int p_147796_4_) { + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147796_1_.getBlockBrightness(this.blockAccess, p_147796_2_, p_147796_3_, p_147796_4_)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + this.renderBlockCropsImpl(p_147796_1_, this.blockAccess.getBlockMetadata(p_147796_2_, p_147796_3_, p_147796_4_), (double)p_147796_2_, (double)((float)p_147796_3_ - 0.0625F), (double)p_147796_4_); + return true; + } + + public void renderTorchAtAngle(Block p_147747_1_, double p_147747_2_, double p_147747_4_, double p_147747_6_, double p_147747_8_, double p_147747_10_, int p_147747_12_) { + Tessellator var13 = Tessellator.instance; + IIcon var14 = this.getBlockIconFromSideAndMetadata(p_147747_1_, 0, p_147747_12_); + + if (this.hasOverrideBlockTexture()) { + var14 = this.overrideBlockTexture; + } + + double var15 = (double)var14.getMinU(); + double var17 = (double)var14.getMinV(); + double var19 = (double)var14.getMaxU(); + double var21 = (double)var14.getMaxV(); + double var23 = (double)var14.getInterpolatedU(7.0D); + double var25 = (double)var14.getInterpolatedV(6.0D); + double var27 = (double)var14.getInterpolatedU(9.0D); + double var29 = (double)var14.getInterpolatedV(8.0D); + double var31 = (double)var14.getInterpolatedU(7.0D); + double var33 = (double)var14.getInterpolatedV(13.0D); + double var35 = (double)var14.getInterpolatedU(9.0D); + double var37 = (double)var14.getInterpolatedV(15.0D); + p_147747_2_ += 0.5D; + p_147747_6_ += 0.5D; + double var39 = p_147747_2_ - 0.5D; + double var41 = p_147747_2_ + 0.5D; + double var43 = p_147747_6_ - 0.5D; + double var45 = p_147747_6_ + 0.5D; + double var47 = 0.0625D; + double var49 = 0.625D; + var13.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - var49) - var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) - var47, var23, var25); + var13.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - var49) - var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) + var47, var23, var29); + var13.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - var49) + var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) + var47, var27, var29); + var13.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - var49) + var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) - var47, var27, var25); + var13.addVertexWithUV(p_147747_2_ + var47 + p_147747_8_, p_147747_4_, p_147747_6_ - var47 + p_147747_10_, var35, var33); + var13.addVertexWithUV(p_147747_2_ + var47 + p_147747_8_, p_147747_4_, p_147747_6_ + var47 + p_147747_10_, var35, var37); + var13.addVertexWithUV(p_147747_2_ - var47 + p_147747_8_, p_147747_4_, p_147747_6_ + var47 + p_147747_10_, var31, var37); + var13.addVertexWithUV(p_147747_2_ - var47 + p_147747_8_, p_147747_4_, p_147747_6_ - var47 + p_147747_10_, var31, var33); + var13.addVertexWithUV(p_147747_2_ - var47, p_147747_4_ + 1.0D, var43, var15, var17); + var13.addVertexWithUV(p_147747_2_ - var47 + p_147747_8_, p_147747_4_ + 0.0D, var43 + p_147747_10_, var15, var21); + var13.addVertexWithUV(p_147747_2_ - var47 + p_147747_8_, p_147747_4_ + 0.0D, var45 + p_147747_10_, var19, var21); + var13.addVertexWithUV(p_147747_2_ - var47, p_147747_4_ + 1.0D, var45, var19, var17); + var13.addVertexWithUV(p_147747_2_ + var47, p_147747_4_ + 1.0D, var45, var15, var17); + var13.addVertexWithUV(p_147747_2_ + p_147747_8_ + var47, p_147747_4_ + 0.0D, var45 + p_147747_10_, var15, var21); + var13.addVertexWithUV(p_147747_2_ + p_147747_8_ + var47, p_147747_4_ + 0.0D, var43 + p_147747_10_, var19, var21); + var13.addVertexWithUV(p_147747_2_ + var47, p_147747_4_ + 1.0D, var43, var19, var17); + var13.addVertexWithUV(var39, p_147747_4_ + 1.0D, p_147747_6_ + var47, var15, var17); + var13.addVertexWithUV(var39 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ + var47 + p_147747_10_, var15, var21); + var13.addVertexWithUV(var41 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ + var47 + p_147747_10_, var19, var21); + var13.addVertexWithUV(var41, p_147747_4_ + 1.0D, p_147747_6_ + var47, var19, var17); + var13.addVertexWithUV(var41, p_147747_4_ + 1.0D, p_147747_6_ - var47, var15, var17); + var13.addVertexWithUV(var41 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ - var47 + p_147747_10_, var15, var21); + var13.addVertexWithUV(var39 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ - var47 + p_147747_10_, var19, var21); + var13.addVertexWithUV(var39, p_147747_4_ + 1.0D, p_147747_6_ - var47, var19, var17); + } + + public void drawCrossedSquares(IIcon p_147765_1_, double p_147765_2_, double p_147765_4_, double p_147765_6_, float p_147765_8_) { + Tessellator var9 = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) { + p_147765_1_ = this.overrideBlockTexture; + } + + double var10 = (double)p_147765_1_.getMinU(); + double var12 = (double)p_147765_1_.getMinV(); + double var14 = (double)p_147765_1_.getMaxU(); + double var16 = (double)p_147765_1_.getMaxV(); + double var18 = 0.45D * (double)p_147765_8_; + double var20 = p_147765_2_ + 0.5D - var18; + double var22 = p_147765_2_ + 0.5D + var18; + double var24 = p_147765_6_ + 0.5D - var18; + double var26 = p_147765_6_ + 0.5D + var18; + var9.addVertexWithUV(var20, p_147765_4_ + (double)p_147765_8_, var24, var10, var12); + var9.addVertexWithUV(var20, p_147765_4_ + 0.0D, var24, var10, var16); + var9.addVertexWithUV(var22, p_147765_4_ + 0.0D, var26, var14, var16); + var9.addVertexWithUV(var22, p_147765_4_ + (double)p_147765_8_, var26, var14, var12); + var9.addVertexWithUV(var22, p_147765_4_ + (double)p_147765_8_, var26, var10, var12); + var9.addVertexWithUV(var22, p_147765_4_ + 0.0D, var26, var10, var16); + var9.addVertexWithUV(var20, p_147765_4_ + 0.0D, var24, var14, var16); + var9.addVertexWithUV(var20, p_147765_4_ + (double)p_147765_8_, var24, var14, var12); + var9.addVertexWithUV(var20, p_147765_4_ + (double)p_147765_8_, var26, var10, var12); + var9.addVertexWithUV(var20, p_147765_4_ + 0.0D, var26, var10, var16); + var9.addVertexWithUV(var22, p_147765_4_ + 0.0D, var24, var14, var16); + var9.addVertexWithUV(var22, p_147765_4_ + (double)p_147765_8_, var24, var14, var12); + var9.addVertexWithUV(var22, p_147765_4_ + (double)p_147765_8_, var24, var10, var12); + var9.addVertexWithUV(var22, p_147765_4_ + 0.0D, var24, var10, var16); + var9.addVertexWithUV(var20, p_147765_4_ + 0.0D, var26, var14, var16); + var9.addVertexWithUV(var20, p_147765_4_ + (double)p_147765_8_, var26, var14, var12); + } + + public void renderBlockStemSmall(Block p_147730_1_, int p_147730_2_, double p_147730_3_, double p_147730_5_, double p_147730_7_, double p_147730_9_) { + Tessellator var11 = Tessellator.instance; + IIcon var12 = this.getBlockIconFromSideAndMetadata(p_147730_1_, 0, p_147730_2_); + + if (this.hasOverrideBlockTexture()) { + var12 = this.overrideBlockTexture; + } + + double var13 = (double)var12.getMinU(); + double var15 = (double)var12.getMinV(); + double var17 = (double)var12.getMaxU(); + double var19 = (double)var12.getInterpolatedV(p_147730_3_ * 16.0D); + double var21 = p_147730_5_ + 0.5D - 0.44999998807907104D; + double var23 = p_147730_5_ + 0.5D + 0.44999998807907104D; + double var25 = p_147730_9_ + 0.5D - 0.44999998807907104D; + double var27 = p_147730_9_ + 0.5D + 0.44999998807907104D; + var11.addVertexWithUV(var21, p_147730_7_ + p_147730_3_, var25, var13, var15); + var11.addVertexWithUV(var21, p_147730_7_ + 0.0D, var25, var13, var19); + var11.addVertexWithUV(var23, p_147730_7_ + 0.0D, var27, var17, var19); + var11.addVertexWithUV(var23, p_147730_7_ + p_147730_3_, var27, var17, var15); + var11.addVertexWithUV(var23, p_147730_7_ + p_147730_3_, var27, var17, var15); + var11.addVertexWithUV(var23, p_147730_7_ + 0.0D, var27, var17, var19); + var11.addVertexWithUV(var21, p_147730_7_ + 0.0D, var25, var13, var19); + var11.addVertexWithUV(var21, p_147730_7_ + p_147730_3_, var25, var13, var15); + var11.addVertexWithUV(var21, p_147730_7_ + p_147730_3_, var27, var13, var15); + var11.addVertexWithUV(var21, p_147730_7_ + 0.0D, var27, var13, var19); + var11.addVertexWithUV(var23, p_147730_7_ + 0.0D, var25, var17, var19); + var11.addVertexWithUV(var23, p_147730_7_ + p_147730_3_, var25, var17, var15); + var11.addVertexWithUV(var23, p_147730_7_ + p_147730_3_, var25, var17, var15); + var11.addVertexWithUV(var23, p_147730_7_ + 0.0D, var25, var17, var19); + var11.addVertexWithUV(var21, p_147730_7_ + 0.0D, var27, var13, var19); + var11.addVertexWithUV(var21, p_147730_7_ + p_147730_3_, var27, var13, var15); + } + + public boolean renderBlockLilyPad(Block p_147783_1_, int p_147783_2_, int p_147783_3_, int p_147783_4_) { + Tessellator var5 = Tessellator.instance; + IIcon var6 = this.getBlockIconFromSide(p_147783_1_, 1); + + if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + var6 = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147783_1_, p_147783_2_, p_147783_3_, p_147783_4_, 1, var6); + } + + float var7 = 0.015625F; + double var8 = (double)var6.getMinU(); + double var10 = (double)var6.getMinV(); + double var12 = (double)var6.getMaxU(); + double var14 = (double)var6.getMaxV(); + long var16 = (long)(p_147783_2_ * 3129871) ^ (long)p_147783_4_ * 116129781L ^ (long)p_147783_3_; + var16 = var16 * var16 * 42317861L + var16 * 11L; + int var18 = (int)(var16 >> 16 & 3L); + var5.setBrightness(p_147783_1_.getBlockBrightness(this.blockAccess, p_147783_2_, p_147783_3_, p_147783_4_)); + float var19 = (float)p_147783_2_ + 0.5F; + float var20 = (float)p_147783_4_ + 0.5F; + float var21 = (float)(var18 & 1) * 0.5F * (float)(1 - var18 / 2 % 2 * 2); + float var22 = (float)(var18 + 1 & 1) * 0.5F * (float)(1 - (var18 + 1) / 2 % 2 * 2); + int col = CustomColorizer.getLilypadColor(); + var5.setColorOpaque_I(col); + var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 + var22), var8, var10); + var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 + var22), var12, var10); + var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 - var22), var12, var14); + var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 - var22), var8, var14); + var5.setColorOpaque_I((col & 16711422) >> 1); + var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 - var22), var8, var14); + var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 - var22), var12, var14); + var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 + var22), var12, var10); + var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 + var22), var8, var10); + return true; + } + + public void renderBlockStemBig(BlockStem p_147740_1_, int p_147740_2_, int p_147740_3_, double p_147740_4_, double p_147740_6_, double p_147740_8_, double p_147740_10_) { + Tessellator var12 = Tessellator.instance; + IIcon var13 = p_147740_1_.func_149872_i(); + + if (this.hasOverrideBlockTexture()) { + var13 = this.overrideBlockTexture; + } + + double var14 = (double)var13.getMinU(); + double var16 = (double)var13.getMinV(); + double var18 = (double)var13.getMaxU(); + double var20 = (double)var13.getMaxV(); + double var22 = p_147740_6_ + 0.5D - 0.5D; + double var24 = p_147740_6_ + 0.5D + 0.5D; + double var26 = p_147740_10_ + 0.5D - 0.5D; + double var28 = p_147740_10_ + 0.5D + 0.5D; + double var30 = p_147740_6_ + 0.5D; + double var32 = p_147740_10_ + 0.5D; + + if ((p_147740_3_ + 1) / 2 % 2 == 1) { + double var34 = var18; + var18 = var14; + var14 = var34; + } + + if (p_147740_3_ < 2) { + var12.addVertexWithUV(var22, p_147740_8_ + p_147740_4_, var32, var14, var16); + var12.addVertexWithUV(var22, p_147740_8_ + 0.0D, var32, var14, var20); + var12.addVertexWithUV(var24, p_147740_8_ + 0.0D, var32, var18, var20); + var12.addVertexWithUV(var24, p_147740_8_ + p_147740_4_, var32, var18, var16); + var12.addVertexWithUV(var24, p_147740_8_ + p_147740_4_, var32, var18, var16); + var12.addVertexWithUV(var24, p_147740_8_ + 0.0D, var32, var18, var20); + var12.addVertexWithUV(var22, p_147740_8_ + 0.0D, var32, var14, var20); + var12.addVertexWithUV(var22, p_147740_8_ + p_147740_4_, var32, var14, var16); + } else { + var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var28, var14, var16); + var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var28, var14, var20); + var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var26, var18, var20); + var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var26, var18, var16); + var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var26, var18, var16); + var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var26, var18, var20); + var12.addVertexWithUV(var30, p_147740_8_ + 0.0D, var28, var14, var20); + var12.addVertexWithUV(var30, p_147740_8_ + p_147740_4_, var28, var14, var16); + } + } + + public void renderBlockCropsImpl(Block p_147795_1_, int p_147795_2_, double p_147795_3_, double p_147795_5_, double p_147795_7_) { + Tessellator var9 = Tessellator.instance; + IIcon var10 = this.getBlockIconFromSideAndMetadata(p_147795_1_, 0, p_147795_2_); + + if (this.hasOverrideBlockTexture()) { + var10 = this.overrideBlockTexture; + } + + double var11 = (double)var10.getMinU(); + double var13 = (double)var10.getMinV(); + double var15 = (double)var10.getMaxU(); + double var17 = (double)var10.getMaxV(); + double var19 = p_147795_3_ + 0.5D - 0.25D; + double var21 = p_147795_3_ + 0.5D + 0.25D; + double var23 = p_147795_7_ + 0.5D - 0.5D; + double var25 = p_147795_7_ + 0.5D + 0.5D; + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var23, var11, var13); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var23, var11, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var25, var15, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var25, var15, var13); + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var25, var11, var13); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var25, var11, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var23, var15, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var23, var15, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var25, var11, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var25, var11, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var23, var15, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var23, var15, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var23, var11, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var23, var11, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var25, var15, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var25, var15, var13); + var19 = p_147795_3_ + 0.5D - 0.5D; + var21 = p_147795_3_ + 0.5D + 0.5D; + var23 = p_147795_7_ + 0.5D - 0.25D; + var25 = p_147795_7_ + 0.5D + 0.25D; + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var23, var11, var13); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var23, var11, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var23, var15, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var23, var15, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var23, var11, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var23, var11, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var23, var15, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var23, var15, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var25, var11, var13); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var25, var11, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var25, var15, var17); + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var25, var15, var13); + var9.addVertexWithUV(var19, p_147795_5_ + 1.0D, var25, var11, var13); + var9.addVertexWithUV(var19, p_147795_5_ + 0.0D, var25, var11, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 0.0D, var25, var15, var17); + var9.addVertexWithUV(var21, p_147795_5_ + 1.0D, var25, var15, var13); + } + + public boolean renderBlockFluids(Block p_147721_1_, int p_147721_2_, int p_147721_3_, int p_147721_4_) { + Tessellator var5 = Tessellator.instance; + int var6 = CustomColorizer.getFluidColor(p_147721_1_, this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + boolean var10 = p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_ + 1, p_147721_4_, 1); + boolean var11 = p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_ - 1, p_147721_4_, 0); + boolean[] var12 = new boolean[] {p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_ - 1, 2), p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_ + 1, 3), p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_ - 1, p_147721_3_, p_147721_4_, 4), p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_ + 1, p_147721_3_, p_147721_4_, 5)}; + + if (!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3]) { + return false; + } else { + boolean var13 = false; + float var14 = 0.5F; + float var15 = 1.0F; + float var16 = 0.8F; + float var17 = 0.6F; + + if (Config.isShaders()) { + var14 = this.lightLevel05; + var16 = this.lightLevel08; + var17 = this.lightLevel06; + } + + double var18 = 0.0D; + double var20 = 1.0D; + Material var22 = p_147721_1_.getMaterial(); + int var23 = this.blockAccess.getBlockMetadata(p_147721_2_, p_147721_3_, p_147721_4_); + double var24 = (double)this.getFluidHeight(p_147721_2_, p_147721_3_, p_147721_4_, var22); + double var26 = (double)this.getFluidHeight(p_147721_2_, p_147721_3_, p_147721_4_ + 1, var22); + double var28 = (double)this.getFluidHeight(p_147721_2_ + 1, p_147721_3_, p_147721_4_ + 1, var22); + double var30 = (double)this.getFluidHeight(p_147721_2_ + 1, p_147721_3_, p_147721_4_, var22); + double var32 = 0.0010000000474974513D; + float var52; + float var53; + float var54; + double var39; + double var41; + double var43; + double var45; + double var47; + double var49; + + if (this.renderAllFaces || var10) { + var13 = true; + IIcon var57 = this.getBlockIconFromSideAndMetadata(p_147721_1_, 1, var23); + float var58 = (float)BlockLiquid.func_149802_a(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_, var22); + + if (var58 > -999.0F) { + var57 = this.getBlockIconFromSideAndMetadata(p_147721_1_, 2, var23); + } + + var24 -= var32; + var26 -= var32; + var28 -= var32; + var30 -= var32; + double var37; + double var51; + + if (var58 < -999.0F) { + var37 = (double)var57.getInterpolatedU(0.0D); + var45 = (double)var57.getInterpolatedV(0.0D); + var39 = var37; + var47 = (double)var57.getInterpolatedV(16.0D); + var41 = (double)var57.getInterpolatedU(16.0D); + var49 = var47; + var43 = var41; + var51 = var45; + } else { + var52 = MathHelper.sin(var58) * 0.25F; + var53 = MathHelper.cos(var58) * 0.25F; + var54 = 8.0F; + var37 = (double)var57.getInterpolatedU((double)(8.0F + (-var53 - var52) * 16.0F)); + var45 = (double)var57.getInterpolatedV((double)(8.0F + (-var53 + var52) * 16.0F)); + var39 = (double)var57.getInterpolatedU((double)(8.0F + (-var53 + var52) * 16.0F)); + var47 = (double)var57.getInterpolatedV((double)(8.0F + (var53 + var52) * 16.0F)); + var41 = (double)var57.getInterpolatedU((double)(8.0F + (var53 + var52) * 16.0F)); + var49 = (double)var57.getInterpolatedV((double)(8.0F + (var53 - var52) * 16.0F)); + var43 = (double)var57.getInterpolatedU((double)(8.0F + (var53 - var52) * 16.0F)); + var51 = (double)var57.getInterpolatedV((double)(8.0F + (-var53 - var52) * 16.0F)); + } + + var5.setBrightness(p_147721_1_.getBlockBrightness(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_)); + var5.setColorOpaque_F(var15 * var7, var15 * var8, var15 * var9); + double var56 = 3.90625E-5D; + var5.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + var24, (double)(p_147721_4_ + 0), var37 + var56, var45 + var56); + var5.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + var26, (double)(p_147721_4_ + 1), var39 + var56, var47 - var56); + var5.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + var28, (double)(p_147721_4_ + 1), var41 - var56, var49 - var56); + var5.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + var30, (double)(p_147721_4_ + 0), var43 - var56, var51 + var56); + var5.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + var24, (double)(p_147721_4_ + 0), var37 + var56, var45 + var56); + var5.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + var30, (double)(p_147721_4_ + 0), var43 - var56, var51 + var56); + var5.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + var28, (double)(p_147721_4_ + 1), var41 - var56, var49 - var56); + var5.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + var26, (double)(p_147721_4_ + 1), var39 + var56, var47 - var56); + } + + if (this.renderAllFaces || var11) { + var5.setBrightness(p_147721_1_.getBlockBrightness(this.blockAccess, p_147721_2_, p_147721_3_ - 1, p_147721_4_)); + var5.setColorOpaque_F(var14 * var7, var14 * var8, var14 * var9); + this.renderFaceYNeg(p_147721_1_, (double)p_147721_2_, (double)p_147721_3_ + var32, (double)p_147721_4_, this.getBlockIconFromSide(p_147721_1_, 0)); + var13 = true; + } + + for (int var571 = 0; var571 < 4; ++var571) { + int var581 = p_147721_2_; + int var591 = p_147721_4_; + + if (var571 == 0) { + var591 = p_147721_4_ - 1; + } + + if (var571 == 1) { + ++var591; + } + + if (var571 == 2) { + var581 = p_147721_2_ - 1; + } + + if (var571 == 3) { + ++var581; + } + + IIcon var59 = this.getBlockIconFromSideAndMetadata(p_147721_1_, var571 + 2, var23); + + if (this.renderAllFaces || var12[var571]) { + if (var571 == 0) { + var39 = var24; + var41 = var30; + var43 = (double)p_147721_2_; + var47 = (double)(p_147721_2_ + 1); + var45 = (double)p_147721_4_ + var32; + var49 = (double)p_147721_4_ + var32; + } else if (var571 == 1) { + var39 = var28; + var41 = var26; + var43 = (double)(p_147721_2_ + 1); + var47 = (double)p_147721_2_; + var45 = (double)(p_147721_4_ + 1) - var32; + var49 = (double)(p_147721_4_ + 1) - var32; + } else if (var571 == 2) { + var39 = var26; + var41 = var24; + var43 = (double)p_147721_2_ + var32; + var47 = (double)p_147721_2_ + var32; + var45 = (double)(p_147721_4_ + 1); + var49 = (double)p_147721_4_; + } else { + var39 = var30; + var41 = var28; + var43 = (double)(p_147721_2_ + 1) - var32; + var47 = (double)(p_147721_2_ + 1) - var32; + var45 = (double)p_147721_4_; + var49 = (double)(p_147721_4_ + 1); + } + + var13 = true; + float var60 = var59.getInterpolatedU(0.0D); + var52 = var59.getInterpolatedU(8.0D); + var53 = var59.getInterpolatedV((1.0D - var39) * 16.0D * 0.5D); + var54 = var59.getInterpolatedV((1.0D - var41) * 16.0D * 0.5D); + float var55 = var59.getInterpolatedV(8.0D); + var5.setBrightness(p_147721_1_.getBlockBrightness(this.blockAccess, var581, p_147721_3_, var591)); + float var61 = 1.0F; + var61 *= var571 < 2 ? var16 : var17; + var5.setColorOpaque_F(var15 * var61 * var7, var15 * var61 * var8, var15 * var61 * var9); + var5.addVertexWithUV(var43, (double)p_147721_3_ + var39, var45, (double)var60, (double)var53); + var5.addVertexWithUV(var47, (double)p_147721_3_ + var41, var49, (double)var52, (double)var54); + var5.addVertexWithUV(var47, (double)(p_147721_3_ + 0), var49, (double)var52, (double)var55); + var5.addVertexWithUV(var43, (double)(p_147721_3_ + 0), var45, (double)var60, (double)var55); + var5.addVertexWithUV(var43, (double)(p_147721_3_ + 0), var45, (double)var60, (double)var55); + var5.addVertexWithUV(var47, (double)(p_147721_3_ + 0), var49, (double)var52, (double)var55); + var5.addVertexWithUV(var47, (double)p_147721_3_ + var41, var49, (double)var52, (double)var54); + var5.addVertexWithUV(var43, (double)p_147721_3_ + var39, var45, (double)var60, (double)var53); + } + } + + this.renderMinY = var18; + this.renderMaxY = var20; + return var13; + } + } + + public float getFluidHeight(int p_147729_1_, int p_147729_2_, int p_147729_3_, Material p_147729_4_) { + int var5 = 0; + float var6 = 0.0F; + + for (int var7 = 0; var7 < 4; ++var7) { + int var8 = p_147729_1_ - (var7 & 1); + int var10 = p_147729_3_ - (var7 >> 1 & 1); + + if (this.blockAccess.getBlock(var8, p_147729_2_ + 1, var10).getMaterial() == p_147729_4_) { + return 1.0F; + } + + Material var11 = this.blockAccess.getBlock(var8, p_147729_2_, var10).getMaterial(); + + if (var11 == p_147729_4_) { + int var12 = this.blockAccess.getBlockMetadata(var8, p_147729_2_, var10); + + if (var12 >= 8 || var12 == 0) { + var6 += BlockLiquid.func_149801_b(var12) * 10.0F; + var5 += 10; + } + + var6 += BlockLiquid.func_149801_b(var12); + ++var5; + } else if (!var11.isSolid()) { + ++var6; + ++var5; + } + } + + return 1.0F - var6 / (float)var5; + } + + public void renderBlockSandFalling(Block p_147749_1_, World p_147749_2_, int p_147749_3_, int p_147749_4_, int p_147749_5_, int p_147749_6_) { + float var7 = 0.5F; + float var8 = 1.0F; + float var9 = 0.8F; + float var10 = 0.6F; + + if (Config.isShaders()) { + var7 = this.lightLevel05; + var9 = this.lightLevel08; + var10 = this.lightLevel06; + } + + Tessellator var11 = Tessellator.instance; + var11.startDrawingQuads(); + var11.setBrightness(p_147749_1_.getBlockBrightness(p_147749_2_, p_147749_3_, p_147749_4_, p_147749_5_)); + var11.setColorOpaque_F(var7, var7, var7); + this.renderFaceYNeg(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 0, p_147749_6_)); + var11.setColorOpaque_F(var8, var8, var8); + this.renderFaceYPos(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 1, p_147749_6_)); + var11.setColorOpaque_F(var9, var9, var9); + this.renderFaceZNeg(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 2, p_147749_6_)); + var11.setColorOpaque_F(var9, var9, var9); + this.renderFaceZPos(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 3, p_147749_6_)); + var11.setColorOpaque_F(var10, var10, var10); + this.renderFaceXNeg(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 4, p_147749_6_)); + var11.setColorOpaque_F(var10, var10, var10); + this.renderFaceXPos(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 5, p_147749_6_)); + var11.draw(); + } + + /** + * Renders a standard cube block at the given coordinates + */ + public boolean renderStandardBlock(Block p_147784_1_, int p_147784_2_, int p_147784_3_, int p_147784_4_) { + int var5 = CustomColorizer.getColorMultiplier(p_147784_1_, this.blockAccess, p_147784_2_, p_147784_3_, p_147784_4_); + float var6 = (float)(var5 >> 16 & 255) / 255.0F; + float var7 = (float)(var5 >> 8 & 255) / 255.0F; + float var8 = (float)(var5 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; + var6 = var9; + var7 = var10; + var8 = var11; + } + + return Minecraft.isAmbientOcclusionEnabled() && p_147784_1_.getLightValue() == 0 ? (this.partialRenderBounds ? this.renderStandardBlockWithAmbientOcclusionPartial(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, var6, var7, var8) : this.renderStandardBlockWithAmbientOcclusion(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, var6, var7, var8)) : this.renderStandardBlockWithColorMultiplier(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, var6, var7, var8); + } + + public boolean renderBlockLog(Block p_147742_1_, int p_147742_2_, int p_147742_3_, int p_147742_4_) { + int var5 = this.blockAccess.getBlockMetadata(p_147742_2_, p_147742_3_, p_147742_4_); + int var6 = var5 & 12; + + if (var6 == 4) { + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + } else if (var6 == 8) { + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + } + + boolean var7 = this.renderStandardBlock(p_147742_1_, p_147742_2_, p_147742_3_, p_147742_4_); + this.uvRotateSouth = 0; + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + return var7; + } + + public boolean renderBlockQuartz(Block p_147779_1_, int p_147779_2_, int p_147779_3_, int p_147779_4_) { + int var5 = this.blockAccess.getBlockMetadata(p_147779_2_, p_147779_3_, p_147779_4_); + + if (var5 == 3) { + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + } else if (var5 == 4) { + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + } + + boolean var6 = this.renderStandardBlock(p_147779_1_, p_147779_2_, p_147779_3_, p_147779_4_); + this.uvRotateSouth = 0; + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + return var6; + } + + public boolean renderStandardBlockWithAmbientOcclusion(Block p_147751_1_, int p_147751_2_, int p_147751_3_, int p_147751_4_, float p_147751_5_, float p_147751_6_, float p_147751_7_) { + this.enableAO = true; + boolean defaultTexture = Tessellator.instance.defaultTexture; + boolean betterGrass = Config.isBetterGrass() && defaultTexture; + boolean simpleAO = p_147751_1_ == Blocks.glass; + boolean var8 = false; + float var9 = 0.0F; + float var10 = 0.0F; + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = true; + int var14 = -1; + Tessellator var15 = Tessellator.instance; + var15.setBrightness(983055); + + if (p_147751_1_ == Blocks.grass) { + var13 = false; + } else if (this.hasOverrideBlockTexture()) { + var13 = false; + } + + boolean var16; + boolean var17; + boolean var18; + boolean var19; + int var20; + float var21; + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_, 0)) { + if (this.renderMinY <= 0.0D) { + --p_147751_3_; + } + + this.aoBrightnessXYNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessYZNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchXYNN = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchYZNN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoLightValueScratchYZNP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoLightValueScratchXYPN = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + var16 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).getCanBlockGrass(); + + if (!var19 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; + } else { + this.aoLightValueScratchXYZNNN = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXYZNNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!var18 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; + } else { + this.aoLightValueScratchXYZNNP = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYZNNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + } + + if (!var19 && !var16) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; + } else { + this.aoLightValueScratchXYZPNN = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXYZPNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!var18 && !var16) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; + } else { + this.aoLightValueScratchXYZPNP = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYZPNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + } + + if (this.renderMinY <= 0.0D) { + ++p_147751_3_; + } + + if (var14 < 0) { + var14 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + + if (this.renderMinY <= 0.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_).isOpaqueCube()) { + var20 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; + var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; + var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; + var10 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + var21 + this.aoLightValueScratchYZNN) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, var20); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); + + if (simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.brightnessTopLeft = this.brightnessTopRight = this.brightnessBottomRight = this.brightnessBottomLeft = var20; + } + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * this.lightLevel05; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * this.lightLevel05; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * this.lightLevel05; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel05; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel05; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel05; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + this.renderFaceYNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 0)); + var8 = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_, 1)) { + if (this.renderMaxY >= 1.0D) { + ++p_147751_3_; + } + + this.aoBrightnessXYNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessXYPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessYZPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoLightValueScratchXYNP = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchXYPP = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchYZPN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoLightValueScratchYZPP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + var16 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).getCanBlockGrass(); + + if (!var19 && !var17) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; + } else { + this.aoLightValueScratchXYZNPN = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXYZNPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!var19 && !var16) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; + } else { + this.aoLightValueScratchXYZPPN = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXYZPPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!var18 && !var17) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; + } else { + this.aoLightValueScratchXYZNPP = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYZNPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + } + + if (!var18 && !var16) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; + } else { + this.aoLightValueScratchXYZPPP = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYZPPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + } + + if (this.renderMaxY >= 1.0D) { + --p_147751_3_; + } + + if (var14 < 0) { + var14 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + + if (this.renderMaxY >= 1.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_).isOpaqueCube()) { + var20 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; + var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; + var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; + var11 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, var20); + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); + + if (simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.brightnessTopLeft = this.brightnessTopRight = this.brightnessBottomRight = this.brightnessBottomLeft = var20; + } + + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_; + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + this.renderFaceYPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 1)); + var8 = true; + } + + IIcon var22; + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1, 2)) { + if (this.renderMinZ <= 0.0D) { + --p_147751_4_; + } + + this.aoLightValueScratchXZNN = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchYZNN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoLightValueScratchYZPN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.aoLightValueScratchXZPN = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoBrightnessXZNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessYZPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXZPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + var16 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).getCanBlockGrass(); + + if (!var17 && !var19) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNNN = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXYZNNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!var17 && !var18) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNPN = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXYZNPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + } + + if (!var16 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPNN = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXYZPNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!var16 && !var18) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPPN = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXYZPPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + } + + if (this.renderMinZ <= 0.0D) { + ++p_147751_4_; + } + + if (var14 < 0) { + var14 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + + if (this.renderMinZ <= 0.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ - 1).isOpaqueCube()) { + var20 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + var9 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; + var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; + var11 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; + var12 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + var21) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, var20); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, var20); + + if (simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.brightnessTopLeft = this.brightnessTopRight = this.brightnessBottomRight = this.brightnessBottomLeft = var20; + } + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * this.lightLevel08; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel08; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var22 = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 2); + + if (betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 2, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.renderFaceZNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + + if (defaultTexture && fancyGrass && var22 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceZNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1, 3)) { + if (this.renderMaxZ >= 1.0D) { + ++p_147751_4_; + } + + this.aoLightValueScratchXZNP = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchXZPP = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchYZNP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoLightValueScratchYZPP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXZNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessXZPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessYZPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var16 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).getCanBlockGrass(); + + if (!var17 && !var19) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNNP = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXYZNNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!var17 && !var18) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNPP = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXYZNPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + } + + if (!var16 && !var19) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPNP = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXYZPNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPPP = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXYZPPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + } + + if (this.renderMaxZ >= 1.0D) { + --p_147751_4_; + } + + if (var14 < 0) { + var14 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + + if (this.renderMaxZ >= 1.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ + 1).isOpaqueCube()) { + var20 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + var9 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; + var12 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; + var11 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; + var10 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + var21) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, var20); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, var20); + + if (simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.brightnessTopLeft = this.brightnessTopRight = this.brightnessBottomRight = this.brightnessBottomLeft = var20; + } + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * this.lightLevel08; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel08; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var22 = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 3); + + if (betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 3, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.renderFaceZPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + + if (defaultTexture && fancyGrass && var22 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceZPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_, 4)) { + if (this.renderMinX <= 0.0D) { + --p_147751_2_; + } + + this.aoLightValueScratchXYNN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoLightValueScratchXZNN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoLightValueScratchXZNP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoLightValueScratchXYNP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXYNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXZNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXZNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var16 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + + if (!var18 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNNN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + this.aoBrightnessXYZNNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + } + + if (!var19 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNNP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + this.aoBrightnessXYZNNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + } + + if (!var18 && !var16) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNPN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + this.aoBrightnessXYZNPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + } + + if (!var19 && !var16) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNPP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + this.aoBrightnessXYZNPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + } + + if (this.renderMinX <= 0.0D) { + ++p_147751_2_; + } + + if (var14 < 0) { + var14 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + + if (this.renderMinX <= 0.0D || !this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_).isOpaqueCube()) { + var20 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + var12 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; + var9 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; + var10 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; + var11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + var21) / 4.0F; + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, var20); + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, var20); + + if (simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.brightnessTopLeft = this.brightnessTopRight = this.brightnessBottomRight = this.brightnessBottomLeft = var20; + } + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * this.lightLevel06; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel06; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var22 = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 4); + + if (betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 4, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.renderFaceXNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + + if (defaultTexture && fancyGrass && var22 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceXNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_, 5)) { + if (this.renderMaxX >= 1.0D) { + ++p_147751_2_; + } + + this.aoLightValueScratchXYPN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoLightValueScratchXZPN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoLightValueScratchXZPP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoLightValueScratchXYPP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXYPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXZPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXZPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var16 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + + if (!var17 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPNN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + this.aoBrightnessXYZPNN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + } + + if (!var17 && !var18) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPNP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + this.aoBrightnessXYZPNP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + } + + if (!var16 && !var19) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPPN = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + this.aoBrightnessXYZPPN = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + } + + if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPPP = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + this.aoBrightnessXYZPPP = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + } + + if (this.renderMaxX >= 1.0D) { + --p_147751_2_; + } + + if (var14 < 0) { + var14 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + + if (this.renderMaxX >= 1.0D || !this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_).isOpaqueCube()) { + var20 = p_147751_1_.getBlockBrightness(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + var9 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; + var10 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; + var11 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; + var12 = (var21 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, var20); + + if (simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.brightnessTopLeft = this.brightnessTopRight = this.brightnessBottomRight = this.brightnessBottomLeft = var20; + } + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * this.lightLevel06; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel06; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var22 = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 5); + + if (betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 5, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.renderFaceXPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + + if (defaultTexture && fancyGrass && var22 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceXPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + this.enableAO = false; + return var8; + } + + public boolean renderStandardBlockWithAmbientOcclusionPartial(Block p_147808_1_, int p_147808_2_, int p_147808_3_, int p_147808_4_, float p_147808_5_, float p_147808_6_, float p_147808_7_) { + this.enableAO = true; + boolean var8 = false; + float var9 = 0.0F; + float var10 = 0.0F; + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = true; + int var14 = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_); + Tessellator var15 = Tessellator.instance; + var15.setBrightness(983055); + + if (p_147808_1_ == Blocks.grass) { + var13 = false; + } else if (this.hasOverrideBlockTexture()) { + var13 = false; + } + + boolean var16; + boolean var17; + boolean var18; + boolean var19; + int var20; + float var21; + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_, 0)) { + if (this.renderMinY <= 0.0D) { + --p_147808_3_; + } + + this.aoBrightnessXYNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessYZNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchXYNN = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchYZNN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoLightValueScratchYZNP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoLightValueScratchXYPN = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + var16 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).getCanBlockGrass(); + + if (!var19 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; + } else { + this.aoLightValueScratchXYZNNN = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXYZNNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!var18 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; + } else { + this.aoLightValueScratchXYZNNP = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYZNNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + } + + if (!var19 && !var16) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; + } else { + this.aoLightValueScratchXYZPNN = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXYZPNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!var18 && !var16) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; + } else { + this.aoLightValueScratchXYZPNP = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYZPNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + } + + if (this.renderMinY <= 0.0D) { + ++p_147808_3_; + } + + var20 = var14; + + if (this.renderMinY <= 0.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_).isOpaqueCube()) { + var20 = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; + var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; + var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; + var10 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + var21 + this.aoLightValueScratchYZNN) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, var20); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * this.lightLevel05; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * this.lightLevel05; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * this.lightLevel05; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel05; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel05; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel05; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + this.renderFaceYNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 0)); + var8 = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_, 1)) { + if (this.renderMaxY >= 1.0D) { + ++p_147808_3_; + } + + this.aoBrightnessXYNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessXYPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessYZPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoLightValueScratchXYNP = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchXYPP = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchYZPN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoLightValueScratchYZPP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + var16 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).getCanBlockGrass(); + + if (!var19 && !var17) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; + } else { + this.aoLightValueScratchXYZNPN = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXYZNPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!var19 && !var16) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; + } else { + this.aoLightValueScratchXYZPPN = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXYZPPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!var18 && !var17) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; + } else { + this.aoLightValueScratchXYZNPP = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYZNPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + } + + if (!var18 && !var16) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; + } else { + this.aoLightValueScratchXYZPPP = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYZPPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + } + + if (this.renderMaxY >= 1.0D) { + --p_147808_3_; + } + + var20 = var14; + + if (this.renderMaxY >= 1.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_).isOpaqueCube()) { + var20 = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; + var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; + var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; + var11 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, var20); + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_; + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + this.renderFaceYPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 1)); + var8 = true; + } + + float var22; + float var23; + float var24; + float var25; + int var26; + int var27; + int var28; + int var29; + IIcon var30; + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1, 2)) { + if (this.renderMinZ <= 0.0D) { + --p_147808_4_; + } + + this.aoLightValueScratchXZNN = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchYZNN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoLightValueScratchYZPN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.aoLightValueScratchXZPN = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoBrightnessXZNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessYZPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXZPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + var16 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).getCanBlockGrass(); + + if (!var17 && !var19) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNNN = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXYZNNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!var17 && !var18) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNPN = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXYZNPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + } + + if (!var16 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPNN = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXYZPNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!var16 && !var18) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPPN = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXYZPPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + } + + if (this.renderMinZ <= 0.0D) { + ++p_147808_4_; + } + + var20 = var14; + + if (this.renderMinZ <= 0.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ - 1).isOpaqueCube()) { + var20 = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + var22 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; + var23 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; + var24 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; + var25 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + var21) / 4.0F; + var9 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMinX) + (double)var23 * this.renderMaxY * this.renderMinX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMinX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); + var10 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMaxY * this.renderMaxX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); + var11 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMinY * this.renderMaxX + (double)var24 * (1.0D - this.renderMinY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); + var12 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMinX) + (double)var23 * this.renderMinY * this.renderMinX + (double)var24 * (1.0D - this.renderMinY) * this.renderMinX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); + var26 = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); + var27 = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, var20); + var28 = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, var20); + var29 = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, var20); + this.brightnessTopLeft = this.mixAoBrightness(var26, var27, var28, var29, this.renderMaxY * (1.0D - this.renderMinX), this.renderMaxY * this.renderMinX, (1.0D - this.renderMaxY) * this.renderMinX, (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); + this.brightnessBottomLeft = this.mixAoBrightness(var26, var27, var28, var29, this.renderMaxY * (1.0D - this.renderMaxX), this.renderMaxY * this.renderMaxX, (1.0D - this.renderMaxY) * this.renderMaxX, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); + this.brightnessBottomRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMaxX), this.renderMinY * this.renderMaxX, (1.0D - this.renderMinY) * this.renderMaxX, (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); + this.brightnessTopRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMinX), this.renderMinY * this.renderMinX, (1.0D - this.renderMinY) * this.renderMinX, (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * this.lightLevel08; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel08; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var30 = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 2); + this.renderFaceZNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + + if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceZNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1, 3)) { + if (this.renderMaxZ >= 1.0D) { + ++p_147808_4_; + } + + this.aoLightValueScratchXZNP = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchXZPP = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchYZNP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoLightValueScratchYZPP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXZNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessXZPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessYZPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var16 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).getCanBlockGrass(); + + if (!var17 && !var19) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNNP = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXYZNNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!var17 && !var18) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNPP = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXYZNPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + } + + if (!var16 && !var19) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPNP = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXYZPNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPPP = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXYZPPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + } + + if (this.renderMaxZ >= 1.0D) { + --p_147808_4_; + } + + var20 = var14; + + if (this.renderMaxZ >= 1.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ + 1).isOpaqueCube()) { + var20 = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + var22 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; + var23 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; + var24 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; + var25 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + var21) / 4.0F; + var9 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMinX) + (double)var23 * this.renderMaxY * this.renderMinX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMinX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); + var10 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMinX) + (double)var23 * this.renderMinY * this.renderMinX + (double)var24 * (1.0D - this.renderMinY) * this.renderMinX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); + var11 = (float)((double)var22 * this.renderMinY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMinY * this.renderMaxX + (double)var24 * (1.0D - this.renderMinY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); + var12 = (float)((double)var22 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)var23 * this.renderMaxY * this.renderMaxX + (double)var24 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); + var26 = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, var20); + var27 = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, var20); + var28 = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); + var29 = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, var20); + this.brightnessTopLeft = this.mixAoBrightness(var26, var29, var28, var27, this.renderMaxY * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * this.renderMinX, this.renderMaxY * this.renderMinX); + this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * this.renderMinX, this.renderMinY * this.renderMinX); + this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * this.renderMaxX, this.renderMinY * this.renderMaxX); + this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMaxY * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * this.renderMaxX, this.renderMaxY * this.renderMaxX); + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * this.lightLevel08; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel08; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel08; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel08; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var30 = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 3); + this.renderFaceZPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + + if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceZPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_, 4)) { + if (this.renderMinX <= 0.0D) { + --p_147808_2_; + } + + this.aoLightValueScratchXYNN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoLightValueScratchXZNN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoLightValueScratchXZNP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoLightValueScratchXYNP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXYNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXZNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXZNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var16 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + + if (!var18 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNNN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + this.aoBrightnessXYZNNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + } + + if (!var19 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNNP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + this.aoBrightnessXYZNNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + } + + if (!var18 && !var16) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { + this.aoLightValueScratchXYZNPN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + this.aoBrightnessXYZNPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + } + + if (!var19 && !var16) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { + this.aoLightValueScratchXYZNPP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + this.aoBrightnessXYZNPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + } + + if (this.renderMinX <= 0.0D) { + ++p_147808_2_; + } + + var20 = var14; + + if (this.renderMinX <= 0.0D || !this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_).isOpaqueCube()) { + var20 = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + var22 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; + var23 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; + var24 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; + var25 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + var21) / 4.0F; + var9 = (float)((double)var23 * this.renderMaxY * this.renderMaxZ + (double)var24 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)var22 * (1.0D - this.renderMaxY) * this.renderMaxZ); + var10 = (float)((double)var23 * this.renderMaxY * this.renderMinZ + (double)var24 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)var25 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)var22 * (1.0D - this.renderMaxY) * this.renderMinZ); + var11 = (float)((double)var23 * this.renderMinY * this.renderMinZ + (double)var24 * this.renderMinY * (1.0D - this.renderMinZ) + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)var22 * (1.0D - this.renderMinY) * this.renderMinZ); + var12 = (float)((double)var23 * this.renderMinY * this.renderMaxZ + (double)var24 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)var25 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)var22 * (1.0D - this.renderMinY) * this.renderMaxZ); + var26 = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, var20); + var27 = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, var20); + var28 = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, var20); + var29 = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, var20); + this.brightnessTopLeft = this.mixAoBrightness(var27, var28, var29, var26, this.renderMaxY * this.renderMaxZ, this.renderMaxY * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * this.renderMaxZ); + this.brightnessBottomLeft = this.mixAoBrightness(var27, var28, var29, var26, this.renderMaxY * this.renderMinZ, this.renderMaxY * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * this.renderMinZ); + this.brightnessBottomRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMinZ, this.renderMinY * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * this.renderMinZ); + this.brightnessTopRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMaxZ, this.renderMinY * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * this.renderMaxZ); + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * this.lightLevel06; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel06; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var30 = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 4); + this.renderFaceXNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + + if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceXNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_, 5)) { + if (this.renderMaxX >= 1.0D) { + ++p_147808_2_; + } + + this.aoLightValueScratchXYPN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoLightValueScratchXZPN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoLightValueScratchXZPP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoLightValueScratchXYPP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXYPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXZPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXZPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var16 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + var17 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + var18 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + var19 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + + if (!var17 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPNN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + this.aoBrightnessXYZPNN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + } + + if (!var17 && !var18) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPNP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + this.aoBrightnessXYZPNP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + } + + if (!var16 && !var19) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { + this.aoLightValueScratchXYZPPN = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + this.aoBrightnessXYZPPN = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + } + + if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { + this.aoLightValueScratchXYZPPP = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + this.aoBrightnessXYZPPP = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + } + + if (this.renderMaxX >= 1.0D) { + --p_147808_2_; + } + + var20 = var14; + + if (this.renderMaxX >= 1.0D || !this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_).isOpaqueCube()) { + var20 = p_147808_1_.getBlockBrightness(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + var22 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; + var23 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; + var24 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; + var25 = (var21 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F; + var9 = (float)((double)var22 * (1.0D - this.renderMinY) * this.renderMaxZ + (double)var23 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)var24 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)var25 * this.renderMinY * this.renderMaxZ); + var10 = (float)((double)var22 * (1.0D - this.renderMinY) * this.renderMinZ + (double)var23 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)var24 * this.renderMinY * (1.0D - this.renderMinZ) + (double)var25 * this.renderMinY * this.renderMinZ); + var11 = (float)((double)var22 * (1.0D - this.renderMaxY) * this.renderMinZ + (double)var23 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)var24 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)var25 * this.renderMaxY * this.renderMinZ); + var12 = (float)((double)var22 * (1.0D - this.renderMaxY) * this.renderMaxZ + (double)var23 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)var24 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)var25 * this.renderMaxY * this.renderMaxZ); + var26 = this.getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); + var27 = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, var20); + var28 = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, var20); + var29 = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, var20); + this.brightnessTopLeft = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMinY) * this.renderMaxZ, (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), this.renderMinY * (1.0D - this.renderMaxZ), this.renderMinY * this.renderMaxZ); + this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMinY) * this.renderMinZ, (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), this.renderMinY * (1.0D - this.renderMinZ), this.renderMinY * this.renderMinZ); + this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMinZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), this.renderMaxY * (1.0D - this.renderMinZ), this.renderMaxY * this.renderMinZ); + this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMaxZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), this.renderMaxY * (1.0D - this.renderMaxZ), this.renderMaxY * this.renderMaxZ); + + if (var13) { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * this.lightLevel06; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = this.lightLevel06; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = this.lightLevel06; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = this.lightLevel06; + } + + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; + this.colorRedBottomLeft *= var10; + this.colorGreenBottomLeft *= var10; + this.colorBlueBottomLeft *= var10; + this.colorRedBottomRight *= var11; + this.colorGreenBottomRight *= var11; + this.colorBlueBottomRight *= var11; + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; + var30 = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 5); + this.renderFaceXPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + + if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceXPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + this.enableAO = false; + return var8; + } + + public int getAoBrightness(int p_147778_1_, int p_147778_2_, int p_147778_3_, int p_147778_4_) { + if (p_147778_1_ == 0) { + p_147778_1_ = p_147778_4_; + } + + if (p_147778_2_ == 0) { + p_147778_2_ = p_147778_4_; + } + + if (p_147778_3_ == 0) { + p_147778_3_ = p_147778_4_; + } + + return p_147778_1_ + p_147778_2_ + p_147778_3_ + p_147778_4_ >> 2 & 16711935; + } + + public int mixAoBrightness(int p_147727_1_, int p_147727_2_, int p_147727_3_, int p_147727_4_, double p_147727_5_, double p_147727_7_, double p_147727_9_, double p_147727_11_) { + int var13 = (int)((double)(p_147727_1_ >> 16 & 255) * p_147727_5_ + (double)(p_147727_2_ >> 16 & 255) * p_147727_7_ + (double)(p_147727_3_ >> 16 & 255) * p_147727_9_ + (double)(p_147727_4_ >> 16 & 255) * p_147727_11_) & 255; + int var14 = (int)((double)(p_147727_1_ & 255) * p_147727_5_ + (double)(p_147727_2_ & 255) * p_147727_7_ + (double)(p_147727_3_ & 255) * p_147727_9_ + (double)(p_147727_4_ & 255) * p_147727_11_) & 255; + return var13 << 16 | var14; + } + + public boolean renderStandardBlockWithColorMultiplier(Block p_147736_1_, int p_147736_2_, int p_147736_3_, int p_147736_4_, float p_147736_5_, float p_147736_6_, float p_147736_7_) { + this.enableAO = false; + boolean defaultTexture = Tessellator.instance.defaultTexture; + boolean betterGrass = Config.isBetterGrass() && defaultTexture; + Tessellator var8 = Tessellator.instance; + boolean var9 = false; + int var26 = -1; + float var27; + float var13; + float var19; + float var22; + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_, 0)) { + if (var26 < 0) { + var26 = p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var27 = this.lightLevel05; + var13 = var27; + var19 = var27; + var22 = var27; + + if (p_147736_1_ != Blocks.grass) { + var13 = var27 * p_147736_5_; + var19 = var27 * p_147736_6_; + var22 = var27 * p_147736_7_; + } + + var8.setBrightness(this.renderMinY > 0.0D ? var26 : p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_)); + var8.setColorOpaque_F(var13, var19, var22); + this.renderFaceYNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 0)); + var9 = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_, 1)) { + if (var26 < 0) { + var26 = p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var27 = 1.0F; + var13 = var27 * p_147736_5_; + var19 = var27 * p_147736_6_; + var22 = var27 * p_147736_7_; + var8.setBrightness(this.renderMaxY < 1.0D ? var26 : p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_)); + var8.setColorOpaque_F(var13, var19, var22); + this.renderFaceYPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 1)); + var9 = true; + } + + float var25; + IIcon var271; + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1, 2)) { + if (var26 < 0) { + var26 = p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = this.lightLevel08; + var19 = var13; + var22 = var13; + var25 = var13; + + if (p_147736_1_ != Blocks.grass) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.setBrightness(this.renderMinZ > 0.0D ? var26 : p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1)); + var8.setColorOpaque_F(var19, var22, var25); + var271 = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 2); + + if (betterGrass) { + if (var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 2, var271); + + if (var271 == TextureUtils.iconGrassTop) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if (var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 2); + } + } + + this.renderFaceZNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + + if (defaultTexture && fancyGrass && var271 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.renderFaceZNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1, 3)) { + if (var26 < 0) { + var26 = p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = this.lightLevel08; + var19 = var13; + var22 = var13; + var25 = var13; + + if (p_147736_1_ != Blocks.grass) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.setBrightness(this.renderMaxZ < 1.0D ? var26 : p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1)); + var8.setColorOpaque_F(var19, var22, var25); + var271 = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 3); + + if (betterGrass) { + if (var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 3, var271); + + if (var271 == TextureUtils.iconGrassTop) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if (var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 3); + } + } + + this.renderFaceZPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + + if (defaultTexture && fancyGrass && var271 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.renderFaceZPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_, 4)) { + if (var26 < 0) { + var26 = p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = this.lightLevel06; + var19 = var13; + var22 = var13; + var25 = var13; + + if (p_147736_1_ != Blocks.grass) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.setBrightness(this.renderMinX > 0.0D ? var26 : p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_)); + var8.setColorOpaque_F(var19, var22, var25); + var271 = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 4); + + if (betterGrass) { + if (var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 4, var271); + + if (var271 == TextureUtils.iconGrassTop) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if (var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 4); + } + } + + this.renderFaceXNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + + if (defaultTexture && fancyGrass && var271 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.renderFaceXNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_, 5)) { + if (var26 < 0) { + var26 = p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = this.lightLevel06; + var19 = var13; + var22 = var13; + var25 = var13; + + if (p_147736_1_ != Blocks.grass) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.setBrightness(this.renderMaxX < 1.0D ? var26 : p_147736_1_.getBlockBrightness(this.blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_)); + var8.setColorOpaque_F(var19, var22, var25); + var271 = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 5); + + if (betterGrass) { + if (var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 5, var271); + + if (var271 == TextureUtils.iconGrassTop) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if (var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 5); + } + } + + this.renderFaceXPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + + if (defaultTexture && fancyGrass && var271 == TextureUtils.iconGrassSide && !this.hasOverrideBlockTexture()) { + var8.setColorOpaque_F(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.renderFaceXPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + return var9; + } + + public boolean renderBlockCocoa(BlockCocoa p_147772_1_, int p_147772_2_, int p_147772_3_, int p_147772_4_) { + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147772_1_.getBlockBrightness(this.blockAccess, p_147772_2_, p_147772_3_, p_147772_4_)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); + int var6 = this.blockAccess.getBlockMetadata(p_147772_2_, p_147772_3_, p_147772_4_); + int var7 = BlockDirectional.func_149895_l(var6); + int var8 = BlockCocoa.func_149987_c(var6); + IIcon var9 = p_147772_1_.func_149988_b(var8); + int var10 = 4 + var8 * 2; + int var11 = 5 + var8 * 2; + double var12 = 15.0D - (double)var10; + double var14 = 15.0D; + double var16 = 4.0D; + double var18 = 4.0D + (double)var11; + double var20 = (double)var9.getInterpolatedU(var12); + double var22 = (double)var9.getInterpolatedU(var14); + double var24 = (double)var9.getInterpolatedV(var16); + double var26 = (double)var9.getInterpolatedV(var18); + double var28 = 0.0D; + double var30 = 0.0D; + + switch (var7) { + case 0: + var28 = 8.0D - (double)(var10 / 2); + var30 = 15.0D - (double)var10; + break; + + case 1: + var28 = 1.0D; + var30 = 8.0D - (double)(var10 / 2); + break; + + case 2: + var28 = 8.0D - (double)(var10 / 2); + var30 = 1.0D; + break; + + case 3: + var28 = 15.0D - (double)var10; + var30 = 8.0D - (double)(var10 / 2); + } + + double var32 = (double)p_147772_2_ + var28 / 16.0D; + double var34 = (double)p_147772_2_ + (var28 + (double)var10) / 16.0D; + double var36 = (double)p_147772_3_ + (12.0D - (double)var11) / 16.0D; + double var38 = (double)p_147772_3_ + 0.75D; + double var40 = (double)p_147772_4_ + var30 / 16.0D; + double var42 = (double)p_147772_4_ + (var30 + (double)var10) / 16.0D; + var5.addVertexWithUV(var32, var36, var40, var20, var26); + var5.addVertexWithUV(var32, var36, var42, var22, var26); + var5.addVertexWithUV(var32, var38, var42, var22, var24); + var5.addVertexWithUV(var32, var38, var40, var20, var24); + var5.addVertexWithUV(var34, var36, var42, var20, var26); + var5.addVertexWithUV(var34, var36, var40, var22, var26); + var5.addVertexWithUV(var34, var38, var40, var22, var24); + var5.addVertexWithUV(var34, var38, var42, var20, var24); + var5.addVertexWithUV(var34, var36, var40, var20, var26); + var5.addVertexWithUV(var32, var36, var40, var22, var26); + var5.addVertexWithUV(var32, var38, var40, var22, var24); + var5.addVertexWithUV(var34, var38, var40, var20, var24); + var5.addVertexWithUV(var32, var36, var42, var20, var26); + var5.addVertexWithUV(var34, var36, var42, var22, var26); + var5.addVertexWithUV(var34, var38, var42, var22, var24); + var5.addVertexWithUV(var32, var38, var42, var20, var24); + int var44 = var10; + + if (var8 >= 2) { + var44 = var10 - 1; + } + + var20 = (double)var9.getMinU(); + var22 = (double)var9.getInterpolatedU((double)var44); + var24 = (double)var9.getMinV(); + var26 = (double)var9.getInterpolatedV((double)var44); + var5.addVertexWithUV(var32, var38, var42, var20, var26); + var5.addVertexWithUV(var34, var38, var42, var22, var26); + var5.addVertexWithUV(var34, var38, var40, var22, var24); + var5.addVertexWithUV(var32, var38, var40, var20, var24); + var5.addVertexWithUV(var32, var36, var40, var20, var24); + var5.addVertexWithUV(var34, var36, var40, var22, var24); + var5.addVertexWithUV(var34, var36, var42, var22, var26); + var5.addVertexWithUV(var32, var36, var42, var20, var26); + var20 = (double)var9.getInterpolatedU(12.0D); + var22 = (double)var9.getMaxU(); + var24 = (double)var9.getMinV(); + var26 = (double)var9.getInterpolatedV(4.0D); + var28 = 8.0D; + var30 = 0.0D; + double var45; + + switch (var7) { + case 0: + var28 = 8.0D; + var30 = 12.0D; + var45 = var20; + var20 = var22; + var22 = var45; + break; + + case 1: + var28 = 0.0D; + var30 = 8.0D; + break; + + case 2: + var28 = 8.0D; + var30 = 0.0D; + break; + + case 3: + var28 = 12.0D; + var30 = 8.0D; + var45 = var20; + var20 = var22; + var22 = var45; + } + + var32 = (double)p_147772_2_ + var28 / 16.0D; + var34 = (double)p_147772_2_ + (var28 + 4.0D) / 16.0D; + var36 = (double)p_147772_3_ + 0.75D; + var38 = (double)p_147772_3_ + 1.0D; + var40 = (double)p_147772_4_ + var30 / 16.0D; + var42 = (double)p_147772_4_ + (var30 + 4.0D) / 16.0D; + + if (var7 != 2 && var7 != 0) { + if (var7 == 1 || var7 == 3) { + var5.addVertexWithUV(var34, var36, var40, var20, var26); + var5.addVertexWithUV(var32, var36, var40, var22, var26); + var5.addVertexWithUV(var32, var38, var40, var22, var24); + var5.addVertexWithUV(var34, var38, var40, var20, var24); + var5.addVertexWithUV(var32, var36, var40, var22, var26); + var5.addVertexWithUV(var34, var36, var40, var20, var26); + var5.addVertexWithUV(var34, var38, var40, var20, var24); + var5.addVertexWithUV(var32, var38, var40, var22, var24); + } + } else { + var5.addVertexWithUV(var32, var36, var40, var22, var26); + var5.addVertexWithUV(var32, var36, var42, var20, var26); + var5.addVertexWithUV(var32, var38, var42, var20, var24); + var5.addVertexWithUV(var32, var38, var40, var22, var24); + var5.addVertexWithUV(var32, var36, var42, var20, var26); + var5.addVertexWithUV(var32, var36, var40, var22, var26); + var5.addVertexWithUV(var32, var38, var40, var22, var24); + var5.addVertexWithUV(var32, var38, var42, var20, var24); + } + + return true; + } + + public boolean renderBlockBeacon(BlockBeacon p_147797_1_, int p_147797_2_, int p_147797_3_, int p_147797_4_) { + float var5 = 0.1875F; + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.glass)); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + this.renderAllFaces = true; + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.obsidian)); + this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)var5, 0.875D); + this.renderStandardBlock(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + IIcon iconBeacon = this.getBlockIcon(Blocks.beacon); + + if (Config.isConnectedTextures()) { + iconBeacon = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_, -1, iconBeacon); + } + + this.setOverrideBlockTexture(iconBeacon); + this.setRenderBounds(0.1875D, (double)var5, 0.1875D, 0.8125D, 0.875D, 0.8125D); + this.renderStandardBlock(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + return true; + } + + public boolean renderBlockCactus(Block p_147755_1_, int p_147755_2_, int p_147755_3_, int p_147755_4_) { + int var5 = p_147755_1_.colorMultiplier(this.blockAccess, p_147755_2_, p_147755_3_, p_147755_4_); + float var6 = (float)(var5 >> 16 & 255) / 255.0F; + float var7 = (float)(var5 >> 8 & 255) / 255.0F; + float var8 = (float)(var5 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; + var6 = var9; + var7 = var10; + var8 = var11; + } + + return this.renderBlockCactusImpl(p_147755_1_, p_147755_2_, p_147755_3_, p_147755_4_, var6, var7, var8); + } + + public boolean renderBlockCactusImpl(Block p_147754_1_, int p_147754_2_, int p_147754_3_, int p_147754_4_, float p_147754_5_, float p_147754_6_, float p_147754_7_) { + Tessellator var8 = Tessellator.instance; + boolean var9 = false; + float var10 = 0.5F; + float var11 = 1.0F; + float var12 = 0.8F; + float var13 = 0.6F; + + if (Config.isShaders()) { + var10 = this.lightLevel05; + var12 = this.lightLevel08; + var13 = this.lightLevel06; + } + + float var14 = var10 * p_147754_5_; + float var15 = var11 * p_147754_5_; + float var16 = var12 * p_147754_5_; + float var17 = var13 * p_147754_5_; + float var18 = var10 * p_147754_6_; + float var19 = var11 * p_147754_6_; + float var20 = var12 * p_147754_6_; + float var21 = var13 * p_147754_6_; + float var22 = var10 * p_147754_7_; + float var23 = var11 * p_147754_7_; + float var24 = var12 * p_147754_7_; + float var25 = var13 * p_147754_7_; + float var26 = 0.0625F; + int var27 = p_147754_1_.getBlockBrightness(this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_); + + if (this.renderAllFaces || p_147754_1_.shouldSideBeRendered(this.blockAccess, p_147754_2_, p_147754_3_ - 1, p_147754_4_, 0)) { + var8.setBrightness(this.renderMinY > 0.0D ? var27 : p_147754_1_.getBlockBrightness(this.blockAccess, p_147754_2_, p_147754_3_ - 1, p_147754_4_)); + var8.setColorOpaque_F(var14, var18, var22); + this.renderFaceYNeg(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 0)); + } + + if (this.renderAllFaces || p_147754_1_.shouldSideBeRendered(this.blockAccess, p_147754_2_, p_147754_3_ + 1, p_147754_4_, 1)) { + var8.setBrightness(this.renderMaxY < 1.0D ? var27 : p_147754_1_.getBlockBrightness(this.blockAccess, p_147754_2_, p_147754_3_ + 1, p_147754_4_)); + var8.setColorOpaque_F(var15, var19, var23); + this.renderFaceYPos(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 1)); + } + + var8.setBrightness(var27); + var8.setColorOpaque_F(var16, var20, var24); + var8.addTranslation(0.0F, 0.0F, var26); + this.renderFaceZNeg(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 2)); + var8.addTranslation(0.0F, 0.0F, -var26); + var8.addTranslation(0.0F, 0.0F, -var26); + this.renderFaceZPos(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 3)); + var8.addTranslation(0.0F, 0.0F, var26); + var8.setColorOpaque_F(var17, var21, var25); + var8.addTranslation(var26, 0.0F, 0.0F); + this.renderFaceXNeg(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 4)); + var8.addTranslation(-var26, 0.0F, 0.0F); + var8.addTranslation(-var26, 0.0F, 0.0F); + this.renderFaceXPos(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 5)); + var8.addTranslation(var26, 0.0F, 0.0F); + return true; + } + + public boolean renderBlockFence(BlockFence p_147735_1_, int p_147735_2_, int p_147735_3_, int p_147735_4_) { + boolean var5 = false; + float var6 = 0.375F; + float var7 = 0.625F; + this.setRenderBounds((double)var6, 0.0D, (double)var6, (double)var7, 1.0D, (double)var7); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + boolean var8 = false; + boolean var9 = false; + + if (p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_ - 1, p_147735_3_, p_147735_4_) || p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_ + 1, p_147735_3_, p_147735_4_)) { + var8 = true; + } + + if (p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ - 1) || p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ + 1)) { + var9 = true; + } + + boolean var10 = p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_ - 1, p_147735_3_, p_147735_4_); + boolean var11 = p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_ + 1, p_147735_3_, p_147735_4_); + boolean var12 = p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ - 1); + boolean var13 = p_147735_1_.func_149826_e(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ + 1); + + if (!var8 && !var9) { + var8 = true; + } + + var6 = 0.4375F; + var7 = 0.5625F; + float var14 = 0.75F; + float var15 = 0.9375F; + float var16 = var10 ? 0.0F : var6; + float var17 = var11 ? 1.0F : var7; + float var18 = var12 ? 0.0F : var6; + float var19 = var13 ? 1.0F : var7; + this.field_152631_f = true; + + if (var8) { + this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + if (var9) { + this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + var14 = 0.375F; + var15 = 0.5625F; + + if (var8) { + this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + if (var9) { + this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + this.field_152631_f = false; + p_147735_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_); + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147735_2_, p_147735_3_, p_147735_4_)) { + this.renderSnow(p_147735_2_, p_147735_3_, p_147735_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + return var5; + } + + public boolean renderBlockWall(BlockWall p_147807_1_, int p_147807_2_, int p_147807_3_, int p_147807_4_) { + boolean var5 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_ - 1, p_147807_3_, p_147807_4_); + boolean var6 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_ + 1, p_147807_3_, p_147807_4_); + boolean var7 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ - 1); + boolean var8 = p_147807_1_.func_150091_e(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ + 1); + boolean var9 = var7 && var8 && !var5 && !var6; + boolean var10 = !var7 && !var8 && var5 && var6; + boolean var11 = this.blockAccess.isAirBlock(p_147807_2_, p_147807_3_ + 1, p_147807_4_); + + if ((var9 || var10) && var11) { + if (var9) { + this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } else { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + } else { + this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + + if (var5) { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if (var6) { + this.setRenderBounds(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if (var7) { + this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if (var8) { + this.setRenderBounds(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + } + + p_147807_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_); + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147807_2_, p_147807_3_, p_147807_4_)) { + this.renderSnow(p_147807_2_, p_147807_3_, p_147807_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + return true; + } + + public boolean renderBlockDragonEgg(BlockDragonEgg p_147802_1_, int p_147802_2_, int p_147802_3_, int p_147802_4_) { + boolean var5 = false; + int var6 = 0; + + for (int var7 = 0; var7 < 8; ++var7) { + byte var8 = 0; + byte var9 = 1; + + if (var7 == 0) { + var8 = 2; + } + + if (var7 == 1) { + var8 = 3; + } + + if (var7 == 2) { + var8 = 4; + } + + if (var7 == 3) { + var8 = 5; + var9 = 2; + } + + if (var7 == 4) { + var8 = 6; + var9 = 3; + } + + if (var7 == 5) { + var8 = 7; + var9 = 5; + } + + if (var7 == 6) { + var8 = 6; + var9 = 2; + } + + if (var7 == 7) { + var8 = 3; + } + + float var10 = (float)var8 / 16.0F; + float var11 = 1.0F - (float)var6 / 16.0F; + float var12 = 1.0F - (float)(var6 + var9) / 16.0F; + var6 += var9; + this.setRenderBounds((double)(0.5F - var10), (double)var12, (double)(0.5F - var10), (double)(0.5F + var10), (double)var11, (double)(0.5F + var10)); + this.renderStandardBlock(p_147802_1_, p_147802_2_, p_147802_3_, p_147802_4_); + } + + var5 = true; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return var5; + } + + public boolean renderBlockFenceGate(BlockFenceGate p_147776_1_, int p_147776_2_, int p_147776_3_, int p_147776_4_) { + boolean var5 = true; + int var6 = this.blockAccess.getBlockMetadata(p_147776_2_, p_147776_3_, p_147776_4_); + boolean var7 = BlockFenceGate.isFenceGateOpen(var6); + int var8 = BlockDirectional.func_149895_l(var6); + float var9 = 0.375F; + float var10 = 0.5625F; + float var11 = 0.75F; + float var12 = 0.9375F; + float var13 = 0.3125F; + float var14 = 1.0F; + + if ((var8 == 2 || var8 == 0) && this.blockAccess.getBlock(p_147776_2_ - 1, p_147776_3_, p_147776_4_) == Blocks.cobblestone_wall && this.blockAccess.getBlock(p_147776_2_ + 1, p_147776_3_, p_147776_4_) == Blocks.cobblestone_wall || (var8 == 3 || var8 == 1) && this.blockAccess.getBlock(p_147776_2_, p_147776_3_, p_147776_4_ - 1) == Blocks.cobblestone_wall && this.blockAccess.getBlock(p_147776_2_, p_147776_3_, p_147776_4_ + 1) == Blocks.cobblestone_wall) { + var9 -= 0.1875F; + var10 -= 0.1875F; + var11 -= 0.1875F; + var12 -= 0.1875F; + var13 -= 0.1875F; + var14 -= 0.1875F; + } + + this.renderAllFaces = true; + float var15; + float var16; + float var17; + float var18; + + if (var8 != 3 && var8 != 1) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.4375F; + var18 = 0.5625F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.875F; + var16 = 1.0F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else { + this.uvRotateTop = 1; + var15 = 0.4375F; + var16 = 0.5625F; + var17 = 0.0F; + var18 = 0.125F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.875F; + var18 = 1.0F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.uvRotateTop = 0; + } + + if (var7) { + if (var8 == 2 || var8 == 0) { + this.uvRotateTop = 1; + } + + float var19; + float var20; + float var21; + + if (var8 == 3) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.5625F; + var20 = 0.8125F; + var21 = 0.9375F; + this.setRenderBounds(0.8125D, (double)var9, 0.0D, 0.9375D, (double)var12, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.8125D, (double)var9, 0.875D, 0.9375D, (double)var12, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)var9, 0.0D, 0.8125D, (double)var10, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)var9, 0.875D, 0.8125D, (double)var10, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)var11, 0.0D, 0.8125D, (double)var12, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)var11, 0.875D, 0.8125D, (double)var12, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else if (var8 == 1) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.0625F; + var20 = 0.1875F; + var21 = 0.4375F; + this.setRenderBounds(0.0625D, (double)var9, 0.0D, 0.1875D, (double)var12, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0625D, (double)var9, 0.875D, 0.1875D, (double)var12, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)var9, 0.0D, 0.4375D, (double)var10, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)var9, 0.875D, 0.4375D, (double)var10, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)var11, 0.0D, 0.4375D, (double)var12, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)var11, 0.875D, 0.4375D, (double)var12, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else if (var8 == 0) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.5625F; + var20 = 0.8125F; + var21 = 0.9375F; + this.setRenderBounds(0.0D, (double)var9, 0.8125D, 0.125D, (double)var12, 0.9375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)var9, 0.8125D, 1.0D, (double)var12, 0.9375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)var9, 0.5625D, 0.125D, (double)var10, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)var9, 0.5625D, 1.0D, (double)var10, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)var11, 0.5625D, 0.125D, (double)var12, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)var11, 0.5625D, 1.0D, (double)var12, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else if (var8 == 2) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.0625F; + var20 = 0.1875F; + var21 = 0.4375F; + this.setRenderBounds(0.0D, (double)var9, 0.0625D, 0.125D, (double)var12, 0.1875D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)var9, 0.0625D, 1.0D, (double)var12, 0.1875D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)var9, 0.1875D, 0.125D, (double)var10, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)var9, 0.1875D, 1.0D, (double)var10, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)var11, 0.1875D, 0.125D, (double)var12, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)var11, 0.1875D, 1.0D, (double)var12, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + } else if (var8 != 3 && var8 != 1) { + var15 = 0.375F; + var16 = 0.5F; + var17 = 0.4375F; + var18 = 0.5625F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.5F; + var16 = 0.625F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.625F; + var16 = 0.875F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.125F; + var16 = 0.375F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else { + this.uvRotateTop = 1; + var15 = 0.4375F; + var16 = 0.5625F; + var17 = 0.375F; + var18 = 0.5F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.5F; + var18 = 0.625F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.625F; + var18 = 0.875F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.125F; + var18 = 0.375F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + + if (Config.isBetterSnow() && this.hasSnowNeighbours(p_147776_2_, p_147776_3_, p_147776_4_)) { + this.renderSnow(p_147776_2_, p_147776_3_, p_147776_4_, Blocks.snow_layer.getBlockBoundsMaxY()); + } + + this.renderAllFaces = false; + this.uvRotateTop = 0; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return var5; + } + + public boolean renderBlockHopper(BlockHopper p_147803_1_, int p_147803_2_, int p_147803_3_, int p_147803_4_) { + Tessellator var5 = Tessellator.instance; + var5.setBrightness(p_147803_1_.getBlockBrightness(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_)); + int var6 = p_147803_1_.colorMultiplier(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var10 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var12 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var10; + var8 = var11; + var9 = var12; + } + + var5.setColorOpaque_F(var7, var8, var9); + return this.renderBlockHopperMetadata(p_147803_1_, p_147803_2_, p_147803_3_, p_147803_4_, this.blockAccess.getBlockMetadata(p_147803_2_, p_147803_3_, p_147803_4_), false); + } + + public boolean renderBlockHopperMetadata(BlockHopper p_147799_1_, int p_147799_2_, int p_147799_3_, int p_147799_4_, int p_147799_5_, boolean p_147799_6_) { + Tessellator var7 = Tessellator.instance; + int var8 = BlockHopper.func_149918_b(p_147799_5_); + double var9 = 0.625D; + this.setRenderBounds(0.0D, var9, 0.0D, 1.0D, 1.0D, 1.0D); + + if (p_147799_6_) { + var7.startDrawingQuads(); + var7.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 0, p_147799_5_)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 1, p_147799_5_)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 2, p_147799_5_)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 3, p_147799_5_)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 4, p_147799_5_)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 5, p_147799_5_)); + var7.draw(); + } else { + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + float var13; + + if (!p_147799_6_) { + var7.setBrightness(p_147799_1_.getBlockBrightness(this.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_)); + int var24 = p_147799_1_.colorMultiplier(this.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_); + float var25 = (float)(var24 >> 16 & 255) / 255.0F; + var13 = (float)(var24 >> 8 & 255) / 255.0F; + float var26 = (float)(var24 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) { + float var15 = (var25 * 30.0F + var13 * 59.0F + var26 * 11.0F) / 100.0F; + float var27 = (var25 * 30.0F + var13 * 70.0F) / 100.0F; + float var17 = (var25 * 30.0F + var26 * 70.0F) / 100.0F; + var25 = var15; + var13 = var27; + var26 = var17; + } + + var7.setColorOpaque_F(var25, var13, var26); + } + + IIcon var241 = BlockHopper.func_149916_e("hopper_outside"); + IIcon var251 = BlockHopper.func_149916_e("hopper_inside"); + var13 = 0.125F; + + if (p_147799_6_) { + var7.startDrawingQuads(); + var7.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147799_1_, (double)(-1.0F + var13), 0.0D, 0.0D, var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147799_1_, (double)(1.0F - var13), 0.0D, 0.0D, var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, (double)(-1.0F + var13), var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, (double)(1.0F - var13), var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147799_1_, 0.0D, -1.0D + var9, 0.0D, var251); + var7.draw(); + } else { + this.renderFaceXPos(p_147799_1_, (double)((float)p_147799_2_ - 1.0F + var13), (double)p_147799_3_, (double)p_147799_4_, var241); + this.renderFaceXNeg(p_147799_1_, (double)((float)p_147799_2_ + 1.0F - var13), (double)p_147799_3_, (double)p_147799_4_, var241); + this.renderFaceZPos(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ - 1.0F + var13), var241); + this.renderFaceZNeg(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ + 1.0F - var13), var241); + this.renderFaceYPos(p_147799_1_, (double)p_147799_2_, (double)((float)p_147799_3_ - 1.0F) + var9, (double)p_147799_4_, var251); + } + + this.setOverrideBlockTexture(var241); + double var261 = 0.25D; + double var271 = 0.25D; + this.setRenderBounds(var261, var271, var261, 1.0D - var261, var9 - 0.002D, 1.0D - var261); + + if (p_147799_6_) { + var7.startDrawingQuads(); + var7.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.draw(); + } else { + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (!p_147799_6_) { + double var20 = 0.375D; + double var22 = 0.25D; + this.setOverrideBlockTexture(var241); + + if (var8 == 0) { + this.setRenderBounds(var20, 0.0D, var20, 1.0D - var20, 0.25D, 1.0D - var20); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (var8 == 2) { + this.setRenderBounds(var20, var271, 0.0D, 1.0D - var20, var271 + var22, var261); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (var8 == 3) { + this.setRenderBounds(var20, var271, 1.0D - var261, 1.0D - var20, var271 + var22, 1.0D); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (var8 == 4) { + this.setRenderBounds(0.0D, var271, var20, var261, var271 + var22, 1.0D - var20); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (var8 == 5) { + this.setRenderBounds(1.0D - var261, var271, var20, 1.0D, var271 + var22, 1.0D - var20); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + } + + this.clearOverrideBlockTexture(); + return true; + } + + public boolean renderBlockStairs(BlockStairs p_147722_1_, int p_147722_2_, int p_147722_3_, int p_147722_4_) { + p_147722_1_.func_150147_e(this.blockAccess, p_147722_2_, p_147722_3_, p_147722_4_); + this.setRenderBoundsFromBlock(p_147722_1_); + this.renderStandardBlock(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + this.field_152631_f = true; + boolean var5 = p_147722_1_.func_150145_f(this.blockAccess, p_147722_2_, p_147722_3_, p_147722_4_); + this.setRenderBoundsFromBlock(p_147722_1_); + this.renderStandardBlock(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + + if (var5 && p_147722_1_.func_150144_g(this.blockAccess, p_147722_2_, p_147722_3_, p_147722_4_)) { + this.setRenderBoundsFromBlock(p_147722_1_); + this.renderStandardBlock(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + } + + this.field_152631_f = false; + return true; + } + + public boolean renderBlockDoor(Block p_147760_1_, int p_147760_2_, int p_147760_3_, int p_147760_4_) { + Tessellator var5 = Tessellator.instance; + int var6 = this.blockAccess.getBlockMetadata(p_147760_2_, p_147760_3_, p_147760_4_); + + if ((var6 & 8) != 0) { + if (this.blockAccess.getBlock(p_147760_2_, p_147760_3_ - 1, p_147760_4_) != p_147760_1_) { + return false; + } + } else if (this.blockAccess.getBlock(p_147760_2_, p_147760_3_ + 1, p_147760_4_) != p_147760_1_) { + return false; + } + + boolean var7 = false; + float var8 = 0.5F; + float var9 = 1.0F; + float var10 = 0.8F; + float var11 = 0.6F; + + if (Config.isShaders()) { + var8 = this.lightLevel05; + var10 = this.lightLevel08; + var11 = this.lightLevel06; + } + + int var12 = p_147760_1_.getBlockBrightness(this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_); + var5.setBrightness(this.renderMinY > 0.0D ? var12 : p_147760_1_.getBlockBrightness(this.blockAccess, p_147760_2_, p_147760_3_ - 1, p_147760_4_)); + var5.setColorOpaque_F(var8, var8, var8); + this.renderFaceYNeg(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 0)); + var7 = true; + var5.setBrightness(this.renderMaxY < 1.0D ? var12 : p_147760_1_.getBlockBrightness(this.blockAccess, p_147760_2_, p_147760_3_ + 1, p_147760_4_)); + var5.setColorOpaque_F(var9, var9, var9); + this.renderFaceYPos(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 1)); + var7 = true; + var5.setBrightness(this.renderMinZ > 0.0D ? var12 : p_147760_1_.getBlockBrightness(this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_ - 1)); + var5.setColorOpaque_F(var10, var10, var10); + IIcon var13 = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 2); + this.renderFaceZNeg(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.flipTexture = false; + var5.setBrightness(this.renderMaxZ < 1.0D ? var12 : p_147760_1_.getBlockBrightness(this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_ + 1)); + var5.setColorOpaque_F(var10, var10, var10); + var13 = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 3); + this.renderFaceZPos(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.flipTexture = false; + var5.setBrightness(this.renderMinX > 0.0D ? var12 : p_147760_1_.getBlockBrightness(this.blockAccess, p_147760_2_ - 1, p_147760_3_, p_147760_4_)); + var5.setColorOpaque_F(var11, var11, var11); + var13 = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 4); + this.renderFaceXNeg(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.flipTexture = false; + var5.setBrightness(this.renderMaxX < 1.0D ? var12 : p_147760_1_.getBlockBrightness(this.blockAccess, p_147760_2_ + 1, p_147760_3_, p_147760_4_)); + var5.setColorOpaque_F(var11, var11, var11); + var13 = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 5); + this.renderFaceXPos(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.flipTexture = false; + return var7; + } + + public void renderFaceYNeg(Block p_147768_1_, double p_147768_2_, double p_147768_4_, double p_147768_6_, IIcon p_147768_8_) { + Tessellator var9 = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) { + p_147768_8_ = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + p_147768_8_ = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147768_1_, (int)p_147768_2_, (int)p_147768_4_, (int)p_147768_6_, 0, p_147768_8_); + } + + boolean uvRotateSet = false; + + if (Config.isNaturalTextures() && this.overrideBlockTexture == null && this.uvRotateBottom == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147768_8_); + + if (var10 != null) { + int rand = Config.getRandom((int)p_147768_2_, (int)p_147768_4_, (int)p_147768_6_, 0); + + if (var10.rotation > 1) { + this.uvRotateBottom = rand & 3; + } + + if (var10.rotation == 2) { + this.uvRotateBottom = this.uvRotateBottom / 2 * 3; + } + + if (var10.flip) { + this.flipTexture = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147768_8_.getInterpolatedU(this.renderMinX * 16.0D); + double var12 = (double)p_147768_8_.getInterpolatedU(this.renderMaxX * 16.0D); + double var14 = (double)p_147768_8_.getInterpolatedV(this.renderMinZ * 16.0D); + double var16 = (double)p_147768_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { + var101 = (double)p_147768_8_.getMinU(); + var12 = (double)p_147768_8_.getMaxU(); + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { + var14 = (double)p_147768_8_.getMinV(); + var16 = (double)p_147768_8_.getMaxV(); + } + + double var18; + + if (this.flipTexture) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + + if (this.uvRotateBottom == 2) { + var101 = (double)p_147768_8_.getInterpolatedU(this.renderMinZ * 16.0D); + var14 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + var12 = (double)p_147768_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + var16 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if (this.uvRotateBottom == 1) { + var101 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + var14 = (double)p_147768_8_.getInterpolatedV(this.renderMinX * 16.0D); + var12 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + var16 = (double)p_147768_8_.getInterpolatedV(this.renderMaxX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if (this.uvRotateBottom == 3) { + var101 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + var12 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + var14 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + var16 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if (uvRotateSet) { + this.uvRotateBottom = 0; + this.flipTexture = false; + } + + var26 = p_147768_2_ + this.renderMinX; + double var28 = p_147768_2_ + this.renderMaxX; + double var30 = p_147768_4_ + this.renderMinY; + double var32 = p_147768_6_ + this.renderMinZ; + double var34 = p_147768_6_ + this.renderMaxZ; + + if (this.renderFromInside) { + var26 = p_147768_2_ + this.renderMaxX; + var28 = p_147768_2_ + this.renderMinX; + } + + if (this.enableAO) { + var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + var9.setBrightness(this.brightnessTopLeft); + var9.addVertexWithUV(var26, var30, var34, var20, var24); + var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + var9.setBrightness(this.brightnessBottomLeft); + var9.addVertexWithUV(var26, var30, var32, var101, var14); + var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + var9.setBrightness(this.brightnessBottomRight); + var9.addVertexWithUV(var28, var30, var32, var18, var22); + var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + var9.setBrightness(this.brightnessTopRight); + var9.addVertexWithUV(var28, var30, var34, var12, var16); + } else { + var9.addVertexWithUV(var26, var30, var34, var20, var24); + var9.addVertexWithUV(var26, var30, var32, var101, var14); + var9.addVertexWithUV(var28, var30, var32, var18, var22); + var9.addVertexWithUV(var28, var30, var34, var12, var16); + } + } + + public void renderFaceYPos(Block p_147806_1_, double p_147806_2_, double p_147806_4_, double p_147806_6_, IIcon p_147806_8_) { + Tessellator var9 = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) { + p_147806_8_ = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + p_147806_8_ = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147806_1_, (int)p_147806_2_, (int)p_147806_4_, (int)p_147806_6_, 1, p_147806_8_); + } + + boolean uvRotateSet = false; + + if (Config.isNaturalTextures() && this.overrideBlockTexture == null && this.uvRotateTop == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147806_8_); + + if (var10 != null) { + int rand = Config.getRandom((int)p_147806_2_, (int)p_147806_4_, (int)p_147806_6_, 1); + + if (var10.rotation > 1) { + this.uvRotateTop = rand & 3; + } + + if (var10.rotation == 2) { + this.uvRotateTop = this.uvRotateTop / 2 * 3; + } + + if (var10.flip) { + this.flipTexture = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147806_8_.getInterpolatedU(this.renderMinX * 16.0D); + double var12 = (double)p_147806_8_.getInterpolatedU(this.renderMaxX * 16.0D); + double var14 = (double)p_147806_8_.getInterpolatedV(this.renderMinZ * 16.0D); + double var16 = (double)p_147806_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + double var18; + + if (this.flipTexture) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { + var101 = (double)p_147806_8_.getMinU(); + var12 = (double)p_147806_8_.getMaxU(); + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { + var14 = (double)p_147806_8_.getMinV(); + var16 = (double)p_147806_8_.getMaxV(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + + if (this.uvRotateTop == 1) { + var101 = (double)p_147806_8_.getInterpolatedU(this.renderMinZ * 16.0D); + var14 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + var12 = (double)p_147806_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + var16 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if (this.uvRotateTop == 2) { + var101 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + var14 = (double)p_147806_8_.getInterpolatedV(this.renderMinX * 16.0D); + var12 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + var16 = (double)p_147806_8_.getInterpolatedV(this.renderMaxX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if (this.uvRotateTop == 3) { + var101 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + var12 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + var14 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + var16 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if (uvRotateSet) { + this.uvRotateTop = 0; + this.flipTexture = false; + } + + var26 = p_147806_2_ + this.renderMinX; + double var28 = p_147806_2_ + this.renderMaxX; + double var30 = p_147806_4_ + this.renderMaxY; + double var32 = p_147806_6_ + this.renderMinZ; + double var34 = p_147806_6_ + this.renderMaxZ; + + if (this.renderFromInside) { + var26 = p_147806_2_ + this.renderMaxX; + var28 = p_147806_2_ + this.renderMinX; + } + + if (this.enableAO) { + var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + var9.setBrightness(this.brightnessTopLeft); + var9.addVertexWithUV(var28, var30, var34, var12, var16); + var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + var9.setBrightness(this.brightnessBottomLeft); + var9.addVertexWithUV(var28, var30, var32, var18, var22); + var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + var9.setBrightness(this.brightnessBottomRight); + var9.addVertexWithUV(var26, var30, var32, var101, var14); + var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + var9.setBrightness(this.brightnessTopRight); + var9.addVertexWithUV(var26, var30, var34, var20, var24); + } else { + var9.addVertexWithUV(var28, var30, var34, var12, var16); + var9.addVertexWithUV(var28, var30, var32, var18, var22); + var9.addVertexWithUV(var26, var30, var32, var101, var14); + var9.addVertexWithUV(var26, var30, var34, var20, var24); + } + } + + public void renderFaceZNeg(Block p_147761_1_, double p_147761_2_, double p_147761_4_, double p_147761_6_, IIcon p_147761_8_) { + Tessellator var9 = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) { + p_147761_8_ = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + p_147761_8_ = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147761_1_, (int)p_147761_2_, (int)p_147761_4_, (int)p_147761_6_, 2, p_147761_8_); + } + + boolean uvRotateSet = false; + + if (Config.isNaturalTextures() && this.overrideBlockTexture == null && this.uvRotateEast == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147761_8_); + + if (var10 != null) { + int rand = Config.getRandom((int)p_147761_2_, (int)p_147761_4_, (int)p_147761_6_, 2); + + if (var10.rotation > 1) { + this.uvRotateEast = rand & 3; + } + + if (var10.rotation == 2) { + this.uvRotateEast = this.uvRotateEast / 2 * 3; + } + + if (var10.flip) { + this.flipTexture = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147761_8_.getInterpolatedU(this.renderMinX * 16.0D); + double var12 = (double)p_147761_8_.getInterpolatedU(this.renderMaxX * 16.0D); + + if (this.field_152631_f) { + var12 = (double)p_147761_8_.getInterpolatedU((1.0D - this.renderMinX) * 16.0D); + var101 = (double)p_147761_8_.getInterpolatedU((1.0D - this.renderMaxX) * 16.0D); + } + + double var14 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double var16 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double var18; + + if (this.flipTexture) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { + var101 = (double)p_147761_8_.getMinU(); + var12 = (double)p_147761_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { + var14 = (double)p_147761_8_.getMinV(); + var16 = (double)p_147761_8_.getMaxV(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + + if (this.uvRotateEast == 2) { + var101 = (double)p_147761_8_.getInterpolatedU(this.renderMinY * 16.0D); + var12 = (double)p_147761_8_.getInterpolatedU(this.renderMaxY * 16.0D); + var14 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + var16 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if (this.uvRotateEast == 1) { + var101 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + var12 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + var14 = (double)p_147761_8_.getInterpolatedV(this.renderMaxX * 16.0D); + var16 = (double)p_147761_8_.getInterpolatedV(this.renderMinX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if (this.uvRotateEast == 3) { + var101 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + var12 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + var14 = (double)p_147761_8_.getInterpolatedV(this.renderMaxY * 16.0D); + var16 = (double)p_147761_8_.getInterpolatedV(this.renderMinY * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if (uvRotateSet) { + this.uvRotateEast = 0; + this.flipTexture = false; + } + + var26 = p_147761_2_ + this.renderMinX; + double var28 = p_147761_2_ + this.renderMaxX; + double var30 = p_147761_4_ + this.renderMinY; + double var32 = p_147761_4_ + this.renderMaxY; + double var34 = p_147761_6_ + this.renderMinZ; + + if (this.renderFromInside) { + var26 = p_147761_2_ + this.renderMaxX; + var28 = p_147761_2_ + this.renderMinX; + } + + if (this.enableAO) { + var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + var9.setBrightness(this.brightnessTopLeft); + var9.addVertexWithUV(var26, var32, var34, var18, var22); + var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + var9.setBrightness(this.brightnessBottomLeft); + var9.addVertexWithUV(var28, var32, var34, var101, var14); + var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + var9.setBrightness(this.brightnessBottomRight); + var9.addVertexWithUV(var28, var30, var34, var20, var24); + var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + var9.setBrightness(this.brightnessTopRight); + var9.addVertexWithUV(var26, var30, var34, var12, var16); + } else { + var9.addVertexWithUV(var26, var32, var34, var18, var22); + var9.addVertexWithUV(var28, var32, var34, var101, var14); + var9.addVertexWithUV(var28, var30, var34, var20, var24); + var9.addVertexWithUV(var26, var30, var34, var12, var16); + } + } + + public void renderFaceZPos(Block p_147734_1_, double p_147734_2_, double p_147734_4_, double p_147734_6_, IIcon p_147734_8_) { + Tessellator var9 = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) { + p_147734_8_ = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + p_147734_8_ = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147734_1_, (int)p_147734_2_, (int)p_147734_4_, (int)p_147734_6_, 3, p_147734_8_); + } + + boolean uvRotateSet = false; + + if (Config.isNaturalTextures() && this.overrideBlockTexture == null && this.uvRotateWest == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147734_8_); + + if (var10 != null) { + int rand = Config.getRandom((int)p_147734_2_, (int)p_147734_4_, (int)p_147734_6_, 3); + + if (var10.rotation > 1) { + this.uvRotateWest = rand & 3; + } + + if (var10.rotation == 2) { + this.uvRotateWest = this.uvRotateWest / 2 * 3; + } + + if (var10.flip) { + this.flipTexture = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147734_8_.getInterpolatedU(this.renderMinX * 16.0D); + double var12 = (double)p_147734_8_.getInterpolatedU(this.renderMaxX * 16.0D); + double var14 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double var16 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double var18; + + if (this.flipTexture) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { + var101 = (double)p_147734_8_.getMinU(); + var12 = (double)p_147734_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { + var14 = (double)p_147734_8_.getMinV(); + var16 = (double)p_147734_8_.getMaxV(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + + if (this.uvRotateWest == 1) { + var101 = (double)p_147734_8_.getInterpolatedU(this.renderMinY * 16.0D); + var16 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + var12 = (double)p_147734_8_.getInterpolatedU(this.renderMaxY * 16.0D); + var14 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if (this.uvRotateWest == 2) { + var101 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + var14 = (double)p_147734_8_.getInterpolatedV(this.renderMinX * 16.0D); + var12 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + var16 = (double)p_147734_8_.getInterpolatedV(this.renderMaxX * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if (this.uvRotateWest == 3) { + var101 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + var12 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + var14 = (double)p_147734_8_.getInterpolatedV(this.renderMaxY * 16.0D); + var16 = (double)p_147734_8_.getInterpolatedV(this.renderMinY * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if (uvRotateSet) { + this.uvRotateWest = 0; + this.flipTexture = false; + } + + var26 = p_147734_2_ + this.renderMinX; + double var28 = p_147734_2_ + this.renderMaxX; + double var30 = p_147734_4_ + this.renderMinY; + double var32 = p_147734_4_ + this.renderMaxY; + double var34 = p_147734_6_ + this.renderMaxZ; + + if (this.renderFromInside) { + var26 = p_147734_2_ + this.renderMaxX; + var28 = p_147734_2_ + this.renderMinX; + } + + if (this.enableAO) { + var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + var9.setBrightness(this.brightnessTopLeft); + var9.addVertexWithUV(var26, var32, var34, var101, var14); + var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + var9.setBrightness(this.brightnessBottomLeft); + var9.addVertexWithUV(var26, var30, var34, var20, var24); + var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + var9.setBrightness(this.brightnessBottomRight); + var9.addVertexWithUV(var28, var30, var34, var12, var16); + var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + var9.setBrightness(this.brightnessTopRight); + var9.addVertexWithUV(var28, var32, var34, var18, var22); + } else { + var9.addVertexWithUV(var26, var32, var34, var101, var14); + var9.addVertexWithUV(var26, var30, var34, var20, var24); + var9.addVertexWithUV(var28, var30, var34, var12, var16); + var9.addVertexWithUV(var28, var32, var34, var18, var22); + } + } + + public void renderFaceXNeg(Block p_147798_1_, double p_147798_2_, double p_147798_4_, double p_147798_6_, IIcon p_147798_8_) { + Tessellator var9 = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) { + p_147798_8_ = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + p_147798_8_ = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147798_1_, (int)p_147798_2_, (int)p_147798_4_, (int)p_147798_6_, 4, p_147798_8_); + } + + boolean uvRotateSet = false; + + if (Config.isNaturalTextures() && this.overrideBlockTexture == null && this.uvRotateNorth == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147798_8_); + + if (var10 != null) { + int rand = Config.getRandom((int)p_147798_2_, (int)p_147798_4_, (int)p_147798_6_, 4); + + if (var10.rotation > 1) { + this.uvRotateNorth = rand & 3; + } + + if (var10.rotation == 2) { + this.uvRotateNorth = this.uvRotateNorth / 2 * 3; + } + + if (var10.flip) { + this.flipTexture = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147798_8_.getInterpolatedU(this.renderMinZ * 16.0D); + double var12 = (double)p_147798_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + double var14 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double var16 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double var18; + + if (this.flipTexture) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { + var101 = (double)p_147798_8_.getMinU(); + var12 = (double)p_147798_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { + var14 = (double)p_147798_8_.getMinV(); + var16 = (double)p_147798_8_.getMaxV(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + + if (this.uvRotateNorth == 1) { + var101 = (double)p_147798_8_.getInterpolatedU(this.renderMinY * 16.0D); + var14 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + var12 = (double)p_147798_8_.getInterpolatedU(this.renderMaxY * 16.0D); + var16 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if (this.uvRotateNorth == 2) { + var101 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + var14 = (double)p_147798_8_.getInterpolatedV(this.renderMinZ * 16.0D); + var12 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + var16 = (double)p_147798_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if (this.uvRotateNorth == 3) { + var101 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + var12 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + var14 = (double)p_147798_8_.getInterpolatedV(this.renderMaxY * 16.0D); + var16 = (double)p_147798_8_.getInterpolatedV(this.renderMinY * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if (uvRotateSet) { + this.uvRotateNorth = 0; + this.flipTexture = false; + } + + var26 = p_147798_2_ + this.renderMinX; + double var28 = p_147798_4_ + this.renderMinY; + double var30 = p_147798_4_ + this.renderMaxY; + double var32 = p_147798_6_ + this.renderMinZ; + double var34 = p_147798_6_ + this.renderMaxZ; + + if (this.renderFromInside) { + var32 = p_147798_6_ + this.renderMaxZ; + var34 = p_147798_6_ + this.renderMinZ; + } + + if (this.enableAO) { + var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + var9.setBrightness(this.brightnessTopLeft); + var9.addVertexWithUV(var26, var30, var34, var18, var22); + var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + var9.setBrightness(this.brightnessBottomLeft); + var9.addVertexWithUV(var26, var30, var32, var101, var14); + var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + var9.setBrightness(this.brightnessBottomRight); + var9.addVertexWithUV(var26, var28, var32, var20, var24); + var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + var9.setBrightness(this.brightnessTopRight); + var9.addVertexWithUV(var26, var28, var34, var12, var16); + } else { + var9.addVertexWithUV(var26, var30, var34, var18, var22); + var9.addVertexWithUV(var26, var30, var32, var101, var14); + var9.addVertexWithUV(var26, var28, var32, var20, var24); + var9.addVertexWithUV(var26, var28, var34, var12, var16); + } + } + + public void renderFaceXPos(Block p_147764_1_, double p_147764_2_, double p_147764_4_, double p_147764_6_, IIcon p_147764_8_) { + Tessellator var9 = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) { + p_147764_8_ = this.overrideBlockTexture; + } + + if (Config.isConnectedTextures() && this.overrideBlockTexture == null) { + p_147764_8_ = ConnectedTextures.getConnectedTexture(this.blockAccess, p_147764_1_, (int)p_147764_2_, (int)p_147764_4_, (int)p_147764_6_, 5, p_147764_8_); + } + + boolean uvRotateSet = false; + + if (Config.isNaturalTextures() && this.overrideBlockTexture == null && this.uvRotateSouth == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147764_8_); + + if (var10 != null) { + int rand = Config.getRandom((int)p_147764_2_, (int)p_147764_4_, (int)p_147764_6_, 5); + + if (var10.rotation > 1) { + this.uvRotateSouth = rand & 3; + } + + if (var10.rotation == 2) { + this.uvRotateSouth = this.uvRotateSouth / 2 * 3; + } + + if (var10.flip) { + this.flipTexture = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147764_8_.getInterpolatedU(this.renderMinZ * 16.0D); + double var12 = (double)p_147764_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + + if (this.field_152631_f) { + var12 = (double)p_147764_8_.getInterpolatedU((1.0D - this.renderMinZ) * 16.0D); + var101 = (double)p_147764_8_.getInterpolatedU((1.0D - this.renderMaxZ) * 16.0D); + } + + double var14 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double var16 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double var18; + + if (this.flipTexture) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { + var101 = (double)p_147764_8_.getMinU(); + var12 = (double)p_147764_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { + var14 = (double)p_147764_8_.getMinV(); + var16 = (double)p_147764_8_.getMaxV(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + + if (this.uvRotateSouth == 2) { + var101 = (double)p_147764_8_.getInterpolatedU(this.renderMinY * 16.0D); + var14 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + var12 = (double)p_147764_8_.getInterpolatedU(this.renderMaxY * 16.0D); + var16 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if (this.uvRotateSouth == 1) { + var101 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + var14 = (double)p_147764_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + var12 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + var16 = (double)p_147764_8_.getInterpolatedV(this.renderMinZ * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if (this.uvRotateSouth == 3) { + var101 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + var12 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + var14 = (double)p_147764_8_.getInterpolatedV(this.renderMaxY * 16.0D); + var16 = (double)p_147764_8_.getInterpolatedV(this.renderMinY * 16.0D); + + if (this.flipTexture) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if (uvRotateSet) { + this.uvRotateSouth = 0; + this.flipTexture = false; + } + + var26 = p_147764_2_ + this.renderMaxX; + double var28 = p_147764_4_ + this.renderMinY; + double var30 = p_147764_4_ + this.renderMaxY; + double var32 = p_147764_6_ + this.renderMinZ; + double var34 = p_147764_6_ + this.renderMaxZ; + + if (this.renderFromInside) { + var32 = p_147764_6_ + this.renderMaxZ; + var34 = p_147764_6_ + this.renderMinZ; + } + + if (this.enableAO) { + var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + var9.setBrightness(this.brightnessTopLeft); + var9.addVertexWithUV(var26, var28, var34, var20, var24); + var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + var9.setBrightness(this.brightnessBottomLeft); + var9.addVertexWithUV(var26, var28, var32, var12, var16); + var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + var9.setBrightness(this.brightnessBottomRight); + var9.addVertexWithUV(var26, var30, var32, var18, var22); + var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + var9.setBrightness(this.brightnessTopRight); + var9.addVertexWithUV(var26, var30, var34, var101, var14); + } else { + var9.addVertexWithUV(var26, var28, var34, var20, var24); + var9.addVertexWithUV(var26, var28, var32, var12, var16); + var9.addVertexWithUV(var26, var30, var32, var18, var22); + var9.addVertexWithUV(var26, var30, var34, var101, var14); + } + } + + public void renderBlockAsItem(Block p_147800_1_, int p_147800_2_, float p_147800_3_) { + Tessellator var4 = Tessellator.instance; + boolean var5 = p_147800_1_ == Blocks.grass; + + if (p_147800_1_ == Blocks.dispenser || p_147800_1_ == Blocks.dropper || p_147800_1_ == Blocks.furnace) { + p_147800_2_ = 3; + } + + int var6; + float var7; + float var8; + float var9; + + if (this.useInventoryTint) { + var6 = p_147800_1_.getRenderColor(p_147800_2_); + + if (var5) { + var6 = 16777215; + } + + var7 = (float)(var6 >> 16 & 255) / 255.0F; + var8 = (float)(var6 >> 8 & 255) / 255.0F; + var9 = (float)(var6 & 255) / 255.0F; + GL11.glColor4f(var7 * p_147800_3_, var8 * p_147800_3_, var9 * p_147800_3_, 1.0F); + } + + var6 = p_147800_1_.getRenderType(); + this.setRenderBoundsFromBlock(p_147800_1_); + int var14; + + if (var6 != 0 && var6 != 31 && var6 != 39 && var6 != 16 && var6 != 26) { + if (var6 == 1) { + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + IIcon var171 = this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_); + this.drawCrossedSquares(var171, -0.5D, -0.5D, -0.5D, 1.0F); + var4.draw(); + } else if (var6 == 19) { + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + p_147800_1_.setBlockBoundsForItemRender(); + this.renderBlockStemSmall(p_147800_1_, p_147800_2_, this.renderMaxY, -0.5D, -0.5D, -0.5D); + var4.draw(); + } else if (var6 == 23) { + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + p_147800_1_.setBlockBoundsForItemRender(); + var4.draw(); + } else if (var6 == 13) { + p_147800_1_.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var7 = 0.0625F; + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + var4.addTranslation(0.0F, 0.0F, var7); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + var4.addTranslation(0.0F, 0.0F, -var7); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + var4.addTranslation(0.0F, 0.0F, -var7); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + var4.addTranslation(0.0F, 0.0F, var7); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + var4.addTranslation(var7, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + var4.addTranslation(-var7, 0.0F, 0.0F); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + var4.addTranslation(-var7, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + var4.addTranslation(var7, 0.0F, 0.0F); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } else if (var6 == 22) { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.func_147715_a(p_147800_1_, p_147800_2_, p_147800_3_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + } else if (var6 == 6) { + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderBlockCropsImpl(p_147800_1_, p_147800_2_, -0.5D, -0.5D, -0.5D); + var4.draw(); + } else if (var6 == 2) { + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderTorchAtAngle(p_147800_1_, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + var4.draw(); + } else if (var6 == 10) { + for (var14 = 0; var14 < 2; ++var14) { + if (var14 == 0) { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + + if (var14 == 1) { + this.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } else if (var6 == 27) { + var14 = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + + for (int var181 = 0; var181 < 8; ++var181) { + byte var17 = 0; + byte var18 = 1; + + if (var181 == 0) { + var17 = 2; + } + + if (var181 == 1) { + var17 = 3; + } + + if (var181 == 2) { + var17 = 4; + } + + if (var181 == 3) { + var17 = 5; + var18 = 2; + } + + if (var181 == 4) { + var17 = 6; + var18 = 3; + } + + if (var181 == 5) { + var17 = 7; + var18 = 5; + } + + if (var181 == 6) { + var17 = 6; + var18 = 2; + } + + if (var181 == 7) { + var17 = 3; + } + + float var11 = (float)var17 / 16.0F; + float var12 = 1.0F - (float)var14 / 16.0F; + float var13 = 1.0F - (float)(var14 + var18) / 16.0F; + var14 += var18; + this.setRenderBounds((double)(0.5F - var11), (double)var13, (double)(0.5F - var11), (double)(0.5F + var11), (double)var12, (double)(0.5F + var11)); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + var4.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + var4.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + var4.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + var4.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + } + + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } else if (var6 == 11) { + for (var14 = 0; var14 < 4; ++var14) { + var8 = 0.125F; + + if (var14 == 0) { + this.setRenderBounds((double)(0.5F - var8), 0.0D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); + } + + if (var14 == 1) { + this.setRenderBounds((double)(0.5F - var8), 0.0D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); + } + + var8 = 0.0625F; + + if (var14 == 2) { + this.setRenderBounds((double)(0.5F - var8), (double)(1.0F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(1.0F - var8), (double)(1.0F + var8 * 2.0F)); + } + + if (var14 == 3) { + this.setRenderBounds((double)(0.5F - var8), (double)(0.5F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(0.5F - var8), (double)(1.0F + var8 * 2.0F)); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } else if (var6 == 21) { + for (var14 = 0; var14 < 3; ++var14) { + var8 = 0.0625F; + + if (var14 == 0) { + this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); + } + + if (var14 == 1) { + this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); + } + + var8 = 0.0625F; + + if (var14 == 2) { + this.setRenderBounds((double)(0.5F - var8), 0.5D, 0.0D, (double)(0.5F + var8), (double)(1.0F - var8), 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } else if (var6 == 32) { + for (var14 = 0; var14 < 2; ++var14) { + if (var14 == 0) { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + + if (var14 == 1) { + this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 1, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 2, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 3, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 4, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 5, p_147800_2_)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } else if (var6 == 35) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + this.renderBlockAnvilOrient((BlockAnvil)p_147800_1_, 0, 0, 0, p_147800_2_ << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } else if (var6 == 34) { + for (var14 = 0; var14 < 3; ++var14) { + if (var14 == 0) { + this.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.obsidian)); + } else if (var14 == 1) { + this.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.beacon)); + } else if (var14 == 2) { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.glass)); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 1, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 2, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 3, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 4, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 5, p_147800_2_)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.clearOverrideBlockTexture(); + } else if (var6 == 38) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + this.renderBlockHopperMetadata((BlockHopper)p_147800_1_, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } else if (Reflector.ModLoader.exists()) { + Reflector.callVoid(Reflector.ModLoader_renderInvBlock, new Object[] {this, p_147800_1_, Integer.valueOf(p_147800_2_), Integer.valueOf(var6)}); + } else if (Reflector.FMLRenderAccessLibrary.exists()) { + Reflector.callVoid(Reflector.FMLRenderAccessLibrary_renderInventoryBlock, new Object[] {this, p_147800_1_, Integer.valueOf(p_147800_2_), Integer.valueOf(var6)}); + } + } else { + if (var6 == 16) { + p_147800_2_ = 1; + } + + p_147800_1_.setBlockBoundsForItemRender(); + this.setRenderBoundsFromBlock(p_147800_1_); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_)); + var4.draw(); + + if (var5 && this.useInventoryTint) { + var14 = p_147800_1_.getRenderColor(p_147800_2_); + var8 = (float)(var14 >> 16 & 255) / 255.0F; + var9 = (float)(var14 >> 8 & 255) / 255.0F; + float var10 = (float)(var14 & 255) / 255.0F; + GL11.glColor4f(var8 * p_147800_3_, var9 * p_147800_3_, var10 * p_147800_3_, 1.0F); + } + + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 1, p_147800_2_)); + var4.draw(); + + if (var5 && this.useInventoryTint) { + GL11.glColor4f(p_147800_3_, p_147800_3_, p_147800_3_, 1.0F); + } + + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 2, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 3, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 4, p_147800_2_)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 5, p_147800_2_)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } + + public static boolean renderItemIn3d(int par0) { + switch (par0) { + case -1: + return false; + + case 0: + case 10: + case 11: + case 13: + case 16: + case 21: + case 22: + case 26: + case 27: + case 31: + case 32: + case 34: + case 35: + case 39: + return true; + + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 12: + case 14: + case 15: + case 17: + case 18: + case 19: + case 20: + case 23: + case 24: + case 25: + case 28: + case 29: + case 30: + case 33: + case 36: + case 37: + case 38: + default: + return Reflector.ModLoader.exists() ? Reflector.callBoolean(Reflector.ModLoader_renderBlockIsItemFull3D, new Object[] {Integer.valueOf(par0)}): (Reflector.FMLRenderAccessLibrary.exists() ? Reflector.callBoolean(Reflector.FMLRenderAccessLibrary_renderItemAsFull3DBlock, new Object[] {Integer.valueOf(par0)}): false); + } + } + + public IIcon getBlockIcon(Block p_147793_1_, IBlockAccess p_147793_2_, int p_147793_3_, int p_147793_4_, int p_147793_5_, int p_147793_6_) { + return this.getIconSafe(p_147793_1_.getIcon(p_147793_2_, p_147793_3_, p_147793_4_, p_147793_5_, p_147793_6_)); + } + + public IIcon getBlockIconFromSideAndMetadata(Block p_147787_1_, int p_147787_2_, int p_147787_3_) { + return this.getIconSafe(p_147787_1_.getIcon(p_147787_2_, p_147787_3_)); + } + + public IIcon getBlockIconFromSide(Block p_147777_1_, int p_147777_2_) { + return this.getIconSafe(p_147777_1_.getBlockTextureFromSide(p_147777_2_)); + } + + public IIcon getBlockIcon(Block p_147745_1_) { + return this.getIconSafe(p_147745_1_.getBlockTextureFromSide(1)); + } + + public IIcon getIconSafe(IIcon p_147758_1_) { + if (p_147758_1_ == null) { + p_147758_1_ = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + } + + return (IIcon)p_147758_1_; + } + + private float getAmbientOcclusionLightValue(int i, int j, int k) { + Block block = this.blockAccess.getBlock(i, j, k); + return block.isBlockNormalCube() ? this.aoLightValueOpaque : 1.0F; + } + + private IIcon fixAoSideGrassTexture(IIcon tex, int x, int y, int z, int side, float f, float f1, float f2) { + if (tex == TextureUtils.iconGrassSide || tex == TextureUtils.iconMyceliumSide) { + tex = Config.getSideGrassTexture(this.blockAccess, x, y, z, side, tex); + + if (tex == TextureUtils.iconGrassTop) { + this.colorRedTopLeft *= f; + this.colorRedBottomLeft *= f; + this.colorRedBottomRight *= f; + this.colorRedTopRight *= f; + this.colorGreenTopLeft *= f1; + this.colorGreenBottomLeft *= f1; + this.colorGreenBottomRight *= f1; + this.colorGreenTopRight *= f1; + this.colorBlueTopLeft *= f2; + this.colorBlueBottomLeft *= f2; + this.colorBlueBottomRight *= f2; + this.colorBlueTopRight *= f2; + } + } + + if (tex == TextureUtils.iconGrassSideSnowed) { + tex = Config.getSideSnowGrassTexture(this.blockAccess, x, y, z, side); + } + + return tex; + } + + private boolean hasSnowNeighbours(int x, int y, int z) { + Block blockSnow = Blocks.snow_layer; + return this.blockAccess.getBlock(x - 1, y, z) != blockSnow && this.blockAccess.getBlock(x + 1, y, z) != blockSnow && this.blockAccess.getBlock(x, y, z - 1) != blockSnow && this.blockAccess.getBlock(x, y, z + 1) != blockSnow ? false : this.blockAccess.getBlock(x, y - 1, z).isOpaqueCube(); + } + + private void renderSnow(int x, int y, int z, double maxY) { + if (this.betterSnowEnabled) { + this.setRenderBoundsFromBlock(Blocks.snow_layer); + this.renderMaxY = maxY; + this.renderStandardBlock(Blocks.snow_layer, x, y, z); + } + } + + public static RenderBlocks getInstance() { + if (instance == null) { + instance = new RenderBlocks(); + } + + return instance; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.~ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.~ new file mode 100644 index 0000000..5fe653b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderBlocks.~ @@ -0,0 +1,7916 @@ +package net.minecraft.client.renderer; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockBeacon; +import net.minecraft.block.BlockBed; +import net.minecraft.block.BlockBrewingStand; +import net.minecraft.block.BlockCauldron; +import net.minecraft.block.BlockCocoa; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockDragonEgg; +import net.minecraft.block.BlockEndPortalFrame; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockFlowerPot; +import net.minecraft.block.BlockGrass; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockPane; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.BlockRedstoneComparator; +import net.minecraft.block.BlockRedstoneDiode; +import net.minecraft.block.BlockRedstoneRepeater; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.BlockStem; +import net.minecraft.block.BlockTripWire; +import net.minecraft.block.BlockWall; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.src.Config; +import net.minecraft.src.ConnectedTextures; +import net.minecraft.src.CustomColorizer; +import net.minecraft.src.NaturalProperties; +import net.minecraft.src.NaturalTextures; +import net.minecraft.src.Reflector; +import net.minecraft.src.TextureUtils; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +public class RenderBlocks { + + public IBlockAccess field_147845_a; + public IIcon field_147840_d; + public boolean field_147842_e; + public boolean field_152631_f; + public boolean field_147837_f; + public static boolean field_147843_b = true; + public static boolean cfgGrassFix = true; + public boolean field_147844_c = true; + public boolean field_147838_g = false; + public double field_147859_h; + public double field_147861_i; + public double field_147855_j; + public double field_147857_k; + public double field_147851_l; + public double field_147853_m; + public boolean field_147847_n; + public boolean field_147849_o; + public final Minecraft field_147877_p; + public int field_147875_q; + public int field_147873_r; + public int field_147871_s; + public int field_147869_t; + public int field_147867_u; + public int field_147865_v; + public boolean field_147863_w; + public float field_147888_x; + public float field_147886_y; + public float field_147884_z; + public float field_147814_A; + public float field_147815_B; + public float field_147816_C; + public float field_147810_D; + public float field_147811_E; + public float field_147812_F; + public float field_147813_G; + public float field_147821_H; + public float field_147822_I; + public float field_147823_J; + public float field_147824_K; + public float field_147817_L; + public float field_147818_M; + public float field_147819_N; + public float field_147820_O; + public float field_147830_P; + public float field_147829_Q; + public int field_147832_R; + public int field_147831_S; + public int field_147826_T; + public int field_147825_U; + public int field_147828_V; + public int field_147827_W; + public int field_147835_X; + public int field_147834_Y; + public int field_147836_Z; + public int field_147880_aa; + public int field_147881_ab; + public int field_147878_ac; + public int field_147879_ad; + public int field_147885_ae; + public int field_147887_af; + public int field_147882_ag; + public int field_147883_ah; + public int field_147866_ai; + public int field_147868_aj; + public int field_147862_ak; + public int field_147864_al; + public int field_147874_am; + public int field_147876_an; + public int field_147870_ao; + public float field_147872_ap; + public float field_147852_aq; + public float field_147850_ar; + public float field_147848_as; + public float field_147846_at; + public float field_147860_au; + public float field_147858_av; + public float field_147856_aw; + public float field_147854_ax; + public float field_147841_ay; + public float field_147839_az; + public float field_147833_aA; + public static final String __OBFID = "CL_00000940"; + public boolean aoLightValuesCalculated; + public float aoLightValueOpaque = 0.2F; + public boolean betterSnowEnabled = true; + private static RenderBlocks instance; + private static final String __OBFID = "CL_00000940"; + + public RenderBlocks(IBlockAccess par1IBlockAccess) { + this.field_147845_a = par1IBlockAccess; + this.field_152631_f = false; + this.field_147842_e = false; + this.field_147877_p = Minecraft.func_71410_x(); + this.aoLightValueOpaque = 1.0F - Config.getAmbientOcclusionLevel() * 0.8F; + } + + public RenderBlocks() { + this.field_147877_p = Minecraft.func_71410_x(); + } + + public void func_147757_a(IIcon p_147757_1_) { + this.field_147840_d = p_147757_1_; + } + + public void func_147771_a() { + this.field_147840_d = null; + } + + public boolean func_147744_b() { + return this.field_147840_d != null; + } + + public void func_147786_a(boolean p_147786_1_) { + this.field_147838_g = p_147786_1_; + } + + public void func_147753_b(boolean p_147753_1_) { + this.field_147837_f = p_147753_1_; + } + + public void func_147782_a(double p_147782_1_, double p_147782_3_, double p_147782_5_, double p_147782_7_, double p_147782_9_, double p_147782_11_) { + if(!this.field_147847_n) { + this.field_147859_h = p_147782_1_; + this.field_147861_i = p_147782_7_; + this.field_147855_j = p_147782_3_; + this.field_147857_k = p_147782_9_; + this.field_147851_l = p_147782_5_; + this.field_147853_m = p_147782_11_; + this.field_147849_o = this.field_147877_p.field_71474_y.field_74348_k >= 2 && (this.field_147859_h > 0.0D || this.field_147861_i < 1.0D || this.field_147855_j > 0.0D || this.field_147857_k < 1.0D || this.field_147851_l > 0.0D || this.field_147853_m < 1.0D); + } + + } + + public void func_147775_a(Block p_147775_1_) { + if(!this.field_147847_n) { + this.field_147859_h = p_147775_1_.func_149704_x(); + this.field_147861_i = p_147775_1_.func_149753_y(); + this.field_147855_j = p_147775_1_.func_149665_z(); + this.field_147857_k = p_147775_1_.func_149669_A(); + this.field_147851_l = p_147775_1_.func_149706_B(); + this.field_147853_m = p_147775_1_.func_149693_C(); + this.field_147849_o = this.field_147877_p.field_71474_y.field_74348_k >= 2 && (this.field_147859_h > 0.0D || this.field_147861_i < 1.0D || this.field_147855_j > 0.0D || this.field_147857_k < 1.0D || this.field_147851_l > 0.0D || this.field_147853_m < 1.0D); + } + + } + + public void func_147770_b(double p_147770_1_, double p_147770_3_, double p_147770_5_, double p_147770_7_, double p_147770_9_, double p_147770_11_) { + this.field_147859_h = p_147770_1_; + this.field_147861_i = p_147770_7_; + this.field_147855_j = p_147770_3_; + this.field_147857_k = p_147770_9_; + this.field_147851_l = p_147770_5_; + this.field_147853_m = p_147770_11_; + this.field_147847_n = true; + this.field_147849_o = this.field_147877_p.field_71474_y.field_74348_k >= 2 && (this.field_147859_h > 0.0D || this.field_147861_i < 1.0D || this.field_147855_j > 0.0D || this.field_147857_k < 1.0D || this.field_147851_l > 0.0D || this.field_147853_m < 1.0D); + } + + public void func_147762_c() { + this.field_147847_n = false; + } + + public void func_147792_a(Block p_147792_1_, int p_147792_2_, int p_147792_3_, int p_147792_4_, IIcon p_147792_5_) { + this.func_147757_a(p_147792_5_); + this.func_147805_b(p_147792_1_, p_147792_2_, p_147792_3_, p_147792_4_); + this.func_147771_a(); + } + + public void func_147769_a(Block p_147769_1_, int p_147769_2_, int p_147769_3_, int p_147769_4_) { + this.field_147837_f = true; + this.func_147805_b(p_147769_1_, p_147769_2_, p_147769_3_, p_147769_4_); + this.field_147837_f = false; + } + + public boolean func_147805_b(Block par1Block, int par2, int par3, int par4) { + int i = par1Block.func_149645_b(); + if(i == -1) { + return false; + } else { + par1Block.func_149719_a(this.field_147845_a, par2, par3, par4); + if(Config.isBetterSnow() && par1Block == Blocks.field_150472_an && this.hasSnowNeighbours(par2, par3, par4)) { + this.renderSnow(par2, par3, par4, Blocks.field_150431_aC.func_149669_A()); + } + + this.func_147775_a(par1Block); + switch(i) { + case 0: + return this.func_147784_q(par1Block, par2, par3, par4); + case 1: + return this.func_147746_l(par1Block, par2, par3, par4); + case 2: + return this.func_147791_c(par1Block, par2, par3, par4); + case 3: + return this.func_147801_a((BlockFire)par1Block, par2, par3, par4); + case 4: + return this.func_147721_p(par1Block, par2, par3, par4); + case 5: + return this.func_147788_h(par1Block, par2, par3, par4); + case 6: + return this.func_147796_n(par1Block, par2, par3, par4); + case 7: + return this.func_147760_u(par1Block, par2, par3, par4); + case 8: + return this.func_147794_i(par1Block, par2, par3, par4); + case 9: + return this.func_147766_a((BlockRailBase)par1Block, par2, par3, par4); + case 10: + return this.func_147722_a((BlockStairs)par1Block, par2, par3, par4); + case 11: + return this.func_147735_a((BlockFence)par1Block, par2, par3, par4); + case 12: + return this.func_147790_e(par1Block, par2, par3, par4); + case 13: + return this.func_147755_t(par1Block, par2, par3, par4); + case 14: + return this.func_147773_v(par1Block, par2, par3, par4); + case 15: + return this.func_147759_a((BlockRedstoneRepeater)par1Block, par2, par3, par4); + case 16: + return this.func_147731_b(par1Block, par2, par3, par4, false); + case 17: + return this.func_147809_c(par1Block, par2, par3, par4, true); + case 18: + return this.func_147767_a((BlockPane)par1Block, par2, par3, par4); + case 19: + return this.func_147724_m(par1Block, par2, par3, par4); + case 20: + return this.func_147726_j(par1Block, par2, par3, par4); + case 21: + return this.func_147776_a((BlockFenceGate)par1Block, par2, par3, par4); + case 22: + default: + if(Reflector.ModLoader.exists()) { + return Reflector.callBoolean(Reflector.ModLoader_renderWorldBlock, new Object[]{this, this.field_147845_a, Integer.valueOf(par2), Integer.valueOf(par3), Integer.valueOf(par4), par1Block, Integer.valueOf(i)}); + } else { + if(Reflector.FMLRenderAccessLibrary.exists()) { + return Reflector.callBoolean(Reflector.FMLRenderAccessLibrary_renderWorldBlock, new Object[]{this, this.field_147845_a, Integer.valueOf(par2), Integer.valueOf(par3), Integer.valueOf(par4), par1Block, Integer.valueOf(i)}); + } + + return false; + } + case 23: + return this.func_147783_o(par1Block, par2, par3, par4); + case 24: + return this.func_147785_a((BlockCauldron)par1Block, par2, par3, par4); + case 25: + return this.func_147741_a((BlockBrewingStand)par1Block, par2, par3, par4); + case 26: + return this.func_147743_a((BlockEndPortalFrame)par1Block, par2, par3, par4); + case 27: + return this.func_147802_a((BlockDragonEgg)par1Block, par2, par3, par4); + case 28: + return this.func_147772_a((BlockCocoa)par1Block, par2, par3, par4); + case 29: + return this.func_147723_f(par1Block, par2, par3, par4); + case 30: + return this.func_147756_g(par1Block, par2, par3, par4); + case 31: + return this.func_147742_r(par1Block, par2, par3, par4); + case 32: + return this.func_147807_a((BlockWall)par1Block, par2, par3, par4); + case 33: + return this.func_147752_a((BlockFlowerPot)par1Block, par2, par3, par4); + case 34: + return this.func_147797_a((BlockBeacon)par1Block, par2, par3, par4); + case 35: + return this.func_147725_a((BlockAnvil)par1Block, par2, par3, par4); + case 36: + return this.func_147748_a((BlockRedstoneDiode)par1Block, par2, par3, par4); + case 37: + return this.func_147781_a((BlockRedstoneComparator)par1Block, par2, par3, par4); + case 38: + return this.func_147803_a((BlockHopper)par1Block, par2, par3, par4); + case 39: + return this.func_147779_s(par1Block, par2, par3, par4); + case 40: + return this.func_147774_a((BlockDoublePlant)par1Block, par2, par3, par4); + case 41: + return this.func_147733_k(par1Block, par2, par3, par4); + } + } + } + + public boolean func_147743_a(BlockEndPortalFrame p_147743_1_, int p_147743_2_, int p_147743_3_, int p_147743_4_) { + int var5 = this.field_147845_a.func_72805_g(p_147743_2_, p_147743_3_, p_147743_4_); + int var6 = var5 & 3; + if(var6 == 0) { + this.field_147867_u = 3; + } else if(var6 == 3) { + this.field_147867_u = 1; + } else if(var6 == 1) { + this.field_147867_u = 2; + } + + if(!BlockEndPortalFrame.func_150020_b(var5)) { + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); + this.func_147784_q(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.field_147867_u = 0; + return true; + } else { + this.field_147837_f = true; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); + this.func_147784_q(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.func_147757_a(p_147743_1_.func_150021_e()); + this.func_147782_a(0.25D, 0.8125D, 0.25D, 0.75D, 1.0D, 0.75D); + this.func_147784_q(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.field_147837_f = false; + this.func_147771_a(); + this.field_147867_u = 0; + return true; + } + } + + public boolean func_147773_v(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) { + Tessellator var5 = Tessellator.field_78398_a; + int var6 = this.field_147845_a.func_72805_g(p_147773_2_, p_147773_3_, p_147773_4_); + int var7 = BlockBed.func_149895_l(var6); + boolean var8 = BlockBed.func_149975_b(var6); + if(Reflector.ForgeBlock_getBedDirection.exists()) { + var7 = Reflector.callInt(p_147773_1_, Reflector.ForgeBlock_getBedDirection, new Object[]{this.field_147845_a, Integer.valueOf(p_147773_2_), Integer.valueOf(p_147773_3_), Integer.valueOf(p_147773_4_)}); + } + + if(Reflector.ForgeBlock_isBedFoot.exists()) { + var8 = Reflector.callBoolean(p_147773_1_, Reflector.ForgeBlock_isBedFoot, new Object[]{this.field_147845_a, Integer.valueOf(p_147773_2_), Integer.valueOf(p_147773_3_), Integer.valueOf(p_147773_4_)}); + } + + float var9 = 0.5F; + float var10 = 1.0F; + float var11 = 0.8F; + float var12 = 0.6F; + int var25 = p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_); + var5.func_78380_c(var25); + var5.func_78386_a(var9, var9, var9); + IIcon var26 = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 0); + if(this.field_147840_d != null) { + var26 = this.field_147840_d; + } + + double var27 = (double)var26.func_94209_e(); + double var29 = (double)var26.func_94212_f(); + double var31 = (double)var26.func_94206_g(); + double var33 = (double)var26.func_94210_h(); + double var35 = (double)p_147773_2_ + this.field_147859_h; + double var37 = (double)p_147773_2_ + this.field_147861_i; + double var39 = (double)p_147773_3_ + this.field_147855_j + 0.1875D; + double var41 = (double)p_147773_4_ + this.field_147851_l; + double var43 = (double)p_147773_4_ + this.field_147853_m; + var5.func_78374_a(var35, var39, var43, var27, var33); + var5.func_78374_a(var35, var39, var41, var27, var31); + var5.func_78374_a(var37, var39, var41, var29, var31); + var5.func_78374_a(var37, var39, var43, var29, var33); + var5.func_78380_c(p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); + var5.func_78386_a(var10, var10, var10); + var26 = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 1); + if(this.field_147840_d != null) { + var26 = this.field_147840_d; + } + + var27 = (double)var26.func_94209_e(); + var29 = (double)var26.func_94212_f(); + var31 = (double)var26.func_94206_g(); + var33 = (double)var26.func_94210_h(); + var35 = var27; + var37 = var29; + var39 = var31; + var41 = var31; + var43 = var27; + double var45 = var29; + double var47 = var33; + double var49 = var33; + if(var7 == 0) { + var37 = var27; + var39 = var33; + var43 = var29; + var49 = var31; + } else if(var7 == 2) { + var35 = var29; + var41 = var33; + var45 = var27; + var47 = var31; + } else if(var7 == 3) { + var35 = var29; + var41 = var33; + var45 = var27; + var47 = var31; + var37 = var27; + var39 = var33; + var43 = var29; + var49 = var31; + } + + double var51 = (double)p_147773_2_ + this.field_147859_h; + double var53 = (double)p_147773_2_ + this.field_147861_i; + double var55 = (double)p_147773_3_ + this.field_147857_k; + double var57 = (double)p_147773_4_ + this.field_147851_l; + double var59 = (double)p_147773_4_ + this.field_147853_m; + var5.func_78374_a(var53, var55, var59, var43, var47); + var5.func_78374_a(var53, var55, var57, var35, var39); + var5.func_78374_a(var51, var55, var57, var37, var41); + var5.func_78374_a(var51, var55, var59, var45, var49); + int var61 = Direction.field_71582_c[var7]; + if(var8) { + var61 = Direction.field_71582_c[Direction.field_71580_e[var7]]; + } + + byte var62 = 4; + switch(var7) { + case 0: + var62 = 5; + break; + case 1: + var62 = 3; + case 2: + default: + break; + case 3: + var62 = 2; + } + + if(var61 != 2 && (this.field_147837_f || p_147773_1_.func_149646_a(this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_ - 1, 2))) { + var5.func_78380_c(this.field_147851_l > 0.0D?var25:p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_ - 1)); + var5.func_78386_a(var11, var11, var11); + this.field_147842_e = var62 == 2; + this.func_147761_c(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 2)); + } + + if(var61 != 3 && (this.field_147837_f || p_147773_1_.func_149646_a(this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_ + 1, 3))) { + var5.func_78380_c(this.field_147853_m < 1.0D?var25:p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_ + 1)); + var5.func_78386_a(var11, var11, var11); + this.field_147842_e = var62 == 3; + this.func_147734_d(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 3)); + } + + if(var61 != 4 && (this.field_147837_f || p_147773_1_.func_149646_a(this.field_147845_a, p_147773_2_ - 1, p_147773_3_, p_147773_4_, 4))) { + var5.func_78380_c(this.field_147851_l > 0.0D?var25:p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_ - 1, p_147773_3_, p_147773_4_)); + var5.func_78386_a(var12, var12, var12); + this.field_147842_e = var62 == 4; + this.func_147798_e(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 4)); + } + + if(var61 != 5 && (this.field_147837_f || p_147773_1_.func_149646_a(this.field_147845_a, p_147773_2_ + 1, p_147773_3_, p_147773_4_, 5))) { + var5.func_78380_c(this.field_147853_m < 1.0D?var25:p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_ + 1, p_147773_3_, p_147773_4_)); + var5.func_78386_a(var12, var12, var12); + this.field_147842_e = var62 == 5; + this.func_147764_f(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 5)); + } + + this.field_147842_e = false; + return true; + } + + public boolean func_147741_a(BlockBrewingStand p_147741_1_, int p_147741_2_, int p_147741_3_, int p_147741_4_) { + this.func_147782_a(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.875D, 0.5625D); + this.func_147784_q(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.func_147757_a(p_147741_1_.func_149959_e()); + this.field_147837_f = true; + this.func_147782_a(0.5625D, 0.0D, 0.3125D, 0.9375D, 0.125D, 0.6875D); + this.func_147784_q(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.func_147782_a(0.125D, 0.0D, 0.0625D, 0.5D, 0.125D, 0.4375D); + this.func_147784_q(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.func_147782_a(0.125D, 0.0D, 0.5625D, 0.5D, 0.125D, 0.9375D); + this.func_147784_q(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.field_147837_f = false; + this.func_147771_a(); + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147741_1_.func_149677_c(this.field_147845_a, p_147741_2_, p_147741_3_, p_147741_4_)); + int var6 = p_147741_1_.func_149720_d(this.field_147845_a, p_147741_2_, p_147741_3_, p_147741_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var31 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var32 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var12 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var31; + var8 = var32; + var9 = var12; + } + + var5.func_78386_a(var7, var8, var9); + IIcon var311 = this.func_147787_a(p_147741_1_, 0, 0); + if(this.func_147744_b()) { + var311 = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + var311 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_, -1, var311); + } + + double var321 = (double)var311.func_94206_g(); + double var13 = (double)var311.func_94210_h(); + int var15 = this.field_147845_a.func_72805_g(p_147741_2_, p_147741_3_, p_147741_4_); + + for(int var16 = 0; var16 < 3; ++var16) { + double var17 = (double)var16 * 3.141592653589793D * 2.0D / 3.0D + 1.5707963267948966D; + double var19 = (double)var311.func_94214_a(8.0D); + double var21 = (double)var311.func_94212_f(); + if((var15 & 1 << var16) != 0) { + var21 = (double)var311.func_94209_e(); + } + + double var23 = (double)p_147741_2_ + 0.5D; + double var25 = (double)p_147741_2_ + 0.5D + Math.sin(var17) * 8.0D / 16.0D; + double var27 = (double)p_147741_4_ + 0.5D; + double var29 = (double)p_147741_4_ + 0.5D + Math.cos(var17) * 8.0D / 16.0D; + var5.func_78374_a(var23, (double)(p_147741_3_ + 1), var27, var19, var321); + var5.func_78374_a(var23, (double)(p_147741_3_ + 0), var27, var19, var13); + var5.func_78374_a(var25, (double)(p_147741_3_ + 0), var29, var21, var13); + var5.func_78374_a(var25, (double)(p_147741_3_ + 1), var29, var21, var321); + var5.func_78374_a(var25, (double)(p_147741_3_ + 1), var29, var21, var321); + var5.func_78374_a(var25, (double)(p_147741_3_ + 0), var29, var21, var13); + var5.func_78374_a(var23, (double)(p_147741_3_ + 0), var27, var19, var13); + var5.func_78374_a(var23, (double)(p_147741_3_ + 1), var27, var19, var321); + } + + p_147741_1_.func_149683_g(); + return true; + } + + public boolean func_147785_a(BlockCauldron p_147785_1_, int p_147785_2_, int p_147785_3_, int p_147785_4_) { + this.func_147784_q(p_147785_1_, p_147785_2_, p_147785_3_, p_147785_4_); + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147785_1_.func_149677_c(this.field_147845_a, p_147785_2_, p_147785_3_, p_147785_4_)); + int var6 = p_147785_1_.func_149720_d(this.field_147845_a, p_147785_2_, p_147785_3_, p_147785_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + float var11; + if(EntityRenderer.field_78517_a) { + float var15 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var16 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var15; + var8 = var11; + var9 = var16; + } + + var5.func_78386_a(var7, var8, var9); + IIcon var151 = p_147785_1_.func_149733_h(2); + var11 = 0.125F; + this.func_147764_f(p_147785_1_, (double)((float)p_147785_2_ - 1.0F + var11), (double)p_147785_3_, (double)p_147785_4_, var151); + this.func_147798_e(p_147785_1_, (double)((float)p_147785_2_ + 1.0F - var11), (double)p_147785_3_, (double)p_147785_4_, var151); + this.func_147734_d(p_147785_1_, (double)p_147785_2_, (double)p_147785_3_, (double)((float)p_147785_4_ - 1.0F + var11), var151); + this.func_147761_c(p_147785_1_, (double)p_147785_2_, (double)p_147785_3_, (double)((float)p_147785_4_ + 1.0F - var11), var151); + IIcon var161 = BlockCauldron.func_150026_e("inner"); + this.func_147806_b(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ - 1.0F + 0.25F), (double)p_147785_4_, var161); + this.func_147768_a(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ + 1.0F - 0.75F), (double)p_147785_4_, var161); + int var13 = this.field_147845_a.func_72805_g(p_147785_2_, p_147785_3_, p_147785_4_); + if(var13 > 0) { + IIcon var14 = BlockLiquid.func_149803_e("water_still"); + int wc = CustomColorizer.getFluidColor(Blocks.field_150355_j, this.field_147845_a, p_147785_2_, p_147785_3_, p_147785_4_); + float wr = (float)(wc >> 16 & 255) / 255.0F; + float wg = (float)(wc >> 8 & 255) / 255.0F; + float wb = (float)(wc & 255) / 255.0F; + var5.func_78386_a(wr, wg, wb); + this.func_147806_b(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ - 1.0F + BlockCauldron.func_150025_c(var13)), (double)p_147785_4_, var14); + } + + return true; + } + + public boolean func_147752_a(BlockFlowerPot p_147752_1_, int p_147752_2_, int p_147752_3_, int p_147752_4_) { + this.func_147784_q(p_147752_1_, p_147752_2_, p_147752_3_, p_147752_4_); + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147752_1_.func_149677_c(this.field_147845_a, p_147752_2_, p_147752_3_, p_147752_4_)); + int var6 = p_147752_1_.func_149720_d(this.field_147845_a, p_147752_2_, p_147752_3_, p_147752_4_); + IIcon var7 = this.func_147777_a(p_147752_1_, 0); + float var8 = (float)(var6 >> 16 & 255) / 255.0F; + float var9 = (float)(var6 >> 8 & 255) / 255.0F; + float var10 = (float)(var6 & 255) / 255.0F; + float var11; + if(EntityRenderer.field_78517_a) { + var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var21 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var22 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var11; + var9 = var21; + var10 = var22; + } + + var5.func_78386_a(var8, var9, var10); + var11 = 0.1865F; + this.func_147764_f(p_147752_1_, (double)((float)p_147752_2_ - 0.5F + var11), (double)p_147752_3_, (double)p_147752_4_, var7); + this.func_147798_e(p_147752_1_, (double)((float)p_147752_2_ + 0.5F - var11), (double)p_147752_3_, (double)p_147752_4_, var7); + this.func_147734_d(p_147752_1_, (double)p_147752_2_, (double)p_147752_3_, (double)((float)p_147752_4_ - 0.5F + var11), var7); + this.func_147761_c(p_147752_1_, (double)p_147752_2_, (double)p_147752_3_, (double)((float)p_147752_4_ + 0.5F - var11), var7); + this.func_147806_b(p_147752_1_, (double)p_147752_2_, (double)((float)p_147752_3_ - 0.5F + var11 + 0.1875F), (double)p_147752_4_, this.func_147745_b(Blocks.field_150346_d)); + TileEntity var211 = this.field_147845_a.func_147438_o(p_147752_2_, p_147752_3_, p_147752_4_); + if(var211 != null && var211 instanceof TileEntityFlowerPot) { + Item var221 = ((TileEntityFlowerPot)var211).func_145965_a(); + int var14 = ((TileEntityFlowerPot)var211).func_145966_b(); + if(var221 instanceof ItemBlock) { + Block var15 = Block.func_149634_a(var221); + int var16 = var15.func_149645_b(); + float var17 = 0.0F; + float var18 = 4.0F; + float var19 = 0.0F; + var5.func_78372_c(var17 / 16.0F, var18 / 16.0F, var19 / 16.0F); + var6 = var15.func_149720_d(this.field_147845_a, p_147752_2_, p_147752_3_, p_147752_4_); + if(var6 != 16777215) { + var8 = (float)(var6 >> 16 & 255) / 255.0F; + var9 = (float)(var6 >> 8 & 255) / 255.0F; + var10 = (float)(var6 & 255) / 255.0F; + var5.func_78386_a(var8, var9, var10); + } + + if(var16 == 1) { + this.func_147765_a(this.func_147787_a(var15, 0, var14), (double)p_147752_2_, (double)p_147752_3_, (double)p_147752_4_, 0.75F); + } else if(var16 == 13) { + this.field_147837_f = true; + float var20 = 0.125F; + this.func_147782_a((double)(0.5F - var20), 0.0D, (double)(0.5F - var20), (double)(0.5F + var20), 0.25D, (double)(0.5F + var20)); + this.func_147784_q(var15, p_147752_2_, p_147752_3_, p_147752_4_); + this.func_147782_a((double)(0.5F - var20), 0.25D, (double)(0.5F - var20), (double)(0.5F + var20), 0.5D, (double)(0.5F + var20)); + this.func_147784_q(var15, p_147752_2_, p_147752_3_, p_147752_4_); + this.func_147782_a((double)(0.5F - var20), 0.5D, (double)(0.5F - var20), (double)(0.5F + var20), 0.75D, (double)(0.5F + var20)); + this.func_147784_q(var15, p_147752_2_, p_147752_3_, p_147752_4_); + this.field_147837_f = false; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } + + var5.func_78372_c(-var17 / 16.0F, -var18 / 16.0F, -var19 / 16.0F); + } + } + + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147752_2_, p_147752_3_, p_147752_4_)) { + this.renderSnow(p_147752_2_, p_147752_3_, p_147752_4_, Blocks.field_150431_aC.func_149669_A()); + } + + return true; + } + + public boolean func_147725_a(BlockAnvil p_147725_1_, int p_147725_2_, int p_147725_3_, int p_147725_4_) { + return this.func_147780_a(p_147725_1_, p_147725_2_, p_147725_3_, p_147725_4_, this.field_147845_a.func_72805_g(p_147725_2_, p_147725_3_, p_147725_4_)); + } + + public boolean func_147780_a(BlockAnvil p_147780_1_, int p_147780_2_, int p_147780_3_, int p_147780_4_, int p_147780_5_) { + Tessellator var6 = Tessellator.field_78398_a; + var6.func_78380_c(p_147780_1_.func_149677_c(this.field_147845_a, p_147780_2_, p_147780_3_, p_147780_4_)); + int var7 = p_147780_1_.func_149720_d(this.field_147845_a, p_147780_2_, p_147780_3_, p_147780_4_); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var11; + var9 = var12; + var10 = var13; + } + + var6.func_78386_a(var8, var9, var10); + return this.func_147728_a(p_147780_1_, p_147780_2_, p_147780_3_, p_147780_4_, p_147780_5_, false); + } + + public boolean func_147728_a(BlockAnvil p_147728_1_, int p_147728_2_, int p_147728_3_, int p_147728_4_, int p_147728_5_, boolean p_147728_6_) { + int var7 = p_147728_6_?0:p_147728_5_ & 3; + boolean var8 = false; + float var9 = 0.0F; + switch(var7) { + case 0: + this.field_147871_s = 2; + this.field_147869_t = 1; + this.field_147867_u = 3; + this.field_147865_v = 3; + break; + case 1: + this.field_147875_q = 1; + this.field_147873_r = 2; + this.field_147867_u = 2; + this.field_147865_v = 1; + var8 = true; + break; + case 2: + this.field_147871_s = 1; + this.field_147869_t = 2; + break; + case 3: + this.field_147875_q = 2; + this.field_147873_r = 1; + this.field_147867_u = 1; + this.field_147865_v = 2; + var8 = true; + } + + var9 = this.func_147737_a(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 0, var9, 0.75F, 0.25F, 0.75F, var8, p_147728_6_, p_147728_5_); + var9 = this.func_147737_a(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 1, var9, 0.5F, 0.0625F, 0.625F, var8, p_147728_6_, p_147728_5_); + var9 = this.func_147737_a(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 2, var9, 0.25F, 0.3125F, 0.5F, var8, p_147728_6_, p_147728_5_); + this.func_147737_a(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 3, var9, 0.625F, 0.375F, 1.0F, var8, p_147728_6_, p_147728_5_); + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.field_147875_q = 0; + this.field_147873_r = 0; + this.field_147871_s = 0; + this.field_147869_t = 0; + this.field_147867_u = 0; + this.field_147865_v = 0; + return true; + } + + public float func_147737_a(BlockAnvil p_147737_1_, int p_147737_2_, int p_147737_3_, int p_147737_4_, int p_147737_5_, float p_147737_6_, float p_147737_7_, float p_147737_8_, float p_147737_9_, boolean p_147737_10_, boolean p_147737_11_, int p_147737_12_) { + if(p_147737_10_) { + float var14 = p_147737_7_; + p_147737_7_ = p_147737_9_; + p_147737_9_ = var14; + } + + p_147737_7_ /= 2.0F; + p_147737_9_ /= 2.0F; + p_147737_1_.field_149833_b = p_147737_5_; + this.func_147782_a((double)(0.5F - p_147737_7_), (double)p_147737_6_, (double)(0.5F - p_147737_9_), (double)(0.5F + p_147737_7_), (double)(p_147737_6_ + p_147737_8_), (double)(0.5F + p_147737_9_)); + if(p_147737_11_) { + Tessellator var141 = Tessellator.field_78398_a; + var141.func_78382_b(); + var141.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147737_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147737_1_, 0, p_147737_12_)); + var141.func_78381_a(); + var141.func_78382_b(); + var141.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147737_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147737_1_, 1, p_147737_12_)); + var141.func_78381_a(); + var141.func_78382_b(); + var141.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147737_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147737_1_, 2, p_147737_12_)); + var141.func_78381_a(); + var141.func_78382_b(); + var141.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147737_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147737_1_, 3, p_147737_12_)); + var141.func_78381_a(); + var141.func_78382_b(); + var141.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147737_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147737_1_, 4, p_147737_12_)); + var141.func_78381_a(); + var141.func_78382_b(); + var141.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147737_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147737_1_, 5, p_147737_12_)); + var141.func_78381_a(); + } else { + this.func_147784_q(p_147737_1_, p_147737_2_, p_147737_3_, p_147737_4_); + } + + return p_147737_6_ + p_147737_8_; + } + + public boolean func_147791_c(Block p_147791_1_, int p_147791_2_, int p_147791_3_, int p_147791_4_) { + int var5 = this.field_147845_a.func_72805_g(p_147791_2_, p_147791_3_, p_147791_4_); + Tessellator var6 = Tessellator.field_78398_a; + var6.func_78380_c(p_147791_1_.func_149677_c(this.field_147845_a, p_147791_2_, p_147791_3_, p_147791_4_)); + var6.func_78386_a(1.0F, 1.0F, 1.0F); + double var7 = 0.4000000059604645D; + double var9 = 0.5D - var7; + double var11 = 0.20000000298023224D; + if(var5 == 1) { + this.func_147747_a(p_147791_1_, (double)p_147791_2_ - var9, (double)p_147791_3_ + var11, (double)p_147791_4_, -var7, 0.0D, 0); + } else if(var5 == 2) { + this.func_147747_a(p_147791_1_, (double)p_147791_2_ + var9, (double)p_147791_3_ + var11, (double)p_147791_4_, var7, 0.0D, 0); + } else if(var5 == 3) { + this.func_147747_a(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_ + var11, (double)p_147791_4_ - var9, 0.0D, -var7, 0); + } else if(var5 == 4) { + this.func_147747_a(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_ + var11, (double)p_147791_4_ + var9, 0.0D, var7, 0); + } else { + this.func_147747_a(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_, (double)p_147791_4_, 0.0D, 0.0D, 0); + if(p_147791_1_ != Blocks.field_150478_aa && Config.isBetterSnow() && this.hasSnowNeighbours(p_147791_2_, p_147791_3_, p_147791_4_)) { + this.renderSnow(p_147791_2_, p_147791_3_, p_147791_4_, Blocks.field_150431_aC.func_149669_A()); + } + } + + return true; + } + + public boolean func_147759_a(BlockRedstoneRepeater p_147759_1_, int p_147759_2_, int p_147759_3_, int p_147759_4_) { + int var5 = this.field_147845_a.func_72805_g(p_147759_2_, p_147759_3_, p_147759_4_); + int var6 = var5 & 3; + int var7 = (var5 & 12) >> 2; + Tessellator var8 = Tessellator.field_78398_a; + var8.func_78380_c(p_147759_1_.func_149677_c(this.field_147845_a, p_147759_2_, p_147759_3_, p_147759_4_)); + var8.func_78386_a(1.0F, 1.0F, 1.0F); + double var9 = -0.1875D; + boolean var11 = p_147759_1_.func_149910_g(this.field_147845_a, p_147759_2_, p_147759_3_, p_147759_4_, var5); + double var12 = 0.0D; + double var14 = 0.0D; + double var16 = 0.0D; + double var18 = 0.0D; + switch(var6) { + case 0: + var18 = -0.3125D; + var14 = BlockRedstoneRepeater.field_149973_b[var7]; + break; + case 1: + var16 = 0.3125D; + var12 = -BlockRedstoneRepeater.field_149973_b[var7]; + break; + case 2: + var18 = 0.3125D; + var14 = -BlockRedstoneRepeater.field_149973_b[var7]; + break; + case 3: + var16 = -0.3125D; + var12 = BlockRedstoneRepeater.field_149973_b[var7]; + } + + if(!var11) { + this.func_147747_a(p_147759_1_, (double)p_147759_2_ + var12, (double)p_147759_3_ + var9, (double)p_147759_4_ + var14, 0.0D, 0.0D, 0); + } else { + IIcon var20 = this.func_147745_b(Blocks.field_150357_h); + this.func_147757_a(var20); + float var21 = 2.0F; + float var22 = 14.0F; + float var23 = 7.0F; + float var24 = 9.0F; + switch(var6) { + case 1: + case 3: + var21 = 7.0F; + var22 = 9.0F; + var23 = 2.0F; + var24 = 14.0F; + case 0: + case 2: + default: + this.func_147782_a((double)(var21 / 16.0F + (float)var12), 0.125D, (double)(var23 / 16.0F + (float)var14), (double)(var22 / 16.0F + (float)var12), 0.25D, (double)(var24 / 16.0F + (float)var14)); + double var25 = (double)var20.func_94214_a((double)var21); + double var27 = (double)var20.func_94207_b((double)var23); + double var29 = (double)var20.func_94214_a((double)var22); + double var31 = (double)var20.func_94207_b((double)var24); + var8.func_78374_a((double)((float)p_147759_2_ + var21 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var23 / 16.0F) + var14, var25, var27); + var8.func_78374_a((double)((float)p_147759_2_ + var21 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var24 / 16.0F) + var14, var25, var31); + var8.func_78374_a((double)((float)p_147759_2_ + var22 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var24 / 16.0F) + var14, var29, var31); + var8.func_78374_a((double)((float)p_147759_2_ + var22 / 16.0F) + var12, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + var23 / 16.0F) + var14, var29, var27); + this.func_147784_q(p_147759_1_, p_147759_2_, p_147759_3_, p_147759_4_); + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); + this.func_147771_a(); + } + } + + var8.func_78380_c(p_147759_1_.func_149677_c(this.field_147845_a, p_147759_2_, p_147759_3_, p_147759_4_)); + var8.func_78386_a(1.0F, 1.0F, 1.0F); + this.func_147747_a(p_147759_1_, (double)p_147759_2_ + var16, (double)p_147759_3_ + var9, (double)p_147759_4_ + var18, 0.0D, 0.0D, 0); + this.func_147748_a(p_147759_1_, p_147759_2_, p_147759_3_, p_147759_4_); + return true; + } + + public boolean func_147781_a(BlockRedstoneComparator p_147781_1_, int p_147781_2_, int p_147781_3_, int p_147781_4_) { + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147781_1_.func_149677_c(this.field_147845_a, p_147781_2_, p_147781_3_, p_147781_4_)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + int var6 = this.field_147845_a.func_72805_g(p_147781_2_, p_147781_3_, p_147781_4_); + int var7 = var6 & 3; + double var8 = 0.0D; + double var10 = -0.1875D; + double var12 = 0.0D; + double var14 = 0.0D; + double var16 = 0.0D; + IIcon var18; + if(p_147781_1_.func_149969_d(var6)) { + var18 = Blocks.field_150429_aA.func_149733_h(0); + } else { + var10 -= 0.1875D; + var18 = Blocks.field_150437_az.func_149733_h(0); + } + + switch(var7) { + case 0: + var12 = -0.3125D; + var16 = 1.0D; + break; + case 1: + var8 = 0.3125D; + var14 = -1.0D; + break; + case 2: + var12 = 0.3125D; + var16 = -1.0D; + break; + case 3: + var8 = -0.3125D; + var14 = 1.0D; + } + + this.func_147747_a(p_147781_1_, (double)p_147781_2_ + 0.25D * var14 + 0.1875D * var16, (double)((float)p_147781_3_ - 0.1875F), (double)p_147781_4_ + 0.25D * var16 + 0.1875D * var14, 0.0D, 0.0D, var6); + this.func_147747_a(p_147781_1_, (double)p_147781_2_ + 0.25D * var14 + -0.1875D * var16, (double)((float)p_147781_3_ - 0.1875F), (double)p_147781_4_ + 0.25D * var16 + -0.1875D * var14, 0.0D, 0.0D, var6); + this.func_147757_a(var18); + this.func_147747_a(p_147781_1_, (double)p_147781_2_ + var8, (double)p_147781_3_ + var10, (double)p_147781_4_ + var12, 0.0D, 0.0D, var6); + this.func_147771_a(); + this.func_147732_a(p_147781_1_, p_147781_2_, p_147781_3_, p_147781_4_, var7); + return true; + } + + public boolean func_147748_a(BlockRedstoneDiode p_147748_1_, int p_147748_2_, int p_147748_3_, int p_147748_4_) { + Tessellator var5 = Tessellator.field_78398_a; + this.func_147732_a(p_147748_1_, p_147748_2_, p_147748_3_, p_147748_4_, this.field_147845_a.func_72805_g(p_147748_2_, p_147748_3_, p_147748_4_) & 3); + return true; + } + + public void func_147732_a(BlockRedstoneDiode p_147732_1_, int p_147732_2_, int p_147732_3_, int p_147732_4_, int p_147732_5_) { + this.func_147784_q(p_147732_1_, p_147732_2_, p_147732_3_, p_147732_4_); + Tessellator var6 = Tessellator.field_78398_a; + var6.func_78380_c(p_147732_1_.func_149677_c(this.field_147845_a, p_147732_2_, p_147732_3_, p_147732_4_)); + var6.func_78386_a(1.0F, 1.0F, 1.0F); + int var7 = this.field_147845_a.func_72805_g(p_147732_2_, p_147732_3_, p_147732_4_); + IIcon var8 = this.func_147787_a(p_147732_1_, 1, var7); + double var9 = (double)var8.func_94209_e(); + double var11 = (double)var8.func_94212_f(); + double var13 = (double)var8.func_94206_g(); + double var15 = (double)var8.func_94210_h(); + double var17 = 0.125D; + double var19 = (double)(p_147732_2_ + 1); + double var21 = (double)(p_147732_2_ + 1); + double var23 = (double)(p_147732_2_ + 0); + double var25 = (double)(p_147732_2_ + 0); + double var27 = (double)(p_147732_4_ + 0); + double var29 = (double)(p_147732_4_ + 1); + double var31 = (double)(p_147732_4_ + 1); + double var33 = (double)(p_147732_4_ + 0); + double var35 = (double)p_147732_3_ + var17; + if(p_147732_5_ == 2) { + var19 = var21 = (double)(p_147732_2_ + 0); + var23 = var25 = (double)(p_147732_2_ + 1); + var27 = var33 = (double)(p_147732_4_ + 1); + var29 = var31 = (double)(p_147732_4_ + 0); + } else if(p_147732_5_ == 3) { + var19 = var25 = (double)(p_147732_2_ + 0); + var21 = var23 = (double)(p_147732_2_ + 1); + var27 = var29 = (double)(p_147732_4_ + 0); + var31 = var33 = (double)(p_147732_4_ + 1); + } else if(p_147732_5_ == 1) { + var19 = var25 = (double)(p_147732_2_ + 1); + var21 = var23 = (double)(p_147732_2_ + 0); + var27 = var29 = (double)(p_147732_4_ + 1); + var31 = var33 = (double)(p_147732_4_ + 0); + } + + var6.func_78374_a(var25, var35, var33, var9, var13); + var6.func_78374_a(var23, var35, var31, var9, var15); + var6.func_78374_a(var21, var35, var29, var11, var15); + var6.func_78374_a(var19, var35, var27, var11, var13); + } + + public void func_147804_d(Block p_147804_1_, int p_147804_2_, int p_147804_3_, int p_147804_4_) { + this.field_147837_f = true; + this.func_147731_b(p_147804_1_, p_147804_2_, p_147804_3_, p_147804_4_, true); + this.field_147837_f = false; + } + + public boolean func_147731_b(Block p_147731_1_, int p_147731_2_, int p_147731_3_, int p_147731_4_, boolean p_147731_5_) { + int var6 = this.field_147845_a.func_72805_g(p_147731_2_, p_147731_3_, p_147731_4_); + boolean var7 = p_147731_5_ || (var6 & 8) != 0; + int var8 = BlockPistonBase.func_150076_b(var6); + float var9 = 0.25F; + if(var7) { + switch(var8) { + case 0: + this.field_147875_q = 3; + this.field_147873_r = 3; + this.field_147871_s = 3; + this.field_147869_t = 3; + this.func_147782_a(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); + break; + case 1: + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); + break; + case 2: + this.field_147871_s = 1; + this.field_147869_t = 2; + this.func_147782_a(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); + break; + case 3: + this.field_147871_s = 2; + this.field_147869_t = 1; + this.field_147867_u = 3; + this.field_147865_v = 3; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); + break; + case 4: + this.field_147875_q = 1; + this.field_147873_r = 2; + this.field_147867_u = 2; + this.field_147865_v = 1; + this.func_147782_a(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + break; + case 5: + this.field_147875_q = 2; + this.field_147873_r = 1; + this.field_147867_u = 1; + this.field_147865_v = 2; + this.func_147782_a(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); + } + + ((BlockPistonBase)p_147731_1_).func_150070_b((float)this.field_147859_h, (float)this.field_147855_j, (float)this.field_147851_l, (float)this.field_147861_i, (float)this.field_147857_k, (float)this.field_147853_m); + this.func_147784_q(p_147731_1_, p_147731_2_, p_147731_3_, p_147731_4_); + this.field_147875_q = 0; + this.field_147873_r = 0; + this.field_147871_s = 0; + this.field_147869_t = 0; + this.field_147867_u = 0; + this.field_147865_v = 0; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + ((BlockPistonBase)p_147731_1_).func_150070_b((float)this.field_147859_h, (float)this.field_147855_j, (float)this.field_147851_l, (float)this.field_147861_i, (float)this.field_147857_k, (float)this.field_147853_m); + } else { + switch(var8) { + case 0: + this.field_147875_q = 3; + this.field_147873_r = 3; + this.field_147871_s = 3; + this.field_147869_t = 3; + case 1: + default: + break; + case 2: + this.field_147871_s = 1; + this.field_147869_t = 2; + break; + case 3: + this.field_147871_s = 2; + this.field_147869_t = 1; + this.field_147867_u = 3; + this.field_147865_v = 3; + break; + case 4: + this.field_147875_q = 1; + this.field_147873_r = 2; + this.field_147867_u = 2; + this.field_147865_v = 1; + break; + case 5: + this.field_147875_q = 2; + this.field_147873_r = 1; + this.field_147867_u = 1; + this.field_147865_v = 2; + } + + this.func_147784_q(p_147731_1_, p_147731_2_, p_147731_3_, p_147731_4_); + this.field_147875_q = 0; + this.field_147873_r = 0; + this.field_147871_s = 0; + this.field_147869_t = 0; + this.field_147867_u = 0; + this.field_147865_v = 0; + } + + return true; + } + + public void func_147763_a(double p_147763_1_, double p_147763_3_, double p_147763_5_, double p_147763_7_, double p_147763_9_, double p_147763_11_, float p_147763_13_, double p_147763_14_) { + IIcon var16 = BlockPistonBase.func_150074_e("piston_side"); + if(this.func_147744_b()) { + var16 = this.field_147840_d; + } + + Tessellator var17 = Tessellator.field_78398_a; + double var18 = (double)var16.func_94209_e(); + double var20 = (double)var16.func_94206_g(); + double var22 = (double)var16.func_94214_a(p_147763_14_); + double var24 = (double)var16.func_94207_b(4.0D); + var17.func_78386_a(p_147763_13_, p_147763_13_, p_147763_13_); + var17.func_78374_a(p_147763_1_, p_147763_7_, p_147763_9_, var22, var20); + var17.func_78374_a(p_147763_1_, p_147763_5_, p_147763_9_, var18, var20); + var17.func_78374_a(p_147763_3_, p_147763_5_, p_147763_11_, var18, var24); + var17.func_78374_a(p_147763_3_, p_147763_7_, p_147763_11_, var22, var24); + } + + public void func_147789_b(double p_147789_1_, double p_147789_3_, double p_147789_5_, double p_147789_7_, double p_147789_9_, double p_147789_11_, float p_147789_13_, double p_147789_14_) { + IIcon var16 = BlockPistonBase.func_150074_e("piston_side"); + if(this.func_147744_b()) { + var16 = this.field_147840_d; + } + + Tessellator var17 = Tessellator.field_78398_a; + double var18 = (double)var16.func_94209_e(); + double var20 = (double)var16.func_94206_g(); + double var22 = (double)var16.func_94214_a(p_147789_14_); + double var24 = (double)var16.func_94207_b(4.0D); + var17.func_78386_a(p_147789_13_, p_147789_13_, p_147789_13_); + var17.func_78374_a(p_147789_1_, p_147789_5_, p_147789_11_, var22, var20); + var17.func_78374_a(p_147789_1_, p_147789_5_, p_147789_9_, var18, var20); + var17.func_78374_a(p_147789_3_, p_147789_7_, p_147789_9_, var18, var24); + var17.func_78374_a(p_147789_3_, p_147789_7_, p_147789_11_, var22, var24); + } + + public void func_147738_c(double p_147738_1_, double p_147738_3_, double p_147738_5_, double p_147738_7_, double p_147738_9_, double p_147738_11_, float p_147738_13_, double p_147738_14_) { + IIcon var16 = BlockPistonBase.func_150074_e("piston_side"); + if(this.func_147744_b()) { + var16 = this.field_147840_d; + } + + Tessellator var17 = Tessellator.field_78398_a; + double var18 = (double)var16.func_94209_e(); + double var20 = (double)var16.func_94206_g(); + double var22 = (double)var16.func_94214_a(p_147738_14_); + double var24 = (double)var16.func_94207_b(4.0D); + var17.func_78386_a(p_147738_13_, p_147738_13_, p_147738_13_); + var17.func_78374_a(p_147738_3_, p_147738_5_, p_147738_9_, var22, var20); + var17.func_78374_a(p_147738_1_, p_147738_5_, p_147738_9_, var18, var20); + var17.func_78374_a(p_147738_1_, p_147738_7_, p_147738_11_, var18, var24); + var17.func_78374_a(p_147738_3_, p_147738_7_, p_147738_11_, var22, var24); + } + + public void func_147750_a(Block p_147750_1_, int p_147750_2_, int p_147750_3_, int p_147750_4_, boolean p_147750_5_) { + this.field_147837_f = true; + this.func_147809_c(p_147750_1_, p_147750_2_, p_147750_3_, p_147750_4_, p_147750_5_); + this.field_147837_f = false; + } + + public boolean func_147809_c(Block p_147809_1_, int p_147809_2_, int p_147809_3_, int p_147809_4_, boolean p_147809_5_) { + int var6 = this.field_147845_a.func_72805_g(p_147809_2_, p_147809_3_, p_147809_4_); + int var7 = BlockPistonExtension.func_150085_b(var6); + float var8 = 0.25F; + float var9 = 0.375F; + float var10 = 0.625F; + float var11 = p_147809_5_?1.0F:0.5F; + double var12 = p_147809_5_?16.0D:8.0D; + switch(var7) { + case 0: + this.field_147875_q = 3; + this.field_147873_r = 3; + this.field_147871_s = 3; + this.field_147869_t = 3; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); + this.func_147784_q(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.func_147763_a((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.8F, var12); + this.func_147763_a((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.8F, var12); + this.func_147763_a((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 0.6F, var12); + this.func_147763_a((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + var11), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.6F, var12); + break; + case 1: + this.func_147782_a(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); + this.func_147784_q(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.func_147763_a((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.8F, var12); + this.func_147763_a((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.8F, var12); + this.func_147763_a((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 0.6F, var12); + this.func_147763_a((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ - 0.25F + 1.0F - var11), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.6F, var12); + break; + case 2: + this.field_147871_s = 1; + this.field_147869_t = 2; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); + this.func_147784_q(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.func_147789_b((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), 0.6F, var12); + this.func_147789_b((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), 0.6F, var12); + this.func_147789_b((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), 0.5F, var12); + this.func_147789_b((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + var11), 1.0F, var12); + break; + case 3: + this.field_147871_s = 2; + this.field_147869_t = 1; + this.field_147867_u = 3; + this.field_147865_v = 3; + this.func_147782_a(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); + this.func_147784_q(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.func_147789_b((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), 0.6F, var12); + this.func_147789_b((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), 0.6F, var12); + this.func_147789_b((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), 0.5F, var12); + this.func_147789_b((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ - 0.25F + 1.0F - var11), (double)((float)p_147809_4_ - 0.25F + 1.0F), 1.0F, var12); + break; + case 4: + this.field_147875_q = 1; + this.field_147873_r = 2; + this.field_147867_u = 2; + this.field_147865_v = 1; + this.func_147782_a(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); + this.func_147784_q(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.func_147738_c((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.5F, var12); + this.func_147738_c((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 1.0F, var12); + this.func_147738_c((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.6F, var12); + this.func_147738_c((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + var11), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.6F, var12); + break; + case 5: + this.field_147875_q = 2; + this.field_147873_r = 1; + this.field_147867_u = 1; + this.field_147865_v = 2; + this.func_147782_a(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.func_147784_q(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.func_147738_c((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.5F, var12); + this.func_147738_c((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 1.0F, var12); + this.func_147738_c((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.6F, var12); + this.func_147738_c((double)((float)p_147809_2_ - 0.25F + 1.0F - var11), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.6F, var12); + } + + this.field_147875_q = 0; + this.field_147873_r = 0; + this.field_147871_s = 0; + this.field_147869_t = 0; + this.field_147867_u = 0; + this.field_147865_v = 0; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return true; + } + + public boolean func_147790_e(Block p_147790_1_, int p_147790_2_, int p_147790_3_, int p_147790_4_) { + int var5 = this.field_147845_a.func_72805_g(p_147790_2_, p_147790_3_, p_147790_4_); + int var6 = var5 & 7; + boolean var7 = (var5 & 8) > 0; + Tessellator var8 = Tessellator.field_78398_a; + boolean var9 = this.func_147744_b(); + if(!var9) { + this.func_147757_a(this.func_147745_b(Blocks.field_150347_e)); + } + + float var10 = 0.25F; + float var11 = 0.1875F; + float var12 = 0.1875F; + if(var6 == 5) { + this.func_147782_a((double)(0.5F - var11), 0.0D, (double)(0.5F - var10), (double)(0.5F + var11), (double)var12, (double)(0.5F + var10)); + } else if(var6 == 6) { + this.func_147782_a((double)(0.5F - var10), 0.0D, (double)(0.5F - var11), (double)(0.5F + var10), (double)var12, (double)(0.5F + var11)); + } else if(var6 == 4) { + this.func_147782_a((double)(0.5F - var11), (double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F + var11), (double)(0.5F + var10), 1.0D); + } else if(var6 == 3) { + this.func_147782_a((double)(0.5F - var11), (double)(0.5F - var10), 0.0D, (double)(0.5F + var11), (double)(0.5F + var10), (double)var12); + } else if(var6 == 2) { + this.func_147782_a((double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F - var11), 1.0D, (double)(0.5F + var10), (double)(0.5F + var11)); + } else if(var6 == 1) { + this.func_147782_a(0.0D, (double)(0.5F - var10), (double)(0.5F - var11), (double)var12, (double)(0.5F + var10), (double)(0.5F + var11)); + } else if(var6 == 0) { + this.func_147782_a((double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F - var11), (double)(0.5F + var10), 1.0D, (double)(0.5F + var11)); + } else if(var6 == 7) { + this.func_147782_a((double)(0.5F - var11), (double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F + var11), 1.0D, (double)(0.5F + var10)); + } + + this.func_147784_q(p_147790_1_, p_147790_2_, p_147790_3_, p_147790_4_); + if(!var9) { + this.func_147771_a(); + } + + var8.func_78380_c(p_147790_1_.func_149677_c(this.field_147845_a, p_147790_2_, p_147790_3_, p_147790_4_)); + var8.func_78386_a(1.0F, 1.0F, 1.0F); + IIcon var13 = this.func_147777_a(p_147790_1_, 0); + if(this.func_147744_b()) { + var13 = this.field_147840_d; + } + + double var14 = (double)var13.func_94209_e(); + double var16 = (double)var13.func_94206_g(); + double var18 = (double)var13.func_94212_f(); + double var20 = (double)var13.func_94210_h(); + Vec3[] var22 = new Vec3[8]; + float var23 = 0.0625F; + float var24 = 0.0625F; + float var25 = 0.625F; + var22[0] = Vec3.func_72443_a((double)(-var23), 0.0D, (double)(-var24)); + var22[1] = Vec3.func_72443_a((double)var23, 0.0D, (double)(-var24)); + var22[2] = Vec3.func_72443_a((double)var23, 0.0D, (double)var24); + var22[3] = Vec3.func_72443_a((double)(-var23), 0.0D, (double)var24); + var22[4] = Vec3.func_72443_a((double)(-var23), (double)var25, (double)(-var24)); + var22[5] = Vec3.func_72443_a((double)var23, (double)var25, (double)(-var24)); + var22[6] = Vec3.func_72443_a((double)var23, (double)var25, (double)var24); + var22[7] = Vec3.func_72443_a((double)(-var23), (double)var25, (double)var24); + + for(int var31 = 0; var31 < 8; ++var31) { + if(var7) { + var22[var31].field_72449_c -= 0.0625D; + var22[var31].func_72440_a(0.69813174F); + } else { + var22[var31].field_72449_c += 0.0625D; + var22[var31].func_72440_a(-0.69813174F); + } + + if(var6 == 0 || var6 == 7) { + var22[var31].func_72446_c(3.1415927F); + } + + if(var6 == 6 || var6 == 0) { + var22[var31].func_72442_b(1.5707964F); + } + + if(var6 > 0 && var6 < 5) { + var22[var31].field_72448_b -= 0.375D; + var22[var31].func_72440_a(1.5707964F); + if(var6 == 4) { + var22[var31].func_72442_b(0.0F); + } + + if(var6 == 3) { + var22[var31].func_72442_b(3.1415927F); + } + + if(var6 == 2) { + var22[var31].func_72442_b(1.5707964F); + } + + if(var6 == 1) { + var22[var31].func_72442_b(-1.5707964F); + } + + var22[var31].field_72450_a += (double)p_147790_2_ + 0.5D; + var22[var31].field_72448_b += (double)((float)p_147790_3_ + 0.5F); + var22[var31].field_72449_c += (double)p_147790_4_ + 0.5D; + } else if(var6 != 0 && var6 != 7) { + var22[var31].field_72450_a += (double)p_147790_2_ + 0.5D; + var22[var31].field_72448_b += (double)((float)p_147790_3_ + 0.125F); + var22[var31].field_72449_c += (double)p_147790_4_ + 0.5D; + } else { + var22[var31].field_72450_a += (double)p_147790_2_ + 0.5D; + var22[var31].field_72448_b += (double)((float)p_147790_3_ + 0.875F); + var22[var31].field_72449_c += (double)p_147790_4_ + 0.5D; + } + } + + Vec3 var311 = null; + Vec3 var27 = null; + Vec3 var28 = null; + Vec3 var29 = null; + + for(int var30 = 0; var30 < 6; ++var30) { + if(var30 == 0) { + var14 = (double)var13.func_94214_a(7.0D); + var16 = (double)var13.func_94207_b(6.0D); + var18 = (double)var13.func_94214_a(9.0D); + var20 = (double)var13.func_94207_b(8.0D); + } else if(var30 == 2) { + var14 = (double)var13.func_94214_a(7.0D); + var16 = (double)var13.func_94207_b(6.0D); + var18 = (double)var13.func_94214_a(9.0D); + var20 = (double)var13.func_94210_h(); + } + + if(var30 == 0) { + var311 = var22[0]; + var27 = var22[1]; + var28 = var22[2]; + var29 = var22[3]; + } else if(var30 == 1) { + var311 = var22[7]; + var27 = var22[6]; + var28 = var22[5]; + var29 = var22[4]; + } else if(var30 == 2) { + var311 = var22[1]; + var27 = var22[0]; + var28 = var22[4]; + var29 = var22[5]; + } else if(var30 == 3) { + var311 = var22[2]; + var27 = var22[1]; + var28 = var22[5]; + var29 = var22[6]; + } else if(var30 == 4) { + var311 = var22[3]; + var27 = var22[2]; + var28 = var22[6]; + var29 = var22[7]; + } else if(var30 == 5) { + var311 = var22[0]; + var27 = var22[3]; + var28 = var22[7]; + var29 = var22[4]; + } + + var8.func_78374_a(var311.field_72450_a, var311.field_72448_b, var311.field_72449_c, var14, var20); + var8.func_78374_a(var27.field_72450_a, var27.field_72448_b, var27.field_72449_c, var18, var20); + var8.func_78374_a(var28.field_72450_a, var28.field_72448_b, var28.field_72449_c, var18, var16); + var8.func_78374_a(var29.field_72450_a, var29.field_72448_b, var29.field_72449_c, var14, var16); + } + + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147790_2_, p_147790_3_, p_147790_4_)) { + this.renderSnow(p_147790_2_, p_147790_3_, p_147790_4_, Blocks.field_150431_aC.func_149669_A()); + } + + return true; + } + + public boolean func_147723_f(Block p_147723_1_, int p_147723_2_, int p_147723_3_, int p_147723_4_) { + Tessellator var5 = Tessellator.field_78398_a; + int var6 = this.field_147845_a.func_72805_g(p_147723_2_, p_147723_3_, p_147723_4_); + int var7 = var6 & 3; + boolean var8 = (var6 & 4) == 4; + boolean var9 = (var6 & 8) == 8; + boolean var10 = !World.func_147466_a(this.field_147845_a, p_147723_2_, p_147723_3_ - 1, p_147723_4_); + boolean var11 = this.func_147744_b(); + if(!var11) { + this.func_147757_a(this.func_147745_b(Blocks.field_150344_f)); + } + + float var12 = 0.25F; + float var13 = 0.125F; + float var14 = 0.125F; + float var15 = 0.3F - var12; + float var16 = 0.3F + var12; + if(var7 == 2) { + this.func_147782_a((double)(0.5F - var13), (double)var15, (double)(1.0F - var14), (double)(0.5F + var13), (double)var16, 1.0D); + } else if(var7 == 0) { + this.func_147782_a((double)(0.5F - var13), (double)var15, 0.0D, (double)(0.5F + var13), (double)var16, (double)var14); + } else if(var7 == 1) { + this.func_147782_a((double)(1.0F - var14), (double)var15, (double)(0.5F - var13), 1.0D, (double)var16, (double)(0.5F + var13)); + } else if(var7 == 3) { + this.func_147782_a(0.0D, (double)var15, (double)(0.5F - var13), (double)var14, (double)var16, (double)(0.5F + var13)); + } + + this.func_147784_q(p_147723_1_, p_147723_2_, p_147723_3_, p_147723_4_); + if(!var11) { + this.func_147771_a(); + } + + var5.func_78380_c(p_147723_1_.func_149677_c(this.field_147845_a, p_147723_2_, p_147723_3_, p_147723_4_)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + IIcon var17 = this.func_147777_a(p_147723_1_, 0); + if(this.func_147744_b()) { + var17 = this.field_147840_d; + } + + double var18 = (double)var17.func_94209_e(); + double var20 = (double)var17.func_94206_g(); + double var22 = (double)var17.func_94212_f(); + double var24 = (double)var17.func_94210_h(); + Vec3[] var26 = new Vec3[8]; + float var27 = 0.046875F; + float var28 = 0.046875F; + float var29 = 0.3125F; + var26[0] = Vec3.func_72443_a((double)(-var27), 0.0D, (double)(-var28)); + var26[1] = Vec3.func_72443_a((double)var27, 0.0D, (double)(-var28)); + var26[2] = Vec3.func_72443_a((double)var27, 0.0D, (double)var28); + var26[3] = Vec3.func_72443_a((double)(-var27), 0.0D, (double)var28); + var26[4] = Vec3.func_72443_a((double)(-var27), (double)var29, (double)(-var28)); + var26[5] = Vec3.func_72443_a((double)var27, (double)var29, (double)(-var28)); + var26[6] = Vec3.func_72443_a((double)var27, (double)var29, (double)var28); + var26[7] = Vec3.func_72443_a((double)(-var27), (double)var29, (double)var28); + + for(int var60 = 0; var60 < 8; ++var60) { + var26[var60].field_72449_c += 0.0625D; + if(var9) { + var26[var60].func_72440_a(0.5235988F); + var26[var60].field_72448_b -= 0.4375D; + } else if(var8) { + var26[var60].func_72440_a(0.08726647F); + var26[var60].field_72448_b -= 0.4375D; + } else { + var26[var60].func_72440_a(-0.69813174F); + var26[var60].field_72448_b -= 0.375D; + } + + var26[var60].func_72440_a(1.5707964F); + if(var7 == 2) { + var26[var60].func_72442_b(0.0F); + } + + if(var7 == 0) { + var26[var60].func_72442_b(3.1415927F); + } + + if(var7 == 1) { + var26[var60].func_72442_b(1.5707964F); + } + + if(var7 == 3) { + var26[var60].func_72442_b(-1.5707964F); + } + + var26[var60].field_72450_a += (double)p_147723_2_ + 0.5D; + var26[var60].field_72448_b += (double)((float)p_147723_3_ + 0.3125F); + var26[var60].field_72449_c += (double)p_147723_4_ + 0.5D; + } + + Vec3 var601 = null; + Vec3 var31 = null; + Vec3 var32 = null; + Vec3 var33 = null; + byte var34 = 7; + byte var35 = 9; + byte var36 = 9; + byte var37 = 16; + + for(int var61 = 0; var61 < 6; ++var61) { + if(var61 == 0) { + var601 = var26[0]; + var31 = var26[1]; + var32 = var26[2]; + var33 = var26[3]; + var18 = (double)var17.func_94214_a((double)var34); + var20 = (double)var17.func_94207_b((double)var36); + var22 = (double)var17.func_94214_a((double)var35); + var24 = (double)var17.func_94207_b((double)(var36 + 2)); + } else if(var61 == 1) { + var601 = var26[7]; + var31 = var26[6]; + var32 = var26[5]; + var33 = var26[4]; + } else if(var61 == 2) { + var601 = var26[1]; + var31 = var26[0]; + var32 = var26[4]; + var33 = var26[5]; + var18 = (double)var17.func_94214_a((double)var34); + var20 = (double)var17.func_94207_b((double)var36); + var22 = (double)var17.func_94214_a((double)var35); + var24 = (double)var17.func_94207_b((double)var37); + } else if(var61 == 3) { + var601 = var26[2]; + var31 = var26[1]; + var32 = var26[5]; + var33 = var26[6]; + } else if(var61 == 4) { + var601 = var26[3]; + var31 = var26[2]; + var32 = var26[6]; + var33 = var26[7]; + } else if(var61 == 5) { + var601 = var26[0]; + var31 = var26[3]; + var32 = var26[7]; + var33 = var26[4]; + } + + var5.func_78374_a(var601.field_72450_a, var601.field_72448_b, var601.field_72449_c, var18, var24); + var5.func_78374_a(var31.field_72450_a, var31.field_72448_b, var31.field_72449_c, var22, var24); + var5.func_78374_a(var32.field_72450_a, var32.field_72448_b, var32.field_72449_c, var22, var20); + var5.func_78374_a(var33.field_72450_a, var33.field_72448_b, var33.field_72449_c, var18, var20); + } + + float var611 = 0.09375F; + float var39 = 0.09375F; + float var40 = 0.03125F; + var26[0] = Vec3.func_72443_a((double)(-var611), 0.0D, (double)(-var39)); + var26[1] = Vec3.func_72443_a((double)var611, 0.0D, (double)(-var39)); + var26[2] = Vec3.func_72443_a((double)var611, 0.0D, (double)var39); + var26[3] = Vec3.func_72443_a((double)(-var611), 0.0D, (double)var39); + var26[4] = Vec3.func_72443_a((double)(-var611), (double)var40, (double)(-var39)); + var26[5] = Vec3.func_72443_a((double)var611, (double)var40, (double)(-var39)); + var26[6] = Vec3.func_72443_a((double)var611, (double)var40, (double)var39); + var26[7] = Vec3.func_72443_a((double)(-var611), (double)var40, (double)var39); + + for(int var62 = 0; var62 < 8; ++var62) { + var26[var62].field_72449_c += 0.21875D; + if(var9) { + var26[var62].field_72448_b -= 0.09375D; + var26[var62].field_72449_c -= 0.1625D; + var26[var62].func_72440_a(0.0F); + } else if(var8) { + var26[var62].field_72448_b += 0.015625D; + var26[var62].field_72449_c -= 0.171875D; + var26[var62].func_72440_a(0.17453294F); + } else { + var26[var62].func_72440_a(0.87266463F); + } + + if(var7 == 2) { + var26[var62].func_72442_b(0.0F); + } + + if(var7 == 0) { + var26[var62].func_72442_b(3.1415927F); + } + + if(var7 == 1) { + var26[var62].func_72442_b(1.5707964F); + } + + if(var7 == 3) { + var26[var62].func_72442_b(-1.5707964F); + } + + var26[var62].field_72450_a += (double)p_147723_2_ + 0.5D; + var26[var62].field_72448_b += (double)((float)p_147723_3_ + 0.3125F); + var26[var62].field_72449_c += (double)p_147723_4_ + 0.5D; + } + + byte var621 = 5; + byte var42 = 11; + byte var43 = 3; + byte var44 = 9; + + for(int var63 = 0; var63 < 6; ++var63) { + if(var63 == 0) { + var601 = var26[0]; + var31 = var26[1]; + var32 = var26[2]; + var33 = var26[3]; + var18 = (double)var17.func_94214_a((double)var621); + var20 = (double)var17.func_94207_b((double)var43); + var22 = (double)var17.func_94214_a((double)var42); + var24 = (double)var17.func_94207_b((double)var44); + } else if(var63 == 1) { + var601 = var26[7]; + var31 = var26[6]; + var32 = var26[5]; + var33 = var26[4]; + } else if(var63 == 2) { + var601 = var26[1]; + var31 = var26[0]; + var32 = var26[4]; + var33 = var26[5]; + var18 = (double)var17.func_94214_a((double)var621); + var20 = (double)var17.func_94207_b((double)var43); + var22 = (double)var17.func_94214_a((double)var42); + var24 = (double)var17.func_94207_b((double)(var43 + 2)); + } else if(var63 == 3) { + var601 = var26[2]; + var31 = var26[1]; + var32 = var26[5]; + var33 = var26[6]; + } else if(var63 == 4) { + var601 = var26[3]; + var31 = var26[2]; + var32 = var26[6]; + var33 = var26[7]; + } else if(var63 == 5) { + var601 = var26[0]; + var31 = var26[3]; + var32 = var26[7]; + var33 = var26[4]; + } + + var5.func_78374_a(var601.field_72450_a, var601.field_72448_b, var601.field_72449_c, var18, var24); + var5.func_78374_a(var31.field_72450_a, var31.field_72448_b, var31.field_72449_c, var22, var24); + var5.func_78374_a(var32.field_72450_a, var32.field_72448_b, var32.field_72449_c, var22, var20); + var5.func_78374_a(var33.field_72450_a, var33.field_72448_b, var33.field_72449_c, var18, var20); + } + + if(var8) { + double var631 = var26[0].field_72448_b; + float var47 = 0.03125F; + float var48 = 0.5F - var47 / 2.0F; + float var49 = var48 + var47; + double var50 = (double)var17.func_94209_e(); + double var52 = (double)var17.func_94207_b(var8?2.0D:0.0D); + double var54 = (double)var17.func_94212_f(); + double var56 = (double)var17.func_94207_b(var8?4.0D:2.0D); + double var58 = (double)(var10?3.5F:1.5F) / 16.0D; + var5.func_78386_a(0.75F, 0.75F, 0.75F); + if(var7 == 2) { + var5.func_78374_a((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var50, var52); + var5.func_78374_a((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var50, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_, var54, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_, var54, var52); + var5.func_78374_a((double)((float)p_147723_2_ + var48), var631, (double)p_147723_4_ + 0.5D, var50, var52); + var5.func_78374_a((double)((float)p_147723_2_ + var49), var631, (double)p_147723_4_ + 0.5D, var50, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var54, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.25D, var54, var52); + } else if(var7 == 0) { + var5.func_78374_a((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var50, var52); + var5.func_78374_a((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var50, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var49), var631, (double)p_147723_4_ + 0.5D, var54, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var48), var631, (double)p_147723_4_ + 0.5D, var54, var52); + var5.func_78374_a((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)(p_147723_4_ + 1), var50, var52); + var5.func_78374_a((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)(p_147723_4_ + 1), var50, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var49), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var54, var56); + var5.func_78374_a((double)((float)p_147723_2_ + var48), (double)p_147723_3_ + var58, (double)p_147723_4_ + 0.75D, var54, var52); + } else if(var7 == 1) { + var5.func_78374_a((double)p_147723_2_, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var50, var56); + var5.func_78374_a((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var54, var56); + var5.func_78374_a((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var54, var52); + var5.func_78374_a((double)p_147723_2_, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var50, var52); + var5.func_78374_a((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var50, var56); + var5.func_78374_a((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var49), var54, var56); + var5.func_78374_a((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var48), var54, var52); + var5.func_78374_a((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var50, var52); + } else { + var5.func_78374_a((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var49), var50, var56); + var5.func_78374_a((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var54, var56); + var5.func_78374_a((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var54, var52); + var5.func_78374_a((double)p_147723_2_ + 0.5D, var631, (double)((float)p_147723_4_ + var48), var50, var52); + var5.func_78374_a((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var50, var56); + var5.func_78374_a((double)(p_147723_2_ + 1), (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var49), var54, var56); + var5.func_78374_a((double)(p_147723_2_ + 1), (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var54, var52); + var5.func_78374_a((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + var58, (double)((float)p_147723_4_ + var48), var50, var52); + } + } + + return true; + } + + public boolean func_147756_g(Block p_147756_1_, int p_147756_2_, int p_147756_3_, int p_147756_4_) { + Tessellator var5 = Tessellator.field_78398_a; + IIcon var6 = this.func_147777_a(p_147756_1_, 0); + int var7 = this.field_147845_a.func_72805_g(p_147756_2_, p_147756_3_, p_147756_4_); + boolean var8 = (var7 & 4) == 4; + boolean var9 = (var7 & 2) == 2; + if(this.func_147744_b()) { + var6 = this.field_147840_d; + } + + var5.func_78380_c(p_147756_1_.func_149677_c(this.field_147845_a, p_147756_2_, p_147756_3_, p_147756_4_)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + double var10 = (double)var6.func_94209_e(); + double var12 = (double)var6.func_94207_b(var8?2.0D:0.0D); + double var14 = (double)var6.func_94212_f(); + double var16 = (double)var6.func_94207_b(var8?4.0D:2.0D); + double var18 = (double)(var9?3.5F:1.5F) / 16.0D; + boolean var20 = BlockTripWire.func_150139_a(this.field_147845_a, p_147756_2_, p_147756_3_, p_147756_4_, var7, 1); + boolean var21 = BlockTripWire.func_150139_a(this.field_147845_a, p_147756_2_, p_147756_3_, p_147756_4_, var7, 3); + boolean var22 = BlockTripWire.func_150139_a(this.field_147845_a, p_147756_2_, p_147756_3_, p_147756_4_, var7, 2); + boolean var23 = BlockTripWire.func_150139_a(this.field_147845_a, p_147756_2_, p_147756_3_, p_147756_4_, var7, 0); + float var24 = 0.03125F; + float var25 = 0.5F - var24 / 2.0F; + float var26 = var25 + var24; + if(!var22 && !var21 && !var23 && !var20) { + var22 = true; + var23 = true; + } + + if(var22) { + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var10, var12); + } + + if(var22 || var23 && !var21 && !var20) { + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.25D, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var10, var12); + } + + if(var23 || var22 && !var21 && !var20) { + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.5D, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var10, var12); + } + + if(var23) { + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var12); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)p_147756_4_ + 0.75D, var14, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var26), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var16); + var5.func_78374_a((double)((float)p_147756_2_ + var25), (double)p_147756_3_ + var18, (double)(p_147756_4_ + 1), var10, var12); + } + + if(var20) { + var5.func_78374_a((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)p_147756_2_, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + if(var20 || var21 && !var22 && !var23) { + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + if(var21 || var20 && !var22 && !var23) { + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + if(var21) { + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + var5.func_78374_a((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var10, var12); + var5.func_78374_a((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var25), var14, var12); + var5.func_78374_a((double)(p_147756_2_ + 1), (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var14, var16); + var5.func_78374_a((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + var18, (double)((float)p_147756_4_ + var26), var10, var16); + } + + return true; + } + + public boolean func_147801_a(BlockFire p_147801_1_, int p_147801_2_, int p_147801_3_, int p_147801_4_) { + Tessellator var5 = Tessellator.field_78398_a; + IIcon var6 = p_147801_1_.func_149840_c(0); + IIcon var7 = p_147801_1_.func_149840_c(1); + IIcon var8 = var6; + if(this.func_147744_b()) { + var8 = this.field_147840_d; + } + + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78380_c(p_147801_1_.func_149677_c(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_)); + double var9 = (double)var8.func_94209_e(); + double var11 = (double)var8.func_94206_g(); + double var13 = (double)var8.func_94212_f(); + double var15 = (double)var8.func_94210_h(); + float var17 = 1.4F; + double var20; + double var22; + double var24; + double var26; + double var28; + double var30; + double var32; + if(!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_)) { + float var36 = 0.2F; + float var19 = 0.0625F; + if((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 1) { + var9 = (double)var7.func_94209_e(); + var11 = (double)var7.func_94206_g(); + var13 = (double)var7.func_94212_f(); + var15 = (double)var7.func_94210_h(); + } + + if((p_147801_2_ / 2 + p_147801_3_ / 2 + p_147801_4_ / 2 & 1) == 1) { + var20 = var13; + var13 = var9; + var9 = var20; + } + + if(Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_)) { + var5.func_78374_a((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + var5.func_78374_a((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.func_78374_a((double)((float)p_147801_2_ + var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + } + + if(Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_)) { + var5.func_78374_a((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.func_78374_a((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + var5.func_78374_a((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 1), var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1), var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a((double)((float)(p_147801_2_ + 1) - var36), (double)((float)p_147801_3_ + var17 + var19), (double)(p_147801_4_ + 0), var9, var11); + } + + if(Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1)) { + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 0), var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)p_147801_4_ + var36), var13, var11); + } + + if(Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1)) { + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + var19), (double)(p_147801_4_ + 1 - 0), var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17 + var19), (double)((float)(p_147801_4_ + 1) - var36), var9, var11); + } + + if(Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_)) { + var20 = (double)p_147801_2_ + 0.5D + 0.5D; + var22 = (double)p_147801_2_ + 0.5D - 0.5D; + var24 = (double)p_147801_4_ + 0.5D + 0.5D; + var26 = (double)p_147801_4_ + 0.5D - 0.5D; + var28 = (double)p_147801_2_ + 0.5D - 0.5D; + var30 = (double)p_147801_2_ + 0.5D + 0.5D; + var32 = (double)p_147801_4_ + 0.5D - 0.5D; + double var34 = (double)p_147801_4_ + 0.5D + 0.5D; + var9 = (double)var6.func_94209_e(); + var11 = (double)var6.func_94206_g(); + var13 = (double)var6.func_94212_f(); + var15 = (double)var6.func_94210_h(); + ++p_147801_3_; + var17 = -0.2F; + if((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 0) { + var5.func_78374_a(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var13, var11); + var5.func_78374_a(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var13, var15); + var5.func_78374_a(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var9, var15); + var5.func_78374_a(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var9, var11); + var9 = (double)var7.func_94209_e(); + var11 = (double)var7.func_94206_g(); + var13 = (double)var7.func_94212_f(); + var15 = (double)var7.func_94210_h(); + var5.func_78374_a(var30, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var13, var11); + var5.func_78374_a(var22, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var13, var15); + var5.func_78374_a(var22, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a(var30, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var9, var11); + } else { + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var34, var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var26, var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var26, var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var34, var9, var11); + var9 = (double)var7.func_94209_e(); + var11 = (double)var7.func_94206_g(); + var13 = (double)var7.func_94212_f(); + var15 = (double)var7.func_94210_h(); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var32, var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var24, var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var24, var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var32, var9, var11); + } + } + } else { + double var18 = (double)p_147801_2_ + 0.5D + 0.2D; + var20 = (double)p_147801_2_ + 0.5D - 0.2D; + var22 = (double)p_147801_4_ + 0.5D + 0.2D; + var24 = (double)p_147801_4_ + 0.5D - 0.2D; + var26 = (double)p_147801_2_ + 0.5D - 0.3D; + var28 = (double)p_147801_2_ + 0.5D + 0.3D; + var30 = (double)p_147801_4_ + 0.5D - 0.3D; + var32 = (double)p_147801_4_ + 0.5D + 0.3D; + var5.func_78374_a(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var13, var11); + var5.func_78374_a(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var13, var15); + var5.func_78374_a(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var9, var11); + var5.func_78374_a(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var13, var11); + var5.func_78374_a(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var13, var15); + var5.func_78374_a(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var9, var15); + var5.func_78374_a(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var9, var11); + var9 = (double)var7.func_94209_e(); + var11 = (double)var7.func_94206_g(); + var13 = (double)var7.func_94212_f(); + var15 = (double)var7.func_94210_h(); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var32, var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var24, var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var24, var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var32, var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var30, var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var22, var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var22, var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var30, var9, var11); + var18 = (double)p_147801_2_ + 0.5D - 0.5D; + var20 = (double)p_147801_2_ + 0.5D + 0.5D; + var22 = (double)p_147801_4_ + 0.5D - 0.5D; + var24 = (double)p_147801_4_ + 0.5D + 0.5D; + var26 = (double)p_147801_2_ + 0.5D - 0.4D; + var28 = (double)p_147801_2_ + 0.5D + 0.4D; + var30 = (double)p_147801_4_ + 0.5D - 0.4D; + var32 = (double)p_147801_4_ + 0.5D + 0.4D; + var5.func_78374_a(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var9, var11); + var5.func_78374_a(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var9, var15); + var5.func_78374_a(var18, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var13, var15); + var5.func_78374_a(var26, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var13, var11); + var5.func_78374_a(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 1), var9, var11); + var5.func_78374_a(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), var9, var15); + var5.func_78374_a(var20, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), var13, var15); + var5.func_78374_a(var28, (double)((float)p_147801_3_ + var17), (double)(p_147801_4_ + 0), var13, var11); + var9 = (double)var6.func_94209_e(); + var11 = (double)var6.func_94206_g(); + var13 = (double)var6.func_94212_f(); + var15 = (double)var6.func_94210_h(); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var32, var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var24, var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var24, var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var32, var13, var11); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + var17), var30, var9, var11); + var5.func_78374_a((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), var22, var9, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), var22, var13, var15); + var5.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + var17), var30, var13, var11); + } + + return true; + } + + public boolean func_147788_h(Block p_147788_1_, int p_147788_2_, int p_147788_3_, int p_147788_4_) { + Tessellator var5 = Tessellator.field_78398_a; + int var6 = this.field_147845_a.func_72805_g(p_147788_2_, p_147788_3_, p_147788_4_); + IIcon var7 = BlockRedstoneWire.func_150173_e("cross"); + IIcon var8 = BlockRedstoneWire.func_150173_e("line"); + IIcon var9 = BlockRedstoneWire.func_150173_e("cross_overlay"); + IIcon var10 = BlockRedstoneWire.func_150173_e("line_overlay"); + var5.func_78380_c(p_147788_1_.func_149677_c(this.field_147845_a, p_147788_2_, p_147788_3_, p_147788_4_)); + float var11 = (float)var6 / 15.0F; + float var12 = var11 * 0.6F + 0.4F; + if(var6 == 0) { + var12 = 0.3F; + } + + float var13 = var11 * var11 * 0.7F - 0.5F; + float var14 = var11 * var11 * 0.6F - 0.7F; + if(var13 < 0.0F) { + var13 = 0.0F; + } + + if(var14 < 0.0F) { + var14 = 0.0F; + } + + int rsColor = CustomColorizer.getRedstoneColor(var6); + if(rsColor != -1) { + int var15 = rsColor >> 16 & 255; + int green = rsColor >> 8 & 255; + int var17 = rsColor & 255; + var12 = (float)var15 / 255.0F; + var13 = (float)green / 255.0F; + var14 = (float)var17 / 255.0F; + } + + var5.func_78386_a(var12, var13, var14); + double var151 = 0.015625D; + double var171 = 0.015625D; + boolean var19 = BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_ - 1, p_147788_3_, p_147788_4_, 1) || !this.field_147845_a.func_147439_a(p_147788_2_ - 1, p_147788_3_, p_147788_4_).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_ - 1, p_147788_3_ - 1, p_147788_4_, -1); + boolean var20 = BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_ + 1, p_147788_3_, p_147788_4_, 3) || !this.field_147845_a.func_147439_a(p_147788_2_ + 1, p_147788_3_, p_147788_4_).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_ + 1, p_147788_3_ - 1, p_147788_4_, -1); + boolean var21 = BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_, p_147788_3_, p_147788_4_ - 1, 2) || !this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_, p_147788_4_ - 1).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_, p_147788_3_ - 1, p_147788_4_ - 1, -1); + boolean var22 = BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_, p_147788_3_, p_147788_4_ + 1, 0) || !this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_, p_147788_4_ + 1).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_, p_147788_3_ - 1, p_147788_4_ + 1, -1); + if(!this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_ + 1, p_147788_4_).func_149637_q()) { + if(this.field_147845_a.func_147439_a(p_147788_2_ - 1, p_147788_3_, p_147788_4_).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_ - 1, p_147788_3_ + 1, p_147788_4_, -1)) { + var19 = true; + } + + if(this.field_147845_a.func_147439_a(p_147788_2_ + 1, p_147788_3_, p_147788_4_).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_ + 1, p_147788_3_ + 1, p_147788_4_, -1)) { + var20 = true; + } + + if(this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_, p_147788_4_ - 1).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_, p_147788_3_ + 1, p_147788_4_ - 1, -1)) { + var21 = true; + } + + if(this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_, p_147788_4_ + 1).func_149637_q() && BlockRedstoneWire.func_150174_f(this.field_147845_a, p_147788_2_, p_147788_3_ + 1, p_147788_4_ + 1, -1)) { + var22 = true; + } + } + + float var23 = (float)(p_147788_2_ + 0); + float var24 = (float)(p_147788_2_ + 1); + float var25 = (float)(p_147788_4_ + 0); + float var26 = (float)(p_147788_4_ + 1); + boolean var27 = false; + if((var19 || var20) && !var21 && !var22) { + var27 = true; + } + + if((var21 || var22) && !var20 && !var19) { + var27 = true; + } + + if(!var27) { + int var33 = 0; + int var29 = 0; + int var30 = 16; + int var31 = 16; + boolean var32 = true; + if(!var19) { + var23 += 0.3125F; + } + + if(!var19) { + var33 += 5; + } + + if(!var20) { + var24 -= 0.3125F; + } + + if(!var20) { + var30 -= 5; + } + + if(!var21) { + var25 += 0.3125F; + } + + if(!var21) { + var29 += 5; + } + + if(!var22) { + var26 -= 0.3125F; + } + + if(!var22) { + var31 -= 5; + } + + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var7.func_94214_a((double)var30), (double)var7.func_94207_b((double)var31)); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var7.func_94214_a((double)var30), (double)var7.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var7.func_94214_a((double)var33), (double)var7.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var7.func_94214_a((double)var33), (double)var7.func_94207_b((double)var31)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var9.func_94214_a((double)var30), (double)var9.func_94207_b((double)var31)); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.func_94214_a((double)var30), (double)var9.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var9.func_94214_a((double)var33), (double)var9.func_94207_b((double)var29)); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var9.func_94214_a((double)var33), (double)var9.func_94207_b((double)var31)); + } else if(var27) { + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94209_e(), (double)var8.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.func_94209_e(), (double)var8.func_94210_h()); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.func_94212_f(), (double)var10.func_94210_h()); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.func_94212_f(), (double)var10.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.func_94209_e(), (double)var10.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.func_94209_e(), (double)var10.func_94210_h()); + } else { + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94209_e(), (double)var8.func_94210_h()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var8.func_94209_e(), (double)var8.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.func_94212_f(), (double)var10.func_94210_h()); + var5.func_78374_a((double)var24, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.func_94209_e(), (double)var10.func_94210_h()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var25, (double)var10.func_94209_e(), (double)var10.func_94206_g()); + var5.func_78374_a((double)var23, (double)p_147788_3_ + 0.015625D, (double)var26, (double)var10.func_94212_f(), (double)var10.func_94206_g()); + } + + if(!this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_ + 1, p_147788_4_).func_149637_q()) { + float var331 = 0.021875F; + if(this.field_147845_a.func_147439_a(p_147788_2_ - 1, p_147788_3_, p_147788_4_).func_149637_q() && this.field_147845_a.func_147439_a(p_147788_2_ - 1, p_147788_3_ + 1, p_147788_4_) == Blocks.field_150488_af) { + var5.func_78386_a(var12, var13, var14); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var8.func_94209_e(), (double)var8.func_94206_g()); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var8.func_94209_e(), (double)var8.func_94210_h()); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var10.func_94212_f(), (double)var10.func_94206_g()); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var10.func_94209_e(), (double)var10.func_94206_g()); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var10.func_94209_e(), (double)var10.func_94210_h()); + var5.func_78374_a((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var10.func_94212_f(), (double)var10.func_94210_h()); + } + + if(this.field_147845_a.func_147439_a(p_147788_2_ + 1, p_147788_3_, p_147788_4_).func_149637_q() && this.field_147845_a.func_147439_a(p_147788_2_ + 1, p_147788_3_ + 1, p_147788_4_) == Blocks.field_150488_af) { + var5.func_78386_a(var12, var13, var14); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var8.func_94209_e(), (double)var8.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var8.func_94209_e(), (double)var8.func_94206_g()); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)var10.func_94209_e(), (double)var10.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)var10.func_94212_f(), (double)var10.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)var10.func_94212_f(), (double)var10.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)var10.func_94209_e(), (double)var10.func_94206_g()); + } + + if(this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_, p_147788_4_ - 1).func_149637_q() && this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_ + 1, p_147788_4_ - 1) == Blocks.field_150488_af) { + var5.func_78386_a(var12, var13, var14); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var8.func_94209_e(), (double)var8.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var8.func_94209_e(), (double)var8.func_94206_g()); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var10.func_94209_e(), (double)var10.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var10.func_94212_f(), (double)var10.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)var10.func_94212_f(), (double)var10.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)var10.func_94209_e(), (double)var10.func_94206_g()); + } + + if(this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_, p_147788_4_ + 1).func_149637_q() && this.field_147845_a.func_147439_a(p_147788_2_, p_147788_3_ + 1, p_147788_4_ + 1) == Blocks.field_150488_af) { + var5.func_78386_a(var12, var13, var14); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.func_94212_f(), (double)var8.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.func_94209_e(), (double)var8.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.func_94209_e(), (double)var8.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var8.func_94212_f(), (double)var8.func_94210_h()); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.func_94212_f(), (double)var10.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.func_94209_e(), (double)var10.func_94206_g()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.func_94209_e(), (double)var10.func_94210_h()); + var5.func_78374_a((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)var10.func_94212_f(), (double)var10.func_94210_h()); + } + } + + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147788_2_, p_147788_3_, p_147788_4_)) { + this.renderSnow(p_147788_2_, p_147788_3_, p_147788_4_, 0.01D); + } + + return true; + } + + public boolean func_147766_a(BlockRailBase p_147766_1_, int p_147766_2_, int p_147766_3_, int p_147766_4_) { + Tessellator var5 = Tessellator.field_78398_a; + int var6 = this.field_147845_a.func_72805_g(p_147766_2_, p_147766_3_, p_147766_4_); + IIcon var7 = this.func_147787_a(p_147766_1_, 0, var6); + if(this.func_147744_b()) { + var7 = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + var7 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147766_1_, p_147766_2_, p_147766_3_, p_147766_4_, 1, var7); + } + + if(p_147766_1_.func_150050_e()) { + var6 &= 7; + } + + var5.func_78380_c(p_147766_1_.func_149677_c(this.field_147845_a, p_147766_2_, p_147766_3_, p_147766_4_)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + double var8 = (double)var7.func_94209_e(); + double var10 = (double)var7.func_94206_g(); + double var12 = (double)var7.func_94212_f(); + double var14 = (double)var7.func_94210_h(); + double var16 = 0.0625D; + double var18 = (double)(p_147766_2_ + 1); + double var20 = (double)(p_147766_2_ + 1); + double var22 = (double)(p_147766_2_ + 0); + double var24 = (double)(p_147766_2_ + 0); + double var26 = (double)(p_147766_4_ + 0); + double var28 = (double)(p_147766_4_ + 1); + double var30 = (double)(p_147766_4_ + 1); + double var32 = (double)(p_147766_4_ + 0); + double var34 = (double)p_147766_3_ + var16; + double var36 = (double)p_147766_3_ + var16; + double var38 = (double)p_147766_3_ + var16; + double var40 = (double)p_147766_3_ + var16; + if(var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) { + if(var6 == 8) { + var18 = var20 = (double)(p_147766_2_ + 0); + var22 = var24 = (double)(p_147766_2_ + 1); + var26 = var32 = (double)(p_147766_4_ + 1); + var28 = var30 = (double)(p_147766_4_ + 0); + } else if(var6 == 9) { + var18 = var24 = (double)(p_147766_2_ + 0); + var20 = var22 = (double)(p_147766_2_ + 1); + var26 = var28 = (double)(p_147766_4_ + 0); + var30 = var32 = (double)(p_147766_4_ + 1); + } + } else { + var18 = var24 = (double)(p_147766_2_ + 1); + var20 = var22 = (double)(p_147766_2_ + 0); + var26 = var28 = (double)(p_147766_4_ + 1); + var30 = var32 = (double)(p_147766_4_ + 0); + } + + if(var6 != 2 && var6 != 4) { + if(var6 == 3 || var6 == 5) { + ++var36; + ++var38; + } + } else { + ++var34; + ++var40; + } + + var5.func_78374_a(var18, var34, var26, var12, var10); + var5.func_78374_a(var20, var36, var28, var12, var14); + var5.func_78374_a(var22, var38, var30, var8, var14); + var5.func_78374_a(var24, var40, var32, var8, var10); + var5.func_78374_a(var24, var40, var32, var8, var10); + var5.func_78374_a(var22, var38, var30, var8, var14); + var5.func_78374_a(var20, var36, var28, var12, var14); + var5.func_78374_a(var18, var34, var26, var12, var10); + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147766_2_, p_147766_3_, p_147766_4_)) { + this.renderSnow(p_147766_2_, p_147766_3_, p_147766_4_, 0.05D); + } + + return true; + } + + public boolean func_147794_i(Block p_147794_1_, int p_147794_2_, int p_147794_3_, int p_147794_4_) { + Tessellator var5 = Tessellator.field_78398_a; + IIcon var6 = this.func_147777_a(p_147794_1_, 0); + if(this.func_147744_b()) { + var6 = this.field_147840_d; + } + + int var15 = this.field_147845_a.func_72805_g(p_147794_2_, p_147794_3_, p_147794_4_); + if(Config.isConnectedTextures() && this.field_147840_d == null) { + var6 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147794_1_, p_147794_2_, p_147794_3_, p_147794_4_, var15, var6); + } + + var5.func_78380_c(p_147794_1_.func_149677_c(this.field_147845_a, p_147794_2_, p_147794_3_, p_147794_4_)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + double var7 = (double)var6.func_94209_e(); + double var9 = (double)var6.func_94206_g(); + double var11 = (double)var6.func_94212_f(); + double var13 = (double)var6.func_94210_h(); + double var16 = 0.0D; + double var18 = 0.05000000074505806D; + if(var15 == 5) { + var5.func_78374_a((double)p_147794_2_ + var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) + var16, var7, var9); + var5.func_78374_a((double)p_147794_2_ + var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) + var16, var7, var13); + var5.func_78374_a((double)p_147794_2_ + var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 0) - var16, var11, var13); + var5.func_78374_a((double)p_147794_2_ + var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 0) - var16, var11, var9); + } + + if(var15 == 4) { + var5.func_78374_a((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) + var16, var11, var13); + var5.func_78374_a((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) + var16, var11, var9); + var5.func_78374_a((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 0) - var16, var7, var9); + var5.func_78374_a((double)(p_147794_2_ + 1) - var18, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 0) - var16, var7, var13); + } + + if(var15 == 3) { + var5.func_78374_a((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 0) - var16, (double)p_147794_4_ + var18, var11, var13); + var5.func_78374_a((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 1) + var16, (double)p_147794_4_ + var18, var11, var9); + var5.func_78374_a((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 1) + var16, (double)p_147794_4_ + var18, var7, var9); + var5.func_78374_a((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 0) - var16, (double)p_147794_4_ + var18, var7, var13); + } + + if(var15 == 2) { + var5.func_78374_a((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) - var18, var7, var9); + var5.func_78374_a((double)(p_147794_2_ + 1) + var16, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) - var18, var7, var13); + var5.func_78374_a((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 0) - var16, (double)(p_147794_4_ + 1) - var18, var11, var13); + var5.func_78374_a((double)(p_147794_2_ + 0) - var16, (double)(p_147794_3_ + 1) + var16, (double)(p_147794_4_ + 1) - var18, var11, var9); + } + + return true; + } + + public boolean func_147726_j(Block p_147726_1_, int p_147726_2_, int p_147726_3_, int p_147726_4_) { + Tessellator var5 = Tessellator.field_78398_a; + IIcon var6 = this.func_147777_a(p_147726_1_, 0); + if(this.func_147744_b()) { + var6 = this.field_147840_d; + } + + int var17 = this.field_147845_a.func_72805_g(p_147726_2_, p_147726_3_, p_147726_4_); + if(Config.isConnectedTextures() && this.field_147840_d == null) { + byte var7 = 0; + if((var17 & 1) != 0) { + var7 = 2; + } else if((var17 & 2) != 0) { + var7 = 5; + } else if((var17 & 4) != 0) { + var7 = 3; + } else if((var17 & 8) != 0) { + var7 = 4; + } + + var6 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147726_1_, p_147726_2_, p_147726_3_, p_147726_4_, var7, var6); + } + + var5.func_78380_c(p_147726_1_.func_149677_c(this.field_147845_a, p_147726_2_, p_147726_3_, p_147726_4_)); + int var71 = CustomColorizer.getColorMultiplier(p_147726_1_, this.field_147845_a, p_147726_2_, p_147726_3_, p_147726_4_); + float var8 = (float)(var71 >> 16 & 255) / 255.0F; + float var9 = (float)(var71 >> 8 & 255) / 255.0F; + float var10 = (float)(var71 & 255) / 255.0F; + var5.func_78386_a(var8, var9, var10); + double var18 = (double)var6.func_94209_e(); + double var19 = (double)var6.func_94206_g(); + double var11 = (double)var6.func_94212_f(); + double var13 = (double)var6.func_94210_h(); + double var15 = 0.05000000074505806D; + if((var17 & 2) != 0) { + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var18, var19); + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var18, var13); + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var11, var13); + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var11, var19); + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var11, var19); + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var11, var13); + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var18, var13); + var5.func_78374_a((double)p_147726_2_ + var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var18, var19); + } + + if((var17 & 8) != 0) { + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var11, var13); + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var11, var19); + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var18, var19); + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var18, var13); + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), var18, var13); + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), var18, var19); + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), var11, var19); + var5.func_78374_a((double)(p_147726_2_ + 1) - var15, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), var11, var13); + } + + if((var17 & 4) != 0) { + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var11, var13); + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var11, var19); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var18, var19); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var18, var13); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var18, var13); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var18, var19); + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)p_147726_4_ + var15, var11, var19); + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)p_147726_4_ + var15, var11, var13); + } + + if((var17 & 1) != 0) { + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var18, var19); + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var18, var13); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var11, var13); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var11, var19); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var11, var19); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var11, var13); + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - var15, var18, var13); + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - var15, var18, var19); + } + + if(this.field_147845_a.func_147439_a(p_147726_2_, p_147726_3_ + 1, p_147726_4_).func_149637_q()) { + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 0), var18, var19); + var5.func_78374_a((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 1), var18, var13); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 1), var11, var13); + var5.func_78374_a((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1) - var15, (double)(p_147726_4_ + 0), var11, var19); + } + + return true; + } + + public boolean func_147733_k(Block block, int x, int y, int z) { + int var5 = this.field_147845_a.func_72800_K(); + Tessellator var6 = Tessellator.field_78398_a; + var6.func_78380_c(block.func_149677_c(this.field_147845_a, x, y, z)); + int var7 = block.func_149720_d(this.field_147845_a, x, y, z); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float isStainedGlass = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float iconGlass = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float iconGlassPaneTop = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = isStainedGlass; + var9 = iconGlass; + var10 = iconGlassPaneTop; + } + + var6.func_78386_a(var8, var9, var10); + boolean isStainedGlass1 = block instanceof BlockStainedGlassPane; + int metadata = 0; + IIcon iconGlass1; + IIcon iconGlassPaneTop1; + if(this.func_147744_b()) { + iconGlass1 = this.field_147840_d; + iconGlassPaneTop1 = this.field_147840_d; + } else { + metadata = this.field_147845_a.func_72805_g(x, y, z); + iconGlass1 = this.func_147787_a(block, 0, metadata); + iconGlassPaneTop1 = isStainedGlass1?((BlockStainedGlassPane)block).func_150104_b(metadata):((BlockPane)block).func_150097_e(); + } + + IIcon iconZ = iconGlass1; + boolean drawTop = true; + boolean drawBottom = true; + if(Config.isConnectedTextures() && this.field_147840_d == null) { + IIcon gMinU = ConnectedTextures.getConnectedTexture(this.field_147845_a, block, x, y, z, 4, iconGlass1); + IIcon iz = ConnectedTextures.getConnectedTexture(this.field_147845_a, block, x, y, z, 3, iconGlass1); + if(gMinU != iconGlass1 || iz != iconGlass1) { + BlockPane gHalf7U = (BlockPane)block; + drawTop = this.field_147845_a.func_147439_a(x, y + 1, z) != block || this.field_147845_a.func_72805_g(x, y + 1, z) != metadata; + drawBottom = this.field_147845_a.func_147439_a(x, y - 1, z) != block || this.field_147845_a.func_72805_g(x, y - 1, z) != metadata; + } + + iconGlass1 = gMinU; + iconZ = iz; + } + + double gMinU1 = (double)iconGlass1.func_94209_e(); + double gHalf7U1 = (double)iconGlass1.func_94214_a(7.0D); + double gHalf9U = (double)iconGlass1.func_94214_a(9.0D); + double gMaxU = (double)iconGlass1.func_94212_f(); + double gMinV = (double)iconGlass1.func_94206_g(); + double gMaxV = (double)iconGlass1.func_94210_h(); + double gMinUz = (double)iconZ.func_94209_e(); + double gHalf7Uz = (double)iconZ.func_94214_a(7.0D); + double gHalf9Uz = (double)iconZ.func_94214_a(9.0D); + double gMaxUz = (double)iconZ.func_94212_f(); + double gMinVz = (double)iconZ.func_94206_g(); + double gMaxVz = (double)iconZ.func_94210_h(); + double var26 = (double)iconGlassPaneTop1.func_94214_a(7.0D); + double var28 = (double)iconGlassPaneTop1.func_94214_a(9.0D); + double var30 = (double)iconGlassPaneTop1.func_94206_g(); + double var32 = (double)iconGlassPaneTop1.func_94210_h(); + double var34 = (double)iconGlassPaneTop1.func_94207_b(7.0D); + double var36 = (double)iconGlassPaneTop1.func_94207_b(9.0D); + double x0 = (double)x; + double x1 = (double)(x + 1); + double z0 = (double)z; + double z1 = (double)(z + 1); + double xHalfMin = (double)x + 0.5D - 0.0625D; + double xHalfMax = (double)x + 0.5D + 0.0625D; + double zHalfMin = (double)z + 0.5D - 0.0625D; + double zHalfMax = (double)z + 0.5D + 0.0625D; + boolean connZNeg = isStainedGlass1?((BlockStainedGlassPane)block).func_150098_a(this.field_147845_a.func_147439_a(x, y, z - 1)):((BlockPane)block).func_150098_a(this.field_147845_a.func_147439_a(x, y, z - 1)); + boolean connZPos = isStainedGlass1?((BlockStainedGlassPane)block).func_150098_a(this.field_147845_a.func_147439_a(x, y, z + 1)):((BlockPane)block).func_150098_a(this.field_147845_a.func_147439_a(x, y, z + 1)); + boolean connXNeg = isStainedGlass1?((BlockStainedGlassPane)block).func_150098_a(this.field_147845_a.func_147439_a(x - 1, y, z)):((BlockPane)block).func_150098_a(this.field_147845_a.func_147439_a(x - 1, y, z)); + boolean connXPos = isStainedGlass1?((BlockStainedGlassPane)block).func_150098_a(this.field_147845_a.func_147439_a(x + 1, y, z)):((BlockPane)block).func_150098_a(this.field_147845_a.func_147439_a(x + 1, y, z)); + double var58 = 0.001D; + double var60 = 0.999D; + double var62 = 0.001D; + boolean disconnected = !connZNeg && !connZPos && !connXNeg && !connXPos; + double yTop = (double)y + 0.999D; + double yBottom = (double)y + 0.001D; + if(!drawTop) { + yTop = (double)(y + 1); + } + + if(!drawBottom) { + yBottom = (double)y; + } + + if(!connXNeg && !disconnected) { + if(!connZNeg && !connZPos) { + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + } + } else if(connXNeg && connXPos) { + if(!connZNeg) { + var6.func_78374_a(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.func_78374_a(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.func_78374_a(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.func_78374_a(x0, yTop, zHalfMin, gMinUz, gMinVz); + } else { + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.func_78374_a(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.func_78374_a(x0, yTop, zHalfMin, gMinUz, gMinVz); + var6.func_78374_a(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.func_78374_a(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + } + + if(!connZPos) { + var6.func_78374_a(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.func_78374_a(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.func_78374_a(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.func_78374_a(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } else { + var6.func_78374_a(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.func_78374_a(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.func_78374_a(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.func_78374_a(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } + + if(drawTop) { + var6.func_78374_a(x0, yTop, zHalfMax, var28, var30); + var6.func_78374_a(x1, yTop, zHalfMax, var28, var32); + var6.func_78374_a(x1, yTop, zHalfMin, var26, var32); + var6.func_78374_a(x0, yTop, zHalfMin, var26, var30); + } + + if(drawBottom) { + var6.func_78374_a(x1, yBottom, zHalfMax, var26, var32); + var6.func_78374_a(x0, yBottom, zHalfMax, var26, var30); + var6.func_78374_a(x0, yBottom, zHalfMin, var28, var30); + var6.func_78374_a(x1, yBottom, zHalfMin, var28, var32); + } + } else { + if(!connZNeg && !disconnected) { + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.func_78374_a(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.func_78374_a(x0, yTop, zHalfMin, gMinUz, gMinVz); + } else { + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.func_78374_a(x0, yBottom, zHalfMin, gMinUz, gMaxVz); + var6.func_78374_a(x0, yTop, zHalfMin, gMinUz, gMinVz); + } + + if(!connZPos && !disconnected) { + var6.func_78374_a(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.func_78374_a(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + } else { + var6.func_78374_a(x0, yTop, zHalfMax, gMinUz, gMinVz); + var6.func_78374_a(x0, yBottom, zHalfMax, gMinUz, gMaxVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + } + + if(drawTop) { + var6.func_78374_a(x0, yTop, zHalfMax, var28, var30); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, var28, var34); + var6.func_78374_a(xHalfMin, yTop, zHalfMin, var26, var34); + var6.func_78374_a(x0, yTop, zHalfMin, var26, var30); + } + + if(drawBottom) { + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, var26, var34); + var6.func_78374_a(x0, yBottom, zHalfMax, var26, var30); + var6.func_78374_a(x0, yBottom, zHalfMin, var28, var30); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, var28, var34); + } + } + + if((connXPos || disconnected) && !connXNeg) { + if(!connZPos && !disconnected) { + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.func_78374_a(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.func_78374_a(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } else { + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.func_78374_a(x1, yBottom, zHalfMax, gMaxUz, gMaxVz); + var6.func_78374_a(x1, yTop, zHalfMax, gMaxUz, gMinVz); + } + + if(!connZNeg && !disconnected) { + var6.func_78374_a(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.func_78374_a(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + } else { + var6.func_78374_a(x1, yTop, zHalfMin, gMaxUz, gMinVz); + var6.func_78374_a(x1, yBottom, zHalfMin, gMaxUz, gMaxVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + } + + if(drawTop) { + var6.func_78374_a(xHalfMax, yTop, zHalfMax, var28, var36); + var6.func_78374_a(x1, yTop, zHalfMax, var28, var30); + var6.func_78374_a(x1, yTop, zHalfMin, var26, var30); + var6.func_78374_a(xHalfMax, yTop, zHalfMin, var26, var36); + } + + if(drawBottom) { + var6.func_78374_a(x1, yBottom, zHalfMax, var26, var32); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, var26, var36); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, var28, var36); + var6.func_78374_a(x1, yBottom, zHalfMin, var28, var32); + } + } else if(!connXPos && !connZNeg && !connZPos) { + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf7U1, gMinV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf9U, gMinV); + } + + if(!connZNeg && !disconnected) { + if(!connXPos && !connXNeg) { + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf9Uz, gMinVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf9Uz, gMaxVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7Uz, gMaxVz); + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7Uz, gMinVz); + } + } else if(connZNeg && connZPos) { + if(!connXNeg) { + var6.func_78374_a(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.func_78374_a(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMin, yTop, z1, gMaxU, gMinV); + } else { + var6.func_78374_a(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.func_78374_a(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMin, yTop, z1, gMaxU, gMinV); + } + + if(!connXPos) { + var6.func_78374_a(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.func_78374_a(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMax, yTop, z0, gMinU1, gMinV); + } else { + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf7U1, gMinV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMax, yTop, z0, gMinU1, gMinV); + var6.func_78374_a(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.func_78374_a(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf9U, gMinV); + } + + if(drawTop) { + var6.func_78374_a(xHalfMax, yTop, z0, var28, var30); + var6.func_78374_a(xHalfMin, yTop, z0, var26, var30); + var6.func_78374_a(xHalfMin, yTop, z1, var26, var32); + var6.func_78374_a(xHalfMax, yTop, z1, var28, var32); + } + + if(drawBottom) { + var6.func_78374_a(xHalfMin, yBottom, z0, var26, var30); + var6.func_78374_a(xHalfMax, yBottom, z0, var28, var30); + var6.func_78374_a(xHalfMax, yBottom, z1, var28, var32); + var6.func_78374_a(xHalfMin, yBottom, z1, var26, var32); + } + } else { + if(!connXNeg && !disconnected) { + var6.func_78374_a(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.func_78374_a(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + } else { + var6.func_78374_a(xHalfMin, yTop, z0, gMinU1, gMinV); + var6.func_78374_a(xHalfMin, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + } + + if(!connXPos && !disconnected) { + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf9U, gMinV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMax, yTop, z0, gMinU1, gMinV); + } else { + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf7U1, gMinV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, z0, gMinU1, gMaxV); + var6.func_78374_a(xHalfMax, yTop, z0, gMinU1, gMinV); + } + + if(drawTop) { + var6.func_78374_a(xHalfMax, yTop, z0, var28, var30); + var6.func_78374_a(xHalfMin, yTop, z0, var26, var30); + var6.func_78374_a(xHalfMin, yTop, zHalfMin, var26, var34); + var6.func_78374_a(xHalfMax, yTop, zHalfMin, var28, var34); + } + + if(drawBottom) { + var6.func_78374_a(xHalfMin, yBottom, z0, var26, var30); + var6.func_78374_a(xHalfMax, yBottom, z0, var28, var30); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, var28, var34); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, var26, var34); + } + } + + if((connZPos || disconnected) && !connZNeg) { + if(!connXNeg && !disconnected) { + var6.func_78374_a(xHalfMin, yTop, zHalfMin, gHalf7U1, gMinV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMin, yTop, z1, gMaxU, gMinV); + } else { + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf9U, gMinV); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMin, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMin, yTop, z1, gMaxU, gMinV); + } + + if(!connXPos && !disconnected) { + var6.func_78374_a(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.func_78374_a(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(xHalfMax, yTop, zHalfMin, gHalf7U1, gMinV); + } else { + var6.func_78374_a(xHalfMax, yTop, z1, gMaxU, gMinV); + var6.func_78374_a(xHalfMax, yBottom, z1, gMaxU, gMaxV); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf9U, gMinV); + } + + if(drawTop) { + var6.func_78374_a(xHalfMax, yTop, zHalfMax, var28, var36); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, var26, var36); + var6.func_78374_a(xHalfMin, yTop, z1, var26, var32); + var6.func_78374_a(xHalfMax, yTop, z1, var28, var32); + } + + if(drawBottom) { + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, var26, var36); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, var28, var36); + var6.func_78374_a(xHalfMax, yBottom, z1, var28, var32); + var6.func_78374_a(xHalfMin, yBottom, z1, var26, var32); + } + } else if(!connZPos && !connXPos && !connXNeg) { + var6.func_78374_a(xHalfMin, yTop, zHalfMax, gHalf7Uz, gMinVz); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, gHalf7Uz, gMaxVz); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, gHalf9Uz, gMaxVz); + var6.func_78374_a(xHalfMax, yTop, zHalfMax, gHalf9Uz, gMinVz); + } + + if(drawTop) { + var6.func_78374_a(xHalfMax, yTop, zHalfMin, var28, var34); + var6.func_78374_a(xHalfMin, yTop, zHalfMin, var26, var34); + var6.func_78374_a(xHalfMin, yTop, zHalfMax, var26, var36); + var6.func_78374_a(xHalfMax, yTop, zHalfMax, var28, var36); + } + + if(drawBottom) { + var6.func_78374_a(xHalfMin, yBottom, zHalfMin, var26, var34); + var6.func_78374_a(xHalfMax, yBottom, zHalfMin, var28, var34); + var6.func_78374_a(xHalfMax, yBottom, zHalfMax, var28, var36); + var6.func_78374_a(xHalfMin, yBottom, zHalfMax, var26, var36); + } + + if(disconnected) { + var6.func_78374_a(x0, yTop, zHalfMin, gHalf7U1, gMinV); + var6.func_78374_a(x0, yBottom, zHalfMin, gHalf7U1, gMaxV); + var6.func_78374_a(x0, yBottom, zHalfMax, gHalf9U, gMaxV); + var6.func_78374_a(x0, yTop, zHalfMax, gHalf9U, gMinV); + var6.func_78374_a(x1, yTop, zHalfMax, gHalf7U1, gMinV); + var6.func_78374_a(x1, yBottom, zHalfMax, gHalf7U1, gMaxV); + var6.func_78374_a(x1, yBottom, zHalfMin, gHalf9U, gMaxV); + var6.func_78374_a(x1, yTop, zHalfMin, gHalf9U, gMinV); + var6.func_78374_a(xHalfMax, yTop, z0, gHalf9Uz, gMinVz); + var6.func_78374_a(xHalfMax, yBottom, z0, gHalf9Uz, gMaxVz); + var6.func_78374_a(xHalfMin, yBottom, z0, gHalf7Uz, gMaxVz); + var6.func_78374_a(xHalfMin, yTop, z0, gHalf7Uz, gMinVz); + var6.func_78374_a(xHalfMin, yTop, z1, gHalf7Uz, gMinVz); + var6.func_78374_a(xHalfMin, yBottom, z1, gHalf7Uz, gMaxVz); + var6.func_78374_a(xHalfMax, yBottom, z1, gHalf9Uz, gMaxVz); + var6.func_78374_a(xHalfMax, yTop, z1, gHalf9Uz, gMinVz); + } + + return true; + } + + public boolean func_147767_a(BlockPane p_147767_1_, int p_147767_2_, int p_147767_3_, int p_147767_4_) { + int var5 = this.field_147845_a.func_72800_K(); + Tessellator var6 = Tessellator.field_78398_a; + var6.func_78380_c(p_147767_1_.func_149677_c(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_)); + int var7 = p_147767_1_.func_149720_d(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var63 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var64 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float kr = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var63; + var9 = var64; + var10 = kr; + } + + var6.func_78386_a(var8, var9, var10); + IIcon var631; + IIcon var641; + if(this.func_147744_b()) { + var631 = this.field_147840_d; + var641 = this.field_147840_d; + } else { + int kr1 = this.field_147845_a.func_72805_g(p_147767_2_, p_147767_3_, p_147767_4_); + var631 = this.func_147787_a(p_147767_1_, 0, kr1); + var641 = p_147767_1_.func_150097_e(); + } + + IIcon kr2 = var631; + IIcon kz = var631; + IIcon kzr = var631; + if(Config.isConnectedTextures() && this.field_147840_d == null) { + var631 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 2, var631); + kr2 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 3, kr2); + kz = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 4, kz); + kzr = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147767_1_, p_147767_2_, p_147767_3_, p_147767_4_, 5, kzr); + } + + double var65 = (double)var631.func_94209_e(); + double var15 = (double)var631.func_94214_a(8.0D); + double var17 = (double)var631.func_94212_f(); + double var19 = (double)var631.func_94206_g(); + double var21 = (double)var631.func_94210_h(); + double dr = (double)kr2.func_94209_e(); + double d1r = (double)kr2.func_94214_a(8.0D); + double d2r = (double)kr2.func_94212_f(); + double d3r = (double)kr2.func_94206_g(); + double d4r = (double)kr2.func_94210_h(); + double dz = (double)kz.func_94209_e(); + double d1z = (double)kz.func_94214_a(8.0D); + double d2z = (double)kz.func_94212_f(); + double d3z = (double)kz.func_94206_g(); + double d4z = (double)kz.func_94210_h(); + double dzr = (double)kzr.func_94209_e(); + double d1zr = (double)kzr.func_94214_a(8.0D); + double d2zr = (double)kzr.func_94212_f(); + double d3zr = (double)kzr.func_94206_g(); + double d4zr = (double)kzr.func_94210_h(); + double var23 = (double)var641.func_94214_a(7.0D); + double var25 = (double)var641.func_94214_a(9.0D); + double var27 = (double)var641.func_94206_g(); + double var29 = (double)var641.func_94207_b(8.0D); + double var31 = (double)var641.func_94210_h(); + double var33 = (double)p_147767_2_; + double var35 = (double)p_147767_2_ + 0.5D; + double var37 = (double)(p_147767_2_ + 1); + double var39 = (double)p_147767_4_; + double var41 = (double)p_147767_4_ + 0.5D; + double var43 = (double)(p_147767_4_ + 1); + double var45 = (double)p_147767_2_ + 0.5D - 0.0625D; + double var47 = (double)p_147767_2_ + 0.5D + 0.0625D; + double var49 = (double)p_147767_4_ + 0.5D - 0.0625D; + double var51 = (double)p_147767_4_ + 0.5D + 0.0625D; + boolean var53 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ - 1)); + boolean var54 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ + 1)); + boolean var55 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ - 1, p_147767_3_, p_147767_4_)); + boolean var56 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ + 1, p_147767_3_, p_147767_4_)); + boolean var57 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); + boolean var58 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); + double var59 = 0.01D; + double var61 = 0.005D; + if((!var55 || !var56) && (var55 || var56 || var53 || var54)) { + if(var55 && !var56) { + var6.func_78374_a(var33, (double)(p_147767_3_ + 1), var41, var65, var19); + var6.func_78374_a(var33, (double)(p_147767_3_ + 0), var41, var65, var21); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, var15, var21); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, var15, var19); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, d1r, d3r); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, d1r, d4r); + var6.func_78374_a(var33, (double)(p_147767_3_ + 0), var41, d2r, d4r); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1), var41, d2r, d3r); + if(!var54 && !var53) { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var51, var23, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var51, var23, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var49, var25, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var49, var25, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var49, var23, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var49, var23, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var51, var25, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var51, var25, var27); + } + + if(var57 || p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_ - 1, p_147767_3_ + 1, p_147767_4_)) { + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + } + + if(var58 || p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_ - 1, p_147767_3_ - 1, p_147767_4_)) { + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + } + } else if(!var55 && var56) { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, var15, var19); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, var15, var21); + var6.func_78374_a(var37, (double)(p_147767_3_ + 0), var41, var17, var21); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1), var41, var17, var19); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1), var41, dr, d3r); + var6.func_78374_a(var37, (double)(p_147767_3_ + 0), var41, dr, d4r); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, d1r, d4r); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, d1r, d3r); + if(!var54 && !var53) { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var49, var23, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var49, var23, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var51, var25, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var51, var25, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var51, var23, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var51, var23, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var49, var25, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var49, var25, var27); + } + + if(var57 || p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_ + 1, p_147767_3_ + 1, p_147767_4_)) { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + } + + if(var58 || p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_ + 1, p_147767_3_ - 1, p_147767_4_)) { + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var49, var23, var27); + } + } + } else { + var6.func_78374_a(var33, (double)(p_147767_3_ + 1), var41, var65, var19); + var6.func_78374_a(var33, (double)(p_147767_3_ + 0), var41, var65, var21); + var6.func_78374_a(var37, (double)(p_147767_3_ + 0), var41, var17, var21); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1), var41, var17, var19); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1), var41, dr, d3r); + var6.func_78374_a(var37, (double)(p_147767_3_ + 0), var41, dr, d4r); + var6.func_78374_a(var33, (double)(p_147767_3_ + 0), var41, d2r, d4r); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1), var41, d2r, d3r); + if(var57) { + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + } else { + if(p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_ - 1, p_147767_3_ + 1, p_147767_4_)) { + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var31); + var6.func_78374_a(var33, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var31); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + } + + if(p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_ + 1, p_147767_3_ + 1, p_147767_4_)) { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var27); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var29); + var6.func_78374_a(var37, (double)(p_147767_3_ + 1) + 0.01D, var49, var23, var27); + } + } + + if(var58) { + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var49, var23, var31); + } else { + if(p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_ - 1, p_147767_3_ - 1, p_147767_4_)) { + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var51, var25, var31); + var6.func_78374_a(var33, (double)p_147767_3_ - 0.01D, var49, var23, var31); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + } + + if(p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_ + 1, p_147767_3_ - 1, p_147767_4_)) { + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var27); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var51, var25, var27); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var51, var25, var29); + var6.func_78374_a(var35, (double)p_147767_3_ - 0.01D, var49, var23, var29); + var6.func_78374_a(var37, (double)p_147767_3_ - 0.01D, var49, var23, var27); + } + } + } + + if((!var53 || !var54) && (var55 || var56 || var53 || var54)) { + if(var53 && !var54) { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var39, dz, d3z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var39, dz, d4z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, d1z, d4z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, d1z, d3z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, d1zr, d3zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, d1zr, d4zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var39, d2zr, d4zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var39, d2zr, d3zr); + if(!var56 && !var55) { + var6.func_78374_a(var45, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1), var41, var25, var27); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.func_78374_a(var47, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.func_78374_a(var45, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1), var41, var25, var27); + } + + if(var57 || p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ + 1, p_147767_4_ - 1)) { + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var27); + } + + if(var58 || p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ - 1, p_147767_4_ - 1)) { + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var39, var25, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var39, var23, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var25, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var39, var25, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var39, var23, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var23, var27); + } + } else if(!var53 && var54) { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, d1z, d3z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, d1z, d4z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var43, d2z, d4z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var43, d2z, d3z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var43, dzr, d3zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var43, dzr, d4zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var41, d1zr, d4zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var41, d1zr, d3zr); + if(!var56 && !var55) { + var6.func_78374_a(var47, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.func_78374_a(var47, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.func_78374_a(var45, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1), var41, var25, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1), var41, var23, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 0), var41, var23, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 0), var41, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1), var41, var25, var27); + } + + if(var57 || p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ + 1, p_147767_4_ + 1)) { + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var29); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var29); + } + + if(var58 || p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ - 1, p_147767_4_ + 1)) { + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var43, var23, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var43, var25, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var43, var23, var29); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var23, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var25, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var43, var25, var29); + } + } + } else { + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var43, dzr, d3zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var43, dzr, d4zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var39, d2zr, d4zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var39, d2zr, d3zr); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var39, dz, d3z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var39, dz, d4z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 0), var43, d2z, d4z); + var6.func_78374_a(var35, (double)(p_147767_3_ + 1), var43, d2z, d3z); + if(var57) { + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var31); + } else { + if(p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ + 1, p_147767_4_ - 1)) { + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var27); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var39, var25, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var39, var23, var29); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var27); + } + + if(p_147767_3_ < var5 - 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ + 1, p_147767_4_ + 1)) { + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var29); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var29); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var43, var23, var29); + var6.func_78374_a(var45, (double)(p_147767_3_ + 1) + 0.005D, var41, var23, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var41, var25, var31); + var6.func_78374_a(var47, (double)(p_147767_3_ + 1) + 0.005D, var43, var25, var29); + } + } + + if(var58) { + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var43, var25, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var39, var25, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var39, var23, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var43, var23, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var39, var25, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var43, var25, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var43, var23, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var39, var23, var31); + } else { + if(p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ - 1, p_147767_4_ - 1)) { + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var39, var25, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var39, var23, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var25, var27); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var39, var25, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var39, var23, var29); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var23, var27); + } + + if(p_147767_3_ > 1 && this.field_147845_a.func_147437_c(p_147767_2_, p_147767_3_ - 1, p_147767_4_ + 1)) { + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var23, var29); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var43, var23, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var43, var25, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var25, var29); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var43, var23, var29); + var6.func_78374_a(var45, (double)p_147767_3_ - 0.005D, var41, var23, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var41, var25, var31); + var6.func_78374_a(var47, (double)p_147767_3_ - 0.005D, var43, var25, var29); + } + } + } + + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147767_2_, p_147767_3_, p_147767_4_)) { + this.renderSnow(p_147767_2_, p_147767_3_, p_147767_4_, Blocks.field_150431_aC.func_149669_A()); + } + + return true; + } + + public boolean func_147746_l(Block p_147746_1_, int p_147746_2_, int p_147746_3_, int p_147746_4_) { + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147746_1_.func_149677_c(this.field_147845_a, p_147746_2_, p_147746_3_, p_147746_4_)); + int var6 = CustomColorizer.getColorMultiplier(p_147746_1_, this.field_147845_a, p_147746_2_, p_147746_3_, p_147746_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var18 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var19 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var18; + var8 = var11; + var9 = var19; + } + + var5.func_78386_a(var7, var8, var9); + double var181 = (double)p_147746_2_; + double var191 = (double)p_147746_3_; + double var14 = (double)p_147746_4_; + long var16; + if(p_147746_1_ == Blocks.field_150329_H) { + var16 = (long)(p_147746_2_ * 3129871) ^ (long)p_147746_4_ * 116129781L ^ (long)p_147746_3_; + var16 = var16 * var16 * 42317861L + var16 * 11L; + var181 += ((double)((float)(var16 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; + var191 += ((double)((float)(var16 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; + var14 += ((double)((float)(var16 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; + } else if(p_147746_1_ == Blocks.field_150328_O || p_147746_1_ == Blocks.field_150327_N) { + var16 = (long)(p_147746_2_ * 3129871) ^ (long)p_147746_4_ * 116129781L ^ (long)p_147746_3_; + var16 = var16 * var16 * 42317861L + var16 * 11L; + var181 += ((double)((float)(var16 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D; + var14 += ((double)((float)(var16 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D; + } + + IIcon var20 = this.func_147787_a(p_147746_1_, 0, this.field_147845_a.func_72805_g(p_147746_2_, p_147746_3_, p_147746_4_)); + if(Config.isConnectedTextures() && this.field_147840_d == null) { + var20 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147746_1_, p_147746_2_, p_147746_3_, p_147746_4_, 2, var20); + } + + this.func_147765_a(var20, var181, var191, var14, 1.0F); + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147746_2_, p_147746_3_, p_147746_4_)) { + this.renderSnow(p_147746_2_, p_147746_3_, p_147746_4_, Blocks.field_150431_aC.func_149669_A()); + } + + return true; + } + + public boolean func_147774_a(BlockDoublePlant p_147774_1_, int p_147774_2_, int p_147774_3_, int p_147774_4_) { + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147774_1_.func_149677_c(this.field_147845_a, p_147774_2_, p_147774_3_, p_147774_4_)); + int var6 = CustomColorizer.getColorMultiplier(p_147774_1_, this.field_147845_a, p_147774_2_, p_147774_3_, p_147774_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var58 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var59 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var58; + var8 = var11; + var9 = var59; + } + + var5.func_78386_a(var7, var8, var9); + long var581 = (long)(p_147774_2_ * 3129871) ^ (long)p_147774_4_ * 116129781L; + var581 = var581 * var581 * 42317861L + var581 * 11L; + double var591 = (double)p_147774_2_; + double var14 = (double)p_147774_3_; + double var16 = (double)p_147774_4_; + var591 += ((double)((float)(var581 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D; + var16 += ((double)((float)(var581 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D; + int var18 = this.field_147845_a.func_72805_g(p_147774_2_, p_147774_3_, p_147774_4_); + boolean var19 = false; + boolean var20 = BlockDoublePlant.func_149887_c(var18); + int var60; + if(var20) { + if(this.field_147845_a.func_147439_a(p_147774_2_, p_147774_3_ - 1, p_147774_4_) != p_147774_1_) { + return false; + } + + var60 = BlockDoublePlant.func_149890_d(this.field_147845_a.func_72805_g(p_147774_2_, p_147774_3_ - 1, p_147774_4_)); + } else { + var60 = BlockDoublePlant.func_149890_d(var18); + } + + IIcon var21 = p_147774_1_.func_149888_a(var20, var60); + this.func_147765_a(var21, var591, var14, var16, 1.0F); + if(var20 && var60 == 0) { + IIcon var22 = p_147774_1_.field_149891_b[0]; + double var23 = Math.cos((double)var581 * 0.8D) * 3.141592653589793D * 0.1D; + double var25 = Math.cos(var23); + double var27 = Math.sin(var23); + double var29 = (double)var22.func_94209_e(); + double var31 = (double)var22.func_94206_g(); + double var33 = (double)var22.func_94212_f(); + double var35 = (double)var22.func_94210_h(); + double var37 = 0.3D; + double var39 = -0.05D; + double var41 = 0.5D + 0.3D * var25 - 0.5D * var27; + double var43 = 0.5D + 0.5D * var25 + 0.3D * var27; + double var45 = 0.5D + 0.3D * var25 + 0.5D * var27; + double var47 = 0.5D + -0.5D * var25 + 0.3D * var27; + double var49 = 0.5D + -0.05D * var25 + 0.5D * var27; + double var51 = 0.5D + -0.5D * var25 + -0.05D * var27; + double var53 = 0.5D + -0.05D * var25 - 0.5D * var27; + double var55 = 0.5D + 0.5D * var25 + -0.05D * var27; + var5.func_78374_a(var591 + var49, var14 + 1.0D, var16 + var51, var29, var35); + var5.func_78374_a(var591 + var53, var14 + 1.0D, var16 + var55, var33, var35); + var5.func_78374_a(var591 + var41, var14 + 0.0D, var16 + var43, var33, var31); + var5.func_78374_a(var591 + var45, var14 + 0.0D, var16 + var47, var29, var31); + IIcon var57 = p_147774_1_.field_149891_b[1]; + var29 = (double)var57.func_94209_e(); + var31 = (double)var57.func_94206_g(); + var33 = (double)var57.func_94212_f(); + var35 = (double)var57.func_94210_h(); + var5.func_78374_a(var591 + var53, var14 + 1.0D, var16 + var55, var29, var35); + var5.func_78374_a(var591 + var49, var14 + 1.0D, var16 + var51, var33, var35); + var5.func_78374_a(var591 + var45, var14 + 0.0D, var16 + var47, var33, var31); + var5.func_78374_a(var591 + var41, var14 + 0.0D, var16 + var43, var29, var31); + } + + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147774_2_, p_147774_3_, p_147774_4_)) { + this.renderSnow(p_147774_2_, p_147774_3_, p_147774_4_, Blocks.field_150431_aC.func_149669_A()); + } + + return true; + } + + public boolean func_147724_m(Block p_147724_1_, int p_147724_2_, int p_147724_3_, int p_147724_4_) { + BlockStem var5 = (BlockStem)p_147724_1_; + Tessellator var6 = Tessellator.field_78398_a; + var6.func_78380_c(var5.func_149677_c(this.field_147845_a, p_147724_2_, p_147724_3_, p_147724_4_)); + int var7 = CustomColorizer.getStemColorMultiplier(var5, this.field_147845_a, p_147724_2_, p_147724_3_, p_147724_4_); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var14 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var14; + var9 = var12; + var10 = var13; + } + + var6.func_78386_a(var8, var9, var10); + var5.func_149719_a(this.field_147845_a, p_147724_2_, p_147724_3_, p_147724_4_); + int var141 = var5.func_149873_e(this.field_147845_a, p_147724_2_, p_147724_3_, p_147724_4_); + if(var141 < 0) { + this.func_147730_a(var5, this.field_147845_a.func_72805_g(p_147724_2_, p_147724_3_, p_147724_4_), this.field_147857_k, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + } else { + this.func_147730_a(var5, this.field_147845_a.func_72805_g(p_147724_2_, p_147724_3_, p_147724_4_), 0.5D, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + this.func_147740_a(var5, this.field_147845_a.func_72805_g(p_147724_2_, p_147724_3_, p_147724_4_), var141, this.field_147857_k, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + } + + return true; + } + + public boolean func_147796_n(Block p_147796_1_, int p_147796_2_, int p_147796_3_, int p_147796_4_) { + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147796_1_.func_149677_c(this.field_147845_a, p_147796_2_, p_147796_3_, p_147796_4_)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + this.func_147795_a(p_147796_1_, this.field_147845_a.func_72805_g(p_147796_2_, p_147796_3_, p_147796_4_), (double)p_147796_2_, (double)((float)p_147796_3_ - 0.0625F), (double)p_147796_4_); + return true; + } + + public void func_147747_a(Block p_147747_1_, double p_147747_2_, double p_147747_4_, double p_147747_6_, double p_147747_8_, double p_147747_10_, int p_147747_12_) { + Tessellator var13 = Tessellator.field_78398_a; + IIcon var14 = this.func_147787_a(p_147747_1_, 0, p_147747_12_); + if(this.func_147744_b()) { + var14 = this.field_147840_d; + } + + double var15 = (double)var14.func_94209_e(); + double var17 = (double)var14.func_94206_g(); + double var19 = (double)var14.func_94212_f(); + double var21 = (double)var14.func_94210_h(); + double var23 = (double)var14.func_94214_a(7.0D); + double var25 = (double)var14.func_94207_b(6.0D); + double var27 = (double)var14.func_94214_a(9.0D); + double var29 = (double)var14.func_94207_b(8.0D); + double var31 = (double)var14.func_94214_a(7.0D); + double var33 = (double)var14.func_94207_b(13.0D); + double var35 = (double)var14.func_94214_a(9.0D); + double var37 = (double)var14.func_94207_b(15.0D); + p_147747_2_ += 0.5D; + p_147747_6_ += 0.5D; + double var39 = p_147747_2_ - 0.5D; + double var41 = p_147747_2_ + 0.5D; + double var43 = p_147747_6_ - 0.5D; + double var45 = p_147747_6_ + 0.5D; + double var47 = 0.0625D; + double var49 = 0.625D; + var13.func_78374_a(p_147747_2_ + p_147747_8_ * (1.0D - var49) - var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) - var47, var23, var25); + var13.func_78374_a(p_147747_2_ + p_147747_8_ * (1.0D - var49) - var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) + var47, var23, var29); + var13.func_78374_a(p_147747_2_ + p_147747_8_ * (1.0D - var49) + var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) + var47, var27, var29); + var13.func_78374_a(p_147747_2_ + p_147747_8_ * (1.0D - var49) + var47, p_147747_4_ + var49, p_147747_6_ + p_147747_10_ * (1.0D - var49) - var47, var27, var25); + var13.func_78374_a(p_147747_2_ + var47 + p_147747_8_, p_147747_4_, p_147747_6_ - var47 + p_147747_10_, var35, var33); + var13.func_78374_a(p_147747_2_ + var47 + p_147747_8_, p_147747_4_, p_147747_6_ + var47 + p_147747_10_, var35, var37); + var13.func_78374_a(p_147747_2_ - var47 + p_147747_8_, p_147747_4_, p_147747_6_ + var47 + p_147747_10_, var31, var37); + var13.func_78374_a(p_147747_2_ - var47 + p_147747_8_, p_147747_4_, p_147747_6_ - var47 + p_147747_10_, var31, var33); + var13.func_78374_a(p_147747_2_ - var47, p_147747_4_ + 1.0D, var43, var15, var17); + var13.func_78374_a(p_147747_2_ - var47 + p_147747_8_, p_147747_4_ + 0.0D, var43 + p_147747_10_, var15, var21); + var13.func_78374_a(p_147747_2_ - var47 + p_147747_8_, p_147747_4_ + 0.0D, var45 + p_147747_10_, var19, var21); + var13.func_78374_a(p_147747_2_ - var47, p_147747_4_ + 1.0D, var45, var19, var17); + var13.func_78374_a(p_147747_2_ + var47, p_147747_4_ + 1.0D, var45, var15, var17); + var13.func_78374_a(p_147747_2_ + p_147747_8_ + var47, p_147747_4_ + 0.0D, var45 + p_147747_10_, var15, var21); + var13.func_78374_a(p_147747_2_ + p_147747_8_ + var47, p_147747_4_ + 0.0D, var43 + p_147747_10_, var19, var21); + var13.func_78374_a(p_147747_2_ + var47, p_147747_4_ + 1.0D, var43, var19, var17); + var13.func_78374_a(var39, p_147747_4_ + 1.0D, p_147747_6_ + var47, var15, var17); + var13.func_78374_a(var39 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ + var47 + p_147747_10_, var15, var21); + var13.func_78374_a(var41 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ + var47 + p_147747_10_, var19, var21); + var13.func_78374_a(var41, p_147747_4_ + 1.0D, p_147747_6_ + var47, var19, var17); + var13.func_78374_a(var41, p_147747_4_ + 1.0D, p_147747_6_ - var47, var15, var17); + var13.func_78374_a(var41 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ - var47 + p_147747_10_, var15, var21); + var13.func_78374_a(var39 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ - var47 + p_147747_10_, var19, var21); + var13.func_78374_a(var39, p_147747_4_ + 1.0D, p_147747_6_ - var47, var19, var17); + } + + public void func_147765_a(IIcon p_147765_1_, double p_147765_2_, double p_147765_4_, double p_147765_6_, float p_147765_8_) { + Tessellator var9 = Tessellator.field_78398_a; + if(this.func_147744_b()) { + p_147765_1_ = this.field_147840_d; + } + + double var10 = (double)p_147765_1_.func_94209_e(); + double var12 = (double)p_147765_1_.func_94206_g(); + double var14 = (double)p_147765_1_.func_94212_f(); + double var16 = (double)p_147765_1_.func_94210_h(); + double var18 = 0.45D * (double)p_147765_8_; + double var20 = p_147765_2_ + 0.5D - var18; + double var22 = p_147765_2_ + 0.5D + var18; + double var24 = p_147765_6_ + 0.5D - var18; + double var26 = p_147765_6_ + 0.5D + var18; + var9.func_78374_a(var20, p_147765_4_ + (double)p_147765_8_, var24, var10, var12); + var9.func_78374_a(var20, p_147765_4_ + 0.0D, var24, var10, var16); + var9.func_78374_a(var22, p_147765_4_ + 0.0D, var26, var14, var16); + var9.func_78374_a(var22, p_147765_4_ + (double)p_147765_8_, var26, var14, var12); + var9.func_78374_a(var22, p_147765_4_ + (double)p_147765_8_, var26, var10, var12); + var9.func_78374_a(var22, p_147765_4_ + 0.0D, var26, var10, var16); + var9.func_78374_a(var20, p_147765_4_ + 0.0D, var24, var14, var16); + var9.func_78374_a(var20, p_147765_4_ + (double)p_147765_8_, var24, var14, var12); + var9.func_78374_a(var20, p_147765_4_ + (double)p_147765_8_, var26, var10, var12); + var9.func_78374_a(var20, p_147765_4_ + 0.0D, var26, var10, var16); + var9.func_78374_a(var22, p_147765_4_ + 0.0D, var24, var14, var16); + var9.func_78374_a(var22, p_147765_4_ + (double)p_147765_8_, var24, var14, var12); + var9.func_78374_a(var22, p_147765_4_ + (double)p_147765_8_, var24, var10, var12); + var9.func_78374_a(var22, p_147765_4_ + 0.0D, var24, var10, var16); + var9.func_78374_a(var20, p_147765_4_ + 0.0D, var26, var14, var16); + var9.func_78374_a(var20, p_147765_4_ + (double)p_147765_8_, var26, var14, var12); + } + + public void func_147730_a(Block p_147730_1_, int p_147730_2_, double p_147730_3_, double p_147730_5_, double p_147730_7_, double p_147730_9_) { + Tessellator var11 = Tessellator.field_78398_a; + IIcon var12 = this.func_147787_a(p_147730_1_, 0, p_147730_2_); + if(this.func_147744_b()) { + var12 = this.field_147840_d; + } + + double var13 = (double)var12.func_94209_e(); + double var15 = (double)var12.func_94206_g(); + double var17 = (double)var12.func_94212_f(); + double var19 = (double)var12.func_94207_b(p_147730_3_ * 16.0D); + double var21 = p_147730_5_ + 0.5D - 0.44999998807907104D; + double var23 = p_147730_5_ + 0.5D + 0.44999998807907104D; + double var25 = p_147730_9_ + 0.5D - 0.44999998807907104D; + double var27 = p_147730_9_ + 0.5D + 0.44999998807907104D; + var11.func_78374_a(var21, p_147730_7_ + p_147730_3_, var25, var13, var15); + var11.func_78374_a(var21, p_147730_7_ + 0.0D, var25, var13, var19); + var11.func_78374_a(var23, p_147730_7_ + 0.0D, var27, var17, var19); + var11.func_78374_a(var23, p_147730_7_ + p_147730_3_, var27, var17, var15); + var11.func_78374_a(var23, p_147730_7_ + p_147730_3_, var27, var17, var15); + var11.func_78374_a(var23, p_147730_7_ + 0.0D, var27, var17, var19); + var11.func_78374_a(var21, p_147730_7_ + 0.0D, var25, var13, var19); + var11.func_78374_a(var21, p_147730_7_ + p_147730_3_, var25, var13, var15); + var11.func_78374_a(var21, p_147730_7_ + p_147730_3_, var27, var13, var15); + var11.func_78374_a(var21, p_147730_7_ + 0.0D, var27, var13, var19); + var11.func_78374_a(var23, p_147730_7_ + 0.0D, var25, var17, var19); + var11.func_78374_a(var23, p_147730_7_ + p_147730_3_, var25, var17, var15); + var11.func_78374_a(var23, p_147730_7_ + p_147730_3_, var25, var17, var15); + var11.func_78374_a(var23, p_147730_7_ + 0.0D, var25, var17, var19); + var11.func_78374_a(var21, p_147730_7_ + 0.0D, var27, var13, var19); + var11.func_78374_a(var21, p_147730_7_ + p_147730_3_, var27, var13, var15); + } + + public boolean func_147783_o(Block p_147783_1_, int p_147783_2_, int p_147783_3_, int p_147783_4_) { + Tessellator var5 = Tessellator.field_78398_a; + IIcon var6 = this.func_147777_a(p_147783_1_, 1); + if(this.func_147744_b()) { + var6 = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + var6 = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147783_1_, p_147783_2_, p_147783_3_, p_147783_4_, 1, var6); + } + + float var7 = 0.015625F; + double var8 = (double)var6.func_94209_e(); + double var10 = (double)var6.func_94206_g(); + double var12 = (double)var6.func_94212_f(); + double var14 = (double)var6.func_94210_h(); + long var16 = (long)(p_147783_2_ * 3129871) ^ (long)p_147783_4_ * 116129781L ^ (long)p_147783_3_; + var16 = var16 * var16 * 42317861L + var16 * 11L; + int var18 = (int)(var16 >> 16 & 3L); + var5.func_78380_c(p_147783_1_.func_149677_c(this.field_147845_a, p_147783_2_, p_147783_3_, p_147783_4_)); + float var19 = (float)p_147783_2_ + 0.5F; + float var20 = (float)p_147783_4_ + 0.5F; + float var21 = (float)(var18 & 1) * 0.5F * (float)(1 - var18 / 2 % 2 * 2); + float var22 = (float)(var18 + 1 & 1) * 0.5F * (float)(1 - (var18 + 1) / 2 % 2 * 2); + int col = CustomColorizer.getLilypadColor(); + var5.func_78378_d(col); + var5.func_78374_a((double)(var19 + var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 + var22), var8, var10); + var5.func_78374_a((double)(var19 + var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 + var22), var12, var10); + var5.func_78374_a((double)(var19 - var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 - var22), var12, var14); + var5.func_78374_a((double)(var19 - var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 - var22), var8, var14); + var5.func_78378_d((col & 16711422) >> 1); + var5.func_78374_a((double)(var19 - var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 - var22), var8, var14); + var5.func_78374_a((double)(var19 - var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 - var22), var12, var14); + var5.func_78374_a((double)(var19 + var21 + var22), (double)((float)p_147783_3_ + var7), (double)(var20 - var21 + var22), var12, var10); + var5.func_78374_a((double)(var19 + var21 - var22), (double)((float)p_147783_3_ + var7), (double)(var20 + var21 + var22), var8, var10); + return true; + } + + public void func_147740_a(BlockStem p_147740_1_, int p_147740_2_, int p_147740_3_, double p_147740_4_, double p_147740_6_, double p_147740_8_, double p_147740_10_) { + Tessellator var12 = Tessellator.field_78398_a; + IIcon var13 = p_147740_1_.func_149872_i(); + if(this.func_147744_b()) { + var13 = this.field_147840_d; + } + + double var14 = (double)var13.func_94209_e(); + double var16 = (double)var13.func_94206_g(); + double var18 = (double)var13.func_94212_f(); + double var20 = (double)var13.func_94210_h(); + double var22 = p_147740_6_ + 0.5D - 0.5D; + double var24 = p_147740_6_ + 0.5D + 0.5D; + double var26 = p_147740_10_ + 0.5D - 0.5D; + double var28 = p_147740_10_ + 0.5D + 0.5D; + double var30 = p_147740_6_ + 0.5D; + double var32 = p_147740_10_ + 0.5D; + if((p_147740_3_ + 1) / 2 % 2 == 1) { + double var34 = var18; + var18 = var14; + var14 = var34; + } + + if(p_147740_3_ < 2) { + var12.func_78374_a(var22, p_147740_8_ + p_147740_4_, var32, var14, var16); + var12.func_78374_a(var22, p_147740_8_ + 0.0D, var32, var14, var20); + var12.func_78374_a(var24, p_147740_8_ + 0.0D, var32, var18, var20); + var12.func_78374_a(var24, p_147740_8_ + p_147740_4_, var32, var18, var16); + var12.func_78374_a(var24, p_147740_8_ + p_147740_4_, var32, var18, var16); + var12.func_78374_a(var24, p_147740_8_ + 0.0D, var32, var18, var20); + var12.func_78374_a(var22, p_147740_8_ + 0.0D, var32, var14, var20); + var12.func_78374_a(var22, p_147740_8_ + p_147740_4_, var32, var14, var16); + } else { + var12.func_78374_a(var30, p_147740_8_ + p_147740_4_, var28, var14, var16); + var12.func_78374_a(var30, p_147740_8_ + 0.0D, var28, var14, var20); + var12.func_78374_a(var30, p_147740_8_ + 0.0D, var26, var18, var20); + var12.func_78374_a(var30, p_147740_8_ + p_147740_4_, var26, var18, var16); + var12.func_78374_a(var30, p_147740_8_ + p_147740_4_, var26, var18, var16); + var12.func_78374_a(var30, p_147740_8_ + 0.0D, var26, var18, var20); + var12.func_78374_a(var30, p_147740_8_ + 0.0D, var28, var14, var20); + var12.func_78374_a(var30, p_147740_8_ + p_147740_4_, var28, var14, var16); + } + + } + + public void func_147795_a(Block p_147795_1_, int p_147795_2_, double p_147795_3_, double p_147795_5_, double p_147795_7_) { + Tessellator var9 = Tessellator.field_78398_a; + IIcon var10 = this.func_147787_a(p_147795_1_, 0, p_147795_2_); + if(this.func_147744_b()) { + var10 = this.field_147840_d; + } + + double var11 = (double)var10.func_94209_e(); + double var13 = (double)var10.func_94206_g(); + double var15 = (double)var10.func_94212_f(); + double var17 = (double)var10.func_94210_h(); + double var19 = p_147795_3_ + 0.5D - 0.25D; + double var21 = p_147795_3_ + 0.5D + 0.25D; + double var23 = p_147795_7_ + 0.5D - 0.5D; + double var25 = p_147795_7_ + 0.5D + 0.5D; + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var23, var11, var13); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var23, var11, var17); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var25, var15, var17); + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var25, var15, var13); + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var25, var11, var13); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var25, var11, var17); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var23, var15, var17); + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var23, var15, var13); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var25, var11, var13); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var25, var11, var17); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var23, var15, var17); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var23, var15, var13); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var23, var11, var13); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var23, var11, var17); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var25, var15, var17); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var25, var15, var13); + var19 = p_147795_3_ + 0.5D - 0.5D; + var21 = p_147795_3_ + 0.5D + 0.5D; + var23 = p_147795_7_ + 0.5D - 0.25D; + var25 = p_147795_7_ + 0.5D + 0.25D; + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var23, var11, var13); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var23, var11, var17); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var23, var15, var17); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var23, var15, var13); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var23, var11, var13); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var23, var11, var17); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var23, var15, var17); + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var23, var15, var13); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var25, var11, var13); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var25, var11, var17); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var25, var15, var17); + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var25, var15, var13); + var9.func_78374_a(var19, p_147795_5_ + 1.0D, var25, var11, var13); + var9.func_78374_a(var19, p_147795_5_ + 0.0D, var25, var11, var17); + var9.func_78374_a(var21, p_147795_5_ + 0.0D, var25, var15, var17); + var9.func_78374_a(var21, p_147795_5_ + 1.0D, var25, var15, var13); + } + + public boolean func_147721_p(Block p_147721_1_, int p_147721_2_, int p_147721_3_, int p_147721_4_) { + Tessellator var5 = Tessellator.field_78398_a; + int var6 = CustomColorizer.getFluidColor(p_147721_1_, this.field_147845_a, p_147721_2_, p_147721_3_, p_147721_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + boolean var10 = p_147721_1_.func_149646_a(this.field_147845_a, p_147721_2_, p_147721_3_ + 1, p_147721_4_, 1); + boolean var11 = p_147721_1_.func_149646_a(this.field_147845_a, p_147721_2_, p_147721_3_ - 1, p_147721_4_, 0); + boolean[] var12 = new boolean[]{p_147721_1_.func_149646_a(this.field_147845_a, p_147721_2_, p_147721_3_, p_147721_4_ - 1, 2), p_147721_1_.func_149646_a(this.field_147845_a, p_147721_2_, p_147721_3_, p_147721_4_ + 1, 3), p_147721_1_.func_149646_a(this.field_147845_a, p_147721_2_ - 1, p_147721_3_, p_147721_4_, 4), p_147721_1_.func_149646_a(this.field_147845_a, p_147721_2_ + 1, p_147721_3_, p_147721_4_, 5)}; + if(!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3]) { + return false; + } else { + boolean var13 = false; + float var14 = 0.5F; + float var15 = 1.0F; + float var16 = 0.8F; + float var17 = 0.6F; + double var18 = 0.0D; + double var20 = 1.0D; + Material var22 = p_147721_1_.func_149688_o(); + int var23 = this.field_147845_a.func_72805_g(p_147721_2_, p_147721_3_, p_147721_4_); + double var24 = (double)this.func_147729_a(p_147721_2_, p_147721_3_, p_147721_4_, var22); + double var26 = (double)this.func_147729_a(p_147721_2_, p_147721_3_, p_147721_4_ + 1, var22); + double var28 = (double)this.func_147729_a(p_147721_2_ + 1, p_147721_3_, p_147721_4_ + 1, var22); + double var30 = (double)this.func_147729_a(p_147721_2_ + 1, p_147721_3_, p_147721_4_, var22); + double var32 = 0.0010000000474974513D; + float var52; + float var53; + float var54; + double var39; + double var41; + double var43; + double var45; + double var47; + double var49; + if(this.field_147837_f || var10) { + var13 = true; + IIcon var57 = this.func_147787_a(p_147721_1_, 1, var23); + float var58 = (float)BlockLiquid.func_149802_a(this.field_147845_a, p_147721_2_, p_147721_3_, p_147721_4_, var22); + if(var58 > -999.0F) { + var57 = this.func_147787_a(p_147721_1_, 2, var23); + } + + var24 -= var32; + var26 -= var32; + var28 -= var32; + var30 -= var32; + double var37; + double var51; + if(var58 < -999.0F) { + var37 = (double)var57.func_94214_a(0.0D); + var45 = (double)var57.func_94207_b(0.0D); + var39 = var37; + var47 = (double)var57.func_94207_b(16.0D); + var41 = (double)var57.func_94214_a(16.0D); + var49 = var47; + var43 = var41; + var51 = var45; + } else { + var52 = MathHelper.func_76126_a(var58) * 0.25F; + var53 = MathHelper.func_76134_b(var58) * 0.25F; + var54 = 8.0F; + var37 = (double)var57.func_94214_a((double)(8.0F + (-var53 - var52) * 16.0F)); + var45 = (double)var57.func_94207_b((double)(8.0F + (-var53 + var52) * 16.0F)); + var39 = (double)var57.func_94214_a((double)(8.0F + (-var53 + var52) * 16.0F)); + var47 = (double)var57.func_94207_b((double)(8.0F + (var53 + var52) * 16.0F)); + var41 = (double)var57.func_94214_a((double)(8.0F + (var53 + var52) * 16.0F)); + var49 = (double)var57.func_94207_b((double)(8.0F + (var53 - var52) * 16.0F)); + var43 = (double)var57.func_94214_a((double)(8.0F + (var53 - var52) * 16.0F)); + var51 = (double)var57.func_94207_b((double)(8.0F + (-var53 - var52) * 16.0F)); + } + + var5.func_78380_c(p_147721_1_.func_149677_c(this.field_147845_a, p_147721_2_, p_147721_3_, p_147721_4_)); + var5.func_78386_a(var15 * var7, var15 * var8, var15 * var9); + double var56 = 3.90625E-5D; + var5.func_78374_a((double)(p_147721_2_ + 0), (double)p_147721_3_ + var24, (double)(p_147721_4_ + 0), var37 + var56, var45 + var56); + var5.func_78374_a((double)(p_147721_2_ + 0), (double)p_147721_3_ + var26, (double)(p_147721_4_ + 1), var39 + var56, var47 - var56); + var5.func_78374_a((double)(p_147721_2_ + 1), (double)p_147721_3_ + var28, (double)(p_147721_4_ + 1), var41 - var56, var49 - var56); + var5.func_78374_a((double)(p_147721_2_ + 1), (double)p_147721_3_ + var30, (double)(p_147721_4_ + 0), var43 - var56, var51 + var56); + var5.func_78374_a((double)(p_147721_2_ + 0), (double)p_147721_3_ + var24, (double)(p_147721_4_ + 0), var37 + var56, var45 + var56); + var5.func_78374_a((double)(p_147721_2_ + 1), (double)p_147721_3_ + var30, (double)(p_147721_4_ + 0), var43 - var56, var51 + var56); + var5.func_78374_a((double)(p_147721_2_ + 1), (double)p_147721_3_ + var28, (double)(p_147721_4_ + 1), var41 - var56, var49 - var56); + var5.func_78374_a((double)(p_147721_2_ + 0), (double)p_147721_3_ + var26, (double)(p_147721_4_ + 1), var39 + var56, var47 - var56); + } + + if(this.field_147837_f || var11) { + var5.func_78380_c(p_147721_1_.func_149677_c(this.field_147845_a, p_147721_2_, p_147721_3_ - 1, p_147721_4_)); + var5.func_78386_a(var14 * var7, var14 * var8, var14 * var9); + this.func_147768_a(p_147721_1_, (double)p_147721_2_, (double)p_147721_3_ + var32, (double)p_147721_4_, this.func_147777_a(p_147721_1_, 0)); + var13 = true; + } + + for(int var571 = 0; var571 < 4; ++var571) { + int var581 = p_147721_2_; + int var591 = p_147721_4_; + if(var571 == 0) { + var591 = p_147721_4_ - 1; + } + + if(var571 == 1) { + ++var591; + } + + if(var571 == 2) { + var581 = p_147721_2_ - 1; + } + + if(var571 == 3) { + ++var581; + } + + IIcon var59 = this.func_147787_a(p_147721_1_, var571 + 2, var23); + if(this.field_147837_f || var12[var571]) { + if(var571 == 0) { + var39 = var24; + var41 = var30; + var43 = (double)p_147721_2_; + var47 = (double)(p_147721_2_ + 1); + var45 = (double)p_147721_4_ + var32; + var49 = (double)p_147721_4_ + var32; + } else if(var571 == 1) { + var39 = var28; + var41 = var26; + var43 = (double)(p_147721_2_ + 1); + var47 = (double)p_147721_2_; + var45 = (double)(p_147721_4_ + 1) - var32; + var49 = (double)(p_147721_4_ + 1) - var32; + } else if(var571 == 2) { + var39 = var26; + var41 = var24; + var43 = (double)p_147721_2_ + var32; + var47 = (double)p_147721_2_ + var32; + var45 = (double)(p_147721_4_ + 1); + var49 = (double)p_147721_4_; + } else { + var39 = var30; + var41 = var28; + var43 = (double)(p_147721_2_ + 1) - var32; + var47 = (double)(p_147721_2_ + 1) - var32; + var45 = (double)p_147721_4_; + var49 = (double)(p_147721_4_ + 1); + } + + var13 = true; + float var60 = var59.func_94214_a(0.0D); + var52 = var59.func_94214_a(8.0D); + var53 = var59.func_94207_b((1.0D - var39) * 16.0D * 0.5D); + var54 = var59.func_94207_b((1.0D - var41) * 16.0D * 0.5D); + float var55 = var59.func_94207_b(8.0D); + var5.func_78380_c(p_147721_1_.func_149677_c(this.field_147845_a, var581, p_147721_3_, var591)); + float var61 = 1.0F; + var61 *= var571 < 2?var16:var17; + var5.func_78386_a(var15 * var61 * var7, var15 * var61 * var8, var15 * var61 * var9); + var5.func_78374_a(var43, (double)p_147721_3_ + var39, var45, (double)var60, (double)var53); + var5.func_78374_a(var47, (double)p_147721_3_ + var41, var49, (double)var52, (double)var54); + var5.func_78374_a(var47, (double)(p_147721_3_ + 0), var49, (double)var52, (double)var55); + var5.func_78374_a(var43, (double)(p_147721_3_ + 0), var45, (double)var60, (double)var55); + var5.func_78374_a(var43, (double)(p_147721_3_ + 0), var45, (double)var60, (double)var55); + var5.func_78374_a(var47, (double)(p_147721_3_ + 0), var49, (double)var52, (double)var55); + var5.func_78374_a(var47, (double)p_147721_3_ + var41, var49, (double)var52, (double)var54); + var5.func_78374_a(var43, (double)p_147721_3_ + var39, var45, (double)var60, (double)var53); + } + } + + this.field_147855_j = var18; + this.field_147857_k = var20; + return var13; + } + } + + public float func_147729_a(int p_147729_1_, int p_147729_2_, int p_147729_3_, Material p_147729_4_) { + int var5 = 0; + float var6 = 0.0F; + + for(int var7 = 0; var7 < 4; ++var7) { + int var8 = p_147729_1_ - (var7 & 1); + int var10 = p_147729_3_ - (var7 >> 1 & 1); + if(this.field_147845_a.func_147439_a(var8, p_147729_2_ + 1, var10).func_149688_o() == p_147729_4_) { + return 1.0F; + } + + Material var11 = this.field_147845_a.func_147439_a(var8, p_147729_2_, var10).func_149688_o(); + if(var11 == p_147729_4_) { + int var12 = this.field_147845_a.func_72805_g(var8, p_147729_2_, var10); + if(var12 >= 8 || var12 == 0) { + var6 += BlockLiquid.func_149801_b(var12) * 10.0F; + var5 += 10; + } + + var6 += BlockLiquid.func_149801_b(var12); + ++var5; + } else if(!var11.func_76220_a()) { + ++var6; + ++var5; + } + } + + return 1.0F - var6 / (float)var5; + } + + public void func_147749_a(Block p_147749_1_, World p_147749_2_, int p_147749_3_, int p_147749_4_, int p_147749_5_, int p_147749_6_) { + float var7 = 0.5F; + float var8 = 1.0F; + float var9 = 0.8F; + float var10 = 0.6F; + Tessellator var11 = Tessellator.field_78398_a; + var11.func_78382_b(); + var11.func_78380_c(p_147749_1_.func_149677_c(p_147749_2_, p_147749_3_, p_147749_4_, p_147749_5_)); + var11.func_78386_a(var7, var7, var7); + this.func_147768_a(p_147749_1_, -0.5D, -0.5D, -0.5D, this.func_147787_a(p_147749_1_, 0, p_147749_6_)); + var11.func_78386_a(var8, var8, var8); + this.func_147806_b(p_147749_1_, -0.5D, -0.5D, -0.5D, this.func_147787_a(p_147749_1_, 1, p_147749_6_)); + var11.func_78386_a(var9, var9, var9); + this.func_147761_c(p_147749_1_, -0.5D, -0.5D, -0.5D, this.func_147787_a(p_147749_1_, 2, p_147749_6_)); + var11.func_78386_a(var9, var9, var9); + this.func_147734_d(p_147749_1_, -0.5D, -0.5D, -0.5D, this.func_147787_a(p_147749_1_, 3, p_147749_6_)); + var11.func_78386_a(var10, var10, var10); + this.func_147798_e(p_147749_1_, -0.5D, -0.5D, -0.5D, this.func_147787_a(p_147749_1_, 4, p_147749_6_)); + var11.func_78386_a(var10, var10, var10); + this.func_147764_f(p_147749_1_, -0.5D, -0.5D, -0.5D, this.func_147787_a(p_147749_1_, 5, p_147749_6_)); + var11.func_78381_a(); + } + + public boolean func_147784_q(Block p_147784_1_, int p_147784_2_, int p_147784_3_, int p_147784_4_) { + int var5 = CustomColorizer.getColorMultiplier(p_147784_1_, this.field_147845_a, p_147784_2_, p_147784_3_, p_147784_4_); + float var6 = (float)(var5 >> 16 & 255) / 255.0F; + float var7 = (float)(var5 >> 8 & 255) / 255.0F; + float var8 = (float)(var5 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; + var6 = var9; + var7 = var10; + var8 = var11; + } + + return Minecraft.func_71379_u() && p_147784_1_.func_149750_m() == 0?(this.field_147849_o?this.func_147808_b(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, var6, var7, var8):this.func_147751_a(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, var6, var7, var8)):this.func_147736_d(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, var6, var7, var8); + } + + public boolean func_147742_r(Block p_147742_1_, int p_147742_2_, int p_147742_3_, int p_147742_4_) { + int var5 = this.field_147845_a.func_72805_g(p_147742_2_, p_147742_3_, p_147742_4_); + int var6 = var5 & 12; + if(var6 == 4) { + this.field_147875_q = 2; + this.field_147873_r = 1; + this.field_147867_u = 1; + this.field_147865_v = 2; + } else if(var6 == 8) { + this.field_147871_s = 2; + this.field_147869_t = 1; + this.field_147867_u = 3; + this.field_147865_v = 3; + } + + boolean var7 = this.func_147784_q(p_147742_1_, p_147742_2_, p_147742_3_, p_147742_4_); + this.field_147871_s = 0; + this.field_147875_q = 0; + this.field_147873_r = 0; + this.field_147869_t = 0; + this.field_147867_u = 0; + this.field_147865_v = 0; + return var7; + } + + public boolean func_147779_s(Block p_147779_1_, int p_147779_2_, int p_147779_3_, int p_147779_4_) { + int var5 = this.field_147845_a.func_72805_g(p_147779_2_, p_147779_3_, p_147779_4_); + if(var5 == 3) { + this.field_147875_q = 2; + this.field_147873_r = 1; + this.field_147867_u = 1; + this.field_147865_v = 2; + } else if(var5 == 4) { + this.field_147871_s = 2; + this.field_147869_t = 1; + this.field_147867_u = 3; + this.field_147865_v = 3; + } + + boolean var6 = this.func_147784_q(p_147779_1_, p_147779_2_, p_147779_3_, p_147779_4_); + this.field_147871_s = 0; + this.field_147875_q = 0; + this.field_147873_r = 0; + this.field_147869_t = 0; + this.field_147867_u = 0; + this.field_147865_v = 0; + return var6; + } + + public boolean func_147751_a(Block p_147751_1_, int p_147751_2_, int p_147751_3_, int p_147751_4_, float p_147751_5_, float p_147751_6_, float p_147751_7_) { + this.field_147863_w = true; + boolean defaultTexture = Tessellator.field_78398_a.defaultTexture; + boolean betterGrass = Config.isBetterGrass() && defaultTexture; + boolean simpleAO = p_147751_1_ == Blocks.field_150359_w; + boolean var8 = false; + float var9 = 0.0F; + float var10 = 0.0F; + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = true; + int var14 = -1; + Tessellator var15 = Tessellator.field_78398_a; + var15.func_78380_c(983055); + if(p_147751_1_ == Blocks.field_150349_c) { + var13 = false; + } else if(this.func_147744_b()) { + var13 = false; + } + + boolean var16; + boolean var17; + boolean var18; + boolean var19; + int var20; + float var21; + if(this.field_147837_f || p_147751_1_.func_149646_a(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_, 0)) { + if(this.field_147855_j <= 0.0D) { + --p_147751_3_; + } + + this.field_147831_S = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147825_U = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147828_V = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.field_147835_X = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.field_147886_y = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147814_A = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147815_B = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.field_147810_D = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + var16 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).func_149751_l(); + if(!var19 && !var17) { + this.field_147888_x = this.field_147886_y; + this.field_147832_R = this.field_147831_S; + } else { + this.field_147888_x = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + this.field_147832_R = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + } + + if(!var18 && !var17) { + this.field_147884_z = this.field_147886_y; + this.field_147826_T = this.field_147831_S; + } else { + this.field_147884_z = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + this.field_147826_T = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + } + + if(!var19 && !var16) { + this.field_147816_C = this.field_147810_D; + this.field_147827_W = this.field_147835_X; + } else { + this.field_147816_C = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + this.field_147827_W = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + } + + if(!var18 && !var16) { + this.field_147811_E = this.field_147810_D; + this.field_147834_Y = this.field_147835_X; + } else { + this.field_147811_E = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + this.field_147834_Y = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + } + + if(this.field_147855_j <= 0.0D) { + ++p_147751_3_; + } + + if(var14 < 0) { + var14 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + if(this.field_147855_j <= 0.0D || !this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ - 1, p_147751_4_).func_149662_c()) { + var20 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + var9 = (this.field_147884_z + this.field_147886_y + this.field_147815_B + var21) / 4.0F; + var12 = (this.field_147815_B + var21 + this.field_147811_E + this.field_147810_D) / 4.0F; + var11 = (var21 + this.field_147814_A + this.field_147810_D + this.field_147816_C) / 4.0F; + var10 = (this.field_147886_y + this.field_147888_x + var21 + this.field_147814_A) / 4.0F; + this.field_147864_al = this.func_147778_a(this.field_147826_T, this.field_147831_S, this.field_147828_V, var20); + this.field_147870_ao = this.func_147778_a(this.field_147828_V, this.field_147834_Y, this.field_147835_X, var20); + this.field_147876_an = this.func_147778_a(this.field_147825_U, this.field_147835_X, this.field_147827_W, var20); + this.field_147874_am = this.func_147778_a(this.field_147831_S, this.field_147832_R, this.field_147825_U, var20); + if(simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.field_147864_al = this.field_147870_ao = this.field_147876_an = this.field_147874_am = var20; + } + + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147751_5_ * 0.5F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147751_6_ * 0.5F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147751_7_ * 0.5F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.5F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.5F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.5F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + this.func_147768_a(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, this.func_147793_a(p_147751_1_, this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_, 0)); + var8 = true; + } + + if(this.field_147837_f || p_147751_1_.func_149646_a(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_, 1)) { + if(this.field_147857_k >= 1.0D) { + ++p_147751_3_; + } + + this.field_147880_aa = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147885_ae = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.field_147878_ac = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147887_af = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.field_147813_G = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147824_K = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.field_147822_I = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147817_L = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + var16 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).func_149751_l(); + if(!var19 && !var17) { + this.field_147812_F = this.field_147813_G; + this.field_147836_Z = this.field_147880_aa; + } else { + this.field_147812_F = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + this.field_147836_Z = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + } + + if(!var19 && !var16) { + this.field_147823_J = this.field_147824_K; + this.field_147879_ad = this.field_147885_ae; + } else { + this.field_147823_J = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + this.field_147879_ad = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + } + + if(!var18 && !var17) { + this.field_147821_H = this.field_147813_G; + this.field_147881_ab = this.field_147880_aa; + } else { + this.field_147821_H = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + this.field_147881_ab = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + } + + if(!var18 && !var16) { + this.field_147818_M = this.field_147824_K; + this.field_147882_ag = this.field_147885_ae; + } else { + this.field_147818_M = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + this.field_147882_ag = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + } + + if(this.field_147857_k >= 1.0D) { + --p_147751_3_; + } + + if(var14 < 0) { + var14 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + if(this.field_147857_k >= 1.0D || !this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ + 1, p_147751_4_).func_149662_c()) { + var20 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var12 = (this.field_147821_H + this.field_147813_G + this.field_147817_L + var21) / 4.0F; + var9 = (this.field_147817_L + var21 + this.field_147818_M + this.field_147824_K) / 4.0F; + var10 = (var21 + this.field_147822_I + this.field_147824_K + this.field_147823_J) / 4.0F; + var11 = (this.field_147813_G + this.field_147812_F + var21 + this.field_147822_I) / 4.0F; + this.field_147870_ao = this.func_147778_a(this.field_147881_ab, this.field_147880_aa, this.field_147887_af, var20); + this.field_147864_al = this.func_147778_a(this.field_147887_af, this.field_147882_ag, this.field_147885_ae, var20); + this.field_147874_am = this.func_147778_a(this.field_147878_ac, this.field_147885_ae, this.field_147879_ad, var20); + this.field_147876_an = this.func_147778_a(this.field_147880_aa, this.field_147836_Z, this.field_147878_ac, var20); + if(simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.field_147864_al = this.field_147870_ao = this.field_147876_an = this.field_147874_am = var20; + } + + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147751_5_; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147751_6_; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147751_7_; + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + this.func_147806_b(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, this.func_147793_a(p_147751_1_, this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_, 1)); + var8 = true; + } + + IIcon var22; + if(this.field_147837_f || p_147751_1_.func_149646_a(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ - 1, 2)) { + if(this.field_147851_l <= 0.0D) { + --p_147751_4_; + } + + this.field_147819_N = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147814_A = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147822_I = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.field_147820_O = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.field_147883_ah = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147825_U = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147878_ac = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.field_147866_ai = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + var16 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).func_149751_l(); + if(!var17 && !var19) { + this.field_147888_x = this.field_147819_N; + this.field_147832_R = this.field_147883_ah; + } else { + this.field_147888_x = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + this.field_147832_R = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + } + + if(!var17 && !var18) { + this.field_147812_F = this.field_147819_N; + this.field_147836_Z = this.field_147883_ah; + } else { + this.field_147812_F = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + this.field_147836_Z = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + } + + if(!var16 && !var19) { + this.field_147816_C = this.field_147820_O; + this.field_147827_W = this.field_147866_ai; + } else { + this.field_147816_C = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + this.field_147827_W = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + } + + if(!var16 && !var18) { + this.field_147823_J = this.field_147820_O; + this.field_147879_ad = this.field_147866_ai; + } else { + this.field_147823_J = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + this.field_147879_ad = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + } + + if(this.field_147851_l <= 0.0D) { + ++p_147751_4_; + } + + if(var14 < 0) { + var14 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + if(this.field_147851_l <= 0.0D || !this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_, p_147751_4_ - 1).func_149662_c()) { + var20 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + var9 = (this.field_147819_N + this.field_147812_F + var21 + this.field_147822_I) / 4.0F; + var10 = (var21 + this.field_147822_I + this.field_147820_O + this.field_147823_J) / 4.0F; + var11 = (this.field_147814_A + var21 + this.field_147816_C + this.field_147820_O) / 4.0F; + var12 = (this.field_147888_x + this.field_147819_N + this.field_147814_A + var21) / 4.0F; + this.field_147864_al = this.func_147778_a(this.field_147883_ah, this.field_147836_Z, this.field_147878_ac, var20); + this.field_147874_am = this.func_147778_a(this.field_147878_ac, this.field_147866_ai, this.field_147879_ad, var20); + this.field_147876_an = this.func_147778_a(this.field_147825_U, this.field_147827_W, this.field_147866_ai, var20); + this.field_147870_ao = this.func_147778_a(this.field_147832_R, this.field_147883_ah, this.field_147825_U, var20); + if(simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.field_147864_al = this.field_147870_ao = this.field_147876_an = this.field_147874_am = var20; + } + + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147751_5_ * 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147751_6_ * 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147751_7_ * 0.8F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.8F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var22 = this.func_147793_a(p_147751_1_, this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_, 2); + if(betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 2, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.func_147761_c(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + if(defaultTexture && field_147843_b && var22 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + this.field_147872_ap *= p_147751_5_; + this.field_147852_aq *= p_147751_5_; + this.field_147850_ar *= p_147751_5_; + this.field_147848_as *= p_147751_5_; + this.field_147846_at *= p_147751_6_; + this.field_147860_au *= p_147751_6_; + this.field_147858_av *= p_147751_6_; + this.field_147856_aw *= p_147751_6_; + this.field_147854_ax *= p_147751_7_; + this.field_147841_ay *= p_147751_7_; + this.field_147839_az *= p_147751_7_; + this.field_147833_aA *= p_147751_7_; + this.func_147761_c(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if(this.field_147837_f || p_147751_1_.func_149646_a(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ + 1, 3)) { + if(this.field_147853_m >= 1.0D) { + ++p_147751_4_; + } + + this.field_147830_P = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147829_Q = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.field_147815_B = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147817_L = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.field_147868_aj = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.field_147862_ak = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.field_147828_V = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147887_af = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var16 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).func_149751_l(); + if(!var17 && !var19) { + this.field_147884_z = this.field_147830_P; + this.field_147826_T = this.field_147868_aj; + } else { + this.field_147884_z = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + this.field_147826_T = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + } + + if(!var17 && !var18) { + this.field_147821_H = this.field_147830_P; + this.field_147881_ab = this.field_147868_aj; + } else { + this.field_147821_H = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + this.field_147881_ab = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + } + + if(!var16 && !var19) { + this.field_147811_E = this.field_147829_Q; + this.field_147834_Y = this.field_147862_ak; + } else { + this.field_147811_E = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + this.field_147834_Y = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + } + + if(!var16 && !var18) { + this.field_147818_M = this.field_147829_Q; + this.field_147882_ag = this.field_147862_ak; + } else { + this.field_147818_M = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + this.field_147882_ag = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + } + + if(this.field_147853_m >= 1.0D) { + --p_147751_4_; + } + + if(var14 < 0) { + var14 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + if(this.field_147853_m >= 1.0D || !this.field_147845_a.func_147439_a(p_147751_2_, p_147751_3_, p_147751_4_ + 1).func_149662_c()) { + var20 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + var9 = (this.field_147830_P + this.field_147821_H + var21 + this.field_147817_L) / 4.0F; + var12 = (var21 + this.field_147817_L + this.field_147829_Q + this.field_147818_M) / 4.0F; + var11 = (this.field_147815_B + var21 + this.field_147811_E + this.field_147829_Q) / 4.0F; + var10 = (this.field_147884_z + this.field_147830_P + this.field_147815_B + var21) / 4.0F; + this.field_147864_al = this.func_147778_a(this.field_147868_aj, this.field_147881_ab, this.field_147887_af, var20); + this.field_147870_ao = this.func_147778_a(this.field_147887_af, this.field_147862_ak, this.field_147882_ag, var20); + this.field_147876_an = this.func_147778_a(this.field_147828_V, this.field_147834_Y, this.field_147862_ak, var20); + this.field_147874_am = this.func_147778_a(this.field_147826_T, this.field_147868_aj, this.field_147828_V, var20); + if(simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.field_147864_al = this.field_147870_ao = this.field_147876_an = this.field_147874_am = var20; + } + + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147751_5_ * 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147751_6_ * 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147751_7_ * 0.8F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.8F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var22 = this.func_147793_a(p_147751_1_, this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_, 3); + if(betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 3, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.func_147734_d(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + if(defaultTexture && field_147843_b && var22 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + this.field_147872_ap *= p_147751_5_; + this.field_147852_aq *= p_147751_5_; + this.field_147850_ar *= p_147751_5_; + this.field_147848_as *= p_147751_5_; + this.field_147846_at *= p_147751_6_; + this.field_147860_au *= p_147751_6_; + this.field_147858_av *= p_147751_6_; + this.field_147856_aw *= p_147751_6_; + this.field_147854_ax *= p_147751_7_; + this.field_147841_ay *= p_147751_7_; + this.field_147839_az *= p_147751_7_; + this.field_147833_aA *= p_147751_7_; + this.func_147734_d(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if(this.field_147837_f || p_147751_1_.func_149646_a(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_, 4)) { + if(this.field_147859_h <= 0.0D) { + --p_147751_2_; + } + + this.field_147886_y = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147819_N = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147830_P = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.field_147813_G = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.field_147831_S = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147883_ah = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147868_aj = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.field_147880_aa = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var16 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).func_149751_l(); + if(!var18 && !var17) { + this.field_147888_x = this.field_147819_N; + this.field_147832_R = this.field_147883_ah; + } else { + this.field_147888_x = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + this.field_147832_R = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + } + + if(!var19 && !var17) { + this.field_147884_z = this.field_147830_P; + this.field_147826_T = this.field_147868_aj; + } else { + this.field_147884_z = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + this.field_147826_T = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + } + + if(!var18 && !var16) { + this.field_147812_F = this.field_147819_N; + this.field_147836_Z = this.field_147883_ah; + } else { + this.field_147812_F = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + this.field_147836_Z = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + } + + if(!var19 && !var16) { + this.field_147821_H = this.field_147830_P; + this.field_147881_ab = this.field_147868_aj; + } else { + this.field_147821_H = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + this.field_147881_ab = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + } + + if(this.field_147859_h <= 0.0D) { + ++p_147751_2_; + } + + if(var14 < 0) { + var14 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + if(this.field_147859_h <= 0.0D || !this.field_147845_a.func_147439_a(p_147751_2_ - 1, p_147751_3_, p_147751_4_).func_149662_c()) { + var20 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_ - 1, p_147751_3_, p_147751_4_); + var12 = (this.field_147886_y + this.field_147884_z + var21 + this.field_147830_P) / 4.0F; + var9 = (var21 + this.field_147830_P + this.field_147813_G + this.field_147821_H) / 4.0F; + var10 = (this.field_147819_N + var21 + this.field_147812_F + this.field_147813_G) / 4.0F; + var11 = (this.field_147888_x + this.field_147886_y + this.field_147819_N + var21) / 4.0F; + this.field_147870_ao = this.func_147778_a(this.field_147831_S, this.field_147826_T, this.field_147868_aj, var20); + this.field_147864_al = this.func_147778_a(this.field_147868_aj, this.field_147880_aa, this.field_147881_ab, var20); + this.field_147874_am = this.func_147778_a(this.field_147883_ah, this.field_147836_Z, this.field_147880_aa, var20); + this.field_147876_an = this.func_147778_a(this.field_147832_R, this.field_147831_S, this.field_147883_ah, var20); + if(simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.field_147864_al = this.field_147870_ao = this.field_147876_an = this.field_147874_am = var20; + } + + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147751_5_ * 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147751_6_ * 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147751_7_ * 0.6F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.6F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var22 = this.func_147793_a(p_147751_1_, this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_, 4); + if(betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 4, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.func_147798_e(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + if(defaultTexture && field_147843_b && var22 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + this.field_147872_ap *= p_147751_5_; + this.field_147852_aq *= p_147751_5_; + this.field_147850_ar *= p_147751_5_; + this.field_147848_as *= p_147751_5_; + this.field_147846_at *= p_147751_6_; + this.field_147860_au *= p_147751_6_; + this.field_147858_av *= p_147751_6_; + this.field_147856_aw *= p_147751_6_; + this.field_147854_ax *= p_147751_7_; + this.field_147841_ay *= p_147751_7_; + this.field_147839_az *= p_147751_7_; + this.field_147833_aA *= p_147751_7_; + this.func_147798_e(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if(this.field_147837_f || p_147751_1_.func_149646_a(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_, 5)) { + if(this.field_147861_i >= 1.0D) { + ++p_147751_2_; + } + + this.field_147810_D = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147820_O = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147829_Q = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.field_147824_K = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.field_147835_X = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.field_147866_ai = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.field_147862_ak = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.field_147885_ae = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + var16 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).func_149751_l(); + if(!var17 && !var19) { + this.field_147816_C = this.field_147820_O; + this.field_147827_W = this.field_147866_ai; + } else { + this.field_147816_C = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + this.field_147827_W = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + } + + if(!var17 && !var18) { + this.field_147811_E = this.field_147829_Q; + this.field_147834_Y = this.field_147862_ak; + } else { + this.field_147811_E = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + this.field_147834_Y = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + } + + if(!var16 && !var19) { + this.field_147823_J = this.field_147820_O; + this.field_147879_ad = this.field_147866_ai; + } else { + this.field_147823_J = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + this.field_147879_ad = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + } + + if(!var16 && !var18) { + this.field_147818_M = this.field_147829_Q; + this.field_147882_ag = this.field_147862_ak; + } else { + this.field_147818_M = this.getAmbientOcclusionLightValue(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + this.field_147882_ag = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + } + + if(this.field_147861_i >= 1.0D) { + --p_147751_2_; + } + + if(var14 < 0) { + var14 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_); + } + + var20 = var14; + if(this.field_147861_i >= 1.0D || !this.field_147845_a.func_147439_a(p_147751_2_ + 1, p_147751_3_, p_147751_4_).func_149662_c()) { + var20 = p_147751_1_.func_149677_c(this.field_147845_a, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147751_2_ + 1, p_147751_3_, p_147751_4_); + var9 = (this.field_147810_D + this.field_147811_E + var21 + this.field_147829_Q) / 4.0F; + var10 = (this.field_147816_C + this.field_147810_D + this.field_147820_O + var21) / 4.0F; + var11 = (this.field_147820_O + var21 + this.field_147823_J + this.field_147824_K) / 4.0F; + var12 = (var21 + this.field_147829_Q + this.field_147824_K + this.field_147818_M) / 4.0F; + this.field_147864_al = this.func_147778_a(this.field_147835_X, this.field_147834_Y, this.field_147862_ak, var20); + this.field_147870_ao = this.func_147778_a(this.field_147862_ak, this.field_147885_ae, this.field_147882_ag, var20); + this.field_147876_an = this.func_147778_a(this.field_147866_ai, this.field_147879_ad, this.field_147885_ae, var20); + this.field_147874_am = this.func_147778_a(this.field_147827_W, this.field_147835_X, this.field_147866_ai, var20); + if(simpleAO) { + var10 = var21; + var11 = var21; + var12 = var21; + var9 = var21; + this.field_147864_al = this.field_147870_ao = this.field_147876_an = this.field_147874_am = var20; + } + + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147751_5_ * 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147751_6_ * 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147751_7_ * 0.6F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.6F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var22 = this.func_147793_a(p_147751_1_, this.field_147845_a, p_147751_2_, p_147751_3_, p_147751_4_, 5); + if(betterGrass) { + var22 = this.fixAoSideGrassTexture(var22, p_147751_2_, p_147751_3_, p_147751_4_, 5, p_147751_5_, p_147751_6_, p_147751_7_); + } + + this.func_147764_f(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, var22); + if(defaultTexture && field_147843_b && var22 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + this.field_147872_ap *= p_147751_5_; + this.field_147852_aq *= p_147751_5_; + this.field_147850_ar *= p_147751_5_; + this.field_147848_as *= p_147751_5_; + this.field_147846_at *= p_147751_6_; + this.field_147860_au *= p_147751_6_; + this.field_147858_av *= p_147751_6_; + this.field_147856_aw *= p_147751_6_; + this.field_147854_ax *= p_147751_7_; + this.field_147841_ay *= p_147751_7_; + this.field_147839_az *= p_147751_7_; + this.field_147833_aA *= p_147751_7_; + this.func_147764_f(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + this.field_147863_w = false; + return var8; + } + + public boolean func_147808_b(Block p_147808_1_, int p_147808_2_, int p_147808_3_, int p_147808_4_, float p_147808_5_, float p_147808_6_, float p_147808_7_) { + this.field_147863_w = true; + boolean var8 = false; + float var9 = 0.0F; + float var10 = 0.0F; + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = true; + int var14 = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_); + Tessellator var15 = Tessellator.field_78398_a; + var15.func_78380_c(983055); + if(p_147808_1_ == Blocks.field_150349_c) { + var13 = false; + } else if(this.func_147744_b()) { + var13 = false; + } + + boolean var16; + boolean var17; + boolean var18; + boolean var19; + int var20; + float var21; + if(this.field_147837_f || p_147808_1_.func_149646_a(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_, 0)) { + if(this.field_147855_j <= 0.0D) { + --p_147808_3_; + } + + this.field_147831_S = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147825_U = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147828_V = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.field_147835_X = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.field_147886_y = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147814_A = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147815_B = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.field_147810_D = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + var16 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).func_149751_l(); + if(!var19 && !var17) { + this.field_147888_x = this.field_147886_y; + this.field_147832_R = this.field_147831_S; + } else { + this.field_147888_x = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + this.field_147832_R = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + } + + if(!var18 && !var17) { + this.field_147884_z = this.field_147886_y; + this.field_147826_T = this.field_147831_S; + } else { + this.field_147884_z = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + this.field_147826_T = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + } + + if(!var19 && !var16) { + this.field_147816_C = this.field_147810_D; + this.field_147827_W = this.field_147835_X; + } else { + this.field_147816_C = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + this.field_147827_W = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + } + + if(!var18 && !var16) { + this.field_147811_E = this.field_147810_D; + this.field_147834_Y = this.field_147835_X; + } else { + this.field_147811_E = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + this.field_147834_Y = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + } + + if(this.field_147855_j <= 0.0D) { + ++p_147808_3_; + } + + var20 = var14; + if(this.field_147855_j <= 0.0D || !this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ - 1, p_147808_4_).func_149662_c()) { + var20 = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + var9 = (this.field_147884_z + this.field_147886_y + this.field_147815_B + var21) / 4.0F; + var12 = (this.field_147815_B + var21 + this.field_147811_E + this.field_147810_D) / 4.0F; + var11 = (var21 + this.field_147814_A + this.field_147810_D + this.field_147816_C) / 4.0F; + var10 = (this.field_147886_y + this.field_147888_x + var21 + this.field_147814_A) / 4.0F; + this.field_147864_al = this.func_147778_a(this.field_147826_T, this.field_147831_S, this.field_147828_V, var20); + this.field_147870_ao = this.func_147778_a(this.field_147828_V, this.field_147834_Y, this.field_147835_X, var20); + this.field_147876_an = this.func_147778_a(this.field_147825_U, this.field_147835_X, this.field_147827_W, var20); + this.field_147874_am = this.func_147778_a(this.field_147831_S, this.field_147832_R, this.field_147825_U, var20); + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147808_5_ * 0.5F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147808_6_ * 0.5F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147808_7_ * 0.5F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.5F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.5F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.5F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + this.func_147768_a(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, this.func_147793_a(p_147808_1_, this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_, 0)); + var8 = true; + } + + if(this.field_147837_f || p_147808_1_.func_149646_a(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_, 1)) { + if(this.field_147857_k >= 1.0D) { + ++p_147808_3_; + } + + this.field_147880_aa = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147885_ae = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.field_147878_ac = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147887_af = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.field_147813_G = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147824_K = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.field_147822_I = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147817_L = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + var16 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).func_149751_l(); + if(!var19 && !var17) { + this.field_147812_F = this.field_147813_G; + this.field_147836_Z = this.field_147880_aa; + } else { + this.field_147812_F = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + this.field_147836_Z = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + } + + if(!var19 && !var16) { + this.field_147823_J = this.field_147824_K; + this.field_147879_ad = this.field_147885_ae; + } else { + this.field_147823_J = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + this.field_147879_ad = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + } + + if(!var18 && !var17) { + this.field_147821_H = this.field_147813_G; + this.field_147881_ab = this.field_147880_aa; + } else { + this.field_147821_H = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + this.field_147881_ab = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + } + + if(!var18 && !var16) { + this.field_147818_M = this.field_147824_K; + this.field_147882_ag = this.field_147885_ae; + } else { + this.field_147818_M = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + this.field_147882_ag = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + } + + if(this.field_147857_k >= 1.0D) { + --p_147808_3_; + } + + var20 = var14; + if(this.field_147857_k >= 1.0D || !this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ + 1, p_147808_4_).func_149662_c()) { + var20 = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var12 = (this.field_147821_H + this.field_147813_G + this.field_147817_L + var21) / 4.0F; + var9 = (this.field_147817_L + var21 + this.field_147818_M + this.field_147824_K) / 4.0F; + var10 = (var21 + this.field_147822_I + this.field_147824_K + this.field_147823_J) / 4.0F; + var11 = (this.field_147813_G + this.field_147812_F + var21 + this.field_147822_I) / 4.0F; + this.field_147870_ao = this.func_147778_a(this.field_147881_ab, this.field_147880_aa, this.field_147887_af, var20); + this.field_147864_al = this.func_147778_a(this.field_147887_af, this.field_147882_ag, this.field_147885_ae, var20); + this.field_147874_am = this.func_147778_a(this.field_147878_ac, this.field_147885_ae, this.field_147879_ad, var20); + this.field_147876_an = this.func_147778_a(this.field_147880_aa, this.field_147836_Z, this.field_147878_ac, var20); + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147808_5_; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147808_6_; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147808_7_; + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + this.func_147806_b(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, this.func_147793_a(p_147808_1_, this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_, 1)); + var8 = true; + } + + float var22; + float var23; + float var24; + float var25; + int var26; + int var27; + int var28; + int var29; + IIcon var30; + if(this.field_147837_f || p_147808_1_.func_149646_a(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ - 1, 2)) { + if(this.field_147851_l <= 0.0D) { + --p_147808_4_; + } + + this.field_147819_N = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147814_A = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147822_I = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.field_147820_O = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.field_147883_ah = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147825_U = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147878_ac = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.field_147866_ai = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + var16 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).func_149751_l(); + if(!var17 && !var19) { + this.field_147888_x = this.field_147819_N; + this.field_147832_R = this.field_147883_ah; + } else { + this.field_147888_x = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + this.field_147832_R = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + } + + if(!var17 && !var18) { + this.field_147812_F = this.field_147819_N; + this.field_147836_Z = this.field_147883_ah; + } else { + this.field_147812_F = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + this.field_147836_Z = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + } + + if(!var16 && !var19) { + this.field_147816_C = this.field_147820_O; + this.field_147827_W = this.field_147866_ai; + } else { + this.field_147816_C = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + this.field_147827_W = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + } + + if(!var16 && !var18) { + this.field_147823_J = this.field_147820_O; + this.field_147879_ad = this.field_147866_ai; + } else { + this.field_147823_J = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + this.field_147879_ad = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + } + + if(this.field_147851_l <= 0.0D) { + ++p_147808_4_; + } + + var20 = var14; + if(this.field_147851_l <= 0.0D || !this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_, p_147808_4_ - 1).func_149662_c()) { + var20 = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + var22 = (this.field_147819_N + this.field_147812_F + var21 + this.field_147822_I) / 4.0F; + var23 = (var21 + this.field_147822_I + this.field_147820_O + this.field_147823_J) / 4.0F; + var24 = (this.field_147814_A + var21 + this.field_147816_C + this.field_147820_O) / 4.0F; + var25 = (this.field_147888_x + this.field_147819_N + this.field_147814_A + var21) / 4.0F; + var9 = (float)((double)var22 * this.field_147857_k * (1.0D - this.field_147859_h) + (double)var23 * this.field_147857_k * this.field_147859_h + (double)var24 * (1.0D - this.field_147857_k) * this.field_147859_h + (double)var25 * (1.0D - this.field_147857_k) * (1.0D - this.field_147859_h)); + var10 = (float)((double)var22 * this.field_147857_k * (1.0D - this.field_147861_i) + (double)var23 * this.field_147857_k * this.field_147861_i + (double)var24 * (1.0D - this.field_147857_k) * this.field_147861_i + (double)var25 * (1.0D - this.field_147857_k) * (1.0D - this.field_147861_i)); + var11 = (float)((double)var22 * this.field_147855_j * (1.0D - this.field_147861_i) + (double)var23 * this.field_147855_j * this.field_147861_i + (double)var24 * (1.0D - this.field_147855_j) * this.field_147861_i + (double)var25 * (1.0D - this.field_147855_j) * (1.0D - this.field_147861_i)); + var12 = (float)((double)var22 * this.field_147855_j * (1.0D - this.field_147859_h) + (double)var23 * this.field_147855_j * this.field_147859_h + (double)var24 * (1.0D - this.field_147855_j) * this.field_147859_h + (double)var25 * (1.0D - this.field_147855_j) * (1.0D - this.field_147859_h)); + var26 = this.func_147778_a(this.field_147883_ah, this.field_147836_Z, this.field_147878_ac, var20); + var27 = this.func_147778_a(this.field_147878_ac, this.field_147866_ai, this.field_147879_ad, var20); + var28 = this.func_147778_a(this.field_147825_U, this.field_147827_W, this.field_147866_ai, var20); + var29 = this.func_147778_a(this.field_147832_R, this.field_147883_ah, this.field_147825_U, var20); + this.field_147864_al = this.func_147727_a(var26, var27, var28, var29, this.field_147857_k * (1.0D - this.field_147859_h), this.field_147857_k * this.field_147859_h, (1.0D - this.field_147857_k) * this.field_147859_h, (1.0D - this.field_147857_k) * (1.0D - this.field_147859_h)); + this.field_147874_am = this.func_147727_a(var26, var27, var28, var29, this.field_147857_k * (1.0D - this.field_147861_i), this.field_147857_k * this.field_147861_i, (1.0D - this.field_147857_k) * this.field_147861_i, (1.0D - this.field_147857_k) * (1.0D - this.field_147861_i)); + this.field_147876_an = this.func_147727_a(var26, var27, var28, var29, this.field_147855_j * (1.0D - this.field_147861_i), this.field_147855_j * this.field_147861_i, (1.0D - this.field_147855_j) * this.field_147861_i, (1.0D - this.field_147855_j) * (1.0D - this.field_147861_i)); + this.field_147870_ao = this.func_147727_a(var26, var27, var28, var29, this.field_147855_j * (1.0D - this.field_147859_h), this.field_147855_j * this.field_147859_h, (1.0D - this.field_147855_j) * this.field_147859_h, (1.0D - this.field_147855_j) * (1.0D - this.field_147859_h)); + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147808_5_ * 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147808_6_ * 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147808_7_ * 0.8F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.8F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var30 = this.func_147793_a(p_147808_1_, this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_, 2); + this.func_147761_c(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + if(field_147843_b && var30.func_94215_i().equals("grass_side") && !this.func_147744_b()) { + this.field_147872_ap *= p_147808_5_; + this.field_147852_aq *= p_147808_5_; + this.field_147850_ar *= p_147808_5_; + this.field_147848_as *= p_147808_5_; + this.field_147846_at *= p_147808_6_; + this.field_147860_au *= p_147808_6_; + this.field_147858_av *= p_147808_6_; + this.field_147856_aw *= p_147808_6_; + this.field_147854_ax *= p_147808_7_; + this.field_147841_ay *= p_147808_7_; + this.field_147839_az *= p_147808_7_; + this.field_147833_aA *= p_147808_7_; + this.func_147761_c(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if(this.field_147837_f || p_147808_1_.func_149646_a(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ + 1, 3)) { + if(this.field_147853_m >= 1.0D) { + ++p_147808_4_; + } + + this.field_147830_P = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147829_Q = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.field_147815_B = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147817_L = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.field_147868_aj = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.field_147862_ak = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.field_147828_V = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147887_af = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var16 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).func_149751_l(); + if(!var17 && !var19) { + this.field_147884_z = this.field_147830_P; + this.field_147826_T = this.field_147868_aj; + } else { + this.field_147884_z = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + this.field_147826_T = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + } + + if(!var17 && !var18) { + this.field_147821_H = this.field_147830_P; + this.field_147881_ab = this.field_147868_aj; + } else { + this.field_147821_H = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + this.field_147881_ab = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + } + + if(!var16 && !var19) { + this.field_147811_E = this.field_147829_Q; + this.field_147834_Y = this.field_147862_ak; + } else { + this.field_147811_E = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + this.field_147834_Y = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + } + + if(!var16 && !var18) { + this.field_147818_M = this.field_147829_Q; + this.field_147882_ag = this.field_147862_ak; + } else { + this.field_147818_M = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + this.field_147882_ag = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + } + + if(this.field_147853_m >= 1.0D) { + --p_147808_4_; + } + + var20 = var14; + if(this.field_147853_m >= 1.0D || !this.field_147845_a.func_147439_a(p_147808_2_, p_147808_3_, p_147808_4_ + 1).func_149662_c()) { + var20 = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + var22 = (this.field_147830_P + this.field_147821_H + var21 + this.field_147817_L) / 4.0F; + var23 = (var21 + this.field_147817_L + this.field_147829_Q + this.field_147818_M) / 4.0F; + var24 = (this.field_147815_B + var21 + this.field_147811_E + this.field_147829_Q) / 4.0F; + var25 = (this.field_147884_z + this.field_147830_P + this.field_147815_B + var21) / 4.0F; + var9 = (float)((double)var22 * this.field_147857_k * (1.0D - this.field_147859_h) + (double)var23 * this.field_147857_k * this.field_147859_h + (double)var24 * (1.0D - this.field_147857_k) * this.field_147859_h + (double)var25 * (1.0D - this.field_147857_k) * (1.0D - this.field_147859_h)); + var10 = (float)((double)var22 * this.field_147855_j * (1.0D - this.field_147859_h) + (double)var23 * this.field_147855_j * this.field_147859_h + (double)var24 * (1.0D - this.field_147855_j) * this.field_147859_h + (double)var25 * (1.0D - this.field_147855_j) * (1.0D - this.field_147859_h)); + var11 = (float)((double)var22 * this.field_147855_j * (1.0D - this.field_147861_i) + (double)var23 * this.field_147855_j * this.field_147861_i + (double)var24 * (1.0D - this.field_147855_j) * this.field_147861_i + (double)var25 * (1.0D - this.field_147855_j) * (1.0D - this.field_147861_i)); + var12 = (float)((double)var22 * this.field_147857_k * (1.0D - this.field_147861_i) + (double)var23 * this.field_147857_k * this.field_147861_i + (double)var24 * (1.0D - this.field_147857_k) * this.field_147861_i + (double)var25 * (1.0D - this.field_147857_k) * (1.0D - this.field_147861_i)); + var26 = this.func_147778_a(this.field_147868_aj, this.field_147881_ab, this.field_147887_af, var20); + var27 = this.func_147778_a(this.field_147887_af, this.field_147862_ak, this.field_147882_ag, var20); + var28 = this.func_147778_a(this.field_147828_V, this.field_147834_Y, this.field_147862_ak, var20); + var29 = this.func_147778_a(this.field_147826_T, this.field_147868_aj, this.field_147828_V, var20); + this.field_147864_al = this.func_147727_a(var26, var29, var28, var27, this.field_147857_k * (1.0D - this.field_147859_h), (1.0D - this.field_147857_k) * (1.0D - this.field_147859_h), (1.0D - this.field_147857_k) * this.field_147859_h, this.field_147857_k * this.field_147859_h); + this.field_147874_am = this.func_147727_a(var26, var29, var28, var27, this.field_147855_j * (1.0D - this.field_147859_h), (1.0D - this.field_147855_j) * (1.0D - this.field_147859_h), (1.0D - this.field_147855_j) * this.field_147859_h, this.field_147855_j * this.field_147859_h); + this.field_147876_an = this.func_147727_a(var26, var29, var28, var27, this.field_147855_j * (1.0D - this.field_147861_i), (1.0D - this.field_147855_j) * (1.0D - this.field_147861_i), (1.0D - this.field_147855_j) * this.field_147861_i, this.field_147855_j * this.field_147861_i); + this.field_147870_ao = this.func_147727_a(var26, var29, var28, var27, this.field_147857_k * (1.0D - this.field_147861_i), (1.0D - this.field_147857_k) * (1.0D - this.field_147861_i), (1.0D - this.field_147857_k) * this.field_147861_i, this.field_147857_k * this.field_147861_i); + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147808_5_ * 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147808_6_ * 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147808_7_ * 0.8F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.8F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.8F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.8F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var30 = this.func_147793_a(p_147808_1_, this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_, 3); + this.func_147734_d(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + if(field_147843_b && var30.func_94215_i().equals("grass_side") && !this.func_147744_b()) { + this.field_147872_ap *= p_147808_5_; + this.field_147852_aq *= p_147808_5_; + this.field_147850_ar *= p_147808_5_; + this.field_147848_as *= p_147808_5_; + this.field_147846_at *= p_147808_6_; + this.field_147860_au *= p_147808_6_; + this.field_147858_av *= p_147808_6_; + this.field_147856_aw *= p_147808_6_; + this.field_147854_ax *= p_147808_7_; + this.field_147841_ay *= p_147808_7_; + this.field_147839_az *= p_147808_7_; + this.field_147833_aA *= p_147808_7_; + this.func_147734_d(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if(this.field_147837_f || p_147808_1_.func_149646_a(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_, 4)) { + if(this.field_147859_h <= 0.0D) { + --p_147808_2_; + } + + this.field_147886_y = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147819_N = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147830_P = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.field_147813_G = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.field_147831_S = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147883_ah = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147868_aj = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.field_147880_aa = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var16 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).func_149751_l(); + if(!var18 && !var17) { + this.field_147888_x = this.field_147819_N; + this.field_147832_R = this.field_147883_ah; + } else { + this.field_147888_x = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + this.field_147832_R = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + } + + if(!var19 && !var17) { + this.field_147884_z = this.field_147830_P; + this.field_147826_T = this.field_147868_aj; + } else { + this.field_147884_z = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + this.field_147826_T = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + } + + if(!var18 && !var16) { + this.field_147812_F = this.field_147819_N; + this.field_147836_Z = this.field_147883_ah; + } else { + this.field_147812_F = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + this.field_147836_Z = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + } + + if(!var19 && !var16) { + this.field_147821_H = this.field_147830_P; + this.field_147881_ab = this.field_147868_aj; + } else { + this.field_147821_H = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + this.field_147881_ab = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + } + + if(this.field_147859_h <= 0.0D) { + ++p_147808_2_; + } + + var20 = var14; + if(this.field_147859_h <= 0.0D || !this.field_147845_a.func_147439_a(p_147808_2_ - 1, p_147808_3_, p_147808_4_).func_149662_c()) { + var20 = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_ - 1, p_147808_3_, p_147808_4_); + var22 = (this.field_147886_y + this.field_147884_z + var21 + this.field_147830_P) / 4.0F; + var23 = (var21 + this.field_147830_P + this.field_147813_G + this.field_147821_H) / 4.0F; + var24 = (this.field_147819_N + var21 + this.field_147812_F + this.field_147813_G) / 4.0F; + var25 = (this.field_147888_x + this.field_147886_y + this.field_147819_N + var21) / 4.0F; + var9 = (float)((double)var23 * this.field_147857_k * this.field_147853_m + (double)var24 * this.field_147857_k * (1.0D - this.field_147853_m) + (double)var25 * (1.0D - this.field_147857_k) * (1.0D - this.field_147853_m) + (double)var22 * (1.0D - this.field_147857_k) * this.field_147853_m); + var10 = (float)((double)var23 * this.field_147857_k * this.field_147851_l + (double)var24 * this.field_147857_k * (1.0D - this.field_147851_l) + (double)var25 * (1.0D - this.field_147857_k) * (1.0D - this.field_147851_l) + (double)var22 * (1.0D - this.field_147857_k) * this.field_147851_l); + var11 = (float)((double)var23 * this.field_147855_j * this.field_147851_l + (double)var24 * this.field_147855_j * (1.0D - this.field_147851_l) + (double)var25 * (1.0D - this.field_147855_j) * (1.0D - this.field_147851_l) + (double)var22 * (1.0D - this.field_147855_j) * this.field_147851_l); + var12 = (float)((double)var23 * this.field_147855_j * this.field_147853_m + (double)var24 * this.field_147855_j * (1.0D - this.field_147853_m) + (double)var25 * (1.0D - this.field_147855_j) * (1.0D - this.field_147853_m) + (double)var22 * (1.0D - this.field_147855_j) * this.field_147853_m); + var26 = this.func_147778_a(this.field_147831_S, this.field_147826_T, this.field_147868_aj, var20); + var27 = this.func_147778_a(this.field_147868_aj, this.field_147880_aa, this.field_147881_ab, var20); + var28 = this.func_147778_a(this.field_147883_ah, this.field_147836_Z, this.field_147880_aa, var20); + var29 = this.func_147778_a(this.field_147832_R, this.field_147831_S, this.field_147883_ah, var20); + this.field_147864_al = this.func_147727_a(var27, var28, var29, var26, this.field_147857_k * this.field_147853_m, this.field_147857_k * (1.0D - this.field_147853_m), (1.0D - this.field_147857_k) * (1.0D - this.field_147853_m), (1.0D - this.field_147857_k) * this.field_147853_m); + this.field_147874_am = this.func_147727_a(var27, var28, var29, var26, this.field_147857_k * this.field_147851_l, this.field_147857_k * (1.0D - this.field_147851_l), (1.0D - this.field_147857_k) * (1.0D - this.field_147851_l), (1.0D - this.field_147857_k) * this.field_147851_l); + this.field_147876_an = this.func_147727_a(var27, var28, var29, var26, this.field_147855_j * this.field_147851_l, this.field_147855_j * (1.0D - this.field_147851_l), (1.0D - this.field_147855_j) * (1.0D - this.field_147851_l), (1.0D - this.field_147855_j) * this.field_147851_l); + this.field_147870_ao = this.func_147727_a(var27, var28, var29, var26, this.field_147855_j * this.field_147853_m, this.field_147855_j * (1.0D - this.field_147853_m), (1.0D - this.field_147855_j) * (1.0D - this.field_147853_m), (1.0D - this.field_147855_j) * this.field_147853_m); + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147808_5_ * 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147808_6_ * 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147808_7_ * 0.6F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.6F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var30 = this.func_147793_a(p_147808_1_, this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_, 4); + this.func_147798_e(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + if(field_147843_b && var30.func_94215_i().equals("grass_side") && !this.func_147744_b()) { + this.field_147872_ap *= p_147808_5_; + this.field_147852_aq *= p_147808_5_; + this.field_147850_ar *= p_147808_5_; + this.field_147848_as *= p_147808_5_; + this.field_147846_at *= p_147808_6_; + this.field_147860_au *= p_147808_6_; + this.field_147858_av *= p_147808_6_; + this.field_147856_aw *= p_147808_6_; + this.field_147854_ax *= p_147808_7_; + this.field_147841_ay *= p_147808_7_; + this.field_147839_az *= p_147808_7_; + this.field_147833_aA *= p_147808_7_; + this.func_147798_e(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + if(this.field_147837_f || p_147808_1_.func_149646_a(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_, 5)) { + if(this.field_147861_i >= 1.0D) { + ++p_147808_2_; + } + + this.field_147810_D = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147820_O = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147829_Q = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.field_147824_K = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.field_147835_X = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.field_147866_ai = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.field_147862_ak = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.field_147885_ae = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + var16 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).func_149751_l(); + var17 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).func_149751_l(); + var18 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).func_149751_l(); + var19 = this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).func_149751_l(); + if(!var17 && !var19) { + this.field_147816_C = this.field_147820_O; + this.field_147827_W = this.field_147866_ai; + } else { + this.field_147816_C = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + this.field_147827_W = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + } + + if(!var17 && !var18) { + this.field_147811_E = this.field_147829_Q; + this.field_147834_Y = this.field_147862_ak; + } else { + this.field_147811_E = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + this.field_147834_Y = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + } + + if(!var16 && !var19) { + this.field_147823_J = this.field_147820_O; + this.field_147879_ad = this.field_147866_ai; + } else { + this.field_147823_J = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + this.field_147879_ad = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + } + + if(!var16 && !var18) { + this.field_147818_M = this.field_147829_Q; + this.field_147882_ag = this.field_147862_ak; + } else { + this.field_147818_M = this.getAmbientOcclusionLightValue(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + this.field_147882_ag = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + } + + if(this.field_147861_i >= 1.0D) { + --p_147808_2_; + } + + var20 = var14; + if(this.field_147861_i >= 1.0D || !this.field_147845_a.func_147439_a(p_147808_2_ + 1, p_147808_3_, p_147808_4_).func_149662_c()) { + var20 = p_147808_1_.func_149677_c(this.field_147845_a, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + } + + var21 = this.getAmbientOcclusionLightValue(p_147808_2_ + 1, p_147808_3_, p_147808_4_); + var22 = (this.field_147810_D + this.field_147811_E + var21 + this.field_147829_Q) / 4.0F; + var23 = (this.field_147816_C + this.field_147810_D + this.field_147820_O + var21) / 4.0F; + var24 = (this.field_147820_O + var21 + this.field_147823_J + this.field_147824_K) / 4.0F; + var25 = (var21 + this.field_147829_Q + this.field_147824_K + this.field_147818_M) / 4.0F; + var9 = (float)((double)var22 * (1.0D - this.field_147855_j) * this.field_147853_m + (double)var23 * (1.0D - this.field_147855_j) * (1.0D - this.field_147853_m) + (double)var24 * this.field_147855_j * (1.0D - this.field_147853_m) + (double)var25 * this.field_147855_j * this.field_147853_m); + var10 = (float)((double)var22 * (1.0D - this.field_147855_j) * this.field_147851_l + (double)var23 * (1.0D - this.field_147855_j) * (1.0D - this.field_147851_l) + (double)var24 * this.field_147855_j * (1.0D - this.field_147851_l) + (double)var25 * this.field_147855_j * this.field_147851_l); + var11 = (float)((double)var22 * (1.0D - this.field_147857_k) * this.field_147851_l + (double)var23 * (1.0D - this.field_147857_k) * (1.0D - this.field_147851_l) + (double)var24 * this.field_147857_k * (1.0D - this.field_147851_l) + (double)var25 * this.field_147857_k * this.field_147851_l); + var12 = (float)((double)var22 * (1.0D - this.field_147857_k) * this.field_147853_m + (double)var23 * (1.0D - this.field_147857_k) * (1.0D - this.field_147853_m) + (double)var24 * this.field_147857_k * (1.0D - this.field_147853_m) + (double)var25 * this.field_147857_k * this.field_147853_m); + var26 = this.func_147778_a(this.field_147835_X, this.field_147834_Y, this.field_147862_ak, var20); + var27 = this.func_147778_a(this.field_147862_ak, this.field_147885_ae, this.field_147882_ag, var20); + var28 = this.func_147778_a(this.field_147866_ai, this.field_147879_ad, this.field_147885_ae, var20); + var29 = this.func_147778_a(this.field_147827_W, this.field_147835_X, this.field_147866_ai, var20); + this.field_147864_al = this.func_147727_a(var26, var29, var28, var27, (1.0D - this.field_147855_j) * this.field_147853_m, (1.0D - this.field_147855_j) * (1.0D - this.field_147853_m), this.field_147855_j * (1.0D - this.field_147853_m), this.field_147855_j * this.field_147853_m); + this.field_147874_am = this.func_147727_a(var26, var29, var28, var27, (1.0D - this.field_147855_j) * this.field_147851_l, (1.0D - this.field_147855_j) * (1.0D - this.field_147851_l), this.field_147855_j * (1.0D - this.field_147851_l), this.field_147855_j * this.field_147851_l); + this.field_147876_an = this.func_147727_a(var26, var29, var28, var27, (1.0D - this.field_147857_k) * this.field_147851_l, (1.0D - this.field_147857_k) * (1.0D - this.field_147851_l), this.field_147857_k * (1.0D - this.field_147851_l), this.field_147857_k * this.field_147851_l); + this.field_147870_ao = this.func_147727_a(var26, var29, var28, var27, (1.0D - this.field_147857_k) * this.field_147853_m, (1.0D - this.field_147857_k) * (1.0D - this.field_147853_m), this.field_147857_k * (1.0D - this.field_147853_m), this.field_147857_k * this.field_147853_m); + if(var13) { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = p_147808_5_ * 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = p_147808_6_ * 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = p_147808_7_ * 0.6F; + } else { + this.field_147872_ap = this.field_147852_aq = this.field_147850_ar = this.field_147848_as = 0.6F; + this.field_147846_at = this.field_147860_au = this.field_147858_av = this.field_147856_aw = 0.6F; + this.field_147854_ax = this.field_147841_ay = this.field_147839_az = this.field_147833_aA = 0.6F; + } + + this.field_147872_ap *= var9; + this.field_147846_at *= var9; + this.field_147854_ax *= var9; + this.field_147852_aq *= var10; + this.field_147860_au *= var10; + this.field_147841_ay *= var10; + this.field_147850_ar *= var11; + this.field_147858_av *= var11; + this.field_147839_az *= var11; + this.field_147848_as *= var12; + this.field_147856_aw *= var12; + this.field_147833_aA *= var12; + var30 = this.func_147793_a(p_147808_1_, this.field_147845_a, p_147808_2_, p_147808_3_, p_147808_4_, 5); + this.func_147764_f(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, var30); + if(field_147843_b && var30.func_94215_i().equals("grass_side") && !this.func_147744_b()) { + this.field_147872_ap *= p_147808_5_; + this.field_147852_aq *= p_147808_5_; + this.field_147850_ar *= p_147808_5_; + this.field_147848_as *= p_147808_5_; + this.field_147846_at *= p_147808_6_; + this.field_147860_au *= p_147808_6_; + this.field_147858_av *= p_147808_6_; + this.field_147856_aw *= p_147808_6_; + this.field_147854_ax *= p_147808_7_; + this.field_147841_ay *= p_147808_7_; + this.field_147839_az *= p_147808_7_; + this.field_147833_aA *= p_147808_7_; + this.func_147764_f(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.func_149990_e()); + } + + var8 = true; + } + + this.field_147863_w = false; + return var8; + } + + public int func_147778_a(int p_147778_1_, int p_147778_2_, int p_147778_3_, int p_147778_4_) { + if(p_147778_1_ == 0) { + p_147778_1_ = p_147778_4_; + } + + if(p_147778_2_ == 0) { + p_147778_2_ = p_147778_4_; + } + + if(p_147778_3_ == 0) { + p_147778_3_ = p_147778_4_; + } + + return p_147778_1_ + p_147778_2_ + p_147778_3_ + p_147778_4_ >> 2 & 16711935; + } + + public int func_147727_a(int p_147727_1_, int p_147727_2_, int p_147727_3_, int p_147727_4_, double p_147727_5_, double p_147727_7_, double p_147727_9_, double p_147727_11_) { + int var13 = (int)((double)(p_147727_1_ >> 16 & 255) * p_147727_5_ + (double)(p_147727_2_ >> 16 & 255) * p_147727_7_ + (double)(p_147727_3_ >> 16 & 255) * p_147727_9_ + (double)(p_147727_4_ >> 16 & 255) * p_147727_11_) & 255; + int var14 = (int)((double)(p_147727_1_ & 255) * p_147727_5_ + (double)(p_147727_2_ & 255) * p_147727_7_ + (double)(p_147727_3_ & 255) * p_147727_9_ + (double)(p_147727_4_ & 255) * p_147727_11_) & 255; + return var13 << 16 | var14; + } + + public boolean func_147736_d(Block p_147736_1_, int p_147736_2_, int p_147736_3_, int p_147736_4_, float p_147736_5_, float p_147736_6_, float p_147736_7_) { + this.field_147863_w = false; + boolean defaultTexture = Tessellator.field_78398_a.defaultTexture; + boolean betterGrass = Config.isBetterGrass() && defaultTexture; + Tessellator var8 = Tessellator.field_78398_a; + boolean var9 = false; + int var26 = -1; + float var27; + float var13; + float var19; + float var22; + if(this.field_147837_f || p_147736_1_.func_149646_a(this.field_147845_a, p_147736_2_, p_147736_3_ - 1, p_147736_4_, 0)) { + if(var26 < 0) { + var26 = p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var27 = 0.5F; + var13 = var27; + var19 = var27; + var22 = var27; + if(p_147736_1_ != Blocks.field_150349_c) { + var13 = var27 * p_147736_5_; + var19 = var27 * p_147736_6_; + var22 = var27 * p_147736_7_; + } + + var8.func_78380_c(this.field_147855_j > 0.0D?var26:p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_ - 1, p_147736_4_)); + var8.func_78386_a(var13, var19, var22); + this.func_147768_a(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, this.func_147793_a(p_147736_1_, this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 0)); + var9 = true; + } + + if(this.field_147837_f || p_147736_1_.func_149646_a(this.field_147845_a, p_147736_2_, p_147736_3_ + 1, p_147736_4_, 1)) { + if(var26 < 0) { + var26 = p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var27 = 1.0F; + var13 = var27 * p_147736_5_; + var19 = var27 * p_147736_6_; + var22 = var27 * p_147736_7_; + var8.func_78380_c(this.field_147857_k < 1.0D?var26:p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_ + 1, p_147736_4_)); + var8.func_78386_a(var13, var19, var22); + this.func_147806_b(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, this.func_147793_a(p_147736_1_, this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 1)); + var9 = true; + } + + float var25; + IIcon var271; + if(this.field_147837_f || p_147736_1_.func_149646_a(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_ - 1, 2)) { + if(var26 < 0) { + var26 = p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = 0.8F; + var19 = var13; + var22 = var13; + var25 = var13; + if(p_147736_1_ != Blocks.field_150349_c) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.func_78380_c(this.field_147851_l > 0.0D?var26:p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_ - 1)); + var8.func_78386_a(var19, var22, var25); + var271 = this.func_147793_a(p_147736_1_, this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 2); + if(betterGrass) { + if(var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 2, var271); + if(var271 == TextureUtils.iconGrassTop) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if(var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 2); + } + } + + this.func_147761_c(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + if(defaultTexture && field_147843_b && var271 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.func_147761_c(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + if(this.field_147837_f || p_147736_1_.func_149646_a(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_ + 1, 3)) { + if(var26 < 0) { + var26 = p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = 0.8F; + var19 = var13; + var22 = var13; + var25 = var13; + if(p_147736_1_ != Blocks.field_150349_c) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.func_78380_c(this.field_147853_m < 1.0D?var26:p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_ + 1)); + var8.func_78386_a(var19, var22, var25); + var271 = this.func_147793_a(p_147736_1_, this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 3); + if(betterGrass) { + if(var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 3, var271); + if(var271 == TextureUtils.iconGrassTop) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if(var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 3); + } + } + + this.func_147734_d(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + if(defaultTexture && field_147843_b && var271 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.func_147734_d(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + if(this.field_147837_f || p_147736_1_.func_149646_a(this.field_147845_a, p_147736_2_ - 1, p_147736_3_, p_147736_4_, 4)) { + if(var26 < 0) { + var26 = p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = 0.6F; + var19 = var13; + var22 = var13; + var25 = var13; + if(p_147736_1_ != Blocks.field_150349_c) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.func_78380_c(this.field_147859_h > 0.0D?var26:p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_ - 1, p_147736_3_, p_147736_4_)); + var8.func_78386_a(var19, var22, var25); + var271 = this.func_147793_a(p_147736_1_, this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 4); + if(betterGrass) { + if(var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 4, var271); + if(var271 == TextureUtils.iconGrassTop) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if(var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 4); + } + } + + this.func_147798_e(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + if(defaultTexture && field_147843_b && var271 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.func_147798_e(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + if(this.field_147837_f || p_147736_1_.func_149646_a(this.field_147845_a, p_147736_2_ + 1, p_147736_3_, p_147736_4_, 5)) { + if(var26 < 0) { + var26 = p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_); + } + + var13 = 0.6F; + var19 = var13; + var22 = var13; + var25 = var13; + if(p_147736_1_ != Blocks.field_150349_c) { + var19 = var13 * p_147736_5_; + var22 = var13 * p_147736_6_; + var25 = var13 * p_147736_7_; + } + + var8.func_78380_c(this.field_147861_i < 1.0D?var26:p_147736_1_.func_149677_c(this.field_147845_a, p_147736_2_ + 1, p_147736_3_, p_147736_4_)); + var8.func_78386_a(var19, var22, var25); + var271 = this.func_147793_a(p_147736_1_, this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 5); + if(betterGrass) { + if(var271 == TextureUtils.iconGrassSide || var271 == TextureUtils.iconMyceliumSide) { + var271 = Config.getSideGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 5, var271); + if(var271 == TextureUtils.iconGrassTop) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + } + } + + if(var271 == TextureUtils.iconGrassSideSnowed) { + var271 = Config.getSideSnowGrassTexture(this.field_147845_a, p_147736_2_, p_147736_3_, p_147736_4_, 5); + } + } + + this.func_147764_f(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, var271); + if(defaultTexture && field_147843_b && var271 == TextureUtils.iconGrassSide && !this.func_147744_b()) { + var8.func_78386_a(var19 * p_147736_5_, var22 * p_147736_6_, var25 * p_147736_7_); + this.func_147764_f(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.func_149990_e()); + } + + var9 = true; + } + + return var9; + } + + public boolean func_147772_a(BlockCocoa p_147772_1_, int p_147772_2_, int p_147772_3_, int p_147772_4_) { + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147772_1_.func_149677_c(this.field_147845_a, p_147772_2_, p_147772_3_, p_147772_4_)); + var5.func_78386_a(1.0F, 1.0F, 1.0F); + int var6 = this.field_147845_a.func_72805_g(p_147772_2_, p_147772_3_, p_147772_4_); + int var7 = BlockDirectional.func_149895_l(var6); + int var8 = BlockCocoa.func_149987_c(var6); + IIcon var9 = p_147772_1_.func_149988_b(var8); + int var10 = 4 + var8 * 2; + int var11 = 5 + var8 * 2; + double var12 = 15.0D - (double)var10; + double var14 = 15.0D; + double var16 = 4.0D; + double var18 = 4.0D + (double)var11; + double var20 = (double)var9.func_94214_a(var12); + double var22 = (double)var9.func_94214_a(var14); + double var24 = (double)var9.func_94207_b(var16); + double var26 = (double)var9.func_94207_b(var18); + double var28 = 0.0D; + double var30 = 0.0D; + switch(var7) { + case 0: + var28 = 8.0D - (double)(var10 / 2); + var30 = 15.0D - (double)var10; + break; + case 1: + var28 = 1.0D; + var30 = 8.0D - (double)(var10 / 2); + break; + case 2: + var28 = 8.0D - (double)(var10 / 2); + var30 = 1.0D; + break; + case 3: + var28 = 15.0D - (double)var10; + var30 = 8.0D - (double)(var10 / 2); + } + + double var32 = (double)p_147772_2_ + var28 / 16.0D; + double var34 = (double)p_147772_2_ + (var28 + (double)var10) / 16.0D; + double var36 = (double)p_147772_3_ + (12.0D - (double)var11) / 16.0D; + double var38 = (double)p_147772_3_ + 0.75D; + double var40 = (double)p_147772_4_ + var30 / 16.0D; + double var42 = (double)p_147772_4_ + (var30 + (double)var10) / 16.0D; + var5.func_78374_a(var32, var36, var40, var20, var26); + var5.func_78374_a(var32, var36, var42, var22, var26); + var5.func_78374_a(var32, var38, var42, var22, var24); + var5.func_78374_a(var32, var38, var40, var20, var24); + var5.func_78374_a(var34, var36, var42, var20, var26); + var5.func_78374_a(var34, var36, var40, var22, var26); + var5.func_78374_a(var34, var38, var40, var22, var24); + var5.func_78374_a(var34, var38, var42, var20, var24); + var5.func_78374_a(var34, var36, var40, var20, var26); + var5.func_78374_a(var32, var36, var40, var22, var26); + var5.func_78374_a(var32, var38, var40, var22, var24); + var5.func_78374_a(var34, var38, var40, var20, var24); + var5.func_78374_a(var32, var36, var42, var20, var26); + var5.func_78374_a(var34, var36, var42, var22, var26); + var5.func_78374_a(var34, var38, var42, var22, var24); + var5.func_78374_a(var32, var38, var42, var20, var24); + int var44 = var10; + if(var8 >= 2) { + var44 = var10 - 1; + } + + var20 = (double)var9.func_94209_e(); + var22 = (double)var9.func_94214_a((double)var44); + var24 = (double)var9.func_94206_g(); + var26 = (double)var9.func_94207_b((double)var44); + var5.func_78374_a(var32, var38, var42, var20, var26); + var5.func_78374_a(var34, var38, var42, var22, var26); + var5.func_78374_a(var34, var38, var40, var22, var24); + var5.func_78374_a(var32, var38, var40, var20, var24); + var5.func_78374_a(var32, var36, var40, var20, var24); + var5.func_78374_a(var34, var36, var40, var22, var24); + var5.func_78374_a(var34, var36, var42, var22, var26); + var5.func_78374_a(var32, var36, var42, var20, var26); + var20 = (double)var9.func_94214_a(12.0D); + var22 = (double)var9.func_94212_f(); + var24 = (double)var9.func_94206_g(); + var26 = (double)var9.func_94207_b(4.0D); + var28 = 8.0D; + var30 = 0.0D; + double var45; + switch(var7) { + case 0: + var28 = 8.0D; + var30 = 12.0D; + var45 = var20; + var20 = var22; + var22 = var45; + break; + case 1: + var28 = 0.0D; + var30 = 8.0D; + break; + case 2: + var28 = 8.0D; + var30 = 0.0D; + break; + case 3: + var28 = 12.0D; + var30 = 8.0D; + var45 = var20; + var20 = var22; + var22 = var45; + } + + var32 = (double)p_147772_2_ + var28 / 16.0D; + var34 = (double)p_147772_2_ + (var28 + 4.0D) / 16.0D; + var36 = (double)p_147772_3_ + 0.75D; + var38 = (double)p_147772_3_ + 1.0D; + var40 = (double)p_147772_4_ + var30 / 16.0D; + var42 = (double)p_147772_4_ + (var30 + 4.0D) / 16.0D; + if(var7 != 2 && var7 != 0) { + if(var7 == 1 || var7 == 3) { + var5.func_78374_a(var34, var36, var40, var20, var26); + var5.func_78374_a(var32, var36, var40, var22, var26); + var5.func_78374_a(var32, var38, var40, var22, var24); + var5.func_78374_a(var34, var38, var40, var20, var24); + var5.func_78374_a(var32, var36, var40, var22, var26); + var5.func_78374_a(var34, var36, var40, var20, var26); + var5.func_78374_a(var34, var38, var40, var20, var24); + var5.func_78374_a(var32, var38, var40, var22, var24); + } + } else { + var5.func_78374_a(var32, var36, var40, var22, var26); + var5.func_78374_a(var32, var36, var42, var20, var26); + var5.func_78374_a(var32, var38, var42, var20, var24); + var5.func_78374_a(var32, var38, var40, var22, var24); + var5.func_78374_a(var32, var36, var42, var20, var26); + var5.func_78374_a(var32, var36, var40, var22, var26); + var5.func_78374_a(var32, var38, var40, var22, var24); + var5.func_78374_a(var32, var38, var42, var20, var24); + } + + return true; + } + + public boolean func_147797_a(BlockBeacon p_147797_1_, int p_147797_2_, int p_147797_3_, int p_147797_4_) { + float var5 = 0.1875F; + this.func_147757_a(this.func_147745_b(Blocks.field_150359_w)); + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.func_147784_q(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + this.field_147837_f = true; + this.func_147757_a(this.func_147745_b(Blocks.field_150343_Z)); + this.func_147782_a(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)var5, 0.875D); + this.func_147784_q(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + IIcon iconBeacon = this.func_147745_b(Blocks.field_150461_bJ); + if(Config.isConnectedTextures()) { + iconBeacon = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_, -1, iconBeacon); + } + + this.func_147757_a(iconBeacon); + this.func_147782_a(0.1875D, (double)var5, 0.1875D, 0.8125D, 0.875D, 0.8125D); + this.func_147784_q(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + this.field_147837_f = false; + this.func_147771_a(); + return true; + } + + public boolean func_147755_t(Block p_147755_1_, int p_147755_2_, int p_147755_3_, int p_147755_4_) { + int var5 = p_147755_1_.func_149720_d(this.field_147845_a, p_147755_2_, p_147755_3_, p_147755_4_); + float var6 = (float)(var5 >> 16 & 255) / 255.0F; + float var7 = (float)(var5 >> 8 & 255) / 255.0F; + float var8 = (float)(var5 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; + var6 = var9; + var7 = var10; + var8 = var11; + } + + return this.func_147754_e(p_147755_1_, p_147755_2_, p_147755_3_, p_147755_4_, var6, var7, var8); + } + + public boolean func_147754_e(Block p_147754_1_, int p_147754_2_, int p_147754_3_, int p_147754_4_, float p_147754_5_, float p_147754_6_, float p_147754_7_) { + Tessellator var8 = Tessellator.field_78398_a; + boolean var9 = false; + float var10 = 0.5F; + float var11 = 1.0F; + float var12 = 0.8F; + float var13 = 0.6F; + float var14 = var10 * p_147754_5_; + float var15 = var11 * p_147754_5_; + float var16 = var12 * p_147754_5_; + float var17 = var13 * p_147754_5_; + float var18 = var10 * p_147754_6_; + float var19 = var11 * p_147754_6_; + float var20 = var12 * p_147754_6_; + float var21 = var13 * p_147754_6_; + float var22 = var10 * p_147754_7_; + float var23 = var11 * p_147754_7_; + float var24 = var12 * p_147754_7_; + float var25 = var13 * p_147754_7_; + float var26 = 0.0625F; + int var27 = p_147754_1_.func_149677_c(this.field_147845_a, p_147754_2_, p_147754_3_, p_147754_4_); + if(this.field_147837_f || p_147754_1_.func_149646_a(this.field_147845_a, p_147754_2_, p_147754_3_ - 1, p_147754_4_, 0)) { + var8.func_78380_c(this.field_147855_j > 0.0D?var27:p_147754_1_.func_149677_c(this.field_147845_a, p_147754_2_, p_147754_3_ - 1, p_147754_4_)); + var8.func_78386_a(var14, var18, var22); + this.func_147768_a(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.func_147793_a(p_147754_1_, this.field_147845_a, p_147754_2_, p_147754_3_, p_147754_4_, 0)); + } + + if(this.field_147837_f || p_147754_1_.func_149646_a(this.field_147845_a, p_147754_2_, p_147754_3_ + 1, p_147754_4_, 1)) { + var8.func_78380_c(this.field_147857_k < 1.0D?var27:p_147754_1_.func_149677_c(this.field_147845_a, p_147754_2_, p_147754_3_ + 1, p_147754_4_)); + var8.func_78386_a(var15, var19, var23); + this.func_147806_b(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.func_147793_a(p_147754_1_, this.field_147845_a, p_147754_2_, p_147754_3_, p_147754_4_, 1)); + } + + var8.func_78380_c(var27); + var8.func_78386_a(var16, var20, var24); + var8.func_78372_c(0.0F, 0.0F, var26); + this.func_147761_c(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.func_147793_a(p_147754_1_, this.field_147845_a, p_147754_2_, p_147754_3_, p_147754_4_, 2)); + var8.func_78372_c(0.0F, 0.0F, -var26); + var8.func_78372_c(0.0F, 0.0F, -var26); + this.func_147734_d(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.func_147793_a(p_147754_1_, this.field_147845_a, p_147754_2_, p_147754_3_, p_147754_4_, 3)); + var8.func_78372_c(0.0F, 0.0F, var26); + var8.func_78386_a(var17, var21, var25); + var8.func_78372_c(var26, 0.0F, 0.0F); + this.func_147798_e(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.func_147793_a(p_147754_1_, this.field_147845_a, p_147754_2_, p_147754_3_, p_147754_4_, 4)); + var8.func_78372_c(-var26, 0.0F, 0.0F); + var8.func_78372_c(-var26, 0.0F, 0.0F); + this.func_147764_f(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.func_147793_a(p_147754_1_, this.field_147845_a, p_147754_2_, p_147754_3_, p_147754_4_, 5)); + var8.func_78372_c(var26, 0.0F, 0.0F); + return true; + } + + public boolean func_147735_a(BlockFence p_147735_1_, int p_147735_2_, int p_147735_3_, int p_147735_4_) { + boolean var5 = false; + float var6 = 0.375F; + float var7 = 0.625F; + this.func_147782_a((double)var6, 0.0D, (double)var6, (double)var7, 1.0D, (double)var7); + this.func_147784_q(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + boolean var8 = false; + boolean var9 = false; + if(p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_ - 1, p_147735_3_, p_147735_4_) || p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_ + 1, p_147735_3_, p_147735_4_)) { + var8 = true; + } + + if(p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_, p_147735_3_, p_147735_4_ - 1) || p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_, p_147735_3_, p_147735_4_ + 1)) { + var9 = true; + } + + boolean var10 = p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_ - 1, p_147735_3_, p_147735_4_); + boolean var11 = p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_ + 1, p_147735_3_, p_147735_4_); + boolean var12 = p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_, p_147735_3_, p_147735_4_ - 1); + boolean var13 = p_147735_1_.func_149826_e(this.field_147845_a, p_147735_2_, p_147735_3_, p_147735_4_ + 1); + if(!var8 && !var9) { + var8 = true; + } + + var6 = 0.4375F; + var7 = 0.5625F; + float var14 = 0.75F; + float var15 = 0.9375F; + float var16 = var10?0.0F:var6; + float var17 = var11?1.0F:var7; + float var18 = var12?0.0F:var6; + float var19 = var13?1.0F:var7; + this.field_152631_f = true; + if(var8) { + this.func_147782_a((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); + this.func_147784_q(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + if(var9) { + this.func_147782_a((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); + this.func_147784_q(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + var14 = 0.375F; + var15 = 0.5625F; + if(var8) { + this.func_147782_a((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); + this.func_147784_q(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + if(var9) { + this.func_147782_a((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); + this.func_147784_q(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + var5 = true; + } + + this.field_152631_f = false; + p_147735_1_.func_149719_a(this.field_147845_a, p_147735_2_, p_147735_3_, p_147735_4_); + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147735_2_, p_147735_3_, p_147735_4_)) { + this.renderSnow(p_147735_2_, p_147735_3_, p_147735_4_, Blocks.field_150431_aC.func_149669_A()); + } + + return var5; + } + + public boolean func_147807_a(BlockWall p_147807_1_, int p_147807_2_, int p_147807_3_, int p_147807_4_) { + boolean var5 = p_147807_1_.func_150091_e(this.field_147845_a, p_147807_2_ - 1, p_147807_3_, p_147807_4_); + boolean var6 = p_147807_1_.func_150091_e(this.field_147845_a, p_147807_2_ + 1, p_147807_3_, p_147807_4_); + boolean var7 = p_147807_1_.func_150091_e(this.field_147845_a, p_147807_2_, p_147807_3_, p_147807_4_ - 1); + boolean var8 = p_147807_1_.func_150091_e(this.field_147845_a, p_147807_2_, p_147807_3_, p_147807_4_ + 1); + boolean var9 = var7 && var8 && !var5 && !var6; + boolean var10 = !var7 && !var8 && var5 && var6; + boolean var11 = this.field_147845_a.func_147437_c(p_147807_2_, p_147807_3_ + 1, p_147807_4_); + if((var9 || var10) && var11) { + if(var9) { + this.func_147782_a(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); + this.func_147784_q(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } else { + this.func_147782_a(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + this.func_147784_q(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + } else { + this.func_147782_a(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + this.func_147784_q(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + if(var5) { + this.func_147782_a(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); + this.func_147784_q(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if(var6) { + this.func_147782_a(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + this.func_147784_q(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if(var7) { + this.func_147782_a(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); + this.func_147784_q(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if(var8) { + this.func_147782_a(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); + this.func_147784_q(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + } + + p_147807_1_.func_149719_a(this.field_147845_a, p_147807_2_, p_147807_3_, p_147807_4_); + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147807_2_, p_147807_3_, p_147807_4_)) { + this.renderSnow(p_147807_2_, p_147807_3_, p_147807_4_, Blocks.field_150431_aC.func_149669_A()); + } + + return true; + } + + public boolean func_147802_a(BlockDragonEgg p_147802_1_, int p_147802_2_, int p_147802_3_, int p_147802_4_) { + boolean var5 = false; + int var6 = 0; + + for(int var7 = 0; var7 < 8; ++var7) { + byte var8 = 0; + byte var9 = 1; + if(var7 == 0) { + var8 = 2; + } + + if(var7 == 1) { + var8 = 3; + } + + if(var7 == 2) { + var8 = 4; + } + + if(var7 == 3) { + var8 = 5; + var9 = 2; + } + + if(var7 == 4) { + var8 = 6; + var9 = 3; + } + + if(var7 == 5) { + var8 = 7; + var9 = 5; + } + + if(var7 == 6) { + var8 = 6; + var9 = 2; + } + + if(var7 == 7) { + var8 = 3; + } + + float var10 = (float)var8 / 16.0F; + float var11 = 1.0F - (float)var6 / 16.0F; + float var12 = 1.0F - (float)(var6 + var9) / 16.0F; + var6 += var9; + this.func_147782_a((double)(0.5F - var10), (double)var12, (double)(0.5F - var10), (double)(0.5F + var10), (double)var11, (double)(0.5F + var10)); + this.func_147784_q(p_147802_1_, p_147802_2_, p_147802_3_, p_147802_4_); + } + + var5 = true; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return var5; + } + + public boolean func_147776_a(BlockFenceGate p_147776_1_, int p_147776_2_, int p_147776_3_, int p_147776_4_) { + boolean var5 = true; + int var6 = this.field_147845_a.func_72805_g(p_147776_2_, p_147776_3_, p_147776_4_); + boolean var7 = BlockFenceGate.func_149896_b(var6); + int var8 = BlockDirectional.func_149895_l(var6); + float var9 = 0.375F; + float var10 = 0.5625F; + float var11 = 0.75F; + float var12 = 0.9375F; + float var13 = 0.3125F; + float var14 = 1.0F; + if((var8 == 2 || var8 == 0) && this.field_147845_a.func_147439_a(p_147776_2_ - 1, p_147776_3_, p_147776_4_) == Blocks.field_150463_bK && this.field_147845_a.func_147439_a(p_147776_2_ + 1, p_147776_3_, p_147776_4_) == Blocks.field_150463_bK || (var8 == 3 || var8 == 1) && this.field_147845_a.func_147439_a(p_147776_2_, p_147776_3_, p_147776_4_ - 1) == Blocks.field_150463_bK && this.field_147845_a.func_147439_a(p_147776_2_, p_147776_3_, p_147776_4_ + 1) == Blocks.field_150463_bK) { + var9 -= 0.1875F; + var10 -= 0.1875F; + var11 -= 0.1875F; + var12 -= 0.1875F; + var13 -= 0.1875F; + var14 -= 0.1875F; + } + + this.field_147837_f = true; + float var15; + float var16; + float var17; + float var18; + if(var8 != 3 && var8 != 1) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.4375F; + var18 = 0.5625F; + this.func_147782_a((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.875F; + var16 = 1.0F; + this.func_147782_a((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else { + this.field_147867_u = 1; + var15 = 0.4375F; + var16 = 0.5625F; + var17 = 0.0F; + var18 = 0.125F; + this.func_147782_a((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.875F; + var18 = 1.0F; + this.func_147782_a((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.field_147867_u = 0; + } + + if(var7) { + if(var8 == 2 || var8 == 0) { + this.field_147867_u = 1; + } + + float var19; + float var20; + float var21; + if(var8 == 3) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.5625F; + var20 = 0.8125F; + var21 = 0.9375F; + this.func_147782_a(0.8125D, (double)var9, 0.0D, 0.9375D, (double)var12, 0.125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.8125D, (double)var9, 0.875D, 0.9375D, (double)var12, 1.0D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.5625D, (double)var9, 0.0D, 0.8125D, (double)var10, 0.125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.5625D, (double)var9, 0.875D, 0.8125D, (double)var10, 1.0D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.5625D, (double)var11, 0.0D, 0.8125D, (double)var12, 0.125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.5625D, (double)var11, 0.875D, 0.8125D, (double)var12, 1.0D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else if(var8 == 1) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.0625F; + var20 = 0.1875F; + var21 = 0.4375F; + this.func_147782_a(0.0625D, (double)var9, 0.0D, 0.1875D, (double)var12, 0.125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.0625D, (double)var9, 0.875D, 0.1875D, (double)var12, 1.0D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.1875D, (double)var9, 0.0D, 0.4375D, (double)var10, 0.125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.1875D, (double)var9, 0.875D, 0.4375D, (double)var10, 1.0D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.1875D, (double)var11, 0.0D, 0.4375D, (double)var12, 0.125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.1875D, (double)var11, 0.875D, 0.4375D, (double)var12, 1.0D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else if(var8 == 0) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.5625F; + var20 = 0.8125F; + var21 = 0.9375F; + this.func_147782_a(0.0D, (double)var9, 0.8125D, 0.125D, (double)var12, 0.9375D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.875D, (double)var9, 0.8125D, 1.0D, (double)var12, 0.9375D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.0D, (double)var9, 0.5625D, 0.125D, (double)var10, 0.8125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.875D, (double)var9, 0.5625D, 1.0D, (double)var10, 0.8125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.0D, (double)var11, 0.5625D, 0.125D, (double)var12, 0.8125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.875D, (double)var11, 0.5625D, 1.0D, (double)var12, 0.8125D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else if(var8 == 2) { + var15 = 0.0F; + var16 = 0.125F; + var17 = 0.875F; + var18 = 1.0F; + var19 = 0.0625F; + var20 = 0.1875F; + var21 = 0.4375F; + this.func_147782_a(0.0D, (double)var9, 0.0625D, 0.125D, (double)var12, 0.1875D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.875D, (double)var9, 0.0625D, 1.0D, (double)var12, 0.1875D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.0D, (double)var9, 0.1875D, 0.125D, (double)var10, 0.4375D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.875D, (double)var9, 0.1875D, 1.0D, (double)var10, 0.4375D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.0D, (double)var11, 0.1875D, 0.125D, (double)var12, 0.4375D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a(0.875D, (double)var11, 0.1875D, 1.0D, (double)var12, 0.4375D); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + } else if(var8 != 3 && var8 != 1) { + var15 = 0.375F; + var16 = 0.5F; + var17 = 0.4375F; + var18 = 0.5625F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.5F; + var16 = 0.625F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.625F; + var16 = 0.875F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var15 = 0.125F; + var16 = 0.375F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } else { + this.field_147867_u = 1; + var15 = 0.4375F; + var16 = 0.5625F; + var17 = 0.375F; + var18 = 0.5F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.5F; + var18 = 0.625F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.625F; + var18 = 0.875F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + var17 = 0.125F; + var18 = 0.375F; + this.func_147782_a((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.func_147782_a((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); + this.func_147784_q(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + + if(Config.isBetterSnow() && this.hasSnowNeighbours(p_147776_2_, p_147776_3_, p_147776_4_)) { + this.renderSnow(p_147776_2_, p_147776_3_, p_147776_4_, Blocks.field_150431_aC.func_149669_A()); + } + + this.field_147837_f = false; + this.field_147867_u = 0; + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return var5; + } + + public boolean func_147803_a(BlockHopper p_147803_1_, int p_147803_2_, int p_147803_3_, int p_147803_4_) { + Tessellator var5 = Tessellator.field_78398_a; + var5.func_78380_c(p_147803_1_.func_149677_c(this.field_147845_a, p_147803_2_, p_147803_3_, p_147803_4_)); + int var6 = p_147803_1_.func_149720_d(this.field_147845_a, p_147803_2_, p_147803_3_, p_147803_4_); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var10 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; + float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; + float var12 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; + var7 = var10; + var8 = var11; + var9 = var12; + } + + var5.func_78386_a(var7, var8, var9); + return this.func_147799_a(p_147803_1_, p_147803_2_, p_147803_3_, p_147803_4_, this.field_147845_a.func_72805_g(p_147803_2_, p_147803_3_, p_147803_4_), false); + } + + public boolean func_147799_a(BlockHopper p_147799_1_, int p_147799_2_, int p_147799_3_, int p_147799_4_, int p_147799_5_, boolean p_147799_6_) { + Tessellator var7 = Tessellator.field_78398_a; + int var8 = BlockHopper.func_149918_b(p_147799_5_); + double var9 = 0.625D; + this.func_147782_a(0.0D, var9, 0.0D, 1.0D, 1.0D, 1.0D); + if(p_147799_6_) { + var7.func_78382_b(); + var7.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147799_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147799_1_, 0, p_147799_5_)); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147799_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147799_1_, 1, p_147799_5_)); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147799_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147799_1_, 2, p_147799_5_)); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147799_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147799_1_, 3, p_147799_5_)); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147799_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147799_1_, 4, p_147799_5_)); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147799_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147799_1_, 5, p_147799_5_)); + var7.func_78381_a(); + } else { + this.func_147784_q(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + float var13; + if(!p_147799_6_) { + var7.func_78380_c(p_147799_1_.func_149677_c(this.field_147845_a, p_147799_2_, p_147799_3_, p_147799_4_)); + int var24 = p_147799_1_.func_149720_d(this.field_147845_a, p_147799_2_, p_147799_3_, p_147799_4_); + float var25 = (float)(var24 >> 16 & 255) / 255.0F; + var13 = (float)(var24 >> 8 & 255) / 255.0F; + float var26 = (float)(var24 & 255) / 255.0F; + if(EntityRenderer.field_78517_a) { + float var15 = (var25 * 30.0F + var13 * 59.0F + var26 * 11.0F) / 100.0F; + float var27 = (var25 * 30.0F + var13 * 70.0F) / 100.0F; + float var17 = (var25 * 30.0F + var26 * 70.0F) / 100.0F; + var25 = var15; + var13 = var27; + var26 = var17; + } + + var7.func_78386_a(var25, var13, var26); + } + + IIcon var241 = BlockHopper.func_149916_e("hopper_outside"); + IIcon var251 = BlockHopper.func_149916_e("hopper_inside"); + var13 = 0.125F; + if(p_147799_6_) { + var7.func_78382_b(); + var7.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147799_1_, (double)(-1.0F + var13), 0.0D, 0.0D, var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147799_1_, (double)(1.0F - var13), 0.0D, 0.0D, var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147799_1_, 0.0D, 0.0D, (double)(-1.0F + var13), var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147799_1_, 0.0D, 0.0D, (double)(1.0F - var13), var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147799_1_, 0.0D, -1.0D + var9, 0.0D, var251); + var7.func_78381_a(); + } else { + this.func_147764_f(p_147799_1_, (double)((float)p_147799_2_ - 1.0F + var13), (double)p_147799_3_, (double)p_147799_4_, var241); + this.func_147798_e(p_147799_1_, (double)((float)p_147799_2_ + 1.0F - var13), (double)p_147799_3_, (double)p_147799_4_, var241); + this.func_147734_d(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ - 1.0F + var13), var241); + this.func_147761_c(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ + 1.0F - var13), var241); + this.func_147806_b(p_147799_1_, (double)p_147799_2_, (double)((float)p_147799_3_ - 1.0F) + var9, (double)p_147799_4_, var251); + } + + this.func_147757_a(var241); + double var261 = 0.25D; + double var271 = 0.25D; + this.func_147782_a(var261, var271, var261, 1.0D - var261, var9 - 0.002D, 1.0D - var261); + if(p_147799_6_) { + var7.func_78382_b(); + var7.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.func_78381_a(); + var7.func_78382_b(); + var7.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147799_1_, 0.0D, 0.0D, 0.0D, var241); + var7.func_78381_a(); + } else { + this.func_147784_q(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if(!p_147799_6_) { + double var20 = 0.375D; + double var22 = 0.25D; + this.func_147757_a(var241); + if(var8 == 0) { + this.func_147782_a(var20, 0.0D, var20, 1.0D - var20, 0.25D, 1.0D - var20); + this.func_147784_q(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if(var8 == 2) { + this.func_147782_a(var20, var271, 0.0D, 1.0D - var20, var271 + var22, var261); + this.func_147784_q(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if(var8 == 3) { + this.func_147782_a(var20, var271, 1.0D - var261, 1.0D - var20, var271 + var22, 1.0D); + this.func_147784_q(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if(var8 == 4) { + this.func_147782_a(0.0D, var271, var20, var261, var271 + var22, 1.0D - var20); + this.func_147784_q(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if(var8 == 5) { + this.func_147782_a(1.0D - var261, var271, var20, 1.0D, var271 + var22, 1.0D - var20); + this.func_147784_q(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + } + + this.func_147771_a(); + return true; + } + + public boolean func_147722_a(BlockStairs p_147722_1_, int p_147722_2_, int p_147722_3_, int p_147722_4_) { + p_147722_1_.func_150147_e(this.field_147845_a, p_147722_2_, p_147722_3_, p_147722_4_); + this.func_147775_a(p_147722_1_); + this.func_147784_q(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + this.field_152631_f = true; + boolean var5 = p_147722_1_.func_150145_f(this.field_147845_a, p_147722_2_, p_147722_3_, p_147722_4_); + this.func_147775_a(p_147722_1_); + this.func_147784_q(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + if(var5 && p_147722_1_.func_150144_g(this.field_147845_a, p_147722_2_, p_147722_3_, p_147722_4_)) { + this.func_147775_a(p_147722_1_); + this.func_147784_q(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + } + + this.field_152631_f = false; + return true; + } + + public boolean func_147760_u(Block p_147760_1_, int p_147760_2_, int p_147760_3_, int p_147760_4_) { + Tessellator var5 = Tessellator.field_78398_a; + int var6 = this.field_147845_a.func_72805_g(p_147760_2_, p_147760_3_, p_147760_4_); + if((var6 & 8) != 0) { + if(this.field_147845_a.func_147439_a(p_147760_2_, p_147760_3_ - 1, p_147760_4_) != p_147760_1_) { + return false; + } + } else if(this.field_147845_a.func_147439_a(p_147760_2_, p_147760_3_ + 1, p_147760_4_) != p_147760_1_) { + return false; + } + + boolean var7 = false; + float var8 = 0.5F; + float var9 = 1.0F; + float var10 = 0.8F; + float var11 = 0.6F; + int var12 = p_147760_1_.func_149677_c(this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_); + var5.func_78380_c(this.field_147855_j > 0.0D?var12:p_147760_1_.func_149677_c(this.field_147845_a, p_147760_2_, p_147760_3_ - 1, p_147760_4_)); + var5.func_78386_a(var8, var8, var8); + this.func_147768_a(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, this.func_147793_a(p_147760_1_, this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_, 0)); + var7 = true; + var5.func_78380_c(this.field_147857_k < 1.0D?var12:p_147760_1_.func_149677_c(this.field_147845_a, p_147760_2_, p_147760_3_ + 1, p_147760_4_)); + var5.func_78386_a(var9, var9, var9); + this.func_147806_b(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, this.func_147793_a(p_147760_1_, this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_, 1)); + var7 = true; + var5.func_78380_c(this.field_147851_l > 0.0D?var12:p_147760_1_.func_149677_c(this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_ - 1)); + var5.func_78386_a(var10, var10, var10); + IIcon var13 = this.func_147793_a(p_147760_1_, this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_, 2); + this.func_147761_c(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.field_147842_e = false; + var5.func_78380_c(this.field_147853_m < 1.0D?var12:p_147760_1_.func_149677_c(this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_ + 1)); + var5.func_78386_a(var10, var10, var10); + var13 = this.func_147793_a(p_147760_1_, this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_, 3); + this.func_147734_d(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.field_147842_e = false; + var5.func_78380_c(this.field_147859_h > 0.0D?var12:p_147760_1_.func_149677_c(this.field_147845_a, p_147760_2_ - 1, p_147760_3_, p_147760_4_)); + var5.func_78386_a(var11, var11, var11); + var13 = this.func_147793_a(p_147760_1_, this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_, 4); + this.func_147798_e(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.field_147842_e = false; + var5.func_78380_c(this.field_147861_i < 1.0D?var12:p_147760_1_.func_149677_c(this.field_147845_a, p_147760_2_ + 1, p_147760_3_, p_147760_4_)); + var5.func_78386_a(var11, var11, var11); + var13 = this.func_147793_a(p_147760_1_, this.field_147845_a, p_147760_2_, p_147760_3_, p_147760_4_, 5); + this.func_147764_f(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, var13); + var7 = true; + this.field_147842_e = false; + return var7; + } + + public void func_147768_a(Block p_147768_1_, double p_147768_2_, double p_147768_4_, double p_147768_6_, IIcon p_147768_8_) { + Tessellator var9 = Tessellator.field_78398_a; + if(this.func_147744_b()) { + p_147768_8_ = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + p_147768_8_ = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147768_1_, (int)p_147768_2_, (int)p_147768_4_, (int)p_147768_6_, 0, p_147768_8_); + } + + boolean uvRotateSet = false; + if(Config.isNaturalTextures() && this.field_147840_d == null && this.field_147865_v == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147768_8_); + if(var10 != null) { + int rand = Config.getRandom((int)p_147768_2_, (int)p_147768_4_, (int)p_147768_6_, 0); + if(var10.rotation > 1) { + this.field_147865_v = rand & 3; + } + + if(var10.rotation == 2) { + this.field_147865_v = this.field_147865_v / 2 * 3; + } + + if(var10.flip) { + this.field_147842_e = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147768_8_.func_94214_a(this.field_147859_h * 16.0D); + double var12 = (double)p_147768_8_.func_94214_a(this.field_147861_i * 16.0D); + double var14 = (double)p_147768_8_.func_94207_b(this.field_147851_l * 16.0D); + double var16 = (double)p_147768_8_.func_94207_b(this.field_147853_m * 16.0D); + if(this.field_147859_h < 0.0D || this.field_147861_i > 1.0D) { + var101 = (double)p_147768_8_.func_94209_e(); + var12 = (double)p_147768_8_.func_94212_f(); + } + + if(this.field_147851_l < 0.0D || this.field_147853_m > 1.0D) { + var14 = (double)p_147768_8_.func_94206_g(); + var16 = (double)p_147768_8_.func_94210_h(); + } + + double var18; + if(this.field_147842_e) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + if(this.field_147865_v == 2) { + var101 = (double)p_147768_8_.func_94214_a(this.field_147851_l * 16.0D); + var14 = (double)p_147768_8_.func_94207_b(16.0D - this.field_147861_i * 16.0D); + var12 = (double)p_147768_8_.func_94214_a(this.field_147853_m * 16.0D); + var16 = (double)p_147768_8_.func_94207_b(16.0D - this.field_147859_h * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if(this.field_147865_v == 1) { + var101 = (double)p_147768_8_.func_94214_a(16.0D - this.field_147853_m * 16.0D); + var14 = (double)p_147768_8_.func_94207_b(this.field_147859_h * 16.0D); + var12 = (double)p_147768_8_.func_94214_a(16.0D - this.field_147851_l * 16.0D); + var16 = (double)p_147768_8_.func_94207_b(this.field_147861_i * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if(this.field_147865_v == 3) { + var101 = (double)p_147768_8_.func_94214_a(16.0D - this.field_147859_h * 16.0D); + var12 = (double)p_147768_8_.func_94214_a(16.0D - this.field_147861_i * 16.0D); + var14 = (double)p_147768_8_.func_94207_b(16.0D - this.field_147851_l * 16.0D); + var16 = (double)p_147768_8_.func_94207_b(16.0D - this.field_147853_m * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if(uvRotateSet) { + this.field_147865_v = 0; + this.field_147842_e = false; + } + + var26 = p_147768_2_ + this.field_147859_h; + double var28 = p_147768_2_ + this.field_147861_i; + double var30 = p_147768_4_ + this.field_147855_j; + double var32 = p_147768_6_ + this.field_147851_l; + double var34 = p_147768_6_ + this.field_147853_m; + if(this.field_147838_g) { + var26 = p_147768_2_ + this.field_147861_i; + var28 = p_147768_2_ + this.field_147859_h; + } + + if(this.field_147863_w) { + var9.func_78386_a(this.field_147872_ap, this.field_147846_at, this.field_147854_ax); + var9.func_78380_c(this.field_147864_al); + var9.func_78374_a(var26, var30, var34, var20, var24); + var9.func_78386_a(this.field_147852_aq, this.field_147860_au, this.field_147841_ay); + var9.func_78380_c(this.field_147874_am); + var9.func_78374_a(var26, var30, var32, var101, var14); + var9.func_78386_a(this.field_147850_ar, this.field_147858_av, this.field_147839_az); + var9.func_78380_c(this.field_147876_an); + var9.func_78374_a(var28, var30, var32, var18, var22); + var9.func_78386_a(this.field_147848_as, this.field_147856_aw, this.field_147833_aA); + var9.func_78380_c(this.field_147870_ao); + var9.func_78374_a(var28, var30, var34, var12, var16); + } else { + var9.func_78374_a(var26, var30, var34, var20, var24); + var9.func_78374_a(var26, var30, var32, var101, var14); + var9.func_78374_a(var28, var30, var32, var18, var22); + var9.func_78374_a(var28, var30, var34, var12, var16); + } + + } + + public void func_147806_b(Block p_147806_1_, double p_147806_2_, double p_147806_4_, double p_147806_6_, IIcon p_147806_8_) { + Tessellator var9 = Tessellator.field_78398_a; + if(this.func_147744_b()) { + p_147806_8_ = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + p_147806_8_ = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147806_1_, (int)p_147806_2_, (int)p_147806_4_, (int)p_147806_6_, 1, p_147806_8_); + } + + boolean uvRotateSet = false; + if(Config.isNaturalTextures() && this.field_147840_d == null && this.field_147867_u == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147806_8_); + if(var10 != null) { + int rand = Config.getRandom((int)p_147806_2_, (int)p_147806_4_, (int)p_147806_6_, 1); + if(var10.rotation > 1) { + this.field_147867_u = rand & 3; + } + + if(var10.rotation == 2) { + this.field_147867_u = this.field_147867_u / 2 * 3; + } + + if(var10.flip) { + this.field_147842_e = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147806_8_.func_94214_a(this.field_147859_h * 16.0D); + double var12 = (double)p_147806_8_.func_94214_a(this.field_147861_i * 16.0D); + double var14 = (double)p_147806_8_.func_94207_b(this.field_147851_l * 16.0D); + double var16 = (double)p_147806_8_.func_94207_b(this.field_147853_m * 16.0D); + double var18; + if(this.field_147842_e) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if(this.field_147859_h < 0.0D || this.field_147861_i > 1.0D) { + var101 = (double)p_147806_8_.func_94209_e(); + var12 = (double)p_147806_8_.func_94212_f(); + } + + if(this.field_147851_l < 0.0D || this.field_147853_m > 1.0D) { + var14 = (double)p_147806_8_.func_94206_g(); + var16 = (double)p_147806_8_.func_94210_h(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + if(this.field_147867_u == 1) { + var101 = (double)p_147806_8_.func_94214_a(this.field_147851_l * 16.0D); + var14 = (double)p_147806_8_.func_94207_b(16.0D - this.field_147861_i * 16.0D); + var12 = (double)p_147806_8_.func_94214_a(this.field_147853_m * 16.0D); + var16 = (double)p_147806_8_.func_94207_b(16.0D - this.field_147859_h * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if(this.field_147867_u == 2) { + var101 = (double)p_147806_8_.func_94214_a(16.0D - this.field_147853_m * 16.0D); + var14 = (double)p_147806_8_.func_94207_b(this.field_147859_h * 16.0D); + var12 = (double)p_147806_8_.func_94214_a(16.0D - this.field_147851_l * 16.0D); + var16 = (double)p_147806_8_.func_94207_b(this.field_147861_i * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if(this.field_147867_u == 3) { + var101 = (double)p_147806_8_.func_94214_a(16.0D - this.field_147859_h * 16.0D); + var12 = (double)p_147806_8_.func_94214_a(16.0D - this.field_147861_i * 16.0D); + var14 = (double)p_147806_8_.func_94207_b(16.0D - this.field_147851_l * 16.0D); + var16 = (double)p_147806_8_.func_94207_b(16.0D - this.field_147853_m * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if(uvRotateSet) { + this.field_147867_u = 0; + this.field_147842_e = false; + } + + var26 = p_147806_2_ + this.field_147859_h; + double var28 = p_147806_2_ + this.field_147861_i; + double var30 = p_147806_4_ + this.field_147857_k; + double var32 = p_147806_6_ + this.field_147851_l; + double var34 = p_147806_6_ + this.field_147853_m; + if(this.field_147838_g) { + var26 = p_147806_2_ + this.field_147861_i; + var28 = p_147806_2_ + this.field_147859_h; + } + + if(this.field_147863_w) { + var9.func_78386_a(this.field_147872_ap, this.field_147846_at, this.field_147854_ax); + var9.func_78380_c(this.field_147864_al); + var9.func_78374_a(var28, var30, var34, var12, var16); + var9.func_78386_a(this.field_147852_aq, this.field_147860_au, this.field_147841_ay); + var9.func_78380_c(this.field_147874_am); + var9.func_78374_a(var28, var30, var32, var18, var22); + var9.func_78386_a(this.field_147850_ar, this.field_147858_av, this.field_147839_az); + var9.func_78380_c(this.field_147876_an); + var9.func_78374_a(var26, var30, var32, var101, var14); + var9.func_78386_a(this.field_147848_as, this.field_147856_aw, this.field_147833_aA); + var9.func_78380_c(this.field_147870_ao); + var9.func_78374_a(var26, var30, var34, var20, var24); + } else { + var9.func_78374_a(var28, var30, var34, var12, var16); + var9.func_78374_a(var28, var30, var32, var18, var22); + var9.func_78374_a(var26, var30, var32, var101, var14); + var9.func_78374_a(var26, var30, var34, var20, var24); + } + + } + + public void func_147761_c(Block p_147761_1_, double p_147761_2_, double p_147761_4_, double p_147761_6_, IIcon p_147761_8_) { + Tessellator var9 = Tessellator.field_78398_a; + if(this.func_147744_b()) { + p_147761_8_ = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + p_147761_8_ = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147761_1_, (int)p_147761_2_, (int)p_147761_4_, (int)p_147761_6_, 2, p_147761_8_); + } + + boolean uvRotateSet = false; + if(Config.isNaturalTextures() && this.field_147840_d == null && this.field_147875_q == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147761_8_); + if(var10 != null) { + int rand = Config.getRandom((int)p_147761_2_, (int)p_147761_4_, (int)p_147761_6_, 2); + if(var10.rotation > 1) { + this.field_147875_q = rand & 3; + } + + if(var10.rotation == 2) { + this.field_147875_q = this.field_147875_q / 2 * 3; + } + + if(var10.flip) { + this.field_147842_e = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147761_8_.func_94214_a(this.field_147859_h * 16.0D); + double var12 = (double)p_147761_8_.func_94214_a(this.field_147861_i * 16.0D); + if(this.field_152631_f) { + var12 = (double)p_147761_8_.func_94214_a((1.0D - this.field_147859_h) * 16.0D); + var101 = (double)p_147761_8_.func_94214_a((1.0D - this.field_147861_i) * 16.0D); + } + + double var14 = (double)p_147761_8_.func_94207_b(16.0D - this.field_147857_k * 16.0D); + double var16 = (double)p_147761_8_.func_94207_b(16.0D - this.field_147855_j * 16.0D); + double var18; + if(this.field_147842_e) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if(this.field_147859_h < 0.0D || this.field_147861_i > 1.0D) { + var101 = (double)p_147761_8_.func_94209_e(); + var12 = (double)p_147761_8_.func_94212_f(); + } + + if(this.field_147855_j < 0.0D || this.field_147857_k > 1.0D) { + var14 = (double)p_147761_8_.func_94206_g(); + var16 = (double)p_147761_8_.func_94210_h(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + if(this.field_147875_q == 2) { + var101 = (double)p_147761_8_.func_94214_a(this.field_147855_j * 16.0D); + var12 = (double)p_147761_8_.func_94214_a(this.field_147857_k * 16.0D); + var14 = (double)p_147761_8_.func_94207_b(16.0D - this.field_147859_h * 16.0D); + var16 = (double)p_147761_8_.func_94207_b(16.0D - this.field_147861_i * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if(this.field_147875_q == 1) { + var101 = (double)p_147761_8_.func_94214_a(16.0D - this.field_147857_k * 16.0D); + var12 = (double)p_147761_8_.func_94214_a(16.0D - this.field_147855_j * 16.0D); + var14 = (double)p_147761_8_.func_94207_b(this.field_147861_i * 16.0D); + var16 = (double)p_147761_8_.func_94207_b(this.field_147859_h * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if(this.field_147875_q == 3) { + var101 = (double)p_147761_8_.func_94214_a(16.0D - this.field_147859_h * 16.0D); + var12 = (double)p_147761_8_.func_94214_a(16.0D - this.field_147861_i * 16.0D); + var14 = (double)p_147761_8_.func_94207_b(this.field_147857_k * 16.0D); + var16 = (double)p_147761_8_.func_94207_b(this.field_147855_j * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if(uvRotateSet) { + this.field_147875_q = 0; + this.field_147842_e = false; + } + + var26 = p_147761_2_ + this.field_147859_h; + double var28 = p_147761_2_ + this.field_147861_i; + double var30 = p_147761_4_ + this.field_147855_j; + double var32 = p_147761_4_ + this.field_147857_k; + double var34 = p_147761_6_ + this.field_147851_l; + if(this.field_147838_g) { + var26 = p_147761_2_ + this.field_147861_i; + var28 = p_147761_2_ + this.field_147859_h; + } + + if(this.field_147863_w) { + var9.func_78386_a(this.field_147872_ap, this.field_147846_at, this.field_147854_ax); + var9.func_78380_c(this.field_147864_al); + var9.func_78374_a(var26, var32, var34, var18, var22); + var9.func_78386_a(this.field_147852_aq, this.field_147860_au, this.field_147841_ay); + var9.func_78380_c(this.field_147874_am); + var9.func_78374_a(var28, var32, var34, var101, var14); + var9.func_78386_a(this.field_147850_ar, this.field_147858_av, this.field_147839_az); + var9.func_78380_c(this.field_147876_an); + var9.func_78374_a(var28, var30, var34, var20, var24); + var9.func_78386_a(this.field_147848_as, this.field_147856_aw, this.field_147833_aA); + var9.func_78380_c(this.field_147870_ao); + var9.func_78374_a(var26, var30, var34, var12, var16); + } else { + var9.func_78374_a(var26, var32, var34, var18, var22); + var9.func_78374_a(var28, var32, var34, var101, var14); + var9.func_78374_a(var28, var30, var34, var20, var24); + var9.func_78374_a(var26, var30, var34, var12, var16); + } + + } + + public void func_147734_d(Block p_147734_1_, double p_147734_2_, double p_147734_4_, double p_147734_6_, IIcon p_147734_8_) { + Tessellator var9 = Tessellator.field_78398_a; + if(this.func_147744_b()) { + p_147734_8_ = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + p_147734_8_ = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147734_1_, (int)p_147734_2_, (int)p_147734_4_, (int)p_147734_6_, 3, p_147734_8_); + } + + boolean uvRotateSet = false; + if(Config.isNaturalTextures() && this.field_147840_d == null && this.field_147873_r == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147734_8_); + if(var10 != null) { + int rand = Config.getRandom((int)p_147734_2_, (int)p_147734_4_, (int)p_147734_6_, 3); + if(var10.rotation > 1) { + this.field_147873_r = rand & 3; + } + + if(var10.rotation == 2) { + this.field_147873_r = this.field_147873_r / 2 * 3; + } + + if(var10.flip) { + this.field_147842_e = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147734_8_.func_94214_a(this.field_147859_h * 16.0D); + double var12 = (double)p_147734_8_.func_94214_a(this.field_147861_i * 16.0D); + double var14 = (double)p_147734_8_.func_94207_b(16.0D - this.field_147857_k * 16.0D); + double var16 = (double)p_147734_8_.func_94207_b(16.0D - this.field_147855_j * 16.0D); + double var18; + if(this.field_147842_e) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if(this.field_147859_h < 0.0D || this.field_147861_i > 1.0D) { + var101 = (double)p_147734_8_.func_94209_e(); + var12 = (double)p_147734_8_.func_94212_f(); + } + + if(this.field_147855_j < 0.0D || this.field_147857_k > 1.0D) { + var14 = (double)p_147734_8_.func_94206_g(); + var16 = (double)p_147734_8_.func_94210_h(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + if(this.field_147873_r == 1) { + var101 = (double)p_147734_8_.func_94214_a(this.field_147855_j * 16.0D); + var16 = (double)p_147734_8_.func_94207_b(16.0D - this.field_147859_h * 16.0D); + var12 = (double)p_147734_8_.func_94214_a(this.field_147857_k * 16.0D); + var14 = (double)p_147734_8_.func_94207_b(16.0D - this.field_147861_i * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if(this.field_147873_r == 2) { + var101 = (double)p_147734_8_.func_94214_a(16.0D - this.field_147857_k * 16.0D); + var14 = (double)p_147734_8_.func_94207_b(this.field_147859_h * 16.0D); + var12 = (double)p_147734_8_.func_94214_a(16.0D - this.field_147855_j * 16.0D); + var16 = (double)p_147734_8_.func_94207_b(this.field_147861_i * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if(this.field_147873_r == 3) { + var101 = (double)p_147734_8_.func_94214_a(16.0D - this.field_147859_h * 16.0D); + var12 = (double)p_147734_8_.func_94214_a(16.0D - this.field_147861_i * 16.0D); + var14 = (double)p_147734_8_.func_94207_b(this.field_147857_k * 16.0D); + var16 = (double)p_147734_8_.func_94207_b(this.field_147855_j * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if(uvRotateSet) { + this.field_147873_r = 0; + this.field_147842_e = false; + } + + var26 = p_147734_2_ + this.field_147859_h; + double var28 = p_147734_2_ + this.field_147861_i; + double var30 = p_147734_4_ + this.field_147855_j; + double var32 = p_147734_4_ + this.field_147857_k; + double var34 = p_147734_6_ + this.field_147853_m; + if(this.field_147838_g) { + var26 = p_147734_2_ + this.field_147861_i; + var28 = p_147734_2_ + this.field_147859_h; + } + + if(this.field_147863_w) { + var9.func_78386_a(this.field_147872_ap, this.field_147846_at, this.field_147854_ax); + var9.func_78380_c(this.field_147864_al); + var9.func_78374_a(var26, var32, var34, var101, var14); + var9.func_78386_a(this.field_147852_aq, this.field_147860_au, this.field_147841_ay); + var9.func_78380_c(this.field_147874_am); + var9.func_78374_a(var26, var30, var34, var20, var24); + var9.func_78386_a(this.field_147850_ar, this.field_147858_av, this.field_147839_az); + var9.func_78380_c(this.field_147876_an); + var9.func_78374_a(var28, var30, var34, var12, var16); + var9.func_78386_a(this.field_147848_as, this.field_147856_aw, this.field_147833_aA); + var9.func_78380_c(this.field_147870_ao); + var9.func_78374_a(var28, var32, var34, var18, var22); + } else { + var9.func_78374_a(var26, var32, var34, var101, var14); + var9.func_78374_a(var26, var30, var34, var20, var24); + var9.func_78374_a(var28, var30, var34, var12, var16); + var9.func_78374_a(var28, var32, var34, var18, var22); + } + + } + + public void func_147798_e(Block p_147798_1_, double p_147798_2_, double p_147798_4_, double p_147798_6_, IIcon p_147798_8_) { + Tessellator var9 = Tessellator.field_78398_a; + if(this.func_147744_b()) { + p_147798_8_ = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + p_147798_8_ = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147798_1_, (int)p_147798_2_, (int)p_147798_4_, (int)p_147798_6_, 4, p_147798_8_); + } + + boolean uvRotateSet = false; + if(Config.isNaturalTextures() && this.field_147840_d == null && this.field_147869_t == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147798_8_); + if(var10 != null) { + int rand = Config.getRandom((int)p_147798_2_, (int)p_147798_4_, (int)p_147798_6_, 4); + if(var10.rotation > 1) { + this.field_147869_t = rand & 3; + } + + if(var10.rotation == 2) { + this.field_147869_t = this.field_147869_t / 2 * 3; + } + + if(var10.flip) { + this.field_147842_e = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147798_8_.func_94214_a(this.field_147851_l * 16.0D); + double var12 = (double)p_147798_8_.func_94214_a(this.field_147853_m * 16.0D); + double var14 = (double)p_147798_8_.func_94207_b(16.0D - this.field_147857_k * 16.0D); + double var16 = (double)p_147798_8_.func_94207_b(16.0D - this.field_147855_j * 16.0D); + double var18; + if(this.field_147842_e) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if(this.field_147851_l < 0.0D || this.field_147853_m > 1.0D) { + var101 = (double)p_147798_8_.func_94209_e(); + var12 = (double)p_147798_8_.func_94212_f(); + } + + if(this.field_147855_j < 0.0D || this.field_147857_k > 1.0D) { + var14 = (double)p_147798_8_.func_94206_g(); + var16 = (double)p_147798_8_.func_94210_h(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + if(this.field_147869_t == 1) { + var101 = (double)p_147798_8_.func_94214_a(this.field_147855_j * 16.0D); + var14 = (double)p_147798_8_.func_94207_b(16.0D - this.field_147853_m * 16.0D); + var12 = (double)p_147798_8_.func_94214_a(this.field_147857_k * 16.0D); + var16 = (double)p_147798_8_.func_94207_b(16.0D - this.field_147851_l * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if(this.field_147869_t == 2) { + var101 = (double)p_147798_8_.func_94214_a(16.0D - this.field_147857_k * 16.0D); + var14 = (double)p_147798_8_.func_94207_b(this.field_147851_l * 16.0D); + var12 = (double)p_147798_8_.func_94214_a(16.0D - this.field_147855_j * 16.0D); + var16 = (double)p_147798_8_.func_94207_b(this.field_147853_m * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if(this.field_147869_t == 3) { + var101 = (double)p_147798_8_.func_94214_a(16.0D - this.field_147851_l * 16.0D); + var12 = (double)p_147798_8_.func_94214_a(16.0D - this.field_147853_m * 16.0D); + var14 = (double)p_147798_8_.func_94207_b(this.field_147857_k * 16.0D); + var16 = (double)p_147798_8_.func_94207_b(this.field_147855_j * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if(uvRotateSet) { + this.field_147869_t = 0; + this.field_147842_e = false; + } + + var26 = p_147798_2_ + this.field_147859_h; + double var28 = p_147798_4_ + this.field_147855_j; + double var30 = p_147798_4_ + this.field_147857_k; + double var32 = p_147798_6_ + this.field_147851_l; + double var34 = p_147798_6_ + this.field_147853_m; + if(this.field_147838_g) { + var32 = p_147798_6_ + this.field_147853_m; + var34 = p_147798_6_ + this.field_147851_l; + } + + if(this.field_147863_w) { + var9.func_78386_a(this.field_147872_ap, this.field_147846_at, this.field_147854_ax); + var9.func_78380_c(this.field_147864_al); + var9.func_78374_a(var26, var30, var34, var18, var22); + var9.func_78386_a(this.field_147852_aq, this.field_147860_au, this.field_147841_ay); + var9.func_78380_c(this.field_147874_am); + var9.func_78374_a(var26, var30, var32, var101, var14); + var9.func_78386_a(this.field_147850_ar, this.field_147858_av, this.field_147839_az); + var9.func_78380_c(this.field_147876_an); + var9.func_78374_a(var26, var28, var32, var20, var24); + var9.func_78386_a(this.field_147848_as, this.field_147856_aw, this.field_147833_aA); + var9.func_78380_c(this.field_147870_ao); + var9.func_78374_a(var26, var28, var34, var12, var16); + } else { + var9.func_78374_a(var26, var30, var34, var18, var22); + var9.func_78374_a(var26, var30, var32, var101, var14); + var9.func_78374_a(var26, var28, var32, var20, var24); + var9.func_78374_a(var26, var28, var34, var12, var16); + } + + } + + public void func_147764_f(Block p_147764_1_, double p_147764_2_, double p_147764_4_, double p_147764_6_, IIcon p_147764_8_) { + Tessellator var9 = Tessellator.field_78398_a; + if(this.func_147744_b()) { + p_147764_8_ = this.field_147840_d; + } + + if(Config.isConnectedTextures() && this.field_147840_d == null) { + p_147764_8_ = ConnectedTextures.getConnectedTexture(this.field_147845_a, p_147764_1_, (int)p_147764_2_, (int)p_147764_4_, (int)p_147764_6_, 5, p_147764_8_); + } + + boolean uvRotateSet = false; + if(Config.isNaturalTextures() && this.field_147840_d == null && this.field_147871_s == 0) { + NaturalProperties var10 = NaturalTextures.getNaturalProperties(p_147764_8_); + if(var10 != null) { + int rand = Config.getRandom((int)p_147764_2_, (int)p_147764_4_, (int)p_147764_6_, 5); + if(var10.rotation > 1) { + this.field_147871_s = rand & 3; + } + + if(var10.rotation == 2) { + this.field_147871_s = this.field_147871_s / 2 * 3; + } + + if(var10.flip) { + this.field_147842_e = (rand & 4) != 0; + } + + uvRotateSet = true; + } + } + + double var101 = (double)p_147764_8_.func_94214_a(this.field_147851_l * 16.0D); + double var12 = (double)p_147764_8_.func_94214_a(this.field_147853_m * 16.0D); + if(this.field_152631_f) { + var12 = (double)p_147764_8_.func_94214_a((1.0D - this.field_147851_l) * 16.0D); + var101 = (double)p_147764_8_.func_94214_a((1.0D - this.field_147853_m) * 16.0D); + } + + double var14 = (double)p_147764_8_.func_94207_b(16.0D - this.field_147857_k * 16.0D); + double var16 = (double)p_147764_8_.func_94207_b(16.0D - this.field_147855_j * 16.0D); + double var18; + if(this.field_147842_e) { + var18 = var101; + var101 = var12; + var12 = var18; + } + + if(this.field_147851_l < 0.0D || this.field_147853_m > 1.0D) { + var101 = (double)p_147764_8_.func_94209_e(); + var12 = (double)p_147764_8_.func_94212_f(); + } + + if(this.field_147855_j < 0.0D || this.field_147857_k > 1.0D) { + var14 = (double)p_147764_8_.func_94206_g(); + var16 = (double)p_147764_8_.func_94210_h(); + } + + var18 = var12; + double var20 = var101; + double var22 = var14; + double var24 = var16; + double var26; + if(this.field_147871_s == 2) { + var101 = (double)p_147764_8_.func_94214_a(this.field_147855_j * 16.0D); + var14 = (double)p_147764_8_.func_94207_b(16.0D - this.field_147851_l * 16.0D); + var12 = (double)p_147764_8_.func_94214_a(this.field_147857_k * 16.0D); + var16 = (double)p_147764_8_.func_94207_b(16.0D - this.field_147853_m * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var22 = var14; + var24 = var16; + var18 = var101; + var20 = var12; + var14 = var16; + var16 = var22; + } else if(this.field_147871_s == 1) { + var101 = (double)p_147764_8_.func_94214_a(16.0D - this.field_147857_k * 16.0D); + var14 = (double)p_147764_8_.func_94207_b(this.field_147853_m * 16.0D); + var12 = (double)p_147764_8_.func_94214_a(16.0D - this.field_147855_j * 16.0D); + var16 = (double)p_147764_8_.func_94207_b(this.field_147851_l * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var101 = var12; + var12 = var20; + var22 = var16; + var24 = var14; + } else if(this.field_147871_s == 3) { + var101 = (double)p_147764_8_.func_94214_a(16.0D - this.field_147851_l * 16.0D); + var12 = (double)p_147764_8_.func_94214_a(16.0D - this.field_147853_m * 16.0D); + var14 = (double)p_147764_8_.func_94207_b(this.field_147857_k * 16.0D); + var16 = (double)p_147764_8_.func_94207_b(this.field_147855_j * 16.0D); + if(this.field_147842_e) { + var26 = var101; + var101 = var12; + var12 = var26; + } + + var18 = var12; + var20 = var101; + var22 = var14; + var24 = var16; + } + + if(uvRotateSet) { + this.field_147871_s = 0; + this.field_147842_e = false; + } + + var26 = p_147764_2_ + this.field_147861_i; + double var28 = p_147764_4_ + this.field_147855_j; + double var30 = p_147764_4_ + this.field_147857_k; + double var32 = p_147764_6_ + this.field_147851_l; + double var34 = p_147764_6_ + this.field_147853_m; + if(this.field_147838_g) { + var32 = p_147764_6_ + this.field_147853_m; + var34 = p_147764_6_ + this.field_147851_l; + } + + if(this.field_147863_w) { + var9.func_78386_a(this.field_147872_ap, this.field_147846_at, this.field_147854_ax); + var9.func_78380_c(this.field_147864_al); + var9.func_78374_a(var26, var28, var34, var20, var24); + var9.func_78386_a(this.field_147852_aq, this.field_147860_au, this.field_147841_ay); + var9.func_78380_c(this.field_147874_am); + var9.func_78374_a(var26, var28, var32, var12, var16); + var9.func_78386_a(this.field_147850_ar, this.field_147858_av, this.field_147839_az); + var9.func_78380_c(this.field_147876_an); + var9.func_78374_a(var26, var30, var32, var18, var22); + var9.func_78386_a(this.field_147848_as, this.field_147856_aw, this.field_147833_aA); + var9.func_78380_c(this.field_147870_ao); + var9.func_78374_a(var26, var30, var34, var101, var14); + } else { + var9.func_78374_a(var26, var28, var34, var20, var24); + var9.func_78374_a(var26, var28, var32, var12, var16); + var9.func_78374_a(var26, var30, var32, var18, var22); + var9.func_78374_a(var26, var30, var34, var101, var14); + } + + } + + public void func_147800_a(Block p_147800_1_, int p_147800_2_, float p_147800_3_) { + Tessellator var4 = Tessellator.field_78398_a; + boolean var5 = p_147800_1_ == Blocks.field_150349_c; + if(p_147800_1_ == Blocks.field_150367_z || p_147800_1_ == Blocks.field_150409_cd || p_147800_1_ == Blocks.field_150460_al) { + p_147800_2_ = 3; + } + + int var6; + float var7; + float var8; + float var9; + if(this.field_147844_c) { + var6 = p_147800_1_.func_149741_i(p_147800_2_); + if(var5) { + var6 = 16777215; + } + + var7 = (float)(var6 >> 16 & 255) / 255.0F; + var8 = (float)(var6 >> 8 & 255) / 255.0F; + var9 = (float)(var6 & 255) / 255.0F; + GL11.glColor4f(var7 * p_147800_3_, var8 * p_147800_3_, var9 * p_147800_3_, 1.0F); + } + + var6 = p_147800_1_.func_149645_b(); + this.func_147775_a(p_147800_1_); + int var14; + if(var6 != 0 && var6 != 31 && var6 != 39 && var6 != 16 && var6 != 26) { + if(var6 == 1) { + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + IIcon var171 = this.func_147787_a(p_147800_1_, 0, p_147800_2_); + this.func_147765_a(var171, -0.5D, -0.5D, -0.5D, 1.0F); + var4.func_78381_a(); + } else if(var6 == 19) { + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + p_147800_1_.func_149683_g(); + this.func_147730_a(p_147800_1_, p_147800_2_, this.field_147857_k, -0.5D, -0.5D, -0.5D); + var4.func_78381_a(); + } else if(var6 == 23) { + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + p_147800_1_.func_149683_g(); + var4.func_78381_a(); + } else if(var6 == 13) { + p_147800_1_.func_149683_g(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var7 = 0.0625F; + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 0)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 1)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + var4.func_78372_c(0.0F, 0.0F, var7); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 2)); + var4.func_78372_c(0.0F, 0.0F, -var7); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + var4.func_78372_c(0.0F, 0.0F, -var7); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 3)); + var4.func_78372_c(0.0F, 0.0F, var7); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + var4.func_78372_c(var7, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 4)); + var4.func_78372_c(-var7, 0.0F, 0.0F); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + var4.func_78372_c(-var7, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 5)); + var4.func_78372_c(var7, 0.0F, 0.0F); + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } else if(var6 == 22) { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.field_147719_a.func_147715_a(p_147800_1_, p_147800_2_, p_147800_3_); + GL11.glEnable('\u803a'); + } else if(var6 == 6) { + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147795_a(p_147800_1_, p_147800_2_, -0.5D, -0.5D, -0.5D); + var4.func_78381_a(); + } else if(var6 == 2) { + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147747_a(p_147800_1_, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + var4.func_78381_a(); + } else if(var6 == 10) { + for(var14 = 0; var14 < 2; ++var14) { + if(var14 == 0) { + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + + if(var14 == 1) { + this.func_147782_a(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 0)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 1)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 2)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 3)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 4)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 5)); + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } else if(var6 == 27) { + var14 = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.func_78382_b(); + + for(int var181 = 0; var181 < 8; ++var181) { + byte var17 = 0; + byte var18 = 1; + if(var181 == 0) { + var17 = 2; + } + + if(var181 == 1) { + var17 = 3; + } + + if(var181 == 2) { + var17 = 4; + } + + if(var181 == 3) { + var17 = 5; + var18 = 2; + } + + if(var181 == 4) { + var17 = 6; + var18 = 3; + } + + if(var181 == 5) { + var17 = 7; + var18 = 5; + } + + if(var181 == 6) { + var17 = 6; + var18 = 2; + } + + if(var181 == 7) { + var17 = 3; + } + + float var11 = (float)var17 / 16.0F; + float var12 = 1.0F - (float)var14 / 16.0F; + float var13 = 1.0F - (float)(var14 + var18) / 16.0F; + var14 += var18; + this.func_147782_a((double)(0.5F - var11), (double)var13, (double)(0.5F - var11), (double)(0.5F + var11), (double)var12, (double)(0.5F + var11)); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 0)); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 1)); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 2)); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 3)); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 4)); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 5)); + } + + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } else if(var6 == 11) { + for(var14 = 0; var14 < 4; ++var14) { + var8 = 0.125F; + if(var14 == 0) { + this.func_147782_a((double)(0.5F - var8), 0.0D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); + } + + if(var14 == 1) { + this.func_147782_a((double)(0.5F - var8), 0.0D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); + } + + var8 = 0.0625F; + if(var14 == 2) { + this.func_147782_a((double)(0.5F - var8), (double)(1.0F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(1.0F - var8), (double)(1.0F + var8 * 2.0F)); + } + + if(var14 == 3) { + this.func_147782_a((double)(0.5F - var8), (double)(0.5F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(0.5F - var8), (double)(1.0F + var8 * 2.0F)); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 0)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 1)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 2)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 3)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 4)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 5)); + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } else if(var6 == 21) { + for(var14 = 0; var14 < 3; ++var14) { + var8 = 0.0625F; + if(var14 == 0) { + this.func_147782_a((double)(0.5F - var8), 0.30000001192092896D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); + } + + if(var14 == 1) { + this.func_147782_a((double)(0.5F - var8), 0.30000001192092896D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); + } + + var8 = 0.0625F; + if(var14 == 2) { + this.func_147782_a((double)(0.5F - var8), 0.5D, 0.0D, (double)(0.5F + var8), (double)(1.0F - var8), 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 0)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 1)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 2)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 3)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 4)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147777_a(p_147800_1_, 5)); + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } else if(var6 == 32) { + for(var14 = 0; var14 < 2; ++var14) { + if(var14 == 0) { + this.func_147782_a(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + + if(var14 == 1) { + this.func_147782_a(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 0, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 1, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 2, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 3, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 4, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 5, p_147800_2_)); + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } else if(var6 == 35) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + this.func_147728_a((BlockAnvil)p_147800_1_, 0, 0, 0, p_147800_2_ << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } else if(var6 == 34) { + for(var14 = 0; var14 < 3; ++var14) { + if(var14 == 0) { + this.func_147782_a(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + this.func_147757_a(this.func_147745_b(Blocks.field_150343_Z)); + } else if(var14 == 1) { + this.func_147782_a(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + this.func_147757_a(this.func_147745_b(Blocks.field_150461_bJ)); + } else if(var14 == 2) { + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.func_147757_a(this.func_147745_b(Blocks.field_150359_w)); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 0, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 1, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 2, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 3, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 4, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 5, p_147800_2_)); + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.func_147782_a(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.func_147771_a(); + } else if(var6 == 38) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + this.func_147799_a((BlockHopper)p_147800_1_, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } else if(Reflector.ModLoader.exists()) { + Reflector.callVoid(Reflector.ModLoader_renderInvBlock, new Object[]{this, p_147800_1_, Integer.valueOf(p_147800_2_), Integer.valueOf(var6)}); + } else if(Reflector.FMLRenderAccessLibrary.exists()) { + Reflector.callVoid(Reflector.FMLRenderAccessLibrary_renderInventoryBlock, new Object[]{this, p_147800_1_, Integer.valueOf(p_147800_2_), Integer.valueOf(var6)}); + } + } else { + if(var6 == 16) { + p_147800_2_ = 1; + } + + p_147800_1_.func_149683_g(); + this.func_147775_a(p_147800_1_); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.func_78382_b(); + var4.func_78375_b(0.0F, -1.0F, 0.0F); + this.func_147768_a(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 0, p_147800_2_)); + var4.func_78381_a(); + if(var5 && this.field_147844_c) { + var14 = p_147800_1_.func_149741_i(p_147800_2_); + var8 = (float)(var14 >> 16 & 255) / 255.0F; + var9 = (float)(var14 >> 8 & 255) / 255.0F; + float var10 = (float)(var14 & 255) / 255.0F; + GL11.glColor4f(var8 * p_147800_3_, var9 * p_147800_3_, var10 * p_147800_3_, 1.0F); + } + + var4.func_78382_b(); + var4.func_78375_b(0.0F, 1.0F, 0.0F); + this.func_147806_b(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 1, p_147800_2_)); + var4.func_78381_a(); + if(var5 && this.field_147844_c) { + GL11.glColor4f(p_147800_3_, p_147800_3_, p_147800_3_, 1.0F); + } + + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, -1.0F); + this.func_147761_c(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 2, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(0.0F, 0.0F, 1.0F); + this.func_147734_d(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 3, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(-1.0F, 0.0F, 0.0F); + this.func_147798_e(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 4, p_147800_2_)); + var4.func_78381_a(); + var4.func_78382_b(); + var4.func_78375_b(1.0F, 0.0F, 0.0F); + this.func_147764_f(p_147800_1_, 0.0D, 0.0D, 0.0D, this.func_147787_a(p_147800_1_, 5, p_147800_2_)); + var4.func_78381_a(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + } + + public static boolean func_147739_a(int par0) { + switch(par0) { + case -1: + return false; + case 0: + case 10: + case 11: + case 13: + case 16: + case 21: + case 22: + case 26: + case 27: + case 31: + case 32: + case 34: + case 35: + case 39: + return true; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 12: + case 14: + case 15: + case 17: + case 18: + case 19: + case 20: + case 23: + case 24: + case 25: + case 28: + case 29: + case 30: + case 33: + case 36: + case 37: + case 38: + default: + return Reflector.ModLoader.exists()?Reflector.callBoolean(Reflector.ModLoader_renderBlockIsItemFull3D, new Object[]{Integer.valueOf(par0)}):(Reflector.FMLRenderAccessLibrary.exists()?Reflector.callBoolean(Reflector.FMLRenderAccessLibrary_renderItemAsFull3DBlock, new Object[]{Integer.valueOf(par0)}):false); + } + } + + public IIcon func_147793_a(Block p_147793_1_, IBlockAccess p_147793_2_, int p_147793_3_, int p_147793_4_, int p_147793_5_, int p_147793_6_) { + return this.func_147758_b(p_147793_1_.func_149673_e(p_147793_2_, p_147793_3_, p_147793_4_, p_147793_5_, p_147793_6_)); + } + + public IIcon func_147787_a(Block p_147787_1_, int p_147787_2_, int p_147787_3_) { + return this.func_147758_b(p_147787_1_.func_149691_a(p_147787_2_, p_147787_3_)); + } + + public IIcon func_147777_a(Block p_147777_1_, int p_147777_2_) { + return this.func_147758_b(p_147777_1_.func_149733_h(p_147777_2_)); + } + + public IIcon func_147745_b(Block p_147745_1_) { + return this.func_147758_b(p_147745_1_.func_149733_h(1)); + } + + public IIcon func_147758_b(IIcon p_147758_1_) { + if(p_147758_1_ == null) { + p_147758_1_ = ((TextureMap)Minecraft.func_71410_x().func_110434_K().func_110581_b(TextureMap.field_110575_b)).func_110572_b("missingno"); + } + + return (IIcon)p_147758_1_; + } + + private float getAmbientOcclusionLightValue(int i, int j, int k) { + Block block = this.field_147845_a.func_147439_a(i, j, k); + return block.func_149637_q()?this.aoLightValueOpaque:1.0F; + } + + private IIcon fixAoSideGrassTexture(IIcon tex, int x, int y, int z, int side, float f, float f1, float f2) { + if(tex == TextureUtils.iconGrassSide || tex == TextureUtils.iconMyceliumSide) { + tex = Config.getSideGrassTexture(this.field_147845_a, x, y, z, side, tex); + if(tex == TextureUtils.iconGrassTop) { + this.field_147872_ap *= f; + this.field_147852_aq *= f; + this.field_147850_ar *= f; + this.field_147848_as *= f; + this.field_147846_at *= f1; + this.field_147860_au *= f1; + this.field_147858_av *= f1; + this.field_147856_aw *= f1; + this.field_147854_ax *= f2; + this.field_147841_ay *= f2; + this.field_147839_az *= f2; + this.field_147833_aA *= f2; + } + } + + if(tex == TextureUtils.iconGrassSideSnowed) { + tex = Config.getSideSnowGrassTexture(this.field_147845_a, x, y, z, side); + } + + return tex; + } + + private boolean hasSnowNeighbours(int x, int y, int z) { + Block blockSnow = Blocks.field_150431_aC; + return this.field_147845_a.func_147439_a(x - 1, y, z) != blockSnow && this.field_147845_a.func_147439_a(x + 1, y, z) != blockSnow && this.field_147845_a.func_147439_a(x, y, z - 1) != blockSnow && this.field_147845_a.func_147439_a(x, y, z + 1) != blockSnow?false:this.field_147845_a.func_147439_a(x, y - 1, z).func_149662_c(); + } + + private void renderSnow(int x, int y, int z, double maxY) { + if(this.betterSnowEnabled) { + this.func_147775_a(Blocks.field_150431_aC); + this.field_147857_k = maxY; + this.func_147784_q(Blocks.field_150431_aC, x, y, z); + } + } + + public static RenderBlocks getInstance() { + if(instance == null) { + instance = new RenderBlocks(); + } + + return instance; + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.# b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.# new file mode 100644 index 0000000..2322931 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.# @@ -0,0 +1,17 @@ +*************** +*** 1574,1580 **** + double var15 = this.field_72777_q.field_71451_h.field_70165_t - p_72726_2_; + double var17 = this.field_72777_q.field_71451_h.field_70163_u - p_72726_4_; + double var19 = this.field_72777_q.field_71451_h.field_70161_v - p_72726_6_; +- Object var21 = null; + if(p_72726_1_.equals("hugeexplosion")) { + this.field_72777_q.field_71452_i.func_78873_a(var21 = new EntityHugeExplodeFX(this.field_72769_h, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_)); + } else if(p_72726_1_.equals("largeexplode")) { +--- 1574,1580 ---- + double var15 = this.field_72777_q.field_71451_h.field_70165_t - p_72726_2_; + double var17 = this.field_72777_q.field_71451_h.field_70163_u - p_72726_4_; + double var19 = this.field_72777_q.field_71451_h.field_70161_v - p_72726_6_; ++ EntityFX var21 = null; + if(p_72726_1_.equals("hugeexplosion")) { + this.field_72777_q.field_71452_i.func_78873_a(var21 = new EntityHugeExplodeFX(this.field_72769_h, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_)); + } else if(p_72726_1_.equals("largeexplode")) { diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.java new file mode 100644 index 0000000..5f72c8c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.java @@ -0,0 +1,3036 @@ +package net.minecraft.client.renderer; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.collect.Maps; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityAuraFX; +import net.minecraft.client.particle.EntityBlockDustFX; +import net.minecraft.client.particle.EntityBreakingFX; +import net.minecraft.client.particle.EntityBubbleFX; +import net.minecraft.client.particle.EntityCloudFX; +import net.minecraft.client.particle.EntityCritFX; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.particle.EntityDropParticleFX; +import net.minecraft.client.particle.EntityEnchantmentTableParticleFX; +import net.minecraft.client.particle.EntityExplodeFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntityFireworkSparkFX; +import net.minecraft.client.particle.EntityFishWakeFX; +import net.minecraft.client.particle.EntityFlameFX; +import net.minecraft.client.particle.EntityFootStepFX; +import net.minecraft.client.particle.EntityHeartFX; +import net.minecraft.client.particle.EntityHugeExplodeFX; +import net.minecraft.client.particle.EntityLargeExplodeFX; +import net.minecraft.client.particle.EntityLavaFX; +import net.minecraft.client.particle.EntityNoteFX; +import net.minecraft.client.particle.EntityPortalFX; +import net.minecraft.client.particle.EntityReddustFX; +import net.minecraft.client.particle.EntitySmokeFX; +import net.minecraft.client.particle.EntitySnowShovelFX; +import net.minecraft.client.particle.EntitySpellParticleFX; +import net.minecraft.client.particle.EntitySplashFX; +import net.minecraft.client.particle.EntitySuspendFX; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.util.RenderDistanceSorter; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemRecord; +import net.minecraft.profiler.Profiler; +import net.minecraft.src.*; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.IWorldAccess; +import net.minecraft.world.WorldProvider; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.ARBOcclusionQuery; +import org.lwjgl.opengl.GL11; +import shadersmod.client.Shaders; + +public class RenderGlobal implements IWorldAccess { + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationMoonPhasesPng = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation locationSunPng = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation locationCloudsPng = new ResourceLocation("textures/environment/clouds.png"); + private static final ResourceLocation locationEndSkyPng = new ResourceLocation("textures/environment/end_sky.png"); + public List tileEntities = new ArrayList(); + public WorldClient theWorld; + + /** The RenderEngine instance used by RenderGlobal */ + public final TextureManager renderEngine; + public CompactArrayList worldRenderersToUpdate = new CompactArrayList(100, 0.8F); + private WorldRenderer[] sortedWorldRenderers; + public WorldRenderer[] worldRenderers; + private int renderChunksWide; + private int renderChunksTall; + private int renderChunksDeep; + + /** OpenGL render lists base */ + public int glRenderListBase; + + /** A reference to the Minecraft object. */ + public Minecraft mc; + public RenderBlocks renderBlocksRg; + + /** OpenGL occlusion query base */ + private IntBuffer glOcclusionQueryBase; + + /** Is occlusion testing enabled */ + private boolean occlusionEnabled; + + /** + * counts the cloud render updates. Used with mod to stagger some updates + */ + private int cloudTickCounter; + + /** The star GL Call list */ + private int starGLCallList; + + /** OpenGL sky list */ + private int glSkyList; + + /** OpenGL sky list 2 */ + private int glSkyList2; + + /** Minimum block X */ + private int minBlockX; + + /** Minimum block Y */ + private int minBlockY; + + /** Minimum block Z */ + private int minBlockZ; + + /** Maximum block X */ + private int maxBlockX; + + /** Maximum block Y */ + private int maxBlockY; + + /** Maximum block Z */ + private int maxBlockZ; + + /** + * Stores blocks currently being broken. Key is entity ID of the thing doing the breaking. Value is a + * DestroyBlockProgress + */ + public final Map damagedBlocks = new HashMap(); + private final Map mapSoundPositions = Maps.newHashMap(); + private IIcon[] destroyBlockIcons; + private boolean displayListEntitiesDirty; + private int displayListEntities; + private int renderDistanceChunks = -1; + + /** Render entities startup counter (init value=2) */ + private int renderEntitiesStartupCounter = 2; + + /** Count entities total */ + private int countEntitiesTotal; + + /** Count entities rendered */ + private int countEntitiesRendered; + + /** Count entities hidden */ + private int countEntitiesHidden; + + /** Occlusion query result */ + IntBuffer occlusionResult = GLAllocation.createDirectIntBuffer(64); + + /** How many renderers are loaded this frame that try to be rendered */ + private int renderersLoaded; + + /** How many renderers are being clipped by the frustrum this frame */ + private int renderersBeingClipped; + + /** How many renderers are being occluded this frame */ + private int renderersBeingOccluded; + + /** How many renderers are actually being rendered this frame */ + private int renderersBeingRendered; + + /** + * How many renderers are skipping rendering due to not having a render pass this frame + */ + private int renderersSkippingRenderPass; + + /** Dummy render int */ + private int dummyRenderInt; + + /** World renderers check index */ + private int worldRenderersCheckIndex; + + /** List of OpenGL lists for the current render pass */ + private List glRenderLists = new ArrayList(); + + /** All render lists (fixed length 4) */ + private RenderList[] allRenderLists = new RenderList[] {new RenderList(), new RenderList(), new RenderList(), new RenderList()}; + + /** + * Previous x position when the renderers were sorted. (Once the distance moves more than 4 units they will be + * resorted) + */ + double prevSortX = -9999.0D; + + /** + * Previous y position when the renderers were sorted. (Once the distance moves more than 4 units they will be + * resorted) + */ + double prevSortY = -9999.0D; + + /** + * Previous Z position when the renderers were sorted. (Once the distance moves more than 4 units they will be + * resorted) + */ + double prevSortZ = -9999.0D; + double prevRenderSortX = -9999.0D; + double prevRenderSortY = -9999.0D; + double prevRenderSortZ = -9999.0D; + int prevChunkSortX = -999; + int prevChunkSortY = -999; + int prevChunkSortZ = -999; + + /** + * The offset used to determine if a renderer is one of the sixteenth that are being updated this frame + */ + int frustumCheckOffset; + private IntBuffer glListBuffer = BufferUtils.createIntBuffer(65536); + double prevReposX; + double prevReposY; + double prevReposZ; + public Entity renderedEntity; + private int glListClouds = -1; + private boolean isFancyGlListClouds = false; + private int cloudTickCounterGlList = -99999; + private double cloudPlayerX = 0.0D; + private double cloudPlayerY = 0.0D; + private double cloudPlayerZ = 0.0D; + private int countSortedWorldRenderers = 0; + private int effectivePreloadedChunks = 0; + private int vertexResortCounter = 30; + public WrDisplayListAllocator displayListAllocator = new WrDisplayListAllocator(); + public EntityLivingBase renderViewEntity; + private int countTileEntitiesRendered; + private long lastMovedTime = System.currentTimeMillis(); + private long lastActionTime = System.currentTimeMillis(); + private static AxisAlignedBB AABB_INFINITE = AxisAlignedBB.getBoundingBox(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); + + public RenderGlobal(Minecraft par1Minecraft) { + this.glListClouds = GLAllocation.generateDisplayLists(1); + this.mc = par1Minecraft; + this.renderEngine = par1Minecraft.getTextureManager(); + byte maxChunkDim = 65; + byte maxChunkHeight = 16; + int countWorldRenderers = maxChunkDim * maxChunkDim * maxChunkHeight; + int countStandardRenderLists = countWorldRenderers * 3; + this.glRenderListBase = GLAllocation.generateDisplayLists(countStandardRenderLists); + this.displayListEntitiesDirty = false; + this.displayListEntities = GLAllocation.generateDisplayLists(1); + this.occlusionEnabled = OpenGlCapsChecker.checkARBOcclusion(); + + if (this.occlusionEnabled) { + this.occlusionResult.clear(); + this.glOcclusionQueryBase = GLAllocation.createDirectIntBuffer(maxChunkDim * maxChunkDim * maxChunkHeight); + this.glOcclusionQueryBase.clear(); + this.glOcclusionQueryBase.position(0); + this.glOcclusionQueryBase.limit(maxChunkDim * maxChunkDim * maxChunkHeight); + ARBOcclusionQuery.glGenQueriesARB(this.glOcclusionQueryBase); + } + + this.starGLCallList = GLAllocation.generateDisplayLists(3); + GL11.glPushMatrix(); + GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE); + this.renderStars(); + GL11.glEndList(); + GL11.glPopMatrix(); + Tessellator var4 = Tessellator.instance; + this.glSkyList = this.starGLCallList + 1; + GL11.glNewList(this.glSkyList, GL11.GL_COMPILE); + byte var6 = 64; + int var7 = 256 / var6 + 2; + float var5 = 16.0F; + int var8; + int var9; + + for (var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { + for (var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { + var4.startDrawingQuads(); + var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + 0)); + var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + 0)); + var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + var6)); + var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + var6)); + var4.draw(); + } + } + + GL11.glEndList(); + this.glSkyList2 = this.starGLCallList + 2; + GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE); + var5 = -16.0F; + var4.startDrawingQuads(); + + for (var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { + for (var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { + var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + 0)); + var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + 0)); + var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + var6)); + var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + var6)); + } + } + + var4.draw(); + GL11.glEndList(); + } + + private void renderStars() { + Random var1 = new Random(10842L); + Tessellator var2 = Tessellator.instance; + var2.startDrawingQuads(); + + for (int var3 = 0; var3 < 1500; ++var3) { + double var4 = (double)(var1.nextFloat() * 2.0F - 1.0F); + double var6 = (double)(var1.nextFloat() * 2.0F - 1.0F); + double var8 = (double)(var1.nextFloat() * 2.0F - 1.0F); + double var10 = (double)(0.15F + var1.nextFloat() * 0.1F); + double var12 = var4 * var4 + var6 * var6 + var8 * var8; + + if (var12 < 1.0D && var12 > 0.01D) { + var12 = 1.0D / Math.sqrt(var12); + var4 *= var12; + var6 *= var12; + var8 *= var12; + double var14 = var4 * 100.0D; + double var16 = var6 * 100.0D; + double var18 = var8 * 100.0D; + double var20 = Math.atan2(var4, var8); + double var22 = Math.sin(var20); + double var24 = Math.cos(var20); + double var26 = Math.atan2(Math.sqrt(var4 * var4 + var8 * var8), var6); + double var28 = Math.sin(var26); + double var30 = Math.cos(var26); + double var32 = var1.nextDouble() * Math.PI * 2.0D; + double var34 = Math.sin(var32); + double var36 = Math.cos(var32); + + for (int var38 = 0; var38 < 4; ++var38) { + double var39 = 0.0D; + double var41 = (double)((var38 & 2) - 1) * var10; + double var43 = (double)((var38 + 1 & 2) - 1) * var10; + double var47 = var41 * var36 - var43 * var34; + double var49 = var43 * var36 + var41 * var34; + double var53 = var47 * var28 + var39 * var30; + double var55 = var39 * var28 - var47 * var30; + double var57 = var55 * var22 - var49 * var24; + double var61 = var49 * var22 + var55 * var24; + var2.addVertex(var14 + var57, var16 + var53, var18 + var61); + } + } + } + + var2.draw(); + } + + /** + * set null to clear + */ + public void setWorldAndLoadRenderers(WorldClient par1WorldClient) { + if (this.theWorld != null) { + this.theWorld.removeWorldAccess(this); + } + + this.prevSortX = -9999.0D; + this.prevSortY = -9999.0D; + this.prevSortZ = -9999.0D; + this.prevRenderSortX = -9999.0D; + this.prevRenderSortY = -9999.0D; + this.prevRenderSortZ = -9999.0D; + this.prevChunkSortX = -9999; + this.prevChunkSortY = -9999; + this.prevChunkSortZ = -9999; + RenderManager.instance.set(par1WorldClient); + this.theWorld = par1WorldClient; + this.renderBlocksRg = new RenderBlocks(par1WorldClient); + + if (Config.isDynamicLights()) { + DynamicLights.clear(); + } + + if (par1WorldClient != null) { + par1WorldClient.addWorldAccess(this); + this.loadRenderers(); + } + } + + /** + * Loads all the renderers and sets up the basic settings usage + */ + public void loadRenderers() { + if (this.theWorld != null) { + Blocks.leaves.func_150122_b(Config.isTreesFancy()); + Blocks.leaves2.func_150122_b(Config.isTreesFancy()); + this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks; + WrUpdates.clearAllUpdates(); + int numChunks; + + if (this.worldRenderers != null) { + for (numChunks = 0; numChunks < this.worldRenderers.length; ++numChunks) { + this.worldRenderers[numChunks].stopRendering(); + } + } + + if (Config.isDynamicLights()) { + DynamicLights.clear(); + } + + numChunks = this.mc.gameSettings.renderDistanceChunks; + byte numChunksFar = 16; + + if (Config.isLoadChunksFar() && numChunks < numChunksFar) { + numChunks = numChunksFar; + } + + int maxPreloadedChunks = Config.limit(numChunksFar - numChunks, 0, 8); + this.effectivePreloadedChunks = Config.limit(Config.getPreloadedChunks(), 0, maxPreloadedChunks); + numChunks += this.effectivePreloadedChunks; + byte limit = 32; + + if (numChunks > limit) { + numChunks = limit; + } + + this.prevReposX = -9999.0D; + this.prevReposY = -9999.0D; + this.prevReposZ = -9999.0D; + int var1 = numChunks * 2 + 1; + this.renderChunksWide = var1; + this.renderChunksTall = 16; + this.renderChunksDeep = var1; + this.worldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep]; + this.sortedWorldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep]; + this.countSortedWorldRenderers = 0; + this.displayListAllocator.resetAllocatedLists(); + int var2 = 0; + int var3 = 0; + this.minBlockX = 0; + this.minBlockY = 0; + this.minBlockZ = 0; + this.maxBlockX = this.renderChunksWide; + this.maxBlockY = this.renderChunksTall; + this.maxBlockZ = this.renderChunksDeep; + int var10; + + for (var10 = 0; var10 < this.worldRenderersToUpdate.size(); ++var10) { + WorldRenderer esf = (WorldRenderer)this.worldRenderersToUpdate.get(var10); + + if (esf != null) { + esf.needsUpdate = false; + } + } + + this.worldRenderersToUpdate.clear(); + this.tileEntities.clear(); + this.onStaticEntitiesChanged(); + + for (var10 = 0; var10 < this.renderChunksWide; ++var10) { + for (int var14 = 0; var14 < this.renderChunksTall; ++var14) { + for (int cz = 0; cz < this.renderChunksDeep; ++cz) { + int wri = (cz * this.renderChunksTall + var14) * this.renderChunksWide + var10; + this.worldRenderers[wri] = WrUpdates.makeWorldRenderer(this.theWorld, this.tileEntities, var10 * 16, var14 * 16, cz * 16, this.glRenderListBase + var2); + + if (this.occlusionEnabled) { + this.worldRenderers[wri].glOcclusionQuery = this.glOcclusionQueryBase.get(var3); + } + + this.worldRenderers[wri].isWaitingOnOcclusionQuery = false; + this.worldRenderers[wri].isVisible = true; + this.worldRenderers[wri].isInFrustum = false; + this.worldRenderers[wri].chunkIndex = var3++; + + if (this.theWorld.blockExists(var10 << 4, 0, cz << 4)) { + this.worldRenderers[wri].markDirty(); + this.worldRenderersToUpdate.add(this.worldRenderers[wri]); + } + + var2 += 3; + } + } + } + + if (this.theWorld != null) { + EntityLivingBase var13 = this.mc.renderViewEntity; + + if (var13 == null) { + var13 = this.mc.thePlayer; + } + + if (var13 != null) { + this.markRenderersForNewPosition(MathHelper.floor_double(var13.posX), MathHelper.floor_double(var13.posY), MathHelper.floor_double(var13.posZ)); + EntitySorterFast var15 = new EntitySorterFast(var13); + var15.prepareToSort(this.sortedWorldRenderers, this.countSortedWorldRenderers); + Arrays.sort(this.sortedWorldRenderers, 0, this.countSortedWorldRenderers, var15); + } + } + + this.renderEntitiesStartupCounter = 2; + } + } + + public void renderEntities(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) { + int pass = 0; + + if (Reflector.MinecraftForgeClient_getRenderPass.exists()) { + pass = Reflector.callInt(Reflector.MinecraftForgeClient_getRenderPass, new Object[0]); + } + + boolean hasEntityShouldRenderInPass = Reflector.ForgeEntity_shouldRenderInPass.exists(); + boolean hasTileEntityShouldRenderInPass = Reflector.ForgeTileEntity_shouldRenderInPass.exists(); + + if (this.renderEntitiesStartupCounter > 0) { + if (pass > 0) { + return; + } + + --this.renderEntitiesStartupCounter; + } else { + double var4 = p_147589_1_.prevPosX + (p_147589_1_.posX - p_147589_1_.prevPosX) * (double)p_147589_3_; + double var6 = p_147589_1_.prevPosY + (p_147589_1_.posY - p_147589_1_.prevPosY) * (double)p_147589_3_; + double var8 = p_147589_1_.prevPosZ + (p_147589_1_.posZ - p_147589_1_.prevPosZ) * (double)p_147589_3_; + this.theWorld.theProfiler.startSection("prepare"); + TileEntityRendererDispatcher.instance.func_147542_a(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, p_147589_3_); + RenderManager.instance.func_147938_a(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntity, this.mc.gameSettings, p_147589_3_); + + if (pass == 0) { + this.countEntitiesTotal = 0; + this.countEntitiesRendered = 0; + this.countEntitiesHidden = 0; + this.countTileEntitiesRendered = 0; + EntityLivingBase var17 = this.mc.renderViewEntity; + double var18 = var17.lastTickPosX + (var17.posX - var17.lastTickPosX) * (double)p_147589_3_; + double var111 = var17.lastTickPosY + (var17.posY - var17.lastTickPosY) * (double)p_147589_3_; + double te = var17.lastTickPosZ + (var17.posZ - var17.lastTickPosZ) * (double)p_147589_3_; + TileEntityRendererDispatcher.staticPlayerX = var18; + TileEntityRendererDispatcher.staticPlayerY = var111; + TileEntityRendererDispatcher.staticPlayerZ = te; + this.theWorld.theProfiler.endStartSection("staticentities"); + + if (this.displayListEntitiesDirty) { + RenderManager.renderPosX = 0.0D; + RenderManager.renderPosY = 0.0D; + RenderManager.renderPosZ = 0.0D; + this.rebuildDisplayListEntities(); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + GL11.glTranslated(-var18, -var111, -te); + GL11.glCallList(this.displayListEntities); + GL11.glPopMatrix(); + RenderManager.renderPosX = var18; + RenderManager.renderPosY = var111; + RenderManager.renderPosZ = te; + } + + this.mc.entityRenderer.enableLightmap((double)p_147589_3_); + this.theWorld.theProfiler.endStartSection("global"); + List var25 = this.theWorld.getLoadedEntityList(); + + if (pass == 0) { + this.countEntitiesTotal = var25.size(); + } + + if (Config.isFogOff() && this.mc.entityRenderer.fogStandard) { + GL11.glDisable(GL11.GL_FOG); + } + + Entity var19; + int var26; + + for (var26 = 0; var26 < this.theWorld.weatherEffects.size(); ++var26) { + var19 = (Entity)this.theWorld.weatherEffects.get(var26); + + if (!hasEntityShouldRenderInPass || Reflector.callBoolean(var19, Reflector.ForgeEntity_shouldRenderInPass, new Object[] {Integer.valueOf(pass)})) { + ++this.countEntitiesRendered; + + if (var19.isInRangeToRender3d(var4, var6, var8)) { + RenderManager.instance.func_147937_a(var19, p_147589_3_); + } + } + } + + this.theWorld.theProfiler.endStartSection("entities"); + boolean var27 = Config.isShaders(); + + if (var27) { + Shaders.beginEntities(); + } + + boolean oldFancyGraphics = this.mc.gameSettings.fancyGraphics; + this.mc.gameSettings.fancyGraphics = Config.isDroppedItemsFancy(); + + for (var26 = 0; var26 < var25.size(); ++var26) { + var19 = (Entity)var25.get(var26); + + if (!hasEntityShouldRenderInPass || Reflector.callBoolean(var19, Reflector.ForgeEntity_shouldRenderInPass, new Object[] {Integer.valueOf(pass)})) { + boolean var28 = var19.isInRangeToRender3d(var4, var6, var8) && (var19.ignoreFrustumCheck || p_147589_2_.isBoundingBoxInFrustum(var19.boundingBox) || var19.riddenByEntity == this.mc.thePlayer); + + if (!var28 && var19 instanceof EntityLiving) { + EntityLiving aabb = (EntityLiving)var19; + + if (aabb.getLeashed() && aabb.getLeashedToEntity() != null) { + Entity teClass = aabb.getLeashedToEntity(); + var28 = p_147589_2_.isBoundingBoxInFrustum(teClass.boundingBox); + } + } + + if (var28 && (var19 != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var19.posX), 0, MathHelper.floor_double(var19.posZ))) { + ++this.countEntitiesRendered; + + if (var19.getClass() == EntityItemFrame.class) { + var19.renderDistanceWeight = 0.06D; + } + + this.renderedEntity = var19; + + if (var27) { + Shaders.nextEntity(var19); + } + + RenderManager.instance.func_147937_a(var19, p_147589_3_); + this.renderedEntity = null; + } + } + } + + this.mc.gameSettings.fancyGraphics = oldFancyGraphics; + this.theWorld.theProfiler.endStartSection("blockentities"); + + if (var27) { + Shaders.endEntities(); + Shaders.beginBlockEntities(); + } + + RenderHelper.enableStandardItemLighting(); + + for (var26 = 0; var26 < this.tileEntities.size(); ++var26) { + TileEntity var29 = (TileEntity)this.tileEntities.get(var26); + + if (!hasTileEntityShouldRenderInPass || Reflector.callBoolean(var29, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[] {Integer.valueOf(pass)})) { + AxisAlignedBB var30 = this.getTileEntityBoundingBox(var29); + + if (var30 == AABB_INFINITE || p_147589_2_.isBoundingBoxInFrustum(var30)) { + Class var31 = var29.getClass(); + + if (var31 == TileEntitySign.class && !Config.zoomMode) { + EntityClientPlayerMP block = this.mc.thePlayer; + double distSq = var29.getDistanceFrom(block.posX, block.posY, block.posZ); + + if (distSq > 256.0D) { + FontRenderer fr = TileEntityRendererDispatcher.instance.func_147548_a(); + fr.enabled = false; + + if (Config.isShaders()) { + Shaders.nextBlockEntity(var29); + } + + TileEntityRendererDispatcher.instance.func_147544_a(var29, p_147589_3_); + ++this.countTileEntitiesRendered; + fr.enabled = true; + continue; + } + } + + if (var31 == TileEntityChest.class) { + Block var32 = this.theWorld.getBlock(var29.field_145851_c, var29.field_145848_d, var29.field_145849_e); + + if (!(var32 instanceof BlockChest)) { + continue; + } + } + + if (Config.isShaders()) { + Shaders.nextBlockEntity(var29); + } + + TileEntityRendererDispatcher.instance.func_147544_a(var29, p_147589_3_); + ++this.countTileEntitiesRendered; + } + } + } + + this.mc.entityRenderer.disableLightmap((double)p_147589_3_); + + if (var27) { + Shaders.endBlockEntities(); + } + + this.theWorld.theProfiler.endSection(); + } + } + + /** + * Gets the render info for use on the Debug screen + */ + public String getDebugInfoRenders() { + return "C: " + this.renderersBeingRendered + "/" + this.renderersLoaded + ". F: " + this.renderersBeingClipped + ", O: " + this.renderersBeingOccluded + ", E: " + this.renderersSkippingRenderPass; + } + + /** + * Gets the entities info for use on the Debug screen + */ + public String getDebugInfoEntities() { + return "E: " + this.countEntitiesRendered + "/" + this.countEntitiesTotal + ". B: " + this.countEntitiesHidden + ", I: " + (this.countEntitiesTotal - this.countEntitiesHidden - this.countEntitiesRendered) + ", " + Config.getVersionDebug(); + } + + public void onStaticEntitiesChanged() { + this.displayListEntitiesDirty = true; + } + + public void rebuildDisplayListEntities() { + this.theWorld.theProfiler.startSection("staticentityrebuild"); + GL11.glPushMatrix(); + GL11.glNewList(this.displayListEntities, GL11.GL_COMPILE); + List var1 = this.theWorld.getLoadedEntityList(); + this.displayListEntitiesDirty = false; + + for (int var2 = 0; var2 < var1.size(); ++var2) { + Entity var3 = (Entity)var1.get(var2); + + if (RenderManager.instance.getEntityRenderObject(var3).func_147905_a()) { + this.displayListEntitiesDirty = this.displayListEntitiesDirty || !RenderManager.instance.func_147936_a(var3, 0.0F, true); + } + } + + GL11.glEndList(); + GL11.glPopMatrix(); + this.theWorld.theProfiler.endSection(); + } + + /** + * Goes through all the renderers setting new positions on them and those that have their position changed are + * adding to be updated + */ + private void markRenderersForNewPosition(int x, int y, int z) { + x -= 8; + y -= 8; + z -= 8; + this.minBlockX = Integer.MAX_VALUE; + this.minBlockY = Integer.MAX_VALUE; + this.minBlockZ = Integer.MAX_VALUE; + this.maxBlockX = Integer.MIN_VALUE; + this.maxBlockY = Integer.MIN_VALUE; + this.maxBlockZ = Integer.MIN_VALUE; + int blocksWide = this.renderChunksWide * 16; + int blocksWide2 = blocksWide / 2; + + for (int ix = 0; ix < this.renderChunksWide; ++ix) { + int blockX = ix * 16; + int blockXAbs = blockX + blocksWide2 - x; + + if (blockXAbs < 0) { + blockXAbs -= blocksWide - 1; + } + + blockXAbs /= blocksWide; + blockX -= blockXAbs * blocksWide; + + if (blockX < this.minBlockX) { + this.minBlockX = blockX; + } + + if (blockX > this.maxBlockX) { + this.maxBlockX = blockX; + } + + for (int iz = 0; iz < this.renderChunksDeep; ++iz) { + int blockZ = iz * 16; + int blockZAbs = blockZ + blocksWide2 - z; + + if (blockZAbs < 0) { + blockZAbs -= blocksWide - 1; + } + + blockZAbs /= blocksWide; + blockZ -= blockZAbs * blocksWide; + + if (blockZ < this.minBlockZ) { + this.minBlockZ = blockZ; + } + + if (blockZ > this.maxBlockZ) { + this.maxBlockZ = blockZ; + } + + for (int iy = 0; iy < this.renderChunksTall; ++iy) { + int blockY = iy * 16; + + if (blockY < this.minBlockY) { + this.minBlockY = blockY; + } + + if (blockY > this.maxBlockY) { + this.maxBlockY = blockY; + } + + WorldRenderer worldrenderer = this.worldRenderers[(iz * this.renderChunksTall + iy) * this.renderChunksWide + ix]; + boolean wasNeedingUpdate = worldrenderer.needsUpdate; + worldrenderer.setPosition(blockX, blockY, blockZ); + + if (!wasNeedingUpdate && worldrenderer.needsUpdate) { + this.worldRenderersToUpdate.add(worldrenderer); + } + } + } + } + } + + /** + * Sorts all renderers based on the passed in entity. Args: entityLiving, renderPass, partialTickTime + */ + public int sortAndRender(EntityLivingBase player, int renderPass, double partialTicks) { + this.renderViewEntity = player; + + if (Config.isDynamicLights()) { + DynamicLights.update(this); + } + + Profiler profiler = this.theWorld.theProfiler; + profiler.startSection("sortchunks"); + int num; + + if (this.worldRenderersToUpdate.size() < 10) { + byte shouldSort = 10; + + for (num = 0; num < shouldSort; ++num) { + this.worldRenderersCheckIndex = (this.worldRenderersCheckIndex + 1) % this.worldRenderers.length; + WorldRenderer ocReq = this.worldRenderers[this.worldRenderersCheckIndex]; + + if (ocReq.needsUpdate && !this.worldRenderersToUpdate.contains(ocReq)) { + this.worldRenderersToUpdate.add(ocReq); + } + } + } + + if (this.mc.gameSettings.renderDistanceChunks != this.renderDistanceChunks && !Config.isLoadChunksFar()) { + this.loadRenderers(); + } + + if (renderPass == 0) { + this.renderersLoaded = 0; + this.dummyRenderInt = 0; + this.renderersBeingClipped = 0; + this.renderersBeingOccluded = 0; + this.renderersBeingRendered = 0; + this.renderersSkippingRenderPass = 0; + } + + boolean var33 = this.prevChunkSortX != player.chunkCoordX || this.prevChunkSortY != player.chunkCoordY || this.prevChunkSortZ != player.chunkCoordZ; + double partialX; + double partialY; + double partialZ; + double var34; + + if (!var33) { + var34 = player.posX - this.prevSortX; + partialX = player.posY - this.prevSortY; + partialY = player.posZ - this.prevSortZ; + partialZ = var34 * var34 + partialX * partialX + partialY * partialY; + var33 = partialZ > 16.0D; + } + + int endIndex; + int stepNum; + + if (var33) { + this.prevChunkSortX = player.chunkCoordX; + this.prevChunkSortY = player.chunkCoordY; + this.prevChunkSortZ = player.chunkCoordZ; + this.prevSortX = player.posX; + this.prevSortY = player.posY; + this.prevSortZ = player.posZ; + num = this.effectivePreloadedChunks * 16; + double var36 = player.posX - this.prevReposX; + double dReposY = player.posY - this.prevReposY; + double dReposZ = player.posZ - this.prevReposZ; + double countResort = var36 * var36 + dReposY * dReposY + dReposZ * dReposZ; + + if (countResort > (double)(num * num) + 16.0D) { + this.prevReposX = player.posX; + this.prevReposY = player.posY; + this.prevReposZ = player.posZ; + this.markRenderersForNewPosition(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); + } + + EntitySorterFast lastIndex = new EntitySorterFast(player); + lastIndex.prepareToSort(this.sortedWorldRenderers, this.countSortedWorldRenderers); + Arrays.sort(this.sortedWorldRenderers, 0, this.countSortedWorldRenderers, lastIndex); + + if (Config.isFastRender()) { + endIndex = (int)player.posX; + stepNum = (int)player.posZ; + short step = 2000; + + if (Math.abs(endIndex - WorldRenderer.globalChunkOffsetX) > step || Math.abs(stepNum - WorldRenderer.globalChunkOffsetZ) > step) { + WorldRenderer.globalChunkOffsetX = endIndex; + WorldRenderer.globalChunkOffsetZ = stepNum; + this.loadRenderers(); + } + } + } + + if (Config.isTranslucentBlocksFancy()) { + var34 = player.posX - this.prevRenderSortX; + partialX = player.posY - this.prevRenderSortY; + partialY = player.posZ - this.prevRenderSortZ; + int var39 = Math.min(27, this.countSortedWorldRenderers); + WorldRenderer firstIndex; + + if (var34 * var34 + partialX * partialX + partialY * partialY > 1.0D) { + this.prevRenderSortX = player.posX; + this.prevRenderSortY = player.posY; + this.prevRenderSortZ = player.posZ; + + for (int var38 = 0; var38 < var39; ++var38) { + firstIndex = this.sortedWorldRenderers[var38]; + + if (firstIndex.vertexState != null && firstIndex.sortDistanceToEntitySquared < 1152.0F) { + firstIndex.needVertexStateResort = true; + + if (this.vertexResortCounter > var38) { + this.vertexResortCounter = var38; + } + } + } + } + + if (this.vertexResortCounter < var39) { + while (this.vertexResortCounter < var39) { + firstIndex = this.sortedWorldRenderers[this.vertexResortCounter]; + ++this.vertexResortCounter; + + if (firstIndex.needVertexStateResort) { + firstIndex.updateRendererSort(player); + break; + } + } + } + } + + RenderHelper.disableStandardItemLighting(); + WrUpdates.preRender(this, player); + + if (this.mc.gameSettings.ofSmoothFps && renderPass == 0) { + GL11.glFinish(); + } + + byte var35 = 0; + int var37 = 0; + + if (this.occlusionEnabled && this.mc.gameSettings.advancedOpengl && !this.mc.gameSettings.anaglyph && renderPass == 0) { + partialX = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; + partialY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; + partialZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; + byte var40 = 0; + int var41 = Math.min(20, this.countSortedWorldRenderers); + this.checkOcclusionQueryResult(var40, var41, player.posX, player.posY, player.posZ); + + for (endIndex = var40; endIndex < var41; ++endIndex) { + this.sortedWorldRenderers[endIndex].isVisible = true; + } + + profiler.endStartSection("render"); + num = var35 + this.renderSortedRenderers(var40, var41, renderPass, partialTicks); + endIndex = var41; + stepNum = 0; + byte var42 = 40; + int startIndex; + + for (int switchStep = this.renderChunksWide; endIndex < this.countSortedWorldRenderers; num += this.renderSortedRenderers(startIndex, endIndex, renderPass, partialTicks)) { + profiler.endStartSection("occ"); + startIndex = endIndex; + + if (stepNum < switchStep) { + ++stepNum; + } else { + --stepNum; + } + + endIndex += stepNum * var42; + + if (endIndex <= startIndex) { + endIndex = startIndex + 10; + } + + if (endIndex > this.countSortedWorldRenderers) { + endIndex = this.countSortedWorldRenderers; + } + + GL11.glDisable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_FOG); + + if (Config.isShaders()) { + Shaders.disableFog(); + } + + GL11.glColorMask(false, false, false, false); + GL11.glDepthMask(false); + profiler.startSection("check"); + this.checkOcclusionQueryResult(startIndex, endIndex, player.posX, player.posY, player.posZ); + profiler.endSection(); + GL11.glPushMatrix(); + float sumTX = 0.0F; + float sumTY = 0.0F; + float sumTZ = 0.0F; + + for (int k = startIndex; k < endIndex; ++k) { + WorldRenderer wr = this.sortedWorldRenderers[k]; + + if (wr.skipAllRenderPasses()) { + wr.isInFrustum = false; + } else if (!wr.isUpdating && !wr.needsBoxUpdate) { + if (wr.isInFrustum) { + if (Config.isOcclusionFancy() && !wr.isInFrustrumFully) { + wr.isVisible = true; + } else if (wr.isInFrustum && !wr.isWaitingOnOcclusionQuery) { + float bbX; + float bbY; + float bbZ; + float tX; + + if (wr.isVisibleFromPosition) { + bbX = Math.abs((float)(wr.visibleFromX - player.posX)); + bbY = Math.abs((float)(wr.visibleFromY - player.posY)); + bbZ = Math.abs((float)(wr.visibleFromZ - player.posZ)); + tX = bbX + bbY + bbZ; + + if ((double)tX < 10.0D + (double)k / 1000.0D) { + wr.isVisible = true; + continue; + } + + wr.isVisibleFromPosition = false; + } + + bbX = (float)((double)wr.posXMinus - partialX); + bbY = (float)((double)wr.posYMinus - partialY); + bbZ = (float)((double)wr.posZMinus - partialZ); + tX = bbX - sumTX; + float tY = bbY - sumTY; + float tZ = bbZ - sumTZ; + + if (tX != 0.0F || tY != 0.0F || tZ != 0.0F) { + GL11.glTranslatef(tX, tY, tZ); + sumTX += tX; + sumTY += tY; + sumTZ += tZ; + } + + profiler.startSection("bb"); + ARBOcclusionQuery.glBeginQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB, wr.glOcclusionQuery); + wr.callOcclusionQueryList(); + ARBOcclusionQuery.glEndQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB); + profiler.endSection(); + wr.isWaitingOnOcclusionQuery = true; + ++var37; + } + } + } else { + wr.isVisible = true; + } + } + + GL11.glPopMatrix(); + + if (this.mc.gameSettings.anaglyph) { + if (EntityRenderer.anaglyphField == 0) { + GL11.glColorMask(false, true, true, true); + } else { + GL11.glColorMask(true, false, false, true); + } + } else { + GL11.glColorMask(true, true, true, true); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_FOG); + + if (Config.isShaders()) { + Shaders.enableFog(); + } + + profiler.endStartSection("render"); + } + } else { + profiler.endStartSection("render"); + num = var35 + this.renderSortedRenderers(0, this.countSortedWorldRenderers, renderPass, partialTicks); + } + + profiler.endSection(); + WrUpdates.postRender(); + return num; + } + + private void checkOcclusionQueryResult(int startIndex, int endIndex, double px, double py, double pz) { + for (int k = startIndex; k < endIndex; ++k) { + WorldRenderer wr = this.sortedWorldRenderers[k]; + + if (wr.isWaitingOnOcclusionQuery) { + this.occlusionResult.clear(); + ARBOcclusionQuery.glGetQueryObjectuARB(wr.glOcclusionQuery, ARBOcclusionQuery.GL_QUERY_RESULT_AVAILABLE_ARB, this.occlusionResult); + + if (this.occlusionResult.get(0) != 0) { + wr.isWaitingOnOcclusionQuery = false; + this.occlusionResult.clear(); + ARBOcclusionQuery.glGetQueryObjectuARB(wr.glOcclusionQuery, ARBOcclusionQuery.GL_QUERY_RESULT_ARB, this.occlusionResult); + + if (!wr.isUpdating && !wr.needsBoxUpdate) { + boolean wasVisible = wr.isVisible; + wr.isVisible = this.occlusionResult.get(0) > 0; + + if (wasVisible && wr.isVisible) { + wr.isVisibleFromPosition = true; + wr.visibleFromX = px; + wr.visibleFromY = py; + wr.visibleFromZ = pz; + } + } else { + wr.isVisible = true; + } + } + } + } + } + + /** + * Renders the sorted renders for the specified render pass. Args: startRenderer, numRenderers, renderPass, + * partialTickTime + */ + private int renderSortedRenderers(int par1, int par2, int par3, double par4) { + if (Config.isFastRender()) { + return this.renderSortedRenderersFast(par1, par2, par3, par4); + } else { + this.glRenderLists.clear(); + int var6 = 0; + int var7 = par1; + int var8 = par2; + byte var9 = 1; + + if (par3 == 1) { + var7 = this.countSortedWorldRenderers - 1 - par1; + var8 = this.countSortedWorldRenderers - 1 - par2; + var9 = -1; + } + + for (int var22 = var7; var22 != var8; var22 += var9) { + if (par3 == 0) { + ++this.renderersLoaded; + + if (this.sortedWorldRenderers[var22].skipRenderPass[par3]) { + ++this.renderersSkippingRenderPass; + } else if (!this.sortedWorldRenderers[var22].isInFrustum) { + ++this.renderersBeingClipped; + } else if (this.occlusionEnabled && !this.sortedWorldRenderers[var22].isVisible) { + ++this.renderersBeingOccluded; + } else { + ++this.renderersBeingRendered; + } + } + + if (!this.sortedWorldRenderers[var22].skipRenderPass[par3] && this.sortedWorldRenderers[var22].isInFrustum && (!this.occlusionEnabled || this.sortedWorldRenderers[var22].isVisible)) { + int var23 = this.sortedWorldRenderers[var22].getGLCallListForPass(par3); + + if (var23 >= 0) { + this.glRenderLists.add(this.sortedWorldRenderers[var22]); + ++var6; + } + } + } + + if (var6 == 0) { + return 0; + } else { + EntityLivingBase var221 = this.mc.renderViewEntity; + double var231 = var221.lastTickPosX + (var221.posX - var221.lastTickPosX) * par4; + double var13 = var221.lastTickPosY + (var221.posY - var221.lastTickPosY) * par4; + double var15 = var221.lastTickPosZ + (var221.posZ - var221.lastTickPosZ) * par4; + int var17 = 0; + int var18; + + for (var18 = 0; var18 < this.allRenderLists.length; ++var18) { + this.allRenderLists[var18].resetList(); + } + + int var20; + int var21; + + for (var18 = 0; var18 < this.glRenderLists.size(); ++var18) { + WorldRenderer var24 = (WorldRenderer)this.glRenderLists.get(var18); + var20 = -1; + + for (var21 = 0; var21 < var17; ++var21) { + if (this.allRenderLists[var21].rendersChunk(var24.posXMinus, var24.posYMinus, var24.posZMinus)) { + var20 = var21; + } + } + + if (var20 < 0) { + var20 = var17++; + this.allRenderLists[var20].setupRenderList(var24.posXMinus, var24.posYMinus, var24.posZMinus, var231, var13, var15); + } + + this.allRenderLists[var20].addGLRenderList(var24.getGLCallListForPass(par3)); + } + + if (Config.isFogOff() && this.mc.entityRenderer.fogStandard) { + GL11.glDisable(GL11.GL_FOG); + } + + var18 = MathHelper.floor_double(var231); + int var241 = MathHelper.floor_double(var15); + var20 = var18 - (var18 & 1023); + var21 = var241 - (var241 & 1023); + Arrays.sort(this.allRenderLists, new RenderDistanceSorter(var20, var21)); + this.renderAllRenderLists(par3, par4); + return var6; + } + } + } + + private int renderSortedRenderersFast(int startIndex, int endIndex, int renderPass, double partialTicks) { + this.glListBuffer.clear(); + int l = 0; + boolean debug = this.mc.gameSettings.showDebugInfo; + int loopStart = startIndex; + int loopEnd = endIndex; + byte loopInc = 1; + + if (renderPass == 1) { + loopStart = this.countSortedWorldRenderers - 1 - startIndex; + loopEnd = this.countSortedWorldRenderers - 1 - endIndex; + loopInc = -1; + } + + for (int entityliving = loopStart; entityliving != loopEnd; entityliving += loopInc) { + WorldRenderer partialX = this.sortedWorldRenderers[entityliving]; + + if (debug && renderPass == 0) { + ++this.renderersLoaded; + + if (partialX.skipRenderPass[renderPass]) { + ++this.renderersSkippingRenderPass; + } else if (!partialX.isInFrustum) { + ++this.renderersBeingClipped; + } else if (this.occlusionEnabled && !partialX.isVisible) { + ++this.renderersBeingOccluded; + } else { + ++this.renderersBeingRendered; + } + } + + if (partialX.isInFrustum && !partialX.skipRenderPass[renderPass] && (!this.occlusionEnabled || partialX.isVisible)) { + int glCallList = partialX.getGLCallListForPass(renderPass); + + if (glCallList >= 0) { + this.glListBuffer.put(glCallList); + ++l; + } + } + } + + if (l == 0) { + return 0; + } else { + if (Config.isFogOff() && this.mc.entityRenderer.fogStandard) { + GL11.glDisable(GL11.GL_FOG); + } + + this.glListBuffer.flip(); + EntityLivingBase var18 = this.mc.renderViewEntity; + double var19 = var18.lastTickPosX + (var18.posX - var18.lastTickPosX) * partialTicks - (double)WorldRenderer.globalChunkOffsetX; + double partialY = var18.lastTickPosY + (var18.posY - var18.lastTickPosY) * partialTicks; + double partialZ = var18.lastTickPosZ + (var18.posZ - var18.lastTickPosZ) * partialTicks - (double)WorldRenderer.globalChunkOffsetZ; + this.mc.entityRenderer.enableLightmap(partialTicks); + GL11.glTranslatef((float)(-var19), (float)(-partialY), (float)(-partialZ)); + GL11.glCallLists(this.glListBuffer); + GL11.glTranslatef((float)var19, (float)partialY, (float)partialZ); + this.mc.entityRenderer.disableLightmap(partialTicks); + return l; + } + } + + /** + * Render all render lists + */ + public void renderAllRenderLists(int par1, double par2) { + this.mc.entityRenderer.enableLightmap(par2); + + for (int var4 = 0; var4 < this.allRenderLists.length; ++var4) { + this.allRenderLists[var4].callLists(); + } + + this.mc.entityRenderer.disableLightmap(par2); + } + + public void updateClouds() { + if (Config.isShaders() && Keyboard.isKeyDown(61) && Keyboard.isKeyDown(19)) { + Shaders.uninit(); + Shaders.loadShaderPack(); + } + + ++this.cloudTickCounter; + + if (this.cloudTickCounter % 20 == 0) { + Iterator var1 = this.damagedBlocks.values().iterator(); + + while (var1.hasNext()) { + DestroyBlockProgress var2 = (DestroyBlockProgress)var1.next(); + int var3 = var2.getCreationCloudUpdateTick(); + + if (this.cloudTickCounter - var3 > 400) { + var1.remove(); + } + } + } + } + + /** + * Renders the sky with the partial tick time. Args: partialTickTime + */ + public void renderSky(float par1) { + if (Reflector.ForgeWorldProvider_getSkyRenderer.exists()) { + WorldProvider var2 = this.mc.theWorld.provider; + Object var3 = Reflector.call(var2, Reflector.ForgeWorldProvider_getSkyRenderer, new Object[0]); + + if (var3 != null) { + Reflector.callVoid(var3, Reflector.IRenderHandler_render, new Object[] {Float.valueOf(par1), this.theWorld, this.mc}); + return; + } + } + + if (this.mc.theWorld.provider.dimensionId == 1) { + if (!Config.isSkyEnabled()) { + return; + } + + GL11.glDisable(GL11.GL_FOG); + + if (Config.isShaders()) { + Shaders.disableFog(); + } + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + GL11.glDepthMask(false); + this.renderEngine.bindTexture(locationEndSkyPng); + Tessellator var201 = Tessellator.instance; + + for (int var22 = 0; var22 < 6; ++var22) { + GL11.glPushMatrix(); + + if (var22 == 1) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (var22 == 2) { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + + if (var22 == 3) { + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + } + + if (var22 == 4) { + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + } + + if (var22 == 5) { + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + } + + var201.startDrawingQuads(); + var201.setColorOpaque_I(2631720); + var201.addVertexWithUV(-100.0D, -100.0D, -100.0D, 0.0D, 0.0D); + var201.addVertexWithUV(-100.0D, -100.0D, 100.0D, 0.0D, 16.0D); + var201.addVertexWithUV(100.0D, -100.0D, 100.0D, 16.0D, 16.0D); + var201.addVertexWithUV(100.0D, -100.0D, -100.0D, 16.0D, 0.0D); + var201.draw(); + GL11.glPopMatrix(); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + } else if (this.mc.theWorld.provider.isSurfaceWorld()) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + Vec3 var21 = this.theWorld.getSkyColor(this.mc.renderViewEntity, par1); + var21 = CustomColorizer.getSkyColor(var21, this.mc.theWorld, this.mc.renderViewEntity.posX, this.mc.renderViewEntity.posY + 1.0D, this.mc.renderViewEntity.posZ); + + if (Config.isShaders()) { + Shaders.setSkyColor(var21); + } + + float var231 = (float)var21.xCoord; + float var4 = (float)var21.yCoord; + float var5 = (float)var21.zCoord; + float var8; + + if (this.mc.gameSettings.anaglyph) { + float var23 = (var231 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F; + float var24 = (var231 * 30.0F + var4 * 70.0F) / 100.0F; + var8 = (var231 * 30.0F + var5 * 70.0F) / 100.0F; + var231 = var23; + var4 = var24; + var5 = var8; + } + + GL11.glColor3f(var231, var4, var5); + Tessellator var241 = Tessellator.instance; + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_FOG); + + if (Config.isShaders()) { + Shaders.enableFog(); + } + + GL11.glColor3f(var231, var4, var5); + + if (Config.isShaders()) { + Shaders.preSkyList(); + } + + if (Config.isSkyEnabled()) { + GL11.glCallList(this.glSkyList); + } + + GL11.glDisable(GL11.GL_FOG); + + if (Config.isShaders()) { + Shaders.disableFog(); + } + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + float[] var251 = this.theWorld.provider.calcSunriseSunsetColors(this.theWorld.getCelestialAngle(par1), par1); + float var9; + float var10; + float var11; + float var12; + float var20; + int var30; + float var16; + float var17; + + if (var251 != null && Config.isSunMoonEnabled()) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glPushMatrix(); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(MathHelper.sin(this.theWorld.getCelestialAngleRadians(par1)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + var8 = var251[0]; + var9 = var251[1]; + var10 = var251[2]; + + if (this.mc.gameSettings.anaglyph) { + var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + var20 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var11; + var9 = var12; + var10 = var20; + } + + var241.startDrawing(6); + var241.setColorRGBA_F(var8, var9, var10, var251[3]); + var241.addVertex(0.0D, 100.0D, 0.0D); + byte var25 = 16; + var241.setColorRGBA_F(var251[0], var251[1], var251[2], 0.0F); + + for (var30 = 0; var30 <= var25; ++var30) { + var20 = (float)var30 * (float)Math.PI * 2.0F / (float)var25; + var16 = MathHelper.sin(var20); + var17 = MathHelper.cos(var20); + var241.addVertex((double)(var16 * 120.0F), (double)(var17 * 120.0F), (double)(-var17 * 40.0F * var251[3])); + } + + var241.draw(); + GL11.glPopMatrix(); + GL11.glShadeModel(GL11.GL_FLAT); + } + + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + GL11.glPushMatrix(); + var8 = 1.0F - this.theWorld.getRainStrength(par1); + var9 = 0.0F; + var10 = 0.0F; + var11 = 0.0F; + GL11.glColor4f(1.0F, 1.0F, 1.0F, var8); + GL11.glTranslatef(var9, var10, var11); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + CustomSky.renderSky(this.theWorld, this.renderEngine, par1); + + if (Config.isShaders()) { + Shaders.preCelestialRotate(); + } + + GL11.glRotatef(this.theWorld.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F); + + if (Config.isShaders()) { + Shaders.postCelestialRotate(); + } + + var12 = 30.0F; + + if (Config.isSunTexture()) { + this.renderEngine.bindTexture(locationSunPng); + var241.startDrawingQuads(); + var241.addVertexWithUV((double)(-var12), 100.0D, (double)(-var12), 0.0D, 0.0D); + var241.addVertexWithUV((double)var12, 100.0D, (double)(-var12), 1.0D, 0.0D); + var241.addVertexWithUV((double)var12, 100.0D, (double)var12, 1.0D, 1.0D); + var241.addVertexWithUV((double)(-var12), 100.0D, (double)var12, 0.0D, 1.0D); + var241.draw(); + } + + var12 = 20.0F; + + if (Config.isMoonTexture()) { + this.renderEngine.bindTexture(locationMoonPhasesPng); + int var26 = this.theWorld.getMoonPhase(); + int var27 = var26 % 4; + var30 = var26 / 4 % 2; + var16 = (float)(var27 + 0) / 4.0F; + var17 = (float)(var30 + 0) / 2.0F; + float var18 = (float)(var27 + 1) / 4.0F; + float var19 = (float)(var30 + 1) / 2.0F; + var241.startDrawingQuads(); + var241.addVertexWithUV((double)(-var12), -100.0D, (double)var12, (double)var18, (double)var19); + var241.addVertexWithUV((double)var12, -100.0D, (double)var12, (double)var16, (double)var19); + var241.addVertexWithUV((double)var12, -100.0D, (double)(-var12), (double)var16, (double)var17); + var241.addVertexWithUV((double)(-var12), -100.0D, (double)(-var12), (double)var18, (double)var17); + var241.draw(); + } + + GL11.glDisable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + var20 = this.theWorld.getStarBrightness(par1) * var8; + + if (var20 > 0.0F && Config.isStarsEnabled() && !CustomSky.hasSkyLayers(this.theWorld)) { + GL11.glColor4f(var20, var20, var20, var20); + GL11.glCallList(this.starGLCallList); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_FOG); + + if (Config.isShaders()) { + Shaders.enableFog(); + } + + GL11.glPopMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GL11.glColor3f(0.0F, 0.0F, 0.0F); + double var28 = this.mc.thePlayer.getPosition(par1).yCoord - this.theWorld.getHorizon(); + + if (var28 < 0.0D) { + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 12.0F, 0.0F); + GL11.glCallList(this.glSkyList2); + GL11.glPopMatrix(); + var10 = 1.0F; + var11 = -((float)(var28 + 65.0D)); + var12 = -var10; + var241.startDrawingQuads(); + var241.setColorRGBA_I(0, 255); + var241.addVertex((double)(-var10), (double)var11, (double)var10); + var241.addVertex((double)var10, (double)var11, (double)var10); + var241.addVertex((double)var10, (double)var12, (double)var10); + var241.addVertex((double)(-var10), (double)var12, (double)var10); + var241.addVertex((double)(-var10), (double)var12, (double)(-var10)); + var241.addVertex((double)var10, (double)var12, (double)(-var10)); + var241.addVertex((double)var10, (double)var11, (double)(-var10)); + var241.addVertex((double)(-var10), (double)var11, (double)(-var10)); + var241.addVertex((double)var10, (double)var12, (double)(-var10)); + var241.addVertex((double)var10, (double)var12, (double)var10); + var241.addVertex((double)var10, (double)var11, (double)var10); + var241.addVertex((double)var10, (double)var11, (double)(-var10)); + var241.addVertex((double)(-var10), (double)var11, (double)(-var10)); + var241.addVertex((double)(-var10), (double)var11, (double)var10); + var241.addVertex((double)(-var10), (double)var12, (double)var10); + var241.addVertex((double)(-var10), (double)var12, (double)(-var10)); + var241.addVertex((double)(-var10), (double)var12, (double)(-var10)); + var241.addVertex((double)(-var10), (double)var12, (double)var10); + var241.addVertex((double)var10, (double)var12, (double)var10); + var241.addVertex((double)var10, (double)var12, (double)(-var10)); + var241.draw(); + } + + if (this.theWorld.provider.isSkyColored()) { + GL11.glColor3f(var231 * 0.2F + 0.04F, var4 * 0.2F + 0.04F, var5 * 0.6F + 0.1F); + } else { + GL11.glColor3f(var231, var4, var5); + } + + if (this.mc.gameSettings.renderDistanceChunks <= 4) { + GL11.glColor3f(this.mc.entityRenderer.fogColorRed, this.mc.entityRenderer.fogColorGreen, this.mc.entityRenderer.fogColorBlue); + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -((float)(var28 - 16.0D)), 0.0F); + + boolean showBottomSkyLayer = CheatBreaker.getInstance().getGlobalSettings().bottomSkyLayer.getValue().equals("No Custom Sky") ? !Config.isCustomSky() || CustomSky.getWorldSkyLayers() == null : CheatBreaker.getInstance().getGlobalSettings().bottomSkyLayer.getValue().equals("ON"); + if (Config.isSkyEnabled() && showBottomSkyLayer) { + GL11.glCallList(this.glSkyList2); + } + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + + GL11.glDepthMask(true); + } + } + + public void renderClouds(float par1) { + if (!Config.isCloudsOff()) { + if (Reflector.ForgeWorldProvider_getCloudRenderer.exists()) { + WorldProvider partialTicks = this.mc.theWorld.provider; + Object var2 = Reflector.call(partialTicks, Reflector.ForgeWorldProvider_getCloudRenderer, new Object[0]); + + if (var2 != null) { + Reflector.callVoid(var2, Reflector.IRenderHandler_render, new Object[] {Float.valueOf(par1), this.theWorld, this.mc}); + return; + } + } + + if (this.mc.theWorld.provider.isSurfaceWorld()) { + if (Config.isCloudsFancy()) { + this.renderCloudsFancy(par1); + } else { + float partialTicks1 = par1; + par1 = 0.0F; + GL11.glDisable(GL11.GL_CULL_FACE); + float var21 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)par1); + byte var3 = 32; + int var4 = 256 / var3; + Tessellator var5 = Tessellator.instance; + this.renderEngine.bindTexture(locationCloudsPng); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + double dc; + double exactPlayerZ1; + + if (this.isFancyGlListClouds || this.cloudTickCounter >= this.cloudTickCounterGlList + 20) { + GL11.glNewList(this.glListClouds, GL11.GL_COMPILE); + Vec3 entityliving = this.theWorld.getCloudColour(par1); + float exactPlayerX = (float)entityliving.xCoord; + float var8 = (float)entityliving.yCoord; + float exactPlayerY = (float)entityliving.zCoord; + float var10; + + if (this.mc.gameSettings.anaglyph) { + var10 = (exactPlayerX * 30.0F + var8 * 59.0F + exactPlayerY * 11.0F) / 100.0F; + float exactPlayerZ = (exactPlayerX * 30.0F + var8 * 70.0F) / 100.0F; + float var12 = (exactPlayerX * 30.0F + exactPlayerY * 70.0F) / 100.0F; + exactPlayerX = var10; + var8 = exactPlayerZ; + exactPlayerY = var12; + } + + var10 = 4.8828125E-4F; + exactPlayerZ1 = (double)((float)this.cloudTickCounter + par1); + dc = this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)par1 + exactPlayerZ1 * 0.029999999329447746D; + double cdx = this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)par1; + int cdz = MathHelper.floor_double(dc / 2048.0D); + int var18 = MathHelper.floor_double(cdx / 2048.0D); + dc -= (double)(cdz * 2048); + cdx -= (double)(var18 * 2048); + float var19 = this.theWorld.provider.getCloudHeight() - var21 + 0.33F; + var19 += this.mc.gameSettings.ofCloudsHeight * 128.0F; + float var20 = (float)(dc * (double)var10); + float var24 = (float)(cdx * (double)var10); + var5.startDrawingQuads(); + var5.setColorRGBA_F(exactPlayerX, var8, exactPlayerY, 0.8F); + + for (int var22 = -var3 * var4; var22 < var3 * var4; var22 += var3) { + for (int var23 = -var3 * var4; var23 < var3 * var4; var23 += var3) { + var5.addVertexWithUV((double)(var22 + 0), (double)var19, (double)(var23 + var3), (double)((float)(var22 + 0) * var10 + var20), (double)((float)(var23 + var3) * var10 + var24)); + var5.addVertexWithUV((double)(var22 + var3), (double)var19, (double)(var23 + var3), (double)((float)(var22 + var3) * var10 + var20), (double)((float)(var23 + var3) * var10 + var24)); + var5.addVertexWithUV((double)(var22 + var3), (double)var19, (double)(var23 + 0), (double)((float)(var22 + var3) * var10 + var20), (double)((float)(var23 + 0) * var10 + var24)); + var5.addVertexWithUV((double)(var22 + 0), (double)var19, (double)(var23 + 0), (double)((float)(var22 + 0) * var10 + var20), (double)((float)(var23 + 0) * var10 + var24)); + } + } + + var5.draw(); + GL11.glEndList(); + this.isFancyGlListClouds = false; + this.cloudTickCounterGlList = this.cloudTickCounter; + this.cloudPlayerX = this.mc.renderViewEntity.prevPosX; + this.cloudPlayerY = this.mc.renderViewEntity.prevPosY; + this.cloudPlayerZ = this.mc.renderViewEntity.prevPosZ; + } + + EntityLivingBase entityliving1 = this.mc.renderViewEntity; + double exactPlayerX1 = entityliving1.prevPosX + (entityliving1.posX - entityliving1.prevPosX) * (double)partialTicks1; + double exactPlayerY1 = entityliving1.prevPosY + (entityliving1.posY - entityliving1.prevPosY) * (double)partialTicks1; + exactPlayerZ1 = entityliving1.prevPosZ + (entityliving1.posZ - entityliving1.prevPosZ) * (double)partialTicks1; + dc = (double)((float)(this.cloudTickCounter - this.cloudTickCounterGlList) + partialTicks1); + float cdx1 = (float)(exactPlayerX1 - this.cloudPlayerX + dc * 0.03D); + float cdy = (float)(exactPlayerY1 - this.cloudPlayerY); + float cdz1 = (float)(exactPlayerZ1 - this.cloudPlayerZ); + GL11.glTranslatef(-cdx1, -cdy, -cdz1); + GL11.glCallList(this.glListClouds); + GL11.glTranslatef(cdx1, cdy, cdz1); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + } + } + } + } + + /** + * Checks if the given position is to be rendered with cloud fog + */ + public boolean hasCloudFog(double par1, double par3, double par5, float par7) { + return false; + } + + /** + * Renders the 3d fancy clouds + */ + public void renderCloudsFancy(float par1) { + float partialTicks = par1; + par1 = 0.0F; + GL11.glDisable(GL11.GL_CULL_FACE); + float var2 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)par1); + Tessellator var3 = Tessellator.instance; + float var4 = 12.0F; + float var5 = 4.0F; + double var6 = (double)((float)this.cloudTickCounter + par1); + double var8 = (this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)par1 + var6 * 0.029999999329447746D) / (double)var4; + double var10 = (this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)par1) / (double)var4 + 0.33000001311302185D; + float var12 = this.theWorld.provider.getCloudHeight() - var2 + 0.33F; + var12 += this.mc.gameSettings.ofCloudsHeight * 128.0F; + int var13 = MathHelper.floor_double(var8 / 2048.0D); + int var14 = MathHelper.floor_double(var10 / 2048.0D); + var8 -= (double)(var13 * 2048); + var10 -= (double)(var14 * 2048); + this.renderEngine.bindTexture(locationCloudsPng); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + float cdz; + + if (!this.isFancyGlListClouds || this.cloudTickCounter >= this.cloudTickCounterGlList + 20) { + GL11.glNewList(this.glListClouds, GL11.GL_COMPILE); + Vec3 entityliving = this.theWorld.getCloudColour(par1); + float exactPlayerX = (float)entityliving.xCoord; + float var17 = (float)entityliving.yCoord; + float exactPlayerY = (float)entityliving.zCoord; + float var19; + float exactPlayerZ; + float var21; + + if (this.mc.gameSettings.anaglyph) { + var19 = (exactPlayerX * 30.0F + var17 * 59.0F + exactPlayerY * 11.0F) / 100.0F; + exactPlayerZ = (exactPlayerX * 30.0F + var17 * 70.0F) / 100.0F; + var21 = (exactPlayerX * 30.0F + exactPlayerY * 70.0F) / 100.0F; + exactPlayerX = var19; + var17 = exactPlayerZ; + exactPlayerY = var21; + } + + var19 = (float)(var8 * 0.0D); + exactPlayerZ = (float)(var10 * 0.0D); + var21 = 0.00390625F; + var19 = (float)MathHelper.floor_double(var8) * var21; + exactPlayerZ = (float)MathHelper.floor_double(var10) * var21; + float dc = (float)(var8 - (double)MathHelper.floor_double(var8)); + float var23 = (float)(var10 - (double)MathHelper.floor_double(var10)); + byte cdx = 8; + byte cdy = 4; + cdz = 9.765625E-4F; + GL11.glScalef(var4, 1.0F, var4); + + for (int var27 = 0; var27 < 2; ++var27) { + if (var27 == 0) { + GL11.glColorMask(false, false, false, false); + } else if (this.mc.gameSettings.anaglyph) { + if (EntityRenderer.anaglyphField == 0) { + GL11.glColorMask(false, true, true, true); + } else { + GL11.glColorMask(true, false, false, true); + } + } else { + GL11.glColorMask(true, true, true, true); + } + + for (int var28 = -cdy + 1; var28 <= cdy; ++var28) { + for (int var29 = -cdy + 1; var29 <= cdy; ++var29) { + var3.startDrawingQuads(); + float var30 = (float)(var28 * cdx); + float var31 = (float)(var29 * cdx); + float var32 = var30 - dc; + float var33 = var31 - var23; + + if (var12 > -var5 - 1.0F) { + var3.setColorRGBA_F(exactPlayerX * 0.7F, var17 * 0.7F, exactPlayerY * 0.7F, 0.8F); + var3.setNormal(0.0F, -1.0F, 0.0F); + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + + if (var12 <= var5 + 1.0F) { + var3.setColorRGBA_F(exactPlayerX, var17, exactPlayerY, 0.8F); + var3.setNormal(0.0F, 1.0F, 0.0F); + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + var5 - cdz), (double)(var33 + (float)cdx), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + var5 - cdz), (double)(var33 + (float)cdx), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + var5 - cdz), (double)(var33 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + var5 - cdz), (double)(var33 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + + var3.setColorRGBA_F(exactPlayerX * 0.9F, var17 * 0.9F, exactPlayerY * 0.9F, 0.8F); + int var34; + + if (var28 > -1) { + var3.setNormal(-1.0F, 0.0F, 0.0F); + + for (var34 = 0; var34 < cdx; ++var34) { + var3.addVertexWithUV((double)(var32 + (float)var34 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)var34 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)var34 + 0.0F), (double)(var12 + var5), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)var34 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + } + + if (var28 <= 1) { + var3.setNormal(1.0F, 0.0F, 0.0F); + + for (var34 = 0; var34 < cdx; ++var34) { + var3.addVertexWithUV((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + var5), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + var5), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + } + + var3.setColorRGBA_F(exactPlayerX * 0.8F, var17 * 0.8F, exactPlayerY * 0.8F, 0.8F); + + if (var29 > -1) { + var3.setNormal(0.0F, 0.0F, -1.0F); + + for (var34 = 0; var34 < cdx; ++var34) { + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + var5), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + } + } + + if (var29 <= 1) { + var3.setNormal(0.0F, 0.0F, 1.0F); + + for (var34 = 0; var34 < cdx; ++var34) { + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + var5), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + } + } + + var3.draw(); + } + } + } + + GL11.glEndList(); + this.isFancyGlListClouds = true; + this.cloudTickCounterGlList = this.cloudTickCounter; + this.cloudPlayerX = this.mc.renderViewEntity.prevPosX; + this.cloudPlayerY = this.mc.renderViewEntity.prevPosY; + this.cloudPlayerZ = this.mc.renderViewEntity.prevPosZ; + } + + EntityLivingBase var36 = this.mc.renderViewEntity; + double var37 = var36.prevPosX + (var36.posX - var36.prevPosX) * (double)partialTicks; + double var38 = var36.prevPosY + (var36.posY - var36.prevPosY) * (double)partialTicks; + double var39 = var36.prevPosZ + (var36.posZ - var36.prevPosZ) * (double)partialTicks; + double var40 = (double)((float)(this.cloudTickCounter - this.cloudTickCounterGlList) + partialTicks); + float var41 = (float)(var37 - this.cloudPlayerX + var40 * 0.03D); + float var42 = (float)(var38 - this.cloudPlayerY); + cdz = (float)(var39 - this.cloudPlayerZ); + GL11.glTranslatef(-var41, -var42, -cdz); + GL11.glCallList(this.glListClouds); + GL11.glTranslatef(var41, var42, cdz); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + } + + /** + * Updates some of the renderers sorted by distance from the player + */ + public boolean updateRenderers(EntityLivingBase entityliving, boolean flag) { + this.renderViewEntity = entityliving; + + if (WrUpdates.hasWrUpdater()) { + return WrUpdates.updateRenderers(this, entityliving, flag); + } else if (this.worldRenderersToUpdate.size() <= 0) { + return false; + } else { + int num = 0; + int maxNum = Config.getUpdatesPerFrame(); + + if (Config.isDynamicUpdates() && !this.isMoving(entityliving)) { + maxNum *= 3; + } + + byte NOT_IN_FRUSTRUM_MUL = 4; + int numValid = 0; + WorldRenderer wrBest = null; + float distSqBest = Float.MAX_VALUE; + int indexBest = -1; + + for (int maxDiffDistSq = 0; maxDiffDistSq < this.worldRenderersToUpdate.size(); ++maxDiffDistSq) { + WorldRenderer i = (WorldRenderer)this.worldRenderersToUpdate.get(maxDiffDistSq); + + if (i != null) { + ++numValid; + + if (!i.needsUpdate) { + this.worldRenderersToUpdate.set(maxDiffDistSq, (Object)null); + } else { + float wr = i.distanceToEntitySquared(entityliving); + + if (wr <= 256.0F && this.isActingNow()) { + i.updateRenderer(entityliving); + i.needsUpdate = false; + this.worldRenderersToUpdate.set(maxDiffDistSq, (Object)null); + ++num; + } else { + if (wr > 256.0F && num >= maxNum) { + break; + } + + if (!i.isInFrustum) { + wr *= (float)NOT_IN_FRUSTRUM_MUL; + } + + if (wrBest == null) { + wrBest = i; + distSqBest = wr; + indexBest = maxDiffDistSq; + } else if (wr < distSqBest) { + wrBest = i; + distSqBest = wr; + indexBest = maxDiffDistSq; + } + } + } + } + } + + if (wrBest != null) { + wrBest.updateRenderer(entityliving); + wrBest.needsUpdate = false; + this.worldRenderersToUpdate.set(indexBest, (Object)null); + ++num; + float var15 = distSqBest / 5.0F; + + for (int var16 = 0; var16 < this.worldRenderersToUpdate.size() && num < maxNum; ++var16) { + WorldRenderer var17 = (WorldRenderer)this.worldRenderersToUpdate.get(var16); + + if (var17 != null) { + float distSq = var17.distanceToEntitySquared(entityliving); + + if (!var17.isInFrustum) { + distSq *= (float)NOT_IN_FRUSTRUM_MUL; + } + + float diffDistSq = Math.abs(distSq - distSqBest); + + if (diffDistSq < var15) { + var17.updateRenderer(entityliving); + var17.needsUpdate = false; + this.worldRenderersToUpdate.set(var16, (Object)null); + ++num; + } + } + } + } + + if (numValid == 0) { + this.worldRenderersToUpdate.clear(); + } + + this.worldRenderersToUpdate.compact(); + return true; + } + } + + public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) { + this.drawBlockDamageTexture(par1Tessellator, par2EntityPlayer, par3); + } + + public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLivingBase par2EntityPlayer, float par3) { + double var4 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3; + double var6 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3; + double var8 = par2EntityPlayer.lastTickPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.lastTickPosZ) * (double)par3; + + if (!this.damagedBlocks.isEmpty()) { + OpenGlHelper.glBlendFunc(774, 768, 1, 0); + this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); + GL11.glPushMatrix(); + GL11.glPolygonOffset(-3.0F, -3.0F); + GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + if (Config.isShaders()) { + Shaders.beginBlockDestroyProgress(); + } + + par1Tessellator.startDrawingQuads(); + par1Tessellator.setTranslation(-var4, -var6, -var8); + par1Tessellator.disableColor(); + Iterator var10 = this.damagedBlocks.values().iterator(); + + while (var10.hasNext()) { + DestroyBlockProgress var11 = (DestroyBlockProgress)var10.next(); + double var12 = (double)var11.getPartialBlockX() - var4; + double var14 = (double)var11.getPartialBlockY() - var6; + double var16 = (double)var11.getPartialBlockZ() - var8; + + if (var12 * var12 + var14 * var14 + var16 * var16 > 1024.0D) { + var10.remove(); + } else { + Block var18 = this.theWorld.getBlock(var11.getPartialBlockX(), var11.getPartialBlockY(), var11.getPartialBlockZ()); + + if (var18.getMaterial() != Material.air) { + this.renderBlocksRg.renderBlockUsingTexture(var18, var11.getPartialBlockX(), var11.getPartialBlockY(), var11.getPartialBlockZ(), this.destroyBlockIcons[var11.getPartialBlockDamage()]); + } + } + } + + par1Tessellator.draw(); + par1Tessellator.setTranslation(0.0D, 0.0D, 0.0D); + + if (Config.isShaders()) { + Shaders.endBlockDestroyProgress(); + } + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDepthMask(true); + GL11.glPopMatrix(); + } + } + + /** + * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime + */ + public void drawSelectionBox(EntityPlayer par1EntityPlayer, MovingObjectPosition par2MovingObjectPosition, int par3, float par4) { + if (par3 == 0 && par2MovingObjectPosition.typeOfHit == MovingObjectType.BLOCK) { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth(2.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.disableTexture2D(); + } + + GL11.glDepthMask(false); + float var5 = 0.002F; + Block var6 = this.theWorld.getBlock(par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ); + + if (var6.getMaterial() != Material.air) { + var6.setBlockBoundsBasedOnState(this.theWorld, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ); + double var7 = par1EntityPlayer.lastTickPosX + (par1EntityPlayer.posX - par1EntityPlayer.lastTickPosX) * (double)par4; + double var9 = par1EntityPlayer.lastTickPosY + (par1EntityPlayer.posY - par1EntityPlayer.lastTickPosY) * (double)par4; + double var11 = par1EntityPlayer.lastTickPosZ + (par1EntityPlayer.posZ - par1EntityPlayer.lastTickPosZ) * (double)par4; + drawOutlinedBoundingBox(var6.getSelectedBoundingBoxFromPool(this.theWorld, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ).expand((double)var5, (double)var5, (double)var5).getOffsetBoundingBox(-var7, -var9, -var11), -1); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (Config.isShaders()) { + Shaders.enableTexture2D(); + } + + GL11.glDisable(GL11.GL_BLEND); + } + } + + /** + * Draws lines for the edges of the bounding box. + */ + public static void drawOutlinedBoundingBox(AxisAlignedBB p_147590_0_, int p_147590_1_) { + Tessellator var2 = Tessellator.instance; + var2.startDrawing(3); + + if (p_147590_1_ != -1) { + var2.setColorOpaque_I(p_147590_1_); + } + + var2.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.maxZ); + var2.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.maxZ); + var2.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + var2.draw(); + var2.startDrawing(3); + + if (p_147590_1_ != -1) { + var2.setColorOpaque_I(p_147590_1_); + } + + var2.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.maxZ); + var2.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.maxZ); + var2.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + var2.draw(); + var2.startDrawing(1); + + if (p_147590_1_ != -1) { + var2.setColorOpaque_I(p_147590_1_); + } + + var2.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.minZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.maxZ); + var2.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.maxZ); + var2.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.maxZ); + var2.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.maxZ); + var2.draw(); + } + + /** + * Marks the blocks in the given range for update + */ + public void markBlocksForUpdate(int par1, int par2, int par3, int par4, int par5, int par6) { + int var7 = MathHelper.bucketInt(par1, 16); + int var8 = MathHelper.bucketInt(par2, 16); + int var9 = MathHelper.bucketInt(par3, 16); + int var10 = MathHelper.bucketInt(par4, 16); + int var11 = MathHelper.bucketInt(par5, 16); + int var12 = MathHelper.bucketInt(par6, 16); + + for (int var13 = var7; var13 <= var10; ++var13) { + int var14 = var13 % this.renderChunksWide; + + if (var14 < 0) { + var14 += this.renderChunksWide; + } + + for (int var15 = var8; var15 <= var11; ++var15) { + int var16 = var15 % this.renderChunksTall; + + if (var16 < 0) { + var16 += this.renderChunksTall; + } + + for (int var17 = var9; var17 <= var12; ++var17) { + int var18 = var17 % this.renderChunksDeep; + + if (var18 < 0) { + var18 += this.renderChunksDeep; + } + + int var19 = (var18 * this.renderChunksTall + var16) * this.renderChunksWide + var14; + WorldRenderer var20 = this.worldRenderers[var19]; + + if (var20 != null && !var20.needsUpdate) { + this.worldRenderersToUpdate.add(var20); + var20.markDirty(); + } + } + } + } + } + + /** + * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), + * including the tile entity description packet if applicable. Args: x, y, z + */ + public void markBlockForUpdate(int p_147586_1_, int p_147586_2_, int p_147586_3_) { + this.markBlocksForUpdate(p_147586_1_ - 1, p_147586_2_ - 1, p_147586_3_ - 1, p_147586_1_ + 1, p_147586_2_ + 1, p_147586_3_ + 1); + } + + /** + * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. + */ + public void markBlockForRenderUpdate(int p_147588_1_, int p_147588_2_, int p_147588_3_) { + this.markBlocksForUpdate(p_147588_1_ - 1, p_147588_2_ - 1, p_147588_3_ - 1, p_147588_1_ + 1, p_147588_2_ + 1, p_147588_3_ + 1); + } + + /** + * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + public void markBlockRangeForRenderUpdate(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) { + this.markBlocksForUpdate(p_147585_1_ - 1, p_147585_2_ - 1, p_147585_3_ - 1, p_147585_4_ + 1, p_147585_5_ + 1, p_147585_6_ + 1); + } + + /** + * Checks all renderers that previously weren't in the frustum and 1/16th of those that previously were in the + * frustum for frustum clipping Args: frustum, partialTickTime + */ + public void clipRenderersByFrustum(ICamera par1ICamera, float par2) { + boolean checkDistanceXz = !Config.isFogOff(); + double renderDistSq = (double)(this.renderDistanceChunks * 16 * this.renderDistanceChunks * 16); + + for (int var3 = 0; var3 < this.countSortedWorldRenderers; ++var3) { + WorldRenderer wr = this.sortedWorldRenderers[var3]; + + if (!wr.skipAllRenderPasses()) { + if (checkDistanceXz && wr.distanceToEntityXzSq > renderDistSq) { + wr.isInFrustum = false; + } else { + wr.updateInFrustum(par1ICamera); + } + } + } + } + + /** + * Plays the specified record. Arg: recordName, x, y, z + */ + public void playRecord(String par1Str, int par2, int par3, int par4) { + ChunkCoordinates var5 = new ChunkCoordinates(par2, par3, par4); + ISound var6 = (ISound)this.mapSoundPositions.get(var5); + + if (var6 != null) { + this.mc.getSoundHandler().func_147683_b(var6); + this.mapSoundPositions.remove(var5); + } + + if (par1Str != null) { + ItemRecord var7 = ItemRecord.func_150926_b(par1Str); + + if (var7 != null) { + this.mc.ingameGUI.setRecordPlayingMessage(var7.func_150927_i()); + } + + ResourceLocation resource = null; + + if (Reflector.ForgeItemRecord_getRecordResource.exists() && var7 != null) { + resource = (ResourceLocation)Reflector.call(var7, Reflector.ForgeItemRecord_getRecordResource, new Object[] {par1Str}); + } + + if (resource == null) { + resource = new ResourceLocation(par1Str); + } + + PositionedSoundRecord var8 = PositionedSoundRecord.func_147675_a(resource, (float)par2, (float)par3, (float)par4); + this.mapSoundPositions.put(var5, var8); + this.mc.getSoundHandler().playSound(var8); + } + } + + /** + * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch + */ + public void playSound(String par1Str, double par2, double par4, double par6, float par8, float par9) {} + + /** + * Plays sound to all near players except the player reference given + */ + public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, double par3, double par5, double par7, float par9, float par10) {} + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + public void spawnParticle(String par1Str, final double par2, final double par4, final double par6, double par8, double par10, double par12) { + try { + this.doSpawnParticle(par1Str, par2, par4, par6, par8, par10, par12); + } catch (Throwable var17) { + CrashReport var15 = CrashReport.makeCrashReport(var17, "Exception while adding particle"); + CrashReportCategory var16 = var15.makeCategory("Particle being added"); + var16.addCrashSection("Name", par1Str); + var16.addCrashSectionCallable("Position", () -> CrashReportCategory.func_85074_a(par2, par4, par6)); + throw new ReportedException(var15); + } + } + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + public EntityFX doSpawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) { + if (this.mc != null && this.mc.renderViewEntity != null && this.mc.effectRenderer != null) { + int var14 = this.mc.gameSettings.particleSetting; + + if (var14 == 1 && this.theWorld.rand.nextInt(3) == 0) { + var14 = 2; + } + + double var15 = this.mc.renderViewEntity.posX - par2; + double var17 = this.mc.renderViewEntity.posY - par4; + double var19 = this.mc.renderViewEntity.posZ - par6; + EntityFX var21 = null; + + if (par1Str.equals("hugeexplosion")) { + if (Config.isAnimatedExplosion()) { + this.mc.effectRenderer.addEffect(var21 = new EntityHugeExplodeFX(this.theWorld, par2, par4, par6, par8, par10, par12)); + } + } else if (par1Str.equals("largeexplode")) { + if (Config.isAnimatedExplosion()) { + this.mc.effectRenderer.addEffect(var21 = new EntityLargeExplodeFX(this.renderEngine, this.theWorld, par2, par4, par6, par8, par10, par12)); + } + } else if (par1Str.equals("fireworksSpark")) { + this.mc.effectRenderer.addEffect(var21 = new EntityFireworkSparkFX(this.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer)); + } + + if (var21 != null) { + return (EntityFX)var21; + } else { + double var22 = 16.0D; + double d3 = 16.0D; + + if (par1Str.equals("crit")) { + var22 = 196.0D; + } + + if (var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) { + return null; + } else if (var14 > 1) { + return null; + } else { + if (par1Str.equals("bubble")) { + var21 = new EntityBubbleFX(this.theWorld, par2, par4, par6, par8, par10, par12); + CustomColorizer.updateWaterFX((EntityFX)var21, this.theWorld); + } else if (par1Str.equals("suspended")) { + if (Config.isWaterParticles()) { + var21 = new EntitySuspendFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } + } else if (par1Str.equals("depthsuspend")) { + if (Config.isVoidParticles()) { + var21 = new EntityAuraFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } + } else if (par1Str.equals("townaura")) { + var21 = new EntityAuraFX(this.theWorld, par2, par4, par6, par8, par10, par12); + CustomColorizer.updateMyceliumFX((EntityFX)var21); + } else if (par1Str.equals("crit")) { + var21 = new EntityCritFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("magicCrit")) { + var21 = new EntityCritFX(this.theWorld, par2, par4, par6, par8, par10, par12); + ((EntityFX)var21).setRBGColorF(((EntityFX)var21).getRedColorF() * 0.3F, ((EntityFX)var21).getGreenColorF() * 0.8F, ((EntityFX)var21).getBlueColorF()); + ((EntityFX)var21).nextTextureIndexX(); + } else if (par1Str.equals("smoke")) { + if (Config.isAnimatedSmoke()) { + var21 = new EntitySmokeFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } + } else if (par1Str.equals("mobSpell")) { + if (Config.isPotionParticles()) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() || (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.activeEffectParticles.getValue()) { + var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled()) { + var21.setAlphaF((float) CheatBreaker.getInstance().getModuleManager().particlesMod.activeEffectOpacity.getValue() / 100.0F); + } + var21.setRBGColorF((float)par8, (float)par10, (float)par12); + } + } + } else if (par1Str.equals("mobSpellAmbient")) { + if (Config.isPotionParticles()) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() || (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.activeEffectParticles.getValue()) { + var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled()) { + var21.setAlphaF((float) CheatBreaker.getInstance().getModuleManager().particlesMod.activeEffectAmbientOpacity.getValue() / 100.0F); + } else { + var21.setAlphaF(0.15F); + } + var21.setRBGColorF((float)par8, (float)par10, (float)par12); + } + } + } else if (par1Str.equals("spell")) { + if (Config.isPotionParticles()) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() || (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.splashParticles.getValue()) { + var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled()) { + var21.setAlphaF((float) CheatBreaker.getInstance().getModuleManager().particlesMod.normalEffectSplashOpacity.getValue() / 100.0F); + } + } + } + } else if (par1Str.equals("instantSpell")) { + if (Config.isPotionParticles()) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() || (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.splashParticles.getValue()) { + var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled()) { + var21.setAlphaF((float) CheatBreaker.getInstance().getModuleManager().particlesMod.instantEffectSplashOpacity.getValue() / 100.0F); + } + ((EntitySpellParticleFX)var21).setBaseSpellTextureIndex(144); + } + } + } else if (par1Str.equals("witchMagic")) { + if (Config.isPotionParticles()) { + var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); + ((EntitySpellParticleFX)var21).setBaseSpellTextureIndex(144); + float var26 = this.theWorld.rand.nextFloat() * 0.5F + 0.35F; + ((EntityFX)var21).setRBGColorF(1.0F * var26, 0.0F * var26, 1.0F * var26); + } + } else if (par1Str.equals("note")) { + var21 = new EntityNoteFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("portal")) { + if (Config.isPortalParticles()) { + var21 = new EntityPortalFX(this.theWorld, par2, par4, par6, par8, par10, par12); + CustomColorizer.updatePortalFX((EntityFX)var21); + } + } else if (par1Str.equals("enchantmenttable")) { + var21 = new EntityEnchantmentTableParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("explode")) { + if (Config.isAnimatedExplosion()) { + var21 = new EntityExplodeFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } + } else if (par1Str.equals("flame")) { + if (Config.isAnimatedFlame()) { + var21 = new EntityFlameFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } + } else if (par1Str.equals("lava")) { + var21 = new EntityLavaFX(this.theWorld, par2, par4, par6); + } else if (par1Str.equals("footstep")) { + var21 = new EntityFootStepFX(this.renderEngine, this.theWorld, par2, par4, par6); + } else if (par1Str.equals("splash")) { + var21 = new EntitySplashFX(this.theWorld, par2, par4, par6, par8, par10, par12); + CustomColorizer.updateWaterFX((EntityFX)var21, this.theWorld); + } else if (par1Str.equals("wake")) { + var21 = new EntityFishWakeFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("largesmoke")) { + if (Config.isAnimatedSmoke()) { + var21 = new EntitySmokeFX(this.theWorld, par2, par4, par6, par8, par10, par12, 2.5F); + } + } else if (par1Str.equals("cloud")) { + var21 = new EntityCloudFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("reddust")) { + if (Config.isAnimatedRedstone()) { + var21 = new EntityReddustFX(this.theWorld, par2, par4, par6, (float)par8, (float)par10, (float)par12); + CustomColorizer.updateReddustFX((EntityFX)var21, this.theWorld, var15, var17, var19); + } + } else if (par1Str.equals("snowballpoof")) { + var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Items.snowball); + } else if (par1Str.equals("dripWater")) { + if (Config.isDrippingWaterLava()) { + var21 = new EntityDropParticleFX(this.theWorld, par2, par4, par6, Material.water); + } + } else if (par1Str.equals("dripLava")) { + if (Config.isDrippingWaterLava()) { + var21 = new EntityDropParticleFX(this.theWorld, par2, par4, par6, Material.lava); + } + } else if (par1Str.equals("snowshovel")) { + var21 = new EntitySnowShovelFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("slime")) { + var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Items.slime_ball); + } else if (par1Str.equals("heart")) { + var21 = new EntityHeartFX(this.theWorld, par2, par4, par6, par8, par10, par12); + } else if (par1Str.equals("angryVillager")) { + var21 = new EntityHeartFX(this.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12); + ((EntityFX)var21).setParticleTextureIndex(81); + ((EntityFX)var21).setRBGColorF(1.0F, 1.0F, 1.0F); + } else if (par1Str.equals("happyVillager")) { + var21 = new EntityAuraFX(this.theWorld, par2, par4, par6, par8, par10, par12); + ((EntityFX)var21).setParticleTextureIndex(82); + ((EntityFX)var21).setRBGColorF(1.0F, 1.0F, 1.0F); + } else { + String[] var27; + int var261; + + if (par1Str.startsWith("iconcrack_")) { + var27 = par1Str.split("_", 3); + int var28 = Integer.parseInt(var27[1]); + + if (var27.length > 2) { + var261 = Integer.parseInt(var27[2]); + var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.getItemById(var28), var261); + } else { + var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.getItemById(var28), 0); + } + } else { + Block var281; + + if (par1Str.startsWith("blockcrack_")) { + var27 = par1Str.split("_", 3); + var281 = Block.getBlockById(Integer.parseInt(var27[1])); + var261 = Integer.parseInt(var27[2]); + var21 = (new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, var281, var261)).applyRenderColor(var261); + } else if (par1Str.startsWith("blockdust_")) { + var27 = par1Str.split("_", 3); + var281 = Block.getBlockById(Integer.parseInt(var27[1])); + var261 = Integer.parseInt(var27[2]); + var21 = (new EntityBlockDustFX(this.theWorld, par2, par4, par6, par8, par10, par12, var281, var261)).applyRenderColor(var261); + } + } + } + + if (var21 != null) { + this.mc.effectRenderer.addEffect((EntityFX)var21); + } + + return (EntityFX)var21; + } + } + } else { + return null; + } + } + + /** + * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any + * necessary textures. On server worlds, adds the entity to the entity tracker. + */ + public void onEntityCreate(Entity par1Entity) { + RandomMobs.entityLoaded(par1Entity, this.theWorld); + + if (Config.isDynamicLights()) { + DynamicLights.entityAdded(par1Entity, this); + } + } + + /** + * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the entity tracker. + */ + public void onEntityDestroy(Entity par1Entity) { + if (Config.isDynamicLights()) { + DynamicLights.entityRemoved(par1Entity, this); + } + } + + /** + * Deletes all display lists + */ + public void deleteAllDisplayLists() { + GLAllocation.deleteDisplayLists(this.glRenderListBase); + this.displayListAllocator.deleteDisplayLists(); + } + + public void broadcastSound(int par1, int par2, int par3, int par4, int par5) { + Random var6 = this.theWorld.rand; + + switch (par1) { + case 1013: + case 1018: + if (this.mc.renderViewEntity != null) { + double var7 = (double)par2 - this.mc.renderViewEntity.posX; + double var9 = (double)par3 - this.mc.renderViewEntity.posY; + double var11 = (double)par4 - this.mc.renderViewEntity.posZ; + double var13 = Math.sqrt(var7 * var7 + var9 * var9 + var11 * var11); + double var15 = this.mc.renderViewEntity.posX; + double var17 = this.mc.renderViewEntity.posY; + double var19 = this.mc.renderViewEntity.posZ; + + if (var13 > 0.0D) { + var15 += var7 / var13 * 2.0D; + var17 += var9 / var13 * 2.0D; + var19 += var11 / var13 * 2.0D; + } + + if (par1 == 1013) { + this.theWorld.playSound(var15, var17, var19, "mob.wither.spawn", 1.0F, 1.0F, false); + } else if (par1 == 1018) { + this.theWorld.playSound(var15, var17, var19, "mob.enderdragon.end", 5.0F, 1.0F, false); + } + } + + default: + } + } + + /** + * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). + */ + public void playAuxSFX(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) { + Random var7 = this.theWorld.rand; + Block var8 = null; + double var9; + double var11; + double var13; + String var15; + int var16; + double var22; + double var26; + double var28; + double var30; + int var40; + double var41; + double var21; + + switch (par2) { + case 1000: + this.theWorld.playSound((double)par3, (double)par4, (double)par5, "random.click", 1.0F, 1.0F, false); + break; + + case 1001: + this.theWorld.playSound((double)par3, (double)par4, (double)par5, "random.click", 1.0F, 1.2F, false); + break; + + case 1002: + this.theWorld.playSound((double)par3, (double)par4, (double)par5, "random.bow", 1.0F, 1.2F, false); + break; + + case 1003: + if (Math.random() < 0.5D) { + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "random.door_open", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + } else { + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "random.door_close", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + } + + break; + + case 1004: + this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.fizz", 0.5F, 2.6F + (var7.nextFloat() - var7.nextFloat()) * 0.8F, false); + break; + + case 1005: + if (Item.getItemById(par6) instanceof ItemRecord) { + this.theWorld.playRecord("records." + ((ItemRecord)Item.getItemById(par6)).field_150929_a, par3, par4, par5); + } else { + this.theWorld.playRecord((String)null, par3, par4, par5); + } + + break; + + case 1007: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.charge", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1008: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.fireball", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1009: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.fireball", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1010: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.wood", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1011: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.metal", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1012: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.woodbreak", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1014: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.wither.shoot", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1015: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.bat.takeoff", 0.05F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1016: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.infect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1017: + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.unfect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + + case 1020: + this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_break", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 1021: + this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_use", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 1022: + this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_land", 0.3F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 2000: + int var34 = par6 % 3 - 1; + int var10 = par6 / 3 % 3 - 1; + var11 = (double)par3 + (double)var34 * 0.6D + 0.5D; + var13 = (double)par4 + 0.5D; + double var35 = (double)par5 + (double)var10 * 0.6D + 0.5D; + + for (int var43 = 0; var43 < 10; ++var43) { + double var44 = var7.nextDouble() * 0.2D + 0.01D; + double var45 = var11 + (double)var34 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var10 * 0.5D; + var22 = var13 + (var7.nextDouble() - 0.5D) * 0.5D; + var41 = var35 + (double)var10 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var34 * 0.5D; + var26 = (double)var34 * var44 + var7.nextGaussian() * 0.01D; + var28 = -0.03D + var7.nextGaussian() * 0.01D; + var30 = (double)var10 * var44 + var7.nextGaussian() * 0.01D; + this.spawnParticle("smoke", var45, var22, var41, var26, var28, var30); + } + + return; + + case 2001: + var8 = Block.getBlockById(par6 & 4095); + + if (var8.getMaterial() != Material.air) { + this.mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation(var8.stepSound.func_150495_a()), (var8.stepSound.func_150497_c() + 1.0F) / 2.0F, var8.stepSound.func_150494_d() * 0.8F, (float)par3 + 0.5F, (float)par4 + 0.5F, (float)par5 + 0.5F)); + } + + this.mc.effectRenderer.func_147215_a(par3, par4, par5, var8, par6 >> 12 & 255); + break; + + case 2002: + var9 = (double)par3; + var11 = (double)par4; + var13 = (double)par5; + var15 = "iconcrack_" + Item.getIdFromItem(Items.potionitem) + "_" + par6; + + for (var16 = 0; var16 < 8; ++var16) { + this.spawnParticle(var15, var9, var11, var13, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); + } + + var16 = Items.potionitem.getColorFromDamage(par6); + float var17 = (float)(var16 >> 16 & 255) / 255.0F; + float var18 = (float)(var16 >> 8 & 255) / 255.0F; + float var19 = (float)(var16 >> 0 & 255) / 255.0F; + String var20 = "spell"; + + if (Items.potionitem.isEffectInstant(par6)) { + var20 = "instantSpell"; + } + + for (var40 = 0; var40 < 100; ++var40) { + var22 = var7.nextDouble() * 4.0D; + var41 = var7.nextDouble() * Math.PI * 2.0D; + var26 = Math.cos(var41) * var22; + var28 = 0.01D + var7.nextDouble() * 0.5D; + var30 = Math.sin(var41) * var22; + EntityFX var46 = this.doSpawnParticle(var20, var9 + var26 * 0.1D, var11 + 0.3D, var13 + var30 * 0.1D, var26, var28, var30); + + if (var46 != null) { + float var33 = 0.75F + var7.nextFloat() * 0.25F; + var46.setRBGColorF(var17 * var33, var18 * var33, var19 * var33); + var46.multiplyVelocity((float)var22); + } + } + + this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "game.potion.smash", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + + case 2003: + var9 = (double)par3 + 0.5D; + var11 = (double)par4; + var13 = (double)par5 + 0.5D; + var15 = "iconcrack_" + Item.getIdFromItem(Items.ender_eye); + + for (var16 = 0; var16 < 8; ++var16) { + this.spawnParticle(var15, var9, var11, var13, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); + } + + for (var21 = 0.0D; var21 < (Math.PI * 2D); var21 += 0.15707963267948966D) { + this.spawnParticle("portal", var9 + Math.cos(var21) * 5.0D, var11 - 0.4D, var13 + Math.sin(var21) * 5.0D, Math.cos(var21) * -5.0D, 0.0D, Math.sin(var21) * -5.0D); + this.spawnParticle("portal", var9 + Math.cos(var21) * 5.0D, var11 - 0.4D, var13 + Math.sin(var21) * 5.0D, Math.cos(var21) * -7.0D, 0.0D, Math.sin(var21) * -7.0D); + } + + return; + + case 2004: + for (var40 = 0; var40 < 20; ++var40) { + var22 = (double)par3 + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + var41 = (double)par4 + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + var26 = (double)par5 + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + this.theWorld.spawnParticle("smoke", var22, var41, var26, 0.0D, 0.0D, 0.0D); + this.theWorld.spawnParticle("flame", var22, var41, var26, 0.0D, 0.0D, 0.0D); + } + + return; + + case 2005: + ItemDye.func_150918_a(this.theWorld, par3, par4, par5, par6); + break; + + case 2006: + var8 = this.theWorld.getBlock(par3, par4, par5); + + if (var8.getMaterial() != Material.air) { + var21 = (double)Math.min(0.2F + (float)par6 / 15.0F, 10.0F); + + if (var21 > 2.5D) { + var21 = 2.5D; + } + + int var23 = (int)(150.0D * var21); + + for (int var24 = 0; var24 < var23; ++var24) { + float var25 = MathHelper.randomFloatClamp(var7, 0.0F, ((float)Math.PI * 2F)); + var26 = (double)MathHelper.randomFloatClamp(var7, 0.75F, 1.0F); + var28 = 0.20000000298023224D + var21 / 100.0D; + var30 = (double)(MathHelper.cos(var25) * 0.2F) * var26 * var26 * (var21 + 0.2D); + double var32 = (double)(MathHelper.sin(var25) * 0.2F) * var26 * var26 * (var21 + 0.2D); + this.theWorld.spawnParticle("blockdust_" + Block.getIdFromBlock(var8) + "_" + this.theWorld.getBlockMetadata(par3, par4, par5), (double)((float)par3 + 0.5F), (double)((float)par4 + 1.0F), (double)((float)par5 + 0.5F), var30, var28, var32); + } + } + } + } + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value + */ + public void destroyBlockPartially(int p_147587_1_, int p_147587_2_, int p_147587_3_, int p_147587_4_, int p_147587_5_) { + if (p_147587_5_ >= 0 && p_147587_5_ < 10) { + DestroyBlockProgress var6 = (DestroyBlockProgress)this.damagedBlocks.get(Integer.valueOf(p_147587_1_)); + + if (var6 == null || var6.getPartialBlockX() != p_147587_2_ || var6.getPartialBlockY() != p_147587_3_ || var6.getPartialBlockZ() != p_147587_4_) { + var6 = new DestroyBlockProgress(p_147587_1_, p_147587_2_, p_147587_3_, p_147587_4_); + this.damagedBlocks.put(Integer.valueOf(p_147587_1_), var6); + } + + var6.setPartialBlockDamage(p_147587_5_); + var6.setCloudUpdateTick(this.cloudTickCounter); + } else { + this.damagedBlocks.remove(Integer.valueOf(p_147587_1_)); + } + } + + public void registerDestroyBlockIcons(IIconRegister par1IconRegister) { + this.destroyBlockIcons = new IIcon[10]; + + for (int var2 = 0; var2 < this.destroyBlockIcons.length; ++var2) { + this.destroyBlockIcons[var2] = par1IconRegister.registerIcon("destroy_stage_" + var2); + } + } + + public void setAllRenderersVisible() { + if (this.worldRenderers != null) { + for (int i = 0; i < this.worldRenderers.length; ++i) { + this.worldRenderers[i].isVisible = true; + } + } + } + + public boolean isMoving(EntityLivingBase entityliving) { + boolean moving = this.isMovingNow(entityliving); + + if (moving) { + this.lastMovedTime = System.currentTimeMillis(); + return true; + } else { + return System.currentTimeMillis() - this.lastMovedTime < 2000L; + } + } + + private boolean isMovingNow(EntityLivingBase entityliving) { + double maxDiff = 0.001D; + return entityliving.isSneaking() || ((double) entityliving.prevSwingProgress > maxDiff || (this.mc.mouseHelper.deltaX != 0 || (this.mc.mouseHelper.deltaY != 0 || (Math.abs(entityliving.posX - entityliving.prevPosX) > maxDiff || (Math.abs(entityliving.posY - entityliving.prevPosY) > maxDiff || Math.abs(entityliving.posZ - entityliving.prevPosZ) > maxDiff))))); + } + + public boolean isActing() { + boolean acting = this.isActingNow(); + + if (acting) { + this.lastActionTime = System.currentTimeMillis(); + return true; + } else { + return System.currentTimeMillis() - this.lastActionTime < 500L; + } + } + + public boolean isActingNow() { + return Mouse.isButtonDown(0) ? true : Mouse.isButtonDown(1); + } + + public int renderAllSortedRenderers(int renderPass, double partialTicks) { + return this.renderSortedRenderers(0, this.countSortedWorldRenderers, renderPass, partialTicks); + } + + public void updateCapes() {} + + public AxisAlignedBB getTileEntityBoundingBox(TileEntity te) { + if (!te.hasWorldObj()) { + return AABB_INFINITE; + } else { + Block blockType = te.getBlockType(); + + if (blockType == Blocks.enchanting_table) { + return AxisAlignedBB.getBoundingBox((double)te.field_145851_c, (double)te.field_145848_d, (double)te.field_145849_e, (double)(te.field_145851_c + 1), (double)(te.field_145848_d + 1), (double)(te.field_145849_e + 1)); + } else if (blockType != Blocks.chest && blockType != Blocks.trapped_chest) { + AxisAlignedBB blockAabb; + + if (Reflector.ForgeTileEntity_getRenderBoundingBox.exists()) { + blockAabb = (AxisAlignedBB)Reflector.call(te, Reflector.ForgeTileEntity_getRenderBoundingBox, new Object[0]); + + if (blockAabb != null) { + return blockAabb; + } + } + + if (blockType != null && blockType != Blocks.beacon) { + blockAabb = blockType.getCollisionBoundingBoxFromPool(te.getWorldObj(), te.field_145851_c, te.field_145848_d, te.field_145849_e); + + if (blockAabb != null) { + return blockAabb; + } + } + + return AABB_INFINITE; + } else { + return AxisAlignedBB.getBoundingBox((double)(te.field_145851_c - 1), (double)te.field_145848_d, (double)(te.field_145849_e - 1), (double)(te.field_145851_c + 2), (double)(te.field_145848_d + 2), (double)(te.field_145849_e + 2)); + } + } + } + + public void addToSortedWorldRenderers(WorldRenderer wr) { + if (!wr.inSortedWorldRenderers) { + int pos = this.countSortedWorldRenderers; + wr.updateDistanceToEntitySquared(this.renderViewEntity); + float distSq = wr.sortDistanceToEntitySquared; + int countGreater; + + if (this.countSortedWorldRenderers > 0) { + countGreater = 0; + int high = this.countSortedWorldRenderers - 1; + int mid = (countGreater + high) / 2; + + while (countGreater <= high) { + mid = (countGreater + high) / 2; + WorldRenderer wrMid = this.sortedWorldRenderers[mid]; + + if (distSq < wrMid.sortDistanceToEntitySquared) { + high = mid - 1; + } else { + countGreater = mid + 1; + } + } + + if (countGreater > mid) { + pos = mid + 1; + } else { + pos = mid; + } + } + + countGreater = this.countSortedWorldRenderers - pos; + + if (countGreater > 0) { + System.arraycopy(this.sortedWorldRenderers, pos, this.sortedWorldRenderers, pos + 1, countGreater); + } + + this.sortedWorldRenderers[pos] = wr; + wr.inSortedWorldRenderers = true; + ++this.countSortedWorldRenderers; + } + } + + public int getCountRenderers() { + return this.renderersLoaded; + } + + public int getCountActiveRenderers() { + return this.renderersBeingRendered; + } + + public int getCountEntitiesRendered() { + return this.countEntitiesRendered; + } + + public int getCountTileEntitiesRendered() { + return this.countTileEntitiesRendered; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.~ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.~ new file mode 100644 index 0000000..724f3e4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderGlobal.~ @@ -0,0 +1,2566 @@ +package net.minecraft.client.renderer; + +import com.google.common.collect.Maps; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityAuraFX; +import net.minecraft.client.particle.EntityBlockDustFX; +import net.minecraft.client.particle.EntityBreakingFX; +import net.minecraft.client.particle.EntityBubbleFX; +import net.minecraft.client.particle.EntityCloudFX; +import net.minecraft.client.particle.EntityCritFX; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.particle.EntityDropParticleFX; +import net.minecraft.client.particle.EntityEnchantmentTableParticleFX; +import net.minecraft.client.particle.EntityExplodeFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntityFireworkSparkFX; +import net.minecraft.client.particle.EntityFishWakeFX; +import net.minecraft.client.particle.EntityFlameFX; +import net.minecraft.client.particle.EntityFootStepFX; +import net.minecraft.client.particle.EntityHeartFX; +import net.minecraft.client.particle.EntityHugeExplodeFX; +import net.minecraft.client.particle.EntityLargeExplodeFX; +import net.minecraft.client.particle.EntityLavaFX; +import net.minecraft.client.particle.EntityNoteFX; +import net.minecraft.client.particle.EntityPortalFX; +import net.minecraft.client.particle.EntityReddustFX; +import net.minecraft.client.particle.EntitySmokeFX; +import net.minecraft.client.particle.EntitySnowShovelFX; +import net.minecraft.client.particle.EntitySpellParticleFX; +import net.minecraft.client.particle.EntitySplashFX; +import net.minecraft.client.particle.EntitySuspendFX; +import net.minecraft.client.renderer.DestroyBlockProgress; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.OpenGlCapsChecker; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.RenderList; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.util.RenderDistanceSorter; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemRecord; +import net.minecraft.profiler.Profiler; +import net.minecraft.src.CompactArrayList; +import net.minecraft.src.Config; +import net.minecraft.src.CustomColorizer; +import net.minecraft.src.CustomSky; +import net.minecraft.src.DynamicLights; +import net.minecraft.src.EntitySorterFast; +import net.minecraft.src.RandomMobs; +import net.minecraft.src.Reflector; +import net.minecraft.src.WrDisplayListAllocator; +import net.minecraft.src.WrUpdates; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.IWorldAccess; +import net.minecraft.world.WorldProvider; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.ARBOcclusionQuery; +import org.lwjgl.opengl.GL11; + +public class RenderGlobal implements IWorldAccess { + + private static final Logger field_147599_m = LogManager.getLogger(); + private static final ResourceLocation field_110927_h = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation field_110928_i = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation field_110925_j = new ResourceLocation("textures/environment/clouds.png"); + private static final ResourceLocation field_110926_k = new ResourceLocation("textures/environment/end_sky.png"); + public List field_147598_a = new ArrayList(); + public WorldClient field_72769_h; + public final TextureManager field_72770_i; + public CompactArrayList field_72767_j = new CompactArrayList(100, 0.8F); + private WorldRenderer[] field_72768_k; + private WorldRenderer[] field_72765_l; + private int field_72766_m; + private int field_72763_n; + private int field_72764_o; + public int field_72778_p; + public Minecraft field_72777_q; + public RenderBlocks field_147592_B; + private IntBuffer field_72775_s; + private boolean field_72774_t; + private int field_72773_u; + private int field_72772_v; + private int field_72771_w; + private int field_72781_x; + private int field_72780_y; + private int field_72779_z; + private int field_72741_A; + private int field_72742_B; + private int field_72743_C; + private int field_72737_D; + public final Map field_72738_E = new HashMap(); + private final Map field_147593_P = Maps.newHashMap(); + private IIcon[] field_94141_F; + private boolean field_147595_R; + private int field_147594_S; + private int field_72739_F = -1; + private int field_72740_G = 2; + private int field_72748_H; + private int field_72749_I; + private int field_72750_J; + IntBuffer field_72761_c = GLAllocation.func_74527_f(64); + private int field_72751_K; + private int field_72744_L; + private int field_72745_M; + private int field_72746_N; + private int field_72747_O; + private int field_72753_P; + private int field_72752_Q; + private List field_72755_R = new ArrayList(); + private RenderList[] field_72754_S = new RenderList[]{new RenderList(), new RenderList(), new RenderList(), new RenderList()}; + double field_72758_d = -9999.0D; + double field_72759_e = -9999.0D; + double field_72756_f = -9999.0D; + double field_147596_f = -9999.0D; + double field_147597_g = -9999.0D; + double field_147602_h = -9999.0D; + int field_147603_i = -999; + int field_147600_j = -999; + int field_147601_k = -999; + int field_72757_g; + private static final String __OBFID = "CL_00000954"; + private IntBuffer glListBuffer = BufferUtils.createIntBuffer(65536); + double prevReposX; + double prevReposY; + double prevReposZ; + public Entity renderedEntity; + private int glListClouds = -1; + private boolean isFancyGlListClouds = false; + private int cloudTickCounterGlList = -99999; + private double cloudPlayerX = 0.0D; + private double cloudPlayerY = 0.0D; + private double cloudPlayerZ = 0.0D; + private int countSortedWorldRenderers = 0; + private int effectivePreloadedChunks = 0; + private int vertexResortCounter = 30; + public WrDisplayListAllocator displayListAllocator = new WrDisplayListAllocator(); + public EntityLivingBase renderViewEntity; + private int countTileEntitiesRendered; + private long lastMovedTime = System.currentTimeMillis(); + private long lastActionTime = System.currentTimeMillis(); + private static AxisAlignedBB AABB_INFINITE = AxisAlignedBB.func_72330_a(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); + private static final String __OBFID = "CL_00000954"; + + public RenderGlobal(Minecraft par1Minecraft) { + this.glListClouds = GLAllocation.func_74526_a(1); + this.field_72777_q = par1Minecraft; + this.field_72770_i = par1Minecraft.func_110434_K(); + byte maxChunkDim = 65; + byte maxChunkHeight = 16; + int countWorldRenderers = maxChunkDim * maxChunkDim * maxChunkHeight; + int countStandardRenderLists = countWorldRenderers * 3; + this.field_72778_p = GLAllocation.func_74526_a(countStandardRenderLists); + this.field_147595_R = false; + this.field_147594_S = GLAllocation.func_74526_a(1); + this.field_72774_t = OpenGlCapsChecker.func_74371_a(); + if(this.field_72774_t) { + this.field_72761_c.clear(); + this.field_72775_s = GLAllocation.func_74527_f(maxChunkDim * maxChunkDim * maxChunkHeight); + this.field_72775_s.clear(); + this.field_72775_s.position(0); + this.field_72775_s.limit(maxChunkDim * maxChunkDim * maxChunkHeight); + ARBOcclusionQuery.glGenQueriesARB(this.field_72775_s); + } + + this.field_72772_v = GLAllocation.func_74526_a(3); + GL11.glPushMatrix(); + GL11.glNewList(this.field_72772_v, 4864); + this.func_72730_g(); + GL11.glEndList(); + GL11.glPopMatrix(); + Tessellator var4 = Tessellator.field_78398_a; + this.field_72771_w = this.field_72772_v + 1; + GL11.glNewList(this.field_72771_w, 4864); + byte var6 = 64; + int var7 = 256 / var6 + 2; + float var5 = 16.0F; + + int var8; + int var9; + for(var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { + for(var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { + var4.func_78382_b(); + var4.func_78377_a((double)(var8 + 0), (double)var5, (double)(var9 + 0)); + var4.func_78377_a((double)(var8 + var6), (double)var5, (double)(var9 + 0)); + var4.func_78377_a((double)(var8 + var6), (double)var5, (double)(var9 + var6)); + var4.func_78377_a((double)(var8 + 0), (double)var5, (double)(var9 + var6)); + var4.func_78381_a(); + } + } + + GL11.glEndList(); + this.field_72781_x = this.field_72772_v + 2; + GL11.glNewList(this.field_72781_x, 4864); + var5 = -16.0F; + var4.func_78382_b(); + + for(var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { + for(var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { + var4.func_78377_a((double)(var8 + var6), (double)var5, (double)(var9 + 0)); + var4.func_78377_a((double)(var8 + 0), (double)var5, (double)(var9 + 0)); + var4.func_78377_a((double)(var8 + 0), (double)var5, (double)(var9 + var6)); + var4.func_78377_a((double)(var8 + var6), (double)var5, (double)(var9 + var6)); + } + } + + var4.func_78381_a(); + GL11.glEndList(); + } + + private void func_72730_g() { + Random var1 = new Random(10842L); + Tessellator var2 = Tessellator.field_78398_a; + var2.func_78382_b(); + + for(int var3 = 0; var3 < 1500; ++var3) { + double var4 = (double)(var1.nextFloat() * 2.0F - 1.0F); + double var6 = (double)(var1.nextFloat() * 2.0F - 1.0F); + double var8 = (double)(var1.nextFloat() * 2.0F - 1.0F); + double var10 = (double)(0.15F + var1.nextFloat() * 0.1F); + double var12 = var4 * var4 + var6 * var6 + var8 * var8; + if(var12 < 1.0D && var12 > 0.01D) { + var12 = 1.0D / Math.sqrt(var12); + var4 *= var12; + var6 *= var12; + var8 *= var12; + double var14 = var4 * 100.0D; + double var16 = var6 * 100.0D; + double var18 = var8 * 100.0D; + double var20 = Math.atan2(var4, var8); + double var22 = Math.sin(var20); + double var24 = Math.cos(var20); + double var26 = Math.atan2(Math.sqrt(var4 * var4 + var8 * var8), var6); + double var28 = Math.sin(var26); + double var30 = Math.cos(var26); + double var32 = var1.nextDouble() * 3.141592653589793D * 2.0D; + double var34 = Math.sin(var32); + double var36 = Math.cos(var32); + + for(int var38 = 0; var38 < 4; ++var38) { + double var39 = 0.0D; + double var41 = (double)((var38 & 2) - 1) * var10; + double var43 = (double)((var38 + 1 & 2) - 1) * var10; + double var47 = var41 * var36 - var43 * var34; + double var49 = var43 * var36 + var41 * var34; + double var53 = var47 * var28 + var39 * var30; + double var55 = var39 * var28 - var47 * var30; + double var57 = var55 * var22 - var49 * var24; + double var61 = var49 * var22 + var55 * var24; + var2.func_78377_a(var14 + var57, var16 + var53, var18 + var61); + } + } + } + + var2.func_78381_a(); + } + + public void func_72732_a(WorldClient par1WorldClient) { + if(this.field_72769_h != null) { + this.field_72769_h.func_72848_b(this); + } + + this.field_72758_d = -9999.0D; + this.field_72759_e = -9999.0D; + this.field_72756_f = -9999.0D; + this.field_147596_f = -9999.0D; + this.field_147597_g = -9999.0D; + this.field_147602_h = -9999.0D; + this.field_147603_i = -9999; + this.field_147600_j = -9999; + this.field_147601_k = -9999; + RenderManager.field_78727_a.func_78717_a(par1WorldClient); + this.field_72769_h = par1WorldClient; + this.field_147592_B = new RenderBlocks(par1WorldClient); + if(Config.isDynamicLights()) { + DynamicLights.clear(); + } + + if(par1WorldClient != null) { + par1WorldClient.func_72954_a(this); + this.func_72712_a(); + } + + } + + public void func_72712_a() { + if(this.field_72769_h != null) { + Blocks.field_150362_t.func_150122_b(Config.isTreesFancy()); + Blocks.field_150361_u.func_150122_b(Config.isTreesFancy()); + this.field_72739_F = this.field_72777_q.field_71474_y.field_151451_c; + WrUpdates.clearAllUpdates(); + int numChunks; + if(this.field_72765_l != null) { + for(numChunks = 0; numChunks < this.field_72765_l.length; ++numChunks) { + this.field_72765_l[numChunks].func_78911_c(); + } + } + + if(Config.isDynamicLights()) { + DynamicLights.clear(); + } + + numChunks = this.field_72777_q.field_71474_y.field_151451_c; + byte numChunksFar = 16; + if(Config.isLoadChunksFar() && numChunks < numChunksFar) { + numChunks = numChunksFar; + } + + int maxPreloadedChunks = Config.limit(numChunksFar - numChunks, 0, 8); + this.effectivePreloadedChunks = Config.limit(Config.getPreloadedChunks(), 0, maxPreloadedChunks); + numChunks += this.effectivePreloadedChunks; + byte limit = 32; + if(numChunks > limit) { + numChunks = limit; + } + + this.prevReposX = -9999.0D; + this.prevReposY = -9999.0D; + this.prevReposZ = -9999.0D; + int var1 = numChunks * 2 + 1; + this.field_72766_m = var1; + this.field_72763_n = 16; + this.field_72764_o = var1; + this.field_72765_l = new WorldRenderer[this.field_72766_m * this.field_72763_n * this.field_72764_o]; + this.field_72768_k = new WorldRenderer[this.field_72766_m * this.field_72763_n * this.field_72764_o]; + this.countSortedWorldRenderers = 0; + this.displayListAllocator.resetAllocatedLists(); + int var2 = 0; + int var3 = 0; + this.field_72780_y = 0; + this.field_72779_z = 0; + this.field_72741_A = 0; + this.field_72742_B = this.field_72766_m; + this.field_72743_C = this.field_72763_n; + this.field_72737_D = this.field_72764_o; + + int var10; + for(var10 = 0; var10 < this.field_72767_j.size(); ++var10) { + WorldRenderer esf = (WorldRenderer)this.field_72767_j.get(var10); + if(esf != null) { + esf.field_78939_q = false; + } + } + + this.field_72767_j.clear(); + this.field_147598_a.clear(); + this.func_147584_b(); + + for(var10 = 0; var10 < this.field_72766_m; ++var10) { + for(int var14 = 0; var14 < this.field_72763_n; ++var14) { + for(int cz = 0; cz < this.field_72764_o; ++cz) { + int wri = (cz * this.field_72763_n + var14) * this.field_72766_m + var10; + this.field_72765_l[wri] = WrUpdates.makeWorldRenderer(this.field_72769_h, this.field_147598_a, var10 * 16, var14 * 16, cz * 16, this.field_72778_p + var2); + if(this.field_72774_t) { + this.field_72765_l[wri].field_78934_v = this.field_72775_s.get(var3); + } + + this.field_72765_l[wri].field_78935_u = false; + this.field_72765_l[wri].field_78936_t = true; + this.field_72765_l[wri].field_78927_l = false; + this.field_72765_l[wri].field_78937_s = var3++; + if(this.field_72769_h.func_72899_e(var10 << 4, 0, cz << 4)) { + this.field_72765_l[wri].func_78914_f(); + this.field_72767_j.add(this.field_72765_l[wri]); + } + + var2 += 3; + } + } + } + + if(this.field_72769_h != null) { + Object var13 = this.field_72777_q.field_71451_h; + if(var13 == null) { + var13 = this.field_72777_q.field_71439_g; + } + + if(var13 != null) { + this.func_72722_c(MathHelper.func_76128_c(((EntityLivingBase)var13).field_70165_t), MathHelper.func_76128_c(((EntityLivingBase)var13).field_70163_u), MathHelper.func_76128_c(((EntityLivingBase)var13).field_70161_v)); + EntitySorterFast var15 = new EntitySorterFast((Entity)var13); + var15.prepareToSort(this.field_72768_k, this.countSortedWorldRenderers); + Arrays.sort(this.field_72768_k, 0, this.countSortedWorldRenderers, var15); + } + } + + this.field_72740_G = 2; + } + + } + + public void func_147589_a(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) { + int pass = 0; + if(Reflector.MinecraftForgeClient_getRenderPass.exists()) { + pass = Reflector.callInt(Reflector.MinecraftForgeClient_getRenderPass, new Object[0]); + } + + boolean hasEntityShouldRenderInPass = Reflector.ForgeEntity_shouldRenderInPass.exists(); + boolean hasTileEntityShouldRenderInPass = Reflector.ForgeTileEntity_shouldRenderInPass.exists(); + if(this.field_72740_G > 0) { + if(pass > 0) { + return; + } + + --this.field_72740_G; + } else { + double var4 = p_147589_1_.field_70169_q + (p_147589_1_.field_70165_t - p_147589_1_.field_70169_q) * (double)p_147589_3_; + double var6 = p_147589_1_.field_70167_r + (p_147589_1_.field_70163_u - p_147589_1_.field_70167_r) * (double)p_147589_3_; + double var8 = p_147589_1_.field_70166_s + (p_147589_1_.field_70161_v - p_147589_1_.field_70166_s) * (double)p_147589_3_; + this.field_72769_h.field_72984_F.func_76320_a("prepare"); + TileEntityRendererDispatcher.field_147556_a.func_147542_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, p_147589_3_); + RenderManager.field_78727_a.func_147938_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_147589_3_); + if(pass == 0) { + this.field_72748_H = 0; + this.field_72749_I = 0; + this.field_72750_J = 0; + this.countTileEntitiesRendered = 0; + EntityLivingBase var17 = this.field_72777_q.field_71451_h; + double var18 = var17.field_70142_S + (var17.field_70165_t - var17.field_70142_S) * (double)p_147589_3_; + double oldFancyGraphics = var17.field_70137_T + (var17.field_70163_u - var17.field_70137_T) * (double)p_147589_3_; + double aabb = var17.field_70136_U + (var17.field_70161_v - var17.field_70136_U) * (double)p_147589_3_; + TileEntityRendererDispatcher.field_147554_b = var18; + TileEntityRendererDispatcher.field_147555_c = oldFancyGraphics; + TileEntityRendererDispatcher.field_147552_d = aabb; + this.field_72769_h.field_72984_F.func_76318_c("staticentities"); + if(this.field_147595_R) { + RenderManager.field_78725_b = 0.0D; + RenderManager.field_78726_c = 0.0D; + RenderManager.field_78723_d = 0.0D; + this.func_147591_f(); + } + + GL11.glMatrixMode(5888); + GL11.glPushMatrix(); + GL11.glTranslated(-var18, -oldFancyGraphics, -aabb); + GL11.glCallList(this.field_147594_S); + GL11.glPopMatrix(); + RenderManager.field_78725_b = var18; + RenderManager.field_78726_c = oldFancyGraphics; + RenderManager.field_78723_d = aabb; + } + + this.field_72777_q.field_71460_t.func_78463_b((double)p_147589_3_); + this.field_72769_h.field_72984_F.func_76318_c("global"); + List var24 = this.field_72769_h.func_72910_y(); + if(pass == 0) { + this.field_72748_H = var24.size(); + } + + if(Config.isFogOff() && this.field_72777_q.field_71460_t.fogStandard) { + GL11.glDisable(2912); + } + + Entity var19; + int var25; + for(var25 = 0; var25 < this.field_72769_h.field_73007_j.size(); ++var25) { + var19 = (Entity)this.field_72769_h.field_73007_j.get(var25); + if(!hasEntityShouldRenderInPass || Reflector.callBoolean(var19, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(pass)})) { + ++this.field_72749_I; + if(var19.func_145770_h(var4, var6, var8)) { + RenderManager.field_78727_a.func_147937_a(var19, p_147589_3_); + } + } + } + + this.field_72769_h.field_72984_F.func_76318_c("entities"); + boolean var26 = this.field_72777_q.field_71474_y.field_74347_j; + this.field_72777_q.field_71474_y.field_74347_j = Config.isDroppedItemsFancy(); + + for(var25 = 0; var25 < var24.size(); ++var25) { + var19 = (Entity)var24.get(var25); + if(!hasEntityShouldRenderInPass || Reflector.callBoolean(var19, Reflector.ForgeEntity_shouldRenderInPass, new Object[]{Integer.valueOf(pass)})) { + boolean te = var19.func_145770_h(var4, var6, var8) && (var19.field_70158_ak || p_147589_2_.func_78546_a(var19.field_70121_D) || var19.field_70153_n == this.field_72777_q.field_71439_g); + if(!te && var19 instanceof EntityLiving) { + EntityLiving var28 = (EntityLiving)var19; + if(var28.func_110167_bD() && var28.func_110166_bE() != null) { + Entity teClass = var28.func_110166_bE(); + te = p_147589_2_.func_78546_a(teClass.field_70121_D); + } + } + + if(te && (var19 != this.field_72777_q.field_71451_h || this.field_72777_q.field_71474_y.field_74320_O != 0 || this.field_72777_q.field_71451_h.func_70608_bn()) && this.field_72769_h.func_72899_e(MathHelper.func_76128_c(var19.field_70165_t), 0, MathHelper.func_76128_c(var19.field_70161_v))) { + ++this.field_72749_I; + if(var19.getClass() == EntityItemFrame.class) { + var19.field_70155_l = 0.06D; + } + + this.renderedEntity = var19; + RenderManager.field_78727_a.func_147937_a(var19, p_147589_3_); + this.renderedEntity = null; + } + } + } + + this.field_72777_q.field_71474_y.field_74347_j = var26; + this.field_72769_h.field_72984_F.func_76318_c("blockentities"); + RenderHelper.func_74519_b(); + + for(var25 = 0; var25 < this.field_147598_a.size(); ++var25) { + TileEntity var27 = (TileEntity)this.field_147598_a.get(var25); + if(!hasTileEntityShouldRenderInPass || Reflector.callBoolean(var27, Reflector.ForgeTileEntity_shouldRenderInPass, new Object[]{Integer.valueOf(pass)})) { + AxisAlignedBB var29 = this.getTileEntityBoundingBox(var27); + if(var29 == AABB_INFINITE || p_147589_2_.func_78546_a(var29)) { + Class var30 = var27.getClass(); + if(var30 == TileEntitySign.class && !Config.zoomMode) { + EntityClientPlayerMP block = this.field_72777_q.field_71439_g; + double distSq = var27.func_145835_a(block.field_70165_t, block.field_70163_u, block.field_70161_v); + if(distSq > 256.0D) { + FontRenderer fr = TileEntityRendererDispatcher.field_147556_a.func_147548_a(); + fr.enabled = false; + TileEntityRendererDispatcher.field_147556_a.func_147544_a(var27, p_147589_3_); + ++this.countTileEntitiesRendered; + fr.enabled = true; + continue; + } + } + + if(var30 == TileEntityChest.class) { + Block var31 = this.field_72769_h.func_147439_a(var27.field_145851_c, var27.field_145848_d, var27.field_145849_e); + if(!(var31 instanceof BlockChest)) { + continue; + } + } + + TileEntityRendererDispatcher.field_147556_a.func_147544_a(var27, p_147589_3_); + ++this.countTileEntitiesRendered; + } + } + } + + this.field_72777_q.field_71460_t.func_78483_a((double)p_147589_3_); + this.field_72769_h.field_72984_F.func_76319_b(); + } + + } + + public String func_72735_c() { + return "C: " + this.field_72746_N + "/" + this.field_72751_K + ". F: " + this.field_72744_L + ", O: " + this.field_72745_M + ", E: " + this.field_72747_O; + } + + public String func_72723_d() { + return "E: " + this.field_72749_I + "/" + this.field_72748_H + ". B: " + this.field_72750_J + ", I: " + (this.field_72748_H - this.field_72750_J - this.field_72749_I) + ", " + Config.getVersionDebug(); + } + + public void func_147584_b() { + this.field_147595_R = true; + } + + public void func_147591_f() { + this.field_72769_h.field_72984_F.func_76320_a("staticentityrebuild"); + GL11.glPushMatrix(); + GL11.glNewList(this.field_147594_S, 4864); + List var1 = this.field_72769_h.func_72910_y(); + this.field_147595_R = false; + + for(int var2 = 0; var2 < var1.size(); ++var2) { + Entity var3 = (Entity)var1.get(var2); + if(RenderManager.field_78727_a.func_78713_a(var3).func_147905_a()) { + this.field_147595_R = this.field_147595_R || !RenderManager.field_78727_a.func_147936_a(var3, 0.0F, true); + } + } + + GL11.glEndList(); + GL11.glPopMatrix(); + this.field_72769_h.field_72984_F.func_76319_b(); + } + + private void func_72722_c(int x, int y, int z) { + x -= 8; + y -= 8; + z -= 8; + this.field_72780_y = Integer.MAX_VALUE; + this.field_72779_z = Integer.MAX_VALUE; + this.field_72741_A = Integer.MAX_VALUE; + this.field_72742_B = Integer.MIN_VALUE; + this.field_72743_C = Integer.MIN_VALUE; + this.field_72737_D = Integer.MIN_VALUE; + int blocksWide = this.field_72766_m * 16; + int blocksWide2 = blocksWide / 2; + + for(int ix = 0; ix < this.field_72766_m; ++ix) { + int blockX = ix * 16; + int blockXAbs = blockX + blocksWide2 - x; + if(blockXAbs < 0) { + blockXAbs -= blocksWide - 1; + } + + blockXAbs /= blocksWide; + blockX -= blockXAbs * blocksWide; + if(blockX < this.field_72780_y) { + this.field_72780_y = blockX; + } + + if(blockX > this.field_72742_B) { + this.field_72742_B = blockX; + } + + for(int iz = 0; iz < this.field_72764_o; ++iz) { + int blockZ = iz * 16; + int blockZAbs = blockZ + blocksWide2 - z; + if(blockZAbs < 0) { + blockZAbs -= blocksWide - 1; + } + + blockZAbs /= blocksWide; + blockZ -= blockZAbs * blocksWide; + if(blockZ < this.field_72741_A) { + this.field_72741_A = blockZ; + } + + if(blockZ > this.field_72737_D) { + this.field_72737_D = blockZ; + } + + for(int iy = 0; iy < this.field_72763_n; ++iy) { + int blockY = iy * 16; + if(blockY < this.field_72779_z) { + this.field_72779_z = blockY; + } + + if(blockY > this.field_72743_C) { + this.field_72743_C = blockY; + } + + WorldRenderer worldrenderer = this.field_72765_l[(iz * this.field_72763_n + iy) * this.field_72766_m + ix]; + boolean wasNeedingUpdate = worldrenderer.field_78939_q; + worldrenderer.func_78913_a(blockX, blockY, blockZ); + if(!wasNeedingUpdate && worldrenderer.field_78939_q) { + this.field_72767_j.add(worldrenderer); + } + } + } + } + + } + + public int func_72719_a(EntityLivingBase player, int renderPass, double partialTicks) { + this.renderViewEntity = player; + if(Config.isDynamicLights()) { + DynamicLights.update(this); + } + + Profiler profiler = this.field_72769_h.field_72984_F; + profiler.func_76320_a("sortchunks"); + int num; + if(this.field_72767_j.size() < 10) { + byte shouldSort = 10; + + for(num = 0; num < shouldSort; ++num) { + this.field_72752_Q = (this.field_72752_Q + 1) % this.field_72765_l.length; + WorldRenderer ocReq = this.field_72765_l[this.field_72752_Q]; + if(ocReq.field_78939_q && !this.field_72767_j.contains(ocReq)) { + this.field_72767_j.add(ocReq); + } + } + } + + if(this.field_72777_q.field_71474_y.field_151451_c != this.field_72739_F && !Config.isLoadChunksFar()) { + this.func_72712_a(); + } + + if(renderPass == 0) { + this.field_72751_K = 0; + this.field_72753_P = 0; + this.field_72744_L = 0; + this.field_72745_M = 0; + this.field_72746_N = 0; + this.field_72747_O = 0; + } + + boolean var33 = this.field_147603_i != player.field_70176_ah || this.field_147600_j != player.field_70162_ai || this.field_147601_k != player.field_70164_aj; + double partialX; + double partialY; + double partialZ; + double var34; + if(!var33) { + var34 = player.field_70165_t - this.field_72758_d; + partialX = player.field_70163_u - this.field_72759_e; + partialY = player.field_70161_v - this.field_72756_f; + partialZ = var34 * var34 + partialX * partialX + partialY * partialY; + var33 = partialZ > 16.0D; + } + + int endIndex; + int stepNum; + if(var33) { + this.field_147603_i = player.field_70176_ah; + this.field_147600_j = player.field_70162_ai; + this.field_147601_k = player.field_70164_aj; + this.field_72758_d = player.field_70165_t; + this.field_72759_e = player.field_70163_u; + this.field_72756_f = player.field_70161_v; + num = this.effectivePreloadedChunks * 16; + double var36 = player.field_70165_t - this.prevReposX; + double dReposY = player.field_70163_u - this.prevReposY; + double dReposZ = player.field_70161_v - this.prevReposZ; + double countResort = var36 * var36 + dReposY * dReposY + dReposZ * dReposZ; + if(countResort > (double)(num * num) + 16.0D) { + this.prevReposX = player.field_70165_t; + this.prevReposY = player.field_70163_u; + this.prevReposZ = player.field_70161_v; + this.func_72722_c(MathHelper.func_76128_c(player.field_70165_t), MathHelper.func_76128_c(player.field_70163_u), MathHelper.func_76128_c(player.field_70161_v)); + } + + EntitySorterFast lastIndex = new EntitySorterFast(player); + lastIndex.prepareToSort(this.field_72768_k, this.countSortedWorldRenderers); + Arrays.sort(this.field_72768_k, 0, this.countSortedWorldRenderers, lastIndex); + if(Config.isFastRender()) { + endIndex = (int)player.field_70165_t; + stepNum = (int)player.field_70161_v; + short step = 2000; + if(Math.abs(endIndex - WorldRenderer.globalChunkOffsetX) > step || Math.abs(stepNum - WorldRenderer.globalChunkOffsetZ) > step) { + WorldRenderer.globalChunkOffsetX = endIndex; + WorldRenderer.globalChunkOffsetZ = stepNum; + this.func_72712_a(); + } + } + } + + if(Config.isTranslucentBlocksFancy()) { + var34 = player.field_70165_t - this.field_147596_f; + partialX = player.field_70163_u - this.field_147597_g; + partialY = player.field_70161_v - this.field_147602_h; + int var39 = Math.min(27, this.countSortedWorldRenderers); + WorldRenderer firstIndex; + if(var34 * var34 + partialX * partialX + partialY * partialY > 1.0D) { + this.field_147596_f = player.field_70165_t; + this.field_147597_g = player.field_70163_u; + this.field_147602_h = player.field_70161_v; + + for(int var38 = 0; var38 < var39; ++var38) { + firstIndex = this.field_72768_k[var38]; + if(firstIndex.field_147894_y != null && firstIndex.sortDistanceToEntitySquared < 1152.0F) { + firstIndex.needVertexStateResort = true; + if(this.vertexResortCounter > var38) { + this.vertexResortCounter = var38; + } + } + } + } + + if(this.vertexResortCounter < var39) { + while(this.vertexResortCounter < var39) { + firstIndex = this.field_72768_k[this.vertexResortCounter]; + ++this.vertexResortCounter; + if(firstIndex.needVertexStateResort) { + firstIndex.func_147889_b(player); + break; + } + } + } + } + + RenderHelper.func_74518_a(); + WrUpdates.preRender(this, player); + if(this.field_72777_q.field_71474_y.ofSmoothFps && renderPass == 0) { + GL11.glFinish(); + } + + byte var35 = 0; + int var37 = 0; + if(this.field_72774_t && this.field_72777_q.field_71474_y.field_74349_h && !this.field_72777_q.field_71474_y.field_74337_g && renderPass == 0) { + partialX = player.field_70142_S + (player.field_70165_t - player.field_70142_S) * partialTicks; + partialY = player.field_70137_T + (player.field_70163_u - player.field_70137_T) * partialTicks; + partialZ = player.field_70136_U + (player.field_70161_v - player.field_70136_U) * partialTicks; + byte var40 = 0; + int var41 = Math.min(20, this.countSortedWorldRenderers); + this.checkOcclusionQueryResult(var40, var41, player.field_70165_t, player.field_70163_u, player.field_70161_v); + + for(endIndex = var40; endIndex < var41; ++endIndex) { + this.field_72768_k[endIndex].field_78936_t = true; + } + + profiler.func_76318_c("render"); + num = var35 + this.func_72724_a(var40, var41, renderPass, partialTicks); + endIndex = var41; + stepNum = 0; + byte var42 = 40; + + int startIndex; + for(int switchStep = this.field_72766_m; endIndex < this.countSortedWorldRenderers; num += this.func_72724_a(startIndex, endIndex, renderPass, partialTicks)) { + profiler.func_76318_c("occ"); + startIndex = endIndex; + if(stepNum < switchStep) { + ++stepNum; + } else { + --stepNum; + } + + endIndex += stepNum * var42; + if(endIndex <= startIndex) { + endIndex = startIndex + 10; + } + + if(endIndex > this.countSortedWorldRenderers) { + endIndex = this.countSortedWorldRenderers; + } + + GL11.glDisable(3553); + GL11.glDisable(2896); + GL11.glDisable(3008); + GL11.glDisable(2912); + GL11.glColorMask(false, false, false, false); + GL11.glDepthMask(false); + profiler.func_76320_a("check"); + this.checkOcclusionQueryResult(startIndex, endIndex, player.field_70165_t, player.field_70163_u, player.field_70161_v); + profiler.func_76319_b(); + GL11.glPushMatrix(); + float sumTX = 0.0F; + float sumTY = 0.0F; + float sumTZ = 0.0F; + + for(int k = startIndex; k < endIndex; ++k) { + WorldRenderer wr = this.field_72768_k[k]; + if(wr.func_78906_e()) { + wr.field_78927_l = false; + } else if(!wr.isUpdating && !wr.needsBoxUpdate) { + if(wr.field_78927_l) { + if(Config.isOcclusionFancy() && !wr.isInFrustrumFully) { + wr.field_78936_t = true; + } else if(wr.field_78927_l && !wr.field_78935_u) { + float bbX; + float bbY; + float bbZ; + float tX; + if(wr.isVisibleFromPosition) { + bbX = Math.abs((float)(wr.visibleFromX - player.field_70165_t)); + bbY = Math.abs((float)(wr.visibleFromY - player.field_70163_u)); + bbZ = Math.abs((float)(wr.visibleFromZ - player.field_70161_v)); + tX = bbX + bbY + bbZ; + if((double)tX < 10.0D + (double)k / 1000.0D) { + wr.field_78936_t = true; + continue; + } + + wr.isVisibleFromPosition = false; + } + + bbX = (float)((double)wr.field_78918_f - partialX); + bbY = (float)((double)wr.field_78919_g - partialY); + bbZ = (float)((double)wr.field_78931_h - partialZ); + tX = bbX - sumTX; + float tY = bbY - sumTY; + float tZ = bbZ - sumTZ; + if(tX != 0.0F || tY != 0.0F || tZ != 0.0F) { + GL11.glTranslatef(tX, tY, tZ); + sumTX += tX; + sumTY += tY; + sumTZ += tZ; + } + + profiler.func_76320_a("bb"); + ARBOcclusionQuery.glBeginQueryARB('\u8914', wr.field_78934_v); + wr.func_78904_d(); + ARBOcclusionQuery.glEndQueryARB('\u8914'); + profiler.func_76319_b(); + wr.field_78935_u = true; + ++var37; + } + } + } else { + wr.field_78936_t = true; + } + } + + GL11.glPopMatrix(); + if(this.field_72777_q.field_71474_y.field_74337_g) { + if(EntityRenderer.field_78515_b == 0) { + GL11.glColorMask(false, true, true, true); + } else { + GL11.glColorMask(true, false, false, true); + } + } else { + GL11.glColorMask(true, true, true, true); + } + + GL11.glDepthMask(true); + GL11.glEnable(3553); + GL11.glEnable(3008); + GL11.glEnable(2912); + profiler.func_76318_c("render"); + } + } else { + profiler.func_76318_c("render"); + num = var35 + this.func_72724_a(0, this.countSortedWorldRenderers, renderPass, partialTicks); + } + + profiler.func_76319_b(); + WrUpdates.postRender(); + return num; + } + + private void checkOcclusionQueryResult(int startIndex, int endIndex, double px, double py, double pz) { + for(int k = startIndex; k < endIndex; ++k) { + WorldRenderer wr = this.field_72768_k[k]; + if(wr.field_78935_u) { + this.field_72761_c.clear(); + ARBOcclusionQuery.glGetQueryObjectuARB(wr.field_78934_v, '\u8867', this.field_72761_c); + if(this.field_72761_c.get(0) != 0) { + wr.field_78935_u = false; + this.field_72761_c.clear(); + ARBOcclusionQuery.glGetQueryObjectuARB(wr.field_78934_v, '\u8866', this.field_72761_c); + if(!wr.isUpdating && !wr.needsBoxUpdate) { + boolean wasVisible = wr.field_78936_t; + wr.field_78936_t = this.field_72761_c.get(0) > 0; + if(wasVisible && wr.field_78936_t) { + wr.isVisibleFromPosition = true; + wr.visibleFromX = px; + wr.visibleFromY = py; + wr.visibleFromZ = pz; + } + } else { + wr.field_78936_t = true; + } + } + } + } + + } + + private int func_72724_a(int par1, int par2, int par3, double par4) { + if(Config.isFastRender()) { + return this.renderSortedRenderersFast(par1, par2, par3, par4); + } else { + this.field_72755_R.clear(); + int var6 = 0; + int var7 = par1; + int var8 = par2; + byte var9 = 1; + if(par3 == 1) { + var7 = this.countSortedWorldRenderers - 1 - par1; + var8 = this.countSortedWorldRenderers - 1 - par2; + var9 = -1; + } + + for(int var22 = var7; var22 != var8; var22 += var9) { + if(par3 == 0) { + ++this.field_72751_K; + if(this.field_72768_k[var22].field_78928_m[par3]) { + ++this.field_72747_O; + } else if(!this.field_72768_k[var22].field_78927_l) { + ++this.field_72744_L; + } else if(this.field_72774_t && !this.field_72768_k[var22].field_78936_t) { + ++this.field_72745_M; + } else { + ++this.field_72746_N; + } + } + + if(!this.field_72768_k[var22].field_78928_m[par3] && this.field_72768_k[var22].field_78927_l && (!this.field_72774_t || this.field_72768_k[var22].field_78936_t)) { + int var23 = this.field_72768_k[var22].func_78909_a(par3); + if(var23 >= 0) { + this.field_72755_R.add(this.field_72768_k[var22]); + ++var6; + } + } + } + + if(var6 == 0) { + return 0; + } else { + EntityLivingBase var221 = this.field_72777_q.field_71451_h; + double var231 = var221.field_70142_S + (var221.field_70165_t - var221.field_70142_S) * par4; + double var13 = var221.field_70137_T + (var221.field_70163_u - var221.field_70137_T) * par4; + double var15 = var221.field_70136_U + (var221.field_70161_v - var221.field_70136_U) * par4; + int var17 = 0; + + int var18; + for(var18 = 0; var18 < this.field_72754_S.length; ++var18) { + this.field_72754_S[var18].func_78421_b(); + } + + int var20; + int var21; + for(var18 = 0; var18 < this.field_72755_R.size(); ++var18) { + WorldRenderer var24 = (WorldRenderer)this.field_72755_R.get(var18); + var20 = -1; + + for(var21 = 0; var21 < var17; ++var21) { + if(this.field_72754_S[var21].func_78418_a(var24.field_78918_f, var24.field_78919_g, var24.field_78931_h)) { + var20 = var21; + } + } + + if(var20 < 0) { + var20 = var17++; + this.field_72754_S[var20].func_78422_a(var24.field_78918_f, var24.field_78919_g, var24.field_78931_h, var231, var13, var15); + } + + this.field_72754_S[var20].func_78420_a(var24.func_78909_a(par3)); + } + + if(Config.isFogOff() && this.field_72777_q.field_71460_t.fogStandard) { + GL11.glDisable(2912); + } + + var18 = MathHelper.func_76128_c(var231); + int var241 = MathHelper.func_76128_c(var15); + var20 = var18 - (var18 & 1023); + var21 = var241 - (var241 & 1023); + Arrays.sort(this.field_72754_S, new RenderDistanceSorter(var20, var21)); + this.func_72733_a(par3, par4); + return var6; + } + } + } + + private int renderSortedRenderersFast(int startIndex, int endIndex, int renderPass, double partialTicks) { + this.glListBuffer.clear(); + int l = 0; + boolean debug = this.field_72777_q.field_71474_y.field_74330_P; + int loopStart = startIndex; + int loopEnd = endIndex; + byte loopInc = 1; + if(renderPass == 1) { + loopStart = this.countSortedWorldRenderers - 1 - startIndex; + loopEnd = this.countSortedWorldRenderers - 1 - endIndex; + loopInc = -1; + } + + for(int entityliving = loopStart; entityliving != loopEnd; entityliving += loopInc) { + WorldRenderer partialX = this.field_72768_k[entityliving]; + if(debug && renderPass == 0) { + ++this.field_72751_K; + if(partialX.field_78928_m[renderPass]) { + ++this.field_72747_O; + } else if(!partialX.field_78927_l) { + ++this.field_72744_L; + } else if(this.field_72774_t && !partialX.field_78936_t) { + ++this.field_72745_M; + } else { + ++this.field_72746_N; + } + } + + if(partialX.field_78927_l && !partialX.field_78928_m[renderPass] && (!this.field_72774_t || partialX.field_78936_t)) { + int glCallList = partialX.func_78909_a(renderPass); + if(glCallList >= 0) { + this.glListBuffer.put(glCallList); + ++l; + } + } + } + + if(l == 0) { + return 0; + } else { + if(Config.isFogOff() && this.field_72777_q.field_71460_t.fogStandard) { + GL11.glDisable(2912); + } + + this.glListBuffer.flip(); + EntityLivingBase var18 = this.field_72777_q.field_71451_h; + double var19 = var18.field_70142_S + (var18.field_70165_t - var18.field_70142_S) * partialTicks - (double)WorldRenderer.globalChunkOffsetX; + double partialY = var18.field_70137_T + (var18.field_70163_u - var18.field_70137_T) * partialTicks; + double partialZ = var18.field_70136_U + (var18.field_70161_v - var18.field_70136_U) * partialTicks - (double)WorldRenderer.globalChunkOffsetZ; + this.field_72777_q.field_71460_t.func_78463_b(partialTicks); + GL11.glTranslatef((float)(-var19), (float)(-partialY), (float)(-partialZ)); + GL11.glCallLists(this.glListBuffer); + GL11.glTranslatef((float)var19, (float)partialY, (float)partialZ); + this.field_72777_q.field_71460_t.func_78483_a(partialTicks); + return l; + } + } + + public void func_72733_a(int par1, double par2) { + this.field_72777_q.field_71460_t.func_78463_b(par2); + + for(int var4 = 0; var4 < this.field_72754_S.length; ++var4) { + this.field_72754_S[var4].func_78419_a(); + } + + this.field_72777_q.field_71460_t.func_78483_a(par2); + } + + public void func_72734_e() { + ++this.field_72773_u; + if(this.field_72773_u % 20 == 0) { + Iterator var1 = this.field_72738_E.values().iterator(); + + while(var1.hasNext()) { + DestroyBlockProgress var2 = (DestroyBlockProgress)var1.next(); + int var3 = var2.func_82743_f(); + if(this.field_72773_u - var3 > 400) { + var1.remove(); + } + } + } + + } + + public void func_72714_a(float par1) { + if(Reflector.ForgeWorldProvider_getSkyRenderer.exists()) { + WorldProvider var2 = this.field_72777_q.field_71441_e.field_73011_w; + Object var3 = Reflector.call(var2, Reflector.ForgeWorldProvider_getSkyRenderer, new Object[0]); + if(var3 != null) { + Reflector.callVoid(var3, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(par1), this.field_72769_h, this.field_72777_q}); + return; + } + } + + if(this.field_72777_q.field_71441_e.field_73011_w.field_76574_g == 1) { + if(!Config.isSkyEnabled()) { + return; + } + + GL11.glDisable(2912); + GL11.glDisable(3008); + GL11.glEnable(3042); + OpenGlHelper.func_148821_a(770, 771, 1, 0); + RenderHelper.func_74518_a(); + GL11.glDepthMask(false); + this.field_72770_i.func_110577_a(field_110926_k); + Tessellator var201 = Tessellator.field_78398_a; + + for(int var22 = 0; var22 < 6; ++var22) { + GL11.glPushMatrix(); + if(var22 == 1) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + + if(var22 == 2) { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + + if(var22 == 3) { + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + } + + if(var22 == 4) { + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + } + + if(var22 == 5) { + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + } + + var201.func_78382_b(); + var201.func_78378_d(2631720); + var201.func_78374_a(-100.0D, -100.0D, -100.0D, 0.0D, 0.0D); + var201.func_78374_a(-100.0D, -100.0D, 100.0D, 0.0D, 16.0D); + var201.func_78374_a(100.0D, -100.0D, 100.0D, 16.0D, 16.0D); + var201.func_78374_a(100.0D, -100.0D, -100.0D, 16.0D, 0.0D); + var201.func_78381_a(); + GL11.glPopMatrix(); + } + + GL11.glDepthMask(true); + GL11.glEnable(3553); + GL11.glEnable(3008); + } else if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { + GL11.glDisable(3553); + Vec3 var21 = this.field_72769_h.func_72833_a(this.field_72777_q.field_71451_h, par1); + var21 = CustomColorizer.getSkyColor(var21, this.field_72777_q.field_71441_e, this.field_72777_q.field_71451_h.field_70165_t, this.field_72777_q.field_71451_h.field_70163_u + 1.0D, this.field_72777_q.field_71451_h.field_70161_v); + float var231 = (float)var21.field_72450_a; + float var4 = (float)var21.field_72448_b; + float var5 = (float)var21.field_72449_c; + float var8; + if(this.field_72777_q.field_71474_y.field_74337_g) { + float var23 = (var231 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F; + float var24 = (var231 * 30.0F + var4 * 70.0F) / 100.0F; + var8 = (var231 * 30.0F + var5 * 70.0F) / 100.0F; + var231 = var23; + var4 = var24; + var5 = var8; + } + + GL11.glColor3f(var231, var4, var5); + Tessellator var241 = Tessellator.field_78398_a; + GL11.glDepthMask(false); + GL11.glEnable(2912); + GL11.glColor3f(var231, var4, var5); + if(Config.isSkyEnabled()) { + GL11.glCallList(this.field_72771_w); + } + + GL11.glDisable(2912); + GL11.glDisable(3008); + GL11.glEnable(3042); + OpenGlHelper.func_148821_a(770, 771, 1, 0); + RenderHelper.func_74518_a(); + float[] var251 = this.field_72769_h.field_73011_w.func_76560_a(this.field_72769_h.func_72826_c(par1), par1); + float var9; + float var10; + float var11; + float var12; + float var20; + int var30; + float var16; + float var17; + if(var251 != null && Config.isSunMoonEnabled()) { + GL11.glDisable(3553); + GL11.glShadeModel(7425); + GL11.glPushMatrix(); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(MathHelper.func_76126_a(this.field_72769_h.func_72929_e(par1)) < 0.0F?180.0F:0.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + var8 = var251[0]; + var9 = var251[1]; + var10 = var251[2]; + if(this.field_72777_q.field_71474_y.field_74337_g) { + var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + var20 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; + var8 = var11; + var9 = var12; + var10 = var20; + } + + var241.func_78371_b(6); + var241.func_78369_a(var8, var9, var10, var251[3]); + var241.func_78377_a(0.0D, 100.0D, 0.0D); + byte var25 = 16; + var241.func_78369_a(var251[0], var251[1], var251[2], 0.0F); + + for(var30 = 0; var30 <= var25; ++var30) { + var20 = (float)var30 * 3.1415927F * 2.0F / (float)var25; + var16 = MathHelper.func_76126_a(var20); + var17 = MathHelper.func_76134_b(var20); + var241.func_78377_a((double)(var16 * 120.0F), (double)(var17 * 120.0F), (double)(-var17 * 40.0F * var251[3])); + } + + var241.func_78381_a(); + GL11.glPopMatrix(); + GL11.glShadeModel(7424); + } + + GL11.glEnable(3553); + OpenGlHelper.func_148821_a(770, 1, 1, 0); + GL11.glPushMatrix(); + var8 = 1.0F - this.field_72769_h.func_72867_j(par1); + var9 = 0.0F; + var10 = 0.0F; + var11 = 0.0F; + GL11.glColor4f(1.0F, 1.0F, 1.0F, var8); + GL11.glTranslatef(var9, var10, var11); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + CustomSky.renderSky(this.field_72769_h, this.field_72770_i, this.field_72769_h.func_72826_c(par1), var8); + GL11.glRotatef(this.field_72769_h.func_72826_c(par1) * 360.0F, 1.0F, 0.0F, 0.0F); + if(Config.isSunMoonEnabled()) { + var12 = 30.0F; + this.field_72770_i.func_110577_a(field_110928_i); + var241.func_78382_b(); + var241.func_78374_a((double)(-var12), 100.0D, (double)(-var12), 0.0D, 0.0D); + var241.func_78374_a((double)var12, 100.0D, (double)(-var12), 1.0D, 0.0D); + var241.func_78374_a((double)var12, 100.0D, (double)var12, 1.0D, 1.0D); + var241.func_78374_a((double)(-var12), 100.0D, (double)var12, 0.0D, 1.0D); + var241.func_78381_a(); + var12 = 20.0F; + this.field_72770_i.func_110577_a(field_110927_h); + int var26 = this.field_72769_h.func_72853_d(); + int var27 = var26 % 4; + var30 = var26 / 4 % 2; + var16 = (float)(var27 + 0) / 4.0F; + var17 = (float)(var30 + 0) / 2.0F; + float var18 = (float)(var27 + 1) / 4.0F; + float var19 = (float)(var30 + 1) / 2.0F; + var241.func_78382_b(); + var241.func_78374_a((double)(-var12), -100.0D, (double)var12, (double)var18, (double)var19); + var241.func_78374_a((double)var12, -100.0D, (double)var12, (double)var16, (double)var19); + var241.func_78374_a((double)var12, -100.0D, (double)(-var12), (double)var16, (double)var17); + var241.func_78374_a((double)(-var12), -100.0D, (double)(-var12), (double)var18, (double)var17); + var241.func_78381_a(); + } + + GL11.glDisable(3553); + var20 = this.field_72769_h.func_72880_h(par1) * var8; + if(var20 > 0.0F && Config.isStarsEnabled() && !CustomSky.hasSkyLayers(this.field_72769_h)) { + GL11.glColor4f(var20, var20, var20, var20); + GL11.glCallList(this.field_72772_v); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(3042); + GL11.glEnable(3008); + GL11.glEnable(2912); + GL11.glPopMatrix(); + GL11.glDisable(3553); + GL11.glColor3f(0.0F, 0.0F, 0.0F); + double var28 = this.field_72777_q.field_71439_g.func_70666_h(par1).field_72448_b - this.field_72769_h.func_72919_O(); + if(var28 < 0.0D) { + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 12.0F, 0.0F); + GL11.glCallList(this.field_72781_x); + GL11.glPopMatrix(); + var10 = 1.0F; + var11 = -((float)(var28 + 65.0D)); + var12 = -var10; + var241.func_78382_b(); + var241.func_78384_a(0, 255); + var241.func_78377_a((double)(-var10), (double)var11, (double)var10); + var241.func_78377_a((double)var10, (double)var11, (double)var10); + var241.func_78377_a((double)var10, (double)var12, (double)var10); + var241.func_78377_a((double)(-var10), (double)var12, (double)var10); + var241.func_78377_a((double)(-var10), (double)var12, (double)(-var10)); + var241.func_78377_a((double)var10, (double)var12, (double)(-var10)); + var241.func_78377_a((double)var10, (double)var11, (double)(-var10)); + var241.func_78377_a((double)(-var10), (double)var11, (double)(-var10)); + var241.func_78377_a((double)var10, (double)var12, (double)(-var10)); + var241.func_78377_a((double)var10, (double)var12, (double)var10); + var241.func_78377_a((double)var10, (double)var11, (double)var10); + var241.func_78377_a((double)var10, (double)var11, (double)(-var10)); + var241.func_78377_a((double)(-var10), (double)var11, (double)(-var10)); + var241.func_78377_a((double)(-var10), (double)var11, (double)var10); + var241.func_78377_a((double)(-var10), (double)var12, (double)var10); + var241.func_78377_a((double)(-var10), (double)var12, (double)(-var10)); + var241.func_78377_a((double)(-var10), (double)var12, (double)(-var10)); + var241.func_78377_a((double)(-var10), (double)var12, (double)var10); + var241.func_78377_a((double)var10, (double)var12, (double)var10); + var241.func_78377_a((double)var10, (double)var12, (double)(-var10)); + var241.func_78381_a(); + } + + if(this.field_72769_h.field_73011_w.func_76561_g()) { + GL11.glColor3f(var231 * 0.2F + 0.04F, var4 * 0.2F + 0.04F, var5 * 0.6F + 0.1F); + } else { + GL11.glColor3f(var231, var4, var5); + } + + if(this.field_72777_q.field_71474_y.field_151451_c <= 4) { + GL11.glColor3f(this.field_72777_q.field_71460_t.field_78518_n, this.field_72777_q.field_71460_t.field_78519_o, this.field_72777_q.field_71460_t.field_78533_p); + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -((float)(var28 - 16.0D)), 0.0F); + if(Config.isSkyEnabled()) { + GL11.glCallList(this.field_72781_x); + } + + GL11.glPopMatrix(); + GL11.glEnable(3553); + GL11.glDepthMask(true); + } + + } + + public void func_72718_b(float par1) { + if(!Config.isCloudsOff()) { + if(Reflector.ForgeWorldProvider_getCloudRenderer.exists()) { + WorldProvider partialTicks = this.field_72777_q.field_71441_e.field_73011_w; + Object var2 = Reflector.call(partialTicks, Reflector.ForgeWorldProvider_getCloudRenderer, new Object[0]); + if(var2 != null) { + Reflector.callVoid(var2, Reflector.IRenderHandler_render, new Object[]{Float.valueOf(par1), this.field_72769_h, this.field_72777_q}); + return; + } + } + + if(this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { + if(Config.isCloudsFancy()) { + this.func_72736_c(par1); + } else { + float partialTicks1 = par1; + par1 = 0.0F; + GL11.glDisable(2884); + float var21 = (float)(this.field_72777_q.field_71451_h.field_70137_T + (this.field_72777_q.field_71451_h.field_70163_u - this.field_72777_q.field_71451_h.field_70137_T) * (double)par1); + byte var3 = 32; + int var4 = 256 / var3; + Tessellator var5 = Tessellator.field_78398_a; + this.field_72770_i.func_110577_a(field_110925_j); + GL11.glEnable(3042); + OpenGlHelper.func_148821_a(770, 771, 1, 0); + double dc; + double exactPlayerZ1; + if(this.isFancyGlListClouds || this.field_72773_u >= this.cloudTickCounterGlList + 20) { + GL11.glNewList(this.glListClouds, 4864); + Vec3 entityliving = this.field_72769_h.func_72824_f(par1); + float exactPlayerX = (float)entityliving.field_72450_a; + float var8 = (float)entityliving.field_72448_b; + float exactPlayerY = (float)entityliving.field_72449_c; + float var10; + if(this.field_72777_q.field_71474_y.field_74337_g) { + var10 = (exactPlayerX * 30.0F + var8 * 59.0F + exactPlayerY * 11.0F) / 100.0F; + float exactPlayerZ = (exactPlayerX * 30.0F + var8 * 70.0F) / 100.0F; + float var12 = (exactPlayerX * 30.0F + exactPlayerY * 70.0F) / 100.0F; + exactPlayerX = var10; + var8 = exactPlayerZ; + exactPlayerY = var12; + } + + var10 = 4.8828125E-4F; + exactPlayerZ1 = (double)((float)this.field_72773_u + par1); + dc = this.field_72777_q.field_71451_h.field_70169_q + (this.field_72777_q.field_71451_h.field_70165_t - this.field_72777_q.field_71451_h.field_70169_q) * (double)par1 + exactPlayerZ1 * 0.029999999329447746D; + double cdx = this.field_72777_q.field_71451_h.field_70166_s + (this.field_72777_q.field_71451_h.field_70161_v - this.field_72777_q.field_71451_h.field_70166_s) * (double)par1; + int cdz = MathHelper.func_76128_c(dc / 2048.0D); + int var18 = MathHelper.func_76128_c(cdx / 2048.0D); + dc -= (double)(cdz * 2048); + cdx -= (double)(var18 * 2048); + float var19 = this.field_72769_h.field_73011_w.func_76571_f() - var21 + 0.33F; + var19 += this.field_72777_q.field_71474_y.ofCloudsHeight * 128.0F; + float var20 = (float)(dc * (double)var10); + float var21 = (float)(cdx * (double)var10); + var5.func_78382_b(); + var5.func_78369_a(exactPlayerX, var8, exactPlayerY, 0.8F); + + for(int var22 = -var3 * var4; var22 < var3 * var4; var22 += var3) { + for(int var23 = -var3 * var4; var23 < var3 * var4; var23 += var3) { + var5.func_78374_a((double)(var22 + 0), (double)var19, (double)(var23 + var3), (double)((float)(var22 + 0) * var10 + var20), (double)((float)(var23 + var3) * var10 + var21)); + var5.func_78374_a((double)(var22 + var3), (double)var19, (double)(var23 + var3), (double)((float)(var22 + var3) * var10 + var20), (double)((float)(var23 + var3) * var10 + var21)); + var5.func_78374_a((double)(var22 + var3), (double)var19, (double)(var23 + 0), (double)((float)(var22 + var3) * var10 + var20), (double)((float)(var23 + 0) * var10 + var21)); + var5.func_78374_a((double)(var22 + 0), (double)var19, (double)(var23 + 0), (double)((float)(var22 + 0) * var10 + var20), (double)((float)(var23 + 0) * var10 + var21)); + } + } + + var5.func_78381_a(); + GL11.glEndList(); + this.isFancyGlListClouds = false; + this.cloudTickCounterGlList = this.field_72773_u; + this.cloudPlayerX = this.field_72777_q.field_71451_h.field_70169_q; + this.cloudPlayerY = this.field_72777_q.field_71451_h.field_70167_r; + this.cloudPlayerZ = this.field_72777_q.field_71451_h.field_70166_s; + } + + EntityLivingBase entityliving1 = this.field_72777_q.field_71451_h; + double exactPlayerX1 = entityliving1.field_70169_q + (entityliving1.field_70165_t - entityliving1.field_70169_q) * (double)partialTicks1; + double exactPlayerY1 = entityliving1.field_70167_r + (entityliving1.field_70163_u - entityliving1.field_70167_r) * (double)partialTicks1; + exactPlayerZ1 = entityliving1.field_70166_s + (entityliving1.field_70161_v - entityliving1.field_70166_s) * (double)partialTicks1; + dc = (double)((float)(this.field_72773_u - this.cloudTickCounterGlList) + partialTicks1); + float cdx1 = (float)(exactPlayerX1 - this.cloudPlayerX + dc * 0.03D); + float cdy = (float)(exactPlayerY1 - this.cloudPlayerY); + float cdz1 = (float)(exactPlayerZ1 - this.cloudPlayerZ); + GL11.glTranslatef(-cdx1, -cdy, -cdz1); + GL11.glCallList(this.glListClouds); + GL11.glTranslatef(cdx1, cdy, cdz1); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(3042); + GL11.glEnable(2884); + } + } + + } + } + + public boolean func_72721_a(double par1, double par3, double par5, float par7) { + return false; + } + + public void func_72736_c(float par1) { + float partialTicks = par1; + par1 = 0.0F; + GL11.glDisable(2884); + float var2 = (float)(this.field_72777_q.field_71451_h.field_70137_T + (this.field_72777_q.field_71451_h.field_70163_u - this.field_72777_q.field_71451_h.field_70137_T) * (double)par1); + Tessellator var3 = Tessellator.field_78398_a; + float var4 = 12.0F; + float var5 = 4.0F; + double var6 = (double)((float)this.field_72773_u + par1); + double var8 = (this.field_72777_q.field_71451_h.field_70169_q + (this.field_72777_q.field_71451_h.field_70165_t - this.field_72777_q.field_71451_h.field_70169_q) * (double)par1 + var6 * 0.029999999329447746D) / (double)var4; + double var10 = (this.field_72777_q.field_71451_h.field_70166_s + (this.field_72777_q.field_71451_h.field_70161_v - this.field_72777_q.field_71451_h.field_70166_s) * (double)par1) / (double)var4 + 0.33000001311302185D; + float var12 = this.field_72769_h.field_73011_w.func_76571_f() - var2 + 0.33F; + var12 += this.field_72777_q.field_71474_y.ofCloudsHeight * 128.0F; + int var13 = MathHelper.func_76128_c(var8 / 2048.0D); + int var14 = MathHelper.func_76128_c(var10 / 2048.0D); + var8 -= (double)(var13 * 2048); + var10 -= (double)(var14 * 2048); + this.field_72770_i.func_110577_a(field_110925_j); + GL11.glEnable(3042); + OpenGlHelper.func_148821_a(770, 771, 1, 0); + float cdz; + if(!this.isFancyGlListClouds || this.field_72773_u >= this.cloudTickCounterGlList + 20) { + GL11.glNewList(this.glListClouds, 4864); + Vec3 entityliving = this.field_72769_h.func_72824_f(par1); + float exactPlayerX = (float)entityliving.field_72450_a; + float var17 = (float)entityliving.field_72448_b; + float exactPlayerY = (float)entityliving.field_72449_c; + float var19; + float exactPlayerZ; + float var21; + if(this.field_72777_q.field_71474_y.field_74337_g) { + var19 = (exactPlayerX * 30.0F + var17 * 59.0F + exactPlayerY * 11.0F) / 100.0F; + exactPlayerZ = (exactPlayerX * 30.0F + var17 * 70.0F) / 100.0F; + var21 = (exactPlayerX * 30.0F + exactPlayerY * 70.0F) / 100.0F; + exactPlayerX = var19; + var17 = exactPlayerZ; + exactPlayerY = var21; + } + + var19 = (float)(var8 * 0.0D); + exactPlayerZ = (float)(var10 * 0.0D); + var21 = 0.00390625F; + var19 = (float)MathHelper.func_76128_c(var8) * var21; + exactPlayerZ = (float)MathHelper.func_76128_c(var10) * var21; + float dc = (float)(var8 - (double)MathHelper.func_76128_c(var8)); + float var23 = (float)(var10 - (double)MathHelper.func_76128_c(var10)); + byte cdx = 8; + byte cdy = 4; + cdz = 9.765625E-4F; + GL11.glScalef(var4, 1.0F, var4); + + for(int var27 = 0; var27 < 2; ++var27) { + if(var27 == 0) { + GL11.glColorMask(false, false, false, false); + } else if(this.field_72777_q.field_71474_y.field_74337_g) { + if(EntityRenderer.field_78515_b == 0) { + GL11.glColorMask(false, true, true, true); + } else { + GL11.glColorMask(true, false, false, true); + } + } else { + GL11.glColorMask(true, true, true, true); + } + + for(int var28 = -cdy + 1; var28 <= cdy; ++var28) { + for(int var29 = -cdy + 1; var29 <= cdy; ++var29) { + var3.func_78382_b(); + float var30 = (float)(var28 * cdx); + float var31 = (float)(var29 * cdx); + float var32 = var30 - dc; + float var33 = var31 - var23; + if(var12 > -var5 - 1.0F) { + var3.func_78369_a(exactPlayerX * 0.7F, var17 * 0.7F, exactPlayerY * 0.7F, 0.8F); + var3.func_78375_b(0.0F, -1.0F, 0.0F); + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + + if(var12 <= var5 + 1.0F) { + var3.func_78369_a(exactPlayerX, var17, exactPlayerY, 0.8F); + var3.func_78375_b(0.0F, 1.0F, 0.0F); + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + var5 - cdz), (double)(var33 + (float)cdx), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + var5 - cdz), (double)(var33 + (float)cdx), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + var5 - cdz), (double)(var33 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + var5 - cdz), (double)(var33 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + + var3.func_78369_a(exactPlayerX * 0.9F, var17 * 0.9F, exactPlayerY * 0.9F, 0.8F); + int var34; + if(var28 > -1) { + var3.func_78375_b(-1.0F, 0.0F, 0.0F); + + for(var34 = 0; var34 < cdx; ++var34) { + var3.func_78374_a((double)(var32 + (float)var34 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)var34 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)var34 + 0.0F), (double)(var12 + var5), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)var34 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + } + + if(var28 <= 1) { + var3.func_78375_b(1.0F, 0.0F, 0.0F); + + for(var34 = 0; var34 < cdx; ++var34) { + var3.func_78374_a((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + 0.0F), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + var5), (double)(var33 + (float)cdx), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)cdx) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + var5), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)var34 + 1.0F - cdz), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + exactPlayerZ)); + } + } + + var3.func_78369_a(exactPlayerX * 0.8F, var17 * 0.8F, exactPlayerY * 0.8F, 0.8F); + if(var29 > -1) { + var3.func_78375_b(0.0F, 0.0F, -1.0F); + + for(var34 = 0; var34 < cdx; ++var34) { + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + var5), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + } + } + + if(var29 <= 1) { + var3.func_78375_b(0.0F, 0.0F, 1.0F); + + for(var34 = 0; var34 < cdx; ++var34) { + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + var5), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + (float)cdx), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + (float)cdx) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + var3.func_78374_a((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 1.0F - cdz), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + exactPlayerZ)); + } + } + + var3.func_78381_a(); + } + } + } + + GL11.glEndList(); + this.isFancyGlListClouds = true; + this.cloudTickCounterGlList = this.field_72773_u; + this.cloudPlayerX = this.field_72777_q.field_71451_h.field_70169_q; + this.cloudPlayerY = this.field_72777_q.field_71451_h.field_70167_r; + this.cloudPlayerZ = this.field_72777_q.field_71451_h.field_70166_s; + } + + EntityLivingBase var36 = this.field_72777_q.field_71451_h; + double var37 = var36.field_70169_q + (var36.field_70165_t - var36.field_70169_q) * (double)partialTicks; + double var38 = var36.field_70167_r + (var36.field_70163_u - var36.field_70167_r) * (double)partialTicks; + double var39 = var36.field_70166_s + (var36.field_70161_v - var36.field_70166_s) * (double)partialTicks; + double var40 = (double)((float)(this.field_72773_u - this.cloudTickCounterGlList) + partialTicks); + float var41 = (float)(var37 - this.cloudPlayerX + var40 * 0.03D); + float var42 = (float)(var38 - this.cloudPlayerY); + cdz = (float)(var39 - this.cloudPlayerZ); + GL11.glTranslatef(-var41, -var42, -cdz); + GL11.glCallList(this.glListClouds); + GL11.glTranslatef(var41, var42, cdz); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(3042); + GL11.glEnable(2884); + } + + public boolean func_72716_a(EntityLivingBase entityliving, boolean flag) { + this.renderViewEntity = entityliving; + if(WrUpdates.hasWrUpdater()) { + return WrUpdates.updateRenderers(this, entityliving, flag); + } else if(this.field_72767_j.size() <= 0) { + return false; + } else { + int num = 0; + int maxNum = Config.getUpdatesPerFrame(); + if(Config.isDynamicUpdates() && !this.isMoving(entityliving)) { + maxNum *= 3; + } + + byte NOT_IN_FRUSTRUM_MUL = 4; + int numValid = 0; + WorldRenderer wrBest = null; + float distSqBest = Float.MAX_VALUE; + int indexBest = -1; + + for(int maxDiffDistSq = 0; maxDiffDistSq < this.field_72767_j.size(); ++maxDiffDistSq) { + WorldRenderer i = (WorldRenderer)this.field_72767_j.get(maxDiffDistSq); + if(i != null) { + ++numValid; + if(!i.field_78939_q) { + this.field_72767_j.set(maxDiffDistSq, (Object)null); + } else { + float wr = i.func_78912_a(entityliving); + if(wr <= 256.0F && this.isActingNow()) { + i.func_147892_a(entityliving); + i.field_78939_q = false; + this.field_72767_j.set(maxDiffDistSq, (Object)null); + ++num; + } else { + if(wr > 256.0F && num >= maxNum) { + break; + } + + if(!i.field_78927_l) { + wr *= (float)NOT_IN_FRUSTRUM_MUL; + } + + if(wrBest == null) { + wrBest = i; + distSqBest = wr; + indexBest = maxDiffDistSq; + } else if(wr < distSqBest) { + wrBest = i; + distSqBest = wr; + indexBest = maxDiffDistSq; + } + } + } + } + } + + if(wrBest != null) { + wrBest.func_147892_a(entityliving); + wrBest.field_78939_q = false; + this.field_72767_j.set(indexBest, (Object)null); + ++num; + float var15 = distSqBest / 5.0F; + + for(int var16 = 0; var16 < this.field_72767_j.size() && num < maxNum; ++var16) { + WorldRenderer var17 = (WorldRenderer)this.field_72767_j.get(var16); + if(var17 != null) { + float distSq = var17.func_78912_a(entityliving); + if(!var17.field_78927_l) { + distSq *= (float)NOT_IN_FRUSTRUM_MUL; + } + + float diffDistSq = Math.abs(distSq - distSqBest); + if(diffDistSq < var15) { + var17.func_147892_a(entityliving); + var17.field_78939_q = false; + this.field_72767_j.set(var16, (Object)null); + ++num; + } + } + } + } + + if(numValid == 0) { + this.field_72767_j.clear(); + } + + this.field_72767_j.compact(); + return true; + } + } + + public void func_72717_a(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) { + this.drawBlockDamageTexture(par1Tessellator, par2EntityPlayer, par3); + } + + public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLivingBase par2EntityPlayer, float par3) { + double var4 = par2EntityPlayer.field_70142_S + (par2EntityPlayer.field_70165_t - par2EntityPlayer.field_70142_S) * (double)par3; + double var6 = par2EntityPlayer.field_70137_T + (par2EntityPlayer.field_70163_u - par2EntityPlayer.field_70137_T) * (double)par3; + double var8 = par2EntityPlayer.field_70136_U + (par2EntityPlayer.field_70161_v - par2EntityPlayer.field_70136_U) * (double)par3; + if(!this.field_72738_E.isEmpty()) { + OpenGlHelper.func_148821_a(774, 768, 1, 0); + this.field_72770_i.func_110577_a(TextureMap.field_110575_b); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); + GL11.glPushMatrix(); + GL11.glPolygonOffset(-3.0F, -3.0F); + GL11.glEnable('\u8037'); + GL11.glAlphaFunc(516, 0.1F); + GL11.glEnable(3008); + par1Tessellator.func_78382_b(); + par1Tessellator.func_78373_b(-var4, -var6, -var8); + par1Tessellator.func_78383_c(); + Iterator var10 = this.field_72738_E.values().iterator(); + + while(var10.hasNext()) { + DestroyBlockProgress var11 = (DestroyBlockProgress)var10.next(); + double var12 = (double)var11.func_73110_b() - var4; + double var14 = (double)var11.func_73109_c() - var6; + double var16 = (double)var11.func_73108_d() - var8; + if(var12 * var12 + var14 * var14 + var16 * var16 > 1024.0D) { + var10.remove(); + } else { + Block var18 = this.field_72769_h.func_147439_a(var11.func_73110_b(), var11.func_73109_c(), var11.func_73108_d()); + if(var18.func_149688_o() != Material.field_151579_a) { + this.field_147592_B.func_147792_a(var18, var11.func_73110_b(), var11.func_73109_c(), var11.func_73108_d(), this.field_94141_F[var11.func_73106_e()]); + } + } + } + + par1Tessellator.func_78381_a(); + par1Tessellator.func_78373_b(0.0D, 0.0D, 0.0D); + GL11.glDisable(3008); + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glDisable('\u8037'); + GL11.glEnable(3008); + GL11.glDepthMask(true); + GL11.glPopMatrix(); + } + + } + + public void func_72731_b(EntityPlayer par1EntityPlayer, MovingObjectPosition par2MovingObjectPosition, int par3, float par4) { + if(par3 == 0 && par2MovingObjectPosition.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) { + GL11.glEnable(3042); + OpenGlHelper.func_148821_a(770, 771, 1, 0); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth(2.0F); + GL11.glDisable(3553); + GL11.glDepthMask(false); + float var5 = 0.002F; + Block var6 = this.field_72769_h.func_147439_a(par2MovingObjectPosition.field_72311_b, par2MovingObjectPosition.field_72312_c, par2MovingObjectPosition.field_72309_d); + if(var6.func_149688_o() != Material.field_151579_a) { + var6.func_149719_a(this.field_72769_h, par2MovingObjectPosition.field_72311_b, par2MovingObjectPosition.field_72312_c, par2MovingObjectPosition.field_72309_d); + double var7 = par1EntityPlayer.field_70142_S + (par1EntityPlayer.field_70165_t - par1EntityPlayer.field_70142_S) * (double)par4; + double var9 = par1EntityPlayer.field_70137_T + (par1EntityPlayer.field_70163_u - par1EntityPlayer.field_70137_T) * (double)par4; + double var11 = par1EntityPlayer.field_70136_U + (par1EntityPlayer.field_70161_v - par1EntityPlayer.field_70136_U) * (double)par4; + func_147590_a(var6.func_149633_g(this.field_72769_h, par2MovingObjectPosition.field_72311_b, par2MovingObjectPosition.field_72312_c, par2MovingObjectPosition.field_72309_d).func_72314_b((double)var5, (double)var5, (double)var5).func_72325_c(-var7, -var9, -var11), -1); + } + + GL11.glDepthMask(true); + GL11.glEnable(3553); + GL11.glDisable(3042); + } + + } + + public static void func_147590_a(AxisAlignedBB p_147590_0_, int p_147590_1_) { + Tessellator var2 = Tessellator.field_78398_a; + var2.func_78371_b(3); + if(p_147590_1_ != -1) { + var2.func_78378_d(p_147590_1_); + } + + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72338_b, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72338_b, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72338_b, p_147590_0_.field_72334_f); + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72338_b, p_147590_0_.field_72334_f); + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72338_b, p_147590_0_.field_72339_c); + var2.func_78381_a(); + var2.func_78371_b(3); + if(p_147590_1_ != -1) { + var2.func_78378_d(p_147590_1_); + } + + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72337_e, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72337_e, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72337_e, p_147590_0_.field_72334_f); + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72337_e, p_147590_0_.field_72334_f); + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72337_e, p_147590_0_.field_72339_c); + var2.func_78381_a(); + var2.func_78371_b(1); + if(p_147590_1_ != -1) { + var2.func_78378_d(p_147590_1_); + } + + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72338_b, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72337_e, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72338_b, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72337_e, p_147590_0_.field_72339_c); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72338_b, p_147590_0_.field_72334_f); + var2.func_78377_a(p_147590_0_.field_72336_d, p_147590_0_.field_72337_e, p_147590_0_.field_72334_f); + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72338_b, p_147590_0_.field_72334_f); + var2.func_78377_a(p_147590_0_.field_72340_a, p_147590_0_.field_72337_e, p_147590_0_.field_72334_f); + var2.func_78381_a(); + } + + public void func_72725_b(int par1, int par2, int par3, int par4, int par5, int par6) { + int var7 = MathHelper.func_76137_a(par1, 16); + int var8 = MathHelper.func_76137_a(par2, 16); + int var9 = MathHelper.func_76137_a(par3, 16); + int var10 = MathHelper.func_76137_a(par4, 16); + int var11 = MathHelper.func_76137_a(par5, 16); + int var12 = MathHelper.func_76137_a(par6, 16); + + for(int var13 = var7; var13 <= var10; ++var13) { + int var14 = var13 % this.field_72766_m; + if(var14 < 0) { + var14 += this.field_72766_m; + } + + for(int var15 = var8; var15 <= var11; ++var15) { + int var16 = var15 % this.field_72763_n; + if(var16 < 0) { + var16 += this.field_72763_n; + } + + for(int var17 = var9; var17 <= var12; ++var17) { + int var18 = var17 % this.field_72764_o; + if(var18 < 0) { + var18 += this.field_72764_o; + } + + int var19 = (var18 * this.field_72763_n + var16) * this.field_72766_m + var14; + WorldRenderer var20 = this.field_72765_l[var19]; + if(var20 != null && !var20.field_78939_q) { + this.field_72767_j.add(var20); + var20.func_78914_f(); + } + } + } + } + + } + + public void func_147586_a(int p_147586_1_, int p_147586_2_, int p_147586_3_) { + this.func_72725_b(p_147586_1_ - 1, p_147586_2_ - 1, p_147586_3_ - 1, p_147586_1_ + 1, p_147586_2_ + 1, p_147586_3_ + 1); + } + + public void func_147588_b(int p_147588_1_, int p_147588_2_, int p_147588_3_) { + this.func_72725_b(p_147588_1_ - 1, p_147588_2_ - 1, p_147588_3_ - 1, p_147588_1_ + 1, p_147588_2_ + 1, p_147588_3_ + 1); + } + + public void func_147585_a(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) { + this.func_72725_b(p_147585_1_ - 1, p_147585_2_ - 1, p_147585_3_ - 1, p_147585_4_ + 1, p_147585_5_ + 1, p_147585_6_ + 1); + } + + public void func_72729_a(ICamera par1ICamera, float par2) { + boolean checkDistanceXz = !Config.isFogOff(); + double renderDistSq = (double)(this.field_72739_F * 16 * this.field_72739_F * 16); + + for(int var3 = 0; var3 < this.countSortedWorldRenderers; ++var3) { + WorldRenderer wr = this.field_72768_k[var3]; + if(!wr.func_78906_e()) { + if(checkDistanceXz && wr.distanceToEntityXzSq > renderDistSq) { + wr.field_78927_l = false; + } else { + wr.func_78908_a(par1ICamera); + } + } + } + + } + + public void func_72702_a(String par1Str, int par2, int par3, int par4) { + ChunkCoordinates var5 = new ChunkCoordinates(par2, par3, par4); + ISound var6 = (ISound)this.field_147593_P.get(var5); + if(var6 != null) { + this.field_72777_q.func_147118_V().func_147683_b(var6); + this.field_147593_P.remove(var5); + } + + if(par1Str != null) { + ItemRecord var7 = ItemRecord.func_150926_b(par1Str); + if(var7 != null) { + this.field_72777_q.field_71456_v.func_73833_a(var7.func_150927_i()); + } + + ResourceLocation resource = null; + if(Reflector.ForgeItemRecord_getRecordResource.exists() && var7 != null) { + resource = (ResourceLocation)Reflector.call(var7, Reflector.ForgeItemRecord_getRecordResource, new Object[]{par1Str}); + } + + if(resource == null) { + resource = new ResourceLocation(par1Str); + } + + PositionedSoundRecord var8 = PositionedSoundRecord.func_147675_a(resource, (float)par2, (float)par3, (float)par4); + this.field_147593_P.put(var5, var8); + this.field_72777_q.func_147118_V().func_147682_a(var8); + } + + } + + public void func_72704_a(String par1Str, double par2, double par4, double par6, float par8, float par9) {} + + public void func_85102_a(EntityPlayer par1EntityPlayer, String par2Str, double par3, double par5, double par7, float par9, float par10) {} + + public void func_72708_a(String par1Str, final double par2, final double par4, final double par6, double par8, double par10, double par12) { + try { + this.func_72726_b(par1Str, par2, par4, par6, par8, par10, par12); + } catch (Throwable var17) { + CrashReport var15 = CrashReport.func_85055_a(var17, "Exception while adding particle"); + CrashReportCategory var16 = var15.func_85058_a("Particle being added"); + var16.func_71507_a("Name", par1Str); + var16.func_71500_a("Position", new Callable() { + + private static final String __OBFID = "CL_00000955"; + private static final String __OBFID = "CL_00000955"; + + public String call() { + return CrashReportCategory.func_85074_a(par2, par4, par6); + } + // $FF: synthetic method + // $FF: bridge method + public Object call() throws Exception { + return this.call(); + } + }); + throw new ReportedException(var15); + } + } + + public EntityFX func_72726_b(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) { + if(this.field_72777_q != null && this.field_72777_q.field_71451_h != null && this.field_72777_q.field_71452_i != null) { + int var14 = this.field_72777_q.field_71474_y.field_74362_aa; + if(var14 == 1 && this.field_72769_h.field_73012_v.nextInt(3) == 0) { + var14 = 2; + } + + double var15 = this.field_72777_q.field_71451_h.field_70165_t - par2; + double var17 = this.field_72777_q.field_71451_h.field_70163_u - par4; + double var19 = this.field_72777_q.field_71451_h.field_70161_v - par6; + Object var21 = null; + if(par1Str.equals("hugeexplosion")) { + if(Config.isAnimatedExplosion()) { + this.field_72777_q.field_71452_i.func_78873_a(var21 = new EntityHugeExplodeFX(this.field_72769_h, par2, par4, par6, par8, par10, par12)); + } + } else if(par1Str.equals("largeexplode")) { + if(Config.isAnimatedExplosion()) { + this.field_72777_q.field_71452_i.func_78873_a(var21 = new EntityLargeExplodeFX(this.field_72770_i, this.field_72769_h, par2, par4, par6, par8, par10, par12)); + } + } else if(par1Str.equals("fireworksSpark")) { + this.field_72777_q.field_71452_i.func_78873_a(var21 = new EntityFireworkSparkFX(this.field_72769_h, par2, par4, par6, par8, par10, par12, this.field_72777_q.field_71452_i)); + } + + if(var21 != null) { + return (EntityFX)var21; + } else { + double var22 = 16.0D; + double d3 = 16.0D; + if(par1Str.equals("crit")) { + var22 = 196.0D; + } + + if(var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) { + return null; + } else if(var14 > 1) { + return null; + } else { + if(par1Str.equals("bubble")) { + var21 = new EntityBubbleFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + CustomColorizer.updateWaterFX((EntityFX)var21, this.field_72769_h); + } else if(par1Str.equals("suspended")) { + if(Config.isWaterParticles()) { + var21 = new EntitySuspendFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } + } else if(par1Str.equals("depthsuspend")) { + if(Config.isVoidParticles()) { + var21 = new EntityAuraFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } + } else if(par1Str.equals("townaura")) { + var21 = new EntityAuraFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + CustomColorizer.updateMyceliumFX((EntityFX)var21); + } else if(par1Str.equals("crit")) { + var21 = new EntityCritFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } else if(par1Str.equals("magicCrit")) { + var21 = new EntityCritFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + ((EntityFX)var21).func_70538_b(((EntityFX)var21).func_70534_d() * 0.3F, ((EntityFX)var21).func_70542_f() * 0.8F, ((EntityFX)var21).func_70535_g()); + ((EntityFX)var21).func_94053_h(); + } else if(par1Str.equals("smoke")) { + if(Config.isAnimatedSmoke()) { + var21 = new EntitySmokeFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } + } else if(par1Str.equals("mobSpell")) { + if(Config.isPotionParticles()) { + var21 = new EntitySpellParticleFX(this.field_72769_h, par2, par4, par6, 0.0D, 0.0D, 0.0D); + ((EntityFX)var21).func_70538_b((float)par8, (float)par10, (float)par12); + } + } else if(par1Str.equals("mobSpellAmbient")) { + if(Config.isPotionParticles()) { + var21 = new EntitySpellParticleFX(this.field_72769_h, par2, par4, par6, 0.0D, 0.0D, 0.0D); + ((EntityFX)var21).func_82338_g(0.15F); + ((EntityFX)var21).func_70538_b((float)par8, (float)par10, (float)par12); + } + } else if(par1Str.equals("spell")) { + if(Config.isPotionParticles()) { + var21 = new EntitySpellParticleFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } + } else if(par1Str.equals("instantSpell")) { + if(Config.isPotionParticles()) { + var21 = new EntitySpellParticleFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + ((EntitySpellParticleFX)var21).func_70589_b(144); + } + } else if(par1Str.equals("witchMagic")) { + if(Config.isPotionParticles()) { + var21 = new EntitySpellParticleFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + ((EntitySpellParticleFX)var21).func_70589_b(144); + float var26 = this.field_72769_h.field_73012_v.nextFloat() * 0.5F + 0.35F; + ((EntityFX)var21).func_70538_b(1.0F * var26, 0.0F * var26, 1.0F * var26); + } + } else if(par1Str.equals("note")) { + var21 = new EntityNoteFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } else if(par1Str.equals("portal")) { + if(Config.isPortalParticles()) { + var21 = new EntityPortalFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + CustomColorizer.updatePortalFX((EntityFX)var21); + } + } else if(par1Str.equals("enchantmenttable")) { + var21 = new EntityEnchantmentTableParticleFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } else if(par1Str.equals("explode")) { + if(Config.isAnimatedExplosion()) { + var21 = new EntityExplodeFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } + } else if(par1Str.equals("flame")) { + if(Config.isAnimatedFlame()) { + var21 = new EntityFlameFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } + } else if(par1Str.equals("lava")) { + var21 = new EntityLavaFX(this.field_72769_h, par2, par4, par6); + } else if(par1Str.equals("footstep")) { + var21 = new EntityFootStepFX(this.field_72770_i, this.field_72769_h, par2, par4, par6); + } else if(par1Str.equals("splash")) { + var21 = new EntitySplashFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + CustomColorizer.updateWaterFX((EntityFX)var21, this.field_72769_h); + } else if(par1Str.equals("wake")) { + var21 = new EntityFishWakeFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } else if(par1Str.equals("largesmoke")) { + if(Config.isAnimatedSmoke()) { + var21 = new EntitySmokeFX(this.field_72769_h, par2, par4, par6, par8, par10, par12, 2.5F); + } + } else if(par1Str.equals("cloud")) { + var21 = new EntityCloudFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } else if(par1Str.equals("reddust")) { + if(Config.isAnimatedRedstone()) { + var21 = new EntityReddustFX(this.field_72769_h, par2, par4, par6, (float)par8, (float)par10, (float)par12); + CustomColorizer.updateReddustFX((EntityFX)var21, this.field_72769_h, var15, var17, var19); + } + } else if(par1Str.equals("snowballpoof")) { + var21 = new EntityBreakingFX(this.field_72769_h, par2, par4, par6, Items.field_151126_ay); + } else if(par1Str.equals("dripWater")) { + if(Config.isDrippingWaterLava()) { + var21 = new EntityDropParticleFX(this.field_72769_h, par2, par4, par6, Material.field_151586_h); + } + } else if(par1Str.equals("dripLava")) { + if(Config.isDrippingWaterLava()) { + var21 = new EntityDropParticleFX(this.field_72769_h, par2, par4, par6, Material.field_151587_i); + } + } else if(par1Str.equals("snowshovel")) { + var21 = new EntitySnowShovelFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } else if(par1Str.equals("slime")) { + var21 = new EntityBreakingFX(this.field_72769_h, par2, par4, par6, Items.field_151123_aH); + } else if(par1Str.equals("heart")) { + var21 = new EntityHeartFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + } else if(par1Str.equals("angryVillager")) { + var21 = new EntityHeartFX(this.field_72769_h, par2, par4 + 0.5D, par6, par8, par10, par12); + ((EntityFX)var21).func_70536_a(81); + ((EntityFX)var21).func_70538_b(1.0F, 1.0F, 1.0F); + } else if(par1Str.equals("happyVillager")) { + var21 = new EntityAuraFX(this.field_72769_h, par2, par4, par6, par8, par10, par12); + ((EntityFX)var21).func_70536_a(82); + ((EntityFX)var21).func_70538_b(1.0F, 1.0F, 1.0F); + } else { + String[] var27; + int var261; + if(par1Str.startsWith("iconcrack_")) { + var27 = par1Str.split("_", 3); + int var28 = Integer.parseInt(var27[1]); + if(var27.length > 2) { + var261 = Integer.parseInt(var27[2]); + var21 = new EntityBreakingFX(this.field_72769_h, par2, par4, par6, par8, par10, par12, Item.func_150899_d(var28), var261); + } else { + var21 = new EntityBreakingFX(this.field_72769_h, par2, par4, par6, par8, par10, par12, Item.func_150899_d(var28), 0); + } + } else { + Block var281; + if(par1Str.startsWith("blockcrack_")) { + var27 = par1Str.split("_", 3); + var281 = Block.func_149729_e(Integer.parseInt(var27[1])); + var261 = Integer.parseInt(var27[2]); + var21 = (new EntityDiggingFX(this.field_72769_h, par2, par4, par6, par8, par10, par12, var281, var261)).func_90019_g(var261); + } else if(par1Str.startsWith("blockdust_")) { + var27 = par1Str.split("_", 3); + var281 = Block.func_149729_e(Integer.parseInt(var27[1])); + var261 = Integer.parseInt(var27[2]); + var21 = (new EntityBlockDustFX(this.field_72769_h, par2, par4, par6, par8, par10, par12, var281, var261)).func_90019_g(var261); + } + } + } + + if(var21 != null) { + this.field_72777_q.field_71452_i.func_78873_a((EntityFX)var21); + } + + return (EntityFX)var21; + } + } + } else { + return null; + } + } + + public void func_72703_a(Entity par1Entity) { + RandomMobs.entityLoaded(par1Entity, this.field_72769_h); + if(Config.isDynamicLights()) { + DynamicLights.entityAdded(par1Entity, this); + } + + } + + public void func_72709_b(Entity par1Entity) { + if(Config.isDynamicLights()) { + DynamicLights.entityRemoved(par1Entity, this); + } + + } + + public void func_72728_f() { + GLAllocation.func_74523_b(this.field_72778_p); + this.displayListAllocator.deleteDisplayLists(); + } + + public void func_82746_a(int par1, int par2, int par3, int par4, int par5) { + Random var6 = this.field_72769_h.field_73012_v; + switch(par1) { + case 1013: + case 1018: + if(this.field_72777_q.field_71451_h != null) { + double var7 = (double)par2 - this.field_72777_q.field_71451_h.field_70165_t; + double var9 = (double)par3 - this.field_72777_q.field_71451_h.field_70163_u; + double var11 = (double)par4 - this.field_72777_q.field_71451_h.field_70161_v; + double var13 = Math.sqrt(var7 * var7 + var9 * var9 + var11 * var11); + double var15 = this.field_72777_q.field_71451_h.field_70165_t; + double var17 = this.field_72777_q.field_71451_h.field_70163_u; + double var19 = this.field_72777_q.field_71451_h.field_70161_v; + if(var13 > 0.0D) { + var15 += var7 / var13 * 2.0D; + var17 += var9 / var13 * 2.0D; + var19 += var11 / var13 * 2.0D; + } + + if(par1 == 1013) { + this.field_72769_h.func_72980_b(var15, var17, var19, "mob.wither.spawn", 1.0F, 1.0F, false); + } else if(par1 == 1018) { + this.field_72769_h.func_72980_b(var15, var17, var19, "mob.enderdragon.end", 5.0F, 1.0F, false); + } + } + default: + } + } + + public void func_72706_a(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) { + Random var7 = this.field_72769_h.field_73012_v; + Block var8 = null; + double var9; + double var11; + double var13; + String var15; + int var16; + double var22; + double var26; + double var28; + double var30; + int var40; + double var41; + double var21; + switch(par2) { + case 1000: + this.field_72769_h.func_72980_b((double)par3, (double)par4, (double)par5, "random.click", 1.0F, 1.0F, false); + break; + case 1001: + this.field_72769_h.func_72980_b((double)par3, (double)par4, (double)par5, "random.click", 1.0F, 1.2F, false); + break; + case 1002: + this.field_72769_h.func_72980_b((double)par3, (double)par4, (double)par5, "random.bow", 1.0F, 1.2F, false); + break; + case 1003: + if(Math.random() < 0.5D) { + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "random.door_open", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + } else { + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "random.door_close", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + } + break; + case 1004: + this.field_72769_h.func_72980_b((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.fizz", 0.5F, 2.6F + (var7.nextFloat() - var7.nextFloat()) * 0.8F, false); + break; + case 1005: + if(Item.func_150899_d(par6) instanceof ItemRecord) { + this.field_72769_h.func_72934_a("records." + ((ItemRecord)Item.func_150899_d(par6)).field_150929_a, par3, par4, par5); + } else { + this.field_72769_h.func_72934_a((String)null, par3, par4, par5); + } + break; + case 1007: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.charge", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1008: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.fireball", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1009: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.fireball", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1010: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.wood", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1011: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.metal", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1012: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.woodbreak", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1014: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.wither.shoot", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1015: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.bat.takeoff", 0.05F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1016: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.infect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1017: + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.unfect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1020: + this.field_72769_h.func_72980_b((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_break", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 1021: + this.field_72769_h.func_72980_b((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_use", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 1022: + this.field_72769_h.func_72980_b((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_land", 0.3F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 2000: + int var34 = par6 % 3 - 1; + int var10 = par6 / 3 % 3 - 1; + var11 = (double)par3 + (double)var34 * 0.6D + 0.5D; + var13 = (double)par4 + 0.5D; + double var35 = (double)par5 + (double)var10 * 0.6D + 0.5D; + + for(int var43 = 0; var43 < 10; ++var43) { + double var44 = var7.nextDouble() * 0.2D + 0.01D; + double var45 = var11 + (double)var34 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var10 * 0.5D; + var22 = var13 + (var7.nextDouble() - 0.5D) * 0.5D; + var41 = var35 + (double)var10 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var34 * 0.5D; + var26 = (double)var34 * var44 + var7.nextGaussian() * 0.01D; + var28 = -0.03D + var7.nextGaussian() * 0.01D; + var30 = (double)var10 * var44 + var7.nextGaussian() * 0.01D; + this.func_72708_a("smoke", var45, var22, var41, var26, var28, var30); + } + + return; + case 2001: + var8 = Block.func_149729_e(par6 & 4095); + if(var8.func_149688_o() != Material.field_151579_a) { + this.field_72777_q.func_147118_V().func_147682_a(new PositionedSoundRecord(new ResourceLocation(var8.field_149762_H.func_150495_a()), (var8.field_149762_H.func_150497_c() + 1.0F) / 2.0F, var8.field_149762_H.func_150494_d() * 0.8F, (float)par3 + 0.5F, (float)par4 + 0.5F, (float)par5 + 0.5F)); + } + + this.field_72777_q.field_71452_i.func_147215_a(par3, par4, par5, var8, par6 >> 12 & 255); + break; + case 2002: + var9 = (double)par3; + var11 = (double)par4; + var13 = (double)par5; + var15 = "iconcrack_" + Item.func_150891_b(Items.field_151068_bn) + "_" + par6; + + for(var16 = 0; var16 < 8; ++var16) { + this.func_72708_a(var15, var9, var11, var13, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); + } + + var16 = Items.field_151068_bn.func_77620_a(par6); + float var17 = (float)(var16 >> 16 & 255) / 255.0F; + float var18 = (float)(var16 >> 8 & 255) / 255.0F; + float var19 = (float)(var16 >> 0 & 255) / 255.0F; + String var20 = "spell"; + if(Items.field_151068_bn.func_77833_h(par6)) { + var20 = "instantSpell"; + } + + for(var40 = 0; var40 < 100; ++var40) { + var22 = var7.nextDouble() * 4.0D; + var41 = var7.nextDouble() * 3.141592653589793D * 2.0D; + var26 = Math.cos(var41) * var22; + var28 = 0.01D + var7.nextDouble() * 0.5D; + var30 = Math.sin(var41) * var22; + EntityFX var46 = this.func_72726_b(var20, var9 + var26 * 0.1D, var11 + 0.3D, var13 + var30 * 0.1D, var26, var28, var30); + if(var46 != null) { + float var33 = 0.75F + var7.nextFloat() * 0.25F; + var46.func_70538_b(var17 * var33, var18 * var33, var19 * var33); + var46.func_70543_e((float)var22); + } + } + + this.field_72769_h.func_72980_b((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "game.potion.smash", 1.0F, this.field_72769_h.field_73012_v.nextFloat() * 0.1F + 0.9F, false); + break; + case 2003: + var9 = (double)par3 + 0.5D; + var11 = (double)par4; + var13 = (double)par5 + 0.5D; + var15 = "iconcrack_" + Item.func_150891_b(Items.field_151061_bv); + + for(var16 = 0; var16 < 8; ++var16) { + this.func_72708_a(var15, var9, var11, var13, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); + } + + for(var21 = 0.0D; var21 < 6.283185307179586D; var21 += 0.15707963267948966D) { + this.func_72708_a("portal", var9 + Math.cos(var21) * 5.0D, var11 - 0.4D, var13 + Math.sin(var21) * 5.0D, Math.cos(var21) * -5.0D, 0.0D, Math.sin(var21) * -5.0D); + this.func_72708_a("portal", var9 + Math.cos(var21) * 5.0D, var11 - 0.4D, var13 + Math.sin(var21) * 5.0D, Math.cos(var21) * -7.0D, 0.0D, Math.sin(var21) * -7.0D); + } + + return; + case 2004: + for(var40 = 0; var40 < 20; ++var40) { + var22 = (double)par3 + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D; + var41 = (double)par4 + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D; + var26 = (double)par5 + 0.5D + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5D) * 2.0D; + this.field_72769_h.func_72869_a("smoke", var22, var41, var26, 0.0D, 0.0D, 0.0D); + this.field_72769_h.func_72869_a("flame", var22, var41, var26, 0.0D, 0.0D, 0.0D); + } + + return; + case 2005: + ItemDye.func_150918_a(this.field_72769_h, par3, par4, par5, par6); + break; + case 2006: + var8 = this.field_72769_h.func_147439_a(par3, par4, par5); + if(var8.func_149688_o() != Material.field_151579_a) { + var21 = (double)Math.min(0.2F + (float)par6 / 15.0F, 10.0F); + if(var21 > 2.5D) { + var21 = 2.5D; + } + + int var23 = (int)(150.0D * var21); + + for(int var24 = 0; var24 < var23; ++var24) { + float var25 = MathHelper.func_151240_a(var7, 0.0F, 6.2831855F); + var26 = (double)MathHelper.func_151240_a(var7, 0.75F, 1.0F); + var28 = 0.20000000298023224D + var21 / 100.0D; + var30 = (double)(MathHelper.func_76134_b(var25) * 0.2F) * var26 * var26 * (var21 + 0.2D); + double var32 = (double)(MathHelper.func_76126_a(var25) * 0.2F) * var26 * var26 * (var21 + 0.2D); + this.field_72769_h.func_72869_a("blockdust_" + Block.func_149682_b(var8) + "_" + this.field_72769_h.func_72805_g(par3, par4, par5), (double)((float)par3 + 0.5F), (double)((float)par4 + 1.0F), (double)((float)par5 + 0.5F), var30, var28, var32); + } + } + } + + } + + public void func_147587_b(int p_147587_1_, int p_147587_2_, int p_147587_3_, int p_147587_4_, int p_147587_5_) { + if(p_147587_5_ >= 0 && p_147587_5_ < 10) { + DestroyBlockProgress var6 = (DestroyBlockProgress)this.field_72738_E.get(Integer.valueOf(p_147587_1_)); + if(var6 == null || var6.func_73110_b() != p_147587_2_ || var6.func_73109_c() != p_147587_3_ || var6.func_73108_d() != p_147587_4_) { + var6 = new DestroyBlockProgress(p_147587_1_, p_147587_2_, p_147587_3_, p_147587_4_); + this.field_72738_E.put(Integer.valueOf(p_147587_1_), var6); + } + + var6.func_73107_a(p_147587_5_); + var6.func_82744_b(this.field_72773_u); + } else { + this.field_72738_E.remove(Integer.valueOf(p_147587_1_)); + } + + } + + public void func_94140_a(IIconRegister par1IconRegister) { + this.field_94141_F = new IIcon[10]; + + for(int var2 = 0; var2 < this.field_94141_F.length; ++var2) { + this.field_94141_F[var2] = par1IconRegister.func_94245_a("destroy_stage_" + var2); + } + + } + + public void setAllRenderersVisible() { + if(this.field_72765_l != null) { + for(int i = 0; i < this.field_72765_l.length; ++i) { + this.field_72765_l[i].field_78936_t = true; + } + + } + } + + public boolean isMoving(EntityLivingBase entityliving) { + boolean moving = this.isMovingNow(entityliving); + if(moving) { + this.lastMovedTime = System.currentTimeMillis(); + return true; + } else { + return System.currentTimeMillis() - this.lastMovedTime < 2000L; + } + } + + private boolean isMovingNow(EntityLivingBase entityliving) { + double maxDiff = 0.001D; + return entityliving.func_70093_af()?true:((double)entityliving.field_70732_aI > maxDiff?true:(this.field_72777_q.field_71417_B.field_74377_a != 0?true:(this.field_72777_q.field_71417_B.field_74375_b != 0?true:(Math.abs(entityliving.field_70165_t - entityliving.field_70169_q) > maxDiff?true:(Math.abs(entityliving.field_70163_u - entityliving.field_70167_r) > maxDiff?true:Math.abs(entityliving.field_70161_v - entityliving.field_70166_s) > maxDiff))))); + } + + public boolean isActing() { + boolean acting = this.isActingNow(); + if(acting) { + this.lastActionTime = System.currentTimeMillis(); + return true; + } else { + return System.currentTimeMillis() - this.lastActionTime < 500L; + } + } + + public boolean isActingNow() { + return Mouse.isButtonDown(0)?true:Mouse.isButtonDown(1); + } + + public int renderAllSortedRenderers(int renderPass, double partialTicks) { + return this.func_72724_a(0, this.countSortedWorldRenderers, renderPass, partialTicks); + } + + public void updateCapes() {} + + public AxisAlignedBB getTileEntityBoundingBox(TileEntity te) { + if(!te.func_145830_o()) { + return AABB_INFINITE; + } else { + Block blockType = te.func_145838_q(); + if(blockType == Blocks.field_150381_bn) { + return AxisAlignedBB.func_72330_a((double)te.field_145851_c, (double)te.field_145848_d, (double)te.field_145849_e, (double)(te.field_145851_c + 1), (double)(te.field_145848_d + 1), (double)(te.field_145849_e + 1)); + } else if(blockType != Blocks.field_150486_ae && blockType != Blocks.field_150447_bR) { + AxisAlignedBB blockAabb; + if(Reflector.ForgeTileEntity_getRenderBoundingBox.exists()) { + blockAabb = (AxisAlignedBB)Reflector.call(te, Reflector.ForgeTileEntity_getRenderBoundingBox, new Object[0]); + if(blockAabb != null) { + return blockAabb; + } + } + + if(blockType != null && blockType != Blocks.field_150461_bJ) { + blockAabb = blockType.func_149668_a(te.func_145831_w(), te.field_145851_c, te.field_145848_d, te.field_145849_e); + if(blockAabb != null) { + return blockAabb; + } + } + + return AABB_INFINITE; + } else { + return AxisAlignedBB.func_72330_a((double)(te.field_145851_c - 1), (double)te.field_145848_d, (double)(te.field_145849_e - 1), (double)(te.field_145851_c + 2), (double)(te.field_145848_d + 2), (double)(te.field_145849_e + 2)); + } + } + } + + public void addToSortedWorldRenderers(WorldRenderer wr) { + if(!wr.inSortedWorldRenderers) { + int pos = this.countSortedWorldRenderers; + wr.updateDistanceToEntitySquared(this.renderViewEntity); + float distSq = wr.sortDistanceToEntitySquared; + int countGreater; + if(this.countSortedWorldRenderers > 0) { + countGreater = 0; + int high = this.countSortedWorldRenderers - 1; + int mid = (countGreater + high) / 2; + + while(countGreater <= high) { + mid = (countGreater + high) / 2; + WorldRenderer wrMid = this.field_72768_k[mid]; + if(distSq < wrMid.sortDistanceToEntitySquared) { + high = mid - 1; + } else { + countGreater = mid + 1; + } + } + + if(countGreater > mid) { + pos = mid + 1; + } else { + pos = mid; + } + } + + countGreater = this.countSortedWorldRenderers - pos; + if(countGreater > 0) { + System.arraycopy(this.field_72768_k, pos, this.field_72768_k, pos + 1, countGreater); + } + + this.field_72768_k[pos] = wr; + wr.inSortedWorldRenderers = true; + ++this.countSortedWorldRenderers; + } + } + + public int getCountRenderers() { + return this.field_72751_K; + } + + public int getCountActiveRenderers() { + return this.field_72746_N; + } + + public int getCountEntitiesRendered() { + return this.field_72749_I; + } + + public int getCountTileEntitiesRendered() { + return this.countTileEntitiesRendered; + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderHelper.java new file mode 100644 index 0000000..87ca14f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderHelper.java @@ -0,0 +1,75 @@ +package net.minecraft.client.renderer; + +import java.nio.FloatBuffer; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +public class RenderHelper { + /** Float buffer used to set OpenGL material colors */ + private static final FloatBuffer colorBuffer = GLAllocation.createDirectFloatBuffer(16); + private static final Vec3 field_82884_b = Vec3.createVectorHelper(0.20000000298023224D, 1.0D, -0.699999988079071D).normalize(); + private static final Vec3 field_82885_c = Vec3.createVectorHelper(-0.20000000298023224D, 1.0D, 0.699999988079071D).normalize(); + + + /** + * Disables the OpenGL lighting properties enabled by enableStandardItemLighting + */ + public static void disableStandardItemLighting() { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_COLOR_MATERIAL); + } + + /** + * Sets the OpenGL lighting properties to the values used when rendering blocks as items + */ + public static void enableStandardItemLighting() { + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glColorMaterial(GL11.GL_FRONT_AND_BACK, GL11.GL_AMBIENT_AND_DIFFUSE); + float var0 = 0.4F; + float var1 = 0.6F; + float var2 = 0.0F; + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, setColorBuffer(field_82884_b.xCoord, field_82884_b.yCoord, field_82884_b.zCoord, 0.0D)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, setColorBuffer(var1, var1, var1, 1.0F)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, setColorBuffer(var2, var2, var2, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, setColorBuffer(field_82885_c.xCoord, field_82885_c.yCoord, field_82885_c.zCoord, 0.0D)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, setColorBuffer(var1, var1, var1, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_SPECULAR, setColorBuffer(var2, var2, var2, 1.0F)); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(var0, var0, var0, 1.0F)); + } + + /** + * Update and return colorBuffer with the RGBA values passed as arguments + */ + private static FloatBuffer setColorBuffer(double p_74517_0_, double p_74517_2_, double p_74517_4_, double p_74517_6_) { + return setColorBuffer((float)p_74517_0_, (float)p_74517_2_, (float)p_74517_4_, (float)p_74517_6_); + } + + /** + * Update and return colorBuffer with the RGBA values passed as arguments + */ + private static FloatBuffer setColorBuffer(float p_74521_0_, float p_74521_1_, float p_74521_2_, float p_74521_3_) { + colorBuffer.clear(); + colorBuffer.put(p_74521_0_).put(p_74521_1_).put(p_74521_2_).put(p_74521_3_); + colorBuffer.flip(); + return colorBuffer; + } + + /** + * Sets OpenGL lighting for rendering blocks as items inside GUI screens (such as containers). + */ + public static void enableGUIStandardItemLighting() { + GL11.glPushMatrix(); + GL11.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(165.0F, 1.0F, 0.0F, 0.0F); + enableStandardItemLighting(); + GL11.glPopMatrix(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderList.java new file mode 100644 index 0000000..8a1b5b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderList.java @@ -0,0 +1,79 @@ +package net.minecraft.client.renderer; + +import java.nio.IntBuffer; +import org.lwjgl.opengl.GL11; + +public class RenderList { + /** + * The location of the 16x16x16 render chunk rendered by this RenderList. + */ + public int renderChunkX; + public int renderChunkY; + public int renderChunkZ; + + /** + * The in-world location of the camera, used to translate the world into the proper position for rendering. + */ + private double cameraX; + private double cameraY; + private double cameraZ; + + /** A list of OpenGL render list IDs rendered by this RenderList. */ + private final IntBuffer glLists = GLAllocation.createDirectIntBuffer(65536); + + /** + * Does this RenderList contain properly-initialized and current data for rendering? + */ + private boolean valid; + + /** Has glLists been flipped to make it ready for reading yet? */ + private boolean bufferFlipped; + + + public void setupRenderList(int p_78422_1_, int p_78422_2_, int p_78422_3_, double p_78422_4_, double p_78422_6_, double p_78422_8_) { + this.valid = true; + this.glLists.clear(); + this.renderChunkX = p_78422_1_; + this.renderChunkY = p_78422_2_; + this.renderChunkZ = p_78422_3_; + this.cameraX = p_78422_4_; + this.cameraY = p_78422_6_; + this.cameraZ = p_78422_8_; + } + + public boolean rendersChunk(int p_78418_1_, int p_78418_2_, int p_78418_3_) { + return this.valid && p_78418_1_ == this.renderChunkX && p_78418_2_ == this.renderChunkY && p_78418_3_ == this.renderChunkZ; + } + + public void addGLRenderList(int p_78420_1_) { + this.glLists.put(p_78420_1_); + + if (this.glLists.remaining() == 0) { + this.callLists(); + } + } + + public void callLists() { + if (this.valid) { + if (!this.bufferFlipped) { + this.glLists.flip(); + this.bufferFlipped = true; + } + + if (this.glLists.remaining() > 0) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)((double)this.renderChunkX - this.cameraX), (float)((double)this.renderChunkY - this.cameraY), (float)((double)this.renderChunkZ - this.cameraZ)); + GL11.glCallLists(this.glLists); + GL11.glPopMatrix(); + } + } + } + + /** + * Resets this RenderList to an uninitialized state. + */ + public void resetList() { + this.valid = false; + this.bufferFlipped = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderSorter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderSorter.java new file mode 100644 index 0000000..d572be1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/RenderSorter.java @@ -0,0 +1,30 @@ +package net.minecraft.client.renderer; + +import java.util.Comparator; +import net.minecraft.entity.EntityLivingBase; + +public class RenderSorter implements Comparator { + /** The entity (usually the player) that the camera is inside. */ + private final EntityLivingBase baseEntity; + + + public RenderSorter(EntityLivingBase p_i1241_1_) { + this.baseEntity = p_i1241_1_; + } + + public int compare(WorldRenderer p_compare_1_, WorldRenderer p_compare_2_) { + if (p_compare_1_.isInFrustum && !p_compare_2_.isInFrustum) { + return 1; + } else if (p_compare_2_.isInFrustum && !p_compare_1_.isInFrustum) { + return -1; + } else { + double var3 = p_compare_1_.distanceToEntitySquared(this.baseEntity); + double var5 = p_compare_2_.distanceToEntitySquared(this.baseEntity); + return var3 < var5 ? 1 : (var3 > var5 ? -1 : (p_compare_1_.chunkIndex < p_compare_2_.chunkIndex ? 1 : -1)); + } + } + + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((WorldRenderer)p_compare_1_, (WorldRenderer)p_compare_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/StitcherException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/StitcherException.java new file mode 100644 index 0000000..4d60b34 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/StitcherException.java @@ -0,0 +1,13 @@ +package net.minecraft.client.renderer; + +import net.minecraft.client.renderer.texture.Stitcher; + +public class StitcherException extends RuntimeException { + private final Stitcher.Holder field_98149_a; + + + public StitcherException(Stitcher.Holder p_i2344_1_, String p_i2344_2_) { + super(p_i2344_2_); + this.field_98149_a = p_i2344_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/Tessellator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/Tessellator.java new file mode 100644 index 0000000..ed9d050 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/Tessellator.java @@ -0,0 +1,579 @@ +package net.minecraft.client.renderer; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; +import java.util.PriorityQueue; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.shader.TesselatorVertexState; +import net.minecraft.client.util.QuadComparator; +import net.minecraft.src.Config; +import net.minecraft.src.VertexData; +import org.lwjgl.opengl.GL11; +import shadersmod.client.ShadersTess; + +public class Tessellator { + /** The byte buffer used for GL allocation. */ + public ByteBuffer byteBuffer; + + /** The same memory as byteBuffer, but referenced as an integer buffer. */ + public IntBuffer intBuffer; + + /** The same memory as byteBuffer, but referenced as an float buffer. */ + public FloatBuffer floatBuffer; + + /** The same memory as byteBuffer, but referenced as an short buffer. */ + public ShortBuffer shortBuffer; + + /** Raw integer array. */ + public int[] rawBuffer; + + /** + * The number of vertices to be drawn in the next draw call. Reset to 0 between draw calls. + */ + public int vertexCount; + + /** The first coordinate to be used for the texture. */ + public double textureU; + + /** The second coordinate to be used for the texture. */ + public double textureV; + public int brightness; + + /** The color (RGBA) value to be used for the following draw call. */ + public int color; + + /** + * Whether the current draw object for this tessellator has color values. + */ + public boolean hasColor; + + /** + * Whether the current draw object for this tessellator has texture coordinates. + */ + public boolean hasTexture; + public boolean hasBrightness; + + /** + * Whether the current draw object for this tessellator has normal values. + */ + public boolean hasNormals; + + /** The index into the raw buffer to be used for the next data. */ + public int rawBufferIndex; + + /** + * The number of vertices manually added to the given draw call. This differs from vertexCount because it adds extra + * vertices when converting quads to triangles. + */ + public int addedVertices; + + /** Disables all color information for the following draw call. */ + private boolean isColorDisabled; + + /** The draw mode currently being used by the tessellator. */ + public int drawMode; + + /** + * An offset to be applied along the x-axis for all vertices in this draw call. + */ + public double xOffset; + + /** + * An offset to be applied along the y-axis for all vertices in this draw call. + */ + public double yOffset; + + /** + * An offset to be applied along the z-axis for all vertices in this draw call. + */ + public double zOffset; + + /** The normal to be applied to the face being drawn. */ + private int normal; + + /** The static instance of the Tessellator. */ + public static Tessellator instance = new Tessellator(524288); + + /** Whether this tessellator is currently in draw mode. */ + public boolean isDrawing; + + /** The size of the buffers used (in integers). */ + public int bufferSize; + private boolean renderingChunk; + private static boolean littleEndianByteOrder = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN; + public static boolean renderingWorldRenderer = false; + public boolean defaultTexture; + public int textureID; + public boolean autoGrow; + private VertexData[] vertexDatas; + private boolean[] drawnIcons; + private TextureAtlasSprite[] vertexQuadIcons; + public ShadersTess shadersTess; + + public Tessellator() { + this(65536); + this.defaultTexture = false; + } + + public Tessellator(int par1) { + this.renderingChunk = false; + this.defaultTexture = true; + this.textureID = 0; + this.autoGrow = true; + this.vertexDatas = null; + this.drawnIcons = new boolean[256]; + this.vertexQuadIcons = null; + this.bufferSize = par1; + this.byteBuffer = GLAllocation.createDirectByteBuffer(par1 * 4); + this.intBuffer = this.byteBuffer.asIntBuffer(); + this.floatBuffer = this.byteBuffer.asFloatBuffer(); + this.shortBuffer = this.byteBuffer.asShortBuffer(); + this.rawBuffer = new int[par1]; + this.vertexDatas = new VertexData[4]; + + for (int ix = 0; ix < this.vertexDatas.length; ++ix) { + this.vertexDatas[ix] = new VertexData(); + } + + this.shadersTess = new ShadersTess(); + } + + /** + * Draws the data set up in this tessellator and resets the state to prepare for new drawing. + */ + public int draw() { + if (Config.isShaders()) { + return ShadersTess.draw(this); + } else { +// if (Config.isFastRender() && OpenGlHelper.glBlendFuncZero && !this.hasTexture && !this.renderingChunk && this.hasColor && this.color == -1 && this.vertexCount == 4) { +// this.vertexCount = 0; +// } + + if (!this.isDrawing) { + throw new IllegalStateException("Not tesselating!"); + } else { + this.isDrawing = false; + + if (this.vertexCount > 0 && (!this.renderingChunk || !Config.isMultiTexture())) { + this.intBuffer.clear(); + this.intBuffer.put(this.rawBuffer, 0, this.rawBufferIndex); + this.byteBuffer.position(0); + this.byteBuffer.limit(this.rawBufferIndex * 4); + + if (this.hasTexture) { + this.floatBuffer.position(3); + GL11.glTexCoordPointer(2, 32, this.floatBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + this.shortBuffer.position(14); + GL11.glTexCoordPointer(2, 32, this.shortBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) { + this.byteBuffer.position(20); + GL11.glColorPointer(4, true, 32, this.byteBuffer); + GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) { + this.byteBuffer.position(24); + GL11.glNormalPointer(32, this.byteBuffer); + GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + } + + this.floatBuffer.position(0); + GL11.glVertexPointer(3, 32, this.floatBuffer); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL11.glDrawArrays(this.drawMode, 0, this.vertexCount); + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + + if (this.hasTexture) { + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) { + GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) { + GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + } + } + + int var1 = this.rawBufferIndex * 4; + this.reset(); + return var1; + } + } + } + + public TesselatorVertexState getVertexState(float p_147564_1_, float p_147564_2_, float p_147564_3_) { + if (this.rawBufferIndex < 1) { + return null; + } else { + int[] var4 = new int[this.rawBufferIndex]; + PriorityQueue var5 = new PriorityQueue(this.rawBufferIndex, new QuadComparator(this.rawBuffer, p_147564_1_ + (float)this.xOffset, p_147564_2_ + (float)this.yOffset, p_147564_3_ + (float)this.zOffset)); + byte var6 = 32; + + if (Config.isShaders()) { + var6 = 72; + } + + int var7; + + for (var7 = 0; var7 < this.rawBufferIndex; var7 += var6) { + var5.add(Integer.valueOf(var7)); + } + + for (var7 = 0; !var5.isEmpty(); var7 += var6) { + int var8 = ((Integer)var5.remove()).intValue(); + + for (int var9 = 0; var9 < var6; ++var9) { + var4[var7 + var9] = this.rawBuffer[var8 + var9]; + } + } + + System.arraycopy(var4, 0, this.rawBuffer, 0, var4.length); + return new TesselatorVertexState(var4, this.rawBufferIndex, this.vertexCount, this.hasTexture, this.hasBrightness, this.hasNormals, this.hasColor); + } + } + + public void setVertexState(TesselatorVertexState p_147565_1_) { + System.arraycopy(p_147565_1_.getRawBuffer(), 0, this.rawBuffer, 0, p_147565_1_.getRawBuffer().length); + this.rawBufferIndex = p_147565_1_.getRawBufferIndex(); + this.vertexCount = p_147565_1_.getVertexCount(); + this.hasTexture = p_147565_1_.getHasTexture(); + this.hasBrightness = p_147565_1_.getHasBrightness(); + this.hasColor = p_147565_1_.getHasColor(); + this.hasNormals = p_147565_1_.getHasNormals(); + } + + /** + * Clears the tessellator state in preparation for new drawing. + */ + public void reset() { + this.vertexCount = 0; + this.byteBuffer.clear(); + this.rawBufferIndex = 0; + this.addedVertices = 0; + } + + /** + * Sets draw mode in the tessellator to draw quads. + */ + public void startDrawingQuads() { + this.startDrawing(7); + } + + /** + * Resets tessellator state and prepares for drawing (with the specified draw mode). + */ + public void startDrawing(int par1) { + if (this.isDrawing) { + throw new IllegalStateException("Already tesselating!"); + } else { + this.isDrawing = true; + this.reset(); + this.drawMode = par1; + this.hasNormals = false; + this.hasColor = false; + this.hasTexture = false; + this.hasBrightness = false; + this.isColorDisabled = false; + } + } + + /** + * Sets the texture coordinates. + */ + public void setTextureUV(double par1, double par3) { + this.hasTexture = true; + this.textureU = par1; + this.textureV = par3; + } + + public void setBrightness(int par1) { + this.hasBrightness = true; + this.brightness = par1; + } + + /** + * Sets the RGB values as specified, converting from floats between 0 and 1 to integers from 0-255. + */ + public void setColorOpaque_F(float par1, float par2, float par3) { + this.setColorOpaque((int)(par1 * 255.0F), (int)(par2 * 255.0F), (int)(par3 * 255.0F)); + } + + /** + * Sets the RGBA values for the color, converting from floats between 0 and 1 to integers from 0-255. + */ + public void setColorRGBA_F(float par1, float par2, float par3, float par4) { + this.setColorRGBA((int)(par1 * 255.0F), (int)(par2 * 255.0F), (int)(par3 * 255.0F), (int)(par4 * 255.0F)); + } + + /** + * Sets the RGB values as specified, and sets alpha to opaque. + */ + public void setColorOpaque(int par1, int par2, int par3) { + this.setColorRGBA(par1, par2, par3, CheatBreaker.getInstance() != null && CheatBreaker.getInstance().getModuleManager() != null && CheatBreaker.getInstance().getModuleManager().staffModuleXray.isEnabled() ? (Integer) CheatBreaker.getInstance().getModuleManager().staffModuleXray.opacity.getValue() : 255); + } + + /** + * Sets the RGBA values for the color. Also clamps them to 0-255. + */ + public void setColorRGBA(int par1, int par2, int par3, int par4) { + if (!this.isColorDisabled) { + if (par1 > 255) { + par1 = 255; + } + + if (par2 > 255) { + par2 = 255; + } + + if (par3 > 255) { + par3 = 255; + } + + if (par4 > 255) { + par4 = 255; + } + + if (par1 < 0) { + par1 = 0; + } + + if (par2 < 0) { + par2 = 0; + } + + if (par3 < 0) { + par3 = 0; + } + + if (par4 < 0) { + par4 = 0; + } + + this.hasColor = true; + + if (littleEndianByteOrder) { + this.color = par4 << 24 | par3 << 16 | par2 << 8 | par1; + } else { + this.color = par1 << 24 | par2 << 16 | par3 << 8 | par4; + } + } + } + + public void func_154352_a(byte p_154352_1_, byte p_154352_2_, byte p_154352_3_) { + this.setColorOpaque(p_154352_1_ & 255, p_154352_2_ & 255, p_154352_3_ & 255); + } + + /** + * Adds a vertex specifying both x,y,z and the texture u,v for it. + */ + public void addVertexWithUV(double x, double y, double z, double u, double v) { + this.setTextureUV(u, v); + this.addVertex(x, y, z); + } + + /** + * Adds a vertex with the specified x,y,z to the current draw call. It will trigger a draw() if the buffer gets + * full. + */ + public void addVertex(double par1, double par3, double par5) { + if (Config.isShaders()) { + ShadersTess.addVertex(this, par1, par3, par5); + } else { + if (this.autoGrow && this.rawBufferIndex >= this.bufferSize - 32) { + Config.dbg("Expand tessellator buffer, old: " + this.bufferSize + ", new: " + this.bufferSize * 2); + this.bufferSize *= 2; + int[] newRawBuffer = new int[this.bufferSize]; + System.arraycopy(this.rawBuffer, 0, newRawBuffer, 0, this.rawBuffer.length); + this.rawBuffer = newRawBuffer; + this.byteBuffer = GLAllocation.createDirectByteBuffer(this.bufferSize * 4); + this.intBuffer = this.byteBuffer.asIntBuffer(); + this.floatBuffer = this.byteBuffer.asFloatBuffer(); + this.shortBuffer = this.byteBuffer.asShortBuffer(); + + if (this.vertexQuadIcons != null) { + TextureAtlasSprite[] newVertexQuadIcons = new TextureAtlasSprite[this.bufferSize / 4]; + System.arraycopy(this.vertexQuadIcons, 0, newVertexQuadIcons, 0, this.vertexQuadIcons.length); + this.vertexQuadIcons = newVertexQuadIcons; + } + } + + ++this.addedVertices; + + if (this.hasTexture) { + this.rawBuffer[this.rawBufferIndex + 3] = Float.floatToRawIntBits((float)this.textureU); + this.rawBuffer[this.rawBufferIndex + 4] = Float.floatToRawIntBits((float)this.textureV); + } + + if (this.hasBrightness) { + this.rawBuffer[this.rawBufferIndex + 7] = this.brightness; + } + + if (this.hasColor) { + this.rawBuffer[this.rawBufferIndex + 5] = this.color; + } + + if (this.hasNormals) { + this.rawBuffer[this.rawBufferIndex + 6] = this.normal; + } + + this.rawBuffer[this.rawBufferIndex + 0] = Float.floatToRawIntBits((float)(par1 + this.xOffset)); + this.rawBuffer[this.rawBufferIndex + 1] = Float.floatToRawIntBits((float)(par3 + this.yOffset)); + this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset)); + this.rawBufferIndex += 8; + ++this.vertexCount; + + if (!this.autoGrow && this.addedVertices % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32) { + this.draw(); + this.isDrawing = true; + } + } + } + + /** + * Sets the color to the given opaque value (stored as byte values packed in an integer). + */ + public void setColorOpaque_I(int par1) { + int var2 = par1 >> 16 & 255; + int var3 = par1 >> 8 & 255; + int var4 = par1 & 255; + this.setColorOpaque(var2, var3, var4); + } + + /** + * Sets the color to the given color (packed as bytes in integer) and alpha values. + */ + public void setColorRGBA_I(int par1, int par2) { + int var3 = par1 >> 16 & 255; + int var4 = par1 >> 8 & 255; + int var5 = par1 & 255; + this.setColorRGBA(var3, var4, var5, par2); + } + + /** + * Disables colors for the current draw call. + */ + public void disableColor() { + this.isColorDisabled = true; + } + + /** + * Sets the normal for the current draw call. + */ + public void setNormal(float par1, float par2, float par3) { + if (Config.isShaders()) { + ShadersTess var4 = this.shadersTess; + var4.normalX = par1; + var4.normalY = par2; + var4.normalZ = par3; + } + + this.hasNormals = true; + byte var41 = (byte)((int)(par1 * 127.0F)); + byte var5 = (byte)((int)(par2 * 127.0F)); + byte var6 = (byte)((int)(par3 * 127.0F)); + this.normal = var41 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16; + } + + /** + * Sets the translation for all vertices in the current draw call. + */ + public void setTranslation(double par1, double par3, double par5) { + this.xOffset = par1; + this.yOffset = par3; + this.zOffset = par5; + } + + /** + * Offsets the translation for all vertices in the current draw call. + */ + public void addTranslation(float par1, float par2, float par3) { + this.xOffset += (double)par1; + this.yOffset += (double)par2; + this.zOffset += (double)par3; + } + + public boolean isRenderingChunk() { + return this.renderingChunk; + } + + public void setRenderingChunk(boolean renderingChunk) { + this.renderingChunk = renderingChunk; + } + + private void draw(int startQuadVertex, int endQuadVertex) { + int vxQuadCount = endQuadVertex - startQuadVertex; + + if (vxQuadCount > 0) { + int startVertex = startQuadVertex * 4; + int vxCount = vxQuadCount * 4; + this.floatBuffer.position(3); + GL11.glTexCoordPointer(2, 32, this.floatBuffer); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + this.shortBuffer.position(14); + GL11.glTexCoordPointer(2, 32, this.shortBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + this.byteBuffer.position(20); + GL11.glColorPointer(4, true, 32, this.byteBuffer); + this.floatBuffer.position(0); + GL11.glVertexPointer(3, 32, this.floatBuffer); + GL11.glDrawArrays(this.drawMode, startVertex, vxCount); + } + } + + private int drawForIcon(TextureAtlasSprite icon, int startQuadPos) { + icon.bindOwnTexture(); + int firstRegionEnd = -1; + int lastPos = -1; + int numQuads = this.addedVertices / 4; + + for (int i = startQuadPos; i < numQuads; ++i) { + TextureAtlasSprite ts = this.vertexQuadIcons[i]; + + if (ts == icon) { + if (lastPos < 0) { + lastPos = i; + } + } else if (lastPos >= 0) { + this.draw(lastPos, i); + lastPos = -1; + + if (firstRegionEnd < 0) { + firstRegionEnd = i; + } + } + } + + if (lastPos >= 0) { + this.draw(lastPos, numQuads); + } + + if (firstRegionEnd < 0) { + firstRegionEnd = numQuads; + } + + return firstRegionEnd; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java new file mode 100644 index 0000000..1a1df11 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/ThreadDownloadImageData.java @@ -0,0 +1,208 @@ +package net.minecraft.client.renderer; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.Proxy; +import java.net.URL; +import java.net.Proxy.Type; +import java.util.concurrent.atomic.AtomicInteger; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.src.CapeImageBuffer; +import net.minecraft.src.Config; +import net.minecraft.src.HttpPipeline; +import net.minecraft.src.HttpRequest; +import net.minecraft.src.HttpResponse; +import net.minecraft.src.TextureUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ThreadDownloadImageData extends SimpleTexture { + private static final Logger logger = LogManager.getLogger(); + private static final AtomicInteger field_147643_d = new AtomicInteger(0); + private final File field_152434_e; + private final String imageUrl; + private final IImageBuffer imageBuffer; + private BufferedImage bufferedImage; + private Thread imageThread; + private boolean textureUploaded; + public Boolean imageFound = null; + public boolean pipeline = false; + + public static Runtime runtime = Runtime.getRuntime(); + + public ThreadDownloadImageData(File par1GuiCreateFlatWorld, String p_i1049_2_, ResourceLocation p_i1049_3_, IImageBuffer p_i1049_4_) { + super(p_i1049_3_); + this.field_152434_e = par1GuiCreateFlatWorld; + this.imageUrl = p_i1049_2_; + this.imageBuffer = p_i1049_4_; + } + + private void func_147640_e() { + if (!this.textureUploaded && this.bufferedImage != null) { + this.textureUploaded = true; + + if (this.textureLocation != null) { + this.func_147631_c(); + } + + TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage); + } + } + + public int getGlTextureId() { + this.func_147640_e(); + return super.getGlTextureId(); + } + + public void func_147641_a(BufferedImage p_147641_1_) { + this.bufferedImage = p_147641_1_; + + if (this.imageBuffer != null) { + this.imageBuffer.func_152634_a(); + } + + this.imageFound = Boolean.valueOf(this.bufferedImage != null); + } + + public void loadTexture(IResourceManager par1ResourceManager) throws IOException { + if (this.bufferedImage == null && this.textureLocation != null) { + super.loadTexture(par1ResourceManager); + } + + if (this.imageThread == null) { + if (this.field_152434_e != null && this.field_152434_e.isFile()) { + logger.debug("Loading http texture from local cache ({})", new Object[] {this.field_152434_e}); + + try { + this.bufferedImage = ImageIO.read(this.field_152434_e); + + if (this.imageBuffer != null) { + this.func_147641_a(this.imageBuffer.parseUserSkin(this.bufferedImage)); + } + + this.loadingFinished(); + } catch (IOException var3) { + logger.error("Couldn\'t load skin " + this.field_152434_e, var3); + this.func_152433_a(); + } + } else { + this.func_152433_a(); + } + } + } + + protected void func_152433_a() { + this.imageThread = new Thread("Texture Downloader #" + field_147643_d.incrementAndGet()) { + public void run() { + HttpURLConnection var1 = null; + ThreadDownloadImageData.logger.debug("Downloading http texture from {} to {}", new Object[] {ThreadDownloadImageData.this.imageUrl, ThreadDownloadImageData.this.field_152434_e}); + + if (ThreadDownloadImageData.this.shouldPipeline()) { + ThreadDownloadImageData.this.loadPipelined(); + } else { + try { + var1 = (HttpURLConnection)(new URL(ThreadDownloadImageData.this.imageUrl)).openConnection(Minecraft.getMinecraft().getProxy()); + var1.setDoInput(true); + var1.setDoOutput(false); + var1.connect(); + + if (var1.getResponseCode() / 100 != 2) { + if (var1.getErrorStream() != null) { + Config.readAll(var1.getErrorStream()); + } + + return; + } + + BufferedImage var6; + + if (ThreadDownloadImageData.this.field_152434_e != null) { + FileUtils.copyInputStreamToFile(var1.getInputStream(), ThreadDownloadImageData.this.field_152434_e); + var6 = ImageIO.read(ThreadDownloadImageData.this.field_152434_e); + } else { + var6 = ImageIO.read(var1.getInputStream()); + } + + if (ThreadDownloadImageData.this.imageBuffer != null) { + var6 = ThreadDownloadImageData.this.imageBuffer.parseUserSkin(var6); + } + + ThreadDownloadImageData.this.func_147641_a(var6); + } catch (Exception var61) { + ThreadDownloadImageData.logger.error("Couldn\'t download http texture: " + var61.getClass().getName() + ": " + var61.getMessage()); + } + finally { + if (var1 != null) { + var1.disconnect(); + } + + ThreadDownloadImageData.this.loadingFinished(); + } + } + } + }; + this.imageThread.setDaemon(true); + this.imageThread.start(); + } + + private boolean shouldPipeline() { + if (!this.pipeline) { + return false; + } else { + Proxy proxy = Minecraft.getMinecraft().getProxy(); + return proxy.type() != Type.DIRECT && proxy.type() != Type.SOCKS ? false : this.imageUrl.startsWith("http://"); + } + } + + private void loadPipelined() { + try { + HttpRequest var6 = HttpPipeline.makeRequest(this.imageUrl, Minecraft.getMinecraft().getProxy()); + HttpResponse resp = HttpPipeline.executeRequest(var6); + + if (resp.getStatus() / 100 == 2) { + byte[] body = resp.getBody(); + ByteArrayInputStream bais = new ByteArrayInputStream(body); + BufferedImage var2; + + if (this.field_152434_e != null) { + FileUtils.copyInputStreamToFile(bais, this.field_152434_e); + var2 = ImageIO.read(this.field_152434_e); + } else { + var2 = TextureUtils.readBufferedImage(bais); + } + + if (this.imageBuffer != null) { + var2 = this.imageBuffer.parseUserSkin(var2); + } + + this.func_147641_a(var2); + return; + } + + return; + } catch (Exception var9) { + logger.error("Couldn\'t download http texture: " + var9.getClass().getName() + ": " + var9.getMessage()); + } + finally { + this.loadingFinished(); + } + } + + private void loadingFinished() { + this.imageFound = Boolean.valueOf(this.bufferedImage != null); + + if (this.imageBuffer instanceof CapeImageBuffer) { + CapeImageBuffer cib = (CapeImageBuffer)this.imageBuffer; + cib.cleanup(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/WorldRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/WorldRenderer.java new file mode 100644 index 0000000..5f6055f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/WorldRenderer.java @@ -0,0 +1,445 @@ +package net.minecraft.client.renderer; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.shader.TesselatorVertexState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.src.ChunkCacheOF; +import net.minecraft.src.Config; +import net.minecraft.src.Reflector; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import org.lwjgl.opengl.GL11; + +public class WorldRenderer { + protected TesselatorVertexState vertexState; + + /** Reference to the World object. */ + public World worldObj; + protected int glRenderList; + protected Tessellator tessellator; + public static volatile int chunksUpdated; + public int posX; + public int posY; + public int posZ; + + /** Pos X minus */ + public int posXMinus; + + /** Pos Y minus */ + public int posYMinus; + + /** Pos Z minus */ + public int posZMinus; + + /** Pos X clipped */ + public int posXClip; + + /** Pos Y clipped */ + public int posYClip; + + /** Pos Z clipped */ + public int posZClip; + public boolean isInFrustum; + + /** Should this renderer skip this render pass */ + public boolean[] skipRenderPass; + + /** Pos X plus */ + public int posXPlus; + + /** Pos Y plus */ + public int posYPlus; + + /** Pos Z plus */ + public int posZPlus; + + /** Boolean for whether this renderer needs to be updated or not */ + public volatile boolean needsUpdate; + + /** Axis aligned bounding box */ + public AxisAlignedBB rendererBoundingBox; + + /** Chunk index */ + public int chunkIndex; + + /** Is this renderer visible according to the occlusion query */ + public boolean isVisible; + + /** Is this renderer waiting on the result of the occlusion query */ + public boolean isWaitingOnOcclusionQuery; + + /** OpenGL occlusion query */ + public int glOcclusionQuery; + + /** Is the chunk lit */ + public boolean isChunkLit; + protected boolean isInitialized; + public List tileEntityRenderers; + protected List tileEntities; + + /** Bytes sent to the GPU */ + protected int bytesDrawn; + public boolean isVisibleFromPosition; + public double visibleFromX; + public double visibleFromY; + public double visibleFromZ; + public boolean isInFrustrumFully; + protected boolean needsBoxUpdate; + public volatile boolean isUpdating; + public float sortDistanceToEntitySquared; + public double distanceToEntityXzSq; + protected boolean skipAllRenderPasses; + public boolean inSortedWorldRenderers; + public boolean needVertexStateResort; + public RenderGlobal renderGlobal; + public static int globalChunkOffsetX = 0; + public static int globalChunkOffsetZ = 0; + + public WorldRenderer(World par1World, List par2List, int par3, int par4, int par5, int par6) { + this.tessellator = Tessellator.instance; + this.skipRenderPass = new boolean[] {true, true}; + this.tileEntityRenderers = new ArrayList(); + this.isVisibleFromPosition = false; + this.isInFrustrumFully = false; + this.needsBoxUpdate = false; + this.isUpdating = false; + this.skipAllRenderPasses = true; + this.renderGlobal = Minecraft.getMinecraft().renderGlobal; + this.glRenderList = -1; + this.isInFrustum = false; + this.isVisible = true; + this.isInitialized = false; + this.worldObj = par1World; + this.vertexState = null; + this.tileEntities = par2List; + this.glRenderList = par6; + this.posX = -999; + this.setPosition(par3, par4, par5); + this.needsUpdate = false; + } + + /** + * Sets a new position for the renderer and setting it up so it can be reloaded with the new data for that position + */ + public void setPosition(int par1, int par2, int par3) { + if (par1 != this.posX || par2 != this.posY || par3 != this.posZ) { + this.setDontDraw(); + this.posX = par1; + this.posY = par2; + this.posZ = par3; + this.posXPlus = par1 + 8; + this.posYPlus = par2 + 8; + this.posZPlus = par3 + 8; + this.posXClip = par1 & 1023; + this.posYClip = par2; + this.posZClip = par3 & 1023; + this.posXMinus = par1 - this.posXClip; + this.posYMinus = par2 - this.posYClip; + this.posZMinus = par3 - this.posZClip; + this.rendererBoundingBox = AxisAlignedBB.getBoundingBox((double)par1, (double)par2, (double)par3, (double)(par1 + 16), (double)(par2 + 16), (double)(par3 + 16)); + this.needsBoxUpdate = true; + this.markDirty(); + this.isVisibleFromPosition = false; + } + } + + protected void setupGLTranslation() { + GL11.glTranslatef((float)this.posXClip, (float)this.posYClip, (float)this.posZClip); + } + + /** + * Will update this chunk renderer + */ + public void updateRenderer(EntityLivingBase p_147892_1_) { + if (this.worldObj != null) { + if (this.needsBoxUpdate) { + GL11.glNewList(this.glRenderList + 2, GL11.GL_COMPILE); + RenderItem.renderAABB(AxisAlignedBB.getBoundingBox((double)this.posXClip, (double)this.posYClip, (double)this.posZClip, (double)(this.posXClip + 16), (double)(this.posYClip + 16), (double)(this.posZClip + 16))); + GL11.glEndList(); + this.needsBoxUpdate = false; + } + + this.isVisible = true; + this.isVisibleFromPosition = false; + + if (this.needsUpdate) { + this.needsUpdate = false; + int xMin = this.posX; + int yMin = this.posY; + int zMain = this.posZ; + int xMax = this.posX + 16; + int yMax = this.posY + 16; + int zMax = this.posZ + 16; + + for (int var26 = 0; var26 < 2; ++var26) { + this.skipRenderPass[var26] = true; + } + + this.skipAllRenderPasses = true; + + if (Reflector.LightCache.exists()) { + Object var29 = Reflector.getFieldValue(Reflector.LightCache_cache); + Reflector.callVoid(var29, Reflector.LightCache_clear, new Object[0]); + Reflector.callVoid(Reflector.BlockCoord_resetPool, new Object[0]); + } + + Chunk.isLit = false; + HashSet var30 = new HashSet(); + var30.addAll(this.tileEntityRenderers); + this.tileEntityRenderers.clear(); + Minecraft var9 = Minecraft.getMinecraft(); + EntityLivingBase var10 = var9.renderViewEntity; + int viewEntityPosX = MathHelper.floor_double(var10.posX); + int viewEntityPosY = MathHelper.floor_double(var10.posY); + int viewEntityPosZ = MathHelper.floor_double(var10.posZ); + byte var14 = 1; + ChunkCacheOF chunkcache = new ChunkCacheOF(this.worldObj, xMin - var14, yMin - var14, zMain - var14, xMax + var14, yMax + var14, zMax + var14, var14); + + if (!chunkcache.extendedLevelsInChunkCache()) { + ++chunksUpdated; + chunkcache.renderStart(); + RenderBlocks var27 = new RenderBlocks(chunkcache); + Reflector.callVoid(Reflector.ForgeHooksClient_setWorldRendererRB, new Object[] {var27}); + this.bytesDrawn = 0; + this.vertexState = null; + this.tessellator = Tessellator.instance; + boolean hasForge = Reflector.ForgeHooksClient.exists(); + + for (int renderPass = 0; renderPass < 2; ++renderPass) { + boolean renderNextPass = false; + boolean hasRenderedBlocks = false; + boolean hasGlList = false; + + for (int y = yMin; y < yMax; ++y) { + for (int z = zMain; z < zMax; ++z) { + for (int x = xMin; x < xMax; ++x) { + Block block = chunkcache.getBlock(x, y, z); + + if (block.getMaterial() != Material.air) { + if (!hasGlList) { + hasGlList = true; + this.preRenderBlocks(renderPass); + } + + boolean hasTileEntity = false; + + if (hasForge) { + hasTileEntity = Reflector.callBoolean(block, Reflector.ForgeBlock_hasTileEntity, new Object[] {Integer.valueOf(chunkcache.getBlockMetadata(x, y, z))}); + } + else { + hasTileEntity = block.hasTileEntity(); + } + + if (renderPass == 0 && hasTileEntity) { + TileEntity blockPass = chunkcache.getTileEntity(x, y, z); + + if (TileEntityRendererDispatcher.instance.hasSpecialRenderer(blockPass)) + { + this.tileEntityRenderers.add(blockPass); + } + } + + int var32 = block.getRenderBlockPass(); + + if (var32 > renderPass) { + renderNextPass = true; + } + + boolean canRender = var32 == renderPass; + + if (Reflector.ForgeBlock_canRenderInPass.exists()) { + canRender = Reflector.callBoolean(block, Reflector.ForgeBlock_canRenderInPass, new Object[] {Integer.valueOf(renderPass)}); + } + + if (canRender) { + hasRenderedBlocks |= var27.renderBlockByRenderType(block, x, y, z); + + if (block.getRenderType() == 0 && x == viewEntityPosX && y == viewEntityPosY && z == viewEntityPosZ) + { + var27.setRenderFromInside(true); + var27.setRenderAllFaces(true); + var27.renderBlockByRenderType(block, x, y, z); + var27.setRenderFromInside(false); + var27.setRenderAllFaces(false); + } + } + } + } + } + } + + if (hasRenderedBlocks) { + this.skipRenderPass[renderPass] = false; + } + + if (hasGlList) { + this.postRenderBlocks(renderPass, p_147892_1_); + } else { + hasRenderedBlocks = false; + } + + if (!renderNextPass) { + break; + } + } + + Reflector.callVoid(Reflector.ForgeHooksClient_setWorldRendererRB, new Object[] {(RenderBlocks)null}); + chunkcache.renderFinish(); + } + + HashSet var31 = new HashSet(); + var31.addAll(this.tileEntityRenderers); + var31.removeAll(var30); + this.tileEntities.addAll(var31); + var30.removeAll(this.tileEntityRenderers); + this.tileEntities.removeAll(var30); + this.isChunkLit = Chunk.isLit; + this.isInitialized = true; + this.skipAllRenderPasses = this.skipRenderPass[0] && this.skipRenderPass[1]; + this.updateFinished(); + } + } + } + + protected void preRenderBlocks(int renderpass) { + GL11.glNewList(this.glRenderList + renderpass, GL11.GL_COMPILE); + this.tessellator.setRenderingChunk(true); + + if (Config.isFastRender()) { + Reflector.callVoid(Reflector.ForgeHooksClient_onPreRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.startDrawingQuads(); + this.tessellator.setTranslation((double)(-globalChunkOffsetX), 0.0D, (double)(-globalChunkOffsetZ)); + } else { + GL11.glPushMatrix(); + this.setupGLTranslation(); + float var2 = 1.000001F; + GL11.glTranslatef(-8.0F, -8.0F, -8.0F); + GL11.glScalef(var2, var2, var2); + GL11.glTranslatef(8.0F, 8.0F, 8.0F); + Reflector.callVoid(Reflector.ForgeHooksClient_onPreRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.startDrawingQuads(); + this.tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); + } + } + + protected void postRenderBlocks(int renderpass, EntityLivingBase entityLiving) { + if (Config.isTranslucentBlocksFancy() && renderpass == 1 && !this.skipRenderPass[renderpass]) { + this.vertexState = this.tessellator.getVertexState((float)entityLiving.posX, (float)entityLiving.posY, (float)entityLiving.posZ); + } + + this.bytesDrawn += this.tessellator.draw(); + Reflector.callVoid(Reflector.ForgeHooksClient_onPostRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.setRenderingChunk(false); + + if (!Config.isFastRender()) { + GL11.glPopMatrix(); + } + + GL11.glEndList(); + this.tessellator.setTranslation(0.0D, 0.0D, 0.0D); + } + + public void updateRendererSort(EntityLivingBase p_147889_1_) { + if (this.vertexState != null && !this.skipRenderPass[1]) { + this.tessellator = Tessellator.instance; + this.preRenderBlocks(1); + this.tessellator.setVertexState(this.vertexState); + this.postRenderBlocks(1, p_147889_1_); + } + } + + /** + * Returns the distance of this chunk renderer to the entity without performing the final normalizing square root, + * for performance reasons. + */ + public float distanceToEntitySquared(Entity par1Entity) { + float var2 = (float)(par1Entity.posX - (double)this.posXPlus); + float var3 = (float)(par1Entity.posY - (double)this.posYPlus); + float var4 = (float)(par1Entity.posZ - (double)this.posZPlus); + return var2 * var2 + var3 * var3 + var4 * var4; + } + + /** + * When called this renderer won't draw anymore until its gets initialized again + */ + public void setDontDraw() { + for (int var1 = 0; var1 < 2; ++var1) { + this.skipRenderPass[var1] = true; + } + + this.skipAllRenderPasses = true; + this.isInFrustum = false; + this.isInitialized = false; + this.vertexState = null; + } + + public void stopRendering() { + this.setDontDraw(); + this.worldObj = null; + } + + /** + * Takes in the pass the call list is being requested for. Args: renderPass + */ + public int getGLCallListForPass(int par1) { + return this.glRenderList + par1; + } + + public void updateInFrustum(ICamera par1ICamera) { + this.isInFrustum = par1ICamera.isBoundingBoxInFrustum(this.rendererBoundingBox); + + if (this.isInFrustum && Config.isOcclusionFancy()) { + this.isInFrustrumFully = par1ICamera.isBoundingBoxInFrustumFully(this.rendererBoundingBox); + } else { + this.isInFrustrumFully = false; + } + } + + /** + * Renders the occlusion query GL List + */ + public void callOcclusionQueryList() { + GL11.glCallList(this.glRenderList + 2); + } + + /** + * Checks if all render passes are to be skipped. Returns false if the renderer is not initialized + */ + public boolean skipAllRenderPasses() { + return this.skipAllRenderPasses; + } + + /** + * Marks the current renderer data as dirty and needing to be updated. + */ + public void markDirty() { + this.needsUpdate = true; + } + + protected void updateFinished() { + if (!this.skipAllRenderPasses && !this.inSortedWorldRenderers) { + Minecraft.getMinecraft().renderGlobal.addToSortedWorldRenderers(this); + } + } + + public void updateDistanceToEntitySquared(Entity entity) { + double dx = entity.posX - (double)this.posXPlus; + double dy = entity.posY - (double)this.posYPlus; + double dz = entity.posZ - (double)this.posZPlus; + double dXzSq = dx * dx + dz * dz; + this.distanceToEntityXzSq = dXzSq; + this.sortDistanceToEntitySquared = (float)(dXzSq + dy * dy); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java new file mode 100644 index 0000000..2c53eed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ClippingHelper.java @@ -0,0 +1,49 @@ +package net.minecraft.client.renderer.culling; + +public class ClippingHelper { + public float[][] frustum = new float[16][16]; + public float[] projectionMatrix = new float[16]; + public float[] modelviewMatrix = new float[16]; + public float[] clippingMatrix = new float[16]; + + /** + * Returns true if the box is inside all 6 clipping planes, otherwise returns false. + */ + public boolean isBoxInFrustum(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { + for (int i = 0; i < 6; ++i) { + float minXf = (float)minX; + float minYf = (float)minY; + float minZf = (float)minZ; + float maxXf = (float)maxX; + float maxYf = (float)maxY; + float maxZf = (float)maxZ; + + if (this.frustum[i][0] * minXf + this.frustum[i][1] * minYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * minYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * minXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * minXf + this.frustum[i][1] * minYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * minYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * minXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F) { + return false; + } + } + + return true; + } + + public boolean isBoxInFrustumFully(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { + for (int i = 0; i < 6; ++i) { + float minXf = (float)minX; + float minYf = (float)minY; + float minZf = (float)minZ; + float maxXf = (float)maxX; + float maxYf = (float)maxY; + float maxZf = (float)maxZ; + + if (i < 4) { + if (this.frustum[i][0] * minXf + this.frustum[i][1] * minYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F || this.frustum[i][0] * maxXf + this.frustum[i][1] * minYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F || this.frustum[i][0] * minXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F || this.frustum[i][0] * maxXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F || this.frustum[i][0] * minXf + this.frustum[i][1] * minYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F || this.frustum[i][0] * maxXf + this.frustum[i][1] * minYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F || this.frustum[i][0] * minXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F || this.frustum[i][0] * maxXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F) { + return false; + } + } else if (this.frustum[i][0] * minXf + this.frustum[i][1] * minYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * minYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * minXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * minZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * minXf + this.frustum[i][1] * minYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * minYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * minXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F && this.frustum[i][0] * maxXf + this.frustum[i][1] * maxYf + this.frustum[i][2] * maxZf + this.frustum[i][3] <= 0.0F) { + return false; + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java new file mode 100644 index 0000000..6402edb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java @@ -0,0 +1,91 @@ +package net.minecraft.client.renderer.culling; + +import java.nio.FloatBuffer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ClippingHelperImpl extends ClippingHelper { + private static final ClippingHelperImpl instance = new ClippingHelperImpl(); + private final FloatBuffer projectionMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); + private final FloatBuffer modelviewMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); + private final FloatBuffer field_78564_h = GLAllocation.createDirectFloatBuffer(16); + + + /** + * Initialises the ClippingHelper object then returns an instance of it. + */ + public static ClippingHelper getInstance() { + instance.init(); + return instance; + } + + /** + * Normalize the frustum. + */ + private void normalize(float[][] p_78559_1_, int p_78559_2_) { + float var3 = MathHelper.sqrt_float(p_78559_1_[p_78559_2_][0] * p_78559_1_[p_78559_2_][0] + p_78559_1_[p_78559_2_][1] * p_78559_1_[p_78559_2_][1] + p_78559_1_[p_78559_2_][2] * p_78559_1_[p_78559_2_][2]); + p_78559_1_[p_78559_2_][0] /= var3; + p_78559_1_[p_78559_2_][1] /= var3; + p_78559_1_[p_78559_2_][2] /= var3; + p_78559_1_[p_78559_2_][3] /= var3; + } + + private void init() { + this.projectionMatrixBuffer.clear(); + this.modelviewMatrixBuffer.clear(); + this.field_78564_h.clear(); + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.projectionMatrixBuffer); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.modelviewMatrixBuffer); + this.projectionMatrixBuffer.flip().limit(16); + this.projectionMatrixBuffer.get(this.projectionMatrix); + this.modelviewMatrixBuffer.flip().limit(16); + this.modelviewMatrixBuffer.get(this.modelviewMatrix); + this.clippingMatrix[0] = this.modelviewMatrix[0] * this.projectionMatrix[0] + this.modelviewMatrix[1] * this.projectionMatrix[4] + this.modelviewMatrix[2] * this.projectionMatrix[8] + this.modelviewMatrix[3] * this.projectionMatrix[12]; + this.clippingMatrix[1] = this.modelviewMatrix[0] * this.projectionMatrix[1] + this.modelviewMatrix[1] * this.projectionMatrix[5] + this.modelviewMatrix[2] * this.projectionMatrix[9] + this.modelviewMatrix[3] * this.projectionMatrix[13]; + this.clippingMatrix[2] = this.modelviewMatrix[0] * this.projectionMatrix[2] + this.modelviewMatrix[1] * this.projectionMatrix[6] + this.modelviewMatrix[2] * this.projectionMatrix[10] + this.modelviewMatrix[3] * this.projectionMatrix[14]; + this.clippingMatrix[3] = this.modelviewMatrix[0] * this.projectionMatrix[3] + this.modelviewMatrix[1] * this.projectionMatrix[7] + this.modelviewMatrix[2] * this.projectionMatrix[11] + this.modelviewMatrix[3] * this.projectionMatrix[15]; + this.clippingMatrix[4] = this.modelviewMatrix[4] * this.projectionMatrix[0] + this.modelviewMatrix[5] * this.projectionMatrix[4] + this.modelviewMatrix[6] * this.projectionMatrix[8] + this.modelviewMatrix[7] * this.projectionMatrix[12]; + this.clippingMatrix[5] = this.modelviewMatrix[4] * this.projectionMatrix[1] + this.modelviewMatrix[5] * this.projectionMatrix[5] + this.modelviewMatrix[6] * this.projectionMatrix[9] + this.modelviewMatrix[7] * this.projectionMatrix[13]; + this.clippingMatrix[6] = this.modelviewMatrix[4] * this.projectionMatrix[2] + this.modelviewMatrix[5] * this.projectionMatrix[6] + this.modelviewMatrix[6] * this.projectionMatrix[10] + this.modelviewMatrix[7] * this.projectionMatrix[14]; + this.clippingMatrix[7] = this.modelviewMatrix[4] * this.projectionMatrix[3] + this.modelviewMatrix[5] * this.projectionMatrix[7] + this.modelviewMatrix[6] * this.projectionMatrix[11] + this.modelviewMatrix[7] * this.projectionMatrix[15]; + this.clippingMatrix[8] = this.modelviewMatrix[8] * this.projectionMatrix[0] + this.modelviewMatrix[9] * this.projectionMatrix[4] + this.modelviewMatrix[10] * this.projectionMatrix[8] + this.modelviewMatrix[11] * this.projectionMatrix[12]; + this.clippingMatrix[9] = this.modelviewMatrix[8] * this.projectionMatrix[1] + this.modelviewMatrix[9] * this.projectionMatrix[5] + this.modelviewMatrix[10] * this.projectionMatrix[9] + this.modelviewMatrix[11] * this.projectionMatrix[13]; + this.clippingMatrix[10] = this.modelviewMatrix[8] * this.projectionMatrix[2] + this.modelviewMatrix[9] * this.projectionMatrix[6] + this.modelviewMatrix[10] * this.projectionMatrix[10] + this.modelviewMatrix[11] * this.projectionMatrix[14]; + this.clippingMatrix[11] = this.modelviewMatrix[8] * this.projectionMatrix[3] + this.modelviewMatrix[9] * this.projectionMatrix[7] + this.modelviewMatrix[10] * this.projectionMatrix[11] + this.modelviewMatrix[11] * this.projectionMatrix[15]; + this.clippingMatrix[12] = this.modelviewMatrix[12] * this.projectionMatrix[0] + this.modelviewMatrix[13] * this.projectionMatrix[4] + this.modelviewMatrix[14] * this.projectionMatrix[8] + this.modelviewMatrix[15] * this.projectionMatrix[12]; + this.clippingMatrix[13] = this.modelviewMatrix[12] * this.projectionMatrix[1] + this.modelviewMatrix[13] * this.projectionMatrix[5] + this.modelviewMatrix[14] * this.projectionMatrix[9] + this.modelviewMatrix[15] * this.projectionMatrix[13]; + this.clippingMatrix[14] = this.modelviewMatrix[12] * this.projectionMatrix[2] + this.modelviewMatrix[13] * this.projectionMatrix[6] + this.modelviewMatrix[14] * this.projectionMatrix[10] + this.modelviewMatrix[15] * this.projectionMatrix[14]; + this.clippingMatrix[15] = this.modelviewMatrix[12] * this.projectionMatrix[3] + this.modelviewMatrix[13] * this.projectionMatrix[7] + this.modelviewMatrix[14] * this.projectionMatrix[11] + this.modelviewMatrix[15] * this.projectionMatrix[15]; + this.frustum[0][0] = this.clippingMatrix[3] - this.clippingMatrix[0]; + this.frustum[0][1] = this.clippingMatrix[7] - this.clippingMatrix[4]; + this.frustum[0][2] = this.clippingMatrix[11] - this.clippingMatrix[8]; + this.frustum[0][3] = this.clippingMatrix[15] - this.clippingMatrix[12]; + this.normalize(this.frustum, 0); + this.frustum[1][0] = this.clippingMatrix[3] + this.clippingMatrix[0]; + this.frustum[1][1] = this.clippingMatrix[7] + this.clippingMatrix[4]; + this.frustum[1][2] = this.clippingMatrix[11] + this.clippingMatrix[8]; + this.frustum[1][3] = this.clippingMatrix[15] + this.clippingMatrix[12]; + this.normalize(this.frustum, 1); + this.frustum[2][0] = this.clippingMatrix[3] + this.clippingMatrix[1]; + this.frustum[2][1] = this.clippingMatrix[7] + this.clippingMatrix[5]; + this.frustum[2][2] = this.clippingMatrix[11] + this.clippingMatrix[9]; + this.frustum[2][3] = this.clippingMatrix[15] + this.clippingMatrix[13]; + this.normalize(this.frustum, 2); + this.frustum[3][0] = this.clippingMatrix[3] - this.clippingMatrix[1]; + this.frustum[3][1] = this.clippingMatrix[7] - this.clippingMatrix[5]; + this.frustum[3][2] = this.clippingMatrix[11] - this.clippingMatrix[9]; + this.frustum[3][3] = this.clippingMatrix[15] - this.clippingMatrix[13]; + this.normalize(this.frustum, 3); + this.frustum[4][0] = this.clippingMatrix[3] - this.clippingMatrix[2]; + this.frustum[4][1] = this.clippingMatrix[7] - this.clippingMatrix[6]; + this.frustum[4][2] = this.clippingMatrix[11] - this.clippingMatrix[10]; + this.frustum[4][3] = this.clippingMatrix[15] - this.clippingMatrix[14]; + this.normalize(this.frustum, 4); + this.frustum[5][0] = this.clippingMatrix[3] + this.clippingMatrix[2]; + this.frustum[5][1] = this.clippingMatrix[7] + this.clippingMatrix[6]; + this.frustum[5][2] = this.clippingMatrix[11] + this.clippingMatrix[10]; + this.frustum[5][3] = this.clippingMatrix[15] + this.clippingMatrix[14]; + this.normalize(this.frustum, 5); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/Frustrum.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/Frustrum.java new file mode 100644 index 0000000..a4bfcda --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/Frustrum.java @@ -0,0 +1,44 @@ +package net.minecraft.client.renderer.culling; + +import net.minecraft.util.AxisAlignedBB; + +public class Frustrum implements ICamera { + private ClippingHelper clippingHelper = ClippingHelperImpl.getInstance(); + private double xPosition; + private double yPosition; + private double zPosition; + + public Frustrum(ClippingHelper clippingHelper) { + this.clippingHelper = clippingHelper; + } + + public Frustrum() {} + + public void setPosition(double par1, double par3, double par5) { + this.xPosition = par1; + this.yPosition = par3; + this.zPosition = par5; + } + + /** + * Calls the clipping helper. Returns true if the box is inside all 6 clipping planes, otherwise returns false. + */ + public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11) { + return this.clippingHelper.isBoxInFrustum(par1 - this.xPosition, par3 - this.yPosition, par5 - this.zPosition, par7 - this.xPosition, par9 - this.yPosition, par11 - this.zPosition); + } + + /** + * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. + */ + public boolean isBoundingBoxInFrustum(AxisAlignedBB par1AxisAlignedBB) { + return this.isBoxInFrustum(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ, par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); + } + + public boolean isBoxInFrustumFully(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { + return this.clippingHelper.isBoxInFrustumFully(minX - this.xPosition, minY - this.yPosition, minZ - this.zPosition, maxX - this.xPosition, maxY - this.yPosition, maxZ - this.zPosition); + } + + public boolean isBoundingBoxInFrustumFully(AxisAlignedBB aab) { + return this.isBoxInFrustumFully(aab.minX, aab.minY, aab.minZ, aab.maxX, aab.maxY, aab.maxZ); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ICamera.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ICamera.java new file mode 100644 index 0000000..46290dd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/culling/ICamera.java @@ -0,0 +1,14 @@ +package net.minecraft.client.renderer.culling; + +import net.minecraft.util.AxisAlignedBB; + +public interface ICamera { + /** + * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. + */ + boolean isBoundingBoxInFrustum(AxisAlignedBB p_78546_1_); + + boolean isBoundingBoxInFrustumFully(AxisAlignedBB var1); + + void setPosition(double p_78547_1_, double p_78547_3_, double p_78547_5_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/Render.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/Render.java new file mode 100644 index 0000000..1c5da8f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/Render.java @@ -0,0 +1,445 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.ModulePackTweaks; +import com.cheatbreaker.client.module.impl.normal.misc.ModuleNickHider; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleNametag; +import com.cheatbreaker.client.ui.util.RenderUtil; +import com.cheatbreaker.client.cosmetic.profile.ProfileHandler; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.src.Config; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import shadersmod.client.Shaders; + +import java.awt.*; +import java.util.List; +import java.util.regex.Pattern; + +public abstract class Render { + private static final ResourceLocation shadowTextures = new ResourceLocation("textures/misc/shadow.png"); + protected RenderManager renderManager; + protected RenderBlocks field_147909_c = new RenderBlocks(); + protected float shadowSize; + + /** + * Determines the darkness of the object's shadow. Higher value makes a darker shadow. + */ + protected float shadowOpaque = 1.0F; + private boolean field_147908_f = false; + + private final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + '§' + "[0-689A-E]"); + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) { + IIcon var19 = var18 % 2 == 0 ? var9 : var10; + this.bindTexture(TextureMap.locationBlocksTexture); + float var20 = var19.getMinU(); + float var21 = var19.getMinV(); + float var22 = var19.getMaxU(); + float var23 = var19.getMaxV(); + + if (var18 / 2 % 2 == 0) { + float var24 = var22; + var22 = var20; + var20 = var24; + } + + var12.addVertexWithUV((double)(var13 - var14), (double)(0.0F - var16), (double)var17, (double)var22, (double)var23); + var12.addVertexWithUV((double)(-var13 - var14), (double)(0.0F - var16), (double)var17, (double)var20, (double)var23); + var12.addVertexWithUV((double)(-var13 - var14), (double)(1.4F - var16), (double)var17, (double)var20, (double)var21); + var12.addVertexWithUV((double)(var13 - var14), (double)(1.4F - var16), (double)var17, (double)var22, (double)var21); + var15 -= 0.45F; + var16 -= 0.45F; + var13 *= 0.9F; + var17 += 0.03F; + ++var18; + } + + var12.draw(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + } + + /** + * Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha, + * partialTickTime + */ + private void renderShadow(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { + if (!Config.isShaders() || !Shaders.shouldSkipDefaultShadow) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.renderManager.renderEngine.bindTexture(shadowTextures); + World var10 = this.getWorldFromRenderManager(); + GL11.glDepthMask(false); + float var11 = this.shadowSize; + + if (par1Entity instanceof EntityLiving) { + EntityLiving var35 = (EntityLiving)par1Entity; + var11 *= var35.getRenderSizeModifier(); + + if (var35.isChild()) { + var11 *= 0.5F; + } + } + + double var351 = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par9; + double var14 = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par9 + (double)par1Entity.getShadowSize(); + double var16 = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par9; + int var18 = MathHelper.floor_double(var351 - (double)var11); + int var19 = MathHelper.floor_double(var351 + (double)var11); + int var20 = MathHelper.floor_double(var14 - (double)var11); + int var21 = MathHelper.floor_double(var14); + int var22 = MathHelper.floor_double(var16 - (double)var11); + int var23 = MathHelper.floor_double(var16 + (double)var11); + double var24 = par2 - var351; + double var26 = par4 - var14; + double var28 = par6 - var16; + Tessellator var30 = Tessellator.instance; + var30.startDrawingQuads(); + + for (int var31 = var18; var31 <= var19; ++var31) { + for (int var32 = var20; var32 <= var21; ++var32) { + for (int var33 = var22; var33 <= var23; ++var33) { + Block var34 = var10.getBlock(var31, var32 - 1, var33); + + if (var34.getMaterial() != Material.air && var10.getBlockLightValue(var31, var32, var33) > 3) { + this.func_147907_a(var34, par2, par4 + (double)par1Entity.getShadowSize(), par6, var31, var32, var33, par8, var11, var24, var26 + (double)par1Entity.getShadowSize(), var28); + } + } + } + } + + var30.draw(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + } + } + + /** + * Returns the render manager's world object + */ + private World getWorldFromRenderManager() { + return this.renderManager.worldObj; + } + + private void func_147907_a(Block p_147907_1_, double p_147907_2_, double p_147907_4_, double p_147907_6_, int p_147907_8_, int p_147907_9_, int p_147907_10_, float p_147907_11_, float p_147907_12_, double p_147907_13_, double p_147907_15_, double p_147907_17_) { + Tessellator var19 = Tessellator.instance; + + if (p_147907_1_.renderAsNormalBlock()) { + double var20 = ((double)p_147907_11_ - (p_147907_4_ - ((double)p_147907_9_ + p_147907_15_)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(p_147907_8_, p_147907_9_, p_147907_10_); + + if (var20 >= 0.0D) { + if (var20 > 1.0D) { + var20 = 1.0D; + } + + var19.setColorRGBA_F(1.0F, 1.0F, 1.0F, (float)var20); + double var22 = (double)p_147907_8_ + p_147907_1_.getBlockBoundsMinX() + p_147907_13_; + double var24 = (double)p_147907_8_ + p_147907_1_.getBlockBoundsMaxX() + p_147907_13_; + double var26 = (double)p_147907_9_ + p_147907_1_.getBlockBoundsMinY() + p_147907_15_ + 0.015625D; + double var28 = (double)p_147907_10_ + p_147907_1_.getBlockBoundsMinZ() + p_147907_17_; + double var30 = (double)p_147907_10_ + p_147907_1_.getBlockBoundsMaxZ() + p_147907_17_; + float var32 = (float)((p_147907_2_ - var22) / 2.0D / (double)p_147907_12_ + 0.5D); + float var33 = (float)((p_147907_2_ - var24) / 2.0D / (double)p_147907_12_ + 0.5D); + float var34 = (float)((p_147907_6_ - var28) / 2.0D / (double)p_147907_12_ + 0.5D); + float var35 = (float)((p_147907_6_ - var30) / 2.0D / (double)p_147907_12_ + 0.5D); + var19.addVertexWithUV(var22, var26, var28, (double)var32, (double)var34); + var19.addVertexWithUV(var22, var26, var30, (double)var32, (double)var35); + var19.addVertexWithUV(var24, var26, var30, (double)var33, (double)var35); + var19.addVertexWithUV(var24, var26, var28, (double)var33, (double)var34); + } + } + } + + /** + * Renders a white box with the bounds of the AABB translated by the offset. Args: aabb, x, y, z + */ + public static void renderOffsetAABB(AxisAlignedBB par0AxisAlignedBB, double par1, double par3, double par5) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator var7 = Tessellator.instance; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + var7.startDrawingQuads(); + var7.setTranslation(par1, par3, par5); + var7.setNormal(0.0F, 0.0F, -1.0F); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.setNormal(0.0F, 0.0F, 1.0F); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var7.setNormal(0.0F, -1.0F, 0.0F); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.setNormal(0.0F, 1.0F, 0.0F); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var7.setNormal(-1.0F, 0.0F, 0.0F); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.setNormal(1.0F, 0.0F, 0.0F); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.setTranslation(0.0D, 0.0D, 0.0D); + var7.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + /** + * Adds to the tesselator a box using the aabb for the bounds. Args: aabb + */ + public static void renderAABB(AxisAlignedBB par0AxisAlignedBB) { + Tessellator var1 = Tessellator.instance; + var1.startDrawingQuads(); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var1.draw(); + } + + /** + * Sets the RenderManager. + */ + public void setRenderManager(RenderManager par1RenderManager) { + this.renderManager = par1RenderManager; + } + + /** + * Renders the entity's shadow and fire (if its on fire). Args: entity, x, y, z, yaw, partialTickTime + */ + public void doRenderShadowAndFire(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { + if (/*this.renderManager.options.fancyGraphics && */this.shadowSize > 0.0F && !par1Entity.isInvisible() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().entityShadows.getValue()) { + double var10 = this.renderManager.getDistanceToCamera(par1Entity.posX, par1Entity.posY, par1Entity.posZ); + float var12 = (float)((1.0D - var10 / 256.0D) * (double)this.shadowOpaque); + + if (var12 > 0.0F) + { + this.renderShadow(par1Entity, par2, par4, par6, var12, par9); + } + } + + ModulePackTweaks pt = CheatBreaker.getInstance().getModuleManager().packTweaksMod; + boolean ptIsEnabled = pt.isEnabled(); + boolean renderOverlay = ptIsEnabled ? (Boolean) pt.fireOnEntities.getValue() : true; + if (par1Entity.canRenderOnFire() && renderOverlay) { + this.renderEntityOnFire(par1Entity, par2, par4, par6, par9); + } + } + + /** + * Returns the font renderer from the set render manager + */ + public FontRenderer getFontRendererFromRenderManager() { + return this.renderManager.getFontRenderer(); + } + + public void updateIcons(IIconRegister par1IconRegister) {} + + protected void func_147906_a(Entity entity, String string, double d, double d2, double d3, int n) { + double var10 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer); + + if (var10 <= (n * n)) { + if (CheatBreaker.getInstance().getCbNetHandler().getNametagsMap().containsKey(entity.getUniqueID())) { + List list = CheatBreaker.getInstance().getCbNetHandler().getNametagsMap().get(entity.getUniqueID()); + int n2 = 0; + for (String string2 : list) { + this.boogaloo(-n2, entity, string2, d, d2, d3, n); + ++n2; + } + } else boogaloo(0.0, entity, string, d, d2, d3, n); + } + } + + public void boogaloo(double d, Entity p_147906_1_, String p_147906_2_, double p_147906_3_, double p_147906_5_, double p_147906_7_, int p_147906_9_) { + ModuleNametag mod = CheatBreaker.getInstance().getModuleManager().nametagMod; + ProfileHandler profileHandler = CheatBreaker.getInstance().getProfileHandler(); + boolean modEnabled = mod.isEnabled(); + boolean showIcon = modEnabled && (Boolean) mod.showCheatBreakerLogo.getValue() && mod.meetsIconRequirements(p_147906_2_) && profileHandler.validate(p_147906_1_.getUniqueID().toString(), false) && profileHandler.validate(p_147906_2_, true); + int color = profileHandler.getProfile(p_147906_1_.getUniqueID().toString()) == null ? 0 : profileHandler.getProfile(p_147906_1_.getUniqueID().toString()).getColor(); + int color2 = profileHandler.getProfile(p_147906_1_.getUniqueID().toString()) == null ? 0 : profileHandler.getProfile(p_147906_1_.getUniqueID().toString()).getColor2(); + + float colorR = (float)(color >> 16 & 255) / 255.0F; + float colorG = (float)(color >> 8 & 255) / 255.0F; + float colorB = (float)(color & 255) / 255.0F; + + float color2R = (float)(color2 >> 16 & 255) / 255.0F; + float color2G = (float)(color2 >> 8 & 255) / 255.0F; + float color2B = (float)(color2 & 255) / 255.0F; + + double var10 = p_147906_1_.getDistanceSqToEntity(this.renderManager.livingPlayer); + + if (var10 <= (double) (p_147906_9_ * p_147906_9_)) { + FontRenderer var12 = this.getFontRendererFromRenderManager(); + float var13 = 1.6F; + float var14 = 0.016666668F * var13; + GL11.glPushMatrix(); +// GL11.glTranslatef((float) p_147906_3_ + 0.0F, (float) p_147906_5_ + p_147906_1_.height + 0.5F, (float) p_147906_7_); + GL11.glTranslatef((float)p_147906_3_ + 0.0f, (float)(p_147906_5_ + p_147906_1_.height + 0.5F - d / 3), (float)p_147906_7_); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-var14, -var14, var14); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Tessellator var15 = Tessellator.instance; + byte var16 = 0; + GL11.glDisable(GL11.GL_TEXTURE_2D); + boolean customTextColor = (Boolean) mod.customTextColor.getValue() && modEnabled; + String string = customTextColor ? stripColor(p_147906_2_) : p_147906_2_; + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + string = string.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + string = string.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + int var17 = var12.getStringWidth(string) / 2; + int toAdd = (showIcon ? string.contains(" ") ? 8 : 7 : 0); + var17 = var17 + toAdd; + + if (!modEnabled || (Boolean) mod.background.getValue()) { + var15.startDrawingQuads(); + if (modEnabled) { + float alpha = (mod.backgroundColor.getColorValue() >> 24 & 255) / 255.0F; + float red = (mod.backgroundColor.getColorValue() >> 16 & 255) / 255.0F; + float green = (mod.backgroundColor.getColorValue() >> 8 & 255) / 255.0F; + float blue = (mod.backgroundColor.getColorValue() & 255) / 255.0F; + var15.setColorRGBA_F(red, green, blue, alpha); + } else { + var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); + } + var15.addVertex((-var17 - 1), (-1 + var16), 0.0D); + var15.addVertex((-var17 - 1), (8 + var16), 0.0D); + var15.addVertex((var17 + 1), (8 + var16), 0.0D); + var15.addVertex((var17 + 1), (-1 + var16), 0.0D); + var15.draw(); + } + GL11.glEnable(GL11.GL_TEXTURE_2D); + var12.drawString(string, -(var12.getStringWidth(string) / 2 - toAdd), var16, customTextColor ? new Color(mod.textColor.getColorValue() >> 16 & 255, mod.textColor.getColorValue() >> 8 & 255, mod.textColor.getColorValue() & 255, 32).getRGB() : 553648127, modEnabled && (Boolean) mod.textShadow.getValue()); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(true); + if (showIcon) { + if (mod.textShadow.getBooleanValue()) { + GL11.glColor4f(colorR / 4.0F, colorG / 4.0F, colorB / 4.0F, 1.0f); // Change for WS. DIVIDED BY 4.0F IS REQUIRED + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_1.png"), (float)(-(var17 * 2) + 12) / 2.0f - 5.0f, 1.0F, 13.0f, 7.0f); + GL11.glColor4f(color2R / 4.0F, color2G / 4.0F, color2B / 4.0F, 1.0f); // Change for WS. DIVIDED BY 4.0F IS REQUIRED + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_2.png"), (float)(-(var17 * 2) + 12) / 2.0f - 5.0f, 1.0F, 13.0f, 7.0f); + } + GL11.glColor4f(colorR, colorG, colorB, 1.0f); // Change for WS + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_1.png"), (float)(-(var17 * 2) + 12) / 2.0f - 6.0f, 0.0F, 13.0f, 7.0f); + GL11.glColor4f(color2R, color2G, color2B, 1.0f); // Change for WS + RenderUtil.renderIcon(new ResourceLocation("client/logo_white_2.png"), (float)(-(var17 * 2) + 12) / 2.0f - 6.0f, 0.0F, 13.0f, 7.0f); + } + var12.drawString(string, -(var12.getStringWidth(string) / 2 - toAdd), var16, customTextColor ? mod.textColor.getColorValue() : -1, modEnabled && (Boolean) mod.textShadow.getValue()); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + } + + private String stripColor(String input) { + return input == null ? null : this.STRIP_COLOR_PATTERN.matcher(input).replaceAll("§r"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java new file mode 100644 index 0000000..40b9027 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderArrow.java @@ -0,0 +1,110 @@ +package net.minecraft.client.renderer.entity; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class RenderArrow extends Render { + private static final ResourceLocation arrowTextures = new ResourceLocation("textures/entity/arrow.png"); + + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) { + float var22 = -MathHelper.sin(var21 * 3.0F) * var21; + GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F); + } + + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(var20, var20, var20); + GL11.glTranslatef(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(var20, 0.0F, 0.0F); + var10.startDrawingQuads(); + var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, var16, var18); + var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, var17, var18); + var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, var17, var19); + var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, var16, var19); + var10.draw(); + GL11.glNormal3f(-var20, 0.0F, 0.0F); + var10.startDrawingQuads(); + var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, var16, var18); + var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, var17, var18); + var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, var17, var19); + var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, var16, var19); + var10.draw(); + + for (int var23 = 0; var23 < 4; ++var23) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, var20); + var10.startDrawingQuads(); + var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, var12, var14); + var10.addVertexWithUV(8.0D, -2.0D, 0.0D, var13, var14); + var10.addVertexWithUV(8.0D, 2.0D, 0.0D, var13, var15); + var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, var12, var15); + var10.draw(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityArrow p_110775_1_) { + return arrowTextures; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityArrow)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0 || entity.motionY > 0.0 || entity.motionZ > 0.0; + return (CheatBreaker.getInstance().getGlobalSettings().hideMovingArrows.getBooleanValue() && moving && !grounded) || (CheatBreaker.getInstance().getGlobalSettings().hideGroundedArrows.getBooleanValue() && grounded); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java new file mode 100644 index 0000000..2368870 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderBat.java @@ -0,0 +1,131 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBat; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderBat extends RenderLiving { + private static final ResourceLocation batTextures = new ResourceLocation("textures/entity/bat.png"); + + /** + * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and + * it seems a good match for a bats size + */ + private int renderedBatSize; + + + public RenderBat() { + super(new ModelBat(), 0.25F); + this.renderedBatSize = ((ModelBat)this.mainModel).getBatSize(); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + float var10 = (float)(var8 >> 8 & 255) / 255.0F; + float var11 = (float)(var8 & 255) / 255.0F; + GL11.glColor3f(var9, var10, var11); + + if (var4.isItemEnchanted()) { + return 31; + } + + return 16; + } + + GL11.glColor3f(1.0F, 1.0F, 1.0F); + + if (var4.isItemEnchanted()) { + return 15; + } + + return 1; + } + } + + return -1; + } + + protected void func_82408_c(EntityLiving p_82408_1_, int p_82408_2_, float p_82408_3_) { + ItemStack var4 = p_82408_1_.func_130225_q(3 - p_82408_2_); + + if (var4 != null) { + Item var5 = var4.getItem(); + + if (var5 instanceof ItemArmor) { + this.bindTexture(func_110858_a((ItemArmor)var5, p_82408_2_, "overlay")); + float var6 = 1.0F; + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + var9 = (float)(var12 >> 8 & 255) / 255.0F; + float var10 = (float)(var12 & 255) / 255.0F; + GL11.glColor4f(var14, var9, var10, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, var3, var11); + } + } else { + var11 = var3.getItem().getColorFromItemStack(var3, 0); + float var13 = (float)(var11 >> 16 & 255) / 255.0F; + var14 = (float)(var11 >> 8 & 255) / 255.0F; + var9 = (float)(var11 & 255) / 255.0F; + GL11.glColor4f(var13, var14, var9, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, var3, 0); + } + + GL11.glPopMatrix(); + } + } + + protected void func_82422_c() { + GL11.glTranslatef(0.0F, 0.1875F, 0.0F); + } + + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) { + this.func_82408_c((EntityLiving)p_82408_1_, p_82408_2_, p_82408_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + public int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) { + return this.shouldRenderPass((EntityLiving)p_77032_1_, p_77032_2_, p_77032_3_); + } + + protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) { + this.renderEquippedItems((EntityLiving)p_77029_1_, p_77029_2_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) { + GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * (float)p_76986_1_.getForwardDirection(), 1.0F, 0.0F, 0.0F); + } + + float var12 = 0.75F; + GL11.glScalef(var12, var12, var12); + GL11.glScalef(1.0F / var12, 1.0F / var12, 1.0F / var12); + this.bindEntityTexture(p_76986_1_); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.modelBoat.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityBoat p_110775_1_) { + return boatTextures; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityBoat)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 1.0F) { + var3 = 1.0F; + } + + var3 *= var3; + var3 *= var3; + float var5 = (1.0F + var3 * 0.4F) * var4; + float var6 = (1.0F + var3 * 0.1F) / var4; + GL11.glScalef(var5, var6, var5); + } + + /** + * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime + */ + protected int getColorMultiplier(EntityCreeper p_77030_1_, float p_77030_2_, float p_77030_3_) { + float var4 = p_77030_1_.getCreeperFlashIntensity(p_77030_3_); + + if ((int)(var4 * 10.0F) % 2 == 0) { + return 0; + } else { + int var5 = (int)(var4 * 0.2F * 255.0F); + + if (var5 < 0) { + var5 = 0; + } + + if (var5 > 255) { + var5 = 255; + } + + short var6 = 255; + short var7 = 255; + short var8 = 255; + return var5 << 24 | var6 << 16 | var7 << 8 | var8; + } + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityCreeper p_77032_1_, int p_77032_2_, float p_77032_3_) { + if (p_77032_1_.getPowered()) { + GL11.glDepthMask(!p_77032_1_.isInvisible()); + + if (p_77032_2_ == 1) { + float var4 = (float)p_77032_1_.ticksExisted + p_77032_3_; + this.bindTexture(armoredCreeperTextures); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float var5 = var4 * 0.01F; + float var6 = var4 * 0.01F; + GL11.glTranslatef(var5, var6, 0.0F); + this.setRenderPassModel(this.creeperModel); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_BLEND); + float var7 = 0.5F; + GL11.glColor4f(var7, var7, var7, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + return 1; + } + + if (p_77032_2_ == 2) { + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + } + } + + return -1; + } + + protected int inheritRenderPass(EntityCreeper p_77035_1_, int p_77035_2_, float p_77035_3_) { + return -1; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityCreeper p_110775_1_) { + return creeperTextures; + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + public void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) { + this.preRenderCallback((EntityCreeper)p_77041_1_, p_77041_2_); + } + + /** + * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime + */ + protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_) { + return this.getColorMultiplier((EntityCreeper)p_77030_1_, p_77030_2_, p_77030_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + public int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) { + return this.shouldRenderPass((EntityCreeper)p_77032_1_, p_77032_2_, p_77032_3_); + } + + protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_) { + return this.inheritRenderPass((EntityCreeper)p_77035_1_, p_77035_2_, p_77035_3_); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityCreeper)p_110775_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java new file mode 100644 index 0000000..4906448 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderDragon.java @@ -0,0 +1,288 @@ +package net.minecraft.client.renderer.entity; + +import java.util.Random; +import net.minecraft.client.model.ModelDragon; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.src.Config; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import shadersmod.client.Shaders; + +public class RenderDragon extends RenderLiving { + private static final ResourceLocation enderDragonExplodingTextures = new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png"); + private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"); + private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png"); + private static final ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); + + /** An instance of the dragon model in RenderDragon */ + protected ModelDragon modelDragon; + + public RenderDragon() { + super(new ModelDragon(0.0F), 0.5F); + this.modelDragon = (ModelDragon)this.mainModel; + this.setRenderPassModel(this.mainModel); + } + + protected void rotateCorpse(EntityDragon par1EntityLivingBase, float par2, float par3, float par4) { + float var5 = (float)par1EntityLivingBase.getMovementOffsets(7, par4)[0]; + float var6 = (float)(par1EntityLivingBase.getMovementOffsets(5, par4)[1] - par1EntityLivingBase.getMovementOffsets(10, par4)[1]); + GL11.glRotatef(-var5, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var6 * 10.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.0F, 1.0F); + + if (par1EntityLivingBase.deathTime > 0) { + float var7 = ((float)par1EntityLivingBase.deathTime + par4 - 1.0F) / 20.0F * 1.6F; + var7 = MathHelper.sqrt_float(var7); + + if (var7 > 1.0F) { + var7 = 1.0F; + } + + GL11.glRotatef(var7 * this.getDeathMaxRotation(par1EntityLivingBase), 0.0F, 0.0F, 1.0F); + } + } + + /** + * Renders the model in RenderLiving + */ + protected void renderModel(EntityDragon par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) { + if (par1EntityLivingBase.deathTicks > 0) { + float var8 = (float)par1EntityLivingBase.deathTicks / 200.0F; + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, var8); + this.bindTexture(enderDragonExplodingTextures); + this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glDepthFunc(GL11.GL_EQUAL); + } + + this.bindEntityTexture(par1EntityLivingBase); + this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); + + if (par1EntityLivingBase.hurtTime > 0) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); + this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) { + RenderHelper.disableStandardItemLighting(); + float var4 = ((float)par1EntityLivingBase.deathTicks + par2) / 200.0F; + float var5 = 0.0F; + + if (var4 > 0.8F) { + var5 = (var4 - 0.8F) / 0.2F; + } + + Random var6 = new Random(432L); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDepthMask(false); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -1.0F, -2.0F); + + for (int var7 = 0; (float)var7 < (var4 + var4 * var4) / 2.0F * 60.0F; ++var7) { + GL11.glRotatef(var6.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(var6.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var6.nextFloat() * 360.0F + var4 * 90.0F, 0.0F, 0.0F, 1.0F); + var3.startDrawing(6); + float var8 = var6.nextFloat() * 20.0F + 5.0F + var5 * 10.0F; + float var9 = var6.nextFloat() * 2.0F + 1.0F + var5 * 2.0F; + var3.setColorRGBA_I(16777215, (int)(255.0F * (1.0F - var5))); + var3.addVertex(0.0D, 0.0D, 0.0D); + var3.setColorRGBA_I(16711935, 0); + var3.addVertex(-0.866D * (double)var9, (double)var8, (double)(-0.5F * var9)); + var3.addVertex(0.866D * (double)var9, (double)var8, (double)(-0.5F * var9)); + var3.addVertex(0.0D, (double)var8, (double)(1.0F * var9)); + var3.addVertex(-0.866D * (double)var9, (double)var8, (double)(-0.5F * var9)); + var3.draw(); + } + + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + RenderHelper.enableStandardItemLighting(); + } + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityDragon par1EntityLivingBase, int par2, float par3) { + if (par2 == 1) { + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + if (par2 != 0) { + return -1; + } else { + this.bindTexture(enderDragonEyesTextures); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_EQUAL); + char var4 = 61680; + int var5 = var4 % 65536; + int var6 = var4 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (Config.isShaders()) { + Shaders.beginSpiderEyes(); + } + + return 1; + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= (float)Math.PI; var10 -= ((float)Math.PI * 2F)) { + } + + while (var10 < -(float)Math.PI) { + var10 += ((float)Math.PI * 2F); + } + + float var11 = p_147500_1_.field_145925_p + var10 * p_147500_8_; + GL11.glRotatef(-var11 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F); + this.bindTexture(field_147540_b); + float var12 = p_147500_1_.field_145931_j + (p_147500_1_.field_145933_i - p_147500_1_.field_145931_j) * p_147500_8_ + 0.25F; + float var13 = p_147500_1_.field_145931_j + (p_147500_1_.field_145933_i - p_147500_1_.field_145931_j) * p_147500_8_ + 0.75F; + var12 = (var12 - (float)MathHelper.truncateDoubleToInt(var12)) * 1.6F - 0.3F; + var13 = (var13 - (float)MathHelper.truncateDoubleToInt(var13)) * 1.6F - 0.3F; + + if (var12 < 0.0F) { + var12 = 0.0F; + } + + if (var13 < 0.0F) { + var13 = 0.0F; + } + + if (var12 > 1.0F) { + var12 = 1.0F; + } + + if (var13 > 1.0F) { + var13 = 1.0F; + } + + float var14 = p_147500_1_.field_145927_n + (p_147500_1_.field_145930_m - p_147500_1_.field_145927_n) * p_147500_8_; + GL11.glEnable(GL11.GL_CULL_FACE); + this.field_147541_c.render(null, var9, var12, var13, var14, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntityEnchantmentTable)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java new file mode 100644 index 0000000..0876510 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderEnderman.java @@ -0,0 +1,160 @@ +package net.minecraft.client.renderer.entity; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.model.ModelEnderman; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import shadersmod.client.Shaders; + +public class RenderEnderman extends RenderLiving { + private static final ResourceLocation endermanEyesTexture = new ResourceLocation("textures/entity/enderman/enderman_eyes.png"); + private static final ResourceLocation endermanTextures = new ResourceLocation("textures/entity/enderman/enderman.png"); + + /** The model of the enderman */ + private ModelEnderman endermanModel; + private Random rnd = new Random(); + + public RenderEnderman() { + super(new ModelEnderman(), 0.5F); + this.endermanModel = (ModelEnderman)super.mainModel; + this.setRenderPassModel(this.endermanModel); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0 || p_76986_1_.field_146042_b != Minecraft.getMinecraft().thePlayer) { + float var31 = (p_76986_1_.field_146042_b.prevRenderYawOffset + (p_76986_1_.field_146042_b.renderYawOffset - p_76986_1_.field_146042_b.prevRenderYawOffset) * p_76986_9_) * (float)Math.PI / 180.0F; + double var32 = MathHelper.sin(var31); + double var34 = MathHelper.cos(var31); + var23 = p_76986_1_.field_146042_b.prevPosX + (p_76986_1_.field_146042_b.posX - p_76986_1_.field_146042_b.prevPosX) * (double)p_76986_9_ - var34 * 0.35D - var32 * 0.85D; + var25 = p_76986_1_.field_146042_b.prevPosY + var29 + (p_76986_1_.field_146042_b.posY - p_76986_1_.field_146042_b.prevPosY) * (double)p_76986_9_ - 0.45D; + var27 = p_76986_1_.field_146042_b.prevPosZ + (p_76986_1_.field_146042_b.posZ - p_76986_1_.field_146042_b.prevPosZ) * (double)p_76986_9_ - var32 * 0.35D + var34 * 0.85D; + } + + double var46 = p_76986_1_.prevPosX + (p_76986_1_.posX - p_76986_1_.prevPosX) * (double)p_76986_9_; + double var33 = p_76986_1_.prevPosY + (p_76986_1_.posY - p_76986_1_.prevPosY) * (double)p_76986_9_ + 0.25D; + double var35 = p_76986_1_.prevPosZ + (p_76986_1_.posZ - p_76986_1_.prevPosZ) * (double)p_76986_9_; + double var37 = (float)(var23 - var46); + double var39 = (float)(var25 - var33); + double var41 = (float)(var27 - var35); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + var10.startDrawing(3); + var10.setColorOpaque_I(0); + byte var43 = 16; + + for (int var44 = 0; var44 <= var43; ++var44) { + float var45 = (float)var44 / (float)var43; + var10.addVertex(p_76986_2_ + var37 * (double)var45, p_76986_4_ + var39 * (double)(var45 * var45 + var45) * 0.5D + 0.25D, p_76986_6_ + var41 * (double)var45); + } + + var10.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityFishHook p_110775_1_) { + return field_110792_a; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityFishHook)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 0.01D) { + float var5 = 13.0F; + float var6 = p_77043_1_.limbSwing - p_77043_1_.limbSwingAmount * (1.0F - p_77043_4_) + 6.0F; + float var7 = (Math.abs(var6 % var5 - var5 * 0.5F) - var5 * 0.25F) / (var5 * 0.25F); + GL11.glRotatef(6.5F * var7, 0.0F, 0.0F, 1.0F); + } + } + + protected void renderEquippedItems(EntityIronGolem p_77029_1_, float p_77029_2_) { + super.renderEquippedItems(p_77029_1_, p_77029_2_); + + if (p_77029_1_.getHoldRoseTick() != 0) { + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glPushMatrix(); + GL11.glRotatef(5.0F + 180.0F * this.ironGolemModel.ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + float var3 = 0.8F; + GL11.glScalef(var3, -var3, var3); + int var4 = p_77029_1_.getBrightnessForRender(p_77029_2_); + int var5 = var4 % 65536; + int var6 = var4 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.bindTexture(TextureMap.locationBlocksTexture); + this.field_147909_c.renderBlockAsItem(Blocks.red_flower, 0, 1.0F); + GL11.glPopMatrix(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 1) { + var13 = 2; + } + + if (p_76986_1_.getEntityItem().stackSize > 5) { + var13 = 3; + } + + if (p_76986_1_.getEntityItem().stackSize > 20) { + var13 = 4; + } + + if (p_76986_1_.getEntityItem().stackSize > 40) { + var13 = 5; + } + + GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_ + var11, (float)p_76986_6_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float var18; + float var19; + int var25; + + if (var10.getItemSpriteNumber() == 0 && var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var10.getItem()).getRenderType())) { + Block var22 = Block.getBlockFromItem(var10.getItem()); + GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F); + + if (renderInFrame) { + GL11.glScalef(1.25F, 1.25F, 1.25F); + GL11.glTranslatef(0.0F, 0.05F, 0.0F); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + + float var24 = 0.25F; + var25 = var22.getRenderType(); + + if (var25 == 1 || var25 == 19 || var25 == 12 || var25 == 2) { + var24 = 0.5F; + } + + if (var22.getRenderBlockPass() > 0) { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + GL11.glScalef(var24, var24, var24); + + for (int var26 = 0; var26 < var13; ++var26) { + GL11.glPushMatrix(); + + if (var26 > 0) { + var18 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var24; + var19 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var24; + float var20 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var24; + GL11.glTranslatef(var18, var19, var20); + } + + this.field_147913_i.renderBlockAsItem(var22, var10.getItemDamage(), 1.0F); + GL11.glPopMatrix(); + } + + if (var22.getRenderBlockPass() > 0) { + GL11.glDisable(GL11.GL_BLEND); + } + } else { + float var17; + + if (var10.getItemSpriteNumber() == 1 && var10.getItem().requiresMultipleRenderPasses()) { + if (renderInFrame) { + GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); + GL11.glTranslatef(0.0F, -0.05F, 0.0F); + } else { + GL11.glScalef(0.5F, 0.5F, 0.5F); + } + + for (int var21 = 0; var21 <= 1; ++var21) { + this.random.setSeed(187L); + IIcon var23 = var10.getItem().getIconFromDamageForRenderPass(var10.getItemDamage(), var21); + + if (this.renderWithColor) { + var25 = var10.getItem().getColorFromItemStack(var10, var21); + var17 = (float)(var25 >> 16 & 255) / 255.0F; + var18 = (float)(var25 >> 8 & 255) / 255.0F; + var19 = (float)(var25 & 255) / 255.0F; + GL11.glColor4f(var17, var18, var19, 1.0F); + this.renderDroppedItem(p_76986_1_, var23, var13, p_76986_9_, var17, var18, var19); + } else { + this.renderDroppedItem(p_76986_1_, var23, var13, p_76986_9_, 1.0F, 1.0F, 1.0F); + } + } + } else { + if (var10 != null && var10.getItem() instanceof ItemCloth) { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + if (renderInFrame) { + GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); + GL11.glTranslatef(0.0F, -0.05F, 0.0F); + } else { + GL11.glScalef(0.5F, 0.5F, 0.5F); + } + + IIcon var14 = var10.getIconIndex(); + + if (this.renderWithColor) { + int var15 = var10.getItem().getColorFromItemStack(var10, 0); + float var16 = (float)(var15 >> 16 & 255) / 255.0F; + var17 = (float)(var15 >> 8 & 255) / 255.0F; + var18 = (float)(var15 & 255) / 255.0F; + this.renderDroppedItem(p_76986_1_, var14, var13, p_76986_9_, var16, var17, var18); + } else { + this.renderDroppedItem(p_76986_1_, var14, var13, p_76986_9_, 1.0F, 1.0F, 1.0F); + } + + if (var10 != null && var10.getItem() instanceof ItemCloth) { + GL11.glDisable(GL11.GL_BLEND); + } + } + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + this.bindEntityTexture(p_76986_1_); + TextureUtil.func_147945_b(); + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityItem p_110775_1_) { + return this.renderManager.renderEngine.getResourceLocation(p_110775_1_.getEntityItem().getItemSpriteNumber()); + } + + /** + * Renders a dropped item + */ + private void renderDroppedItem(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_) { + Tessellator var8 = Tessellator.instance; + + if (p_77020_2_ == null) { + TextureManager var9 = Minecraft.getMinecraft().getTextureManager(); + ResourceLocation var10 = var9.getResourceLocation(p_77020_1_.getEntityItem().getItemSpriteNumber()); + p_77020_2_ = ((TextureMap)var9.getTexture(var10)).getAtlasSprite("missingno"); + } + + float var25 = p_77020_2_.getMinU(); + float var26 = p_77020_2_.getMaxU(); + float var11 = p_77020_2_.getMinV(); + float var12 = p_77020_2_.getMaxV(); + float var13 = 1.0F; + float var14 = 0.5F; + float var15 = 0.25F; + float var17; + + if (this.renderManager.options.fancyGraphics) { + GL11.glPushMatrix(); + + if (renderInFrame) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } else { + if ((Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.faceCamera.getValue() && CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GL11.glRotatef(360.0f - this.renderManager.playerViewY, 0.0f, 1.0f, 0.0f); + if ((Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.yRotation.getValue()) { + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + } + } else { + GL11.glRotatef((((float)p_77020_1_.age + p_77020_4_) / 20.0F + p_77020_1_.hoverStart) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + } + + float var16 = 0.0625F; + var17 = 0.021875F; + ItemStack var18 = p_77020_1_.getEntityItem(); + int var19 = var18.stackSize; + byte var24; + + if (var19 < 2) { + var24 = 1; + } else if (var19 < 16) { + var24 = 2; + } else if (var19 < 32) { + var24 = 3; + } else { + var24 = 4; + } + + GL11.glTranslatef(-var14, -var15, -((var16 + var17) * (float)var24 / 2.0F)); + + for (int var20 = 0; var20 < var24; ++var20) { + GL11.glTranslatef(0.0F, 0.0F, var16 + var17); + + if (var18.getItemSpriteNumber() == 0) { + this.bindTexture(TextureMap.locationBlocksTexture); + } else { + this.bindTexture(TextureMap.locationItemsTexture); + } + + GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); + ItemRenderer.renderItemIn2D(var8, var26, var11, var25, var12, p_77020_2_.getIconWidth(), p_77020_2_.getIconHeight(), var16); + + ModuleEnchantmentGlint glintModule = CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod; + if (var18.hasEffect() && glintModule.isEnabled() && (Boolean) glintModule.droppedItemGlint.getValue()) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + int getGlintColor = glintModule.droppedItemGlintColor.getColorValue(); + float glintA = (float)(getGlintColor >> 24 & 0xFF) / 255.0f; + float glintR = (float)(getGlintColor >> 16 & 0xFF) / 255.0f; + float glintG = (float)(getGlintColor >> 8 & 0xFF) / 255.0f; + float glintB = (float)(getGlintColor & 0xFF) / 255.0f; + float a = glintA * 0.76f; + GL11.glColor4f(glintR * a, glintG * a, glintB * a, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float var22 = 0.125F; + GL11.glScalef(var22, var22, var22); + float var23 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(var23, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, var16); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(var22, var22, var22); + var23 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-var23, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, var16); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + } + + GL11.glPopMatrix(); + } else { + for (int var27 = 0; var27 < p_77020_3_; ++var27) { + GL11.glPushMatrix(); + + if (var27 > 0) { + var17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float var28 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float var29 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + GL11.glTranslatef(var17, var28, var29); + } + + if (!renderInFrame) { + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + if ((Boolean) CheatBreaker.getInstance().getModuleManager().packTweaksMod.yRotation.getValue() && CheatBreaker.getInstance().getModuleManager().packTweaksMod.isEnabled()) { + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + } + } + + GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); + var8.startDrawingQuads(); + var8.setNormal(0.0F, 1.0F, 0.0F); + var8.addVertexWithUV(0.0F - var14, 0.0F - var15, 0.0D, var25, var12); + var8.addVertexWithUV(var13 - var14, 0.0F - var15, 0.0D, var26, var12); + var8.addVertexWithUV(var13 - var14, 1.0F - var15, 0.0D, var26, var11); + var8.addVertexWithUV(0.0F - var14, 1.0F - var15, 0.0D, var25, var11); + var8.draw(); + GL11.glPopMatrix(); + } + } + } + + /** + * Renders the item's icon or block into the UI at the specified position. + */ + public void renderItemIntoGUI(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_) { + int var6 = p_77015_3_.getItemDamage(); + Object var7 = p_77015_3_.getIconIndex(); + int var9; + float var12; + float var17; + float var18; + + if (p_77015_3_.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(p_77015_3_.getItem()).getRenderType())) { + p_77015_2_.bindTexture(TextureMap.locationBlocksTexture); + Block var16 = Block.getBlockFromItem(p_77015_3_.getItem()); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + if (var16.getRenderBlockPass() != 0) { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } else { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glPushMatrix(); + GL11.glTranslatef((float)(p_77015_4_ - 2), (float)(p_77015_5_ + 3), -3.0F + this.zLevel); + GL11.glScalef(10.0F, 10.0F, 10.0F); + GL11.glTranslatef(1.0F, 0.5F, 1.0F); + GL11.glScalef(1.0F, 1.0F, -1.0F); + GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + var9 = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0); + var17 = (float)(var9 >> 16 & 255) / 255.0F; + var18 = (float)(var9 >> 8 & 255) / 255.0F; + var12 = (float)(var9 & 255) / 255.0F; + + if (this.renderWithColor) { + GL11.glColor4f(var17, var18, var12, 1.0F); + } + + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + this.field_147913_i.useInventoryTint = this.renderWithColor; + this.field_147913_i.renderBlockAsItem(var16, var6, 1.0F); + this.field_147913_i.useInventoryTint = true; + + if (var16.getRenderBlockPass() == 0) { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + } + + GL11.glPopMatrix(); + } else if (p_77015_3_.getItem().requiresMultipleRenderPasses()) { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); + p_77015_2_.bindTexture(TextureMap.locationItemsTexture); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(0, 0, 0, 0); + GL11.glColorMask(false, false, false, true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Tessellator var8 = Tessellator.instance; + var8.startDrawingQuads(); + var8.setColorOpaque_I(-1); + var8.addVertex(p_77015_4_ - 2, p_77015_5_ + 18, this.zLevel); + var8.addVertex(p_77015_4_ + 18, p_77015_5_ + 18, this.zLevel); + var8.addVertex(p_77015_4_ + 18, p_77015_5_ - 2, this.zLevel); + var8.addVertex(p_77015_4_ - 2, p_77015_5_ - 2, this.zLevel); + var8.draw(); + GL11.glColorMask(true, true, true, true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + + for (var9 = 0; var9 <= 1; ++var9) { + IIcon var10 = p_77015_3_.getItem().getIconFromDamageForRenderPass(var6, var9); + int var11 = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, var9); + var12 = (float)(var11 >> 16 & 255) / 255.0F; + float var13 = (float)(var11 >> 8 & 255) / 255.0F; + float var14 = (float)(var11 & 255) / 255.0F; + + if (this.renderWithColor) { + GL11.glColor4f(var12, var13, var14, 1.0F); + } + + this.renderIcon(p_77015_4_, p_77015_5_, var10, 16, 16); + } + + GL11.glEnable(GL11.GL_LIGHTING); + } else { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + ResourceLocation var15 = p_77015_2_.getResourceLocation(p_77015_3_.getItemSpriteNumber()); + p_77015_2_.bindTexture(var15); + + if (var7 == null) { + var7 = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(var15)).getAtlasSprite("missingno"); + } + + var9 = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0); + var17 = (float)(var9 >> 16 & 255) / 255.0F; + var18 = (float)(var9 >> 8 & 255) / 255.0F; + var12 = (float)(var9 & 255) / 255.0F; + + if (this.renderWithColor) { + GL11.glColor4f(var17, var18, var12, 1.0F); + } + + this.renderIcon(p_77015_4_, p_77015_5_, (IIcon)var7, 16, 16); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + } + + /** + * Render the item's icon or block into the GUI, including the glint effect. + */ + public void renderItemAndEffectIntoGUI(FontRenderer p_82406_1_, TextureManager p_82406_2_, final ItemStack p_82406_3_, int p_82406_4_, int p_82406_5_) { + if (p_82406_3_ != null) { + this.zLevel += 50.0F; + + try { + this.renderItemIntoGUI(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_); + } catch (Throwable var9) { + CrashReport var7 = CrashReport.makeCrashReport(var9, "Rendering item"); + CrashReportCategory var8 = var7.makeCategory("Item being rendered"); + var8.addCrashSectionCallable("Item Type", new Callable() { + + public String call() { + return String.valueOf(p_82406_3_.getItem()); + } + }); + var8.addCrashSectionCallable("Item Aux", new Callable() { + + public String call() { + return String.valueOf(p_82406_3_.getItemDamage()); + } + }); + var8.addCrashSectionCallable("Item NBT", new Callable() { + + public String call() { + return String.valueOf(p_82406_3_.getTagCompound()); + } + }); + var8.addCrashSectionCallable("Item Foil", new Callable() { + + public String call() { + return String.valueOf(p_82406_3_.hasEffect()); + } + }); + throw new ReportedException(var7); + } + + ModuleEnchantmentGlint glintModule = CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod; + if (p_82406_3_.hasEffect() && glintModule.isEnabled() && (Boolean) glintModule.inventoryGlint.getValue()) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + p_82406_2_.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + int var8 = p_82406_3_.getItem().getColorFromItemStack(p_82406_3_, 0); + float var10 = (float)(var8 >> 16 & 0xFF) / 255.0f; + float var11 = (float)(var8 >> 8 & 0xFF) / 255.0f; + float var9 = (float)(var8 & 0xFF) / 255.0f; + int getGlintColor = glintModule.inventoryGlintColor.getColorValue(); + float glintA = (float)(getGlintColor >> 24 & 0xFF) / 255.0f; + float glintR = (float)(getGlintColor >> 16 & 0xFF) / 255.0f; + float glintG = (float)(getGlintColor >> 8 & 0xFF) / 255.0f; + float glintB = (float)(getGlintColor & 0xFF) / 255.0f; + if (var8 != 0xFFFFFF && (Boolean)glintModule.showPotionColor.getValue()) { + GL11.glColor4f(var10 * glintA, var11 * glintA, var9 * glintA, 1.0F); + } else { + GL11.glColor4f(glintR * glintA, glintG * glintA, glintB * glintA, 1.0F); + } + if (var8 != 0xFFFFFF && !(Boolean)glintModule.excludePotionGlint.getValue() || var8 == 0xFFFFFF && !(Boolean)glintModule.onlyRenderPotionGlint.getValue()) { + if (glintModule.boxBoundary.getValue().equals("Entire Slot") ) { + this.renderGlint(p_82406_4_ * 431278612 + p_82406_5_ * 32178161, p_82406_4_ - 2, p_82406_5_ - 2, 20, 20); + } else { + this.renderGlint(p_82406_4_ * 431278612 + p_82406_5_ * 32178161, p_82406_4_, p_82406_5_, 16, 16); + } + } + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + this.zLevel -= 50.0F; + } + } + + private void renderGlint(int p_77018_1_, int p_77018_2_, int p_77018_3_, int p_77018_4_, int p_77018_5_) { + for (int var6 = 0; var6 < 2; ++var6) { + OpenGlHelper.glBlendFunc((Boolean) CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod.shinyPots.getValue() ? 773 : 772, 1, 0, 0); + float var7 = 0.00390625F; + float var8 = 0.00390625F; + float var9 = (float)(Minecraft.getSystemTime() % (long)(3000 + var6 * 1873)) / (3000.0F + (float)(var6 * 1873)) * 256.0F; + float var10 = 0.0F; + Tessellator var11 = Tessellator.instance; + float var12 = 4.0F; + + if (var6 == 1) { + var12 = -1.0F; + } + + var11.startDrawingQuads(); + var11.addVertexWithUV(p_77018_2_ + 0, p_77018_3_ + p_77018_5_, this.zLevel, (var9 + (float)p_77018_5_ * var12) * var7, (var10 + (float)p_77018_5_) * var8); + var11.addVertexWithUV(p_77018_2_ + p_77018_4_, p_77018_3_ + p_77018_5_, this.zLevel, (var9 + (float)p_77018_4_ + (float)p_77018_5_ * var12) * var7, (var10 + (float)p_77018_5_) * var8); + var11.addVertexWithUV(p_77018_2_ + p_77018_4_, p_77018_3_ + 0, this.zLevel, (var9 + (float)p_77018_4_) * var7, (var10 + 0.0F) * var8); + var11.addVertexWithUV(p_77018_2_ + 0, p_77018_3_ + 0, this.zLevel, (var9 + 0.0F) * var7, (var10 + 0.0F) * var8); + var11.draw(); + } + } + + /** + * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the + * specified position. + */ + public void renderItemOverlayIntoGUI(FontRenderer p_77021_1_, TextureManager p_77021_2_, ItemStack p_77021_3_, int p_77021_4_, int p_77021_5_) { + this.renderItemOverlayIntoGUI(p_77021_1_, p_77021_2_, p_77021_3_, p_77021_4_, p_77021_5_, null); + } + + public void renderItemOverlayIntoGUI(FontRenderer p_94148_1_, TextureManager p_94148_2_, ItemStack p_94148_3_, int p_94148_4_, int p_94148_5_, String p_94148_6_) { + if (p_94148_3_ != null) { + if (p_94148_3_.stackSize > 1 || p_94148_6_ != null) { + String var7 = p_94148_6_ == null ? String.valueOf(p_94148_3_.stackSize) : p_94148_6_; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + p_94148_1_.drawStringWithShadow(var7, p_94148_4_ + 19 - 2 - p_94148_1_.getStringWidth(var7), p_94148_5_ + 6 + 3, 16777215); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + + if (p_94148_3_.isItemDamaged()) { + int var12 = (int)Math.round(13.0D - (double)p_94148_3_.getItemDamageForDisplay() * 13.0D / (double)p_94148_3_.getMaxDamage()); + int var8 = (int)Math.round(255.0D - (double)p_94148_3_.getItemDamageForDisplay() * 255.0D / (double)p_94148_3_.getMaxDamage()); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + Tessellator var9 = Tessellator.instance; + int var10 = 255 - var8 << 16 | var8 << 8; + int var11 = (255 - var8) / 4 << 16 | 16128; + this.renderQuad(var9, p_94148_4_ + 2, p_94148_5_ + 13, 13, 2, 0); + this.renderQuad(var9, p_94148_4_ + 2, p_94148_5_ + 13, 12, 1, var11); + this.renderQuad(var9, p_94148_4_ + 2, p_94148_5_ + 13, var12, 1, var10); + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: + * tessellator, x, y, width, height, color + */ + private void renderQuad(Tessellator p_77017_1_, int p_77017_2_, int p_77017_3_, int p_77017_4_, int p_77017_5_, int p_77017_6_) { + p_77017_1_.startDrawingQuads(); + p_77017_1_.setColorOpaque_I(p_77017_6_); + p_77017_1_.addVertex(p_77017_2_ + 0, p_77017_3_ + 0, 0.0D); + p_77017_1_.addVertex(p_77017_2_ + 0, p_77017_3_ + p_77017_5_, 0.0D); + p_77017_1_.addVertex(p_77017_2_ + p_77017_4_, p_77017_3_ + p_77017_5_, 0.0D); + p_77017_1_.addVertex(p_77017_2_ + p_77017_4_, p_77017_3_ + 0, 0.0D); + p_77017_1_.draw(); + } + + public void renderIcon(int p_94149_1_, int p_94149_2_, IIcon p_94149_3_, int p_94149_4_, int p_94149_5_) { + Tessellator var6 = Tessellator.instance; + var6.startDrawingQuads(); + var6.addVertexWithUV(p_94149_1_ + 0, p_94149_2_ + p_94149_5_, this.zLevel, p_94149_3_.getMinU(), p_94149_3_.getMaxV()); + var6.addVertexWithUV(p_94149_1_ + p_94149_4_, p_94149_2_ + p_94149_5_, this.zLevel, p_94149_3_.getMaxU(), p_94149_3_.getMaxV()); + var6.addVertexWithUV(p_94149_1_ + p_94149_4_, p_94149_2_ + 0, this.zLevel, p_94149_3_.getMaxU(), p_94149_3_.getMinV()); + var6.addVertexWithUV(p_94149_1_ + 0, p_94149_2_ + 0, this.zLevel, p_94149_3_.getMinU(), p_94149_3_.getMinV()); + var6.draw(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityItem)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 0; --var18) { + var11[var18] = var13; + var12[var18] = var15; + var13 += var17.nextInt(11) - 5; + var15 += var17.nextInt(11) - 5; + } + + for (int var45 = 0; var45 < 4; ++var45) { + Random var46 = new Random(p_76986_1_.boltVertex); + + for (int var19 = 0; var19 < 3; ++var19) { + int var20 = 7; + int var21 = 0; + + if (var19 > 0) { + var20 = 7 - var19; + } + + if (var19 > 0) { + var21 = var20 - 2; + } + + double var22 = var11[var20] - var13; + double var24 = var12[var20] - var15; + + for (int var26 = var20; var26 >= var21; --var26) { + double var27 = var22; + double var29 = var24; + + if (var19 == 0) { + var22 += var46.nextInt(11) - 5; + var24 += var46.nextInt(11) - 5; + } else { + var22 += var46.nextInt(31) - 15; + var24 += var46.nextInt(31) - 15; + } + + var10.startDrawing(5); + float var31 = 0.5F; + var10.setColorRGBA_F(0.9F * var31, 0.9F * var31, 1.0F * var31, 0.3F); + double var32 = 0.1D + (double)var45 * 0.2D; + + if (var19 == 0) { + var32 *= (double)var26 * 0.1D + 1.0D; + } + + double var34 = 0.1D + (double)var45 * 0.2D; + + if (var19 == 0) { + var34 *= (double)(var26 - 1) * 0.1D + 1.0D; + } + + for (int var36 = 0; var36 < 5; ++var36) { + double var37 = p_76986_2_ + 0.5D - var32; + double var39 = p_76986_6_ + 0.5D - var32; + + if (var36 == 1 || var36 == 2) { + var37 += var32 * 2.0D; + } + + if (var36 == 2 || var36 == 3) { + var39 += var32 * 2.0D; + } + + double var41 = p_76986_2_ + 0.5D - var34; + double var43 = p_76986_6_ + 0.5D - var34; + + if (var36 == 1 || var36 == 2) { + var41 += var34 * 2.0D; + } + + if (var36 == 2 || var36 == 3) { + var43 += var34 * 2.0D; + } + + var10.addVertex(var41 + var22, p_76986_4_ + (double)(var26 * 16), var43 + var24); + var10.addVertex(var37 + var27, p_76986_4_ + (double)((var26 + 1) * 16), var39 + var29); + } + + var10.draw(); + } + } + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityLightningBolt p_110775_1_) { + return null; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityLightningBolt)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render getEntityRenderMap() { + return this.entityRenderMap; + } + + public void updateIcons(IIconRegister p_94178_1_) { + for (Object o : this.entityRenderMap.values()) { + Render var3 = (Render) o; + var3.updateIcons(p_94178_1_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java new file mode 100644 index 0000000..3caf4e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderMinecart.java @@ -0,0 +1,139 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.block.Block; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelMinecart; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +public class RenderMinecart extends Render { + private static final ResourceLocation minecartTextures = new ResourceLocation("textures/entity/minecart.png"); + + /** instance of ModelMinecart for rendering */ + protected ModelBase modelMinecart = new ModelMinecart(); + protected final RenderBlocks field_94145_f; + + + public RenderMinecart() { + this.shadowSize = 0.5F; + this.field_94145_f = new RenderBlocks(); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float var13 = (((float)(var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float var14 = (((float)(var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + GL11.glTranslatef(var12, var13, var14); + double var15 = p_76986_1_.lastTickPosX + (p_76986_1_.posX - p_76986_1_.lastTickPosX) * (double)p_76986_9_; + double var17 = p_76986_1_.lastTickPosY + (p_76986_1_.posY - p_76986_1_.lastTickPosY) * (double)p_76986_9_; + double var19 = p_76986_1_.lastTickPosZ + (p_76986_1_.posZ - p_76986_1_.lastTickPosZ) * (double)p_76986_9_; + double var21 = 0.30000001192092896D; + Vec3 var23 = p_76986_1_.func_70489_a(var15, var17, var19); + float var24 = p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_; + + if (var23 != null) { + Vec3 var25 = p_76986_1_.func_70495_a(var15, var17, var19, var21); + Vec3 var26 = p_76986_1_.func_70495_a(var15, var17, var19, -var21); + + if (var25 == null) { + var25 = var23; + } + + if (var26 == null) { + var26 = var23; + } + + p_76986_2_ += var23.xCoord - var15; + p_76986_4_ += (var25.yCoord + var26.yCoord) / 2.0D - var17; + p_76986_6_ += var23.zCoord - var19; + Vec3 var27 = var26.addVector(-var25.xCoord, -var25.yCoord, -var25.zCoord); + + if (var27.lengthVector() != 0.0D) { + var27 = var27.normalize(); + p_76986_8_ = (float)(Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI); + var24 = (float)(Math.atan(var27.yCoord) * 73.0D); + } + } + + GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); + GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var24, 0.0F, 0.0F, 1.0F); + float var31 = (float)p_76986_1_.getRollingAmplitude() - p_76986_9_; + float var32 = p_76986_1_.getDamage() - p_76986_9_; + + if (var32 < 0.0F) { + var32 = 0.0F; + } + + if (var31 > 0.0F) { + GL11.glRotatef(MathHelper.sin(var31) * var31 * var32 / 10.0F * (float)p_76986_1_.getRollingDirection(), 1.0F, 0.0F, 0.0F); + } + + int var33 = p_76986_1_.getDisplayTileOffset(); + Block var28 = p_76986_1_.func_145820_n(); + int var29 = p_76986_1_.getDisplayTileData(); + + if (var28.getRenderType() != -1) { + GL11.glPushMatrix(); + this.bindTexture(TextureMap.locationBlocksTexture); + float var30 = 0.75F; + GL11.glScalef(var30, var30, var30); + GL11.glTranslatef(0.0F, (float)var33 / 16.0F, 0.0F); + this.func_147910_a(p_76986_1_, p_76986_9_, var28, var29); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.bindEntityTexture(p_76986_1_); + } + + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.modelMinecart.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityMinecart p_110775_1_) { + return minecartTextures; + } + + protected void func_147910_a(EntityMinecart p_147910_1_, float p_147910_2_, Block p_147910_3_, int p_147910_4_) { + float var5 = p_147910_1_.getBrightness(p_147910_2_); + GL11.glPushMatrix(); + this.field_94145_f.renderBlockAsItem(p_147910_3_, p_147910_4_, var5); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityMinecart)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + float var10 = (float)(var8 >> 8 & 255) / 255.0F; + float var11 = (float)(var8 & 255) / 255.0F; + GL11.glColor3f(var9, var10, var11); + + if (var4.isItemEnchanted()) { + return 31; + } + + return 16; + } + + GL11.glColor3f(1.0F, 1.0F, 1.0F); + + if (var4.isItemEnchanted()) { + return 15; + } + + return 1; + } + } + + return -1; + } + + protected void func_82408_c(AbstractClientPlayer p_82408_1_, int p_82408_2_, float p_82408_3_) { + ItemStack var4 = p_82408_1_.inventory.armorItemInSlot(3 - p_82408_2_); + + if (var4 != null) { + Item var5 = var4.getItem(); + + if (var5 instanceof ItemArmor) { + this.bindTexture(RenderBiped.func_110858_a((ItemArmor)var5, p_82408_2_, "overlay")); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) { + EnumAction var11 = var10.getItemUseAction(); + + if (var11 == EnumAction.block) { + this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 3; + } else if (var11 == EnumAction.bow) { + this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = true; + } + } + + this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = p_76986_1_.isSneaking(); + double var13 = p_76986_4_ - (double)p_76986_1_.yOffset; + + if (p_76986_1_.isSneaking() && !(p_76986_1_ instanceof EntityPlayerSP)) { + var13 -= 0.125D; + } + + super.doRender(p_76986_1_, p_76986_2_, var13, p_76986_6_, p_76986_8_, p_76986_9_); + this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false; + this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false; + this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(AbstractClientPlayer p_110775_1_) { + return p_110775_1_.getLocationSkin(); + } + + protected void renderEquippedItems(AbstractClientPlayer p_77029_1_, float p_77029_2_) { + GL11.glColor3f(1.0F, 1.0F, 1.0F); + super.renderEquippedItems(p_77029_1_, p_77029_2_); + super.renderArrowsStuckInEntity(p_77029_1_, p_77029_2_); + ItemStack var3 = p_77029_1_.inventory.armorItemInSlot(3); + + if (var3 != null) { + GL11.glPushMatrix(); + this.modelBipedMain.bipedHead.postRender(0.0625F); + float var4; + + if (var3.getItem() instanceof ItemBlock) { + if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { + var4 = 0.625F; + GL11.glTranslatef(0.0F, -0.25F, 0.0F); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(var4, -var4, -var4); + } + + this.renderManager.itemRenderer.renderItem(p_77029_1_, var3, 0); + } else if (var3.getItem() == Items.skull) { + var4 = 1.0625F; + GL11.glScalef(var4, -var4, -var4); + GameProfile var5 = null; + + if (var3.hasTagCompound()) { + NBTTagCompound var6 = var3.getTagCompound(); + + if (var6.func_150297_b("SkullOwner", 10)) { + var5 = NBTUtil.func_152459_a(var6.getCompoundTag("SkullOwner")); + } else if (var6.func_150297_b("SkullOwner", 8) && !StringUtils.isNullOrEmpty(var6.getString("SkullOwner"))) { + var5 = new GameProfile(null, var6.getString("SkullOwner")); + } + } + + TileEntitySkullRenderer.field_147536_b.func_152674_a(-0.5F, 0.0F, -0.5F, 1, 180.0F, var3.getItemDamage(), var5); + } + + GL11.glPopMatrix(); + } + + float var7; + + if (p_77029_1_.getCommandSenderName().equals("deadmau5") && p_77029_1_.func_152123_o()) { + this.bindTexture(p_77029_1_.getLocationSkin()); + + for (int var20 = 0; var20 < 2; ++var20) { + float var22 = p_77029_1_.prevRotationYaw + (p_77029_1_.rotationYaw - p_77029_1_.prevRotationYaw) * p_77029_2_ - (p_77029_1_.prevRenderYawOffset + (p_77029_1_.renderYawOffset - p_77029_1_.prevRenderYawOffset) * p_77029_2_); + float var25 = p_77029_1_.prevRotationPitch + (p_77029_1_.rotationPitch - p_77029_1_.prevRotationPitch) * p_77029_2_; + GL11.glPushMatrix(); + GL11.glRotatef(var22, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var25, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.375F * (float)(var20 * 2 - 1), 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.375F, 0.0F); + GL11.glRotatef(-var25, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-var22, 0.0F, 1.0F, 0.0F); + var7 = 1.3333334F; + GL11.glScalef(var7, var7, var7); + this.modelBipedMain.renderEars(0.0625F); + GL11.glPopMatrix(); + } + } + + boolean var21 = p_77029_1_.func_152122_n(); + float var11; + + if (var21 && !p_77029_1_.isInvisible() && !p_77029_1_.getHideCape()) { + this.bindTexture(p_77029_1_.getLocationCape()); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 0.0F, 0.125F); + double var23 = p_77029_1_.field_71091_bM + (p_77029_1_.field_71094_bP - p_77029_1_.field_71091_bM) * (double)p_77029_2_ - (p_77029_1_.prevPosX + (p_77029_1_.posX - p_77029_1_.prevPosX) * (double)p_77029_2_); + double var27 = p_77029_1_.field_71096_bN + (p_77029_1_.field_71095_bQ - p_77029_1_.field_71096_bN) * (double)p_77029_2_ - (p_77029_1_.prevPosY + (p_77029_1_.posY - p_77029_1_.prevPosY) * (double)p_77029_2_); + double var9 = p_77029_1_.field_71097_bO + (p_77029_1_.field_71085_bR - p_77029_1_.field_71097_bO) * (double)p_77029_2_ - (p_77029_1_.prevPosZ + (p_77029_1_.posZ - p_77029_1_.prevPosZ) * (double)p_77029_2_); + var11 = p_77029_1_.prevRenderYawOffset + (p_77029_1_.renderYawOffset - p_77029_1_.prevRenderYawOffset) * p_77029_2_; + double var12 = MathHelper.sin(var11 * (float)Math.PI / 180.0F); + double var14 = -MathHelper.cos(var11 * (float)Math.PI / 180.0F); + float var16 = (float)var27 * 10.0F; + + if (var16 < -6.0F) { + var16 = -6.0F; + } + + if (var16 > 32.0F) { + var16 = 32.0F; + } + + float var17 = (float)(var23 * var12 + var9 * var14) * 100.0F; + float var18 = (float)(var23 * var14 - var9 * var12) * 100.0F; + + if (var17 < 0.0F) { + var17 = 0.0F; + } + + float var19 = p_77029_1_.prevCameraYaw + (p_77029_1_.cameraYaw - p_77029_1_.prevCameraYaw) * p_77029_2_; + var16 += MathHelper.sin((p_77029_1_.prevDistanceWalkedModified + (p_77029_1_.distanceWalkedModified - p_77029_1_.prevDistanceWalkedModified) * p_77029_2_) * 6.0F) * 32.0F * var19; + + if (p_77029_1_.isSneaking()) { + var16 += 25.0F; + } + + GL11.glRotatef(6.0F + var17 / 2.0F + var16, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var18 / 2.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-var18 / 2.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + this.modelBipedMain.renderCloak(0.0625F); + GL11.glPopMatrix(); + } + + ItemStack var24 = p_77029_1_.inventory.getCurrentItem(); + + if (var24 != null) { + GL11.glPushMatrix(); + this.modelBipedMain.bipedRightArm.postRender(0.0625F); + GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); + + if (p_77029_1_.fishEntity != null) { + var24 = new ItemStack(Items.stick); + } + + EnumAction var26 = null; + + if (p_77029_1_.getItemInUseCount() > 0) { + var26 = var24.getItemUseAction(); + } + + if (var24.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var24.getItem()).getRenderType())) { + var7 = 0.5F; + GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); + var7 *= 0.75F; + GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(-var7, -var7, var7); + } else if (var24.getItem() == Items.bow) { + var7 = 0.625F; + GL11.glTranslatef(0.0F, 0.125F, 0.3125F); + GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(var7, -var7, var7); + GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + } else if (var24.getItem().isFull3D()) { + var7 = 0.625F; + + if (var24.getItem().shouldRotateAroundWhenRendering()) { + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, -0.125F, 0.0F); + } + + if (p_77029_1_.getItemInUseCount() > 0 && var26 == EnumAction.block) { + GL11.glTranslatef(0.05F, 0.0F, -0.1F); + GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-10.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F); + } + + GL11.glTranslatef(0.0F, 0.1875F, 0.0F); + GL11.glScalef(var7, -var7, var7); + GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + } else { + var7 = 0.375F; + GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); + GL11.glScalef(var7, var7, var7); + GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); + } + + float var10; + int var28; + float var30; + + if (var24.getItem().requiresMultipleRenderPasses()) { + for (var28 = 0; var28 <= 1; ++var28) { + int var8 = var24.getItem().getColorFromItemStack(var24, var28); + var30 = (float)(var8 >> 16 & 255) / 255.0F; + var10 = (float)(var8 >> 8 & 255) / 255.0F; + var11 = (float)(var8 & 255) / 255.0F; + GL11.glColor4f(var30, var10, var11, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, var24, var28); + } + } else { + var28 = var24.getItem().getColorFromItemStack(var24, 0); + float var29 = (float)(var28 >> 16 & 255) / 255.0F; + var30 = (float)(var28 >> 8 & 255) / 255.0F; + var10 = (float)(var28 & 255) / 255.0F; + GL11.glColor4f(var29, var30, var10, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, var24, 0); + } + + GL11.glPopMatrix(); + } + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(AbstractClientPlayer p_77041_1_, float p_77041_2_) { + float var3 = 0.9375F; + GL11.glScalef(var3, var3, var3); + } + + protected void func_96449_a(AbstractClientPlayer p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) { + if (p_96449_10_ < 100.0D) { + Scoreboard var12 = p_96449_1_.getWorldScoreboard(); + ScoreObjective var13 = var12.func_96539_a(2); + + if (var13 != null) { + Score var14 = var12.func_96529_a(p_96449_1_.getCommandSenderName(), var13); + + if (p_96449_1_.isPlayerSleeping()) { + this.func_147906_a(p_96449_1_, var14.getScorePoints() + " " + var13.getDisplayName(), p_96449_2_, p_96449_4_ - 1.5D, p_96449_6_, 64); + } else { + this.func_147906_a(p_96449_1_, var14.getScorePoints() + " " + var13.getDisplayName(), p_96449_2_, p_96449_4_, p_96449_6_, 64); + } + + p_96449_4_ += (float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * p_96449_9_; + } + } + + super.func_96449_a(p_96449_1_, p_96449_2_, p_96449_4_, p_96449_6_, p_96449_8_, p_96449_9_, p_96449_10_); + } + + public void renderFirstPersonArm(EntityPlayer p_82441_1_) { + float var2 = 1.0F; + GL11.glColor3f(var2, var2, var2); + this.modelBipedMain.onGround = 0.0F; + this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_82441_1_); + this.modelBipedMain.bipedRightArm.render(0.0625F); + } + + /** + * Sets a simple glTranslate on a LivingEntity. + */ + protected void renderLivingAt(AbstractClientPlayer p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) { + if (p_77039_1_.isEntityAlive() && p_77039_1_.isPlayerSleeping()) { + super.renderLivingAt(p_77039_1_, p_77039_2_ + (double)p_77039_1_.field_71079_bU, p_77039_4_ + (double)p_77039_1_.field_71082_cx, p_77039_6_ + (double)p_77039_1_.field_71089_bV); + } else { + super.renderLivingAt(p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_); + } + } + + protected void rotateCorpse(AbstractClientPlayer p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) { + if (p_77043_1_.isEntityAlive() && p_77043_1_.isPlayerSleeping()) { + GL11.glRotatef(p_77043_1_.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.getDeathMaxRotation(p_77043_1_), 0.0F, 0.0F, 1.0F); + GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F); + } else { + super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_); + } + } + + protected void func_96449_a(EntityLivingBase p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) { + this.func_96449_a((AbstractClientPlayer)p_96449_1_, p_96449_2_, p_96449_4_, p_96449_6_, p_96449_8_, p_96449_9_, p_96449_10_); + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + public void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) { + this.preRenderCallback((AbstractClientPlayer)p_77041_1_, p_77041_2_); + } + + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) { + this.func_82408_c((AbstractClientPlayer)p_82408_1_, p_82408_2_, p_82408_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + public int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) { + return this.shouldRenderPass((AbstractClientPlayer)p_77032_1_, p_77032_2_, p_77032_3_); + } + + protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) { + this.renderEquippedItems((AbstractClientPlayer)p_77029_1_, p_77029_2_); + } + + protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) { + this.rotateCorpse((AbstractClientPlayer)p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_); + } + + /** + * Sets a simple glTranslate on a LivingEntity. + */ + protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) { + this.renderLivingAt((AbstractClientPlayer)p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + float var14 = (float)(var12 >> 8 & 255) / 255.0F; + float var15 = (float)(var12 & 255) / 255.0F; + GL11.glColor3f(var13, var14, var15); + GL11.glPushMatrix(); + this.func_77026_a(var11, ItemPotion.func_94589_d("overlay")); + GL11.glPopMatrix(); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + + this.func_77026_a(var11, var10); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return TextureMap.locationItemsTexture; + } + + private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) { + float var3 = p_77026_2_.getMinU(); + float var4 = p_77026_2_.getMaxU(); + float var5 = p_77026_2_.getMinV(); + float var6 = p_77026_2_.getMaxV(); + float var7 = 1.0F; + float var8 = 0.5F; + float var9 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + p_77026_1_.startDrawingQuads(); + p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); + p_77026_1_.addVertexWithUV(0.0F - var8, 0.0F - var9, 0.0D, var3, var6); + p_77026_1_.addVertexWithUV(var7 - var8, 0.0F - var9, 0.0D, var4, var6); + p_77026_1_.addVertexWithUV(var7 - var8, var7 - var9, 0.0D, var4, var5); + p_77026_1_.addVertexWithUV(0.0F - var8, var7 - var9, 0.0D, var3, var5); + p_77026_1_.draw(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java new file mode 100644 index 0000000..30e7ac3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderSpider.java @@ -0,0 +1,78 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelSpider; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import shadersmod.client.Shaders; + +public class RenderSpider extends RenderLiving { + private static final ResourceLocation spiderEyesTextures = new ResourceLocation("textures/entity/spider_eyes.png"); + private static final ResourceLocation spiderTextures = new ResourceLocation("textures/entity/spider/spider.png"); + + public RenderSpider() { + super(new ModelSpider(), 1.0F); + this.setRenderPassModel(new ModelSpider()); + } + + protected float getDeathMaxRotation(EntitySpider par1EntityLivingBase) { + return 180.0F; + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntitySpider par1EntityLivingBase, int par2, float par3) { + if (par2 != 0) { + return -1; + } else { + this.bindTexture(spiderEyesTextures); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + + GL11.glDepthMask(!par1EntityLivingBase.isInvisible()); + + char var4 = 61680; + int var5 = var4 % 65536; + int var6 = var4 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (Config.isShaders()) { + Shaders.beginSpiderEyes(); + } + + return 1; + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntitySpider par1Entity) { + return spiderTextures; + } + + protected float getDeathMaxRotation(EntityLivingBase par1EntityLivingBase) { + return this.getDeathMaxRotation((EntitySpider)par1EntityLivingBase); + } + + /** + * Queries whether should render the specified pass or not. + */ + public int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { + return this.shouldRenderPass((EntitySpider)par1EntityLivingBase, par2, par3); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity par1Entity) { + return this.getEntityTexture((EntitySpider)par1Entity); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java new file mode 100644 index 0000000..10a329d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderSquid.java @@ -0,0 +1,100 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderSquid extends RenderLiving { + private static final ResourceLocation squidTextures = new ResourceLocation("textures/entity/squid.png"); + + + public RenderSquid(ModelBase p_i1268_1_, float p_i1268_2_) { + super(p_i1268_1_, p_i1268_2_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 1.0F) { + var10 = 1.0F; + } + + var10 *= var10; + var10 *= var10; + float var11 = 1.0F + var10 * 0.3F; + GL11.glScalef(var11, var11, var11); + } + + var10 = (1.0F - ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F) / 100.0F) * 0.8F; + this.bindEntityTexture(p_76986_1_); + this.blockRenderer.renderBlockAsItem(Blocks.tnt, 0, p_76986_1_.getBrightness(p_76986_9_)); + + if (p_76986_1_.fuse / 5 % 2 == 0) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); + this.blockRenderer.renderBlockAsItem(Blocks.tnt, 0, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityTNTPrimed p_110775_1_) { + return TextureMap.locationBlocksTexture; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity p_110775_1_) { + return this.getEntityTexture((EntityTNTPrimed)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render -1 && (float)var5 - p_147910_2_ + 1.0F < 10.0F) { + float var6 = 1.0F - ((float)var5 - p_147910_2_ + 1.0F) / 10.0F; + + if (var6 < 0.0F) { + var6 = 0.0F; + } + + if (var6 > 1.0F) { + var6 = 1.0F; + } + + var6 *= var6; + var6 *= var6; + float var7 = 1.0F + var6 * 0.3F; + GL11.glScalef(var7, var7, var7); + } + + super.func_147910_a(p_147910_1_, p_147910_2_, p_147910_3_, p_147910_4_); + + if (var5 > -1 && var5 / 5 % 2 == 0) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - ((float)var5 - p_147910_2_ + 1.0F) / 100.0F) * 0.8F); + GL11.glPushMatrix(); + this.field_94145_f.renderBlockAsItem(Blocks.tnt, 0, 1.0F); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + } + + protected void func_147910_a(EntityMinecart p_147910_1_, float p_147910_2_, Block p_147910_3_, int p_147910_4_) { + this.func_147910_a((EntityMinecartTNT)p_147910_1_, p_147910_2_, p_147910_3_, p_147910_4_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java new file mode 100644 index 0000000..4e5dfdb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/entity/RenderVillager.java @@ -0,0 +1,146 @@ +package net.minecraft.client.renderer.entity; + +import net.minecraft.client.model.ModelVillager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderVillager extends RenderLiving { + private static final ResourceLocation villagerTextures = new ResourceLocation("textures/entity/villager/villager.png"); + private static final ResourceLocation farmerVillagerTextures = new ResourceLocation("textures/entity/villager/farmer.png"); + private static final ResourceLocation librarianVillagerTextures = new ResourceLocation("textures/entity/villager/librarian.png"); + private static final ResourceLocation priestVillagerTextures = new ResourceLocation("textures/entity/villager/priest.png"); + private static final ResourceLocation smithVillagerTextures = new ResourceLocation("textures/entity/villager/smith.png"); + private static final ResourceLocation butcherVillagerTextures = new ResourceLocation("textures/entity/villager/butcher.png"); + + /** Model of the villager. */ + protected ModelVillager villagerModel; + + + public RenderVillager() { + super(new ModelVillager(0.0F), 0.5F); + this.villagerModel = (ModelVillager)this.mainModel; + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityVillager p_77032_1_, int p_77032_2_, float p_77032_3_) { + return -1; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0 && (var2 > 80 || var2 / 5 % 2 != 1) ? invulnerableWitherTextures : witherTextures; + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(EntityWither p_77041_1_, float p_77041_2_) { + int var3 = p_77041_1_.func_82212_n(); + + if (var3 > 0) { + float var4 = 2.0F - ((float)var3 - p_77041_2_) / 220.0F * 0.5F; + GL11.glScalef(var4, var4, var4); + } else { + GL11.glScalef(2.0F, 2.0F, 2.0F); + } + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityWither p_77032_1_, int p_77032_2_, float p_77032_3_) { + if (p_77032_1_.isArmored()) { + GL11.glDepthMask(!p_77032_1_.isInvisible()); + + if (p_77032_2_ == 1) { + float var4 = (float)p_77032_1_.ticksExisted + p_77032_3_; + this.bindTexture(invulnerableWitherTextures); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float var5 = MathHelper.cos(var4 * 0.02F) * 3.0F; + float var6 = var4 * 0.01F; + GL11.glTranslatef(var5, var6, 0.0F); + this.setRenderPassModel(this.mainModel); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_BLEND); + float var7 = 0.5F; + GL11.glColor4f(var7, var7, var7, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GL11.glTranslatef(0.0F, -0.01F, 0.0F); + GL11.glScalef(1.1F, 1.1F, 1.1F); + return 1; + } + + if (p_77032_2_ == 2) { + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + } + } + + return -1; + } + + protected int inheritRenderPass(EntityWither p_77035_1_, int p_77035_2_, float p_77035_3_) { + return -1; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 180.0F) { + var4 -= 360.0F; + } + + return p_77034_1_ + p_77034_3_ * var4; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 85.0F) { + var13 = 85.0F; + } + + var10 = var11 - var13; + + if (var13 * var13 > 2500.0F) { + var10 += var13 * 0.2F; + } + } + + float var26 = p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_; + this.renderLivingAt(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); + var13 = this.handleRotationFloat(p_76986_1_, p_76986_9_); + this.rotateCorpse(p_76986_1_, var13, var10, p_76986_9_); + float var14 = 0.0625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.preRenderCallback(p_76986_1_, p_76986_9_); + GL11.glTranslatef(0.0F, -24.0F * var14 - 0.0078125F, 0.0F); + float var15 = p_76986_1_.prevLimbSwingAmount + (p_76986_1_.limbSwingAmount - p_76986_1_.prevLimbSwingAmount) * p_76986_9_; + float var16 = p_76986_1_.limbSwing - p_76986_1_.limbSwingAmount * (1.0F - p_76986_9_); + + if (p_76986_1_.isChild()) { + var16 *= 3.0F; + } + + if (var15 > 1.0F) { + var15 = 1.0F; + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + this.mainModel.setLivingAnimations(p_76986_1_, var16, var15, p_76986_9_); + this.renderModel(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + int var18; + float var19; + float var20; + float var22; + + for (int var17 = 0; var17 < 4; ++var17) { + var18 = this.shouldRenderPass(p_76986_1_, var17, p_76986_9_); + + if (var18 > 0) { + this.renderPassModel.setLivingAnimations(p_76986_1_, var16, var15, p_76986_9_); + this.renderPassModel.render(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + + if ((var18 & 240) == 16) { + this.func_82408_c(p_76986_1_, var17, p_76986_9_); + this.renderPassModel.render(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + } + + ModuleEnchantmentGlint glintModule = CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod; + if ((var18 & 15) == 15 && glintModule.isEnabled() && (Boolean)glintModule.armorGlint.getValue()) { + var19 = (float)p_76986_1_.ticksExisted + p_76986_9_; + this.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + var20 = 0.5F; + GL11.glColor4f(var20, var20, var20, 1.0F); + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDepthMask(false); + + for (int var21 = 0; var21 < 2; ++var21) + { + GL11.glDisable(GL11.GL_LIGHTING); + int getGlintColor = glintModule.armorGlintColor.getColorValue(); + float glintA = (float)(getGlintColor >> 24 & 255) / 255.0F; + float glintR = (float)(getGlintColor >> 16 & 255) / 255.0F; + float glintG = (float)(getGlintColor >> 8 & 255) / 255.0F; + float glintB = (float)(getGlintColor & 255) / 255.0F; + var22 = glintA * 0.76F; + GL11.glColor4f(glintR * var22, glintG * var22, glintB * var22, 1.0F); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float var23 = var19 * (0.001F + (float)var21 * 0.003F) * 20.0F; + float var24 = 0.33333334F; + GL11.glScalef(var24, var24, var24); + GL11.glRotatef(30.0F - (float)var21 * 60.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, var23, 0.0F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.renderPassModel.render(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glDepthMask(true); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + } + + GL11.glDepthMask(true); + this.renderEquippedItems(p_76986_1_, p_76986_9_); + ModuleHitColor hitColorModule = CheatBreaker.getInstance().getModuleManager().hitColorMod; + float var27; + if ((Boolean)hitColorModule.affectedBrightness.getValue() || !hitColorModule.isEnabled()) { + var27 = p_76986_1_.getBrightness(p_76986_9_); + } else { + var27 = 1.0F; + } + var18 = this.getColorMultiplier(p_76986_1_, var27, p_76986_9_); + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + if (hitColorModule.toggle.getBooleanValue() || !hitColorModule.isEnabled()) { + if ((var18 >> 24 & 255) > 0 || p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDepthFunc(GL11.GL_EQUAL); + + int hitColor = hitColorModule.hitColor.getColorValue(); + float hitA = (float)(hitColor >> 24 & 255) / 255.0F; + if (!hitColorModule.fade.getValue().equals("None")) { + float percent = 1.0F - (float)p_76986_1_.hurtTime / 10.0F; + if (hitColorModule.fade.getValue().equals("Linear In/Out")) { + percent = percent < 0.5F ? percent / 0.5F : (1.0F - percent) / 0.5F; + } else if (hitColorModule.fade.getValue().equals("Linear Out")) { + percent = (1.0F - percent); + } + + hitA = hitA * percent; + } + + float hitR = (float)(hitColor >> 16 & 255) / 255.0F; + float hitG = (float)(hitColor >> 8 & 255) / 255.0F; + float hitB = (float)(hitColor & 255) / 255.0F; + if (p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) { + if (hitColorModule.isEnabled()) { + GL11.glColor4f(var27 * hitR, var27 * hitG, var27 * hitB, hitA); + } else { + GL11.glColor4f(var27, 0.0F, 0.0F, 0.4F); + } + this.mainModel.render(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + if ((Boolean)hitColorModule.affectArmor.getValue() || !hitColorModule.isEnabled()) { + for (int var28 = 0; var28 < 4; ++var28) + { + if (this.inheritRenderPass(p_76986_1_, var28, p_76986_9_) >= 0) { + if (hitColorModule.isEnabled()) { + GL11.glColor4f(var27 * hitR, var27 * hitG, var27 * hitB, hitA); + } else { + GL11.glColor4f(var27, 0.0F, 0.0F, 0.4F); + } + this.renderPassModel.render(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + } + } + } + } + + if ((var18 >> 24 & 255) > 0) { + var19 = (float)(var18 >> 16 & 255) / 255.0F; + var20 = (float)(var18 >> 8 & 255) / 255.0F; + float var29 = (float)(var18 & 255) / 255.0F; + var22 = (float)(var18 >> 24 & 255) / 255.0F; + GL11.glColor4f(var19, var20, var29, var22); + this.mainModel.render(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + + for (int var30 = 0; var30 < 4; ++var30) { + if (this.inheritRenderPass(p_76986_1_, var30, p_76986_9_) >= 0) + { + GL11.glColor4f(var19, var20, var29, var22); + this.renderPassModel.render(p_76986_1_, var16, var15, var13, var11 - var10, var26, var14); + } + } + } + } + + + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } catch (Exception var25) { + logger.error("Couldn't render entity", var25); + } + + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glEnable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + this.passSpecialRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); + } + + /** + * Renders the model in RenderLiving + */ + protected void renderModel(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) { + this.bindEntityTexture(p_77036_1_); + + if (!p_77036_1_.isInvisible()) { + this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + } else if (!p_77036_1_.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)) { + GL11.glPushMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); + this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + } else { + this.mainModel.setRotationAngles(p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_, p_77036_1_); + } + } + + /** + * Sets a simple glTranslate on a LivingEntity. + */ + protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) { + GL11.glTranslatef((float)p_77039_2_, (float)p_77039_4_, (float)p_77039_6_); + } + + protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) { + GL11.glRotatef(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + + if (p_77043_1_.deathTime > 0) { + float var5 = ((float)p_77043_1_.deathTime + p_77043_4_ - 1.0F) / 20.0F * 1.6F; + var5 = MathHelper.sqrt_float(var5); + + if (var5 > 1.0F) { + var5 = 1.0F; + } + + GL11.glRotatef(var5 * this.getDeathMaxRotation(p_77043_1_), 0.0F, 0.0F, 1.0F); + } else { + String var6 = EnumChatFormatting.getTextWithoutFormattingCodes(p_77043_1_.getCommandSenderName()); + + if ((var6.equals("Dinnerbone") || var6.equals("Grumm")) && (!(p_77043_1_ instanceof EntityPlayer) || !((EntityPlayer)p_77043_1_).getHideCape())) { + GL11.glTranslatef(0.0F, p_77043_1_.height + 0.1F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + } + } + } + + protected float renderSwingProgress(EntityLivingBase p_77040_1_, float p_77040_2_) { + return p_77040_1_.getSwingProgress(p_77040_2_); + } + + /** + * Defines what float the third param in setRotationAngles of ModelBase is + */ + protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) { + return (float)p_77044_1_.ticksExisted + p_77044_2_; + } + + protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) {} + + /** + * renders arrows the Entity has been attacked with, attached to it + */ + protected void renderArrowsStuckInEntity(EntityLivingBase p_85093_1_, float p_85093_2_) { + if (CheatBreaker.getInstance().getGlobalSettings().hideStuckArrows.getBooleanValue()) return; + int var3 = p_85093_1_.getArrowCountInEntity(); + + if (var3 > 0) { + EntityArrow var4 = new EntityArrow(p_85093_1_.worldObj, p_85093_1_.posX, p_85093_1_.posY, p_85093_1_.posZ); + Random var5 = new Random(p_85093_1_.getEntityId()); +// RenderHelper.disableStandardItemLighting(); + + for (int var6 = 0; var6 < var3; ++var6) { + GL11.glPushMatrix(); + ModelRenderer var7 = this.mainModel.getRandomModelBox(var5); + ModelBox var8 = (ModelBox)var7.cubeList.get(var5.nextInt(var7.cubeList.size())); + var7.postRender(0.0625F); + float var9 = var5.nextFloat(); + float var10 = var5.nextFloat(); + float var11 = var5.nextFloat(); + float var12 = (var8.posX1 + (var8.posX2 - var8.posX1) * var9) / 16.0F; + float var13 = (var8.posY1 + (var8.posY2 - var8.posY1) * var10) / 16.0F; + float var14 = (var8.posZ1 + (var8.posZ2 - var8.posZ1) * var11) / 16.0F; + GL11.glTranslatef(var12, var13, var14); + var9 = var9 * 2.0F - 1.0F; + var10 = var10 * 2.0F - 1.0F; + var11 = var11 * 2.0F - 1.0F; + var9 *= -1.0F; + var10 *= -1.0F; + var11 *= -1.0F; + float var15 = MathHelper.sqrt_float(var9 * var9 + var11 * var11); + var4.prevRotationYaw = var4.rotationYaw = (float)(Math.atan2(var9, var11) * 180.0D / Math.PI); + var4.prevRotationPitch = var4.rotationPitch = (float)(Math.atan2(var10, var15) * 180.0D / Math.PI); + double var16 = 0.0D; + double var18 = 0.0D; + double var20 = 0.0D; + float var22 = 0.0F; + this.renderManager.func_147940_a(var4, var16, var18, var20, var22, p_85093_2_); + GL11.glPopMatrix(); + } + +// RenderHelper.enableStandardItemLighting(); + } + } + + protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_) { + return this.shouldRenderPass(p_77035_1_, p_77035_2_, p_77035_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + public int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) { + return -1; + } + + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) {} + + protected float getDeathMaxRotation(EntityLivingBase p_77037_1_) { + return 90.0F; + } + + /** + * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime + */ + protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_) { + return 0; + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + public void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {} + + /** + * Passes the specialRender and renders it + */ + protected void passSpecialRender(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_, double p_77033_6_) { + ModuleNametag nametagMod = CheatBreaker.getInstance().getModuleManager().nametagMod; + boolean modEnabled = nametagMod.isEnabled(); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + + if (this.func_110813_b(p_77033_1_) || (p_77033_1_.equals(Minecraft.getMinecraft().thePlayer) && modEnabled && (Boolean) nametagMod.showOwnNametag.getValue())) { + float var8 = 1.6F; + float var9 = 0.016666668F * var8; + double var10 = p_77033_1_.getDistanceSqToEntity(this.renderManager.livingPlayer); + float var12 = p_77033_1_.isSneaking() ? 32.0F : 64.0F; + + if (!Minecraft.getMinecraft().hideNametags && var10 < (double)(var12 * var12)) { + String var13 = p_77033_1_.func_145748_c_().getFormattedText(); + + if (p_77033_1_.isSneaking()) { + FontRenderer var14 = this.getFontRendererFromRenderManager(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_77033_2_ + 0.0F, (float)p_77033_4_ + p_77033_1_.height + 0.5F, (float)p_77033_6_); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-var9, -var9, var9); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Tessellator var15 = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + + boolean customTextColor = (Boolean) nametagMod.customTextColor.getValue() && modEnabled; + String string = customTextColor ? stripColor(var13) : var13; + + ModuleNickHider nickHider = CheatBreaker.getInstance().getModuleManager().nickHiderMod; + if (nickHider.isEnabled() && nickHider.hideRealName.getBooleanValue()) { + if (!nickHider.customNameString.getStringValue().equals(Minecraft.getMinecraft().getSession().getUsername())) { + string = string.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), nickHider.customNameString.getStringValue()); + } else { + string = string.replaceAll(Minecraft.getMinecraft().getSession().getUsername(), "You"); + } + } + + int var16 = var14.getStringWidth(string) / 2; + if (!modEnabled || (Boolean) nametagMod.background.getValue()) { + var15.startDrawingQuads(); + if (modEnabled) { + float alpha = (nametagMod.backgroundColor.getColorValue() >> 24 & 255) / 255.0F; + float red = (nametagMod.backgroundColor.getColorValue() >> 16 & 255) / 255.0F; + float green = (nametagMod.backgroundColor.getColorValue() >> 8 & 255) / 255.0F; + float blue = (nametagMod.backgroundColor.getColorValue() & 255) / 255.0F; + var15.setColorRGBA_F(red, green, blue, alpha); + } else { + var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); + } + var15.addVertex(-var16 - 1, -1, 0.0D); + var15.addVertex(-var16 - 1, 8, 0.0D); + var15.addVertex(var16 + 1, 8, 0.0D); + var15.addVertex(var16 + 1, -1, 0.0D); + var15.draw(); + } + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + + var14.drawString(string, -(var14.getStringWidth(string) / 2), 0, customTextColor ? new Color(nametagMod.textColor.getColorValue() >> 16 & 255, nametagMod.textColor.getColorValue() >> 8 & 255, nametagMod.textColor.getColorValue() & 255, 32).getRGB() : 553648127, modEnabled && (Boolean) nametagMod.textShadow.getValue()); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } else { + this.func_96449_a(p_77033_1_, p_77033_2_, p_77033_4_, p_77033_6_, var13, var9, var10); + } + } + } + } + + protected boolean func_110813_b(EntityLivingBase p_110813_1_) { + ModuleNametag nametagMod = CheatBreaker.getInstance().getModuleManager().nametagMod; + boolean modEnabled = nametagMod.isEnabled(); + boolean showTagsF1 = modEnabled && (Boolean) nametagMod.showNametagsInF1.getValue(); + return (Minecraft.isGuiEnabled() || showTagsF1) && p_110813_1_ != this.renderManager.livingPlayer && !p_110813_1_.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && p_110813_1_.riddenByEntity == null; + } + + protected void func_96449_a(EntityLivingBase p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) { + if (p_96449_1_.isPlayerSleeping()) { + this.func_147906_a(p_96449_1_, p_96449_8_, p_96449_2_, p_96449_4_ - 1.5D, p_96449_6_, 64); + } else { + this.func_147906_a(p_96449_1_, p_96449_8_, p_96449_2_, p_96449_4_, p_96449_6_, 64); + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) { + var2.setNewDimension(this.maxTileDimension); + } + + this.setStitchHolders.add(var2); + } + + public void doStitch() { + Stitcher.Holder[] var1 = (Stitcher.Holder[])((Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()])); + Arrays.sort(var1); + Stitcher.Holder[] var2 = var1; + int var3 = var1.length; + + for (int var4 = 0; var4 < var3; ++var4) { + Stitcher.Holder var5 = var2[var4]; + + if (!this.allocateSlot(var5)) { + String var6 = String.format("Unable to fit: %s, size: %dx%d, atlas: %dx%d, atlasMax: %dx%d - Maybe try a lower resolution resourcepack?", new Object[] {var5.getAtlasSprite().getIconName(), Integer.valueOf(var5.getAtlasSprite().getIconWidth()), Integer.valueOf(var5.getAtlasSprite().getIconHeight()), Integer.valueOf(this.currentWidth), Integer.valueOf(this.currentHeight), Integer.valueOf(this.maxWidth), Integer.valueOf(this.maxHeight)}); + throw new StitcherException(var5, var6); + } + } + + if (this.forcePowerOf2) { + this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); + this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); + } + } + + public List getStichSlots() { + ArrayList var1 = Lists.newArrayList(); + Iterator var2 = this.stitchSlots.iterator(); + + while (var2.hasNext()) { + Stitcher.Slot var7 = (Stitcher.Slot)var2.next(); + var7.getAllStitchSlots(var1); + } + + ArrayList var71 = Lists.newArrayList(); + Iterator var8 = var1.iterator(); + + while (var8.hasNext()) { + Stitcher.Slot var4 = (Stitcher.Slot)var8.next(); + Stitcher.Holder var5 = var4.getStitchHolder(); + TextureAtlasSprite var6 = var5.getAtlasSprite(); + var6.initSprite(this.currentWidth, this.currentHeight, var4.getOriginX(), var4.getOriginY(), var5.isRotated()); + var71.add(var6); + } + + return var71; + } + + private static int func_147969_b(int p_147969_0_, int p_147969_1_) { + return (p_147969_0_ >> p_147969_1_) + ((p_147969_0_ & (1 << p_147969_1_) - 1) == 0 ? 0 : 1) << p_147969_1_; + } + + /** + * Attempts to find space for specified tile + */ + private boolean allocateSlot(Stitcher.Holder par1StitchHolder) { + for (int var2 = 0; var2 < this.stitchSlots.size(); ++var2) { + if (((Stitcher.Slot)this.stitchSlots.get(var2)).addSlot(par1StitchHolder)) { + return true; + } + + par1StitchHolder.rotate(); + + if (((Stitcher.Slot)this.stitchSlots.get(var2)).addSlot(par1StitchHolder)) { + return true; + } + + par1StitchHolder.rotate(); + } + + return this.expandAndAllocateSlot(par1StitchHolder); + } + + /** + * Expand stitched texture in order to make space for specified tile + */ + private boolean expandAndAllocateSlot(Stitcher.Holder par1StitchHolder) { + int var2 = Math.min(par1StitchHolder.getWidth(), par1StitchHolder.getHeight()); + boolean var3 = this.currentWidth == 0 && this.currentHeight == 0; + boolean var4; + int var5; + + if (this.forcePowerOf2) { + var5 = MathHelper.roundUpToPowerOfTwo(this.currentWidth); + int var15 = MathHelper.roundUpToPowerOfTwo(this.currentHeight); + int var14 = MathHelper.roundUpToPowerOfTwo(this.currentWidth + var2); + int var8 = MathHelper.roundUpToPowerOfTwo(this.currentHeight + var2); + boolean var9 = var14 <= this.maxWidth; + boolean var10 = var8 <= this.maxHeight; + + if (!var9 && !var10) { + return false; + } + + boolean var11 = var5 != var14; + boolean var12 = var15 != var8; + + if (var11 ^ var12) { + var4 = !var11; + } else { + var4 = var9 && var5 <= var15; + } + } else { + boolean var151 = this.currentWidth + var2 <= this.maxWidth; + boolean var141 = this.currentHeight + var2 <= this.maxHeight; + + if (!var151 && !var141) { + return false; + } + + var4 = var151 && (var3 || this.currentWidth <= this.currentHeight); + } + + var5 = Math.max(par1StitchHolder.getWidth(), par1StitchHolder.getHeight()); + + if (MathHelper.roundUpToPowerOfTwo((!var4 ? this.currentHeight : this.currentWidth) + var5) > (!var4 ? this.maxHeight : this.maxWidth)) { + return false; + } else { + Stitcher.Slot var152; + + if (var4) { + if (par1StitchHolder.getWidth() > par1StitchHolder.getHeight()) { + par1StitchHolder.rotate(); + } + + if (this.currentHeight == 0) { + this.currentHeight = par1StitchHolder.getHeight(); + } + + var152 = new Stitcher.Slot(this.currentWidth, 0, par1StitchHolder.getWidth(), this.currentHeight); + this.currentWidth += par1StitchHolder.getWidth(); + } else { + var152 = new Stitcher.Slot(0, this.currentHeight, this.currentWidth, par1StitchHolder.getHeight()); + this.currentHeight += par1StitchHolder.getHeight(); + } + + var152.addSlot(par1StitchHolder); + this.stitchSlots.add(var152); + return true; + } + } + + public static class Holder implements Comparable { + private final TextureAtlasSprite theTexture; + private final int width; + private final int height; + private final int mipmapLevelHolder; + private boolean rotated; + private float scaleFactor = 1.0F; + + public Holder(TextureAtlasSprite p_i45094_1_, int p_i45094_2_) { + this.theTexture = p_i45094_1_; + this.width = p_i45094_1_.getIconWidth(); + this.height = p_i45094_1_.getIconHeight(); + this.mipmapLevelHolder = p_i45094_2_; + this.rotated = Stitcher.func_147969_b(this.height, p_i45094_2_) > Stitcher.func_147969_b(this.width, p_i45094_2_); + } + + public TextureAtlasSprite getAtlasSprite() { + return this.theTexture; + } + + public int getWidth() { + return this.rotated ? Stitcher.func_147969_b((int)((float)this.height * this.scaleFactor), this.mipmapLevelHolder) : Stitcher.func_147969_b((int)((float)this.width * this.scaleFactor), this.mipmapLevelHolder); + } + + public int getHeight() { + return this.rotated ? Stitcher.func_147969_b((int)((float)this.width * this.scaleFactor), this.mipmapLevelHolder) : Stitcher.func_147969_b((int)((float)this.height * this.scaleFactor), this.mipmapLevelHolder); + } + + public void rotate() { + this.rotated = !this.rotated; + } + + public boolean isRotated() { + return this.rotated; + } + + public void setNewDimension(int par1) { + if (this.width > par1 && this.height > par1) { + this.scaleFactor = (float)par1 / (float)Math.min(this.width, this.height); + } + } + + public String toString() { + return "Holder{width=" + this.width + ", height=" + this.height + '}'; + } + + public int compareTo(Stitcher.Holder par1Obj) { + int var2; + + if (this.getHeight() == par1Obj.getHeight()) { + if (this.getWidth() == par1Obj.getWidth()) { + if (this.theTexture.getIconName() == null) { + return par1Obj.theTexture.getIconName() == null ? 0 : -1; + } + + return this.theTexture.getIconName().compareTo(par1Obj.theTexture.getIconName()); + } + + var2 = this.getWidth() < par1Obj.getWidth() ? 1 : -1; + } else { + var2 = this.getHeight() < par1Obj.getHeight() ? 1 : -1; + } + + return var2; + } + + public int compareTo(Object par1Obj) { + return this.compareTo((Stitcher.Holder)par1Obj); + } + } + + public static class Slot { + private final int originX; + private final int originY; + private final int width; + private final int height; + private List subSlots; + private Stitcher.Holder holder; + + public Slot(int par1, int par2, int par3, int par4) { + this.originX = par1; + this.originY = par2; + this.width = par3; + this.height = par4; + } + + public Stitcher.Holder getStitchHolder() { + return this.holder; + } + + public int getOriginX() { + return this.originX; + } + + public int getOriginY() { + return this.originY; + } + + public boolean addSlot(Stitcher.Holder par1StitchHolder) { + if (this.holder != null) { + return false; + } else { + int var2 = par1StitchHolder.getWidth(); + int var3 = par1StitchHolder.getHeight(); + + if (var2 <= this.width && var3 <= this.height) { + if (var2 == this.width && var3 == this.height) { + this.holder = par1StitchHolder; + return true; + } else { + if (this.subSlots == null) { + this.subSlots = new ArrayList(1); + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY, var2, var3)); + int var8 = this.width - var2; + int var9 = this.height - var3; + + if (var9 > 0 && var8 > 0) { + int var6 = Math.max(this.height, var8); + int var7 = Math.max(this.width, var9); + + if (var6 >= var7) { + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + var3, var2, var9)); + this.subSlots.add(new Stitcher.Slot(this.originX + var2, this.originY, var8, this.height)); + } else { + this.subSlots.add(new Stitcher.Slot(this.originX + var2, this.originY, var8, var3)); + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + var3, this.width, var9)); + } + } else if (var8 == 0) { + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + var3, var2, var9)); + } else if (var9 == 0) { + this.subSlots.add(new Stitcher.Slot(this.originX + var2, this.originY, var8, var3)); + } + } + + Iterator var81 = this.subSlots.iterator(); + + while (var81.hasNext()) { + Stitcher.Slot var91 = (Stitcher.Slot)var81.next(); + + if (var91.addSlot(par1StitchHolder)) { + return true; + } + } + + return false; + } + } else { + return false; + } + } + } + + public void getAllStitchSlots(List par1List) { + if (this.holder != null) { + par1List.add(this); + } else if (this.subSlots != null) { + Iterator var2 = this.subSlots.iterator(); + + while (var2.hasNext()) { + Stitcher.Slot var3 = (Stitcher.Slot)var2.next(); + var3.getAllStitchSlots(par1List); + } + } + } + + public String toString() { + return "Slot{originX=" + this.originX + ", originY=" + this.originY + ", width=" + this.width + ", height=" + this.height + ", texture=" + this.holder + ", subSlots=" + this.subSlots + '}'; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java new file mode 100644 index 0000000..0e26656 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java @@ -0,0 +1,651 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationFrame; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.src.Mipmaps; +import net.minecraft.src.TextureUtils; +import net.minecraft.util.IIcon; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import shadersmod.client.Shaders; + +public class TextureAtlasSprite implements IIcon { + private final String iconName; + protected List framesTextureData = Lists.newArrayList(); + private AnimationMetadataSection animationMetadata; + protected boolean rotated; + private boolean field_147966_k; + protected int originX; + protected int originY; + protected int width; + protected int height; + private float minU; + private float maxU; + private float minV; + private float maxV; + protected int frameCounter; + protected int tickCounter; + private int indexInMap = -1; + public float baseU; + public float baseV; + public int sheetWidth; + public int sheetHeight; + private boolean mipmapActive = false; + public int glOwnTextureId = -1; + private int uploadedFrameIndex = -1; + private int uploadedOwnFrameIndex = -1; + public IntBuffer[] frameBuffers; + public Mipmaps[] frameMipmaps; + public int mipmapLevels = 0; + public TextureAtlasSprite spriteNormal = null; + public TextureAtlasSprite spriteSpecular = null; + public boolean isShadersSprite = false; + + protected TextureAtlasSprite(String par1Str) { + this.iconName = par1Str; + } + + public void initSprite(int par1, int par2, int par3, int par4, boolean par5) { + this.originX = par3; + this.originY = par4; + this.rotated = par5; + float var6 = (float)(0.009999999776482582D / (double)par1); + float var7 = (float)(0.009999999776482582D / (double)par2); + this.minU = (float)par3 / (float)((double)par1) + var6; + this.maxU = (float)(par3 + this.width) / (float)((double)par1) - var6; + this.minV = (float)par4 / (float)par2 + var7; + this.maxV = (float)(par4 + this.height) / (float)par2 - var7; + + if (this.field_147966_k) { + float var8 = 8.0F / (float)par1; + float var9 = 8.0F / (float)par2; + this.minU += var8; + this.maxU -= var8; + this.minV += var9; + this.maxV -= var9; + } + + this.baseU = Math.min(this.minU, this.maxU); + this.baseV = Math.min(this.minV, this.maxV); + + if (this.spriteNormal != null) { + this.spriteNormal.initSprite(par1, par2, par3, par4, par5); + } + + if (this.spriteSpecular != null) { + this.spriteSpecular.initSprite(par1, par2, par3, par4, par5); + } + } + + public void copyFrom(TextureAtlasSprite par1TextureAtlasSprite) { + this.originX = par1TextureAtlasSprite.originX; + this.originY = par1TextureAtlasSprite.originY; + this.width = par1TextureAtlasSprite.width; + this.height = par1TextureAtlasSprite.height; + this.rotated = par1TextureAtlasSprite.rotated; + this.minU = par1TextureAtlasSprite.minU; + this.maxU = par1TextureAtlasSprite.maxU; + this.minV = par1TextureAtlasSprite.minV; + this.maxV = par1TextureAtlasSprite.maxV; + this.baseU = Math.min(this.minU, this.maxU); + this.baseV = Math.min(this.minV, this.maxV); + } + + /** + * Returns the X position of this icon on its texture sheet, in pixels. + */ + public int getOriginX() { + return this.originX; + } + + /** + * Returns the Y position of this icon on its texture sheet, in pixels. + */ + public int getOriginY() { + return this.originY; + } + + /** + * Returns the width of the icon, in pixels. + */ + public int getIconWidth() { + return this.width; + } + + /** + * Returns the height of the icon, in pixels. + */ + public int getIconHeight() { + return this.height; + } + + /** + * Returns the minimum U coordinate to use when rendering with this icon. + */ + public float getMinU() { + return this.minU; + } + + /** + * Returns the maximum U coordinate to use when rendering with this icon. + */ + public float getMaxU() { + return this.maxU; + } + + /** + * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. + */ + public float getInterpolatedU(double par1) { + float var3 = this.maxU - this.minU; + return this.minU + var3 * (float)par1 / 16.0F; + } + + /** + * Returns the minimum V coordinate to use when rendering with this icon. + */ + public float getMinV() { + return this.minV; + } + + /** + * Returns the maximum V coordinate to use when rendering with this icon. + */ + public float getMaxV() { + return this.maxV; + } + + /** + * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. + */ + public float getInterpolatedV(double par1) { + float var3 = this.maxV - this.minV; + return this.minV + var3 * ((float)par1 / 16.0F); + } + + public String getIconName() { + return this.iconName; + } + + public void updateAnimation() { + if (this.animationMetadata != null) { + ++this.tickCounter; + + if (this.tickCounter >= this.animationMetadata.getFrameTimeSingle(this.frameCounter)) { + int var1 = this.animationMetadata.getFrameIndex(this.frameCounter); + int var2 = this.animationMetadata.getFrameCount() == 0 ? this.framesTextureData.size() : this.animationMetadata.getFrameCount(); + this.frameCounter = (this.frameCounter + 1) % var2; + this.tickCounter = 0; + int var3 = this.animationMetadata.getFrameIndex(this.frameCounter); + boolean texBlur = false; + boolean texClamp = false; + + if (var1 != var3 && var3 >= 0 && var3 < this.framesTextureData.size()) { + TextureUtil.func_147955_a((int[][])((int[][])this.framesTextureData.get(var3)), this.width, this.height, this.originX, this.originY, texBlur, texClamp); + this.uploadedFrameIndex = var3; + } + } + } + } + + public int[][] func_147965_a(int p_147965_1_) { + return (int[][])((int[][])this.framesTextureData.get(p_147965_1_)); + } + + public int getFrameCount() { + return this.framesTextureData.size(); + } + + public void setIconWidth(int par1) { + this.width = par1; + } + + public void setIconHeight(int par1) { + this.height = par1; + } + + public void func_147964_a(BufferedImage[] p_147964_1_, AnimationMetadataSection p_147964_2_, boolean p_147964_3_) { + this.resetSprite(); + this.field_147966_k = p_147964_3_; + int var4 = p_147964_1_[0].getWidth(); + int var5 = p_147964_1_[0].getHeight(); + this.width = var4; + this.height = var5; + + if (p_147964_3_) { + this.width += 16; + this.height += 16; + } + + int[][] var6 = new int[p_147964_1_.length][]; + int var7; + + for (var7 = 0; var7 < p_147964_1_.length; ++var7) { + BufferedImage var12 = p_147964_1_[var7]; + + if (var12 != null) { + if (var7 > 0 && (var12.getWidth() != var4 >> var7 || var12.getHeight() != var5 >> var7)) { + throw new RuntimeException(String.format("Unable to load miplevel: %d, image is size: %dx%d, expected %dx%d", new Object[] {Integer.valueOf(var7), Integer.valueOf(var12.getWidth()), Integer.valueOf(var12.getHeight()), Integer.valueOf(var4 >> var7), Integer.valueOf(var5 >> var7)})); + } + + var6[var7] = new int[var12.getWidth() * var12.getHeight()]; + var12.getRGB(0, 0, var12.getWidth(), var12.getHeight(), var6[var7], 0, var12.getWidth()); + } + } + + if (p_147964_2_ == null) { + if (var5 != var4) { + throw new RuntimeException("broken aspect ratio and not an animation"); + } + + this.func_147961_a(var6); + this.framesTextureData.add(this.func_147960_a(var6, var4, var5)); + } else { + var7 = var5 / var4; + int var121 = var4; + int var9 = var4; + this.height = this.width; + int var11; + + if (p_147964_2_.getFrameCount() > 0) { + Iterator var13 = p_147964_2_.getFrameIndexSet().iterator(); + + while (var13.hasNext()) { + var11 = ((Integer)var13.next()).intValue(); + + if (var11 >= var7) { + throw new RuntimeException("invalid frameindex " + var11); + } + + this.allocateFrameTextureData(var11); + this.framesTextureData.set(var11, this.func_147960_a(func_147962_a(var6, var121, var9, var11), var121, var9)); + } + + this.animationMetadata = p_147964_2_; + } else { + ArrayList var131 = Lists.newArrayList(); + + for (var11 = 0; var11 < var7; ++var11) { + this.framesTextureData.add(this.func_147960_a(func_147962_a(var6, var121, var9, var11), var121, var9)); + var131.add(new AnimationFrame(var11, -1)); + } + + this.animationMetadata = new AnimationMetadataSection(var131, this.width, this.height, p_147964_2_.getFrameTime()); + } + } + + if (!this.isShadersSprite) { + if (Config.isShaders()) { + this.loadShadersSprites(); + } + } + } + + public void func_147963_d(int p_147963_1_) { + ArrayList var2 = Lists.newArrayList(); + + for (int var3 = 0; var3 < this.framesTextureData.size(); ++var3) { + final int[][] var4 = (int[][])((int[][])this.framesTextureData.get(var3)); + + if (var4 != null) { + try { + var2.add(TextureUtil.func_147949_a(p_147963_1_, this.width, var4)); + } catch (Throwable var8) { + CrashReport var6 = CrashReport.makeCrashReport(var8, "Generating mipmaps for frame"); + CrashReportCategory var7 = var6.makeCategory("Frame being iterated"); + var7.addCrashSection("Frame index", Integer.valueOf(var3)); + var7.addCrashSectionCallable("Frame sizes", new Callable() { + public String call() { + StringBuilder var1 = new StringBuilder(); + int[][] var2 = var4; + int var3 = var2.length; + + for (int var4x = 0; var4x < var3; ++var4x) { + int[] var5 = var2[var4x]; + + if (var1.length() > 0) { + var1.append(", "); + } + + var1.append(var5 == null ? "null" : Integer.valueOf(var5.length)); + } + + return var1.toString(); + } + }); + throw new ReportedException(var6); + } + } + } + + this.setFramesTextureData(var2); + } + + private void func_147961_a(int[][] p_147961_1_) { + int[] var2 = p_147961_1_[0]; + int var3 = 0; + int var4 = 0; + int var5 = 0; + int var6 = 0; + int var7; + + for (var7 = 0; var7 < var2.length; ++var7) { + if ((var2[var7] & -16777216) != 0) { + var4 += var2[var7] >> 16 & 255; + var5 += var2[var7] >> 8 & 255; + var6 += var2[var7] >> 0 & 255; + ++var3; + } + } + + if (var3 != 0) { + var4 /= var3; + var5 /= var3; + var6 /= var3; + + for (var7 = 0; var7 < var2.length; ++var7) { + if ((var2[var7] & -16777216) == 0) { + var2[var7] = var4 << 16 | var5 << 8 | var6; + } + } + } + } + + private int[][] func_147960_a(int[][] p_147960_1_, int p_147960_2_, int p_147960_3_) { + if (!this.field_147966_k) { + return p_147960_1_; + } else { + int[][] var4 = new int[p_147960_1_.length][]; + + for (int var5 = 0; var5 < p_147960_1_.length; ++var5) { + int[] var6 = p_147960_1_[var5]; + + if (var6 != null) { + int[] var7 = new int[(p_147960_2_ + 16 >> var5) * (p_147960_3_ + 16 >> var5)]; + System.arraycopy(var6, 0, var7, 0, var6.length); + var4[var5] = TextureUtil.func_147948_a(var7, p_147960_2_ >> var5, p_147960_3_ >> var5, 8 >> var5); + } + } + + return var4; + } + } + + private void allocateFrameTextureData(int par1) { + if (this.framesTextureData.size() <= par1) { + for (int var2 = this.framesTextureData.size(); var2 <= par1; ++var2) { + this.framesTextureData.add((Object)null); + } + } + } + + private static int[][] func_147962_a(int[][] p_147962_0_, int p_147962_1_, int p_147962_2_, int p_147962_3_) { + int[][] var4 = new int[p_147962_0_.length][]; + + for (int var5 = 0; var5 < p_147962_0_.length; ++var5) { + int[] var6 = p_147962_0_[var5]; + + if (var6 != null) { + var4[var5] = new int[(p_147962_1_ >> var5) * (p_147962_2_ >> var5)]; + System.arraycopy(var6, p_147962_3_ * var4[var5].length, var4[var5], 0, var4[var5].length); + } + } + + return var4; + } + + public void clearFramesTextureData() { + this.framesTextureData.clear(); + } + + public boolean hasAnimationMetadata() { + return this.animationMetadata != null; + } + + public void setFramesTextureData(List par1List) { + this.framesTextureData = par1List; + + for (int i = 0; i < this.framesTextureData.size(); ++i) { + int[][] datas = (int[][])((int[][])this.framesTextureData.get(i)); + + if (datas != null && !this.iconName.startsWith("leaves_")) { + for (int di = 0; di < datas.length; ++di) { + int[] data = datas[di]; + + if (data != null) { + this.fixTransparentColor(data); + } + } + } + } + } + + private void resetSprite() { + this.animationMetadata = null; + this.setFramesTextureData(Lists.newArrayList()); + this.frameCounter = 0; + this.tickCounter = 0; + this.deleteOwnTexture(); + this.uploadedFrameIndex = -1; + this.uploadedOwnFrameIndex = -1; + this.frameBuffers = null; + this.frameMipmaps = null; + } + + public String toString() { + return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; + } + + public int getWidth() { + return this.width; + } + + public int getHeight() { + return this.height; + } + + public int getIndexInMap() { + return this.indexInMap; + } + + public void setIndexInMap(int indexInMap) { + this.indexInMap = indexInMap; + } + + public void setMipmapActive(boolean mipmapActive) { + this.mipmapActive = mipmapActive; + this.frameMipmaps = null; + } + + public void uploadFrameTexture() { + this.uploadFrameTexture(this.frameCounter, this.originX, this.originY); + } + + public void uploadFrameTexture(int frameIndex, int xPos, int yPos) {} + + private void uploadFrameMipmaps(int frameIndex, int xPos, int yPos) {} + + public void bindOwnTexture() {} + + public void bindUploadOwnTexture() { + this.bindOwnTexture(); + this.uploadFrameTexture(this.frameCounter, 0, 0); + } + + public void uploadOwnAnimation() { + if (this.uploadedFrameIndex != this.uploadedOwnFrameIndex) { + TextureUtil.bindTexture(this.glOwnTextureId); + this.uploadFrameTexture(this.uploadedFrameIndex, 0, 0); + this.uploadedOwnFrameIndex = this.uploadedFrameIndex; + } + } + + public void deleteOwnTexture() { + if (this.glOwnTextureId >= 0) { + GL11.glDeleteTextures(this.glOwnTextureId); + this.glOwnTextureId = -1; + } + } + + private void fixTransparentColor(int[] data) { + if (!this.isShadersSprite) { + long redSum = 0L; + long greenSum = 0L; + long blueSum = 0L; + long count = 0L; + int redAvg; + int greenAvg; + int blueAvg; + int colAvg; + int i; + int col; + + for (redAvg = 0; redAvg < data.length; ++redAvg) { + greenAvg = data[redAvg]; + blueAvg = greenAvg >> 24 & 255; + + if (blueAvg >= 16) { + colAvg = greenAvg >> 16 & 255; + i = greenAvg >> 8 & 255; + col = greenAvg & 255; + redSum += (long)colAvg; + greenSum += (long)i; + blueSum += (long)col; + ++count; + } + } + + if (count > 0L) { + redAvg = (int)(redSum / count); + greenAvg = (int)(greenSum / count); + blueAvg = (int)(blueSum / count); + colAvg = redAvg << 16 | greenAvg << 8 | blueAvg; + + for (i = 0; i < data.length; ++i) { + col = data[i]; + int alpha = col >> 24 & 255; + + if (alpha <= 16) { + data[i] = colAvg; + } + } + } + } + } + + public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) { + return false; + } + + public boolean load(IResourceManager manager, ResourceLocation location) { + return true; + } + + private void loadShadersSprites() { + this.mipmapLevels = Config.getTextureMap().getMipmapLevels(); + String nameSpecular; + ResourceLocation locSpecular; + TextureAtlasSprite e; + + if (Shaders.configNormalMap) { + nameSpecular = this.iconName + "_n"; + locSpecular = new ResourceLocation(nameSpecular); + locSpecular = Config.getTextureMap().func_147634_a(locSpecular, 0); + + if (Config.hasResource(locSpecular)) { + try { + e = new TextureAtlasSprite(nameSpecular); + e.isShadersSprite = true; + e.copyFrom(this); + e.loadShaderSpriteFrames(locSpecular, this.mipmapLevels + 1); + e.func_147963_d(this.mipmapLevels); + this.spriteNormal = e; + } catch (IOException var5) { + Config.warn("Error loading normal texture: " + nameSpecular); + Config.warn(var5.getClass().getName() + ": " + var5.getMessage()); + } + } + } + + if (Shaders.configSpecularMap) { + nameSpecular = this.iconName + "_s"; + locSpecular = new ResourceLocation(nameSpecular); + locSpecular = Config.getTextureMap().func_147634_a(locSpecular, 0); + + if (Config.hasResource(locSpecular)) { + try { + e = new TextureAtlasSprite(nameSpecular); + e.isShadersSprite = true; + e.copyFrom(this); + e.loadShaderSpriteFrames(locSpecular, this.mipmapLevels + 1); + e.func_147963_d(this.mipmapLevels); + this.spriteSpecular = e; + } catch (IOException var4) { + Config.warn("Error loading specular texture: " + nameSpecular); + Config.warn(var4.getClass().getName() + ": " + var4.getMessage()); + } + } + } + } + + public void loadShaderSpriteFrames(ResourceLocation loc, int mipmaplevels) throws IOException { + IResource resource = Config.getResource(loc); + BufferedImage bufferedimage = TextureUtils.readBufferedImage(resource.getInputStream()); + + if (this.width != bufferedimage.getWidth()) { + bufferedimage = TextureUtils.scaleImage(bufferedimage, this.width); + } + + AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)resource.getMetadata("animation"); + int[][] aint = new int[mipmaplevels][]; + aint[0] = new int[bufferedimage.getWidth() * bufferedimage.getHeight()]; + bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), aint[0], 0, bufferedimage.getWidth()); + + if (animationmetadatasection == null) { + this.framesTextureData.add(aint); + } else { + int i = bufferedimage.getHeight() / this.width; + int k; + + if (animationmetadatasection.getFrameCount() > 0) { + Iterator list = animationmetadatasection.getFrameIndexSet().iterator(); + + while (list.hasNext()) { + k = ((Integer)list.next()).intValue(); + + if (k >= i) { + throw new RuntimeException("invalid frameindex " + k); + } + + this.allocateFrameTextureData(k); + this.framesTextureData.set(k, func_147962_a(aint, this.width, this.width, k)); + } + + this.animationMetadata = animationmetadatasection; + } else { + ArrayList var10 = Lists.newArrayList(); + + for (k = 0; k < i; ++k) { + this.framesTextureData.add(func_147962_a(aint, this.width, this.width, k)); + var10.add(new AnimationFrame(k, -1)); + } + + this.animationMetadata = new AnimationMetadataSection(var10, this.width, this.height, animationmetadatasection.getFrameTime()); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java new file mode 100644 index 0000000..565a48d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureClock.java @@ -0,0 +1,67 @@ +package net.minecraft.client.renderer.texture; + +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; +import shadersmod.client.ShadersTex; + +public class TextureClock extends TextureAtlasSprite { + private double field_94239_h; + private double field_94240_i; + + public TextureClock(String par1Str) { + super(par1Str); + } + + public void updateAnimation() { + if (!this.framesTextureData.isEmpty()) { + Minecraft var1 = Minecraft.getMinecraft(); + double var2 = 0.0D; + + if (var1.theWorld != null && var1.thePlayer != null) { + float var7 = var1.theWorld.getCelestialAngle(1.0F); + var2 = (double)var7; + + if (!var1.theWorld.provider.isSurfaceWorld()) { + var2 = Math.random(); + } + } + + double var71; + + for (var71 = var2 - this.field_94239_h; var71 < -0.5D; ++var71) { + ; + } + + while (var71 >= 0.5D) { + --var71; + } + + if (var71 < -1.0D) { + var71 = -1.0D; + } + + if (var71 > 1.0D) { + var71 = 1.0D; + } + + this.field_94240_i += var71 * 0.1D; + this.field_94240_i *= 0.8D; + this.field_94239_h += this.field_94240_i; + int var6; + + for (var6 = (int)((this.field_94239_h + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); var6 < 0; var6 = (var6 + this.framesTextureData.size()) % this.framesTextureData.size()) { + ; + } + + if (var6 != this.frameCounter) { + this.frameCounter = var6; + + if (Config.isShaders()) { + ShadersTex.uploadTexSub((int[][])((int[][])this.framesTextureData.get(this.frameCounter)), this.width, this.height, this.originX, this.originY, false, false); + } else { + TextureUtil.func_147955_a((int[][])((int[][])this.framesTextureData.get(this.frameCounter)), this.width, this.height, this.originX, this.originY, false, false); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java new file mode 100644 index 0000000..546a053 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureCompass.java @@ -0,0 +1,92 @@ +package net.minecraft.client.renderer.texture; + +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import shadersmod.client.ShadersTex; + +public class TextureCompass extends TextureAtlasSprite { + /** Current compass heading in radians */ + public double currentAngle; + + /** Speed and direction of compass rotation */ + public double angleDelta; + + public TextureCompass(String par1Str) { + super(par1Str); + } + + public void updateAnimation() { + Minecraft var1 = Minecraft.getMinecraft(); + + if (var1.theWorld != null && var1.thePlayer != null) { + this.updateCompass(var1.theWorld, var1.thePlayer.posX, var1.thePlayer.posZ, var1.thePlayer.rotationYaw, false, false); + } else { + this.updateCompass((World)null, 0.0D, 0.0D, 0.0D, true, false); + } + } + + /** + * Updates the compass based on the given x,z coords and camera direction + */ + public void updateCompass(World par1World, double par2, double par4, double par6, boolean par8, boolean par9) { + if (!this.framesTextureData.isEmpty()) { + double var10 = 0.0D; + + if (par1World != null && !par8) { + ChunkCoordinates var18 = par1World.getSpawnPoint(); + double var13 = (double)var18.posX - par2; + double var15 = (double)var18.posZ - par4; + par6 %= 360.0D; + var10 = -((par6 - 90.0D) * Math.PI / 180.0D - Math.atan2(var15, var13)); + + if (!par1World.provider.isSurfaceWorld()) { + var10 = Math.random() * Math.PI * 2.0D; + } + } + + if (par9) { + this.currentAngle = var10; + } else { + double var181; + + for (var181 = var10 - this.currentAngle; var181 < -Math.PI; var181 += (Math.PI * 2D)) { + ; + } + + while (var181 >= Math.PI) { + var181 -= (Math.PI * 2D); + } + + if (var181 < -1.0D) { + var181 = -1.0D; + } + + if (var181 > 1.0D) { + var181 = 1.0D; + } + + this.angleDelta += var181 * 0.1D; + this.angleDelta *= 0.8D; + this.currentAngle += this.angleDelta; + } + + int var182; + + for (var182 = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); var182 < 0; var182 = (var182 + this.framesTextureData.size()) % this.framesTextureData.size()) { + ; + } + + if (var182 != this.frameCounter) { + this.frameCounter = var182; + + if (Config.isShaders()) { + ShadersTex.uploadTexSub((int[][])((int[][])this.framesTextureData.get(this.frameCounter)), this.width, this.height, this.originX, this.originY, false, false); + } else { + TextureUtil.func_147955_a((int[][])((int[][])this.framesTextureData.get(this.frameCounter)), this.width, this.height, this.originX, this.originY, false, false); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManage# b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManage# new file mode 100644 index 0000000..61008bd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManage# @@ -0,0 +1,47 @@ +*************** +*** 72,84 **** + + public boolean func_110579_a(ResourceLocation p_110579_1_, final ITextureObject p_110579_2_) { + boolean var3 = true; +- + try { + ((ITextureObject)p_110579_2_).func_110551_a(this.field_110582_d); + } catch (IOException var8) { + field_147646_a.warn("Failed to load texture: " + p_110579_1_, var8); +- p_110579_2_ = TextureUtil.field_111001_a; +- this.field_110585_a.put(p_110579_1_, p_110579_2_); + var3 = false; + } catch (Throwable var9) { + CrashReport var5 = CrashReport.func_85055_a(var9, "Registering texture"); +--- 72,85 ---- + + public boolean func_110579_a(ResourceLocation p_110579_1_, final ITextureObject p_110579_2_) { + boolean var3 = true; ++ ITextureObject p_110579_2_2 = p_110579_2_; ++ + try { + ((ITextureObject)p_110579_2_).func_110551_a(this.field_110582_d); + } catch (IOException var8) { + field_147646_a.warn("Failed to load texture: " + p_110579_1_, var8); ++ p_110579_2_2 = TextureUtil.field_111001_a; ++ this.field_110585_a.put(p_110579_1_, p_110579_2_2); + var3 = false; + } catch (Throwable var9) { + CrashReport var5 = CrashReport.func_85055_a(var9, "Registering texture"); +*************** +*** 95,101 **** + throw new ReportedException(var5); + } + +- this.field_110585_a.put(p_110579_1_, p_110579_2_); + return var3; + } + +--- 96,102 ---- + throw new ReportedException(var5); + } + ++ this.field_110585_a.put(p_110579_1_, p_110579_2_2); + return var3; + } + diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java new file mode 100644 index 0000000..d3fe07e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java @@ -0,0 +1,169 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.src.RandomMobs; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import shadersmod.client.ShadersTex; + +public class TextureManager implements ITickable, IResourceManagerReloadListener { + private static final Logger logger = LogManager.getLogger(); + private final Map mapTextureObjects = Maps.newHashMap(); + private final Map mapResourceLocations = Maps.newHashMap(); + private final List listTickables = Lists.newArrayList(); + private final Map mapTextureCounters = Maps.newHashMap(); + private IResourceManager theResourceManager; + + public TextureManager(IResourceManager par1ResourceManager) { + this.theResourceManager = par1ResourceManager; + } + + public void bindTexture(ResourceLocation par1ResourceLocation) { + if (Config.isRandomMobs()) { + par1ResourceLocation = RandomMobs.getTextureLocation(par1ResourceLocation); + } + + Object var2 = (ITextureObject)this.mapTextureObjects.get(par1ResourceLocation); + + if (var2 == null) { + var2 = new SimpleTexture(par1ResourceLocation); + this.loadTexture(par1ResourceLocation, (ITextureObject)var2); + } + + if (Config.isShaders()) { + ShadersTex.bindTexture((ITextureObject)var2); + } else { + TextureUtil.bindTexture(((ITextureObject)var2).getGlTextureId()); + } + } + + public ResourceLocation getResourceLocation(int par1) { + return (ResourceLocation)this.mapResourceLocations.get(Integer.valueOf(par1)); + } + + public boolean loadTextureMap(ResourceLocation par1ResourceLocation, TextureMap par2TextureMap) { + if (this.loadTickableTexture(par1ResourceLocation, par2TextureMap)) { + this.mapResourceLocations.put(Integer.valueOf(par2TextureMap.getTextureType()), par1ResourceLocation); + return true; + } else { + return false; + } + } + + public boolean loadTickableTexture(ResourceLocation par1ResourceLocation, ITickableTextureObject par2TickableTextureObject) { + if (this.loadTexture(par1ResourceLocation, par2TickableTextureObject)) { + this.listTickables.add(par2TickableTextureObject); + return true; + } else { + return false; + } + } + + public boolean loadTexture(ResourceLocation par1ResourceLocation, final ITextureObject par2TextureObject) { + boolean var3 = true; + Object par2TextureObject2 = par2TextureObject; + + try { + par2TextureObject.loadTexture(this.theResourceManager); + } catch (IOException var8) { + logger.warn("Failed to load texture: " + par1ResourceLocation, var8); + par2TextureObject2 = TextureUtil.missingTexture; + this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject2); + var3 = false; + } catch (Throwable var9) { + CrashReport var5 = CrashReport.makeCrashReport(var9, "Registering texture"); + CrashReportCategory var6 = var5.makeCategory("Resource location being registered"); + var6.addCrashSection("Resource location", par1ResourceLocation); + var6.addCrashSectionCallable("Texture object class", () -> par2TextureObject.getClass().getName()); + throw new ReportedException(var5); + } + + this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject2); + return var3; + } + + public ITextureObject getTexture(ResourceLocation par1ResourceLocation) { + return (ITextureObject)this.mapTextureObjects.get(par1ResourceLocation); + } + + public ResourceLocation getDynamicTextureLocation(String par1Str, DynamicTexture par2DynamicTexture) { + if (par1Str.equals("logo")) { + par2DynamicTexture = Config.getMojangLogoTexture(par2DynamicTexture); + } + + Integer var3 = (Integer)this.mapTextureCounters.get(par1Str); + + if (var3 == null) { + var3 = Integer.valueOf(1); + } else { + var3 = Integer.valueOf(var3.intValue() + 1); + } + + this.mapTextureCounters.put(par1Str, var3); + ResourceLocation var4 = new ResourceLocation(String.format("dynamic/%s_%d", new Object[] {par1Str, var3})); + this.loadTexture(var4, par2DynamicTexture); + return var4; + } + + public void tick() { + Iterator var1 = this.listTickables.iterator(); + + while (var1.hasNext()) { + ITickable var2 = (ITickable)var1.next(); + var2.tick(); + } + } + + public void func_147645_c(ResourceLocation p_147645_1_) { + ITextureObject var2 = this.getTexture(p_147645_1_); + + if (var2 != null) { + this.mapTextureObjects.remove(p_147645_1_); + TextureUtil.deleteTexture(var2.getGlTextureId()); + } + } + + public void onResourceManagerReload(IResourceManager par1ResourceManager) { + Config.dbg("*** Reloading textures ***"); + Config.log("Resource packs: " + Config.getResourcePackNames()); + Iterator it = this.mapTextureObjects.keySet().iterator(); + + while (it.hasNext()) { + ResourceLocation var2 = (ResourceLocation)it.next(); + String var3 = var2.getResourcePath(); + + if (var3.startsWith("mcpatcher/") || var3.startsWith("optifine/")) { + ITextureObject tex = (ITextureObject)this.mapTextureObjects.get(var2); + int glTexId = tex.getGlTextureId(); + + if (glTexId > 0) { + GL11.glDeleteTextures(glTexId); + } + + it.remove(); + } + } + + Iterator var21 = this.mapTextureObjects.entrySet().iterator(); + + while (var21.hasNext()) { + Entry var31 = (Entry)var21.next(); + this.loadTexture((ResourceLocation)var31.getKey(), (ITextureObject)var31.getValue()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManage~ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManage~ new file mode 100644 index 0000000..8d0e7b5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureManage~ @@ -0,0 +1,184 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.ITickable; +import net.minecraft.client.renderer.texture.ITickableTextureObject; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.src.Config; +import net.minecraft.src.RandomMobs; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +public class TextureManager implements ITickable, IResourceManagerReloadListener { + + private static final Logger field_147646_a = LogManager.getLogger(); + private final Map field_110585_a = Maps.newHashMap(); + private final Map field_130089_b = Maps.newHashMap(); + private final List field_110583_b = Lists.newArrayList(); + private final Map field_110584_c = Maps.newHashMap(); + private IResourceManager field_110582_d; + private static final String __OBFID = "CL_00001064"; + private static final String __OBFID = "CL_00001064"; + + public TextureManager(IResourceManager par1ResourceManager) { + this.field_110582_d = par1ResourceManager; + } + + public void func_110577_a(ResourceLocation par1ResourceLocation) { + if(Config.isRandomMobs()) { + par1ResourceLocation = RandomMobs.getTextureLocation(par1ResourceLocation); + } + + Object var2 = (ITextureObject)this.field_110585_a.get(par1ResourceLocation); + if(var2 == null) { + var2 = new SimpleTexture(par1ResourceLocation); + this.func_110579_a(par1ResourceLocation, (ITextureObject)var2); + } + + TextureUtil.func_94277_a(((ITextureObject)var2).func_110552_b()); + } + + public ResourceLocation func_130087_a(int par1) { + return (ResourceLocation)this.field_130089_b.get(Integer.valueOf(par1)); + } + + public boolean func_130088_a(ResourceLocation par1ResourceLocation, TextureMap par2TextureMap) { + if(this.func_110580_a(par1ResourceLocation, par2TextureMap)) { + this.field_130089_b.put(Integer.valueOf(par2TextureMap.func_130086_a()), par1ResourceLocation); + return true; + } else { + return false; + } + } + + public boolean func_110580_a(ResourceLocation par1ResourceLocation, ITickableTextureObject par2TickableTextureObject) { + if(this.func_110579_a(par1ResourceLocation, par2TickableTextureObject)) { + this.field_110583_b.add(par2TickableTextureObject); + return true; + } else { + return false; + } + } + + public boolean func_110579_a(ResourceLocation par1ResourceLocation, final ITextureObject par2TextureObject) { + boolean var3 = true; + Object par2TextureObject2 = par2TextureObject; + + try { + par2TextureObject.func_110551_a(this.field_110582_d); + } catch (IOException var8) { + field_147646_a.warn("Failed to load texture: " + par1ResourceLocation, var8); + par2TextureObject2 = TextureUtil.field_111001_a; + this.field_110585_a.put(par1ResourceLocation, par2TextureObject2); + var3 = false; + } catch (Throwable var9) { + CrashReport var5 = CrashReport.func_85055_a(var9, "Registering texture"); + CrashReportCategory var6 = var5.func_85058_a("Resource location being registered"); + var6.func_71507_a("Resource location", par1ResourceLocation); + var6.func_71500_a("Texture object class", new Callable() { + + private static final String __OBFID = "CL_00001065"; + private static final String __OBFID = "CL_00001065"; + + public String call() { + return par2TextureObject.getClass().getName(); + } + // $FF: synthetic method + // $FF: bridge method + public Object call() throws Exception { + return this.call(); + } + }); + throw new ReportedException(var5); + } + + this.field_110585_a.put(par1ResourceLocation, par2TextureObject2); + return var3; + } + + public ITextureObject func_110581_b(ResourceLocation par1ResourceLocation) { + return (ITextureObject)this.field_110585_a.get(par1ResourceLocation); + } + + public ResourceLocation func_110578_a(String par1Str, DynamicTexture par2DynamicTexture) { + if(par1Str.equals("logo")) { + par2DynamicTexture = Config.getMojangLogoTexture(par2DynamicTexture); + } + + Integer var3 = (Integer)this.field_110584_c.get(par1Str); + if(var3 == null) { + var3 = Integer.valueOf(1); + } else { + var3 = Integer.valueOf(var3.intValue() + 1); + } + + this.field_110584_c.put(par1Str, var3); + ResourceLocation var4 = new ResourceLocation(String.format("dynamic/%s_%d", new Object[]{par1Str, var3})); + this.func_110579_a(var4, par2DynamicTexture); + return var4; + } + + public void func_110550_d() { + Iterator var1 = this.field_110583_b.iterator(); + + while(var1.hasNext()) { + ITickable var2 = (ITickable)var1.next(); + var2.func_110550_d(); + } + + } + + public void func_147645_c(ResourceLocation p_147645_1_) { + ITextureObject var2 = this.func_110581_b(p_147645_1_); + if(var2 != null) { + TextureUtil.func_147942_a(var2.func_110552_b()); + } + + } + + public void func_110549_a(IResourceManager par1ResourceManager) { + Config.dbg("*** Reloading textures ***"); + Config.log("Resource packs: " + Config.getResourcePackNames()); + Iterator it = this.field_110585_a.keySet().iterator(); + + while(it.hasNext()) { + ResourceLocation var2 = (ResourceLocation)it.next(); + if(var2.func_110623_a().startsWith("mcpatcher/")) { + ITextureObject var3 = (ITextureObject)this.field_110585_a.get(var2); + int glTexId = var3.func_110552_b(); + if(glTexId > 0) { + GL11.glDeleteTextures(glTexId); + } + + it.remove(); + } + } + + Iterator var21 = this.field_110585_a.entrySet().iterator(); + + while(var21.hasNext()) { + Entry var31 = (Entry)var21.next(); + this.func_110579_a((ResourceLocation)var31.getKey(), (ITextureObject)var31.getValue()); + } + + } + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java new file mode 100644 index 0000000..5998577 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureMap.java @@ -0,0 +1,711 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.StitcherException; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.item.Item; +import net.minecraft.src.Config; +import net.minecraft.src.ConnectedTextures; +import net.minecraft.src.CustomItems; +import net.minecraft.src.Reflector; +import net.minecraft.src.ReflectorForge; +import net.minecraft.src.TextureUtils; +import net.minecraft.src.WrUpdates; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import shadersmod.client.ShadersTex; + +public class TextureMap extends AbstractTexture implements ITickableTextureObject, IIconRegister { + private static final boolean ENABLE_SKIP = Boolean.parseBoolean(System.getProperty("fml.skipFirstTextureLoad", "true")); + private static final Logger logger = LogManager.getLogger(); + public static final ResourceLocation locationBlocksTexture = new ResourceLocation("textures/atlas/blocks.png"); + public static final ResourceLocation locationItemsTexture = new ResourceLocation("textures/atlas/items.png"); + private final List listAnimatedSprites; + private final Map mapRegisteredSprites; + private final Map mapUploadedSprites; + + /** 0 = terrain.png, 1 = items.png */ + public final int textureType; + public final String basePath; + private int field_147636_j; + private int field_147637_k; + private final TextureAtlasSprite missingImage; + private boolean skipFirst; + public static TextureMap textureMapBlocks = null; + public static TextureMap textureMapItems = null; + private TextureAtlasSprite[] iconGrid; + private int iconGridSize; + private int iconGridCountX; + private int iconGridCountY; + private double iconGridSizeU; + private double iconGridSizeV; + private int counterIndexInMap; + public int atlasWidth; + public int atlasHeight; + + public TextureMap(int par1, String par2Str) { + this(par1, par2Str, false); + } + + public TextureMap(int par1, String par2Str, boolean skipFirst) { + this.listAnimatedSprites = Lists.newArrayList(); + this.mapRegisteredSprites = Maps.newHashMap(); + this.mapUploadedSprites = Maps.newHashMap(); + this.field_147637_k = 1; + this.missingImage = new TextureAtlasSprite("missingno"); + this.skipFirst = false; + this.iconGrid = null; + this.iconGridSize = -1; + this.iconGridCountX = -1; + this.iconGridCountY = -1; + this.iconGridSizeU = -1.0D; + this.iconGridSizeV = -1.0D; + this.counterIndexInMap = 0; + this.atlasWidth = 0; + this.atlasHeight = 0; + this.textureType = par1; + this.basePath = par2Str; + + if (this.textureType == 0) { + textureMapBlocks = this; + } + + if (this.textureType == 1) { + textureMapItems = this; + } + + this.registerIcons(); + this.skipFirst = skipFirst && ENABLE_SKIP; + } + + private void initMissingImage() { + int[] var1; + + if ((float)this.field_147637_k > 1.0F) { + boolean var5 = true; + boolean var3 = true; + boolean var4 = true; + this.missingImage.setIconWidth(32); + this.missingImage.setIconHeight(32); + var1 = new int[1024]; + System.arraycopy(TextureUtil.missingTextureData, 0, var1, 0, TextureUtil.missingTextureData.length); + TextureUtil.func_147948_a(var1, 16, 16, 8); + } else { + var1 = TextureUtil.missingTextureData; + this.missingImage.setIconWidth(16); + this.missingImage.setIconHeight(16); + } + + int[][] var51 = new int[this.field_147636_j + 1][]; + var51[0] = var1; + this.missingImage.setFramesTextureData(Lists.newArrayList(new int[][][] {var51})); + this.missingImage.setIndexInMap(this.counterIndexInMap++); + } + + public void loadTexture(IResourceManager par1ResourceManager) throws IOException { + ShadersTex.resManager = par1ResourceManager; + this.counterIndexInMap = 0; + this.initMissingImage(); + this.func_147631_c(); + this.loadTextureAtlas(par1ResourceManager); + } + + public void loadTextureAtlas(IResourceManager par1ResourceManager) { + ShadersTex.resManager = par1ResourceManager; + Config.dbg("Loading texture map: " + this.basePath); + WrUpdates.finishCurrentUpdate(); + this.registerIcons(); + int var2 = TextureUtils.getGLMaximumTextureSize(); + Stitcher var3 = new Stitcher(var2, var2, true, 0, this.field_147636_j); + this.mapUploadedSprites.clear(); + this.listAnimatedSprites.clear(); + int var4 = Integer.MAX_VALUE; + Reflector.callVoid(Reflector.ForgeHooksClient_onTextureStitchedPre, new Object[] {this}); + Iterator var5 = this.mapRegisteredSprites.entrySet().iterator(); + TextureAtlasSprite var8; + + while (var5.hasNext() && !this.skipFirst) { + Entry var24 = (Entry)var5.next(); + ResourceLocation var25 = new ResourceLocation((String)var24.getKey()); + var8 = (TextureAtlasSprite)var24.getValue(); + ResourceLocation sheetWidth = this.func_147634_a(var25, 0); + + if (var8.getIndexInMap() < 0) { + var8.setIndexInMap(this.counterIndexInMap++); + } + + if (var8.hasCustomLoader(par1ResourceManager, var25)) { + if (!var8.load(par1ResourceManager, var25)) { + var4 = Math.min(var4, Math.min(var8.getIconWidth(), var8.getIconHeight())); + var3.addSprite(var8); + } + + Config.dbg("Custom loader: " + var8); + } else { + try { + IResource sheetHeight = ShadersTex.loadResource(par1ResourceManager, sheetWidth); + BufferedImage[] debugImage = new BufferedImage[1 + this.field_147636_j]; + debugImage[0] = ImageIO.read(sheetHeight.getInputStream()); + TextureMetadataSection var26 = (TextureMetadataSection)sheetHeight.getMetadata("texture"); + + if (var26 != null) { + List var28 = var26.func_148535_c(); + int var30; + + if (!var28.isEmpty()) { + int var18 = debugImage[0].getWidth(); + var30 = debugImage[0].getHeight(); + + if (MathHelper.roundUpToPowerOfTwo(var18) != var18 || MathHelper.roundUpToPowerOfTwo(var30) != var30) { + throw new RuntimeException("Unable to load extra miplevels, source-texture is not power of two"); + } + } + + Iterator var182 = var28.iterator(); + + while (var182.hasNext()) { + var30 = ((Integer)var182.next()).intValue(); + + if (var30 > 0 && var30 < debugImage.length - 1 && debugImage[var30] == null) { + ResourceLocation var32 = this.func_147634_a(var25, var30); + + try { + debugImage[var30] = ImageIO.read(ShadersTex.loadResource(par1ResourceManager, var32).getInputStream()); + } catch (IOException var20) { + logger.error("Unable to load miplevel {} from: {}", new Object[] {Integer.valueOf(var30), var32, var20}); + } + } + } + } + + AnimationMetadataSection var281 = (AnimationMetadataSection)sheetHeight.getMetadata("animation"); + var8.func_147964_a(debugImage, var281, (float)this.field_147637_k > 1.0F); + } catch (RuntimeException var22) { + logger.error("Unable to parse metadata from " + sheetWidth, var22); + ReflectorForge.FMLClientHandler_trackBrokenTexture(sheetWidth, var22.getMessage()); + continue; + } catch (IOException var23) { + logger.error("Using missing texture, unable to load " + sheetWidth + ", " + var23.getClass().getName()); + ReflectorForge.FMLClientHandler_trackMissingTexture(sheetWidth); + continue; + } + + var4 = Math.min(var4, Math.min(var8.getIconWidth(), var8.getIconHeight())); + var3.addSprite(var8); + } + } + + int var241 = MathHelper.calculateLogBaseTwo(var4); + + if (var241 < 0) { + var241 = 0; + } + + if (var241 < this.field_147636_j) { + logger.info("{}: dropping miplevel from {} to {}, because of minTexel: {}", new Object[] {this.basePath, Integer.valueOf(this.field_147636_j), Integer.valueOf(var241), Integer.valueOf(var4)}); + this.field_147636_j = var241; + } + + Iterator var251 = this.mapRegisteredSprites.values().iterator(); + + while (var251.hasNext() && !this.skipFirst) { + final TextureAtlasSprite sheetWidth1 = (TextureAtlasSprite)var251.next(); + + try { + sheetWidth1.func_147963_d(this.field_147636_j); + } catch (Throwable var19) { + CrashReport debugImage1 = CrashReport.makeCrashReport(var19, "Applying mipmap"); + CrashReportCategory var261 = debugImage1.makeCategory("Sprite being mipmapped"); + var261.addCrashSectionCallable("Sprite name", () -> sheetWidth1.getIconName()); + var261.addCrashSectionCallable("Sprite size", () -> sheetWidth1.getIconWidth() + " x " + sheetWidth1.getIconHeight()); + var261.addCrashSectionCallable("Sprite frames", () -> sheetWidth1.getFrameCount() + " frames"); + var261.addCrashSection("Mipmap levels", Integer.valueOf(this.field_147636_j)); + throw new ReportedException(debugImage1); + } + } + + this.missingImage.func_147963_d(this.field_147636_j); + var3.addSprite(this.missingImage); + this.skipFirst = false; + + try { + var3.doStitch(); + } catch (StitcherException var181) { + throw var181; + } + + Config.dbg("Texture size: " + this.basePath + ", " + var3.getCurrentWidth() + "x" + var3.getCurrentHeight()); + int sheetWidth2 = var3.getCurrentWidth(); + int sheetHeight1 = var3.getCurrentHeight(); + BufferedImage debugImage2 = null; + + if (System.getProperty("saveTextureMap", "false").equalsIgnoreCase("true")) { + debugImage2 = this.makeDebugImage(sheetWidth2, sheetHeight1); + } + + logger.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(var3.getCurrentWidth()), Integer.valueOf(var3.getCurrentHeight()), this.basePath}); + + if (Config.isShaders()) { + ShadersTex.allocateTextureMap(this.getGlTextureId(), this.field_147636_j, var3.getCurrentWidth(), var3.getCurrentHeight(), var3, this); + } else { + TextureUtil.func_147946_a(this.getGlTextureId(), this.field_147636_j, var3.getCurrentWidth(), var3.getCurrentHeight(), (float)this.field_147637_k); + } + + HashMap var262 = Maps.newHashMap(this.mapRegisteredSprites); + Iterator var282 = var3.getStichSlots().iterator(); + + while (var282.hasNext()) { + var8 = (TextureAtlasSprite)var282.next(); + + if (Config.isShaders()) { + ShadersTex.setIconName(ShadersTex.setSprite(var8).getIconName()); + } + + String var301 = var8.getIconName(); + var262.remove(var301); + this.mapUploadedSprites.put(var301, var8); + + try { + if (Config.isShaders()) { + ShadersTex.uploadTexSubForLoadAtlas(var8.func_147965_a(0), var8.getIconWidth(), var8.getIconHeight(), var8.getOriginX(), var8.getOriginY(), false, false); + } else { + TextureUtil.func_147955_a(var8.func_147965_a(0), var8.getIconWidth(), var8.getIconHeight(), var8.getOriginX(), var8.getOriginY(), false, false); + } + + if (debugImage2 != null) { + this.addDebugSprite(var8, debugImage2); + } + } catch (Throwable var21) { + CrashReport var321 = CrashReport.makeCrashReport(var21, "Stitching texture atlas"); + CrashReportCategory var33 = var321.makeCategory("Texture being stitched together"); + var33.addCrashSection("Atlas path", this.basePath); + var33.addCrashSection("Sprite", var8); + throw new ReportedException(var321); + } + + if (var8.hasAnimationMetadata()) { + this.listAnimatedSprites.add(var8); + } else { + var8.clearFramesTextureData(); + } + } + + var282 = var262.values().iterator(); + + while (var282.hasNext()) { + var8 = (TextureAtlasSprite)var282.next(); + var8.copyFrom(this.missingImage); + } + + if (debugImage2 != null) { + this.writeDebugImage(debugImage2, "debug_" + this.basePath.replace('/', '_') + ".png"); + } + + Reflector.callVoid(Reflector.ForgeHooksClient_onTextureStitchedPost, new Object[] {this}); + } + + public ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_) { + return this.isAbsoluteLocation(p_147634_1_) ? (p_147634_2_ == 0 ? new ResourceLocation(p_147634_1_.getResourceDomain(), p_147634_1_.getResourcePath() + ".png") : new ResourceLocation(p_147634_1_.getResourceDomain(), p_147634_1_.getResourcePath() + "mipmap" + p_147634_2_ + ".png")) : (p_147634_2_ == 0 ? new ResourceLocation(p_147634_1_.getResourceDomain(), String.format("%s/%s%s", new Object[] {this.basePath, p_147634_1_.getResourcePath(), ".png"})): new ResourceLocation(p_147634_1_.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", new Object[] {this.basePath, p_147634_1_.getResourcePath(), Integer.valueOf(p_147634_2_), ".png"}))); + } + + private void registerIcons() { + this.mapRegisteredSprites.clear(); + Iterator var1; + + if (this.textureType == 0) { + var1 = Block.blockRegistry.iterator(); + + while (var1.hasNext()) { + Block var3 = (Block)var1.next(); + + if (var3.getMaterial() != Material.air) { + var3.registerBlockIcons(this); + } + } + + Minecraft.getMinecraft().renderGlobal.registerDestroyBlockIcons(this); + RenderManager.instance.updateIcons(this); + ConnectedTextures.updateIcons(this); + } + + if (this.textureType == 1) { + CustomItems.updateIcons(this); + } + + var1 = Item.itemRegistry.iterator(); + + while (var1.hasNext()) { + Item var31 = (Item)var1.next(); + + if (var31 != null && var31.getSpriteNumber() == this.textureType) { + var31.registerIcons(this); + } + } + } + + public TextureAtlasSprite getAtlasSprite(String par1Str) { + TextureAtlasSprite var2 = (TextureAtlasSprite)this.mapUploadedSprites.get(par1Str); + + if (var2 == null) { + var2 = this.missingImage; + } + + return var2; + } + + public void updateAnimations() { + if (Config.isShaders()) { + ShadersTex.updatingTex = this.getMultiTexID(); + } + + boolean hasNormal = false; + boolean hasSpecular = false; + TextureUtil.bindTexture(this.getGlTextureId()); + Iterator var1 = this.listAnimatedSprites.iterator(); + + while (var1.hasNext()) { + TextureAtlasSprite i$ = (TextureAtlasSprite)var1.next(); + + if (this.textureType == 0) { + if (!this.isTerrainAnimationActive(i$)) { + continue; + } + } else if (this.textureType == 1 && !this.isItemAnimationActive(i$)) { + continue; + } + + i$.updateAnimation(); + + if (i$.spriteNormal != null) { + hasNormal = true; + } + + if (i$.spriteSpecular != null) { + hasSpecular = true; + } + } + + if (Config.isShaders()) { + TextureAtlasSprite textureatlassprite; + Iterator i$1; + + if (hasNormal) { + TextureUtil.bindTexture(this.getMultiTexID().norm); + i$1 = this.listAnimatedSprites.iterator(); + + while (i$1.hasNext()) { + textureatlassprite = (TextureAtlasSprite)i$1.next(); + + if (textureatlassprite.spriteNormal != null && this.isTerrainAnimationActive(textureatlassprite)) { + if (textureatlassprite == TextureUtils.iconClock || textureatlassprite == TextureUtils.iconCompass) { + textureatlassprite.spriteNormal.frameCounter = textureatlassprite.frameCounter; + } + + textureatlassprite.spriteNormal.updateAnimation(); + } + } + } + + if (hasSpecular) { + TextureUtil.bindTexture(this.getMultiTexID().spec); + i$1 = this.listAnimatedSprites.iterator(); + + while (i$1.hasNext()) { + textureatlassprite = (TextureAtlasSprite)i$1.next(); + + if (textureatlassprite.spriteSpecular != null && this.isTerrainAnimationActive(textureatlassprite)) { + if (textureatlassprite == TextureUtils.iconClock || textureatlassprite == TextureUtils.iconCompass) { + textureatlassprite.spriteNormal.frameCounter = textureatlassprite.frameCounter; + } + + textureatlassprite.spriteSpecular.updateAnimation(); + } + } + } + + if (hasNormal || hasSpecular) { + TextureUtil.bindTexture(this.getGlTextureId()); + } + } + + if (Config.isShaders()) { + ShadersTex.updatingTex = null; + } + } + + private boolean isItemAnimationActive(TextureAtlasSprite ts) { + return ts != TextureUtils.iconClock && ts != TextureUtils.iconCompass ? Config.isAnimatedItems() : true; + } + + public IIcon registerIcon(String par1Str) { + if (par1Str == null) { + throw new IllegalArgumentException("Name cannot be null!"); + } else if (par1Str.indexOf(92) != -1 && !this.isAbsoluteLocationPath(par1Str)) { + throw new IllegalArgumentException("Name cannot contain slashes!"); + } else { + Object var2 = (TextureAtlasSprite)this.mapRegisteredSprites.get(par1Str); + + if (var2 == null && this.textureType == 1 && Reflector.ModLoader_getCustomAnimationLogic.exists()) { + var2 = Reflector.call(Reflector.ModLoader_getCustomAnimationLogic, new Object[] {par1Str}); + } + + if (var2 == null) { + if (this.textureType == 1) { + if ("clock".equals(par1Str)) { + var2 = new TextureClock(par1Str); + } else if ("compass".equals(par1Str)) { + var2 = new TextureCompass(par1Str); + } else { + var2 = new TextureAtlasSprite(par1Str); + } + } else { + var2 = new TextureAtlasSprite(par1Str); + } + + this.mapRegisteredSprites.put(par1Str, var2); + + if (var2 instanceof TextureAtlasSprite) { + TextureAtlasSprite tas = (TextureAtlasSprite)var2; + + if (tas.getIndexInMap() < 0) { + tas.setIndexInMap(this.counterIndexInMap++); + } + } + } + + return (IIcon)var2; + } + } + + public int getTextureType() { + return this.textureType; + } + + public void tick() { + this.updateAnimations(); + } + + public void func_147633_a(int p_147633_1_) { + this.field_147636_j = p_147633_1_; + } + + public void func_147632_b(int p_147632_1_) { + this.field_147637_k = p_147632_1_; + } + + public TextureAtlasSprite getTextureExtry(String name) { + return (TextureAtlasSprite)this.mapRegisteredSprites.get(name); + } + + public boolean setTextureEntry(String name, TextureAtlasSprite entry) { + if (!this.mapRegisteredSprites.containsKey(name)) { + this.mapRegisteredSprites.put(name, entry); + + if (entry.getIndexInMap() < 0) { + entry.setIndexInMap(this.counterIndexInMap++); + } + + return true; + } else { + return false; + } + } + + public boolean setTextureEntry(TextureAtlasSprite entry) { + return this.setTextureEntry(entry.getIconName(), entry); + } + + public String getBasePath() { + return this.basePath; + } + + public int getMipmapLevels() { + return this.field_147636_j; + } + + private boolean isAbsoluteLocation(ResourceLocation loc) { + String path = loc.getResourcePath(); + return this.isAbsoluteLocationPath(path); + } + + private boolean isAbsoluteLocationPath(String resPath) { + String path = resPath.toLowerCase(); + return path.startsWith("mcpatcher/") || path.startsWith("optifine/"); + } + + public TextureAtlasSprite getIconSafe(String name) { + return (TextureAtlasSprite)this.mapRegisteredSprites.get(name); + } + + private int getStandardTileSize(Collection icons) { + int[] sizeCounts = new int[16]; + Iterator mostUsedPo2 = icons.iterator(); + int value; + int count; + + while (mostUsedPo2.hasNext()) { + TextureAtlasSprite mostUsedCount = (TextureAtlasSprite)mostUsedPo2.next(); + + if (mostUsedCount != null) { + value = TextureUtils.getPowerOfTwo(mostUsedCount.getWidth()); + count = TextureUtils.getPowerOfTwo(mostUsedCount.getHeight()); + int po2 = Math.max(value, count); + + if (po2 < sizeCounts.length) { + ++sizeCounts[po2]; + } + } + } + + int var8 = 4; + int var9 = 0; + + for (value = 0; value < sizeCounts.length; ++value) { + count = sizeCounts[value]; + + if (count > var9) { + var8 = value; + var9 = count; + } + } + + if (var8 < 4) { + var8 = 4; + } + + value = TextureUtils.twoToPower(var8); + return value; + } + + private void updateIconGrid(int sheetWidth, int sheetHeight) { + this.iconGridCountX = -1; + this.iconGridCountY = -1; + this.iconGrid = null; + + if (this.iconGridSize > 0) { + this.iconGridCountX = sheetWidth / this.iconGridSize; + this.iconGridCountY = sheetHeight / this.iconGridSize; + this.iconGrid = new TextureAtlasSprite[this.iconGridCountX * this.iconGridCountY]; + this.iconGridSizeU = 1.0D / (double)this.iconGridCountX; + this.iconGridSizeV = 1.0D / (double)this.iconGridCountY; + Iterator it = this.mapUploadedSprites.values().iterator(); + + while (it.hasNext()) { + TextureAtlasSprite ts = (TextureAtlasSprite)it.next(); + double deltaU = 0.5D / (double)sheetWidth; + double deltaV = 0.5D / (double)sheetHeight; + double uMin = (double)Math.min(ts.getMinU(), ts.getMaxU()) + deltaU; + double vMin = (double)Math.min(ts.getMinV(), ts.getMaxV()) + deltaV; + double uMax = (double)Math.max(ts.getMinU(), ts.getMaxU()) - deltaU; + double vMax = (double)Math.max(ts.getMinV(), ts.getMaxV()) - deltaV; + int iuMin = (int)(uMin / this.iconGridSizeU); + int ivMin = (int)(vMin / this.iconGridSizeV); + int iuMax = (int)(uMax / this.iconGridSizeU); + int ivMax = (int)(vMax / this.iconGridSizeV); + + for (int iu = iuMin; iu <= iuMax; ++iu) { + if (iu >= 0 && iu < this.iconGridCountX) { + for (int iv = ivMin; iv <= ivMax; ++iv) { + if (iv >= 0 && iv < this.iconGridCountX) { + int index = iv * this.iconGridCountX + iu; + this.iconGrid[index] = ts; + } else { + Config.warn("Invalid grid V: " + iv + ", icon: " + ts.getIconName()); + } + } + } else { + Config.warn("Invalid grid U: " + iu + ", icon: " + ts.getIconName()); + } + } + } + } + } + + public TextureAtlasSprite getIconByUV(double u, double v) { + if (this.iconGrid == null) { + return null; + } else { + int iu = (int)(u / this.iconGridSizeU); + int iv = (int)(v / this.iconGridSizeV); + int index = iv * this.iconGridCountX + iu; + return index >= 0 && index <= this.iconGrid.length ? this.iconGrid[index] : null; + } + } + + public TextureAtlasSprite getMissingSprite() { + return this.missingImage; + } + + public int getMaxTextureIndex() { + return this.mapRegisteredSprites.size(); + } + + private boolean isTerrainAnimationActive(TextureAtlasSprite ts) { + return ts != TextureUtils.iconWaterStill && ts != TextureUtils.iconWaterFlow ? (ts != TextureUtils.iconLavaStill && ts != TextureUtils.iconLavaFlow ? (ts != TextureUtils.iconFireLayer0 && ts != TextureUtils.iconFireLayer1 ? (ts == TextureUtils.iconPortal ? Config.isAnimatedPortal() : (ts != TextureUtils.iconClock && ts != TextureUtils.iconCompass ? Config.isAnimatedTerrain() : true)) : Config.isAnimatedFire()) : Config.isAnimatedLava()) : Config.isAnimatedWater(); + } + + public int getCountRegisteredSprites() { + return this.counterIndexInMap; + } + + public void loadTextureSafe(IResourceManager rm) { + try { + this.loadTexture(rm); + } catch (IOException var3) { + Config.warn("Error loading texture map: " + this.basePath); + var3.printStackTrace(); + } + } + + private BufferedImage makeDebugImage(int sheetWidth, int sheetHeight) { + BufferedImage image = new BufferedImage(sheetWidth, sheetHeight, 2); + Graphics2D g = image.createGraphics(); + g.setPaint(new Color(255, 255, 0)); + g.fillRect(0, 0, image.getWidth(), image.getHeight()); + return image; + } + + private void addDebugSprite(TextureAtlasSprite ts, BufferedImage image) { + if (ts.getFrameCount() < 1) { + Config.warn("Debug sprite has no data: " + ts.getIconName()); + } else { + int[] data = ts.func_147965_a(0)[0]; + image.setRGB(ts.getOriginX(), ts.getOriginY(), ts.getIconWidth(), ts.getIconHeight(), data, 0, ts.getIconWidth()); + } + } + + private void writeDebugImage(BufferedImage image, String pngPath) { + try { + ImageIO.write(image, "png", new File(Config.getMinecraft().mcDataDir, pngPath)); + } catch (Exception var4) { + var4.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java new file mode 100644 index 0000000..a5ad92a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/texture/TextureUtil.java @@ -0,0 +1,350 @@ +package net.minecraft.client.renderer.texture; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.nio.IntBuffer; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.src.Mipmaps; +import net.minecraft.src.Reflector; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; +import org.lwjgl.opengl.GL12; + +public class TextureUtil { + private static final Logger logger = LogManager.getLogger(); + private static final IntBuffer dataBuffer = GLAllocation.createDirectIntBuffer(4194304); + public static final DynamicTexture missingTexture = new DynamicTexture(16, 16); + public static final int[] missingTextureData = missingTexture.getTextureData(); + private static int field_147958_e = -1; + private static int field_147956_f = -1; + private static float field_152779_g = -1.0F; + private static final int[] field_147957_g; + + public static int glGenTextures() { + return GL11.glGenTextures(); + } + + public static void deleteTexture(int p_147942_0_) { + GL11.glDeleteTextures(p_147942_0_); + } + + public static int uploadTextureImage(int par0, BufferedImage par1BufferedImage) { + return uploadTextureImageAllocate(par0, par1BufferedImage, false, false); + } + + public static void uploadTexture(int par0, int[] par1ArrayOfInteger, int par2, int par3) { + bindTexture(par0); + func_147947_a(0, par1ArrayOfInteger, par2, par3, 0, 0, false, false, false); + } + + public static int[][] func_147949_a(int p_147949_0_, int p_147949_1_, int[][] p_147949_2_) { + int[][] var3 = new int[p_147949_0_ + 1][]; + var3[0] = p_147949_2_[0]; + + if (p_147949_0_ > 0) { + boolean var4 = false; + int var5; + + for (var5 = 0; var5 < p_147949_2_.length; ++var5) { + if (p_147949_2_[0][var5] >> 24 == 0) { + var4 = true; + break; + } + } + + for (var5 = 1; var5 <= p_147949_0_; ++var5) { + if (p_147949_2_[var5] != null) { + var3[var5] = p_147949_2_[var5]; + } else { + int[] var6 = var3[var5 - 1]; + int[] var7 = new int[var6.length >> 2]; + int var8 = p_147949_1_ >> var5; + int var9 = var7.length / var8; + int var10 = var8 << 1; + + for (int var11 = 0; var11 < var8; ++var11) { + for (int var12 = 0; var12 < var9; ++var12) { + int var13 = 2 * (var11 + var12 * var10); + var7[var11 + var12 * var8] = func_147943_a(var6[var13 + 0], var6[var13 + 1], var6[var13 + 0 + var10], var6[var13 + 1 + var10], var4); + } + } + + var3[var5] = var7; + } + } + } + + return var3; + } + + private static int func_147943_a(int p_147943_0_, int p_147943_1_, int p_147943_2_, int p_147943_3_, boolean p_147943_4_) { + return Mipmaps.alphaBlend(p_147943_0_, p_147943_1_, p_147943_2_, p_147943_3_); + } + + private static int func_147944_a(int p_147944_0_, int p_147944_1_, int p_147944_2_, int p_147944_3_, int p_147944_4_) { + float var5 = (float)Math.pow((double)((float)(p_147944_0_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float var6 = (float)Math.pow((double)((float)(p_147944_1_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float var7 = (float)Math.pow((double)((float)(p_147944_2_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float var8 = (float)Math.pow((double)((float)(p_147944_3_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float var9 = (float)Math.pow((double)(var5 + var6 + var7 + var8) * 0.25D, 0.45454545454545453D); + return (int)((double)var9 * 255.0D); + } + + public static void func_147955_a(int[][] p_147955_0_, int p_147955_1_, int p_147955_2_, int p_147955_3_, int p_147955_4_, boolean p_147955_5_, boolean p_147955_6_) { + for (int var7 = 0; var7 < p_147955_0_.length; ++var7) { + int[] var8 = p_147955_0_[var7]; + func_147947_a(var7, var8, p_147955_1_ >> var7, p_147955_2_ >> var7, p_147955_3_ >> var7, p_147955_4_ >> var7, p_147955_5_, p_147955_6_, p_147955_0_.length > 1); + } + } + + private static void func_147947_a(int p_147947_0_, int[] p_147947_1_, int p_147947_2_, int p_147947_3_, int p_147947_4_, int p_147947_5_, boolean p_147947_6_, boolean p_147947_7_, boolean p_147947_8_) { + int var9 = 4194304 / p_147947_2_; + func_147954_b(p_147947_6_, p_147947_8_); + setTextureClamped(p_147947_7_); + int var12; + + for (int var10 = 0; var10 < p_147947_2_ * p_147947_3_; var10 += p_147947_2_ * var12) { + int var11 = var10 / p_147947_2_; + var12 = Math.min(var9, p_147947_3_ - var11); + int var13 = p_147947_2_ * var12; + copyToBufferPos(p_147947_1_, var10, var13); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, p_147947_0_, p_147947_4_, p_147947_5_ + var11, p_147947_2_, var12, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer); + } + } + + public static int uploadTextureImageAllocate(int par0, BufferedImage par1BufferedImage, boolean par2, boolean par3) { + allocateTexture(par0, par1BufferedImage.getWidth(), par1BufferedImage.getHeight()); + return uploadTextureImageSub(par0, par1BufferedImage, 0, 0, par2, par3); + } + + public static void allocateTexture(int par0, int par1, int par2) { + func_147946_a(par0, 0, par1, par2, 1.0F); + } + + public static void func_147946_a(int p_147946_0_, int p_147946_1_, int p_147946_2_, int p_147946_3_, float p_147946_4_) { + Class monitor = TextureUtil.class; + + if (Reflector.SplashScreen.exists()) { + monitor = Reflector.SplashScreen.getTargetClass(); + } + + synchronized (monitor) { + deleteTexture(p_147946_0_); + bindTexture(p_147946_0_); + } + + if (OpenGlHelper.anisotropicFilteringSupported) { + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, p_147946_4_); + } + + if (p_147946_1_ > 0) { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_147946_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, (float)p_147946_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0F); + } + + for (int var5 = 0; var5 <= p_147946_1_; ++var5) { + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, var5, GL11.GL_RGBA, p_147946_2_ >> var5, p_147946_3_ >> var5, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null); + } + } + + public static int uploadTextureImageSub(int par0, BufferedImage par1BufferedImage, int par2, int par3, boolean par4, boolean par5) { + bindTexture(par0); + uploadTextureImageSubImpl(par1BufferedImage, par2, par3, par4, par5); + return par0; + } + + private static void uploadTextureImageSubImpl(BufferedImage par0BufferedImage, int par1, int par2, boolean par3, boolean par4) { + int var5 = par0BufferedImage.getWidth(); + int var6 = par0BufferedImage.getHeight(); + int var7 = 4194304 / var5; + int[] var8 = new int[var7 * var5]; + func_147951_b(par3); + setTextureClamped(par4); + + for (int var9 = 0; var9 < var5 * var6; var9 += var5 * var7) { + int var10 = var9 / var5; + int var11 = Math.min(var7, var6 - var10); + int var12 = var5 * var11; + par0BufferedImage.getRGB(0, var10, var5, var11, var8, 0, var5); + copyToBuffer(var8, var12); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, par1, par2 + var10, var5, var11, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer); + } + } + + public static void setTextureClamped(boolean par0) { + if (par0) { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + } else { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + } + } + + private static void func_147951_b(boolean p_147951_0_) { + func_147954_b(p_147951_0_, false); + } + + public static void func_152777_a(boolean p_152777_0_, boolean p_152777_1_, float p_152777_2_) { + field_147958_e = GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER); + field_147956_f = GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER); + field_152779_g = GL11.glGetTexParameterf(GL11.GL_TEXTURE_2D, 34046); + func_147954_b(p_152777_0_, p_152777_1_); + func_152778_a(p_152777_2_); + } + + public static void func_147945_b() { + if (field_147958_e >= 0 && field_147956_f >= 0 && field_152779_g >= 0.0F) { + func_147952_b(field_147958_e, field_147956_f); + func_152778_a(field_152779_g); + field_152779_g = -1.0F; + field_147958_e = -1; + field_147956_f = -1; + } + } + + private static void func_147952_b(int p_147952_0_, int p_147952_1_) { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147952_0_); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, p_147952_1_); + } + + private static void func_152778_a(float p_152778_0_) { + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, p_152778_0_); + } + + public static void func_147954_b(boolean p_147954_0_, boolean p_147954_1_) { + if (p_147954_0_) { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147954_1_ ? GL11.GL_LINEAR_MIPMAP_LINEAR : GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + } else { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147954_1_ ? GL11.GL_NEAREST_MIPMAP_LINEAR : GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + } + } + + private static void copyToBuffer(int[] par0ArrayOfInteger, int par1) { + copyToBufferPos(par0ArrayOfInteger, 0, par1); + } + + private static void copyToBufferPos(int[] par0ArrayOfInteger, int par1, int par2) { + int[] var3 = par0ArrayOfInteger; + + if (Minecraft.getMinecraft().gameSettings.anaglyph) { + var3 = updateAnaglyph(par0ArrayOfInteger); + } + + dataBuffer.clear(); + dataBuffer.put(var3, par1, par2); + dataBuffer.position(0).limit(par2); + } + + static void bindTexture(int par0) { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, par0); + } + + public static int[] readImageData(IResourceManager par0ResourceManager, ResourceLocation par1ResourceLocation) throws IOException { + BufferedImage var2 = ImageIO.read(par0ResourceManager.getResource(par1ResourceLocation).getInputStream()); + + if (var2 == null) { + return null; + } else { + int var3 = var2.getWidth(); + int var4 = var2.getHeight(); + int[] var5 = new int[var3 * var4]; + var2.getRGB(0, 0, var3, var4, var5, 0, var3); + return var5; + } + } + + public static int[] updateAnaglyph(int[] par0ArrayOfInteger) { + int[] var1 = new int[par0ArrayOfInteger.length]; + + for (int var2 = 0; var2 < par0ArrayOfInteger.length; ++var2) { + int var3 = par0ArrayOfInteger[var2] >> 24 & 255; + int var4 = par0ArrayOfInteger[var2] >> 16 & 255; + int var5 = par0ArrayOfInteger[var2] >> 8 & 255; + int var6 = par0ArrayOfInteger[var2] & 255; + int var7 = (var4 * 30 + var5 * 59 + var6 * 11) / 100; + int var8 = (var4 * 30 + var5 * 70) / 100; + int var9 = (var4 * 30 + var6 * 70) / 100; + var1[var2] = var3 << 24 | var7 << 16 | var8 << 8 | var9; + } + + return var1; + } + + public static int[] func_147948_a(int[] p_147948_0_, int p_147948_1_, int p_147948_2_, int p_147948_3_) { + int var4 = p_147948_1_ + 2 * p_147948_3_; + int var5; + int var6; + + for (var5 = p_147948_2_ - 1; var5 >= 0; --var5) { + var6 = var5 * p_147948_1_; + int var7 = p_147948_3_ + (var5 + p_147948_3_) * var4; + int var8; + + for (var8 = 0; var8 < p_147948_3_; var8 += p_147948_1_) { + int var9 = Math.min(p_147948_1_, p_147948_3_ - var8); + System.arraycopy(p_147948_0_, var6 + p_147948_1_ - var9, p_147948_0_, var7 - var8 - var9, var9); + } + + System.arraycopy(p_147948_0_, var6, p_147948_0_, var7, p_147948_1_); + + for (var8 = 0; var8 < p_147948_3_; var8 += p_147948_1_) { + System.arraycopy(p_147948_0_, var6, p_147948_0_, var7 + p_147948_1_ + var8, Math.min(p_147948_1_, p_147948_3_ - var8)); + } + } + + for (var5 = 0; var5 < p_147948_3_; var5 += p_147948_2_) { + var6 = Math.min(p_147948_2_, p_147948_3_ - var5); + System.arraycopy(p_147948_0_, (p_147948_3_ + p_147948_2_ - var6) * var4, p_147948_0_, (p_147948_3_ - var5 - var6) * var4, var4 * var6); + } + + for (var5 = 0; var5 < p_147948_3_; var5 += p_147948_2_) { + var6 = Math.min(p_147948_2_, p_147948_3_ - var5); + System.arraycopy(p_147948_0_, p_147948_3_ * var4, p_147948_0_, (p_147948_2_ + p_147948_3_ + var5) * var4, var4 * var6); + } + + return p_147948_0_; + } + + public static void func_147953_a(int[] p_147953_0_, int p_147953_1_, int p_147953_2_) { + int[] var3 = new int[p_147953_1_]; + int var4 = p_147953_2_ / 2; + + for (int var5 = 0; var5 < var4; ++var5) { + System.arraycopy(p_147953_0_, var5 * p_147953_1_, var3, 0, p_147953_1_); + System.arraycopy(p_147953_0_, (p_147953_2_ - 1 - var5) * p_147953_1_, p_147953_0_, var5 * p_147953_1_, p_147953_1_); + System.arraycopy(var3, 0, p_147953_0_, (p_147953_2_ - 1 - var5) * p_147953_1_, p_147953_1_); + } + } + + public static void allocateTextureImpl(int p_147946_0_, int p_147946_1_, int p_147946_2_, int p_147946_3_) { + func_147946_a(p_147946_0_, p_147946_1_, p_147946_2_, p_147946_3_, 1.0F); + } + + static { + int var0 = -16777216; + int var1 = -524040; + int[] var2 = new int[] { -524040, -524040, -524040, -524040, -524040, -524040, -524040, -524040}; + int[] var3 = new int[] { -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216}; + int var4 = var2.length; + + for (int var5 = 0; var5 < 16; ++var5) { + System.arraycopy(var5 < var4 ? var2 : var3, 0, missingTextureData, 16 * var5, var4); + System.arraycopy(var5 < var4 ? var3 : var2, 0, missingTextureData, 16 * var5 + var4, var4); + } + + missingTexture.updateDynamicTexture(); + field_147957_g = new int[4]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/RenderEndPortal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/RenderEndPortal.java new file mode 100644 index 0000000..b5ce04b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/RenderEndPortal.java @@ -0,0 +1,124 @@ +package net.minecraft.client.renderer.tileentity; + +import java.nio.FloatBuffer; +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.src.Config; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import shadersmod.client.ShadersRender; + +public class RenderEndPortal extends TileEntitySpecialRenderer { + private static final ResourceLocation field_147529_c = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation field_147526_d = new ResourceLocation("textures/entity/end_portal.png"); + private static final Random field_147527_e = new Random(31100L); + FloatBuffer field_147528_b = GLAllocation.createDirectFloatBuffer(16); + + public void renderTileEntityAt(TileEntityEndPortal p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + if (!Config.isShaders() || !ShadersRender.renderEndPortal(p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_, 0, 0.75F)) { + float var9 = (float)this.field_147501_a.field_147560_j; + float var10 = (float)this.field_147501_a.field_147561_k; + float var11 = (float)this.field_147501_a.field_147558_l; + GL11.glDisable(GL11.GL_LIGHTING); + field_147527_e.setSeed(31100L); + float var12 = 0.75F; + + for (int var13 = 0; var13 < 16; ++var13) { + GL11.glPushMatrix(); + float var14 = (float)(16 - var13); + float var15 = 0.0625F; + float var16 = 1.0F / (var14 + 1.0F); + + if (var13 == 0) { + this.bindTexture(field_147529_c); + var16 = 0.1F; + var14 = 65.0F; + var15 = 0.125F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + } + + if (var13 == 1) { + this.bindTexture(field_147526_d); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + var15 = 0.5F; + } + + float var17 = (float)(-(p_147500_4_ + (double)var12)); + float var18 = var17 + ActiveRenderInfo.objectY; + float var19 = var17 + var14 + ActiveRenderInfo.objectY; + float var20 = var18 / var19; + var20 += (float)(p_147500_4_ + (double)var12); + GL11.glTranslatef(var9, var20, var11); + GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); + GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); + GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); + GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_EYE_LINEAR); + GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.func_147525_a(1.0F, 0.0F, 0.0F, 0.0F)); + GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.func_147525_a(0.0F, 0.0F, 1.0F, 0.0F)); + GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.func_147525_a(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glTexGen(GL11.GL_Q, GL11.GL_EYE_PLANE, this.func_147525_a(0.0F, 1.0F, 0.0F, 0.0F)); + GL11.glEnable(GL11.GL_TEXTURE_GEN_S); + GL11.glEnable(GL11.GL_TEXTURE_GEN_T); + GL11.glEnable(GL11.GL_TEXTURE_GEN_R); + GL11.glEnable(GL11.GL_TEXTURE_GEN_Q); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 700000L) / 700000.0F, 0.0F); + GL11.glScalef(var15, var15, var15); + GL11.glTranslatef(0.5F, 0.5F, 0.0F); + GL11.glRotatef((float)(var13 * var13 * 4321 + var13 * 9) * 2.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + GL11.glTranslatef(-var9, -var11, -var10); + var18 = var17 + ActiveRenderInfo.objectY; + GL11.glTranslatef(ActiveRenderInfo.objectX * var14 / var18, ActiveRenderInfo.objectZ * var14 / var18, -var10); + Tessellator var23 = Tessellator.instance; + var23.startDrawingQuads(); + var20 = field_147527_e.nextFloat() * 0.5F + 0.1F; + float var21 = field_147527_e.nextFloat() * 0.5F + 0.4F; + float var22 = field_147527_e.nextFloat() * 0.5F + 0.5F; + + if (var13 == 0) { + var22 = 1.0F; + var21 = 1.0F; + var20 = 1.0F; + } + + var23.setColorRGBA_F(var20 * var16, var21 * var16, var22 * var16, 1.0F); + var23.addVertex(p_147500_2_, p_147500_4_ + (double)var12, p_147500_6_); + var23.addVertex(p_147500_2_, p_147500_4_ + (double)var12, p_147500_6_ + 1.0D); + var23.addVertex(p_147500_2_ + 1.0D, p_147500_4_ + (double)var12, p_147500_6_ + 1.0D); + var23.addVertex(p_147500_2_ + 1.0D, p_147500_4_ + (double)var12, p_147500_6_); + var23.draw(); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_GEN_S); + GL11.glDisable(GL11.GL_TEXTURE_GEN_T); + GL11.glDisable(GL11.GL_TEXTURE_GEN_R); + GL11.glDisable(GL11.GL_TEXTURE_GEN_Q); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + + private FloatBuffer func_147525_a(float p_147525_1_, float p_147525_2_, float p_147525_3_, float p_147525_4_) { + this.field_147528_b.clear(); + this.field_147528_b.put(p_147525_1_).put(p_147525_2_).put(p_147525_3_).put(p_147525_4_); + this.field_147528_b.flip(); + return this.field_147528_b; + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntityEndPortal)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java new file mode 100644 index 0000000..ba296df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java @@ -0,0 +1,62 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelEnderCrystal; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderEnderCrystal extends Render { + private static final ResourceLocation enderCrystalTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal.png"); + private final ModelBase field_76995_b; + + + public RenderEnderCrystal() { + this.shadowSize = 0.5F; + this.field_76995_b = new ModelEnderCrystal(0.0F, true); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) { + var132.updateAnimation(); + } + } + } + } + GL11.glPopMatrix(); + } + } + + protected void func_147914_a(EntityItemFrame p_147914_1_, double p_147914_2_, double p_147914_4_, double p_147914_6_) { + if (Minecraft.isGuiEnabled() && p_147914_1_.getDisplayedItem() != null && p_147914_1_.getDisplayedItem().hasDisplayName() && this.renderManager.field_147941_i == p_147914_1_) { + float var8 = 1.6F; + float var9 = 0.016666668F * var8; + double var10 = p_147914_1_.getDistanceSqToEntity(this.renderManager.livingPlayer); + float var12 = p_147914_1_.isSneaking() ? 32.0F : 64.0F; + + if (var10 < (double)(var12 * var12)) { + String var13 = p_147914_1_.getDisplayedItem().getDisplayName(); + + if (p_147914_1_.isSneaking()) { + FontRenderer var14 = this.getFontRendererFromRenderManager(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_147914_2_ + 0.0F, (float)p_147914_4_ + p_147914_1_.height + 0.5F, (float)p_147914_6_); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-var9, -var9, var9); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + Tessellator var15 = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + var15.startDrawingQuads(); + int var16 = var14.getStringWidth(var13) / 2; + var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); + var15.addVertex((double)(-var16 - 1), -1.0D, 0.0D); + var15.addVertex((double)(-var16 - 1), 8.0D, 0.0D); + var15.addVertex((double)(var16 + 1), 8.0D, 0.0D); + var15.addVertex((double)(var16 + 1), -1.0D, 0.0D); + var15.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + var14.drawString(var13, -var14.getStringWidth(var13) / 2, 0, 553648127); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } else { + this.func_147906_a(p_147914_1_, var13, p_147914_2_, p_147914_4_, p_147914_6_, 64); + } + } + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + public ResourceLocation getEntityTexture(Entity par1Entity) { + return this.getEntityTexture((EntityItemFrame)par1Entity); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 180.0F) { + var4 -= 360.0F; + } + + return p_82400_1_ + p_82400_3_ * var4; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) { + if (Config.isShaders()) { + Shaders.beginBeacon(); + } + + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + + if (var9 > 0.0F) { + Tessellator var10 = Tessellator.instance; + this.bindTexture(field_147523_b); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + float var11 = (float)p_147500_1_.getWorldObj().getTotalWorldTime() + p_147500_8_; + float var12 = -var11 * 0.2F - (float)MathHelper.floor_float(-var11 * 0.1F); + byte var13 = 1; + double var14 = (double)var11 * 0.025D * (1.0D - (double)(var13 & 1) * 2.5D); + var10.startDrawingQuads(); + var10.setColorRGBA(255, 255, 255, 32); + double var16 = (double)var13 * 0.2D; + double var18 = 0.5D + Math.cos(var14 + 2.356194490192345D) * var16; + double var20 = 0.5D + Math.sin(var14 + 2.356194490192345D) * var16; + double var22 = 0.5D + Math.cos(var14 + (Math.PI / 4D)) * var16; + double var24 = 0.5D + Math.sin(var14 + (Math.PI / 4D)) * var16; + double var26 = 0.5D + Math.cos(var14 + 3.9269908169872414D) * var16; + double var28 = 0.5D + Math.sin(var14 + 3.9269908169872414D) * var16; + double var30 = 0.5D + Math.cos(var14 + 5.497787143782138D) * var16; + double var32 = 0.5D + Math.sin(var14 + 5.497787143782138D) * var16; + double var34 = (double)(256.0F * var9); + double var36 = 0.0D; + double var38 = 1.0D; + double var40 = (double)(-1.0F + var12); + double var42 = (double)(256.0F * var9) * (0.5D / var16) + var40; + var10.addVertexWithUV(p_147500_2_ + var18, p_147500_4_ + var34, p_147500_6_ + var20, var38, var42); + var10.addVertexWithUV(p_147500_2_ + var18, p_147500_4_, p_147500_6_ + var20, var38, var40); + var10.addVertexWithUV(p_147500_2_ + var22, p_147500_4_, p_147500_6_ + var24, var36, var40); + var10.addVertexWithUV(p_147500_2_ + var22, p_147500_4_ + var34, p_147500_6_ + var24, var36, var42); + var10.addVertexWithUV(p_147500_2_ + var30, p_147500_4_ + var34, p_147500_6_ + var32, var38, var42); + var10.addVertexWithUV(p_147500_2_ + var30, p_147500_4_, p_147500_6_ + var32, var38, var40); + var10.addVertexWithUV(p_147500_2_ + var26, p_147500_4_, p_147500_6_ + var28, var36, var40); + var10.addVertexWithUV(p_147500_2_ + var26, p_147500_4_ + var34, p_147500_6_ + var28, var36, var42); + var10.addVertexWithUV(p_147500_2_ + var22, p_147500_4_ + var34, p_147500_6_ + var24, var38, var42); + var10.addVertexWithUV(p_147500_2_ + var22, p_147500_4_, p_147500_6_ + var24, var38, var40); + var10.addVertexWithUV(p_147500_2_ + var30, p_147500_4_, p_147500_6_ + var32, var36, var40); + var10.addVertexWithUV(p_147500_2_ + var30, p_147500_4_ + var34, p_147500_6_ + var32, var36, var42); + var10.addVertexWithUV(p_147500_2_ + var26, p_147500_4_ + var34, p_147500_6_ + var28, var38, var42); + var10.addVertexWithUV(p_147500_2_ + var26, p_147500_4_, p_147500_6_ + var28, var38, var40); + var10.addVertexWithUV(p_147500_2_ + var18, p_147500_4_, p_147500_6_ + var20, var36, var40); + var10.addVertexWithUV(p_147500_2_ + var18, p_147500_4_ + var34, p_147500_6_ + var20, var36, var42); + var10.draw(); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDepthMask(false); + var10.startDrawingQuads(); + var10.setColorRGBA(255, 255, 255, 32); + double var44 = 0.2D; + double var15 = 0.2D; + double var17 = 0.8D; + double var19 = 0.2D; + double var21 = 0.2D; + double var23 = 0.8D; + double var25 = 0.8D; + double var27 = 0.8D; + double var29 = (double)(256.0F * var9); + double var31 = 0.0D; + double var33 = 1.0D; + double var35 = (double)(-1.0F + var12); + double var37 = (double)(256.0F * var9) + var35; + var10.addVertexWithUV(p_147500_2_ + var44, p_147500_4_ + var29, p_147500_6_ + var15, var33, var37); + var10.addVertexWithUV(p_147500_2_ + var44, p_147500_4_, p_147500_6_ + var15, var33, var35); + var10.addVertexWithUV(p_147500_2_ + var17, p_147500_4_, p_147500_6_ + var19, var31, var35); + var10.addVertexWithUV(p_147500_2_ + var17, p_147500_4_ + var29, p_147500_6_ + var19, var31, var37); + var10.addVertexWithUV(p_147500_2_ + var25, p_147500_4_ + var29, p_147500_6_ + var27, var33, var37); + var10.addVertexWithUV(p_147500_2_ + var25, p_147500_4_, p_147500_6_ + var27, var33, var35); + var10.addVertexWithUV(p_147500_2_ + var21, p_147500_4_, p_147500_6_ + var23, var31, var35); + var10.addVertexWithUV(p_147500_2_ + var21, p_147500_4_ + var29, p_147500_6_ + var23, var31, var37); + var10.addVertexWithUV(p_147500_2_ + var17, p_147500_4_ + var29, p_147500_6_ + var19, var33, var37); + var10.addVertexWithUV(p_147500_2_ + var17, p_147500_4_, p_147500_6_ + var19, var33, var35); + var10.addVertexWithUV(p_147500_2_ + var25, p_147500_4_, p_147500_6_ + var27, var31, var35); + var10.addVertexWithUV(p_147500_2_ + var25, p_147500_4_ + var29, p_147500_6_ + var27, var31, var37); + var10.addVertexWithUV(p_147500_2_ + var21, p_147500_4_ + var29, p_147500_6_ + var23, var33, var37); + var10.addVertexWithUV(p_147500_2_ + var21, p_147500_4_, p_147500_6_ + var23, var33, var35); + var10.addVertexWithUV(p_147500_2_ + var44, p_147500_4_, p_147500_6_ + var15, var31, var35); + var10.addVertexWithUV(p_147500_2_ + var44, p_147500_4_ + var29, p_147500_6_ + var15, var31, var37); + var10.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + } + + if (Config.isShaders()) { + Shaders.endBeacon(); + } + } + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntityBeacon)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java new file mode 100644 index 0000000..842d04d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java @@ -0,0 +1,142 @@ +package net.minecraft.client.renderer.tileentity; + +import java.util.Calendar; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.model.ModelLargeChest; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class TileEntityChestRenderer extends TileEntitySpecialRenderer { + private static final ResourceLocation field_147507_b = new ResourceLocation("textures/entity/chest/trapped_double.png"); + private static final ResourceLocation field_147508_c = new ResourceLocation("textures/entity/chest/christmas_double.png"); + private static final ResourceLocation field_147505_d = new ResourceLocation("textures/entity/chest/normal_double.png"); + private static final ResourceLocation field_147506_e = new ResourceLocation("textures/entity/chest/trapped.png"); + private static final ResourceLocation field_147503_f = new ResourceLocation("textures/entity/chest/christmas.png"); + private static final ResourceLocation field_147504_g = new ResourceLocation("textures/entity/chest/normal.png"); + private final ModelChest field_147510_h = new ModelChest(); + private final ModelChest field_147511_i = new ModelLargeChest(); + private boolean field_147509_j; + + + public TileEntityChestRenderer() { + Calendar var1 = Calendar.getInstance(); + + if (var1.get(2) + 1 == 12 && var1.get(5) >= 24 && var1.get(5) <= 26) { + this.field_147509_j = true; + } + } + + public void renderTileEntityAt(TileEntityChest p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + int var9; + + if (!p_147500_1_.hasWorldObj()) { + var9 = 0; + } else { + Block var10 = p_147500_1_.getBlockType(); + var9 = p_147500_1_.getBlockMetadata(); + + if (var10 instanceof BlockChest && var9 == 0) { + ((BlockChest)var10).func_149954_e(p_147500_1_.getWorldObj(), p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e); + var9 = p_147500_1_.getBlockMetadata(); + } + + p_147500_1_.func_145979_i(); + } + + if (p_147500_1_.field_145992_i == null && p_147500_1_.field_145991_k == null) { + ModelChest var14; + + if (p_147500_1_.field_145990_j == null && p_147500_1_.field_145988_l == null) { + var14 = this.field_147510_h; + + if (p_147500_1_.func_145980_j() == 1) { + this.bindTexture(field_147506_e); + } else if (this.field_147509_j) { + this.bindTexture(field_147503_f); + } else { + this.bindTexture(field_147504_g); + } + } else { + var14 = this.field_147511_i; + + if (p_147500_1_.func_145980_j() == 1) { + this.bindTexture(field_147507_b); + } else if (this.field_147509_j) { + this.bindTexture(field_147508_c); + } else { + this.bindTexture(field_147505_d); + } + } + + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float)p_147500_2_, (float)p_147500_4_ + 1.0F, (float)p_147500_6_ + 1.0F); + GL11.glScalef(1.0F, -1.0F, -1.0F); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + short var11 = 0; + + if (var9 == 2) { + var11 = 180; + } + + if (var9 == 3) { + var11 = 0; + } + + if (var9 == 4) { + var11 = 90; + } + + if (var9 == 5) { + var11 = -90; + } + + if (var9 == 2 && p_147500_1_.field_145990_j != null) { + GL11.glTranslatef(1.0F, 0.0F, 0.0F); + } + + if (var9 == 5 && p_147500_1_.field_145988_l != null) { + GL11.glTranslatef(0.0F, 0.0F, -1.0F); + } + + GL11.glRotatef(var11, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + float var12 = p_147500_1_.field_145986_n + (p_147500_1_.field_145989_m - p_147500_1_.field_145986_n) * p_147500_8_; + float var13; + + if (p_147500_1_.field_145992_i != null) { + var13 = p_147500_1_.field_145992_i.field_145986_n + (p_147500_1_.field_145992_i.field_145989_m - p_147500_1_.field_145992_i.field_145986_n) * p_147500_8_; + + if (var13 > var12) { + var12 = var13; + } + } + + if (p_147500_1_.field_145991_k != null) { + var13 = p_147500_1_.field_145991_k.field_145986_n + (p_147500_1_.field_145991_k.field_145989_m - p_147500_1_.field_145991_k.field_145986_n) * p_147500_8_; + + if (var13 > var12) { + var12 = var13; + } + } + + var12 = 1.0F - var12; + var12 = 1.0F - var12 * var12 * var12; + var14.chestLid.rotateAngleX = -(var12 * (float)Math.PI / 2.0F); + var14.renderAll(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntityChest)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java new file mode 100644 index 0000000..b1ab16c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java @@ -0,0 +1,62 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.model.ModelChest; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class TileEntityEnderChestRenderer extends TileEntitySpecialRenderer { + private static final ResourceLocation field_147520_b = new ResourceLocation("textures/entity/chest/ender.png"); + private final ModelChest field_147521_c = new ModelChest(); + + + public void renderTileEntityAt(TileEntityEnderChest p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + int var9 = 0; + + if (p_147500_1_.hasWorldObj()) { + var9 = p_147500_1_.getBlockMetadata(); + } + + this.bindTexture(field_147520_b); + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float)p_147500_2_, (float)p_147500_4_ + 1.0F, (float)p_147500_6_ + 1.0F); + GL11.glScalef(1.0F, -1.0F, -1.0F); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + short var10 = 0; + + if (var9 == 2) { + var10 = 180; + } + + if (var9 == 3) { + var10 = 0; + } + + if (var9 == 4) { + var10 = 90; + } + + if (var9 == 5) { + var10 = -90; + } + + GL11.glRotatef(var10, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + float var11 = p_147500_1_.field_145975_i + (p_147500_1_.field_145972_a - p_147500_1_.field_145975_i) * p_147500_8_; + var11 = 1.0F - var11; + var11 = 1.0F - var11 * var11 * var11; + this.field_147521_c.chestLid.rotateAngleX = -(var11 * (float)Math.PI / 2.0F); + this.field_147521_c.renderAll(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntityEnderChest)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java new file mode 100644 index 0000000..a7691de --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java @@ -0,0 +1,39 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import org.lwjgl.opengl.GL11; + +public class TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer { + + + public void renderTileEntityAt(TileEntityMobSpawner p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_, (float)p_147500_6_ + 0.5F); + func_147517_a(p_147500_1_.func_145881_a(), p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + GL11.glPopMatrix(); + } + + public static void func_147517_a(MobSpawnerBaseLogic p_147517_0_, double p_147517_1_, double p_147517_3_, double p_147517_5_, float p_147517_7_) { + Entity var8 = p_147517_0_.func_98281_h(); + + if (var8 != null) { + var8.setWorld(p_147517_0_.getSpawnerWorld()); + float var9 = 0.4375F; + GL11.glTranslatef(0.0F, 0.4F, 0.0F); + GL11.glRotatef((float)(p_147517_0_.field_98284_d + (p_147517_0_.field_98287_c - p_147517_0_.field_98284_d) * (double)p_147517_7_) * 10.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.4F, 0.0F); + GL11.glScalef(var9, var9, var9); + var8.setLocationAndAngles(p_147517_1_, p_147517_3_, p_147517_5_, 0.0F, 0.0F); + RenderManager.instance.func_147940_a(var8, 0.0D, 0.0D, 0.0D, 0.0F, p_147517_7_); + } + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntityMobSpawner)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.java new file mode 100644 index 0000000..79139e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.java @@ -0,0 +1,24 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnderChest; + +public class TileEntityRendererChestHelper { + public static TileEntityRendererChestHelper instance = new TileEntityRendererChestHelper(); + private final TileEntityChest field_147717_b = new TileEntityChest(0); + private final TileEntityChest field_147718_c = new TileEntityChest(1); + private final TileEntityEnderChest field_147716_d = new TileEntityEnderChest(); + + + public void func_147715_a(Block p_147715_1_, int p_147715_2_, float p_147715_3_) { + if (p_147715_1_ == Blocks.ender_chest) { + TileEntityRendererDispatcher.instance.func_147549_a(this.field_147716_d, 0.0D, 0.0D, 0.0D, 0.0F); + } else if (p_147715_1_ == Blocks.trapped_chest) { + TileEntityRendererDispatcher.instance.func_147549_a(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F); + } else { + TileEntityRendererDispatcher.instance.func_147549_a(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java new file mode 100644 index 0000000..ed404db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java @@ -0,0 +1,138 @@ +package net.minecraft.client.renderer.tileentity; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderEnchantmentTable; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.ReportedException; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +public class TileEntityRendererDispatcher { + private final Map mapSpecialRenderers = new HashMap(); + public static TileEntityRendererDispatcher instance = new TileEntityRendererDispatcher(); + private FontRenderer field_147557_n; + public static double staticPlayerX; + public static double staticPlayerY; + public static double staticPlayerZ; + public TextureManager field_147553_e; + public World field_147550_f; + public EntityLivingBase field_147551_g; + public float field_147562_h; + public float field_147563_i; + public double field_147560_j; + public double field_147561_k; + public double field_147558_l; + + + private TileEntityRendererDispatcher() { + this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer()); + this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer()); + this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityRendererPiston()); + this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer()); + this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer()); + this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable()); + this.mapSpecialRenderers.put(TileEntityEndPortal.class, new RenderEndPortal()); + this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer()); + this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer()); + Iterator var1 = this.mapSpecialRenderers.values().iterator(); + + while (var1.hasNext()) { + TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next(); + var2.func_147497_a(this); + } + } + + public TileEntitySpecialRenderer getSpecialRendererByClass(Class p_147546_1_) { + TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)this.mapSpecialRenderers.get(p_147546_1_); + + if (var2 == null && p_147546_1_ != TileEntity.class) { + var2 = this.getSpecialRendererByClass(p_147546_1_.getSuperclass()); + this.mapSpecialRenderers.put(p_147546_1_, var2); + } + + return var2; + } + + public boolean hasSpecialRenderer(TileEntity p_147545_1_) { + return this.getSpecialRenderer(p_147545_1_) != null; + } + + public TileEntitySpecialRenderer getSpecialRenderer(TileEntity p_147547_1_) { + return p_147547_1_ == null ? null : this.getSpecialRendererByClass(p_147547_1_.getClass()); + } + + public void func_147542_a(World p_147542_1_, TextureManager p_147542_2_, FontRenderer p_147542_3_, EntityLivingBase p_147542_4_, float p_147542_5_) { + if (this.field_147550_f != p_147542_1_) { + this.func_147543_a(p_147542_1_); + } + + this.field_147553_e = p_147542_2_; + this.field_147551_g = p_147542_4_; + this.field_147557_n = p_147542_3_; + this.field_147562_h = p_147542_4_.prevRotationYaw + (p_147542_4_.rotationYaw - p_147542_4_.prevRotationYaw) * p_147542_5_; + this.field_147563_i = p_147542_4_.prevRotationPitch + (p_147542_4_.rotationPitch - p_147542_4_.prevRotationPitch) * p_147542_5_; + this.field_147560_j = p_147542_4_.lastTickPosX + (p_147542_4_.posX - p_147542_4_.lastTickPosX) * (double)p_147542_5_; + this.field_147561_k = p_147542_4_.lastTickPosY + (p_147542_4_.posY - p_147542_4_.lastTickPosY) * (double)p_147542_5_; + this.field_147558_l = p_147542_4_.lastTickPosZ + (p_147542_4_.posZ - p_147542_4_.lastTickPosZ) * (double)p_147542_5_; + } + + public void func_147544_a(TileEntity p_147544_1_, float p_147544_2_) { + if (p_147544_1_.getDistanceFrom(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_147544_1_.getMaxRenderDistanceSquared()) { + int var3 = this.field_147550_f.getLightBrightnessForSkyBlocks(p_147544_1_.field_145851_c, p_147544_1_.field_145848_d, p_147544_1_.field_145849_e, 0); + int var4 = var3 % 65536; + int var5 = var3 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var4 / 1.0F, (float)var5 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.func_147549_a(p_147544_1_, (double)p_147544_1_.field_145851_c - staticPlayerX, (double)p_147544_1_.field_145848_d - staticPlayerY, (double)p_147544_1_.field_145849_e - staticPlayerZ, p_147544_2_); + } + } + + public void func_147549_a(TileEntity p_147549_1_, double p_147549_2_, double p_147549_4_, double p_147549_6_, float p_147549_8_) { + TileEntitySpecialRenderer var9 = this.getSpecialRenderer(p_147549_1_); + + if (var9 != null) { + try { + var9.renderTileEntityAt(p_147549_1_, p_147549_2_, p_147549_4_, p_147549_6_, p_147549_8_); + } catch (Throwable var13) { + CrashReport var11 = CrashReport.makeCrashReport(var13, "Rendering Block Entity"); + CrashReportCategory var12 = var11.makeCategory("Block Entity Details"); + p_147549_1_.func_145828_a(var12); + throw new ReportedException(var11); + } + } + } + + public void func_147543_a(World p_147543_1_) { + this.field_147550_f = p_147543_1_; + Iterator var2 = this.mapSpecialRenderers.values().iterator(); + + while (var2.hasNext()) { + TileEntitySpecialRenderer var3 = (TileEntitySpecialRenderer)var2.next(); + + if (var3 != null) { + var3.func_147496_a(p_147543_1_); + } + } + } + + public FontRenderer func_147548_a() { + return this.field_147557_n; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.java new file mode 100644 index 0000000..3cf52cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.java @@ -0,0 +1,67 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +public class TileEntityRendererPiston extends TileEntitySpecialRenderer { + private RenderBlocks field_147516_b; + + + public void renderTileEntityAt(TileEntityPiston p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + Block var9 = p_147500_1_.func_145861_a(); + + if (var9.getMaterial() != Material.air && p_147500_1_.func_145860_a(p_147500_8_) < 1.0F) { + Tessellator var10 = Tessellator.instance; + this.bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_CULL_FACE); + + if (Minecraft.isAmbientOcclusionEnabled()) { + GL11.glShadeModel(GL11.GL_SMOOTH); + } else { + GL11.glShadeModel(GL11.GL_FLAT); + } + + var10.startDrawingQuads(); + var10.setTranslation((float)p_147500_2_ - (float)p_147500_1_.field_145851_c + p_147500_1_.func_145865_b(p_147500_8_), (float)p_147500_4_ - (float)p_147500_1_.field_145848_d + p_147500_1_.func_145862_c(p_147500_8_), (float)p_147500_6_ - (float)p_147500_1_.field_145849_e + p_147500_1_.func_145859_d(p_147500_8_)); + var10.setColorOpaque_F(1.0F, 1.0F, 1.0F); + + if (var9 == Blocks.piston_head && p_147500_1_.func_145860_a(p_147500_8_) < 0.5F) { + this.field_147516_b.renderPistonExtensionAllFaces(var9, p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e, false); + } else if (p_147500_1_.func_145867_d() && !p_147500_1_.func_145868_b()) { + Blocks.piston_head.func_150086_a(((BlockPistonBase)var9).func_150073_e()); + this.field_147516_b.renderPistonExtensionAllFaces(Blocks.piston_head, p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e, p_147500_1_.func_145860_a(p_147500_8_) < 0.5F); + Blocks.piston_head.func_150087_e(); + var10.setTranslation((float)p_147500_2_ - (float)p_147500_1_.field_145851_c, (float)p_147500_4_ - (float)p_147500_1_.field_145848_d, (float)p_147500_6_ - (float)p_147500_1_.field_145849_e); + this.field_147516_b.renderPistonBaseAllFaces(var9, p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e); + } else { + this.field_147516_b.renderBlockAllFaces(var9, p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e); + } + + var10.setTranslation(0.0D, 0.0D, 0.0D); + var10.draw(); + RenderHelper.enableStandardItemLighting(); + } + } + + public void func_147496_a(World p_147496_1_) { + this.field_147516_b = new RenderBlocks(p_147496_1_); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntityPiston)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java new file mode 100644 index 0000000..b981bae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java @@ -0,0 +1,82 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.ModelSign; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class TileEntitySignRenderer extends TileEntitySpecialRenderer { + private static final ResourceLocation field_147513_b = new ResourceLocation("textures/entity/sign.png"); + private final ModelSign field_147514_c = new ModelSign(); + + + public void renderTileEntityAt(TileEntitySign p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + Block var9 = p_147500_1_.getBlockType(); + GL11.glPushMatrix(); + float var10 = 0.6666667F; + float var12; + + if (var9 == Blocks.standing_sign) { + GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_ + 0.75F * var10, (float)p_147500_6_ + 0.5F); + float var11 = (float)(p_147500_1_.getBlockMetadata() * 360) / 16.0F; + GL11.glRotatef(-var11, 0.0F, 1.0F, 0.0F); + this.field_147514_c.signStick.showModel = true; + } else { + int var16 = p_147500_1_.getBlockMetadata(); + var12 = 0.0F; + + if (var16 == 2) { + var12 = 180.0F; + } + + if (var16 == 4) { + var12 = 90.0F; + } + + if (var16 == 5) { + var12 = -90.0F; + } + + GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_ + 0.75F * var10, (float)p_147500_6_ + 0.5F); + GL11.glRotatef(-var12, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.3125F, -0.4375F); + this.field_147514_c.signStick.showModel = false; + } + + this.bindTexture(field_147513_b); + GL11.glPushMatrix(); + GL11.glScalef(var10, -var10, -var10); + this.field_147514_c.renderSign(); + GL11.glPopMatrix(); + FontRenderer var17 = this.func_147498_b(); + var12 = 0.016666668F * var10; + GL11.glTranslatef(0.0F, 0.5F * var10, 0.07F * var10); + GL11.glScalef(var12, -var12, var12); + GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); + GL11.glDepthMask(false); + byte var13 = 0; + + for (int var14 = 0; var14 < p_147500_1_.field_145915_a.length; ++var14) { + String var15 = p_147500_1_.field_145915_a[var14]; + + if (var14 == p_147500_1_.field_145918_i) { + var15 = "> " + var15 + " <"; + var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - p_147500_1_.field_145915_a.length * 5, var13); + } else { + var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - p_147500_1_.field_145915_a.length * 5, var13); + } + } + + GL11.glDepthMask(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntitySign)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java new file mode 100644 index 0000000..05a6942 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java @@ -0,0 +1,114 @@ +package net.minecraft.client.renderer.tileentity; + +import com.cheatbreaker.client.CheatBreaker; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import java.util.Map; + +public class TileEntitySkullRenderer extends TileEntitySpecialRenderer { + private static final ResourceLocation field_147537_c = new ResourceLocation("textures/entity/skeleton/skeleton.png"); + private static final ResourceLocation field_147534_d = new ResourceLocation("textures/entity/skeleton/wither_skeleton.png"); + private static final ResourceLocation field_147535_e = new ResourceLocation("textures/entity/zombie/zombie.png"); + private static final ResourceLocation field_147532_f = new ResourceLocation("textures/entity/creeper/creeper.png"); + public static TileEntitySkullRenderer field_147536_b; + private final ModelSkeletonHead field_147533_g = new ModelSkeletonHead(0, 0, 64, 32); + private final ModelSkeletonHead field_147538_h = new ModelSkeletonHead(0, 0, 64, 64); + + + public void renderTileEntityAt(TileEntitySkull p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + if (CheatBreaker.getInstance().getGlobalSettings().hidePlacedSkulls.getBooleanValue()) return; + this.func_152674_a((float)p_147500_2_, (float)p_147500_4_, (float)p_147500_6_, p_147500_1_.getBlockMetadata() & 7, (float)(p_147500_1_.func_145906_b() * 360) / 16.0F, p_147500_1_.func_145904_a(), p_147500_1_.func_152108_a()); + } + + public void func_147497_a(TileEntityRendererDispatcher p_147497_1_) { + super.func_147497_a(p_147497_1_); + field_147536_b = this; + } + + public void func_152674_a(float p_152674_1_, float p_152674_2_, float p_152674_3_, int p_152674_4_, float p_152674_5_, int p_152674_6_, GameProfile p_152674_7_) { + ModelSkeletonHead var8 = this.field_147533_g; + + switch (p_152674_6_) { + case 0: + default: + this.bindTexture(field_147537_c); + break; + + case 1: + this.bindTexture(field_147534_d); + break; + + case 2: + this.bindTexture(field_147535_e); + var8 = this.field_147538_h; + break; + + case 3: + ResourceLocation var9 = AbstractClientPlayer.locationStevePng; + + if (p_152674_7_ != null) { + Minecraft var10 = Minecraft.getMinecraft(); + Map var11 = var10.func_152342_ad().func_152788_a(p_152674_7_); + + if (var11.containsKey(Type.SKIN)) { + var9 = var10.func_152342_ad().func_152792_a((MinecraftProfileTexture)var11.get(Type.SKIN), Type.SKIN); + } + } + + this.bindTexture(var9); + break; + + case 4: + this.bindTexture(field_147532_f); + } + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_CULL_FACE); + + if (p_152674_4_ != 1) { + switch (p_152674_4_) { + case 2: + GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_ + 0.25F, p_152674_3_ + 0.74F); + break; + + case 3: + GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_ + 0.25F, p_152674_3_ + 0.26F); + p_152674_5_ = 180.0F; + break; + + case 4: + GL11.glTranslatef(p_152674_1_ + 0.74F, p_152674_2_ + 0.25F, p_152674_3_ + 0.5F); + p_152674_5_ = 270.0F; + break; + + case 5: + default: + GL11.glTranslatef(p_152674_1_ + 0.26F, p_152674_2_ + 0.25F, p_152674_3_ + 0.5F); + p_152674_5_ = 90.0F; + } + } else { + GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_, p_152674_3_ + 0.5F); + } + + float var12 = 0.0625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + var8.render(null, 0.0F, 0.0F, 0.0F, p_152674_5_, 0.0F, var12); + GL11.glPopMatrix(); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { + this.renderTileEntityAt((TileEntitySkull)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java new file mode 100644 index 0000000..f96af7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java @@ -0,0 +1,32 @@ +package net.minecraft.client.renderer.tileentity; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public abstract class TileEntitySpecialRenderer { + protected TileEntityRendererDispatcher field_147501_a; + + + public abstract void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_); + + protected void bindTexture(ResourceLocation p_147499_1_) { + TextureManager var2 = this.field_147501_a.field_147553_e; + + if (var2 != null) { + var2.bindTexture(p_147499_1_); + } + } + + public void func_147497_a(TileEntityRendererDispatcher p_147497_1_) { + this.field_147501_a = p_147497_1_; + } + + public void func_147496_a(World p_147496_1_) {} + + public FontRenderer func_147498_b() { + return this.field_147501_a.func_147548_a(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java new file mode 100644 index 0000000..76d8628 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/AbstractResourcePack.java @@ -0,0 +1,104 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Charsets; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.*; + +public abstract class AbstractResourcePack implements IResourcePack { + private static final Logger resourceLog = LogManager.getLogger(); + public final File resourcePackFile; + public static final int SIZE_CAP = 64; + + public AbstractResourcePack(File p_i1287_1_) { + this.resourcePackFile = p_i1287_1_; + } + + private static String locationToName(ResourceLocation p_110592_0_) { + return String.format("%s/%s/%s", "assets", p_110592_0_.getResourceDomain(), p_110592_0_.getResourcePath()); + } + + protected static String getRelativeName(File p_110595_0_, File p_110595_1_) { + return p_110595_0_.toURI().relativize(p_110595_1_.toURI()).getPath(); + } + + public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException { + return this.getInputStreamByName(locationToName(p_110590_1_)); + } + + public boolean resourceExists(ResourceLocation p_110589_1_) { + return this.hasResourceName(locationToName(p_110589_1_)); + } + + protected abstract InputStream getInputStreamByName(String p_110591_1_) throws IOException; + + protected abstract boolean hasResourceName(String p_110593_1_); + + protected void logNameNotLowercase(String p_110594_1_) { + resourceLog.warn("ResourcePack: ignored non-lowercase namespace: %s in %s", p_110594_1_, this.resourcePackFile); + } + + public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { + return readMetadata(p_135058_1_, this.getInputStreamByName("pack.mcmeta"), p_135058_2_); + } + + static IMetadataSection readMetadata(IMetadataSerializer p_110596_0_, InputStream p_110596_1_, String p_110596_2_) { + JsonObject var3 = null; + BufferedReader var4 = null; + + try { + var4 = new BufferedReader(new InputStreamReader(p_110596_1_, Charsets.UTF_8)); + var3 = (new JsonParser()).parse(var4).getAsJsonObject(); + } catch (RuntimeException var9) { + throw new JsonParseException(var9); + } + finally { + IOUtils.closeQuietly(var4); + } + + return p_110596_0_.parseMetadataSection(p_110596_2_, var3); + } + + + public BufferedImage getPackImage(){ + try { + return scalePackImage(ImageIO.read(this.getInputStreamByName("pack.png"))); + } catch (IOException e) { + return Config.getDefaultResourcePack().getPackImage(); + } + } + + public BufferedImage scalePackImage(BufferedImage image) { + if (image == null) { + return null; + } + if (image.getWidth() > SIZE_CAP || image.getHeight() > SIZE_CAP) { + resourceLog.info("[Icon Scaler] Scaling resource pack icon from " + image.getWidth() + " to " + SIZE_CAP); + BufferedImage smallImage = new BufferedImage(SIZE_CAP, SIZE_CAP, BufferedImage.TYPE_INT_ARGB); + Graphics graphics = smallImage.getGraphics(); + graphics.drawImage(image, 0, 0, SIZE_CAP, SIZE_CAP, null); + graphics.dispose(); + return smallImage; + } else { + resourceLog.info("[Icon Scaler] Retaining pack icon scale at " + image.getWidth()); + return image; + } + + } + + public String getPackName() { + return this.resourcePackFile.getName(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java new file mode 100644 index 0000000..935ad97 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/DefaultResourcePack.java @@ -0,0 +1,80 @@ +package net.minecraft.client.resources; + +import com.cheatbreaker.client.network.agent.AgentResources; +import com.google.common.collect.ImmutableSet; +import lombok.SneakyThrows; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.src.ReflectorForge; +import net.minecraft.util.ResourceLocation; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.*; +import java.util.Map; +import java.util.Set; + +public class DefaultResourcePack implements IResourcePack { + public static final Set defaultResourceDomains = ImmutableSet.of("minecraft", "realms"); + private final Map field_152781_b; + + public DefaultResourcePack(Map par1GuiScreen) { + this.field_152781_b = par1GuiScreen; + } + + public InputStream getInputStream(ResourceLocation par1ResourceLocation) throws IOException { + InputStream var2 = this.getResourceStream(par1ResourceLocation); + + if (var2 != null) { + return var2; + } else { + InputStream var3 = this.func_152780_c(par1ResourceLocation); + + if (var3 != null) { + return var3; + } else { + throw new FileNotFoundException(par1ResourceLocation.getResourcePath()); + } + } + } + + public InputStream func_152780_c(ResourceLocation p_152780_1_) throws IOException { + File var2 = (File)this.field_152781_b.get(p_152780_1_.toString()); + return var2 != null && var2.isFile() ? new FileInputStream(var2) : null; + } + + public InputStream getResourceStream(ResourceLocation par1ResourceLocation) { + String path = "/assets/" + par1ResourceLocation.getResourceDomain() + "/" + par1ResourceLocation.getResourcePath(); + InputStream is = ReflectorForge.getOptiFineResourceStream(path); + return is != null ? is : DefaultResourcePack.class.getResourceAsStream("/assets/" + par1ResourceLocation.getResourceDomain() + "/" + par1ResourceLocation.getResourcePath()); + } + + public boolean resourceExists(ResourceLocation par1ResourceLocation) { + return this.getResourceStream(par1ResourceLocation) != null || this.field_152781_b.containsKey(par1ResourceLocation.toString()); + } + + public Set getResourceDomains() { + return defaultResourceDomains; + } + + public IMetadataSection getPackMetadata(IMetadataSerializer par1MetadataSerializer, String par2Str) throws IOException { + try { + FileInputStream var5 = new FileInputStream((File)this.field_152781_b.get("pack.mcmeta")); + return AbstractResourcePack.readMetadata(par1MetadataSerializer, var5, par2Str); + } catch (RuntimeException | FileNotFoundException var4) { + return null; + } + } + + @Override @SneakyThrows + public BufferedImage getPackImage() { + if (AgentResources.existsBytes("pack.png")) { + return ImageIO.read(new ByteArrayInputStream(AgentResources.getBytesNative("pack.png"))); + } + return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + new ResourceLocation("pack.png").getResourcePath())); + } + + public String getPackName() { + return "Default"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java new file mode 100644 index 0000000..7a621a9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FallbackResourceManager.java @@ -0,0 +1,85 @@ +package net.minecraft.client.resources; + +import com.cheatbreaker.client.network.agent.AgentResources; +import com.google.common.collect.Lists; +import lombok.SneakyThrows; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class FallbackResourceManager implements IResourceManager { + protected final List resourcePacks = new ArrayList<>(); + private final IMetadataSerializer frmMetadataSerializer; + + + public FallbackResourceManager(IMetadataSerializer p_i1289_1_) { + this.frmMetadataSerializer = p_i1289_1_; + } + + public void addResourcePack(IResourcePack p_110538_1_) { + this.resourcePacks.add(p_110538_1_); + } + + public Set getResourceDomains() { + return null; + } + + @Override @SneakyThrows + public IResource getResource(ResourceLocation resourceLocation) { + Object object; + IResourcePack iResourcePack = null; + ResourceLocation resourceLocation2 = FallbackResourceManager.getLocationMcmeta(resourceLocation); + for (int i = this.resourcePacks.size() - 1; i >= 0; --i) { + IResourcePack pack = this.resourcePacks.get(i); + if (iResourcePack == null && pack.resourceExists(resourceLocation2)) { + iResourcePack = pack; + } + if (!pack.resourceExists(resourceLocation)) continue; + InputStream inputStream = null; + if (iResourcePack != null) { + inputStream = iResourcePack.getInputStream(resourceLocation2); + } + return new SimpleResource(resourceLocation, pack.getInputStream(resourceLocation), inputStream, this.frmMetadataSerializer); + } + String string = "assets/minecraft/" + resourceLocation.getResourcePath(); + if (AgentResources.existsBytes(string)) { + object = AgentResources.getBytesNative(string); + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream((byte[])object); + ByteArrayInputStream byteArrayInputStream2 = null; + if (AgentResources.existsBytes(string + ".mcmeta")) { + byteArrayInputStream2 = new ByteArrayInputStream(AgentResources.getBytesNative(string + ".mcmeta")); + } + return new SimpleResource(resourceLocation, byteArrayInputStream, byteArrayInputStream2, this.frmMetadataSerializer); + } + throw new FileNotFoundException(resourceLocation.toString()); + } + + public List getAllResources(ResourceLocation p_135056_1_) throws IOException { + ArrayList var2 = Lists.newArrayList(); + ResourceLocation var3 = getLocationMcmeta(p_135056_1_); + + for (IResourcePack pack : this.resourcePacks) { + if (pack.resourceExists(p_135056_1_)) { + InputStream var6 = pack.resourceExists(var3) ? pack.getInputStream(var3) : null; + var2.add(new SimpleResource(p_135056_1_, pack.getInputStream(p_135056_1_), var6, this.frmMetadataSerializer)); + } + } + + if (var2.isEmpty()) { + throw new FileNotFoundException(p_135056_1_.toString()); + } else { + return var2; + } + } + + static ResourceLocation getLocationMcmeta(ResourceLocation p_110537_0_) { + return new ResourceLocation(p_110537_0_.getResourceDomain(), p_110537_0_.getResourcePath() + ".mcmeta"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FileResourcePack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FileResourcePack.java new file mode 100644 index 0000000..8e20e39 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FileResourcePack.java @@ -0,0 +1,99 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.io.Closeable; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +public class FileResourcePack extends AbstractResourcePack implements Closeable { + public static final Splitter entryNameSplitter = Splitter.on('/').omitEmptyStrings().limit(3); + private ZipFile resourcePackZipFile; + + + public FileResourcePack(File p_i1290_1_) { + super(p_i1290_1_); + } + + private ZipFile getResourcePackZipFile() throws IOException { + if (this.resourcePackZipFile == null) { + this.resourcePackZipFile = new ZipFile(this.resourcePackFile); + } + + return this.resourcePackZipFile; + } + + protected InputStream getInputStreamByName(String p_110591_1_) throws IOException { + ZipFile var2 = this.getResourcePackZipFile(); + ZipEntry var3 = var2.getEntry(p_110591_1_); + + if (var3 == null) { + throw new ResourcePackFileNotFoundException(this.resourcePackFile, p_110591_1_); + } else { + return var2.getInputStream(var3); + } + } + + public boolean hasResourceName(String p_110593_1_) { + try { + return this.getResourcePackZipFile().getEntry(p_110593_1_) != null; + } catch (IOException var3) { + return false; + } + } + + public Set getResourceDomains() { + ZipFile var1; + + try { + var1 = this.getResourcePackZipFile(); + } catch (IOException var8) { + return Collections.emptySet(); + } + + Enumeration var2 = var1.entries(); + HashSet var3 = Sets.newHashSet(); + + while (var2.hasMoreElements()) { + ZipEntry var4 = (ZipEntry)var2.nextElement(); + String var5 = var4.getName(); + + if (var5.startsWith("assets/")) { + ArrayList var6 = Lists.newArrayList(entryNameSplitter.split(var5)); + + if (var6.size() > 1) { + String var7 = (String)var6.get(1); + + if (!var7.equals(var7.toLowerCase())) { + this.logNameNotLowercase(var7); + } else { + var3.add(var7); + } + } + } + } + + return var3; + } + + protected void finalize() throws Throwable { + this.close(); + super.finalize(); + } + + public void close() throws IOException { + if (this.resourcePackZipFile != null) { + this.resourcePackZipFile.close(); + this.resourcePackZipFile = null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FolderResourcePack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FolderResourcePack.java new file mode 100644 index 0000000..69503bd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FolderResourcePack.java @@ -0,0 +1,50 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Sets; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashSet; +import java.util.Set; +import org.apache.commons.io.filefilter.DirectoryFileFilter; + +public class FolderResourcePack extends AbstractResourcePack { + + + public FolderResourcePack(File p_i1291_1_) { + super(p_i1291_1_); + } + + protected InputStream getInputStreamByName(String p_110591_1_) throws IOException { + return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile, p_110591_1_))); + } + + protected boolean hasResourceName(String p_110593_1_) { + return (new File(this.resourcePackFile, p_110593_1_)).isFile(); + } + + public Set getResourceDomains() { + HashSet var1 = Sets.newHashSet(); + File var2 = new File(this.resourcePackFile, "assets/"); + + if (var2.isDirectory()) { + File[] var3 = var2.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY); + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + File var6 = var3[var5]; + String var7 = getRelativeName(var2, var6); + + if (!var7.equals(var7.toLowerCase())) { + this.logNameNotLowercase(var7); + } else { + var1.add(var7.substring(0, var7.length() - 1)); + } + } + } + + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java new file mode 100644 index 0000000..b2bcbe2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/FoliageColorReloadListener.java @@ -0,0 +1,18 @@ +package net.minecraft.client.resources; + +import java.io.IOException; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ColorizerFoliage; + +public class FoliageColorReloadListener implements IResourceManagerReloadListener { + private static final ResourceLocation field_130079_a = new ResourceLocation("textures/colormap/foliage.png"); + + + public void onResourceManagerReload(IResourceManager p_110549_1_) { + try { + ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(p_110549_1_, field_130079_a)); + } catch (IOException var3) { + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java new file mode 100644 index 0000000..0d71dd8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/GrassColorReloadListener.java @@ -0,0 +1,18 @@ +package net.minecraft.client.resources; + +import java.io.IOException; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ColorizerGrass; + +public class GrassColorReloadListener implements IResourceManagerReloadListener { + private static final ResourceLocation field_130078_a = new ResourceLocation("textures/colormap/grass.png"); + + + public void onResourceManagerReload(IResourceManager p_110549_1_) { + try { + ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(p_110549_1_, field_130078_a)); + } catch (IOException var3) { + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/I18n.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/I18n.java new file mode 100644 index 0000000..b7535c1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/I18n.java @@ -0,0 +1,22 @@ +package net.minecraft.client.resources; + +import java.util.Map; + +public class I18n { + private static Locale i18nLocale; + + static void setLocale(Locale par0Locale) { + i18nLocale = par0Locale; + } + + /** + * format(a, b) is equivalent to String.format(translate(a), b). Args: translationKey, params... + */ + public static String format(String par0Str, Object ... par1ArrayOfObj) { + return i18nLocale.formatMessage(par0Str, par1ArrayOfObj); + } + + public static Map getLocaleProperties() { + return i18nLocale.field_135032_a; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java new file mode 100644 index 0000000..9ffa449 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IReloadableResourceManager.java @@ -0,0 +1,9 @@ +package net.minecraft.client.resources; + +import java.util.List; + +public interface IReloadableResourceManager extends IResourceManager { + void reloadResources(List p_110541_1_); + + void registerReloadListener(IResourceManagerReloadListener p_110542_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResource.java new file mode 100644 index 0000000..6475b75 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResource.java @@ -0,0 +1,12 @@ +package net.minecraft.client.resources; + +import java.io.InputStream; +import net.minecraft.client.resources.data.IMetadataSection; + +public interface IResource { + InputStream getInputStream(); + + boolean hasMetadata(); + + IMetadataSection getMetadata(String p_110526_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourceManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourceManager.java new file mode 100644 index 0000000..3680fd5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourceManager.java @@ -0,0 +1,14 @@ +package net.minecraft.client.resources; + +import java.io.IOException; +import java.util.List; +import java.util.Set; +import net.minecraft.util.ResourceLocation; + +public interface IResourceManager { + Set getResourceDomains(); + + IResource getResource(ResourceLocation p_110536_1_) throws IOException; + + List getAllResources(ResourceLocation p_135056_1_) throws IOException; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java new file mode 100644 index 0000000..0d75256 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourceManagerReloadListener.java @@ -0,0 +1,5 @@ +package net.minecraft.client.resources; + +public interface IResourceManagerReloadListener { + void onResourceManagerReload(IResourceManager p_110549_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourcePack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourcePack.java new file mode 100644 index 0000000..cad8943 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/IResourcePack.java @@ -0,0 +1,23 @@ +package net.minecraft.client.resources; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.Set; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +public interface IResourcePack { + InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException; + + boolean resourceExists(ResourceLocation p_110589_1_); + + Set getResourceDomains(); + + IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException; + + BufferedImage getPackImage(); + + String getPackName(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/Language.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/Language.java new file mode 100644 index 0000000..18b9ac2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/Language.java @@ -0,0 +1,44 @@ +package net.minecraft.client.resources; + +public class Language implements Comparable { + private final String languageCode; + private final String region; + private final String name; + private final boolean bidirectional; + + + public Language(String p_i1303_1_, String p_i1303_2_, String p_i1303_3_, boolean p_i1303_4_) { + this.languageCode = p_i1303_1_; + this.region = p_i1303_2_; + this.name = p_i1303_3_; + this.bidirectional = p_i1303_4_; + } + + public String getLanguageCode() { + return this.languageCode; + } + + public boolean isBidirectional() { + return this.bidirectional; + } + + public String toString() { + return String.format("%s (%s)", this.name, this.region); + } + + public boolean equals(Object p_equals_1_) { + return this == p_equals_1_ || (p_equals_1_ instanceof Language && this.languageCode.equals(((Language) p_equals_1_).languageCode)); + } + + public int hashCode() { + return this.languageCode.hashCode(); + } + + public int compareTo(Language p_compareTo_1_) { + return this.languageCode.compareTo(p_compareTo_1_.languageCode); + } + + public int compareTo(Object p_compareTo_1_) { + return this.compareTo((Language)p_compareTo_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/LanguageManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/LanguageManager.java new file mode 100644 index 0000000..312d9aa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/LanguageManager.java @@ -0,0 +1,91 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.LanguageMetadataSection; +import net.minecraft.util.StringTranslate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class LanguageManager implements IResourceManagerReloadListener { + private static final Logger logger = LogManager.getLogger(); + private final IMetadataSerializer theMetadataSerializer; + private String currentLanguage; + protected static final Locale currentLocale = new Locale(); + private final Map languageMap = Maps.newHashMap(); + + + public LanguageManager(IMetadataSerializer p_i1304_1_, String p_i1304_2_) { + this.theMetadataSerializer = p_i1304_1_; + this.currentLanguage = p_i1304_2_; + I18n.setLocale(currentLocale); + } + + public void parseLanguageMetadata(List p_135043_1_) { + this.languageMap.clear(); + Iterator var2 = p_135043_1_.iterator(); + + while (var2.hasNext()) { + IResourcePack var3 = (IResourcePack)var2.next(); + + try { + LanguageMetadataSection var4 = (LanguageMetadataSection)var3.getPackMetadata(this.theMetadataSerializer, "language"); + + if (var4 != null) { + Iterator var5 = var4.getLanguages().iterator(); + + while (var5.hasNext()) { + Language var6 = (Language)var5.next(); + + if (!this.languageMap.containsKey(var6.getLanguageCode())) { + this.languageMap.put(var6.getLanguageCode(), var6); + } + } + } + } catch (RuntimeException var7) { + logger.warn("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var7); + } catch (IOException var8) { + logger.warn("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var8); + } + } + } + + public void onResourceManagerReload(IResourceManager p_110549_1_) { + ArrayList var2 = Lists.newArrayList("en_US"); + + if (!"en_US".equals(this.currentLanguage)) { + var2.add(this.currentLanguage); + } + + currentLocale.loadLocaleDataFiles(p_110549_1_, var2); + StringTranslate.replaceWith(currentLocale.field_135032_a); + } + + public boolean isCurrentLocaleUnicode() { + return currentLocale.isUnicode(); + } + + public boolean isCurrentLanguageBidirectional() { + return this.getCurrentLanguage() != null && this.getCurrentLanguage().isBidirectional(); + } + + public void setCurrentLanguage(Language p_135045_1_) { + this.currentLanguage = p_135045_1_.getLanguageCode(); + } + + public Language getCurrentLanguage() { + return this.languageMap.containsKey(this.currentLanguage) ? (Language)this.languageMap.get(this.currentLanguage) : (Language)this.languageMap.get("en_US"); + } + + public SortedSet getLanguages() { + return Sets.newTreeSet(this.languageMap.values()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/Locale.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/Locale.java new file mode 100644 index 0000000..b914c03 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/Locale.java @@ -0,0 +1,126 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.io.InputStream; +import java.util.IllegalFormatException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +public class Locale { + /** Splits on "=" */ + private static final Splitter splitter = Splitter.on('=').limit(2); + private static final Pattern field_135031_c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + Map field_135032_a = Maps.newHashMap(); + private boolean field_135029_d; + + + /** + * par2 is a list of languages. For each language $L and domain $D, attempts to load the resource $D:lang/$L.lang + */ + public synchronized void loadLocaleDataFiles(IResourceManager p_135022_1_, List p_135022_2_) { + this.field_135032_a.clear(); + Iterator var3 = p_135022_2_.iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + String var5 = String.format("lang/%s.lang", var4); + Iterator var6 = p_135022_1_.getResourceDomains().iterator(); + + while (var6.hasNext()) { + String var7 = (String)var6.next(); + + try { + this.loadLocaleData(p_135022_1_.getAllResources(new ResourceLocation(var7, var5))); + } catch (IOException var9) { + } + } + } + + this.checkUnicode(); + } + + public boolean isUnicode() { + return this.field_135029_d; + } + + private void checkUnicode() { + this.field_135029_d = false; + int var1 = 0; + int var2 = 0; + Iterator var3 = this.field_135032_a.values().iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + int var5 = var4.length(); + var2 += var5; + + for (int var6 = 0; var6 < var5; ++var6) { + if (var4.charAt(var6) >= 256) { + ++var1; + } + } + } + + float var7 = (float)var1 / (float)var2; + this.field_135029_d = (double)var7 > 0.1D; + } + + /** + * par1 is a list of Resources + */ + private void loadLocaleData(List p_135028_1_) throws IOException { + Iterator var2 = p_135028_1_.iterator(); + + while (var2.hasNext()) { + IResource var3 = (IResource)var2.next(); + this.loadLocaleData(var3.getInputStream()); + } + } + + private void loadLocaleData(InputStream p_135021_1_) throws IOException { + Iterator var2 = IOUtils.readLines(p_135021_1_, Charsets.UTF_8).iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + + if (!var3.isEmpty() && var3.charAt(0) != 35) { + String[] var4 = Iterables.toArray(splitter.split(var3), String.class); + + if (var4 != null && var4.length == 2) { + String var5 = var4[0]; + String var6 = field_135031_c.matcher(var4[1]).replaceAll("%$1s"); + this.field_135032_a.put(var5, var6); + } + } + } + } + + /** + * Returns the translation, or the key itself if the key could not be translated. + */ + private String translateKeyPrivate(String p_135026_1_) { + String var2 = (String)this.field_135032_a.get(p_135026_1_); + return var2 == null ? p_135026_1_ : var2; + } + + /** + * Calls String.format(translateKey(key), params) + */ + public String formatMessage(String p_135023_1_, Object[] p_135023_2_) { + String var3 = this.translateKeyPrivate(p_135023_1_); + + try { + return String.format(var3, p_135023_2_); + } catch (IllegalFormatException var5) { + return "Format error: " + var3; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourceIndex.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourceIndex.java new file mode 100644 index 0000000..7d6a3cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourceIndex.java @@ -0,0 +1,63 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Charsets; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.JsonUtils; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ResourceIndex { + private static final Logger field_152783_a = LogManager.getLogger(); + private final Map field_152784_b = Maps.newHashMap(); + + + public ResourceIndex(File p_i1047_1_, String p_i1047_2_) { + if (p_i1047_2_ != null) { + File var3 = new File(p_i1047_1_, "objects"); + File var4 = new File(p_i1047_1_, "indexes/" + p_i1047_2_ + ".json"); + BufferedReader var5 = null; + + try { + var5 = Files.newReader(var4, Charsets.UTF_8); + JsonObject var6 = (new JsonParser()).parse(var5).getAsJsonObject(); + JsonObject var7 = JsonUtils.getJsonObjectFieldOrDefault(var6, "objects", null); + + if (var7 != null) { + Iterator var8 = var7.entrySet().iterator(); + + while (var8.hasNext()) { + Entry var9 = (Entry)var8.next(); + JsonObject var10 = (JsonObject)var9.getValue(); + String var11 = (String)var9.getKey(); + String[] var12 = var11.split("/", 2); + String var13 = var12.length == 1 ? var12[0] : var12[0] + ":" + var12[1]; + String var14 = JsonUtils.getJsonObjectStringFieldValue(var10, "hash"); + File var15 = new File(var3, var14.substring(0, 2) + "/" + var14); + this.field_152784_b.put(var13, var15); + } + } + } catch (JsonParseException var20) { + field_152783_a.error("Unable to parse resource index file: " + var4); + } catch (FileNotFoundException var21) { + field_152783_a.error("Can't find the resource index file: " + var4); + } finally { + IOUtils.closeQuietly(var5); + } + } + } + + public Map func_152782_a() { + return this.field_152784_b; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java new file mode 100644 index 0000000..12330c4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java @@ -0,0 +1,12 @@ +package net.minecraft.client.resources; + +import java.io.File; +import java.io.FileNotFoundException; + +public class ResourcePackFileNotFoundException extends FileNotFoundException { + + + public ResourcePackFileNotFoundException(File p_i1294_1_, String p_i1294_2_) { + super(String.format("'%s' in ResourcePack '%s'", p_i1294_2_, p_i1294_1_)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java new file mode 100644 index 0000000..b0f238e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntry.java @@ -0,0 +1,152 @@ +package net.minecraft.client.resources; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.gui.GuiScreenResourcePacks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public abstract class ResourcePackListEntry implements GuiListExtended.IGuiListEntry { + private static final ResourceLocation field_148316_c = new ResourceLocation("textures/gui/resource_packs.png"); + protected final Minecraft field_148317_a; + protected final GuiScreenResourcePacks field_148315_b; + + + public ResourcePackListEntry(GuiScreenResourcePacks p_i45051_1_) { + this.field_148315_b = p_i45051_1_; + this.field_148317_a = Minecraft.getMinecraft(); + } + + public void func_148279_a(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) { + this.func_148313_c(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 0.0F, 0.0F, 32, 32, 32.0F, 32.0F); + int var11; + + if ((this.field_148317_a.gameSettings.touchscreen || p_148279_9_) && this.func_148310_d()) { + this.field_148317_a.getTextureManager().bindTexture(field_148316_c); + Gui.drawRect(p_148279_2_, p_148279_3_, p_148279_2_ + 32, p_148279_3_ + 32, -1601138544); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int var10 = p_148279_7_ - p_148279_2_; + var11 = p_148279_8_ - p_148279_3_; + + if (this.func_148309_e()) { + if (var10 < 32) { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 0.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 0.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } else { + if (this.func_148308_f()) { + if (var10 < 16) { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 32.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 32.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.func_148314_g()) { + if (var10 < 32 && var10 > 16 && var11 < 16) { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 96.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 96.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.func_148307_h()) { + if (var10 < 32 && var10 > 16 && var11 > 16) { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 64.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } else { + Gui.drawModalRectWithCustomSizedTexture(p_148279_2_, p_148279_3_, 64.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + } + } + + String var14 = this.func_148312_b(); + var11 = this.field_148317_a.fontRenderer.getStringWidth(var14); + + if (var11 > 157) { + var14 = this.field_148317_a.fontRenderer.trimStringToWidth(var14, 157 - this.field_148317_a.fontRenderer.getStringWidth("...")) + "..."; + } + + this.field_148317_a.fontRenderer.drawStringWithShadow(var14, p_148279_2_ + 32 + 2, p_148279_3_ + 1, 16777215); + List var12 = this.field_148317_a.fontRenderer.listFormattedStringToWidth(this.func_148311_a(), 157); + + for (int var13 = 0; var13 < 2 && var13 < var12.size(); ++var13) { + this.field_148317_a.fontRenderer.drawStringWithShadow((String)var12.get(var13), p_148279_2_ + 32 + 2, p_148279_3_ + 12 + 10 * var13, 8421504); + } + } + + protected abstract String func_148311_a(); + + protected abstract String func_148312_b(); + + protected abstract void func_148313_c(); + + protected boolean func_148310_d() { + return true; + } + + protected boolean func_148309_e() { + return !this.field_148315_b.func_146961_a(this); + } + + protected boolean func_148308_f() { + return this.field_148315_b.func_146961_a(this); + } + + protected boolean func_148314_g() { + List var1 = this.field_148315_b.func_146962_b(this); + int var2 = var1.indexOf(this); + return var2 > 0 && ((ResourcePackListEntry)var1.get(var2 - 1)).func_148310_d(); + } + + protected boolean func_148307_h() { + List var1 = this.field_148315_b.func_146962_b(this); + int var2 = var1.indexOf(this); + return var2 >= 0 && var2 < var1.size() - 1 && ((ResourcePackListEntry)var1.get(var2 + 1)).func_148310_d(); + } + + public boolean func_148278_a(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) { + if (this.func_148310_d() && p_148278_5_ <= 32) { + if (this.func_148309_e()) { + this.field_148315_b.func_146962_b(this).remove(this); + this.field_148315_b.func_146963_h().add(0, this); + return true; + } + + if (p_148278_5_ < 16 && this.func_148308_f()) { + this.field_148315_b.func_146962_b(this).remove(this); + this.field_148315_b.func_146964_g().add(0, this); + return true; + } + + List var7; + int var8; + + if (p_148278_5_ > 16 && p_148278_6_ < 16 && this.func_148314_g()) { + var7 = this.field_148315_b.func_146962_b(this); + var8 = var7.indexOf(this); + var7.remove(this); + var7.add(var8 - 1, this); + return true; + } + + if (p_148278_5_ > 16 && p_148278_6_ > 16 && this.func_148307_h()) { + var7 = this.field_148315_b.func_146962_b(this); + var8 = var7.indexOf(this); + var7.remove(this); + var7.add(var8 + 1, this); + return true; + } + } + + return false; + } + + public void func_148277_b(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java new file mode 100644 index 0000000..a3d5818 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java @@ -0,0 +1,71 @@ +package net.minecraft.client.resources; + +import com.google.gson.JsonParseException; +import java.io.IOException; +import net.minecraft.client.gui.GuiScreenResourcePacks; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ResourcePackListEntryDefault extends ResourcePackListEntry { + private static final Logger logger = LogManager.getLogger(); + private final IResourcePack field_148320_d; + private final ResourceLocation field_148321_e; + + + public ResourcePackListEntryDefault(GuiScreenResourcePacks p_i45052_1_) { + super(p_i45052_1_); + this.field_148320_d = this.field_148317_a.getResourcePackRepository().rprDefaultResourcePack; + DynamicTexture var2; + var2 = new DynamicTexture(this.field_148320_d.getPackImage()); + this.field_148321_e = this.field_148317_a.getTextureManager().getDynamicTextureLocation("texturepackicon", var2); + } + + protected String func_148311_a() { + try { + PackMetadataSection var1 = (PackMetadataSection)this.field_148320_d.getPackMetadata(this.field_148317_a.getResourcePackRepository().rprMetadataSerializer, "pack"); + + if (var1 != null) { + return var1.func_152805_a().getFormattedText(); + } + } catch (JsonParseException var2) { + logger.error("Couldn't load metadata info", var2); + } catch (IOException var3) { + logger.error("Couldn't load metadata info", var3); + } + + return EnumChatFormatting.RED + "Missing " + "pack.mcmeta" + " :("; + } + + protected boolean func_148309_e() { + return false; + } + + protected boolean func_148308_f() { + return false; + } + + protected boolean func_148314_g() { + return false; + } + + protected boolean func_148307_h() { + return false; + } + + protected String func_148312_b() { + return "Default"; + } + + protected void func_148313_c() { + this.field_148317_a.getTextureManager().bindTexture(this.field_148321_e); + } + + protected boolean func_148310_d() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java new file mode 100644 index 0000000..12fac03 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackListEntryFound.java @@ -0,0 +1,29 @@ +package net.minecraft.client.resources; + +import net.minecraft.client.gui.GuiScreenResourcePacks; + +public class ResourcePackListEntryFound extends ResourcePackListEntry { + private final ResourcePackRepository.Entry field_148319_c; + + + public ResourcePackListEntryFound(GuiScreenResourcePacks p_i45053_1_, ResourcePackRepository.Entry p_i45053_2_) { + super(p_i45053_1_); + this.field_148319_c = p_i45053_2_; + } + + protected void func_148313_c() { + this.field_148319_c.bindTexturePackIcon(this.field_148317_a.getTextureManager()); + } + + protected String func_148311_a() { + return this.field_148319_c.getTexturePackDescription(); + } + + protected String func_148312_b() { + return this.field_148319_c.getResourcePackName(); + } + + public ResourcePackRepository.Entry func_148318_i() { + return this.field_148319_c; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java new file mode 100644 index 0000000..77994e3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/ResourcePackRepository.java @@ -0,0 +1,249 @@ +package net.minecraft.client.resources; + +import com.cheatbreaker.client.module.impl.packmanager.utils.PackUtils; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreenWorking; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.HttpUtil; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; + +import java.awt.image.BufferedImage; +import java.io.Closeable; +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.*; + +public class ResourcePackRepository { + protected static final FileFilter resourcePackFilter = new FileFilter() { + + public boolean accept(File p_accept_1_) { + boolean var2 = p_accept_1_.isFile() && p_accept_1_.getName().endsWith(".zip"); + boolean var3 = p_accept_1_.isDirectory() && (new File(p_accept_1_, "pack.mcmeta")).isFile(); + return var2 || var3; + } + }; + private final File dirResourcepacks; + public final IResourcePack rprDefaultResourcePack; + private final File field_148534_e; + public final IMetadataSerializer rprMetadataSerializer; + private IResourcePack field_148532_f; + private boolean field_148533_g; + private List repositoryEntriesAll = Lists.newArrayList(); + private final List repositoryEntries = Lists.newArrayList(); + + + public ResourcePackRepository(File p_i45101_1_, File p_i45101_2_, IResourcePack p_i45101_3_, IMetadataSerializer p_i45101_4_, GameSettings p_i45101_5_) { + this.dirResourcepacks = p_i45101_1_; + this.field_148534_e = p_i45101_2_; + this.rprDefaultResourcePack = p_i45101_3_; + this.rprMetadataSerializer = p_i45101_4_; + this.fixDirResourcepacks(); + this.updateRepositoryEntriesAll(); + Iterator var6 = p_i45101_5_.resourcePacks.iterator(); + + while (var6.hasNext()) { + String var7 = (String)var6.next(); + Iterator var8 = this.repositoryEntriesAll.iterator(); + + while (var8.hasNext()) { + ResourcePackRepository.Entry var9 = (ResourcePackRepository.Entry)var8.next(); + + if (var9.getResourcePackName().equals(var7)) { + this.repositoryEntries.add(var9); + break; + } + } + } + } + + private void fixDirResourcepacks() { + if (!this.dirResourcepacks.isDirectory()) { + this.dirResourcepacks.delete(); + this.dirResourcepacks.mkdirs(); + } + } + + private List getResourcePackFiles() { + return this.dirResourcepacks.isDirectory() ? Arrays.asList(this.dirResourcepacks.listFiles(resourcePackFilter)) : Collections.emptyList(); + } + + public void updateRepositoryEntriesAll() { + ArrayList var1 = Lists.newArrayList(); + Iterator var2 = this.getResourcePackFiles().iterator(); + + while (var2.hasNext()) { + File var3 = (File)var2.next(); + ResourcePackRepository.Entry var4 = new ResourcePackRepository.Entry(var3, null); + + if (!this.repositoryEntriesAll.contains(var4)) { + try { + if (PackUtils.isResourcePack(var4.resourcePackFile)) { + var4.updateResourcePack(); + var1.add(var4); + } + } catch (Exception var6) { + var1.remove(var4); + } + } else { + int var5 = this.repositoryEntriesAll.indexOf(var4); + + if (var5 > -1 && var5 < this.repositoryEntriesAll.size()) { + var1.add(this.repositoryEntriesAll.get(var5)); + } + } + } + + this.repositoryEntriesAll.removeAll(var1); + var2 = this.repositoryEntriesAll.iterator(); + + while (var2.hasNext()) { + ResourcePackRepository.Entry var7 = (ResourcePackRepository.Entry)var2.next(); + var7.closeResourcePack(); + } + + this.repositoryEntriesAll = var1; + } + + public List getRepositoryEntriesAll() { + return ImmutableList.copyOf(this.repositoryEntriesAll); + } + + public List getRepositoryEntries() { + return ImmutableList.copyOf(this.repositoryEntries); + } + + public void setRepositories(List p_148527_1_) { + this.repositoryEntries.clear(); + this.repositoryEntries.addAll(p_148527_1_); + } + + public File getDirResourcepacks() { + return this.dirResourcepacks; + } + + public void func_148526_a(String p_148526_1_) { + String var2 = p_148526_1_.substring(p_148526_1_.lastIndexOf("/") + 1); + + if (var2.contains("?")) { + var2 = var2.substring(0, var2.indexOf("?")); + } + + if (var2.endsWith(".zip")) { + File var3 = new File(this.field_148534_e, var2.replaceAll("\\W", "")); + this.func_148529_f(); + this.func_148528_a(p_148526_1_, var3); + } + } + + private void func_148528_a(String p_148528_1_, File p_148528_2_) { + HashMap var3 = Maps.newHashMap(); + GuiScreenWorking var4 = new GuiScreenWorking(); + var3.put("X-Minecraft-Username", Minecraft.getMinecraft().getSession().getUsername()); + var3.put("X-Minecraft-UUID", Minecraft.getMinecraft().getSession().getPlayerID()); + var3.put("X-Minecraft-Version", "1.7.10"); + this.field_148533_g = true; + Minecraft.getMinecraft().displayGuiScreen(var4); + HttpUtil.func_151223_a(p_148528_2_, p_148528_1_, new HttpUtil.DownloadListener() { + + public void func_148522_a(File p_148522_1_) { + if (ResourcePackRepository.this.field_148533_g) { + ResourcePackRepository.this.field_148533_g = false; + ResourcePackRepository.this.field_148532_f = new FileResourcePack(p_148522_1_); + Minecraft.getMinecraft().scheduleResourcesRefresh(); + } + } + }, var3, 52428800, var4, Minecraft.getMinecraft().getProxy()); + } + + public IResourcePack func_148530_e() { + return this.field_148532_f; + } + + public void func_148529_f() { + this.field_148532_f = null; + this.field_148533_g = false; + } + + public class Entry { + private final File resourcePackFile; + private IResourcePack reResourcePack; + private PackMetadataSection rePackMetadataSection; + private BufferedImage texturePackIcon; + private ResourceLocation locationTexturePackIcon; + + + private Entry(File p_i1295_2_) { + this.resourcePackFile = p_i1295_2_; + } + + public void updateResourcePack() { + this.reResourcePack = this.resourcePackFile.isDirectory() ? new FolderResourcePack(this.resourcePackFile) : new FileResourcePack(this.resourcePackFile); + try { + this.rePackMetadataSection = (PackMetadataSection)this.reResourcePack.getPackMetadata(ResourcePackRepository.this.rprMetadataSerializer, "pack"); + } catch (IOException e) { + e.printStackTrace(); + } + + this.texturePackIcon = this.reResourcePack.getPackImage(); + + if (this.texturePackIcon == null) { + this.texturePackIcon = ResourcePackRepository.this.rprDefaultResourcePack.getPackImage(); + } + + this.closeResourcePack(); + } + + public void bindTexturePackIcon(TextureManager p_110518_1_) { + if (this.locationTexturePackIcon == null) { + this.locationTexturePackIcon = p_110518_1_.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.texturePackIcon)); + } + + p_110518_1_.bindTexture(this.locationTexturePackIcon); + } + + public void closeResourcePack() { + if (this.reResourcePack instanceof Closeable) { + IOUtils.closeQuietly((Closeable)this.reResourcePack); + } + } + + public IResourcePack getResourcePack() { + return this.reResourcePack; + } + + public String getResourcePackName() { + return this.reResourcePack.getPackName(); + } + + public String getTexturePackDescription() { + return this.rePackMetadataSection == null ? EnumChatFormatting.RED + + "Invalid pack.mcmeta (or missing 'pack' section)" : this.rePackMetadataSection.func_152805_a().getFormattedText(); + } + + public boolean equals(Object p_equals_1_) { + return this == p_equals_1_ || (p_equals_1_ instanceof Entry && this.toString().equals(p_equals_1_.toString())); + } + + public int hashCode() { + return this.toString().hashCode(); + } + + public String toString() { + return String.format("%s:%s:%d", this.resourcePackFile.getName(), this.resourcePackFile.isDirectory() ? "folder" : "zip", Long.valueOf(this.resourcePackFile.lastModified())); + } + + Entry(File p_i1296_2_, Object p_i1296_3_) { + this(p_i1296_2_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java new file mode 100644 index 0000000..fc65298 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java @@ -0,0 +1,152 @@ +package net.minecraft.client.resources; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.src.Config; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class SimpleReloadableResourceManager implements IReloadableResourceManager { + private static final Logger logger = LogManager.getLogger(); + private static final Joiner joinerResourcePacks = Joiner.on(", "); + private final Map domainResourceManagers = Maps.newHashMap(); + private final List reloadListeners = Lists.newArrayList(); + private final Set setResourceDomains = Sets.newLinkedHashSet(); + private final IMetadataSerializer rmMetadataSerializer; + + + public SimpleReloadableResourceManager(IMetadataSerializer p_i1299_1_) { + this.rmMetadataSerializer = p_i1299_1_; + } + + public void reloadResourcePack(IResourcePack p_110545_1_) { + FallbackResourceManager var4; + + for (Iterator var2 = p_110545_1_.getResourceDomains().iterator(); var2.hasNext(); var4.addResourcePack(p_110545_1_)) { + String var3 = (String)var2.next(); + this.setResourceDomains.add(var3); + var4 = (FallbackResourceManager)this.domainResourceManagers.get(var3); + + if (var4 == null) { + var4 = new FallbackResourceManager(this.rmMetadataSerializer); + this.domainResourceManagers.put(var3, var4); + } + } + } + + public Set getResourceDomains() { + return this.setResourceDomains; + } + + public IResource getResource(ResourceLocation p_110536_1_) throws IOException { + IResourceManager var2 = (IResourceManager)this.domainResourceManagers.get(p_110536_1_.getResourceDomain()); + + if (var2 != null) { + return var2.getResource(p_110536_1_); + } else { + throw new FileNotFoundException(p_110536_1_.toString()); + } + } + + public List getAllResources(ResourceLocation p_135056_1_) throws IOException { + IResourceManager var2 = (IResourceManager)this.domainResourceManagers.get(p_135056_1_.getResourceDomain()); + + if (var2 != null) { + return var2.getAllResources(p_135056_1_); + } else { + throw new FileNotFoundException(p_135056_1_.toString()); + } + } + + private void clearResources() { + this.domainResourceManagers.clear(); + this.setResourceDomains.clear(); + } + + public void reloadResources(List p_110541_1_) { + this.clearResources(); + logger.info("Reloading ResourceManager: " + joinerResourcePacks.join(Iterables.transform(p_110541_1_, new Function() { + + public String apply(IResourcePack p_apply_1_) { + return p_apply_1_.getPackName(); + } + public Object apply(Object p_apply_1_) { + return this.apply((IResourcePack)p_apply_1_); + } + }))); + Iterator var2 = p_110541_1_.iterator(); + + while (var2.hasNext()) { + IResourcePack var3 = (IResourcePack)var2.next(); + this.reloadResourcePack(var3); + } + + updatepack(); + this.notifyReloadListeners(); + } + + public void registerReloadListener(IResourceManagerReloadListener p_110542_1_) { + this.reloadListeners.add(p_110542_1_); + p_110542_1_.onResourceManagerReload(this); + } + + private void notifyReloadListeners() { + Iterator var1 = this.reloadListeners.iterator(); + + while (var1.hasNext()) { + IResourceManagerReloadListener var2 = (IResourceManagerReloadListener)var1.next(); + var2.onResourceManagerReload(this); + } + } + + /** + * Last two classes are for the Pack Display Mod. + */ + public static void updatepack() { + if (CheatBreaker.getInstance() == null) { + return; + } + DynamicTexture texture; + texture = new DynamicTexture(getResourcePack().getPackImage()); + CheatBreaker.icontexture = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("texturepackicon", texture); + } + + public static IResourcePack getResourcePack() { + IResourcePack[] rps = Config.getResourcePacks(); + + if (rps.length <= 0) { + return Config.getDefaultResourcePack(); + } else { + IResourcePack[] names = new IResourcePack[rps.length]; + + System.arraycopy(rps, 0, names, 0, rps.length); + try { + if (CheatBreaker.getInstance().getModuleManager().packDisplayMod.order.getValue().equals("Bottom")) { + return names[0]; + } else if (CheatBreaker.getInstance().getModuleManager().packDisplayMod.order.getValue().equals("Rotate")) { + return names[CheatBreaker.getInstance().getModuleManager().packDisplayMod.currentPack]; + } + return names[names.length -1]; + } catch (Exception e) { + return names[names.length -1]; + } + + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SimpleResource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SimpleResource.java new file mode 100644 index 0000000..7121114 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SimpleResource.java @@ -0,0 +1,81 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Maps; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Map; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; + +public class SimpleResource implements IResource { + private final Map mapMetadataSections = Maps.newHashMap(); + private final ResourceLocation srResourceLocation; + private final InputStream resourceInputStream; + private final InputStream mcmetaInputStream; + private final IMetadataSerializer srMetadataSerializer; + private boolean mcmetaJsonChecked; + private JsonObject mcmetaJson; + + + public SimpleResource(ResourceLocation p_i1300_1_, InputStream p_i1300_2_, InputStream p_i1300_3_, IMetadataSerializer p_i1300_4_) { + this.srResourceLocation = p_i1300_1_; + this.resourceInputStream = p_i1300_2_; + this.mcmetaInputStream = p_i1300_3_; + this.srMetadataSerializer = p_i1300_4_; + } + + public InputStream getInputStream() { + return this.resourceInputStream; + } + + public boolean hasMetadata() { + return this.mcmetaInputStream != null; + } + + public IMetadataSection getMetadata(String p_110526_1_) { + if (!this.hasMetadata()) { + return null; + } else { + if (this.mcmetaJson == null && !this.mcmetaJsonChecked) { + this.mcmetaJsonChecked = true; + BufferedReader var2 = null; + + try { + var2 = new BufferedReader(new InputStreamReader(this.mcmetaInputStream)); + this.mcmetaJson = (new JsonParser()).parse(var2).getAsJsonObject(); + } + finally { + IOUtils.closeQuietly(var2); + } + } + + IMetadataSection var6 = (IMetadataSection)this.mapMetadataSections.get(p_110526_1_); + + if (var6 == null) { + var6 = this.srMetadataSerializer.parseMetadataSection(p_110526_1_, this.mcmetaJson); + } + + return var6; + } + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (p_equals_1_ instanceof SimpleResource) { + SimpleResource var2 = (SimpleResource)p_equals_1_; + return this.srResourceLocation != null ? this.srResourceLocation.equals(var2.srResourceLocation) : var2.srResourceLocation == null; + } else { + return false; + } + } + + public int hashCode() { + return this.srResourceLocation == null ? 0 : this.srResourceLocation.hashCode(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SkinManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SkinManager.java new file mode 100644 index 0000000..1bf578c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/SkinManager.java @@ -0,0 +1,131 @@ +package net.minecraft.client.resources; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.InsecureTextureException; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.IImageBuffer; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +public class SkinManager { + public static final ResourceLocation field_152793_a = new ResourceLocation("textures/entity/steve.png"); + private static final ExecutorService field_152794_b = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue()); + private final TextureManager field_152795_c; + private final File field_152796_d; + private final MinecraftSessionService field_152797_e; + private final LoadingCache field_152798_f; + + + public SkinManager(TextureManager p_i1044_1_, File p_i1044_2_, MinecraftSessionService p_i1044_3_) { + this.field_152795_c = p_i1044_1_; + this.field_152796_d = p_i1044_2_; + this.field_152797_e = p_i1044_3_; + this.field_152798_f = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).build(new CacheLoader() { + + public Map func_152786_a(GameProfile p_152786_1_) { + return Minecraft.getMinecraft().func_152347_ac().getTextures(p_152786_1_, false); + } + public Object load(Object p_load_1_) { + return this.func_152786_a((GameProfile)p_load_1_); + } + }); + } + + public ResourceLocation func_152792_a(MinecraftProfileTexture p_152792_1_, Type p_152792_2_) { + return this.func_152789_a(p_152792_1_, p_152792_2_, null); + } + + public ResourceLocation func_152789_a(MinecraftProfileTexture p_152789_1_, final Type p_152789_2_, final SkinManager.SkinAvailableCallback p_152789_3_) { + final ResourceLocation var4 = new ResourceLocation("skins/" + p_152789_1_.getHash()); + ITextureObject var5 = this.field_152795_c.getTexture(var4); + + if (var5 != null) { + if (p_152789_3_ != null) { + p_152789_3_.func_152121_a(p_152789_2_, var4); + } + } else { + File var6 = new File(this.field_152796_d, p_152789_1_.getHash().substring(0, 2)); + File var7 = new File(var6, p_152789_1_.getHash()); + final ImageBufferDownload var8 = p_152789_2_ == Type.SKIN ? new ImageBufferDownload() : null; + ThreadDownloadImageData var9 = new ThreadDownloadImageData(var7, p_152789_1_.getUrl(), field_152793_a, new IImageBuffer() { + + public BufferedImage parseUserSkin(BufferedImage p_78432_1_) { + if (var8 != null) { + p_78432_1_ = var8.parseUserSkin(p_78432_1_); + } + + return p_78432_1_; + } + public void func_152634_a() { + if (var8 != null) { + var8.func_152634_a(); + } + + if (p_152789_3_ != null) { + p_152789_3_.func_152121_a(p_152789_2_, var4); + } + } + }); + this.field_152795_c.loadTexture(var4, var9); + } + + return var4; + } + + public void func_152790_a(final GameProfile p_152790_1_, final SkinManager.SkinAvailableCallback p_152790_2_, final boolean p_152790_3_) { + field_152794_b.submit(new Runnable() { + + public void run() { + final HashMap var1 = Maps.newHashMap(); + + try { + var1.putAll(SkinManager.this.field_152797_e.getTextures(p_152790_1_, p_152790_3_)); + } catch (InsecureTextureException var3) { + } + + if (var1.isEmpty() && p_152790_1_.getId().equals(Minecraft.getMinecraft().getSession().func_148256_e().getId())) { + var1.putAll(SkinManager.this.field_152797_e.getTextures(SkinManager.this.field_152797_e.fillProfileProperties(p_152790_1_, false), false)); + } + + Minecraft.getMinecraft().func_152344_a(new Runnable() { + + public void run() { + if (var1.containsKey(Type.SKIN)) { + SkinManager.this.func_152789_a((MinecraftProfileTexture)var1.get(Type.SKIN), Type.SKIN, p_152790_2_); + } + + if (var1.containsKey(Type.CAPE)) { + SkinManager.this.func_152789_a((MinecraftProfileTexture)var1.get(Type.CAPE), Type.CAPE, p_152790_2_); + } + } + }); + } + }); + } + + public Map func_152788_a(GameProfile p_152788_1_) { + return (Map)this.field_152798_f.getUnchecked(p_152788_1_); + } + + public interface SkinAvailableCallback { + void func_152121_a(Type p_152121_1_, ResourceLocation p_152121_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java new file mode 100644 index 0000000..01ac307 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationFrame.java @@ -0,0 +1,28 @@ +package net.minecraft.client.resources.data; + +public class AnimationFrame { + private final int frameIndex; + private final int frameTime; + + + public AnimationFrame(int p_i1307_1_) { + this(p_i1307_1_, -1); + } + + public AnimationFrame(int p_i1308_1_, int p_i1308_2_) { + this.frameIndex = p_i1308_1_; + this.frameTime = p_i1308_2_; + } + + public boolean hasNoTime() { + return this.frameTime == -1; + } + + public int getFrameTime() { + return this.frameTime; + } + + public int getFrameIndex() { + return this.frameIndex; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java new file mode 100644 index 0000000..3d7acb5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSection.java @@ -0,0 +1,67 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Sets; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +public class AnimationMetadataSection implements IMetadataSection { + private final List animationFrames; + private final int frameWidth; + private final int frameHeight; + private final int frameTime; + + + public AnimationMetadataSection(List p_i1309_1_, int p_i1309_2_, int p_i1309_3_, int p_i1309_4_) { + this.animationFrames = p_i1309_1_; + this.frameWidth = p_i1309_2_; + this.frameHeight = p_i1309_3_; + this.frameTime = p_i1309_4_; + } + + public int getFrameHeight() { + return this.frameHeight; + } + + public int getFrameWidth() { + return this.frameWidth; + } + + public int getFrameCount() { + return this.animationFrames.size(); + } + + public int getFrameTime() { + return this.frameTime; + } + + private AnimationFrame getAnimationFrame(int p_130072_1_) { + return (AnimationFrame)this.animationFrames.get(p_130072_1_); + } + + public int getFrameTimeSingle(int p_110472_1_) { + AnimationFrame var2 = this.getAnimationFrame(p_110472_1_); + return var2.hasNoTime() ? this.frameTime : var2.getFrameTime(); + } + + public boolean frameHasTime(int p_110470_1_) { + return !((AnimationFrame)this.animationFrames.get(p_110470_1_)).hasNoTime(); + } + + public int getFrameIndex(int p_110468_1_) { + return ((AnimationFrame)this.animationFrames.get(p_110468_1_)).getFrameIndex(); + } + + public Set getFrameIndexSet() { + HashSet var1 = Sets.newHashSet(); + Iterator var2 = this.animationFrames.iterator(); + + while (var2.hasNext()) { + AnimationFrame var3 = (AnimationFrame)var2.next(); + var1.add(Integer.valueOf(var3.getFrameIndex())); + } + + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java new file mode 100644 index 0000000..774def3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java @@ -0,0 +1,123 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import java.util.ArrayList; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +public class AnimationMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer { + + + public AnimationMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + ArrayList var4 = Lists.newArrayList(); + JsonObject var5 = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "metadata section"); + int var6 = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(var5, "frametime", 1); + + if (var6 != 1) { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(var6), "Invalid default frame time", new Object[0]); + } + + int var8; + + if (var5.has("frames")) { + try { + JsonArray var7 = JsonUtils.getJsonObjectJsonArrayField(var5, "frames"); + + for (var8 = 0; var8 < var7.size(); ++var8) { + JsonElement var9 = var7.get(var8); + AnimationFrame var10 = this.parseAnimationFrame(var8, var9); + + if (var10 != null) { + var4.add(var10); + } + } + } catch (ClassCastException var11) { + throw new JsonParseException("Invalid animation->frames: expected array, was " + var5.get("frames"), var11); + } + } + + int var12 = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(var5, "width", -1); + var8 = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(var5, "height", -1); + + if (var12 != -1) { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(var12), "Invalid width", new Object[0]); + } + + if (var8 != -1) { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(var8), "Invalid height", new Object[0]); + } + + return new AnimationMetadataSection(var4, var12, var8, var6); + } + + private AnimationFrame parseAnimationFrame(int p_110492_1_, JsonElement p_110492_2_) { + if (p_110492_2_.isJsonPrimitive()) { + return new AnimationFrame(JsonUtils.getJsonElementIntegerValue(p_110492_2_, "frames[" + p_110492_1_ + "]")); + } else if (p_110492_2_.isJsonObject()) { + JsonObject var3 = JsonUtils.getJsonElementAsJsonObject(p_110492_2_, "frames[" + p_110492_1_ + "]"); + int var4 = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(var3, "time", -1); + + if (var3.has("time")) { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(var4), "Invalid frame time", new Object[0]); + } + + int var5 = JsonUtils.getJsonObjectIntegerFieldValue(var3, "index"); + Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(var5), "Invalid frame index", new Object[0]); + return new AnimationFrame(var5, var4); + } else { + return null; + } + } + + public JsonElement serialize(AnimationMetadataSection p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + JsonObject var4 = new JsonObject(); + var4.addProperty("frametime", Integer.valueOf(p_serialize_1_.getFrameTime())); + + if (p_serialize_1_.getFrameWidth() != -1) { + var4.addProperty("width", Integer.valueOf(p_serialize_1_.getFrameWidth())); + } + + if (p_serialize_1_.getFrameHeight() != -1) { + var4.addProperty("height", Integer.valueOf(p_serialize_1_.getFrameHeight())); + } + + if (p_serialize_1_.getFrameCount() > 0) { + JsonArray var5 = new JsonArray(); + + for (int var6 = 0; var6 < p_serialize_1_.getFrameCount(); ++var6) { + if (p_serialize_1_.frameHasTime(var6)) { + JsonObject var7 = new JsonObject(); + var7.addProperty("index", Integer.valueOf(p_serialize_1_.getFrameIndex(var6))); + var7.addProperty("time", Integer.valueOf(p_serialize_1_.getFrameTimeSingle(var6))); + var5.add(var7); + } else { + var5.add(new JsonPrimitive(Integer.valueOf(p_serialize_1_.getFrameIndex(var6)))); + } + } + + var4.add("frames", var5); + } + + return var4; + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() { + return "animation"; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.serialize((AnimationMetadataSection)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java new file mode 100644 index 0000000..ca1b750 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java @@ -0,0 +1,5 @@ +package net.minecraft.client.resources.data; + +public abstract class BaseMetadataSectionSerializer implements IMetadataSectionSerializer { + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java new file mode 100644 index 0000000..3530c83 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/FontMetadataSection.java @@ -0,0 +1,14 @@ +package net.minecraft.client.resources.data; + +public class FontMetadataSection implements IMetadataSection { + private final float[] charWidths; + private final float[] charLefts; + private final float[] charSpacings; + + + public FontMetadataSection(float[] p_i1310_1_, float[] p_i1310_2_, float[] p_i1310_3_) { + this.charWidths = p_i1310_1_; + this.charLefts = p_i1310_2_; + this.charSpacings = p_i1310_3_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java new file mode 100644 index 0000000..704fcc7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java @@ -0,0 +1,75 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +public class FontMetadataSectionSerializer extends BaseMetadataSectionSerializer { + + + public FontMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = p_deserialize_1_.getAsJsonObject(); + float[] var5 = new float[256]; + float[] var6 = new float[256]; + float[] var7 = new float[256]; + float var8 = 1.0F; + float var9 = 0.0F; + float var10 = 0.0F; + + if (var4.has("characters")) { + if (!var4.get("characters").isJsonObject()) { + throw new JsonParseException("Invalid font->characters: expected object, was " + var4.get("characters")); + } + + JsonObject var11 = var4.getAsJsonObject("characters"); + + if (var11.has("default")) { + if (!var11.get("default").isJsonObject()) { + throw new JsonParseException("Invalid font->characters->default: expected object, was " + var11.get("default")); + } + + JsonObject var12 = var11.getAsJsonObject("default"); + var8 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(var12, "width", var8); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(var8), "Invalid default width", new Object[0]); + var9 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(var12, "spacing", var9); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(var9), "Invalid default spacing", new Object[0]); + var10 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(var12, "left", var9); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(var10), "Invalid default left", new Object[0]); + } + + for (int var18 = 0; var18 < 256; ++var18) { + JsonElement var13 = var11.get(Integer.toString(var18)); + float var14 = var8; + float var15 = var9; + float var16 = var10; + + if (var13 != null) { + JsonObject var17 = JsonUtils.getJsonElementAsJsonObject(var13, "characters[" + var18 + "]"); + var14 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(var17, "width", var8); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(var14), "Invalid width", new Object[0]); + var15 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(var17, "spacing", var9); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(var15), "Invalid spacing", new Object[0]); + var16 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(var17, "left", var10); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(var16), "Invalid left", new Object[0]); + } + + var5[var18] = var14; + var6[var18] = var15; + var7[var18] = var16; + } + } + + return new FontMetadataSection(var5, var7, var6); + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() { + return "font"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java new file mode 100644 index 0000000..3ec46a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSection.java @@ -0,0 +1,4 @@ +package net.minecraft.client.resources.data; + +public interface IMetadataSection { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java new file mode 100644 index 0000000..e957e6b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java @@ -0,0 +1,10 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializer; + +public interface IMetadataSectionSerializer extends JsonDeserializer { + /** + * The name of this section type as it appears in JSON. + */ + String getSectionName(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java new file mode 100644 index 0000000..e522db1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/IMetadataSerializer.java @@ -0,0 +1,77 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumTypeAdapterFactory; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IRegistry; +import net.minecraft.util.RegistrySimple; + +public class IMetadataSerializer { + private final IRegistry metadataSectionSerializerRegistry = new RegistrySimple(); + private final GsonBuilder gsonBuilder = new GsonBuilder(); + + /** + * Cached Gson instance. Set to null when more sections are registered, and then re-created from the builder. + */ + private Gson gson; + + + public IMetadataSerializer() { + this.gsonBuilder.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()); + this.gsonBuilder.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()); + this.gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); + } + + public void registerMetadataSectionType(IMetadataSectionSerializer p_110504_1_, Class p_110504_2_) { + this.metadataSectionSerializerRegistry.putObject(p_110504_1_.getSectionName(), new IMetadataSerializer.Registration(p_110504_1_, p_110504_2_, null)); + this.gsonBuilder.registerTypeAdapter(p_110504_2_, p_110504_1_); + this.gson = null; + } + + public IMetadataSection parseMetadataSection(String p_110503_1_, JsonObject p_110503_2_) { + if (p_110503_1_ == null) { + throw new IllegalArgumentException("Metadata section name cannot be null"); + } else if (!p_110503_2_.has(p_110503_1_)) { + return null; + } else if (!p_110503_2_.get(p_110503_1_).isJsonObject()) { + throw new IllegalArgumentException("Invalid metadata for '" + p_110503_1_ + "' - expected object, found " + p_110503_2_.get(p_110503_1_)); + } else { + IMetadataSerializer.Registration var3 = (IMetadataSerializer.Registration)this.metadataSectionSerializerRegistry.getObject(p_110503_1_); + + if (var3 == null) { + throw new IllegalArgumentException("Don't know how to handle metadata section '" + p_110503_1_ + "'"); + } else { + return (IMetadataSection)this.getGson().fromJson(p_110503_2_.getAsJsonObject(p_110503_1_), var3.field_110500_b); + } + } + } + + /** + * Returns a Gson instance with type adapters registered for metadata sections. + */ + private Gson getGson() { + if (this.gson == null) { + this.gson = this.gsonBuilder.create(); + } + + return this.gson; + } + + class Registration { + final IMetadataSectionSerializer field_110502_a; + final Class field_110500_b; + + + private Registration(IMetadataSectionSerializer p_i1305_2_, Class p_i1305_3_) { + this.field_110502_a = p_i1305_2_; + this.field_110500_b = p_i1305_3_; + } + + Registration(IMetadataSectionSerializer p_i1306_2_, Class p_i1306_3_, Object p_i1306_4_) { + this(p_i1306_2_, p_i1306_3_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java new file mode 100644 index 0000000..0e8c541 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSection.java @@ -0,0 +1,16 @@ +package net.minecraft.client.resources.data; + +import java.util.Collection; + +public class LanguageMetadataSection implements IMetadataSection { + private final Collection languages; + + + public LanguageMetadataSection(Collection p_i1311_1_) { + this.languages = p_i1311_1_; + } + + public Collection getLanguages() { + return this.languages; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java new file mode 100644 index 0000000..e3ed010 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java @@ -0,0 +1,58 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Sets; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map.Entry; +import net.minecraft.client.resources.Language; +import net.minecraft.util.JsonUtils; + +public class LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer { + + + public LanguageMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = p_deserialize_1_.getAsJsonObject(); + HashSet var5 = Sets.newHashSet(); + Iterator var6 = var4.entrySet().iterator(); + String var8; + String var10; + String var11; + boolean var12; + + do { + if (!var6.hasNext()) { + return new LanguageMetadataSection(var5); + } + + Entry var7 = (Entry)var6.next(); + var8 = (String)var7.getKey(); + JsonObject var9 = JsonUtils.getJsonElementAsJsonObject((JsonElement)var7.getValue(), "language"); + var10 = JsonUtils.getJsonObjectStringFieldValue(var9, "region"); + var11 = JsonUtils.getJsonObjectStringFieldValue(var9, "name"); + var12 = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(var9, "bidirectional", false); + + if (var10.isEmpty()) { + throw new JsonParseException("Invalid language->'" + var8 + "'->region: empty value"); + } + + if (var11.isEmpty()) { + throw new JsonParseException("Invalid language->'" + var8 + "'->name: empty value"); + } + } + while (var5.add(new Language(var8, var10, var11, var12))); + + throw new JsonParseException("Duplicate language->'" + var8 + "' defined"); + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() { + return "language"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java new file mode 100644 index 0000000..a44399d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/PackMetadataSection.java @@ -0,0 +1,22 @@ +package net.minecraft.client.resources.data; + +import net.minecraft.util.IChatComponent; + +public class PackMetadataSection implements IMetadataSection { + private final IChatComponent packDescription; + private final int packFormat; + + + public PackMetadataSection(IChatComponent p_i1034_1_, int p_i1034_2_) { + this.packDescription = p_i1034_1_; + this.packFormat = p_i1034_2_; + } + + public IChatComponent func_152805_a() { + return this.packDescription; + } + + public int getPackFormat() { + return this.packFormat; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java new file mode 100644 index 0000000..c89b7e1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java @@ -0,0 +1,39 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; + +public class PackMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer { + + + public PackMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = p_deserialize_1_.getAsJsonObject(); + IChatComponent var5 = p_deserialize_3_.deserialize(var4.get("description"), IChatComponent.class); + int var6 = JsonUtils.getJsonObjectIntegerFieldValue(var4, "pack_format"); + return new PackMetadataSection(var5, var6); + } + + public JsonElement serialize(PackMetadataSection p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + JsonObject var4 = new JsonObject(); + var4.addProperty("pack_format", Integer.valueOf(p_serialize_1_.getPackFormat())); + var4.add("description", p_serialize_3_.serialize(p_serialize_1_.func_152805_a())); + return var4; + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() { + return "pack"; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.serialize((PackMetadataSection)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java new file mode 100644 index 0000000..c7f85b9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/TextureMetadataSection.java @@ -0,0 +1,29 @@ +package net.minecraft.client.resources.data; + +import java.util.Collections; +import java.util.List; + +public class TextureMetadataSection implements IMetadataSection { + private final boolean textureBlur; + private final boolean textureClamp; + private final List field_148536_c; + + + public TextureMetadataSection(boolean p_i45102_1_, boolean p_i45102_2_, List p_i45102_3_) { + this.textureBlur = p_i45102_1_; + this.textureClamp = p_i45102_2_; + this.field_148536_c = p_i45102_3_; + } + + public boolean getTextureBlur() { + return this.textureBlur; + } + + public boolean getTextureClamp() { + return this.textureClamp; + } + + public List func_148535_c() { + return Collections.unmodifiableList(this.field_148536_c); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java new file mode 100644 index 0000000..9a72a7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java @@ -0,0 +1,53 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import java.util.ArrayList; +import net.minecraft.util.JsonUtils; + +public class TextureMetadataSectionSerializer extends BaseMetadataSectionSerializer { + + + public TextureMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = p_deserialize_1_.getAsJsonObject(); + boolean var5 = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(var4, "blur", false); + boolean var6 = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(var4, "clamp", false); + ArrayList var7 = Lists.newArrayList(); + + if (var4.has("mipmaps")) { + try { + JsonArray var8 = var4.getAsJsonArray("mipmaps"); + + for (int var9 = 0; var9 < var8.size(); ++var9) { + JsonElement var10 = var8.get(var9); + + if (var10.isJsonPrimitive()) { + try { + var7.add(Integer.valueOf(var10.getAsInt())); + } catch (NumberFormatException var12) { + throw new JsonParseException("Invalid texture->mipmap->" + var9 + ": expected number, was " + var10, var12); + } + } else if (var10.isJsonObject()) { + throw new JsonParseException("Invalid texture->mipmap->" + var9 + ": expected number, was " + var10); + } + } + } catch (ClassCastException var13) { + throw new JsonParseException("Invalid texture->mipmaps: expected array, was " + var4.get("mipmaps"), var13); + } + } + + return new TextureMetadataSection(var5, var6, var7); + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() { + return "texture"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/settings/GameSettings.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/settings/GameSettings.java new file mode 100644 index 0000000..7ec4417 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/settings/GameSettings.java @@ -0,0 +1,2872 @@ +package net.minecraft.client.settings; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer.EnumChatVisibility; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.src.*; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import shadersmod.client.Shaders; + +import java.io.*; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +public class GameSettings { + private static final Logger logger = LogManager.getLogger(); + private static final Gson gson = new Gson(); + private static final ParameterizedType typeListString = new ParameterizedType() { + public Type[] getActualTypeArguments() { + return new Type[] {String.class}; + } + public Type getRawType() { + return List.class; + } + public Type getOwnerType() { + return null; + } + }; + + /** GUI scale values */ + private static final String[] GUISCALES = new String[] {"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; + private static final String[] PARTICLES = new String[] {"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; + private static final String[] AMBIENT_OCCLUSIONS = new String[] {"options.ao.off", "options.ao.min", "options.ao.max"}; + private static final String[] field_152391_aS = new String[] {"options.stream.compression.low", "options.stream.compression.medium", "options.stream.compression.high"}; + private static final String[] field_152392_aT = new String[] {"options.stream.chat.enabled.streaming", "options.stream.chat.enabled.always", "options.stream.chat.enabled.never"}; + private static final String[] field_152393_aU = new String[] {"options.stream.chat.userFilter.all", "options.stream.chat.userFilter.subs", "options.stream.chat.userFilter.mods"}; + private static final String[] field_152394_aV = new String[] {"options.stream.mic_toggle.mute", "options.stream.mic_toggle.talk"}; + public float mouseSensitivity = 0.5F; + public boolean invertMouse; + public int renderDistanceChunks = -1; + public boolean viewBobbing = true; + public boolean anaglyph; + + /** Advanced OpenGL */ + public boolean advancedOpengl; + public boolean fboEnable = true; + public int limitFramerate = 120; + public boolean fancyGraphics = true; + + /** Smooth Lighting */ + public int ambientOcclusion = 2; + public int ofFogType = 1; + public float ofFogStart = 0.8F; + public int ofMipmapType = 0; + public boolean ofLoadFar = false; + public int ofPreloadedChunks = 0; + public boolean ofOcclusionFancy = false; + public boolean ofSmoothFps = false; + public boolean ofSmoothWorld = Config.isSingleProcessor(); + public boolean ofLazyChunkLoading = Config.isSingleProcessor(); + public float ofAoLevel = 1.0F; + public int ofAaLevel = 0; + public int ofClouds = 0; + public float ofCloudsHeight = 0.0F; + public int ofTrees = 0; + public int ofGrass = 0; + public int ofRain = 0; + public int ofWater = 0; + public int ofDroppedItems = 0; + public int ofBetterGrass = 3; + public int ofAutoSaveTicks = 4000; + public boolean ofLagometer = false; + public boolean ofProfiler = false; + public boolean ofShowFps = false; + public boolean ofWeather = true; + public boolean ofSky = true; + public boolean ofStars = true; + public boolean ofSunMoon = true; + public int ofVignette = 0; + public int ofChunkUpdates = 1; + public int ofChunkLoading = 0; + public boolean ofChunkUpdatesDynamic = false; + public int ofTime = 0; + public boolean ofClearWater = false; + public boolean ofDepthFog = true; + public boolean ofBetterSnow = false; + public String ofFullscreenMode = "Default"; + public boolean ofSwampColors = true; + public boolean ofRandomMobs = true; + public boolean ofSmoothBiomes = true; + public boolean ofCustomFonts = true; + public boolean ofCustomColors = true; + public boolean ofCustomSky = true; + public boolean ofShowCapes = true; + public int ofConnectedTextures = 2; + public boolean ofNaturalTextures = false; + public boolean ofFastMath = false; + public boolean ofFastRender = false; + public int ofTranslucentBlocks = 2; + public boolean ofDynamicFov = true; + public int ofDynamicLights = 3; + public int ofAnimatedWater = 0; + public int ofAnimatedLava = 0; + public boolean ofAnimatedFire = true; + public boolean ofAnimatedPortal = true; + public boolean ofAnimatedRedstone = true; + public boolean ofAnimatedExplosion = true; + public boolean ofAnimatedFlame = true; + public boolean ofAnimatedSmoke = true; + public boolean ofVoidParticles = true; + public boolean ofWaterParticles = true; + public boolean ofRainSplash = true; + public boolean ofPortalParticles = true; + public boolean ofPotionParticles = true; + public boolean ofDrippingWaterLava = true; + public boolean ofAnimatedTerrain = true; + public boolean ofAnimatedItems = true; + public boolean ofAnimatedTextures = true; + public static final int DEFAULT = 0; + public static final int FAST = 1; + public static final int FANCY = 2; + public static final int OFF = 3; + public static final int ANIM_ON = 0; + public static final int ANIM_GENERATED = 1; + public static final int ANIM_OFF = 2; + public static final int CL_DEFAULT = 0; + public static final int CL_SMOOTH = 1; + public static final int CL_THREADED = 2; + public static final String DEFAULT_STR = "Default"; + private static final int[] OF_DYNAMIC_LIGHTS = new int[] {3, 1, 2}; + private static final String[] KEYS_DYNAMIC_LIGHTS = new String[] {"options.off", "options.graphics.fast", "options.graphics.fancy"}; + public KeyBinding ofKeyBindZoom; + public File optionsFileOF; + + /** Clouds flag */ + public boolean clouds = true; + public List resourcePacks = new ArrayList(); + public EnumChatVisibility chatVisibility; + public boolean chatColours; + public boolean chatLinks; + public boolean chatLinksPrompt; + public float chatOpacity; + public boolean snooperEnabled; + public boolean fullScreen; + public boolean enableVsync; + public boolean hideServerAddress; + + /** + * Whether to show advanced information on item tooltips, toggled by F3+H + */ + public boolean advancedItemTooltips; + + /** Whether to pause when the game loses focus, toggled by F3+P */ + public boolean pauseOnLostFocus; + + /** Whether to show your cape */ + public boolean showCape; + public boolean touchscreen; + public int overrideWidth; + public int overrideHeight; + public boolean heldItemTooltips; + public float chatScale; + public float chatWidth; + public float chatHeightUnfocused; + public float chatHeightFocused; + public boolean showInventoryAchievementHint; + public int mipmapLevels; + public int anisotropicFiltering; + private Map mapSoundLevels; + public float field_152400_J; + public float field_152401_K; + public float field_152402_L; + public float field_152403_M; + public float field_152404_N; + public int field_152405_O; + public boolean field_152406_P; + public String field_152407_Q; + public int field_152408_R; + public int field_152409_S; + public int field_152410_T; + public KeyBinding keyBindForward; + public KeyBinding keyBindLeft; + public KeyBinding keyBindBack; + public KeyBinding keyBindRight; + public KeyBinding keyBindJump; + public KeyBinding keyBindSneak; + public KeyBinding keyBindInventory; + public KeyBinding keyBindUseItem; + public KeyBinding keyBindDrop; + public KeyBinding keyBindAttack; + public KeyBinding keyBindPickBlock; + public KeyBinding keyBindSprint; + public KeyBinding keyBindChat; + public KeyBinding keyBindPlayerList; + public KeyBinding keyBindCommand; + public KeyBinding keyBindScreenshot; + public KeyBinding keyBindTogglePerspective; + public KeyBinding keyBindSmoothCamera; + public KeyBinding field_152395_am; + public KeyBinding[] keyBindsHotbar; + public KeyBinding[] keyBindings; + protected Minecraft mc; + public File optionsFile; + public EnumDifficulty difficulty; + public boolean hideGUI; + public int thirdPersonView; + + /** true if debug info should be displayed instead of version */ + public boolean showDebugInfo; + public boolean showDebugProfilerChart; + + /** The lastServer string. */ + public String lastServer; + + /** No clipping for singleplayer */ + public boolean noclip; + + /** Smooth Camera Toggle */ + public boolean smoothCamera; + public boolean debugCamEnable; + + /** No clipping movement rate */ + public float noclipRate; + + /** Change rate for debug camera */ + public float debugCamRate; + public float fovSetting; + public float gammaSetting; + public float saturation; + + /** GUI scale */ + public int guiScale; + + /** Determines amount of particles. 0 = All, 1 = Decreased, 2 = Minimal */ + public int particleSetting; + + /** Game settings language */ + public String language; + public boolean forceUnicodeFont; + + public float getGamma() { + return (Boolean) CheatBreaker.getInstance().getGlobalSettings().enableFpsBoost.getValue() && + (Boolean) CheatBreaker.getInstance().getGlobalSettings().fullBright.getValue() ? 100.0f : this.gammaSetting; + } + + public GameSettings(Minecraft par1Minecraft, File par2File) { + this.chatVisibility = EnumChatVisibility.FULL; + this.chatColours = true; + this.chatLinks = true; + this.chatLinksPrompt = true; + this.chatOpacity = 1.0F; + this.snooperEnabled = true; + this.enableVsync = true; + this.pauseOnLostFocus = true; + this.showCape = true; + this.heldItemTooltips = true; + this.chatScale = 1.0F; + this.chatWidth = 1.0F; + this.chatHeightUnfocused = 0.44366196F; + this.chatHeightFocused = 1.0F; + this.showInventoryAchievementHint = true; + this.mipmapLevels = 4; + this.anisotropicFiltering = 1; + this.mapSoundLevels = Maps.newEnumMap(SoundCategory.class); + this.field_152400_J = 0.5F; + this.field_152401_K = 1.0F; + this.field_152402_L = 1.0F; + this.field_152403_M = 0.5412844F; + this.field_152404_N = 0.31690142F; + this.field_152405_O = 1; + this.field_152406_P = true; + this.field_152407_Q = ""; + this.field_152408_R = 0; + this.field_152409_S = 0; + this.field_152410_T = 0; + this.keyBindForward = new KeyBinding("key.forward", 17, "key.categories.movement"); + this.keyBindLeft = new KeyBinding("key.left", 30, "key.categories.movement"); + this.keyBindBack = new KeyBinding("key.back", 31, "key.categories.movement"); + this.keyBindRight = new KeyBinding("key.right", 32, "key.categories.movement"); + this.keyBindJump = new KeyBinding("key.jump", 57, "key.categories.movement"); + this.keyBindSneak = new KeyBinding("key.sneak", 42, "key.categories.movement"); + this.keyBindInventory = new KeyBinding("key.inventory", 18, "key.categories.inventory"); + this.keyBindUseItem = new KeyBinding("key.use", -99, "key.categories.gameplay"); + this.keyBindDrop = new KeyBinding("key.drop", 16, "key.categories.gameplay"); + this.keyBindAttack = new KeyBinding("key.attack", -100, "key.categories.gameplay"); + this.keyBindPickBlock = new KeyBinding("key.pickItem", -98, "key.categories.gameplay"); + this.keyBindSprint = new KeyBinding("key.sprint", 29, "key.categories.gameplay"); + this.keyBindChat = new KeyBinding("key.chat", 20, "key.categories.multiplayer"); + this.keyBindPlayerList = new KeyBinding("key.playerlist", 15, "key.categories.multiplayer"); + this.keyBindCommand = new KeyBinding("key.command", 53, "key.categories.multiplayer"); + this.keyBindScreenshot = new KeyBinding("key.screenshot", 60, "key.categories.misc"); + this.keyBindTogglePerspective = new KeyBinding("key.togglePerspective", 63, "key.categories.misc"); + this.keyBindSmoothCamera = new KeyBinding("key.smoothCamera", 0, "key.categories.misc"); + this.field_152395_am = new KeyBinding("key.fullscreen", 87, "key.categories.misc"); + this.keyBindsHotbar = new KeyBinding[] {new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"), new KeyBinding("key.hotbar.3", 4, "key.categories.inventory"), new KeyBinding("key.hotbar.4", 5, "key.categories.inventory"), new KeyBinding("key.hotbar.5", 6, "key.categories.inventory"), new KeyBinding("key.hotbar.6", 7, "key.categories.inventory"), new KeyBinding("key.hotbar.7", 8, "key.categories.inventory"), new KeyBinding("key.hotbar.8", 9, "key.categories.inventory"), new KeyBinding("key.hotbar.9", 10, "key.categories.inventory")}; + this.keyBindings = (KeyBinding[])((KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindSprint, this.field_152395_am}, this.keyBindsHotbar)); + this.difficulty = EnumDifficulty.NORMAL; + this.lastServer = ""; + this.noclipRate = 1.0F; + this.debugCamRate = 1.0F; + this.fovSetting = 70.0F; + this.language = "en_US"; + this.forceUnicodeFont = false; + this.mc = par1Minecraft; + this.optionsFile = new File(par2File, "options.txt"); + this.optionsFileOF = new File(par2File, "optionsof.txt"); + this.limitFramerate = (int)GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.ofKeyBindZoom = new KeyBinding("of.key.zoom", 46, "key.categories.misc"); + this.keyBindings = (KeyBinding[])((KeyBinding[])ArrayUtils.add(this.keyBindings, this.ofKeyBindZoom)); + GameSettings.Options.RENDER_DISTANCE.setValueMax(32.0F); + this.renderDistanceChunks = par1Minecraft.isJava64bit() ? 12 : 8; + this.loadOptions(); + Config.initGameSettings(this); + } + + public GameSettings() { + this.chatVisibility = EnumChatVisibility.FULL; + this.chatColours = true; + this.chatLinks = true; + this.chatLinksPrompt = true; + this.chatOpacity = 1.0F; + this.snooperEnabled = true; + this.enableVsync = true; + this.pauseOnLostFocus = true; + this.showCape = true; + this.heldItemTooltips = true; + this.chatScale = 1.0F; + this.chatWidth = 1.0F; + this.chatHeightUnfocused = 0.44366196F; + this.chatHeightFocused = 1.0F; + this.showInventoryAchievementHint = true; + this.mipmapLevels = 4; + this.anisotropicFiltering = 1; + this.mapSoundLevels = Maps.newEnumMap(SoundCategory.class); + this.field_152400_J = 0.5F; + this.field_152401_K = 1.0F; + this.field_152402_L = 1.0F; + this.field_152403_M = 0.5412844F; + this.field_152404_N = 0.31690142F; + this.field_152405_O = 1; + this.field_152406_P = true; + this.field_152407_Q = ""; + this.field_152408_R = 0; + this.field_152409_S = 0; + this.field_152410_T = 0; + this.keyBindForward = new KeyBinding("key.forward", 17, "key.categories.movement"); + this.keyBindLeft = new KeyBinding("key.left", 30, "key.categories.movement"); + this.keyBindBack = new KeyBinding("key.back", 31, "key.categories.movement"); + this.keyBindRight = new KeyBinding("key.right", 32, "key.categories.movement"); + this.keyBindJump = new KeyBinding("key.jump", 57, "key.categories.movement"); + this.keyBindSneak = new KeyBinding("key.sneak", 42, "key.categories.movement"); + this.keyBindInventory = new KeyBinding("key.inventory", 18, "key.categories.inventory"); + this.keyBindUseItem = new KeyBinding("key.use", -99, "key.categories.gameplay"); + this.keyBindDrop = new KeyBinding("key.drop", 16, "key.categories.gameplay"); + this.keyBindAttack = new KeyBinding("key.attack", -100, "key.categories.gameplay"); + this.keyBindPickBlock = new KeyBinding("key.pickItem", -98, "key.categories.gameplay"); + this.keyBindSprint = new KeyBinding("key.sprint", 29, "key.categories.gameplay"); + this.keyBindChat = new KeyBinding("key.chat", 20, "key.categories.multiplayer"); + this.keyBindPlayerList = new KeyBinding("key.playerlist", 15, "key.categories.multiplayer"); + this.keyBindCommand = new KeyBinding("key.command", 53, "key.categories.multiplayer"); + this.keyBindScreenshot = new KeyBinding("key.screenshot", 60, "key.categories.misc"); + this.keyBindTogglePerspective = new KeyBinding("key.togglePerspective", 63, "key.categories.misc"); + this.keyBindSmoothCamera = new KeyBinding("key.smoothCamera", 0, "key.categories.misc"); + this.field_152395_am = new KeyBinding("key.fullscreen", 87, "key.categories.misc"); + this.keyBindsHotbar = new KeyBinding[] {new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"), new KeyBinding("key.hotbar.3", 4, "key.categories.inventory"), new KeyBinding("key.hotbar.4", 5, "key.categories.inventory"), new KeyBinding("key.hotbar.5", 6, "key.categories.inventory"), new KeyBinding("key.hotbar.6", 7, "key.categories.inventory"), new KeyBinding("key.hotbar.7", 8, "key.categories.inventory"), new KeyBinding("key.hotbar.8", 9, "key.categories.inventory"), new KeyBinding("key.hotbar.9", 10, "key.categories.inventory")}; + this.keyBindings = (KeyBinding[])((KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindSprint, this.field_152395_am}, this.keyBindsHotbar)); + this.difficulty = EnumDifficulty.NORMAL; + this.lastServer = ""; + this.noclipRate = 1.0F; + this.debugCamRate = 1.0F; + this.fovSetting = 70.0F; + this.language = "en_US"; + this.forceUnicodeFont = false; + this.limitFramerate = (int)GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.ofKeyBindZoom = new KeyBinding("of.key.zoom", 46, "key.categories.misc"); + this.keyBindings = (KeyBinding[])((KeyBinding[])ArrayUtils.add(this.keyBindings, this.ofKeyBindZoom)); + } + + /** + * Represents a key or mouse button as a string. Args: key + */ + public static String getKeyDisplayString(int par0) { + return par0 < 0 ? I18n.format("key.mouseButton", new Object[] {Integer.valueOf(par0 + 101)}): Keyboard.getKeyName(par0); + } + + /** + * Returns whether the specified key binding is currently being pressed. + */ + public static boolean isKeyDown(KeyBinding par0KeyBinding) { + return par0KeyBinding.getKeyCode() == 0 ? false : (par0KeyBinding.getKeyCode() < 0 ? Mouse.isButtonDown(par0KeyBinding.getKeyCode() + 100) : Keyboard.isKeyDown(par0KeyBinding.getKeyCode())); + } + + public void setKeyCodeSave(KeyBinding p_151440_1_, int p_151440_2_) { + p_151440_1_.setKeyCode(p_151440_2_); + this.saveOptions(); + } + + /** + * If the specified option is controlled by a slider (float value), this will set the float value. + */ + public void setOptionFloatValue(GameSettings.Options par1EnumOptions, float par2) { + if (par1EnumOptions == GameSettings.Options.CLOUD_HEIGHT) { + this.ofCloudsHeight = par2; + } + + if (par1EnumOptions == GameSettings.Options.AO_LEVEL) { + this.ofAoLevel = par2; + this.mc.renderGlobal.loadRenderers(); + } + + int var3; + + if (par1EnumOptions == GameSettings.Options.MIPMAP_TYPE) { + var3 = (int)par2; + this.ofMipmapType = Config.limit(var3, 0, 3); + TextureUtils.refreshBlockTextures(); + } + + if (par1EnumOptions == GameSettings.Options.SENSITIVITY) { + this.mouseSensitivity = par2; + } + + if (par1EnumOptions == GameSettings.Options.FOV) { + this.fovSetting = par2; + } + + if (par1EnumOptions == GameSettings.Options.GAMMA) { + this.gammaSetting = par2; + } + + if (par1EnumOptions == GameSettings.Options.FRAMERATE_LIMIT) { + this.limitFramerate = (int)par2; + this.enableVsync = false; + + if (this.limitFramerate <= 0) { + this.limitFramerate = (int)GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.enableVsync = true; + } + + this.updateVSync(); + } + + if (par1EnumOptions == GameSettings.Options.CHAT_OPACITY) { + this.chatOpacity = par2; + this.mc.ingameGUI.getChatGUI().func_146245_b(); + } + + if (par1EnumOptions == GameSettings.Options.CHAT_HEIGHT_FOCUSED) { + this.chatHeightFocused = par2; + this.mc.ingameGUI.getChatGUI().func_146245_b(); + } + + if (par1EnumOptions == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED) { + this.chatHeightUnfocused = par2; + this.mc.ingameGUI.getChatGUI().func_146245_b(); + } + + if (par1EnumOptions == GameSettings.Options.CHAT_WIDTH) { + this.chatWidth = par2; + this.mc.ingameGUI.getChatGUI().func_146245_b(); + } + + if (par1EnumOptions == GameSettings.Options.CHAT_SCALE) { + this.chatScale = par2; + this.mc.ingameGUI.getChatGUI().func_146245_b(); + } + + if (par1EnumOptions == GameSettings.Options.ANISOTROPIC_FILTERING) { + var3 = this.anisotropicFiltering; + + if (var3 > 1 && Config.isShaders()) { + Config.showGuiMessage(Lang.get("of.message.af.shaders1"), Lang.get("of.message.af.shaders2")); + return; + } + + this.anisotropicFiltering = (int)par2; + + if ((float)var3 != par2) { + this.mc.getTextureMapBlocks().func_147632_b(this.anisotropicFiltering); + this.mc.scheduleResourcesRefresh(); + } + } + + if (par1EnumOptions == GameSettings.Options.MIPMAP_LEVELS) { + var3 = this.mipmapLevels; + this.mipmapLevels = (int)par2; + + if ((float)var3 != par2) { + this.mc.getTextureMapBlocks().func_147633_a(this.mipmapLevels); + this.mc.scheduleResourcesRefresh(); + } + } + + if (par1EnumOptions == GameSettings.Options.RENDER_DISTANCE) { + this.renderDistanceChunks = (int)par2; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_BYTES_PER_PIXEL) { + this.field_152400_J = par2; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_VOLUME_MIC) { + this.field_152401_K = par2; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_VOLUME_SYSTEM) { + this.field_152402_L = par2; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_KBPS) { + this.field_152403_M = par2; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_FPS) { + this.field_152404_N = par2; + } + } + + /** + * For non-float options. Toggles the option on/off, or cycles through the list i.e. render distances. + */ + public void setOptionValue(GameSettings.Options par1EnumOptions, int par2) { + if (par1EnumOptions == GameSettings.Options.FOG_FANCY) { + switch (this.ofFogType) { + case 1: + this.ofFogType = 2; + + if (!Config.isFancyFogAvailable()) { + this.ofFogType = 3; + } + + break; + + case 2: + this.ofFogType = 3; + break; + + case 3: + this.ofFogType = 1; + break; + + default: + this.ofFogType = 1; + } + } + + if (par1EnumOptions == GameSettings.Options.FOG_START) { + this.ofFogStart += 0.2F; + + if (this.ofFogStart > 0.81F) { + this.ofFogStart = 0.2F; + } + } + + if (par1EnumOptions == GameSettings.Options.LOAD_FAR) { + this.ofLoadFar = !this.ofLoadFar; + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.PRELOADED_CHUNKS) { + this.ofPreloadedChunks += 2; + + if (this.ofPreloadedChunks > 8) { + this.ofPreloadedChunks = 0; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.SMOOTH_FPS) { + this.ofSmoothFps = !this.ofSmoothFps; + } + + if (par1EnumOptions == GameSettings.Options.SMOOTH_WORLD) { + this.ofSmoothWorld = !this.ofSmoothWorld; + Config.updateAvailableProcessors(); + + if (!Config.isSingleProcessor()) { + this.ofSmoothWorld = false; + } + + Config.updateThreadPriorities(); + } + + if (par1EnumOptions == GameSettings.Options.CLOUDS) { + ++this.ofClouds; + + if (this.ofClouds > 3) { + this.ofClouds = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.TREES) { + ++this.ofTrees; + + if (this.ofTrees > 2) { + this.ofTrees = 0; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.GRASS) { + ++this.ofGrass; + + if (this.ofGrass > 2) { + this.ofGrass = 0; + } + + RenderBlocks.fancyGrass = Config.isGrassFancy(); + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.DROPPED_ITEMS) { + ++this.ofDroppedItems; + + if (this.ofDroppedItems > 2) { + this.ofDroppedItems = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.RAIN) { + ++this.ofRain; + + if (this.ofRain > 3) { + this.ofRain = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.WATER) { + ++this.ofWater; + + if (this.ofWater > 2) { + this.ofWater = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_WATER) { + ++this.ofAnimatedWater; + + if (this.ofAnimatedWater == 1) { + ++this.ofAnimatedWater; + } + + if (this.ofAnimatedWater > 2) { + this.ofAnimatedWater = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_LAVA) { + ++this.ofAnimatedLava; + + if (this.ofAnimatedLava == 1) { + ++this.ofAnimatedLava; + } + + if (this.ofAnimatedLava > 2) { + this.ofAnimatedLava = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_FIRE) { + this.ofAnimatedFire = !this.ofAnimatedFire; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_PORTAL) { + this.ofAnimatedPortal = !this.ofAnimatedPortal; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_REDSTONE) { + this.ofAnimatedRedstone = !this.ofAnimatedRedstone; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_EXPLOSION) { + this.ofAnimatedExplosion = !this.ofAnimatedExplosion; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_FLAME) { + this.ofAnimatedFlame = !this.ofAnimatedFlame; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_SMOKE) { + this.ofAnimatedSmoke = !this.ofAnimatedSmoke; + } + + if (par1EnumOptions == GameSettings.Options.VOID_PARTICLES) { + this.ofVoidParticles = !this.ofVoidParticles; + } + + if (par1EnumOptions == GameSettings.Options.WATER_PARTICLES) { + this.ofWaterParticles = !this.ofWaterParticles; + } + + if (par1EnumOptions == GameSettings.Options.PORTAL_PARTICLES) { + this.ofPortalParticles = !this.ofPortalParticles; + } + + if (par1EnumOptions == GameSettings.Options.POTION_PARTICLES) { + this.ofPotionParticles = !this.ofPotionParticles; + } + + if (par1EnumOptions == GameSettings.Options.DRIPPING_WATER_LAVA) { + this.ofDrippingWaterLava = !this.ofDrippingWaterLava; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_TERRAIN) { + this.ofAnimatedTerrain = !this.ofAnimatedTerrain; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_TEXTURES) { + this.ofAnimatedTextures = !this.ofAnimatedTextures; + } + + if (par1EnumOptions == GameSettings.Options.ANIMATED_ITEMS) { + this.ofAnimatedItems = !this.ofAnimatedItems; + } + + if (par1EnumOptions == GameSettings.Options.RAIN_SPLASH) { + this.ofRainSplash = !this.ofRainSplash; + } + + if (par1EnumOptions == GameSettings.Options.LAGOMETER) { + this.ofLagometer = !this.ofLagometer; + } + + if (par1EnumOptions == GameSettings.Options.SHOW_FPS) { + this.ofShowFps = !this.ofShowFps; + } + + if (par1EnumOptions == GameSettings.Options.AUTOSAVE_TICKS) { + this.ofAutoSaveTicks *= 10; + + if (this.ofAutoSaveTicks > 40000) { + this.ofAutoSaveTicks = 40; + } + } + + if (par1EnumOptions == GameSettings.Options.BETTER_GRASS) { + ++this.ofBetterGrass; + + if (this.ofBetterGrass > 3) { + this.ofBetterGrass = 1; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.CONNECTED_TEXTURES) { + ++this.ofConnectedTextures; + + if (this.ofConnectedTextures > 3) { + this.ofConnectedTextures = 1; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.WEATHER) { + this.ofWeather = !this.ofWeather; + } + + if (par1EnumOptions == GameSettings.Options.SKY) { + this.ofSky = !this.ofSky; + } + + if (par1EnumOptions == GameSettings.Options.STARS) { + this.ofStars = !this.ofStars; + } + + if (par1EnumOptions == GameSettings.Options.SUN_MOON) { + this.ofSunMoon = !this.ofSunMoon; + } + + if (par1EnumOptions == GameSettings.Options.VIGNETTE) { + ++this.ofVignette; + + if (this.ofVignette > 2) { + this.ofVignette = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.CHUNK_UPDATES) { + ++this.ofChunkUpdates; + + if (this.ofChunkUpdates > 5) { + this.ofChunkUpdates = 1; + } + } + + if (par1EnumOptions == GameSettings.Options.CHUNK_LOADING) { +// ++this.ofChunkLoading; +// +// if (this.ofChunkLoading > 2) { +// this.ofChunkLoading = 0; +// } +// +// this.updateChunkLoading(); + } + + if (par1EnumOptions == GameSettings.Options.CHUNK_UPDATES_DYNAMIC) { + this.ofChunkUpdatesDynamic = !this.ofChunkUpdatesDynamic; + } + + if (par1EnumOptions == GameSettings.Options.TIME) { + ++this.ofTime; + + if (this.ofTime > 3) { + this.ofTime = 0; + } + } + + if (par1EnumOptions == GameSettings.Options.CLEAR_WATER) { + this.ofClearWater = !this.ofClearWater; + this.updateWaterOpacity(); + } + + if (par1EnumOptions == GameSettings.Options.DEPTH_FOG) { + this.ofDepthFog = !this.ofDepthFog; + } + + if (par1EnumOptions == GameSettings.Options.AA_LEVEL) { + this.ofAaLevel = 0; + } + + if (par1EnumOptions == GameSettings.Options.PROFILER) { + this.ofProfiler = !this.ofProfiler; + } + + if (par1EnumOptions == GameSettings.Options.BETTER_SNOW) { + this.ofBetterSnow = !this.ofBetterSnow; + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.SWAMP_COLORS) { + this.ofSwampColors = !this.ofSwampColors; + CustomColorizer.updateUseDefaultColorMultiplier(); + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.RANDOM_MOBS) { + this.ofRandomMobs = !this.ofRandomMobs; + RandomMobs.resetTextures(); + } + + if (par1EnumOptions == GameSettings.Options.SMOOTH_BIOMES) { + this.ofSmoothBiomes = !this.ofSmoothBiomes; + CustomColorizer.updateUseDefaultColorMultiplier(); + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.CUSTOM_FONTS) { + this.ofCustomFonts = !this.ofCustomFonts; + this.mc.fontRenderer.onResourceManagerReload(Config.getResourceManager()); + this.mc.standardGalacticFontRenderer.onResourceManagerReload(Config.getResourceManager()); + } + + if (par1EnumOptions == GameSettings.Options.CUSTOM_COLORS) { + this.ofCustomColors = !this.ofCustomColors; + CustomColorizer.update(); + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.CUSTOM_SKY) { + this.ofCustomSky = !this.ofCustomSky; + CustomSky.update(); + } + + if (par1EnumOptions == GameSettings.Options.SHOW_CAPES) { + this.ofShowCapes = !this.ofShowCapes; + this.mc.renderGlobal.updateCapes(); + } + + if (par1EnumOptions == GameSettings.Options.NATURAL_TEXTURES) { + this.ofNaturalTextures = !this.ofNaturalTextures; + NaturalTextures.update(); + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.FAST_MATH) { + this.ofFastMath = !this.ofFastMath; + MathHelper.fastMath = this.ofFastMath; + } + + if (par1EnumOptions == GameSettings.Options.FAST_RENDER) { +// if (!this.ofFastRender && Config.isShaders()) { +// Config.showGuiMessage(Lang.get("of.message.fr.shaders1"), Lang.get("of.message.fr.shaders2")); +// return; +// } + + this.ofFastRender = !this.ofFastRender; + + /*if (this.ofFastRender) { + this.mc.entityRenderer.stopUseShader(); + }*/ + + Config.updateFramebufferSize(); + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.TRANSLUCENT_BLOCKS) { + if (this.ofTranslucentBlocks == 1) { + this.ofTranslucentBlocks = 2; + } else { + this.ofTranslucentBlocks = 1; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.LAZY_CHUNK_LOADING) { + this.ofLazyChunkLoading = !this.ofLazyChunkLoading; + Config.updateAvailableProcessors(); + + if (!Config.isSingleProcessor()) { + this.ofLazyChunkLoading = false; + } + + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.FULLSCREEN_MODE) { + List modeList = Arrays.asList(Config.getDisplayModeNames()); + + if (this.ofFullscreenMode.equals("Default")) { + this.ofFullscreenMode = (String)modeList.get(0); + } else { + int index = modeList.indexOf(this.ofFullscreenMode); + + if (index < 0) { + this.ofFullscreenMode = "Default"; + } else { + ++index; + + if (index >= modeList.size()) { + this.ofFullscreenMode = "Default"; + } else { + this.ofFullscreenMode = (String)modeList.get(index); + } + } + } + } + + if (par1EnumOptions == GameSettings.Options.DYNAMIC_FOV) { + this.ofDynamicFov = !this.ofDynamicFov; + } + + if (par1EnumOptions == GameSettings.Options.DYNAMIC_LIGHTS) { + this.ofDynamicLights = nextValue(this.ofDynamicLights, OF_DYNAMIC_LIGHTS); + DynamicLights.removeLights(this.mc.renderGlobal); + } + + if (par1EnumOptions == GameSettings.Options.HELD_ITEM_TOOLTIPS) { + this.heldItemTooltips = !this.heldItemTooltips; + } + + if (par1EnumOptions == GameSettings.Options.INVERT_MOUSE) { + this.invertMouse = !this.invertMouse; + } + + if (par1EnumOptions == GameSettings.Options.GUI_SCALE) { + this.guiScale = this.guiScale + par2 & 3; + } + + if (par1EnumOptions == GameSettings.Options.PARTICLES) { + this.particleSetting = (this.particleSetting + par2) % 3; + } + + if (par1EnumOptions == GameSettings.Options.VIEW_BOBBING) { + this.viewBobbing = !this.viewBobbing; + } + + if (par1EnumOptions == GameSettings.Options.RENDER_CLOUDS) { + this.clouds = !this.clouds; + } + + if (par1EnumOptions == GameSettings.Options.FORCE_UNICODE_FONT) { + this.forceUnicodeFont = !this.forceUnicodeFont; + this.mc.fontRenderer.setUnicodeFlag(this.mc.getLanguageManager().isCurrentLocaleUnicode() || this.forceUnicodeFont); + } + + if (par1EnumOptions == GameSettings.Options.ADVANCED_OPENGL) { + if (!Config.isOcclusionAvailable()) { + this.ofOcclusionFancy = false; + this.advancedOpengl = false; + } else if (!this.advancedOpengl) { + this.advancedOpengl = true; + this.ofOcclusionFancy = false; + } else if (!this.ofOcclusionFancy) { + this.ofOcclusionFancy = true; + } else { + this.ofOcclusionFancy = false; + this.advancedOpengl = false; + } + + this.mc.renderGlobal.setAllRenderersVisible(); + } + + if (par1EnumOptions == GameSettings.Options.FBO_ENABLE) { + this.fboEnable = !this.fboEnable; + } + + if (par1EnumOptions == GameSettings.Options.ANAGLYPH) { + if (!this.anaglyph && Config.isShaders()) { + Config.showGuiMessage(Lang.get("of.message.an.shaders1"), Lang.get("of.message.an.shaders2")); + return; + } + + this.anaglyph = !this.anaglyph; + this.mc.refreshResources(); + } + + if (par1EnumOptions == GameSettings.Options.DIFFICULTY) { + this.difficulty = EnumDifficulty.getDifficultyEnum(this.difficulty.getDifficultyId() + par2 & 3); + } + + if (par1EnumOptions == GameSettings.Options.GRAPHICS) { + this.fancyGraphics = !this.fancyGraphics; + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.AMBIENT_OCCLUSION) { + this.ambientOcclusion = (this.ambientOcclusion + par2) % 3; + this.mc.renderGlobal.loadRenderers(); + } + + if (par1EnumOptions == GameSettings.Options.CHAT_VISIBILITY) { + this.chatVisibility = EnumChatVisibility.getEnumChatVisibility((this.chatVisibility.getChatVisibility() + par2) % 3); + } + + if (par1EnumOptions == GameSettings.Options.STREAM_COMPRESSION) { + this.field_152405_O = (this.field_152405_O + par2) % 3; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_SEND_METADATA) { + this.field_152406_P = !this.field_152406_P; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_CHAT_ENABLED) { + this.field_152408_R = (this.field_152408_R + par2) % 3; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_CHAT_USER_FILTER) { + this.field_152409_S = (this.field_152409_S + par2) % 3; + } + + if (par1EnumOptions == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR) { + this.field_152410_T = (this.field_152410_T + par2) % 2; + } + + if (par1EnumOptions == GameSettings.Options.CHAT_COLOR) { + this.chatColours = !this.chatColours; + } + + if (par1EnumOptions == GameSettings.Options.CHAT_LINKS) { + this.chatLinks = !this.chatLinks; + } + + if (par1EnumOptions == GameSettings.Options.CHAT_LINKS_PROMPT) { + this.chatLinksPrompt = !this.chatLinksPrompt; + } + + if (par1EnumOptions == GameSettings.Options.SNOOPER_ENABLED) { + this.snooperEnabled = !this.snooperEnabled; + } + + if (par1EnumOptions == GameSettings.Options.SHOW_CAPE) { + this.showCape = !this.showCape; + } + + if (par1EnumOptions == GameSettings.Options.TOUCHSCREEN) { + this.touchscreen = !this.touchscreen; + } + + if (par1EnumOptions == GameSettings.Options.USE_FULLSCREEN) { + this.fullScreen = !this.fullScreen; + + if (this.mc.isFullScreen() != this.fullScreen) { + this.mc.toggleFullscreen(); + } + } + + if (par1EnumOptions == GameSettings.Options.ENABLE_VSYNC) { + this.enableVsync = !this.enableVsync; + Display.setVSyncEnabled(this.enableVsync); + } + + this.saveOptions(); + } + + public float getOptionFloatValue(GameSettings.Options par1EnumOptions) { + return par1EnumOptions == GameSettings.Options.CLOUD_HEIGHT ? this.ofCloudsHeight : (par1EnumOptions == GameSettings.Options.AO_LEVEL ? this.ofAoLevel : (par1EnumOptions == GameSettings.Options.FRAMERATE_LIMIT ? ((float)this.limitFramerate == GameSettings.Options.FRAMERATE_LIMIT.getValueMax() && this.enableVsync ? 0.0F : (float)this.limitFramerate) : (par1EnumOptions == GameSettings.Options.MIPMAP_TYPE ? (float)this.ofMipmapType : (par1EnumOptions == GameSettings.Options.FOV ? this.fovSetting : (par1EnumOptions == GameSettings.Options.GAMMA ? this.gammaSetting : (par1EnumOptions == GameSettings.Options.SATURATION ? this.saturation : (par1EnumOptions == GameSettings.Options.SENSITIVITY ? this.mouseSensitivity : (par1EnumOptions == GameSettings.Options.CHAT_OPACITY ? this.chatOpacity : (par1EnumOptions == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (par1EnumOptions == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (par1EnumOptions == GameSettings.Options.CHAT_SCALE ? this.chatScale : (par1EnumOptions == GameSettings.Options.CHAT_WIDTH ? this.chatWidth : (par1EnumOptions == GameSettings.Options.FRAMERATE_LIMIT ? (float)this.limitFramerate : (par1EnumOptions == GameSettings.Options.ANISOTROPIC_FILTERING ? (float)this.anisotropicFiltering : (par1EnumOptions == GameSettings.Options.MIPMAP_LEVELS ? (float)this.mipmapLevels : (par1EnumOptions == GameSettings.Options.RENDER_DISTANCE ? (float)this.renderDistanceChunks : (par1EnumOptions == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? this.field_152400_J : (par1EnumOptions == GameSettings.Options.STREAM_VOLUME_MIC ? this.field_152401_K : (par1EnumOptions == GameSettings.Options.STREAM_VOLUME_SYSTEM ? this.field_152402_L : (par1EnumOptions == GameSettings.Options.STREAM_KBPS ? this.field_152403_M : (par1EnumOptions == GameSettings.Options.STREAM_FPS ? this.field_152404_N : 0.0F))))))))))))))))))))); + } + + public boolean getOptionOrdinalValue(GameSettings.Options par1EnumOptions) { + switch (GameSettings.SwitchOptions.optionIds[par1EnumOptions.ordinal()]) { + case 1: + return this.invertMouse; + + case 2: + return this.viewBobbing; + + case 3: + return this.anaglyph; + + case 4: + return this.advancedOpengl; + + case 5: + return this.fboEnable; + + case 6: + return this.clouds; + + case 7: + return this.chatColours; + + case 8: + return this.chatLinks; + + case 9: + return this.chatLinksPrompt; + + case 10: + return this.snooperEnabled; + + case 11: + return this.fullScreen; + + case 12: + return this.enableVsync; + + case 13: + return this.showCape; + + case 14: + return this.touchscreen; + + case 15: + return this.field_152406_P; + + case 16: + return this.forceUnicodeFont; + + default: + return false; + } + } + + /** + * Returns the translation of the given index in the given String array. If the index is smaller than 0 or greater + * than/equal to the length of the String array, it is changed to 0. + */ + private static String getTranslation(String[] par0ArrayOfStr, int par1) { + if (par1 < 0 || par1 >= par0ArrayOfStr.length) { + par1 = 0; + } + + return I18n.format(par0ArrayOfStr[par1], new Object[0]); + } + + /** + * Gets a key binding. + */ + public String getKeyBinding(GameSettings.Options par1EnumOptions) { + String var2 = I18n.format(par1EnumOptions.getEnumString(), new Object[0]) + ": "; + + if (var2 == null) { + var2 = par1EnumOptions.getEnumString(); + } + + int var33; + + if (par1EnumOptions == GameSettings.Options.RENDER_DISTANCE) { + var33 = (int)this.getOptionFloatValue(par1EnumOptions); + String var41 = I18n.format("options.renderDistance.tiny", new Object[0]); + byte baseDist = 2; + + if (var33 >= 4) { + var41 = I18n.format("options.renderDistance.short", new Object[0]); + baseDist = 4; + } + + if (var33 >= 8) { + var41 = I18n.format("options.renderDistance.normal", new Object[0]); + baseDist = 8; + } + + if (var33 >= 16) { + var41 = I18n.format("options.renderDistance.far", new Object[0]); + baseDist = 16; + } + + if (var33 >= 32) { + var41 = Lang.get("of.options.renderDistance.extreme"); + baseDist = 32; + } + + int diff = this.renderDistanceChunks - baseDist; + String descr = var41; + + if (diff > 0) { + descr = var41 + "+"; + } + + return var2 + var33 + " " + descr + ""; + } else if (par1EnumOptions == GameSettings.Options.ADVANCED_OPENGL) { + return !this.advancedOpengl ? var2 + Lang.getOff() : (this.ofOcclusionFancy ? var2 + Lang.getFancy() : var2 + Lang.getFast()); + } else if (par1EnumOptions == GameSettings.Options.FOG_FANCY) { + switch (this.ofFogType) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + case 3: + return var2 + Lang.getOff(); + + default: + return var2 + Lang.getOff(); + } + } else if (par1EnumOptions == GameSettings.Options.FOG_START) { + return var2 + this.ofFogStart; + } else if (par1EnumOptions == GameSettings.Options.MIPMAP_TYPE) { + switch (this.ofMipmapType) { + case 0: + return var2 + Lang.get("of.options.mipmap.nearest"); + + case 1: + return var2 + Lang.get("of.options.mipmap.linear"); + + case 2: + return var2 + Lang.get("of.options.mipmap.bilinear"); + + case 3: + return var2 + Lang.get("of.options.mipmap.trilinear"); + + default: + return var2 + Lang.get("of.options.mipmap.nearest"); + } + } else if (par1EnumOptions == GameSettings.Options.LOAD_FAR) { + return this.ofLoadFar ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.PRELOADED_CHUNKS) { + return this.ofPreloadedChunks == 0 ? var2 + Lang.getOff() : var2 + this.ofPreloadedChunks; + } else if (par1EnumOptions == GameSettings.Options.SMOOTH_FPS) { + return this.ofSmoothFps ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.SMOOTH_WORLD) { + return this.ofSmoothWorld ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.CLOUDS) { + switch (this.ofClouds) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + case 3: + return var2 + Lang.getOff(); + + default: + return var2 + Lang.getDefault(); + } + } else if (par1EnumOptions == GameSettings.Options.TREES) { + switch (this.ofTrees) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + default: + return var2 + Lang.getDefault(); + } + } else if (par1EnumOptions == GameSettings.Options.GRASS) { + switch (this.ofGrass) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + default: + return var2 + Lang.getDefault(); + } + } else if (par1EnumOptions == GameSettings.Options.DROPPED_ITEMS) { + switch (this.ofDroppedItems) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + default: + return var2 + Lang.getDefault(); + } + } else if (par1EnumOptions == GameSettings.Options.RAIN) { + switch (this.ofRain) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + case 3: + return var2 + Lang.getOff(); + + default: + return var2 + Lang.getDefault(); + } + } else if (par1EnumOptions == GameSettings.Options.WATER) { + switch (this.ofWater) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + case 3: + return var2 + Lang.getOff(); + + default: + return var2 + Lang.getDefault(); + } + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_WATER) { + switch (this.ofAnimatedWater) { + case 1: + return var2 + Lang.get("of.options.animation.dynamic"); + + case 2: + return var2 + Lang.getOff(); + + default: + return var2 + Lang.getOn(); + } + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_LAVA) { + switch (this.ofAnimatedLava) { + case 1: + return var2 + Lang.get("of.options.animation.dynamic"); + + case 2: + return var2 + Lang.getOff(); + + default: + return var2 + Lang.getOn(); + } + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_FIRE) { + return this.ofAnimatedFire ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_PORTAL) { + return this.ofAnimatedPortal ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_REDSTONE) { + return this.ofAnimatedRedstone ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_EXPLOSION) { + return this.ofAnimatedExplosion ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_FLAME) { + return this.ofAnimatedFlame ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_SMOKE) { + return this.ofAnimatedSmoke ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.VOID_PARTICLES) { + return this.ofVoidParticles ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.WATER_PARTICLES) { + return this.ofWaterParticles ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.PORTAL_PARTICLES) { + return this.ofPortalParticles ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.POTION_PARTICLES) { + return this.ofPotionParticles ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.DRIPPING_WATER_LAVA) { + return this.ofDrippingWaterLava ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_TERRAIN) { + return this.ofAnimatedTerrain ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_TEXTURES) { + return this.ofAnimatedTextures ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.ANIMATED_ITEMS) { + return this.ofAnimatedItems ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.RAIN_SPLASH) { + return this.ofRainSplash ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.LAGOMETER) { + return this.ofLagometer ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.SHOW_FPS) { + return this.ofShowFps ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.AUTOSAVE_TICKS) { + return this.ofAutoSaveTicks <= 40 ? var2 + Lang.get("of.options.save.default") : (this.ofAutoSaveTicks <= 400 ? var2 + Lang.get("of.options.save.20s") : (this.ofAutoSaveTicks <= 4000 ? var2 + Lang.get("of.options.save.3min") : var2 + Lang.get("of.options.save.30min"))); + } else if (par1EnumOptions == GameSettings.Options.BETTER_GRASS) { + switch (this.ofBetterGrass) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + default: + return var2 + Lang.getOff(); + } + } else if (par1EnumOptions == GameSettings.Options.CONNECTED_TEXTURES) { + switch (this.ofConnectedTextures) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + default: + return var2 + Lang.getOff(); + } + } else if (par1EnumOptions == GameSettings.Options.WEATHER) { + return this.ofWeather ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.SKY) { + return this.ofSky ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.STARS) { + return this.ofStars ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.SUN_MOON) { + return this.ofSunMoon ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.VIGNETTE) { + switch (this.ofVignette) { + case 1: + return var2 + Lang.getFast(); + + case 2: + return var2 + Lang.getFancy(); + + default: + return var2 + Lang.getDefault(); + } + } else if (par1EnumOptions == GameSettings.Options.CHUNK_UPDATES) { + return var2 + this.ofChunkUpdates; + } else if (par1EnumOptions == GameSettings.Options.CHUNK_LOADING) { + return this.ofChunkLoading == 1 ? var2 + "Smooth" : (this.ofChunkLoading == 2 ? var2 + "Multi-Core" : var2 + "Default"); + } else if (par1EnumOptions == GameSettings.Options.CHUNK_UPDATES_DYNAMIC) { + return this.ofChunkUpdatesDynamic ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.TIME) { + return this.ofTime == 1 ? var2 + Lang.get("of.options.time.dayOnly") : (this.ofTime == 3 ? var2 + Lang.get("of.options.time.nightOnly") : var2 + Lang.getDefault()); + } else if (par1EnumOptions == GameSettings.Options.CLEAR_WATER) { + return this.ofClearWater ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.DEPTH_FOG) { + return this.ofDepthFog ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.AA_LEVEL) { + return this.ofAaLevel == 0 ? var2 + Lang.getOff() : var2 + this.ofAaLevel; + } else if (par1EnumOptions == GameSettings.Options.PROFILER) { + return this.ofProfiler ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.BETTER_SNOW) { + return this.ofBetterSnow ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.SWAMP_COLORS) { + return this.ofSwampColors ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.RANDOM_MOBS) { + return this.ofRandomMobs ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.SMOOTH_BIOMES) { + return this.ofSmoothBiomes ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.CUSTOM_FONTS) { + return this.ofCustomFonts ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.CUSTOM_COLORS) { + return this.ofCustomColors ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.CUSTOM_SKY) { + return this.ofCustomSky ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.SHOW_CAPES) { + return this.ofShowCapes ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.NATURAL_TEXTURES) { + return this.ofNaturalTextures ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.FAST_MATH) { + return this.ofFastMath ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.FAST_RENDER) { + return this.ofFastRender ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.TRANSLUCENT_BLOCKS) { + return this.ofTranslucentBlocks == 1 ? var2 + Lang.getFast() : var2 + Lang.getFancy(); + } else if (par1EnumOptions == GameSettings.Options.LAZY_CHUNK_LOADING) { + return this.ofLazyChunkLoading ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.DYNAMIC_FOV) { + return this.ofDynamicFov ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else if (par1EnumOptions == GameSettings.Options.DYNAMIC_LIGHTS) { + var33 = indexOf(this.ofDynamicLights, OF_DYNAMIC_LIGHTS); + return var2 + getTranslation(KEYS_DYNAMIC_LIGHTS, var33); + } else if (par1EnumOptions == GameSettings.Options.FULLSCREEN_MODE) { + return this.ofFullscreenMode.equals("Default") ? var2 + Lang.getDefault() : var2 + this.ofFullscreenMode; + } else if (par1EnumOptions == GameSettings.Options.HELD_ITEM_TOOLTIPS) { + return this.heldItemTooltips ? var2 + Lang.getOn() : var2 + Lang.getOff(); + } else { + float var32; + + if (par1EnumOptions == GameSettings.Options.FRAMERATE_LIMIT) { + var32 = this.getOptionFloatValue(par1EnumOptions); + return var32 == 0.0F ? var2 + Lang.get("of.options.framerateLimit.vsync") : (var32 == par1EnumOptions.valueMax ? var2 + I18n.format("options.framerateLimit.max", new Object[0]) : var2 + (int)var32 + " fps"); + } else if (par1EnumOptions.getEnumFloat()) { + var32 = this.getOptionFloatValue(par1EnumOptions); + float var4 = par1EnumOptions.normalizeValue(var32); + return par1EnumOptions == GameSettings.Options.SENSITIVITY ? (var4 == 0.0F ? var2 + I18n.format("options.sensitivity.min") : (var4 == 1.0F ? var2 + I18n.format("options.sensitivity.max") : var2 + (int)(var4 * 200.0F) + "%")) : (par1EnumOptions == GameSettings.Options.FOV ? (var32 == 70.0F ? var2 + I18n.format("options.fov.min") : (var32 == 110.0F ? var2 + I18n.format("options.fov.max") : var2 + (int)var32)) : (par1EnumOptions == GameSettings.Options.FRAMERATE_LIMIT ? (var32 == par1EnumOptions.valueMax ? var2 + I18n.format("options.framerateLimit.max") : var2 + (int)var32 + " fps") : (par1EnumOptions == GameSettings.Options.GAMMA ? (var4 == 0.0F ? var2 + I18n.format("options.gamma.min") : (var4 == 1.0F ? var2 + I18n.format("options.gamma.max") : var2 + "+" + (int)(var4 * 100.0F) + "%")) : (par1EnumOptions == GameSettings.Options.SATURATION ? var2 + (int)(var4 * 400.0F) + "%" : (par1EnumOptions == GameSettings.Options.CHAT_OPACITY ? var2 + (int)(var4 * 90.0F + 10.0F) + "%" : (par1EnumOptions == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? var2 + GuiNewChat.func_146243_b(var4) + "px" : (par1EnumOptions == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? var2 + GuiNewChat.func_146243_b(var4) + "px" : (par1EnumOptions == GameSettings.Options.CHAT_WIDTH ? var2 + GuiNewChat.func_146233_a(var4) + "px" : (par1EnumOptions == GameSettings.Options.RENDER_DISTANCE ? var2 + (int)var32 + " chunks" : (par1EnumOptions == GameSettings.Options.ANISOTROPIC_FILTERING ? (var32 == 1.0F ? var2 + I18n.format("options.off") : var2 + (int)var32) : (par1EnumOptions == GameSettings.Options.MIPMAP_LEVELS ? (var32 == 0.0F ? var2 + I18n.format("options.off") : var2 + (int)var32) : (par1EnumOptions == GameSettings.Options.STREAM_FPS ? var2 + " fps" : (par1EnumOptions == GameSettings.Options.STREAM_KBPS ? var2 + " Kbps" : (par1EnumOptions == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? var2 : (var4 == 0.0F ? var2 + I18n.format("options.off") : var2 + (int)(var4 * 100.0F) + "%"))))))))))))))); + } else if (par1EnumOptions.getEnumBoolean()) { + boolean var31 = this.getOptionOrdinalValue(par1EnumOptions); + return var31 ? var2 + I18n.format("options.on", new Object[0]) : var2 + I18n.format("options.off", new Object[0]); + } else if (par1EnumOptions == GameSettings.Options.DIFFICULTY) { + return var2 + I18n.format(this.difficulty.getDifficultyResourceKey(), new Object[0]); + } else if (par1EnumOptions == GameSettings.Options.GUI_SCALE) { + return var2 + getTranslation(GUISCALES, this.guiScale); + } else if (par1EnumOptions == GameSettings.Options.CHAT_VISIBILITY) { + return var2 + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]); + } else if (par1EnumOptions == GameSettings.Options.PARTICLES) { + return var2 + getTranslation(PARTICLES, this.particleSetting); + } else if (par1EnumOptions == GameSettings.Options.AMBIENT_OCCLUSION) { + return var2 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); + } else if (par1EnumOptions == GameSettings.Options.STREAM_COMPRESSION) { + return var2 + getTranslation(field_152391_aS, this.field_152405_O); + } else if (par1EnumOptions == GameSettings.Options.STREAM_CHAT_ENABLED) { + return var2 + getTranslation(field_152392_aT, this.field_152408_R); + } else if (par1EnumOptions == GameSettings.Options.STREAM_CHAT_USER_FILTER) { + return var2 + getTranslation(field_152393_aU, this.field_152409_S); + } else if (par1EnumOptions == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR) { + return var2 + getTranslation(field_152394_aV, this.field_152410_T); + } else if (par1EnumOptions == GameSettings.Options.GRAPHICS) { + if (this.fancyGraphics) { + return var2 + I18n.format("options.graphics.fancy", new Object[0]); + } else { + String var3 = "options.graphics.fast"; + return var2 + I18n.format("options.graphics.fast", new Object[0]); + } + } else { + return var2; + } + } + } + + /** + * Loads the options from the options file. It appears that this has replaced the previous 'loadOptions' + */ + public void loadOptions() { + try { + if (!this.optionsFile.exists()) { + return; + } + + BufferedReader var9 = new BufferedReader(new FileReader(this.optionsFile)); + String var2 = ""; + this.mapSoundLevels.clear(); + + while ((var2 = var9.readLine()) != null) { + try { + String[] var8 = var2.split(":"); + + if (var8[0].equals("mouseSensitivity")) { + this.mouseSensitivity = this.parseFloat(var8[1]); + } + + if (var8[0].equals("invertYMouse")) { + this.invertMouse = var8[1].equals("true"); + } + + if (var8[0].equals("fov")) { + this.fovSetting = this.parseFloat(var8[1]); + } + + if (var8[0].equals("gamma")) { + this.gammaSetting = this.parseFloat(var8[1]); + } + + if (var8[0].equals("saturation")) { + this.saturation = this.parseFloat(var8[1]); + } + + if (var8[0].equals("fov")) { + this.fovSetting = this.parseFloat(var8[1]) * 40.0F + 70.0F; + } + + if (var8[0].equals("renderDistance")) { + this.renderDistanceChunks = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("guiScale")) { + this.guiScale = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("particles")) { + this.particleSetting = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("bobView")) { + this.viewBobbing = var8[1].equals("true"); + } + + if (var8[0].equals("anaglyph3d")) { + this.anaglyph = var8[1].equals("true"); + } + + if (var8[0].equals("advancedOpengl")) { + this.advancedOpengl = var8[1].equals("true"); + } + + if (var8[0].equals("maxFps")) { + this.limitFramerate = Integer.parseInt(var8[1]); + this.enableVsync = false; + + if (this.limitFramerate <= 0) { + this.limitFramerate = (int)GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.enableVsync = true; + } + + this.updateVSync(); + } + + if (var8[0].equals("fboEnable")) { + this.fboEnable = var8[1].equals("true"); + } + + if (var8[0].equals("difficulty")) { + this.difficulty = EnumDifficulty.getDifficultyEnum(Integer.parseInt(var8[1])); + } + + if (var8[0].equals("fancyGraphics")) { + this.fancyGraphics = var8[1].equals("true"); + } + + if (var8[0].equals("ao")) { + if (var8[1].equals("true")) { + this.ambientOcclusion = 2; + } else if (var8[1].equals("false")) { + this.ambientOcclusion = 0; + } else { + this.ambientOcclusion = Integer.parseInt(var8[1]); + } + } + + if (var8[0].equals("clouds")) { + this.clouds = var8[1].equals("true"); + } + + if (var8[0].equals("resourcePacks")) { + this.resourcePacks = (List)gson.fromJson(var2.substring(var2.indexOf(58) + 1), typeListString); + + if (this.resourcePacks == null) { + this.resourcePacks = new ArrayList(); + } + } + + if (var8[0].equals("lastServer") && var8.length >= 2) { + this.lastServer = var2.substring(var2.indexOf(58) + 1); + } + + if (var8[0].equals("lang") && var8.length >= 2) { + this.language = var8[1]; + } + + if (var8[0].equals("chatVisibility")) { + this.chatVisibility = EnumChatVisibility.getEnumChatVisibility(Integer.parseInt(var8[1])); + } + + if (var8[0].equals("chatColors")) { + this.chatColours = var8[1].equals("true"); + } + + if (var8[0].equals("chatLinks")) { + this.chatLinks = var8[1].equals("true"); + } + + if (var8[0].equals("chatLinksPrompt")) { + this.chatLinksPrompt = var8[1].equals("true"); + } + + if (var8[0].equals("chatOpacity")) { + this.chatOpacity = this.parseFloat(var8[1]); + } + + if (var8[0].equals("snooperEnabled")) { + this.snooperEnabled = var8[1].equals("true"); + } + + if (var8[0].equals("fullscreen")) { + this.fullScreen = var8[1].equals("true"); + } + + if (var8[0].equals("enableVsync")) { + this.enableVsync = var8[1].equals("true"); + this.updateVSync(); + } + + if (var8[0].equals("hideServerAddress")) { + this.hideServerAddress = var8[1].equals("true"); + } + + if (var8[0].equals("advancedItemTooltips")) { + this.advancedItemTooltips = var8[1].equals("true"); + } + + if (var8[0].equals("pauseOnLostFocus")) { + this.pauseOnLostFocus = var8[1].equals("true"); + } + + if (var8[0].equals("showCape")) { + this.showCape = var8[1].equals("true"); + } + + if (var8[0].equals("touchscreen")) { + this.touchscreen = var8[1].equals("true"); + } + + if (var8[0].equals("overrideHeight")) { + this.overrideHeight = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("overrideWidth")) { + this.overrideWidth = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("heldItemTooltips")) { + this.heldItemTooltips = var8[1].equals("true"); + } + + if (var8[0].equals("chatHeightFocused")) { + this.chatHeightFocused = this.parseFloat(var8[1]); + } + + if (var8[0].equals("chatHeightUnfocused")) { + this.chatHeightUnfocused = this.parseFloat(var8[1]); + } + + if (var8[0].equals("chatScale")) { + this.chatScale = this.parseFloat(var8[1]); + } + + if (var8[0].equals("chatWidth")) { + this.chatWidth = this.parseFloat(var8[1]); + } + + if (var8[0].equals("showInventoryAchievementHint")) { + this.showInventoryAchievementHint = var8[1].equals("true"); + } + + if (var8[0].equals("mipmapLevels")) { + this.mipmapLevels = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("anisotropicFiltering")) { + this.anisotropicFiltering = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("streamBytesPerPixel")) { + this.field_152400_J = this.parseFloat(var8[1]); + } + + if (var8[0].equals("streamMicVolume")) { + this.field_152401_K = this.parseFloat(var8[1]); + } + + if (var8[0].equals("streamSystemVolume")) { + this.field_152402_L = this.parseFloat(var8[1]); + } + + if (var8[0].equals("streamKbps")) { + this.field_152403_M = this.parseFloat(var8[1]); + } + + if (var8[0].equals("streamFps")) { + this.field_152404_N = this.parseFloat(var8[1]); + } + + if (var8[0].equals("streamCompression")) { + this.field_152405_O = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("streamSendMetadata")) { + this.field_152406_P = var8[1].equals("true"); + } + + if (var8[0].equals("streamPreferredServer") && var8.length >= 2) { + this.field_152407_Q = var2.substring(var2.indexOf(58) + 1); + } + + if (var8[0].equals("streamChatEnabled")) { + this.field_152408_R = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("streamChatUserFilter")) { + this.field_152409_S = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("streamMicToggleBehavior")) { + this.field_152410_T = Integer.parseInt(var8[1]); + } + + if (var8[0].equals("forceUnicodeFont")) { + this.forceUnicodeFont = var8[1].equals("true"); + } + + KeyBinding[] var4 = this.keyBindings; + int var5 = var4.length; + int var6; + + for (var6 = 0; var6 < var5; ++var6) { + KeyBinding var10 = var4[var6]; + + if (var8[0].equals("key_" + var10.getKeyDescription())) { + var10.setKeyCode(Integer.parseInt(var8[1])); + } + } + + SoundCategory[] var111 = SoundCategory.values(); + var5 = var111.length; + + for (var6 = 0; var6 < var5; ++var6) { + SoundCategory var11 = var111[var6]; + + if (var8[0].equals("soundCategory_" + var11.getCategoryName())) { + this.mapSoundLevels.put(var11, Float.valueOf(this.parseFloat(var8[1]))); + } + } + } catch (Exception var91) { + logger.warn("Skipping bad option: " + var2); + var91.printStackTrace(); + } + } + + KeyBinding.resetKeyBindingArrayAndHash(); + var9.close(); + } catch (Exception var101) { + logger.error("Failed to load options", var101); + } + + this.loadOfOptions(); + } + + /** + * Parses a string into a float. + */ + private float parseFloat(String par1Str) { + return par1Str.equals("true") ? 1.0F : (par1Str.equals("false") ? 0.0F : Float.parseFloat(par1Str)); + } + + /** + * Saves the options to the options file. + */ + public void saveOptions() { + if (Reflector.FMLClientHandler.exists()) { + Object var6 = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); + + if (var6 != null && Reflector.callBoolean(var6, Reflector.FMLClientHandler_isLoading, new Object[0])) { + return; + } + } + + try { + PrintWriter var81 = new PrintWriter(new FileWriter(this.optionsFile)); + var81.println("invertYMouse:" + this.invertMouse); + var81.println("mouseSensitivity:" + this.mouseSensitivity); + var81.println("fov:" + (this.fovSetting - 70.0F) / 40.0F); + var81.println("gamma:" + this.gammaSetting); + var81.println("saturation:" + this.saturation); + var81.println("renderDistance:" + Config.limit(this.renderDistanceChunks, 2, 16)); + var81.println("guiScale:" + this.guiScale); + var81.println("particles:" + this.particleSetting); + var81.println("bobView:" + this.viewBobbing); + var81.println("anaglyph3d:" + this.anaglyph); + var81.println("advancedOpengl:" + this.advancedOpengl); + var81.println("maxFps:" + this.limitFramerate); + var81.println("fboEnable:" + this.fboEnable); + var81.println("difficulty:" + this.difficulty.getDifficultyId()); + var81.println("fancyGraphics:" + this.fancyGraphics); + var81.println("ao:" + this.ambientOcclusion); + var81.println("clouds:" + this.clouds); + var81.println("resourcePacks:" + gson.toJson(this.resourcePacks)); + var81.println("lastServer:" + this.lastServer); + var81.println("lang:" + this.language); + var81.println("chatVisibility:" + this.chatVisibility.getChatVisibility()); + var81.println("chatColors:" + this.chatColours); + var81.println("chatLinks:" + this.chatLinks); + var81.println("chatLinksPrompt:" + this.chatLinksPrompt); + var81.println("chatOpacity:" + this.chatOpacity); + var81.println("snooperEnabled:" + this.snooperEnabled); + var81.println("fullscreen:" + this.fullScreen); + var81.println("enableVsync:" + this.enableVsync); + var81.println("hideServerAddress:" + this.hideServerAddress); + var81.println("advancedItemTooltips:" + this.advancedItemTooltips); + var81.println("pauseOnLostFocus:" + this.pauseOnLostFocus); + var81.println("showCape:" + this.showCape); + var81.println("touchscreen:" + this.touchscreen); + var81.println("overrideWidth:" + this.overrideWidth); + var81.println("overrideHeight:" + this.overrideHeight); + var81.println("heldItemTooltips:" + this.heldItemTooltips); + var81.println("chatHeightFocused:" + this.chatHeightFocused); + var81.println("chatHeightUnfocused:" + this.chatHeightUnfocused); + var81.println("chatScale:" + this.chatScale); + var81.println("chatWidth:" + this.chatWidth); + var81.println("showInventoryAchievementHint:" + this.showInventoryAchievementHint); + var81.println("mipmapLevels:" + this.mipmapLevels); + var81.println("anisotropicFiltering:" + this.anisotropicFiltering); + var81.println("streamBytesPerPixel:" + this.field_152400_J); + var81.println("streamMicVolume:" + this.field_152401_K); + var81.println("streamSystemVolume:" + this.field_152402_L); + var81.println("streamKbps:" + this.field_152403_M); + var81.println("streamFps:" + this.field_152404_N); + var81.println("streamCompression:" + this.field_152405_O); + var81.println("streamSendMetadata:" + this.field_152406_P); + var81.println("streamPreferredServer:" + this.field_152407_Q); + var81.println("streamChatEnabled:" + this.field_152408_R); + var81.println("streamChatUserFilter:" + this.field_152409_S); + var81.println("streamMicToggleBehavior:" + this.field_152410_T); + var81.println("forceUnicodeFont:" + this.forceUnicodeFont); + KeyBinding[] var2 = this.keyBindings; + int var3 = var2.length; + int var4; + + for (var4 = 0; var4 < var3; ++var4) { + KeyBinding var7 = var2[var4]; + var81.println("key_" + var7.getKeyDescription() + ":" + var7.getKeyCode()); + } + + SoundCategory[] var9 = SoundCategory.values(); + var3 = var9.length; + + for (var4 = 0; var4 < var3; ++var4) { + SoundCategory var8 = var9[var4]; + var81.println("soundCategory_" + var8.getCategoryName() + ":" + this.getSoundLevel(var8)); + } + + var81.close(); + } catch (Exception var71) { + logger.error("Failed to save options", var71); + } + + this.saveOfOptions(); + this.sendSettingsToServer(); + } + + public float getSoundLevel(SoundCategory p_151438_1_) { + return this.mapSoundLevels.containsKey(p_151438_1_) ? ((Float)this.mapSoundLevels.get(p_151438_1_)).floatValue() : 1.0F; + } + + public void setSoundLevel(SoundCategory p_151439_1_, float p_151439_2_) { + this.mc.getSoundHandler().setSoundLevel(p_151439_1_, p_151439_2_); + this.mapSoundLevels.put(p_151439_1_, Float.valueOf(p_151439_2_)); + } + + /** + * Send a client info packet with settings information to the server + */ + public void sendSettingsToServer() { + if (this.mc.thePlayer != null) { + this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language, this.renderDistanceChunks, this.chatVisibility, this.chatColours, this.difficulty, this.showCape)); + } + } + + /** + * Should render clouds + */ + public boolean shouldRenderClouds() { + return this.renderDistanceChunks >= 4 && this.clouds; + } + + public void loadOfOptions() { + try { + File exception = this.optionsFileOF; + + if (!exception.exists()) { + exception = this.optionsFile; + } + + if (!exception.exists()) { + return; + } + + BufferedReader bufferedreader = new BufferedReader(new FileReader(exception)); + String s = ""; + + while ((s = bufferedreader.readLine()) != null) { + try { + String[] exception1 = s.split(":"); + + if (exception1[0].equals("ofRenderDistanceChunks") && exception1.length >= 2) { + this.renderDistanceChunks = Integer.valueOf(exception1[1]).intValue(); + this.renderDistanceChunks = Config.limit(this.renderDistanceChunks, 2, 32); + } + + if (exception1[0].equals("ofFogType") && exception1.length >= 2) { + this.ofFogType = Integer.valueOf(exception1[1]).intValue(); + this.ofFogType = Config.limit(this.ofFogType, 1, 3); + } + + if (exception1[0].equals("ofFogStart") && exception1.length >= 2) { + this.ofFogStart = Float.valueOf(exception1[1]).floatValue(); + + if (this.ofFogStart < 0.2F) { + this.ofFogStart = 0.2F; + } + + if (this.ofFogStart > 0.81F) { + this.ofFogStart = 0.8F; + } + } + + if (exception1[0].equals("ofMipmapType") && exception1.length >= 2) { + this.ofMipmapType = Integer.valueOf(exception1[1]).intValue(); + this.ofMipmapType = Config.limit(this.ofMipmapType, 0, 3); + } + + if (exception1[0].equals("ofLoadFar") && exception1.length >= 2) { + this.ofLoadFar = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofPreloadedChunks") && exception1.length >= 2) { + this.ofPreloadedChunks = Integer.valueOf(exception1[1]).intValue(); + + if (this.ofPreloadedChunks < 0) { + this.ofPreloadedChunks = 0; + } + + if (this.ofPreloadedChunks > 8) { + this.ofPreloadedChunks = 8; + } + } + + if (exception1[0].equals("ofOcclusionFancy") && exception1.length >= 2) { + this.ofOcclusionFancy = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofSmoothFps") && exception1.length >= 2) { + this.ofSmoothFps = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofSmoothWorld") && exception1.length >= 2) { + this.ofSmoothWorld = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAoLevel") && exception1.length >= 2) { + this.ofAoLevel = Float.valueOf(exception1[1]).floatValue(); + this.ofAoLevel = Config.limit(this.ofAoLevel, 0.0F, 1.0F); + } + + if (exception1[0].equals("ofClouds") && exception1.length >= 2) { + this.ofClouds = Integer.valueOf(exception1[1]).intValue(); + this.ofClouds = Config.limit(this.ofClouds, 0, 3); + } + + if (exception1[0].equals("ofCloudsHeight") && exception1.length >= 2) { + this.ofCloudsHeight = Float.valueOf(exception1[1]).floatValue(); + this.ofCloudsHeight = Config.limit(this.ofCloudsHeight, 0.0F, 1.0F); + } + + if (exception1[0].equals("ofTrees") && exception1.length >= 2) { + this.ofTrees = Integer.valueOf(exception1[1]).intValue(); + this.ofTrees = Config.limit(this.ofTrees, 0, 2); + } + + if (exception1[0].equals("ofGrass") && exception1.length >= 2) { + this.ofGrass = Integer.valueOf(exception1[1]).intValue(); + this.ofGrass = Config.limit(this.ofGrass, 0, 2); + } + + if (exception1[0].equals("ofDroppedItems") && exception1.length >= 2) { + this.ofDroppedItems = Integer.valueOf(exception1[1]).intValue(); + this.ofDroppedItems = Config.limit(this.ofDroppedItems, 0, 2); + } + + if (exception1[0].equals("ofRain") && exception1.length >= 2) { + this.ofRain = Integer.valueOf(exception1[1]).intValue(); + this.ofRain = Config.limit(this.ofRain, 0, 3); + } + + if (exception1[0].equals("ofWater") && exception1.length >= 2) { + this.ofWater = Integer.valueOf(exception1[1]).intValue(); + this.ofWater = Config.limit(this.ofWater, 0, 3); + } + + if (exception1[0].equals("ofAnimatedWater") && exception1.length >= 2) { + this.ofAnimatedWater = Integer.valueOf(exception1[1]).intValue(); + this.ofAnimatedWater = Config.limit(this.ofAnimatedWater, 0, 2); + } + + if (exception1[0].equals("ofAnimatedLava") && exception1.length >= 2) { + this.ofAnimatedLava = Integer.valueOf(exception1[1]).intValue(); + this.ofAnimatedLava = Config.limit(this.ofAnimatedLava, 0, 2); + } + + if (exception1[0].equals("ofAnimatedFire") && exception1.length >= 2) { + this.ofAnimatedFire = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedPortal") && exception1.length >= 2) { + this.ofAnimatedPortal = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedRedstone") && exception1.length >= 2) { + this.ofAnimatedRedstone = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedExplosion") && exception1.length >= 2) { + this.ofAnimatedExplosion = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedFlame") && exception1.length >= 2) { + this.ofAnimatedFlame = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedSmoke") && exception1.length >= 2) { + this.ofAnimatedSmoke = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofVoidParticles") && exception1.length >= 2) { + this.ofVoidParticles = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofWaterParticles") && exception1.length >= 2) { + this.ofWaterParticles = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofPortalParticles") && exception1.length >= 2) { + this.ofPortalParticles = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofPotionParticles") && exception1.length >= 2) { + this.ofPotionParticles = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofDrippingWaterLava") && exception1.length >= 2) { + this.ofDrippingWaterLava = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedTerrain") && exception1.length >= 2) { + this.ofAnimatedTerrain = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedTextures") && exception1.length >= 2) { + this.ofAnimatedTextures = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAnimatedItems") && exception1.length >= 2) { + this.ofAnimatedItems = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofRainSplash") && exception1.length >= 2) { + this.ofRainSplash = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofLagometer") && exception1.length >= 2) { + this.ofLagometer = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofShowFps") && exception1.length >= 2) { + this.ofShowFps = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAutoSaveTicks") && exception1.length >= 2) { + this.ofAutoSaveTicks = Integer.valueOf(exception1[1]).intValue(); + this.ofAutoSaveTicks = Config.limit(this.ofAutoSaveTicks, 40, 40000); + } + + if (exception1[0].equals("ofBetterGrass") && exception1.length >= 2) { + this.ofBetterGrass = Integer.valueOf(exception1[1]).intValue(); + this.ofBetterGrass = Config.limit(this.ofBetterGrass, 1, 3); + } + + if (exception1[0].equals("ofConnectedTextures") && exception1.length >= 2) { + this.ofConnectedTextures = Integer.valueOf(exception1[1]).intValue(); + this.ofConnectedTextures = Config.limit(this.ofConnectedTextures, 1, 3); + } + + if (exception1[0].equals("ofWeather") && exception1.length >= 2) { + this.ofWeather = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofSky") && exception1.length >= 2) { + this.ofSky = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofStars") && exception1.length >= 2) { + this.ofStars = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofSunMoon") && exception1.length >= 2) { + this.ofSunMoon = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofVignette") && exception1.length >= 2) { + this.ofVignette = Integer.valueOf(exception1[1]).intValue(); + this.ofVignette = Config.limit(this.ofVignette, 0, 2); + } + + if (exception1[0].equals("ofChunkUpdates") && exception1.length >= 2) { + this.ofChunkUpdates = Integer.valueOf(exception1[1]).intValue(); + this.ofChunkUpdates = Config.limit(this.ofChunkUpdates, 1, 5); + } + + if (exception1[0].equals("ofChunkLoading") && exception1.length >= 2) { + this.ofChunkLoading = Integer.valueOf(exception1[1]).intValue(); + this.ofChunkLoading = Config.limit(this.ofChunkLoading, 0, 2); + this.updateChunkLoading(); + } + + if (exception1[0].equals("ofChunkUpdatesDynamic") && exception1.length >= 2) { + this.ofChunkUpdatesDynamic = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofTime") && exception1.length >= 2) { + this.ofTime = Integer.valueOf(exception1[1]).intValue(); + this.ofTime = Config.limit(this.ofTime, 0, 3); + } + + if (exception1[0].equals("ofClearWater") && exception1.length >= 2) { + this.ofClearWater = Boolean.valueOf(exception1[1]).booleanValue(); + this.updateWaterOpacity(); + } + + if (exception1[0].equals("ofDepthFog") && exception1.length >= 2) { + this.ofDepthFog = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofAaLevel") && exception1.length >= 2) { + this.ofAaLevel = Integer.valueOf(exception1[1]).intValue(); + this.ofAaLevel = Config.limit(this.ofAaLevel, 0, 16); + } + + if (exception1[0].equals("ofProfiler") && exception1.length >= 2) { + this.ofProfiler = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofBetterSnow") && exception1.length >= 2) { + this.ofBetterSnow = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofSwampColors") && exception1.length >= 2) { + this.ofSwampColors = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofRandomMobs") && exception1.length >= 2) { + this.ofRandomMobs = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofSmoothBiomes") && exception1.length >= 2) { + this.ofSmoothBiomes = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofCustomFonts") && exception1.length >= 2) { + this.ofCustomFonts = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofCustomColors") && exception1.length >= 2) { + this.ofCustomColors = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofCustomSky") && exception1.length >= 2) { + this.ofCustomSky = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofShowCapes") && exception1.length >= 2) { + this.ofShowCapes = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofNaturalTextures") && exception1.length >= 2) { + this.ofNaturalTextures = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofLazyChunkLoading") && exception1.length >= 2) { + this.ofLazyChunkLoading = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofDynamicFov") && exception1.length >= 2) { + this.ofDynamicFov = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofDynamicLights") && exception1.length >= 2) { + this.ofDynamicLights = Integer.valueOf(exception1[1]).intValue(); + this.ofDynamicLights = Config.limit(this.ofDynamicLights, 1, 3); + } + + if (exception1[0].equals("ofFullscreenMode") && exception1.length >= 2) { + this.ofFullscreenMode = exception1[1]; + } + + if (exception1[0].equals("ofFastMath") && exception1.length >= 2) { + this.ofFastMath = Boolean.valueOf(exception1[1]).booleanValue(); + MathHelper.fastMath = this.ofFastMath; + } + + if (exception1[0].equals("ofFastRender") && exception1.length >= 2) { + this.ofFastRender = Boolean.valueOf(exception1[1]).booleanValue(); + } + + if (exception1[0].equals("ofTranslucentBlocks") && exception1.length >= 2) { + this.ofTranslucentBlocks = Integer.valueOf(exception1[1]).intValue(); + this.ofTranslucentBlocks = Config.limit(this.ofTranslucentBlocks, 1, 2); + } + } catch (Exception var5) { + Config.dbg("Skipping bad option: " + s); + var5.printStackTrace(); + } + } + + KeyBinding.resetKeyBindingArrayAndHash(); + bufferedreader.close(); + } catch (Exception var6) { + Config.warn("Failed to load options"); + var6.printStackTrace(); + } + } + + public void saveOfOptions() { + try { + PrintWriter exception = new PrintWriter(new FileWriter(this.optionsFileOF)); + exception.println("ofRenderDistanceChunks:" + this.renderDistanceChunks); + exception.println("ofFogType:" + this.ofFogType); + exception.println("ofFogStart:" + this.ofFogStart); + exception.println("ofMipmapType:" + this.ofMipmapType); + exception.println("ofLoadFar:" + this.ofLoadFar); + exception.println("ofPreloadedChunks:" + this.ofPreloadedChunks); + exception.println("ofOcclusionFancy:" + this.ofOcclusionFancy); + exception.println("ofSmoothFps:" + this.ofSmoothFps); + exception.println("ofSmoothWorld:" + this.ofSmoothWorld); + exception.println("ofAoLevel:" + this.ofAoLevel); + exception.println("ofClouds:" + this.ofClouds); + exception.println("ofCloudsHeight:" + this.ofCloudsHeight); + exception.println("ofTrees:" + this.ofTrees); + exception.println("ofGrass:" + this.ofGrass); + exception.println("ofDroppedItems:" + this.ofDroppedItems); + exception.println("ofRain:" + this.ofRain); + exception.println("ofWater:" + this.ofWater); + exception.println("ofAnimatedWater:" + this.ofAnimatedWater); + exception.println("ofAnimatedLava:" + this.ofAnimatedLava); + exception.println("ofAnimatedFire:" + this.ofAnimatedFire); + exception.println("ofAnimatedPortal:" + this.ofAnimatedPortal); + exception.println("ofAnimatedRedstone:" + this.ofAnimatedRedstone); + exception.println("ofAnimatedExplosion:" + this.ofAnimatedExplosion); + exception.println("ofAnimatedFlame:" + this.ofAnimatedFlame); + exception.println("ofAnimatedSmoke:" + this.ofAnimatedSmoke); + exception.println("ofVoidParticles:" + this.ofVoidParticles); + exception.println("ofWaterParticles:" + this.ofWaterParticles); + exception.println("ofPortalParticles:" + this.ofPortalParticles); + exception.println("ofPotionParticles:" + this.ofPotionParticles); + exception.println("ofDrippingWaterLava:" + this.ofDrippingWaterLava); + exception.println("ofAnimatedTerrain:" + this.ofAnimatedTerrain); + exception.println("ofAnimatedTextures:" + this.ofAnimatedTextures); + exception.println("ofAnimatedItems:" + this.ofAnimatedItems); + exception.println("ofRainSplash:" + this.ofRainSplash); + exception.println("ofLagometer:" + this.ofLagometer); + exception.println("ofShowFps:" + this.ofShowFps); + exception.println("ofAutoSaveTicks:" + this.ofAutoSaveTicks); + exception.println("ofBetterGrass:" + this.ofBetterGrass); + exception.println("ofConnectedTextures:" + this.ofConnectedTextures); + exception.println("ofWeather:" + this.ofWeather); + exception.println("ofSky:" + this.ofSky); + exception.println("ofStars:" + this.ofStars); + exception.println("ofSunMoon:" + this.ofSunMoon); + exception.println("ofVignette:" + this.ofVignette); + exception.println("ofChunkUpdates:" + this.ofChunkUpdates); + exception.println("ofChunkLoading:" + this.ofChunkLoading); + exception.println("ofChunkUpdatesDynamic:" + this.ofChunkUpdatesDynamic); + exception.println("ofTime:" + this.ofTime); + exception.println("ofClearWater:" + this.ofClearWater); + exception.println("ofDepthFog:" + this.ofDepthFog); + exception.println("ofAaLevel:" + this.ofAaLevel); + exception.println("ofProfiler:" + this.ofProfiler); + exception.println("ofBetterSnow:" + this.ofBetterSnow); + exception.println("ofSwampColors:" + this.ofSwampColors); + exception.println("ofRandomMobs:" + this.ofRandomMobs); + exception.println("ofSmoothBiomes:" + this.ofSmoothBiomes); + exception.println("ofCustomFonts:" + this.ofCustomFonts); + exception.println("ofCustomColors:" + this.ofCustomColors); + exception.println("ofCustomSky:" + this.ofCustomSky); + exception.println("ofShowCapes:" + this.ofShowCapes); + exception.println("ofNaturalTextures:" + this.ofNaturalTextures); + exception.println("ofLazyChunkLoading:" + this.ofLazyChunkLoading); + exception.println("ofDynamicFov:" + this.ofDynamicFov); + exception.println("ofDynamicLights:" + this.ofDynamicLights); + exception.println("ofFullscreenMode:" + this.ofFullscreenMode); + exception.println("ofFastMath:" + this.ofFastMath); + exception.println("ofFastRender:" + this.ofFastRender); + exception.println("ofTranslucentBlocks:" + this.ofTranslucentBlocks); + exception.close(); + } catch (Exception var2) { + Config.warn("Failed to save options"); + var2.printStackTrace(); + } + } + + public void resetSettings() { + this.renderDistanceChunks = 8; + this.viewBobbing = true; + this.anaglyph = false; + this.advancedOpengl = false; + this.limitFramerate = (int)GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + this.enableVsync = false; + this.updateVSync(); + this.mipmapLevels = 4; + this.anisotropicFiltering = 1; + this.fancyGraphics = true; + this.ambientOcclusion = 2; + this.clouds = true; + this.fovSetting = 70.0F; + this.gammaSetting = 0.0F; + this.guiScale = 0; + this.particleSetting = 0; + this.heldItemTooltips = true; + this.ofFogType = 1; + this.ofFogStart = 0.8F; + this.ofMipmapType = 0; + this.ofLoadFar = false; + this.ofPreloadedChunks = 0; + this.ofOcclusionFancy = false; + this.ofSmoothFps = false; + Config.updateAvailableProcessors(); + this.ofSmoothWorld = Config.isSingleProcessor(); + this.ofLazyChunkLoading = Config.isSingleProcessor(); + this.ofFastMath = false; + this.ofFastRender = false; + this.ofTranslucentBlocks = 2; + this.ofDynamicFov = true; + this.ofDynamicLights = 3; + this.ofAoLevel = 1.0F; + this.ofAaLevel = 0; + this.ofClouds = 0; + this.ofCloudsHeight = 0.0F; + this.ofTrees = 0; + this.ofGrass = 0; + this.ofRain = 0; + this.ofWater = 0; + this.ofBetterGrass = 3; + this.ofAutoSaveTicks = 4000; + this.ofLagometer = false; + this.ofShowFps = false; + this.ofProfiler = false; + this.ofWeather = true; + this.ofSky = true; + this.ofStars = true; + this.ofSunMoon = true; + this.ofVignette = 0; + this.ofChunkUpdates = 1; + this.ofChunkLoading = 0; + this.ofChunkUpdatesDynamic = false; + this.ofTime = 0; + this.ofClearWater = false; + this.ofDepthFog = true; + this.ofBetterSnow = false; + this.ofFullscreenMode = "Default"; + this.ofSwampColors = true; + this.ofRandomMobs = true; + this.ofSmoothBiomes = true; + this.ofCustomFonts = true; + this.ofCustomColors = true; + this.ofCustomSky = true; + this.ofShowCapes = true; + this.ofConnectedTextures = 2; + this.ofNaturalTextures = false; + this.ofAnimatedWater = 0; + this.ofAnimatedLava = 0; + this.ofAnimatedFire = true; + this.ofAnimatedPortal = true; + this.ofAnimatedRedstone = true; + this.ofAnimatedExplosion = true; + this.ofAnimatedFlame = true; + this.ofAnimatedSmoke = true; + this.ofVoidParticles = true; + this.ofWaterParticles = true; + this.ofRainSplash = true; + this.ofPortalParticles = true; + this.ofPotionParticles = true; + this.ofDrippingWaterLava = true; + this.ofAnimatedTerrain = true; + this.ofAnimatedItems = true; + this.ofAnimatedTextures = true; + Shaders.setShaderPack(Shaders.packNameNone); + Shaders.configAntialiasingLevel = 0; + Shaders.uninit(); + Shaders.storeConfig(); + this.mc.renderGlobal.updateCapes(); + this.updateWaterOpacity(); + this.mc.renderGlobal.setAllRenderersVisible(); + this.mc.refreshResources(); + this.saveOptions(); + } + + public void updateVSync() { + Display.setVSyncEnabled(this.enableVsync); + } + + private void updateWaterOpacity() { + if (this.mc.isIntegratedServerRunning() && this.mc.getIntegratedServer() != null) { + Config.waterOpacityChanged = true; + } + + ClearWater.updateWaterOpacity(this, this.mc.theWorld); + } + + public void updateChunkLoading() { + switch (this.ofChunkLoading) { + case 1: + WrUpdates.setWrUpdater(new WrUpdaterSmooth()); + break; + + case 2: + WrUpdates.setWrUpdater(new WrUpdaterThreaded()); + break; + + default: + WrUpdates.setWrUpdater((IWrUpdater)null); + } + + if (this.mc.renderGlobal != null) { + this.mc.renderGlobal.loadRenderers(); + } + } + + public void setAllAnimations(boolean flag) { + int animVal = flag ? 0 : 2; + this.ofAnimatedWater = animVal; + this.ofAnimatedLava = animVal; + this.ofAnimatedFire = flag; + this.ofAnimatedPortal = flag; + this.ofAnimatedRedstone = flag; + this.ofAnimatedExplosion = flag; + this.ofAnimatedFlame = flag; + this.ofAnimatedSmoke = flag; + this.ofVoidParticles = flag; + this.ofWaterParticles = flag; + this.ofRainSplash = flag; + this.ofPortalParticles = flag; + this.ofPotionParticles = flag; + this.particleSetting = flag ? 0 : 2; + this.ofDrippingWaterLava = flag; + this.ofAnimatedTerrain = flag; + this.ofAnimatedItems = flag; + this.ofAnimatedTextures = flag; + } + + private static int nextValue(int val, int[] vals) { + int index = indexOf(val, vals); + + if (index < 0) { + return vals[0]; + } else { + ++index; + + if (index >= vals.length) { + index = 0; + } + + return vals[index]; + } + } + + private static int limit(int val, int[] vals) { + int index = indexOf(val, vals); + return index < 0 ? vals[0] : val; + } + + private static int indexOf(int val, int[] vals) { + for (int i = 0; i < vals.length; ++i) { + if (vals[i] == val) { + return i; + } + } + + return -1; + } + + public static enum Options { + INVERT_MOUSE("INVERT_MOUSE", 0, "INVERT_MOUSE", 0, "options.invertMouse", false, true), + SENSITIVITY("SENSITIVITY", 1, "SENSITIVITY", 1, "options.sensitivity", true, false), + FOV("FOV", 2, "FOV", 2, "options.fov", true, false, 30.0F, 110.0F, 1.0F), + GAMMA("GAMMA", 3, "GAMMA", 3, "options.gamma", true, false), + SATURATION("SATURATION", 4, "SATURATION", 4, "options.saturation", true, false), + RENDER_DISTANCE("RENDER_DISTANCE", 5, "RENDER_DISTANCE", 5, "options.renderDistance", true, false, 2.0F, 16.0F, 1.0F), + VIEW_BOBBING("VIEW_BOBBING", 6, "VIEW_BOBBING", 6, "options.viewBobbing", false, true), + ANAGLYPH("ANAGLYPH", 7, "ANAGLYPH", 7, "options.anaglyph", false, true), + ADVANCED_OPENGL("ADVANCED_OPENGL", 8, "ADVANCED_OPENGL", 8, "options.advancedOpengl", false, true), + FRAMERATE_LIMIT("FRAMERATE_LIMIT", 9, "FRAMERATE_LIMIT", 9, "options.framerateLimit", true, false, 0.0F, 260.0F, 5.0F), + FBO_ENABLE("FBO_ENABLE", 10, "FBO_ENABLE", 10, "options.fboEnable", false, true), + DIFFICULTY("DIFFICULTY", 11, "DIFFICULTY", 11, "options.difficulty", false, false), + GRAPHICS("GRAPHICS", 12, "GRAPHICS", 12, "options.graphics", false, false), + AMBIENT_OCCLUSION("AMBIENT_OCCLUSION", 13, "AMBIENT_OCCLUSION", 13, "options.ao", false, false), + GUI_SCALE("GUI_SCALE", 14, "GUI_SCALE", 14, "options.guiScale", false, false), + RENDER_CLOUDS("RENDER_CLOUDS", 15, "RENDER_CLOUDS", 15, "options.renderClouds", false, true), + PARTICLES("PARTICLES", 16, "PARTICLES", 16, "options.particles", false, false), + CHAT_VISIBILITY("CHAT_VISIBILITY", 17, "CHAT_VISIBILITY", 17, "options.chat.visibility", false, false), + CHAT_COLOR("CHAT_COLOR", 18, "CHAT_COLOR", 18, "options.chat.color", false, true), + CHAT_LINKS("CHAT_LINKS", 19, "CHAT_LINKS", 19, "options.chat.links", false, true), + CHAT_OPACITY("CHAT_OPACITY", 20, "CHAT_OPACITY", 20, "options.chat.opacity", true, false), + CHAT_LINKS_PROMPT("CHAT_LINKS_PROMPT", 21, "CHAT_LINKS_PROMPT", 21, "options.chat.links.prompt", false, true), + SNOOPER_ENABLED("SNOOPER_ENABLED", 22, "SNOOPER_ENABLED", 22, "options.snooper", false, true), + USE_FULLSCREEN("USE_FULLSCREEN", 23, "USE_FULLSCREEN", 23, "options.fullscreen", false, true), + ENABLE_VSYNC("ENABLE_VSYNC", 24, "ENABLE_VSYNC", 24, "options.vsync", false, true), + SHOW_CAPE("SHOW_CAPE", 25, "SHOW_CAPE", 25, "options.showCape", false, true), + TOUCHSCREEN("TOUCHSCREEN", 26, "TOUCHSCREEN", 26, "options.touchscreen", false, true), + CHAT_SCALE("CHAT_SCALE", 27, "CHAT_SCALE", 27, "options.chat.scale", true, false), + CHAT_WIDTH("CHAT_WIDTH", 28, "CHAT_WIDTH", 28, "options.chat.width", true, false), + CHAT_HEIGHT_FOCUSED("CHAT_HEIGHT_FOCUSED", 29, "CHAT_HEIGHT_FOCUSED", 29, "options.chat.height.focused", true, false), + CHAT_HEIGHT_UNFOCUSED("CHAT_HEIGHT_UNFOCUSED", 30, "CHAT_HEIGHT_UNFOCUSED", 30, "options.chat.height.unfocused", true, false), + MIPMAP_LEVELS("MIPMAP_LEVELS", 31, "MIPMAP_LEVELS", 31, "options.mipmapLevels", true, false, 0.0F, 4.0F, 1.0F), + ANISOTROPIC_FILTERING("ANISOTROPIC_FILTERING", 32, "ANISOTROPIC_FILTERING", 32, "options.anisotropicFiltering", true, false, 1.0F, 16.0F, 0.0F, (Object)null, null) { + protected float snapToStep(float p_148264_1_) { + return (float)MathHelper.roundUpToPowerOfTwo((int)p_148264_1_); + } + }, + FORCE_UNICODE_FONT("FORCE_UNICODE_FONT", 33, "FORCE_UNICODE_FONT", 33, "options.forceUnicodeFont", false, true), + STREAM_BYTES_PER_PIXEL("STREAM_BYTES_PER_PIXEL", 34, "STREAM_BYTES_PER_PIXEL", 34, "options.stream.bytesPerPixel", true, false), + STREAM_VOLUME_MIC("STREAM_VOLUME_MIC", 35, "STREAM_VOLUME_MIC", 35, "options.stream.micVolumne", true, false), + STREAM_VOLUME_SYSTEM("STREAM_VOLUME_SYSTEM", 36, "STREAM_VOLUME_SYSTEM", 36, "options.stream.systemVolume", true, false), + STREAM_KBPS("STREAM_KBPS", 37, "STREAM_KBPS", 37, "options.stream.kbps", true, false), + STREAM_FPS("STREAM_FPS", 38, "STREAM_FPS", 38, "options.stream.fps", true, false), + STREAM_COMPRESSION("STREAM_COMPRESSION", 39, "STREAM_COMPRESSION", 39, "options.stream.compression", false, false), + STREAM_SEND_METADATA("STREAM_SEND_METADATA", 40, "STREAM_SEND_METADATA", 40, "options.stream.sendMetadata", false, true), + STREAM_CHAT_ENABLED("STREAM_CHAT_ENABLED", 41, "STREAM_CHAT_ENABLED", 41, "options.stream.chat.enabled", false, false), + STREAM_CHAT_USER_FILTER("STREAM_CHAT_USER_FILTER", 42, "STREAM_CHAT_USER_FILTER", 42, "options.stream.chat.userFilter", false, false), + STREAM_MIC_TOGGLE_BEHAVIOR("STREAM_MIC_TOGGLE_BEHAVIOR", 43, "STREAM_MIC_TOGGLE_BEHAVIOR", 43, "options.stream.micToggleBehavior", false, false), + FOG_FANCY("FOG_FANCY", 44, "", 999, "of.options.FOG_FANCY", false, false), + FOG_START("FOG_START", 45, "", 999, "of.options.FOG_START", false, false), + MIPMAP_TYPE("MIPMAP_TYPE", 46, "", 999, "of.options.MIPMAP_TYPE", true, false, 0.0F, 3.0F, 1.0F), + LOAD_FAR("LOAD_FAR", 47, "", 999, "Load Far", false, false), + PRELOADED_CHUNKS("PRELOADED_CHUNKS", 48, "", 999, "Preloaded Chunks", false, false), + SMOOTH_FPS("SMOOTH_FPS", 49, "", 999, "of.options.SMOOTH_FPS", false, false), + CLOUDS("CLOUDS", 50, "", 999, "of.options.CLOUDS", false, false), + CLOUD_HEIGHT("CLOUD_HEIGHT", 51, "", 999, "of.options.CLOUD_HEIGHT", true, false), + TREES("TREES", 52, "", 999, "of.options.TREES", false, false), + GRASS("GRASS", 53, "", 999, "Grass", false, false), + RAIN("RAIN", 54, "", 999, "of.options.RAIN", false, false), + WATER("WATER", 55, "", 999, "Water", false, false), + ANIMATED_WATER("ANIMATED_WATER", 56, "", 999, "of.options.ANIMATED_WATER", false, false), + ANIMATED_LAVA("ANIMATED_LAVA", 57, "", 999, "of.options.ANIMATED_LAVA", false, false), + ANIMATED_FIRE("ANIMATED_FIRE", 58, "", 999, "of.options.ANIMATED_FIRE", false, false), + ANIMATED_PORTAL("ANIMATED_PORTAL", 59, "", 999, "of.options.ANIMATED_PORTAL", false, false), + AO_LEVEL("AO_LEVEL", 60, "", 999, "of.options.AO_LEVEL", true, false), + LAGOMETER("LAGOMETER", 61, "", 999, "of.options.LAGOMETER", false, false), + SHOW_FPS("SHOW_FPS", 62, "", 999, "of.options.SHOW_FPS", false, false), + AUTOSAVE_TICKS("AUTOSAVE_TICKS", 63, "", 999, "of.options.AUTOSAVE_TICKS", false, false), + BETTER_GRASS("BETTER_GRASS", 64, "", 999, "of.options.BETTER_GRASS", false, false), + ANIMATED_REDSTONE("ANIMATED_REDSTONE", 65, "", 999, "of.options.ANIMATED_REDSTONE", false, false), + ANIMATED_EXPLOSION("ANIMATED_EXPLOSION", 66, "", 999, "of.options.ANIMATED_EXPLOSION", false, false), + ANIMATED_FLAME("ANIMATED_FLAME", 67, "", 999, "of.options.ANIMATED_FLAME", false, false), + ANIMATED_SMOKE("ANIMATED_SMOKE", 68, "", 999, "of.options.ANIMATED_SMOKE", false, false), + WEATHER("WEATHER", 69, "", 999, "of.options.WEATHER", false, false), + SKY("SKY", 70, "", 999, "of.options.SKY", false, false), + STARS("STARS", 71, "", 999, "of.options.STARS", false, false), + SUN_MOON("SUN_MOON", 72, "", 999, "of.options.SUN_MOON", false, false), + VIGNETTE("VIGNETTE", 73, "", 999, "of.options.VIGNETTE", false, false), + CHUNK_UPDATES("CHUNK_UPDATES", 74, "", 999, "of.options.CHUNK_UPDATES", false, false), + CHUNK_UPDATES_DYNAMIC("CHUNK_UPDATES_DYNAMIC", 75, "", 999, "of.options.CHUNK_UPDATES_DYNAMIC", false, false), + TIME("TIME", 76, "", 999, "of.options.TIME", false, false), + CLEAR_WATER("CLEAR_WATER", 77, "", 999, "of.options.CLEAR_WATER", false, false), + SMOOTH_WORLD("SMOOTH_WORLD", 78, "", 999, "of.options.SMOOTH_WORLD", false, false), + DEPTH_FOG("DEPTH_FOG", 79, "", 999, "Depth Fog", false, false), + VOID_PARTICLES("VOID_PARTICLES", 80, "", 999, "of.options.VOID_PARTICLES", false, false), + WATER_PARTICLES("WATER_PARTICLES", 81, "", 999, "of.options.WATER_PARTICLES", false, false), + RAIN_SPLASH("RAIN_SPLASH", 82, "", 999, "of.options.RAIN_SPLASH", false, false), + PORTAL_PARTICLES("PORTAL_PARTICLES", 83, "", 999, "of.options.PORTAL_PARTICLES", false, false), + POTION_PARTICLES("POTION_PARTICLES", 84, "", 999, "of.options.POTION_PARTICLES", false, false), + PROFILER("PROFILER", 85, "", 999, "of.options.PROFILER", false, false), + DRIPPING_WATER_LAVA("DRIPPING_WATER_LAVA", 86, "", 999, "of.options.DRIPPING_WATER_LAVA", false, false), + BETTER_SNOW("BETTER_SNOW", 87, "", 999, "of.options.BETTER_SNOW", false, false), + FULLSCREEN_MODE("FULLSCREEN_MODE", 88, "", 999, "of.options.FULLSCREEN_MODE", false, false), + ANIMATED_TERRAIN("ANIMATED_TERRAIN", 89, "", 999, "of.options.ANIMATED_TERRAIN", false, false), + ANIMATED_ITEMS("ANIMATED_ITEMS", 90, "", 999, "Items Animated", false, false), + SWAMP_COLORS("SWAMP_COLORS", 91, "", 999, "of.options.SWAMP_COLORS", false, false), + RANDOM_MOBS("RANDOM_MOBS", 92, "", 999, "of.options.RANDOM_MOBS", false, false), + SMOOTH_BIOMES("SMOOTH_BIOMES", 93, "", 999, "of.options.SMOOTH_BIOMES", false, false), + CUSTOM_FONTS("CUSTOM_FONTS", 94, "", 999, "of.options.CUSTOM_FONTS", false, false), + CUSTOM_COLORS("CUSTOM_COLORS", 95, "", 999, "of.options.CUSTOM_COLORS", false, false), + SHOW_CAPES("SHOW_CAPES", 96, "", 999, "of.options.SHOW_CAPES", false, false), + CONNECTED_TEXTURES("CONNECTED_TEXTURES", 97, "", 999, "of.options.CONNECTED_TEXTURES", false, false), + AA_LEVEL("AA_LEVEL", 98, "", 999, "of.options.AA_LEVEL", true, false, 0.0F, 16.0F, 1.0F), + ANIMATED_TEXTURES("ANIMATED_TEXTURES", 99, "", 999, "of.options.ANIMATED_TEXTURES", false, false), + NATURAL_TEXTURES("NATURAL_TEXTURES", 100, "", 999, "of.options.NATURAL_TEXTURES", false, false), + CHUNK_LOADING("CHUNK_LOADING", 101, "", 999, "Chunk Loading", false, false), + HELD_ITEM_TOOLTIPS("HELD_ITEM_TOOLTIPS", 102, "", 999, "of.options.HELD_ITEM_TOOLTIPS", false, false), + DROPPED_ITEMS("DROPPED_ITEMS", 103, "", 999, "of.options.DROPPED_ITEMS", false, false), + LAZY_CHUNK_LOADING("LAZY_CHUNK_LOADING", 104, "", 999, "of.options.LAZY_CHUNK_LOADING", false, false), + CUSTOM_SKY("CUSTOM_SKY", 105, "", 999, "of.options.CUSTOM_SKY", false, false), + FAST_MATH("FAST_MATH", 106, "", 999, "of.options.FAST_MATH", false, false), + FAST_RENDER("FAST_RENDER", 107, "", 999, "of.options.FAST_RENDER", false, false), + TRANSLUCENT_BLOCKS("TRANSLUCENT_BLOCKS", 108, "", 999, "of.options.TRANSLUCENT_BLOCKS", false, false), + DYNAMIC_FOV("DYNAMIC_FOV", 109, "", 999, "of.options.DYNAMIC_FOV", false, false), + DYNAMIC_LIGHTS("DYNAMIC_LIGHTS", 110, "", 999, "of.options.DYNAMIC_LIGHTS", false, false); + private final boolean enumFloat; + private final boolean enumBoolean; + private final String enumString; + private final float valueStep; + private float valueMin; + private float valueMax; + private static final GameSettings.Options[] $VALUES = new GameSettings.Options[]{INVERT_MOUSE, SENSITIVITY, FOV, GAMMA, SATURATION, RENDER_DISTANCE, VIEW_BOBBING, ANAGLYPH, ADVANCED_OPENGL, FRAMERATE_LIMIT, FBO_ENABLE, DIFFICULTY, GRAPHICS, AMBIENT_OCCLUSION, GUI_SCALE, RENDER_CLOUDS, PARTICLES, CHAT_VISIBILITY, CHAT_COLOR, CHAT_LINKS, CHAT_OPACITY, CHAT_LINKS_PROMPT, SNOOPER_ENABLED, USE_FULLSCREEN, ENABLE_VSYNC, SHOW_CAPE, TOUCHSCREEN, CHAT_SCALE, CHAT_WIDTH, CHAT_HEIGHT_FOCUSED, CHAT_HEIGHT_UNFOCUSED, MIPMAP_LEVELS, ANISOTROPIC_FILTERING, FORCE_UNICODE_FONT, STREAM_BYTES_PER_PIXEL, STREAM_VOLUME_MIC, STREAM_VOLUME_SYSTEM, STREAM_KBPS, STREAM_FPS, STREAM_COMPRESSION, STREAM_SEND_METADATA, STREAM_CHAT_ENABLED, STREAM_CHAT_USER_FILTER, STREAM_MIC_TOGGLE_BEHAVIOR}; + + private static final GameSettings.Options[] $VALUES$ = new GameSettings.Options[]{INVERT_MOUSE, SENSITIVITY, FOV, GAMMA, SATURATION, RENDER_DISTANCE, VIEW_BOBBING, ANAGLYPH, ADVANCED_OPENGL, FRAMERATE_LIMIT, FBO_ENABLE, DIFFICULTY, GRAPHICS, AMBIENT_OCCLUSION, GUI_SCALE, RENDER_CLOUDS, PARTICLES, CHAT_VISIBILITY, CHAT_COLOR, CHAT_LINKS, CHAT_OPACITY, CHAT_LINKS_PROMPT, SNOOPER_ENABLED, USE_FULLSCREEN, ENABLE_VSYNC, SHOW_CAPE, TOUCHSCREEN, CHAT_SCALE, CHAT_WIDTH, CHAT_HEIGHT_FOCUSED, CHAT_HEIGHT_UNFOCUSED, MIPMAP_LEVELS, ANISOTROPIC_FILTERING, FORCE_UNICODE_FONT, STREAM_BYTES_PER_PIXEL, STREAM_VOLUME_MIC, STREAM_VOLUME_SYSTEM, STREAM_KBPS, STREAM_FPS, STREAM_COMPRESSION, STREAM_SEND_METADATA, STREAM_CHAT_ENABLED, STREAM_CHAT_USER_FILTER, STREAM_MIC_TOGGLE_BEHAVIOR, FOG_FANCY, FOG_START, MIPMAP_TYPE, LOAD_FAR, PRELOADED_CHUNKS, SMOOTH_FPS, CLOUDS, CLOUD_HEIGHT, TREES, GRASS, RAIN, WATER, ANIMATED_WATER, ANIMATED_LAVA, ANIMATED_FIRE, ANIMATED_PORTAL, AO_LEVEL, LAGOMETER, SHOW_FPS, AUTOSAVE_TICKS, BETTER_GRASS, ANIMATED_REDSTONE, ANIMATED_EXPLOSION, ANIMATED_FLAME, ANIMATED_SMOKE, WEATHER, SKY, STARS, SUN_MOON, VIGNETTE, CHUNK_UPDATES, CHUNK_UPDATES_DYNAMIC, TIME, CLEAR_WATER, SMOOTH_WORLD, DEPTH_FOG, VOID_PARTICLES, WATER_PARTICLES, RAIN_SPLASH, PORTAL_PARTICLES, POTION_PARTICLES, PROFILER, DRIPPING_WATER_LAVA, BETTER_SNOW, FULLSCREEN_MODE, ANIMATED_TERRAIN, ANIMATED_ITEMS, SWAMP_COLORS, RANDOM_MOBS, SMOOTH_BIOMES, CUSTOM_FONTS, CUSTOM_COLORS, SHOW_CAPES, CONNECTED_TEXTURES, AA_LEVEL, ANIMATED_TEXTURES, NATURAL_TEXTURES, CHUNK_LOADING, HELD_ITEM_TOOLTIPS, DROPPED_ITEMS, LAZY_CHUNK_LOADING, CUSTOM_SKY, FAST_MATH, FAST_RENDER, TRANSLUCENT_BLOCKS, DYNAMIC_FOV, DYNAMIC_LIGHTS}; + + public static GameSettings.Options getEnumOptions(int par0) { + GameSettings.Options[] var1 = values(); + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + GameSettings.Options var4 = var1[var3]; + + if (var4.returnEnumOrdinal() == par0) { + return var4; + } + } + + return null; + } + + private Options(String p_i46401_1_, int p_i46401_2_, String par1Str, int par2, String par3Str, boolean par4, boolean par5) { + this(p_i46401_1_, p_i46401_2_, par1Str, par2, par3Str, par4, par5, 0.0F, 1.0F, 0.0F); + } + + private Options(String p_i46402_1_, int p_i46402_2_, String p_i45004_1_, int p_i45004_2_, String p_i45004_3_, boolean p_i45004_4_, boolean p_i45004_5_, float p_i45004_6_, float p_i45004_7_, float p_i45004_8_) { + this.enumString = p_i45004_3_; + this.enumFloat = p_i45004_4_; + this.enumBoolean = p_i45004_5_; + this.valueMin = p_i45004_6_; + this.valueMax = p_i45004_7_; + this.valueStep = p_i45004_8_; + } + + public boolean getEnumFloat() { + return this.enumFloat; + } + + public boolean getEnumBoolean() { + return this.enumBoolean; + } + + public int returnEnumOrdinal() { + return this.ordinal(); + } + + public String getEnumString() { + return this.enumString; + } + + public float getValueMax() { + return this.valueMax; + } + + public void setValueMax(float p_148263_1_) { + this.valueMax = p_148263_1_; + } + + public float normalizeValue(float p_148266_1_) { + return MathHelper.clamp_float((this.snapToStepClamp(p_148266_1_) - this.valueMin) / (this.valueMax - this.valueMin), 0.0F, 1.0F); + } + + public float denormalizeValue(float p_148262_1_) { + return this.snapToStepClamp(this.valueMin + (this.valueMax - this.valueMin) * MathHelper.clamp_float(p_148262_1_, 0.0F, 1.0F)); + } + + public float snapToStepClamp(float p_148268_1_) { + p_148268_1_ = this.snapToStep(p_148268_1_); + return MathHelper.clamp_float(p_148268_1_, this.valueMin, this.valueMax); + } + + protected float snapToStep(float p_148264_1_) { + if (this.valueStep > 0.0F) { + p_148264_1_ = this.valueStep * (float)Math.round(p_148264_1_ / this.valueStep); + } + + return p_148264_1_; + } + + private Options(String p_i46403_1_, int p_i46403_2_, String p_i45005_1_, int p_i45005_2_, String p_i45005_3_, boolean p_i45005_4_, boolean p_i45005_5_, float p_i45005_6_, float p_i45005_7_, float p_i45005_8_, Object p_i45005_9_) { + this(p_i46403_1_, p_i46403_2_, p_i45005_1_, p_i45005_2_, p_i45005_3_, p_i45005_4_, p_i45005_5_, p_i45005_6_, p_i45005_7_, p_i45005_8_); + } + + Options(String x0, int x1, String x2, int x3, String x4, boolean x5, boolean x6, float x7, float x8, float x9, Object x10, Object x11) { + this(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10); + } + } + + static final class SwitchOptions { + static final int[] optionIds = new int[GameSettings.Options.values().length]; + + static { + try { + optionIds[GameSettings.Options.INVERT_MOUSE.ordinal()] = 1; + } catch (NoSuchFieldError var16) { + ; + } + + try { + optionIds[GameSettings.Options.VIEW_BOBBING.ordinal()] = 2; + } catch (NoSuchFieldError var15) { + ; + } + + try { + optionIds[GameSettings.Options.ANAGLYPH.ordinal()] = 3; + } catch (NoSuchFieldError var14) { + ; + } + + try { + optionIds[GameSettings.Options.ADVANCED_OPENGL.ordinal()] = 4; + } catch (NoSuchFieldError var13) { + ; + } + + try { + optionIds[GameSettings.Options.FBO_ENABLE.ordinal()] = 5; + } catch (NoSuchFieldError var12) { + ; + } + + try { + optionIds[GameSettings.Options.RENDER_CLOUDS.ordinal()] = 6; + } catch (NoSuchFieldError var11) { + ; + } + + try { + optionIds[GameSettings.Options.CHAT_COLOR.ordinal()] = 7; + } catch (NoSuchFieldError var10) { + ; + } + + try { + optionIds[GameSettings.Options.CHAT_LINKS.ordinal()] = 8; + } catch (NoSuchFieldError var9) { + ; + } + + try { + optionIds[GameSettings.Options.CHAT_LINKS_PROMPT.ordinal()] = 9; + } catch (NoSuchFieldError var8) { + ; + } + + try { + optionIds[GameSettings.Options.SNOOPER_ENABLED.ordinal()] = 10; + } catch (NoSuchFieldError var7) { + ; + } + + try { + optionIds[GameSettings.Options.USE_FULLSCREEN.ordinal()] = 11; + } catch (NoSuchFieldError var6) { + ; + } + + try { + optionIds[GameSettings.Options.ENABLE_VSYNC.ordinal()] = 12; + } catch (NoSuchFieldError var5) { + ; + } + + try { + optionIds[GameSettings.Options.SHOW_CAPE.ordinal()] = 13; + } catch (NoSuchFieldError var4) { + ; + } + + try { + optionIds[GameSettings.Options.TOUCHSCREEN.ordinal()] = 14; + } catch (NoSuchFieldError var3) { + ; + } + + try { + optionIds[GameSettings.Options.STREAM_SEND_METADATA.ordinal()] = 15; + } catch (NoSuchFieldError var2) { + ; + } + + try { + optionIds[GameSettings.Options.FORCE_UNICODE_FONT.ordinal()] = 16; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/settings/KeyBinding.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/settings/KeyBinding.java new file mode 100644 index 0000000..bd2f9c9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/settings/KeyBinding.java @@ -0,0 +1,145 @@ +package net.minecraft.client.settings; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.IntHashMap; + +import java.util.*; + +public class KeyBinding implements Comparable { + private static final List keybindArray = new ArrayList(); + private static final IntHashMap hash = new IntHashMap(); + private static final Set keybindSet = new HashSet(); + private final String keyDescription; + private final int keyCodeDefault; + private final String keyCategory; + private int keyCode; + + /** because _303 wanted me to call it that(Caironater) */ + private boolean pressed; + private int presses; + public boolean isCheatBreakerKeybind; + + + public static void onTick(int p_74507_0_) { + if (p_74507_0_ != 0) { + KeyBinding var1 = (KeyBinding)hash.lookup(p_74507_0_); + + if (var1 != null) { + ++var1.presses; + } + } + } + + public static void setKeyBindState(int p_74510_0_, boolean p_74510_1_) { + if (p_74510_0_ != 0) { + KeyBinding var2 = (KeyBinding)hash.lookup(p_74510_0_); + + if (var2 != null) { + var2.pressed = p_74510_1_; + } + } + } + + public static void unPressAllKeys() { + Iterator var0 = keybindArray.iterator(); + + while (var0.hasNext()) { + KeyBinding var1 = (KeyBinding)var0.next(); + var1.unpressKey(); + } + } + + public static void resetKeyBindingArrayAndHash() { + hash.clearMap(); + Iterator var0 = keybindArray.iterator(); + + while (var0.hasNext()) { + KeyBinding var1 = (KeyBinding)var0.next(); + hash.addKey(var1.keyCode, var1); + } + } + + public static Set func_151467_c() { + return keybindSet; + } + + public KeyBinding(String p_i45001_1_, int p_i45001_2_, String p_i45001_3_) { + this.keyDescription = p_i45001_1_; + this.keyCode = p_i45001_2_; + this.keyCodeDefault = p_i45001_2_; + this.keyCategory = p_i45001_3_; + keybindArray.add(this); + hash.addKey(p_i45001_2_, this); + keybindSet.add(p_i45001_3_); + } + + public KeyBinding(String keyDescription, int keyCode, String keyCategory, boolean cbKeybind) { + this.pressed = false; + this.keyDescription = keyDescription; + this.keyCode = keyCode; + this.keyCodeDefault = keyCode; + this.keyCategory = keyCategory; + this.isCheatBreakerKeybind = cbKeybind; + keybindArray.add(this); + hash.addKey(keyCode, this); + keybindSet.add(keyCategory); + } + + public boolean getIsKeyPressed() { + return this.pressed; + } + + public String getKeyCategory() { + return this.keyCategory; + } + + public boolean isPressed() { + if (this.presses == 0) { + return false; + } else { + --this.presses; + return true; + } + } + + private void unpressKey() { + this.presses = 0; + this.pressed = false; + } + + public String getKeyDescription() { + return this.keyDescription; + } + + public int getKeyCodeDefault() { + return this.keyCodeDefault; + } + + public int getKeyCode() { + return this.keyCode; + } + + public void setKeyCode(int p_151462_1_) { + // CheatBreaker code to prevent setting attack keybind to movement keys + GameSettings gameSettings = Minecraft.getMinecraft().gameSettings; + if (gameSettings != null && this == gameSettings.keyBindAttack && p_151462_1_ != -100 && p_151462_1_ != -99) { + return; + } + this.keyCode = p_151462_1_; + } + + public int compareTo(KeyBinding p_compareTo_1_) { + int var2 = I18n.format(this.keyCategory).compareTo(I18n.format(p_compareTo_1_.keyCategory)); + + if (var2 == 0) { + var2 = I18n.format(this.keyDescription).compareTo(I18n.format(p_compareTo_1_.keyDescription)); + } + + return var2; + } + + public int compareTo(Object p_compareTo_1_) { + return this.compareTo((KeyBinding)p_compareTo_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/FrameBuffer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/FrameBuffer.java new file mode 100644 index 0000000..454d5f7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/FrameBuffer.java @@ -0,0 +1,223 @@ +package net.minecraft.client.shader; + +import java.nio.ByteBuffer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureUtil; +import org.lwjgl.opengl.GL11; + +public class FrameBuffer { + public int framebufferTextureWidth; + public int framebufferTextureHeight; + public int framebufferWidth; + public int framebufferHeight; + public boolean useDepth; + public int framebufferObject; + public int framebufferTexture; + public int depthBuffer; + public float[] framebufferColor; + public int framebufferFilter; + + + public FrameBuffer(int p_i45078_1_, int p_i45078_2_, boolean p_i45078_3_) { + this.useDepth = p_i45078_3_; + this.framebufferObject = -1; + this.framebufferTexture = -1; + this.depthBuffer = -1; + this.framebufferColor = new float[4]; + this.framebufferColor[0] = 1.0F; + this.framebufferColor[1] = 1.0F; + this.framebufferColor[2] = 1.0F; + this.framebufferColor[3] = 0.0F; + this.createBindFramebuffer(p_i45078_1_, p_i45078_2_); + } + + public void createBindFramebuffer(int p_147613_1_, int p_147613_2_) { + if (!OpenGlHelper.isFramebufferEnabled()) { + this.framebufferWidth = p_147613_1_; + this.framebufferHeight = p_147613_2_; + } else { + GL11.glEnable(GL11.GL_DEPTH_TEST); + + if (this.framebufferObject >= 0) { + this.deleteFramebuffer(); + } + + this.createFramebuffer(p_147613_1_, p_147613_2_); + this.checkFramebufferComplete(); + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, 0); + } + } + + public void deleteFramebuffer() { + if (OpenGlHelper.isFramebufferEnabled()) { + this.unbindFramebufferTexture(); + this.unbindFramebuffer(); + + if (this.depthBuffer > -1) { + OpenGlHelper.func_153184_g(this.depthBuffer); + this.depthBuffer = -1; + } + + if (this.framebufferTexture > -1) { + TextureUtil.deleteTexture(this.framebufferTexture); + this.framebufferTexture = -1; + } + + if (this.framebufferObject > -1) { + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, 0); + OpenGlHelper.func_153174_h(this.framebufferObject); + this.framebufferObject = -1; + } + } + } + + public void createFramebuffer(int p_147605_1_, int p_147605_2_) { + this.framebufferWidth = p_147605_1_; + this.framebufferHeight = p_147605_2_; + this.framebufferTextureWidth = p_147605_1_; + this.framebufferTextureHeight = p_147605_2_; + + if (!OpenGlHelper.isFramebufferEnabled()) { + this.framebufferClear(); + } else { + this.framebufferObject = OpenGlHelper.func_153165_e(); + this.framebufferTexture = TextureUtil.glGenTextures(); + + if (this.useDepth) { + this.depthBuffer = OpenGlHelper.func_153185_f(); + } + + this.setFramebufferFilter(9728); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.framebufferTexture); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, this.framebufferObject); + OpenGlHelper.func_153188_a(OpenGlHelper.field_153198_e, OpenGlHelper.field_153200_g, 3553, this.framebufferTexture, 0); + + if (this.useDepth) { + OpenGlHelper.func_153176_h(OpenGlHelper.field_153199_f, this.depthBuffer); + OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight); + OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, OpenGlHelper.field_153201_h, OpenGlHelper.field_153199_f, this.depthBuffer); + } + + this.framebufferClear(); + this.unbindFramebufferTexture(); + } + } + + public void setFramebufferFilter(int p_147607_1_) { + if (OpenGlHelper.isFramebufferEnabled()) { + this.framebufferFilter = p_147607_1_; + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.framebufferTexture); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, (float)p_147607_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, (float)p_147607_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + } + + public void checkFramebufferComplete() { + int var1 = OpenGlHelper.func_153167_i(OpenGlHelper.field_153198_e); + + if (var1 != OpenGlHelper.field_153202_i) { + if (var1 == OpenGlHelper.field_153203_j) { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); + } else if (var1 == OpenGlHelper.field_153204_k) { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); + } else if (var1 == OpenGlHelper.field_153205_l) { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER"); + } else if (var1 == OpenGlHelper.field_153206_m) { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER"); + } else { + throw new RuntimeException("glCheckFramebufferStatus returned unknown status:" + var1); + } + } + } + + public void bindFramebufferTexture() { + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.framebufferTexture); + } + } + + public void unbindFramebufferTexture() { + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + } + + public void bindFramebuffer(boolean p_147610_1_) { + if (OpenGlHelper.isFramebufferEnabled()) { + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, this.framebufferObject); + + if (p_147610_1_) { + GL11.glViewport(0, 0, this.framebufferWidth, this.framebufferHeight); + } + } + } + + public void unbindFramebuffer() { + if (OpenGlHelper.isFramebufferEnabled()) { + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, 0); + } + } + + public void setFramebufferColor(float p_147604_1_, float p_147604_2_, float p_147604_3_, float p_147604_4_) { + this.framebufferColor[0] = p_147604_1_; + this.framebufferColor[1] = p_147604_2_; + this.framebufferColor[2] = p_147604_3_; + this.framebufferColor[3] = p_147604_4_; + } + + public void framebufferRender(int p_147615_1_, int p_147615_2_) { + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glColorMask(true, true, true, false); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, p_147615_1_, p_147615_2_, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glViewport(0, 0, p_147615_1_, p_147615_2_); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + this.bindFramebufferTexture(); + float var3 = (float)p_147615_1_; + float var4 = (float)p_147615_2_; + float var5 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth; + float var6 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight; + Tessellator var7 = Tessellator.instance; + var7.startDrawingQuads(); + var7.setColorOpaque_I(-1); + var7.addVertexWithUV(0.0D, var4, 0.0D, 0.0D, 0.0D); + var7.addVertexWithUV(var3, var4, 0.0D, var5, 0.0D); + var7.addVertexWithUV(var3, 0.0D, 0.0D, var5, var6); + var7.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, var6); + var7.draw(); + this.unbindFramebufferTexture(); + GL11.glDepthMask(true); + GL11.glColorMask(true, true, true, true); + } + } + + public void framebufferClear() { + this.bindFramebuffer(true); + GL11.glClearColor(this.framebufferColor[0], this.framebufferColor[1], this.framebufferColor[2], this.framebufferColor[3]); + int var1 = 16384; + + if (this.useDepth) { + GL11.glClearDepth(1.0D); + var1 |= 256; + } + + GL11.glClear(var1); + this.unbindFramebuffer(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/Shader.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/Shader.java new file mode 100644 index 0000000..d8a2521 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/Shader.java @@ -0,0 +1,108 @@ +package net.minecraft.client.shader; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import javax.vecmath.Matrix4f; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import org.lwjgl.opengl.GL11; + +public class Shader { + private final ShaderManager manager; + public final FrameBuffer frameBufferIn; + public final FrameBuffer frameBufferOut; + private final List listAuxFramebuffers = Lists.newArrayList(); + private final List listAuxNames = Lists.newArrayList(); + private final List listAuxWidths = Lists.newArrayList(); + private final List listAuxHeights = Lists.newArrayList(); + private Matrix4f projectionMatrix; + + + public Shader(IResourceManager p_i45089_1_, String p_i45089_2_, FrameBuffer p_i45089_3_, FrameBuffer p_i45089_4_) throws JsonException { + this.manager = new ShaderManager(p_i45089_1_, p_i45089_2_); + this.frameBufferIn = p_i45089_3_; + this.frameBufferOut = p_i45089_4_; + } + + public void deleteShader() { + this.manager.func_147988_a(); + } + + public void addAuxFramebuffer(String p_148041_1_, Object p_148041_2_, int p_148041_3_, int p_148041_4_) { + this.listAuxNames.add(this.listAuxNames.size(), p_148041_1_); + this.listAuxFramebuffers.add(this.listAuxFramebuffers.size(), p_148041_2_); + this.listAuxWidths.add(this.listAuxWidths.size(), Integer.valueOf(p_148041_3_)); + this.listAuxHeights.add(this.listAuxHeights.size(), Integer.valueOf(p_148041_4_)); + } + + private void preLoadShader() { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + + public void setProjectionMatrix(Matrix4f p_148045_1_) { + this.projectionMatrix = p_148045_1_; + } + + public void loadShader(float p_148042_1_) { + this.preLoadShader(); + this.frameBufferIn.unbindFramebuffer(); + float var2 = (float)this.frameBufferOut.framebufferTextureWidth; + float var3 = (float)this.frameBufferOut.framebufferTextureHeight; + GL11.glViewport(0, 0, (int)var2, (int)var3); + this.manager.func_147992_a("DiffuseSampler", this.frameBufferIn); + + for (int var4 = 0; var4 < this.listAuxFramebuffers.size(); ++var4) { + this.manager.func_147992_a((String)this.listAuxNames.get(var4), this.listAuxFramebuffers.get(var4)); + this.manager.func_147984_b("AuxSize" + var4).func_148087_a((float)((Integer)this.listAuxWidths.get(var4)).intValue(), (float)((Integer)this.listAuxHeights.get(var4)).intValue()); + } + + this.manager.func_147984_b("ProjMat").func_148088_a(this.projectionMatrix); + this.manager.func_147984_b("InSize").func_148087_a((float)this.frameBufferIn.framebufferTextureWidth, (float)this.frameBufferIn.framebufferTextureHeight); + this.manager.func_147984_b("OutSize").func_148087_a(var2, var3); + this.manager.func_147984_b("Time").func_148090_a(p_148042_1_); + Minecraft var8 = Minecraft.getMinecraft(); + this.manager.func_147984_b("ScreenSize").func_148087_a((float)var8.displayWidth, (float)var8.displayHeight); + this.manager.func_147995_c(); + this.frameBufferOut.framebufferClear(); + this.frameBufferOut.bindFramebuffer(false); + GL11.glDepthMask(false); + GL11.glColorMask(true, true, true, false); + Tessellator var5 = Tessellator.instance; + var5.startDrawingQuads(); + var5.setColorOpaque_I(-1); + var5.addVertex(0.0D, var3, 500.0D); + var5.addVertex(var2, var3, 500.0D); + var5.addVertex(var2, 0.0D, 500.0D); + var5.addVertex(0.0D, 0.0D, 500.0D); + var5.draw(); + GL11.glDepthMask(true); + GL11.glColorMask(true, true, true, true); + this.manager.func_147993_b(); + this.frameBufferOut.unbindFramebuffer(); + this.frameBufferIn.unbindFramebufferTexture(); + Iterator var6 = this.listAuxFramebuffers.iterator(); + + while (var6.hasNext()) { + Object var7 = var6.next(); + + if (var7 instanceof FrameBuffer) { + ((FrameBuffer)var7).unbindFramebufferTexture(); + } + } + } + + public ShaderManager getShaderManager() { + return this.manager; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderDefault.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderDefault.java new file mode 100644 index 0000000..a972296 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderDefault.java @@ -0,0 +1,29 @@ +package net.minecraft.client.shader; + +import javax.vecmath.Matrix4f; + +public class ShaderDefault extends ShaderUniform { + + + public ShaderDefault() { + super("dummy", 4, 1, null); + } + + public void func_148090_a(float p_148090_1_) {} + + public void func_148087_a(float p_148087_1_, float p_148087_2_) {} + + public void func_148095_a(float p_148095_1_, float p_148095_2_, float p_148095_3_) {} + + public void func_148081_a(float p_148081_1_, float p_148081_2_, float p_148081_3_, float p_148081_4_) {} + + public void func_148092_b(float p_148092_1_, float p_148092_2_, float p_148092_3_, float p_148092_4_) {} + + public void func_148083_a(int p_148083_1_, int p_148083_2_, int p_148083_3_, int p_148083_4_) {} + + public void func_148097_a(float[] p_148097_1_) {} + + public void func_148094_a(float p_148094_1_, float p_148094_2_, float p_148094_3_, float p_148094_4_, float p_148094_5_, float p_148094_6_, float p_148094_7_, float p_148094_8_, float p_148094_9_, float p_148094_10_, float p_148094_11_, float p_148094_12_, float p_148094_13_, float p_148094_14_, float p_148094_15_, float p_148094_16_) {} + + public void func_148088_a(Matrix4f p_148088_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderGroup.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderGroup.java new file mode 100644 index 0000000..0d8c00e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderGroup.java @@ -0,0 +1,352 @@ +package net.minecraft.client.shader; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.lwjgl.opengl.GL11; + +import javax.vecmath.Matrix4f; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +public class ShaderGroup { + private final FrameBuffer mainFrameBuffer; + private final IResourceManager resourceManager; + private final String shaderGroupName; + public final List listShaders = Lists.newArrayList(); + private final Map mapFramebuffers = Maps.newHashMap(); + private final List listFramebuffers = Lists.newArrayList(); + private Matrix4f projectionMatrix; + private int mainFramebufferWidth; + private int mainFramebufferHeight; + private float field_148036_j; + private float field_148037_k; + + + public ShaderGroup(TextureManager p_i1050_1_, IResourceManager p_i1050_2_, FrameBuffer p_i1050_3_, ResourceLocation p_i1050_4_) throws JsonException { + this.resourceManager = p_i1050_2_; + this.mainFrameBuffer = p_i1050_3_; + this.field_148036_j = 0.0F; + this.field_148037_k = 0.0F; + this.mainFramebufferWidth = p_i1050_3_.framebufferWidth; + this.mainFramebufferHeight = p_i1050_3_.framebufferHeight; + this.shaderGroupName = p_i1050_4_.toString(); + this.resetProjectionMatrix(); + this.func_152765_a(p_i1050_1_, p_i1050_4_); + } + + public void func_152765_a(TextureManager p_152765_1_, ResourceLocation p_152765_2_) throws JsonException { + JsonParser var3 = new JsonParser(); + InputStream var4 = null; + + try { + IResource var5 = this.resourceManager.getResource(p_152765_2_); + var4 = var5.getInputStream(); + JsonObject var22 = var3.parse(IOUtils.toString(var4, Charsets.UTF_8)).getAsJsonObject(); + JsonArray var7; + int var8; + Iterator var9; + JsonElement var10; + JsonException var12; + + if (JsonUtils.jsonObjectFieldTypeIsArray(var22, "targets")) { + var7 = var22.getAsJsonArray("targets"); + var8 = 0; + + for (var9 = var7.iterator(); var9.hasNext(); ++var8) { + var10 = (JsonElement)var9.next(); + + try { + this.initTarget(var10); + } catch (Exception var19) { + var12 = JsonException.func_151379_a(var19); + var12.func_151380_a("targets[" + var8 + "]"); + throw var12; + } + } + } + + if (JsonUtils.jsonObjectFieldTypeIsArray(var22, "passes")) { + var7 = var22.getAsJsonArray("passes"); + var8 = 0; + + for (var9 = var7.iterator(); var9.hasNext(); ++var8) { + var10 = (JsonElement)var9.next(); + + try { + this.func_152764_a(p_152765_1_, var10); + } catch (Exception var18) { + var12 = JsonException.func_151379_a(var18); + var12.func_151380_a("passes[" + var8 + "]"); + throw var12; + } + } + } + } catch (Exception var20) { + JsonException var6 = JsonException.func_151379_a(var20); + var6.func_151381_b(p_152765_2_.getResourcePath()); + throw var6; + } + finally { + IOUtils.closeQuietly(var4); + } + } + + private void initTarget(JsonElement p_148027_1_) throws JsonException { + if (JsonUtils.jsonElementTypeIsString(p_148027_1_)) { + this.addFramebuffer(p_148027_1_.getAsString(), this.mainFramebufferWidth, this.mainFramebufferHeight); + } else { + JsonObject var2 = JsonUtils.getJsonElementAsJsonObject(p_148027_1_, "target"); + String var3 = JsonUtils.getJsonObjectStringFieldValue(var2, "name"); + int var4 = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(var2, "width", this.mainFramebufferWidth); + int var5 = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(var2, "height", this.mainFramebufferHeight); + + if (this.mapFramebuffers.containsKey(var3)) { + throw new JsonException(var3 + " is already defined"); + } + + this.addFramebuffer(var3, var4, var5); + } + } + + private void func_152764_a(TextureManager p_152764_1_, JsonElement p_152764_2_) throws JsonException { + JsonObject var3 = JsonUtils.getJsonElementAsJsonObject(p_152764_2_, "pass"); + String var4 = JsonUtils.getJsonObjectStringFieldValue(var3, "name"); + String var5 = JsonUtils.getJsonObjectStringFieldValue(var3, "intarget"); + String var6 = JsonUtils.getJsonObjectStringFieldValue(var3, "outtarget"); + FrameBuffer var7 = this.getFramebuffer(var5); + FrameBuffer var8 = this.getFramebuffer(var6); + + if (var7 == null) { + throw new JsonException("Input target '" + var5 + "' does not exist"); + } else if (var8 == null) { + throw new JsonException("Output target '" + var6 + "' does not exist"); + } else { + Shader var9 = this.addShader(var4, var7, var8); + JsonArray var10 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(var3, "auxtargets", null); + + if (var10 != null) { + int var11 = 0; + + for (Iterator var12 = var10.iterator(); var12.hasNext(); ++var11) { + JsonElement var13 = (JsonElement)var12.next(); + + try { + JsonObject var14 = JsonUtils.getJsonElementAsJsonObject(var13, "auxtarget"); + String var30 = JsonUtils.getJsonObjectStringFieldValue(var14, "name"); + String var16 = JsonUtils.getJsonObjectStringFieldValue(var14, "id"); + FrameBuffer var17 = this.getFramebuffer(var16); + + if (var17 == null) { + ResourceLocation var18 = new ResourceLocation("textures/effect/" + var16 + ".png"); + + try { + this.resourceManager.getResource(var18); + } catch (FileNotFoundException var24) { + throw new JsonException("Render target or texture '" + var16 + "' does not exist"); + } + + p_152764_1_.bindTexture(var18); + ITextureObject var19 = p_152764_1_.getTexture(var18); + int var20 = JsonUtils.getJsonObjectIntegerFieldValue(var14, "width"); + int var21 = JsonUtils.getJsonObjectIntegerFieldValue(var14, "height"); + boolean var22 = JsonUtils.getJsonObjectBooleanFieldValue(var14, "bilinear"); + + if (var22) { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + } else { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + } + + var9.addAuxFramebuffer(var30, Integer.valueOf(var19.getGlTextureId()), var20, var21); + } else { + var9.addAuxFramebuffer(var30, var17, var17.framebufferTextureWidth, var17.framebufferTextureHeight); + } + } catch (Exception var25) { + JsonException var15 = JsonException.func_151379_a(var25); + var15.func_151380_a("auxtargets[" + var11 + "]"); + throw var15; + } + } + } + + JsonArray var26 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(var3, "uniforms", null); + + if (var26 != null) { + int var27 = 0; + + for (Iterator var28 = var26.iterator(); var28.hasNext(); ++var27) { + JsonElement var29 = (JsonElement)var28.next(); + + try { + this.initUniform(var29); + } catch (Exception var23) { + JsonException var31 = JsonException.func_151379_a(var23); + var31.func_151380_a("uniforms[" + var27 + "]"); + throw var31; + } + } + } + } + } + + private void initUniform(JsonElement p_148028_1_) throws JsonException { + JsonObject var2 = JsonUtils.getJsonElementAsJsonObject(p_148028_1_, "uniform"); + String var3 = JsonUtils.getJsonObjectStringFieldValue(var2, "name"); + ShaderUniform var4 = this.listShaders.get(this.listShaders.size() - 1).getShaderManager().func_147991_a(var3); + + if (var4 == null) { + throw new JsonException("Uniform '" + var3 + "' does not exist"); + } else { + float[] var5 = new float[4]; + int var6 = 0; + JsonArray var7 = JsonUtils.getJsonObjectJsonArrayField(var2, "values"); + + for (Iterator var8 = var7.iterator(); var8.hasNext(); ++var6) { + JsonElement var9 = (JsonElement)var8.next(); + + try { + var5[var6] = JsonUtils.getJsonElementFloatValue(var9, "value"); + } catch (Exception var12) { + JsonException var11 = JsonException.func_151379_a(var12); + var11.func_151380_a("values[" + var6 + "]"); + throw var11; + } + } + + switch (var6) { + case 0: + default: + break; + + case 1: + var4.func_148090_a(var5[0]); + break; + + case 2: + var4.func_148087_a(var5[0], var5[1]); + break; + + case 3: + var4.func_148095_a(var5[0], var5[1], var5[2]); + break; + + case 4: + var4.func_148081_a(var5[0], var5[1], var5[2], var5[3]); + } + } + } + + public void addFramebuffer(String p_148020_1_, int p_148020_2_, int p_148020_3_) { + FrameBuffer var4 = new FrameBuffer(p_148020_2_, p_148020_3_, true); + var4.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F); + this.mapFramebuffers.put(p_148020_1_, var4); + + if (p_148020_2_ == this.mainFramebufferWidth && p_148020_3_ == this.mainFramebufferHeight) { + this.listFramebuffers.add(var4); + } + } + + public void deleteShaderGroup() { + Iterator var1 = this.mapFramebuffers.values().iterator(); + + while (var1.hasNext()) { + FrameBuffer var2 = (FrameBuffer)var1.next(); + var2.deleteFramebuffer(); + } + + var1 = this.listShaders.iterator(); + + while (var1.hasNext()) { + Shader var3 = (Shader)var1.next(); + var3.deleteShader(); + } + + this.listShaders.clear(); + } + + public Shader addShader(String p_148023_1_, FrameBuffer p_148023_2_, FrameBuffer p_148023_3_) throws JsonException { + Shader var4 = new Shader(this.resourceManager, p_148023_1_, p_148023_2_, p_148023_3_); + this.listShaders.add(this.listShaders.size(), var4); + return var4; + } + + private void resetProjectionMatrix() { + this.projectionMatrix = new Matrix4f(); + this.projectionMatrix.setIdentity(); + this.projectionMatrix.m00 = 2.0F / (float)this.mainFrameBuffer.framebufferTextureWidth; + this.projectionMatrix.m11 = 2.0F / (float)(-this.mainFrameBuffer.framebufferTextureHeight); + this.projectionMatrix.m22 = -0.0020001999F; + this.projectionMatrix.m33 = 1.0F; + this.projectionMatrix.m03 = -1.0F; + this.projectionMatrix.m13 = 1.0F; + this.projectionMatrix.m23 = -1.0001999F; + } + + public void createBindFramebuffers(int p_148026_1_, int p_148026_2_) { + this.mainFramebufferWidth = this.mainFrameBuffer.framebufferTextureWidth; + this.mainFramebufferHeight = this.mainFrameBuffer.framebufferTextureHeight; + this.resetProjectionMatrix(); + Iterator var3 = this.listShaders.iterator(); + + while (var3.hasNext()) { + Shader var4 = (Shader)var3.next(); + var4.setProjectionMatrix(this.projectionMatrix); + } + + var3 = this.listFramebuffers.iterator(); + + while (var3.hasNext()) { + FrameBuffer var5 = (FrameBuffer)var3.next(); + var5.createBindFramebuffer(p_148026_1_, p_148026_2_); + } + } + + public void loadShaderGroup(float p_148018_1_) { + if (p_148018_1_ < this.field_148037_k) { + this.field_148036_j += 1.0F - this.field_148037_k; + this.field_148036_j += p_148018_1_; + } else { + this.field_148036_j += p_148018_1_ - this.field_148037_k; + } + + for (this.field_148037_k = p_148018_1_; this.field_148036_j > 20.0F; this.field_148036_j -= 20.0F) { + } + + Iterator var2 = this.listShaders.iterator(); + + while (var2.hasNext()) { + Shader var3 = (Shader)var2.next(); + var3.loadShader(this.field_148036_j / 20.0F); + } + } + + public final String getShaderGroupName() { + return this.shaderGroupName; + } + + private FrameBuffer getFramebuffer(String p_148017_1_) { + return p_148017_1_ == null ? null : (p_148017_1_.equals("minecraft:main") ? this.mainFrameBuffer : (FrameBuffer)this.mapFramebuffers.get(p_148017_1_)); + } + + public List getShaders() { + return this.listShaders; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderLinkHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderLinkHelper.java new file mode 100644 index 0000000..91bccea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderLinkHelper.java @@ -0,0 +1,48 @@ +package net.minecraft.client.shader; + +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.util.JsonException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ShaderLinkHelper { + private static final Logger logger = LogManager.getLogger(); + private static ShaderLinkHelper staticShaderLinkHelper; + + + public static void setNewStaticShaderLinkHelper() { + staticShaderLinkHelper = new ShaderLinkHelper(); + } + + public static ShaderLinkHelper getStaticShaderLinkHelper() { + return staticShaderLinkHelper; + } + + public void func_148077_a(ShaderManager p_148077_1_) { + p_148077_1_.func_147994_f().func_148054_b(p_148077_1_); + p_148077_1_.func_147989_e().func_148054_b(p_148077_1_); + OpenGlHelper.func_153187_e(p_148077_1_.func_147986_h()); + } + + public int func_148078_c() throws JsonException { + int var1 = OpenGlHelper.func_153183_d(); + + if (var1 <= 0) { + throw new JsonException("Could not create shader program (returned program ID " + var1 + ")"); + } else { + return var1; + } + } + + public void func_148075_b(ShaderManager p_148075_1_) { + p_148075_1_.func_147994_f().func_148056_a(p_148075_1_); + p_148075_1_.func_147989_e().func_148056_a(p_148075_1_); + OpenGlHelper.func_153179_f(p_148075_1_.func_147986_h()); + int var2 = OpenGlHelper.func_153175_a(p_148075_1_.func_147986_h(), OpenGlHelper.field_153207_o); + + if (var2 == 0) { + logger.warn("Error encountered when linking program containing VS " + p_148075_1_.func_147989_e().func_148055_a() + " and FS " + p_148075_1_.func_147994_f().func_148055_a() + ". Log output:"); + logger.warn(OpenGlHelper.func_153166_e(p_148075_1_.func_147986_h(), 32768)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderLoader.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderLoader.java new file mode 100644 index 0000000..e2a7705 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderLoader.java @@ -0,0 +1,108 @@ +package net.minecraft.client.shader; + +import com.google.common.collect.Maps; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Map; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.lwjgl.BufferUtils; + +public class ShaderLoader { + private final ShaderLoader.ShaderType field_148061_a; + private final String field_148059_b; + private final int field_148060_c; + private int field_148058_d = 0; + + + private ShaderLoader(ShaderLoader.ShaderType p_i45091_1_, int p_i45091_2_, String p_i45091_3_) { + this.field_148061_a = p_i45091_1_; + this.field_148060_c = p_i45091_2_; + this.field_148059_b = p_i45091_3_; + } + + public void func_148056_a(ShaderManager p_148056_1_) { + ++this.field_148058_d; + OpenGlHelper.func_153178_b(p_148056_1_.func_147986_h(), this.field_148060_c); + } + + public void func_148054_b(ShaderManager p_148054_1_) { + --this.field_148058_d; + + if (this.field_148058_d <= 0) { + OpenGlHelper.func_153180_a(this.field_148060_c); + this.field_148061_a.func_148064_d().remove(this.field_148059_b); + } + } + + public String func_148055_a() { + return this.field_148059_b; + } + + public static ShaderLoader func_148057_a(IResourceManager p_148057_0_, ShaderLoader.ShaderType p_148057_1_, String p_148057_2_) throws IOException { + ShaderLoader var3 = (ShaderLoader)p_148057_1_.func_148064_d().get(p_148057_2_); + + if (var3 == null) { + ResourceLocation var4 = new ResourceLocation("shaders/program/" + p_148057_2_ + p_148057_1_.func_148063_b()); + BufferedInputStream var5 = new BufferedInputStream(p_148057_0_.getResource(var4).getInputStream()); + byte[] var6 = IOUtils.toByteArray(var5); + ByteBuffer var7 = BufferUtils.createByteBuffer(var6.length); + var7.put(var6); + var7.position(0); + int var8 = OpenGlHelper.func_153195_b(p_148057_1_.func_148065_c()); + OpenGlHelper.func_153169_a(var8, var7); + OpenGlHelper.func_153170_c(var8); + + if (OpenGlHelper.func_153157_c(var8, OpenGlHelper.field_153208_p) == 0) { + String var9 = StringUtils.trim(OpenGlHelper.func_153158_d(var8, 32768)); + JsonException var10 = new JsonException("Couldn't compile " + p_148057_1_.func_148062_a() + " program: " + var9); + var10.func_151381_b(var4.getResourcePath()); + throw var10; + } + + var3 = new ShaderLoader(p_148057_1_, var8, p_148057_2_); + p_148057_1_.func_148064_d().put(p_148057_2_, var3); + } + + return var3; + } + + public enum ShaderType { + VERTEX("VERTEX", 0, "vertex", ".vsh", OpenGlHelper.field_153209_q), + FRAGMENT("FRAGMENT", 1, "fragment", ".fsh", OpenGlHelper.field_153210_r); + private final String field_148072_c; + private final String field_148069_d; + private final int field_148070_e; + private final Map field_148067_f = Maps.newHashMap(); + + private static final ShaderLoader.ShaderType[] $VALUES = new ShaderLoader.ShaderType[]{VERTEX, FRAGMENT}; + + + ShaderType(String p_i45090_1_, int p_i45090_2_, String p_i45090_3_, String p_i45090_4_, int p_i45090_5_) { + this.field_148072_c = p_i45090_3_; + this.field_148069_d = p_i45090_4_; + this.field_148070_e = p_i45090_5_; + } + + public String func_148062_a() { + return this.field_148072_c; + } + + protected String func_148063_b() { + return this.field_148069_d; + } + + protected int func_148065_c() { + return this.field_148070_e; + } + + protected Map func_148064_d() { + return this.field_148067_f; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderManager.java new file mode 100644 index 0000000..ef63888 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderManager.java @@ -0,0 +1,345 @@ +package net.minecraft.client.shader; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonBlendingMode; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; + +public class ShaderManager { + private static final Logger logger = LogManager.getLogger(); + private static final ShaderDefault defaultShaderUniform = new ShaderDefault(); + private static ShaderManager staticShaderManager = null; + private static int field_147999_d = -1; + private static boolean field_148000_e = true; + private final Map field_147997_f = Maps.newHashMap(); + private final List field_147998_g = Lists.newArrayList(); + private final List field_148010_h = Lists.newArrayList(); + private final List field_148011_i = Lists.newArrayList(); + private final List field_148008_j = Lists.newArrayList(); + private final Map field_148009_k = Maps.newHashMap(); + private final int field_148006_l; + private final String field_148007_m; + private final boolean field_148004_n; + private boolean field_148005_o; + private final JsonBlendingMode field_148016_p; + private final List field_148015_q; + private final List field_148014_r; + private final ShaderLoader field_148013_s; + private final ShaderLoader field_148012_t; + + + public ShaderManager(IResourceManager p_i45087_1_, String p_i45087_2_) throws JsonException { + JsonParser var3 = new JsonParser(); + ResourceLocation var4 = new ResourceLocation("shaders/program/" + p_i45087_2_ + ".json"); + this.field_148007_m = p_i45087_2_; + InputStream var5 = null; + + try { + var5 = p_i45087_1_.getResource(var4).getInputStream(); + JsonObject var6 = var3.parse(IOUtils.toString(var5, Charsets.UTF_8)).getAsJsonObject(); + String var7 = JsonUtils.getJsonObjectStringFieldValue(var6, "vertex"); + String var28 = JsonUtils.getJsonObjectStringFieldValue(var6, "fragment"); + JsonArray var9 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(var6, "samplers", null); + + if (var9 != null) { + int var10 = 0; + + for (Iterator var11 = var9.iterator(); var11.hasNext(); ++var10) { + JsonElement var12 = (JsonElement)var11.next(); + + try { + this.func_147996_a(var12); + } catch (Exception var25) { + JsonException var14 = JsonException.func_151379_a(var25); + var14.func_151380_a("samplers[" + var10 + "]"); + throw var14; + } + } + } + + JsonArray var29 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(var6, "attributes", null); + Iterator var32; + + if (var29 != null) { + int var30 = 0; + this.field_148015_q = Lists.newArrayListWithCapacity(var29.size()); + this.field_148014_r = Lists.newArrayListWithCapacity(var29.size()); + + for (var32 = var29.iterator(); var32.hasNext(); ++var30) { + JsonElement var13 = (JsonElement)var32.next(); + + try { + this.field_148014_r.add(JsonUtils.getJsonElementStringValue(var13, "attribute")); + } catch (Exception var24) { + JsonException var15 = JsonException.func_151379_a(var24); + var15.func_151380_a("attributes[" + var30 + "]"); + throw var15; + } + } + } else { + this.field_148015_q = null; + this.field_148014_r = null; + } + + JsonArray var31 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(var6, "uniforms", null); + + if (var31 != null) { + int var33 = 0; + + for (Iterator var34 = var31.iterator(); var34.hasNext(); ++var33) { + JsonElement var36 = (JsonElement)var34.next(); + + try { + this.func_147987_b(var36); + } catch (Exception var23) { + JsonException var16 = JsonException.func_151379_a(var23); + var16.func_151380_a("uniforms[" + var33 + "]"); + throw var16; + } + } + } + + this.field_148016_p = JsonBlendingMode.func_148110_a(JsonUtils.getJsonObjectFieldOrDefault(var6, "blend", null)); + this.field_148004_n = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(var6, "cull", true); + this.field_148013_s = ShaderLoader.func_148057_a(p_i45087_1_, ShaderLoader.ShaderType.VERTEX, var7); + this.field_148012_t = ShaderLoader.func_148057_a(p_i45087_1_, ShaderLoader.ShaderType.FRAGMENT, var28); + this.field_148006_l = ShaderLinkHelper.getStaticShaderLinkHelper().func_148078_c(); + ShaderLinkHelper.getStaticShaderLinkHelper().func_148075_b(this); + this.func_147990_i(); + + if (this.field_148014_r != null) { + var32 = this.field_148014_r.iterator(); + + while (var32.hasNext()) { + String var35 = (String)var32.next(); + int var37 = OpenGlHelper.func_153164_b(this.field_148006_l, var35); + this.field_148015_q.add(Integer.valueOf(var37)); + } + } + } catch (Exception var26) { + JsonException var8 = JsonException.func_151379_a(var26); + var8.func_151381_b(var4.getResourcePath()); + throw var8; + } + finally { + IOUtils.closeQuietly(var5); + } + + this.func_147985_d(); + } + + public void func_147988_a() { + ShaderLinkHelper.getStaticShaderLinkHelper().func_148077_a(this); + } + + public void func_147993_b() { + OpenGlHelper.func_153161_d(0); + field_147999_d = -1; + staticShaderManager = null; + field_148000_e = true; + + for (int var1 = 0; var1 < this.field_148010_h.size(); ++var1) { + if (this.field_147997_f.get(this.field_147998_g.get(var1)) != null) { + GL13.glActiveTexture(GL13.GL_TEXTURE0 + var1); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + } + } + + public void func_147995_c() { + this.field_148005_o = false; + staticShaderManager = this; + this.field_148016_p.func_148109_a(); + + if (this.field_148006_l != field_147999_d) { + OpenGlHelper.func_153161_d(this.field_148006_l); + field_147999_d = this.field_148006_l; + } + + if (field_148000_e != this.field_148004_n) { + field_148000_e = this.field_148004_n; + + if (this.field_148004_n) { + GL11.glEnable(GL11.GL_CULL_FACE); + } else { + GL11.glDisable(GL11.GL_CULL_FACE); + } + } + + for (int var1 = 0; var1 < this.field_148010_h.size(); ++var1) { + if (this.field_147997_f.get(this.field_147998_g.get(var1)) != null) { + GL13.glActiveTexture(GL13.GL_TEXTURE0 + var1); + GL11.glEnable(GL11.GL_TEXTURE_2D); + Object var2 = this.field_147997_f.get(this.field_147998_g.get(var1)); + int var3 = -1; + + if (var2 instanceof FrameBuffer) { + var3 = ((FrameBuffer)var2).framebufferTexture; + } else if (var2 instanceof ITextureObject) { + var3 = ((ITextureObject)var2).getGlTextureId(); + } else if (var2 instanceof Integer) { + var3 = ((Integer)var2).intValue(); + } + + if (var3 != -1) { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, var3); + OpenGlHelper.func_153163_f(OpenGlHelper.func_153194_a(this.field_148006_l, (CharSequence)this.field_147998_g.get(var1)), var1); + } + } + } + + Iterator var4 = this.field_148011_i.iterator(); + + while (var4.hasNext()) { + ShaderUniform var5 = (ShaderUniform)var4.next(); + var5.func_148093_b(); + } + } + + public void func_147985_d() { + this.field_148005_o = true; + } + + public ShaderUniform func_147991_a(String p_147991_1_) { + return this.field_148009_k.containsKey(p_147991_1_) ? (ShaderUniform)this.field_148009_k.get(p_147991_1_) : null; + } + + public ShaderUniform func_147984_b(String p_147984_1_) { + return this.field_148009_k.containsKey(p_147984_1_) ? (ShaderUniform)this.field_148009_k.get(p_147984_1_) : defaultShaderUniform; + } + + private void func_147990_i() { + int var1 = 0; + String var3; + int var4; + + for (int var2 = 0; var1 < this.field_147998_g.size(); ++var2) { + var3 = (String)this.field_147998_g.get(var1); + var4 = OpenGlHelper.func_153194_a(this.field_148006_l, var3); + + if (var4 == -1) { + logger.warn("Shader " + this.field_148007_m + "could not find sampler named " + var3 + " in the specified shader program."); + this.field_147997_f.remove(var3); + this.field_147998_g.remove(var2); + --var2; + } else { + this.field_148010_h.add(Integer.valueOf(var4)); + } + + ++var1; + } + + Iterator var5 = this.field_148011_i.iterator(); + + while (var5.hasNext()) { + ShaderUniform var6 = (ShaderUniform)var5.next(); + var3 = var6.func_148086_a(); + var4 = OpenGlHelper.func_153194_a(this.field_148006_l, var3); + + if (var4 == -1) { + logger.warn("Could not find uniform named " + var3 + " in the specified" + " shader program."); + } else { + this.field_148008_j.add(Integer.valueOf(var4)); + var6.func_148084_b(var4); + this.field_148009_k.put(var3, var6); + } + } + } + + private void func_147996_a(JsonElement p_147996_1_) { + JsonObject var2 = JsonUtils.getJsonElementAsJsonObject(p_147996_1_, "sampler"); + String var3 = JsonUtils.getJsonObjectStringFieldValue(var2, "name"); + + if (!JsonUtils.jsonObjectFieldTypeIsString(var2, "file")) { + this.field_147997_f.put(var3, null); + this.field_147998_g.add(var3); + } else { + this.field_147998_g.add(var3); + } + } + + public void func_147992_a(String p_147992_1_, Object p_147992_2_) { + this.field_147997_f.remove(p_147992_1_); + + this.field_147997_f.put(p_147992_1_, p_147992_2_); + this.func_147985_d(); + } + + private void func_147987_b(JsonElement p_147987_1_) throws JsonException { + JsonObject var2 = JsonUtils.getJsonElementAsJsonObject(p_147987_1_, "uniform"); + String var3 = JsonUtils.getJsonObjectStringFieldValue(var2, "name"); + int var4 = ShaderUniform.func_148085_a(JsonUtils.getJsonObjectStringFieldValue(var2, "type")); + int var5 = JsonUtils.getJsonObjectIntegerFieldValue(var2, "count"); + float[] var6 = new float[Math.max(var5, 16)]; + JsonArray var7 = JsonUtils.getJsonObjectJsonArrayField(var2, "values"); + + if (var7.size() != var5 && var7.size() > 1) { + throw new JsonException("Invalid amount of values specified (expected " + var5 + ", found " + var7.size() + ")"); + } else { + int var8 = 0; + + for (Iterator var9 = var7.iterator(); var9.hasNext(); ++var8) { + JsonElement var10 = (JsonElement)var9.next(); + + try { + var6[var8] = JsonUtils.getJsonElementFloatValue(var10, "value"); + } catch (Exception var13) { + JsonException var12 = JsonException.func_151379_a(var13); + var12.func_151380_a("values[" + var8 + "]"); + throw var12; + } + } + + if (var5 > 1 && var7.size() == 1) { + while (var8 < var5) { + var6[var8] = var6[0]; + ++var8; + } + } + + int var14 = var5 > 1 && var5 <= 4 && var4 < 8 ? var5 - 1 : 0; + ShaderUniform var15 = new ShaderUniform(var3, var4 + var14, var5, this); + + if (var4 <= 3) { + var15.func_148083_a((int)var6[0], (int)var6[1], (int)var6[2], (int)var6[3]); + } else if (var4 <= 7) { + var15.func_148092_b(var6[0], var6[1], var6[2], var6[3]); + } else { + var15.func_148097_a(var6); + } + + this.field_148011_i.add(var15); + } + } + + public ShaderLoader func_147989_e() { + return this.field_148013_s; + } + + public ShaderLoader func_147994_f() { + return this.field_148012_t; + } + + public int func_147986_h() { + return this.field_148006_l; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderUniform.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderUniform.java new file mode 100644 index 0000000..3398d33 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/ShaderUniform.java @@ -0,0 +1,268 @@ +package net.minecraft.client.shader; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import javax.vecmath.Matrix4f; +import net.minecraft.client.renderer.OpenGlHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; + +public class ShaderUniform { + private static final Logger logger = LogManager.getLogger(); + private int field_148102_b; + private final int field_148103_c; + private final int field_148100_d; + private final IntBuffer field_148101_e; + private final FloatBuffer field_148098_f; + private final String field_148099_g; + private boolean field_148105_h; + private final ShaderManager field_148106_i; + + + public ShaderUniform(String p_i45092_1_, int p_i45092_2_, int p_i45092_3_, ShaderManager p_i45092_4_) { + this.field_148099_g = p_i45092_1_; + this.field_148103_c = p_i45092_3_; + this.field_148100_d = p_i45092_2_; + this.field_148106_i = p_i45092_4_; + + if (p_i45092_2_ <= 3) { + this.field_148101_e = BufferUtils.createIntBuffer(p_i45092_3_); + this.field_148098_f = null; + } else { + this.field_148101_e = null; + this.field_148098_f = BufferUtils.createFloatBuffer(p_i45092_3_); + } + + this.field_148102_b = -1; + this.func_148096_h(); + } + + private void func_148096_h() { + this.field_148105_h = true; + + if (this.field_148106_i != null) { + this.field_148106_i.func_147985_d(); + } + } + + public static int func_148085_a(String p_148085_0_) { + byte var1 = -1; + + if (p_148085_0_.equals("int")) { + var1 = 0; + } else if (p_148085_0_.equals("float")) { + var1 = 4; + } else if (p_148085_0_.startsWith("matrix")) { + if (p_148085_0_.endsWith("2x2")) { + var1 = 8; + } else if (p_148085_0_.endsWith("3x3")) { + var1 = 9; + } else if (p_148085_0_.endsWith("4x4")) { + var1 = 10; + } + } + + return var1; + } + + public void func_148084_b(int p_148084_1_) { + this.field_148102_b = p_148084_1_; + } + + public String func_148086_a() { + return this.field_148099_g; + } + + public void func_148090_a(float p_148090_1_) { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148090_1_); + this.func_148096_h(); + } + + public void func_148087_a(float p_148087_1_, float p_148087_2_) { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148087_1_); + this.field_148098_f.put(1, p_148087_2_); + this.func_148096_h(); + } + + public void func_148095_a(float p_148095_1_, float p_148095_2_, float p_148095_3_) { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148095_1_); + this.field_148098_f.put(1, p_148095_2_); + this.field_148098_f.put(2, p_148095_3_); + this.func_148096_h(); + } + + public void func_148081_a(float p_148081_1_, float p_148081_2_, float p_148081_3_, float p_148081_4_) { + this.field_148098_f.position(0); + this.field_148098_f.put(p_148081_1_); + this.field_148098_f.put(p_148081_2_); + this.field_148098_f.put(p_148081_3_); + this.field_148098_f.put(p_148081_4_); + this.field_148098_f.flip(); + this.func_148096_h(); + } + + public void func_148092_b(float p_148092_1_, float p_148092_2_, float p_148092_3_, float p_148092_4_) { + this.field_148098_f.position(0); + + if (this.field_148100_d >= 4) { + this.field_148098_f.put(0, p_148092_1_); + } + + if (this.field_148100_d >= 5) { + this.field_148098_f.put(1, p_148092_2_); + } + + if (this.field_148100_d >= 6) { + this.field_148098_f.put(2, p_148092_3_); + } + + if (this.field_148100_d >= 7) { + this.field_148098_f.put(3, p_148092_4_); + } + + this.func_148096_h(); + } + + public void func_148083_a(int p_148083_1_, int p_148083_2_, int p_148083_3_, int p_148083_4_) { + this.field_148101_e.position(0); + + if (this.field_148100_d >= 0) { + this.field_148101_e.put(0, p_148083_1_); + } + + if (this.field_148100_d >= 1) { + this.field_148101_e.put(1, p_148083_2_); + } + + if (this.field_148100_d >= 2) { + this.field_148101_e.put(2, p_148083_3_); + } + + if (this.field_148100_d >= 3) { + this.field_148101_e.put(3, p_148083_4_); + } + + this.func_148096_h(); + } + + public void func_148097_a(float[] p_148097_1_) { + if (p_148097_1_.length < this.field_148103_c) { + logger.warn("Uniform.set called with a too-small value array (expected " + this.field_148103_c + ", got " + p_148097_1_.length + "). Ignoring."); + } else { + this.field_148098_f.position(0); + this.field_148098_f.put(p_148097_1_); + this.field_148098_f.position(0); + this.func_148096_h(); + } + } + + public void func_148094_a(float p_148094_1_, float p_148094_2_, float p_148094_3_, float p_148094_4_, float p_148094_5_, float p_148094_6_, float p_148094_7_, float p_148094_8_, float p_148094_9_, float p_148094_10_, float p_148094_11_, float p_148094_12_, float p_148094_13_, float p_148094_14_, float p_148094_15_, float p_148094_16_) { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148094_1_); + this.field_148098_f.put(1, p_148094_2_); + this.field_148098_f.put(2, p_148094_3_); + this.field_148098_f.put(3, p_148094_4_); + this.field_148098_f.put(4, p_148094_5_); + this.field_148098_f.put(5, p_148094_6_); + this.field_148098_f.put(6, p_148094_7_); + this.field_148098_f.put(7, p_148094_8_); + this.field_148098_f.put(8, p_148094_9_); + this.field_148098_f.put(9, p_148094_10_); + this.field_148098_f.put(10, p_148094_11_); + this.field_148098_f.put(11, p_148094_12_); + this.field_148098_f.put(12, p_148094_13_); + this.field_148098_f.put(13, p_148094_14_); + this.field_148098_f.put(14, p_148094_15_); + this.field_148098_f.put(15, p_148094_16_); + this.func_148096_h(); + } + + public void func_148088_a(Matrix4f p_148088_1_) { + this.func_148094_a(p_148088_1_.m00, p_148088_1_.m01, p_148088_1_.m02, p_148088_1_.m03, p_148088_1_.m10, p_148088_1_.m11, p_148088_1_.m12, p_148088_1_.m13, p_148088_1_.m20, p_148088_1_.m21, p_148088_1_.m22, p_148088_1_.m23, p_148088_1_.m30, p_148088_1_.m31, p_148088_1_.m32, p_148088_1_.m33); + } + + public void func_148093_b() { + if (!this.field_148105_h) { + } + + this.field_148105_h = false; + + if (this.field_148100_d <= 3) { + this.func_148091_i(); + } else if (this.field_148100_d <= 7) { + this.func_148089_j(); + } else { + if (this.field_148100_d > 10) { + logger.warn("Uniform.upload called, but type value (" + this.field_148100_d + ") is not " + "a valid type. Ignoring."); + return; + } + + this.func_148082_k(); + } + } + + private void func_148091_i() { + switch (this.field_148100_d) { + case 0: + OpenGlHelper.func_153181_a(this.field_148102_b, this.field_148101_e); + break; + + case 1: + OpenGlHelper.func_153182_b(this.field_148102_b, this.field_148101_e); + break; + + case 2: + OpenGlHelper.func_153192_c(this.field_148102_b, this.field_148101_e); + break; + + case 3: + OpenGlHelper.func_153162_d(this.field_148102_b, this.field_148101_e); + break; + + default: + logger.warn("Uniform.upload called, but count value (" + this.field_148103_c + ") is " + " not in the range of 1 to 4. Ignoring."); + } + } + + private void func_148089_j() { + switch (this.field_148100_d) { + case 4: + OpenGlHelper.func_153168_a(this.field_148102_b, this.field_148098_f); + break; + + case 5: + OpenGlHelper.func_153177_b(this.field_148102_b, this.field_148098_f); + break; + + case 6: + OpenGlHelper.func_153191_c(this.field_148102_b, this.field_148098_f); + break; + + case 7: + OpenGlHelper.func_153159_d(this.field_148102_b, this.field_148098_f); + break; + + default: + logger.warn("Uniform.upload called, but count value (" + this.field_148103_c + ") is " + "not in the range of 1 to 4. Ignoring."); + } + } + + private void func_148082_k() { + switch (this.field_148100_d) { + case 8: + OpenGlHelper.func_153173_a(this.field_148102_b, true, this.field_148098_f); + break; + + case 9: + OpenGlHelper.func_153189_b(this.field_148102_b, true, this.field_148098_f); + break; + + case 10: + OpenGlHelper.func_153160_c(this.field_148102_b, true, this.field_148098_f); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/TesselatorVertexState.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/TesselatorVertexState.java new file mode 100644 index 0000000..d7fdf4c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/shader/TesselatorVertexState.java @@ -0,0 +1,65 @@ +package net.minecraft.client.shader; + +public class TesselatorVertexState { + private int[] rawBuffer; + private int rawBufferIndex; + private int vertexCount; + private boolean hasTexture; + private boolean hasBrightness; + private boolean hasNormals; + private boolean hasColor; + + public TesselatorVertexState(int[] p_i45079_1_, int p_i45079_2_, int p_i45079_3_, boolean p_i45079_4_, boolean p_i45079_5_, boolean p_i45079_6_, boolean p_i45079_7_) { + this.rawBuffer = p_i45079_1_; + this.rawBufferIndex = p_i45079_2_; + this.vertexCount = p_i45079_3_; + this.hasTexture = p_i45079_4_; + this.hasBrightness = p_i45079_5_; + this.hasNormals = p_i45079_6_; + this.hasColor = p_i45079_7_; + } + + public int[] getRawBuffer() { + return this.rawBuffer; + } + + public int getRawBufferIndex() { + return this.rawBufferIndex; + } + + public int getVertexCount() { + return this.vertexCount; + } + + public boolean getHasTexture() { + return this.hasTexture; + } + + public boolean getHasBrightness() { + return this.hasBrightness; + } + + public boolean getHasNormals() { + return this.hasNormals; + } + + public boolean getHasColor() { + return this.hasColor; + } + + public void addTessellatorVertexState(TesselatorVertexState tsv) { + if (tsv != null) { + if (tsv.hasBrightness == this.hasBrightness && tsv.hasColor == this.hasColor && tsv.hasNormals == this.hasNormals && tsv.hasTexture == this.hasTexture) { + int newRawBufferIndex = this.rawBufferIndex + tsv.rawBufferIndex; + int[] newRawBuffer = new int[newRawBufferIndex]; + System.arraycopy(this.rawBuffer, 0, newRawBuffer, 0, this.rawBufferIndex); + System.arraycopy(tsv.rawBuffer, 0, newRawBuffer, this.rawBufferIndex, tsv.rawBufferIndex); + this.rawBuffer = newRawBuffer; + this.rawBufferIndex = newRawBufferIndex; + this.vertexCount += tsv.vertexCount; + } else { + throw new IllegalArgumentException("Incompatible vertex states"); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/JsonBlendingMode.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/JsonBlendingMode.java new file mode 100644 index 0000000..c4ec4d1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/JsonBlendingMode.java @@ -0,0 +1,163 @@ +package net.minecraft.client.util; + +import com.google.gson.JsonObject; +import net.minecraft.util.JsonUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; + +public class JsonBlendingMode { + private static JsonBlendingMode field_148118_a = null; + private final int field_148116_b; + private final int field_148117_c; + private final int field_148114_d; + private final int field_148115_e; + private final int field_148112_f; + private final boolean field_148113_g; + private final boolean field_148119_h; + + + private JsonBlendingMode(boolean p_i45084_1_, boolean p_i45084_2_, int p_i45084_3_, int p_i45084_4_, int p_i45084_5_, int p_i45084_6_, int p_i45084_7_) { + this.field_148113_g = p_i45084_1_; + this.field_148116_b = p_i45084_3_; + this.field_148114_d = p_i45084_4_; + this.field_148117_c = p_i45084_5_; + this.field_148115_e = p_i45084_6_; + this.field_148119_h = p_i45084_2_; + this.field_148112_f = p_i45084_7_; + } + + public JsonBlendingMode() { + this(false, true, 1, 0, 1, 0, 32774); + } + + public JsonBlendingMode(int p_i45085_1_, int p_i45085_2_, int p_i45085_3_) { + this(false, false, p_i45085_1_, p_i45085_2_, p_i45085_1_, p_i45085_2_, p_i45085_3_); + } + + public JsonBlendingMode(int p_i45086_1_, int p_i45086_2_, int p_i45086_3_, int p_i45086_4_, int p_i45086_5_) { + this(true, false, p_i45086_1_, p_i45086_2_, p_i45086_3_, p_i45086_4_, p_i45086_5_); + } + + public void func_148109_a() { + if (!this.equals(field_148118_a)) { + if (field_148118_a == null || this.field_148119_h != field_148118_a.func_148111_b()) { + field_148118_a = this; + + if (this.field_148119_h) { + GL11.glDisable(GL11.GL_BLEND); + return; + } + + GL11.glEnable(GL11.GL_BLEND); + } + + GL14.glBlendEquation(this.field_148112_f); + + if (this.field_148113_g) { + GL14.glBlendFuncSeparate(this.field_148116_b, this.field_148114_d, this.field_148117_c, this.field_148115_e); + } else { + GL11.glBlendFunc(this.field_148116_b, this.field_148114_d); + } + } + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (!(p_equals_1_ instanceof JsonBlendingMode)) { + return false; + } else { + JsonBlendingMode var2 = (JsonBlendingMode)p_equals_1_; + return this.field_148112_f == var2.field_148112_f && (this.field_148115_e == var2.field_148115_e && (this.field_148114_d == var2.field_148114_d && (this.field_148119_h == var2.field_148119_h && (this.field_148113_g == var2.field_148113_g && (this.field_148117_c == var2.field_148117_c && this.field_148116_b == var2.field_148116_b))))); + } + } + + public int hashCode() { + int var1 = this.field_148116_b; + var1 = 31 * var1 + this.field_148117_c; + var1 = 31 * var1 + this.field_148114_d; + var1 = 31 * var1 + this.field_148115_e; + var1 = 31 * var1 + this.field_148112_f; + var1 = 31 * var1 + (this.field_148113_g ? 1 : 0); + var1 = 31 * var1 + (this.field_148119_h ? 1 : 0); + return var1; + } + + public boolean func_148111_b() { + return this.field_148119_h; + } + + public static JsonBlendingMode func_148110_a(JsonObject p_148110_0_) { + if (p_148110_0_ == null) { + return new JsonBlendingMode(); + } else { + int var1 = 32774; + int var2 = 1; + int var3 = 0; + int var4 = 1; + int var5 = 0; + boolean var6 = true; + boolean var7 = false; + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "func")) { + var1 = func_148108_a(p_148110_0_.get("func").getAsString()); + + if (var1 != 32774) { + var6 = false; + } + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "srcrgb")) { + var2 = func_148107_b(p_148110_0_.get("srcrgb").getAsString()); + + if (var2 != 1) { + var6 = false; + } + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "dstrgb")) { + var3 = func_148107_b(p_148110_0_.get("dstrgb").getAsString()); + + if (var3 != 0) { + var6 = false; + } + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "srcalpha")) { + var4 = func_148107_b(p_148110_0_.get("srcalpha").getAsString()); + + if (var4 != 1) { + var6 = false; + } + + var7 = true; + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "dstalpha")) { + var5 = func_148107_b(p_148110_0_.get("dstalpha").getAsString()); + + if (var5 != 0) { + var6 = false; + } + + var7 = true; + } + + return var6 ? new JsonBlendingMode() : (var7 ? new JsonBlendingMode(var2, var3, var4, var5, var1) : new JsonBlendingMode(var2, var3, var1)); + } + } + + private static int func_148108_a(String p_148108_0_) { + String var1 = p_148108_0_.trim().toLowerCase(); + return var1.equals("add") ? 32774 : (var1.equals("subtract") ? 32778 : (var1.equals("reversesubtract") ? 32779 : (var1.equals("reverse_subtract") ? 32779 : (var1.equals("min") ? 32775 : (var1.equals("max") ? 32776 : 32774))))); + } + + private static int func_148107_b(String p_148107_0_) { + String var1 = p_148107_0_.trim().toLowerCase(); + var1 = var1.replaceAll("_", ""); + var1 = var1.replaceAll("one", "1"); + var1 = var1.replaceAll("zero", "0"); + var1 = var1.replaceAll("minus", "-"); + return var1.equals("0") ? 0 : (var1.equals("1") ? 1 : (var1.equals("srccolor") ? 768 : (var1.equals("1-srccolor") ? 769 : (var1.equals("dstcolor") ? 774 : (var1.equals("1-dstcolor") ? 775 : (var1.equals("srcalpha") ? 770 : (var1.equals("1-srcalpha") ? 771 : (var1.equals("dstalpha") ? 772 : (var1.equals("1-dstalpha") ? 773 : -1))))))))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/JsonException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/JsonException.java new file mode 100644 index 0000000..4e405d0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/JsonException.java @@ -0,0 +1,78 @@ +package net.minecraft.client.util; + +import com.google.common.collect.Lists; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import org.apache.commons.lang3.StringUtils; + +public class JsonException extends IOException { + private final List field_151383_a = Lists.newArrayList(); + private final String field_151382_b; + + + public JsonException(String p_i45279_1_) { + this.field_151383_a.add(new JsonException.Entry(null)); + this.field_151382_b = p_i45279_1_; + } + + public JsonException(String p_i45280_1_, Throwable p_i45280_2_) { + super(p_i45280_2_); + this.field_151383_a.add(new JsonException.Entry(null)); + this.field_151382_b = p_i45280_1_; + } + + public void func_151380_a(String p_151380_1_) { + ((JsonException.Entry)this.field_151383_a.get(0)).func_151373_a(p_151380_1_); + } + + public void func_151381_b(String p_151381_1_) { + ((JsonException.Entry)this.field_151383_a.get(0)).field_151376_a = p_151381_1_; + this.field_151383_a.add(0, new JsonException.Entry(null)); + } + + public String getMessage() { + return "Invalid " + this.field_151383_a.get(this.field_151383_a.size() - 1).toString() + ": " + this.field_151382_b; + } + + public static JsonException func_151379_a(Exception p_151379_0_) { + if (p_151379_0_ instanceof JsonException) { + return (JsonException)p_151379_0_; + } else { + String var1 = p_151379_0_.getMessage(); + + if (p_151379_0_ instanceof FileNotFoundException) { + var1 = "File not found"; + } + + return new JsonException(var1, p_151379_0_); + } + } + + public static class Entry { + private String field_151376_a; + private final List field_151375_b; + + + private Entry() { + this.field_151376_a = null; + this.field_151375_b = Lists.newArrayList(); + } + + private void func_151373_a(String p_151373_1_) { + this.field_151375_b.add(0, p_151373_1_); + } + + public String func_151372_b() { + return StringUtils.join(this.field_151375_b, "->"); + } + + public String toString() { + return this.field_151376_a != null ? (!this.field_151375_b.isEmpty() ? this.field_151376_a + " " + this.func_151372_b() : this.field_151376_a) : (!this.field_151375_b.isEmpty() ? "(Unknown file) " + this.func_151372_b() : "(Unknown file)"); + } + + Entry(Object p_i45278_1_) { + this(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/QuadComparator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/QuadComparator.java new file mode 100644 index 0000000..6c36d4d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/QuadComparator.java @@ -0,0 +1,58 @@ +package net.minecraft.client.util; + +import java.util.Comparator; + +public class QuadComparator implements Comparator { + private final float field_147630_a; + private final float field_147628_b; + private final float field_147629_c; + private final int[] field_147627_d; + + + public QuadComparator(int[] p_i45077_1_, float p_i45077_2_, float p_i45077_3_, float p_i45077_4_) { + this.field_147627_d = p_i45077_1_; + this.field_147630_a = p_i45077_2_; + this.field_147628_b = p_i45077_3_; + this.field_147629_c = p_i45077_4_; + } + + public int compare(Integer p_compare_1_, Integer p_compare_2_) { + float var3 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue()]) - this.field_147630_a; + float var4 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 1]) - this.field_147628_b; + float var5 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 2]) - this.field_147629_c; + float var6 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 8]) - this.field_147630_a; + float var7 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 9]) - this.field_147628_b; + float var8 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 10]) - this.field_147629_c; + float var9 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 16]) - this.field_147630_a; + float var10 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 17]) - this.field_147628_b; + float var11 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 18]) - this.field_147629_c; + float var12 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 24]) - this.field_147630_a; + float var13 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 25]) - this.field_147628_b; + float var14 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 26]) - this.field_147629_c; + float var15 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue()]) - this.field_147630_a; + float var16 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 1]) - this.field_147628_b; + float var17 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 2]) - this.field_147629_c; + float var18 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 8]) - this.field_147630_a; + float var19 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 9]) - this.field_147628_b; + float var20 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 10]) - this.field_147629_c; + float var21 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 16]) - this.field_147630_a; + float var22 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 17]) - this.field_147628_b; + float var23 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 18]) - this.field_147629_c; + float var24 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 24]) - this.field_147630_a; + float var25 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 25]) - this.field_147628_b; + float var26 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 26]) - this.field_147629_c; + float var27 = (var3 + var6 + var9 + var12) * 0.25F; + float var28 = (var4 + var7 + var10 + var13) * 0.25F; + float var29 = (var5 + var8 + var11 + var14) * 0.25F; + float var30 = (var15 + var18 + var21 + var24) * 0.25F; + float var31 = (var16 + var19 + var22 + var25) * 0.25F; + float var32 = (var17 + var20 + var23 + var26) * 0.25F; + float var33 = var27 * var27 + var28 * var28 + var29 * var29; + float var34 = var30 * var30 + var31 * var31 + var32 * var32; + return Float.compare(var34, var33); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((Integer)p_compare_1_, (Integer)p_compare_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/RenderDistanceSorter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/RenderDistanceSorter.java new file mode 100644 index 0000000..a76693e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/client/util/RenderDistanceSorter.java @@ -0,0 +1,30 @@ +package net.minecraft.client.util; + +import com.google.common.collect.ComparisonChain; +import java.util.Comparator; +import net.minecraft.client.renderer.RenderList; + +public class RenderDistanceSorter implements Comparator { + int field_152632_a; + int field_152633_b; + + + public RenderDistanceSorter(int p_i1051_1_, int p_i1051_2_) { + this.field_152632_a = p_i1051_1_; + this.field_152633_b = p_i1051_2_; + } + + public int compare(RenderList p_compare_1_, RenderList p_compare_2_) { + int var3 = p_compare_1_.renderChunkX - this.field_152632_a; + int var4 = p_compare_1_.renderChunkZ - this.field_152633_b; + int var5 = p_compare_2_.renderChunkX - this.field_152632_a; + int var6 = p_compare_2_.renderChunkZ - this.field_152633_b; + int var7 = var3 * var3 + var4 * var4; + int var8 = var5 * var5 + var6 * var6; + return ComparisonChain.start().compare(var8, var7).result(); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((RenderList)p_compare_1_, (RenderList)p_compare_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandBase.java new file mode 100644 index 0000000..46511c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandBase.java @@ -0,0 +1,450 @@ +package net.minecraft.command; + +import com.google.common.primitives.Doubles; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public abstract class CommandBase implements ICommand { + private static IAdminCommand theAdmin; + + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 4; + } + + public List getCommandAliases() { + return null; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { + return p_71519_1_.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return null; + } + + /** + * Parses an int from the given string. + */ + public static int parseInt(ICommandSender p_71526_0_, String p_71526_1_) { + try { + return Integer.parseInt(p_71526_1_); + } catch (NumberFormatException var3) { + throw new NumberInvalidException("commands.generic.num.invalid", p_71526_1_); + } + } + + /** + * Parses an int from the given sring with a specified minimum. + */ + public static int parseIntWithMin(ICommandSender p_71528_0_, String p_71528_1_, int p_71528_2_) { + return parseIntBounded(p_71528_0_, p_71528_1_, p_71528_2_, Integer.MAX_VALUE); + } + + /** + * Parses an int from the given string within a specified bound. + */ + public static int parseIntBounded(ICommandSender p_71532_0_, String p_71532_1_, int p_71532_2_, int p_71532_3_) { + int var4 = parseInt(p_71532_0_, p_71532_1_); + + if (var4 < p_71532_2_) { + throw new NumberInvalidException("commands.generic.num.tooSmall", Integer.valueOf(var4), Integer.valueOf(p_71532_2_)); + } else if (var4 > p_71532_3_) { + throw new NumberInvalidException("commands.generic.num.tooBig", Integer.valueOf(var4), Integer.valueOf(p_71532_3_)); + } else { + return var4; + } + } + + /** + * Parses a double from the given string or throws an exception if it's not a double. + */ + public static double parseDouble(ICommandSender p_82363_0_, String p_82363_1_) { + try { + double var2 = Double.parseDouble(p_82363_1_); + + if (!Doubles.isFinite(var2)) { + throw new NumberInvalidException("commands.generic.num.invalid", p_82363_1_); + } else { + return var2; + } + } catch (NumberFormatException var4) { + throw new NumberInvalidException("commands.generic.num.invalid", p_82363_1_); + } + } + + /** + * Parses a double from the given string. Throws if the string could not be parsed as a double, or if it's less + * than the given minimum value. + */ + public static double parseDoubleWithMin(ICommandSender p_110664_0_, String p_110664_1_, double p_110664_2_) { + return parseDoubleBounded(p_110664_0_, p_110664_1_, p_110664_2_, Double.MAX_VALUE); + } + + /** + * Parses a double from the given string. Throws if the string could not be parsed as a double, or if it's not + * between the given min and max values. + */ + public static double parseDoubleBounded(ICommandSender p_110661_0_, String p_110661_1_, double p_110661_2_, double p_110661_4_) { + double var6 = parseDouble(p_110661_0_, p_110661_1_); + + if (var6 < p_110661_2_) { + throw new NumberInvalidException("commands.generic.double.tooSmall", Double.valueOf(var6), Double.valueOf(p_110661_2_)); + } else if (var6 > p_110661_4_) { + throw new NumberInvalidException("commands.generic.double.tooBig", Double.valueOf(var6), Double.valueOf(p_110661_4_)); + } else { + return var6; + } + } + + /** + * Parses a boolean value from the given string. Throws if the string does not contain a boolean value. Accepted + * values are (case-sensitive): "true", "false", "0", "1". + */ + public static boolean parseBoolean(ICommandSender p_110662_0_, String p_110662_1_) { + if (!p_110662_1_.equals("true") && !p_110662_1_.equals("1")) { + if (!p_110662_1_.equals("false") && !p_110662_1_.equals("0")) { + throw new CommandException("commands.generic.boolean.invalid", p_110662_1_); + } else { + return false; + } + } else { + return true; + } + } + + /** + * Returns the given ICommandSender as a EntityPlayer or throw an exception. + */ + public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender p_71521_0_) { + if (p_71521_0_ instanceof EntityPlayerMP) { + return (EntityPlayerMP)p_71521_0_; + } else { + throw new PlayerNotFoundException("You must specify which player you wish to perform this action on."); + } + } + + public static EntityPlayerMP getPlayer(ICommandSender p_82359_0_, String p_82359_1_) { + EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(p_82359_0_, p_82359_1_); + + if (var2 != null) { + return var2; + } else { + var2 = MinecraftServer.getServer().getConfigurationManager().func_152612_a(p_82359_1_); + + if (var2 == null) { + throw new PlayerNotFoundException(); + } else { + return var2; + } + } + } + + public static String func_96332_d(ICommandSender p_96332_0_, String p_96332_1_) { + EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(p_96332_0_, p_96332_1_); + + if (var2 != null) { + return var2.getCommandSenderName(); + } else if (PlayerSelector.hasArguments(p_96332_1_)) { + throw new PlayerNotFoundException(); + } else { + return p_96332_1_; + } + } + + public static IChatComponent func_147178_a(ICommandSender p_147178_0_, String[] p_147178_1_, int p_147178_2_) { + return func_147176_a(p_147178_0_, p_147178_1_, p_147178_2_, false); + } + + public static IChatComponent func_147176_a(ICommandSender p_147176_0_, String[] p_147176_1_, int p_147176_2_, boolean p_147176_3_) { + ChatComponentText var4 = new ChatComponentText(""); + + for (int var5 = p_147176_2_; var5 < p_147176_1_.length; ++var5) { + if (var5 > p_147176_2_) { + var4.appendText(" "); + } + + Object var6 = new ChatComponentText(p_147176_1_[var5]); + + if (p_147176_3_) { + IChatComponent var7 = PlayerSelector.func_150869_b(p_147176_0_, p_147176_1_[var5]); + + if (var7 != null) { + var6 = var7; + } else if (PlayerSelector.hasArguments(p_147176_1_[var5])) { + throw new PlayerNotFoundException(); + } + } + + var4.appendSibling((IChatComponent)var6); + } + + return var4; + } + + public static String func_82360_a(ICommandSender p_82360_0_, String[] p_82360_1_, int p_82360_2_) { + StringBuilder var3 = new StringBuilder(); + + for (int var4 = p_82360_2_; var4 < p_82360_1_.length; ++var4) { + if (var4 > p_82360_2_) { + var3.append(" "); + } + + String var5 = p_82360_1_[var4]; + var3.append(var5); + } + + return var3.toString(); + } + + public static double func_110666_a(ICommandSender p_110666_0_, double p_110666_1_, String p_110666_3_) { + return func_110665_a(p_110666_0_, p_110666_1_, p_110666_3_, -30000000, 30000000); + } + + public static double func_110665_a(ICommandSender p_110665_0_, double p_110665_1_, String p_110665_3_, int p_110665_4_, int p_110665_5_) { + boolean var6 = p_110665_3_.startsWith("~"); + + if (var6 && Double.isNaN(p_110665_1_)) { + throw new NumberInvalidException("commands.generic.num.invalid", Double.valueOf(p_110665_1_)); + } else { + double var7 = var6 ? p_110665_1_ : 0.0D; + + if (!var6 || p_110665_3_.length() > 1) { + boolean var9 = p_110665_3_.contains("."); + + if (var6) { + p_110665_3_ = p_110665_3_.substring(1); + } + + var7 += parseDouble(p_110665_0_, p_110665_3_); + + if (!var9 && !var6) { + var7 += 0.5D; + } + } + + if (p_110665_4_ != 0 || p_110665_5_ != 0) { + if (var7 < (double)p_110665_4_) { + throw new NumberInvalidException("commands.generic.double.tooSmall", Double.valueOf(var7), Integer.valueOf(p_110665_4_)); + } + + if (var7 > (double)p_110665_5_) { + throw new NumberInvalidException("commands.generic.double.tooBig", Double.valueOf(var7), Integer.valueOf(p_110665_5_)); + } + } + + return var7; + } + } + + /** + * Gets the Item specified by the given text string. First checks the item registry, then tries by parsing the + * string as an integer ID (deprecated). Warns the sender if we matched by parsing the ID. Throws if the item + * wasn't found. Returns the item if it was found. + */ + public static Item getItemByText(ICommandSender p_147179_0_, String p_147179_1_) { + Item var2 = (Item)Item.itemRegistry.getObject(p_147179_1_); + + if (var2 == null) { + try { + Item var3 = Item.getItemById(Integer.parseInt(p_147179_1_)); + + if (var3 != null) { + ChatComponentTranslation var4 = new ChatComponentTranslation("commands.generic.deprecatedId", Item.itemRegistry.getNameForObject(var3)); + var4.getChatStyle().setColor(EnumChatFormatting.GRAY); + p_147179_0_.addChatMessage(var4); + } + + var2 = var3; + } catch (NumberFormatException var5) { + } + } + + if (var2 == null) { + throw new NumberInvalidException("commands.give.notFound", p_147179_1_); + } else { + return var2; + } + } + + /** + * Gets the Block specified by the given text string. First checks the block registry, then tries by parsing the + * string as an integer ID (deprecated). Warns the sender if we matched by parsing the ID. Throws if the block + * wasn't found. Returns the block if it was found. + */ + public static Block getBlockByText(ICommandSender p_147180_0_, String p_147180_1_) { + if (Block.blockRegistry.containsKey(p_147180_1_)) { + return (Block)Block.blockRegistry.getObject(p_147180_1_); + } else { + try { + int var2 = Integer.parseInt(p_147180_1_); + + if (Block.blockRegistry.containsID(var2)) { + Block var3 = Block.getBlockById(var2); + ChatComponentTranslation var4 = new ChatComponentTranslation("commands.generic.deprecatedId", Block.blockRegistry.getNameForObject(var3)); + var4.getChatStyle().setColor(EnumChatFormatting.GRAY); + p_147180_0_.addChatMessage(var4); + return var3; + } + } catch (NumberFormatException var5) { + } + + throw new NumberInvalidException("commands.give.notFound", p_147180_1_); + } + } + + /** + * Creates a linguistic series joining the input objects together. Examples: 1) {} --> "", 2) {"Steve"} --> + * "Steve", 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", "Phil", "Mark"} --> "Steve, Phil and Mark" + */ + public static String joinNiceString(Object[] p_71527_0_) { + StringBuilder var1 = new StringBuilder(); + + for (int var2 = 0; var2 < p_71527_0_.length; ++var2) { + String var3 = p_71527_0_[var2].toString(); + + if (var2 > 0) { + if (var2 == p_71527_0_.length - 1) { + var1.append(" and "); + } else { + var1.append(", "); + } + } + + var1.append(var3); + } + + return var1.toString(); + } + + /** + * Creates a linguistic series joining the input chat components. Examples: 1) {} --> "", 2) {"Steve"} --> + * "Steve", 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", "Phil", "Mark"} --> "Steve, Phil and Mark" + */ + public static IChatComponent joinNiceString(IChatComponent[] p_147177_0_) { + ChatComponentText var1 = new ChatComponentText(""); + + for (int var2 = 0; var2 < p_147177_0_.length; ++var2) { + if (var2 > 0) { + if (var2 == p_147177_0_.length - 1) { + var1.appendText(" and "); + } else if (var2 > 0) { + var1.appendText(", "); + } + } + + var1.appendSibling(p_147177_0_[var2]); + } + + return var1; + } + + /** + * Creates a linguistic series joining together the elements of the given collection. Examples: 1) {} --> "", 2) + * {"Steve"} --> "Steve", 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", "Phil", "Mark"} --> "Steve, Phil + * and Mark" + */ + public static String joinNiceStringFromCollection(Collection p_96333_0_) { + return joinNiceString(p_96333_0_.toArray(new String[p_96333_0_.size()])); + } + + /** + * Returns true if the given substring is exactly equal to the start of the given string (case insensitive). + */ + public static boolean doesStringStartWith(String p_71523_0_, String p_71523_1_) { + return p_71523_1_.regionMatches(true, 0, p_71523_0_, 0, p_71523_0_.length()); + } + + /** + * Returns a List of strings (chosen from the given strings) which the last word in the given string array is a + * beginning-match for. (Tab completion). + */ + public static List getListOfStringsMatchingLastWord(String[] p_71530_0_, String ... p_71530_1_) { + String var2 = p_71530_0_[p_71530_0_.length - 1]; + ArrayList var3 = new ArrayList(); + String[] var4 = p_71530_1_; + int var5 = p_71530_1_.length; + + for (int var6 = 0; var6 < var5; ++var6) { + String var7 = var4[var6]; + + if (doesStringStartWith(var2, var7)) { + var3.add(var7); + } + } + + return var3; + } + + /** + * Returns a List of strings (chosen from the given string iterable) which the last word in the given string array + * is a beginning-match for. (Tab completion). + */ + public static List getListOfStringsFromIterableMatchingLastWord(String[] p_71531_0_, Iterable p_71531_1_) { + String var2 = p_71531_0_[p_71531_0_.length - 1]; + ArrayList var3 = new ArrayList(); + Iterator var4 = p_71531_1_.iterator(); + + while (var4.hasNext()) { + String var5 = (String)var4.next(); + + if (doesStringStartWith(var2, var5)) { + var3.add(var5); + } + } + + return var3; + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return false; + } + + public static void func_152373_a(ICommandSender p_152373_0_, ICommand p_152373_1_, String p_152373_2_, Object ... p_152373_3_) { + func_152374_a(p_152373_0_, p_152373_1_, 0, p_152373_2_, p_152373_3_); + } + + public static void func_152374_a(ICommandSender p_152374_0_, ICommand p_152374_1_, int p_152374_2_, String p_152374_3_, Object ... p_152374_4_) { + if (theAdmin != null) { + theAdmin.func_152372_a(p_152374_0_, p_152374_1_, p_152374_2_, p_152374_3_, p_152374_4_); + } + } + + /** + * Sets the static IAdminCommander. + */ + public static void setAdminCommander(IAdminCommand p_71529_0_) { + theAdmin = p_71529_0_; + } + + public int compareTo(ICommand p_compareTo_1_) { + return this.getCommandName().compareTo(p_compareTo_1_.getCommandName()); + } + + public int compareTo(Object p_compareTo_1_) { + return this.compareTo((ICommand)p_compareTo_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandClearInventory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandClearInventory.java new file mode 100644 index 0000000..ea946e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandClearInventory.java @@ -0,0 +1,66 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.server.MinecraftServer; + +public class CommandClearInventory extends CommandBase { + + + public String getCommandName() { + return "clear"; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.clear.usage"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + EntityPlayerMP var3 = p_71515_2_.length == 0 ? getCommandSenderAsPlayer(p_71515_1_) : getPlayer(p_71515_1_, p_71515_2_[0]); + Item var4 = p_71515_2_.length >= 2 ? getItemByText(p_71515_1_, p_71515_2_[1]) : null; + int var5 = p_71515_2_.length >= 3 ? parseIntWithMin(p_71515_1_, p_71515_2_[2], 0) : -1; + + if (p_71515_2_.length >= 2 && var4 == null) { + throw new CommandException("commands.clear.failure", var3.getCommandSenderName()); + } else { + int var6 = var3.inventory.clearInventory(var4, var5); + var3.inventoryContainer.detectAndSendChanges(); + + if (!var3.capabilities.isCreativeMode) { + var3.updateHeldItem(); + } + + if (var6 == 0) { + throw new CommandException("commands.clear.failure", var3.getCommandSenderName()); + } else { + func_152373_a(p_71515_1_, this, "commands.clear.success", var3.getCommandSenderName(), Integer.valueOf(var6)); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, this.func_147209_d()) : (p_71516_2_.length == 2 ? getListOfStringsFromIterableMatchingLastWord(p_71516_2_, Item.itemRegistry.getKeys()) : null); + } + + protected String[] func_147209_d() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDebug.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDebug.java new file mode 100644 index 0000000..26297e4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDebug.java @@ -0,0 +1,137 @@ +package net.minecraft.command; + +import java.io.File; +import java.io.FileWriter; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CommandDebug extends CommandBase { + private static final Logger logger = LogManager.getLogger(); + private long field_147206_b; + private int field_147207_c; + + + public String getCommandName() { + return "debug"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.debug.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length == 1) { + if (p_71515_2_[0].equals("start")) { + func_152373_a(p_71515_1_, this, "commands.debug.start"); + MinecraftServer.getServer().enableProfiling(); + this.field_147206_b = MinecraftServer.getSystemTimeMillis(); + this.field_147207_c = MinecraftServer.getServer().getTickCounter(); + return; + } + + if (p_71515_2_[0].equals("stop")) { + if (!MinecraftServer.getServer().theProfiler.profilingEnabled) { + throw new CommandException("commands.debug.notStarted"); + } + + long var3 = MinecraftServer.getSystemTimeMillis(); + int var5 = MinecraftServer.getServer().getTickCounter(); + long var6 = var3 - this.field_147206_b; + int var8 = var5 - this.field_147207_c; + this.func_147205_a(var6, var8); + MinecraftServer.getServer().theProfiler.profilingEnabled = false; + func_152373_a(p_71515_1_, this, "commands.debug.stop", Float.valueOf((float)var6 / 1000.0F), Integer.valueOf(var8)); + return; + } + } + + throw new WrongUsageException("commands.debug.usage"); + } + + private void func_147205_a(long p_147205_1_, int p_147205_3_) { + File var4 = new File(MinecraftServer.getServer().getFile("debug"), "profile-results-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + ".txt"); + var4.getParentFile().mkdirs(); + + try { + FileWriter var5 = new FileWriter(var4); + var5.write(this.func_147204_b(p_147205_1_, p_147205_3_)); + var5.close(); + } catch (Throwable var6) { + logger.error("Could not save profiler results to " + var4, var6); + } + } + + private String func_147204_b(long p_147204_1_, int p_147204_3_) { + StringBuilder var4 = new StringBuilder(); + var4.append("---- Minecraft Profiler Results ----\n"); + var4.append("// "); + var4.append(func_147203_d()); + var4.append("\n\n"); + var4.append("Time span: ").append(p_147204_1_).append(" ms\n"); + var4.append("Tick span: ").append(p_147204_3_).append(" ticks\n"); + var4.append("// This is approximately ").append(String.format("%.2f", Float.valueOf((float)p_147204_3_ / ((float)p_147204_1_ / 1000.0F)))).append(" ticks per second. It should be ").append(20).append(" ticks per second\n\n"); + var4.append("--- BEGIN PROFILE DUMP ---\n\n"); + this.func_147202_a(0, "root", var4); + var4.append("--- END PROFILE DUMP ---\n\n"); + return var4.toString(); + } + + private void func_147202_a(int p_147202_1_, String p_147202_2_, StringBuilder p_147202_3_) { + List var4 = MinecraftServer.getServer().theProfiler.getProfilingData(p_147202_2_); + + if (var4 != null && var4.size() >= 3) { + for (int var5 = 1; var5 < var4.size(); ++var5) { + Profiler.Result var6 = (Profiler.Result)var4.get(var5); + p_147202_3_.append(String.format("[%02d] ", Integer.valueOf(p_147202_1_))); + + for (int var7 = 0; var7 < p_147202_1_; ++var7) { + p_147202_3_.append(" "); + } + + p_147202_3_.append(var6.field_76331_c); + p_147202_3_.append(" - "); + p_147202_3_.append(String.format("%.2f", Double.valueOf(var6.field_76332_a))); + p_147202_3_.append("%/"); + p_147202_3_.append(String.format("%.2f", Double.valueOf(var6.field_76330_b))); + p_147202_3_.append("%\n"); + + if (!var6.field_76331_c.equals("unspecified")) { + try { + this.func_147202_a(p_147202_1_ + 1, p_147202_2_ + "." + var6.field_76331_c, p_147202_3_); + } catch (Exception var8) { + p_147202_3_.append("[[ EXCEPTION " + var8 + " ]]"); + } + } + } + } + } + + private static String func_147203_d() { + String[] var0 = new String[] {"Shiny numbers!", "Am I not running fast enough? :(", "I'm working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!", "Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers", "Now with the same numbers", "You should add flames to things, it makes them go faster!", "Do you feel the need for... optimization?", "*cracks redstone whip*", "Maybe if you treated it better then it'll have more motivation to work faster! Poor server."}; + + try { + return var0[(int)(System.nanoTime() % (long)var0.length)]; + } catch (Throwable var2) { + return "Witty comment unavailable :("; + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, "start", "stop"): null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDefaultGameMode.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDefaultGameMode.java new file mode 100644 index 0000000..2eb1915 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDefaultGameMode.java @@ -0,0 +1,42 @@ +package net.minecraft.command; + +import java.util.Iterator; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.WorldSettings; + +public class CommandDefaultGameMode extends CommandGameMode { + + + public String getCommandName() { + return "defaultgamemode"; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.defaultgamemode.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length > 0) { + WorldSettings.GameType var3 = this.getGameModeFromCommand(p_71515_1_, p_71515_2_[0]); + this.setGameType(var3); + func_152373_a(p_71515_1_, this, "commands.defaultgamemode.success", new ChatComponentTranslation("gameMode." + var3.getName())); + } else { + throw new WrongUsageException("commands.defaultgamemode.usage"); + } + } + + protected void setGameType(WorldSettings.GameType p_71541_1_) { + MinecraftServer var2 = MinecraftServer.getServer(); + var2.setGameType(p_71541_1_); + EntityPlayerMP var4; + + if (var2.getForceGamemode()) { + for (Iterator var3 = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); var3.hasNext(); var4.fallDistance = 0.0F) { + var4 = (EntityPlayerMP)var3.next(); + var4.setGameType(p_71541_1_); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDifficulty.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDifficulty.java new file mode 100644 index 0000000..af11471 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandDifficulty.java @@ -0,0 +1,46 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.EnumDifficulty; + +public class CommandDifficulty extends CommandBase { + + + public String getCommandName() { + return "difficulty"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.difficulty.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length > 0) { + EnumDifficulty var3 = this.func_147201_h(p_71515_1_, p_71515_2_[0]); + MinecraftServer.getServer().func_147139_a(var3); + func_152373_a(p_71515_1_, this, "commands.difficulty.success", new ChatComponentTranslation(var3.getDifficultyResourceKey())); + } else { + throw new WrongUsageException("commands.difficulty.usage"); + } + } + + protected EnumDifficulty func_147201_h(ICommandSender p_147201_1_, String p_147201_2_) { + return !p_147201_2_.equalsIgnoreCase("peaceful") && !p_147201_2_.equalsIgnoreCase("p") ? (!p_147201_2_.equalsIgnoreCase("easy") && !p_147201_2_.equalsIgnoreCase("e") ? (!p_147201_2_.equalsIgnoreCase("normal") && !p_147201_2_.equalsIgnoreCase("n") ? (!p_147201_2_.equalsIgnoreCase("hard") && !p_147201_2_.equalsIgnoreCase("h") ? EnumDifficulty.getDifficultyEnum(parseIntBounded(p_147201_1_, p_147201_2_, 0, 3)) : EnumDifficulty.HARD) : EnumDifficulty.NORMAL) : EnumDifficulty.EASY) : EnumDifficulty.PEACEFUL; + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, "peaceful", "easy", "normal", "hard"): null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandEffect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandEffect.java new file mode 100644 index 0000000..dff6850 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandEffect.java @@ -0,0 +1,100 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandEffect extends CommandBase { + + + public String getCommandName() { + return "effect"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.effect.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException("commands.effect.usage"); + } else { + EntityPlayerMP var3 = getPlayer(p_71515_1_, p_71515_2_[0]); + + if (p_71515_2_[1].equals("clear")) { + if (var3.getActivePotionEffects().isEmpty()) { + throw new CommandException("commands.effect.failure.notActive.all", var3.getCommandSenderName()); + } + + var3.clearActivePotions(); + func_152373_a(p_71515_1_, this, "commands.effect.success.removed.all", var3.getCommandSenderName()); + } else { + int var4 = parseIntWithMin(p_71515_1_, p_71515_2_[1], 1); + int var5 = 600; + int var6 = 30; + int var7 = 0; + + if (var4 < 0 || var4 >= Potion.potionTypes.length || Potion.potionTypes[var4] == null) { + throw new NumberInvalidException("commands.effect.notFound", Integer.valueOf(var4)); + } + + if (p_71515_2_.length >= 3) { + var6 = parseIntBounded(p_71515_1_, p_71515_2_[2], 0, 1000000); + + if (Potion.potionTypes[var4].isInstant()) { + var5 = var6; + } else { + var5 = var6 * 20; + } + } else if (Potion.potionTypes[var4].isInstant()) { + var5 = 1; + } + + if (p_71515_2_.length >= 4) { + var7 = parseIntBounded(p_71515_1_, p_71515_2_[3], 0, 255); + } + + if (var6 == 0) { + if (!var3.isPotionActive(var4)) { + throw new CommandException("commands.effect.failure.notActive", new ChatComponentTranslation(Potion.potionTypes[var4].getName()), var3.getCommandSenderName()); + } + + var3.removePotionEffect(var4); + func_152373_a(p_71515_1_, this, "commands.effect.success.removed", new ChatComponentTranslation(Potion.potionTypes[var4].getName()), var3.getCommandSenderName()); + } else { + PotionEffect var8 = new PotionEffect(var4, var5, var7); + var3.addPotionEffect(var8); + func_152373_a(p_71515_1_, this, "commands.effect.success", new ChatComponentTranslation(var8.getEffectName()), Integer.valueOf(var4), Integer.valueOf(var7), var3.getCommandSenderName(), Integer.valueOf(var6)); + } + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandEnchant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandEnchant.java new file mode 100644 index 0000000..bb99966 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandEnchant.java @@ -0,0 +1,93 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; + +public class CommandEnchant extends CommandBase { + + + public String getCommandName() { + return "enchant"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.enchant.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException("commands.enchant.usage"); + } else { + EntityPlayerMP var3 = getPlayer(p_71515_1_, p_71515_2_[0]); + int var4 = parseIntBounded(p_71515_1_, p_71515_2_[1], 0, Enchantment.enchantmentsList.length - 1); + int var5 = 1; + ItemStack var6 = var3.getCurrentEquippedItem(); + + if (var6 == null) { + throw new CommandException("commands.enchant.noItem"); + } else { + Enchantment var7 = Enchantment.enchantmentsList[var4]; + + if (var7 == null) { + throw new NumberInvalidException("commands.enchant.notFound", Integer.valueOf(var4)); + } else if (!var7.canApply(var6)) { + throw new CommandException("commands.enchant.cantEnchant"); + } else { + if (p_71515_2_.length >= 3) { + var5 = parseIntBounded(p_71515_1_, p_71515_2_[2], var7.getMinLevel(), var7.getMaxLevel()); + } + + if (var6.hasTagCompound()) { + NBTTagList var8 = var6.getEnchantmentTagList(); + + if (var8 != null) { + for (int var9 = 0; var9 < var8.tagCount(); ++var9) { + short var10 = var8.getCompoundTagAt(var9).getShort("id"); + + if (Enchantment.enchantmentsList[var10] != null) { + Enchantment var11 = Enchantment.enchantmentsList[var10]; + + if (!var11.canApplyTogether(var7)) { + throw new CommandException("commands.enchant.cantCombine", var7.getTranslatedName(var5), var11.getTranslatedName(var8.getCompoundTagAt(var9).getShort("lvl"))); + } + } + } + } + } + + var6.addEnchantment(var7, var5); + func_152373_a(p_71515_1_, this, "commands.enchant.success"); + } + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, this.getListOfPlayers()) : null; + } + + protected String[] getListOfPlayers() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandException.java new file mode 100644 index 0000000..9e2b882 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandException.java @@ -0,0 +1,15 @@ +package net.minecraft.command; + +public class CommandException extends RuntimeException { + private final Object[] errorObjects; + + + public CommandException(String p_i1359_1_, Object ... p_i1359_2_) { + super(p_i1359_1_); + this.errorObjects = p_i1359_2_; + } + + public Object[] getErrorOjbects() { + return this.errorObjects; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGameMode.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGameMode.java new file mode 100644 index 0000000..ee1ca9c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGameMode.java @@ -0,0 +1,72 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.WorldSettings; + +public class CommandGameMode extends CommandBase { + + + public String getCommandName() { + return "gamemode"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.gamemode.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length > 0) { + WorldSettings.GameType var3 = this.getGameModeFromCommand(p_71515_1_, p_71515_2_[0]); + EntityPlayerMP var4 = p_71515_2_.length >= 2 ? getPlayer(p_71515_1_, p_71515_2_[1]) : getCommandSenderAsPlayer(p_71515_1_); + var4.setGameType(var3); + var4.fallDistance = 0.0F; + ChatComponentTranslation var5 = new ChatComponentTranslation("gameMode." + var3.getName()); + + if (var4 != p_71515_1_) { + func_152374_a(p_71515_1_, this, 1, "commands.gamemode.success.other", var4.getCommandSenderName(), var5); + } else { + func_152374_a(p_71515_1_, this, 1, "commands.gamemode.success.self", var5); + } + } else { + throw new WrongUsageException("commands.gamemode.usage"); + } + } + + /** + * Gets the Game Mode specified in the command. + */ + protected WorldSettings.GameType getGameModeFromCommand(ICommandSender p_71539_1_, String p_71539_2_) { + return !p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.SURVIVAL.getName()) && !p_71539_2_.equalsIgnoreCase("s") ? (!p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.CREATIVE.getName()) && !p_71539_2_.equalsIgnoreCase("c") ? (!p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.ADVENTURE.getName()) && !p_71539_2_.equalsIgnoreCase("a") ? WorldSettings.getGameTypeById(parseIntBounded(p_71539_1_, p_71539_2_, 0, WorldSettings.GameType.values().length - 2)) : WorldSettings.GameType.ADVENTURE) : WorldSettings.GameType.CREATIVE) : WorldSettings.GameType.SURVIVAL; + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, "survival", "creative", "adventure"): (p_71516_2_.length == 2 ? getListOfStringsMatchingLastWord(p_71516_2_, this.getListOfPlayerUsernames()) : null); + } + + /** + * Returns String array containing all player usernames in the server. + */ + protected String[] getListOfPlayerUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGameRule.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGameRule.java new file mode 100644 index 0000000..8156c7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGameRule.java @@ -0,0 +1,71 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.GameRules; + +public class CommandGameRule extends CommandBase { + + + public String getCommandName() { + return "gamerule"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.gamerule.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + String var6; + + if (p_71515_2_.length == 2) { + var6 = p_71515_2_[0]; + String var7 = p_71515_2_[1]; + GameRules var8 = this.getGameRules(); + + if (var8.hasRule(var6)) { + var8.setOrCreateGameRule(var6, var7); + func_152373_a(p_71515_1_, this, "commands.gamerule.success"); + } else { + func_152373_a(p_71515_1_, this, "commands.gamerule.norule", var6); + } + } else if (p_71515_2_.length == 1) { + var6 = p_71515_2_[0]; + GameRules var4 = this.getGameRules(); + + if (var4.hasRule(var6)) { + String var5 = var4.getGameRuleStringValue(var6); + p_71515_1_.addChatMessage((new ChatComponentText(var6)).appendText(" = ").appendText(var5)); + } else { + func_152373_a(p_71515_1_, this, "commands.gamerule.norule", var6); + } + } else if (p_71515_2_.length == 0) { + GameRules var3 = this.getGameRules(); + p_71515_1_.addChatMessage(new ChatComponentText(joinNiceString(var3.getRules()))); + } else { + throw new WrongUsageException("commands.gamerule.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, this.getGameRules().getRules()) : (p_71516_2_.length == 2 ? getListOfStringsMatchingLastWord(p_71516_2_, "true", "false"): null); + } + + /** + * Return the game rule set this command should be able to manipulate. + */ + private GameRules getGameRules() { + return MinecraftServer.getServer().worldServerForDimension(0).getGameRules(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGive.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGive.java new file mode 100644 index 0000000..1c8bc86 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandGive.java @@ -0,0 +1,93 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; + +public class CommandGive extends CommandBase { + + + public String getCommandName() { + return "give"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.give.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException("commands.give.usage"); + } else { + EntityPlayerMP var3 = getPlayer(p_71515_1_, p_71515_2_[0]); + Item var4 = getItemByText(p_71515_1_, p_71515_2_[1]); + int var5 = 1; + int var6 = 0; + + if (p_71515_2_.length >= 3) { + var5 = parseIntBounded(p_71515_1_, p_71515_2_[2], 1, 64); + } + + if (p_71515_2_.length >= 4) { + var6 = parseInt(p_71515_1_, p_71515_2_[3]); + } + + ItemStack var7 = new ItemStack(var4, var5, var6); + + if (p_71515_2_.length >= 5) { + String var8 = func_147178_a(p_71515_1_, p_71515_2_, 4).getUnformattedText(); + + try { + NBTBase var9 = JsonToNBT.func_150315_a(var8); + + if (!(var9 instanceof NBTTagCompound)) { + func_152373_a(p_71515_1_, this, "commands.give.tagError", "Not a valid tag"); + return; + } + + var7.setTagCompound((NBTTagCompound)var9); + } catch (NBTException var10) { + func_152373_a(p_71515_1_, this, "commands.give.tagError", var10.getMessage()); + return; + } + } + + EntityItem var11 = var3.dropPlayerItemWithRandomChoice(var7, false); + var11.delayBeforeCanPickup = 0; + var11.func_145797_a(var3.getCommandSenderName()); + func_152373_a(p_71515_1_, this, "commands.give.success", var7.func_151000_E(), Integer.valueOf(var5), var3.getCommandSenderName()); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, this.getPlayers()) : (p_71516_2_.length == 2 ? getListOfStringsFromIterableMatchingLastWord(p_71516_2_, Item.itemRegistry.getKeys()) : null); + } + + protected String[] getPlayers() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandHandler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandHandler.java new file mode 100644 index 0000000..952e458 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandHandler.java @@ -0,0 +1,213 @@ +package net.minecraft.command; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CommandHandler implements ICommandManager { + private static final Logger logger = LogManager.getLogger(); + + /** Map of Strings to the ICommand objects they represent */ + private final Map commandMap = new HashMap(); + + /** The set of ICommand objects currently loaded. */ + private final Set commandSet = new HashSet(); + + + public int executeCommand(ICommandSender p_71556_1_, String p_71556_2_) { + p_71556_2_ = p_71556_2_.trim(); + + if (p_71556_2_.startsWith("/")) { + p_71556_2_ = p_71556_2_.substring(1); + } + + String[] var3 = p_71556_2_.split(" "); + String var4 = var3[0]; + var3 = dropFirstString(var3); + ICommand var5 = (ICommand)this.commandMap.get(var4); + int var6 = this.getUsernameIndex(var5, var3); + int var7 = 0; + ChatComponentTranslation var9; + + try { + if (var5 == null) { + throw new CommandNotFoundException(); + } + + if (var5.canCommandSenderUseCommand(p_71556_1_)) { + if (var6 > -1) { + EntityPlayerMP[] var8 = PlayerSelector.matchPlayers(p_71556_1_, var3[var6]); + String var22 = var3[var6]; + EntityPlayerMP[] var10 = var8; + int var11 = var8.length; + + for (int var12 = 0; var12 < var11; ++var12) { + EntityPlayerMP var13 = var10[var12]; + var3[var6] = var13.getCommandSenderName(); + + try { + var5.processCommand(p_71556_1_, var3); + ++var7; + } catch (CommandException var17) { + ChatComponentTranslation var15 = new ChatComponentTranslation(var17.getMessage(), var17.getErrorOjbects()); + var15.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(var15); + } + } + + var3[var6] = var22; + } else { + try { + var5.processCommand(p_71556_1_, var3); + ++var7; + } catch (CommandException var16) { + var9 = new ChatComponentTranslation(var16.getMessage(), var16.getErrorOjbects()); + var9.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(var9); + } + } + } else { + ChatComponentTranslation var21 = new ChatComponentTranslation("commands.generic.permission"); + var21.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(var21); + } + } catch (WrongUsageException var18) { + var9 = new ChatComponentTranslation("commands.generic.usage", new ChatComponentTranslation(var18.getMessage(), var18.getErrorOjbects())); + var9.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(var9); + } catch (CommandException var19) { + var9 = new ChatComponentTranslation(var19.getMessage(), var19.getErrorOjbects()); + var9.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(var9); + } catch (Throwable var20) { + var9 = new ChatComponentTranslation("commands.generic.exception"); + var9.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(var9); + logger.error("Couldn't process command: '" + p_71556_2_ + "'", var20); + } + + return var7; + } + + /** + * adds the command and any aliases it has to the internal map of available commands + */ + public ICommand registerCommand(ICommand p_71560_1_) { + List var2 = p_71560_1_.getCommandAliases(); + this.commandMap.put(p_71560_1_.getCommandName(), p_71560_1_); + this.commandSet.add(p_71560_1_); + + if (var2 != null) { + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + ICommand var5 = (ICommand)this.commandMap.get(var4); + + if (var5 == null || !var5.getCommandName().equals(var4)) { + this.commandMap.put(var4, p_71560_1_); + } + } + } + + return p_71560_1_; + } + + /** + * creates a new array and sets elements 0..n-2 to be 0..n-1 of the input (n elements) + */ + private static String[] dropFirstString(String[] p_71559_0_) { + String[] var1 = new String[p_71559_0_.length - 1]; + + for (int var2 = 1; var2 < p_71559_0_.length; ++var2) { + var1[var2 - 1] = p_71559_0_[var2]; + } + + return var1; + } + + /** + * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. + */ + public List getPossibleCommands(ICommandSender p_71558_1_, String p_71558_2_) { + String[] var3 = p_71558_2_.split(" ", -1); + String var4 = var3[0]; + + if (var3.length == 1) { + ArrayList var8 = new ArrayList(); + Iterator var6 = this.commandMap.entrySet().iterator(); + + while (var6.hasNext()) { + Entry var7 = (Entry)var6.next(); + + if (CommandBase.doesStringStartWith(var4, (String)var7.getKey()) && ((ICommand)var7.getValue()).canCommandSenderUseCommand(p_71558_1_)) { + var8.add(var7.getKey()); + } + } + + return var8; + } else { + if (var3.length > 1) { + ICommand var5 = (ICommand)this.commandMap.get(var4); + + if (var5 != null) { + return var5.addTabCompletionOptions(p_71558_1_, dropFirstString(var3)); + } + } + + return null; + } + } + + /** + * returns all commands that the commandSender can use + */ + public List getPossibleCommands(ICommandSender p_71557_1_) { + ArrayList var2 = new ArrayList(); + Iterator var3 = this.commandSet.iterator(); + + while (var3.hasNext()) { + ICommand var4 = (ICommand)var3.next(); + + if (var4.canCommandSenderUseCommand(p_71557_1_)) { + var2.add(var4); + } + } + + return var2; + } + + /** + * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. + */ + public Map getCommands() { + return this.commandMap; + } + + /** + * Return a command's first parameter index containing a valid username. + */ + private int getUsernameIndex(ICommand p_82370_1_, String[] p_82370_2_) { + if (p_82370_1_ == null) { + return -1; + } else { + for (int var3 = 0; var3 < p_82370_2_.length; ++var3) { + if (p_82370_1_.isUsernameIndex(p_82370_2_, var3) && PlayerSelector.matchesMultiplePlayers(p_82370_2_[var3])) { + return var3; + } + } + + return -1; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandHelp.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandHelp.java new file mode 100644 index 0000000..4142cdf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandHelp.java @@ -0,0 +1,91 @@ +package net.minecraft.command; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; + +public class CommandHelp extends CommandBase { + + + public String getCommandName() { + return "help"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.help.usage"; + } + + public List getCommandAliases() { + return Arrays.asList("?"); + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + List var3 = this.getSortedPossibleCommands(p_71515_1_); + byte var4 = 7; + int var5 = (var3.size() - 1) / var4; + boolean var6 = false; + int var13; + + try { + var13 = p_71515_2_.length == 0 ? 0 : parseIntBounded(p_71515_1_, p_71515_2_[0], 1, var5 + 1) - 1; + } catch (NumberInvalidException var12) { + Map var8 = this.getCommands(); + ICommand var9 = (ICommand)var8.get(p_71515_2_[0]); + + if (var9 != null) { + throw new WrongUsageException(var9.getCommandUsage(p_71515_1_)); + } + + if (MathHelper.parseIntWithDefault(p_71515_2_[0], -1) != -1) { + throw var12; + } + + throw new CommandNotFoundException(); + } + + int var7 = Math.min((var13 + 1) * var4, var3.size()); + ChatComponentTranslation var14 = new ChatComponentTranslation("commands.help.header", Integer.valueOf(var13 + 1), Integer.valueOf(var5 + 1)); + var14.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_71515_1_.addChatMessage(var14); + + for (int var15 = var13 * var4; var15 < var7; ++var15) { + ICommand var10 = (ICommand)var3.get(var15); + ChatComponentTranslation var11 = new ChatComponentTranslation(var10.getCommandUsage(p_71515_1_)); + var11.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + var10.getCommandName() + " ")); + p_71515_1_.addChatMessage(var11); + } + + if (var13 == 0 && p_71515_1_ instanceof EntityPlayer) { + ChatComponentTranslation var16 = new ChatComponentTranslation("commands.help.footer"); + var16.getChatStyle().setColor(EnumChatFormatting.GREEN); + p_71515_1_.addChatMessage(var16); + } + } + + /** + * Returns a sorted list of all possible commands for the given ICommandSender. + */ + protected List getSortedPossibleCommands(ICommandSender p_71534_1_) { + List var2 = MinecraftServer.getServer().getCommandManager().getPossibleCommands(p_71534_1_); + Collections.sort(var2); + return var2; + } + + protected Map getCommands() { + return MinecraftServer.getServer().getCommandManager().getCommands(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandKill.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandKill.java new file mode 100644 index 0000000..d884e88 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandKill.java @@ -0,0 +1,30 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; + +public class CommandKill extends CommandBase { + + + public String getCommandName() { + return "kill"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.kill.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + EntityPlayerMP var3 = getCommandSenderAsPlayer(p_71515_1_); + var3.attackEntityFrom(DamageSource.outOfWorld, Float.MAX_VALUE); + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.kill.success")); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandNotFoundException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandNotFoundException.java new file mode 100644 index 0000000..c978898 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandNotFoundException.java @@ -0,0 +1,13 @@ +package net.minecraft.command; + +public class CommandNotFoundException extends CommandException { + + + public CommandNotFoundException() { + this("commands.generic.notFound"); + } + + public CommandNotFoundException(String p_i1363_1_, Object ... p_i1363_2_) { + super(p_i1363_1_, p_i1363_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandPlaySound.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandPlaySound.java new file mode 100644 index 0000000..9cc8468 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandPlaySound.java @@ -0,0 +1,100 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S29PacketSoundEffect; + +public class CommandPlaySound extends CommandBase { + + + public String getCommandName() { + return "playsound"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.playsound.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException(this.getCommandUsage(p_71515_1_)); + } else { + byte var3 = 0; + int var36 = var3 + 1; + String var4 = p_71515_2_[var3]; + EntityPlayerMP var5 = getPlayer(p_71515_1_, p_71515_2_[var36++]); + double var6 = var5.getPlayerCoordinates().posX; + double var8 = var5.getPlayerCoordinates().posY; + double var10 = var5.getPlayerCoordinates().posZ; + double var12 = 1.0D; + double var14 = 1.0D; + double var16 = 0.0D; + + if (p_71515_2_.length > var36) { + var6 = func_110666_a(p_71515_1_, var6, p_71515_2_[var36++]); + } + + if (p_71515_2_.length > var36) { + var8 = func_110665_a(p_71515_1_, var8, p_71515_2_[var36++], 0, 0); + } + + if (p_71515_2_.length > var36) { + var10 = func_110666_a(p_71515_1_, var10, p_71515_2_[var36++]); + } + + if (p_71515_2_.length > var36) { + var12 = parseDoubleBounded(p_71515_1_, p_71515_2_[var36++], 0.0D, 3.4028234663852886E38D); + } + + if (p_71515_2_.length > var36) { + var14 = parseDoubleBounded(p_71515_1_, p_71515_2_[var36++], 0.0D, 2.0D); + } + + if (p_71515_2_.length > var36) { + var16 = parseDoubleBounded(p_71515_1_, p_71515_2_[var36++], 0.0D, 1.0D); + } + + double var18 = var12 > 1.0D ? var12 * 16.0D : 16.0D; + double var20 = var5.getDistance(var6, var8, var10); + + if (var20 > var18) { + if (var16 <= 0.0D) { + throw new CommandException("commands.playsound.playerTooFar", var5.getCommandSenderName()); + } + + double var22 = var6 - var5.posX; + double var24 = var8 - var5.posY; + double var26 = var10 - var5.posZ; + double var28 = Math.sqrt(var22 * var22 + var24 * var24 + var26 * var26); + double var30 = var5.posX; + double var32 = var5.posY; + double var34 = var5.posZ; + + if (var28 > 0.0D) { + var30 += var22 / var28 * 2.0D; + var32 += var24 / var28 * 2.0D; + var34 += var26 / var28 * 2.0D; + } + + var5.playerNetServerHandler.sendPacket(new S29PacketSoundEffect(var4, var30, var32, var34, (float)var16, (float)var14)); + } else { + var5.playerNetServerHandler.sendPacket(new S29PacketSoundEffect(var4, var6, var8, var10, (float)var12, (float)var14)); + } + + func_152373_a(p_71515_1_, this, "commands.playsound.success", var4, var5.getCommandSenderName()); + } + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandServerKick.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandServerKick.java new file mode 100644 index 0000000..81b88fe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandServerKick.java @@ -0,0 +1,58 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +public class CommandServerKick extends CommandBase { + + + public String getCommandName() { + return "kick"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.kick.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length > 0 && p_71515_2_[0].length() > 1) { + EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().func_152612_a(p_71515_2_[0]); + String var4 = "Kicked by an operator."; + boolean var5 = false; + + if (var3 == null) { + throw new PlayerNotFoundException(); + } else { + if (p_71515_2_.length >= 2) { + var4 = func_147178_a(p_71515_1_, p_71515_2_, 1).getUnformattedText(); + var5 = true; + } + + var3.playerNetServerHandler.kickPlayerFromServer(var4); + + if (var5) { + func_152373_a(p_71515_1_, this, "commands.kick.success.reason", var3.getCommandSenderName(), var4); + } else { + func_152373_a(p_71515_1_, this, "commands.kick.success", var3.getCommandSenderName()); + } + } + } else { + throw new WrongUsageException("commands.kick.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length >= 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java new file mode 100644 index 0000000..54a75ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java @@ -0,0 +1,32 @@ +package net.minecraft.command; + +import net.minecraft.server.MinecraftServer; + +public class CommandSetPlayerTimeout extends CommandBase { + + + public String getCommandName() { + return "setidletimeout"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.setidletimeout.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length == 1) { + int var3 = parseIntWithMin(p_71515_1_, p_71515_2_[0], 0); + MinecraftServer.getServer().func_143006_e(var3); + func_152373_a(p_71515_1_, this, "commands.setidletimeout.success", Integer.valueOf(var3)); + } else { + throw new WrongUsageException("commands.setidletimeout.usage"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java new file mode 100644 index 0000000..59d38a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java @@ -0,0 +1,64 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChunkCoordinates; + +public class CommandSetSpawnpoint extends CommandBase { + + + public String getCommandName() { + return "spawnpoint"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.spawnpoint.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + EntityPlayerMP var3 = p_71515_2_.length == 0 ? getCommandSenderAsPlayer(p_71515_1_) : getPlayer(p_71515_1_, p_71515_2_[0]); + + if (p_71515_2_.length == 4) { + if (var3.worldObj != null) { + byte var4 = 1; + int var5 = 30000000; + int var9 = var4 + 1; + int var6 = parseIntBounded(p_71515_1_, p_71515_2_[var4], -var5, var5); + int var7 = parseIntBounded(p_71515_1_, p_71515_2_[var9++], 0, 256); + int var8 = parseIntBounded(p_71515_1_, p_71515_2_[var9++], -var5, var5); + var3.setSpawnChunk(new ChunkCoordinates(var6, var7, var8), true); + func_152373_a(p_71515_1_, this, "commands.spawnpoint.success", var3.getCommandSenderName(), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8)); + } + } else { + if (p_71515_2_.length > 1) { + throw new WrongUsageException("commands.spawnpoint.usage"); + } + + ChunkCoordinates var10 = var3.getPlayerCoordinates(); + var3.setSpawnChunk(var10, true); + func_152373_a(p_71515_1_, this, "commands.spawnpoint.success", var3.getCommandSenderName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length != 1 && p_71516_2_.length != 2 ? null : getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandShowSeed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandShowSeed.java new file mode 100644 index 0000000..54828d9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandShowSeed.java @@ -0,0 +1,37 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; + +public class CommandShowSeed extends CommandBase { + + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { + return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(p_71519_1_); + } + + public String getCommandName() { + return "seed"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.seed.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + Object var3 = p_71515_1_ instanceof EntityPlayer ? ((EntityPlayer)p_71515_1_).worldObj : MinecraftServer.getServer().worldServerForDimension(0); + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.seed.success", Long.valueOf(((World)var3).getSeed()))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSpreadPlayers.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSpreadPlayers.java new file mode 100644 index 0000000..ab63a37 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandSpreadPlayers.java @@ -0,0 +1,329 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class CommandSpreadPlayers extends CommandBase { + + + public String getCommandName() { + return "spreadplayers"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.spreadplayers.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 6) { + throw new WrongUsageException("commands.spreadplayers.usage"); + } else { + byte var3 = 0; + int var16 = var3 + 1; + double var4 = func_110666_a(p_71515_1_, Double.NaN, p_71515_2_[var3]); + double var6 = func_110666_a(p_71515_1_, Double.NaN, p_71515_2_[var16++]); + double var8 = parseDoubleWithMin(p_71515_1_, p_71515_2_[var16++], 0.0D); + double var10 = parseDoubleWithMin(p_71515_1_, p_71515_2_[var16++], var8 + 1.0D); + boolean var12 = parseBoolean(p_71515_1_, p_71515_2_[var16++]); + ArrayList var13 = Lists.newArrayList(); + + while (true) { + while (var16 < p_71515_2_.length) { + String var14 = p_71515_2_[var16++]; + + if (PlayerSelector.hasArguments(var14)) { + EntityPlayerMP[] var17 = PlayerSelector.matchPlayers(p_71515_1_, var14); + + if (var17 == null || var17.length == 0) { + throw new PlayerNotFoundException(); + } + + Collections.addAll(var13, var17); + } else { + EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().func_152612_a(var14); + + if (var15 == null) { + throw new PlayerNotFoundException(); + } + + var13.add(var15); + } + } + + if (var13.isEmpty()) { + throw new PlayerNotFoundException(); + } + + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.spreadplayers.spreading." + (var12 ? "teams" : "players"), Integer.valueOf(var13.size()), Double.valueOf(var10), Double.valueOf(var4), Double.valueOf(var6), Double.valueOf(var8))); + this.func_110669_a(p_71515_1_, var13, new CommandSpreadPlayers.Position(var4, var6), var8, var10, ((EntityLivingBase)var13.get(0)).worldObj, var12); + return; + } + } + } + + private void func_110669_a(ICommandSender p_110669_1_, List p_110669_2_, CommandSpreadPlayers.Position p_110669_3_, double p_110669_4_, double p_110669_6_, World p_110669_8_, boolean p_110669_9_) { + Random var10 = new Random(); + double var11 = p_110669_3_.field_111101_a - p_110669_6_; + double var13 = p_110669_3_.field_111100_b - p_110669_6_; + double var15 = p_110669_3_.field_111101_a + p_110669_6_; + double var17 = p_110669_3_.field_111100_b + p_110669_6_; + CommandSpreadPlayers.Position[] var19 = this.func_110670_a(var10, p_110669_9_ ? this.func_110667_a(p_110669_2_) : p_110669_2_.size(), var11, var13, var15, var17); + int var20 = this.func_110668_a(p_110669_3_, p_110669_4_, p_110669_8_, var10, var11, var13, var15, var17, var19, p_110669_9_); + double var21 = this.func_110671_a(p_110669_2_, p_110669_8_, var19, p_110669_9_); + func_152373_a(p_110669_1_, this, "commands.spreadplayers.success." + (p_110669_9_ ? "teams" : "players"), Integer.valueOf(var19.length), Double.valueOf(p_110669_3_.field_111101_a), Double.valueOf(p_110669_3_.field_111100_b)); + + if (var19.length > 1) { + p_110669_1_.addChatMessage(new ChatComponentTranslation("commands.spreadplayers.info." + (p_110669_9_ ? "teams" : "players"), String.format("%.2f", Double.valueOf(var21)), Integer.valueOf(var20))); + } + } + + private int func_110667_a(List p_110667_1_) { + HashSet var2 = Sets.newHashSet(); + Iterator var3 = p_110667_1_.iterator(); + + while (var3.hasNext()) { + EntityLivingBase var4 = (EntityLivingBase)var3.next(); + + if (var4 instanceof EntityPlayer) { + var2.add(var4.getTeam()); + } else { + var2.add(null); + } + } + + return var2.size(); + } + + private int func_110668_a(CommandSpreadPlayers.Position p_110668_1_, double p_110668_2_, World p_110668_4_, Random p_110668_5_, double p_110668_6_, double p_110668_8_, double p_110668_10_, double p_110668_12_, CommandSpreadPlayers.Position[] p_110668_14_, boolean p_110668_15_) { + boolean var16 = true; + double var18 = 3.4028234663852886E38D; + int var17; + + for (var17 = 0; var17 < 10000 && var16; ++var17) { + var16 = false; + var18 = 3.4028234663852886E38D; + int var22; + CommandSpreadPlayers.Position var23; + + for (int var20 = 0; var20 < p_110668_14_.length; ++var20) { + CommandSpreadPlayers.Position var21 = p_110668_14_[var20]; + var22 = 0; + var23 = new CommandSpreadPlayers.Position(); + + for (int var24 = 0; var24 < p_110668_14_.length; ++var24) { + if (var20 != var24) { + CommandSpreadPlayers.Position var25 = p_110668_14_[var24]; + double var26 = var21.func_111099_a(var25); + var18 = Math.min(var26, var18); + + if (var26 < p_110668_2_) { + ++var22; + var23.field_111101_a += var25.field_111101_a - var21.field_111101_a; + var23.field_111100_b += var25.field_111100_b - var21.field_111100_b; + } + } + } + + if (var22 > 0) { + var23.field_111101_a /= var22; + var23.field_111100_b /= var22; + double var30 = var23.func_111096_b(); + + if (var30 > 0.0D) { + var23.func_111095_a(); + var21.func_111094_b(var23); + } else { + var21.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_); + } + + var16 = true; + } + + if (var21.func_111093_a(p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_)) { + var16 = true; + } + } + + if (!var16) { + CommandSpreadPlayers.Position[] var28 = p_110668_14_; + int var29 = p_110668_14_.length; + + for (var22 = 0; var22 < var29; ++var22) { + var23 = var28[var22]; + + if (!var23.func_111098_b(p_110668_4_)) { + var23.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_); + var16 = true; + } + } + } + } + + if (var17 >= 10000) { + throw new CommandException("commands.spreadplayers.failure." + (p_110668_15_ ? "teams" : "players"), Integer.valueOf(p_110668_14_.length), Double.valueOf(p_110668_1_.field_111101_a), Double.valueOf(p_110668_1_.field_111100_b), String.format("%.2f", Double.valueOf(var18))); + } else { + return var17; + } + } + + private double func_110671_a(List p_110671_1_, World p_110671_2_, CommandSpreadPlayers.Position[] p_110671_3_, boolean p_110671_4_) { + double var5 = 0.0D; + int var7 = 0; + HashMap var8 = Maps.newHashMap(); + + for (int var9 = 0; var9 < p_110671_1_.size(); ++var9) { + EntityLivingBase var10 = (EntityLivingBase)p_110671_1_.get(var9); + CommandSpreadPlayers.Position var11; + + if (p_110671_4_) { + Team var12 = var10 instanceof EntityPlayer ? var10.getTeam() : null; + + if (!var8.containsKey(var12)) { + var8.put(var12, p_110671_3_[var7++]); + } + + var11 = (CommandSpreadPlayers.Position)var8.get(var12); + } else { + var11 = p_110671_3_[var7++]; + } + + var10.setPositionAndUpdate((float)MathHelper.floor_double(var11.field_111101_a) + 0.5F, var11.func_111092_a(p_110671_2_), (double)MathHelper.floor_double(var11.field_111100_b) + 0.5D); + double var17 = Double.MAX_VALUE; + + for (int var14 = 0; var14 < p_110671_3_.length; ++var14) { + if (var11 != p_110671_3_[var14]) { + double var15 = var11.func_111099_a(p_110671_3_[var14]); + var17 = Math.min(var15, var17); + } + } + + var5 += var17; + } + + var5 /= p_110671_1_.size(); + return var5; + } + + private CommandSpreadPlayers.Position[] func_110670_a(Random p_110670_1_, int p_110670_2_, double p_110670_3_, double p_110670_5_, double p_110670_7_, double p_110670_9_) { + CommandSpreadPlayers.Position[] var11 = new CommandSpreadPlayers.Position[p_110670_2_]; + + for (int var12 = 0; var12 < var11.length; ++var12) { + CommandSpreadPlayers.Position var13 = new CommandSpreadPlayers.Position(); + var13.func_111097_a(p_110670_1_, p_110670_3_, p_110670_5_, p_110670_7_, p_110670_9_); + var11[var12] = var13; + } + + return var11; + } + + static class Position { + double field_111101_a; + double field_111100_b; + + + Position() {} + + Position(double p_i1358_1_, double p_i1358_3_) { + this.field_111101_a = p_i1358_1_; + this.field_111100_b = p_i1358_3_; + } + + double func_111099_a(CommandSpreadPlayers.Position p_111099_1_) { + double var2 = this.field_111101_a - p_111099_1_.field_111101_a; + double var4 = this.field_111100_b - p_111099_1_.field_111100_b; + return Math.sqrt(var2 * var2 + var4 * var4); + } + + void func_111095_a() { + double var1 = this.func_111096_b(); + this.field_111101_a /= var1; + this.field_111100_b /= var1; + } + + float func_111096_b() { + return MathHelper.sqrt_double(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b); + } + + public void func_111094_b(CommandSpreadPlayers.Position p_111094_1_) { + this.field_111101_a -= p_111094_1_.field_111101_a; + this.field_111100_b -= p_111094_1_.field_111100_b; + } + + public boolean func_111093_a(double p_111093_1_, double p_111093_3_, double p_111093_5_, double p_111093_7_) { + boolean var9 = false; + + if (this.field_111101_a < p_111093_1_) { + this.field_111101_a = p_111093_1_; + var9 = true; + } else if (this.field_111101_a > p_111093_5_) { + this.field_111101_a = p_111093_5_; + var9 = true; + } + + if (this.field_111100_b < p_111093_3_) { + this.field_111100_b = p_111093_3_; + var9 = true; + } else if (this.field_111100_b > p_111093_7_) { + this.field_111100_b = p_111093_7_; + var9 = true; + } + + return var9; + } + + public int func_111092_a(World p_111092_1_) { + int var2 = MathHelper.floor_double(this.field_111101_a); + int var3 = MathHelper.floor_double(this.field_111100_b); + + for (int var4 = 256; var4 > 0; --var4) { + if (p_111092_1_.getBlock(var2, var4, var3).getMaterial() != Material.air) { + return var4 + 1; + } + } + + return 257; + } + + public boolean func_111098_b(World p_111098_1_) { + int var2 = MathHelper.floor_double(this.field_111101_a); + int var3 = MathHelper.floor_double(this.field_111100_b); + short var4 = 256; + + if (var4 <= 0) { + return false; + } else { + Material var5 = p_111098_1_.getBlock(var2, var4, var3).getMaterial(); + return !var5.isLiquid() && var5 != Material.fire; + } + } + + public void func_111097_a(Random p_111097_1_, double p_111097_2_, double p_111097_4_, double p_111097_6_, double p_111097_8_) { + this.field_111101_a = MathHelper.getRandomDoubleInRange(p_111097_1_, p_111097_2_, p_111097_6_); + this.field_111100_b = MathHelper.getRandomDoubleInRange(p_111097_1_, p_111097_4_, p_111097_8_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandTime.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandTime.java new file mode 100644 index 0000000..7ba9f35 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandTime.java @@ -0,0 +1,79 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandTime extends CommandBase { + + + public String getCommandName() { + return "time"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.time.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length > 1) { + int var3; + + if (p_71515_2_[0].equals("set")) { + if (p_71515_2_[1].equals("day")) { + var3 = 1000; + } else if (p_71515_2_[1].equals("night")) { + var3 = 13000; + } else { + var3 = parseIntWithMin(p_71515_1_, p_71515_2_[1], 0); + } + + this.setTime(p_71515_1_, var3); + func_152373_a(p_71515_1_, this, "commands.time.set", Integer.valueOf(var3)); + return; + } + + if (p_71515_2_[0].equals("add")) { + var3 = parseIntWithMin(p_71515_1_, p_71515_2_[1], 0); + this.addTime(p_71515_1_, var3); + func_152373_a(p_71515_1_, this, "commands.time.added", Integer.valueOf(var3)); + return; + } + } + + throw new WrongUsageException("commands.time.usage"); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, "set", "add"): (p_71516_2_.length == 2 && p_71516_2_[0].equals("set") ? getListOfStringsMatchingLastWord(p_71516_2_, "day", "night"): null); + } + + /** + * Set the time in the server object. + */ + protected void setTime(ICommandSender p_71552_1_, int p_71552_2_) { + for (int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { + MinecraftServer.getServer().worldServers[var3].setWorldTime(p_71552_2_); + } + } + + /** + * Adds (or removes) time in the server object. + */ + protected void addTime(ICommandSender p_71553_1_, int p_71553_2_) { + for (int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { + WorldServer var4 = MinecraftServer.getServer().worldServers[var3]; + var4.setWorldTime(var4.getWorldTime() + (long)p_71553_2_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandToggleDownfall.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandToggleDownfall.java new file mode 100644 index 0000000..571de6d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandToggleDownfall.java @@ -0,0 +1,36 @@ +package net.minecraft.command; + +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.storage.WorldInfo; + +public class CommandToggleDownfall extends CommandBase { + + + public String getCommandName() { + return "toggledownfall"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.downfall.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + this.toggleDownfall(); + func_152373_a(p_71515_1_, this, "commands.downfall.success"); + } + + /** + * Toggle rain and enable thundering. + */ + protected void toggleDownfall() { + WorldInfo var1 = MinecraftServer.getServer().worldServers[0].getWorldInfo(); + var1.setRaining(!var1.isRaining()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandWeather.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandWeather.java new file mode 100644 index 0000000..83dbaf0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandWeather.java @@ -0,0 +1,71 @@ +package net.minecraft.command; + +import java.util.List; +import java.util.Random; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.WorldInfo; + +public class CommandWeather extends CommandBase { + + + public String getCommandName() { + return "weather"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.weather.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 1 && p_71515_2_.length <= 2) { + int var3 = (300 + (new Random()).nextInt(600)) * 20; + + if (p_71515_2_.length >= 2) { + var3 = parseIntBounded(p_71515_1_, p_71515_2_[1], 1, 1000000) * 20; + } + + WorldServer var4 = MinecraftServer.getServer().worldServers[0]; + WorldInfo var5 = var4.getWorldInfo(); + + if ("clear".equalsIgnoreCase(p_71515_2_[0])) { + var5.setRainTime(0); + var5.setThunderTime(0); + var5.setRaining(false); + var5.setThundering(false); + func_152373_a(p_71515_1_, this, "commands.weather.clear"); + } else if ("rain".equalsIgnoreCase(p_71515_2_[0])) { + var5.setRainTime(var3); + var5.setRaining(true); + var5.setThundering(false); + func_152373_a(p_71515_1_, this, "commands.weather.rain"); + } else { + if (!"thunder".equalsIgnoreCase(p_71515_2_[0])) { + throw new WrongUsageException("commands.weather.usage"); + } + + var5.setRainTime(var3); + var5.setThunderTime(var3); + var5.setRaining(true); + var5.setThundering(true); + func_152373_a(p_71515_1_, this, "commands.weather.thunder"); + } + } else { + throw new WrongUsageException("commands.weather.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, "clear", "rain", "thunder"): null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandXP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandXP.java new file mode 100644 index 0000000..ec221a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/CommandXP.java @@ -0,0 +1,87 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +public class CommandXP extends CommandBase { + + + public String getCommandName() { + return "xp"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.xp.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length <= 0) { + throw new WrongUsageException("commands.xp.usage"); + } else { + String var4 = p_71515_2_[0]; + boolean var5 = var4.endsWith("l") || var4.endsWith("L"); + + if (var5 && var4.length() > 1) { + var4 = var4.substring(0, var4.length() - 1); + } + + int var6 = parseInt(p_71515_1_, var4); + boolean var7 = var6 < 0; + + if (var7) { + var6 *= -1; + } + + EntityPlayerMP var3; + + if (p_71515_2_.length > 1) { + var3 = getPlayer(p_71515_1_, p_71515_2_[1]); + } else { + var3 = getCommandSenderAsPlayer(p_71515_1_); + } + + if (var5) { + if (var7) { + var3.addExperienceLevel(-var6); + func_152373_a(p_71515_1_, this, "commands.xp.success.negative.levels", Integer.valueOf(var6), var3.getCommandSenderName()); + } else { + var3.addExperienceLevel(var6); + func_152373_a(p_71515_1_, this, "commands.xp.success.levels", Integer.valueOf(var6), var3.getCommandSenderName()); + } + } else { + if (var7) { + throw new WrongUsageException("commands.xp.failure.widthdrawXp"); + } + + var3.addExperience(var6); + func_152373_a(p_71515_1_, this, "commands.xp.success", Integer.valueOf(var6), var3.getCommandSenderName()); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 2 ? getListOfStringsMatchingLastWord(p_71516_2_, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/IAdminCommand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/IAdminCommand.java new file mode 100644 index 0000000..1968dcb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/IAdminCommand.java @@ -0,0 +1,5 @@ +package net.minecraft.command; + +public interface IAdminCommand { + void func_152372_a(ICommandSender var1, ICommand var2, int var3, String var4, Object ... var5); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommand.java new file mode 100644 index 0000000..1707bc0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommand.java @@ -0,0 +1,28 @@ +package net.minecraft.command; + +import java.util.List; + +public interface ICommand extends Comparable { + String getCommandName(); + + String getCommandUsage(ICommandSender p_71518_1_); + + List getCommandAliases(); + + void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_); + + /** + * Returns true if the given command sender is allowed to use this command. + */ + boolean canCommandSenderUseCommand(ICommandSender p_71519_1_); + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_); + + /** + * Return whether the specified command parameter index is a username parameter. + */ + boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommandManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommandManager.java new file mode 100644 index 0000000..530fe5c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommandManager.java @@ -0,0 +1,23 @@ +package net.minecraft.command; + +import java.util.List; +import java.util.Map; + +public interface ICommandManager { + int executeCommand(ICommandSender p_71556_1_, String p_71556_2_); + + /** + * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. + */ + List getPossibleCommands(ICommandSender p_71558_1_, String p_71558_2_); + + /** + * returns all commands that the commandSender can use + */ + List getPossibleCommands(ICommandSender p_71557_1_); + + /** + * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. + */ + Map getCommands(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommandSender.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommandSender.java new file mode 100644 index 0000000..21edf6f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ICommandSender.java @@ -0,0 +1,34 @@ +package net.minecraft.command; + +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public interface ICommandSender { + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + String getCommandSenderName(); + + IChatComponent func_145748_c_(); + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + void addChatMessage(IChatComponent p_145747_1_); + + /** + * Returns true if the command sender is allowed to use the given command. + */ + boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_); + + /** + * Return the position for this command sender. + */ + ChunkCoordinates getPlayerCoordinates(); + + World getEntityWorld(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/IEntitySelector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/IEntitySelector.java new file mode 100644 index 0000000..4b85221 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/IEntitySelector.java @@ -0,0 +1,54 @@ +package net.minecraft.command; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +public interface IEntitySelector { + IEntitySelector selectAnything = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_.isEntityAlive(); + } + }; + IEntitySelector field_152785_b = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_.isEntityAlive() && p_82704_1_.riddenByEntity == null && p_82704_1_.ridingEntity == null; + } + }; + IEntitySelector selectInventories = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_ instanceof IInventory && p_82704_1_.isEntityAlive(); + } + }; + + /** + * Return whether the specified entity is applicable to this filter. + */ + boolean isEntityApplicable(Entity p_82704_1_); + + class ArmoredMob implements IEntitySelector { + private final ItemStack field_96567_c; + + + public ArmoredMob(ItemStack p_i1584_1_) { + this.field_96567_c = p_i1584_1_; + } + + public boolean isEntityApplicable(Entity p_82704_1_) { + if (!p_82704_1_.isEntityAlive()) { + return false; + } else if (!(p_82704_1_ instanceof EntityLivingBase)) { + return false; + } else { + EntityLivingBase var2 = (EntityLivingBase)p_82704_1_; + return var2.getEquipmentInSlot(EntityLiving.getArmorPosition(this.field_96567_c)) == null && (var2 instanceof EntityLiving ? ((EntityLiving) var2).canPickUpLoot() : var2 instanceof EntityPlayer); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/NumberInvalidException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/NumberInvalidException.java new file mode 100644 index 0000000..8eb3e91 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/NumberInvalidException.java @@ -0,0 +1,13 @@ +package net.minecraft.command; + +public class NumberInvalidException extends CommandException { + + + public NumberInvalidException() { + this("commands.generic.num.invalid"); + } + + public NumberInvalidException(String p_i1360_1_, Object ... p_i1360_2_) { + super(p_i1360_1_, p_i1360_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/PlayerNotFoundException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/PlayerNotFoundException.java new file mode 100644 index 0000000..6e4f7c4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/PlayerNotFoundException.java @@ -0,0 +1,13 @@ +package net.minecraft.command; + +public class PlayerNotFoundException extends CommandException { + + + public PlayerNotFoundException() { + this("commands.generic.player.notFound"); + } + + public PlayerNotFoundException(String p_i1362_1_, Object ... p_i1362_2_) { + super(p_i1362_1_, p_i1362_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/PlayerSelector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/PlayerSelector.java new file mode 100644 index 0000000..b749723 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/PlayerSelector.java @@ -0,0 +1,292 @@ +package net.minecraft.command; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; + +public class PlayerSelector { + /** + * This matches the at-tokens introduced for command blocks, including their arguments, if any. + */ + private static final Pattern tokenPattern = Pattern.compile("^@([parf])(?:\\[([\\w=,!-]*)\\])?$"); + + /** + * This matches things like "-1,,4", and is used for getting x,y,z,range from the token's argument list. + */ + private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); + + /** + * This matches things like "rm=4,c=2" and is used for handling named token arguments. + */ + private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); + + + /** + * Returns the one player that matches the given at-token. Returns null if more than one player matches. + */ + public static EntityPlayerMP matchOnePlayer(ICommandSender p_82386_0_, String p_82386_1_) { + EntityPlayerMP[] var2 = matchPlayers(p_82386_0_, p_82386_1_); + return var2 != null && var2.length == 1 ? var2[0] : null; + } + + public static IChatComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) { + EntityPlayerMP[] var2 = matchPlayers(p_150869_0_, p_150869_1_); + + if (var2 != null && var2.length != 0) { + IChatComponent[] var3 = new IChatComponent[var2.length]; + + for (int var4 = 0; var4 < var3.length; ++var4) { + var3[var4] = var2[var4].func_145748_c_(); + } + + return CommandBase.joinNiceString(var3); + } else { + return null; + } + } + + /** + * Returns an array of all players matched by the given at-token. + */ + public static EntityPlayerMP[] matchPlayers(ICommandSender p_82380_0_, String p_82380_1_) { + Matcher var2 = tokenPattern.matcher(p_82380_1_); + + if (var2.matches()) { + Map var3 = getArgumentMap(var2.group(2)); + String var4 = var2.group(1); + int var5 = getDefaultMinimumRange(var4); + int var6 = getDefaultMaximumRange(var4); + int var7 = getDefaultMinimumLevel(var4); + int var8 = getDefaultMaximumLevel(var4); + int var9 = getDefaultCount(var4); + int var10 = WorldSettings.GameType.NOT_SET.getID(); + ChunkCoordinates var11 = p_82380_0_.getPlayerCoordinates(); + Map var12 = func_96560_a(var3); + String var13 = null; + String var14 = null; + boolean var15 = false; + + if (var3.containsKey("rm")) { + var5 = MathHelper.parseIntWithDefault((String)var3.get("rm"), var5); + var15 = true; + } + + if (var3.containsKey("r")) { + var6 = MathHelper.parseIntWithDefault((String)var3.get("r"), var6); + var15 = true; + } + + if (var3.containsKey("lm")) { + var7 = MathHelper.parseIntWithDefault((String)var3.get("lm"), var7); + } + + if (var3.containsKey("l")) { + var8 = MathHelper.parseIntWithDefault((String)var3.get("l"), var8); + } + + if (var3.containsKey("x")) { + var11.posX = MathHelper.parseIntWithDefault((String)var3.get("x"), var11.posX); + var15 = true; + } + + if (var3.containsKey("y")) { + var11.posY = MathHelper.parseIntWithDefault((String)var3.get("y"), var11.posY); + var15 = true; + } + + if (var3.containsKey("z")) { + var11.posZ = MathHelper.parseIntWithDefault((String)var3.get("z"), var11.posZ); + var15 = true; + } + + if (var3.containsKey("m")) { + var10 = MathHelper.parseIntWithDefault((String)var3.get("m"), var10); + } + + if (var3.containsKey("c")) { + var9 = MathHelper.parseIntWithDefault((String)var3.get("c"), var9); + } + + if (var3.containsKey("team")) { + var14 = (String)var3.get("team"); + } + + if (var3.containsKey("name")) { + var13 = (String)var3.get("name"); + } + + World var16 = var15 ? p_82380_0_.getEntityWorld() : null; + List var17; + + if (!var4.equals("p") && !var4.equals("a")) { + if (var4.equals("r")) { + var17 = MinecraftServer.getServer().getConfigurationManager().findPlayers(var11, var5, var6, 0, var10, var7, var8, var12, var13, var14, var16); + Collections.shuffle(var17); + var17 = var17.subList(0, Math.min(var9, var17.size())); + return var17.isEmpty() ? new EntityPlayerMP[0] : (EntityPlayerMP[])var17.toArray(new EntityPlayerMP[var17.size()]); + } else { + return null; + } + } else { + var17 = MinecraftServer.getServer().getConfigurationManager().findPlayers(var11, var5, var6, var9, var10, var7, var8, var12, var13, var14, var16); + return var17.isEmpty() ? new EntityPlayerMP[0] : (EntityPlayerMP[])var17.toArray(new EntityPlayerMP[var17.size()]); + } + } else { + return null; + } + } + + public static Map func_96560_a(Map p_96560_0_) { + HashMap var1 = new HashMap(); + Iterator var2 = p_96560_0_.keySet().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + + if (var3.startsWith("score_") && var3.length() > "score_".length()) { + String var4 = var3.substring("score_".length()); + var1.put(var4, Integer.valueOf(MathHelper.parseIntWithDefault((String)p_96560_0_.get(var3), 1))); + } + } + + return var1; + } + + /** + * Returns whether the given pattern can match more than one player. + */ + public static boolean matchesMultiplePlayers(String p_82377_0_) { + Matcher var1 = tokenPattern.matcher(p_82377_0_); + + if (var1.matches()) { + Map var2 = getArgumentMap(var1.group(2)); + String var3 = var1.group(1); + int var4 = getDefaultCount(var3); + + if (var2.containsKey("c")) { + var4 = MathHelper.parseIntWithDefault((String)var2.get("c"), var4); + } + + return var4 != 1; + } else { + return false; + } + } + + /** + * Returns whether the given token (parameter 1) has exactly the given arguments (parameter 2). + */ + public static boolean hasTheseArguments(String p_82383_0_, String p_82383_1_) { + Matcher var2 = tokenPattern.matcher(p_82383_0_); + + if (var2.matches()) { + String var3 = var2.group(1); + return p_82383_1_ == null || p_82383_1_.equals(var3); + } else { + return false; + } + } + + /** + * Returns whether the given token has any arguments set. + */ + public static boolean hasArguments(String p_82378_0_) { + return hasTheseArguments(p_82378_0_, null); + } + + /** + * Gets the default minimum range (argument rm). + */ + private static final int getDefaultMinimumRange(String p_82384_0_) { + return 0; + } + + /** + * Gets the default maximum range (argument r). + */ + private static final int getDefaultMaximumRange(String p_82379_0_) { + return 0; + } + + /** + * Gets the default maximum experience level (argument l) + */ + private static final int getDefaultMaximumLevel(String p_82376_0_) { + return Integer.MAX_VALUE; + } + + /** + * Gets the default minimum experience level (argument lm) + */ + private static final int getDefaultMinimumLevel(String p_82375_0_) { + return 0; + } + + /** + * Gets the default number of players to return (argument c, 0 for infinite) + */ + private static final int getDefaultCount(String p_82382_0_) { + return p_82382_0_.equals("a") ? 0 : 1; + } + + /** + * Parses the given argument string, turning it into a HashMap<String, String> of name->value. + */ + private static Map getArgumentMap(String p_82381_0_) { + HashMap var1 = new HashMap(); + + if (p_82381_0_ == null) { + return var1; + } else { + Matcher var2 = intListPattern.matcher(p_82381_0_); + int var3 = 0; + int var4; + + for (var4 = -1; var2.find(); var4 = var2.end()) { + String var5 = null; + + switch (var3++) { + case 0: + var5 = "x"; + break; + + case 1: + var5 = "y"; + break; + + case 2: + var5 = "z"; + break; + + case 3: + var5 = "r"; + } + + if (var5 != null && var2.group(1).length() > 0) { + var1.put(var5, var2.group(1)); + } + } + + if (var4 < p_82381_0_.length()) { + var2 = keyValueListPattern.matcher(var4 == -1 ? p_82381_0_ : p_82381_0_.substring(var4)); + + while (var2.find()) { + var1.put(var2.group(1), var2.group(2)); + } + } + + return var1; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ServerCommandManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ServerCommandManager.java new file mode 100644 index 0000000..b84a151 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/ServerCommandManager.java @@ -0,0 +1,125 @@ +package net.minecraft.command; + +import java.util.Iterator; +import net.minecraft.command.server.CommandAchievement; +import net.minecraft.command.server.CommandBanIp; +import net.minecraft.command.server.CommandBanPlayer; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.command.server.CommandBroadcast; +import net.minecraft.command.server.CommandDeOp; +import net.minecraft.command.server.CommandEmote; +import net.minecraft.command.server.CommandListBans; +import net.minecraft.command.server.CommandListPlayers; +import net.minecraft.command.server.CommandMessage; +import net.minecraft.command.server.CommandMessageRaw; +import net.minecraft.command.server.CommandNetstat; +import net.minecraft.command.server.CommandOp; +import net.minecraft.command.server.CommandPardonIp; +import net.minecraft.command.server.CommandPardonPlayer; +import net.minecraft.command.server.CommandPublishLocalServer; +import net.minecraft.command.server.CommandSaveAll; +import net.minecraft.command.server.CommandSaveOff; +import net.minecraft.command.server.CommandSaveOn; +import net.minecraft.command.server.CommandScoreboard; +import net.minecraft.command.server.CommandSetBlock; +import net.minecraft.command.server.CommandSetDefaultSpawnpoint; +import net.minecraft.command.server.CommandStop; +import net.minecraft.command.server.CommandSummon; +import net.minecraft.command.server.CommandTeleport; +import net.minecraft.command.server.CommandTestFor; +import net.minecraft.command.server.CommandTestForBlock; +import net.minecraft.command.server.CommandWhitelist; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.rcon.RConConsoleSource; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; + +public class ServerCommandManager extends CommandHandler implements IAdminCommand { + + + public ServerCommandManager() { + this.registerCommand(new CommandTime()); + this.registerCommand(new CommandGameMode()); + this.registerCommand(new CommandDifficulty()); + this.registerCommand(new CommandDefaultGameMode()); + this.registerCommand(new CommandKill()); + this.registerCommand(new CommandToggleDownfall()); + this.registerCommand(new CommandWeather()); + this.registerCommand(new CommandXP()); + this.registerCommand(new CommandTeleport()); + this.registerCommand(new CommandGive()); + this.registerCommand(new CommandEffect()); + this.registerCommand(new CommandEnchant()); + this.registerCommand(new CommandEmote()); + this.registerCommand(new CommandShowSeed()); + this.registerCommand(new CommandHelp()); + this.registerCommand(new CommandDebug()); + this.registerCommand(new CommandMessage()); + this.registerCommand(new CommandBroadcast()); + this.registerCommand(new CommandSetSpawnpoint()); + this.registerCommand(new CommandSetDefaultSpawnpoint()); + this.registerCommand(new CommandGameRule()); + this.registerCommand(new CommandClearInventory()); + this.registerCommand(new CommandTestFor()); + this.registerCommand(new CommandSpreadPlayers()); + this.registerCommand(new CommandPlaySound()); + this.registerCommand(new CommandScoreboard()); + this.registerCommand(new CommandAchievement()); + this.registerCommand(new CommandSummon()); + this.registerCommand(new CommandSetBlock()); + this.registerCommand(new CommandTestForBlock()); + this.registerCommand(new CommandMessageRaw()); + + if (MinecraftServer.getServer().isDedicatedServer()) { + this.registerCommand(new CommandOp()); + this.registerCommand(new CommandDeOp()); + this.registerCommand(new CommandStop()); + this.registerCommand(new CommandSaveAll()); + this.registerCommand(new CommandSaveOff()); + this.registerCommand(new CommandSaveOn()); + this.registerCommand(new CommandBanIp()); + this.registerCommand(new CommandPardonIp()); + this.registerCommand(new CommandBanPlayer()); + this.registerCommand(new CommandListBans()); + this.registerCommand(new CommandPardonPlayer()); + this.registerCommand(new CommandServerKick()); + this.registerCommand(new CommandListPlayers()); + this.registerCommand(new CommandWhitelist()); + this.registerCommand(new CommandSetPlayerTimeout()); + this.registerCommand(new CommandNetstat()); + } else { + this.registerCommand(new CommandPublishLocalServer()); + } + + CommandBase.setAdminCommander(this); + } + + public void func_152372_a(ICommandSender p_152372_1_, ICommand p_152372_2_, int p_152372_3_, String p_152372_4_, Object ... p_152372_5_) { + boolean var6 = !(p_152372_1_ instanceof CommandBlockLogic) || MinecraftServer.getServer().worldServers[0].getGameRules().getGameRuleBooleanValue("commandBlockOutput"); + + ChatComponentTranslation var7 = new ChatComponentTranslation("chat.type.admin", p_152372_1_.getCommandSenderName(), new ChatComponentTranslation(p_152372_4_, p_152372_5_)); + var7.getChatStyle().setColor(EnumChatFormatting.GRAY); + var7.getChatStyle().setItalic(Boolean.valueOf(true)); + + if (var6) { + Iterator var8 = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); + + while (var8.hasNext()) { + EntityPlayer var9 = (EntityPlayer)var8.next(); + + if (var9 != p_152372_1_ && MinecraftServer.getServer().getConfigurationManager().func_152596_g(var9.getGameProfile()) && p_152372_2_.canCommandSenderUseCommand(var9) && (!(p_152372_1_ instanceof RConConsoleSource) || MinecraftServer.getServer().func_152363_m())) { + var9.addChatMessage(var7); + } + } + } + + if (p_152372_1_ != MinecraftServer.getServer()) { + MinecraftServer.getServer().addChatMessage(var7); + } + + if ((p_152372_3_ & 1) != 1) { + p_152372_1_.addChatMessage(new ChatComponentTranslation(p_152372_4_, p_152372_5_)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/SyntaxErrorException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/SyntaxErrorException.java new file mode 100644 index 0000000..b9dab0c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/SyntaxErrorException.java @@ -0,0 +1,13 @@ +package net.minecraft.command; + +public class SyntaxErrorException extends CommandException { + + + public SyntaxErrorException() { + this("commands.generic.snytax"); + } + + public SyntaxErrorException(String p_i1361_1_, Object ... p_i1361_2_) { + super(p_i1361_1_, p_i1361_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/WrongUsageException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/WrongUsageException.java new file mode 100644 index 0000000..a34d4ca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/WrongUsageException.java @@ -0,0 +1,9 @@ +package net.minecraft.command; + +public class WrongUsageException extends SyntaxErrorException { + + + public WrongUsageException(String p_i1364_1_, Object ... p_i1364_2_) { + super(p_i1364_1_, p_i1364_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandAchievement.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandAchievement.java new file mode 100644 index 0000000..ab62ae2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandAchievement.java @@ -0,0 +1,117 @@ +package net.minecraft.command.server; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; + +public class CommandAchievement extends CommandBase { + + + public String getCommandName() { + return "achievement"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.achievement.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 2) { + StatBase var3 = StatList.func_151177_a(p_71515_2_[1]); + + if (var3 == null && !p_71515_2_[1].equals("*")) { + throw new CommandException("commands.achievement.unknownAchievement", p_71515_2_[1]); + } + + EntityPlayerMP var4; + + if (p_71515_2_.length >= 3) { + var4 = getPlayer(p_71515_1_, p_71515_2_[2]); + } else { + var4 = getCommandSenderAsPlayer(p_71515_1_); + } + + if (p_71515_2_[0].equalsIgnoreCase("give")) { + if (var3 == null) { + Iterator var5 = AchievementList.achievementList.iterator(); + + while (var5.hasNext()) { + Achievement var6 = (Achievement)var5.next(); + var4.triggerAchievement(var6); + } + + func_152373_a(p_71515_1_, this, "commands.achievement.give.success.all", var4.getCommandSenderName()); + } else { + if (var3 instanceof Achievement) { + Achievement var9 = (Achievement)var3; + ArrayList var10; + + for (var10 = Lists.newArrayList(); var9.parentAchievement != null && !var4.func_147099_x().hasAchievementUnlocked(var9.parentAchievement); var9 = var9.parentAchievement) { + var10.add(var9.parentAchievement); + } + + Iterator var7 = Lists.reverse(var10).iterator(); + + while (var7.hasNext()) { + Achievement var8 = (Achievement)var7.next(); + var4.triggerAchievement(var8); + } + } + + var4.triggerAchievement(var3); + func_152373_a(p_71515_1_, this, "commands.achievement.give.success.one", var4.getCommandSenderName(), var3.func_150955_j()); + } + + return; + } + } + + throw new WrongUsageException("commands.achievement.usage"); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + if (p_71516_2_.length == 1) { + return getListOfStringsMatchingLastWord(p_71516_2_, "give"); + } else if (p_71516_2_.length != 2) { + return p_71516_2_.length == 3 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()) : null; + } else { + ArrayList var3 = Lists.newArrayList(); + Iterator var4 = StatList.allStats.iterator(); + + while (var4.hasNext()) { + StatBase var5 = (StatBase)var4.next(); + var3.add(var5.statId); + } + + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, var3); + } + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBanIp.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBanIp.java new file mode 100644 index 0000000..3d3b16e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBanIp.java @@ -0,0 +1,94 @@ +package net.minecraft.command.server; + +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.IPBanEntry; +import net.minecraft.util.IChatComponent; + +public class CommandBanIp extends CommandBase { + public static final Pattern field_147211_a = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); + + + public String getCommandName() { + return "ban-ip"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { + return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152689_b() && super.canCommandSenderUseCommand(p_71519_1_); + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.banip.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 1 && p_71515_2_[0].length() > 1) { + Matcher var3 = field_147211_a.matcher(p_71515_2_[0]); + IChatComponent var4 = null; + + if (p_71515_2_.length >= 2) { + var4 = func_147178_a(p_71515_1_, p_71515_2_, 1); + } + + if (var3.matches()) { + this.func_147210_a(p_71515_1_, p_71515_2_[0], var4 == null ? null : var4.getUnformattedText()); + } else { + EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().func_152612_a(p_71515_2_[0]); + + if (var5 == null) { + throw new PlayerNotFoundException("commands.banip.invalid"); + } + + this.func_147210_a(p_71515_1_, var5.getPlayerIP(), var4 == null ? null : var4.getUnformattedText()); + } + } else { + throw new WrongUsageException("commands.banip.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()) : null; + } + + protected void func_147210_a(ICommandSender p_147210_1_, String p_147210_2_, String p_147210_3_) { + IPBanEntry var4 = new IPBanEntry(p_147210_2_, null, p_147210_1_.getCommandSenderName(), null, p_147210_3_); + MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152687_a(var4); + List var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerList(p_147210_2_); + String[] var6 = new String[var5.size()]; + int var7 = 0; + EntityPlayerMP var9; + + for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getCommandSenderName()) { + var9 = (EntityPlayerMP)var8.next(); + var9.playerNetServerHandler.kickPlayerFromServer("You have been IP banned."); + } + + if (var5.isEmpty()) { + func_152373_a(p_147210_1_, this, "commands.banip.success", p_147210_2_); + } else { + func_152373_a(p_147210_1_, this, "commands.banip.success.players", p_147210_2_, joinNiceString(var6)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBanPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBanPlayer.java new file mode 100644 index 0000000..b0349ba --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBanPlayer.java @@ -0,0 +1,74 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.Date; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.UserListBansEntry; + +public class CommandBanPlayer extends CommandBase { + + + public String getCommandName() { + return "ban"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.ban.usage"; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { + return MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152689_b() && super.canCommandSenderUseCommand(p_71519_1_); + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 1 && p_71515_2_[0].length() > 0) { + MinecraftServer var3 = MinecraftServer.getServer(); + GameProfile var4 = var3.func_152358_ax().func_152655_a(p_71515_2_[0]); + + if (var4 == null) { + throw new CommandException("commands.ban.failed", p_71515_2_[0]); + } else { + String var5 = null; + + if (p_71515_2_.length >= 2) { + var5 = func_147178_a(p_71515_1_, p_71515_2_, 1).getUnformattedText(); + } + + UserListBansEntry var6 = new UserListBansEntry(var4, null, p_71515_1_.getCommandSenderName(), null, var5); + var3.getConfigurationManager().func_152608_h().func_152687_a(var6); + EntityPlayerMP var7 = var3.getConfigurationManager().func_152612_a(p_71515_2_[0]); + + if (var7 != null) { + var7.playerNetServerHandler.kickPlayerFromServer("You are banned from this server."); + } + + func_152373_a(p_71515_1_, this, "commands.ban.success", p_71515_2_[0]); + } + } else { + throw new WrongUsageException("commands.ban.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length >= 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBlockLogic.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBlockLogic.java new file mode 100644 index 0000000..07ee36c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBlockLogic.java @@ -0,0 +1,127 @@ +package net.minecraft.command.server; + +import io.netty.buffer.ByteBuf; +import java.text.SimpleDateFormat; +import java.util.Date; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public abstract class CommandBlockLogic implements ICommandSender { + private static final SimpleDateFormat field_145766_a = new SimpleDateFormat("HH:mm:ss"); + private int field_145764_b; + private boolean field_145765_c = true; + private IChatComponent field_145762_d = null; + private String field_145763_e = ""; + private String field_145761_f = "@"; + + + public int func_145760_g() { + return this.field_145764_b; + } + + public IChatComponent func_145749_h() { + return this.field_145762_d; + } + + public void func_145758_a(NBTTagCompound p_145758_1_) { + p_145758_1_.setString("Command", this.field_145763_e); + p_145758_1_.setInteger("SuccessCount", this.field_145764_b); + p_145758_1_.setString("CustomName", this.field_145761_f); + + if (this.field_145762_d != null) { + p_145758_1_.setString("LastOutput", IChatComponent.Serializer.func_150696_a(this.field_145762_d)); + } + + p_145758_1_.setBoolean("TrackOutput", this.field_145765_c); + } + + public void func_145759_b(NBTTagCompound p_145759_1_) { + this.field_145763_e = p_145759_1_.getString("Command"); + this.field_145764_b = p_145759_1_.getInteger("SuccessCount"); + + if (p_145759_1_.func_150297_b("CustomName", 8)) { + this.field_145761_f = p_145759_1_.getString("CustomName"); + } + + if (p_145759_1_.func_150297_b("LastOutput", 8)) { + this.field_145762_d = IChatComponent.Serializer.func_150699_a(p_145759_1_.getString("LastOutput")); + } + + if (p_145759_1_.func_150297_b("TrackOutput", 1)) { + this.field_145765_c = p_145759_1_.getBoolean("TrackOutput"); + } + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_) { + return p_70003_1_ <= 2; + } + + public void func_145752_a(String p_145752_1_) { + this.field_145763_e = p_145752_1_; + } + + public String func_145753_i() { + return this.field_145763_e; + } + + public void func_145755_a(World p_145755_1_) { + if (p_145755_1_.isClient) { + this.field_145764_b = 0; + } + + MinecraftServer var2 = MinecraftServer.getServer(); + + if (var2 != null && var2.isCommandBlockEnabled()) { + ICommandManager var3 = var2.getCommandManager(); + this.field_145764_b = var3.executeCommand(this, this.field_145763_e); + } else { + this.field_145764_b = 0; + } + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return this.field_145761_f; + } + + public IChatComponent func_145748_c_() { + return new ChatComponentText(this.getCommandSenderName()); + } + + public void func_145754_b(String p_145754_1_) { + this.field_145761_f = p_145754_1_; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent p_145747_1_) { + if (this.field_145765_c && this.getEntityWorld() != null && !this.getEntityWorld().isClient) { + this.field_145762_d = (new ChatComponentText("[" + field_145766_a.format(new Date()) + "] ")).appendSibling(p_145747_1_); + this.func_145756_e(); + } + } + + public abstract void func_145756_e(); + + public abstract int func_145751_f(); + + public abstract void func_145757_a(ByteBuf p_145757_1_); + + public void func_145750_b(IChatComponent p_145750_1_) { + this.field_145762_d = p_145750_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBroadcast.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBroadcast.java new file mode 100644 index 0000000..6a6bc5b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandBroadcast.java @@ -0,0 +1,44 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class CommandBroadcast extends CommandBase { + + + public String getCommandName() { + return "say"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 1; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.say.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length > 0 && p_71515_2_[0].length() > 0) { + IChatComponent var3 = func_147176_a(p_71515_1_, p_71515_2_, 0, true); + MinecraftServer.getServer().getConfigurationManager().func_148539_a(new ChatComponentTranslation("chat.type.announcement", p_71515_1_.getCommandSenderName(), var3)); + } else { + throw new WrongUsageException("commands.say.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length >= 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()) : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandDeOp.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandDeOp.java new file mode 100644 index 0000000..9a6c91c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandDeOp.java @@ -0,0 +1,51 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandDeOp extends CommandBase { + + + public String getCommandName() { + return "deop"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.deop.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length == 1 && p_71515_2_[0].length() > 0) { + MinecraftServer var3 = MinecraftServer.getServer(); + GameProfile var4 = var3.getConfigurationManager().func_152603_m().func_152700_a(p_71515_2_[0]); + + if (var4 == null) { + throw new CommandException("commands.deop.failed", p_71515_2_[0]); + } else { + var3.getConfigurationManager().func_152610_b(var4); + func_152373_a(p_71515_1_, this, "commands.deop.success", p_71515_2_[0]); + } + } else { + throw new WrongUsageException("commands.deop.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getConfigurationManager().func_152606_n()) : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandEmote.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandEmote.java new file mode 100644 index 0000000..5012659 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandEmote.java @@ -0,0 +1,44 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class CommandEmote extends CommandBase { + + + public String getCommandName() { + return "me"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.me.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length > 0) { + IChatComponent var3 = func_147176_a(p_71515_1_, p_71515_2_, 0, p_71515_1_.canCommandSenderUseCommand(1, "me")); + MinecraftServer.getServer().getConfigurationManager().func_148539_a(new ChatComponentTranslation("chat.type.emote", p_71515_1_.func_145748_c_(), var3)); + } else { + throw new WrongUsageException("commands.me.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandListBans.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandListBans.java new file mode 100644 index 0000000..226eced --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandListBans.java @@ -0,0 +1,51 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandListBans extends CommandBase { + + + public String getCommandName() { + return "banlist"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { + return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152689_b() || MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152689_b()) && super.canCommandSenderUseCommand(p_71519_1_); + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.banlist.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 1 && p_71515_2_[0].equalsIgnoreCase("ips")) { + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.banlist.ips", Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152685_a().length))); + p_71515_1_.addChatMessage(new ChatComponentText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152685_a()))); + } else { + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.banlist.players", Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152685_a().length))); + p_71515_1_.addChatMessage(new ChatComponentText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152685_a()))); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, "players", "ips"): null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandListPlayers.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandListPlayers.java new file mode 100644 index 0000000..d954f49 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandListPlayers.java @@ -0,0 +1,31 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandListPlayers extends CommandBase { + + + public String getCommandName() { + return "list"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.players.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.players.list", Integer.valueOf(MinecraftServer.getServer().getCurrentPlayerCount()), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers()))); + p_71515_1_.addChatMessage(new ChatComponentText(MinecraftServer.getServer().getConfigurationManager().func_152609_b(p_71515_2_.length > 0 && "uuids".equalsIgnoreCase(p_71515_2_[0])))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandMessage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandMessage.java new file mode 100644 index 0000000..4f98f28 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandMessage.java @@ -0,0 +1,73 @@ +package net.minecraft.command.server; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class CommandMessage extends CommandBase { + + + public List getCommandAliases() { + return Arrays.asList("w", "msg"); + } + + public String getCommandName() { + return "tell"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.message.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException("commands.message.usage"); + } else { + EntityPlayerMP var3 = getPlayer(p_71515_1_, p_71515_2_[0]); + + if (var3 == null) { + throw new PlayerNotFoundException(); + } else if (var3 == p_71515_1_) { + throw new PlayerNotFoundException("commands.message.sameTarget"); + } else { + IChatComponent var4 = func_147176_a(p_71515_1_, p_71515_2_, 1, !(p_71515_1_ instanceof EntityPlayer)); + ChatComponentTranslation var5 = new ChatComponentTranslation("commands.message.display.incoming", p_71515_1_.func_145748_c_(), var4.createCopy()); + ChatComponentTranslation var6 = new ChatComponentTranslation("commands.message.display.outgoing", var3.func_145748_c_(), var4.createCopy()); + var5.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true)); + var6.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true)); + var3.addChatMessage(var5); + p_71515_1_.addChatMessage(var6); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandMessageRaw.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandMessageRaw.java new file mode 100644 index 0000000..d85a82f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandMessageRaw.java @@ -0,0 +1,62 @@ +package net.minecraft.command.server; + +import com.google.gson.JsonParseException; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.exception.ExceptionUtils; + +public class CommandMessageRaw extends CommandBase { + + + public String getCommandName() { + return "tellraw"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.tellraw.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException("commands.tellraw.usage"); + } else { + EntityPlayerMP var3 = getPlayer(p_71515_1_, p_71515_2_[0]); + String var4 = func_82360_a(p_71515_1_, p_71515_2_, 1); + + try { + IChatComponent var5 = IChatComponent.Serializer.func_150699_a(var4); + var3.addChatMessage(var5); + } catch (JsonParseException var7) { + Throwable var6 = ExceptionUtils.getRootCause(var7); + throw new SyntaxErrorException("commands.tellraw.jsonException", var6 == null ? "" : var6.getMessage()); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()) : null; + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandNetstat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandNetstat.java new file mode 100644 index 0000000..d18a610 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandNetstat.java @@ -0,0 +1,92 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.NetworkStatistics; +import net.minecraft.util.ChatComponentText; + +public class CommandNetstat extends CommandBase { + + + public String getCommandName() { + return "netstat"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 0; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.players.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_1_ instanceof EntityPlayer) { + p_71515_1_.addChatMessage(new ChatComponentText("Command is not available for players")); + } else { + if (p_71515_2_.length > 0 && p_71515_2_[0].length() > 1) { + if ("hottest-read".equals(p_71515_2_[0])) { + p_71515_1_.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152477_e().toString())); + } else if ("hottest-write".equals(p_71515_2_[0])) { + p_71515_1_.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152475_g().toString())); + } else if ("most-read".equals(p_71515_2_[0])) { + p_71515_1_.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152467_f().toString())); + } else if ("most-write".equals(p_71515_2_[0])) { + p_71515_1_.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152470_h().toString())); + } else { + NetworkStatistics.PacketStat var4; + int var7; + + if ("packet-read".equals(p_71515_2_[0])) { + if (p_71515_2_.length > 1 && p_71515_2_[1].length() > 0) { + try { + var7 = Integer.parseInt(p_71515_2_[1].trim()); + var4 = NetworkManager.field_152462_h.func_152466_a(var7); + this.func_152375_a(p_71515_1_, var7, var4); + } catch (Exception var6) { + p_71515_1_.addChatMessage(new ChatComponentText("Packet " + p_71515_2_[1] + " not found!")); + } + } else { + p_71515_1_.addChatMessage(new ChatComponentText("Packet id is missing")); + } + } else if ("packet-write".equals(p_71515_2_[0])) { + if (p_71515_2_.length > 1 && p_71515_2_[1].length() > 0) { + try { + var7 = Integer.parseInt(p_71515_2_[1].trim()); + var4 = NetworkManager.field_152462_h.func_152468_b(var7); + this.func_152375_a(p_71515_1_, var7, var4); + } catch (Exception var5) { + p_71515_1_.addChatMessage(new ChatComponentText("Packet " + p_71515_2_[1] + " not found!")); + } + } else { + p_71515_1_.addChatMessage(new ChatComponentText("Packet id is missing")); + } + } else if ("read-count".equals(p_71515_2_[0])) { + p_71515_1_.addChatMessage(new ChatComponentText("total-read-count" + NetworkManager.field_152462_h.func_152472_c())); + } else if ("write-count".equals(p_71515_2_[0])) { + p_71515_1_.addChatMessage(new ChatComponentText("total-write-count" + NetworkManager.field_152462_h.func_152473_d())); + } else { + p_71515_1_.addChatMessage(new ChatComponentText("Unrecognized: " + p_71515_2_[0])); + } + } + } else { + String var3 = "reads: " + NetworkManager.field_152462_h.func_152465_a(); + var3 = var3 + ", writes: " + NetworkManager.field_152462_h.func_152471_b(); + p_71515_1_.addChatMessage(new ChatComponentText(var3)); + } + } + } + + private void func_152375_a(ICommandSender p_152375_1_, int p_152375_2_, NetworkStatistics.PacketStat p_152375_3_) { + if (p_152375_3_ != null) { + p_152375_1_.addChatMessage(new ChatComponentText(p_152375_3_.toString())); + } else { + p_152375_1_.addChatMessage(new ChatComponentText("Packet " + p_152375_2_ + " not found!")); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandOp.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandOp.java new file mode 100644 index 0000000..118254c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandOp.java @@ -0,0 +1,69 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandOp extends CommandBase { + + + public String getCommandName() { + return "op"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.op.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length == 1 && p_71515_2_[0].length() > 0) { + MinecraftServer var3 = MinecraftServer.getServer(); + GameProfile var4 = var3.func_152358_ax().func_152655_a(p_71515_2_[0]); + + if (var4 == null) { + throw new CommandException("commands.op.failed", p_71515_2_[0]); + } else { + var3.getConfigurationManager().func_152605_a(var4); + func_152373_a(p_71515_1_, this, "commands.op.success", p_71515_2_[0]); + } + } else { + throw new WrongUsageException("commands.op.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + if (p_71516_2_.length == 1) { + String var3 = p_71516_2_[p_71516_2_.length - 1]; + ArrayList var4 = new ArrayList(); + GameProfile[] var5 = MinecraftServer.getServer().func_152357_F(); + int var6 = var5.length; + + for (int var7 = 0; var7 < var6; ++var7) { + GameProfile var8 = var5[var7]; + + if (!MinecraftServer.getServer().getConfigurationManager().func_152596_g(var8) && doesStringStartWith(var3, var8.getName())) { + var4.add(var8.getName()); + } + } + + return var4; + } else { + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPardonIp.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPardonIp.java new file mode 100644 index 0000000..038de1e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPardonIp.java @@ -0,0 +1,57 @@ +package net.minecraft.command.server; + +import java.util.List; +import java.util.regex.Matcher; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandPardonIp extends CommandBase { + + + public String getCommandName() { + return "pardon-ip"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { + return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152689_b() && super.canCommandSenderUseCommand(p_71519_1_); + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.unbanip.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length == 1 && p_71515_2_[0].length() > 1) { + Matcher var3 = CommandBanIp.field_147211_a.matcher(p_71515_2_[0]); + + if (var3.matches()) { + MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152684_c(p_71515_2_[0]); + func_152373_a(p_71515_1_, this, "commands.unbanip.success", p_71515_2_[0]); + } else { + throw new SyntaxErrorException("commands.unbanip.invalid"); + } + } else { + throw new WrongUsageException("commands.unbanip.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152685_a()) : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPardonPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPardonPlayer.java new file mode 100644 index 0000000..2d10ce2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPardonPlayer.java @@ -0,0 +1,58 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandPardonPlayer extends CommandBase { + + + public String getCommandName() { + return "pardon"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.unban.usage"; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) { + return MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152689_b() && super.canCommandSenderUseCommand(p_71519_1_); + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length == 1 && p_71515_2_[0].length() > 0) { + MinecraftServer var3 = MinecraftServer.getServer(); + GameProfile var4 = var3.getConfigurationManager().func_152608_h().func_152703_a(p_71515_2_[0]); + + if (var4 == null) { + throw new CommandException("commands.unban.failed", p_71515_2_[0]); + } else { + var3.getConfigurationManager().func_152608_h().func_152684_c(var4); + func_152373_a(p_71515_1_, this, "commands.unban.success", p_71515_2_[0]); + } + } else { + throw new WrongUsageException("commands.unban.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152685_a()) : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPublishLocalServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPublishLocalServer.java new file mode 100644 index 0000000..ca69da8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandPublishLocalServer.java @@ -0,0 +1,28 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldSettings; + +public class CommandPublishLocalServer extends CommandBase { + + + public String getCommandName() { + return "publish"; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.publish.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + String var3 = MinecraftServer.getServer().shareToLAN(WorldSettings.GameType.SURVIVAL, false); + + if (var3 != null) { + func_152373_a(p_71515_1_, this, "commands.publish.started", var3); + } else { + func_152373_a(p_71515_1_, this, "commands.publish.failed"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveAll.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveAll.java new file mode 100644 index 0000000..5bb4fec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveAll.java @@ -0,0 +1,67 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldServer; + +public class CommandSaveAll extends CommandBase { + + + public String getCommandName() { + return "save-all"; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.save.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + MinecraftServer var3 = MinecraftServer.getServer(); + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.save.start")); + + if (var3.getConfigurationManager() != null) { + var3.getConfigurationManager().saveAllPlayerData(); + } + + try { + int var4; + WorldServer var5; + boolean var6; + + for (var4 = 0; var4 < var3.worldServers.length; ++var4) { + if (var3.worldServers[var4] != null) { + var5 = var3.worldServers[var4]; + var6 = var5.levelSaving; + var5.levelSaving = false; + var5.saveAllChunks(true, null); + var5.levelSaving = var6; + } + } + + if (p_71515_2_.length > 0 && "flush".equals(p_71515_2_[0])) { + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.save.flushStart")); + + for (var4 = 0; var4 < var3.worldServers.length; ++var4) { + if (var3.worldServers[var4] != null) { + var5 = var3.worldServers[var4]; + var6 = var5.levelSaving; + var5.levelSaving = false; + var5.saveChunkData(); + var5.levelSaving = var6; + } + } + + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.save.flushEnd")); + } + } catch (MinecraftException var7) { + func_152373_a(p_71515_1_, this, "commands.save.failed", var7.getMessage()); + return; + } + + func_152373_a(p_71515_1_, this, "commands.save.success"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveOff.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveOff.java new file mode 100644 index 0000000..ab080b9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveOff.java @@ -0,0 +1,41 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandSaveOff extends CommandBase { + + + public String getCommandName() { + return "save-off"; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.save-off.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + MinecraftServer var3 = MinecraftServer.getServer(); + boolean var4 = false; + + for (int var5 = 0; var5 < var3.worldServers.length; ++var5) { + if (var3.worldServers[var5] != null) { + WorldServer var6 = var3.worldServers[var5]; + + if (!var6.levelSaving) { + var6.levelSaving = true; + var4 = true; + } + } + } + + if (var4) { + func_152373_a(p_71515_1_, this, "commands.save.disabled"); + } else { + throw new CommandException("commands.save-off.alreadyOff"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveOn.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveOn.java new file mode 100644 index 0000000..3587873 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSaveOn.java @@ -0,0 +1,41 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandSaveOn extends CommandBase { + + + public String getCommandName() { + return "save-on"; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.save-on.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + MinecraftServer var3 = MinecraftServer.getServer(); + boolean var4 = false; + + for (int var5 = 0; var5 < var3.worldServers.length; ++var5) { + if (var3.worldServers[var5] != null) { + WorldServer var6 = var3.worldServers[var5]; + + if (var6.levelSaving) { + var6.levelSaving = false; + var4 = true; + } + } + } + + if (var4) { + func_152373_a(p_71515_1_, this, "commands.save.enabled"); + } else { + throw new CommandException("commands.save-on.alreadyOn"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandScoreboard.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandScoreboard.java new file mode 100644 index 0000000..dbe5404 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandScoreboard.java @@ -0,0 +1,695 @@ +package net.minecraft.command.server; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; + +public class CommandScoreboard extends CommandBase { + + + public String getCommandName() { + return "scoreboard"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.scoreboard.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 1) { + if (p_71515_2_[0].equalsIgnoreCase("objectives")) { + if (p_71515_2_.length == 1) { + throw new WrongUsageException("commands.scoreboard.objectives.usage"); + } + + if (p_71515_2_[1].equalsIgnoreCase("list")) { + this.func_147196_d(p_71515_1_); + } else if (p_71515_2_[1].equalsIgnoreCase("add")) { + if (p_71515_2_.length < 4) { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage"); + } + + this.func_147193_c(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("remove")) { + if (p_71515_2_.length != 3) { + throw new WrongUsageException("commands.scoreboard.objectives.remove.usage"); + } + + this.func_147191_h(p_71515_1_, p_71515_2_[2]); + } else { + if (!p_71515_2_[1].equalsIgnoreCase("setdisplay")) { + throw new WrongUsageException("commands.scoreboard.objectives.usage"); + } + + if (p_71515_2_.length != 3 && p_71515_2_.length != 4) { + throw new WrongUsageException("commands.scoreboard.objectives.setdisplay.usage"); + } + + this.func_147198_k(p_71515_1_, p_71515_2_, 2); + } + + return; + } + + if (p_71515_2_[0].equalsIgnoreCase("players")) { + if (p_71515_2_.length == 1) { + throw new WrongUsageException("commands.scoreboard.players.usage"); + } + + if (p_71515_2_[1].equalsIgnoreCase("list")) { + if (p_71515_2_.length > 3) { + throw new WrongUsageException("commands.scoreboard.players.list.usage"); + } + + this.func_147195_l(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("add")) { + if (p_71515_2_.length != 5) { + throw new WrongUsageException("commands.scoreboard.players.add.usage"); + } + + this.func_147197_m(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("remove")) { + if (p_71515_2_.length != 5) { + throw new WrongUsageException("commands.scoreboard.players.remove.usage"); + } + + this.func_147197_m(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("set")) { + if (p_71515_2_.length != 5) { + throw new WrongUsageException("commands.scoreboard.players.set.usage"); + } + + this.func_147197_m(p_71515_1_, p_71515_2_, 2); + } else { + if (!p_71515_2_[1].equalsIgnoreCase("reset")) { + throw new WrongUsageException("commands.scoreboard.players.usage"); + } + + if (p_71515_2_.length != 3) { + throw new WrongUsageException("commands.scoreboard.players.reset.usage"); + } + + this.func_147187_n(p_71515_1_, p_71515_2_, 2); + } + + return; + } + + if (p_71515_2_[0].equalsIgnoreCase("teams")) { + if (p_71515_2_.length == 1) { + throw new WrongUsageException("commands.scoreboard.teams.usage"); + } + + if (p_71515_2_[1].equalsIgnoreCase("list")) { + if (p_71515_2_.length > 3) { + throw new WrongUsageException("commands.scoreboard.teams.list.usage"); + } + + this.func_147186_g(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("add")) { + if (p_71515_2_.length < 3) { + throw new WrongUsageException("commands.scoreboard.teams.add.usage"); + } + + this.func_147185_d(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("remove")) { + if (p_71515_2_.length != 3) { + throw new WrongUsageException("commands.scoreboard.teams.remove.usage"); + } + + this.func_147194_f(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("empty")) { + if (p_71515_2_.length != 3) { + throw new WrongUsageException("commands.scoreboard.teams.empty.usage"); + } + + this.func_147188_j(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("join")) { + if (p_71515_2_.length < 4 && (p_71515_2_.length != 3 || !(p_71515_1_ instanceof EntityPlayer))) { + throw new WrongUsageException("commands.scoreboard.teams.join.usage"); + } + + this.func_147190_h(p_71515_1_, p_71515_2_, 2); + } else if (p_71515_2_[1].equalsIgnoreCase("leave")) { + if (p_71515_2_.length < 3 && !(p_71515_1_ instanceof EntityPlayer)) { + throw new WrongUsageException("commands.scoreboard.teams.leave.usage"); + } + + this.func_147199_i(p_71515_1_, p_71515_2_, 2); + } else { + if (!p_71515_2_[1].equalsIgnoreCase("option")) { + throw new WrongUsageException("commands.scoreboard.teams.usage"); + } + + if (p_71515_2_.length != 4 && p_71515_2_.length != 5) { + throw new WrongUsageException("commands.scoreboard.teams.option.usage"); + } + + this.func_147200_e(p_71515_1_, p_71515_2_, 2); + } + + return; + } + } + + throw new WrongUsageException("commands.scoreboard.usage"); + } + + protected Scoreboard func_147192_d() { + return MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + } + + protected ScoreObjective func_147189_a(String p_147189_1_, boolean p_147189_2_) { + Scoreboard var3 = this.func_147192_d(); + ScoreObjective var4 = var3.getObjective(p_147189_1_); + + if (var4 == null) { + throw new CommandException("commands.scoreboard.objectiveNotFound", p_147189_1_); + } else if (p_147189_2_ && var4.getCriteria().isReadOnly()) { + throw new CommandException("commands.scoreboard.objectiveReadOnly", p_147189_1_); + } else { + return var4; + } + } + + protected ScorePlayerTeam func_147183_a(String p_147183_1_) { + Scoreboard var2 = this.func_147192_d(); + ScorePlayerTeam var3 = var2.getTeam(p_147183_1_); + + if (var3 == null) { + throw new CommandException("commands.scoreboard.teamNotFound", p_147183_1_); + } else { + return var3; + } + } + + protected void func_147193_c(ICommandSender p_147193_1_, String[] p_147193_2_, int p_147193_3_) { + String var4 = p_147193_2_[p_147193_3_++]; + String var5 = p_147193_2_[p_147193_3_++]; + Scoreboard var6 = this.func_147192_d(); + IScoreObjectiveCriteria var7 = (IScoreObjectiveCriteria)IScoreObjectiveCriteria.field_96643_a.get(var5); + + if (var7 == null) { + throw new WrongUsageException("commands.scoreboard.objectives.add.wrongType", var5); + } else if (var6.getObjective(var4) != null) { + throw new CommandException("commands.scoreboard.objectives.add.alreadyExists", var4); + } else if (var4.length() > 16) { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.tooLong", var4, Integer.valueOf(16)); + } else if (var4.length() == 0) { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage"); + } else { + if (p_147193_2_.length > p_147193_3_) { + String var8 = func_147178_a(p_147193_1_, p_147193_2_, p_147193_3_).getUnformattedText(); + + if (var8.length() > 32) { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.displayTooLong", var8, Integer.valueOf(32)); + } + + if (var8.length() > 0) { + var6.addScoreObjective(var4, var7).setDisplayName(var8); + } else { + var6.addScoreObjective(var4, var7); + } + } else { + var6.addScoreObjective(var4, var7); + } + + func_152373_a(p_147193_1_, this, "commands.scoreboard.objectives.add.success", var4); + } + } + + protected void func_147185_d(ICommandSender p_147185_1_, String[] p_147185_2_, int p_147185_3_) { + String var4 = p_147185_2_[p_147185_3_++]; + Scoreboard var5 = this.func_147192_d(); + + if (var5.getTeam(var4) != null) { + throw new CommandException("commands.scoreboard.teams.add.alreadyExists", var4); + } else if (var4.length() > 16) { + throw new SyntaxErrorException("commands.scoreboard.teams.add.tooLong", var4, Integer.valueOf(16)); + } else if (var4.length() == 0) { + throw new WrongUsageException("commands.scoreboard.teams.add.usage"); + } else { + if (p_147185_2_.length > p_147185_3_) { + String var6 = func_147178_a(p_147185_1_, p_147185_2_, p_147185_3_).getUnformattedText(); + + if (var6.length() > 32) { + throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", var6, Integer.valueOf(32)); + } + + if (var6.length() > 0) { + var5.createTeam(var4).setTeamName(var6); + } else { + var5.createTeam(var4); + } + } else { + var5.createTeam(var4); + } + + func_152373_a(p_147185_1_, this, "commands.scoreboard.teams.add.success", var4); + } + } + + protected void func_147200_e(ICommandSender p_147200_1_, String[] p_147200_2_, int p_147200_3_) { + ScorePlayerTeam var4 = this.func_147183_a(p_147200_2_[p_147200_3_++]); + + if (var4 != null) { + String var5 = p_147200_2_[p_147200_3_++].toLowerCase(); + + if (!var5.equalsIgnoreCase("color") && !var5.equalsIgnoreCase("friendlyfire") && !var5.equalsIgnoreCase("seeFriendlyInvisibles")) { + throw new WrongUsageException("commands.scoreboard.teams.option.usage"); + } else if (p_147200_2_.length == 4) { + if (var5.equalsIgnoreCase("color")) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", var5, joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false))); + } else if (!var5.equalsIgnoreCase("friendlyfire") && !var5.equalsIgnoreCase("seeFriendlyInvisibles")) { + throw new WrongUsageException("commands.scoreboard.teams.option.usage"); + } else { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", var5, joinNiceStringFromCollection(Arrays.asList("true", "false"))); + } + } else { + String var6 = p_147200_2_[p_147200_3_++]; + + if (var5.equalsIgnoreCase("color")) { + EnumChatFormatting var7 = EnumChatFormatting.getValueByName(var6); + + if (var7 == null || var7.isFancyStyling()) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", var5, joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false))); + } + + var4.setNamePrefix(var7.toString()); + var4.setNameSuffix(EnumChatFormatting.RESET.toString()); + } else if (var5.equalsIgnoreCase("friendlyfire")) { + if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false")) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", var5, joinNiceStringFromCollection(Arrays.asList("true", "false"))); + } + + var4.setAllowFriendlyFire(var6.equalsIgnoreCase("true")); + } else if (var5.equalsIgnoreCase("seeFriendlyInvisibles")) { + if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false")) { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", var5, joinNiceStringFromCollection(Arrays.asList("true", "false"))); + } + + var4.setSeeFriendlyInvisiblesEnabled(var6.equalsIgnoreCase("true")); + } + + func_152373_a(p_147200_1_, this, "commands.scoreboard.teams.option.success", var5, var4.getRegisteredName(), var6); + } + } + } + + protected void func_147194_f(ICommandSender p_147194_1_, String[] p_147194_2_, int p_147194_3_) { + Scoreboard var4 = this.func_147192_d(); + ScorePlayerTeam var5 = this.func_147183_a(p_147194_2_[p_147194_3_++]); + + if (var5 != null) { + var4.removeTeam(var5); + func_152373_a(p_147194_1_, this, "commands.scoreboard.teams.remove.success", var5.getRegisteredName()); + } + } + + protected void func_147186_g(ICommandSender p_147186_1_, String[] p_147186_2_, int p_147186_3_) { + Scoreboard var4 = this.func_147192_d(); + + if (p_147186_2_.length > p_147186_3_) { + ScorePlayerTeam var5 = this.func_147183_a(p_147186_2_[p_147186_3_++]); + + if (var5 == null) { + return; + } + + Collection var6 = var5.getMembershipCollection(); + + if (var6.size() <= 0) { + throw new CommandException("commands.scoreboard.teams.list.player.empty", var5.getRegisteredName()); + } + + ChatComponentTranslation var7 = new ChatComponentTranslation("commands.scoreboard.teams.list.player.count", Integer.valueOf(var6.size()), var5.getRegisteredName()); + var7.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147186_1_.addChatMessage(var7); + p_147186_1_.addChatMessage(new ChatComponentText(joinNiceString(var6.toArray()))); + } else { + Collection var9 = var4.getTeams(); + + if (var9.size() <= 0) { + throw new CommandException("commands.scoreboard.teams.list.empty"); + } + + ChatComponentTranslation var10 = new ChatComponentTranslation("commands.scoreboard.teams.list.count", Integer.valueOf(var9.size())); + var10.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147186_1_.addChatMessage(var10); + Iterator var11 = var9.iterator(); + + while (var11.hasNext()) { + ScorePlayerTeam var8 = (ScorePlayerTeam)var11.next(); + p_147186_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.teams.list.entry", var8.getRegisteredName(), var8.func_96669_c(), Integer.valueOf(var8.getMembershipCollection().size()))); + } + } + } + + protected void func_147190_h(ICommandSender p_147190_1_, String[] p_147190_2_, int p_147190_3_) { + Scoreboard var4 = this.func_147192_d(); + String var5 = p_147190_2_[p_147190_3_++]; + HashSet var6 = new HashSet(); + HashSet var7 = new HashSet(); + String var8; + + if (p_147190_1_ instanceof EntityPlayer && p_147190_3_ == p_147190_2_.length) { + var8 = getCommandSenderAsPlayer(p_147190_1_).getCommandSenderName(); + + if (var4.func_151392_a(var8, var5)) { + var6.add(var8); + } else { + var7.add(var8); + } + } else { + while (p_147190_3_ < p_147190_2_.length) { + var8 = func_96332_d(p_147190_1_, p_147190_2_[p_147190_3_++]); + + if (var4.func_151392_a(var8, var5)) { + var6.add(var8); + } else { + var7.add(var8); + } + } + } + + if (!var6.isEmpty()) { + func_152373_a(p_147190_1_, this, "commands.scoreboard.teams.join.success", Integer.valueOf(var6.size()), var5, joinNiceString(var6.toArray(new String[0]))); + } + + if (!var7.isEmpty()) { + throw new CommandException("commands.scoreboard.teams.join.failure", Integer.valueOf(var7.size()), var5, joinNiceString(var7.toArray(new String[0]))); + } + } + + protected void func_147199_i(ICommandSender p_147199_1_, String[] p_147199_2_, int p_147199_3_) { + Scoreboard var4 = this.func_147192_d(); + HashSet var5 = new HashSet(); + HashSet var6 = new HashSet(); + String var7; + + if (p_147199_1_ instanceof EntityPlayer && p_147199_3_ == p_147199_2_.length) { + var7 = getCommandSenderAsPlayer(p_147199_1_).getCommandSenderName(); + + if (var4.func_96524_g(var7)) { + var5.add(var7); + } else { + var6.add(var7); + } + } else { + while (p_147199_3_ < p_147199_2_.length) { + var7 = func_96332_d(p_147199_1_, p_147199_2_[p_147199_3_++]); + + if (var4.func_96524_g(var7)) { + var5.add(var7); + } else { + var6.add(var7); + } + } + } + + if (!var5.isEmpty()) { + func_152373_a(p_147199_1_, this, "commands.scoreboard.teams.leave.success", Integer.valueOf(var5.size()), joinNiceString(var5.toArray(new String[0]))); + } + + if (!var6.isEmpty()) { + throw new CommandException("commands.scoreboard.teams.leave.failure", Integer.valueOf(var6.size()), joinNiceString(var6.toArray(new String[0]))); + } + } + + protected void func_147188_j(ICommandSender p_147188_1_, String[] p_147188_2_, int p_147188_3_) { + Scoreboard var4 = this.func_147192_d(); + ScorePlayerTeam var5 = this.func_147183_a(p_147188_2_[p_147188_3_++]); + + if (var5 != null) { + ArrayList var6 = new ArrayList(var5.getMembershipCollection()); + + if (var6.isEmpty()) { + throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", var5.getRegisteredName()); + } else { + Iterator var7 = var6.iterator(); + + while (var7.hasNext()) { + String var8 = (String)var7.next(); + var4.removePlayerFromTeam(var8, var5); + } + + func_152373_a(p_147188_1_, this, "commands.scoreboard.teams.empty.success", Integer.valueOf(var6.size()), var5.getRegisteredName()); + } + } + } + + protected void func_147191_h(ICommandSender p_147191_1_, String p_147191_2_) { + Scoreboard var3 = this.func_147192_d(); + ScoreObjective var4 = this.func_147189_a(p_147191_2_, false); + var3.func_96519_k(var4); + func_152373_a(p_147191_1_, this, "commands.scoreboard.objectives.remove.success", p_147191_2_); + } + + protected void func_147196_d(ICommandSender p_147196_1_) { + Scoreboard var2 = this.func_147192_d(); + Collection var3 = var2.getScoreObjectives(); + + if (var3.size() <= 0) { + throw new CommandException("commands.scoreboard.objectives.list.empty"); + } else { + ChatComponentTranslation var4 = new ChatComponentTranslation("commands.scoreboard.objectives.list.count", Integer.valueOf(var3.size())); + var4.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147196_1_.addChatMessage(var4); + Iterator var5 = var3.iterator(); + + while (var5.hasNext()) { + ScoreObjective var6 = (ScoreObjective)var5.next(); + p_147196_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.objectives.list.entry", var6.getName(), var6.getDisplayName(), var6.getCriteria().func_96636_a())); + } + } + } + + protected void func_147198_k(ICommandSender p_147198_1_, String[] p_147198_2_, int p_147198_3_) { + Scoreboard var4 = this.func_147192_d(); + String var5 = p_147198_2_[p_147198_3_++]; + int var6 = Scoreboard.getObjectiveDisplaySlotNumber(var5); + ScoreObjective var7 = null; + + if (p_147198_2_.length == 4) { + var7 = this.func_147189_a(p_147198_2_[p_147198_3_++], false); + } + + if (var6 < 0) { + throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", var5); + } else { + var4.func_96530_a(var6, var7); + + if (var7 != null) { + func_152373_a(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successSet", Scoreboard.getObjectiveDisplaySlot(var6), var7.getName()); + } else { + func_152373_a(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successCleared", Scoreboard.getObjectiveDisplaySlot(var6)); + } + } + } + + protected void func_147195_l(ICommandSender p_147195_1_, String[] p_147195_2_, int p_147195_3_) { + Scoreboard var4 = this.func_147192_d(); + + if (p_147195_2_.length > p_147195_3_) { + String var5 = func_96332_d(p_147195_1_, p_147195_2_[p_147195_3_++]); + Map var6 = var4.func_96510_d(var5); + + if (var6.size() <= 0) { + throw new CommandException("commands.scoreboard.players.list.player.empty", var5); + } + + ChatComponentTranslation var7 = new ChatComponentTranslation("commands.scoreboard.players.list.player.count", Integer.valueOf(var6.size()), var5); + var7.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147195_1_.addChatMessage(var7); + Iterator var8 = var6.values().iterator(); + + while (var8.hasNext()) { + Score var9 = (Score)var8.next(); + p_147195_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.players.list.player.entry", Integer.valueOf(var9.getScorePoints()), var9.func_96645_d().getDisplayName(), var9.func_96645_d().getName())); + } + } else { + Collection var10 = var4.getObjectiveNames(); + + if (var10.size() <= 0) { + throw new CommandException("commands.scoreboard.players.list.empty"); + } + + ChatComponentTranslation var11 = new ChatComponentTranslation("commands.scoreboard.players.list.count", Integer.valueOf(var10.size())); + var11.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147195_1_.addChatMessage(var11); + p_147195_1_.addChatMessage(new ChatComponentText(joinNiceString(var10.toArray()))); + } + } + + protected void func_147197_m(ICommandSender p_147197_1_, String[] p_147197_2_, int p_147197_3_) { + String var4 = p_147197_2_[p_147197_3_ - 1]; + String var5 = func_96332_d(p_147197_1_, p_147197_2_[p_147197_3_++]); + ScoreObjective var6 = this.func_147189_a(p_147197_2_[p_147197_3_++], true); + int var7 = var4.equalsIgnoreCase("set") ? parseInt(p_147197_1_, p_147197_2_[p_147197_3_++]) : parseIntWithMin(p_147197_1_, p_147197_2_[p_147197_3_++], 1); + Scoreboard var8 = this.func_147192_d(); + Score var9 = var8.func_96529_a(var5, var6); + + if (var4.equalsIgnoreCase("set")) { + var9.func_96647_c(var7); + } else if (var4.equalsIgnoreCase("add")) { + var9.func_96649_a(var7); + } else { + var9.func_96646_b(var7); + } + + func_152373_a(p_147197_1_, this, "commands.scoreboard.players.set.success", var6.getName(), var5, Integer.valueOf(var9.getScorePoints())); + } + + protected void func_147187_n(ICommandSender p_147187_1_, String[] p_147187_2_, int p_147187_3_) { + Scoreboard var4 = this.func_147192_d(); + String var5 = func_96332_d(p_147187_1_, p_147187_2_[p_147187_3_++]); + var4.func_96515_c(var5); + func_152373_a(p_147187_1_, this, "commands.scoreboard.players.reset.success", var5); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + if (p_71516_2_.length == 1) { + return getListOfStringsMatchingLastWord(p_71516_2_, "objectives", "players", "teams"); + } else { + if (p_71516_2_[0].equalsIgnoreCase("objectives")) { + if (p_71516_2_.length == 2) { + return getListOfStringsMatchingLastWord(p_71516_2_, "list", "add", "remove", "setdisplay"); + } + + if (p_71516_2_[1].equalsIgnoreCase("add")) { + if (p_71516_2_.length == 4) { + Set var3 = IScoreObjectiveCriteria.field_96643_a.keySet(); + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, var3); + } + } else if (p_71516_2_[1].equalsIgnoreCase("remove")) { + if (p_71516_2_.length == 3) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, this.func_147184_a(false)); + } + } else if (p_71516_2_[1].equalsIgnoreCase("setdisplay")) { + if (p_71516_2_.length == 3) { + return getListOfStringsMatchingLastWord(p_71516_2_, "list", "sidebar", "belowName"); + } + + if (p_71516_2_.length == 4) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, this.func_147184_a(false)); + } + } + } else if (p_71516_2_[0].equalsIgnoreCase("players")) { + if (p_71516_2_.length == 2) { + return getListOfStringsMatchingLastWord(p_71516_2_, "set", "add", "remove", "reset", "list"); + } + + if (!p_71516_2_[1].equalsIgnoreCase("set") && !p_71516_2_[1].equalsIgnoreCase("add") && !p_71516_2_[1].equalsIgnoreCase("remove")) { + if ((p_71516_2_[1].equalsIgnoreCase("reset") || p_71516_2_[1].equalsIgnoreCase("list")) && p_71516_2_.length == 3) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, this.func_147192_d().getObjectiveNames()); + } + } else { + if (p_71516_2_.length == 3) { + return getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()); + } + + if (p_71516_2_.length == 4) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, this.func_147184_a(true)); + } + } + } else if (p_71516_2_[0].equalsIgnoreCase("teams")) { + if (p_71516_2_.length == 2) { + return getListOfStringsMatchingLastWord(p_71516_2_, "add", "remove", "join", "leave", "empty", "list", "option"); + } + + if (p_71516_2_[1].equalsIgnoreCase("join")) { + if (p_71516_2_.length == 3) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, this.func_147192_d().getTeamNames()); + } + + if (p_71516_2_.length >= 4) { + return getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()); + } + } else { + if (p_71516_2_[1].equalsIgnoreCase("leave")) { + return getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()); + } + + if (!p_71516_2_[1].equalsIgnoreCase("empty") && !p_71516_2_[1].equalsIgnoreCase("list") && !p_71516_2_[1].equalsIgnoreCase("remove")) { + if (p_71516_2_[1].equalsIgnoreCase("option")) { + if (p_71516_2_.length == 3) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, this.func_147192_d().getTeamNames()); + } + + if (p_71516_2_.length == 4) { + return getListOfStringsMatchingLastWord(p_71516_2_, "color", "friendlyfire", "seeFriendlyInvisibles"); + } + + if (p_71516_2_.length == 5) { + if (p_71516_2_[3].equalsIgnoreCase("color")) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, EnumChatFormatting.getValidValues(true, false)); + } + + if (p_71516_2_[3].equalsIgnoreCase("friendlyfire") || p_71516_2_[3].equalsIgnoreCase("seeFriendlyInvisibles")) { + return getListOfStringsMatchingLastWord(p_71516_2_, "true", "false"); + } + } + } + } else if (p_71516_2_.length == 3) { + return getListOfStringsFromIterableMatchingLastWord(p_71516_2_, this.func_147192_d().getTeamNames()); + } + } + } + + return null; + } + } + + protected List func_147184_a(boolean p_147184_1_) { + Collection var2 = this.func_147192_d().getScoreObjectives(); + ArrayList var3 = new ArrayList(); + Iterator var4 = var2.iterator(); + + while (var4.hasNext()) { + ScoreObjective var5 = (ScoreObjective)var4.next(); + + if (!p_147184_1_ || !var5.getCriteria().isReadOnly()) { + var3.add(var5.getName()); + } + } + + return var3; + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_1_[0].equalsIgnoreCase("players") ? p_82358_2_ == 2 : (p_82358_1_[0].equalsIgnoreCase("teams") && (p_82358_2_ == 2 || p_82358_2_ == 3)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSetBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSetBlock.java new file mode 100644 index 0000000..5fea863 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSetBlock.java @@ -0,0 +1,111 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class CommandSetBlock extends CommandBase { + + + public String getCommandName() { + return "setblock"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.setblock.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 4) { + int var3 = p_71515_1_.getPlayerCoordinates().posX; + int var4 = p_71515_1_.getPlayerCoordinates().posY; + int var5 = p_71515_1_.getPlayerCoordinates().posZ; + var3 = MathHelper.floor_double(func_110666_a(p_71515_1_, var3, p_71515_2_[0])); + var4 = MathHelper.floor_double(func_110666_a(p_71515_1_, var4, p_71515_2_[1])); + var5 = MathHelper.floor_double(func_110666_a(p_71515_1_, var5, p_71515_2_[2])); + Block var6 = CommandBase.getBlockByText(p_71515_1_, p_71515_2_[3]); + int var7 = 0; + + if (p_71515_2_.length >= 5) { + var7 = parseIntBounded(p_71515_1_, p_71515_2_[4], 0, 15); + } + + World var8 = p_71515_1_.getEntityWorld(); + + if (!var8.blockExists(var3, var4, var5)) { + throw new CommandException("commands.setblock.outOfWorld"); + } else { + NBTTagCompound var9 = new NBTTagCompound(); + boolean var10 = false; + + if (p_71515_2_.length >= 7 && var6.hasTileEntity()) { + String var11 = func_147178_a(p_71515_1_, p_71515_2_, 6).getUnformattedText(); + + try { + NBTBase var12 = JsonToNBT.func_150315_a(var11); + + if (!(var12 instanceof NBTTagCompound)) { + throw new CommandException("commands.setblock.tagError", "Not a valid tag"); + } + + var9 = (NBTTagCompound)var12; + var10 = true; + } catch (NBTException var13) { + throw new CommandException("commands.setblock.tagError", var13.getMessage()); + } + } + + if (p_71515_2_.length >= 6) { + if (p_71515_2_[5].equals("destroy")) { + var8.func_147480_a(var3, var4, var5, true); + } else if (p_71515_2_[5].equals("keep") && !var8.isAirBlock(var3, var4, var5)) { + throw new CommandException("commands.setblock.noChange"); + } + } + + if (!var8.setBlock(var3, var4, var5, var6, var7, 3)) { + throw new CommandException("commands.setblock.noChange"); + } else { + if (var10) { + TileEntity var14 = var8.getTileEntity(var3, var4, var5); + + if (var14 != null) { + var9.setInteger("x", var3); + var9.setInteger("y", var4); + var9.setInteger("z", var5); + var14.readFromNBT(var9); + } + } + + func_152373_a(p_71515_1_, this, "commands.setblock.success"); + } + } + } else { + throw new WrongUsageException("commands.setblock.usage"); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 4 ? getListOfStringsFromIterableMatchingLastWord(p_71516_2_, Block.blockRegistry.getKeys()) : (p_71516_2_.length == 6 ? getListOfStringsMatchingLastWord(p_71516_2_, "replace", "destroy", "keep"): null); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java new file mode 100644 index 0000000..31b6f39 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java @@ -0,0 +1,49 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.util.ChunkCoordinates; + +public class CommandSetDefaultSpawnpoint extends CommandBase { + + + public String getCommandName() { + return "setworldspawn"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.setworldspawn.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length == 3) { + if (p_71515_1_.getEntityWorld() == null) { + throw new WrongUsageException("commands.setworldspawn.usage"); + } + + byte var3 = 0; + int var7 = var3 + 1; + int var4 = parseIntBounded(p_71515_1_, p_71515_2_[var3], -30000000, 30000000); + int var5 = parseIntBounded(p_71515_1_, p_71515_2_[var7++], 0, 256); + int var6 = parseIntBounded(p_71515_1_, p_71515_2_[var7++], -30000000, 30000000); + p_71515_1_.getEntityWorld().setSpawnLocation(var4, var5, var6); + func_152373_a(p_71515_1_, this, "commands.setworldspawn.success", Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6)); + } else { + if (p_71515_2_.length != 0) { + throw new WrongUsageException("commands.setworldspawn.usage"); + } + + ChunkCoordinates var8 = getCommandSenderAsPlayer(p_71515_1_).getPlayerCoordinates(); + p_71515_1_.getEntityWorld().setSpawnLocation(var8.posX, var8.posY, var8.posZ); + func_152373_a(p_71515_1_, this, "commands.setworldspawn.success", Integer.valueOf(var8.posX), Integer.valueOf(var8.posY), Integer.valueOf(var8.posZ)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandStop.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandStop.java new file mode 100644 index 0000000..06ac8cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandStop.java @@ -0,0 +1,25 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; + +public class CommandStop extends CommandBase { + + + public String getCommandName() { + return "stop"; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.stop.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (MinecraftServer.getServer().worldServers != null) { + func_152373_a(p_71515_1_, this, "commands.stop.start"); + } + + MinecraftServer.getServer().initiateShutdown(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSummon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSummon.java new file mode 100644 index 0000000..45db0c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandSummon.java @@ -0,0 +1,121 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public class CommandSummon extends CommandBase { + + + public String getCommandName() { + return "summon"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.summon.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 1) { + throw new WrongUsageException("commands.summon.usage"); + } else { + String var3 = p_71515_2_[0]; + double var4 = (double)p_71515_1_.getPlayerCoordinates().posX + 0.5D; + double var6 = p_71515_1_.getPlayerCoordinates().posY; + double var8 = (double)p_71515_1_.getPlayerCoordinates().posZ + 0.5D; + + if (p_71515_2_.length >= 4) { + var4 = func_110666_a(p_71515_1_, var4, p_71515_2_[1]); + var6 = func_110666_a(p_71515_1_, var6, p_71515_2_[2]); + var8 = func_110666_a(p_71515_1_, var8, p_71515_2_[3]); + } + + World var10 = p_71515_1_.getEntityWorld(); + + if (!var10.blockExists((int)var4, (int)var6, (int)var8)) { + func_152373_a(p_71515_1_, this, "commands.summon.outOfWorld"); + } else { + NBTTagCompound var11 = new NBTTagCompound(); + boolean var12 = false; + + if (p_71515_2_.length >= 5) { + IChatComponent var13 = func_147178_a(p_71515_1_, p_71515_2_, 4); + + try { + NBTBase var14 = JsonToNBT.func_150315_a(var13.getUnformattedText()); + + if (!(var14 instanceof NBTTagCompound)) { + func_152373_a(p_71515_1_, this, "commands.summon.tagError", "Not a valid tag"); + return; + } + + var11 = (NBTTagCompound)var14; + var12 = true; + } catch (NBTException var17) { + func_152373_a(p_71515_1_, this, "commands.summon.tagError", var17.getMessage()); + return; + } + } + + var11.setString("id", var3); + Entity var18 = EntityList.createEntityFromNBT(var11, var10); + + if (var18 == null) { + func_152373_a(p_71515_1_, this, "commands.summon.failed"); + } else { + var18.setLocationAndAngles(var4, var6, var8, var18.rotationYaw, var18.rotationPitch); + + if (!var12 && var18 instanceof EntityLiving) { + ((EntityLiving)var18).onSpawnWithEgg(null); + } + + var10.spawnEntityInWorld(var18); + Entity var19 = var18; + + for (NBTTagCompound var15 = var11; var19 != null && var15.func_150297_b("Riding", 10); var15 = var15.getCompoundTag("Riding")) { + Entity var16 = EntityList.createEntityFromNBT(var15.getCompoundTag("Riding"), var10); + + if (var16 != null) { + var16.setLocationAndAngles(var4, var6, var8, var16.rotationYaw, var16.rotationPitch); + var10.spawnEntityInWorld(var16); + var19.mountEntity(var16); + } + + var19 = var16; + } + + func_152373_a(p_71515_1_, this, "commands.summon.success"); + } + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 1 ? getListOfStringsMatchingLastWord(p_71516_2_, this.func_147182_d()) : null; + } + + protected String[] func_147182_d() { + return (String[])EntityList.func_151515_b().toArray(new String[0]); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTeleport.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTeleport.java new file mode 100644 index 0000000..2e1f47e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTeleport.java @@ -0,0 +1,88 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +public class CommandTeleport extends CommandBase { + + + public String getCommandName() { + return "tp"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.tp.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length < 1) { + throw new WrongUsageException("commands.tp.usage"); + } else { + EntityPlayerMP var3; + + if (p_71515_2_.length != 2 && p_71515_2_.length != 4) { + var3 = getCommandSenderAsPlayer(p_71515_1_); + } else { + var3 = getPlayer(p_71515_1_, p_71515_2_[0]); + + if (var3 == null) { + throw new PlayerNotFoundException(); + } + } + + if (p_71515_2_.length != 3 && p_71515_2_.length != 4) { + if (p_71515_2_.length == 1 || p_71515_2_.length == 2) { + EntityPlayerMP var11 = getPlayer(p_71515_1_, p_71515_2_[p_71515_2_.length - 1]); + + if (var11 == null) { + throw new PlayerNotFoundException(); + } + + if (var11.worldObj != var3.worldObj) { + func_152373_a(p_71515_1_, this, "commands.tp.notSameDimension"); + return; + } + + var3.mountEntity(null); + var3.playerNetServerHandler.setPlayerLocation(var11.posX, var11.posY, var11.posZ, var11.rotationYaw, var11.rotationPitch); + func_152373_a(p_71515_1_, this, "commands.tp.success", var3.getCommandSenderName(), var11.getCommandSenderName()); + } + } else if (var3.worldObj != null) { + int var4 = p_71515_2_.length - 3; + double var5 = func_110666_a(p_71515_1_, var3.posX, p_71515_2_[var4++]); + double var7 = func_110665_a(p_71515_1_, var3.posY, p_71515_2_[var4++], 0, 0); + double var9 = func_110666_a(p_71515_1_, var3.posZ, p_71515_2_[var4++]); + var3.mountEntity(null); + var3.setPositionAndUpdate(var5, var7, var9); + func_152373_a(p_71515_1_, this, "commands.tp.success.coordinates", var3.getCommandSenderName(), Double.valueOf(var5), Double.valueOf(var7), Double.valueOf(var9)); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length != 1 && p_71516_2_.length != 2 ? null : getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getAllUsernames()); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTestFor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTestFor.java new file mode 100644 index 0000000..108e692 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTestFor.java @@ -0,0 +1,42 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; + +public class CommandTestFor extends CommandBase { + + + public String getCommandName() { + return "testfor"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.testfor.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length != 1) { + throw new WrongUsageException("commands.testfor.usage"); + } else if (!(p_71515_1_ instanceof CommandBlockLogic)) { + throw new CommandException("commands.testfor.failed"); + } else { + getPlayer(p_71515_1_, p_71515_2_[0]); + } + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] p_82358_1_, int p_82358_2_) { + return p_82358_2_ == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTestForBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTestForBlock.java new file mode 100644 index 0000000..4b57d13 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandTestForBlock.java @@ -0,0 +1,157 @@ +package net.minecraft.command.server; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class CommandTestForBlock extends CommandBase { + + + public String getCommandName() { + return "testforblock"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 2; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.testforblock.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 4) { + int var3 = p_71515_1_.getPlayerCoordinates().posX; + int var4 = p_71515_1_.getPlayerCoordinates().posY; + int var5 = p_71515_1_.getPlayerCoordinates().posZ; + var3 = MathHelper.floor_double(func_110666_a(p_71515_1_, var3, p_71515_2_[0])); + var4 = MathHelper.floor_double(func_110666_a(p_71515_1_, var4, p_71515_2_[1])); + var5 = MathHelper.floor_double(func_110666_a(p_71515_1_, var5, p_71515_2_[2])); + Block var6 = Block.getBlockFromName(p_71515_2_[3]); + + if (var6 == null) { + throw new NumberInvalidException("commands.setblock.notFound", p_71515_2_[3]); + } else { + int var7 = -1; + + if (p_71515_2_.length >= 5) { + var7 = parseIntBounded(p_71515_1_, p_71515_2_[4], -1, 15); + } + + World var8 = p_71515_1_.getEntityWorld(); + + if (!var8.blockExists(var3, var4, var5)) { + throw new CommandException("commands.testforblock.outOfWorld"); + } else { + NBTTagCompound var9 = new NBTTagCompound(); + boolean var10 = false; + + if (p_71515_2_.length >= 6 && var6.hasTileEntity()) { + String var11 = func_147178_a(p_71515_1_, p_71515_2_, 5).getUnformattedText(); + + try { + NBTBase var12 = JsonToNBT.func_150315_a(var11); + + if (!(var12 instanceof NBTTagCompound)) { + throw new CommandException("commands.setblock.tagError", "Not a valid tag"); + } + + var9 = (NBTTagCompound)var12; + var10 = true; + } catch (NBTException var14) { + throw new CommandException("commands.setblock.tagError", var14.getMessage()); + } + } + + Block var15 = var8.getBlock(var3, var4, var5); + + if (var15 != var6) { + throw new CommandException("commands.testforblock.failed.tile", Integer.valueOf(var3), Integer.valueOf(var4), Integer.valueOf(var5), var15.getLocalizedName(), var6.getLocalizedName()); + } else { + if (var7 > -1) { + int var16 = var8.getBlockMetadata(var3, var4, var5); + + if (var16 != var7) { + throw new CommandException("commands.testforblock.failed.data", Integer.valueOf(var3), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var16), Integer.valueOf(var7)); + } + } + + if (var10) { + TileEntity var17 = var8.getTileEntity(var3, var4, var5); + + if (var17 == null) { + throw new CommandException("commands.testforblock.failed.tileEntity", Integer.valueOf(var3), Integer.valueOf(var4), Integer.valueOf(var5)); + } + + NBTTagCompound var13 = new NBTTagCompound(); + var17.writeToNBT(var13); + + if (!this.func_147181_a(var9, var13)) { + throw new CommandException("commands.testforblock.failed.nbt", Integer.valueOf(var3), Integer.valueOf(var4), Integer.valueOf(var5)); + } + } + + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.testforblock.success", Integer.valueOf(var3), Integer.valueOf(var4), Integer.valueOf(var5))); + } + } + } + } else { + throw new WrongUsageException("commands.testforblock.usage"); + } + } + + public boolean func_147181_a(NBTBase p_147181_1_, NBTBase p_147181_2_) { + if (p_147181_1_ == p_147181_2_) { + return true; + } else if (p_147181_1_ == null) { + return true; + } else if (p_147181_2_ == null) { + return false; + } else if (!p_147181_1_.getClass().equals(p_147181_2_.getClass())) { + return false; + } else if (p_147181_1_ instanceof NBTTagCompound) { + NBTTagCompound var3 = (NBTTagCompound)p_147181_1_; + NBTTagCompound var4 = (NBTTagCompound)p_147181_2_; + Iterator var5 = var3.func_150296_c().iterator(); + String var6; + NBTBase var7; + + do { + if (!var5.hasNext()) { + return true; + } + + var6 = (String)var5.next(); + var7 = var3.getTag(var6); + } + while (this.func_147181_a(var7, var4.getTag(var6))); + + return false; + } else { + return p_147181_1_.equals(p_147181_2_); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + return p_71516_2_.length == 4 ? getListOfStringsFromIterableMatchingLastWord(p_71516_2_, Block.blockRegistry.getKeys()) : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandWhitelist.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandWhitelist.java new file mode 100644 index 0000000..2d42a0d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/command/server/CommandWhitelist.java @@ -0,0 +1,118 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandWhitelist extends CommandBase { + + + public String getCommandName() { + return "whitelist"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() { + return 3; + } + + public String getCommandUsage(ICommandSender p_71518_1_) { + return "commands.whitelist.usage"; + } + + public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { + if (p_71515_2_.length >= 1) { + MinecraftServer var3 = MinecraftServer.getServer(); + + if (p_71515_2_[0].equals("on")) { + var3.getConfigurationManager().setWhiteListEnabled(true); + func_152373_a(p_71515_1_, this, "commands.whitelist.enabled"); + return; + } + + if (p_71515_2_[0].equals("off")) { + var3.getConfigurationManager().setWhiteListEnabled(false); + func_152373_a(p_71515_1_, this, "commands.whitelist.disabled"); + return; + } + + if (p_71515_2_[0].equals("list")) { + p_71515_1_.addChatMessage(new ChatComponentTranslation("commands.whitelist.list", Integer.valueOf(var3.getConfigurationManager().func_152598_l().length), Integer.valueOf(var3.getConfigurationManager().getAvailablePlayerDat().length))); + String[] var5 = var3.getConfigurationManager().func_152598_l(); + p_71515_1_.addChatMessage(new ChatComponentText(joinNiceString(var5))); + return; + } + + GameProfile var4; + + if (p_71515_2_[0].equals("add")) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException("commands.whitelist.add.usage"); + } + + var4 = var3.func_152358_ax().func_152655_a(p_71515_2_[1]); + + if (var4 == null) { + throw new CommandException("commands.whitelist.add.failed", p_71515_2_[1]); + } + + var3.getConfigurationManager().func_152601_d(var4); + func_152373_a(p_71515_1_, this, "commands.whitelist.add.success", p_71515_2_[1]); + return; + } + + if (p_71515_2_[0].equals("remove")) { + if (p_71515_2_.length < 2) { + throw new WrongUsageException("commands.whitelist.remove.usage"); + } + + var4 = var3.getConfigurationManager().func_152599_k().func_152706_a(p_71515_2_[1]); + + if (var4 == null) { + throw new CommandException("commands.whitelist.remove.failed", p_71515_2_[1]); + } + + var3.getConfigurationManager().func_152597_c(var4); + func_152373_a(p_71515_1_, this, "commands.whitelist.remove.success", p_71515_2_[1]); + return; + } + + if (p_71515_2_[0].equals("reload")) { + var3.getConfigurationManager().loadWhiteList(); + func_152373_a(p_71515_1_, this, "commands.whitelist.reloaded"); + return; + } + } + + throw new WrongUsageException("commands.whitelist.usage"); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender p_71516_1_, String[] p_71516_2_) { + if (p_71516_2_.length == 1) { + return getListOfStringsMatchingLastWord(p_71516_2_, "on", "off", "list", "add", "remove", "reload"); + } else { + if (p_71516_2_.length == 2) { + if (p_71516_2_[0].equals("remove")) { + return getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().getConfigurationManager().func_152598_l()); + } + + if (p_71516_2_[0].equals("add")) { + return getListOfStringsMatchingLastWord(p_71516_2_, MinecraftServer.getServer().func_152358_ax().func_152654_a()); + } + } + + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/crash/CrashReport.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/crash/CrashReport.java new file mode 100644 index 0000000..fcc70da --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/crash/CrashReport.java @@ -0,0 +1,492 @@ +package net.minecraft.crash; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.AbstractModule; +import com.cheatbreaker.client.module.data.Setting; +import com.cheatbreaker.client.network.websocket.client.WSPacketClientCrashReport; +import com.google.common.collect.ImmutableMap; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.CrashReporter; +import net.minecraft.src.HttpUtils; +import net.minecraft.src.Reflector; +import net.minecraft.util.ReportedException; +import net.minecraft.world.gen.layer.IntCache; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.*; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.*; +import java.util.concurrent.Callable; + +public class CrashReport { + private static final Logger logger = LogManager.getLogger(); + + /** Description of the crash report. */ + private final String description; + + /** The Throwable that is the "cause" for this crash and Crash Report. */ + private final Throwable cause; + + /** Category of crash */ + private final CrashReportCategory theReportCategory = new CrashReportCategory(this, "System Details"); + + /** Holds the keys and values of all crash report sections. */ + private final List crashReportSections = new ArrayList(); + + /** File of crash report. */ + private File crashReportFile; + private boolean field_85059_f = true; + private StackTraceElement[] stacktrace = new StackTraceElement[0]; + private boolean reported = false; + + public CrashReport(String par1Str, Throwable par2Throwable) { + this.description = par1Str; + this.cause = par2Throwable; + this.populateEnvironment(); + } + + /** + * Populates this crash report with initial information about the running server and operating system / java + * environment + */ + private void populateEnvironment() { + this.theReportCategory.addCrashSectionCallable("Minecraft Version", () -> "1.7.10"); + this.theReportCategory.addCrashSectionCallable("Operating System", () -> System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version")); + this.theReportCategory.addCrashSectionCallable("Java Version", () -> System.getProperty("java.version") + ", " + System.getProperty("java.vendor")); + this.theReportCategory.addCrashSectionCallable("Java VM Version", () -> System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor")); + this.theReportCategory.addCrashSectionCallable("Memory", () -> { + Runtime var1 = Runtime.getRuntime(); + long var2 = var1.maxMemory(); + long var4 = var1.totalMemory(); + long var6 = var1.freeMemory(); + long var8 = var2 / 1024L / 1024L; + long var10 = var4 / 1024L / 1024L; + long var12 = var6 / 1024L / 1024L; + return var6 + " bytes (" + var12 + " MB) / " + var4 + " bytes (" + var10 + " MB) up to " + var2 + " bytes (" + var8 + " MB)"; + }); + this.theReportCategory.addCrashSectionCallable("JVM Flags", () -> { + RuntimeMXBean var1 = ManagementFactory.getRuntimeMXBean(); + List var2 = var1.getInputArguments(); + int var3 = 0; + StringBuilder var4 = new StringBuilder(); + Iterator var5 = var2.iterator(); + + while (var5.hasNext()) { + String var6 = (String)var5.next(); + + if (var6.startsWith("-X")) { + if (var3++ > 0) { + var4.append(" "); + } + + var4.append(var6); + } + } + + return String.format("%d total; %s", new Object[] {Integer.valueOf(var3), var4.toString()}); + }); + this.theReportCategory.addCrashSectionCallable("AABB Pool Size", () -> { + byte var1 = 0; + int var2 = 56 * var1; + int var3 = var2 / 1024 / 1024; + byte var4 = 0; + int var5 = 56 * var4; + int var6 = var5 / 1024 / 1024; + return var1 + " (" + var2 + " bytes; " + var3 + " MB) allocated, " + var4 + " (" + var5 + " bytes; " + var6 + " MB) used"; + }); + this.theReportCategory.addCrashSectionCallable("IntCache", new Callable() { + public String call() throws SecurityException, NoSuchFieldException, IllegalAccessException, IllegalArgumentException { + return IntCache.getCacheSizes(); + } + }); + + if (Reflector.FMLCommonHandler_enhanceCrashReport.exists()) { + Object instance = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + Reflector.callString(instance, Reflector.FMLCommonHandler_enhanceCrashReport, new Object[] {this, this.theReportCategory}); + } + } + + /** + * Returns the description of the Crash Report. + */ + public String getDescription() { + return this.description; + } + + /** + * Returns the Throwable object that is the cause for the crash and Crash Report. + */ + public Throwable getCrashCause() { + return this.cause; + } + + /** + * Gets the various sections of the crash report into the given StringBuilder + */ + public void getSectionsInStringBuilder(StringBuilder par1StringBuilder) { + if ((this.stacktrace == null || this.stacktrace.length <= 0) && this.crashReportSections.size() > 0) { + this.stacktrace = (StackTraceElement[])((StackTraceElement[])ArrayUtils.subarray(((CrashReportCategory)this.crashReportSections.get(0)).func_147152_a(), 0, 1)); + } + + if (this.stacktrace != null && this.stacktrace.length > 0) { + par1StringBuilder.append("-- Head --\n"); + par1StringBuilder.append("Stacktrace:\n"); + StackTraceElement[] var6 = this.stacktrace; + int var7 = var6.length; + + for (int var4 = 0; var4 < var7; ++var4) { + StackTraceElement var5 = var6[var4]; + par1StringBuilder.append("\t").append("at ").append(var5.toString()); + par1StringBuilder.append("\n"); + } + + par1StringBuilder.append("\n"); + } + + Iterator var61 = this.crashReportSections.iterator(); + + while (var61.hasNext()) { + CrashReportCategory var71 = (CrashReportCategory)var61.next(); + var71.appendToStringBuilder(par1StringBuilder); + par1StringBuilder.append("\n\n"); + } + + this.theReportCategory.appendToStringBuilder(par1StringBuilder); + } + + /** + * Gets the stack trace of the Throwable that caused this crash report, or if that fails, the cause .toString(). + */ + public String getCauseStackTraceOrString() { + StringWriter var1 = null; + PrintWriter var2 = null; + Object var3 = this.cause; + + if (((Throwable)var3).getMessage() == null) { + if (var3 instanceof NullPointerException) { + var3 = new NullPointerException(this.description); + } else if (var3 instanceof StackOverflowError) { + var3 = new StackOverflowError(this.description); + } else if (var3 instanceof OutOfMemoryError) { + var3 = new OutOfMemoryError(this.description); + } + + ((Throwable)var3).setStackTrace(this.cause.getStackTrace()); + } + + String var4 = ((Throwable)var3).toString(); + + try { + var1 = new StringWriter(); + var2 = new PrintWriter(var1); + ((Throwable)var3).printStackTrace(var2); + var4 = var1.toString(); + } + finally { + IOUtils.closeQuietly(var1); + IOUtils.closeQuietly(var2); + } + + return var4; + } + + /** + * Gets the complete report with headers, stack trace, and different sections as a string. + */ + public String getCompleteReport() { + if (!this.reported) { + this.reported = true; + CrashReporter.onCrashReport(this, this.theReportCategory); + } + + StringBuilder var1 = new StringBuilder(); + var1.append("---- Minecraft Crash Report ----\n"); + var1.append("// "); + var1.append(getWittyComment()); + var1.append("\n\n"); + var1.append("Time: "); + var1.append((new SimpleDateFormat()).format(new Date())); + var1.append("\n"); + var1.append("Description: "); + var1.append(this.description); + var1.append("\n\n"); + var1.append(this.getCauseStackTraceOrString()); + var1.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n"); + + for (int var2 = 0; var2 < 87; ++var2) { + var1.append("-"); + } + + var1.append("\n\n"); + this.getSectionsInStringBuilder(var1); + return var1.toString(); + } + + /** + * Gets the file this crash report is saved into. + */ + public File getFile() { + return this.crashReportFile; + } + + /** + * Saves this CrashReport to the given file and returns a value indicating whether we were successful at doing so. + */ + public boolean saveToFile(File p_147149_1_) { + if (this.crashReportFile != null) { + return false; + } else { + if (p_147149_1_.getParentFile() != null) { + p_147149_1_.getParentFile().mkdirs(); + } + + try { + FileWriter var3 = new FileWriter(p_147149_1_); + var3.write(this.getCompleteReport()); + var3.close(); + this.crashReportFile = p_147149_1_; + return true; + } catch (Throwable var31) { + logger.error("Could not save crash report to " + p_147149_1_, var31); + return false; + } + } + } + + public CrashReportCategory getCategory() { + return this.theReportCategory; + } + + /** + * Creates a CrashReportCategory + */ + public CrashReportCategory makeCategory(String par1Str) { + return this.makeCategoryDepth(par1Str, 1); + } + + /** + * Creates a CrashReportCategory for the given stack trace depth + */ + public CrashReportCategory makeCategoryDepth(String par1Str, int par2) { + CrashReportCategory var3 = new CrashReportCategory(this, par1Str); + + if (this.field_85059_f) { + int var4 = var3.getPrunedStackTrace(par2); + StackTraceElement[] var5 = this.cause.getStackTrace(); + StackTraceElement var6 = null; + StackTraceElement var7 = null; + int var8 = var5.length - var4; + + if (var8 < 0) { + System.out.println("Negative index in crash report handler (" + var5.length + "/" + var4 + ")"); + } + + if (var5 != null && 0 <= var8 && var8 < var5.length) { + var6 = var5[var8]; + + if (var5.length + 1 - var4 < var5.length) { + var7 = var5[var5.length + 1 - var4]; + } + } + + this.field_85059_f = var3.firstTwoElementsOfStackTraceMatch(var6, var7); + + if (var4 > 0 && !this.crashReportSections.isEmpty()) { + CrashReportCategory var9 = (CrashReportCategory)this.crashReportSections.get(this.crashReportSections.size() - 1); + var9.trimStackTraceEntriesFromBottom(var4); + } else if (var5 != null && var5.length >= var4 && 0 <= var8 && var8 < var5.length) { + this.stacktrace = new StackTraceElement[var8]; + System.arraycopy(var5, 0, this.stacktrace, 0, this.stacktrace.length); + } else { + this.field_85059_f = false; + } + } + + this.crashReportSections.add(var3); + return var3; + } + + /** + * Gets a random witty comment for inclusion in this CrashReport + */ + private static String getWittyComment() { + String[] var0 = new String[] {"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!", "But it works on my machine."}; + + try { + return var0[(int)(System.nanoTime() % (long)var0.length)]; + } catch (Throwable var2) { + return "Witty comment unavailable :("; + } + } + + /** + * Creates a crash report for the exception + */ + public static CrashReport makeCrashReport(Throwable throwable, String par1Str) { + try { + StackTraceElement[] stackTrace; + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(throwable.getClass().getSimpleName()).append(": ").append(throwable.getLocalizedMessage()); + for (StackTraceElement element : stackTrace = throwable.getStackTrace()) { + stringBuilder.append("\n").append("\t").append("at ").append(element); + } + UUID uuid = UUID.randomUUID(); + StringSelection reportID = new StringSelection("CB-" + uuid.toString()); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(reportID, null); + sendCrashReport(uuid.toString(), stringBuilder.toString()); + if (throwable.getClass().getSimpleName().equals("OutOfMemoryError")) { + new Thread(() -> JOptionPane.showMessageDialog(null, "Your client has ran out of memory." + + "\nYou can increase memory allocation in the launcher. " + + "\n\nPlease use the following code (also copied to your clipboard) when submitting a bug report: " + + "\n\nCB-" + uuid, "Out of Memory", 2)).start(); + } else { + new Thread(() -> JOptionPane.showMessageDialog(null, + "Your client has crashed. " + + "\n\nPlease use the following code (also copied to your clipboard) when submitting a bug report: " + + "\n\nCB-" + uuid, "Something went wrong", 2)).start(); + } + Thread.sleep(4000L); + } catch (Exception stackTrace) { + stackTrace.printStackTrace(); + // empty catch block + } + + CrashReport var2; + + if (throwable instanceof ReportedException) { + var2 = ((ReportedException)throwable).getCrashReport(); + } else { + var2 = new CrashReport(par1Str, throwable); + } + + return var2; + } + + private static void sendCrashReport(String crashId, String stackTrace) throws IOException { + StringBuilder descriptionBuilder = new StringBuilder(); + descriptionBuilder.append("OptiFine Version: ").append(Config.getVersion()).append("\n\n"); + descriptionBuilder.append("CheatBreaker client Version: ").append(CheatBreaker.getInstance().getGitCommitId() + "/" + + CheatBreaker.getInstance().getGitBranch()).append("\n\n"); + descriptionBuilder.append("= [ User Info ] =\n"); + if (Minecraft.getMinecraft().getSession() != null) { + try { + descriptionBuilder.append("User: " + Minecraft.getMinecraft().getSession().getUsername() + "\n"); + descriptionBuilder.append("UUID: " + Minecraft.getMinecraft().getSession().getPlayerID() + "\n\n"); + + } catch (Exception var20) { + var20.printStackTrace(); + } + } + descriptionBuilder.append("= [ Crash Info ] =\n"); + descriptionBuilder.append("Crash ID: " + crashId); + descriptionBuilder.append("\nStackTrace: " + stackTrace + "\n\n"); + BufferedReader var28; + String var29; + Runtime runtime = Runtime.getRuntime(); + long maxMemory = runtime.maxMemory(); + long totalMemory = runtime.totalMemory(); + long freeMemory = runtime.freeMemory(); + long maxMemDiv = maxMemory / 1024L / 1024L; + long totalMemDiv = totalMemory / 1024L / 1024L; + long freeMemDiv = freeMemory / 1024L / 1024L; + descriptionBuilder.append("= [ System Info ] =\n"); + descriptionBuilder.append("OpenGlVersion: " + Config.openGlVersion + "\n"); + descriptionBuilder.append("OpenGlRenderer: " + Config.openGlRenderer + "\n"); + descriptionBuilder.append("OpenGlVendor: " + Config.openGlVendor + "\n"); + descriptionBuilder.append("CpuCount: " + Config.getAvailableProcessors() + "\n"); + descriptionBuilder.append("OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n"); + descriptionBuilder.append("Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n"); + descriptionBuilder.append("Java VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor") + "\n"); + descriptionBuilder.append("Memory: " + freeMemory + " bytes (" + freeMemDiv + " MB) / " + totalMemory + " bytes (" + totalMemDiv + " MB) up to " + maxMemory + " bytes (" + maxMemDiv + " MB)\n"); + descriptionBuilder.append("JVM Flags: " + jvmargs() + "\n\n"); + descriptionBuilder.append("= [ Module Settings ] =").append("\n"); + for (AbstractModule var16 : CheatBreaker.getInstance().getModuleManager().playerMods) { + StringBuilder var17 = new StringBuilder(); + for (Setting var19 : var16.getSettingsList()) { + if (var19.getSettingName().equals("label")) continue; + var17.append(var19.getSettingName()).append("=").append(var19.getValue()).append(var16.getSettingsList().indexOf(var19) == var16.getSettingsList().size() - 1 ? "" : ", "); + } + descriptionBuilder.append(var16.getName() + ": [" + var17.toString() + "]\n"); + } + descriptionBuilder.append("\n= [ Global Settings ] =").append("\n"); + String var23 = ""; + List var24 =CheatBreaker.getInstance().getGlobalSettings().settingsList; + for (Setting var27 : var24) { + if (var27.getSettingName().equals("label")) continue; + var23 = var23 + var27.getSettingName() + "=" + var27.getValue() + (var24.indexOf(var27) == var24.size() - 1 ? "" : ", "); + } + descriptionBuilder.append("Global: [" + var23 + "]\n\n"); + GameSettings var26 = Minecraft.getMinecraft().gameSettings; + descriptionBuilder.append("= [ Options.txt ] =\n"); + try { + var28 = new BufferedReader(new FileReader(var26.optionsFile)); + while ((var29 = var28.readLine()) != null) { + if (var29.startsWith("stream") || var29.startsWith("key_") || var29.startsWith("soundCategory")) continue; + descriptionBuilder.append(var29 + "\n"); + } + } catch (IOException var22) { + var22.printStackTrace(); + } + descriptionBuilder.append("\n= [ OptionsOF.txt ] =\n"); + try { + var28 = new BufferedReader(new FileReader(var26.optionsFileOF)); + while ((var29 = var28.readLine()) != null) { + if (var29.startsWith("ofAnimated")) continue; + descriptionBuilder.append(var29 + "\n"); + } + } catch (IOException var21) { + var21.printStackTrace(); + } + + byte[] var4 = null; + try { + var4 = descriptionBuilder.toString().getBytes("ASCII"); + } catch (Exception exception) { + // empty catch block + } + + ImmutableMap var5 = ImmutableMap.builder() + .put("branch", CheatBreaker.getInstance().getGitBranch()) + .put("buildType", CheatBreaker.getInstance().getGitBuildVersion()) + .put("crashID", crashId) + .put("version", Config.MC_VERSION) + .put("gitCommit", CheatBreaker.getInstance().getGitCommitIdAbbrev()) + .put("osInfo", System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version")) + .put("username", Minecraft.getMinecraft().getSession().getUsername()) + .put("uuid", Minecraft.getMinecraft().getSession().getPlayerID()) + .build(); + HttpUtils.post(CheatBreaker.getInstance().getGlobalSettings().webapiCrashReportUpload, var5, var4); + if (CheatBreaker.getInstance().getWSNetHandler().isOpen()) { + WSPacketClientCrashReport crashReport = new WSPacketClientCrashReport(crashId, CheatBreaker.getInstance().getGitCommitId(), System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version"), "Memory: " + freeMemory + " bytes (" + freeMemDiv + " MB) / " + totalMemory + " bytes (" + totalMemDiv + " MB) up to " + maxMemory + " bytes (" + maxMemDiv + " MB)", descriptionBuilder.toString()); + CheatBreaker.getInstance().getWSNetHandler().sendPacket(crashReport); + } + } + + private static String jvmargs() { + RuntimeMXBean var0 = ManagementFactory.getRuntimeMXBean(); + List var1 = var0.getInputArguments(); + int var2 = 0; + StringBuilder var3 = new StringBuilder(); + for (String var5 : var1) { + if (!var5.startsWith("-X")) continue; + if (var2++ > 0) { + var3.append(" "); + } + var3.append(var5); + } + return String.format("%d total; %s", var2, var3.toString()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/crash/CrashReportCategory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/crash/CrashReportCategory.java new file mode 100644 index 0000000..ee72f34 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/crash/CrashReportCategory.java @@ -0,0 +1,246 @@ +package net.minecraft.crash; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.util.MathHelper; + +public class CrashReportCategory { + private final CrashReport theCrashReport; + private final String field_85076_b; + private final List field_85077_c = new ArrayList(); + private StackTraceElement[] stackTrace = new StackTraceElement[0]; + + + public CrashReportCategory(CrashReport p_i1353_1_, String p_i1353_2_) { + this.theCrashReport = p_i1353_1_; + this.field_85076_b = p_i1353_2_; + } + + public static String func_85074_a(double p_85074_0_, double p_85074_2_, double p_85074_4_) { + return String.format("%.2f,%.2f,%.2f - %s", Double.valueOf(p_85074_0_), Double.valueOf(p_85074_2_), Double.valueOf(p_85074_4_), getLocationInfo(MathHelper.floor_double(p_85074_0_), MathHelper.floor_double(p_85074_2_), MathHelper.floor_double(p_85074_4_))); + } + + /** + * Returns a string with world information on location.Args:x,y,z + */ + public static String getLocationInfo(int p_85071_0_, int p_85071_1_, int p_85071_2_) { + StringBuilder var3 = new StringBuilder(); + + try { + var3.append(String.format("World: (%d,%d,%d)", Integer.valueOf(p_85071_0_), Integer.valueOf(p_85071_1_), Integer.valueOf(p_85071_2_))); + } catch (Throwable var16) { + var3.append("(Error finding world loc)"); + } + + var3.append(", "); + int var4; + int var5; + int var6; + int var7; + int var8; + int var9; + int var10; + int var11; + int var12; + + try { + var4 = p_85071_0_ >> 4; + var5 = p_85071_2_ >> 4; + var6 = p_85071_0_ & 15; + var7 = p_85071_1_ >> 4; + var8 = p_85071_2_ & 15; + var9 = var4 << 4; + var10 = var5 << 4; + var11 = (var4 + 1 << 4) - 1; + var12 = (var5 + 1 << 4) - 1; + var3.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12))); + } catch (Throwable var15) { + var3.append("(Error finding chunk loc)"); + } + + var3.append(", "); + + try { + var4 = p_85071_0_ >> 9; + var5 = p_85071_2_ >> 9; + var6 = var4 << 5; + var7 = var5 << 5; + var8 = (var4 + 1 << 5) - 1; + var9 = (var5 + 1 << 5) - 1; + var10 = var4 << 9; + var11 = var5 << 9; + var12 = (var4 + 1 << 9) - 1; + int var13 = (var5 + 1 << 9) - 1; + var3.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12), Integer.valueOf(var13))); + } catch (Throwable var14) { + var3.append("(Error finding world loc)"); + } + + return var3.toString(); + } + + /** + * Adds a Crashreport section with the given name with the value set to the result of the given Callable; + */ + public void addCrashSectionCallable(String p_71500_1_, Callable p_71500_2_) { + try { + this.addCrashSection(p_71500_1_, p_71500_2_.call()); + } catch (Throwable var4) { + this.addCrashSectionThrowable(p_71500_1_, var4); + } + } + + /** + * Adds a Crashreport section with the given name with the given value (convered .toString()) + */ + public void addCrashSection(String p_71507_1_, Object p_71507_2_) { + this.field_85077_c.add(new CrashReportCategory.Entry(p_71507_1_, p_71507_2_)); + } + + /** + * Adds a Crashreport section with the given name with the given Throwable + */ + public void addCrashSectionThrowable(String p_71499_1_, Throwable p_71499_2_) { + this.addCrashSection(p_71499_1_, p_71499_2_); + } + + /** + * Resets our stack trace according to the current trace, pruning the deepest 3 entries. The parameter indicates + * how many additional deepest entries to prune. Returns the number of entries in the resulting pruned stack trace. + */ + public int getPrunedStackTrace(int p_85073_1_) { + StackTraceElement[] var2 = Thread.currentThread().getStackTrace(); + + if (var2.length <= 0) { + return 0; + } else { + this.stackTrace = new StackTraceElement[var2.length - 3 - p_85073_1_]; + System.arraycopy(var2, 3 + p_85073_1_, this.stackTrace, 0, this.stackTrace.length); + return this.stackTrace.length; + } + } + + /** + * Do the deepest two elements of our saved stack trace match the given elements, in order from the deepest? + */ + public boolean firstTwoElementsOfStackTraceMatch(StackTraceElement p_85069_1_, StackTraceElement p_85069_2_) { + if (this.stackTrace.length != 0 && p_85069_1_ != null) { + StackTraceElement var3 = this.stackTrace[0]; + + if (var3.isNativeMethod() == p_85069_1_.isNativeMethod() && var3.getClassName().equals(p_85069_1_.getClassName()) && var3.getFileName().equals(p_85069_1_.getFileName()) && var3.getMethodName().equals(p_85069_1_.getMethodName())) { + if (p_85069_2_ != null != this.stackTrace.length > 1) { + return false; + } else if (p_85069_2_ != null && !this.stackTrace[1].equals(p_85069_2_)) { + return false; + } else { + this.stackTrace[0] = p_85069_1_; + return true; + } + } else { + return false; + } + } else { + return false; + } + } + + /** + * Removes the given number entries from the bottom of the stack trace. + */ + public void trimStackTraceEntriesFromBottom(int p_85070_1_) { + StackTraceElement[] var2 = new StackTraceElement[this.stackTrace.length - p_85070_1_]; + System.arraycopy(this.stackTrace, 0, var2, 0, var2.length); + this.stackTrace = var2; + } + + public void appendToStringBuilder(StringBuilder p_85072_1_) { + p_85072_1_.append("-- ").append(this.field_85076_b).append(" --\n"); + p_85072_1_.append("Details:"); + Iterator var2 = this.field_85077_c.iterator(); + + while (var2.hasNext()) { + CrashReportCategory.Entry var3 = (CrashReportCategory.Entry)var2.next(); + p_85072_1_.append("\n\t"); + p_85072_1_.append(var3.func_85089_a()); + p_85072_1_.append(": "); + p_85072_1_.append(var3.func_85090_b()); + } + + if (this.stackTrace != null && this.stackTrace.length > 0) { + p_85072_1_.append("\nStacktrace:"); + StackTraceElement[] var6 = this.stackTrace; + int var7 = var6.length; + + for (int var4 = 0; var4 < var7; ++var4) { + StackTraceElement var5 = var6[var4]; + p_85072_1_.append("\n\tat "); + p_85072_1_.append(var5.toString()); + } + } + } + + public StackTraceElement[] func_147152_a() { + return this.stackTrace; + } + + public static void func_147153_a(CrashReportCategory p_147153_0_, final int p_147153_1_, final int p_147153_2_, final int p_147153_3_, final Block p_147153_4_, final int p_147153_5_) { + final int var6 = Block.getIdFromBlock(p_147153_4_); + p_147153_0_.addCrashSectionCallable("Block type", new Callable() { + + public String call() { + try { + return String.format("ID #%d (%s // %s)", Integer.valueOf(var6), p_147153_4_.getUnlocalizedName(), p_147153_4_.getClass().getCanonicalName()); + } catch (Throwable var2) { + return "ID #" + var6; + } + } + }); + p_147153_0_.addCrashSectionCallable("Block data value", new Callable() { + + public String call() { + if (p_147153_5_ < 0) { + return "Unknown? (Got " + p_147153_5_ + ")"; + } else { + String var1 = String.format("%4s", new Object[] {Integer.toBinaryString(p_147153_5_)}).replace(" ", "0"); + return String.format("%1$d / 0x%1$X / 0b%2$s", Integer.valueOf(p_147153_5_), var1); + } + } + }); + p_147153_0_.addCrashSectionCallable("Block location", new Callable() { + + public String call() { + return CrashReportCategory.getLocationInfo(p_147153_1_, p_147153_2_, p_147153_3_); + } + }); + } + + static class Entry { + private final String field_85092_a; + private final String field_85091_b; + + + public Entry(String p_i1352_1_, Object p_i1352_2_) { + this.field_85092_a = p_i1352_1_; + + if (p_i1352_2_ == null) { + this.field_85091_b = "~~NULL~~"; + } else if (p_i1352_2_ instanceof Throwable) { + Throwable var3 = (Throwable)p_i1352_2_; + this.field_85091_b = "~~ERROR~~ " + var3.getClass().getSimpleName() + ": " + var3.getMessage(); + } else { + this.field_85091_b = p_i1352_2_.toString(); + } + } + + public String func_85089_a() { + return this.field_85092_a; + } + + public String func_85090_b() { + return this.field_85091_b; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/creativetab/CreativeTabs.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/creativetab/CreativeTabs.java new file mode 100644 index 0000000..bf99782 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/creativetab/CreativeTabs.java @@ -0,0 +1,251 @@ +package net.minecraft.creativetab; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public abstract class CreativeTabs { + public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12]; + public static final CreativeTabs tabBlock = new CreativeTabs(0, "buildingBlocks") { + + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.brick_block); + } + }; + public static final CreativeTabs tabDecorations = new CreativeTabs(1, "decorations") { + + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.double_plant); + } + public int func_151243_f() { + return 5; + } + }; + public static final CreativeTabs tabRedstone = new CreativeTabs(2, "redstone") { + + public Item getTabIconItem() { + return Items.redstone; + } + }; + public static final CreativeTabs tabTransport = new CreativeTabs(3, "transportation") { + + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.golden_rail); + } + }; + public static final CreativeTabs tabMisc = (new CreativeTabs(4, "misc") { + + public Item getTabIconItem() { + return Items.lava_bucket; + } + }).func_111229_a(EnumEnchantmentType.all); + public static final CreativeTabs tabAllSearch = (new CreativeTabs(5, "search") { + + public Item getTabIconItem() { + return Items.compass; + } + }).setBackgroundImageName("item_search.png"); + public static final CreativeTabs tabFood = new CreativeTabs(6, "food") { + + public Item getTabIconItem() { + return Items.apple; + } + }; + public static final CreativeTabs tabTools = (new CreativeTabs(7, "tools") { + + public Item getTabIconItem() { + return Items.iron_axe; + } + }).func_111229_a(EnumEnchantmentType.digger, EnumEnchantmentType.fishing_rod, EnumEnchantmentType.breakable); + public static final CreativeTabs tabCombat = (new CreativeTabs(8, "combat") { + + public Item getTabIconItem() { + return Items.golden_sword; + } + }).func_111229_a(EnumEnchantmentType.armor, EnumEnchantmentType.armor_feet, EnumEnchantmentType.armor_head, EnumEnchantmentType.armor_legs, EnumEnchantmentType.armor_torso, EnumEnchantmentType.bow, EnumEnchantmentType.weapon); + public static final CreativeTabs tabBrewing = new CreativeTabs(9, "brewing") { + + public Item getTabIconItem() { + return Items.potionitem; + } + }; + public static final CreativeTabs tabMaterials = new CreativeTabs(10, "materials") { + + public Item getTabIconItem() { + return Items.stick; + } + }; + public static final CreativeTabs tabInventory = (new CreativeTabs(11, "inventory") { + + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.chest); + } + }).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); + private final int tabIndex; + private final String tabLabel; + + /** Texture to use. */ + private String backgroundImageName = "items.png"; + private boolean hasScrollbar = true; + + /** Whether to draw the title in the foreground of the creative GUI */ + private boolean drawTitle = true; + private EnumEnchantmentType[] field_111230_s; + private ItemStack field_151245_t; + + + public CreativeTabs(int p_i1853_1_, String p_i1853_2_) { + this.tabIndex = p_i1853_1_; + this.tabLabel = p_i1853_2_; + creativeTabArray[p_i1853_1_] = this; + } + + public int getTabIndex() { + return this.tabIndex; + } + + public String getTabLabel() { + return this.tabLabel; + } + + /** + * Gets the translated Label. + */ + public String getTranslatedTabLabel() { + return "itemGroup." + this.getTabLabel(); + } + + public ItemStack getIconItemStack() { + if (this.field_151245_t == null) { + this.field_151245_t = new ItemStack(this.getTabIconItem(), 1, this.func_151243_f()); + } + + return this.field_151245_t; + } + + public abstract Item getTabIconItem(); + + public int func_151243_f() { + return 0; + } + + public String getBackgroundImageName() { + return this.backgroundImageName; + } + + public CreativeTabs setBackgroundImageName(String p_78025_1_) { + this.backgroundImageName = p_78025_1_; + return this; + } + + public boolean drawInForegroundOfTab() { + return this.drawTitle; + } + + public CreativeTabs setNoTitle() { + this.drawTitle = false; + return this; + } + + public boolean shouldHidePlayerInventory() { + return this.hasScrollbar; + } + + public CreativeTabs setNoScrollbar() { + this.hasScrollbar = false; + return this; + } + + /** + * returns index % 6 + */ + public int getTabColumn() { + return this.tabIndex % 6; + } + + /** + * returns tabIndex < 6 + */ + public boolean isTabInFirstRow() { + return this.tabIndex < 6; + } + + public EnumEnchantmentType[] func_111225_m() { + return this.field_111230_s; + } + + public CreativeTabs func_111229_a(EnumEnchantmentType ... p_111229_1_) { + this.field_111230_s = p_111229_1_; + return this; + } + + public boolean func_111226_a(EnumEnchantmentType p_111226_1_) { + if (this.field_111230_s == null) { + return false; + } else { + EnumEnchantmentType[] var2 = this.field_111230_s; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + EnumEnchantmentType var5 = var2[var4]; + + if (var5 == p_111226_1_) { + return true; + } + } + + return false; + } + } + + /** + * only shows items which have tabToDisplayOn == this + */ + public void displayAllReleventItems(List p_78018_1_) { + Iterator var2 = Item.itemRegistry.iterator(); + + while (var2.hasNext()) { + Item var3 = (Item)var2.next(); + + if (var3 != null && var3.getCreativeTab() == this) { + var3.getSubItems(var3, this, p_78018_1_); + } + } + + if (this.func_111225_m() != null) { + this.addEnchantmentBooksToList(p_78018_1_, this.func_111225_m()); + } + } + + /** + * Adds the enchantment books from the supplied EnumEnchantmentType to the given list. + */ + public void addEnchantmentBooksToList(List p_92116_1_, EnumEnchantmentType ... p_92116_2_) { + Enchantment[] var3 = Enchantment.enchantmentsList; + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Enchantment var6 = var3[var5]; + + if (var6 != null && var6.type != null) { + boolean var7 = false; + + for (int var8 = 0; var8 < p_92116_2_.length && !var7; ++var8) { + if (var6.type == p_92116_2_[var8]) { + var7 = true; + } + } + + if (var7) { + p_92116_1_.add(Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(var6, var6.getMaxLevel()))); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java new file mode 100644 index 0000000..ff17440 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java @@ -0,0 +1,65 @@ +package net.minecraft.dispenser; + +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BehaviorDefaultDispenseItem implements IBehaviorDispenseItem { + + + /** + * Dispenses the specified ItemStack from a dispenser. + */ + public final ItemStack dispense(IBlockSource p_82482_1_, ItemStack p_82482_2_) { + ItemStack var3 = this.dispenseStack(p_82482_1_, p_82482_2_); + this.playDispenseSound(p_82482_1_); + this.spawnDispenseParticles(p_82482_1_, BlockDispenser.func_149937_b(p_82482_1_.getBlockMetadata())); + return var3; + } + + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + protected ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + IPosition var4 = BlockDispenser.func_149939_a(p_82487_1_); + ItemStack var5 = p_82487_2_.splitStack(1); + doDispense(p_82487_1_.getWorld(), var5, 6, var3, var4); + return p_82487_2_; + } + + public static void doDispense(World p_82486_0_, ItemStack p_82486_1_, int p_82486_2_, EnumFacing p_82486_3_, IPosition p_82486_4_) { + double var5 = p_82486_4_.getX(); + double var7 = p_82486_4_.getY(); + double var9 = p_82486_4_.getZ(); + EntityItem var11 = new EntityItem(p_82486_0_, var5, var7 - 0.3D, var9, p_82486_1_); + double var12 = p_82486_0_.rand.nextDouble() * 0.1D + 0.2D; + var11.motionX = (double)p_82486_3_.getFrontOffsetX() * var12; + var11.motionY = 0.20000000298023224D; + var11.motionZ = (double)p_82486_3_.getFrontOffsetZ() * var12; + var11.motionX += p_82486_0_.rand.nextGaussian() * 0.007499999832361937D * (double)p_82486_2_; + var11.motionY += p_82486_0_.rand.nextGaussian() * 0.007499999832361937D * (double)p_82486_2_; + var11.motionZ += p_82486_0_.rand.nextGaussian() * 0.007499999832361937D * (double)p_82486_2_; + p_82486_0_.spawnEntityInWorld(var11); + } + + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource p_82485_1_) { + p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + + /** + * Order clients to display dispense particles from the specified block and facing. + */ + protected void spawnDispenseParticles(IBlockSource p_82489_1_, EnumFacing p_82489_2_) { + p_82489_1_.getWorld().playAuxSFX(2000, p_82489_1_.getXInt(), p_82489_1_.getYInt(), p_82489_1_.getZInt(), this.func_82488_a(p_82489_2_)); + } + + private int func_82488_a(EnumFacing p_82488_1_) { + return p_82488_1_.getFrontOffsetX() + 1 + (p_82488_1_.getFrontOffsetZ() + 1) * 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java new file mode 100644 index 0000000..66578d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/BehaviorProjectileDispense.java @@ -0,0 +1,46 @@ +package net.minecraft.dispenser; + +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IProjectile; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public abstract class BehaviorProjectileDispense extends BehaviorDefaultDispenseItem { + + + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + World var3 = p_82487_1_.getWorld(); + IPosition var4 = BlockDispenser.func_149939_a(p_82487_1_); + EnumFacing var5 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + IProjectile var6 = this.getProjectileEntity(var3, var4); + var6.setThrowableHeading(var5.getFrontOffsetX(), (float)var5.getFrontOffsetY() + 0.1F, var5.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a()); + var3.spawnEntityInWorld((Entity)var6); + p_82487_2_.splitStack(1); + return p_82487_2_; + } + + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource p_82485_1_) { + p_82485_1_.getWorld().playAuxSFX(1002, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + + /** + * Return the projectile entity spawned by this dispense behavior. + */ + protected abstract IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_); + + protected float func_82498_a() { + return 6.0F; + } + + protected float func_82500_b() { + return 1.1F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java new file mode 100644 index 0000000..0ae7045 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IBehaviorDispenseItem.java @@ -0,0 +1,17 @@ +package net.minecraft.dispenser; + +import net.minecraft.item.ItemStack; + +public interface IBehaviorDispenseItem { + IBehaviorDispenseItem itemDispenseBehaviorProvider = new IBehaviorDispenseItem() { + + public ItemStack dispense(IBlockSource p_82482_1_, ItemStack p_82482_2_) { + return p_82482_2_; + } + }; + + /** + * Dispenses the specified ItemStack from a dispenser. + */ + ItemStack dispense(IBlockSource p_82482_1_, ItemStack p_82482_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IBlockSource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IBlockSource.java new file mode 100644 index 0000000..dd2a7bf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IBlockSource.java @@ -0,0 +1,21 @@ +package net.minecraft.dispenser; + +import net.minecraft.tileentity.TileEntity; + +public interface IBlockSource extends ILocatableSource { + double getX(); + + double getY(); + + double getZ(); + + int getXInt(); + + int getYInt(); + + int getZInt(); + + int getBlockMetadata(); + + TileEntity getBlockTileEntity(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/ILocatableSource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/ILocatableSource.java new file mode 100644 index 0000000..3fda7d7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/ILocatableSource.java @@ -0,0 +1,4 @@ +package net.minecraft.dispenser; + +public interface ILocatableSource extends ILocation { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/ILocation.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/ILocation.java new file mode 100644 index 0000000..9a607f1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/ILocation.java @@ -0,0 +1,7 @@ +package net.minecraft.dispenser; + +import net.minecraft.world.World; + +public interface ILocation extends IPosition { + World getWorld(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IPosition.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IPosition.java new file mode 100644 index 0000000..167d0ef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/IPosition.java @@ -0,0 +1,9 @@ +package net.minecraft.dispenser; + +public interface IPosition { + double getX(); + + double getY(); + + double getZ(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/PositionImpl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/PositionImpl.java new file mode 100644 index 0000000..9b84a6d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/dispenser/PositionImpl.java @@ -0,0 +1,26 @@ +package net.minecraft.dispenser; + +public class PositionImpl implements IPosition { + protected final double x; + protected final double y; + protected final double z; + + + public PositionImpl(double p_i1368_1_, double p_i1368_3_, double p_i1368_5_) { + this.x = p_i1368_1_; + this.y = p_i1368_3_; + this.z = p_i1368_5_; + } + + public double getX() { + return this.x; + } + + public double getY() { + return this.y; + } + + public double getZ() { + return this.z; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/Enchantment.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/Enchantment.java new file mode 100644 index 0000000..dec432c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/Enchantment.java @@ -0,0 +1,214 @@ +package net.minecraft.enchantment; + +import java.util.ArrayList; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.StatCollector; + +public abstract class Enchantment { + public static final Enchantment[] enchantmentsList = new Enchantment[256]; + + /** The list of enchantments applicable by the anvil from a book */ + public static final Enchantment[] enchantmentsBookList; + + /** Converts environmental damage to armour damage */ + public static final Enchantment protection = new EnchantmentProtection(0, 10, 0); + + /** Protection against fire */ + public static final Enchantment fireProtection = new EnchantmentProtection(1, 5, 1); + + /** Less fall damage */ + public static final Enchantment featherFalling = new EnchantmentProtection(2, 5, 2); + + /** Protection against explosions */ + public static final Enchantment blastProtection = new EnchantmentProtection(3, 2, 3); + + /** Protection against projectile entities (e.g. arrows) */ + public static final Enchantment projectileProtection = new EnchantmentProtection(4, 5, 4); + + /** + * Decreases the rate of air loss underwater; increases time between damage while suffocating + */ + public static final Enchantment respiration = new EnchantmentOxygen(5, 2); + + /** Increases underwater mining rate */ + public static final Enchantment aquaAffinity = new EnchantmentWaterWorker(6, 2); + public static final Enchantment thorns = new EnchantmentThorns(7, 1); + + /** Extra damage to mobs */ + public static final Enchantment sharpness = new EnchantmentDamage(16, 10, 0); + + /** Extra damage to zombies, zombie pigmen and skeletons */ + public static final Enchantment smite = new EnchantmentDamage(17, 5, 1); + + /** Extra damage to spiders, cave spiders and silverfish */ + public static final Enchantment baneOfArthropods = new EnchantmentDamage(18, 5, 2); + + /** Knocks mob and players backwards upon hit */ + public static final Enchantment knockback = new EnchantmentKnockback(19, 5); + + /** Lights mobs on fire */ + public static final Enchantment fireAspect = new EnchantmentFireAspect(20, 2); + + /** Mobs have a chance to drop more loot */ + public static final Enchantment looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon); + + /** Faster resource gathering while in use */ + public static final Enchantment efficiency = new EnchantmentDigging(32, 10); + + /** + * Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not + * cobblestone) + */ + public static final Enchantment silkTouch = new EnchantmentUntouching(33, 1); + + /** + * Sometimes, the tool's durability will not be spent when the tool is used + */ + public static final Enchantment unbreaking = new EnchantmentDurability(34, 5); + + /** Can multiply the drop rate of items from blocks */ + public static final Enchantment fortune = new EnchantmentLootBonus(35, 2, EnumEnchantmentType.digger); + + /** Power enchantment for bows, add's extra damage to arrows. */ + public static final Enchantment power = new EnchantmentArrowDamage(48, 10); + + /** + * Knockback enchantments for bows, the arrows will knockback the target when hit. + */ + public static final Enchantment punch = new EnchantmentArrowKnockback(49, 2); + + /** + * Flame enchantment for bows. Arrows fired by the bow will be on fire. Any target hit will also set on fire. + */ + public static final Enchantment flame = new EnchantmentArrowFire(50, 2); + + /** + * Infinity enchantment for bows. The bow will not consume arrows anymore, but will still required at least one + * arrow on inventory use the bow. + */ + public static final Enchantment infinity = new EnchantmentArrowInfinite(51, 1); + public static final Enchantment field_151370_z = new EnchantmentLootBonus(61, 2, EnumEnchantmentType.fishing_rod); + public static final Enchantment field_151369_A = new EnchantmentFishingSpeed(62, 2, EnumEnchantmentType.fishing_rod); + public final int effectId; + private final int weight; + + /** The EnumEnchantmentType given to this Enchantment. */ + public EnumEnchantmentType type; + + /** Used in localisation and stats. */ + protected String name; + + + protected Enchantment(int p_i1926_1_, int p_i1926_2_, EnumEnchantmentType p_i1926_3_) { + this.effectId = p_i1926_1_; + this.weight = p_i1926_2_; + this.type = p_i1926_3_; + + if (enchantmentsList[p_i1926_1_] != null) { + throw new IllegalArgumentException("Duplicate enchantment id!"); + } else { + enchantmentsList[p_i1926_1_] = this; + } + } + + public int getWeight() { + return this.weight; + } + + /** + * Returns the minimum level that the enchantment can have. + */ + public int getMinLevel() { + return 1; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 1 + p_77321_1_ * 10; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return this.getMinEnchantability(p_77317_1_) + 5; + } + + /** + * Calculates de damage protection of the enchantment based on level and damage source passed. + */ + public int calcModifierDamage(int p_77318_1_, DamageSource p_77318_2_) { + return 0; + } + + public float func_152376_a(int p_152376_1_, EnumCreatureAttribute p_152376_2_) { + return 0.0F; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) { + return this != p_77326_1_; + } + + /** + * Sets the enchantment name + */ + public Enchantment setName(String p_77322_1_) { + this.name = p_77322_1_; + return this; + } + + /** + * Return the name of key in translation table of this enchantment. + */ + public String getName() { + return "enchantment." + this.name; + } + + /** + * Returns the correct traslated name of the enchantment and the level in roman numbers. + */ + public String getTranslatedName(int p_77316_1_) { + String var2 = StatCollector.translateToLocal(this.getName()); + return var2 + " " + StatCollector.translateToLocal("enchantment.level." + p_77316_1_); + } + + public boolean canApply(ItemStack p_92089_1_) { + return this.type.canEnchantItem(p_92089_1_.getItem()); + } + + public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) {} + + public void func_151367_b(EntityLivingBase p_151367_1_, Entity p_151367_2_, int p_151367_3_) {} + + static { + ArrayList var0 = new ArrayList(); + Enchantment[] var1 = enchantmentsList; + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + Enchantment var4 = var1[var3]; + + if (var4 != null) { + var0.add(var4); + } + } + + enchantmentsBookList = (Enchantment[])var0.toArray(new Enchantment[0]); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java new file mode 100644 index 0000000..6809225 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowDamage.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowDamage extends Enchantment { + + + public EnchantmentArrowDamage(int p_i1919_1_, int p_i1919_2_) { + super(p_i1919_1_, p_i1919_2_, EnumEnchantmentType.bow); + this.setName("arrowDamage"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 1 + (p_77321_1_ - 1) * 10; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return this.getMinEnchantability(p_77317_1_) + 15; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 5; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java new file mode 100644 index 0000000..0e210be --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowFire.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowFire extends Enchantment { + + + public EnchantmentArrowFire(int p_i1920_1_, int p_i1920_2_) { + super(p_i1920_1_, p_i1920_2_, EnumEnchantmentType.bow); + this.setName("arrowFire"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 20; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java new file mode 100644 index 0000000..7540477 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowInfinite extends Enchantment { + + + public EnchantmentArrowInfinite(int p_i1921_1_, int p_i1921_2_) { + super(p_i1921_1_, p_i1921_2_, EnumEnchantmentType.bow); + this.setName("arrowInfinite"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 20; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java new file mode 100644 index 0000000..8ce48c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowKnockback extends Enchantment { + + + public EnchantmentArrowKnockback(int p_i1922_1_, int p_i1922_2_) { + super(p_i1922_1_, p_i1922_2_, EnumEnchantmentType.bow); + this.setName("arrowKnockback"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 12 + (p_77321_1_ - 1) * 20; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return this.getMinEnchantability(p_77317_1_) + 25; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java new file mode 100644 index 0000000..3630d83 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDamage.java @@ -0,0 +1,95 @@ +package net.minecraft.enchantment; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +public class EnchantmentDamage extends Enchantment { + /** Holds the name to be translated of each protection type. */ + private static final String[] protectionName = new String[] {"all", "undead", "arthropods"}; + + /** + * Holds the base factor of enchantability needed to be able to use the enchant. + */ + private static final int[] baseEnchantability = new int[] {1, 5, 5}; + + /** + * Holds how much each level increased the enchantability factor to be able to use this enchant. + */ + private static final int[] levelEnchantability = new int[] {11, 8, 8}; + + /** + * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing + * enchant. + */ + private static final int[] thresholdEnchantability = new int[] {20, 20, 20}; + + /** + * Defines the type of damage of the enchantment, 0 = all, 1 = undead, 3 = arthropods + */ + public final int damageType; + + + public EnchantmentDamage(int p_i1923_1_, int p_i1923_2_, int p_i1923_3_) { + super(p_i1923_1_, p_i1923_2_, EnumEnchantmentType.weapon); + this.damageType = p_i1923_3_; + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return baseEnchantability[this.damageType] + (p_77321_1_ - 1) * levelEnchantability[this.damageType]; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return this.getMinEnchantability(p_77317_1_) + thresholdEnchantability[this.damageType]; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 5; + } + + public float func_152376_a(int p_152376_1_, EnumCreatureAttribute p_152376_2_) { + return this.damageType == 0 ? (float)p_152376_1_ * 1.25F : (this.damageType == 1 && p_152376_2_ == EnumCreatureAttribute.UNDEAD ? (float)p_152376_1_ * 2.5F : (this.damageType == 2 && p_152376_2_ == EnumCreatureAttribute.ARTHROPOD ? (float)p_152376_1_ * 2.5F : 0.0F)); + } + + /** + * Return the name of key in translation table of this enchantment. + */ + public String getName() { + return "enchantment.damage." + protectionName[this.damageType]; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) { + return !(p_77326_1_ instanceof EnchantmentDamage); + } + + public boolean canApply(ItemStack p_92089_1_) { + return p_92089_1_.getItem() instanceof ItemAxe || super.canApply(p_92089_1_); + } + + public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) { + if (p_151368_2_ instanceof EntityLivingBase) { + EntityLivingBase var4 = (EntityLivingBase)p_151368_2_; + + if (this.damageType == 2 && var4.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) { + int var5 = 20 + p_151368_1_.getRNG().nextInt(10 * p_151368_3_); + var4.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, var5, 3)); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentData.java new file mode 100644 index 0000000..6d28acb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentData.java @@ -0,0 +1,22 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.WeightedRandom; + +public class EnchantmentData extends WeightedRandom.Item { + /** Enchantment object associated with this EnchantmentData */ + public final Enchantment enchantmentobj; + + /** Enchantment level associated with this EnchantmentData */ + public final int enchantmentLevel; + + + public EnchantmentData(Enchantment p_i1930_1_, int p_i1930_2_) { + super(p_i1930_1_.getWeight()); + this.enchantmentobj = p_i1930_1_; + this.enchantmentLevel = p_i1930_2_; + } + + public EnchantmentData(int p_i1931_1_, int p_i1931_2_) { + this(Enchantment.enchantmentsList[p_i1931_1_], p_i1931_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java new file mode 100644 index 0000000..7fa287e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDigging.java @@ -0,0 +1,38 @@ +package net.minecraft.enchantment; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class EnchantmentDigging extends Enchantment { + + + protected EnchantmentDigging(int p_i1925_1_, int p_i1925_2_) { + super(p_i1925_1_, p_i1925_2_, EnumEnchantmentType.digger); + this.setName("digging"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 1 + 10 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 5; + } + + public boolean canApply(ItemStack p_92089_1_) { + return p_92089_1_.getItem() == Items.shears || super.canApply(p_92089_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java new file mode 100644 index 0000000..72f7f3e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentDurability.java @@ -0,0 +1,48 @@ +package net.minecraft.enchantment; + +import java.util.Random; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; + +public class EnchantmentDurability extends Enchantment { + + + protected EnchantmentDurability(int p_i1924_1_, int p_i1924_2_) { + super(p_i1924_1_, p_i1924_2_, EnumEnchantmentType.breakable); + this.setName("durability"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 5 + (p_77321_1_ - 1) * 8; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } + + public boolean canApply(ItemStack p_92089_1_) { + return p_92089_1_.isItemStackDamageable() || super.canApply(p_92089_1_); + } + + /** + * Used by ItemStack.attemptDamageItem. Randomly determines if a point of damage should be negated using the + * enchantment level (par1). If the ItemStack is Armor then there is a flat 60% chance for damage to be negated no + * matter the enchantment level, otherwise there is a 1-(par/1) chance for damage to be negated. + */ + public static boolean negateDamage(ItemStack p_92097_0_, int p_92097_1_, Random p_92097_2_) { + return (!(p_92097_0_.getItem() instanceof ItemArmor) || !(p_92097_2_.nextFloat() < 0.6F)) && p_92097_2_.nextInt(p_92097_1_ + 1) > 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java new file mode 100644 index 0000000..aea0e43 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentFireAspect.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentFireAspect extends Enchantment { + + + protected EnchantmentFireAspect(int p_i1932_1_, int p_i1932_2_) { + super(p_i1932_1_, p_i1932_2_, EnumEnchantmentType.weapon); + this.setName("fire"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 10 + 20 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java new file mode 100644 index 0000000..7e8e4c4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentFishingSpeed extends Enchantment { + + + protected EnchantmentFishingSpeed(int p_i45361_1_, int p_i45361_2_, EnumEnchantmentType p_i45361_3_) { + super(p_i45361_1_, p_i45361_2_, p_i45361_3_); + this.setName("fishingSpeed"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 15 + (p_77321_1_ - 1) * 9; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java new file mode 100644 index 0000000..086a89a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentHelper.java @@ -0,0 +1,508 @@ +package net.minecraft.enchantment; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.WeightedRandom; + +public class EnchantmentHelper { + /** Is the random seed of enchantment effects. */ + private static final Random enchantmentRand = new Random(); + + /** + * Used to calculate the extra armor of enchantments on armors equipped on player. + */ + private static final EnchantmentHelper.ModifierDamage enchantmentModifierDamage = new EnchantmentHelper.ModifierDamage(null); + + /** + * Used to calculate the (magic) extra damage done by enchantments on current equipped item of player. + */ + private static final EnchantmentHelper.ModifierLiving enchantmentModifierLiving = new EnchantmentHelper.ModifierLiving(null); + private static final EnchantmentHelper.HurtIterator field_151388_d = new EnchantmentHelper.HurtIterator(null); + private static final EnchantmentHelper.DamageIterator field_151389_e = new EnchantmentHelper.DamageIterator(null); + + + /** + * Returns the level of enchantment on the ItemStack passed. + */ + public static int getEnchantmentLevel(int p_77506_0_, ItemStack p_77506_1_) { + if (p_77506_1_ == null) { + return 0; + } else { + NBTTagList var2 = p_77506_1_.getEnchantmentTagList(); + + if (var2 == null) { + return 0; + } else { + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + short var4 = var2.getCompoundTagAt(var3).getShort("id"); + short var5 = var2.getCompoundTagAt(var3).getShort("lvl"); + + if (var4 == p_77506_0_) { + return var5; + } + } + + return 0; + } + } + } + + /** + * Return the enchantments for the specified stack. + */ + public static Map getEnchantments(ItemStack p_82781_0_) { + LinkedHashMap var1 = new LinkedHashMap(); + NBTTagList var2 = p_82781_0_.getItem() == Items.enchanted_book ? Items.enchanted_book.func_92110_g(p_82781_0_) : p_82781_0_.getEnchantmentTagList(); + + if (var2 != null) { + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + short var4 = var2.getCompoundTagAt(var3).getShort("id"); + short var5 = var2.getCompoundTagAt(var3).getShort("lvl"); + var1.put(Integer.valueOf(var4), Integer.valueOf(var5)); + } + } + + return var1; + } + + /** + * Set the enchantments for the specified stack. + */ + public static void setEnchantments(Map p_82782_0_, ItemStack p_82782_1_) { + NBTTagList var2 = new NBTTagList(); + Iterator var3 = p_82782_0_.keySet().iterator(); + + while (var3.hasNext()) { + int var4 = ((Integer)var3.next()).intValue(); + NBTTagCompound var5 = new NBTTagCompound(); + var5.setShort("id", (short)var4); + var5.setShort("lvl", (short)((Integer)p_82782_0_.get(Integer.valueOf(var4))).intValue()); + var2.appendTag(var5); + + if (p_82782_1_.getItem() == Items.enchanted_book) { + Items.enchanted_book.addEnchantment(p_82782_1_, new EnchantmentData(var4, ((Integer)p_82782_0_.get(Integer.valueOf(var4))).intValue())); + } + } + + if (var2.tagCount() > 0) { + if (p_82782_1_.getItem() != Items.enchanted_book) { + p_82782_1_.setTagInfo("ench", var2); + } + } else if (p_82782_1_.hasTagCompound()) { + p_82782_1_.getTagCompound().removeTag("ench"); + } + } + + /** + * Returns the biggest level of the enchantment on the array of ItemStack passed. + */ + public static int getMaxEnchantmentLevel(int p_77511_0_, ItemStack[] p_77511_1_) { + if (p_77511_1_ == null) { + return 0; + } else { + int var2 = 0; + ItemStack[] var3 = p_77511_1_; + int var4 = p_77511_1_.length; + + for (int var5 = 0; var5 < var4; ++var5) { + ItemStack var6 = var3[var5]; + int var7 = getEnchantmentLevel(p_77511_0_, var6); + + if (var7 > var2) { + var2 = var7; + } + } + + return var2; + } + } + + /** + * Executes the enchantment modifier on the ItemStack passed. + */ + private static void applyEnchantmentModifier(EnchantmentHelper.IModifier p_77518_0_, ItemStack p_77518_1_) { + if (p_77518_1_ != null) { + NBTTagList var2 = p_77518_1_.getEnchantmentTagList(); + + if (var2 != null) { + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + short var4 = var2.getCompoundTagAt(var3).getShort("id"); + short var5 = var2.getCompoundTagAt(var3).getShort("lvl"); + + if (Enchantment.enchantmentsList[var4] != null) { + p_77518_0_.calculateModifier(Enchantment.enchantmentsList[var4], var5); + } + } + } + } + } + + /** + * Executes the enchantment modifier on the array of ItemStack passed. + */ + private static void applyEnchantmentModifierArray(EnchantmentHelper.IModifier p_77516_0_, ItemStack[] p_77516_1_) { + ItemStack[] var2 = p_77516_1_; + int var3 = p_77516_1_.length; + + for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; + applyEnchantmentModifier(p_77516_0_, var5); + } + } + + /** + * Returns the modifier of protection enchantments on armors equipped on player. + */ + public static int getEnchantmentModifierDamage(ItemStack[] p_77508_0_, DamageSource p_77508_1_) { + enchantmentModifierDamage.damageModifier = 0; + enchantmentModifierDamage.source = p_77508_1_; + applyEnchantmentModifierArray(enchantmentModifierDamage, p_77508_0_); + + if (enchantmentModifierDamage.damageModifier > 25) { + enchantmentModifierDamage.damageModifier = 25; + } + + return (enchantmentModifierDamage.damageModifier + 1 >> 1) + enchantmentRand.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); + } + + /** + * Return the (magic) extra damage of the enchantments on player equipped item. + */ + public static float getEnchantmentModifierLiving(EntityLivingBase p_77512_0_, EntityLivingBase p_77512_1_) { + return func_152377_a(p_77512_0_.getHeldItem(), p_77512_1_.getCreatureAttribute()); + } + + public static float func_152377_a(ItemStack p_152377_0_, EnumCreatureAttribute p_152377_1_) { + enchantmentModifierLiving.livingModifier = 0.0F; + enchantmentModifierLiving.entityLiving = p_152377_1_; + applyEnchantmentModifier(enchantmentModifierLiving, p_152377_0_); + return enchantmentModifierLiving.livingModifier; + } + + public static void func_151384_a(EntityLivingBase p_151384_0_, Entity p_151384_1_) { + field_151388_d.field_151363_b = p_151384_1_; + field_151388_d.field_151364_a = p_151384_0_; + applyEnchantmentModifierArray(field_151388_d, p_151384_0_.getLastActiveItems()); + + if (p_151384_1_ instanceof EntityPlayer) { + applyEnchantmentModifier(field_151388_d, p_151384_0_.getHeldItem()); + } + } + + public static void func_151385_b(EntityLivingBase p_151385_0_, Entity p_151385_1_) { + field_151389_e.field_151366_a = p_151385_0_; + field_151389_e.field_151365_b = p_151385_1_; + applyEnchantmentModifierArray(field_151389_e, p_151385_0_.getLastActiveItems()); + + if (p_151385_0_ instanceof EntityPlayer) { + applyEnchantmentModifier(field_151389_e, p_151385_0_.getHeldItem()); + } + } + + /** + * Returns the knockback value of enchantments on equipped player item. + */ + public static int getKnockbackModifier(EntityLivingBase p_77507_0_, EntityLivingBase p_77507_1_) { + return getEnchantmentLevel(Enchantment.knockback.effectId, p_77507_0_.getHeldItem()); + } + + public static int getFireAspectModifier(EntityLivingBase p_90036_0_) { + return getEnchantmentLevel(Enchantment.fireAspect.effectId, p_90036_0_.getHeldItem()); + } + + /** + * Returns the 'Water Breathing' modifier of enchantments on player equipped armors. + */ + public static int getRespiration(EntityLivingBase p_77501_0_) { + return getMaxEnchantmentLevel(Enchantment.respiration.effectId, p_77501_0_.getLastActiveItems()); + } + + /** + * Return the extra efficiency of tools based on enchantments on equipped player item. + */ + public static int getEfficiencyModifier(EntityLivingBase p_77509_0_) { + return getEnchantmentLevel(Enchantment.efficiency.effectId, p_77509_0_.getHeldItem()); + } + + /** + * Returns the silk touch status of enchantments on current equipped item of player. + */ + public static boolean getSilkTouchModifier(EntityLivingBase p_77502_0_) { + return getEnchantmentLevel(Enchantment.silkTouch.effectId, p_77502_0_.getHeldItem()) > 0; + } + + /** + * Returns the fortune enchantment modifier of the current equipped item of player. + */ + public static int getFortuneModifier(EntityLivingBase p_77517_0_) { + return getEnchantmentLevel(Enchantment.fortune.effectId, p_77517_0_.getHeldItem()); + } + + public static int func_151386_g(EntityLivingBase p_151386_0_) { + return getEnchantmentLevel(Enchantment.field_151370_z.effectId, p_151386_0_.getHeldItem()); + } + + public static int func_151387_h(EntityLivingBase p_151387_0_) { + return getEnchantmentLevel(Enchantment.field_151369_A.effectId, p_151387_0_.getHeldItem()); + } + + /** + * Returns the looting enchantment modifier of the current equipped item of player. + */ + public static int getLootingModifier(EntityLivingBase p_77519_0_) { + return getEnchantmentLevel(Enchantment.looting.effectId, p_77519_0_.getHeldItem()); + } + + /** + * Returns the aqua affinity status of enchantments on current equipped item of player. + */ + public static boolean getAquaAffinityModifier(EntityLivingBase p_77510_0_) { + return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, p_77510_0_.getLastActiveItems()) > 0; + } + + public static ItemStack func_92099_a(Enchantment p_92099_0_, EntityLivingBase p_92099_1_) { + ItemStack[] var2 = p_92099_1_.getLastActiveItems(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; + + if (var5 != null && getEnchantmentLevel(p_92099_0_.effectId, var5) > 0) { + return var5; + } + } + + return null; + } + + /** + * Returns the enchantability of itemstack, it's uses a singular formula for each index (2nd parameter: 0, 1 and 2), + * cutting to the max enchantability power of the table (3rd parameter) + */ + public static int calcItemStackEnchantability(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) { + Item var4 = p_77514_3_.getItem(); + int var5 = var4.getItemEnchantability(); + + if (var5 <= 0) { + return 0; + } else { + if (p_77514_2_ > 15) { + p_77514_2_ = 15; + } + + int var6 = p_77514_0_.nextInt(8) + 1 + (p_77514_2_ >> 1) + p_77514_0_.nextInt(p_77514_2_ + 1); + return p_77514_1_ == 0 ? Math.max(var6 / 3, 1) : (p_77514_1_ == 1 ? var6 * 2 / 3 + 1 : Math.max(var6, p_77514_2_ * 2)); + } + } + + /** + * Adds a random enchantment to the specified item. Args: random, itemStack, enchantabilityLevel + */ + public static ItemStack addRandomEnchantment(Random p_77504_0_, ItemStack p_77504_1_, int p_77504_2_) { + List var3 = buildEnchantmentList(p_77504_0_, p_77504_1_, p_77504_2_); + boolean var4 = p_77504_1_.getItem() == Items.book; + + if (var4) { + p_77504_1_.func_150996_a(Items.enchanted_book); + } + + if (var3 != null) { + Iterator var5 = var3.iterator(); + + while (var5.hasNext()) { + EnchantmentData var6 = (EnchantmentData)var5.next(); + + if (var4) { + Items.enchanted_book.addEnchantment(p_77504_1_, var6); + } else { + p_77504_1_.addEnchantment(var6.enchantmentobj, var6.enchantmentLevel); + } + } + } + + return p_77504_1_; + } + + /** + * Create a list of random EnchantmentData (enchantments) that can be added together to the ItemStack, the 3rd + * parameter is the total enchantability level. + */ + public static List buildEnchantmentList(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_) { + Item var3 = p_77513_1_.getItem(); + int var4 = var3.getItemEnchantability(); + + if (var4 <= 0) { + return null; + } else { + var4 /= 2; + var4 = 1 + p_77513_0_.nextInt((var4 >> 1) + 1) + p_77513_0_.nextInt((var4 >> 1) + 1); + int var5 = var4 + p_77513_2_; + float var6 = (p_77513_0_.nextFloat() + p_77513_0_.nextFloat() - 1.0F) * 0.15F; + int var7 = (int)((float)var5 * (1.0F + var6) + 0.5F); + + if (var7 < 1) { + var7 = 1; + } + + ArrayList var8 = null; + Map var9 = mapEnchantmentData(var7, p_77513_1_); + + if (var9 != null && !var9.isEmpty()) { + EnchantmentData var10 = (EnchantmentData)WeightedRandom.getRandomItem(p_77513_0_, var9.values()); + + if (var10 != null) { + var8 = new ArrayList(); + var8.add(var10); + + for (int var11 = var7; p_77513_0_.nextInt(50) <= var11; var11 >>= 1) { + Iterator var12 = var9.keySet().iterator(); + + while (var12.hasNext()) { + Integer var13 = (Integer)var12.next(); + boolean var14 = true; + Iterator var15 = var8.iterator(); + + while (true) { + if (var15.hasNext()) { + EnchantmentData var16 = (EnchantmentData)var15.next(); + + if (var16.enchantmentobj.canApplyTogether(Enchantment.enchantmentsList[var13.intValue()])) { + continue; + } + + var14 = false; + } + + if (!var14) { + var12.remove(); + } + + break; + } + } + + if (!var9.isEmpty()) { + EnchantmentData var17 = (EnchantmentData)WeightedRandom.getRandomItem(p_77513_0_, var9.values()); + var8.add(var17); + } + } + } + } + + return var8; + } + } + + /** + * Creates a 'Map' of EnchantmentData (enchantments) possible to add on the ItemStack and the enchantability level + * passed. + */ + public static Map mapEnchantmentData(int p_77505_0_, ItemStack p_77505_1_) { + Item var2 = p_77505_1_.getItem(); + HashMap var3 = null; + boolean var4 = p_77505_1_.getItem() == Items.book; + Enchantment[] var5 = Enchantment.enchantmentsList; + int var6 = var5.length; + + for (int var7 = 0; var7 < var6; ++var7) { + Enchantment var8 = var5[var7]; + + if (var8 != null && (var8.type.canEnchantItem(var2) || var4)) { + for (int var9 = var8.getMinLevel(); var9 <= var8.getMaxLevel(); ++var9) { + if (p_77505_0_ >= var8.getMinEnchantability(var9) && p_77505_0_ <= var8.getMaxEnchantability(var9)) { + if (var3 == null) { + var3 = new HashMap(); + } + + var3.put(Integer.valueOf(var8.effectId), new EnchantmentData(var8, var9)); + } + } + } + } + + return var3; + } + + static final class DamageIterator implements EnchantmentHelper.IModifier { + public EntityLivingBase field_151366_a; + public Entity field_151365_b; + + + private DamageIterator() {} + + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) { + p_77493_1_.func_151368_a(this.field_151366_a, this.field_151365_b, p_77493_2_); + } + + DamageIterator(Object p_i45359_1_) { + this(); + } + } + + static final class HurtIterator implements EnchantmentHelper.IModifier { + public EntityLivingBase field_151364_a; + public Entity field_151363_b; + + + private HurtIterator() {} + + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) { + p_77493_1_.func_151367_b(this.field_151364_a, this.field_151363_b, p_77493_2_); + } + + HurtIterator(Object p_i45360_1_) { + this(); + } + } + + interface IModifier { + void calculateModifier(Enchantment p_77493_1_, int p_77493_2_); + } + + static final class ModifierDamage implements EnchantmentHelper.IModifier { + public int damageModifier; + public DamageSource source; + + + private ModifierDamage() {} + + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) { + this.damageModifier += p_77493_1_.calcModifierDamage(p_77493_2_, this.source); + } + + ModifierDamage(Object p_i1929_1_) { + this(); + } + } + + static final class ModifierLiving implements EnchantmentHelper.IModifier { + public float livingModifier; + public EnumCreatureAttribute entityLiving; + + + private ModifierLiving() {} + + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) { + this.livingModifier += p_77493_1_.func_152376_a(p_77493_2_, this.entityLiving); + } + + ModifierLiving(Object p_i1928_1_) { + this(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java new file mode 100644 index 0000000..2620bbb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentKnockback.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentKnockback extends Enchantment { + + + protected EnchantmentKnockback(int p_i1933_1_, int p_i1933_2_) { + super(p_i1933_1_, p_i1933_2_, EnumEnchantmentType.weapon); + this.setName("knockback"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 5 + 20 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java new file mode 100644 index 0000000..fe03967 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentLootBonus.java @@ -0,0 +1,45 @@ +package net.minecraft.enchantment; + +public class EnchantmentLootBonus extends Enchantment { + + + protected EnchantmentLootBonus(int p_i1934_1_, int p_i1934_2_, EnumEnchantmentType p_i1934_3_) { + super(p_i1934_1_, p_i1934_2_, p_i1934_3_); + + if (p_i1934_3_ == EnumEnchantmentType.digger) { + this.setName("lootBonusDigger"); + } else if (p_i1934_3_ == EnumEnchantmentType.fishing_rod) { + this.setName("lootBonusFishing"); + } else { + this.setName("lootBonus"); + } + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 15 + (p_77321_1_ - 1) * 9; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) { + return super.canApplyTogether(p_77326_1_) && p_77326_1_.effectId != silkTouch.effectId; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java new file mode 100644 index 0000000..701dff1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentOxygen.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentOxygen extends Enchantment { + + + public EnchantmentOxygen(int p_i1935_1_, int p_i1935_2_) { + super(p_i1935_1_, p_i1935_2_, EnumEnchantmentType.armor_head); + this.setName("oxygen"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 10 * p_77321_1_; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return this.getMinEnchantability(p_77317_1_) + 30; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java new file mode 100644 index 0000000..2343d94 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentProtection.java @@ -0,0 +1,117 @@ +package net.minecraft.enchantment; + +import net.minecraft.entity.Entity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; + +public class EnchantmentProtection extends Enchantment { + /** Holds the name to be translated of each protection type. */ + private static final String[] protectionName = new String[] {"all", "fire", "fall", "explosion", "projectile"}; + + /** + * Holds the base factor of enchantability needed to be able to use the enchant. + */ + private static final int[] baseEnchantability = new int[] {1, 10, 5, 5, 3}; + + /** + * Holds how much each level increased the enchantability factor to be able to use this enchant. + */ + private static final int[] levelEnchantability = new int[] {11, 8, 6, 8, 6}; + + /** + * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing + * enchant. + */ + private static final int[] thresholdEnchantability = new int[] {20, 12, 10, 12, 15}; + + /** + * Defines the type of protection of the enchantment, 0 = all, 1 = fire, 2 = fall (feather fall), 3 = explosion and + * 4 = projectile. + */ + public final int protectionType; + + + public EnchantmentProtection(int p_i1936_1_, int p_i1936_2_, int p_i1936_3_) { + super(p_i1936_1_, p_i1936_2_, EnumEnchantmentType.armor); + this.protectionType = p_i1936_3_; + + if (p_i1936_3_ == 2) { + this.type = EnumEnchantmentType.armor_feet; + } + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return baseEnchantability[this.protectionType] + (p_77321_1_ - 1) * levelEnchantability[this.protectionType]; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return this.getMinEnchantability(p_77317_1_) + thresholdEnchantability[this.protectionType]; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 4; + } + + /** + * Calculates de damage protection of the enchantment based on level and damage source passed. + */ + public int calcModifierDamage(int p_77318_1_, DamageSource p_77318_2_) { + if (p_77318_2_.canHarmInCreative()) { + return 0; + } else { + float var3 = (float)(6 + p_77318_1_ * p_77318_1_) / 3.0F; + return this.protectionType == 0 ? MathHelper.floor_float(var3 * 0.75F) : (this.protectionType == 1 && p_77318_2_.isFireDamage() ? MathHelper.floor_float(var3 * 1.25F) : (this.protectionType == 2 && p_77318_2_ == DamageSource.fall ? MathHelper.floor_float(var3 * 2.5F) : (this.protectionType == 3 && p_77318_2_.isExplosion() ? MathHelper.floor_float(var3 * 1.5F) : (this.protectionType == 4 && p_77318_2_.isProjectile() ? MathHelper.floor_float(var3 * 1.5F) : 0)))); + } + } + + /** + * Return the name of key in translation table of this enchantment. + */ + public String getName() { + return "enchantment.protect." + protectionName[this.protectionType]; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) { + if (p_77326_1_ instanceof EnchantmentProtection) { + EnchantmentProtection var2 = (EnchantmentProtection)p_77326_1_; + return var2.protectionType != this.protectionType && (this.protectionType == 2 || var2.protectionType == 2); + } else { + return super.canApplyTogether(p_77326_1_); + } + } + + /** + * Gets the amount of ticks an entity should be set fire, adjusted for fire protection. + */ + public static int getFireTimeForEntity(Entity p_92093_0_, int p_92093_1_) { + int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, p_92093_0_.getLastActiveItems()); + + if (var2 > 0) { + p_92093_1_ -= MathHelper.floor_float((float)p_92093_1_ * (float)var2 * 0.15F); + } + + return p_92093_1_; + } + + public static double func_92092_a(Entity p_92092_0_, double p_92092_1_) { + int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, p_92092_0_.getLastActiveItems()); + + if (var3 > 0) { + p_92092_1_ -= MathHelper.floor_double(p_92092_1_ * (double)((float)var3 * 0.15F)); + } + + return p_92092_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java new file mode 100644 index 0000000..3863cca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentThorns.java @@ -0,0 +1,66 @@ +package net.minecraft.enchantment; + +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; + +public class EnchantmentThorns extends Enchantment { + + + public EnchantmentThorns(int p_i1937_1_, int p_i1937_2_) { + super(p_i1937_1_, p_i1937_2_, EnumEnchantmentType.armor_torso); + this.setName("thorns"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 10 + 20 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 3; + } + + public boolean canApply(ItemStack p_92089_1_) { + return p_92089_1_.getItem() instanceof ItemArmor || super.canApply(p_92089_1_); + } + + public void func_151367_b(EntityLivingBase p_151367_1_, Entity p_151367_2_, int p_151367_3_) { + Random var4 = p_151367_1_.getRNG(); + ItemStack var5 = EnchantmentHelper.func_92099_a(Enchantment.thorns, p_151367_1_); + + if (func_92094_a(p_151367_3_, var4)) { + p_151367_2_.attackEntityFrom(DamageSource.causeThornsDamage(p_151367_1_), (float)func_92095_b(p_151367_3_, var4)); + p_151367_2_.playSound("damage.thorns", 0.5F, 1.0F); + + if (var5 != null) { + var5.damageItem(3, p_151367_1_); + } + } else if (var5 != null) { + var5.damageItem(1, p_151367_1_); + } + } + + public static boolean func_92094_a(int p_92094_0_, Random p_92094_1_) { + return p_92094_0_ > 0 && p_92094_1_.nextFloat() < 0.15F * (float) p_92094_0_; + } + + public static int func_92095_b(int p_92095_0_, Random p_92095_1_) { + return p_92095_0_ > 10 ? p_92095_0_ - 10 : 1 + p_92095_1_.nextInt(4); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java new file mode 100644 index 0000000..3465f8b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java @@ -0,0 +1,45 @@ +package net.minecraft.enchantment; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class EnchantmentUntouching extends Enchantment { + + + protected EnchantmentUntouching(int p_i1938_1_, int p_i1938_2_) { + super(p_i1938_1_, p_i1938_2_, EnumEnchantmentType.digger); + this.setName("untouching"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 15; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) { + return super.canApplyTogether(p_77326_1_) && p_77326_1_.effectId != fortune.effectId; + } + + public boolean canApply(ItemStack p_92089_1_) { + return p_92089_1_.getItem() == Items.shears || super.canApply(p_92089_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java new file mode 100644 index 0000000..1cdab13 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnchantmentWaterWorker.java @@ -0,0 +1,31 @@ +package net.minecraft.enchantment; + +public class EnchantmentWaterWorker extends Enchantment { + + + public EnchantmentWaterWorker(int p_i1939_1_, int p_i1939_2_) { + super(p_i1939_1_, p_i1939_2_, EnumEnchantmentType.armor_head); + this.setName("waterWorker"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) { + return 1; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) { + return this.getMinEnchantability(p_77317_1_) + 40; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java new file mode 100644 index 0000000..e99e218 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/enchantment/EnumEnchantmentType.java @@ -0,0 +1,43 @@ +package net.minecraft.enchantment; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemFishingRod; +import net.minecraft.item.ItemSword; +import net.minecraft.item.ItemTool; + +public enum EnumEnchantmentType { + all, + armor, + armor_feet, + armor_legs, + armor_torso, + armor_head, + weapon, + digger, + fishing_rod, + breakable, + bow; + + + /** + * Return true if the item passed can be enchanted by a enchantment of this type. + */ + public boolean canEnchantItem(Item p_77557_1_) { + if (this == all) { + return true; + } else if (this == breakable && p_77557_1_.isDamageable()) { + return true; + } else if (p_77557_1_ instanceof ItemArmor) { + if (this == armor) { + return true; + } else { + ItemArmor var2 = (ItemArmor)p_77557_1_; + return var2.armorType == 0 ? this == armor_head : (var2.armorType == 2 ? this == armor_legs : (var2.armorType == 1 ? this == armor_torso : (var2.armorType == 3 && this == armor_feet))); + } + } else { + return p_77557_1_ instanceof ItemSword ? this == weapon : (p_77557_1_ instanceof ItemTool ? this == digger : (p_77557_1_ instanceof ItemBow ? this == bow : (p_77557_1_ instanceof ItemFishingRod && this == fishing_rod))); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/DataWatcher.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/DataWatcher.java new file mode 100644 index 0000000..2a5400f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/DataWatcher.java @@ -0,0 +1,393 @@ +package net.minecraft.entity; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ReportedException; +import org.apache.commons.lang3.ObjectUtils; + +public class DataWatcher { + private final Entity field_151511_a; + + /** When isBlank is true the DataWatcher is not watching any objects */ + private boolean isBlank = true; + private static final HashMap dataTypes = new HashMap(); + private final Map watchedObjects = new HashMap(); + + /** true if one or more object was changed */ + private boolean objectChanged; + private final ReadWriteLock lock = new ReentrantReadWriteLock(); + + + public DataWatcher(Entity p_i45313_1_) { + this.field_151511_a = p_i45313_1_; + } + + /** + * adds a new object to dataWatcher to watch, to update an already existing object see updateObject. Arguments: data + * Value Id, Object to add + */ + public void addObject(int p_75682_1_, Object p_75682_2_) { + Integer var3 = (Integer)dataTypes.get(p_75682_2_.getClass()); + + if (var3 == null) { + throw new IllegalArgumentException("Unknown data type: " + p_75682_2_.getClass()); + } else if (p_75682_1_ > 31) { + throw new IllegalArgumentException("Data value id is too big with " + p_75682_1_ + "! (Max is " + 31 + ")"); + } else if (this.watchedObjects.containsKey(Integer.valueOf(p_75682_1_))) { + throw new IllegalArgumentException("Duplicate id value for " + p_75682_1_ + "!"); + } else { + DataWatcher.WatchableObject var4 = new DataWatcher.WatchableObject(var3.intValue(), p_75682_1_, p_75682_2_); + this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(p_75682_1_), var4); + this.lock.writeLock().unlock(); + this.isBlank = false; + } + } + + /** + * Add a new object for the DataWatcher to watch, using the specified data type. + */ + public void addObjectByDataType(int p_82709_1_, int p_82709_2_) { + DataWatcher.WatchableObject var3 = new DataWatcher.WatchableObject(p_82709_2_, p_82709_1_, null); + this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(p_82709_1_), var3); + this.lock.writeLock().unlock(); + this.isBlank = false; + } + + /** + * gets the bytevalue of a watchable object + */ + public byte getWatchableObjectByte(int p_75683_1_) { + return ((Byte)this.getWatchedObject(p_75683_1_).getObject()).byteValue(); + } + + public short getWatchableObjectShort(int p_75693_1_) { + return ((Short)this.getWatchedObject(p_75693_1_).getObject()).shortValue(); + } + + /** + * gets a watchable object and returns it as a Integer + */ + public int getWatchableObjectInt(int p_75679_1_) { + return ((Integer)this.getWatchedObject(p_75679_1_).getObject()).intValue(); + } + + public float getWatchableObjectFloat(int p_111145_1_) { + return ((Float)this.getWatchedObject(p_111145_1_).getObject()).floatValue(); + } + + /** + * gets a watchable object and returns it as a String + */ + public String getWatchableObjectString(int p_75681_1_) { + return (String)this.getWatchedObject(p_75681_1_).getObject(); + } + + /** + * Get a watchable object as an ItemStack. + */ + public ItemStack getWatchableObjectItemStack(int p_82710_1_) { + return (ItemStack)this.getWatchedObject(p_82710_1_).getObject(); + } + + /** + * is threadsafe, unless it throws an exception, then + */ + private DataWatcher.WatchableObject getWatchedObject(int p_75691_1_) { + this.lock.readLock().lock(); + DataWatcher.WatchableObject var2; + + try { + var2 = (DataWatcher.WatchableObject)this.watchedObjects.get(Integer.valueOf(p_75691_1_)); + } catch (Throwable var6) { + CrashReport var4 = CrashReport.makeCrashReport(var6, "Getting synched entity data"); + CrashReportCategory var5 = var4.makeCategory("Synched entity data"); + var5.addCrashSection("Data ID", Integer.valueOf(p_75691_1_)); + throw new ReportedException(var4); + } + + this.lock.readLock().unlock(); + return var2; + } + + /** + * updates an already existing object + */ + public void updateObject(int p_75692_1_, Object p_75692_2_) { + DataWatcher.WatchableObject var3 = this.getWatchedObject(p_75692_1_); + + if (ObjectUtils.notEqual(p_75692_2_, var3.getObject())) { + var3.setObject(p_75692_2_); + this.field_151511_a.func_145781_i(p_75692_1_); + var3.setWatched(true); + this.objectChanged = true; + } + } + + public void setObjectWatched(int p_82708_1_) { + this.getWatchedObject(p_82708_1_).watched = true; + this.objectChanged = true; + } + + public boolean hasChanges() { + return this.objectChanged; + } + + /** + * Writes the list of watched objects (entity attribute of type {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) to the specified PacketBuffer + */ + public static void writeWatchedListToPacketBuffer(List p_151507_0_, PacketBuffer p_151507_1_) throws IOException { + if (p_151507_0_ != null) { + Iterator var2 = p_151507_0_.iterator(); + + while (var2.hasNext()) { + DataWatcher.WatchableObject var3 = (DataWatcher.WatchableObject)var2.next(); + writeWatchableObjectToPacketBuffer(p_151507_1_, var3); + } + } + + p_151507_1_.writeByte(127); + } + + public List getChanged() { + ArrayList var1 = null; + + if (this.objectChanged) { + this.lock.readLock().lock(); + Iterator var2 = this.watchedObjects.values().iterator(); + + while (var2.hasNext()) { + DataWatcher.WatchableObject var3 = (DataWatcher.WatchableObject)var2.next(); + + if (var3.isWatched()) { + var3.setWatched(false); + + if (var1 == null) { + var1 = new ArrayList(); + } + + var1.add(var3); + } + } + + this.lock.readLock().unlock(); + } + + this.objectChanged = false; + return var1; + } + + public void func_151509_a(PacketBuffer p_151509_1_) throws IOException { + this.lock.readLock().lock(); + Iterator var2 = this.watchedObjects.values().iterator(); + + while (var2.hasNext()) { + DataWatcher.WatchableObject var3 = (DataWatcher.WatchableObject)var2.next(); + writeWatchableObjectToPacketBuffer(p_151509_1_, var3); + } + + this.lock.readLock().unlock(); + p_151509_1_.writeByte(127); + } + + public List getAllWatched() { + ArrayList var1 = null; + this.lock.readLock().lock(); + DataWatcher.WatchableObject var3; + + for (Iterator var2 = this.watchedObjects.values().iterator(); var2.hasNext(); var1.add(var3)) { + var3 = (DataWatcher.WatchableObject)var2.next(); + + if (var1 == null) { + var1 = new ArrayList(); + } + } + + this.lock.readLock().unlock(); + return var1; + } + + /** + * Writes a watchable object (entity attribute of type {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) to the specified PacketBuffer + */ + private static void writeWatchableObjectToPacketBuffer(PacketBuffer p_151510_0_, DataWatcher.WatchableObject p_151510_1_) throws IOException { + int var2 = (p_151510_1_.getObjectType() << 5 | p_151510_1_.getDataValueId() & 31) & 255; + p_151510_0_.writeByte(var2); + + switch (p_151510_1_.getObjectType()) { + case 0: + p_151510_0_.writeByte(((Byte)p_151510_1_.getObject()).byteValue()); + break; + + case 1: + p_151510_0_.writeShort(((Short)p_151510_1_.getObject()).shortValue()); + break; + + case 2: + p_151510_0_.writeInt(((Integer)p_151510_1_.getObject()).intValue()); + break; + + case 3: + p_151510_0_.writeFloat(((Float)p_151510_1_.getObject()).floatValue()); + break; + + case 4: + p_151510_0_.writeStringToBuffer((String)p_151510_1_.getObject()); + break; + + case 5: + ItemStack var4 = (ItemStack)p_151510_1_.getObject(); + p_151510_0_.writeItemStackToBuffer(var4); + break; + + case 6: + ChunkCoordinates var3 = (ChunkCoordinates)p_151510_1_.getObject(); + p_151510_0_.writeInt(var3.posX); + p_151510_0_.writeInt(var3.posY); + p_151510_0_.writeInt(var3.posZ); + } + } + + /** + * Reads a list of watched objects (entity attribute of type {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) from the supplied PacketBuffer + */ + public static List readWatchedListFromPacketBuffer(PacketBuffer p_151508_0_) throws IOException { + ArrayList var1 = null; + + for (byte var2 = p_151508_0_.readByte(); var2 != 127; var2 = p_151508_0_.readByte()) { + if (var1 == null) { + var1 = new ArrayList(); + } + + int var3 = (var2 & 224) >> 5; + int var4 = var2 & 31; + DataWatcher.WatchableObject var5 = null; + + switch (var3) { + case 0: + var5 = new DataWatcher.WatchableObject(var3, var4, Byte.valueOf(p_151508_0_.readByte())); + break; + + case 1: + var5 = new DataWatcher.WatchableObject(var3, var4, Short.valueOf(p_151508_0_.readShort())); + break; + + case 2: + var5 = new DataWatcher.WatchableObject(var3, var4, Integer.valueOf(p_151508_0_.readInt())); + break; + + case 3: + var5 = new DataWatcher.WatchableObject(var3, var4, Float.valueOf(p_151508_0_.readFloat())); + break; + + case 4: + var5 = new DataWatcher.WatchableObject(var3, var4, p_151508_0_.readStringFromBuffer(32767)); + break; + + case 5: + var5 = new DataWatcher.WatchableObject(var3, var4, p_151508_0_.readItemStackFromBuffer()); + break; + + case 6: + int var6 = p_151508_0_.readInt(); + int var7 = p_151508_0_.readInt(); + int var8 = p_151508_0_.readInt(); + var5 = new DataWatcher.WatchableObject(var3, var4, new ChunkCoordinates(var6, var7, var8)); + } + + var1.add(var5); + } + + return var1; + } + + public void updateWatchedObjectsFromList(List p_75687_1_) { + this.lock.writeLock().lock(); + Iterator var2 = p_75687_1_.iterator(); + + while (var2.hasNext()) { + DataWatcher.WatchableObject var3 = (DataWatcher.WatchableObject)var2.next(); + DataWatcher.WatchableObject var4 = (DataWatcher.WatchableObject)this.watchedObjects.get(Integer.valueOf(var3.getDataValueId())); + + if (var4 != null) { + var4.setObject(var3.getObject()); + this.field_151511_a.func_145781_i(var3.getDataValueId()); + } + } + + this.lock.writeLock().unlock(); + this.objectChanged = true; + } + + public boolean getIsBlank() { + return this.isBlank; + } + + public void func_111144_e() { + this.objectChanged = false; + } + + static { + dataTypes.put(Byte.class, Integer.valueOf(0)); + dataTypes.put(Short.class, Integer.valueOf(1)); + dataTypes.put(Integer.class, Integer.valueOf(2)); + dataTypes.put(Float.class, Integer.valueOf(3)); + dataTypes.put(String.class, Integer.valueOf(4)); + dataTypes.put(ItemStack.class, Integer.valueOf(5)); + dataTypes.put(ChunkCoordinates.class, Integer.valueOf(6)); + } + + public static class WatchableObject { + private final int objectType; + private final int dataValueId; + private Object watchedObject; + private boolean watched; + + + public WatchableObject(int p_i1603_1_, int p_i1603_2_, Object p_i1603_3_) { + this.dataValueId = p_i1603_2_; + this.watchedObject = p_i1603_3_; + this.objectType = p_i1603_1_; + this.watched = true; + } + + public int getDataValueId() { + return this.dataValueId; + } + + public void setObject(Object p_75673_1_) { + this.watchedObject = p_75673_1_; + } + + public Object getObject() { + return this.watchedObject; + } + + public int getObjectType() { + return this.objectType; + } + + public boolean isWatched() { + return this.watched; + } + + public void setWatched(boolean p_75671_1_) { + this.watched = p_75671_1_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/Entity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/Entity.java new file mode 100644 index 0000000..c0ad369 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/Entity.java @@ -0,0 +1,2197 @@ +package net.minecraft.entity; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleParticles; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.enchantment.EnchantmentProtection; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.*; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.Callable; + +public abstract class Entity { + private static int nextEntityID; + private int field_145783_c; + public double renderDistanceWeight; + + /** + * Blocks entities from spawning when they do their AABB check to make sure the spot is clear of entities that can + * prevent spawning. + */ + public boolean preventEntitySpawning; + + /** The entity that is riding this entity */ + public Entity riddenByEntity; + + /** The entity we are currently riding */ + public Entity ridingEntity; + public boolean forceSpawn; + + /** Reference to the World object. */ + public World worldObj; + public double prevPosX; + public double prevPosY; + public double prevPosZ; + + /** Entity position X */ + public double posX; + + /** Entity position Y */ + public double posY; + + /** Entity position Z */ + public double posZ; + + /** Entity motion X */ + public double motionX; + + /** Entity motion Y */ + public double motionY; + + /** Entity motion Z */ + public double motionZ; + + /** Entity rotation Yaw */ + public float rotationYaw; + + /** Entity rotation Pitch */ + public float rotationPitch; + public float prevRotationYaw; + public float prevRotationPitch; + + /** Axis aligned bounding box. */ + public final AxisAlignedBB boundingBox; + public boolean onGround; + + /** + * True if after a move this entity has collided with something on X- or Z-axis + */ + public boolean isCollidedHorizontally; + + /** + * True if after a move this entity has collided with something on Y-axis + */ + public boolean isCollidedVertically; + + /** + * True if after a move this entity has collided with something either vertically or horizontally + */ + public boolean isCollided; + public boolean velocityChanged; + protected boolean isInWeb; + public boolean field_70135_K; + + /** + * Gets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term) + */ + public boolean isDead; + public float yOffset; + + /** How wide this entity is considered to be */ + public float width; + + /** How high this entity is considered to be */ + public float height; + + /** The previous ticks distance walked multiplied by 0.6 */ + public float prevDistanceWalkedModified; + + /** The distance walked multiplied by 0.6 */ + public float distanceWalkedModified; + public float distanceWalkedOnStepModified; + public float fallDistance; + + /** + * The distance that has to be exceeded in order to triger a new step sound and an onEntityWalking event on a block + */ + private int nextStepDistance; + + /** + * The entity's X coordinate at the previous tick, used to calculate position during rendering routines + */ + public double lastTickPosX; + + /** + * The entity's Y coordinate at the previous tick, used to calculate position during rendering routines + */ + public double lastTickPosY; + + /** + * The entity's Z coordinate at the previous tick, used to calculate position during rendering routines + */ + public double lastTickPosZ; + public float ySize; + + /** + * How high this entity can step up when running into a block to try to get over it (currently make note the entity + * will always step up this amount and not just the amount needed) + */ + public float stepHeight; + + /** + * Whether this entity won't clip with collision or not (make note it won't disable gravity) + */ + public boolean noClip; + + /** + * Reduces the velocity applied by entity collisions by the specified percent. + */ + public float entityCollisionReduction; + protected Random rand; + + /** How many ticks has this entity had ran since being alive */ + public int ticksExisted; + + /** + * The amount of ticks you have to stand inside of fire before be set on fire + */ + public int fireResistance; + private int fire; + + /** + * Whether this entity is currently inside of water (if it handles water movement that is) + */ + protected boolean inWater; + + /** + * Remaining time an entity will be "immune" to further damage after being hurt. + */ + public int hurtResistantTime; + private boolean firstUpdate; + protected boolean isImmuneToFire; + protected DataWatcher dataWatcher; + private double entityRiderPitchDelta; + private double entityRiderYawDelta; + + /** Has this entity been added to the chunk its within */ + public boolean addedToChunk; + public int chunkCoordX; + public int chunkCoordY; + public int chunkCoordZ; + public int serverPosX; + public int serverPosY; + public int serverPosZ; + + /** + * Render entity even if it is outside the camera frustum. Only true in EntityFish for now. Used in RenderGlobal: + * render if ignoreFrustumCheck or in frustum. + */ + public boolean ignoreFrustumCheck; + public boolean isAirBorne; + public int timeUntilPortal; + + /** Whether the entity is inside a Portal */ + protected boolean inPortal; + protected int portalCounter; + + /** Which dimension the player is in (-1 = the Nether, 0 = normal world) */ + public int dimension; + protected int teleportDirection; + private boolean invulnerable; + protected UUID entityUniqueID; + public Entity.EnumEntitySize myEntitySize; + + + public int getEntityId() { + return this.field_145783_c; + } + + public void setEntityId(int p_145769_1_) { + this.field_145783_c = p_145769_1_; + } + + public Entity(World p_i1582_1_) { + this.field_145783_c = nextEntityID++; + this.renderDistanceWeight = 1.0D; + this.boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + this.field_70135_K = true; + this.width = 0.6F; + this.height = 1.8F; + this.nextStepDistance = 1; + this.rand = new Random(); + this.fireResistance = 1; + this.firstUpdate = true; + this.entityUniqueID = UUID.randomUUID(); + this.myEntitySize = Entity.EnumEntitySize.SIZE_2; + this.worldObj = p_i1582_1_; + this.setPosition(0.0D, 0.0D, 0.0D); + + if (p_i1582_1_ != null) { + this.dimension = p_i1582_1_.provider.dimensionId; + } + + this.dataWatcher = new DataWatcher(this); + this.dataWatcher.addObject(0, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(1, Short.valueOf((short)300)); + this.entityInit(); + } + + protected abstract void entityInit(); + + public DataWatcher getDataWatcher() { + return this.dataWatcher; + } + + public boolean equals(Object p_equals_1_) { + return p_equals_1_ instanceof Entity && ((Entity) p_equals_1_).field_145783_c == this.field_145783_c; + } + + public int hashCode() { + return this.field_145783_c; + } + + /** + * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned + * (only actually used on players though its also on Entity) + */ + protected void preparePlayerToSpawn() { + if (this.worldObj != null) { + while (this.posY > 0.0D) { + this.setPosition(this.posX, this.posY, this.posZ); + + if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { + break; + } + + ++this.posY; + } + + this.motionX = this.motionY = this.motionZ = 0.0D; + this.rotationPitch = 0.0F; + } + } + + /** + * Will get destroyed next tick. + */ + public void setDead() { + this.isDead = true; + } + + /** + * Sets the width and height of the entity. Args: width, height + */ + protected void setSize(float p_70105_1_, float p_70105_2_) { + float var3; + + if (p_70105_1_ != this.width || p_70105_2_ != this.height) { + var3 = this.width; + this.width = p_70105_1_; + this.height = p_70105_2_; + this.boundingBox.maxX = this.boundingBox.minX + (double)this.width; + this.boundingBox.maxZ = this.boundingBox.minZ + (double)this.width; + this.boundingBox.maxY = this.boundingBox.minY + (double)this.height; + + if (this.width > var3 && !this.firstUpdate && !this.worldObj.isClient) { + this.moveEntity(var3 - this.width, 0.0D, var3 - this.width); + } + } + + var3 = p_70105_1_ % 2.0F; + + if ((double)var3 < 0.375D) { + this.myEntitySize = Entity.EnumEntitySize.SIZE_1; + } else if ((double)var3 < 0.75D) { + this.myEntitySize = Entity.EnumEntitySize.SIZE_2; + } else if ((double)var3 < 1.0D) { + this.myEntitySize = Entity.EnumEntitySize.SIZE_3; + } else if ((double)var3 < 1.375D) { + this.myEntitySize = Entity.EnumEntitySize.SIZE_4; + } else if ((double)var3 < 1.75D) { + this.myEntitySize = Entity.EnumEntitySize.SIZE_5; + } else { + this.myEntitySize = Entity.EnumEntitySize.SIZE_6; + } + } + + /** + * Sets the rotation of the entity + */ + protected void setRotation(float p_70101_1_, float p_70101_2_) { + this.rotationYaw = p_70101_1_ % 360.0F; + this.rotationPitch = p_70101_2_ % 360.0F; + } + + /** + * Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box. + */ + public void setPosition(double p_70107_1_, double p_70107_3_, double p_70107_5_) { + this.posX = p_70107_1_; + this.posY = p_70107_3_; + this.posZ = p_70107_5_; + float var7 = this.width / 2.0F; + float var8 = this.height; + this.boundingBox.setBounds(p_70107_1_ - (double)var7, p_70107_3_ - (double)this.yOffset + (double)this.ySize, p_70107_5_ - (double)var7, p_70107_1_ + (double)var7, p_70107_3_ - (double)this.yOffset + (double)this.ySize + (double)var8, p_70107_5_ + (double)var7); + } + + /** + * Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both + * arguments in degrees. + */ + public void setAngles(float p_70082_1_, float p_70082_2_) { + float var3 = this.rotationPitch; + float var4 = this.rotationYaw; + this.rotationYaw = (float)((double)this.rotationYaw + (double)p_70082_1_ * 0.15D); + this.rotationPitch = (float)((double)this.rotationPitch - (double)p_70082_2_ * 0.15D); + + if (this.rotationPitch < -90.0F) { + this.rotationPitch = -90.0F; + } + + if (this.rotationPitch > 90.0F) { + this.rotationPitch = 90.0F; + } + + this.prevRotationPitch += this.rotationPitch - var3; + this.prevRotationYaw += this.rotationYaw - var4; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.onEntityUpdate(); + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + this.worldObj.theProfiler.startSection("entityBaseTick"); + + if (this.ridingEntity != null && this.ridingEntity.isDead) { + this.ridingEntity = null; + } + + this.prevDistanceWalkedModified = this.distanceWalkedModified; + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + int var2; + + if (!this.worldObj.isClient && this.worldObj instanceof WorldServer) { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer var1 = ((WorldServer)this.worldObj).func_73046_m(); + var2 = this.getMaxInPortalTime(); + + if (this.inPortal) { + if (var1.getAllowNether()) { + if (this.ridingEntity == null && this.portalCounter++ >= var2) { + this.portalCounter = var2; + this.timeUntilPortal = this.getPortalCooldown(); + byte var3; + + if (this.worldObj.provider.dimensionId == -1) { + var3 = 0; + } else { + var3 = -1; + } + + this.travelToDimension(var3); + } + + this.inPortal = false; + } + } else { + if (this.portalCounter > 0) { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + if (this.isSprinting() && !this.isInWater()) { + int var5 = MathHelper.floor_double(this.posX); + var2 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var6 = MathHelper.floor_double(this.posZ); + Block var4 = this.worldObj.getBlock(var5, var2, var6); + + ModuleParticles mod = CheatBreaker.getInstance().getModuleManager().particlesMod; + if (!mod.isEnabled() || mod.sprintingParticles.getBooleanValue()) { + if (var4.getMaterial() != Material.air) { + this.worldObj.spawnParticle("blockcrack_" + Block.getIdFromBlock(var4) + "_" + this.worldObj.getBlockMetadata(var5, var2, var6), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D); + } + } + } + + this.handleWaterMovement(); + + if (this.worldObj.isClient) { + this.fire = 0; + } else if (this.fire > 0) { + if (this.isImmuneToFire) { + this.fire -= 4; + + if (this.fire < 0) { + this.fire = 0; + } + } else { + if (this.fire % 20 == 0) { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + --this.fire; + } + } + + if (this.handleLavaMovement()) { + this.setOnFireFromLava(); + this.fallDistance *= 0.5F; + } + + if (this.posY < -64.0D) { + this.kill(); + } + + if (!this.worldObj.isClient) { + this.setFlag(0, this.fire > 0); + } + + this.firstUpdate = false; + this.worldObj.theProfiler.endSection(); + } + + /** + * Return the amount of time this entity should stay in a portal before being transported. + */ + public int getMaxInPortalTime() { + return 0; + } + + /** + * Called whenever the entity is walking inside of lava. + */ + protected void setOnFireFromLava() { + if (!this.isImmuneToFire) { + this.attackEntityFrom(DamageSource.lava, 4.0F); + this.setFire(15); + } + } + + /** + * Sets entity to burn for x amount of seconds, cannot lower amount of existing fire. + */ + public void setFire(int p_70015_1_) { + int var2 = p_70015_1_ * 20; + var2 = EnchantmentProtection.getFireTimeForEntity(this, var2); + + if (this.fire < var2) { + this.fire = var2; + } + } + + /** + * Removes fire from entity. + */ + public void extinguish() { + this.fire = 0; + } + + /** + * sets the dead flag. Used when you fall off the bottom of the world. + */ + protected void kill() { + this.setDead(); + } + + /** + * Checks if the offset position from the entity's current position is inside of liquid. Args: x, y, z + */ + public boolean isOffsetPositionInLiquid(double p_70038_1_, double p_70038_3_, double p_70038_5_) { + AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(p_70038_1_, p_70038_3_, p_70038_5_); + List var8 = this.worldObj.getCollidingBoundingBoxes(this, var7); + return var8.isEmpty() && !this.worldObj.isAnyLiquid(var7); + } + + /** + * Tries to moves the entity by the passed in displacement. Args: x, y, z + */ + public void moveEntity(double p_70091_1_, double p_70091_3_, double p_70091_5_) { + if (this.noClip) { + this.boundingBox.offset(p_70091_1_, p_70091_3_, p_70091_5_); + this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; + this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; + this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; + } else { + this.worldObj.theProfiler.startSection("move"); + this.ySize *= 0.4F; + double var7 = this.posX; + double var9 = this.posY; + double var11 = this.posZ; + + if (this.isInWeb) { + this.isInWeb = false; + p_70091_1_ *= 0.25D; + p_70091_3_ *= 0.05000000074505806D; + p_70091_5_ *= 0.25D; + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + } + + double var13 = p_70091_1_; + double var15 = p_70091_3_; + double var17 = p_70091_5_; + AxisAlignedBB var19 = this.boundingBox.copy(); + boolean var20 = this.onGround && this.isSneaking() && this instanceof EntityPlayer; + + if (var20) { + double var21; + + for (var21 = 0.05D; p_70091_1_ != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(p_70091_1_, -1.0D, 0.0D)).isEmpty(); var13 = p_70091_1_) { + if (p_70091_1_ < var21 && p_70091_1_ >= -var21) { + p_70091_1_ = 0.0D; + } else if (p_70091_1_ > 0.0D) { + p_70091_1_ -= var21; + } else { + p_70091_1_ += var21; + } + } + + for (; p_70091_5_ != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, p_70091_5_)).isEmpty(); var17 = p_70091_5_) { + if (p_70091_5_ < var21 && p_70091_5_ >= -var21) { + p_70091_5_ = 0.0D; + } else if (p_70091_5_ > 0.0D) { + p_70091_5_ -= var21; + } else { + p_70091_5_ += var21; + } + } + + while (p_70091_1_ != 0.0D && p_70091_5_ != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(p_70091_1_, -1.0D, p_70091_5_)).isEmpty()) { + if (p_70091_1_ < var21 && p_70091_1_ >= -var21) { + p_70091_1_ = 0.0D; + } else if (p_70091_1_ > 0.0D) { + p_70091_1_ -= var21; + } else { + p_70091_1_ += var21; + } + + if (p_70091_5_ < var21 && p_70091_5_ >= -var21) { + p_70091_5_ = 0.0D; + } else if (p_70091_5_ > 0.0D) { + p_70091_5_ -= var21; + } else { + p_70091_5_ += var21; + } + + var13 = p_70091_1_; + var17 = p_70091_5_; + } + } + + List var36 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(p_70091_1_, p_70091_3_, p_70091_5_)); + + for (int var22 = 0; var22 < var36.size(); ++var22) { + p_70091_3_ = ((AxisAlignedBB)var36.get(var22)).calculateYOffset(this.boundingBox, p_70091_3_); + } + + this.boundingBox.offset(0.0D, p_70091_3_, 0.0D); + + if (!this.field_70135_K && var15 != p_70091_3_) { + p_70091_5_ = 0.0D; + p_70091_3_ = 0.0D; + p_70091_1_ = 0.0D; + } + + boolean var37 = this.onGround || var15 != p_70091_3_ && var15 < 0.0D; + int var23; + + for (var23 = 0; var23 < var36.size(); ++var23) { + p_70091_1_ = ((AxisAlignedBB)var36.get(var23)).calculateXOffset(this.boundingBox, p_70091_1_); + } + + this.boundingBox.offset(p_70091_1_, 0.0D, 0.0D); + + if (!this.field_70135_K && var13 != p_70091_1_) { + p_70091_5_ = 0.0D; + p_70091_3_ = 0.0D; + p_70091_1_ = 0.0D; + } + + for (var23 = 0; var23 < var36.size(); ++var23) { + p_70091_5_ = ((AxisAlignedBB)var36.get(var23)).calculateZOffset(this.boundingBox, p_70091_5_); + } + + this.boundingBox.offset(0.0D, 0.0D, p_70091_5_); + + if (!this.field_70135_K && var17 != p_70091_5_) { + p_70091_5_ = 0.0D; + p_70091_3_ = 0.0D; + p_70091_1_ = 0.0D; + } + + double var25; + double var27; + int var30; + double var38; + + if (this.stepHeight > 0.0F && var37 && (var20 || this.ySize < 0.05F) && (var13 != p_70091_1_ || var17 != p_70091_5_)) { + var38 = p_70091_1_; + var25 = p_70091_3_; + var27 = p_70091_5_; + p_70091_1_ = var13; + p_70091_3_ = this.stepHeight; + p_70091_5_ = var17; + AxisAlignedBB var29 = this.boundingBox.copy(); + this.boundingBox.setBB(var19); + var36 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var13, p_70091_3_, var17)); + + for (var30 = 0; var30 < var36.size(); ++var30) { + p_70091_3_ = ((AxisAlignedBB)var36.get(var30)).calculateYOffset(this.boundingBox, p_70091_3_); + } + + this.boundingBox.offset(0.0D, p_70091_3_, 0.0D); + + if (!this.field_70135_K && var15 != p_70091_3_) { + p_70091_5_ = 0.0D; + p_70091_3_ = 0.0D; + p_70091_1_ = 0.0D; + } + + for (var30 = 0; var30 < var36.size(); ++var30) { + p_70091_1_ = ((AxisAlignedBB)var36.get(var30)).calculateXOffset(this.boundingBox, p_70091_1_); + } + + this.boundingBox.offset(p_70091_1_, 0.0D, 0.0D); + + if (!this.field_70135_K && var13 != p_70091_1_) { + p_70091_5_ = 0.0D; + p_70091_3_ = 0.0D; + p_70091_1_ = 0.0D; + } + + for (var30 = 0; var30 < var36.size(); ++var30) { + p_70091_5_ = ((AxisAlignedBB)var36.get(var30)).calculateZOffset(this.boundingBox, p_70091_5_); + } + + this.boundingBox.offset(0.0D, 0.0D, p_70091_5_); + + if (!this.field_70135_K && var17 != p_70091_5_) { + p_70091_5_ = 0.0D; + p_70091_3_ = 0.0D; + p_70091_1_ = 0.0D; + } + + if (!this.field_70135_K && var15 != p_70091_3_) { + p_70091_5_ = 0.0D; + p_70091_3_ = 0.0D; + p_70091_1_ = 0.0D; + } else { + p_70091_3_ = -this.stepHeight; + + for (var30 = 0; var30 < var36.size(); ++var30) { + p_70091_3_ = ((AxisAlignedBB)var36.get(var30)).calculateYOffset(this.boundingBox, p_70091_3_); + } + + this.boundingBox.offset(0.0D, p_70091_3_, 0.0D); + } + + if (var38 * var38 + var27 * var27 >= p_70091_1_ * p_70091_1_ + p_70091_5_ * p_70091_5_) { + p_70091_1_ = var38; + p_70091_3_ = var25; + p_70091_5_ = var27; + this.boundingBox.setBB(var29); + } + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rest"); + this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; + this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; + this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; + this.isCollidedHorizontally = var13 != p_70091_1_ || var17 != p_70091_5_; + this.isCollidedVertically = var15 != p_70091_3_; + this.onGround = var15 != p_70091_3_ && var15 < 0.0D; + this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically; + this.updateFallState(p_70091_3_, this.onGround); + + if (var13 != p_70091_1_) { + this.motionX = 0.0D; + } + + if (var15 != p_70091_3_) { + this.motionY = 0.0D; + } + + if (var17 != p_70091_5_) { + this.motionZ = 0.0D; + } + + var38 = this.posX - var7; + var25 = this.posY - var9; + var27 = this.posZ - var11; + + if (this.canTriggerWalking() && !var20 && this.ridingEntity == null) { + int var39 = MathHelper.floor_double(this.posX); + var30 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var31 = MathHelper.floor_double(this.posZ); + Block var32 = this.worldObj.getBlock(var39, var30, var31); + int var33 = this.worldObj.getBlock(var39, var30 - 1, var31).getRenderType(); + + if (var33 == 11 || var33 == 32 || var33 == 21) { + var32 = this.worldObj.getBlock(var39, var30 - 1, var31); + } + + if (var32 != Blocks.ladder) { + var25 = 0.0D; + } + + this.distanceWalkedModified = (float)((double)this.distanceWalkedModified + (double)MathHelper.sqrt_double(var38 * var38 + var27 * var27) * 0.6D); + this.distanceWalkedOnStepModified = (float)((double)this.distanceWalkedOnStepModified + (double)MathHelper.sqrt_double(var38 * var38 + var25 * var25 + var27 * var27) * 0.6D); + + if (this.distanceWalkedOnStepModified > (float)this.nextStepDistance && var32.getMaterial() != Material.air) { + this.nextStepDistance = (int)this.distanceWalkedOnStepModified + 1; + + if (this.isInWater()) { + float var34 = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.35F; + + if (var34 > 1.0F) { + var34 = 1.0F; + } + + this.playSound(this.getSwimSound(), var34, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + } + + this.func_145780_a(var39, var30, var31, var32); + var32.onEntityWalking(this.worldObj, var39, var30, var31, this); + } + } + + try { + this.func_145775_I(); + } catch (Throwable var35) { + CrashReport var41 = CrashReport.makeCrashReport(var35, "Checking entity block collision"); + CrashReportCategory var42 = var41.makeCategory("Entity being checked for collision"); + this.addEntityCrashInfo(var42); + throw new ReportedException(var41); + } + + boolean var40 = this.isWet(); + + if (this.worldObj.func_147470_e(this.boundingBox.contract(0.001D, 0.001D, 0.001D))) { + this.dealFireDamage(1); + + if (!var40) { + ++this.fire; + + if (this.fire == 0) { + this.setFire(8); + } + } + } else if (this.fire <= 0) { + this.fire = -this.fireResistance; + } + + if (var40 && this.fire > 0) { + this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + this.fire = -this.fireResistance; + } + + this.worldObj.theProfiler.endSection(); + } + } + + protected String getSwimSound() { + return "game.neutral.swim"; + } + + protected void func_145775_I() { + int var1 = MathHelper.floor_double(this.boundingBox.minX + 0.001D); + int var2 = MathHelper.floor_double(this.boundingBox.minY + 0.001D); + int var3 = MathHelper.floor_double(this.boundingBox.minZ + 0.001D); + int var4 = MathHelper.floor_double(this.boundingBox.maxX - 0.001D); + int var5 = MathHelper.floor_double(this.boundingBox.maxY - 0.001D); + int var6 = MathHelper.floor_double(this.boundingBox.maxZ - 0.001D); + + if (this.worldObj.checkChunksExist(var1, var2, var3, var4, var5, var6)) { + for (int var7 = var1; var7 <= var4; ++var7) { + for (int var8 = var2; var8 <= var5; ++var8) { + for (int var9 = var3; var9 <= var6; ++var9) { + Block var10 = this.worldObj.getBlock(var7, var8, var9); + + try { + var10.onEntityCollidedWithBlock(this.worldObj, var7, var8, var9, this); + } catch (Throwable var14) { + CrashReport var12 = CrashReport.makeCrashReport(var14, "Colliding entity with block"); + CrashReportCategory var13 = var12.makeCategory("Block being collided with"); + CrashReportCategory.func_147153_a(var13, var7, var8, var9, var10, this.worldObj.getBlockMetadata(var7, var8, var9)); + throw new ReportedException(var12); + } + } + } + } + } + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + Block.SoundType var5 = p_145780_4_.stepSound; + + if (this.worldObj.getBlock(p_145780_1_, p_145780_2_ + 1, p_145780_3_) == Blocks.snow_layer) { + var5 = Blocks.snow_layer.stepSound; + this.playSound(var5.func_150498_e(), var5.func_150497_c() * 0.15F, var5.func_150494_d()); + } else if (!p_145780_4_.getMaterial().isLiquid()) { + this.playSound(var5.func_150498_e(), var5.func_150497_c() * 0.15F, var5.func_150494_d()); + } + } + + public void playSound(String p_85030_1_, float p_85030_2_, float p_85030_3_) { + this.worldObj.playSoundAtEntity(this, p_85030_1_, p_85030_2_, p_85030_3_); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return true; + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double p_70064_1_, boolean p_70064_3_) { + if (p_70064_3_) { + if (this.fallDistance > 0.0F) { + this.fall(this.fallDistance); + this.fallDistance = 0.0F; + } + } else if (p_70064_1_ < 0.0D) { + this.fallDistance = (float)((double)this.fallDistance - p_70064_1_); + } + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() { + return null; + } + + /** + * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: + * amountDamage + */ + protected void dealFireDamage(int p_70081_1_) { + if (!this.isImmuneToFire) { + this.attackEntityFrom(DamageSource.inFire, (float)p_70081_1_); + } + } + + public final boolean isImmuneToFire() { + return this.isImmuneToFire; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + if (this.riddenByEntity != null) { + this.riddenByEntity.fall(p_70069_1_); + } + } + + /** + * Checks if this entity is either in water or on an open air block in rain (used in wolves). + */ + public boolean isWet() { + return this.inWater || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + (double)this.height), MathHelper.floor_double(this.posZ)); + } + + /** + * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning + * true) + */ + public boolean isInWater() { + return this.inWater; + } + + /** + * Returns if this entity is in water and will end up adding the waters velocity to the entity + */ + public boolean handleWaterMovement() { + if (this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) { + if (!this.inWater && !this.firstUpdate) { + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; + + if (var1 > 1.0F) { + var1 = 1.0F; + } + + this.playSound(this.getSplashSound(), var1, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float var2 = (float)MathHelper.floor_double(this.boundingBox.minY); + int var3; + float var4; + float var5; + + for (var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { + var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle("bubble", this.posX + (double)var4, var2 + 1.0F, this.posZ + (double)var5, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ); + } + + for (var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { + var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle("splash", this.posX + (double)var4, var2 + 1.0F, this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); + } + } + + this.fallDistance = 0.0F; + this.inWater = true; + this.fire = 0; + } else { + this.inWater = false; + } + + return this.inWater; + } + + protected String getSplashSound() { + return "game.neutral.swim.splash"; + } + + /** + * Checks if the current block the entity is within of the specified material type + */ + public boolean isInsideOfMaterial(Material p_70055_1_) { + double var2 = this.posY + (double)this.getEyeHeight(); + int var4 = MathHelper.floor_double(this.posX); + int var5 = MathHelper.floor_float((float)MathHelper.floor_double(var2)); + int var6 = MathHelper.floor_double(this.posZ); + Block var7 = this.worldObj.getBlock(var4, var5, var6); + + if (var7.getMaterial() == p_70055_1_) { + float var8 = BlockLiquid.func_149801_b(this.worldObj.getBlockMetadata(var4, var5, var6)) - 0.11111111F; + float var9 = (float)(var5 + 1) - var8; + return var2 < (double)var9; + } else { + return false; + } + } + + public float getEyeHeight() { + return 0.0F; + } + + /** + * Whether or not the current entity is in lava + */ + public boolean handleLavaMovement() { + return this.worldObj.isMaterialInBB(this.boundingBox.expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.lava); + } + + /** + * Used in both water and by flying objects + */ + public void moveFlying(float p_70060_1_, float p_70060_2_, float p_70060_3_) { + float var4 = p_70060_1_ * p_70060_1_ + p_70060_2_ * p_70060_2_; + + if (var4 >= 1.0E-4F) { + var4 = MathHelper.sqrt_float(var4); + + if (var4 < 1.0F) { + var4 = 1.0F; + } + + var4 = p_70060_3_ / var4; + p_70060_1_ *= var4; + p_70060_2_ *= var4; + float var5 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float var6 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); + this.motionX += p_70060_1_ * var6 - p_70060_2_ * var5; + this.motionZ += p_70060_2_ * var6 + p_70060_1_ * var5; + } + } + + public int getBrightnessForRender(float p_70070_1_) { + int var2 = MathHelper.floor_double(this.posX); + int var3 = MathHelper.floor_double(this.posZ); + + if (this.worldObj.blockExists(var2, 0, var3)) { + double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; + int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); + return this.worldObj.getLightBrightnessForSkyBlocks(var2, var6, var3, 0); + } else { + return 0; + } + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + int var2 = MathHelper.floor_double(this.posX); + int var3 = MathHelper.floor_double(this.posZ); + + if (this.worldObj.blockExists(var2, 0, var3)) { + double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; + int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); + return this.worldObj.getLightBrightness(var2, var6, var3); + } else { + return 0.0F; + } + } + + /** + * Sets the reference to the World object. + */ + public void setWorld(World p_70029_1_) { + this.worldObj = p_70029_1_; + } + + /** + * Sets the entity's position and rotation. Args: posX, posY, posZ, yaw, pitch + */ + public void setPositionAndRotation(double p_70080_1_, double p_70080_3_, double p_70080_5_, float p_70080_7_, float p_70080_8_) { + this.prevPosX = this.posX = p_70080_1_; + this.prevPosY = this.posY = p_70080_3_; + this.prevPosZ = this.posZ = p_70080_5_; + this.prevRotationYaw = this.rotationYaw = p_70080_7_; + this.prevRotationPitch = this.rotationPitch = p_70080_8_; + this.ySize = 0.0F; + double var9 = this.prevRotationYaw - p_70080_7_; + + if (var9 < -180.0D) { + this.prevRotationYaw += 360.0F; + } + + if (var9 >= 180.0D) { + this.prevRotationYaw -= 360.0F; + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(p_70080_7_, p_70080_8_); + } + + /** + * Sets the location and Yaw/Pitch of an entity in the world + */ + public void setLocationAndAngles(double p_70012_1_, double p_70012_3_, double p_70012_5_, float p_70012_7_, float p_70012_8_) { + this.lastTickPosX = this.prevPosX = this.posX = p_70012_1_; + this.lastTickPosY = this.prevPosY = this.posY = p_70012_3_ + (double)this.yOffset; + this.lastTickPosZ = this.prevPosZ = this.posZ = p_70012_5_; + this.rotationYaw = p_70012_7_; + this.rotationPitch = p_70012_8_; + this.setPosition(this.posX, this.posY, this.posZ); + } + + /** + * Returns the distance to the entity. Args: entity + */ + public float getDistanceToEntity(Entity p_70032_1_) { + float var2 = (float)(this.posX - p_70032_1_.posX); + float var3 = (float)(this.posY - p_70032_1_.posY); + float var4 = (float)(this.posZ - p_70032_1_.posZ); + return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4); + } + + /** + * Gets the squared distance to the position. Args: x, y, z + */ + public double getDistanceSq(double p_70092_1_, double p_70092_3_, double p_70092_5_) { + double var7 = this.posX - p_70092_1_; + double var9 = this.posY - p_70092_3_; + double var11 = this.posZ - p_70092_5_; + return var7 * var7 + var9 * var9 + var11 * var11; + } + + /** + * Gets the distance to the position. Args: x, y, z + */ + public double getDistance(double p_70011_1_, double p_70011_3_, double p_70011_5_) { + double var7 = this.posX - p_70011_1_; + double var9 = this.posY - p_70011_3_; + double var11 = this.posZ - p_70011_5_; + return MathHelper.sqrt_double(var7 * var7 + var9 * var9 + var11 * var11); + } + + /** + * Returns the squared distance to the entity. Args: entity + */ + public double getDistanceSqToEntity(Entity p_70068_1_) { + double var2 = this.posX - p_70068_1_.posX; + double var4 = this.posY - p_70068_1_.posY; + double var6 = this.posZ - p_70068_1_.posZ; + return var2 * var2 + var4 * var4 + var6 * var6; + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer p_70100_1_) {} + + /** + * Applies a velocity to each of the entities pushing them away from each other. Args: entity + */ + public void applyEntityCollision(Entity p_70108_1_) { + if (p_70108_1_.riddenByEntity != this && p_70108_1_.ridingEntity != this) { + double var2 = p_70108_1_.posX - this.posX; + double var4 = p_70108_1_.posZ - this.posZ; + double var6 = MathHelper.abs_max(var2, var4); + + if (var6 >= 0.009999999776482582D) { + var6 = MathHelper.sqrt_double(var6); + var2 /= var6; + var4 /= var6; + double var8 = 1.0D / var6; + + if (var8 > 1.0D) { + var8 = 1.0D; + } + + var2 *= var8; + var4 *= var8; + var2 *= 0.05000000074505806D; + var4 *= 0.05000000074505806D; + var2 *= 1.0F - this.entityCollisionReduction; + var4 *= 1.0F - this.entityCollisionReduction; + this.addVelocity(-var2, 0.0D, -var4); + p_70108_1_.addVelocity(var2, 0.0D, var4); + } + } + } + + /** + * Adds to the current velocity of the entity. Args: x, y, z + */ + public void addVelocity(double p_70024_1_, double p_70024_3_, double p_70024_5_) { + this.motionX += p_70024_1_; + this.motionY += p_70024_3_; + this.motionZ += p_70024_5_; + this.isAirBorne = true; + } + + /** + * Sets that this entity has been attacked. + */ + protected void setBeenAttacked() { + this.velocityChanged = true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + this.setBeenAttacked(); + return false; + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() { + return false; + } + + /** + * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: + * entity, scoreToAdd + */ + public void addToPlayerScore(Entity p_70084_1_, int p_70084_2_) {} + + public boolean isInRangeToRender3d(double p_145770_1_, double p_145770_3_, double p_145770_5_) { + double var7 = this.posX - p_145770_1_; + double var9 = this.posY - p_145770_3_; + double var11 = this.posZ - p_145770_5_; + double var13 = var7 * var7 + var9 * var9 + var11 * var11; + return this.isInRangeToRenderDist(var13); + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + double var3 = this.boundingBox.getAverageEdgeLength(); + var3 *= 64.0D * this.renderDistanceWeight; + return p_70112_1_ < var3 * var3; + } + + /** + * Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their + * riders. + */ + public boolean writeMountToNBT(NBTTagCompound p_98035_1_) { + String var2 = this.getEntityString(); + + if (!this.isDead && var2 != null) { + p_98035_1_.setString("id", var2); + this.writeToNBT(p_98035_1_); + return true; + } else { + return false; + } + } + + /** + * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this + * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their + * rider. + */ + public boolean writeToNBTOptional(NBTTagCompound p_70039_1_) { + String var2 = this.getEntityString(); + + if (!this.isDead && var2 != null && this.riddenByEntity == null) { + p_70039_1_.setString("id", var2); + this.writeToNBT(p_70039_1_); + return true; + } else { + return false; + } + } + + /** + * Save the entity to NBT (calls an abstract helper method to write extra data) + */ + public void writeToNBT(NBTTagCompound p_70109_1_) { + try { + p_70109_1_.setTag("Pos", this.newDoubleNBTList(this.posX, this.posY + (double)this.ySize, this.posZ)); + p_70109_1_.setTag("Motion", this.newDoubleNBTList(this.motionX, this.motionY, this.motionZ)); + p_70109_1_.setTag("Rotation", this.newFloatNBTList(this.rotationYaw, this.rotationPitch)); + p_70109_1_.setFloat("FallDistance", this.fallDistance); + p_70109_1_.setShort("Fire", (short)this.fire); + p_70109_1_.setShort("Air", (short)this.getAir()); + p_70109_1_.setBoolean("OnGround", this.onGround); + p_70109_1_.setInteger("Dimension", this.dimension); + p_70109_1_.setBoolean("Invulnerable", this.invulnerable); + p_70109_1_.setInteger("PortalCooldown", this.timeUntilPortal); + p_70109_1_.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits()); + p_70109_1_.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits()); + this.writeEntityToNBT(p_70109_1_); + + if (this.ridingEntity != null) { + NBTTagCompound var2 = new NBTTagCompound(); + + if (this.ridingEntity.writeMountToNBT(var2)) { + p_70109_1_.setTag("Riding", var2); + } + } + } catch (Throwable var5) { + CrashReport var3 = CrashReport.makeCrashReport(var5, "Saving entity NBT"); + CrashReportCategory var4 = var3.makeCategory("Entity being saved"); + this.addEntityCrashInfo(var4); + throw new ReportedException(var3); + } + } + + /** + * Reads the entity from NBT (calls an abstract helper method to read specialized data) + */ + public void readFromNBT(NBTTagCompound p_70020_1_) { + try { + NBTTagList var2 = p_70020_1_.getTagList("Pos", 6); + NBTTagList var6 = p_70020_1_.getTagList("Motion", 6); + NBTTagList var7 = p_70020_1_.getTagList("Rotation", 5); + this.motionX = var6.func_150309_d(0); + this.motionY = var6.func_150309_d(1); + this.motionZ = var6.func_150309_d(2); + + if (Math.abs(this.motionX) > 10.0D) { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) > 10.0D) { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) > 10.0D) { + this.motionZ = 0.0D; + } + + this.prevPosX = this.lastTickPosX = this.posX = var2.func_150309_d(0); + this.prevPosY = this.lastTickPosY = this.posY = var2.func_150309_d(1); + this.prevPosZ = this.lastTickPosZ = this.posZ = var2.func_150309_d(2); + this.prevRotationYaw = this.rotationYaw = var7.func_150308_e(0); + this.prevRotationPitch = this.rotationPitch = var7.func_150308_e(1); + this.fallDistance = p_70020_1_.getFloat("FallDistance"); + this.fire = p_70020_1_.getShort("Fire"); + this.setAir(p_70020_1_.getShort("Air")); + this.onGround = p_70020_1_.getBoolean("OnGround"); + this.dimension = p_70020_1_.getInteger("Dimension"); + this.invulnerable = p_70020_1_.getBoolean("Invulnerable"); + this.timeUntilPortal = p_70020_1_.getInteger("PortalCooldown"); + + if (p_70020_1_.func_150297_b("UUIDMost", 4) && p_70020_1_.func_150297_b("UUIDLeast", 4)) { + this.entityUniqueID = new UUID(p_70020_1_.getLong("UUIDMost"), p_70020_1_.getLong("UUIDLeast")); + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + this.readEntityFromNBT(p_70020_1_); + + if (this.shouldSetPosAfterLoading()) { + this.setPosition(this.posX, this.posY, this.posZ); + } + } catch (Throwable var5) { + CrashReport var3 = CrashReport.makeCrashReport(var5, "Loading entity NBT"); + CrashReportCategory var4 = var3.makeCategory("Entity being loaded"); + this.addEntityCrashInfo(var4); + throw new ReportedException(var3); + } + } + + protected boolean shouldSetPosAfterLoading() { + return true; + } + + /** + * Returns the string that identifies this Entity's class + */ + protected final String getEntityString() { + return EntityList.getEntityString(this); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected abstract void readEntityFromNBT(NBTTagCompound p_70037_1_); + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected abstract void writeEntityToNBT(NBTTagCompound p_70014_1_); + + public void onChunkLoad() {} + + /** + * creates a NBT list from the array of doubles passed to this function + */ + protected NBTTagList newDoubleNBTList(double ... p_70087_1_) { + NBTTagList var2 = new NBTTagList(); + double[] var3 = p_70087_1_; + int var4 = p_70087_1_.length; + + for (int var5 = 0; var5 < var4; ++var5) { + double var6 = var3[var5]; + var2.appendTag(new NBTTagDouble(var6)); + } + + return var2; + } + + /** + * Returns a new NBTTagList filled with the specified floats + */ + protected NBTTagList newFloatNBTList(float ... p_70049_1_) { + NBTTagList var2 = new NBTTagList(); + float[] var3 = p_70049_1_; + int var4 = p_70049_1_.length; + + for (int var5 = 0; var5 < var4; ++var5) { + float var6 = var3[var5]; + var2.appendTag(new NBTTagFloat(var6)); + } + + return var2; + } + + public float getShadowSize() { + return this.height / 2.0F; + } + + public EntityItem func_145779_a(Item p_145779_1_, int p_145779_2_) { + return this.func_145778_a(p_145779_1_, p_145779_2_, 0.0F); + } + + public EntityItem func_145778_a(Item p_145778_1_, int p_145778_2_, float p_145778_3_) { + return this.entityDropItem(new ItemStack(p_145778_1_, p_145778_2_, 0), p_145778_3_); + } + + /** + * Drops an item at the position of the entity. + */ + public EntityItem entityDropItem(ItemStack p_70099_1_, float p_70099_2_) { + if (p_70099_1_.stackSize != 0 && p_70099_1_.getItem() != null) { + EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)p_70099_2_, this.posZ, p_70099_1_); + var3.delayBeforeCanPickup = 10; + this.worldObj.spawnEntityInWorld(var3); + return var3; + } else { + return null; + } + } + + /** + * Checks whether target entity is alive. + */ + public boolean isEntityAlive() { + return !this.isDead; + } + + /** + * Checks if this entity is inside of an opaque block + */ + public boolean isEntityInsideOpaqueBlock() { + for (int var1 = 0; var1 < 8; ++var1) { + float var2 = ((float)((var1 >> 0) % 2) - 0.5F) * this.width * 0.8F; + float var3 = ((float)((var1 >> 1) % 2) - 0.5F) * 0.1F; + float var4 = ((float)((var1 >> 2) % 2) - 0.5F) * this.width * 0.8F; + int var5 = MathHelper.floor_double(this.posX + (double)var2); + int var6 = MathHelper.floor_double(this.posY + (double)this.getEyeHeight() + (double)var3); + int var7 = MathHelper.floor_double(this.posZ + (double)var4); + + if (this.worldObj.getBlock(var5, var6, var7).isNormalCube()) { + return true; + } + } + + return false; + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + return false; + } + + /** + * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be + * pushable on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity p_70114_1_) { + return null; + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + if (this.ridingEntity.isDead) { + this.ridingEntity = null; + } else { + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.onUpdate(); + + if (this.ridingEntity != null) { + this.ridingEntity.updateRiderPosition(); + this.entityRiderYawDelta += this.ridingEntity.rotationYaw - this.ridingEntity.prevRotationYaw; + + for (this.entityRiderPitchDelta += this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch; this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) { + } + + while (this.entityRiderYawDelta < -180.0D) { + this.entityRiderYawDelta += 360.0D; + } + + while (this.entityRiderPitchDelta >= 180.0D) { + this.entityRiderPitchDelta -= 360.0D; + } + + while (this.entityRiderPitchDelta < -180.0D) { + this.entityRiderPitchDelta += 360.0D; + } + + double var1 = this.entityRiderYawDelta * 0.5D; + double var3 = this.entityRiderPitchDelta * 0.5D; + float var5 = 10.0F; + + if (var1 > (double)var5) { + var1 = var5; + } + + if (var1 < (double)(-var5)) { + var1 = -var5; + } + + if (var3 > (double)var5) { + var3 = var5; + } + + if (var3 < (double)(-var5)) { + var3 = -var5; + } + + this.entityRiderYawDelta -= var1; + this.entityRiderPitchDelta -= var3; + } + } + } + + public void updateRiderPosition() { + if (this.riddenByEntity != null) { + this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); + } + } + + /** + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return this.yOffset; + } + + /** + * Returns the Y offset from the entity's position for any entity riding this one. + */ + public double getMountedYOffset() { + return (double)this.height * 0.75D; + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity p_70078_1_) { + this.entityRiderPitchDelta = 0.0D; + this.entityRiderYawDelta = 0.0D; + + if (p_70078_1_ == null) { + if (this.ridingEntity != null) { + this.setLocationAndAngles(this.ridingEntity.posX, this.ridingEntity.boundingBox.minY + (double)this.ridingEntity.height, this.ridingEntity.posZ, this.rotationYaw, this.rotationPitch); + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } else { + if (this.ridingEntity != null) { + this.ridingEntity.riddenByEntity = null; + } + + if (p_70078_1_ != null) { + for (Entity var2 = p_70078_1_.ridingEntity; var2 != null; var2 = var2.ridingEntity) { + if (var2 == this) { + return; + } + } + } + + this.ridingEntity = p_70078_1_; + p_70078_1_.riddenByEntity = this; + } + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); + this.setRotation(p_70056_7_, p_70056_8_); + List var10 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(0.03125D, 0.0D, 0.03125D)); + + if (!var10.isEmpty()) { + double var11 = 0.0D; + + for (int var13 = 0; var13 < var10.size(); ++var13) { + AxisAlignedBB var14 = (AxisAlignedBB)var10.get(var13); + + if (var14.maxY > var11) { + var11 = var14.maxY; + } + } + + p_70056_3_ += var11 - this.boundingBox.minY; + this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); + } + } + + public float getCollisionBorderSize() { + return 0.1F; + } + + /** + * returns a (normalized) vector of where this entity is looking + */ + public Vec3 getLookVec() { + return null; + } + + /** + * Called by portal blocks when an entity is within it. + */ + public void setInPortal() { + if (this.timeUntilPortal > 0) { + this.timeUntilPortal = this.getPortalCooldown(); + } else { + double var1 = this.prevPosX - this.posX; + double var3 = this.prevPosZ - this.posZ; + + if (!this.worldObj.isClient && !this.inPortal) { + this.teleportDirection = Direction.getMovementDirection(var1, var3); + } + + this.inPortal = true; + } + } + + /** + * Return the amount of cooldown before this entity can use a portal again. + */ + public int getPortalCooldown() { + return 300; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; + } + + public void handleHealthUpdate(byte p_70103_1_) {} + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + public void performHurtAnimation() {} + + public ItemStack[] getLastActiveItems() { + return null; + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int p_70062_1_, ItemStack p_70062_2_) {} + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() { + boolean var1 = this.worldObj != null && this.worldObj.isClient; + return !this.isImmuneToFire && (this.fire > 0 || var1 && this.getFlag(0)); + } + + /** + * Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position + * for players. + */ + public boolean isRiding() { + return this.ridingEntity != null; + } + + /** + * Returns if this entity is sneaking. + */ + public boolean isSneaking() { + return this.getFlag(1); + } + + /** + * Sets the sneaking flag. + */ + public void setSneaking(boolean p_70095_1_) { + this.setFlag(1, p_70095_1_); + } + + /** + * Get if the Entity is sprinting. + */ + public boolean isSprinting() { + return this.getFlag(3); + } + + /** + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean p_70031_1_) { + this.setFlag(3, p_70031_1_); + } + + public boolean isInvisible() { + return this.getFlag(5); + } + + /** + * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic + * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible + * will render the entity semitransparent. + */ + public boolean isInvisibleToPlayer(EntityPlayer p_98034_1_) { + return this.isInvisible(); + } + + public void setInvisible(boolean p_82142_1_) { + this.setFlag(5, p_82142_1_); + } + + public boolean isEating() { + return this.getFlag(4); + } + + public void setEating(boolean p_70019_1_) { + this.setFlag(4, p_70019_1_); + } + + /** + * Returns true if the flag is active for the entity. Known flags: 0) is burning; 1) is sneaking; 2) is riding + * something; 3) is sprinting; 4) is eating + */ + protected boolean getFlag(int p_70083_1_) { + return (this.dataWatcher.getWatchableObjectByte(0) & 1 << p_70083_1_) != 0; + } + + /** + * Enable or disable a entity flag, see getEntityFlag to read the know flags. + */ + protected void setFlag(int p_70052_1_, boolean p_70052_2_) { + byte var3 = this.dataWatcher.getWatchableObjectByte(0); + + if (p_70052_2_) { + this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 | 1 << p_70052_1_))); + } else { + this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 & ~(1 << p_70052_1_)))); + } + } + + public int getAir() { + return this.dataWatcher.getWatchableObjectShort(1); + } + + public void setAir(int p_70050_1_) { + this.dataWatcher.updateObject(1, Short.valueOf((short)p_70050_1_)); + } + + /** + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt p_70077_1_) { + this.dealFireDamage(5); + ++this.fire; + + if (this.fire == 0) { + this.setFire(8); + } + } + + /** + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase p_70074_1_) {} + + protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) { + int var7 = MathHelper.floor_double(p_145771_1_); + int var8 = MathHelper.floor_double(p_145771_3_); + int var9 = MathHelper.floor_double(p_145771_5_); + double var10 = p_145771_1_ - (double)var7; + double var12 = p_145771_3_ - (double)var8; + double var14 = p_145771_5_ - (double)var9; + List var16 = this.worldObj.func_147461_a(this.boundingBox); + + if (var16.isEmpty() && !this.worldObj.func_147469_q(var7, var8, var9)) { + return false; + } else { + boolean var17 = !this.worldObj.func_147469_q(var7 - 1, var8, var9); + boolean var18 = !this.worldObj.func_147469_q(var7 + 1, var8, var9); + boolean var19 = !this.worldObj.func_147469_q(var7, var8 - 1, var9); + boolean var20 = !this.worldObj.func_147469_q(var7, var8 + 1, var9); + boolean var21 = !this.worldObj.func_147469_q(var7, var8, var9 - 1); + boolean var22 = !this.worldObj.func_147469_q(var7, var8, var9 + 1); + byte var23 = 3; + double var24 = 9999.0D; + + if (var17 && var10 < var24) { + var24 = var10; + var23 = 0; + } + + if (var18 && 1.0D - var10 < var24) { + var24 = 1.0D - var10; + var23 = 1; + } + + if (var20 && 1.0D - var12 < var24) { + var24 = 1.0D - var12; + var23 = 3; + } + + if (var21 && var14 < var24) { + var24 = var14; + var23 = 4; + } + + if (var22 && 1.0D - var14 < var24) { + var24 = 1.0D - var14; + var23 = 5; + } + + float var26 = this.rand.nextFloat() * 0.2F + 0.1F; + + if (var23 == 0) { + this.motionX = -var26; + } + + if (var23 == 1) { + this.motionX = var26; + } + + if (var23 == 2) { + this.motionY = -var26; + } + + if (var23 == 3) { + this.motionY = var26; + } + + if (var23 == 4) { + this.motionZ = -var26; + } + + if (var23 == 5) { + this.motionZ = var26; + } + + return true; + } + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() { + this.isInWeb = true; + this.fallDistance = 0.0F; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + String var1 = EntityList.getEntityString(this); + + if (var1 == null) { + var1 = "generic"; + } + + return StatCollector.translateToLocal("entity." + var1 + ".name"); + } + + /** + * Return the Entity parts making up this Entity (currently only for dragons) + */ + public Entity[] getParts() { + return null; + } + + /** + * Returns true if Entity argument is equal to this Entity + */ + public boolean isEntityEqual(Entity p_70028_1_) { + return this == p_70028_1_; + } + + public float getRotationYawHead() { + return 0.0F; + } + + /** + * Sets the head's yaw rotation of the entity. + */ + public void setRotationYawHead(float p_70034_1_) {} + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() { + return true; + } + + /** + * Called when a player attacks an entity. If this returns true the attack will not happen. + */ + public boolean hitByEntity(Entity p_85031_1_) { + return false; + } + + public String toString() { + return String.format("%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getCommandSenderName(), Integer.valueOf(this.field_145783_c), this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)); + } + + /** + * Return whether this entity is invulnerable to damage. + */ + public boolean isEntityInvulnerable() { + return this.invulnerable; + } + + /** + * Sets this entity's location and angles to the location and angles of the passed in entity. + */ + public void copyLocationAndAnglesFrom(Entity p_82149_1_) { + this.setLocationAndAngles(p_82149_1_.posX, p_82149_1_.posY, p_82149_1_.posZ, p_82149_1_.rotationYaw, p_82149_1_.rotationPitch); + } + + /** + * Copies important data from another entity to this entity. Used when teleporting entities between worlds, as this + * actually deletes the teleporting entity and re-creates it on the other side. Params: Entity to copy from, unused + * (always true) + */ + public void copyDataFrom(Entity p_82141_1_, boolean p_82141_2_) { + NBTTagCompound var3 = new NBTTagCompound(); + p_82141_1_.writeToNBT(var3); + this.readFromNBT(var3); + this.timeUntilPortal = p_82141_1_.timeUntilPortal; + this.teleportDirection = p_82141_1_.teleportDirection; + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int p_71027_1_) { + if (!this.worldObj.isClient && !this.isDead) { + this.worldObj.theProfiler.startSection("changeDimension"); + MinecraftServer var2 = MinecraftServer.getServer(); + int var3 = this.dimension; + WorldServer var4 = var2.worldServerForDimension(var3); + WorldServer var5 = var2.worldServerForDimension(p_71027_1_); + this.dimension = p_71027_1_; + + if (var3 == 1 && p_71027_1_ == 1) { + var5 = var2.worldServerForDimension(0); + this.dimension = 0; + } + + this.worldObj.removeEntity(this); + this.isDead = false; + this.worldObj.theProfiler.startSection("reposition"); + var2.getConfigurationManager().transferEntityToWorld(this, var3, var4, var5); + this.worldObj.theProfiler.endStartSection("reloading"); + Entity var6 = EntityList.createEntityByName(EntityList.getEntityString(this), var5); + + if (var6 != null) { + var6.copyDataFrom(this, true); + + if (var3 == 1 && p_71027_1_ == 1) { + ChunkCoordinates var7 = var5.getSpawnPoint(); + var7.posY = this.worldObj.getTopSolidOrLiquidBlock(var7.posX, var7.posZ); + var6.setLocationAndAngles(var7.posX, var7.posY, var7.posZ, var6.rotationYaw, var6.rotationPitch); + } + + var5.spawnEntityInWorld(var6); + } + + this.isDead = true; + this.worldObj.theProfiler.endSection(); + var4.resetUpdateEntityTick(); + var5.resetUpdateEntityTick(); + this.worldObj.theProfiler.endSection(); + } + } + + public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_) { + return p_145772_6_.getExplosionResistance(this); + } + + public boolean func_145774_a(Explosion p_145774_1_, World p_145774_2_, int p_145774_3_, int p_145774_4_, int p_145774_5_, Block p_145774_6_, float p_145774_7_) { + return true; + } + + /** + * The number of iterations PathFinder.getSafePoint will execute before giving up. + */ + public int getMaxSafePointTries() { + return 3; + } + + public int getTeleportDirection() { + return this.teleportDirection; + } + + public boolean doesEntityNotTriggerPressurePlate() { + return false; + } + + public void addEntityCrashInfo(CrashReportCategory p_85029_1_) { + p_85029_1_.addCrashSectionCallable("Entity Type", new Callable() { + + public String call() { + return EntityList.getEntityString(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")"; + } + }); + p_85029_1_.addCrashSection("Entity ID", Integer.valueOf(this.field_145783_c)); + p_85029_1_.addCrashSectionCallable("Entity Name", new Callable() { + + public String call() { + return Entity.this.getCommandSenderName(); + } + }); + p_85029_1_.addCrashSection("Entity's Exact location", String.format("%.2f, %.2f, %.2f", Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ))); + p_85029_1_.addCrashSection("Entity's Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); + p_85029_1_.addCrashSection("Entity's Momentum", String.format("%.2f, %.2f, %.2f", Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ))); + } + + /** + * Return whether this entity should be rendered as on fire. + */ + public boolean canRenderOnFire() { + return this.isBurning(); + } + + public UUID getUniqueID() { + return this.entityUniqueID; + } + + public boolean isPushedByWater() { + return true; + } + + public IChatComponent func_145748_c_() { + return new ChatComponentText(this.getCommandSenderName()); + } + + public void func_145781_i(int p_145781_1_) {} + + public enum EnumEntitySize { + SIZE_1("SIZE_1", 0), + SIZE_2("SIZE_2", 1), + SIZE_3("SIZE_3", 2), + SIZE_4("SIZE_4", 3), + SIZE_5("SIZE_5", 4), + SIZE_6("SIZE_6", 5); + + private static final Entity.EnumEntitySize[] $VALUES = new Entity.EnumEntitySize[]{SIZE_1, SIZE_2, SIZE_3, SIZE_4, SIZE_5, SIZE_6}; + + + EnumEntitySize(String p_i1581_1_, int p_i1581_2_) {} + + public int multiplyBy32AndRound(double p_75630_1_) { + double var3 = p_75630_1_ - ((double)MathHelper.floor_double(p_75630_1_) + 0.5D); + + switch (Entity.SwitchEnumEntitySize.field_96565_a[this.ordinal()]) { + case 1: + if (var3 < 0.0D) { + if (var3 < -0.3125D) { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + } else if (var3 < 0.3125D) { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + + return MathHelper.floor_double(p_75630_1_ * 32.0D); + + case 2: + if (var3 < 0.0D) { + if (var3 < -0.3125D) { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + } else if (var3 < 0.3125D) { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + + case 3: + if (var3 > 0.0D) { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + + case 4: + if (var3 < 0.0D) { + if (var3 < -0.1875D) { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + } else if (var3 < 0.1875D) { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + + return MathHelper.floor_double(p_75630_1_ * 32.0D); + + case 5: + if (var3 < 0.0D) { + if (var3 < -0.1875D) { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + } else if (var3 < 0.1875D) { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + + case 6: + default: + if (var3 > 0.0D) { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } else { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + } + } + } + + static final class SwitchEnumEntitySize { + static final int[] field_96565_a = new int[Entity.EnumEntitySize.values().length]; + + + static { + try { + field_96565_a[Entity.EnumEntitySize.SIZE_1.ordinal()] = 1; + } catch (NoSuchFieldError var6) { + } + + try { + field_96565_a[Entity.EnumEntitySize.SIZE_2.ordinal()] = 2; + } catch (NoSuchFieldError var5) { + } + + try { + field_96565_a[Entity.EnumEntitySize.SIZE_3.ordinal()] = 3; + } catch (NoSuchFieldError var4) { + } + + try { + field_96565_a[Entity.EnumEntitySize.SIZE_4.ordinal()] = 4; + } catch (NoSuchFieldError var3) { + } + + try { + field_96565_a[Entity.EnumEntitySize.SIZE_5.ordinal()] = 5; + } catch (NoSuchFieldError var2) { + } + + try { + field_96565_a[Entity.EnumEntitySize.SIZE_6.ordinal()] = 6; + } catch (NoSuchFieldError var1) { + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityAgeable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityAgeable.java new file mode 100644 index 0000000..aead47a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityAgeable.java @@ -0,0 +1,165 @@ +package net.minecraft.entity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public abstract class EntityAgeable extends EntityCreature { + private float field_98056_d = -1.0F; + private float field_98057_e; + + + public EntityAgeable(World p_i1578_1_) { + super(p_i1578_1_); + } + + public abstract EntityAgeable createChild(EntityAgeable p_90011_1_); + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.spawn_egg) { + if (!this.worldObj.isClient) { + Class var3 = EntityList.getClassFromID(var2.getItemDamage()); + + if (var3 != null && var3.isAssignableFrom(this.getClass())) { + EntityAgeable var4 = this.createChild(this); + + if (var4 != null) { + var4.setGrowingAge(-24000); + var4.setLocationAndAngles(this.posX, this.posY, this.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(var4); + + if (var2.hasDisplayName()) { + var4.setCustomNameTag(var2.getDisplayName()); + } + + if (!p_70085_1_.capabilities.isCreativeMode) { + --var2.stackSize; + + if (var2.stackSize <= 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + } + } + } + } + + return true; + } else { + return false; + } + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(12, new Integer(0)); + } + + /** + * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's + * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the + * Entity is considered a child. + */ + public int getGrowingAge() { + return this.dataWatcher.getWatchableObjectInt(12); + } + + /** + * "Adds the value of the parameter times 20 to the age of this entity. If the entity is an adult (if the entity's + * age is greater than 0), it will have no effect." + */ + public void addGrowth(int p_110195_1_) { + int var2 = this.getGrowingAge(); + var2 += p_110195_1_ * 20; + + if (var2 > 0) { + var2 = 0; + } + + this.setGrowingAge(var2); + } + + /** + * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's + * positive, it get's decremented each tick. With a negative value the Entity is considered a child. + */ + public void setGrowingAge(int p_70873_1_) { + this.dataWatcher.updateObject(12, Integer.valueOf(p_70873_1_)); + this.setScaleForAge(this.isChild()); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("Age", this.getGrowingAge()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setGrowingAge(p_70037_1_.getInteger("Age")); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + + if (this.worldObj.isClient) { + this.setScaleForAge(this.isChild()); + } else { + int var1 = this.getGrowingAge(); + + if (var1 < 0) { + ++var1; + this.setGrowingAge(var1); + } else if (var1 > 0) { + --var1; + this.setGrowingAge(var1); + } + } + } + + /** + * If Animal, checks if the age timer is negative + */ + public boolean isChild() { + return this.getGrowingAge() < 0; + } + + /** + * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." + */ + public void setScaleForAge(boolean p_98054_1_) { + this.setScale(p_98054_1_ ? 0.5F : 1.0F); + } + + /** + * Sets the width and height of the entity. Args: width, height + */ + protected final void setSize(float p_70105_1_, float p_70105_2_) { + boolean var3 = this.field_98056_d > 0.0F; + this.field_98056_d = p_70105_1_; + this.field_98057_e = p_70105_2_; + + if (!var3) { + this.setScale(1.0F); + } + } + + protected final void setScale(float p_98055_1_) { + super.setSize(this.field_98056_d * p_98055_1_, this.field_98057_e * p_98055_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityBodyHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityBodyHelper.java new file mode 100644 index 0000000..27bd324 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityBodyHelper.java @@ -0,0 +1,57 @@ +package net.minecraft.entity; + +import net.minecraft.util.MathHelper; + +public class EntityBodyHelper { + /** Instance of EntityLiving. */ + private final EntityLivingBase theLiving; + private int field_75666_b; + private float field_75667_c; + + + public EntityBodyHelper(EntityLivingBase p_i1611_1_) { + this.theLiving = p_i1611_1_; + } + + public void func_75664_a() { + double var1 = this.theLiving.posX - this.theLiving.prevPosX; + double var3 = this.theLiving.posZ - this.theLiving.prevPosZ; + + if (var1 * var1 + var3 * var3 > 2.500000277905201E-7D) { + this.theLiving.renderYawOffset = this.theLiving.rotationYaw; + this.theLiving.rotationYawHead = this.func_75665_a(this.theLiving.renderYawOffset, this.theLiving.rotationYawHead, 75.0F); + this.field_75667_c = this.theLiving.rotationYawHead; + this.field_75666_b = 0; + } else { + float var5 = 75.0F; + + if (Math.abs(this.theLiving.rotationYawHead - this.field_75667_c) > 15.0F) { + this.field_75666_b = 0; + this.field_75667_c = this.theLiving.rotationYawHead; + } else { + ++this.field_75666_b; + boolean var6 = true; + + if (this.field_75666_b > 10) { + var5 = Math.max(1.0F - (float)(this.field_75666_b - 10) / 10.0F, 0.0F) * 75.0F; + } + } + + this.theLiving.renderYawOffset = this.func_75665_a(this.theLiving.rotationYawHead, this.theLiving.renderYawOffset, var5); + } + } + + private float func_75665_a(float p_75665_1_, float p_75665_2_, float p_75665_3_) { + float var4 = MathHelper.wrapAngleTo180_float(p_75665_1_ - p_75665_2_); + + if (var4 < -p_75665_3_) { + var4 = -p_75665_3_; + } + + if (var4 >= p_75665_3_) { + var4 = p_75665_3_; + } + + return p_75665_1_ - var4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityCreature.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityCreature.java new file mode 100644 index 0000000..1f3f61c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityCreature.java @@ -0,0 +1,343 @@ +package net.minecraft.entity; + +import java.util.UUID; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class EntityCreature extends EntityLiving { + public static final UUID field_110179_h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); + public static final AttributeModifier field_110181_i = (new AttributeModifier(field_110179_h, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); + private PathEntity pathToEntity; + + /** The Entity this EntityCreature is set to attack. */ + protected Entity entityToAttack; + + /** + * returns true if a creature has attacked recently only used for creepers and skeletons + */ + protected boolean hasAttacked; + + /** Used to make a creature speed up and wander away when hit. */ + protected int fleeingTick; + private final ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); + + /** If -1 there is no maximum distance */ + private float maximumHomeDistance = -1.0F; + private final EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0D); + private boolean field_110180_bt; + + + public EntityCreature(World p_i1602_1_) { + super(p_i1602_1_); + } + + /** + * Disables a mob's ability to move on its own while true. + */ + protected boolean isMovementCeased() { + return false; + } + + protected void updateEntityActionState() { + this.worldObj.theProfiler.startSection("ai"); + + if (this.fleeingTick > 0 && --this.fleeingTick == 0) { + IAttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var1.removeModifier(field_110181_i); + } + + this.hasAttacked = this.isMovementCeased(); + float var21 = 16.0F; + + if (this.entityToAttack == null) { + this.entityToAttack = this.findPlayerToAttack(); + + if (this.entityToAttack != null) { + this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var21, true, false, false, true); + } + } else if (this.entityToAttack.isEntityAlive()) { + float var2 = this.entityToAttack.getDistanceToEntity(this); + + if (this.canEntityBeSeen(this.entityToAttack)) { + this.attackEntity(this.entityToAttack, var2); + } + } else { + this.entityToAttack = null; + } + + if (this.entityToAttack instanceof EntityPlayerMP && ((EntityPlayerMP)this.entityToAttack).theItemInWorldManager.isCreative()) { + this.entityToAttack = null; + } + + this.worldObj.theProfiler.endSection(); + + if (!this.hasAttacked && this.entityToAttack != null && (this.pathToEntity == null || this.rand.nextInt(20) == 0)) { + this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var21, true, false, false, true); + } else if (!this.hasAttacked && (this.pathToEntity == null && this.rand.nextInt(180) == 0 || this.rand.nextInt(120) == 0 || this.fleeingTick > 0) && this.entityAge < 100) { + this.updateWanderPath(); + } + + int var22 = MathHelper.floor_double(this.boundingBox.minY + 0.5D); + boolean var3 = this.isInWater(); + boolean var4 = this.handleLavaMovement(); + this.rotationPitch = 0.0F; + + if (this.pathToEntity != null && this.rand.nextInt(100) != 0) { + this.worldObj.theProfiler.startSection("followpath"); + Vec3 var5 = this.pathToEntity.getPosition(this); + double var6 = this.width * 2.0F; + + while (var5 != null && var5.squareDistanceTo(this.posX, var5.yCoord, this.posZ) < var6 * var6) { + this.pathToEntity.incrementPathIndex(); + + if (this.pathToEntity.isFinished()) { + var5 = null; + this.pathToEntity = null; + } else { + var5 = this.pathToEntity.getPosition(this); + } + } + + this.isJumping = false; + + if (var5 != null) { + double var8 = var5.xCoord - this.posX; + double var10 = var5.zCoord - this.posZ; + double var12 = var5.yCoord - (double)var22; + float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI) - 90.0F; + float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); + this.moveForward = (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); + + if (var15 > 30.0F) { + var15 = 30.0F; + } + + if (var15 < -30.0F) { + var15 = -30.0F; + } + + this.rotationYaw += var15; + + if (this.hasAttacked && this.entityToAttack != null) { + double var16 = this.entityToAttack.posX - this.posX; + double var18 = this.entityToAttack.posZ - this.posZ; + float var20 = this.rotationYaw; + this.rotationYaw = (float)(Math.atan2(var18, var16) * 180.0D / Math.PI) - 90.0F; + var15 = (var20 - this.rotationYaw + 90.0F) * (float)Math.PI / 180.0F; + this.moveStrafing = -MathHelper.sin(var15) * this.moveForward * 1.0F; + this.moveForward = MathHelper.cos(var15) * this.moveForward * 1.0F; + } + + if (var12 > 0.0D) { + this.isJumping = true; + } + } + + if (this.entityToAttack != null) { + this.faceEntity(this.entityToAttack, 30.0F, 30.0F); + } + + if (this.isCollidedHorizontally && !this.hasPath()) { + this.isJumping = true; + } + + if (this.rand.nextFloat() < 0.8F && (var3 || var4)) { + this.isJumping = true; + } + + this.worldObj.theProfiler.endSection(); + } else { + super.updateEntityActionState(); + this.pathToEntity = null; + } + } + + /** + * Time remaining during which the Animal is sped up and flees. + */ + protected void updateWanderPath() { + this.worldObj.theProfiler.startSection("stroll"); + boolean var1 = false; + int var2 = -1; + int var3 = -1; + int var4 = -1; + float var5 = -99999.0F; + + for (int var6 = 0; var6 < 10; ++var6) { + int var7 = MathHelper.floor_double(this.posX + (double)this.rand.nextInt(13) - 6.0D); + int var8 = MathHelper.floor_double(this.posY + (double)this.rand.nextInt(7) - 3.0D); + int var9 = MathHelper.floor_double(this.posZ + (double)this.rand.nextInt(13) - 6.0D); + float var10 = this.getBlockPathWeight(var7, var8, var9); + + if (var10 > var5) { + var5 = var10; + var2 = var7; + var3 = var8; + var4 = var9; + var1 = true; + } + } + + if (var1) { + this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, var2, var3, var4, 10.0F, true, false, false, true); + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) {} + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) { + return 0.0F; + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() { + return null; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); + int var3 = MathHelper.floor_double(this.posZ); + return super.getCanSpawnHere() && this.getBlockPathWeight(var1, var2, var3) >= 0.0F; + } + + /** + * if the entity got a PathEntity it returns true, else false + */ + public boolean hasPath() { + return this.pathToEntity != null; + } + + /** + * sets the pathToEntity + */ + public void setPathToEntity(PathEntity p_70778_1_) { + this.pathToEntity = p_70778_1_; + } + + /** + * returns the target Entity + */ + public Entity getEntityToAttack() { + return this.entityToAttack; + } + + /** + * Sets the entity which is to be attacked. + */ + public void setTarget(Entity p_70784_1_) { + this.entityToAttack = p_70784_1_; + } + + public boolean isWithinHomeDistanceCurrentPosition() { + return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + } + + public boolean isWithinHomeDistance(int p_110176_1_, int p_110176_2_, int p_110176_3_) { + return this.maximumHomeDistance == -1.0F || this.homePosition.getDistanceSquared(p_110176_1_, p_110176_2_, p_110176_3_) < this.maximumHomeDistance * this.maximumHomeDistance; + } + + public void setHomeArea(int p_110171_1_, int p_110171_2_, int p_110171_3_, int p_110171_4_) { + this.homePosition.set(p_110171_1_, p_110171_2_, p_110171_3_); + this.maximumHomeDistance = (float)p_110171_4_; + } + + /** + * Returns the chunk coordinate object of the home position. + */ + public ChunkCoordinates getHomePosition() { + return this.homePosition; + } + + public float func_110174_bM() { + return this.maximumHomeDistance; + } + + public void detachHome() { + this.maximumHomeDistance = -1.0F; + } + + /** + * Returns whether a home area is defined for this entity. + */ + public boolean hasHome() { + return this.maximumHomeDistance != -1.0F; + } + + /** + * Applies logic related to leashes, for example dragging the entity or breaking the leash. + */ + protected void updateLeashedState() { + super.updateLeashedState(); + + if (this.getLeashed() && this.getLeashedToEntity() != null && this.getLeashedToEntity().worldObj == this.worldObj) { + Entity var1 = this.getLeashedToEntity(); + this.setHomeArea((int)var1.posX, (int)var1.posY, (int)var1.posZ, 5); + float var2 = this.getDistanceToEntity(var1); + + if (this instanceof EntityTameable && ((EntityTameable)this).isSitting()) { + if (var2 > 10.0F) { + this.clearLeashed(true, true); + } + + return; + } + + if (!this.field_110180_bt) { + this.tasks.addTask(2, this.field_110178_bs); + this.getNavigator().setAvoidsWater(false); + this.field_110180_bt = true; + } + + this.func_142017_o(var2); + + if (var2 > 4.0F) { + this.getNavigator().tryMoveToEntityLiving(var1, 1.0D); + } + + if (var2 > 6.0F) { + double var3 = (var1.posX - this.posX) / (double)var2; + double var5 = (var1.posY - this.posY) / (double)var2; + double var7 = (var1.posZ - this.posZ) / (double)var2; + this.motionX += var3 * Math.abs(var3) * 0.4D; + this.motionY += var5 * Math.abs(var5) * 0.4D; + this.motionZ += var7 * Math.abs(var7) * 0.4D; + } + + if (var2 > 10.0F) { + this.clearLeashed(true, true); + } + } else if (!this.getLeashed() && this.field_110180_bt) { + this.field_110180_bt = false; + this.tasks.removeTask(this.field_110178_bs); + this.getNavigator().setAvoidsWater(true); + this.detachHome(); + } + } + + protected void func_142017_o(float p_142017_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityFlying.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityFlying.java new file mode 100644 index 0000000..e37cd29 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityFlying.java @@ -0,0 +1,80 @@ +package net.minecraft.entity; + +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityFlying extends EntityLiving { + + + public EntityFlying(World p_i1587_1_) { + super(p_i1587_1_); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {} + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) { + if (this.isInWater()) { + this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + } else if (this.handleLavaMovement()) { + this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } else { + float var3 = 0.91F; + + if (this.onGround) { + var3 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + float var4 = 0.16277136F / (var3 * var3 * var3); + this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * var4 : 0.02F); + var3 = 0.91F; + + if (this.onGround) { + var3 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= var3; + this.motionY *= var3; + this.motionZ *= var3; + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double var8 = this.posX - this.prevPosX; + double var5 = this.posZ - this.prevPosZ; + float var7 = MathHelper.sqrt_double(var8 * var8 + var5 * var5) * 4.0F; + + if (var7 > 1.0F) { + var7 = 1.0F; + } + + this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityHanging.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityHanging.java new file mode 100644 index 0000000..e336685 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityHanging.java @@ -0,0 +1,307 @@ +package net.minecraft.entity; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.Direction; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityHanging extends Entity { + private int tickCounter1; + public int hangingDirection; + public int field_146063_b; + public int field_146064_c; + public int field_146062_d; + + + public EntityHanging(World p_i1588_1_) { + super(p_i1588_1_); + this.yOffset = 0.0F; + this.setSize(0.5F, 0.5F); + } + + public EntityHanging(World p_i1589_1_, int p_i1589_2_, int p_i1589_3_, int p_i1589_4_, int p_i1589_5_) { + this(p_i1589_1_); + this.field_146063_b = p_i1589_2_; + this.field_146064_c = p_i1589_3_; + this.field_146062_d = p_i1589_4_; + } + + protected void entityInit() {} + + public void setDirection(int p_82328_1_) { + this.hangingDirection = p_82328_1_; + this.prevRotationYaw = this.rotationYaw = (float)(p_82328_1_ * 90); + float var2 = (float)this.getWidthPixels(); + float var3 = (float)this.getHeightPixels(); + float var4 = (float)this.getWidthPixels(); + + if (p_82328_1_ != 2 && p_82328_1_ != 0) { + var2 = 0.5F; + } else { + var4 = 0.5F; + this.rotationYaw = this.prevRotationYaw = (float)(Direction.rotateOpposite[p_82328_1_] * 90); + } + + var2 /= 32.0F; + var3 /= 32.0F; + var4 /= 32.0F; + float var5 = (float)this.field_146063_b + 0.5F; + float var6 = (float)this.field_146064_c + 0.5F; + float var7 = (float)this.field_146062_d + 0.5F; + float var8 = 0.5625F; + + if (p_82328_1_ == 2) { + var7 -= var8; + } + + if (p_82328_1_ == 1) { + var5 -= var8; + } + + if (p_82328_1_ == 0) { + var7 += var8; + } + + if (p_82328_1_ == 3) { + var5 += var8; + } + + if (p_82328_1_ == 2) { + var5 -= this.func_70517_b(this.getWidthPixels()); + } + + if (p_82328_1_ == 1) { + var7 += this.func_70517_b(this.getWidthPixels()); + } + + if (p_82328_1_ == 0) { + var5 += this.func_70517_b(this.getWidthPixels()); + } + + if (p_82328_1_ == 3) { + var7 -= this.func_70517_b(this.getWidthPixels()); + } + + var6 += this.func_70517_b(this.getHeightPixels()); + this.setPosition(var5, var6, var7); + float var9 = -0.03125F; + this.boundingBox.setBounds(var5 - var2 - var9, var6 - var3 - var9, var7 - var4 - var9, var5 + var2 + var9, var6 + var3 + var9, var7 + var4 + var9); + } + + private float func_70517_b(int p_70517_1_) { + return p_70517_1_ == 32 ? 0.5F : (p_70517_1_ == 64 ? 0.5F : 0.0F); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.tickCounter1++ == 100 && !this.worldObj.isClient) { + this.tickCounter1 = 0; + + if (!this.isDead && !this.onValidSurface()) { + this.setDead(); + this.onBroken(null); + } + } + } + + /** + * checks to make sure painting can be placed there + */ + public boolean onValidSurface() { + if (!this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { + return false; + } else { + int var1 = Math.max(1, this.getWidthPixels() / 16); + int var2 = Math.max(1, this.getHeightPixels() / 16); + int var3 = this.field_146063_b; + int var4 = this.field_146064_c; + int var5 = this.field_146062_d; + + if (this.hangingDirection == 2) { + var3 = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); + } + + if (this.hangingDirection == 1) { + var5 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); + } + + if (this.hangingDirection == 0) { + var3 = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); + } + + if (this.hangingDirection == 3) { + var5 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); + } + + var4 = MathHelper.floor_double(this.posY - (double)((float)this.getHeightPixels() / 32.0F)); + + for (int var6 = 0; var6 < var1; ++var6) { + for (int var7 = 0; var7 < var2; ++var7) { + Material var8; + + if (this.hangingDirection != 2 && this.hangingDirection != 0) { + var8 = this.worldObj.getBlock(this.field_146063_b, var4 + var7, var5 + var6).getMaterial(); + } else { + var8 = this.worldObj.getBlock(var3 + var6, var4 + var7, this.field_146062_d).getMaterial(); + } + + if (!var8.isSolid()) { + return false; + } + } + } + + List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox); + Iterator var10 = var9.iterator(); + Entity var11; + + do { + if (!var10.hasNext()) { + return true; + } + + var11 = (Entity)var10.next(); + } + while (!(var11 instanceof EntityHanging)); + + return false; + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + /** + * Called when a player attacks an entity. If this returns true the attack will not happen. + */ + public boolean hitByEntity(Entity p_85031_1_) { + return p_85031_1_ instanceof EntityPlayer && this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p_85031_1_), 0.0F); + } + + public void func_145781_i(int p_145781_1_) { + this.worldObj.func_147450_X(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + if (!this.isDead && !this.worldObj.isClient) { + this.setDead(); + this.setBeenAttacked(); + this.onBroken(p_70097_1_.getEntity()); + } + + return true; + } + } + + /** + * Tries to moves the entity by the passed in displacement. Args: x, y, z + */ + public void moveEntity(double p_70091_1_, double p_70091_3_, double p_70091_5_) { + if (!this.worldObj.isClient && !this.isDead && p_70091_1_ * p_70091_1_ + p_70091_3_ * p_70091_3_ + p_70091_5_ * p_70091_5_ > 0.0D) { + this.setDead(); + this.onBroken(null); + } + } + + /** + * Adds to the current velocity of the entity. Args: x, y, z + */ + public void addVelocity(double p_70024_1_, double p_70024_3_, double p_70024_5_) { + if (!this.worldObj.isClient && !this.isDead && p_70024_1_ * p_70024_1_ + p_70024_3_ * p_70024_3_ + p_70024_5_ * p_70024_5_ > 0.0D) { + this.setDead(); + this.onBroken(null); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setByte("Direction", (byte)this.hangingDirection); + p_70014_1_.setInteger("TileX", this.field_146063_b); + p_70014_1_.setInteger("TileY", this.field_146064_c); + p_70014_1_.setInteger("TileZ", this.field_146062_d); + + switch (this.hangingDirection) { + case 0: + p_70014_1_.setByte("Dir", (byte)2); + break; + + case 1: + p_70014_1_.setByte("Dir", (byte)1); + break; + + case 2: + p_70014_1_.setByte("Dir", (byte)0); + break; + + case 3: + p_70014_1_.setByte("Dir", (byte)3); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + if (p_70037_1_.func_150297_b("Direction", 99)) { + this.hangingDirection = p_70037_1_.getByte("Direction"); + } else { + switch (p_70037_1_.getByte("Dir")) { + case 0: + this.hangingDirection = 2; + break; + + case 1: + this.hangingDirection = 1; + break; + + case 2: + this.hangingDirection = 0; + break; + + case 3: + this.hangingDirection = 3; + } + } + + this.field_146063_b = p_70037_1_.getInteger("TileX"); + this.field_146064_c = p_70037_1_.getInteger("TileY"); + this.field_146062_d = p_70037_1_.getInteger("TileZ"); + this.setDirection(this.hangingDirection); + } + + public abstract int getWidthPixels(); + + public abstract int getHeightPixels(); + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public abstract void onBroken(Entity p_110128_1_); + + protected boolean shouldSetPosAfterLoading() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLeashKnot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLeashKnot.java new file mode 100644 index 0000000..c500b04 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLeashKnot.java @@ -0,0 +1,154 @@ +package net.minecraft.entity; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class EntityLeashKnot extends EntityHanging { + + + public EntityLeashKnot(World p_i1592_1_) { + super(p_i1592_1_); + } + + public EntityLeashKnot(World p_i1593_1_, int p_i1593_2_, int p_i1593_3_, int p_i1593_4_) { + super(p_i1593_1_, p_i1593_2_, p_i1593_3_, p_i1593_4_, 0); + this.setPosition((double)p_i1593_2_ + 0.5D, (double)p_i1593_3_ + 0.5D, (double)p_i1593_4_ + 0.5D); + } + + protected void entityInit() { + super.entityInit(); + } + + public void setDirection(int p_82328_1_) {} + + public int getWidthPixels() { + return 9; + } + + public int getHeightPixels() { + return 9; + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + return p_70112_1_ < 1024.0D; + } + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity p_110128_1_) {} + + /** + * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this + * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their + * rider. + */ + public boolean writeToNBTOptional(NBTTagCompound p_70039_1_) { + return false; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) {} + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + ItemStack var2 = p_130002_1_.getHeldItem(); + boolean var3 = false; + double var4; + List var6; + Iterator var7; + EntityLiving var8; + + if (var2 != null && var2.getItem() == Items.lead && !this.worldObj.isClient) { + var4 = 7.0D; + var6 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(this.posX - var4, this.posY - var4, this.posZ - var4, this.posX + var4, this.posY + var4, this.posZ + var4)); + + if (var6 != null) { + var7 = var6.iterator(); + + while (var7.hasNext()) { + var8 = (EntityLiving)var7.next(); + + if (var8.getLeashed() && var8.getLeashedToEntity() == p_130002_1_) { + var8.setLeashedToEntity(this, true); + var3 = true; + } + } + } + } + + if (!this.worldObj.isClient && !var3) { + this.setDead(); + + if (p_130002_1_.capabilities.isCreativeMode) { + var4 = 7.0D; + var6 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(this.posX - var4, this.posY - var4, this.posZ - var4, this.posX + var4, this.posY + var4, this.posZ + var4)); + + if (var6 != null) { + var7 = var6.iterator(); + + while (var7.hasNext()) { + var8 = (EntityLiving)var7.next(); + + if (var8.getLeashed() && var8.getLeashedToEntity() == this) { + var8.clearLeashed(true, false); + } + } + } + } + } + + return true; + } + + /** + * checks to make sure painting can be placed there + */ + public boolean onValidSurface() { + return this.worldObj.getBlock(this.field_146063_b, this.field_146064_c, this.field_146062_d).getRenderType() == 11; + } + + public static EntityLeashKnot func_110129_a(World p_110129_0_, int p_110129_1_, int p_110129_2_, int p_110129_3_) { + EntityLeashKnot var4 = new EntityLeashKnot(p_110129_0_, p_110129_1_, p_110129_2_, p_110129_3_); + var4.forceSpawn = true; + p_110129_0_.spawnEntityInWorld(var4); + return var4; + } + + public static EntityLeashKnot getKnotForBlock(World p_110130_0_, int p_110130_1_, int p_110130_2_, int p_110130_3_) { + List var4 = p_110130_0_.getEntitiesWithinAABB(EntityLeashKnot.class, AxisAlignedBB.getBoundingBox((double)p_110130_1_ - 1.0D, (double)p_110130_2_ - 1.0D, (double)p_110130_3_ - 1.0D, (double)p_110130_1_ + 1.0D, (double)p_110130_2_ + 1.0D, (double)p_110130_3_ + 1.0D)); + + if (var4 != null) { + Iterator var5 = var4.iterator(); + + while (var5.hasNext()) { + EntityLeashKnot var6 = (EntityLeashKnot)var5.next(); + + if (var6.field_146063_b == p_110130_1_ && var6.field_146064_c == p_110130_2_ && var6.field_146062_d == p_110130_3_) { + return var6; + } + } + } + + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityList.java new file mode 100644 index 0000000..98d1235 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityList.java @@ -0,0 +1,312 @@ +package net.minecraft.entity; + +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.entity.item.EntityMinecartEmpty; +import net.minecraft.entity.item.EntityMinecartFurnace; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.item.EntityMinecartTNT; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCaveSpider; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityGiantZombie; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityList { + private static final Logger logger = LogManager.getLogger(); + + /** Provides a mapping between entity classes and a string */ + private static final Map stringToClassMapping = new HashMap(); + + /** Provides a mapping between a string and an entity classes */ + private static final Map classToStringMapping = new HashMap(); + + /** provides a mapping between an entityID and an Entity Class */ + private static final Map IDtoClassMapping = new HashMap(); + + /** provides a mapping between an Entity Class and an entity ID */ + private static final Map classToIDMapping = new HashMap(); + + /** Maps entity names to their numeric identifiers */ + private static final Map stringToIDMapping = new HashMap(); + + /** This is a HashMap of the Creative Entity Eggs/Spawners. */ + public static HashMap entityEggs = new LinkedHashMap(); + + + /** + * adds a mapping between Entity classes and both a string representation and an ID + */ + private static void addMapping(Class p_75618_0_, String p_75618_1_, int p_75618_2_) { + if (stringToClassMapping.containsKey(p_75618_1_)) { + throw new IllegalArgumentException("ID is already registered: " + p_75618_1_); + } else if (IDtoClassMapping.containsKey(Integer.valueOf(p_75618_2_))) { + throw new IllegalArgumentException("ID is already registered: " + p_75618_2_); + } else { + stringToClassMapping.put(p_75618_1_, p_75618_0_); + classToStringMapping.put(p_75618_0_, p_75618_1_); + IDtoClassMapping.put(Integer.valueOf(p_75618_2_), p_75618_0_); + classToIDMapping.put(p_75618_0_, Integer.valueOf(p_75618_2_)); + stringToIDMapping.put(p_75618_1_, Integer.valueOf(p_75618_2_)); + } + } + + /** + * Adds a entity mapping with egg info. + */ + private static void addMapping(Class p_75614_0_, String p_75614_1_, int p_75614_2_, int p_75614_3_, int p_75614_4_) { + addMapping(p_75614_0_, p_75614_1_, p_75614_2_); + entityEggs.put(Integer.valueOf(p_75614_2_), new EntityList.EntityEggInfo(p_75614_2_, p_75614_3_, p_75614_4_)); + } + + /** + * Create a new instance of an entity in the world by using the entity name. + */ + public static Entity createEntityByName(String p_75620_0_, World p_75620_1_) { + Entity var2 = null; + + try { + Class var3 = (Class)stringToClassMapping.get(p_75620_0_); + + if (var3 != null) { + var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_75620_1_}); + } + } catch (Exception var4) { + var4.printStackTrace(); + } + + return var2; + } + + /** + * create a new instance of an entity from NBT store + */ + public static Entity createEntityFromNBT(NBTTagCompound p_75615_0_, World p_75615_1_) { + Entity var2 = null; + + if ("Minecart".equals(p_75615_0_.getString("id"))) { + switch (p_75615_0_.getInteger("Type")) { + case 0: + p_75615_0_.setString("id", "MinecartRideable"); + break; + + case 1: + p_75615_0_.setString("id", "MinecartChest"); + break; + + case 2: + p_75615_0_.setString("id", "MinecartFurnace"); + } + + p_75615_0_.removeTag("Type"); + } + + try { + Class var3 = (Class)stringToClassMapping.get(p_75615_0_.getString("id")); + + if (var3 != null) { + var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_75615_1_}); + } + } catch (Exception var4) { + var4.printStackTrace(); + } + + if (var2 != null) { + var2.readFromNBT(p_75615_0_); + } else { + logger.warn("Skipping Entity with id " + p_75615_0_.getString("id")); + } + + return var2; + } + + /** + * Create a new instance of an entity in the world by using an entity ID. + */ + public static Entity createEntityByID(int p_75616_0_, World p_75616_1_) { + Entity var2 = null; + + try { + Class var3 = getClassFromID(p_75616_0_); + + if (var3 != null) { + var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_75616_1_}); + } + } catch (Exception var4) { + var4.printStackTrace(); + } + + if (var2 == null) { + logger.warn("Skipping Entity with id " + p_75616_0_); + } + + return var2; + } + + /** + * gets the entityID of a specific entity + */ + public static int getEntityID(Entity p_75619_0_) { + Class var1 = p_75619_0_.getClass(); + return classToIDMapping.containsKey(var1) ? ((Integer)classToIDMapping.get(var1)).intValue() : 0; + } + + /** + * Return the class assigned to this entity ID. + */ + public static Class getClassFromID(int p_90035_0_) { + return (Class)IDtoClassMapping.get(Integer.valueOf(p_90035_0_)); + } + + /** + * Gets the string representation of a specific entity. + */ + public static String getEntityString(Entity p_75621_0_) { + return (String)classToStringMapping.get(p_75621_0_.getClass()); + } + + /** + * Finds the class using IDtoClassMapping and classToStringMapping + */ + public static String getStringFromID(int p_75617_0_) { + Class var1 = getClassFromID(p_75617_0_); + return var1 != null ? (String)classToStringMapping.get(var1) : null; + } + + public static void func_151514_a() {} + + public static Set func_151515_b() { + return Collections.unmodifiableSet(stringToIDMapping.keySet()); + } + + static { + addMapping(EntityItem.class, "Item", 1); + addMapping(EntityXPOrb.class, "XPOrb", 2); + addMapping(EntityLeashKnot.class, "LeashKnot", 8); + addMapping(EntityPainting.class, "Painting", 9); + addMapping(EntityArrow.class, "Arrow", 10); + addMapping(EntitySnowball.class, "Snowball", 11); + addMapping(EntityLargeFireball.class, "Fireball", 12); + addMapping(EntitySmallFireball.class, "SmallFireball", 13); + addMapping(EntityEnderPearl.class, "ThrownEnderpearl", 14); + addMapping(EntityEnderEye.class, "EyeOfEnderSignal", 15); + addMapping(EntityPotion.class, "ThrownPotion", 16); + addMapping(EntityExpBottle.class, "ThrownExpBottle", 17); + addMapping(EntityItemFrame.class, "ItemFrame", 18); + addMapping(EntityWitherSkull.class, "WitherSkull", 19); + addMapping(EntityTNTPrimed.class, "PrimedTnt", 20); + addMapping(EntityFallingBlock.class, "FallingSand", 21); + addMapping(EntityFireworkRocket.class, "FireworksRocketEntity", 22); + addMapping(EntityBoat.class, "Boat", 41); + addMapping(EntityMinecartEmpty.class, "MinecartRideable", 42); + addMapping(EntityMinecartChest.class, "MinecartChest", 43); + addMapping(EntityMinecartFurnace.class, "MinecartFurnace", 44); + addMapping(EntityMinecartTNT.class, "MinecartTNT", 45); + addMapping(EntityMinecartHopper.class, "MinecartHopper", 46); + addMapping(EntityMinecartMobSpawner.class, "MinecartSpawner", 47); + addMapping(EntityMinecartCommandBlock.class, "MinecartCommandBlock", 40); + addMapping(EntityLiving.class, "Mob", 48); + addMapping(EntityMob.class, "Monster", 49); + addMapping(EntityCreeper.class, "Creeper", 50, 894731, 0); + addMapping(EntitySkeleton.class, "Skeleton", 51, 12698049, 4802889); + addMapping(EntitySpider.class, "Spider", 52, 3419431, 11013646); + addMapping(EntityGiantZombie.class, "Giant", 53); + addMapping(EntityZombie.class, "Zombie", 54, 44975, 7969893); + addMapping(EntitySlime.class, "Slime", 55, 5349438, 8306542); + addMapping(EntityGhast.class, "Ghast", 56, 16382457, 12369084); + addMapping(EntityPigZombie.class, "PigZombie", 57, 15373203, 5009705); + addMapping(EntityEnderman.class, "Enderman", 58, 1447446, 0); + addMapping(EntityCaveSpider.class, "CaveSpider", 59, 803406, 11013646); + addMapping(EntitySilverfish.class, "Silverfish", 60, 7237230, 3158064); + addMapping(EntityBlaze.class, "Blaze", 61, 16167425, 16775294); + addMapping(EntityMagmaCube.class, "LavaSlime", 62, 3407872, 16579584); + addMapping(EntityDragon.class, "EnderDragon", 63); + addMapping(EntityWither.class, "WitherBoss", 64); + addMapping(EntityBat.class, "Bat", 65, 4996656, 986895); + addMapping(EntityWitch.class, "Witch", 66, 3407872, 5349438); + addMapping(EntityPig.class, "Pig", 90, 15771042, 14377823); + addMapping(EntitySheep.class, "Sheep", 91, 15198183, 16758197); + addMapping(EntityCow.class, "Cow", 92, 4470310, 10592673); + addMapping(EntityChicken.class, "Chicken", 93, 10592673, 16711680); + addMapping(EntitySquid.class, "Squid", 94, 2243405, 7375001); + addMapping(EntityWolf.class, "Wolf", 95, 14144467, 13545366); + addMapping(EntityMooshroom.class, "MushroomCow", 96, 10489616, 12040119); + addMapping(EntitySnowman.class, "SnowMan", 97); + addMapping(EntityOcelot.class, "Ozelot", 98, 15720061, 5653556); + addMapping(EntityIronGolem.class, "VillagerGolem", 99); + addMapping(EntityHorse.class, "EntityHorse", 100, 12623485, 15656192); + addMapping(EntityVillager.class, "Villager", 120, 5651507, 12422002); + addMapping(EntityEnderCrystal.class, "EnderCrystal", 200); + } + + public static class EntityEggInfo { + public final int spawnedID; + public final int primaryColor; + public final int secondaryColor; + public final StatBase field_151512_d; + public final StatBase field_151513_e; + + + public EntityEggInfo(int p_i1583_1_, int p_i1583_2_, int p_i1583_3_) { + this.spawnedID = p_i1583_1_; + this.primaryColor = p_i1583_2_; + this.secondaryColor = p_i1583_3_; + this.field_151512_d = StatList.func_151182_a(this); + this.field_151513_e = StatList.func_151176_b(this); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLiving.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLiving.java new file mode 100644 index 0000000..7e8ca68 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLiving.java @@ -0,0 +1,1089 @@ +package net.minecraft.entity; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.src.BlockPos; +import net.minecraft.src.Reflector; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.BiomeGenBase; + +import java.util.Iterator; +import java.util.List; +import java.util.UUID; + +public abstract class EntityLiving extends EntityLivingBase { + /** Number of ticks since this EntityLiving last produced its sound */ + public int livingSoundTime; + + /** The experience points the Entity gives. */ + protected int experienceValue; + private final EntityLookHelper lookHelper; + private final EntityMoveHelper moveHelper; + + /** Entity jumping helper */ + private final EntityJumpHelper jumpHelper; + private final EntityBodyHelper bodyHelper; + private final PathNavigate navigator; + protected final EntityAITasks tasks; + protected final EntityAITasks targetTasks; + + /** The active target the Task system uses for tracking */ + private EntityLivingBase attackTarget; + private final EntitySenses senses; + + /** Equipment (armor and held item) for this entity. */ + private final ItemStack[] equipment = new ItemStack[5]; + + /** Chances for each equipment piece from dropping when this entity dies. */ + protected float[] equipmentDropChances = new float[5]; + + /** Whether this entity can pick up items from the ground. */ + private boolean canPickUpLoot; + + /** Whether this entity should NOT despawn. */ + private boolean persistenceRequired; + protected float defaultPitch; + + /** This entity's current target. */ + private Entity currentTarget; + + /** How long to keep a specific target entity */ + protected int numTicksToChaseTarget; + private boolean isLeashed; + private Entity leashedToEntity; + private NBTTagCompound field_110170_bx; + + public int randomMobsId = 0; + public BiomeGenBase spawnBiome = null; + public BlockPos spawnPosition = null; + + + public EntityLiving(World par1World) { + super(par1World); + this.tasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null); + this.targetTasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null); + this.lookHelper = new EntityLookHelper(this); + this.moveHelper = new EntityMoveHelper(this); + this.jumpHelper = new EntityJumpHelper(this); + this.bodyHelper = new EntityBodyHelper(this); + this.navigator = new PathNavigate(this, par1World); + this.senses = new EntitySenses(this); + + for (int uuid = 0; uuid < this.equipmentDropChances.length; ++uuid) { + this.equipmentDropChances[uuid] = 0.085F; + } + + UUID var5 = this.getUniqueID(); + long uuidLow = var5.getLeastSignificantBits(); + this.randomMobsId = (int)(uuidLow & 2147483647L); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D); + } + + public EntityLookHelper getLookHelper() { + return this.lookHelper; + } + + public EntityMoveHelper getMoveHelper() { + return this.moveHelper; + } + + public EntityJumpHelper getJumpHelper() { + return this.jumpHelper; + } + + public PathNavigate getNavigator() { + return this.navigator; + } + + /** + * returns the EntitySenses Object for the EntityLiving + */ + public EntitySenses getEntitySenses() { + return this.senses; + } + + /** + * Gets the active target the Task system uses for tracking + */ + public EntityLivingBase getAttackTarget() { + return this.attackTarget; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase par1EntityLivingBase) { + this.attackTarget = par1EntityLivingBase; + Reflector.callVoid(Reflector.ForgeHooks_onLivingSetAttackTarget, this, par1EntityLivingBase); + } + + /** + * Returns true if this entity can attack entities of the specified class. + */ + public boolean canAttackClass(Class par1Class) { + return EntityCreeper.class != par1Class && EntityGhast.class != par1Class; + } + + /** + * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This + * function is used in the AIEatGrass) + */ + public void eatGrassBonus() {} + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(11, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(10, ""); + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() { + return 80; + } + + /** + * Plays living's sound at its position + */ + public void playLivingSound() { + String var1 = this.getLivingSound(); + + if (var1 != null) { + this.playSound(var1, this.getSoundVolume(), this.getSoundPitch()); + } + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("mobBaseTick"); + + if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) { + this.livingSoundTime = -this.getTalkInterval(); + this.playLivingSound(); + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { + if (this.experienceValue > 0) { + int var2 = this.experienceValue; + ItemStack[] var3 = this.getLastActiveItems(); + + for (int var4 = 0; var4 < var3.length; ++var4) { + if (var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F) { + var2 += 1 + this.rand.nextInt(3); + } + } + + return var2; + } else { + return this.experienceValue; + } + } + + /** + * Spawns an explosion particle around the Entity's location + */ + public void spawnExplosionParticle() { + for (int var1 = 0; var1 < 20; ++var1) { + double var2 = this.rand.nextGaussian() * 0.02D; + double var4 = this.rand.nextGaussian() * 0.02D; + double var6 = this.rand.nextGaussian() * 0.02D; + double var8 = 10.0D; + this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - var2 * var8, this.posY + (double)(this.rand.nextFloat() * this.height) - var4 * var8, this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - var6 * var8, var2, var4, var6); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (!this.worldObj.isClient) { + this.updateLeashedState(); + } + } + + protected float func_110146_f(float par1, float par2) { + if (this.isAIEnabled()) { + this.bodyHelper.func_75664_a(); + return par2; + } else { + return super.func_110146_f(par1, par2); + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return null; + } + + protected Item func_146068_u() { + return Item.getItemById(0); + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean par1, int par2) { + Item var3 = this.func_146068_u(); + + if (var3 != null) { + int var4 = this.rand.nextInt(3); + + if (par2 > 0) { + var4 += this.rand.nextInt(par2 + 1); + } + + for (int var5 = 0; var5 < var4; ++var5) { + this.func_145779_a(var3, 1); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot()); + par1NBTTagCompound.setBoolean("PersistenceRequired", this.persistenceRequired); + NBTTagList var2 = new NBTTagList(); + NBTTagCompound var4; + + for (int var6 = 0; var6 < this.equipment.length; ++var6) { + var4 = new NBTTagCompound(); + + if (this.equipment[var6] != null) { + this.equipment[var6].writeToNBT(var4); + } + + var2.appendTag(var4); + } + + par1NBTTagCompound.setTag("Equipment", var2); + NBTTagList var61 = new NBTTagList(); + + for (int var5 = 0; var5 < this.equipmentDropChances.length; ++var5) { + var61.appendTag(new NBTTagFloat(this.equipmentDropChances[var5])); + } + + par1NBTTagCompound.setTag("DropChances", var61); + par1NBTTagCompound.setString("CustomName", this.getCustomNameTag()); + par1NBTTagCompound.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); + par1NBTTagCompound.setBoolean("Leashed", this.isLeashed); + + if (this.leashedToEntity != null) { + var4 = new NBTTagCompound(); + + if (this.leashedToEntity instanceof EntityLivingBase) { + var4.setLong("UUIDMost", this.leashedToEntity.getUniqueID().getMostSignificantBits()); + var4.setLong("UUIDLeast", this.leashedToEntity.getUniqueID().getLeastSignificantBits()); + } else if (this.leashedToEntity instanceof EntityHanging) { + EntityHanging var7 = (EntityHanging)this.leashedToEntity; + var4.setInteger("X", var7.field_146063_b); + var4.setInteger("Y", var7.field_146064_c); + var4.setInteger("Z", var7.field_146062_d); + } + + par1NBTTagCompound.setTag("Leash", var4); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readEntityFromNBT(par1NBTTagCompound); + this.setCanPickUpLoot(par1NBTTagCompound.getBoolean("CanPickUpLoot")); + this.persistenceRequired = par1NBTTagCompound.getBoolean("PersistenceRequired"); + + if (par1NBTTagCompound.func_150297_b("CustomName", 8) && par1NBTTagCompound.getString("CustomName").length() > 0) { + this.setCustomNameTag(par1NBTTagCompound.getString("CustomName")); + } + + this.setAlwaysRenderNameTag(par1NBTTagCompound.getBoolean("CustomNameVisible")); + NBTTagList var2; + int var3; + + if (par1NBTTagCompound.func_150297_b("Equipment", 9)) { + var2 = par1NBTTagCompound.getTagList("Equipment", 10); + + for (var3 = 0; var3 < this.equipment.length; ++var3) { + this.equipment[var3] = ItemStack.loadItemStackFromNBT(var2.getCompoundTagAt(var3)); + } + } + + if (par1NBTTagCompound.func_150297_b("DropChances", 9)) { + var2 = par1NBTTagCompound.getTagList("DropChances", 5); + + for (var3 = 0; var3 < var2.tagCount(); ++var3) { + this.equipmentDropChances[var3] = var2.func_150308_e(var3); + } + } + + this.isLeashed = par1NBTTagCompound.getBoolean("Leashed"); + + if (this.isLeashed && par1NBTTagCompound.func_150297_b("Leash", 10)) { + this.field_110170_bx = par1NBTTagCompound.getCompoundTag("Leash"); + } + } + + public void setMoveForward(float par1) { + this.moveForward = par1; + } + + /** + * set the movespeed used for the new AI system + */ + public void setAIMoveSpeed(float par1) { + super.setAIMoveSpeed(par1); + this.setMoveForward(par1); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.worldObj.theProfiler.startSection("looting"); + + if (!this.worldObj.isClient && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + List var1 = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(1.0D, 0.0D, 1.0D)); + Iterator var2 = var1.iterator(); + + while (var2.hasNext()) { + EntityItem var3 = (EntityItem)var2.next(); + + if (!var3.isDead && var3.getEntityItem() != null) { + ItemStack var4 = var3.getEntityItem(); + int var5 = getArmorPosition(var4); + + if (var5 > -1) { + boolean var6 = true; + ItemStack var7 = this.getEquipmentInSlot(var5); + + if (var7 != null) + { + if (var5 == 0) { + if (var4.getItem() instanceof ItemSword && !(var7.getItem() instanceof ItemSword)) + { + var6 = true; + } else if (var4.getItem() instanceof ItemSword && var7.getItem() instanceof ItemSword) + { + ItemSword var11 = (ItemSword)var4.getItem(); + ItemSword var12 = (ItemSword)var7.getItem(); + + if (var11.func_150931_i() == var12.func_150931_i()) + { + var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); + } + else + { + var6 = var11.func_150931_i() > var12.func_150931_i(); + } + } else + { + var6 = false; + } + } else if (var4.getItem() instanceof ItemArmor && !(var7.getItem() instanceof ItemArmor)) { + var6 = true; + } else if (var4.getItem() instanceof ItemArmor && var7.getItem() instanceof ItemArmor) { + ItemArmor var111 = (ItemArmor)var4.getItem(); + ItemArmor var121 = (ItemArmor)var7.getItem(); + + if (var111.damageReduceAmount == var121.damageReduceAmount) + { + var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); + } else + { + var6 = var111.damageReduceAmount > var121.damageReduceAmount; + } + } else { + var6 = false; + } + } + + if (var6) + { + if (var7 != null && this.rand.nextFloat() - 0.1F < this.equipmentDropChances[var5]) { + this.entityDropItem(var7, 0.0F); + } + + if (var4.getItem() == Items.diamond && var3.func_145800_j() != null) { + EntityPlayer var112 = this.worldObj.getPlayerEntityByName(var3.func_145800_j()); + + if (var112 != null) + { + var112.triggerAchievement(AchievementList.field_150966_x); + } + } + + this.setCurrentItemOrArmor(var5, var4); + this.equipmentDropChances[var5] = 2.0F; + this.persistenceRequired = true; + this.onItemPickup(var3, 1); + var3.setDead(); + } + } + } + } + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return false; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return true; + } + + /** + * Makes the entity despawn if requirements are reached + */ + public void despawnEntity() { + Object result = null; + Object Result_DEFAULT = Reflector.getFieldValue(Reflector.Event_Result_DEFAULT); + Object Result_DENY = Reflector.getFieldValue(Reflector.Event_Result_DENY); + + if (this.persistenceRequired) { + this.entityAge = 0; + } else if ((this.entityAge & 31) == 31 && (result = Reflector.call(Reflector.ForgeEventFactory_canEntityDespawn, this)) != Result_DEFAULT) { + if (result == Result_DENY) { + this.entityAge = 0; + } else { + this.setDead(); + } + } else { + EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, -1.0D); + + if (var1 != null) { + double var2 = var1.posX - this.posX; + double var4 = var1.posY - this.posY; + double var6 = var1.posZ - this.posZ; + double var8 = var2 * var2 + var4 * var4 + var6 * var6; + + if (this.canDespawn() && var8 > 16384.0D) { + this.setDead(); + } + + if (this.entityAge > 600 && this.rand.nextInt(800) == 0 && var8 > 1024.0D && this.canDespawn()) { + this.setDead(); + } + else if (var8 < 1024.0D) { + this.entityAge = 0; + } + } + } + } + + protected void updateAITasks() { + ++this.entityAge; + this.worldObj.theProfiler.startSection("checkDespawn"); + this.despawnEntity(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("sensing"); + this.senses.clearSensingCache(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("targetSelector"); + this.targetTasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("goalSelector"); + this.tasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("navigation"); + this.navigator.onUpdateNavigation(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("mob tick"); + this.updateAITick(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("controls"); + this.worldObj.theProfiler.startSection("move"); + this.moveHelper.onUpdateMoveHelper(); + this.worldObj.theProfiler.endStartSection("look"); + this.lookHelper.onUpdateLook(); + this.worldObj.theProfiler.endStartSection("jump"); + this.jumpHelper.doJump(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.endSection(); + } + + protected void updateEntityActionState() { + super.updateEntityActionState(); + this.moveStrafing = 0.0F; + this.moveForward = 0.0F; + this.despawnEntity(); + float var1 = 8.0F; + + if (this.rand.nextFloat() < 0.02F) { + EntityPlayer var4 = this.worldObj.getClosestPlayerToEntity(this, var1); + + if (var4 != null) { + this.currentTarget = var4; + this.numTicksToChaseTarget = 10 + this.rand.nextInt(20); + } else { + this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; + } + } + + if (this.currentTarget != null) { + this.faceEntity(this.currentTarget, 10.0F, (float)this.getVerticalFaceSpeed()); + + if (this.numTicksToChaseTarget-- <= 0 || this.currentTarget.isDead || this.currentTarget.getDistanceSqToEntity(this) > (double)(var1 * var1)) { + this.currentTarget = null; + } + } else { + if (this.rand.nextFloat() < 0.05F) { + this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; + } + + this.rotationYaw += this.randomYawVelocity; + this.rotationPitch = this.defaultPitch; + } + + boolean var41 = this.isInWater(); + boolean var3 = this.handleLavaMovement(); + + if (var41 || var3) { + this.isJumping = this.rand.nextFloat() < 0.8F; + } + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() { + return 40; + } + + /** + * Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument. + */ + public void faceEntity(Entity par1Entity, float par2, float par3) { + double var4 = par1Entity.posX - this.posX; + double var8 = par1Entity.posZ - this.posZ; + double var6; + + if (par1Entity instanceof EntityLivingBase) { + EntityLivingBase var14 = (EntityLivingBase)par1Entity; + var6 = var14.posY + (double)var14.getEyeHeight() - (this.posY + (double)this.getEyeHeight()); + } else { + var6 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) / 2.0D - (this.posY + (double)this.getEyeHeight()); + } + + double var141 = MathHelper.sqrt_double(var4 * var4 + var8 * var8); + float var12 = (float)(Math.atan2(var8, var4) * 180.0D / Math.PI) - 90.0F; + float var13 = (float)(-(Math.atan2(var6, var141) * 180.0D / Math.PI)); + this.rotationPitch = this.updateRotation(this.rotationPitch, var13, par3); + this.rotationYaw = this.updateRotation(this.rotationYaw, var12, par2); + } + + /** + * Arguments: current rotation, intended rotation, max increment. + */ + private float updateRotation(float par1, float par2, float par3) { + float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); + + if (var4 > par3) { + var4 = par3; + } + + if (var4 < -par3) { + var4 = -par3; + } + + return par1 + var4; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + /** + * Returns render size modifier + */ + public float getRenderSizeModifier() { + return 1.0F; + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 4; + } + + /** + * The number of iterations PathFinder.getSafePoint will execute before giving up. + */ + public int getMaxSafePointTries() { + if (this.getAttackTarget() == null) { + return 3; + } else { + int var1 = (int)(this.getHealth() - this.getMaxHealth() * 0.33F); + var1 -= (3 - this.worldObj.difficultySetting.getDifficultyId()) * 4; + + if (var1 < 0) { + var1 = 0; + } + + return var1 + 3; + } + } + + /** + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() { + return this.equipment[0]; + } + + /** + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int par1) { + return this.equipment[par1]; + } + + public ItemStack func_130225_q(int par1) { + return this.equipment[par1 + 1]; + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { + this.equipment[par1] = par2ItemStack; + } + + public ItemStack[] getLastActiveItems() { + return this.equipment; + } + + /** + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean par1, int par2) { + for (int var3 = 0; var3 < this.getLastActiveItems().length; ++var3) { + ItemStack var4 = this.getEquipmentInSlot(var3); + boolean var5 = this.equipmentDropChances[var3] > 1.0F; + + if (var4 != null && (par1 || var5) && this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3]) { + if (!var5 && var4.isItemStackDamageable()) { + int var6 = Math.max(var4.getMaxDamage() - 25, 1); + int var7 = var4.getMaxDamage() - this.rand.nextInt(this.rand.nextInt(var6) + 1); + + if (var7 > var6) { + var7 = var6; + } + + if (var7 < 1) { + var7 = 1; + } + + var4.setItemDamage(var7); + } + + this.entityDropItem(var4, 0.0F); + } + } + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() { + if (this.rand.nextFloat() < 0.15F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)) { + int var1 = this.rand.nextInt(2); + float var2 = this.worldObj.difficultySetting == EnumDifficulty.HARD ? 0.1F : 0.25F; + + if (this.rand.nextFloat() < 0.095F) { + ++var1; + } + + if (this.rand.nextFloat() < 0.095F) { + ++var1; + } + + if (this.rand.nextFloat() < 0.095F) { + ++var1; + } + + for (int var3 = 3; var3 >= 0; --var3) { + ItemStack var4 = this.func_130225_q(var3); + + if (var3 < 3 && this.rand.nextFloat() < var2) { + break; + } + + if (var4 == null) { + Item var5 = getArmorItemForSlot(var3 + 1, var1); + + if (var5 != null) { + this.setCurrentItemOrArmor(var3 + 1, new ItemStack(var5)); + } + } + } + } + } + + public static int getArmorPosition(ItemStack par0ItemStack) { + if (par0ItemStack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && par0ItemStack.getItem() != Items.skull) { + if (par0ItemStack.getItem() instanceof ItemArmor) { + switch (((ItemArmor)par0ItemStack.getItem()).armorType) { + case 0: + return 4; + + case 1: + return 3; + + case 2: + return 2; + + case 3: + return 1; + } + } + + return 0; + } else { + return 4; + } + } + + /** + * Params: Armor slot, Item tier + */ + public static Item getArmorItemForSlot(int par0, int par1) { + switch (par0) { + case 4: + if (par1 == 0) { + return Items.leather_helmet; + } + else if (par1 == 1) { + return Items.golden_helmet; + } + else if (par1 == 2) { + return Items.chainmail_helmet; + } + else if (par1 == 3) { + return Items.iron_helmet; + } + else if (par1 == 4) { + return Items.diamond_helmet; + } + + case 3: + if (par1 == 0) { + return Items.leather_chestplate; + } + else if (par1 == 1) { + return Items.golden_chestplate; + } + else if (par1 == 2) { + return Items.chainmail_chestplate; + } + else if (par1 == 3) { + return Items.iron_chestplate; + } + else if (par1 == 4) { + return Items.diamond_chestplate; + } + + case 2: + if (par1 == 0) { + return Items.leather_leggings; + } + else if (par1 == 1) { + return Items.golden_leggings; + } + else if (par1 == 2) { + return Items.chainmail_leggings; + } + else if (par1 == 3) { + return Items.iron_leggings; + } + else if (par1 == 4) { + return Items.diamond_leggings; + } + + case 1: + if (par1 == 0) { + return Items.leather_boots; + } + else if (par1 == 1) { + return Items.golden_boots; + } + else if (par1 == 2) { + return Items.chainmail_boots; + } + else if (par1 == 3) { + return Items.iron_boots; + } + else if (par1 == 4) { + return Items.diamond_boots; + } + + default: + return null; + } + } + + /** + * Enchants the entity's armor and held item based on difficulty + */ + protected void enchantEquipment() { + float var1 = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + + if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * var1) { + EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), (int)(5.0F + var1 * (float)this.rand.nextInt(18))); + } + + for (int var2 = 0; var2 < 4; ++var2) { + ItemStack var3 = this.func_130225_q(var2); + + if (var3 != null && this.rand.nextFloat() < 0.5F * var1) { + EnchantmentHelper.addRandomEnchantment(this.rand, var3, (int)(5.0F + var1 * (float)this.rand.nextInt(18))); + } + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { + this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1)); + return par1EntityLivingData; + } + + /** + * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden + * by a player and the player is holding a carrot-on-a-stick + */ + public boolean canBeSteered() { + return false; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return this.hasCustomNameTag() ? this.getCustomNameTag() : super.getCommandSenderName(); + } + + public void func_110163_bv() { + this.persistenceRequired = true; + } + + public void setCustomNameTag(String par1Str) { + this.dataWatcher.updateObject(10, par1Str); + } + + public String getCustomNameTag() { + return this.dataWatcher.getWatchableObjectString(10); + } + + public boolean hasCustomNameTag() { + return this.dataWatcher.getWatchableObjectString(10).length() > 0; + } + + public void setAlwaysRenderNameTag(boolean par1) { + this.dataWatcher.updateObject(11, Byte.valueOf((byte)(par1 ? 1 : 0))); + } + + public boolean getAlwaysRenderNameTag() { + return this.dataWatcher.getWatchableObjectByte(11) == 1; + } + + public boolean getAlwaysRenderNameTagForRender() { + return this.getAlwaysRenderNameTag(); + } + + public void setEquipmentDropChance(int par1, float par2) { + this.equipmentDropChances[par1] = par2; + } + + public boolean canPickUpLoot() { + return this.canPickUpLoot; + } + + public void setCanPickUpLoot(boolean par1) { + this.canPickUpLoot = par1; + } + + public boolean isNoDespawnRequired() { + return this.persistenceRequired; + } + + /** + * First layer of player interaction + */ + public final boolean interactFirst(EntityPlayer par1EntityPlayer) { + if (this.getLeashed() && this.getLeashedToEntity() == par1EntityPlayer) { + this.clearLeashed(true, !par1EntityPlayer.capabilities.isCreativeMode); + return true; + } else { + ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.lead && this.allowLeashing()) { + if (!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) { + this.setLeashedToEntity(par1EntityPlayer, true); + --var2.stackSize; + return true; + } + + if (((EntityTameable)this).func_152114_e(par1EntityPlayer)) { + this.setLeashedToEntity(par1EntityPlayer, true); + --var2.stackSize; + return true; + } + } + + return this.interact(par1EntityPlayer) || super.interactFirst(par1EntityPlayer); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer par1EntityPlayer) { + return false; + } + + /** + * Applies logic related to leashes, for example dragging the entity or breaking the leash. + */ + protected void updateLeashedState() { + if (this.field_110170_bx != null) { + this.recreateLeash(); + } + + if (this.isLeashed && (this.leashedToEntity == null || this.leashedToEntity.isDead)) { + this.clearLeashed(true, true); + } + } + + /** + * Removes the leash from this entity. Second parameter tells whether to send a packet to surrounding players. + */ + public void clearLeashed(boolean par1, boolean par2) { + if (this.isLeashed) { + this.isLeashed = false; + this.leashedToEntity = null; + + if (!this.worldObj.isClient && par2) { + this.func_145779_a(Items.lead, 1); + } + + if (!this.worldObj.isClient && par1 && this.worldObj instanceof WorldServer) { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, null)); + } + } + } + + public boolean allowLeashing() { + return !this.getLeashed() && !(this instanceof IMob); + } + + public boolean getLeashed() { + return this.isLeashed; + } + + public Entity getLeashedToEntity() { + return this.leashedToEntity; + } + + /** + * Sets the entity to be leashed to.\nArgs:\n@param par1Entity: The entity to be tethered to.\n@param par2: Whether + * to send an attaching notification packet to surrounding players. + */ + public void setLeashedToEntity(Entity par1Entity, boolean par2) { + this.isLeashed = true; + this.leashedToEntity = par1Entity; + + if (!this.worldObj.isClient && par2 && this.worldObj instanceof WorldServer) { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, this.leashedToEntity)); + } + } + + private void recreateLeash() { + if (this.isLeashed && this.field_110170_bx != null) { + if (this.field_110170_bx.func_150297_b("UUIDMost", 4) && this.field_110170_bx.func_150297_b("UUIDLeast", 4)) { + UUID var11 = new UUID(this.field_110170_bx.getLong("UUIDMost"), this.field_110170_bx.getLong("UUIDLeast")); + List var21 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(10.0D, 10.0D, 10.0D)); + + for (Object o : var21) { + EntityLivingBase var41 = (EntityLivingBase) o; + + if (var41.getUniqueID().equals(var11)) { + this.leashedToEntity = var41; + break; + } + } + } else if (this.field_110170_bx.func_150297_b("X", 99) && this.field_110170_bx.func_150297_b("Y", 99) && this.field_110170_bx.func_150297_b("Z", 99)) { + int var1 = this.field_110170_bx.getInteger("X"); + int var2 = this.field_110170_bx.getInteger("Y"); + int var3 = this.field_110170_bx.getInteger("Z"); + EntityLeashKnot var4 = EntityLeashKnot.getKnotForBlock(this.worldObj, var1, var2, var3); + + if (var4 == null) { + var4 = EntityLeashKnot.func_110129_a(this.worldObj, var1, var2, var3); + } + + this.leashedToEntity = var4; + } else { + this.clearLeashed(false, true); + } + } + + this.field_110170_bx = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLivingBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLivingBase.java new file mode 100644 index 0000000..1cdcb72 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityLivingBase.java @@ -0,0 +1,1915 @@ +package net.minecraft.entity; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.ai.attributes.*; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.*; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.scoreboard.Team; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +import java.util.*; + +public abstract class EntityLivingBase extends Entity { + private static final UUID sprintingSpeedBoostModifierUUID = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); + private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier(sprintingSpeedBoostModifierUUID, "Sprinting speed boost", 0.30000001192092896D, 2)).setSaved(false); + private BaseAttributeMap attributeMap; + private final CombatTracker _combatTracker = new CombatTracker(this); + private final HashMap activePotionsMap = new HashMap(); + + /** The equipment this mob was previously wearing, used for syncing. */ + private final ItemStack[] previousEquipment = new ItemStack[5]; + + /** Whether an arm swing is currently in progress. */ + public boolean isSwingInProgress; + public int swingProgressInt; + public int arrowHitTimer; + public float prevHealth; + + /** + * The amount of time remaining this entity should act 'hurt'. (Visual appearance of red tint) + */ + public int hurtTime; + + /** What the hurt time was max set to last. */ + public int maxHurtTime; + + /** The yaw at which this entity was last attacked from. */ + public float attackedAtYaw; + + /** + * The amount of time remaining this entity should act 'dead', i.e. have a corpse in the world. + */ + public int deathTime; + public int attackTime; + public float prevSwingProgress; + public float swingProgress; + public float prevLimbSwingAmount; + public float limbSwingAmount; + + /** + * Only relevant when limbYaw is not 0(the entity is moving). Influences where in its swing legs and arms currently + * are. + */ + public float limbSwing; + public int maxHurtResistantTime = 20; + public float prevCameraPitch; + public float cameraPitch; + public float field_70769_ao; + public float field_70770_ap; + public float renderYawOffset; + public float prevRenderYawOffset; + + /** Entity head rotation yaw */ + public float rotationYawHead; + + /** Entity head rotation yaw at previous tick */ + public float prevRotationYawHead; + + /** + * A factor used to determine how far this entity will move each tick if it is jumping or falling. + */ + public float jumpMovementFactor = 0.02F; + + /** The most recent player that has attacked this entity */ + protected EntityPlayer attackingPlayer; + + /** + * Set to 60 when hit by the player or the player's wolf, then decrements. Used to determine whether the entity + * should drop items on death. + */ + protected int recentlyHit; + + /** + * This gets set on entity death, but never used. Looks like a duplicate of isDead + */ + protected boolean dead; + + /** The age of this EntityLiving (used to determine when it dies) */ + public int entityAge; + protected float field_70768_au; + protected float field_110154_aX; + protected float field_70764_aw; + protected float field_70763_ax; + protected float field_70741_aB; + + /** The score value of the Mob, the amount of points the mob is worth. */ + protected int scoreValue; + + /** + * Damage taken in the last hit. Mobs are resistant to damage less than this for a short time after taking damage. + */ + protected float lastDamage; + + /** used to check whether entity is jumping. */ + protected boolean isJumping; + public float moveStrafing; + public float moveForward; + protected float randomYawVelocity; + + /** + * The number of updates over which the new position and rotation are to be applied to the entity. + */ + protected int newPosRotationIncrements; + + /** The new X position to be applied to the entity. */ + protected double newPosX; + + /** The new Y position to be applied to the entity. */ + protected double newPosY; + protected double newPosZ; + + /** The new yaw rotation to be applied to the entity. */ + protected double newRotationYaw; + + /** The new yaw rotation to be applied to the entity. */ + protected double newRotationPitch; + + /** Whether the DataWatcher needs to be updated with the active potions */ + private boolean potionsNeedUpdate = true; + + /** is only being set, has no uses as of MC 1.1 */ + private EntityLivingBase entityLivingToAttack; + private int revengeTimer; + private EntityLivingBase lastAttacker; + + /** Holds the value of ticksExisted when setLastAttacker was last called. */ + private int lastAttackerTime; + + /** + * A factor used to determine how far this entity will move each tick if it is walking on land. Adjusted by speed, + * and slipperiness of the current block. + */ + private float landMovementFactor; + + /** Number of ticks since last jump */ + private int jumpTicks; + private float field_110151_bq; + + + public EntityLivingBase(World p_i1594_1_) { + super(p_i1594_1_); + this.applyEntityAttributes(); + this.setHealth(this.getMaxHealth()); + this.preventEntitySpawning = true; + this.field_70770_ap = (float)(Math.random() + 1.0D) * 0.01F; + this.setPosition(this.posX, this.posY, this.posZ); + this.field_70769_ao = (float)Math.random() * 12398.0F; + this.rotationYaw = (float)(Math.random() * Math.PI * 2.0D); + this.rotationYawHead = this.rotationYaw; + this.stepHeight = 0.5F; + } + + protected void entityInit() { + this.dataWatcher.addObject(7, Integer.valueOf(0)); + this.dataWatcher.addObject(8, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(9, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(6, Float.valueOf(1.0F)); + } + + protected void applyEntityAttributes() { + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed); + + if (!this.isAIEnabled()) { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.10000000149011612D); + } + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double p_70064_1_, boolean p_70064_3_) { + if (!this.isInWater()) { + this.handleWaterMovement(); + } + + if (p_70064_3_ && this.fallDistance > 0.0F) { + int var4 = MathHelper.floor_double(this.posX); + int var5 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var6 = MathHelper.floor_double(this.posZ); + Block var7 = this.worldObj.getBlock(var4, var5, var6); + + if (var7.getMaterial() == Material.air) { + int var8 = this.worldObj.getBlock(var4, var5 - 1, var6).getRenderType(); + + if (var8 == 11 || var8 == 32 || var8 == 21) { + var7 = this.worldObj.getBlock(var4, var5 - 1, var6); + } + } else if (!this.worldObj.isClient && this.fallDistance > 3.0F) { + this.worldObj.playAuxSFX(2006, var4, var5, var6, MathHelper.ceiling_float_int(this.fallDistance - 3.0F)); + } + + var7.onFallenUpon(this.worldObj, var4, var5, var6, this, this.fallDistance); + } + + super.updateFallState(p_70064_1_, p_70064_3_); + } + + public boolean canBreatheUnderwater() { + return false; + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + this.prevSwingProgress = this.swingProgress; + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("livingEntityBaseTick"); + + if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) { + this.attackEntityFrom(DamageSource.inWall, 1.0F); + } + + if (this.isImmuneToFire() || this.worldObj.isClient) { + this.extinguish(); + } + + boolean var1 = this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.disableDamage; + + if (this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) { + if (!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !var1) { + this.setAir(this.decreaseAirSupply(this.getAir())); + + if (this.getAir() == -20) { + this.setAir(0); + + for (int var2 = 0; var2 < 8; ++var2) { + float var3 = this.rand.nextFloat() - this.rand.nextFloat(); + float var4 = this.rand.nextFloat() - this.rand.nextFloat(); + float var5 = this.rand.nextFloat() - this.rand.nextFloat(); + this.worldObj.spawnParticle("bubble", this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); + } + + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } + + if (!this.worldObj.isClient && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) { + this.mountEntity(null); + } + } else { + this.setAir(300); + } + + if (this.isEntityAlive() && this.isWet()) { + this.extinguish(); + } + + this.prevCameraPitch = this.cameraPitch; + + if (this.attackTime > 0) { + --this.attackTime; + } + + if (this.hurtTime > 0) { + --this.hurtTime; + } + + if (this.hurtResistantTime > 0 && !(this instanceof EntityPlayerMP)) { + --this.hurtResistantTime; + } + + if (this.getHealth() <= 0.0F) { + this.onDeathUpdate(); + } + + if (this.recentlyHit > 0) { + --this.recentlyHit; + } else { + this.attackingPlayer = null; + } + + if (this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) { + this.lastAttacker = null; + } + + if (this.entityLivingToAttack != null) { + if (!this.entityLivingToAttack.isEntityAlive()) { + this.setRevengeTarget(null); + } else if (this.ticksExisted - this.revengeTimer > 100) { + this.setRevengeTarget(null); + } + } + + this.updatePotionEffects(); + this.field_70763_ax = this.field_70764_aw; + this.prevRenderYawOffset = this.renderYawOffset; + this.prevRotationYawHead = this.rotationYawHead; + this.prevRotationYaw = this.rotationYaw; + this.prevRotationPitch = this.rotationPitch; + this.worldObj.theProfiler.endSection(); + } + + /** + * If Animal, checks if the age timer is negative + */ + public boolean isChild() { + return false; + } + + /** + * handles entity death timer, experience orb and particle creation + */ + protected void onDeathUpdate() { + ++this.deathTime; + + if (this.deathTime == 20) { + int var1; + + if (!this.worldObj.isClient && (this.recentlyHit > 0 || this.isPlayer()) && this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { + var1 = this.getExperiencePoints(this.attackingPlayer); + + while (var1 > 0) { + int var2 = EntityXPOrb.getXPSplit(var1); + var1 -= var2; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2)); + } + } + + this.setDead(); + + for (var1 = 0; var1 < 20; ++var1) { + double var8 = this.rand.nextGaussian() * 0.02D; + double var4 = this.rand.nextGaussian() * 0.02D; + double var6 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var8, var4, var6); + } + } + } + + protected boolean func_146066_aG() { + return !this.isChild(); + } + + /** + * Decrements the entity's air supply when underwater + */ + protected int decreaseAirSupply(int p_70682_1_) { + int var2 = EnchantmentHelper.getRespiration(this); + return var2 > 0 && this.rand.nextInt(var2 + 1) > 0 ? p_70682_1_ : p_70682_1_ - 1; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) { + return 0; + } + + /** + * Only use is to identify if class is an instance of player for experience dropping + */ + protected boolean isPlayer() { + return false; + } + + public Random getRNG() { + return this.rand; + } + + public EntityLivingBase getAITarget() { + return this.entityLivingToAttack; + } + + public int func_142015_aE() { + return this.revengeTimer; + } + + public void setRevengeTarget(EntityLivingBase p_70604_1_) { + this.entityLivingToAttack = p_70604_1_; + this.revengeTimer = this.ticksExisted; + } + + public EntityLivingBase getLastAttacker() { + return this.lastAttacker; + } + + public int getLastAttackerTime() { + return this.lastAttackerTime; + } + + public void setLastAttacker(Entity p_130011_1_) { + if (p_130011_1_ instanceof EntityLivingBase) { + this.lastAttacker = (EntityLivingBase)p_130011_1_; + } else { + this.lastAttacker = null; + } + + this.lastAttackerTime = this.ticksExisted; + } + + public int getAge() { + return this.entityAge; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setFloat("HealF", this.getHealth()); + p_70014_1_.setShort("Health", (short)((int)Math.ceil(this.getHealth()))); + p_70014_1_.setShort("HurtTime", (short)this.hurtTime); + p_70014_1_.setShort("DeathTime", (short)this.deathTime); + p_70014_1_.setShort("AttackTime", (short)this.attackTime); + p_70014_1_.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); + ItemStack[] var2 = this.getLastActiveItems(); + int var3 = var2.length; + int var4; + ItemStack var5; + + for (var4 = 0; var4 < var3; ++var4) { + var5 = var2[var4]; + + if (var5 != null) { + this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers()); + } + } + + p_70014_1_.setTag("Attributes", SharedMonsterAttributes.writeBaseAttributeMapToNBT(this.getAttributeMap())); + var2 = this.getLastActiveItems(); + var3 = var2.length; + + for (var4 = 0; var4 < var3; ++var4) { + var5 = var2[var4]; + + if (var5 != null) { + this.attributeMap.applyAttributeModifiers(var5.getAttributeModifiers()); + } + } + + if (!this.activePotionsMap.isEmpty()) { + NBTTagList var6 = new NBTTagList(); + Iterator var7 = this.activePotionsMap.values().iterator(); + + while (var7.hasNext()) { + PotionEffect var8 = (PotionEffect)var7.next(); + var6.appendTag(var8.writeCustomPotionEffectToNBT(new NBTTagCompound())); + } + + p_70014_1_.setTag("ActiveEffects", var6); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.setAbsorptionAmount(p_70037_1_.getFloat("AbsorptionAmount")); + + if (p_70037_1_.func_150297_b("Attributes", 9) && this.worldObj != null && !this.worldObj.isClient) { + SharedMonsterAttributes.func_151475_a(this.getAttributeMap(), p_70037_1_.getTagList("Attributes", 10)); + } + + if (p_70037_1_.func_150297_b("ActiveEffects", 9)) { + NBTTagList var2 = p_70037_1_.getTagList("ActiveEffects", 10); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + PotionEffect var5 = PotionEffect.readCustomPotionEffectFromNBT(var4); + + if (var5 != null) { + this.activePotionsMap.put(Integer.valueOf(var5.getPotionID()), var5); + } + } + } + + if (p_70037_1_.func_150297_b("HealF", 99)) { + this.setHealth(p_70037_1_.getFloat("HealF")); + } else { + NBTBase var6 = p_70037_1_.getTag("Health"); + + if (var6 == null) { + this.setHealth(this.getMaxHealth()); + } else if (var6.getId() == 5) { + this.setHealth(((NBTTagFloat)var6).func_150288_h()); + } else if (var6.getId() == 2) { + this.setHealth(((NBTTagShort)var6).func_150289_e()); + } + } + + this.hurtTime = p_70037_1_.getShort("HurtTime"); + this.deathTime = p_70037_1_.getShort("DeathTime"); + this.attackTime = p_70037_1_.getShort("AttackTime"); + } + + protected void updatePotionEffects() { + Iterator var1 = this.activePotionsMap.keySet().iterator(); + + while (var1.hasNext()) { + Integer var2 = (Integer)var1.next(); + PotionEffect var3 = (PotionEffect)this.activePotionsMap.get(var2); + + if (!var3.onUpdate(this)) { + if (!this.worldObj.isClient) { + var1.remove(); + this.onFinishedPotionEffect(var3); + } + } else if (var3.getDuration() % 600 == 0) { + this.onChangedPotionEffect(var3, false); + } + } + + int var11; + + if (this.potionsNeedUpdate) { + if (!this.worldObj.isClient) { + if (this.activePotionsMap.isEmpty()) { + this.dataWatcher.updateObject(8, Byte.valueOf((byte)0)); + this.dataWatcher.updateObject(7, Integer.valueOf(0)); + this.setInvisible(false); + } else { + var11 = PotionHelper.calcPotionLiquidColor(this.activePotionsMap.values()); + this.dataWatcher.updateObject(8, Byte.valueOf((byte)(PotionHelper.func_82817_b(this.activePotionsMap.values()) ? 1 : 0))); + this.dataWatcher.updateObject(7, Integer.valueOf(var11)); + this.setInvisible(this.isPotionActive(Potion.invisibility.id)); + } + } + + this.potionsNeedUpdate = false; + } + + var11 = this.dataWatcher.getWatchableObjectInt(7); + boolean var12 = this.dataWatcher.getWatchableObjectByte(8) > 0; + + if (var11 > 0) { + boolean var4 = false; + + if (!this.isInvisible()) { + var4 = this.rand.nextBoolean(); + } else { + var4 = this.rand.nextInt(15) == 0; + } + + if (var12) { + var4 &= this.rand.nextInt(5) == 0; + } + + if (var4 && var11 > 0) { + double var5 = (double)(var11 >> 16 & 255) / 255.0D; + double var7 = (double)(var11 >> 8 & 255) / 255.0D; + double var9 = (double)(var11 >> 0 & 255) / 255.0D; + this.worldObj.spawnParticle(var12 ? "mobSpellAmbient" : "mobSpell", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - (double)this.yOffset, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, var5, var7, var9); + } + } + } + + public void clearActivePotions() { + Iterator var1 = this.activePotionsMap.keySet().iterator(); + + while (var1.hasNext()) { + Integer var2 = (Integer)var1.next(); + PotionEffect var3 = (PotionEffect)this.activePotionsMap.get(var2); + + if (!this.worldObj.isClient) { + var1.remove(); + this.onFinishedPotionEffect(var3); + } + } + } + + public Collection getActivePotionEffects() { + return this.activePotionsMap.values(); + } + + public boolean isPotionActive(int p_82165_1_) { + return this.activePotionsMap.containsKey(Integer.valueOf(p_82165_1_)); + } + + public boolean isPotionActive(Potion p_70644_1_) { + return this.activePotionsMap.containsKey(Integer.valueOf(p_70644_1_.id)); + } + + /** + * returns the PotionEffect for the supplied Potion if it is active, null otherwise. + */ + public PotionEffect getActivePotionEffect(Potion p_70660_1_) { + return (PotionEffect)this.activePotionsMap.get(Integer.valueOf(p_70660_1_.id)); + } + + /** + * adds a PotionEffect to the entity + */ + public void addPotionEffect(PotionEffect p_70690_1_) { + if (this.isPotionApplicable(p_70690_1_)) { + if (this.activePotionsMap.containsKey(Integer.valueOf(p_70690_1_.getPotionID()))) { + ((PotionEffect)this.activePotionsMap.get(Integer.valueOf(p_70690_1_.getPotionID()))).combine(p_70690_1_); + this.onChangedPotionEffect((PotionEffect)this.activePotionsMap.get(Integer.valueOf(p_70690_1_.getPotionID())), true); + } else { + this.activePotionsMap.put(Integer.valueOf(p_70690_1_.getPotionID()), p_70690_1_); + this.onNewPotionEffect(p_70690_1_); + } + } + } + + public boolean isPotionApplicable(PotionEffect p_70687_1_) { + if (this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { + int var2 = p_70687_1_.getPotionID(); + + return var2 != Potion.regeneration.id && var2 != Potion.poison.id; + } + + return true; + } + + /** + * Returns true if this entity is undead. + */ + public boolean isEntityUndead() { + return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; + } + + /** + * Remove the speified potion effect from this entity. + */ + public void removePotionEffectClient(int p_70618_1_) { + this.activePotionsMap.remove(Integer.valueOf(p_70618_1_)); + } + + /** + * Remove the specified potion effect from this entity. + */ + public void removePotionEffect(int p_82170_1_) { + PotionEffect var2 = (PotionEffect)this.activePotionsMap.remove(Integer.valueOf(p_82170_1_)); + + if (var2 != null) { + this.onFinishedPotionEffect(var2); + } + } + + protected void onNewPotionEffect(PotionEffect p_70670_1_) { + this.potionsNeedUpdate = true; + + if (!this.worldObj.isClient) { + Potion.potionTypes[p_70670_1_.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), p_70670_1_.getAmplifier()); + } + } + + protected void onChangedPotionEffect(PotionEffect p_70695_1_, boolean p_70695_2_) { + this.potionsNeedUpdate = true; + + if (p_70695_2_ && !this.worldObj.isClient) { + Potion.potionTypes[p_70695_1_.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), p_70695_1_.getAmplifier()); + Potion.potionTypes[p_70695_1_.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), p_70695_1_.getAmplifier()); + } + } + + protected void onFinishedPotionEffect(PotionEffect p_70688_1_) { + this.potionsNeedUpdate = true; + + if (!this.worldObj.isClient) { + Potion.potionTypes[p_70688_1_.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), p_70688_1_.getAmplifier()); + } + } + + /** + * Heal living entity (param: amount of half-hearts) + */ + public void heal(float p_70691_1_) { + float var2 = this.getHealth(); + + if (var2 > 0.0F) { + this.setHealth(var2 + p_70691_1_); + } + } + + public final float getHealth() { + return this.dataWatcher.getWatchableObjectFloat(6); + } + + public void setHealth(float p_70606_1_) { + this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(p_70606_1_, 0.0F, this.getMaxHealth()))); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if (this.worldObj.isClient) { + return false; + } else { + this.entityAge = 0; + + if (this.getHealth() <= 0.0F) { + return false; + } else if (p_70097_1_.isFireDamage() && this.isPotionActive(Potion.fireResistance)) { + return false; + } else { + if ((p_70097_1_ == DamageSource.anvil || p_70097_1_ == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) { + this.getEquipmentInSlot(4).damageItem((int)(p_70097_2_ * 4.0F + this.rand.nextFloat() * p_70097_2_ * 2.0F), this); + p_70097_2_ *= 0.75F; + } + + this.limbSwingAmount = 1.5F; + boolean var3 = true; + + if ((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) { + if (p_70097_2_ <= this.lastDamage) { + return false; + } + + this.damageEntity(p_70097_1_, p_70097_2_ - this.lastDamage); + this.lastDamage = p_70097_2_; + var3 = false; + } else { + this.lastDamage = p_70097_2_; + this.prevHealth = this.getHealth(); + this.hurtResistantTime = this.maxHurtResistantTime; + this.damageEntity(p_70097_1_, p_70097_2_); + this.hurtTime = this.maxHurtTime = 10; + } + + this.attackedAtYaw = 0.0F; + Entity var4 = p_70097_1_.getEntity(); + + if (var4 != null) { + if (var4 instanceof EntityLivingBase) { + this.setRevengeTarget((EntityLivingBase)var4); + } + + if (var4 instanceof EntityPlayer) { + this.recentlyHit = 100; + this.attackingPlayer = (EntityPlayer)var4; + } else if (var4 instanceof EntityWolf) { + EntityWolf var5 = (EntityWolf)var4; + + if (var5.isTamed()) { + this.recentlyHit = 100; + this.attackingPlayer = null; + } + } + } + + if (var3) { + this.worldObj.setEntityState(this, (byte)2); + + if (p_70097_1_ != DamageSource.drown) { + this.setBeenAttacked(); + } + + if (var4 != null) { + double var9 = var4.posX - this.posX; + double var7; + + for (var7 = var4.posZ - this.posZ; var9 * var9 + var7 * var7 < 1.0E-4D; var7 = (Math.random() - Math.random()) * 0.01D) { + var9 = (Math.random() - Math.random()) * 0.01D; + } + + this.attackedAtYaw = (float)(Math.atan2(var7, var9) * 180.0D / Math.PI) - this.rotationYaw; + this.knockBack(var4, p_70097_2_, var9, var7); + } else { + this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180); + } + } + + String var10; + + if (this.getHealth() <= 0.0F) { + var10 = this.getDeathSound(); + + if (var3 && var10 != null) { + this.playSound(var10, this.getSoundVolume(), this.getSoundPitch()); + } + + this.onDeath(p_70097_1_); + } else { + var10 = this.getHurtSound(); + + if (var3 && var10 != null) { + this.playSound(var10, this.getSoundVolume(), this.getSoundPitch()); + } + } + + return true; + } + } + } + + /** + * Renders broken item particles using the given ItemStack + */ + public void renderBrokenItemStack(ItemStack p_70669_1_) { + this.playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F); + + for (int var2 = 0; var2 < 5; ++var2) { + Vec3 var3 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + var3.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var3.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + Vec3 var4 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); + var4.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var4.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + var4 = var4.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); + this.worldObj.spawnParticle("iconcrack_" + Item.getIdFromItem(p_70669_1_.getItem()), var4.xCoord, var4.yCoord, var4.zCoord, var3.xCoord, var3.yCoord + 0.05D, var3.zCoord); + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + Entity var2 = p_70645_1_.getEntity(); + EntityLivingBase var3 = this.func_94060_bK(); + + if (this.scoreValue >= 0 && var3 != null) { + var3.addToPlayerScore(this, this.scoreValue); + } + + if (var2 != null) { + var2.onKillEntity(this); + } + + this.dead = true; + this.func_110142_aN().func_94549_h(); + + if (!this.worldObj.isClient) { + int var4 = 0; + + if (var2 instanceof EntityPlayer) { + var4 = EnchantmentHelper.getLootingModifier((EntityLivingBase)var2); + } + + if (this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { + this.dropFewItems(this.recentlyHit > 0, var4); + this.dropEquipment(this.recentlyHit > 0, var4); + + if (this.recentlyHit > 0) { + int var5 = this.rand.nextInt(200) - var4; + + if (var5 < 5) { + this.dropRareDrop(var5 <= 0 ? 1 : 0); + } + } + } + } + + this.worldObj.setEntityState(this, (byte)3); + } + + /** + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean p_82160_1_, int p_82160_2_) {} + + /** + * knocks back this entity + */ + public void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) { + if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { + this.isAirBorne = true; + float var7 = MathHelper.sqrt_double(p_70653_3_ * p_70653_3_ + p_70653_5_ * p_70653_5_); + float var8 = 0.4F; + this.motionX /= 2.0D; + this.motionY /= 2.0D; + this.motionZ /= 2.0D; + this.motionX -= p_70653_3_ / (double)var7 * (double)var8; + this.motionY += var8; + this.motionZ -= p_70653_5_ / (double)var7 * (double)var8; + + if (this.motionY > 0.4000000059604645D) { + this.motionY = 0.4000000059604645D; + } + } + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "game.neutral.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "game.neutral.die"; + } + + protected void dropRareDrop(int p_70600_1_) {} + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {} + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); + int var3 = MathHelper.floor_double(this.posZ); + Block var4 = this.worldObj.getBlock(var1, var2, var3); + return var4 == Blocks.ladder || var4 == Blocks.vine; + } + + /** + * Checks whether target entity is alive. + */ + public boolean isEntityAlive() { + return !this.isDead && this.getHealth() > 0.0F; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + super.fall(p_70069_1_); + PotionEffect var2 = this.getActivePotionEffect(Potion.jump); + float var3 = var2 != null ? (float)(var2.getAmplifier() + 1) : 0.0F; + int var4 = MathHelper.ceiling_float_int(p_70069_1_ - 3.0F - var3); + + if (var4 > 0) { + this.playSound(this.func_146067_o(var4), 1.0F, 1.0F); + this.attackEntityFrom(DamageSource.fall, (float)var4); + int var5 = MathHelper.floor_double(this.posX); + int var6 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var7 = MathHelper.floor_double(this.posZ); + Block var8 = this.worldObj.getBlock(var5, var6, var7); + + if (var8.getMaterial() != Material.air) { + Block.SoundType var9 = var8.stepSound; + this.playSound(var9.func_150498_e(), var9.func_150497_c() * 0.5F, var9.func_150494_d() * 0.75F); + } + } + } + + protected String func_146067_o(int p_146067_1_) { + return p_146067_1_ > 4 ? "game.neutral.hurt.fall.big" : "game.neutral.hurt.fall.small"; + } + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + public void performHurtAnimation() { + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + int var1 = 0; + ItemStack[] var2 = this.getLastActiveItems(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; + + if (var5 != null && var5.getItem() instanceof ItemArmor) { + int var6 = ((ItemArmor)var5.getItem()).damageReduceAmount; + var1 += var6; + } + } + + return var1; + } + + protected void damageArmor(float p_70675_1_) {} + + /** + * Reduces damage, depending on armor + */ + protected float applyArmorCalculations(DamageSource p_70655_1_, float p_70655_2_) { + if (!p_70655_1_.isUnblockable()) { + int var3 = 25 - this.getTotalArmorValue(); + float var4 = p_70655_2_ * (float)var3; + this.damageArmor(p_70655_2_); + p_70655_2_ = var4 / 25.0F; + } + + return p_70655_2_; + } + + /** + * Reduces damage, depending on potions + */ + protected float applyPotionDamageCalculations(DamageSource p_70672_1_, float p_70672_2_) { + if (p_70672_1_.isDamageAbsolute()) { + return p_70672_2_; + } else { + if (this instanceof EntityZombie) { + p_70672_2_ = p_70672_2_; + } + + int var3; + int var4; + float var5; + + if (this.isPotionActive(Potion.resistance) && p_70672_1_ != DamageSource.outOfWorld) { + var3 = (this.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5; + var4 = 25 - var3; + var5 = p_70672_2_ * (float)var4; + p_70672_2_ = var5 / 25.0F; + } + + if (p_70672_2_ <= 0.0F) { + return 0.0F; + } else { + var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getLastActiveItems(), p_70672_1_); + + if (var3 > 20) { + var3 = 20; + } + + if (var3 > 0 && var3 <= 20) { + var4 = 25 - var3; + var5 = p_70672_2_ * (float)var4; + p_70672_2_ = var5 / 25.0F; + } + + return p_70672_2_; + } + } + } + + /** + * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health + * second with the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource p_70665_1_, float p_70665_2_) { + if (!this.isEntityInvulnerable()) { + p_70665_2_ = this.applyArmorCalculations(p_70665_1_, p_70665_2_); + p_70665_2_ = this.applyPotionDamageCalculations(p_70665_1_, p_70665_2_); + float var3 = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - p_70665_2_)); + + if (p_70665_2_ != 0.0F) { + float var4 = this.getHealth(); + this.setHealth(var4 - p_70665_2_); + this.func_110142_aN().func_94547_a(p_70665_1_, var4, p_70665_2_); + this.setAbsorptionAmount(this.getAbsorptionAmount() - p_70665_2_); + } + } + } + + public CombatTracker func_110142_aN() { + return this._combatTracker; + } + + public EntityLivingBase func_94060_bK() { + return this._combatTracker.func_94550_c() != null ? this._combatTracker.func_94550_c() : (this.attackingPlayer != null ? this.attackingPlayer : (this.entityLivingToAttack != null ? this.entityLivingToAttack : null)); + } + + public final float getMaxHealth() { + return (float)this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(); + } + + /** + * counts the amount of arrows stuck in the entity. getting hit by arrows increases this, used in rendering + */ + public final int getArrowCountInEntity() { + return this.dataWatcher.getWatchableObjectByte(9); + } + + /** + * sets the amount of arrows stuck in the entity. used for rendering those + */ + public final void setArrowCountInEntity(int p_85034_1_) { + this.dataWatcher.updateObject(9, Byte.valueOf((byte)p_85034_1_)); + } + + /** + * Returns an integer indicating the end point of the swing animation, used by {@link #swingProgress} to provide a + * progress indicator. Takes dig speed enchantments into account. + */ + private int getArmSwingAnimationEnd() { + return this.isPotionActive(Potion.digSpeed) ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6); + } + + /** + * Swings the item the player is holding. + */ + public void swingItem() { + if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { + this.swingProgressInt = -1; + this.isSwingInProgress = true; + + if (this.worldObj instanceof WorldServer) { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S0BPacketAnimation(this, 0)); + } + } + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 2) { + this.limbSwingAmount = 1.5F; + this.hurtResistantTime = this.maxHurtResistantTime; + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.attackEntityFrom(DamageSource.generic, 0.0F); + } else if (p_70103_1_ == 3) { + this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.setHealth(0.0F); + this.onDeath(DamageSource.generic); + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * sets the dead flag. Used when you fall off the bottom of the world. + */ + protected void kill() { + this.attackEntityFrom(DamageSource.outOfWorld, 4.0F); + } + + /** + * Updates the arm swing progress counters and animation progress + */ + protected void updateArmSwingProgress() { + int var1 = this.getArmSwingAnimationEnd(); + + if (this.isSwingInProgress) { + ++this.swingProgressInt; + + if (this.swingProgressInt >= var1) { + this.swingProgressInt = 0; + this.isSwingInProgress = false; + } + } else { + this.swingProgressInt = 0; + } + + this.swingProgress = (float)this.swingProgressInt / (float)var1; + } + + public IAttributeInstance getEntityAttribute(IAttribute p_110148_1_) { + return this.getAttributeMap().getAttributeInstance(p_110148_1_); + } + + public BaseAttributeMap getAttributeMap() { + if (this.attributeMap == null) { + this.attributeMap = new ServersideAttributeMap(); + } + + return this.attributeMap; + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEFINED; + } + + /** + * Returns the item that this EntityLiving is holding, if any. + */ + public abstract ItemStack getHeldItem(); + + /** + * 0: Tool in Hand; 1-4: Armor + */ + public abstract ItemStack getEquipmentInSlot(int p_71124_1_); + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public abstract void setCurrentItemOrArmor(int p_70062_1_, ItemStack p_70062_2_); + + /** + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean p_70031_1_) { + super.setSprinting(p_70031_1_); + IAttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (var2.getModifier(sprintingSpeedBoostModifierUUID) != null) { + var2.removeModifier(sprintingSpeedBoostModifier); + } + + if (p_70031_1_) { + var2.applyModifier(sprintingSpeedBoostModifier); + } + } + + public abstract ItemStack[] getLastActiveItems(); + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 1.0F; + } + + /** + * Gets the pitch of living sounds in living entities. + */ + protected float getSoundPitch() { + return this.isChild() ? (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.5F : (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F; + } + + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() { + return this.getHealth() <= 0.0F; + } + + /** + * Sets the position of the entity and updates the 'last' variables + */ + public void setPositionAndUpdate(double p_70634_1_, double p_70634_3_, double p_70634_5_) { + this.setLocationAndAngles(p_70634_1_, p_70634_3_, p_70634_5_, this.rotationYaw, this.rotationPitch); + } + + /** + * Moves the entity to a position out of the way of its mount. + */ + public void dismountEntity(Entity p_110145_1_) { + double var3 = p_110145_1_.posX; + double var5 = p_110145_1_.boundingBox.minY + (double)p_110145_1_.height; + double var7 = p_110145_1_.posZ; + byte var9 = 1; + + for (int var10 = -var9; var10 <= var9; ++var10) { + for (int var11 = -var9; var11 < var9; ++var11) { + if (var10 != 0 || var11 != 0) { + int var12 = (int)(this.posX + (double)var10); + int var13 = (int)(this.posZ + (double)var11); + AxisAlignedBB var2 = this.boundingBox.getOffsetBoundingBox(var10, 1.0D, var11); + + if (this.worldObj.func_147461_a(var2).isEmpty()) { + if (World.doesBlockHaveSolidTopSurface(this.worldObj, var12, (int)this.posY, var13)) { + this.setPositionAndUpdate(this.posX + (double)var10, this.posY + 1.0D, this.posZ + (double)var11); + return; + } + + if (World.doesBlockHaveSolidTopSurface(this.worldObj, var12, (int)this.posY - 1, var13) || this.worldObj.getBlock(var12, (int)this.posY - 1, var13).getMaterial() == Material.water) { + var3 = this.posX + (double)var10; + var5 = this.posY + 1.0D; + var7 = this.posZ + (double)var11; + } + } + } + } + } + + this.setPositionAndUpdate(var3, var5, var7); + } + + public boolean getAlwaysRenderNameTagForRender() { + return false; + } + + /** + * Gets the Icon Index of the item currently held + */ + public IIcon getItemIcon(ItemStack p_70620_1_, int p_70620_2_) { + return p_70620_1_.getItem().requiresMultipleRenderPasses() ? p_70620_1_.getItem().getIconFromDamageForRenderPass(p_70620_1_.getItemDamage(), p_70620_2_) : p_70620_1_.getIconIndex(); + } + + /** + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() { + this.motionY = 0.41999998688697815D; + + if (this.isPotionActive(Potion.jump)) { + this.motionY += (float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F; + } + + if (this.isSprinting()) { + float var1 = this.rotationYaw * 0.017453292F; + this.motionX -= MathHelper.sin(var1) * 0.2F; + this.motionZ += MathHelper.cos(var1) * 0.2F; + } + + this.isAirBorne = true; + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) { + double var8; + + if (this.isInWater() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) { + var8 = this.posY; + this.moveFlying(p_70612_1_, p_70612_2_, this.isAIEnabled() ? 0.04F : 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + this.motionY -= 0.02D; + + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + var8, this.motionZ)) { + this.motionY = 0.30000001192092896D; + } + } else if (this.handleLavaMovement() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) { + var8 = this.posY; + this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + this.motionY -= 0.02D; + + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + var8, this.motionZ)) { + this.motionY = 0.30000001192092896D; + } + } else { + float var3 = 0.91F; + + if (this.onGround) { + var3 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + float var4 = 0.16277136F / (var3 * var3 * var3); + float var5; + + if (this.onGround) { + var5 = this.getAIMoveSpeed() * var4; + } else { + var5 = this.jumpMovementFactor; + } + + this.moveFlying(p_70612_1_, p_70612_2_, var5); + var3 = 0.91F; + + if (this.onGround) { + var3 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + if (this.isOnLadder()) { + float var6 = 0.15F; + + if (this.motionX < (double)(-var6)) { + this.motionX = -var6; + } + + if (this.motionX > (double)var6) { + this.motionX = var6; + } + + if (this.motionZ < (double)(-var6)) { + this.motionZ = -var6; + } + + if (this.motionZ > (double)var6) { + this.motionZ = var6; + } + + this.fallDistance = 0.0F; + + if (this.motionY < -0.15D) { + this.motionY = -0.15D; + } + + boolean var7 = this.isSneaking() && this instanceof EntityPlayer; + + if (var7 && this.motionY < 0.0D) { + this.motionY = 0.0D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.isCollidedHorizontally && this.isOnLadder()) { + this.motionY = 0.2D; + } + + if (this.worldObj.isClient && (!this.worldObj.blockExists((int)this.posX, 0, (int)this.posZ) || !this.worldObj.getChunkFromBlockCoords((int)this.posX, (int)this.posZ).isChunkLoaded)) { + if (this.posY > 0.0D) { + this.motionY = -0.1D; + } else { + this.motionY = 0.0D; + } + } else { + this.motionY -= 0.08D; + } + + this.motionY *= 0.9800000190734863D; + this.motionX *= var3; + this.motionZ *= var3; + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + var8 = this.posX - this.prevPosX; + double var9 = this.posZ - this.prevPosZ; + float var10 = MathHelper.sqrt_double(var8 * var8 + var9 * var9) * 4.0F; + + if (var10 > 1.0F) { + var10 = 1.0F; + } + + this.limbSwingAmount += (var10 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return false; + } + + /** + * the movespeed used for the new AI system + */ + public float getAIMoveSpeed() { + return this.isAIEnabled() ? this.landMovementFactor : 0.1F; + } + + /** + * set the movespeed used for the new AI system + */ + public void setAIMoveSpeed(float p_70659_1_) { + this.landMovementFactor = p_70659_1_; + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + this.setLastAttacker(p_70652_1_); + return false; + } + + /** + * Returns whether player is sleeping or not + */ + public boolean isPlayerSleeping() { + return false; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (!this.worldObj.isClient) { + int var1 = this.getArrowCountInEntity(); + + if (var1 > 0) { + if (this.arrowHitTimer <= 0) { + this.arrowHitTimer = 20 * (30 - var1); + } + + --this.arrowHitTimer; + + if (this.arrowHitTimer <= 0) { + this.setArrowCountInEntity(var1 - 1); + } + } + + for (int var2 = 0; var2 < 5; ++var2) { + ItemStack var3 = this.previousEquipment[var2]; + ItemStack var4 = this.getEquipmentInSlot(var2); + + if (!ItemStack.areItemStacksEqual(var4, var3)) { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S04PacketEntityEquipment(this.getEntityId(), var2, var4)); + + if (var3 != null) { + this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers()); + } + + if (var4 != null) { + this.attributeMap.applyAttributeModifiers(var4.getAttributeModifiers()); + } + + this.previousEquipment[var2] = var4 == null ? null : var4.copy(); + } + } + + if (this.ticksExisted % 20 == 0) { + this.func_110142_aN().func_94549_h(); + } + } + + this.onLivingUpdate(); + double var9 = this.posX - this.prevPosX; + double var10 = this.posZ - this.prevPosZ; + float var5 = (float)(var9 * var9 + var10 * var10); + float var6 = this.renderYawOffset; + float var7 = 0.0F; + this.field_70768_au = this.field_110154_aX; + float var8 = 0.0F; + + if (var5 > 0.0025000002F) { + var8 = 1.0F; + var7 = (float)Math.sqrt(var5) * 3.0F; + var6 = (float)Math.atan2(var10, var9) * 180.0F / (float)Math.PI - 90.0F; + } + + if (this.swingProgress > 0.0F) { + var6 = this.rotationYaw; + } + + if (!this.onGround) { + var8 = 0.0F; + } + + this.field_110154_aX += (var8 - this.field_110154_aX) * 0.3F; + this.worldObj.theProfiler.startSection("headTurn"); + var7 = this.func_110146_f(var6, var7); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rangeChecks"); + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset < -180.0F) { + this.prevRenderYawOffset -= 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) { + this.prevRenderYawOffset += 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch < -180.0F) { + this.prevRotationPitch -= 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead < -180.0F) { + this.prevRotationYawHead -= 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead >= 180.0F) { + this.prevRotationYawHead += 360.0F; + } + + this.worldObj.theProfiler.endSection(); + this.field_70764_aw += var7; + } + + protected float func_110146_f(float p_110146_1_, float p_110146_2_) { + float var3 = MathHelper.wrapAngleTo180_float(p_110146_1_ - this.renderYawOffset); + this.renderYawOffset += var3 * 0.3F; + float var4 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.renderYawOffset); + boolean var5 = var4 < -90.0F || var4 >= 90.0F; + + if (var4 < -75.0F) { + var4 = -75.0F; + } + + if (var4 >= 75.0F) { + var4 = 75.0F; + } + + this.renderYawOffset = this.rotationYaw - var4; + + if (var4 * var4 > 2500.0F) { + this.renderYawOffset += var4 * 0.2F; + } + + if (var5) { + p_110146_2_ *= -1.0F; + } + + return p_110146_2_; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.jumpTicks > 0) { + --this.jumpTicks; + } + + if (this.newPosRotationIncrements > 0) { + double var1 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + double var3 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + double var5 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; + double var7 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + var7 / (double)this.newPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(var1, var3, var5); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else if (!this.isClientWorld()) { + this.motionX *= 0.98D; + this.motionY *= 0.98D; + this.motionZ *= 0.98D; + } + + if (Math.abs(this.motionX) < 0.005D) { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) < 0.005D) { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) < 0.005D) { + this.motionZ = 0.0D; + } + + this.worldObj.theProfiler.startSection("ai"); + + if (this.isMovementBlocked()) { + this.isJumping = false; + this.moveStrafing = 0.0F; + this.moveForward = 0.0F; + this.randomYawVelocity = 0.0F; + } else if (this.isClientWorld()) { + if (this.isAIEnabled()) { + this.worldObj.theProfiler.startSection("newAi"); + this.updateAITasks(); + this.worldObj.theProfiler.endSection(); + } else { + this.worldObj.theProfiler.startSection("oldAi"); + this.updateEntityActionState(); + this.worldObj.theProfiler.endSection(); + this.rotationYawHead = this.rotationYaw; + } + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("jump"); + + if (this.isJumping) { + if (!this.isInWater() && !this.handleLavaMovement()) { + if (this.onGround && this.jumpTicks == 0) { + this.jump(); + this.jumpTicks = 10; + } + } else { + this.motionY += 0.03999999910593033D; + } + } else { + this.jumpTicks = 0; + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("travel"); + this.moveStrafing *= 0.98F; + this.moveForward *= 0.98F; + this.randomYawVelocity *= 0.9F; + this.moveEntityWithHeading(this.moveStrafing, this.moveForward); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("push"); + + if (!this.worldObj.isClient) { + this.collideWithNearbyEntities(); + } + + this.worldObj.theProfiler.endSection(); + } + + protected void updateAITasks() {} + + protected void collideWithNearbyEntities() { + List var1 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + + if (var1 != null && !var1.isEmpty()) { + for (int var2 = 0; var2 < var1.size(); ++var2) { + Entity var3 = (Entity)var1.get(var2); + + if (var3.canBePushed()) { + this.collideWithEntity(var3); + } + } + } + } + + protected void collideWithEntity(Entity p_82167_1_) { + p_82167_1_.applyEntityCollision(this); + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + super.updateRidden(); + this.field_70768_au = this.field_110154_aX; + this.field_110154_aX = 0.0F; + this.fallDistance = 0.0F; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.yOffset = 0.0F; + this.newPosX = p_70056_1_; + this.newPosY = p_70056_3_; + this.newPosZ = p_70056_5_; + this.newRotationYaw = p_70056_7_; + this.newRotationPitch = p_70056_8_; + this.newPosRotationIncrements = p_70056_9_; + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() {} + + protected void updateEntityActionState() { + ++this.entityAge; + } + + public void setJumping(boolean p_70637_1_) { + this.isJumping = p_70637_1_; + } + + /** + * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) { + if (!p_71001_1_.isDead && !this.worldObj.isClient) { + EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker(); + + if (p_71001_1_ instanceof EntityItem) { + var3.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + + if (p_71001_1_ instanceof EntityArrow) { + var3.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + + if (p_71001_1_ instanceof EntityXPOrb) { + var3.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + } + } + + /** + * returns true if the entity provided in the argument can be seen. (Raytrace) + */ + public boolean canEntityBeSeen(Entity p_70685_1_) { + return this.worldObj.rayTraceBlocks(Vec3.createVectorHelper(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), Vec3.createVectorHelper(p_70685_1_.posX, p_70685_1_.posY + (double)p_70685_1_.getEyeHeight(), p_70685_1_.posZ)) == null; + } + + /** + * returns a (normalized) vector of where this entity is looking + */ + public Vec3 getLookVec() { + return this.getLook(1.0F); + } + + /** + * interpolated look vector + */ + public Vec3 getLook(float p_70676_1_) { + float var2; + float var3; + float var4; + float var5; + + if (p_70676_1_ == 1.0F) { + var2 = MathHelper.cos(-this.rotationYaw * 0.017453292F - (float)Math.PI); + var3 = MathHelper.sin(-this.rotationYaw * 0.017453292F - (float)Math.PI); + var4 = -MathHelper.cos(-this.rotationPitch * 0.017453292F); + var5 = MathHelper.sin(-this.rotationPitch * 0.017453292F); + return Vec3.createVectorHelper(var3 * var4, var5, var2 * var4); + } else { + var2 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * p_70676_1_; + var3 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * p_70676_1_; + var4 = MathHelper.cos(-var3 * 0.017453292F - (float)Math.PI); + var5 = MathHelper.sin(-var3 * 0.017453292F - (float)Math.PI); + float var6 = -MathHelper.cos(-var2 * 0.017453292F); + float var7 = MathHelper.sin(-var2 * 0.017453292F); + return Vec3.createVectorHelper(var5 * var6, var7, var4 * var6); + } + } + + /** + * Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime + */ + public float getSwingProgress(float p_70678_1_) { + float var2 = this.swingProgress - this.prevSwingProgress; + + if (var2 < 0.0F) { + ++var2; + } + + return this.prevSwingProgress + var2 * p_70678_1_; + } + + /** + * interpolated position vector + */ + public Vec3 getPosition(float p_70666_1_) { + if (p_70666_1_ == 1.0F) { + return Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + } else { + double var2 = this.prevPosX + (this.posX - this.prevPosX) * (double)p_70666_1_; + double var4 = this.prevPosY + (this.posY - this.prevPosY) * (double)p_70666_1_; + double var6 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70666_1_; + return Vec3.createVectorHelper(var2, var4, var6); + } + } + + /** + * Performs a ray trace for the distance specified and using the partial tick time. Args: distance, partialTickTime + */ + public MovingObjectPosition rayTrace(double p_70614_1_, float p_70614_3_) { + Vec3 var4 = this.getPosition(p_70614_3_); + Vec3 var5 = this.getLook(p_70614_3_); + Vec3 var6 = var4.addVector(var5.xCoord * p_70614_1_, var5.yCoord * p_70614_1_, var5.zCoord * p_70614_1_); + return this.worldObj.func_147447_a(var4, var6, false, false, true); + } + + /** + * Returns whether the entity is in a local (com.cheatbreaker.client) world + */ + public boolean isClientWorld() { + return !this.worldObj.isClient; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() { + return !this.isDead; + } + + public float getEyeHeight() { + return this.height * 0.85F; + } + + /** + * Sets that this entity has been attacked. + */ + protected void setBeenAttacked() { + this.velocityChanged = this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); + } + + public float getRotationYawHead() { + return this.rotationYawHead; + } + + /** + * Sets the head's yaw rotation of the entity. + */ + public void setRotationYawHead(float p_70034_1_) { + this.rotationYawHead = p_70034_1_; + } + + public float getAbsorptionAmount() { + return this.field_110151_bq; + } + + public void setAbsorptionAmount(float p_110149_1_) { + if (p_110149_1_ < 0.0F) { + p_110149_1_ = 0.0F; + } + + this.field_110151_bq = p_110149_1_; + } + + public Team getTeam() { + return null; + } + + public boolean isOnSameTeam(EntityLivingBase p_142014_1_) { + return this.isOnTeam(p_142014_1_.getTeam()); + } + + /** + * Returns true if the entity is on a specific team. + */ + public boolean isOnTeam(Team p_142012_1_) { + return this.getTeam() != null && this.getTeam().isSameTeam(p_142012_1_); + } + + public void func_152111_bt() {} + + public void func_152112_bu() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java new file mode 100644 index 0000000..4a4cae0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityMinecartCommandBlock.java @@ -0,0 +1,115 @@ +package net.minecraft.entity; + +import io.netty.buffer.ByteBuf; +import net.minecraft.block.Block; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityMinecartCommandBlock extends EntityMinecart { + private final CommandBlockLogic field_145824_a = new CommandBlockLogic() { + + public void func_145756_e() { + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(23, this.func_145753_i()); + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(24, IChatComponent.Serializer.func_150696_a(this.func_145749_h())); + } + public int func_145751_f() { + return 1; + } + public void func_145757_a(ByteBuf p_145757_1_) { + p_145757_1_.writeInt(EntityMinecartCommandBlock.this.getEntityId()); + } + public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(MathHelper.floor_double(EntityMinecartCommandBlock.this.posX), MathHelper.floor_double(EntityMinecartCommandBlock.this.posY + 0.5D), MathHelper.floor_double(EntityMinecartCommandBlock.this.posZ)); + } + public World getEntityWorld() { + return EntityMinecartCommandBlock.this.worldObj; + } + }; + private int field_145823_b = 0; + + + public EntityMinecartCommandBlock(World p_i45321_1_) { + super(p_i45321_1_); + } + + public EntityMinecartCommandBlock(World p_i45322_1_, double p_i45322_2_, double p_i45322_4_, double p_i45322_6_) { + super(p_i45322_1_, p_i45322_2_, p_i45322_4_, p_i45322_6_); + } + + protected void entityInit() { + super.entityInit(); + this.getDataWatcher().addObject(23, ""); + this.getDataWatcher().addObject(24, ""); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.field_145824_a.func_145759_b(p_70037_1_); + this.getDataWatcher().updateObject(23, this.func_145822_e().func_145753_i()); + this.getDataWatcher().updateObject(24, IChatComponent.Serializer.func_150696_a(this.func_145822_e().func_145749_h())); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + this.field_145824_a.func_145758_a(p_70014_1_); + } + + public int getMinecartType() { + return 6; + } + + public Block func_145817_o() { + return Blocks.command_block; + } + + public CommandBlockLogic func_145822_e() { + return this.field_145824_a; + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) { + if (p_96095_4_ && this.ticksExisted - this.field_145823_b >= 4) { + this.func_145822_e().func_145755_a(this.worldObj); + this.field_145823_b = this.ticksExisted; + } + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + if (this.worldObj.isClient) { + p_130002_1_.func_146095_a(this.func_145822_e()); + } + + return super.interactFirst(p_130002_1_); + } + + public void func_145781_i(int p_145781_1_) { + super.func_145781_i(p_145781_1_); + + if (p_145781_1_ == 24) { + try { + this.field_145824_a.func_145750_b(IChatComponent.Serializer.func_150699_a(this.getDataWatcher().getWatchableObjectString(24))); + } catch (Throwable var3) { + } + } else if (p_145781_1_ == 23) { + this.field_145824_a.func_145752_a(this.getDataWatcher().getWatchableObjectString(23)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityTracker.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityTracker.java new file mode 100644 index 0000000..c0e687c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityTracker.java @@ -0,0 +1,255 @@ +package net.minecraft.entity; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.network.Packet; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityTracker { + private static final Logger logger = LogManager.getLogger(); + private final WorldServer theWorld; + + /** + * List of tracked entities, used for iteration operations on tracked entities. + */ + private final Set trackedEntities = new HashSet(); + private final IntHashMap trackedEntityIDs = new IntHashMap(); + private final int entityViewDistance; + + + public EntityTracker(WorldServer p_i1516_1_) { + this.theWorld = p_i1516_1_; + this.entityViewDistance = p_i1516_1_.func_73046_m().getConfigurationManager().getEntityViewDistance(); + } + + /** + * if entity is a player sends all tracked events to the player, otherwise, adds with a visibility and update arate + * based on the class type + */ + public void addEntityToTracker(Entity p_72786_1_) { + if (p_72786_1_ instanceof EntityPlayerMP) { + this.addEntityToTracker(p_72786_1_, 512, 2); + EntityPlayerMP var2 = (EntityPlayerMP)p_72786_1_; + Iterator var3 = this.trackedEntities.iterator(); + + while (var3.hasNext()) { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); + + if (var4.myEntity != var2) { + var4.tryStartWachingThis(var2); + } + } + } else if (p_72786_1_ instanceof EntityFishHook) { + this.addEntityToTracker(p_72786_1_, 64, 5, true); + } else if (p_72786_1_ instanceof EntityArrow) { + this.addEntityToTracker(p_72786_1_, 64, 20, false); + } else if (p_72786_1_ instanceof EntitySmallFireball) { + this.addEntityToTracker(p_72786_1_, 64, 10, false); + } else if (p_72786_1_ instanceof EntityFireball) { + this.addEntityToTracker(p_72786_1_, 64, 10, false); + } else if (p_72786_1_ instanceof EntitySnowball) { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } else if (p_72786_1_ instanceof EntityEnderPearl) { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } else if (p_72786_1_ instanceof EntityEnderEye) { + this.addEntityToTracker(p_72786_1_, 64, 4, true); + } else if (p_72786_1_ instanceof EntityEgg) { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } else if (p_72786_1_ instanceof EntityPotion) { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } else if (p_72786_1_ instanceof EntityExpBottle) { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } else if (p_72786_1_ instanceof EntityFireworkRocket) { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } else if (p_72786_1_ instanceof EntityItem) { + this.addEntityToTracker(p_72786_1_, 64, 20, true); + } else if (p_72786_1_ instanceof EntityMinecart) { + this.addEntityToTracker(p_72786_1_, 80, 3, true); + } else if (p_72786_1_ instanceof EntityBoat) { + this.addEntityToTracker(p_72786_1_, 80, 3, true); + } else if (p_72786_1_ instanceof EntitySquid) { + this.addEntityToTracker(p_72786_1_, 64, 3, true); + } else if (p_72786_1_ instanceof EntityWither) { + this.addEntityToTracker(p_72786_1_, 80, 3, false); + } else if (p_72786_1_ instanceof EntityBat) { + this.addEntityToTracker(p_72786_1_, 80, 3, false); + } else if (p_72786_1_ instanceof IAnimals) { + this.addEntityToTracker(p_72786_1_, 80, 3, true); + } else if (p_72786_1_ instanceof EntityDragon) { + this.addEntityToTracker(p_72786_1_, 160, 3, true); + } else if (p_72786_1_ instanceof EntityTNTPrimed) { + this.addEntityToTracker(p_72786_1_, 160, 10, true); + } else if (p_72786_1_ instanceof EntityFallingBlock) { + this.addEntityToTracker(p_72786_1_, 160, 20, true); + } else if (p_72786_1_ instanceof EntityHanging) { + this.addEntityToTracker(p_72786_1_, 160, Integer.MAX_VALUE, false); + } else if (p_72786_1_ instanceof EntityXPOrb) { + this.addEntityToTracker(p_72786_1_, 160, 20, true); + } else if (p_72786_1_ instanceof EntityEnderCrystal) { + this.addEntityToTracker(p_72786_1_, 256, Integer.MAX_VALUE, false); + } + } + + public void addEntityToTracker(Entity p_72791_1_, int p_72791_2_, int p_72791_3_) { + this.addEntityToTracker(p_72791_1_, p_72791_2_, p_72791_3_, false); + } + + public void addEntityToTracker(Entity p_72785_1_, int p_72785_2_, final int p_72785_3_, boolean p_72785_4_) { + if (p_72785_2_ > this.entityViewDistance) { + p_72785_2_ = this.entityViewDistance; + } + + try { + if (this.trackedEntityIDs.containsItem(p_72785_1_.getEntityId())) { + throw new IllegalStateException("Entity is already tracked!"); + } + + EntityTrackerEntry var5 = new EntityTrackerEntry(p_72785_1_, p_72785_2_, p_72785_3_, p_72785_4_); + this.trackedEntities.add(var5); + this.trackedEntityIDs.addKey(p_72785_1_.getEntityId(), var5); + var5.sendEventsToPlayers(this.theWorld.playerEntities); + } catch (Throwable var11) { + CrashReport var6 = CrashReport.makeCrashReport(var11, "Adding entity to track"); + CrashReportCategory var7 = var6.makeCategory("Entity To Track"); + var7.addCrashSection("Tracking range", p_72785_2_ + " blocks"); + var7.addCrashSectionCallable("Update interval", new Callable() { + + public String call() { + String var1 = "Once per " + p_72785_3_ + " ticks"; + + if (p_72785_3_ == Integer.MAX_VALUE) { + var1 = "Maximum (" + var1 + ")"; + } + + return var1; + } + }); + p_72785_1_.addEntityCrashInfo(var7); + CrashReportCategory var8 = var6.makeCategory("Entity That Is Already Tracked"); + ((EntityTrackerEntry)this.trackedEntityIDs.lookup(p_72785_1_.getEntityId())).myEntity.addEntityCrashInfo(var8); + + try { + throw new ReportedException(var6); + } catch (ReportedException var10) { + logger.error("\"Silently\" catching entity tracking error.", var10); + } + } + } + + public void removeEntityFromAllTrackingPlayers(Entity p_72790_1_) { + if (p_72790_1_ instanceof EntityPlayerMP) { + EntityPlayerMP var2 = (EntityPlayerMP)p_72790_1_; + Iterator var3 = this.trackedEntities.iterator(); + + while (var3.hasNext()) { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); + var4.removeFromWatchingList(var2); + } + } + + EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityIDs.removeObject(p_72790_1_.getEntityId()); + + if (var5 != null) { + this.trackedEntities.remove(var5); + var5.informAllAssociatedPlayersOfItemDestruction(); + } + } + + public void updateTrackedEntities() { + ArrayList var1 = new ArrayList(); + Iterator var2 = this.trackedEntities.iterator(); + + while (var2.hasNext()) { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); + var3.sendLocationToAllClients(this.theWorld.playerEntities); + + if (var3.playerEntitiesUpdated && var3.myEntity instanceof EntityPlayerMP) { + var1.add(var3.myEntity); + } + } + + for (int var6 = 0; var6 < var1.size(); ++var6) { + EntityPlayerMP var7 = (EntityPlayerMP)var1.get(var6); + Iterator var4 = this.trackedEntities.iterator(); + + while (var4.hasNext()) { + EntityTrackerEntry var5 = (EntityTrackerEntry)var4.next(); + + if (var5.myEntity != var7) { + var5.tryStartWachingThis(var7); + } + } + } + } + + public void func_151247_a(Entity p_151247_1_, Packet p_151247_2_) { + EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(p_151247_1_.getEntityId()); + + if (var3 != null) { + var3.func_151259_a(p_151247_2_); + } + } + + public void func_151248_b(Entity p_151248_1_, Packet p_151248_2_) { + EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(p_151248_1_.getEntityId()); + + if (var3 != null) { + var3.func_151261_b(p_151248_2_); + } + } + + public void removePlayerFromTrackers(EntityPlayerMP p_72787_1_) { + Iterator var2 = this.trackedEntities.iterator(); + + while (var2.hasNext()) { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); + var3.removePlayerFromTracker(p_72787_1_); + } + } + + public void func_85172_a(EntityPlayerMP p_85172_1_, Chunk p_85172_2_) { + Iterator var3 = this.trackedEntities.iterator(); + + while (var3.hasNext()) { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); + + if (var4.myEntity != p_85172_1_ && var4.myEntity.chunkCoordX == p_85172_2_.xPosition && var4.myEntity.chunkCoordZ == p_85172_2_.zPosition) { + var4.tryStartWachingThis(p_85172_1_); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityTrackerEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityTrackerEntry.java new file mode 100644 index 0000000..9514ec7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EntityTrackerEntry.java @@ -0,0 +1,504 @@ +package net.minecraft.entity; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Items; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.MathHelper; +import net.minecraft.world.storage.MapData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityTrackerEntry { + private static final Logger logger = LogManager.getLogger(); + public Entity myEntity; + public int blocksDistanceThreshold; + + /** check for sync when ticks % updateFrequency==0 */ + public int updateFrequency; + public int lastScaledXPosition; + public int lastScaledYPosition; + public int lastScaledZPosition; + public int lastYaw; + public int lastPitch; + public int lastHeadMotion; + public double motionX; + public double motionY; + public double motionZ; + public int ticks; + private double posX; + private double posY; + private double posZ; + + /** set to true on first sendLocationToClients */ + private boolean isDataInitialized; + private final boolean sendVelocityUpdates; + + /** + * every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position + * remains fully synced. + */ + private int ticksSinceLastForcedTeleport; + private Entity field_85178_v; + private boolean ridingEntity; + public boolean playerEntitiesUpdated; + + /** + * Holds references to all the players that are currently receiving position updates for this entity. + */ + public Set trackingPlayers = new HashSet(); + + + public EntityTrackerEntry(Entity p_i1525_1_, int p_i1525_2_, int p_i1525_3_, boolean p_i1525_4_) { + this.myEntity = p_i1525_1_; + this.blocksDistanceThreshold = p_i1525_2_; + this.updateFrequency = p_i1525_3_; + this.sendVelocityUpdates = p_i1525_4_; + this.lastScaledXPosition = MathHelper.floor_double(p_i1525_1_.posX * 32.0D); + this.lastScaledYPosition = MathHelper.floor_double(p_i1525_1_.posY * 32.0D); + this.lastScaledZPosition = MathHelper.floor_double(p_i1525_1_.posZ * 32.0D); + this.lastYaw = MathHelper.floor_float(p_i1525_1_.rotationYaw * 256.0F / 360.0F); + this.lastPitch = MathHelper.floor_float(p_i1525_1_.rotationPitch * 256.0F / 360.0F); + this.lastHeadMotion = MathHelper.floor_float(p_i1525_1_.getRotationYawHead() * 256.0F / 360.0F); + } + + public boolean equals(Object p_equals_1_) { + return p_equals_1_ instanceof EntityTrackerEntry && ((EntityTrackerEntry) p_equals_1_).myEntity.getEntityId() == this.myEntity.getEntityId(); + } + + public int hashCode() { + return this.myEntity.getEntityId(); + } + + /** + * also sends velocity, rotation, and riding info. + */ + public void sendLocationToAllClients(List p_73122_1_) { + this.playerEntitiesUpdated = false; + + if (!this.isDataInitialized || this.myEntity.getDistanceSq(this.posX, this.posY, this.posZ) > 16.0D) { + this.posX = this.myEntity.posX; + this.posY = this.myEntity.posY; + this.posZ = this.myEntity.posZ; + this.isDataInitialized = true; + this.playerEntitiesUpdated = true; + this.sendEventsToPlayers(p_73122_1_); + } + + if (this.field_85178_v != this.myEntity.ridingEntity || this.myEntity.ridingEntity != null && this.ticks % 60 == 0) { + this.field_85178_v = this.myEntity.ridingEntity; + this.func_151259_a(new S1BPacketEntityAttach(0, this.myEntity, this.myEntity.ridingEntity)); + } + + if (this.myEntity instanceof EntityItemFrame && this.ticks % 10 == 0) { + EntityItemFrame var23 = (EntityItemFrame)this.myEntity; + ItemStack var24 = var23.getDisplayedItem(); + + if (var24 != null && var24.getItem() instanceof ItemMap) { + MapData var26 = Items.filled_map.getMapData(var24, this.myEntity.worldObj); + Iterator var27 = p_73122_1_.iterator(); + + while (var27.hasNext()) { + EntityPlayer var28 = (EntityPlayer)var27.next(); + EntityPlayerMP var29 = (EntityPlayerMP)var28; + var26.updateVisiblePlayers(var29, var24); + Packet var30 = Items.filled_map.func_150911_c(var24, this.myEntity.worldObj, var29); + + if (var30 != null) { + var29.playerNetServerHandler.sendPacket(var30); + } + } + } + + this.func_111190_b(); + } else if (this.ticks % this.updateFrequency == 0 || this.myEntity.isAirBorne || this.myEntity.getDataWatcher().hasChanges()) { + int var2; + int var3; + + if (this.myEntity.ridingEntity == null) { + ++this.ticksSinceLastForcedTeleport; + var2 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); + var3 = MathHelper.floor_double(this.myEntity.posY * 32.0D); + int var4 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); + int var5 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); + int var6 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); + int var7 = var2 - this.lastScaledXPosition; + int var8 = var3 - this.lastScaledYPosition; + int var9 = var4 - this.lastScaledZPosition; + Object var10 = null; + boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.ticks % 60 == 0; + boolean var12 = Math.abs(var5 - this.lastYaw) >= 4 || Math.abs(var6 - this.lastPitch) >= 4; + + if (this.ticks > 0 || this.myEntity instanceof EntityArrow) { + if (var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) { + if (var11 && var12) { + var10 = new S14PacketEntity.S17PacketEntityLookMove(this.myEntity.getEntityId(), (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6); + } else if (var11) { + var10 = new S14PacketEntity.S15PacketEntityRelMove(this.myEntity.getEntityId(), (byte)var7, (byte)var8, (byte)var9); + } else if (var12) { + var10 = new S14PacketEntity.S16PacketEntityLook(this.myEntity.getEntityId(), (byte)var5, (byte)var6); + } + } else { + this.ticksSinceLastForcedTeleport = 0; + var10 = new S18PacketEntityTeleport(this.myEntity.getEntityId(), var2, var3, var4, (byte)var5, (byte)var6); + } + } + + if (this.sendVelocityUpdates) { + double var13 = this.myEntity.motionX - this.motionX; + double var15 = this.myEntity.motionY - this.motionY; + double var17 = this.myEntity.motionZ - this.motionZ; + double var19 = 0.02D; + double var21 = var13 * var13 + var15 * var15 + var17 * var17; + + if (var21 > var19 * var19 || var21 > 0.0D && this.myEntity.motionX == 0.0D && this.myEntity.motionY == 0.0D && this.myEntity.motionZ == 0.0D) { + this.motionX = this.myEntity.motionX; + this.motionY = this.myEntity.motionY; + this.motionZ = this.myEntity.motionZ; + this.func_151259_a(new S12PacketEntityVelocity(this.myEntity.getEntityId(), this.motionX, this.motionY, this.motionZ)); + } + } + + if (var10 != null) { + this.func_151259_a((Packet)var10); + } + + this.func_111190_b(); + + if (var11) { + this.lastScaledXPosition = var2; + this.lastScaledYPosition = var3; + this.lastScaledZPosition = var4; + } + + if (var12) { + this.lastYaw = var5; + this.lastPitch = var6; + } + + this.ridingEntity = false; + } else { + var2 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); + var3 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); + boolean var25 = Math.abs(var2 - this.lastYaw) >= 4 || Math.abs(var3 - this.lastPitch) >= 4; + + if (var25) { + this.func_151259_a(new S14PacketEntity.S16PacketEntityLook(this.myEntity.getEntityId(), (byte)var2, (byte)var3)); + this.lastYaw = var2; + this.lastPitch = var3; + } + + this.lastScaledXPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); + this.lastScaledYPosition = MathHelper.floor_double(this.myEntity.posY * 32.0D); + this.lastScaledZPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); + this.func_111190_b(); + this.ridingEntity = true; + } + + var2 = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); + + if (Math.abs(var2 - this.lastHeadMotion) >= 4) { + this.func_151259_a(new S19PacketEntityHeadLook(this.myEntity, (byte)var2)); + this.lastHeadMotion = var2; + } + + this.myEntity.isAirBorne = false; + } + + ++this.ticks; + + if (this.myEntity.velocityChanged) { + this.func_151261_b(new S12PacketEntityVelocity(this.myEntity)); + this.myEntity.velocityChanged = false; + } + } + + private void func_111190_b() { + DataWatcher var1 = this.myEntity.getDataWatcher(); + + if (var1.hasChanges()) { + this.func_151261_b(new S1CPacketEntityMetadata(this.myEntity.getEntityId(), var1, false)); + } + + if (this.myEntity instanceof EntityLivingBase) { + ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Set var3 = var2.getAttributeInstanceSet(); + + if (!var3.isEmpty()) { + this.func_151261_b(new S20PacketEntityProperties(this.myEntity.getEntityId(), var3)); + } + + var3.clear(); + } + } + + public void func_151259_a(Packet p_151259_1_) { + Iterator var2 = this.trackingPlayers.iterator(); + + while (var2.hasNext()) { + EntityPlayerMP var3 = (EntityPlayerMP)var2.next(); + var3.playerNetServerHandler.sendPacket(p_151259_1_); + } + } + + public void func_151261_b(Packet p_151261_1_) { + this.func_151259_a(p_151261_1_); + + if (this.myEntity instanceof EntityPlayerMP) { + ((EntityPlayerMP)this.myEntity).playerNetServerHandler.sendPacket(p_151261_1_); + } + } + + public void informAllAssociatedPlayersOfItemDestruction() { + Iterator var1 = this.trackingPlayers.iterator(); + + while (var1.hasNext()) { + EntityPlayerMP var2 = (EntityPlayerMP)var1.next(); + var2.func_152339_d(this.myEntity); + } + } + + public void removeFromWatchingList(EntityPlayerMP p_73118_1_) { + if (this.trackingPlayers.contains(p_73118_1_)) { + p_73118_1_.func_152339_d(this.myEntity); + this.trackingPlayers.remove(p_73118_1_); + } + } + + /** + * if the player is more than the distance threshold (typically 64) then the player is removed instead + */ + public void tryStartWachingThis(EntityPlayerMP p_73117_1_) { + if (p_73117_1_ != this.myEntity) { + double var2 = p_73117_1_.posX - (double)(this.lastScaledXPosition / 32); + double var4 = p_73117_1_.posZ - (double)(this.lastScaledZPosition / 32); + + if (var2 >= (double)(-this.blocksDistanceThreshold) && var2 <= (double)this.blocksDistanceThreshold && var4 >= (double)(-this.blocksDistanceThreshold) && var4 <= (double)this.blocksDistanceThreshold) { + if (!this.trackingPlayers.contains(p_73117_1_) && (this.isPlayerWatchingThisChunk(p_73117_1_) || this.myEntity.forceSpawn)) { + this.trackingPlayers.add(p_73117_1_); + Packet var6 = this.func_151260_c(); + p_73117_1_.playerNetServerHandler.sendPacket(var6); + + if (!this.myEntity.getDataWatcher().getIsBlank()) { + p_73117_1_.playerNetServerHandler.sendPacket(new S1CPacketEntityMetadata(this.myEntity.getEntityId(), this.myEntity.getDataWatcher(), true)); + } + + if (this.myEntity instanceof EntityLivingBase) { + ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Collection var8 = var7.getWatchedAttributes(); + + if (!var8.isEmpty()) { + p_73117_1_.playerNetServerHandler.sendPacket(new S20PacketEntityProperties(this.myEntity.getEntityId(), var8)); + } + } + + this.motionX = this.myEntity.motionX; + this.motionY = this.myEntity.motionY; + this.motionZ = this.myEntity.motionZ; + + if (this.sendVelocityUpdates && !(var6 instanceof S0FPacketSpawnMob)) { + p_73117_1_.playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(this.myEntity.getEntityId(), this.myEntity.motionX, this.myEntity.motionY, this.myEntity.motionZ)); + } + + if (this.myEntity.ridingEntity != null) { + p_73117_1_.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this.myEntity, this.myEntity.ridingEntity)); + } + + if (this.myEntity instanceof EntityLiving && ((EntityLiving)this.myEntity).getLeashedToEntity() != null) { + p_73117_1_.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(1, this.myEntity, ((EntityLiving)this.myEntity).getLeashedToEntity())); + } + + if (this.myEntity instanceof EntityLivingBase) { + for (int var10 = 0; var10 < 5; ++var10) { + ItemStack var13 = ((EntityLivingBase)this.myEntity).getEquipmentInSlot(var10); + + if (var13 != null) { + p_73117_1_.playerNetServerHandler.sendPacket(new S04PacketEntityEquipment(this.myEntity.getEntityId(), var10, var13)); + } + } + } + + if (this.myEntity instanceof EntityPlayer) { + EntityPlayer var11 = (EntityPlayer)this.myEntity; + + if (var11.isPlayerSleeping()) { + p_73117_1_.playerNetServerHandler.sendPacket(new S0APacketUseBed(var11, MathHelper.floor_double(this.myEntity.posX), MathHelper.floor_double(this.myEntity.posY), MathHelper.floor_double(this.myEntity.posZ))); + } + } + + if (this.myEntity instanceof EntityLivingBase) { + EntityLivingBase var12 = (EntityLivingBase)this.myEntity; + Iterator var14 = var12.getActivePotionEffects().iterator(); + + while (var14.hasNext()) { + PotionEffect var9 = (PotionEffect)var14.next(); + p_73117_1_.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.myEntity.getEntityId(), var9)); + } + } + } + } else if (this.trackingPlayers.contains(p_73117_1_)) { + this.trackingPlayers.remove(p_73117_1_); + p_73117_1_.func_152339_d(this.myEntity); + } + } + } + + private boolean isPlayerWatchingThisChunk(EntityPlayerMP p_73121_1_) { + return p_73121_1_.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(p_73121_1_, this.myEntity.chunkCoordX, this.myEntity.chunkCoordZ); + } + + public void sendEventsToPlayers(List p_73125_1_) { + for (int var2 = 0; var2 < p_73125_1_.size(); ++var2) { + this.tryStartWachingThis((EntityPlayerMP)p_73125_1_.get(var2)); + } + } + + private Packet func_151260_c() { + if (this.myEntity.isDead) { + logger.warn("Fetching addPacket for removed entity"); + } + + if (this.myEntity instanceof EntityItem) { + return new S0EPacketSpawnObject(this.myEntity, 2, 1); + } else if (this.myEntity instanceof EntityPlayerMP) { + return new S0CPacketSpawnPlayer((EntityPlayer)this.myEntity); + } else if (this.myEntity instanceof EntityMinecart) { + EntityMinecart var9 = (EntityMinecart)this.myEntity; + return new S0EPacketSpawnObject(this.myEntity, 10, var9.getMinecartType()); + } else if (this.myEntity instanceof EntityBoat) { + return new S0EPacketSpawnObject(this.myEntity, 1); + } else if (!(this.myEntity instanceof IAnimals) && !(this.myEntity instanceof EntityDragon)) { + if (this.myEntity instanceof EntityFishHook) { + EntityPlayer var8 = ((EntityFishHook)this.myEntity).field_146042_b; + return new S0EPacketSpawnObject(this.myEntity, 90, var8 != null ? var8.getEntityId() : this.myEntity.getEntityId()); + } else if (this.myEntity instanceof EntityArrow) { + Entity var7 = ((EntityArrow)this.myEntity).shootingEntity; + return new S0EPacketSpawnObject(this.myEntity, 60, var7 != null ? var7.getEntityId() : this.myEntity.getEntityId()); + } else if (this.myEntity instanceof EntitySnowball) { + return new S0EPacketSpawnObject(this.myEntity, 61); + } else if (this.myEntity instanceof EntityPotion) { + return new S0EPacketSpawnObject(this.myEntity, 73, ((EntityPotion)this.myEntity).getPotionDamage()); + } else if (this.myEntity instanceof EntityExpBottle) { + return new S0EPacketSpawnObject(this.myEntity, 75); + } else if (this.myEntity instanceof EntityEnderPearl) { + return new S0EPacketSpawnObject(this.myEntity, 65); + } else if (this.myEntity instanceof EntityEnderEye) { + return new S0EPacketSpawnObject(this.myEntity, 72); + } else if (this.myEntity instanceof EntityFireworkRocket) { + return new S0EPacketSpawnObject(this.myEntity, 76); + } else { + S0EPacketSpawnObject var2; + + if (this.myEntity instanceof EntityFireball) { + EntityFireball var6 = (EntityFireball)this.myEntity; + var2 = null; + byte var3 = 63; + + if (this.myEntity instanceof EntitySmallFireball) { + var3 = 64; + } else if (this.myEntity instanceof EntityWitherSkull) { + var3 = 66; + } + + if (var6.shootingEntity != null) { + var2 = new S0EPacketSpawnObject(this.myEntity, var3, ((EntityFireball)this.myEntity).shootingEntity.getEntityId()); + } else { + var2 = new S0EPacketSpawnObject(this.myEntity, var3, 0); + } + + var2.func_149003_d((int)(var6.accelerationX * 8000.0D)); + var2.func_149000_e((int)(var6.accelerationY * 8000.0D)); + var2.func_149007_f((int)(var6.accelerationZ * 8000.0D)); + return var2; + } else if (this.myEntity instanceof EntityEgg) { + return new S0EPacketSpawnObject(this.myEntity, 62); + } else if (this.myEntity instanceof EntityTNTPrimed) { + return new S0EPacketSpawnObject(this.myEntity, 50); + } else if (this.myEntity instanceof EntityEnderCrystal) { + return new S0EPacketSpawnObject(this.myEntity, 51); + } else if (this.myEntity instanceof EntityFallingBlock) { + EntityFallingBlock var5 = (EntityFallingBlock)this.myEntity; + return new S0EPacketSpawnObject(this.myEntity, 70, Block.getIdFromBlock(var5.func_145805_f()) | var5.field_145814_a << 16); + } else if (this.myEntity instanceof EntityPainting) { + return new S10PacketSpawnPainting((EntityPainting)this.myEntity); + } else if (this.myEntity instanceof EntityItemFrame) { + EntityItemFrame var4 = (EntityItemFrame)this.myEntity; + var2 = new S0EPacketSpawnObject(this.myEntity, 71, var4.hangingDirection); + var2.func_148996_a(MathHelper.floor_float((float)(var4.field_146063_b * 32))); + var2.func_148995_b(MathHelper.floor_float((float)(var4.field_146064_c * 32))); + var2.func_149005_c(MathHelper.floor_float((float)(var4.field_146062_d * 32))); + return var2; + } else if (this.myEntity instanceof EntityLeashKnot) { + EntityLeashKnot var1 = (EntityLeashKnot)this.myEntity; + var2 = new S0EPacketSpawnObject(this.myEntity, 77); + var2.func_148996_a(MathHelper.floor_float((float)(var1.field_146063_b * 32))); + var2.func_148995_b(MathHelper.floor_float((float)(var1.field_146064_c * 32))); + var2.func_149005_c(MathHelper.floor_float((float)(var1.field_146062_d * 32))); + return var2; + } else if (this.myEntity instanceof EntityXPOrb) { + return new S11PacketSpawnExperienceOrb((EntityXPOrb)this.myEntity); + } else { + throw new IllegalArgumentException("Don't know how to add " + this.myEntity.getClass() + "!"); + } + } + } else { + this.lastHeadMotion = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); + return new S0FPacketSpawnMob((EntityLivingBase)this.myEntity); + } + } + + public void removePlayerFromTracker(EntityPlayerMP p_73123_1_) { + if (this.trackingPlayers.contains(p_73123_1_)) { + this.trackingPlayers.remove(p_73123_1_); + p_73123_1_.func_152339_d(this.myEntity); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java new file mode 100644 index 0000000..407137b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EnumCreatureAttribute.java @@ -0,0 +1,8 @@ +package net.minecraft.entity; + +public enum EnumCreatureAttribute { + UNDEFINED, + UNDEAD, + ARTHROPOD + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EnumCreatureType.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EnumCreatureType.java new file mode 100644 index 0000000..08b1b70 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/EnumCreatureType.java @@ -0,0 +1,63 @@ +package net.minecraft.entity; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityAmbientCreature; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityWaterMob; + +public enum EnumCreatureType { + monster(IMob.class, 70, Material.air, false, false), + creature(EntityAnimal.class, 10, Material.air, true, true), + ambient(EntityAmbientCreature.class, 15, Material.air, true, false), + waterCreature(EntityWaterMob.class, 5, Material.water, true, false); + + /** + * The root class of creatures associated with this EnumCreatureType (IMobs for aggressive creatures, EntityAnimals + * for friendly ones) + */ + private final Class creatureClass; + private final int maxNumberOfCreature; + private final Material creatureMaterial; + + /** A flag indicating whether this creature type is peaceful. */ + private final boolean isPeacefulCreature; + + /** Whether this creature type is an animal. */ + private final boolean isAnimal; + + + EnumCreatureType(Class p_i1596_3_, int p_i1596_4_, Material p_i1596_5_, boolean p_i1596_6_, boolean p_i1596_7_) { + this.creatureClass = p_i1596_3_; + this.maxNumberOfCreature = p_i1596_4_; + this.creatureMaterial = p_i1596_5_; + this.isPeacefulCreature = p_i1596_6_; + this.isAnimal = p_i1596_7_; + } + + public Class getCreatureClass() { + return this.creatureClass; + } + + public int getMaxNumberOfCreature() { + return this.maxNumberOfCreature; + } + + public Material getCreatureMaterial() { + return this.creatureMaterial; + } + + /** + * Gets whether or not this creature type is peaceful. + */ + public boolean getPeacefulCreature() { + return this.isPeacefulCreature; + } + + /** + * Return whether this creature type is an animal. + */ + public boolean getAnimal() { + return this.isAnimal; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityLivingData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityLivingData.java new file mode 100644 index 0000000..c185f6a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityLivingData.java @@ -0,0 +1,4 @@ +package net.minecraft.entity; + +public interface IEntityLivingData { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityMultiPart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityMultiPart.java new file mode 100644 index 0000000..0504236 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityMultiPart.java @@ -0,0 +1,11 @@ +package net.minecraft.entity; + +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public interface IEntityMultiPart { + World func_82194_d(); + + boolean attackEntityFromPart(EntityDragonPart p_70965_1_, DamageSource p_70965_2_, float p_70965_3_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityOwnable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityOwnable.java new file mode 100644 index 0000000..8c28162 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IEntityOwnable.java @@ -0,0 +1,7 @@ +package net.minecraft.entity; + +public interface IEntityOwnable { + String func_152113_b(); + + Entity getOwner(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IMerchant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IMerchant.java new file mode 100644 index 0000000..abc7b04 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IMerchant.java @@ -0,0 +1,20 @@ +package net.minecraft.entity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public interface IMerchant { + void setCustomer(EntityPlayer p_70932_1_); + + EntityPlayer getCustomer(); + + MerchantRecipeList getRecipes(EntityPlayer p_70934_1_); + + void setRecipes(MerchantRecipeList p_70930_1_); + + void useRecipe(MerchantRecipe p_70933_1_); + + void func_110297_a_(ItemStack p_110297_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/INpc.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/INpc.java new file mode 100644 index 0000000..1f1147b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/INpc.java @@ -0,0 +1,6 @@ +package net.minecraft.entity; + +import net.minecraft.entity.passive.IAnimals; + +public interface INpc extends IAnimals { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IProjectile.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IProjectile.java new file mode 100644 index 0000000..a5be3d9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IProjectile.java @@ -0,0 +1,8 @@ +package net.minecraft.entity; + +public interface IProjectile { + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IRangedAttackMob.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IRangedAttackMob.java new file mode 100644 index 0000000..5a541aa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/IRangedAttackMob.java @@ -0,0 +1,8 @@ +package net.minecraft.entity; + +public interface IRangedAttackMob { + /** + * Attack the specified entity using a ranged attack. + */ + void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/NpcMerchant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/NpcMerchant.java new file mode 100644 index 0000000..d933643 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/NpcMerchant.java @@ -0,0 +1,42 @@ +package net.minecraft.entity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.InventoryMerchant; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public class NpcMerchant implements IMerchant { + /** Instance of Merchants Inventory. */ + private final InventoryMerchant theMerchantInventory; + + /** This merchant's current player customer. */ + private final EntityPlayer customer; + + /** The MerchantRecipeList instance. */ + private MerchantRecipeList recipeList; + + + public NpcMerchant(EntityPlayer p_i1746_1_) { + this.customer = p_i1746_1_; + this.theMerchantInventory = new InventoryMerchant(p_i1746_1_, this); + } + + public EntityPlayer getCustomer() { + return this.customer; + } + + public void setCustomer(EntityPlayer p_70932_1_) {} + + public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) { + return this.recipeList; + } + + public void setRecipes(MerchantRecipeList p_70930_1_) { + this.recipeList = p_70930_1_; + } + + public void useRecipe(MerchantRecipe p_70933_1_) {} + + public void func_110297_a_(ItemStack p_110297_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java new file mode 100644 index 0000000..c326a8e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java @@ -0,0 +1,120 @@ +package net.minecraft.entity; + +import java.util.Collection; +import java.util.Iterator; +import java.util.UUID; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SharedMonsterAttributes { + private static final Logger logger = LogManager.getLogger(); + public static final IAttribute maxHealth = (new RangedAttribute("generic.maxHealth", 20.0D, 0.0D, Double.MAX_VALUE)).setDescription("Max Health").setShouldWatch(true); + public static final IAttribute followRange = (new RangedAttribute("generic.followRange", 32.0D, 0.0D, 2048.0D)).setDescription("Follow Range"); + public static final IAttribute knockbackResistance = (new RangedAttribute("generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).setDescription("Knockback Resistance"); + public static final IAttribute movementSpeed = (new RangedAttribute("generic.movementSpeed", 0.699999988079071D, 0.0D, Double.MAX_VALUE)).setDescription("Movement Speed").setShouldWatch(true); + public static final IAttribute attackDamage = new RangedAttribute("generic.attackDamage", 2.0D, 0.0D, Double.MAX_VALUE); + + + /** + * Creates an NBTTagList from a BaseAttributeMap, including all its AttributeInstances + */ + public static NBTTagList writeBaseAttributeMapToNBT(BaseAttributeMap p_111257_0_) { + NBTTagList var1 = new NBTTagList(); + Iterator var2 = p_111257_0_.getAllAttributes().iterator(); + + while (var2.hasNext()) { + IAttributeInstance var3 = (IAttributeInstance)var2.next(); + var1.appendTag(writeAttributeInstanceToNBT(var3)); + } + + return var1; + } + + /** + * Creates an NBTTagCompound from an AttributeInstance, including its AttributeModifiers + */ + private static NBTTagCompound writeAttributeInstanceToNBT(IAttributeInstance p_111261_0_) { + NBTTagCompound var1 = new NBTTagCompound(); + IAttribute var2 = p_111261_0_.getAttribute(); + var1.setString("Name", var2.getAttributeUnlocalizedName()); + var1.setDouble("Base", p_111261_0_.getBaseValue()); + Collection var3 = p_111261_0_.func_111122_c(); + + if (var3 != null && !var3.isEmpty()) { + NBTTagList var4 = new NBTTagList(); + Iterator var5 = var3.iterator(); + + while (var5.hasNext()) { + AttributeModifier var6 = (AttributeModifier)var5.next(); + + if (var6.isSaved()) { + var4.appendTag(writeAttributeModifierToNBT(var6)); + } + } + + var1.setTag("Modifiers", var4); + } + + return var1; + } + + /** + * Creates an NBTTagCompound from an AttributeModifier + */ + private static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier p_111262_0_) { + NBTTagCompound var1 = new NBTTagCompound(); + var1.setString("Name", p_111262_0_.getName()); + var1.setDouble("Amount", p_111262_0_.getAmount()); + var1.setInteger("Operation", p_111262_0_.getOperation()); + var1.setLong("UUIDMost", p_111262_0_.getID().getMostSignificantBits()); + var1.setLong("UUIDLeast", p_111262_0_.getID().getLeastSignificantBits()); + return var1; + } + + public static void func_151475_a(BaseAttributeMap p_151475_0_, NBTTagList p_151475_1_) { + for (int var2 = 0; var2 < p_151475_1_.tagCount(); ++var2) { + NBTTagCompound var3 = p_151475_1_.getCompoundTagAt(var2); + IAttributeInstance var4 = p_151475_0_.getAttributeInstanceByName(var3.getString("Name")); + + if (var4 != null) { + applyModifiersToAttributeInstance(var4, var3); + } else { + logger.warn("Ignoring unknown attribute '" + var3.getString("Name") + "'"); + } + } + } + + private static void applyModifiersToAttributeInstance(IAttributeInstance p_111258_0_, NBTTagCompound p_111258_1_) { + p_111258_0_.setBaseValue(p_111258_1_.getDouble("Base")); + + if (p_111258_1_.func_150297_b("Modifiers", 9)) { + NBTTagList var2 = p_111258_1_.getTagList("Modifiers", 10); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + AttributeModifier var4 = readAttributeModifierFromNBT(var2.getCompoundTagAt(var3)); + AttributeModifier var5 = p_111258_0_.getModifier(var4.getID()); + + if (var5 != null) { + p_111258_0_.removeModifier(var5); + } + + p_111258_0_.applyModifier(var4); + } + } + } + + /** + * Creates an AttributeModifier from an NBTTagCompound + */ + public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound p_111259_0_) { + UUID var1 = new UUID(p_111259_0_.getLong("UUIDMost"), p_111259_0_.getLong("UUIDLeast")); + return new AttributeModifier(var1, p_111259_0_.getString("Name"), p_111259_0_.getDouble("Amount"), p_111259_0_.getInteger("Operation")); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java new file mode 100644 index 0000000..361a8c6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java @@ -0,0 +1,131 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.util.MathHelper; + +public class EntityAIArrowAttack extends EntityAIBase { + /** The entity the AI instance has been applied to */ + private final EntityLiving entityHost; + + /** + * The entity (as a RangedAttackMob) the AI instance has been applied to. + */ + private final IRangedAttackMob rangedAttackEntityHost; + private EntityLivingBase attackTarget; + + /** + * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the + * maxRangedAttackTime. + */ + private int rangedAttackTime; + private final double entityMoveSpeed; + private int field_75318_f; + private final int field_96561_g; + + /** + * The maximum time the AI has to wait before peforming another ranged attack. + */ + private final int maxRangedAttackTime; + private final float field_96562_i; + private final float field_82642_h; + + + public EntityAIArrowAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_) { + this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_); + } + + public EntityAIArrowAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_) { + this.rangedAttackTime = -1; + + if (!(p_i1650_1_ instanceof EntityLivingBase)) { + throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); + } else { + this.rangedAttackEntityHost = p_i1650_1_; + this.entityHost = (EntityLiving)p_i1650_1_; + this.entityMoveSpeed = p_i1650_2_; + this.field_96561_g = p_i1650_4_; + this.maxRangedAttackTime = p_i1650_5_; + this.field_96562_i = p_i1650_6_; + this.field_82642_h = p_i1650_6_ * p_i1650_6_; + this.setMutexBits(3); + } + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.entityHost.getAttackTarget(); + + if (var1 == null) { + return false; + } else { + this.attackTarget = var1; + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.shouldExecute() || !this.entityHost.getNavigator().noPath(); + } + + /** + * Resets the task + */ + public void resetTask() { + this.attackTarget = null; + this.field_75318_f = 0; + this.rangedAttackTime = -1; + } + + /** + * Updates the task + */ + public void updateTask() { + double var1 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.boundingBox.minY, this.attackTarget.posZ); + boolean var3 = this.entityHost.getEntitySenses().canSee(this.attackTarget); + + if (var3) { + ++this.field_75318_f; + } else { + this.field_75318_f = 0; + } + + if (var1 <= (double)this.field_82642_h && this.field_75318_f >= 20) { + this.entityHost.getNavigator().clearPathEntity(); + } else { + this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed); + } + + this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F); + float var4; + + if (--this.rangedAttackTime == 0) { + if (var1 > (double)this.field_82642_h || !var3) { + return; + } + + var4 = MathHelper.sqrt_double(var1) / this.field_96562_i; + float var5 = var4; + + if (var4 < 0.1F) { + var5 = 0.1F; + } + + if (var5 > 1.0F) { + var5 = 1.0F; + } + + this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, var5); + this.rangedAttackTime = MathHelper.floor_float(var4 * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); + } else if (this.rangedAttackTime < 0) { + var4 = MathHelper.sqrt_double(var1) / this.field_96562_i; + this.rangedAttackTime = MathHelper.floor_float(var4 * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java new file mode 100644 index 0000000..b3e0479 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java @@ -0,0 +1,128 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityAIAttackOnCollide extends EntityAIBase { + World worldObj; + EntityCreature attacker; + + /** + * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. + */ + int attackTick; + + /** The speed with which the mob will approach the target */ + double speedTowardsTarget; + + /** + * When true, the mob will continue chasing its target, even if it can't find a path to them right now. + */ + boolean longMemory; + + /** The PathEntity of our entity. */ + PathEntity entityPathEntity; + Class classTarget; + private int field_75445_i; + private double field_151497_i; + private double field_151495_j; + private double field_151496_k; + + + public EntityAIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_) { + this(p_i1635_1_, p_i1635_3_, p_i1635_5_); + this.classTarget = p_i1635_2_; + } + + public EntityAIAttackOnCollide(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) { + this.attacker = p_i1636_1_; + this.worldObj = p_i1636_1_.worldObj; + this.speedTowardsTarget = p_i1636_2_; + this.longMemory = p_i1636_4_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.attacker.getAttackTarget(); + + if (var1 == null) { + return false; + } else if (!var1.isEntityAlive()) { + return false; + } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())) { + return false; + } else { + this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(var1); + return this.entityPathEntity != null; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + EntityLivingBase var1 = this.attacker.getAttackTarget(); + return var1 != null && (var1.isEntityAlive() && (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistance(MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ)))); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); + this.field_75445_i = 0; + } + + /** + * Resets the task + */ + public void resetTask() { + this.attacker.getNavigator().clearPathEntity(); + } + + /** + * Updates the task + */ + public void updateTask() { + EntityLivingBase var1 = this.attacker.getAttackTarget(); + this.attacker.getLookHelper().setLookPositionWithEntity(var1, 30.0F, 30.0F); + double var2 = this.attacker.getDistanceSq(var1.posX, var1.boundingBox.minY, var1.posZ); + double var4 = this.attacker.width * 2.0F * this.attacker.width * 2.0F + var1.width; + --this.field_75445_i; + + if ((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && this.field_75445_i <= 0 && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D || var1.getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k) >= 1.0D || this.attacker.getRNG().nextFloat() < 0.05F)) { + this.field_151497_i = var1.posX; + this.field_151495_j = var1.boundingBox.minY; + this.field_151496_k = var1.posZ; + this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); + + if (var2 > 1024.0D) { + this.field_75445_i += 10; + } else if (var2 > 256.0D) { + this.field_75445_i += 5; + } + + if (!this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.speedTowardsTarget)) { + this.field_75445_i += 15; + } + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + + if (var2 <= var4 && this.attackTick <= 20) { + this.attackTick = 20; + + if (this.attacker.getHeldItem() != null) { + this.attacker.swingItem(); + } + + this.attacker.attackEntityAsMob(var1); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java new file mode 100644 index 0000000..9c0d372 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java @@ -0,0 +1,115 @@ +package net.minecraft.entity.ai; + +import java.util.List; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.util.Vec3; + +public class EntityAIAvoidEntity extends EntityAIBase { + public final IEntitySelector field_98218_a = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_.isEntityAlive() && EntityAIAvoidEntity.this.theEntity.getEntitySenses().canSee(p_82704_1_); + } + }; + + /** The entity we are attached to */ + private final EntityCreature theEntity; + private final double farSpeed; + private final double nearSpeed; + private Entity closestLivingEntity; + private final float distanceFromEntity; + + /** The PathEntity of our entity */ + private PathEntity entityPathEntity; + + /** The PathNavigate of our entity */ + private final PathNavigate entityPathNavigate; + + /** The class of the entity we should avoid */ + private final Class targetEntityClass; + + + public EntityAIAvoidEntity(EntityCreature p_i1616_1_, Class p_i1616_2_, float p_i1616_3_, double p_i1616_4_, double p_i1616_6_) { + this.theEntity = p_i1616_1_; + this.targetEntityClass = p_i1616_2_; + this.distanceFromEntity = p_i1616_3_; + this.farSpeed = p_i1616_4_; + this.nearSpeed = p_i1616_6_; + this.entityPathNavigate = p_i1616_1_.getNavigator(); + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.targetEntityClass == EntityPlayer.class) { + if (this.theEntity instanceof EntityTameable && ((EntityTameable)this.theEntity).isTamed()) { + return false; + } + + this.closestLivingEntity = this.theEntity.worldObj.getClosestPlayerToEntity(this.theEntity, this.distanceFromEntity); + + if (this.closestLivingEntity == null) { + return false; + } + } else { + List var1 = this.theEntity.worldObj.selectEntitiesWithinAABB(this.targetEntityClass, this.theEntity.boundingBox.expand(this.distanceFromEntity, 3.0D, this.distanceFromEntity), this.field_98218_a); + + if (var1.isEmpty()) { + return false; + } + + this.closestLivingEntity = (Entity)var1.get(0); + } + + Vec3 var2 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.theEntity, 16, 7, Vec3.createVectorHelper(this.closestLivingEntity.posX, this.closestLivingEntity.posY, this.closestLivingEntity.posZ)); + + if (var2 == null) { + return false; + } else if (this.closestLivingEntity.getDistanceSq(var2.xCoord, var2.yCoord, var2.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) { + return false; + } else { + this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(var2.xCoord, var2.yCoord, var2.zCoord); + return this.entityPathEntity != null && this.entityPathEntity.isDestinationSame(var2); + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.entityPathNavigate.noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); + } + + /** + * Resets the task + */ + public void resetTask() { + this.closestLivingEntity = null; + } + + /** + * Updates the task + */ + public void updateTask() { + if (this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) { + this.theEntity.getNavigator().setSpeed(this.nearSpeed); + } else { + this.theEntity.getNavigator().setSpeed(this.farSpeed); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBase.java new file mode 100644 index 0000000..1aba10a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBase.java @@ -0,0 +1,60 @@ +package net.minecraft.entity.ai; + +public abstract class EntityAIBase { + /** + * A bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields + * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. + */ + private int mutexBits; + + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public abstract boolean shouldExecute(); + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.shouldExecute(); + } + + /** + * Determine if this AI Task is interruptible by a higher (= lower value) priority task. + */ + public boolean isInterruptible() { + return true; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() {} + + /** + * Resets the task + */ + public void resetTask() {} + + /** + * Updates the task + */ + public void updateTask() {} + + /** + * Sets a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it + * yields zero, the two tasks may run concurrently, if not - they must run exclusively from each other. + */ + public void setMutexBits(int p_75248_1_) { + this.mutexBits = p_75248_1_; + } + + /** + * Get a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields + * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. + */ + public int getMutexBits() { + return this.mutexBits; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBeg.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBeg.java new file mode 100644 index 0000000..2eb8dc5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBeg.java @@ -0,0 +1,70 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class EntityAIBeg extends EntityAIBase { + private final EntityWolf theWolf; + private EntityPlayer thePlayer; + private final World worldObject; + private final float minPlayerDistance; + private int field_75384_e; + + + public EntityAIBeg(EntityWolf p_i1617_1_, float p_i1617_2_) { + this.theWolf = p_i1617_1_; + this.worldObject = p_i1617_1_.worldObj; + this.minPlayerDistance = p_i1617_2_; + this.setMutexBits(2); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.thePlayer = this.worldObject.getClosestPlayerToEntity(this.theWolf, this.minPlayerDistance); + return this.thePlayer != null && this.hasPlayerGotBoneInHand(this.thePlayer); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.thePlayer.isEntityAlive() && (!(this.theWolf.getDistanceSqToEntity(this.thePlayer) > (double) (this.minPlayerDistance * this.minPlayerDistance)) && this.field_75384_e > 0 && this.hasPlayerGotBoneInHand(this.thePlayer)); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theWolf.func_70918_i(true); + this.field_75384_e = 40 + this.theWolf.getRNG().nextInt(40); + } + + /** + * Resets the task + */ + public void resetTask() { + this.theWolf.func_70918_i(false); + this.thePlayer = null; + } + + /** + * Updates the task + */ + public void updateTask() { + this.theWolf.getLookHelper().setLookPosition(this.thePlayer.posX, this.thePlayer.posY + (double)this.thePlayer.getEyeHeight(), this.thePlayer.posZ, 10.0F, (float)this.theWolf.getVerticalFaceSpeed()); + --this.field_75384_e; + } + + /** + * Gets if the Player has the Bone in the hand. + */ + private boolean hasPlayerGotBoneInHand(EntityPlayer p_75382_1_) { + ItemStack var2 = p_75382_1_.inventory.getCurrentItem(); + return var2 != null && (!this.theWolf.isTamed() && var2.getItem() == Items.bone || this.theWolf.isBreedingItem(var2)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java new file mode 100644 index 0000000..3ae974a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java @@ -0,0 +1,71 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLiving; +import net.minecraft.world.EnumDifficulty; + +public class EntityAIBreakDoor extends EntityAIDoorInteract { + private int breakingTime; + private int field_75358_j = -1; + + + public EntityAIBreakDoor(EntityLiving p_i1618_1_) { + super(p_i1618_1_); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return super.shouldExecute() && (this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing") && !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ)); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + super.startExecuting(); + this.breakingTime = 0; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + double var1 = this.theEntity.getDistanceSq(this.entityPosX, this.entityPosY, this.entityPosZ); + return this.breakingTime <= 240 && !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && var1 < 4.0D; + } + + /** + * Resets the task + */ + public void resetTask() { + super.resetTask(); + this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.getEntityId(), this.entityPosX, this.entityPosY, this.entityPosZ, -1); + } + + /** + * Updates the task + */ + public void updateTask() { + super.updateTask(); + + if (this.theEntity.getRNG().nextInt(20) == 0) { + this.theEntity.worldObj.playAuxSFX(1010, this.entityPosX, this.entityPosY, this.entityPosZ, 0); + } + + ++this.breakingTime; + int var1 = (int)((float)this.breakingTime / 240.0F * 10.0F); + + if (var1 != this.field_75358_j) { + this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.getEntityId(), this.entityPosX, this.entityPosY, this.entityPosZ, var1); + this.field_75358_j = var1; + } + + if (this.breakingTime == 240 && this.theEntity.worldObj.difficultySetting == EnumDifficulty.HARD) { + this.theEntity.worldObj.setBlockToAir(this.entityPosX, this.entityPosY, this.entityPosZ); + this.theEntity.worldObj.playAuxSFX(1012, this.entityPosX, this.entityPosY, this.entityPosZ, 0); + this.theEntity.worldObj.playAuxSFX(2001, this.entityPosX, this.entityPosY, this.entityPosZ, Block.getIdFromBlock(this.field_151504_e)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java new file mode 100644 index 0000000..39ed732 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java @@ -0,0 +1,193 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathFinder; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; + +public class EntityAIControlledByPlayer extends EntityAIBase { + private final EntityLiving thisEntity; + private final float maxSpeed; + private float currentSpeed; + + /** Whether the entity's speed is boosted. */ + private boolean speedBoosted; + + /** + * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled + */ + private int speedBoostTime; + + /** Maximum time the entity's speed should be boosted for. */ + private int maxSpeedBoostTime; + + + public EntityAIControlledByPlayer(EntityLiving p_i1620_1_, float p_i1620_2_) { + this.thisEntity = p_i1620_1_; + this.maxSpeed = p_i1620_2_; + this.setMutexBits(7); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.currentSpeed = 0.0F; + } + + /** + * Resets the task + */ + public void resetTask() { + this.speedBoosted = false; + this.currentSpeed = 0.0F; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); + } + + /** + * Updates the task + */ + public void updateTask() { + EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; + EntityCreature var2 = (EntityCreature)this.thisEntity; + float var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; + + if (var3 > 5.0F) { + var3 = 5.0F; + } + + if (var3 < -5.0F) { + var3 = -5.0F; + } + + this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); + + if (this.currentSpeed < this.maxSpeed) { + this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; + } + + if (this.currentSpeed > this.maxSpeed) { + this.currentSpeed = this.maxSpeed; + } + + int var4 = MathHelper.floor_double(this.thisEntity.posX); + int var5 = MathHelper.floor_double(this.thisEntity.posY); + int var6 = MathHelper.floor_double(this.thisEntity.posZ); + float var7 = this.currentSpeed; + + if (this.speedBoosted) { + if (this.speedBoostTime++ > this.maxSpeedBoostTime) { + this.speedBoosted = false; + } + + var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); + } + + float var8 = 0.91F; + + if (this.thisEntity.onGround) { + var8 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)).slipperiness * 0.91F; + } + + float var9 = 0.16277136F / (var8 * var8 * var8); + float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); + float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); + float var12 = var2.getAIMoveSpeed() * var9; + float var13 = Math.max(var7, 1.0F); + var13 = var12 / var13; + float var14 = var7 * var13; + float var15 = -(var14 * var10); + float var16 = var14 * var11; + + if (MathHelper.abs(var15) > MathHelper.abs(var16)) { + if (var15 < 0.0F) { + var15 -= this.thisEntity.width / 2.0F; + } + + if (var15 > 0.0F) { + var15 += this.thisEntity.width / 2.0F; + } + + var16 = 0.0F; + } else { + var15 = 0.0F; + + if (var16 < 0.0F) { + var16 -= this.thisEntity.width / 2.0F; + } + + if (var16 > 0.0F) { + var16 += this.thisEntity.width / 2.0F; + } + } + + int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); + int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); + PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); + + if (var4 != var17 || var6 != var18) { + Block var20 = this.thisEntity.worldObj.getBlock(var4, var5, var6); + boolean var21 = !this.func_151498_a(var20) && (var20.getMaterial() != Material.air || !this.func_151498_a(this.thisEntity.worldObj.getBlock(var4, var5 - 1, var6))); + + if (var21 && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { + var2.getJumpHelper().setJumping(); + } + } + + if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { + ItemStack var22 = var1.getHeldItem(); + + if (var22 != null && var22.getItem() == Items.carrot_on_a_stick) { + var22.damageItem(1, var1); + + if (var22.stackSize == 0) { + ItemStack var23 = new ItemStack(Items.fishing_rod); + var23.setTagCompound(var22.stackTagCompound); + var1.inventory.mainInventory[var1.inventory.currentItem] = var23; + } + } + } + + this.thisEntity.moveEntityWithHeading(0.0F, var7); + } + + private boolean func_151498_a(Block p_151498_1_) { + return p_151498_1_.getRenderType() == 10 || p_151498_1_ instanceof BlockSlab; + } + + /** + * Return whether the entity's speed is boosted. + */ + public boolean isSpeedBoosted() { + return this.speedBoosted; + } + + /** + * Boost the entity's movement speed. + */ + public void boostSpeed() { + this.speedBoosted = true; + this.speedBoostTime = 0; + this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; + } + + /** + * Return whether the entity is being controlled by a player. + */ + public boolean isControlledByPlayer() { + return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java new file mode 100644 index 0000000..c2b0497 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java @@ -0,0 +1,58 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; + +public class EntityAICreeperSwell extends EntityAIBase { + /** The creeper that is swelling. */ + EntityCreeper swellingCreeper; + + /** + * The creeper's attack target. This is used for the changing of the creeper's state. + */ + EntityLivingBase creeperAttackTarget; + + + public EntityAICreeperSwell(EntityCreeper p_i1655_1_) { + this.swellingCreeper = p_i1655_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 || var1 != null && this.swellingCreeper.getDistanceSqToEntity(var1) < 9.0D; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.swellingCreeper.getNavigator().clearPathEntity(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } + + /** + * Resets the task + */ + public void resetTask() { + this.creeperAttackTarget = null; + } + + /** + * Updates the task + */ + public void updateTask() { + if (this.creeperAttackTarget == null) { + this.swellingCreeper.setCreeperState(-1); + } else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) { + this.swellingCreeper.setCreeperState(-1); + } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) { + this.swellingCreeper.setCreeperState(-1); + } else { + this.swellingCreeper.setCreeperState(1); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java new file mode 100644 index 0000000..4e24081 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java @@ -0,0 +1,53 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.village.Village; + +public class EntityAIDefendVillage extends EntityAITarget { + EntityIronGolem irongolem; + + /** + * The aggressor of the iron golem's village which is now the golem's attack target. + */ + EntityLivingBase villageAgressorTarget; + + + public EntityAIDefendVillage(EntityIronGolem p_i1659_1_) { + super(p_i1659_1_, false, true); + this.irongolem = p_i1659_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + Village var1 = this.irongolem.getVillage(); + + if (var1 == null) { + return false; + } else { + this.villageAgressorTarget = var1.findNearestVillageAggressor(this.irongolem); + + if (!this.isSuitableTarget(this.villageAgressorTarget, false)) { + if (this.taskOwner.getRNG().nextInt(20) == 0) { + this.villageAgressorTarget = var1.func_82685_c(this.irongolem); + return this.isSuitableTarget(this.villageAgressorTarget, false); + } else { + return false; + } + } else { + return true; + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.irongolem.setAttackTarget(this.villageAgressorTarget); + super.startExecuting(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java new file mode 100644 index 0000000..7146a5a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java @@ -0,0 +1,101 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; + +public abstract class EntityAIDoorInteract extends EntityAIBase { + protected EntityLiving theEntity; + protected int entityPosX; + protected int entityPosY; + protected int entityPosZ; + protected BlockDoor field_151504_e; + + /** + * If is true then the Entity has stopped Door Interaction and compoleted the task. + */ + boolean hasStoppedDoorInteraction; + float entityPositionX; + float entityPositionZ; + + + public EntityAIDoorInteract(EntityLiving p_i1621_1_) { + this.theEntity = p_i1621_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theEntity.isCollidedHorizontally) { + return false; + } else { + PathNavigate var1 = this.theEntity.getNavigator(); + PathEntity var2 = var1.getPath(); + + if (var2 != null && !var2.isFinished() && var1.getCanBreakDoors()) { + for (int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3) { + PathPoint var4 = var2.getPathPointFromIndex(var3); + this.entityPosX = var4.xCoord; + this.entityPosY = var4.yCoord + 1; + this.entityPosZ = var4.zCoord; + + if (this.theEntity.getDistanceSq(this.entityPosX, this.theEntity.posY, this.entityPosZ) <= 2.25D) { + this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ); + + if (this.field_151504_e != null) { + return true; + } + } + } + + this.entityPosX = MathHelper.floor_double(this.theEntity.posX); + this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D); + this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ); + this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ); + return this.field_151504_e != null; + } else { + return false; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.hasStoppedDoorInteraction; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.hasStoppedDoorInteraction = false; + this.entityPositionX = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); + this.entityPositionZ = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); + } + + /** + * Updates the task + */ + public void updateTask() { + float var1 = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); + float var2 = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); + float var3 = this.entityPositionX * var1 + this.entityPositionZ * var2; + + if (var3 < 0.0F) { + this.hasStoppedDoorInteraction = true; + } + } + + private BlockDoor func_151503_a(int p_151503_1_, int p_151503_2_, int p_151503_3_) { + Block var4 = this.theEntity.worldObj.getBlock(p_151503_1_, p_151503_2_, p_151503_3_); + return var4 != Blocks.wooden_door ? null : (BlockDoor)var4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java new file mode 100644 index 0000000..73bbed4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java @@ -0,0 +1,89 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityAIEatGrass extends EntityAIBase { + private final EntityLiving field_151500_b; + private final World field_151501_c; + int field_151502_a; + + + public EntityAIEatGrass(EntityLiving p_i45314_1_) { + this.field_151500_b = p_i45314_1_; + this.field_151501_c = p_i45314_1_.worldObj; + this.setMutexBits(7); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.field_151500_b.getRNG().nextInt(this.field_151500_b.isChild() ? 50 : 1000) != 0) { + return false; + } else { + int var1 = MathHelper.floor_double(this.field_151500_b.posX); + int var2 = MathHelper.floor_double(this.field_151500_b.posY); + int var3 = MathHelper.floor_double(this.field_151500_b.posZ); + return this.field_151501_c.getBlock(var1, var2, var3) == Blocks.tallgrass && this.field_151501_c.getBlockMetadata(var1, var2, var3) == 1 || this.field_151501_c.getBlock(var1, var2 - 1, var3) == Blocks.grass; + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_151502_a = 40; + this.field_151501_c.setEntityState(this.field_151500_b, (byte)10); + this.field_151500_b.getNavigator().clearPathEntity(); + } + + /** + * Resets the task + */ + public void resetTask() { + this.field_151502_a = 0; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.field_151502_a > 0; + } + + public int func_151499_f() { + return this.field_151502_a; + } + + /** + * Updates the task + */ + public void updateTask() { + this.field_151502_a = Math.max(0, this.field_151502_a - 1); + + if (this.field_151502_a == 4) { + int var1 = MathHelper.floor_double(this.field_151500_b.posX); + int var2 = MathHelper.floor_double(this.field_151500_b.posY); + int var3 = MathHelper.floor_double(this.field_151500_b.posZ); + + if (this.field_151501_c.getBlock(var1, var2, var3) == Blocks.tallgrass) { + if (this.field_151501_c.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + this.field_151501_c.func_147480_a(var1, var2, var3, false); + } + + this.field_151500_b.eatGrassBonus(); + } else if (this.field_151501_c.getBlock(var1, var2 - 1, var3) == Blocks.grass) { + if (this.field_151501_c.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + this.field_151501_c.playAuxSFX(2001, var1, var2 - 1, var3, Block.getIdFromBlock(Blocks.grass)); + this.field_151501_c.setBlock(var1, var2 - 1, var3, Blocks.dirt, 0, 2); + } + + this.field_151500_b.eatGrassBonus(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java new file mode 100644 index 0000000..6f68bc0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java @@ -0,0 +1,78 @@ +package net.minecraft.entity.ai; + +import java.util.Random; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityAIFleeSun extends EntityAIBase { + private final EntityCreature theCreature; + private double shelterX; + private double shelterY; + private double shelterZ; + private final double movementSpeed; + private final World theWorld; + + + public EntityAIFleeSun(EntityCreature p_i1623_1_, double p_i1623_2_) { + this.theCreature = p_i1623_1_; + this.movementSpeed = p_i1623_2_; + this.theWorld = p_i1623_1_.worldObj; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theWorld.isDaytime()) { + return false; + } else if (!this.theCreature.isBurning()) { + return false; + } else if (!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int)this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ))) { + return false; + } else { + Vec3 var1 = this.findPossibleShelter(); + + if (var1 == null) { + return false; + } else { + this.shelterX = var1.xCoord; + this.shelterY = var1.yCoord; + this.shelterZ = var1.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.theCreature.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theCreature.getNavigator().tryMoveToXYZ(this.shelterX, this.shelterY, this.shelterZ, this.movementSpeed); + } + + private Vec3 findPossibleShelter() { + Random var1 = this.theCreature.getRNG(); + + for (int var2 = 0; var2 < 10; ++var2) { + int var3 = MathHelper.floor_double(this.theCreature.posX + (double)var1.nextInt(20) - 10.0D); + int var4 = MathHelper.floor_double(this.theCreature.boundingBox.minY + (double)var1.nextInt(6) - 3.0D); + int var5 = MathHelper.floor_double(this.theCreature.posZ + (double)var1.nextInt(20) - 10.0D); + + if (!this.theWorld.canBlockSeeTheSky(var3, var4, var5) && this.theCreature.getBlockPathWeight(var3, var4, var5) < 0.0F) { + return Vec3.createVectorHelper(var3, var4, var5); + } + } + + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java new file mode 100644 index 0000000..30a66fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java @@ -0,0 +1,90 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; + +public class EntityAIFollowGolem extends EntityAIBase { + private final EntityVillager theVillager; + private EntityIronGolem theGolem; + private int takeGolemRoseTick; + private boolean tookGolemRose; + + + public EntityAIFollowGolem(EntityVillager p_i1656_1_) { + this.theVillager = p_i1656_1_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theVillager.getGrowingAge() >= 0) { + return false; + } else if (!this.theVillager.worldObj.isDaytime()) { + return false; + } else { + List var1 = this.theVillager.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, this.theVillager.boundingBox.expand(6.0D, 2.0D, 6.0D)); + + if (var1.isEmpty()) { + return false; + } else { + Iterator var2 = var1.iterator(); + + while (var2.hasNext()) { + EntityIronGolem var3 = (EntityIronGolem)var2.next(); + + if (var3.getHoldRoseTick() > 0) { + this.theGolem = var3; + break; + } + } + + return this.theGolem != null; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.theGolem.getHoldRoseTick() > 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.takeGolemRoseTick = this.theVillager.getRNG().nextInt(320); + this.tookGolemRose = false; + this.theGolem.getNavigator().clearPathEntity(); + } + + /** + * Resets the task + */ + public void resetTask() { + this.theGolem = null; + this.theVillager.getNavigator().clearPathEntity(); + } + + /** + * Updates the task + */ + public void updateTask() { + this.theVillager.getLookHelper().setLookPositionWithEntity(this.theGolem, 30.0F, 30.0F); + + if (this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) { + this.theVillager.getNavigator().tryMoveToEntityLiving(this.theGolem, 0.5D); + this.tookGolemRose = true; + } + + if (this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) { + this.theGolem.setHoldingRose(false); + this.theVillager.getNavigator().clearPathEntity(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java new file mode 100644 index 0000000..fe5e1aa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java @@ -0,0 +1,106 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityAIFollowOwner extends EntityAIBase { + private final EntityTameable thePet; + private EntityLivingBase theOwner; + World theWorld; + private final double field_75336_f; + private final PathNavigate petPathfinder; + private int field_75343_h; + float maxDist; + float minDist; + private boolean field_75344_i; + + + public EntityAIFollowOwner(EntityTameable p_i1625_1_, double p_i1625_2_, float p_i1625_4_, float p_i1625_5_) { + this.thePet = p_i1625_1_; + this.theWorld = p_i1625_1_.worldObj; + this.field_75336_f = p_i1625_2_; + this.petPathfinder = p_i1625_1_.getNavigator(); + this.minDist = p_i1625_4_; + this.maxDist = p_i1625_5_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.thePet.getOwner(); + + if (var1 == null) { + return false; + } else if (this.thePet.isSitting()) { + return false; + } else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)) { + return false; + } else { + this.theOwner = var1; + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_75343_h = 0; + this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); + this.thePet.getNavigator().setAvoidsWater(false); + } + + /** + * Resets the task + */ + public void resetTask() { + this.theOwner = null; + this.petPathfinder.clearPathEntity(); + this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); + } + + /** + * Updates the task + */ + public void updateTask() { + this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); + + if (!this.thePet.isSitting()) { + if (--this.field_75343_h <= 0) { + this.field_75343_h = 10; + + if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) { + if (!this.thePet.getLeashed()) { + if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { + int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; + int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; + int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); + + for (int var4 = 0; var4 <= 4; ++var4) { + for (int var5 = 0; var5 <= 4; ++var5) { + if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) && World.doesBlockHaveSolidTopSurface(this.theWorld, var1 + var4, var3 - 1, var2 + var5) && !this.theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() && !this.theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()) { + this.thePet.setLocationAndAngles((float)(var1 + var4) + 0.5F, var3, (float)(var2 + var5) + 0.5F, this.thePet.rotationYaw, this.thePet.rotationPitch); + this.petPathfinder.clearPathEntity(); + return; + } + } + } + } + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java new file mode 100644 index 0000000..c9e85c8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java @@ -0,0 +1,91 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.passive.EntityAnimal; + +public class EntityAIFollowParent extends EntityAIBase { + /** The child that is following its parent. */ + EntityAnimal childAnimal; + EntityAnimal parentAnimal; + double field_75347_c; + private int field_75345_d; + + + public EntityAIFollowParent(EntityAnimal p_i1626_1_, double p_i1626_2_) { + this.childAnimal = p_i1626_1_; + this.field_75347_c = p_i1626_2_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.childAnimal.getGrowingAge() >= 0) { + return false; + } else { + List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); + EntityAnimal var2 = null; + double var3 = Double.MAX_VALUE; + Iterator var5 = var1.iterator(); + + while (var5.hasNext()) { + EntityAnimal var6 = (EntityAnimal)var5.next(); + + if (var6.getGrowingAge() >= 0) { + double var7 = this.childAnimal.getDistanceSqToEntity(var6); + + if (var7 <= var3) { + var3 = var7; + var2 = var6; + } + } + } + + if (var2 == null) { + return false; + } else if (var3 < 9.0D) { + return false; + } else { + this.parentAnimal = var2; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + if (!this.parentAnimal.isEntityAlive()) { + return false; + } else { + double var1 = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); + return var1 >= 9.0D && var1 <= 256.0D; + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_75345_d = 0; + } + + /** + * Resets the task + */ + public void resetTask() { + this.parentAnimal = null; + } + + /** + * Updates the task + */ + public void updateTask() { + if (--this.field_75345_d <= 0) { + this.field_75345_d = 10; + this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java new file mode 100644 index 0000000..0eb30ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java @@ -0,0 +1,50 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.AxisAlignedBB; + +public class EntityAIHurtByTarget extends EntityAITarget { + boolean entityCallsForHelp; + private int field_142052_b; + + + public EntityAIHurtByTarget(EntityCreature p_i1660_1_, boolean p_i1660_2_) { + super(p_i1660_1_, false); + this.entityCallsForHelp = p_i1660_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + int var1 = this.taskOwner.func_142015_aE(); + return var1 != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); + this.field_142052_b = this.taskOwner.func_142015_aE(); + + if (this.entityCallsForHelp) { + double var1 = this.getTargetDistance(); + List var3 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(var1, 10.0D, var1)); + Iterator var4 = var3.iterator(); + + while (var4.hasNext()) { + EntityCreature var5 = (EntityCreature)var4.next(); + + if (this.taskOwner != var5 && var5.getAttackTarget() == null && !var5.isOnSameTeam(this.taskOwner.getAITarget())) { + var5.setAttackTarget(this.taskOwner.getAITarget()); + } + } + } + + super.startExecuting(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java new file mode 100644 index 0000000..8e21bd1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java @@ -0,0 +1,56 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +public class EntityAILeapAtTarget extends EntityAIBase { + /** The entity that is leaping. */ + EntityLiving leaper; + + /** The entity that the leaper is leaping towards. */ + EntityLivingBase leapTarget; + + /** The entity's motionY after leaping. */ + float leapMotionY; + + + public EntityAILeapAtTarget(EntityLiving p_i1630_1_, float p_i1630_2_) { + this.leaper = p_i1630_1_; + this.leapMotionY = p_i1630_2_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.leapTarget = this.leaper.getAttackTarget(); + + if (this.leapTarget == null) { + return false; + } else { + double var1 = this.leaper.getDistanceSqToEntity(this.leapTarget); + return var1 >= 4.0D && var1 <= 16.0D && (this.leaper.onGround && this.leaper.getRNG().nextInt(5) == 0); + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.leaper.onGround; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + double var1 = this.leapTarget.posX - this.leaper.posX; + double var3 = this.leapTarget.posZ - this.leaper.posZ; + float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3); + this.leaper.motionX += var1 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; + this.leaper.motionZ += var3 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; + this.leaper.motionY = this.leapMotionY; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java new file mode 100644 index 0000000..387c038 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java @@ -0,0 +1,26 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; + +public class EntityAILookAtTradePlayer extends EntityAIWatchClosest { + private final EntityVillager theMerchant; + + + public EntityAILookAtTradePlayer(EntityVillager p_i1633_1_) { + super(p_i1633_1_, EntityPlayer.class, 8.0F); + this.theMerchant = p_i1633_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theMerchant.isTrading()) { + this.closestEntity = this.theMerchant.getCustomer(); + return true; + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java new file mode 100644 index 0000000..0f3d15b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java @@ -0,0 +1,61 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; + +public class EntityAILookAtVillager extends EntityAIBase { + private final EntityIronGolem theGolem; + private EntityVillager theVillager; + private int lookTime; + + + public EntityAILookAtVillager(EntityIronGolem p_i1643_1_) { + this.theGolem = p_i1643_1_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theGolem.worldObj.isDaytime()) { + return false; + } else if (this.theGolem.getRNG().nextInt(8000) != 0) { + return false; + } else { + this.theVillager = (EntityVillager)this.theGolem.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.theGolem.boundingBox.expand(6.0D, 2.0D, 6.0D), this.theGolem); + return this.theVillager != null; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.lookTime > 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.lookTime = 400; + this.theGolem.setHoldingRose(true); + } + + /** + * Resets the task + */ + public void resetTask() { + this.theGolem.setHoldingRose(false); + this.theVillager = null; + } + + /** + * Updates the task + */ + public void updateTask() { + this.theGolem.getLookHelper().setLookPositionWithEntity(this.theVillager, 30.0F, 30.0F); + --this.lookTime; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java new file mode 100644 index 0000000..269fa65 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java @@ -0,0 +1,57 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAILookIdle extends EntityAIBase { + /** The entity that is looking idle. */ + private final EntityLiving idleEntity; + + /** X offset to look at */ + private double lookX; + + /** Z offset to look at */ + private double lookZ; + + /** + * A decrementing tick that stops the entity from being idle once it reaches 0. + */ + private int idleTime; + + + public EntityAILookIdle(EntityLiving p_i1647_1_) { + this.idleEntity = p_i1647_1_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.idleEntity.getRNG().nextFloat() < 0.02F; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.idleTime >= 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + double var1 = (Math.PI * 2D) * this.idleEntity.getRNG().nextDouble(); + this.lookX = Math.cos(var1); + this.lookZ = Math.sin(var1); + this.idleTime = 20 + this.idleEntity.getRNG().nextInt(20); + } + + /** + * Updates the task + */ + public void updateTask() { + --this.idleTime; + this.idleEntity.getLookHelper().setLookPosition(this.idleEntity.posX + this.lookX, this.idleEntity.posY + (double)this.idleEntity.getEyeHeight(), this.idleEntity.posZ + this.lookZ, 10.0F, (float)this.idleEntity.getVerticalFaceSpeed()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMate.java new file mode 100644 index 0000000..1c5bd6f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMate.java @@ -0,0 +1,141 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class EntityAIMate extends EntityAIBase { + private final EntityAnimal theAnimal; + World theWorld; + private EntityAnimal targetMate; + + /** + * Delay preventing a baby from spawning immediately when two mate-able animals find each other. + */ + int spawnBabyDelay; + + /** The speed the creature moves at during mating behavior. */ + double moveSpeed; + + + public EntityAIMate(EntityAnimal p_i1619_1_, double p_i1619_2_) { + this.theAnimal = p_i1619_1_; + this.theWorld = p_i1619_1_.worldObj; + this.moveSpeed = p_i1619_2_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theAnimal.isInLove()) { + return false; + } else { + this.targetMate = this.getNearbyMate(); + return this.targetMate != null; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; + } + + /** + * Resets the task + */ + public void resetTask() { + this.targetMate = null; + this.spawnBabyDelay = 0; + } + + /** + * Updates the task + */ + public void updateTask() { + this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); + this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); + ++this.spawnBabyDelay; + + if (this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) { + this.spawnBaby(); + } + } + + /** + * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first + * valid mate found. + */ + private EntityAnimal getNearbyMate() { + float var1 = 8.0F; + List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand(var1, var1, var1)); + double var3 = Double.MAX_VALUE; + EntityAnimal var5 = null; + Iterator var6 = var2.iterator(); + + while (var6.hasNext()) { + EntityAnimal var7 = (EntityAnimal)var6.next(); + + if (this.theAnimal.canMateWith(var7) && this.theAnimal.getDistanceSqToEntity(var7) < var3) { + var5 = var7; + var3 = this.theAnimal.getDistanceSqToEntity(var7); + } + } + + return var5; + } + + /** + * Spawns a baby animal of the same type. + */ + private void spawnBaby() { + EntityAgeable var1 = this.theAnimal.createChild(this.targetMate); + + if (var1 != null) { + EntityPlayer var2 = this.theAnimal.func_146083_cb(); + + if (var2 == null && this.targetMate.func_146083_cb() != null) { + var2 = this.targetMate.func_146083_cb(); + } + + if (var2 != null) { + var2.triggerAchievement(StatList.field_151186_x); + + if (this.theAnimal instanceof EntityCow) { + var2.triggerAchievement(AchievementList.field_150962_H); + } + } + + this.theAnimal.setGrowingAge(6000); + this.targetMate.setGrowingAge(6000); + this.theAnimal.resetInLove(); + this.targetMate.resetInLove(); + var1.setGrowingAge(-24000); + var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); + this.theWorld.spawnEntityInWorld(var1); + Random var3 = this.theAnimal.getRNG(); + + for (int var4 = 0; var4 < 7; ++var4) { + double var5 = var3.nextGaussian() * 0.02D; + double var7 = var3.nextGaussian() * 0.02D; + double var9 = var3.nextGaussian() * 0.02D; + this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var3.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var3.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var3.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var5, var7, var9); + } + + if (this.theWorld.getGameRules().getGameRuleBooleanValue("doMobLoot")) { + this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var3.nextInt(7) + 1)); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java new file mode 100644 index 0000000..9879df5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java @@ -0,0 +1,81 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIMoveIndoors extends EntityAIBase { + private final EntityCreature entityObj; + private VillageDoorInfo doorInfo; + private int insidePosX = -1; + private int insidePosZ = -1; + + + public EntityAIMoveIndoors(EntityCreature p_i1637_1_) { + this.entityObj = p_i1637_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + int var1 = MathHelper.floor_double(this.entityObj.posX); + int var2 = MathHelper.floor_double(this.entityObj.posY); + int var3 = MathHelper.floor_double(this.entityObj.posZ); + + if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() || !this.entityObj.worldObj.getBiomeGenForCoords(var1, var3).canSpawnLightningBolt()) && !this.entityObj.worldObj.provider.hasNoSky) { + if (this.entityObj.getRNG().nextInt(50) != 0) { + return false; + } else if (this.insidePosX != -1 && this.entityObj.getDistanceSq(this.insidePosX, this.entityObj.posY, this.insidePosZ) < 4.0D) { + return false; + } else { + Village var4 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(var1, var2, var3, 14); + + if (var4 == null) { + return false; + } else { + this.doorInfo = var4.findNearestDoorUnrestricted(var1, var2, var3); + return this.doorInfo != null; + } + } + } else { + return false; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.entityObj.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.insidePosX = -1; + + if (this.entityObj.getDistanceSq(this.doorInfo.getInsidePosX(), this.doorInfo.posY, this.doorInfo.getInsidePosZ()) > 256.0D) { + Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entityObj, 14, 3, Vec3.createVectorHelper((double)this.doorInfo.getInsidePosX() + 0.5D, this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D)); + + if (var1 != null) { + this.entityObj.getNavigator().tryMoveToXYZ(var1.xCoord, var1.yCoord, var1.zCoord, 1.0D); + } + } else { + this.entityObj.getNavigator().tryMoveToXYZ((double)this.doorInfo.getInsidePosX() + 0.5D, this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D, 1.0D); + } + } + + /** + * Resets the task + */ + public void resetTask() { + this.insidePosX = this.doorInfo.getInsidePosX(); + this.insidePosZ = this.doorInfo.getInsidePosZ(); + this.doorInfo = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java new file mode 100644 index 0000000..c713cf3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java @@ -0,0 +1,142 @@ +package net.minecraft.entity.ai; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIMoveThroughVillage extends EntityAIBase { + private final EntityCreature theEntity; + private final double movementSpeed; + + /** The PathNavigate of our entity. */ + private PathEntity entityPathNavigate; + private VillageDoorInfo doorInfo; + private final boolean isNocturnal; + private final List doorList = new ArrayList(); + + + public EntityAIMoveThroughVillage(EntityCreature p_i1638_1_, double p_i1638_2_, boolean p_i1638_4_) { + this.theEntity = p_i1638_1_; + this.movementSpeed = p_i1638_2_; + this.isNocturnal = p_i1638_4_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.func_75414_f(); + + if (this.isNocturnal && this.theEntity.worldObj.isDaytime()) { + return false; + } else { + Village var1 = this.theEntity.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ), 0); + + if (var1 == null) { + return false; + } else { + this.doorInfo = this.func_75412_a(var1); + + if (this.doorInfo == null) { + return false; + } else { + boolean var2 = this.theEntity.getNavigator().getCanBreakDoors(); + this.theEntity.getNavigator().setBreakDoors(false); + this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ(this.doorInfo.posX, this.doorInfo.posY, this.doorInfo.posZ); + this.theEntity.getNavigator().setBreakDoors(var2); + + if (this.entityPathNavigate != null) { + return true; + } else { + Vec3 var3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 10, 7, Vec3.createVectorHelper(this.doorInfo.posX, this.doorInfo.posY, this.doorInfo.posZ)); + + if (var3 == null) { + return false; + } else { + this.theEntity.getNavigator().setBreakDoors(false); + this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ(var3.xCoord, var3.yCoord, var3.zCoord); + this.theEntity.getNavigator().setBreakDoors(var2); + return this.entityPathNavigate != null; + } + } + } + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + if (this.theEntity.getNavigator().noPath()) { + return false; + } else { + float var1 = this.theEntity.width + 4.0F; + return this.theEntity.getDistanceSq(this.doorInfo.posX, this.doorInfo.posY, this.doorInfo.posZ) > (double)(var1 * var1); + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().setPath(this.entityPathNavigate, this.movementSpeed); + } + + /** + * Resets the task + */ + public void resetTask() { + if (this.theEntity.getNavigator().noPath() || this.theEntity.getDistanceSq(this.doorInfo.posX, this.doorInfo.posY, this.doorInfo.posZ) < 16.0D) { + this.doorList.add(this.doorInfo); + } + } + + private VillageDoorInfo func_75412_a(Village p_75412_1_) { + VillageDoorInfo var2 = null; + int var3 = Integer.MAX_VALUE; + List var4 = p_75412_1_.getVillageDoorInfoList(); + Iterator var5 = var4.iterator(); + + while (var5.hasNext()) { + VillageDoorInfo var6 = (VillageDoorInfo)var5.next(); + int var7 = var6.getDistanceSquared(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ)); + + if (var7 < var3 && !this.func_75413_a(var6)) { + var2 = var6; + var3 = var7; + } + } + + return var2; + } + + private boolean func_75413_a(VillageDoorInfo p_75413_1_) { + Iterator var2 = this.doorList.iterator(); + VillageDoorInfo var3; + + do { + if (!var2.hasNext()) { + return false; + } + + var3 = (VillageDoorInfo)var2.next(); + } + while (p_75413_1_.posX != var3.posX || p_75413_1_.posY != var3.posY || p_75413_1_.posZ != var3.posZ); + + return true; + } + + private void func_75414_f() { + if (this.doorList.size() > 15) { + this.doorList.remove(0); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java new file mode 100644 index 0000000..72d6e27 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java @@ -0,0 +1,55 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; + +public class EntityAIMoveTowardsRestriction extends EntityAIBase { + private final EntityCreature theEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private final double movementSpeed; + + + public EntityAIMoveTowardsRestriction(EntityCreature p_i2347_1_, double p_i2347_2_) { + this.theEntity = p_i2347_1_; + this.movementSpeed = p_i2347_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theEntity.isWithinHomeDistanceCurrentPosition()) { + return false; + } else { + ChunkCoordinates var1 = this.theEntity.getHomePosition(); + Vec3 var2 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper(var1.posX, var1.posY, var1.posZ)); + + if (var2 == null) { + return false; + } else { + this.movePosX = var2.xCoord; + this.movePosY = var2.yCoord; + this.movePosZ = var2.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.theEntity.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java new file mode 100644 index 0000000..885d1cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java @@ -0,0 +1,72 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.Vec3; + +public class EntityAIMoveTowardsTarget extends EntityAIBase { + private final EntityCreature theEntity; + private EntityLivingBase targetEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private final double speed; + + /** + * If the distance to the target entity is further than this, this AI task will not run. + */ + private final float maxTargetDistance; + + + public EntityAIMoveTowardsTarget(EntityCreature p_i1640_1_, double p_i1640_2_, float p_i1640_4_) { + this.theEntity = p_i1640_1_; + this.speed = p_i1640_2_; + this.maxTargetDistance = p_i1640_4_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + this.targetEntity = this.theEntity.getAttackTarget(); + + if (this.targetEntity == null) { + return false; + } else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.maxTargetDistance * this.maxTargetDistance)) { + return false; + } else { + Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); + + if (var1 == null) { + return false; + } else { + this.movePosX = var1.xCoord; + this.movePosY = var1.yCoord; + this.movePosZ = var1.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.maxTargetDistance * this.maxTargetDistance); + } + + /** + * Resets the task + */ + public void resetTask() { + this.targetEntity = null; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.speed); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java new file mode 100644 index 0000000..db0d9ff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java @@ -0,0 +1,94 @@ +package net.minecraft.entity.ai; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; + +public class EntityAINearestAttackableTarget extends EntityAITarget { + private final Class targetClass; + private final int targetChance; + + /** Instance of EntityAINearestAttackableTargetSorter. */ + private final EntityAINearestAttackableTarget.Sorter theNearestAttackableTargetSorter; + + /** + * This filter is applied to the Entity search. Only matching entities will be targetted. (null -> no + * restrictions) + */ + private final IEntitySelector targetEntitySelector; + private EntityLivingBase targetEntity; + + + public EntityAINearestAttackableTarget(EntityCreature p_i1663_1_, Class p_i1663_2_, int p_i1663_3_, boolean p_i1663_4_) { + this(p_i1663_1_, p_i1663_2_, p_i1663_3_, p_i1663_4_, false); + } + + public EntityAINearestAttackableTarget(EntityCreature p_i1664_1_, Class p_i1664_2_, int p_i1664_3_, boolean p_i1664_4_, boolean p_i1664_5_) { + this(p_i1664_1_, p_i1664_2_, p_i1664_3_, p_i1664_4_, p_i1664_5_, null); + } + + public EntityAINearestAttackableTarget(EntityCreature p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_) { + super(p_i1665_1_, p_i1665_4_, p_i1665_5_); + this.targetClass = p_i1665_2_; + this.targetChance = p_i1665_3_; + this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(p_i1665_1_); + this.setMutexBits(1); + this.targetEntitySelector = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_ instanceof EntityLivingBase && ((p_i1665_6_ == null || p_i1665_6_.isEntityApplicable(p_82704_1_)) && EntityAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase) p_82704_1_, false)); + } + }; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) { + return false; + } else { + double var1 = this.getTargetDistance(); + List var3 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand(var1, 4.0D, var1), this.targetEntitySelector); + Collections.sort(var3, this.theNearestAttackableTargetSorter); + + if (var3.isEmpty()) { + return false; + } else { + this.targetEntity = (EntityLivingBase)var3.get(0); + return true; + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.targetEntity); + super.startExecuting(); + } + + public static class Sorter implements Comparator { + private final Entity theEntity; + + + public Sorter(Entity p_i1662_1_) { + this.theEntity = p_i1662_1_; + } + + public int compare(Entity p_compare_1_, Entity p_compare_2_) { + double var3 = this.theEntity.getDistanceSqToEntity(p_compare_1_); + double var5 = this.theEntity.getDistanceSqToEntity(p_compare_2_); + return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((Entity)p_compare_1_, (Entity)p_compare_2_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java new file mode 100644 index 0000000..f39e062 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java @@ -0,0 +1,74 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public class EntityAIOcelotAttack extends EntityAIBase { + World theWorld; + EntityLiving theEntity; + EntityLivingBase theVictim; + int attackCountdown; + + + public EntityAIOcelotAttack(EntityLiving p_i1641_1_) { + this.theEntity = p_i1641_1_; + this.theWorld = p_i1641_1_.worldObj; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.theEntity.getAttackTarget(); + + if (var1 == null) { + return false; + } else { + this.theVictim = var1; + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.theVictim.isEntityAlive() && (!(this.theEntity.getDistanceSqToEntity(this.theVictim) > 225.0D) && (!this.theEntity.getNavigator().noPath() || this.shouldExecute())); + } + + /** + * Resets the task + */ + public void resetTask() { + this.theVictim = null; + this.theEntity.getNavigator().clearPathEntity(); + } + + /** + * Updates the task + */ + public void updateTask() { + this.theEntity.getLookHelper().setLookPositionWithEntity(this.theVictim, 30.0F, 30.0F); + double var1 = this.theEntity.width * 2.0F * this.theEntity.width * 2.0F; + double var3 = this.theEntity.getDistanceSq(this.theVictim.posX, this.theVictim.boundingBox.minY, this.theVictim.posZ); + double var5 = 0.8D; + + if (var3 > var1 && var3 < 16.0D) { + var5 = 1.33D; + } else if (var3 < 225.0D) { + var5 = 0.6D; + } + + this.theEntity.getNavigator().tryMoveToEntityLiving(this.theVictim, var5); + this.attackCountdown = Math.max(this.attackCountdown - 1, 0); + + if (var3 <= var1) { + if (this.attackCountdown <= 0) { + this.attackCountdown = 20; + this.theEntity.attackEntityAsMob(this.theVictim); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java new file mode 100644 index 0000000..cd08baf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java @@ -0,0 +1,115 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.world.World; + +public class EntityAIOcelotSit extends EntityAIBase { + private final EntityOcelot field_151493_a; + private final double field_151491_b; + private int field_151492_c; + private int field_151489_d; + private int field_151490_e; + private int field_151487_f; + private int field_151488_g; + private int field_151494_h; + + + public EntityAIOcelotSit(EntityOcelot p_i45315_1_, double p_i45315_2_) { + this.field_151493_a = p_i45315_1_; + this.field_151491_b = p_i45315_2_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.field_151493_a.isTamed() && !this.field_151493_a.isSitting() && this.field_151493_a.getRNG().nextDouble() <= 0.006500000134110451D && this.func_151485_f(); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.field_151492_c <= this.field_151490_e && this.field_151489_d <= 60 && this.func_151486_a(this.field_151493_a.worldObj, this.field_151487_f, this.field_151488_g, this.field_151494_h); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_151493_a.getNavigator().tryMoveToXYZ((double)((float)this.field_151487_f) + 0.5D, this.field_151488_g + 1, (double)((float)this.field_151494_h) + 0.5D, this.field_151491_b); + this.field_151492_c = 0; + this.field_151489_d = 0; + this.field_151490_e = this.field_151493_a.getRNG().nextInt(this.field_151493_a.getRNG().nextInt(1200) + 1200) + 1200; + this.field_151493_a.func_70907_r().setSitting(false); + } + + /** + * Resets the task + */ + public void resetTask() { + this.field_151493_a.setSitting(false); + } + + /** + * Updates the task + */ + public void updateTask() { + ++this.field_151492_c; + this.field_151493_a.func_70907_r().setSitting(false); + + if (this.field_151493_a.getDistanceSq(this.field_151487_f, this.field_151488_g + 1, this.field_151494_h) > 1.0D) { + this.field_151493_a.setSitting(false); + this.field_151493_a.getNavigator().tryMoveToXYZ((double)((float)this.field_151487_f) + 0.5D, this.field_151488_g + 1, (double)((float)this.field_151494_h) + 0.5D, this.field_151491_b); + ++this.field_151489_d; + } else if (!this.field_151493_a.isSitting()) { + this.field_151493_a.setSitting(true); + } else { + --this.field_151489_d; + } + } + + private boolean func_151485_f() { + int var1 = (int)this.field_151493_a.posY; + double var2 = 2.147483647E9D; + + for (int var4 = (int)this.field_151493_a.posX - 8; (double)var4 < this.field_151493_a.posX + 8.0D; ++var4) { + for (int var5 = (int)this.field_151493_a.posZ - 8; (double)var5 < this.field_151493_a.posZ + 8.0D; ++var5) { + if (this.func_151486_a(this.field_151493_a.worldObj, var4, var1, var5) && this.field_151493_a.worldObj.isAirBlock(var4, var1 + 1, var5)) { + double var6 = this.field_151493_a.getDistanceSq(var4, var1, var5); + + if (var6 < var2) { + this.field_151487_f = var4; + this.field_151488_g = var1; + this.field_151494_h = var5; + var2 = var6; + } + } + } + } + + return var2 < 2.147483647E9D; + } + + private boolean func_151486_a(World p_151486_1_, int p_151486_2_, int p_151486_3_, int p_151486_4_) { + Block var5 = p_151486_1_.getBlock(p_151486_2_, p_151486_3_, p_151486_4_); + int var6 = p_151486_1_.getBlockMetadata(p_151486_2_, p_151486_3_, p_151486_4_); + + if (var5 == Blocks.chest) { + TileEntityChest var7 = (TileEntityChest)p_151486_1_.getTileEntity(p_151486_2_, p_151486_3_, p_151486_4_); + + return var7.field_145987_o < 1; + } else { + if (var5 == Blocks.lit_furnace) { + return true; + } + + return var5 == Blocks.bed && !BlockBed.func_149975_b(var6); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java new file mode 100644 index 0000000..7053822 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java @@ -0,0 +1,47 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAIOpenDoor extends EntityAIDoorInteract { + boolean field_75361_i; + int field_75360_j; + + + public EntityAIOpenDoor(EntityLiving p_i1644_1_, boolean p_i1644_2_) { + super(p_i1644_1_); + this.theEntity = p_i1644_1_; + this.field_75361_i = p_i1644_2_; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.field_75361_i && this.field_75360_j > 0 && super.continueExecuting(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.field_75360_j = 20; + this.field_151504_e.func_150014_a(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, true); + } + + /** + * Resets the task + */ + public void resetTask() { + if (this.field_75361_i) { + this.field_151504_e.func_150014_a(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, false); + } + } + + /** + * Updates the task + */ + public void updateTask() { + --this.field_75360_j; + super.updateTask(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java new file mode 100644 index 0000000..4f380e3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java @@ -0,0 +1,50 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAIOwnerHurtByTarget extends EntityAITarget { + EntityTameable theDefendingTameable; + EntityLivingBase theOwnerAttacker; + private int field_142051_e; + + + public EntityAIOwnerHurtByTarget(EntityTameable p_i1667_1_) { + super(p_i1667_1_, false); + this.theDefendingTameable = p_i1667_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theDefendingTameable.isTamed()) { + return false; + } else { + EntityLivingBase var1 = this.theDefendingTameable.getOwner(); + + if (var1 == null) { + return false; + } else { + this.theOwnerAttacker = var1.getAITarget(); + int var2 = var1.func_142015_aE(); + return var2 != this.field_142051_e && this.isSuitableTarget(this.theOwnerAttacker, false) && this.theDefendingTameable.func_142018_a(this.theOwnerAttacker, var1); + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.theOwnerAttacker); + EntityLivingBase var1 = this.theDefendingTameable.getOwner(); + + if (var1 != null) { + this.field_142051_e = var1.func_142015_aE(); + } + + super.startExecuting(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java new file mode 100644 index 0000000..cc5b407 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java @@ -0,0 +1,50 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAIOwnerHurtTarget extends EntityAITarget { + EntityTameable theEntityTameable; + EntityLivingBase theTarget; + private int field_142050_e; + + + public EntityAIOwnerHurtTarget(EntityTameable p_i1668_1_) { + super(p_i1668_1_, false); + this.theEntityTameable = p_i1668_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theEntityTameable.isTamed()) { + return false; + } else { + EntityLivingBase var1 = this.theEntityTameable.getOwner(); + + if (var1 == null) { + return false; + } else { + this.theTarget = var1.getLastAttacker(); + int var2 = var1.getLastAttackerTime(); + return var2 != this.field_142050_e && this.isSuitableTarget(this.theTarget, false) && this.theEntityTameable.func_142018_a(this.theTarget, var1); + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.theTarget); + EntityLivingBase var1 = this.theEntityTameable.getOwner(); + + if (var1 != null) { + this.field_142050_e = var1.getLastAttackerTime(); + } + + super.startExecuting(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIPanic.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIPanic.java new file mode 100644 index 0000000..be7ebe0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIPanic.java @@ -0,0 +1,53 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.Vec3; + +public class EntityAIPanic extends EntityAIBase { + private final EntityCreature theEntityCreature; + private final double speed; + private double randPosX; + private double randPosY; + private double randPosZ; + + + public EntityAIPanic(EntityCreature p_i1645_1_, double p_i1645_2_) { + this.theEntityCreature = p_i1645_1_; + this.speed = p_i1645_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) { + return false; + } else { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); + + if (var1 == null) { + return false; + } else { + this.randPosX = var1.xCoord; + this.randPosY = var1.yCoord; + this.randPosZ = var1.zCoord; + return true; + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.theEntityCreature.getNavigator().noPath(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIPlay.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIPlay.java new file mode 100644 index 0000000..01e62b5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIPlay.java @@ -0,0 +1,104 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.Vec3; + +public class EntityAIPlay extends EntityAIBase { + private final EntityVillager villagerObj; + private EntityLivingBase targetVillager; + private final double field_75261_c; + private int playTime; + + + public EntityAIPlay(EntityVillager p_i1646_1_, double p_i1646_2_) { + this.villagerObj = p_i1646_1_; + this.field_75261_c = p_i1646_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.villagerObj.getGrowingAge() >= 0) { + return false; + } else if (this.villagerObj.getRNG().nextInt(400) != 0) { + return false; + } else { + List var1 = this.villagerObj.worldObj.getEntitiesWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(6.0D, 3.0D, 6.0D)); + double var2 = Double.MAX_VALUE; + Iterator var4 = var1.iterator(); + + while (var4.hasNext()) { + EntityVillager var5 = (EntityVillager)var4.next(); + + if (var5 != this.villagerObj && !var5.isPlaying() && var5.getGrowingAge() < 0) { + double var6 = var5.getDistanceSqToEntity(this.villagerObj); + + if (var6 <= var2) { + var2 = var6; + this.targetVillager = var5; + } + } + } + + if (this.targetVillager == null) { + Vec3 var8 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + + return var8 != null; + } + + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.playTime > 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + if (this.targetVillager != null) { + this.villagerObj.setPlaying(true); + } + + this.playTime = 1000; + } + + /** + * Resets the task + */ + public void resetTask() { + this.villagerObj.setPlaying(false); + this.targetVillager = null; + } + + /** + * Updates the task + */ + public void updateTask() { + --this.playTime; + + if (this.targetVillager != null) { + if (this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.targetVillager, this.field_75261_c); + } + } else if (this.villagerObj.getNavigator().noPath()) { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + + if (var1 == null) { + return; + } + + this.villagerObj.getNavigator().tryMoveToXYZ(var1.xCoord, var1.yCoord, var1.zCoord, this.field_75261_c); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java new file mode 100644 index 0000000..4f3fab7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java @@ -0,0 +1,65 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIRestrictOpenDoor extends EntityAIBase { + private final EntityCreature entityObj; + private VillageDoorInfo frontDoor; + + + public EntityAIRestrictOpenDoor(EntityCreature p_i1651_1_) { + this.entityObj = p_i1651_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.entityObj.worldObj.isDaytime()) { + return false; + } else { + Village var1 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 16); + + if (var1 == null) { + return false; + } else { + this.frontDoor = var1.findNearestDoor(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)); + return this.frontDoor != null && (double) this.frontDoor.getInsideDistanceSquare(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)) < 2.25D; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.entityObj.worldObj.isDaytime() && !this.frontDoor.isDetachedFromVillageFlag && this.frontDoor.isInside(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posZ)); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.entityObj.getNavigator().setBreakDoors(false); + this.entityObj.getNavigator().setEnterDoors(false); + } + + /** + * Resets the task + */ + public void resetTask() { + this.entityObj.getNavigator().setBreakDoors(true); + this.entityObj.getNavigator().setEnterDoors(true); + this.frontDoor = null; + } + + /** + * Updates the task + */ + public void updateTask() { + this.frontDoor.incrementDoorOpeningRestrictionCounter(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java new file mode 100644 index 0000000..de0ee8b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java @@ -0,0 +1,33 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; + +public class EntityAIRestrictSun extends EntityAIBase { + private final EntityCreature theEntity; + + + public EntityAIRestrictSun(EntityCreature p_i1652_1_) { + this.theEntity = p_i1652_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.theEntity.worldObj.isDaytime(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().setAvoidSun(true); + } + + /** + * Resets the task + */ + public void resetTask() { + this.theEntity.getNavigator().setAvoidSun(false); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java new file mode 100644 index 0000000..d7f115f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java @@ -0,0 +1,80 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; + +public class EntityAIRunAroundLikeCrazy extends EntityAIBase { + private final EntityHorse horseHost; + private final double field_111178_b; + private double field_111179_c; + private double field_111176_d; + private double field_111177_e; + + + public EntityAIRunAroundLikeCrazy(EntityHorse p_i1653_1_, double p_i1653_2_) { + this.horseHost = p_i1653_1_; + this.field_111178_b = p_i1653_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.horseHost, 5, 4); + + if (var1 == null) { + return false; + } else { + this.field_111179_c = var1.xCoord; + this.field_111176_d = var1.yCoord; + this.field_111177_e = var1.zCoord; + return true; + } + } else { + return false; + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.horseHost.getNavigator().tryMoveToXYZ(this.field_111179_c, this.field_111176_d, this.field_111177_e, this.field_111178_b); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.horseHost.getNavigator().noPath() && this.horseHost.riddenByEntity != null; + } + + /** + * Updates the task + */ + public void updateTask() { + if (this.horseHost.getRNG().nextInt(50) == 0) { + if (this.horseHost.riddenByEntity instanceof EntityPlayer) { + int var1 = this.horseHost.getTemper(); + int var2 = this.horseHost.getMaxTemper(); + + if (var2 > 0 && this.horseHost.getRNG().nextInt(var2) < var1) { + this.horseHost.setTamedBy((EntityPlayer)this.horseHost.riddenByEntity); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)7); + return; + } + + this.horseHost.increaseTemper(5); + } + + this.horseHost.riddenByEntity.mountEntity(null); + this.horseHost.riddenByEntity = null; + this.horseHost.makeHorseRearWithSound(); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)6); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAISit.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAISit.java new file mode 100644 index 0000000..1371b9a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAISit.java @@ -0,0 +1,55 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAISit extends EntityAIBase { + private final EntityTameable theEntity; + + /** If the EntityTameable is sitting. */ + private boolean isSitting; + + + public EntityAISit(EntityTameable p_i1654_1_) { + this.theEntity = p_i1654_1_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.theEntity.isTamed()) { + return false; + } else if (this.theEntity.isInWater()) { + return false; + } else if (!this.theEntity.onGround) { + return false; + } else { + EntityLivingBase var1 = this.theEntity.getOwner(); + return var1 == null || ((!(this.theEntity.getDistanceSqToEntity(var1) < 144.0D) || var1.getAITarget() == null) && this.isSitting); + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.setSitting(true); + } + + /** + * Resets the task + */ + public void resetTask() { + this.theEntity.setSitting(false); + } + + /** + * Sets the sitting flag. + */ + public void setSitting(boolean p_75270_1_) { + this.isSitting = p_75270_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAISwimming.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAISwimming.java new file mode 100644 index 0000000..faff38f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAISwimming.java @@ -0,0 +1,30 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAISwimming extends EntityAIBase { + private final EntityLiving theEntity; + + + public EntityAISwimming(EntityLiving p_i1624_1_) { + this.theEntity = p_i1624_1_; + this.setMutexBits(4); + p_i1624_1_.getNavigator().setCanSwim(true); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); + } + + /** + * Updates the task + */ + public void updateTask() { + if (this.theEntity.getRNG().nextFloat() < 0.8F) { + this.theEntity.getJumpHelper().setJumping(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITarget.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITarget.java new file mode 100644 index 0000000..93c0713 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITarget.java @@ -0,0 +1,169 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.StringUtils; + +public abstract class EntityAITarget extends EntityAIBase { + /** The entity that this task belongs to */ + protected EntityCreature taskOwner; + + /** + * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. + */ + protected boolean shouldCheckSight; + + /** + * When true, only entities that can be reached with minimal effort will be targetted. + */ + private final boolean nearbyOnly; + + /** + * When nearbyOnly is true: 0 -> No target, but OK to search; 1 -> Nearby target found; 2 -> Target too far. + */ + private int targetSearchStatus; + + /** + * When nearbyOnly is true, this throttles target searching to avoid excessive pathfinding. + */ + private int targetSearchDelay; + private int field_75298_g; + + + public EntityAITarget(EntityCreature p_i1669_1_, boolean p_i1669_2_) { + this(p_i1669_1_, p_i1669_2_, false); + } + + public EntityAITarget(EntityCreature p_i1670_1_, boolean p_i1670_2_, boolean p_i1670_3_) { + this.taskOwner = p_i1670_1_; + this.shouldCheckSight = p_i1670_2_; + this.nearbyOnly = p_i1670_3_; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + EntityLivingBase var1 = this.taskOwner.getAttackTarget(); + + if (var1 == null) { + return false; + } else if (!var1.isEntityAlive()) { + return false; + } else { + double var2 = this.getTargetDistance(); + + if (this.taskOwner.getDistanceSqToEntity(var1) > var2 * var2) { + return false; + } else { + if (this.shouldCheckSight) { + if (this.taskOwner.getEntitySenses().canSee(var1)) { + this.field_75298_g = 0; + } else if (++this.field_75298_g > 60) { + return false; + } + } + + return !(var1 instanceof EntityPlayerMP) || !((EntityPlayerMP)var1).theItemInWorldManager.isCreative(); + } + } + } + + protected double getTargetDistance() { + IAttributeInstance var1 = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); + return var1 == null ? 16.0D : var1.getAttributeValue(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.targetSearchStatus = 0; + this.targetSearchDelay = 0; + this.field_75298_g = 0; + } + + /** + * Resets the task + */ + public void resetTask() { + this.taskOwner.setAttackTarget(null); + } + + /** + * A method used to see if an entity is a suitable target through a number of checks. + */ + protected boolean isSuitableTarget(EntityLivingBase p_75296_1_, boolean p_75296_2_) { + if (p_75296_1_ == null) { + return false; + } else if (p_75296_1_ == this.taskOwner) { + return false; + } else if (!p_75296_1_.isEntityAlive()) { + return false; + } else if (!this.taskOwner.canAttackClass(p_75296_1_.getClass())) { + return false; + } else { + if (this.taskOwner instanceof IEntityOwnable && StringUtils.isNotEmpty(((IEntityOwnable)this.taskOwner).func_152113_b())) { + if (p_75296_1_ instanceof IEntityOwnable && ((IEntityOwnable)this.taskOwner).func_152113_b().equals(((IEntityOwnable)p_75296_1_).func_152113_b())) { + return false; + } + + if (p_75296_1_ == ((IEntityOwnable)this.taskOwner).getOwner()) { + return false; + } + } else if (p_75296_1_ instanceof EntityPlayer && !p_75296_2_ && ((EntityPlayer)p_75296_1_).capabilities.disableDamage) { + return false; + } + + if (!this.taskOwner.isWithinHomeDistance(MathHelper.floor_double(p_75296_1_.posX), MathHelper.floor_double(p_75296_1_.posY), MathHelper.floor_double(p_75296_1_.posZ))) { + return false; + } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(p_75296_1_)) { + return false; + } else { + if (this.nearbyOnly) { + if (--this.targetSearchDelay <= 0) { + this.targetSearchStatus = 0; + } + + if (this.targetSearchStatus == 0) { + this.targetSearchStatus = this.canEasilyReach(p_75296_1_) ? 1 : 2; + } + + return this.targetSearchStatus != 2; + } + + return true; + } + } + } + + /** + * Checks to see if this entity can find a short path to the given target. + */ + private boolean canEasilyReach(EntityLivingBase p_75295_1_) { + this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5); + PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(p_75295_1_); + + if (var2 == null) { + return false; + } else { + PathPoint var3 = var2.getFinalPathPoint(); + + if (var3 == null) { + return false; + } else { + int var4 = var3.xCoord - MathHelper.floor_double(p_75295_1_.posX); + int var5 = var3.zCoord - MathHelper.floor_double(p_75295_1_.posZ); + return (double)(var4 * var4 + var5 * var5) <= 2.25D; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java new file mode 100644 index 0000000..8c40375 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java @@ -0,0 +1,20 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAITargetNonTamed extends EntityAINearestAttackableTarget { + private final EntityTameable theTameable; + + + public EntityAITargetNonTamed(EntityTameable p_i1666_1_, Class p_i1666_2_, int p_i1666_3_, boolean p_i1666_4_) { + super(p_i1666_1_, p_i1666_2_, p_i1666_3_, p_i1666_4_); + this.theTameable = p_i1666_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + return !this.theTameable.isTamed() && super.shouldExecute(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITasks.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITasks.java new file mode 100644 index 0000000..5eac5eb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITasks.java @@ -0,0 +1,170 @@ +package net.minecraft.entity.ai; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.profiler.Profiler; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityAITasks { + private static final Logger logger = LogManager.getLogger(); + + /** A list of EntityAITaskEntrys in EntityAITasks. */ + private final List taskEntries = new ArrayList(); + + /** A list of EntityAITaskEntrys that are currently being executed. */ + private final List executingTaskEntries = new ArrayList(); + + /** Instance of Profiler. */ + private final Profiler theProfiler; + private int tickCount; + private final int tickRate = 3; + + + public EntityAITasks(Profiler p_i1628_1_) { + this.theProfiler = p_i1628_1_; + } + + public void addTask(int p_75776_1_, EntityAIBase p_75776_2_) { + this.taskEntries.add(new EntityAITasks.EntityAITaskEntry(p_75776_1_, p_75776_2_)); + } + + /** + * removes the indicated task from the entity's AI tasks. + */ + public void removeTask(EntityAIBase p_85156_1_) { + Iterator var2 = this.taskEntries.iterator(); + + while (var2.hasNext()) { + EntityAITasks.EntityAITaskEntry var3 = (EntityAITasks.EntityAITaskEntry)var2.next(); + EntityAIBase var4 = var3.action; + + if (var4 == p_85156_1_) { + if (this.executingTaskEntries.contains(var3)) { + var4.resetTask(); + this.executingTaskEntries.remove(var3); + } + + var2.remove(); + } + } + } + + public void onUpdateTasks() { + ArrayList var1 = new ArrayList(); + Iterator var2; + EntityAITasks.EntityAITaskEntry var3; + + if (this.tickCount++ % this.tickRate == 0) { + var2 = this.taskEntries.iterator(); + + while (var2.hasNext()) { + var3 = (EntityAITasks.EntityAITaskEntry)var2.next(); + boolean var4 = this.executingTaskEntries.contains(var3); + + if (var4) { + if (this.canUse(var3) && this.canContinue(var3)) { + continue; + } + + var3.action.resetTask(); + this.executingTaskEntries.remove(var3); + } + + if (this.canUse(var3) && var3.action.shouldExecute()) { + var1.add(var3); + this.executingTaskEntries.add(var3); + } + } + } else { + var2 = this.executingTaskEntries.iterator(); + + while (var2.hasNext()) { + var3 = (EntityAITasks.EntityAITaskEntry)var2.next(); + + if (!var3.action.continueExecuting()) { + var3.action.resetTask(); + var2.remove(); + } + } + } + + this.theProfiler.startSection("goalStart"); + var2 = var1.iterator(); + + while (var2.hasNext()) { + var3 = (EntityAITasks.EntityAITaskEntry)var2.next(); + this.theProfiler.startSection(var3.action.getClass().getSimpleName()); + var3.action.startExecuting(); + this.theProfiler.endSection(); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("goalTick"); + var2 = this.executingTaskEntries.iterator(); + + while (var2.hasNext()) { + var3 = (EntityAITasks.EntityAITaskEntry)var2.next(); + var3.action.updateTask(); + } + + this.theProfiler.endSection(); + } + + /** + * Determine if a specific AI Task should continue being executed. + */ + private boolean canContinue(EntityAITasks.EntityAITaskEntry p_75773_1_) { + this.theProfiler.startSection("canContinue"); + boolean var2 = p_75773_1_.action.continueExecuting(); + this.theProfiler.endSection(); + return var2; + } + + /** + * Determine if a specific AI Task can be executed, which means that all running higher (= lower int value) priority + * tasks are compatible with it or all lower priority tasks can be interrupted. + */ + private boolean canUse(EntityAITasks.EntityAITaskEntry p_75775_1_) { + this.theProfiler.startSection("canUse"); + Iterator var2 = this.taskEntries.iterator(); + + while (var2.hasNext()) { + EntityAITasks.EntityAITaskEntry var3 = (EntityAITasks.EntityAITaskEntry)var2.next(); + + if (var3 != p_75775_1_) { + if (p_75775_1_.priority >= var3.priority) { + if (this.executingTaskEntries.contains(var3) && !this.areTasksCompatible(p_75775_1_, var3)) { + this.theProfiler.endSection(); + return false; + } + } else if (this.executingTaskEntries.contains(var3) && !var3.action.isInterruptible()) { + this.theProfiler.endSection(); + return false; + } + } + } + + this.theProfiler.endSection(); + return true; + } + + /** + * Returns whether two EntityAITaskEntries can be executed concurrently + */ + private boolean areTasksCompatible(EntityAITasks.EntityAITaskEntry p_75777_1_, EntityAITasks.EntityAITaskEntry p_75777_2_) { + return (p_75777_1_.action.getMutexBits() & p_75777_2_.action.getMutexBits()) == 0; + } + + class EntityAITaskEntry { + public EntityAIBase action; + public int priority; + + + public EntityAITaskEntry(int p_i1627_2_, EntityAIBase p_i1627_3_) { + this.priority = p_i1627_2_; + this.action = p_i1627_3_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITempt.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITempt.java new file mode 100644 index 0000000..35a2dfc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITempt.java @@ -0,0 +1,139 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class EntityAITempt extends EntityAIBase { + /** The entity using this AI that is tempted by the player. */ + private final EntityCreature temptedEntity; + private final double field_75282_b; + + /** X position of player tempting this mob */ + private double targetX; + + /** Y position of player tempting this mob */ + private double targetY; + + /** Z position of player tempting this mob */ + private double targetZ; + private double field_75278_f; + private double field_75279_g; + + /** The player that is tempting the entity that is using this AI. */ + private EntityPlayer temptingPlayer; + + /** + * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always + * return false if delayTemptCounter is greater than 0. + */ + private int delayTemptCounter; + + /** True if this EntityAITempt task is running */ + private boolean isRunning; + private final Item field_151484_k; + + /** + * Whether the entity using this AI will be scared by the tempter's sudden movement. + */ + private final boolean scaredByPlayerMovement; + private boolean field_75286_m; + + + public EntityAITempt(EntityCreature p_i45316_1_, double p_i45316_2_, Item p_i45316_4_, boolean p_i45316_5_) { + this.temptedEntity = p_i45316_1_; + this.field_75282_b = p_i45316_2_; + this.field_151484_k = p_i45316_4_; + this.scaredByPlayerMovement = p_i45316_5_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.delayTemptCounter > 0) { + --this.delayTemptCounter; + return false; + } else { + this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); + + if (this.temptingPlayer == null) { + return false; + } else { + ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); + return var1 != null && var1.getItem() == this.field_151484_k; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + if (this.scaredByPlayerMovement) { + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { + if (this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.010000000000000002D) { + return false; + } + + if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { + return false; + } + } else { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + } + + this.field_75278_f = this.temptingPlayer.rotationPitch; + this.field_75279_g = this.temptingPlayer.rotationYaw; + } + + return this.shouldExecute(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + this.isRunning = true; + this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); + this.temptedEntity.getNavigator().setAvoidsWater(false); + } + + /** + * Resets the task + */ + public void resetTask() { + this.temptingPlayer = null; + this.temptedEntity.getNavigator().clearPathEntity(); + this.delayTemptCounter = 100; + this.isRunning = false; + this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); + } + + /** + * Updates the task + */ + public void updateTask() { + this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); + + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { + this.temptedEntity.getNavigator().clearPathEntity(); + } else { + this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.field_75282_b); + } + } + + /** + * @see #isRunning + */ + public boolean isRunning() { + return this.isRunning; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java new file mode 100644 index 0000000..829cccf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java @@ -0,0 +1,47 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; + +public class EntityAITradePlayer extends EntityAIBase { + private final EntityVillager villager; + + + public EntityAITradePlayer(EntityVillager p_i1658_1_) { + this.villager = p_i1658_1_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (!this.villager.isEntityAlive()) { + return false; + } else if (this.villager.isInWater()) { + return false; + } else if (!this.villager.onGround) { + return false; + } else if (this.villager.velocityChanged) { + return false; + } else { + EntityPlayer var1 = this.villager.getCustomer(); + return var1 != null && (!(this.villager.getDistanceSqToEntity(var1) > 16.0D) && var1.openContainer instanceof Container); + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.villager.getNavigator().clearPathEntity(); + } + + /** + * Resets the task + */ + public void resetTask() { + this.villager.setCustomer(null); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java new file mode 100644 index 0000000..6d0c569 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java @@ -0,0 +1,111 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityAIVillagerMate extends EntityAIBase { + private final EntityVillager villagerObj; + private EntityVillager mate; + private final World worldObj; + private int matingTimeout; + Village villageObj; + + + public EntityAIVillagerMate(EntityVillager p_i1634_1_) { + this.villagerObj = p_i1634_1_; + this.worldObj = p_i1634_1_.worldObj; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.villagerObj.getGrowingAge() != 0) { + return false; + } else if (this.villagerObj.getRNG().nextInt(500) != 0) { + return false; + } else { + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.villagerObj.posX), MathHelper.floor_double(this.villagerObj.posY), MathHelper.floor_double(this.villagerObj.posZ), 0); + + if (this.villageObj == null) { + return false; + } else if (!this.checkSufficientDoorsPresentForNewVillager()) { + return false; + } else { + Entity var1 = this.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(8.0D, 3.0D, 8.0D), this.villagerObj); + + if (var1 == null) { + return false; + } else { + this.mate = (EntityVillager)var1; + return this.mate.getGrowingAge() == 0; + } + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.matingTimeout = 300; + this.villagerObj.setMating(true); + } + + /** + * Resets the task + */ + public void resetTask() { + this.villageObj = null; + this.mate = null; + this.villagerObj.setMating(false); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.matingTimeout >= 0 && this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getGrowingAge() == 0; + } + + /** + * Updates the task + */ + public void updateTask() { + --this.matingTimeout; + this.villagerObj.getLookHelper().setLookPositionWithEntity(this.mate, 10.0F, 30.0F); + + if (this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.mate, 0.25D); + } else if (this.matingTimeout == 0 && this.mate.isMating()) { + this.giveBirth(); + } + + if (this.villagerObj.getRNG().nextInt(35) == 0) { + this.worldObj.setEntityState(this.villagerObj, (byte)12); + } + } + + private boolean checkSufficientDoorsPresentForNewVillager() { + if (!this.villageObj.isMatingSeason()) { + return false; + } else { + int var1 = (int)((double)((float)this.villageObj.getNumVillageDoors()) * 0.35D); + return this.villageObj.getNumVillagers() < var1; + } + } + + private void giveBirth() { + EntityVillager var1 = this.villagerObj.createChild(this.mate); + this.mate.setGrowingAge(6000); + this.villagerObj.setGrowingAge(6000); + var1.setGrowingAge(-24000); + var1.setLocationAndAngles(this.villagerObj.posX, this.villagerObj.posY, this.villagerObj.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(var1); + this.worldObj.setEntityState(var1, (byte)12); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWander.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWander.java new file mode 100644 index 0000000..e441f8c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWander.java @@ -0,0 +1,55 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.Vec3; + +public class EntityAIWander extends EntityAIBase { + private final EntityCreature entity; + private double xPosition; + private double yPosition; + private double zPosition; + private final double speed; + + + public EntityAIWander(EntityCreature p_i1648_1_, double p_i1648_2_) { + this.entity = p_i1648_1_; + this.speed = p_i1648_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.entity.getAge() >= 100) { + return false; + } else if (this.entity.getRNG().nextInt(120) != 0) { + return false; + } else { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); + + if (var1 == null) { + return false; + } else { + this.xPosition = var1.xCoord; + this.yPosition = var1.yCoord; + this.zPosition = var1.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return !this.entity.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java new file mode 100644 index 0000000..6e24cf5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java @@ -0,0 +1,85 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; + +public class EntityAIWatchClosest extends EntityAIBase { + private final EntityLiving theWatcher; + + /** The closest entity which is being watched by this one. */ + protected Entity closestEntity; + + /** This is the Maximum distance that the AI will look for the Entity */ + private final float maxDistanceForPlayer; + private int lookTime; + private final float field_75331_e; + private final Class watchedClass; + + + public EntityAIWatchClosest(EntityLiving p_i1631_1_, Class p_i1631_2_, float p_i1631_3_) { + this.theWatcher = p_i1631_1_; + this.watchedClass = p_i1631_2_; + this.maxDistanceForPlayer = p_i1631_3_; + this.field_75331_e = 0.02F; + this.setMutexBits(2); + } + + public EntityAIWatchClosest(EntityLiving p_i1632_1_, Class p_i1632_2_, float p_i1632_3_, float p_i1632_4_) { + this.theWatcher = p_i1632_1_; + this.watchedClass = p_i1632_2_; + this.maxDistanceForPlayer = p_i1632_3_; + this.field_75331_e = p_i1632_4_; + this.setMutexBits(2); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() { + if (this.theWatcher.getRNG().nextFloat() >= this.field_75331_e) { + return false; + } else { + if (this.theWatcher.getAttackTarget() != null) { + this.closestEntity = this.theWatcher.getAttackTarget(); + } + + if (this.watchedClass == EntityPlayer.class) { + this.closestEntity = this.theWatcher.worldObj.getClosestPlayerToEntity(this.theWatcher, this.maxDistanceForPlayer); + } else { + this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.boundingBox.expand(this.maxDistanceForPlayer, 3.0D, this.maxDistanceForPlayer), this.theWatcher); + } + + return this.closestEntity != null; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() { + return this.closestEntity.isEntityAlive() && (!(this.theWatcher.getDistanceSqToEntity(this.closestEntity) > (double) (this.maxDistanceForPlayer * this.maxDistanceForPlayer)) && this.lookTime > 0); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() { + this.lookTime = 40 + this.theWatcher.getRNG().nextInt(40); + } + + /** + * Resets the task + */ + public void resetTask() { + this.closestEntity = null; + } + + /** + * Updates the task + */ + public void updateTask() { + this.theWatcher.getLookHelper().setLookPosition(this.closestEntity.posX, this.closestEntity.posY + (double)this.closestEntity.getEyeHeight(), this.closestEntity.posZ, 10.0F, (float)this.theWatcher.getVerticalFaceSpeed()); + --this.lookTime; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java new file mode 100644 index 0000000..ad4a7bb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java @@ -0,0 +1,12 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAIWatchClosest2 extends EntityAIWatchClosest { + + + public EntityAIWatchClosest2(EntityLiving p_i1629_1_, Class p_i1629_2_, float p_i1629_3_, float p_i1629_4_) { + super(p_i1629_1_, p_i1629_2_, p_i1629_3_, p_i1629_4_); + this.setMutexBits(3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java new file mode 100644 index 0000000..2041242 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java @@ -0,0 +1,25 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityJumpHelper { + private final EntityLiving entity; + private boolean isJumping; + + + public EntityJumpHelper(EntityLiving p_i1612_1_) { + this.entity = p_i1612_1_; + } + + public void setJumping() { + this.isJumping = true; + } + + /** + * Called to actually make the entity jump if isJumping is true. + */ + public void doJump() { + this.entity.setJumping(this.isJumping); + this.isJumping = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityLookHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityLookHelper.java new file mode 100644 index 0000000..b4c8383 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityLookHelper.java @@ -0,0 +1,108 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +public class EntityLookHelper { + private final EntityLiving entity; + + /** + * The amount of change that is made each update for an entity facing a direction. + */ + private float deltaLookYaw; + + /** + * The amount of change that is made each update for an entity facing a direction. + */ + private float deltaLookPitch; + + /** Whether or not the entity is trying to look at something. */ + private boolean isLooking; + private double posX; + private double posY; + private double posZ; + + + public EntityLookHelper(EntityLiving p_i1613_1_) { + this.entity = p_i1613_1_; + } + + /** + * Sets position to look at using entity + */ + public void setLookPositionWithEntity(Entity p_75651_1_, float p_75651_2_, float p_75651_3_) { + this.posX = p_75651_1_.posX; + + if (p_75651_1_ instanceof EntityLivingBase) { + this.posY = p_75651_1_.posY + (double)p_75651_1_.getEyeHeight(); + } else { + this.posY = (p_75651_1_.boundingBox.minY + p_75651_1_.boundingBox.maxY) / 2.0D; + } + + this.posZ = p_75651_1_.posZ; + this.deltaLookYaw = p_75651_2_; + this.deltaLookPitch = p_75651_3_; + this.isLooking = true; + } + + /** + * Sets position to look at + */ + public void setLookPosition(double p_75650_1_, double p_75650_3_, double p_75650_5_, float p_75650_7_, float p_75650_8_) { + this.posX = p_75650_1_; + this.posY = p_75650_3_; + this.posZ = p_75650_5_; + this.deltaLookYaw = p_75650_7_; + this.deltaLookPitch = p_75650_8_; + this.isLooking = true; + } + + /** + * Updates look + */ + public void onUpdateLook() { + this.entity.rotationPitch = 0.0F; + + if (this.isLooking) { + this.isLooking = false; + double var1 = this.posX - this.entity.posX; + double var3 = this.posY - (this.entity.posY + (double)this.entity.getEyeHeight()); + double var5 = this.posZ - this.entity.posZ; + double var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); + float var9 = (float)(Math.atan2(var5, var1) * 180.0D / Math.PI) - 90.0F; + float var10 = (float)(-(Math.atan2(var3, var7) * 180.0D / Math.PI)); + this.entity.rotationPitch = this.updateRotation(this.entity.rotationPitch, var10, this.deltaLookPitch); + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, var9, this.deltaLookYaw); + } else { + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, this.entity.renderYawOffset, 10.0F); + } + + float var11 = MathHelper.wrapAngleTo180_float(this.entity.rotationYawHead - this.entity.renderYawOffset); + + if (!this.entity.getNavigator().noPath()) { + if (var11 < -75.0F) { + this.entity.rotationYawHead = this.entity.renderYawOffset - 75.0F; + } + + if (var11 > 75.0F) { + this.entity.rotationYawHead = this.entity.renderYawOffset + 75.0F; + } + } + } + + private float updateRotation(float p_75652_1_, float p_75652_2_, float p_75652_3_) { + float var4 = MathHelper.wrapAngleTo180_float(p_75652_2_ - p_75652_1_); + + if (var4 > p_75652_3_) { + var4 = p_75652_3_; + } + + if (var4 < -p_75652_3_) { + var4 = -p_75652_3_; + } + + return p_75652_1_ + var4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java new file mode 100644 index 0000000..f846e60 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java @@ -0,0 +1,80 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityMinecartMobSpawner extends EntityMinecart { + /** Mob spawner logic for this spawner minecart. */ + private final MobSpawnerBaseLogic mobSpawnerLogic = new MobSpawnerBaseLogic() { + + public void func_98267_a(int p_98267_1_) { + EntityMinecartMobSpawner.this.worldObj.setEntityState(EntityMinecartMobSpawner.this, (byte)p_98267_1_); + } + public World getSpawnerWorld() { + return EntityMinecartMobSpawner.this.worldObj; + } + public int getSpawnerX() { + return MathHelper.floor_double(EntityMinecartMobSpawner.this.posX); + } + public int getSpawnerY() { + return MathHelper.floor_double(EntityMinecartMobSpawner.this.posY); + } + public int getSpawnerZ() { + return MathHelper.floor_double(EntityMinecartMobSpawner.this.posZ); + } + }; + + + public EntityMinecartMobSpawner(World p_i1725_1_) { + super(p_i1725_1_); + } + + public EntityMinecartMobSpawner(World p_i1726_1_, double p_i1726_2_, double p_i1726_4_, double p_i1726_6_) { + super(p_i1726_1_, p_i1726_2_, p_i1726_4_, p_i1726_6_); + } + + public int getMinecartType() { + return 4; + } + + public Block func_145817_o() { + return Blocks.mob_spawner; + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.mobSpawnerLogic.readFromNBT(p_70037_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + this.mobSpawnerLogic.writeToNBT(p_70014_1_); + } + + public void handleHealthUpdate(byte p_70103_1_) { + this.mobSpawnerLogic.setDelayToMin(p_70103_1_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + this.mobSpawnerLogic.updateSpawner(); + } + + public MobSpawnerBaseLogic func_98039_d() { + return this.mobSpawnerLogic; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java new file mode 100644 index 0000000..c7ea249 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java @@ -0,0 +1,84 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.MathHelper; + +public class EntityMoveHelper { + /** The EntityLiving that is being moved */ + private final EntityLiving entity; + private double posX; + private double posY; + private double posZ; + + /** The speed at which the entity should move */ + private double speed; + private boolean update; + + + public EntityMoveHelper(EntityLiving p_i1614_1_) { + this.entity = p_i1614_1_; + this.posX = p_i1614_1_.posX; + this.posY = p_i1614_1_.posY; + this.posZ = p_i1614_1_.posZ; + } + + public boolean isUpdating() { + return this.update; + } + + public double getSpeed() { + return this.speed; + } + + /** + * Sets the speed and location to move to + */ + public void setMoveTo(double p_75642_1_, double p_75642_3_, double p_75642_5_, double p_75642_7_) { + this.posX = p_75642_1_; + this.posY = p_75642_3_; + this.posZ = p_75642_5_; + this.speed = p_75642_7_; + this.update = true; + } + + public void onUpdateMoveHelper() { + this.entity.setMoveForward(0.0F); + + if (this.update) { + this.update = false; + int var1 = MathHelper.floor_double(this.entity.boundingBox.minY + 0.5D); + double var2 = this.posX - this.entity.posX; + double var4 = this.posZ - this.entity.posZ; + double var6 = this.posY - (double)var1; + double var8 = var2 * var2 + var6 * var6 + var4 * var4; + + if (var8 >= 2.500000277905201E-7D) { + float var10 = (float)(Math.atan2(var4, var2) * 180.0D / Math.PI) - 90.0F; + this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, var10, 30.0F); + this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + + if (var6 > 0.0D && var2 * var2 + var4 * var4 < 1.0D) { + this.entity.getJumpHelper().setJumping(); + } + } + } + } + + /** + * Limits the given angle to a upper and lower limit. + */ + private float limitAngle(float p_75639_1_, float p_75639_2_, float p_75639_3_) { + float var4 = MathHelper.wrapAngleTo180_float(p_75639_2_ - p_75639_1_); + + if (var4 > p_75639_3_) { + var4 = p_75639_3_; + } + + if (var4 < -p_75639_3_) { + var4 = -p_75639_3_; + } + + return p_75639_1_ + var4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntitySenses.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntitySenses.java new file mode 100644 index 0000000..2a4ad22 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/EntitySenses.java @@ -0,0 +1,52 @@ +package net.minecraft.entity.ai; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; + +public class EntitySenses { + EntityLiving entityObj; + + /** Cache of entities which we can see */ + List seenEntities = new ArrayList(); + + /** Cache of entities which we cannot see */ + List unseenEntities = new ArrayList(); + + + public EntitySenses(EntityLiving p_i1672_1_) { + this.entityObj = p_i1672_1_; + } + + /** + * Clears canSeeCachePositive and canSeeCacheNegative. + */ + public void clearSensingCache() { + this.seenEntities.clear(); + this.unseenEntities.clear(); + } + + /** + * Checks, whether 'our' entity can see the entity given as argument (true) or not (false), caching the result. + */ + public boolean canSee(Entity p_75522_1_) { + if (this.seenEntities.contains(p_75522_1_)) { + return true; + } else if (this.unseenEntities.contains(p_75522_1_)) { + return false; + } else { + this.entityObj.worldObj.theProfiler.startSection("canSee"); + boolean var2 = this.entityObj.canEntityBeSeen(p_75522_1_); + this.entityObj.worldObj.theProfiler.endSection(); + + if (var2) { + this.seenEntities.add(p_75522_1_); + } else { + this.unseenEntities.add(p_75522_1_); + } + + return var2; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java new file mode 100644 index 0000000..d92479b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java @@ -0,0 +1,94 @@ +package net.minecraft.entity.ai; + +import java.util.Random; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class RandomPositionGenerator { + /** + * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. + * MULTIPLE findTowards and findAway calls, will share this var + */ + private static final Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + + + /** + * finds a random target within par1(x,z) and par2 (y) blocks + */ + public static Vec3 findRandomTarget(EntityCreature p_75463_0_, int p_75463_1_, int p_75463_2_) { + return findRandomTargetBlock(p_75463_0_, p_75463_1_, p_75463_2_, null); + } + + /** + * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 + */ + public static Vec3 findRandomTargetBlockTowards(EntityCreature p_75464_0_, int p_75464_1_, int p_75464_2_, Vec3 p_75464_3_) { + staticVector.xCoord = p_75464_3_.xCoord - p_75464_0_.posX; + staticVector.yCoord = p_75464_3_.yCoord - p_75464_0_.posY; + staticVector.zCoord = p_75464_3_.zCoord - p_75464_0_.posZ; + return findRandomTargetBlock(p_75464_0_, p_75464_1_, p_75464_2_, staticVector); + } + + /** + * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 + */ + public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature p_75461_0_, int p_75461_1_, int p_75461_2_, Vec3 p_75461_3_) { + staticVector.xCoord = p_75461_0_.posX - p_75461_3_.xCoord; + staticVector.yCoord = p_75461_0_.posY - p_75461_3_.yCoord; + staticVector.zCoord = p_75461_0_.posZ - p_75461_3_.zCoord; + return findRandomTargetBlock(p_75461_0_, p_75461_1_, p_75461_2_, staticVector); + } + + /** + * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of + * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number + */ + private static Vec3 findRandomTargetBlock(EntityCreature p_75462_0_, int p_75462_1_, int p_75462_2_, Vec3 p_75462_3_) { + Random var4 = p_75462_0_.getRNG(); + boolean var5 = false; + int var6 = 0; + int var7 = 0; + int var8 = 0; + float var9 = -99999.0F; + boolean var10; + + if (p_75462_0_.hasHome()) { + double var11 = p_75462_0_.getHomePosition().getDistanceSquared(MathHelper.floor_double(p_75462_0_.posX), MathHelper.floor_double(p_75462_0_.posY), MathHelper.floor_double(p_75462_0_.posZ)) + 4.0F; + double var13 = p_75462_0_.func_110174_bM() + (float)p_75462_1_; + var10 = var11 < var13 * var13; + } else { + var10 = false; + } + + for (int var16 = 0; var16 < 10; ++var16) { + int var12 = var4.nextInt(2 * p_75462_1_) - p_75462_1_; + int var17 = var4.nextInt(2 * p_75462_2_) - p_75462_2_; + int var14 = var4.nextInt(2 * p_75462_1_) - p_75462_1_; + + if (p_75462_3_ == null || (double)var12 * p_75462_3_.xCoord + (double)var14 * p_75462_3_.zCoord >= 0.0D) { + var12 += MathHelper.floor_double(p_75462_0_.posX); + var17 += MathHelper.floor_double(p_75462_0_.posY); + var14 += MathHelper.floor_double(p_75462_0_.posZ); + + if (!var10 || p_75462_0_.isWithinHomeDistance(var12, var17, var14)) { + float var15 = p_75462_0_.getBlockPathWeight(var12, var17, var14); + + if (var15 > var9) { + var9 = var15; + var6 = var12; + var7 = var17; + var8 = var14; + var5 = true; + } + } + } + } + + if (var5) { + return Vec3.createVectorHelper(var6, var7, var8); + } else { + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java new file mode 100644 index 0000000..6ae30df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/AttributeModifier.java @@ -0,0 +1,84 @@ +package net.minecraft.entity.ai.attributes; + +import java.util.UUID; +import org.apache.commons.lang3.Validate; + +public class AttributeModifier { + private final double amount; + private final int operation; + private final String name; + private final UUID id; + + /** + * If false, this modifier is not saved in NBT. Used for "natural" modifiers like speed boost from sprinting + */ + private boolean isSaved; + + + public AttributeModifier(String p_i1605_1_, double p_i1605_2_, int p_i1605_4_) { + this(UUID.randomUUID(), p_i1605_1_, p_i1605_2_, p_i1605_4_); + } + + public AttributeModifier(UUID p_i1606_1_, String p_i1606_2_, double p_i1606_3_, int p_i1606_5_) { + this.isSaved = true; + this.id = p_i1606_1_; + this.name = p_i1606_2_; + this.amount = p_i1606_3_; + this.operation = p_i1606_5_; + Validate.notEmpty(p_i1606_2_, "Modifier name cannot be empty"); + Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(p_i1606_5_), "Invalid operation", new Object[0]); + } + + public UUID getID() { + return this.id; + } + + public String getName() { + return this.name; + } + + public int getOperation() { + return this.operation; + } + + public double getAmount() { + return this.amount; + } + + /** + * @see #isSaved + */ + public boolean isSaved() { + return this.isSaved; + } + + /** + * @see #isSaved + */ + public AttributeModifier setSaved(boolean p_111168_1_) { + this.isSaved = p_111168_1_; + return this; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) { + AttributeModifier var2 = (AttributeModifier)p_equals_1_; + + if (this.id != null) { + return this.id.equals(var2.id); + } else return var2.id == null; + } else { + return false; + } + } + + public int hashCode() { + return this.id != null ? this.id.hashCode() : 0; + } + + public String toString() { + return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name='" + this.name + '\'' + ", id=" + this.id + ", serialize=" + this.isSaved + '}'; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java new file mode 100644 index 0000000..d17f696 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/BaseAttribute.java @@ -0,0 +1,38 @@ +package net.minecraft.entity.ai.attributes; + +public abstract class BaseAttribute implements IAttribute { + private final String unlocalizedName; + private final double defaultValue; + private boolean shouldWatch; + + + protected BaseAttribute(String p_i1607_1_, double p_i1607_2_) { + this.unlocalizedName = p_i1607_1_; + this.defaultValue = p_i1607_2_; + + if (p_i1607_1_ == null) { + throw new IllegalArgumentException("Name cannot be null!"); + } + } + + public String getAttributeUnlocalizedName() { + return this.unlocalizedName; + } + + public double getDefaultValue() { + return this.defaultValue; + } + + public boolean getShouldWatch() { + return this.shouldWatch; + } + + public BaseAttribute setShouldWatch(boolean p_111112_1_) { + this.shouldWatch = p_111112_1_; + return this; + } + + public int hashCode() { + return this.unlocalizedName.hashCode(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java new file mode 100644 index 0000000..f692ee4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java @@ -0,0 +1,61 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.server.management.LowerStringMap; + +public abstract class BaseAttributeMap { + protected final Map attributes = new HashMap(); + protected final Map attributesByName = new LowerStringMap(); + + + public IAttributeInstance getAttributeInstance(IAttribute p_111151_1_) { + return (IAttributeInstance)this.attributes.get(p_111151_1_); + } + + public IAttributeInstance getAttributeInstanceByName(String p_111152_1_) { + return (IAttributeInstance)this.attributesByName.get(p_111152_1_); + } + + /** + * Registers an attribute with this AttributeMap, returns a modifiable AttributeInstance associated with this map + */ + public abstract IAttributeInstance registerAttribute(IAttribute p_111150_1_); + + public Collection getAllAttributes() { + return this.attributesByName.values(); + } + + public void addAttributeInstance(ModifiableAttributeInstance p_111149_1_) {} + + public void removeAttributeModifiers(Multimap p_111148_1_) { + Iterator var2 = p_111148_1_.entries().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + IAttributeInstance var4 = this.getAttributeInstanceByName((String)var3.getKey()); + + if (var4 != null) { + var4.removeModifier((AttributeModifier)var3.getValue()); + } + } + } + + public void applyAttributeModifiers(Multimap p_111147_1_) { + Iterator var2 = p_111147_1_.entries().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + IAttributeInstance var4 = this.getAttributeInstanceByName((String)var3.getKey()); + + if (var4 != null) { + var4.removeModifier((AttributeModifier)var3.getValue()); + var4.applyModifier((AttributeModifier)var3.getValue()); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java new file mode 100644 index 0000000..ca61e6a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/IAttribute.java @@ -0,0 +1,11 @@ +package net.minecraft.entity.ai.attributes; + +public interface IAttribute { + String getAttributeUnlocalizedName(); + + double clampValue(double p_111109_1_); + + double getDefaultValue(); + + boolean getShouldWatch(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java new file mode 100644 index 0000000..4ddf489 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java @@ -0,0 +1,30 @@ +package net.minecraft.entity.ai.attributes; + +import java.util.Collection; +import java.util.UUID; + +public interface IAttributeInstance { + /** + * Get the Attribute this is an instance of + */ + IAttribute getAttribute(); + + double getBaseValue(); + + void setBaseValue(double p_111128_1_); + + Collection func_111122_c(); + + /** + * Returns attribute modifier, if any, by the given UUID + */ + AttributeModifier getModifier(UUID p_111127_1_); + + void applyModifier(AttributeModifier p_111121_1_); + + void removeModifier(AttributeModifier p_111124_1_); + + void removeAllModifiers(); + + double getAttributeValue(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java new file mode 100644 index 0000000..ae53e39 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java @@ -0,0 +1,163 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class ModifiableAttributeInstance implements IAttributeInstance { + /** The BaseAttributeMap this attributeInstance can be found in */ + private final BaseAttributeMap attributeMap; + + /** The Attribute this is an instance of */ + private final IAttribute genericAttribute; + private final Map mapByOperation = Maps.newHashMap(); + private final Map mapByName = Maps.newHashMap(); + private final Map mapByUUID = Maps.newHashMap(); + private double baseValue; + private boolean needsUpdate = true; + private double cachedValue; + + + public ModifiableAttributeInstance(BaseAttributeMap p_i1608_1_, IAttribute p_i1608_2_) { + this.attributeMap = p_i1608_1_; + this.genericAttribute = p_i1608_2_; + this.baseValue = p_i1608_2_.getDefaultValue(); + + for (int var3 = 0; var3 < 3; ++var3) { + this.mapByOperation.put(Integer.valueOf(var3), new HashSet()); + } + } + + /** + * Get the Attribute this is an instance of + */ + public IAttribute getAttribute() { + return this.genericAttribute; + } + + public double getBaseValue() { + return this.baseValue; + } + + public void setBaseValue(double p_111128_1_) { + if (p_111128_1_ != this.getBaseValue()) { + this.baseValue = p_111128_1_; + this.flagForUpdate(); + } + } + + public Collection getModifiersByOperation(int p_111130_1_) { + return (Collection)this.mapByOperation.get(Integer.valueOf(p_111130_1_)); + } + + public Collection func_111122_c() { + HashSet var1 = new HashSet(); + + for (int var2 = 0; var2 < 3; ++var2) { + var1.addAll(this.getModifiersByOperation(var2)); + } + + return var1; + } + + /** + * Returns attribute modifier, if any, by the given UUID + */ + public AttributeModifier getModifier(UUID p_111127_1_) { + return (AttributeModifier)this.mapByUUID.get(p_111127_1_); + } + + public void applyModifier(AttributeModifier p_111121_1_) { + if (this.getModifier(p_111121_1_.getID()) != null) { + throw new IllegalArgumentException("Modifier is already applied on this attribute!"); + } else { + Object var2 = this.mapByName.get(p_111121_1_.getName()); + + if (var2 == null) { + var2 = new HashSet(); + this.mapByName.put(p_111121_1_.getName(), var2); + } + + ((Set)this.mapByOperation.get(Integer.valueOf(p_111121_1_.getOperation()))).add(p_111121_1_); + ((Set)var2).add(p_111121_1_); + this.mapByUUID.put(p_111121_1_.getID(), p_111121_1_); + this.flagForUpdate(); + } + } + + private void flagForUpdate() { + this.needsUpdate = true; + this.attributeMap.addAttributeInstance(this); + } + + public void removeModifier(AttributeModifier p_111124_1_) { + for (int var2 = 0; var2 < 3; ++var2) { + Set var3 = (Set)this.mapByOperation.get(Integer.valueOf(var2)); + var3.remove(p_111124_1_); + } + + Set var4 = (Set)this.mapByName.get(p_111124_1_.getName()); + + if (var4 != null) { + var4.remove(p_111124_1_); + + if (var4.isEmpty()) { + this.mapByName.remove(p_111124_1_.getName()); + } + } + + this.mapByUUID.remove(p_111124_1_.getID()); + this.flagForUpdate(); + } + + public void removeAllModifiers() { + Collection var1 = this.func_111122_c(); + + if (var1 != null) { + ArrayList var4 = new ArrayList(var1); + Iterator var2 = var4.iterator(); + + while (var2.hasNext()) { + AttributeModifier var3 = (AttributeModifier)var2.next(); + this.removeModifier(var3); + } + } + } + + public double getAttributeValue() { + if (this.needsUpdate) { + this.cachedValue = this.computeValue(); + this.needsUpdate = false; + } + + return this.cachedValue; + } + + private double computeValue() { + double var1 = this.getBaseValue(); + AttributeModifier var4; + + for (Iterator var3 = this.getModifiersByOperation(0).iterator(); var3.hasNext(); var1 += var4.getAmount()) { + var4 = (AttributeModifier)var3.next(); + } + + double var7 = var1; + Iterator var5; + AttributeModifier var6; + + for (var5 = this.getModifiersByOperation(1).iterator(); var5.hasNext(); var7 += var1 * var6.getAmount()) { + var6 = (AttributeModifier)var5.next(); + } + + for (var5 = this.getModifiersByOperation(2).iterator(); var5.hasNext(); var7 *= 1.0D + var6.getAmount()) { + var6 = (AttributeModifier)var5.next(); + } + + return this.genericAttribute.clampValue(var7); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java new file mode 100644 index 0000000..c194579 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/RangedAttribute.java @@ -0,0 +1,43 @@ +package net.minecraft.entity.ai.attributes; + +public class RangedAttribute extends BaseAttribute { + private final double minimumValue; + private final double maximumValue; + private String description; + + + public RangedAttribute(String p_i1609_1_, double p_i1609_2_, double p_i1609_4_, double p_i1609_6_) { + super(p_i1609_1_, p_i1609_2_); + this.minimumValue = p_i1609_4_; + this.maximumValue = p_i1609_6_; + + if (p_i1609_4_ > p_i1609_6_) { + throw new IllegalArgumentException("Minimum value cannot be bigger than maximum value!"); + } else if (p_i1609_2_ < p_i1609_4_) { + throw new IllegalArgumentException("Default value cannot be lower than minimum value!"); + } else if (p_i1609_2_ > p_i1609_6_) { + throw new IllegalArgumentException("Default value cannot be bigger than maximum value!"); + } + } + + public RangedAttribute setDescription(String p_111117_1_) { + this.description = p_111117_1_; + return this; + } + + public String getDescription() { + return this.description; + } + + public double clampValue(double p_111109_1_) { + if (p_111109_1_ < this.minimumValue) { + p_111109_1_ = this.minimumValue; + } + + if (p_111109_1_ > this.maximumValue) { + p_111109_1_ = this.maximumValue; + } + + return p_111109_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java new file mode 100644 index 0000000..5b379ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java @@ -0,0 +1,73 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import net.minecraft.server.management.LowerStringMap; + +public class ServersideAttributeMap extends BaseAttributeMap { + private final Set attributeInstanceSet = Sets.newHashSet(); + protected final Map descriptionToAttributeInstanceMap = new LowerStringMap(); + + + public ModifiableAttributeInstance getAttributeInstance(IAttribute p_111151_1_) { + return (ModifiableAttributeInstance)super.getAttributeInstance(p_111151_1_); + } + + public ModifiableAttributeInstance getAttributeInstanceByName(String p_111152_1_) { + IAttributeInstance var2 = super.getAttributeInstanceByName(p_111152_1_); + + if (var2 == null) { + var2 = (IAttributeInstance)this.descriptionToAttributeInstanceMap.get(p_111152_1_); + } + + return (ModifiableAttributeInstance)var2; + } + + /** + * Registers an attribute with this AttributeMap, returns a modifiable AttributeInstance associated with this map + */ + public IAttributeInstance registerAttribute(IAttribute p_111150_1_) { + if (this.attributesByName.containsKey(p_111150_1_.getAttributeUnlocalizedName())) { + throw new IllegalArgumentException("Attribute is already registered!"); + } else { + ModifiableAttributeInstance var2 = new ModifiableAttributeInstance(this, p_111150_1_); + this.attributesByName.put(p_111150_1_.getAttributeUnlocalizedName(), var2); + + if (p_111150_1_ instanceof RangedAttribute && ((RangedAttribute)p_111150_1_).getDescription() != null) { + this.descriptionToAttributeInstanceMap.put(((RangedAttribute)p_111150_1_).getDescription(), var2); + } + + this.attributes.put(p_111150_1_, var2); + return var2; + } + } + + public void addAttributeInstance(ModifiableAttributeInstance p_111149_1_) { + if (p_111149_1_.getAttribute().getShouldWatch()) { + this.attributeInstanceSet.add(p_111149_1_); + } + } + + public Set getAttributeInstanceSet() { + return this.attributeInstanceSet; + } + + public Collection getWatchedAttributes() { + HashSet var1 = Sets.newHashSet(); + Iterator var2 = this.getAllAttributes().iterator(); + + while (var2.hasNext()) { + IAttributeInstance var3 = (IAttributeInstance)var2.next(); + + if (var3.getAttribute().getShouldWatch()) { + var1.add(var3); + } + } + + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/BossStatus.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/BossStatus.java new file mode 100644 index 0000000..064fd65 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/BossStatus.java @@ -0,0 +1,16 @@ +package net.minecraft.entity.boss; + +public final class BossStatus { + public static float healthScale; + public static int statusBarTime; + public static String bossName; + public static boolean hasColorModifier; + + + public static void setBossStatus(IBossDisplayData p_82824_0_, boolean p_82824_1_) { + healthScale = p_82824_0_.getHealth() / p_82824_0_.getMaxHealth(); + statusBarTime = 100; + bossName = p_82824_0_.func_145748_c_().getFormattedText(); + hasColorModifier = p_82824_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityDragon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityDragon.java new file mode 100644 index 0000000..48a2e35 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityDragon.java @@ -0,0 +1,655 @@ +package net.minecraft.entity.boss; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEndPortal; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityDragon extends EntityLiving implements IBossDisplayData, IEntityMultiPart, IMob { + public double targetX; + public double targetY; + public double targetZ; + + /** + * Ring buffer array for the last 64 Y-positions and yaw rotations. Used to calculate offsets for the animations. + */ + public double[][] ringBuffer = new double[64][3]; + + /** + * Index into the ring buffer. Incremented once per tick and restarts at 0 once it reaches the end of the buffer. + */ + public int ringBufferIndex = -1; + + /** An array containing all body parts of this dragon */ + public EntityDragonPart[] dragonPartArray; + + /** The head bounding box of a dragon */ + public EntityDragonPart dragonPartHead; + + /** The body bounding box of a dragon */ + public EntityDragonPart dragonPartBody; + public EntityDragonPart dragonPartTail1; + public EntityDragonPart dragonPartTail2; + public EntityDragonPart dragonPartTail3; + public EntityDragonPart dragonPartWing1; + public EntityDragonPart dragonPartWing2; + + /** Animation time at previous tick. */ + public float prevAnimTime; + + /** + * Animation time, used to control the speed of the animation cycles (wings flapping, jaw opening, etc.) + */ + public float animTime; + + /** Force selecting a new flight target at next tick if set to true. */ + public boolean forceNewTarget; + + /** + * Activated if the dragon is flying though obsidian, white stone or bedrock. Slows movement and animation speed. + */ + public boolean slowed; + private Entity target; + public int deathTicks; + + /** The current endercrystal that is healing this dragon */ + public EntityEnderCrystal healingEnderCrystal; + + + public EntityDragon(World p_i1700_1_) { + super(p_i1700_1_); + this.dragonPartArray = new EntityDragonPart[] {this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)}; + this.setHealth(this.getMaxHealth()); + this.setSize(16.0F, 8.0F); + this.noClip = true; + this.isImmuneToFire = true; + this.targetY = 100.0D; + this.ignoreFrustumCheck = true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); + } + + protected void entityInit() { + super.entityInit(); + } + + /** + * Returns a double[3] array with movement offsets, used to calculate trailing tail/neck positions. [0] = yaw + * offset, [1] = y offset, [2] = unused, always 0. Parameters: buffer index offset, partial ticks. + */ + public double[] getMovementOffsets(int p_70974_1_, float p_70974_2_) { + if (this.getHealth() <= 0.0F) { + p_70974_2_ = 0.0F; + } + + p_70974_2_ = 1.0F - p_70974_2_; + int var3 = this.ringBufferIndex - p_70974_1_ * 1 & 63; + int var4 = this.ringBufferIndex - p_70974_1_ * 1 - 1 & 63; + double[] var5 = new double[3]; + double var6 = this.ringBuffer[var3][0]; + double var8 = MathHelper.wrapAngleTo180_double(this.ringBuffer[var4][0] - var6); + var5[0] = var6 + var8 * (double)p_70974_2_; + var6 = this.ringBuffer[var3][1]; + var8 = this.ringBuffer[var4][1] - var6; + var5[1] = var6 + var8 * (double)p_70974_2_; + var5[2] = this.ringBuffer[var3][2] + (this.ringBuffer[var4][2] - this.ringBuffer[var3][2]) * (double)p_70974_2_; + return var5; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + float var1; + float var2; + + if (this.worldObj.isClient) { + var1 = MathHelper.cos(this.animTime * (float)Math.PI * 2.0F); + var2 = MathHelper.cos(this.prevAnimTime * (float)Math.PI * 2.0F); + + if (var2 <= -0.3F && var1 >= -0.3F) { + this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false); + } + } + + this.prevAnimTime = this.animTime; + float var3; + + if (this.getHealth() <= 0.0F) { + var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; + var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; + var3 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle("largeexplode", this.posX + (double)var1, this.posY + 2.0D + (double)var2, this.posZ + (double)var3, 0.0D, 0.0D, 0.0D); + } else { + this.updateDragonEnderCrystal(); + var1 = 0.2F / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F); + var1 *= (float)Math.pow(2.0D, this.motionY); + + if (this.slowed) { + this.animTime += var1 * 0.5F; + } else { + this.animTime += var1; + } + + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + + if (this.ringBufferIndex < 0) { + for (int var25 = 0; var25 < this.ringBuffer.length; ++var25) { + this.ringBuffer[var25][0] = this.rotationYaw; + this.ringBuffer[var25][1] = this.posY; + } + } + + if (++this.ringBufferIndex == this.ringBuffer.length) { + this.ringBufferIndex = 0; + } + + this.ringBuffer[this.ringBufferIndex][0] = this.rotationYaw; + this.ringBuffer[this.ringBufferIndex][1] = this.posY; + double var4; + double var6; + double var8; + double var26; + float var31; + + if (this.worldObj.isClient) { + if (this.newPosRotationIncrements > 0) { + var26 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + var4 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + var6 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; + var8 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + var8 / (double)this.newPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(var26, var4, var6); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } else { + var26 = this.targetX - this.posX; + var4 = this.targetY - this.posY; + var6 = this.targetZ - this.posZ; + var8 = var26 * var26 + var4 * var4 + var6 * var6; + + if (this.target != null) { + this.targetX = this.target.posX; + this.targetZ = this.target.posZ; + double var10 = this.targetX - this.posX; + double var12 = this.targetZ - this.posZ; + double var14 = Math.sqrt(var10 * var10 + var12 * var12); + double var16 = 0.4000000059604645D + var14 / 80.0D - 1.0D; + + if (var16 > 10.0D) { + var16 = 10.0D; + } + + this.targetY = this.target.boundingBox.minY + var16; + } else { + this.targetX += this.rand.nextGaussian() * 2.0D; + this.targetZ += this.rand.nextGaussian() * 2.0D; + } + + if (this.forceNewTarget || var8 < 100.0D || var8 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) { + this.setNewTarget(); + } + + var4 /= MathHelper.sqrt_double(var26 * var26 + var6 * var6); + var31 = 0.6F; + + if (var4 < (double)(-var31)) { + var4 = -var31; + } + + if (var4 > (double)var31) { + var4 = var31; + } + + this.motionY += var4 * 0.10000000149011612D; + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + double var11 = 180.0D - Math.atan2(var26, var6) * 180.0D / Math.PI; + double var13 = MathHelper.wrapAngleTo180_double(var11 - (double)this.rotationYaw); + + if (var13 > 50.0D) { + var13 = 50.0D; + } + + if (var13 < -50.0D) { + var13 = -50.0D; + } + + Vec3 var15 = Vec3.createVectorHelper(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ).normalize(); + Vec3 var39 = Vec3.createVectorHelper(MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F), this.motionY, -MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F)).normalize(); + float var17 = (float)(var39.dotProduct(var15) + 0.5D) / 1.5F; + + if (var17 < 0.0F) { + var17 = 0.0F; + } + + this.randomYawVelocity *= 0.8F; + float var18 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F; + double var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D; + + if (var19 > 40.0D) { + var19 = 40.0D; + } + + this.randomYawVelocity = (float)((double)this.randomYawVelocity + var13 * (0.699999988079071D / var19 / (double)var18)); + this.rotationYaw += this.randomYawVelocity * 0.1F; + float var21 = (float)(2.0D / (var19 + 1.0D)); + float var22 = 0.06F; + this.moveFlying(0.0F, -1.0F, var22 * (var17 * var21 + (1.0F - var21))); + + if (this.slowed) { + this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D); + } else { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + Vec3 var23 = Vec3.createVectorHelper(this.motionX, this.motionY, this.motionZ).normalize(); + float var24 = (float)(var23.dotProduct(var39) + 1.0D) / 2.0F; + var24 = 0.8F + 0.15F * var24; + this.motionX *= var24; + this.motionZ *= var24; + this.motionY *= 0.9100000262260437D; + } + + this.renderYawOffset = this.rotationYaw; + this.dragonPartHead.width = this.dragonPartHead.height = 3.0F; + this.dragonPartTail1.width = this.dragonPartTail1.height = 2.0F; + this.dragonPartTail2.width = this.dragonPartTail2.height = 2.0F; + this.dragonPartTail3.width = this.dragonPartTail3.height = 2.0F; + this.dragonPartBody.height = 3.0F; + this.dragonPartBody.width = 5.0F; + this.dragonPartWing1.height = 2.0F; + this.dragonPartWing1.width = 4.0F; + this.dragonPartWing2.height = 3.0F; + this.dragonPartWing2.width = 4.0F; + var2 = (float)(this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F / 180.0F * (float)Math.PI; + var3 = MathHelper.cos(var2); + float var27 = -MathHelper.sin(var2); + float var5 = this.rotationYaw * (float)Math.PI / 180.0F; + float var28 = MathHelper.sin(var5); + float var7 = MathHelper.cos(var5); + this.dragonPartBody.onUpdate(); + this.dragonPartBody.setLocationAndAngles(this.posX + (double)(var28 * 0.5F), this.posY, this.posZ - (double)(var7 * 0.5F), 0.0F, 0.0F); + this.dragonPartWing1.onUpdate(); + this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(var7 * 4.5F), this.posY + 2.0D, this.posZ + (double)(var28 * 4.5F), 0.0F, 0.0F); + this.dragonPartWing2.onUpdate(); + this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(var7 * 4.5F), this.posY + 2.0D, this.posZ - (double)(var28 * 4.5F), 0.0F, 0.0F); + + if (!this.worldObj.isClient && this.hurtTime == 0) { + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.boundingBox.expand(1.0D, 1.0D, 1.0D))); + } + + double[] var29 = this.getMovementOffsets(5, 1.0F); + double[] var9 = this.getMovementOffsets(0, 1.0F); + var31 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F); + float var33 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F); + this.dragonPartHead.onUpdate(); + this.dragonPartHead.setLocationAndAngles(this.posX + (double)(var31 * 5.5F * var3), this.posY + (var9[1] - var29[1]) * 1.0D + (double)(var27 * 5.5F), this.posZ - (double)(var33 * 5.5F * var3), 0.0F, 0.0F); + + for (int var30 = 0; var30 < 3; ++var30) { + EntityDragonPart var32 = null; + + if (var30 == 0) { + var32 = this.dragonPartTail1; + } + + if (var30 == 1) { + var32 = this.dragonPartTail2; + } + + if (var30 == 2) { + var32 = this.dragonPartTail3; + } + + double[] var34 = this.getMovementOffsets(12 + var30 * 2, 1.0F); + float var35 = this.rotationYaw * (float)Math.PI / 180.0F + this.simplifyAngle(var34[0] - var29[0]) * (float)Math.PI / 180.0F * 1.0F; + float var36 = MathHelper.sin(var35); + float var37 = MathHelper.cos(var35); + float var38 = 1.5F; + float var40 = (float)(var30 + 1) * 2.0F; + var32.onUpdate(); + var32.setLocationAndAngles(this.posX - (double)((var28 * var38 + var36 * var40) * var3), this.posY + (var34[1] - var29[1]) * 1.0D - (double)((var40 + var38) * var27) + 1.5D, this.posZ + (double)((var7 * var38 + var37 * var40) * var3), 0.0F, 0.0F); + } + + if (!this.worldObj.isClient) { + this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.boundingBox) | this.destroyBlocksInAABB(this.dragonPartBody.boundingBox); + } + } + } + + /** + * Updates the state of the enderdragon's current endercrystal. + */ + private void updateDragonEnderCrystal() { + if (this.healingEnderCrystal != null) { + if (this.healingEnderCrystal.isDead) { + if (!this.worldObj.isClient) { + this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource(null), 10.0F); + } + + this.healingEnderCrystal = null; + } else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { + this.setHealth(this.getHealth() + 1.0F); + } + } + + if (this.rand.nextInt(10) == 0) { + float var1 = 32.0F; + List var2 = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, this.boundingBox.expand(var1, var1, var1)); + EntityEnderCrystal var3 = null; + double var4 = Double.MAX_VALUE; + Iterator var6 = var2.iterator(); + + while (var6.hasNext()) { + EntityEnderCrystal var7 = (EntityEnderCrystal)var6.next(); + double var8 = var7.getDistanceSqToEntity(this); + + if (var8 < var4) { + var4 = var8; + var3 = var7; + } + } + + this.healingEnderCrystal = var3; + } + } + + /** + * Pushes all entities inside the list away from the enderdragon. + */ + private void collideWithEntities(List p_70970_1_) { + double var2 = (this.dragonPartBody.boundingBox.minX + this.dragonPartBody.boundingBox.maxX) / 2.0D; + double var4 = (this.dragonPartBody.boundingBox.minZ + this.dragonPartBody.boundingBox.maxZ) / 2.0D; + Iterator var6 = p_70970_1_.iterator(); + + while (var6.hasNext()) { + Entity var7 = (Entity)var6.next(); + + if (var7 instanceof EntityLivingBase) { + double var8 = var7.posX - var2; + double var10 = var7.posZ - var4; + double var12 = var8 * var8 + var10 * var10; + var7.addVelocity(var8 / var12 * 4.0D, 0.20000000298023224D, var10 / var12 * 4.0D); + } + } + } + + /** + * Attacks all entities inside this list, dealing 5 hearts of damage. + */ + private void attackEntitiesInList(List p_70971_1_) { + for (int var2 = 0; var2 < p_70971_1_.size(); ++var2) { + Entity var3 = (Entity)p_70971_1_.get(var2); + + if (var3 instanceof EntityLivingBase) { + var3.attackEntityFrom(DamageSource.causeMobDamage(this), 10.0F); + } + } + } + + /** + * Sets a new target for the flight AI. It can be a random coordinate or a nearby player. + */ + private void setNewTarget() { + this.forceNewTarget = false; + + if (this.rand.nextInt(2) == 0 && !this.worldObj.playerEntities.isEmpty()) { + this.target = this.worldObj.playerEntities.get(this.rand.nextInt(this.worldObj.playerEntities.size())); + } else { + boolean var1 = false; + + do { + this.targetX = 0.0D; + this.targetY = 70.0F + this.rand.nextFloat() * 50.0F; + this.targetZ = 0.0D; + this.targetX += this.rand.nextFloat() * 120.0F - 60.0F; + this.targetZ += this.rand.nextFloat() * 120.0F - 60.0F; + double var2 = this.posX - this.targetX; + double var4 = this.posY - this.targetY; + double var6 = this.posZ - this.targetZ; + var1 = var2 * var2 + var4 * var4 + var6 * var6 > 100.0D; + } + while (!var1); + + this.target = null; + } + } + + /** + * Simplifies the value of a number by adding/subtracting 180 to the point that the number is between -180 and 180. + */ + private float simplifyAngle(double p_70973_1_) { + return (float)MathHelper.wrapAngleTo180_double(p_70973_1_); + } + + /** + * Destroys all blocks that aren't associated with 'The End' inside the given bounding box. + */ + private boolean destroyBlocksInAABB(AxisAlignedBB p_70972_1_) { + int var2 = MathHelper.floor_double(p_70972_1_.minX); + int var3 = MathHelper.floor_double(p_70972_1_.minY); + int var4 = MathHelper.floor_double(p_70972_1_.minZ); + int var5 = MathHelper.floor_double(p_70972_1_.maxX); + int var6 = MathHelper.floor_double(p_70972_1_.maxY); + int var7 = MathHelper.floor_double(p_70972_1_.maxZ); + boolean var8 = false; + boolean var9 = false; + + for (int var10 = var2; var10 <= var5; ++var10) { + for (int var11 = var3; var11 <= var6; ++var11) { + for (int var12 = var4; var12 <= var7; ++var12) { + Block var13 = this.worldObj.getBlock(var10, var11, var12); + + if (var13.getMaterial() != Material.air) { + if (var13 != Blocks.obsidian && var13 != Blocks.end_stone && var13 != Blocks.bedrock && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + var9 = this.worldObj.setBlockToAir(var10, var11, var12) || var9; + } else { + var8 = true; + } + } + } + } + } + + if (var9) { + double var16 = p_70972_1_.minX + (p_70972_1_.maxX - p_70972_1_.minX) * (double)this.rand.nextFloat(); + double var17 = p_70972_1_.minY + (p_70972_1_.maxY - p_70972_1_.minY) * (double)this.rand.nextFloat(); + double var14 = p_70972_1_.minZ + (p_70972_1_.maxZ - p_70972_1_.minZ) * (double)this.rand.nextFloat(); + this.worldObj.spawnParticle("largeexplode", var16, var17, var14, 0.0D, 0.0D, 0.0D); + } + + return var8; + } + + public boolean attackEntityFromPart(EntityDragonPart p_70965_1_, DamageSource p_70965_2_, float p_70965_3_) { + if (p_70965_1_ != this.dragonPartHead) { + p_70965_3_ = p_70965_3_ / 4.0F + 1.0F; + } + + float var4 = this.rotationYaw * (float)Math.PI / 180.0F; + float var5 = MathHelper.sin(var4); + float var6 = MathHelper.cos(var4); + this.targetX = this.posX + (double)(var5 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); + this.targetY = this.posY + (double)(this.rand.nextFloat() * 3.0F) + 1.0D; + this.targetZ = this.posZ - (double)(var6 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); + this.target = null; + + if (p_70965_2_.getEntity() instanceof EntityPlayer || p_70965_2_.isExplosion()) { + this.func_82195_e(p_70965_2_, p_70965_3_); + } + + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + return false; + } + + protected boolean func_82195_e(DamageSource p_82195_1_, float p_82195_2_) { + return super.attackEntityFrom(p_82195_1_, p_82195_2_); + } + + /** + * handles entity death timer, experience orb and particle creation + */ + protected void onDeathUpdate() { + ++this.deathTicks; + + if (this.deathTicks >= 180 && this.deathTicks <= 200) { + float var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; + float var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; + float var3 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle("hugeexplosion", this.posX + (double)var1, this.posY + 2.0D + (double)var2, this.posZ + (double)var3, 0.0D, 0.0D, 0.0D); + } + + int var4; + int var5; + + if (!this.worldObj.isClient) { + if (this.deathTicks > 150 && this.deathTicks % 5 == 0) { + var4 = 1000; + + while (var4 > 0) { + var5 = EntityXPOrb.getXPSplit(var4); + var4 -= var5; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); + } + } + + if (this.deathTicks == 1) { + this.worldObj.playBroadcastSound(1018, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + + this.moveEntity(0.0D, 0.10000000149011612D, 0.0D); + this.renderYawOffset = this.rotationYaw += 20.0F; + + if (this.deathTicks == 200 && !this.worldObj.isClient) { + var4 = 2000; + + while (var4 > 0) { + var5 = EntityXPOrb.getXPSplit(var4); + var4 -= var5; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); + } + + this.createEnderPortal(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + this.setDead(); + } + } + + /** + * Creates the ender portal leading back to the normal world after defeating the enderdragon. + */ + private void createEnderPortal(int p_70975_1_, int p_70975_2_) { + byte var3 = 64; + BlockEndPortal.field_149948_a = true; + byte var4 = 4; + + for (int var5 = var3 - 1; var5 <= var3 + 32; ++var5) { + for (int var6 = p_70975_1_ - var4; var6 <= p_70975_1_ + var4; ++var6) { + for (int var7 = p_70975_2_ - var4; var7 <= p_70975_2_ + var4; ++var7) { + double var8 = var6 - p_70975_1_; + double var10 = var7 - p_70975_2_; + double var12 = var8 * var8 + var10 * var10; + + if (var12 <= ((double)var4 - 0.5D) * ((double)var4 - 0.5D)) { + if (var5 < var3) { + if (var12 <= ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { + this.worldObj.setBlock(var6, var5, var7, Blocks.bedrock); + } + } else if (var5 > var3) { + this.worldObj.setBlock(var6, var5, var7, Blocks.air); + } else if (var12 > ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { + this.worldObj.setBlock(var6, var5, var7, Blocks.bedrock); + } else { + this.worldObj.setBlock(var6, var5, var7, Blocks.end_portal); + } + } + } + } + } + + this.worldObj.setBlock(p_70975_1_, var3 + 0, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_, var3 + 1, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_, var3 + 2, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_ - 1, var3 + 2, p_70975_2_, Blocks.torch); + this.worldObj.setBlock(p_70975_1_ + 1, var3 + 2, p_70975_2_, Blocks.torch); + this.worldObj.setBlock(p_70975_1_, var3 + 2, p_70975_2_ - 1, Blocks.torch); + this.worldObj.setBlock(p_70975_1_, var3 + 2, p_70975_2_ + 1, Blocks.torch); + this.worldObj.setBlock(p_70975_1_, var3 + 3, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_, var3 + 4, p_70975_2_, Blocks.dragon_egg); + BlockEndPortal.field_149948_a = false; + } + + /** + * Makes the entity despawn if requirements are reached + */ + public void despawnEntity() {} + + /** + * Return the Entity parts making up this Entity (currently only for dragons) + */ + public Entity[] getParts() { + return this.dragonPartArray; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + public World func_82194_d() { + return this.worldObj; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.enderdragon.growl"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.enderdragon.hit"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 5.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java new file mode 100644 index 0000000..d036be0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityDragonPart.java @@ -0,0 +1,53 @@ +package net.minecraft.entity.boss; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; + +public class EntityDragonPart extends Entity { + /** The dragon entity this dragon part belongs to */ + public final IEntityMultiPart entityDragonObj; + public final String field_146032_b; + + + public EntityDragonPart(IEntityMultiPart p_i1697_1_, String p_i1697_2_, float p_i1697_3_, float p_i1697_4_) { + super(p_i1697_1_.func_82194_d()); + this.setSize(p_i1697_3_, p_i1697_4_); + this.entityDragonObj = p_i1697_1_; + this.field_146032_b = p_i1697_2_; + } + + protected void entityInit() {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {} + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {} + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + return !this.isEntityInvulnerable() && this.entityDragonObj.attackEntityFromPart(this, p_70097_1_, p_70097_2_); + } + + /** + * Returns true if Entity argument is equal to this Entity + */ + public boolean isEntityEqual(Entity p_70028_1_) { + return this == p_70028_1_ || this.entityDragonObj == p_70028_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityWither.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityWither.java new file mode 100644 index 0000000..e109714 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/EntityWither.java @@ -0,0 +1,553 @@ +package net.minecraft.entity.boss; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityWither extends EntityMob implements IBossDisplayData, IRangedAttackMob { + private final float[] field_82220_d = new float[2]; + private final float[] field_82221_e = new float[2]; + private final float[] field_82217_f = new float[2]; + private final float[] field_82218_g = new float[2]; + private final int[] field_82223_h = new int[2]; + private final int[] field_82224_i = new int[2]; + private int field_82222_j; + + /** Selector used to determine the entities a wither boss should attack. */ + private static final IEntitySelector attackEntitySelector = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_ instanceof EntityLivingBase && ((EntityLivingBase)p_82704_1_).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; + } + }; + + + public EntityWither(World p_i1701_1_) { + super(p_i1701_1_); + this.setHealth(this.getMaxHealth()); + this.setSize(0.9F, 4.0F); + this.isImmuneToFire = true; + this.getNavigator().setCanSwim(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 40, 20.0F)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, attackEntitySelector)); + this.experienceValue = 50; + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(0)); + this.dataWatcher.addObject(19, new Integer(0)); + this.dataWatcher.addObject(20, new Integer(0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("Invul", this.func_82212_n()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.func_82215_s(p_70037_1_.getInteger("Invul")); + } + + public float getShadowSize() { + return this.height / 8.0F; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.wither.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.wither.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.wither.death"; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + this.motionY *= 0.6000000238418579D; + double var4; + double var6; + double var8; + + if (!this.worldObj.isClient && this.getWatchedTargetId(0) > 0) { + Entity var1 = this.worldObj.getEntityByID(this.getWatchedTargetId(0)); + + if (var1 != null) { + if (this.posY < var1.posY || !this.isArmored() && this.posY < var1.posY + 5.0D) { + if (this.motionY < 0.0D) { + this.motionY = 0.0D; + } + + this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; + } + + double var2 = var1.posX - this.posX; + var4 = var1.posZ - this.posZ; + var6 = var2 * var2 + var4 * var4; + + if (var6 > 9.0D) { + var8 = MathHelper.sqrt_double(var6); + this.motionX += (var2 / var8 * 0.5D - this.motionX) * 0.6000000238418579D; + this.motionZ += (var4 / var8 * 0.5D - this.motionZ) * 0.6000000238418579D; + } + } + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) { + this.rotationYaw = (float)Math.atan2(this.motionZ, this.motionX) * (180F / (float)Math.PI) - 90.0F; + } + + super.onLivingUpdate(); + int var20; + + for (var20 = 0; var20 < 2; ++var20) { + this.field_82218_g[var20] = this.field_82221_e[var20]; + this.field_82217_f[var20] = this.field_82220_d[var20]; + } + + int var22; + + for (var20 = 0; var20 < 2; ++var20) { + var22 = this.getWatchedTargetId(var20 + 1); + Entity var3 = null; + + if (var22 > 0) { + var3 = this.worldObj.getEntityByID(var22); + } + + if (var3 != null) { + var4 = this.func_82214_u(var20 + 1); + var6 = this.func_82208_v(var20 + 1); + var8 = this.func_82213_w(var20 + 1); + double var10 = var3.posX - var4; + double var12 = var3.posY + (double)var3.getEyeHeight() - var6; + double var14 = var3.posZ - var8; + double var16 = MathHelper.sqrt_double(var10 * var10 + var14 * var14); + float var18 = (float)(Math.atan2(var14, var10) * 180.0D / Math.PI) - 90.0F; + float var19 = (float)(-(Math.atan2(var12, var16) * 180.0D / Math.PI)); + this.field_82220_d[var20] = this.func_82204_b(this.field_82220_d[var20], var19, 40.0F); + this.field_82221_e[var20] = this.func_82204_b(this.field_82221_e[var20], var18, 10.0F); + } else { + this.field_82221_e[var20] = this.func_82204_b(this.field_82221_e[var20], this.renderYawOffset, 10.0F); + } + } + + boolean var21 = this.isArmored(); + + for (var22 = 0; var22 < 3; ++var22) { + double var23 = this.func_82214_u(var22); + double var5 = this.func_82208_v(var22); + double var7 = this.func_82213_w(var22); + this.worldObj.spawnParticle("smoke", var23 + this.rand.nextGaussian() * 0.30000001192092896D, var5 + this.rand.nextGaussian() * 0.30000001192092896D, var7 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); + + if (var21 && this.worldObj.rand.nextInt(4) == 0) { + this.worldObj.spawnParticle("mobSpell", var23 + this.rand.nextGaussian() * 0.30000001192092896D, var5 + this.rand.nextGaussian() * 0.30000001192092896D, var7 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D); + } + } + + if (this.func_82212_n() > 0) { + for (var22 = 0; var22 < 3; ++var22) { + this.worldObj.spawnParticle("mobSpell", this.posX + this.rand.nextGaussian() * 1.0D, this.posY + (double)(this.rand.nextFloat() * 3.3F), this.posZ + this.rand.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); + } + } + } + + protected void updateAITasks() { + int var1; + + if (this.func_82212_n() > 0) { + var1 = this.func_82212_n() - 1; + + if (var1 <= 0) { + this.worldObj.newExplosion(this, this.posX, this.posY + (double)this.getEyeHeight(), this.posZ, 7.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.worldObj.playBroadcastSound(1013, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + this.func_82215_s(var1); + + if (this.ticksExisted % 10 == 0) { + this.heal(10.0F); + } + } else { + super.updateAITasks(); + int var12; + + for (var1 = 1; var1 < 3; ++var1) { + if (this.ticksExisted >= this.field_82223_h[var1 - 1]) { + this.field_82223_h[var1 - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); + + if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL || this.worldObj.difficultySetting == EnumDifficulty.HARD) { + int var10001 = var1 - 1; + int var10003 = this.field_82224_i[var1 - 1]; + this.field_82224_i[var10001] = this.field_82224_i[var1 - 1] + 1; + + if (var10003 > 15) { + float var2 = 10.0F; + float var3 = 5.0F; + double var4 = MathHelper.getRandomDoubleInRange(this.rand, this.posX - (double)var2, this.posX + (double)var2); + double var6 = MathHelper.getRandomDoubleInRange(this.rand, this.posY - (double)var3, this.posY + (double)var3); + double var8 = MathHelper.getRandomDoubleInRange(this.rand, this.posZ - (double)var2, this.posZ + (double)var2); + this.func_82209_a(var1 + 1, var4, var6, var8, true); + this.field_82224_i[var1 - 1] = 0; + } + } + + var12 = this.getWatchedTargetId(var1); + + if (var12 > 0) { + Entity var14 = this.worldObj.getEntityByID(var12); + + if (var14 != null && var14.isEntityAlive() && this.getDistanceSqToEntity(var14) <= 900.0D && this.canEntityBeSeen(var14)) { + this.func_82216_a(var1 + 1, (EntityLivingBase)var14); + this.field_82223_h[var1 - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); + this.field_82224_i[var1 - 1] = 0; + } else { + this.func_82211_c(var1, 0); + } + } else { + List var13 = this.worldObj.selectEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(20.0D, 8.0D, 20.0D), attackEntitySelector); + + for (int var16 = 0; var16 < 10 && !var13.isEmpty(); ++var16) { + EntityLivingBase var5 = (EntityLivingBase)var13.get(this.rand.nextInt(var13.size())); + + if (var5 != this && var5.isEntityAlive() && this.canEntityBeSeen(var5)) { + if (var5 instanceof EntityPlayer) { + if (!((EntityPlayer)var5).capabilities.disableDamage) { + this.func_82211_c(var1, var5.getEntityId()); + } + } else { + this.func_82211_c(var1, var5.getEntityId()); + } + + break; + } + + var13.remove(var5); + } + } + } + } + + if (this.getAttackTarget() != null) { + this.func_82211_c(0, this.getAttackTarget().getEntityId()); + } else { + this.func_82211_c(0, 0); + } + + if (this.field_82222_j > 0) { + --this.field_82222_j; + + if (this.field_82222_j == 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + var1 = MathHelper.floor_double(this.posY); + var12 = MathHelper.floor_double(this.posX); + int var15 = MathHelper.floor_double(this.posZ); + boolean var17 = false; + + for (int var18 = -1; var18 <= 1; ++var18) { + for (int var19 = -1; var19 <= 1; ++var19) { + for (int var7 = 0; var7 <= 3; ++var7) { + int var20 = var12 + var18; + int var9 = var1 + var7; + int var10 = var15 + var19; + Block var11 = this.worldObj.getBlock(var20, var9, var10); + + if (var11.getMaterial() != Material.air && var11 != Blocks.bedrock && var11 != Blocks.end_portal && var11 != Blocks.end_portal_frame && var11 != Blocks.command_block) { + var17 = this.worldObj.func_147480_a(var20, var9, var10, true) || var17; + } + } + } + } + + if (var17) { + this.worldObj.playAuxSFXAtEntity(null, 1012, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + } + + if (this.ticksExisted % 20 == 0) { + this.heal(1.0F); + } + } + } + + public void func_82206_m() { + this.func_82215_s(220); + this.setHealth(this.getMaxHealth() / 3.0F); + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() {} + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return 4; + } + + private double func_82214_u(int p_82214_1_) { + if (p_82214_1_ <= 0) { + return this.posX; + } else { + float var2 = (this.renderYawOffset + (float)(180 * (p_82214_1_ - 1))) / 180.0F * (float)Math.PI; + float var3 = MathHelper.cos(var2); + return this.posX + (double)var3 * 1.3D; + } + } + + private double func_82208_v(int p_82208_1_) { + return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D; + } + + private double func_82213_w(int p_82213_1_) { + if (p_82213_1_ <= 0) { + return this.posZ; + } else { + float var2 = (this.renderYawOffset + (float)(180 * (p_82213_1_ - 1))) / 180.0F * (float)Math.PI; + float var3 = MathHelper.sin(var2); + return this.posZ + (double)var3 * 1.3D; + } + } + + private float func_82204_b(float p_82204_1_, float p_82204_2_, float p_82204_3_) { + float var4 = MathHelper.wrapAngleTo180_float(p_82204_2_ - p_82204_1_); + + if (var4 > p_82204_3_) { + var4 = p_82204_3_; + } + + if (var4 < -p_82204_3_) { + var4 = -p_82204_3_; + } + + return p_82204_1_ + var4; + } + + private void func_82216_a(int p_82216_1_, EntityLivingBase p_82216_2_) { + this.func_82209_a(p_82216_1_, p_82216_2_.posX, p_82216_2_.posY + (double)p_82216_2_.getEyeHeight() * 0.5D, p_82216_2_.posZ, p_82216_1_ == 0 && this.rand.nextFloat() < 0.001F); + } + + private void func_82209_a(int p_82209_1_, double p_82209_2_, double p_82209_4_, double p_82209_6_, boolean p_82209_8_) { + this.worldObj.playAuxSFXAtEntity(null, 1014, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + double var9 = this.func_82214_u(p_82209_1_); + double var11 = this.func_82208_v(p_82209_1_); + double var13 = this.func_82213_w(p_82209_1_); + double var15 = p_82209_2_ - var9; + double var17 = p_82209_4_ - var11; + double var19 = p_82209_6_ - var13; + EntityWitherSkull var21 = new EntityWitherSkull(this.worldObj, this, var15, var17, var19); + + if (p_82209_8_) { + var21.setInvulnerable(true); + } + + var21.posY = var11; + var21.posX = var9; + var21.posZ = var13; + this.worldObj.spawnEntityInWorld(var21); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + this.func_82216_a(0, p_82196_1_); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if (p_70097_1_ == DamageSource.drown) { + return false; + } else if (this.func_82212_n() > 0) { + return false; + } else { + Entity var3; + + if (this.isArmored()) { + var3 = p_70097_1_.getSourceOfDamage(); + + if (var3 instanceof EntityArrow) { + return false; + } + } + + var3 = p_70097_1_.getEntity(); + + if (var3 != null && !(var3 instanceof EntityPlayer) && var3 instanceof EntityLivingBase && ((EntityLivingBase)var3).getCreatureAttribute() == this.getCreatureAttribute()) { + return false; + } else { + if (this.field_82222_j <= 0) { + this.field_82222_j = 20; + } + + for (int var4 = 0; var4 < this.field_82224_i.length; ++var4) { + this.field_82224_i[var4] += 3; + } + + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + this.func_145779_a(Items.nether_star, 1); + + if (!this.worldObj.isClient) { + Iterator var3 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50.0D, 100.0D, 50.0D)).iterator(); + + while (var3.hasNext()) { + EntityPlayer var4 = (EntityPlayer)var3.next(); + var4.triggerAchievement(AchievementList.field_150964_J); + } + } + } + + /** + * Makes the entity despawn if requirements are reached + */ + public void despawnEntity() { + this.entityAge = 0; + } + + public int getBrightnessForRender(float p_70070_1_) { + return 15728880; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * adds a PotionEffect to the entity + */ + public void addPotionEffect(PotionEffect p_70690_1_) {} + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(300.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + } + + public float func_82207_a(int p_82207_1_) { + return this.field_82221_e[p_82207_1_]; + } + + public float func_82210_r(int p_82210_1_) { + return this.field_82220_d[p_82210_1_]; + } + + public int func_82212_n() { + return this.dataWatcher.getWatchableObjectInt(20); + } + + public void func_82215_s(int p_82215_1_) { + this.dataWatcher.updateObject(20, Integer.valueOf(p_82215_1_)); + } + + /** + * Returns the target entity ID if present, or -1 if not @param par1 The target offset, should be from 0-2 + */ + public int getWatchedTargetId(int p_82203_1_) { + return this.dataWatcher.getWatchableObjectInt(17 + p_82203_1_); + } + + public void func_82211_c(int p_82211_1_, int p_82211_2_) { + this.dataWatcher.updateObject(17 + p_82211_1_, Integer.valueOf(p_82211_2_)); + } + + /** + * Returns whether the wither is armored with its boss armor or not by checking whether its health is below half of + * its maximum. + */ + public boolean isArmored() { + return this.getHealth() <= this.getMaxHealth() / 2.0F; + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity p_70078_1_) { + this.ridingEntity = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java new file mode 100644 index 0000000..613d114 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/boss/IBossDisplayData.java @@ -0,0 +1,11 @@ +package net.minecraft.entity.boss; + +import net.minecraft.util.IChatComponent; + +public interface IBossDisplayData { + float getMaxHealth(); + + float getHealth(); + + IChatComponent func_145748_c_(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java new file mode 100644 index 0000000..e77b5dd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java @@ -0,0 +1,117 @@ +package net.minecraft.entity.effect; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityLightningBolt extends EntityWeatherEffect { + /** + * Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. + */ + private int lightningState; + + /** + * A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt + */ + public long boltVertex; + + /** + * Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. + */ + private int boltLivingTime; + + + public EntityLightningBolt(World p_i1703_1_, double p_i1703_2_, double p_i1703_4_, double p_i1703_6_) { + super(p_i1703_1_); + this.setLocationAndAngles(p_i1703_2_, p_i1703_4_, p_i1703_6_, 0.0F, 0.0F); + this.lightningState = 2; + this.boltVertex = this.rand.nextLong(); + this.boltLivingTime = this.rand.nextInt(3) + 1; + + if (!p_i1703_1_.isClient && p_i1703_1_.getGameRules().getGameRuleBooleanValue("doFireTick") && (p_i1703_1_.difficultySetting == EnumDifficulty.NORMAL || p_i1703_1_.difficultySetting == EnumDifficulty.HARD) && p_i1703_1_.doChunksNearChunkExist(MathHelper.floor_double(p_i1703_2_), MathHelper.floor_double(p_i1703_4_), MathHelper.floor_double(p_i1703_6_), 10)) { + int var8 = MathHelper.floor_double(p_i1703_2_); + int var9 = MathHelper.floor_double(p_i1703_4_); + int var10 = MathHelper.floor_double(p_i1703_6_); + + if (p_i1703_1_.getBlock(var8, var9, var10).getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(p_i1703_1_, var8, var9, var10)) { + p_i1703_1_.setBlock(var8, var9, var10, Blocks.fire); + } + + for (var8 = 0; var8 < 4; ++var8) { + var9 = MathHelper.floor_double(p_i1703_2_) + this.rand.nextInt(3) - 1; + var10 = MathHelper.floor_double(p_i1703_4_) + this.rand.nextInt(3) - 1; + int var11 = MathHelper.floor_double(p_i1703_6_) + this.rand.nextInt(3) - 1; + + if (p_i1703_1_.getBlock(var9, var10, var11).getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(p_i1703_1_, var9, var10, var11)) { + p_i1703_1_.setBlock(var9, var10, var11, Blocks.fire); + } + } + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.lightningState == 2) { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.rand.nextFloat() * 0.2F); + } + + --this.lightningState; + + if (this.lightningState < 0) { + if (this.boltLivingTime == 0) { + this.setDead(); + } else if (this.lightningState < -this.rand.nextInt(10)) { + --this.boltLivingTime; + this.lightningState = 1; + this.boltVertex = this.rand.nextLong(); + + if (!this.worldObj.isClient && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY); + int var3 = MathHelper.floor_double(this.posZ); + + if (this.worldObj.getBlock(var1, var2, var3).getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(this.worldObj, var1, var2, var3)) { + this.worldObj.setBlock(var1, var2, var3, Blocks.fire); + } + } + } + } + + if (this.lightningState >= 0) { + if (this.worldObj.isClient) { + this.worldObj.lastLightningBolt = 2; + } else { + double var6 = 3.0D; + List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - var6, this.posY - var6, this.posZ - var6, this.posX + var6, this.posY + 6.0D + var6, this.posZ + var6)); + + for (int var4 = 0; var4 < var7.size(); ++var4) { + Entity var5 = (Entity)var7.get(var4); + var5.onStruckByLightning(this); + } + } + } + } + + protected void entityInit() {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {} + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java new file mode 100644 index 0000000..6a9ac34 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/effect/EntityWeatherEffect.java @@ -0,0 +1,12 @@ +package net.minecraft.entity.effect; + +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public abstract class EntityWeatherEffect extends Entity { + + + public EntityWeatherEffect(World p_i1702_1_) { + super(p_i1702_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityBoat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityBoat.java new file mode 100644 index 0000000..b07e132 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityBoat.java @@ -0,0 +1,517 @@ +package net.minecraft.entity.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBoat extends Entity { + /** true if no player in boat */ + private boolean isBoatEmpty; + private double speedMultiplier; + private int boatPosRotationIncrements; + private double boatX; + private double boatY; + private double boatZ; + private double boatYaw; + private double boatPitch; + private double velocityX; + private double velocityY; + private double velocityZ; + + + public EntityBoat(World p_i1704_1_) { + super(p_i1704_1_); + this.isBoatEmpty = true; + this.speedMultiplier = 0.07D; + this.preventEntitySpawning = true; + this.setSize(1.5F, 0.6F); + this.yOffset = this.height / 2.0F; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + } + + /** + * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be + * pushable on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity p_70114_1_) { + return p_70114_1_.boundingBox; + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() { + return this.boundingBox; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() { + return true; + } + + public EntityBoat(World p_i1705_1_, double p_i1705_2_, double p_i1705_4_, double p_i1705_6_) { + this(p_i1705_1_); + this.setPosition(p_i1705_2_, p_i1705_4_ + (double)this.yOffset, p_i1705_6_); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = p_i1705_2_; + this.prevPosY = p_i1705_4_; + this.prevPosZ = p_i1705_6_; + } + + /** + * Returns the Y offset from the entity's position for any entity riding this one. + */ + public double getMountedYOffset() { + return (double)this.height * 0.0D - 0.30000001192092896D; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if (!this.worldObj.isClient && !this.isDead) { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() + p_70097_2_ * 10.0F); + this.setBeenAttacked(); + boolean var3 = p_70097_1_.getEntity() instanceof EntityPlayer && ((EntityPlayer)p_70097_1_.getEntity()).capabilities.isCreativeMode; + + if (var3 || this.getDamageTaken() > 40.0F) { + if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + + if (!var3) { + this.func_145778_a(Items.boat, 1, 0.0F); + } + + this.setDead(); + } + + return true; + } else { + return true; + } + } + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + public void performHurtAnimation() { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() * 11.0F); + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + if (this.isBoatEmpty) { + this.boatPosRotationIncrements = p_70056_9_ + 5; + } else { + double var10 = p_70056_1_ - this.posX; + double var12 = p_70056_3_ - this.posY; + double var14 = p_70056_5_ - this.posZ; + double var16 = var10 * var10 + var12 * var12 + var14 * var14; + + if (var16 <= 1.0D) { + return; + } + + this.boatPosRotationIncrements = 3; + } + + this.boatX = p_70056_1_; + this.boatY = p_70056_3_; + this.boatZ = p_70056_5_; + this.boatYaw = p_70056_7_; + this.boatPitch = p_70056_8_; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.velocityX = this.motionX = p_70016_1_; + this.velocityY = this.motionY = p_70016_3_; + this.velocityZ = this.motionZ = p_70016_5_; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.getTimeSinceHit() > 0) { + this.setTimeSinceHit(this.getTimeSinceHit() - 1); + } + + if (this.getDamageTaken() > 0.0F) { + this.setDamageTaken(this.getDamageTaken() - 1.0F); + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + byte var1 = 5; + double var2 = 0.0D; + + for (int var4 = 0; var4 < var1; ++var4) { + double var5 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 0) / (double)var1 - 0.125D; + double var7 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 1) / (double)var1 - 0.125D; + AxisAlignedBB var9 = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, var5, this.boundingBox.minZ, this.boundingBox.maxX, var7, this.boundingBox.maxZ); + + if (this.worldObj.isAABBInMaterial(var9, Material.water)) { + var2 += 1.0D / (double)var1; + } + } + + double var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + double var6; + double var8; + int var10; + + if (var19 > 0.26249999999999996D) { + var6 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D); + var8 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D); + + for (var10 = 0; (double)var10 < 1.0D + var19 * 60.0D; ++var10) { + double var11 = this.rand.nextFloat() * 2.0F - 1.0F; + double var13 = (double)(this.rand.nextInt(2) * 2 - 1) * 0.7D; + double var15; + double var17; + + if (this.rand.nextBoolean()) { + var15 = this.posX - var6 * var11 * 0.8D + var8 * var13; + var17 = this.posZ - var8 * var11 * 0.8D - var6 * var13; + this.worldObj.spawnParticle("splash", var15, this.posY - 0.125D, var17, this.motionX, this.motionY, this.motionZ); + } else { + var15 = this.posX + var6 + var8 * var11 * 0.7D; + var17 = this.posZ + var8 - var6 * var11 * 0.7D; + this.worldObj.spawnParticle("splash", var15, this.posY - 0.125D, var17, this.motionX, this.motionY, this.motionZ); + } + } + } + + double var24; + double var26; + + if (this.worldObj.isClient && this.isBoatEmpty) { + if (this.boatPosRotationIncrements > 0) { + var6 = this.posX + (this.boatX - this.posX) / (double)this.boatPosRotationIncrements; + var8 = this.posY + (this.boatY - this.posY) / (double)this.boatPosRotationIncrements; + var24 = this.posZ + (this.boatZ - this.posZ) / (double)this.boatPosRotationIncrements; + var26 = MathHelper.wrapAngleTo180_double(this.boatYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + var26 / (double)this.boatPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.boatPitch - (double)this.rotationPitch) / (double)this.boatPosRotationIncrements); + --this.boatPosRotationIncrements; + this.setPosition(var6, var8, var24); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else { + var6 = this.posX + this.motionX; + var8 = this.posY + this.motionY; + var24 = this.posZ + this.motionZ; + this.setPosition(var6, var8, var24); + + if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.9900000095367432D; + } + } else { + if (var2 < 1.0D) { + var6 = var2 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * var6; + } else { + if (this.motionY < 0.0D) { + this.motionY /= 2.0D; + } + + this.motionY += 0.007000000216066837D; + } + + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { + EntityLivingBase var20 = (EntityLivingBase)this.riddenByEntity; + float var21 = this.riddenByEntity.rotationYaw + -var20.moveStrafing * 90.0F; + this.motionX += -Math.sin(var21 * (float)Math.PI / 180.0F) * this.speedMultiplier * (double)var20.moveForward * 0.05000000074505806D; + this.motionZ += Math.cos(var21 * (float)Math.PI / 180.0F) * this.speedMultiplier * (double)var20.moveForward * 0.05000000074505806D; + } + + var6 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var6 > 0.35D) { + var8 = 0.35D / var6; + this.motionX *= var8; + this.motionZ *= var8; + var6 = 0.35D; + } + + if (var6 > var19 && this.speedMultiplier < 0.35D) { + this.speedMultiplier += (0.35D - this.speedMultiplier) / 35.0D; + + if (this.speedMultiplier > 0.35D) { + this.speedMultiplier = 0.35D; + } + } else { + this.speedMultiplier -= (this.speedMultiplier - 0.07D) / 35.0D; + + if (this.speedMultiplier < 0.07D) { + this.speedMultiplier = 0.07D; + } + } + + int var22; + + for (var22 = 0; var22 < 4; ++var22) { + int var23 = MathHelper.floor_double(this.posX + ((double)(var22 % 2) - 0.5D) * 0.8D); + var10 = MathHelper.floor_double(this.posZ + ((double)(var22 / 2) - 0.5D) * 0.8D); + + for (int var25 = 0; var25 < 2; ++var25) { + int var12 = MathHelper.floor_double(this.posY) + var25; + Block var27 = this.worldObj.getBlock(var23, var12, var10); + + if (var27 == Blocks.snow_layer) { + this.worldObj.setBlockToAir(var23, var12, var10); + this.isCollidedHorizontally = false; + } else if (var27 == Blocks.waterlily) { + this.worldObj.func_147480_a(var23, var12, var10, true); + this.isCollidedHorizontally = false; + } + } + } + + if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.isCollidedHorizontally && var19 > 0.2D) { + if (!this.worldObj.isClient && !this.isDead) { + this.setDead(); + + for (var22 = 0; var22 < 3; ++var22) { + this.func_145778_a(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (var22 = 0; var22 < 2; ++var22) { + this.func_145778_a(Items.stick, 1, 0.0F); + } + } + } else { + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.9900000095367432D; + } + + this.rotationPitch = 0.0F; + var8 = this.rotationYaw; + var24 = this.prevPosX - this.posX; + var26 = this.prevPosZ - this.posZ; + + if (var24 * var24 + var26 * var26 > 0.001D) { + var8 = (float)(Math.atan2(var26, var24) * 180.0D / Math.PI); + } + + double var14 = MathHelper.wrapAngleTo180_double(var8 - (double)this.rotationYaw); + + if (var14 > 20.0D) { + var14 = 20.0D; + } + + if (var14 < -20.0D) { + var14 = -20.0D; + } + + this.rotationYaw = (float)((double)this.rotationYaw + var14); + this.setRotation(this.rotationYaw, this.rotationPitch); + + if (!this.worldObj.isClient) { + List var16 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + + if (var16 != null && !var16.isEmpty()) { + for (int var28 = 0; var28 < var16.size(); ++var28) { + Entity var18 = (Entity)var16.get(var28); + + if (var18 != this.riddenByEntity && var18.canBePushed() && var18 instanceof EntityBoat) { + var18.applyEntityCollision(this); + } + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) { + this.riddenByEntity = null; + } + } + } + } + + public void updateRiderPosition() { + if (this.riddenByEntity != null) { + double var1 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + double var3 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + this.riddenByEntity.setPosition(this.posX + var1, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + var3); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {} + + public float getShadowSize() { + return 0.0F; + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != p_130002_1_) { + return true; + } else { + if (!this.worldObj.isClient) { + p_130002_1_.mountEntity(this); + } + + return true; + } + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double p_70064_1_, boolean p_70064_3_) { + int var4 = MathHelper.floor_double(this.posX); + int var5 = MathHelper.floor_double(this.posY); + int var6 = MathHelper.floor_double(this.posZ); + + if (p_70064_3_) { + if (this.fallDistance > 3.0F) { + this.fall(this.fallDistance); + + if (!this.worldObj.isClient && !this.isDead) { + this.setDead(); + int var7; + + for (var7 = 0; var7 < 3; ++var7) { + this.func_145778_a(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (var7 = 0; var7 < 2; ++var7) { + this.func_145778_a(Items.stick, 1, 0.0F); + } + } + + this.fallDistance = 0.0F; + } + } else if (this.worldObj.getBlock(var4, var5 - 1, var6).getMaterial() != Material.water && p_70064_1_ < 0.0D) { + this.fallDistance = (float)((double)this.fallDistance - p_70064_1_); + } + } + + /** + * Sets the damage taken from the last hit. + */ + public void setDamageTaken(float p_70266_1_) { + this.dataWatcher.updateObject(19, Float.valueOf(p_70266_1_)); + } + + /** + * Gets the damage taken from the last hit. + */ + public float getDamageTaken() { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + /** + * Sets the time to count down from since the last time entity was hit. + */ + public void setTimeSinceHit(int p_70265_1_) { + this.dataWatcher.updateObject(17, Integer.valueOf(p_70265_1_)); + } + + /** + * Gets the time since the last hit. + */ + public int getTimeSinceHit() { + return this.dataWatcher.getWatchableObjectInt(17); + } + + /** + * Sets the forward direction of the entity. + */ + public void setForwardDirection(int p_70269_1_) { + this.dataWatcher.updateObject(18, Integer.valueOf(p_70269_1_)); + } + + /** + * Gets the forward direction of the entity. + */ + public int getForwardDirection() { + return this.dataWatcher.getWatchableObjectInt(18); + } + + /** + * true if no player in boat + */ + public void setIsBoatEmpty(boolean p_70270_1_) { + this.isBoatEmpty = p_70270_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java new file mode 100644 index 0000000..b8429d5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java @@ -0,0 +1,104 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderEnd; + +public class EntityEnderCrystal extends Entity { + /** Used to create the rotation animation when rendering the crystal. */ + public int innerRotation; + public int health; + + + public EntityEnderCrystal(World p_i1698_1_) { + super(p_i1698_1_); + this.preventEntitySpawning = true; + this.setSize(2.0F, 2.0F); + this.yOffset = this.height / 2.0F; + this.health = 5; + this.innerRotation = this.rand.nextInt(100000); + } + + public EntityEnderCrystal(World p_i1699_1_, double p_i1699_2_, double p_i1699_4_, double p_i1699_6_) { + this(p_i1699_1_); + this.setPosition(p_i1699_2_, p_i1699_4_, p_i1699_6_); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(8, Integer.valueOf(this.health)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.innerRotation; + this.dataWatcher.updateObject(8, Integer.valueOf(this.health)); + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY); + int var3 = MathHelper.floor_double(this.posZ); + + if (this.worldObj.provider instanceof WorldProviderEnd && this.worldObj.getBlock(var1, var2, var3) != Blocks.fire) { + this.worldObj.setBlock(var1, var2, var3, Blocks.fire); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {} + + public float getShadowSize() { + return 0.0F; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + if (!this.isDead && !this.worldObj.isClient) { + this.health = 0; + + if (this.health <= 0) { + this.setDead(); + + if (!this.worldObj.isClient) { + this.worldObj.createExplosion(null, this.posX, this.posY, this.posZ, 6.0F, true); + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderEye.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderEye.java new file mode 100644 index 0000000..259353f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderEye.java @@ -0,0 +1,197 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityEnderEye extends Entity { + /** 'x' location the eye should float towards. */ + private double targetX; + + /** 'y' location the eye should float towards. */ + private double targetY; + + /** 'z' location the eye should float towards. */ + private double targetZ; + private int despawnTimer; + private boolean shatterOrDrop; + + + public EntityEnderEye(World p_i1757_1_) { + super(p_i1757_1_); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() {} + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; + return p_70112_1_ < var3 * var3; + } + + public EntityEnderEye(World p_i1758_1_, double p_i1758_2_, double p_i1758_4_, double p_i1758_6_) { + super(p_i1758_1_); + this.despawnTimer = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_); + this.yOffset = 0.0F; + } + + /** + * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args: + * strongholdX, strongholdY, strongholdZ + */ + public void moveTowards(double p_70220_1_, int p_70220_3_, double p_70220_4_) { + double var6 = p_70220_1_ - this.posX; + double var8 = p_70220_4_ - this.posZ; + float var10 = MathHelper.sqrt_double(var6 * var6 + var8 * var8); + + if (var10 > 12.0F) { + this.targetX = this.posX + var6 / (double)var10 * 12.0D; + this.targetZ = this.posZ + var8 / (double)var10 * 12.0D; + this.targetY = this.posY + 8.0D; + } else { + this.targetX = p_70220_1_; + this.targetY = p_70220_3_; + this.targetZ = p_70220_4_; + } + + this.despawnTimer = 0; + this.shatterOrDrop = this.rand.nextInt(5) > 0; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float var7 = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, var7) * 180.0D / Math.PI); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + + if (!this.worldObj.isClient) { + double var2 = this.targetX - this.posX; + double var4 = this.targetZ - this.posZ; + float var6 = (float)Math.sqrt(var2 * var2 + var4 * var4); + float var7 = (float)Math.atan2(var4, var2); + double var8 = (double)var1 + (double)(var6 - var1) * 0.0025D; + + if (var6 < 1.0F) { + var8 *= 0.8D; + this.motionY *= 0.8D; + } + + this.motionX = Math.cos(var7) * var8; + this.motionZ = Math.sin(var7) * var8; + + if (this.posY < this.targetY) { + this.motionY += (1.0D - this.motionY) * 0.014999999664723873D; + } else { + this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D; + } + } + + float var10 = 0.25F; + + if (this.isInWater()) { + for (int var3 = 0; var3 < 4; ++var3) { + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var10, this.posY - this.motionY * (double)var10, this.posZ - this.motionZ * (double)var10, this.motionX, this.motionY, this.motionZ); + } + } else { + this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)var10 - 0.5D, this.posZ - this.motionZ * (double)var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ); + } + + if (!this.worldObj.isClient) { + this.setPosition(this.posX, this.posY, this.posZ); + ++this.despawnTimer; + + if (this.despawnTimer > 80 && !this.worldObj.isClient) { + this.setDead(); + + if (this.shatterOrDrop) { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye))); + } else { + this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); + } + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) {} + + public float getShadowSize() { + return 0.0F; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return 1.0F; + } + + public int getBrightnessForRender(float p_70070_1_) { + return 15728880; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java new file mode 100644 index 0000000..c3110aa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java @@ -0,0 +1,56 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityEnderPearl extends EntityThrowable { + + + public EntityEnderPearl(World p_i1782_1_) { + super(p_i1782_1_); + } + + public EntityEnderPearl(World p_i1783_1_, EntityLivingBase p_i1783_2_) { + super(p_i1783_1_, p_i1783_2_); + } + + public EntityEnderPearl(World p_i1784_1_, double p_i1784_2_, double p_i1784_4_, double p_i1784_6_) { + super(p_i1784_1_, p_i1784_2_, p_i1784_4_, p_i1784_6_); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) { + if (p_70184_1_.entityHit != null) { + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); + } + + for (int var2 = 0; var2 < 32; ++var2) { + this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian()); + } + + if (!this.worldObj.isClient) { + if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) { + EntityPlayerMP var3 = (EntityPlayerMP)this.getThrower(); + + if (var3.playerNetServerHandler.func_147362_b().isChannelOpen() && var3.worldObj == this.worldObj) { + if (this.getThrower().isRiding()) { + this.getThrower().mountEntity(null); + } + + this.getThrower().setPositionAndUpdate(this.posX, this.posY, this.posZ); + this.getThrower().fallDistance = 0.0F; + this.getThrower().attackEntityFrom(DamageSource.fall, 5.0F); + } + } + + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityExpBottle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityExpBottle.java new file mode 100644 index 0000000..cbe7156 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityExpBottle.java @@ -0,0 +1,55 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityExpBottle extends EntityThrowable { + + + public EntityExpBottle(World p_i1785_1_) { + super(p_i1785_1_); + } + + public EntityExpBottle(World p_i1786_1_, EntityLivingBase p_i1786_2_) { + super(p_i1786_1_, p_i1786_2_); + } + + public EntityExpBottle(World p_i1787_1_, double p_i1787_2_, double p_i1787_4_, double p_i1787_6_) { + super(p_i1787_1_, p_i1787_2_, p_i1787_4_, p_i1787_6_); + } + + /** + * Gets the amount of gravity to apply to the thrown entity with each tick. + */ + protected float getGravityVelocity() { + return 0.07F; + } + + protected float func_70182_d() { + return 0.7F; + } + + protected float func_70183_g() { + return -20.0F; + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) { + if (!this.worldObj.isClient) { + this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); + int var2 = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5); + + while (var2 > 0) { + int var3 = EntityXPOrb.getXPSplit(var2); + var2 -= var3; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var3)); + } + + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java new file mode 100644 index 0000000..a1b388b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java @@ -0,0 +1,272 @@ +package net.minecraft.entity.item; + +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFallingBlock extends Entity { + private Block field_145811_e; + public int field_145814_a; + public int field_145812_b; + public boolean field_145813_c; + private boolean field_145808_f; + private boolean field_145809_g; + private int field_145815_h; + private float field_145816_i; + public NBTTagCompound field_145810_d; + + + public EntityFallingBlock(World p_i1706_1_) { + super(p_i1706_1_); + this.field_145813_c = true; + this.field_145815_h = 40; + this.field_145816_i = 2.0F; + } + + public EntityFallingBlock(World p_i45318_1_, double p_i45318_2_, double p_i45318_4_, double p_i45318_6_, Block p_i45318_8_) { + this(p_i45318_1_, p_i45318_2_, p_i45318_4_, p_i45318_6_, p_i45318_8_, 0); + } + + public EntityFallingBlock(World p_i45319_1_, double p_i45319_2_, double p_i45319_4_, double p_i45319_6_, Block p_i45319_8_, int p_i45319_9_) { + super(p_i45319_1_); + this.field_145813_c = true; + this.field_145815_h = 40; + this.field_145816_i = 2.0F; + this.field_145811_e = p_i45319_8_; + this.field_145814_a = p_i45319_9_; + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; + this.setPosition(p_i45319_2_, p_i45319_4_, p_i45319_6_); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = p_i45319_2_; + this.prevPosY = p_i45319_4_; + this.prevPosZ = p_i45319_6_; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() {} + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.field_145811_e.getMaterial() == Material.air) { + this.setDead(); + } else { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.field_145812_b; + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (!this.worldObj.isClient) { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY); + int var3 = MathHelper.floor_double(this.posZ); + + if (this.field_145812_b == 1) { + if (this.worldObj.getBlock(var1, var2, var3) != this.field_145811_e) { + this.setDead(); + return; + } + + this.worldObj.setBlockToAir(var1, var2, var3); + } + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + + if (this.worldObj.getBlock(var1, var2, var3) != Blocks.piston_extension) { + this.setDead(); + + if (!this.field_145808_f && this.worldObj.canPlaceEntityOnSide(this.field_145811_e, var1, var2, var3, true, 1, null, null) && !BlockFalling.func_149831_e(this.worldObj, var1, var2 - 1, var3) && this.worldObj.setBlock(var1, var2, var3, this.field_145811_e, this.field_145814_a, 3)) { + if (this.field_145811_e instanceof BlockFalling) { + ((BlockFalling)this.field_145811_e).func_149828_a(this.worldObj, var1, var2, var3, this.field_145814_a); + } + + if (this.field_145810_d != null && this.field_145811_e instanceof ITileEntityProvider) { + TileEntity var4 = this.worldObj.getTileEntity(var1, var2, var3); + + if (var4 != null) { + NBTTagCompound var5 = new NBTTagCompound(); + var4.writeToNBT(var5); + Iterator var6 = this.field_145810_d.func_150296_c().iterator(); + + while (var6.hasNext()) { + String var7 = (String)var6.next(); + NBTBase var8 = this.field_145810_d.getTag(var7); + + if (!var7.equals("x") && !var7.equals("y") && !var7.equals("z")) { + var5.setTag(var7, var8.copy()); + } + } + + var4.readFromNBT(var5); + var4.onInventoryChanged(); + } + } + } else if (this.field_145813_c && !this.field_145808_f) { + this.entityDropItem(new ItemStack(this.field_145811_e, 1, this.field_145811_e.damageDropped(this.field_145814_a)), 0.0F); + } + } + } else if (this.field_145812_b > 100 && !this.worldObj.isClient && (var2 < 1 || var2 > 256) || this.field_145812_b > 600) { + if (this.field_145813_c) { + this.entityDropItem(new ItemStack(this.field_145811_e, 1, this.field_145811_e.damageDropped(this.field_145814_a)), 0.0F); + } + + this.setDead(); + } + } + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + if (this.field_145809_g) { + int var2 = MathHelper.ceiling_float_int(p_70069_1_ - 1.0F); + + if (var2 > 0) { + ArrayList var3 = new ArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox)); + boolean var4 = this.field_145811_e == Blocks.anvil; + DamageSource var5 = var4 ? DamageSource.anvil : DamageSource.fallingBlock; + Iterator var6 = var3.iterator(); + + while (var6.hasNext()) { + Entity var7 = (Entity)var6.next(); + var7.attackEntityFrom(var5, (float)Math.min(MathHelper.floor_float((float)var2 * this.field_145816_i), this.field_145815_h)); + } + + if (var4 && (double)this.rand.nextFloat() < 0.05000000074505806D + (double)var2 * 0.05D) { + int var8 = this.field_145814_a >> 2; + int var9 = this.field_145814_a & 3; + ++var8; + + if (var8 > 2) { + this.field_145808_f = true; + } else { + this.field_145814_a = var9 | var8 << 2; + } + } + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setByte("Tile", (byte)Block.getIdFromBlock(this.field_145811_e)); + p_70014_1_.setInteger("TileID", Block.getIdFromBlock(this.field_145811_e)); + p_70014_1_.setByte("Data", (byte)this.field_145814_a); + p_70014_1_.setByte("Time", (byte)this.field_145812_b); + p_70014_1_.setBoolean("DropItem", this.field_145813_c); + p_70014_1_.setBoolean("HurtEntities", this.field_145809_g); + p_70014_1_.setFloat("FallHurtAmount", this.field_145816_i); + p_70014_1_.setInteger("FallHurtMax", this.field_145815_h); + + if (this.field_145810_d != null) { + p_70014_1_.setTag("TileEntityData", this.field_145810_d); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + if (p_70037_1_.func_150297_b("TileID", 99)) { + this.field_145811_e = Block.getBlockById(p_70037_1_.getInteger("TileID")); + } else { + this.field_145811_e = Block.getBlockById(p_70037_1_.getByte("Tile") & 255); + } + + this.field_145814_a = p_70037_1_.getByte("Data") & 255; + this.field_145812_b = p_70037_1_.getByte("Time") & 255; + + if (p_70037_1_.func_150297_b("HurtEntities", 99)) { + this.field_145809_g = p_70037_1_.getBoolean("HurtEntities"); + this.field_145816_i = p_70037_1_.getFloat("FallHurtAmount"); + this.field_145815_h = p_70037_1_.getInteger("FallHurtMax"); + } else if (this.field_145811_e == Blocks.anvil) { + this.field_145809_g = true; + } + + if (p_70037_1_.func_150297_b("DropItem", 99)) { + this.field_145813_c = p_70037_1_.getBoolean("DropItem"); + } + + if (p_70037_1_.func_150297_b("TileEntityData", 10)) { + this.field_145810_d = p_70037_1_.getCompoundTag("TileEntityData"); + } + + if (this.field_145811_e.getMaterial() == Material.air) { + this.field_145811_e = Blocks.sand; + } + } + + public float getShadowSize() { + return 0.0F; + } + + public World func_145807_e() { + return this.worldObj; + } + + public void func_145806_a(boolean p_145806_1_) { + this.field_145809_g = p_145806_1_; + } + + /** + * Return whether this entity should be rendered as on fire. + */ + public boolean canRenderOnFire() { + return false; + } + + public void addEntityCrashInfo(CrashReportCategory p_85029_1_) { + super.addEntityCrashInfo(p_85029_1_); + p_85029_1_.addCrashSection("Immitating block ID", Integer.valueOf(Block.getIdFromBlock(this.field_145811_e))); + p_85029_1_.addCrashSection("Immitating block data", Integer.valueOf(this.field_145814_a)); + } + + public Block func_145805_f() { + return this.field_145811_e; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java new file mode 100644 index 0000000..6a2bf3d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java @@ -0,0 +1,192 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFireworkRocket extends Entity { + /** The age of the firework in ticks. */ + private int fireworkAge; + + /** + * The lifetime of the firework in ticks. When the age reaches the lifetime the firework explodes. + */ + private int lifetime; + + + public EntityFireworkRocket(World p_i1762_1_) { + super(p_i1762_1_); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() { + this.dataWatcher.addObjectByDataType(8, 5); + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + return p_70112_1_ < 4096.0D; + } + + public EntityFireworkRocket(World p_i1763_1_, double p_i1763_2_, double p_i1763_4_, double p_i1763_6_, ItemStack p_i1763_8_) { + super(p_i1763_1_); + this.fireworkAge = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(p_i1763_2_, p_i1763_4_, p_i1763_6_); + this.yOffset = 0.0F; + int var9 = 1; + + if (p_i1763_8_ != null && p_i1763_8_.hasTagCompound()) { + this.dataWatcher.updateObject(8, p_i1763_8_); + NBTTagCompound var10 = p_i1763_8_.getTagCompound(); + NBTTagCompound var11 = var10.getCompoundTag("Fireworks"); + + if (var11 != null) { + var9 += var11.getByte("Flight"); + } + } + + this.motionX = this.rand.nextGaussian() * 0.001D; + this.motionZ = this.rand.nextGaussian() * 0.001D; + this.motionY = 0.05D; + this.lifetime = 10 * var9 + this.rand.nextInt(6) + this.rand.nextInt(7); + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float var7 = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, var7) * 180.0D / Math.PI); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.motionX *= 1.15D; + this.motionZ *= 1.15D; + this.motionY += 0.04D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + + if (this.fireworkAge == 0) { + this.worldObj.playSoundAtEntity(this, "fireworks.launch", 3.0F, 1.0F); + } + + ++this.fireworkAge; + + if (this.worldObj.isClient && this.fireworkAge % 2 < 2) { + this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D); + } + + if (!this.worldObj.isClient && this.fireworkAge > this.lifetime) { + this.worldObj.setEntityState(this, (byte)17); + this.setDead(); + } + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 17 && this.worldObj.isClient) { + ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); + NBTTagCompound var3 = null; + + if (var2 != null && var2.hasTagCompound()) { + var3 = var2.getTagCompound().getCompoundTag("Fireworks"); + } + + this.worldObj.makeFireworks(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3); + } + + super.handleHealthUpdate(p_70103_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setInteger("Life", this.fireworkAge); + p_70014_1_.setInteger("LifeTime", this.lifetime); + ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); + + if (var2 != null) { + NBTTagCompound var3 = new NBTTagCompound(); + var2.writeToNBT(var3); + p_70014_1_.setTag("FireworksItem", var3); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.fireworkAge = p_70037_1_.getInteger("Life"); + this.lifetime = p_70037_1_.getInteger("LifeTime"); + NBTTagCompound var2 = p_70037_1_.getCompoundTag("FireworksItem"); + + if (var2 != null) { + ItemStack var3 = ItemStack.loadItemStackFromNBT(var2); + + if (var3 != null) { + this.dataWatcher.updateObject(8, var3); + } + } + } + + public float getShadowSize() { + return 0.0F; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return super.getBrightness(p_70013_1_); + } + + public int getBrightnessForRender(float p_70070_1_) { + return super.getBrightnessForRender(p_70070_1_); + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityItem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityItem.java new file mode 100644 index 0000000..7fd6ef4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityItem.java @@ -0,0 +1,372 @@ +package net.minecraft.entity.item; + +import java.util.Iterator; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityItem extends Entity { + private static final Logger logger = LogManager.getLogger(); + + /** + * The age of this EntityItem (used to animate it up and down as well as expire it) + */ + public int age; + public int delayBeforeCanPickup; + + /** The health of this EntityItem. (For example, damage for tools) */ + private int health; + private String field_145801_f; + private String field_145802_g; + + /** The EntityItem's random initial float height. */ + public float hoverStart; + + + public EntityItem(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_) { + super(p_i1709_1_); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; + this.setPosition(p_i1709_2_, p_i1709_4_, p_i1709_6_); + this.rotationYaw = (float)(Math.random() * 360.0D); + this.motionX = (float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D); + this.motionY = 0.20000000298023224D; + this.motionZ = (float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D); + } + + public EntityItem(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) { + this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); + this.setEntityItemStack(p_i1710_8_); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public EntityItem(World p_i1711_1_) { + super(p_i1711_1_); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; + } + + protected void entityInit() { + this.getDataWatcher().addObjectByDataType(10, 5); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.getEntityItem() == null) { + this.setDead(); + } else { + super.onUpdate(); + + if (this.delayBeforeCanPickup > 0) { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.noClip = this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + boolean var1 = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ; + + if (var1 || this.ticksExisted % 25 == 0) { + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() == Material.lava) { + this.motionY = 0.20000000298023224D; + this.motionX = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; + this.motionZ = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + if (!this.worldObj.isClient) { + this.searchForOtherItemsNearby(); + } + } + + float var2 = 0.98F; + + if (this.onGround) { + var2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.98F; + } + + this.motionX *= var2; + this.motionY *= 0.9800000190734863D; + this.motionZ *= var2; + + if (this.onGround) { + this.motionY *= -0.5D; + } + + ++this.age; + + if (!this.worldObj.isClient && this.age >= 6000) { + this.setDead(); + } + } + } + + /** + * Looks for other itemstacks nearby and tries to stack them together + */ + private void searchForOtherItemsNearby() { + Iterator var1 = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.5D, 0.0D, 0.5D)).iterator(); + + while (var1.hasNext()) { + EntityItem var2 = (EntityItem)var1.next(); + this.combineItems(var2); + } + } + + /** + * Tries to merge this item with the item passed as the parameter. Returns true if successful. Either this item or + * the other item will be removed from the world. + */ + public boolean combineItems(EntityItem p_70289_1_) { + if (p_70289_1_ == this) { + return false; + } else if (p_70289_1_.isEntityAlive() && this.isEntityAlive()) { + ItemStack var2 = this.getEntityItem(); + ItemStack var3 = p_70289_1_.getEntityItem(); + + if (var3.getItem() != var2.getItem()) { + return false; + } else if (var3.hasTagCompound() ^ var2.hasTagCompound()) { + return false; + } else if (var3.hasTagCompound() && !var3.getTagCompound().equals(var2.getTagCompound())) { + return false; + } else if (var3.getItem() == null) { + return false; + } else if (var3.getItem().getHasSubtypes() && var3.getItemDamage() != var2.getItemDamage()) { + return false; + } else if (var3.stackSize < var2.stackSize) { + return p_70289_1_.combineItems(this); + } else if (var3.stackSize + var2.stackSize > var3.getMaxStackSize()) { + return false; + } else { + var3.stackSize += var2.stackSize; + p_70289_1_.delayBeforeCanPickup = Math.max(p_70289_1_.delayBeforeCanPickup, this.delayBeforeCanPickup); + p_70289_1_.age = Math.min(p_70289_1_.age, this.age); + p_70289_1_.setEntityItemStack(var3); + this.setDead(); + return true; + } + } else { + return false; + } + } + + /** + * sets the age of the item so that it'll despawn one minute after it has been dropped (instead of five). Used when + * items are dropped from players in creative mode + */ + public void setAgeToCreativeDespawnTime() { + this.age = 4800; + } + + /** + * Returns if this entity is in water and will end up adding the waters velocity to the entity + */ + public boolean handleWaterMovement() { + return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); + } + + /** + * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: + * amountDamage + */ + protected void dealFireDamage(int p_70081_1_) { + this.attackEntityFrom(DamageSource.inFire, (float)p_70081_1_); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && p_70097_1_.isExplosion()) { + return false; + } else { + this.setBeenAttacked(); + this.health = (int)((float)this.health - p_70097_2_); + + if (this.health <= 0) { + this.setDead(); + } + + return false; + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("Health", (byte)this.health); + p_70014_1_.setShort("Age", (short)this.age); + + if (this.func_145800_j() != null) { + p_70014_1_.setString("Thrower", this.field_145801_f); + } + + if (this.func_145798_i() != null) { + p_70014_1_.setString("Owner", this.field_145802_g); + } + + if (this.getEntityItem() != null) { + p_70014_1_.setTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.health = p_70037_1_.getShort("Health") & 255; + this.age = p_70037_1_.getShort("Age"); + + if (p_70037_1_.hasKey("Owner")) { + this.field_145802_g = p_70037_1_.getString("Owner"); + } + + if (p_70037_1_.hasKey("Thrower")) { + this.field_145801_f = p_70037_1_.getString("Thrower"); + } + + NBTTagCompound var2 = p_70037_1_.getCompoundTag("Item"); + this.setEntityItemStack(ItemStack.loadItemStackFromNBT(var2)); + + if (this.getEntityItem() == null) { + this.setDead(); + } + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer p_70100_1_) { + if (!this.worldObj.isClient) { + ItemStack var2 = this.getEntityItem(); + int var3 = var2.stackSize; + + if (this.delayBeforeCanPickup == 0 && (this.field_145802_g == null || 6000 - this.age <= 200 || this.field_145802_g.equals(p_70100_1_.getCommandSenderName())) && p_70100_1_.inventory.addItemStackToInventory(var2)) { + if (var2.getItem() == Item.getItemFromBlock(Blocks.log)) { + p_70100_1_.triggerAchievement(AchievementList.mineWood); + } + + if (var2.getItem() == Item.getItemFromBlock(Blocks.log2)) { + p_70100_1_.triggerAchievement(AchievementList.mineWood); + } + + if (var2.getItem() == Items.leather) { + p_70100_1_.triggerAchievement(AchievementList.killCow); + } + + if (var2.getItem() == Items.diamond) { + p_70100_1_.triggerAchievement(AchievementList.diamonds); + } + + if (var2.getItem() == Items.blaze_rod) { + p_70100_1_.triggerAchievement(AchievementList.blazeRod); + } + + if (var2.getItem() == Items.diamond && this.func_145800_j() != null) { + EntityPlayer var4 = this.worldObj.getPlayerEntityByName(this.func_145800_j()); + + if (var4 != null && var4 != p_70100_1_) { + var4.triggerAchievement(AchievementList.field_150966_x); + } + } + + this.worldObj.playSoundAtEntity(p_70100_1_, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + p_70100_1_.onItemPickup(this, var3); + + if (var2.stackSize <= 0) { + this.setDead(); + } + } + } + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return StatCollector.translateToLocal("item." + this.getEntityItem().getUnlocalizedName()); + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() { + return false; + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int p_71027_1_) { + super.travelToDimension(p_71027_1_); + + if (!this.worldObj.isClient) { + this.searchForOtherItemsNearby(); + } + } + + /** + * Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an + * ItemStack containing Block.stone) + */ + public ItemStack getEntityItem() { + ItemStack var1 = this.getDataWatcher().getWatchableObjectItemStack(10); + return var1 == null ? new ItemStack(Blocks.stone) : var1; + } + + /** + * Sets the ItemStack for this entity + */ + public void setEntityItemStack(ItemStack p_92058_1_) { + this.getDataWatcher().updateObject(10, p_92058_1_); + this.getDataWatcher().setObjectWatched(10); + } + + public String func_145798_i() { + return this.field_145802_g; + } + + public void func_145797_a(String p_145797_1_) { + this.field_145802_g = p_145797_1_; + } + + public String func_145800_j() { + return this.field_145801_f; + } + + public void func_145799_b(String p_145799_1_) { + this.field_145801_f = p_145799_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityItemFrame.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityItemFrame.java new file mode 100644 index 0000000..82939af --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityItemFrame.java @@ -0,0 +1,190 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class EntityItemFrame extends EntityHanging { + /** Chance for this item frame's item to drop from the frame. */ + private float itemDropChance = 1.0F; + + + public EntityItemFrame(World p_i1590_1_) { + super(p_i1590_1_); + } + + public EntityItemFrame(World p_i1591_1_, int p_i1591_2_, int p_i1591_3_, int p_i1591_4_, int p_i1591_5_) { + super(p_i1591_1_, p_i1591_2_, p_i1591_3_, p_i1591_4_, p_i1591_5_); + this.setDirection(p_i1591_5_); + } + + protected void entityInit() { + this.getDataWatcher().addObjectByDataType(2, 5); + this.getDataWatcher().addObject(3, Byte.valueOf((byte)0)); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if (this.getDisplayedItem() != null) { + if (!this.worldObj.isClient) { + this.func_146065_b(p_70097_1_.getEntity(), false); + this.setDisplayedItem(null); + } + + return true; + } else { + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + public int getWidthPixels() { + return 9; + } + + public int getHeightPixels() { + return 9; + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + double var3 = 16.0D; + var3 *= 64.0D * this.renderDistanceWeight; + return p_70112_1_ < var3 * var3; + } + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity p_110128_1_) { + this.func_146065_b(p_110128_1_, true); + } + + public void func_146065_b(Entity p_146065_1_, boolean p_146065_2_) { + ItemStack var3 = this.getDisplayedItem(); + + if (p_146065_1_ instanceof EntityPlayer) { + EntityPlayer var4 = (EntityPlayer)p_146065_1_; + + if (var4.capabilities.isCreativeMode) { + this.removeFrameFromMap(var3); + return; + } + } + + if (p_146065_2_) { + this.entityDropItem(new ItemStack(Items.item_frame), 0.0F); + } + + if (var3 != null && this.rand.nextFloat() < this.itemDropChance) { + var3 = var3.copy(); + this.removeFrameFromMap(var3); + this.entityDropItem(var3, 0.0F); + } + } + + /** + * Removes the dot representing this frame's position from the map when the item frame is broken. + */ + private void removeFrameFromMap(ItemStack p_110131_1_) { + if (p_110131_1_ != null) { + if (p_110131_1_.getItem() == Items.filled_map) { + MapData var2 = ((ItemMap)p_110131_1_.getItem()).getMapData(p_110131_1_, this.worldObj); + var2.playersVisibleOnMap.remove("frame-" + this.getEntityId()); + } + + p_110131_1_.setItemFrame(null); + } + } + + public ItemStack getDisplayedItem() { + return this.getDataWatcher().getWatchableObjectItemStack(2); + } + + public void setDisplayedItem(ItemStack p_82334_1_) { + if (p_82334_1_ != null) { + p_82334_1_ = p_82334_1_.copy(); + p_82334_1_.stackSize = 1; + p_82334_1_.setItemFrame(this); + } + + this.getDataWatcher().updateObject(2, p_82334_1_); + this.getDataWatcher().setObjectWatched(2); + } + + /** + * Return the rotation of the item currently on this frame. + */ + public int getRotation() { + return this.getDataWatcher().getWatchableObjectByte(3); + } + + public void setItemRotation(int p_82336_1_) { + this.getDataWatcher().updateObject(3, Byte.valueOf((byte)(p_82336_1_ % 4))); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + if (this.getDisplayedItem() != null) { + p_70014_1_.setTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); + p_70014_1_.setByte("ItemRotation", (byte)this.getRotation()); + p_70014_1_.setFloat("ItemDropChance", this.itemDropChance); + } + + super.writeEntityToNBT(p_70014_1_); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + NBTTagCompound var2 = p_70037_1_.getCompoundTag("Item"); + + if (var2 != null && !var2.hasNoTags()) { + this.setDisplayedItem(ItemStack.loadItemStackFromNBT(var2)); + this.setItemRotation(p_70037_1_.getByte("ItemRotation")); + + if (p_70037_1_.func_150297_b("ItemDropChance", 99)) { + this.itemDropChance = p_70037_1_.getFloat("ItemDropChance"); + } + } + + super.readEntityFromNBT(p_70037_1_); + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + if (this.getDisplayedItem() == null) { + ItemStack var2 = p_130002_1_.getHeldItem(); + + if (var2 != null && !this.worldObj.isClient) { + this.setDisplayedItem(var2); + + if (!p_130002_1_.capabilities.isCreativeMode && --var2.stackSize <= 0) { + p_130002_1_.inventory.setInventorySlotContents(p_130002_1_.inventory.currentItem, null); + } + } + } else if (!this.worldObj.isClient) { + this.setItemRotation(this.getRotation() + 1); + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecart.java new file mode 100644 index 0000000..493d9df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecart.java @@ -0,0 +1,963 @@ +package net.minecraft.entity.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public abstract class EntityMinecart extends Entity { + private boolean isInReverse; + private String entityName; + + /** Minecart rotational logic matrix */ + private static final int[][][] matrix = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; + + /** appears to be the progress of the turn */ + private int turnProgress; + private double minecartX; + private double minecartY; + private double minecartZ; + private double minecartYaw; + private double minecartPitch; + private double velocityX; + private double velocityY; + private double velocityZ; + + + public EntityMinecart(World p_i1712_1_) { + super(p_i1712_1_); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.7F); + this.yOffset = this.height / 2.0F; + } + + /** + * Creates a new minecart of the specified type in the specified location in the given world. par0World - world to + * create the minecart in, double par1,par3,par5 represent x,y,z respectively. int par7 specifies the type: 1 for + * MinecartChest, 2 for MinecartFurnace, 3 for MinecartTNT, 4 for MinecartMobSpawner, 5 for MinecartHopper and 0 for + * a standard empty minecart + */ + public static EntityMinecart createMinecart(World p_94090_0_, double p_94090_1_, double p_94090_3_, double p_94090_5_, int p_94090_7_) { + switch (p_94090_7_) { + case 1: + return new EntityMinecartChest(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + + case 2: + return new EntityMinecartFurnace(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + + case 3: + return new EntityMinecartTNT(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + + case 4: + return new EntityMinecartMobSpawner(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + + case 5: + return new EntityMinecartHopper(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + + case 6: + return new EntityMinecartCommandBlock(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + + default: + return new EntityMinecartEmpty(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + this.dataWatcher.addObject(20, new Integer(0)); + this.dataWatcher.addObject(21, new Integer(6)); + this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); + } + + /** + * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be + * pushable on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity p_70114_1_) { + return p_70114_1_.canBePushed() ? p_70114_1_.boundingBox : null; + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() { + return null; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() { + return true; + } + + public EntityMinecart(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) { + this(p_i1713_1_); + this.setPosition(p_i1713_2_, p_i1713_4_, p_i1713_6_); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = p_i1713_2_; + this.prevPosY = p_i1713_4_; + this.prevPosZ = p_i1713_6_; + } + + /** + * Returns the Y offset from the entity's position for any entity riding this one. + */ + public double getMountedYOffset() { + return (double)this.height * 0.0D - 0.30000001192092896D; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (!this.worldObj.isClient && !this.isDead) { + if (this.isEntityInvulnerable()) { + return false; + } else { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setBeenAttacked(); + this.setDamage(this.getDamage() + p_70097_2_ * 10.0F); + boolean var3 = p_70097_1_.getEntity() instanceof EntityPlayer && ((EntityPlayer)p_70097_1_.getEntity()).capabilities.isCreativeMode; + + if (var3 || this.getDamage() > 40.0F) { + if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + + if (var3 && !this.isInventoryNameLocalized()) { + this.setDead(); + } else { + this.killMinecart(p_70097_1_); + } + } + + return true; + } + } else { + return true; + } + } + + public void killMinecart(DamageSource p_94095_1_) { + this.setDead(); + ItemStack var2 = new ItemStack(Items.minecart, 1); + + if (this.entityName != null) { + var2.setStackDisplayName(this.entityName); + } + + this.entityDropItem(var2, 0.0F); + } + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + public void performHurtAnimation() { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setDamage(this.getDamage() + this.getDamage() * 10.0F); + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /** + * Will get destroyed next tick. + */ + public void setDead() { + super.setDead(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.getRollingAmplitude() > 0) { + this.setRollingAmplitude(this.getRollingAmplitude() - 1); + } + + if (this.getDamage() > 0.0F) { + this.setDamage(this.getDamage() - 1.0F); + } + + if (this.posY < -64.0D) { + this.kill(); + } + + int var2; + + if (!this.worldObj.isClient && this.worldObj instanceof WorldServer) { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer var1 = ((WorldServer)this.worldObj).func_73046_m(); + var2 = this.getMaxInPortalTime(); + + if (this.inPortal) { + if (var1.getAllowNether()) { + if (this.ridingEntity == null && this.portalCounter++ >= var2) { + this.portalCounter = var2; + this.timeUntilPortal = this.getPortalCooldown(); + byte var3; + + if (this.worldObj.provider.dimensionId == -1) { + var3 = 0; + } else { + var3 = -1; + } + + this.travelToDimension(var3); + } + + this.inPortal = false; + } + } else { + if (this.portalCounter > 0) { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + if (this.worldObj.isClient) { + if (this.turnProgress > 0) { + double var19 = this.posX + (this.minecartX - this.posX) / (double)this.turnProgress; + double var21 = this.posY + (this.minecartY - this.posY) / (double)this.turnProgress; + double var5 = this.posZ + (this.minecartZ - this.posZ) / (double)this.turnProgress; + double var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + var7 / (double)this.turnProgress); + this.rotationPitch = (float)((double)this.rotationPitch + (this.minecartPitch - (double)this.rotationPitch) / (double)this.turnProgress); + --this.turnProgress; + this.setPosition(var19, var21, var5); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else { + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } else { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + int var18 = MathHelper.floor_double(this.posX); + var2 = MathHelper.floor_double(this.posY); + int var20 = MathHelper.floor_double(this.posZ); + + if (BlockRailBase.func_150049_b_(this.worldObj, var18, var2 - 1, var20)) { + --var2; + } + + double var4 = 0.4D; + double var6 = 0.0078125D; + Block var8 = this.worldObj.getBlock(var18, var2, var20); + + if (BlockRailBase.func_150051_a(var8)) { + int var9 = this.worldObj.getBlockMetadata(var18, var2, var20); + this.func_145821_a(var18, var2, var20, var4, var6, var8, var9); + + if (var8 == Blocks.activator_rail) { + this.onActivatorRailPass(var18, var2, var20, (var9 & 8) != 0); + } + } else { + this.func_94088_b(var4); + } + + this.func_145775_I(); + this.rotationPitch = 0.0F; + double var22 = this.prevPosX - this.posX; + double var11 = this.prevPosZ - this.posZ; + + if (var22 * var22 + var11 * var11 > 0.001D) { + this.rotationYaw = (float)(Math.atan2(var11, var22) * 180.0D / Math.PI); + + if (this.isInReverse) { + this.rotationYaw += 180.0F; + } + } + + double var13 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); + + if (var13 < -170.0D || var13 >= 170.0D) { + this.rotationYaw += 180.0F; + this.isInReverse = !this.isInReverse; + } + + this.setRotation(this.rotationYaw, this.rotationPitch); + List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + + if (var15 != null && !var15.isEmpty()) { + for (int var16 = 0; var16 < var15.size(); ++var16) { + Entity var17 = (Entity)var15.get(var16); + + if (var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof EntityMinecart) { + var17.applyEntityCollision(this); + } + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) { + if (this.riddenByEntity.ridingEntity == this) { + this.riddenByEntity.ridingEntity = null; + } + + this.riddenByEntity = null; + } + } + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) {} + + protected void func_94088_b(double p_94088_1_) { + if (this.motionX < -p_94088_1_) { + this.motionX = -p_94088_1_; + } + + if (this.motionX > p_94088_1_) { + this.motionX = p_94088_1_; + } + + if (this.motionZ < -p_94088_1_) { + this.motionZ = -p_94088_1_; + } + + if (this.motionZ > p_94088_1_) { + this.motionZ = p_94088_1_; + } + + if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (!this.onGround) { + this.motionX *= 0.949999988079071D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.949999988079071D; + } + } + + protected void func_145821_a(int p_145821_1_, int p_145821_2_, int p_145821_3_, double p_145821_4_, double p_145821_6_, Block p_145821_8_, int p_145821_9_) { + this.fallDistance = 0.0F; + Vec3 var10 = this.func_70489_a(this.posX, this.posY, this.posZ); + this.posY = p_145821_2_; + boolean var11 = false; + boolean var12 = false; + + if (p_145821_8_ == Blocks.golden_rail) { + var11 = (p_145821_9_ & 8) != 0; + var12 = !var11; + } + + if (((BlockRailBase)p_145821_8_).func_150050_e()) { + p_145821_9_ &= 7; + } + + if (p_145821_9_ >= 2 && p_145821_9_ <= 5) { + this.posY = p_145821_2_ + 1; + } + + if (p_145821_9_ == 2) { + this.motionX -= p_145821_6_; + } + + if (p_145821_9_ == 3) { + this.motionX += p_145821_6_; + } + + if (p_145821_9_ == 4) { + this.motionZ += p_145821_6_; + } + + if (p_145821_9_ == 5) { + this.motionZ -= p_145821_6_; + } + + int[][] var13 = matrix[p_145821_9_]; + double var14 = var13[1][0] - var13[0][0]; + double var16 = var13[1][2] - var13[0][2]; + double var18 = Math.sqrt(var14 * var14 + var16 * var16); + double var20 = this.motionX * var14 + this.motionZ * var16; + + if (var20 < 0.0D) { + var14 = -var14; + var16 = -var16; + } + + double var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var22 > 2.0D) { + var22 = 2.0D; + } + + this.motionX = var22 * var14 / var18; + this.motionZ = var22 * var16 / var18; + double var24; + double var26; + double var28; + double var30; + + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { + var24 = ((EntityLivingBase)this.riddenByEntity).moveForward; + + if (var24 > 0.0D) { + var26 = -Math.sin(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F); + var28 = Math.cos(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F); + var30 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (var30 < 0.01D) { + this.motionX += var26 * 0.1D; + this.motionZ += var28 * 0.1D; + var12 = false; + } + } + } + + if (var12) { + var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var24 < 0.03D) { + this.motionX *= 0.0D; + this.motionY *= 0.0D; + this.motionZ *= 0.0D; + } else { + this.motionX *= 0.5D; + this.motionY *= 0.0D; + this.motionZ *= 0.5D; + } + } + + var24 = 0.0D; + var26 = (double)p_145821_1_ + 0.5D + (double)var13[0][0] * 0.5D; + var28 = (double)p_145821_3_ + 0.5D + (double)var13[0][2] * 0.5D; + var30 = (double)p_145821_1_ + 0.5D + (double)var13[1][0] * 0.5D; + double var32 = (double)p_145821_3_ + 0.5D + (double)var13[1][2] * 0.5D; + var14 = var30 - var26; + var16 = var32 - var28; + double var34; + double var36; + + if (var14 == 0.0D) { + this.posX = (double)p_145821_1_ + 0.5D; + var24 = this.posZ - (double)p_145821_3_; + } else if (var16 == 0.0D) { + this.posZ = (double)p_145821_3_ + 0.5D; + var24 = this.posX - (double)p_145821_1_; + } else { + var34 = this.posX - var26; + var36 = this.posZ - var28; + var24 = (var34 * var14 + var36 * var16) * 2.0D; + } + + this.posX = var26 + var14 * var24; + this.posZ = var28 + var16 * var24; + this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); + var34 = this.motionX; + var36 = this.motionZ; + + if (this.riddenByEntity != null) { + var34 *= 0.75D; + var36 *= 0.75D; + } + + if (var34 < -p_145821_4_) { + var34 = -p_145821_4_; + } + + if (var34 > p_145821_4_) { + var34 = p_145821_4_; + } + + if (var36 < -p_145821_4_) { + var36 = -p_145821_4_; + } + + if (var36 > p_145821_4_) { + var36 = p_145821_4_; + } + + this.moveEntity(var34, 0.0D, var36); + + if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - p_145821_1_ == var13[0][0] && MathHelper.floor_double(this.posZ) - p_145821_3_ == var13[0][2]) { + this.setPosition(this.posX, this.posY + (double)var13[0][1], this.posZ); + } else if (var13[1][1] != 0 && MathHelper.floor_double(this.posX) - p_145821_1_ == var13[1][0] && MathHelper.floor_double(this.posZ) - p_145821_3_ == var13[1][2]) { + this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ); + } + + this.applyDrag(); + Vec3 var38 = this.func_70489_a(this.posX, this.posY, this.posZ); + + if (var38 != null && var10 != null) { + double var39 = (var10.yCoord - var38.yCoord) * 0.05D; + var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var22 > 0.0D) { + this.motionX = this.motionX / var22 * (var22 + var39); + this.motionZ = this.motionZ / var22 * (var22 + var39); + } + + this.setPosition(this.posX, var38.yCoord, this.posZ); + } + + int var45 = MathHelper.floor_double(this.posX); + int var40 = MathHelper.floor_double(this.posZ); + + if (var45 != p_145821_1_ || var40 != p_145821_3_) { + var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.motionX = var22 * (double)(var45 - p_145821_1_); + this.motionZ = var22 * (double)(var40 - p_145821_3_); + } + + if (var11) { + double var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var41 > 0.01D) { + double var43 = 0.06D; + this.motionX += this.motionX / var41 * var43; + this.motionZ += this.motionZ / var41 * var43; + } else if (p_145821_9_ == 1) { + if (this.worldObj.getBlock(p_145821_1_ - 1, p_145821_2_, p_145821_3_).isNormalCube()) { + this.motionX = 0.02D; + } else if (this.worldObj.getBlock(p_145821_1_ + 1, p_145821_2_, p_145821_3_).isNormalCube()) { + this.motionX = -0.02D; + } + } else if (p_145821_9_ == 0) { + if (this.worldObj.getBlock(p_145821_1_, p_145821_2_, p_145821_3_ - 1).isNormalCube()) { + this.motionZ = 0.02D; + } else if (this.worldObj.getBlock(p_145821_1_, p_145821_2_, p_145821_3_ + 1).isNormalCube()) { + this.motionZ = -0.02D; + } + } + } + } + + protected void applyDrag() { + if (this.riddenByEntity != null) { + this.motionX *= 0.996999979019165D; + this.motionY *= 0.0D; + this.motionZ *= 0.996999979019165D; + } else { + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.0D; + this.motionZ *= 0.9599999785423279D; + } + } + + public Vec3 func_70495_a(double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_) { + int var9 = MathHelper.floor_double(p_70495_1_); + int var10 = MathHelper.floor_double(p_70495_3_); + int var11 = MathHelper.floor_double(p_70495_5_); + + if (BlockRailBase.func_150049_b_(this.worldObj, var9, var10 - 1, var11)) { + --var10; + } + + Block var12 = this.worldObj.getBlock(var9, var10, var11); + + if (!BlockRailBase.func_150051_a(var12)) { + return null; + } else { + int var13 = this.worldObj.getBlockMetadata(var9, var10, var11); + + if (((BlockRailBase)var12).func_150050_e()) { + var13 &= 7; + } + + p_70495_3_ = var10; + + if (var13 >= 2 && var13 <= 5) { + p_70495_3_ = var10 + 1; + } + + int[][] var14 = matrix[var13]; + double var15 = var14[1][0] - var14[0][0]; + double var17 = var14[1][2] - var14[0][2]; + double var19 = Math.sqrt(var15 * var15 + var17 * var17); + var15 /= var19; + var17 /= var19; + p_70495_1_ += var15 * p_70495_7_; + p_70495_5_ += var17 * p_70495_7_; + + if (var14[0][1] != 0 && MathHelper.floor_double(p_70495_1_) - var9 == var14[0][0] && MathHelper.floor_double(p_70495_5_) - var11 == var14[0][2]) { + p_70495_3_ += var14[0][1]; + } else if (var14[1][1] != 0 && MathHelper.floor_double(p_70495_1_) - var9 == var14[1][0] && MathHelper.floor_double(p_70495_5_) - var11 == var14[1][2]) { + p_70495_3_ += var14[1][1]; + } + + return this.func_70489_a(p_70495_1_, p_70495_3_, p_70495_5_); + } + } + + public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_) { + int var7 = MathHelper.floor_double(p_70489_1_); + int var8 = MathHelper.floor_double(p_70489_3_); + int var9 = MathHelper.floor_double(p_70489_5_); + + if (BlockRailBase.func_150049_b_(this.worldObj, var7, var8 - 1, var9)) { + --var8; + } + + Block var10 = this.worldObj.getBlock(var7, var8, var9); + + if (BlockRailBase.func_150051_a(var10)) { + int var11 = this.worldObj.getBlockMetadata(var7, var8, var9); + p_70489_3_ = var8; + + if (((BlockRailBase)var10).func_150050_e()) { + var11 &= 7; + } + + if (var11 >= 2 && var11 <= 5) { + p_70489_3_ = var8 + 1; + } + + int[][] var12 = matrix[var11]; + double var13 = 0.0D; + double var15 = (double)var7 + 0.5D + (double)var12[0][0] * 0.5D; + double var17 = (double)var8 + 0.5D + (double)var12[0][1] * 0.5D; + double var19 = (double)var9 + 0.5D + (double)var12[0][2] * 0.5D; + double var21 = (double)var7 + 0.5D + (double)var12[1][0] * 0.5D; + double var23 = (double)var8 + 0.5D + (double)var12[1][1] * 0.5D; + double var25 = (double)var9 + 0.5D + (double)var12[1][2] * 0.5D; + double var27 = var21 - var15; + double var29 = (var23 - var17) * 2.0D; + double var31 = var25 - var19; + + if (var27 == 0.0D) { + p_70489_1_ = (double)var7 + 0.5D; + var13 = p_70489_5_ - (double)var9; + } else if (var31 == 0.0D) { + p_70489_5_ = (double)var9 + 0.5D; + var13 = p_70489_1_ - (double)var7; + } else { + double var33 = p_70489_1_ - var15; + double var35 = p_70489_5_ - var19; + var13 = (var33 * var27 + var35 * var31) * 2.0D; + } + + p_70489_1_ = var15 + var27 * var13; + p_70489_3_ = var17 + var29 * var13; + p_70489_5_ = var19 + var31 * var13; + + if (var29 < 0.0D) { + ++p_70489_3_; + } + + if (var29 > 0.0D) { + p_70489_3_ += 0.5D; + } + + return Vec3.createVectorHelper(p_70489_1_, p_70489_3_, p_70489_5_); + } else { + return null; + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + if (p_70037_1_.getBoolean("CustomDisplayTile")) { + this.func_145819_k(p_70037_1_.getInteger("DisplayTile")); + this.setDisplayTileData(p_70037_1_.getInteger("DisplayData")); + this.setDisplayTileOffset(p_70037_1_.getInteger("DisplayOffset")); + } + + if (p_70037_1_.func_150297_b("CustomName", 8) && p_70037_1_.getString("CustomName").length() > 0) { + this.entityName = p_70037_1_.getString("CustomName"); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + if (this.hasDisplayTile()) { + p_70014_1_.setBoolean("CustomDisplayTile", true); + p_70014_1_.setInteger("DisplayTile", this.func_145820_n().getMaterial() == Material.air ? 0 : Block.getIdFromBlock(this.func_145820_n())); + p_70014_1_.setInteger("DisplayData", this.getDisplayTileData()); + p_70014_1_.setInteger("DisplayOffset", this.getDisplayTileOffset()); + } + + if (this.entityName != null && this.entityName.length() > 0) { + p_70014_1_.setString("CustomName", this.entityName); + } + } + + public float getShadowSize() { + return 0.0F; + } + + /** + * Applies a velocity to each of the entities pushing them away from each other. Args: entity + */ + public void applyEntityCollision(Entity p_70108_1_) { + if (!this.worldObj.isClient) { + if (p_70108_1_ != this.riddenByEntity) { + if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && this.getMinecartType() == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && p_70108_1_.ridingEntity == null) { + p_70108_1_.mountEntity(this); + } + + double var2 = p_70108_1_.posX - this.posX; + double var4 = p_70108_1_.posZ - this.posZ; + double var6 = var2 * var2 + var4 * var4; + + if (var6 >= 9.999999747378752E-5D) { + var6 = MathHelper.sqrt_double(var6); + var2 /= var6; + var4 /= var6; + double var8 = 1.0D / var6; + + if (var8 > 1.0D) { + var8 = 1.0D; + } + + var2 *= var8; + var4 *= var8; + var2 *= 0.10000000149011612D; + var4 *= 0.10000000149011612D; + var2 *= 1.0F - this.entityCollisionReduction; + var4 *= 1.0F - this.entityCollisionReduction; + var2 *= 0.5D; + var4 *= 0.5D; + + if (p_70108_1_ instanceof EntityMinecart) { + double var10 = p_70108_1_.posX - this.posX; + double var12 = p_70108_1_.posZ - this.posZ; + Vec3 var14 = Vec3.createVectorHelper(var10, 0.0D, var12).normalize(); + Vec3 var15 = Vec3.createVectorHelper(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F), 0.0D, MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F)).normalize(); + double var16 = Math.abs(var14.dotProduct(var15)); + + if (var16 < 0.800000011920929D) { + return; + } + + double var18 = p_70108_1_.motionX + this.motionX; + double var20 = p_70108_1_.motionZ + this.motionZ; + + if (((EntityMinecart)p_70108_1_).getMinecartType() == 2 && this.getMinecartType() != 2) { + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(p_70108_1_.motionX - var2, 0.0D, p_70108_1_.motionZ - var4); + p_70108_1_.motionX *= 0.949999988079071D; + p_70108_1_.motionZ *= 0.949999988079071D; + } else if (((EntityMinecart)p_70108_1_).getMinecartType() != 2 && this.getMinecartType() == 2) { + p_70108_1_.motionX *= 0.20000000298023224D; + p_70108_1_.motionZ *= 0.20000000298023224D; + p_70108_1_.addVelocity(this.motionX + var2, 0.0D, this.motionZ + var4); + this.motionX *= 0.949999988079071D; + this.motionZ *= 0.949999988079071D; + } else { + var18 /= 2.0D; + var20 /= 2.0D; + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(var18 - var2, 0.0D, var20 - var4); + p_70108_1_.motionX *= 0.20000000298023224D; + p_70108_1_.motionZ *= 0.20000000298023224D; + p_70108_1_.addVelocity(var18 + var2, 0.0D, var20 + var4); + } + } else { + this.addVelocity(-var2, 0.0D, -var4); + p_70108_1_.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D); + } + } + } + } + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.minecartX = p_70056_1_; + this.minecartY = p_70056_3_; + this.minecartZ = p_70056_5_; + this.minecartYaw = p_70056_7_; + this.minecartPitch = p_70056_8_; + this.turnProgress = p_70056_9_ + 2; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.velocityX = this.motionX = p_70016_1_; + this.velocityY = this.motionY = p_70016_3_; + this.velocityZ = this.motionZ = p_70016_5_; + } + + /** + * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over + * 40. + */ + public void setDamage(float p_70492_1_) { + this.dataWatcher.updateObject(19, Float.valueOf(p_70492_1_)); + } + + /** + * Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over + * 40. + */ + public float getDamage() { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + /** + * Sets the rolling amplitude the cart rolls while being attacked. + */ + public void setRollingAmplitude(int p_70497_1_) { + this.dataWatcher.updateObject(17, Integer.valueOf(p_70497_1_)); + } + + /** + * Gets the rolling amplitude the cart rolls while being attacked. + */ + public int getRollingAmplitude() { + return this.dataWatcher.getWatchableObjectInt(17); + } + + /** + * Sets the rolling direction the cart rolls while being attacked. Can be 1 or -1. + */ + public void setRollingDirection(int p_70494_1_) { + this.dataWatcher.updateObject(18, Integer.valueOf(p_70494_1_)); + } + + /** + * Gets the rolling direction the cart rolls while being attacked. Can be 1 or -1. + */ + public int getRollingDirection() { + return this.dataWatcher.getWatchableObjectInt(18); + } + + public abstract int getMinecartType(); + + public Block func_145820_n() { + if (!this.hasDisplayTile()) { + return this.func_145817_o(); + } else { + int var1 = this.getDataWatcher().getWatchableObjectInt(20) & 65535; + return Block.getBlockById(var1); + } + } + + public Block func_145817_o() { + return Blocks.air; + } + + public int getDisplayTileData() { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileData() : this.getDataWatcher().getWatchableObjectInt(20) >> 16; + } + + public int getDefaultDisplayTileData() { + return 0; + } + + public int getDisplayTileOffset() { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileOffset() : this.getDataWatcher().getWatchableObjectInt(21); + } + + public int getDefaultDisplayTileOffset() { + return 6; + } + + public void func_145819_k(int p_145819_1_) { + this.getDataWatcher().updateObject(20, Integer.valueOf(p_145819_1_ & 65535 | this.getDisplayTileData() << 16)); + this.setHasDisplayTile(true); + } + + public void setDisplayTileData(int p_94092_1_) { + this.getDataWatcher().updateObject(20, Integer.valueOf(Block.getIdFromBlock(this.func_145820_n()) & 65535 | p_94092_1_ << 16)); + this.setHasDisplayTile(true); + } + + public void setDisplayTileOffset(int p_94086_1_) { + this.getDataWatcher().updateObject(21, Integer.valueOf(p_94086_1_)); + this.setHasDisplayTile(true); + } + + public boolean hasDisplayTile() { + return this.getDataWatcher().getWatchableObjectByte(22) == 1; + } + + public void setHasDisplayTile(boolean p_94096_1_) { + this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(p_94096_1_ ? 1 : 0))); + } + + /** + * Sets the minecart's name. + */ + public void setMinecartName(String p_96094_1_) { + this.entityName = p_96094_1_; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return this.entityName != null ? this.entityName : super.getCommandSenderName(); + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.entityName != null; + } + + public String func_95999_t() { + return this.entityName; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java new file mode 100644 index 0000000..81f3da8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartChest.java @@ -0,0 +1,43 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityMinecartChest extends EntityMinecartContainer { + + + public EntityMinecartChest(World p_i1714_1_) { + super(p_i1714_1_); + } + + public EntityMinecartChest(World p_i1715_1_, double p_i1715_2_, double p_i1715_4_, double p_i1715_6_) { + super(p_i1715_1_, p_i1715_2_, p_i1715_4_, p_i1715_6_); + } + + public void killMinecart(DamageSource p_94095_1_) { + super.killMinecart(p_94095_1_); + this.func_145778_a(Item.getItemFromBlock(Blocks.chest), 1, 0.0F); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 27; + } + + public int getMinecartType() { + return 1; + } + + public Block func_145817_o() { + return Blocks.chest; + } + + public int getDefaultDisplayTileOffset() { + return 8; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java new file mode 100644 index 0000000..0b1e394 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java @@ -0,0 +1,258 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public abstract class EntityMinecartContainer extends EntityMinecart implements IInventory { + private ItemStack[] minecartContainerItems = new ItemStack[36]; + + /** + * When set to true, the minecart will drop all items when setDead() is called. When false (such as when travelling + * dimensions) it preserves its contents. + */ + private boolean dropContentsWhenDead = true; + + + public EntityMinecartContainer(World p_i1716_1_) { + super(p_i1716_1_); + } + + public EntityMinecartContainer(World p_i1717_1_, double p_i1717_2_, double p_i1717_4_, double p_i1717_6_) { + super(p_i1717_1_, p_i1717_2_, p_i1717_4_, p_i1717_6_); + } + + public void killMinecart(DamageSource p_94095_1_) { + super.killMinecart(p_94095_1_); + + for (int var2 = 0; var2 < this.getSizeInventory(); ++var2) { + ItemStack var3 = this.getStackInSlot(var2); + + if (var3 != null) { + float var4 = this.rand.nextFloat() * 0.8F + 0.1F; + float var5 = this.rand.nextFloat() * 0.8F + 0.1F; + float var6 = this.rand.nextFloat() * 0.8F + 0.1F; + + while (var3.stackSize > 0) { + int var7 = this.rand.nextInt(21) + 10; + + if (var7 > var3.stackSize) { + var7 = var3.stackSize; + } + + var3.stackSize -= var7; + EntityItem var8 = new EntityItem(this.worldObj, this.posX + (double)var4, this.posY + (double)var5, this.posZ + (double)var6, new ItemStack(var3.getItem(), var7, var3.getItemDamage())); + float var9 = 0.05F; + var8.motionX = (float)this.rand.nextGaussian() * var9; + var8.motionY = (float)this.rand.nextGaussian() * var9 + 0.2F; + var8.motionZ = (float)this.rand.nextGaussian() * var9; + this.worldObj.spawnEntityInWorld(var8); + } + } + } + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return this.minecartContainerItems[p_70301_1_]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.minecartContainerItems[p_70298_1_] != null) { + ItemStack var3; + + if (this.minecartContainerItems[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.minecartContainerItems[p_70298_1_]; + this.minecartContainerItems[p_70298_1_] = null; + return var3; + } else { + var3 = this.minecartContainerItems[p_70298_1_].splitStack(p_70298_2_); + + if (this.minecartContainerItems[p_70298_1_].stackSize == 0) { + this.minecartContainerItems[p_70298_1_] = null; + } + + return var3; + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.minecartContainerItems[p_70304_1_] != null) { + ItemStack var2 = this.minecartContainerItems[p_70304_1_]; + this.minecartContainerItems[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.minecartContainerItems[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() {} + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return !this.isDead && p_70300_1_.getDistanceSqToEntity(this) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.func_95999_t() : "container.minecart"; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int p_71027_1_) { + this.dropContentsWhenDead = false; + super.travelToDimension(p_71027_1_); + } + + /** + * Will get destroyed next tick. + */ + public void setDead() { + if (this.dropContentsWhenDead) { + for (int var1 = 0; var1 < this.getSizeInventory(); ++var1) { + ItemStack var2 = this.getStackInSlot(var1); + + if (var2 != null) { + float var3 = this.rand.nextFloat() * 0.8F + 0.1F; + float var4 = this.rand.nextFloat() * 0.8F + 0.1F; + float var5 = this.rand.nextFloat() * 0.8F + 0.1F; + + while (var2.stackSize > 0) { + int var6 = this.rand.nextInt(21) + 10; + + if (var6 > var2.stackSize) { + var6 = var2.stackSize; + } + + var2.stackSize -= var6; + EntityItem var7 = new EntityItem(this.worldObj, this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, new ItemStack(var2.getItem(), var6, var2.getItemDamage())); + + if (var2.hasTagCompound()) { + var7.getEntityItem().setTagCompound((NBTTagCompound)var2.getTagCompound().copy()); + } + + float var8 = 0.05F; + var7.motionX = (float)this.rand.nextGaussian() * var8; + var7.motionY = (float)this.rand.nextGaussian() * var8 + 0.2F; + var7.motionZ = (float)this.rand.nextGaussian() * var8; + this.worldObj.spawnEntityInWorld(var7); + } + } + } + } + + super.setDead(); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.minecartContainerItems.length; ++var3) { + if (this.minecartContainerItems[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.minecartContainerItems[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + p_70014_1_.setTag("Items", var2); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + NBTTagList var2 = p_70037_1_.getTagList("Items", 10); + this.minecartContainerItems = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + int var5 = var4.getByte("Slot") & 255; + + if (var5 >= 0 && var5 < this.minecartContainerItems.length) { + this.minecartContainerItems[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + if (!this.worldObj.isClient) { + p_130002_1_.displayGUIChest(this); + } + + return true; + } + + protected void applyDrag() { + int var1 = 15 - Container.calcRedstoneFromInventory(this); + float var2 = 0.98F + (float)var1 * 0.001F; + this.motionX *= var2; + this.motionY *= 0.0D; + this.motionZ *= var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java new file mode 100644 index 0000000..b6d927d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -0,0 +1,37 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class EntityMinecartEmpty extends EntityMinecart { + + + public EntityMinecartEmpty(World p_i1722_1_) { + super(p_i1722_1_); + } + + public EntityMinecartEmpty(World p_i1723_1_, double p_i1723_2_, double p_i1723_4_, double p_i1723_6_) { + super(p_i1723_1_, p_i1723_2_, p_i1723_4_, p_i1723_6_); + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != p_130002_1_) { + return true; + } else if (this.riddenByEntity != null && this.riddenByEntity != p_130002_1_) { + return false; + } else { + if (!this.worldObj.isClient) { + p_130002_1_.mountEntity(this); + } + + return true; + } + } + + public int getMinecartType() { + return 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java new file mode 100644 index 0000000..2296b6a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartFurnace.java @@ -0,0 +1,164 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityMinecartFurnace extends EntityMinecart { + private int fuel; + public double pushX; + public double pushZ; + + + public EntityMinecartFurnace(World p_i1718_1_) { + super(p_i1718_1_); + } + + public EntityMinecartFurnace(World p_i1719_1_, double p_i1719_2_, double p_i1719_4_, double p_i1719_6_) { + super(p_i1719_1_, p_i1719_2_, p_i1719_4_, p_i1719_6_); + } + + public int getMinecartType() { + return 2; + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.fuel > 0) { + --this.fuel; + } + + if (this.fuel <= 0) { + this.pushX = this.pushZ = 0.0D; + } + + this.setMinecartPowered(this.fuel > 0); + + if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) { + this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); + } + } + + public void killMinecart(DamageSource p_94095_1_) { + super.killMinecart(p_94095_1_); + + if (!p_94095_1_.isExplosion()) { + this.entityDropItem(new ItemStack(Blocks.furnace, 1), 0.0F); + } + } + + protected void func_145821_a(int p_145821_1_, int p_145821_2_, int p_145821_3_, double p_145821_4_, double p_145821_6_, Block p_145821_8_, int p_145821_9_) { + super.func_145821_a(p_145821_1_, p_145821_2_, p_145821_3_, p_145821_4_, p_145821_6_, p_145821_8_, p_145821_9_); + double var10 = this.pushX * this.pushX + this.pushZ * this.pushZ; + + if (var10 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) { + var10 = MathHelper.sqrt_double(var10); + this.pushX /= var10; + this.pushZ /= var10; + + if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) { + this.pushX = 0.0D; + this.pushZ = 0.0D; + } else { + this.pushX = this.motionX; + this.pushZ = this.motionZ; + } + } + } + + protected void applyDrag() { + double var1 = this.pushX * this.pushX + this.pushZ * this.pushZ; + + if (var1 > 1.0E-4D) { + var1 = MathHelper.sqrt_double(var1); + this.pushX /= var1; + this.pushZ /= var1; + double var3 = 0.05D; + this.motionX *= 0.800000011920929D; + this.motionY *= 0.0D; + this.motionZ *= 0.800000011920929D; + this.motionX += this.pushX * var3; + this.motionZ += this.pushZ * var3; + } else { + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.0D; + this.motionZ *= 0.9800000190734863D; + } + + super.applyDrag(); + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + ItemStack var2 = p_130002_1_.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.coal) { + if (!p_130002_1_.capabilities.isCreativeMode && --var2.stackSize == 0) { + p_130002_1_.inventory.setInventorySlotContents(p_130002_1_.inventory.currentItem, null); + } + + this.fuel += 3600; + } + + this.pushX = this.posX - p_130002_1_.posX; + this.pushZ = this.posZ - p_130002_1_.posZ; + return true; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setDouble("PushX", this.pushX); + p_70014_1_.setDouble("PushZ", this.pushZ); + p_70014_1_.setShort("Fuel", (short)this.fuel); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.pushX = p_70037_1_.getDouble("PushX"); + this.pushZ = p_70037_1_.getDouble("PushZ"); + this.fuel = p_70037_1_.getShort("Fuel"); + } + + protected boolean isMinecartPowered() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + protected void setMinecartPowered(boolean p_94107_1_) { + if (p_94107_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) & -2))); + } + } + + public Block func_145817_o() { + return Blocks.lit_furnace; + } + + public int getDefaultDisplayTileData() { + return 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java new file mode 100644 index 0000000..e827b76 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java @@ -0,0 +1,180 @@ +package net.minecraft.entity.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.IHopper; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityMinecartHopper extends EntityMinecartContainer implements IHopper { + /** Whether this hopper minecart is being blocked by an activator rail. */ + private boolean isBlocked = true; + private int transferTicker = -1; + + + public EntityMinecartHopper(World p_i1720_1_) { + super(p_i1720_1_); + } + + public EntityMinecartHopper(World p_i1721_1_, double p_i1721_2_, double p_i1721_4_, double p_i1721_6_) { + super(p_i1721_1_, p_i1721_2_, p_i1721_4_, p_i1721_6_); + } + + public int getMinecartType() { + return 5; + } + + public Block func_145817_o() { + return Blocks.hopper; + } + + public int getDefaultDisplayTileOffset() { + return 1; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 5; + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer p_130002_1_) { + if (!this.worldObj.isClient) { + p_130002_1_.displayGUIHopperMinecart(this); + } + + return true; + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) { + boolean var5 = !p_96095_4_; + + if (var5 != this.getBlocked()) { + this.setBlocked(var5); + } + } + + /** + * Get whether this hopper minecart is being blocked by an activator rail. + */ + public boolean getBlocked() { + return this.isBlocked; + } + + /** + * Set whether this hopper minecart is being blocked by an activator rail. + */ + public void setBlocked(boolean p_96110_1_) { + this.isBlocked = p_96110_1_; + } + + /** + * Returns the worldObj for this tileEntity. + */ + public World getWorldObj() { + return this.worldObj; + } + + /** + * Gets the world X position for this hopper entity. + */ + public double getXPos() { + return this.posX; + } + + /** + * Gets the world Y position for this hopper entity. + */ + public double getYPos() { + return this.posY; + } + + /** + * Gets the world Z position for this hopper entity. + */ + public double getZPos() { + return this.posZ; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (!this.worldObj.isClient && this.isEntityAlive() && this.getBlocked()) { + --this.transferTicker; + + if (!this.canTransfer()) { + this.setTransferTicker(0); + + if (this.func_96112_aD()) { + this.setTransferTicker(4); + this.onInventoryChanged(); + } + } + } + } + + public boolean func_96112_aD() { + if (TileEntityHopper.func_145891_a(this)) { + return true; + } else { + List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything); + + if (var1.size() > 0) { + TileEntityHopper.func_145898_a(this, (EntityItem)var1.get(0)); + } + + return false; + } + } + + public void killMinecart(DamageSource p_94095_1_) { + super.killMinecart(p_94095_1_); + this.func_145778_a(Item.getItemFromBlock(Blocks.hopper), 1, 0.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("TransferCooldown", this.transferTicker); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.transferTicker = p_70037_1_.getInteger("TransferCooldown"); + } + + /** + * Sets the transfer ticker, used to determine the delay between transfers. + */ + public void setTransferTicker(int p_98042_1_) { + this.transferTicker = p_98042_1_; + } + + /** + * Returns whether the hopper cart can currently transfer an item. + */ + public boolean canTransfer() { + return this.transferTicker > 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java new file mode 100644 index 0000000..71aa8d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java @@ -0,0 +1,161 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockRailBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityMinecartTNT extends EntityMinecart { + private int minecartTNTFuse = -1; + + + public EntityMinecartTNT(World p_i1727_1_) { + super(p_i1727_1_); + } + + public EntityMinecartTNT(World p_i1728_1_, double p_i1728_2_, double p_i1728_4_, double p_i1728_6_) { + super(p_i1728_1_, p_i1728_2_, p_i1728_4_, p_i1728_6_); + } + + public int getMinecartType() { + return 3; + } + + public Block func_145817_o() { + return Blocks.tnt; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.minecartTNTFuse > 0) { + --this.minecartTNTFuse; + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + } else if (this.minecartTNTFuse == 0) { + this.explodeCart(this.motionX * this.motionX + this.motionZ * this.motionZ); + } + + if (this.isCollidedHorizontally) { + double var1 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (var1 >= 0.009999999776482582D) { + this.explodeCart(var1); + } + } + } + + public void killMinecart(DamageSource p_94095_1_) { + super.killMinecart(p_94095_1_); + double var2 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (!p_94095_1_.isExplosion()) { + this.entityDropItem(new ItemStack(Blocks.tnt, 1), 0.0F); + } + + if (p_94095_1_.isFireDamage() || p_94095_1_.isExplosion() || var2 >= 0.009999999776482582D) { + this.explodeCart(var2); + } + } + + /** + * Makes the minecart explode. + */ + protected void explodeCart(double p_94103_1_) { + if (!this.worldObj.isClient) { + double var3 = Math.sqrt(p_94103_1_); + + if (var3 > 5.0D) { + var3 = 5.0D; + } + + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.rand.nextDouble() * 1.5D * var3), true); + this.setDead(); + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + if (p_70069_1_ >= 3.0F) { + float var2 = p_70069_1_ / 10.0F; + this.explodeCart(var2 * var2); + } + + super.fall(p_70069_1_); + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) { + if (p_96095_4_ && this.minecartTNTFuse < 0) { + this.ignite(); + } + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 10) { + this.ignite(); + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Ignites this TNT cart. + */ + public void ignite() { + this.minecartTNTFuse = 80; + + if (!this.worldObj.isClient) { + this.worldObj.setEntityState(this, (byte)10); + this.worldObj.playSoundAtEntity(this, "game.tnt.primed", 1.0F, 1.0F); + } + } + + public int func_94104_d() { + return this.minecartTNTFuse; + } + + /** + * Returns true if the TNT minecart is ignited. + */ + public boolean isIgnited() { + return this.minecartTNTFuse > -1; + } + + public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_) { + return this.isIgnited() && (BlockRailBase.func_150051_a(p_145772_6_) || BlockRailBase.func_150049_b_(p_145772_2_, p_145772_3_, p_145772_4_ + 1, p_145772_5_)) ? 0.0F : super.func_145772_a(p_145772_1_, p_145772_2_, p_145772_3_, p_145772_4_, p_145772_5_, p_145772_6_); + } + + public boolean func_145774_a(Explosion p_145774_1_, World p_145774_2_, int p_145774_3_, int p_145774_4_, int p_145774_5_, Block p_145774_6_, float p_145774_7_) { + return (!this.isIgnited() || (!BlockRailBase.func_150051_a(p_145774_6_) && !BlockRailBase.func_150049_b_(p_145774_2_, p_145774_3_, p_145774_4_ + 1, p_145774_5_))) && super.func_145774_a(p_145774_1_, p_145774_2_, p_145774_3_, p_145774_4_, p_145774_5_, p_145774_6_, p_145774_7_); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + + if (p_70037_1_.func_150297_b("TNTFuse", 99)) { + this.minecartTNTFuse = p_70037_1_.getInteger("TNTFuse"); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("TNTFuse", this.minecartTNTFuse); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityPainting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityPainting.java new file mode 100644 index 0000000..d6f970f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityPainting.java @@ -0,0 +1,159 @@ +package net.minecraft.entity.item; + +import java.util.ArrayList; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class EntityPainting extends EntityHanging { + public EntityPainting.EnumArt art; + + + public EntityPainting(World p_i1599_1_) { + super(p_i1599_1_); + } + + public EntityPainting(World p_i1600_1_, int p_i1600_2_, int p_i1600_3_, int p_i1600_4_, int p_i1600_5_) { + super(p_i1600_1_, p_i1600_2_, p_i1600_3_, p_i1600_4_, p_i1600_5_); + ArrayList var6 = new ArrayList(); + EntityPainting.EnumArt[] var7 = EntityPainting.EnumArt.values(); + int var8 = var7.length; + + for (int var9 = 0; var9 < var8; ++var9) { + EntityPainting.EnumArt var10 = var7[var9]; + this.art = var10; + this.setDirection(p_i1600_5_); + + if (this.onValidSurface()) { + var6.add(var10); + } + } + + if (!var6.isEmpty()) { + this.art = (EntityPainting.EnumArt)var6.get(this.rand.nextInt(var6.size())); + } + + this.setDirection(p_i1600_5_); + } + + public EntityPainting(World p_i1601_1_, int p_i1601_2_, int p_i1601_3_, int p_i1601_4_, int p_i1601_5_, String p_i1601_6_) { + this(p_i1601_1_, p_i1601_2_, p_i1601_3_, p_i1601_4_, p_i1601_5_); + EntityPainting.EnumArt[] var7 = EntityPainting.EnumArt.values(); + int var8 = var7.length; + + for (int var9 = 0; var9 < var8; ++var9) { + EntityPainting.EnumArt var10 = var7[var9]; + + if (var10.title.equals(p_i1601_6_)) { + this.art = var10; + break; + } + } + + this.setDirection(p_i1601_5_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setString("Motive", this.art.title); + super.writeEntityToNBT(p_70014_1_); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + String var2 = p_70037_1_.getString("Motive"); + EntityPainting.EnumArt[] var3 = EntityPainting.EnumArt.values(); + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + EntityPainting.EnumArt var6 = var3[var5]; + + if (var6.title.equals(var2)) { + this.art = var6; + } + } + + if (this.art == null) { + this.art = EntityPainting.EnumArt.Kebab; + } + + super.readEntityFromNBT(p_70037_1_); + } + + public int getWidthPixels() { + return this.art.sizeX; + } + + public int getHeightPixels() { + return this.art.sizeY; + } + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity p_110128_1_) { + if (p_110128_1_ instanceof EntityPlayer) { + EntityPlayer var2 = (EntityPlayer)p_110128_1_; + + if (var2.capabilities.isCreativeMode) { + return; + } + } + + this.entityDropItem(new ItemStack(Items.painting), 0.0F); + } + + public enum EnumArt { + Kebab("Kebab", 0, "Kebab", 16, 16, 0, 0), + Aztec("Aztec", 1, "Aztec", 16, 16, 16, 0), + Alban("Alban", 2, "Alban", 16, 16, 32, 0), + Aztec2("Aztec2", 3, "Aztec2", 16, 16, 48, 0), + Bomb("Bomb", 4, "Bomb", 16, 16, 64, 0), + Plant("Plant", 5, "Plant", 16, 16, 80, 0), + Wasteland("Wasteland", 6, "Wasteland", 16, 16, 96, 0), + Pool("Pool", 7, "Pool", 32, 16, 0, 32), + Courbet("Courbet", 8, "Courbet", 32, 16, 32, 32), + Sea("Sea", 9, "Sea", 32, 16, 64, 32), + Sunset("Sunset", 10, "Sunset", 32, 16, 96, 32), + Creebet("Creebet", 11, "Creebet", 32, 16, 128, 32), + Wanderer("Wanderer", 12, "Wanderer", 16, 32, 0, 64), + Graham("Graham", 13, "Graham", 16, 32, 16, 64), + Match("Match", 14, "Match", 32, 32, 0, 128), + Bust("Bust", 15, "Bust", 32, 32, 32, 128), + Stage("Stage", 16, "Stage", 32, 32, 64, 128), + Void("Void", 17, "Void", 32, 32, 96, 128), + SkullAndRoses("SkullAndRoses", 18, "SkullAndRoses", 32, 32, 128, 128), + Wither("Wither", 19, "Wither", 32, 32, 160, 128), + Fighters("Fighters", 20, "Fighters", 64, 32, 0, 96), + Pointer("Pointer", 21, "Pointer", 64, 64, 0, 192), + Pigscene("Pigscene", 22, "Pigscene", 64, 64, 64, 192), + BurningSkull("BurningSkull", 23, "BurningSkull", 64, 64, 128, 192), + Skeleton("Skeleton", 24, "Skeleton", 64, 48, 192, 64), + DonkeyKong("DonkeyKong", 25, "DonkeyKong", 64, 48, 192, 112); + public static final int maxArtTitleLength = "SkullAndRoses".length(); + public final String title; + public final int sizeX; + public final int sizeY; + public final int offsetX; + public final int offsetY; + + private static final EntityPainting.EnumArt[] $VALUES = new EntityPainting.EnumArt[]{Kebab, Aztec, Alban, Aztec2, Bomb, Plant, Wasteland, Pool, Courbet, Sea, Sunset, Creebet, Wanderer, Graham, Match, Bust, Stage, Void, SkullAndRoses, Wither, Fighters, Pointer, Pigscene, BurningSkull, Skeleton, DonkeyKong}; + + + EnumArt(String p_i1598_1_, int p_i1598_2_, String p_i1598_3_, int p_i1598_4_, int p_i1598_5_, int p_i1598_6_, int p_i1598_7_) { + this.title = p_i1598_3_; + this.sizeX = p_i1598_4_; + this.sizeY = p_i1598_5_; + this.offsetX = p_i1598_6_; + this.offsetY = p_i1598_7_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java new file mode 100644 index 0000000..560b628 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java @@ -0,0 +1,111 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class EntityTNTPrimed extends Entity { + /** How long the fuse is */ + public int fuse; + private EntityLivingBase tntPlacedBy; + + + public EntityTNTPrimed(World p_i1729_1_) { + super(p_i1729_1_); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; + } + + public EntityTNTPrimed(World p_i1730_1_, double p_i1730_2_, double p_i1730_4_, double p_i1730_6_, EntityLivingBase p_i1730_8_) { + this(p_i1730_1_); + this.setPosition(p_i1730_2_, p_i1730_4_, p_i1730_6_); + float var9 = (float)(Math.random() * Math.PI * 2.0D); + this.motionX = -((float)Math.sin(var9)) * 0.02F; + this.motionY = 0.20000000298023224D; + this.motionZ = -((float)Math.cos(var9)) * 0.02F; + this.fuse = 80; + this.prevPosX = p_i1730_2_; + this.prevPosY = p_i1730_4_; + this.prevPosZ = p_i1730_6_; + this.tntPlacedBy = p_i1730_8_; + } + + protected void entityInit() {} + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.onGround) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + } + + if (this.fuse-- <= 0) { + this.setDead(); + + if (!this.worldObj.isClient) { + this.explode(); + } + } else { + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + } + } + + private void explode() { + float var1 = 4.0F; + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, var1, true); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setByte("Fuse", (byte)this.fuse); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.fuse = p_70037_1_.getByte("Fuse"); + } + + public float getShadowSize() { + return 0.0F; + } + + /** + * returns null or the entityliving it was placed or ignited by + */ + public EntityLivingBase getTntPlacedBy() { + return this.tntPlacedBy; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityXPOrb.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityXPOrb.java new file mode 100644 index 0000000..eb8654f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/item/EntityXPOrb.java @@ -0,0 +1,250 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityXPOrb extends Entity { + /** + * A constantly increasing value that RenderXPOrb uses to control the colour shifting (Green / yellow) + */ + public int xpColor; + + /** The age of the XP orb in ticks. */ + public int xpOrbAge; + public int field_70532_c; + + /** The health of this XP orb. */ + private int xpOrbHealth = 5; + + /** This is how much XP this orb has. */ + private int xpValue; + + /** The closest EntityPlayer to this orb. */ + private EntityPlayer closestPlayer; + + /** Threshold color for tracking players */ + private int xpTargetColor; + + + public EntityXPOrb(World p_i1585_1_, double p_i1585_2_, double p_i1585_4_, double p_i1585_6_, int p_i1585_8_) { + super(p_i1585_1_); + this.setSize(0.5F, 0.5F); + this.yOffset = this.height / 2.0F; + this.setPosition(p_i1585_2_, p_i1585_4_, p_i1585_6_); + this.rotationYaw = (float)(Math.random() * 360.0D); + this.motionX = (float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F; + this.motionY = (float)(Math.random() * 0.2D) * 2.0F; + this.motionZ = (float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F; + this.xpValue = p_i1585_8_; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public EntityXPOrb(World p_i1586_1_) { + super(p_i1586_1_); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; + } + + protected void entityInit() {} + + public int getBrightnessForRender(float p_70070_1_) { + float var2 = 0.5F; + + if (var2 < 0.0F) { + var2 = 0.0F; + } + + if (var2 > 1.0F) { + var2 = 1.0F; + } + + int var3 = super.getBrightnessForRender(p_70070_1_); + int var4 = var3 & 255; + int var5 = var3 >> 16 & 255; + var4 += (int)(var2 * 15.0F * 16.0F); + + if (var4 > 240) { + var4 = 240; + } + + return var4 | var5 << 16; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.field_70532_c > 0) { + --this.field_70532_c; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.029999999329447746D; + + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() == Material.lava) { + this.motionY = 0.20000000298023224D; + this.motionX = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; + this.motionZ = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F; + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + double var1 = 8.0D; + + if (this.xpTargetColor < this.xpColor - 20 + this.getEntityId() % 100) { + if (this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > var1 * var1) { + this.closestPlayer = this.worldObj.getClosestPlayerToEntity(this, var1); + } + + this.xpTargetColor = this.xpColor; + } + + if (this.closestPlayer != null) { + double var3 = (this.closestPlayer.posX - this.posX) / var1; + double var5 = (this.closestPlayer.posY + (double)this.closestPlayer.getEyeHeight() - this.posY) / var1; + double var7 = (this.closestPlayer.posZ - this.posZ) / var1; + double var9 = Math.sqrt(var3 * var3 + var5 * var5 + var7 * var7); + double var11 = 1.0D - var9; + + if (var11 > 0.0D) { + var11 *= var11; + this.motionX += var3 / var9 * var11 * 0.1D; + this.motionY += var5 / var9 * var11 * 0.1D; + this.motionZ += var7 / var9 * var11 * 0.1D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float var13 = 0.98F; + + if (this.onGround) { + var13 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.98F; + } + + this.motionX *= var13; + this.motionY *= 0.9800000190734863D; + this.motionZ *= var13; + + if (this.onGround) { + this.motionY *= -0.8999999761581421D; + } + + ++this.xpColor; + ++this.xpOrbAge; + + if (this.xpOrbAge >= 6000) { + this.setDead(); + } + } + + /** + * Returns if this entity is in water and will end up adding the waters velocity to the entity + */ + public boolean handleWaterMovement() { + return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); + } + + /** + * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: + * amountDamage + */ + protected void dealFireDamage(int p_70081_1_) { + this.attackEntityFrom(DamageSource.inFire, (float)p_70081_1_); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + this.setBeenAttacked(); + this.xpOrbHealth = (int)((float)this.xpOrbHealth - p_70097_2_); + + if (this.xpOrbHealth <= 0) { + this.setDead(); + } + + return false; + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("Health", (byte)this.xpOrbHealth); + p_70014_1_.setShort("Age", (short)this.xpOrbAge); + p_70014_1_.setShort("Value", (short)this.xpValue); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.xpOrbHealth = p_70037_1_.getShort("Health") & 255; + this.xpOrbAge = p_70037_1_.getShort("Age"); + this.xpValue = p_70037_1_.getShort("Value"); + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer p_70100_1_) { + if (!this.worldObj.isClient) { + if (this.field_70532_c == 0 && p_70100_1_.xpCooldown == 0) { + p_70100_1_.xpCooldown = 2; + this.worldObj.playSoundAtEntity(p_70100_1_, "random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); + p_70100_1_.onItemPickup(this, 1); + p_70100_1_.addExperience(this.xpValue); + this.setDead(); + } + } + } + + /** + * Returns the XP value of this XP orb. + */ + public int getXpValue() { + return this.xpValue; + } + + /** + * Returns a number from 1 to 10 based on how much XP this orb is worth. This is used by RenderXPOrb to determine + * what texture to use. + */ + public int getTextureByXP() { + return this.xpValue >= 2477 ? 10 : (this.xpValue >= 1237 ? 9 : (this.xpValue >= 617 ? 8 : (this.xpValue >= 307 ? 7 : (this.xpValue >= 149 ? 6 : (this.xpValue >= 73 ? 5 : (this.xpValue >= 37 ? 4 : (this.xpValue >= 17 ? 3 : (this.xpValue >= 7 ? 2 : (this.xpValue >= 3 ? 1 : 0))))))))); + } + + /** + * Get a fragment of the maximum experience points value for the supplied value of experience points value. + */ + public static int getXPSplit(int p_70527_0_) { + return p_70527_0_ >= 2477 ? 2477 : (p_70527_0_ >= 1237 ? 1237 : (p_70527_0_ >= 617 ? 617 : (p_70527_0_ >= 307 ? 307 : (p_70527_0_ >= 149 ? 149 : (p_70527_0_ >= 73 ? 73 : (p_70527_0_ >= 37 ? 37 : (p_70527_0_ >= 17 ? 17 : (p_70527_0_ >= 7 ? 7 : (p_70527_0_ >= 3 ? 3 : 1))))))))); + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityBlaze.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityBlaze.java new file mode 100644 index 0000000..d3e3d00 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityBlaze.java @@ -0,0 +1,201 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBlaze extends EntityMob { + /** Random offset used in floating behaviour */ + private float heightOffset = 0.5F; + + /** ticks until heightOffset is randomized */ + private int heightOffsetUpdateTime; + private int field_70846_g; + + + public EntityBlaze(World p_i1731_1_) { + super(p_i1731_1_); + this.isImmuneToFire = true; + this.experienceValue = 10; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.blaze.breathe"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.blaze.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.blaze.death"; + } + + public int getBrightnessForRender(float p_70070_1_) { + return 15728880; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return 1.0F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (!this.worldObj.isClient) { + if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + --this.heightOffsetUpdateTime; + + if (this.heightOffsetUpdateTime <= 0) { + this.heightOffsetUpdateTime = 100; + this.heightOffset = 0.5F + (float)this.rand.nextGaussian() * 3.0F; + } + + if (this.getEntityToAttack() != null && this.getEntityToAttack().posY + (double)this.getEntityToAttack().getEyeHeight() > this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) { + this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D; + } + } + + if (this.rand.nextInt(24) == 0) { + this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F); + } + + if (!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + + for (int var1 = 0; var1 < 2; ++var1) { + this.worldObj.spawnParticle("largesmoke", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D); + } + + super.onLivingUpdate(); + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) { + if (this.attackTime <= 0 && p_70785_2_ < 2.0F && p_70785_1_.boundingBox.maxY > this.boundingBox.minY && p_70785_1_.boundingBox.minY < this.boundingBox.maxY) { + this.attackTime = 20; + this.attackEntityAsMob(p_70785_1_); + } else if (p_70785_2_ < 30.0F) { + double var3 = p_70785_1_.posX - this.posX; + double var5 = p_70785_1_.boundingBox.minY + (double)(p_70785_1_.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); + double var7 = p_70785_1_.posZ - this.posZ; + + if (this.attackTime == 0) { + ++this.field_70846_g; + + if (this.field_70846_g == 1) { + this.attackTime = 60; + this.func_70844_e(true); + } else if (this.field_70846_g <= 4) { + this.attackTime = 6; + } else { + this.attackTime = 100; + this.field_70846_g = 0; + this.func_70844_e(false); + } + + if (this.field_70846_g > 1) { + float var9 = MathHelper.sqrt_float(p_70785_2_) * 0.5F; + this.worldObj.playAuxSFXAtEntity(null, 1009, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + + for (int var10 = 0; var10 < 1; ++var10) { + EntitySmallFireball var11 = new EntitySmallFireball(this.worldObj, this, var3 + this.rand.nextGaussian() * (double)var9, var5, var7 + this.rand.nextGaussian() * (double)var9); + var11.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; + this.worldObj.spawnEntityInWorld(var11); + } + } + } + + this.rotationYaw = (float)(Math.atan2(var7, var3) * 180.0D / Math.PI) - 90.0F; + this.hasAttacked = true; + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + protected Item func_146068_u() { + return Items.blaze_rod; + } + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() { + return this.func_70845_n(); + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + if (p_70628_1_) { + int var3 = this.rand.nextInt(2 + p_70628_2_); + + for (int var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.blaze_rod, 1); + } + } + } + + public boolean func_70845_n() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void func_70844_e(boolean p_70844_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70844_1_) { + var2 = (byte)(var2 | 1); + } else { + var2 &= -2; + } + + this.dataWatcher.updateObject(16, Byte.valueOf(var2)); + } + + /** + * Checks to make sure the light is not too bright where the mob is spawning + */ + protected boolean isValidLightLevel() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java new file mode 100644 index 0000000..f7588d9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityCaveSpider.java @@ -0,0 +1,50 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityCaveSpider extends EntitySpider { + + + public EntityCaveSpider(World p_i1732_1_) { + super(p_i1732_1_); + this.setSize(0.7F, 0.5F); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(12.0D); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + if (super.attackEntityAsMob(p_70652_1_)) { + if (p_70652_1_ instanceof EntityLivingBase) { + byte var2 = 0; + + if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL) { + var2 = 7; + } else if (this.worldObj.difficultySetting == EnumDifficulty.HARD) { + var2 = 15; + } + + if (var2 > 0) { + ((EntityLivingBase)p_70652_1_).addPotionEffect(new PotionEffect(Potion.poison.id, var2 * 20, 0)); + } + } + + return true; + } else { + return false; + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + return p_110161_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityCreeper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityCreeper.java new file mode 100644 index 0000000..f50f227 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityCreeper.java @@ -0,0 +1,272 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAICreeperSwell; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityCreeper extends EntityMob { + /** + * Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go + * weird) + */ + private int lastActiveTime; + + /** + * The amount of time since the creeper was close enough to the player to ignite + */ + private int timeSinceIgnited; + private int fuseTime = 30; + + /** Explosion radius for this creeper. */ + private int explosionRadius = 3; + + + public EntityCreeper(World p_i1733_1_) { + super(p_i1733_1_); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAICreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + /** + * The number of iterations PathFinder.getSafePoint will execute before giving up. + */ + public int getMaxSafePointTries() { + return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + super.fall(p_70069_1_); + this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + p_70069_1_ * 1.5F); + + if (this.timeSinceIgnited > this.fuseTime - 5) { + this.timeSinceIgnited = this.fuseTime - 5; + } + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1)); + this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + + if (this.dataWatcher.getWatchableObjectByte(17) == 1) { + p_70014_1_.setBoolean("powered", true); + } + + p_70014_1_.setShort("Fuse", (short)this.fuseTime); + p_70014_1_.setByte("ExplosionRadius", (byte)this.explosionRadius); + p_70014_1_.setBoolean("ignited", this.func_146078_ca()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.dataWatcher.updateObject(17, Byte.valueOf((byte)(p_70037_1_.getBoolean("powered") ? 1 : 0))); + + if (p_70037_1_.func_150297_b("Fuse", 99)) { + this.fuseTime = p_70037_1_.getShort("Fuse"); + } + + if (p_70037_1_.func_150297_b("ExplosionRadius", 99)) { + this.explosionRadius = p_70037_1_.getByte("ExplosionRadius"); + } + + if (p_70037_1_.getBoolean("ignited")) { + this.func_146079_cb(); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.isEntityAlive()) { + this.lastActiveTime = this.timeSinceIgnited; + + if (this.func_146078_ca()) { + this.setCreeperState(1); + } + + int var1 = this.getCreeperState(); + + if (var1 > 0 && this.timeSinceIgnited == 0) { + this.playSound("creeper.primed", 1.0F, 0.5F); + } + + this.timeSinceIgnited += var1; + + if (this.timeSinceIgnited < 0) { + this.timeSinceIgnited = 0; + } + + if (this.timeSinceIgnited >= this.fuseTime) { + this.timeSinceIgnited = this.fuseTime; + this.func_146077_cc(); + } + } + + super.onUpdate(); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.creeper.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.creeper.death"; + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + super.onDeath(p_70645_1_); + + if (p_70645_1_.getEntity() instanceof EntitySkeleton) { + int var2 = Item.getIdFromItem(Items.record_13); + int var3 = Item.getIdFromItem(Items.record_wait); + int var4 = var2 + this.rand.nextInt(var3 - var2 + 1); + this.func_145779_a(Item.getItemById(var4), 1); + } + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + return true; + } + + /** + * Returns true if the creeper is powered by a lightning bolt. + */ + public boolean getPowered() { + return this.dataWatcher.getWatchableObjectByte(17) == 1; + } + + /** + * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited. + */ + public float getCreeperFlashIntensity(float p_70831_1_) { + return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float)(this.fuseTime - 2); + } + + protected Item func_146068_u() { + return Items.gunpowder; + } + + /** + * Returns the current state of creeper, -1 is idle, 1 is 'in fuse' + */ + public int getCreeperState() { + return this.dataWatcher.getWatchableObjectByte(16); + } + + /** + * Sets the state of creeper, -1 to idle and 1 to be 'in fuse' + */ + public void setCreeperState(int p_70829_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)p_70829_1_)); + } + + /** + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt p_70077_1_) { + super.onStruckByLightning(p_70077_1_); + this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.flint_and_steel) { + this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + p_70085_1_.swingItem(); + + if (!this.worldObj.isClient) { + this.func_146079_cb(); + var2.damageItem(1, p_70085_1_); + return true; + } + } + + return super.interact(p_70085_1_); + } + + private void func_146077_cc() { + if (!this.worldObj.isClient) { + boolean var1 = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); + + if (this.getPowered()) { + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(this.explosionRadius * 2), var1); + } else { + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, var1); + } + + this.setDead(); + } + } + + public boolean func_146078_ca() { + return this.dataWatcher.getWatchableObjectByte(18) != 0; + } + + public void func_146079_cb() { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)1)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityEnderman.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityEnderman.java new file mode 100644 index 0000000..8a586f0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityEnderman.java @@ -0,0 +1,429 @@ +package net.minecraft.entity.monster; + +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityEnderman extends EntityMob { + private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); + private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", 6.199999809265137D, 0)).setSaved(false); + private static final boolean[] carriableBlocks = new boolean[256]; + + /** + * Counter to delay the teleportation of an enderman towards the currently attacked target + */ + private int teleportDelay; + + /** + * A player must stare at an enderman for 5 ticks before it becomes aggressive. This field counts those ticks. + */ + private int stareTimer; + private Entity lastEntityToAttack; + private boolean isAggressive; + + + public EntityEnderman(World p_i1734_1_) { + super(p_i1734_1_); + this.setSize(0.6F, 2.9F); + this.stepHeight = 1.0F; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(7.0D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + this.dataWatcher.addObject(17, new Byte((byte)0)); + this.dataWatcher.addObject(18, new Byte((byte)0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setShort("carried", (short)Block.getIdFromBlock(this.func_146080_bZ())); + p_70014_1_.setShort("carriedData", (short)this.getCarryingData()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.func_146081_a(Block.getBlockById(p_70037_1_.getShort("carried"))); + this.setCarryingData(p_70037_1_.getShort("carriedData")); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() { + EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D); + + if (var1 != null) { + if (this.shouldAttackPlayer(var1)) { + this.isAggressive = true; + + if (this.stareTimer == 0) { + this.worldObj.playSoundEffect(var1.posX, var1.posY, var1.posZ, "mob.endermen.stare", 1.0F, 1.0F); + } + + if (this.stareTimer++ == 5) { + this.stareTimer = 0; + this.setScreaming(true); + return var1; + } + } else { + this.stareTimer = 0; + } + } + + return null; + } + + /** + * Checks to see if this enderman should be attacking this player + */ + private boolean shouldAttackPlayer(EntityPlayer p_70821_1_) { + ItemStack var2 = p_70821_1_.inventory.armorInventory[3]; + + if (var2 != null && var2.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) { + return false; + } else { + Vec3 var3 = p_70821_1_.getLook(1.0F).normalize(); + Vec3 var4 = Vec3.createVectorHelper(this.posX - p_70821_1_.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (p_70821_1_.posY + (double)p_70821_1_.getEyeHeight()), this.posZ - p_70821_1_.posZ); + double var5 = var4.lengthVector(); + var4 = var4.normalize(); + double var7 = var3.dotProduct(var4); + return var7 > 1.0D - 0.025D / var5 && p_70821_1_.canEntityBeSeen(this); + } + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.lastEntityToAttack != this.entityToAttack) { + IAttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var1.removeModifier(attackingSpeedBoostModifier); + + if (this.entityToAttack != null) { + var1.applyModifier(attackingSpeedBoostModifier); + } + } + + this.lastEntityToAttack = this.entityToAttack; + int var6; + + if (!this.worldObj.isClient && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + int var2; + int var3; + Block var4; + + if (this.func_146080_bZ().getMaterial() == Material.air) { + if (this.rand.nextInt(20) == 0) { + var6 = MathHelper.floor_double(this.posX - 2.0D + this.rand.nextDouble() * 4.0D); + var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 3.0D); + var3 = MathHelper.floor_double(this.posZ - 2.0D + this.rand.nextDouble() * 4.0D); + var4 = this.worldObj.getBlock(var6, var2, var3); + + if (carriableBlocks[Block.getIdFromBlock(var4)]) { + this.func_146081_a(var4); + this.setCarryingData(this.worldObj.getBlockMetadata(var6, var2, var3)); + this.worldObj.setBlock(var6, var2, var3, Blocks.air); + } + } + } else if (this.rand.nextInt(2000) == 0) { + var6 = MathHelper.floor_double(this.posX - 1.0D + this.rand.nextDouble() * 2.0D); + var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 2.0D); + var3 = MathHelper.floor_double(this.posZ - 1.0D + this.rand.nextDouble() * 2.0D); + var4 = this.worldObj.getBlock(var6, var2, var3); + Block var5 = this.worldObj.getBlock(var6, var2 - 1, var3); + + if (var4.getMaterial() == Material.air && var5.getMaterial() != Material.air && var5.renderAsNormalBlock()) { + this.worldObj.setBlock(var6, var2, var3, this.func_146080_bZ(), this.getCarryingData(), 3); + this.func_146081_a(Blocks.air); + } + } + } + + for (var6 = 0; var6 < 2; ++var6) { + this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D); + } + + if (this.worldObj.isDaytime() && !this.worldObj.isClient) { + float var7 = this.getBrightness(1.0F); + + if (var7 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (var7 - 0.4F) * 2.0F) { + this.entityToAttack = null; + this.setScreaming(false); + this.isAggressive = false; + this.teleportRandomly(); + } + } + + if (this.isWet() || this.isBurning()) { + this.entityToAttack = null; + this.setScreaming(false); + this.isAggressive = false; + this.teleportRandomly(); + } + + if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) { + this.setScreaming(false); + } + + this.isJumping = false; + + if (this.entityToAttack != null) { + this.faceEntity(this.entityToAttack, 100.0F, 100.0F); + } + + if (!this.worldObj.isClient && this.isEntityAlive()) { + if (this.entityToAttack != null) { + if (this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) { + if (this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) { + this.teleportRandomly(); + } + + this.teleportDelay = 0; + } else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) { + this.teleportDelay = 0; + } + } else { + this.setScreaming(false); + this.teleportDelay = 0; + } + } + + super.onLivingUpdate(); + } + + /** + * Teleport the enderman to a random nearby position + */ + protected boolean teleportRandomly() { + double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D; + double var3 = this.posY + (double)(this.rand.nextInt(64) - 32); + double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D; + return this.teleportTo(var1, var3, var5); + } + + /** + * Teleport the enderman to another entity + */ + protected boolean teleportToEntity(Entity p_70816_1_) { + Vec3 var2 = Vec3.createVectorHelper(this.posX - p_70816_1_.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - p_70816_1_.posY + (double)p_70816_1_.getEyeHeight(), this.posZ - p_70816_1_.posZ); + var2 = var2.normalize(); + double var3 = 16.0D; + double var5 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.xCoord * var3; + double var7 = this.posY + (double)(this.rand.nextInt(16) - 8) - var2.yCoord * var3; + double var9 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.zCoord * var3; + return this.teleportTo(var5, var7, var9); + } + + /** + * Teleport the enderman + */ + protected boolean teleportTo(double p_70825_1_, double p_70825_3_, double p_70825_5_) { + double var7 = this.posX; + double var9 = this.posY; + double var11 = this.posZ; + this.posX = p_70825_1_; + this.posY = p_70825_3_; + this.posZ = p_70825_5_; + boolean var13 = false; + int var14 = MathHelper.floor_double(this.posX); + int var15 = MathHelper.floor_double(this.posY); + int var16 = MathHelper.floor_double(this.posZ); + + if (this.worldObj.blockExists(var14, var15, var16)) { + boolean var17 = false; + + while (!var17 && var15 > 0) { + Block var18 = this.worldObj.getBlock(var14, var15 - 1, var16); + + if (var18.getMaterial().blocksMovement()) { + var17 = true; + } else { + --this.posY; + --var15; + } + } + + if (var17) { + this.setPosition(this.posX, this.posY, this.posZ); + + if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { + var13 = true; + } + } + } + + if (!var13) { + this.setPosition(var7, var9, var11); + return false; + } else { + short var30 = 128; + + for (int var31 = 0; var31 < var30; ++var31) { + double var19 = (double)var31 / ((double)var30 - 1.0D); + float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; + float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; + float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; + double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; + double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * (double)this.height; + double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; + this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); + } + + this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); + this.playSound("mob.endermen.portal", 1.0F, 1.0F); + return true; + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.endermen.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.endermen.death"; + } + + protected Item func_146068_u() { + return Items.ender_pearl; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + Item var3 = this.func_146068_u(); + + if (var3 != null) { + int var4 = this.rand.nextInt(2 + p_70628_2_); + + for (int var5 = 0; var5 < var4; ++var5) { + this.func_145779_a(var3, 1); + } + } + } + + public void func_146081_a(Block p_146081_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(Block.getIdFromBlock(p_146081_1_) & 255))); + } + + public Block func_146080_bZ() { + return Block.getBlockById(this.dataWatcher.getWatchableObjectByte(16)); + } + + /** + * Set the metadata of the block an enderman carries + */ + public void setCarryingData(int p_70817_1_) { + this.dataWatcher.updateObject(17, Byte.valueOf((byte)(p_70817_1_ & 255))); + } + + /** + * Get the metadata of the block an enderman carries + */ + public int getCarryingData() { + return this.dataWatcher.getWatchableObjectByte(17); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + this.setScreaming(true); + + if (p_70097_1_ instanceof EntityDamageSource && p_70097_1_.getEntity() instanceof EntityPlayer) { + this.isAggressive = true; + } + + if (p_70097_1_ instanceof EntityDamageSourceIndirect) { + this.isAggressive = false; + + for (int var3 = 0; var3 < 64; ++var3) { + if (this.teleportRandomly()) { + return true; + } + } + + return false; + } else { + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + } + + public boolean isScreaming() { + return this.dataWatcher.getWatchableObjectByte(18) > 0; + } + + public void setScreaming(boolean p_70819_1_) { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)(p_70819_1_ ? 1 : 0))); + } + + static { + carriableBlocks[Block.getIdFromBlock(Blocks.grass)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.dirt)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.sand)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.gravel)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.yellow_flower)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.red_flower)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.brown_mushroom)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.red_mushroom)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.tnt)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.cactus)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.clay)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.pumpkin)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.melon_block)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.mycelium)] = true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGhast.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGhast.java new file mode 100644 index 0000000..564124d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGhast.java @@ -0,0 +1,266 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityGhast extends EntityFlying implements IMob { + public int courseChangeCooldown; + public double waypointX; + public double waypointY; + public double waypointZ; + private Entity targetedEntity; + + /** Cooldown time between target loss and new target aquirement. */ + private int aggroCooldown; + public int prevAttackCounter; + public int attackCounter; + + /** The explosion radius of spawned fireballs. */ + private int explosionStrength = 1; + + + public EntityGhast(World p_i1735_1_) { + super(p_i1735_1_); + this.setSize(4.0F, 4.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; + } + + public boolean func_110182_bF() { + return this.dataWatcher.getWatchableObjectByte(16) != 0; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if ("fireball".equals(p_70097_1_.getDamageType()) && p_70097_1_.getEntity() instanceof EntityPlayer) { + super.attackEntityFrom(p_70097_1_, 1000.0F); + ((EntityPlayer)p_70097_1_.getEntity()).triggerAchievement(AchievementList.ghast); + return true; + } else { + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + } + + protected void updateEntityActionState() { + if (!this.worldObj.isClient && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) { + this.setDead(); + } + + this.despawnEntity(); + this.prevAttackCounter = this.attackCounter; + double var1 = this.waypointX - this.posX; + double var3 = this.waypointY - this.posY; + double var5 = this.waypointZ - this.posZ; + double var7 = var1 * var1 + var3 * var3 + var5 * var5; + + if (var7 < 1.0D || var7 > 3600.0D) { + this.waypointX = this.posX + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + + if (this.courseChangeCooldown-- <= 0) { + this.courseChangeCooldown += this.rand.nextInt(5) + 2; + var7 = MathHelper.sqrt_double(var7); + + if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, var7)) { + this.motionX += var1 / var7 * 0.1D; + this.motionY += var3 / var7 * 0.1D; + this.motionZ += var5 / var7 * 0.1D; + } else { + this.waypointX = this.posX; + this.waypointY = this.posY; + this.waypointZ = this.posZ; + } + } + + if (this.targetedEntity != null && this.targetedEntity.isDead) { + this.targetedEntity = null; + } + + if (this.targetedEntity == null || this.aggroCooldown-- <= 0) { + this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); + + if (this.targetedEntity != null) { + this.aggroCooldown = 20; + } + } + + double var9 = 64.0D; + + if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9) { + double var11 = this.targetedEntity.posX - this.posX; + double var13 = this.targetedEntity.boundingBox.minY + (double)(this.targetedEntity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); + double var15 = this.targetedEntity.posZ - this.posZ; + this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(var11, var15)) * 180.0F / (float)Math.PI; + + if (this.canEntityBeSeen(this.targetedEntity)) { + if (this.attackCounter == 10) { + this.worldObj.playAuxSFXAtEntity(null, 1007, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + ++this.attackCounter; + + if (this.attackCounter == 20) { + this.worldObj.playAuxSFXAtEntity(null, 1008, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + EntityLargeFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); + var17.field_92057_e = this.explosionStrength; + double var18 = 4.0D; + Vec3 var20 = this.getLook(1.0F); + var17.posX = this.posX + var20.xCoord * var18; + var17.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; + var17.posZ = this.posZ + var20.zCoord * var18; + this.worldObj.spawnEntityInWorld(var17); + this.attackCounter = -40; + } + } else if (this.attackCounter > 0) { + --this.attackCounter; + } + } else { + this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI; + + if (this.attackCounter > 0) { + --this.attackCounter; + } + } + + if (!this.worldObj.isClient) { + byte var21 = this.dataWatcher.getWatchableObjectByte(16); + byte var12 = (byte)(this.attackCounter > 10 ? 1 : 0); + + if (var21 != var12) { + this.dataWatcher.updateObject(16, Byte.valueOf(var12)); + } + } + } + + /** + * True if the ghast has an unobstructed line of travel to the waypoint. + */ + private boolean isCourseTraversable(double p_70790_1_, double p_70790_3_, double p_70790_5_, double p_70790_7_) { + double var9 = (this.waypointX - this.posX) / p_70790_7_; + double var11 = (this.waypointY - this.posY) / p_70790_7_; + double var13 = (this.waypointZ - this.posZ) / p_70790_7_; + AxisAlignedBB var15 = this.boundingBox.copy(); + + for (int var16 = 1; (double)var16 < p_70790_7_; ++var16) { + var15.offset(var9, var11, var13); + + if (!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty()) { + return false; + } + } + + return true; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.ghast.moan"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.ghast.scream"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.ghast.death"; + } + + protected Item func_146068_u() { + return Items.gunpowder; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + p_70628_2_); + int var4; + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.ghast_tear, 1); + } + + var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.gunpowder, 1); + } + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 10.0F; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL; + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 1; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("ExplosionPower", this.explosionStrength); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + + if (p_70037_1_.func_150297_b("ExplosionPower", 99)) { + this.explosionStrength = p_70037_1_.getInteger("ExplosionPower"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java new file mode 100644 index 0000000..2a6437c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGiantZombie.java @@ -0,0 +1,29 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.world.World; + +public class EntityGiantZombie extends EntityMob { + + + public EntityGiantZombie(World p_i1736_1_) { + super(p_i1736_1_); + this.yOffset *= 6.0F; + this.setSize(this.width * 6.0F, this.height * 6.0F); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50.0D); + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) { + return this.worldObj.getLightBrightness(p_70783_1_, p_70783_2_, p_70783_3_) - 0.5F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGolem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGolem.java new file mode 100644 index 0000000..5484371 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityGolem.java @@ -0,0 +1,53 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.world.World; + +public abstract class EntityGolem extends EntityCreature implements IAnimals { + + + public EntityGolem(World p_i1686_1_) { + super(p_i1686_1_); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "none"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "none"; + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() { + return 120; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java new file mode 100644 index 0000000..a2149df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java @@ -0,0 +1,259 @@ +package net.minecraft.entity.monster; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIDefendVillage; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookAtVillager; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIMoveTowardsTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityIronGolem extends EntityGolem { + /** deincrements, and a distance-to-home check is done at 0 */ + private int homeCheckTimer; + Village villageObj; + private int attackTimer; + private int holdRoseTick; + + + public EntityIronGolem(World p_i1694_1_) { + super(p_i1694_1_); + this.setSize(1.4F, 2.9F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F)); + this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true)); + this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(5, new EntityAILookAtVillager(this)); + this.tasks.addTask(6, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIDefendVillage(this)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector)); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() { + if (--this.homeCheckTimer <= 0) { + this.homeCheckTimer = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); + + if (this.villageObj == null) { + this.detachHome(); + } else { + ChunkCoordinates var1 = this.villageObj.getCenter(); + this.setHomeArea(var1.posX, var1.posY, var1.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F)); + } + } + + super.updateAITick(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Decrements the entity's air supply when underwater + */ + protected int decreaseAirSupply(int p_70682_1_) { + return p_70682_1_; + } + + protected void collideWithEntity(Entity p_82167_1_) { + if (p_82167_1_ instanceof IMob && this.getRNG().nextInt(20) == 0) { + this.setAttackTarget((EntityLivingBase)p_82167_1_); + } + + super.collideWithEntity(p_82167_1_); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + + if (this.attackTimer > 0) { + --this.attackTimer; + } + + if (this.holdRoseTick > 0) { + --this.holdRoseTick; + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D && this.rand.nextInt(5) == 0) { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var3 = MathHelper.floor_double(this.posZ); + Block var4 = this.worldObj.getBlock(var1, var2, var3); + + if (var4.getMaterial() != Material.air) { + this.worldObj.spawnParticle("blockcrack_" + Block.getIdFromBlock(var4) + "_" + this.worldObj.getBlockMetadata(var1, var2, var3), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.rand.nextFloat() - 0.5D), 0.5D, ((double)this.rand.nextFloat() - 0.5D) * 4.0D); + } + } + } + + /** + * Returns true if this entity can attack entities of the specified class. + */ + public boolean canAttackClass(Class p_70686_1_) { + return (!this.isPlayerCreated() || !EntityPlayer.class.isAssignableFrom(p_70686_1_)) && super.canAttackClass(p_70686_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setBoolean("PlayerCreated", this.isPlayerCreated()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setPlayerCreated(p_70037_1_.getBoolean("PlayerCreated")); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte)4); + boolean var2 = p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.rand.nextInt(15))); + + if (var2) { + p_70652_1_.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return var2; + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 4) { + this.attackTimer = 10; + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + } else if (p_70103_1_ == 11) { + this.holdRoseTick = 400; + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + public Village getVillage() { + return this.villageObj; + } + + public int getAttackTimer() { + return this.attackTimer; + } + + public void setHoldingRose(boolean p_70851_1_) { + this.holdRoseTick = p_70851_1_ ? 400 : 0; + this.worldObj.setEntityState(this, (byte)11); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.irongolem.death"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.irongolem.walk", 1.0F, 1.0F); + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(3); + int var4; + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145778_a(Item.getItemFromBlock(Blocks.red_flower), 1, 0.0F); + } + + var4 = 3 + this.rand.nextInt(3); + + for (int var5 = 0; var5 < var4; ++var5) { + this.func_145779_a(Items.iron_ingot, 1); + } + } + + public int getHoldRoseTick() { + return this.holdRoseTick; + } + + public boolean isPlayerCreated() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setPlayerCreated(boolean p_70849_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70849_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + if (!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) { + this.villageObj.setReputationForPlayer(this.attackingPlayer.getCommandSenderName(), -5); + } + + super.onDeath(p_70645_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java new file mode 100644 index 0000000..7e5b7d1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java @@ -0,0 +1,146 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityMagmaCube extends EntitySlime { + + + public EntityMagmaCube(World p_i1737_1_) { + super(p_i1737_1_); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return this.getSlimeSize() * 3; + } + + public int getBrightnessForRender(float p_70070_1_) { + return 15728880; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return 1.0F; + } + + /** + * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() + */ + protected String getSlimeParticle() { + return "flame"; + } + + protected EntitySlime createInstance() { + return new EntityMagmaCube(this.worldObj); + } + + protected Item func_146068_u() { + return Items.magma_cream; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + Item var3 = this.func_146068_u(); + + if (var3 != null && this.getSlimeSize() > 1) { + int var4 = this.rand.nextInt(4) - 2; + + if (p_70628_2_ > 0) { + var4 += this.rand.nextInt(p_70628_2_ + 1); + } + + for (int var5 = 0; var5 < var4; ++var5) { + this.func_145779_a(var3, 1); + } + } + } + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() { + return false; + } + + /** + * Gets the amount of time the slime needs to wait between jumps. + */ + protected int getJumpDelay() { + return super.getJumpDelay() * 4; + } + + protected void alterSquishAmount() { + this.squishAmount *= 0.9F; + } + + /** + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() { + this.motionY = 0.42F + (float)this.getSlimeSize() * 0.1F; + this.isAirBorne = true; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * Indicates weather the slime is able to damage the player (based upon the slime's size) + */ + protected boolean canDamagePlayer() { + return true; + } + + /** + * Gets the amount of damage dealt to the player when "attacked" by the slime. + */ + protected int getAttackStrength() { + return super.getAttackStrength() + 2; + } + + /** + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound() { + return this.getSlimeSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small"; + } + + /** + * Whether or not the current entity is in lava + */ + public boolean handleLavaMovement() { + return false; + } + + /** + * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityMob.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityMob.java new file mode 100644 index 0000000..14e8674 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityMob.java @@ -0,0 +1,198 @@ +package net.minecraft.entity.monster; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public abstract class EntityMob extends EntityCreature implements IMob { + + + public EntityMob(World p_i1738_1_) { + super(p_i1738_1_); + this.experienceValue = 5; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + this.updateArmSwingProgress(); + float var1 = this.getBrightness(1.0F); + + if (var1 > 0.5F) { + this.entityAge += 2; + } + + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (!this.worldObj.isClient && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) { + this.setDead(); + } + } + + protected String getSwimSound() { + return "game.hostile.swim"; + } + + protected String getSplashSound() { + return "game.hostile.swim.splash"; + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() { + EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + return var1 != null && this.canEntityBeSeen(var1) ? var1 : null; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if (super.attackEntityFrom(p_70097_1_, p_70097_2_)) { + Entity var3 = p_70097_1_.getEntity(); + + if (this.riddenByEntity != var3 && this.ridingEntity != var3) { + if (var3 != this) { + this.entityToAttack = var3; + } + + return true; + } else { + return true; + } + } else { + return false; + } + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "game.hostile.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "game.hostile.die"; + } + + protected String func_146067_o(int p_146067_1_) { + return p_146067_1_ > 4 ? "game.hostile.hurt.fall.big" : "game.hostile.hurt.fall.small"; + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + float var2 = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int var3 = 0; + + if (p_70652_1_ instanceof EntityLivingBase) { + var2 += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)p_70652_1_); + var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)p_70652_1_); + } + + boolean var4 = p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), var2); + + if (var4) { + if (var3 > 0) { + p_70652_1_.addVelocity(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F, 0.1D, MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + } + + int var5 = EnchantmentHelper.getFireAspectModifier(this); + + if (var5 > 0) { + p_70652_1_.setFire(var5 * 4); + } + + if (p_70652_1_ instanceof EntityLivingBase) { + EnchantmentHelper.func_151384_a((EntityLivingBase)p_70652_1_, this); + } + + EnchantmentHelper.func_151385_b(this, p_70652_1_); + } + + return var4; + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) { + if (this.attackTime <= 0 && p_70785_2_ < 2.0F && p_70785_1_.boundingBox.maxY > this.boundingBox.minY && p_70785_1_.boundingBox.minY < this.boundingBox.maxY) { + this.attackTime = 20; + this.attackEntityAsMob(p_70785_1_); + } + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) { + return 0.5F - this.worldObj.getLightBrightness(p_70783_1_, p_70783_2_, p_70783_3_); + } + + /** + * Checks to make sure the light is not too bright where the mob is spawning + */ + protected boolean isValidLightLevel() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); + int var3 = MathHelper.floor_double(this.posZ); + + if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { + return false; + } else { + int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); + + if (this.worldObj.isThundering()) { + int var5 = this.worldObj.skylightSubtracted; + this.worldObj.skylightSubtracted = 10; + var4 = this.worldObj.getBlockLightValue(var1, var2, var3); + this.worldObj.skylightSubtracted = var5; + } + + return var4 <= this.rand.nextInt(8); + } + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.isValidLightLevel() && super.getCanSpawnHere(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); + } + + protected boolean func_146066_aG() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java new file mode 100644 index 0000000..f854155 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java @@ -0,0 +1,201 @@ +package net.minecraft.entity.monster; + +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityPigZombie extends EntityZombie { + private static final UUID field_110189_bq = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); + private static final AttributeModifier field_110190_br = (new AttributeModifier(field_110189_bq, "Attacking speed boost", 0.45D, 0)).setSaved(false); + + /** Above zero if this PigZombie is Angry. */ + private int angerLevel; + + /** A random delay until this PigZombie next makes a sound. */ + private int randomSoundDelay; + private Entity field_110191_bu; + + + public EntityPigZombie(World p_i1739_1_) { + super(p_i1739_1_); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(field_110186_bp).setBaseValue(0.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return false; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.field_110191_bu != this.entityToAttack && !this.worldObj.isClient) { + IAttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var1.removeModifier(field_110190_br); + + if (this.entityToAttack != null) { + var1.applyModifier(field_110190_br); + } + } + + this.field_110191_bu = this.entityToAttack; + + if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) { + this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F); + } + + super.onUpdate(); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setShort("Anger", (short)this.angerLevel); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.angerLevel = p_70037_1_.getShort("Anger"); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() { + return this.angerLevel == 0 ? null : super.findPlayerToAttack(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + Entity var3 = p_70097_1_.getEntity(); + + if (var3 instanceof EntityPlayer) { + List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(32.0D, 32.0D, 32.0D)); + + for (int var5 = 0; var5 < var4.size(); ++var5) { + Entity var6 = (Entity)var4.get(var5); + + if (var6 instanceof EntityPigZombie) { + EntityPigZombie var7 = (EntityPigZombie)var6; + var7.becomeAngryAt(var3); + } + } + + this.becomeAngryAt(var3); + } + + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + /** + * Causes this PigZombie to become angry at the supplied Entity (which will be a player). + */ + private void becomeAngryAt(Entity p_70835_1_) { + this.entityToAttack = p_70835_1_; + this.angerLevel = 400 + this.rand.nextInt(400); + this.randomSoundDelay = this.rand.nextInt(40); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.zombiepig.zpig"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.zombiepig.zpighurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.zombiepig.zpigdeath"; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(2 + p_70628_2_); + int var4; + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.rotten_flesh, 1); + } + + var3 = this.rand.nextInt(2 + p_70628_2_); + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.gold_nugget, 1); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + return false; + } + + protected void dropRareDrop(int p_70600_1_) { + this.func_145779_a(Items.gold_ingot, 1); + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() { + this.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + super.onSpawnWithEgg(p_110161_1_); + this.setVillager(false); + return p_110161_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java new file mode 100644 index 0000000..309d155 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java @@ -0,0 +1,214 @@ +package net.minecraft.entity.monster; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import org.apache.commons.lang3.tuple.ImmutablePair; + +public class EntitySilverfish extends EntityMob { + /** + * A cooldown before this entity will search for another Silverfish to join them in battle. + */ + private int allySummonCooldown; + + + public EntitySilverfish(World p_i1740_1_) { + super(p_i1740_1_); + this.setSize(0.3F, 0.7F); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() { + double var1 = 8.0D; + return this.worldObj.getClosestVulnerablePlayerToEntity(this, var1); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.silverfish.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.silverfish.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.silverfish.kill"; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + if (this.allySummonCooldown <= 0 && (p_70097_1_ instanceof EntityDamageSource || p_70097_1_ == DamageSource.magic)) { + this.allySummonCooldown = 20; + } + + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) { + if (this.attackTime <= 0 && p_70785_2_ < 1.2F && p_70785_1_.boundingBox.maxY > this.boundingBox.minY && p_70785_1_.boundingBox.minY < this.boundingBox.maxY) { + this.attackTime = 20; + this.attackEntityAsMob(p_70785_1_); + } + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.silverfish.step", 0.15F, 1.0F); + } + + protected Item func_146068_u() { + return Item.getItemById(0); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.renderYawOffset = this.rotationYaw; + super.onUpdate(); + } + + protected void updateEntityActionState() { + super.updateEntityActionState(); + + if (!this.worldObj.isClient) { + int var1; + int var2; + int var3; + int var6; + + if (this.allySummonCooldown > 0) { + --this.allySummonCooldown; + + if (this.allySummonCooldown == 0) { + var1 = MathHelper.floor_double(this.posX); + var2 = MathHelper.floor_double(this.posY); + var3 = MathHelper.floor_double(this.posZ); + boolean var4 = false; + + for (int var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0 ? 1 - var5 : 0 - var5) { + for (var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0 ? 1 - var6 : 0 - var6) { + for (int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0 ? 1 - var7 : 0 - var7) { + if (this.worldObj.getBlock(var1 + var6, var2 + var5, var3 + var7) == Blocks.monster_egg) { + if (!this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + int var8 = this.worldObj.getBlockMetadata(var1 + var6, var2 + var5, var3 + var7); + ImmutablePair var9 = BlockSilverfish.func_150197_b(var8); + this.worldObj.setBlock(var1 + var6, var2 + var5, var3 + var7, (Block)var9.getLeft(), ((Integer)var9.getRight()).intValue(), 3); + } + else { + this.worldObj.func_147480_a(var1 + var6, var2 + var5, var3 + var7, false); + } + + Blocks.monster_egg.onBlockDestroyedByPlayer(this.worldObj, var1 + var6, var2 + var5, var3 + var7, 0); + + if (this.rand.nextBoolean()) { + var4 = true; + break; + } + } + } + } + } + } + } + + if (this.entityToAttack == null && !this.hasPath()) { + var1 = MathHelper.floor_double(this.posX); + var2 = MathHelper.floor_double(this.posY + 0.5D); + var3 = MathHelper.floor_double(this.posZ); + int var10 = this.rand.nextInt(6); + Block var11 = this.worldObj.getBlock(var1 + Facing.offsetsXForSide[var10], var2 + Facing.offsetsYForSide[var10], var3 + Facing.offsetsZForSide[var10]); + var6 = this.worldObj.getBlockMetadata(var1 + Facing.offsetsXForSide[var10], var2 + Facing.offsetsYForSide[var10], var3 + Facing.offsetsZForSide[var10]); + + if (BlockSilverfish.func_150196_a(var11)) { + this.worldObj.setBlock(var1 + Facing.offsetsXForSide[var10], var2 + Facing.offsetsYForSide[var10], var3 + Facing.offsetsZForSide[var10], Blocks.monster_egg, BlockSilverfish.func_150195_a(var11, var6), 3); + this.spawnExplosionParticle(); + this.setDead(); + } else { + this.updateWanderPath(); + } + } else if (this.entityToAttack != null && !this.hasPath()) { + this.entityToAttack = null; + } + } + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) { + return this.worldObj.getBlock(p_70783_1_, p_70783_2_ - 1, p_70783_3_) == Blocks.stone ? 10.0F : super.getBlockPathWeight(p_70783_1_, p_70783_2_, p_70783_3_); + } + + /** + * Checks to make sure the light is not too bright where the mob is spawning + */ + protected boolean isValidLightLevel() { + return true; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + if (super.getCanSpawnHere()) { + EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, 5.0D); + return var1 == null; + } else { + return false; + } + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.ARTHROPOD; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java new file mode 100644 index 0000000..a9c97e3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java @@ -0,0 +1,362 @@ +package net.minecraft.entity.monster; + +import java.util.Calendar; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIFleeSun; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIRestrictSun; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderHell; + +public class EntitySkeleton extends EntityMob implements IRangedAttackMob { + private final EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); + private final EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + + + public EntitySkeleton(World p_i1741_1_) { + super(p_i1741_1_); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIRestrictSun(this)); + this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + + if (p_i1741_1_ != null && !p_i1741_1_.isClient) { + this.setCombatTask(); + } + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(13, new Byte((byte)0)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.skeleton.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.skeleton.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.skeleton.death"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.skeleton.step", 0.15F, 1.0F); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + if (super.attackEntityAsMob(p_70652_1_)) { + if (this.getSkeletonType() == 1 && p_70652_1_ instanceof EntityLivingBase) { + ((EntityLivingBase)p_70652_1_).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); + } + + return true; + } else { + return false; + } + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.worldObj.isDaytime() && !this.worldObj.isClient) { + float var1 = this.getBrightness(1.0F); + + if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { + boolean var2 = true; + ItemStack var3 = this.getEquipmentInSlot(4); + + if (var3 != null) { + if (var3.isItemStackDamageable()) { + var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2)); + + if (var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { + this.renderBrokenItemStack(var3); + this.setCurrentItemOrArmor(4, null); + } + } + + var2 = false; + } + + if (var2) { + this.setFire(8); + } + } + } + + if (this.worldObj.isClient && this.getSkeletonType() == 1) { + this.setSize(0.72F, 2.34F); + } + + super.onLivingUpdate(); + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + super.updateRidden(); + + if (this.ridingEntity instanceof EntityCreature) { + EntityCreature var1 = (EntityCreature)this.ridingEntity; + this.renderYawOffset = var1.renderYawOffset; + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + super.onDeath(p_70645_1_); + + if (p_70645_1_.getSourceOfDamage() instanceof EntityArrow && p_70645_1_.getEntity() instanceof EntityPlayer) { + EntityPlayer var2 = (EntityPlayer)p_70645_1_.getEntity(); + double var3 = var2.posX - this.posX; + double var5 = var2.posZ - this.posZ; + + if (var3 * var3 + var5 * var5 >= 2500.0D) { + var2.triggerAchievement(AchievementList.snipeSkeleton); + } + } + } + + protected Item func_146068_u() { + return Items.arrow; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3; + int var4; + + if (this.getSkeletonType() == 1) { + var3 = this.rand.nextInt(3 + p_70628_2_) - 1; + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.coal, 1); + } + } else { + var3 = this.rand.nextInt(3 + p_70628_2_); + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.arrow, 1); + } + } + + var3 = this.rand.nextInt(3 + p_70628_2_); + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.bone, 1); + } + } + + protected void dropRareDrop(int p_70600_1_) { + if (this.getSkeletonType() == 1) { + this.entityDropItem(new ItemStack(Items.skull, 1, 1), 0.0F); + } + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() { + super.addRandomArmor(); + this.setCurrentItemOrArmor(0, new ItemStack(Items.bow)); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + + if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { + this.tasks.addTask(4, this.aiAttackOnCollide); + this.setSkeletonType(1); + this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); + } else { + this.tasks.addTask(4, this.aiArrowAttack); + this.addRandomArmor(); + this.enchantEquipment(); + } + + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)); + + if (this.getEquipmentInSlot(4) == null) { + Calendar var2 = this.worldObj.getCurrentDate(); + + if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F) { + this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + return p_110161_1_; + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack var1 = this.getHeldItem(); + + if (var1 != null && var1.getItem() == Items.bow) { + this.tasks.addTask(4, this.aiArrowAttack); + } else { + this.tasks.addTask(4, this.aiAttackOnCollide); + } + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + EntityArrow var3 = new EntityArrow(this.worldObj, this, p_82196_1_, 1.6F, (float)(14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); + int var4 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + int var5 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); + var3.setDamage((double)(p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D + (double)((float)this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); + + if (var4 > 0) { + var3.setDamage(var3.getDamage() + (double)var4 * 0.5D + 0.5D); + } + + if (var5 > 0) { + var3.setKnockbackStrength(var5); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1) { + var3.setFire(100); + } + + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(var3); + } + + /** + * Return this skeleton's type. + */ + public int getSkeletonType() { + return this.dataWatcher.getWatchableObjectByte(13); + } + + /** + * Set this skeleton's type. + */ + public void setSkeletonType(int p_82201_1_) { + this.dataWatcher.updateObject(13, Byte.valueOf((byte)p_82201_1_)); + this.isImmuneToFire = p_82201_1_ == 1; + + if (p_82201_1_ == 1) { + this.setSize(0.72F, 2.34F); + } else { + this.setSize(0.6F, 1.8F); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + + if (p_70037_1_.func_150297_b("SkeletonType", 99)) { + byte var2 = p_70037_1_.getByte("SkeletonType"); + this.setSkeletonType(var2); + } + + this.setCombatTask(); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setByte("SkeletonType", (byte)this.getSkeletonType()); + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int p_70062_1_, ItemStack p_70062_2_) { + super.setCurrentItemOrArmor(p_70062_1_, p_70062_2_); + + if (!this.worldObj.isClient && p_70062_1_ == 0) { + this.setCombatTask(); + } + } + + /** + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return super.getYOffset() - 0.5D; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySlime.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySlime.java new file mode 100644 index 0000000..d96f01b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySlime.java @@ -0,0 +1,300 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +public class EntitySlime extends EntityLiving implements IMob { + public float squishAmount; + public float squishFactor; + public float prevSquishFactor; + + /** ticks until this slime jumps again */ + private int slimeJumpDelay; + + + public EntitySlime(World p_i1742_1_) { + super(p_i1742_1_); + int var2 = 1 << this.rand.nextInt(3); + this.yOffset = 0.0F; + this.slimeJumpDelay = this.rand.nextInt(20) + 10; + this.setSlimeSize(var2); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)1)); + } + + protected void setSlimeSize(int p_70799_1_) { + this.dataWatcher.updateObject(16, new Byte((byte)p_70799_1_)); + this.setSize(0.6F * (float)p_70799_1_, 0.6F * (float)p_70799_1_); + this.setPosition(this.posX, this.posY, this.posZ); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(p_70799_1_ * p_70799_1_); + this.setHealth(this.getMaxHealth()); + this.experienceValue = p_70799_1_; + } + + /** + * Returns the size of the slime. + */ + public int getSlimeSize() { + return this.dataWatcher.getWatchableObjectByte(16); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("Size", this.getSlimeSize() - 1); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + int var2 = p_70037_1_.getInteger("Size"); + + if (var2 < 0) { + var2 = 0; + } + + this.setSlimeSize(var2 + 1); + } + + /** + * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() + */ + protected String getSlimeParticle() { + return "slime"; + } + + /** + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (!this.worldObj.isClient && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL && this.getSlimeSize() > 0) { + this.isDead = true; + } + + this.squishFactor += (this.squishAmount - this.squishFactor) * 0.5F; + this.prevSquishFactor = this.squishFactor; + boolean var1 = this.onGround; + super.onUpdate(); + int var2; + + if (this.onGround && !var1) { + var2 = this.getSlimeSize(); + + for (int var3 = 0; var3 < var2 * 8; ++var3) { + float var4 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float var5 = this.rand.nextFloat() * 0.5F + 0.5F; + float var6 = MathHelper.sin(var4) * (float)var2 * 0.5F * var5; + float var7 = MathHelper.cos(var4) * (float)var2 * 0.5F * var5; + this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)var6, this.boundingBox.minY, this.posZ + (double)var7, 0.0D, 0.0D, 0.0D); + } + + if (this.makesSoundOnLand()) { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } + + this.squishAmount = -0.5F; + } else if (!this.onGround && var1) { + this.squishAmount = 1.0F; + } + + this.alterSquishAmount(); + + if (this.worldObj.isClient) { + var2 = this.getSlimeSize(); + this.setSize(0.6F * (float)var2, 0.6F * (float)var2); + } + } + + protected void updateEntityActionState() { + this.despawnEntity(); + EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + + if (var1 != null) { + this.faceEntity(var1, 10.0F, 20.0F); + } + + if (this.onGround && this.slimeJumpDelay-- <= 0) { + this.slimeJumpDelay = this.getJumpDelay(); + + if (var1 != null) { + this.slimeJumpDelay /= 3; + } + + this.isJumping = true; + + if (this.makesSoundOnJump()) { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } + + this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; + this.moveForward = (float)(1 * this.getSlimeSize()); + } else { + this.isJumping = false; + + if (this.onGround) { + this.moveStrafing = this.moveForward = 0.0F; + } + } + } + + protected void alterSquishAmount() { + this.squishAmount *= 0.6F; + } + + /** + * Gets the amount of time the slime needs to wait between jumps. + */ + protected int getJumpDelay() { + return this.rand.nextInt(20) + 10; + } + + protected EntitySlime createInstance() { + return new EntitySlime(this.worldObj); + } + + /** + * Will get destroyed next tick. + */ + public void setDead() { + int var1 = this.getSlimeSize(); + + if (!this.worldObj.isClient && var1 > 1 && this.getHealth() <= 0.0F) { + int var2 = 2 + this.rand.nextInt(3); + + for (int var3 = 0; var3 < var2; ++var3) { + float var4 = ((float)(var3 % 2) - 0.5F) * (float)var1 / 4.0F; + float var5 = ((float)(var3 / 2) - 0.5F) * (float)var1 / 4.0F; + EntitySlime var6 = this.createInstance(); + var6.setSlimeSize(var1 / 2); + var6.setLocationAndAngles(this.posX + (double)var4, this.posY + 0.5D, this.posZ + (double)var5, this.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(var6); + } + } + + super.setDead(); + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer p_70100_1_) { + if (this.canDamagePlayer()) { + int var2 = this.getSlimeSize(); + + if (this.canEntityBeSeen(p_70100_1_) && this.getDistanceSqToEntity(p_70100_1_) < 0.6D * (double)var2 * 0.6D * (double)var2 && p_70100_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength())) { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } + } + + /** + * Indicates weather the slime is able to damage the player (based upon the slime's size) + */ + protected boolean canDamagePlayer() { + return this.getSlimeSize() > 1; + } + + /** + * Gets the amount of damage dealt to the player when "attacked" by the slime. + */ + protected int getAttackStrength() { + return this.getSlimeSize(); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + protected Item func_146068_u() { + return this.getSlimeSize() == 1 ? Items.slime_ball : Item.getItemById(0); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + Chunk var1 = this.worldObj.getChunkFromBlockCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + + if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) { + return false; + } else { + if (this.getSlimeSize() == 1 || this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL) { + BiomeGenBase var2 = this.worldObj.getBiomeGenForCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + + if (var2 == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) <= this.rand.nextInt(8)) { + return super.getCanSpawnHere(); + } + + if (this.rand.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) { + return super.getCanSpawnHere(); + } + } + + return false; + } + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F * (float)this.getSlimeSize(); + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() { + return 0; + } + + /** + * Returns true if the slime makes a sound when it jumps (based upon the slime's size) + */ + protected boolean makesSoundOnJump() { + return this.getSlimeSize() > 0; + } + + /** + * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand() { + return this.getSlimeSize() > 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySnowman.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySnowman.java new file mode 100644 index 0000000..02aa84b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySnowman.java @@ -0,0 +1,106 @@ +package net.minecraft.entity.monster; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySnowman extends EntityGolem implements IRangedAttackMob { + + + public EntitySnowman(World p_i1692_1_) { + super(p_i1692_1_); + this.setSize(0.4F, 1.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.25D, 20, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(4, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY); + int var3 = MathHelper.floor_double(this.posZ); + + if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.worldObj.getBiomeGenForCoords(var1, var3).getFloatTemperature(var1, var2, var3) > 1.0F) { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + for (int var4 = 0; var4 < 4; ++var4) { + var1 = MathHelper.floor_double(this.posX + (double)((float)(var4 % 2 * 2 - 1) * 0.25F)); + var2 = MathHelper.floor_double(this.posY); + var3 = MathHelper.floor_double(this.posZ + (double)((float)(var4 / 2 % 2 * 2 - 1) * 0.25F)); + + if (this.worldObj.getBlock(var1, var2, var3).getMaterial() == Material.air && this.worldObj.getBiomeGenForCoords(var1, var3).getFloatTemperature(var1, var2, var3) < 0.8F && Blocks.snow_layer.canPlaceBlockAt(this.worldObj, var1, var2, var3)) { + this.worldObj.setBlock(var1, var2, var3, Blocks.snow_layer); + } + } + } + + protected Item func_146068_u() { + return Items.snowball; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(16); + + for (int var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.snowball, 1); + } + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + EntitySnowball var3 = new EntitySnowball(this.worldObj, this); + double var4 = p_82196_1_.posX - this.posX; + double var6 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - var3.posY; + double var8 = p_82196_1_.posZ - this.posZ; + float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8) * 0.2F; + var3.setThrowableHeading(var4, var6 + (double)var10, var8, 1.6F, 12.0F); + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(var3); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySpider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySpider.java new file mode 100644 index 0000000..44e4506 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntitySpider.java @@ -0,0 +1,221 @@ +package net.minecraft.entity.monster; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntitySpider extends EntityMob { + + + public EntitySpider(World p_i1743_1_) { + super(p_i1743_1_); + this.setSize(1.4F, 0.9F); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (!this.worldObj.isClient) { + this.setBesideClimbableBlock(this.isCollidedHorizontally); + } + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(16.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.800000011920929D); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() { + float var1 = this.getBrightness(1.0F); + + if (var1 < 0.5F) { + double var2 = 16.0D; + return this.worldObj.getClosestVulnerablePlayerToEntity(this, var2); + } else { + return null; + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.spider.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.spider.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.spider.death"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.spider.step", 0.15F, 1.0F); + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) { + float var3 = this.getBrightness(1.0F); + + if (var3 > 0.5F && this.rand.nextInt(100) == 0) { + this.entityToAttack = null; + } else { + if (p_70785_2_ > 2.0F && p_70785_2_ < 6.0F && this.rand.nextInt(10) == 0) { + if (this.onGround) { + double var4 = p_70785_1_.posX - this.posX; + double var6 = p_70785_1_.posZ - this.posZ; + float var8 = MathHelper.sqrt_double(var4 * var4 + var6 * var6); + this.motionX = var4 / (double)var8 * 0.5D * 0.800000011920929D + this.motionX * 0.20000000298023224D; + this.motionZ = var6 / (double)var8 * 0.5D * 0.800000011920929D + this.motionZ * 0.20000000298023224D; + this.motionY = 0.4000000059604645D; + } + } else { + super.attackEntity(p_70785_1_, p_70785_2_); + } + } + } + + protected Item func_146068_u() { + return Items.string; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + super.dropFewItems(p_70628_1_, p_70628_2_); + + if (p_70628_1_ && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + p_70628_2_) > 0)) { + this.func_145779_a(Items.spider_eye, 1); + } + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + return this.isBesideClimbableBlock(); + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() {} + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.ARTHROPOD; + } + + public boolean isPotionApplicable(PotionEffect p_70687_1_) { + return p_70687_1_.getPotionID() != Potion.poison.id && super.isPotionApplicable(p_70687_1_); + } + + /** + * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using + * setBesideClimableBlock. + */ + public boolean isBesideClimbableBlock() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + /** + * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is + * false. + */ + public void setBesideClimbableBlock(boolean p_70839_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70839_1_) { + var2 = (byte)(var2 | 1); + } else { + var2 &= -2; + } + + this.dataWatcher.updateObject(16, Byte.valueOf(var2)); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_); + + if (this.worldObj.rand.nextInt(100) == 0) { + EntitySkeleton var2 = new EntitySkeleton(this.worldObj); + var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + var2.onSpawnWithEgg(null); + this.worldObj.spawnEntityInWorld(var2); + var2.mountEntity(this); + } + + if (p_110161_1_1 == null) { + p_110161_1_1 = new EntitySpider.GroupData(); + + if (this.worldObj.difficultySetting == EnumDifficulty.HARD && this.worldObj.rand.nextFloat() < 0.1F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)) { + ((EntitySpider.GroupData)p_110161_1_1).func_111104_a(this.worldObj.rand); + } + } + + if (p_110161_1_1 instanceof EntitySpider.GroupData) { + int var4 = ((EntitySpider.GroupData)p_110161_1_1).field_111105_a; + + if (var4 > 0 && Potion.potionTypes[var4] != null) { + this.addPotionEffect(new PotionEffect(var4, Integer.MAX_VALUE)); + } + } + + return (IEntityLivingData)p_110161_1_1; + } + + public static class GroupData implements IEntityLivingData { + public int field_111105_a; + + + public void func_111104_a(Random p_111104_1_) { + int var2 = p_111104_1_.nextInt(5); + + if (var2 <= 1) { + this.field_111105_a = Potion.moveSpeed.id; + } else if (var2 <= 2) { + this.field_111105_a = Potion.damageBoost.id; + } else if (var2 <= 3) { + this.field_111105_a = Potion.regeneration.id; + } else if (var2 <= 4) { + this.field_111105_a = Potion.invisibility.id; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityWitch.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityWitch.java new file mode 100644 index 0000000..269a17f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityWitch.java @@ -0,0 +1,239 @@ +package net.minecraft.entity.monster; + +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityWitch extends EntityMob implements IRangedAttackMob { + private static final UUID field_110184_bp = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); + private static final AttributeModifier field_110185_bq = (new AttributeModifier(field_110184_bp, "Drinking speed penalty", -0.25D, 0)).setSaved(false); + + /** List of items a witch should drop on death. */ + private static final Item[] witchDrops = new Item[] {Items.glowstone_dust, Items.sugar, Items.redstone, Items.spider_eye, Items.glass_bottle, Items.gunpowder, Items.stick, Items.stick}; + + /** + * Timer used as interval for a witch's attack, decremented every tick if aggressive and when reaches zero the witch + * will throw a potion at the target entity. + */ + private int witchAttackTimer; + + + public EntityWitch(World p_i1744_1_) { + super(p_i1744_1_); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 60, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(3, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + } + + protected void entityInit() { + super.entityInit(); + this.getDataWatcher().addObject(21, Byte.valueOf((byte)0)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.witch.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.witch.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.witch.death"; + } + + /** + * Set whether this witch is aggressive at an entity. + */ + public void setAggressive(boolean p_82197_1_) { + this.getDataWatcher().updateObject(21, Byte.valueOf((byte)(p_82197_1_ ? 1 : 0))); + } + + /** + * Return whether this witch is aggressive at an entity. + */ + public boolean getAggressive() { + return this.getDataWatcher().getWatchableObjectByte(21) == 1; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(26.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (!this.worldObj.isClient) { + if (this.getAggressive()) { + if (this.witchAttackTimer-- <= 0) { + this.setAggressive(false); + ItemStack var1 = this.getHeldItem(); + this.setCurrentItemOrArmor(0, null); + + if (var1 != null && var1.getItem() == Items.potionitem) { + List var2 = Items.potionitem.getEffects(var1); + + if (var2 != null) { + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + PotionEffect var4 = (PotionEffect)var3.next(); + this.addPotionEffect(new PotionEffect(var4)); + } + } + } + + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).removeModifier(field_110185_bq); + } + } else { + short var5 = -1; + + if (this.rand.nextFloat() < 0.15F && this.isInsideOfMaterial(Material.water) && !this.isPotionActive(Potion.waterBreathing)) { + var5 = 8237; + } else if (this.rand.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) { + var5 = 16307; + } else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { + var5 = 16341; + } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { + var5 = 16274; + } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { + var5 = 16274; + } + + if (var5 > -1) { + this.setCurrentItemOrArmor(0, new ItemStack(Items.potionitem, 1, var5)); + this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration(); + this.setAggressive(true); + IAttributeInstance var6 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var6.removeModifier(field_110185_bq); + var6.applyModifier(field_110185_bq); + } + } + + if (this.rand.nextFloat() < 7.5E-4F) { + this.worldObj.setEntityState(this, (byte)15); + } + } + + super.onLivingUpdate(); + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 15) { + for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2) { + this.worldObj.spawnParticle("witchMagic", this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.boundingBox.maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D); + } + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Reduces damage, depending on potions + */ + protected float applyPotionDamageCalculations(DamageSource p_70672_1_, float p_70672_2_) { + p_70672_2_ = super.applyPotionDamageCalculations(p_70672_1_, p_70672_2_); + + if (p_70672_1_.getEntity() == this) { + p_70672_2_ = 0.0F; + } + + if (p_70672_1_.isMagicDamage()) { + p_70672_2_ = (float)((double)p_70672_2_ * 0.15D); + } + + return p_70672_2_; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(3) + 1; + + for (int var4 = 0; var4 < var3; ++var4) { + int var5 = this.rand.nextInt(3); + Item var6 = witchDrops[this.rand.nextInt(witchDrops.length)]; + + if (p_70628_2_ > 0) { + var5 += this.rand.nextInt(p_70628_2_ + 1); + } + + for (int var7 = 0; var7 < var5; ++var7) { + this.func_145779_a(var6, 1); + } + } + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + if (!this.getAggressive()) { + EntityPotion var3 = new EntityPotion(this.worldObj, this, 32732); + var3.rotationPitch -= -20.0F; + double var4 = p_82196_1_.posX + p_82196_1_.motionX - this.posX; + double var6 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - this.posY; + double var8 = p_82196_1_.posZ + p_82196_1_.motionZ - this.posZ; + float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8); + + if (var10 >= 8.0F && !p_82196_1_.isPotionActive(Potion.moveSlowdown)) { + var3.setPotionDamage(32698); + } else if (p_82196_1_.getHealth() >= 8.0F && !p_82196_1_.isPotionActive(Potion.poison)) { + var3.setPotionDamage(32660); + } else if (var10 <= 3.0F && !p_82196_1_.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F) { + var3.setPotionDamage(32696); + } + + var3.setThrowableHeading(var4, var6 + (double)(var10 * 0.2F), var8, 0.75F, 8.0F); + this.worldObj.spawnEntityInWorld(var3); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityZombie.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityZombie.java new file mode 100644 index 0000000..c81254a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/EntityZombie.java @@ -0,0 +1,635 @@ +package net.minecraft.entity.monster; + +import java.util.Calendar; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBreakDoor; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityZombie extends EntityMob { + protected static final IAttribute field_110186_bp = (new RangedAttribute("zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).setDescription("Spawn Reinforcements Chance"); + private static final UUID babySpeedBoostUUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); + private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, "Baby speed boost", 0.5D, 1); + private final EntityAIBreakDoor field_146075_bs = new EntityAIBreakDoor(this); + + /** + * Ticker used to determine the time remaining for this zombie to convert into a villager when cured. + */ + private int conversionTime; + private boolean field_146076_bu = false; + private float field_146074_bv = -1.0F; + private float field_146073_bw; + + + public EntityZombie(World p_i1745_1_) { + super(p_i1745_1_); + this.getNavigator().setBreakDoors(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false)); + this.setSize(0.6F, 1.8F); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); + this.getAttributeMap().registerAttribute(field_110186_bp).setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); + } + + protected void entityInit() { + super.entityInit(); + this.getDataWatcher().addObject(12, Byte.valueOf((byte)0)); + this.getDataWatcher().addObject(13, Byte.valueOf((byte)0)); + this.getDataWatcher().addObject(14, Byte.valueOf((byte)0)); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + int var1 = super.getTotalArmorValue() + 2; + + if (var1 > 20) { + var1 = 20; + } + + return var1; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return true; + } + + public boolean func_146072_bX() { + return this.field_146076_bu; + } + + public void func_146070_a(boolean p_146070_1_) { + if (this.field_146076_bu != p_146070_1_) { + this.field_146076_bu = p_146070_1_; + + if (p_146070_1_) { + this.tasks.addTask(1, this.field_146075_bs); + } else { + this.tasks.removeTask(this.field_146075_bs); + } + } + } + + /** + * If Animal, checks if the age timer is negative + */ + public boolean isChild() { + return this.getDataWatcher().getWatchableObjectByte(12) == 1; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) { + if (this.isChild()) { + this.experienceValue = (int)((float)this.experienceValue * 2.5F); + } + + return super.getExperiencePoints(p_70693_1_); + } + + /** + * Set whether this zombie is a child. + */ + public void setChild(boolean p_82227_1_) { + this.getDataWatcher().updateObject(12, Byte.valueOf((byte)(p_82227_1_ ? 1 : 0))); + + if (this.worldObj != null && !this.worldObj.isClient) { + IAttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var2.removeModifier(babySpeedBoostModifier); + + if (p_82227_1_) { + var2.applyModifier(babySpeedBoostModifier); + } + } + + this.func_146071_k(p_82227_1_); + } + + /** + * Return whether this zombie is a villager. + */ + public boolean isVillager() { + return this.getDataWatcher().getWatchableObjectByte(13) == 1; + } + + /** + * Set whether this zombie is a villager. + */ + public void setVillager(boolean p_82229_1_) { + this.getDataWatcher().updateObject(13, Byte.valueOf((byte)(p_82229_1_ ? 1 : 0))); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.worldObj.isDaytime() && !this.worldObj.isClient && !this.isChild()) { + float var1 = this.getBrightness(1.0F); + + if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { + boolean var2 = true; + ItemStack var3 = this.getEquipmentInSlot(4); + + if (var3 != null) { + if (var3.isItemStackDamageable()) { + var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2)); + + if (var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { + this.renderBrokenItemStack(var3); + this.setCurrentItemOrArmor(4, null); + } + } + + var2 = false; + } + + if (var2) { + this.setFire(8); + } + } + } + + if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof EntityChicken) { + ((EntityLiving)this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D); + } + + super.onLivingUpdate(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (!super.attackEntityFrom(p_70097_1_, p_70097_2_)) { + return false; + } else { + EntityLivingBase var3 = this.getAttackTarget(); + + if (var3 == null && this.getEntityToAttack() instanceof EntityLivingBase) { + var3 = (EntityLivingBase)this.getEntityToAttack(); + } + + if (var3 == null && p_70097_1_.getEntity() instanceof EntityLivingBase) { + var3 = (EntityLivingBase)p_70097_1_.getEntity(); + } + + if (var3 != null && this.worldObj.difficultySetting == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) { + int var4 = MathHelper.floor_double(this.posX); + int var5 = MathHelper.floor_double(this.posY); + int var6 = MathHelper.floor_double(this.posZ); + EntityZombie var7 = new EntityZombie(this.worldObj); + + for (int var8 = 0; var8 < 50; ++var8) { + int var9 = var4 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int var10 = var5 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int var11 = var6 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + + if (World.doesBlockHaveSolidTopSurface(this.worldObj, var9, var10 - 1, var11) && this.worldObj.getBlockLightValue(var9, var10, var11) < 10) { + var7.setPosition(var9, var10, var11); + + if (this.worldObj.checkNoEntityCollision(var7.boundingBox) && this.worldObj.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(var7.boundingBox)) { + this.worldObj.spawnEntityInWorld(var7); + var7.setAttackTarget(var3); + var7.onSpawnWithEgg(null); + this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + var7.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); + break; + } + } + } + } + + return true; + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (!this.worldObj.isClient && this.isConverting()) { + int var1 = this.getConversionTimeBoost(); + this.conversionTime -= var1; + + if (this.conversionTime <= 0) { + this.convertToVillager(); + } + } + + super.onUpdate(); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + boolean var2 = super.attackEntityAsMob(p_70652_1_); + + if (var2) { + int var3 = this.worldObj.difficultySetting.getDifficultyId(); + + if (this.getHeldItem() == null && this.isBurning() && this.rand.nextFloat() < (float)var3 * 0.3F) { + p_70652_1_.setFire(2 * var3); + } + } + + return var2; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.zombie.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.zombie.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.zombie.death"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + protected Item func_146068_u() { + return Items.rotten_flesh; + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + + protected void dropRareDrop(int p_70600_1_) { + switch (this.rand.nextInt(3)) { + case 0: + this.func_145779_a(Items.iron_ingot, 1); + break; + + case 1: + this.func_145779_a(Items.carrot, 1); + break; + + case 2: + this.func_145779_a(Items.potato, 1); + } + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() { + super.addRandomArmor(); + + if (this.rand.nextFloat() < (this.worldObj.difficultySetting == EnumDifficulty.HARD ? 0.05F : 0.01F)) { + int var1 = this.rand.nextInt(3); + + if (var1 == 0) { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); + } else { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_shovel)); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + + if (this.isChild()) { + p_70014_1_.setBoolean("IsBaby", true); + } + + if (this.isVillager()) { + p_70014_1_.setBoolean("IsVillager", true); + } + + p_70014_1_.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); + p_70014_1_.setBoolean("CanBreakDoors", this.func_146072_bX()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + + if (p_70037_1_.getBoolean("IsBaby")) { + this.setChild(true); + } + + if (p_70037_1_.getBoolean("IsVillager")) { + this.setVillager(true); + } + + if (p_70037_1_.func_150297_b("ConversionTime", 99) && p_70037_1_.getInteger("ConversionTime") > -1) { + this.startConversion(p_70037_1_.getInteger("ConversionTime")); + } + + this.func_146070_a(p_70037_1_.getBoolean("CanBreakDoors")); + } + + /** + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase p_70074_1_) { + super.onKillEntity(p_70074_1_); + + if ((this.worldObj.difficultySetting == EnumDifficulty.NORMAL || this.worldObj.difficultySetting == EnumDifficulty.HARD) && p_70074_1_ instanceof EntityVillager) { + if (this.worldObj.difficultySetting != EnumDifficulty.HARD && this.rand.nextBoolean()) { + return; + } + + EntityZombie var2 = new EntityZombie(this.worldObj); + var2.copyLocationAndAnglesFrom(p_70074_1_); + this.worldObj.removeEntity(p_70074_1_); + var2.onSpawnWithEgg(null); + var2.setVillager(true); + + if (p_70074_1_.isChild()) { + var2.setChild(true); + } + + this.worldObj.spawnEntityInWorld(var2); + this.worldObj.playAuxSFXAtEntity(null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_); + float var2 = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * var2); + + if (p_110161_1_1 == null) { + p_110161_1_1 = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < 0.05F, this.worldObj.rand.nextFloat() < 0.05F, null); + } + + if (p_110161_1_1 instanceof EntityZombie.GroupData) { + EntityZombie.GroupData var3 = (EntityZombie.GroupData)p_110161_1_1; + + if (var3.field_142046_b) { + this.setVillager(true); + } + + if (var3.field_142048_a) { + this.setChild(true); + + if ((double)this.worldObj.rand.nextFloat() < 0.05D) { + List var4 = this.worldObj.selectEntitiesWithinAABB(EntityChicken.class, this.boundingBox.expand(5.0D, 3.0D, 5.0D), IEntitySelector.field_152785_b); + + if (!var4.isEmpty()) { + EntityChicken var5 = (EntityChicken)var4.get(0); + var5.func_152117_i(true); + this.mountEntity(var5); + } + } else if ((double)this.worldObj.rand.nextFloat() < 0.05D) { + EntityChicken var9 = new EntityChicken(this.worldObj); + var9.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + var9.onSpawnWithEgg(null); + var9.func_152117_i(true); + this.worldObj.spawnEntityInWorld(var9); + this.mountEntity(var9); + } + } + } + + this.func_146070_a(this.rand.nextFloat() < var2 * 0.1F); + this.addRandomArmor(); + this.enchantEquipment(); + + if (this.getEquipmentInSlot(4) == null) { + Calendar var7 = this.worldObj.getCurrentDate(); + + if (var7.get(2) + 1 == 10 && var7.get(5) == 31 && this.rand.nextFloat() < 0.25F) { + this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0)); + double var8 = this.rand.nextDouble() * 1.5D * (double)this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + + if (var8 > 1.0D) { + this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", var8, 2)); + } + + if (this.rand.nextFloat() < var2 * 0.05F) { + this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0)); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2)); + this.func_146070_a(true); + } + + return (IEntityLivingData)p_110161_1_1; + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.getCurrentEquippedItem(); + + if (var2 != null && var2.getItem() == Items.golden_apple && var2.getItemDamage() == 0 && this.isVillager() && this.isPotionActive(Potion.weakness)) { + if (!p_70085_1_.capabilities.isCreativeMode) { + --var2.stackSize; + } + + if (var2.stackSize <= 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + + if (!this.worldObj.isClient) { + this.startConversion(this.rand.nextInt(2401) + 3600); + } + + return true; + } else { + return false; + } + } + + /** + * Starts converting this zombie into a villager. The zombie converts into a villager after the specified time in + * ticks. + */ + protected void startConversion(int p_82228_1_) { + this.conversionTime = p_82228_1_; + this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1)); + this.removePotionEffect(Potion.weakness.id); + this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, p_82228_1_, Math.min(this.worldObj.difficultySetting.getDifficultyId() - 1, 0))); + this.worldObj.setEntityState(this, (byte)16); + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 16) { + this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return !this.isConverting(); + } + + /** + * Returns whether this zombie is in the process of converting to a villager + */ + public boolean isConverting() { + return this.getDataWatcher().getWatchableObjectByte(14) == 1; + } + + /** + * Convert this zombie into a villager. + */ + protected void convertToVillager() { + EntityVillager var1 = new EntityVillager(this.worldObj); + var1.copyLocationAndAnglesFrom(this); + var1.onSpawnWithEgg(null); + var1.setLookingForHome(); + + if (this.isChild()) { + var1.setGrowingAge(-24000); + } + + this.worldObj.removeEntity(this); + this.worldObj.spawnEntityInWorld(var1); + var1.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); + this.worldObj.playAuxSFXAtEntity(null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + /** + * Return the amount of time decremented from conversionTime every tick. + */ + protected int getConversionTimeBoost() { + int var1 = 1; + + if (this.rand.nextFloat() < 0.01F) { + int var2 = 0; + + for (int var3 = (int)this.posX - 4; var3 < (int)this.posX + 4 && var2 < 14; ++var3) { + for (int var4 = (int)this.posY - 4; var4 < (int)this.posY + 4 && var2 < 14; ++var4) { + for (int var5 = (int)this.posZ - 4; var5 < (int)this.posZ + 4 && var2 < 14; ++var5) { + Block var6 = this.worldObj.getBlock(var3, var4, var5); + + if (var6 == Blocks.iron_bars || var6 == Blocks.bed) { + if (this.rand.nextFloat() < 0.3F) { + ++var1; + } + + ++var2; + } + } + } + } + } + + return var1; + } + + public void func_146071_k(boolean p_146071_1_) { + this.func_146069_a(p_146071_1_ ? 0.5F : 1.0F); + } + + /** + * Sets the width and height of the entity. Args: width, height + */ + protected final void setSize(float p_70105_1_, float p_70105_2_) { + boolean var3 = this.field_146074_bv > 0.0F && this.field_146073_bw > 0.0F; + this.field_146074_bv = p_70105_1_; + this.field_146073_bw = p_70105_2_; + + if (!var3) { + this.func_146069_a(1.0F); + } + } + + protected final void func_146069_a(float p_146069_1_) { + super.setSize(this.field_146074_bv * p_146069_1_, this.field_146073_bw * p_146069_1_); + } + + class GroupData implements IEntityLivingData { + public boolean field_142048_a; + public boolean field_142046_b; + + + private GroupData(boolean p_i2348_2_, boolean p_i2348_3_) { + this.field_142048_a = false; + this.field_142046_b = false; + this.field_142048_a = p_i2348_2_; + this.field_142046_b = p_i2348_3_; + } + + GroupData(boolean p_i2349_2_, boolean p_i2349_3_, Object p_i2349_4_) { + this(p_i2349_2_, p_i2349_3_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/IMob.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/IMob.java new file mode 100644 index 0000000..3541627 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/monster/IMob.java @@ -0,0 +1,15 @@ +package net.minecraft.entity.monster; + +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.IAnimals; + +public interface IMob extends IAnimals { + /** Entity selector for IMob types. */ + IEntitySelector mobSelector = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_ instanceof IMob; + } + }; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java new file mode 100644 index 0000000..d255a99 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityAmbientCreature.java @@ -0,0 +1,24 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public abstract class EntityAmbientCreature extends EntityLiving implements IAnimals { + + + public EntityAmbientCreature(World p_i1679_1_) { + super(p_i1679_1_); + } + + public boolean allowLeashing() { + return false; + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer p_70085_1_) { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityAnimal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityAnimal.java new file mode 100644 index 0000000..120944d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityAnimal.java @@ -0,0 +1,362 @@ +package net.minecraft.entity.passive; + +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityAnimal extends EntityAgeable implements IAnimals { + private int inLove; + + /** + * This is representation of a counter for reproduction progress. (Note that this is different from the inLove which + * represent being in Love-Mode) + */ + private int breeding; + private EntityPlayer field_146084_br; + + + public EntityAnimal(World p_i1681_1_) { + super(p_i1681_1_); + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() { + if (this.getGrowingAge() != 0) { + this.inLove = 0; + } + + super.updateAITick(); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + + if (this.getGrowingAge() != 0) { + this.inLove = 0; + } + + if (this.inLove > 0) { + --this.inLove; + String var1 = "heart"; + + if (this.inLove % 10 == 0) { + double var2 = this.rand.nextGaussian() * 0.02D; + double var4 = this.rand.nextGaussian() * 0.02D; + double var6 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(var1, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); + } + } else { + this.breeding = 0; + } + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) { + if (p_70785_1_ instanceof EntityPlayer) { + if (p_70785_2_ < 3.0F) { + double var3 = p_70785_1_.posX - this.posX; + double var5 = p_70785_1_.posZ - this.posZ; + this.rotationYaw = (float)(Math.atan2(var5, var3) * 180.0D / Math.PI) - 90.0F; + this.hasAttacked = true; + } + + EntityPlayer var7 = (EntityPlayer)p_70785_1_; + + if (var7.getCurrentEquippedItem() == null || !this.isBreedingItem(var7.getCurrentEquippedItem())) { + this.entityToAttack = null; + } + } else if (p_70785_1_ instanceof EntityAnimal) { + EntityAnimal var8 = (EntityAnimal)p_70785_1_; + + if (this.getGrowingAge() > 0 && var8.getGrowingAge() < 0) { + if ((double)p_70785_2_ < 2.5D) { + this.hasAttacked = true; + } + } else if (this.inLove > 0 && var8.inLove > 0) { + if (var8.entityToAttack == null) { + var8.entityToAttack = this; + } + + if (var8.entityToAttack == this && (double)p_70785_2_ < 3.5D) { + ++var8.inLove; + ++this.inLove; + ++this.breeding; + + if (this.breeding % 4 == 0) { + this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D); + } + + if (this.breeding == 60) { + this.procreate((EntityAnimal)p_70785_1_); + } + } else { + this.breeding = 0; + } + } else { + this.breeding = 0; + this.entityToAttack = null; + } + } + } + + /** + * Creates a baby animal according to the animal type of the target at the actual position and spawns 'love' + * particles. + */ + private void procreate(EntityAnimal p_70876_1_) { + EntityAgeable var2 = this.createChild(p_70876_1_); + + if (var2 != null) { + if (this.field_146084_br == null && p_70876_1_.func_146083_cb() != null) { + this.field_146084_br = p_70876_1_.func_146083_cb(); + } + + if (this.field_146084_br != null) { + this.field_146084_br.triggerAchievement(StatList.field_151186_x); + + if (this instanceof EntityCow) { + this.field_146084_br.triggerAchievement(AchievementList.field_150962_H); + } + } + + this.setGrowingAge(6000); + p_70876_1_.setGrowingAge(6000); + this.inLove = 0; + this.breeding = 0; + this.entityToAttack = null; + p_70876_1_.entityToAttack = null; + p_70876_1_.breeding = 0; + p_70876_1_.inLove = 0; + var2.setGrowingAge(-24000); + var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + + for (int var3 = 0; var3 < 7; ++var3) { + double var4 = this.rand.nextGaussian() * 0.02D; + double var6 = this.rand.nextGaussian() * 0.02D; + double var8 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); + } + + this.worldObj.spawnEntityInWorld(var2); + } + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + this.fleeingTick = 60; + + if (!this.isAIEnabled()) { + IAttributeInstance var3 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (var3.getModifier(field_110179_h) == null) { + var3.applyModifier(field_110181_i); + } + } + + this.entityToAttack = null; + this.inLove = 0; + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) { + return this.worldObj.getBlock(p_70783_1_, p_70783_2_ - 1, p_70783_3_) == Blocks.grass ? 10.0F : this.worldObj.getLightBrightness(p_70783_1_, p_70783_2_, p_70783_3_) - 0.5F; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("InLove", this.inLove); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.inLove = p_70037_1_.getInteger("InLove"); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() { + if (this.fleeingTick > 0) { + return null; + } else { + float var1 = 8.0F; + List var2; + int var3; + EntityAnimal var4; + + if (this.inLove > 0) { + var2 = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand(var1, var1, var1)); + + for (var3 = 0; var3 < var2.size(); ++var3) { + var4 = (EntityAnimal)var2.get(var3); + + if (var4 != this && var4.inLove > 0) { + return var4; + } + } + } else if (this.getGrowingAge() == 0) { + var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(var1, var1, var1)); + + for (var3 = 0; var3 < var2.size(); ++var3) { + EntityPlayer var5 = (EntityPlayer)var2.get(var3); + + if (var5.getCurrentEquippedItem() != null && this.isBreedingItem(var5.getCurrentEquippedItem())) { + return var5; + } + } + } else if (this.getGrowingAge() > 0) { + var2 = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand(var1, var1, var1)); + + for (var3 = 0; var3 < var2.size(); ++var3) { + var4 = (EntityAnimal)var2.get(var3); + + if (var4 != this && var4.getGrowingAge() < 0) { + return var4; + } + } + } + + return null; + } + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); + int var3 = MathHelper.floor_double(this.posZ); + return this.worldObj.getBlock(var1, var2 - 1, var3) == Blocks.grass && this.worldObj.getFullBlockLightValue(var1, var2, var3) > 8 && super.getCanSpawnHere(); + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() { + return 120; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return false; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) { + return 1 + this.worldObj.rand.nextInt(3); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) { + return p_70877_1_.getItem() == Items.wheat; + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (var2 != null && this.isBreedingItem(var2) && this.getGrowingAge() == 0 && this.inLove <= 0) { + if (!p_70085_1_.capabilities.isCreativeMode) { + --var2.stackSize; + + if (var2.stackSize <= 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + } + + this.func_146082_f(p_70085_1_); + return true; + } else { + return super.interact(p_70085_1_); + } + } + + public void func_146082_f(EntityPlayer p_146082_1_) { + this.inLove = 600; + this.field_146084_br = p_146082_1_; + this.entityToAttack = null; + this.worldObj.setEntityState(this, (byte)18); + } + + public EntityPlayer func_146083_cb() { + return this.field_146084_br; + } + + /** + * Returns if the entity is currently in 'love mode'. + */ + public boolean isInLove() { + return this.inLove > 0; + } + + public void resetInLove() { + this.inLove = 0; + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) { + return p_70878_1_ != this && (p_70878_1_.getClass() == this.getClass() && this.isInLove() && p_70878_1_.isInLove()); + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 18) { + for (int var2 = 0; var2 < 7; ++var2) { + double var3 = this.rand.nextGaussian() * 0.02D; + double var5 = this.rand.nextGaussian() * 0.02D; + double var7 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); + } + } else { + super.handleHealthUpdate(p_70103_1_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityBat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityBat.java new file mode 100644 index 0000000..699966a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityBat.java @@ -0,0 +1,238 @@ +package net.minecraft.entity.passive; + +import java.util.Calendar; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBat extends EntityAmbientCreature { + /** Coordinates of where the bat spawned. */ + private ChunkCoordinates spawnPosition; + + + public EntityBat(World p_i1680_1_) { + super(p_i1680_1_); + this.setSize(0.5F, 0.9F); + this.setIsBatHanging(true); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.1F; + } + + /** + * Gets the pitch of living sounds in living entities. + */ + protected float getSoundPitch() { + return super.getSoundPitch() * 0.95F; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.getIsBatHanging() && this.rand.nextInt(4) != 0 ? null : "mob.bat.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.bat.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.bat.death"; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() { + return false; + } + + protected void collideWithEntity(Entity p_82167_1_) {} + + protected void collideWithNearbyEntities() {} + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(6.0D); + } + + public boolean getIsBatHanging() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setIsBatHanging(boolean p_82236_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_82236_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return true; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.getIsBatHanging()) { + this.motionX = this.motionY = this.motionZ = 0.0D; + this.posY = (double)MathHelper.floor_double(this.posY) + 1.0D - (double)this.height; + } else { + this.motionY *= 0.6000000238418579D; + } + } + + protected void updateAITasks() { + super.updateAITasks(); + + if (this.getIsBatHanging()) { + if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ)).isNormalCube()) { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity(null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } else { + if (this.rand.nextInt(200) == 0) { + this.rotationYawHead = (float)this.rand.nextInt(360); + } + + if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity(null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + } else { + if (this.spawnPosition != null && (!this.worldObj.isAirBlock(this.spawnPosition.posX, this.spawnPosition.posY, this.spawnPosition.posZ) || this.spawnPosition.posY < 1)) { + this.spawnPosition = null; + } + + if (this.spawnPosition == null || this.rand.nextInt(30) == 0 || this.spawnPosition.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) { + this.spawnPosition = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); + } + + double var1 = (double)this.spawnPosition.posX + 0.5D - this.posX; + double var3 = (double)this.spawnPosition.posY + 0.1D - this.posY; + double var5 = (double)this.spawnPosition.posZ + 0.5D - this.posZ; + this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D; + this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; + this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D; + float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; + float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); + this.moveForward = 0.5F; + this.rotationYaw += var8; + + if (this.rand.nextInt(100) == 0 && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ)).isNormalCube()) { + this.setIsBatHanging(true); + } + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {} + + public boolean doesEntityNotTriggerPressurePlate() { + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + if (!this.worldObj.isClient && this.getIsBatHanging()) { + this.setIsBatHanging(false); + } + + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.dataWatcher.updateObject(16, Byte.valueOf(p_70037_1_.getByte("BatFlags"))); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + int var1 = MathHelper.floor_double(this.boundingBox.minY); + + if (var1 >= 63) { + return false; + } else { + int var2 = MathHelper.floor_double(this.posX); + int var3 = MathHelper.floor_double(this.posZ); + int var4 = this.worldObj.getBlockLightValue(var2, var1, var3); + byte var5 = 4; + Calendar var6 = this.worldObj.getCurrentDate(); + + if ((var6.get(2) + 1 != 10 || var6.get(5) < 20) && (var6.get(2) + 1 != 11 || var6.get(5) > 3)) { + if (this.rand.nextBoolean()) { + return false; + } + } else { + var5 = 7; + } + + return var4 <= this.rand.nextInt(var5) && super.getCanSpawnHere(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityChicken.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityChicken.java new file mode 100644 index 0000000..13d14ec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityChicken.java @@ -0,0 +1,213 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemSeeds; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityChicken extends EntityAnimal { + public float field_70886_e; + public float destPos; + public float field_70884_g; + public float field_70888_h; + public float field_70889_i = 1.0F; + + /** The time until the next egg is spawned. */ + public int timeUntilNextEgg; + public boolean field_152118_bv; + + + public EntityChicken(World p_i1682_1_) { + super(p_i1682_1_); + this.setSize(0.3F, 0.7F); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.wheat_seeds, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.field_70888_h = this.field_70886_e; + this.field_70884_g = this.destPos; + this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D); + + if (this.destPos < 0.0F) { + this.destPos = 0.0F; + } + + if (this.destPos > 1.0F) { + this.destPos = 1.0F; + } + + if (!this.onGround && this.field_70889_i < 1.0F) { + this.field_70889_i = 1.0F; + } + + this.field_70889_i = (float)((double)this.field_70889_i * 0.9D); + + if (!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + + this.field_70886_e += this.field_70889_i * 2.0F; + + if (!this.worldObj.isClient && !this.isChild() && !this.func_152116_bZ() && --this.timeUntilNextEgg <= 0) { + this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.func_145779_a(Items.egg, 1); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.chicken.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.chicken.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.chicken.hurt"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.chicken.step", 0.15F, 1.0F); + } + + protected Item func_146068_u() { + return Items.feather; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); + + for (int var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.feather, 1); + } + + if (this.isBurning()) { + this.func_145779_a(Items.cooked_chicken, 1); + } else { + this.func_145779_a(Items.chicken, 1); + } + } + + public EntityChicken createChild(EntityAgeable p_90011_1_) { + return new EntityChicken(this.worldObj); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) { + return p_70877_1_ != null && p_70877_1_.getItem() instanceof ItemSeeds; + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.field_152118_bv = p_70037_1_.getBoolean("IsChickenJockey"); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) { + return this.func_152116_bZ() ? 10 : super.getExperiencePoints(p_70693_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setBoolean("IsChickenJockey", this.field_152118_bv); + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return this.func_152116_bZ() && this.riddenByEntity == null; + } + + public void updateRiderPosition() { + super.updateRiderPosition(); + float var1 = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float var2 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float var3 = 0.1F; + float var4 = 0.0F; + this.riddenByEntity.setPosition(this.posX + (double)(var3 * var1), this.posY + (double)(this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double)var4, this.posZ - (double)(var3 * var2)); + + if (this.riddenByEntity instanceof EntityLivingBase) { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + + public boolean func_152116_bZ() { + return this.field_152118_bv; + } + + public void func_152117_i(boolean p_152117_1_) { + this.field_152118_bv = p_152117_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityCow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityCow.java new file mode 100644 index 0000000..6d57f07 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityCow.java @@ -0,0 +1,130 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class EntityCow extends EntityAnimal { + + + public EntityCow(World p_i1683_1_) { + super(p_i1683_1_); + this.setSize(0.9F, 1.3F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.cow.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.cow.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.cow.hurt"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.cow.step", 0.15F, 1.0F); + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item func_146068_u() { + return Items.leather; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); + int var4; + + for (var4 = 0; var4 < var3; ++var4) { + this.func_145779_a(Items.leather, 1); + } + + var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_); + + for (var4 = 0; var4 < var3; ++var4) { + if (this.isBurning()) { + this.func_145779_a(Items.cooked_beef, 1); + } else { + this.func_145779_a(Items.beef, 1); + } + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.bucket && !p_70085_1_.capabilities.isCreativeMode) { + if (var2.stackSize-- == 1) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, new ItemStack(Items.milk_bucket)); + } else if (!p_70085_1_.inventory.addItemStackToInventory(new ItemStack(Items.milk_bucket))) { + p_70085_1_.dropPlayerItemWithRandomChoice(new ItemStack(Items.milk_bucket, 1, 0), false); + } + + return true; + } else { + return super.interact(p_70085_1_); + } + } + + public EntityCow createChild(EntityAgeable p_90011_1_) { + return new EntityCow(this.worldObj); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityHorse.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityHorse.java new file mode 100644 index 0000000..8ba2790 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityHorse.java @@ -0,0 +1,1431 @@ +package net.minecraft.entity.passive; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAIRunAroundLikeCrazy; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.IInvBasic; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class EntityHorse extends EntityAnimal implements IInvBasic { + private static final IEntitySelector horseBreedingSelector = new IEntitySelector() { + + public boolean isEntityApplicable(Entity p_82704_1_) { + return p_82704_1_ instanceof EntityHorse && ((EntityHorse)p_82704_1_).func_110205_ce(); + } + }; + private static final IAttribute horseJumpStrength = (new RangedAttribute("horse.jumpStrength", 0.7D, 0.0D, 2.0D)).setDescription("Jump Strength").setShouldWatch(true); + private static final String[] horseArmorTextures = new String[] {null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; + private static final String[] field_110273_bx = new String[] {"", "meo", "goo", "dio"}; + private static final int[] armorValues = new int[] {0, 5, 7, 11}; + private static final String[] horseTextures = new String[] {"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; + private static final String[] field_110269_bA = new String[] {"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; + private static final String[] horseMarkingTextures = new String[] {null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; + private static final String[] field_110292_bC = new String[] {"", "wo_", "wmo", "wdo", "bdo"}; + private int eatingHaystackCounter; + private int openMouthCounter; + private int jumpRearingCounter; + public int field_110278_bp; + public int field_110279_bq; + protected boolean horseJumping; + private AnimalChest horseChest; + private boolean hasReproduced; + + /** + * "The higher this value, the more likely the horse is to be tamed next time a player rides it." + */ + protected int temper; + protected float jumpPower; + private boolean field_110294_bI; + private float headLean; + private float prevHeadLean; + private float rearingAmount; + private float prevRearingAmount; + private float mouthOpenness; + private float prevMouthOpenness; + private int field_110285_bP; + private String field_110286_bQ; + private final String[] field_110280_bR = new String[3]; + + + public EntityHorse(World p_i1685_1_) { + super(p_i1685_1_); + this.setSize(1.4F, 1.6F); + this.isImmuneToFire = false; + this.setChested(false); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.2D)); + this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWander(this, 0.7D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.func_110226_cD(); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + this.dataWatcher.addObject(19, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(20, Integer.valueOf(0)); + this.dataWatcher.addObject(21, ""); + this.dataWatcher.addObject(22, Integer.valueOf(0)); + } + + public void setHorseType(int p_110214_1_) { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)p_110214_1_)); + this.func_110230_cF(); + } + + /** + * returns the horse type + */ + public int getHorseType() { + return this.dataWatcher.getWatchableObjectByte(19); + } + + public void setHorseVariant(int p_110235_1_) { + this.dataWatcher.updateObject(20, Integer.valueOf(p_110235_1_)); + this.func_110230_cF(); + } + + public int getHorseVariant() { + return this.dataWatcher.getWatchableObjectInt(20); + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + if (this.hasCustomNameTag()) { + return this.getCustomNameTag(); + } else { + int var1 = this.getHorseType(); + + switch (var1) { + case 0: + default: + return StatCollector.translateToLocal("entity.horse.name"); + + case 1: + return StatCollector.translateToLocal("entity.donkey.name"); + + case 2: + return StatCollector.translateToLocal("entity.mule.name"); + + case 3: + return StatCollector.translateToLocal("entity.zombiehorse.name"); + + case 4: + return StatCollector.translateToLocal("entity.skeletonhorse.name"); + } + } + } + + private boolean getHorseWatchableBoolean(int p_110233_1_) { + return (this.dataWatcher.getWatchableObjectInt(16) & p_110233_1_) != 0; + } + + private void setHorseWatchableBoolean(int p_110208_1_, boolean p_110208_2_) { + int var3 = this.dataWatcher.getWatchableObjectInt(16); + + if (p_110208_2_) { + this.dataWatcher.updateObject(16, Integer.valueOf(var3 | p_110208_1_)); + } else { + this.dataWatcher.updateObject(16, Integer.valueOf(var3 & ~p_110208_1_)); + } + } + + public boolean isAdultHorse() { + return !this.isChild(); + } + + public boolean isTame() { + return this.getHorseWatchableBoolean(2); + } + + public boolean func_110253_bW() { + return this.isAdultHorse(); + } + + public String func_152119_ch() { + return this.dataWatcher.getWatchableObjectString(21); + } + + public void func_152120_b(String p_152120_1_) { + this.dataWatcher.updateObject(21, p_152120_1_); + } + + public float getHorseSize() { + int var1 = this.getGrowingAge(); + return var1 >= 0 ? 1.0F : 0.5F + (float)(-24000 - var1) / -24000.0F * 0.5F; + } + + /** + * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." + */ + public void setScaleForAge(boolean p_98054_1_) { + if (p_98054_1_) { + this.setScale(this.getHorseSize()); + } else { + this.setScale(1.0F); + } + } + + public boolean isHorseJumping() { + return this.horseJumping; + } + + public void setHorseTamed(boolean p_110234_1_) { + this.setHorseWatchableBoolean(2, p_110234_1_); + } + + public void setHorseJumping(boolean p_110255_1_) { + this.horseJumping = p_110255_1_; + } + + public boolean allowLeashing() { + return !this.func_110256_cu() && super.allowLeashing(); + } + + protected void func_142017_o(float p_142017_1_) { + if (p_142017_1_ > 6.0F && this.isEatingHaystack()) { + this.setEatingHaystack(false); + } + } + + public boolean isChested() { + return this.getHorseWatchableBoolean(8); + } + + public int func_110241_cb() { + return this.dataWatcher.getWatchableObjectInt(22); + } + + /** + * 0 = iron, 1 = gold, 2 = diamond + */ + private int getHorseArmorIndex(ItemStack p_110260_1_) { + if (p_110260_1_ == null) { + return 0; + } else { + Item var2 = p_110260_1_.getItem(); + return var2 == Items.iron_horse_armor ? 1 : (var2 == Items.golden_horse_armor ? 2 : (var2 == Items.diamond_horse_armor ? 3 : 0)); + } + } + + public boolean isEatingHaystack() { + return this.getHorseWatchableBoolean(32); + } + + public boolean isRearing() { + return this.getHorseWatchableBoolean(64); + } + + public boolean func_110205_ce() { + return this.getHorseWatchableBoolean(16); + } + + public boolean getHasReproduced() { + return this.hasReproduced; + } + + public void func_146086_d(ItemStack p_146086_1_) { + this.dataWatcher.updateObject(22, Integer.valueOf(this.getHorseArmorIndex(p_146086_1_))); + this.func_110230_cF(); + } + + public void func_110242_l(boolean p_110242_1_) { + this.setHorseWatchableBoolean(16, p_110242_1_); + } + + public void setChested(boolean p_110207_1_) { + this.setHorseWatchableBoolean(8, p_110207_1_); + } + + public void setHasReproduced(boolean p_110221_1_) { + this.hasReproduced = p_110221_1_; + } + + public void setHorseSaddled(boolean p_110251_1_) { + this.setHorseWatchableBoolean(4, p_110251_1_); + } + + public int getTemper() { + return this.temper; + } + + public void setTemper(int p_110238_1_) { + this.temper = p_110238_1_; + } + + public int increaseTemper(int p_110198_1_) { + int var2 = MathHelper.clamp_int(this.getTemper() + p_110198_1_, 0, this.getMaxTemper()); + this.setTemper(var2); + return var2; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + Entity var3 = p_70097_1_.getEntity(); + return (this.riddenByEntity == null || !this.riddenByEntity.equals(var3)) && super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return armorValues[this.func_110241_cb()]; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() { + return this.riddenByEntity == null; + } + + public boolean prepareChunkForSpawn() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posZ); + this.worldObj.getBiomeGenForCoords(var1, var2); + return true; + } + + public void dropChests() { + if (!this.worldObj.isClient && this.isChested()) { + this.func_145779_a(Item.getItemFromBlock(Blocks.chest), 1); + this.setChested(false); + } + } + + private void func_110266_cB() { + this.openHorseMouth(); + this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + if (p_70069_1_ > 1.0F) { + this.playSound("mob.horse.land", 0.4F, 1.0F); + } + + int var2 = MathHelper.ceiling_float_int(p_70069_1_ * 0.5F - 3.0F); + + if (var2 > 0) { + this.attackEntityFrom(DamageSource.fall, (float)var2); + + if (this.riddenByEntity != null) { + this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)var2); + } + + Block var3 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.2D - (double)this.prevRotationYaw), MathHelper.floor_double(this.posZ)); + + if (var3.getMaterial() != Material.air) { + Block.SoundType var4 = var3.stepSound; + this.worldObj.playSoundAtEntity(this, var4.func_150498_e(), var4.func_150497_c() * 0.5F, var4.func_150494_d() * 0.75F); + } + } + } + + private int func_110225_cC() { + int var1 = this.getHorseType(); + return this.isChested() && (var1 == 1 || var1 == 2) ? 17 : 2; + } + + private void func_110226_cD() { + AnimalChest var1 = this.horseChest; + this.horseChest = new AnimalChest("HorseChest", this.func_110225_cC()); + this.horseChest.func_110133_a(this.getCommandSenderName()); + + if (var1 != null) { + var1.func_110132_b(this); + int var2 = Math.min(var1.getSizeInventory(), this.horseChest.getSizeInventory()); + + for (int var3 = 0; var3 < var2; ++var3) { + ItemStack var4 = var1.getStackInSlot(var3); + + if (var4 != null) { + this.horseChest.setInventorySlotContents(var3, var4.copy()); + } + } + + var1 = null; + } + + this.horseChest.func_110134_a(this); + this.func_110232_cE(); + } + + private void func_110232_cE() { + if (!this.worldObj.isClient) { + this.setHorseSaddled(this.horseChest.getStackInSlot(0) != null); + + if (this.func_110259_cr()) { + this.func_146086_d(this.horseChest.getStackInSlot(1)); + } + } + } + + /** + * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. + */ + public void onInventoryChanged(InventoryBasic p_76316_1_) { + int var2 = this.func_110241_cb(); + boolean var3 = this.isHorseSaddled(); + this.func_110232_cE(); + + if (this.ticksExisted > 20) { + if (var2 == 0 && var2 != this.func_110241_cb()) { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } else if (var2 != this.func_110241_cb()) { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + + if (!var3 && this.isHorseSaddled()) { + this.playSound("mob.horse.leather", 0.5F, 1.0F); + } + } + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + this.prepareChunkForSpawn(); + return super.getCanSpawnHere(); + } + + protected EntityHorse getClosestHorse(Entity p_110250_1_, double p_110250_2_) { + double var4 = Double.MAX_VALUE; + Entity var6 = null; + List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(p_110250_1_, p_110250_1_.boundingBox.addCoord(p_110250_2_, p_110250_2_, p_110250_2_), horseBreedingSelector); + Iterator var8 = var7.iterator(); + + while (var8.hasNext()) { + Entity var9 = (Entity)var8.next(); + double var10 = var9.getDistanceSq(p_110250_1_.posX, p_110250_1_.posY, p_110250_1_.posZ); + + if (var10 < var4) { + var6 = var9; + var4 = var10; + } + } + + return (EntityHorse)var6; + } + + public double getHorseJumpStrength() { + return this.getEntityAttribute(horseJumpStrength).getAttributeValue(); + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + this.openHorseMouth(); + int var1 = this.getHorseType(); + return var1 == 3 ? "mob.horse.zombie.death" : (var1 == 4 ? "mob.horse.skeleton.death" : (var1 != 1 && var1 != 2 ? "mob.horse.death" : "mob.horse.donkey.death")); + } + + protected Item func_146068_u() { + boolean var1 = this.rand.nextInt(4) == 0; + int var2 = this.getHorseType(); + return var2 == 4 ? Items.bone : (var2 == 3 ? (var1 ? Item.getItemById(0) : Items.rotten_flesh) : Items.leather); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + this.openHorseMouth(); + + if (this.rand.nextInt(3) == 0) { + this.makeHorseRear(); + } + + int var1 = this.getHorseType(); + return var1 == 3 ? "mob.horse.zombie.hit" : (var1 == 4 ? "mob.horse.skeleton.hit" : (var1 != 1 && var1 != 2 ? "mob.horse.hit" : "mob.horse.donkey.hit")); + } + + public boolean isHorseSaddled() { + return this.getHorseWatchableBoolean(4); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + this.openHorseMouth(); + + if (this.rand.nextInt(10) == 0 && !this.isMovementBlocked()) { + this.makeHorseRear(); + } + + int var1 = this.getHorseType(); + return var1 == 3 ? "mob.horse.zombie.idle" : (var1 == 4 ? "mob.horse.skeleton.idle" : (var1 != 1 && var1 != 2 ? "mob.horse.idle" : "mob.horse.donkey.idle")); + } + + protected String getAngrySoundName() { + this.openHorseMouth(); + this.makeHorseRear(); + int var1 = this.getHorseType(); + return var1 != 3 && var1 != 4 ? (var1 != 1 && var1 != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + Block.SoundType var5 = p_145780_4_.stepSound; + + if (this.worldObj.getBlock(p_145780_1_, p_145780_2_ + 1, p_145780_3_) == Blocks.snow_layer) { + var5 = Blocks.snow_layer.stepSound; + } + + if (!p_145780_4_.getMaterial().isLiquid()) { + int var6 = this.getHorseType(); + + if (this.riddenByEntity != null && var6 != 1 && var6 != 2) { + ++this.field_110285_bP; + + if (this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) { + this.playSound("mob.horse.gallop", var5.func_150497_c() * 0.15F, var5.func_150494_d()); + + if (var6 == 0 && this.rand.nextInt(10) == 0) { + this.playSound("mob.horse.breathe", var5.func_150497_c() * 0.6F, var5.func_150494_d()); + } + } else if (this.field_110285_bP <= 5) { + this.playSound("mob.horse.wood", var5.func_150497_c() * 0.15F, var5.func_150494_d()); + } + } else if (var5 == Block.soundTypeWood) { + this.playSound("mob.horse.wood", var5.func_150497_c() * 0.15F, var5.func_150494_d()); + } else { + this.playSound("mob.horse.soft", var5.func_150497_c() * 0.15F, var5.func_150494_d()); + } + } + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(horseJumpStrength); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(53.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.22499999403953552D); + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 6; + } + + public int getMaxTemper() { + return 100; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.8F; + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() { + return 400; + } + + public boolean func_110239_cn() { + return this.getHorseType() == 0 || this.func_110241_cb() > 0; + } + + private void func_110230_cF() { + this.field_110286_bQ = null; + } + + private void setHorseTexturePaths() { + this.field_110286_bQ = "horse/"; + this.field_110280_bR[0] = null; + this.field_110280_bR[1] = null; + this.field_110280_bR[2] = null; + int var1 = this.getHorseType(); + int var2 = this.getHorseVariant(); + int var3; + + if (var1 == 0) { + var3 = var2 & 255; + int var4 = (var2 & 65280) >> 8; + this.field_110280_bR[0] = horseTextures[var3]; + this.field_110286_bQ = this.field_110286_bQ + field_110269_bA[var3]; + this.field_110280_bR[1] = horseMarkingTextures[var4]; + this.field_110286_bQ = this.field_110286_bQ + field_110292_bC[var4]; + } else { + this.field_110280_bR[0] = ""; + this.field_110286_bQ = this.field_110286_bQ + "_" + var1 + "_"; + } + + var3 = this.func_110241_cb(); + this.field_110280_bR[2] = horseArmorTextures[var3]; + this.field_110286_bQ = this.field_110286_bQ + field_110273_bx[var3]; + } + + public String getHorseTexture() { + if (this.field_110286_bQ == null) { + this.setHorseTexturePaths(); + } + + return this.field_110286_bQ; + } + + public String[] getVariantTexturePaths() { + if (this.field_110286_bQ == null) { + this.setHorseTexturePaths(); + } + + return this.field_110280_bR; + } + + public void openGUI(EntityPlayer p_110199_1_) { + if (!this.worldObj.isClient && (this.riddenByEntity == null || this.riddenByEntity == p_110199_1_) && this.isTame()) { + this.horseChest.func_110133_a(this.getCommandSenderName()); + p_110199_1_.displayGUIHorse(this, this.horseChest); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.spawn_egg) { + return super.interact(p_70085_1_); + } else if (!this.isTame() && this.func_110256_cu()) { + return false; + } else if (this.isTame() && this.isAdultHorse() && p_70085_1_.isSneaking()) { + this.openGUI(p_70085_1_); + return true; + } else if (this.func_110253_bW() && this.riddenByEntity != null) { + return super.interact(p_70085_1_); + } else { + if (var2 != null) { + boolean var3 = false; + + if (this.func_110259_cr()) { + byte var4 = -1; + + if (var2.getItem() == Items.iron_horse_armor) { + var4 = 1; + } else if (var2.getItem() == Items.golden_horse_armor) { + var4 = 2; + } else if (var2.getItem() == Items.diamond_horse_armor) { + var4 = 3; + } + + if (var4 >= 0) { + if (!this.isTame()) { + this.makeHorseRearWithSound(); + return true; + } + + this.openGUI(p_70085_1_); + return true; + } + } + + if (!var3 && !this.func_110256_cu()) { + float var7 = 0.0F; + short var5 = 0; + byte var6 = 0; + + if (var2.getItem() == Items.wheat) { + var7 = 2.0F; + var5 = 60; + var6 = 3; + } else if (var2.getItem() == Items.sugar) { + var7 = 1.0F; + var5 = 30; + var6 = 3; + } else if (var2.getItem() == Items.bread) { + var7 = 7.0F; + var5 = 180; + var6 = 3; + } else if (Block.getBlockFromItem(var2.getItem()) == Blocks.hay_block) { + var7 = 20.0F; + var5 = 180; + } else if (var2.getItem() == Items.apple) { + var7 = 3.0F; + var5 = 60; + var6 = 3; + } else if (var2.getItem() == Items.golden_carrot) { + var7 = 4.0F; + var5 = 60; + var6 = 5; + + if (this.isTame() && this.getGrowingAge() == 0) { + var3 = true; + this.func_146082_f(p_70085_1_); + } + } else if (var2.getItem() == Items.golden_apple) { + var7 = 10.0F; + var5 = 240; + var6 = 10; + + if (this.isTame() && this.getGrowingAge() == 0) { + var3 = true; + this.func_146082_f(p_70085_1_); + } + } + + if (this.getHealth() < this.getMaxHealth() && var7 > 0.0F) { + this.heal(var7); + var3 = true; + } + + if (!this.isAdultHorse() && var5 > 0) { + this.addGrowth(var5); + var3 = true; + } + + if (var6 > 0 && (var3 || !this.isTame()) && var6 < this.getMaxTemper()) { + var3 = true; + this.increaseTemper(var6); + } + + if (var3) { + this.func_110266_cB(); + } + } + + if (!this.isTame() && !var3) { + if (var2 != null && var2.interactWithEntity(p_70085_1_, this)) { + return true; + } + + this.makeHorseRearWithSound(); + return true; + } + + if (!var3 && this.func_110229_cs() && !this.isChested() && var2.getItem() == Item.getItemFromBlock(Blocks.chest)) { + this.setChested(true); + this.playSound("mob.chickenplop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + var3 = true; + this.func_110226_cD(); + } + + if (!var3 && this.func_110253_bW() && !this.isHorseSaddled() && var2.getItem() == Items.saddle) { + this.openGUI(p_70085_1_); + return true; + } + + if (var3) { + if (!p_70085_1_.capabilities.isCreativeMode && --var2.stackSize == 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + + return true; + } + } + + if (this.func_110253_bW() && this.riddenByEntity == null) { + if (var2 != null && var2.interactWithEntity(p_70085_1_, this)) { + return true; + } else { + this.func_110237_h(p_70085_1_); + return true; + } + } else { + return super.interact(p_70085_1_); + } + } + } + + private void func_110237_h(EntityPlayer p_110237_1_) { + p_110237_1_.rotationYaw = this.rotationYaw; + p_110237_1_.rotationPitch = this.rotationPitch; + this.setEatingHaystack(false); + this.setRearing(false); + + if (!this.worldObj.isClient) { + p_110237_1_.mountEntity(this); + } + } + + public boolean func_110259_cr() { + return this.getHorseType() == 0; + } + + public boolean func_110229_cs() { + int var1 = this.getHorseType(); + return var1 == 2 || var1 == 1; + } + + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() { + return this.riddenByEntity != null && this.isHorseSaddled() || this.isEatingHaystack() || this.isRearing(); + } + + public boolean func_110256_cu() { + int var1 = this.getHorseType(); + return var1 == 3 || var1 == 4; + } + + public boolean func_110222_cv() { + return this.func_110256_cu() || this.getHorseType() == 2; + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) { + return false; + } + + private void func_110210_cH() { + this.field_110278_bp = 1; + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + super.onDeath(p_70645_1_); + + if (!this.worldObj.isClient) { + this.dropChestItems(); + } + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.rand.nextInt(200) == 0) { + this.func_110210_cH(); + } + + super.onLivingUpdate(); + + if (!this.worldObj.isClient) { + if (this.rand.nextInt(900) == 0 && this.deathTime == 0) { + this.heal(1.0F); + } + + if (!this.isEatingHaystack() && this.riddenByEntity == null && this.rand.nextInt(300) == 0 && this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ)) == Blocks.grass) { + this.setEatingHaystack(true); + } + + if (this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) { + this.eatingHaystackCounter = 0; + this.setEatingHaystack(false); + } + + if (this.func_110205_ce() && !this.isAdultHorse() && !this.isEatingHaystack()) { + EntityHorse var1 = this.getClosestHorse(this, 16.0D); + + if (var1 != null && this.getDistanceSqToEntity(var1) > 4.0D) { + PathEntity var2 = this.worldObj.getPathEntityToEntity(this, var1, 16.0F, true, false, false, true); + this.setPathToEntity(var2); + } + } + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.worldObj.isClient && this.dataWatcher.hasChanges()) { + this.dataWatcher.func_111144_e(); + this.func_110230_cF(); + } + + if (this.openMouthCounter > 0 && ++this.openMouthCounter > 30) { + this.openMouthCounter = 0; + this.setHorseWatchableBoolean(128, false); + } + + if (!this.worldObj.isClient && this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) { + this.jumpRearingCounter = 0; + this.setRearing(false); + } + + if (this.field_110278_bp > 0 && ++this.field_110278_bp > 8) { + this.field_110278_bp = 0; + } + + if (this.field_110279_bq > 0) { + ++this.field_110279_bq; + + if (this.field_110279_bq > 300) { + this.field_110279_bq = 0; + } + } + + this.prevHeadLean = this.headLean; + + if (this.isEatingHaystack()) { + this.headLean += (1.0F - this.headLean) * 0.4F + 0.05F; + + if (this.headLean > 1.0F) { + this.headLean = 1.0F; + } + } else { + this.headLean += (0.0F - this.headLean) * 0.4F - 0.05F; + + if (this.headLean < 0.0F) { + this.headLean = 0.0F; + } + } + + this.prevRearingAmount = this.rearingAmount; + + if (this.isRearing()) { + this.prevHeadLean = this.headLean = 0.0F; + this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F; + + if (this.rearingAmount > 1.0F) { + this.rearingAmount = 1.0F; + } + } else { + this.field_110294_bI = false; + this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount - this.rearingAmount) * 0.6F - 0.05F; + + if (this.rearingAmount < 0.0F) { + this.rearingAmount = 0.0F; + } + } + + this.prevMouthOpenness = this.mouthOpenness; + + if (this.getHorseWatchableBoolean(128)) { + this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F; + + if (this.mouthOpenness > 1.0F) { + this.mouthOpenness = 1.0F; + } + } else { + this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F; + + if (this.mouthOpenness < 0.0F) { + this.mouthOpenness = 0.0F; + } + } + } + + private void openHorseMouth() { + if (!this.worldObj.isClient) { + this.openMouthCounter = 1; + this.setHorseWatchableBoolean(128, true); + } + } + + private boolean func_110200_cJ() { + return this.riddenByEntity == null && this.ridingEntity == null && this.isTame() && this.isAdultHorse() && !this.func_110222_cv() && this.getHealth() >= this.getMaxHealth(); + } + + public void setEating(boolean p_70019_1_) { + this.setHorseWatchableBoolean(32, p_70019_1_); + } + + public void setEatingHaystack(boolean p_110227_1_) { + this.setEating(p_110227_1_); + } + + public void setRearing(boolean p_110219_1_) { + if (p_110219_1_) { + this.setEatingHaystack(false); + } + + this.setHorseWatchableBoolean(64, p_110219_1_); + } + + private void makeHorseRear() { + if (!this.worldObj.isClient) { + this.jumpRearingCounter = 1; + this.setRearing(true); + } + } + + public void makeHorseRearWithSound() { + this.makeHorseRear(); + String var1 = this.getAngrySoundName(); + + if (var1 != null) { + this.playSound(var1, this.getSoundVolume(), this.getSoundPitch()); + } + } + + public void dropChestItems() { + this.dropItemsInChest(this, this.horseChest); + this.dropChests(); + } + + private void dropItemsInChest(Entity p_110240_1_, AnimalChest p_110240_2_) { + if (p_110240_2_ != null && !this.worldObj.isClient) { + for (int var3 = 0; var3 < p_110240_2_.getSizeInventory(); ++var3) { + ItemStack var4 = p_110240_2_.getStackInSlot(var3); + + if (var4 != null) { + this.entityDropItem(var4, 0.0F); + } + } + } + } + + public boolean setTamedBy(EntityPlayer p_110263_1_) { + this.func_152120_b(p_110263_1_.getUniqueID().toString()); + this.setHorseTamed(true); + return true; + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase && this.isHorseSaddled()) { + this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; + this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; + this.setRotation(this.rotationYaw, this.rotationPitch); + this.rotationYawHead = this.renderYawOffset = this.rotationYaw; + p_70612_1_ = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; + p_70612_2_ = ((EntityLivingBase)this.riddenByEntity).moveForward; + + if (p_70612_2_ <= 0.0F) { + p_70612_2_ *= 0.25F; + this.field_110285_bP = 0; + } + + if (this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) { + p_70612_1_ = 0.0F; + p_70612_2_ = 0.0F; + } + + if (this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) { + this.motionY = this.getHorseJumpStrength() * (double)this.jumpPower; + + if (this.isPotionActive(Potion.jump)) { + this.motionY += (float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F; + } + + this.setHorseJumping(true); + this.isAirBorne = true; + + if (p_70612_2_ > 0.0F) { + float var3 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float var4 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); + this.motionX += -0.4F * var3 * this.jumpPower; + this.motionZ += 0.4F * var4 * this.jumpPower; + this.playSound("mob.horse.jump", 0.4F, 1.0F); + } + + this.jumpPower = 0.0F; + } + + this.stepHeight = 1.0F; + this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; + + if (!this.worldObj.isClient) { + this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + } + + if (this.onGround) { + this.jumpPower = 0.0F; + this.setHorseJumping(false); + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double var8 = this.posX - this.prevPosX; + double var5 = this.posZ - this.prevPosZ; + float var7 = MathHelper.sqrt_double(var8 * var8 + var5 * var5) * 4.0F; + + if (var7 > 1.0F) { + var7 = 1.0F; + } + + this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } else { + this.stepHeight = 0.5F; + this.jumpMovementFactor = 0.02F; + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setBoolean("EatingHaystack", this.isEatingHaystack()); + p_70014_1_.setBoolean("ChestedHorse", this.isChested()); + p_70014_1_.setBoolean("HasReproduced", this.getHasReproduced()); + p_70014_1_.setBoolean("Bred", this.func_110205_ce()); + p_70014_1_.setInteger("Type", this.getHorseType()); + p_70014_1_.setInteger("Variant", this.getHorseVariant()); + p_70014_1_.setInteger("Temper", this.getTemper()); + p_70014_1_.setBoolean("Tame", this.isTame()); + p_70014_1_.setString("OwnerUUID", this.func_152119_ch()); + + if (this.isChested()) { + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 2; var3 < this.horseChest.getSizeInventory(); ++var3) { + ItemStack var4 = this.horseChest.getStackInSlot(var3); + + if (var4 != null) { + NBTTagCompound var5 = new NBTTagCompound(); + var5.setByte("Slot", (byte)var3); + var4.writeToNBT(var5); + var2.appendTag(var5); + } + } + + p_70014_1_.setTag("Items", var2); + } + + if (this.horseChest.getStackInSlot(1) != null) { + p_70014_1_.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound())); + } + + if (this.horseChest.getStackInSlot(0) != null) { + p_70014_1_.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound())); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setEatingHaystack(p_70037_1_.getBoolean("EatingHaystack")); + this.func_110242_l(p_70037_1_.getBoolean("Bred")); + this.setChested(p_70037_1_.getBoolean("ChestedHorse")); + this.setHasReproduced(p_70037_1_.getBoolean("HasReproduced")); + this.setHorseType(p_70037_1_.getInteger("Type")); + this.setHorseVariant(p_70037_1_.getInteger("Variant")); + this.setTemper(p_70037_1_.getInteger("Temper")); + this.setHorseTamed(p_70037_1_.getBoolean("Tame")); + + if (p_70037_1_.func_150297_b("OwnerUUID", 8)) { + this.func_152120_b(p_70037_1_.getString("OwnerUUID")); + } + + IAttributeInstance var2 = this.getAttributeMap().getAttributeInstanceByName("Speed"); + + if (var2 != null) { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(var2.getBaseValue() * 0.25D); + } + + if (this.isChested()) { + NBTTagList var3 = p_70037_1_.getTagList("Items", 10); + this.func_110226_cD(); + + for (int var4 = 0; var4 < var3.tagCount(); ++var4) { + NBTTagCompound var5 = var3.getCompoundTagAt(var4); + int var6 = var5.getByte("Slot") & 255; + + if (var6 >= 2 && var6 < this.horseChest.getSizeInventory()) { + this.horseChest.setInventorySlotContents(var6, ItemStack.loadItemStackFromNBT(var5)); + } + } + } + + ItemStack var7; + + if (p_70037_1_.func_150297_b("ArmorItem", 10)) { + var7 = ItemStack.loadItemStackFromNBT(p_70037_1_.getCompoundTag("ArmorItem")); + + if (var7 != null && func_146085_a(var7.getItem())) { + this.horseChest.setInventorySlotContents(1, var7); + } + } + + if (p_70037_1_.func_150297_b("SaddleItem", 10)) { + var7 = ItemStack.loadItemStackFromNBT(p_70037_1_.getCompoundTag("SaddleItem")); + + if (var7 != null && var7.getItem() == Items.saddle) { + this.horseChest.setInventorySlotContents(0, var7); + } + } else if (p_70037_1_.getBoolean("Saddle")) { + this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle)); + } + + this.func_110232_cE(); + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) { + if (p_70878_1_ == this) { + return false; + } else if (p_70878_1_.getClass() != this.getClass()) { + return false; + } else { + EntityHorse var2 = (EntityHorse)p_70878_1_; + + if (this.func_110200_cJ() && var2.func_110200_cJ()) { + int var3 = this.getHorseType(); + int var4 = var2.getHorseType(); + return var3 == var4 || var3 == 0 && var4 == 1 || var3 == 1 && var4 == 0; + } else { + return false; + } + } + } + + public EntityAgeable createChild(EntityAgeable p_90011_1_) { + EntityHorse var2 = (EntityHorse)p_90011_1_; + EntityHorse var3 = new EntityHorse(this.worldObj); + int var4 = this.getHorseType(); + int var5 = var2.getHorseType(); + int var6 = 0; + + if (var4 == var5) { + var6 = var4; + } else if (var4 == 0 && var5 == 1 || var4 == 1 && var5 == 0) { + var6 = 2; + } + + if (var6 == 0) { + int var8 = this.rand.nextInt(9); + int var7; + + if (var8 < 4) { + var7 = this.getHorseVariant() & 255; + } else if (var8 < 8) { + var7 = var2.getHorseVariant() & 255; + } else { + var7 = this.rand.nextInt(7); + } + + int var9 = this.rand.nextInt(5); + + if (var9 < 2) { + var7 |= this.getHorseVariant() & 65280; + } else if (var9 < 4) { + var7 |= var2.getHorseVariant() & 65280; + } else { + var7 |= this.rand.nextInt(5) << 8 & 65280; + } + + var3.setHorseVariant(var7); + } + + var3.setHorseType(var6); + double var13 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + p_90011_1_.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + (double)this.func_110267_cL(); + var3.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(var13 / 3.0D); + double var14 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + p_90011_1_.getEntityAttribute(horseJumpStrength).getBaseValue() + this.func_110245_cM(); + var3.getEntityAttribute(horseJumpStrength).setBaseValue(var14 / 3.0D); + double var11 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + p_90011_1_.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + this.func_110203_cN(); + var3.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(var11 / 3.0D); + return var3; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_); + boolean var2 = false; + int var3 = 0; + int var7; + + if (p_110161_1_1 instanceof EntityHorse.GroupData) { + var7 = ((EntityHorse.GroupData)p_110161_1_1).field_111107_a; + var3 = ((EntityHorse.GroupData)p_110161_1_1).field_111106_b & 255 | this.rand.nextInt(5) << 8; + } else { + if (this.rand.nextInt(10) == 0) { + var7 = 1; + } else { + int var4 = this.rand.nextInt(7); + int var5 = this.rand.nextInt(5); + var7 = 0; + var3 = var4 | var5 << 8; + } + + p_110161_1_1 = new EntityHorse.GroupData(var7, var3); + } + + this.setHorseType(var7); + this.setHorseVariant(var3); + + if (this.rand.nextInt(5) == 0) { + this.setGrowingAge(-24000); + } + + if (var7 != 4 && var7 != 3) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.func_110267_cL()); + + if (var7 == 0) { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(this.func_110203_cN()); + } else { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.17499999701976776D); + } + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + if (var7 != 2 && var7 != 1) { + this.getEntityAttribute(horseJumpStrength).setBaseValue(this.func_110245_cM()); + } else { + this.getEntityAttribute(horseJumpStrength).setBaseValue(0.5D); + } + + this.setHealth(this.getMaxHealth()); + return (IEntityLivingData)p_110161_1_1; + } + + public float getGrassEatingAmount(float p_110258_1_) { + return this.prevHeadLean + (this.headLean - this.prevHeadLean) * p_110258_1_; + } + + public float getRearingAmount(float p_110223_1_) { + return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * p_110223_1_; + } + + public float func_110201_q(float p_110201_1_) { + return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * p_110201_1_; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return true; + } + + public void setJumpPower(int p_110206_1_) { + if (this.isHorseSaddled()) { + if (p_110206_1_ < 0) { + p_110206_1_ = 0; + } else { + this.field_110294_bI = true; + this.makeHorseRear(); + } + + if (p_110206_1_ >= 90) { + this.jumpPower = 1.0F; + } else { + this.jumpPower = 0.4F + 0.4F * (float)p_110206_1_ / 90.0F; + } + } + } + + /** + * "Spawns particles for the horse entity. par1 tells whether to spawn hearts. If it is false, it spawns smoke." + */ + protected void spawnHorseParticles(boolean p_110216_1_) { + String var2 = p_110216_1_ ? "heart" : "smoke"; + + for (int var3 = 0; var3 < 7; ++var3) { + double var4 = this.rand.nextGaussian() * 0.02D; + double var6 = this.rand.nextGaussian() * 0.02D; + double var8 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); + } + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 7) { + this.spawnHorseParticles(true); + } else if (p_70103_1_ == 6) { + this.spawnHorseParticles(false); + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + public void updateRiderPosition() { + super.updateRiderPosition(); + + if (this.prevRearingAmount > 0.0F) { + float var1 = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float var2 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float var3 = 0.7F * this.prevRearingAmount; + float var4 = 0.15F * this.prevRearingAmount; + this.riddenByEntity.setPosition(this.posX + (double)(var3 * var1), this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + (double)var4, this.posZ - (double)(var3 * var2)); + + if (this.riddenByEntity instanceof EntityLivingBase) { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + } + + private float func_110267_cL() { + return 15.0F + (float)this.rand.nextInt(8) + (float)this.rand.nextInt(9); + } + + private double func_110245_cM() { + return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D; + } + + private double func_110203_cN() { + return (0.44999998807907104D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D) * 0.25D; + } + + public static boolean func_146085_a(Item p_146085_0_) { + return p_146085_0_ == Items.iron_horse_armor || p_146085_0_ == Items.golden_horse_armor || p_146085_0_ == Items.diamond_horse_armor; + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() { + return false; + } + + public static class GroupData implements IEntityLivingData { + public int field_111107_a; + public int field_111106_b; + + + public GroupData(int p_i1684_1_, int p_i1684_2_) { + this.field_111107_a = p_i1684_1_; + this.field_111106_b = p_i1684_2_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java new file mode 100644 index 0000000..968f46d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java @@ -0,0 +1,65 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class EntityMooshroom extends EntityCow { + + + public EntityMooshroom(World p_i1687_1_) { + super(p_i1687_1_); + this.setSize(0.9F, 1.3F); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.bowl && this.getGrowingAge() >= 0) { + if (var2.stackSize == 1) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, new ItemStack(Items.mushroom_stew)); + return true; + } + + if (p_70085_1_.inventory.addItemStackToInventory(new ItemStack(Items.mushroom_stew)) && !p_70085_1_.capabilities.isCreativeMode) { + p_70085_1_.inventory.decrStackSize(p_70085_1_.inventory.currentItem, 1); + return true; + } + } + + if (var2 != null && var2.getItem() == Items.shears && this.getGrowingAge() >= 0) { + this.setDead(); + this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); + + if (!this.worldObj.isClient) { + EntityCow var3 = new EntityCow(this.worldObj); + var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + var3.setHealth(this.getHealth()); + var3.renderYawOffset = this.renderYawOffset; + this.worldObj.spawnEntityInWorld(var3); + + for (int var4 = 0; var4 < 5; ++var4) { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Blocks.red_mushroom))); + } + + var2.damageItem(1, p_70085_1_); + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + } + + return true; + } else { + return super.interact(p_70085_1_); + } + } + + public EntityMooshroom createChild(EntityAgeable p_90011_1_) { + return new EntityMooshroom(this.worldObj); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityOcelot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityOcelot.java new file mode 100644 index 0000000..b177f42 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityOcelot.java @@ -0,0 +1,307 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIOcelotAttack; +import net.minecraft.entity.ai.EntityAIOcelotSit; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class EntityOcelot extends EntityTameable { + /** + * The tempt AI task for this mob, used to prevent taming while it is fleeing. + */ + private final EntityAITempt aiTempt; + + + public EntityOcelot(World p_i1688_1_) { + super(p_i1688_1_); + this.setSize(0.6F, 0.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true)); + this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F)); + this.tasks.addTask(6, new EntityAIOcelotSit(this, 1.33D)); + this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F)); + this.tasks.addTask(8, new EntityAIOcelotAttack(this)); + this.tasks.addTask(9, new EntityAIMate(this, 0.8D)); + this.tasks.addTask(10, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); + this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false)); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + public void updateAITick() { + if (this.getMoveHelper().isUpdating()) { + double var1 = this.getMoveHelper().getSpeed(); + + if (var1 == 0.6D) { + this.setSneaking(true); + this.setSprinting(false); + } else if (var1 == 1.33D) { + this.setSneaking(false); + this.setSprinting(true); + } else { + this.setSneaking(false); + this.setSprinting(false); + } + } else { + this.setSneaking(false); + this.setSprinting(false); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return !this.isTamed() && this.ticksExisted > 2400; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("CatType", this.getTameSkin()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setTameSkin(p_70037_1_.getInteger("CatType")); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isTamed() ? (this.isInLove() ? "mob.cat.purr" : (this.rand.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.cat.hitt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.cat.hitt"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item func_146068_u() { + return Items.leather; + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + this.aiSit.setSitting(false); + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {} + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (this.isTamed()) { + if (this.func_152114_e(p_70085_1_) && !this.worldObj.isClient && !this.isBreedingItem(var2)) { + this.aiSit.setSitting(!this.isSitting()); + } + } else if (this.aiTempt.isRunning() && var2 != null && var2.getItem() == Items.fish && p_70085_1_.getDistanceSqToEntity(this) < 9.0D) { + if (!p_70085_1_.capabilities.isCreativeMode) { + --var2.stackSize; + } + + if (var2.stackSize <= 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + + if (!this.worldObj.isClient) { + if (this.rand.nextInt(3) == 0) { + this.setTamed(true); + this.setTameSkin(1 + this.worldObj.rand.nextInt(3)); + this.func_152115_b(p_70085_1_.getUniqueID().toString()); + this.playTameEffect(true); + this.aiSit.setSitting(true); + this.worldObj.setEntityState(this, (byte)7); + } else { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte)6); + } + } + + return true; + } + + return super.interact(p_70085_1_); + } + + public EntityOcelot createChild(EntityAgeable p_90011_1_) { + EntityOcelot var2 = new EntityOcelot(this.worldObj); + + if (this.isTamed()) { + var2.func_152115_b(this.func_152113_b()); + var2.setTamed(true); + var2.setTameSkin(this.getTameSkin()); + } + + return var2; + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) { + return p_70877_1_ != null && p_70877_1_.getItem() == Items.fish; + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) { + if (p_70878_1_ == this) { + return false; + } else if (!this.isTamed()) { + return false; + } else if (!(p_70878_1_ instanceof EntityOcelot)) { + return false; + } else { + EntityOcelot var2 = (EntityOcelot)p_70878_1_; + return var2.isTamed() && this.isInLove() && var2.isInLove(); + } + } + + public int getTameSkin() { + return this.dataWatcher.getWatchableObjectByte(18); + } + + public void setTameSkin(int p_70912_1_) { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)p_70912_1_)); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + if (this.worldObj.rand.nextInt(3) == 0) { + return false; + } else { + if (this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); + int var3 = MathHelper.floor_double(this.posZ); + + if (var2 < 63) { + return false; + } + + Block var4 = this.worldObj.getBlock(var1, var2 - 1, var3); + + return var4 == Blocks.grass || var4.getMaterial() == Material.leaves; + } + + return false; + } + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return this.hasCustomNameTag() ? this.getCustomNameTag() : (this.isTamed() ? StatCollector.translateToLocal("entity.Cat.name") : super.getCommandSenderName()); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + + if (this.worldObj.rand.nextInt(7) == 0) { + for (int var2 = 0; var2 < 2; ++var2) { + EntityOcelot var3 = new EntityOcelot(this.worldObj); + var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + var3.setGrowingAge(-24000); + this.worldObj.spawnEntityInWorld(var3); + } + } + + return p_110161_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityPig.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityPig.java new file mode 100644 index 0000000..7096f05 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityPig.java @@ -0,0 +1,215 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIControlledByPlayer; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.world.World; + +public class EntityPig extends EntityAnimal { + /** AI task for player control. */ + private final EntityAIControlledByPlayer aiControlledByPlayer; + + + public EntityPig(World p_i1689_1_) { + super(p_i1689_1_); + this.setSize(0.9F, 0.9F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F)); + this.tasks.addTask(3, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false)); + this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + protected void updateAITasks() { + super.updateAITasks(); + } + + /** + * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden + * by a player and the player is holding a carrot-on-a-stick + */ + public boolean canBeSteered() { + ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); + return var1 != null && var1.getItem() == Items.carrot_on_a_stick; + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setBoolean("Saddle", this.getSaddled()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setSaddled(p_70037_1_.getBoolean("Saddle")); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.pig.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.pig.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.pig.death"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.pig.step", 0.15F, 1.0F); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + if (super.interact(p_70085_1_)) { + return true; + } else if (this.getSaddled() && !this.worldObj.isClient && (this.riddenByEntity == null || this.riddenByEntity == p_70085_1_)) { + p_70085_1_.mountEntity(this); + return true; + } else { + return false; + } + } + + protected Item func_146068_u() { + return this.isBurning() ? Items.cooked_porkchop : Items.porkchop; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_); + + for (int var4 = 0; var4 < var3; ++var4) { + if (this.isBurning()) { + this.func_145779_a(Items.cooked_porkchop, 1); + } else { + this.func_145779_a(Items.porkchop, 1); + } + } + + if (this.getSaddled()) { + this.func_145779_a(Items.saddle, 1); + } + } + + /** + * Returns true if the pig is saddled. + */ + public boolean getSaddled() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + /** + * Set or remove the saddle of the pig. + */ + public void setSaddled(boolean p_70900_1_) { + if (p_70900_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)1)); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)0)); + } + } + + /** + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt p_70077_1_) { + if (!this.worldObj.isClient) { + EntityPigZombie var2 = new EntityPigZombie(this.worldObj); + var2.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.worldObj.spawnEntityInWorld(var2); + this.setDead(); + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + super.fall(p_70069_1_); + + if (p_70069_1_ > 5.0F && this.riddenByEntity instanceof EntityPlayer) { + ((EntityPlayer)this.riddenByEntity).triggerAchievement(AchievementList.flyPig); + } + } + + public EntityPig createChild(EntityAgeable p_90011_1_) { + return new EntityPig(this.worldObj); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) { + return p_70877_1_ != null && p_70877_1_.getItem() == Items.carrot; + } + + /** + * Return the AI task for player control. + */ + public EntityAIControlledByPlayer getAIControlledByPlayer() { + return this.aiControlledByPlayer; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntitySheep.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntitySheep.java new file mode 100644 index 0000000..199b310 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntitySheep.java @@ -0,0 +1,289 @@ +package net.minecraft.entity.passive; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIEatGrass; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySheep extends EntityAnimal { + private final InventoryCrafting field_90016_e = new InventoryCrafting(new Container() { + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return false; + } + }, 2, 1); + + /** + * Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece. + */ + public static final float[][] fleeceColorTable = new float[][] {{1.0F, 1.0F, 1.0F}, {0.85F, 0.5F, 0.2F}, {0.7F, 0.3F, 0.85F}, {0.4F, 0.6F, 0.85F}, {0.9F, 0.9F, 0.2F}, {0.5F, 0.8F, 0.1F}, {0.95F, 0.5F, 0.65F}, {0.3F, 0.3F, 0.3F}, {0.6F, 0.6F, 0.6F}, {0.3F, 0.5F, 0.6F}, {0.5F, 0.25F, 0.7F}, {0.2F, 0.3F, 0.7F}, {0.4F, 0.3F, 0.2F}, {0.4F, 0.5F, 0.2F}, {0.6F, 0.2F, 0.2F}, {0.1F, 0.1F, 0.1F}}; + + /** + * Used to control movement as well as wool regrowth. Set to 40 on handleHealthUpdate and counts down with each + * tick. + */ + private int sheepTimer; + private final EntityAIEatGrass field_146087_bs = new EntityAIEatGrass(this); + + + public EntitySheep(World p_i1691_1_) { + super(p_i1691_1_); + this.setSize(0.9F, 1.3F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, this.field_146087_bs); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.field_90016_e.setInventorySlotContents(0, new ItemStack(Items.dye, 1, 0)); + this.field_90016_e.setInventorySlotContents(1, new ItemStack(Items.dye, 1, 0)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() { + return true; + } + + protected void updateAITasks() { + this.sheepTimer = this.field_146087_bs.func_151499_f(); + super.updateAITasks(); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.worldObj.isClient) { + this.sheepTimer = Math.max(0, this.sheepTimer - 1); + } + + super.onLivingUpdate(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + if (!this.getSheared()) { + this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor()), 0.0F); + } + } + + protected Item func_146068_u() { + return Item.getItemFromBlock(Blocks.wool); + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 10) { + this.sheepTimer = 40; + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + public float func_70894_j(float p_70894_1_) { + return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - p_70894_1_) / 4.0F : -((float)(this.sheepTimer - 40) - p_70894_1_) / 4.0F)); + } + + public float func_70890_k(float p_70890_1_) { + if (this.sheepTimer > 4 && this.sheepTimer <= 36) { + float var2 = ((float)(this.sheepTimer - 4) - p_70890_1_) / 32.0F; + return ((float)Math.PI / 5F) + ((float)Math.PI * 7F / 100F) * MathHelper.sin(var2 * 28.7F); + } else { + return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch / (180F / (float)Math.PI); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (var2 != null && var2.getItem() == Items.shears && !this.getSheared() && !this.isChild()) { + if (!this.worldObj.isClient) { + this.setSheared(true); + int var3 = 1 + this.rand.nextInt(3); + + for (int var4 = 0; var4 < var3; ++var4) { + EntityItem var5 = this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor()), 1.0F); + var5.motionY += this.rand.nextFloat() * 0.05F; + var5.motionX += (this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F; + var5.motionZ += (this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F; + } + } + + var2.damageItem(1, p_70085_1_); + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + } + + return super.interact(p_70085_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setBoolean("Sheared", this.getSheared()); + p_70014_1_.setByte("Color", (byte)this.getFleeceColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setSheared(p_70037_1_.getBoolean("Sheared")); + this.setFleeceColor(p_70037_1_.getByte("Color")); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return "mob.sheep.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.sheep.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.sheep.say"; + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.sheep.step", 0.15F, 1.0F); + } + + public int getFleeceColor() { + return this.dataWatcher.getWatchableObjectByte(16) & 15; + } + + public void setFleeceColor(int p_70891_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & 240 | p_70891_1_ & 15))); + } + + /** + * returns true if a sheeps wool has been sheared + */ + public boolean getSheared() { + return (this.dataWatcher.getWatchableObjectByte(16) & 16) != 0; + } + + /** + * make a sheep sheared if set to true + */ + public void setSheared(boolean p_70893_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70893_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 16))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -17))); + } + } + + /** + * This method is called when a sheep spawns in the world to select the color of sheep fleece. + */ + public static int getRandomFleeceColor(Random p_70895_0_) { + int var1 = p_70895_0_.nextInt(100); + return var1 < 5 ? 15 : (var1 < 10 ? 7 : (var1 < 15 ? 8 : (var1 < 18 ? 12 : (p_70895_0_.nextInt(500) == 0 ? 6 : 0)))); + } + + public EntitySheep createChild(EntityAgeable p_90011_1_) { + EntitySheep var2 = (EntitySheep)p_90011_1_; + EntitySheep var3 = new EntitySheep(this.worldObj); + int var4 = this.func_90014_a(this, var2); + var3.setFleeceColor(15 - var4); + return var3; + } + + /** + * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This + * function is used in the AIEatGrass) + */ + public void eatGrassBonus() { + this.setSheared(false); + + if (this.isChild()) { + this.addGrowth(60); + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + this.setFleeceColor(getRandomFleeceColor(this.worldObj.rand)); + return p_110161_1_; + } + + private int func_90014_a(EntityAnimal p_90014_1_, EntityAnimal p_90014_2_) { + int var3 = this.func_90013_b(p_90014_1_); + int var4 = this.func_90013_b(p_90014_2_); + this.field_90016_e.getStackInSlot(0).setItemDamage(var3); + this.field_90016_e.getStackInSlot(1).setItemDamage(var4); + ItemStack var5 = CraftingManager.getInstance().findMatchingRecipe(this.field_90016_e, p_90014_1_.worldObj); + int var6; + + if (var5 != null && var5.getItem() == Items.dye) { + var6 = var5.getItemDamage(); + } else { + var6 = this.worldObj.rand.nextBoolean() ? var3 : var4; + } + + return var6; + } + + private int func_90013_b(EntityAnimal p_90013_1_) { + return 15 - ((EntitySheep)p_90013_1_).getFleeceColor(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntitySquid.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntitySquid.java new file mode 100644 index 0000000..a09838e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntitySquid.java @@ -0,0 +1,202 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySquid extends EntityWaterMob { + public float squidPitch; + public float prevSquidPitch; + public float squidYaw; + public float prevSquidYaw; + + /** + * appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate. + */ + public float squidRotation; + + /** previous squidRotation in radians */ + public float prevSquidRotation; + + /** angle of the tentacles in radians */ + public float tentacleAngle; + + /** the last calculated angle of the tentacles in radians */ + public float lastTentacleAngle; + private float randomMotionSpeed; + + /** change in squidRotation in radians. */ + private float rotationVelocity; + private float field_70871_bB; + private float randomMotionVecX; + private float randomMotionVecY; + private float randomMotionVecZ; + + + public EntitySquid(World p_i1693_1_) { + super(p_i1693_1_); + this.setSize(0.95F, 0.95F); + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return null; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return null; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return null; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item func_146068_u() { + return Item.getItemById(0); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + /** + * Drop 0-2 items of this living's type + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { + int var3 = this.rand.nextInt(3 + p_70628_2_) + 1; + + for (int var4 = 0; var4 < var3; ++var4) { + this.entityDropItem(new ItemStack(Items.dye, 1, 0), 0.0F); + } + } + + /** + * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning + * true) + */ + public boolean isInWater() { + return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.prevSquidPitch = this.squidPitch; + this.prevSquidYaw = this.squidYaw; + this.prevSquidRotation = this.squidRotation; + this.lastTentacleAngle = this.tentacleAngle; + this.squidRotation += this.rotationVelocity; + + if (this.squidRotation > ((float)Math.PI * 2F)) { + this.squidRotation -= ((float)Math.PI * 2F); + + if (this.rand.nextInt(10) == 0) { + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + } + + if (this.isInWater()) { + float var1; + + if (this.squidRotation < (float)Math.PI) { + var1 = this.squidRotation / (float)Math.PI; + this.tentacleAngle = MathHelper.sin(var1 * var1 * (float)Math.PI) * (float)Math.PI * 0.25F; + + if ((double)var1 > 0.75D) { + this.randomMotionSpeed = 1.0F; + this.field_70871_bB = 1.0F; + } else { + this.field_70871_bB *= 0.8F; + } + } else { + this.tentacleAngle = 0.0F; + this.randomMotionSpeed *= 0.9F; + this.field_70871_bB *= 0.99F; + } + + if (!this.worldObj.isClient) { + this.motionX = this.randomMotionVecX * this.randomMotionSpeed; + this.motionY = this.randomMotionVecY * this.randomMotionSpeed; + this.motionZ = this.randomMotionVecZ * this.randomMotionSpeed; + } + + var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.renderYawOffset += (-((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI - this.renderYawOffset) * 0.1F; + this.rotationYaw = this.renderYawOffset; + this.squidYaw += (float)Math.PI * this.field_70871_bB * 1.5F; + this.squidPitch += (-((float)Math.atan2(var1, this.motionY)) * 180.0F / (float)Math.PI - this.squidPitch) * 0.1F; + } else { + this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.squidRotation)) * (float)Math.PI * 0.25F; + + if (!this.worldObj.isClient) { + this.motionX = 0.0D; + this.motionY -= 0.08D; + this.motionY *= 0.9800000190734863D; + this.motionZ = 0.0D; + } + + this.squidPitch = (float)((double)this.squidPitch + (double)(-90.0F - this.squidPitch) * 0.02D); + } + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + protected void updateEntityActionState() { + ++this.entityAge; + + if (this.entityAge > 100) { + this.randomMotionVecX = this.randomMotionVecY = this.randomMotionVecZ = 0.0F; + } else if (this.rand.nextInt(50) == 0 || !this.inWater || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F) { + float var1 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + this.randomMotionVecX = MathHelper.cos(var1) * 0.2F; + this.randomMotionVecY = -0.1F + this.rand.nextFloat() * 0.2F; + this.randomMotionVecZ = MathHelper.sin(var1) * 0.2F; + } + + this.despawnEntity(); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.posY > 45.0D && this.posY < 63.0D && super.getCanSpawnHere(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityTameable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityTameable.java new file mode 100644 index 0000000..311474c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityTameable.java @@ -0,0 +1,177 @@ +package net.minecraft.entity.passive; + +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.ai.EntityAISit; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.management.PreYggdrasilConverter; +import net.minecraft.world.World; + +public abstract class EntityTameable extends EntityAnimal implements IEntityOwnable { + protected EntityAISit aiSit = new EntityAISit(this); + + + public EntityTameable(World p_i1604_1_) { + super(p_i1604_1_); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(17, ""); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + + if (this.func_152113_b() == null) { + p_70014_1_.setString("OwnerUUID", ""); + } else { + p_70014_1_.setString("OwnerUUID", this.func_152113_b()); + } + + p_70014_1_.setBoolean("Sitting", this.isSitting()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + String var2 = ""; + + if (p_70037_1_.func_150297_b("OwnerUUID", 8)) { + var2 = p_70037_1_.getString("OwnerUUID"); + } else { + String var3 = p_70037_1_.getString("Owner"); + var2 = PreYggdrasilConverter.func_152719_a(var3); + } + + if (var2.length() > 0) { + this.func_152115_b(var2); + this.setTamed(true); + } + + this.aiSit.setSitting(p_70037_1_.getBoolean("Sitting")); + this.setSitting(p_70037_1_.getBoolean("Sitting")); + } + + /** + * Play the taming effect, will either be hearts or smoke depending on status + */ + protected void playTameEffect(boolean p_70908_1_) { + String var2 = "heart"; + + if (!p_70908_1_) { + var2 = "smoke"; + } + + for (int var3 = 0; var3 < 7; ++var3) { + double var4 = this.rand.nextGaussian() * 0.02D; + double var6 = this.rand.nextGaussian() * 0.02D; + double var8 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); + } + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 7) { + this.playTameEffect(true); + } else if (p_70103_1_ == 6) { + this.playTameEffect(false); + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + public boolean isTamed() { + return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0; + } + + public void setTamed(boolean p_70903_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70903_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 4))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -5))); + } + } + + public boolean isSitting() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setSitting(boolean p_70904_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70904_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } + } + + public String func_152113_b() { + return this.dataWatcher.getWatchableObjectString(17); + } + + public void func_152115_b(String p_152115_1_) { + this.dataWatcher.updateObject(17, p_152115_1_); + } + + public EntityLivingBase getOwner() { + try { + UUID var1 = UUID.fromString(this.func_152113_b()); + return var1 == null ? null : this.worldObj.func_152378_a(var1); + } catch (IllegalArgumentException var2) { + return null; + } + } + + public boolean func_152114_e(EntityLivingBase p_152114_1_) { + return p_152114_1_ == this.getOwner(); + } + + public EntityAISit func_70907_r() { + return this.aiSit; + } + + public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { + return true; + } + + public Team getTeam() { + if (this.isTamed()) { + EntityLivingBase var1 = this.getOwner(); + + if (var1 != null) { + return var1.getTeam(); + } + } + + return super.getTeam(); + } + + public boolean isOnSameTeam(EntityLivingBase p_142014_1_) { + if (this.isTamed()) { + EntityLivingBase var2 = this.getOwner(); + + if (p_142014_1_ == var2) { + return true; + } + + if (var2 != null) { + return var2.isOnSameTeam(p_142014_1_); + } + } + + return super.isOnSameTeam(p_142014_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityVillager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityVillager.java new file mode 100644 index 0000000..e94abd4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityVillager.java @@ -0,0 +1,673 @@ +package net.minecraft.entity.passive; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Random; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.INpc; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowGolem; +import net.minecraft.entity.ai.EntityAILookAtTradePlayer; +import net.minecraft.entity.ai.EntityAIMoveIndoors; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAIPlay; +import net.minecraft.entity.ai.EntityAIRestrictOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITradePlayer; +import net.minecraft.entity.ai.EntityAIVillagerMate; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Tuple; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityVillager extends EntityAgeable implements IMerchant, INpc { + private int randomTickDivider; + private boolean isMating; + private boolean isPlaying; + Village villageObj; + + /** This villager's current customer. */ + private EntityPlayer buyingPlayer; + + /** Initialises the MerchantRecipeList.java */ + private MerchantRecipeList buyingList; + private int timeUntilReset; + + /** addDefaultEquipmentAndRecipies is called if this is true */ + private boolean needsInitilization; + private int wealth; + + /** Last player to trade with this villager, used for aggressivity. */ + private String lastBuyingPlayer; + private boolean isLookingForHome; + private float field_82191_bN; + + /** Selling list of Villagers items. */ + private static final Map villagersSellingList = new HashMap(); + + /** Selling list of Blacksmith items. */ + private static final Map blacksmithSellingList = new HashMap(); + + + public EntityVillager(World p_i1747_1_) { + this(p_i1747_1_, 0); + } + + public EntityVillager(World p_i1748_1_, int p_i1748_2_) { + super(p_i1748_1_); + this.setProfession(p_i1748_2_); + this.setSize(0.6F, 1.8F); + this.getNavigator().setBreakDoors(true); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); + this.tasks.addTask(1, new EntityAITradePlayer(this)); + this.tasks.addTask(1, new EntityAILookAtTradePlayer(this)); + this.tasks.addTask(2, new EntityAIMoveIndoors(this)); + this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); + this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); + this.tasks.addTask(6, new EntityAIVillagerMate(this)); + this.tasks.addTask(7, new EntityAIFollowGolem(this)); + this.tasks.addTask(8, new EntityAIPlay(this, 0.32D)); + this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F)); + this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() { + if (--this.randomTickDivider <= 0) { + this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + this.randomTickDivider = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); + + if (this.villageObj == null) { + this.detachHome(); + } else { + ChunkCoordinates var1 = this.villageObj.getCenter(); + this.setHomeArea(var1.posX, var1.posY, var1.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F)); + + if (this.isLookingForHome) { + this.isLookingForHome = false; + this.villageObj.setDefaultPlayerReputation(5); + } + } + } + + if (!this.isTrading() && this.timeUntilReset > 0) { + --this.timeUntilReset; + + if (this.timeUntilReset <= 0) { + if (this.needsInitilization) { + if (this.buyingList.size() > 1) { + Iterator var3 = this.buyingList.iterator(); + + while (var3.hasNext()) { + MerchantRecipe var2 = (MerchantRecipe)var3.next(); + + if (var2.isRecipeDisabled()) { + var2.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2); + } + } + } + + this.addDefaultEquipmentAndRecipies(1); + this.needsInitilization = false; + + if (this.villageObj != null && this.lastBuyingPlayer != null) { + this.worldObj.setEntityState(this, (byte)14); + this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1); + } + } + + this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0)); + } + } + + super.updateAITick(); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + boolean var3 = var2 != null && var2.getItem() == Items.spawn_egg; + + if (!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { + if (!this.worldObj.isClient) { + this.setCustomer(p_70085_1_); + p_70085_1_.displayGUIMerchant(this, this.getCustomNameTag()); + } + + return true; + } else { + return super.interact(p_70085_1_); + } + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("Profession", this.getProfession()); + p_70014_1_.setInteger("Riches", this.wealth); + + if (this.buyingList != null) { + p_70014_1_.setTag("Offers", this.buyingList.getRecipiesAsTags()); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setProfession(p_70037_1_.getInteger("Profession")); + this.wealth = p_70037_1_.getInteger("Riches"); + + if (p_70037_1_.func_150297_b("Offers", 10)) { + NBTTagCompound var2 = p_70037_1_.getCompoundTag("Offers"); + this.buyingList = new MerchantRecipeList(var2); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return false; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isTrading() ? "mob.villager.haggle" : "mob.villager.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.villager.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.villager.death"; + } + + public void setProfession(int p_70938_1_) { + this.dataWatcher.updateObject(16, Integer.valueOf(p_70938_1_)); + } + + public int getProfession() { + return this.dataWatcher.getWatchableObjectInt(16); + } + + public boolean isMating() { + return this.isMating; + } + + public void setMating(boolean p_70947_1_) { + this.isMating = p_70947_1_; + } + + public void setPlaying(boolean p_70939_1_) { + this.isPlaying = p_70939_1_; + } + + public boolean isPlaying() { + return this.isPlaying; + } + + public void setRevengeTarget(EntityLivingBase p_70604_1_) { + super.setRevengeTarget(p_70604_1_); + + if (this.villageObj != null && p_70604_1_ != null) { + this.villageObj.addOrRenewAgressor(p_70604_1_); + + if (p_70604_1_ instanceof EntityPlayer) { + byte var2 = -1; + + if (this.isChild()) { + var2 = -3; + } + + this.villageObj.setReputationForPlayer(p_70604_1_.getCommandSenderName(), var2); + + if (this.isEntityAlive()) { + this.worldObj.setEntityState(this, (byte)13); + } + } + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + if (this.villageObj != null) { + Entity var2 = p_70645_1_.getEntity(); + + if (var2 != null) { + if (var2 instanceof EntityPlayer) { + this.villageObj.setReputationForPlayer(var2.getCommandSenderName(), -2); + } else if (var2 instanceof IMob) { + this.villageObj.endMatingSeason(); + } + } else if (var2 == null) { + EntityPlayer var3 = this.worldObj.getClosestPlayerToEntity(this, 16.0D); + + if (var3 != null) { + this.villageObj.endMatingSeason(); + } + } + } + + super.onDeath(p_70645_1_); + } + + public void setCustomer(EntityPlayer p_70932_1_) { + this.buyingPlayer = p_70932_1_; + } + + public EntityPlayer getCustomer() { + return this.buyingPlayer; + } + + public boolean isTrading() { + return this.buyingPlayer != null; + } + + public void useRecipe(MerchantRecipe p_70933_1_) { + p_70933_1_.incrementToolUses(); + this.livingSoundTime = -this.getTalkInterval(); + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + + if (p_70933_1_.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1))) { + this.timeUntilReset = 40; + this.needsInitilization = true; + + if (this.buyingPlayer != null) { + this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName(); + } else { + this.lastBuyingPlayer = null; + } + } + + if (p_70933_1_.getItemToBuy().getItem() == Items.emerald) { + this.wealth += p_70933_1_.getItemToBuy().stackSize; + } + } + + public void func_110297_a_(ItemStack p_110297_1_) { + if (!this.worldObj.isClient && this.livingSoundTime > -this.getTalkInterval() + 20) { + this.livingSoundTime = -this.getTalkInterval(); + + if (p_110297_1_ != null) { + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + } else { + this.playSound("mob.villager.no", this.getSoundVolume(), this.getSoundPitch()); + } + } + } + + public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) { + if (this.buyingList == null) { + this.addDefaultEquipmentAndRecipies(1); + } + + return this.buyingList; + } + + /** + * Adjusts the probability of obtaining a given recipe being offered by a villager + */ + private float adjustProbability(float p_82188_1_) { + float var2 = p_82188_1_ + this.field_82191_bN; + return var2 > 0.9F ? 0.9F - (var2 - 0.9F) : var2; + } + + /** + * based on the villagers profession add items, equipment, and recipies adds par1 random items to the list of things + * that the villager wants to buy. (at most 1 of each wanted type is added) + */ + private void addDefaultEquipmentAndRecipies(int p_70950_1_) { + if (this.buyingList != null) { + this.field_82191_bN = MathHelper.sqrt_float((float)this.buyingList.size()) * 0.2F; + } else { + this.field_82191_bN = 0.0F; + } + + MerchantRecipeList var2; + var2 = new MerchantRecipeList(); + int var6; + label50: + + switch (this.getProfession()) { + case 0: + func_146091_a(var2, Items.wheat, this.rand, this.adjustProbability(0.9F)); + func_146091_a(var2, Item.getItemFromBlock(Blocks.wool), this.rand, this.adjustProbability(0.5F)); + func_146091_a(var2, Items.chicken, this.rand, this.adjustProbability(0.5F)); + func_146091_a(var2, Items.cooked_fished, this.rand, this.adjustProbability(0.4F)); + func_146089_b(var2, Items.bread, this.rand, this.adjustProbability(0.9F)); + func_146089_b(var2, Items.melon, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.apple, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.cookie, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.shears, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.flint_and_steel, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.cooked_chicken, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.arrow, this.rand, this.adjustProbability(0.5F)); + + if (this.rand.nextFloat() < this.adjustProbability(0.5F)) { + var2.add(new MerchantRecipe(new ItemStack(Blocks.gravel, 10), new ItemStack(Items.emerald), new ItemStack(Items.flint, 4 + this.rand.nextInt(2), 0))); + } + + break; + + case 1: + func_146091_a(var2, Items.paper, this.rand, this.adjustProbability(0.8F)); + func_146091_a(var2, Items.book, this.rand, this.adjustProbability(0.8F)); + func_146091_a(var2, Items.written_book, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Item.getItemFromBlock(Blocks.bookshelf), this.rand, this.adjustProbability(0.8F)); + func_146089_b(var2, Item.getItemFromBlock(Blocks.glass), this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.compass, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.clock, this.rand, this.adjustProbability(0.2F)); + + if (this.rand.nextFloat() < this.adjustProbability(0.07F)) { + Enchantment var8 = Enchantment.enchantmentsBookList[this.rand.nextInt(Enchantment.enchantmentsBookList.length)]; + int var10 = MathHelper.getRandomIntegerInRange(this.rand, var8.getMinLevel(), var8.getMaxLevel()); + ItemStack var11 = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(var8, var10)); + var6 = 2 + this.rand.nextInt(5 + var10 * 10) + 3 * var10; + var2.add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, var6), var11)); + } + + break; + + case 2: + func_146089_b(var2, Items.ender_eye, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.experience_bottle, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.redstone, this.rand, this.adjustProbability(0.4F)); + func_146089_b(var2, Item.getItemFromBlock(Blocks.glowstone), this.rand, this.adjustProbability(0.3F)); + Item[] var3 = new Item[] {Items.iron_sword, Items.diamond_sword, Items.iron_chestplate, Items.diamond_chestplate, Items.iron_axe, Items.diamond_axe, Items.iron_pickaxe, Items.diamond_pickaxe}; + Item[] var4 = var3; + int var5 = var3.length; + var6 = 0; + + while (true) { + if (var6 >= var5) { + break label50; + } + + Item var7 = var4[var6]; + + if (this.rand.nextFloat() < this.adjustProbability(0.05F)) { + var2.add(new MerchantRecipe(new ItemStack(var7, 1, 0), new ItemStack(Items.emerald, 2 + this.rand.nextInt(3), 0), EnchantmentHelper.addRandomEnchantment(this.rand, new ItemStack(var7, 1, 0), 5 + this.rand.nextInt(15)))); + } + + ++var6; + } + + case 3: + func_146091_a(var2, Items.coal, this.rand, this.adjustProbability(0.7F)); + func_146091_a(var2, Items.iron_ingot, this.rand, this.adjustProbability(0.5F)); + func_146091_a(var2, Items.gold_ingot, this.rand, this.adjustProbability(0.5F)); + func_146091_a(var2, Items.diamond, this.rand, this.adjustProbability(0.5F)); + func_146089_b(var2, Items.iron_sword, this.rand, this.adjustProbability(0.5F)); + func_146089_b(var2, Items.diamond_sword, this.rand, this.adjustProbability(0.5F)); + func_146089_b(var2, Items.iron_axe, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.diamond_axe, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.iron_pickaxe, this.rand, this.adjustProbability(0.5F)); + func_146089_b(var2, Items.diamond_pickaxe, this.rand, this.adjustProbability(0.5F)); + func_146089_b(var2, Items.iron_shovel, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.diamond_shovel, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.iron_hoe, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.diamond_hoe, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.iron_boots, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.diamond_boots, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.iron_helmet, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.diamond_helmet, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.iron_chestplate, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.diamond_chestplate, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.iron_leggings, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.diamond_leggings, this.rand, this.adjustProbability(0.2F)); + func_146089_b(var2, Items.chainmail_boots, this.rand, this.adjustProbability(0.1F)); + func_146089_b(var2, Items.chainmail_helmet, this.rand, this.adjustProbability(0.1F)); + func_146089_b(var2, Items.chainmail_chestplate, this.rand, this.adjustProbability(0.1F)); + func_146089_b(var2, Items.chainmail_leggings, this.rand, this.adjustProbability(0.1F)); + break; + + case 4: + func_146091_a(var2, Items.coal, this.rand, this.adjustProbability(0.7F)); + func_146091_a(var2, Items.porkchop, this.rand, this.adjustProbability(0.5F)); + func_146091_a(var2, Items.beef, this.rand, this.adjustProbability(0.5F)); + func_146089_b(var2, Items.saddle, this.rand, this.adjustProbability(0.1F)); + func_146089_b(var2, Items.leather_chestplate, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.leather_boots, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.leather_helmet, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.leather_leggings, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.cooked_porkchop, this.rand, this.adjustProbability(0.3F)); + func_146089_b(var2, Items.cooked_beef, this.rand, this.adjustProbability(0.3F)); + } + + if (var2.isEmpty()) { + func_146091_a(var2, Items.gold_ingot, this.rand, 1.0F); + } + + Collections.shuffle(var2); + + if (this.buyingList == null) { + this.buyingList = new MerchantRecipeList(); + } + + for (int var9 = 0; var9 < p_70950_1_ && var9 < var2.size(); ++var9) { + this.buyingList.addToListWithCheck((MerchantRecipe)var2.get(var9)); + } + } + + public void setRecipes(MerchantRecipeList p_70930_1_) {} + + private static void func_146091_a(MerchantRecipeList p_146091_0_, Item p_146091_1_, Random p_146091_2_, float p_146091_3_) { + if (p_146091_2_.nextFloat() < p_146091_3_) { + p_146091_0_.add(new MerchantRecipe(func_146088_a(p_146091_1_, p_146091_2_), Items.emerald)); + } + } + + private static ItemStack func_146088_a(Item p_146088_0_, Random p_146088_1_) { + return new ItemStack(p_146088_0_, func_146092_b(p_146088_0_, p_146088_1_), 0); + } + + private static int func_146092_b(Item p_146092_0_, Random p_146092_1_) { + Tuple var2 = (Tuple)villagersSellingList.get(p_146092_0_); + return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + p_146092_1_.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); + } + + private static void func_146089_b(MerchantRecipeList p_146089_0_, Item p_146089_1_, Random p_146089_2_, float p_146089_3_) { + if (p_146089_2_.nextFloat() < p_146089_3_) { + int var4 = func_146090_c(p_146089_1_, p_146089_2_); + ItemStack var5; + ItemStack var6; + + if (var4 < 0) { + var5 = new ItemStack(Items.emerald, 1, 0); + var6 = new ItemStack(p_146089_1_, -var4, 0); + } else { + var5 = new ItemStack(Items.emerald, var4, 0); + var6 = new ItemStack(p_146089_1_, 1, 0); + } + + p_146089_0_.add(new MerchantRecipe(var5, var6)); + } + } + + private static int func_146090_c(Item p_146090_0_, Random p_146090_1_) { + Tuple var2 = (Tuple)blacksmithSellingList.get(p_146090_0_); + return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + p_146090_1_.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 12) { + this.generateRandomParticles("heart"); + } else if (p_70103_1_ == 13) { + this.generateRandomParticles("angryVillager"); + } else if (p_70103_1_ == 14) { + this.generateRandomParticles("happyVillager"); + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * par1 is the particleName + */ + private void generateRandomParticles(String p_70942_1_) { + for (int var2 = 0; var2 < 5; ++var2) { + double var3 = this.rand.nextGaussian() * 0.02D; + double var5 = this.rand.nextGaussian() * 0.02D; + double var7 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(p_70942_1_, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + this.setProfession(this.worldObj.rand.nextInt(5)); + return p_110161_1_; + } + + public void setLookingForHome() { + this.isLookingForHome = true; + } + + public EntityVillager createChild(EntityAgeable p_90011_1_) { + EntityVillager var2 = new EntityVillager(this.worldObj); + var2.onSpawnWithEgg(null); + return var2; + } + + public boolean allowLeashing() { + return false; + } + + static { + villagersSellingList.put(Items.coal, new Tuple(Integer.valueOf(16), Integer.valueOf(24))); + villagersSellingList.put(Items.iron_ingot, new Tuple(Integer.valueOf(8), Integer.valueOf(10))); + villagersSellingList.put(Items.gold_ingot, new Tuple(Integer.valueOf(8), Integer.valueOf(10))); + villagersSellingList.put(Items.diamond, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + villagersSellingList.put(Items.paper, new Tuple(Integer.valueOf(24), Integer.valueOf(36))); + villagersSellingList.put(Items.book, new Tuple(Integer.valueOf(11), Integer.valueOf(13))); + villagersSellingList.put(Items.written_book, new Tuple(Integer.valueOf(1), Integer.valueOf(1))); + villagersSellingList.put(Items.ender_pearl, new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + villagersSellingList.put(Items.ender_eye, new Tuple(Integer.valueOf(2), Integer.valueOf(3))); + villagersSellingList.put(Items.porkchop, new Tuple(Integer.valueOf(14), Integer.valueOf(18))); + villagersSellingList.put(Items.beef, new Tuple(Integer.valueOf(14), Integer.valueOf(18))); + villagersSellingList.put(Items.chicken, new Tuple(Integer.valueOf(14), Integer.valueOf(18))); + villagersSellingList.put(Items.cooked_fished, new Tuple(Integer.valueOf(9), Integer.valueOf(13))); + villagersSellingList.put(Items.wheat_seeds, new Tuple(Integer.valueOf(34), Integer.valueOf(48))); + villagersSellingList.put(Items.melon_seeds, new Tuple(Integer.valueOf(30), Integer.valueOf(38))); + villagersSellingList.put(Items.pumpkin_seeds, new Tuple(Integer.valueOf(30), Integer.valueOf(38))); + villagersSellingList.put(Items.wheat, new Tuple(Integer.valueOf(18), Integer.valueOf(22))); + villagersSellingList.put(Item.getItemFromBlock(Blocks.wool), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); + villagersSellingList.put(Items.rotten_flesh, new Tuple(Integer.valueOf(36), Integer.valueOf(64))); + blacksmithSellingList.put(Items.flint_and_steel, new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Items.shears, new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Items.iron_sword, new Tuple(Integer.valueOf(7), Integer.valueOf(11))); + blacksmithSellingList.put(Items.diamond_sword, new Tuple(Integer.valueOf(12), Integer.valueOf(14))); + blacksmithSellingList.put(Items.iron_axe, new Tuple(Integer.valueOf(6), Integer.valueOf(8))); + blacksmithSellingList.put(Items.diamond_axe, new Tuple(Integer.valueOf(9), Integer.valueOf(12))); + blacksmithSellingList.put(Items.iron_pickaxe, new Tuple(Integer.valueOf(7), Integer.valueOf(9))); + blacksmithSellingList.put(Items.diamond_pickaxe, new Tuple(Integer.valueOf(10), Integer.valueOf(12))); + blacksmithSellingList.put(Items.iron_shovel, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_shovel, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_hoe, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_hoe, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_boots, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_boots, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_helmet, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_helmet, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_chestplate, new Tuple(Integer.valueOf(10), Integer.valueOf(14))); + blacksmithSellingList.put(Items.diamond_chestplate, new Tuple(Integer.valueOf(16), Integer.valueOf(19))); + blacksmithSellingList.put(Items.iron_leggings, new Tuple(Integer.valueOf(8), Integer.valueOf(10))); + blacksmithSellingList.put(Items.diamond_leggings, new Tuple(Integer.valueOf(11), Integer.valueOf(14))); + blacksmithSellingList.put(Items.chainmail_boots, new Tuple(Integer.valueOf(5), Integer.valueOf(7))); + blacksmithSellingList.put(Items.chainmail_helmet, new Tuple(Integer.valueOf(5), Integer.valueOf(7))); + blacksmithSellingList.put(Items.chainmail_chestplate, new Tuple(Integer.valueOf(11), Integer.valueOf(15))); + blacksmithSellingList.put(Items.chainmail_leggings, new Tuple(Integer.valueOf(9), Integer.valueOf(11))); + blacksmithSellingList.put(Items.bread, new Tuple(Integer.valueOf(-4), Integer.valueOf(-2))); + blacksmithSellingList.put(Items.melon, new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); + blacksmithSellingList.put(Items.apple, new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); + blacksmithSellingList.put(Items.cookie, new Tuple(Integer.valueOf(-10), Integer.valueOf(-7))); + blacksmithSellingList.put(Item.getItemFromBlock(Blocks.glass), new Tuple(Integer.valueOf(-5), Integer.valueOf(-3))); + blacksmithSellingList.put(Item.getItemFromBlock(Blocks.bookshelf), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Items.leather_chestplate, new Tuple(Integer.valueOf(4), Integer.valueOf(5))); + blacksmithSellingList.put(Items.leather_boots, new Tuple(Integer.valueOf(2), Integer.valueOf(4))); + blacksmithSellingList.put(Items.leather_helmet, new Tuple(Integer.valueOf(2), Integer.valueOf(4))); + blacksmithSellingList.put(Items.leather_leggings, new Tuple(Integer.valueOf(2), Integer.valueOf(4))); + blacksmithSellingList.put(Items.saddle, new Tuple(Integer.valueOf(6), Integer.valueOf(8))); + blacksmithSellingList.put(Items.experience_bottle, new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); + blacksmithSellingList.put(Items.redstone, new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); + blacksmithSellingList.put(Items.compass, new Tuple(Integer.valueOf(10), Integer.valueOf(12))); + blacksmithSellingList.put(Items.clock, new Tuple(Integer.valueOf(10), Integer.valueOf(12))); + blacksmithSellingList.put(Item.getItemFromBlock(Blocks.glowstone), new Tuple(Integer.valueOf(-3), Integer.valueOf(-1))); + blacksmithSellingList.put(Items.cooked_porkchop, new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); + blacksmithSellingList.put(Items.cooked_beef, new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); + blacksmithSellingList.put(Items.cooked_chicken, new Tuple(Integer.valueOf(-8), Integer.valueOf(-6))); + blacksmithSellingList.put(Items.ender_eye, new Tuple(Integer.valueOf(7), Integer.valueOf(11))); + blacksmithSellingList.put(Items.arrow, new Tuple(Integer.valueOf(-12), Integer.valueOf(-8))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java new file mode 100644 index 0000000..507549e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityWaterMob.java @@ -0,0 +1,66 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public abstract class EntityWaterMob extends EntityCreature implements IAnimals { + + + public EntityWaterMob(World p_i1695_1_) { + super(p_i1695_1_); + } + + public boolean canBreatheUnderwater() { + return true; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() { + return this.worldObj.checkNoEntityCollision(this.boundingBox); + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() { + return 120; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return true; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) { + return 1 + this.worldObj.rand.nextInt(3); + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() { + int var1 = this.getAir(); + super.onEntityUpdate(); + + if (this.isEntityAlive() && !this.isInWater()) { + --var1; + this.setAir(var1); + + if (this.getAir() == -20) { + this.setAir(0); + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } else { + this.setAir(300); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityWolf.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityWolf.java new file mode 100644 index 0000000..5b9a0c3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/EntityWolf.java @@ -0,0 +1,513 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBeg; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityWolf extends EntityTameable { + private float field_70926_e; + private float field_70924_f; + + /** true is the wolf is wet else false */ + private boolean isShaking; + private boolean field_70928_h; + + /** + * This time increases while wolf is shaking and emitting water particles. + */ + private float timeWolfIsShaking; + private float prevTimeWolfIsShaking; + + + public EntityWolf(World p_i1696_1_) { + super(p_i1696_1_); + this.setSize(0.6F, 0.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + if (this.isTamed()) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase p_70624_1_) { + super.setAttackTarget(p_70624_1_); + + if (p_70624_1_ == null) { + this.setAngry(false); + } else if (!this.isTamed()) { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte)0)); + this.dataWatcher.addObject(20, new Byte((byte)BlockColored.func_150032_b(1))); + } + + protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_) { + this.playSound("mob.wolf.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setBoolean("Angry", this.isAngry()); + p_70014_1_.setByte("CollarColor", (byte)this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.setAngry(p_70037_1_.getBoolean("Angry")); + + if (p_70037_1_.func_150297_b("CollarColor", 99)) { + this.setCollarColor(p_70037_1_.getByte("CollarColor")); + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() { + return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "mob.wolf.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "mob.wolf.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() { + return 0.4F; + } + + protected Item func_146068_u() { + return Item.getItemById(-1); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + super.onLivingUpdate(); + + if (!this.worldObj.isClient && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) { + this.field_70928_h = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + this.worldObj.setEntityState(this, (byte)8); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + this.field_70924_f = this.field_70926_e; + + if (this.func_70922_bv()) { + this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F; + } else { + this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F; + } + + if (this.func_70922_bv()) { + this.numTicksToChaseTarget = 10; + } + + if (this.isWet()) { + this.isShaking = true; + this.field_70928_h = false; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } else if ((this.isShaking || this.field_70928_h) && this.field_70928_h) { + if (this.timeWolfIsShaking == 0.0F) { + this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.prevTimeWolfIsShaking = this.timeWolfIsShaking; + this.timeWolfIsShaking += 0.05F; + + if (this.prevTimeWolfIsShaking >= 2.0F) { + this.isShaking = false; + this.field_70928_h = false; + this.prevTimeWolfIsShaking = 0.0F; + this.timeWolfIsShaking = 0.0F; + } + + if (this.timeWolfIsShaking > 0.4F) { + float var1 = (float)this.boundingBox.minY; + int var2 = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F); + + for (int var3 = 0; var3 < var2; ++var3) { + float var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + float var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + this.worldObj.spawnParticle("splash", this.posX + (double)var4, var1 + 0.8F, this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); + } + } + } + } + + public boolean getWolfShaking() { + return this.isShaking; + } + + /** + * Used when calculating the amount of shading to apply while the wolf is shaking. + */ + public float getShadingWhileShaking(float p_70915_1_) { + return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F; + } + + public float getShakeAngle(float p_70923_1_, float p_70923_2_) { + float var3 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F; + + if (var3 < 0.0F) { + var3 = 0.0F; + } else if (var3 > 1.0F) { + var3 = 1.0F; + } + + return MathHelper.sin(var3 * (float)Math.PI) * MathHelper.sin(var3 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI; + } + + public float getInterestedAngle(float p_70917_1_) { + return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * p_70917_1_) * 0.15F * (float)Math.PI; + } + + public float getEyeHeight() { + return this.height * 0.8F; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + Entity var3 = p_70097_1_.getEntity(); + this.aiSit.setSitting(false); + + if (var3 != null && !(var3 instanceof EntityPlayer) && !(var3 instanceof EntityArrow)) { + p_70097_2_ = (p_70097_2_ + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + public boolean attackEntityAsMob(Entity p_70652_1_) { + int var2 = this.isTamed() ? 4 : 2; + return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)var2); + } + + public void setTamed(boolean p_70903_1_) { + super.setTamed(p_70903_1_); + + if (p_70903_1_) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) { + ItemStack var2 = p_70085_1_.inventory.getCurrentItem(); + + if (this.isTamed()) { + if (var2 != null) { + if (var2.getItem() instanceof ItemFood) { + ItemFood var3 = (ItemFood)var2.getItem(); + + if (var3.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) { + if (!p_70085_1_.capabilities.isCreativeMode) { + --var2.stackSize; + } + + this.heal((float)var3.func_150905_g(var2)); + + if (var2.stackSize <= 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + + return true; + } + } else if (var2.getItem() == Items.dye) { + int var4 = BlockColored.func_150032_b(var2.getItemDamage()); + + if (var4 != this.getCollarColor()) { + this.setCollarColor(var4); + + if (!p_70085_1_.capabilities.isCreativeMode && --var2.stackSize <= 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + + return true; + } + } + } + + if (this.func_152114_e(p_70085_1_) && !this.worldObj.isClient && !this.isBreedingItem(var2)) { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity(null); + this.setTarget(null); + this.setAttackTarget(null); + } + } else if (var2 != null && var2.getItem() == Items.bone && !this.isAngry()) { + if (!p_70085_1_.capabilities.isCreativeMode) { + --var2.stackSize; + } + + if (var2.stackSize <= 0) { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, null); + } + + if (!this.worldObj.isClient) { + if (this.rand.nextInt(3) == 0) { + this.setTamed(true); + this.setPathToEntity(null); + this.setAttackTarget(null); + this.aiSit.setSitting(true); + this.setHealth(20.0F); + this.func_152115_b(p_70085_1_.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte)7); + } else { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte)6); + } + } + + return true; + } + + return super.interact(p_70085_1_); + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 8) { + this.field_70928_h = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + public float getTailRotation() { + return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F)); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) { + return p_70877_1_ != null && (p_70877_1_.getItem() instanceof ItemFood && ((ItemFood) p_70877_1_.getItem()).isWolfsFavoriteMeat()); + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() { + return 8; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean p_70916_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70916_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 2))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int p_82185_1_) { + this.dataWatcher.updateObject(20, Byte.valueOf((byte)(p_82185_1_ & 15))); + } + + public EntityWolf createChild(EntityAgeable p_90011_1_) { + EntityWolf var2 = new EntityWolf(this.worldObj); + String var3 = this.func_152113_b(); + + if (var3 != null && var3.trim().length() > 0) { + var2.func_152115_b(var3); + var2.setTamed(true); + } + + return var2; + } + + public void func_70918_i(boolean p_70918_1_) { + if (p_70918_1_) { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)1)); + } else { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) { + if (p_70878_1_ == this) { + return false; + } else if (!this.isTamed()) { + return false; + } else if (!(p_70878_1_ instanceof EntityWolf)) { + return false; + } else { + EntityWolf var2 = (EntityWolf)p_70878_1_; + return var2.isTamed() && (!var2.isSitting() && this.isInLove() && var2.isInLove()); + } + } + + public boolean func_70922_bv() { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() { + return !this.isTamed() && this.ticksExisted > 2400; + } + + public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { + if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { + if (p_142018_1_ instanceof EntityWolf) { + EntityWolf var3 = (EntityWolf)p_142018_1_; + + if (var3.isTamed() && var3.getOwner() == p_142018_2_) { + return false; + } + } + + return (!(p_142018_1_ instanceof EntityPlayer) || !(p_142018_2_ instanceof EntityPlayer) || ((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_)) && (!(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame()); + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/IAnimals.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/IAnimals.java new file mode 100644 index 0000000..26d8c48 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/passive/IAnimals.java @@ -0,0 +1,4 @@ +package net.minecraft.entity.passive; + +public interface IAnimals { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/EntityPlayer.java new file mode 100644 index 0000000..21f697f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -0,0 +1,2014 @@ +package net.minecraft.entity.player; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.cosmetic.Cosmetic; +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityCrit2FX; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.event.ClickEvent; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryEnderChest; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.*; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.*; +import net.minecraft.util.*; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.IChunkProvider; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; + +public abstract class EntityPlayer extends EntityLivingBase implements ICommandSender { + /** Inventory of the player */ + public InventoryPlayer inventory = new InventoryPlayer(this); + private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); + + /** + * The Container for the player's inventory (which opens when they press E) + */ + public Container inventoryContainer; + + /** The Container the player has open. */ + public Container openContainer; + + /** The food object of the player, the general hunger logic. */ + protected FoodStats foodStats = new FoodStats(); + + private Cosmetic playerCapes = null; + private Cosmetic playerWings = null; + + /** + * Used to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as + * defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly. + */ + protected int flyToggleTimer; + public float prevCameraYaw; + public float cameraYaw; + + /** + * Used by EntityPlayer to prevent too many xp orbs from getting absorbed at once. + */ + public int xpCooldown; + public double field_71091_bM; + public double field_71096_bN; + public double field_71097_bO; + public double field_71094_bP; + public double field_71095_bQ; + public double field_71085_bR; + public float lIIlIlIllllllIllllIIllllI = 0.0f; + + /** Boolean value indicating weather a player is sleeping or not */ + protected boolean sleeping; + + /** the current location of the player */ + public ChunkCoordinates playerLocation; + private int sleepTimer; + public float field_71079_bU; + public float field_71082_cx; + public float field_71089_bV; + + /** holds the spawn chunk of the player */ + private ChunkCoordinates spawnChunk; + + /** + * Whether this player's spawn point is forced, preventing execution of bed checks. + */ + private boolean spawnForced; + + /** Holds the coordinate of the player when enter a minecraft to ride. */ + private ChunkCoordinates startMinecartRidingCoordinate; + + /** The player's capabilities. (See class PlayerCapabilities) */ + public PlayerCapabilities capabilities = new PlayerCapabilities(); + + /** The current experience level the player is on. */ + public int experienceLevel; + + /** + * The total amount of experience the player has. This also includes the amount of experience within their + * Experience Bar. + */ + public int experienceTotal; + + /** + * The current amount of experience the player has within their Experience Bar. + */ + public float experience; + + /** + * This is the item that is in use when the player is holding down the useItemButton (e.g., bow, food, sword) + */ + private ItemStack itemInUse; + + /** + * This field starts off equal to getMaxItemUseDuration and is decremented on each tick + */ + private int itemInUseCount; + protected float speedOnGround = 0.1F; + protected float speedInAir = 0.02F; + private int field_82249_h; + private final GameProfile field_146106_i; + + /** + * An instance of a fishing rod's hook. If this isn't null, the icon image of the fishing rod is slightly different + */ + public EntityFishHook fishEntity; + + public Cosmetic getPlayerCape() { + return this.playerCapes; + } + + public boolean hasCape() { + return this.playerCapes != null; + } + + public boolean hasWings() { + return this.playerWings != null; + } + + public void setCBCape(Cosmetic cosmetic) { + this.playerCapes = cosmetic; + } + + public Cosmetic getWings() { + return this.playerWings; + } + + public void setCBWings(Cosmetic cosmetic) { + this.playerWings = cosmetic; + } + + public EntityPlayer(World p_i45324_1_, GameProfile p_i45324_2_) { + super(p_i45324_1_); + this.entityUniqueID = func_146094_a(p_i45324_2_); + this.field_146106_i = p_i45324_2_; + this.inventoryContainer = new ContainerPlayer(this.inventory, !p_i45324_1_.isClient, this); + this.openContainer = this.inventoryContainer; + this.yOffset = 1.62F; + ChunkCoordinates var3 = p_i45324_1_.getSpawnPoint(); + this.setLocationAndAngles((double)var3.posX + 0.5D, var3.posY + 1, (double)var3.posZ + 0.5D, 0.0F, 0.0F); + this.field_70741_aB = 180.0F; + this.fireResistance = 20; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(17, Float.valueOf(0.0F)); + this.dataWatcher.addObject(18, Integer.valueOf(0)); + } + + /** + * returns the ItemStack containing the itemInUse + */ + public ItemStack getItemInUse() { + return this.itemInUse; + } + + /** + * Returns the item in use count + */ + public int getItemInUseCount() { + return this.itemInUseCount; + } + + /** + * Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton + */ + public boolean isUsingItem() { + return this.itemInUse != null; + } + + /** + * gets the duration for how long the current itemInUse has been in use + */ + public int getItemInUseDuration() { + return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0; + } + + public void stopUsingItem() { + if (this.itemInUse != null) { + this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); + } + + this.clearItemInUse(); + } + + public void clearItemInUse() { + this.itemInUse = null; + this.itemInUseCount = 0; + + if (!this.worldObj.isClient) { + this.setEating(false); + } + } + + public boolean isBlocking() { + return this.isUsingItem() && this.itemInUse.getItem().getItemUseAction(this.itemInUse) == EnumAction.block; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (this.itemInUse != null) { + ItemStack var1 = this.inventory.getCurrentItem(); + + if (var1 == this.itemInUse) { + if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { + this.updateItemUse(var1, 5); + } + + if (--this.itemInUseCount == 0 && !this.worldObj.isClient) { + this.onItemUseFinish(); + } + } else { + this.clearItemInUse(); + } + } + + if (this.xpCooldown > 0) { + --this.xpCooldown; + } + + if (this.isPlayerSleeping()) { + ++this.sleepTimer; + + if (this.sleepTimer > 100) { + this.sleepTimer = 100; + } + + if (!this.worldObj.isClient) { + if (!this.isInBed()) { + this.wakeUpPlayer(true, true, false); + } else if (this.worldObj.isDaytime()) { + this.wakeUpPlayer(false, true, true); + } + } + } else if (this.sleepTimer > 0) { + ++this.sleepTimer; + + if (this.sleepTimer >= 110) { + this.sleepTimer = 0; + } + } + + super.onUpdate(); + + if (!this.worldObj.isClient && this.openContainer != null && !this.openContainer.canInteractWith(this)) { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + if (this.isBurning() && this.capabilities.disableDamage) { + this.extinguish(); + } + + this.field_71091_bM = this.field_71094_bP; + this.field_71096_bN = this.field_71095_bQ; + this.field_71097_bO = this.field_71085_bR; + double var9 = this.posX - this.field_71094_bP; + double var3 = this.posY - this.field_71095_bQ; + double var5 = this.posZ - this.field_71085_bR; + double var7 = 10.0D; + + if (var9 > var7) { + this.field_71091_bM = this.field_71094_bP = this.posX; + } + + if (var5 > var7) { + this.field_71097_bO = this.field_71085_bR = this.posZ; + } + + if (var3 > var7) { + this.field_71096_bN = this.field_71095_bQ = this.posY; + } + + if (var9 < -var7) { + this.field_71091_bM = this.field_71094_bP = this.posX; + } + + if (var5 < -var7) { + this.field_71097_bO = this.field_71085_bR = this.posZ; + } + + if (var3 < -var7) { + this.field_71096_bN = this.field_71095_bQ = this.posY; + } + + this.field_71094_bP += var9 * 0.25D; + this.field_71085_bR += var5 * 0.25D; + this.field_71095_bQ += var3 * 0.25D; + + if (this.ridingEntity == null) { + this.startMinecartRidingCoordinate = null; + } + + if (!this.worldObj.isClient) { + this.foodStats.onUpdate(this); + this.addStat(StatList.minutesPlayedStat, 1); + } + } + + /** + * Return the amount of time this entity should stay in a portal before being transported. + */ + public int getMaxInPortalTime() { + return this.capabilities.disableDamage ? 0 : 80; + } + + protected String getSwimSound() { + return "game.player.swim"; + } + + protected String getSplashSound() { + return "game.player.swim.splash"; + } + + /** + * Return the amount of cooldown before this entity can use a portal again. + */ + public int getPortalCooldown() { + return 10; + } + + public void playSound(String p_85030_1_, float p_85030_2_, float p_85030_3_) { + this.worldObj.playSoundToNearExcept(this, p_85030_1_, p_85030_2_, p_85030_3_); + } + + /** + * Plays sounds and makes particles for item in use state + */ + protected void updateItemUse(ItemStack p_71010_1_, int p_71010_2_) { + if (p_71010_1_.getItemUseAction() == EnumAction.drink) { + this.playSound("random.drink", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (p_71010_1_.getItemUseAction() == EnumAction.eat) { + for (int var3 = 0; var3 < p_71010_2_; ++var3) { + Vec3 var4 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + var4.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var4.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + Vec3 var5 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); + var5.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var5.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + var5 = var5.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); + String var6 = "iconcrack_" + Item.getIdFromItem(p_71010_1_.getItem()); + + if (p_71010_1_.getHasSubtypes()) { + var6 = var6 + "_" + p_71010_1_.getItemDamage(); + } + + this.worldObj.spawnParticle(var6, var5.xCoord, var5.yCoord, var5.zCoord, var4.xCoord, var4.yCoord + 0.05D, var4.zCoord); + } + + this.playSound("random.eat", 0.5F + 0.5F * (float)this.rand.nextInt(2), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } + + /** + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() { + if (this.itemInUse != null) { + this.updateItemUse(this.itemInUse, 16); + int var1 = this.itemInUse.stackSize; + ItemStack var2 = this.itemInUse.onFoodEaten(this.worldObj, this); + + if (var2 != this.itemInUse || var2 != null && var2.stackSize != var1) { + this.inventory.mainInventory[this.inventory.currentItem] = var2; + + if (var2.stackSize == 0) { + this.inventory.mainInventory[this.inventory.currentItem] = null; + } + } + + this.clearItemInUse(); + } + } + + public void handleHealthUpdate(byte p_70103_1_) { + if (p_70103_1_ == 9) { + this.onItemUseFinish(); + } else { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() { + return this.getHealth() <= 0.0F || this.isPlayerSleeping(); + } + + /** + * set current crafting inventory back to the 2x2 square + */ + protected void closeScreen() { + this.openContainer = this.inventoryContainer; + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity p_70078_1_) { + if (this.ridingEntity != null && p_70078_1_ == null) { + if (!this.worldObj.isClient) { + this.dismountEntity(this.ridingEntity); + } + + if (this.ridingEntity != null) { + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } else { + super.mountEntity(p_70078_1_); + } + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() { + if (!this.worldObj.isClient && this.isSneaking()) { + this.mountEntity(null); + this.setSneaking(false); + } else { + double var1 = this.posX; + double var3 = this.posY; + double var5 = this.posZ; + float var7 = this.rotationYaw; + float var8 = this.rotationPitch; + super.updateRidden(); + this.prevCameraYaw = this.cameraYaw; + this.cameraYaw = 0.0F; + this.addMountedMovementStat(this.posX - var1, this.posY - var3, this.posZ - var5); + + if (this.ridingEntity instanceof EntityPig) { + this.rotationPitch = var8; + this.rotationYaw = var7; + this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; + } + } + } + + /** + * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned + * (only actually used on players though its also on Entity) + */ + public void preparePlayerToSpawn() { + this.yOffset = 1.62F; + this.setSize(0.6F, 1.8F); + super.preparePlayerToSpawn(); + this.setHealth(this.getMaxHealth()); + this.deathTime = 0; + } + + protected void updateEntityActionState() { + super.updateEntityActionState(); + this.updateArmSwingProgress(); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() { + if (this.flyToggleTimer > 0) { + --this.flyToggleTimer; + } + + if (this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL && this.getHealth() < this.getMaxHealth() && this.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.ticksExisted % 20 * 12 == 0) { + this.heal(1.0F); + } + + this.inventory.decrementAnimations(); + this.prevCameraYaw = this.cameraYaw; + super.onLivingUpdate(); + IAttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (!this.worldObj.isClient) { + var1.setBaseValue(this.capabilities.getWalkSpeed()); + } + + this.jumpMovementFactor = this.speedInAir; + + if (this.isSprinting()) { + this.jumpMovementFactor = (float)((double)this.jumpMovementFactor + (double)this.speedInAir * 0.3D); + } + + this.setAIMoveSpeed((float)var1.getAttributeValue()); + float var2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float var3 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; + + if (var2 > 0.1F) { + var2 = 0.1F; + } + + if (!this.onGround || this.getHealth() <= 0.0F) { + var2 = 0.0F; + } + + if (this.onGround || this.getHealth() <= 0.0F) { + var3 = 0.0F; + } + + this.cameraYaw += (var2 - this.cameraYaw) * 0.4F; + this.cameraPitch += (var3 - this.cameraPitch) * 0.8F; + + if (this.getHealth() > 0.0F) { + AxisAlignedBB var4 = null; + + if (this.ridingEntity != null && !this.ridingEntity.isDead) { + var4 = this.boundingBox.func_111270_a(this.ridingEntity.boundingBox).expand(1.0D, 0.0D, 1.0D); + } else { + var4 = this.boundingBox.expand(1.0D, 0.5D, 1.0D); + } + + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var4); + + if (var5 != null) { + for (int var6 = 0; var6 < var5.size(); ++var6) { + Entity var7 = (Entity)var5.get(var6); + + if (!var7.isDead) { + this.collideWithPlayer(var7); + } + } + } + } + } + + private void collideWithPlayer(Entity p_71044_1_) { + p_71044_1_.onCollideWithPlayer(this); + } + + public int getScore() { + return this.dataWatcher.getWatchableObjectInt(18); + } + + /** + * Set player's score + */ + public void setScore(int p_85040_1_) { + this.dataWatcher.updateObject(18, Integer.valueOf(p_85040_1_)); + } + + /** + * Add to player's score + */ + public void addScore(int p_85039_1_) { + int var2 = this.getScore(); + this.dataWatcher.updateObject(18, Integer.valueOf(var2 + p_85039_1_)); + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + super.onDeath(p_70645_1_); + this.setSize(0.2F, 0.2F); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionY = 0.10000000149011612D; + + if (this.getCommandSenderName().equals("Notch")) { + this.func_146097_a(new ItemStack(Items.apple, 1), true, false); + } + + if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + this.inventory.dropAllItems(); + } + + if (p_70645_1_ != null) { + this.motionX = -MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F; + this.motionZ = -MathHelper.sin((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F; + } else { + this.motionX = this.motionZ = 0.0D; + } + + this.yOffset = 0.1F; + this.addStat(StatList.deathsStat, 1); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() { + return "game.player.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() { + return "game.player.die"; + } + + /** + * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: + * entity, scoreToAdd + */ + public void addToPlayerScore(Entity p_70084_1_, int p_70084_2_) { + this.addScore(p_70084_2_); + Collection var3 = this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.totalKillCount); + + if (p_70084_1_ instanceof EntityPlayer) { + this.addStat(StatList.playerKillsStat, 1); + var3.addAll(this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.playerKillCount)); + } else { + this.addStat(StatList.mobKillsStat, 1); + } + + Iterator var4 = var3.iterator(); + + while (var4.hasNext()) { + ScoreObjective var5 = (ScoreObjective)var4.next(); + Score var6 = this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), var5); + var6.func_96648_a(); + } + } + + /** + * Called when player presses the drop item key + */ + public EntityItem dropOneItem(boolean p_71040_1_) { + return this.func_146097_a(this.inventory.decrStackSize(this.inventory.currentItem, p_71040_1_ && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false, true); + } + + /** + * Args: itemstack, flag + */ + public EntityItem dropPlayerItemWithRandomChoice(ItemStack p_71019_1_, boolean p_71019_2_) { + return this.func_146097_a(p_71019_1_, false, false); + } + + public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_) { + if (p_146097_1_ == null) { + return null; + } else if (p_146097_1_.stackSize == 0) { + return null; + } else { + EntityItem var4 = new EntityItem(this.worldObj, this.posX, this.posY - 0.30000001192092896D + (double)this.getEyeHeight(), this.posZ, p_146097_1_); + var4.delayBeforeCanPickup = 40; + + if (p_146097_3_) { + var4.func_145799_b(this.getCommandSenderName()); + } + + float var5 = 0.1F; + float var6; + + if (p_146097_2_) { + var6 = this.rand.nextFloat() * 0.5F; + float var7 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + var4.motionX = -MathHelper.sin(var7) * var6; + var4.motionZ = MathHelper.cos(var7) * var6; + var4.motionY = 0.20000000298023224D; + } else { + var5 = 0.3F; + var4.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var5; + var4.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var5; + var4.motionY = -MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * var5 + 0.1F; + var5 = 0.02F; + var6 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + var5 *= this.rand.nextFloat(); + var4.motionX += Math.cos(var6) * (double)var5; + var4.motionY += (this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F; + var4.motionZ += Math.sin(var6) * (double)var5; + } + + this.joinEntityItemWithWorld(var4); + this.addStat(StatList.dropStat, 1); + return var4; + } + } + + /** + * Joins the passed in entity item with the world. Args: entityItem + */ + protected void joinEntityItemWithWorld(EntityItem p_71012_1_) { + this.worldObj.spawnEntityInWorld(p_71012_1_); + } + + /** + * Returns how strong the player is against the specified block at this moment + */ + public float getCurrentPlayerStrVsBlock(Block p_146096_1_, boolean p_146096_2_) { + float var3 = this.inventory.func_146023_a(p_146096_1_); + + if (var3 > 1.0F) { + int var4 = EnchantmentHelper.getEfficiencyModifier(this); + ItemStack var5 = this.inventory.getCurrentItem(); + + if (var4 > 0 && var5 != null) { + float var6 = (float)(var4 * var4 + 1); + + if (!var5.func_150998_b(p_146096_1_) && var3 <= 1.0F) { + var3 += var6 * 0.08F; + } else { + var3 += var6; + } + } + } + + if (this.isPotionActive(Potion.digSpeed)) { + var3 *= 1.0F + (float)(this.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F; + } + + if (this.isPotionActive(Potion.digSlowdown)) { + var3 *= 1.0F - (float)(this.getActivePotionEffect(Potion.digSlowdown).getAmplifier() + 1) * 0.2F; + } + + if (this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) { + var3 /= 5.0F; + } + + if (!this.onGround) { + var3 /= 5.0F; + } + + return var3; + } + + /** + * Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary) + */ + public boolean canHarvestBlock(Block p_146099_1_) { + return this.inventory.func_146025_b(p_146099_1_); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + this.entityUniqueID = func_146094_a(this.field_146106_i); + NBTTagList var2 = p_70037_1_.getTagList("Inventory", 10); + this.inventory.readFromNBT(var2); + this.inventory.currentItem = p_70037_1_.getInteger("SelectedItemSlot"); + this.sleeping = p_70037_1_.getBoolean("Sleeping"); + this.sleepTimer = p_70037_1_.getShort("SleepTimer"); + this.experience = p_70037_1_.getFloat("XpP"); + this.experienceLevel = p_70037_1_.getInteger("XpLevel"); + this.experienceTotal = p_70037_1_.getInteger("XpTotal"); + this.setScore(p_70037_1_.getInteger("Score")); + + if (this.sleeping) { + this.playerLocation = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + this.wakeUpPlayer(true, true, false); + } + + if (p_70037_1_.func_150297_b("SpawnX", 99) && p_70037_1_.func_150297_b("SpawnY", 99) && p_70037_1_.func_150297_b("SpawnZ", 99)) { + this.spawnChunk = new ChunkCoordinates(p_70037_1_.getInteger("SpawnX"), p_70037_1_.getInteger("SpawnY"), p_70037_1_.getInteger("SpawnZ")); + this.spawnForced = p_70037_1_.getBoolean("SpawnForced"); + } + + this.foodStats.readNBT(p_70037_1_); + this.capabilities.readCapabilitiesFromNBT(p_70037_1_); + + if (p_70037_1_.func_150297_b("EnderItems", 9)) { + NBTTagList var3 = p_70037_1_.getTagList("EnderItems", 10); + this.theInventoryEnderChest.loadInventoryFromNBT(var3); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); + p_70014_1_.setInteger("SelectedItemSlot", this.inventory.currentItem); + p_70014_1_.setBoolean("Sleeping", this.sleeping); + p_70014_1_.setShort("SleepTimer", (short)this.sleepTimer); + p_70014_1_.setFloat("XpP", this.experience); + p_70014_1_.setInteger("XpLevel", this.experienceLevel); + p_70014_1_.setInteger("XpTotal", this.experienceTotal); + p_70014_1_.setInteger("Score", this.getScore()); + + if (this.spawnChunk != null) { + p_70014_1_.setInteger("SpawnX", this.spawnChunk.posX); + p_70014_1_.setInteger("SpawnY", this.spawnChunk.posY); + p_70014_1_.setInteger("SpawnZ", this.spawnChunk.posZ); + p_70014_1_.setBoolean("SpawnForced", this.spawnForced); + } + + this.foodStats.writeNBT(p_70014_1_); + this.capabilities.writeCapabilitiesToNBT(p_70014_1_); + p_70014_1_.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ + public void displayGUIChest(IInventory p_71007_1_) {} + + public void func_146093_a(TileEntityHopper p_146093_1_) {} + + public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) {} + + public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) {} + + public void displayGUIEnchantment(int p_71002_1_, int p_71002_2_, int p_71002_3_, String p_71002_4_) {} + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) {} + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int p_71058_1_, int p_71058_2_, int p_71058_3_) {} + + public float getEyeHeight() { + return 0.12F; + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ + protected void resetHeight() { + this.yOffset = 1.62F; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else if (this.capabilities.disableDamage && !p_70097_1_.canHarmInCreative()) { + return false; + } else { + this.entityAge = 0; + + if (this.getHealth() <= 0.0F) { + return false; + } else { + if (this.isPlayerSleeping() && !this.worldObj.isClient) { + this.wakeUpPlayer(true, true, false); + } + + if (p_70097_1_.isDifficultyScaled()) { + if (this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) { + p_70097_2_ = 0.0F; + } + + if (this.worldObj.difficultySetting == EnumDifficulty.EASY) { + p_70097_2_ = p_70097_2_ / 2.0F + 1.0F; + } + + if (this.worldObj.difficultySetting == EnumDifficulty.HARD) { + p_70097_2_ = p_70097_2_ * 3.0F / 2.0F; + } + } + + if (p_70097_2_ == 0.0F) { + return false; + } else { + Entity var3 = p_70097_1_.getEntity(); + + if (var3 instanceof EntityArrow && ((EntityArrow)var3).shootingEntity != null) { + var3 = ((EntityArrow)var3).shootingEntity; + } + + this.addStat(StatList.damageTakenStat, Math.round(p_70097_2_ * 10.0F)); + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + } + } + + public boolean canAttackPlayer(EntityPlayer p_96122_1_) { + Team var2 = this.getTeam(); + Team var3 = p_96122_1_.getTeam(); + return var2 == null || (!var2.isSameTeam(var3) || var2.getAllowFriendlyFire()); + } + + protected void damageArmor(float p_70675_1_) { + this.inventory.damageArmor(p_70675_1_); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() { + return this.inventory.getTotalArmorValue(); + } + + /** + * When searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing + * them anyway. + */ + public float getArmorVisibility() { + int var1 = 0; + ItemStack[] var2 = this.inventory.armorInventory; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; + + if (var5 != null) { + ++var1; + } + } + + return (float)var1 / (float)this.inventory.armorInventory.length; + } + + /** + * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health + * second with the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource p_70665_1_, float p_70665_2_) { + if (!this.isEntityInvulnerable()) { + if (!p_70665_1_.isUnblockable() && this.isBlocking() && p_70665_2_ > 0.0F) { + p_70665_2_ = (1.0F + p_70665_2_) * 0.5F; + } + + p_70665_2_ = this.applyArmorCalculations(p_70665_1_, p_70665_2_); + p_70665_2_ = this.applyPotionDamageCalculations(p_70665_1_, p_70665_2_); + float var3 = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - p_70665_2_)); + + if (p_70665_2_ != 0.0F) { + this.addExhaustion(p_70665_1_.getHungerDamage()); + float var4 = this.getHealth(); + this.setHealth(this.getHealth() - p_70665_2_); + this.func_110142_aN().func_94547_a(p_70665_1_, var4, p_70665_2_); + } + } + } + + public void func_146101_a(TileEntityFurnace p_146101_1_) {} + + public void func_146102_a(TileEntityDispenser p_146102_1_) {} + + public void func_146100_a(TileEntity p_146100_1_) {} + + public void func_146095_a(CommandBlockLogic p_146095_1_) {} + + public void func_146098_a(TileEntityBrewingStand p_146098_1_) {} + + public void func_146104_a(TileEntityBeacon p_146104_1_) {} + + public void displayGUIMerchant(IMerchant p_71030_1_, String p_71030_2_) {} + + /** + * Displays the GUI for interacting with a book. + */ + public void displayGUIBook(ItemStack p_71048_1_) {} + + public boolean interactWith(Entity p_70998_1_) { + ItemStack var2 = this.getCurrentEquippedItem(); + ItemStack var3 = var2 != null ? var2.copy() : null; + + if (!p_70998_1_.interactFirst(this)) { + if (var2 != null && p_70998_1_ instanceof EntityLivingBase) { + if (this.capabilities.isCreativeMode) { + var2 = var3; + } + + if (var2.interactWithEntity(this, (EntityLivingBase)p_70998_1_)) { + if (var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { + this.destroyCurrentEquippedItem(); + } + + return true; + } + } + + return false; + } else { + if (var2 != null && var2 == this.getCurrentEquippedItem()) { + if (var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { + this.destroyCurrentEquippedItem(); + } else if (var2.stackSize < var3.stackSize && this.capabilities.isCreativeMode) { + var2.stackSize = var3.stackSize; + } + } + + return true; + } + } + + /** + * Returns the currently being used item by the player. + */ + public ItemStack getCurrentEquippedItem() { + return this.inventory.getCurrentItem(); + } + + /** + * Destroys the currently equipped item from the player's inventory. + */ + public void destroyCurrentEquippedItem() { + this.inventory.setInventorySlotContents(this.inventory.currentItem, null); + } + + /** + * Returns the Y Offset of this entity. + */ + public double getYOffset() { + return this.yOffset - 0.5F; + } + + /** + * Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity + * called on it. Args: targetEntity + */ + public void attackTargetEntityWithCurrentItem(Entity p_71059_1_) { + if (p_71059_1_.canAttackWithItem()) { + if (!p_71059_1_.hitByEntity(this)) { + float var2 = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int var3 = 0; + float var4 = 0.0F; + + if (p_71059_1_ instanceof EntityLivingBase) { + var4 = EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)p_71059_1_); + var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)p_71059_1_); + } + + if (this.isSprinting()) { + ++var3; + } + + if (var2 > 0.0F || var4 > 0.0F) { + boolean var5 = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && p_71059_1_ instanceof EntityLivingBase; + + if (var5 && var2 > 0.0F) { + var2 *= 1.5F; + } + + var2 += var4; + boolean var6 = false; + int var7 = EnchantmentHelper.getFireAspectModifier(this); + + if (p_71059_1_ instanceof EntityLivingBase && var7 > 0 && !p_71059_1_.isBurning()) { + var6 = true; + p_71059_1_.setFire(1); + } + + boolean var8 = p_71059_1_.attackEntityFrom(DamageSource.causePlayerDamage(this), var2); + + if (var8) { + int i; + if (var3 > 0) { + p_71059_1_.addVelocity(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F, 0.1D, MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + this.setSprinting(false); + } + boolean override = Minecraft.getMinecraft().isSingleplayer() ? (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.damaged.getValue().equals("Override") : (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.attacking.getValue().equals("Override"); + boolean vanilla = Minecraft.getMinecraft().isSingleplayer() ? (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.damaged.getValue().equals("Vanilla") : (Boolean) CheatBreaker.getInstance().getModuleManager().particlesMod.attacking.getValue().equals("Vanilla"); + + if (var5 || CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().particlesMod.critParticles.getValue().equals("Always") && !vanilla) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && !vanilla) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.critParticles.getValue().equals("Never") && override) { + EntityCrit2FX var1 = new EntityCrit2FX(Minecraft.getMinecraft().theWorld, p_71059_1_, "crit", (Float) CheatBreaker.getInstance().getModuleManager().particlesMod.critParticlesMultiplier.getValue()); + Minecraft.getMinecraft().effectRenderer.addEffect(var1); + } + } else { + this.onCriticalHit(p_71059_1_); + } + } + + if (var4 > 0.0F || CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticles.getValue().equals("Always") && !vanilla) { + if (CheatBreaker.getInstance().getModuleManager().particlesMod.isEnabled() && !vanilla) { + if (!CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticles.getValue().equals("Never") && override) { + EntityCrit2FX var1 = new EntityCrit2FX(Minecraft.getMinecraft().theWorld, p_71059_1_, "magicCrit", (Float) CheatBreaker.getInstance().getModuleManager().particlesMod.sharpnessParticlesMultiplier.getValue()); + Minecraft.getMinecraft().effectRenderer.addEffect(var1); + } + } else { + this.onEnchantmentCritical(p_71059_1_); + } + } + + if (var2 >= 18.0F) { + this.triggerAchievement(AchievementList.overkill); + } + + this.setLastAttacker(p_71059_1_); + + if (p_71059_1_ instanceof EntityLivingBase) { + EnchantmentHelper.func_151384_a((EntityLivingBase)p_71059_1_, this); + } + + EnchantmentHelper.func_151385_b(this, p_71059_1_); + ItemStack var9 = this.getCurrentEquippedItem(); + Object var10 = p_71059_1_; + + if (p_71059_1_ instanceof EntityDragonPart) { + IEntityMultiPart var11 = ((EntityDragonPart)p_71059_1_).entityDragonObj; + + if (var11 != null && var11 instanceof EntityLivingBase) { + var10 = var11; + } + } + + if (var9 != null && var10 instanceof EntityLivingBase) { + var9.hitEntity((EntityLivingBase)var10, this); + + if (var9.stackSize <= 0) { + this.destroyCurrentEquippedItem(); + } + } + + if (p_71059_1_ instanceof EntityLivingBase) { + this.addStat(StatList.damageDealtStat, Math.round(var2 * 10.0F)); + + if (var7 > 0) { + p_71059_1_.setFire(var7 * 4); + } + } + + this.addExhaustion(0.3F); + } else if (var6) { + p_71059_1_.extinguish(); + } + } + } + } + } + + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity p_71009_1_) {} + + public void onEnchantmentCritical(Entity p_71047_1_) {} + + public void respawnPlayer() {} + + /** + * Will get destroyed next tick. + */ + public void setDead() { + super.setDead(); + this.inventoryContainer.onContainerClosed(this); + + if (this.openContainer != null) { + this.openContainer.onContainerClosed(this); + } + } + + /** + * Checks if this entity is inside of an opaque block + */ + public boolean isEntityInsideOpaqueBlock() { + return !this.sleeping && super.isEntityInsideOpaqueBlock(); + } + + /** + * Returns the GameProfile for this player + */ + public GameProfile getGameProfile() { + return this.field_146106_i; + } + + /** + * puts player to sleep on specified bed if possible + */ + public EntityPlayer.EnumStatus sleepInBedAt(int p_71018_1_, int p_71018_2_, int p_71018_3_) { + if (!this.worldObj.isClient) { + if (this.isPlayerSleeping() || !this.isEntityAlive()) { + return EntityPlayer.EnumStatus.OTHER_PROBLEM; + } + + if (!this.worldObj.provider.isSurfaceWorld()) { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_HERE; + } + + if (this.worldObj.isDaytime()) { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW; + } + + if (Math.abs(this.posX - (double)p_71018_1_) > 3.0D || Math.abs(this.posY - (double)p_71018_2_) > 2.0D || Math.abs(this.posZ - (double)p_71018_3_) > 3.0D) { + return EntityPlayer.EnumStatus.TOO_FAR_AWAY; + } + + double var4 = 8.0D; + double var6 = 5.0D; + List var8 = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getBoundingBox((double)p_71018_1_ - var4, (double)p_71018_2_ - var6, (double)p_71018_3_ - var4, (double)p_71018_1_ + var4, (double)p_71018_2_ + var6, (double)p_71018_3_ + var4)); + + if (!var8.isEmpty()) { + return EntityPlayer.EnumStatus.NOT_SAFE; + } + } + + if (this.isRiding()) { + this.mountEntity(null); + } + + this.setSize(0.2F, 0.2F); + this.yOffset = 0.2F; + + if (this.worldObj.blockExists(p_71018_1_, p_71018_2_, p_71018_3_)) { + int var9 = this.worldObj.getBlockMetadata(p_71018_1_, p_71018_2_, p_71018_3_); + int var5 = BlockBed.func_149895_l(var9); + float var10 = 0.5F; + float var7 = 0.5F; + + switch (var5) { + case 0: + var7 = 0.9F; + break; + + case 1: + var10 = 0.1F; + break; + + case 2: + var7 = 0.1F; + break; + + case 3: + var10 = 0.9F; + } + + this.func_71013_b(var5); + this.setPosition((float)p_71018_1_ + var10, (float)p_71018_2_ + 0.9375F, (float)p_71018_3_ + var7); + } else { + this.setPosition((float)p_71018_1_ + 0.5F, (float)p_71018_2_ + 0.9375F, (float)p_71018_3_ + 0.5F); + } + + this.sleeping = true; + this.sleepTimer = 0; + this.playerLocation = new ChunkCoordinates(p_71018_1_, p_71018_2_, p_71018_3_); + this.motionX = this.motionZ = this.motionY = 0.0D; + + if (!this.worldObj.isClient) { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + return EntityPlayer.EnumStatus.OK; + } + + private void func_71013_b(int p_71013_1_) { + this.field_71079_bU = 0.0F; + this.field_71089_bV = 0.0F; + + switch (p_71013_1_) { + case 0: + this.field_71089_bV = -1.8F; + break; + + case 1: + this.field_71079_bU = 1.8F; + break; + + case 2: + this.field_71089_bV = 1.8F; + break; + + case 3: + this.field_71079_bU = -1.8F; + } + } + + /** + * Wake up the player if they're sleeping. + */ + public void wakeUpPlayer(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) { + this.setSize(0.6F, 1.8F); + this.resetHeight(); + ChunkCoordinates var4 = this.playerLocation; + ChunkCoordinates var5 = this.playerLocation; + + if (var4 != null && this.worldObj.getBlock(var4.posX, var4.posY, var4.posZ) == Blocks.bed) { + BlockBed.func_149979_a(this.worldObj, var4.posX, var4.posY, var4.posZ, false); + var5 = BlockBed.func_149977_a(this.worldObj, var4.posX, var4.posY, var4.posZ, 0); + + if (var5 == null) { + var5 = new ChunkCoordinates(var4.posX, var4.posY + 1, var4.posZ); + } + + this.setPosition((float)var5.posX + 0.5F, (float)var5.posY + this.yOffset + 0.1F, (float)var5.posZ + 0.5F); + } + + this.sleeping = false; + + if (!this.worldObj.isClient && p_70999_2_) { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + if (p_70999_1_) { + this.sleepTimer = 0; + } else { + this.sleepTimer = 100; + } + + if (p_70999_3_) { + this.setSpawnChunk(this.playerLocation, false); + } + } + + /** + * Checks if the player is currently in a bed + */ + private boolean isInBed() { + return this.worldObj.getBlock(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Blocks.bed; + } + + /** + * Ensure that a block enabling respawning exists at the specified coordinates and find an empty space nearby to + * spawn. + */ + public static ChunkCoordinates verifyRespawnCoordinates(World p_71056_0_, ChunkCoordinates p_71056_1_, boolean p_71056_2_) { + IChunkProvider var3 = p_71056_0_.getChunkProvider(); + var3.loadChunk(p_71056_1_.posX - 3 >> 4, p_71056_1_.posZ - 3 >> 4); + var3.loadChunk(p_71056_1_.posX + 3 >> 4, p_71056_1_.posZ - 3 >> 4); + var3.loadChunk(p_71056_1_.posX - 3 >> 4, p_71056_1_.posZ + 3 >> 4); + var3.loadChunk(p_71056_1_.posX + 3 >> 4, p_71056_1_.posZ + 3 >> 4); + + if (p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ) == Blocks.bed) { + ChunkCoordinates var8 = BlockBed.func_149977_a(p_71056_0_, p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ, 0); + return var8; + } else { + Material var4 = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ).getMaterial(); + Material var5 = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY + 1, p_71056_1_.posZ).getMaterial(); + boolean var6 = !var4.isSolid() && !var4.isLiquid(); + boolean var7 = !var5.isSolid() && !var5.isLiquid(); + return p_71056_2_ && var6 && var7 ? p_71056_1_ : null; + } + } + + /** + * Returns the orientation of the bed in degrees. + */ + public float getBedOrientationInDegrees() { + if (this.playerLocation != null) { + int var1 = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); + int var2 = BlockBed.func_149895_l(var1); + + switch (var2) { + case 0: + return 90.0F; + + case 1: + return 0.0F; + + case 2: + return 270.0F; + + case 3: + return 180.0F; + } + } + + return 0.0F; + } + + /** + * Returns whether player is sleeping or not + */ + public boolean isPlayerSleeping() { + return this.sleeping; + } + + /** + * Returns whether or not the player is asleep and the screen has fully faded. + */ + public boolean isPlayerFullyAsleep() { + return this.sleeping && this.sleepTimer >= 100; + } + + public int getSleepTimer() { + return this.sleepTimer; + } + + protected boolean getHideCape(int p_82241_1_) { + return (this.dataWatcher.getWatchableObjectByte(16) & 1 << p_82241_1_) != 0; + } + + protected void setHideCape(int p_82239_1_, boolean p_82239_2_) { + byte var3 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_82239_2_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 | 1 << p_82239_1_))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 & ~(1 << p_82239_1_)))); + } + } + + public void addChatComponentMessage(IChatComponent p_146105_1_) {} + + /** + * Returns the location of the bed the player will respawn at, or null if the player has not slept in a bed. + */ + public ChunkCoordinates getBedLocation() { + return this.spawnChunk; + } + + public boolean isSpawnForced() { + return this.spawnForced; + } + + /** + * Defines a spawn coordinate to player spawn. Used by bed after the player sleep on it. + */ + public void setSpawnChunk(ChunkCoordinates p_71063_1_, boolean p_71063_2_) { + if (p_71063_1_ != null) { + this.spawnChunk = new ChunkCoordinates(p_71063_1_); + this.spawnForced = p_71063_2_; + } else { + this.spawnChunk = null; + this.spawnForced = false; + } + } + + /** + * Will trigger the specified trigger. + */ + public void triggerAchievement(StatBase p_71029_1_) { + this.addStat(p_71029_1_, 1); + } + + /** + * Adds a value to a statistic field. + */ + public void addStat(StatBase p_71064_1_, int p_71064_2_) {} + + /** + * Causes this entity to do an upwards motion (jumping). + */ + public void jump() { + super.jump(); + this.addStat(StatList.jumpStat, 1); + + if (this.isSprinting()) { + this.addExhaustion(0.8F); + } else { + this.addExhaustion(0.2F); + } + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) { + double var3 = this.posX; + double var5 = this.posY; + double var7 = this.posZ; + + if (this.capabilities.isFlying && this.ridingEntity == null) { + double var9 = this.motionY; + float var11 = this.jumpMovementFactor; + this.jumpMovementFactor = this.capabilities.getFlySpeed(); + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + this.motionY = var9 * 0.6D; + this.jumpMovementFactor = var11; + } else { + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + } + + this.addMovementStat(this.posX - var3, this.posY - var5, this.posZ - var7); + } + + /** + * the movespeed used for the new AI system + */ + public float getAIMoveSpeed() { + return (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); + } + + /** + * Adds a value to a movement statistic field - like run, walk, swin or climb. + */ + public void addMovementStat(double p_71000_1_, double p_71000_3_, double p_71000_5_) { + if (this.ridingEntity == null) { + int var7; + + if (this.isInsideOfMaterial(Material.water)) { + var7 = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_3_ * p_71000_3_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (var7 > 0) { + this.addStat(StatList.distanceDoveStat, var7); + this.addExhaustion(0.015F * (float)var7 * 0.01F); + } + } else if (this.isInWater()) { + var7 = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (var7 > 0) { + this.addStat(StatList.distanceSwumStat, var7); + this.addExhaustion(0.015F * (float)var7 * 0.01F); + } + } else if (this.isOnLadder()) { + if (p_71000_3_ > 0.0D) { + this.addStat(StatList.distanceClimbedStat, (int)Math.round(p_71000_3_ * 100.0D)); + } + } else if (this.onGround) { + var7 = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (var7 > 0) { + this.addStat(StatList.distanceWalkedStat, var7); + + if (this.isSprinting()) { + this.addExhaustion(0.099999994F * (float)var7 * 0.01F); + } else { + this.addExhaustion(0.01F * (float)var7 * 0.01F); + } + } + } else { + var7 = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (var7 > 25) { + this.addStat(StatList.distanceFlownStat, var7); + } + } + } + } + + /** + * Adds a value to a mounted movement statistic field - by minecart, boat, or pig. + */ + private void addMountedMovementStat(double p_71015_1_, double p_71015_3_, double p_71015_5_) { + if (this.ridingEntity != null) { + int var7 = Math.round(MathHelper.sqrt_double(p_71015_1_ * p_71015_1_ + p_71015_3_ * p_71015_3_ + p_71015_5_ * p_71015_5_) * 100.0F); + + if (var7 > 0) { + if (this.ridingEntity instanceof EntityMinecart) { + this.addStat(StatList.distanceByMinecartStat, var7); + + if (this.startMinecartRidingCoordinate == null) { + this.startMinecartRidingCoordinate = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + } else if ((double)this.startMinecartRidingCoordinate.getDistanceSquared(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) >= 1000000.0D) { + this.addStat(AchievementList.onARail, 1); + } + } else if (this.ridingEntity instanceof EntityBoat) { + this.addStat(StatList.distanceByBoatStat, var7); + } else if (this.ridingEntity instanceof EntityPig) { + this.addStat(StatList.distanceByPigStat, var7); + } else if (this.ridingEntity instanceof EntityHorse) { + this.addStat(StatList.field_151185_q, var7); + } + } + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) { + if (!this.capabilities.allowFlying) { + if (p_70069_1_ >= 2.0F) { + this.addStat(StatList.distanceFallenStat, (int)Math.round((double)p_70069_1_ * 100.0D)); + } + + super.fall(p_70069_1_); + } + } + + protected String func_146067_o(int p_146067_1_) { + return p_146067_1_ > 4 ? "game.player.hurt.fall.big" : "game.player.hurt.fall.small"; + } + + /** + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase p_70074_1_) { + if (p_70074_1_ instanceof IMob) { + this.triggerAchievement(AchievementList.killEnemy); + } + + int var2 = EntityList.getEntityID(p_70074_1_); + EntityList.EntityEggInfo var3 = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(var2)); + + if (var3 != null) { + this.addStat(var3.field_151512_d, 1); + } + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() { + if (!this.capabilities.isFlying) { + super.setInWeb(); + } + } + + /** + * Gets the Icon Index of the item currently held + */ + public IIcon getItemIcon(ItemStack p_70620_1_, int p_70620_2_) { + IIcon var3 = super.getItemIcon(p_70620_1_, p_70620_2_); + + if (p_70620_1_.getItem() == Items.fishing_rod && this.fishEntity != null) { + var3 = Items.fishing_rod.func_94597_g(); + } else { + if (p_70620_1_.getItem().requiresMultipleRenderPasses()) { + return p_70620_1_.getItem().getIconFromDamageForRenderPass(p_70620_1_.getItemDamage(), p_70620_2_); + } + + if (this.itemInUse != null && p_70620_1_.getItem() == Items.bow) { + int var4 = p_70620_1_.getMaxItemUseDuration() - this.itemInUseCount; + + if (var4 >= 18) { + return Items.bow.getItemIconForUseDuration(2); + } + + if (var4 > 13) { + return Items.bow.getItemIconForUseDuration(1); + } + + if (var4 > 0) { + return Items.bow.getItemIconForUseDuration(0); + } + } + } + + return var3; + } + + public ItemStack getCurrentArmor(int p_82169_1_) { + return this.inventory.armorItemInSlot(p_82169_1_); + } + + /** + * Add experience points to player. + */ + public void addExperience(int p_71023_1_) { + this.addScore(p_71023_1_); + int var2 = Integer.MAX_VALUE - this.experienceTotal; + + if (p_71023_1_ > var2) { + p_71023_1_ = var2; + } + + this.experience += (float)p_71023_1_ / (float)this.xpBarCap(); + + for (this.experienceTotal += p_71023_1_; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) { + this.experience = (this.experience - 1.0F) * (float)this.xpBarCap(); + this.addExperienceLevel(1); + } + } + + /** + * Add experience levels to this player. + */ + public void addExperienceLevel(int p_82242_1_) { + this.experienceLevel += p_82242_1_; + + if (this.experienceLevel < 0) { + this.experienceLevel = 0; + this.experience = 0.0F; + this.experienceTotal = 0; + } + + if (p_82242_1_ > 0 && this.experienceLevel % 5 == 0 && (float)this.field_82249_h < (float)this.ticksExisted - 100.0F) { + float var2 = this.experienceLevel > 30 ? 1.0F : (float)this.experienceLevel / 30.0F; + this.worldObj.playSoundAtEntity(this, "random.levelup", var2 * 0.75F, 1.0F); + this.field_82249_h = this.ticksExisted; + } + } + + /** + * This method returns the cap amount of experience that the experience bar can hold. With each level, the + * experience cap on the player's experience bar is raised by 10. + */ + public int xpBarCap() { + return this.experienceLevel >= 30 ? 62 + (this.experienceLevel - 30) * 7 : (this.experienceLevel >= 15 ? 17 + (this.experienceLevel - 15) * 3 : 17); + } + + /** + * increases exhaustion level by supplied amount + */ + public void addExhaustion(float p_71020_1_) { + if (!this.capabilities.disableDamage) { + if (!this.worldObj.isClient) { + this.foodStats.addExhaustion(p_71020_1_); + } + } + } + + /** + * Returns the player's FoodStats object. + */ + public FoodStats getFoodStats() { + return this.foodStats; + } + + public boolean canEat(boolean p_71043_1_) { + return (p_71043_1_ || this.foodStats.needFood()) && !this.capabilities.disableDamage; + } + + /** + * Checks if the player's health is not full and not zero. + */ + public boolean shouldHeal() { + return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); + } + + /** + * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration + */ + public void setItemInUse(ItemStack p_71008_1_, int p_71008_2_) { + if (p_71008_1_ != this.itemInUse) { + this.itemInUse = p_71008_1_; + this.itemInUseCount = p_71008_2_; + + if (!this.worldObj.isClient) { + this.setEating(true); + } + } + } + + /** + * Returns true if the given block can be mined with the current tool in adventure mode. + */ + public boolean isCurrentToolAdventureModeExempt(int p_82246_1_, int p_82246_2_, int p_82246_3_) { + if (this.capabilities.allowEdit) { + return true; + } else { + Block var4 = this.worldObj.getBlock(p_82246_1_, p_82246_2_, p_82246_3_); + + if (var4.getMaterial() != Material.air) { + if (var4.getMaterial().isAdventureModeExempt()) { + return true; + } + + if (this.getCurrentEquippedItem() != null) { + ItemStack var5 = this.getCurrentEquippedItem(); + + return var5.func_150998_b(var4) || var5.func_150997_a(var4) > 1.0F; + } + } + + return false; + } + } + + public boolean canPlayerEdit(int p_82247_1_, int p_82247_2_, int p_82247_3_, int p_82247_4_, ItemStack p_82247_5_) { + return this.capabilities.allowEdit || (p_82247_5_ != null && p_82247_5_.canEditBlocks()); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) { + if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + return 0; + } else { + int var2 = this.experienceLevel * 7; + return var2 > 100 ? 100 : var2; + } + } + + /** + * Only use is to identify if class is an instance of player for experience dropping + */ + protected boolean isPlayer() { + return true; + } + + public boolean getAlwaysRenderNameTagForRender() { + return true; + } + + /** + * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest + * Inventory. + */ + public void clonePlayer(EntityPlayer p_71049_1_, boolean p_71049_2_) { + if (p_71049_2_) { + this.inventory.copyInventory(p_71049_1_.inventory); + this.setHealth(p_71049_1_.getHealth()); + this.foodStats = p_71049_1_.foodStats; + this.experienceLevel = p_71049_1_.experienceLevel; + this.experienceTotal = p_71049_1_.experienceTotal; + this.experience = p_71049_1_.experience; + this.setScore(p_71049_1_.getScore()); + this.teleportDirection = p_71049_1_.teleportDirection; + } else if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + this.inventory.copyInventory(p_71049_1_.inventory); + this.experienceLevel = p_71049_1_.experienceLevel; + this.experienceTotal = p_71049_1_.experienceTotal; + this.experience = p_71049_1_.experience; + this.setScore(p_71049_1_.getScore()); + } + + this.theInventoryEnderChest = p_71049_1_.theInventoryEnderChest; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return !this.capabilities.isFlying; + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() {} + + /** + * Sets the player's game mode and sends it to them. + */ + public void setGameType(WorldSettings.GameType p_71033_1_) {} + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return this.field_146106_i.getName(); + } + + public World getEntityWorld() { + return this.worldObj; + } + + /** + * Returns the InventoryEnderChest of this player. + */ + public InventoryEnderChest getInventoryEnderChest() { + return this.theInventoryEnderChest; + } + + /** + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int p_71124_1_) { + return p_71124_1_ == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[p_71124_1_ - 1]; + } + + /** + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() { + return this.inventory.getCurrentItem(); + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int p_70062_1_, ItemStack p_70062_2_) { + try { + this.inventory.armorInventory[p_70062_1_] = p_70062_2_; + } catch (ArrayIndexOutOfBoundsException e) { + e.printStackTrace(); + } + } + + /** + * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic + * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible + * will render the entity semitransparent. + */ + public boolean isInvisibleToPlayer(EntityPlayer p_98034_1_) { + if (!this.isInvisible()) { + return false; + } else { + Team var2 = this.getTeam(); + return var2 == null || p_98034_1_ == null || p_98034_1_.getTeam() != var2 || !var2.func_98297_h(); + } + } + + public ItemStack[] getLastActiveItems() { + return this.inventory.armorInventory; + } + + public boolean getHideCape() { + return this.getHideCape(1); + } + + public boolean isPushedByWater() { + return !this.capabilities.isFlying; + } + + public Scoreboard getWorldScoreboard() { + return this.worldObj.getScoreboard(); + } + + public Team getTeam() { + return this.getWorldScoreboard().getPlayersTeam(this.getCommandSenderName()); + } + + public IChatComponent func_145748_c_() { + ChatComponentText var1 = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getCommandSenderName())); + var1.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getCommandSenderName() + " ")); + return var1; + } + + public void setAbsorptionAmount(float p_110149_1_) { + if (p_110149_1_ < 0.0F) { + p_110149_1_ = 0.0F; + } + + this.getDataWatcher().updateObject(17, Float.valueOf(p_110149_1_)); + } + + public float getAbsorptionAmount() { + return this.getDataWatcher().getWatchableObjectFloat(17); + } + + public static UUID func_146094_a(GameProfile p_146094_0_) { + UUID var1 = p_146094_0_.getId(); + + if (var1 == null) { + var1 = UUID.nameUUIDFromBytes(("OfflinePlayer:" + p_146094_0_.getName()).getBytes(Charsets.UTF_8)); + } + + return var1; + } + + public enum EnumChatVisibility { + FULL("FULL", 0, 0, "options.chat.visibility.full"), + SYSTEM("SYSTEM", 1, 1, "options.chat.visibility.system"), + HIDDEN("HIDDEN", 2, 2, "options.chat.visibility.hidden"); + private static final EntityPlayer.EnumChatVisibility[] field_151432_d = new EntityPlayer.EnumChatVisibility[values().length]; + private final int chatVisibility; + private final String resourceKey; + + private static final EntityPlayer.EnumChatVisibility[] $VALUES = new EntityPlayer.EnumChatVisibility[]{FULL, SYSTEM, HIDDEN}; + + + EnumChatVisibility(String p_i45323_1_, int p_i45323_2_, int p_i45323_3_, String p_i45323_4_) { + this.chatVisibility = p_i45323_3_; + this.resourceKey = p_i45323_4_; + } + + public int getChatVisibility() { + return this.chatVisibility; + } + + public static EntityPlayer.EnumChatVisibility getEnumChatVisibility(int p_151426_0_) { + return field_151432_d[p_151426_0_ % field_151432_d.length]; + } + + public String getResourceKey() { + return this.resourceKey; + } + + static { + EntityPlayer.EnumChatVisibility[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + EntityPlayer.EnumChatVisibility var3 = var0[var2]; + field_151432_d[var3.chatVisibility] = var3; + } + } + } + + public enum EnumStatus { + OK("OK", 0), + NOT_POSSIBLE_HERE("NOT_POSSIBLE_HERE", 1), + NOT_POSSIBLE_NOW("NOT_POSSIBLE_NOW", 2), + TOO_FAR_AWAY("TOO_FAR_AWAY", 3), + OTHER_PROBLEM("OTHER_PROBLEM", 4), + NOT_SAFE("NOT_SAFE", 5); + + private static final EntityPlayer.EnumStatus[] $VALUES = new EntityPlayer.EnumStatus[]{OK, NOT_POSSIBLE_HERE, NOT_POSSIBLE_NOW, TOO_FAR_AWAY, OTHER_PROBLEM, NOT_SAFE}; + + + EnumStatus(String p_i1751_1_, int p_i1751_2_) {} + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java new file mode 100644 index 0000000..bd68855 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java @@ -0,0 +1,1008 @@ +package net.minecraft.entity.player; + +import com.google.common.collect.Sets; +import com.mojang.authlib.GameProfile; +import io.netty.buffer.Unpooled; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.ContainerBrewingStand; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.ContainerDispenser; +import net.minecraft.inventory.ContainerEnchantment; +import net.minecraft.inventory.ContainerFurnace; +import net.minecraft.inventory.ContainerHopper; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryMerchant; +import net.minecraft.inventory.SlotCrafting; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemMapBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.server.management.UserListOpsEntry; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonSerializableSet; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityPlayerMP extends EntityPlayer implements ICrafting { + private static final Logger logger = LogManager.getLogger(); + private String translator = "en_US"; + + /** + * The NetServerHandler assigned to this player by the ServerConfigurationManager. + */ + public NetHandlerPlayServer playerNetServerHandler; + + /** Reference to the MinecraftServer object. */ + public final MinecraftServer mcServer; + + /** The ItemInWorldManager belonging to this player */ + public final ItemInWorldManager theItemInWorldManager; + + /** player X position as seen by PlayerManager */ + public double managedPosX; + + /** player Z position as seen by PlayerManager */ + public double managedPosZ; + + /** LinkedList that holds the loaded chunks. */ + public final List loadedChunks = new LinkedList(); + + /** entities added to this list will be packet29'd to the player */ + private final List destroyedItemsNetCache = new LinkedList(); + private final StatisticsFile field_147103_bO; + private float field_130068_bO = Float.MIN_VALUE; + + /** amount of health the com.cheatbreaker.client was last set to */ + private float lastHealth = -1.0E8F; + + /** set to foodStats.GetFoodLevel */ + private int lastFoodLevel = -99999999; + + /** set to foodStats.getSaturationLevel() == 0.0F each tick */ + private boolean wasHungry = true; + + /** Amount of experience the com.cheatbreaker.client was last set to */ + private int lastExperience = -99999999; + private int field_147101_bU = 60; + private EntityPlayer.EnumChatVisibility chatVisibility; + private boolean chatColours = true; + private long field_143005_bX = System.currentTimeMillis(); + + /** + * The currently in use window ID. Incremented every time a window is opened. + */ + private int currentWindowId; + + /** + * set to true when player is moving quantity of items from one inventory to another(crafting) but item in either + * slot is not changed + */ + public boolean isChangingQuantityOnly; + public int ping; + + /** + * Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory + * and XP + */ + public boolean playerConqueredTheEnd; + + + public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, ItemInWorldManager p_i45285_4_) { + super(p_i45285_2_, p_i45285_3_); + p_i45285_4_.thisPlayerMP = this; + this.theItemInWorldManager = p_i45285_4_; + ChunkCoordinates var5 = p_i45285_2_.getSpawnPoint(); + int var6 = var5.posX; + int var7 = var5.posZ; + int var8 = var5.posY; + + if (!p_i45285_2_.provider.hasNoSky && p_i45285_2_.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) { + int var9 = Math.max(5, p_i45285_1_.getSpawnProtectionSize() - 6); + var6 += this.rand.nextInt(var9 * 2) - var9; + var7 += this.rand.nextInt(var9 * 2) - var9; + var8 = p_i45285_2_.getTopSolidOrLiquidBlock(var6, var7); + } + + this.mcServer = p_i45285_1_; + this.field_147103_bO = p_i45285_1_.getConfigurationManager().func_152602_a(this); + this.stepHeight = 0.0F; + this.yOffset = 0.0F; + this.setLocationAndAngles((double)var6 + 0.5D, var8, (double)var7 + 0.5D, 0.0F, 0.0F); + + while (!p_i45285_2_.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { + this.setPosition(this.posX, this.posY + 1.0D, this.posZ); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + + if (p_70037_1_.func_150297_b("playerGameType", 99)) { + if (MinecraftServer.getServer().getForceGamemode()) { + this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType()); + } else { + this.theItemInWorldManager.setGameType(WorldSettings.GameType.getByID(p_70037_1_.getInteger("playerGameType"))); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); + } + + /** + * Add experience levels to this player. + */ + public void addExperienceLevel(int p_82242_1_) { + super.addExperienceLevel(p_82242_1_); + this.lastExperience = -1; + } + + public void addSelfToInternalCraftingInventory() { + this.openContainer.addCraftingToCrafters(this); + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ + protected void resetHeight() { + this.yOffset = 0.0F; + } + + public float getEyeHeight() { + return 1.62F; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.theItemInWorldManager.updateBlockRemoving(); + --this.field_147101_bU; + + if (this.hurtResistantTime > 0) { + --this.hurtResistantTime; + } + + this.openContainer.detectAndSendChanges(); + + if (!this.worldObj.isClient && !this.openContainer.canInteractWith(this)) { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + while (!this.destroyedItemsNetCache.isEmpty()) { + int var1 = Math.min(this.destroyedItemsNetCache.size(), 127); + int[] var2 = new int[var1]; + Iterator var3 = this.destroyedItemsNetCache.iterator(); + int var4 = 0; + + while (var3.hasNext() && var4 < var1) { + var2[var4++] = ((Integer)var3.next()).intValue(); + var3.remove(); + } + + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(var2)); + } + + if (!this.loadedChunks.isEmpty()) { + ArrayList var6 = new ArrayList(); + Iterator var7 = this.loadedChunks.iterator(); + ArrayList var8 = new ArrayList(); + Chunk var5; + + while (var7.hasNext() && var6.size() < S26PacketMapChunkBulk.func_149258_c()) { + ChunkCoordIntPair var9 = (ChunkCoordIntPair)var7.next(); + + if (var9 != null) { + if (this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4)) { + var5 = this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos); + + if (var5.func_150802_k()) { + var6.add(var5); + var8.addAll(((WorldServer)this.worldObj).func_147486_a(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16)); + var7.remove(); + } + } + } else { + var7.remove(); + } + } + + if (!var6.isEmpty()) { + this.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(var6)); + Iterator var10 = var8.iterator(); + + while (var10.hasNext()) { + TileEntity var11 = (TileEntity)var10.next(); + this.func_147097_b(var11); + } + + var10 = var6.iterator(); + + while (var10.hasNext()) { + var5 = (Chunk)var10.next(); + this.getServerForPlayer().getEntityTracker().func_85172_a(this, var5); + } + } + } + } + + public void onUpdateEntity() { + try { + super.onUpdate(); + + for (int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1) { + ItemStack var6 = this.inventory.getStackInSlot(var1); + + if (var6 != null && var6.getItem().isMap()) { + Packet var8 = ((ItemMapBase)var6.getItem()).func_150911_c(var6, this.worldObj, this); + + if (var8 != null) { + this.playerNetServerHandler.sendPacket(var8); + } + } + } + + if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) { + this.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); + this.lastHealth = this.getHealth(); + this.lastFoodLevel = this.foodStats.getFoodLevel(); + this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; + } + + if (this.getHealth() + this.getAbsorptionAmount() != this.field_130068_bO) { + this.field_130068_bO = this.getHealth() + this.getAbsorptionAmount(); + Collection var5 = this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.health); + Iterator var7 = var5.iterator(); + + while (var7.hasNext()) { + ScoreObjective var9 = (ScoreObjective)var7.next(); + this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), var9).func_96651_a(Arrays.asList(this)); + } + } + + if (this.experienceTotal != this.lastExperience) { + this.lastExperience = this.experienceTotal; + this.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(this.experience, this.experienceTotal, this.experienceLevel)); + } + + if (this.ticksExisted % 20 * 5 == 0 && !this.func_147099_x().hasAchievementUnlocked(AchievementList.field_150961_L)) { + this.func_147098_j(); + } + } catch (Throwable var4) { + CrashReport var2 = CrashReport.makeCrashReport(var4, "Ticking player"); + CrashReportCategory var3 = var2.makeCategory("Player being ticked"); + this.addEntityCrashInfo(var3); + throw new ReportedException(var2); + } + } + + protected void func_147098_j() { + BiomeGenBase var1 = this.worldObj.getBiomeGenForCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + + if (var1 != null) { + String var2 = var1.biomeName; + JsonSerializableSet var3 = (JsonSerializableSet)this.func_147099_x().func_150870_b(AchievementList.field_150961_L); + + if (var3 == null) { + var3 = (JsonSerializableSet)this.func_147099_x().func_150872_a(AchievementList.field_150961_L, new JsonSerializableSet()); + } + + var3.add(var2); + + if (this.func_147099_x().canUnlockAchievement(AchievementList.field_150961_L) && var3.size() == BiomeGenBase.field_150597_n.size()) { + HashSet var4 = Sets.newHashSet(BiomeGenBase.field_150597_n); + Iterator var5 = var3.iterator(); + + while (var5.hasNext()) { + String var6 = (String)var5.next(); + Iterator var7 = var4.iterator(); + + while (var7.hasNext()) { + BiomeGenBase var8 = (BiomeGenBase)var7.next(); + + if (var8.biomeName.equals(var6)) { + var7.remove(); + } + } + + if (var4.isEmpty()) { + break; + } + } + + if (var4.isEmpty()) { + this.triggerAchievement(AchievementList.field_150961_L); + } + } + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) { + this.mcServer.getConfigurationManager().func_148539_a(this.func_110142_aN().func_151521_b()); + + if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + this.inventory.dropAllItems(); + } + + Collection var2 = this.worldObj.getScoreboard().func_96520_a(IScoreObjectiveCriteria.deathCount); + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + ScoreObjective var4 = (ScoreObjective)var3.next(); + Score var5 = this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), var4); + var5.func_96648_a(); + } + + EntityLivingBase var6 = this.func_94060_bK(); + + if (var6 != null) { + int var7 = EntityList.getEntityID(var6); + EntityList.EntityEggInfo var8 = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(var7)); + + if (var8 != null) { + this.addStat(var8.field_151513_e, 1); + } + + var6.addToPlayerScore(this, this.scoreValue); + } + + this.addStat(StatList.deathsStat, 1); + this.func_110142_aN().func_94549_h(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(p_70097_1_.damageType); + + if (!var3 && this.field_147101_bU > 0 && p_70097_1_ != DamageSource.outOfWorld) { + return false; + } else { + if (p_70097_1_ instanceof EntityDamageSource) { + Entity var4 = p_70097_1_.getEntity(); + + if (var4 instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var4)) { + return false; + } + + if (var4 instanceof EntityArrow) { + EntityArrow var5 = (EntityArrow)var4; + + if (var5.shootingEntity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var5.shootingEntity)) { + return false; + } + } + } + + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + } + + public boolean canAttackPlayer(EntityPlayer p_96122_1_) { + return this.mcServer.isPVPEnabled() && super.canAttackPlayer(p_96122_1_); + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int p_71027_1_) { + if (this.dimension == 1 && p_71027_1_ == 1) { + this.triggerAchievement(AchievementList.theEnd2); + this.worldObj.removeEntity(this); + this.playerConqueredTheEnd = true; + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(4, 0.0F)); + } else { + if (this.dimension == 0 && p_71027_1_ == 1) { + this.triggerAchievement(AchievementList.theEnd); + ChunkCoordinates var2 = this.mcServer.worldServerForDimension(p_71027_1_).getEntrancePortalLocation(); + + if (var2 != null) { + this.playerNetServerHandler.setPlayerLocation(var2.posX, var2.posY, var2.posZ, 0.0F, 0.0F); + } + + p_71027_1_ = 1; + } else { + this.triggerAchievement(AchievementList.portal); + } + + this.mcServer.getConfigurationManager().transferPlayerToDimension(this, p_71027_1_); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + } + } + + private void func_147097_b(TileEntity p_147097_1_) { + if (p_147097_1_ != null) { + Packet var2 = p_147097_1_.getDescriptionPacket(); + + if (var2 != null) { + this.playerNetServerHandler.sendPacket(var2); + } + } + } + + /** + * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) { + super.onItemPickup(p_71001_1_, p_71001_2_); + this.openContainer.detectAndSendChanges(); + } + + /** + * puts player to sleep on specified bed if possible + */ + public EntityPlayer.EnumStatus sleepInBedAt(int p_71018_1_, int p_71018_2_, int p_71018_3_) { + EntityPlayer.EnumStatus var4 = super.sleepInBedAt(p_71018_1_, p_71018_2_, p_71018_3_); + + if (var4 == EntityPlayer.EnumStatus.OK) { + S0APacketUseBed var5 = new S0APacketUseBed(this, p_71018_1_, p_71018_2_, p_71018_3_); + this.getServerForPlayer().getEntityTracker().func_151247_a(this, var5); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.playerNetServerHandler.sendPacket(var5); + } + + return var4; + } + + /** + * Wake up the player if they're sleeping. + */ + public void wakeUpPlayer(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) { + if (this.isPlayerSleeping()) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 2)); + } + + super.wakeUpPlayer(p_70999_1_, p_70999_2_, p_70999_3_); + + if (this.playerNetServerHandler != null) { + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity p_70078_1_) { + super.mountEntity(p_70078_1_); + this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity)); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {} + + /** + * process player falling based on movement packet + */ + public void handleFalling(double p_71122_1_, boolean p_71122_3_) { + super.updateFallState(p_71122_1_, p_71122_3_); + } + + public void func_146100_a(TileEntity p_146100_1_) { + if (p_146100_1_ instanceof TileEntitySign) { + ((TileEntitySign)p_146100_1_).func_145912_a(this); + this.playerNetServerHandler.sendPacket(new S36PacketSignEditorOpen(p_146100_1_.field_145851_c, p_146100_1_.field_145848_d, p_146100_1_.field_145849_e)); + } + } + + /** + * get the next window id to use + */ + private void getNextWindowId() { + this.currentWindowId = this.currentWindowId % 100 + 1; + } + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int p_71058_1_, int p_71058_2_, int p_71058_3_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); + this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, p_71058_1_, p_71058_2_, p_71058_3_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIEnchantment(int p_71002_1_, int p_71002_2_, int p_71002_3_, String p_71002_4_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 4, p_71002_4_ == null ? "" : p_71002_4_, 9, p_71002_4_ != null)); + this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, p_71002_1_, p_71002_2_, p_71002_3_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); + this.openContainer = new ContainerRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_, this); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ + public void displayGUIChest(IInventory p_71007_1_) { + if (this.openContainer != this.inventoryContainer) { + this.closeScreen(); + } + + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 0, p_71007_1_.getInventoryName(), p_71007_1_.getSizeInventory(), p_71007_1_.isInventoryNameLocalized())); + this.openContainer = new ContainerChest(this.inventory, p_71007_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146093_a(TileEntityHopper p_146093_1_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 9, p_146093_1_.getInventoryName(), p_146093_1_.getSizeInventory(), p_146093_1_.isInventoryNameLocalized())); + this.openContainer = new ContainerHopper(this.inventory, p_146093_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 9, p_96125_1_.getInventoryName(), p_96125_1_.getSizeInventory(), p_96125_1_.isInventoryNameLocalized())); + this.openContainer = new ContainerHopper(this.inventory, p_96125_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146101_a(TileEntityFurnace p_146101_1_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 2, p_146101_1_.getInventoryName(), p_146101_1_.getSizeInventory(), p_146101_1_.isInventoryNameLocalized())); + this.openContainer = new ContainerFurnace(this.inventory, p_146101_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146102_a(TileEntityDispenser p_146102_1_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, p_146102_1_ instanceof TileEntityDropper ? 10 : 3, p_146102_1_.getInventoryName(), p_146102_1_.getSizeInventory(), p_146102_1_.isInventoryNameLocalized())); + this.openContainer = new ContainerDispenser(this.inventory, p_146102_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146098_a(TileEntityBrewingStand p_146098_1_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 5, p_146098_1_.getInventoryName(), p_146098_1_.getSizeInventory(), p_146098_1_.isInventoryNameLocalized())); + this.openContainer = new ContainerBrewingStand(this.inventory, p_146098_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146104_a(TileEntityBeacon p_146104_1_) { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 7, p_146104_1_.getInventoryName(), p_146104_1_.getSizeInventory(), p_146104_1_.isInventoryNameLocalized())); + this.openContainer = new ContainerBeacon(this.inventory, p_146104_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIMerchant(IMerchant p_71030_1_, String p_71030_2_) { + this.getNextWindowId(); + this.openContainer = new ContainerMerchant(this.inventory, p_71030_1_, this.worldObj); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 6, p_71030_2_ == null ? "" : p_71030_2_, var3.getSizeInventory(), p_71030_2_ != null)); + MerchantRecipeList var4 = p_71030_1_.getRecipes(this); + + if (var4 != null) { + PacketBuffer var5 = new PacketBuffer(Unpooled.buffer()); + + try { + var5.writeInt(this.currentWindowId); + var4.func_151391_a(var5); + this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|TrList", var5)); + } catch (IOException var10) { + logger.error("Couldn't send trade list", var10); + } finally { + var5.release(); + } + } + } + + public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) { + if (this.openContainer != this.inventoryContainer) { + this.closeScreen(); + } + + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 11, p_110298_2_.getInventoryName(), p_110298_2_.getSizeInventory(), p_110298_2_.isInventoryNameLocalized(), p_110298_1_.getEntityId())); + this.openContainer = new ContainerHorseInventory(this.inventory, p_110298_2_, p_110298_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + /** + * Sends the contents of an inventory slot to the com.cheatbreaker.client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) { + if (!(p_71111_1_.getSlot(p_71111_2_) instanceof SlotCrafting)) { + if (!this.isChangingQuantityOnly) { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(p_71111_1_.windowId, p_71111_2_, p_71111_3_)); + } + } + } + + public void sendContainerToPlayer(Container p_71120_1_) { + this.sendContainerAndContentsToPlayer(p_71120_1_, p_71120_1_.getInventory()); + } + + public void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_) { + this.playerNetServerHandler.sendPacket(new S30PacketWindowItems(p_71110_1_.windowId, p_71110_2_)); + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + + /** + * Sends two ints to the com.cheatbreaker.client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_) { + this.playerNetServerHandler.sendPacket(new S31PacketWindowProperty(p_71112_1_.windowId, p_71112_2_, p_71112_3_)); + } + + /** + * set current crafting inventory back to the 2x2 square + */ + public void closeScreen() { + this.playerNetServerHandler.sendPacket(new S2EPacketCloseWindow(this.openContainer.windowId)); + this.closeContainer(); + } + + /** + * updates item held by mouse + */ + public void updateHeldItem() { + if (!this.isChangingQuantityOnly) { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + } + + /** + * Closes the container the player currently has open. + */ + public void closeContainer() { + this.openContainer.onContainerClosed(this); + this.openContainer = this.inventoryContainer; + } + + public void setEntityActionState(float p_110430_1_, float p_110430_2_, boolean p_110430_3_, boolean p_110430_4_) { + if (this.ridingEntity != null) { + if (p_110430_1_ >= -1.0F && p_110430_1_ <= 1.0F) { + this.moveStrafing = p_110430_1_; + } + + if (p_110430_2_ >= -1.0F && p_110430_2_ <= 1.0F) { + this.moveForward = p_110430_2_; + } + + this.isJumping = p_110430_3_; + this.setSneaking(p_110430_4_); + } + } + + /** + * Adds a value to a statistic field. + */ + public void addStat(StatBase p_71064_1_, int p_71064_2_) { + if (p_71064_1_ != null) { + this.field_147103_bO.func_150871_b(this, p_71064_1_, p_71064_2_); + Iterator var3 = this.getWorldScoreboard().func_96520_a(p_71064_1_.func_150952_k()).iterator(); + + while (var3.hasNext()) { + ScoreObjective var4 = (ScoreObjective)var3.next(); + this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), var4).func_96648_a(); + } + + if (this.field_147103_bO.func_150879_e()) { + this.field_147103_bO.func_150876_a(this); + } + } + } + + public void mountEntityAndWakeUp() { + if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + + if (this.sleeping) { + this.wakeUpPlayer(true, false, false); + } + } + + /** + * this function is called when a players inventory is sent to him, lastHealth is updated on any dimension + * transitions, then reset. + */ + public void setPlayerHealthUpdated() { + this.lastHealth = -1.0E8F; + } + + public void addChatComponentMessage(IChatComponent p_146105_1_) { + this.playerNetServerHandler.sendPacket(new S02PacketChat(p_146105_1_)); + } + + /** + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() { + this.playerNetServerHandler.sendPacket(new S19PacketEntityStatus(this, (byte)9)); + super.onItemUseFinish(); + } + + /** + * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration + */ + public void setItemInUse(ItemStack p_71008_1_, int p_71008_2_) { + super.setItemInUse(p_71008_1_, p_71008_2_); + + if (p_71008_1_ != null && p_71008_1_.getItem() != null && p_71008_1_.getItem().getItemUseAction(p_71008_1_) == EnumAction.eat) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 3)); + } + } + + /** + * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest + * Inventory. + */ + public void clonePlayer(EntityPlayer p_71049_1_, boolean p_71049_2_) { + super.clonePlayer(p_71049_1_, p_71049_2_); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + this.destroyedItemsNetCache.addAll(((EntityPlayerMP)p_71049_1_).destroyedItemsNetCache); + } + + protected void onNewPotionEffect(PotionEffect p_70670_1_) { + super.onNewPotionEffect(p_70670_1_); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), p_70670_1_)); + } + + protected void onChangedPotionEffect(PotionEffect p_70695_1_, boolean p_70695_2_) { + super.onChangedPotionEffect(p_70695_1_, p_70695_2_); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), p_70695_1_)); + } + + protected void onFinishedPotionEffect(PotionEffect p_70688_1_) { + super.onFinishedPotionEffect(p_70688_1_); + this.playerNetServerHandler.sendPacket(new S1EPacketRemoveEntityEffect(this.getEntityId(), p_70688_1_)); + } + + /** + * Sets the position of the entity and updates the 'last' variables + */ + public void setPositionAndUpdate(double p_70634_1_, double p_70634_3_, double p_70634_5_) { + this.playerNetServerHandler.setPlayerLocation(p_70634_1_, p_70634_3_, p_70634_5_, this.rotationYaw, this.rotationPitch); + } + + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity p_71009_1_) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(p_71009_1_, 4)); + } + + public void onEnchantmentCritical(Entity p_71047_1_) { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(p_71047_1_, 5)); + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() { + if (this.playerNetServerHandler != null) { + this.playerNetServerHandler.sendPacket(new S39PacketPlayerAbilities(this.capabilities)); + } + } + + public WorldServer getServerForPlayer() { + return (WorldServer)this.worldObj; + } + + /** + * Sets the player's game mode and sends it to them. + */ + public void setGameType(WorldSettings.GameType p_71033_1_) { + this.theItemInWorldManager.setGameType(p_71033_1_); + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(3, (float)p_71033_1_.getID())); + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent p_145747_1_) { + this.playerNetServerHandler.sendPacket(new S02PacketChat(p_145747_1_)); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_) { + if ("seed".equals(p_70003_2_) && !this.mcServer.isDedicatedServer()) { + return true; + } else if (!"tell".equals(p_70003_2_) && !"help".equals(p_70003_2_) && !"me".equals(p_70003_2_)) { + if (this.mcServer.getConfigurationManager().func_152596_g(this.getGameProfile())) { + UserListOpsEntry var3 = (UserListOpsEntry)this.mcServer.getConfigurationManager().func_152603_m().func_152683_b(this.getGameProfile()); + return var3 != null ? var3.func_152644_a() >= p_70003_1_ : this.mcServer.func_110455_j() >= p_70003_1_; + } else { + return false; + } + } else { + return true; + } + } + + /** + * Gets the player's IP address. Used in /banip. + */ + public String getPlayerIP() { + String var1 = this.playerNetServerHandler.netManager.getSocketAddress().toString(); + var1 = var1.substring(var1.indexOf("/") + 1); + var1 = var1.substring(0, var1.indexOf(":")); + return var1; + } + + public void func_147100_a(C15PacketClientSettings p_147100_1_) { + this.translator = p_147100_1_.func_149524_c(); + int var2 = 256 >> p_147100_1_.func_149521_d(); + + if (var2 > 3 && var2 < 20) { + } + + this.chatVisibility = p_147100_1_.func_149523_e(); + this.chatColours = p_147100_1_.func_149520_f(); + + if (this.mcServer.isSinglePlayer() && this.mcServer.getServerOwner().equals(this.getCommandSenderName())) { + this.mcServer.func_147139_a(p_147100_1_.func_149518_g()); + } + + this.setHideCape(1, !p_147100_1_.func_149519_h()); + } + + public EntityPlayer.EnumChatVisibility func_147096_v() { + return this.chatVisibility; + } + + public void func_147095_a(String p_147095_1_) { + this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|RPack", p_147095_1_.getBytes(Charsets.UTF_8))); + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ)); + } + + public void func_143004_u() { + this.field_143005_bX = MinecraftServer.getSystemTimeMillis(); + } + + public StatisticsFile func_147099_x() { + return this.field_147103_bO; + } + + public void func_152339_d(Entity p_152339_1_) { + if (p_152339_1_ instanceof EntityPlayer) { + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(p_152339_1_.getEntityId())); + } else { + this.destroyedItemsNetCache.add(Integer.valueOf(p_152339_1_.getEntityId())); + } + } + + public long func_154331_x() { + return this.field_143005_bX; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/InventoryPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/InventoryPlayer.java new file mode 100644 index 0000000..4dd6b70 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/InventoryPlayer.java @@ -0,0 +1,674 @@ +package net.minecraft.entity.player; + +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ReportedException; + +public class InventoryPlayer implements IInventory { + /** + * An array of 36 item stacks indicating the main player inventory (including the visible bar). + */ + public ItemStack[] mainInventory = new ItemStack[36]; + + /** An array of 4 item stacks containing the currently worn armor pieces. */ + public ItemStack[] armorInventory = new ItemStack[4]; + + /** The index of the currently held item (0-8). */ + public int currentItem; + + /** The current ItemStack. */ + private ItemStack currentItemStack; + + /** The player whose inventory this is. */ + public EntityPlayer player; + private ItemStack itemStack; + + /** + * Set true whenever the inventory changes. Nothing sets it false so you will have to write your own code to check + * it and reset the value. + */ + public boolean inventoryChanged; + + + public InventoryPlayer(EntityPlayer p_i1750_1_) { + this.player = p_i1750_1_; + } + + /** + * Returns the item stack currently held by the player. + */ + public ItemStack getCurrentItem() { + return this.currentItem < 9 && this.currentItem >= 0 ? this.mainInventory[this.currentItem] : null; + } + + /** + * Get the size of the player hotbar inventory + */ + public static int getHotbarSize() { + return 9; + } + + private int func_146029_c(Item p_146029_1_) { + for (int var2 = 0; var2 < this.mainInventory.length; ++var2) { + if (this.mainInventory[var2] != null && this.mainInventory[var2].getItem() == p_146029_1_) { + return var2; + } + } + + return -1; + } + + private int func_146024_c(Item p_146024_1_, int p_146024_2_) { + for (int var3 = 0; var3 < this.mainInventory.length; ++var3) { + if (this.mainInventory[var3] != null && this.mainInventory[var3].getItem() == p_146024_1_ && this.mainInventory[var3].getItemDamage() == p_146024_2_) { + return var3; + } + } + + return -1; + } + + /** + * stores an itemstack in the users inventory + */ + private int storeItemStack(ItemStack p_70432_1_) { + for (int var2 = 0; var2 < this.mainInventory.length; ++var2) { + if (this.mainInventory[var2] != null && this.mainInventory[var2].getItem() == p_70432_1_.getItem() && this.mainInventory[var2].isStackable() && this.mainInventory[var2].stackSize < this.mainInventory[var2].getMaxStackSize() && this.mainInventory[var2].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[var2].getHasSubtypes() || this.mainInventory[var2].getItemDamage() == p_70432_1_.getItemDamage()) && ItemStack.areItemStackTagsEqual(this.mainInventory[var2], p_70432_1_)) { + return var2; + } + } + + return -1; + } + + /** + * Returns the first item stack that is empty. + */ + public int getFirstEmptyStack() { + for (int var1 = 0; var1 < this.mainInventory.length; ++var1) { + if (this.mainInventory[var1] == null) { + return var1; + } + } + + return -1; + } + + public void func_146030_a(Item p_146030_1_, int p_146030_2_, boolean p_146030_3_, boolean p_146030_4_) { + boolean var5 = true; + this.currentItemStack = this.getCurrentItem(); + int var7; + + if (p_146030_3_) { + var7 = this.func_146024_c(p_146030_1_, p_146030_2_); + } else { + var7 = this.func_146029_c(p_146030_1_); + } + + if (var7 >= 0 && var7 < 9) { + this.currentItem = var7; + } else { + if (p_146030_4_ && p_146030_1_ != null) { + int var6 = this.getFirstEmptyStack(); + + if (var6 >= 0 && var6 < 9) { + this.currentItem = var6; + } + + this.func_70439_a(p_146030_1_, p_146030_2_); + } + } + } + + /** + * Switch the current item to the next one or the previous one + */ + public void changeCurrentItem(int p_70453_1_) { + if (p_70453_1_ > 0) { + p_70453_1_ = 1; + } + + if (p_70453_1_ < 0) { + p_70453_1_ = -1; + } + + for (this.currentItem -= p_70453_1_; this.currentItem < 0; this.currentItem += 9) { + } + + while (this.currentItem >= 9) { + this.currentItem -= 9; + } + } + + /** + * Removes all items from player inventory, including armor + */ + public int clearInventory(Item p_146027_1_, int p_146027_2_) { + int var3 = 0; + int var4; + ItemStack var5; + + for (var4 = 0; var4 < this.mainInventory.length; ++var4) { + var5 = this.mainInventory[var4]; + + if (var5 != null && (p_146027_1_ == null || var5.getItem() == p_146027_1_) && (p_146027_2_ <= -1 || var5.getItemDamage() == p_146027_2_)) { + var3 += var5.stackSize; + this.mainInventory[var4] = null; + } + } + + for (var4 = 0; var4 < this.armorInventory.length; ++var4) { + var5 = this.armorInventory[var4]; + + if (var5 != null && (p_146027_1_ == null || var5.getItem() == p_146027_1_) && (p_146027_2_ <= -1 || var5.getItemDamage() == p_146027_2_)) { + var3 += var5.stackSize; + this.armorInventory[var4] = null; + } + } + + if (this.itemStack != null) { + if (p_146027_1_ != null && this.itemStack.getItem() != p_146027_1_) { + return var3; + } + + if (p_146027_2_ > -1 && this.itemStack.getItemDamage() != p_146027_2_) { + return var3; + } + + var3 += this.itemStack.stackSize; + this.setItemStack(null); + } + + return var3; + } + + public void func_70439_a(Item p_70439_1_, int p_70439_2_) { + if (p_70439_1_ != null) { + if (this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.func_146024_c(this.currentItemStack.getItem(), this.currentItemStack.getItemDamageForDisplay()) == this.currentItem) { + return; + } + + int var3 = this.func_146024_c(p_70439_1_, p_70439_2_); + + if (var3 >= 0) { + int var4 = this.mainInventory[var3].stackSize; + this.mainInventory[var3] = this.mainInventory[this.currentItem]; + this.mainInventory[this.currentItem] = new ItemStack(p_70439_1_, var4, p_70439_2_); + } else { + this.mainInventory[this.currentItem] = new ItemStack(p_70439_1_, 1, p_70439_2_); + } + } + } + + /** + * This function stores as many items of an ItemStack as possible in a matching slot and returns the quantity of + * left over items. + */ + private int storePartialItemStack(ItemStack p_70452_1_) { + Item var2 = p_70452_1_.getItem(); + int var3 = p_70452_1_.stackSize; + int var4; + + if (p_70452_1_.getMaxStackSize() == 1) { + var4 = this.getFirstEmptyStack(); + + if (var4 < 0) { + return var3; + } else { + if (this.mainInventory[var4] == null) { + this.mainInventory[var4] = ItemStack.copyItemStack(p_70452_1_); + } + + return 0; + } + } else { + var4 = this.storeItemStack(p_70452_1_); + + if (var4 < 0) { + var4 = this.getFirstEmptyStack(); + } + + if (var4 < 0) { + return var3; + } else { + if (this.mainInventory[var4] == null) { + this.mainInventory[var4] = new ItemStack(var2, 0, p_70452_1_.getItemDamage()); + + if (p_70452_1_.hasTagCompound()) { + this.mainInventory[var4].setTagCompound((NBTTagCompound)p_70452_1_.getTagCompound().copy()); + } + } + + int var5 = var3; + + if (var3 > this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize) { + var5 = this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize; + } + + if (var5 > this.getInventoryStackLimit() - this.mainInventory[var4].stackSize) { + var5 = this.getInventoryStackLimit() - this.mainInventory[var4].stackSize; + } + + if (var5 == 0) { + return var3; + } else { + var3 -= var5; + this.mainInventory[var4].stackSize += var5; + this.mainInventory[var4].animationsToGo = 5; + return var3; + } + } + } + } + + /** + * Decrement the number of animations remaining. Only called on com.cheatbreaker.client side. This is used to handle the animation of + * receiving a block. + */ + public void decrementAnimations() { + for (int var1 = 0; var1 < this.mainInventory.length; ++var1) { + if (this.mainInventory[var1] != null) { + this.mainInventory[var1].updateAnimation(this.player.worldObj, this.player, var1, this.currentItem == var1); + } + } + } + + public boolean consumeInventoryItem(Item p_146026_1_) { + int var2 = this.func_146029_c(p_146026_1_); + + if (var2 < 0) { + return false; + } else { + if (--this.mainInventory[var2].stackSize <= 0) { + this.mainInventory[var2] = null; + } + + return true; + } + } + + public boolean hasItem(Item p_146028_1_) { + int var2 = this.func_146029_c(p_146028_1_); + return var2 >= 0; + } + + /** + * Adds the item stack to the inventory, returns false if it is impossible. + */ + public boolean addItemStackToInventory(final ItemStack p_70441_1_) { + if (p_70441_1_ != null && p_70441_1_.stackSize != 0 && p_70441_1_.getItem() != null) { + try { + int var2; + + if (p_70441_1_.isItemDamaged()) { + var2 = this.getFirstEmptyStack(); + + if (var2 >= 0) { + this.mainInventory[var2] = ItemStack.copyItemStack(p_70441_1_); + this.mainInventory[var2].animationsToGo = 5; + p_70441_1_.stackSize = 0; + return true; + } else if (this.player.capabilities.isCreativeMode) { + p_70441_1_.stackSize = 0; + return true; + } else { + return false; + } + } else { + do { + var2 = p_70441_1_.stackSize; + p_70441_1_.stackSize = this.storePartialItemStack(p_70441_1_); + } + while (p_70441_1_.stackSize > 0 && p_70441_1_.stackSize < var2); + + if (p_70441_1_.stackSize == var2 && this.player.capabilities.isCreativeMode) { + p_70441_1_.stackSize = 0; + return true; + } else { + return p_70441_1_.stackSize < var2; + } + } + } catch (Throwable var5) { + CrashReport var3 = CrashReport.makeCrashReport(var5, "Adding item to inventory"); + CrashReportCategory var4 = var3.makeCategory("Item being added"); + var4.addCrashSection("Item ID", Integer.valueOf(Item.getIdFromItem(p_70441_1_.getItem()))); + var4.addCrashSection("Item data", Integer.valueOf(p_70441_1_.getItemDamage())); + var4.addCrashSectionCallable("Item name", new Callable() { + + public String call() { + return p_70441_1_.getDisplayName(); + } + }); + throw new ReportedException(var3); + } + } else { + return false; + } + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + ItemStack[] var3 = this.mainInventory; + + if (p_70298_1_ >= this.mainInventory.length) { + var3 = this.armorInventory; + p_70298_1_ -= this.mainInventory.length; + } + + if (var3[p_70298_1_] != null) { + ItemStack var4; + + if (var3[p_70298_1_].stackSize <= p_70298_2_) { + var4 = var3[p_70298_1_]; + var3[p_70298_1_] = null; + return var4; + } else { + var4 = var3[p_70298_1_].splitStack(p_70298_2_); + + if (var3[p_70298_1_].stackSize == 0) { + var3[p_70298_1_] = null; + } + + return var4; + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + ItemStack[] var2 = this.mainInventory; + + if (p_70304_1_ >= this.mainInventory.length) { + var2 = this.armorInventory; + p_70304_1_ -= this.mainInventory.length; + } + + if (var2[p_70304_1_] != null) { + ItemStack var3 = var2[p_70304_1_]; + var2[p_70304_1_] = null; + return var3; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + ItemStack[] var3 = this.mainInventory; + + if (p_70299_1_ >= var3.length) { + p_70299_1_ -= var3.length; + var3 = this.armorInventory; + } + + var3[p_70299_1_] = p_70299_2_; + } + + public float func_146023_a(Block p_146023_1_) { + float var2 = 1.0F; + + if (this.mainInventory[this.currentItem] != null) { + var2 *= this.mainInventory[this.currentItem].func_150997_a(p_146023_1_); + } + + return var2; + } + + /** + * Writes the inventory out as a list of compound tags. This is where the slot indices are used (+100 for armor, +80 + * for crafting). + */ + public NBTTagList writeToNBT(NBTTagList p_70442_1_) { + int var2; + NBTTagCompound var3; + + for (var2 = 0; var2 < this.mainInventory.length; ++var2) { + if (this.mainInventory[var2] != null) { + var3 = new NBTTagCompound(); + var3.setByte("Slot", (byte)var2); + this.mainInventory[var2].writeToNBT(var3); + p_70442_1_.appendTag(var3); + } + } + + for (var2 = 0; var2 < this.armorInventory.length; ++var2) { + if (this.armorInventory[var2] != null) { + var3 = new NBTTagCompound(); + var3.setByte("Slot", (byte)(var2 + 100)); + this.armorInventory[var2].writeToNBT(var3); + p_70442_1_.appendTag(var3); + } + } + + return p_70442_1_; + } + + /** + * Reads from the given tag list and fills the slots in the inventory with the correct items. + */ + public void readFromNBT(NBTTagList p_70443_1_) { + this.mainInventory = new ItemStack[36]; + this.armorInventory = new ItemStack[4]; + + for (int var2 = 0; var2 < p_70443_1_.tagCount(); ++var2) { + NBTTagCompound var3 = p_70443_1_.getCompoundTagAt(var2); + int var4 = var3.getByte("Slot") & 255; + ItemStack var5 = ItemStack.loadItemStackFromNBT(var3); + + if (var5 != null) { + if (var4 >= 0 && var4 < this.mainInventory.length) { + this.mainInventory[var4] = var5; + } + + if (var4 >= 100 && var4 < this.armorInventory.length + 100) { + this.armorInventory[var4 - 100] = var5; + } + } + } + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.mainInventory.length + 4; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + ItemStack[] var2 = this.mainInventory; + + if (p_70301_1_ >= var2.length) { + p_70301_1_ -= var2.length; + var2 = this.armorInventory; + } + + return var2[p_70301_1_]; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return "container.inventory"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return false; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + public boolean func_146025_b(Block p_146025_1_) { + if (p_146025_1_.getMaterial().isToolNotRequired()) { + return true; + } else { + ItemStack var2 = this.getStackInSlot(this.currentItem); + return var2 != null && var2.func_150998_b(p_146025_1_); + } + } + + /** + * returns a player armor item (as itemstack) contained in specified armor slot. + */ + public ItemStack armorItemInSlot(int p_70440_1_) { + return this.armorInventory[p_70440_1_]; + } + + /** + * Based on the damage values and maximum damage values of each armor item, returns the current armor value. + */ + public int getTotalArmorValue() { + int var1 = 0; + + for (int var2 = 0; var2 < this.armorInventory.length; ++var2) { + if (this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { + int var3 = ((ItemArmor)this.armorInventory[var2].getItem()).damageReduceAmount; + var1 += var3; + } + } + + return var1; + } + + /** + * Damages armor in each slot by the specified amount. + */ + public void damageArmor(float p_70449_1_) { + p_70449_1_ /= 4.0F; + + if (p_70449_1_ < 1.0F) { + p_70449_1_ = 1.0F; + } + + for (int var2 = 0; var2 < this.armorInventory.length; ++var2) { + if (this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { + this.armorInventory[var2].damageItem((int)p_70449_1_, this.player); + + if (this.armorInventory[var2].stackSize == 0) { + this.armorInventory[var2] = null; + } + } + } + } + + /** + * Drop all armor and main inventory items. + */ + public void dropAllItems() { + int var1; + + for (var1 = 0; var1 < this.mainInventory.length; ++var1) { + if (this.mainInventory[var1] != null) { + this.player.func_146097_a(this.mainInventory[var1], true, false); + this.mainInventory[var1] = null; + } + } + + for (var1 = 0; var1 < this.armorInventory.length; ++var1) { + if (this.armorInventory[var1] != null) { + this.player.func_146097_a(this.armorInventory[var1], true, false); + this.armorInventory[var1] = null; + } + } + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() { + this.inventoryChanged = true; + } + + public void setItemStack(ItemStack p_70437_1_) { + this.itemStack = p_70437_1_; + } + + public ItemStack getItemStack() { + return this.itemStack; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return !this.player.isDead && p_70300_1_.getDistanceSqToEntity(this.player) <= 64.0D; + } + + /** + * Returns true if the specified ItemStack exists in the inventory. + */ + public boolean hasItemStack(ItemStack p_70431_1_) { + int var2; + + for (var2 = 0; var2 < this.armorInventory.length; ++var2) { + if (this.armorInventory[var2] != null && this.armorInventory[var2].isItemEqual(p_70431_1_)) { + return true; + } + } + + for (var2 = 0; var2 < this.mainInventory.length; ++var2) { + if (this.mainInventory[var2] != null && this.mainInventory[var2].isItemEqual(p_70431_1_)) { + return true; + } + } + + return false; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } + + /** + * Copy the ItemStack contents from another InventoryPlayer instance + */ + public void copyInventory(InventoryPlayer p_70455_1_) { + int var2; + + for (var2 = 0; var2 < this.mainInventory.length; ++var2) { + this.mainInventory[var2] = ItemStack.copyItemStack(p_70455_1_.mainInventory[var2]); + } + + for (var2 = 0; var2 < this.armorInventory.length; ++var2) { + this.armorInventory[var2] = ItemStack.copyItemStack(p_70455_1_.armorInventory[var2]); + } + + this.currentItem = p_70455_1_.currentItem; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java new file mode 100644 index 0000000..e594e8a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/player/PlayerCapabilities.java @@ -0,0 +1,72 @@ +package net.minecraft.entity.player; + +import net.minecraft.nbt.NBTTagCompound; + +public class PlayerCapabilities { + /** Disables player damage. */ + public boolean disableDamage; + + /** Sets/indicates whether the player is flying. */ + public boolean isFlying; + + /** whether or not to allow the player to fly when they double jump. */ + public boolean allowFlying; + + /** + * Used to determine if creative mode is enabled, and therefore if items should be depleted on usage + */ + public boolean isCreativeMode; + + /** Indicates whether the player is allowed to modify the surroundings */ + public boolean allowEdit = true; + private float flySpeed = 0.05F; + private float walkSpeed = 0.1F; + + + public void writeCapabilitiesToNBT(NBTTagCompound p_75091_1_) { + NBTTagCompound var2 = new NBTTagCompound(); + var2.setBoolean("invulnerable", this.disableDamage); + var2.setBoolean("flying", this.isFlying); + var2.setBoolean("mayfly", this.allowFlying); + var2.setBoolean("instabuild", this.isCreativeMode); + var2.setBoolean("mayBuild", this.allowEdit); + var2.setFloat("flySpeed", this.flySpeed); + var2.setFloat("walkSpeed", this.walkSpeed); + p_75091_1_.setTag("abilities", var2); + } + + public void readCapabilitiesFromNBT(NBTTagCompound p_75095_1_) { + if (p_75095_1_.func_150297_b("abilities", 10)) { + NBTTagCompound var2 = p_75095_1_.getCompoundTag("abilities"); + this.disableDamage = var2.getBoolean("invulnerable"); + this.isFlying = var2.getBoolean("flying"); + this.allowFlying = var2.getBoolean("mayfly"); + this.isCreativeMode = var2.getBoolean("instabuild"); + + if (var2.func_150297_b("flySpeed", 99)) { + this.flySpeed = var2.getFloat("flySpeed"); + this.walkSpeed = var2.getFloat("walkSpeed"); + } + + if (var2.func_150297_b("mayBuild", 1)) { + this.allowEdit = var2.getBoolean("mayBuild"); + } + } + } + + public float getFlySpeed() { + return this.flySpeed; + } + + public void setFlySpeed(float p_75092_1_) { + this.flySpeed = p_75092_1_; + } + + public float getWalkSpeed() { + return this.walkSpeed; + } + + public void setPlayerWalkSpeed(float p_82877_1_) { + this.walkSpeed = p_82877_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityArrow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityArrow.java new file mode 100644 index 0000000..e72cc40 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityArrow.java @@ -0,0 +1,511 @@ +package net.minecraft.entity.projectile; + +import lombok.Getter; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.util.*; +import net.minecraft.world.World; + +import java.util.List; + +public class EntityArrow extends Entity implements IProjectile { + private int field_145791_d = -1; + private int field_145792_e = -1; + private int field_145789_f = -1; + private Block field_145790_g; + private int inData; + @Getter private boolean inGround; + + /** 1 if the player can pick up the arrow */ + public int canBePickedUp; + + /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake; + + /** The owner of this arrow. */ + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + + /** The amount of knockback an arrow applies when it hits a mob. */ + private int knockbackStrength; + + + public EntityArrow(World p_i1753_1_) { + super(p_i1753_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityArrow(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) { + super(p_i1754_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); + this.yOffset = 0.0F; + } + + public EntityArrow(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) { + super(p_i1755_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1755_2_; + + if (p_i1755_2_ instanceof EntityPlayer) { + this.canBePickedUp = 1; + } + + this.posY = p_i1755_2_.posY + (double)p_i1755_2_.getEyeHeight() - 0.10000000149011612D; + double var6 = p_i1755_3_.posX - p_i1755_2_.posX; + double var8 = p_i1755_3_.boundingBox.minY + (double)(p_i1755_3_.height / 3.0F) - this.posY; + double var10 = p_i1755_3_.posZ - p_i1755_2_.posZ; + double var12 = MathHelper.sqrt_double(var6 * var6 + var10 * var10); + + if (var12 >= 1.0E-7D) { + float var14 = (float)(Math.atan2(var10, var6) * 180.0D / Math.PI) - 90.0F; + float var15 = (float)(-(Math.atan2(var8, var12) * 180.0D / Math.PI)); + double var16 = var6 / var12; + double var18 = var10 / var12; + this.setLocationAndAngles(p_i1755_2_.posX + var16, this.posY, p_i1755_2_.posZ + var18, var14, var15); + this.yOffset = 0.0F; + float var20 = (float)var12 * 0.2F; + this.setThrowableHeading(var6, var8 + (double)var20, var10, p_i1755_4_, p_i1755_5_); + } + } + + public EntityArrow(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) { + super(p_i1756_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1756_2_; + + if (p_i1756_2_ instanceof EntityPlayer) { + this.canBePickedUp = 1; + } + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + (double)p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI); + this.motionY = -MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); + } + + protected void entityInit() { + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) { + float var9 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= var9; + p_70186_3_ /= var9; + p_70186_5_ /= var9; + p_70186_1_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; + p_70186_1_ *= p_70186_7_; + p_70186_3_ *= p_70186_7_; + p_70186_5_ *= p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float var10 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); + this.setRotation(p_70056_7_, p_70056_8_); + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float var7 = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, var7) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, var1) * 180.0D / Math.PI); + } + + Block var16 = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (var16.getMaterial() != Material.air) { + var16.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + AxisAlignedBB var2 = var16.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (var2 != null && var2.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { + this.inGround = true; + } + } + + if (this.arrowShake > 0) { + --this.arrowShake; + } + + if (this.inGround) { + int var18 = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (var16 == this.field_145790_g && var18 == this.inData) { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) { + this.setDead(); + } + } else { + this.inGround = false; + this.motionX *= this.rand.nextFloat() * 0.2F; + this.motionY *= this.rand.nextFloat() * 0.2F; + this.motionZ *= this.rand.nextFloat() * 0.2F; + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } else { + ++this.ticksInAir; + Vec3 var17 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 var3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition var4 = this.worldObj.func_147447_a(var17, var3, false, true, false); + var17 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + var3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var4 != null) { + var3 = Vec3.createVectorHelper(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + } + + Entity var5 = null; + List var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var7 = 0.0D; + int var9; + float var11; + + for (var9 = 0; var9 < var6.size(); ++var9) { + Entity var10 = (Entity)var6.get(var9); + + if (var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) { + var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); + MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); + + if (var13 != null) { + double var14 = var17.distanceTo(var13.hitVec); + + if (var14 < var7 || var7 == 0.0D) { + var5 = var10; + var7 = var14; + } + } + } + } + + if (var5 != null) { + var4 = new MovingObjectPosition(var5); + } + + if (var4 != null && var4.entityHit != null && var4.entityHit instanceof EntityPlayer) { + EntityPlayer var19 = (EntityPlayer)var4.entityHit; + + if (var19.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(var19)) { + var4 = null; + } + } + + float var20; + float var26; + + if (var4 != null) { + if (var4.entityHit != null) { + var20 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int var21 = MathHelper.ceiling_double_int((double)var20 * this.damage); + + if (this.getIsCritical()) { + var21 += this.rand.nextInt(var21 / 2 + 2); + } + + DamageSource var23 = null; + + if (this.shootingEntity == null) { + var23 = DamageSource.causeArrowDamage(this, this); + } else { + var23 = DamageSource.causeArrowDamage(this, this.shootingEntity); + } + + if (this.isBurning() && !(var4.entityHit instanceof EntityEnderman)) { + var4.entityHit.setFire(5); + } + + if (var4.entityHit.attackEntityFrom(var23, (float)var21)) { + if (var4.entityHit instanceof EntityLivingBase) { + EntityLivingBase var24 = (EntityLivingBase)var4.entityHit; + + if (!this.worldObj.isClient) { + var24.setArrowCountInEntity(var24.getArrowCountInEntity() + 1); + } + + if (this.knockbackStrength > 0) { + var26 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var26 > 0.0F) { + var4.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)var26, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)var26); + } + } + + if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase) { + EnchantmentHelper.func_151384_a(var24, this.shootingEntity); + EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, var24); + } + + if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { + ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + } + } + + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + + if (!(var4.entityHit instanceof EntityEnderman)) { + this.setDead(); + } + } else { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } else { + this.field_145791_d = var4.blockX; + this.field_145792_e = var4.blockY; + this.field_145789_f = var4.blockZ; + this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.motionX = (float)(var4.hitVec.xCoord - this.posX); + this.motionY = (float)(var4.hitVec.yCoord - this.posY); + this.motionZ = (float)(var4.hitVec.zCoord - this.posZ); + var20 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / (double)var20 * 0.05000000074505806D; + this.posY -= this.motionY / (double)var20 * 0.05000000074505806D; + this.posZ -= this.motionZ / (double)var20 * 0.05000000074505806D; + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); + + if (this.field_145790_g.getMaterial() != Material.air) { + this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this); + } + } + } + + if (this.getIsCritical()) { + for (var9 = 0; var9 < 4; ++var9) { + this.worldObj.spawnParticle("crit", this.posX + this.motionX * (double)var9 / 4.0D, this.posY + this.motionY * (double)var9 / 4.0D, this.posZ + this.motionZ * (double)var9 / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + var20 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, var20) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var22 = 0.99F; + var11 = 0.05F; + + if (this.isInWater()) { + for (int var25 = 0; var25 < 4; ++var25) { + var26 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var26, this.posY - this.motionY * (double)var26, this.posZ - this.motionZ * (double)var26, this.motionX, this.motionY, this.motionZ); + } + + var22 = 0.8F; + } + + if (this.isWet()) { + this.extinguish(); + } + + this.motionX *= var22; + this.motionY *= var22; + this.motionZ *= var22; + this.motionY -= var11; + this.setPosition(this.posX, this.posY, this.posZ); + this.func_145775_I(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("xTile", (short)this.field_145791_d); + p_70014_1_.setShort("yTile", (short)this.field_145792_e); + p_70014_1_.setShort("zTile", (short)this.field_145789_f); + p_70014_1_.setShort("life", (short)this.ticksInGround); + p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g)); + p_70014_1_.setByte("inData", (byte)this.inData); + p_70014_1_.setByte("shake", (byte)this.arrowShake); + p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + p_70014_1_.setByte("pickup", (byte)this.canBePickedUp); + p_70014_1_.setDouble("damage", this.damage); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.field_145791_d = p_70037_1_.getShort("xTile"); + this.field_145792_e = p_70037_1_.getShort("yTile"); + this.field_145789_f = p_70037_1_.getShort("zTile"); + this.ticksInGround = p_70037_1_.getShort("life"); + this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.inData = p_70037_1_.getByte("inData") & 255; + this.arrowShake = p_70037_1_.getByte("shake") & 255; + this.inGround = p_70037_1_.getByte("inGround") == 1; + + if (p_70037_1_.func_150297_b("damage", 99)) { + this.damage = p_70037_1_.getDouble("damage"); + } + + if (p_70037_1_.func_150297_b("pickup", 99)) { + this.canBePickedUp = p_70037_1_.getByte("pickup"); + } else if (p_70037_1_.func_150297_b("player", 99)) { + this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0; + } + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer p_70100_1_) { + if (!this.worldObj.isClient && this.inGround && this.arrowShake <= 0) { + boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && p_70100_1_.capabilities.isCreativeMode; + + if (this.canBePickedUp == 1 && !p_70100_1_.inventory.addItemStackToInventory(new ItemStack(Items.arrow, 1))) { + var2 = false; + } + + if (var2) { + this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + p_70100_1_.onItemPickup(this, 1); + this.setDead(); + } + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() { + return false; + } + + public float getShadowSize() { + return 0.0F; + } + + public void setDamage(double p_70239_1_) { + this.damage = p_70239_1_; + } + + public double getDamage() { + return this.damage; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int p_70240_1_) { + this.knockbackStrength = p_70240_1_; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public void setIsCritical(boolean p_70243_1_) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70243_1_) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public boolean getIsCritical() { + byte var1 = this.dataWatcher.getWatchableObjectByte(16); + return (var1 & 1) != 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityEgg.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityEgg.java new file mode 100644 index 0000000..79240e1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityEgg.java @@ -0,0 +1,55 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityEgg extends EntityThrowable { + + + public EntityEgg(World p_i1779_1_) { + super(p_i1779_1_); + } + + public EntityEgg(World p_i1780_1_, EntityLivingBase p_i1780_2_) { + super(p_i1780_1_, p_i1780_2_); + } + + public EntityEgg(World p_i1781_1_, double p_i1781_2_, double p_i1781_4_, double p_i1781_6_) { + super(p_i1781_1_, p_i1781_2_, p_i1781_4_, p_i1781_6_); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) { + if (p_70184_1_.entityHit != null) { + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); + } + + if (!this.worldObj.isClient && this.rand.nextInt(8) == 0) { + byte var2 = 1; + + if (this.rand.nextInt(32) == 0) { + var2 = 4; + } + + for (int var3 = 0; var3 < var2; ++var3) { + EntityChicken var4 = new EntityChicken(this.worldObj); + var4.setGrowingAge(-24000); + var4.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + this.worldObj.spawnEntityInWorld(var4); + } + } + + for (int var5 = 0; var5 < 8; ++var5) { + this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + + if (!this.worldObj.isClient) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityFireball.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityFireball.java new file mode 100644 index 0000000..820292f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityFireball.java @@ -0,0 +1,293 @@ +package net.minecraft.entity.projectile; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class EntityFireball extends Entity { + private int field_145795_e = -1; + private int field_145793_f = -1; + private int field_145794_g = -1; + private Block field_145796_h; + private boolean inGround; + public EntityLivingBase shootingEntity; + private int ticksAlive; + private int ticksInAir; + public double accelerationX; + public double accelerationY; + public double accelerationZ; + + + public EntityFireball(World p_i1759_1_) { + super(p_i1759_1_); + this.setSize(1.0F, 1.0F); + } + + protected void entityInit() {} + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; + return p_70112_1_ < var3 * var3; + } + + public EntityFireball(World p_i1760_1_, double p_i1760_2_, double p_i1760_4_, double p_i1760_6_, double p_i1760_8_, double p_i1760_10_, double p_i1760_12_) { + super(p_i1760_1_); + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(p_i1760_2_, p_i1760_4_, p_i1760_6_, this.rotationYaw, this.rotationPitch); + this.setPosition(p_i1760_2_, p_i1760_4_, p_i1760_6_); + double var14 = MathHelper.sqrt_double(p_i1760_8_ * p_i1760_8_ + p_i1760_10_ * p_i1760_10_ + p_i1760_12_ * p_i1760_12_); + this.accelerationX = p_i1760_8_ / var14 * 0.1D; + this.accelerationY = p_i1760_10_ / var14 * 0.1D; + this.accelerationZ = p_i1760_12_ / var14 * 0.1D; + } + + public EntityFireball(World p_i1761_1_, EntityLivingBase p_i1761_2_, double p_i1761_3_, double p_i1761_5_, double p_i1761_7_) { + super(p_i1761_1_); + this.shootingEntity = p_i1761_2_; + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(p_i1761_2_.posX, p_i1761_2_.posY, p_i1761_2_.posZ, p_i1761_2_.rotationYaw, p_i1761_2_.rotationPitch); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = this.motionY = this.motionZ = 0.0D; + p_i1761_3_ += this.rand.nextGaussian() * 0.4D; + p_i1761_5_ += this.rand.nextGaussian() * 0.4D; + p_i1761_7_ += this.rand.nextGaussian() * 0.4D; + double var9 = MathHelper.sqrt_double(p_i1761_3_ * p_i1761_3_ + p_i1761_5_ * p_i1761_5_ + p_i1761_7_ * p_i1761_7_); + this.accelerationX = p_i1761_3_ / var9 * 0.1D; + this.accelerationY = p_i1761_5_ / var9 * 0.1D; + this.accelerationZ = p_i1761_7_ / var9 * 0.1D; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (!this.worldObj.isClient && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ))) { + this.setDead(); + } else { + super.onUpdate(); + this.setFire(1); + + if (this.inGround) { + if (this.worldObj.getBlock(this.field_145795_e, this.field_145793_f, this.field_145794_g) == this.field_145796_h) { + ++this.ticksAlive; + + if (this.ticksAlive == 600) { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= this.rand.nextFloat() * 0.2F; + this.motionY *= this.rand.nextFloat() * 0.2F; + this.motionZ *= this.rand.nextFloat() * 0.2F; + this.ticksAlive = 0; + this.ticksInAir = 0; + } else { + ++this.ticksInAir; + } + + Vec3 var1 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var1, var2); + var1 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) { + var2 = Vec3.createVectorHelper(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); + } + + Entity var4 = null; + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var6 = 0.0D; + + for (int var8 = 0; var8 < var5.size(); ++var8) { + Entity var9 = (Entity)var5.get(var8); + + if (var9.canBeCollidedWith() && (!var9.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) { + float var10 = 0.3F; + AxisAlignedBB var11 = var9.boundingBox.expand(var10, var10, var10); + MovingObjectPosition var12 = var11.calculateIntercept(var1, var2); + + if (var12 != null) { + double var13 = var1.distanceTo(var12.hitVec); + + if (var13 < var6 || var6 == 0.0D) { + var4 = var9; + var6 = var13; + } + } + } + } + + if (var4 != null) { + var3 = new MovingObjectPosition(var4); + } + + if (var3 != null) { + this.onImpact(var3); + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float var15 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; + + for (this.rotationPitch = (float)(Math.atan2(var15, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var16 = this.getMotionFactor(); + + if (this.isInWater()) { + for (int var17 = 0; var17 < 4; ++var17) { + float var18 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var18, this.posY - this.motionY * (double)var18, this.posZ - this.motionZ * (double)var18, this.motionX, this.motionY, this.motionZ); + } + + var16 = 0.8F; + } + + this.motionX += this.accelerationX; + this.motionY += this.accelerationY; + this.motionZ += this.accelerationZ; + this.motionX *= var16; + this.motionY *= var16; + this.motionZ *= var16; + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + this.setPosition(this.posX, this.posY, this.posZ); + } + } + + /** + * Return the motion factor for this projectile. The factor is multiplied by the original motion. + */ + protected float getMotionFactor() { + return 0.95F; + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected abstract void onImpact(MovingObjectPosition p_70227_1_); + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("xTile", (short)this.field_145795_e); + p_70014_1_.setShort("yTile", (short)this.field_145793_f); + p_70014_1_.setShort("zTile", (short)this.field_145794_g); + p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145796_h)); + p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + p_70014_1_.setTag("direction", this.newDoubleNBTList(this.motionX, this.motionY, this.motionZ)); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.field_145795_e = p_70037_1_.getShort("xTile"); + this.field_145793_f = p_70037_1_.getShort("yTile"); + this.field_145794_g = p_70037_1_.getShort("zTile"); + this.field_145796_h = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.inGround = p_70037_1_.getByte("inGround") == 1; + + if (p_70037_1_.func_150297_b("direction", 9)) { + NBTTagList var2 = p_70037_1_.getTagList("direction", 6); + this.motionX = var2.func_150309_d(0); + this.motionY = var2.func_150309_d(1); + this.motionZ = var2.func_150309_d(2); + } else { + this.setDead(); + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return true; + } + + public float getCollisionBorderSize() { + return 1.0F; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + if (this.isEntityInvulnerable()) { + return false; + } else { + this.setBeenAttacked(); + + if (p_70097_1_.getEntity() != null) { + Vec3 var3 = p_70097_1_.getEntity().getLookVec(); + + if (var3 != null) { + this.motionX = var3.xCoord; + this.motionY = var3.yCoord; + this.motionZ = var3.zCoord; + this.accelerationX = this.motionX * 0.1D; + this.accelerationY = this.motionY * 0.1D; + this.accelerationZ = this.motionZ * 0.1D; + } + + if (p_70097_1_.getEntity() instanceof EntityLivingBase) { + this.shootingEntity = (EntityLivingBase)p_70097_1_.getEntity(); + } + + return true; + } else { + return false; + } + } + } + + public float getShadowSize() { + return 0.0F; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) { + return 1.0F; + } + + public int getBrightnessForRender(float p_70070_1_) { + return 15728880; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java new file mode 100644 index 0000000..b12ba58 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java @@ -0,0 +1,517 @@ +package net.minecraft.entity.projectile; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemFishFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomFishable; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class EntityFishHook extends Entity { + private static final List field_146039_d = Arrays.asList((new WeightedRandomFishable(new ItemStack(Items.leather_boots), 10)).func_150709_a(0.9F), new WeightedRandomFishable(new ItemStack(Items.leather), 10), new WeightedRandomFishable(new ItemStack(Items.bone), 10), new WeightedRandomFishable(new ItemStack(Items.potionitem), 10), new WeightedRandomFishable(new ItemStack(Items.string), 5), (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 2)).func_150709_a(0.9F), new WeightedRandomFishable(new ItemStack(Items.bowl), 10), new WeightedRandomFishable(new ItemStack(Items.stick), 5), new WeightedRandomFishable(new ItemStack(Items.dye, 10, 0), 1), new WeightedRandomFishable(new ItemStack(Blocks.tripwire_hook), 10), new WeightedRandomFishable(new ItemStack(Items.rotten_flesh), 10)); + private static final List field_146041_e = Arrays.asList(new WeightedRandomFishable(new ItemStack(Blocks.waterlily), 1), new WeightedRandomFishable(new ItemStack(Items.name_tag), 1), new WeightedRandomFishable(new ItemStack(Items.saddle), 1), (new WeightedRandomFishable(new ItemStack(Items.bow), 1)).func_150709_a(0.25F).func_150707_a(), (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 1)).func_150709_a(0.25F).func_150707_a(), (new WeightedRandomFishable(new ItemStack(Items.book), 1)).func_150707_a()); + private static final List field_146036_f = Arrays.asList(new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.func_150976_a()), 60), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.SALMON.func_150976_a()), 25), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.CLOWNFISH.func_150976_a()), 2), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.PUFFERFISH.func_150976_a()), 13)); + private int field_146037_g; + private int field_146048_h; + private int field_146050_i; + private Block field_146046_j; + private boolean field_146051_au; + public int field_146044_a; + public EntityPlayer field_146042_b; + private int field_146049_av; + private int field_146047_aw; + private int field_146045_ax; + private int field_146040_ay; + private int field_146038_az; + private float field_146054_aA; + public Entity field_146043_c; + private int field_146055_aB; + private double field_146056_aC; + private double field_146057_aD; + private double field_146058_aE; + private double field_146059_aF; + private double field_146060_aG; + private double field_146061_aH; + private double field_146052_aI; + private double field_146053_aJ; + + + public EntityFishHook(World p_i1764_1_) { + super(p_i1764_1_); + this.field_146037_g = -1; + this.field_146048_h = -1; + this.field_146050_i = -1; + this.setSize(0.25F, 0.25F); + this.ignoreFrustumCheck = true; + } + + public EntityFishHook(World p_i1765_1_, double p_i1765_2_, double p_i1765_4_, double p_i1765_6_, EntityPlayer p_i1765_8_) { + this(p_i1765_1_); + this.setPosition(p_i1765_2_, p_i1765_4_, p_i1765_6_); + this.ignoreFrustumCheck = true; + this.field_146042_b = p_i1765_8_; + p_i1765_8_.fishEntity = this; + } + + public EntityFishHook(World p_i1766_1_, EntityPlayer p_i1766_2_) { + super(p_i1766_1_); + this.field_146037_g = -1; + this.field_146048_h = -1; + this.field_146050_i = -1; + this.ignoreFrustumCheck = true; + this.field_146042_b = p_i1766_2_; + this.field_146042_b.fishEntity = this; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(p_i1766_2_.posX, p_i1766_2_.posY + 1.62D - (double)p_i1766_2_.yOffset, p_i1766_2_.posZ, p_i1766_2_.rotationYaw, p_i1766_2_.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + float var3 = 0.4F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var3; + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var3; + this.motionY = -MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * var3; + this.func_146035_c(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F); + } + + protected void entityInit() {} + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; + return p_70112_1_ < var3 * var3; + } + + public void func_146035_c(double p_146035_1_, double p_146035_3_, double p_146035_5_, float p_146035_7_, float p_146035_8_) { + float var9 = MathHelper.sqrt_double(p_146035_1_ * p_146035_1_ + p_146035_3_ * p_146035_3_ + p_146035_5_ * p_146035_5_); + p_146035_1_ /= var9; + p_146035_3_ /= var9; + p_146035_5_ /= var9; + p_146035_1_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_3_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_5_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_1_ *= p_146035_7_; + p_146035_3_ *= p_146035_7_; + p_146035_5_ *= p_146035_7_; + this.motionX = p_146035_1_; + this.motionY = p_146035_3_; + this.motionZ = p_146035_5_; + float var10 = MathHelper.sqrt_double(p_146035_1_ * p_146035_1_ + p_146035_5_ * p_146035_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_146035_1_, p_146035_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_146035_3_, var10) * 180.0D / Math.PI); + this.field_146049_av = 0; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { + this.field_146056_aC = p_70056_1_; + this.field_146057_aD = p_70056_3_; + this.field_146058_aE = p_70056_5_; + this.field_146059_aF = p_70056_7_; + this.field_146060_aG = p_70056_8_; + this.field_146055_aB = p_70056_9_; + this.motionX = this.field_146061_aH; + this.motionY = this.field_146052_aI; + this.motionZ = this.field_146053_aJ; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.field_146061_aH = this.motionX = p_70016_1_; + this.field_146052_aI = this.motionY = p_70016_3_; + this.field_146053_aJ = this.motionZ = p_70016_5_; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + + if (this.field_146055_aB > 0) { + double var27 = this.posX + (this.field_146056_aC - this.posX) / (double)this.field_146055_aB; + double var28 = this.posY + (this.field_146057_aD - this.posY) / (double)this.field_146055_aB; + double var29 = this.posZ + (this.field_146058_aE - this.posZ) / (double)this.field_146055_aB; + double var7 = MathHelper.wrapAngleTo180_double(this.field_146059_aF - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + var7 / (double)this.field_146055_aB); + this.rotationPitch = (float)((double)this.rotationPitch + (this.field_146060_aG - (double)this.rotationPitch) / (double)this.field_146055_aB); + --this.field_146055_aB; + this.setPosition(var27, var28, var29); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else { + if (!this.worldObj.isClient) { + ItemStack var1 = this.field_146042_b.getCurrentEquippedItem(); + + if (this.field_146042_b.isDead || !this.field_146042_b.isEntityAlive() || var1 == null || var1.getItem() != Items.fishing_rod || this.getDistanceSqToEntity(this.field_146042_b) > 1024.0D) { + this.setDead(); + this.field_146042_b.fishEntity = null; + return; + } + + if (this.field_146043_c != null) { + if (!this.field_146043_c.isDead) { + this.posX = this.field_146043_c.posX; + this.posY = this.field_146043_c.boundingBox.minY + (double)this.field_146043_c.height * 0.8D; + this.posZ = this.field_146043_c.posZ; + return; + } + + this.field_146043_c = null; + } + } + + if (this.field_146044_a > 0) { + --this.field_146044_a; + } + + if (this.field_146051_au) { + if (this.worldObj.getBlock(this.field_146037_g, this.field_146048_h, this.field_146050_i) == this.field_146046_j) { + ++this.field_146049_av; + + if (this.field_146049_av == 1200) { + this.setDead(); + } + + return; + } + + this.field_146051_au = false; + this.motionX *= this.rand.nextFloat() * 0.2F; + this.motionY *= this.rand.nextFloat() * 0.2F; + this.motionZ *= this.rand.nextFloat() * 0.2F; + this.field_146049_av = 0; + this.field_146047_aw = 0; + } else { + ++this.field_146047_aw; + } + + Vec3 var26 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var26, var2); + var26 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) { + var2 = Vec3.createVectorHelper(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); + } + + Entity var4 = null; + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var6 = 0.0D; + double var13; + + for (int var8 = 0; var8 < var5.size(); ++var8) { + Entity var9 = (Entity)var5.get(var8); + + if (var9.canBeCollidedWith() && (var9 != this.field_146042_b || this.field_146047_aw >= 5)) { + float var10 = 0.3F; + AxisAlignedBB var11 = var9.boundingBox.expand(var10, var10, var10); + MovingObjectPosition var12 = var11.calculateIntercept(var26, var2); + + if (var12 != null) { + var13 = var26.distanceTo(var12.hitVec); + + if (var13 < var6 || var6 == 0.0D) { + var4 = var9; + var6 = var13; + } + } + } + } + + if (var4 != null) { + var3 = new MovingObjectPosition(var4); + } + + if (var3 != null) { + if (var3.entityHit != null) { + if (var3.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.field_146042_b), 0.0F)) { + this.field_146043_c = var3.entityHit; + } + } else { + this.field_146051_au = true; + } + } + + if (!this.field_146051_au) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float var30 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, var30) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var31 = 0.92F; + + if (this.onGround || this.isCollidedHorizontally) { + var31 = 0.5F; + } + + byte var32 = 5; + double var33 = 0.0D; + + for (int var34 = 0; var34 < var32; ++var34) { + double var14 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var34 + 0) / (double)var32 - 0.125D + 0.125D; + double var16 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var34 + 1) / (double)var32 - 0.125D + 0.125D; + AxisAlignedBB var18 = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, var14, this.boundingBox.minZ, this.boundingBox.maxX, var16, this.boundingBox.maxZ); + + if (this.worldObj.isAABBInMaterial(var18, Material.water)) { + var33 += 1.0D / (double)var32; + } + } + + if (!this.worldObj.isClient && var33 > 0.0D) { + WorldServer var35 = (WorldServer)this.worldObj; + int var36 = 1; + + if (this.rand.nextFloat() < 0.25F && this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) { + var36 = 2; + } + + if (this.rand.nextFloat() < 0.5F && !this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) { + --var36; + } + + if (this.field_146045_ax > 0) { + --this.field_146045_ax; + + if (this.field_146045_ax <= 0) { + this.field_146040_ay = 0; + this.field_146038_az = 0; + } + } else { + float var15; + float var17; + double var20; + double var22; + float var37; + double var38; + + if (this.field_146038_az > 0) { + this.field_146038_az -= var36; + + if (this.field_146038_az <= 0) { + this.motionY -= 0.20000000298023224D; + this.playSound("random.splash", 0.25F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + var15 = (float)MathHelper.floor_double(this.boundingBox.minY); + var35.func_147487_a("bubble", this.posX, var15 + 1.0F, this.posZ, (int)(1.0F + this.width * 20.0F), this.width, 0.0D, this.width, 0.20000000298023224D); + var35.func_147487_a("wake", this.posX, var15 + 1.0F, this.posZ, (int)(1.0F + this.width * 20.0F), this.width, 0.0D, this.width, 0.20000000298023224D); + this.field_146045_ax = MathHelper.getRandomIntegerInRange(this.rand, 10, 30); + } else { + this.field_146054_aA = (float)((double)this.field_146054_aA + this.rand.nextGaussian() * 4.0D); + var15 = this.field_146054_aA * 0.017453292F; + var37 = MathHelper.sin(var15); + var17 = MathHelper.cos(var15); + var38 = this.posX + (double)(var37 * (float)this.field_146038_az * 0.1F); + var20 = (float)MathHelper.floor_double(this.boundingBox.minY) + 1.0F; + var22 = this.posZ + (double)(var17 * (float)this.field_146038_az * 0.1F); + + if (this.rand.nextFloat() < 0.15F) { + var35.func_147487_a("bubble", var38, var20 - 0.10000000149011612D, var22, 1, var37, 0.1D, var17, 0.0D); + } + + float var24 = var37 * 0.04F; + float var25 = var17 * 0.04F; + var35.func_147487_a("wake", var38, var20, var22, 0, var25, 0.01D, -var24, 1.0D); + var35.func_147487_a("wake", var38, var20, var22, 0, -var25, 0.01D, var24, 1.0D); + } + } else if (this.field_146040_ay > 0) { + this.field_146040_ay -= var36; + var15 = 0.15F; + + if (this.field_146040_ay < 20) { + var15 = (float)((double)var15 + (double)(20 - this.field_146040_ay) * 0.05D); + } else if (this.field_146040_ay < 40) { + var15 = (float)((double)var15 + (double)(40 - this.field_146040_ay) * 0.02D); + } else if (this.field_146040_ay < 60) { + var15 = (float)((double)var15 + (double)(60 - this.field_146040_ay) * 0.01D); + } + + if (this.rand.nextFloat() < var15) { + var37 = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F) * 0.017453292F; + var17 = MathHelper.randomFloatClamp(this.rand, 25.0F, 60.0F); + var38 = this.posX + (double)(MathHelper.sin(var37) * var17 * 0.1F); + var20 = (float)MathHelper.floor_double(this.boundingBox.minY) + 1.0F; + var22 = this.posZ + (double)(MathHelper.cos(var37) * var17 * 0.1F); + var35.func_147487_a("splash", var38, var20, var22, 2 + this.rand.nextInt(2), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D); + } + + if (this.field_146040_ay <= 0) { + this.field_146054_aA = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F); + this.field_146038_az = MathHelper.getRandomIntegerInRange(this.rand, 20, 80); + } + } else { + this.field_146040_ay = MathHelper.getRandomIntegerInRange(this.rand, 100, 900); + this.field_146040_ay -= EnchantmentHelper.func_151387_h(this.field_146042_b) * 20 * 5; + } + } + + if (this.field_146045_ax > 0) { + this.motionY -= (double)(this.rand.nextFloat() * this.rand.nextFloat() * this.rand.nextFloat()) * 0.2D; + } + } + + var13 = var33 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * var13; + + if (var33 > 0.0D) { + var31 = (float)((double)var31 * 0.9D); + this.motionY *= 0.8D; + } + + this.motionX *= var31; + this.motionY *= var31; + this.motionZ *= var31; + this.setPosition(this.posX, this.posY, this.posZ); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("xTile", (short)this.field_146037_g); + p_70014_1_.setShort("yTile", (short)this.field_146048_h); + p_70014_1_.setShort("zTile", (short)this.field_146050_i); + p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_146046_j)); + p_70014_1_.setByte("shake", (byte)this.field_146044_a); + p_70014_1_.setByte("inGround", (byte)(this.field_146051_au ? 1 : 0)); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.field_146037_g = p_70037_1_.getShort("xTile"); + this.field_146048_h = p_70037_1_.getShort("yTile"); + this.field_146050_i = p_70037_1_.getShort("zTile"); + this.field_146046_j = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.field_146044_a = p_70037_1_.getByte("shake") & 255; + this.field_146051_au = p_70037_1_.getByte("inGround") == 1; + } + + public float getShadowSize() { + return 0.0F; + } + + public int func_146034_e() { + if (this.worldObj.isClient) { + return 0; + } else { + byte var1 = 0; + + if (this.field_146043_c != null) { + double var2 = this.field_146042_b.posX - this.posX; + double var4 = this.field_146042_b.posY - this.posY; + double var6 = this.field_146042_b.posZ - this.posZ; + double var8 = MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6); + double var10 = 0.1D; + this.field_146043_c.motionX += var2 * var10; + this.field_146043_c.motionY += var4 * var10 + (double)MathHelper.sqrt_double(var8) * 0.08D; + this.field_146043_c.motionZ += var6 * var10; + var1 = 3; + } else if (this.field_146045_ax > 0) { + EntityItem var13 = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, this.func_146033_f()); + double var3 = this.field_146042_b.posX - this.posX; + double var5 = this.field_146042_b.posY - this.posY; + double var7 = this.field_146042_b.posZ - this.posZ; + double var9 = MathHelper.sqrt_double(var3 * var3 + var5 * var5 + var7 * var7); + double var11 = 0.1D; + var13.motionX = var3 * var11; + var13.motionY = var5 * var11 + (double)MathHelper.sqrt_double(var9) * 0.08D; + var13.motionZ = var7 * var11; + this.worldObj.spawnEntityInWorld(var13); + this.field_146042_b.worldObj.spawnEntityInWorld(new EntityXPOrb(this.field_146042_b.worldObj, this.field_146042_b.posX, this.field_146042_b.posY + 0.5D, this.field_146042_b.posZ + 0.5D, this.rand.nextInt(6) + 1)); + var1 = 1; + } + + if (this.field_146051_au) { + var1 = 2; + } + + this.setDead(); + this.field_146042_b.fishEntity = null; + return var1; + } + } + + private ItemStack func_146033_f() { + float var1 = this.worldObj.rand.nextFloat(); + int var2 = EnchantmentHelper.func_151386_g(this.field_146042_b); + int var3 = EnchantmentHelper.func_151387_h(this.field_146042_b); + float var4 = 0.1F - (float)var2 * 0.025F - (float)var3 * 0.01F; + float var5 = 0.05F + (float)var2 * 0.01F - (float)var3 * 0.01F; + var4 = MathHelper.clamp_float(var4, 0.0F, 1.0F); + var5 = MathHelper.clamp_float(var5, 0.0F, 1.0F); + + if (var1 < var4) { + this.field_146042_b.addStat(StatList.field_151183_A, 1); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, field_146039_d)).func_150708_a(this.rand); + } else { + var1 -= var4; + + if (var1 < var5) { + this.field_146042_b.addStat(StatList.field_151184_B, 1); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, field_146041_e)).func_150708_a(this.rand); + } else { + float var10000 = var1 - var5; + this.field_146042_b.addStat(StatList.fishCaughtStat, 1); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, field_146036_f)).func_150708_a(this.rand); + } + } + } + + /** + * Will get destroyed next tick. + */ + public void setDead() { + super.setDead(); + + if (this.field_146042_b != null) { + this.field_146042_b.fishEntity = null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java new file mode 100644 index 0000000..6856d22 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java @@ -0,0 +1,58 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityLargeFireball extends EntityFireball { + public int field_92057_e = 1; + + + public EntityLargeFireball(World p_i1767_1_) { + super(p_i1767_1_); + } + + public EntityLargeFireball(World p_i1768_1_, double p_i1768_2_, double p_i1768_4_, double p_i1768_6_, double p_i1768_8_, double p_i1768_10_, double p_i1768_12_) { + super(p_i1768_1_, p_i1768_2_, p_i1768_4_, p_i1768_6_, p_i1768_8_, p_i1768_10_, p_i1768_12_); + } + + public EntityLargeFireball(World p_i1769_1_, EntityLivingBase p_i1769_2_, double p_i1769_3_, double p_i1769_5_, double p_i1769_7_) { + super(p_i1769_1_, p_i1769_2_, p_i1769_3_, p_i1769_5_, p_i1769_7_); + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70227_1_) { + if (!this.worldObj.isClient) { + if (p_70227_1_.entityHit != null) { + p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); + } + + this.worldObj.newExplosion(null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.setDead(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setInteger("ExplosionPower", this.field_92057_e); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + + if (p_70037_1_.func_150297_b("ExplosionPower", 99)) { + this.field_92057_e = p_70037_1_.getInteger("ExplosionPower"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityPotion.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityPotion.java new file mode 100644 index 0000000..e70d0eb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityPotion.java @@ -0,0 +1,156 @@ +package net.minecraft.entity.projectile; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityPotion extends EntityThrowable { + /** + * The damage value of the thrown potion that this EntityPotion represents. + */ + private ItemStack potionDamage; + + + public EntityPotion(World p_i1788_1_) { + super(p_i1788_1_); + } + + public EntityPotion(World p_i1789_1_, EntityLivingBase p_i1789_2_, int p_i1789_3_) { + this(p_i1789_1_, p_i1789_2_, new ItemStack(Items.potionitem, 1, p_i1789_3_)); + } + + public EntityPotion(World p_i1790_1_, EntityLivingBase p_i1790_2_, ItemStack p_i1790_3_) { + super(p_i1790_1_, p_i1790_2_); + this.potionDamage = p_i1790_3_; + } + + public EntityPotion(World p_i1791_1_, double p_i1791_2_, double p_i1791_4_, double p_i1791_6_, int p_i1791_8_) { + this(p_i1791_1_, p_i1791_2_, p_i1791_4_, p_i1791_6_, new ItemStack(Items.potionitem, 1, p_i1791_8_)); + } + + public EntityPotion(World p_i1792_1_, double p_i1792_2_, double p_i1792_4_, double p_i1792_6_, ItemStack p_i1792_8_) { + super(p_i1792_1_, p_i1792_2_, p_i1792_4_, p_i1792_6_); + this.potionDamage = p_i1792_8_; + } + + /** + * Gets the amount of gravity to apply to the thrown entity with each tick. + */ + protected float getGravityVelocity() { + return 0.05F; + } + + protected float func_70182_d() { + return 0.5F; + } + + protected float func_70183_g() { + return -20.0F; + } + + public void setPotionDamage(int p_82340_1_) { + if (this.potionDamage == null) { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + this.potionDamage.setItemDamage(p_82340_1_); + } + + /** + * Returns the damage value of the thrown potion that this EntityPotion represents. + */ + public int getPotionDamage() { + if (this.potionDamage == null) { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + return this.potionDamage.getItemDamage(); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) { + if (!this.worldObj.isClient) { + List var2 = Items.potionitem.getEffects(this.potionDamage); + + if (var2 != null && !var2.isEmpty()) { + AxisAlignedBB var3 = this.boundingBox.expand(4.0D, 2.0D, 4.0D); + List var4 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, var3); + + if (var4 != null && !var4.isEmpty()) { + Iterator var5 = var4.iterator(); + + while (var5.hasNext()) { + EntityLivingBase var6 = (EntityLivingBase)var5.next(); + double var7 = this.getDistanceSqToEntity(var6); + + if (var7 < 16.0D) { + double var9 = 1.0D - Math.sqrt(var7) / 4.0D; + + if (var6 == p_70184_1_.entityHit) { + var9 = 1.0D; + } + + Iterator var11 = var2.iterator(); + + while (var11.hasNext()) { + PotionEffect var12 = (PotionEffect)var11.next(); + int var13 = var12.getPotionID(); + + if (Potion.potionTypes[var13].isInstant()) { + Potion.potionTypes[var13].affectEntity(this.getThrower(), var6, var12.getAmplifier(), var9); + } else { + int var14 = (int)(var9 * (double)var12.getDuration() + 0.5D); + + if (var14 > 20) { + var6.addPotionEffect(new PotionEffect(var13, var14, var12.getAmplifier())); + } + } + } + } + } + } + } + + this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), this.getPotionDamage()); + this.setDead(); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + + if (p_70037_1_.func_150297_b("Potion", 10)) { + this.potionDamage = ItemStack.loadItemStackFromNBT(p_70037_1_.getCompoundTag("Potion")); + } else { + this.setPotionDamage(p_70037_1_.getInteger("potionValue")); + } + + if (this.potionDamage == null) { + this.setDead(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + + if (this.potionDamage != null) { + p_70014_1_.setTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java new file mode 100644 index 0000000..83b14ec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java @@ -0,0 +1,88 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntitySmallFireball extends EntityFireball { + + + public EntitySmallFireball(World p_i1770_1_) { + super(p_i1770_1_); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World p_i1771_1_, EntityLivingBase p_i1771_2_, double p_i1771_3_, double p_i1771_5_, double p_i1771_7_) { + super(p_i1771_1_, p_i1771_2_, p_i1771_3_, p_i1771_5_, p_i1771_7_); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World p_i1772_1_, double p_i1772_2_, double p_i1772_4_, double p_i1772_6_, double p_i1772_8_, double p_i1772_10_, double p_i1772_12_) { + super(p_i1772_1_, p_i1772_2_, p_i1772_4_, p_i1772_6_, p_i1772_8_, p_i1772_10_, p_i1772_12_); + this.setSize(0.3125F, 0.3125F); + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70227_1_) { + if (!this.worldObj.isClient) { + if (p_70227_1_.entityHit != null) { + if (!p_70227_1_.entityHit.isImmuneToFire() && p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) { + p_70227_1_.entityHit.setFire(5); + } + } else { + int var2 = p_70227_1_.blockX; + int var3 = p_70227_1_.blockY; + int var4 = p_70227_1_.blockZ; + + switch (p_70227_1_.sideHit) { + case 0: + --var3; + break; + + case 1: + ++var3; + break; + + case 2: + --var4; + break; + + case 3: + ++var4; + break; + + case 4: + --var2; + break; + + case 5: + ++var2; + } + + if (this.worldObj.isAirBlock(var2, var3, var4)) { + this.worldObj.setBlock(var2, var3, var4, Blocks.fire); + } + } + + this.setDead(); + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java new file mode 100644 index 0000000..dcf7ca3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java @@ -0,0 +1,46 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntitySnowball extends EntityThrowable { + + + public EntitySnowball(World p_i1773_1_) { + super(p_i1773_1_); + } + + public EntitySnowball(World p_i1774_1_, EntityLivingBase p_i1774_2_) { + super(p_i1774_1_, p_i1774_2_); + } + + public EntitySnowball(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) { + if (p_70184_1_.entityHit != null) { + byte var2 = 0; + + if (p_70184_1_.entityHit instanceof EntityBlaze) { + var2 = 3; + } + + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), var2); + } + + for (int var3 = 0; var3 < 8; ++var3) { + this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + + if (!this.worldObj.isClient) { + this.setDead(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java new file mode 100644 index 0000000..7fb6fe9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java @@ -0,0 +1,302 @@ +package net.minecraft.entity.projectile; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class EntityThrowable extends Entity implements IProjectile { + private int field_145788_c = -1; + private int field_145786_d = -1; + private int field_145787_e = -1; + private Block field_145785_f; + protected boolean inGround; + public int throwableShake; + + /** The entity that threw this throwable item. */ + private EntityLivingBase thrower; + private String throwerName; + private int ticksInGround; + private int ticksInAir; + + + public EntityThrowable(World p_i1776_1_) { + super(p_i1776_1_); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() {} + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + public boolean isInRangeToRenderDist(double p_70112_1_) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; + return p_70112_1_ < var3 * var3; + } + + public EntityThrowable(World p_i1777_1_, EntityLivingBase p_i1777_2_) { + super(p_i1777_1_); + this.thrower = p_i1777_2_; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(p_i1777_2_.posX, p_i1777_2_.posY + (double)p_i1777_2_.getEyeHeight(), p_i1777_2_.posZ, p_i1777_2_.rotationYaw, p_i1777_2_.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + float var3 = 0.4F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var3; + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var3; + this.motionY = -MathHelper.sin((this.rotationPitch + this.func_70183_g()) / 180.0F * (float)Math.PI) * var3; + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.func_70182_d(), 1.0F); + } + + public EntityThrowable(World p_i1778_1_, double p_i1778_2_, double p_i1778_4_, double p_i1778_6_) { + super(p_i1778_1_); + this.ticksInGround = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(p_i1778_2_, p_i1778_4_, p_i1778_6_); + this.yOffset = 0.0F; + } + + protected float func_70182_d() { + return 1.5F; + } + + protected float func_70183_g() { + return 0.0F; + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) { + float var9 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= var9; + p_70186_3_ /= var9; + p_70186_5_ /= var9; + p_70186_1_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_70186_8_; + p_70186_1_ *= p_70186_7_; + p_70186_3_ *= p_70186_7_; + p_70186_5_ *= p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float var10 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { + this.motionX = p_70016_1_; + this.motionY = p_70016_3_; + this.motionZ = p_70016_5_; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float var7 = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, var7) * 180.0D / Math.PI); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + + if (this.throwableShake > 0) { + --this.throwableShake; + } + + if (this.inGround) { + if (this.worldObj.getBlock(this.field_145788_c, this.field_145786_d, this.field_145787_e) == this.field_145785_f) { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= this.rand.nextFloat() * 0.2F; + this.motionY *= this.rand.nextFloat() * 0.2F; + this.motionZ *= this.rand.nextFloat() * 0.2F; + this.ticksInGround = 0; + this.ticksInAir = 0; + } else { + ++this.ticksInAir; + } + + Vec3 var1 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var1, var2); + var1 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var3 != null) { + var2 = Vec3.createVectorHelper(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); + } + + if (!this.worldObj.isClient) { + Entity var4 = null; + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var6 = 0.0D; + EntityLivingBase var8 = this.getThrower(); + + for (int var9 = 0; var9 < var5.size(); ++var9) { + Entity var10 = (Entity)var5.get(var9); + + if (var10.canBeCollidedWith() && (var10 != var8 || this.ticksInAir >= 5)) { + float var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand(var11, var11, var11); + MovingObjectPosition var13 = var12.calculateIntercept(var1, var2); + + if (var13 != null) { + double var14 = var1.distanceTo(var13.hitVec); + + if (var14 < var6 || var6 == 0.0D) { + var4 = var10; + var6 = var14; + } + } + } + } + + if (var4 != null) { + var3 = new MovingObjectPosition(var4); + } + } + + if (var3 != null) { + if (var3.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.worldObj.getBlock(var3.blockX, var3.blockY, var3.blockZ) == Blocks.portal) { + this.setInPortal(); + } else { + this.onImpact(var3); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, var16) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var17 = 0.99F; + float var18 = this.getGravityVelocity(); + + if (this.isInWater()) { + for (int var7 = 0; var7 < 4; ++var7) { + float var19 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var19, this.posY - this.motionY * (double)var19, this.posZ - this.motionZ * (double)var19, this.motionX, this.motionY, this.motionZ); + } + + var17 = 0.8F; + } + + this.motionX *= var17; + this.motionY *= var17; + this.motionZ *= var17; + this.motionY -= var18; + this.setPosition(this.posX, this.posY, this.posZ); + } + + /** + * Gets the amount of gravity to apply to the thrown entity with each tick. + */ + protected float getGravityVelocity() { + return 0.03F; + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected abstract void onImpact(MovingObjectPosition p_70184_1_); + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + p_70014_1_.setShort("xTile", (short)this.field_145788_c); + p_70014_1_.setShort("yTile", (short)this.field_145786_d); + p_70014_1_.setShort("zTile", (short)this.field_145787_e); + p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145785_f)); + p_70014_1_.setByte("shake", (byte)this.throwableShake); + p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + + if ((this.throwerName == null || this.throwerName.length() == 0) && this.thrower != null && this.thrower instanceof EntityPlayer) { + this.throwerName = this.thrower.getCommandSenderName(); + } + + p_70014_1_.setString("ownerName", this.throwerName == null ? "" : this.throwerName); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + this.field_145788_c = p_70037_1_.getShort("xTile"); + this.field_145786_d = p_70037_1_.getShort("yTile"); + this.field_145787_e = p_70037_1_.getShort("zTile"); + this.field_145785_f = Block.getBlockById(p_70037_1_.getByte("inTile") & 255); + this.throwableShake = p_70037_1_.getByte("shake") & 255; + this.inGround = p_70037_1_.getByte("inGround") == 1; + this.throwerName = p_70037_1_.getString("ownerName"); + + if (this.throwerName != null && this.throwerName.length() == 0) { + this.throwerName = null; + } + } + + public float getShadowSize() { + return 0.0F; + } + + public EntityLivingBase getThrower() { + if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0) { + this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName); + } + + return this.thrower; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java new file mode 100644 index 0000000..996173f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java @@ -0,0 +1,121 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityWitherSkull extends EntityFireball { + + + public EntityWitherSkull(World p_i1793_1_) { + super(p_i1793_1_); + this.setSize(0.3125F, 0.3125F); + } + + public EntityWitherSkull(World p_i1794_1_, EntityLivingBase p_i1794_2_, double p_i1794_3_, double p_i1794_5_, double p_i1794_7_) { + super(p_i1794_1_, p_i1794_2_, p_i1794_3_, p_i1794_5_, p_i1794_7_); + this.setSize(0.3125F, 0.3125F); + } + + /** + * Return the motion factor for this projectile. The factor is multiplied by the original motion. + */ + protected float getMotionFactor() { + return this.isInvulnerable() ? 0.73F : super.getMotionFactor(); + } + + public EntityWitherSkull(World p_i1795_1_, double p_i1795_2_, double p_i1795_4_, double p_i1795_6_, double p_i1795_8_, double p_i1795_10_, double p_i1795_12_) { + super(p_i1795_1_, p_i1795_2_, p_i1795_4_, p_i1795_6_, p_i1795_8_, p_i1795_10_, p_i1795_12_); + this.setSize(0.3125F, 0.3125F); + } + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() { + return false; + } + + public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_) { + float var7 = super.func_145772_a(p_145772_1_, p_145772_2_, p_145772_3_, p_145772_4_, p_145772_5_, p_145772_6_); + + if (this.isInvulnerable() && p_145772_6_ != Blocks.bedrock && p_145772_6_ != Blocks.end_portal && p_145772_6_ != Blocks.end_portal_frame && p_145772_6_ != Blocks.command_block) { + var7 = Math.min(0.8F, var7); + } + + return var7; + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70227_1_) { + if (!this.worldObj.isClient) { + if (p_70227_1_.entityHit != null) { + if (this.shootingEntity != null) { + if (p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F) && !p_70227_1_.entityHit.isEntityAlive()) { + this.shootingEntity.heal(5.0F); + } + } else { + p_70227_1_.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); + } + + if (p_70227_1_.entityHit instanceof EntityLivingBase) { + byte var2 = 0; + + if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL) { + var2 = 10; + } else if (this.worldObj.difficultySetting == EnumDifficulty.HARD) { + var2 = 40; + } + + if (var2 > 0) { + ((EntityLivingBase)p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * var2, 1)); + } + } + } + + this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.setDead(); + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() { + return false; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + return false; + } + + protected void entityInit() { + this.dataWatcher.addObject(10, Byte.valueOf((byte)0)); + } + + /** + * Return whether this skull comes from an invulnerable (aura) wither boss. + */ + public boolean isInvulnerable() { + return this.dataWatcher.getWatchableObjectByte(10) == 1; + } + + /** + * Set whether this skull comes from an invulnerable (aura) wither boss. + */ + public void setInvulnerable(boolean p_82343_1_) { + this.dataWatcher.updateObject(10, Byte.valueOf((byte)(p_82343_1_ ? 1 : 0))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/event/ClickEvent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/event/ClickEvent.java new file mode 100644 index 0000000..4fcf43a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/event/ClickEvent.java @@ -0,0 +1,101 @@ +package net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; + +public class ClickEvent { + private final ClickEvent.Action action; + private final String value; + + + public ClickEvent(ClickEvent.Action p_i45156_1_, String p_i45156_2_) { + this.action = p_i45156_1_; + this.value = p_i45156_2_; + } + + /** + * Gets the action to perform when this event is raised. + */ + public ClickEvent.Action getAction() { + return this.action; + } + + /** + * Gets the value to perform the action on when this event is raised. For example, if the action is "open URL", + * this would be the URL to open. + */ + public String getValue() { + return this.value; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) { + ClickEvent var2 = (ClickEvent)p_equals_1_; + + if (this.action != var2.action) { + return false; + } else { + if (this.value != null) { + return this.value.equals(var2.value); + } else return var2.value == null; + } + } else { + return false; + } + } + + public String toString() { + return "ClickEvent{action=" + this.action + ", value='" + this.value + '\'' + '}'; + } + + public int hashCode() { + int var1 = this.action.hashCode(); + var1 = 31 * var1 + (this.value != null ? this.value.hashCode() : 0); + return var1; + } + + public enum Action { + OPEN_URL("OPEN_URL", 0, "open_url", true), + OPEN_FILE("OPEN_FILE", 1, "open_file", false), + RUN_COMMAND("RUN_COMMAND", 2, "run_command", true), + TWITCH_USER_INFO("TWITCH_USER_INFO", 3, "twitch_user_info", false), + SUGGEST_COMMAND("SUGGEST_COMMAND", 4, "suggest_command", true), + UPLOAD_SCREENSHOT("UPLOAD_SCREENSHOT", 5, "upload_screenshot", false), + COPY_SCREENSHOT("UPLOAD_SCREENSHOT", 6, "copy_screenshot", false); + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + private final String canonicalName; + + private static final ClickEvent.Action[] $VALUES = new ClickEvent.Action[]{OPEN_URL, OPEN_FILE, RUN_COMMAND, TWITCH_USER_INFO, SUGGEST_COMMAND}; + + + Action(String p_i45155_1_, int p_i45155_2_, String p_i45155_3_, boolean p_i45155_4_) { + this.canonicalName = p_i45155_3_; + this.allowedInChat = p_i45155_4_; + } + + public boolean shouldAllowInChat() { + return this.allowedInChat; + } + + public String getCanonicalName() { + return this.canonicalName; + } + + public static ClickEvent.Action getValueByCanonicalName(String p_150672_0_) { + return (ClickEvent.Action)nameMapping.get(p_150672_0_); + } + + static { + ClickEvent.Action[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + ClickEvent.Action var3 = var0[var2]; + nameMapping.put(var3.getCanonicalName(), var3); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/event/HoverEvent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/event/HoverEvent.java new file mode 100644 index 0000000..7d6da94 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/event/HoverEvent.java @@ -0,0 +1,98 @@ +package net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.util.IChatComponent; + +public class HoverEvent { + private final HoverEvent.Action action; + private final IChatComponent value; + + + public HoverEvent(HoverEvent.Action p_i45158_1_, IChatComponent p_i45158_2_) { + this.action = p_i45158_1_; + this.value = p_i45158_2_; + } + + /** + * Gets the action to perform when this event is raised. + */ + public HoverEvent.Action getAction() { + return this.action; + } + + /** + * Gets the value to perform the action on when this event is raised. For example, if the action is "show item", + * this would be the item to show. + */ + public IChatComponent getValue() { + return this.value; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) { + HoverEvent var2 = (HoverEvent)p_equals_1_; + + if (this.action != var2.action) { + return false; + } else { + if (this.value != null) { + return this.value.equals(var2.value); + } else return var2.value == null; + } + } else { + return false; + } + } + + public String toString() { + return "HoverEvent{action=" + this.action + ", value='" + this.value + '\'' + '}'; + } + + public int hashCode() { + int var1 = this.action.hashCode(); + var1 = 31 * var1 + (this.value != null ? this.value.hashCode() : 0); + return var1; + } + + public enum Action { + SHOW_TEXT("SHOW_TEXT", 0, "show_text", true), + SHOW_ACHIEVEMENT("SHOW_ACHIEVEMENT", 1, "show_achievement", true), + SHOW_ITEM("SHOW_ITEM", 2, "show_item", true); + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + private final String canonicalName; + + private static final HoverEvent.Action[] $VALUES = new HoverEvent.Action[]{SHOW_TEXT, SHOW_ACHIEVEMENT, SHOW_ITEM}; + + + Action(String p_i45157_1_, int p_i45157_2_, String p_i45157_3_, boolean p_i45157_4_) { + this.canonicalName = p_i45157_3_; + this.allowedInChat = p_i45157_4_; + } + + public boolean shouldAllowInChat() { + return this.allowedInChat; + } + + public String getCanonicalName() { + return this.canonicalName; + } + + public static HoverEvent.Action getValueByCanonicalName(String p_150684_0_) { + return (HoverEvent.Action)nameMapping.get(p_150684_0_); + } + + static { + HoverEvent.Action[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + HoverEvent.Action var3 = var0[var2]; + nameMapping.put(var3.getCanonicalName(), var3); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Blocks.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Blocks.java new file mode 100644 index 0000000..f7be1ca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Blocks.java @@ -0,0 +1,205 @@ +package net.minecraft.init; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBeacon; +import net.minecraft.block.BlockBush; +import net.minecraft.block.BlockCauldron; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockDaylightDetector; +import net.minecraft.block.BlockDeadBush; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockGrass; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockMycelium; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.BlockPistonMoving; +import net.minecraft.block.BlockPortal; +import net.minecraft.block.BlockRedstoneComparator; +import net.minecraft.block.BlockRedstoneRepeater; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.BlockTripWireHook; + +public class Blocks { + public static final Block air = (Block)Block.blockRegistry.getObject("air"); + public static final Block stone = (Block)Block.blockRegistry.getObject("stone"); + public static final BlockGrass grass = (BlockGrass)Block.blockRegistry.getObject("grass"); + public static final Block dirt = (Block)Block.blockRegistry.getObject("dirt"); + public static final Block cobblestone = (Block)Block.blockRegistry.getObject("cobblestone"); + public static final Block planks = (Block)Block.blockRegistry.getObject("planks"); + public static final Block sapling = (Block)Block.blockRegistry.getObject("sapling"); + public static final Block bedrock = (Block)Block.blockRegistry.getObject("bedrock"); + public static final BlockLiquid flowing_water = (BlockLiquid)Block.blockRegistry.getObject("flowing_water"); + public static final Block water = (Block)Block.blockRegistry.getObject("water"); + public static final BlockLiquid flowing_lava = (BlockLiquid)Block.blockRegistry.getObject("flowing_lava"); + public static final Block lava = (Block)Block.blockRegistry.getObject("lava"); + public static final BlockSand sand = (BlockSand)Block.blockRegistry.getObject("sand"); + public static final Block gravel = (Block)Block.blockRegistry.getObject("gravel"); + public static final Block gold_ore = (Block)Block.blockRegistry.getObject("gold_ore"); + public static final Block iron_ore = (Block)Block.blockRegistry.getObject("iron_ore"); + public static final Block coal_ore = (Block)Block.blockRegistry.getObject("coal_ore"); + public static final Block log = (Block)Block.blockRegistry.getObject("log"); + public static final Block log2 = (Block)Block.blockRegistry.getObject("log2"); + public static final BlockLeaves leaves = (BlockLeaves)Block.blockRegistry.getObject("leaves"); + public static final BlockLeaves leaves2 = (BlockLeaves)Block.blockRegistry.getObject("leaves2"); + public static final Block sponge = (Block)Block.blockRegistry.getObject("sponge"); + public static final Block glass = (Block)Block.blockRegistry.getObject("glass"); + public static final Block lapis_ore = (Block)Block.blockRegistry.getObject("lapis_ore"); + public static final Block lapis_block = (Block)Block.blockRegistry.getObject("lapis_block"); + public static final Block dispenser = (Block)Block.blockRegistry.getObject("dispenser"); + public static final Block sandstone = (Block)Block.blockRegistry.getObject("sandstone"); + public static final Block noteblock = (Block)Block.blockRegistry.getObject("noteblock"); + public static final Block bed = (Block)Block.blockRegistry.getObject("bed"); + public static final Block golden_rail = (Block)Block.blockRegistry.getObject("golden_rail"); + public static final Block detector_rail = (Block)Block.blockRegistry.getObject("detector_rail"); + public static final BlockPistonBase sticky_piston = (BlockPistonBase)Block.blockRegistry.getObject("sticky_piston"); + public static final Block web = (Block)Block.blockRegistry.getObject("web"); + public static final BlockTallGrass tallgrass = (BlockTallGrass)Block.blockRegistry.getObject("tallgrass"); + public static final BlockDeadBush deadbush = (BlockDeadBush)Block.blockRegistry.getObject("deadbush"); + public static final BlockPistonBase piston = (BlockPistonBase)Block.blockRegistry.getObject("piston"); + public static final BlockPistonExtension piston_head = (BlockPistonExtension)Block.blockRegistry.getObject("piston_head"); + public static final Block wool = (Block)Block.blockRegistry.getObject("wool"); + public static final BlockPistonMoving piston_extension = (BlockPistonMoving)Block.blockRegistry.getObject("piston_extension"); + public static final BlockFlower yellow_flower = (BlockFlower)Block.blockRegistry.getObject("yellow_flower"); + public static final BlockFlower red_flower = (BlockFlower)Block.blockRegistry.getObject("red_flower"); + public static final BlockBush brown_mushroom = (BlockBush)Block.blockRegistry.getObject("brown_mushroom"); + public static final BlockBush red_mushroom = (BlockBush)Block.blockRegistry.getObject("red_mushroom"); + public static final Block gold_block = (Block)Block.blockRegistry.getObject("gold_block"); + public static final Block iron_block = (Block)Block.blockRegistry.getObject("iron_block"); + public static final BlockSlab double_stone_slab = (BlockSlab)Block.blockRegistry.getObject("double_stone_slab"); + public static final BlockSlab stone_slab = (BlockSlab)Block.blockRegistry.getObject("stone_slab"); + public static final Block brick_block = (Block)Block.blockRegistry.getObject("brick_block"); + public static final Block tnt = (Block)Block.blockRegistry.getObject("tnt"); + public static final Block bookshelf = (Block)Block.blockRegistry.getObject("bookshelf"); + public static final Block mossy_cobblestone = (Block)Block.blockRegistry.getObject("mossy_cobblestone"); + public static final Block obsidian = (Block)Block.blockRegistry.getObject("obsidian"); + public static final Block torch = (Block)Block.blockRegistry.getObject("torch"); + public static final BlockFire fire = (BlockFire)Block.blockRegistry.getObject("fire"); + public static final Block mob_spawner = (Block)Block.blockRegistry.getObject("mob_spawner"); + public static final Block oak_stairs = (Block)Block.blockRegistry.getObject("oak_stairs"); + public static final BlockChest chest = (BlockChest)Block.blockRegistry.getObject("chest"); + public static final BlockRedstoneWire redstone_wire = (BlockRedstoneWire)Block.blockRegistry.getObject("redstone_wire"); + public static final Block diamond_ore = (Block)Block.blockRegistry.getObject("diamond_ore"); + public static final Block diamond_block = (Block)Block.blockRegistry.getObject("diamond_block"); + public static final Block crafting_table = (Block)Block.blockRegistry.getObject("crafting_table"); + public static final Block wheat = (Block)Block.blockRegistry.getObject("wheat"); + public static final Block farmland = (Block)Block.blockRegistry.getObject("farmland"); + public static final Block furnace = (Block)Block.blockRegistry.getObject("furnace"); + public static final Block lit_furnace = (Block)Block.blockRegistry.getObject("lit_furnace"); + public static final Block standing_sign = (Block)Block.blockRegistry.getObject("standing_sign"); + public static final Block wooden_door = (Block)Block.blockRegistry.getObject("wooden_door"); + public static final Block ladder = (Block)Block.blockRegistry.getObject("ladder"); + public static final Block rail = (Block)Block.blockRegistry.getObject("rail"); + public static final Block stone_stairs = (Block)Block.blockRegistry.getObject("stone_stairs"); + public static final Block wall_sign = (Block)Block.blockRegistry.getObject("wall_sign"); + public static final Block lever = (Block)Block.blockRegistry.getObject("lever"); + public static final Block stone_pressure_plate = (Block)Block.blockRegistry.getObject("stone_pressure_plate"); + public static final Block iron_door = (Block)Block.blockRegistry.getObject("iron_door"); + public static final Block wooden_pressure_plate = (Block)Block.blockRegistry.getObject("wooden_pressure_plate"); + public static final Block redstone_ore = (Block)Block.blockRegistry.getObject("redstone_ore"); + public static final Block lit_redstone_ore = (Block)Block.blockRegistry.getObject("lit_redstone_ore"); + public static final Block unlit_redstone_torch = (Block)Block.blockRegistry.getObject("unlit_redstone_torch"); + public static final Block redstone_torch = (Block)Block.blockRegistry.getObject("redstone_torch"); + public static final Block stone_button = (Block)Block.blockRegistry.getObject("stone_button"); + public static final Block snow_layer = (Block)Block.blockRegistry.getObject("snow_layer"); + public static final Block ice = (Block)Block.blockRegistry.getObject("ice"); + public static final Block snow = (Block)Block.blockRegistry.getObject("snow"); + public static final Block cactus = (Block)Block.blockRegistry.getObject("cactus"); + public static final Block clay = (Block)Block.blockRegistry.getObject("clay"); + public static final Block reeds = (Block)Block.blockRegistry.getObject("reeds"); + public static final Block jukebox = (Block)Block.blockRegistry.getObject("jukebox"); + public static final Block fence = (Block)Block.blockRegistry.getObject("fence"); + public static final Block pumpkin = (Block)Block.blockRegistry.getObject("pumpkin"); + public static final Block netherrack = (Block)Block.blockRegistry.getObject("netherrack"); + public static final Block soul_sand = (Block)Block.blockRegistry.getObject("soul_sand"); + public static final Block glowstone = (Block)Block.blockRegistry.getObject("glowstone"); + public static final BlockPortal portal = (BlockPortal)Block.blockRegistry.getObject("portal"); + public static final Block lit_pumpkin = (Block)Block.blockRegistry.getObject("lit_pumpkin"); + public static final Block cake = (Block)Block.blockRegistry.getObject("cake"); + public static final BlockRedstoneRepeater unpowered_repeater = (BlockRedstoneRepeater)Block.blockRegistry.getObject("unpowered_repeater"); + public static final BlockRedstoneRepeater powered_repeater = (BlockRedstoneRepeater)Block.blockRegistry.getObject("powered_repeater"); + public static final Block trapdoor = (Block)Block.blockRegistry.getObject("trapdoor"); + public static final Block monster_egg = (Block)Block.blockRegistry.getObject("monster_egg"); + public static final Block stonebrick = (Block)Block.blockRegistry.getObject("stonebrick"); + public static final Block brown_mushroom_block = (Block)Block.blockRegistry.getObject("brown_mushroom_block"); + public static final Block red_mushroom_block = (Block)Block.blockRegistry.getObject("red_mushroom_block"); + public static final Block iron_bars = (Block)Block.blockRegistry.getObject("iron_bars"); + public static final Block glass_pane = (Block)Block.blockRegistry.getObject("glass_pane"); + public static final Block melon_block = (Block)Block.blockRegistry.getObject("melon_block"); + public static final Block pumpkin_stem = (Block)Block.blockRegistry.getObject("pumpkin_stem"); + public static final Block melon_stem = (Block)Block.blockRegistry.getObject("melon_stem"); + public static final Block vine = (Block)Block.blockRegistry.getObject("vine"); + public static final Block fence_gate = (Block)Block.blockRegistry.getObject("fence_gate"); + public static final Block brick_stairs = (Block)Block.blockRegistry.getObject("brick_stairs"); + public static final Block stone_brick_stairs = (Block)Block.blockRegistry.getObject("stone_brick_stairs"); + public static final BlockMycelium mycelium = (BlockMycelium)Block.blockRegistry.getObject("mycelium"); + public static final Block waterlily = (Block)Block.blockRegistry.getObject("waterlily"); + public static final Block nether_brick = (Block)Block.blockRegistry.getObject("nether_brick"); + public static final Block nether_brick_fence = (Block)Block.blockRegistry.getObject("nether_brick_fence"); + public static final Block nether_brick_stairs = (Block)Block.blockRegistry.getObject("nether_brick_stairs"); + public static final Block nether_wart = (Block)Block.blockRegistry.getObject("nether_wart"); + public static final Block enchanting_table = (Block)Block.blockRegistry.getObject("enchanting_table"); + public static final Block brewing_stand = (Block)Block.blockRegistry.getObject("brewing_stand"); + public static final BlockCauldron cauldron = (BlockCauldron)Block.blockRegistry.getObject("cauldron"); + public static final Block end_portal = (Block)Block.blockRegistry.getObject("end_portal"); + public static final Block end_portal_frame = (Block)Block.blockRegistry.getObject("end_portal_frame"); + public static final Block end_stone = (Block)Block.blockRegistry.getObject("end_stone"); + public static final Block dragon_egg = (Block)Block.blockRegistry.getObject("dragon_egg"); + public static final Block redstone_lamp = (Block)Block.blockRegistry.getObject("redstone_lamp"); + public static final Block lit_redstone_lamp = (Block)Block.blockRegistry.getObject("lit_redstone_lamp"); + public static final BlockSlab double_wooden_slab = (BlockSlab)Block.blockRegistry.getObject("double_wooden_slab"); + public static final BlockSlab wooden_slab = (BlockSlab)Block.blockRegistry.getObject("wooden_slab"); + public static final Block cocoa = (Block)Block.blockRegistry.getObject("cocoa"); + public static final Block sandstone_stairs = (Block)Block.blockRegistry.getObject("sandstone_stairs"); + public static final Block emerald_ore = (Block)Block.blockRegistry.getObject("emerald_ore"); + public static final Block ender_chest = (Block)Block.blockRegistry.getObject("ender_chest"); + public static final BlockTripWireHook tripwire_hook = (BlockTripWireHook)Block.blockRegistry.getObject("tripwire_hook"); + public static final Block tripwire = (Block)Block.blockRegistry.getObject("tripwire"); + public static final Block emerald_block = (Block)Block.blockRegistry.getObject("emerald_block"); + public static final Block spruce_stairs = (Block)Block.blockRegistry.getObject("spruce_stairs"); + public static final Block birch_stairs = (Block)Block.blockRegistry.getObject("birch_stairs"); + public static final Block jungle_stairs = (Block)Block.blockRegistry.getObject("jungle_stairs"); + public static final Block command_block = (Block)Block.blockRegistry.getObject("command_block"); + public static final BlockBeacon beacon = (BlockBeacon)Block.blockRegistry.getObject("beacon"); + public static final Block cobblestone_wall = (Block)Block.blockRegistry.getObject("cobblestone_wall"); + public static final Block flower_pot = (Block)Block.blockRegistry.getObject("flower_pot"); + public static final Block carrots = (Block)Block.blockRegistry.getObject("carrots"); + public static final Block potatoes = (Block)Block.blockRegistry.getObject("potatoes"); + public static final Block wooden_button = (Block)Block.blockRegistry.getObject("wooden_button"); + public static final Block skull = (Block)Block.blockRegistry.getObject("skull"); + public static final Block anvil = (Block)Block.blockRegistry.getObject("anvil"); + public static final Block trapped_chest = (Block)Block.blockRegistry.getObject("trapped_chest"); + public static final Block light_weighted_pressure_plate = (Block)Block.blockRegistry.getObject("light_weighted_pressure_plate"); + public static final Block heavy_weighted_pressure_plate = (Block)Block.blockRegistry.getObject("heavy_weighted_pressure_plate"); + public static final BlockRedstoneComparator unpowered_comparator = (BlockRedstoneComparator)Block.blockRegistry.getObject("unpowered_comparator"); + public static final BlockRedstoneComparator powered_comparator = (BlockRedstoneComparator)Block.blockRegistry.getObject("powered_comparator"); + public static final BlockDaylightDetector daylight_detector = (BlockDaylightDetector)Block.blockRegistry.getObject("daylight_detector"); + public static final Block redstone_block = (Block)Block.blockRegistry.getObject("redstone_block"); + public static final Block quartz_ore = (Block)Block.blockRegistry.getObject("quartz_ore"); + public static final BlockHopper hopper = (BlockHopper)Block.blockRegistry.getObject("hopper"); + public static final Block quartz_block = (Block)Block.blockRegistry.getObject("quartz_block"); + public static final Block quartz_stairs = (Block)Block.blockRegistry.getObject("quartz_stairs"); + public static final Block activator_rail = (Block)Block.blockRegistry.getObject("activator_rail"); + public static final Block dropper = (Block)Block.blockRegistry.getObject("dropper"); + public static final Block stained_hardened_clay = (Block)Block.blockRegistry.getObject("stained_hardened_clay"); + public static final Block hay_block = (Block)Block.blockRegistry.getObject("hay_block"); + public static final Block carpet = (Block)Block.blockRegistry.getObject("carpet"); + public static final Block hardened_clay = (Block)Block.blockRegistry.getObject("hardened_clay"); + public static final Block coal_block = (Block)Block.blockRegistry.getObject("coal_block"); + public static final Block packed_ice = (Block)Block.blockRegistry.getObject("packed_ice"); + public static final Block acacia_stairs = (Block)Block.blockRegistry.getObject("acacia_stairs"); + public static final Block dark_oak_stairs = (Block)Block.blockRegistry.getObject("dark_oak_stairs"); + public static final BlockDoublePlant double_plant = (BlockDoublePlant)Block.blockRegistry.getObject("double_plant"); + public static final BlockStainedGlass stained_glass = (BlockStainedGlass)Block.blockRegistry.getObject("stained_glass"); + public static final BlockStainedGlassPane stained_glass_pane = (BlockStainedGlassPane)Block.blockRegistry.getObject("stained_glass_pane"); + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Bootstrap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Bootstrap.java new file mode 100644 index 0000000..e4c2b1a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Bootstrap.java @@ -0,0 +1,327 @@ +package net.minecraft.init; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockFire; +import net.minecraft.block.material.Material; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.BehaviorProjectileDispense; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemMonsterPlacer; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class Bootstrap { + private static boolean field_151355_a = false; + + + static void func_151353_a() { + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.arrow, new BehaviorProjectileDispense() { + + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + EntityArrow var3 = new EntityArrow(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + var3.canBePickedUp = 1; + return var3; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.egg, new BehaviorProjectileDispense() { + + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityEgg(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.snowball, new BehaviorProjectileDispense() { + + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntitySnowball(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.experience_bottle, new BehaviorProjectileDispense() { + + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityExpBottle(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ()); + } + protected float func_82498_a() { + return super.func_82498_a() * 0.5F; + } + protected float func_82500_b() { + return super.func_82500_b() * 1.25F; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.potionitem, new IBehaviorDispenseItem() { + private final BehaviorDefaultDispenseItem field_150843_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispense(IBlockSource p_82482_1_, final ItemStack p_82482_2_) { + return ItemPotion.isSplash(p_82482_2_.getItemDamage()) ? (new BehaviorProjectileDispense() { + + protected IProjectile getProjectileEntity(World p_82499_1_, IPosition p_82499_2_) { + return new EntityPotion(p_82499_1_, p_82499_2_.getX(), p_82499_2_.getY(), p_82499_2_.getZ(), p_82482_2_.copy()); + } + protected float func_82498_a() { + return super.func_82498_a() * 0.5F; + } + protected float func_82500_b() { + return super.func_82500_b() * 1.25F; + } + }).dispense(p_82482_1_, p_82482_2_): this.field_150843_b.dispense(p_82482_1_, p_82482_2_); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.spawn_egg, new BehaviorDefaultDispenseItem() { + + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + double var4 = p_82487_1_.getX() + (double)var3.getFrontOffsetX(); + double var6 = (float)p_82487_1_.getYInt() + 0.2F; + double var8 = p_82487_1_.getZ() + (double)var3.getFrontOffsetZ(); + Entity var10 = ItemMonsterPlacer.spawnCreature(p_82487_1_.getWorld(), p_82487_2_.getItemDamage(), var4, var6, var8); + + if (var10 instanceof EntityLivingBase && p_82487_2_.hasDisplayName()) { + ((EntityLiving)var10).setCustomNameTag(p_82487_2_.getDisplayName()); + } + + p_82487_2_.splitStack(1); + return p_82487_2_; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fireworks, new BehaviorDefaultDispenseItem() { + + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + double var4 = p_82487_1_.getX() + (double)var3.getFrontOffsetX(); + double var6 = (float)p_82487_1_.getYInt() + 0.2F; + double var8 = p_82487_1_.getZ() + (double)var3.getFrontOffsetZ(); + EntityFireworkRocket var10 = new EntityFireworkRocket(p_82487_1_.getWorld(), var4, var6, var8, p_82487_2_); + p_82487_1_.getWorld().spawnEntityInWorld(var10); + p_82487_2_.splitStack(1); + return p_82487_2_; + } + protected void playDispenseSound(IBlockSource p_82485_1_) { + p_82485_1_.getWorld().playAuxSFX(1002, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fire_charge, new BehaviorDefaultDispenseItem() { + + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + IPosition var4 = BlockDispenser.func_149939_a(p_82487_1_); + double var5 = var4.getX() + (double)((float)var3.getFrontOffsetX() * 0.3F); + double var7 = var4.getY() + (double)((float)var3.getFrontOffsetX() * 0.3F); + double var9 = var4.getZ() + (double)((float)var3.getFrontOffsetZ() * 0.3F); + World var11 = p_82487_1_.getWorld(); + Random var12 = var11.rand; + double var13 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetX(); + double var15 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetY(); + double var17 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetZ(); + var11.spawnEntityInWorld(new EntitySmallFireball(var11, var5, var7, var9, var13, var15, var17)); + p_82487_2_.splitStack(1); + return p_82487_2_; + } + protected void playDispenseSound(IBlockSource p_82485_1_) { + p_82485_1_.getWorld().playAuxSFX(1009, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.boat, new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem field_150842_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + World var4 = p_82487_1_.getWorld(); + double var5 = p_82487_1_.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); + double var7 = p_82487_1_.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); + double var9 = p_82487_1_.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); + int var11 = p_82487_1_.getXInt() + var3.getFrontOffsetX(); + int var12 = p_82487_1_.getYInt() + var3.getFrontOffsetY(); + int var13 = p_82487_1_.getZInt() + var3.getFrontOffsetZ(); + Material var14 = var4.getBlock(var11, var12, var13).getMaterial(); + double var15; + + if (Material.water.equals(var14)) { + var15 = 1.0D; + } else { + if (!Material.air.equals(var14) || !Material.water.equals(var4.getBlock(var11, var12 - 1, var13).getMaterial())) { + return this.field_150842_b.dispense(p_82487_1_, p_82487_2_); + } + + var15 = 0.0D; + } + + EntityBoat var17 = new EntityBoat(var4, var5, var7 + var15, var9); + var4.spawnEntityInWorld(var17); + p_82487_2_.splitStack(1); + return p_82487_2_; + } + protected void playDispenseSound(IBlockSource p_82485_1_) { + p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + }); + BehaviorDefaultDispenseItem var0 = new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem field_150841_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + ItemBucket var3 = (ItemBucket)p_82487_2_.getItem(); + int var4 = p_82487_1_.getXInt(); + int var5 = p_82487_1_.getYInt(); + int var6 = p_82487_1_.getZInt(); + EnumFacing var7 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + + if (var3.tryPlaceContainedLiquid(p_82487_1_.getWorld(), var4 + var7.getFrontOffsetX(), var5 + var7.getFrontOffsetY(), var6 + var7.getFrontOffsetZ())) { + p_82487_2_.func_150996_a(Items.bucket); + p_82487_2_.stackSize = 1; + return p_82487_2_; + } else { + return this.field_150841_b.dispense(p_82487_1_, p_82487_2_); + } + } + }; + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.lava_bucket, var0); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.water_bucket, var0); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + World var4 = p_82487_1_.getWorld(); + int var5 = p_82487_1_.getXInt() + var3.getFrontOffsetX(); + int var6 = p_82487_1_.getYInt() + var3.getFrontOffsetY(); + int var7 = p_82487_1_.getZInt() + var3.getFrontOffsetZ(); + Material var8 = var4.getBlock(var5, var6, var7).getMaterial(); + int var9 = var4.getBlockMetadata(var5, var6, var7); + Item var10; + + if (Material.water.equals(var8) && var9 == 0) { + var10 = Items.water_bucket; + } else { + if (!Material.lava.equals(var8) || var9 != 0) { + return super.dispenseStack(p_82487_1_, p_82487_2_); + } + + var10 = Items.lava_bucket; + } + + var4.setBlockToAir(var5, var6, var7); + + if (--p_82487_2_.stackSize == 0) { + p_82487_2_.func_150996_a(var10); + p_82487_2_.stackSize = 1; + } else if (((TileEntityDispenser)p_82487_1_.getBlockTileEntity()).func_146019_a(new ItemStack(var10)) < 0) { + this.field_150840_b.dispense(p_82487_1_, new ItemStack(var10)); + } + + return p_82487_2_; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.flint_and_steel, new BehaviorDefaultDispenseItem() { + private boolean field_150839_b = true; + + protected ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + World var4 = p_82487_1_.getWorld(); + int var5 = p_82487_1_.getXInt() + var3.getFrontOffsetX(); + int var6 = p_82487_1_.getYInt() + var3.getFrontOffsetY(); + int var7 = p_82487_1_.getZInt() + var3.getFrontOffsetZ(); + + if (var4.isAirBlock(var5, var6, var7)) { + var4.setBlock(var5, var6, var7, Blocks.fire); + + if (p_82487_2_.attemptDamageItem(1, var4.rand)) { + p_82487_2_.stackSize = 0; + } + } else if (var4.getBlock(var5, var6, var7) == Blocks.tnt) { + Blocks.tnt.onBlockDestroyedByPlayer(var4, var5, var6, var7, 1); + var4.setBlockToAir(var5, var6, var7); + } else { + this.field_150839_b = false; + } + + return p_82487_2_; + } + protected void playDispenseSound(IBlockSource p_82485_1_) { + if (this.field_150839_b) { + p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } else { + p_82485_1_.getWorld().playAuxSFX(1001, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.dye, new BehaviorDefaultDispenseItem() { + private boolean field_150838_b = true; + + protected ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + if (p_82487_2_.getItemDamage() == 15) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + World var4 = p_82487_1_.getWorld(); + int var5 = p_82487_1_.getXInt() + var3.getFrontOffsetX(); + int var6 = p_82487_1_.getYInt() + var3.getFrontOffsetY(); + int var7 = p_82487_1_.getZInt() + var3.getFrontOffsetZ(); + + if (ItemDye.func_150919_a(p_82487_2_, var4, var5, var6, var7)) { + if (!var4.isClient) { + var4.playAuxSFX(2005, var5, var6, var7, 0); + } + } else { + this.field_150838_b = false; + } + + return p_82487_2_; + } else { + return super.dispenseStack(p_82487_1_, p_82487_2_); + } + } + protected void playDispenseSound(IBlockSource p_82485_1_) { + if (this.field_150838_b) { + p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } else { + p_82485_1_.getWorld().playAuxSFX(1001, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Item.getItemFromBlock(Blocks.tnt), new BehaviorDefaultDispenseItem() { + + protected ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + World var4 = p_82487_1_.getWorld(); + int var5 = p_82487_1_.getXInt() + var3.getFrontOffsetX(); + int var6 = p_82487_1_.getYInt() + var3.getFrontOffsetY(); + int var7 = p_82487_1_.getZInt() + var3.getFrontOffsetZ(); + EntityTNTPrimed var8 = new EntityTNTPrimed(var4, (float)var5 + 0.5F, (float)var6 + 0.5F, (float)var7 + 0.5F, null); + var4.spawnEntityInWorld(var8); + --p_82487_2_.stackSize; + return p_82487_2_; + } + }); + } + + public static void func_151354_b() { + if (!field_151355_a) { + field_151355_a = true; + Block.registerBlocks(); + BlockFire.func_149843_e(); + Item.registerItems(); + StatList.func_151178_a(); + func_151353_a(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Items.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Items.java new file mode 100644 index 0000000..8894100 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/init/Items.java @@ -0,0 +1,186 @@ +package net.minecraft.init; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemEmptyMap; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.item.ItemFishingRod; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemShears; + +public class Items { + public static final Item iron_shovel = (Item)Item.itemRegistry.getObject("iron_shovel"); + public static final Item iron_pickaxe = (Item)Item.itemRegistry.getObject("iron_pickaxe"); + public static final Item iron_axe = (Item)Item.itemRegistry.getObject("iron_axe"); + public static final Item flint_and_steel = (Item)Item.itemRegistry.getObject("flint_and_steel"); + public static final Item apple = (Item)Item.itemRegistry.getObject("apple"); + public static final ItemBow bow = (ItemBow)Item.itemRegistry.getObject("bow"); + public static final Item arrow = (Item)Item.itemRegistry.getObject("arrow"); + public static final Item coal = (Item)Item.itemRegistry.getObject("coal"); + public static final Item diamond = (Item)Item.itemRegistry.getObject("diamond"); + public static final Item iron_ingot = (Item)Item.itemRegistry.getObject("iron_ingot"); + public static final Item gold_ingot = (Item)Item.itemRegistry.getObject("gold_ingot"); + public static final Item iron_sword = (Item)Item.itemRegistry.getObject("iron_sword"); + public static final Item wooden_sword = (Item)Item.itemRegistry.getObject("wooden_sword"); + public static final Item wooden_shovel = (Item)Item.itemRegistry.getObject("wooden_shovel"); + public static final Item wooden_pickaxe = (Item)Item.itemRegistry.getObject("wooden_pickaxe"); + public static final Item wooden_axe = (Item)Item.itemRegistry.getObject("wooden_axe"); + public static final Item stone_sword = (Item)Item.itemRegistry.getObject("stone_sword"); + public static final Item stone_shovel = (Item)Item.itemRegistry.getObject("stone_shovel"); + public static final Item stone_pickaxe = (Item)Item.itemRegistry.getObject("stone_pickaxe"); + public static final Item stone_axe = (Item)Item.itemRegistry.getObject("stone_axe"); + public static final Item diamond_sword = (Item)Item.itemRegistry.getObject("diamond_sword"); + public static final Item diamond_shovel = (Item)Item.itemRegistry.getObject("diamond_shovel"); + public static final Item diamond_pickaxe = (Item)Item.itemRegistry.getObject("diamond_pickaxe"); + public static final Item diamond_axe = (Item)Item.itemRegistry.getObject("diamond_axe"); + public static final Item stick = (Item)Item.itemRegistry.getObject("stick"); + public static final Item bowl = (Item)Item.itemRegistry.getObject("bowl"); + public static final Item mushroom_stew = (Item)Item.itemRegistry.getObject("mushroom_stew"); + public static final Item golden_sword = (Item)Item.itemRegistry.getObject("golden_sword"); + public static final Item golden_shovel = (Item)Item.itemRegistry.getObject("golden_shovel"); + public static final Item golden_pickaxe = (Item)Item.itemRegistry.getObject("golden_pickaxe"); + public static final Item golden_axe = (Item)Item.itemRegistry.getObject("golden_axe"); + public static final Item string = (Item)Item.itemRegistry.getObject("string"); + public static final Item feather = (Item)Item.itemRegistry.getObject("feather"); + public static final Item gunpowder = (Item)Item.itemRegistry.getObject("gunpowder"); + public static final Item wooden_hoe = (Item)Item.itemRegistry.getObject("wooden_hoe"); + public static final Item stone_hoe = (Item)Item.itemRegistry.getObject("stone_hoe"); + public static final Item iron_hoe = (Item)Item.itemRegistry.getObject("iron_hoe"); + public static final Item diamond_hoe = (Item)Item.itemRegistry.getObject("diamond_hoe"); + public static final Item golden_hoe = (Item)Item.itemRegistry.getObject("golden_hoe"); + public static final Item wheat_seeds = (Item)Item.itemRegistry.getObject("wheat_seeds"); + public static final Item wheat = (Item)Item.itemRegistry.getObject("wheat"); + public static final Item bread = (Item)Item.itemRegistry.getObject("bread"); + public static final ItemArmor leather_helmet = (ItemArmor)Item.itemRegistry.getObject("leather_helmet"); + public static final ItemArmor leather_chestplate = (ItemArmor)Item.itemRegistry.getObject("leather_chestplate"); + public static final ItemArmor leather_leggings = (ItemArmor)Item.itemRegistry.getObject("leather_leggings"); + public static final ItemArmor leather_boots = (ItemArmor)Item.itemRegistry.getObject("leather_boots"); + public static final ItemArmor chainmail_helmet = (ItemArmor)Item.itemRegistry.getObject("chainmail_helmet"); + public static final ItemArmor chainmail_chestplate = (ItemArmor)Item.itemRegistry.getObject("chainmail_chestplate"); + public static final ItemArmor chainmail_leggings = (ItemArmor)Item.itemRegistry.getObject("chainmail_leggings"); + public static final ItemArmor chainmail_boots = (ItemArmor)Item.itemRegistry.getObject("chainmail_boots"); + public static final ItemArmor iron_helmet = (ItemArmor)Item.itemRegistry.getObject("iron_helmet"); + public static final ItemArmor iron_chestplate = (ItemArmor)Item.itemRegistry.getObject("iron_chestplate"); + public static final ItemArmor iron_leggings = (ItemArmor)Item.itemRegistry.getObject("iron_leggings"); + public static final ItemArmor iron_boots = (ItemArmor)Item.itemRegistry.getObject("iron_boots"); + public static final ItemArmor diamond_helmet = (ItemArmor)Item.itemRegistry.getObject("diamond_helmet"); + public static final ItemArmor diamond_chestplate = (ItemArmor)Item.itemRegistry.getObject("diamond_chestplate"); + public static final ItemArmor diamond_leggings = (ItemArmor)Item.itemRegistry.getObject("diamond_leggings"); + public static final ItemArmor diamond_boots = (ItemArmor)Item.itemRegistry.getObject("diamond_boots"); + public static final ItemArmor golden_helmet = (ItemArmor)Item.itemRegistry.getObject("golden_helmet"); + public static final ItemArmor golden_chestplate = (ItemArmor)Item.itemRegistry.getObject("golden_chestplate"); + public static final ItemArmor golden_leggings = (ItemArmor)Item.itemRegistry.getObject("golden_leggings"); + public static final ItemArmor golden_boots = (ItemArmor)Item.itemRegistry.getObject("golden_boots"); + public static final Item flint = (Item)Item.itemRegistry.getObject("flint"); + public static final Item porkchop = (Item)Item.itemRegistry.getObject("porkchop"); + public static final Item cooked_porkchop = (Item)Item.itemRegistry.getObject("cooked_porkchop"); + public static final Item painting = (Item)Item.itemRegistry.getObject("painting"); + public static final Item golden_apple = (Item)Item.itemRegistry.getObject("golden_apple"); + public static final Item sign = (Item)Item.itemRegistry.getObject("sign"); + public static final Item wooden_door = (Item)Item.itemRegistry.getObject("wooden_door"); + public static final Item bucket = (Item)Item.itemRegistry.getObject("bucket"); + public static final Item water_bucket = (Item)Item.itemRegistry.getObject("water_bucket"); + public static final Item lava_bucket = (Item)Item.itemRegistry.getObject("lava_bucket"); + public static final Item minecart = (Item)Item.itemRegistry.getObject("minecart"); + public static final Item saddle = (Item)Item.itemRegistry.getObject("saddle"); + public static final Item iron_door = (Item)Item.itemRegistry.getObject("iron_door"); + public static final Item redstone = (Item)Item.itemRegistry.getObject("redstone"); + public static final Item snowball = (Item)Item.itemRegistry.getObject("snowball"); + public static final Item boat = (Item)Item.itemRegistry.getObject("boat"); + public static final Item leather = (Item)Item.itemRegistry.getObject("leather"); + public static final Item milk_bucket = (Item)Item.itemRegistry.getObject("milk_bucket"); + public static final Item brick = (Item)Item.itemRegistry.getObject("brick"); + public static final Item clay_ball = (Item)Item.itemRegistry.getObject("clay_ball"); + public static final Item reeds = (Item)Item.itemRegistry.getObject("reeds"); + public static final Item paper = (Item)Item.itemRegistry.getObject("paper"); + public static final Item book = (Item)Item.itemRegistry.getObject("book"); + public static final Item slime_ball = (Item)Item.itemRegistry.getObject("slime_ball"); + public static final Item chest_minecart = (Item)Item.itemRegistry.getObject("chest_minecart"); + public static final Item furnace_minecart = (Item)Item.itemRegistry.getObject("furnace_minecart"); + public static final Item egg = (Item)Item.itemRegistry.getObject("egg"); + public static final Item compass = (Item)Item.itemRegistry.getObject("compass"); + public static final ItemFishingRod fishing_rod = (ItemFishingRod)Item.itemRegistry.getObject("fishing_rod"); + public static final Item clock = (Item)Item.itemRegistry.getObject("clock"); + public static final Item glowstone_dust = (Item)Item.itemRegistry.getObject("glowstone_dust"); + public static final Item fish = (Item)Item.itemRegistry.getObject("fish"); + public static final Item cooked_fished = (Item)Item.itemRegistry.getObject("cooked_fished"); + public static final Item dye = (Item)Item.itemRegistry.getObject("dye"); + public static final Item bone = (Item)Item.itemRegistry.getObject("bone"); + public static final Item sugar = (Item)Item.itemRegistry.getObject("sugar"); + public static final Item cake = (Item)Item.itemRegistry.getObject("cake"); + public static final Item bed = (Item)Item.itemRegistry.getObject("bed"); + public static final Item repeater = (Item)Item.itemRegistry.getObject("repeater"); + public static final Item cookie = (Item)Item.itemRegistry.getObject("cookie"); + public static final ItemMap filled_map = (ItemMap)Item.itemRegistry.getObject("filled_map"); + public static final ItemShears shears = (ItemShears)Item.itemRegistry.getObject("shears"); + public static final Item melon = (Item)Item.itemRegistry.getObject("melon"); + public static final Item pumpkin_seeds = (Item)Item.itemRegistry.getObject("pumpkin_seeds"); + public static final Item melon_seeds = (Item)Item.itemRegistry.getObject("melon_seeds"); + public static final Item beef = (Item)Item.itemRegistry.getObject("beef"); + public static final Item cooked_beef = (Item)Item.itemRegistry.getObject("cooked_beef"); + public static final Item chicken = (Item)Item.itemRegistry.getObject("chicken"); + public static final Item cooked_chicken = (Item)Item.itemRegistry.getObject("cooked_chicken"); + public static final Item rotten_flesh = (Item)Item.itemRegistry.getObject("rotten_flesh"); + public static final Item ender_pearl = (Item)Item.itemRegistry.getObject("ender_pearl"); + public static final Item blaze_rod = (Item)Item.itemRegistry.getObject("blaze_rod"); + public static final Item ghast_tear = (Item)Item.itemRegistry.getObject("ghast_tear"); + public static final Item gold_nugget = (Item)Item.itemRegistry.getObject("gold_nugget"); + public static final Item nether_wart = (Item)Item.itemRegistry.getObject("nether_wart"); + public static final ItemPotion potionitem = (ItemPotion)Item.itemRegistry.getObject("potion"); + public static final Item glass_bottle = (Item)Item.itemRegistry.getObject("glass_bottle"); + public static final Item spider_eye = (Item)Item.itemRegistry.getObject("spider_eye"); + public static final Item fermented_spider_eye = (Item)Item.itemRegistry.getObject("fermented_spider_eye"); + public static final Item blaze_powder = (Item)Item.itemRegistry.getObject("blaze_powder"); + public static final Item magma_cream = (Item)Item.itemRegistry.getObject("magma_cream"); + public static final Item brewing_stand = (Item)Item.itemRegistry.getObject("brewing_stand"); + public static final Item cauldron = (Item)Item.itemRegistry.getObject("cauldron"); + public static final Item ender_eye = (Item)Item.itemRegistry.getObject("ender_eye"); + public static final Item speckled_melon = (Item)Item.itemRegistry.getObject("speckled_melon"); + public static final Item spawn_egg = (Item)Item.itemRegistry.getObject("spawn_egg"); + public static final Item experience_bottle = (Item)Item.itemRegistry.getObject("experience_bottle"); + public static final Item fire_charge = (Item)Item.itemRegistry.getObject("fire_charge"); + public static final Item writable_book = (Item)Item.itemRegistry.getObject("writable_book"); + public static final Item written_book = (Item)Item.itemRegistry.getObject("written_book"); + public static final Item emerald = (Item)Item.itemRegistry.getObject("emerald"); + public static final Item item_frame = (Item)Item.itemRegistry.getObject("item_frame"); + public static final Item flower_pot = (Item)Item.itemRegistry.getObject("flower_pot"); + public static final Item carrot = (Item)Item.itemRegistry.getObject("carrot"); + public static final Item potato = (Item)Item.itemRegistry.getObject("potato"); + public static final Item baked_potato = (Item)Item.itemRegistry.getObject("baked_potato"); + public static final Item poisonous_potato = (Item)Item.itemRegistry.getObject("poisonous_potato"); + public static final ItemEmptyMap map = (ItemEmptyMap)Item.itemRegistry.getObject("map"); + public static final Item golden_carrot = (Item)Item.itemRegistry.getObject("golden_carrot"); + public static final Item skull = (Item)Item.itemRegistry.getObject("skull"); + public static final Item carrot_on_a_stick = (Item)Item.itemRegistry.getObject("carrot_on_a_stick"); + public static final Item nether_star = (Item)Item.itemRegistry.getObject("nether_star"); + public static final Item pumpkin_pie = (Item)Item.itemRegistry.getObject("pumpkin_pie"); + public static final Item fireworks = (Item)Item.itemRegistry.getObject("fireworks"); + public static final Item firework_charge = (Item)Item.itemRegistry.getObject("firework_charge"); + public static final ItemEnchantedBook enchanted_book = (ItemEnchantedBook)Item.itemRegistry.getObject("enchanted_book"); + public static final Item comparator = (Item)Item.itemRegistry.getObject("comparator"); + public static final Item netherbrick = (Item)Item.itemRegistry.getObject("netherbrick"); + public static final Item quartz = (Item)Item.itemRegistry.getObject("quartz"); + public static final Item tnt_minecart = (Item)Item.itemRegistry.getObject("tnt_minecart"); + public static final Item hopper_minecart = (Item)Item.itemRegistry.getObject("hopper_minecart"); + public static final Item iron_horse_armor = (Item)Item.itemRegistry.getObject("iron_horse_armor"); + public static final Item golden_horse_armor = (Item)Item.itemRegistry.getObject("golden_horse_armor"); + public static final Item diamond_horse_armor = (Item)Item.itemRegistry.getObject("diamond_horse_armor"); + public static final Item lead = (Item)Item.itemRegistry.getObject("lead"); + public static final Item name_tag = (Item)Item.itemRegistry.getObject("name_tag"); + public static final Item command_block_minecart = (Item)Item.itemRegistry.getObject("command_block_minecart"); + public static final Item record_13 = (Item)Item.itemRegistry.getObject("record_13"); + public static final Item record_cat = (Item)Item.itemRegistry.getObject("record_cat"); + public static final Item record_blocks = (Item)Item.itemRegistry.getObject("record_blocks"); + public static final Item record_chirp = (Item)Item.itemRegistry.getObject("record_chirp"); + public static final Item record_far = (Item)Item.itemRegistry.getObject("record_far"); + public static final Item record_mall = (Item)Item.itemRegistry.getObject("record_mall"); + public static final Item record_mellohi = (Item)Item.itemRegistry.getObject("record_mellohi"); + public static final Item record_stal = (Item)Item.itemRegistry.getObject("record_stal"); + public static final Item record_strad = (Item)Item.itemRegistry.getObject("record_strad"); + public static final Item record_ward = (Item)Item.itemRegistry.getObject("record_ward"); + public static final Item record_11 = (Item)Item.itemRegistry.getObject("record_11"); + public static final Item record_wait = (Item)Item.itemRegistry.getObject("record_wait"); + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/AnimalChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/AnimalChest.java new file mode 100644 index 0000000..a248cf2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/AnimalChest.java @@ -0,0 +1,13 @@ +package net.minecraft.inventory; + +public class AnimalChest extends InventoryBasic { + + + public AnimalChest(String p_i1796_1_, int p_i1796_2_) { + super(p_i1796_1_, false, p_i1796_2_); + } + + public AnimalChest(String p_i1797_1_, boolean p_i1797_2_, int p_i1797_3_) { + super(p_i1797_1_, p_i1797_2_, p_i1797_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/Container.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/Container.java new file mode 100644 index 0000000..af18564 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/Container.java @@ -0,0 +1,621 @@ +package net.minecraft.inventory; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +public abstract class Container { + /** the list of all items(stacks) for the corresponding slot */ + public List inventoryItemStacks = new ArrayList(); + + /** the list of all slots in the inventory */ + public List inventorySlots = new ArrayList(); + public int windowId; + private short transactionID; + private int field_94535_f = -1; + private int field_94536_g; + private final Set field_94537_h = new HashSet(); + + /** + * list of all people that need to be notified when this craftinventory changes + */ + protected List crafters = new ArrayList(); + private final Set playerList = new HashSet(); + + + /** + * the slot is assumed empty + */ + protected Slot addSlotToContainer(Slot p_75146_1_) { + p_75146_1_.slotNumber = this.inventorySlots.size(); + this.inventorySlots.add(p_75146_1_); + this.inventoryItemStacks.add(null); + return p_75146_1_; + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) { + if (this.crafters.contains(p_75132_1_)) { + throw new IllegalArgumentException("Listener already listening"); + } else { + this.crafters.add(p_75132_1_); + p_75132_1_.sendContainerAndContentsToPlayer(this, this.getInventory()); + this.detectAndSendChanges(); + } + } + + /** + * Remove this crafting listener from the listener list. + */ + public void removeCraftingFromCrafters(ICrafting p_82847_1_) { + this.crafters.remove(p_82847_1_); + } + + /** + * returns a list if itemStacks, for each slot. + */ + public List getInventory() { + ArrayList var1 = new ArrayList(); + + for (int var2 = 0; var2 < this.inventorySlots.size(); ++var2) { + var1.add(((Slot)this.inventorySlots.get(var2)).getStack()); + } + + return var1; + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() { + for (int var1 = 0; var1 < this.inventorySlots.size(); ++var1) { + ItemStack var2 = ((Slot)this.inventorySlots.get(var1)).getStack(); + ItemStack var3 = (ItemStack)this.inventoryItemStacks.get(var1); + + if (!ItemStack.areItemStacksEqual(var3, var2)) { + var3 = var2 == null ? null : var2.copy(); + this.inventoryItemStacks.set(var1, var3); + + for (int var4 = 0; var4 < this.crafters.size(); ++var4) { + ((ICrafting)this.crafters.get(var4)).sendSlotContents(this, var1, var3); + } + } + } + } + + /** + * enchants the item on the table using the specified slot; also deducts XP from player + */ + public boolean enchantItem(EntityPlayer p_75140_1_, int p_75140_2_) { + return false; + } + + public Slot getSlotFromInventory(IInventory p_75147_1_, int p_75147_2_) { + for (int var3 = 0; var3 < this.inventorySlots.size(); ++var3) { + Slot var4 = (Slot)this.inventorySlots.get(var3); + + if (var4.isSlotInInventory(p_75147_1_, p_75147_2_)) { + return var4; + } + } + + return null; + } + + public Slot getSlot(int p_75139_1_) { + return (Slot)this.inventorySlots.get(p_75139_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + Slot var3 = (Slot)this.inventorySlots.get(p_82846_2_); + return var3 != null ? var3.getStack() : null; + } + + public ItemStack slotClick(int p_75144_1_, int p_75144_2_, int p_75144_3_, EntityPlayer p_75144_4_) { + ItemStack var5 = null; + InventoryPlayer var6 = p_75144_4_.inventory; + int var9; + ItemStack var17; + + if (p_75144_3_ == 5) { + int var7 = this.field_94536_g; + this.field_94536_g = func_94532_c(p_75144_2_); + + if ((var7 != 1 || this.field_94536_g != 2) && var7 != this.field_94536_g) { + this.func_94533_d(); + } else if (var6.getItemStack() == null) { + this.func_94533_d(); + } else if (this.field_94536_g == 0) { + this.field_94535_f = func_94529_b(p_75144_2_); + + if (func_94528_d(this.field_94535_f)) { + this.field_94536_g = 1; + this.field_94537_h.clear(); + } else { + this.func_94533_d(); + } + } else if (this.field_94536_g == 1) { + Slot var8 = (Slot)this.inventorySlots.get(p_75144_1_); + + if (var8 != null && func_94527_a(var8, var6.getItemStack(), true) && var8.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize > this.field_94537_h.size() && this.canDragIntoSlot(var8)) { + this.field_94537_h.add(var8); + } + } else if (this.field_94536_g == 2) { + if (!this.field_94537_h.isEmpty()) { + var17 = var6.getItemStack().copy(); + var9 = var6.getItemStack().stackSize; + Iterator var10 = this.field_94537_h.iterator(); + + while (var10.hasNext()) { + Slot var11 = (Slot)var10.next(); + + if (var11 != null && func_94527_a(var11, var6.getItemStack(), true) && var11.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize >= this.field_94537_h.size() && this.canDragIntoSlot(var11)) { + ItemStack var12 = var17.copy(); + int var13 = var11.getHasStack() ? var11.getStack().stackSize : 0; + func_94525_a(this.field_94537_h, this.field_94535_f, var12, var13); + + if (var12.stackSize > var12.getMaxStackSize()) { + var12.stackSize = var12.getMaxStackSize(); + } + + if (var12.stackSize > var11.getSlotStackLimit()) { + var12.stackSize = var11.getSlotStackLimit(); + } + + var9 -= var12.stackSize - var13; + var11.putStack(var12); + } + } + + var17.stackSize = var9; + + if (var17.stackSize <= 0) { + var17 = null; + } + + var6.setItemStack(var17); + } + + this.func_94533_d(); + } else { + this.func_94533_d(); + } + } else if (this.field_94536_g != 0) { + this.func_94533_d(); + } else { + Slot var16; + int var21; + ItemStack var23; + + if ((p_75144_3_ == 0 || p_75144_3_ == 1) && (p_75144_2_ == 0 || p_75144_2_ == 1)) { + if (p_75144_1_ == -999) { + if (var6.getItemStack() != null && p_75144_1_ == -999) { + if (p_75144_2_ == 0) { + p_75144_4_.dropPlayerItemWithRandomChoice(var6.getItemStack(), true); + var6.setItemStack(null); + } + + if (p_75144_2_ == 1) { + p_75144_4_.dropPlayerItemWithRandomChoice(var6.getItemStack().splitStack(1), true); + + if (var6.getItemStack().stackSize == 0) { + var6.setItemStack(null); + } + } + } + } else if (p_75144_3_ == 1) { + if (p_75144_1_ < 0) { + return null; + } + + var16 = (Slot)this.inventorySlots.get(p_75144_1_); + + if (var16 != null && var16.canTakeStack(p_75144_4_)) { + var17 = this.transferStackInSlot(p_75144_4_, p_75144_1_); + + if (var17 != null) { + Item var19 = var17.getItem(); + var5 = var17.copy(); + + if (var16.getStack() != null && var16.getStack().getItem() == var19) { + this.retrySlotClick(p_75144_1_, p_75144_2_, true, p_75144_4_); + } + } + } + } else { + if (p_75144_1_ < 0) { + return null; + } + + var16 = (Slot)this.inventorySlots.get(p_75144_1_); + + if (var16 != null) { + var17 = var16.getStack(); + ItemStack var20 = var6.getItemStack(); + + if (var17 != null) { + var5 = var17.copy(); + } + + if (var17 == null) { + if (var20 != null && var16.isItemValid(var20)) { + var21 = p_75144_2_ == 0 ? var20.stackSize : 1; + + if (var21 > var16.getSlotStackLimit()) { + var21 = var16.getSlotStackLimit(); + } + + if (var20.stackSize >= var21) { + var16.putStack(var20.splitStack(var21)); + } + + if (var20.stackSize == 0) { + var6.setItemStack(null); + } + } + } else if (var16.canTakeStack(p_75144_4_)) { + if (var20 == null) { + var21 = p_75144_2_ == 0 ? var17.stackSize : (var17.stackSize + 1) / 2; + var23 = var16.decrStackSize(var21); + var6.setItemStack(var23); + + if (var17.stackSize == 0) { + var16.putStack(null); + } + + var16.onPickupFromSlot(p_75144_4_, var6.getItemStack()); + } else if (var16.isItemValid(var20)) { + if (var17.getItem() == var20.getItem() && var17.getItemDamage() == var20.getItemDamage() && ItemStack.areItemStackTagsEqual(var17, var20)) { + var21 = p_75144_2_ == 0 ? var20.stackSize : 1; + + if (var21 > var16.getSlotStackLimit() - var17.stackSize) { + var21 = var16.getSlotStackLimit() - var17.stackSize; + } + + if (var21 > var20.getMaxStackSize() - var17.stackSize) { + var21 = var20.getMaxStackSize() - var17.stackSize; + } + + var20.splitStack(var21); + + if (var20.stackSize == 0) { + var6.setItemStack(null); + } + + var17.stackSize += var21; + } else if (var20.stackSize <= var16.getSlotStackLimit()) { + var16.putStack(var20); + var6.setItemStack(var17); + } + } else if (var17.getItem() == var20.getItem() && var20.getMaxStackSize() > 1 && (!var17.getHasSubtypes() || var17.getItemDamage() == var20.getItemDamage()) && ItemStack.areItemStackTagsEqual(var17, var20)) { + var21 = var17.stackSize; + + if (var21 > 0 && var21 + var20.stackSize <= var20.getMaxStackSize()) { + var20.stackSize += var21; + var17 = var16.decrStackSize(var21); + + if (var17.stackSize == 0) { + var16.putStack(null); + } + + var16.onPickupFromSlot(p_75144_4_, var6.getItemStack()); + } + } + } + + var16.onSlotChanged(); + } + } + } else if (p_75144_3_ == 2 && p_75144_2_ >= 0 && p_75144_2_ < 9) { + var16 = (Slot)this.inventorySlots.get(p_75144_1_); + + if (var16.canTakeStack(p_75144_4_)) { + var17 = var6.getStackInSlot(p_75144_2_); + boolean var18 = var17 == null || var16.inventory == var6 && var16.isItemValid(var17); + var21 = -1; + + if (!var18) { + var21 = var6.getFirstEmptyStack(); + var18 |= var21 > -1; + } + + if (var16.getHasStack() && var18) { + var23 = var16.getStack(); + var6.setInventorySlotContents(p_75144_2_, var23.copy()); + + if ((var16.inventory != var6 || !var16.isItemValid(var17)) && var17 != null) { + if (var21 > -1) { + var6.addItemStackToInventory(var17); + var16.decrStackSize(var23.stackSize); + var16.putStack(null); + var16.onPickupFromSlot(p_75144_4_, var23); + } + } else { + var16.decrStackSize(var23.stackSize); + var16.putStack(var17); + var16.onPickupFromSlot(p_75144_4_, var23); + } + } else if (!var16.getHasStack() && var17 != null && var16.isItemValid(var17)) { + var6.setInventorySlotContents(p_75144_2_, null); + var16.putStack(var17); + } + } + } else if (p_75144_3_ == 3 && p_75144_4_.capabilities.isCreativeMode && var6.getItemStack() == null && p_75144_1_ >= 0) { + var16 = (Slot)this.inventorySlots.get(p_75144_1_); + + if (var16 != null && var16.getHasStack()) { + var17 = var16.getStack().copy(); + var17.stackSize = var17.getMaxStackSize(); + var6.setItemStack(var17); + } + } else if (p_75144_3_ == 4 && var6.getItemStack() == null && p_75144_1_ >= 0) { + var16 = (Slot)this.inventorySlots.get(p_75144_1_); + + if (var16 != null && var16.getHasStack() && var16.canTakeStack(p_75144_4_)) { + var17 = var16.decrStackSize(p_75144_2_ == 0 ? 1 : var16.getStack().stackSize); + var16.onPickupFromSlot(p_75144_4_, var17); + p_75144_4_.dropPlayerItemWithRandomChoice(var17, true); + } + } else if (p_75144_3_ == 6 && p_75144_1_ >= 0) { + var16 = (Slot)this.inventorySlots.get(p_75144_1_); + var17 = var6.getItemStack(); + + if (var17 != null && (var16 == null || !var16.getHasStack() || !var16.canTakeStack(p_75144_4_))) { + var9 = p_75144_2_ == 0 ? 0 : this.inventorySlots.size() - 1; + var21 = p_75144_2_ == 0 ? 1 : -1; + + for (int var22 = 0; var22 < 2; ++var22) { + for (int var24 = var9; var24 >= 0 && var24 < this.inventorySlots.size() && var17.stackSize < var17.getMaxStackSize(); var24 += var21) { + Slot var25 = (Slot)this.inventorySlots.get(var24); + + if (var25.getHasStack() && func_94527_a(var25, var17, true) && var25.canTakeStack(p_75144_4_) && this.func_94530_a(var17, var25) && (var22 != 0 || var25.getStack().stackSize != var25.getStack().getMaxStackSize())) { + int var14 = Math.min(var17.getMaxStackSize() - var17.stackSize, var25.getStack().stackSize); + ItemStack var15 = var25.decrStackSize(var14); + var17.stackSize += var14; + + if (var15.stackSize <= 0) { + var25.putStack(null); + } + + var25.onPickupFromSlot(p_75144_4_, var15); + } + } + } + } + + this.detectAndSendChanges(); + } + } + + return var5; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) { + return true; + } + + protected void retrySlotClick(int p_75133_1_, int p_75133_2_, boolean p_75133_3_, EntityPlayer p_75133_4_) { + this.slotClick(p_75133_1_, p_75133_2_, 1, p_75133_4_); + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + InventoryPlayer var2 = p_75134_1_.inventory; + + if (var2.getItemStack() != null) { + p_75134_1_.dropPlayerItemWithRandomChoice(var2.getItemStack(), false); + var2.setItemStack(null); + } + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) { + this.detectAndSendChanges(); + } + + /** + * args: slotID, itemStack to put in slot + */ + public void putStackInSlot(int p_75141_1_, ItemStack p_75141_2_) { + this.getSlot(p_75141_1_).putStack(p_75141_2_); + } + + /** + * places itemstacks in first x slots, x being aitemstack.lenght + */ + public void putStacksInSlots(ItemStack[] p_75131_1_) { + for (int var2 = 0; var2 < p_75131_1_.length; ++var2) { + this.getSlot(var2).putStack(p_75131_1_[var2]); + } + } + + public void updateProgressBar(int p_75137_1_, int p_75137_2_) {} + + /** + * Gets a unique transaction ID. Parameter is unused. + */ + public short getNextTransactionID(InventoryPlayer p_75136_1_) { + ++this.transactionID; + return this.transactionID; + } + + /** + * NotUsing because adding a player twice is an error + */ + public boolean isPlayerNotUsingContainer(EntityPlayer p_75129_1_) { + return !this.playerList.contains(p_75129_1_); + } + + /** + * adds or removes the player from the container based on par2 + */ + public void setPlayerIsPresent(EntityPlayer p_75128_1_, boolean p_75128_2_) { + if (p_75128_2_) { + this.playerList.remove(p_75128_1_); + } else { + this.playerList.add(p_75128_1_); + } + } + + public abstract boolean canInteractWith(EntityPlayer p_75145_1_); + + /** + * merges provided ItemStack with the first avaliable one in the container/player inventory + */ + protected boolean mergeItemStack(ItemStack p_75135_1_, int p_75135_2_, int p_75135_3_, boolean p_75135_4_) { + boolean var5 = false; + int var6 = p_75135_2_; + + if (p_75135_4_) { + var6 = p_75135_3_ - 1; + } + + Slot var7; + ItemStack var8; + + if (p_75135_1_.isStackable()) { + while (p_75135_1_.stackSize > 0 && (!p_75135_4_ && var6 < p_75135_3_ || p_75135_4_ && var6 >= p_75135_2_)) { + var7 = (Slot)this.inventorySlots.get(var6); + var8 = var7.getStack(); + + if (var8 != null && var8.getItem() == p_75135_1_.getItem() && (!p_75135_1_.getHasSubtypes() || p_75135_1_.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(p_75135_1_, var8)) { + int var9 = var8.stackSize + p_75135_1_.stackSize; + + if (var9 <= p_75135_1_.getMaxStackSize()) { + p_75135_1_.stackSize = 0; + var8.stackSize = var9; + var7.onSlotChanged(); + var5 = true; + } else if (var8.stackSize < p_75135_1_.getMaxStackSize()) { + p_75135_1_.stackSize -= p_75135_1_.getMaxStackSize() - var8.stackSize; + var8.stackSize = p_75135_1_.getMaxStackSize(); + var7.onSlotChanged(); + var5 = true; + } + } + + if (p_75135_4_) { + --var6; + } else { + ++var6; + } + } + } + + if (p_75135_1_.stackSize > 0) { + if (p_75135_4_) { + var6 = p_75135_3_ - 1; + } else { + var6 = p_75135_2_; + } + + while (!p_75135_4_ && var6 < p_75135_3_ || p_75135_4_ && var6 >= p_75135_2_) { + var7 = (Slot)this.inventorySlots.get(var6); + var8 = var7.getStack(); + + if (var8 == null) { + var7.putStack(p_75135_1_.copy()); + var7.onSlotChanged(); + p_75135_1_.stackSize = 0; + var5 = true; + break; + } + + if (p_75135_4_) { + --var6; + } else { + ++var6; + } + } + } + + return var5; + } + + public static int func_94529_b(int p_94529_0_) { + return p_94529_0_ >> 2 & 3; + } + + public static int func_94532_c(int p_94532_0_) { + return p_94532_0_ & 3; + } + + public static int func_94534_d(int p_94534_0_, int p_94534_1_) { + return p_94534_0_ & 3 | (p_94534_1_ & 3) << 2; + } + + public static boolean func_94528_d(int p_94528_0_) { + return p_94528_0_ == 0 || p_94528_0_ == 1; + } + + protected void func_94533_d() { + this.field_94536_g = 0; + this.field_94537_h.clear(); + } + + public static boolean func_94527_a(Slot p_94527_0_, ItemStack p_94527_1_, boolean p_94527_2_) { + boolean var3 = p_94527_0_ == null || !p_94527_0_.getHasStack(); + + if (p_94527_0_ != null && p_94527_0_.getHasStack() && p_94527_1_ != null && p_94527_1_.isItemEqual(p_94527_0_.getStack()) && ItemStack.areItemStackTagsEqual(p_94527_0_.getStack(), p_94527_1_)) { + int var10002 = p_94527_2_ ? 0 : p_94527_1_.stackSize; + var3 |= p_94527_0_.getStack().stackSize + var10002 <= p_94527_1_.getMaxStackSize(); + } + + return var3; + } + + public static void func_94525_a(Set p_94525_0_, int p_94525_1_, ItemStack p_94525_2_, int p_94525_3_) { + switch (p_94525_1_) { + case 0: + p_94525_2_.stackSize = MathHelper.floor_float((float)p_94525_2_.stackSize / (float)p_94525_0_.size()); + break; + + case 1: + p_94525_2_.stackSize = 1; + } + + p_94525_2_.stackSize += p_94525_3_; + } + + /** + * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if + * the slot can be added to a list of Slots to split the held ItemStack across. + */ + public boolean canDragIntoSlot(Slot p_94531_1_) { + return true; + } + + public static int calcRedstoneFromInventory(IInventory p_94526_0_) { + if (p_94526_0_ == null) { + return 0; + } else { + int var1 = 0; + float var2 = 0.0F; + + for (int var3 = 0; var3 < p_94526_0_.getSizeInventory(); ++var3) { + ItemStack var4 = p_94526_0_.getStackInSlot(var3); + + if (var4 != null) { + var2 += (float)var4.stackSize / (float)Math.min(p_94526_0_.getInventoryStackLimit(), var4.getMaxStackSize()); + ++var1; + } + } + + var2 /= (float)p_94526_0_.getSizeInventory(); + return MathHelper.floor_float(var2 * 14.0F) + (var1 > 0 ? 1 : 0); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerBeacon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerBeacon.java new file mode 100644 index 0000000..3465a72 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerBeacon.java @@ -0,0 +1,136 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityBeacon; + +public class ContainerBeacon extends Container { + private final TileEntityBeacon theBeacon; + + /** + * This beacon's slot where you put in Emerald, Diamond, Gold or Iron Ingot. + */ + private final ContainerBeacon.BeaconSlot beaconSlot; + private final int field_82865_g; + private final int field_82867_h; + private final int field_82868_i; + + + public ContainerBeacon(InventoryPlayer p_i1802_1_, TileEntityBeacon p_i1802_2_) { + this.theBeacon = p_i1802_2_; + this.addSlotToContainer(this.beaconSlot = new ContainerBeacon.BeaconSlot(p_i1802_2_, 0, 136, 110)); + byte var3 = 36; + short var4 = 137; + int var5; + + for (var5 = 0; var5 < 3; ++var5) { + for (int var6 = 0; var6 < 9; ++var6) { + this.addSlotToContainer(new Slot(p_i1802_1_, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18)); + } + } + + for (var5 = 0; var5 < 9; ++var5) { + this.addSlotToContainer(new Slot(p_i1802_1_, var5, var3 + var5 * 18, 58 + var4)); + } + + this.field_82865_g = p_i1802_2_.func_145998_l(); + this.field_82867_h = p_i1802_2_.func_146007_j(); + this.field_82868_i = p_i1802_2_.func_146006_k(); + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.field_82865_g); + p_75132_1_.sendProgressBarUpdate(this, 1, this.field_82867_h); + p_75132_1_.sendProgressBarUpdate(this, 2, this.field_82868_i); + } + + public void updateProgressBar(int p_75137_1_, int p_75137_2_) { + if (p_75137_1_ == 0) { + this.theBeacon.func_146005_c(p_75137_2_); + } + + if (p_75137_1_ == 1) { + this.theBeacon.func_146001_d(p_75137_2_); + } + + if (p_75137_1_ == 2) { + this.theBeacon.func_146004_e(p_75137_2_); + } + } + + public TileEntityBeacon func_148327_e() { + return this.theBeacon; + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.theBeacon.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ == 0) { + if (!this.mergeItemStack(var5, 1, 37, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } else if (!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(var5) && var5.stackSize == 1) { + if (!this.mergeItemStack(var5, 0, 1, false)) { + return null; + } + } else if (p_82846_2_ >= 1 && p_82846_2_ < 28) { + if (!this.mergeItemStack(var5, 28, 37, false)) { + return null; + } + } else if (p_82846_2_ >= 28 && p_82846_2_ < 37) { + if (!this.mergeItemStack(var5, 1, 28, false)) { + return null; + } + } else if (!this.mergeItemStack(var5, 1, 37, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } + + class BeaconSlot extends Slot { + + + public BeaconSlot(IInventory p_i1801_2_, int p_i1801_3_, int p_i1801_4_, int p_i1801_5_) { + super(p_i1801_2_, p_i1801_3_, p_i1801_4_, p_i1801_5_); + } + + public boolean isItemValid(ItemStack p_75214_1_) { + return p_75214_1_ != null && (p_75214_1_.getItem() == Items.emerald || p_75214_1_.getItem() == Items.diamond || p_75214_1_.getItem() == Items.gold_ingot || p_75214_1_.getItem() == Items.iron_ingot); + } + + public int getSlotStackLimit() { + return 1; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java new file mode 100644 index 0000000..e67b506 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java @@ -0,0 +1,169 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntityBrewingStand; + +public class ContainerBrewingStand extends Container { + private final TileEntityBrewingStand tileBrewingStand; + + /** Instance of Slot. */ + private final Slot theSlot; + private int brewTime; + + + public ContainerBrewingStand(InventoryPlayer p_i1805_1_, TileEntityBrewingStand p_i1805_2_) { + this.tileBrewingStand = p_i1805_2_; + this.addSlotToContainer(new ContainerBrewingStand.Potion(p_i1805_1_.player, p_i1805_2_, 0, 56, 46)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(p_i1805_1_.player, p_i1805_2_, 1, 79, 53)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(p_i1805_1_.player, p_i1805_2_, 2, 102, 46)); + this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(p_i1805_2_, 3, 79, 17)); + int var3; + + for (var3 = 0; var3 < 3; ++var3) { + for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(p_i1805_1_, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer(new Slot(p_i1805_1_, var3, 8 + var3 * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileBrewingStand.func_145935_i()); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for (int var1 = 0; var1 < this.crafters.size(); ++var1) { + ICrafting var2 = (ICrafting)this.crafters.get(var1); + + if (this.brewTime != this.tileBrewingStand.func_145935_i()) { + var2.sendProgressBarUpdate(this, 0, this.tileBrewingStand.func_145935_i()); + } + } + + this.brewTime = this.tileBrewingStand.func_145935_i(); + } + + public void updateProgressBar(int p_75137_1_, int p_75137_2_) { + if (p_75137_1_ == 0) { + this.tileBrewingStand.func_145938_d(p_75137_2_); + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.tileBrewingStand.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if ((p_82846_2_ < 0 || p_82846_2_ > 2) && p_82846_2_ != 3) { + if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(var5)) { + if (!this.mergeItemStack(var5, 3, 4, false)) { + return null; + } + } else if (ContainerBrewingStand.Potion.canHoldPotion(var3)) { + if (!this.mergeItemStack(var5, 0, 3, false)) { + return null; + } + } else if (p_82846_2_ >= 4 && p_82846_2_ < 31) { + if (!this.mergeItemStack(var5, 31, 40, false)) { + return null; + } + } else if (p_82846_2_ >= 31 && p_82846_2_ < 40) { + if (!this.mergeItemStack(var5, 4, 31, false)) { + return null; + } + } else if (!this.mergeItemStack(var5, 4, 40, false)) { + return null; + } + } else { + if (!this.mergeItemStack(var5, 4, 40, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } + + class Ingredient extends Slot { + + + public Ingredient(IInventory p_i1803_2_, int p_i1803_3_, int p_i1803_4_, int p_i1803_5_) { + super(p_i1803_2_, p_i1803_3_, p_i1803_4_, p_i1803_5_); + } + + public boolean isItemValid(ItemStack p_75214_1_) { + return p_75214_1_ != null && p_75214_1_.getItem().isPotionIngredient(p_75214_1_); + } + + public int getSlotStackLimit() { + return 64; + } + } + + static class Potion extends Slot { + private final EntityPlayer player; + + + public Potion(EntityPlayer p_i1804_1_, IInventory p_i1804_2_, int p_i1804_3_, int p_i1804_4_, int p_i1804_5_) { + super(p_i1804_2_, p_i1804_3_, p_i1804_4_, p_i1804_5_); + this.player = p_i1804_1_; + } + + public boolean isItemValid(ItemStack p_75214_1_) { + return canHoldPotion(p_75214_1_); + } + + public int getSlotStackLimit() { + return 1; + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { + if (p_82870_2_.getItem() == Items.potionitem && p_82870_2_.getItemDamage() > 0) { + this.player.addStat(AchievementList.potion, 1); + } + + super.onPickupFromSlot(p_82870_1_, p_82870_2_); + } + + public static boolean canHoldPotion(ItemStack p_75243_0_) { + return p_75243_0_ != null && (p_75243_0_.getItem() == Items.potionitem || p_75243_0_.getItem() == Items.glass_bottle); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerChest.java new file mode 100644 index 0000000..6e42d85 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerChest.java @@ -0,0 +1,83 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ContainerChest extends Container { + private final IInventory lowerChestInventory; + private final int numRows; + + + public ContainerChest(IInventory p_i1806_1_, IInventory p_i1806_2_) { + this.lowerChestInventory = p_i1806_2_; + this.numRows = p_i1806_2_.getSizeInventory() / 9; + p_i1806_2_.openInventory(); + int var3 = (this.numRows - 4) * 18; + int var4; + int var5; + + for (var4 = 0; var4 < this.numRows; ++var4) { + for (var5 = 0; var5 < 9; ++var5) { + this.addSlotToContainer(new Slot(p_i1806_2_, var5 + var4 * 9, 8 + var5 * 18, 18 + var4 * 18)); + } + } + + for (var4 = 0; var4 < 3; ++var4) { + for (var5 = 0; var5 < 9; ++var5) { + this.addSlotToContainer(new Slot(p_i1806_1_, var5 + var4 * 9 + 9, 8 + var5 * 18, 103 + var4 * 18 + var3)); + } + } + + for (var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(p_i1806_1_, var4, 8 + var4 * 18, 161 + var3)); + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.lowerChestInventory.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ < this.numRows * 9) { + if (!this.mergeItemStack(var5, this.numRows * 9, this.inventorySlots.size(), true)) { + return null; + } + } else if (!this.mergeItemStack(var5, 0, this.numRows * 9, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + } + + return var3; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + this.lowerChestInventory.closeInventory(); + } + + /** + * Return this chest container's lower chest inventory. + */ + public IInventory getLowerChestInventory() { + return this.lowerChestInventory; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerDispenser.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerDispenser.java new file mode 100644 index 0000000..4b09de1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerDispenser.java @@ -0,0 +1,71 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityDispenser; + +public class ContainerDispenser extends Container { + private final TileEntityDispenser tileEntityDispenser; + + + public ContainerDispenser(IInventory p_i1825_1_, TileEntityDispenser p_i1825_2_) { + this.tileEntityDispenser = p_i1825_2_; + int var3; + int var4; + + for (var3 = 0; var3 < 3; ++var3) { + for (var4 = 0; var4 < 3; ++var4) { + this.addSlotToContainer(new Slot(p_i1825_2_, var4 + var3 * 3, 62 + var4 * 18, 17 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 3; ++var3) { + for (var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(p_i1825_1_, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer(new Slot(p_i1825_1_, var3, 8 + var3 * 18, 142)); + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.tileEntityDispenser.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ < 9) { + if (!this.mergeItemStack(var5, 9, 45, true)) { + return null; + } + } else if (!this.mergeItemStack(var5, 0, 9, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerEnchantment.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerEnchantment.java new file mode 100644 index 0000000..bbbe2b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerEnchantment.java @@ -0,0 +1,260 @@ +package net.minecraft.inventory; + +import java.util.List; +import java.util.Random; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ContainerEnchantment extends Container { + /** SlotEnchantmentTable object with ItemStack to be enchanted */ + public IInventory tableInventory = new InventoryBasic("Enchant", true, 1) { + + public int getInventoryStackLimit() { + return 1; + } + public void onInventoryChanged() { + super.onInventoryChanged(); + ContainerEnchantment.this.onCraftMatrixChanged(this); + } + }; + + /** current world (for bookshelf counting) */ + private final World worldPointer; + private final int posX; + private final int posY; + private final int posZ; + private final Random rand = new Random(); + + /** used as seed for EnchantmentNameParts (see GuiEnchantment) */ + public long nameSeed; + + /** 3-member array storing the enchantment levels of each slot */ + public int[] enchantLevels = new int[3]; + + + public ContainerEnchantment(InventoryPlayer p_i1811_1_, World p_i1811_2_, int p_i1811_3_, int p_i1811_4_, int p_i1811_5_) { + this.worldPointer = p_i1811_2_; + this.posX = p_i1811_3_; + this.posY = p_i1811_4_; + this.posZ = p_i1811_5_; + this.addSlotToContainer(new Slot(this.tableInventory, 0, 25, 47) { + + public boolean isItemValid(ItemStack p_75214_1_) { + return true; + } + }); + int var6; + + for (var6 = 0; var6 < 3; ++var6) { + for (int var7 = 0; var7 < 9; ++var7) { + this.addSlotToContainer(new Slot(p_i1811_1_, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); + } + } + + for (var6 = 0; var6 < 9; ++var6) { + this.addSlotToContainer(new Slot(p_i1811_1_, var6, 8 + var6 * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + p_75132_1_.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + p_75132_1_.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for (int var1 = 0; var1 < this.crafters.size(); ++var1) { + ICrafting var2 = (ICrafting)this.crafters.get(var1); + var2.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + var2.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + var2.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } + } + + public void updateProgressBar(int p_75137_1_, int p_75137_2_) { + if (p_75137_1_ >= 0 && p_75137_1_ <= 2) { + this.enchantLevels[p_75137_1_] = p_75137_2_; + } else { + super.updateProgressBar(p_75137_1_, p_75137_2_); + } + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) { + if (p_75130_1_ == this.tableInventory) { + ItemStack var2 = p_75130_1_.getStackInSlot(0); + int var3; + + if (var2 != null && var2.isItemEnchantable()) { + this.nameSeed = this.rand.nextLong(); + + if (!this.worldPointer.isClient) { + var3 = 0; + int var4; + + for (var4 = -1; var4 <= 1; ++var4) { + for (int var5 = -1; var5 <= 1; ++var5) { + if ((var4 != 0 || var5 != 0) && this.worldPointer.isAirBlock(this.posX + var5, this.posY, this.posZ + var4) && this.worldPointer.isAirBlock(this.posX + var5, this.posY + 1, this.posZ + var4)) { + if (this.worldPointer.getBlock(this.posX + var5 * 2, this.posY, this.posZ + var4 * 2) == Blocks.bookshelf) { + ++var3; + } + + if (this.worldPointer.getBlock(this.posX + var5 * 2, this.posY + 1, this.posZ + var4 * 2) == Blocks.bookshelf) { + ++var3; + } + + if (var5 != 0 && var4 != 0) { + if (this.worldPointer.getBlock(this.posX + var5 * 2, this.posY, this.posZ + var4) == Blocks.bookshelf) { + ++var3; + } + + if (this.worldPointer.getBlock(this.posX + var5 * 2, this.posY + 1, this.posZ + var4) == Blocks.bookshelf) { + ++var3; + } + + if (this.worldPointer.getBlock(this.posX + var5, this.posY, this.posZ + var4 * 2) == Blocks.bookshelf) { + ++var3; + } + + if (this.worldPointer.getBlock(this.posX + var5, this.posY + 1, this.posZ + var4 * 2) == Blocks.bookshelf) { + ++var3; + } + } + } + } + } + + for (var4 = 0; var4 < 3; ++var4) { + this.enchantLevels[var4] = EnchantmentHelper.calcItemStackEnchantability(this.rand, var4, var3, var2); + } + + this.detectAndSendChanges(); + } + } else { + for (var3 = 0; var3 < 3; ++var3) { + this.enchantLevels[var3] = 0; + } + } + } + } + + /** + * enchants the item on the table using the specified slot; also deducts XP from player + */ + public boolean enchantItem(EntityPlayer p_75140_1_, int p_75140_2_) { + ItemStack var3 = this.tableInventory.getStackInSlot(0); + + if (this.enchantLevels[p_75140_2_] > 0 && var3 != null && (p_75140_1_.experienceLevel >= this.enchantLevels[p_75140_2_] || p_75140_1_.capabilities.isCreativeMode)) { + if (!this.worldPointer.isClient) { + List var4 = EnchantmentHelper.buildEnchantmentList(this.rand, var3, this.enchantLevels[p_75140_2_]); + boolean var5 = var3.getItem() == Items.book; + + if (var4 != null) { + p_75140_1_.addExperienceLevel(-this.enchantLevels[p_75140_2_]); + + if (var5) { + var3.func_150996_a(Items.enchanted_book); + } + + int var6 = var5 && var4.size() > 1 ? this.rand.nextInt(var4.size()) : -1; + + for (int var7 = 0; var7 < var4.size(); ++var7) { + EnchantmentData var8 = (EnchantmentData)var4.get(var7); + + if (!var5 || var7 != var6) { + if (var5) { + Items.enchanted_book.addEnchantment(var3, var8); + } else { + var3.addEnchantment(var8.enchantmentobj, var8.enchantmentLevel); + } + } + } + + this.onCraftMatrixChanged(this.tableInventory); + } + } + + return true; + } else { + return false; + } + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + + if (!this.worldPointer.isClient) { + ItemStack var2 = this.tableInventory.getStackInSlotOnClosing(0); + + if (var2 != null) { + p_75134_1_.dropPlayerItemWithRandomChoice(var2, false); + } + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.worldPointer.getBlock(this.posX, this.posY, this.posZ) == Blocks.enchanting_table && p_75145_1_.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ == 0) { + if (!this.mergeItemStack(var5, 1, 37, true)) { + return null; + } + } else { + if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(var5)) { + return null; + } + + if (var5.hasTagCompound() && var5.stackSize == 1) { + ((Slot)this.inventorySlots.get(0)).putStack(var5.copy()); + var5.stackSize = 0; + } else if (var5.stackSize >= 1) { + ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(var5.getItem(), 1, var5.getItemDamage())); + --var5.stackSize; + } + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerFurnace.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerFurnace.java new file mode 100644 index 0000000..34b09a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerFurnace.java @@ -0,0 +1,138 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.tileentity.TileEntityFurnace; + +public class ContainerFurnace extends Container { + private final TileEntityFurnace furnace; + private int lastCookTime; + private int lastBurnTime; + private int lastItemBurnTime; + + + public ContainerFurnace(InventoryPlayer p_i1812_1_, TileEntityFurnace p_i1812_2_) { + this.furnace = p_i1812_2_; + this.addSlotToContainer(new Slot(p_i1812_2_, 0, 56, 17)); + this.addSlotToContainer(new Slot(p_i1812_2_, 1, 56, 53)); + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 2, 116, 35)); + int var3; + + for (var3 = 0; var3 < 3; ++var3) { + for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(p_i1812_1_, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer(new Slot(p_i1812_1_, var3, 8 + var3 * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.furnace.field_145961_j); + p_75132_1_.sendProgressBarUpdate(this, 1, this.furnace.field_145956_a); + p_75132_1_.sendProgressBarUpdate(this, 2, this.furnace.field_145963_i); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for (int var1 = 0; var1 < this.crafters.size(); ++var1) { + ICrafting var2 = (ICrafting)this.crafters.get(var1); + + if (this.lastCookTime != this.furnace.field_145961_j) { + var2.sendProgressBarUpdate(this, 0, this.furnace.field_145961_j); + } + + if (this.lastBurnTime != this.furnace.field_145956_a) { + var2.sendProgressBarUpdate(this, 1, this.furnace.field_145956_a); + } + + if (this.lastItemBurnTime != this.furnace.field_145963_i) { + var2.sendProgressBarUpdate(this, 2, this.furnace.field_145963_i); + } + } + + this.lastCookTime = this.furnace.field_145961_j; + this.lastBurnTime = this.furnace.field_145956_a; + this.lastItemBurnTime = this.furnace.field_145963_i; + } + + public void updateProgressBar(int p_75137_1_, int p_75137_2_) { + if (p_75137_1_ == 0) { + this.furnace.field_145961_j = p_75137_2_; + } + + if (p_75137_1_ == 1) { + this.furnace.field_145956_a = p_75137_2_; + } + + if (p_75137_1_ == 2) { + this.furnace.field_145963_i = p_75137_2_; + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.furnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ == 2) { + if (!this.mergeItemStack(var5, 3, 39, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } else if (p_82846_2_ != 1 && p_82846_2_ != 0) { + if (FurnaceRecipes.smelting().func_151395_a(var5) != null) { + if (!this.mergeItemStack(var5, 0, 1, false)) { + return null; + } + } else if (TileEntityFurnace.func_145954_b(var5)) { + if (!this.mergeItemStack(var5, 1, 2, false)) { + return null; + } + } else if (p_82846_2_ >= 3 && p_82846_2_ < 30) { + if (!this.mergeItemStack(var5, 30, 39, false)) { + return null; + } + } else if (p_82846_2_ >= 30 && p_82846_2_ < 39 && !this.mergeItemStack(var5, 3, 30, false)) { + return null; + } + } else if (!this.mergeItemStack(var5, 3, 39, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerHopper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerHopper.java new file mode 100644 index 0000000..d04a5a5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerHopper.java @@ -0,0 +1,72 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class ContainerHopper extends Container { + private final IInventory field_94538_a; + + + public ContainerHopper(InventoryPlayer p_i1814_1_, IInventory p_i1814_2_) { + this.field_94538_a = p_i1814_2_; + p_i1814_2_.openInventory(); + byte var3 = 51; + int var4; + + for (var4 = 0; var4 < p_i1814_2_.getSizeInventory(); ++var4) { + this.addSlotToContainer(new Slot(p_i1814_2_, var4, 44 + var4 * 18, 20)); + } + + for (var4 = 0; var4 < 3; ++var4) { + for (int var5 = 0; var5 < 9; ++var5) { + this.addSlotToContainer(new Slot(p_i1814_1_, var5 + var4 * 9 + 9, 8 + var5 * 18, var4 * 18 + var3)); + } + } + + for (var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(p_i1814_1_, var4, 8 + var4 * 18, 58 + var3)); + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.field_94538_a.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ < this.field_94538_a.getSizeInventory()) { + if (!this.mergeItemStack(var5, this.field_94538_a.getSizeInventory(), this.inventorySlots.size(), true)) { + return null; + } + } else if (!this.mergeItemStack(var5, 0, this.field_94538_a.getSizeInventory(), false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + } + + return var3; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + this.field_94538_a.closeInventory(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java new file mode 100644 index 0000000..079baee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerHorseInventory.java @@ -0,0 +1,104 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class ContainerHorseInventory extends Container { + private final IInventory field_111243_a; + private final EntityHorse theHorse; + + + public ContainerHorseInventory(IInventory p_i1817_1_, final IInventory p_i1817_2_, final EntityHorse p_i1817_3_) { + this.field_111243_a = p_i1817_2_; + this.theHorse = p_i1817_3_; + byte var4 = 3; + p_i1817_2_.openInventory(); + int var5 = (var4 - 4) * 18; + this.addSlotToContainer(new Slot(p_i1817_2_, 0, 8, 18) { + + public boolean isItemValid(ItemStack p_75214_1_) { + return super.isItemValid(p_75214_1_) && p_75214_1_.getItem() == Items.saddle && !this.getHasStack(); + } + }); + this.addSlotToContainer(new Slot(p_i1817_2_, 1, 8, 36) { + + public boolean isItemValid(ItemStack p_75214_1_) { + return super.isItemValid(p_75214_1_) && p_i1817_3_.func_110259_cr() && EntityHorse.func_146085_a(p_75214_1_.getItem()); + } + public boolean func_111238_b() { + return p_i1817_3_.func_110259_cr(); + } + }); + int var6; + int var7; + + if (p_i1817_3_.isChested()) { + for (var6 = 0; var6 < var4; ++var6) { + for (var7 = 0; var7 < 5; ++var7) { + this.addSlotToContainer(new Slot(p_i1817_2_, 2 + var7 + var6 * 5, 80 + var7 * 18, 18 + var6 * 18)); + } + } + } + + for (var6 = 0; var6 < 3; ++var6) { + for (var7 = 0; var7 < 9; ++var7) { + this.addSlotToContainer(new Slot(p_i1817_1_, var7 + var6 * 9 + 9, 8 + var7 * 18, 102 + var6 * 18 + var5)); + } + } + + for (var6 = 0; var6 < 9; ++var6) { + this.addSlotToContainer(new Slot(p_i1817_1_, var6, 8 + var6 * 18, 160 + var5)); + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.field_111243_a.isUseableByPlayer(p_75145_1_) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(p_75145_1_) < 8.0F; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ < this.field_111243_a.getSizeInventory()) { + if (!this.mergeItemStack(var5, this.field_111243_a.getSizeInventory(), this.inventorySlots.size(), true)) { + return null; + } + } else if (this.getSlot(1).isItemValid(var5) && !this.getSlot(1).getHasStack()) { + if (!this.mergeItemStack(var5, 1, 2, false)) { + return null; + } + } else if (this.getSlot(0).isItemValid(var5)) { + if (!this.mergeItemStack(var5, 0, 1, false)) { + return null; + } + } else if (this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(var5, 2, this.field_111243_a.getSizeInventory(), false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + } + + return var3; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + this.field_111243_a.closeInventory(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerMerchant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerMerchant.java new file mode 100644 index 0000000..cd070e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerMerchant.java @@ -0,0 +1,138 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ContainerMerchant extends Container { + /** Instance of Merchant. */ + private final IMerchant theMerchant; + private final InventoryMerchant merchantInventory; + + /** Instance of World. */ + private final World theWorld; + + + public ContainerMerchant(InventoryPlayer p_i1821_1_, IMerchant p_i1821_2_, World p_i1821_3_) { + this.theMerchant = p_i1821_2_; + this.theWorld = p_i1821_3_; + this.merchantInventory = new InventoryMerchant(p_i1821_1_.player, p_i1821_2_); + this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53)); + this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53)); + this.addSlotToContainer(new SlotMerchantResult(p_i1821_1_.player, p_i1821_2_, this.merchantInventory, 2, 120, 53)); + int var4; + + for (var4 = 0; var4 < 3; ++var4) { + for (int var5 = 0; var5 < 9; ++var5) { + this.addSlotToContainer(new Slot(p_i1821_1_, var5 + var4 * 9 + 9, 8 + var5 * 18, 84 + var4 * 18)); + } + } + + for (var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(p_i1821_1_, var4, 8 + var4 * 18, 142)); + } + } + + public InventoryMerchant getMerchantInventory() { + return this.merchantInventory; + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) { + super.addCraftingToCrafters(p_75132_1_); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) { + this.merchantInventory.resetRecipeAndSlots(); + super.onCraftMatrixChanged(p_75130_1_); + } + + public void setCurrentRecipeIndex(int p_75175_1_) { + this.merchantInventory.setCurrentRecipeIndex(p_75175_1_); + } + + public void updateProgressBar(int p_75137_1_, int p_75137_2_) {} + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.theMerchant.getCustomer() == p_75145_1_; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ == 2) { + if (!this.mergeItemStack(var5, 3, 39, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } else if (p_82846_2_ != 0 && p_82846_2_ != 1) { + if (p_82846_2_ >= 3 && p_82846_2_ < 30) { + if (!this.mergeItemStack(var5, 30, 39, false)) { + return null; + } + } else if (p_82846_2_ >= 30 && p_82846_2_ < 39 && !this.mergeItemStack(var5, 3, 30, false)) { + return null; + } + } else if (!this.mergeItemStack(var5, 3, 39, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + this.theMerchant.setCustomer(null); + super.onContainerClosed(p_75134_1_); + + if (!this.theWorld.isClient) { + ItemStack var2 = this.merchantInventory.getStackInSlotOnClosing(0); + + if (var2 != null) { + p_75134_1_.dropPlayerItemWithRandomChoice(var2, false); + } + + var2 = this.merchantInventory.getStackInSlotOnClosing(1); + + if (var2 != null) { + p_75134_1_.dropPlayerItemWithRandomChoice(var2, false); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerPlayer.java new file mode 100644 index 0000000..e011b2b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerPlayer.java @@ -0,0 +1,155 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.util.IIcon; + +public class ContainerPlayer extends Container { + /** The crafting matrix inventory. */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2); + public IInventory craftResult = new InventoryCraftResult(); + + /** Determines if inventory manipulation should be handled. */ + public boolean isLocalWorld; + private final EntityPlayer thePlayer; + + + public ContainerPlayer(final InventoryPlayer p_i1819_1_, boolean p_i1819_2_, EntityPlayer p_i1819_3_) { + this.isLocalWorld = p_i1819_2_; + this.thePlayer = p_i1819_3_; + this.addSlotToContainer(new SlotCrafting(p_i1819_1_.player, this.craftMatrix, this.craftResult, 0, 144, 36)); + int var4; + int var5; + + for (var4 = 0; var4 < 2; ++var4) { + for (var5 = 0; var5 < 2; ++var5) { + this.addSlotToContainer(new Slot(this.craftMatrix, var5 + var4 * 2, 88 + var5 * 18, 26 + var4 * 18)); + } + } + + for (var4 = 0; var4 < 4; ++var4) { + final int var44 = var4; + this.addSlotToContainer(new Slot(p_i1819_1_, p_i1819_1_.getSizeInventory() - 1 - var4, 8, 8 + var4 * 18) { + + public int getSlotStackLimit() { + return 1; + } + public boolean isItemValid(ItemStack p_75214_1_) { + return p_75214_1_ != null && (p_75214_1_.getItem() instanceof ItemArmor ? ((ItemArmor) p_75214_1_.getItem()).armorType == var44 : ((p_75214_1_.getItem() == Item.getItemFromBlock(Blocks.pumpkin) || p_75214_1_.getItem() == Items.skull) && var44 == 0)); + } + public IIcon getBackgroundIconIndex() { + return ItemArmor.func_94602_b(var44); + } + }); + } + + for (var4 = 0; var4 < 3; ++var4) { + for (var5 = 0; var5 < 9; ++var5) { + this.addSlotToContainer(new Slot(p_i1819_1_, var5 + (var4 + 1) * 9, 8 + var5 * 18, 84 + var4 * 18)); + } + } + + for (var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(p_i1819_1_, var4, 8 + var4 * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj)); + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + + for (int var2 = 0; var2 < 4; ++var2) { + ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2); + + if (var3 != null) { + p_75134_1_.dropPlayerItemWithRandomChoice(var3, false); + } + } + + this.craftResult.setInventorySlotContents(0, null); + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ == 0) { + if (!this.mergeItemStack(var5, 9, 45, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } else if (p_82846_2_ >= 1 && p_82846_2_ < 5) { + if (!this.mergeItemStack(var5, 9, 45, false)) { + return null; + } + } else if (p_82846_2_ >= 5 && p_82846_2_ < 9) { + if (!this.mergeItemStack(var5, 9, 45, false)) { + return null; + } + } else if (var3.getItem() instanceof ItemArmor && !((Slot)this.inventorySlots.get(5 + ((ItemArmor)var3.getItem()).armorType)).getHasStack()) { + int var6 = 5 + ((ItemArmor)var3.getItem()).armorType; + + if (!this.mergeItemStack(var5, var6, var6 + 1, false)) { + return null; + } + } else if (p_82846_2_ >= 9 && p_82846_2_ < 36) { + if (!this.mergeItemStack(var5, 36, 45, false)) { + return null; + } + } else if (p_82846_2_ >= 36 && p_82846_2_ < 45) { + if (!this.mergeItemStack(var5, 9, 36, false)) { + return null; + } + } else if (!this.mergeItemStack(var5, 9, 45, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) { + return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerRepair.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerRepair.java new file mode 100644 index 0000000..f79a20d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerRepair.java @@ -0,0 +1,470 @@ +package net.minecraft.inventory; + +import java.util.Iterator; +import java.util.Map; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ContainerRepair extends Container { + private static final Logger logger = LogManager.getLogger(); + + /** Here comes out item you merged and/or renamed. */ + private final IInventory outputSlot = new InventoryCraftResult(); + + /** + * The 2slots where you put your items in that you want to merge and/or rename. + */ + private final IInventory inputSlots = new InventoryBasic("Repair", true, 2) { + + public void onInventoryChanged() { + super.onInventoryChanged(); + ContainerRepair.this.onCraftMatrixChanged(this); + } + }; + private final World theWorld; + private final int field_82861_i; + private final int field_82858_j; + private final int field_82859_k; + + /** The maximum cost of repairing/renaming in the anvil. */ + public int maximumCost; + + /** determined by damage of input item and stackSize of repair materials */ + private int stackSizeToBeUsedInRepair; + private String repairedItemName; + + /** The player that has this container open. */ + private final EntityPlayer thePlayer; + + + public ContainerRepair(InventoryPlayer p_i1800_1_, final World p_i1800_2_, final int p_i1800_3_, final int p_i1800_4_, final int p_i1800_5_, EntityPlayer p_i1800_6_) { + this.theWorld = p_i1800_2_; + this.field_82861_i = p_i1800_3_; + this.field_82858_j = p_i1800_4_; + this.field_82859_k = p_i1800_5_; + this.thePlayer = p_i1800_6_; + this.addSlotToContainer(new Slot(this.inputSlots, 0, 27, 47)); + this.addSlotToContainer(new Slot(this.inputSlots, 1, 76, 47)); + this.addSlotToContainer(new Slot(this.outputSlot, 2, 134, 47) { + + public boolean isItemValid(ItemStack p_75214_1_) { + return false; + } + public boolean canTakeStack(EntityPlayer p_82869_1_) { + return (p_82869_1_.capabilities.isCreativeMode || p_82869_1_.experienceLevel >= ContainerRepair.this.maximumCost) && ContainerRepair.this.maximumCost > 0 && this.getHasStack(); + } + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { + if (!p_82870_1_.capabilities.isCreativeMode) { + p_82870_1_.addExperienceLevel(-ContainerRepair.this.maximumCost); + } + + ContainerRepair.this.inputSlots.setInventorySlotContents(0, null); + + if (ContainerRepair.this.stackSizeToBeUsedInRepair > 0) { + ItemStack var3 = ContainerRepair.this.inputSlots.getStackInSlot(1); + + if (var3 != null && var3.stackSize > ContainerRepair.this.stackSizeToBeUsedInRepair) { + var3.stackSize -= ContainerRepair.this.stackSizeToBeUsedInRepair; + ContainerRepair.this.inputSlots.setInventorySlotContents(1, var3); + } else { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, null); + } + } else { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, null); + } + + ContainerRepair.this.maximumCost = 0; + + if (!p_82870_1_.capabilities.isCreativeMode && !p_i1800_2_.isClient && p_i1800_2_.getBlock(p_i1800_3_, p_i1800_4_, p_i1800_5_) == Blocks.anvil && p_82870_1_.getRNG().nextFloat() < 0.12F) { + int var6 = p_i1800_2_.getBlockMetadata(p_i1800_3_, p_i1800_4_, p_i1800_5_); + int var4 = var6 & 3; + int var5 = var6 >> 2; + ++var5; + + if (var5 > 2) { + p_i1800_2_.setBlockToAir(p_i1800_3_, p_i1800_4_, p_i1800_5_); + p_i1800_2_.playAuxSFX(1020, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } else { + p_i1800_2_.setBlockMetadataWithNotify(p_i1800_3_, p_i1800_4_, p_i1800_5_, var4 | var5 << 2, 2); + p_i1800_2_.playAuxSFX(1021, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + } else if (!p_i1800_2_.isClient) { + p_i1800_2_.playAuxSFX(1021, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + } + }); + int var7; + + for (var7 = 0; var7 < 3; ++var7) { + for (int var8 = 0; var8 < 9; ++var8) { + this.addSlotToContainer(new Slot(p_i1800_1_, var8 + var7 * 9 + 9, 8 + var8 * 18, 84 + var7 * 18)); + } + } + + for (var7 = 0; var7 < 9; ++var7) { + this.addSlotToContainer(new Slot(p_i1800_1_, var7, 8 + var7 * 18, 142)); + } + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) { + super.onCraftMatrixChanged(p_75130_1_); + + if (p_75130_1_ == this.inputSlots) { + this.updateRepairOutput(); + } + } + + /** + * called when the Anvil Input Slot changes, calculates the new result and puts it in the output slot + */ + public void updateRepairOutput() { + ItemStack var1 = this.inputSlots.getStackInSlot(0); + this.maximumCost = 0; + int var2 = 0; + byte var3 = 0; + int var4 = 0; + + if (var1 == null) { + this.outputSlot.setInventorySlotContents(0, null); + this.maximumCost = 0; + } else { + ItemStack var5 = var1.copy(); + ItemStack var6 = this.inputSlots.getStackInSlot(1); + Map var7 = EnchantmentHelper.getEnchantments(var5); + boolean var8 = false; + int var19 = var3 + var1.getRepairCost() + (var6 == null ? 0 : var6.getRepairCost()); + this.stackSizeToBeUsedInRepair = 0; + int var9; + int var10; + int var11; + int var13; + int var14; + Iterator var21; + Enchantment var22; + + if (var6 != null) { + var8 = var6.getItem() == Items.enchanted_book && Items.enchanted_book.func_92110_g(var6).tagCount() > 0; + + if (var5.isItemStackDamageable() && var5.getItem().getIsRepairable(var1, var6)) { + var9 = Math.min(var5.getItemDamageForDisplay(), var5.getMaxDamage() / 4); + + if (var9 <= 0) { + this.outputSlot.setInventorySlotContents(0, null); + this.maximumCost = 0; + return; + } + + for (var10 = 0; var9 > 0 && var10 < var6.stackSize; ++var10) { + var11 = var5.getItemDamageForDisplay() - var9; + var5.setItemDamage(var11); + var2 += Math.max(1, var9 / 100) + var7.size(); + var9 = Math.min(var5.getItemDamageForDisplay(), var5.getMaxDamage() / 4); + } + + this.stackSizeToBeUsedInRepair = var10; + } else { + if (!var8 && (var5.getItem() != var6.getItem() || !var5.isItemStackDamageable())) { + this.outputSlot.setInventorySlotContents(0, null); + this.maximumCost = 0; + return; + } + + if (var5.isItemStackDamageable() && !var8) { + var9 = var1.getMaxDamage() - var1.getItemDamageForDisplay(); + var10 = var6.getMaxDamage() - var6.getItemDamageForDisplay(); + var11 = var10 + var5.getMaxDamage() * 12 / 100; + int var12 = var9 + var11; + var13 = var5.getMaxDamage() - var12; + + if (var13 < 0) { + var13 = 0; + } + + if (var13 < var5.getItemDamage()) { + var5.setItemDamage(var13); + var2 += Math.max(1, var11 / 100); + } + } + + Map var20 = EnchantmentHelper.getEnchantments(var6); + var21 = var20.keySet().iterator(); + + while (var21.hasNext()) { + var11 = ((Integer)var21.next()).intValue(); + var22 = Enchantment.enchantmentsList[var11]; + var13 = var7.containsKey(Integer.valueOf(var11)) ? ((Integer)var7.get(Integer.valueOf(var11))).intValue() : 0; + var14 = ((Integer)var20.get(Integer.valueOf(var11))).intValue(); + int var10000; + + if (var13 == var14) { + ++var14; + var10000 = var14; + } else { + var10000 = Math.max(var14, var13); + } + + var14 = var10000; + int var15 = var14 - var13; + boolean var16 = var22.canApply(var1); + + if (this.thePlayer.capabilities.isCreativeMode || var1.getItem() == Items.enchanted_book) { + var16 = true; + } + + Iterator var17 = var7.keySet().iterator(); + + while (var17.hasNext()) { + int var18 = ((Integer)var17.next()).intValue(); + + if (var18 != var11 && !var22.canApplyTogether(Enchantment.enchantmentsList[var18])) { + var16 = false; + var2 += var15; + } + } + + if (var16) { + if (var14 > var22.getMaxLevel()) { + var14 = var22.getMaxLevel(); + } + + var7.put(Integer.valueOf(var11), Integer.valueOf(var14)); + int var23 = 0; + + switch (var22.getWeight()) { + case 1: + var23 = 8; + break; + + case 2: + var23 = 4; + + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + + case 5: + var23 = 2; + break; + + case 10: + var23 = 1; + } + + if (var8) { + var23 = Math.max(1, var23 / 2); + } + + var2 += var23 * var15; + } + } + } + } + + if (StringUtils.isBlank(this.repairedItemName)) { + if (var1.hasDisplayName()) { + var4 = var1.isItemStackDamageable() ? 7 : var1.stackSize * 5; + var2 += var4; + var5.func_135074_t(); + } + } else if (!this.repairedItemName.equals(var1.getDisplayName())) { + var4 = var1.isItemStackDamageable() ? 7 : var1.stackSize * 5; + var2 += var4; + + if (var1.hasDisplayName()) { + var19 += var4 / 2; + } + + var5.setStackDisplayName(this.repairedItemName); + } + + var9 = 0; + + for (var21 = var7.keySet().iterator(); var21.hasNext(); var19 += var9 + var13 * var14) { + var11 = ((Integer)var21.next()).intValue(); + var22 = Enchantment.enchantmentsList[var11]; + var13 = ((Integer)var7.get(Integer.valueOf(var11))).intValue(); + var14 = 0; + ++var9; + + switch (var22.getWeight()) { + case 1: + var14 = 8; + break; + + case 2: + var14 = 4; + + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + + case 5: + var14 = 2; + break; + + case 10: + var14 = 1; + } + + if (var8) { + var14 = Math.max(1, var14 / 2); + } + } + + if (var8) { + var19 = Math.max(1, var19 / 2); + } + + this.maximumCost = var19 + var2; + + if (var2 <= 0) { + var5 = null; + } + + if (var4 == var2 && var4 > 0 && this.maximumCost >= 40) { + this.maximumCost = 39; + } + + if (this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) { + var5 = null; + } + + if (var5 != null) { + var10 = var5.getRepairCost(); + + if (var6 != null && var10 < var6.getRepairCost()) { + var10 = var6.getRepairCost(); + } + + if (var5.hasDisplayName()) { + var10 -= 9; + } + + if (var10 < 0) { + var10 = 0; + } + + var10 += 2; + var5.setRepairCost(var10); + EnchantmentHelper.setEnchantments(var7, var5); + } + + this.outputSlot.setInventorySlotContents(0, var5); + this.detectAndSendChanges(); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.maximumCost); + } + + public void updateProgressBar(int p_75137_1_, int p_75137_2_) { + if (p_75137_1_ == 0) { + this.maximumCost = p_75137_2_; + } + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + + if (!this.theWorld.isClient) { + for (int var2 = 0; var2 < this.inputSlots.getSizeInventory(); ++var2) { + ItemStack var3 = this.inputSlots.getStackInSlotOnClosing(var2); + + if (var3 != null) { + p_75134_1_.dropPlayerItemWithRandomChoice(var3, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.theWorld.getBlock(this.field_82861_i, this.field_82858_j, this.field_82859_k) == Blocks.anvil && p_75145_1_.getDistanceSq((double) this.field_82861_i + 0.5D, (double) this.field_82858_j + 0.5D, (double) this.field_82859_k + 0.5D) <= 64.0D; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ == 2) { + if (!this.mergeItemStack(var5, 3, 39, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } else if (p_82846_2_ != 0 && p_82846_2_ != 1) { + if (p_82846_2_ >= 3 && p_82846_2_ < 39 && !this.mergeItemStack(var5, 0, 2, false)) { + return null; + } + } else if (!this.mergeItemStack(var5, 3, 39, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } + + /** + * used by the Anvil GUI to update the Item Name being typed by the player + */ + public void updateItemName(String p_82850_1_) { + this.repairedItemName = p_82850_1_; + + if (this.getSlot(2).getHasStack()) { + ItemStack var2 = this.getSlot(2).getStack(); + + if (StringUtils.isBlank(p_82850_1_)) { + var2.func_135074_t(); + } else { + var2.setStackDisplayName(this.repairedItemName); + } + } + + this.updateRepairOutput(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerWorkbench.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerWorkbench.java new file mode 100644 index 0000000..66055b4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ContainerWorkbench.java @@ -0,0 +1,124 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.world.World; + +public class ContainerWorkbench extends Container { + /** The crafting matrix inventory (3x3). */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); + public IInventory craftResult = new InventoryCraftResult(); + private final World worldObj; + private final int posX; + private final int posY; + private final int posZ; + + + public ContainerWorkbench(InventoryPlayer p_i1808_1_, World p_i1808_2_, int p_i1808_3_, int p_i1808_4_, int p_i1808_5_) { + this.worldObj = p_i1808_2_; + this.posX = p_i1808_3_; + this.posY = p_i1808_4_; + this.posZ = p_i1808_5_; + this.addSlotToContainer(new SlotCrafting(p_i1808_1_.player, this.craftMatrix, this.craftResult, 0, 124, 35)); + int var6; + int var7; + + for (var6 = 0; var6 < 3; ++var6) { + for (var7 = 0; var7 < 3; ++var7) { + this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18)); + } + } + + for (var6 = 0; var6 < 3; ++var6) { + for (var7 = 0; var7 < 9; ++var7) { + this.addSlotToContainer(new Slot(p_i1808_1_, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); + } + } + + for (var6 = 0; var6 < 9; ++var6) { + this.addSlotToContainer(new Slot(p_i1808_1_, var6, 8 + var6 * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) { + super.onContainerClosed(p_75134_1_); + + if (!this.worldObj.isClient) { + for (int var2 = 0; var2 < 9; ++var2) { + ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2); + + if (var3 != null) { + p_75134_1_.dropPlayerItemWithRandomChoice(var3, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return this.worldObj.getBlock(this.posX, this.posY, this.posZ) == Blocks.crafting_table && p_75145_1_.getDistanceSq((double) this.posX + 0.5D, (double) this.posY + 0.5D, (double) this.posZ + 0.5D) <= 64.0D; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + + if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ == 0) { + if (!this.mergeItemStack(var5, 10, 46, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } else if (p_82846_2_ >= 10 && p_82846_2_ < 37) { + if (!this.mergeItemStack(var5, 37, 46, false)) { + return null; + } + } else if (p_82846_2_ >= 37 && p_82846_2_ < 46) { + if (!this.mergeItemStack(var5, 10, 37, false)) { + return null; + } + } else if (!this.mergeItemStack(var5, 10, 46, false)) { + return null; + } + + if (var5.stackSize == 0) { + var4.putStack(null); + } else { + var4.onSlotChanged(); + } + + if (var5.stackSize == var3.stackSize) { + return null; + } + + var4.onPickupFromSlot(p_82846_1_, var5); + } + + return var3; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) { + return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ICrafting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ICrafting.java new file mode 100644 index 0000000..8e8338b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ICrafting.java @@ -0,0 +1,21 @@ +package net.minecraft.inventory; + +import java.util.List; +import net.minecraft.item.ItemStack; + +public interface ICrafting { + void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_); + + /** + * Sends the contents of an inventory slot to the com.cheatbreaker.client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_); + + /** + * Sends two ints to the com.cheatbreaker.client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/IInvBasic.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/IInvBasic.java new file mode 100644 index 0000000..fdd3887 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/IInvBasic.java @@ -0,0 +1,8 @@ +package net.minecraft.inventory; + +public interface IInvBasic { + /** + * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. + */ + void onInventoryChanged(InventoryBasic p_76316_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/IInventory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/IInventory.java new file mode 100644 index 0000000..450bb9d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/IInventory.java @@ -0,0 +1,67 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public interface IInventory { + /** + * Returns the number of slots in the inventory. + */ + int getSizeInventory(); + + /** + * Returns the stack in slot i + */ + ItemStack getStackInSlot(int p_70301_1_); + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + ItemStack decrStackSize(int p_70298_1_, int p_70298_2_); + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + ItemStack getStackInSlotOnClosing(int p_70304_1_); + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_); + + /** + * Returns the name of the inventory + */ + String getInventoryName(); + + /** + * Returns if the inventory name is localized + */ + boolean isInventoryNameLocalized(); + + /** + * Returns the maximum stack size for a inventory slot. + */ + int getInventoryStackLimit(); + + /** + * Called when an the contents of an Inventory change, usually + */ + void onInventoryChanged(); + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + boolean isUseableByPlayer(EntityPlayer p_70300_1_); + + void openInventory(); + + void closeInventory(); + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ISidedInventory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ISidedInventory.java new file mode 100644 index 0000000..27595f3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/ISidedInventory.java @@ -0,0 +1,23 @@ +package net.minecraft.inventory; + +import net.minecraft.item.ItemStack; + +public interface ISidedInventory extends IInventory { + /** + * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this + * block. + */ + int[] getAccessibleSlotsFromSide(int p_94128_1_); + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ + boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_); + + /** + * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, + * side + */ + boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryBasic.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryBasic.java new file mode 100644 index 0000000..593596f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryBasic.java @@ -0,0 +1,158 @@ +package net.minecraft.inventory; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryBasic implements IInventory { + private String inventoryTitle; + private final int slotsCount; + private final ItemStack[] inventoryContents; + private List field_70480_d; + private boolean field_94051_e; + + + public InventoryBasic(String p_i1561_1_, boolean p_i1561_2_, int p_i1561_3_) { + this.inventoryTitle = p_i1561_1_; + this.field_94051_e = p_i1561_2_; + this.slotsCount = p_i1561_3_; + this.inventoryContents = new ItemStack[p_i1561_3_]; + } + + public void func_110134_a(IInvBasic p_110134_1_) { + if (this.field_70480_d == null) { + this.field_70480_d = new ArrayList(); + } + + this.field_70480_d.add(p_110134_1_); + } + + public void func_110132_b(IInvBasic p_110132_1_) { + this.field_70480_d.remove(p_110132_1_); + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return p_70301_1_ >= 0 && p_70301_1_ < this.inventoryContents.length ? this.inventoryContents[p_70301_1_] : null; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.inventoryContents[p_70298_1_] != null) { + ItemStack var3; + + if (this.inventoryContents[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.inventoryContents[p_70298_1_]; + this.inventoryContents[p_70298_1_] = null; + this.onInventoryChanged(); + return var3; + } else { + var3 = this.inventoryContents[p_70298_1_].splitStack(p_70298_2_); + + if (this.inventoryContents[p_70298_1_].stackSize == 0) { + this.inventoryContents[p_70298_1_] = null; + } + + this.onInventoryChanged(); + return var3; + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.inventoryContents[p_70304_1_] != null) { + ItemStack var2 = this.inventoryContents[p_70304_1_]; + this.inventoryContents[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.inventoryContents[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + + this.onInventoryChanged(); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.slotsCount; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.inventoryTitle; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.field_94051_e; + } + + public void func_110133_a(String p_110133_1_) { + this.field_94051_e = true; + this.inventoryTitle = p_110133_1_; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() { + if (this.field_70480_d != null) { + for (int var1 = 0; var1 < this.field_70480_d.size(); ++var1) { + ((IInvBasic)this.field_70480_d.get(var1)).onInventoryChanged(this); + } + } + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryCraftResult.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryCraftResult.java new file mode 100644 index 0000000..937a1b6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryCraftResult.java @@ -0,0 +1,103 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryCraftResult implements IInventory { + /** A list of one item containing the result of the crafting formula */ + private final ItemStack[] stackResult = new ItemStack[1]; + + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 1; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return this.stackResult[0]; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return "Result"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return false; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.stackResult[0] != null) { + ItemStack var3 = this.stackResult[0]; + this.stackResult[0] = null; + return var3; + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.stackResult[0] != null) { + ItemStack var2 = this.stackResult[0]; + this.stackResult[0] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.stackResult[0] = p_70299_2_; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() {} + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryCrafting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryCrafting.java new file mode 100644 index 0000000..69a026b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryCrafting.java @@ -0,0 +1,145 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryCrafting implements IInventory { + /** List of the stacks in the crafting matrix. */ + private final ItemStack[] stackList; + + /** the width of the crafting inventory */ + private final int inventoryWidth; + + /** + * Class containing the callbacks for the events on_GUIClosed and on_CraftMaxtrixChanged. + */ + private final Container eventHandler; + + + public InventoryCrafting(Container p_i1807_1_, int p_i1807_2_, int p_i1807_3_) { + int var4 = p_i1807_2_ * p_i1807_3_; + this.stackList = new ItemStack[var4]; + this.eventHandler = p_i1807_1_; + this.inventoryWidth = p_i1807_2_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.stackList.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return p_70301_1_ >= this.getSizeInventory() ? null : this.stackList[p_70301_1_]; + } + + /** + * Returns the itemstack in the slot specified (Top left is 0, 0). Args: row, column + */ + public ItemStack getStackInRowAndColumn(int p_70463_1_, int p_70463_2_) { + if (p_70463_1_ >= 0 && p_70463_1_ < this.inventoryWidth) { + int var3 = p_70463_1_ + p_70463_2_ * this.inventoryWidth; + return this.getStackInSlot(var3); + } else { + return null; + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return "container.crafting"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return false; + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.stackList[p_70304_1_] != null) { + ItemStack var2 = this.stackList[p_70304_1_]; + this.stackList[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.stackList[p_70298_1_] != null) { + ItemStack var3; + + if (this.stackList[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.stackList[p_70298_1_]; + this.stackList[p_70298_1_] = null; + this.eventHandler.onCraftMatrixChanged(this); + return var3; + } else { + var3 = this.stackList[p_70298_1_].splitStack(p_70298_2_); + + if (this.stackList[p_70298_1_].stackSize == 0) { + this.stackList[p_70298_1_] = null; + } + + this.eventHandler.onCraftMatrixChanged(this); + return var3; + } + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.stackList[p_70299_1_] = p_70299_2_; + this.eventHandler.onCraftMatrixChanged(this); + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() {} + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryEnderChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryEnderChest.java new file mode 100644 index 0000000..bbf085f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryEnderChest.java @@ -0,0 +1,78 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntityEnderChest; + +public class InventoryEnderChest extends InventoryBasic { + private TileEntityEnderChest associatedChest; + + + public InventoryEnderChest() { + super("container.enderchest", false, 27); + } + + public void func_146031_a(TileEntityEnderChest p_146031_1_) { + this.associatedChest = p_146031_1_; + } + + public void loadInventoryFromNBT(NBTTagList p_70486_1_) { + int var2; + + for (var2 = 0; var2 < this.getSizeInventory(); ++var2) { + this.setInventorySlotContents(var2, null); + } + + for (var2 = 0; var2 < p_70486_1_.tagCount(); ++var2) { + NBTTagCompound var3 = p_70486_1_.getCompoundTagAt(var2); + int var4 = var3.getByte("Slot") & 255; + + if (var4 >= 0 && var4 < this.getSizeInventory()) { + this.setInventorySlotContents(var4, ItemStack.loadItemStackFromNBT(var3)); + } + } + } + + public NBTTagList saveInventoryToNBT() { + NBTTagList var1 = new NBTTagList(); + + for (int var2 = 0; var2 < this.getSizeInventory(); ++var2) { + ItemStack var3 = this.getStackInSlot(var2); + + if (var3 != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var2); + var3.writeToNBT(var4); + var1.appendTag(var4); + } + } + + return var1; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return (this.associatedChest == null || this.associatedChest.func_145971_a(p_70300_1_)) && super.isUseableByPlayer(p_70300_1_); + } + + public void openInventory() { + if (this.associatedChest != null) { + this.associatedChest.func_145969_a(); + } + + super.openInventory(); + } + + public void closeInventory() { + if (this.associatedChest != null) { + this.associatedChest.func_145970_b(); + } + + super.closeInventory(); + this.associatedChest = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryLargeChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryLargeChest.java new file mode 100644 index 0000000..949448a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryLargeChest.java @@ -0,0 +1,132 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryLargeChest implements IInventory { + /** Name of the chest. */ + private final String name; + + /** Inventory object corresponding to double chest upper part */ + private final IInventory upperChest; + + /** Inventory object corresponding to double chest lower part */ + private final IInventory lowerChest; + + + public InventoryLargeChest(String p_i1559_1_, IInventory p_i1559_2_, IInventory p_i1559_3_) { + this.name = p_i1559_1_; + + if (p_i1559_2_ == null) { + p_i1559_2_ = p_i1559_3_; + } + + if (p_i1559_3_ == null) { + p_i1559_3_ = p_i1559_2_; + } + + this.upperChest = p_i1559_2_; + this.lowerChest = p_i1559_3_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory(); + } + + /** + * Return whether the given inventory is part of this large chest. + */ + public boolean isPartOfLargeChest(IInventory p_90010_1_) { + return this.upperChest == p_90010_1_ || this.lowerChest == p_90010_1_; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.upperChest.isInventoryNameLocalized() ? this.upperChest.getInventoryName() : (this.lowerChest.isInventoryNameLocalized() ? this.lowerChest.getInventoryName() : this.name); + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.upperChest.isInventoryNameLocalized() || this.lowerChest.isInventoryNameLocalized(); + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return p_70301_1_ >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlot(p_70301_1_ - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlot(p_70301_1_); + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + return p_70298_1_ >= this.upperChest.getSizeInventory() ? this.lowerChest.decrStackSize(p_70298_1_ - this.upperChest.getSizeInventory(), p_70298_2_) : this.upperChest.decrStackSize(p_70298_1_, p_70298_2_); + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + return p_70304_1_ >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlotOnClosing(p_70304_1_ - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlotOnClosing(p_70304_1_); + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + if (p_70299_1_ >= this.upperChest.getSizeInventory()) { + this.lowerChest.setInventorySlotContents(p_70299_1_ - this.upperChest.getSizeInventory(), p_70299_2_); + } else { + this.upperChest.setInventorySlotContents(p_70299_1_, p_70299_2_); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return this.upperChest.getInventoryStackLimit(); + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() { + this.upperChest.onInventoryChanged(); + this.lowerChest.onInventoryChanged(); + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.upperChest.isUseableByPlayer(p_70300_1_) && this.lowerChest.isUseableByPlayer(p_70300_1_); + } + + public void openInventory() { + this.upperChest.openInventory(); + this.lowerChest.openInventory(); + } + + public void closeInventory() { + this.upperChest.closeInventory(); + this.lowerChest.closeInventory(); + } + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryMerchant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryMerchant.java new file mode 100644 index 0000000..1d90916 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/InventoryMerchant.java @@ -0,0 +1,204 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public class InventoryMerchant implements IInventory { + private final IMerchant theMerchant; + private final ItemStack[] theInventory = new ItemStack[3]; + private final EntityPlayer thePlayer; + private MerchantRecipe currentRecipe; + private int currentRecipeIndex; + + + public InventoryMerchant(EntityPlayer p_i1820_1_, IMerchant p_i1820_2_) { + this.thePlayer = p_i1820_1_; + this.theMerchant = p_i1820_2_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.theInventory.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return this.theInventory[p_70301_1_]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.theInventory[p_70298_1_] != null) { + ItemStack var3; + + if (p_70298_1_ == 2) { + var3 = this.theInventory[p_70298_1_]; + this.theInventory[p_70298_1_] = null; + return var3; + } else if (this.theInventory[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.theInventory[p_70298_1_]; + this.theInventory[p_70298_1_] = null; + + if (this.inventoryResetNeededOnSlotChange(p_70298_1_)) { + this.resetRecipeAndSlots(); + } + + return var3; + } else { + var3 = this.theInventory[p_70298_1_].splitStack(p_70298_2_); + + if (this.theInventory[p_70298_1_].stackSize == 0) { + this.theInventory[p_70298_1_] = null; + } + + if (this.inventoryResetNeededOnSlotChange(p_70298_1_)) { + this.resetRecipeAndSlots(); + } + + return var3; + } + } else { + return null; + } + } + + /** + * if par1 slot has changed, does resetRecipeAndSlots need to be called? + */ + private boolean inventoryResetNeededOnSlotChange(int p_70469_1_) { + return p_70469_1_ == 0 || p_70469_1_ == 1; + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.theInventory[p_70304_1_] != null) { + ItemStack var2 = this.theInventory[p_70304_1_]; + this.theInventory[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.theInventory[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + + if (this.inventoryResetNeededOnSlotChange(p_70299_1_)) { + this.resetRecipeAndSlots(); + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return "mob.villager"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return false; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.theMerchant.getCustomer() == p_70300_1_; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() { + this.resetRecipeAndSlots(); + } + + public void resetRecipeAndSlots() { + this.currentRecipe = null; + ItemStack var1 = this.theInventory[0]; + ItemStack var2 = this.theInventory[1]; + + if (var1 == null) { + var1 = var2; + var2 = null; + } + + if (var1 == null) { + this.setInventorySlotContents(2, null); + } else { + MerchantRecipeList var3 = this.theMerchant.getRecipes(this.thePlayer); + + if (var3 != null) { + MerchantRecipe var4 = var3.canRecipeBeUsed(var1, var2, this.currentRecipeIndex); + + if (var4 != null && !var4.isRecipeDisabled()) { + this.currentRecipe = var4; + this.setInventorySlotContents(2, var4.getItemToSell().copy()); + } else if (var2 != null) { + var4 = var3.canRecipeBeUsed(var2, var1, this.currentRecipeIndex); + + if (var4 != null && !var4.isRecipeDisabled()) { + this.currentRecipe = var4; + this.setInventorySlotContents(2, var4.getItemToSell().copy()); + } else { + this.setInventorySlotContents(2, null); + } + } else { + this.setInventorySlotContents(2, null); + } + } + } + + this.theMerchant.func_110297_a_(this.getStackInSlot(2)); + } + + public MerchantRecipe getCurrentRecipe() { + return this.currentRecipe; + } + + public void setCurrentRecipeIndex(int p_70471_1_) { + this.currentRecipeIndex = p_70471_1_; + this.resetRecipeAndSlots(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/Slot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/Slot.java new file mode 100644 index 0000000..98957e0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/Slot.java @@ -0,0 +1,137 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class Slot { + /** The index of the slot in the inventory. */ + private final int slotIndex; + + /** The inventory we want to extract a slot from. */ + public final IInventory inventory; + + /** the id of the slot(also the index in the inventory arraylist) */ + public int slotNumber; + + /** display position of the inventory slot on the screen x axis */ + public int xDisplayPosition; + + /** display position of the inventory slot on the screen y axis */ + public int yDisplayPosition; + + + public Slot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { + this.inventory = p_i1824_1_; + this.slotIndex = p_i1824_2_; + this.xDisplayPosition = p_i1824_3_; + this.yDisplayPosition = p_i1824_4_; + } + + /** + * if par2 has more items than par1, onCrafting(item,countIncrease) is called + */ + public void onSlotChange(ItemStack p_75220_1_, ItemStack p_75220_2_) { + if (p_75220_1_ != null && p_75220_2_ != null) { + if (p_75220_1_.getItem() == p_75220_2_.getItem()) { + int var3 = p_75220_2_.stackSize - p_75220_1_.stackSize; + + if (var3 > 0) { + this.onCrafting(p_75220_1_, var3); + } + } + } + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) {} + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) {} + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { + this.onSlotChanged(); + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack p_75214_1_) { + return true; + } + + /** + * Helper fnct to get the stack in the slot. + */ + public ItemStack getStack() { + return this.inventory.getStackInSlot(this.slotIndex); + } + + /** + * Returns if this slot contains a stack. + */ + public boolean getHasStack() { + return this.getStack() != null; + } + + /** + * Helper method to put a stack in the slot. + */ + public void putStack(ItemStack p_75215_1_) { + this.inventory.setInventorySlotContents(this.slotIndex, p_75215_1_); + this.onSlotChanged(); + } + + /** + * Called when the stack in a Slot changes + */ + public void onSlotChanged() { + this.inventory.onInventoryChanged(); + } + + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case + * of armor slots) + */ + public int getSlotStackLimit() { + return this.inventory.getInventoryStackLimit(); + } + + /** + * Returns the icon index on items.png that is used as background image of the slot. + */ + public IIcon getBackgroundIconIndex() { + return null; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) { + return this.inventory.decrStackSize(this.slotIndex, p_75209_1_); + } + + /** + * returns true if this slot is in par2 of par1 + */ + public boolean isSlotInInventory(IInventory p_75217_1_, int p_75217_2_) { + return p_75217_1_ == this.inventory && p_75217_2_ == this.slotIndex; + } + + /** + * Return whether this slot's stack can be taken from this slot. + */ + public boolean canTakeStack(EntityPlayer p_82869_1_) { + return true; + } + + public boolean func_111238_b() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotCrafting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotCrafting.java new file mode 100644 index 0000000..0804eb8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotCrafting.java @@ -0,0 +1,131 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.stats.AchievementList; + +public class SlotCrafting extends Slot { + /** The craft matrix inventory linked to this result slot. */ + private final IInventory craftMatrix; + + /** The player that is using the GUI where this slot resides. */ + private final EntityPlayer thePlayer; + + /** + * The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. + */ + private int amountCrafted; + + + public SlotCrafting(EntityPlayer p_i1823_1_, IInventory p_i1823_2_, IInventory p_i1823_3_, int p_i1823_4_, int p_i1823_5_, int p_i1823_6_) { + super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_); + this.thePlayer = p_i1823_1_; + this.craftMatrix = p_i1823_2_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack p_75214_1_) { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) { + if (this.getHasStack()) { + this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize); + } + + return super.decrStackSize(p_75209_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) { + this.amountCrafted += p_75210_2_; + this.onCrafting(p_75210_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) { + p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); + this.amountCrafted = 0; + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) { + this.thePlayer.addStat(AchievementList.buildWorkBench, 1); + } + + if (p_75208_1_.getItem() instanceof ItemPickaxe) { + this.thePlayer.addStat(AchievementList.buildPickaxe, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace)) { + this.thePlayer.addStat(AchievementList.buildFurnace, 1); + } + + if (p_75208_1_.getItem() instanceof ItemHoe) { + this.thePlayer.addStat(AchievementList.buildHoe, 1); + } + + if (p_75208_1_.getItem() == Items.bread) { + this.thePlayer.addStat(AchievementList.makeBread, 1); + } + + if (p_75208_1_.getItem() == Items.cake) { + this.thePlayer.addStat(AchievementList.bakeCake, 1); + } + + if (p_75208_1_.getItem() instanceof ItemPickaxe && ((ItemPickaxe)p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD) { + this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1); + } + + if (p_75208_1_.getItem() instanceof ItemSword) { + this.thePlayer.addStat(AchievementList.buildSword, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) { + this.thePlayer.addStat(AchievementList.enchantments, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) { + this.thePlayer.addStat(AchievementList.bookcase, 1); + } + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { + this.onCrafting(p_82870_2_); + + for (int var3 = 0; var3 < this.craftMatrix.getSizeInventory(); ++var3) { + ItemStack var4 = this.craftMatrix.getStackInSlot(var3); + + if (var4 != null) { + this.craftMatrix.decrStackSize(var3, 1); + + if (var4.getItem().hasContainerItem()) { + ItemStack var5 = new ItemStack(var4.getItem().getContainerItem()); + + if (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5)) { + if (this.craftMatrix.getStackInSlot(var3) == null) { + this.craftMatrix.setInventorySlotContents(var3, var5); + } else { + this.thePlayer.dropPlayerItemWithRandomChoice(var5, false); + } + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotFurnace.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotFurnace.java new file mode 100644 index 0000000..87f4ef9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotFurnace.java @@ -0,0 +1,95 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.MathHelper; + +public class SlotFurnace extends Slot { + /** The player that is using the GUI where this slot resides. */ + private final EntityPlayer thePlayer; + private int field_75228_b; + + + public SlotFurnace(EntityPlayer p_i1813_1_, IInventory p_i1813_2_, int p_i1813_3_, int p_i1813_4_, int p_i1813_5_) { + super(p_i1813_2_, p_i1813_3_, p_i1813_4_, p_i1813_5_); + this.thePlayer = p_i1813_1_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack p_75214_1_) { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) { + if (this.getHasStack()) { + this.field_75228_b += Math.min(p_75209_1_, this.getStack().stackSize); + } + + return super.decrStackSize(p_75209_1_); + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { + this.onCrafting(p_82870_2_); + super.onPickupFromSlot(p_82870_1_, p_82870_2_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) { + this.field_75228_b += p_75210_2_; + this.onCrafting(p_75210_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) { + p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); + + if (!this.thePlayer.worldObj.isClient) { + int var2 = this.field_75228_b; + float var3 = FurnaceRecipes.smelting().func_151398_b(p_75208_1_); + int var4; + + if (var3 == 0.0F) { + var2 = 0; + } else if (var3 < 1.0F) { + var4 = MathHelper.floor_float((float)var2 * var3); + + if (var4 < MathHelper.ceiling_float_int((float)var2 * var3) && (float)Math.random() < (float)var2 * var3 - (float)var4) { + ++var4; + } + + var2 = var4; + } + + while (var2 > 0) { + var4 = EntityXPOrb.getXPSplit(var2); + var2 -= var4; + this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, var4)); + } + } + + this.field_75228_b = 0; + + if (p_75208_1_.getItem() == Items.iron_ingot) { + this.thePlayer.addStat(AchievementList.acquireIron, 1); + } + + if (p_75208_1_.getItem() == Items.cooked_fished) { + this.thePlayer.addStat(AchievementList.cookFish, 1); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotMerchantResult.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotMerchantResult.java new file mode 100644 index 0000000..1a1e8d0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/inventory/SlotMerchantResult.java @@ -0,0 +1,107 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; + +public class SlotMerchantResult extends Slot { + /** Merchant's inventory. */ + private final InventoryMerchant theMerchantInventory; + + /** The Player whos trying to buy/sell stuff. */ + private final EntityPlayer thePlayer; + private int field_75231_g; + + /** "Instance" of the Merchant. */ + private final IMerchant theMerchant; + + + public SlotMerchantResult(EntityPlayer p_i1822_1_, IMerchant p_i1822_2_, InventoryMerchant p_i1822_3_, int p_i1822_4_, int p_i1822_5_, int p_i1822_6_) { + super(p_i1822_3_, p_i1822_4_, p_i1822_5_, p_i1822_6_); + this.thePlayer = p_i1822_1_; + this.theMerchant = p_i1822_2_; + this.theMerchantInventory = p_i1822_3_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack p_75214_1_) { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) { + if (this.getHasStack()) { + this.field_75231_g += Math.min(p_75209_1_, this.getStack().stackSize); + } + + return super.decrStackSize(p_75209_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) { + this.field_75231_g += p_75210_2_; + this.onCrafting(p_75210_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) { + p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75231_g); + this.field_75231_g = 0; + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { + this.onCrafting(p_82870_2_); + MerchantRecipe var3 = this.theMerchantInventory.getCurrentRecipe(); + + if (var3 != null) { + ItemStack var4 = this.theMerchantInventory.getStackInSlot(0); + ItemStack var5 = this.theMerchantInventory.getStackInSlot(1); + + if (this.func_75230_a(var3, var4, var5) || this.func_75230_a(var3, var5, var4)) { + this.theMerchant.useRecipe(var3); + + if (var4 != null && var4.stackSize <= 0) { + var4 = null; + } + + if (var5 != null && var5.stackSize <= 0) { + var5 = null; + } + + this.theMerchantInventory.setInventorySlotContents(0, var4); + this.theMerchantInventory.setInventorySlotContents(1, var5); + } + } + } + + private boolean func_75230_a(MerchantRecipe p_75230_1_, ItemStack p_75230_2_, ItemStack p_75230_3_) { + ItemStack var4 = p_75230_1_.getItemToBuy(); + ItemStack var5 = p_75230_1_.getSecondItemToBuy(); + + if (p_75230_2_ != null && p_75230_2_.getItem() == var4.getItem()) { + if (var5 != null && p_75230_3_ != null && var5.getItem() == p_75230_3_.getItem()) { + p_75230_2_.stackSize -= var4.stackSize; + p_75230_3_.stackSize -= var5.stackSize; + return true; + } + + if (var5 == null && p_75230_3_ == null) { + p_75230_2_.stackSize -= var4.stackSize; + return true; + } + } + + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/EnumAction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/EnumAction.java new file mode 100644 index 0000000..1a95d4e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/EnumAction.java @@ -0,0 +1,10 @@ +package net.minecraft.item; + +public enum EnumAction { + none, + eat, + drink, + block, + bow + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/EnumRarity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/EnumRarity.java new file mode 100644 index 0000000..a9cb115 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/EnumRarity.java @@ -0,0 +1,25 @@ +package net.minecraft.item; + +import net.minecraft.util.EnumChatFormatting; + +public enum EnumRarity { + common(EnumChatFormatting.WHITE, "Common"), + uncommon(EnumChatFormatting.YELLOW, "Uncommon"), + rare(EnumChatFormatting.AQUA, "Rare"), + epic(EnumChatFormatting.LIGHT_PURPLE, "Epic"); + + /** + * A decimal representation of the hex color codes of a the color assigned to this rarity type. (13 becomes d as in + * \247d which is light purple) + */ + public final EnumChatFormatting rarityColor; + + /** Rarity name. */ + public final String rarityName; + + + EnumRarity(EnumChatFormatting p_i45349_3_, String p_i45349_4_) { + this.rarityColor = p_i45349_3_; + this.rarityName = p_i45349_4_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/Item.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/Item.java new file mode 100644 index 0000000..a006bc0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/Item.java @@ -0,0 +1,776 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import com.google.common.collect.Sets; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockNewLog; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockQuartz; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockWall; +import net.minecraft.block.BlockWood; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.RegistryNamespaced; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class Item { + public static final RegistryNamespaced itemRegistry = new RegistryNamespaced(); + protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + private CreativeTabs tabToDisplayOn; + + /** The RNG used by the Item subclasses. */ + protected static Random itemRand = new Random(); + + /** Maximum size of the stack. */ + protected int maxStackSize = 64; + + /** Maximum damage an item can handle. */ + private int maxDamage; + + /** If true, render the object in full 3D, like weapons and tools. */ + protected boolean bFull3D; + + /** + * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior + */ + protected boolean hasSubtypes; + private Item containerItem; + private String potionEffect; + + /** The unlocalized name of this item. */ + private String unlocalizedName; + + /** Icon index in the icons table. */ + protected IIcon itemIcon; + + /** The string associated with this Item's Icon. */ + protected String iconString; + + + public static int getIdFromItem(Item p_150891_0_) { + return p_150891_0_ == null ? 0 : itemRegistry.getIDForObject(p_150891_0_); + } + + public static Item getItemById(int p_150899_0_) { + return (Item)itemRegistry.getObjectForID(p_150899_0_); + } + + public static Item getItemFromBlock(Block p_150898_0_) { + return getItemById(Block.getIdFromBlock(p_150898_0_)); + } + + public static void registerItems() { + itemRegistry.addObject(256, "iron_shovel", (new ItemSpade(Item.ToolMaterial.IRON)).setUnlocalizedName("shovelIron").setTextureName("iron_shovel")); + itemRegistry.addObject(257, "iron_pickaxe", (new ItemPickaxe(Item.ToolMaterial.IRON)).setUnlocalizedName("pickaxeIron").setTextureName("iron_pickaxe")); + itemRegistry.addObject(258, "iron_axe", (new ItemAxe(Item.ToolMaterial.IRON)).setUnlocalizedName("hatchetIron").setTextureName("iron_axe")); + itemRegistry.addObject(259, "flint_and_steel", (new ItemFlintAndSteel()).setUnlocalizedName("flintAndSteel").setTextureName("flint_and_steel")); + itemRegistry.addObject(260, "apple", (new ItemFood(4, 0.3F, false)).setUnlocalizedName("apple").setTextureName("apple")); + itemRegistry.addObject(261, "bow", (new ItemBow()).setUnlocalizedName("bow").setTextureName("bow")); + itemRegistry.addObject(262, "arrow", (new Item()).setUnlocalizedName("arrow").setCreativeTab(CreativeTabs.tabCombat).setTextureName("arrow")); + itemRegistry.addObject(263, "coal", (new ItemCoal()).setUnlocalizedName("coal").setTextureName("coal")); + itemRegistry.addObject(264, "diamond", (new Item()).setUnlocalizedName("diamond").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("diamond")); + itemRegistry.addObject(265, "iron_ingot", (new Item()).setUnlocalizedName("ingotIron").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("iron_ingot")); + itemRegistry.addObject(266, "gold_ingot", (new Item()).setUnlocalizedName("ingotGold").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_ingot")); + itemRegistry.addObject(267, "iron_sword", (new ItemSword(Item.ToolMaterial.IRON)).setUnlocalizedName("swordIron").setTextureName("iron_sword")); + itemRegistry.addObject(268, "wooden_sword", (new ItemSword(Item.ToolMaterial.WOOD)).setUnlocalizedName("swordWood").setTextureName("wood_sword")); + itemRegistry.addObject(269, "wooden_shovel", (new ItemSpade(Item.ToolMaterial.WOOD)).setUnlocalizedName("shovelWood").setTextureName("wood_shovel")); + itemRegistry.addObject(270, "wooden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("pickaxeWood").setTextureName("wood_pickaxe")); + itemRegistry.addObject(271, "wooden_axe", (new ItemAxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hatchetWood").setTextureName("wood_axe")); + itemRegistry.addObject(272, "stone_sword", (new ItemSword(Item.ToolMaterial.STONE)).setUnlocalizedName("swordStone").setTextureName("stone_sword")); + itemRegistry.addObject(273, "stone_shovel", (new ItemSpade(Item.ToolMaterial.STONE)).setUnlocalizedName("shovelStone").setTextureName("stone_shovel")); + itemRegistry.addObject(274, "stone_pickaxe", (new ItemPickaxe(Item.ToolMaterial.STONE)).setUnlocalizedName("pickaxeStone").setTextureName("stone_pickaxe")); + itemRegistry.addObject(275, "stone_axe", (new ItemAxe(Item.ToolMaterial.STONE)).setUnlocalizedName("hatchetStone").setTextureName("stone_axe")); + itemRegistry.addObject(276, "diamond_sword", (new ItemSword(Item.ToolMaterial.EMERALD)).setUnlocalizedName("swordDiamond").setTextureName("diamond_sword")); + itemRegistry.addObject(277, "diamond_shovel", (new ItemSpade(Item.ToolMaterial.EMERALD)).setUnlocalizedName("shovelDiamond").setTextureName("diamond_shovel")); + itemRegistry.addObject(278, "diamond_pickaxe", (new ItemPickaxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("pickaxeDiamond").setTextureName("diamond_pickaxe")); + itemRegistry.addObject(279, "diamond_axe", (new ItemAxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hatchetDiamond").setTextureName("diamond_axe")); + itemRegistry.addObject(280, "stick", (new Item()).setFull3D().setUnlocalizedName("stick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("stick")); + itemRegistry.addObject(281, "bowl", (new Item()).setUnlocalizedName("bowl").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("bowl")); + itemRegistry.addObject(282, "mushroom_stew", (new ItemSoup(6)).setUnlocalizedName("mushroomStew").setTextureName("mushroom_stew")); + itemRegistry.addObject(283, "golden_sword", (new ItemSword(Item.ToolMaterial.GOLD)).setUnlocalizedName("swordGold").setTextureName("gold_sword")); + itemRegistry.addObject(284, "golden_shovel", (new ItemSpade(Item.ToolMaterial.GOLD)).setUnlocalizedName("shovelGold").setTextureName("gold_shovel")); + itemRegistry.addObject(285, "golden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("pickaxeGold").setTextureName("gold_pickaxe")); + itemRegistry.addObject(286, "golden_axe", (new ItemAxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hatchetGold").setTextureName("gold_axe")); + itemRegistry.addObject(287, "string", (new ItemReed(Blocks.tripwire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("string")); + itemRegistry.addObject(288, "feather", (new Item()).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("feather")); + itemRegistry.addObject(289, "gunpowder", (new Item()).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gunpowder")); + itemRegistry.addObject(290, "wooden_hoe", (new ItemHoe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hoeWood").setTextureName("wood_hoe")); + itemRegistry.addObject(291, "stone_hoe", (new ItemHoe(Item.ToolMaterial.STONE)).setUnlocalizedName("hoeStone").setTextureName("stone_hoe")); + itemRegistry.addObject(292, "iron_hoe", (new ItemHoe(Item.ToolMaterial.IRON)).setUnlocalizedName("hoeIron").setTextureName("iron_hoe")); + itemRegistry.addObject(293, "diamond_hoe", (new ItemHoe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hoeDiamond").setTextureName("diamond_hoe")); + itemRegistry.addObject(294, "golden_hoe", (new ItemHoe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hoeGold").setTextureName("gold_hoe")); + itemRegistry.addObject(295, "wheat_seeds", (new ItemSeeds(Blocks.wheat, Blocks.farmland)).setUnlocalizedName("seeds").setTextureName("seeds_wheat")); + itemRegistry.addObject(296, "wheat", (new Item()).setUnlocalizedName("wheat").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("wheat")); + itemRegistry.addObject(297, "bread", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("bread").setTextureName("bread")); + itemRegistry.addObject(298, "leather_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 0)).setUnlocalizedName("helmetCloth").setTextureName("leather_helmet")); + itemRegistry.addObject(299, "leather_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 1)).setUnlocalizedName("chestplateCloth").setTextureName("leather_chestplate")); + itemRegistry.addObject(300, "leather_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 2)).setUnlocalizedName("leggingsCloth").setTextureName("leather_leggings")); + itemRegistry.addObject(301, "leather_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 3)).setUnlocalizedName("bootsCloth").setTextureName("leather_boots")); + itemRegistry.addObject(302, "chainmail_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 0)).setUnlocalizedName("helmetChain").setTextureName("chainmail_helmet")); + itemRegistry.addObject(303, "chainmail_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 1)).setUnlocalizedName("chestplateChain").setTextureName("chainmail_chestplate")); + itemRegistry.addObject(304, "chainmail_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 2)).setUnlocalizedName("leggingsChain").setTextureName("chainmail_leggings")); + itemRegistry.addObject(305, "chainmail_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 3)).setUnlocalizedName("bootsChain").setTextureName("chainmail_boots")); + itemRegistry.addObject(306, "iron_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 0)).setUnlocalizedName("helmetIron").setTextureName("iron_helmet")); + itemRegistry.addObject(307, "iron_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 1)).setUnlocalizedName("chestplateIron").setTextureName("iron_chestplate")); + itemRegistry.addObject(308, "iron_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 2)).setUnlocalizedName("leggingsIron").setTextureName("iron_leggings")); + itemRegistry.addObject(309, "iron_boots", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 3)).setUnlocalizedName("bootsIron").setTextureName("iron_boots")); + itemRegistry.addObject(310, "diamond_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)).setUnlocalizedName("helmetDiamond").setTextureName("diamond_helmet")); + itemRegistry.addObject(311, "diamond_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 1)).setUnlocalizedName("chestplateDiamond").setTextureName("diamond_chestplate")); + itemRegistry.addObject(312, "diamond_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 2)).setUnlocalizedName("leggingsDiamond").setTextureName("diamond_leggings")); + itemRegistry.addObject(313, "diamond_boots", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)).setUnlocalizedName("bootsDiamond").setTextureName("diamond_boots")); + itemRegistry.addObject(314, "golden_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 0)).setUnlocalizedName("helmetGold").setTextureName("gold_helmet")); + itemRegistry.addObject(315, "golden_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold").setTextureName("gold_chestplate")); + itemRegistry.addObject(316, "golden_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold").setTextureName("gold_leggings")); + itemRegistry.addObject(317, "golden_boots", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold").setTextureName("gold_boots")); + itemRegistry.addObject(318, "flint", (new Item()).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("flint")); + itemRegistry.addObject(319, "porkchop", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("porkchopRaw").setTextureName("porkchop_raw")); + itemRegistry.addObject(320, "cooked_porkchop", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("porkchopCooked").setTextureName("porkchop_cooked")); + itemRegistry.addObject(321, "painting", (new ItemHangingEntity(EntityPainting.class)).setUnlocalizedName("painting").setTextureName("painting")); + itemRegistry.addObject(322, "golden_apple", (new ItemAppleGold(4, 1.2F, false)).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 1, 1.0F).setUnlocalizedName("appleGold").setTextureName("apple_golden")); + itemRegistry.addObject(323, "sign", (new ItemSign()).setUnlocalizedName("sign").setTextureName("sign")); + itemRegistry.addObject(324, "wooden_door", (new ItemDoor(Material.wood)).setUnlocalizedName("doorWood").setTextureName("door_wood")); + Item var0 = (new ItemBucket(Blocks.air)).setUnlocalizedName("bucket").setMaxStackSize(16).setTextureName("bucket_empty"); + itemRegistry.addObject(325, "bucket", var0); + itemRegistry.addObject(326, "water_bucket", (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(var0).setTextureName("bucket_water")); + itemRegistry.addObject(327, "lava_bucket", (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(var0).setTextureName("bucket_lava")); + itemRegistry.addObject(328, "minecart", (new ItemMinecart(0)).setUnlocalizedName("minecart").setTextureName("minecart_normal")); + itemRegistry.addObject(329, "saddle", (new ItemSaddle()).setUnlocalizedName("saddle").setTextureName("saddle")); + itemRegistry.addObject(330, "iron_door", (new ItemDoor(Material.iron)).setUnlocalizedName("doorIron").setTextureName("door_iron")); + itemRegistry.addObject(331, "redstone", (new ItemRedstone()).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect).setTextureName("redstone_dust")); + itemRegistry.addObject(332, "snowball", (new ItemSnowball()).setUnlocalizedName("snowball").setTextureName("snowball")); + itemRegistry.addObject(333, "boat", (new ItemBoat()).setUnlocalizedName("boat").setTextureName("boat")); + itemRegistry.addObject(334, "leather", (new Item()).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("leather")); + itemRegistry.addObject(335, "milk_bucket", (new ItemBucketMilk()).setUnlocalizedName("milk").setContainerItem(var0).setTextureName("bucket_milk")); + itemRegistry.addObject(336, "brick", (new Item()).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("brick")); + itemRegistry.addObject(337, "clay_ball", (new Item()).setUnlocalizedName("clay").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("clay_ball")); + itemRegistry.addObject(338, "reeds", (new ItemReed(Blocks.reeds)).setUnlocalizedName("reeds").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("reeds")); + itemRegistry.addObject(339, "paper", (new Item()).setUnlocalizedName("paper").setCreativeTab(CreativeTabs.tabMisc).setTextureName("paper")); + itemRegistry.addObject(340, "book", (new ItemBook()).setUnlocalizedName("book").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_normal")); + itemRegistry.addObject(341, "slime_ball", (new Item()).setUnlocalizedName("slimeball").setCreativeTab(CreativeTabs.tabMisc).setTextureName("slimeball")); + itemRegistry.addObject(342, "chest_minecart", (new ItemMinecart(1)).setUnlocalizedName("minecartChest").setTextureName("minecart_chest")); + itemRegistry.addObject(343, "furnace_minecart", (new ItemMinecart(2)).setUnlocalizedName("minecartFurnace").setTextureName("minecart_furnace")); + itemRegistry.addObject(344, "egg", (new ItemEgg()).setUnlocalizedName("egg").setTextureName("egg")); + itemRegistry.addObject(345, "compass", (new Item()).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools).setTextureName("compass")); + itemRegistry.addObject(346, "fishing_rod", (new ItemFishingRod()).setUnlocalizedName("fishingRod").setTextureName("fishing_rod")); + itemRegistry.addObject(347, "clock", (new Item()).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools).setTextureName("clock")); + itemRegistry.addObject(348, "glowstone_dust", (new Item()).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("glowstone_dust")); + itemRegistry.addObject(349, "fish", (new ItemFishFood(false)).setUnlocalizedName("fish").setTextureName("fish_raw").setHasSubtypes(true)); + itemRegistry.addObject(350, "cooked_fished", (new ItemFishFood(true)).setUnlocalizedName("fish").setTextureName("fish_cooked").setHasSubtypes(true)); + itemRegistry.addObject(351, "dye", (new ItemDye()).setUnlocalizedName("dyePowder").setTextureName("dye_powder")); + itemRegistry.addObject(352, "bone", (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc).setTextureName("bone")); + itemRegistry.addObject(353, "sugar", (new Item()).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("sugar")); + itemRegistry.addObject(354, "cake", (new ItemReed(Blocks.cake)).setMaxStackSize(1).setUnlocalizedName("cake").setCreativeTab(CreativeTabs.tabFood).setTextureName("cake")); + itemRegistry.addObject(355, "bed", (new ItemBed()).setMaxStackSize(1).setUnlocalizedName("bed").setTextureName("bed")); + itemRegistry.addObject(356, "repeater", (new ItemReed(Blocks.unpowered_repeater)).setUnlocalizedName("diode").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("repeater")); + itemRegistry.addObject(357, "cookie", (new ItemFood(2, 0.1F, false)).setUnlocalizedName("cookie").setTextureName("cookie")); + itemRegistry.addObject(358, "filled_map", (new ItemMap()).setUnlocalizedName("map").setTextureName("map_filled")); + itemRegistry.addObject(359, "shears", (new ItemShears()).setUnlocalizedName("shears").setTextureName("shears")); + itemRegistry.addObject(360, "melon", (new ItemFood(2, 0.3F, false)).setUnlocalizedName("melon").setTextureName("melon")); + itemRegistry.addObject(361, "pumpkin_seeds", (new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland)).setUnlocalizedName("seeds_pumpkin").setTextureName("seeds_pumpkin")); + itemRegistry.addObject(362, "melon_seeds", (new ItemSeeds(Blocks.melon_stem, Blocks.farmland)).setUnlocalizedName("seeds_melon").setTextureName("seeds_melon")); + itemRegistry.addObject(363, "beef", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("beefRaw").setTextureName("beef_raw")); + itemRegistry.addObject(364, "cooked_beef", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("beefCooked").setTextureName("beef_cooked")); + itemRegistry.addObject(365, "chicken", (new ItemFood(2, 0.3F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("chickenRaw").setTextureName("chicken_raw")); + itemRegistry.addObject(366, "cooked_chicken", (new ItemFood(6, 0.6F, true)).setUnlocalizedName("chickenCooked").setTextureName("chicken_cooked")); + itemRegistry.addObject(367, "rotten_flesh", (new ItemFood(4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh").setTextureName("rotten_flesh")); + itemRegistry.addObject(368, "ender_pearl", (new ItemEnderPearl()).setUnlocalizedName("enderPearl").setTextureName("ender_pearl")); + itemRegistry.addObject(369, "blaze_rod", (new Item()).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("blaze_rod")); + itemRegistry.addObject(370, "ghast_tear", (new Item()).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("ghast_tear")); + itemRegistry.addObject(371, "gold_nugget", (new Item()).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_nugget")); + itemRegistry.addObject(372, "nether_wart", (new ItemSeeds(Blocks.nether_wart, Blocks.soul_sand)).setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4").setTextureName("nether_wart")); + itemRegistry.addObject(373, "potion", (new ItemPotion()).setUnlocalizedName("potion").setTextureName("potion")); + itemRegistry.addObject(374, "glass_bottle", (new ItemGlassBottle()).setUnlocalizedName("glassBottle").setTextureName("potion_bottle_empty")); + itemRegistry.addObject(375, "spider_eye", (new ItemFood(2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect).setTextureName("spider_eye")); + itemRegistry.addObject(376, "fermented_spider_eye", (new Item()).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("spider_eye_fermented")); + itemRegistry.addObject(377, "blaze_powder", (new Item()).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("blaze_powder")); + itemRegistry.addObject(378, "magma_cream", (new Item()).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("magma_cream")); + itemRegistry.addObject(379, "brewing_stand", (new ItemReed(Blocks.brewing_stand)).setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("brewing_stand")); + itemRegistry.addObject(380, "cauldron", (new ItemReed(Blocks.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("cauldron")); + itemRegistry.addObject(381, "ender_eye", (new ItemEnderEye()).setUnlocalizedName("eyeOfEnder").setTextureName("ender_eye")); + itemRegistry.addObject(382, "speckled_melon", (new Item()).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("melon_speckled")); + itemRegistry.addObject(383, "spawn_egg", (new ItemMonsterPlacer()).setUnlocalizedName("monsterPlacer").setTextureName("spawn_egg")); + itemRegistry.addObject(384, "experience_bottle", (new ItemExpBottle()).setUnlocalizedName("expBottle").setTextureName("experience_bottle")); + itemRegistry.addObject(385, "fire_charge", (new ItemFireball()).setUnlocalizedName("fireball").setTextureName("fireball")); + itemRegistry.addObject(386, "writable_book", (new ItemWritableBook()).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_writable")); + itemRegistry.addObject(387, "written_book", (new ItemEditableBook()).setUnlocalizedName("writtenBook").setTextureName("book_written").setMaxStackSize(16)); + itemRegistry.addObject(388, "emerald", (new Item()).setUnlocalizedName("emerald").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("emerald")); + itemRegistry.addObject(389, "item_frame", (new ItemHangingEntity(EntityItemFrame.class)).setUnlocalizedName("frame").setTextureName("item_frame")); + itemRegistry.addObject(390, "flower_pot", (new ItemReed(Blocks.flower_pot)).setUnlocalizedName("flowerPot").setCreativeTab(CreativeTabs.tabDecorations).setTextureName("flower_pot")); + itemRegistry.addObject(391, "carrot", (new ItemSeedFood(4, 0.6F, Blocks.carrots, Blocks.farmland)).setUnlocalizedName("carrots").setTextureName("carrot")); + itemRegistry.addObject(392, "potato", (new ItemSeedFood(1, 0.3F, Blocks.potatoes, Blocks.farmland)).setUnlocalizedName("potato").setTextureName("potato")); + itemRegistry.addObject(393, "baked_potato", (new ItemFood(6, 0.6F, false)).setUnlocalizedName("potatoBaked").setTextureName("potato_baked")); + itemRegistry.addObject(394, "poisonous_potato", (new ItemFood(2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous").setTextureName("potato_poisonous")); + itemRegistry.addObject(395, "map", (new ItemEmptyMap()).setUnlocalizedName("emptyMap").setTextureName("map_empty")); + itemRegistry.addObject(396, "golden_carrot", (new ItemFood(6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.goldenCarrotEffect).setTextureName("carrot_golden")); + itemRegistry.addObject(397, "skull", (new ItemSkull()).setUnlocalizedName("skull").setTextureName("skull")); + itemRegistry.addObject(398, "carrot_on_a_stick", (new ItemCarrotOnAStick()).setUnlocalizedName("carrotOnAStick").setTextureName("carrot_on_a_stick")); + itemRegistry.addObject(399, "nether_star", (new ItemSimpleFoiled()).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("nether_star")); + itemRegistry.addObject(400, "pumpkin_pie", (new ItemFood(8, 0.3F, false)).setUnlocalizedName("pumpkinPie").setCreativeTab(CreativeTabs.tabFood).setTextureName("pumpkin_pie")); + itemRegistry.addObject(401, "fireworks", (new ItemFirework()).setUnlocalizedName("fireworks").setTextureName("fireworks")); + itemRegistry.addObject(402, "firework_charge", (new ItemFireworkCharge()).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc).setTextureName("fireworks_charge")); + itemRegistry.addObject(403, "enchanted_book", (new ItemEnchantedBook()).setMaxStackSize(1).setUnlocalizedName("enchantedBook").setTextureName("book_enchanted")); + itemRegistry.addObject(404, "comparator", (new ItemReed(Blocks.unpowered_comparator)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator")); + itemRegistry.addObject(405, "netherbrick", (new Item()).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick")); + itemRegistry.addObject(406, "quartz", (new Item()).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz")); + itemRegistry.addObject(407, "tnt_minecart", (new ItemMinecart(3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt")); + itemRegistry.addObject(408, "hopper_minecart", (new ItemMinecart(5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper")); + itemRegistry.addObject(417, "iron_horse_armor", (new Item()).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor")); + itemRegistry.addObject(418, "golden_horse_armor", (new Item()).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor")); + itemRegistry.addObject(419, "diamond_horse_armor", (new Item()).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("diamond_horse_armor")); + itemRegistry.addObject(420, "lead", (new ItemLead()).setUnlocalizedName("leash").setTextureName("lead")); + itemRegistry.addObject(421, "name_tag", (new ItemNameTag()).setUnlocalizedName("nameTag").setTextureName("name_tag")); + itemRegistry.addObject(422, "command_block_minecart", (new ItemMinecart(6)).setUnlocalizedName("minecartCommandBlock").setTextureName("minecart_command_block").setCreativeTab(null)); + itemRegistry.addObject(2256, "record_13", (new ItemRecord("13")).setUnlocalizedName("record").setTextureName("record_13")); + itemRegistry.addObject(2257, "record_cat", (new ItemRecord("cat")).setUnlocalizedName("record").setTextureName("record_cat")); + itemRegistry.addObject(2258, "record_blocks", (new ItemRecord("blocks")).setUnlocalizedName("record").setTextureName("record_blocks")); + itemRegistry.addObject(2259, "record_chirp", (new ItemRecord("chirp")).setUnlocalizedName("record").setTextureName("record_chirp")); + itemRegistry.addObject(2260, "record_far", (new ItemRecord("far")).setUnlocalizedName("record").setTextureName("record_far")); + itemRegistry.addObject(2261, "record_mall", (new ItemRecord("mall")).setUnlocalizedName("record").setTextureName("record_mall")); + itemRegistry.addObject(2262, "record_mellohi", (new ItemRecord("mellohi")).setUnlocalizedName("record").setTextureName("record_mellohi")); + itemRegistry.addObject(2263, "record_stal", (new ItemRecord("stal")).setUnlocalizedName("record").setTextureName("record_stal")); + itemRegistry.addObject(2264, "record_strad", (new ItemRecord("strad")).setUnlocalizedName("record").setTextureName("record_strad")); + itemRegistry.addObject(2265, "record_ward", (new ItemRecord("ward")).setUnlocalizedName("record").setTextureName("record_ward")); + itemRegistry.addObject(2266, "record_11", (new ItemRecord("11")).setUnlocalizedName("record").setTextureName("record_11")); + itemRegistry.addObject(2267, "record_wait", (new ItemRecord("wait")).setUnlocalizedName("record").setTextureName("record_wait")); + HashSet var1 = Sets.newHashSet(Blocks.air, Blocks.brewing_stand, Blocks.bed, Blocks.nether_wart, Blocks.cauldron, Blocks.flower_pot, Blocks.wheat, Blocks.reeds, Blocks.cake, Blocks.skull, Blocks.piston_head, Blocks.piston_extension, Blocks.lit_redstone_ore, Blocks.powered_repeater, Blocks.pumpkin_stem, Blocks.standing_sign, Blocks.powered_comparator, Blocks.tripwire, Blocks.lit_redstone_lamp, Blocks.melon_stem, Blocks.unlit_redstone_torch, Blocks.unpowered_comparator, Blocks.redstone_wire, Blocks.wall_sign, Blocks.unpowered_repeater, Blocks.iron_door, Blocks.wooden_door); + Iterator var2 = Block.blockRegistry.getKeys().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + Block var4 = (Block)Block.blockRegistry.getObject(var3); + Object var5; + + if (var4 == Blocks.wool) { + var5 = (new ItemCloth(Blocks.wool)).setUnlocalizedName("cloth"); + } else if (var4 == Blocks.stained_hardened_clay) { + var5 = (new ItemCloth(Blocks.stained_hardened_clay)).setUnlocalizedName("clayHardenedStained"); + } else if (var4 == Blocks.stained_glass) { + var5 = (new ItemCloth(Blocks.stained_glass)).setUnlocalizedName("stainedGlass"); + } else if (var4 == Blocks.stained_glass_pane) { + var5 = (new ItemCloth(Blocks.stained_glass_pane)).setUnlocalizedName("stainedGlassPane"); + } else if (var4 == Blocks.carpet) { + var5 = (new ItemCloth(Blocks.carpet)).setUnlocalizedName("woolCarpet"); + } else if (var4 == Blocks.dirt) { + var5 = (new ItemMultiTexture(Blocks.dirt, Blocks.dirt, BlockDirt.field_150009_a)).setUnlocalizedName("dirt"); + } else if (var4 == Blocks.sand) { + var5 = (new ItemMultiTexture(Blocks.sand, Blocks.sand, BlockSand.field_149838_a)).setUnlocalizedName("sand"); + } else if (var4 == Blocks.log) { + var5 = (new ItemMultiTexture(Blocks.log, Blocks.log, BlockOldLog.field_150168_M)).setUnlocalizedName("log"); + } else if (var4 == Blocks.log2) { + var5 = (new ItemMultiTexture(Blocks.log2, Blocks.log2, BlockNewLog.field_150169_M)).setUnlocalizedName("log"); + } else if (var4 == Blocks.planks) { + var5 = (new ItemMultiTexture(Blocks.planks, Blocks.planks, BlockWood.field_150096_a)).setUnlocalizedName("wood"); + } else if (var4 == Blocks.monster_egg) { + var5 = (new ItemMultiTexture(Blocks.monster_egg, Blocks.monster_egg, BlockSilverfish.field_150198_a)).setUnlocalizedName("monsterStoneEgg"); + } else if (var4 == Blocks.stonebrick) { + var5 = (new ItemMultiTexture(Blocks.stonebrick, Blocks.stonebrick, BlockStoneBrick.field_150142_a)).setUnlocalizedName("stonebricksmooth"); + } else if (var4 == Blocks.sandstone) { + var5 = (new ItemMultiTexture(Blocks.sandstone, Blocks.sandstone, BlockSandStone.field_150157_a)).setUnlocalizedName("sandStone"); + } else if (var4 == Blocks.quartz_block) { + var5 = (new ItemMultiTexture(Blocks.quartz_block, Blocks.quartz_block, BlockQuartz.field_150191_a)).setUnlocalizedName("quartzBlock"); + } else if (var4 == Blocks.stone_slab) { + var5 = (new ItemSlab(Blocks.stone_slab, Blocks.stone_slab, Blocks.double_stone_slab, false)).setUnlocalizedName("stoneSlab"); + } else if (var4 == Blocks.double_stone_slab) { + var5 = (new ItemSlab(Blocks.double_stone_slab, Blocks.stone_slab, Blocks.double_stone_slab, true)).setUnlocalizedName("stoneSlab"); + } else if (var4 == Blocks.wooden_slab) { + var5 = (new ItemSlab(Blocks.wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab, false)).setUnlocalizedName("woodSlab"); + } else if (var4 == Blocks.double_wooden_slab) { + var5 = (new ItemSlab(Blocks.double_wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab, true)).setUnlocalizedName("woodSlab"); + } else if (var4 == Blocks.sapling) { + var5 = (new ItemMultiTexture(Blocks.sapling, Blocks.sapling, BlockSapling.field_149882_a)).setUnlocalizedName("sapling"); + } else if (var4 == Blocks.leaves) { + var5 = (new ItemLeaves(Blocks.leaves)).setUnlocalizedName("leaves"); + } else if (var4 == Blocks.leaves2) { + var5 = (new ItemLeaves(Blocks.leaves2)).setUnlocalizedName("leaves"); + } else if (var4 == Blocks.vine) { + var5 = new ItemColored(Blocks.vine, false); + } else if (var4 == Blocks.tallgrass) { + var5 = (new ItemColored(Blocks.tallgrass, true)).func_150943_a(new String[] {"shrub", "grass", "fern"}); + } else if (var4 == Blocks.yellow_flower) { + var5 = (new ItemMultiTexture(Blocks.yellow_flower, Blocks.yellow_flower, BlockFlower.field_149858_b)).setUnlocalizedName("flower"); + } else if (var4 == Blocks.red_flower) { + var5 = (new ItemMultiTexture(Blocks.red_flower, Blocks.red_flower, BlockFlower.field_149859_a)).setUnlocalizedName("rose"); + } else if (var4 == Blocks.snow_layer) { + var5 = new ItemSnow(Blocks.snow_layer, Blocks.snow_layer); + } else if (var4 == Blocks.waterlily) { + var5 = new ItemLilyPad(Blocks.waterlily); + } else if (var4 == Blocks.piston) { + var5 = new ItemPiston(Blocks.piston); + } else if (var4 == Blocks.sticky_piston) { + var5 = new ItemPiston(Blocks.sticky_piston); + } else if (var4 == Blocks.cobblestone_wall) { + var5 = (new ItemMultiTexture(Blocks.cobblestone_wall, Blocks.cobblestone_wall, BlockWall.field_150092_a)).setUnlocalizedName("cobbleWall"); + } else if (var4 == Blocks.anvil) { + var5 = (new ItemAnvilBlock(Blocks.anvil)).setUnlocalizedName("anvil"); + } else if (var4 == Blocks.double_plant) { + var5 = (new ItemDoublePlant(Blocks.double_plant, Blocks.double_plant, BlockDoublePlant.field_149892_a)).setUnlocalizedName("doublePlant"); + } else { + if (var1.contains(var4)) { + continue; + } + + var5 = new ItemBlock(var4); + } + + itemRegistry.addObject(Block.getIdFromBlock(var4), var3, var5); + } + } + + public Item setMaxStackSize(int p_77625_1_) { + this.maxStackSize = p_77625_1_; + return this; + } + + /** + * Returns 0 for /terrain.png, 1 for /gui/items.png + */ + public int getSpriteNumber() { + return 1; + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.itemIcon; + } + + /** + * Returns the icon index of the stack given as argument. + */ + public final IIcon getIconIndex(ItemStack p_77650_1_) { + return this.getIconFromDamage(p_77650_1_.getItemDamage()); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + return false; + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { + return 1.0F; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + return p_77659_1_; + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + return p_77654_1_; + } + + /** + * Returns the maximum size of the stack for a specific item. + */ + public int getItemStackLimit() { + return this.maxStackSize; + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return 0; + } + + public boolean getHasSubtypes() { + return this.hasSubtypes; + } + + protected Item setHasSubtypes(boolean p_77627_1_) { + this.hasSubtypes = p_77627_1_; + return this; + } + + /** + * Returns the maximum damage an item can take. + */ + public int getMaxDamage() { + return this.maxDamage; + } + + /** + * set max damage of an Item + */ + protected Item setMaxDamage(int p_77656_1_) { + this.maxDamage = p_77656_1_; + return this; + } + + public boolean isDamageable() { + return this.maxDamage > 0 && !this.hasSubtypes; + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) { + return false; + } + + public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) { + return false; + } + + public boolean func_150897_b(Block p_150897_1_) { + return false; + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) { + return false; + } + + /** + * Sets bFull3D to True and return the object. + */ + public Item setFull3D() { + this.bFull3D = true; + return this; + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return this.bFull3D; + } + + /** + * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities + * hands. + */ + public boolean shouldRotateAroundWhenRendering() { + return false; + } + + /** + * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item." + */ + public Item setUnlocalizedName(String p_77655_1_) { + this.unlocalizedName = p_77655_1_; + return this; + } + + /** + * Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the + * unlocalized name itself is returned. + */ + public String getUnlocalizedNameInefficiently(ItemStack p_77657_1_) { + String var2 = this.getUnlocalizedName(p_77657_1_); + return var2 == null ? "" : StatCollector.translateToLocal(var2); + } + + /** + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName() { + return "item." + this.unlocalizedName; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + return "item." + this.unlocalizedName; + } + + public Item setContainerItem(Item p_77642_1_) { + this.containerItem = p_77642_1_; + return this; + } + + /** + * If this returns true, after a recipe involving this item is crafted the container item will be added to the + * player's inventory instead of remaining in the crafting grid. + */ + public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) { + return true; + } + + /** + * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the com.cheatbreaker.client. + */ + public boolean getShareTag() { + return true; + } + + public Item getContainerItem() { + return this.containerItem; + } + + /** + * True if this Item has a container item (a.k.a. crafting result) + */ + public boolean hasContainerItem() { + return this.containerItem != null; + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + return 16777215; + } + + /** + * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and + * update it's contents. + */ + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {} + + /** + * Called when item is crafted/smelted. Used only by maps so far. + */ + public void onCreated(ItemStack p_77622_1_, World p_77622_2_, EntityPlayer p_77622_3_) {} + + /** + * false for all Items except sub-classes of ItemMapBase + */ + public boolean isMap() { + return false; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.none; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 0; + } + + /** + * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) {} + + /** + * Sets the string representing this item's effect on a potion when used as an ingredient. + */ + protected Item setPotionEffect(String p_77631_1_) { + this.potionEffect = p_77631_1_; + return this; + } + + public String getPotionEffect(ItemStack p_150896_1_) { + return this.potionEffect; + } + + public boolean isPotionIngredient(ItemStack p_150892_1_) { + return this.getPotionEffect(p_150892_1_) != null; + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {} + + public String getItemStackDisplayName(ItemStack p_77653_1_) { + return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim(); + } + + public boolean hasEffect(ItemStack p_77636_1_) { + return p_77636_1_.isItemEnchanted(); + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) { + return p_77613_1_.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common; + } + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) { + return this.getItemStackLimit() == 1 && this.isDamageable(); + } + + protected MovingObjectPosition getMovingObjectPositionFromPlayer(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) { + float var4 = 1.0F; + float var5 = p_77621_2_.prevRotationPitch + (p_77621_2_.rotationPitch - p_77621_2_.prevRotationPitch) * var4; + float var6 = p_77621_2_.prevRotationYaw + (p_77621_2_.rotationYaw - p_77621_2_.prevRotationYaw) * var4; + double var7 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * (double)var4; + double var9 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * (double)var4 + 1.62D - (double)p_77621_2_.yOffset; + double var11 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * (double)var4; + Vec3 var13 = Vec3.createVectorHelper(var7, var9, var11); + float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI); + float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI); + float var16 = -MathHelper.cos(-var5 * 0.017453292F); + float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); + return p_77621_1_.func_147447_a(var13, var23, p_77621_3_, !p_77621_3_, false); + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return 0; + } + + public boolean requiresMultipleRenderPasses() { + return false; + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { + return this.getIconFromDamage(p_77618_1_); + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + } + + /** + * gets the CreativeTab this item is displayed on + */ + public CreativeTabs getCreativeTab() { + return this.tabToDisplayOn; + } + + /** + * returns this; + */ + public Item setCreativeTab(CreativeTabs p_77637_1_) { + this.tabToDisplayOn = p_77637_1_; + return this; + } + + /** + * Returns true if players can use this item to affect the world (e.g. placing blocks, placing ender eyes in portal) + * when not in creative + */ + public boolean canItemEditBlocks() { + return true; + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + public void registerIcons(IIconRegister p_94581_1_) { + this.itemIcon = p_94581_1_.registerIcon(this.getIconString()); + } + + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + public Multimap getItemAttributeModifiers() { + return HashMultimap.create(); + } + + protected Item setTextureName(String p_111206_1_) { + this.iconString = p_111206_1_; + return this; + } + + /** + * Returns the string associated with this Item's Icon. + */ + protected String getIconString() { + return this.iconString == null ? "MISSING_ICON_ITEM_" + itemRegistry.getIDForObject(this) + "_" + this.unlocalizedName : this.iconString; + } + + public enum ToolMaterial { + WOOD("WOOD", 0, 0, 59, 2.0F, 0.0F, 15), + STONE("STONE", 1, 1, 131, 4.0F, 1.0F, 5), + IRON("IRON", 2, 2, 250, 6.0F, 2.0F, 14), + EMERALD("EMERALD", 3, 3, 1561, 8.0F, 3.0F, 10), + GOLD("GOLD", 4, 0, 32, 12.0F, 0.0F, 22); + private final int harvestLevel; + private final int maxUses; + private final float efficiencyOnProperMaterial; + private final float damageVsEntity; + private final int enchantability; + + private static final Item.ToolMaterial[] $VALUES = new Item.ToolMaterial[]{WOOD, STONE, IRON, EMERALD, GOLD}; + + + ToolMaterial(String p_i1874_1_, int p_i1874_2_, int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) { + this.harvestLevel = p_i1874_3_; + this.maxUses = p_i1874_4_; + this.efficiencyOnProperMaterial = p_i1874_5_; + this.damageVsEntity = p_i1874_6_; + this.enchantability = p_i1874_7_; + } + + public int getMaxUses() { + return this.maxUses; + } + + public float getEfficiencyOnProperMaterial() { + return this.efficiencyOnProperMaterial; + } + + public float getDamageVsEntity() { + return this.damageVsEntity; + } + + public int getHarvestLevel() { + return this.harvestLevel; + } + + public int getEnchantability() { + return this.enchantability; + } + + public Item func_150995_f() { + return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAnvilBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAnvilBlock.java new file mode 100644 index 0000000..879a602 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAnvilBlock.java @@ -0,0 +1,19 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; + +public class ItemAnvilBlock extends ItemMultiTexture { + + + public ItemAnvilBlock(Block p_i1826_1_) { + super(p_i1826_1_, p_i1826_1_, BlockAnvil.field_149834_a); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_ << 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAppleGold.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAppleGold.java new file mode 100644 index 0000000..5ead711 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAppleGold.java @@ -0,0 +1,52 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class ItemAppleGold extends ItemFood { + + + public ItemAppleGold(int p_i45341_1_, float p_i45341_2_, boolean p_i45341_3_) { + super(p_i45341_1_, p_i45341_2_, p_i45341_3_); + this.setHasSubtypes(true); + } + + public boolean hasEffect(ItemStack p_77636_1_) { + return p_77636_1_.getItemDamage() > 0; + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) { + return p_77613_1_.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; + } + + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) { + if (!p_77849_2_.isClient) { + p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0)); + } + + if (p_77849_1_.getItemDamage() > 0) { + if (!p_77849_2_.isClient) { + p_77849_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); + } + } else { + super.onFoodEaten(p_77849_1_, p_77849_2_, p_77849_3_); + } + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 1)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemArmor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemArmor.java new file mode 100644 index 0000000..2bfc088 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemArmor.java @@ -0,0 +1,275 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.block.BlockDispenser; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.command.IEntitySelector; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemArmor extends Item { + /** Holds the 'base' maxDamage that each armorType have. */ + private static final int[] maxDamageArray = new int[] {11, 16, 15, 13}; + private static final String[] CLOTH_OVERLAY_NAMES = new String[] {"leather_helmet_overlay", "leather_chestplate_overlay", "leather_leggings_overlay", "leather_boots_overlay"}; + public static final String[] EMPTY_SLOT_NAMES = new String[] {"empty_armor_slot_helmet", "empty_armor_slot_chestplate", "empty_armor_slot_leggings", "empty_armor_slot_boots"}; + private static final IBehaviorDispenseItem dispenserBehavior = new BehaviorDefaultDispenseItem() { + + protected ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + int var4 = p_82487_1_.getXInt() + var3.getFrontOffsetX(); + int var5 = p_82487_1_.getYInt() + var3.getFrontOffsetY(); + int var6 = p_82487_1_.getZInt() + var3.getFrontOffsetZ(); + AxisAlignedBB var7 = AxisAlignedBB.getBoundingBox(var4, var5, var6, var4 + 1, var5 + 1, var6 + 1); + List var8 = p_82487_1_.getWorld().selectEntitiesWithinAABB(EntityLivingBase.class, var7, new IEntitySelector.ArmoredMob(p_82487_2_)); + + if (var8.size() > 0) { + EntityLivingBase var9 = (EntityLivingBase)var8.get(0); + int var10 = var9 instanceof EntityPlayer ? 1 : 0; + int var11 = EntityLiving.getArmorPosition(p_82487_2_); + ItemStack var12 = p_82487_2_.copy(); + var12.stackSize = 1; + var9.setCurrentItemOrArmor(var11 - var10, var12); + + if (var9 instanceof EntityLiving) { + ((EntityLiving)var9).setEquipmentDropChance(var11, 2.0F); + } + + --p_82487_2_.stackSize; + return p_82487_2_; + } else { + return super.dispenseStack(p_82487_1_, p_82487_2_); + } + } + }; + + /** + * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots + */ + public final int armorType; + + /** Holds the amount of damage that the armor reduces at full durability. */ + public final int damageReduceAmount; + + /** + * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is + * iron, 3 is diamond and 4 is gold. + */ + public final int renderIndex; + + /** The EnumArmorMaterial used for this ItemArmor */ + private final ItemArmor.ArmorMaterial material; + private IIcon overlayIcon; + private IIcon emptySlotIcon; + + + public ItemArmor(ItemArmor.ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { + this.material = p_i45325_1_; + this.armorType = p_i45325_3_; + this.renderIndex = p_i45325_2_; + this.damageReduceAmount = p_i45325_1_.getDamageReductionAmount(p_i45325_3_); + this.setMaxDamage(p_i45325_1_.getDurability(p_i45325_3_)); + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabCombat); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserBehavior); + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + if (p_82790_2_ > 0) { + return 16777215; + } else { + int var3 = this.getColor(p_82790_1_); + + if (var3 < 0) { + var3 = 16777215; + } + + return var3; + } + } + + public boolean requiresMultipleRenderPasses() { + return this.material == ItemArmor.ArmorMaterial.CLOTH; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return this.material.getEnchantability(); + } + + /** + * Return the armor material for this armor item. + */ + public ItemArmor.ArmorMaterial getArmorMaterial() { + return this.material; + } + + /** + * Return whether the specified armor ItemStack has a color. + */ + public boolean hasColor(ItemStack p_82816_1_) { + return this.material == ArmorMaterial.CLOTH && (p_82816_1_.hasTagCompound() && (p_82816_1_.getTagCompound().func_150297_b("display", 10) && p_82816_1_.getTagCompound().getCompoundTag("display").func_150297_b("color", 3))); + } + + /** + * Return the color for the specified armor ItemStack. + */ + public int getColor(ItemStack p_82814_1_) { + if (this.material != ItemArmor.ArmorMaterial.CLOTH) { + return -1; + } else { + NBTTagCompound var2 = p_82814_1_.getTagCompound(); + + if (var2 == null) { + return 10511680; + } else { + NBTTagCompound var3 = var2.getCompoundTag("display"); + return var3 == null ? 10511680 : (var3.func_150297_b("color", 3) ? var3.getInteger("color") : 10511680); + } + } + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { + return p_77618_2_ == 1 ? this.overlayIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + /** + * Remove the color from the specified armor ItemStack. + */ + public void removeColor(ItemStack p_82815_1_) { + if (this.material == ItemArmor.ArmorMaterial.CLOTH) { + NBTTagCompound var2 = p_82815_1_.getTagCompound(); + + if (var2 != null) { + NBTTagCompound var3 = var2.getCompoundTag("display"); + + if (var3.hasKey("color")) { + var3.removeTag("color"); + } + } + } + } + + public void func_82813_b(ItemStack p_82813_1_, int p_82813_2_) { + if (this.material != ItemArmor.ArmorMaterial.CLOTH) { + throw new UnsupportedOperationException("Can't dye non-leather!"); + } else { + NBTTagCompound var3 = p_82813_1_.getTagCompound(); + + if (var3 == null) { + var3 = new NBTTagCompound(); + p_82813_1_.setTagCompound(var3); + } + + NBTTagCompound var4 = var3.getCompoundTag("display"); + + if (!var3.func_150297_b("display", 10)) { + var3.setTag("display", var4); + } + + var4.setInteger("color", p_82813_2_); + } + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return this.material.func_151685_b() == p_82789_2_.getItem() || super.getIsRepairable(p_82789_1_, p_82789_2_); + } + + public void registerIcons(IIconRegister p_94581_1_) { + super.registerIcons(p_94581_1_); + + if (this.material == ItemArmor.ArmorMaterial.CLOTH) { + this.overlayIcon = p_94581_1_.registerIcon(CLOTH_OVERLAY_NAMES[this.armorType]); + } + + this.emptySlotIcon = p_94581_1_.registerIcon(EMPTY_SLOT_NAMES[this.armorType]); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + int var4 = EntityLiving.getArmorPosition(p_77659_1_) - 1; + ItemStack var5 = p_77659_3_.getCurrentArmor(var4); + + if (var5 == null) { + p_77659_3_.setCurrentItemOrArmor(var4, p_77659_1_.copy()); + p_77659_1_.stackSize = 0; + } + + return p_77659_1_; + } + + public static IIcon func_94602_b(int p_94602_0_) { + switch (p_94602_0_) { + case 0: + return Items.diamond_helmet.emptySlotIcon; + + case 1: + return Items.diamond_chestplate.emptySlotIcon; + + case 2: + return Items.diamond_leggings.emptySlotIcon; + + case 3: + return Items.diamond_boots.emptySlotIcon; + + default: + return null; + } + } + + public enum ArmorMaterial { + CLOTH("CLOTH", 0, 5, new int[]{1, 3, 2, 1}, 15), + CHAIN("CHAIN", 1, 15, new int[]{2, 5, 4, 1}, 12), + IRON("IRON", 2, 15, new int[]{2, 6, 5, 2}, 9), + GOLD("GOLD", 3, 7, new int[]{2, 5, 3, 1}, 25), + DIAMOND("DIAMOND", 4, 33, new int[]{3, 8, 6, 3}, 10); + private final int maxDamageFactor; + private final int[] damageReductionAmountArray; + private final int enchantability; + + private static final ItemArmor.ArmorMaterial[] $VALUES = new ItemArmor.ArmorMaterial[]{CLOTH, CHAIN, IRON, GOLD, DIAMOND}; + + + ArmorMaterial(String p_i1827_1_, int p_i1827_2_, int p_i1827_3_, int[] p_i1827_4_, int p_i1827_5_) { + this.maxDamageFactor = p_i1827_3_; + this.damageReductionAmountArray = p_i1827_4_; + this.enchantability = p_i1827_5_; + } + + public int getDurability(int p_78046_1_) { + return ItemArmor.maxDamageArray[p_78046_1_] * this.maxDamageFactor; + } + + public int getDamageReductionAmount(int p_78044_1_) { + return this.damageReductionAmountArray[p_78044_1_]; + } + + public int getEnchantability() { + return this.enchantability; + } + + public Item func_151685_b() { + return this == CLOTH ? Items.leather : (this == CHAIN ? Items.iron_ingot : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == DIAMOND ? Items.diamond : null)))); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAxe.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAxe.java new file mode 100644 index 0000000..04ca1e1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemAxe.java @@ -0,0 +1,20 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; + +public class ItemAxe extends ItemTool { + private static final Set field_150917_c = Sets.newHashSet(Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin); + + + protected ItemAxe(Item.ToolMaterial p_i45327_1_) { + super(3.0F, p_i45327_1_, field_150917_c); + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { + return p_150893_2_.getMaterial() != Material.wood && p_150893_2_.getMaterial() != Material.plants && p_150893_2_.getMaterial() != Material.vine ? super.func_150893_a(p_150893_1_, p_150893_2_) : this.efficiencyOnProperMaterial; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBed.java new file mode 100644 index 0000000..92f11bd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBed.java @@ -0,0 +1,67 @@ +package net.minecraft.item; + +import net.minecraft.block.BlockBed; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemBed extends Item { + + + public ItemBed() { + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_3_.isClient) { + return true; + } else if (p_77648_7_ != 1) { + return false; + } else { + ++p_77648_5_; + BlockBed var11 = (BlockBed)Blocks.bed; + int var12 = MathHelper.floor_double((double)(p_77648_2_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + byte var13 = 0; + byte var14 = 0; + + if (var12 == 0) { + var14 = 1; + } + + if (var12 == 1) { + var13 = -1; + } + + if (var12 == 2) { + var14 = -1; + } + + if (var12 == 3) { + var13 = 1; + } + + if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_ + var13, p_77648_5_, p_77648_6_ + var14, p_77648_7_, p_77648_1_)) { + if (p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_) && p_77648_3_.isAirBlock(p_77648_4_ + var13, p_77648_5_, p_77648_6_ + var14) && World.doesBlockHaveSolidTopSurface(p_77648_3_, p_77648_4_, p_77648_5_ - 1, p_77648_6_) && World.doesBlockHaveSolidTopSurface(p_77648_3_, p_77648_4_ + var13, p_77648_5_ - 1, p_77648_6_ + var14)) { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, var11, var12, 3); + + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == var11) { + p_77648_3_.setBlock(p_77648_4_ + var13, p_77648_5_, p_77648_6_ + var14, var11, var12 + 8, 3); + } + + --p_77648_1_.stackSize; + return true; + } else { + return false; + } + } else { + return false; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBlock.java new file mode 100644 index 0000000..90bf0bc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBlock.java @@ -0,0 +1,175 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemBlock extends Item { + protected final Block field_150939_a; + private IIcon field_150938_b; + + + public ItemBlock(Block p_i45328_1_) { + this.field_150939_a = p_i45328_1_; + } + + /** + * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item." + */ + public ItemBlock setUnlocalizedName(String p_77655_1_) { + super.setUnlocalizedName(p_77655_1_); + return this; + } + + /** + * Returns 0 for /terrain.png, 1 for /gui/items.png + */ + public int getSpriteNumber() { + return this.field_150939_a.getItemIconName() != null ? 1 : 0; + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.field_150938_b != null ? this.field_150938_b : this.field_150939_a.getBlockTextureFromSide(1); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (var11 == Blocks.snow_layer && (p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) & 7) < 1) { + p_77648_7_ = 1; + } else if (var11 != Blocks.vine && var11 != Blocks.tallgrass && var11 != Blocks.deadbush) { + if (p_77648_7_ == 0) { + --p_77648_5_; + } + + if (p_77648_7_ == 1) { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + } + + if (p_77648_1_.stackSize == 0) { + return false; + } else if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else if (p_77648_5_ == 255 && this.field_150939_a.getMaterial().isSolid()) { + return false; + } else if (p_77648_3_.canPlaceEntityOnSide(this.field_150939_a, p_77648_4_, p_77648_5_, p_77648_6_, false, p_77648_7_, p_77648_2_, p_77648_1_)) { + int var12 = this.getMetadata(p_77648_1_.getItemDamage()); + int var13 = this.field_150939_a.onBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, var12); + + if (p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, this.field_150939_a, var13, 3)) { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_150939_a) { + this.field_150939_a.onBlockPlacedBy(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_, p_77648_1_); + this.field_150939_a.onPostBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, var13); + } + + p_77648_3_.playSoundEffect((float)p_77648_4_ + 0.5F, (float)p_77648_5_ + 0.5F, (float)p_77648_6_ + 0.5F, this.field_150939_a.stepSound.func_150496_b(), (this.field_150939_a.stepSound.func_150497_c() + 1.0F) / 2.0F, this.field_150939_a.stepSound.func_150494_d() * 0.8F); + --p_77648_1_.stackSize; + } + + return true; + } else { + return false; + } + } + + public boolean func_150936_a(World p_150936_1_, int p_150936_2_, int p_150936_3_, int p_150936_4_, int p_150936_5_, EntityPlayer p_150936_6_, ItemStack p_150936_7_) { + Block var8 = p_150936_1_.getBlock(p_150936_2_, p_150936_3_, p_150936_4_); + + if (var8 == Blocks.snow_layer) { + p_150936_5_ = 1; + } else if (var8 != Blocks.vine && var8 != Blocks.tallgrass && var8 != Blocks.deadbush) { + if (p_150936_5_ == 0) { + --p_150936_3_; + } + + if (p_150936_5_ == 1) { + ++p_150936_3_; + } + + if (p_150936_5_ == 2) { + --p_150936_4_; + } + + if (p_150936_5_ == 3) { + ++p_150936_4_; + } + + if (p_150936_5_ == 4) { + --p_150936_2_; + } + + if (p_150936_5_ == 5) { + ++p_150936_2_; + } + } + + return p_150936_1_.canPlaceEntityOnSide(this.field_150939_a, p_150936_2_, p_150936_3_, p_150936_4_, false, p_150936_5_, null, p_150936_7_); + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + return this.field_150939_a.getUnlocalizedName(); + } + + /** + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName() { + return this.field_150939_a.getUnlocalizedName(); + } + + /** + * gets the CreativeTab this item is displayed on + */ + public CreativeTabs getCreativeTab() { + return this.field_150939_a.getCreativeTabToDisplayOn(); + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + this.field_150939_a.getSubBlocks(p_150895_1_, p_150895_2_, p_150895_3_); + } + + public void registerIcons(IIconRegister p_94581_1_) { + String var2 = this.field_150939_a.getItemIconName(); + + if (var2 != null) { + this.field_150938_b = p_94581_1_.registerIcon(var2); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBlockWithMetadata.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBlockWithMetadata.java new file mode 100644 index 0000000..3dfaec0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBlockWithMetadata.java @@ -0,0 +1,30 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; + +public class ItemBlockWithMetadata extends ItemBlock { + private final Block field_150950_b; + + + public ItemBlockWithMetadata(Block p_i45326_1_, Block p_i45326_2_) { + super(p_i45326_1_); + this.field_150950_b = p_i45326_2_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.field_150950_b.getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBoat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBoat.java new file mode 100644 index 0000000..c72dc15 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBoat.java @@ -0,0 +1,98 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class ItemBoat extends Item { + + + public ItemBoat() { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + float var4 = 1.0F; + float var5 = p_77659_3_.prevRotationPitch + (p_77659_3_.rotationPitch - p_77659_3_.prevRotationPitch) * var4; + float var6 = p_77659_3_.prevRotationYaw + (p_77659_3_.rotationYaw - p_77659_3_.prevRotationYaw) * var4; + double var7 = p_77659_3_.prevPosX + (p_77659_3_.posX - p_77659_3_.prevPosX) * (double)var4; + double var9 = p_77659_3_.prevPosY + (p_77659_3_.posY - p_77659_3_.prevPosY) * (double)var4 + 1.62D - (double)p_77659_3_.yOffset; + double var11 = p_77659_3_.prevPosZ + (p_77659_3_.posZ - p_77659_3_.prevPosZ) * (double)var4; + Vec3 var13 = Vec3.createVectorHelper(var7, var9, var11); + float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI); + float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI); + float var16 = -MathHelper.cos(-var5 * 0.017453292F); + float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); + MovingObjectPosition var24 = p_77659_2_.rayTraceBlocks(var13, var23, true); + + if (var24 == null) { + return p_77659_1_; + } else { + Vec3 var25 = p_77659_3_.getLook(var4); + boolean var26 = false; + float var27 = 1.0F; + List var28 = p_77659_2_.getEntitiesWithinAABBExcludingEntity(p_77659_3_, p_77659_3_.boundingBox.addCoord(var25.xCoord * var21, var25.yCoord * var21, var25.zCoord * var21).expand(var27, var27, var27)); + int var29; + + for (var29 = 0; var29 < var28.size(); ++var29) { + Entity var30 = (Entity)var28.get(var29); + + if (var30.canBeCollidedWith()) { + float var31 = var30.getCollisionBorderSize(); + AxisAlignedBB var32 = var30.boundingBox.expand(var31, var31, var31); + + if (var32.isVecInside(var13)) { + var26 = true; + } + } + } + + if (var26) { + return p_77659_1_; + } else { + if (var24.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + var29 = var24.blockX; + int var33 = var24.blockY; + int var34 = var24.blockZ; + + if (p_77659_2_.getBlock(var29, var33, var34) == Blocks.snow_layer) { + --var33; + } + + EntityBoat var35 = new EntityBoat(p_77659_2_, (float)var29 + 0.5F, (float)var33 + 1.0F, (float)var34 + 0.5F); + var35.rotationYaw = (float)(((MathHelper.floor_double((double)(p_77659_3_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); + + if (!p_77659_2_.getCollidingBoundingBoxes(var35, var35.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { + return p_77659_1_; + } + + if (!p_77659_2_.isClient) { + p_77659_2_.spawnEntityInWorld(var35); + } + + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + } + + return p_77659_1_; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBook.java new file mode 100644 index 0000000..3576d59 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBook.java @@ -0,0 +1,19 @@ +package net.minecraft.item; + +public class ItemBook extends Item { + + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) { + return p_77616_1_.stackSize == 1; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBow.java new file mode 100644 index 0000000..397a121 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBow.java @@ -0,0 +1,131 @@ +package net.minecraft.item; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemBow extends Item { + public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; + private IIcon[] iconArray; + + + public ItemBow() { + this.maxStackSize = 1; + this.setMaxDamage(384); + this.setCreativeTab(CreativeTabs.tabCombat); + } + + /** + * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) { + boolean var5 = p_77615_3_.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0; + + if (var5 || p_77615_3_.inventory.hasItem(Items.arrow)) { + int var6 = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_; + float var7 = (float)var6 / 20.0F; + var7 = (var7 * var7 + var7 * 2.0F) / 3.0F; + + if ((double)var7 < 0.1D) { + return; + } + + if (var7 > 1.0F) { + var7 = 1.0F; + } + + EntityArrow var8 = new EntityArrow(p_77615_2_, p_77615_3_, var7 * 2.0F); + + if (var7 == 1.0F) { + var8.setIsCritical(true); + } + + int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, p_77615_1_); + + if (var9 > 0) { + var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D); + } + + int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, p_77615_1_); + + if (var10 > 0) { + var8.setKnockbackStrength(var10); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, p_77615_1_) > 0) { + var8.setFire(100); + } + + p_77615_1_.damageItem(1, p_77615_3_); + p_77615_2_.playSoundAtEntity(p_77615_3_, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F); + + if (var5) { + var8.canBePickedUp = 2; + } else { + p_77615_3_.inventory.consumeInventoryItem(Items.arrow); + } + + if (!p_77615_2_.isClient) { + p_77615_2_.spawnEntityInWorld(var8); + } + } + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + return p_77654_1_; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 72000; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.bow; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (p_77659_3_.capabilities.isCreativeMode || p_77659_3_.inventory.hasItem(Items.arrow)) { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + } + + return p_77659_1_; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return 1; + } + + public void registerIcons(IIconRegister p_94581_1_) { + this.itemIcon = p_94581_1_.registerIcon(this.getIconString() + "_standby"); + this.iconArray = new IIcon[bowPullIconNameArray.length]; + + for (int var2 = 0; var2 < this.iconArray.length; ++var2) { + this.iconArray[var2] = p_94581_1_.registerIcon(this.getIconString() + "_" + bowPullIconNameArray[var2]); + } + } + + /** + * used to cycle through icons based on their used duration, i.e. for the bow + */ + public IIcon getItemIconForUseDuration(int p_94599_1_) { + return this.iconArray[p_94599_1_]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBucket.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBucket.java new file mode 100644 index 0000000..111a8ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBucket.java @@ -0,0 +1,147 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemBucket extends Item { + /** field for checking if the bucket has been filled. */ + private final Block isFull; + + + public ItemBucket(Block p_i45331_1_) { + this.maxStackSize = 1; + this.isFull = p_i45331_1_; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + boolean var4 = this.isFull == Blocks.air; + MovingObjectPosition var5 = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, var4); + + if (var5 == null) { + return p_77659_1_; + } else { + if (var5.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int var6 = var5.blockX; + int var7 = var5.blockY; + int var8 = var5.blockZ; + + if (!p_77659_2_.canMineBlock(p_77659_3_, var6, var7, var8)) { + return p_77659_1_; + } + + if (var4) { + if (!p_77659_3_.canPlayerEdit(var6, var7, var8, var5.sideHit, p_77659_1_)) { + return p_77659_1_; + } + + Material var9 = p_77659_2_.getBlock(var6, var7, var8).getMaterial(); + int var10 = p_77659_2_.getBlockMetadata(var6, var7, var8); + + if (var9 == Material.water && var10 == 0) { + p_77659_2_.setBlockToAir(var6, var7, var8); + return this.func_150910_a(p_77659_1_, p_77659_3_, Items.water_bucket); + } + + if (var9 == Material.lava && var10 == 0) { + p_77659_2_.setBlockToAir(var6, var7, var8); + return this.func_150910_a(p_77659_1_, p_77659_3_, Items.lava_bucket); + } + } else { + if (this.isFull == Blocks.air) { + return new ItemStack(Items.bucket); + } + + if (var5.sideHit == 0) { + --var7; + } + + if (var5.sideHit == 1) { + ++var7; + } + + if (var5.sideHit == 2) { + --var8; + } + + if (var5.sideHit == 3) { + ++var8; + } + + if (var5.sideHit == 4) { + --var6; + } + + if (var5.sideHit == 5) { + ++var6; + } + + if (!p_77659_3_.canPlayerEdit(var6, var7, var8, var5.sideHit, p_77659_1_)) { + return p_77659_1_; + } + + if (this.tryPlaceContainedLiquid(p_77659_2_, var6, var7, var8) && !p_77659_3_.capabilities.isCreativeMode) { + return new ItemStack(Items.bucket); + } + } + } + + return p_77659_1_; + } + } + + private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) { + if (p_150910_2_.capabilities.isCreativeMode) { + return p_150910_1_; + } else if (--p_150910_1_.stackSize <= 0) { + return new ItemStack(p_150910_3_); + } else { + if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) { + p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false); + } + + return p_150910_1_; + } + } + + /** + * Attempts to place the liquid contained inside the bucket. + */ + public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_) { + if (this.isFull == Blocks.air) { + return false; + } else { + Material var5 = p_77875_1_.getBlock(p_77875_2_, p_77875_3_, p_77875_4_).getMaterial(); + boolean var6 = !var5.isSolid(); + + if (!p_77875_1_.isAirBlock(p_77875_2_, p_77875_3_, p_77875_4_) && !var6) { + return false; + } else { + if (p_77875_1_.provider.isHellWorld && this.isFull == Blocks.flowing_water) { + p_77875_1_.playSoundEffect((float)p_77875_2_ + 0.5F, (float)p_77875_3_ + 0.5F, (float)p_77875_4_ + 0.5F, "random.fizz", 0.5F, 2.6F + (p_77875_1_.rand.nextFloat() - p_77875_1_.rand.nextFloat()) * 0.8F); + + for (int var7 = 0; var7 < 8; ++var7) { + p_77875_1_.spawnParticle("largesmoke", (double)p_77875_2_ + Math.random(), (double)p_77875_3_ + Math.random(), (double)p_77875_4_ + Math.random(), 0.0D, 0.0D, 0.0D); + } + } else { + if (!p_77875_1_.isClient && var6 && !var5.isLiquid()) { + p_77875_1_.func_147480_a(p_77875_2_, p_77875_3_, p_77875_4_, true); + } + + p_77875_1_.setBlock(p_77875_2_, p_77875_3_, p_77875_4_, this.isFull, 0, 3); + } + + return true; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBucketMilk.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBucketMilk.java new file mode 100644 index 0000000..b1594b6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemBucketMilk.java @@ -0,0 +1,49 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + +public class ItemBucketMilk extends Item { + + + public ItemBucketMilk() { + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + if (!p_77654_3_.capabilities.isCreativeMode) { + --p_77654_1_.stackSize; + } + + if (!p_77654_2_.isClient) { + p_77654_3_.clearActivePotions(); + } + + return p_77654_1_.stackSize <= 0 ? new ItemStack(Items.bucket) : p_77654_1_; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 32; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.drink; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + return p_77659_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java new file mode 100644 index 0000000..325ee70 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java @@ -0,0 +1,54 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + +public class ItemCarrotOnAStick extends Item { + + + public ItemCarrotOnAStick() { + this.setCreativeTab(CreativeTabs.tabTransport); + this.setMaxStackSize(1); + this.setMaxDamage(25); + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /** + * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities + * hands. + */ + public boolean shouldRotateAroundWhenRendering() { + return true; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (p_77659_3_.isRiding() && p_77659_3_.ridingEntity instanceof EntityPig) { + EntityPig var4 = (EntityPig)p_77659_3_.ridingEntity; + + if (var4.getAIControlledByPlayer().isControlledByPlayer() && p_77659_1_.getMaxDamage() - p_77659_1_.getItemDamage() >= 7) { + var4.getAIControlledByPlayer().boostSpeed(); + p_77659_1_.damageItem(7, p_77659_3_); + + if (p_77659_1_.stackSize == 0) { + ItemStack var5 = new ItemStack(Items.fishing_rod); + var5.setTagCompound(p_77659_1_.stackTagCompound); + return var5; + } + } + } + + return p_77659_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCloth.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCloth.java new file mode 100644 index 0000000..9dde7b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCloth.java @@ -0,0 +1,37 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; +import net.minecraft.util.IIcon; + +public class ItemCloth extends ItemBlock { + + + public ItemCloth(Block p_i45358_1_) { + super(p_i45358_1_); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.field_150939_a.func_149735_b(2, BlockColored.func_150032_b(p_77617_1_)); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[BlockColored.func_150032_b(p_77667_1_.getItemDamage())]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCoal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCoal.java new file mode 100644 index 0000000..b9a4bd3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemCoal.java @@ -0,0 +1,45 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.IIcon; + +public class ItemCoal extends Item { + private IIcon field_111220_a; + + + public ItemCoal() { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + return p_77667_1_.getItemDamage() == 1 ? "item.charcoal" : "item.coal"; + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 1)); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return p_77617_1_ == 1 ? this.field_111220_a : super.getIconFromDamage(p_77617_1_); + } + + public void registerIcons(IIconRegister p_94581_1_) { + super.registerIcons(p_94581_1_); + this.field_111220_a = p_94581_1_.registerIcon("charcoal"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemColored.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemColored.java new file mode 100644 index 0000000..8adbefb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemColored.java @@ -0,0 +1,56 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; + +public class ItemColored extends ItemBlock { + private final Block field_150944_b; + private String[] field_150945_c; + + + public ItemColored(Block p_i45332_1_, boolean p_i45332_2_) { + super(p_i45332_1_); + this.field_150944_b = p_i45332_1_; + + if (p_i45332_2_) { + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + return this.field_150944_b.getRenderColor(p_82790_1_.getItemDamage()); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.field_150944_b.getIcon(0, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_; + } + + public ItemColored func_150943_a(String[] p_150943_1_) { + this.field_150945_c = p_150943_1_; + return this; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + if (this.field_150945_c == null) { + return super.getUnlocalizedName(p_77667_1_); + } else { + int var2 = p_77667_1_.getItemDamage(); + return var2 >= 0 && var2 < this.field_150945_c.length ? super.getUnlocalizedName(p_77667_1_) + "." + this.field_150945_c[var2] : super.getUnlocalizedName(p_77667_1_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDoor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDoor.java new file mode 100644 index 0000000..e5ae799 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDoor.java @@ -0,0 +1,90 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemDoor extends Item { + private final Material doorMaterial; + + + public ItemDoor(Material p_i45334_1_) { + this.doorMaterial = p_i45334_1_; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_7_ != 1) { + return false; + } else { + ++p_77648_5_; + Block var11; + + if (this.doorMaterial == Material.wood) { + var11 = Blocks.wooden_door; + } else { + var11 = Blocks.iron_door; + } + + if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) { + if (!var11.canPlaceBlockAt(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) { + return false; + } else { + int var12 = MathHelper.floor_double((double)((p_77648_2_.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; + func_150924_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, var12, var11); + --p_77648_1_.stackSize; + return true; + } + } else { + return false; + } + } + } + + public static void func_150924_a(World p_150924_0_, int p_150924_1_, int p_150924_2_, int p_150924_3_, int p_150924_4_, Block p_150924_5_) { + byte var6 = 0; + byte var7 = 0; + + if (p_150924_4_ == 0) { + var7 = 1; + } + + if (p_150924_4_ == 1) { + var6 = -1; + } + + if (p_150924_4_ == 2) { + var7 = -1; + } + + if (p_150924_4_ == 3) { + var6 = 1; + } + + int var8 = (p_150924_0_.getBlock(p_150924_1_ - var6, p_150924_2_, p_150924_3_ - var7).isNormalCube() ? 1 : 0) + (p_150924_0_.getBlock(p_150924_1_ - var6, p_150924_2_ + 1, p_150924_3_ - var7).isNormalCube() ? 1 : 0); + int var9 = (p_150924_0_.getBlock(p_150924_1_ + var6, p_150924_2_, p_150924_3_ + var7).isNormalCube() ? 1 : 0) + (p_150924_0_.getBlock(p_150924_1_ + var6, p_150924_2_ + 1, p_150924_3_ + var7).isNormalCube() ? 1 : 0); + boolean var10 = p_150924_0_.getBlock(p_150924_1_ - var6, p_150924_2_, p_150924_3_ - var7) == p_150924_5_ || p_150924_0_.getBlock(p_150924_1_ - var6, p_150924_2_ + 1, p_150924_3_ - var7) == p_150924_5_; + boolean var11 = p_150924_0_.getBlock(p_150924_1_ + var6, p_150924_2_, p_150924_3_ + var7) == p_150924_5_ || p_150924_0_.getBlock(p_150924_1_ + var6, p_150924_2_ + 1, p_150924_3_ + var7) == p_150924_5_; + boolean var12 = false; + + if (var10 && !var11) { + var12 = true; + } else if (var9 > var8) { + var12 = true; + } + + p_150924_0_.setBlock(p_150924_1_, p_150924_2_, p_150924_3_, p_150924_5_, p_150924_4_, 2); + p_150924_0_.setBlock(p_150924_1_, p_150924_2_ + 1, p_150924_3_, p_150924_5_, 8 | (var12 ? 1 : 0), 2); + p_150924_0_.notifyBlocksOfNeighborChange(p_150924_1_, p_150924_2_, p_150924_3_, p_150924_5_); + p_150924_0_.notifyBlocksOfNeighborChange(p_150924_1_, p_150924_2_ + 1, p_150924_3_, p_150924_5_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDoublePlant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDoublePlant.java new file mode 100644 index 0000000..99c2ee4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDoublePlant.java @@ -0,0 +1,26 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerGrass; + +public class ItemDoublePlant extends ItemMultiTexture { + + + public ItemDoublePlant(Block p_i45335_1_, BlockDoublePlant p_i45335_2_, String[] p_i45335_3_) { + super(p_i45335_1_, p_i45335_2_, p_i45335_3_); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return BlockDoublePlant.func_149890_d(p_77617_1_) == 0 ? ((BlockDoublePlant)this.field_150941_b).field_149891_b[0] : ((BlockDoublePlant)this.field_150941_b).func_149888_a(true, p_77617_1_); + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + int var3 = BlockDoublePlant.func_149890_d(p_82790_1_.getItemDamage()); + return var3 != 2 && var3 != 3 ? super.getColorFromItemStack(p_82790_1_, p_82790_2_) : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDye.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDye.java new file mode 100644 index 0000000..638e082 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemDye.java @@ -0,0 +1,187 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; +import net.minecraft.block.BlockLog; +import net.minecraft.block.IGrowable; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemDye extends Item { + public static final String[] field_150923_a = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"}; + public static final String[] field_150921_b = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"}; + public static final int[] field_150922_c = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; + private IIcon[] field_150920_d; + + + public ItemDye() { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + int var2 = MathHelper.clamp_int(p_77617_1_, 0, 15); + return this.field_150920_d[var2]; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + int var2 = MathHelper.clamp_int(p_77667_1_.getItemDamage(), 0, 15); + return super.getUnlocalizedName() + "." + field_150923_a[var2]; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + if (p_77648_1_.getItemDamage() == 15) { + if (func_150919_a(p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) { + if (!p_77648_3_.isClient) { + p_77648_3_.playAuxSFX(2005, p_77648_4_, p_77648_5_, p_77648_6_, 0); + } + + return true; + } + } else if (p_77648_1_.getItemDamage() == 3) { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + int var12 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + + if (var11 == Blocks.log && BlockLog.func_150165_c(var12) == 3) { + if (p_77648_7_ == 0) { + return false; + } + + if (p_77648_7_ == 1) { + return false; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + + if (p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_)) { + int var13 = Blocks.cocoa.onBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, 0); + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.cocoa, var13, 2); + + if (!p_77648_2_.capabilities.isCreativeMode) { + --p_77648_1_.stackSize; + } + } + + return true; + } + } + + return false; + } + } + + public static boolean func_150919_a(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_) { + Block var5 = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_); + + if (var5 instanceof IGrowable) { + IGrowable var6 = (IGrowable)var5; + + if (var6.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isClient)) { + if (!p_150919_1_.isClient) { + if (var6.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_)) { + var6.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_); + } + + --p_150919_0_.stackSize; + } + + return true; + } + } + + return false; + } + + public static void func_150918_a(World p_150918_0_, int p_150918_1_, int p_150918_2_, int p_150918_3_, int p_150918_4_) { + if (p_150918_4_ == 0) { + p_150918_4_ = 15; + } + + Block var5 = p_150918_0_.getBlock(p_150918_1_, p_150918_2_, p_150918_3_); + + if (var5.getMaterial() != Material.air) { + var5.setBlockBoundsBasedOnState(p_150918_0_, p_150918_1_, p_150918_2_, p_150918_3_); + + for (int var6 = 0; var6 < p_150918_4_; ++var6) { + double var7 = itemRand.nextGaussian() * 0.02D; + double var9 = itemRand.nextGaussian() * 0.02D; + double var11 = itemRand.nextGaussian() * 0.02D; + p_150918_0_.spawnParticle("happyVillager", (float)p_150918_1_ + itemRand.nextFloat(), (double)p_150918_2_ + (double)itemRand.nextFloat() * var5.getBlockBoundsMaxY(), (float)p_150918_3_ + itemRand.nextFloat(), var7, var9, var11); + } + } + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) { + if (p_111207_3_ instanceof EntitySheep) { + EntitySheep var4 = (EntitySheep)p_111207_3_; + int var5 = BlockColored.func_150032_b(p_111207_1_.getItemDamage()); + + if (!var4.getSheared() && var4.getFleeceColor() != var5) { + var4.setFleeceColor(var5); + --p_111207_1_.stackSize; + } + + return true; + } else { + return false; + } + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + for (int var4 = 0; var4 < 16; ++var4) { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, var4)); + } + } + + public void registerIcons(IIconRegister p_94581_1_) { + this.field_150920_d = new IIcon[field_150921_b.length]; + + for (int var2 = 0; var2 < field_150921_b.length; ++var2) { + this.field_150920_d[var2] = p_94581_1_.registerIcon(this.getIconString() + "_" + field_150921_b[var2]); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEditableBook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEditableBook.java new file mode 100644 index 0000000..f7bf488 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEditableBook.java @@ -0,0 +1,74 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; + +public class ItemEditableBook extends Item { + + + public ItemEditableBook() { + this.setMaxStackSize(1); + } + + public static boolean validBookTagContents(NBTTagCompound p_77828_0_) { + if (!ItemWritableBook.func_150930_a(p_77828_0_)) { + return false; + } else if (!p_77828_0_.func_150297_b("title", 8)) { + return false; + } else { + String var1 = p_77828_0_.getString("title"); + return var1 != null && var1.length() <= 16 && p_77828_0_.func_150297_b("author", 8); + } + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) { + if (p_77653_1_.hasTagCompound()) { + NBTTagCompound var2 = p_77653_1_.getTagCompound(); + String var3 = var2.getString("title"); + + if (!StringUtils.isNullOrEmpty(var3)) { + return var3; + } + } + + return super.getItemStackDisplayName(p_77653_1_); + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + if (p_77624_1_.hasTagCompound()) { + NBTTagCompound var5 = p_77624_1_.getTagCompound(); + String var6 = var5.getString("author"); + + if (!StringUtils.isNullOrEmpty(var6)) { + p_77624_3_.add(EnumChatFormatting.GRAY + StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {var6})); + } + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + p_77659_3_.displayGUIBook(p_77659_1_); + return p_77659_1_; + } + + /** + * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the com.cheatbreaker.client. + */ + public boolean getShareTag() { + return true; + } + + public boolean hasEffect(ItemStack p_77636_1_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEgg.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEgg.java new file mode 100644 index 0000000..945ac88 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEgg.java @@ -0,0 +1,32 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.world.World; + +public class ItemEgg extends Item { + + + public ItemEgg() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!p_77659_2_.isClient) { + p_77659_2_.spawnEntityInWorld(new EntityEgg(p_77659_2_, p_77659_3_)); + } + + return p_77659_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEmptyMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEmptyMap.java new file mode 100644 index 0000000..08993a1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEmptyMap.java @@ -0,0 +1,42 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class ItemEmptyMap extends ItemMapBase { + + + protected ItemEmptyMap() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + ItemStack var4 = new ItemStack(Items.filled_map, 1, p_77659_2_.getUniqueDataId("map")); + String var5 = "map_" + var4.getItemDamage(); + MapData var6 = new MapData(var5); + p_77659_2_.setItemData(var5, var6); + var6.scale = 0; + int var7 = 128 * (1 << var6.scale); + var6.xCenter = (int)(Math.round(p_77659_3_.posX / (double)var7) * (long)var7); + var6.zCenter = (int)(Math.round(p_77659_3_.posZ / (double)var7) * (long)var7); + var6.dimension = (byte)p_77659_2_.provider.dimensionId; + var6.markDirty(); + --p_77659_1_.stackSize; + + if (p_77659_1_.stackSize <= 0) { + return var4; + } else { + if (!p_77659_3_.inventory.addItemStackToInventory(var4.copy())) { + p_77659_3_.dropPlayerItemWithRandomChoice(var4, false); + } + + return p_77659_1_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnchantedBook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnchantedBook.java new file mode 100644 index 0000000..55b906a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnchantedBook.java @@ -0,0 +1,116 @@ +package net.minecraft.item; + +import java.util.List; +import java.util.Random; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.WeightedRandomChestContent; + +public class ItemEnchantedBook extends Item { + + + public boolean hasEffect(ItemStack p_77636_1_) { + return true; + } + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) { + return false; + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) { + return this.func_92110_g(p_77613_1_).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(p_77613_1_); + } + + public NBTTagList func_92110_g(ItemStack p_92110_1_) { + return p_92110_1_.stackTagCompound != null && p_92110_1_.stackTagCompound.func_150297_b("StoredEnchantments", 9) ? (NBTTagList)p_92110_1_.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList(); + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_); + NBTTagList var5 = this.func_92110_g(p_77624_1_); + + if (var5 != null) { + for (int var6 = 0; var6 < var5.tagCount(); ++var6) { + short var7 = var5.getCompoundTagAt(var6).getShort("id"); + short var8 = var5.getCompoundTagAt(var6).getShort("lvl"); + + if (Enchantment.enchantmentsList[var7] != null) { + p_77624_3_.add(Enchantment.enchantmentsList[var7].getTranslatedName(var8)); + } + } + } + } + + /** + * Adds an stored enchantment to an enchanted book ItemStack + */ + public void addEnchantment(ItemStack p_92115_1_, EnchantmentData p_92115_2_) { + NBTTagList var3 = this.func_92110_g(p_92115_1_); + boolean var4 = true; + + for (int var5 = 0; var5 < var3.tagCount(); ++var5) { + NBTTagCompound var6 = var3.getCompoundTagAt(var5); + + if (var6.getShort("id") == p_92115_2_.enchantmentobj.effectId) { + if (var6.getShort("lvl") < p_92115_2_.enchantmentLevel) { + var6.setShort("lvl", (short)p_92115_2_.enchantmentLevel); + } + + var4 = false; + break; + } + } + + if (var4) { + NBTTagCompound var7 = new NBTTagCompound(); + var7.setShort("id", (short)p_92115_2_.enchantmentobj.effectId); + var7.setShort("lvl", (short)p_92115_2_.enchantmentLevel); + var3.appendTag(var7); + } + + if (!p_92115_1_.hasTagCompound()) { + p_92115_1_.setTagCompound(new NBTTagCompound()); + } + + p_92115_1_.getTagCompound().setTag("StoredEnchantments", var3); + } + + /** + * Returns the ItemStack of an enchanted version of this item. + */ + public ItemStack getEnchantedItemStack(EnchantmentData p_92111_1_) { + ItemStack var2 = new ItemStack(this); + this.addEnchantment(var2, p_92111_1_); + return var2; + } + + public void func_92113_a(Enchantment p_92113_1_, List p_92113_2_) { + for (int var3 = p_92113_1_.getMinLevel(); var3 <= p_92113_1_.getMaxLevel(); ++var3) { + p_92113_2_.add(this.getEnchantedItemStack(new EnchantmentData(p_92113_1_, var3))); + } + } + + public WeightedRandomChestContent func_92114_b(Random p_92114_1_) { + return this.func_92112_a(p_92114_1_, 1, 1, 1); + } + + public WeightedRandomChestContent func_92112_a(Random p_92112_1_, int p_92112_2_, int p_92112_3_, int p_92112_4_) { + ItemStack var5 = new ItemStack(Items.book, 1, 0); + EnchantmentHelper.addRandomEnchantment(p_92112_1_, var5, 30); + return new WeightedRandomChestContent(var5, p_92112_2_, p_92112_3_, p_92112_4_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnderEye.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnderEye.java new file mode 100644 index 0000000..d843c6a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnderEye.java @@ -0,0 +1,154 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockEndPortalFrame; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public class ItemEnderEye extends Item { + + + public ItemEnderEye() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + int var12 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + + if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && var11 == Blocks.end_portal_frame && !BlockEndPortalFrame.func_150020_b(var12)) { + if (p_77648_3_.isClient) { + return true; + } else { + p_77648_3_.setBlockMetadataWithNotify(p_77648_4_, p_77648_5_, p_77648_6_, var12 + 4, 2); + p_77648_3_.func_147453_f(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.end_portal_frame); + --p_77648_1_.stackSize; + int var13; + + for (var13 = 0; var13 < 16; ++var13) { + double var14 = (float)p_77648_4_ + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F; + double var16 = (float)p_77648_5_ + 0.8125F; + double var18 = (float)p_77648_6_ + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F; + double var20 = 0.0D; + double var22 = 0.0D; + double var24 = 0.0D; + p_77648_3_.spawnParticle("smoke", var14, var16, var18, var20, var22, var24); + } + + var13 = var12 & 3; + int var26 = 0; + int var15 = 0; + boolean var27 = false; + boolean var17 = true; + int var28 = Direction.rotateRight[var13]; + int var19; + int var21; + int var29; + + for (var19 = -2; var19 <= 2; ++var19) { + var29 = p_77648_4_ + Direction.offsetX[var28] * var19; + var21 = p_77648_6_ + Direction.offsetZ[var28] * var19; + + if (p_77648_3_.getBlock(var29, p_77648_5_, var21) == Blocks.end_portal_frame) { + if (!BlockEndPortalFrame.func_150020_b(p_77648_3_.getBlockMetadata(var29, p_77648_5_, var21))) { + var17 = false; + break; + } + + var15 = var19; + + if (!var27) { + var26 = var19; + var27 = true; + } + } + } + + if (var17 && var15 == var26 + 2) { + for (var19 = var26; var19 <= var15; ++var19) { + var29 = p_77648_4_ + Direction.offsetX[var28] * var19; + var21 = p_77648_6_ + Direction.offsetZ[var28] * var19; + var29 += Direction.offsetX[var13] * 4; + var21 += Direction.offsetZ[var13] * 4; + + if (p_77648_3_.getBlock(var29, p_77648_5_, var21) != Blocks.end_portal_frame || !BlockEndPortalFrame.func_150020_b(p_77648_3_.getBlockMetadata(var29, p_77648_5_, var21))) { + var17 = false; + break; + } + } + + int var30; + + for (var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) { + for (var29 = 1; var29 <= 3; ++var29) { + var21 = p_77648_4_ + Direction.offsetX[var28] * var19; + var30 = p_77648_6_ + Direction.offsetZ[var28] * var19; + var21 += Direction.offsetX[var13] * var29; + var30 += Direction.offsetZ[var13] * var29; + + if (p_77648_3_.getBlock(var21, p_77648_5_, var30) != Blocks.end_portal_frame || !BlockEndPortalFrame.func_150020_b(p_77648_3_.getBlockMetadata(var21, p_77648_5_, var30))) { + var17 = false; + break; + } + } + } + + if (var17) { + for (var19 = var26; var19 <= var15; ++var19) { + for (var29 = 1; var29 <= 3; ++var29) { + var21 = p_77648_4_ + Direction.offsetX[var28] * var19; + var30 = p_77648_6_ + Direction.offsetZ[var28] * var19; + var21 += Direction.offsetX[var13] * var29; + var30 += Direction.offsetZ[var13] * var29; + p_77648_3_.setBlock(var21, p_77648_5_, var30, Blocks.end_portal, 0, 2); + } + } + } + } + + return true; + } + } else { + return false; + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, false); + + if (var4 != null && var4.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && p_77659_2_.getBlock(var4.blockX, var4.blockY, var4.blockZ) == Blocks.end_portal_frame) { + return p_77659_1_; + } else { + if (!p_77659_2_.isClient) { + ChunkPosition var5 = p_77659_2_.findClosestStructure("Stronghold", (int)p_77659_3_.posX, (int)p_77659_3_.posY, (int)p_77659_3_.posZ); + + if (var5 != null) { + EntityEnderEye var6 = new EntityEnderEye(p_77659_2_, p_77659_3_.posX, p_77659_3_.posY + 1.62D - (double)p_77659_3_.yOffset, p_77659_3_.posZ); + var6.moveTowards(var5.field_151329_a, var5.field_151327_b, var5.field_151328_c); + p_77659_2_.spawnEntityInWorld(var6); + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + p_77659_2_.playAuxSFXAtEntity(null, 1002, (int)p_77659_3_.posX, (int)p_77659_3_.posY, (int)p_77659_3_.posZ, 0); + + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + } + } + + return p_77659_1_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnderPearl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnderPearl.java new file mode 100644 index 0000000..a4913b1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemEnderPearl.java @@ -0,0 +1,33 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class ItemEnderPearl extends Item { + + + public ItemEnderPearl() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (p_77659_3_.capabilities.isCreativeMode) { + return p_77659_1_; + } else { + --p_77659_1_.stackSize; + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!p_77659_2_.isClient) { + p_77659_2_.spawnEntityInWorld(new EntityEnderPearl(p_77659_2_, p_77659_3_)); + } + + return p_77659_1_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemExpBottle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemExpBottle.java new file mode 100644 index 0000000..1d7e36c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemExpBottle.java @@ -0,0 +1,35 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class ItemExpBottle extends Item { + + + public ItemExpBottle() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public boolean hasEffect(ItemStack p_77636_1_) { + return true; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!p_77659_2_.isClient) { + p_77659_2_.spawnEntityInWorld(new EntityExpBottle(p_77659_2_, p_77659_3_)); + } + + return p_77659_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFireball.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFireball.java new file mode 100644 index 0000000..170298f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFireball.java @@ -0,0 +1,64 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemFireball extends Item { + + + public ItemFireball() { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_3_.isClient) { + return true; + } else { + if (p_77648_7_ == 0) { + --p_77648_5_; + } + + if (p_77648_7_ == 1) { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).getMaterial() == Material.air) { + p_77648_3_.playSoundEffect((double)p_77648_4_ + 0.5D, (double)p_77648_5_ + 0.5D, (double)p_77648_6_ + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.fire); + } + + if (!p_77648_2_.capabilities.isCreativeMode) { + --p_77648_1_.stackSize; + } + + return true; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFirework.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFirework.java new file mode 100644 index 0000000..761d66c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFirework.java @@ -0,0 +1,66 @@ +package net.minecraft.item; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemFirework extends Item { + + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (!p_77648_3_.isClient) { + EntityFireworkRocket var11 = new EntityFireworkRocket(p_77648_3_, (float)p_77648_4_ + p_77648_8_, (float)p_77648_5_ + p_77648_9_, (float)p_77648_6_ + p_77648_10_, p_77648_1_); + p_77648_3_.spawnEntityInWorld(var11); + + if (!p_77648_2_.capabilities.isCreativeMode) { + --p_77648_1_.stackSize; + } + + return true; + } else { + return false; + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + if (p_77624_1_.hasTagCompound()) { + NBTTagCompound var5 = p_77624_1_.getTagCompound().getCompoundTag("Fireworks"); + + if (var5 != null) { + if (var5.func_150297_b("Flight", 99)) { + p_77624_3_.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + var5.getByte("Flight")); + } + + NBTTagList var6 = var5.getTagList("Explosions", 10); + + if (var6 != null && var6.tagCount() > 0) { + for (int var7 = 0; var7 < var6.tagCount(); ++var7) { + NBTTagCompound var8 = var6.getCompoundTagAt(var7); + ArrayList var9 = new ArrayList(); + ItemFireworkCharge.func_150902_a(var8, var9); + + if (var9.size() > 0) { + for (int var10 = 1; var10 < var9.size(); ++var10) { + var9.set(var10, " " + var9.get(var10)); + } + + p_77624_3_.addAll(var9); + } + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFireworkCharge.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFireworkCharge.java new file mode 100644 index 0000000..8e88dbb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFireworkCharge.java @@ -0,0 +1,186 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagIntArray; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +public class ItemFireworkCharge extends Item { + private IIcon field_150904_a; + + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { + return p_77618_2_ > 0 ? this.field_150904_a : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + if (p_82790_2_ != 1) { + return super.getColorFromItemStack(p_82790_1_, p_82790_2_); + } else { + NBTBase var3 = func_150903_a(p_82790_1_, "Colors"); + + if (var3 != null && var3 instanceof NBTTagIntArray) { + NBTTagIntArray var4 = (NBTTagIntArray)var3; + int[] var5 = var4.func_150302_c(); + + if (var5.length == 1) { + return var5[0]; + } else { + int var6 = 0; + int var7 = 0; + int var8 = 0; + int[] var9 = var5; + int var10 = var5.length; + + for (int var11 = 0; var11 < var10; ++var11) { + int var12 = var9[var11]; + var6 += (var12 & 16711680) >> 16; + var7 += (var12 & 65280) >> 8; + var8 += (var12 & 255) >> 0; + } + + var6 /= var5.length; + var7 /= var5.length; + var8 /= var5.length; + return var6 << 16 | var7 << 8 | var8; + } + } else { + return 9079434; + } + } + } + + public boolean requiresMultipleRenderPasses() { + return true; + } + + public static NBTBase func_150903_a(ItemStack p_150903_0_, String p_150903_1_) { + if (p_150903_0_.hasTagCompound()) { + NBTTagCompound var2 = p_150903_0_.getTagCompound().getCompoundTag("Explosion"); + + if (var2 != null) { + return var2.getTag(p_150903_1_); + } + } + + return null; + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + if (p_77624_1_.hasTagCompound()) { + NBTTagCompound var5 = p_77624_1_.getTagCompound().getCompoundTag("Explosion"); + + if (var5 != null) { + func_150902_a(var5, p_77624_3_); + } + } + } + + public static void func_150902_a(NBTTagCompound p_150902_0_, List p_150902_1_) { + byte var2 = p_150902_0_.getByte("Type"); + + if (var2 >= 0 && var2 <= 4) { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.type." + var2).trim()); + } else { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); + } + + int[] var3 = p_150902_0_.getIntArray("Colors"); + int var8; + int var9; + + if (var3.length > 0) { + boolean var4 = true; + String var5 = ""; + int[] var6 = var3; + int var7 = var3.length; + + for (var8 = 0; var8 < var7; ++var8) { + var9 = var6[var8]; + + if (!var4) { + var5 = var5 + ", "; + } + + var4 = false; + boolean var10 = false; + + for (int var11 = 0; var11 < 16; ++var11) { + if (var9 == ItemDye.field_150922_c[var11]) { + var10 = true; + var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.field_150923_a[var11]); + break; + } + } + + if (!var10) { + var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + p_150902_1_.add(var5); + } + + int[] var13 = p_150902_0_.getIntArray("FadeColors"); + boolean var14; + + if (var13.length > 0) { + var14 = true; + String var15 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " "; + int[] var17 = var13; + var8 = var13.length; + + for (var9 = 0; var9 < var8; ++var9) { + int var18 = var17[var9]; + + if (!var14) { + var15 = var15 + ", "; + } + + var14 = false; + boolean var19 = false; + + for (int var12 = 0; var12 < 16; ++var12) { + if (var18 == ItemDye.field_150922_c[var12]) { + var19 = true; + var15 = var15 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.field_150923_a[var12]); + break; + } + } + + if (!var19) { + var15 = var15 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + p_150902_1_.add(var15); + } + + var14 = p_150902_0_.getBoolean("Trail"); + + if (var14) { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); + } + + boolean var16 = p_150902_0_.getBoolean("Flicker"); + + if (var16) { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); + } + } + + public void registerIcons(IIconRegister p_94581_1_) { + super.registerIcons(p_94581_1_); + this.field_150904_a = p_94581_1_.registerIcon(this.getIconString() + "_overlay"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFishFood.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFishFood.java new file mode 100644 index 0000000..9737e60 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFishFood.java @@ -0,0 +1,195 @@ +package net.minecraft.item; + +import com.google.common.collect.Maps; +import java.util.List; +import java.util.Map; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemFishFood extends ItemFood { + private final boolean field_150907_b; + + + public ItemFishFood(boolean p_i45338_1_) { + super(0, 0.0F, false); + this.field_150907_b = p_i45338_1_; + } + + public int func_150905_g(ItemStack p_150905_1_) { + ItemFishFood.FishType var2 = ItemFishFood.FishType.func_150978_a(p_150905_1_); + return this.field_150907_b && var2.func_150973_i() ? var2.func_150970_e() : var2.func_150975_c(); + } + + public float func_150906_h(ItemStack p_150906_1_) { + ItemFishFood.FishType var2 = ItemFishFood.FishType.func_150978_a(p_150906_1_); + return this.field_150907_b && var2.func_150973_i() ? var2.func_150977_f() : var2.func_150967_d(); + } + + public String getPotionEffect(ItemStack p_150896_1_) { + return ItemFishFood.FishType.func_150978_a(p_150896_1_) == ItemFishFood.FishType.PUFFERFISH ? PotionHelper.field_151423_m : null; + } + + public void registerIcons(IIconRegister p_94581_1_) { + ItemFishFood.FishType[] var2 = ItemFishFood.FishType.values(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + ItemFishFood.FishType var5 = var2[var4]; + var5.func_150968_a(p_94581_1_); + } + } + + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) { + ItemFishFood.FishType var4 = ItemFishFood.FishType.func_150978_a(p_77849_1_); + + if (var4 == ItemFishFood.FishType.PUFFERFISH) { + p_77849_3_.addPotionEffect(new PotionEffect(Potion.poison.id, 1200, 3)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.hunger.id, 300, 2)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 1)); + } + + super.onFoodEaten(p_77849_1_, p_77849_2_, p_77849_3_); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + ItemFishFood.FishType var2 = ItemFishFood.FishType.func_150974_a(p_77617_1_); + return this.field_150907_b && var2.func_150973_i() ? var2.func_150979_h() : var2.func_150971_g(); + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + ItemFishFood.FishType[] var4 = ItemFishFood.FishType.values(); + int var5 = var4.length; + + for (int var6 = 0; var6 < var5; ++var6) { + ItemFishFood.FishType var7 = var4[var6]; + + if (!this.field_150907_b || var7.func_150973_i()) { + p_150895_3_.add(new ItemStack(this, 1, var7.func_150976_a())); + } + } + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + ItemFishFood.FishType var2 = ItemFishFood.FishType.func_150978_a(p_77667_1_); + return this.getUnlocalizedName() + "." + var2.func_150972_b() + "." + (this.field_150907_b && var2.func_150973_i() ? "cooked" : "raw"); + } + + public enum FishType { + COD("COD", 0, 0, "cod", 2, 0.1F, 5, 0.6F), + SALMON("SALMON", 1, 1, "salmon", 2, 0.1F, 6, 0.8F), + CLOWNFISH("CLOWNFISH", 2, 2, "clownfish", 1, 0.1F), + PUFFERFISH("PUFFERFISH", 3, 3, "pufferfish", 1, 0.1F); + private static final Map field_150983_e = Maps.newHashMap(); + private final int field_150980_f; + private final String field_150981_g; + private IIcon field_150993_h; + private IIcon field_150994_i; + private final int field_150991_j; + private final float field_150992_k; + private final int field_150989_l; + private final float field_150990_m; + private boolean field_150987_n = false; + + private static final ItemFishFood.FishType[] $VALUES = new ItemFishFood.FishType[]{COD, SALMON, CLOWNFISH, PUFFERFISH}; + + + FishType(String p_i45336_1_, int p_i45336_2_, int p_i45336_3_, String p_i45336_4_, int p_i45336_5_, float p_i45336_6_, int p_i45336_7_, float p_i45336_8_) { + this.field_150980_f = p_i45336_3_; + this.field_150981_g = p_i45336_4_; + this.field_150991_j = p_i45336_5_; + this.field_150992_k = p_i45336_6_; + this.field_150989_l = p_i45336_7_; + this.field_150990_m = p_i45336_8_; + this.field_150987_n = true; + } + + FishType(String p_i45337_1_, int p_i45337_2_, int p_i45337_3_, String p_i45337_4_, int p_i45337_5_, float p_i45337_6_) { + this.field_150980_f = p_i45337_3_; + this.field_150981_g = p_i45337_4_; + this.field_150991_j = p_i45337_5_; + this.field_150992_k = p_i45337_6_; + this.field_150989_l = 0; + this.field_150990_m = 0.0F; + this.field_150987_n = false; + } + + public int func_150976_a() { + return this.field_150980_f; + } + + public String func_150972_b() { + return this.field_150981_g; + } + + public int func_150975_c() { + return this.field_150991_j; + } + + public float func_150967_d() { + return this.field_150992_k; + } + + public int func_150970_e() { + return this.field_150989_l; + } + + public float func_150977_f() { + return this.field_150990_m; + } + + public void func_150968_a(IIconRegister p_150968_1_) { + this.field_150993_h = p_150968_1_.registerIcon("fish_" + this.field_150981_g + "_raw"); + + if (this.field_150987_n) { + this.field_150994_i = p_150968_1_.registerIcon("fish_" + this.field_150981_g + "_cooked"); + } + } + + public IIcon func_150971_g() { + return this.field_150993_h; + } + + public IIcon func_150979_h() { + return this.field_150994_i; + } + + public boolean func_150973_i() { + return this.field_150987_n; + } + + public static ItemFishFood.FishType func_150974_a(int p_150974_0_) { + ItemFishFood.FishType var1 = (ItemFishFood.FishType)field_150983_e.get(Integer.valueOf(p_150974_0_)); + return var1 == null ? COD : var1; + } + + public static ItemFishFood.FishType func_150978_a(ItemStack p_150978_0_) { + return p_150978_0_.getItem() instanceof ItemFishFood ? func_150974_a(p_150978_0_.getItemDamage()) : COD; + } + + static { + ItemFishFood.FishType[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + ItemFishFood.FishType var3 = var0[var2]; + field_150983_e.put(Integer.valueOf(var3.func_150976_a()), var3); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFishingRod.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFishingRod.java new file mode 100644 index 0000000..c2cee0a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFishingRod.java @@ -0,0 +1,78 @@ +package net.minecraft.item; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemFishingRod extends Item { + private IIcon theIcon; + + + public ItemFishingRod() { + this.setMaxDamage(64); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /** + * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities + * hands. + */ + public boolean shouldRotateAroundWhenRendering() { + return true; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (p_77659_3_.fishEntity != null) { + int var4 = p_77659_3_.fishEntity.func_146034_e(); + p_77659_1_.damageItem(var4, p_77659_3_); + p_77659_3_.swingItem(); + } else { + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!p_77659_2_.isClient) { + p_77659_2_.spawnEntityInWorld(new EntityFishHook(p_77659_2_, p_77659_3_)); + } + + p_77659_3_.swingItem(); + } + + return p_77659_1_; + } + + public void registerIcons(IIconRegister p_94581_1_) { + this.itemIcon = p_94581_1_.registerIcon(this.getIconString() + "_uncast"); + this.theIcon = p_94581_1_.registerIcon(this.getIconString() + "_cast"); + } + + public IIcon func_94597_g() { + return this.theIcon; + } + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) { + return super.isItemTool(p_77616_1_); + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFlag.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFlag.java new file mode 100644 index 0000000..c3a0f9e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFlag.java @@ -0,0 +1,12 @@ +package net.minecraft.item; + +enum ItemFlag { + DISPLAY_NAME, + ITEM_STACK_INFORMATION, + ENCHANTMENTS, + COLOR, + LORE, + ATTRIBUTE_MODIFIERS, + UNBREAKABLE, + DURABILITY +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFlintAndSteel.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFlintAndSteel.java new file mode 100644 index 0000000..efbb1fe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFlintAndSteel.java @@ -0,0 +1,59 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemFlintAndSteel extends Item { + + + public ItemFlintAndSteel() { + this.maxStackSize = 1; + this.setMaxDamage(64); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_7_ == 0) { + --p_77648_5_; + } + + if (p_77648_7_ == 1) { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).getMaterial() == Material.air) { + p_77648_3_.playSoundEffect((double)p_77648_4_ + 0.5D, (double)p_77648_5_ + 0.5D, (double)p_77648_6_ + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.fire); + } + + p_77648_1_.damageItem(1, p_77648_2_); + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFood.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFood.java new file mode 100644 index 0000000..66f69bd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemFood.java @@ -0,0 +1,124 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class ItemFood extends Item { + /** Number of ticks to run while 'EnumAction'ing until result. */ + public final int itemUseDuration; + + /** The amount this food item heals the player. */ + private final int healAmount; + private final float saturationModifier; + + /** Whether wolves like this food (true for raw and cooked porkchop). */ + private final boolean isWolfsFavoriteMeat; + + /** + * If this field is true, the food can be consumed even if the player don't need to eat. + */ + private boolean alwaysEdible; + + /** + * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect + */ + private int potionId; + + /** set by setPotionEffect */ + private int potionDuration; + + /** set by setPotionEffect */ + private int potionAmplifier; + + /** probably of the set potion effect occurring */ + private float potionEffectProbability; + + + public ItemFood(int p_i45339_1_, float p_i45339_2_, boolean p_i45339_3_) { + this.itemUseDuration = 32; + this.healAmount = p_i45339_1_; + this.isWolfsFavoriteMeat = p_i45339_3_; + this.saturationModifier = p_i45339_2_; + this.setCreativeTab(CreativeTabs.tabFood); + } + + public ItemFood(int p_i45340_1_, boolean p_i45340_2_) { + this(p_i45340_1_, 0.6F, p_i45340_2_); + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + --p_77654_1_.stackSize; + p_77654_3_.getFoodStats().func_151686_a(this, p_77654_1_); + p_77654_2_.playSoundAtEntity(p_77654_3_, "random.burp", 0.5F, p_77654_2_.rand.nextFloat() * 0.1F + 0.9F); + this.onFoodEaten(p_77654_1_, p_77654_2_, p_77654_3_); + return p_77654_1_; + } + + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) { + if (!p_77849_2_.isClient && this.potionId > 0 && p_77849_2_.rand.nextFloat() < this.potionEffectProbability) { + p_77849_3_.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); + } + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 32; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.eat; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (p_77659_3_.canEat(this.alwaysEdible)) { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + } + + return p_77659_1_; + } + + public int func_150905_g(ItemStack p_150905_1_) { + return this.healAmount; + } + + public float func_150906_h(ItemStack p_150906_1_) { + return this.saturationModifier; + } + + /** + * Whether wolves like this food (true for raw and cooked porkchop). + */ + public boolean isWolfsFavoriteMeat() { + return this.isWolfsFavoriteMeat; + } + + /** + * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, + * float probability of effect happening + */ + public ItemFood setPotionEffect(int p_77844_1_, int p_77844_2_, int p_77844_3_, float p_77844_4_) { + this.potionId = p_77844_1_; + this.potionDuration = p_77844_2_; + this.potionAmplifier = p_77844_3_; + this.potionEffectProbability = p_77844_4_; + return this; + } + + /** + * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. + */ + public ItemFood setAlwaysEdible() { + this.alwaysEdible = true; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemGlassBottle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemGlassBottle.java new file mode 100644 index 0000000..28d5611 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemGlassBottle.java @@ -0,0 +1,66 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemGlassBottle extends Item { + + + public ItemGlassBottle() { + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return Items.potionitem.getIconFromDamage(0); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, true); + + if (var4 == null) { + return p_77659_1_; + } else { + if (var4.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int var5 = var4.blockX; + int var6 = var4.blockY; + int var7 = var4.blockZ; + + if (!p_77659_2_.canMineBlock(p_77659_3_, var5, var6, var7)) { + return p_77659_1_; + } + + if (!p_77659_3_.canPlayerEdit(var5, var6, var7, var4.sideHit, p_77659_1_)) { + return p_77659_1_; + } + + if (p_77659_2_.getBlock(var5, var6, var7).getMaterial() == Material.water) { + --p_77659_1_.stackSize; + + if (p_77659_1_.stackSize <= 0) { + return new ItemStack(Items.potionitem); + } + + if (!p_77659_3_.inventory.addItemStackToInventory(new ItemStack(Items.potionitem))) { + p_77659_3_.dropPlayerItemWithRandomChoice(new ItemStack(Items.potionitem, 1, 0), false); + } + } + } + + return p_77659_1_; + } + } + + public void registerIcons(IIconRegister p_94581_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemHangingEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemHangingEntity.java new file mode 100644 index 0000000..3a5b1a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemHangingEntity.java @@ -0,0 +1,55 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Direction; +import net.minecraft.world.World; + +public class ItemHangingEntity extends Item { + private final Class hangingEntityClass; + + + public ItemHangingEntity(Class p_i45342_1_) { + this.hangingEntityClass = p_i45342_1_; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_7_ == 0) { + return false; + } else if (p_77648_7_ == 1) { + return false; + } else { + int var11 = Direction.facingToDirection[p_77648_7_]; + EntityHanging var12 = this.createHangingEntity(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, var11); + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + if (var12 != null && var12.onValidSurface()) { + if (!p_77648_3_.isClient) { + p_77648_3_.spawnEntityInWorld(var12); + } + + --p_77648_1_.stackSize; + } + + return true; + } + } + } + + /** + * Create the hanging entity associated to this item. + */ + private EntityHanging createHangingEntity(World p_82810_1_, int p_82810_2_, int p_82810_3_, int p_82810_4_, int p_82810_5_) { + return this.hangingEntityClass == EntityPainting.class ? new EntityPainting(p_82810_1_, p_82810_2_, p_82810_3_, p_82810_4_, p_82810_5_) : (this.hangingEntityClass == EntityItemFrame.class ? new EntityItemFrame(p_82810_1_, p_82810_2_, p_82810_3_, p_82810_4_, p_82810_5_) : null); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemHoe.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemHoe.java new file mode 100644 index 0000000..4e550f1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemHoe.java @@ -0,0 +1,62 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemHoe extends Item { + protected Item.ToolMaterial theToolMaterial; + + + public ItemHoe(Item.ToolMaterial p_i45343_1_) { + this.theToolMaterial = p_i45343_1_; + this.maxStackSize = 1; + this.setMaxDamage(p_i45343_1_.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).getMaterial() == Material.air && (var11 == Blocks.grass || var11 == Blocks.dirt)) { + Block var12 = Blocks.farmland; + p_77648_3_.playSoundEffect((float)p_77648_4_ + 0.5F, (float)p_77648_5_ + 0.5F, (float)p_77648_6_ + 0.5F, var12.stepSound.func_150498_e(), (var12.stepSound.func_150497_c() + 1.0F) / 2.0F, var12.stepSound.func_150494_d() * 0.8F); + + if (p_77648_3_.isClient) { + return true; + } else { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, var12); + p_77648_1_.damageItem(1, p_77648_2_); + return true; + } + } else { + return false; + } + } + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /** + * Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond + * would return "EMERALD") + */ + public String getMaterialName() { + return this.theToolMaterial.toString(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLead.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLead.java new file mode 100644 index 0000000..1c4b1ed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLead.java @@ -0,0 +1,64 @@ +package net.minecraft.item; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class ItemLead extends Item { + + + public ItemLead() { + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (var11.getRenderType() == 11) { + if (p_77648_3_.isClient) { + return true; + } else { + func_150909_a(p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_); + return true; + } + } else { + return false; + } + } + + public static boolean func_150909_a(EntityPlayer p_150909_0_, World p_150909_1_, int p_150909_2_, int p_150909_3_, int p_150909_4_) { + EntityLeashKnot var5 = EntityLeashKnot.getKnotForBlock(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_); + boolean var6 = false; + double var7 = 7.0D; + List var9 = p_150909_1_.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox((double)p_150909_2_ - var7, (double)p_150909_3_ - var7, (double)p_150909_4_ - var7, (double)p_150909_2_ + var7, (double)p_150909_3_ + var7, (double)p_150909_4_ + var7)); + + if (var9 != null) { + Iterator var10 = var9.iterator(); + + while (var10.hasNext()) { + EntityLiving var11 = (EntityLiving)var10.next(); + + if (var11.getLeashed() && var11.getLeashedToEntity() == p_150909_0_) { + if (var5 == null) { + var5 = EntityLeashKnot.func_110129_a(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_); + } + + var11.setLeashedToEntity(var5, true); + var6 = true; + } + } + } + + return var6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLeaves.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLeaves.java new file mode 100644 index 0000000..a8e3a0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLeaves.java @@ -0,0 +1,48 @@ +package net.minecraft.item; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.util.IIcon; + +public class ItemLeaves extends ItemBlock { + private final BlockLeaves field_150940_b; + + + public ItemLeaves(BlockLeaves p_i45344_1_) { + super(p_i45344_1_); + this.field_150940_b = p_i45344_1_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_ | 4; + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.field_150940_b.getIcon(0, p_77617_1_); + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + return this.field_150940_b.getRenderColor(p_82790_1_.getItemDamage()); + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + int var2 = p_77667_1_.getItemDamage(); + + if (var2 < 0 || var2 >= this.field_150940_b.func_150125_e().length) { + var2 = 0; + } + + return super.getUnlocalizedName() + "." + this.field_150940_b.func_150125_e()[var2]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLilyPad.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLilyPad.java new file mode 100644 index 0000000..9202b25 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemLilyPad.java @@ -0,0 +1,55 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemLilyPad extends ItemColored { + + + public ItemLilyPad(Block p_i45357_1_) { + super(p_i45357_1_, false); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, true); + + if (var4 == null) { + return p_77659_1_; + } else { + if (var4.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int var5 = var4.blockX; + int var6 = var4.blockY; + int var7 = var4.blockZ; + + if (!p_77659_2_.canMineBlock(p_77659_3_, var5, var6, var7)) { + return p_77659_1_; + } + + if (!p_77659_3_.canPlayerEdit(var5, var6, var7, var4.sideHit, p_77659_1_)) { + return p_77659_1_; + } + + if (p_77659_2_.getBlock(var5, var6, var7).getMaterial() == Material.water && p_77659_2_.getBlockMetadata(var5, var6, var7) == 0 && p_77659_2_.isAirBlock(var5, var6 + 1, var7)) { + p_77659_2_.setBlock(var5, var6 + 1, var7, Blocks.waterlily); + + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + } + } + + return p_77659_1_; + } + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + return Blocks.waterlily.getRenderColor(p_82790_1_.getItemDamage()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMap.java new file mode 100644 index 0000000..b548962 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMap.java @@ -0,0 +1,262 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Iterables; +import com.google.common.collect.Multisets; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.MapColor; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.MapData; + +public class ItemMap extends ItemMapBase { + + + protected ItemMap() { + this.setHasSubtypes(true); + } + + public static MapData func_150912_a(int p_150912_0_, World p_150912_1_) { + String var2 = "map_" + p_150912_0_; + MapData var3 = (MapData)p_150912_1_.loadItemData(MapData.class, var2); + + if (var3 == null) { + var3 = new MapData(var2); + p_150912_1_.setItemData(var2, var3); + } + + return var3; + } + + public MapData getMapData(ItemStack p_77873_1_, World p_77873_2_) { + String var3 = "map_" + p_77873_1_.getItemDamage(); + MapData var4 = (MapData)p_77873_2_.loadItemData(MapData.class, var3); + + if (var4 == null && !p_77873_2_.isClient) { + p_77873_1_.setItemDamage(p_77873_2_.getUniqueDataId("map")); + var3 = "map_" + p_77873_1_.getItemDamage(); + var4 = new MapData(var3); + var4.scale = 3; + int var5 = 128 * (1 << var4.scale); + var4.xCenter = Math.round((float)p_77873_2_.getWorldInfo().getSpawnX() / (float)var5) * var5; + var4.zCenter = Math.round((float)(p_77873_2_.getWorldInfo().getSpawnZ() / var5)) * var5; + var4.dimension = (byte)p_77873_2_.provider.dimensionId; + var4.markDirty(); + p_77873_2_.setItemData(var3, var4); + } + + return var4; + } + + public void updateMapData(World p_77872_1_, Entity p_77872_2_, MapData p_77872_3_) { + if (p_77872_1_.provider.dimensionId == p_77872_3_.dimension && p_77872_2_ instanceof EntityPlayer) { + int var4 = 1 << p_77872_3_.scale; + int var5 = p_77872_3_.xCenter; + int var6 = p_77872_3_.zCenter; + int var7 = MathHelper.floor_double(p_77872_2_.posX - (double)var5) / var4 + 64; + int var8 = MathHelper.floor_double(p_77872_2_.posZ - (double)var6) / var4 + 64; + int var9 = 128 / var4; + + if (p_77872_1_.provider.hasNoSky) { + var9 /= 2; + } + + MapData.MapInfo var10 = p_77872_3_.func_82568_a((EntityPlayer)p_77872_2_); + ++var10.field_82569_d; + + for (int var11 = var7 - var9 + 1; var11 < var7 + var9; ++var11) { + if ((var11 & 15) == (var10.field_82569_d & 15)) { + int var12 = 255; + int var13 = 0; + double var14 = 0.0D; + + for (int var16 = var8 - var9 - 1; var16 < var8 + var9; ++var16) { + if (var11 >= 0 && var16 >= -1 && var11 < 128 && var16 < 128) { + int var17 = var11 - var7; + int var18 = var16 - var8; + boolean var19 = var17 * var17 + var18 * var18 > (var9 - 2) * (var9 - 2); + int var20 = (var5 / var4 + var11 - 64) * var4; + int var21 = (var6 / var4 + var16 - 64) * var4; + HashMultiset var22 = HashMultiset.create(); + Chunk var23 = p_77872_1_.getChunkFromBlockCoords(var20, var21); + + if (!var23.isEmpty()) { + int var24 = var20 & 15; + int var25 = var21 & 15; + int var26 = 0; + double var27 = 0.0D; + int var29; + + if (p_77872_1_.provider.hasNoSky) { + var29 = var20 + var21 * 231871; + var29 = var29 * var29 * 31287121 + var29 * 11; + + if ((var29 >> 20 & 1) == 0) { + var22.add(Blocks.dirt.getMapColor(0), 10); + } + else { + var22.add(Blocks.stone.getMapColor(0), 100); + } + + var27 = 100.0D; + } else { + for (var29 = 0; var29 < var4; ++var29) { + for (int var30 = 0; var30 < var4; ++var30) { + int var31 = var23.getHeightValue(var29 + var24, var30 + var25) + 1; + Block var32 = Blocks.air; + int var33 = 0; + + if (var31 > 1) + { + do { + --var31; + var32 = var23.func_150810_a(var29 + var24, var31, var30 + var25); + var33 = var23.getBlockMetadata(var29 + var24, var31, var30 + var25); + } + while (var32.getMapColor(var33) == MapColor.field_151660_b && var31 > 0); + + if (var31 > 0 && var32.getMaterial().isLiquid()) { + int var34 = var31 - 1; + Block var35; + + do { + var35 = var23.func_150810_a(var29 + var24, var34--, var30 + var25); + ++var26; + } + while (var34 > 0 && var35.getMaterial().isLiquid()); + } + } + + var27 += (double)var31 / (double)(var4 * var4); + var22.add(var32.getMapColor(var33)); + } + } + } + + var26 /= var4 * var4; + double var36 = (var27 - var14) * 4.0D / (double)(var4 + 4) + ((double)(var11 + var16 & 1) - 0.5D) * 0.4D; + byte var37 = 1; + + if (var36 > 0.6D) { + var37 = 2; + } + + if (var36 < -0.6D) { + var37 = 0; + } + + MapColor var38 = Iterables.getFirst(Multisets.copyHighestCountFirst(var22), MapColor.field_151660_b); + + if (var38 == MapColor.field_151662_n) { + var36 = (double)var26 * 0.1D + (double)(var11 + var16 & 1) * 0.2D; + var37 = 1; + + if (var36 < 0.5D) { + var37 = 2; + } + + if (var36 > 0.9D) { + var37 = 0; + } + } + + var14 = var27; + + if (var16 >= 0 && var17 * var17 + var18 * var18 < var9 * var9 && (!var19 || (var11 + var16 & 1) != 0)) { + byte var39 = p_77872_3_.colors[var11 + var16 * 128]; + byte var40 = (byte)(var38.colorIndex * 4 + var37); + + if (var39 != var40) { + if (var12 > var16) { + var12 = var16; + } + + if (var13 < var16) { + var13 = var16; + } + + p_77872_3_.colors[var11 + var16 * 128] = var40; + } + } + } + } + } + + if (var12 <= var13) { + p_77872_3_.setColumnDirty(var11, var12, var13); + } + } + } + } + } + + /** + * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and + * update it's contents. + */ + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + if (!p_77663_2_.isClient) { + MapData var6 = this.getMapData(p_77663_1_, p_77663_2_); + + if (p_77663_3_ instanceof EntityPlayer) { + EntityPlayer var7 = (EntityPlayer)p_77663_3_; + var6.updateVisiblePlayers(var7, p_77663_1_); + } + + if (p_77663_5_) { + this.updateMapData(p_77663_2_, p_77663_3_, var6); + } + } + } + + public Packet func_150911_c(ItemStack p_150911_1_, World p_150911_2_, EntityPlayer p_150911_3_) { + byte[] var4 = this.getMapData(p_150911_1_, p_150911_2_).getUpdatePacketData(p_150911_1_, p_150911_2_, p_150911_3_); + return var4 == null ? null : new S34PacketMaps(p_150911_1_.getItemDamage(), var4); + } + + /** + * Called when item is crafted/smelted. Used only by maps so far. + */ + public void onCreated(ItemStack p_77622_1_, World p_77622_2_, EntityPlayer p_77622_3_) { + if (p_77622_1_.hasTagCompound() && p_77622_1_.getTagCompound().getBoolean("map_is_scaling")) { + MapData var4 = Items.filled_map.getMapData(p_77622_1_, p_77622_2_); + p_77622_1_.setItemDamage(p_77622_2_.getUniqueDataId("map")); + MapData var5 = new MapData("map_" + p_77622_1_.getItemDamage()); + var5.scale = (byte)(var4.scale + 1); + + if (var5.scale > 4) { + var5.scale = 4; + } + + var5.xCenter = var4.xCenter; + var5.zCenter = var4.zCenter; + var5.dimension = var4.dimension; + var5.markDirty(); + p_77622_2_.setItemData("map_" + p_77622_1_.getItemDamage(), var5); + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + MapData var5 = this.getMapData(p_77624_1_, p_77624_2_.worldObj); + + if (p_77624_4_) { + if (var5 == null) { + p_77624_3_.add("Unknown map"); + } else { + p_77624_3_.add("Scaling at 1:" + (1 << var5.scale)); + p_77624_3_.add("(Level " + var5.scale + "/" + 4 + ")"); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMapBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMapBase.java new file mode 100644 index 0000000..2a639b2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMapBase.java @@ -0,0 +1,20 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.Packet; +import net.minecraft.world.World; + +public class ItemMapBase extends Item { + + + /** + * false for all Items except sub-classes of ItemMapBase + */ + public boolean isMap() { + return true; + } + + public Packet func_150911_c(ItemStack p_150911_1_, World p_150911_2_, EntityPlayer p_150911_3_) { + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMinecart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMinecart.java new file mode 100644 index 0000000..091f812 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMinecart.java @@ -0,0 +1,88 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemMinecart extends Item { + private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); + + public ItemStack dispenseStack(IBlockSource p_82487_1_, ItemStack p_82487_2_) { + EnumFacing var3 = BlockDispenser.func_149937_b(p_82487_1_.getBlockMetadata()); + World var4 = p_82487_1_.getWorld(); + double var5 = p_82487_1_.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); + double var7 = p_82487_1_.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); + double var9 = p_82487_1_.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); + int var11 = p_82487_1_.getXInt() + var3.getFrontOffsetX(); + int var12 = p_82487_1_.getYInt() + var3.getFrontOffsetY(); + int var13 = p_82487_1_.getZInt() + var3.getFrontOffsetZ(); + Block var14 = var4.getBlock(var11, var12, var13); + double var15; + + if (BlockRailBase.func_150051_a(var14)) { + var15 = 0.0D; + } else { + if (var14.getMaterial() != Material.air || !BlockRailBase.func_150051_a(var4.getBlock(var11, var12 - 1, var13))) { + return this.behaviourDefaultDispenseItem.dispense(p_82487_1_, p_82487_2_); + } + + var15 = -1.0D; + } + + EntityMinecart var17 = EntityMinecart.createMinecart(var4, var5, var7 + var15, var9, ((ItemMinecart)p_82487_2_.getItem()).minecartType); + + if (p_82487_2_.hasDisplayName()) { + var17.setMinecartName(p_82487_2_.getDisplayName()); + } + + var4.spawnEntityInWorld(var17); + p_82487_2_.splitStack(1); + return p_82487_2_; + } + protected void playDispenseSound(IBlockSource p_82485_1_) { + p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0); + } + }; + public int minecartType; + + + public ItemMinecart(int p_i45345_1_) { + this.maxStackSize = 1; + this.minecartType = p_i45345_1_; + this.setCreativeTab(CreativeTabs.tabTransport); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserMinecartBehavior); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (BlockRailBase.func_150051_a(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_))) { + if (!p_77648_3_.isClient) { + EntityMinecart var11 = EntityMinecart.createMinecart(p_77648_3_, (float)p_77648_4_ + 0.5F, (float)p_77648_5_ + 0.5F, (float)p_77648_6_ + 0.5F, this.minecartType); + + if (p_77648_1_.hasDisplayName()) { + var11.setMinecartName(p_77648_1_.getDisplayName()); + } + + p_77648_3_.spawnEntityInWorld(var11); + } + + --p_77648_1_.stackSize; + return true; + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMonsterPlacer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMonsterPlacer.java new file mode 100644 index 0000000..2f62d66 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMonsterPlacer.java @@ -0,0 +1,181 @@ +package net.minecraft.item; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemMonsterPlacer extends Item { + private IIcon theIcon; + + + public ItemMonsterPlacer() { + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) { + String var2 = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); + String var3 = EntityList.getStringFromID(p_77653_1_.getItemDamage()); + + if (var3 != null) { + var2 = var2 + " " + StatCollector.translateToLocal("entity." + var3 + ".name"); + } + + return var2; + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + EntityList.EntityEggInfo var3 = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(p_82790_1_.getItemDamage())); + return var3 != null ? (p_82790_2_ == 0 ? var3.primaryColor : var3.secondaryColor) : 16777215; + } + + public boolean requiresMultipleRenderPasses() { + return true; + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { + return p_77618_2_ > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_3_.isClient) { + return true; + } else { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + p_77648_4_ += Facing.offsetsXForSide[p_77648_7_]; + p_77648_5_ += Facing.offsetsYForSide[p_77648_7_]; + p_77648_6_ += Facing.offsetsZForSide[p_77648_7_]; + double var12 = 0.0D; + + if (p_77648_7_ == 1 && var11.getRenderType() == 11) { + var12 = 0.5D; + } + + Entity var14 = spawnCreature(p_77648_3_, p_77648_1_.getItemDamage(), (double)p_77648_4_ + 0.5D, (double)p_77648_5_ + var12, (double)p_77648_6_ + 0.5D); + + if (var14 != null) { + if (var14 instanceof EntityLivingBase && p_77648_1_.hasDisplayName()) { + ((EntityLiving)var14).setCustomNameTag(p_77648_1_.getDisplayName()); + } + + if (!p_77648_2_.capabilities.isCreativeMode) { + --p_77648_1_.stackSize; + } + } + + return true; + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (p_77659_2_.isClient) { + return p_77659_1_; + } else { + MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, true); + + if (var4 == null) { + return p_77659_1_; + } else { + if (var4.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int var5 = var4.blockX; + int var6 = var4.blockY; + int var7 = var4.blockZ; + + if (!p_77659_2_.canMineBlock(p_77659_3_, var5, var6, var7)) { + return p_77659_1_; + } + + if (!p_77659_3_.canPlayerEdit(var5, var6, var7, var4.sideHit, p_77659_1_)) { + return p_77659_1_; + } + + if (p_77659_2_.getBlock(var5, var6, var7) instanceof BlockLiquid) { + Entity var8 = spawnCreature(p_77659_2_, p_77659_1_.getItemDamage(), var5, var6, var7); + + if (var8 != null) { + if (var8 instanceof EntityLivingBase && p_77659_1_.hasDisplayName()) { + ((EntityLiving)var8).setCustomNameTag(p_77659_1_.getDisplayName()); + } + + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + } + } + } + + return p_77659_1_; + } + } + } + + /** + * Spawns the creature specified by the egg's type in the location specified by the last three parameters. + * Parameters: world, entityID, x, y, z. + */ + public static Entity spawnCreature(World p_77840_0_, int p_77840_1_, double p_77840_2_, double p_77840_4_, double p_77840_6_) { + if (!EntityList.entityEggs.containsKey(Integer.valueOf(p_77840_1_))) { + return null; + } else { + Entity var8 = null; + + for (int var9 = 0; var9 < 1; ++var9) { + var8 = EntityList.createEntityByID(p_77840_1_, p_77840_0_); + + if (var8 != null && var8 instanceof EntityLivingBase) { + EntityLiving var10 = (EntityLiving)var8; + var8.setLocationAndAngles(p_77840_2_, p_77840_4_, p_77840_6_, MathHelper.wrapAngleTo180_float(p_77840_0_.rand.nextFloat() * 360.0F), 0.0F); + var10.rotationYawHead = var10.rotationYaw; + var10.renderYawOffset = var10.rotationYaw; + var10.onSpawnWithEgg(null); + p_77840_0_.spawnEntityInWorld(var8); + var10.playLivingSound(); + } + } + + return var8; + } + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + Iterator var4 = EntityList.entityEggs.values().iterator(); + + while (var4.hasNext()) { + EntityList.EntityEggInfo var5 = (EntityList.EntityEggInfo)var4.next(); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, var5.spawnedID)); + } + } + + public void registerIcons(IIconRegister p_94581_1_) { + super.registerIcons(p_94581_1_); + this.theIcon = p_94581_1_.registerIcon(this.getIconString() + "_overlay"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMultiTexture.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMultiTexture.java new file mode 100644 index 0000000..c57b2d6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemMultiTexture.java @@ -0,0 +1,46 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; + +public class ItemMultiTexture extends ItemBlock { + protected final Block field_150941_b; + protected final String[] field_150942_c; + + + public ItemMultiTexture(Block p_i45346_1_, Block p_i45346_2_, String[] p_i45346_3_) { + super(p_i45346_1_); + this.field_150941_b = p_i45346_2_; + this.field_150942_c = p_i45346_3_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.field_150941_b.getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + int var2 = p_77667_1_.getItemDamage(); + + if (var2 < 0 || var2 >= this.field_150942_c.length) { + var2 = 0; + } + + return super.getUnlocalizedName() + "." + this.field_150942_c[var2]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemNameTag.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemNameTag.java new file mode 100644 index 0000000..2c3650f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemNameTag.java @@ -0,0 +1,31 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; + +public class ItemNameTag extends Item { + + + public ItemNameTag() { + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) { + if (!p_111207_1_.hasDisplayName()) { + return false; + } else if (p_111207_3_ instanceof EntityLiving) { + EntityLiving var4 = (EntityLiving)p_111207_3_; + var4.setCustomNameTag(p_111207_1_.getDisplayName()); + var4.func_110163_bv(); + --p_111207_1_.stackSize; + return true; + } else { + return super.itemInteractionForEntity(p_111207_1_, p_111207_2_, p_111207_3_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPickaxe.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPickaxe.java new file mode 100644 index 0000000..6024635 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPickaxe.java @@ -0,0 +1,24 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; + +public class ItemPickaxe extends ItemTool { + private static final Set field_150915_c = Sets.newHashSet(Blocks.cobblestone, Blocks.double_stone_slab, Blocks.stone_slab, Blocks.stone, Blocks.sandstone, Blocks.mossy_cobblestone, Blocks.iron_ore, Blocks.iron_block, Blocks.coal_ore, Blocks.gold_block, Blocks.gold_ore, Blocks.diamond_ore, Blocks.diamond_block, Blocks.ice, Blocks.netherrack, Blocks.lapis_ore, Blocks.lapis_block, Blocks.redstone_ore, Blocks.lit_redstone_ore, Blocks.rail, Blocks.detector_rail, Blocks.golden_rail, Blocks.activator_rail); + + + protected ItemPickaxe(Item.ToolMaterial p_i45347_1_) { + super(2.0F, p_i45347_1_, field_150915_c); + } + + public boolean func_150897_b(Block p_150897_1_) { + return p_150897_1_ == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (p_150897_1_ != Blocks.diamond_block && p_150897_1_ != Blocks.diamond_ore ? (p_150897_1_ != Blocks.emerald_ore && p_150897_1_ != Blocks.emerald_block ? (p_150897_1_ != Blocks.gold_block && p_150897_1_ != Blocks.gold_ore ? (p_150897_1_ != Blocks.iron_block && p_150897_1_ != Blocks.iron_ore ? (p_150897_1_ != Blocks.lapis_block && p_150897_1_ != Blocks.lapis_ore ? (p_150897_1_ != Blocks.redstone_ore && p_150897_1_ != Blocks.lit_redstone_ore ? (p_150897_1_.getMaterial() == Material.rock || (p_150897_1_.getMaterial() == Material.iron || p_150897_1_.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { + return p_150893_2_.getMaterial() != Material.iron && p_150893_2_.getMaterial() != Material.anvil && p_150893_2_.getMaterial() != Material.rock ? super.func_150893_a(p_150893_1_, p_150893_2_) : this.efficiencyOnProperMaterial; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPiston.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPiston.java new file mode 100644 index 0000000..697e668 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPiston.java @@ -0,0 +1,18 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; + +public class ItemPiston extends ItemBlock { + + + public ItemPiston(Block p_i45348_1_) { + super(p_i45348_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return 7; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPotion.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPotion.java new file mode 100644 index 0000000..94e1b27 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemPotion.java @@ -0,0 +1,378 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemPotion extends Item { + /** + * Contains a map from integers to the list of potion effects that potions with that damage value confer (to prevent + * recalculating it). + */ + private final HashMap effectCache = new HashMap(); + private static final Map field_77835_b = new LinkedHashMap(); + private IIcon field_94591_c; + private IIcon field_94590_d; + private IIcon field_94592_ct; + + + public ItemPotion() { + this.setMaxStackSize(1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + /** + * Returns a list of potion effects for the specified itemstack. + */ + public List getEffects(ItemStack p_77832_1_) { + if (p_77832_1_.hasTagCompound() && p_77832_1_.getTagCompound().func_150297_b("CustomPotionEffects", 9)) { + ArrayList var7 = new ArrayList(); + NBTTagList var3 = p_77832_1_.getTagCompound().getTagList("CustomPotionEffects", 10); + + for (int var4 = 0; var4 < var3.tagCount(); ++var4) { + NBTTagCompound var5 = var3.getCompoundTagAt(var4); + PotionEffect var6 = PotionEffect.readCustomPotionEffectFromNBT(var5); + + if (var6 != null) { + var7.add(var6); + } + } + + return var7; + } else { + List var2 = (List)this.effectCache.get(Integer.valueOf(p_77832_1_.getItemDamage())); + + if (var2 == null) { + var2 = PotionHelper.getPotionEffects(p_77832_1_.getItemDamage(), false); + this.effectCache.put(Integer.valueOf(p_77832_1_.getItemDamage()), var2); + } + + return var2; + } + } + + /** + * Returns a list of effects for the specified potion damage value. + */ + public List getEffects(int p_77834_1_) { + List var2 = (List)this.effectCache.get(Integer.valueOf(p_77834_1_)); + + if (var2 == null) { + var2 = PotionHelper.getPotionEffects(p_77834_1_, false); + this.effectCache.put(Integer.valueOf(p_77834_1_), var2); + } + + return var2; + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + if (!p_77654_3_.capabilities.isCreativeMode) { + --p_77654_1_.stackSize; + } + + if (!p_77654_2_.isClient) { + List var4 = this.getEffects(p_77654_1_); + + if (var4 != null) { + Iterator var5 = var4.iterator(); + + while (var5.hasNext()) { + PotionEffect var6 = (PotionEffect)var5.next(); + p_77654_3_.addPotionEffect(new PotionEffect(var6)); + } + } + } + + if (!p_77654_3_.capabilities.isCreativeMode) { + if (p_77654_1_.stackSize <= 0) { + return new ItemStack(Items.glass_bottle); + } + + p_77654_3_.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); + } + + return p_77654_1_; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 32; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.drink; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (isSplash(p_77659_1_.getItemDamage())) { + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!p_77659_2_.isClient) { + p_77659_2_.spawnEntityInWorld(new EntityPotion(p_77659_2_, p_77659_3_, p_77659_1_)); + } + + return p_77659_1_; + } else { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + return p_77659_1_; + } + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + return false; + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return isSplash(p_77617_1_) ? this.field_94591_c : this.field_94590_d; + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) { + return p_77618_2_ == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + /** + * returns wether or not a potion is a throwable splash potion based on damage value + */ + public static boolean isSplash(int p_77831_0_) { + return (p_77831_0_ & 16384) != 0; + } + + public int getColorFromDamage(int p_77620_1_) { + return PotionHelper.func_77915_a(p_77620_1_, false); + } + + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) { + return p_82790_2_ > 0 ? 16777215 : this.getColorFromDamage(p_82790_1_.getItemDamage()); + } + + public boolean requiresMultipleRenderPasses() { + return true; + } + + public boolean isEffectInstant(int p_77833_1_) { + List var2 = this.getEffects(p_77833_1_); + + if (var2 != null && !var2.isEmpty()) { + Iterator var3 = var2.iterator(); + PotionEffect var4; + + do { + if (!var3.hasNext()) { + return false; + } + + var4 = (PotionEffect)var3.next(); + } + while (!Potion.potionTypes[var4.getPotionID()].isInstant()); + + return true; + } else { + return false; + } + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) { + if (p_77653_1_.getItemDamage() == 0) { + return StatCollector.translateToLocal("item.emptyPotion.name").trim(); + } else { + String var2 = ""; + + if (isSplash(p_77653_1_.getItemDamage())) { + var2 = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " "; + } + + List var3 = Items.potionitem.getEffects(p_77653_1_); + String var4; + + if (var3 != null && !var3.isEmpty()) { + var4 = ((PotionEffect)var3.get(0)).getEffectName(); + var4 = var4 + ".postfix"; + return var2 + StatCollector.translateToLocal(var4).trim(); + } else { + var4 = PotionHelper.func_77905_c(p_77653_1_.getItemDamage()); + return StatCollector.translateToLocal(var4).trim() + " " + super.getItemStackDisplayName(p_77653_1_); + } + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + if (p_77624_1_.getItemDamage() != 0) { + List var5 = Items.potionitem.getEffects(p_77624_1_); + HashMultimap var6 = HashMultimap.create(); + Iterator var16; + + if (var5 != null && !var5.isEmpty()) { + var16 = var5.iterator(); + + while (var16.hasNext()) { + PotionEffect var8 = (PotionEffect)var16.next(); + String var9 = StatCollector.translateToLocal(var8.getEffectName()).trim(); + Potion var10 = Potion.potionTypes[var8.getPotionID()]; + Map var11 = var10.func_111186_k(); + + if (var11 != null && var11.size() > 0) { + Iterator var12 = var11.entrySet().iterator(); + + while (var12.hasNext()) { + Entry var13 = (Entry)var12.next(); + AttributeModifier var14 = (AttributeModifier)var13.getValue(); + AttributeModifier var15 = new AttributeModifier(var14.getName(), var10.func_111183_a(var8.getAmplifier(), var14), var14.getOperation()); + var6.put(((IAttribute)var13.getKey()).getAttributeUnlocalizedName(), var15); + } + } + + if (var8.getAmplifier() > 0) { + var9 = var9 + " " + StatCollector.translateToLocal("potion.potency." + var8.getAmplifier()).trim(); + } + + if (var8.getDuration() > 20) { + var9 = var9 + " (" + Potion.getDurationString(var8) + ")"; + } + + if (var10.isBadEffect()) { + p_77624_3_.add(EnumChatFormatting.RED + var9); + } else { + p_77624_3_.add(EnumChatFormatting.GRAY + var9); + } + } + } else { + String var7 = StatCollector.translateToLocal("potion.empty").trim(); + p_77624_3_.add(EnumChatFormatting.GRAY + var7); + } + + if (!var6.isEmpty()) { + p_77624_3_.add(""); + p_77624_3_.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); + var16 = var6.entries().iterator(); + + while (var16.hasNext()) { + Entry var17 = (Entry)var16.next(); + AttributeModifier var18 = (AttributeModifier)var17.getValue(); + double var19 = var18.getAmount(); + double var20; + + if (var18.getOperation() != 1 && var18.getOperation() != 2) { + var20 = var18.getAmount(); + } else { + var20 = var18.getAmount() * 100.0D; + } + + if (var19 > 0.0D) { + p_77624_3_.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var18.getOperation(), new Object[] {ItemStack.DECIMALFORMAT.format(var20), StatCollector.translateToLocal("attribute.name." + var17.getKey())})); + } else if (var19 < 0.0D) { + var20 *= -1.0D; + p_77624_3_.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var18.getOperation(), new Object[] {ItemStack.DECIMALFORMAT.format(var20), StatCollector.translateToLocal("attribute.name." + var17.getKey())})); + } + } + } + } + } + + public boolean hasEffect(ItemStack p_77636_1_) { + List var2 = this.getEffects(p_77636_1_); + return var2 != null && !var2.isEmpty(); + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + super.getSubItems(p_150895_1_, p_150895_2_, p_150895_3_); + int var5; + + if (field_77835_b.isEmpty()) { + for (int var4 = 0; var4 <= 15; ++var4) { + for (var5 = 0; var5 <= 1; ++var5) { + int var6; + + if (var5 == 0) { + var6 = var4 | 8192; + } else { + var6 = var4 | 16384; + } + + for (int var7 = 0; var7 <= 2; ++var7) { + int var8 = var6; + + if (var7 != 0) { + if (var7 == 1) { + var8 = var6 | 32; + } else if (var7 == 2) { + var8 = var6 | 64; + } + } + + List var9 = PotionHelper.getPotionEffects(var8, false); + + if (var9 != null && !var9.isEmpty()) { + field_77835_b.put(var9, Integer.valueOf(var8)); + } + } + } + } + } + + for (Object o : field_77835_b.values()) { + var5 = ((Integer) o).intValue(); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, var5)); + } + } + + public void registerIcons(IIconRegister p_94581_1_) { + this.field_94590_d = p_94581_1_.registerIcon(this.getIconString() + "_" + "bottle_drinkable"); + this.field_94591_c = p_94581_1_.registerIcon(this.getIconString() + "_" + "bottle_splash"); + this.field_94592_ct = p_94581_1_.registerIcon(this.getIconString() + "_" + "overlay"); + } + + public static IIcon func_94589_d(String p_94589_0_) { + return p_94589_0_.equals("bottle_drinkable") ? Items.potionitem.field_94590_d : (p_94589_0_.equals("bottle_splash") ? Items.potionitem.field_94591_c : (p_94589_0_.equals("overlay") ? Items.potionitem.field_94592_ct : null)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemRecord.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemRecord.java new file mode 100644 index 0000000..b87ae30 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemRecord.java @@ -0,0 +1,73 @@ +package net.minecraft.item; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.minecraft.block.BlockJukebox; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemRecord extends Item { + private static final Map field_150928_b = new HashMap(); + public final String field_150929_a; + + + protected ItemRecord(String p_i45350_1_) { + this.field_150929_a = p_i45350_1_; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabMisc); + field_150928_b.put(p_i45350_1_, this); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return this.itemIcon; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == Blocks.jukebox && p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) == 0) { + if (p_77648_3_.isClient) { + return true; + } else { + ((BlockJukebox)Blocks.jukebox).func_149926_b(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_1_); + p_77648_3_.playAuxSFXAtEntity(null, 1005, p_77648_4_, p_77648_5_, p_77648_6_, Item.getIdFromItem(this)); + --p_77648_1_.stackSize; + return true; + } + } else { + return false; + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { + p_77624_3_.add(this.func_150927_i()); + } + + public String func_150927_i() { + return StatCollector.translateToLocal("item.record." + this.field_150929_a + ".desc"); + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.rare; + } + + public static ItemRecord func_150926_b(String p_150926_0_) { + return (ItemRecord)field_150928_b.get(p_150926_0_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemRedstone.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemRedstone.java new file mode 100644 index 0000000..0ac1df1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemRedstone.java @@ -0,0 +1,61 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemRedstone extends Item { + + + public ItemRedstone() { + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) != Blocks.snow_layer) { + if (p_77648_7_ == 0) { + --p_77648_5_; + } + + if (p_77648_7_ == 1) { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + + if (!p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_)) { + return false; + } + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + if (Blocks.redstone_wire.canPlaceBlockAt(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) { + --p_77648_1_.stackSize; + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.redstone_wire); + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemReed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemReed.java new file mode 100644 index 0000000..1da34df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemReed.java @@ -0,0 +1,74 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemReed extends Item { + private final Block field_150935_a; + + + public ItemReed(Block p_i45329_1_) { + this.field_150935_a = p_i45329_1_; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (var11 == Blocks.snow_layer && (p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) & 7) < 1) { + p_77648_7_ = 1; + } else if (var11 != Blocks.vine && var11 != Blocks.tallgrass && var11 != Blocks.deadbush) { + if (p_77648_7_ == 0) { + --p_77648_5_; + } + + if (p_77648_7_ == 1) { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else if (p_77648_1_.stackSize == 0) { + return false; + } else { + if (p_77648_3_.canPlaceEntityOnSide(this.field_150935_a, p_77648_4_, p_77648_5_, p_77648_6_, false, p_77648_7_, null, p_77648_1_)) { + int var12 = this.field_150935_a.onBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, 0); + + if (p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, this.field_150935_a, var12, 3)) { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_150935_a) { + this.field_150935_a.onBlockPlacedBy(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_, p_77648_1_); + this.field_150935_a.onPostBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, var12); + } + + p_77648_3_.playSoundEffect((float)p_77648_4_ + 0.5F, (float)p_77648_5_ + 0.5F, (float)p_77648_6_ + 0.5F, this.field_150935_a.stepSound.func_150496_b(), (this.field_150935_a.stepSound.func_150497_c() + 1.0F) / 2.0F, this.field_150935_a.stepSound.func_150494_d() * 0.8F); + --p_77648_1_.stackSize; + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSaddle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSaddle.java new file mode 100644 index 0000000..483f1c9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSaddle.java @@ -0,0 +1,43 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.EntityPlayer; + +public class ItemSaddle extends Item { + + + public ItemSaddle() { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) { + if (p_111207_3_ instanceof EntityPig) { + EntityPig var4 = (EntityPig)p_111207_3_; + + if (!var4.getSaddled() && !var4.isChild()) { + var4.setSaddled(true); + var4.worldObj.playSoundAtEntity(var4, "mob.horse.leather", 0.5F, 1.0F); + --p_111207_1_.stackSize; + } + + return true; + } else { + return false; + } + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) { + this.itemInteractionForEntity(p_77644_1_, null, p_77644_2_); + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSeedFood.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSeedFood.java new file mode 100644 index 0000000..be47361 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSeedFood.java @@ -0,0 +1,39 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class ItemSeedFood extends ItemFood { + private final Block field_150908_b; + + /** Block ID of the soil this seed food should be planted on. */ + private final Block soilId; + + + public ItemSeedFood(int p_i45351_1_, float p_i45351_2_, Block p_i45351_3_, Block p_i45351_4_) { + super(p_i45351_1_, p_i45351_2_, false); + this.field_150908_b = p_i45351_3_; + this.soilId = p_i45351_4_; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_7_ != 1) { + return false; + } else if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == this.soilId && p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150908_b); + --p_77648_1_.stackSize; + return true; + } else { + return false; + } + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSeeds.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSeeds.java new file mode 100644 index 0000000..1075567 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSeeds.java @@ -0,0 +1,40 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class ItemSeeds extends Item { + private final Block field_150925_a; + + /** BlockID of the block the seeds can be planted on. */ + private final Block soilBlockID; + + + public ItemSeeds(Block p_i45352_1_, Block p_i45352_2_) { + this.field_150925_a = p_i45352_1_; + this.soilBlockID = p_i45352_2_; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_7_ != 1) { + return false; + } else if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == this.soilBlockID && p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150925_a); + --p_77648_1_.stackSize; + return true; + } else { + return false; + } + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemShears.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemShears.java new file mode 100644 index 0000000..4a12172 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemShears.java @@ -0,0 +1,35 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemShears extends Item { + + + public ItemShears() { + this.setMaxStackSize(1); + this.setMaxDamage(238); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) { + if (p_150894_3_.getMaterial() != Material.leaves && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire) { + return super.onBlockDestroyed(p_150894_1_, p_150894_2_, p_150894_3_, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); + } else { + p_150894_1_.damageItem(1, p_150894_7_); + return true; + } + } + + public boolean func_150897_b(Block p_150897_1_) { + return p_150897_1_ == Blocks.web || p_150897_1_ == Blocks.redstone_wire || p_150897_1_ == Blocks.tripwire; + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { + return p_150893_2_ != Blocks.web && p_150893_2_.getMaterial() != Material.leaves ? (p_150893_2_ == Blocks.wool ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSign.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSign.java new file mode 100644 index 0000000..639a318 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSign.java @@ -0,0 +1,73 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemSign extends Item { + + + public ItemSign() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_7_ == 0) { + return false; + } else if (!p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).getMaterial().isSolid()) { + return false; + } else { + if (p_77648_7_ == 1) { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else if (!Blocks.standing_sign.canPlaceBlockAt(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) { + return false; + } else if (p_77648_3_.isClient) { + return true; + } else { + if (p_77648_7_ == 1) { + int var11 = MathHelper.floor_double((double)((p_77648_2_.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.standing_sign, var11, 3); + } else { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.wall_sign, p_77648_7_, 3); + } + + --p_77648_1_.stackSize; + TileEntitySign var12 = (TileEntitySign)p_77648_3_.getTileEntity(p_77648_4_, p_77648_5_, p_77648_6_); + + if (var12 != null) { + p_77648_2_.func_146100_a(var12); + } + + return true; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSimpleFoiled.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSimpleFoiled.java new file mode 100644 index 0000000..ea00a65 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSimpleFoiled.java @@ -0,0 +1,9 @@ +package net.minecraft.item; + +public class ItemSimpleFoiled extends Item { + + + public boolean hasEffect(ItemStack p_77636_1_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSkull.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSkull.java new file mode 100644 index 0000000..bc30fa5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSkull.java @@ -0,0 +1,164 @@ +package net.minecraft.item; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.BlockSkull; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemSkull extends Item { + private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper"}; + public static final String[] field_94587_a = new String[] {"skeleton", "wither", "zombie", "steve", "creeper"}; + private IIcon[] field_94586_c; + + + public ItemSkull() { + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_7_ == 0) { + return false; + } else if (!p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).getMaterial().isSolid()) { + return false; + } else { + if (p_77648_7_ == 1) { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) { + --p_77648_6_; + } + + if (p_77648_7_ == 3) { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) { + --p_77648_4_; + } + + if (p_77648_7_ == 5) { + ++p_77648_4_; + } + + if (!p_77648_3_.isClient) { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.skull, p_77648_7_, 2); + int var11 = 0; + + if (p_77648_7_ == 1) { + var11 = MathHelper.floor_double((double)(p_77648_2_.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; + } + + TileEntity var12 = p_77648_3_.getTileEntity(p_77648_4_, p_77648_5_, p_77648_6_); + + if (var12 != null && var12 instanceof TileEntitySkull) { + if (p_77648_1_.getItemDamage() == 3) { + GameProfile var13 = null; + + if (p_77648_1_.hasTagCompound()) { + NBTTagCompound var14 = p_77648_1_.getTagCompound(); + + if (var14.func_150297_b("SkullOwner", 10)) { + var13 = NBTUtil.func_152459_a(var14.getCompoundTag("SkullOwner")); + } else if (var14.func_150297_b("SkullOwner", 8) && var14.getString("SkullOwner").length() > 0) { + var13 = new GameProfile(null, var14.getString("SkullOwner")); + } + } + + ((TileEntitySkull)var12).func_152106_a(var13); + } else { + ((TileEntitySkull)var12).func_152107_a(p_77648_1_.getItemDamage()); + } + + ((TileEntitySkull)var12).func_145903_a(var11); + ((BlockSkull)Blocks.skull).func_149965_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, (TileEntitySkull)var12); + } + + --p_77648_1_.stackSize; + } + + return true; + } + } + + /** + * This returns the sub items + */ + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { + for (int var4 = 0; var4 < skullTypes.length; ++var4) { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, var4)); + } + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + if (p_77617_1_ < 0 || p_77617_1_ >= skullTypes.length) { + p_77617_1_ = 0; + } + + return this.field_94586_c[p_77617_1_]; + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + int var2 = p_77667_1_.getItemDamage(); + + if (var2 < 0 || var2 >= skullTypes.length) { + var2 = 0; + } + + return super.getUnlocalizedName() + "." + skullTypes[var2]; + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) { + if (p_77653_1_.getItemDamage() == 3 && p_77653_1_.hasTagCompound()) { + if (p_77653_1_.getTagCompound().func_150297_b("SkullOwner", 10)) { + return StatCollector.translateToLocalFormatted("item.skull.player.name", NBTUtil.func_152459_a(p_77653_1_.getTagCompound().getCompoundTag("SkullOwner")).getName()); + } + + if (p_77653_1_.getTagCompound().func_150297_b("SkullOwner", 8)) { + return StatCollector.translateToLocalFormatted("item.skull.player.name", p_77653_1_.getTagCompound().getString("SkullOwner")); + } + } + + return super.getItemStackDisplayName(p_77653_1_); + } + + public void registerIcons(IIconRegister p_94581_1_) { + this.field_94586_c = new IIcon[field_94587_a.length]; + + for (int var2 = 0; var2 < field_94587_a.length; ++var2) { + this.field_94586_c[var2] = p_94581_1_.registerIcon(this.getIconString() + "_" + field_94587_a[var2]); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSlab.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSlab.java new file mode 100644 index 0000000..442d996 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSlab.java @@ -0,0 +1,159 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemSlab extends ItemBlock { + private final boolean field_150948_b; + private final BlockSlab field_150949_c; + private final BlockSlab field_150947_d; + + + public ItemSlab(Block p_i45355_1_, BlockSlab p_i45355_2_, BlockSlab p_i45355_3_, boolean p_i45355_4_) { + super(p_i45355_1_); + this.field_150949_c = p_i45355_2_; + this.field_150947_d = p_i45355_3_; + this.field_150948_b = p_i45355_4_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + public IIcon getIconFromDamage(int p_77617_1_) { + return Block.getBlockFromItem(this).getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack p_77667_1_) { + return this.field_150949_c.func_150002_b(p_77667_1_.getItemDamage()); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (this.field_150948_b) { + return super.onItemUse(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_); + } else if (p_77648_1_.stackSize == 0) { + return false; + } else if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + int var12 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + int var13 = var12 & 7; + boolean var14 = (var12 & 8) != 0; + + if ((p_77648_7_ == 1 && !var14 || p_77648_7_ == 0 && var14) && var11 == this.field_150949_c && var13 == p_77648_1_.getItemDamage()) { + if (p_77648_3_.checkNoEntityCollision(this.field_150947_d.getCollisionBoundingBoxFromPool(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) && p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, this.field_150947_d, var13, 3)) { + p_77648_3_.playSoundEffect((float)p_77648_4_ + 0.5F, (float)p_77648_5_ + 0.5F, (float)p_77648_6_ + 0.5F, this.field_150947_d.stepSound.func_150496_b(), (this.field_150947_d.stepSound.func_150497_c() + 1.0F) / 2.0F, this.field_150947_d.stepSound.func_150494_d() * 0.8F); + --p_77648_1_.stackSize; + } + + return true; + } else { + return this.func_150946_a(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_) || super.onItemUse(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_); + } + } + } + + public boolean func_150936_a(World p_150936_1_, int p_150936_2_, int p_150936_3_, int p_150936_4_, int p_150936_5_, EntityPlayer p_150936_6_, ItemStack p_150936_7_) { + int var8 = p_150936_2_; + int var9 = p_150936_3_; + int var10 = p_150936_4_; + Block var11 = p_150936_1_.getBlock(p_150936_2_, p_150936_3_, p_150936_4_); + int var12 = p_150936_1_.getBlockMetadata(p_150936_2_, p_150936_3_, p_150936_4_); + int var13 = var12 & 7; + boolean var14 = (var12 & 8) != 0; + + if ((p_150936_5_ == 1 && !var14 || p_150936_5_ == 0 && var14) && var11 == this.field_150949_c && var13 == p_150936_7_.getItemDamage()) { + return true; + } else { + if (p_150936_5_ == 0) { + --p_150936_3_; + } + + if (p_150936_5_ == 1) { + ++p_150936_3_; + } + + if (p_150936_5_ == 2) { + --p_150936_4_; + } + + if (p_150936_5_ == 3) { + ++p_150936_4_; + } + + if (p_150936_5_ == 4) { + --p_150936_2_; + } + + if (p_150936_5_ == 5) { + ++p_150936_2_; + } + + Block var15 = p_150936_1_.getBlock(p_150936_2_, p_150936_3_, p_150936_4_); + int var16 = p_150936_1_.getBlockMetadata(p_150936_2_, p_150936_3_, p_150936_4_); + var13 = var16 & 7; + return var15 == this.field_150949_c && var13 == p_150936_7_.getItemDamage() || super.func_150936_a(p_150936_1_, var8, var9, var10, p_150936_5_, p_150936_6_, p_150936_7_); + } + } + + private boolean func_150946_a(ItemStack p_150946_1_, EntityPlayer p_150946_2_, World p_150946_3_, int p_150946_4_, int p_150946_5_, int p_150946_6_, int p_150946_7_) { + if (p_150946_7_ == 0) { + --p_150946_5_; + } + + if (p_150946_7_ == 1) { + ++p_150946_5_; + } + + if (p_150946_7_ == 2) { + --p_150946_6_; + } + + if (p_150946_7_ == 3) { + ++p_150946_6_; + } + + if (p_150946_7_ == 4) { + --p_150946_4_; + } + + if (p_150946_7_ == 5) { + ++p_150946_4_; + } + + Block var8 = p_150946_3_.getBlock(p_150946_4_, p_150946_5_, p_150946_6_); + int var9 = p_150946_3_.getBlockMetadata(p_150946_4_, p_150946_5_, p_150946_6_); + int var10 = var9 & 7; + + if (var8 == this.field_150949_c && var10 == p_150946_1_.getItemDamage()) { + if (p_150946_3_.checkNoEntityCollision(this.field_150947_d.getCollisionBoundingBoxFromPool(p_150946_3_, p_150946_4_, p_150946_5_, p_150946_6_)) && p_150946_3_.setBlock(p_150946_4_, p_150946_5_, p_150946_6_, this.field_150947_d, var10, 3)) { + p_150946_3_.playSoundEffect((float)p_150946_4_ + 0.5F, (float)p_150946_5_ + 0.5F, (float)p_150946_6_ + 0.5F, this.field_150947_d.stepSound.func_150496_b(), (this.field_150947_d.stepSound.func_150497_c() + 1.0F) / 2.0F, this.field_150947_d.stepSound.func_150494_d() * 0.8F); + --p_150946_1_.stackSize; + } + + return true; + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSnow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSnow.java new file mode 100644 index 0000000..ee2b1a3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSnow.java @@ -0,0 +1,41 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemSnow extends ItemBlockWithMetadata { + + + public ItemSnow(Block p_i45354_1_, Block p_i45354_2_) { + super(p_i45354_1_, p_i45354_2_); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + if (p_77648_1_.stackSize == 0) { + return false; + } else if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) { + return false; + } else { + Block var11 = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (var11 == Blocks.snow_layer) { + int var12 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + int var13 = var12 & 7; + + if (var13 <= 6 && p_77648_3_.checkNoEntityCollision(this.field_150939_a.getCollisionBoundingBoxFromPool(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) && p_77648_3_.setBlockMetadataWithNotify(p_77648_4_, p_77648_5_, p_77648_6_, var13 + 1 | var12 & -8, 2)) { + p_77648_3_.playSoundEffect((float)p_77648_4_ + 0.5F, (float)p_77648_5_ + 0.5F, (float)p_77648_6_ + 0.5F, this.field_150939_a.stepSound.func_150496_b(), (this.field_150939_a.stepSound.func_150497_c() + 1.0F) / 2.0F, this.field_150939_a.stepSound.func_150494_d() * 0.8F); + --p_77648_1_.stackSize; + return true; + } + } + + return super.onItemUse(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSnowball.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSnowball.java new file mode 100644 index 0000000..b018e5f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSnowball.java @@ -0,0 +1,32 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.world.World; + +public class ItemSnowball extends Item { + + + public ItemSnowball() { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + if (!p_77659_3_.capabilities.isCreativeMode) { + --p_77659_1_.stackSize; + } + + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!p_77659_2_.isClient) { + p_77659_2_.spawnEntityInWorld(new EntitySnowball(p_77659_2_, p_77659_3_)); + } + + return p_77659_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSoup.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSoup.java new file mode 100644 index 0000000..231ecd2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSoup.java @@ -0,0 +1,19 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + +public class ItemSoup extends ItemFood { + + + public ItemSoup(int p_i45330_1_) { + super(p_i45330_1_, false); + this.setMaxStackSize(1); + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) { + super.onEaten(p_77654_1_, p_77654_2_, p_77654_3_); + return new ItemStack(Items.bowl); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSpade.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSpade.java new file mode 100644 index 0000000..52ed0a1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSpade.java @@ -0,0 +1,19 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class ItemSpade extends ItemTool { + private static final Set field_150916_c = Sets.newHashSet(Blocks.grass, Blocks.dirt, Blocks.sand, Blocks.gravel, Blocks.snow_layer, Blocks.snow, Blocks.clay, Blocks.farmland, Blocks.soul_sand, Blocks.mycelium); + + + public ItemSpade(Item.ToolMaterial p_i45353_1_) { + super(1.0F, p_i45353_1_, field_150916_c); + } + + public boolean func_150897_b(Block p_150897_1_) { + return p_150897_1_ == Blocks.snow_layer || p_150897_1_ == Blocks.snow; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemStack.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemStack.java new file mode 100644 index 0000000..cbe8015 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemStack.java @@ -0,0 +1,680 @@ +package net.minecraft.item; + +import com.cheatbreaker.client.CheatBreaker; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentDurability; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.HoverEvent; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.stats.StatList; +import net.minecraft.util.*; +import net.minecraft.world.World; + +import java.text.DecimalFormat; +import java.util.*; + +public final class ItemStack { + public static final DecimalFormat DECIMALFORMAT = new DecimalFormat("#.###"); + + /** Size of the stack. */ + public int stackSize; + + /** + * Number of animation frames to go when receiving an item (by walking into it, for example). + */ + public int animationsToGo; + private Item item; + + /** + * A NBTTagMap containing data about an ItemStack. Can only be used for non stackable items + */ + public NBTTagCompound stackTagCompound; + + /** Damage dealt to the item or number of use. Raise when using items. */ + private int itemDamage; + + /** Item frame this stack is on, or null if not on an item frame. */ + private EntityItemFrame itemFrame; + + public ItemStack(Block block) { + this(block, 1); + } + + public ItemStack(Block block, int amount) { + this(block, amount, 0); + } + + public ItemStack(Block block, int amount, int meta) { + this(Item.getItemFromBlock(block), amount, meta); + } + + public ItemStack(Item item) { + this(item, 1); + } + + public ItemStack(Item item, int amount) { + this(item, amount, 0); + } + + public ItemStack(Item item, int amount, int n2) { + this.item = item; + this.stackSize = amount; + this.itemDamage = n2; + if (this.itemDamage < 0) { + this.itemDamage = 0; + } + } + + public static ItemStack loadItemStackFromNBT(NBTTagCompound nbt) { + ItemStack itemStack = new ItemStack(); + itemStack.readFromNBT(nbt); + return itemStack.getItem() != null ? itemStack : null; + } + + private ItemStack() {} + + /** + * Remove the argument from the stack size. Return a new stack object with argument size. + */ + public ItemStack splitStack(int amount) { + ItemStack itemStack = new ItemStack(this.item, amount, this.itemDamage); + if (this.stackTagCompound != null) { + itemStack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + this.stackSize -= amount; + return itemStack; + } + + /** + * Returns the object corresponding to the stack. + */ + public Item getItem() { + return this.item; + } + + /** + * Returns the icon index of the current stack. + */ + public IIcon getIconIndex() { + return this.getItem().getIconIndex(this); + } + + public int getItemSpriteNumber() { + return this.getItem().getSpriteNumber(); + } + + public boolean tryPlaceItemIntoWorld(EntityPlayer player, World world, int n, int n2, int n3, int n4, float f, float f2, float f3) { + boolean bl = this.getItem().onItemUse(this, player, world, n, n2, n3, n4, f, f2, f3); + if (bl) { + player.addStat(StatList.objectUseStats[Item.getIdFromItem(this.item)], 1); + } + return bl; + } + + public float func_150997_a(Block block) { + return this.getItem().func_150893_a(this, block); + } + + /** + * Called whenever this item stack is equipped and right clicked. Returns the new item stack to put in the position + * where this item is. Args: world, player + */ + public ItemStack useItemRightClick(World world, EntityPlayer player) { + return this.getItem().onItemRightClick(this, world, player); + } + + public ItemStack onFoodEaten(World world, EntityPlayer player) { + return this.getItem().onEaten(this, world, player); + } + + /** + * Write the stack fields to a NBT object. Return the new NBT object. + */ + public NBTTagCompound writeToNBT(NBTTagCompound nbt) { + nbt.setShort("id", (short)Item.getIdFromItem(this.item)); + nbt.setByte("Count", (byte)this.stackSize); + nbt.setShort("Damage", (short)this.itemDamage); + if (this.stackTagCompound != null) { + nbt.setTag("tag", this.stackTagCompound); + } + return nbt; + } + + /** + * Read the stack fields from a NBT object. + */ + public void readFromNBT(NBTTagCompound nBTTagCompound) { + this.item = Item.getItemById(nBTTagCompound.getShort("id")); + this.stackSize = nBTTagCompound.getByte("Count"); + this.itemDamage = nBTTagCompound.getShort("Damage"); + if (this.itemDamage < 0) { + this.itemDamage = 0; + } + if (nBTTagCompound.func_150297_b("tag", 10)) { + this.stackTagCompound = nBTTagCompound.getCompoundTag("tag"); + } + } + + /** + * Returns maximum size of the stack. + */ + public int getMaxStackSize() { + return this.getItem().getItemStackLimit(); + } + + /** + * Returns true if the ItemStack can hold 2 or more units of the item. + */ + public boolean isStackable() { + return this.getMaxStackSize() > 1 && (!this.isItemDamaged() || !this.isItemDamaged()); + } + + /** + * true if this itemStack is damageable + */ + public boolean isItemStackDamageable() { + return this.item != null && (this.item.getMaxDamage() > 0 && (!this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable"))); + } + + public boolean getHasSubtypes() { + return this.item.getHasSubtypes(); + } + + /** + * returns true when a damageable item is damaged + */ + public boolean isItemDamaged() { + return this.isItemStackDamageable() && this.itemDamage > 0; + } + + /** + * gets the damage of an itemstack, for displaying purposes + */ + public int getItemDamageForDisplay() { + return this.itemDamage; + } + + /** + * gets the damage of an itemstack + */ + public int getItemDamage() { + return this.itemDamage; + } + + /** + * Sets the item damage of the ItemStack. + */ + public void setItemDamage(int meta) { + this.itemDamage = meta; + if (this.itemDamage < 0) { + this.itemDamage = 0; + } + } + + /** + * Returns the max damage an item in the stack can take. + */ + public int getMaxDamage() { + return this.item.getMaxDamage(); + } + + /** + * Attempts to damage the ItemStack with par1 amount of damage, If the ItemStack has the Unbreaking enchantment + * there is a chance for each point of damage to be negated. Returns true if it takes more damage than + * getMaxDamage(). Returns false otherwise or if the ItemStack can't be damaged or if all points of damage are + * negated. + */ + public boolean attemptDamageItem(int amount, Random rand) { + if (!this.isItemStackDamageable()) { + return false; + } + if (amount > 0) { + int n2 = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, this); + int n3 = 0; + for (int i = 0; n2 > 0 && i < amount; ++i) { + if (!EnchantmentDurability.negateDamage(this, n2, rand)) continue; + ++n3; + } + if ((amount -= n3) <= 0) { + return false; + } + } + this.itemDamage += amount; + return this.itemDamage > this.getMaxDamage(); + } + + /** + * Damages the item in the ItemStack + */ + public void damageItem(int amount, EntityLivingBase entity) { + if ((!(entity instanceof EntityPlayer) || !((EntityPlayer)entity).capabilities.isCreativeMode) && this.isItemStackDamageable() && this.attemptDamageItem(amount, entity.getRNG())) { + entity.renderBrokenItemStack(this); + --this.stackSize; + if (entity instanceof EntityPlayer) { + EntityPlayer entityPlayer = (EntityPlayer)entity; + entityPlayer.addStat(StatList.objectBreakStats[Item.getIdFromItem(this.item)], 1); + if (this.stackSize == 0 && this.getItem() instanceof ItemBow) { + entityPlayer.destroyCurrentEquippedItem(); + } + } + if (this.stackSize < 0) { + this.stackSize = 0; + } + this.itemDamage = 0; + } + } + + /** + * Calls the corresponding fct in di + */ + public void hitEntity(EntityLivingBase entityIn, EntityPlayer playerIn) { + boolean bl = this.item.hitEntity(this, entityIn, playerIn); + if (bl) { + playerIn.addStat(StatList.objectUseStats[Item.getIdFromItem(this.item)], 1); + } + } + + public void func_150999_a(World world, Block block, int n, int n2, int n3, EntityPlayer entityPlayer) { + boolean bl = this.item.onBlockDestroyed(this, world, block, n, n2, n3, entityPlayer); + if (bl) { + entityPlayer.addStat(StatList.objectUseStats[Item.getIdFromItem(this.item)], 1); + } + } + + public boolean func_150998_b(Block block) { + return this.item.func_150897_b(block); + } + + public boolean interactWithEntity(EntityPlayer playerIn, EntityLivingBase entityIn) { + return this.item.itemInteractionForEntity(this, playerIn, entityIn); + } + + /** + * Returns a new stack with the same properties. + */ + public ItemStack copy() { + ItemStack itemStack = new ItemStack(this.item, this.stackSize, this.itemDamage); + if (this.stackTagCompound != null) { + itemStack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + return itemStack; + } + + /** + * compares ItemStack argument1 with ItemStack argument2; returns true if both ItemStacks are equal + */ + public static boolean areItemStackTagsEqual(ItemStack stackA, ItemStack stackB) { + return stackA == null && stackB == null || (stackA != null && stackB != null && ((stackA.stackTagCompound != null || stackB.stackTagCompound == null) && (stackA.stackTagCompound == null || stackA.stackTagCompound.equals(stackB.stackTagCompound)))); + } + + /** + * compares ItemStack argument1 with ItemStack argument2; returns true if both ItemStacks are equal + */ + public static boolean areItemStacksEqual(ItemStack stackA, ItemStack stackB) { + return stackA == null && stackB == null || (stackA != null && stackB != null && stackA.isItemStackEqual(stackB)); + } + + /** + * compares ItemStack argument to the instance ItemStack; returns true if both ItemStacks are equal + */ + private boolean isItemStackEqual(ItemStack stackA) { + return this.stackSize == stackA.stackSize && (this.item == stackA.item && (this.itemDamage == stackA.itemDamage && ((this.stackTagCompound != null || stackA.stackTagCompound == null) && (this.stackTagCompound == null || this.stackTagCompound.equals(stackA.stackTagCompound))))); + } + + /** + * compares ItemStack argument to the instance ItemStack; returns true if the Items contained in both ItemStacks are + * equal + */ + public boolean isItemEqual(ItemStack other) { + return this.item == other.item && this.itemDamage == other.itemDamage; + } + + public String getUnlocalizedName() { + return this.item.getUnlocalizedName(this); + } + + /** + * Creates a copy of a ItemStack, a null parameters will return a null. + */ + public static ItemStack copyItemStack(ItemStack stack) { + return stack == null ? null : stack.copy(); + } + + public String toString() { + return this.stackSize + "x" + this.item.getUnlocalizedName() + "@" + this.itemDamage; + } + + /** + * Called each tick as long the ItemStack in on player inventory. Used to progress the pickup animation and update + * maps. + */ + public void updateAnimation(World world, Entity entity, int inventorySlot, boolean isCurrentItem) { + if (this.animationsToGo > 0) { + --this.animationsToGo; + } + this.item.onUpdate(this, world, entity, inventorySlot, isCurrentItem); + } + + public void onCrafting(World world, EntityPlayer player, int amount) { + player.addStat(StatList.objectCraftStats[Item.getIdFromItem(this.item)], amount); + this.item.onCreated(this, world, player); + } + + public int getMaxItemUseDuration() { + return this.getItem().getMaxItemUseDuration(this); + } + + public EnumAction getItemUseAction() { + return this.getItem().getItemUseAction(this); + } + + /** + * Called when the player releases the use item button. Args: world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(World world, EntityPlayer entityPlayer, int n) { + this.getItem().onPlayerStoppedUsing(this, world, entityPlayer, n); + } + + /** + * Returns true if the ItemStack has an NBTTagCompound. Currently used to store enchantments. + */ + public boolean hasTagCompound() { + return this.stackTagCompound != null; + } + + /** + * Returns the NBTTagCompound of the ItemStack. + */ + public NBTTagCompound getTagCompound() { + return this.stackTagCompound; + } + + public NBTTagList getEnchantmentTagList() { + return this.stackTagCompound == null ? null : this.stackTagCompound.getTagList("ench", 10); + } + + /** + * Assigns a NBTTagCompound to the ItemStack, minecraft validates that only non-stackable items can have it. + */ + public void setTagCompound(NBTTagCompound nbt) { + this.stackTagCompound = nbt; + } + + /** + * returns the display name of the itemstack + */ + public String getDisplayName() { + NBTTagCompound nBTTagCompound; + String string = this.getItem().getItemStackDisplayName(this); + if (this.stackTagCompound != null && this.stackTagCompound.func_150297_b("display", 10) && (nBTTagCompound = this.stackTagCompound.getCompoundTag("display")).func_150297_b("Name", 8)) { + string = nBTTagCompound.getString("Name"); + } + return string; + } + + public ItemStack setStackDisplayName(String displayName) { + if (this.stackTagCompound == null) { + this.stackTagCompound = new NBTTagCompound(); + } + if (!this.stackTagCompound.func_150297_b("display", 10)) { + this.stackTagCompound.setTag("display", new NBTTagCompound()); + } + this.stackTagCompound.getCompoundTag("display").setString("Name", displayName); + return this; + } + + public void func_135074_t() { + if (this.stackTagCompound != null && this.stackTagCompound.func_150297_b("display", 10)) { + NBTTagCompound tag = this.stackTagCompound.getCompoundTag("display"); + tag.removeTag("Name"); + if (tag.hasNoTags()) { + this.stackTagCompound.removeTag("display"); + if (this.stackTagCompound.hasNoTags()) { + this.setTagCompound(null); + } + } + } + } + + /** + * Returns true if the itemstack has a display name + */ + public boolean hasDisplayName() { + return this.stackTagCompound != null && (this.stackTagCompound.func_150297_b("display", 10) && this.stackTagCompound.getCompoundTag("display").func_150297_b("Name", 8)); + } + + /** + * Return a list of strings containing information about the item + */ + public List getTooltip(EntityPlayer playerIn, boolean advanced) { + int n; + String displayName = this.getDisplayName(); + ArrayList list = new ArrayList<>(); + if (this.isCorrectFlag(ItemFlag.DISPLAY_NAME)) { + + if (this.hasDisplayName()) { + displayName = EnumChatFormatting.ITALIC + displayName + EnumChatFormatting.RESET; + } + if (advanced) { + String s = ""; + if (displayName.length() > 0) { + displayName = displayName + " ("; + s = ")"; + } + n = Item.getIdFromItem(this.item); + displayName = this.getHasSubtypes() ? displayName + String.format("#%04d/%d%s", n, this.itemDamage, s) : displayName + String.format("#%04d%s", n, s); + } else if (!this.hasDisplayName() && this.item == Items.filled_map) { + displayName = displayName + " #" + this.itemDamage; + } + list.add(displayName); + } + if (this.isCorrectFlag(ItemFlag.ITEM_STACK_INFORMATION)) { + this.item.addInformation(this, playerIn, list, advanced); + } + if (this.hasTagCompound()) { + int n2; + NBTTagList nbtTagList = this.getEnchantmentTagList(); + if (this.isCorrectFlag(ItemFlag.ENCHANTMENTS) && nbtTagList != null) { + for (n = 0; n < nbtTagList.tagCount(); ++n) { + short s = nbtTagList.getCompoundTagAt(n).getShort("id"); + n2 = nbtTagList.getCompoundTagAt(n).getShort("lvl"); + if (Enchantment.enchantmentsList[s] == null) continue; + list.add(Enchantment.enchantmentsList[s].getTranslatedName(n2)); + } + } + if (this.stackTagCompound.func_150297_b("display", 10)) { + NBTTagCompound var15 = this.stackTagCompound.getCompoundTag("display"); + if (this.isCorrectFlag(ItemFlag.COLOR) && var15.func_150297_b("color", 3)) { + if (advanced) { + list.add("Color: #" + Integer.toHexString(var15.getInteger("color")).toUpperCase()); + } else { + list.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed")); + } + } + + NBTTagList nbttaglist1 = var15.getTagList("Lore", 8); + if (this.isCorrectFlag(ItemFlag.LORE) && var15.func_150299_b("Lore") == 9 && nbttaglist1.tagCount() > 0) { + for (n2 = 0; n2 < nbttaglist1.tagCount(); ++n2) { + list.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + nbttaglist1.getStringTagAt(n2)); + } + } + } + } + Multimap var14 = this.getAttributeModifiers(); + + if (this.isCorrectFlag(ItemFlag.ATTRIBUTE_MODIFIERS) && !var14.isEmpty() + && CheatBreaker.getInstance().getGlobalSettings().SHOW_MODIFIERS) { + list.add(""); + + for (Map.Entry entry : var14.entries()) { + AttributeModifier attributeModifier = entry.getValue(); + double d = attributeModifier.getAmount(); + if (attributeModifier.getID() == Item.field_111210_e) { + d += (double) EnchantmentHelper.func_152377_a(this, EnumCreatureAttribute.UNDEFINED); + } + double d2 = attributeModifier.getOperation() != 1 && attributeModifier.getOperation() != 2 ? d : d * (double) 100; + if (d > 0.0) { + list.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributeModifier.getOperation(), DECIMALFORMAT.format(d2), StatCollector.translateToLocal("attribute.name." + (String) ((Map.Entry) entry).getKey()))); + continue; + } + if (!(d < 0.0)) continue; + list.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributeModifier.getOperation(), DECIMALFORMAT.format(d2 *= (double) -1), StatCollector.translateToLocal("attribute.name." + (String) ((Map.Entry) entry).getKey()))); + } + } + if (this.isCorrectFlag(ItemFlag.UNBREAKABLE) && this.hasTagCompound() && this.getTagCompound().getBoolean("Unbreakable")) { + list.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal("item.unbreakable")); + } + if (this.isCorrectFlag(ItemFlag.DURABILITY) && advanced && this.isItemDamaged()) { + list.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); + } + return list; + } + + private boolean isCorrectFlag(ItemFlag flag) { + if (!this.hasTagCompound()) { + return true; + } + if (!this.getTagCompound().hasKey("hidden")) { + return true; + } + NBTTagCompound nBTTagCompound = this.getTagCompound().getCompoundTag("hidden"); + return !nBTTagCompound.hasKey(flag.name()) || nBTTagCompound.getByte(flag.name()) != 1; + } + + public boolean hasEffect() { + return this.getItem().hasEffect(this); + } + + public EnumRarity getRarity() { + return this.getItem().getRarity(this); + } + + /** + * True if it is a tool and has no enchantments to begin with + */ + public boolean isItemEnchantable() { + return this.getItem().isItemTool(this) && !this.isItemEnchanted(); + } + + /** + * Adds an enchantment with a desired level on the ItemStack. + */ + public void addEnchantment(Enchantment enchantment, int n) { + if (this.stackTagCompound == null) { + this.setTagCompound(new NBTTagCompound()); + } + if (!this.stackTagCompound.func_150297_b("ench", 9)) { + this.stackTagCompound.setTag("ench", new NBTTagList()); + } + NBTTagList nBTTagList = this.stackTagCompound.getTagList("ench", 10); + NBTTagCompound nBTTagCompound = new NBTTagCompound(); + nBTTagCompound.setShort("id", (short)enchantment.effectId); + nBTTagCompound.setShort("lvl", (short)((byte)n)); + nBTTagList.appendTag(nBTTagCompound); + } + + /** + * True if the item has enchantment data + */ + public boolean isItemEnchanted() { + return this.stackTagCompound != null && this.stackTagCompound.func_150297_b("ench", 9); + } + + public void setTagInfo(String string, NBTBase nBTBase) { + if (this.stackTagCompound == null) { + this.setTagCompound(new NBTTagCompound()); + } + this.stackTagCompound.setTag(string, nBTBase); + } + + public boolean canEditBlocks() { + return this.getItem().canItemEditBlocks(); + } + + /** + * Return whether this stack is on an item frame. + */ + public boolean isOnItemFrame() { + return this.itemFrame != null; + } + + /** + * Set the item frame this stack is on. + */ + public void setItemFrame(EntityItemFrame frame) { + this.itemFrame = frame; + } + + /** + * Return the item frame this stack is on. Returns null if not on an item frame. + */ + public EntityItemFrame getItemFrame() { + return this.itemFrame; + } + + /** + * Get this stack's repair cost, or 0 if no repair cost is defined. + */ + public int getRepairCost() { + return this.hasTagCompound() && this.stackTagCompound.func_150297_b("RepairCost", 3) ? this.stackTagCompound.getInteger("RepairCost") : 0; + } + + /** + * Set this stack's repair cost. + */ + public void setRepairCost(int cost) { + if (!this.hasTagCompound()) { + this.stackTagCompound = new NBTTagCompound(); + } + this.stackTagCompound.setInteger("RepairCost", cost); + } + + /** + * Gets the attribute modifiers for this ItemStack.\nWill check for an NBT tag list containing modifiers for the + * stack. + */ + public Multimap getAttributeModifiers() { + Multimap multimap; + if (this.hasTagCompound() && this.stackTagCompound.func_150297_b("AttributeModifiers", 9)) { + multimap = HashMultimap.create(); + NBTTagList nBTTagList = this.stackTagCompound.getTagList("AttributeModifiers", 10); + for (int i = 0; i < nBTTagList.tagCount(); ++i) { + NBTTagCompound nBTTagCompound = nBTTagList.getCompoundTagAt(i); + AttributeModifier modifier = SharedMonsterAttributes.readAttributeModifierFromNBT(nBTTagCompound); + if (modifier.getID().getLeastSignificantBits() == 0L || modifier.getID().getMostSignificantBits() == 0L) continue; + multimap.put(nBTTagCompound.getString("AttributeName"), modifier); + } + } else { + multimap = this.getItem().getItemAttributeModifiers(); + } + return multimap; + } + + public void func_150996_a(Item item) { + this.item = item; + } + + public IChatComponent func_151000_E() { + IChatComponent iChatComponent = new ChatComponentText("[").appendText(this.getDisplayName()).appendText("]"); + if (this.item != null) { + NBTTagCompound nBTTagCompound = new NBTTagCompound(); + this.writeToNBT(nBTTagCompound); + iChatComponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new ChatComponentText(nBTTagCompound.toString()))); + iChatComponent.getChatStyle().setColor(this.getRarity().rarityColor); + } + return iChatComponent; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSword.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSword.java new file mode 100644 index 0000000..a95557b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemSword.java @@ -0,0 +1,116 @@ +package net.minecraft.item; + +import com.google.common.collect.Multimap; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemSword extends Item { + private final float field_150934_a; + private final Item.ToolMaterial field_150933_b; + + + public ItemSword(Item.ToolMaterial p_i45356_1_) { + this.field_150933_b = p_i45356_1_; + this.maxStackSize = 1; + this.setMaxDamage(p_i45356_1_.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabCombat); + this.field_150934_a = 4.0F + p_i45356_1_.getDamageVsEntity(); + } + + public float func_150931_i() { + return this.field_150933_b.getDamageVsEntity(); + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { + if (p_150893_2_ == Blocks.web) { + return 15.0F; + } else { + Material var3 = p_150893_2_.getMaterial(); + return var3 != Material.plants && var3 != Material.vine && var3 != Material.coral && var3 != Material.leaves && var3 != Material.field_151572_C ? 1.0F : 1.5F; + } + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) { + p_77644_1_.damageItem(1, p_77644_3_); + return true; + } + + public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) { + if ((double)p_150894_3_.getBlockHardness(p_150894_2_, p_150894_4_, p_150894_5_, p_150894_6_) != 0.0D) { + p_150894_1_.damageItem(2, p_150894_7_); + } + + return true; + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack p_77661_1_) { + return EnumAction.block; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) { + return 72000; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + return p_77659_1_; + } + + public boolean func_150897_b(Block p_150897_1_) { + return p_150897_1_ == Blocks.web; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return this.field_150933_b.getEnchantability(); + } + + public String func_150932_j() { + return this.field_150933_b.toString(); + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return this.field_150933_b.func_150995_f() == p_82789_2_.getItem() || super.getIsRepairable(p_82789_1_, p_82789_2_); + } + + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + public Multimap getItemAttributeModifiers() { + Multimap var1 = super.getItemAttributeModifiers(); + var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", this.field_150934_a, 0)); + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemTool.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemTool.java new file mode 100644 index 0000000..e954b68 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemTool.java @@ -0,0 +1,94 @@ +package net.minecraft.item; + +import com.google.common.collect.Multimap; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.world.World; + +public class ItemTool extends Item { + private final Set field_150914_c; + protected float efficiencyOnProperMaterial = 4.0F; + + /** Damage versus entities. */ + private final float damageVsEntity; + + /** The material this tool is made from. */ + protected Item.ToolMaterial toolMaterial; + + + protected ItemTool(float p_i45333_1_, Item.ToolMaterial p_i45333_2_, Set p_i45333_3_) { + this.toolMaterial = p_i45333_2_; + this.field_150914_c = p_i45333_3_; + this.maxStackSize = 1; + this.setMaxDamage(p_i45333_2_.getMaxUses()); + this.efficiencyOnProperMaterial = p_i45333_2_.getEfficiencyOnProperMaterial(); + this.damageVsEntity = p_i45333_1_ + p_i45333_2_.getDamageVsEntity(); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { + return this.field_150914_c.contains(p_150893_2_) ? this.efficiencyOnProperMaterial : 1.0F; + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) { + p_77644_1_.damageItem(2, p_77644_3_); + return true; + } + + public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) { + if ((double)p_150894_3_.getBlockHardness(p_150894_2_, p_150894_4_, p_150894_5_, p_150894_6_) != 0.0D) { + p_150894_1_.damageItem(1, p_150894_7_); + } + + return true; + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } + + public Item.ToolMaterial func_150913_i() { + return this.toolMaterial; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return this.toolMaterial.getEnchantability(); + } + + /** + * Return the name for this tool's material. + */ + public String getToolMaterialName() { + return this.toolMaterial.toString(); + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return this.toolMaterial.func_150995_f() == p_82789_2_.getItem() || super.getIsRepairable(p_82789_1_, p_82789_2_); + } + + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + public Multimap getItemAttributeModifiers() { + Multimap var1 = super.getItemAttributeModifiers(); + var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", this.damageVsEntity, 0)); + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemWritableBook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemWritableBook.java new file mode 100644 index 0000000..7c1d08a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/ItemWritableBook.java @@ -0,0 +1,53 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public class ItemWritableBook extends Item { + + + public ItemWritableBook() { + this.setMaxStackSize(1); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { + p_77659_3_.displayGUIBook(p_77659_1_); + return p_77659_1_; + } + + /** + * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the com.cheatbreaker.client. + */ + public boolean getShareTag() { + return true; + } + + public static boolean func_150930_a(NBTTagCompound p_150930_0_) { + if (p_150930_0_ == null) { + return false; + } else if (!p_150930_0_.func_150297_b("pages", 9)) { + return false; + } else { + NBTTagList var1 = p_150930_0_.getTagList("pages", 8); + + for (int var2 = 0; var2 < var1.tagCount(); ++var2) { + String var3 = var1.getStringTagAt(var2); + + if (var3 == null) { + return false; + } + + if (var3.length() > 256) { + return false; + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/CraftingManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/CraftingManager.java new file mode 100644 index 0000000..d4ef796 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/CraftingManager.java @@ -0,0 +1,304 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class CraftingManager { + /** The static instance of this class */ + private static final CraftingManager instance = new CraftingManager(); + + /** A list of all the recipes added */ + private final List recipes = new ArrayList(); + + + /** + * Returns the static instance of this class + */ + public static final CraftingManager getInstance() { + return instance; + } + + private CraftingManager() { + (new RecipesTools()).addRecipes(this); + (new RecipesWeapons()).addRecipes(this); + (new RecipesIngots()).addRecipes(this); + (new RecipesFood()).addRecipes(this); + (new RecipesCrafting()).addRecipes(this); + (new RecipesArmor()).addRecipes(this); + (new RecipesDyes()).addRecipes(this); + this.recipes.add(new RecipesArmorDyes()); + this.recipes.add(new RecipeBookCloning()); + this.recipes.add(new RecipesMapCloning()); + this.recipes.add(new RecipesMapExtending()); + this.recipes.add(new RecipeFireworks()); + this.addRecipe(new ItemStack(Items.paper, 3), "###", '#', Items.reeds); + this.addShapelessRecipe(new ItemStack(Items.book, 1), Items.paper, Items.paper, Items.paper, Items.leather); + this.addShapelessRecipe(new ItemStack(Items.writable_book, 1), Items.book, new ItemStack(Items.dye, 1, 0), Items.feather); + this.addRecipe(new ItemStack(Blocks.fence, 2), "###", "###", '#', Items.stick); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, 0), "###", "###", '#', Blocks.cobblestone); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, 1), "###", "###", '#', Blocks.mossy_cobblestone); + this.addRecipe(new ItemStack(Blocks.nether_brick_fence, 6), "###", "###", '#', Blocks.nether_brick); + this.addRecipe(new ItemStack(Blocks.fence_gate, 1), "#W#", "#W#", '#', Items.stick, 'W', Blocks.planks); + this.addRecipe(new ItemStack(Blocks.jukebox, 1), "###", "#X#", "###", '#', Blocks.planks, 'X', Items.diamond); + this.addRecipe(new ItemStack(Items.lead, 2), "~~ ", "~O ", " ~", '~', Items.string, 'O', Items.slime_ball); + this.addRecipe(new ItemStack(Blocks.noteblock, 1), "###", "#X#", "###", '#', Blocks.planks, 'X', Items.redstone); + this.addRecipe(new ItemStack(Blocks.bookshelf, 1), "###", "XXX", "###", '#', Blocks.planks, 'X', Items.book); + this.addRecipe(new ItemStack(Blocks.snow, 1), "##", "##", '#', Items.snowball); + this.addRecipe(new ItemStack(Blocks.snow_layer, 6), "###", '#', Blocks.snow); + this.addRecipe(new ItemStack(Blocks.clay, 1), "##", "##", '#', Items.clay_ball); + this.addRecipe(new ItemStack(Blocks.brick_block, 1), "##", "##", '#', Items.brick); + this.addRecipe(new ItemStack(Blocks.glowstone, 1), "##", "##", '#', Items.glowstone_dust); + this.addRecipe(new ItemStack(Blocks.quartz_block, 1), "##", "##", '#', Items.quartz); + this.addRecipe(new ItemStack(Blocks.wool, 1), "##", "##", '#', Items.string); + this.addRecipe(new ItemStack(Blocks.tnt, 1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Blocks.sand); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 3), "###", '#', Blocks.cobblestone); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 0), "###", '#', Blocks.stone); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 1), "###", '#', Blocks.sandstone); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 4), "###", '#', Blocks.brick_block); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 5), "###", '#', Blocks.stonebrick); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 6), "###", '#', Blocks.nether_brick); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 7), "###", '#', Blocks.quartz_block); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 0), "###", '#', new ItemStack(Blocks.planks, 1, 0)); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 2), "###", '#', new ItemStack(Blocks.planks, 1, 2)); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 1), "###", '#', new ItemStack(Blocks.planks, 1, 1)); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 3), "###", '#', new ItemStack(Blocks.planks, 1, 3)); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 4), "###", '#', new ItemStack(Blocks.planks, 1, 4)); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 5), "###", '#', new ItemStack(Blocks.planks, 1, 5)); + this.addRecipe(new ItemStack(Blocks.ladder, 3), "# #", "###", "# #", '#', Items.stick); + this.addRecipe(new ItemStack(Items.wooden_door, 1), "##", "##", "##", '#', Blocks.planks); + this.addRecipe(new ItemStack(Blocks.trapdoor, 2), "###", "###", '#', Blocks.planks); + this.addRecipe(new ItemStack(Items.iron_door, 1), "##", "##", "##", '#', Items.iron_ingot); + this.addRecipe(new ItemStack(Items.sign, 3), "###", "###", " X ", '#', Blocks.planks, 'X', Items.stick); + this.addRecipe(new ItemStack(Items.cake, 1), "AAA", "BEB", "CCC", 'A', Items.milk_bucket, 'B', Items.sugar, 'C', Items.wheat, 'E', Items.egg); + this.addRecipe(new ItemStack(Items.sugar, 1), "#", '#', Items.reeds); + this.addRecipe(new ItemStack(Blocks.planks, 4, 0), "#", '#', new ItemStack(Blocks.log, 1, 0)); + this.addRecipe(new ItemStack(Blocks.planks, 4, 1), "#", '#', new ItemStack(Blocks.log, 1, 1)); + this.addRecipe(new ItemStack(Blocks.planks, 4, 2), "#", '#', new ItemStack(Blocks.log, 1, 2)); + this.addRecipe(new ItemStack(Blocks.planks, 4, 3), "#", '#', new ItemStack(Blocks.log, 1, 3)); + this.addRecipe(new ItemStack(Blocks.planks, 4, 4), "#", '#', new ItemStack(Blocks.log2, 1, 0)); + this.addRecipe(new ItemStack(Blocks.planks, 4, 5), "#", '#', new ItemStack(Blocks.log2, 1, 1)); + this.addRecipe(new ItemStack(Items.stick, 4), "#", "#", '#', Blocks.planks); + this.addRecipe(new ItemStack(Blocks.torch, 4), "X", "#", 'X', Items.coal, '#', Items.stick); + this.addRecipe(new ItemStack(Blocks.torch, 4), "X", "#", 'X', new ItemStack(Items.coal, 1, 1), '#', Items.stick); + this.addRecipe(new ItemStack(Items.bowl, 4), "# #", " # ", '#', Blocks.planks); + this.addRecipe(new ItemStack(Items.glass_bottle, 3), "# #", " # ", '#', Blocks.glass); + this.addRecipe(new ItemStack(Blocks.rail, 16), "X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick); + this.addRecipe(new ItemStack(Blocks.golden_rail, 6), "X X", "X#X", "XRX", 'X', Items.gold_ingot, 'R', Items.redstone, '#', Items.stick); + this.addRecipe(new ItemStack(Blocks.activator_rail, 6), "XSX", "X#X", "XSX", 'X', Items.iron_ingot, '#', Blocks.redstone_torch, 'S', Items.stick); + this.addRecipe(new ItemStack(Blocks.detector_rail, 6), "X X", "X#X", "XRX", 'X', Items.iron_ingot, 'R', Items.redstone, '#', Blocks.stone_pressure_plate); + this.addRecipe(new ItemStack(Items.minecart, 1), "# #", "###", '#', Items.iron_ingot); + this.addRecipe(new ItemStack(Items.cauldron, 1), "# #", "# #", "###", '#', Items.iron_ingot); + this.addRecipe(new ItemStack(Items.brewing_stand, 1), " B ", "###", '#', Blocks.cobblestone, 'B', Items.blaze_rod); + this.addRecipe(new ItemStack(Blocks.lit_pumpkin, 1), "A", "B", 'A', Blocks.pumpkin, 'B', Blocks.torch); + this.addRecipe(new ItemStack(Items.chest_minecart, 1), "A", "B", 'A', Blocks.chest, 'B', Items.minecart); + this.addRecipe(new ItemStack(Items.furnace_minecart, 1), "A", "B", 'A', Blocks.furnace, 'B', Items.minecart); + this.addRecipe(new ItemStack(Items.tnt_minecart, 1), "A", "B", 'A', Blocks.tnt, 'B', Items.minecart); + this.addRecipe(new ItemStack(Items.hopper_minecart, 1), "A", "B", 'A', Blocks.hopper, 'B', Items.minecart); + this.addRecipe(new ItemStack(Items.boat, 1), "# #", "###", '#', Blocks.planks); + this.addRecipe(new ItemStack(Items.bucket, 1), "# #", " # ", '#', Items.iron_ingot); + this.addRecipe(new ItemStack(Items.flower_pot, 1), "# #", " # ", '#', Items.brick); + this.addShapelessRecipe(new ItemStack(Items.flint_and_steel, 1), new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1)); + this.addRecipe(new ItemStack(Items.bread, 1), "###", '#', Items.wheat); + this.addRecipe(new ItemStack(Blocks.oak_stairs, 4), "# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 0)); + this.addRecipe(new ItemStack(Blocks.birch_stairs, 4), "# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 2)); + this.addRecipe(new ItemStack(Blocks.spruce_stairs, 4), "# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 1)); + this.addRecipe(new ItemStack(Blocks.jungle_stairs, 4), "# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 3)); + this.addRecipe(new ItemStack(Blocks.acacia_stairs, 4), "# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 4)); + this.addRecipe(new ItemStack(Blocks.dark_oak_stairs, 4), "# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 5)); + this.addRecipe(new ItemStack(Items.fishing_rod, 1), " #", " #X", "# X", '#', Items.stick, 'X', Items.string); + this.addRecipe(new ItemStack(Items.carrot_on_a_stick, 1), "# ", " X", '#', Items.fishing_rod, 'X', Items.carrot).func_92100_c(); + this.addRecipe(new ItemStack(Blocks.stone_stairs, 4), "# ", "## ", "###", '#', Blocks.cobblestone); + this.addRecipe(new ItemStack(Blocks.brick_stairs, 4), "# ", "## ", "###", '#', Blocks.brick_block); + this.addRecipe(new ItemStack(Blocks.stone_brick_stairs, 4), "# ", "## ", "###", '#', Blocks.stonebrick); + this.addRecipe(new ItemStack(Blocks.nether_brick_stairs, 4), "# ", "## ", "###", '#', Blocks.nether_brick); + this.addRecipe(new ItemStack(Blocks.sandstone_stairs, 4), "# ", "## ", "###", '#', Blocks.sandstone); + this.addRecipe(new ItemStack(Blocks.quartz_stairs, 4), "# ", "## ", "###", '#', Blocks.quartz_block); + this.addRecipe(new ItemStack(Items.painting, 1), "###", "#X#", "###", '#', Items.stick, 'X', Blocks.wool); + this.addRecipe(new ItemStack(Items.item_frame, 1), "###", "#X#", "###", '#', Items.stick, 'X', Items.leather); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 0), "###", "#X#", "###", '#', Items.gold_ingot, 'X', Items.apple); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 1), "###", "#X#", "###", '#', Blocks.gold_block, 'X', Items.apple); + this.addRecipe(new ItemStack(Items.golden_carrot, 1, 0), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot); + this.addRecipe(new ItemStack(Items.speckled_melon, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.melon); + this.addRecipe(new ItemStack(Blocks.lever, 1), "X", "#", '#', Blocks.cobblestone, 'X', Items.stick); + this.addRecipe(new ItemStack(Blocks.tripwire_hook, 2), "I", "S", "#", '#', Blocks.planks, 'S', Items.stick, 'I', Items.iron_ingot); + this.addRecipe(new ItemStack(Blocks.redstone_torch, 1), "X", "#", '#', Items.stick, 'X', Items.redstone); + this.addRecipe(new ItemStack(Items.repeater, 1), "#X#", "III", '#', Blocks.redstone_torch, 'X', Items.redstone, 'I', Blocks.stone); + this.addRecipe(new ItemStack(Items.comparator, 1), " # ", "#X#", "III", '#', Blocks.redstone_torch, 'X', Items.quartz, 'I', Blocks.stone); + this.addRecipe(new ItemStack(Items.clock, 1), " # ", "#X#", " # ", '#', Items.gold_ingot, 'X', Items.redstone); + this.addRecipe(new ItemStack(Items.compass, 1), " # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.redstone); + this.addRecipe(new ItemStack(Items.map, 1), "###", "#X#", "###", '#', Items.paper, 'X', Items.compass); + this.addRecipe(new ItemStack(Blocks.stone_button, 1), "#", '#', Blocks.stone); + this.addRecipe(new ItemStack(Blocks.wooden_button, 1), "#", '#', Blocks.planks); + this.addRecipe(new ItemStack(Blocks.stone_pressure_plate, 1), "##", '#', Blocks.stone); + this.addRecipe(new ItemStack(Blocks.wooden_pressure_plate, 1), "##", '#', Blocks.planks); + this.addRecipe(new ItemStack(Blocks.heavy_weighted_pressure_plate, 1), "##", '#', Items.iron_ingot); + this.addRecipe(new ItemStack(Blocks.light_weighted_pressure_plate, 1), "##", '#', Items.gold_ingot); + this.addRecipe(new ItemStack(Blocks.dispenser, 1), "###", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.bow, 'R', Items.redstone); + this.addRecipe(new ItemStack(Blocks.dropper, 1), "###", "# #", "#R#", '#', Blocks.cobblestone, 'R', Items.redstone); + this.addRecipe(new ItemStack(Blocks.piston, 1), "TTT", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.iron_ingot, 'R', Items.redstone, 'T', Blocks.planks); + this.addRecipe(new ItemStack(Blocks.sticky_piston, 1), "S", "P", 'S', Items.slime_ball, 'P', Blocks.piston); + this.addRecipe(new ItemStack(Items.bed, 1), "###", "XXX", '#', Blocks.wool, 'X', Blocks.planks); + this.addRecipe(new ItemStack(Blocks.enchanting_table, 1), " B ", "D#D", "###", '#', Blocks.obsidian, 'B', Items.book, 'D', Items.diamond); + this.addRecipe(new ItemStack(Blocks.anvil, 1), "III", " i ", "iii", 'I', Blocks.iron_block, 'i', Items.iron_ingot); + this.addShapelessRecipe(new ItemStack(Items.ender_eye, 1), Items.ender_pearl, Items.blaze_powder); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), Items.gunpowder, Items.blaze_powder, Items.coal); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), Items.gunpowder, Items.blaze_powder, new ItemStack(Items.coal, 1, 1)); + this.addRecipe(new ItemStack(Blocks.daylight_detector), "GGG", "QQQ", "WWW", 'G', Blocks.glass, 'Q', Items.quartz, 'W', Blocks.wooden_slab); + this.addRecipe(new ItemStack(Blocks.hopper), "I I", "ICI", " I ", 'I', Items.iron_ingot, 'C', Blocks.chest); + Collections.sort(this.recipes, new Comparator() { + + public int compare(IRecipe p_compare_1_, IRecipe p_compare_2_) { + return p_compare_1_ instanceof ShapelessRecipes && p_compare_2_ instanceof ShapedRecipes ? 1 : (p_compare_2_ instanceof ShapelessRecipes && p_compare_1_ instanceof ShapedRecipes ? -1 : (p_compare_2_.getRecipeSize() < p_compare_1_.getRecipeSize() ? -1 : (p_compare_2_.getRecipeSize() > p_compare_1_.getRecipeSize() ? 1 : 0))); + } + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((IRecipe)p_compare_1_, (IRecipe)p_compare_2_); + } + }); + } + + ShapedRecipes addRecipe(ItemStack p_92103_1_, Object ... p_92103_2_) { + String var3 = ""; + int var4 = 0; + int var5 = 0; + int var6 = 0; + + if (p_92103_2_[var4] instanceof String[]) { + String[] var7 = (String[]) p_92103_2_[var4++]; + + for (int var8 = 0; var8 < var7.length; ++var8) { + String var9 = var7[var8]; + ++var6; + var5 = var9.length(); + var3 = var3 + var9; + } + } else { + while (p_92103_2_[var4] instanceof String) { + String var11 = (String)p_92103_2_[var4++]; + ++var6; + var5 = var11.length(); + var3 = var3 + var11; + } + } + + HashMap var12; + + for (var12 = new HashMap(); var4 < p_92103_2_.length; var4 += 2) { + Character var13 = (Character)p_92103_2_[var4]; + ItemStack var15 = null; + + if (p_92103_2_[var4 + 1] instanceof Item) { + var15 = new ItemStack((Item)p_92103_2_[var4 + 1]); + } else if (p_92103_2_[var4 + 1] instanceof Block) { + var15 = new ItemStack((Block)p_92103_2_[var4 + 1], 1, 32767); + } else if (p_92103_2_[var4 + 1] instanceof ItemStack) { + var15 = (ItemStack)p_92103_2_[var4 + 1]; + } + + var12.put(var13, var15); + } + + ItemStack[] var14 = new ItemStack[var5 * var6]; + + for (int var16 = 0; var16 < var5 * var6; ++var16) { + char var10 = var3.charAt(var16); + + if (var12.containsKey(Character.valueOf(var10))) { + var14[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy(); + } else { + var14[var16] = null; + } + } + + ShapedRecipes var17 = new ShapedRecipes(var5, var6, var14, p_92103_1_); + this.recipes.add(var17); + return var17; + } + + void addShapelessRecipe(ItemStack p_77596_1_, Object ... p_77596_2_) { + ArrayList var3 = new ArrayList(); + Object[] var4 = p_77596_2_; + int var5 = p_77596_2_.length; + + for (int var6 = 0; var6 < var5; ++var6) { + Object var7 = var4[var6]; + + if (var7 instanceof ItemStack) { + var3.add(((ItemStack)var7).copy()); + } else if (var7 instanceof Item) { + var3.add(new ItemStack((Item)var7)); + } else { + if (!(var7 instanceof Block)) { + throw new RuntimeException("Invalid shapeless recipy!"); + } + + var3.add(new ItemStack((Block)var7)); + } + } + + this.recipes.add(new ShapelessRecipes(p_77596_1_, var3)); + } + + public ItemStack findMatchingRecipe(InventoryCrafting p_82787_1_, World p_82787_2_) { + int var3 = 0; + ItemStack var4 = null; + ItemStack var5 = null; + int var6; + + for (var6 = 0; var6 < p_82787_1_.getSizeInventory(); ++var6) { + ItemStack var7 = p_82787_1_.getStackInSlot(var6); + + if (var7 != null) { + if (var3 == 0) { + var4 = var7; + } + + if (var3 == 1) { + var5 = var7; + } + + ++var3; + } + } + + if (var3 == 2 && var4.getItem() == var5.getItem() && var4.stackSize == 1 && var5.stackSize == 1 && var4.getItem().isDamageable()) { + Item var11 = var4.getItem(); + int var13 = var11.getMaxDamage() - var4.getItemDamageForDisplay(); + int var8 = var11.getMaxDamage() - var5.getItemDamageForDisplay(); + int var9 = var13 + var8 + var11.getMaxDamage() * 5 / 100; + int var10 = var11.getMaxDamage() - var9; + + if (var10 < 0) { + var10 = 0; + } + + return new ItemStack(var4.getItem(), 1, var10); + } else { + for (var6 = 0; var6 < this.recipes.size(); ++var6) { + IRecipe var12 = (IRecipe)this.recipes.get(var6); + + if (var12.matches(p_82787_1_, p_82787_2_)) { + return var12.getCraftingResult(p_82787_1_); + } + } + + return null; + } + } + + /** + * returns the List<> of all recipes + */ + public List getRecipeList() { + return this.recipes; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java new file mode 100644 index 0000000..806a867 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/FurnaceRecipes.java @@ -0,0 +1,115 @@ +package net.minecraft.item.crafting; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFishFood; +import net.minecraft.item.ItemStack; + +public class FurnaceRecipes { + private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); + + /** The list of smelting results. */ + private final Map smeltingList = new HashMap(); + private final Map experienceList = new HashMap(); + + + /** + * Used to call methods addSmelting and getSmeltingResult. + */ + public static FurnaceRecipes smelting() { + return smeltingBase; + } + + private FurnaceRecipes() { + this.func_151393_a(Blocks.iron_ore, new ItemStack(Items.iron_ingot), 0.7F); + this.func_151393_a(Blocks.gold_ore, new ItemStack(Items.gold_ingot), 1.0F); + this.func_151393_a(Blocks.diamond_ore, new ItemStack(Items.diamond), 1.0F); + this.func_151393_a(Blocks.sand, new ItemStack(Blocks.glass), 0.1F); + this.func_151396_a(Items.porkchop, new ItemStack(Items.cooked_porkchop), 0.35F); + this.func_151396_a(Items.beef, new ItemStack(Items.cooked_beef), 0.35F); + this.func_151396_a(Items.chicken, new ItemStack(Items.cooked_chicken), 0.35F); + this.func_151393_a(Blocks.cobblestone, new ItemStack(Blocks.stone), 0.1F); + this.func_151396_a(Items.clay_ball, new ItemStack(Items.brick), 0.3F); + this.func_151393_a(Blocks.clay, new ItemStack(Blocks.hardened_clay), 0.35F); + this.func_151393_a(Blocks.cactus, new ItemStack(Items.dye, 1, 2), 0.2F); + this.func_151393_a(Blocks.log, new ItemStack(Items.coal, 1, 1), 0.15F); + this.func_151393_a(Blocks.log2, new ItemStack(Items.coal, 1, 1), 0.15F); + this.func_151393_a(Blocks.emerald_ore, new ItemStack(Items.emerald), 1.0F); + this.func_151396_a(Items.potato, new ItemStack(Items.baked_potato), 0.35F); + this.func_151393_a(Blocks.netherrack, new ItemStack(Items.netherbrick), 0.1F); + ItemFishFood.FishType[] var1 = ItemFishFood.FishType.values(); + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + ItemFishFood.FishType var4 = var1[var3]; + + if (var4.func_150973_i()) { + this.func_151394_a(new ItemStack(Items.fish, 1, var4.func_150976_a()), new ItemStack(Items.cooked_fished, 1, var4.func_150976_a()), 0.35F); + } + } + + this.func_151393_a(Blocks.coal_ore, new ItemStack(Items.coal), 0.1F); + this.func_151393_a(Blocks.redstone_ore, new ItemStack(Items.redstone), 0.7F); + this.func_151393_a(Blocks.lapis_ore, new ItemStack(Items.dye, 1, 4), 0.2F); + this.func_151393_a(Blocks.quartz_ore, new ItemStack(Items.quartz), 0.2F); + } + + public void func_151393_a(Block p_151393_1_, ItemStack p_151393_2_, float p_151393_3_) { + this.func_151396_a(Item.getItemFromBlock(p_151393_1_), p_151393_2_, p_151393_3_); + } + + public void func_151396_a(Item p_151396_1_, ItemStack p_151396_2_, float p_151396_3_) { + this.func_151394_a(new ItemStack(p_151396_1_, 1, 32767), p_151396_2_, p_151396_3_); + } + + public void func_151394_a(ItemStack p_151394_1_, ItemStack p_151394_2_, float p_151394_3_) { + this.smeltingList.put(p_151394_1_, p_151394_2_); + this.experienceList.put(p_151394_2_, Float.valueOf(p_151394_3_)); + } + + public ItemStack func_151395_a(ItemStack p_151395_1_) { + Iterator var2 = this.smeltingList.entrySet().iterator(); + Entry var3; + + do { + if (!var2.hasNext()) { + return null; + } + + var3 = (Entry)var2.next(); + } + while (!this.func_151397_a(p_151395_1_, (ItemStack)var3.getKey())); + + return (ItemStack)var3.getValue(); + } + + private boolean func_151397_a(ItemStack p_151397_1_, ItemStack p_151397_2_) { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + + public Map getSmeltingList() { + return this.smeltingList; + } + + public float func_151398_b(ItemStack p_151398_1_) { + Iterator var2 = this.experienceList.entrySet().iterator(); + Entry var3; + + do { + if (!var2.hasNext()) { + return 0.0F; + } + + var3 = (Entry)var2.next(); + } + while (!this.func_151397_a(p_151398_1_, (ItemStack)var3.getKey())); + + return ((Float)var3.getValue()).floatValue(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/IRecipe.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/IRecipe.java new file mode 100644 index 0000000..e169718 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/IRecipe.java @@ -0,0 +1,24 @@ +package net.minecraft.item.crafting; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IRecipe { + /** + * Used to check if a recipe matches current crafting inventory + */ + boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_); + + /** + * Returns an Item that is the result of this recipe + */ + ItemStack getCraftingResult(InventoryCrafting p_77572_1_); + + /** + * Returns the size of the recipe area + */ + int getRecipeSize(); + + ItemStack getRecipeOutput(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java new file mode 100644 index 0000000..ccddd45 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipeBookCloning.java @@ -0,0 +1,93 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class RecipeBookCloning implements IRecipe { + + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + int var3 = 0; + ItemStack var4 = null; + + for (int var5 = 0; var5 < p_77569_1_.getSizeInventory(); ++var5) { + ItemStack var6 = p_77569_1_.getStackInSlot(var5); + + if (var6 != null) { + if (var6.getItem() == Items.written_book) { + if (var4 != null) { + return false; + } + + var4 = var6; + } else { + if (var6.getItem() != Items.writable_book) { + return false; + } + + ++var3; + } + } + } + + return var4 != null && var3 > 0; + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + int var2 = 0; + ItemStack var3 = null; + + for (int var4 = 0; var4 < p_77572_1_.getSizeInventory(); ++var4) { + ItemStack var5 = p_77572_1_.getStackInSlot(var4); + + if (var5 != null) { + if (var5.getItem() == Items.written_book) { + if (var3 != null) { + return null; + } + + var3 = var5; + } else { + if (var5.getItem() != Items.writable_book) { + return null; + } + + ++var2; + } + } + } + + if (var3 != null && var2 >= 1) { + ItemStack var6 = new ItemStack(Items.written_book, var2 + 1); + var6.setTagCompound((NBTTagCompound)var3.getTagCompound().copy()); + + if (var3.hasDisplayName()) { + var6.setStackDisplayName(var3.getDisplayName()); + } + + return var6; + } else { + return null; + } + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 9; + } + + public ItemStack getRecipeOutput() { + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java new file mode 100644 index 0000000..7d103c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipeFireworks.java @@ -0,0 +1,188 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public class RecipeFireworks implements IRecipe { + private ItemStack field_92102_a; + + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + this.field_92102_a = null; + int var3 = 0; + int var4 = 0; + int var5 = 0; + int var6 = 0; + int var7 = 0; + int var8 = 0; + + for (int var9 = 0; var9 < p_77569_1_.getSizeInventory(); ++var9) { + ItemStack var10 = p_77569_1_.getStackInSlot(var9); + + if (var10 != null) { + if (var10.getItem() == Items.gunpowder) { + ++var4; + } else if (var10.getItem() == Items.firework_charge) { + ++var6; + } else if (var10.getItem() == Items.dye) { + ++var5; + } else if (var10.getItem() == Items.paper) { + ++var3; + } else if (var10.getItem() == Items.glowstone_dust) { + ++var7; + } else if (var10.getItem() == Items.diamond) { + ++var7; + } else if (var10.getItem() == Items.fire_charge) { + ++var8; + } else if (var10.getItem() == Items.feather) { + ++var8; + } else if (var10.getItem() == Items.gold_nugget) { + ++var8; + } else { + if (var10.getItem() != Items.skull) { + return false; + } + + ++var8; + } + } + } + + var7 += var5 + var8; + + if (var4 <= 3 && var3 <= 1) { + NBTTagCompound var16; + NBTTagCompound var19; + + if (var4 >= 1 && var3 == 1 && var7 == 0) { + this.field_92102_a = new ItemStack(Items.fireworks); + + if (var6 > 0) { + var16 = new NBTTagCompound(); + var19 = new NBTTagCompound(); + NBTTagList var23 = new NBTTagList(); + + for (int var24 = 0; var24 < p_77569_1_.getSizeInventory(); ++var24) { + ItemStack var26 = p_77569_1_.getStackInSlot(var24); + + if (var26 != null && var26.getItem() == Items.firework_charge && var26.hasTagCompound() && var26.getTagCompound().func_150297_b("Explosion", 10)) { + var23.appendTag(var26.getTagCompound().getCompoundTag("Explosion")); + } + } + + var19.setTag("Explosions", var23); + var19.setByte("Flight", (byte)var4); + var16.setTag("Fireworks", var19); + this.field_92102_a.setTagCompound(var16); + } + + return true; + } else if (var4 == 1 && var3 == 0 && var6 == 0 && var5 > 0 && var8 <= 1) { + this.field_92102_a = new ItemStack(Items.firework_charge); + var16 = new NBTTagCompound(); + var19 = new NBTTagCompound(); + byte var22 = 0; + ArrayList var12 = new ArrayList(); + + for (int var13 = 0; var13 < p_77569_1_.getSizeInventory(); ++var13) { + ItemStack var14 = p_77569_1_.getStackInSlot(var13); + + if (var14 != null) { + if (var14.getItem() == Items.dye) { + var12.add(Integer.valueOf(ItemDye.field_150922_c[var14.getItemDamage()])); + } else if (var14.getItem() == Items.glowstone_dust) { + var19.setBoolean("Flicker", true); + } else if (var14.getItem() == Items.diamond) { + var19.setBoolean("Trail", true); + } else if (var14.getItem() == Items.fire_charge) { + var22 = 1; + } else if (var14.getItem() == Items.feather) { + var22 = 4; + } else if (var14.getItem() == Items.gold_nugget) { + var22 = 2; + } else if (var14.getItem() == Items.skull) { + var22 = 3; + } + } + } + + int[] var25 = new int[var12.size()]; + + for (int var27 = 0; var27 < var25.length; ++var27) { + var25[var27] = ((Integer)var12.get(var27)).intValue(); + } + + var19.setIntArray("Colors", var25); + var19.setByte("Type", var22); + var16.setTag("Explosion", var19); + this.field_92102_a.setTagCompound(var16); + return true; + } else if (var4 == 0 && var3 == 0 && var6 == 1 && var5 > 0 && var5 == var7) { + ArrayList var15 = new ArrayList(); + + for (int var17 = 0; var17 < p_77569_1_.getSizeInventory(); ++var17) { + ItemStack var11 = p_77569_1_.getStackInSlot(var17); + + if (var11 != null) { + if (var11.getItem() == Items.dye) { + var15.add(Integer.valueOf(ItemDye.field_150922_c[var11.getItemDamage()])); + } else if (var11.getItem() == Items.firework_charge) { + this.field_92102_a = var11.copy(); + this.field_92102_a.stackSize = 1; + } + } + } + + int[] var18 = new int[var15.size()]; + + for (int var20 = 0; var20 < var18.length; ++var20) { + var18[var20] = ((Integer)var15.get(var20)).intValue(); + } + + if (this.field_92102_a != null && this.field_92102_a.hasTagCompound()) { + NBTTagCompound var21 = this.field_92102_a.getTagCompound().getCompoundTag("Explosion"); + + if (var21 == null) { + return false; + } else { + var21.setIntArray("FadeColors", var18); + return true; + } + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + return this.field_92102_a.copy(); + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 10; + } + + public ItemStack getRecipeOutput() { + return this.field_92102_a; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesArmor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesArmor.java new file mode 100644 index 0000000..da496fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesArmor.java @@ -0,0 +1,30 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesArmor { + private final String[][] recipePatterns = new String[][] {{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}}; + private final Object[][] recipeItems; + + + public RecipesArmor() { + this.recipeItems = new Object[][] {{Items.leather, Blocks.fire, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.leather_helmet, Items.chainmail_helmet, Items.iron_helmet, Items.diamond_helmet, Items.golden_helmet}, {Items.leather_chestplate, Items.chainmail_chestplate, Items.iron_chestplate, Items.diamond_chestplate, Items.golden_chestplate}, {Items.leather_leggings, Items.chainmail_leggings, Items.iron_leggings, Items.diamond_leggings, Items.golden_leggings}, {Items.leather_boots, Items.chainmail_boots, Items.iron_boots, Items.diamond_boots, Items.golden_boots}}; + } + + /** + * Adds the armor recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77609_1_) { + for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { + Object var3 = this.recipeItems[0][var2]; + + for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { + Item var5 = (Item)this.recipeItems[var4 + 1][var2]; + p_77609_1_.addRecipe(new ItemStack(var5), this.recipePatterns[var4], 'X', var3); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java new file mode 100644 index 0000000..258b4ab --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesArmorDyes.java @@ -0,0 +1,133 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RecipesArmorDyes implements IRecipe { + + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + ItemStack var3 = null; + ArrayList var4 = new ArrayList(); + + for (int var5 = 0; var5 < p_77569_1_.getSizeInventory(); ++var5) { + ItemStack var6 = p_77569_1_.getStackInSlot(var5); + + if (var6 != null) { + if (var6.getItem() instanceof ItemArmor) { + ItemArmor var7 = (ItemArmor)var6.getItem(); + + if (var7.getArmorMaterial() != ItemArmor.ArmorMaterial.CLOTH || var3 != null) { + return false; + } + + var3 = var6; + } else { + if (var6.getItem() != Items.dye) { + return false; + } + + var4.add(var6); + } + } + } + + return var3 != null && !var4.isEmpty(); + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + ItemStack var2 = null; + int[] var3 = new int[3]; + int var4 = 0; + int var5 = 0; + ItemArmor var6 = null; + int var7; + int var9; + float var10; + float var11; + int var17; + + for (var7 = 0; var7 < p_77572_1_.getSizeInventory(); ++var7) { + ItemStack var8 = p_77572_1_.getStackInSlot(var7); + + if (var8 != null) { + if (var8.getItem() instanceof ItemArmor) { + var6 = (ItemArmor)var8.getItem(); + + if (var6.getArmorMaterial() != ItemArmor.ArmorMaterial.CLOTH || var2 != null) { + return null; + } + + var2 = var8.copy(); + var2.stackSize = 1; + + if (var6.hasColor(var8)) { + var9 = var6.getColor(var2); + var10 = (float)(var9 >> 16 & 255) / 255.0F; + var11 = (float)(var9 >> 8 & 255) / 255.0F; + float var12 = (float)(var9 & 255) / 255.0F; + var4 = (int)((float)var4 + Math.max(var10, Math.max(var11, var12)) * 255.0F); + var3[0] = (int)((float)var3[0] + var10 * 255.0F); + var3[1] = (int)((float)var3[1] + var11 * 255.0F); + var3[2] = (int)((float)var3[2] + var12 * 255.0F); + ++var5; + } + } else { + if (var8.getItem() != Items.dye) { + return null; + } + + float[] var14 = EntitySheep.fleeceColorTable[BlockColored.func_150032_b(var8.getItemDamage())]; + int var15 = (int)(var14[0] * 255.0F); + int var16 = (int)(var14[1] * 255.0F); + var17 = (int)(var14[2] * 255.0F); + var4 += Math.max(var15, Math.max(var16, var17)); + var3[0] += var15; + var3[1] += var16; + var3[2] += var17; + ++var5; + } + } + } + + if (var6 == null) { + return null; + } else { + var7 = var3[0] / var5; + int var13 = var3[1] / var5; + var9 = var3[2] / var5; + var10 = (float)var4 / (float)var5; + var11 = (float)Math.max(var7, Math.max(var13, var9)); + var7 = (int)((float)var7 * var10 / var11); + var13 = (int)((float)var13 * var10 / var11); + var9 = (int)((float)var9 * var10 / var11); + var17 = (var7 << 8) + var13; + var17 = (var17 << 8) + var9; + var6.func_82813_b(var2, var17); + return var2; + } + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 10; + } + + public ItemStack getRecipeOutput() { + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java new file mode 100644 index 0000000..c6614f6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java @@ -0,0 +1,31 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesCrafting { + + + /** + * Adds the crafting recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77589_1_) { + p_77589_1_.addRecipe(new ItemStack(Blocks.chest), "###", "# #", "###", '#', Blocks.planks); + p_77589_1_.addRecipe(new ItemStack(Blocks.trapped_chest), "#-", '#', Blocks.chest, '-', Blocks.tripwire_hook); + p_77589_1_.addRecipe(new ItemStack(Blocks.ender_chest), "###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.ender_eye); + p_77589_1_.addRecipe(new ItemStack(Blocks.furnace), "###", "# #", "###", '#', Blocks.cobblestone); + p_77589_1_.addRecipe(new ItemStack(Blocks.crafting_table), "##", "##", '#', Blocks.planks); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone), "##", "##", '#', new ItemStack(Blocks.sand, 1, 0)); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 4, 2), "##", "##", '#', Blocks.sandstone); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), "#", "#", '#', new ItemStack(Blocks.stone_slab, 1, 1)); + p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 1, 1), "#", "#", '#', new ItemStack(Blocks.stone_slab, 1, 7)); + p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 2, 2), "#", "#", '#', new ItemStack(Blocks.quartz_block, 1, 0)); + p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 4), "##", "##", '#', Blocks.stone); + p_77589_1_.addRecipe(new ItemStack(Blocks.iron_bars, 16), "###", "###", '#', Items.iron_ingot); + p_77589_1_.addRecipe(new ItemStack(Blocks.glass_pane, 16), "###", "###", '#', Blocks.glass); + p_77589_1_.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), " R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone); + p_77589_1_.addRecipe(new ItemStack(Blocks.beacon, 1), "GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.nether_star, 'O', Blocks.obsidian); + p_77589_1_.addRecipe(new ItemStack(Blocks.nether_brick, 1), "NN", "NN", 'N', Items.netherbrick); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesDyes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesDyes.java new file mode 100644 index 0000000..1ad402f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesDyes.java @@ -0,0 +1,57 @@ +package net.minecraft.item.crafting; + +import net.minecraft.block.BlockColored; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesDyes { + + + /** + * Adds the dye recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77607_1_) { + int var2; + + for (var2 = 0; var2 < 16; ++var2) { + p_77607_1_.addShapelessRecipe(new ItemStack(Blocks.wool, 1, BlockColored.func_150031_c(var2)), new ItemStack(Items.dye, 1, var2), new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0)); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_hardened_clay, 8, BlockColored.func_150031_c(var2)), "###", "#X#", "###", '#', new ItemStack(Blocks.hardened_clay), 'X', new ItemStack(Items.dye, 1, var2)); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_glass, 8, BlockColored.func_150031_c(var2)), "###", "#X#", "###", '#', new ItemStack(Blocks.glass), 'X', new ItemStack(Items.dye, 1, var2)); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_glass_pane, 16, var2), "###", "###", '#', new ItemStack(Blocks.stained_glass, 1, var2)); + } + + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 11), new ItemStack(Blocks.yellow_flower, 1, 0)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 1), new ItemStack(Blocks.red_flower, 1, 0)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, 15), Items.bone); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 9), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 15)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 14), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 11)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 10), new ItemStack(Items.dye, 1, 2), new ItemStack(Items.dye, 1, 15)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 8), new ItemStack(Items.dye, 1, 0), new ItemStack(Items.dye, 1, 15)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 7), new ItemStack(Items.dye, 1, 8), new ItemStack(Items.dye, 1, 15)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, 7), new ItemStack(Items.dye, 1, 0), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.dye, 1, 15)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 12), new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 15)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 6), new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 2)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 5), new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 1)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 13), new ItemStack(Items.dye, 1, 5), new ItemStack(Items.dye, 1, 9)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, 13), new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 9)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 4, 13), new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 15)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 12), new ItemStack(Blocks.red_flower, 1, 1)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 13), new ItemStack(Blocks.red_flower, 1, 2)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 7), new ItemStack(Blocks.red_flower, 1, 3)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 1), new ItemStack(Blocks.red_flower, 1, 4)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 14), new ItemStack(Blocks.red_flower, 1, 5)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 7), new ItemStack(Blocks.red_flower, 1, 6)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 9), new ItemStack(Blocks.red_flower, 1, 7)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 7), new ItemStack(Blocks.red_flower, 1, 8)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 11), new ItemStack(Blocks.double_plant, 1, 0)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 13), new ItemStack(Blocks.double_plant, 1, 1)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 1), new ItemStack(Blocks.double_plant, 1, 4)); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 9), new ItemStack(Blocks.double_plant, 1, 5)); + + for (var2 = 0; var2 < 16; ++var2) { + p_77607_1_.addRecipe(new ItemStack(Blocks.carpet, 3, var2), "##", '#', new ItemStack(Blocks.wool, 1, var2)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesFood.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesFood.java new file mode 100644 index 0000000..b7ab22a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesFood.java @@ -0,0 +1,24 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesFood { + + + /** + * Adds the food recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77608_1_) { + p_77608_1_.addShapelessRecipe(new ItemStack(Items.mushroom_stew), Blocks.brown_mushroom, Blocks.red_mushroom, Items.bowl); + p_77608_1_.addRecipe(new ItemStack(Items.cookie, 8), "#X#", 'X', new ItemStack(Items.dye, 1, 3), '#', Items.wheat); + p_77608_1_.addRecipe(new ItemStack(Blocks.melon_block), "MMM", "MMM", "MMM", 'M', Items.melon); + p_77608_1_.addRecipe(new ItemStack(Items.melon_seeds), "M", 'M', Items.melon); + p_77608_1_.addRecipe(new ItemStack(Items.pumpkin_seeds, 4), "M", 'M', Blocks.pumpkin); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.pumpkin_pie), Blocks.pumpkin, Items.sugar, Items.egg); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.fermented_spider_eye), Items.spider_eye, Blocks.brown_mushroom, Items.sugar); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.blaze_powder, 2), Items.blaze_rod); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.magma_cream), Items.blaze_powder, Items.slime_ball); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesIngots.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesIngots.java new file mode 100644 index 0000000..74dc280 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesIngots.java @@ -0,0 +1,30 @@ +package net.minecraft.item.crafting; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesIngots { + private final Object[][] recipeItems; + + + public RecipesIngots() { + this.recipeItems = new Object[][] {{Blocks.gold_block, new ItemStack(Items.gold_ingot, 9)}, {Blocks.iron_block, new ItemStack(Items.iron_ingot, 9)}, {Blocks.diamond_block, new ItemStack(Items.diamond, 9)}, {Blocks.emerald_block, new ItemStack(Items.emerald, 9)}, {Blocks.lapis_block, new ItemStack(Items.dye, 9, 4)}, {Blocks.redstone_block, new ItemStack(Items.redstone, 9)}, {Blocks.coal_block, new ItemStack(Items.coal, 9, 0)}, {Blocks.hay_block, new ItemStack(Items.wheat, 9)}}; + } + + /** + * Adds the ingot recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77590_1_) { + for (int var2 = 0; var2 < this.recipeItems.length; ++var2) { + Block var3 = (Block)this.recipeItems[var2][0]; + ItemStack var4 = (ItemStack)this.recipeItems[var2][1]; + p_77590_1_.addRecipe(new ItemStack(var3), "###", "###", "###", '#', var4); + p_77590_1_.addRecipe(var4, "#", '#', var3); + } + + p_77590_1_.addRecipe(new ItemStack(Items.gold_ingot), "###", "###", "###", '#', Items.gold_nugget); + p_77590_1_.addRecipe(new ItemStack(Items.gold_nugget, 9), "#", '#', Items.gold_ingot); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java new file mode 100644 index 0000000..9663c8f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesMapCloning.java @@ -0,0 +1,91 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RecipesMapCloning implements IRecipe { + + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + int var3 = 0; + ItemStack var4 = null; + + for (int var5 = 0; var5 < p_77569_1_.getSizeInventory(); ++var5) { + ItemStack var6 = p_77569_1_.getStackInSlot(var5); + + if (var6 != null) { + if (var6.getItem() == Items.filled_map) { + if (var4 != null) { + return false; + } + + var4 = var6; + } else { + if (var6.getItem() != Items.map) { + return false; + } + + ++var3; + } + } + } + + return var4 != null && var3 > 0; + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + int var2 = 0; + ItemStack var3 = null; + + for (int var4 = 0; var4 < p_77572_1_.getSizeInventory(); ++var4) { + ItemStack var5 = p_77572_1_.getStackInSlot(var4); + + if (var5 != null) { + if (var5.getItem() == Items.filled_map) { + if (var3 != null) { + return null; + } + + var3 = var5; + } else { + if (var5.getItem() != Items.map) { + return null; + } + + ++var2; + } + } + } + + if (var3 != null && var2 >= 1) { + ItemStack var6 = new ItemStack(Items.filled_map, var2 + 1, var3.getItemDamage()); + + if (var3.hasDisplayName()) { + var6.setStackDisplayName(var3.getDisplayName()); + } + + return var6; + } else { + return null; + } + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return 9; + } + + public ItemStack getRecipeOutput() { + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java new file mode 100644 index 0000000..c6f9bed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesMapExtending.java @@ -0,0 +1,67 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class RecipesMapExtending extends ShapedRecipes { + + + public RecipesMapExtending() { + super(3, 3, new ItemStack[] {new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.filled_map, 0, 32767), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper)}, new ItemStack(Items.map, 0, 0)); + } + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + if (!super.matches(p_77569_1_, p_77569_2_)) { + return false; + } else { + ItemStack var3 = null; + + for (int var4 = 0; var4 < p_77569_1_.getSizeInventory() && var3 == null; ++var4) { + ItemStack var5 = p_77569_1_.getStackInSlot(var4); + + if (var5 != null && var5.getItem() == Items.filled_map) { + var3 = var5; + } + } + + if (var3 == null) { + return false; + } else { + MapData var6 = Items.filled_map.getMapData(var3, p_77569_2_); + return var6 != null && var6.scale < 4; + } + } + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + ItemStack var2 = null; + + for (int var3 = 0; var3 < p_77572_1_.getSizeInventory() && var2 == null; ++var3) { + ItemStack var4 = p_77572_1_.getStackInSlot(var3); + + if (var4 != null && var4.getItem() == Items.filled_map) { + var2 = var4; + } + } + + var2 = var2.copy(); + var2.stackSize = 1; + + if (var2.getTagCompound() == null) { + var2.setTagCompound(new NBTTagCompound()); + } + + var2.getTagCompound().setBoolean("map_is_scaling", true); + return var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesTools.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesTools.java new file mode 100644 index 0000000..162fa35 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesTools.java @@ -0,0 +1,32 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesTools { + private final String[][] recipePatterns = new String[][] {{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}}; + private final Object[][] recipeItems; + + + public RecipesTools() { + this.recipeItems = new Object[][] {{Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.wooden_pickaxe, Items.stone_pickaxe, Items.iron_pickaxe, Items.diamond_pickaxe, Items.golden_pickaxe}, {Items.wooden_shovel, Items.stone_shovel, Items.iron_shovel, Items.diamond_shovel, Items.golden_shovel}, {Items.wooden_axe, Items.stone_axe, Items.iron_axe, Items.diamond_axe, Items.golden_axe}, {Items.wooden_hoe, Items.stone_hoe, Items.iron_hoe, Items.diamond_hoe, Items.golden_hoe}}; + } + + /** + * Adds the tool recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77586_1_) { + for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { + Object var3 = this.recipeItems[0][var2]; + + for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { + Item var5 = (Item)this.recipeItems[var4 + 1][var2]; + p_77586_1_.addRecipe(new ItemStack(var5), this.recipePatterns[var4], '#', Items.stick, 'X', var3); + } + } + + p_77586_1_.addRecipe(new ItemStack(Items.shears), " #", "# ", '#', Items.iron_ingot); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java new file mode 100644 index 0000000..6ba87f0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/RecipesWeapons.java @@ -0,0 +1,33 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesWeapons { + private final String[][] recipePatterns = new String[][] {{"X", "X", "#"}}; + private final Object[][] recipeItems; + + + public RecipesWeapons() { + this.recipeItems = new Object[][] {{Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.wooden_sword, Items.stone_sword, Items.iron_sword, Items.diamond_sword, Items.golden_sword}}; + } + + /** + * Adds the weapon recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77583_1_) { + for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { + Object var3 = this.recipeItems[0][var2]; + + for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { + Item var5 = (Item)this.recipeItems[var4 + 1][var2]; + p_77583_1_.addRecipe(new ItemStack(var5), this.recipePatterns[var4], '#', Items.stick, 'X', var3); + } + } + + p_77583_1_.addRecipe(new ItemStack(Items.bow, 1), " #X", "# X", " #X", 'X', Items.string, '#', Items.stick); + p_77583_1_.addRecipe(new ItemStack(Items.arrow, 4), "X", "#", "Y", 'Y', Items.feather, 'X', Items.flint, '#', Items.stick); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java new file mode 100644 index 0000000..d077126 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/ShapedRecipes.java @@ -0,0 +1,122 @@ +package net.minecraft.item.crafting; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class ShapedRecipes implements IRecipe { + /** How many horizontal slots this recipe is wide. */ + private final int recipeWidth; + + /** How many vertical slots this recipe uses. */ + private final int recipeHeight; + + /** Is a array of ItemStack that composes the recipe. */ + private final ItemStack[] recipeItems; + + /** Is the ItemStack that you get when craft the recipe. */ + private final ItemStack recipeOutput; + private boolean field_92101_f; + + + public ShapedRecipes(int p_i1917_1_, int p_i1917_2_, ItemStack[] p_i1917_3_, ItemStack p_i1917_4_) { + this.recipeWidth = p_i1917_1_; + this.recipeHeight = p_i1917_2_; + this.recipeItems = p_i1917_3_; + this.recipeOutput = p_i1917_4_; + } + + public ItemStack getRecipeOutput() { + return this.recipeOutput; + } + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + for (int var3 = 0; var3 <= 3 - this.recipeWidth; ++var3) { + for (int var4 = 0; var4 <= 3 - this.recipeHeight; ++var4) { + if (this.checkMatch(p_77569_1_, var3, var4, true)) { + return true; + } + + if (this.checkMatch(p_77569_1_, var3, var4, false)) { + return true; + } + } + } + + return false; + } + + /** + * Checks if the region of a crafting inventory is match for the recipe. + */ + private boolean checkMatch(InventoryCrafting p_77573_1_, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) { + for (int var5 = 0; var5 < 3; ++var5) { + for (int var6 = 0; var6 < 3; ++var6) { + int var7 = var5 - p_77573_2_; + int var8 = var6 - p_77573_3_; + ItemStack var9 = null; + + if (var7 >= 0 && var8 >= 0 && var7 < this.recipeWidth && var8 < this.recipeHeight) { + if (p_77573_4_) { + var9 = this.recipeItems[this.recipeWidth - var7 - 1 + var8 * this.recipeWidth]; + } else { + var9 = this.recipeItems[var7 + var8 * this.recipeWidth]; + } + } + + ItemStack var10 = p_77573_1_.getStackInRowAndColumn(var5, var6); + + if (var10 != null || var9 != null) { + if (var10 == null && var9 != null || var10 != null && var9 == null) { + return false; + } + + if (var9.getItem() != var10.getItem()) { + return false; + } + + if (var9.getItemDamage() != 32767 && var9.getItemDamage() != var10.getItemDamage()) { + return false; + } + } + } + } + + return true; + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + ItemStack var2 = this.getRecipeOutput().copy(); + + if (this.field_92101_f) { + for (int var3 = 0; var3 < p_77572_1_.getSizeInventory(); ++var3) { + ItemStack var4 = p_77572_1_.getStackInSlot(var3); + + if (var4 != null && var4.hasTagCompound()) { + var2.setTagCompound((NBTTagCompound)var4.stackTagCompound.copy()); + } + } + } + + return var2; + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return this.recipeWidth * this.recipeHeight; + } + + public ShapedRecipes func_92100_c() { + this.field_92101_f = true; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java new file mode 100644 index 0000000..94e0dd1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/item/crafting/ShapelessRecipes.java @@ -0,0 +1,74 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ShapelessRecipes implements IRecipe { + /** Is the ItemStack that you get when craft the recipe. */ + private final ItemStack recipeOutput; + + /** Is a List of ItemStack that composes the recipe. */ + private final List recipeItems; + + + public ShapelessRecipes(ItemStack p_i1918_1_, List p_i1918_2_) { + this.recipeOutput = p_i1918_1_; + this.recipeItems = p_i1918_2_; + } + + public ItemStack getRecipeOutput() { + return this.recipeOutput; + } + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { + ArrayList var3 = new ArrayList(this.recipeItems); + + for (int var4 = 0; var4 < 3; ++var4) { + for (int var5 = 0; var5 < 3; ++var5) { + ItemStack var6 = p_77569_1_.getStackInRowAndColumn(var5, var4); + + if (var6 != null) { + boolean var7 = false; + Iterator var8 = var3.iterator(); + + while (var8.hasNext()) { + ItemStack var9 = (ItemStack)var8.next(); + + if (var6.getItem() == var9.getItem() && (var9.getItemDamage() == 32767 || var6.getItemDamage() == var9.getItemDamage())) { + var7 = true; + var3.remove(var9); + break; + } + } + + if (!var7) { + return false; + } + } + } + } + + return var3.isEmpty(); + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { + return this.recipeOutput.copy(); + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() { + return this.recipeItems.size(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/CompressedStreamTools.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/CompressedStreamTools.java new file mode 100644 index 0000000..59f8d4a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/CompressedStreamTools.java @@ -0,0 +1,188 @@ +package net.minecraft.nbt; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; + +public class CompressedStreamTools { + + + /** + * Load the gzipped compound from the inputstream. + */ + public static NBTTagCompound readCompressed(InputStream p_74796_0_) throws IOException { + DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(p_74796_0_))); + NBTTagCompound var2; + + try { + var2 = func_152456_a(var1, NBTSizeTracker.field_152451_a); + } + finally { + var1.close(); + } + + return var2; + } + + /** + * Write the compound, gzipped, to the outputstream. + */ + public static void writeCompressed(NBTTagCompound p_74799_0_, OutputStream p_74799_1_) throws IOException { + DataOutputStream var2 = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(p_74799_1_))); + + try { + write(p_74799_0_, var2); + } + finally { + var2.close(); + } + } + + public static NBTTagCompound func_152457_a(byte[] p_152457_0_, NBTSizeTracker p_152457_1_) throws IOException { + DataInputStream var2 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(p_152457_0_)))); + NBTTagCompound var3; + + try { + var3 = func_152456_a(var2, p_152457_1_); + } + finally { + var2.close(); + } + + return var3; + } + + public static byte[] compress(NBTTagCompound p_74798_0_) throws IOException { + ByteArrayOutputStream var1 = new ByteArrayOutputStream(); + DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1)); + + try { + write(p_74798_0_, var2); + } + finally { + var2.close(); + } + + return var1.toByteArray(); + } + + public static void safeWrite(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException { + File var2 = new File(p_74793_1_.getAbsolutePath() + "_tmp"); + + if (var2.exists()) { + var2.delete(); + } + + write(p_74793_0_, var2); + + if (p_74793_1_.exists()) { + p_74793_1_.delete(); + } + + if (p_74793_1_.exists()) { + throw new IOException("Failed to delete " + p_74793_1_); + } else { + var2.renameTo(p_74793_1_); + } + } + + public static void write(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException { + DataOutputStream var2 = new DataOutputStream(new FileOutputStream(p_74795_1_)); + + try { + write(p_74795_0_, var2); + } + finally { + var2.close(); + } + } + + public static NBTTagCompound read(File p_74797_0_) throws IOException { + return func_152458_a(p_74797_0_, NBTSizeTracker.field_152451_a); + } + + public static NBTTagCompound func_152458_a(File p_152458_0_, NBTSizeTracker p_152458_1_) throws IOException { + if (!p_152458_0_.exists()) { + return null; + } else { + DataInputStream var2 = new DataInputStream(new FileInputStream(p_152458_0_)); + NBTTagCompound var3; + + try { + var3 = func_152456_a(var2, p_152458_1_); + } finally { + var2.close(); + } + + return var3; + } + } + + /** + * Reads from a CompressedStream. + */ + public static NBTTagCompound read(DataInputStream p_74794_0_) throws IOException { + return func_152456_a(p_74794_0_, NBTSizeTracker.field_152451_a); + } + + public static NBTTagCompound func_152456_a(DataInput p_152456_0_, NBTSizeTracker p_152456_1_) throws IOException { + NBTBase var2 = func_152455_a(p_152456_0_, 0, p_152456_1_); + + if (var2 instanceof NBTTagCompound) { + return (NBTTagCompound)var2; + } else { + throw new IOException("Root tag must be a named compound tag"); + } + } + + public static void write(NBTTagCompound p_74800_0_, DataOutput p_74800_1_) throws IOException { + func_150663_a(p_74800_0_, p_74800_1_); + } + + private static void func_150663_a(NBTBase p_150663_0_, DataOutput p_150663_1_) throws IOException { + p_150663_1_.writeByte(p_150663_0_.getId()); + + if (p_150663_0_.getId() != 0) { + p_150663_1_.writeUTF(""); + p_150663_0_.write(p_150663_1_); + } + } + + private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException { + byte var3 = p_152455_0_.readByte(); + + if (var3 == 0) { + return new NBTTagEnd(); + } else { + p_152455_0_.readUTF(); + NBTBase var4 = NBTBase.func_150284_a(var3); + + try { + var4.func_152446_a(p_152455_0_, p_152455_1_, p_152455_2_); + return var4; + } catch (IOException var8) { + CrashReport var6 = CrashReport.makeCrashReport(var8, "Loading NBT data"); + CrashReportCategory var7 = var6.makeCategory("NBT Tag"); + var7.addCrashSection("Tag name", "[UNNAMED TAG]"); + var7.addCrashSection("Tag type", Byte.valueOf(var3)); + throw new ReportedException(var6); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/JsonToNBT.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/JsonToNBT.java new file mode 100644 index 0000000..642adca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/JsonToNBT.java @@ -0,0 +1,410 @@ +package net.minecraft.nbt; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Stack; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class JsonToNBT { + private static final Logger logger = LogManager.getLogger(); + + + public static NBTBase func_150315_a(String p_150315_0_) throws NBTException { + p_150315_0_ = p_150315_0_.trim(); + int var1 = func_150310_b(p_150315_0_); + + if (var1 != 1) { + throw new NBTException("Encountered multiple top tags, only one expected"); + } else { + JsonToNBT.Any var2 = null; + + if (p_150315_0_.startsWith("{")) { + var2 = func_150316_a("tag", p_150315_0_); + } else { + var2 = func_150316_a(func_150313_b(p_150315_0_, false), func_150311_c(p_150315_0_, false)); + } + + return var2.func_150489_a(); + } + } + + static int func_150310_b(String p_150310_0_) throws NBTException { + int var1 = 0; + boolean var2 = false; + Stack var3 = new Stack(); + + for (int var4 = 0; var4 < p_150310_0_.length(); ++var4) { + char var5 = p_150310_0_.charAt(var4); + + if (var5 == 34) { + if (var4 > 0 && p_150310_0_.charAt(var4 - 1) == 92) { + if (!var2) { + throw new NBTException("Illegal use of \\\": " + p_150310_0_); + } + } else { + var2 = !var2; + } + } else if (!var2) { + if (var5 != 123 && var5 != 91) { + if (var5 == 125 && (var3.isEmpty() || ((Character)var3.pop()).charValue() != 123)) { + throw new NBTException("Unbalanced curly brackets {}: " + p_150310_0_); + } + + if (var5 == 93 && (var3.isEmpty() || ((Character)var3.pop()).charValue() != 91)) { + throw new NBTException("Unbalanced square brackets []: " + p_150310_0_); + } + } else { + if (var3.isEmpty()) { + ++var1; + } + + var3.push(Character.valueOf(var5)); + } + } + } + + if (var2) { + throw new NBTException("Unbalanced quotation: " + p_150310_0_); + } else if (!var3.isEmpty()) { + throw new NBTException("Unbalanced brackets: " + p_150310_0_); + } else if (var1 == 0 && !p_150310_0_.isEmpty()) { + return 1; + } else { + return var1; + } + } + + static JsonToNBT.Any func_150316_a(String p_150316_0_, String p_150316_1_) throws NBTException { + p_150316_1_ = p_150316_1_.trim(); + func_150310_b(p_150316_1_); + String var3; + String var4; + String var5; + char var6; + + if (p_150316_1_.startsWith("{")) { + if (!p_150316_1_.endsWith("}")) { + throw new NBTException("Unable to locate ending bracket for: " + p_150316_1_); + } else { + p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1); + JsonToNBT.Compound var7 = new JsonToNBT.Compound(p_150316_0_); + + while (p_150316_1_.length() > 0) { + var3 = func_150314_a(p_150316_1_, false); + + if (var3.length() > 0) { + var4 = func_150313_b(var3, false); + var5 = func_150311_c(var3, false); + var7.field_150491_b.add(func_150316_a(var4, var5)); + + if (p_150316_1_.length() < var3.length() + 1) { + break; + } + + var6 = p_150316_1_.charAt(var3.length()); + + if (var6 != 44 && var6 != 123 && var6 != 125 && var6 != 91 && var6 != 93) { + throw new NBTException("Unexpected token '" + var6 + "' at: " + p_150316_1_.substring(var3.length())); + } + + p_150316_1_ = p_150316_1_.substring(var3.length() + 1); + } + } + + return var7; + } + } else if (p_150316_1_.startsWith("[") && !p_150316_1_.matches("\\[[-\\d|,\\s]+\\]")) { + if (!p_150316_1_.endsWith("]")) { + throw new NBTException("Unable to locate ending bracket for: " + p_150316_1_); + } else { + p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1); + JsonToNBT.List var2 = new JsonToNBT.List(p_150316_0_); + + while (p_150316_1_.length() > 0) { + var3 = func_150314_a(p_150316_1_, true); + + if (var3.length() > 0) { + var4 = func_150313_b(var3, true); + var5 = func_150311_c(var3, true); + var2.field_150492_b.add(func_150316_a(var4, var5)); + + if (p_150316_1_.length() < var3.length() + 1) { + break; + } + + var6 = p_150316_1_.charAt(var3.length()); + + if (var6 != 44 && var6 != 123 && var6 != 125 && var6 != 91 && var6 != 93) { + throw new NBTException("Unexpected token '" + var6 + "' at: " + p_150316_1_.substring(var3.length())); + } + + p_150316_1_ = p_150316_1_.substring(var3.length() + 1); + } else { + logger.debug(p_150316_1_); + } + } + + return var2; + } + } else { + return new JsonToNBT.Primitive(p_150316_0_, p_150316_1_); + } + } + + private static String func_150314_a(String p_150314_0_, boolean p_150314_1_) throws NBTException { + int var2 = func_150312_a(p_150314_0_, ':'); + + if (var2 < 0 && !p_150314_1_) { + throw new NBTException("Unable to locate name/value separator for string: " + p_150314_0_); + } else { + int var3 = func_150312_a(p_150314_0_, ','); + + if (var3 >= 0 && var3 < var2 && !p_150314_1_) { + throw new NBTException("Name error at: " + p_150314_0_); + } else { + if (p_150314_1_ && (var2 < 0 || var2 > var3)) { + var2 = -1; + } + + Stack var4 = new Stack(); + int var5 = var2 + 1; + boolean var6 = false; + boolean var7 = false; + boolean var8 = false; + + for (int var9 = 0; var5 < p_150314_0_.length(); ++var5) { + char var10 = p_150314_0_.charAt(var5); + + if (var10 == 34) { + if (var5 > 0 && p_150314_0_.charAt(var5 - 1) == 92) { + if (!var6) { + throw new NBTException("Illegal use of \\\": " + p_150314_0_); + } + } else { + var6 = !var6; + + if (var6 && !var8) { + var7 = true; + } + + if (!var6) { + var9 = var5; + } + } + } else if (!var6) { + if (var10 != 123 && var10 != 91) { + if (var10 == 125 && (var4.isEmpty() || ((Character)var4.pop()).charValue() != 123)) { + throw new NBTException("Unbalanced curly brackets {}: " + p_150314_0_); + } + + if (var10 == 93 && (var4.isEmpty() || ((Character)var4.pop()).charValue() != 91)) { + throw new NBTException("Unbalanced square brackets []: " + p_150314_0_); + } + + if (var10 == 44 && var4.isEmpty()) { + return p_150314_0_.substring(0, var5); + } + } else { + var4.push(Character.valueOf(var10)); + } + } + + if (!Character.isWhitespace(var10)) { + if (!var6 && var7 && var9 != var5) { + return p_150314_0_.substring(0, var9 + 1); + } + + var8 = true; + } + } + + return p_150314_0_.substring(0, var5); + } + } + } + + private static String func_150313_b(String p_150313_0_, boolean p_150313_1_) throws NBTException { + if (p_150313_1_) { + p_150313_0_ = p_150313_0_.trim(); + + if (p_150313_0_.startsWith("{") || p_150313_0_.startsWith("[")) { + return ""; + } + } + + int var2 = p_150313_0_.indexOf(58); + + if (var2 < 0) { + if (p_150313_1_) { + return ""; + } else { + throw new NBTException("Unable to locate name/value separator for string: " + p_150313_0_); + } + } else { + return p_150313_0_.substring(0, var2).trim(); + } + } + + private static String func_150311_c(String p_150311_0_, boolean p_150311_1_) throws NBTException { + if (p_150311_1_) { + p_150311_0_ = p_150311_0_.trim(); + + if (p_150311_0_.startsWith("{") || p_150311_0_.startsWith("[")) { + return p_150311_0_; + } + } + + int var2 = p_150311_0_.indexOf(58); + + if (var2 < 0) { + if (p_150311_1_) { + return p_150311_0_; + } else { + throw new NBTException("Unable to locate name/value separator for string: " + p_150311_0_); + } + } else { + return p_150311_0_.substring(var2 + 1).trim(); + } + } + + private static int func_150312_a(String p_150312_0_, char p_150312_1_) { + int var2 = 0; + + for (boolean var3 = false; var2 < p_150312_0_.length(); ++var2) { + char var4 = p_150312_0_.charAt(var2); + + if (var4 == 34) { + if (var2 <= 0 || p_150312_0_.charAt(var2 - 1) != 92) { + var3 = !var3; + } + } else if (!var3) { + if (var4 == p_150312_1_) { + return var2; + } + + if (var4 == 123 || var4 == 91) { + return -1; + } + } + } + + return -1; + } + + abstract static class Any { + protected String field_150490_a; + + + public abstract NBTBase func_150489_a(); + } + + static class Compound extends JsonToNBT.Any { + protected ArrayList field_150491_b = new ArrayList(); + + + public Compound(String p_i45137_1_) { + this.field_150490_a = p_i45137_1_; + } + + public NBTBase func_150489_a() { + NBTTagCompound var1 = new NBTTagCompound(); + Iterator var2 = this.field_150491_b.iterator(); + + while (var2.hasNext()) { + JsonToNBT.Any var3 = (JsonToNBT.Any)var2.next(); + var1.setTag(var3.field_150490_a, var3.func_150489_a()); + } + + return var1; + } + } + + static class List extends JsonToNBT.Any { + protected ArrayList field_150492_b = new ArrayList(); + + + public List(String p_i45138_1_) { + this.field_150490_a = p_i45138_1_; + } + + public NBTBase func_150489_a() { + NBTTagList var1 = new NBTTagList(); + Iterator var2 = this.field_150492_b.iterator(); + + while (var2.hasNext()) { + JsonToNBT.Any var3 = (JsonToNBT.Any)var2.next(); + var1.appendTag(var3.func_150489_a()); + } + + return var1; + } + } + + static class Primitive extends JsonToNBT.Any { + protected String field_150493_b; + + + public Primitive(String p_i45139_1_, String p_i45139_2_) { + this.field_150490_a = p_i45139_1_; + this.field_150493_b = p_i45139_2_; + } + + public NBTBase func_150489_a() { + try { + if (this.field_150493_b.matches("[-+]?[0-9]*\\.?[0-9]+[d|D]")) { + return new NBTTagDouble(Double.parseDouble(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } else if (this.field_150493_b.matches("[-+]?[0-9]*\\.?[0-9]+[f|F]")) { + return new NBTTagFloat(Float.parseFloat(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } else if (this.field_150493_b.matches("[-+]?[0-9]+[b|B]")) { + return new NBTTagByte(Byte.parseByte(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } else if (this.field_150493_b.matches("[-+]?[0-9]+[l|L]")) { + return new NBTTagLong(Long.parseLong(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } else if (this.field_150493_b.matches("[-+]?[0-9]+[s|S]")) { + return new NBTTagShort(Short.parseShort(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } else if (this.field_150493_b.matches("[-+]?[0-9]+")) { + return new NBTTagInt(Integer.parseInt(this.field_150493_b)); + } else if (this.field_150493_b.matches("[-+]?[0-9]*\\.?[0-9]+")) { + return new NBTTagDouble(Double.parseDouble(this.field_150493_b)); + } else if (!this.field_150493_b.equalsIgnoreCase("true") && !this.field_150493_b.equalsIgnoreCase("false")) { + if (this.field_150493_b.startsWith("[") && this.field_150493_b.endsWith("]")) { + if (this.field_150493_b.length() > 2) { + String var1 = this.field_150493_b.substring(1, this.field_150493_b.length() - 1); + String[] var2 = var1.split(","); + + try { + if (var2.length <= 1) { + return new NBTTagIntArray(new int[] {Integer.parseInt(var1.trim())}); + } else { + int[] var3 = new int[var2.length]; + + for (int var4 = 0; var4 < var2.length; ++var4) { + var3[var4] = Integer.parseInt(var2[var4].trim()); + } + + return new NBTTagIntArray(var3); + } + } catch (NumberFormatException var5) { + return new NBTTagString(this.field_150493_b); + } + } else { + return new NBTTagIntArray(); + } + } else { + if (this.field_150493_b.startsWith("\"") && this.field_150493_b.endsWith("\"") && this.field_150493_b.length() > 2) { + this.field_150493_b = this.field_150493_b.substring(1, this.field_150493_b.length() - 1); + } + + this.field_150493_b = this.field_150493_b.replaceAll("\\\\\"", "\""); + return new NBTTagString(this.field_150493_b); + } + } else { + return new NBTTagByte((byte)(Boolean.parseBoolean(this.field_150493_b) ? 1 : 0)); + } + } catch (NumberFormatException var6) { + this.field_150493_b = this.field_150493_b.replaceAll("\\\\\"", "\""); + return new NBTTagString(this.field_150493_b); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTBase.java new file mode 100644 index 0000000..a594369 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTBase.java @@ -0,0 +1,105 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public abstract class NBTBase { + public static final String[] NBTTypes = new String[] {"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"}; + + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + abstract void write(DataOutput p_74734_1_) throws IOException; + + abstract void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException; + + public abstract String toString(); + + /** + * Gets the type byte for the tag. + */ + public abstract byte getId(); + + protected static NBTBase func_150284_a(byte p_150284_0_) { + switch (p_150284_0_) { + case 0: + return new NBTTagEnd(); + + case 1: + return new NBTTagByte(); + + case 2: + return new NBTTagShort(); + + case 3: + return new NBTTagInt(); + + case 4: + return new NBTTagLong(); + + case 5: + return new NBTTagFloat(); + + case 6: + return new NBTTagDouble(); + + case 7: + return new NBTTagByteArray(); + + case 8: + return new NBTTagString(); + + case 9: + return new NBTTagList(); + + case 10: + return new NBTTagCompound(); + + case 11: + return new NBTTagIntArray(); + + default: + return null; + } + } + + /** + * Creates a clone of the tag. + */ + public abstract NBTBase copy(); + + public boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof NBTBase)) { + return false; + } else { + NBTBase var2 = (NBTBase)p_equals_1_; + return this.getId() == var2.getId(); + } + } + + public int hashCode() { + return this.getId(); + } + + protected String func_150285_a_() { + return this.toString(); + } + + public abstract static class NBTPrimitive extends NBTBase { + + + public abstract long func_150291_c(); + + public abstract int func_150287_d(); + + public abstract short func_150289_e(); + + public abstract byte func_150290_f(); + + public abstract double func_150286_g(); + + public abstract float func_150288_h(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTException.java new file mode 100644 index 0000000..fe08225 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTException.java @@ -0,0 +1,9 @@ +package net.minecraft.nbt; + +public class NBTException extends Exception { + + + public NBTException(String p_i45136_1_) { + super(p_i45136_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTSizeTracker.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTSizeTracker.java new file mode 100644 index 0000000..38191a0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTSizeTracker.java @@ -0,0 +1,23 @@ +package net.minecraft.nbt; + +public class NBTSizeTracker { + public static final NBTSizeTracker field_152451_a = new NBTSizeTracker(0L) { + + public void func_152450_a(long p_152450_1_) {} + }; + private final long field_152452_b; + private long field_152453_c; + + + public NBTSizeTracker(long p_i46342_1_) { + this.field_152452_b = p_i46342_1_; + } + + public void func_152450_a(long p_152450_1_) { + this.field_152453_c += p_152450_1_ / 8L; + + if (this.field_152453_c > this.field_152452_b) { + throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.field_152453_c + "bytes where max allowed: " + this.field_152452_b); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagByte.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagByte.java new file mode 100644 index 0000000..c941181 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagByte.java @@ -0,0 +1,84 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagByte extends NBTBase.NBTPrimitive { + /** The byte value for the tag. */ + private byte data; + + + NBTTagByte() {} + + public NBTTagByte(byte p_i45129_1_) { + this.data = p_i45129_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeByte(this.data); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + p_152446_3_.func_152450_a(8L); + this.data = p_152446_1_.readByte(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)1; + } + + public String toString() { + return "" + this.data + "b"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagByte(this.data); + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagByte var2 = (NBTTagByte)p_equals_1_; + return this.data == var2.data; + } else { + return false; + } + } + + public int hashCode() { + return super.hashCode() ^ this.data; + } + + public long func_150291_c() { + return this.data; + } + + public int func_150287_d() { + return this.data; + } + + public short func_150289_e() { + return this.data; + } + + public byte func_150290_f() { + return this.data; + } + + public double func_150286_g() { + return this.data; + } + + public float func_150288_h() { + return this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagByteArray.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagByteArray.java new file mode 100644 index 0000000..d27c6bf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagByteArray.java @@ -0,0 +1,65 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Arrays; + +public class NBTTagByteArray extends NBTBase { + /** The byte array stored in the tag. */ + private byte[] byteArray; + + + NBTTagByteArray() {} + + public NBTTagByteArray(byte[] p_i45128_1_) { + this.byteArray = p_i45128_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeInt(this.byteArray.length); + p_74734_1_.write(this.byteArray); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + int var4 = p_152446_1_.readInt(); + p_152446_3_.func_152450_a(8 * var4); + this.byteArray = new byte[var4]; + p_152446_1_.readFully(this.byteArray); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)7; + } + + public String toString() { + return "[" + this.byteArray.length + " bytes]"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + byte[] var1 = new byte[this.byteArray.length]; + System.arraycopy(this.byteArray, 0, var1, 0, this.byteArray.length); + return new NBTTagByteArray(var1); + } + + public boolean equals(Object p_equals_1_) { + return super.equals(p_equals_1_) && Arrays.equals(this.byteArray, ((NBTTagByteArray) p_equals_1_).byteArray); + } + + public int hashCode() { + return super.hashCode() ^ Arrays.hashCode(this.byteArray); + } + + public byte[] func_150292_c() { + return this.byteArray; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagCompound.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagCompound.java new file mode 100644 index 0000000..f46c31f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagCompound.java @@ -0,0 +1,410 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NBTTagCompound extends NBTBase { + private static final Logger logger = LogManager.getLogger(); + + /** + * The key-value pairs for the tag. Each key is a UTF string, each value is a tag. + */ + private final Map tagMap = new HashMap(); + + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + Iterator var2 = this.tagMap.keySet().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + NBTBase var4 = (NBTBase)this.tagMap.get(var3); + func_150298_a(var3, var4, p_74734_1_); + } + + p_74734_1_.writeByte(0); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + if (p_152446_2_ > 512) { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } else { + this.tagMap.clear(); + byte var4; + + while ((var4 = func_152447_a(p_152446_1_, p_152446_3_)) != 0) { + String var5 = func_152448_b(p_152446_1_, p_152446_3_); + p_152446_3_.func_152450_a(16 * var5.length()); + NBTBase var6 = func_152449_a(var4, var5, p_152446_1_, p_152446_2_ + 1, p_152446_3_); + this.tagMap.put(var5, var6); + } + } + } + + public Set func_150296_c() { + return this.tagMap.keySet(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)10; + } + + /** + * Stores the given tag into the map with the given string key. This is mostly used to store tag lists. + */ + public void setTag(String p_74782_1_, NBTBase p_74782_2_) { + this.tagMap.put(p_74782_1_, p_74782_2_); + } + + /** + * Stores a new NBTTagByte with the given byte value into the map with the given string key. + */ + public void setByte(String p_74774_1_, byte p_74774_2_) { + this.tagMap.put(p_74774_1_, new NBTTagByte(p_74774_2_)); + } + + /** + * Stores a new NBTTagShort with the given short value into the map with the given string key. + */ + public void setShort(String p_74777_1_, short p_74777_2_) { + this.tagMap.put(p_74777_1_, new NBTTagShort(p_74777_2_)); + } + + /** + * Stores a new NBTTagInt with the given integer value into the map with the given string key. + */ + public void setInteger(String p_74768_1_, int p_74768_2_) { + this.tagMap.put(p_74768_1_, new NBTTagInt(p_74768_2_)); + } + + /** + * Stores a new NBTTagLong with the given long value into the map with the given string key. + */ + public void setLong(String p_74772_1_, long p_74772_2_) { + this.tagMap.put(p_74772_1_, new NBTTagLong(p_74772_2_)); + } + + /** + * Stores a new NBTTagFloat with the given float value into the map with the given string key. + */ + public void setFloat(String p_74776_1_, float p_74776_2_) { + this.tagMap.put(p_74776_1_, new NBTTagFloat(p_74776_2_)); + } + + /** + * Stores a new NBTTagDouble with the given double value into the map with the given string key. + */ + public void setDouble(String p_74780_1_, double p_74780_2_) { + this.tagMap.put(p_74780_1_, new NBTTagDouble(p_74780_2_)); + } + + /** + * Stores a new NBTTagString with the given string value into the map with the given string key. + */ + public void setString(String p_74778_1_, String p_74778_2_) { + this.tagMap.put(p_74778_1_, new NBTTagString(p_74778_2_)); + } + + /** + * Stores a new NBTTagByteArray with the given array as data into the map with the given string key. + */ + public void setByteArray(String p_74773_1_, byte[] p_74773_2_) { + this.tagMap.put(p_74773_1_, new NBTTagByteArray(p_74773_2_)); + } + + /** + * Stores a new NBTTagIntArray with the given array as data into the map with the given string key. + */ + public void setIntArray(String p_74783_1_, int[] p_74783_2_) { + this.tagMap.put(p_74783_1_, new NBTTagIntArray(p_74783_2_)); + } + + /** + * Stores the given boolean value as a NBTTagByte, storing 1 for true and 0 for false, using the given string key. + */ + public void setBoolean(String p_74757_1_, boolean p_74757_2_) { + this.setByte(p_74757_1_, (byte)(p_74757_2_ ? 1 : 0)); + } + + /** + * gets a generic tag with the specified name + */ + public NBTBase getTag(String p_74781_1_) { + return (NBTBase)this.tagMap.get(p_74781_1_); + } + + public byte func_150299_b(String p_150299_1_) { + NBTBase var2 = (NBTBase)this.tagMap.get(p_150299_1_); + return var2 != null ? var2.getId() : 0; + } + + /** + * Returns whether the given string has been previously stored as a key in the map. + */ + public boolean hasKey(String p_74764_1_) { + return this.tagMap.containsKey(p_74764_1_); + } + + public boolean func_150297_b(String p_150297_1_, int p_150297_2_) { + byte var3 = this.func_150299_b(p_150297_1_); + return var3 == p_150297_2_ || (p_150297_2_ == 99 && (var3 == 1 || var3 == 2 || var3 == 3 || var3 == 4 || var3 == 5 || var3 == 6)); + } + + /** + * Retrieves a byte value using the specified key, or 0 if no such key was stored. + */ + public byte getByte(String p_74771_1_) { + try { + return !this.tagMap.containsKey(p_74771_1_) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(p_74771_1_)).func_150290_f(); + } catch (ClassCastException var3) { + return (byte)0; + } + } + + /** + * Retrieves a short value using the specified key, or 0 if no such key was stored. + */ + public short getShort(String p_74765_1_) { + try { + return !this.tagMap.containsKey(p_74765_1_) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(p_74765_1_)).func_150289_e(); + } catch (ClassCastException var3) { + return (short)0; + } + } + + /** + * Retrieves an integer value using the specified key, or 0 if no such key was stored. + */ + public int getInteger(String p_74762_1_) { + try { + return !this.tagMap.containsKey(p_74762_1_) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(p_74762_1_)).func_150287_d(); + } catch (ClassCastException var3) { + return 0; + } + } + + /** + * Retrieves a long value using the specified key, or 0 if no such key was stored. + */ + public long getLong(String p_74763_1_) { + try { + return !this.tagMap.containsKey(p_74763_1_) ? 0L : ((NBTBase.NBTPrimitive)this.tagMap.get(p_74763_1_)).func_150291_c(); + } catch (ClassCastException var3) { + return 0L; + } + } + + /** + * Retrieves a float value using the specified key, or 0 if no such key was stored. + */ + public float getFloat(String p_74760_1_) { + try { + return !this.tagMap.containsKey(p_74760_1_) ? 0.0F : ((NBTBase.NBTPrimitive)this.tagMap.get(p_74760_1_)).func_150288_h(); + } catch (ClassCastException var3) { + return 0.0F; + } + } + + /** + * Retrieves a double value using the specified key, or 0 if no such key was stored. + */ + public double getDouble(String p_74769_1_) { + try { + return !this.tagMap.containsKey(p_74769_1_) ? 0.0D : ((NBTBase.NBTPrimitive)this.tagMap.get(p_74769_1_)).func_150286_g(); + } catch (ClassCastException var3) { + return 0.0D; + } + } + + /** + * Retrieves a string value using the specified key, or an empty string if no such key was stored. + */ + public String getString(String p_74779_1_) { + try { + return !this.tagMap.containsKey(p_74779_1_) ? "" : ((NBTBase)this.tagMap.get(p_74779_1_)).func_150285_a_(); + } catch (ClassCastException var3) { + return ""; + } + } + + /** + * Retrieves a byte array using the specified key, or a zero-length array if no such key was stored. + */ + public byte[] getByteArray(String p_74770_1_) { + try { + return !this.tagMap.containsKey(p_74770_1_) ? new byte[0] : ((NBTTagByteArray)this.tagMap.get(p_74770_1_)).func_150292_c(); + } catch (ClassCastException var3) { + throw new ReportedException(this.createCrashReport(p_74770_1_, 7, var3)); + } + } + + /** + * Retrieves an int array using the specified key, or a zero-length array if no such key was stored. + */ + public int[] getIntArray(String p_74759_1_) { + try { + return !this.tagMap.containsKey(p_74759_1_) ? new int[0] : ((NBTTagIntArray)this.tagMap.get(p_74759_1_)).func_150302_c(); + } catch (ClassCastException var3) { + throw new ReportedException(this.createCrashReport(p_74759_1_, 11, var3)); + } + } + + /** + * Retrieves a NBTTagCompound subtag matching the specified key, or a new empty NBTTagCompound if no such key was + * stored. + */ + public NBTTagCompound getCompoundTag(String p_74775_1_) { + try { + return !this.tagMap.containsKey(p_74775_1_) ? new NBTTagCompound() : (NBTTagCompound)this.tagMap.get(p_74775_1_); + } catch (ClassCastException var3) { + throw new ReportedException(this.createCrashReport(p_74775_1_, 10, var3)); + } + } + + /** + * Gets the NBTTagList object with the given name. Args: name, NBTBase type + */ + public NBTTagList getTagList(String p_150295_1_, int p_150295_2_) { + try { + if (this.func_150299_b(p_150295_1_) != 9) { + return new NBTTagList(); + } else { + NBTTagList var3 = (NBTTagList)this.tagMap.get(p_150295_1_); + return var3.tagCount() > 0 && var3.func_150303_d() != p_150295_2_ ? new NBTTagList() : var3; + } + } catch (ClassCastException var4) { + throw new ReportedException(this.createCrashReport(p_150295_1_, 9, var4)); + } + } + + /** + * Retrieves a boolean value using the specified key, or false if no such key was stored. This uses the getByte + * method. + */ + public boolean getBoolean(String p_74767_1_) { + return this.getByte(p_74767_1_) != 0; + } + + /** + * Remove the specified tag. + */ + public void removeTag(String p_82580_1_) { + this.tagMap.remove(p_82580_1_); + } + + public String toString() { + String var1 = "{"; + String var3; + + for (Iterator var2 = this.tagMap.keySet().iterator(); var2.hasNext(); var1 = var1 + var3 + ':' + this.tagMap.get(var3) + ',') { + var3 = (String)var2.next(); + } + + return var1 + "}"; + } + + /** + * Return whether this compound has no tags. + */ + public boolean hasNoTags() { + return this.tagMap.isEmpty(); + } + + /** + * Create a crash report which indicates a NBT read error. + */ + private CrashReport createCrashReport(final String p_82581_1_, final int p_82581_2_, ClassCastException p_82581_3_) { + CrashReport var4 = CrashReport.makeCrashReport(p_82581_3_, "Reading NBT data"); + CrashReportCategory var5 = var4.makeCategoryDepth("Corrupt NBT tag", 1); + var5.addCrashSectionCallable("Tag type found", new Callable() { + + public String call() { + return NBTBase.NBTTypes[((NBTBase)NBTTagCompound.this.tagMap.get(p_82581_1_)).getId()]; + } + }); + var5.addCrashSectionCallable("Tag type expected", new Callable() { + + public String call() { + return NBTBase.NBTTypes[p_82581_2_]; + } + }); + var5.addCrashSection("Tag name", p_82581_1_); + return var4; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + NBTTagCompound var1 = new NBTTagCompound(); + Iterator var2 = this.tagMap.keySet().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + var1.setTag(var3, ((NBTBase)this.tagMap.get(var3)).copy()); + } + + return var1; + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagCompound var2 = (NBTTagCompound)p_equals_1_; + return this.tagMap.entrySet().equals(var2.tagMap.entrySet()); + } else { + return false; + } + } + + public int hashCode() { + return super.hashCode() ^ this.tagMap.hashCode(); + } + + private static void func_150298_a(String p_150298_0_, NBTBase p_150298_1_, DataOutput p_150298_2_) throws IOException { + p_150298_2_.writeByte(p_150298_1_.getId()); + + if (p_150298_1_.getId() != 0) { + p_150298_2_.writeUTF(p_150298_0_); + p_150298_1_.write(p_150298_2_); + } + } + + private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException { + return p_152447_0_.readByte(); + } + + private static String func_152448_b(DataInput p_152448_0_, NBTSizeTracker p_152448_1_) throws IOException { + return p_152448_0_.readUTF(); + } + + static NBTBase func_152449_a(byte p_152449_0_, String p_152449_1_, DataInput p_152449_2_, int p_152449_3_, NBTSizeTracker p_152449_4_) { + NBTBase var5 = NBTBase.func_150284_a(p_152449_0_); + + try { + var5.func_152446_a(p_152449_2_, p_152449_3_, p_152449_4_); + return var5; + } catch (IOException var9) { + CrashReport var7 = CrashReport.makeCrashReport(var9, "Loading NBT data"); + CrashReportCategory var8 = var7.makeCategory("NBT Tag"); + var8.addCrashSection("Tag name", p_152449_1_); + var8.addCrashSection("Tag type", Byte.valueOf(p_152449_0_)); + throw new ReportedException(var7); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagDouble.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagDouble.java new file mode 100644 index 0000000..625d103 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagDouble.java @@ -0,0 +1,86 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import net.minecraft.util.MathHelper; + +public class NBTTagDouble extends NBTBase.NBTPrimitive { + /** The double value for the tag. */ + private double data; + + + NBTTagDouble() {} + + public NBTTagDouble(double p_i45130_1_) { + this.data = p_i45130_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeDouble(this.data); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + p_152446_3_.func_152450_a(64L); + this.data = p_152446_1_.readDouble(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)6; + } + + public String toString() { + return "" + this.data + "d"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagDouble(this.data); + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagDouble var2 = (NBTTagDouble)p_equals_1_; + return this.data == var2.data; + } else { + return false; + } + } + + public int hashCode() { + long var1 = Double.doubleToLongBits(this.data); + return super.hashCode() ^ (int)(var1 ^ var1 >>> 32); + } + + public long func_150291_c() { + return (long)Math.floor(this.data); + } + + public int func_150287_d() { + return MathHelper.floor_double(this.data); + } + + public short func_150289_e() { + return (short)(MathHelper.floor_double(this.data) & 65535); + } + + public byte func_150290_f() { + return (byte)(MathHelper.floor_double(this.data) & 255); + } + + public double func_150286_g() { + return this.data; + } + + public float func_150288_h() { + return (float)this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagEnd.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagEnd.java new file mode 100644 index 0000000..b4b5a01 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagEnd.java @@ -0,0 +1,34 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagEnd extends NBTBase { + + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException {} + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException {} + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)0; + } + + public String toString() { + return "END"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagEnd(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagFloat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagFloat.java new file mode 100644 index 0000000..5fc5a90 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagFloat.java @@ -0,0 +1,85 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import net.minecraft.util.MathHelper; + +public class NBTTagFloat extends NBTBase.NBTPrimitive { + /** The float value for the tag. */ + private float data; + + + NBTTagFloat() {} + + public NBTTagFloat(float p_i45131_1_) { + this.data = p_i45131_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeFloat(this.data); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + p_152446_3_.func_152450_a(32L); + this.data = p_152446_1_.readFloat(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)5; + } + + public String toString() { + return "" + this.data + "f"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagFloat(this.data); + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagFloat var2 = (NBTTagFloat)p_equals_1_; + return this.data == var2.data; + } else { + return false; + } + } + + public int hashCode() { + return super.hashCode() ^ Float.floatToIntBits(this.data); + } + + public long func_150291_c() { + return (long)this.data; + } + + public int func_150287_d() { + return MathHelper.floor_float(this.data); + } + + public short func_150289_e() { + return (short)(MathHelper.floor_float(this.data) & 65535); + } + + public byte func_150290_f() { + return (byte)(MathHelper.floor_float(this.data) & 255); + } + + public double func_150286_g() { + return this.data; + } + + public float func_150288_h() { + return this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagInt.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagInt.java new file mode 100644 index 0000000..5173607 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagInt.java @@ -0,0 +1,84 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagInt extends NBTBase.NBTPrimitive { + /** The integer value for the tag. */ + private int data; + + + NBTTagInt() {} + + public NBTTagInt(int p_i45133_1_) { + this.data = p_i45133_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeInt(this.data); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + p_152446_3_.func_152450_a(32L); + this.data = p_152446_1_.readInt(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)3; + } + + public String toString() { + return "" + this.data; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagInt(this.data); + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagInt var2 = (NBTTagInt)p_equals_1_; + return this.data == var2.data; + } else { + return false; + } + } + + public int hashCode() { + return super.hashCode() ^ this.data; + } + + public long func_150291_c() { + return this.data; + } + + public int func_150287_d() { + return this.data; + } + + public short func_150289_e() { + return (short)(this.data & 65535); + } + + public byte func_150290_f() { + return (byte)(this.data & 255); + } + + public double func_150286_g() { + return this.data; + } + + public float func_150288_h() { + return (float)this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagIntArray.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagIntArray.java new file mode 100644 index 0000000..24b520c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagIntArray.java @@ -0,0 +1,80 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Arrays; + +public class NBTTagIntArray extends NBTBase { + /** The array of saved integers */ + private int[] intArray; + + + NBTTagIntArray() {} + + public NBTTagIntArray(int[] p_i45132_1_) { + this.intArray = p_i45132_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeInt(this.intArray.length); + + for (int var2 = 0; var2 < this.intArray.length; ++var2) { + p_74734_1_.writeInt(this.intArray[var2]); + } + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + int var4 = p_152446_1_.readInt(); + p_152446_3_.func_152450_a(32 * var4); + this.intArray = new int[var4]; + + for (int var5 = 0; var5 < var4; ++var5) { + this.intArray[var5] = p_152446_1_.readInt(); + } + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)11; + } + + public String toString() { + String var1 = "["; + int[] var2 = this.intArray; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + int var5 = var2[var4]; + var1 = var1 + var5 + ","; + } + + return var1 + "]"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + int[] var1 = new int[this.intArray.length]; + System.arraycopy(this.intArray, 0, var1, 0, this.intArray.length); + return new NBTTagIntArray(var1); + } + + public boolean equals(Object p_equals_1_) { + return super.equals(p_equals_1_) && Arrays.equals(this.intArray, ((NBTTagIntArray) p_equals_1_).intArray); + } + + public int hashCode() { + return super.hashCode() ^ Arrays.hashCode(this.intArray); + } + + public int[] func_150302_c() { + return this.intArray; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagList.java new file mode 100644 index 0000000..1a8127e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagList.java @@ -0,0 +1,205 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class NBTTagList extends NBTBase { + /** The array list containing the tags encapsulated in this list. */ + private List tagList = new ArrayList(); + + /** + * The type byte for the tags in the list - they must all be of the same type. + */ + private byte tagType = 0; + + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + if (!this.tagList.isEmpty()) { + this.tagType = ((NBTBase)this.tagList.get(0)).getId(); + } else { + this.tagType = 0; + } + + p_74734_1_.writeByte(this.tagType); + p_74734_1_.writeInt(this.tagList.size()); + + for (int var2 = 0; var2 < this.tagList.size(); ++var2) { + ((NBTBase)this.tagList.get(var2)).write(p_74734_1_); + } + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + if (p_152446_2_ > 512) { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } else { + p_152446_3_.func_152450_a(8L); + this.tagType = p_152446_1_.readByte(); + int var4 = p_152446_1_.readInt(); + this.tagList = new ArrayList(); + + for (int var5 = 0; var5 < var4; ++var5) { + NBTBase var6 = NBTBase.func_150284_a(this.tagType); + var6.func_152446_a(p_152446_1_, p_152446_2_ + 1, p_152446_3_); + this.tagList.add(var6); + } + } + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)9; + } + + public String toString() { + String var1 = "["; + int var2 = 0; + + for (Iterator var3 = this.tagList.iterator(); var3.hasNext(); ++var2) { + NBTBase var4 = (NBTBase)var3.next(); + var1 = var1 + "" + var2 + ':' + var4 + ','; + } + + return var1 + "]"; + } + + /** + * Adds the provided tag to the end of the list. There is no check to verify this tag is of the same type as any + * previous tag. + */ + public void appendTag(NBTBase p_74742_1_) { + if (this.tagType == 0) { + this.tagType = p_74742_1_.getId(); + } else if (this.tagType != p_74742_1_.getId()) { + System.err.println("WARNING: Adding mismatching tag types to tag list"); + return; + } + + this.tagList.add(p_74742_1_); + } + + public void func_150304_a(int p_150304_1_, NBTBase p_150304_2_) { + if (p_150304_1_ >= 0 && p_150304_1_ < this.tagList.size()) { + if (this.tagType == 0) { + this.tagType = p_150304_2_.getId(); + } else if (this.tagType != p_150304_2_.getId()) { + System.err.println("WARNING: Adding mismatching tag types to tag list"); + return; + } + + this.tagList.set(p_150304_1_, p_150304_2_); + } else { + System.err.println("WARNING: index out of bounds to set tag in tag list"); + } + } + + /** + * Removes a tag at the given index. + */ + public NBTBase removeTag(int p_74744_1_) { + return (NBTBase)this.tagList.remove(p_74744_1_); + } + + /** + * Retrieves the NBTTagCompound at the specified index in the list + */ + public NBTTagCompound getCompoundTagAt(int p_150305_1_) { + if (p_150305_1_ >= 0 && p_150305_1_ < this.tagList.size()) { + NBTBase var2 = (NBTBase)this.tagList.get(p_150305_1_); + return var2.getId() == 10 ? (NBTTagCompound)var2 : new NBTTagCompound(); + } else { + return new NBTTagCompound(); + } + } + + public int[] func_150306_c(int p_150306_1_) { + if (p_150306_1_ >= 0 && p_150306_1_ < this.tagList.size()) { + NBTBase var2 = (NBTBase)this.tagList.get(p_150306_1_); + return var2.getId() == 11 ? ((NBTTagIntArray)var2).func_150302_c() : new int[0]; + } else { + return new int[0]; + } + } + + public double func_150309_d(int p_150309_1_) { + if (p_150309_1_ >= 0 && p_150309_1_ < this.tagList.size()) { + NBTBase var2 = (NBTBase)this.tagList.get(p_150309_1_); + return var2.getId() == 6 ? ((NBTTagDouble)var2).func_150286_g() : 0.0D; + } else { + return 0.0D; + } + } + + public float func_150308_e(int p_150308_1_) { + if (p_150308_1_ >= 0 && p_150308_1_ < this.tagList.size()) { + NBTBase var2 = (NBTBase)this.tagList.get(p_150308_1_); + return var2.getId() == 5 ? ((NBTTagFloat)var2).func_150288_h() : 0.0F; + } else { + return 0.0F; + } + } + + /** + * Retrieves the tag String value at the specified index in the list + */ + public String getStringTagAt(int p_150307_1_) { + if (p_150307_1_ >= 0 && p_150307_1_ < this.tagList.size()) { + NBTBase var2 = (NBTBase)this.tagList.get(p_150307_1_); + return var2.getId() == 8 ? var2.func_150285_a_() : var2.toString(); + } else { + return ""; + } + } + + /** + * Returns the number of tags in the list. + */ + public int tagCount() { + return this.tagList.size(); + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + NBTTagList var1 = new NBTTagList(); + var1.tagType = this.tagType; + Iterator var2 = this.tagList.iterator(); + + while (var2.hasNext()) { + NBTBase var3 = (NBTBase)var2.next(); + NBTBase var4 = var3.copy(); + var1.tagList.add(var4); + } + + return var1; + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagList var2 = (NBTTagList)p_equals_1_; + + if (this.tagType == var2.tagType) { + return this.tagList.equals(var2.tagList); + } + } + + return false; + } + + public int hashCode() { + return super.hashCode() ^ this.tagList.hashCode(); + } + + public int func_150303_d() { + return this.tagType; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagLong.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagLong.java new file mode 100644 index 0000000..7d67fbd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagLong.java @@ -0,0 +1,84 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagLong extends NBTBase.NBTPrimitive { + /** The long value for the tag. */ + private long data; + + + NBTTagLong() {} + + public NBTTagLong(long p_i45134_1_) { + this.data = p_i45134_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeLong(this.data); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + p_152446_3_.func_152450_a(64L); + this.data = p_152446_1_.readLong(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)4; + } + + public String toString() { + return "" + this.data + "L"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagLong(this.data); + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagLong var2 = (NBTTagLong)p_equals_1_; + return this.data == var2.data; + } else { + return false; + } + } + + public int hashCode() { + return super.hashCode() ^ (int)(this.data ^ this.data >>> 32); + } + + public long func_150291_c() { + return this.data; + } + + public int func_150287_d() { + return (int)(this.data & -1L); + } + + public short func_150289_e() { + return (short)((int)(this.data & 65535L)); + } + + public byte func_150290_f() { + return (byte)((int)(this.data & 255L)); + } + + public double func_150286_g() { + return (double)this.data; + } + + public float func_150288_h() { + return (float)this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagShort.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagShort.java new file mode 100644 index 0000000..2d096cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagShort.java @@ -0,0 +1,84 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagShort extends NBTBase.NBTPrimitive { + /** The short value for the tag. */ + private short data; + + + public NBTTagShort() {} + + public NBTTagShort(short p_i45135_1_) { + this.data = p_i45135_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeShort(this.data); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + p_152446_3_.func_152450_a(16L); + this.data = p_152446_1_.readShort(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)2; + } + + public String toString() { + return "" + this.data + "s"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagShort(this.data); + } + + public boolean equals(Object p_equals_1_) { + if (super.equals(p_equals_1_)) { + NBTTagShort var2 = (NBTTagShort)p_equals_1_; + return this.data == var2.data; + } else { + return false; + } + } + + public int hashCode() { + return super.hashCode() ^ this.data; + } + + public long func_150291_c() { + return this.data; + } + + public int func_150287_d() { + return this.data; + } + + public short func_150289_e() { + return this.data; + } + + public byte func_150290_f() { + return (byte)(this.data & 255); + } + + public double func_150286_g() { + return this.data; + } + + public float func_150288_h() { + return this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagString.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagString.java new file mode 100644 index 0000000..90adf24 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTTagString.java @@ -0,0 +1,70 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagString extends NBTBase { + /** The string value for the tag (cannot be empty). */ + private String data; + + + public NBTTagString() { + this.data = ""; + } + + public NBTTagString(String p_i1389_1_) { + this.data = p_i1389_1_; + + if (p_i1389_1_ == null) { + throw new IllegalArgumentException("Empty string not allowed"); + } + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput p_74734_1_) throws IOException { + p_74734_1_.writeUTF(this.data); + } + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException { + this.data = p_152446_1_.readUTF(); + p_152446_3_.func_152450_a(16 * this.data.length()); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() { + return (byte)8; + } + + public String toString() { + return "\"" + this.data + "\""; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() { + return new NBTTagString(this.data); + } + + public boolean equals(Object p_equals_1_) { + if (!super.equals(p_equals_1_)) { + return false; + } else { + NBTTagString var2 = (NBTTagString)p_equals_1_; + return this.data == null && var2.data == null || this.data != null && this.data.equals(var2.data); + } + } + + public int hashCode() { + return super.hashCode() ^ this.data.hashCode(); + } + + public String func_150285_a_() { + return this.data; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTUtil.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTUtil.java new file mode 100644 index 0000000..a48831c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/nbt/NBTUtil.java @@ -0,0 +1,96 @@ +package net.minecraft.nbt; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import java.util.Iterator; +import java.util.UUID; +import net.minecraft.util.StringUtils; + +public final class NBTUtil { + + + public static GameProfile func_152459_a(NBTTagCompound p_152459_0_) { + String var1 = null; + String var2 = null; + + if (p_152459_0_.func_150297_b("Name", 8)) { + var1 = p_152459_0_.getString("Name"); + } + + if (p_152459_0_.func_150297_b("Id", 8)) { + var2 = p_152459_0_.getString("Id"); + } + + if (StringUtils.isNullOrEmpty(var1) && StringUtils.isNullOrEmpty(var2)) { + return null; + } else { + UUID var3; + + try { + var3 = UUID.fromString(var2); + } catch (Throwable var12) { + var3 = null; + } + + GameProfile var4 = new GameProfile(var3, var1); + + if (p_152459_0_.func_150297_b("Properties", 10)) { + NBTTagCompound var5 = p_152459_0_.getCompoundTag("Properties"); + Iterator var6 = var5.func_150296_c().iterator(); + + while (var6.hasNext()) { + String var7 = (String)var6.next(); + NBTTagList var8 = var5.getTagList(var7, 10); + + for (int var9 = 0; var9 < var8.tagCount(); ++var9) { + NBTTagCompound var10 = var8.getCompoundTagAt(var9); + String var11 = var10.getString("Value"); + + if (var10.func_150297_b("Signature", 8)) { + var4.getProperties().put(var7, new Property(var7, var11, var10.getString("Signature"))); + } else { + var4.getProperties().put(var7, new Property(var7, var11)); + } + } + } + } + + return var4; + } + } + + public static void func_152460_a(NBTTagCompound p_152460_0_, GameProfile p_152460_1_) { + if (!StringUtils.isNullOrEmpty(p_152460_1_.getName())) { + p_152460_0_.setString("Name", p_152460_1_.getName()); + } + + if (p_152460_1_.getId() != null) { + p_152460_0_.setString("Id", p_152460_1_.getId().toString()); + } + + if (!p_152460_1_.getProperties().isEmpty()) { + NBTTagCompound var2 = new NBTTagCompound(); + Iterator var3 = p_152460_1_.getProperties().keySet().iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + NBTTagList var5 = new NBTTagList(); + NBTTagCompound var8; + + for (Iterator var6 = p_152460_1_.getProperties().get(var4).iterator(); var6.hasNext(); var5.appendTag(var8)) { + Property var7 = (Property)var6.next(); + var8 = new NBTTagCompound(); + var8.setString("Value", var7.getValue()); + + if (var7.hasSignature()) { + var8.setString("Signature", var7.getSignature()); + } + } + + var2.setTag(var4, var5); + } + + p_152460_0_.setTag("Properties", var2); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/EnumConnectionState.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/EnumConnectionState.java new file mode 100644 index 0000000..1a79bc7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/EnumConnectionState.java @@ -0,0 +1,321 @@ +package net.minecraft.network; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import gnu.trove.map.TIntObjectMap; +import gnu.trove.map.hash.TIntObjectHashMap; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import org.apache.logging.log4j.LogManager; + +public enum EnumConnectionState { + HANDSHAKING("HANDSHAKING", 0, -1, null) { + { + this.func_150751_a(0, C00Handshake.class); + } + }, + PLAY("PLAY", 1, 0, null) { + { + this.func_150756_b(0, S00PacketKeepAlive.class); + this.func_150756_b(1, S01PacketJoinGame.class); + this.func_150756_b(2, S02PacketChat.class); + this.func_150756_b(3, S03PacketTimeUpdate.class); + this.func_150756_b(4, S04PacketEntityEquipment.class); + this.func_150756_b(5, S05PacketSpawnPosition.class); + this.func_150756_b(6, S06PacketUpdateHealth.class); + this.func_150756_b(7, S07PacketRespawn.class); + this.func_150756_b(8, S08PacketPlayerPosLook.class); + this.func_150756_b(9, S09PacketHeldItemChange.class); + this.func_150756_b(10, S0APacketUseBed.class); + this.func_150756_b(11, S0BPacketAnimation.class); + this.func_150756_b(12, S0CPacketSpawnPlayer.class); + this.func_150756_b(13, S0DPacketCollectItem.class); + this.func_150756_b(14, S0EPacketSpawnObject.class); + this.func_150756_b(15, S0FPacketSpawnMob.class); + this.func_150756_b(16, S10PacketSpawnPainting.class); + this.func_150756_b(17, S11PacketSpawnExperienceOrb.class); + this.func_150756_b(18, S12PacketEntityVelocity.class); + this.func_150756_b(19, S13PacketDestroyEntities.class); + this.func_150756_b(20, S14PacketEntity.class); + this.func_150756_b(21, S14PacketEntity.S15PacketEntityRelMove.class); + this.func_150756_b(22, S14PacketEntity.S16PacketEntityLook.class); + this.func_150756_b(23, S14PacketEntity.S17PacketEntityLookMove.class); + this.func_150756_b(24, S18PacketEntityTeleport.class); + this.func_150756_b(25, S19PacketEntityHeadLook.class); + this.func_150756_b(26, S19PacketEntityStatus.class); + this.func_150756_b(27, S1BPacketEntityAttach.class); + this.func_150756_b(28, S1CPacketEntityMetadata.class); + this.func_150756_b(29, S1DPacketEntityEffect.class); + this.func_150756_b(30, S1EPacketRemoveEntityEffect.class); + this.func_150756_b(31, S1FPacketSetExperience.class); + this.func_150756_b(32, S20PacketEntityProperties.class); + this.func_150756_b(33, S21PacketChunkData.class); + this.func_150756_b(34, S22PacketMultiBlockChange.class); + this.func_150756_b(35, S23PacketBlockChange.class); + this.func_150756_b(36, S24PacketBlockAction.class); + this.func_150756_b(37, S25PacketBlockBreakAnim.class); + this.func_150756_b(38, S26PacketMapChunkBulk.class); + this.func_150756_b(39, S27PacketExplosion.class); + this.func_150756_b(40, S28PacketEffect.class); + this.func_150756_b(41, S29PacketSoundEffect.class); + this.func_150756_b(42, S2APacketParticles.class); + this.func_150756_b(43, S2BPacketChangeGameState.class); + this.func_150756_b(44, S2CPacketSpawnGlobalEntity.class); + this.func_150756_b(45, S2DPacketOpenWindow.class); + this.func_150756_b(46, S2EPacketCloseWindow.class); + this.func_150756_b(47, S2FPacketSetSlot.class); + this.func_150756_b(48, S30PacketWindowItems.class); + this.func_150756_b(49, S31PacketWindowProperty.class); + this.func_150756_b(50, S32PacketConfirmTransaction.class); + this.func_150756_b(51, S33PacketUpdateSign.class); + this.func_150756_b(52, S34PacketMaps.class); + this.func_150756_b(53, S35PacketUpdateTileEntity.class); + this.func_150756_b(54, S36PacketSignEditorOpen.class); + this.func_150756_b(55, S37PacketStatistics.class); + this.func_150756_b(56, S38PacketPlayerListItem.class); + this.func_150756_b(57, S39PacketPlayerAbilities.class); + this.func_150756_b(58, S3APacketTabComplete.class); + this.func_150756_b(59, S3BPacketScoreboardObjective.class); + this.func_150756_b(60, S3CPacketUpdateScore.class); + this.func_150756_b(61, S3DPacketDisplayScoreboard.class); + this.func_150756_b(62, S3EPacketTeams.class); + this.func_150756_b(63, S3FPacketCustomPayload.class); + this.func_150756_b(64, S40PacketDisconnect.class); + this.func_150751_a(0, C00PacketKeepAlive.class); + this.func_150751_a(1, C01PacketChatMessage.class); + this.func_150751_a(2, C02PacketUseEntity.class); + this.func_150751_a(3, C03PacketPlayer.class); + this.func_150751_a(4, C03PacketPlayer.C04PacketPlayerPosition.class); + this.func_150751_a(5, C03PacketPlayer.C05PacketPlayerLook.class); + this.func_150751_a(6, C03PacketPlayer.C06PacketPlayerPosLook.class); + this.func_150751_a(7, C07PacketPlayerDigging.class); + this.func_150751_a(8, C08PacketPlayerBlockPlacement.class); + this.func_150751_a(9, C09PacketHeldItemChange.class); + this.func_150751_a(10, C0APacketAnimation.class); + this.func_150751_a(11, C0BPacketEntityAction.class); + this.func_150751_a(12, C0CPacketInput.class); + this.func_150751_a(13, C0DPacketCloseWindow.class); + this.func_150751_a(14, C0EPacketClickWindow.class); + this.func_150751_a(15, C0FPacketConfirmTransaction.class); + this.func_150751_a(16, C10PacketCreativeInventoryAction.class); + this.func_150751_a(17, C11PacketEnchantItem.class); + this.func_150751_a(18, C12PacketUpdateSign.class); + this.func_150751_a(19, C13PacketPlayerAbilities.class); + this.func_150751_a(20, C14PacketTabComplete.class); + this.func_150751_a(21, C15PacketClientSettings.class); + this.func_150751_a(22, C16PacketClientStatus.class); + this.func_150751_a(23, C17PacketCustomPayload.class); + } + }, + STATUS("STATUS", 2, 1, null) { + { + this.func_150751_a(0, C00PacketServerQuery.class); + this.func_150756_b(0, S00PacketServerInfo.class); + this.func_150751_a(1, C01PacketPing.class); + this.func_150756_b(1, S01PacketPong.class); + } + }, + LOGIN("LOGIN", 3, 2, null) { + { + this.func_150756_b(0, S00PacketDisconnect.class); + this.func_150756_b(1, S01PacketEncryptionRequest.class); + this.func_150756_b(2, S02PacketLoginSuccess.class); + this.func_150751_a(0, C00PacketLoginStart.class); + this.func_150751_a(1, C01PacketEncryptionResponse.class); + } + }; + private static final TIntObjectMap field_150764_e = new TIntObjectHashMap(); + private static final Map field_150761_f = Maps.newHashMap(); + private final int field_150762_g; + private final BiMap field_150769_h; + private final BiMap field_150770_i; + + + EnumConnectionState(int p_i45152_3_) { + this.field_150769_h = HashBiMap.create(); + this.field_150770_i = HashBiMap.create(); + this.field_150762_g = p_i45152_3_; + } + + protected EnumConnectionState func_150751_a(int p_150751_1_, Class p_150751_2_) { + String var3; + + if (this.field_150769_h.containsKey(Integer.valueOf(p_150751_1_))) { + var3 = "Serverbound packet ID " + p_150751_1_ + " is already assigned to " + this.field_150769_h.get(Integer.valueOf(p_150751_1_)) + "; cannot re-assign to " + p_150751_2_; + LogManager.getLogger().fatal(var3); + throw new IllegalArgumentException(var3); + } else if (this.field_150769_h.containsValue(p_150751_2_)) { + var3 = "Serverbound packet " + p_150751_2_ + " is already assigned to ID " + this.field_150769_h.inverse().get(p_150751_2_) + "; cannot re-assign to " + p_150751_1_; + LogManager.getLogger().fatal(var3); + throw new IllegalArgumentException(var3); + } else { + this.field_150769_h.put(Integer.valueOf(p_150751_1_), p_150751_2_); + return this; + } + } + + protected EnumConnectionState func_150756_b(int p_150756_1_, Class p_150756_2_) { + String var3; + + if (this.field_150770_i.containsKey(Integer.valueOf(p_150756_1_))) { + var3 = "Clientbound packet ID " + p_150756_1_ + " is already assigned to " + this.field_150770_i.get(Integer.valueOf(p_150756_1_)) + "; cannot re-assign to " + p_150756_2_; + LogManager.getLogger().fatal(var3); + throw new IllegalArgumentException(var3); + } else if (this.field_150770_i.containsValue(p_150756_2_)) { + var3 = "Clientbound packet " + p_150756_2_ + " is already assigned to ID " + this.field_150770_i.inverse().get(p_150756_2_) + "; cannot re-assign to " + p_150756_1_; + LogManager.getLogger().fatal(var3); + throw new IllegalArgumentException(var3); + } else { + this.field_150770_i.put(Integer.valueOf(p_150756_1_), p_150756_2_); + return this; + } + } + + public BiMap func_150753_a() { + return this.field_150769_h; + } + + public BiMap func_150755_b() { + return this.field_150770_i; + } + + public BiMap func_150757_a(boolean p_150757_1_) { + return p_150757_1_ ? this.func_150755_b() : this.func_150753_a(); + } + + public BiMap func_150754_b(boolean p_150754_1_) { + return p_150754_1_ ? this.func_150753_a() : this.func_150755_b(); + } + + public int func_150759_c() { + return this.field_150762_g; + } + + public static EnumConnectionState func_150760_a(int p_150760_0_) { + return (EnumConnectionState)field_150764_e.get(p_150760_0_); + } + + public static EnumConnectionState func_150752_a(Packet p_150752_0_) { + return (EnumConnectionState)field_150761_f.get(p_150752_0_.getClass()); + } + + EnumConnectionState(String ignore1, int ignore2, int p_i1197_3_, Object p_i1197_4_) { + this(p_i1197_3_); + } + + static { + EnumConnectionState[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + EnumConnectionState var3 = var0[var2]; + field_150764_e.put(var3.func_150759_c(), var3); + Iterator var4 = Iterables.concat(var3.func_150755_b().values(), var3.func_150753_a().values()).iterator(); + + while (var4.hasNext()) { + Class var5 = (Class)var4.next(); + + if (field_150761_f.containsKey(var5) && field_150761_f.get(var5) != var3) { + throw new Error("Packet " + var5 + " is already assigned to protocol " + field_150761_f.get(var5) + " - can't reassign to " + var3); + } + + field_150761_f.put(var5, var3); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/INetHandler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/INetHandler.java new file mode 100644 index 0000000..4672db9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/INetHandler.java @@ -0,0 +1,22 @@ +package net.minecraft.network; + +import net.minecraft.util.IChatComponent; + +public interface INetHandler { + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + void onDisconnect(IChatComponent p_147231_1_); + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_); + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + void onNetworkTick(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetHandlerPlayServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetHandlerPlayServer.java new file mode 100644 index 0000000..38cc8bf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetHandlerPlayServer.java @@ -0,0 +1,1122 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import io.netty.buffer.Unpooled; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.material.Material; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemEditableBook; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemWritableBook; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.UserListBansEntry; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldServer; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetHandlerPlayServer implements INetHandlerPlayServer { + private static final Logger logger = LogManager.getLogger(); + public final NetworkManager netManager; + private final MinecraftServer serverController; + public EntityPlayerMP playerEntity; + private int networkTickCount; + + /** + * Used to keep track of how the player is floating while gamerules should prevent that. Surpassing 80 ticks means + * kick + */ + private int floatingTickCount; + private boolean field_147366_g; + private int field_147378_h; + private long field_147379_i; + private static final Random field_147376_j = new Random(); + private long field_147377_k; + + /** + * Incremented by 20 each time a user sends a chat message, decreased by one every tick. Non-ops kicked when over + * 200 + */ + private int chatSpamThresholdCount; + private int field_147375_m; + private final IntHashMap field_147372_n = new IntHashMap(); + private double lastPosX; + private double lastPosY; + private double lastPosZ; + private boolean hasMoved = true; + + + public NetHandlerPlayServer(MinecraftServer p_i1530_1_, NetworkManager p_i1530_2_, EntityPlayerMP p_i1530_3_) { + this.serverController = p_i1530_1_; + this.netManager = p_i1530_2_; + p_i1530_2_.setNetHandler(this); + this.playerEntity = p_i1530_3_; + p_i1530_3_.playerNetServerHandler = this; + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() { + this.field_147366_g = false; + ++this.networkTickCount; + this.serverController.theProfiler.startSection("keepAlive"); + + if ((long)this.networkTickCount - this.field_147377_k > 40L) { + this.field_147377_k = this.networkTickCount; + this.field_147379_i = this.func_147363_d(); + this.field_147378_h = (int)this.field_147379_i; + this.sendPacket(new S00PacketKeepAlive(this.field_147378_h)); + } + + if (this.chatSpamThresholdCount > 0) { + --this.chatSpamThresholdCount; + } + + if (this.field_147375_m > 0) { + --this.field_147375_m; + } + + if (this.playerEntity.func_154331_x() > 0L && this.serverController.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.playerEntity.func_154331_x() > (long)(this.serverController.func_143007_ar() * 1000 * 60)) { + this.kickPlayerFromServer("You have been idle for too long!"); + } + } + + public NetworkManager func_147362_b() { + return this.netManager; + } + + /** + * Kick a player from the server with a reason + */ + public void kickPlayerFromServer(String p_147360_1_) { + final ChatComponentText var2 = new ChatComponentText(p_147360_1_); + this.netManager.scheduleOutboundPacket(new S40PacketDisconnect(var2), new GenericFutureListener() { + + public void operationComplete(Future p_operationComplete_1_) { + NetHandlerPlayServer.this.netManager.closeChannel(var2); + } + }); + this.netManager.disableAutoRead(); + } + + /** + * Processes player movement input. Includes walking, strafing, jumping, sneaking; excludes riding and toggling + * flying/sprinting + */ + public void processInput(C0CPacketInput p_147358_1_) { + this.playerEntity.setEntityActionState(p_147358_1_.func_149620_c(), p_147358_1_.func_149616_d(), p_147358_1_.func_149618_e(), p_147358_1_.func_149617_f()); + } + + /** + * Processes clients perspective on player positioning and/or orientation + */ + public void processPlayer(C03PacketPlayer p_147347_1_) { + WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension); + this.field_147366_g = true; + + if (!this.playerEntity.playerConqueredTheEnd) { + double var3; + + if (!this.hasMoved) { + var3 = p_147347_1_.func_149467_d() - this.lastPosY; + + if (p_147347_1_.func_149464_c() == this.lastPosX && var3 * var3 < 0.01D && p_147347_1_.func_149472_e() == this.lastPosZ) { + this.hasMoved = true; + } + } + + if (this.hasMoved) { + double var5; + double var7; + double var9; + + if (this.playerEntity.ridingEntity != null) { + float var34 = this.playerEntity.rotationYaw; + float var4 = this.playerEntity.rotationPitch; + this.playerEntity.ridingEntity.updateRiderPosition(); + var5 = this.playerEntity.posX; + var7 = this.playerEntity.posY; + var9 = this.playerEntity.posZ; + + if (p_147347_1_.func_149463_k()) { + var34 = p_147347_1_.func_149462_g(); + var4 = p_147347_1_.func_149470_h(); + } + + this.playerEntity.onGround = p_147347_1_.func_149465_i(); + this.playerEntity.onUpdateEntity(); + this.playerEntity.ySize = 0.0F; + this.playerEntity.setPositionAndRotation(var5, var7, var9, var34, var4); + + if (this.playerEntity.ridingEntity != null) { + this.playerEntity.ridingEntity.updateRiderPosition(); + } + + this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + + if (this.hasMoved) { + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + } + + var2.updateEntity(this.playerEntity); + return; + } + + if (this.playerEntity.isPlayerSleeping()) { + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + var2.updateEntity(this.playerEntity); + return; + } + + var3 = this.playerEntity.posY; + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + var5 = this.playerEntity.posX; + var7 = this.playerEntity.posY; + var9 = this.playerEntity.posZ; + float var11 = this.playerEntity.rotationYaw; + float var12 = this.playerEntity.rotationPitch; + + if (p_147347_1_.func_149466_j() && p_147347_1_.func_149467_d() == -999.0D && p_147347_1_.func_149471_f() == -999.0D) { + p_147347_1_.func_149469_a(false); + } + + double var13; + + if (p_147347_1_.func_149466_j()) { + var5 = p_147347_1_.func_149464_c(); + var7 = p_147347_1_.func_149467_d(); + var9 = p_147347_1_.func_149472_e(); + var13 = p_147347_1_.func_149471_f() - p_147347_1_.func_149467_d(); + + if (!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D)) { + this.kickPlayerFromServer("Illegal stance"); + logger.warn(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13); + return; + } + + if (Math.abs(p_147347_1_.func_149464_c()) > 3.2E7D || Math.abs(p_147347_1_.func_149472_e()) > 3.2E7D) { + this.kickPlayerFromServer("Illegal position"); + return; + } + } + + if (p_147347_1_.func_149463_k()) { + var11 = p_147347_1_.func_149462_g(); + var12 = p_147347_1_.func_149470_h(); + } + + this.playerEntity.onUpdateEntity(); + this.playerEntity.ySize = 0.0F; + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, var11, var12); + + if (!this.hasMoved) { + return; + } + + var13 = var5 - this.playerEntity.posX; + double var15 = var7 - this.playerEntity.posY; + double var17 = var9 - this.playerEntity.posZ; + double var19 = Math.min(Math.abs(var13), Math.abs(this.playerEntity.motionX)); + double var21 = Math.min(Math.abs(var15), Math.abs(this.playerEntity.motionY)); + double var23 = Math.min(Math.abs(var17), Math.abs(this.playerEntity.motionZ)); + double var25 = var19 * var19 + var21 * var21 + var23 * var23; + + if (var25 > 100.0D && (!this.serverController.isSinglePlayer() || !this.serverController.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) { + logger.warn(this.playerEntity.getCommandSenderName() + " moved too quickly! " + var13 + "," + var15 + "," + var17 + " (" + var19 + ", " + var21 + ", " + var23 + ")"); + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + return; + } + + float var27 = 0.0625F; + boolean var28 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract(var27, var27, var27)).isEmpty(); + + if (this.playerEntity.onGround && !p_147347_1_.func_149465_i() && var15 > 0.0D) { + this.playerEntity.jump(); + } + + this.playerEntity.moveEntity(var13, var15, var17); + this.playerEntity.onGround = p_147347_1_.func_149465_i(); + this.playerEntity.addMovementStat(var13, var15, var17); + double var29 = var15; + var13 = var5 - this.playerEntity.posX; + var15 = var7 - this.playerEntity.posY; + + if (var15 > -0.5D || var15 < 0.5D) { + var15 = 0.0D; + } + + var17 = var9 - this.playerEntity.posZ; + var25 = var13 * var13 + var15 * var15 + var17 * var17; + boolean var31 = false; + + if (var25 > 0.0625D && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.theItemInWorldManager.isCreative()) { + var31 = true; + logger.warn(this.playerEntity.getCommandSenderName() + " moved wrongly!"); + } + + this.playerEntity.setPositionAndRotation(var5, var7, var9, var11, var12); + boolean var32 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract(var27, var27, var27)).isEmpty(); + + if (var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping()) { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, var11, var12); + return; + } + + AxisAlignedBB var33 = this.playerEntity.boundingBox.copy().expand(var27, var27, var27).addCoord(0.0D, -0.55D, 0.0D); + + if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33)) { + if (var29 >= -0.03125D) { + ++this.floatingTickCount; + + if (this.floatingTickCount > 80) { + logger.warn(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); + this.kickPlayerFromServer("Flying is not enabled on this server"); + return; + } + } + } else { + this.floatingTickCount = 0; + } + + this.playerEntity.onGround = p_147347_1_.func_149465_i(); + this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + this.playerEntity.handleFalling(this.playerEntity.posY - var3, p_147347_1_.func_149465_i()); + } else if (this.networkTickCount % 20 == 0) { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + } + } + } + + public void setPlayerLocation(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_) { + this.hasMoved = false; + this.lastPosX = p_147364_1_; + this.lastPosY = p_147364_3_; + this.lastPosZ = p_147364_5_; + this.playerEntity.setPositionAndRotation(p_147364_1_, p_147364_3_, p_147364_5_, p_147364_7_, p_147364_8_); + this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(p_147364_1_, p_147364_3_ + 1.6200000047683716D, p_147364_5_, p_147364_7_, p_147364_8_, false)); + } + + /** + * Processes the player initiating/stopping digging on a particular spot, as well as a player dropping items?. (0: + * initiated, 1: reinitiated, 2? , 3-4 drop item (respectively without or with player control), 5: stopped; x,y,z, + * side clicked on;) + */ + public void processPlayerDigging(C07PacketPlayerDigging p_147345_1_) { + WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension); + this.playerEntity.func_143004_u(); + + if (p_147345_1_.func_149506_g() == 4) { + this.playerEntity.dropOneItem(false); + } else if (p_147345_1_.func_149506_g() == 3) { + this.playerEntity.dropOneItem(true); + } else if (p_147345_1_.func_149506_g() == 5) { + this.playerEntity.stopUsingItem(); + } else { + boolean var3 = p_147345_1_.func_149506_g() == 0; + + if (p_147345_1_.func_149506_g() == 1) { + var3 = true; + } + + if (p_147345_1_.func_149506_g() == 2) { + var3 = true; + } + + int var4 = p_147345_1_.func_149505_c(); + int var5 = p_147345_1_.func_149503_d(); + int var6 = p_147345_1_.func_149502_e(); + + if (var3) { + double var7 = this.playerEntity.posX - ((double)var4 + 0.5D); + double var9 = this.playerEntity.posY - ((double)var5 + 0.5D) + 1.5D; + double var11 = this.playerEntity.posZ - ((double)var6 + 0.5D); + double var13 = var7 * var7 + var9 * var9 + var11 * var11; + + if (var13 > 36.0D) { + return; + } + + if (var5 >= this.serverController.getBuildLimit()) { + return; + } + } + + if (p_147345_1_.func_149506_g() == 0) { + if (!this.serverController.isBlockProtected(var2, var4, var5, var6, this.playerEntity)) { + this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, p_147345_1_.func_149501_f()); + } else { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(var4, var5, var6, var2)); + } + } else if (p_147345_1_.func_149506_g() == 2) { + this.playerEntity.theItemInWorldManager.uncheckedTryHarvestBlock(var4, var5, var6); + + if (var2.getBlock(var4, var5, var6).getMaterial() != Material.air) { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(var4, var5, var6, var2)); + } + } else if (p_147345_1_.func_149506_g() == 1) { + this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(var4, var5, var6); + + if (var2.getBlock(var4, var5, var6).getMaterial() != Material.air) { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(var4, var5, var6, var2)); + } + } + } + } + + /** + * Processes block placement and block activation (anvil, furnace, etc.) + */ + public void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement p_147346_1_) { + WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension); + ItemStack var3 = this.playerEntity.inventory.getCurrentItem(); + boolean var4 = false; + int var5 = p_147346_1_.func_149576_c(); + int var6 = p_147346_1_.func_149571_d(); + int var7 = p_147346_1_.func_149570_e(); + int var8 = p_147346_1_.func_149568_f(); + this.playerEntity.func_143004_u(); + + if (p_147346_1_.func_149568_f() == 255) { + if (var3 == null) { + return; + } + + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3); + } else if (p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit())) { + ChatComponentTranslation var9 = new ChatComponentTranslation("build.tooHigh", Integer.valueOf(this.serverController.getBuildLimit())); + var9.getChatStyle().setColor(EnumChatFormatting.RED); + this.playerEntity.playerNetServerHandler.sendPacket(new S02PacketChat(var9)); + var4 = true; + } else { + if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.serverController.isBlockProtected(var2, var5, var6, var7, this.playerEntity)) { + this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); + } + + var4 = true; + } + + if (var4) { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(var5, var6, var7, var2)); + + if (var8 == 0) { + --var6; + } + + if (var8 == 1) { + ++var6; + } + + if (var8 == 2) { + --var7; + } + + if (var8 == 3) { + ++var7; + } + + if (var8 == 4) { + --var5; + } + + if (var8 == 5) { + ++var5; + } + + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(var5, var6, var7, var2)); + } + + var3 = this.playerEntity.inventory.getCurrentItem(); + + if (var3 != null && var3.stackSize == 0) { + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = null; + var3 = null; + } + + if (var3 == null || var3.getMaxItemUseDuration() == 0) { + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot var10 = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.isChangingQuantityOnly = false; + + if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), p_147346_1_.func_149574_g())) { + this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, var10.slotNumber, this.playerEntity.inventory.getCurrentItem())); + } + } + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent p_147231_1_) { + logger.info(this.playerEntity.getCommandSenderName() + " lost connection: " + p_147231_1_); + this.serverController.func_147132_au(); + ChatComponentTranslation var2 = new ChatComponentTranslation("multiplayer.player.left", this.playerEntity.func_145748_c_()); + var2.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.serverController.getConfigurationManager().func_148539_a(var2); + this.playerEntity.mountEntityAndWakeUp(); + this.serverController.getConfigurationManager().playerLoggedOut(this.playerEntity); + + if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner())) { + logger.info("Stopping singleplayer server as player logged out"); + this.serverController.initiateShutdown(); + } + } + + public void sendPacket(final Packet p_147359_1_) { + if (p_147359_1_ instanceof S02PacketChat) { + S02PacketChat var2 = (S02PacketChat)p_147359_1_; + EntityPlayer.EnumChatVisibility var3 = this.playerEntity.func_147096_v(); + + if (var3 == EntityPlayer.EnumChatVisibility.HIDDEN) { + return; + } + + if (var3 == EntityPlayer.EnumChatVisibility.SYSTEM && !var2.func_148916_d()) { + return; + } + } + + try { + this.netManager.scheduleOutboundPacket(p_147359_1_); + } catch (Throwable var5) { + CrashReport var6 = CrashReport.makeCrashReport(var5, "Sending packet"); + CrashReportCategory var4 = var6.makeCategory("Packet being sent"); + var4.addCrashSectionCallable("Packet class", new Callable() { + + public String call() { + return p_147359_1_.getClass().getCanonicalName(); + } + }); + throw new ReportedException(var6); + } + } + + /** + * Updates which quickbar slot is selected + */ + public void processHeldItemChange(C09PacketHeldItemChange p_147355_1_) { + if (p_147355_1_.func_149614_c() >= 0 && p_147355_1_.func_149614_c() < InventoryPlayer.getHotbarSize()) { + this.playerEntity.inventory.currentItem = p_147355_1_.func_149614_c(); + this.playerEntity.func_143004_u(); + } else { + logger.warn(this.playerEntity.getCommandSenderName() + " tried to set an invalid carried item"); + } + } + + /** + * Process chat messages (broadcast back to clients) and commands (executes) + */ + public void processChatMessage(C01PacketChatMessage p_147354_1_) { + if (this.playerEntity.func_147096_v() == EntityPlayer.EnumChatVisibility.HIDDEN) { + ChatComponentTranslation var4 = new ChatComponentTranslation("chat.cannotSend"); + var4.getChatStyle().setColor(EnumChatFormatting.RED); + this.sendPacket(new S02PacketChat(var4)); + } else { + this.playerEntity.func_143004_u(); + String var2 = p_147354_1_.func_149439_c(); + var2 = StringUtils.normalizeSpace(var2); + + for (int var3 = 0; var3 < var2.length(); ++var3) { + if (!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3))) { + this.kickPlayerFromServer("Illegal characters in chat"); + return; + } + } + + if (var2.startsWith("/")) { + this.handleSlashCommand(var2); + } else { + ChatComponentTranslation var5 = new ChatComponentTranslation("chat.type.text", this.playerEntity.func_145748_c_(), var2); + this.serverController.getConfigurationManager().func_148544_a(var5, false); + } + + this.chatSpamThresholdCount += 20; + + if (this.chatSpamThresholdCount > 200 && !this.serverController.getConfigurationManager().func_152596_g(this.playerEntity.getGameProfile())) { + this.kickPlayerFromServer("disconnect.spam"); + } + } + } + + /** + * Handle commands that start with a / + */ + private void handleSlashCommand(String p_147361_1_) { + this.serverController.getCommandManager().executeCommand(this.playerEntity, p_147361_1_); + } + + /** + * Processes the player swinging its held item + */ + public void processAnimation(C0APacketAnimation p_147350_1_) { + this.playerEntity.func_143004_u(); + + if (p_147350_1_.func_149421_d() == 1) { + this.playerEntity.swingItem(); + } + } + + /** + * Processes a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump + * height of the horse the player is riding + */ + public void processEntityAction(C0BPacketEntityAction p_147357_1_) { + this.playerEntity.func_143004_u(); + + if (p_147357_1_.func_149513_d() == 1) { + this.playerEntity.setSneaking(true); + } else if (p_147357_1_.func_149513_d() == 2) { + this.playerEntity.setSneaking(false); + } else if (p_147357_1_.func_149513_d() == 4) { + this.playerEntity.setSprinting(true); + } else if (p_147357_1_.func_149513_d() == 5) { + this.playerEntity.setSprinting(false); + } else if (p_147357_1_.func_149513_d() == 3) { + this.playerEntity.wakeUpPlayer(false, true, true); + this.hasMoved = false; + } else if (p_147357_1_.func_149513_d() == 6) { + if (this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { + ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(p_147357_1_.func_149512_e()); + } + } else if (p_147357_1_.func_149513_d() == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { + ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity); + } + } + + /** + * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently + * equipped item + */ + public void processUseEntity(C02PacketUseEntity p_147340_1_) { + WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension); + Entity var3 = p_147340_1_.func_149564_a(var2); + this.playerEntity.func_143004_u(); + + if (var3 != null) { + boolean var4 = this.playerEntity.canEntityBeSeen(var3); + double var5 = 36.0D; + + if (!var4) { + var5 = 9.0D; + } + + if (this.playerEntity.getDistanceSqToEntity(var3) < var5) { + if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.INTERACT) { + this.playerEntity.interactWith(var3); + } else if (p_147340_1_.func_149565_c() == C02PacketUseEntity.Action.ATTACK) { + if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity) { + this.kickPlayerFromServer("Attempting to attack an invalid entity"); + this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); + return; + } + + this.playerEntity.attackTargetEntityWithCurrentItem(var3); + } + } + } + } + + /** + * Processes the com.cheatbreaker.client status updates: respawn attempt from player, opening statistics or achievements, or + * acquiring 'open inventory' achievement + */ + public void processClientStatus(C16PacketClientStatus p_147342_1_) { + this.playerEntity.func_143004_u(); + C16PacketClientStatus.EnumState var2 = p_147342_1_.func_149435_c(); + + switch (NetHandlerPlayServer.SwitchEnumState.field_151290_a[var2.ordinal()]) { + case 1: + if (this.playerEntity.playerConqueredTheEnd) { + this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, 0, true); + } else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) { + if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner())) { + this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it's game over!"); + this.serverController.deleteWorldAndStopServer(); + } else { + UserListBansEntry var3 = new UserListBansEntry(this.playerEntity.getGameProfile(), null, "(You just lost the game)", null, "Death in Hardcore"); + this.serverController.getConfigurationManager().func_152608_h().func_152687_a(var3); + this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it's game over!"); + } + } else { + if (this.playerEntity.getHealth() > 0.0F) { + return; + } + + this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false); + } + + break; + + case 2: + this.playerEntity.func_147099_x().func_150876_a(this.playerEntity); + break; + + case 3: + this.playerEntity.triggerAchievement(AchievementList.openInventory); + } + } + + /** + * Processes the com.cheatbreaker.client closing windows (container) + */ + public void processCloseWindow(C0DPacketCloseWindow p_147356_1_) { + this.playerEntity.closeContainer(); + } + + /** + * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they + * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has + * the same open container/inventory + */ + public void processClickWindow(C0EPacketClickWindow p_147351_1_) { + this.playerEntity.func_143004_u(); + + if (this.playerEntity.openContainer.windowId == p_147351_1_.func_149548_c() && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { + ItemStack var2 = this.playerEntity.openContainer.slotClick(p_147351_1_.func_149544_d(), p_147351_1_.func_149543_e(), p_147351_1_.func_149542_h(), this.playerEntity); + + if (ItemStack.areItemStacksEqual(p_147351_1_.func_149546_g(), var2)) { + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true)); + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.updateHeldItem(); + this.playerEntity.isChangingQuantityOnly = false; + } else { + this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(p_147351_1_.func_149547_f())); + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), false)); + this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false); + ArrayList var3 = new ArrayList(); + + for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4) { + var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack()); + } + + this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, var3); + } + } + } + + /** + * Enchants the item identified by the packet given some convoluted conditions (matching window, which + * should/shouldn't be in use?) + */ + public void processEnchantItem(C11PacketEnchantItem p_147338_1_) { + this.playerEntity.func_143004_u(); + + if (this.playerEntity.openContainer.windowId == p_147338_1_.func_149539_c() && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { + this.playerEntity.openContainer.enchantItem(this.playerEntity, p_147338_1_.func_149537_d()); + this.playerEntity.openContainer.detectAndSendChanges(); + } + } + + /** + * Update the server with an ItemStack in a slot. + */ + public void processCreativeInventoryAction(C10PacketCreativeInventoryAction p_147344_1_) { + if (this.playerEntity.theItemInWorldManager.isCreative()) { + boolean var2 = p_147344_1_.func_149627_c() < 0; + ItemStack var3 = p_147344_1_.func_149625_d(); + boolean var4 = p_147344_1_.func_149627_c() >= 1 && p_147344_1_.func_149627_c() < 36 + InventoryPlayer.getHotbarSize(); + boolean var5 = var3 == null || var3.getItem() != null; + boolean var6 = var3 == null || var3.getItemDamage() >= 0 && var3.stackSize <= 64 && var3.stackSize > 0; + + if (var4 && var5 && var6) { + if (var3 == null) { + this.playerEntity.inventoryContainer.putStackInSlot(p_147344_1_.func_149627_c(), null); + } else { + this.playerEntity.inventoryContainer.putStackInSlot(p_147344_1_.func_149627_c(), var3); + } + + this.playerEntity.inventoryContainer.setPlayerIsPresent(this.playerEntity, true); + } else if (var2 && var5 && var6 && this.field_147375_m < 200) { + this.field_147375_m += 20; + EntityItem var7 = this.playerEntity.dropPlayerItemWithRandomChoice(var3, true); + + if (var7 != null) { + var7.setAgeToCreativeDespawnTime(); + } + } + } + } + + /** + * Received in response to the server requesting to confirm that the com.cheatbreaker.client-side open container matches the servers' + * after a mismatched container-slot manipulation. It will unlock the player's ability to manipulate the container + * contents + */ + public void processConfirmTransaction(C0FPacketConfirmTransaction p_147339_1_) { + Short var2 = (Short)this.field_147372_n.lookup(this.playerEntity.openContainer.windowId); + + if (var2 != null && p_147339_1_.func_149533_d() == var2.shortValue() && this.playerEntity.openContainer.windowId == p_147339_1_.func_149532_c() && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { + this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true); + } + } + + public void processUpdateSign(C12PacketUpdateSign p_147343_1_) { + this.playerEntity.func_143004_u(); + WorldServer var2 = this.serverController.worldServerForDimension(this.playerEntity.dimension); + + if (var2.blockExists(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e())) { + TileEntity var3 = var2.getTileEntity(p_147343_1_.func_149588_c(), p_147343_1_.func_149586_d(), p_147343_1_.func_149585_e()); + + if (var3 instanceof TileEntitySign) { + TileEntitySign var4 = (TileEntitySign)var3; + + if (!var4.func_145914_a() || var4.func_145911_b() != this.playerEntity) { + this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign"); + return; + } + } + + int var6; + int var8; + + for (var8 = 0; var8 < 4; ++var8) { + boolean var5 = true; + + if (p_147343_1_.func_149589_f()[var8].length() > 15) { + var5 = false; + } else { + for (var6 = 0; var6 < p_147343_1_.func_149589_f()[var8].length(); ++var6) { + if (!ChatAllowedCharacters.isAllowedCharacter(p_147343_1_.func_149589_f()[var8].charAt(var6))) { + var5 = false; + } + } + } + + if (!var5) { + p_147343_1_.func_149589_f()[var8] = "!?"; + } + } + + if (var3 instanceof TileEntitySign) { + var8 = p_147343_1_.func_149588_c(); + int var9 = p_147343_1_.func_149586_d(); + var6 = p_147343_1_.func_149585_e(); + TileEntitySign var7 = (TileEntitySign)var3; + System.arraycopy(p_147343_1_.func_149589_f(), 0, var7.field_145915_a, 0, 4); + var7.onInventoryChanged(); + var2.func_147471_g(var8, var9, var6); + } + } + } + + /** + * Updates a players' ping statistics + */ + public void processKeepAlive(C00PacketKeepAlive p_147353_1_) { + if (p_147353_1_.func_149460_c() == this.field_147378_h) { + int var2 = (int)(this.func_147363_d() - this.field_147379_i); + this.playerEntity.ping = (this.playerEntity.ping * 3 + var2) / 4; + } + } + + private long func_147363_d() { + return System.nanoTime() / 1000000L; + } + + /** + * Processes a player starting/stopping flying + */ + public void processPlayerAbilities(C13PacketPlayerAbilities p_147348_1_) { + this.playerEntity.capabilities.isFlying = p_147348_1_.func_149488_d() && this.playerEntity.capabilities.allowFlying; + } + + /** + * Retrieves possible tab completions for the requested command string and sends them to the com.cheatbreaker.client + */ + public void processTabComplete(C14PacketTabComplete p_147341_1_) { + ArrayList var2 = Lists.newArrayList(); + Iterator var3 = this.serverController.getPossibleCompletions(this.playerEntity, p_147341_1_.func_149419_c()).iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + var2.add(var4); + } + + this.playerEntity.playerNetServerHandler.sendPacket(new S3APacketTabComplete((String[])var2.toArray(new String[var2.size()]))); + } + + /** + * Updates serverside copy of com.cheatbreaker.client settings: language, render distance, chat visibility, chat colours, difficulty, + * and whether to show the cape + */ + public void processClientSettings(C15PacketClientSettings p_147352_1_) { + this.playerEntity.func_147100_a(p_147352_1_); + } + + /** + * Synchronizes serverside and clientside book contents and signing + */ + public void processVanilla250Packet(C17PacketCustomPayload p_147349_1_) { + PacketBuffer var2; + ItemStack var3; + ItemStack var4; + + if ("MC|BEdit".equals(p_147349_1_.func_149559_c())) { + var2 = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e())); + + try { + var3 = var2.readItemStackFromBuffer(); + + if (var3 != null) { + if (!ItemWritableBook.func_150930_a(var3.getTagCompound())) { + throw new IOException("Invalid book tag!"); + } + + var4 = this.playerEntity.inventory.getCurrentItem(); + + if (var4 == null) { + return; + } + + if (var3.getItem() == Items.writable_book && var3.getItem() == var4.getItem()) { + var4.setTagInfo("pages", var3.getTagCompound().getTagList("pages", 8)); + } + + return; + } + } catch (Exception var38) { + logger.error("Couldn't handle book info", var38); + return; + } finally { + var2.release(); + } + + return; + } else if ("MC|BSign".equals(p_147349_1_.func_149559_c())) { + var2 = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e())); + + try { + var3 = var2.readItemStackFromBuffer(); + + if (var3 == null) { + return; + } + + if (!ItemEditableBook.validBookTagContents(var3.getTagCompound())) { + throw new IOException("Invalid book tag!"); + } + + var4 = this.playerEntity.inventory.getCurrentItem(); + + if (var4 != null) { + if (var3.getItem() == Items.written_book && var4.getItem() == Items.writable_book) { + var4.setTagInfo("author", new NBTTagString(this.playerEntity.getCommandSenderName())); + var4.setTagInfo("title", new NBTTagString(var3.getTagCompound().getString("title"))); + var4.setTagInfo("pages", var3.getTagCompound().getTagList("pages", 8)); + var4.func_150996_a(Items.written_book); + } + + return; + } + } catch (Exception var36) { + logger.error("Couldn't sign book", var36); + return; + } finally { + var2.release(); + } + + return; + } else { + DataInputStream var40; + int var42; + + if ("MC|TrSel".equals(p_147349_1_.func_149559_c())) { + try { + var40 = new DataInputStream(new ByteArrayInputStream(p_147349_1_.func_149558_e())); + var42 = var40.readInt(); + Container var45 = this.playerEntity.openContainer; + + if (var45 instanceof ContainerMerchant) { + ((ContainerMerchant)var45).setCurrentRecipeIndex(var42); + } + } catch (Exception var35) { + logger.error("Couldn't select trade", var35); + } + } else if ("MC|AdvCdm".equals(p_147349_1_.func_149559_c())) { + if (!this.serverController.isCommandBlockEnabled()) { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notEnabled")); + } else if (this.playerEntity.canCommandSenderUseCommand(2, "") && this.playerEntity.capabilities.isCreativeMode) { + var2 = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e())); + + try { + byte var43 = var2.readByte(); + CommandBlockLogic var46 = null; + + if (var43 == 0) { + TileEntity var5 = this.playerEntity.worldObj.getTileEntity(var2.readInt(), var2.readInt(), var2.readInt()); + + if (var5 instanceof TileEntityCommandBlock) { + var46 = ((TileEntityCommandBlock)var5).func_145993_a(); + } + } else if (var43 == 1) { + Entity var48 = this.playerEntity.worldObj.getEntityByID(var2.readInt()); + + if (var48 instanceof EntityMinecartCommandBlock) { + var46 = ((EntityMinecartCommandBlock)var48).func_145822_e(); + } + } + + String var49 = var2.readStringFromBuffer(var2.readableBytes()); + + if (var46 != null) { + var46.func_145752_a(var49); + var46.func_145756_e(); + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.setCommand.success", var49)); + } + } catch (Exception var33) { + logger.error("Couldn't set command block", var33); + } + finally { + var2.release(); + } + } else { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notAllowed")); + } + } else if ("MC|Beacon".equals(p_147349_1_.func_149559_c())) { + if (this.playerEntity.openContainer instanceof ContainerBeacon) { + try { + var40 = new DataInputStream(new ByteArrayInputStream(p_147349_1_.func_149558_e())); + var42 = var40.readInt(); + int var47 = var40.readInt(); + ContainerBeacon var50 = (ContainerBeacon)this.playerEntity.openContainer; + Slot var6 = var50.getSlot(0); + + if (var6.getHasStack()) { + var6.decrStackSize(1); + TileEntityBeacon var7 = var50.func_148327_e(); + var7.func_146001_d(var42); + var7.func_146004_e(var47); + var7.onInventoryChanged(); + } + } catch (Exception var32) { + logger.error("Couldn't set beacon", var32); + } + } + } else if ("MC|ItemName".equals(p_147349_1_.func_149559_c()) && this.playerEntity.openContainer instanceof ContainerRepair) { + ContainerRepair var41 = (ContainerRepair)this.playerEntity.openContainer; + + if (p_147349_1_.func_149558_e() != null && p_147349_1_.func_149558_e().length >= 1) { + String var44 = ChatAllowedCharacters.filerAllowedCharacters(new String(p_147349_1_.func_149558_e(), Charsets.UTF_8)); + + if (var44.length() <= 30) { + var41.updateItemName(var44); + } + } else { + var41.updateItemName(""); + } + } + } + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + if (p_147232_2_ != EnumConnectionState.PLAY) { + throw new IllegalStateException("Unexpected change in protocol!"); + } + } + + static final class SwitchEnumState { + static final int[] field_151290_a = new int[C16PacketClientStatus.EnumState.values().length]; + + + static { + try { + field_151290_a[C16PacketClientStatus.EnumState.PERFORM_RESPAWN.ordinal()] = 1; + } catch (NoSuchFieldError var3) { + } + + try { + field_151290_a[C16PacketClientStatus.EnumState.REQUEST_STATS.ordinal()] = 2; + } catch (NoSuchFieldError var2) { + } + + try { + field_151290_a[C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT.ordinal()] = 3; + } catch (NoSuchFieldError var1) { + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptingDecoder.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptingDecoder.java new file mode 100644 index 0000000..fa9331b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptingDecoder.java @@ -0,0 +1,25 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToMessageDecoder; +import java.util.List; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptingDecoder extends MessageToMessageDecoder { + private final NettyEncryptionTranslator field_150509_a; + + + public NettyEncryptingDecoder(Cipher p_i45141_1_) { + this.field_150509_a = new NettyEncryptionTranslator(p_i45141_1_); + } + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws ShortBufferException { + p_decode_3_.add(this.field_150509_a.func_150503_a(p_decode_1_, p_decode_2_)); + } + + protected void decode(ChannelHandlerContext p_decode_1_, Object p_decode_2_, List p_decode_3_) throws ShortBufferException { + this.decode(p_decode_1_, (ByteBuf)p_decode_2_, p_decode_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptingEncoder.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptingEncoder.java new file mode 100644 index 0000000..872b18f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptingEncoder.java @@ -0,0 +1,24 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptingEncoder extends MessageToByteEncoder { + private final NettyEncryptionTranslator field_150750_a; + + + public NettyEncryptingEncoder(Cipher p_i45142_1_) { + this.field_150750_a = new NettyEncryptionTranslator(p_i45142_1_); + } + + protected void encode(ChannelHandlerContext p_encode_1_, ByteBuf p_encode_2_, ByteBuf p_encode_3_) throws ShortBufferException { + this.field_150750_a.func_150504_a(p_encode_2_, p_encode_3_); + } + + protected void encode(ChannelHandlerContext p_encode_1_, Object p_encode_2_, ByteBuf p_encode_3_) throws ShortBufferException { + this.encode(p_encode_1_, (ByteBuf)p_encode_2_, p_encode_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptionTranslator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptionTranslator.java new file mode 100644 index 0000000..aac59d7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NettyEncryptionTranslator.java @@ -0,0 +1,48 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptionTranslator { + private final Cipher field_150507_a; + private byte[] field_150505_b = new byte[0]; + private byte[] field_150506_c = new byte[0]; + + + protected NettyEncryptionTranslator(Cipher p_i45140_1_) { + this.field_150507_a = p_i45140_1_; + } + + private byte[] func_150502_a(ByteBuf p_150502_1_) { + int var2 = p_150502_1_.readableBytes(); + + if (this.field_150505_b.length < var2) { + this.field_150505_b = new byte[var2]; + } + + p_150502_1_.readBytes(this.field_150505_b, 0, var2); + return this.field_150505_b; + } + + protected ByteBuf func_150503_a(ChannelHandlerContext p_150503_1_, ByteBuf p_150503_2_) throws ShortBufferException { + int var3 = p_150503_2_.readableBytes(); + byte[] var4 = this.func_150502_a(p_150503_2_); + ByteBuf var5 = p_150503_1_.alloc().heapBuffer(this.field_150507_a.getOutputSize(var3)); + var5.writerIndex(this.field_150507_a.update(var4, 0, var3, var5.array(), var5.arrayOffset())); + return var5; + } + + protected void func_150504_a(ByteBuf p_150504_1_, ByteBuf p_150504_2_) throws ShortBufferException { + int var3 = p_150504_1_.readableBytes(); + byte[] var4 = this.func_150502_a(p_150504_1_); + int var5 = this.field_150507_a.getOutputSize(var3); + + if (this.field_150506_c.length < var5) { + this.field_150506_c = new byte[var5]; + } + + p_150504_2_.writeBytes(this.field_150506_c, 0, this.field_150507_a.update(var4, 0, var3, this.field_150506_c)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkManager.java new file mode 100644 index 0000000..2282ad4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkManager.java @@ -0,0 +1,410 @@ +package net.minecraft.network; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.network.messages.Message; +import com.cheatbreaker.client.network.netty.CBChannelInboundHandlerAdap; +import com.cheatbreaker.client.network.netty.CBPingInboundHandler; +import com.cheatbreaker.client.network.plugin.CBOutboundChannel; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Queues; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.*; +import io.netty.channel.local.LocalChannel; +import io.netty.channel.local.LocalServerChannel; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.handler.timeout.TimeoutException; +import io.netty.util.AttributeKey; +import io.netty.util.concurrent.GenericFutureListener; +import io.netty.util.concurrent.ScheduledFuture; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.util.*; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +import javax.crypto.SecretKey; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.InetAddress; +import java.net.SocketAddress; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +public class NetworkManager extends SimpleChannelInboundHandler { + public static final Marker logMarkerNetwork = MarkerManager.getMarker("NETWORK"); + public static final Marker logMarkerPackets = MarkerManager.getMarker("NETWORK_PACKETS", logMarkerNetwork); + public static final Marker field_152461_c = MarkerManager.getMarker("NETWORK_STAT", logMarkerNetwork); + public static final AttributeKey attrKeyConnectionState = new AttributeKey("protocol"); + public static final AttributeKey attrKeyReceivable = new AttributeKey("receivable_packets"); + public static final AttributeKey attrKeySendable = new AttributeKey("sendable_packets"); + public static final NioEventLoopGroup eventLoops = new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Client IO #%d").setDaemon(true).build()); + public static final NetworkStatistics field_152462_h = new NetworkStatistics(); + private static final Logger logger = LogManager.getLogger(); + /** + * Whether this NetworkManager deals with the com.cheatbreaker.client or server side of the connection + */ + private final boolean isClientSide; + + /** + * The queue for received, unprioritized packets that will be processed at the earliest opportunity + */ + private final Queue receivedPacketsQueue = Queues.newConcurrentLinkedQueue(); + + /** + * The queue for packets that require transmission + */ + private final Queue outboundPacketsQueue = Queues.newConcurrentLinkedQueue(); + + /** + * The active channel + */ + private Channel channel; + + /** + * The address of the remote party + */ + private SocketAddress socketAddress; + + /** + * The INetHandler instance responsible for processing received packets + */ + private INetHandler netHandler; + + /** + * The current connection state, being one of: HANDSHAKING, PLAY, STATUS, LOGIN + */ + private EnumConnectionState connectionState; + + /** + * A String indicating why the network has shutdown. + */ + private IChatComponent terminationReason; + private boolean field_152463_r; + + private ScheduledFuture scheduledFuture; + private CBOutboundChannel cbOutboundChannel; + public Set lIIIIllIIlIlIllIIIlIllIlI = ImmutableSet.of("7471b8e8-27c2-4354-a7d2-bd6a82dc00a0", "f11c7e0b-85e6-4b4b-afbf-e6cda9f531e5", "6c430f5f-2742-4b73-8850-b19bc561902a", "1d8fdd3d-4099-4eda-a06c-66ebca67970a", "401202a3-0102-4ed8-979a-e5d4832c8a9b", "ef1d2c32-a234-4fd8-b116-299221c1ec92"); + + + public NetworkManager(boolean p_i45147_1_) { + this.isClientSide = p_i45147_1_; + } + + /** + * Prepares a clientside NetworkManager: establishes a connection to the address and port supplied and configures + * the channel pipeline. Returns the newly created instance. + */ + public static NetworkManager provideLanClient(InetAddress p_150726_0_, int p_150726_1_) { + final NetworkManager var2 = new NetworkManager(true); + (new Bootstrap()).group(eventLoops).handler(new ChannelInitializer() { + + protected void initChannel(Channel p_initChannel_1_) { + try { + p_initChannel_1_.config().setOption(ChannelOption.IP_TOS, 24); + } catch (ChannelException var4) { + } + + try { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, true); + } catch (ChannelException var3) { + } + + p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(20)).addLast("splitter", new MessageDeserializer2()).addLast("decoder", new MessageDeserializer(NetworkManager.field_152462_h)).addLast("prepender", new MessageSerializer2()).addLast("encoder", new MessageSerializer(NetworkManager.field_152462_h)).addLast("packet_handler", var2); + } + }).channel(NioSocketChannel.class).connect(p_150726_0_, p_150726_1_).syncUninterruptibly(); + return var2; + } + + /** + * Prepares a clientside NetworkManager: establishes a connection to the socket supplied and configures the channel + * pipeline. Returns the newly created instance. + */ + public static NetworkManager provideLocalClient(SocketAddress p_150722_0_) { + final NetworkManager var1 = new NetworkManager(true); + (new Bootstrap()).group(eventLoops).handler(new ChannelInitializer() { + + protected void initChannel(Channel p_initChannel_1_) { + p_initChannel_1_.pipeline().addLast("packet_handler", var1); + } + }).channel(LocalChannel.class).connect(p_150722_0_).syncUninterruptibly(); + return var1; + } + + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception { + super.channelActive(p_channelActive_1_); + this.channel = p_channelActive_1_.channel(); + this.socketAddress = this.channel.remoteAddress(); + this.setConnectionState(EnumConnectionState.HANDSHAKING); + } + + /** + * Sets the new connection state and registers which packets this channel may send and receive + */ + public void setConnectionState(EnumConnectionState p_150723_1_) { + this.connectionState = (EnumConnectionState) this.channel.attr(attrKeyConnectionState).getAndSet(p_150723_1_); + this.channel.attr(attrKeyReceivable).set(p_150723_1_.func_150757_a(this.isClientSide)); + this.channel.attr(attrKeySendable).set(p_150723_1_.func_150754_b(this.isClientSide)); + this.channel.config().setAutoRead(true); + logger.debug("Enabled auto read"); + } + + public void channelInactive(ChannelHandlerContext p_channelInactive_1_) { + this.closeChannel(new ChatComponentTranslation("disconnect.endOfStream")); + } + + public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) { + ChatComponentTranslation var3; + + if (p_exceptionCaught_2_ instanceof TimeoutException) { + var3 = new ChatComponentTranslation("disconnect.timeout"); + } else { + var3 = new ChatComponentTranslation("disconnect.genericReason", "Internal Exception: " + p_exceptionCaught_2_); + } + + this.closeChannel(var3); + } + + protected void channelRead0(ChannelHandlerContext context, Packet packet) { + if (this.channel.isOpen()) { + block8: { + try { + if (!(packet instanceof S01PacketJoinGame) || Minecraft.getMinecraft().isIntegratedServerRunning() || !Minecraft.getMinecraft().currentServerData.isCheatBreakerServer()) break block8; + try { + byte[] var3 = Message.b; + if (var3 != null && var3.length > 0) { + this.channel.writeAndFlush(new C17PacketCustomPayload(CheatBreaker.getInstance().getPluginBinaryChannel(), var3)); + } + } catch (UnsatisfiedLinkError var3) {} + } catch (Exception var5) { + var5.printStackTrace(); + } + } + if (packet.hasPriority()) { + packet.processPacket(this.netHandler); + } else { + this.receivedPacketsQueue.add(packet); + } + } + } + + /** + * Will flush the outbound queue and dispatch the supplied Packet if the channel is ready, otherwise it adds the + * packet to the outbound queue and registers the GenericFutureListener to fire after transmission + */ + public void scheduleOutboundPacket(Packet p_150725_1_, GenericFutureListener... p_150725_2_) { + if (this.channel != null && this.channel.isOpen()) { + this.flushOutboundQueue(); + this.dispatchPacket(p_150725_1_, p_150725_2_); + } else { + this.outboundPacketsQueue.add(new NetworkManager.InboundHandlerTuplePacketListener(p_150725_1_, p_150725_2_)); + } + } + + /** + * Will commit the packet to the channel. If the current thread 'owns' the channel it will write and flush the + * packet, otherwise it will add a task for the channel eventloop thread to do that. + */ + private void dispatchPacket(final Packet p_150732_1_, final GenericFutureListener[] p_150732_2_) { + final EnumConnectionState var3 = EnumConnectionState.func_150752_a(p_150732_1_); + final EnumConnectionState var4 = (EnumConnectionState) this.channel.attr(attrKeyConnectionState).get(); + + if (var4 != var3) { + logger.debug("Disabled auto read"); + this.channel.config().setAutoRead(false); + } + + if (this.channel.eventLoop().inEventLoop()) { + if (var3 != var4) { + this.setConnectionState(var3); + } + + this.channel.writeAndFlush(p_150732_1_).addListeners(p_150732_2_).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } else { + this.channel.eventLoop().execute(new Runnable() { + + public void run() { + if (var3 != var4) { + NetworkManager.this.setConnectionState(var3); + } + + NetworkManager.this.channel.writeAndFlush(p_150732_1_).addListeners(p_150732_2_).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + }); + } + } + + /** + * Will iterate through the outboundPacketQueue and dispatch all Packets + */ + private void flushOutboundQueue() { + if (this.channel != null && this.channel.isOpen()) { + while (!this.outboundPacketsQueue.isEmpty()) { + NetworkManager.InboundHandlerTuplePacketListener var1 = (NetworkManager.InboundHandlerTuplePacketListener) this.outboundPacketsQueue.poll(); + this.dispatchPacket(var1.field_150774_a, var1.field_150773_b); + } + } + } + + /** + * Checks timeouts and processes all packets received + */ + public void processReceivedPackets() { + this.flushOutboundQueue(); + EnumConnectionState var1 = (EnumConnectionState) this.channel.attr(attrKeyConnectionState).get(); + + if (this.connectionState != var1) { + if (this.connectionState != null) { + this.netHandler.onConnectionStateTransition(this.connectionState, var1); + } + + this.connectionState = var1; + } + + if (this.netHandler != null) { + for (int var2 = 1000; !this.receivedPacketsQueue.isEmpty() && var2 >= 0; --var2) { + Packet var3 = (Packet) this.receivedPacketsQueue.poll(); + var3.processPacket(this.netHandler); + } + + this.netHandler.onNetworkTick(); + } + + this.channel.flush(); + } + + /** + * Return the InetSocketAddress of the remote endpoint + */ + public SocketAddress getSocketAddress() { + return this.socketAddress; + } + + /** + * Closes the channel, the parameter can be used for an exit message (not certain how it gets sent) + */ + public void closeChannel(IChatComponent p_150718_1_) { + if (this.channel.isOpen()) { + this.channel.close(); + this.terminationReason = p_150718_1_; + } + } + + /** + * True if this NetworkManager uses a memory connection (single player game). False may imply both an active TCP + * connection or simply no active connection at all + */ + public boolean isLocalChannel() { + return this.channel instanceof LocalChannel || this.channel instanceof LocalServerChannel; + } + + /** + * Adds an encoder+decoder to the channel pipeline. The parameter is the secret key used for encrypted communication + */ + public void enableEncryption(SecretKey secretKey) { + this.channel.pipeline().addBefore("splitter", "decrypt", new NettyEncryptingDecoder(CryptManager.func_151229_a(2, secretKey))); + this.channel.pipeline().addBefore("prepender", "encrypt", new NettyEncryptingEncoder(CryptManager.func_151229_a(1, secretKey))); + if (Minecraft.getMinecraft().currentServerData.isCheatBreakerServer()) { + String uuid = Minecraft.getMinecraft().getSession().getPlayerID(); + if (!this.lIIIIllIIlIlIllIIIlIllIlI.contains(uuid)) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-512"); + digest.update(secretKey.getEncoded()); + digest.update(EntityRenderer.class.getName().getBytes()); + digest.update(S12PacketEntityVelocity.class.getName().getBytes()); + digest.update(uuid.getBytes()); + digest.update(Minecraft.getMinecraft().currentServerData.serverIP.getBytes()); + this.channel.writeAndFlush(new C17PacketCustomPayload("CB|INIT", digest.digest())); + System.out.println("Sent CB|INIT"); + } catch (NoSuchAlgorithmException digest) { + + } + } + this.cbOutboundChannel = new CBOutboundChannel(secretKey); + this.channel.pipeline().addBefore("encoder", "cb-checksum-out", this.cbOutboundChannel); + CBChannelInboundHandlerAdap checksumInput = new CBChannelInboundHandlerAdap(secretKey); + this.channel.pipeline().addAfter("splitter", "cb-checksum-in", checksumInput); + this.channel.pipeline().addAfter("decoder", "cb-checksum-verify", new CBPingInboundHandler(checksumInput)); + this.scheduledFuture = this.channel.eventLoop().scheduleAtFixedRate(() -> { + ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream(); + DataOutputStream outputStream = new DataOutputStream(arrayOutputStream); + try { + outputStream.writeInt((int)this.cbOutboundChannel.lIIIIlIIllIIlIIlIIIlIIllI()); + } catch (IOException iOException) { + + } + this.channel.writeAndFlush(new C17PacketCustomPayload("CB|PING", arrayOutputStream.toByteArray())); + }, 1L, 5L, TimeUnit.SECONDS); + } + this.field_152463_r = true; + } + + /** + * Returns true if this NetworkManager has an active channel, false otherwise + */ + public boolean isChannelOpen() { + return this.channel != null && this.channel.isOpen(); + } + + /** + * Gets the current handler for processing packets + */ + public INetHandler getNetHandler() { + return this.netHandler; + } + + /** + * Sets the NetHandler for this NetworkManager, no checks are made if this handler is suitable for the particular + * connection state (protocol) + */ + public void setNetHandler(INetHandler p_150719_1_) { + Validate.notNull(p_150719_1_, "packetListener"); + logger.debug("Set listener of {} to {}", this, p_150719_1_); + this.netHandler = p_150719_1_; + } + + /** + * If this channel is closed, returns the exit message, null otherwise. + */ + public IChatComponent getExitMessage() { + return this.terminationReason; + } + + /** + * Switches the channel to manual reading modus + */ + public void disableAutoRead() { + this.channel.config().setAutoRead(false); + } + + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Object p_channelRead0_2_) { + this.channelRead0(p_channelRead0_1_, (Packet) p_channelRead0_2_); + } + + public Channel getChannel() { + return this.channel; + } + + static class InboundHandlerTuplePacketListener { + private final Packet field_150774_a; + private final GenericFutureListener[] field_150773_b; + + + public InboundHandlerTuplePacketListener(Packet p_i45146_1_, GenericFutureListener... p_i45146_2_) { + this.field_150774_a = p_i45146_1_; + this.field_150773_b = p_i45146_2_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkStatistics.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkStatistics.java new file mode 100644 index 0000000..908d9dc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkStatistics.java @@ -0,0 +1,199 @@ +package net.minecraft.network; + +import java.util.concurrent.atomic.AtomicReference; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class NetworkStatistics { + private static final Logger field_152478_a = LogManager.getLogger(); + private static final Marker field_152479_b = MarkerManager.getMarker("NETSTAT_MARKER", NetworkManager.field_152461_c); + private final NetworkStatistics.Tracker field_152480_c = new NetworkStatistics.Tracker(); + private final NetworkStatistics.Tracker field_152481_d = new NetworkStatistics.Tracker(); + + + public void func_152469_a(int p_152469_1_, long p_152469_2_) { + this.field_152480_c.func_152488_a(p_152469_1_, p_152469_2_); + } + + public void func_152464_b(int p_152464_1_, long p_152464_2_) { + this.field_152481_d.func_152488_a(p_152464_1_, p_152464_2_); + } + + public long func_152465_a() { + return this.field_152480_c.func_152485_a(); + } + + public long func_152471_b() { + return this.field_152481_d.func_152485_a(); + } + + public long func_152472_c() { + return this.field_152480_c.func_152489_b(); + } + + public long func_152473_d() { + return this.field_152481_d.func_152489_b(); + } + + public NetworkStatistics.PacketStat func_152477_e() { + return this.field_152480_c.func_152484_c(); + } + + public NetworkStatistics.PacketStat func_152467_f() { + return this.field_152480_c.func_152486_d(); + } + + public NetworkStatistics.PacketStat func_152475_g() { + return this.field_152481_d.func_152484_c(); + } + + public NetworkStatistics.PacketStat func_152470_h() { + return this.field_152481_d.func_152486_d(); + } + + public NetworkStatistics.PacketStat func_152466_a(int p_152466_1_) { + return this.field_152480_c.func_152487_a(p_152466_1_); + } + + public NetworkStatistics.PacketStat func_152468_b(int p_152468_1_) { + return this.field_152481_d.func_152487_a(p_152468_1_); + } + + public static class PacketStat { + private final int field_152482_a; + private final NetworkStatistics.PacketStatData field_152483_b; + + + public PacketStat(int p_i1188_1_, NetworkStatistics.PacketStatData p_i1188_2_) { + this.field_152482_a = p_i1188_1_; + this.field_152483_b = p_i1188_2_; + } + + public String toString() { + return "PacketStat(" + this.field_152482_a + ")" + this.field_152483_b; + } + } + + static class PacketStatData { + private final long field_152496_a; + private final int field_152497_b; + private final double field_152498_c; + + + private PacketStatData(long p_i46399_1_, int p_i46399_3_, double p_i46399_4_) { + this.field_152496_a = p_i46399_1_; + this.field_152497_b = p_i46399_3_; + this.field_152498_c = p_i46399_4_; + } + + public NetworkStatistics.PacketStatData func_152494_a(long p_152494_1_) { + return new NetworkStatistics.PacketStatData(p_152494_1_ + this.field_152496_a, this.field_152497_b + 1, (double)((p_152494_1_ + this.field_152496_a) / (long)(this.field_152497_b + 1))); + } + + public long func_152493_a() { + return this.field_152496_a; + } + + public int func_152495_b() { + return this.field_152497_b; + } + + public String toString() { + return "{totalBytes=" + this.field_152496_a + ", count=" + this.field_152497_b + ", averageBytes=" + this.field_152498_c + '}'; + } + + PacketStatData(long p_i1185_1_, int p_i1185_3_, double p_i1185_4_, Object p_i1185_6_) { + this(p_i1185_1_, p_i1185_3_, p_i1185_4_); + } + } + + static class Tracker { + private final AtomicReference[] field_152490_a = new AtomicReference[100]; + + + public Tracker() { + for (int var1 = 0; var1 < 100; ++var1) { + this.field_152490_a[var1] = new AtomicReference(new NetworkStatistics.PacketStatData(0L, 0, 0.0D, null)); + } + } + + public void func_152488_a(int p_152488_1_, long p_152488_2_) { + try { + if (p_152488_1_ < 0 || p_152488_1_ >= 100) { + return; + } + + NetworkStatistics.PacketStatData var4; + NetworkStatistics.PacketStatData var5; + + do { + var4 = (NetworkStatistics.PacketStatData)this.field_152490_a[p_152488_1_].get(); + var5 = var4.func_152494_a(p_152488_2_); + } + while (!this.field_152490_a[p_152488_1_].compareAndSet(var4, var5)); + } catch (Exception var6) { + if (NetworkStatistics.field_152478_a.isDebugEnabled()) { + NetworkStatistics.field_152478_a.debug(NetworkStatistics.field_152479_b, "NetStat failed with packetId: " + p_152488_1_, var6); + } + } + } + + public long func_152485_a() { + long var1 = 0L; + + for (int var3 = 0; var3 < 100; ++var3) { + var1 += ((NetworkStatistics.PacketStatData)this.field_152490_a[var3].get()).func_152493_a(); + } + + return var1; + } + + public long func_152489_b() { + long var1 = 0L; + + for (int var3 = 0; var3 < 100; ++var3) { + var1 += ((PacketStatData)this.field_152490_a[var3].get()).func_152495_b(); + } + + return var1; + } + + public NetworkStatistics.PacketStat func_152484_c() { + int var1 = -1; + NetworkStatistics.PacketStatData var2 = new NetworkStatistics.PacketStatData(-1L, -1, 0.0D, null); + + for (int var3 = 0; var3 < 100; ++var3) { + NetworkStatistics.PacketStatData var4 = (NetworkStatistics.PacketStatData)this.field_152490_a[var3].get(); + + if (var4.field_152496_a > var2.field_152496_a) { + var1 = var3; + var2 = var4; + } + } + + return new NetworkStatistics.PacketStat(var1, var2); + } + + public NetworkStatistics.PacketStat func_152486_d() { + int var1 = -1; + NetworkStatistics.PacketStatData var2 = new NetworkStatistics.PacketStatData(-1L, -1, 0.0D, null); + + for (int var3 = 0; var3 < 100; ++var3) { + NetworkStatistics.PacketStatData var4 = (NetworkStatistics.PacketStatData)this.field_152490_a[var3].get(); + + if (var4.field_152497_b > var2.field_152497_b) { + var1 = var3; + var2 = var4; + } + } + + return new NetworkStatistics.PacketStat(var1, var2); + } + + public NetworkStatistics.PacketStat func_152487_a(int p_152487_1_) { + return p_152487_1_ >= 0 && p_152487_1_ < 100 ? new NetworkStatistics.PacketStat(p_152487_1_, (NetworkStatistics.PacketStatData)this.field_152490_a[p_152487_1_].get()) : null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkSystem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkSystem.java new file mode 100644 index 0000000..6de9911 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/NetworkSystem.java @@ -0,0 +1,183 @@ +package net.minecraft.network; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelException; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.local.LocalAddress; +import io.netty.channel.local.LocalServerChannel; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.IOException; +import java.net.InetAddress; +import java.net.SocketAddress; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.client.network.NetHandlerHandshakeMemory; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.NetHandlerHandshakeTCP; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MessageDeserializer; +import net.minecraft.util.MessageDeserializer2; +import net.minecraft.util.MessageSerializer; +import net.minecraft.util.MessageSerializer2; +import net.minecraft.util.ReportedException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetworkSystem { + private static final Logger logger = LogManager.getLogger(); + private static final NioEventLoopGroup eventLoops = new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty IO #%d").setDaemon(true).build()); + + /** Reference to the MinecraftServer object. */ + private final MinecraftServer mcServer; + + /** True if this NetworkSystem has never had his endpoints terminated */ + public volatile boolean isAlive; + + /** Contains all endpoints added to this NetworkSystem */ + private final List endpoints = Collections.synchronizedList(new ArrayList()); + + /** A list containing all NetworkManager instances of all endpoints */ + private final List networkManagers = Collections.synchronizedList(new ArrayList()); + + + public NetworkSystem(MinecraftServer p_i45292_1_) { + this.mcServer = p_i45292_1_; + this.isAlive = true; + } + + /** + * Adds a channel that listens on publicly accessible network ports + */ + public void addLanEndpoint(InetAddress p_151265_1_, int p_151265_2_) throws IOException { + List var3 = this.endpoints; + + synchronized (this.endpoints) { + this.endpoints.add((new ServerBootstrap()).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer() { + + protected void initChannel(Channel p_initChannel_1_) { + try { + p_initChannel_1_.config().setOption(ChannelOption.IP_TOS, Integer.valueOf(24)); + } catch (ChannelException var4) { + } + + try { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(false)); + } catch (ChannelException var3) { + } + + p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new PingResponseHandler(NetworkSystem.this)).addLast("splitter", new MessageDeserializer2()).addLast("decoder", new MessageDeserializer(NetworkManager.field_152462_h)).addLast("prepender", new MessageSerializer2()).addLast("encoder", new MessageSerializer(NetworkManager.field_152462_h)); + NetworkManager var2 = new NetworkManager(false); + NetworkSystem.this.networkManagers.add(var2); + p_initChannel_1_.pipeline().addLast("packet_handler", var2); + var2.setNetHandler(new NetHandlerHandshakeTCP(NetworkSystem.this.mcServer, var2)); + } + }).group(eventLoops).localAddress(p_151265_1_, p_151265_2_).bind().syncUninterruptibly()); + } + } + + /** + * Adds a channel that listens locally + */ + public SocketAddress addLocalEndpoint() { + List var2 = this.endpoints; + ChannelFuture var1; + + synchronized (this.endpoints) { + var1 = (new ServerBootstrap()).channel(LocalServerChannel.class).childHandler(new ChannelInitializer() { + + protected void initChannel(Channel p_initChannel_1_) { + NetworkManager var2 = new NetworkManager(false); + var2.setNetHandler(new NetHandlerHandshakeMemory(NetworkSystem.this.mcServer, var2)); + NetworkSystem.this.networkManagers.add(var2); + p_initChannel_1_.pipeline().addLast("packet_handler", var2); + } + }).group(eventLoops).localAddress(LocalAddress.ANY).bind().syncUninterruptibly(); + this.endpoints.add(var1); + } + + return var1.channel().localAddress(); + } + + /** + * Shuts down all open endpoints (with immediate effect?) + */ + public void terminateEndpoints() { + this.isAlive = false; + Iterator var1 = this.endpoints.iterator(); + + while (var1.hasNext()) { + ChannelFuture var2 = (ChannelFuture)var1.next(); + var2.channel().close().syncUninterruptibly(); + } + } + + /** + * Will try to process the packets received by each NetworkManager, gracefully manage processing failures and cleans + * up dead connections + */ + public void networkTick() { + List var1 = this.networkManagers; + + synchronized (this.networkManagers) { + Iterator var2 = this.networkManagers.iterator(); + + while (var2.hasNext()) { + final NetworkManager var3 = (NetworkManager)var2.next(); + + if (!var3.isChannelOpen()) { + var2.remove(); + + if (var3.getExitMessage() != null) { + var3.getNetHandler().onDisconnect(var3.getExitMessage()); + } else if (var3.getNetHandler() != null) { + var3.getNetHandler().onDisconnect(new ChatComponentText("Disconnected")); + } + } else { + try { + var3.processReceivedPackets(); + } catch (Exception var8) { + if (var3.isLocalChannel()) { + CrashReport var10 = CrashReport.makeCrashReport(var8, "Ticking memory connection"); + CrashReportCategory var6 = var10.makeCategory("Ticking connection"); + var6.addCrashSectionCallable("Connection", new Callable() { + + public String call() { + return var3.toString(); + } + }); + throw new ReportedException(var10); + } + + logger.warn("Failed to handle packet for " + var3.getSocketAddress(), var8); + final ChatComponentText var5 = new ChatComponentText("Internal server error"); + var3.scheduleOutboundPacket(new S40PacketDisconnect(var5), new GenericFutureListener() { + + public void operationComplete(Future p_operationComplete_1_) { + var3.closeChannel(var5); + } + }); + var3.disableAutoRead(); + } + } + } + } + } + + public MinecraftServer func_151267_d() { + return this.mcServer; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/Packet.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/Packet.java new file mode 100644 index 0000000..91747ec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/Packet.java @@ -0,0 +1,81 @@ +package net.minecraft.network; + +import com.google.common.collect.BiMap; +import io.netty.buffer.ByteBuf; +import java.io.IOException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class Packet { + private static final Logger logger = LogManager.getLogger(); + + + /** + * Returns a packet instance, given the params: BiMap and (int) id + */ + public static Packet generatePacket(BiMap p_148839_0_, int p_148839_1_) { + try { + Class var2 = (Class)p_148839_0_.get(Integer.valueOf(p_148839_1_)); + return var2 == null ? null : (Packet)var2.newInstance(); + } catch (Exception var3) { + logger.error("Couldn't create packet " + p_148839_1_, var3); + return null; + } + } + + /** + * Will write a byte array to supplied ByteBuf as a separately defined structure by prefixing the byte array with + * its length + */ + public static void writeBlob(ByteBuf p_148838_0_, byte[] p_148838_1_) { + p_148838_0_.writeShort(p_148838_1_.length); + p_148838_0_.writeBytes(p_148838_1_); + } + + /** + * Will read a byte array from the supplied ByteBuf, the first short encountered will be interpreted as the size of + * the byte array to read in + */ + public static byte[] readBlob(ByteBuf p_148834_0_) throws IOException { + short var1 = p_148834_0_.readShort(); + + if (var1 < 0) { + throw new IOException("Key was smaller than nothing! Weird key!"); + } else { + byte[] var2 = new byte[var1]; + p_148834_0_.readBytes(var2); + return var2; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public abstract void readPacketData(PacketBuffer p_148837_1_) throws IOException; + + /** + * Writes the raw packet data to the data stream. + */ + public abstract void writePacketData(PacketBuffer p_148840_1_) throws IOException; + + public abstract void processPacket(INetHandler p_148833_1_); + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return false; + } + + public String toString() { + return this.getClass().getSimpleName(); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return ""; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/PacketBuffer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/PacketBuffer.java new file mode 100644 index 0000000..9ae5113 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/PacketBuffer.java @@ -0,0 +1,776 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufProcessor; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTSizeTracker; +import net.minecraft.nbt.NBTTagCompound; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.GatheringByteChannel; +import java.nio.channels.ScatteringByteChannel; +import java.nio.charset.Charset; +import java.util.UUID; + +public class PacketBuffer extends ByteBuf { + private final ByteBuf buf; + + + public PacketBuffer(ByteBuf p_i45154_1_) { + this.buf = p_i45154_1_; + } + + /** + * Calculates the number of bytes required to fit the supplied int (0-5) if it were to be read/written using + * readVarIntFromBuffer or writeVarIntToBuffer + */ + public static int getVarIntSize(int p_150790_0_) { + return (p_150790_0_ & -128) == 0 ? 1 : ((p_150790_0_ & -16384) == 0 ? 2 : ((p_150790_0_ & -2097152) == 0 ? 3 : ((p_150790_0_ & -268435456) == 0 ? 4 : 5))); + } + + /** + * Reads a compressed int from the buffer. To do so it maximally reads 5 byte-sized chunks whose most significant + * bit dictates whether another byte should be read. + */ + public int readVarIntFromBuffer() { + int var1 = 0; + int var2 = 0; + byte var3; + + do { + var3 = this.readByte(); + var1 |= (var3 & 127) << var2++ * 7; + + if (var2 > 5) { + throw new RuntimeException("VarInt too big"); + } + } + while ((var3 & 128) == 128); + + return var1; + } + + /** + * Writes a compressed int to the buffer. The smallest number of bytes to fit the passed int will be written. Of + * each such byte only 7 bits will be used to describe the actual value since its most significant bit dictates + * whether the next byte is part of that same int. Micro-optimization for int values that are expected to have + * values below 128. + */ + public void writeVarIntToBuffer(int p_150787_1_) { + while ((p_150787_1_ & -128) != 0) { + this.writeByte(p_150787_1_ & 127 | 128); + p_150787_1_ >>>= 7; + } + + this.writeByte(p_150787_1_); + } + + public void writeUUID(UUID uuid) { + this.buf.writeLong(uuid.getMostSignificantBits()); + this.buf.writeLong(uuid.getLeastSignificantBits()); + } + + public UUID readUUID() { + long mostSigBits = this.buf.readLong(); + long leastSigBits = this.buf.readLong(); + return new UUID(mostSigBits, leastSigBits); + } + + /** + * Writes a compressed NBTTagCompound to this buffer + */ + public void writeNBTTagCompoundToBuffer(NBTTagCompound p_150786_1_) throws IOException { + if (p_150786_1_ == null) { + this.writeShort(-1); + } else { + byte[] var2 = CompressedStreamTools.compress(p_150786_1_); + this.writeShort((short)var2.length); + this.writeBytes(var2); + } + } + + /** + * Reads a compressed NBTTagCompound from this buffer + */ + public NBTTagCompound readNBTTagCompoundFromBuffer() throws IOException { + short var1 = this.readShort(); + + if (var1 < 0) { + return null; + } else { + byte[] var2 = new byte[var1]; + this.readBytes(var2); + return CompressedStreamTools.func_152457_a(var2, new NBTSizeTracker(2097152L)); + } + } + + /** + * Writes the ItemStack's ID (short), then size (byte), then damage. (short) + */ + public void writeItemStackToBuffer(ItemStack p_150788_1_) throws IOException { + if (p_150788_1_ == null) { + this.writeShort(-1); + } else { + this.writeShort(Item.getIdFromItem(p_150788_1_.getItem())); + this.writeByte(p_150788_1_.stackSize); + this.writeShort(p_150788_1_.getItemDamage()); + NBTTagCompound var2 = null; + + if (p_150788_1_.getItem().isDamageable() || p_150788_1_.getItem().getShareTag()) { + var2 = p_150788_1_.stackTagCompound; + } + + this.writeNBTTagCompoundToBuffer(var2); + } + } + + /** + * Reads an ItemStack from this buffer + */ + public ItemStack readItemStackFromBuffer() throws IOException { + ItemStack var1 = null; + short var2 = this.readShort(); + + if (var2 >= 0) { + byte var3 = this.readByte(); + short var4 = this.readShort(); + var1 = new ItemStack(Item.getItemById(var2), var3, var4); + var1.stackTagCompound = this.readNBTTagCompoundFromBuffer(); + } + + return var1; + } + + /** + * Reads a string from this buffer. Expected parameter is maximum allowed string length. Will throw IOException if + * string length exceeds this value! + */ + public String readStringFromBuffer(int maxLength) { + try { + int n2 = this.readVarIntFromBuffer(); + if (n2 > maxLength * 4) { + + throw new IOException("The received encoded string buffer length is longer than maximum allowed (" + n2 + " > " + maxLength * 4 + ")"); + + } + if (n2 < 0) { + throw new IOException("The received encoded string buffer length is less than zero! Weird string!"); + } + String string = new String(this.readBytes(n2).array(), Charsets.UTF_8); + if (string.length() > maxLength) { + throw new IOException("The received string length is longer than maximum allowed (" + n2 + " > " + maxLength + ")"); + } + return string; + } catch (IOException e) { + e.printStackTrace(); + return null; + } + + } + + /** + * Writes a (UTF-8 encoded) String to this buffer. Will throw IOException if String length exceeds 32767 bytes + */ + public void writeStringToBuffer(String p_150785_1_) { + byte[] var2 = p_150785_1_.getBytes(Charsets.UTF_8); + + if (var2.length > 32767) { + try { + throw new IOException("String too big (was " + p_150785_1_.length() + " bytes encoded, max " + 32767 + ")"); + } catch (IOException e) { + e.printStackTrace(); + } + } else { + this.writeVarIntToBuffer(var2.length); + this.writeBytes(var2); + } + } + + public int capacity() { + return this.buf.capacity(); + } + + public ByteBuf capacity(int p_capacity_1_) { + return this.buf.capacity(p_capacity_1_); + } + + public int maxCapacity() { + return this.buf.maxCapacity(); + } + + public ByteBufAllocator alloc() { + return this.buf.alloc(); + } + + public ByteOrder order() { + return this.buf.order(); + } + + public ByteBuf order(ByteOrder p_order_1_) { + return this.buf.order(p_order_1_); + } + + public ByteBuf unwrap() { + return this.buf.unwrap(); + } + + public boolean isDirect() { + return this.buf.isDirect(); + } + + public int readerIndex() { + return this.buf.readerIndex(); + } + + public ByteBuf readerIndex(int p_readerIndex_1_) { + return this.buf.readerIndex(p_readerIndex_1_); + } + + public int writerIndex() { + return this.buf.writerIndex(); + } + + public ByteBuf writerIndex(int p_writerIndex_1_) { + return this.buf.writerIndex(p_writerIndex_1_); + } + + public ByteBuf setIndex(int p_setIndex_1_, int p_setIndex_2_) { + return this.buf.setIndex(p_setIndex_1_, p_setIndex_2_); + } + + public int readableBytes() { + return this.buf.readableBytes(); + } + + public int writableBytes() { + return this.buf.writableBytes(); + } + + public int maxWritableBytes() { + return this.buf.maxWritableBytes(); + } + + public boolean isReadable() { + return this.buf.isReadable(); + } + + public boolean isReadable(int p_isReadable_1_) { + return this.buf.isReadable(p_isReadable_1_); + } + + public boolean isWritable() { + return this.buf.isWritable(); + } + + public boolean isWritable(int p_isWritable_1_) { + return this.buf.isWritable(p_isWritable_1_); + } + + public ByteBuf clear() { + return this.buf.clear(); + } + + public ByteBuf markReaderIndex() { + return this.buf.markReaderIndex(); + } + + public ByteBuf resetReaderIndex() { + return this.buf.resetReaderIndex(); + } + + public ByteBuf markWriterIndex() { + return this.buf.markWriterIndex(); + } + + public ByteBuf resetWriterIndex() { + return this.buf.resetWriterIndex(); + } + + public ByteBuf discardReadBytes() { + return this.buf.discardReadBytes(); + } + + public ByteBuf discardSomeReadBytes() { + return this.buf.discardSomeReadBytes(); + } + + public ByteBuf ensureWritable(int p_ensureWritable_1_) { + return this.buf.ensureWritable(p_ensureWritable_1_); + } + + public int ensureWritable(int p_ensureWritable_1_, boolean p_ensureWritable_2_) { + return this.buf.ensureWritable(p_ensureWritable_1_, p_ensureWritable_2_); + } + + public boolean getBoolean(int p_getBoolean_1_) { + return this.buf.getBoolean(p_getBoolean_1_); + } + + public byte getByte(int p_getByte_1_) { + return this.buf.getByte(p_getByte_1_); + } + + public short getUnsignedByte(int p_getUnsignedByte_1_) { + return this.buf.getUnsignedByte(p_getUnsignedByte_1_); + } + + public short getShort(int p_getShort_1_) { + return this.buf.getShort(p_getShort_1_); + } + + public int getUnsignedShort(int p_getUnsignedShort_1_) { + return this.buf.getUnsignedShort(p_getUnsignedShort_1_); + } + + public int getMedium(int p_getMedium_1_) { + return this.buf.getMedium(p_getMedium_1_); + } + + public int getUnsignedMedium(int p_getUnsignedMedium_1_) { + return this.buf.getUnsignedMedium(p_getUnsignedMedium_1_); + } + + public int getInt(int p_getInt_1_) { + return this.buf.getInt(p_getInt_1_); + } + + public long getUnsignedInt(int p_getUnsignedInt_1_) { + return this.buf.getUnsignedInt(p_getUnsignedInt_1_); + } + + public long getLong(int p_getLong_1_) { + return this.buf.getLong(p_getLong_1_); + } + + public char getChar(int p_getChar_1_) { + return this.buf.getChar(p_getChar_1_); + } + + public float getFloat(int p_getFloat_1_) { + return this.buf.getFloat(p_getFloat_1_); + } + + public double getDouble(int p_getDouble_1_) { + return this.buf.getDouble(p_getDouble_1_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_) { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_) { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_); + } + + public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_) { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuffer p_getBytes_2_) { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, OutputStream p_getBytes_2_, int p_getBytes_3_) throws IOException { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public int getBytes(int p_getBytes_1_, GatheringByteChannel p_getBytes_2_, int p_getBytes_3_) throws IOException { + return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public ByteBuf setBoolean(int p_setBoolean_1_, boolean p_setBoolean_2_) { + return this.buf.setBoolean(p_setBoolean_1_, p_setBoolean_2_); + } + + public ByteBuf setByte(int p_setByte_1_, int p_setByte_2_) { + return this.buf.setByte(p_setByte_1_, p_setByte_2_); + } + + public ByteBuf setShort(int p_setShort_1_, int p_setShort_2_) { + return this.buf.setShort(p_setShort_1_, p_setShort_2_); + } + + public ByteBuf setMedium(int p_setMedium_1_, int p_setMedium_2_) { + return this.buf.setMedium(p_setMedium_1_, p_setMedium_2_); + } + + public ByteBuf setInt(int p_setInt_1_, int p_setInt_2_) { + return this.buf.setInt(p_setInt_1_, p_setInt_2_); + } + + public ByteBuf setLong(int p_setLong_1_, long p_setLong_2_) { + return this.buf.setLong(p_setLong_1_, p_setLong_2_); + } + + public ByteBuf setChar(int p_setChar_1_, int p_setChar_2_) { + return this.buf.setChar(p_setChar_1_, p_setChar_2_); + } + + public ByteBuf setFloat(int p_setFloat_1_, float p_setFloat_2_) { + return this.buf.setFloat(p_setFloat_1_, p_setFloat_2_); + } + + public ByteBuf setDouble(int p_setDouble_1_, double p_setDouble_2_) { + return this.buf.setDouble(p_setDouble_1_, p_setDouble_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_) { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_) { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_); + } + + public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_) { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuffer p_setBytes_2_) { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public int setBytes(int p_setBytes_1_, InputStream p_setBytes_2_, int p_setBytes_3_) throws IOException { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public int setBytes(int p_setBytes_1_, ScatteringByteChannel p_setBytes_2_, int p_setBytes_3_) throws IOException { + return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public ByteBuf setZero(int p_setZero_1_, int p_setZero_2_) { + return this.buf.setZero(p_setZero_1_, p_setZero_2_); + } + + public boolean readBoolean() { + return this.buf.readBoolean(); + } + + public byte readByte() { + return this.buf.readByte(); + } + + public short readUnsignedByte() { + return this.buf.readUnsignedByte(); + } + + public short readShort() { + return this.buf.readShort(); + } + + public int readUnsignedShort() { + return this.buf.readUnsignedShort(); + } + + public int readMedium() { + return this.buf.readMedium(); + } + + public int readUnsignedMedium() { + return this.buf.readUnsignedMedium(); + } + + public int readInt() { + return this.buf.readInt(); + } + + public long readUnsignedInt() { + return this.buf.readUnsignedInt(); + } + + public long readLong() { + return this.buf.readLong(); + } + + public char readChar() { + return this.buf.readChar(); + } + + public float readFloat() { + return this.buf.readFloat(); + } + + public double readDouble() { + return this.buf.readDouble(); + } + + public ByteBuf readBytes(int p_readBytes_1_) { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readSlice(int p_readSlice_1_) { + return this.buf.readSlice(p_readSlice_1_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_) { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_) { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_); + } + + public ByteBuf readBytes(byte[] p_readBytes_1_) { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(byte[] p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_); + } + + public ByteBuf readBytes(ByteBuffer p_readBytes_1_) { + return this.buf.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(OutputStream p_readBytes_1_, int p_readBytes_2_) throws IOException { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public int readBytes(GatheringByteChannel p_readBytes_1_, int p_readBytes_2_) throws IOException { + return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public ByteBuf skipBytes(int p_skipBytes_1_) { + return this.buf.skipBytes(p_skipBytes_1_); + } + + public ByteBuf writeBoolean(boolean p_writeBoolean_1_) { + return this.buf.writeBoolean(p_writeBoolean_1_); + } + + public ByteBuf writeByte(int p_writeByte_1_) { + return this.buf.writeByte(p_writeByte_1_); + } + + public ByteBuf writeShort(int p_writeShort_1_) { + return this.buf.writeShort(p_writeShort_1_); + } + + public ByteBuf writeMedium(int p_writeMedium_1_) { + return this.buf.writeMedium(p_writeMedium_1_); + } + + public ByteBuf writeInt(int p_writeInt_1_) { + return this.buf.writeInt(p_writeInt_1_); + } + + public ByteBuf writeLong(long p_writeLong_1_) { + return this.buf.writeLong(p_writeLong_1_); + } + + public ByteBuf writeChar(int p_writeChar_1_) { + return this.buf.writeChar(p_writeChar_1_); + } + + public ByteBuf writeFloat(float p_writeFloat_1_) { + return this.buf.writeFloat(p_writeFloat_1_); + } + + public ByteBuf writeDouble(double p_writeDouble_1_) { + return this.buf.writeDouble(p_writeDouble_1_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_) { + return this.buf.writeBytes(p_writeBytes_1_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_) { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_); + } + + public ByteBuf writeBytes(byte[] p_writeBytes_1_) { + return this.buf.writeBytes(p_writeBytes_1_); + } + + public ByteBuf writeBytes(byte[] p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_); + } + + public ByteBuf writeBytes(ByteBuffer p_writeBytes_1_) { + return this.buf.writeBytes(p_writeBytes_1_); + } + + public int writeBytes(InputStream p_writeBytes_1_, int p_writeBytes_2_) throws IOException { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public int writeBytes(ScatteringByteChannel p_writeBytes_1_, int p_writeBytes_2_) throws IOException { + return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public ByteBuf writeZero(int p_writeZero_1_) { + return this.buf.writeZero(p_writeZero_1_); + } + + public int indexOf(int p_indexOf_1_, int p_indexOf_2_, byte p_indexOf_3_) { + return this.buf.indexOf(p_indexOf_1_, p_indexOf_2_, p_indexOf_3_); + } + + public int bytesBefore(byte p_bytesBefore_1_) { + return this.buf.bytesBefore(p_bytesBefore_1_); + } + + public int bytesBefore(int p_bytesBefore_1_, byte p_bytesBefore_2_) { + return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_); + } + + public int bytesBefore(int p_bytesBefore_1_, int p_bytesBefore_2_, byte p_bytesBefore_3_) { + return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_, p_bytesBefore_3_); + } + + public int forEachByte(ByteBufProcessor p_forEachByte_1_) { + return this.buf.forEachByte(p_forEachByte_1_); + } + + public int forEachByte(int p_forEachByte_1_, int p_forEachByte_2_, ByteBufProcessor p_forEachByte_3_) { + return this.buf.forEachByte(p_forEachByte_1_, p_forEachByte_2_, p_forEachByte_3_); + } + + public int forEachByteDesc(ByteBufProcessor p_forEachByteDesc_1_) { + return this.buf.forEachByteDesc(p_forEachByteDesc_1_); + } + + public int forEachByteDesc(int p_forEachByteDesc_1_, int p_forEachByteDesc_2_, ByteBufProcessor p_forEachByteDesc_3_) { + return this.buf.forEachByteDesc(p_forEachByteDesc_1_, p_forEachByteDesc_2_, p_forEachByteDesc_3_); + } + + public ByteBuf copy() { + return this.buf.copy(); + } + + public ByteBuf copy(int p_copy_1_, int p_copy_2_) { + return this.buf.copy(p_copy_1_, p_copy_2_); + } + + public ByteBuf slice() { + return this.buf.slice(); + } + + public ByteBuf slice(int p_slice_1_, int p_slice_2_) { + return this.buf.slice(p_slice_1_, p_slice_2_); + } + + public ByteBuf duplicate() { + return this.buf.duplicate(); + } + + public int nioBufferCount() { + return this.buf.nioBufferCount(); + } + + public ByteBuffer nioBuffer() { + return this.buf.nioBuffer(); + } + + public ByteBuffer nioBuffer(int p_nioBuffer_1_, int p_nioBuffer_2_) { + return this.buf.nioBuffer(p_nioBuffer_1_, p_nioBuffer_2_); + } + + public ByteBuffer internalNioBuffer(int p_internalNioBuffer_1_, int p_internalNioBuffer_2_) { + return this.buf.internalNioBuffer(p_internalNioBuffer_1_, p_internalNioBuffer_2_); + } + + public ByteBuffer[] nioBuffers() { + return this.buf.nioBuffers(); + } + + public ByteBuffer[] nioBuffers(int p_nioBuffers_1_, int p_nioBuffers_2_) { + return this.buf.nioBuffers(p_nioBuffers_1_, p_nioBuffers_2_); + } + + public boolean hasArray() { + return this.buf.hasArray(); + } + + public byte[] array() { + return this.buf.array(); + } + + public int arrayOffset() { + return this.buf.arrayOffset(); + } + + public boolean hasMemoryAddress() { + return this.buf.hasMemoryAddress(); + } + + public long memoryAddress() { + return this.buf.memoryAddress(); + } + + public String toString(Charset p_toString_1_) { + return this.buf.toString(p_toString_1_); + } + + public String toString(int p_toString_1_, int p_toString_2_, Charset p_toString_3_) { + return this.buf.toString(p_toString_1_, p_toString_2_, p_toString_3_); + } + + public int hashCode() { + return this.buf.hashCode(); + } + + public boolean equals(Object p_equals_1_) { + return this.buf.equals(p_equals_1_); + } + + public int compareTo(ByteBuf p_compareTo_1_) { + return this.buf.compareTo(p_compareTo_1_); + } + + public String toString() { + return this.buf.toString(); + } + + public ByteBuf retain(int p_retain_1_) { + return this.buf.retain(p_retain_1_); + } + + public ByteBuf retain() { + return this.buf.retain(); + } + + public int refCnt() { + return this.buf.refCnt(); + } + + public boolean release() { + return this.buf.release(); + } + + public boolean release(int p_release_1_) { + return this.buf.release(p_release_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/PingResponseHandler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/PingResponseHandler.java new file mode 100644 index 0000000..2388f13 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/PingResponseHandler.java @@ -0,0 +1,115 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import java.net.InetSocketAddress; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PingResponseHandler extends ChannelInboundHandlerAdapter { + private static final Logger logger = LogManager.getLogger(); + private final NetworkSystem field_151257_b; + + + public PingResponseHandler(NetworkSystem p_i45286_1_) { + this.field_151257_b = p_i45286_1_; + } + + public void channelRead(ChannelHandlerContext p_channelRead_1_, Object p_channelRead_2_) { + ByteBuf var3 = (ByteBuf)p_channelRead_2_; + var3.markReaderIndex(); + boolean var4 = true; + + try { + try { + if (var3.readUnsignedByte() != 254) { + return; + } + + InetSocketAddress var5 = (InetSocketAddress)p_channelRead_1_.channel().remoteAddress(); + MinecraftServer var6 = this.field_151257_b.func_151267_d(); + int var7 = var3.readableBytes(); + String var8; + + switch (var7) { + case 0: + logger.debug("Ping: (<1.3.x) from {}:{}", var5.getAddress(), Integer.valueOf(var5.getPort())); + var8 = String.format("%s\u00a7%d\u00a7%d", var6.getMOTD(), Integer.valueOf(var6.getCurrentPlayerCount()), Integer.valueOf(var6.getMaxPlayers())); + this.func_151256_a(p_channelRead_1_, this.func_151255_a(var8)); + break; + + case 1: + if (var3.readUnsignedByte() != 1) { + return; + } + + logger.debug("Ping: (1.4-1.5.x) from {}:{}", var5.getAddress(), Integer.valueOf(var5.getPort())); + var8 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", Integer.valueOf(127), var6.getMinecraftVersion(), var6.getMOTD(), Integer.valueOf(var6.getCurrentPlayerCount()), Integer.valueOf(var6.getMaxPlayers())); + this.func_151256_a(p_channelRead_1_, this.func_151255_a(var8)); + break; + + default: + boolean var23 = var3.readUnsignedByte() == 1; + var23 &= var3.readUnsignedByte() == 250; + var23 &= "MC|PingHost".equals(new String(var3.readBytes(var3.readShort() * 2).array(), Charsets.UTF_16BE)); + int var9 = var3.readUnsignedShort(); + var23 &= var3.readUnsignedByte() >= 73; + var23 &= 3 + var3.readBytes(var3.readShort() * 2).array().length + 4 == var9; + var23 &= var3.readInt() <= 65535; + var23 &= var3.readableBytes() == 0; + + if (!var23) { + return; + } + + logger.debug("Ping: (1.6) from {}:{}", var5.getAddress(), Integer.valueOf(var5.getPort())); + String var10 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", Integer.valueOf(127), var6.getMinecraftVersion(), var6.getMOTD(), Integer.valueOf(var6.getCurrentPlayerCount()), Integer.valueOf(var6.getMaxPlayers())); + ByteBuf var11 = this.func_151255_a(var10); + + try { + this.func_151256_a(p_channelRead_1_, var11); + } + finally { + var11.release(); + } + } + + var3.release(); + var4 = false; + } catch (RuntimeException var21) { + } + } + finally { + if (var4) { + var3.resetReaderIndex(); + p_channelRead_1_.channel().pipeline().remove("legacy_query"); + p_channelRead_1_.fireChannelRead(p_channelRead_2_); + } + } + } + + private void func_151256_a(ChannelHandlerContext p_151256_1_, ByteBuf p_151256_2_) { + p_151256_1_.pipeline().firstContext().writeAndFlush(p_151256_2_).addListener(ChannelFutureListener.CLOSE); + } + + private ByteBuf func_151255_a(String p_151255_1_) { + ByteBuf var2 = Unpooled.buffer(); + var2.writeByte(255); + char[] var3 = p_151255_1_.toCharArray(); + var2.writeShort(var3.length); + char[] var4 = var3; + int var5 = var3.length; + + for (int var6 = 0; var6 < var5; ++var6) { + char var7 = var4[var6]; + var2.writeChar(var7); + } + + return var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/ServerStatusResponse.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/ServerStatusResponse.java new file mode 100644 index 0000000..8f82c43 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/ServerStatusResponse.java @@ -0,0 +1,230 @@ +package net.minecraft.network; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.mojang.authlib.GameProfile; +import java.lang.reflect.Type; +import java.util.UUID; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; + +public class ServerStatusResponse { + private IChatComponent field_151326_a; + private ServerStatusResponse.PlayerCountData field_151324_b; + private ServerStatusResponse.MinecraftProtocolVersionIdentifier field_151325_c; + private String field_151323_d; + public String lcString; + + + public IChatComponent func_151317_a() { + return this.field_151326_a; + } + + public void func_151315_a(IChatComponent p_151315_1_) { + this.field_151326_a = p_151315_1_; + } + + public ServerStatusResponse.PlayerCountData func_151318_b() { + return this.field_151324_b; + } + + public void func_151319_a(ServerStatusResponse.PlayerCountData p_151319_1_) { + this.field_151324_b = p_151319_1_; + } + + public ServerStatusResponse.MinecraftProtocolVersionIdentifier func_151322_c() { + return this.field_151325_c; + } + + public void func_151321_a(ServerStatusResponse.MinecraftProtocolVersionIdentifier p_151321_1_) { + this.field_151325_c = p_151321_1_; + } + + public void func_151320_a(String p_151320_1_) { + this.field_151323_d = p_151320_1_; + } + + public String func_151316_d() { + return this.field_151323_d; + } + + public static class MinecraftProtocolVersionIdentifier { + private final String field_151306_a; + private final int field_151305_b; + + + public MinecraftProtocolVersionIdentifier(String p_i45275_1_, int p_i45275_2_) { + this.field_151306_a = p_i45275_1_; + this.field_151305_b = p_i45275_2_; + } + + public String func_151303_a() { + return this.field_151306_a; + } + + public int func_151304_b() { + return this.field_151305_b; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer { + + + public ServerStatusResponse.MinecraftProtocolVersionIdentifier deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "version"); + return new ServerStatusResponse.MinecraftProtocolVersionIdentifier(JsonUtils.getJsonObjectStringFieldValue(var4, "name"), JsonUtils.getJsonObjectIntegerFieldValue(var4, "protocol")); + } + + public JsonElement serialize(ServerStatusResponse.MinecraftProtocolVersionIdentifier p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + JsonObject var4 = new JsonObject(); + var4.addProperty("name", p_serialize_1_.func_151303_a()); + var4.addProperty("protocol", Integer.valueOf(p_serialize_1_.func_151304_b())); + return var4; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.serialize((ServerStatusResponse.MinecraftProtocolVersionIdentifier)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } + } + + public static class PlayerCountData { + private final int field_151336_a; + private final int field_151334_b; + private GameProfile[] field_151335_c; + + + public PlayerCountData(int p_i45274_1_, int p_i45274_2_) { + this.field_151336_a = p_i45274_1_; + this.field_151334_b = p_i45274_2_; + } + + public int func_151332_a() { + return this.field_151336_a; + } + + public int func_151333_b() { + return this.field_151334_b; + } + + public GameProfile[] func_151331_c() { + return this.field_151335_c; + } + + public void func_151330_a(GameProfile[] p_151330_1_) { + this.field_151335_c = p_151330_1_; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer { + + + public ServerStatusResponse.PlayerCountData deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "players"); + ServerStatusResponse.PlayerCountData var5 = new ServerStatusResponse.PlayerCountData(JsonUtils.getJsonObjectIntegerFieldValue(var4, "max"), JsonUtils.getJsonObjectIntegerFieldValue(var4, "online")); + + if (JsonUtils.jsonObjectFieldTypeIsArray(var4, "sample")) { + JsonArray var6 = JsonUtils.getJsonObjectJsonArrayField(var4, "sample"); + + if (var6.size() > 0) { + GameProfile[] var7 = new GameProfile[var6.size()]; + + for (int var8 = 0; var8 < var7.length; ++var8) { + JsonObject var9 = JsonUtils.getJsonElementAsJsonObject(var6.get(var8), "player[" + var8 + "]"); + String var10 = JsonUtils.getJsonObjectStringFieldValue(var9, "id"); + var7[var8] = new GameProfile(UUID.fromString(var10), JsonUtils.getJsonObjectStringFieldValue(var9, "name")); + } + + var5.func_151330_a(var7); + } + } + + return var5; + } + + public JsonElement serialize(ServerStatusResponse.PlayerCountData p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + JsonObject var4 = new JsonObject(); + var4.addProperty("max", Integer.valueOf(p_serialize_1_.func_151332_a())); + var4.addProperty("online", Integer.valueOf(p_serialize_1_.func_151333_b())); + + if (p_serialize_1_.func_151331_c() != null && p_serialize_1_.func_151331_c().length > 0) { + JsonArray var5 = new JsonArray(); + + for (int var6 = 0; var6 < p_serialize_1_.func_151331_c().length; ++var6) { + JsonObject var7 = new JsonObject(); + UUID var8 = p_serialize_1_.func_151331_c()[var6].getId(); + var7.addProperty("id", var8 == null ? "" : var8.toString()); + var7.addProperty("name", p_serialize_1_.func_151331_c()[var6].getName()); + var5.add(var7); + } + + var4.add("sample", var5); + } + + return var4; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.serialize((ServerStatusResponse.PlayerCountData)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } + } + + public static class Serializer implements JsonDeserializer, JsonSerializer { + + + public ServerStatusResponse deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + JsonObject var4 = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "status"); + ServerStatusResponse var5 = new ServerStatusResponse(); + + if (var4.has("description")) { + var5.func_151315_a(p_deserialize_3_.deserialize(var4.get("description"), IChatComponent.class)); + } + + if (var4.has("players")) { + var5.func_151319_a(p_deserialize_3_.deserialize(var4.get("players"), PlayerCountData.class)); + } + + if (var4.has("version")) { + var5.func_151321_a(p_deserialize_3_.deserialize(var4.get("version"), MinecraftProtocolVersionIdentifier.class)); + } + + if (var4.has("favicon")) { + var5.func_151320_a(JsonUtils.getJsonObjectStringFieldValue(var4, "favicon")); + } + if (var4.has("lcServer")) { + var5.lcString = var4.get("lcServer").getAsString(); + } + return var5; + } + + public JsonElement serialize(ServerStatusResponse p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + JsonObject var4 = new JsonObject(); + + if (p_serialize_1_.func_151317_a() != null) { + var4.add("description", p_serialize_3_.serialize(p_serialize_1_.func_151317_a())); + } + + if (p_serialize_1_.func_151318_b() != null) { + var4.add("players", p_serialize_3_.serialize(p_serialize_1_.func_151318_b())); + } + + if (p_serialize_1_.func_151322_c() != null) { + var4.add("version", p_serialize_3_.serialize(p_serialize_1_.func_151322_c())); + } + + if (p_serialize_1_.func_151316_d() != null) { + var4.addProperty("favicon", p_serialize_1_.func_151316_d()); + } + + return var4; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.serialize((ServerStatusResponse)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java new file mode 100644 index 0000000..bf2365e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java @@ -0,0 +1,13 @@ +package net.minecraft.network.handshake; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.handshake.client.C00Handshake; + +public interface INetHandlerHandshakeServer extends INetHandler { + /** + * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The + * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention + * must pass a versioncheck or receive a disconnect otherwise + */ + void processHandshake(C00Handshake p_147383_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java new file mode 100644 index 0000000..fb41e45 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/handshake/client/C00Handshake.java @@ -0,0 +1,69 @@ +package net.minecraft.network.handshake.client; + +import java.io.IOException; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; + +public class C00Handshake extends Packet { + private int field_149600_a; + private String field_149598_b; + private int field_149599_c; + private EnumConnectionState field_149597_d; + + + public C00Handshake() {} + + public C00Handshake(int p_i45266_1_, String p_i45266_2_, int p_i45266_3_, EnumConnectionState p_i45266_4_) { + this.field_149600_a = p_i45266_1_; + this.field_149598_b = p_i45266_2_; + this.field_149599_c = p_i45266_3_; + this.field_149597_d = p_i45266_4_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149600_a = p_148837_1_.readVarIntFromBuffer(); + this.field_149598_b = p_148837_1_.readStringFromBuffer(255); + this.field_149599_c = p_148837_1_.readUnsignedShort(); + this.field_149597_d = EnumConnectionState.func_150760_a(p_148837_1_.readVarIntFromBuffer()); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_149600_a); + p_148840_1_.writeStringToBuffer(this.field_149598_b); + p_148840_1_.writeShort(this.field_149599_c); + p_148840_1_.writeVarIntToBuffer(this.field_149597_d.func_150759_c()); + } + + public void processPacket(INetHandlerHandshakeServer p_148833_1_) { + p_148833_1_.processHandshake(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public EnumConnectionState func_149594_c() { + return this.field_149597_d; + } + + public int func_149595_d() { + return this.field_149600_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerHandshakeServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java new file mode 100644 index 0000000..c0d4ae1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/INetHandlerLoginClient.java @@ -0,0 +1,14 @@ +package net.minecraft.network.login; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; + +public interface INetHandlerLoginClient extends INetHandler { + void handleEncryptionRequest(S01PacketEncryptionRequest p_147389_1_); + + void handleLoginSuccess(S02PacketLoginSuccess p_147390_1_); + + void handleDisconnect(S00PacketDisconnect p_147388_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java new file mode 100644 index 0000000..114ad33 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/INetHandlerLoginServer.java @@ -0,0 +1,11 @@ +package net.minecraft.network.login; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; + +public interface INetHandlerLoginServer extends INetHandler { + void processLoginStart(C00PacketLoginStart p_147316_1_); + + void processEncryptionResponse(C01PacketEncryptionResponse p_147315_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java new file mode 100644 index 0000000..a74d1b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java @@ -0,0 +1,46 @@ +package net.minecraft.network.login.client; + +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.UUID; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginServer; + +public class C00PacketLoginStart extends Packet { + private GameProfile field_149305_a; + + + public C00PacketLoginStart() {} + + public C00PacketLoginStart(GameProfile p_i45270_1_) { + this.field_149305_a = p_i45270_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149305_a = new GameProfile(null, p_148837_1_.readStringFromBuffer(16)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149305_a.getName()); + } + + public void processPacket(INetHandlerLoginServer p_148833_1_) { + p_148833_1_.processLoginStart(this); + } + + public GameProfile func_149304_c() { + return this.field_149305_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerLoginServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java new file mode 100644 index 0000000..f4e809f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java @@ -0,0 +1,56 @@ +package net.minecraft.network.login.client; + +import java.io.IOException; +import java.security.PrivateKey; +import java.security.PublicKey; +import javax.crypto.SecretKey; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginServer; +import net.minecraft.util.CryptManager; + +public class C01PacketEncryptionResponse extends Packet { + private byte[] field_149302_a = new byte[0]; + private byte[] field_149301_b = new byte[0]; + + + public C01PacketEncryptionResponse() {} + + public C01PacketEncryptionResponse(SecretKey p_i45271_1_, PublicKey p_i45271_2_, byte[] p_i45271_3_) { + this.field_149302_a = CryptManager.encryptData(p_i45271_2_, p_i45271_1_.getEncoded()); + this.field_149301_b = CryptManager.encryptData(p_i45271_2_, p_i45271_3_); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149302_a = readBlob(p_148837_1_); + this.field_149301_b = readBlob(p_148837_1_); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + writeBlob(p_148840_1_, this.field_149302_a); + writeBlob(p_148840_1_, this.field_149301_b); + } + + public void processPacket(INetHandlerLoginServer p_148833_1_) { + p_148833_1_.processEncryptionResponse(this); + } + + public SecretKey func_149300_a(PrivateKey p_149300_1_) { + return CryptManager.decryptSharedKey(p_149300_1_, this.field_149302_a); + } + + public byte[] func_149299_b(PrivateKey p_149299_1_) { + return p_149299_1_ == null ? this.field_149301_b : CryptManager.decryptData(p_149299_1_, this.field_149301_b); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerLoginServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java new file mode 100644 index 0000000..693a318 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S00PacketDisconnect.java @@ -0,0 +1,53 @@ +package net.minecraft.network.login.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.util.IChatComponent; + +public class S00PacketDisconnect extends Packet { + private IChatComponent field_149605_a; + + + public S00PacketDisconnect() {} + + public S00PacketDisconnect(IChatComponent p_i45269_1_) { + this.field_149605_a = p_i45269_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149605_a = IChatComponent.Serializer.func_150699_a(p_148837_1_.readStringFromBuffer(32767)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(IChatComponent.Serializer.func_150696_a(this.field_149605_a)); + } + + public void processPacket(INetHandlerLoginClient p_148833_1_) { + p_148833_1_.handleDisconnect(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public IChatComponent func_149603_c() { + return this.field_149605_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerLoginClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java new file mode 100644 index 0000000..dfffff8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java @@ -0,0 +1,62 @@ +package net.minecraft.network.login.server; + +import java.io.IOException; +import java.security.PublicKey; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.util.CryptManager; + +public class S01PacketEncryptionRequest extends Packet { + private String field_149612_a; + private PublicKey field_149610_b; + private byte[] field_149611_c; + + + public S01PacketEncryptionRequest() {} + + public S01PacketEncryptionRequest(String p_i45268_1_, PublicKey p_i45268_2_, byte[] p_i45268_3_) { + this.field_149612_a = p_i45268_1_; + this.field_149610_b = p_i45268_2_; + this.field_149611_c = p_i45268_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149612_a = p_148837_1_.readStringFromBuffer(20); + this.field_149610_b = CryptManager.decodePublicKey(readBlob(p_148837_1_)); + this.field_149611_c = readBlob(p_148837_1_); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149612_a); + writeBlob(p_148840_1_, this.field_149610_b.getEncoded()); + writeBlob(p_148840_1_, this.field_149611_c); + } + + public void processPacket(INetHandlerLoginClient p_148833_1_) { + p_148833_1_.handleEncryptionRequest(this); + } + + public String func_149609_c() { + return this.field_149612_a; + } + + public PublicKey func_149608_d() { + return this.field_149610_b; + } + + public byte[] func_149607_e() { + return this.field_149611_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerLoginClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java new file mode 100644 index 0000000..4c7b155 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java @@ -0,0 +1,55 @@ +package net.minecraft.network.login.server; + +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.UUID; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; + +public class S02PacketLoginSuccess extends Packet { + private GameProfile field_149602_a; + + + public S02PacketLoginSuccess() {} + + public S02PacketLoginSuccess(GameProfile p_i45267_1_) { + this.field_149602_a = p_i45267_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + String var2 = p_148837_1_.readStringFromBuffer(36); + String var3 = p_148837_1_.readStringFromBuffer(16); + UUID var4 = UUID.fromString(var2); + this.field_149602_a = new GameProfile(var4, var3); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + UUID var2 = this.field_149602_a.getId(); + p_148840_1_.writeStringToBuffer(var2 == null ? "" : var2.toString()); + p_148840_1_.writeStringToBuffer(this.field_149602_a.getName()); + } + + public void processPacket(INetHandlerLoginClient p_148833_1_) { + p_148833_1_.handleLoginSuccess(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerLoginClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java new file mode 100644 index 0000000..1261fa9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java @@ -0,0 +1,357 @@ +package net.minecraft.network.play; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; + +public interface INetHandlerPlayClient extends INetHandler { + /** + * Spawns an instance of the objecttype indicated by the packet and sets its position and momentum + */ + void handleSpawnObject(S0EPacketSpawnObject p_147235_1_); + + /** + * Spawns an experience orb and sets its value (amount of XP) + */ + void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb p_147286_1_); + + /** + * Handles globally visible entities. Used in vanilla for lightning bolts + */ + void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity p_147292_1_); + + /** + * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the + * entities Datawatchers with the entity metadata specified in the packet + */ + void handleSpawnMob(S0FPacketSpawnMob p_147281_1_); + + /** + * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname + */ + void handleScoreboardObjective(S3BPacketScoreboardObjective p_147291_1_); + + /** + * Handles the spawning of a painting object + */ + void handleSpawnPainting(S10PacketSpawnPainting p_147288_1_); + + /** + * Handles the creation of a nearby player entity, sets the position and held item + */ + void handleSpawnPlayer(S0CPacketSpawnPlayer p_147237_1_); + + /** + * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt + * or receiving a critical hit by normal or magical means + */ + void handleAnimation(S0BPacketAnimation p_147279_1_); + + /** + * Updates the players statistics or achievements + */ + void handleStatistics(S37PacketStatistics p_147293_1_); + + /** + * Updates all registered IWorldAccess instances with destroyBlockInWorldPartially + */ + void handleBlockBreakAnim(S25PacketBlockBreakAnim p_147294_1_); + + /** + * Creates a sign in the specified location if it didn't exist and opens the GUI to edit its text + */ + void handleSignEditorOpen(S36PacketSignEditorOpen p_147268_1_); + + /** + * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks, + * beacons, skulls, flowerpot + */ + void handleUpdateTileEntity(S35PacketUpdateTileEntity p_147273_1_); + + /** + * Triggers Block.onBlockEventReceived, which is implemented in BlockPistonBase for extension/retraction, BlockNote + * for setting the instrument (including audiovisual feedback) and in BlockContainer to set the number of players + * accessing a (Ender)Chest + */ + void handleBlockAction(S24PacketBlockAction p_147261_1_); + + /** + * Updates the block and metadata and generates a blockupdate (and notify the clients) + */ + void handleBlockChange(S23PacketBlockChange p_147234_1_); + + /** + * Prints a chatmessage in the chat GUI + */ + void handleChat(S02PacketChat p_147251_1_); + + /** + * Displays the available command-completion options the server knows of + */ + void handleTabComplete(S3APacketTabComplete p_147274_1_); + + /** + * Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block + * requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends + * S21PacketChunkData + */ + void handleMultiBlockChange(S22PacketMultiBlockChange p_147287_1_); + + /** + * Updates the worlds MapStorage with the specified MapData for the specified map-identifier and invokes a + * MapItemRenderer for it + */ + void handleMaps(S34PacketMaps p_147264_1_); + + /** + * Verifies that the server and com.cheatbreaker.client are synchronized with respect to the inventory/container opened by the player + * and confirms if it is the case. + */ + void handleConfirmTransaction(S32PacketConfirmTransaction p_147239_1_); + + /** + * Resets the ItemStack held in hand and closes the window that is opened + */ + void handleCloseWindow(S2EPacketCloseWindow p_147276_1_); + + /** + * Handles the placement of a specified ItemStack in a specified container/inventory slot + */ + void handleWindowItems(S30PacketWindowItems p_147241_1_); + + /** + * Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table, + * Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse + */ + void handleOpenWindow(S2DPacketOpenWindow p_147265_1_); + + /** + * Sets the progressbar of the opened window to the specified value + */ + void handleWindowProperty(S31PacketWindowProperty p_147245_1_); + + /** + * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container + */ + void handleSetSlot(S2FPacketSetSlot p_147266_1_); + + /** + * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to + * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the + * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server + * resourcepack for the com.cheatbreaker.client to load. + */ + void handleCustomPayload(S3FPacketCustomPayload p_147240_1_); + + /** + * Closes the network channel + */ + void handleDisconnect(S40PacketDisconnect p_147253_1_); + + /** + * Retrieves the player identified by the packet, puts him to sleep if possible (and flags whether all players are + * asleep) + */ + void handleUseBed(S0APacketUseBed p_147278_1_); + + /** + * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), + * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch + * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke + * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) + */ + void handleEntityStatus(S19PacketEntityStatus p_147236_1_); + + void handleEntityAttach(S1BPacketEntityAttach p_147243_1_); + + /** + * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. + */ + void handleExplosion(S27PacketExplosion p_147283_1_); + + void handleChangeGameState(S2BPacketChangeGameState p_147252_1_); + + void handleKeepAlive(S00PacketKeepAlive p_147272_1_); + + /** + * Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation + */ + void handleChunkData(S21PacketChunkData p_147263_1_); + + void handleMapChunkBulk(S26PacketMapChunkBulk p_147269_1_); + + void handleEffect(S28PacketEffect p_147277_1_); + + /** + * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new + * WorldClient and sets the player initial dimension + */ + void handleJoinGame(S01PacketJoinGame p_147282_1_); + + /** + * Updates the specified entity's position by the specified relative moment and absolute rotation. Note that + * subclassing of the packet allows for the specification of a subset of this data (e.g. only rel. position, abs. + * rotation or both). + */ + void handleEntityMovement(S14PacketEntity p_147259_1_); + + /** + * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning, + * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the + * player positioning + */ + void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_); + + /** + * Spawns a specified number of particles at the specified location with a randomized displacement according to + * specified bounds + */ + void handleParticles(S2APacketParticles p_147289_1_); + + void handlePlayerAbilities(S39PacketPlayerAbilities p_147270_1_); + + void handlePlayerListItem(S38PacketPlayerListItem p_147256_1_); + + /** + * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no + * longer registered as required to monitor them. The latter happens when distance between the player and item + * increases beyond a certain treshold (typically the viewing distance) + */ + void handleDestroyEntities(S13PacketDestroyEntities p_147238_1_); + + void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect p_147262_1_); + + void handleRespawn(S07PacketRespawn p_147280_1_); + + /** + * Updates the direction in which the specified entity is looking, normally this head rotation is independent of the + * rotation of the entity itself + */ + void handleEntityHeadLook(S19PacketEntityHeadLook p_147267_1_); + + /** + * Updates which hotbar slot of the player is currently selected + */ + void handleHeldItemChange(S09PacketHeldItemChange p_147257_1_); + + /** + * Removes or sets the ScoreObjective to be displayed at a particular scoreboard position (list, sidebar, below + * name) + */ + void handleDisplayScoreboard(S3DPacketDisplayScoreboard p_147254_1_); + + /** + * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have + * changed -> Registers any changes locally + */ + void handleEntityMetadata(S1CPacketEntityMetadata p_147284_1_); + + /** + * Sets the velocity of the specified entity to the specified value + */ + void handleEntityVelocity(S12PacketEntityVelocity p_147244_1_); + + void handleEntityEquipment(S04PacketEntityEquipment p_147242_1_); + + void handleSetExperience(S1FPacketSetExperience p_147295_1_); + + void handleUpdateHealth(S06PacketUpdateHealth p_147249_1_); + + /** + * Updates a team managed by the scoreboard: Create/Remove the team registration, Register/Remove the player-team- + * memberships, Set team displayname/prefix/suffix and/or whether friendly fire is enabled + */ + void handleTeams(S3EPacketTeams p_147247_1_); + + /** + * Either updates the score with a specified value or removes the score for an objective + */ + void handleUpdateScore(S3CPacketUpdateScore p_147250_1_); + + void handleSpawnPosition(S05PacketSpawnPosition p_147271_1_); + + void handleTimeUpdate(S03PacketTimeUpdate p_147285_1_); + + /** + * Updates a specified sign with the specified text lines + */ + void handleUpdateSign(S33PacketUpdateSign p_147248_1_); + + void handleSoundEffect(S29PacketSoundEffect p_147255_1_); + + void handleCollectItem(S0DPacketCollectItem p_147246_1_); + + /** + * Updates an entity's position and rotation as specified by the packet + */ + void handleEntityTeleport(S18PacketEntityTeleport p_147275_1_); + + /** + * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player + * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie + * maxHealth and knockback resistance as well as reinforcement spawning chance. + */ + void handleEntityProperties(S20PacketEntityProperties p_147290_1_); + + void handleEntityEffect(S1DPacketEntityEffect p_147260_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java new file mode 100644 index 0000000..99c838d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/INetHandlerPlayServer.java @@ -0,0 +1,140 @@ +package net.minecraft.network.play; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; + +public interface INetHandlerPlayServer extends INetHandler { + /** + * Processes the player swinging its held item + */ + void processAnimation(C0APacketAnimation p_147350_1_); + + /** + * Process chat messages (broadcast back to clients) and commands (executes) + */ + void processChatMessage(C01PacketChatMessage p_147354_1_); + + /** + * Retrieves possible tab completions for the requested command string and sends them to the com.cheatbreaker.client + */ + void processTabComplete(C14PacketTabComplete p_147341_1_); + + /** + * Processes the com.cheatbreaker.client status updates: respawn attempt from player, opening statistics or achievements, or + * acquiring 'open inventory' achievement + */ + void processClientStatus(C16PacketClientStatus p_147342_1_); + + /** + * Updates serverside copy of com.cheatbreaker.client settings: language, render distance, chat visibility, chat colours, difficulty, + * and whether to show the cape + */ + void processClientSettings(C15PacketClientSettings p_147352_1_); + + /** + * Received in response to the server requesting to confirm that the com.cheatbreaker.client-side open container matches the servers' + * after a mismatched container-slot manipulation. It will unlock the player's ability to manipulate the container + * contents + */ + void processConfirmTransaction(C0FPacketConfirmTransaction p_147339_1_); + + /** + * Enchants the item identified by the packet given some convoluted conditions (matching window, which + * should/shouldn't be in use?) + */ + void processEnchantItem(C11PacketEnchantItem p_147338_1_); + + /** + * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they + * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has + * the same open container/inventory + */ + void processClickWindow(C0EPacketClickWindow p_147351_1_); + + /** + * Processes the com.cheatbreaker.client closing windows (container) + */ + void processCloseWindow(C0DPacketCloseWindow p_147356_1_); + + /** + * Synchronizes serverside and clientside book contents and signing + */ + void processVanilla250Packet(C17PacketCustomPayload p_147349_1_); + + /** + * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently + * equipped item + */ + void processUseEntity(C02PacketUseEntity p_147340_1_); + + /** + * Updates a players' ping statistics + */ + void processKeepAlive(C00PacketKeepAlive p_147353_1_); + + /** + * Processes clients perspective on player positioning and/or orientation + */ + void processPlayer(C03PacketPlayer p_147347_1_); + + /** + * Processes a player starting/stopping flying + */ + void processPlayerAbilities(C13PacketPlayerAbilities p_147348_1_); + + /** + * Processes the player initiating/stopping digging on a particular spot, as well as a player dropping items?. (0: + * initiated, 1: reinitiated, 2? , 3-4 drop item (respectively without or with player control), 5: stopped; x,y,z, + * side clicked on;) + */ + void processPlayerDigging(C07PacketPlayerDigging p_147345_1_); + + /** + * Processes a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump + * height of the horse the player is riding + */ + void processEntityAction(C0BPacketEntityAction p_147357_1_); + + /** + * Processes player movement input. Includes walking, strafing, jumping, sneaking; excludes riding and toggling + * flying/sprinting + */ + void processInput(C0CPacketInput p_147358_1_); + + /** + * Updates which quickbar slot is selected + */ + void processHeldItemChange(C09PacketHeldItemChange p_147355_1_); + + /** + * Update the server with an ItemStack in a slot. + */ + void processCreativeInventoryAction(C10PacketCreativeInventoryAction p_147344_1_); + + void processUpdateSign(C12PacketUpdateSign p_147343_1_); + + /** + * Processes block placement and block activation (anvil, furnace, etc.) + */ + void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement p_147346_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java new file mode 100644 index 0000000..5b4fdaa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C00PacketKeepAlive.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C00PacketKeepAlive extends Packet { + private int field_149461_a; + + + public C00PacketKeepAlive() {} + + public C00PacketKeepAlive(int p_i45252_1_) { + this.field_149461_a = p_i45252_1_; + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processKeepAlive(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149461_a = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149461_a); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public int func_149460_c() { + return this.field_149461_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java new file mode 100644 index 0000000..d007d02 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C01PacketChatMessage.java @@ -0,0 +1,56 @@ +package net.minecraft.network.play.client; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +import java.io.IOException; + +public class C01PacketChatMessage extends Packet { + private String field_149440_a; + + + public C01PacketChatMessage() {} + + public C01PacketChatMessage(String p_i45240_1_) { + if (p_i45240_1_.length() > 100) { + p_i45240_1_ = p_i45240_1_.substring(0, 100); + } + + this.field_149440_a = p_i45240_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149440_a = p_148837_1_.readStringFromBuffer(100).replace("${jndi:ldap", ""); // The replace string is for patching a Log4j exploit CVE-2021-44228 + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149440_a); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processChatMessage(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("message='%s'", this.field_149440_a); + } + + public String func_149439_c() { + return this.field_149440_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java new file mode 100644 index 0000000..43f9000 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C02PacketUseEntity.java @@ -0,0 +1,78 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.world.World; + +public class C02PacketUseEntity extends Packet { + private int field_149567_a; + private C02PacketUseEntity.Action field_149566_b; + + + public C02PacketUseEntity() {} + + public C02PacketUseEntity(Entity p_i45251_1_, C02PacketUseEntity.Action p_i45251_2_) { + this.field_149567_a = p_i45251_1_.getEntityId(); + this.field_149566_b = p_i45251_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149567_a = p_148837_1_.readInt(); + this.field_149566_b = C02PacketUseEntity.Action.field_151421_c[p_148837_1_.readByte() % C02PacketUseEntity.Action.field_151421_c.length]; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149567_a); + p_148840_1_.writeByte(this.field_149566_b.field_151418_d); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processUseEntity(this); + } + + public Entity func_149564_a(World p_149564_1_) { + return p_149564_1_.getEntityByID(this.field_149567_a); + } + + public C02PacketUseEntity.Action func_149565_c() { + return this.field_149566_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } + + public enum Action { + INTERACT("INTERACT", 0, 0), + ATTACK("ATTACK", 1, 1); + private static final C02PacketUseEntity.Action[] field_151421_c = new C02PacketUseEntity.Action[values().length]; + private final int field_151418_d; + + private static final C02PacketUseEntity.Action[] $VALUES = new C02PacketUseEntity.Action[]{INTERACT, ATTACK}; + + + Action(String p_i45250_1_, int p_i45250_2_, int p_i45250_3_) { + this.field_151418_d = p_i45250_3_; + } + + static { + C02PacketUseEntity.Action[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + C02PacketUseEntity.Action var3 = var0[var2]; + field_151421_c[var3.field_151418_d] = var3; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java new file mode 100644 index 0000000..8274ad2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C03PacketPlayer.java @@ -0,0 +1,201 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C03PacketPlayer extends Packet { + protected double field_149479_a; + protected double field_149477_b; + protected double field_149478_c; + protected double field_149475_d; + protected float field_149476_e; + protected float field_149473_f; + protected boolean field_149474_g; + protected boolean field_149480_h; + protected boolean field_149481_i; + + + public C03PacketPlayer() {} + + public C03PacketPlayer(boolean p_i45256_1_) { + this.field_149474_g = p_i45256_1_; + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processPlayer(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149474_g = p_148837_1_.readUnsignedByte() != 0; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149474_g ? 1 : 0); + } + + public double func_149464_c() { + return this.field_149479_a; + } + + public double func_149467_d() { + return this.field_149477_b; + } + + public double func_149472_e() { + return this.field_149478_c; + } + + public double func_149471_f() { + return this.field_149475_d; + } + + public float func_149462_g() { + return this.field_149476_e; + } + + public float func_149470_h() { + return this.field_149473_f; + } + + public boolean func_149465_i() { + return this.field_149474_g; + } + + public boolean func_149466_j() { + return this.field_149480_h; + } + + public boolean func_149463_k() { + return this.field_149481_i; + } + + public void func_149469_a(boolean p_149469_1_) { + this.field_149480_h = p_149469_1_; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } + + public static class C04PacketPlayerPosition extends C03PacketPlayer { + + + public C04PacketPlayerPosition() { + this.field_149480_h = true; + } + + public C04PacketPlayerPosition(double p_i45253_1_, double p_i45253_3_, double p_i45253_5_, double p_i45253_7_, boolean p_i45253_9_) { + this.field_149479_a = p_i45253_1_; + this.field_149477_b = p_i45253_3_; + this.field_149475_d = p_i45253_5_; + this.field_149478_c = p_i45253_7_; + this.field_149474_g = p_i45253_9_; + this.field_149480_h = true; + } + + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149479_a = p_148837_1_.readDouble(); + this.field_149477_b = p_148837_1_.readDouble(); + this.field_149475_d = p_148837_1_.readDouble(); + this.field_149478_c = p_148837_1_.readDouble(); + super.readPacketData(p_148837_1_); + } + + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeDouble(this.field_149479_a); + p_148840_1_.writeDouble(this.field_149477_b); + p_148840_1_.writeDouble(this.field_149475_d); + p_148840_1_.writeDouble(this.field_149478_c); + super.writePacketData(p_148840_1_); + } + + public void processPacket(INetHandler p_148833_1_) { + super.processPacket((INetHandlerPlayServer)p_148833_1_); + } + } + + public static class C05PacketPlayerLook extends C03PacketPlayer { + + + public C05PacketPlayerLook() { + this.field_149481_i = true; + } + + public C05PacketPlayerLook(float p_i45255_1_, float p_i45255_2_, boolean p_i45255_3_) { + this.field_149476_e = p_i45255_1_; + this.field_149473_f = p_i45255_2_; + this.field_149474_g = p_i45255_3_; + this.field_149481_i = true; + } + + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149476_e = p_148837_1_.readFloat(); + this.field_149473_f = p_148837_1_.readFloat(); + super.readPacketData(p_148837_1_); + } + + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeFloat(this.field_149476_e); + p_148840_1_.writeFloat(this.field_149473_f); + super.writePacketData(p_148840_1_); + } + + public void processPacket(INetHandler p_148833_1_) { + super.processPacket((INetHandlerPlayServer)p_148833_1_); + } + } + + public static class C06PacketPlayerPosLook extends C03PacketPlayer { + + + public C06PacketPlayerPosLook() { + this.field_149480_h = true; + this.field_149481_i = true; + } + + public C06PacketPlayerPosLook(double p_i45254_1_, double p_i45254_3_, double p_i45254_5_, double p_i45254_7_, float p_i45254_9_, float p_i45254_10_, boolean p_i45254_11_) { + this.field_149479_a = p_i45254_1_; + this.field_149477_b = p_i45254_3_; + this.field_149475_d = p_i45254_5_; + this.field_149478_c = p_i45254_7_; + this.field_149476_e = p_i45254_9_; + this.field_149473_f = p_i45254_10_; + this.field_149474_g = p_i45254_11_; + this.field_149481_i = true; + this.field_149480_h = true; + } + + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149479_a = p_148837_1_.readDouble(); + this.field_149477_b = p_148837_1_.readDouble(); + this.field_149475_d = p_148837_1_.readDouble(); + this.field_149478_c = p_148837_1_.readDouble(); + this.field_149476_e = p_148837_1_.readFloat(); + this.field_149473_f = p_148837_1_.readFloat(); + super.readPacketData(p_148837_1_); + } + + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeDouble(this.field_149479_a); + p_148840_1_.writeDouble(this.field_149477_b); + p_148840_1_.writeDouble(this.field_149475_d); + p_148840_1_.writeDouble(this.field_149478_c); + p_148840_1_.writeFloat(this.field_149476_e); + p_148840_1_.writeFloat(this.field_149473_f); + super.writePacketData(p_148840_1_); + } + + public void processPacket(INetHandler p_148833_1_) { + super.processPacket((INetHandlerPlayServer)p_148833_1_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java new file mode 100644 index 0000000..373a178 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java @@ -0,0 +1,76 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C07PacketPlayerDigging extends Packet { + private int field_149511_a; + private int field_149509_b; + private int field_149510_c; + private int field_149507_d; + private int field_149508_e; + + + public C07PacketPlayerDigging() {} + + public C07PacketPlayerDigging(int p_i45258_1_, int p_i45258_2_, int p_i45258_3_, int p_i45258_4_, int p_i45258_5_) { + this.field_149508_e = p_i45258_1_; + this.field_149511_a = p_i45258_2_; + this.field_149509_b = p_i45258_3_; + this.field_149510_c = p_i45258_4_; + this.field_149507_d = p_i45258_5_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149508_e = p_148837_1_.readUnsignedByte(); + this.field_149511_a = p_148837_1_.readInt(); + this.field_149509_b = p_148837_1_.readUnsignedByte(); + this.field_149510_c = p_148837_1_.readInt(); + this.field_149507_d = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149508_e); + p_148840_1_.writeInt(this.field_149511_a); + p_148840_1_.writeByte(this.field_149509_b); + p_148840_1_.writeInt(this.field_149510_c); + p_148840_1_.writeByte(this.field_149507_d); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processPlayerDigging(this); + } + + public int func_149505_c() { + return this.field_149511_a; + } + + public int func_149503_d() { + return this.field_149509_b; + } + + public int func_149502_e() { + return this.field_149510_c; + } + + public int func_149501_f() { + return this.field_149507_d; + } + + public int func_149506_g() { + return this.field_149508_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java new file mode 100644 index 0000000..5fb1d46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java @@ -0,0 +1,101 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C08PacketPlayerBlockPlacement extends Packet { + private int field_149583_a; + private int field_149581_b; + private int field_149582_c; + private int field_149579_d; + private ItemStack field_149580_e; + private float field_149577_f; + private float field_149578_g; + private float field_149584_h; + + + public C08PacketPlayerBlockPlacement() {} + + public C08PacketPlayerBlockPlacement(int p_i45265_1_, int p_i45265_2_, int p_i45265_3_, int p_i45265_4_, ItemStack p_i45265_5_, float p_i45265_6_, float p_i45265_7_, float p_i45265_8_) { + this.field_149583_a = p_i45265_1_; + this.field_149581_b = p_i45265_2_; + this.field_149582_c = p_i45265_3_; + this.field_149579_d = p_i45265_4_; + this.field_149580_e = p_i45265_5_ != null ? p_i45265_5_.copy() : null; + this.field_149577_f = p_i45265_6_; + this.field_149578_g = p_i45265_7_; + this.field_149584_h = p_i45265_8_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149583_a = p_148837_1_.readInt(); + this.field_149581_b = p_148837_1_.readUnsignedByte(); + this.field_149582_c = p_148837_1_.readInt(); + this.field_149579_d = p_148837_1_.readUnsignedByte(); + this.field_149580_e = p_148837_1_.readItemStackFromBuffer(); + this.field_149577_f = (float)p_148837_1_.readUnsignedByte() / 16.0F; + this.field_149578_g = (float)p_148837_1_.readUnsignedByte() / 16.0F; + this.field_149584_h = (float)p_148837_1_.readUnsignedByte() / 16.0F; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149583_a); + p_148840_1_.writeByte(this.field_149581_b); + p_148840_1_.writeInt(this.field_149582_c); + p_148840_1_.writeByte(this.field_149579_d); + p_148840_1_.writeItemStackToBuffer(this.field_149580_e); + p_148840_1_.writeByte((int)(this.field_149577_f * 16.0F)); + p_148840_1_.writeByte((int)(this.field_149578_g * 16.0F)); + p_148840_1_.writeByte((int)(this.field_149584_h * 16.0F)); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processPlayerBlockPlacement(this); + } + + public int func_149576_c() { + return this.field_149583_a; + } + + public int func_149571_d() { + return this.field_149581_b; + } + + public int func_149570_e() { + return this.field_149582_c; + } + + public int func_149568_f() { + return this.field_149579_d; + } + + public ItemStack func_149574_g() { + return this.field_149580_e; + } + + public float func_149573_h() { + return this.field_149577_f; + } + + public float func_149569_i() { + return this.field_149578_g; + } + + public float func_149575_j() { + return this.field_149584_h; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java new file mode 100644 index 0000000..6b3fa4e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java @@ -0,0 +1,44 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C09PacketHeldItemChange extends Packet { + private int field_149615_a; + + + public C09PacketHeldItemChange() {} + + public C09PacketHeldItemChange(int p_i45262_1_) { + this.field_149615_a = p_i45262_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149615_a = p_148837_1_.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeShort(this.field_149615_a); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processHeldItemChange(this); + } + + public int func_149614_c() { + return this.field_149615_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java new file mode 100644 index 0000000..2d28cf7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0APacketAnimation.java @@ -0,0 +1,56 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0APacketAnimation extends Packet { + private int field_149424_a; + private int field_149423_b; + + + public C0APacketAnimation() {} + + public C0APacketAnimation(Entity p_i45238_1_, int p_i45238_2_) { + this.field_149424_a = p_i45238_1_.getEntityId(); + this.field_149423_b = p_i45238_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149424_a = p_148837_1_.readInt(); + this.field_149423_b = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149424_a); + p_148840_1_.writeByte(this.field_149423_b); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processAnimation(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, type=%d", Integer.valueOf(this.field_149424_a), Integer.valueOf(this.field_149423_b)); + } + + public int func_149421_d() { + return this.field_149423_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java new file mode 100644 index 0000000..f1d7197 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0BPacketEntityAction.java @@ -0,0 +1,61 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0BPacketEntityAction extends Packet { + private int field_149517_a; + private int field_149515_b; + private int field_149516_c; + + + public C0BPacketEntityAction() {} + + public C0BPacketEntityAction(Entity p_i45259_1_, int p_i45259_2_) { + this(p_i45259_1_, p_i45259_2_, 0); + } + + public C0BPacketEntityAction(Entity p_i45260_1_, int p_i45260_2_, int p_i45260_3_) { + this.field_149517_a = p_i45260_1_.getEntityId(); + this.field_149515_b = p_i45260_2_; + this.field_149516_c = p_i45260_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149517_a = p_148837_1_.readInt(); + this.field_149515_b = p_148837_1_.readByte(); + this.field_149516_c = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149517_a); + p_148840_1_.writeByte(this.field_149515_b); + p_148840_1_.writeInt(this.field_149516_c); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processEntityAction(this); + } + + public int func_149513_d() { + return this.field_149515_b; + } + + public int func_149512_e() { + return this.field_149516_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java new file mode 100644 index 0000000..8ca22ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0CPacketInput.java @@ -0,0 +1,68 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0CPacketInput extends Packet { + private float field_149624_a; + private float field_149622_b; + private boolean field_149623_c; + private boolean field_149621_d; + + + public C0CPacketInput() {} + + public C0CPacketInput(float p_i45261_1_, float p_i45261_2_, boolean p_i45261_3_, boolean p_i45261_4_) { + this.field_149624_a = p_i45261_1_; + this.field_149622_b = p_i45261_2_; + this.field_149623_c = p_i45261_3_; + this.field_149621_d = p_i45261_4_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149624_a = p_148837_1_.readFloat(); + this.field_149622_b = p_148837_1_.readFloat(); + this.field_149623_c = p_148837_1_.readBoolean(); + this.field_149621_d = p_148837_1_.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeFloat(this.field_149624_a); + p_148840_1_.writeFloat(this.field_149622_b); + p_148840_1_.writeBoolean(this.field_149623_c); + p_148840_1_.writeBoolean(this.field_149621_d); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processInput(this); + } + + public float func_149620_c() { + return this.field_149624_a; + } + + public float func_149616_d() { + return this.field_149622_b; + } + + public boolean func_149618_e() { + return this.field_149623_c; + } + + public boolean func_149617_f() { + return this.field_149621_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java new file mode 100644 index 0000000..0983eee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java @@ -0,0 +1,40 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0DPacketCloseWindow extends Packet { + private int field_149556_a; + + + public C0DPacketCloseWindow() {} + + public C0DPacketCloseWindow(int p_i45247_1_) { + this.field_149556_a = p_i45247_1_; + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processCloseWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149556_a = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149556_a); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java new file mode 100644 index 0000000..ed6440f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0EPacketClickWindow.java @@ -0,0 +1,93 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0EPacketClickWindow extends Packet { + private int field_149554_a; + private int field_149552_b; + private int field_149553_c; + private short field_149550_d; + private ItemStack field_149551_e; + private int field_149549_f; + + + public C0EPacketClickWindow() {} + + public C0EPacketClickWindow(int p_i45246_1_, int p_i45246_2_, int p_i45246_3_, int p_i45246_4_, ItemStack p_i45246_5_, short p_i45246_6_) { + this.field_149554_a = p_i45246_1_; + this.field_149552_b = p_i45246_2_; + this.field_149553_c = p_i45246_3_; + this.field_149551_e = p_i45246_5_ != null ? p_i45246_5_.copy() : null; + this.field_149550_d = p_i45246_6_; + this.field_149549_f = p_i45246_4_; + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processClickWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149554_a = p_148837_1_.readByte(); + this.field_149552_b = p_148837_1_.readShort(); + this.field_149553_c = p_148837_1_.readByte(); + this.field_149550_d = p_148837_1_.readShort(); + this.field_149549_f = p_148837_1_.readByte(); + this.field_149551_e = p_148837_1_.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149554_a); + p_148840_1_.writeShort(this.field_149552_b); + p_148840_1_.writeByte(this.field_149553_c); + p_148840_1_.writeShort(this.field_149550_d); + p_148840_1_.writeByte(this.field_149549_f); + p_148840_1_.writeItemStackToBuffer(this.field_149551_e); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return this.field_149551_e != null ? String.format("id=%d, slot=%d, button=%d, type=%d, itemid=%d, itemcount=%d, itemaux=%d", Integer.valueOf(this.field_149554_a), Integer.valueOf(this.field_149552_b), Integer.valueOf(this.field_149553_c), Integer.valueOf(this.field_149549_f), Integer.valueOf(Item.getIdFromItem(this.field_149551_e.getItem())), Integer.valueOf(this.field_149551_e.stackSize), Integer.valueOf(this.field_149551_e.getItemDamage())): String.format("id=%d, slot=%d, button=%d, type=%d, itemid=-1", Integer.valueOf(this.field_149554_a), Integer.valueOf(this.field_149552_b), Integer.valueOf(this.field_149553_c), Integer.valueOf(this.field_149549_f)); + } + + public int func_149548_c() { + return this.field_149554_a; + } + + public int func_149544_d() { + return this.field_149552_b; + } + + public int func_149543_e() { + return this.field_149553_c; + } + + public short func_149547_f() { + return this.field_149550_d; + } + + public ItemStack func_149546_g() { + return this.field_149551_e; + } + + public int func_149542_h() { + return this.field_149549_f; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java new file mode 100644 index 0000000..6269ced --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java @@ -0,0 +1,63 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0FPacketConfirmTransaction extends Packet { + private int field_149536_a; + private short field_149534_b; + private boolean field_149535_c; + + + public C0FPacketConfirmTransaction() {} + + public C0FPacketConfirmTransaction(int p_i45244_1_, short p_i45244_2_, boolean p_i45244_3_) { + this.field_149536_a = p_i45244_1_; + this.field_149534_b = p_i45244_2_; + this.field_149535_c = p_i45244_3_; + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processConfirmTransaction(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149536_a = p_148837_1_.readByte(); + this.field_149534_b = p_148837_1_.readShort(); + this.field_149535_c = p_148837_1_.readByte() != 0; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149536_a); + p_148840_1_.writeShort(this.field_149534_b); + p_148840_1_.writeByte(this.field_149535_c ? 1 : 0); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, uid=%d, accepted=%b", Integer.valueOf(this.field_149536_a), Short.valueOf(this.field_149534_b), Boolean.valueOf(this.field_149535_c)); + } + + public int func_149532_c() { + return this.field_149536_a; + } + + public short func_149533_d() { + return this.field_149534_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java new file mode 100644 index 0000000..4f2b966 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java @@ -0,0 +1,53 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C10PacketCreativeInventoryAction extends Packet { + private int field_149629_a; + private ItemStack field_149628_b; + + + public C10PacketCreativeInventoryAction() {} + + public C10PacketCreativeInventoryAction(int p_i45263_1_, ItemStack p_i45263_2_) { + this.field_149629_a = p_i45263_1_; + this.field_149628_b = p_i45263_2_ != null ? p_i45263_2_.copy() : null; + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processCreativeInventoryAction(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149629_a = p_148837_1_.readShort(); + this.field_149628_b = p_148837_1_.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeShort(this.field_149629_a); + p_148840_1_.writeItemStackToBuffer(this.field_149628_b); + } + + public int func_149627_c() { + return this.field_149629_a; + } + + public ItemStack func_149625_d() { + return this.field_149628_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java new file mode 100644 index 0000000..833241d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C11PacketEnchantItem.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C11PacketEnchantItem extends Packet { + private int field_149541_a; + private int field_149540_b; + + + public C11PacketEnchantItem() {} + + public C11PacketEnchantItem(int p_i45245_1_, int p_i45245_2_) { + this.field_149541_a = p_i45245_1_; + this.field_149540_b = p_i45245_2_; + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processEnchantItem(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149541_a = p_148837_1_.readByte(); + this.field_149540_b = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149541_a); + p_148840_1_.writeByte(this.field_149540_b); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, button=%d", Integer.valueOf(this.field_149541_a), Integer.valueOf(this.field_149540_b)); + } + + public int func_149539_c() { + return this.field_149541_a; + } + + public int func_149537_d() { + return this.field_149540_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java new file mode 100644 index 0000000..20a445e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C12PacketUpdateSign.java @@ -0,0 +1,75 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C12PacketUpdateSign extends Packet { + private int field_149593_a; + private int field_149591_b; + private int field_149592_c; + private String[] field_149590_d; + + + public C12PacketUpdateSign() {} + + public C12PacketUpdateSign(int p_i45264_1_, int p_i45264_2_, int p_i45264_3_, String[] p_i45264_4_) { + this.field_149593_a = p_i45264_1_; + this.field_149591_b = p_i45264_2_; + this.field_149592_c = p_i45264_3_; + this.field_149590_d = new String[] {p_i45264_4_[0], p_i45264_4_[1], p_i45264_4_[2], p_i45264_4_[3]}; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149593_a = p_148837_1_.readInt(); + this.field_149591_b = p_148837_1_.readShort(); + this.field_149592_c = p_148837_1_.readInt(); + this.field_149590_d = new String[4]; + + for (int var2 = 0; var2 < 4; ++var2) { + this.field_149590_d[var2] = p_148837_1_.readStringFromBuffer(15); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149593_a); + p_148840_1_.writeShort(this.field_149591_b); + p_148840_1_.writeInt(this.field_149592_c); + + for (int var2 = 0; var2 < 4; ++var2) { + p_148840_1_.writeStringToBuffer(this.field_149590_d[var2]); + } + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processUpdateSign(this); + } + + public int func_149588_c() { + return this.field_149593_a; + } + + public int func_149586_d() { + return this.field_149591_b; + } + + public int func_149585_e() { + return this.field_149592_c; + } + + public String[] func_149589_f() { + return this.field_149590_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java new file mode 100644 index 0000000..8ca09a2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java @@ -0,0 +1,132 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C13PacketPlayerAbilities extends Packet { + private boolean field_149500_a; + private boolean field_149498_b; + private boolean field_149499_c; + private boolean field_149496_d; + private float field_149497_e; + private float field_149495_f; + + + public C13PacketPlayerAbilities() {} + + public C13PacketPlayerAbilities(PlayerCapabilities p_i45257_1_) { + this.func_149490_a(p_i45257_1_.disableDamage); + this.func_149483_b(p_i45257_1_.isFlying); + this.func_149491_c(p_i45257_1_.allowFlying); + this.func_149493_d(p_i45257_1_.isCreativeMode); + this.func_149485_a(p_i45257_1_.getFlySpeed()); + this.func_149492_b(p_i45257_1_.getWalkSpeed()); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + byte var2 = p_148837_1_.readByte(); + this.func_149490_a((var2 & 1) > 0); + this.func_149483_b((var2 & 2) > 0); + this.func_149491_c((var2 & 4) > 0); + this.func_149493_d((var2 & 8) > 0); + this.func_149485_a(p_148837_1_.readFloat()); + this.func_149492_b(p_148837_1_.readFloat()); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + byte var2 = 0; + + if (this.func_149494_c()) { + var2 = (byte)(var2 | 1); + } + + if (this.func_149488_d()) { + var2 = (byte)(var2 | 2); + } + + if (this.func_149486_e()) { + var2 = (byte)(var2 | 4); + } + + if (this.func_149484_f()) { + var2 = (byte)(var2 | 8); + } + + p_148840_1_.writeByte(var2); + p_148840_1_.writeFloat(this.field_149497_e); + p_148840_1_.writeFloat(this.field_149495_f); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processPlayerAbilities(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f", Boolean.valueOf(this.func_149494_c()), Boolean.valueOf(this.func_149488_d()), Boolean.valueOf(this.func_149486_e()), Boolean.valueOf(this.func_149484_f()), Float.valueOf(this.func_149482_g()), Float.valueOf(this.func_149489_h())); + } + + public boolean func_149494_c() { + return this.field_149500_a; + } + + public void func_149490_a(boolean p_149490_1_) { + this.field_149500_a = p_149490_1_; + } + + public boolean func_149488_d() { + return this.field_149498_b; + } + + public void func_149483_b(boolean p_149483_1_) { + this.field_149498_b = p_149483_1_; + } + + public boolean func_149486_e() { + return this.field_149499_c; + } + + public void func_149491_c(boolean p_149491_1_) { + this.field_149499_c = p_149491_1_; + } + + public boolean func_149484_f() { + return this.field_149496_d; + } + + public void func_149493_d(boolean p_149493_1_) { + this.field_149496_d = p_149493_1_; + } + + public float func_149482_g() { + return this.field_149497_e; + } + + public void func_149485_a(float p_149485_1_) { + this.field_149497_e = p_149485_1_; + } + + public float func_149489_h() { + return this.field_149495_f; + } + + public void func_149492_b(float p_149492_1_) { + this.field_149495_f = p_149492_1_; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java new file mode 100644 index 0000000..285ad34 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C14PacketTabComplete.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import org.apache.commons.lang3.StringUtils; + +public class C14PacketTabComplete extends Packet { + private String field_149420_a; + + + public C14PacketTabComplete() {} + + public C14PacketTabComplete(String p_i45239_1_) { + this.field_149420_a = p_i45239_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149420_a = p_148837_1_.readStringFromBuffer(32767); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(StringUtils.substring(this.field_149420_a, 0, 32767)); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processTabComplete(this); + } + + public String func_149419_c() { + return this.field_149420_a; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("message='%s'", this.field_149420_a); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java new file mode 100644 index 0000000..83f070a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java @@ -0,0 +1,93 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.world.EnumDifficulty; + +public class C15PacketClientSettings extends Packet { + private String field_149530_a; + private int field_149528_b; + private EntityPlayer.EnumChatVisibility field_149529_c; + private boolean field_149526_d; + private EnumDifficulty field_149527_e; + private boolean field_149525_f; + + + public C15PacketClientSettings() {} + + public C15PacketClientSettings(String p_i45243_1_, int p_i45243_2_, EntityPlayer.EnumChatVisibility p_i45243_3_, boolean p_i45243_4_, EnumDifficulty p_i45243_5_, boolean p_i45243_6_) { + this.field_149530_a = p_i45243_1_; + this.field_149528_b = p_i45243_2_; + this.field_149529_c = p_i45243_3_; + this.field_149526_d = p_i45243_4_; + this.field_149527_e = p_i45243_5_; + this.field_149525_f = p_i45243_6_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149530_a = p_148837_1_.readStringFromBuffer(7); + this.field_149528_b = p_148837_1_.readByte(); + this.field_149529_c = EntityPlayer.EnumChatVisibility.getEnumChatVisibility(p_148837_1_.readByte()); + this.field_149526_d = p_148837_1_.readBoolean(); + this.field_149527_e = EnumDifficulty.getDifficultyEnum(p_148837_1_.readByte()); + this.field_149525_f = p_148837_1_.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149530_a); + p_148840_1_.writeByte(this.field_149528_b); + p_148840_1_.writeByte(this.field_149529_c.getChatVisibility()); + p_148840_1_.writeBoolean(this.field_149526_d); + p_148840_1_.writeByte(this.field_149527_e.getDifficultyId()); + p_148840_1_.writeBoolean(this.field_149525_f); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processClientSettings(this); + } + + public String func_149524_c() { + return this.field_149530_a; + } + + public int func_149521_d() { + return this.field_149528_b; + } + + public EntityPlayer.EnumChatVisibility func_149523_e() { + return this.field_149529_c; + } + + public boolean func_149520_f() { + return this.field_149526_d; + } + + public EnumDifficulty func_149518_g() { + return this.field_149527_e; + } + + public boolean func_149519_h() { + return this.field_149525_f; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("lang='%s', view=%d, chat=%s, col=%b, difficulty=%s, cape=%b", this.field_149530_a, Integer.valueOf(this.field_149528_b), this.field_149529_c, Boolean.valueOf(this.field_149526_d), this.field_149527_e, Boolean.valueOf(this.field_149525_f)); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java new file mode 100644 index 0000000..bb4de9c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C16PacketClientStatus.java @@ -0,0 +1,69 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C16PacketClientStatus extends Packet { + private C16PacketClientStatus.EnumState field_149437_a; + + + public C16PacketClientStatus() {} + + public C16PacketClientStatus(C16PacketClientStatus.EnumState p_i45242_1_) { + this.field_149437_a = p_i45242_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149437_a = C16PacketClientStatus.EnumState.field_151404_e[p_148837_1_.readByte() % C16PacketClientStatus.EnumState.field_151404_e.length]; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149437_a.field_151403_d); + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processClientStatus(this); + } + + public C16PacketClientStatus.EnumState func_149435_c() { + return this.field_149437_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } + + public enum EnumState { + PERFORM_RESPAWN("PERFORM_RESPAWN", 0, 0), + REQUEST_STATS("REQUEST_STATS", 1, 1), + OPEN_INVENTORY_ACHIEVEMENT("OPEN_INVENTORY_ACHIEVEMENT", 2, 2); + private final int field_151403_d; + private static final C16PacketClientStatus.EnumState[] field_151404_e = new C16PacketClientStatus.EnumState[values().length]; + + private static final C16PacketClientStatus.EnumState[] $VALUES = new C16PacketClientStatus.EnumState[]{PERFORM_RESPAWN, REQUEST_STATS, OPEN_INVENTORY_ACHIEVEMENT}; + + + EnumState(String p_i45241_1_, int p_i45241_2_, int p_i45241_3_) { + this.field_151403_d = p_i45241_3_; + } + + static { + C16PacketClientStatus.EnumState[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + C16PacketClientStatus.EnumState var3 = var0[var2]; + field_151404_e[var3.field_151403_d] = var3; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java new file mode 100644 index 0000000..e1d7ae8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/client/C17PacketCustomPayload.java @@ -0,0 +1,75 @@ +package net.minecraft.network.play.client; + +import io.netty.buffer.ByteBuf; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C17PacketCustomPayload extends Packet { + private String field_149562_a; + private int field_149560_b; + private byte[] field_149561_c; + + + public C17PacketCustomPayload() {} + + public C17PacketCustomPayload(String p_i45248_1_, ByteBuf p_i45248_2_) { + this(p_i45248_1_, p_i45248_2_.array()); + } + + public C17PacketCustomPayload(String p_i45249_1_, byte[] p_i45249_2_) { + this.field_149562_a = p_i45249_1_; + this.field_149561_c = p_i45249_2_; + + if (p_i45249_2_ != null) { + this.field_149560_b = p_i45249_2_.length; + + if (this.field_149560_b >= 32767) { + throw new IllegalArgumentException("Payload may not be larger than 32k"); + } + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149562_a = p_148837_1_.readStringFromBuffer(20); + this.field_149560_b = p_148837_1_.readShort(); + + if (this.field_149560_b > 0 && this.field_149560_b < 32767) { + this.field_149561_c = new byte[this.field_149560_b]; + p_148837_1_.readBytes(this.field_149561_c); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149562_a); + p_148840_1_.writeShort((short)this.field_149560_b); + + if (this.field_149561_c != null) { + p_148840_1_.writeBytes(this.field_149561_c); + } + } + + public void processPacket(INetHandlerPlayServer p_148833_1_) { + p_148833_1_.processVanilla250Packet(this); + } + + public String func_149559_c() { + return this.field_149562_a; + } + + public byte[] func_149558_e() { + return this.field_149561_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java new file mode 100644 index 0000000..26e9af3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S00PacketKeepAlive.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S00PacketKeepAlive extends Packet { + private int field_149136_a; + + + public S00PacketKeepAlive() {} + + public S00PacketKeepAlive(int p_i45195_1_) { + this.field_149136_a = p_i45195_1_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleKeepAlive(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149136_a = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149136_a); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public int func_149134_c() { + return this.field_149136_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java new file mode 100644 index 0000000..0cf419c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S01PacketJoinGame.java @@ -0,0 +1,113 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class S01PacketJoinGame extends Packet { + private int field_149206_a; + private boolean field_149204_b; + private WorldSettings.GameType field_149205_c; + private int field_149202_d; + private EnumDifficulty field_149203_e; + private int field_149200_f; + private WorldType field_149201_g; + + + public S01PacketJoinGame() {} + + public S01PacketJoinGame(int p_i45201_1_, WorldSettings.GameType p_i45201_2_, boolean p_i45201_3_, int p_i45201_4_, EnumDifficulty p_i45201_5_, int p_i45201_6_, WorldType p_i45201_7_) { + this.field_149206_a = p_i45201_1_; + this.field_149202_d = p_i45201_4_; + this.field_149203_e = p_i45201_5_; + this.field_149205_c = p_i45201_2_; + this.field_149200_f = p_i45201_6_; + this.field_149204_b = p_i45201_3_; + this.field_149201_g = p_i45201_7_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149206_a = p_148837_1_.readInt(); + short var2 = p_148837_1_.readUnsignedByte(); + this.field_149204_b = (var2 & 8) == 8; + int var3 = var2 & -9; + this.field_149205_c = WorldSettings.GameType.getByID(var3); + this.field_149202_d = p_148837_1_.readByte(); + this.field_149203_e = EnumDifficulty.getDifficultyEnum(p_148837_1_.readUnsignedByte()); + this.field_149200_f = p_148837_1_.readUnsignedByte(); + this.field_149201_g = WorldType.parseWorldType(p_148837_1_.readStringFromBuffer(16)); + + if (this.field_149201_g == null) { + this.field_149201_g = WorldType.DEFAULT; + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149206_a); + int var2 = this.field_149205_c.getID(); + + if (this.field_149204_b) { + var2 |= 8; + } + + p_148840_1_.writeByte(var2); + p_148840_1_.writeByte(this.field_149202_d); + p_148840_1_.writeByte(this.field_149203_e.getDifficultyId()); + p_148840_1_.writeByte(this.field_149200_f); + p_148840_1_.writeStringToBuffer(this.field_149201_g.getWorldTypeName()); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleJoinGame(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("eid=%d, gameType=%d, hardcore=%b, dimension=%d, difficulty=%s, maxplayers=%d", Integer.valueOf(this.field_149206_a), Integer.valueOf(this.field_149205_c.getID()), Boolean.valueOf(this.field_149204_b), Integer.valueOf(this.field_149202_d), this.field_149203_e, Integer.valueOf(this.field_149200_f)); + } + + public int func_149197_c() { + return this.field_149206_a; + } + + public boolean func_149195_d() { + return this.field_149204_b; + } + + public WorldSettings.GameType func_149198_e() { + return this.field_149205_c; + } + + public int func_149194_f() { + return this.field_149202_d; + } + + public EnumDifficulty func_149192_g() { + return this.field_149203_e; + } + + public int func_149193_h() { + return this.field_149200_f; + } + + public WorldType func_149196_i() { + return this.field_149201_g; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S02PacketChat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S02PacketChat.java new file mode 100644 index 0000000..a17cd38 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S02PacketChat.java @@ -0,0 +1,65 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S02PacketChat extends Packet { + private IChatComponent field_148919_a; + private boolean field_148918_b; + + + public S02PacketChat() { + this.field_148918_b = true; + } + + public S02PacketChat(IChatComponent p_i45179_1_) { + this(p_i45179_1_, true); + } + + public S02PacketChat(IChatComponent p_i45180_1_, boolean p_i45180_2_) { + this.field_148918_b = true; + this.field_148919_a = p_i45180_1_; + this.field_148918_b = p_i45180_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148919_a = IChatComponent.Serializer.func_150699_a(p_148837_1_.readStringFromBuffer(32767)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(IChatComponent.Serializer.func_150696_a(this.field_148919_a)); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleChat(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("message='%s'", this.field_148919_a); + } + + public IChatComponent func_148915_c() { + return this.field_148919_a; + } + + public boolean func_148916_d() { + return this.field_148918_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java new file mode 100644 index 0000000..4126036 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java @@ -0,0 +1,67 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S03PacketTimeUpdate extends Packet { + private long field_149369_a; + private long field_149368_b; + + + public S03PacketTimeUpdate() {} + + public S03PacketTimeUpdate(long p_i45230_1_, long p_i45230_3_, boolean p_i45230_5_) { + this.field_149369_a = p_i45230_1_; + this.field_149368_b = p_i45230_3_; + + if (!p_i45230_5_) { + this.field_149368_b = -this.field_149368_b; + + if (this.field_149368_b == 0L) { + this.field_149368_b = -1L; + } + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149369_a = p_148837_1_.readLong(); + this.field_149368_b = p_148837_1_.readLong(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeLong(this.field_149369_a); + p_148840_1_.writeLong(this.field_149368_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleTimeUpdate(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("time=%d,dtime=%d", Long.valueOf(this.field_149369_a), Long.valueOf(this.field_149368_b)); + } + + public long func_149366_c() { + return this.field_149369_a; + } + + public long func_149365_d() { + return this.field_149368_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java new file mode 100644 index 0000000..5920160 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java @@ -0,0 +1,68 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S04PacketEntityEquipment extends Packet { + private int field_149394_a; + private int field_149392_b; + private ItemStack field_149393_c; + + + public S04PacketEntityEquipment() {} + + public S04PacketEntityEquipment(int p_i45221_1_, int p_i45221_2_, ItemStack p_i45221_3_) { + this.field_149394_a = p_i45221_1_; + this.field_149392_b = p_i45221_2_; + this.field_149393_c = p_i45221_3_ == null ? null : p_i45221_3_.copy(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149394_a = p_148837_1_.readInt(); + this.field_149392_b = p_148837_1_.readShort(); + this.field_149393_c = p_148837_1_.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149394_a); + p_148840_1_.writeShort(this.field_149392_b); + p_148840_1_.writeItemStackToBuffer(this.field_149393_c); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityEquipment(this); + } + + public ItemStack func_149390_c() { + return this.field_149393_c; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("entity=%d, slot=%d, item=%s", Integer.valueOf(this.field_149394_a), Integer.valueOf(this.field_149392_b), this.field_149393_c); + } + + public int func_149389_d() { + return this.field_149394_a; + } + + public int func_149388_e() { + return this.field_149392_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java new file mode 100644 index 0000000..38d3f9f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java @@ -0,0 +1,75 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S05PacketSpawnPosition extends Packet { + private int field_149364_a; + private int field_149362_b; + private int field_149363_c; + + + public S05PacketSpawnPosition() {} + + public S05PacketSpawnPosition(int p_i45229_1_, int p_i45229_2_, int p_i45229_3_) { + this.field_149364_a = p_i45229_1_; + this.field_149362_b = p_i45229_2_; + this.field_149363_c = p_i45229_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149364_a = p_148837_1_.readInt(); + this.field_149362_b = p_148837_1_.readInt(); + this.field_149363_c = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149364_a); + p_148840_1_.writeInt(this.field_149362_b); + p_148840_1_.writeInt(this.field_149363_c); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSpawnPosition(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return false; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("x=%d, y=%d, z=%d", Integer.valueOf(this.field_149364_a), Integer.valueOf(this.field_149362_b), Integer.valueOf(this.field_149363_c)); + } + + public int func_149360_c() { + return this.field_149364_a; + } + + public int func_149359_d() { + return this.field_149362_b; + } + + public int func_149358_e() { + return this.field_149363_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java new file mode 100644 index 0000000..2f65c73 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S06PacketUpdateHealth extends Packet { + private float field_149336_a; + private int field_149334_b; + private float field_149335_c; + + + public S06PacketUpdateHealth() {} + + public S06PacketUpdateHealth(float p_i45223_1_, int p_i45223_2_, float p_i45223_3_) { + this.field_149336_a = p_i45223_1_; + this.field_149334_b = p_i45223_2_; + this.field_149335_c = p_i45223_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149336_a = p_148837_1_.readFloat(); + this.field_149334_b = p_148837_1_.readShort(); + this.field_149335_c = p_148837_1_.readFloat(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeFloat(this.field_149336_a); + p_148840_1_.writeShort(this.field_149334_b); + p_148840_1_.writeFloat(this.field_149335_c); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleUpdateHealth(this); + } + + public float func_149332_c() { + return this.field_149336_a; + } + + public int func_149330_d() { + return this.field_149334_b; + } + + public float func_149331_e() { + return this.field_149335_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java new file mode 100644 index 0000000..3ee7857 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S07PacketRespawn.java @@ -0,0 +1,75 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class S07PacketRespawn extends Packet { + private int field_149088_a; + private EnumDifficulty field_149086_b; + private WorldSettings.GameType field_149087_c; + private WorldType field_149085_d; + + + public S07PacketRespawn() {} + + public S07PacketRespawn(int p_i45213_1_, EnumDifficulty p_i45213_2_, WorldType p_i45213_3_, WorldSettings.GameType p_i45213_4_) { + this.field_149088_a = p_i45213_1_; + this.field_149086_b = p_i45213_2_; + this.field_149087_c = p_i45213_4_; + this.field_149085_d = p_i45213_3_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleRespawn(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149088_a = p_148837_1_.readInt(); + this.field_149086_b = EnumDifficulty.getDifficultyEnum(p_148837_1_.readUnsignedByte()); + this.field_149087_c = WorldSettings.GameType.getByID(p_148837_1_.readUnsignedByte()); + this.field_149085_d = WorldType.parseWorldType(p_148837_1_.readStringFromBuffer(16)); + + if (this.field_149085_d == null) { + this.field_149085_d = WorldType.DEFAULT; + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149088_a); + p_148840_1_.writeByte(this.field_149086_b.getDifficultyId()); + p_148840_1_.writeByte(this.field_149087_c.getID()); + p_148840_1_.writeStringToBuffer(this.field_149085_d.getWorldTypeName()); + } + + public int func_149082_c() { + return this.field_149088_a; + } + + public EnumDifficulty func_149081_d() { + return this.field_149086_b; + } + + public WorldSettings.GameType func_149083_e() { + return this.field_149087_c; + } + + public WorldType func_149080_f() { + return this.field_149085_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java new file mode 100644 index 0000000..400a909 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java @@ -0,0 +1,84 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S08PacketPlayerPosLook extends Packet { + private double field_148940_a; + private double field_148938_b; + private double field_148939_c; + private float field_148936_d; + private float field_148937_e; + private boolean field_148935_f; + + + public S08PacketPlayerPosLook() {} + + public S08PacketPlayerPosLook(double p_i45164_1_, double p_i45164_3_, double p_i45164_5_, float p_i45164_7_, float p_i45164_8_, boolean p_i45164_9_) { + this.field_148940_a = p_i45164_1_; + this.field_148938_b = p_i45164_3_; + this.field_148939_c = p_i45164_5_; + this.field_148936_d = p_i45164_7_; + this.field_148937_e = p_i45164_8_; + this.field_148935_f = p_i45164_9_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148940_a = p_148837_1_.readDouble(); + this.field_148938_b = p_148837_1_.readDouble(); + this.field_148939_c = p_148837_1_.readDouble(); + this.field_148936_d = p_148837_1_.readFloat(); + this.field_148937_e = p_148837_1_.readFloat(); + this.field_148935_f = p_148837_1_.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeDouble(this.field_148940_a); + p_148840_1_.writeDouble(this.field_148938_b); + p_148840_1_.writeDouble(this.field_148939_c); + p_148840_1_.writeFloat(this.field_148936_d); + p_148840_1_.writeFloat(this.field_148937_e); + p_148840_1_.writeBoolean(this.field_148935_f); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handlePlayerPosLook(this); + } + + public double func_148932_c() { + return this.field_148940_a; + } + + public double func_148928_d() { + return this.field_148938_b; + } + + public double func_148933_e() { + return this.field_148939_c; + } + + public float func_148931_f() { + return this.field_148936_d; + } + + public float func_148930_g() { + return this.field_148937_e; + } + + public boolean func_148929_h() { + return this.field_148935_f; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java new file mode 100644 index 0000000..232d154 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java @@ -0,0 +1,44 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S09PacketHeldItemChange extends Packet { + private int field_149387_a; + + + public S09PacketHeldItemChange() {} + + public S09PacketHeldItemChange(int p_i45215_1_) { + this.field_149387_a = p_i45215_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149387_a = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149387_a); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleHeldItemChange(this); + } + + public int func_149385_c() { + return this.field_149387_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java new file mode 100644 index 0000000..26c1c81 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0APacketUseBed.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S0APacketUseBed extends Packet { + private int field_149097_a; + private int field_149095_b; + private int field_149096_c; + private int field_149094_d; + + + public S0APacketUseBed() {} + + public S0APacketUseBed(EntityPlayer p_i45210_1_, int p_i45210_2_, int p_i45210_3_, int p_i45210_4_) { + this.field_149095_b = p_i45210_2_; + this.field_149096_c = p_i45210_3_; + this.field_149094_d = p_i45210_4_; + this.field_149097_a = p_i45210_1_.getEntityId(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149097_a = p_148837_1_.readInt(); + this.field_149095_b = p_148837_1_.readInt(); + this.field_149096_c = p_148837_1_.readByte(); + this.field_149094_d = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149097_a); + p_148840_1_.writeInt(this.field_149095_b); + p_148840_1_.writeByte(this.field_149096_c); + p_148840_1_.writeInt(this.field_149094_d); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleUseBed(this); + } + + public EntityPlayer func_149091_a(World p_149091_1_) { + return (EntityPlayer)p_149091_1_.getEntityByID(this.field_149097_a); + } + + public int func_149092_c() { + return this.field_149095_b; + } + + public int func_149090_d() { + return this.field_149096_c; + } + + public int func_149089_e() { + return this.field_149094_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java new file mode 100644 index 0000000..6a376ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0BPacketAnimation.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S0BPacketAnimation extends Packet { + private int field_148981_a; + private int field_148980_b; + + + public S0BPacketAnimation() {} + + public S0BPacketAnimation(Entity p_i45172_1_, int p_i45172_2_) { + this.field_148981_a = p_i45172_1_.getEntityId(); + this.field_148980_b = p_i45172_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148981_a = p_148837_1_.readVarIntFromBuffer(); + this.field_148980_b = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_148981_a); + p_148840_1_.writeByte(this.field_148980_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleAnimation(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, type=%d", Integer.valueOf(this.field_148981_a), Integer.valueOf(this.field_148980_b)); + } + + public int func_148978_c() { + return this.field_148981_a; + } + + public int func_148977_d() { + return this.field_148980_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java new file mode 100644 index 0000000..7b50bbd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java @@ -0,0 +1,153 @@ +package net.minecraft.network.play.server; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0CPacketSpawnPlayer extends Packet { + private int field_148957_a; + private GameProfile field_148955_b; + private int field_148956_c; + private int field_148953_d; + private int field_148954_e; + private byte field_148951_f; + private byte field_148952_g; + private int field_148959_h; + private DataWatcher field_148960_i; + private List field_148958_j; + + + public S0CPacketSpawnPlayer() {} + + public S0CPacketSpawnPlayer(EntityPlayer p_i45171_1_) { + this.field_148957_a = p_i45171_1_.getEntityId(); + this.field_148955_b = p_i45171_1_.getGameProfile(); + this.field_148956_c = MathHelper.floor_double(p_i45171_1_.posX * 32.0D); + this.field_148953_d = MathHelper.floor_double(p_i45171_1_.posY * 32.0D); + this.field_148954_e = MathHelper.floor_double(p_i45171_1_.posZ * 32.0D); + this.field_148951_f = (byte)((int)(p_i45171_1_.rotationYaw * 256.0F / 360.0F)); + this.field_148952_g = (byte)((int)(p_i45171_1_.rotationPitch * 256.0F / 360.0F)); + ItemStack var2 = p_i45171_1_.inventory.getCurrentItem(); + this.field_148959_h = var2 == null ? 0 : Item.getIdFromItem(var2.getItem()); + this.field_148960_i = p_i45171_1_.getDataWatcher(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148957_a = p_148837_1_.readVarIntFromBuffer(); + UUID var2 = UUID.fromString(p_148837_1_.readStringFromBuffer(36)); + this.field_148955_b = new GameProfile(var2, p_148837_1_.readStringFromBuffer(16)); + int var3 = p_148837_1_.readVarIntFromBuffer(); + + for (int var4 = 0; var4 < var3; ++var4) { + String var5 = p_148837_1_.readStringFromBuffer(32767); + String var6 = p_148837_1_.readStringFromBuffer(32767); + String var7 = p_148837_1_.readStringFromBuffer(32767); + this.field_148955_b.getProperties().put(var5, new Property(var5, var6, var7)); + } + + this.field_148956_c = p_148837_1_.readInt(); + this.field_148953_d = p_148837_1_.readInt(); + this.field_148954_e = p_148837_1_.readInt(); + this.field_148951_f = p_148837_1_.readByte(); + this.field_148952_g = p_148837_1_.readByte(); + this.field_148959_h = p_148837_1_.readShort(); + this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_148957_a); + UUID var2 = this.field_148955_b.getId(); + p_148840_1_.writeStringToBuffer(var2 == null ? "" : var2.toString()); + p_148840_1_.writeStringToBuffer(this.field_148955_b.getName()); + p_148840_1_.writeVarIntToBuffer(this.field_148955_b.getProperties().size()); + Iterator var3 = this.field_148955_b.getProperties().values().iterator(); + + while (var3.hasNext()) { + Property var4 = (Property)var3.next(); + p_148840_1_.writeStringToBuffer(var4.getName()); + p_148840_1_.writeStringToBuffer(var4.getValue()); + p_148840_1_.writeStringToBuffer(var4.getSignature()); + } + + p_148840_1_.writeInt(this.field_148956_c); + p_148840_1_.writeInt(this.field_148953_d); + p_148840_1_.writeInt(this.field_148954_e); + p_148840_1_.writeByte(this.field_148951_f); + p_148840_1_.writeByte(this.field_148952_g); + p_148840_1_.writeShort(this.field_148959_h); + this.field_148960_i.func_151509_a(p_148840_1_); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSpawnPlayer(this); + } + + public List func_148944_c() { + if (this.field_148958_j == null) { + this.field_148958_j = this.field_148960_i.getAllWatched(); + } + + return this.field_148958_j; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, gameProfile='%s', x=%.2f, y=%.2f, z=%.2f, carried=%d", Integer.valueOf(this.field_148957_a), this.field_148955_b, Float.valueOf((float)this.field_148956_c / 32.0F), Float.valueOf((float)this.field_148953_d / 32.0F), Float.valueOf((float)this.field_148954_e / 32.0F), Integer.valueOf(this.field_148959_h)); + } + + public int func_148943_d() { + return this.field_148957_a; + } + + public GameProfile func_148948_e() { + return this.field_148955_b; + } + + public int func_148942_f() { + return this.field_148956_c; + } + + public int func_148949_g() { + return this.field_148953_d; + } + + public int func_148946_h() { + return this.field_148954_e; + } + + public byte func_148941_i() { + return this.field_148951_f; + } + + public byte func_148945_j() { + return this.field_148952_g; + } + + public int func_148947_k() { + return this.field_148959_h; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java new file mode 100644 index 0000000..b79114b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0DPacketCollectItem.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S0DPacketCollectItem extends Packet { + private int field_149357_a; + private int field_149356_b; + + + public S0DPacketCollectItem() {} + + public S0DPacketCollectItem(int p_i45232_1_, int p_i45232_2_) { + this.field_149357_a = p_i45232_1_; + this.field_149356_b = p_i45232_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149357_a = p_148837_1_.readInt(); + this.field_149356_b = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149357_a); + p_148840_1_.writeInt(this.field_149356_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleCollectItem(this); + } + + public int func_149354_c() { + return this.field_149357_a; + } + + public int func_149353_d() { + return this.field_149356_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java new file mode 100644 index 0000000..9bc525e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java @@ -0,0 +1,203 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0EPacketSpawnObject extends Packet { + private int field_149018_a; + private int field_149016_b; + private int field_149017_c; + private int field_149014_d; + private int field_149015_e; + private int field_149012_f; + private int field_149013_g; + private int field_149021_h; + private int field_149022_i; + private int field_149019_j; + private int field_149020_k; + + + public S0EPacketSpawnObject() {} + + public S0EPacketSpawnObject(Entity p_i45165_1_, int p_i45165_2_) { + this(p_i45165_1_, p_i45165_2_, 0); + } + + public S0EPacketSpawnObject(Entity p_i45166_1_, int p_i45166_2_, int p_i45166_3_) { + this.field_149018_a = p_i45166_1_.getEntityId(); + this.field_149016_b = MathHelper.floor_double(p_i45166_1_.posX * 32.0D); + this.field_149017_c = MathHelper.floor_double(p_i45166_1_.posY * 32.0D); + this.field_149014_d = MathHelper.floor_double(p_i45166_1_.posZ * 32.0D); + this.field_149021_h = MathHelper.floor_float(p_i45166_1_.rotationPitch * 256.0F / 360.0F); + this.field_149022_i = MathHelper.floor_float(p_i45166_1_.rotationYaw * 256.0F / 360.0F); + this.field_149019_j = p_i45166_2_; + this.field_149020_k = p_i45166_3_; + + if (p_i45166_3_ > 0) { + double var4 = p_i45166_1_.motionX; + double var6 = p_i45166_1_.motionY; + double var8 = p_i45166_1_.motionZ; + double var10 = 3.9D; + + if (var4 < -var10) { + var4 = -var10; + } + + if (var6 < -var10) { + var6 = -var10; + } + + if (var8 < -var10) { + var8 = -var10; + } + + if (var4 > var10) { + var4 = var10; + } + + if (var6 > var10) { + var6 = var10; + } + + if (var8 > var10) { + var8 = var10; + } + + this.field_149015_e = (int)(var4 * 8000.0D); + this.field_149012_f = (int)(var6 * 8000.0D); + this.field_149013_g = (int)(var8 * 8000.0D); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149018_a = p_148837_1_.readVarIntFromBuffer(); + this.field_149019_j = p_148837_1_.readByte(); + this.field_149016_b = p_148837_1_.readInt(); + this.field_149017_c = p_148837_1_.readInt(); + this.field_149014_d = p_148837_1_.readInt(); + this.field_149021_h = p_148837_1_.readByte(); + this.field_149022_i = p_148837_1_.readByte(); + this.field_149020_k = p_148837_1_.readInt(); + + if (this.field_149020_k > 0) { + this.field_149015_e = p_148837_1_.readShort(); + this.field_149012_f = p_148837_1_.readShort(); + this.field_149013_g = p_148837_1_.readShort(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_149018_a); + p_148840_1_.writeByte(this.field_149019_j); + p_148840_1_.writeInt(this.field_149016_b); + p_148840_1_.writeInt(this.field_149017_c); + p_148840_1_.writeInt(this.field_149014_d); + p_148840_1_.writeByte(this.field_149021_h); + p_148840_1_.writeByte(this.field_149022_i); + p_148840_1_.writeInt(this.field_149020_k); + + if (this.field_149020_k > 0) { + p_148840_1_.writeShort(this.field_149015_e); + p_148840_1_.writeShort(this.field_149012_f); + p_148840_1_.writeShort(this.field_149013_g); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSpawnObject(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, type=%d, x=%.2f, y=%.2f, z=%.2f", Integer.valueOf(this.field_149018_a), Integer.valueOf(this.field_149019_j), Float.valueOf((float)this.field_149016_b / 32.0F), Float.valueOf((float)this.field_149017_c / 32.0F), Float.valueOf((float)this.field_149014_d / 32.0F)); + } + + public int func_149001_c() { + return this.field_149018_a; + } + + public int func_148997_d() { + return this.field_149016_b; + } + + public int func_148998_e() { + return this.field_149017_c; + } + + public int func_148994_f() { + return this.field_149014_d; + } + + public int func_149010_g() { + return this.field_149015_e; + } + + public int func_149004_h() { + return this.field_149012_f; + } + + public int func_148999_i() { + return this.field_149013_g; + } + + public int func_149008_j() { + return this.field_149021_h; + } + + public int func_149006_k() { + return this.field_149022_i; + } + + public int func_148993_l() { + return this.field_149019_j; + } + + public int func_149009_m() { + return this.field_149020_k; + } + + public void func_148996_a(int p_148996_1_) { + this.field_149016_b = p_148996_1_; + } + + public void func_148995_b(int p_148995_1_) { + this.field_149017_c = p_148995_1_; + } + + public void func_149005_c(int p_149005_1_) { + this.field_149014_d = p_149005_1_; + } + + public void func_149003_d(int p_149003_1_) { + this.field_149015_e = p_149003_1_; + } + + public void func_149000_e(int p_149000_1_) { + this.field_149012_f = p_149000_1_; + } + + public void func_149007_f(int p_149007_1_) { + this.field_149013_g = p_149007_1_; + } + + public void func_149002_g(int p_149002_1_) { + this.field_149020_k = p_149002_1_; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java new file mode 100644 index 0000000..3eff929 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java @@ -0,0 +1,178 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0FPacketSpawnMob extends Packet { + private int field_149042_a; + private int field_149040_b; + private int field_149041_c; + private int field_149038_d; + private int field_149039_e; + private int field_149036_f; + private int field_149037_g; + private int field_149047_h; + private byte field_149048_i; + private byte field_149045_j; + private byte field_149046_k; + private DataWatcher field_149043_l; + private List field_149044_m; + + + public S0FPacketSpawnMob() {} + + public S0FPacketSpawnMob(EntityLivingBase p_i45192_1_) { + this.field_149042_a = p_i45192_1_.getEntityId(); + this.field_149040_b = (byte)EntityList.getEntityID(p_i45192_1_); + this.field_149041_c = p_i45192_1_.myEntitySize.multiplyBy32AndRound(p_i45192_1_.posX); + this.field_149038_d = MathHelper.floor_double(p_i45192_1_.posY * 32.0D); + this.field_149039_e = p_i45192_1_.myEntitySize.multiplyBy32AndRound(p_i45192_1_.posZ); + this.field_149048_i = (byte)((int)(p_i45192_1_.rotationYaw * 256.0F / 360.0F)); + this.field_149045_j = (byte)((int)(p_i45192_1_.rotationPitch * 256.0F / 360.0F)); + this.field_149046_k = (byte)((int)(p_i45192_1_.rotationYawHead * 256.0F / 360.0F)); + double var2 = 3.9D; + double var4 = p_i45192_1_.motionX; + double var6 = p_i45192_1_.motionY; + double var8 = p_i45192_1_.motionZ; + + if (var4 < -var2) { + var4 = -var2; + } + + if (var6 < -var2) { + var6 = -var2; + } + + if (var8 < -var2) { + var8 = -var2; + } + + if (var4 > var2) { + var4 = var2; + } + + if (var6 > var2) { + var6 = var2; + } + + if (var8 > var2) { + var8 = var2; + } + + this.field_149036_f = (int)(var4 * 8000.0D); + this.field_149037_g = (int)(var6 * 8000.0D); + this.field_149047_h = (int)(var8 * 8000.0D); + this.field_149043_l = p_i45192_1_.getDataWatcher(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149042_a = p_148837_1_.readVarIntFromBuffer(); + this.field_149040_b = p_148837_1_.readByte() & 255; + this.field_149041_c = p_148837_1_.readInt(); + this.field_149038_d = p_148837_1_.readInt(); + this.field_149039_e = p_148837_1_.readInt(); + this.field_149048_i = p_148837_1_.readByte(); + this.field_149045_j = p_148837_1_.readByte(); + this.field_149046_k = p_148837_1_.readByte(); + this.field_149036_f = p_148837_1_.readShort(); + this.field_149037_g = p_148837_1_.readShort(); + this.field_149047_h = p_148837_1_.readShort(); + this.field_149044_m = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_149042_a); + p_148840_1_.writeByte(this.field_149040_b & 255); + p_148840_1_.writeInt(this.field_149041_c); + p_148840_1_.writeInt(this.field_149038_d); + p_148840_1_.writeInt(this.field_149039_e); + p_148840_1_.writeByte(this.field_149048_i); + p_148840_1_.writeByte(this.field_149045_j); + p_148840_1_.writeByte(this.field_149046_k); + p_148840_1_.writeShort(this.field_149036_f); + p_148840_1_.writeShort(this.field_149037_g); + p_148840_1_.writeShort(this.field_149047_h); + this.field_149043_l.func_151509_a(p_148840_1_); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSpawnMob(this); + } + + public List func_149027_c() { + if (this.field_149044_m == null) { + this.field_149044_m = this.field_149043_l.getAllWatched(); + } + + return this.field_149044_m; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, type=%d, x=%.2f, y=%.2f, z=%.2f, xd=%.2f, yd=%.2f, zd=%.2f", Integer.valueOf(this.field_149042_a), Integer.valueOf(this.field_149040_b), Float.valueOf((float)this.field_149041_c / 32.0F), Float.valueOf((float)this.field_149038_d / 32.0F), Float.valueOf((float)this.field_149039_e / 32.0F), Float.valueOf((float)this.field_149036_f / 8000.0F), Float.valueOf((float)this.field_149037_g / 8000.0F), Float.valueOf((float)this.field_149047_h / 8000.0F)); + } + + public int func_149024_d() { + return this.field_149042_a; + } + + public int func_149025_e() { + return this.field_149040_b; + } + + public int func_149023_f() { + return this.field_149041_c; + } + + public int func_149034_g() { + return this.field_149038_d; + } + + public int func_149029_h() { + return this.field_149039_e; + } + + public int func_149026_i() { + return this.field_149036_f; + } + + public int func_149033_j() { + return this.field_149037_g; + } + + public int func_149031_k() { + return this.field_149047_h; + } + + public byte func_149028_l() { + return this.field_149048_i; + } + + public byte func_149030_m() { + return this.field_149045_j; + } + + public byte func_149032_n() { + return this.field_149046_k; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java new file mode 100644 index 0000000..35adc2d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java @@ -0,0 +1,92 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S10PacketSpawnPainting extends Packet { + private int field_148973_a; + private int field_148971_b; + private int field_148972_c; + private int field_148969_d; + private int field_148970_e; + private String field_148968_f; + + + public S10PacketSpawnPainting() {} + + public S10PacketSpawnPainting(EntityPainting p_i45170_1_) { + this.field_148973_a = p_i45170_1_.getEntityId(); + this.field_148971_b = p_i45170_1_.field_146063_b; + this.field_148972_c = p_i45170_1_.field_146064_c; + this.field_148969_d = p_i45170_1_.field_146062_d; + this.field_148970_e = p_i45170_1_.hangingDirection; + this.field_148968_f = p_i45170_1_.art.title; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148973_a = p_148837_1_.readVarIntFromBuffer(); + this.field_148968_f = p_148837_1_.readStringFromBuffer(EntityPainting.EnumArt.maxArtTitleLength); + this.field_148971_b = p_148837_1_.readInt(); + this.field_148972_c = p_148837_1_.readInt(); + this.field_148969_d = p_148837_1_.readInt(); + this.field_148970_e = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_148973_a); + p_148840_1_.writeStringToBuffer(this.field_148968_f); + p_148840_1_.writeInt(this.field_148971_b); + p_148840_1_.writeInt(this.field_148972_c); + p_148840_1_.writeInt(this.field_148969_d); + p_148840_1_.writeInt(this.field_148970_e); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSpawnPainting(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, type=%s, x=%d, y=%d, z=%d", Integer.valueOf(this.field_148973_a), this.field_148968_f, Integer.valueOf(this.field_148971_b), Integer.valueOf(this.field_148972_c), Integer.valueOf(this.field_148969_d)); + } + + public int func_148965_c() { + return this.field_148973_a; + } + + public int func_148964_d() { + return this.field_148971_b; + } + + public int func_148963_e() { + return this.field_148972_c; + } + + public int func_148962_f() { + return this.field_148969_d; + } + + public int func_148966_g() { + return this.field_148970_e; + } + + public String func_148961_h() { + return this.field_148968_f; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java new file mode 100644 index 0000000..167a671 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java @@ -0,0 +1,85 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S11PacketSpawnExperienceOrb extends Packet { + private int field_148992_a; + private int field_148990_b; + private int field_148991_c; + private int field_148988_d; + private int field_148989_e; + + + public S11PacketSpawnExperienceOrb() {} + + public S11PacketSpawnExperienceOrb(EntityXPOrb p_i45167_1_) { + this.field_148992_a = p_i45167_1_.getEntityId(); + this.field_148990_b = MathHelper.floor_double(p_i45167_1_.posX * 32.0D); + this.field_148991_c = MathHelper.floor_double(p_i45167_1_.posY * 32.0D); + this.field_148988_d = MathHelper.floor_double(p_i45167_1_.posZ * 32.0D); + this.field_148989_e = p_i45167_1_.getXpValue(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148992_a = p_148837_1_.readVarIntFromBuffer(); + this.field_148990_b = p_148837_1_.readInt(); + this.field_148991_c = p_148837_1_.readInt(); + this.field_148988_d = p_148837_1_.readInt(); + this.field_148989_e = p_148837_1_.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_148992_a); + p_148840_1_.writeInt(this.field_148990_b); + p_148840_1_.writeInt(this.field_148991_c); + p_148840_1_.writeInt(this.field_148988_d); + p_148840_1_.writeShort(this.field_148989_e); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSpawnExperienceOrb(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, value=%d, x=%.2f, y=%.2f, z=%.2f", Integer.valueOf(this.field_148992_a), Integer.valueOf(this.field_148989_e), Float.valueOf((float)this.field_148990_b / 32.0F), Float.valueOf((float)this.field_148991_c / 32.0F), Float.valueOf((float)this.field_148988_d / 32.0F)); + } + + public int func_148985_c() { + return this.field_148992_a; + } + + public int func_148984_d() { + return this.field_148990_b; + } + + public int func_148983_e() { + return this.field_148991_c; + } + + public int func_148982_f() { + return this.field_148988_d; + } + + public int func_148986_g() { + return this.field_148989_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java new file mode 100644 index 0000000..05cf7cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java @@ -0,0 +1,106 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S12PacketEntityVelocity extends Packet { + private int field_149417_a; + private int field_149415_b; + private int field_149416_c; + private int field_149414_d; + + + public S12PacketEntityVelocity() {} + + public S12PacketEntityVelocity(Entity p_i45219_1_) { + this(p_i45219_1_.getEntityId(), p_i45219_1_.motionX, p_i45219_1_.motionY, p_i45219_1_.motionZ); + } + + public S12PacketEntityVelocity(int p_i45220_1_, double p_i45220_2_, double p_i45220_4_, double p_i45220_6_) { + this.field_149417_a = p_i45220_1_; + double var8 = 3.9D; + + if (p_i45220_2_ < -var8) { + p_i45220_2_ = -var8; + } + + if (p_i45220_4_ < -var8) { + p_i45220_4_ = -var8; + } + + if (p_i45220_6_ < -var8) { + p_i45220_6_ = -var8; + } + + if (p_i45220_2_ > var8) { + p_i45220_2_ = var8; + } + + if (p_i45220_4_ > var8) { + p_i45220_4_ = var8; + } + + if (p_i45220_6_ > var8) { + p_i45220_6_ = var8; + } + + this.field_149415_b = (int)(p_i45220_2_ * 8000.0D); + this.field_149416_c = (int)(p_i45220_4_ * 8000.0D); + this.field_149414_d = (int)(p_i45220_6_ * 8000.0D); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149417_a = p_148837_1_.readInt(); + this.field_149415_b = p_148837_1_.readShort(); + this.field_149416_c = p_148837_1_.readShort(); + this.field_149414_d = p_148837_1_.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149417_a); + p_148840_1_.writeShort(this.field_149415_b); + p_148840_1_.writeShort(this.field_149416_c); + p_148840_1_.writeShort(this.field_149414_d); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityVelocity(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, x=%.2f, y=%.2f, z=%.2f", Integer.valueOf(this.field_149417_a), Float.valueOf((float)this.field_149415_b / 8000.0F), Float.valueOf((float)this.field_149416_c / 8000.0F), Float.valueOf((float)this.field_149414_d / 8000.0F)); + } + + public int func_149412_c() { + return this.field_149417_a; + } + + public int func_149411_d() { + return this.field_149415_b; + } + + public int func_149410_e() { + return this.field_149416_c; + } + + public int func_149409_f() { + return this.field_149414_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java new file mode 100644 index 0000000..2573b55 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java @@ -0,0 +1,69 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S13PacketDestroyEntities extends Packet { + private int[] field_149100_a; + + + public S13PacketDestroyEntities() {} + + public S13PacketDestroyEntities(int ... p_i45211_1_) { + this.field_149100_a = p_i45211_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149100_a = new int[p_148837_1_.readByte()]; + + for (int var2 = 0; var2 < this.field_149100_a.length; ++var2) { + this.field_149100_a[var2] = p_148837_1_.readInt(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149100_a.length); + + for (int var2 = 0; var2 < this.field_149100_a.length; ++var2) { + p_148840_1_.writeInt(this.field_149100_a[var2]); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleDestroyEntities(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + StringBuilder var1 = new StringBuilder(); + + for (int var2 = 0; var2 < this.field_149100_a.length; ++var2) { + if (var2 > 0) { + var1.append(", "); + } + + var1.append(this.field_149100_a[var2]); + } + + return String.format("entities=%d[%s]", Integer.valueOf(this.field_149100_a.length), var1); + } + + public int[] func_149098_c() { + return this.field_149100_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java new file mode 100644 index 0000000..80d14cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S14PacketEntity.java @@ -0,0 +1,201 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S14PacketEntity extends Packet { + protected int field_149074_a; + protected byte field_149072_b; + protected byte field_149073_c; + protected byte field_149070_d; + protected byte field_149071_e; + protected byte field_149068_f; + protected boolean field_149069_g; + + + public S14PacketEntity() {} + + public S14PacketEntity(int p_i45206_1_) { + this.field_149074_a = p_i45206_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149074_a = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149074_a); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityMovement(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d", Integer.valueOf(this.field_149074_a)); + } + + public String toString() { + return "Entity_" + super.toString(); + } + + public Entity func_149065_a(World p_149065_1_) { + return p_149065_1_.getEntityByID(this.field_149074_a); + } + + public byte func_149062_c() { + return this.field_149072_b; + } + + public byte func_149061_d() { + return this.field_149073_c; + } + + public byte func_149064_e() { + return this.field_149070_d; + } + + public byte func_149066_f() { + return this.field_149071_e; + } + + public byte func_149063_g() { + return this.field_149068_f; + } + + public boolean func_149060_h() { + return this.field_149069_g; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } + + public static class S15PacketEntityRelMove extends S14PacketEntity { + + + public S15PacketEntityRelMove() {} + + public S15PacketEntityRelMove(int p_i45203_1_, byte p_i45203_2_, byte p_i45203_3_, byte p_i45203_4_) { + super(p_i45203_1_); + this.field_149072_b = p_i45203_2_; + this.field_149073_c = p_i45203_3_; + this.field_149070_d = p_i45203_4_; + } + + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + super.readPacketData(p_148837_1_); + this.field_149072_b = p_148837_1_.readByte(); + this.field_149073_c = p_148837_1_.readByte(); + this.field_149070_d = p_148837_1_.readByte(); + } + + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + super.writePacketData(p_148840_1_); + p_148840_1_.writeByte(this.field_149072_b); + p_148840_1_.writeByte(this.field_149073_c); + p_148840_1_.writeByte(this.field_149070_d); + } + + public String serialize() { + return super.serialize() + String.format(", xa=%d, ya=%d, za=%d", Byte.valueOf(this.field_149072_b), Byte.valueOf(this.field_149073_c), Byte.valueOf(this.field_149070_d)); + } + + public void processPacket(INetHandler p_148833_1_) { + super.processPacket((INetHandlerPlayClient)p_148833_1_); + } + } + + public static class S16PacketEntityLook extends S14PacketEntity { + + + public S16PacketEntityLook() { + this.field_149069_g = true; + } + + public S16PacketEntityLook(int p_i45205_1_, byte p_i45205_2_, byte p_i45205_3_) { + super(p_i45205_1_); + this.field_149071_e = p_i45205_2_; + this.field_149068_f = p_i45205_3_; + this.field_149069_g = true; + } + + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + super.readPacketData(p_148837_1_); + this.field_149071_e = p_148837_1_.readByte(); + this.field_149068_f = p_148837_1_.readByte(); + } + + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + super.writePacketData(p_148840_1_); + p_148840_1_.writeByte(this.field_149071_e); + p_148840_1_.writeByte(this.field_149068_f); + } + + public String serialize() { + return super.serialize() + String.format(", yRot=%d, xRot=%d", Byte.valueOf(this.field_149071_e), Byte.valueOf(this.field_149068_f)); + } + + public void processPacket(INetHandler p_148833_1_) { + super.processPacket((INetHandlerPlayClient)p_148833_1_); + } + } + + public static class S17PacketEntityLookMove extends S14PacketEntity { + + + public S17PacketEntityLookMove() { + this.field_149069_g = true; + } + + public S17PacketEntityLookMove(int p_i45204_1_, byte p_i45204_2_, byte p_i45204_3_, byte p_i45204_4_, byte p_i45204_5_, byte p_i45204_6_) { + super(p_i45204_1_); + this.field_149072_b = p_i45204_2_; + this.field_149073_c = p_i45204_3_; + this.field_149070_d = p_i45204_4_; + this.field_149071_e = p_i45204_5_; + this.field_149068_f = p_i45204_6_; + this.field_149069_g = true; + } + + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + super.readPacketData(p_148837_1_); + this.field_149072_b = p_148837_1_.readByte(); + this.field_149073_c = p_148837_1_.readByte(); + this.field_149070_d = p_148837_1_.readByte(); + this.field_149071_e = p_148837_1_.readByte(); + this.field_149068_f = p_148837_1_.readByte(); + } + + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + super.writePacketData(p_148840_1_); + p_148840_1_.writeByte(this.field_149072_b); + p_148840_1_.writeByte(this.field_149073_c); + p_148840_1_.writeByte(this.field_149070_d); + p_148840_1_.writeByte(this.field_149071_e); + p_148840_1_.writeByte(this.field_149068_f); + } + + public String serialize() { + return super.serialize() + String.format(", xa=%d, ya=%d, za=%d, yRot=%d, xRot=%d", Byte.valueOf(this.field_149072_b), Byte.valueOf(this.field_149073_c), Byte.valueOf(this.field_149070_d), Byte.valueOf(this.field_149071_e), Byte.valueOf(this.field_149068_f)); + } + + public void processPacket(INetHandler p_148833_1_) { + super.processPacket((INetHandlerPlayClient)p_148833_1_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java new file mode 100644 index 0000000..a3c239f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java @@ -0,0 +1,95 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S18PacketEntityTeleport extends Packet { + private int field_149458_a; + private int field_149456_b; + private int field_149457_c; + private int field_149454_d; + private byte field_149455_e; + private byte field_149453_f; + + + public S18PacketEntityTeleport() {} + + public S18PacketEntityTeleport(Entity p_i45233_1_) { + this.field_149458_a = p_i45233_1_.getEntityId(); + this.field_149456_b = MathHelper.floor_double(p_i45233_1_.posX * 32.0D); + this.field_149457_c = MathHelper.floor_double(p_i45233_1_.posY * 32.0D); + this.field_149454_d = MathHelper.floor_double(p_i45233_1_.posZ * 32.0D); + this.field_149455_e = (byte)((int)(p_i45233_1_.rotationYaw * 256.0F / 360.0F)); + this.field_149453_f = (byte)((int)(p_i45233_1_.rotationPitch * 256.0F / 360.0F)); + } + + public S18PacketEntityTeleport(int p_i45234_1_, int p_i45234_2_, int p_i45234_3_, int p_i45234_4_, byte p_i45234_5_, byte p_i45234_6_) { + this.field_149458_a = p_i45234_1_; + this.field_149456_b = p_i45234_2_; + this.field_149457_c = p_i45234_3_; + this.field_149454_d = p_i45234_4_; + this.field_149455_e = p_i45234_5_; + this.field_149453_f = p_i45234_6_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149458_a = p_148837_1_.readInt(); + this.field_149456_b = p_148837_1_.readInt(); + this.field_149457_c = p_148837_1_.readInt(); + this.field_149454_d = p_148837_1_.readInt(); + this.field_149455_e = p_148837_1_.readByte(); + this.field_149453_f = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149458_a); + p_148840_1_.writeInt(this.field_149456_b); + p_148840_1_.writeInt(this.field_149457_c); + p_148840_1_.writeInt(this.field_149454_d); + p_148840_1_.writeByte(this.field_149455_e); + p_148840_1_.writeByte(this.field_149453_f); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityTeleport(this); + } + + public int func_149451_c() { + return this.field_149458_a; + } + + public int func_149449_d() { + return this.field_149456_b; + } + + public int func_149448_e() { + return this.field_149457_c; + } + + public int func_149446_f() { + return this.field_149454_d; + } + + public byte func_149450_g() { + return this.field_149455_e; + } + + public byte func_149447_h() { + return this.field_149453_f; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java new file mode 100644 index 0000000..ddb91e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java @@ -0,0 +1,61 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S19PacketEntityHeadLook extends Packet { + private int field_149384_a; + private byte field_149383_b; + + + public S19PacketEntityHeadLook() {} + + public S19PacketEntityHeadLook(Entity p_i45214_1_, byte p_i45214_2_) { + this.field_149384_a = p_i45214_1_.getEntityId(); + this.field_149383_b = p_i45214_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149384_a = p_148837_1_.readInt(); + this.field_149383_b = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149384_a); + p_148840_1_.writeByte(this.field_149383_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityHeadLook(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, rot=%d", Integer.valueOf(this.field_149384_a), Byte.valueOf(this.field_149383_b)); + } + + public Entity func_149381_a(World p_149381_1_) { + return p_149381_1_.getEntityByID(this.field_149384_a); + } + + public byte func_149380_c() { + return this.field_149383_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java new file mode 100644 index 0000000..3e23051 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S19PacketEntityStatus.java @@ -0,0 +1,54 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S19PacketEntityStatus extends Packet { + private int field_149164_a; + private byte field_149163_b; + + + public S19PacketEntityStatus() {} + + public S19PacketEntityStatus(Entity p_i46335_1_, byte p_i46335_2_) { + this.field_149164_a = p_i46335_1_.getEntityId(); + this.field_149163_b = p_i46335_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149164_a = p_148837_1_.readInt(); + this.field_149163_b = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149164_a); + p_148840_1_.writeByte(this.field_149163_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityStatus(this); + } + + public Entity func_149161_a(World p_149161_1_) { + return p_149161_1_.getEntityByID(this.field_149164_a); + } + + public byte func_149160_c() { + return this.field_149163_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java new file mode 100644 index 0000000..032481d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java @@ -0,0 +1,61 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1BPacketEntityAttach extends Packet { + private int field_149408_a; + private int field_149406_b; + private int field_149407_c; + + + public S1BPacketEntityAttach() {} + + public S1BPacketEntityAttach(int p_i45218_1_, Entity p_i45218_2_, Entity p_i45218_3_) { + this.field_149408_a = p_i45218_1_; + this.field_149406_b = p_i45218_2_.getEntityId(); + this.field_149407_c = p_i45218_3_ != null ? p_i45218_3_.getEntityId() : -1; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149406_b = p_148837_1_.readInt(); + this.field_149407_c = p_148837_1_.readInt(); + this.field_149408_a = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149406_b); + p_148840_1_.writeInt(this.field_149407_c); + p_148840_1_.writeByte(this.field_149408_a); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityAttach(this); + } + + public int func_149404_c() { + return this.field_149408_a; + } + + public int func_149403_d() { + return this.field_149406_b; + } + + public int func_149402_e() { + return this.field_149407_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java new file mode 100644 index 0000000..c264597 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.minecraft.entity.DataWatcher; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1CPacketEntityMetadata extends Packet { + private int field_149379_a; + private List field_149378_b; + + + public S1CPacketEntityMetadata() {} + + public S1CPacketEntityMetadata(int p_i45217_1_, DataWatcher p_i45217_2_, boolean p_i45217_3_) { + this.field_149379_a = p_i45217_1_; + + if (p_i45217_3_) { + this.field_149378_b = p_i45217_2_.getAllWatched(); + } else { + this.field_149378_b = p_i45217_2_.getChanged(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149379_a = p_148837_1_.readInt(); + this.field_149378_b = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149379_a); + DataWatcher.writeWatchedListToPacketBuffer(this.field_149378_b, p_148840_1_); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityMetadata(this); + } + + public List func_149376_c() { + return this.field_149378_b; + } + + public int func_149375_d() { + return this.field_149379_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java new file mode 100644 index 0000000..66c59ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java @@ -0,0 +1,78 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.potion.PotionEffect; + +public class S1DPacketEntityEffect extends Packet { + private int field_149434_a; + private byte field_149432_b; + private byte field_149433_c; + private short field_149431_d; + + + public S1DPacketEntityEffect() {} + + public S1DPacketEntityEffect(int p_i45237_1_, PotionEffect p_i45237_2_) { + this.field_149434_a = p_i45237_1_; + this.field_149432_b = (byte)(p_i45237_2_.getPotionID() & 255); + this.field_149433_c = (byte)(p_i45237_2_.getAmplifier() & 255); + + if (p_i45237_2_.getDuration() > 32767) { + this.field_149431_d = 32767; + } else { + this.field_149431_d = (short)p_i45237_2_.getDuration(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149434_a = p_148837_1_.readInt(); + this.field_149432_b = p_148837_1_.readByte(); + this.field_149433_c = p_148837_1_.readByte(); + this.field_149431_d = p_148837_1_.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149434_a); + p_148840_1_.writeByte(this.field_149432_b); + p_148840_1_.writeByte(this.field_149433_c); + p_148840_1_.writeShort(this.field_149431_d); + } + + public boolean func_149429_c() { + return this.field_149431_d == 32767; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityEffect(this); + } + + public int func_149426_d() { + return this.field_149434_a; + } + + public byte func_149427_e() { + return this.field_149432_b; + } + + public byte func_149428_f() { + return this.field_149433_c; + } + + public short func_149425_g() { + return this.field_149431_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java new file mode 100644 index 0000000..44fc458 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java @@ -0,0 +1,53 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.potion.PotionEffect; + +public class S1EPacketRemoveEntityEffect extends Packet { + private int field_149079_a; + private int field_149078_b; + + + public S1EPacketRemoveEntityEffect() {} + + public S1EPacketRemoveEntityEffect(int p_i45212_1_, PotionEffect p_i45212_2_) { + this.field_149079_a = p_i45212_1_; + this.field_149078_b = p_i45212_2_.getPotionID(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149079_a = p_148837_1_.readInt(); + this.field_149078_b = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149079_a); + p_148840_1_.writeByte(this.field_149078_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleRemoveEntityEffect(this); + } + + public int func_149076_c() { + return this.field_149079_a; + } + + public int func_149075_d() { + return this.field_149078_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java new file mode 100644 index 0000000..cf4ae7e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S1FPacketSetExperience.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1FPacketSetExperience extends Packet { + private float field_149401_a; + private int field_149399_b; + private int field_149400_c; + + + public S1FPacketSetExperience() {} + + public S1FPacketSetExperience(float p_i45222_1_, int p_i45222_2_, int p_i45222_3_) { + this.field_149401_a = p_i45222_1_; + this.field_149399_b = p_i45222_2_; + this.field_149400_c = p_i45222_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149401_a = p_148837_1_.readFloat(); + this.field_149400_c = p_148837_1_.readShort(); + this.field_149399_b = p_148837_1_.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeFloat(this.field_149401_a); + p_148840_1_.writeShort(this.field_149400_c); + p_148840_1_.writeShort(this.field_149399_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSetExperience(this); + } + + public float func_149397_c() { + return this.field_149401_a; + } + + public int func_149396_d() { + return this.field_149399_b; + } + + public int func_149395_e() { + return this.field_149400_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java new file mode 100644 index 0000000..23e369b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S20PacketEntityProperties.java @@ -0,0 +1,120 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S20PacketEntityProperties extends Packet { + private int field_149445_a; + private final List field_149444_b = new ArrayList(); + + + public S20PacketEntityProperties() {} + + public S20PacketEntityProperties(int p_i45236_1_, Collection p_i45236_2_) { + this.field_149445_a = p_i45236_1_; + Iterator var3 = p_i45236_2_.iterator(); + + while (var3.hasNext()) { + IAttributeInstance var4 = (IAttributeInstance)var3.next(); + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot(var4.getAttribute().getAttributeUnlocalizedName(), var4.getBaseValue(), var4.func_111122_c())); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149445_a = p_148837_1_.readInt(); + int var2 = p_148837_1_.readInt(); + + for (int var3 = 0; var3 < var2; ++var3) { + String var4 = p_148837_1_.readStringFromBuffer(64); + double var5 = p_148837_1_.readDouble(); + ArrayList var7 = new ArrayList(); + short var8 = p_148837_1_.readShort(); + + for (int var9 = 0; var9 < var8; ++var9) { + UUID var10 = new UUID(p_148837_1_.readLong(), p_148837_1_.readLong()); + var7.add(new AttributeModifier(var10, "Unknown synced attribute modifier", p_148837_1_.readDouble(), p_148837_1_.readByte())); + } + + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot(var4, var5, var7)); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149445_a); + p_148840_1_.writeInt(this.field_149444_b.size()); + Iterator var2 = this.field_149444_b.iterator(); + + while (var2.hasNext()) { + S20PacketEntityProperties.Snapshot var3 = (S20PacketEntityProperties.Snapshot)var2.next(); + p_148840_1_.writeStringToBuffer(var3.func_151409_a()); + p_148840_1_.writeDouble(var3.func_151410_b()); + p_148840_1_.writeShort(var3.func_151408_c().size()); + Iterator var4 = var3.func_151408_c().iterator(); + + while (var4.hasNext()) { + AttributeModifier var5 = (AttributeModifier)var4.next(); + p_148840_1_.writeLong(var5.getID().getMostSignificantBits()); + p_148840_1_.writeLong(var5.getID().getLeastSignificantBits()); + p_148840_1_.writeDouble(var5.getAmount()); + p_148840_1_.writeByte(var5.getOperation()); + } + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEntityProperties(this); + } + + public int func_149442_c() { + return this.field_149445_a; + } + + public List func_149441_d() { + return this.field_149444_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } + + public class Snapshot { + private final String field_151412_b; + private final double field_151413_c; + private final Collection field_151411_d; + + + public Snapshot(String p_i45235_2_, double p_i45235_3_, Collection p_i45235_5_) { + this.field_151412_b = p_i45235_2_; + this.field_151413_c = p_i45235_3_; + this.field_151411_d = p_i45235_5_; + } + + public String func_151409_a() { + return this.field_151412_b; + } + + public double func_151410_b() { + return this.field_151413_c; + } + + public Collection func_151408_c() { + return this.field_151411_d; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java new file mode 100644 index 0000000..a412cfe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S21PacketChunkData.java @@ -0,0 +1,236 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.zip.DataFormatException; +import java.util.zip.Deflater; +import java.util.zip.Inflater; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.NibbleArray; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +public class S21PacketChunkData extends Packet { + private int field_149284_a; + private int field_149282_b; + private int field_149283_c; + private int field_149280_d; + private byte[] field_149281_e; + private byte[] field_149278_f; + private boolean field_149279_g; + private int field_149285_h; + private static byte[] field_149286_i = new byte[196864]; + + + public S21PacketChunkData() {} + + public S21PacketChunkData(Chunk p_i45196_1_, boolean p_i45196_2_, int p_i45196_3_) { + this.field_149284_a = p_i45196_1_.xPosition; + this.field_149282_b = p_i45196_1_.zPosition; + this.field_149279_g = p_i45196_2_; + S21PacketChunkData.Extracted var4 = func_149269_a(p_i45196_1_, p_i45196_2_, p_i45196_3_); + Deflater var5 = new Deflater(-1); + this.field_149280_d = var4.field_150281_c; + this.field_149283_c = var4.field_150280_b; + + try { + this.field_149278_f = var4.field_150282_a; + var5.setInput(var4.field_150282_a, 0, var4.field_150282_a.length); + var5.finish(); + this.field_149281_e = new byte[var4.field_150282_a.length]; + this.field_149285_h = var5.deflate(this.field_149281_e); + } + finally { + var5.end(); + } + } + + public static int func_149275_c() { + return 196864; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149284_a = p_148837_1_.readInt(); + this.field_149282_b = p_148837_1_.readInt(); + this.field_149279_g = p_148837_1_.readBoolean(); + this.field_149283_c = p_148837_1_.readShort(); + this.field_149280_d = p_148837_1_.readShort(); + this.field_149285_h = p_148837_1_.readInt(); + + if (field_149286_i.length < this.field_149285_h) { + field_149286_i = new byte[this.field_149285_h]; + } + + p_148837_1_.readBytes(field_149286_i, 0, this.field_149285_h); + int var2 = 0; + int var3; + + for (var3 = 0; var3 < 16; ++var3) { + var2 += this.field_149283_c >> var3 & 1; + } + + var3 = 12288 * var2; + + if (this.field_149279_g) { + var3 += 256; + } + + this.field_149278_f = new byte[var3]; + Inflater var4 = new Inflater(); + var4.setInput(field_149286_i, 0, this.field_149285_h); + + try { + var4.inflate(this.field_149278_f); + } catch (DataFormatException var9) { + throw new IOException("Bad compressed data format"); + } + finally { + var4.end(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149284_a); + p_148840_1_.writeInt(this.field_149282_b); + p_148840_1_.writeBoolean(this.field_149279_g); + p_148840_1_.writeShort((short)(this.field_149283_c & 65535)); + p_148840_1_.writeShort((short)(this.field_149280_d & 65535)); + p_148840_1_.writeInt(this.field_149285_h); + p_148840_1_.writeBytes(this.field_149281_e, 0, this.field_149285_h); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleChunkData(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("x=%d, z=%d, full=%b, sects=%d, add=%d, size=%d", Integer.valueOf(this.field_149284_a), Integer.valueOf(this.field_149282_b), Boolean.valueOf(this.field_149279_g), Integer.valueOf(this.field_149283_c), Integer.valueOf(this.field_149280_d), Integer.valueOf(this.field_149285_h)); + } + + public byte[] func_149272_d() { + return this.field_149278_f; + } + + public static S21PacketChunkData.Extracted func_149269_a(Chunk p_149269_0_, boolean p_149269_1_, int p_149269_2_) { + int var3 = 0; + ExtendedBlockStorage[] var4 = p_149269_0_.getBlockStorageArray(); + int var5 = 0; + S21PacketChunkData.Extracted var6 = new S21PacketChunkData.Extracted(); + byte[] var7 = field_149286_i; + + if (p_149269_1_) { + p_149269_0_.sendUpdates = true; + } + + int var8; + + for (var8 = 0; var8 < var4.length; ++var8) { + if (var4[var8] != null && (!p_149269_1_ || !var4[var8].isEmpty()) && (p_149269_2_ & 1 << var8) != 0) { + var6.field_150280_b |= 1 << var8; + + if (var4[var8].getBlockMSBArray() != null) { + var6.field_150281_c |= 1 << var8; + ++var5; + } + } + } + + for (var8 = 0; var8 < var4.length; ++var8) { + if (var4[var8] != null && (!p_149269_1_ || !var4[var8].isEmpty()) && (p_149269_2_ & 1 << var8) != 0) { + byte[] var9 = var4[var8].getBlockLSBArray(); + System.arraycopy(var9, 0, var7, var3, var9.length); + var3 += var9.length; + } + } + + NibbleArray var11; + + for (var8 = 0; var8 < var4.length; ++var8) { + if (var4[var8] != null && (!p_149269_1_ || !var4[var8].isEmpty()) && (p_149269_2_ & 1 << var8) != 0) { + var11 = var4[var8].getMetadataArray(); + System.arraycopy(var11.data, 0, var7, var3, var11.data.length); + var3 += var11.data.length; + } + } + + for (var8 = 0; var8 < var4.length; ++var8) { + if (var4[var8] != null && (!p_149269_1_ || !var4[var8].isEmpty()) && (p_149269_2_ & 1 << var8) != 0) { + var11 = var4[var8].getBlocklightArray(); + System.arraycopy(var11.data, 0, var7, var3, var11.data.length); + var3 += var11.data.length; + } + } + + if (!p_149269_0_.worldObj.provider.hasNoSky) { + for (var8 = 0; var8 < var4.length; ++var8) { + if (var4[var8] != null && (!p_149269_1_ || !var4[var8].isEmpty()) && (p_149269_2_ & 1 << var8) != 0) { + var11 = var4[var8].getSkylightArray(); + System.arraycopy(var11.data, 0, var7, var3, var11.data.length); + var3 += var11.data.length; + } + } + } + + if (var5 > 0) { + for (var8 = 0; var8 < var4.length; ++var8) { + if (var4[var8] != null && (!p_149269_1_ || !var4[var8].isEmpty()) && var4[var8].getBlockMSBArray() != null && (p_149269_2_ & 1 << var8) != 0) { + var11 = var4[var8].getBlockMSBArray(); + System.arraycopy(var11.data, 0, var7, var3, var11.data.length); + var3 += var11.data.length; + } + } + } + + if (p_149269_1_) { + byte[] var10 = p_149269_0_.getBiomeArray(); + System.arraycopy(var10, 0, var7, var3, var10.length); + var3 += var10.length; + } + + var6.field_150282_a = new byte[var3]; + System.arraycopy(var7, 0, var6.field_150282_a, 0, var3); + return var6; + } + + public int func_149273_e() { + return this.field_149284_a; + } + + public int func_149271_f() { + return this.field_149282_b; + } + + public int func_149276_g() { + return this.field_149283_c; + } + + public int func_149270_h() { + return this.field_149280_d; + } + + public boolean func_149274_i() { + return this.field_149279_g; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } + + public static class Extracted { + public byte[] field_150282_a; + public int field_150280_b; + public int field_150281_c; + + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java new file mode 100644 index 0000000..4486061 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java @@ -0,0 +1,109 @@ +package net.minecraft.network.play.server; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class S22PacketMultiBlockChange extends Packet { + private static final Logger logger = LogManager.getLogger(); + private ChunkCoordIntPair field_148925_b; + private byte[] field_148926_c; + private int field_148924_d; + + + public S22PacketMultiBlockChange() {} + + public S22PacketMultiBlockChange(int p_i45181_1_, short[] p_i45181_2_, Chunk p_i45181_3_) { + this.field_148925_b = new ChunkCoordIntPair(p_i45181_3_.xPosition, p_i45181_3_.zPosition); + this.field_148924_d = p_i45181_1_; + int var4 = 4 * p_i45181_1_; + + try { + ByteArrayOutputStream var5 = new ByteArrayOutputStream(var4); + DataOutputStream var6 = new DataOutputStream(var5); + + for (int var7 = 0; var7 < p_i45181_1_; ++var7) { + int var8 = p_i45181_2_[var7] >> 12 & 15; + int var9 = p_i45181_2_[var7] >> 8 & 15; + int var10 = p_i45181_2_[var7] & 255; + var6.writeShort(p_i45181_2_[var7]); + var6.writeShort((short)((Block.getIdFromBlock(p_i45181_3_.func_150810_a(var8, var10, var9)) & 4095) << 4 | p_i45181_3_.getBlockMetadata(var8, var10, var9) & 15)); + } + + this.field_148926_c = var5.toByteArray(); + + if (this.field_148926_c.length != var4) { + throw new RuntimeException("Expected length " + var4 + " doesn't match received length " + this.field_148926_c.length); + } + } catch (IOException var11) { + logger.error("Couldn't create bulk block update packet", var11); + this.field_148926_c = null; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148925_b = new ChunkCoordIntPair(p_148837_1_.readInt(), p_148837_1_.readInt()); + this.field_148924_d = p_148837_1_.readShort() & 65535; + int var2 = p_148837_1_.readInt(); + + if (var2 > 0) { + this.field_148926_c = new byte[var2]; + p_148837_1_.readBytes(this.field_148926_c); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_148925_b.chunkXPos); + p_148840_1_.writeInt(this.field_148925_b.chunkZPos); + p_148840_1_.writeShort((short)this.field_148924_d); + + if (this.field_148926_c != null) { + p_148840_1_.writeInt(this.field_148926_c.length); + p_148840_1_.writeBytes(this.field_148926_c); + } else { + p_148840_1_.writeInt(0); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleMultiBlockChange(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("xc=%d, zc=%d, count=%d", Integer.valueOf(this.field_148925_b.chunkXPos), Integer.valueOf(this.field_148925_b.chunkZPos), Integer.valueOf(this.field_148924_d)); + } + + public ChunkCoordIntPair func_148920_c() { + return this.field_148925_b; + } + + public byte[] func_148921_d() { + return this.field_148926_c; + } + + public int func_148922_e() { + return this.field_148924_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java new file mode 100644 index 0000000..44ac134 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S23PacketBlockChange.java @@ -0,0 +1,85 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S23PacketBlockChange extends Packet { + private int field_148887_a; + private int field_148885_b; + private int field_148886_c; + private Block field_148883_d; + private int field_148884_e; + + + public S23PacketBlockChange() {} + + public S23PacketBlockChange(int p_i45177_1_, int p_i45177_2_, int p_i45177_3_, World p_i45177_4_) { + this.field_148887_a = p_i45177_1_; + this.field_148885_b = p_i45177_2_; + this.field_148886_c = p_i45177_3_; + this.field_148883_d = p_i45177_4_.getBlock(p_i45177_1_, p_i45177_2_, p_i45177_3_); + this.field_148884_e = p_i45177_4_.getBlockMetadata(p_i45177_1_, p_i45177_2_, p_i45177_3_); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148887_a = p_148837_1_.readInt(); + this.field_148885_b = p_148837_1_.readUnsignedByte(); + this.field_148886_c = p_148837_1_.readInt(); + this.field_148883_d = Block.getBlockById(p_148837_1_.readVarIntFromBuffer()); + this.field_148884_e = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_148887_a); + p_148840_1_.writeByte(this.field_148885_b); + p_148840_1_.writeInt(this.field_148886_c); + p_148840_1_.writeVarIntToBuffer(Block.getIdFromBlock(this.field_148883_d)); + p_148840_1_.writeByte(this.field_148884_e); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleBlockChange(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("type=%d, data=%d, x=%d, y=%d, z=%d", Integer.valueOf(Block.getIdFromBlock(this.field_148883_d)), Integer.valueOf(this.field_148884_e), Integer.valueOf(this.field_148887_a), Integer.valueOf(this.field_148885_b), Integer.valueOf(this.field_148886_c)); + } + + public Block func_148880_c() { + return this.field_148883_d; + } + + public int func_148879_d() { + return this.field_148887_a; + } + + public int func_148878_e() { + return this.field_148885_b; + } + + public int func_148877_f() { + return this.field_148886_c; + } + + public int func_148881_g() { + return this.field_148884_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java new file mode 100644 index 0000000..3a2757a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S24PacketBlockAction.java @@ -0,0 +1,85 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S24PacketBlockAction extends Packet { + private int field_148876_a; + private int field_148874_b; + private int field_148875_c; + private int field_148872_d; + private int field_148873_e; + private Block field_148871_f; + + + public S24PacketBlockAction() {} + + public S24PacketBlockAction(int p_i45176_1_, int p_i45176_2_, int p_i45176_3_, Block p_i45176_4_, int p_i45176_5_, int p_i45176_6_) { + this.field_148876_a = p_i45176_1_; + this.field_148874_b = p_i45176_2_; + this.field_148875_c = p_i45176_3_; + this.field_148872_d = p_i45176_5_; + this.field_148873_e = p_i45176_6_; + this.field_148871_f = p_i45176_4_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148876_a = p_148837_1_.readInt(); + this.field_148874_b = p_148837_1_.readShort(); + this.field_148875_c = p_148837_1_.readInt(); + this.field_148872_d = p_148837_1_.readUnsignedByte(); + this.field_148873_e = p_148837_1_.readUnsignedByte(); + this.field_148871_f = Block.getBlockById(p_148837_1_.readVarIntFromBuffer() & 4095); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_148876_a); + p_148840_1_.writeShort(this.field_148874_b); + p_148840_1_.writeInt(this.field_148875_c); + p_148840_1_.writeByte(this.field_148872_d); + p_148840_1_.writeByte(this.field_148873_e); + p_148840_1_.writeVarIntToBuffer(Block.getIdFromBlock(this.field_148871_f) & 4095); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleBlockAction(this); + } + + public Block func_148868_c() { + return this.field_148871_f; + } + + public int func_148867_d() { + return this.field_148876_a; + } + + public int func_148866_e() { + return this.field_148874_b; + } + + public int func_148865_f() { + return this.field_148875_c; + } + + public int func_148869_g() { + return this.field_148872_d; + } + + public int func_148864_h() { + return this.field_148873_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java new file mode 100644 index 0000000..0cdbb12 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java @@ -0,0 +1,76 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S25PacketBlockBreakAnim extends Packet { + private int field_148852_a; + private int field_148850_b; + private int field_148851_c; + private int field_148848_d; + private int field_148849_e; + + + public S25PacketBlockBreakAnim() {} + + public S25PacketBlockBreakAnim(int p_i45174_1_, int p_i45174_2_, int p_i45174_3_, int p_i45174_4_, int p_i45174_5_) { + this.field_148852_a = p_i45174_1_; + this.field_148850_b = p_i45174_2_; + this.field_148851_c = p_i45174_3_; + this.field_148848_d = p_i45174_4_; + this.field_148849_e = p_i45174_5_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148852_a = p_148837_1_.readVarIntFromBuffer(); + this.field_148850_b = p_148837_1_.readInt(); + this.field_148851_c = p_148837_1_.readInt(); + this.field_148848_d = p_148837_1_.readInt(); + this.field_148849_e = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_148852_a); + p_148840_1_.writeInt(this.field_148850_b); + p_148840_1_.writeInt(this.field_148851_c); + p_148840_1_.writeInt(this.field_148848_d); + p_148840_1_.writeByte(this.field_148849_e); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleBlockBreakAnim(this); + } + + public int func_148845_c() { + return this.field_148852_a; + } + + public int func_148844_d() { + return this.field_148850_b; + } + + public int func_148843_e() { + return this.field_148851_c; + } + + public int func_148842_f() { + return this.field_148848_d; + } + + public int func_148846_g() { + return this.field_148849_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java new file mode 100644 index 0000000..cd10228 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java @@ -0,0 +1,199 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import java.util.zip.DataFormatException; +import java.util.zip.Deflater; +import java.util.zip.Inflater; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.chunk.Chunk; + +public class S26PacketMapChunkBulk extends Packet { + private int[] field_149266_a; + private int[] field_149264_b; + private int[] field_149265_c; + private int[] field_149262_d; + private byte[] field_149263_e; + private byte[][] field_149260_f; + private int field_149261_g; + private boolean field_149267_h; + private static byte[] field_149268_i = new byte[0]; + + + public S26PacketMapChunkBulk() {} + + public S26PacketMapChunkBulk(List p_i45197_1_) { + int var2 = p_i45197_1_.size(); + this.field_149266_a = new int[var2]; + this.field_149264_b = new int[var2]; + this.field_149265_c = new int[var2]; + this.field_149262_d = new int[var2]; + this.field_149260_f = new byte[var2][]; + this.field_149267_h = !p_i45197_1_.isEmpty() && !((Chunk)p_i45197_1_.get(0)).worldObj.provider.hasNoSky; + int var3 = 0; + + for (int var4 = 0; var4 < var2; ++var4) { + Chunk var5 = (Chunk)p_i45197_1_.get(var4); + S21PacketChunkData.Extracted var6 = S21PacketChunkData.func_149269_a(var5, true, 65535); + + if (field_149268_i.length < var3 + var6.field_150282_a.length) { + byte[] var7 = new byte[var3 + var6.field_150282_a.length]; + System.arraycopy(field_149268_i, 0, var7, 0, field_149268_i.length); + field_149268_i = var7; + } + + System.arraycopy(var6.field_150282_a, 0, field_149268_i, var3, var6.field_150282_a.length); + var3 += var6.field_150282_a.length; + this.field_149266_a[var4] = var5.xPosition; + this.field_149264_b[var4] = var5.zPosition; + this.field_149265_c[var4] = var6.field_150280_b; + this.field_149262_d[var4] = var6.field_150281_c; + this.field_149260_f[var4] = var6.field_150282_a; + } + + Deflater var11 = new Deflater(-1); + + try { + var11.setInput(field_149268_i, 0, var3); + var11.finish(); + this.field_149263_e = new byte[var3]; + this.field_149261_g = var11.deflate(this.field_149263_e); + } + finally { + var11.end(); + } + } + + public static int func_149258_c() { + return 5; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + short var2 = p_148837_1_.readShort(); + this.field_149261_g = p_148837_1_.readInt(); + this.field_149267_h = p_148837_1_.readBoolean(); + this.field_149266_a = new int[var2]; + this.field_149264_b = new int[var2]; + this.field_149265_c = new int[var2]; + this.field_149262_d = new int[var2]; + this.field_149260_f = new byte[var2][]; + + if (field_149268_i.length < this.field_149261_g) { + field_149268_i = new byte[this.field_149261_g]; + } + + p_148837_1_.readBytes(field_149268_i, 0, this.field_149261_g); + byte[] var3 = new byte[S21PacketChunkData.func_149275_c() * var2]; + Inflater var4 = new Inflater(); + var4.setInput(field_149268_i, 0, this.field_149261_g); + + try { + var4.inflate(var3); + } catch (DataFormatException var12) { + throw new IOException("Bad compressed data format"); + } + finally { + var4.end(); + } + + int var5 = 0; + + for (int var6 = 0; var6 < var2; ++var6) { + this.field_149266_a[var6] = p_148837_1_.readInt(); + this.field_149264_b[var6] = p_148837_1_.readInt(); + this.field_149265_c[var6] = p_148837_1_.readShort(); + this.field_149262_d[var6] = p_148837_1_.readShort(); + int var7 = 0; + int var8 = 0; + int var9; + + for (var9 = 0; var9 < 16; ++var9) { + var7 += this.field_149265_c[var6] >> var9 & 1; + var8 += this.field_149262_d[var6] >> var9 & 1; + } + + var9 = 2048 * 4 * var7 + 256; + var9 += 2048 * var8; + + if (this.field_149267_h) { + var9 += 2048 * var7; + } + + this.field_149260_f[var6] = new byte[var9]; + System.arraycopy(var3, var5, this.field_149260_f[var6], 0, var9); + var5 += var9; + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeShort(this.field_149266_a.length); + p_148840_1_.writeInt(this.field_149261_g); + p_148840_1_.writeBoolean(this.field_149267_h); + p_148840_1_.writeBytes(this.field_149263_e, 0, this.field_149261_g); + + for (int var2 = 0; var2 < this.field_149266_a.length; ++var2) { + p_148840_1_.writeInt(this.field_149266_a[var2]); + p_148840_1_.writeInt(this.field_149264_b[var2]); + p_148840_1_.writeShort((short)(this.field_149265_c[var2] & 65535)); + p_148840_1_.writeShort((short)(this.field_149262_d[var2] & 65535)); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleMapChunkBulk(this); + } + + public int func_149255_a(int p_149255_1_) { + return this.field_149266_a[p_149255_1_]; + } + + public int func_149253_b(int p_149253_1_) { + return this.field_149264_b[p_149253_1_]; + } + + public int func_149254_d() { + return this.field_149266_a.length; + } + + public byte[] func_149256_c(int p_149256_1_) { + return this.field_149260_f[p_149256_1_]; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + StringBuilder var1 = new StringBuilder(); + + for (int var2 = 0; var2 < this.field_149266_a.length; ++var2) { + if (var2 > 0) { + var1.append(", "); + } + + var1.append(String.format("{x=%d, z=%d, sections=%d, adds=%d, data=%d}", Integer.valueOf(this.field_149266_a[var2]), Integer.valueOf(this.field_149264_b[var2]), Integer.valueOf(this.field_149265_c[var2]), Integer.valueOf(this.field_149262_d[var2]), Integer.valueOf(this.field_149260_f[var2].length))); + } + + return String.format("size=%d, chunks=%d[%s]", Integer.valueOf(this.field_149261_g), Integer.valueOf(this.field_149266_a.length), var1); + } + + public int[] func_149252_e() { + return this.field_149265_c; + } + + public int[] func_149257_f() { + return this.field_149262_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java new file mode 100644 index 0000000..905d193 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S27PacketExplosion.java @@ -0,0 +1,135 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkPosition; + +public class S27PacketExplosion extends Packet { + private double field_149158_a; + private double field_149156_b; + private double field_149157_c; + private float field_149154_d; + private List field_149155_e; + private float field_149152_f; + private float field_149153_g; + private float field_149159_h; + + + public S27PacketExplosion() {} + + public S27PacketExplosion(double p_i45193_1_, double p_i45193_3_, double p_i45193_5_, float p_i45193_7_, List p_i45193_8_, Vec3 p_i45193_9_) { + this.field_149158_a = p_i45193_1_; + this.field_149156_b = p_i45193_3_; + this.field_149157_c = p_i45193_5_; + this.field_149154_d = p_i45193_7_; + this.field_149155_e = new ArrayList(p_i45193_8_); + + if (p_i45193_9_ != null) { + this.field_149152_f = (float)p_i45193_9_.xCoord; + this.field_149153_g = (float)p_i45193_9_.yCoord; + this.field_149159_h = (float)p_i45193_9_.zCoord; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149158_a = p_148837_1_.readFloat(); + this.field_149156_b = p_148837_1_.readFloat(); + this.field_149157_c = p_148837_1_.readFloat(); + this.field_149154_d = p_148837_1_.readFloat(); + int var2 = p_148837_1_.readInt(); + this.field_149155_e = new ArrayList(var2); + int var3 = (int)this.field_149158_a; + int var4 = (int)this.field_149156_b; + int var5 = (int)this.field_149157_c; + + for (int var6 = 0; var6 < var2; ++var6) { + int var7 = p_148837_1_.readByte() + var3; + int var8 = p_148837_1_.readByte() + var4; + int var9 = p_148837_1_.readByte() + var5; + this.field_149155_e.add(new ChunkPosition(var7, var8, var9)); + } + + this.field_149152_f = p_148837_1_.readFloat(); + this.field_149153_g = p_148837_1_.readFloat(); + this.field_149159_h = p_148837_1_.readFloat(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeFloat((float)this.field_149158_a); + p_148840_1_.writeFloat((float)this.field_149156_b); + p_148840_1_.writeFloat((float)this.field_149157_c); + p_148840_1_.writeFloat(this.field_149154_d); + p_148840_1_.writeInt(this.field_149155_e.size()); + int var2 = (int)this.field_149158_a; + int var3 = (int)this.field_149156_b; + int var4 = (int)this.field_149157_c; + Iterator var5 = this.field_149155_e.iterator(); + + while (var5.hasNext()) { + ChunkPosition var6 = (ChunkPosition)var5.next(); + int var7 = var6.field_151329_a - var2; + int var8 = var6.field_151327_b - var3; + int var9 = var6.field_151328_c - var4; + p_148840_1_.writeByte(var7); + p_148840_1_.writeByte(var8); + p_148840_1_.writeByte(var9); + } + + p_148840_1_.writeFloat(this.field_149152_f); + p_148840_1_.writeFloat(this.field_149153_g); + p_148840_1_.writeFloat(this.field_149159_h); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleExplosion(this); + } + + public float func_149149_c() { + return this.field_149152_f; + } + + public float func_149144_d() { + return this.field_149153_g; + } + + public float func_149147_e() { + return this.field_149159_h; + } + + public double func_149148_f() { + return this.field_149158_a; + } + + public double func_149143_g() { + return this.field_149156_b; + } + + public double func_149145_h() { + return this.field_149157_c; + } + + public float func_149146_i() { + return this.field_149154_d; + } + + public List func_149150_j() { + return this.field_149155_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java new file mode 100644 index 0000000..4a43d51 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S28PacketEffect.java @@ -0,0 +1,84 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S28PacketEffect extends Packet { + private int field_149251_a; + private int field_149249_b; + private int field_149250_c; + private int field_149247_d; + private int field_149248_e; + private boolean field_149246_f; + + + public S28PacketEffect() {} + + public S28PacketEffect(int p_i45198_1_, int p_i45198_2_, int p_i45198_3_, int p_i45198_4_, int p_i45198_5_, boolean p_i45198_6_) { + this.field_149251_a = p_i45198_1_; + this.field_149250_c = p_i45198_2_; + this.field_149247_d = p_i45198_3_; + this.field_149248_e = p_i45198_4_; + this.field_149249_b = p_i45198_5_; + this.field_149246_f = p_i45198_6_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149251_a = p_148837_1_.readInt(); + this.field_149250_c = p_148837_1_.readInt(); + this.field_149247_d = p_148837_1_.readByte() & 255; + this.field_149248_e = p_148837_1_.readInt(); + this.field_149249_b = p_148837_1_.readInt(); + this.field_149246_f = p_148837_1_.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149251_a); + p_148840_1_.writeInt(this.field_149250_c); + p_148840_1_.writeByte(this.field_149247_d & 255); + p_148840_1_.writeInt(this.field_149248_e); + p_148840_1_.writeInt(this.field_149249_b); + p_148840_1_.writeBoolean(this.field_149246_f); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleEffect(this); + } + + public boolean func_149244_c() { + return this.field_149246_f; + } + + public int func_149242_d() { + return this.field_149251_a; + } + + public int func_149241_e() { + return this.field_149249_b; + } + + public int func_149240_f() { + return this.field_149250_c; + } + + public int func_149243_g() { + return this.field_149247_d; + } + + public int func_149239_h() { + return this.field_149248_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java new file mode 100644 index 0000000..a3fc604 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S29PacketSoundEffect.java @@ -0,0 +1,94 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import org.apache.commons.lang3.Validate; + +public class S29PacketSoundEffect extends Packet { + private String field_149219_a; + private int field_149217_b; + private int field_149218_c = Integer.MAX_VALUE; + private int field_149215_d; + private float field_149216_e; + private int field_149214_f; + + + public S29PacketSoundEffect() {} + + public S29PacketSoundEffect(String p_i45200_1_, double p_i45200_2_, double p_i45200_4_, double p_i45200_6_, float p_i45200_8_, float p_i45200_9_) { + Validate.notNull(p_i45200_1_, "name"); + this.field_149219_a = p_i45200_1_; + this.field_149217_b = (int)(p_i45200_2_ * 8.0D); + this.field_149218_c = (int)(p_i45200_4_ * 8.0D); + this.field_149215_d = (int)(p_i45200_6_ * 8.0D); + this.field_149216_e = p_i45200_8_; + this.field_149214_f = (int)(p_i45200_9_ * 63.0F); + + if (this.field_149214_f < 0) { + this.field_149214_f = 0; + } + + if (this.field_149214_f > 255) { + this.field_149214_f = 255; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149219_a = p_148837_1_.readStringFromBuffer(256); + this.field_149217_b = p_148837_1_.readInt(); + this.field_149218_c = p_148837_1_.readInt(); + this.field_149215_d = p_148837_1_.readInt(); + this.field_149216_e = p_148837_1_.readFloat(); + this.field_149214_f = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149219_a); + p_148840_1_.writeInt(this.field_149217_b); + p_148840_1_.writeInt(this.field_149218_c); + p_148840_1_.writeInt(this.field_149215_d); + p_148840_1_.writeFloat(this.field_149216_e); + p_148840_1_.writeByte(this.field_149214_f); + } + + public String func_149212_c() { + return this.field_149219_a; + } + + public double func_149207_d() { + return (float)this.field_149217_b / 8.0F; + } + + public double func_149211_e() { + return (float)this.field_149218_c / 8.0F; + } + + public double func_149210_f() { + return (float)this.field_149215_d / 8.0F; + } + + public float func_149208_g() { + return this.field_149216_e; + } + + public float func_149209_h() { + return (float)this.field_149214_f / 63.0F; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSoundEffect(this); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java new file mode 100644 index 0000000..e0b7237 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2APacketParticles.java @@ -0,0 +1,108 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2APacketParticles extends Packet { + private String field_149236_a; + private float field_149234_b; + private float field_149235_c; + private float field_149232_d; + private float field_149233_e; + private float field_149230_f; + private float field_149231_g; + private float field_149237_h; + private int field_149238_i; + + + public S2APacketParticles() {} + + public S2APacketParticles(String p_i45199_1_, float p_i45199_2_, float p_i45199_3_, float p_i45199_4_, float p_i45199_5_, float p_i45199_6_, float p_i45199_7_, float p_i45199_8_, int p_i45199_9_) { + this.field_149236_a = p_i45199_1_; + this.field_149234_b = p_i45199_2_; + this.field_149235_c = p_i45199_3_; + this.field_149232_d = p_i45199_4_; + this.field_149233_e = p_i45199_5_; + this.field_149230_f = p_i45199_6_; + this.field_149231_g = p_i45199_7_; + this.field_149237_h = p_i45199_8_; + this.field_149238_i = p_i45199_9_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149236_a = p_148837_1_.readStringFromBuffer(64); + this.field_149234_b = p_148837_1_.readFloat(); + this.field_149235_c = p_148837_1_.readFloat(); + this.field_149232_d = p_148837_1_.readFloat(); + this.field_149233_e = p_148837_1_.readFloat(); + this.field_149230_f = p_148837_1_.readFloat(); + this.field_149231_g = p_148837_1_.readFloat(); + this.field_149237_h = p_148837_1_.readFloat(); + this.field_149238_i = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149236_a); + p_148840_1_.writeFloat(this.field_149234_b); + p_148840_1_.writeFloat(this.field_149235_c); + p_148840_1_.writeFloat(this.field_149232_d); + p_148840_1_.writeFloat(this.field_149233_e); + p_148840_1_.writeFloat(this.field_149230_f); + p_148840_1_.writeFloat(this.field_149231_g); + p_148840_1_.writeFloat(this.field_149237_h); + p_148840_1_.writeInt(this.field_149238_i); + } + + public String func_149228_c() { + return this.field_149236_a; + } + + public double func_149220_d() { + return this.field_149234_b; + } + + public double func_149226_e() { + return this.field_149235_c; + } + + public double func_149225_f() { + return this.field_149232_d; + } + + public float func_149221_g() { + return this.field_149233_e; + } + + public float func_149224_h() { + return this.field_149230_f; + } + + public float func_149223_i() { + return this.field_149231_g; + } + + public float func_149227_j() { + return this.field_149237_h; + } + + public int func_149222_k() { + return this.field_149238_i; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleParticles(this); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java new file mode 100644 index 0000000..000eb57 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java @@ -0,0 +1,53 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2BPacketChangeGameState extends Packet { + public static final String[] field_149142_a = new String[] {"tile.bed.notValid", null, null, "gameMode.changed"}; + private int field_149140_b; + private float field_149141_c; + + + public S2BPacketChangeGameState() {} + + public S2BPacketChangeGameState(int p_i45194_1_, float p_i45194_2_) { + this.field_149140_b = p_i45194_1_; + this.field_149141_c = p_i45194_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149140_b = p_148837_1_.readUnsignedByte(); + this.field_149141_c = p_148837_1_.readFloat(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149140_b); + p_148840_1_.writeFloat(this.field_149141_c); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleChangeGameState(this); + } + + public int func_149138_c() { + return this.field_149140_b; + } + + public float func_149137_d() { + return this.field_149141_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java new file mode 100644 index 0000000..a70413d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java @@ -0,0 +1,89 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S2CPacketSpawnGlobalEntity extends Packet { + private int field_149059_a; + private int field_149057_b; + private int field_149058_c; + private int field_149055_d; + private int field_149056_e; + + + public S2CPacketSpawnGlobalEntity() {} + + public S2CPacketSpawnGlobalEntity(Entity p_i45191_1_) { + this.field_149059_a = p_i45191_1_.getEntityId(); + this.field_149057_b = MathHelper.floor_double(p_i45191_1_.posX * 32.0D); + this.field_149058_c = MathHelper.floor_double(p_i45191_1_.posY * 32.0D); + this.field_149055_d = MathHelper.floor_double(p_i45191_1_.posZ * 32.0D); + + if (p_i45191_1_ instanceof EntityLightningBolt) { + this.field_149056_e = 1; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149059_a = p_148837_1_.readVarIntFromBuffer(); + this.field_149056_e = p_148837_1_.readByte(); + this.field_149057_b = p_148837_1_.readInt(); + this.field_149058_c = p_148837_1_.readInt(); + this.field_149055_d = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_149059_a); + p_148840_1_.writeByte(this.field_149056_e); + p_148840_1_.writeInt(this.field_149057_b); + p_148840_1_.writeInt(this.field_149058_c); + p_148840_1_.writeInt(this.field_149055_d); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSpawnGlobalEntity(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, type=%d, x=%.2f, y=%.2f, z=%.2f", Integer.valueOf(this.field_149059_a), Integer.valueOf(this.field_149056_e), Float.valueOf((float)this.field_149057_b / 32.0F), Float.valueOf((float)this.field_149058_c / 32.0F), Float.valueOf((float)this.field_149055_d / 32.0F)); + } + + public int func_149052_c() { + return this.field_149059_a; + } + + public int func_149051_d() { + return this.field_149057_b; + } + + public int func_149050_e() { + return this.field_149058_c; + } + + public int func_149049_f() { + return this.field_149055_d; + } + + public int func_149053_g() { + return this.field_149056_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java new file mode 100644 index 0000000..5d7caed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java @@ -0,0 +1,94 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2DPacketOpenWindow extends Packet { + private int field_148909_a; + private int field_148907_b; + private String field_148908_c; + private int field_148905_d; + private boolean field_148906_e; + private int field_148904_f; + + + public S2DPacketOpenWindow() {} + + public S2DPacketOpenWindow(int p_i45184_1_, int p_i45184_2_, String p_i45184_3_, int p_i45184_4_, boolean p_i45184_5_) { + this.field_148909_a = p_i45184_1_; + this.field_148907_b = p_i45184_2_; + this.field_148908_c = p_i45184_3_; + this.field_148905_d = p_i45184_4_; + this.field_148906_e = p_i45184_5_; + } + + public S2DPacketOpenWindow(int p_i45185_1_, int p_i45185_2_, String p_i45185_3_, int p_i45185_4_, boolean p_i45185_5_, int p_i45185_6_) { + this(p_i45185_1_, p_i45185_2_, p_i45185_3_, p_i45185_4_, p_i45185_5_); + this.field_148904_f = p_i45185_6_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleOpenWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148909_a = p_148837_1_.readUnsignedByte(); + this.field_148907_b = p_148837_1_.readUnsignedByte(); + this.field_148908_c = p_148837_1_.readStringFromBuffer(32); + this.field_148905_d = p_148837_1_.readUnsignedByte(); + this.field_148906_e = p_148837_1_.readBoolean(); + + if (this.field_148907_b == 11) { + this.field_148904_f = p_148837_1_.readInt(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_148909_a); + p_148840_1_.writeByte(this.field_148907_b); + p_148840_1_.writeStringToBuffer(this.field_148908_c); + p_148840_1_.writeByte(this.field_148905_d); + p_148840_1_.writeBoolean(this.field_148906_e); + + if (this.field_148907_b == 11) { + p_148840_1_.writeInt(this.field_148904_f); + } + } + + public int func_148901_c() { + return this.field_148909_a; + } + + public int func_148899_d() { + return this.field_148907_b; + } + + public String func_148902_e() { + return this.field_148908_c; + } + + public int func_148898_f() { + return this.field_148905_d; + } + + public boolean func_148900_g() { + return this.field_148906_e; + } + + public int func_148897_h() { + return this.field_148904_f; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java new file mode 100644 index 0000000..aa1272e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java @@ -0,0 +1,40 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2EPacketCloseWindow extends Packet { + private int field_148896_a; + + + public S2EPacketCloseWindow() {} + + public S2EPacketCloseWindow(int p_i45183_1_) { + this.field_148896_a = p_i45183_1_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleCloseWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148896_a = p_148837_1_.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_148896_a); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java new file mode 100644 index 0000000..54d9b7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S2FPacketSetSlot.java @@ -0,0 +1,61 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2FPacketSetSlot extends Packet { + private int field_149179_a; + private int field_149177_b; + private ItemStack field_149178_c; + + + public S2FPacketSetSlot() {} + + public S2FPacketSetSlot(int p_i45188_1_, int p_i45188_2_, ItemStack p_i45188_3_) { + this.field_149179_a = p_i45188_1_; + this.field_149177_b = p_i45188_2_; + this.field_149178_c = p_i45188_3_ == null ? null : p_i45188_3_.copy(); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSetSlot(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149179_a = p_148837_1_.readByte(); + this.field_149177_b = p_148837_1_.readShort(); + this.field_149178_c = p_148837_1_.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149179_a); + p_148840_1_.writeShort(this.field_149177_b); + p_148840_1_.writeItemStackToBuffer(this.field_149178_c); + } + + public int func_149175_c() { + return this.field_149179_a; + } + + public int func_149173_d() { + return this.field_149177_b; + } + + public ItemStack func_149174_e() { + return this.field_149178_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java new file mode 100644 index 0000000..f76f905 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S30PacketWindowItems.java @@ -0,0 +1,71 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S30PacketWindowItems extends Packet { + private int field_148914_a; + private ItemStack[] field_148913_b; + + + public S30PacketWindowItems() {} + + public S30PacketWindowItems(int p_i45186_1_, List p_i45186_2_) { + this.field_148914_a = p_i45186_1_; + this.field_148913_b = new ItemStack[p_i45186_2_.size()]; + + for (int var3 = 0; var3 < this.field_148913_b.length; ++var3) { + ItemStack var4 = (ItemStack)p_i45186_2_.get(var3); + this.field_148913_b[var3] = var4 == null ? null : var4.copy(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148914_a = p_148837_1_.readUnsignedByte(); + short var2 = p_148837_1_.readShort(); + this.field_148913_b = new ItemStack[var2]; + + for (int var3 = 0; var3 < var2; ++var3) { + this.field_148913_b[var3] = p_148837_1_.readItemStackFromBuffer(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_148914_a); + p_148840_1_.writeShort(this.field_148913_b.length); + ItemStack[] var2 = this.field_148913_b; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; + p_148840_1_.writeItemStackToBuffer(var5); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleWindowItems(this); + } + + public int func_148911_c() { + return this.field_148914_a; + } + + public ItemStack[] func_148910_d() { + return this.field_148913_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java new file mode 100644 index 0000000..f029984 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S31PacketWindowProperty.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S31PacketWindowProperty extends Packet { + private int field_149186_a; + private int field_149184_b; + private int field_149185_c; + + + public S31PacketWindowProperty() {} + + public S31PacketWindowProperty(int p_i45187_1_, int p_i45187_2_, int p_i45187_3_) { + this.field_149186_a = p_i45187_1_; + this.field_149184_b = p_i45187_2_; + this.field_149185_c = p_i45187_3_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleWindowProperty(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149186_a = p_148837_1_.readUnsignedByte(); + this.field_149184_b = p_148837_1_.readShort(); + this.field_149185_c = p_148837_1_.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149186_a); + p_148840_1_.writeShort(this.field_149184_b); + p_148840_1_.writeShort(this.field_149185_c); + } + + public int func_149182_c() { + return this.field_149186_a; + } + + public int func_149181_d() { + return this.field_149184_b; + } + + public int func_149180_e() { + return this.field_149185_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java new file mode 100644 index 0000000..4e6c03b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java @@ -0,0 +1,67 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S32PacketConfirmTransaction extends Packet { + private int field_148894_a; + private short field_148892_b; + private boolean field_148893_c; + + + public S32PacketConfirmTransaction() {} + + public S32PacketConfirmTransaction(int p_i45182_1_, short p_i45182_2_, boolean p_i45182_3_) { + this.field_148894_a = p_i45182_1_; + this.field_148892_b = p_i45182_2_; + this.field_148893_c = p_i45182_3_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleConfirmTransaction(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148894_a = p_148837_1_.readUnsignedByte(); + this.field_148892_b = p_148837_1_.readShort(); + this.field_148893_c = p_148837_1_.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_148894_a); + p_148840_1_.writeShort(this.field_148892_b); + p_148840_1_.writeBoolean(this.field_148893_c); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, uid=%d, accepted=%b", Integer.valueOf(this.field_148894_a), Short.valueOf(this.field_148892_b), Boolean.valueOf(this.field_148893_c)); + } + + public int func_148889_c() { + return this.field_148894_a; + } + + public short func_148890_d() { + return this.field_148892_b; + } + + public boolean func_148888_e() { + return this.field_148893_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java new file mode 100644 index 0000000..6babbf6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S33PacketUpdateSign.java @@ -0,0 +1,75 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S33PacketUpdateSign extends Packet { + private int field_149352_a; + private int field_149350_b; + private int field_149351_c; + private String[] field_149349_d; + + + public S33PacketUpdateSign() {} + + public S33PacketUpdateSign(int p_i45231_1_, int p_i45231_2_, int p_i45231_3_, String[] p_i45231_4_) { + this.field_149352_a = p_i45231_1_; + this.field_149350_b = p_i45231_2_; + this.field_149351_c = p_i45231_3_; + this.field_149349_d = new String[] {p_i45231_4_[0], p_i45231_4_[1], p_i45231_4_[2], p_i45231_4_[3]}; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149352_a = p_148837_1_.readInt(); + this.field_149350_b = p_148837_1_.readShort(); + this.field_149351_c = p_148837_1_.readInt(); + this.field_149349_d = new String[4]; + + for (int var2 = 0; var2 < 4; ++var2) { + this.field_149349_d[var2] = p_148837_1_.readStringFromBuffer(15); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149352_a); + p_148840_1_.writeShort(this.field_149350_b); + p_148840_1_.writeInt(this.field_149351_c); + + for (int var2 = 0; var2 < 4; ++var2) { + p_148840_1_.writeStringToBuffer(this.field_149349_d[var2]); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleUpdateSign(this); + } + + public int func_149346_c() { + return this.field_149352_a; + } + + public int func_149345_d() { + return this.field_149350_b; + } + + public int func_149344_e() { + return this.field_149351_c; + } + + public String[] func_149347_f() { + return this.field_149349_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java new file mode 100644 index 0000000..1ca80bf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S34PacketMaps.java @@ -0,0 +1,61 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S34PacketMaps extends Packet { + private int field_149191_a; + private byte[] field_149190_b; + + + public S34PacketMaps() {} + + public S34PacketMaps(int p_i45202_1_, byte[] p_i45202_2_) { + this.field_149191_a = p_i45202_1_; + this.field_149190_b = p_i45202_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149191_a = p_148837_1_.readVarIntFromBuffer(); + this.field_149190_b = new byte[p_148837_1_.readUnsignedShort()]; + p_148837_1_.readBytes(this.field_149190_b); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_149191_a); + p_148840_1_.writeShort(this.field_149190_b.length); + p_148840_1_.writeBytes(this.field_149190_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleMaps(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("id=%d, length=%d", Integer.valueOf(this.field_149191_a), Integer.valueOf(this.field_149190_b.length)); + } + + public int func_149188_c() { + return this.field_149191_a; + } + + public byte[] func_149187_d() { + return this.field_149190_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java new file mode 100644 index 0000000..f389bac --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java @@ -0,0 +1,77 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S35PacketUpdateTileEntity extends Packet { + private int field_148863_a; + private int field_148861_b; + private int field_148862_c; + private int field_148859_d; + private NBTTagCompound field_148860_e; + + + public S35PacketUpdateTileEntity() {} + + public S35PacketUpdateTileEntity(int p_i45175_1_, int p_i45175_2_, int p_i45175_3_, int p_i45175_4_, NBTTagCompound p_i45175_5_) { + this.field_148863_a = p_i45175_1_; + this.field_148861_b = p_i45175_2_; + this.field_148862_c = p_i45175_3_; + this.field_148859_d = p_i45175_4_; + this.field_148860_e = p_i45175_5_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_148863_a = p_148837_1_.readInt(); + this.field_148861_b = p_148837_1_.readShort(); + this.field_148862_c = p_148837_1_.readInt(); + this.field_148859_d = p_148837_1_.readUnsignedByte(); + this.field_148860_e = p_148837_1_.readNBTTagCompoundFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_148863_a); + p_148840_1_.writeShort(this.field_148861_b); + p_148840_1_.writeInt(this.field_148862_c); + p_148840_1_.writeByte((byte)this.field_148859_d); + p_148840_1_.writeNBTTagCompoundToBuffer(this.field_148860_e); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleUpdateTileEntity(this); + } + + public int func_148856_c() { + return this.field_148863_a; + } + + public int func_148855_d() { + return this.field_148861_b; + } + + public int func_148854_e() { + return this.field_148862_c; + } + + public int func_148853_f() { + return this.field_148859_d; + } + + public NBTTagCompound func_148857_g() { + return this.field_148860_e; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java new file mode 100644 index 0000000..01a10c3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S36PacketSignEditorOpen extends Packet { + private int field_149133_a; + private int field_149131_b; + private int field_149132_c; + + + public S36PacketSignEditorOpen() {} + + public S36PacketSignEditorOpen(int p_i45207_1_, int p_i45207_2_, int p_i45207_3_) { + this.field_149133_a = p_i45207_1_; + this.field_149131_b = p_i45207_2_; + this.field_149132_c = p_i45207_3_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleSignEditorOpen(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149133_a = p_148837_1_.readInt(); + this.field_149131_b = p_148837_1_.readInt(); + this.field_149132_c = p_148837_1_.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeInt(this.field_149133_a); + p_148840_1_.writeInt(this.field_149131_b); + p_148840_1_.writeInt(this.field_149132_c); + } + + public int func_149129_c() { + return this.field_149133_a; + } + + public int func_149128_d() { + return this.field_149131_b; + } + + public int func_149127_e() { + return this.field_149132_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java new file mode 100644 index 0000000..4607044 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S37PacketStatistics.java @@ -0,0 +1,74 @@ +package net.minecraft.network.play.server; + +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; + +public class S37PacketStatistics extends Packet { + private Map field_148976_a; + + + public S37PacketStatistics() {} + + public S37PacketStatistics(Map p_i45173_1_) { + this.field_148976_a = p_i45173_1_; + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleStatistics(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + int var2 = p_148837_1_.readVarIntFromBuffer(); + this.field_148976_a = Maps.newHashMap(); + + for (int var3 = 0; var3 < var2; ++var3) { + StatBase var4 = StatList.func_151177_a(p_148837_1_.readStringFromBuffer(32767)); + int var5 = p_148837_1_.readVarIntFromBuffer(); + + if (var4 != null) { + this.field_148976_a.put(var4, Integer.valueOf(var5)); + } + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_148976_a.size()); + Iterator var2 = this.field_148976_a.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + p_148840_1_.writeStringToBuffer(((StatBase)var3.getKey()).statId); + p_148840_1_.writeVarIntToBuffer(((Integer)var3.getValue()).intValue()); + } + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("count=%d", Integer.valueOf(this.field_148976_a.size())); + } + + public Map func_148974_c() { + return this.field_148976_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java new file mode 100644 index 0000000..73df147 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S38PacketPlayerListItem extends Packet { + private String field_149126_a; + private boolean field_149124_b; + private int field_149125_c; + + + public S38PacketPlayerListItem() {} + + public S38PacketPlayerListItem(String p_i45209_1_, boolean p_i45209_2_, int p_i45209_3_) { + this.field_149126_a = p_i45209_1_; + this.field_149124_b = p_i45209_2_; + this.field_149125_c = p_i45209_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149126_a = p_148837_1_.readStringFromBuffer(16); + this.field_149124_b = p_148837_1_.readBoolean(); + this.field_149125_c = p_148837_1_.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149126_a); + p_148840_1_.writeBoolean(this.field_149124_b); + p_148840_1_.writeShort(this.field_149125_c); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handlePlayerListItem(this); + } + + public String func_149122_c() { + return this.field_149126_a; + } + + public boolean func_149121_d() { + return this.field_149124_b; + } + + public int func_149120_e() { + return this.field_149125_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java new file mode 100644 index 0000000..5bd7c1c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java @@ -0,0 +1,132 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S39PacketPlayerAbilities extends Packet { + private boolean field_149119_a; + private boolean field_149117_b; + private boolean field_149118_c; + private boolean field_149115_d; + private float field_149116_e; + private float field_149114_f; + + + public S39PacketPlayerAbilities() {} + + public S39PacketPlayerAbilities(PlayerCapabilities p_i45208_1_) { + this.func_149108_a(p_i45208_1_.disableDamage); + this.func_149102_b(p_i45208_1_.isFlying); + this.func_149109_c(p_i45208_1_.allowFlying); + this.func_149111_d(p_i45208_1_.isCreativeMode); + this.func_149104_a(p_i45208_1_.getFlySpeed()); + this.func_149110_b(p_i45208_1_.getWalkSpeed()); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + byte var2 = p_148837_1_.readByte(); + this.func_149108_a((var2 & 1) > 0); + this.func_149102_b((var2 & 2) > 0); + this.func_149109_c((var2 & 4) > 0); + this.func_149111_d((var2 & 8) > 0); + this.func_149104_a(p_148837_1_.readFloat()); + this.func_149110_b(p_148837_1_.readFloat()); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + byte var2 = 0; + + if (this.func_149112_c()) { + var2 = (byte)(var2 | 1); + } + + if (this.func_149106_d()) { + var2 = (byte)(var2 | 2); + } + + if (this.func_149105_e()) { + var2 = (byte)(var2 | 4); + } + + if (this.func_149103_f()) { + var2 = (byte)(var2 | 8); + } + + p_148840_1_.writeByte(var2); + p_148840_1_.writeFloat(this.field_149116_e); + p_148840_1_.writeFloat(this.field_149114_f); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handlePlayerAbilities(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f", Boolean.valueOf(this.func_149112_c()), Boolean.valueOf(this.func_149106_d()), Boolean.valueOf(this.func_149105_e()), Boolean.valueOf(this.func_149103_f()), Float.valueOf(this.func_149101_g()), Float.valueOf(this.func_149107_h())); + } + + public boolean func_149112_c() { + return this.field_149119_a; + } + + public void func_149108_a(boolean p_149108_1_) { + this.field_149119_a = p_149108_1_; + } + + public boolean func_149106_d() { + return this.field_149117_b; + } + + public void func_149102_b(boolean p_149102_1_) { + this.field_149117_b = p_149102_1_; + } + + public boolean func_149105_e() { + return this.field_149118_c; + } + + public void func_149109_c(boolean p_149109_1_) { + this.field_149118_c = p_149109_1_; + } + + public boolean func_149103_f() { + return this.field_149115_d; + } + + public void func_149111_d(boolean p_149111_1_) { + this.field_149115_d = p_149111_1_; + } + + public float func_149101_g() { + return this.field_149116_e; + } + + public void func_149104_a(float p_149104_1_) { + this.field_149116_e = p_149104_1_; + } + + public float func_149107_h() { + return this.field_149114_f; + } + + public void func_149110_b(float p_149110_1_) { + this.field_149114_f = p_149110_1_; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java new file mode 100644 index 0000000..e77e594 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3APacketTabComplete.java @@ -0,0 +1,63 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import org.apache.commons.lang3.ArrayUtils; + +public class S3APacketTabComplete extends Packet { + private String[] field_149632_a; + + + public S3APacketTabComplete() {} + + public S3APacketTabComplete(String[] p_i45178_1_) { + this.field_149632_a = p_i45178_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149632_a = new String[p_148837_1_.readVarIntFromBuffer()]; + + for (int var2 = 0; var2 < this.field_149632_a.length; ++var2) { + this.field_149632_a[var2] = p_148837_1_.readStringFromBuffer(32767); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeVarIntToBuffer(this.field_149632_a.length); + String[] var2 = this.field_149632_a; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + String var5 = var2[var4]; + p_148840_1_.writeStringToBuffer(var5); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleTabComplete(this); + } + + public String[] func_149630_c() { + return this.field_149632_a; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() { + return String.format("candidates='%s'", ArrayUtils.toString(this.field_149632_a)); + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java new file mode 100644 index 0000000..3844a78 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java @@ -0,0 +1,61 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScoreObjective; + +public class S3BPacketScoreboardObjective extends Packet { + private String field_149343_a; + private String field_149341_b; + private int field_149342_c; + + + public S3BPacketScoreboardObjective() {} + + public S3BPacketScoreboardObjective(ScoreObjective p_i45224_1_, int p_i45224_2_) { + this.field_149343_a = p_i45224_1_.getName(); + this.field_149341_b = p_i45224_1_.getDisplayName(); + this.field_149342_c = p_i45224_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149343_a = p_148837_1_.readStringFromBuffer(16); + this.field_149341_b = p_148837_1_.readStringFromBuffer(32); + this.field_149342_c = p_148837_1_.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149343_a); + p_148840_1_.writeStringToBuffer(this.field_149341_b); + p_148840_1_.writeByte(this.field_149342_c); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleScoreboardObjective(this); + } + + public String func_149339_c() { + return this.field_149343_a; + } + + public String func_149337_d() { + return this.field_149341_b; + } + + public int func_149338_e() { + return this.field_149342_c; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java new file mode 100644 index 0000000..2e06fda --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java @@ -0,0 +1,82 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.Score; + +public class S3CPacketUpdateScore extends Packet { + private String field_149329_a = ""; + private String field_149327_b = ""; + private int field_149328_c; + private int field_149326_d; + + + public S3CPacketUpdateScore() {} + + public S3CPacketUpdateScore(Score p_i45227_1_, int p_i45227_2_) { + this.field_149329_a = p_i45227_1_.getPlayerName(); + this.field_149327_b = p_i45227_1_.func_96645_d().getName(); + this.field_149328_c = p_i45227_1_.getScorePoints(); + this.field_149326_d = p_i45227_2_; + } + + public S3CPacketUpdateScore(String p_i45228_1_) { + this.field_149329_a = p_i45228_1_; + this.field_149327_b = ""; + this.field_149328_c = 0; + this.field_149326_d = 1; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149329_a = p_148837_1_.readStringFromBuffer(16); + this.field_149326_d = p_148837_1_.readByte(); + + if (this.field_149326_d != 1) { + this.field_149327_b = p_148837_1_.readStringFromBuffer(16); + this.field_149328_c = p_148837_1_.readInt(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149329_a); + p_148840_1_.writeByte(this.field_149326_d); + + if (this.field_149326_d != 1) { + p_148840_1_.writeStringToBuffer(this.field_149327_b); + p_148840_1_.writeInt(this.field_149328_c); + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleUpdateScore(this); + } + + public String func_149324_c() { + return this.field_149329_a; + } + + public String func_149321_d() { + return this.field_149327_b; + } + + public int func_149323_e() { + return this.field_149328_c; + } + + public int func_149322_f() { + return this.field_149326_d; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java new file mode 100644 index 0000000..1f46345 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java @@ -0,0 +1,58 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScoreObjective; + +public class S3DPacketDisplayScoreboard extends Packet { + private int field_149374_a; + private String field_149373_b; + + + public S3DPacketDisplayScoreboard() {} + + public S3DPacketDisplayScoreboard(int p_i45216_1_, ScoreObjective p_i45216_2_) { + this.field_149374_a = p_i45216_1_; + + if (p_i45216_2_ == null) { + this.field_149373_b = ""; + } else { + this.field_149373_b = p_i45216_2_.getName(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149374_a = p_148837_1_.readByte(); + this.field_149373_b = p_148837_1_.readStringFromBuffer(16); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeByte(this.field_149374_a); + p_148840_1_.writeStringToBuffer(this.field_149373_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleDisplayScoreboard(this); + } + + public int func_149371_c() { + return this.field_149374_a; + } + + public String func_149370_d() { + return this.field_149373_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java new file mode 100644 index 0000000..c828142 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3EPacketTeams.java @@ -0,0 +1,136 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScorePlayerTeam; + +public class S3EPacketTeams extends Packet { + private String field_149320_a = ""; + private String field_149318_b = ""; + private String field_149319_c = ""; + private String field_149316_d = ""; + private final Collection field_149317_e = new ArrayList(); + private int field_149314_f; + private int field_149315_g; + + + public S3EPacketTeams() {} + + public S3EPacketTeams(ScorePlayerTeam p_i45225_1_, int p_i45225_2_) { + this.field_149320_a = p_i45225_1_.getRegisteredName(); + this.field_149314_f = p_i45225_2_; + + if (p_i45225_2_ == 0 || p_i45225_2_ == 2) { + this.field_149318_b = p_i45225_1_.func_96669_c(); + this.field_149319_c = p_i45225_1_.getColorPrefix(); + this.field_149316_d = p_i45225_1_.getColorSuffix(); + this.field_149315_g = p_i45225_1_.func_98299_i(); + } + + if (p_i45225_2_ == 0) { + this.field_149317_e.addAll(p_i45225_1_.getMembershipCollection()); + } + } + + public S3EPacketTeams(ScorePlayerTeam p_i45226_1_, Collection p_i45226_2_, int p_i45226_3_) { + if (p_i45226_3_ != 3 && p_i45226_3_ != 4) { + throw new IllegalArgumentException("Method must be join or leave for player constructor"); + } else if (p_i45226_2_ != null && !p_i45226_2_.isEmpty()) { + this.field_149314_f = p_i45226_3_; + this.field_149320_a = p_i45226_1_.getRegisteredName(); + this.field_149317_e.addAll(p_i45226_2_); + } else { + throw new IllegalArgumentException("Players cannot be null/empty"); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149320_a = p_148837_1_.readStringFromBuffer(16); + this.field_149314_f = p_148837_1_.readByte(); + + if (this.field_149314_f == 0 || this.field_149314_f == 2) { + this.field_149318_b = p_148837_1_.readStringFromBuffer(32); + this.field_149319_c = p_148837_1_.readStringFromBuffer(16); + this.field_149316_d = p_148837_1_.readStringFromBuffer(16); + this.field_149315_g = p_148837_1_.readByte(); + } + + if (this.field_149314_f == 0 || this.field_149314_f == 3 || this.field_149314_f == 4) { + short var2 = p_148837_1_.readShort(); + + for (int var3 = 0; var3 < var2; ++var3) { + this.field_149317_e.add(p_148837_1_.readStringFromBuffer(40)); + } + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149320_a); + p_148840_1_.writeByte(this.field_149314_f); + + if (this.field_149314_f == 0 || this.field_149314_f == 2) { + p_148840_1_.writeStringToBuffer(this.field_149318_b); + p_148840_1_.writeStringToBuffer(this.field_149319_c); + p_148840_1_.writeStringToBuffer(this.field_149316_d); + p_148840_1_.writeByte(this.field_149315_g); + } + + if (this.field_149314_f == 0 || this.field_149314_f == 3 || this.field_149314_f == 4) { + p_148840_1_.writeShort(this.field_149317_e.size()); + Iterator var2 = this.field_149317_e.iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + p_148840_1_.writeStringToBuffer(var3); + } + } + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleTeams(this); + } + + public String func_149312_c() { + return this.field_149320_a; + } + + public String func_149306_d() { + return this.field_149318_b; + } + + public String func_149311_e() { + return this.field_149319_c; + } + + public String func_149309_f() { + return this.field_149316_d; + } + + public Collection func_149310_g() { + return this.field_149317_e; + } + + public int func_149307_h() { + return this.field_149314_f; + } + + public int func_149308_i() { + return this.field_149315_g; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java new file mode 100644 index 0000000..6886ba0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java @@ -0,0 +1,63 @@ +package net.minecraft.network.play.server; + +import io.netty.buffer.ByteBuf; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S3FPacketCustomPayload extends Packet { + private String field_149172_a; + private byte[] field_149171_b; + + + public S3FPacketCustomPayload() {} + + public S3FPacketCustomPayload(String p_i45189_1_, ByteBuf p_i45189_2_) { + this(p_i45189_1_, p_i45189_2_.array()); + } + + public S3FPacketCustomPayload(String p_i45190_1_, byte[] p_i45190_2_) { + this.field_149172_a = p_i45190_1_; + this.field_149171_b = p_i45190_2_; + + if (p_i45190_2_.length >= 1048576) { + throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes"); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149172_a = p_148837_1_.readStringFromBuffer(20); + this.field_149171_b = new byte[p_148837_1_.readUnsignedShort()]; + p_148837_1_.readBytes(this.field_149171_b); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(this.field_149172_a); + p_148840_1_.writeShort(this.field_149171_b.length); + p_148840_1_.writeBytes(this.field_149171_b); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleCustomPayload(this); + } + + public String func_149169_c() { + return this.field_149172_a; + } + + public byte[] func_149168_d() { + return this.field_149171_b; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java new file mode 100644 index 0000000..3dc46f2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/play/server/S40PacketDisconnect.java @@ -0,0 +1,53 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S40PacketDisconnect extends Packet { + private IChatComponent field_149167_a; + + + public S40PacketDisconnect() {} + + public S40PacketDisconnect(IChatComponent p_i46336_1_) { + this.field_149167_a = p_i46336_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149167_a = IChatComponent.Serializer.func_150699_a(p_148837_1_.readStringFromBuffer(32767)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(IChatComponent.Serializer.func_150696_a(this.field_149167_a)); + } + + public void processPacket(INetHandlerPlayClient p_148833_1_) { + p_148833_1_.handleDisconnect(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public IChatComponent func_149165_c() { + return this.field_149167_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerPlayClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/rcon/RConConsoleSource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/rcon/RConConsoleSource.java new file mode 100644 index 0000000..7def53c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/rcon/RConConsoleSource.java @@ -0,0 +1,53 @@ +package net.minecraft.network.rcon; + +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public class RConConsoleSource implements ICommandSender { + public static final RConConsoleSource field_70010_a = new RConConsoleSource(); + private final StringBuffer field_70009_b = new StringBuffer(); + + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return "Rcon"; + } + + public IChatComponent func_145748_c_() { + return new ChatComponentText(this.getCommandSenderName()); + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent p_145747_1_) { + this.field_70009_b.append(p_145747_1_.getUnformattedText()); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_) { + return true; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(0, 0, 0); + } + + public World getEntityWorld() { + return MinecraftServer.getServer().getEntityWorld(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java new file mode 100644 index 0000000..f07558b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java @@ -0,0 +1,11 @@ +package net.minecraft.network.status; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; + +public interface INetHandlerStatusClient extends INetHandler { + void handleServerInfo(S00PacketServerInfo p_147397_1_); + + void handlePong(S01PacketPong p_147398_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java new file mode 100644 index 0000000..b006d72 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java @@ -0,0 +1,11 @@ +package net.minecraft.network.status; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; + +public interface INetHandlerStatusServer extends INetHandler { + void processPing(C01PacketPing p_147311_1_); + + void processServerQuery(C00PacketServerQuery p_147312_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java new file mode 100644 index 0000000..fd8d130 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java @@ -0,0 +1,37 @@ +package net.minecraft.network.status.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusServer; + +public class C00PacketServerQuery extends Packet { + + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException {} + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException {} + + public void processPacket(INetHandlerStatusServer p_148833_1_) { + p_148833_1_.processServerQuery(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerStatusServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/client/C01PacketPing.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/client/C01PacketPing.java new file mode 100644 index 0000000..20d0a2b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/client/C01PacketPing.java @@ -0,0 +1,52 @@ +package net.minecraft.network.status.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusServer; + +public class C01PacketPing extends Packet { + private long field_149290_a; + + + public C01PacketPing() {} + + public C01PacketPing(long p_i45276_1_) { + this.field_149290_a = p_i45276_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149290_a = p_148837_1_.readLong(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeLong(this.field_149290_a); + } + + public void processPacket(INetHandlerStatusServer p_148833_1_) { + p_148833_1_.processPing(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public long func_149289_c() { + return this.field_149290_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerStatusServer)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java new file mode 100644 index 0000000..65c9b43 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java @@ -0,0 +1,61 @@ +package net.minecraft.network.status.server; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import java.io.IOException; + +import com.cheatbreaker.client.util.LunarClientJsonThing; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumTypeAdapterFactory; +import net.minecraft.util.IChatComponent; + +public class S00PacketServerInfo extends Packet { + private static final Gson field_149297_a = (new GsonBuilder()).registerTypeAdapter(ServerStatusResponse.MinecraftProtocolVersionIdentifier.class, new ServerStatusResponse.MinecraftProtocolVersionIdentifier.Serializer()).registerTypeAdapter(ServerStatusResponse.PlayerCountData.class, new ServerStatusResponse.PlayerCountData.Serializer()).registerTypeAdapter(ServerStatusResponse.class, new ServerStatusResponse.Serializer()).registerTypeAdapter(ServerStatusResponse.class, new LunarClientJsonThing()).registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()).registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()).registerTypeAdapterFactory(new EnumTypeAdapterFactory()).create(); + private ServerStatusResponse field_149296_b; + + + public S00PacketServerInfo() {} + + public S00PacketServerInfo(ServerStatusResponse p_i45273_1_) { + this.field_149296_b = p_i45273_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149296_b = field_149297_a.fromJson(p_148837_1_.readStringFromBuffer(32767), ServerStatusResponse.class); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeStringToBuffer(field_149297_a.toJson(this.field_149296_b)); + } + + public void processPacket(INetHandlerStatusClient p_148833_1_) { + p_148833_1_.handleServerInfo(this); + } + + public ServerStatusResponse func_149294_c() { + return this.field_149296_b; + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerStatusClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/server/S01PacketPong.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/server/S01PacketPong.java new file mode 100644 index 0000000..69a1033 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/network/status/server/S01PacketPong.java @@ -0,0 +1,52 @@ +package net.minecraft.network.status.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusClient; + +public class S01PacketPong extends Packet { + private long field_149293_a; + + + public S01PacketPong() {} + + public S01PacketPong(long p_i45272_1_) { + this.field_149293_a = p_i45272_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer p_148837_1_) throws IOException { + this.field_149293_a = p_148837_1_.readLong(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + p_148840_1_.writeLong(this.field_149293_a); + } + + public void processPacket(INetHandlerStatusClient p_148833_1_) { + p_148833_1_.handlePong(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() { + return true; + } + + public long func_149292_c() { + return this.field_149293_a; + } + + public void processPacket(INetHandler p_148833_1_) { + this.processPacket((INetHandlerStatusClient)p_148833_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/Path.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/Path.java new file mode 100644 index 0000000..36b2cf9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/Path.java @@ -0,0 +1,148 @@ +package net.minecraft.pathfinding; + +public class Path { + /** Contains the points in this path */ + private PathPoint[] pathPoints = new PathPoint[1024]; + + /** The number of points in this path */ + private int count; + + + /** + * Adds a point to the path + */ + public PathPoint addPoint(PathPoint p_75849_1_) { + if (p_75849_1_.index >= 0) { + throw new IllegalStateException("OW KNOWS!"); + } else { + if (this.count == this.pathPoints.length) { + PathPoint[] var2 = new PathPoint[this.count << 1]; + System.arraycopy(this.pathPoints, 0, var2, 0, this.count); + this.pathPoints = var2; + } + + this.pathPoints[this.count] = p_75849_1_; + p_75849_1_.index = this.count; + this.sortBack(this.count++); + return p_75849_1_; + } + } + + /** + * Clears the path + */ + public void clearPath() { + this.count = 0; + } + + /** + * Returns and removes the first point in the path + */ + public PathPoint dequeue() { + PathPoint var1 = this.pathPoints[0]; + this.pathPoints[0] = this.pathPoints[--this.count]; + this.pathPoints[this.count] = null; + + if (this.count > 0) { + this.sortForward(0); + } + + var1.index = -1; + return var1; + } + + /** + * Changes the provided point's distance to target + */ + public void changeDistance(PathPoint p_75850_1_, float p_75850_2_) { + float var3 = p_75850_1_.distanceToTarget; + p_75850_1_.distanceToTarget = p_75850_2_; + + if (p_75850_2_ < var3) { + this.sortBack(p_75850_1_.index); + } else { + this.sortForward(p_75850_1_.index); + } + } + + /** + * Sorts a point to the left + */ + private void sortBack(int p_75847_1_) { + PathPoint var2 = this.pathPoints[p_75847_1_]; + int var4; + + for (float var3 = var2.distanceToTarget; p_75847_1_ > 0; p_75847_1_ = var4) { + var4 = p_75847_1_ - 1 >> 1; + PathPoint var5 = this.pathPoints[var4]; + + if (var3 >= var5.distanceToTarget) { + break; + } + + this.pathPoints[p_75847_1_] = var5; + var5.index = p_75847_1_; + } + + this.pathPoints[p_75847_1_] = var2; + var2.index = p_75847_1_; + } + + /** + * Sorts a point to the right + */ + private void sortForward(int p_75846_1_) { + PathPoint var2 = this.pathPoints[p_75846_1_]; + float var3 = var2.distanceToTarget; + + while (true) { + int var4 = 1 + (p_75846_1_ << 1); + int var5 = var4 + 1; + + if (var4 >= this.count) { + break; + } + + PathPoint var6 = this.pathPoints[var4]; + float var7 = var6.distanceToTarget; + PathPoint var8; + float var9; + + if (var5 >= this.count) { + var8 = null; + var9 = Float.POSITIVE_INFINITY; + } else { + var8 = this.pathPoints[var5]; + var9 = var8.distanceToTarget; + } + + if (var7 < var9) { + if (var7 >= var3) { + break; + } + + this.pathPoints[p_75846_1_] = var6; + var6.index = p_75846_1_; + p_75846_1_ = var4; + } else { + if (var9 >= var3) { + break; + } + + this.pathPoints[p_75846_1_] = var8; + var8.index = p_75846_1_; + p_75846_1_ = var5; + } + } + + this.pathPoints[p_75846_1_] = var2; + var2.index = p_75846_1_; + } + + /** + * Returns true if this path contains no points + */ + public boolean isPathEmpty() { + return this.count == 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathEntity.java new file mode 100644 index 0000000..c75ccf3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathEntity.java @@ -0,0 +1,109 @@ +package net.minecraft.pathfinding; + +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; + +public class PathEntity { + /** The actual points in the path */ + private final PathPoint[] points; + + /** PathEntity Array Index the Entity is currently targeting */ + private int currentPathIndex; + + /** The total length of the path */ + private int pathLength; + + + public PathEntity(PathPoint[] p_i2136_1_) { + this.points = p_i2136_1_; + this.pathLength = p_i2136_1_.length; + } + + /** + * Directs this path to the next point in its array + */ + public void incrementPathIndex() { + ++this.currentPathIndex; + } + + /** + * Returns true if this path has reached the end + */ + public boolean isFinished() { + return this.currentPathIndex >= this.pathLength; + } + + /** + * returns the last PathPoint of the Array + */ + public PathPoint getFinalPathPoint() { + return this.pathLength > 0 ? this.points[this.pathLength - 1] : null; + } + + /** + * return the PathPoint located at the specified PathIndex, usually the current one + */ + public PathPoint getPathPointFromIndex(int p_75877_1_) { + return this.points[p_75877_1_]; + } + + public int getCurrentPathLength() { + return this.pathLength; + } + + public void setCurrentPathLength(int p_75871_1_) { + this.pathLength = p_75871_1_; + } + + public int getCurrentPathIndex() { + return this.currentPathIndex; + } + + public void setCurrentPathIndex(int p_75872_1_) { + this.currentPathIndex = p_75872_1_; + } + + /** + * Gets the vector of the PathPoint associated with the given index. + */ + public Vec3 getVectorFromIndex(Entity p_75881_1_, int p_75881_2_) { + double var3 = (double)this.points[p_75881_2_].xCoord + (double)((int)(p_75881_1_.width + 1.0F)) * 0.5D; + double var5 = this.points[p_75881_2_].yCoord; + double var7 = (double)this.points[p_75881_2_].zCoord + (double)((int)(p_75881_1_.width + 1.0F)) * 0.5D; + return Vec3.createVectorHelper(var3, var5, var7); + } + + /** + * returns the current PathEntity target node as Vec3D + */ + public Vec3 getPosition(Entity p_75878_1_) { + return this.getVectorFromIndex(p_75878_1_, this.currentPathIndex); + } + + /** + * Returns true if the EntityPath are the same. Non instance related equals. + */ + public boolean isSamePath(PathEntity p_75876_1_) { + if (p_75876_1_ == null) { + return false; + } else if (p_75876_1_.points.length != this.points.length) { + return false; + } else { + for (int var2 = 0; var2 < this.points.length; ++var2) { + if (this.points[var2].xCoord != p_75876_1_.points[var2].xCoord || this.points[var2].yCoord != p_75876_1_.points[var2].yCoord || this.points[var2].zCoord != p_75876_1_.points[var2].zCoord) { + return false; + } + } + + return true; + } + } + + /** + * Returns true if the final PathPoint in the PathEntity is equal to Vec3D coords. + */ + public boolean isDestinationSame(Vec3 p_75880_1_) { + PathPoint var2 = this.getFinalPathPoint(); + return var2 != null && var2.xCoord == (int) p_75880_1_.xCoord && var2.zCoord == (int) p_75880_1_.zCoord; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathFinder.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathFinder.java new file mode 100644 index 0000000..884b696 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathFinder.java @@ -0,0 +1,336 @@ +package net.minecraft.pathfinding; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; + +public class PathFinder { + /** Used to find obstacles */ + private final IBlockAccess worldMap; + + /** The path being generated */ + private final Path path = new Path(); + + /** The points in the path */ + private final IntHashMap pointMap = new IntHashMap(); + + /** Selection of path points to add to the path */ + private final PathPoint[] pathOptions = new PathPoint[32]; + + /** should the PathFinder go through wodden door blocks */ + private final boolean isWoddenDoorAllowed; + + /** + * should the PathFinder disregard BlockMovement type materials in its path + */ + private final boolean isMovementBlockAllowed; + private boolean isPathingInWater; + + /** tells the FathFinder to not stop pathing underwater */ + private final boolean canEntityDrown; + + + public PathFinder(IBlockAccess p_i2137_1_, boolean p_i2137_2_, boolean p_i2137_3_, boolean p_i2137_4_, boolean p_i2137_5_) { + this.worldMap = p_i2137_1_; + this.isWoddenDoorAllowed = p_i2137_2_; + this.isMovementBlockAllowed = p_i2137_3_; + this.isPathingInWater = p_i2137_4_; + this.canEntityDrown = p_i2137_5_; + } + + /** + * Creates a path from one entity to another within a minimum distance + */ + public PathEntity createEntityPathTo(Entity p_75856_1_, Entity p_75856_2_, float p_75856_3_) { + return this.createEntityPathTo(p_75856_1_, p_75856_2_.posX, p_75856_2_.boundingBox.minY, p_75856_2_.posZ, p_75856_3_); + } + + /** + * Creates a path from an entity to a specified location within a minimum distance + */ + public PathEntity createEntityPathTo(Entity p_75859_1_, int p_75859_2_, int p_75859_3_, int p_75859_4_, float p_75859_5_) { + return this.createEntityPathTo(p_75859_1_, (float)p_75859_2_ + 0.5F, (float)p_75859_3_ + 0.5F, (float)p_75859_4_ + 0.5F, p_75859_5_); + } + + /** + * Internal implementation of creating a path from an entity to a point + */ + private PathEntity createEntityPathTo(Entity p_75857_1_, double p_75857_2_, double p_75857_4_, double p_75857_6_, float p_75857_8_) { + this.path.clearPath(); + this.pointMap.clearMap(); + boolean var9 = this.isPathingInWater; + int var10 = MathHelper.floor_double(p_75857_1_.boundingBox.minY + 0.5D); + + if (this.canEntityDrown && p_75857_1_.isInWater()) { + var10 = (int)p_75857_1_.boundingBox.minY; + + for (Block var11 = this.worldMap.getBlock(MathHelper.floor_double(p_75857_1_.posX), var10, MathHelper.floor_double(p_75857_1_.posZ)); var11 == Blocks.flowing_water || var11 == Blocks.water; var11 = this.worldMap.getBlock(MathHelper.floor_double(p_75857_1_.posX), var10, MathHelper.floor_double(p_75857_1_.posZ))) { + ++var10; + } + + var9 = this.isPathingInWater; + this.isPathingInWater = false; + } else { + var10 = MathHelper.floor_double(p_75857_1_.boundingBox.minY + 0.5D); + } + + PathPoint var15 = this.openPoint(MathHelper.floor_double(p_75857_1_.boundingBox.minX), var10, MathHelper.floor_double(p_75857_1_.boundingBox.minZ)); + PathPoint var12 = this.openPoint(MathHelper.floor_double(p_75857_2_ - (double)(p_75857_1_.width / 2.0F)), MathHelper.floor_double(p_75857_4_), MathHelper.floor_double(p_75857_6_ - (double)(p_75857_1_.width / 2.0F))); + PathPoint var13 = new PathPoint(MathHelper.floor_float(p_75857_1_.width + 1.0F), MathHelper.floor_float(p_75857_1_.height + 1.0F), MathHelper.floor_float(p_75857_1_.width + 1.0F)); + PathEntity var14 = this.addToPath(p_75857_1_, var15, var12, var13, p_75857_8_); + this.isPathingInWater = var9; + return var14; + } + + /** + * Adds a path from start to end and returns the whole path (args: unused, start, end, unused, maxDistance) + */ + private PathEntity addToPath(Entity p_75861_1_, PathPoint p_75861_2_, PathPoint p_75861_3_, PathPoint p_75861_4_, float p_75861_5_) { + p_75861_2_.totalPathDistance = 0.0F; + p_75861_2_.distanceToNext = p_75861_2_.distanceToSquared(p_75861_3_); + p_75861_2_.distanceToTarget = p_75861_2_.distanceToNext; + this.path.clearPath(); + this.path.addPoint(p_75861_2_); + PathPoint var6 = p_75861_2_; + + while (!this.path.isPathEmpty()) { + PathPoint var7 = this.path.dequeue(); + + if (var7.equals(p_75861_3_)) { + return this.createEntityPath(p_75861_2_, p_75861_3_); + } + + if (var7.distanceToSquared(p_75861_3_) < var6.distanceToSquared(p_75861_3_)) { + var6 = var7; + } + + var7.isFirst = true; + int var8 = this.findPathOptions(p_75861_1_, var7, p_75861_4_, p_75861_3_, p_75861_5_); + + for (int var9 = 0; var9 < var8; ++var9) { + PathPoint var10 = this.pathOptions[var9]; + float var11 = var7.totalPathDistance + var7.distanceToSquared(var10); + + if (!var10.isAssigned() || var11 < var10.totalPathDistance) { + var10.previous = var7; + var10.totalPathDistance = var11; + var10.distanceToNext = var10.distanceToSquared(p_75861_3_); + + if (var10.isAssigned()) { + this.path.changeDistance(var10, var10.totalPathDistance + var10.distanceToNext); + } else { + var10.distanceToTarget = var10.totalPathDistance + var10.distanceToNext; + this.path.addPoint(var10); + } + } + } + } + + if (var6 == p_75861_2_) { + return null; + } else { + return this.createEntityPath(p_75861_2_, var6); + } + } + + /** + * populates pathOptions with available points and returns the number of options found (args: unused1, currentPoint, + * unused2, targetPoint, maxDistance) + */ + private int findPathOptions(Entity p_75860_1_, PathPoint p_75860_2_, PathPoint p_75860_3_, PathPoint p_75860_4_, float p_75860_5_) { + int var6 = 0; + byte var7 = 0; + + if (this.getVerticalOffset(p_75860_1_, p_75860_2_.xCoord, p_75860_2_.yCoord + 1, p_75860_2_.zCoord, p_75860_3_) == 1) { + var7 = 1; + } + + PathPoint var8 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord, p_75860_2_.yCoord, p_75860_2_.zCoord + 1, p_75860_3_, var7); + PathPoint var9 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord - 1, p_75860_2_.yCoord, p_75860_2_.zCoord, p_75860_3_, var7); + PathPoint var10 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord + 1, p_75860_2_.yCoord, p_75860_2_.zCoord, p_75860_3_, var7); + PathPoint var11 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord, p_75860_2_.yCoord, p_75860_2_.zCoord - 1, p_75860_3_, var7); + + if (var8 != null && !var8.isFirst && var8.distanceTo(p_75860_4_) < p_75860_5_) { + this.pathOptions[var6++] = var8; + } + + if (var9 != null && !var9.isFirst && var9.distanceTo(p_75860_4_) < p_75860_5_) { + this.pathOptions[var6++] = var9; + } + + if (var10 != null && !var10.isFirst && var10.distanceTo(p_75860_4_) < p_75860_5_) { + this.pathOptions[var6++] = var10; + } + + if (var11 != null && !var11.isFirst && var11.distanceTo(p_75860_4_) < p_75860_5_) { + this.pathOptions[var6++] = var11; + } + + return var6; + } + + /** + * Returns a point that the entity can safely move to + */ + private PathPoint getSafePoint(Entity p_75858_1_, int p_75858_2_, int p_75858_3_, int p_75858_4_, PathPoint p_75858_5_, int p_75858_6_) { + PathPoint var7 = null; + int var8 = this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_, p_75858_4_, p_75858_5_); + + if (var8 == 2) { + return this.openPoint(p_75858_2_, p_75858_3_, p_75858_4_); + } else { + if (var8 == 1) { + var7 = this.openPoint(p_75858_2_, p_75858_3_, p_75858_4_); + } + + if (var7 == null && p_75858_6_ > 0 && var8 != -3 && var8 != -4 && this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_ + p_75858_6_, p_75858_4_, p_75858_5_) == 1) { + var7 = this.openPoint(p_75858_2_, p_75858_3_ + p_75858_6_, p_75858_4_); + p_75858_3_ += p_75858_6_; + } + + if (var7 != null) { + int var9 = 0; + int var10 = 0; + + while (p_75858_3_ > 0) { + var10 = this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_ - 1, p_75858_4_, p_75858_5_); + + if (this.isPathingInWater && var10 == -1) { + return null; + } + + if (var10 != 1) { + break; + } + + if (var9++ >= p_75858_1_.getMaxSafePointTries()) { + return null; + } + + --p_75858_3_; + + if (p_75858_3_ > 0) { + var7 = this.openPoint(p_75858_2_, p_75858_3_, p_75858_4_); + } + } + + if (var10 == -2) { + return null; + } + } + + return var7; + } + } + + /** + * Returns a mapped point or creates and adds one + */ + private final PathPoint openPoint(int p_75854_1_, int p_75854_2_, int p_75854_3_) { + int var4 = PathPoint.makeHash(p_75854_1_, p_75854_2_, p_75854_3_); + PathPoint var5 = (PathPoint)this.pointMap.lookup(var4); + + if (var5 == null) { + var5 = new PathPoint(p_75854_1_, p_75854_2_, p_75854_3_); + this.pointMap.addKey(var4, var5); + } + + return var5; + } + + /** + * Checks if an entity collides with blocks at a position. Returns 1 if clear, 0 for colliding with any solid block, + * -1 for water(if avoiding water) but otherwise clear, -2 for lava, -3 for fence, -4 for closed trapdoor, 2 if + * otherwise clear except for open trapdoor or water(if not avoiding) + */ + public int getVerticalOffset(Entity p_75855_1_, int p_75855_2_, int p_75855_3_, int p_75855_4_, PathPoint p_75855_5_) { + return func_82565_a(p_75855_1_, p_75855_2_, p_75855_3_, p_75855_4_, p_75855_5_, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); + } + + public static int func_82565_a(Entity p_82565_0_, int p_82565_1_, int p_82565_2_, int p_82565_3_, PathPoint p_82565_4_, boolean p_82565_5_, boolean p_82565_6_, boolean p_82565_7_) { + boolean var8 = false; + + for (int var9 = p_82565_1_; var9 < p_82565_1_ + p_82565_4_.xCoord; ++var9) { + for (int var10 = p_82565_2_; var10 < p_82565_2_ + p_82565_4_.yCoord; ++var10) { + for (int var11 = p_82565_3_; var11 < p_82565_3_ + p_82565_4_.zCoord; ++var11) { + Block var12 = p_82565_0_.worldObj.getBlock(var9, var10, var11); + + if (var12.getMaterial() != Material.air) { + if (var12 == Blocks.trapdoor) { + var8 = true; + } else if (var12 != Blocks.flowing_water && var12 != Blocks.water) { + if (!p_82565_7_ && var12 == Blocks.wooden_door) { + return 0; + } + } else { + if (p_82565_5_) { + return -1; + } + + var8 = true; + } + + int var13 = var12.getRenderType(); + + if (p_82565_0_.worldObj.getBlock(var9, var10, var11).getRenderType() == 9) { + int var17 = MathHelper.floor_double(p_82565_0_.posX); + int var15 = MathHelper.floor_double(p_82565_0_.posY); + int var16 = MathHelper.floor_double(p_82565_0_.posZ); + + if (p_82565_0_.worldObj.getBlock(var17, var15, var16).getRenderType() != 9 && p_82565_0_.worldObj.getBlock(var17, var15 - 1, var16).getRenderType() != 9) { + return -3; + } + } else if (!var12.getBlocksMovement(p_82565_0_.worldObj, var9, var10, var11) && (!p_82565_6_ || var12 != Blocks.wooden_door)) { + if (var13 == 11 || var12 == Blocks.fence_gate || var13 == 32) { + return -3; + } + + if (var12 == Blocks.trapdoor) { + return -4; + } + + Material var14 = var12.getMaterial(); + + if (var14 != Material.lava) { + return 0; + } + + if (!p_82565_0_.handleLavaMovement()) { + return -2; + } + } + } + } + } + } + + return var8 ? 2 : 1; + } + + /** + * Returns a new PathEntity for a given start and end point + */ + private PathEntity createEntityPath(PathPoint p_75853_1_, PathPoint p_75853_2_) { + int var3 = 1; + PathPoint var4; + + for (var4 = p_75853_2_; var4.previous != null; var4 = var4.previous) { + ++var3; + } + + PathPoint[] var5 = new PathPoint[var3]; + var4 = p_75853_2_; + --var3; + + for (var5[var3] = p_75853_2_; var4.previous != null; var5[var3] = var4) { + var4 = var4.previous; + --var3; + } + + return new PathEntity(var5); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathNavigate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathNavigate.java new file mode 100644 index 0000000..f6dfd36 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathNavigate.java @@ -0,0 +1,453 @@ +package net.minecraft.pathfinding; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class PathNavigate { + private final EntityLiving theEntity; + private final World worldObj; + + /** The PathEntity being followed. */ + private PathEntity currentPath; + private double speed; + + /** + * The number of blocks (extra) +/- in each axis that get pulled out as cache for the pathfinder's search space + */ + private final IAttributeInstance pathSearchRange; + private boolean noSunPathfind; + + /** Time, in number of ticks, following the current path */ + private int totalTicks; + + /** + * The time when the last position check was done (to detect successful movement) + */ + private int ticksAtLastPos; + + /** + * Coordinates of the entity's position last time a check was done (part of monitoring getting 'stuck') + */ + private final Vec3 lastPosCheck = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + + /** + * Specifically, if a wooden door block is even considered to be passable by the pathfinder + */ + private boolean canPassOpenWoodenDoors = true; + + /** If door blocks are considered passable even when closed */ + private boolean canPassClosedWoodenDoors; + + /** If water blocks are avoided (at least by the pathfinder) */ + private boolean avoidsWater; + + /** + * If the entity can swim. Swimming AI enables this and the pathfinder will also cause the entity to swim straight + * upwards when underwater + */ + private boolean canSwim; + + + public PathNavigate(EntityLiving p_i1671_1_, World p_i1671_2_) { + this.theEntity = p_i1671_1_; + this.worldObj = p_i1671_2_; + this.pathSearchRange = p_i1671_1_.getEntityAttribute(SharedMonsterAttributes.followRange); + } + + public void setAvoidsWater(boolean p_75491_1_) { + this.avoidsWater = p_75491_1_; + } + + public boolean getAvoidsWater() { + return this.avoidsWater; + } + + public void setBreakDoors(boolean p_75498_1_) { + this.canPassClosedWoodenDoors = p_75498_1_; + } + + /** + * Sets if the entity can enter open doors + */ + public void setEnterDoors(boolean p_75490_1_) { + this.canPassOpenWoodenDoors = p_75490_1_; + } + + /** + * Returns true if the entity can break doors, false otherwise + */ + public boolean getCanBreakDoors() { + return this.canPassClosedWoodenDoors; + } + + /** + * Sets if the path should avoid sunlight + */ + public void setAvoidSun(boolean p_75504_1_) { + this.noSunPathfind = p_75504_1_; + } + + /** + * Sets the speed + */ + public void setSpeed(double p_75489_1_) { + this.speed = p_75489_1_; + } + + /** + * Sets if the entity can swim + */ + public void setCanSwim(boolean p_75495_1_) { + this.canSwim = p_75495_1_; + } + + public float func_111269_d() { + return (float)this.pathSearchRange.getAttributeValue(); + } + + /** + * Returns the path to the given coordinates + */ + public PathEntity getPathToXYZ(double p_75488_1_, double p_75488_3_, double p_75488_5_) { + return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(p_75488_1_), (int)p_75488_3_, MathHelper.floor_double(p_75488_5_), this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to XYZ. Returns true if successful. + */ + public boolean tryMoveToXYZ(double p_75492_1_, double p_75492_3_, double p_75492_5_, double p_75492_7_) { + PathEntity var9 = this.getPathToXYZ(MathHelper.floor_double(p_75492_1_), (int)p_75492_3_, MathHelper.floor_double(p_75492_5_)); + return this.setPath(var9, p_75492_7_); + } + + /** + * Returns the path to the given EntityLiving + */ + public PathEntity getPathToEntityLiving(Entity p_75494_1_) { + return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, p_75494_1_, this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to EntityLiving. Returns true if successful. + */ + public boolean tryMoveToEntityLiving(Entity p_75497_1_, double p_75497_2_) { + PathEntity var4 = this.getPathToEntityLiving(p_75497_1_); + return var4 != null && this.setPath(var4, p_75497_2_); + } + + /** + * sets the active path data if path is 100% unique compared to old path, checks to adjust path for sun avoiding + * ents and stores end coords + */ + public boolean setPath(PathEntity p_75484_1_, double p_75484_2_) { + if (p_75484_1_ == null) { + this.currentPath = null; + return false; + } else { + if (!p_75484_1_.isSamePath(this.currentPath)) { + this.currentPath = p_75484_1_; + } + + if (this.noSunPathfind) { + this.removeSunnyPath(); + } + + if (this.currentPath.getCurrentPathLength() == 0) { + return false; + } else { + this.speed = p_75484_2_; + Vec3 var4 = this.getEntityPosition(); + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck.xCoord = var4.xCoord; + this.lastPosCheck.yCoord = var4.yCoord; + this.lastPosCheck.zCoord = var4.zCoord; + return true; + } + } + } + + /** + * gets the actively used PathEntity + */ + public PathEntity getPath() { + return this.currentPath; + } + + public void onUpdateNavigation() { + ++this.totalTicks; + + if (!this.noPath()) { + if (this.canNavigate()) { + this.pathFollow(); + } + + if (!this.noPath()) { + Vec3 var1 = this.currentPath.getPosition(this.theEntity); + + if (var1 != null) { + this.theEntity.getMoveHelper().setMoveTo(var1.xCoord, var1.yCoord, var1.zCoord, this.speed); + } + } + } + } + + private void pathFollow() { + Vec3 var1 = this.getEntityPosition(); + int var2 = this.currentPath.getCurrentPathLength(); + + for (int var3 = this.currentPath.getCurrentPathIndex(); var3 < this.currentPath.getCurrentPathLength(); ++var3) { + if (this.currentPath.getPathPointFromIndex(var3).yCoord != (int)var1.yCoord) { + var2 = var3; + break; + } + } + + float var8 = this.theEntity.width * this.theEntity.width; + int var4; + + for (var4 = this.currentPath.getCurrentPathIndex(); var4 < var2; ++var4) { + if (var1.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, var4)) < (double)var8) { + this.currentPath.setCurrentPathIndex(var4 + 1); + } + } + + var4 = MathHelper.ceiling_float_int(this.theEntity.width); + int var5 = (int)this.theEntity.height + 1; + int var6 = var4; + + for (int var7 = var2 - 1; var7 >= this.currentPath.getCurrentPathIndex(); --var7) { + if (this.isDirectPathBetweenPoints(var1, this.currentPath.getVectorFromIndex(this.theEntity, var7), var4, var5, var6)) { + this.currentPath.setCurrentPathIndex(var7); + break; + } + } + + if (this.totalTicks - this.ticksAtLastPos > 100) { + if (var1.squareDistanceTo(this.lastPosCheck) < 2.25D) { + this.clearPathEntity(); + } + + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck.xCoord = var1.xCoord; + this.lastPosCheck.yCoord = var1.yCoord; + this.lastPosCheck.zCoord = var1.zCoord; + } + } + + /** + * If null path or reached the end + */ + public boolean noPath() { + return this.currentPath == null || this.currentPath.isFinished(); + } + + /** + * sets active PathEntity to null + */ + public void clearPathEntity() { + this.currentPath = null; + } + + private Vec3 getEntityPosition() { + return Vec3.createVectorHelper(this.theEntity.posX, this.getPathableYPos(), this.theEntity.posZ); + } + + /** + * Gets the safe pathing Y position for the entity depending on if it can path swim or not + */ + private int getPathableYPos() { + if (this.theEntity.isInWater() && this.canSwim) { + int var1 = (int)this.theEntity.boundingBox.minY; + Block var2 = this.worldObj.getBlock(MathHelper.floor_double(this.theEntity.posX), var1, MathHelper.floor_double(this.theEntity.posZ)); + int var3 = 0; + + do { + if (var2 != Blocks.flowing_water && var2 != Blocks.water) { + return var1; + } + + ++var1; + var2 = this.worldObj.getBlock(MathHelper.floor_double(this.theEntity.posX), var1, MathHelper.floor_double(this.theEntity.posZ)); + ++var3; + } + while (var3 <= 16); + + return (int)this.theEntity.boundingBox.minY; + } else { + return (int)(this.theEntity.boundingBox.minY + 0.5D); + } + } + + /** + * If on ground or swimming and can swim + */ + private boolean canNavigate() { + return this.theEntity.onGround || this.canSwim && this.isInFluid() || this.theEntity.isRiding() && this.theEntity instanceof EntityZombie && this.theEntity.ridingEntity instanceof EntityChicken; + } + + /** + * Returns true if the entity is in water or lava, false otherwise + */ + private boolean isInFluid() { + return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); + } + + /** + * Trims path data from the end to the first sun covered block + */ + private void removeSunnyPath() { + if (!this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.boundingBox.minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ))) { + for (int var1 = 0; var1 < this.currentPath.getCurrentPathLength(); ++var1) { + PathPoint var2 = this.currentPath.getPathPointFromIndex(var1); + + if (this.worldObj.canBlockSeeTheSky(var2.xCoord, var2.yCoord, var2.zCoord)) { + this.currentPath.setCurrentPathLength(var1 - 1); + return; + } + } + } + } + + /** + * Returns true when an entity of specified size could safely walk in a straight line between the two points. Args: + * pos1, pos2, entityXSize, entityYSize, entityZSize + */ + private boolean isDirectPathBetweenPoints(Vec3 p_75493_1_, Vec3 p_75493_2_, int p_75493_3_, int p_75493_4_, int p_75493_5_) { + int var6 = MathHelper.floor_double(p_75493_1_.xCoord); + int var7 = MathHelper.floor_double(p_75493_1_.zCoord); + double var8 = p_75493_2_.xCoord - p_75493_1_.xCoord; + double var10 = p_75493_2_.zCoord - p_75493_1_.zCoord; + double var12 = var8 * var8 + var10 * var10; + + if (var12 < 1.0E-8D) { + return false; + } else { + double var14 = 1.0D / Math.sqrt(var12); + var8 *= var14; + var10 *= var14; + p_75493_3_ += 2; + p_75493_5_ += 2; + + if (!this.isSafeToStandAt(var6, (int)p_75493_1_.yCoord, var7, p_75493_3_, p_75493_4_, p_75493_5_, p_75493_1_, var8, var10)) { + return false; + } else { + p_75493_3_ -= 2; + p_75493_5_ -= 2; + double var16 = 1.0D / Math.abs(var8); + double var18 = 1.0D / Math.abs(var10); + double var20 = (double)(var6 * 1) - p_75493_1_.xCoord; + double var22 = (double)(var7 * 1) - p_75493_1_.zCoord; + + if (var8 >= 0.0D) { + ++var20; + } + + if (var10 >= 0.0D) { + ++var22; + } + + var20 /= var8; + var22 /= var10; + int var24 = var8 < 0.0D ? -1 : 1; + int var25 = var10 < 0.0D ? -1 : 1; + int var26 = MathHelper.floor_double(p_75493_2_.xCoord); + int var27 = MathHelper.floor_double(p_75493_2_.zCoord); + int var28 = var26 - var6; + int var29 = var27 - var7; + + do { + if (var28 * var24 <= 0 && var29 * var25 <= 0) { + return true; + } + + if (var20 < var22) { + var20 += var16; + var6 += var24; + var28 = var26 - var6; + } else { + var22 += var18; + var7 += var25; + var29 = var27 - var7; + } + } + while (this.isSafeToStandAt(var6, (int)p_75493_1_.yCoord, var7, p_75493_3_, p_75493_4_, p_75493_5_, p_75493_1_, var8, var10)); + + return false; + } + } + } + + /** + * Returns true when an entity could stand at a position, including solid blocks under the entire entity. Args: + * xOffset, yOffset, zOffset, entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ + */ + private boolean isSafeToStandAt(int p_75483_1_, int p_75483_2_, int p_75483_3_, int p_75483_4_, int p_75483_5_, int p_75483_6_, Vec3 p_75483_7_, double p_75483_8_, double p_75483_10_) { + int var12 = p_75483_1_ - p_75483_4_ / 2; + int var13 = p_75483_3_ - p_75483_6_ / 2; + + if (!this.isPositionClear(var12, p_75483_2_, var13, p_75483_4_, p_75483_5_, p_75483_6_, p_75483_7_, p_75483_8_, p_75483_10_)) { + return false; + } else { + for (int var14 = var12; var14 < var12 + p_75483_4_; ++var14) { + for (int var15 = var13; var15 < var13 + p_75483_6_; ++var15) { + double var16 = (double)var14 + 0.5D - p_75483_7_.xCoord; + double var18 = (double)var15 + 0.5D - p_75483_7_.zCoord; + + if (var16 * p_75483_8_ + var18 * p_75483_10_ >= 0.0D) { + Block var20 = this.worldObj.getBlock(var14, p_75483_2_ - 1, var15); + Material var21 = var20.getMaterial(); + + if (var21 == Material.air) { + return false; + } + + if (var21 == Material.water && !this.theEntity.isInWater()) { + return false; + } + + if (var21 == Material.lava) { + return false; + } + } + } + } + + return true; + } + } + + /** + * Returns true if an entity does not collide with any solid blocks at the position. Args: xOffset, yOffset, + * zOffset, entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ + */ + private boolean isPositionClear(int p_75496_1_, int p_75496_2_, int p_75496_3_, int p_75496_4_, int p_75496_5_, int p_75496_6_, Vec3 p_75496_7_, double p_75496_8_, double p_75496_10_) { + for (int var12 = p_75496_1_; var12 < p_75496_1_ + p_75496_4_; ++var12) { + for (int var13 = p_75496_2_; var13 < p_75496_2_ + p_75496_5_; ++var13) { + for (int var14 = p_75496_3_; var14 < p_75496_3_ + p_75496_6_; ++var14) { + double var15 = (double)var12 + 0.5D - p_75496_7_.xCoord; + double var17 = (double)var14 + 0.5D - p_75496_7_.zCoord; + + if (var15 * p_75496_8_ + var17 * p_75496_10_ >= 0.0D) { + Block var19 = this.worldObj.getBlock(var12, var13, var14); + + if (!var19.getBlocksMovement(this.worldObj, var12, var13, var14)) { + return false; + } + } + } + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathPoint.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathPoint.java new file mode 100644 index 0000000..cc9e9d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/pathfinding/PathPoint.java @@ -0,0 +1,91 @@ +package net.minecraft.pathfinding; + +import net.minecraft.util.MathHelper; + +public class PathPoint { + /** The x coordinate of this point */ + public final int xCoord; + + /** The y coordinate of this point */ + public final int yCoord; + + /** The z coordinate of this point */ + public final int zCoord; + + /** A hash of the coordinates used to identify this point */ + private final int hash; + + /** The index of this point in its assigned path */ + int index = -1; + + /** The distance along the path to this point */ + float totalPathDistance; + + /** The linear distance to the next point */ + float distanceToNext; + + /** The distance to the target */ + float distanceToTarget; + + /** The point preceding this in its assigned path */ + PathPoint previous; + + /** Indicates this is the origin */ + public boolean isFirst; + + + public PathPoint(int p_i2135_1_, int p_i2135_2_, int p_i2135_3_) { + this.xCoord = p_i2135_1_; + this.yCoord = p_i2135_2_; + this.zCoord = p_i2135_3_; + this.hash = makeHash(p_i2135_1_, p_i2135_2_, p_i2135_3_); + } + + public static int makeHash(int p_75830_0_, int p_75830_1_, int p_75830_2_) { + return p_75830_1_ & 255 | (p_75830_0_ & 32767) << 8 | (p_75830_2_ & 32767) << 24 | (p_75830_0_ < 0 ? Integer.MIN_VALUE : 0) | (p_75830_2_ < 0 ? 32768 : 0); + } + + /** + * Returns the linear distance to another path point + */ + public float distanceTo(PathPoint p_75829_1_) { + float var2 = (float)(p_75829_1_.xCoord - this.xCoord); + float var3 = (float)(p_75829_1_.yCoord - this.yCoord); + float var4 = (float)(p_75829_1_.zCoord - this.zCoord); + return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4); + } + + /** + * Returns the squared distance to another path point + */ + public float distanceToSquared(PathPoint p_75832_1_) { + float var2 = (float)(p_75832_1_.xCoord - this.xCoord); + float var3 = (float)(p_75832_1_.yCoord - this.yCoord); + float var4 = (float)(p_75832_1_.zCoord - this.zCoord); + return var2 * var2 + var3 * var3 + var4 * var4; + } + + public boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof PathPoint)) { + return false; + } else { + PathPoint var2 = (PathPoint)p_equals_1_; + return this.hash == var2.hash && this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord; + } + } + + public int hashCode() { + return this.hash; + } + + /** + * Returns true if this point has already been assigned to a path + */ + public boolean isAssigned() { + return this.index >= 0; + } + + public String toString() { + return this.xCoord + ", " + this.yCoord + ", " + this.zCoord; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/Potion.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/Potion.java new file mode 100644 index 0000000..f101c45 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/Potion.java @@ -0,0 +1,305 @@ +package net.minecraft.potion; + +import com.google.common.collect.Maps; +import java.util.Iterator; +import java.util.Map; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.StringUtils; + +public class Potion { + /** The array of potion types. */ + public static final Potion[] potionTypes = new Potion[32]; + public static final Potion field_76423_b = null; + public static final Potion moveSpeed = (new Potion(1, false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); + public static final Potion moveSlowdown = (new Potion(2, true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", -0.15000000596046448D, 2); + public static final Potion digSpeed = (new Potion(3, false, 14270531)).setPotionName("potion.digSpeed").setIconIndex(2, 0).setEffectiveness(1.5D); + public static final Potion digSlowdown = (new Potion(4, true, 4866583)).setPotionName("potion.digSlowDown").setIconIndex(3, 0); + public static final Potion damageBoost = (new PotionAttackDamage(5, false, 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 3.0D, 2); + public static final Potion heal = (new PotionHealth(6, false, 16262179)).setPotionName("potion.heal"); + public static final Potion harm = (new PotionHealth(7, true, 4393481)).setPotionName("potion.harm"); + public static final Potion jump = (new Potion(8, false, 7889559)).setPotionName("potion.jump").setIconIndex(2, 1); + public static final Potion confusion = (new Potion(9, true, 5578058)).setPotionName("potion.confusion").setIconIndex(3, 1).setEffectiveness(0.25D); + + /** The regeneration Potion object. */ + public static final Potion regeneration = (new Potion(10, false, 13458603)).setPotionName("potion.regeneration").setIconIndex(7, 0).setEffectiveness(0.25D); + public static final Potion resistance = (new Potion(11, false, 10044730)).setPotionName("potion.resistance").setIconIndex(6, 1); + + /** The fire resistance Potion object. */ + public static final Potion fireResistance = (new Potion(12, false, 14981690)).setPotionName("potion.fireResistance").setIconIndex(7, 1); + + /** The water breathing Potion object. */ + public static final Potion waterBreathing = (new Potion(13, false, 3035801)).setPotionName("potion.waterBreathing").setIconIndex(0, 2); + + /** The invisibility Potion object. */ + public static final Potion invisibility = (new Potion(14, false, 8356754)).setPotionName("potion.invisibility").setIconIndex(0, 1); + + /** The blindness Potion object. */ + public static final Potion blindness = (new Potion(15, true, 2039587)).setPotionName("potion.blindness").setIconIndex(5, 1).setEffectiveness(0.25D); + + /** The night vision Potion object. */ + public static final Potion nightVision = (new Potion(16, false, 2039713)).setPotionName("potion.nightVision").setIconIndex(4, 1); + + /** The hunger Potion object. */ + public static final Potion hunger = (new Potion(17, true, 5797459)).setPotionName("potion.hunger").setIconIndex(1, 1); + + /** The weakness Potion object. */ + public static final Potion weakness = (new PotionAttackDamage(18, true, 4738376)).setPotionName("potion.weakness").setIconIndex(5, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); + + /** The poison Potion object. */ + public static final Potion poison = (new Potion(19, true, 5149489)).setPotionName("potion.poison").setIconIndex(6, 0).setEffectiveness(0.25D); + + /** The wither Potion object. */ + public static final Potion wither = (new Potion(20, true, 3484199)).setPotionName("potion.wither").setIconIndex(1, 2).setEffectiveness(0.25D); + public static final Potion field_76434_w = (new PotionHealthBoost(21, false, 16284963)).setPotionName("potion.healthBoost").setIconIndex(2, 2).func_111184_a(SharedMonsterAttributes.maxHealth, "5D6F0BA2-1186-46AC-B896-C61C5CEE99CC", 4.0D, 0); + public static final Potion field_76444_x = (new PotionAbsoption(22, false, 2445989)).setPotionName("potion.absorption").setIconIndex(2, 2); + public static final Potion field_76443_y = (new PotionHealth(23, false, 16262179)).setPotionName("potion.saturation"); + public static final Potion field_76442_z = null; + public static final Potion field_76409_A = null; + public static final Potion field_76410_B = null; + public static final Potion field_76411_C = null; + public static final Potion field_76405_D = null; + public static final Potion field_76406_E = null; + public static final Potion field_76407_F = null; + public static final Potion field_76408_G = null; + + /** The Id of a Potion object. */ + public final int id; + private final Map field_111188_I = Maps.newHashMap(); + + /** + * This field indicated if the effect is 'bad' - negative - for the entity. + */ + private final boolean isBadEffect; + + /** Is the color of the liquid for this potion. */ + private final int liquidColor; + + /** The name of the Potion. */ + private String name = ""; + + /** The index for the icon displayed when the potion effect is active. */ + private int statusIconIndex = -1; + private double effectiveness; + private boolean usable; + + + protected Potion(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_) { + this.id = p_i1573_1_; + potionTypes[p_i1573_1_] = this; + this.isBadEffect = p_i1573_2_; + + if (p_i1573_2_) { + this.effectiveness = 0.5D; + } else { + this.effectiveness = 1.0D; + } + + this.liquidColor = p_i1573_3_; + } + + /** + * Sets the index for the icon displayed in the player's inventory when the status is active. + */ + protected Potion setIconIndex(int p_76399_1_, int p_76399_2_) { + this.statusIconIndex = p_76399_1_ + p_76399_2_ * 8; + return this; + } + + /** + * returns the ID of the potion + */ + public int getId() { + return this.id; + } + + public void performEffect(EntityLivingBase p_76394_1_, int p_76394_2_) { + if (this.id == regeneration.id) { + if (p_76394_1_.getHealth() < p_76394_1_.getMaxHealth()) { + p_76394_1_.heal(1.0F); + } + } else if (this.id == poison.id) { + if (p_76394_1_.getHealth() > 1.0F) { + p_76394_1_.attackEntityFrom(DamageSource.magic, 1.0F); + } + } else if (this.id == wither.id) { + p_76394_1_.attackEntityFrom(DamageSource.wither, 1.0F); + } else if (this.id == hunger.id && p_76394_1_ instanceof EntityPlayer) { + ((EntityPlayer)p_76394_1_).addExhaustion(0.025F * (float)(p_76394_2_ + 1)); + } else if (this.id == field_76443_y.id && p_76394_1_ instanceof EntityPlayer) { + if (!p_76394_1_.worldObj.isClient) { + ((EntityPlayer)p_76394_1_).getFoodStats().addStats(p_76394_2_ + 1, 1.0F); + } + } else if ((this.id != heal.id || p_76394_1_.isEntityUndead()) && (this.id != harm.id || !p_76394_1_.isEntityUndead())) { + if (this.id == harm.id && !p_76394_1_.isEntityUndead() || this.id == heal.id && p_76394_1_.isEntityUndead()) { + p_76394_1_.attackEntityFrom(DamageSource.magic, (float)(6 << p_76394_2_)); + } + } else { + p_76394_1_.heal((float)Math.max(4 << p_76394_2_, 0)); + } + } + + /** + * Hits the provided entity with this potion's instant effect. + */ + public void affectEntity(EntityLivingBase p_76402_1_, EntityLivingBase p_76402_2_, int p_76402_3_, double p_76402_4_) { + int var6; + + if ((this.id != heal.id || p_76402_2_.isEntityUndead()) && (this.id != harm.id || !p_76402_2_.isEntityUndead())) { + if (this.id == harm.id && !p_76402_2_.isEntityUndead() || this.id == heal.id && p_76402_2_.isEntityUndead()) { + var6 = (int)(p_76402_4_ * (double)(6 << p_76402_3_) + 0.5D); + + if (p_76402_1_ == null) { + p_76402_2_.attackEntityFrom(DamageSource.magic, (float)var6); + } else { + p_76402_2_.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p_76402_2_, p_76402_1_), (float)var6); + } + } + } else { + var6 = (int)(p_76402_4_ * (double)(4 << p_76402_3_) + 0.5D); + p_76402_2_.heal((float)var6); + } + } + + /** + * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) + */ + public boolean isInstant() { + return false; + } + + /** + * checks if Potion effect is ready to be applied this tick. + */ + public boolean isReady(int p_76397_1_, int p_76397_2_) { + int var3; + + if (this.id == regeneration.id) { + var3 = 50 >> p_76397_2_; + return var3 <= 0 || p_76397_1_ % var3 == 0; + } else if (this.id == poison.id) { + var3 = 25 >> p_76397_2_; + return var3 <= 0 || p_76397_1_ % var3 == 0; + } else if (this.id == wither.id) { + var3 = 40 >> p_76397_2_; + return var3 <= 0 || p_76397_1_ % var3 == 0; + } else { + return this.id == hunger.id; + } + } + + /** + * Set the potion name. + */ + public Potion setPotionName(String p_76390_1_) { + this.name = p_76390_1_; + return this; + } + + /** + * returns the name of the potion + */ + public String getName() { + return this.name; + } + + /** + * Returns true if the potion has a associated status icon to display in then inventory when active. + */ + public boolean hasStatusIcon() { + return this.statusIconIndex >= 0; + } + + /** + * Returns the index for the icon to display when the potion is active. + */ + public int getStatusIconIndex() { + return this.statusIconIndex; + } + + /** + * This method returns true if the potion effect is bad - negative - for the entity. + */ + public boolean isBadEffect() { + return this.isBadEffect; + } + + public static String getDurationString(PotionEffect p_76389_0_) { + if (p_76389_0_.getIsPotionDurationMax()) { + return "**:**"; + } else { + int var1 = p_76389_0_.getDuration(); + return StringUtils.ticksToElapsedTime(var1); + } + } + + protected Potion setEffectiveness(double p_76404_1_) { + this.effectiveness = p_76404_1_; + return this; + } + + public double getEffectiveness() { + return this.effectiveness; + } + + public boolean isUsable() { + return this.usable; + } + + /** + * Returns the color of the potion liquid. + */ + public int getLiquidColor() { + return this.liquidColor; + } + + public Potion func_111184_a(IAttribute p_111184_1_, String p_111184_2_, double p_111184_3_, int p_111184_5_) { + AttributeModifier var6 = new AttributeModifier(UUID.fromString(p_111184_2_), this.getName(), p_111184_3_, p_111184_5_); + this.field_111188_I.put(p_111184_1_, var6); + return this; + } + + public Map func_111186_k() { + return this.field_111188_I; + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase p_111187_1_, BaseAttributeMap p_111187_2_, int p_111187_3_) { + Iterator var4 = this.field_111188_I.entrySet().iterator(); + + while (var4.hasNext()) { + Entry var5 = (Entry)var4.next(); + IAttributeInstance var6 = p_111187_2_.getAttributeInstance((IAttribute)var5.getKey()); + + if (var6 != null) { + var6.removeModifier((AttributeModifier)var5.getValue()); + } + } + } + + public void applyAttributesModifiersToEntity(EntityLivingBase p_111185_1_, BaseAttributeMap p_111185_2_, int p_111185_3_) { + Iterator var4 = this.field_111188_I.entrySet().iterator(); + + while (var4.hasNext()) { + Entry var5 = (Entry)var4.next(); + IAttributeInstance var6 = p_111185_2_.getAttributeInstance((IAttribute)var5.getKey()); + + if (var6 != null) { + AttributeModifier var7 = (AttributeModifier)var5.getValue(); + var6.removeModifier(var7); + var6.applyModifier(new AttributeModifier(var7.getID(), this.getName() + " " + p_111185_3_, this.func_111183_a(p_111185_3_, var7), var7.getOperation())); + } + } + } + + public double func_111183_a(int p_111183_1_, AttributeModifier p_111183_2_) { + return p_111183_2_.getAmount() * (double)(p_111183_1_ + 1); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionAbsoption.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionAbsoption.java new file mode 100644 index 0000000..5b3e442 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionAbsoption.java @@ -0,0 +1,22 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; + +public class PotionAbsoption extends Potion { + + + protected PotionAbsoption(int p_i1569_1_, boolean p_i1569_2_, int p_i1569_3_) { + super(p_i1569_1_, p_i1569_2_, p_i1569_3_); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase p_111187_1_, BaseAttributeMap p_111187_2_, int p_111187_3_) { + p_111187_1_.setAbsorptionAmount(p_111187_1_.getAbsorptionAmount() - (float)(4 * (p_111187_3_ + 1))); + super.removeAttributesModifiersFromEntity(p_111187_1_, p_111187_2_, p_111187_3_); + } + + public void applyAttributesModifiersToEntity(EntityLivingBase p_111185_1_, BaseAttributeMap p_111185_2_, int p_111185_3_) { + p_111185_1_.setAbsorptionAmount(p_111185_1_.getAbsorptionAmount() + (float)(4 * (p_111185_3_ + 1))); + super.applyAttributesModifiersToEntity(p_111185_1_, p_111185_2_, p_111185_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionAttackDamage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionAttackDamage.java new file mode 100644 index 0000000..299b06a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionAttackDamage.java @@ -0,0 +1,15 @@ +package net.minecraft.potion; + +import net.minecraft.entity.ai.attributes.AttributeModifier; + +public class PotionAttackDamage extends Potion { + + + protected PotionAttackDamage(int p_i1570_1_, boolean p_i1570_2_, int p_i1570_3_) { + super(p_i1570_1_, p_i1570_2_, p_i1570_3_); + } + + public double func_111183_a(int p_111183_1_, AttributeModifier p_111183_2_) { + return this.id == Potion.weakness.id ? (double)(-0.5F * (float)(p_111183_1_ + 1)) : 1.3D * (double)(p_111183_1_ + 1); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionEffect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionEffect.java new file mode 100644 index 0000000..407bd81 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionEffect.java @@ -0,0 +1,187 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; + +public class PotionEffect { + /** ID value of the potion this effect matches. */ + private final int potionID; + + /** The duration of the potion effect */ + private int duration; + + /** The amplifier of the potion effect */ + private int amplifier; + + /** Whether the potion is a splash potion */ + private boolean isSplashPotion; + + /** Whether the potion effect came from a beacon */ + private boolean isAmbient; + + /** True if potion effect duration is at maximum, false otherwise. */ + private boolean isPotionDurationMax; + + + public PotionEffect(int p_i1574_1_, int p_i1574_2_) { + this(p_i1574_1_, p_i1574_2_, 0); + } + + public PotionEffect(int p_i1575_1_, int p_i1575_2_, int p_i1575_3_) { + this(p_i1575_1_, p_i1575_2_, p_i1575_3_, false); + } + + public PotionEffect(int p_i1576_1_, int p_i1576_2_, int p_i1576_3_, boolean p_i1576_4_) { + this.potionID = p_i1576_1_; + this.duration = p_i1576_2_; + this.amplifier = p_i1576_3_; + this.isAmbient = p_i1576_4_; + } + + public PotionEffect(PotionEffect p_i1577_1_) { + this.potionID = p_i1577_1_.potionID; + this.duration = p_i1577_1_.duration; + this.amplifier = p_i1577_1_.amplifier; + } + + /** + * merges the input PotionEffect into this one if this.amplifier <= tomerge.amplifier. The duration in the supplied + * potion effect is assumed to be greater. + */ + public void combine(PotionEffect p_76452_1_) { + if (this.potionID != p_76452_1_.potionID) { + System.err.println("This method should only be called for matching effects!"); + } + + if (p_76452_1_.amplifier > this.amplifier) { + this.amplifier = p_76452_1_.amplifier; + this.duration = p_76452_1_.duration; + } else if (p_76452_1_.amplifier == this.amplifier && this.duration < p_76452_1_.duration) { + this.duration = p_76452_1_.duration; + } else if (!p_76452_1_.isAmbient && this.isAmbient) { + this.isAmbient = p_76452_1_.isAmbient; + } + } + + /** + * Retrieve the ID of the potion this effect matches. + */ + public int getPotionID() { + return this.potionID; + } + + public int getDuration() { + return this.duration; + } + + public int getAmplifier() { + return this.amplifier; + } + + /** + * Set whether this potion is a splash potion. + */ + public void setSplashPotion(boolean p_82721_1_) { + this.isSplashPotion = p_82721_1_; + } + + /** + * Gets whether this potion effect originated from a beacon + */ + public boolean getIsAmbient() { + return this.isAmbient; + } + + public boolean onUpdate(EntityLivingBase p_76455_1_) { + if (this.duration > 0) { + if (Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) { + this.performEffect(p_76455_1_); + } + + this.deincrementDuration(); + } + + return this.duration > 0; + } + + private int deincrementDuration() { + return --this.duration; + } + + public void performEffect(EntityLivingBase p_76457_1_) { + if (this.duration > 0) { + Potion.potionTypes[this.potionID].performEffect(p_76457_1_, this.amplifier); + } + } + + public String getEffectName() { + return Potion.potionTypes[this.potionID].getName(); + } + + public int hashCode() { + return this.potionID; + } + + public String toString() { + String var1 = ""; + + if (this.getAmplifier() > 0) { + var1 = this.getEffectName() + " x " + (this.getAmplifier() + 1) + ", Duration: " + this.getDuration(); + } else { + var1 = this.getEffectName() + ", Duration: " + this.getDuration(); + } + + if (this.isSplashPotion) { + var1 = var1 + ", Splash: true"; + } + + return Potion.potionTypes[this.potionID].isUsable() ? "(" + var1 + ")" : var1; + } + + public boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof PotionEffect)) { + return false; + } else { + PotionEffect var2 = (PotionEffect)p_equals_1_; + return this.potionID == var2.potionID && this.amplifier == var2.amplifier && this.duration == var2.duration && this.isSplashPotion == var2.isSplashPotion && this.isAmbient == var2.isAmbient; + } + } + + /** + * Write a custom potion effect to a potion item's NBT data. + */ + public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound p_82719_1_) { + p_82719_1_.setByte("Id", (byte)this.getPotionID()); + p_82719_1_.setByte("Amplifier", (byte)this.getAmplifier()); + p_82719_1_.setInteger("Duration", this.getDuration()); + p_82719_1_.setBoolean("Ambient", this.getIsAmbient()); + return p_82719_1_; + } + + /** + * Read a custom potion effect from a potion item's NBT data. + */ + public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound p_82722_0_) { + byte var1 = p_82722_0_.getByte("Id"); + + if (var1 >= 0 && var1 < Potion.potionTypes.length && Potion.potionTypes[var1] != null) { + byte var2 = p_82722_0_.getByte("Amplifier"); + int var3 = p_82722_0_.getInteger("Duration"); + boolean var4 = p_82722_0_.getBoolean("Ambient"); + return new PotionEffect(var1, var3, var2, var4); + } else { + return null; + } + } + + /** + * Toggle the isPotionDurationMax field. + */ + public void setPotionDurationMax(boolean p_100012_1_) { + this.isPotionDurationMax = p_100012_1_; + } + + public boolean getIsPotionDurationMax() { + return this.isPotionDurationMax; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHealth.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHealth.java new file mode 100644 index 0000000..1e92a8f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHealth.java @@ -0,0 +1,23 @@ +package net.minecraft.potion; + +public class PotionHealth extends Potion { + + + public PotionHealth(int p_i1572_1_, boolean p_i1572_2_, int p_i1572_3_) { + super(p_i1572_1_, p_i1572_2_, p_i1572_3_); + } + + /** + * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) + */ + public boolean isInstant() { + return true; + } + + /** + * checks if Potion effect is ready to be applied this tick. + */ + public boolean isReady(int p_76397_1_, int p_76397_2_) { + return p_76397_1_ >= 1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHealthBoost.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHealthBoost.java new file mode 100644 index 0000000..ced8722 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHealthBoost.java @@ -0,0 +1,20 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; + +public class PotionHealthBoost extends Potion { + + + public PotionHealthBoost(int p_i1571_1_, boolean p_i1571_2_, int p_i1571_3_) { + super(p_i1571_1_, p_i1571_2_, p_i1571_3_); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase p_111187_1_, BaseAttributeMap p_111187_2_, int p_111187_3_) { + super.removeAttributesModifiersFromEntity(p_111187_1_, p_111187_2_, p_111187_3_); + + if (p_111187_1_.getHealth() > p_111187_1_.getMaxHealth()) { + p_111187_1_.setHealth(p_111187_1_.getMaxHealth()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHelper.java new file mode 100644 index 0000000..0bbbede --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/potion/PotionHelper.java @@ -0,0 +1,490 @@ +package net.minecraft.potion; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +public class PotionHelper { + public static final String field_77924_a = null; + public static final String sugarEffect; + public static final String ghastTearEffect = "+0-1-2-3&4-4+13"; + public static final String spiderEyeEffect; + public static final String fermentedSpiderEyeEffect; + public static final String speckledMelonEffect; + public static final String blazePowderEffect; + public static final String magmaCreamEffect; + public static final String redstoneEffect; + public static final String glowstoneEffect; + public static final String gunpowderEffect; + public static final String goldenCarrotEffect; + public static final String field_151423_m; + private static final HashMap potionRequirements = new HashMap(); + + /** Potion effect amplifier map */ + private static final HashMap potionAmplifiers = new HashMap(); + private static final HashMap field_77925_n; + + /** An array of possible potion prefix names, as translation IDs. */ + private static final String[] potionPrefixes; + + + /** + * Is the bit given set to 1? + */ + public static boolean checkFlag(int p_77914_0_, int p_77914_1_) { + return (p_77914_0_ & 1 << p_77914_1_) != 0; + } + + /** + * Returns 1 if the flag is set, 0 if it is not set. + */ + private static int isFlagSet(int p_77910_0_, int p_77910_1_) { + return checkFlag(p_77910_0_, p_77910_1_) ? 1 : 0; + } + + /** + * Returns 0 if the flag is set, 1 if it is not set. + */ + private static int isFlagUnset(int p_77916_0_, int p_77916_1_) { + return checkFlag(p_77916_0_, p_77916_1_) ? 0 : 1; + } + + public static int func_77909_a(int p_77909_0_) { + return func_77908_a(p_77909_0_, 5, 4, 3, 2, 1); + } + + /** + * Given a {@link Collection}<{@link PotionEffect}> will return an Integer color. + */ + public static int calcPotionLiquidColor(Collection p_77911_0_) { + int var1 = 3694022; + + if (p_77911_0_ != null && !p_77911_0_.isEmpty()) { + float var2 = 0.0F; + float var3 = 0.0F; + float var4 = 0.0F; + float var5 = 0.0F; + + for (Object o : p_77911_0_) { + PotionEffect var7 = (PotionEffect) o; + int var8 = Potion.potionTypes[var7.getPotionID()].getLiquidColor(); + + for (int var9 = 0; var9 <= var7.getAmplifier(); ++var9) { + var2 += (float) (var8 >> 16 & 255) / 255.0F; + var3 += (float) (var8 >> 8 & 255) / 255.0F; + var4 += (float) (var8 >> 0 & 255) / 255.0F; + ++var5; + } + } + + var2 = var2 / var5 * 255.0F; + var3 = var3 / var5 * 255.0F; + var4 = var4 / var5 * 255.0F; + return (int)var2 << 16 | (int)var3 << 8 | (int)var4; + } else { + return var1; + } + } + + public static boolean func_82817_b(Collection p_82817_0_) { + Iterator var1 = p_82817_0_.iterator(); + PotionEffect var2; + + do { + if (!var1.hasNext()) { + return true; + } + + var2 = (PotionEffect)var1.next(); + } + while (var2.getIsAmbient()); + + return false; + } + + public static int func_77915_a(int p_77915_0_, boolean p_77915_1_) { + if (!p_77915_1_) { + if (field_77925_n.containsKey(Integer.valueOf(p_77915_0_))) { + return ((Integer)field_77925_n.get(Integer.valueOf(p_77915_0_))).intValue(); + } else { + int var2 = calcPotionLiquidColor(getPotionEffects(p_77915_0_, false)); + field_77925_n.put(Integer.valueOf(p_77915_0_), Integer.valueOf(var2)); + return var2; + } + } else { + return calcPotionLiquidColor(getPotionEffects(p_77915_0_, p_77915_1_)); + } + } + + public static String func_77905_c(int p_77905_0_) { + int var1 = func_77909_a(p_77905_0_); + return potionPrefixes[var1]; + } + + private static int func_77904_a(boolean p_77904_0_, boolean p_77904_1_, boolean p_77904_2_, int p_77904_3_, int p_77904_4_, int p_77904_5_, int p_77904_6_) { + int var7 = 0; + + if (p_77904_0_) { + var7 = isFlagUnset(p_77904_6_, p_77904_4_); + } else if (p_77904_3_ != -1) { + if (p_77904_3_ == 0 && countSetFlags(p_77904_6_) == p_77904_4_) { + var7 = 1; + } else if (p_77904_3_ == 1 && countSetFlags(p_77904_6_) > p_77904_4_) { + var7 = 1; + } else if (p_77904_3_ == 2 && countSetFlags(p_77904_6_) < p_77904_4_) { + var7 = 1; + } + } else { + var7 = isFlagSet(p_77904_6_, p_77904_4_); + } + + if (p_77904_1_) { + var7 *= p_77904_5_; + } + + if (p_77904_2_) { + var7 *= -1; + } + + return var7; + } + + /** + * Count the number of bits in an integer set to ON. + */ + private static int countSetFlags(int p_77907_0_) { + int var1; + + for (var1 = 0; p_77907_0_ > 0; ++var1) { + p_77907_0_ &= p_77907_0_ - 1; + } + + return var1; + } + + private static int parsePotionEffects(String p_77912_0_, int p_77912_1_, int p_77912_2_, int p_77912_3_) { + if (p_77912_1_ < p_77912_0_.length() && p_77912_2_ >= 0 && p_77912_1_ < p_77912_2_) { + int var4 = p_77912_0_.indexOf(124, p_77912_1_); + int var5; + int var17; + + if (var4 >= 0 && var4 < p_77912_2_) { + var5 = parsePotionEffects(p_77912_0_, p_77912_1_, var4 - 1, p_77912_3_); + + if (var5 > 0) { + return var5; + } else { + var17 = parsePotionEffects(p_77912_0_, var4 + 1, p_77912_2_, p_77912_3_); + return var17 > 0 ? var17 : 0; + } + } else { + var5 = p_77912_0_.indexOf(38, p_77912_1_); + + if (var5 >= 0 && var5 < p_77912_2_) { + var17 = parsePotionEffects(p_77912_0_, p_77912_1_, var5 - 1, p_77912_3_); + + if (var17 <= 0) { + return 0; + } else { + int var18 = parsePotionEffects(p_77912_0_, var5 + 1, p_77912_2_, p_77912_3_); + return var18 <= 0 ? 0 : (var17 > var18 ? var17 : var18); + } + } else { + boolean var6 = false; + boolean var7 = false; + boolean var8 = false; + boolean var9 = false; + boolean var10 = false; + byte var11 = -1; + int var12 = 0; + int var13 = 0; + int var14 = 0; + + for (int var15 = p_77912_1_; var15 < p_77912_2_; ++var15) { + char var16 = p_77912_0_.charAt(var15); + + if (var16 >= 48 && var16 <= 57) { + if (var6) { + var13 = var16 - 48; + var7 = true; + } else { + var12 *= 10; + var12 += var16 - 48; + var8 = true; + } + } else if (var16 == 42) { + var6 = true; + } else if (var16 == 33) { + if (var8) { + var14 += func_77904_a(var9, var7, var10, var11, var12, var13, p_77912_3_); + var9 = false; + var10 = false; + var6 = false; + var7 = false; + var8 = false; + var13 = 0; + var12 = 0; + var11 = -1; + } + + var9 = true; + } else if (var16 == 45) { + if (var8) { + var14 += func_77904_a(var9, var7, var10, var11, var12, var13, p_77912_3_); + var9 = false; + var10 = false; + var6 = false; + var7 = false; + var8 = false; + var13 = 0; + var12 = 0; + var11 = -1; + } + + var10 = true; + } else if (var16 != 61 && var16 != 60 && var16 != 62) { + if (var16 == 43 && var8) { + var14 += func_77904_a(var9, var7, var10, var11, var12, var13, p_77912_3_); + var9 = false; + var10 = false; + var6 = false; + var7 = false; + var8 = false; + var13 = 0; + var12 = 0; + var11 = -1; + } + } else { + if (var8) { + var14 += func_77904_a(var9, var7, var10, var11, var12, var13, p_77912_3_); + var9 = false; + var10 = false; + var6 = false; + var7 = false; + var8 = false; + var13 = 0; + var12 = 0; + var11 = -1; + } + + if (var16 == 61) { + var11 = 0; + } else if (var16 == 60) { + var11 = 2; + } else if (var16 == 62) { + var11 = 1; + } + } + } + + if (var8) { + var14 += func_77904_a(var9, var7, var10, var11, var12, var13, p_77912_3_); + } + + return var14; + } + } + } else { + return 0; + } + } + + /** + * Returns a list of effects for the specified potion damage value. + */ + public static List getPotionEffects(int p_77917_0_, boolean p_77917_1_) { + ArrayList var2 = null; + Potion[] var3 = Potion.potionTypes; + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Potion var6 = var3[var5]; + + if (var6 != null && (!var6.isUsable() || p_77917_1_)) { + String var7 = (String)potionRequirements.get(Integer.valueOf(var6.getId())); + + if (var7 != null) { + int var8 = parsePotionEffects(var7, 0, var7.length(), p_77917_0_); + + if (var8 > 0) { + int var9 = 0; + String var10 = (String)potionAmplifiers.get(Integer.valueOf(var6.getId())); + + if (var10 != null) { + var9 = parsePotionEffects(var10, 0, var10.length(), p_77917_0_); + + if (var9 < 0) { + var9 = 0; + } + } + + if (var6.isInstant()) { + var8 = 1; + } else { + var8 = 1200 * (var8 * 3 + (var8 - 1) * 2); + var8 >>= var9; + var8 = (int)Math.round((double)var8 * var6.getEffectiveness()); + + if ((p_77917_0_ & 16384) != 0) { + var8 = (int)Math.round((double)var8 * 0.75D + 0.5D); + } + } + + if (var2 == null) { + var2 = new ArrayList(); + } + + PotionEffect var11 = new PotionEffect(var6.getId(), var8, var9); + + if ((p_77917_0_ & 16384) != 0) { + var11.setSplashPotion(true); + } + + var2.add(var11); + } + } + } + } + + return var2; + } + + /** + * Does bit operations for brewPotionData, given data, the index of the bit being operated upon, whether the bit + * will be removed, whether the bit will be toggled (NOT), or whether the data field will be set to 0 if the bit is + * not present. + */ + private static int brewBitOperations(int p_77906_0_, int p_77906_1_, boolean p_77906_2_, boolean p_77906_3_, boolean p_77906_4_) { + if (p_77906_4_) { + if (!checkFlag(p_77906_0_, p_77906_1_)) { + return 0; + } + } else if (p_77906_2_) { + p_77906_0_ &= ~(1 << p_77906_1_); + } else if (p_77906_3_) { + if ((p_77906_0_ & 1 << p_77906_1_) == 0) { + p_77906_0_ |= 1 << p_77906_1_; + } else { + p_77906_0_ &= ~(1 << p_77906_1_); + } + } else { + p_77906_0_ |= 1 << p_77906_1_; + } + + return p_77906_0_; + } + + /** + * Generate a data value for a potion, given its previous data value and the encoded string of new effects it will + * receive + */ + public static int applyIngredient(int p_77913_0_, String p_77913_1_) { + byte var2 = 0; + int var3 = p_77913_1_.length(); + boolean var4 = false; + boolean var5 = false; + boolean var6 = false; + boolean var7 = false; + int var8 = 0; + + for (int var9 = var2; var9 < var3; ++var9) { + char var10 = p_77913_1_.charAt(var9); + + if (var10 >= 48 && var10 <= 57) { + var8 *= 10; + var8 += var10 - 48; + var4 = true; + } else if (var10 == 33) { + if (var4) { + p_77913_0_ = brewBitOperations(p_77913_0_, var8, var6, var5, var7); + var7 = false; + var5 = false; + var6 = false; + var4 = false; + var8 = 0; + } + + var5 = true; + } else if (var10 == 45) { + if (var4) { + p_77913_0_ = brewBitOperations(p_77913_0_, var8, var6, var5, var7); + var7 = false; + var5 = false; + var6 = false; + var4 = false; + var8 = 0; + } + + var6 = true; + } else if (var10 == 43) { + if (var4) { + p_77913_0_ = brewBitOperations(p_77913_0_, var8, var6, var5, var7); + var7 = false; + var5 = false; + var6 = false; + var4 = false; + var8 = 0; + } + } else if (var10 == 38) { + if (var4) { + p_77913_0_ = brewBitOperations(p_77913_0_, var8, var6, var5, var7); + var7 = false; + var5 = false; + var6 = false; + var4 = false; + var8 = 0; + } + + var7 = true; + } + } + + if (var4) { + p_77913_0_ = brewBitOperations(p_77913_0_, var8, var6, var5, var7); + } + + return p_77913_0_ & 32767; + } + + public static int func_77908_a(int p_77908_0_, int p_77908_1_, int p_77908_2_, int p_77908_3_, int p_77908_4_, int p_77908_5_) { + return (checkFlag(p_77908_0_, p_77908_1_) ? 16 : 0) | (checkFlag(p_77908_0_, p_77908_2_) ? 8 : 0) | (checkFlag(p_77908_0_, p_77908_3_) ? 4 : 0) | (checkFlag(p_77908_0_, p_77908_4_) ? 2 : 0) | (checkFlag(p_77908_0_, p_77908_5_) ? 1 : 0); + } + + static { + potionRequirements.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); + sugarEffect = "-0+1-2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); + magmaCreamEffect = "+0+1-2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); + speckledMelonEffect = "+0-1+2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); + spiderEyeEffect = "-0-1+2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); + fermentedSpiderEyeEffect = "-0+3-4+13"; + potionRequirements.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); + potionRequirements.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); + blazePowderEffect = "+0-1-2+3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); + goldenCarrotEffect = "-0+1+2-3+13&4-4"; + potionRequirements.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); + field_151423_m = "+0-1+2+3+13&4-4"; + potionRequirements.put(Integer.valueOf(Potion.waterBreathing.getId()), "0 & !1 & 2 & 3 & 2+6"); + glowstoneEffect = "+5-6-7"; + potionAmplifiers.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.regeneration.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.harm.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.heal.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.resistance.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.poison.getId()), "5"); + redstoneEffect = "-5+6-7"; + gunpowderEffect = "+14&13-13"; + field_77925_n = new HashMap(); + potionPrefixes = new String[] {"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"}; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/IPlayerUsage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/IPlayerUsage.java new file mode 100644 index 0000000..836c9d5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/IPlayerUsage.java @@ -0,0 +1,12 @@ +package net.minecraft.profiler; + +public interface IPlayerUsage { + void addServerStatsToSnooper(PlayerUsageSnooper p_70000_1_); + + void addServerTypeToSnooper(PlayerUsageSnooper p_70001_1_); + + /** + * Returns whether snooping is enabled or not. + */ + boolean isSnooperEnabled(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/PlayerUsageSnooper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/PlayerUsageSnooper.java new file mode 100644 index 0000000..bc9ce87 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/PlayerUsageSnooper.java @@ -0,0 +1,180 @@ +package net.minecraft.profiler; + +import com.google.common.collect.Maps; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.util.HttpUtil; + +public class PlayerUsageSnooper { + private final Map field_152773_a = Maps.newHashMap(); + private final Map field_152774_b = Maps.newHashMap(); + private final String uniqueID = UUID.randomUUID().toString(); + + /** URL of the server to send the report to */ + private final URL serverUrl; + private final IPlayerUsage playerStatsCollector; + + /** set to fire the snooperThread every 15 mins */ + private final Timer threadTrigger = new Timer("Snooper Timer", true); + private final Object syncLock = new Object(); + private final long minecraftStartTimeMilis; + private boolean isRunning; + + /** incremented on every getSelfCounterFor */ + private int selfCounter; + + + public PlayerUsageSnooper(String p_i1563_1_, IPlayerUsage p_i1563_2_, long p_i1563_3_) { + try { + this.serverUrl = new URL("http://snoop.minecraft.net/" + p_i1563_1_ + "?version=" + 2); + } catch (MalformedURLException var6) { + throw new IllegalArgumentException(); + } + + this.playerStatsCollector = p_i1563_2_; + this.minecraftStartTimeMilis = p_i1563_3_; + } + + /** + * Note issuing start multiple times is not an error. + */ + public void startSnooper() { + if (!this.isRunning) { + this.isRunning = true; + this.func_152766_h(); + this.threadTrigger.schedule(new TimerTask() { + + public void run() { + if (PlayerUsageSnooper.this.playerStatsCollector.isSnooperEnabled()) { + HashMap var1; + + synchronized (PlayerUsageSnooper.this.syncLock) { + var1 = new HashMap(PlayerUsageSnooper.this.field_152774_b); + + if (PlayerUsageSnooper.this.selfCounter == 0) { + var1.putAll(PlayerUsageSnooper.this.field_152773_a); + } + + var1.put("snooper_count", Integer.valueOf(PlayerUsageSnooper.access$308(PlayerUsageSnooper.this))); + var1.put("snooper_token", PlayerUsageSnooper.this.uniqueID); + } + + HttpUtil.func_151226_a(PlayerUsageSnooper.this.serverUrl, var1, true); + } + } + }, 0L, 900000L); + } + } + + private void func_152766_h() { + this.addJvmArgsToSnooper(); + this.func_152768_a("snooper_token", this.uniqueID); + this.func_152767_b("snooper_token", this.uniqueID); + this.func_152767_b("os_name", System.getProperty("os.name")); + this.func_152767_b("os_version", System.getProperty("os.version")); + this.func_152767_b("os_architecture", System.getProperty("os.arch")); + this.func_152767_b("java_version", System.getProperty("java.version")); + this.func_152767_b("version", "1.7.10"); + this.playerStatsCollector.addServerTypeToSnooper(this); + } + + private void addJvmArgsToSnooper() { + RuntimeMXBean var1 = ManagementFactory.getRuntimeMXBean(); + List var2 = var1.getInputArguments(); + int var3 = 0; + Iterator var4 = var2.iterator(); + + while (var4.hasNext()) { + String var5 = (String)var4.next(); + + if (var5.startsWith("-X")) { + this.func_152768_a("jvm_arg[" + var3++ + "]", var5); + } + } + + this.func_152768_a("jvm_args", Integer.valueOf(var3)); + } + + public void addMemoryStatsToSnooper() { + this.func_152767_b("memory_total", Long.valueOf(Runtime.getRuntime().totalMemory())); + this.func_152767_b("memory_max", Long.valueOf(Runtime.getRuntime().maxMemory())); + this.func_152767_b("memory_free", Long.valueOf(Runtime.getRuntime().freeMemory())); + this.func_152767_b("cpu_cores", Integer.valueOf(Runtime.getRuntime().availableProcessors())); + this.playerStatsCollector.addServerStatsToSnooper(this); + } + + public void func_152768_a(String p_152768_1_, Object p_152768_2_) { + Object var3 = this.syncLock; + + synchronized (this.syncLock) { + this.field_152774_b.put(p_152768_1_, p_152768_2_); + } + } + + public void func_152767_b(String p_152767_1_, Object p_152767_2_) { + Object var3 = this.syncLock; + + synchronized (this.syncLock) { + this.field_152773_a.put(p_152767_1_, p_152767_2_); + } + } + + public Map getCurrentStats() { + LinkedHashMap var1 = new LinkedHashMap(); + Object var2 = this.syncLock; + + synchronized (this.syncLock) { + this.addMemoryStatsToSnooper(); + Iterator var3 = this.field_152773_a.entrySet().iterator(); + Entry var4; + + while (var3.hasNext()) { + var4 = (Entry)var3.next(); + var1.put(var4.getKey(), var4.getValue().toString()); + } + + var3 = this.field_152774_b.entrySet().iterator(); + + while (var3.hasNext()) { + var4 = (Entry)var3.next(); + var1.put(var4.getKey(), var4.getValue().toString()); + } + + return var1; + } + } + + public boolean isSnooperRunning() { + return this.isRunning; + } + + public void stopSnooper() { + this.threadTrigger.cancel(); + } + + public String getUniqueID() { + return this.uniqueID; + } + + /** + * Returns the saved value of System#currentTimeMillis when the game started + */ + public long getMinecraftStartTimeMillis() { + return this.minecraftStartTimeMilis; + } + + static int access$308(PlayerUsageSnooper p_access$308_0_) { + return p_access$308_0_.selfCounter++; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/Profiler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/Profiler.java new file mode 100644 index 0000000..c5cbd51 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/profiler/Profiler.java @@ -0,0 +1,228 @@ +package net.minecraft.profiler; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.src.Config; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Profiler { + private static final Logger logger = LogManager.getLogger(); + + /** List of parent sections */ + private final List sectionList = new ArrayList(); + + /** List of timestamps (System.nanoTime) */ + private final List timestampList = new ArrayList(); + + /** Flag profiling enabled */ + public boolean profilingEnabled; + + /** Current profiling section */ + private String profilingSection = ""; + + /** Profiling map */ + private final Map profilingMap = new HashMap(); + public boolean profilerGlobalEnabled = true; + private boolean profilerLocalEnabled; + private long startTickNano; + public long timeTickNano; + private long startUpdateChunksNano; + public long timeUpdateChunksNano; + + public Profiler() { + this.profilerLocalEnabled = this.profilerGlobalEnabled; + this.startTickNano = 0L; + this.timeTickNano = 0L; + this.startUpdateChunksNano = 0L; + this.timeUpdateChunksNano = 0L; + } + + /** + * Clear profiling. + */ + public void clearProfiling() { + this.profilingMap.clear(); + this.profilingSection = ""; + this.sectionList.clear(); + this.profilerLocalEnabled = this.profilerGlobalEnabled; + } + + /** + * Start section + */ + public void startSection(String par1Str) { + if (Config.getGameSettings().showDebugInfo) { + if (this.startTickNano == 0L && par1Str.equals("tick")) { + this.startTickNano = System.nanoTime(); + } + + if (this.startTickNano != 0L && par1Str.equals("preRenderErrors")) { + this.timeTickNano = System.nanoTime() - this.startTickNano; + this.startTickNano = 0L; + } + + if (this.startUpdateChunksNano == 0L && par1Str.equals("updatechunks")) { + this.startUpdateChunksNano = System.nanoTime(); + } + + if (this.startUpdateChunksNano != 0L && par1Str.equals("terrain")) { + this.timeUpdateChunksNano = System.nanoTime() - this.startUpdateChunksNano; + this.startUpdateChunksNano = 0L; + } + } + + if (this.profilerLocalEnabled) { + if (this.profilingEnabled) { + if (this.profilingSection.length() > 0) { + this.profilingSection = this.profilingSection + "."; + } + + this.profilingSection = this.profilingSection + par1Str; + this.sectionList.add(this.profilingSection); + this.timestampList.add(Long.valueOf(System.nanoTime())); + } + } + } + + /** + * End section + */ + public void endSection() { + if (this.profilerLocalEnabled) { + if (this.profilingEnabled) { + long var1 = System.nanoTime(); + long var3 = ((Long)this.timestampList.remove(this.timestampList.size() - 1)).longValue(); + this.sectionList.remove(this.sectionList.size() - 1); + long var5 = var1 - var3; + + if (this.profilingMap.containsKey(this.profilingSection)) { + this.profilingMap.put(this.profilingSection, Long.valueOf(((Long)this.profilingMap.get(this.profilingSection)).longValue() + var5)); + } else { + this.profilingMap.put(this.profilingSection, Long.valueOf(var5)); + } + + if (var5 > 100000000L) { + logger.warn("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox " + (double)var5 / 1000000.0D + " ms"); + } + + this.profilingSection = !this.sectionList.isEmpty() ? (String)this.sectionList.get(this.sectionList.size() - 1) : ""; + } + } + } + + /** + * Get profiling data + */ + public List getProfilingData(String par1Str) { + this.profilerLocalEnabled = this.profilerGlobalEnabled; + + if (!this.profilerLocalEnabled) { + return new ArrayList(Arrays.asList(new Profiler.Result[] {new Profiler.Result("root", 0.0D, 0.0D)})); + } else if (!this.profilingEnabled) { + return null; + } else { + long var3 = this.profilingMap.containsKey("root") ? ((Long)this.profilingMap.get("root")).longValue() : 0L; + long var5 = this.profilingMap.containsKey(par1Str) ? ((Long)this.profilingMap.get(par1Str)).longValue() : -1L; + ArrayList var7 = new ArrayList(); + + if (par1Str.length() > 0) { + par1Str = par1Str + "."; + } + + long var8 = 0L; + Iterator var10 = this.profilingMap.keySet().iterator(); + + while (var10.hasNext()) { + String var20 = (String)var10.next(); + + if (var20.length() > par1Str.length() && var20.startsWith(par1Str) && var20.indexOf(".", par1Str.length() + 1) < 0) { + var8 += ((Long)this.profilingMap.get(var20)).longValue(); + } + } + + float var201 = (float)var8; + + if (var8 < var5) { + var8 = var5; + } + + if (var3 < var8) { + var3 = var8; + } + + Iterator var21 = this.profilingMap.keySet().iterator(); + String var12; + + while (var21.hasNext()) { + var12 = (String)var21.next(); + + if (var12.length() > par1Str.length() && var12.startsWith(par1Str) && var12.indexOf(".", par1Str.length() + 1) < 0) { + long var13 = ((Long)this.profilingMap.get(var12)).longValue(); + double var15 = (double)var13 * 100.0D / (double)var8; + double var17 = (double)var13 * 100.0D / (double)var3; + String var19 = var12.substring(par1Str.length()); + var7.add(new Profiler.Result(var19, var15, var17)); + } + } + + var21 = this.profilingMap.keySet().iterator(); + + while (var21.hasNext()) { + var12 = (String)var21.next(); + this.profilingMap.put(var12, Long.valueOf(((Long)this.profilingMap.get(var12)).longValue() * 999L / 1000L)); + } + + if ((float)var8 > var201) { + var7.add(new Profiler.Result("unspecified", (double)((float)var8 - var201) * 100.0D / (double)var8, (double)((float)var8 - var201) * 100.0D / (double)var3)); + } + + Collections.sort(var7); + var7.add(0, new Profiler.Result(par1Str, 100.0D, (double)var8 * 100.0D / (double)var3)); + return var7; + } + } + + /** + * End current section and start a new section + */ + public void endStartSection(String par1Str) { + if (this.profilerLocalEnabled) { + this.endSection(); + this.startSection(par1Str); + } + } + + public String getNameOfLastSection() { + return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String)this.sectionList.get(this.sectionList.size() - 1); + } + + public static final class Result implements Comparable { + public double field_76332_a; + public double field_76330_b; + public String field_76331_c; + + public Result(String par1Str, double par2, double par4) { + this.field_76331_c = par1Str; + this.field_76332_a = par2; + this.field_76330_b = par4; + } + + public int compareTo(Profiler.Result par1Obj) { + return par1Obj.field_76332_a < this.field_76332_a ? -1 : (par1Obj.field_76332_a > this.field_76332_a ? 1 : par1Obj.field_76331_c.compareTo(this.field_76331_c)); + } + + public int func_76329_a() { + return (this.field_76331_c.hashCode() & 11184810) + 4473924; + } + + public int compareTo(Object par1Obj) { + return this.compareTo((Profiler.Result)par1Obj); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/DisconnectedOnlineScreen.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/DisconnectedOnlineScreen.java new file mode 100644 index 0000000..7a3878b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/DisconnectedOnlineScreen.java @@ -0,0 +1,52 @@ +package net.minecraft.realms; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.util.IChatComponent; + +public class DisconnectedOnlineScreen extends RealmsScreen { + private final String title; + private final IChatComponent reason; + private List lines; + private final RealmsScreen parent; + + + public DisconnectedOnlineScreen(RealmsScreen p_i1000_1_, String p_i1000_2_, IChatComponent p_i1000_3_) { + this.parent = p_i1000_1_; + this.title = getLocalizedString(p_i1000_2_); + this.reason = p_i1000_3_; + } + + public void init() { + this.buttonsClear(); + this.buttonsAdd(newButton(0, this.width() / 2 - 100, this.height() / 4 + 120 + 12, getLocalizedString("gui.back"))); + this.lines = this.fontSplit(this.reason.getFormattedText(), this.width() - 50); + } + + public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) { + if (p_keyPressed_2_ == 1) { + Realms.setScreen(this.parent); + } + } + + public void buttonClicked(RealmsButton p_buttonClicked_1_) { + if (p_buttonClicked_1_.id() == 0) { + Realms.setScreen(this.parent); + } + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) { + this.renderBackground(); + this.drawCenteredString(this.title, this.width() / 2, this.height() / 2 - 50, 11184810); + int var4 = this.height() / 2 - 30; + + if (this.lines != null) { + for (Iterator var5 = this.lines.iterator(); var5.hasNext(); var4 += this.fontLineHeight()) { + String var6 = (String)var5.next(); + this.drawCenteredString(var6, this.width() / 2, var4, 16777215); + } + } + + super.render(p_render_1_, p_render_2_, p_render_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/Realms.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/Realms.java new file mode 100644 index 0000000..c146de1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/Realms.java @@ -0,0 +1,66 @@ +package net.minecraft.realms; + +import com.mojang.authlib.GameProfile; +import java.net.Proxy; +import java.util.UUID; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; +import net.minecraft.world.WorldSettings; + +public class Realms { + + + public static boolean isTouchScreen() { + return Minecraft.getMinecraft().gameSettings.touchscreen; + } + + public static Proxy getProxy() { + return Minecraft.getMinecraft().getProxy(); + } + + public static String sessionId() { + Session var0 = Minecraft.getMinecraft().getSession(); + return var0 == null ? null : var0.getSessionID(); + } + + public static String userName() { + Session var0 = Minecraft.getMinecraft().getSession(); + return var0 == null ? null : var0.getUsername(); + } + + public static long currentTimeMillis() { + return Minecraft.getSystemTime(); + } + + public static String getSessionId() { + return Minecraft.getMinecraft().getSession().getSessionID(); + } + + public static String getName() { + return Minecraft.getMinecraft().getSession().getUsername(); + } + + public static String uuidToName(String p_uuidToName_0_) { + return Minecraft.getMinecraft().func_152347_ac().fillProfileProperties(new GameProfile(UUID.fromString(p_uuidToName_0_.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")), null), false).getName(); + } + + public static void setScreen(RealmsScreen p_setScreen_0_) { + Minecraft.getMinecraft().displayGuiScreen(p_setScreen_0_.getProxy()); + } + + public static String getGameDirectoryPath() { + return Minecraft.getMinecraft().mcDataDir.getAbsolutePath(); + } + + public static int survivalId() { + return WorldSettings.GameType.SURVIVAL.getID(); + } + + public static int creativeId() { + return WorldSettings.GameType.CREATIVE.getID(); + } + + public static int adventureId() { + return WorldSettings.GameType.ADVENTURE.getID(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java new file mode 100644 index 0000000..3c9fc33 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java @@ -0,0 +1,66 @@ +package net.minecraft.realms; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.SaveFormatComparator; + +public class RealmsAnvilLevelStorageSource { + private final ISaveFormat levelStorageSource; + + + public RealmsAnvilLevelStorageSource(ISaveFormat p_i1106_1_) { + this.levelStorageSource = p_i1106_1_; + } + + public String getName() { + return this.levelStorageSource.func_154333_a(); + } + + public boolean levelExists(String p_levelExists_1_) { + return this.levelStorageSource.canLoadWorld(p_levelExists_1_); + } + + public boolean convertLevel(String p_convertLevel_1_, IProgressUpdate p_convertLevel_2_) { + return this.levelStorageSource.convertMapFormat(p_convertLevel_1_, p_convertLevel_2_); + } + + public boolean requiresConversion(String p_requiresConversion_1_) { + return this.levelStorageSource.isOldMapFormat(p_requiresConversion_1_); + } + + public boolean isNewLevelIdAcceptable(String p_isNewLevelIdAcceptable_1_) { + return this.levelStorageSource.func_154335_d(p_isNewLevelIdAcceptable_1_); + } + + public boolean deleteLevel(String p_deleteLevel_1_) { + return this.levelStorageSource.deleteWorldDirectory(p_deleteLevel_1_); + } + + public boolean isConvertible(String p_isConvertible_1_) { + return this.levelStorageSource.func_154334_a(p_isConvertible_1_); + } + + public void renameLevel(String p_renameLevel_1_, String p_renameLevel_2_) { + this.levelStorageSource.renameWorld(p_renameLevel_1_, p_renameLevel_2_); + } + + public void clearAll() { + this.levelStorageSource.flushCache(); + } + + public List getLevelList() throws AnvilConverterException { + ArrayList var1 = new ArrayList(); + Iterator var2 = this.levelStorageSource.getSaveList().iterator(); + + while (var2.hasNext()) { + SaveFormatComparator var3 = (SaveFormatComparator)var2.next(); + var1.add(new RealmsLevelSummary(var3)); + } + + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsBridge.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsBridge.java new file mode 100644 index 0000000..a752101 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsBridge.java @@ -0,0 +1,31 @@ +package net.minecraft.realms; + +import java.lang.reflect.Constructor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RealmsBridge extends RealmsScreen { + private static final Logger LOGGER = LogManager.getLogger(); + private GuiScreen previousScreen; + + + public void switchToRealms(GuiScreen p_switchToRealms_1_) { + this.previousScreen = p_switchToRealms_1_; + + try { + Class var2 = Class.forName("com.mojang.realmsclient.RealmsMainScreen"); + Constructor var3 = var2.getDeclaredConstructor(RealmsScreen.class); + var3.setAccessible(true); + Object var4 = var3.newInstance(this); + Minecraft.getMinecraft().displayGuiScreen(((RealmsScreen)var4).getProxy()); + } catch (Exception var5) { + LOGGER.error("Realms module missing", var5); + } + } + + public void init() { + Minecraft.getMinecraft().displayGuiScreen(this.previousScreen); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsButton.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsButton.java new file mode 100644 index 0000000..4e57e90 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsButton.java @@ -0,0 +1,69 @@ +package net.minecraft.realms; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiButtonRealmsProxy; + +public class RealmsButton { + private final GuiButtonRealmsProxy proxy; + + + public RealmsButton(int p_i1177_1_, int p_i1177_2_, int p_i1177_3_, String p_i1177_4_) { + this.proxy = new GuiButtonRealmsProxy(this, p_i1177_1_, p_i1177_2_, p_i1177_3_, p_i1177_4_); + } + + public RealmsButton(int p_i1178_1_, int p_i1178_2_, int p_i1178_3_, int p_i1178_4_, int p_i1178_5_, String p_i1178_6_) { + this.proxy = new GuiButtonRealmsProxy(this, p_i1178_1_, p_i1178_2_, p_i1178_3_, p_i1178_6_, p_i1178_4_, p_i1178_5_); + } + + public GuiButton getProxy() { + return this.proxy; + } + + public int id() { + return this.proxy.func_154314_d(); + } + + public boolean active() { + return this.proxy.func_154315_e(); + } + + public void active(boolean p_active_1_) { + this.proxy.func_154313_b(p_active_1_); + } + + public void msg(String p_msg_1_) { + this.proxy.func_154311_a(p_msg_1_); + } + + public int getWidth() { + return this.proxy.func_146117_b(); + } + + public int getHeight() { + return this.proxy.func_154310_c(); + } + + public int y() { + return this.proxy.func_154316_f(); + } + + public void render(int p_render_1_, int p_render_2_) { + this.proxy.drawButton(Minecraft.getMinecraft(), p_render_1_, p_render_2_); + } + + public void clicked(int p_clicked_1_, int p_clicked_2_) {} + + public void released(int p_released_1_, int p_released_2_) {} + + public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_) { + Gui.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_); + } + + public void renderBg(int p_renderBg_1_, int p_renderBg_2_) {} + + public int getYImage(boolean p_getYImage_1_) { + return this.proxy.func_154312_c(p_getYImage_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsConnect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsConnect.java new file mode 100644 index 0000000..875dfdb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsConnect.java @@ -0,0 +1,98 @@ +package net.minecraft.realms; + +import io.netty.util.concurrent.GenericFutureListener; +import java.net.InetAddress; +import java.net.UnknownHostException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentTranslation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RealmsConnect { + private static final Logger LOGGER = LogManager.getLogger(); + private final RealmsScreen onlineScreen; + private volatile boolean aborted = false; + private NetworkManager connection; + + + public RealmsConnect(RealmsScreen p_i1079_1_) { + this.onlineScreen = p_i1079_1_; + } + + public void connect(final String p_connect_1_, final int p_connect_2_) { + (new Thread("Realms-connect-task") { + + public void run() { + InetAddress var1 = null; + + try { + var1 = InetAddress.getByName(p_connect_1_); + + if (RealmsConnect.this.aborted) { + return; + } + + RealmsConnect.this.connection = NetworkManager.provideLanClient(var1, p_connect_2_); + + if (RealmsConnect.this.aborted) { + return; + } + + RealmsConnect.this.connection.setNetHandler(new NetHandlerLoginClient(RealmsConnect.this.connection, Minecraft.getMinecraft(), RealmsConnect.this.onlineScreen.getProxy())); + + if (RealmsConnect.this.aborted) { + return; + } + + RealmsConnect.this.connection.scheduleOutboundPacket(new C00Handshake(5, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); + + if (RealmsConnect.this.aborted) { + return; + } + + RealmsConnect.this.connection.scheduleOutboundPacket(new C00PacketLoginStart(Minecraft.getMinecraft().getSession().func_148256_e())); + } catch (UnknownHostException var5) { + if (RealmsConnect.this.aborted) { + return; + } + + RealmsConnect.LOGGER.error("Couldn't connect to world", var5); + Realms.setScreen(new DisconnectedOnlineScreen(RealmsConnect.this.onlineScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", "Unknown host '" + p_connect_1_ + "'"))); + } catch (Exception var6) { + if (RealmsConnect.this.aborted) { + return; + } + + RealmsConnect.LOGGER.error("Couldn't connect to world", var6); + String var3 = var6.toString(); + + if (var1 != null) { + String var4 = var1 + ":" + p_connect_2_; + var3 = var3.replaceAll(var4, ""); + } + + Realms.setScreen(new DisconnectedOnlineScreen(RealmsConnect.this.onlineScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", var3))); + } + } + }).start(); + } + + public void abort() { + this.aborted = true; + } + + public void tick() { + if (this.connection != null) { + if (this.connection.isChannelOpen()) { + this.connection.processReceivedPackets(); + } else if (this.connection.getExitMessage() != null) { + this.connection.getNetHandler().onDisconnect(this.connection.getExitMessage()); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsEditBox.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsEditBox.java new file mode 100644 index 0000000..6830ea0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsEditBox.java @@ -0,0 +1,568 @@ +package net.minecraft.realms; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ChatAllowedCharacters; +import org.lwjgl.opengl.GL11; + +public class RealmsEditBox { + public static final int BACKWARDS = -1; + public static final int FORWARDS = 1; + private static final int CURSOR_INSERT_WIDTH = 1; + private static final int CURSOR_INSERT_COLOR = -3092272; + private static final String CURSOR_APPEND_CHARACTER = "_"; + private final FontRenderer font; + private final int x; + private final int y; + private final int width; + private final int height; + private String value; + private int maxLength; + private int frame; + private boolean bordered; + private boolean canLoseFocus; + private boolean inFocus; + private boolean isEditable; + private int displayPos; + private int cursorPos; + private int highlightPos; + private int textColor; + private int textColorUneditable; + private boolean visible; + + + public RealmsEditBox(int p_i1111_1_, int p_i1111_2_, int p_i1111_3_, int p_i1111_4_) { + this(Minecraft.getMinecraft().fontRenderer, p_i1111_1_, p_i1111_2_, p_i1111_3_, p_i1111_4_); + } + + public RealmsEditBox(FontRenderer p_i1112_1_, int p_i1112_2_, int p_i1112_3_, int p_i1112_4_, int p_i1112_5_) { + this.value = ""; + this.maxLength = 32; + this.bordered = true; + this.canLoseFocus = true; + this.isEditable = true; + this.textColor = 14737632; + this.textColorUneditable = 7368816; + this.visible = true; + this.font = p_i1112_1_; + this.x = p_i1112_2_; + this.y = p_i1112_3_; + this.width = p_i1112_4_; + this.height = p_i1112_5_; + } + + public void tick() { + ++this.frame; + } + + public void setValue(String p_setValue_1_) { + if (p_setValue_1_.length() > this.maxLength) { + this.value = p_setValue_1_.substring(0, this.maxLength); + } else { + this.value = p_setValue_1_; + } + + this.moveCursorToEnd(); + } + + public String getValue() { + return this.value; + } + + public String getHighlighted() { + int var1 = this.cursorPos < this.highlightPos ? this.cursorPos : this.highlightPos; + int var2 = this.cursorPos < this.highlightPos ? this.highlightPos : this.cursorPos; + return this.value.substring(var1, var2); + } + + public void insertText(String p_insertText_1_) { + String var2 = ""; + String var3 = ChatAllowedCharacters.filerAllowedCharacters(p_insertText_1_); + int var4 = this.cursorPos < this.highlightPos ? this.cursorPos : this.highlightPos; + int var5 = this.cursorPos < this.highlightPos ? this.highlightPos : this.cursorPos; + int var6 = this.maxLength - this.value.length() - (var4 - this.highlightPos); + boolean var7 = false; + + if (this.value.length() > 0) { + var2 = var2 + this.value.substring(0, var4); + } + + int var8; + + if (var6 < var3.length()) { + var2 = var2 + var3.substring(0, var6); + var8 = var6; + } else { + var2 = var2 + var3; + var8 = var3.length(); + } + + if (this.value.length() > 0 && var5 < this.value.length()) { + var2 = var2 + this.value.substring(var5); + } + + this.value = var2; + this.moveCursor(var4 - this.highlightPos + var8); + } + + public void deleteWords(int p_deleteWords_1_) { + if (this.value.length() != 0) { + if (this.highlightPos != this.cursorPos) { + this.insertText(""); + } else { + this.deleteChars(this.getWordPosition(p_deleteWords_1_) - this.cursorPos); + } + } + } + + public void deleteChars(int p_deleteChars_1_) { + if (this.value.length() != 0) { + if (this.highlightPos != this.cursorPos) { + this.insertText(""); + } else { + boolean var2 = p_deleteChars_1_ < 0; + int var3 = var2 ? this.cursorPos + p_deleteChars_1_ : this.cursorPos; + int var4 = var2 ? this.cursorPos : this.cursorPos + p_deleteChars_1_; + String var5 = ""; + + if (var3 >= 0) { + var5 = this.value.substring(0, var3); + } + + if (var4 < this.value.length()) { + var5 = var5 + this.value.substring(var4); + } + + this.value = var5; + + if (var2) { + this.moveCursor(p_deleteChars_1_); + } + } + } + } + + public int getWordPosition(int p_getWordPosition_1_) { + return this.getWordPosition(p_getWordPosition_1_, this.getCursorPosition()); + } + + public int getWordPosition(int p_getWordPosition_1_, int p_getWordPosition_2_) { + return this.getWordPosition(p_getWordPosition_1_, this.getCursorPosition(), true); + } + + public int getWordPosition(int p_getWordPosition_1_, int p_getWordPosition_2_, boolean p_getWordPosition_3_) { + int var4 = p_getWordPosition_2_; + boolean var5 = p_getWordPosition_1_ < 0; + int var6 = Math.abs(p_getWordPosition_1_); + + for (int var7 = 0; var7 < var6; ++var7) { + if (var5) { + while (p_getWordPosition_3_ && var4 > 0 && this.value.charAt(var4 - 1) == 32) { + --var4; + } + + while (var4 > 0 && this.value.charAt(var4 - 1) != 32) { + --var4; + } + } else { + int var8 = this.value.length(); + var4 = this.value.indexOf(32, var4); + + if (var4 == -1) { + var4 = var8; + } else { + while (p_getWordPosition_3_ && var4 < var8 && this.value.charAt(var4) == 32) { + ++var4; + } + } + } + } + + return var4; + } + + public void moveCursor(int p_moveCursor_1_) { + this.moveCursorTo(this.highlightPos + p_moveCursor_1_); + } + + public void moveCursorTo(int p_moveCursorTo_1_) { + this.cursorPos = p_moveCursorTo_1_; + int var2 = this.value.length(); + + if (this.cursorPos < 0) { + this.cursorPos = 0; + } + + if (this.cursorPos > var2) { + this.cursorPos = var2; + } + + this.setHighlightPos(this.cursorPos); + } + + public void moveCursorToStart() { + this.moveCursorTo(0); + } + + public void moveCursorToEnd() { + this.moveCursorTo(this.value.length()); + } + + public boolean keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) { + if (!this.inFocus) { + return false; + } else { + switch (p_keyPressed_1_) { + case 1: + this.moveCursorToEnd(); + this.setHighlightPos(0); + return true; + + case 3: + GuiScreen.setClipboardString(this.getHighlighted()); + return true; + + case 22: + if (this.isEditable) { + this.insertText(GuiScreen.getClipboardString()); + } + + return true; + + case 24: + GuiScreen.setClipboardString(this.getHighlighted()); + + if (this.isEditable) { + this.insertText(""); + } + + return true; + + default: + switch (p_keyPressed_2_) { + case 14: + if (GuiScreen.isCtrlKeyDown()) { + if (this.isEditable) { + this.deleteWords(-1); + } + } else if (this.isEditable) { + this.deleteChars(-1); + } + + return true; + + case 199: + if (GuiScreen.isShiftKeyDown()) { + this.setHighlightPos(0); + } else { + this.moveCursorToStart(); + } + + return true; + + case 203: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setHighlightPos(this.getWordPosition(-1, this.getHighlightPos())); + } else { + this.setHighlightPos(this.getHighlightPos() - 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.moveCursorTo(this.getWordPosition(-1)); + } else { + this.moveCursor(-1); + } + + return true; + + case 205: + if (GuiScreen.isShiftKeyDown()) { + if (GuiScreen.isCtrlKeyDown()) { + this.setHighlightPos(this.getWordPosition(1, this.getHighlightPos())); + } else { + this.setHighlightPos(this.getHighlightPos() + 1); + } + } else if (GuiScreen.isCtrlKeyDown()) { + this.moveCursorTo(this.getWordPosition(1)); + } else { + this.moveCursor(1); + } + + return true; + + case 207: + if (GuiScreen.isShiftKeyDown()) { + this.setHighlightPos(this.value.length()); + } else { + this.moveCursorToEnd(); + } + + return true; + + case 211: + if (GuiScreen.isCtrlKeyDown()) { + if (this.isEditable) { + this.deleteWords(1); + } + } else if (this.isEditable) { + this.deleteChars(1); + } + + return true; + + default: + if (ChatAllowedCharacters.isAllowedCharacter(p_keyPressed_1_)) { + if (this.isEditable) { + this.insertText(Character.toString(p_keyPressed_1_)); + } + + return true; + } else { + return false; + } + } + } + } + } + + public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_) { + boolean var4 = p_mouseClicked_1_ >= this.x && p_mouseClicked_1_ < this.x + this.width && p_mouseClicked_2_ >= this.y && p_mouseClicked_2_ < this.y + this.height; + + if (this.canLoseFocus) { + this.setFocus(var4); + } + + if (this.inFocus && p_mouseClicked_3_ == 0) { + int var5 = p_mouseClicked_1_ - this.x; + + if (this.bordered) { + var5 -= 4; + } + + String var6 = this.font.trimStringToWidth(this.value.substring(this.displayPos), this.getInnerWidth()); + this.moveCursorTo(this.font.trimStringToWidth(var6, var5).length() + this.displayPos); + } + } + + public void render() { + if (this.isVisible()) { + if (this.isBordered()) { + Gui.drawRect(this.x - 1, this.y - 1, this.x + this.width + 1, this.y + this.height + 1, -6250336); + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, -16777216); + } + + int var1 = this.isEditable ? this.textColor : this.textColorUneditable; + int var2 = this.cursorPos - this.displayPos; + int var3 = this.highlightPos - this.displayPos; + String var4 = this.font.trimStringToWidth(this.value.substring(this.displayPos), this.getInnerWidth()); + boolean var5 = var2 >= 0 && var2 <= var4.length(); + boolean var6 = this.inFocus && this.frame / 6 % 2 == 0 && var5; + int var7 = this.bordered ? this.x + 4 : this.x; + int var8 = this.bordered ? this.y + (this.height - 8) / 2 : this.y; + int var9 = var7; + + if (var3 > var4.length()) { + var3 = var4.length(); + } + + if (var4.length() > 0) { + String var10 = var5 ? var4.substring(0, var2) : var4; + var9 = this.font.drawStringWithShadow(var10, var7, var8, var1); + } + + boolean var13 = this.cursorPos < this.value.length() || this.value.length() >= this.getMaxLength(); + int var11 = var9; + + if (!var5) { + var11 = var2 > 0 ? var7 + this.width : var7; + } else if (var13) { + var11 = var9 - 1; + --var9; + } + + if (var4.length() > 0 && var5 && var2 < var4.length()) { + this.font.drawStringWithShadow(var4.substring(var2), var9, var8, var1); + } + + if (var6) { + if (var13) { + Gui.drawRect(var11, var8 - 1, var11 + 1, var8 + 1 + this.font.FONT_HEIGHT, -3092272); + } else { + this.font.drawStringWithShadow("_", var11, var8, var1); + } + } + + if (var3 != var2) { + int var12 = var7 + this.font.getStringWidth(var4.substring(0, var3)); + this.renderHighlight(var11, var8 - 1, var12 - 1, var8 + 1 + this.font.FONT_HEIGHT); + } + } + } + + private void renderHighlight(int p_renderHighlight_1_, int p_renderHighlight_2_, int p_renderHighlight_3_, int p_renderHighlight_4_) { + int var5; + + if (p_renderHighlight_1_ < p_renderHighlight_3_) { + var5 = p_renderHighlight_1_; + p_renderHighlight_1_ = p_renderHighlight_3_; + p_renderHighlight_3_ = var5; + } + + if (p_renderHighlight_2_ < p_renderHighlight_4_) { + var5 = p_renderHighlight_2_; + p_renderHighlight_2_ = p_renderHighlight_4_; + p_renderHighlight_4_ = var5; + } + + if (p_renderHighlight_3_ > this.x + this.width) { + p_renderHighlight_3_ = this.x + this.width; + } + + if (p_renderHighlight_1_ > this.x + this.width) { + p_renderHighlight_1_ = this.x + this.width; + } + + Tessellator var6 = Tessellator.instance; + GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); + GL11.glLogicOp(GL11.GL_OR_REVERSE); + var6.startDrawingQuads(); + var6.addVertex(p_renderHighlight_1_, p_renderHighlight_4_, 0.0D); + var6.addVertex(p_renderHighlight_3_, p_renderHighlight_4_, 0.0D); + var6.addVertex(p_renderHighlight_3_, p_renderHighlight_2_, 0.0D); + var6.addVertex(p_renderHighlight_1_, p_renderHighlight_2_, 0.0D); + var6.draw(); + GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + public void setMaxLength(int p_setMaxLength_1_) { + this.maxLength = p_setMaxLength_1_; + + if (this.value.length() > p_setMaxLength_1_) { + this.value = this.value.substring(0, p_setMaxLength_1_); + } + } + + public int getMaxLength() { + return this.maxLength; + } + + public int getCursorPosition() { + return this.cursorPos; + } + + public boolean isBordered() { + return this.bordered; + } + + public void setBordered(boolean p_setBordered_1_) { + this.bordered = p_setBordered_1_; + } + + public int getTextColor() { + return this.textColor; + } + + public void setTextColor(int p_setTextColor_1_) { + this.textColor = p_setTextColor_1_; + } + + public int getTextColorUneditable() { + return this.textColorUneditable; + } + + public void setTextColorUneditable(int p_setTextColorUneditable_1_) { + this.textColorUneditable = p_setTextColorUneditable_1_; + } + + public void setFocus(boolean p_setFocus_1_) { + if (p_setFocus_1_ && !this.inFocus) { + this.frame = 0; + } + + this.inFocus = p_setFocus_1_; + } + + public boolean isFocused() { + return this.inFocus; + } + + public boolean isIsEditable() { + return this.isEditable; + } + + public void setIsEditable(boolean p_setIsEditable_1_) { + this.isEditable = p_setIsEditable_1_; + } + + public int getHighlightPos() { + return this.highlightPos; + } + + public int getInnerWidth() { + return this.isBordered() ? this.width - 8 : this.width; + } + + public void setHighlightPos(int p_setHighlightPos_1_) { + int var2 = this.value.length(); + + if (p_setHighlightPos_1_ > var2) { + p_setHighlightPos_1_ = var2; + } + + if (p_setHighlightPos_1_ < 0) { + p_setHighlightPos_1_ = 0; + } + + this.highlightPos = p_setHighlightPos_1_; + + if (this.font != null) { + if (this.displayPos > var2) { + this.displayPos = var2; + } + + int var3 = this.getInnerWidth(); + String var4 = this.font.trimStringToWidth(this.value.substring(this.displayPos), var3); + int var5 = var4.length() + this.displayPos; + + if (p_setHighlightPos_1_ == this.displayPos) { + this.displayPos -= this.font.trimStringToWidth(this.value, var3, true).length(); + } + + if (p_setHighlightPos_1_ > var5) { + this.displayPos += p_setHighlightPos_1_ - var5; + } else if (p_setHighlightPos_1_ <= this.displayPos) { + this.displayPos -= this.displayPos - p_setHighlightPos_1_; + } + + if (this.displayPos < 0) { + this.displayPos = 0; + } + + if (this.displayPos > var2) { + this.displayPos = var2; + } + } + } + + public boolean isCanLoseFocus() { + return this.canLoseFocus; + } + + public void setCanLoseFocus(boolean p_setCanLoseFocus_1_) { + this.canLoseFocus = p_setCanLoseFocus_1_; + } + + public boolean isVisible() { + return this.visible; + } + + public void setVisible(boolean p_setVisible_1_) { + this.visible = p_setVisible_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsLevelSummary.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsLevelSummary.java new file mode 100644 index 0000000..0322ca9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsLevelSummary.java @@ -0,0 +1,56 @@ +package net.minecraft.realms; + +import net.minecraft.world.storage.SaveFormatComparator; + +public class RealmsLevelSummary implements Comparable { + private final SaveFormatComparator levelSummary; + + + public RealmsLevelSummary(SaveFormatComparator p_i1109_1_) { + this.levelSummary = p_i1109_1_; + } + + public int getGameMode() { + return this.levelSummary.getEnumGameType().getID(); + } + + public String getLevelId() { + return this.levelSummary.getFileName(); + } + + public boolean hasCheats() { + return this.levelSummary.getCheatsEnabled(); + } + + public boolean isHardcore() { + return this.levelSummary.isHardcoreModeEnabled(); + } + + public boolean isRequiresConversion() { + return this.levelSummary.requiresConversion(); + } + + public String getLevelName() { + return this.levelSummary.getDisplayName(); + } + + public long getLastPlayed() { + return this.levelSummary.getLastTimePlayed(); + } + + public int compareTo(SaveFormatComparator p_compareTo_1_) { + return this.levelSummary.compareTo(p_compareTo_1_); + } + + public long getSizeOnDisk() { + return this.levelSummary.func_154336_c(); + } + + public int compareTo(RealmsLevelSummary p_compareTo_1_) { + return this.levelSummary.getLastTimePlayed() < p_compareTo_1_.getLastPlayed() ? 1 : (this.levelSummary.getLastTimePlayed() > p_compareTo_1_.getLastPlayed() ? -1 : this.levelSummary.getFileName().compareTo(p_compareTo_1_.getLevelId())); + } + + public int compareTo(Object p_compareTo_1_) { + return this.compareTo((RealmsLevelSummary)p_compareTo_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsMth.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsMth.java new file mode 100644 index 0000000..b52ebed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsMth.java @@ -0,0 +1,140 @@ +package net.minecraft.realms; + +import java.util.Random; +import net.minecraft.util.MathHelper; + +public class RealmsMth { + + + public static float sin(float p_sin_0_) { + return MathHelper.sin(p_sin_0_); + } + + public static double nextDouble(Random p_nextDouble_0_, double p_nextDouble_1_, double p_nextDouble_3_) { + return MathHelper.getRandomDoubleInRange(p_nextDouble_0_, p_nextDouble_1_, p_nextDouble_3_); + } + + public static int ceil(float p_ceil_0_) { + return MathHelper.ceiling_float_int(p_ceil_0_); + } + + public static int floor(double p_floor_0_) { + return MathHelper.floor_double(p_floor_0_); + } + + public static int intFloorDiv(int p_intFloorDiv_0_, int p_intFloorDiv_1_) { + return MathHelper.bucketInt(p_intFloorDiv_0_, p_intFloorDiv_1_); + } + + public static float abs(float p_abs_0_) { + return MathHelper.abs(p_abs_0_); + } + + public static int clamp(int p_clamp_0_, int p_clamp_1_, int p_clamp_2_) { + return MathHelper.clamp_int(p_clamp_0_, p_clamp_1_, p_clamp_2_); + } + + public static double clampedLerp(double p_clampedLerp_0_, double p_clampedLerp_2_, double p_clampedLerp_4_) { + return MathHelper.denormalizeClamp(p_clampedLerp_0_, p_clampedLerp_2_, p_clampedLerp_4_); + } + + public static int ceil(double p_ceil_0_) { + return MathHelper.ceiling_double_int(p_ceil_0_); + } + + public static boolean isEmpty(String p_isEmpty_0_) { + return MathHelper.stringNullOrLengthZero(p_isEmpty_0_); + } + + public static long lfloor(double p_lfloor_0_) { + return MathHelper.floor_double_long(p_lfloor_0_); + } + + public static float sqrt(double p_sqrt_0_) { + return MathHelper.sqrt_double(p_sqrt_0_); + } + + public static double clamp(double p_clamp_0_, double p_clamp_2_, double p_clamp_4_) { + return MathHelper.clamp_double(p_clamp_0_, p_clamp_2_, p_clamp_4_); + } + + public static int getInt(String p_getInt_0_, int p_getInt_1_) { + return MathHelper.parseIntWithDefault(p_getInt_0_, p_getInt_1_); + } + + public static double getDouble(String p_getDouble_0_, double p_getDouble_1_) { + return MathHelper.parseDoubleWithDefault(p_getDouble_0_, p_getDouble_1_); + } + + public static int log2(int p_log2_0_) { + return MathHelper.calculateLogBaseTwo(p_log2_0_); + } + + public static int absFloor(double p_absFloor_0_) { + return MathHelper.func_154353_e(p_absFloor_0_); + } + + public static int smallestEncompassingPowerOfTwo(int p_smallestEncompassingPowerOfTwo_0_) { + return MathHelper.roundUpToPowerOfTwo(p_smallestEncompassingPowerOfTwo_0_); + } + + public static float sqrt(float p_sqrt_0_) { + return MathHelper.sqrt_float(p_sqrt_0_); + } + + public static float cos(float p_cos_0_) { + return MathHelper.cos(p_cos_0_); + } + + public static int getInt(String p_getInt_0_, int p_getInt_1_, int p_getInt_2_) { + return MathHelper.parseIntWithDefaultAndMax(p_getInt_0_, p_getInt_1_, p_getInt_2_); + } + + public static int fastFloor(double p_fastFloor_0_) { + return MathHelper.truncateDoubleToInt(p_fastFloor_0_); + } + + public static double asbMax(double p_asbMax_0_, double p_asbMax_2_) { + return MathHelper.abs_max(p_asbMax_0_, p_asbMax_2_); + } + + public static float nextFloat(Random p_nextFloat_0_, float p_nextFloat_1_, float p_nextFloat_2_) { + return MathHelper.randomFloatClamp(p_nextFloat_0_, p_nextFloat_1_, p_nextFloat_2_); + } + + public static double wrapDegrees(double p_wrapDegrees_0_) { + return MathHelper.wrapAngleTo180_double(p_wrapDegrees_0_); + } + + public static float wrapDegrees(float p_wrapDegrees_0_) { + return MathHelper.wrapAngleTo180_float(p_wrapDegrees_0_); + } + + public static float clamp(float p_clamp_0_, float p_clamp_1_, float p_clamp_2_) { + return MathHelper.clamp_float(p_clamp_0_, p_clamp_1_, p_clamp_2_); + } + + public static double getDouble(String p_getDouble_0_, double p_getDouble_1_, double p_getDouble_3_) { + return MathHelper.parseDoubleWithDefaultAndMax(p_getDouble_0_, p_getDouble_1_, p_getDouble_3_); + } + + public static int roundUp(int p_roundUp_0_, int p_roundUp_1_) { + return MathHelper.func_154354_b(p_roundUp_0_, p_roundUp_1_); + } + + public static double average(long[] p_average_0_) { + return MathHelper.average(p_average_0_); + } + + public static int floor(float p_floor_0_) { + return MathHelper.floor_float(p_floor_0_); + } + + public static int abs(int p_abs_0_) { + return MathHelper.abs_int(p_abs_0_); + } + + public static int nextInt(Random p_nextInt_0_, int p_nextInt_1_, int p_nextInt_2_) { + return MathHelper.getRandomIntegerInRange(p_nextInt_0_, p_nextInt_1_, p_nextInt_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsScreen.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsScreen.java new file mode 100644 index 0000000..fbb0462 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsScreen.java @@ -0,0 +1,190 @@ +package net.minecraft.realms; + +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreenRealmsProxy; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class RealmsScreen { + public static final int SKIN_HEAD_U = 8; + public static final int SKIN_HEAD_V = 8; + public static final int SKIN_HEAD_WIDTH = 8; + public static final int SKIN_HEAD_HEIGHT = 8; + public static final int SKIN_TEX_WIDTH = 64; + public static final int SKIN_TEX_HEIGHT = 32; + public static final int SKIN_HAT_U = 40; + public static final int SKIN_HAT_V = 8; + public static final int SKIN_HAT_WIDTH = 8; + public static final int SKIN_HAT_HEIGHT = 8; + protected Minecraft minecraft; + public int width; + public int height; + private final GuiScreenRealmsProxy proxy = new GuiScreenRealmsProxy(this); + + + public GuiScreenRealmsProxy getProxy() { + return this.proxy; + } + + public void init() {} + + public void init(Minecraft p_init_1_, int p_init_2_, int p_init_3_) {} + + public void drawCenteredString(String p_drawCenteredString_1_, int p_drawCenteredString_2_, int p_drawCenteredString_3_, int p_drawCenteredString_4_) { + this.proxy.func_154325_a(p_drawCenteredString_1_, p_drawCenteredString_2_, p_drawCenteredString_3_, p_drawCenteredString_4_); + } + + public void drawString(String p_drawString_1_, int p_drawString_2_, int p_drawString_3_, int p_drawString_4_) { + this.proxy.func_154322_b(p_drawString_1_, p_drawString_2_, p_drawString_3_, p_drawString_4_); + } + + public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_) { + this.proxy.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_); + } + + public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_, int p_blit_7_, float p_blit_8_, float p_blit_9_) { + Gui.drawScaledCustomSizeModalRect(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_, p_blit_8_, p_blit_9_); + } + + public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, float p_blit_6_, float p_blit_7_) { + Gui.drawModalRectWithCustomSizedTexture(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_); + } + + public void fillGradient(int p_fillGradient_1_, int p_fillGradient_2_, int p_fillGradient_3_, int p_fillGradient_4_, int p_fillGradient_5_, int p_fillGradient_6_) { + this.proxy.drawGradientRect(p_fillGradient_1_, p_fillGradient_2_, p_fillGradient_3_, p_fillGradient_4_, p_fillGradient_5_, p_fillGradient_6_); + } + + public void renderBackground() { + this.proxy.drawDefaultBackground(); + } + + public boolean isPauseScreen() { + return this.proxy.doesGuiPauseGame(); + } + + public void renderBackground(int p_renderBackground_1_) { + this.proxy.func_146270_b(p_renderBackground_1_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) { + for (int var4 = 0; var4 < this.proxy.func_154320_j().size(); ++var4) { + ((RealmsButton)this.proxy.func_154320_j().get(var4)).render(p_render_1_, p_render_2_); + } + } + + public void renderTooltip(ItemStack p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) { + this.proxy.func_146285_a(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public void renderTooltip(String p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) { + this.proxy.func_146279_a(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public void renderTooltip(List p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) { + this.proxy.func_146283_a(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public static void bindFace(String p_bindFace_0_) { + ResourceLocation var1 = AbstractClientPlayer.getLocationSkin(p_bindFace_0_); + + if (var1 == null) { + var1 = AbstractClientPlayer.getLocationSkin("default"); + } + + AbstractClientPlayer.getDownloadImageSkin(var1, p_bindFace_0_); + Minecraft.getMinecraft().getTextureManager().bindTexture(var1); + } + + public static void bind(String p_bind_0_) { + ResourceLocation var1 = new ResourceLocation(p_bind_0_); + Minecraft.getMinecraft().getTextureManager().bindTexture(var1); + } + + public void tick() {} + + public int width() { + return this.proxy.width; + } + + public int height() { + return this.proxy.height; + } + + public int fontLineHeight() { + return this.proxy.func_154329_h(); + } + + public int fontWidth(String p_fontWidth_1_) { + return this.proxy.func_154326_c(p_fontWidth_1_); + } + + public void fontDrawShadow(String p_fontDrawShadow_1_, int p_fontDrawShadow_2_, int p_fontDrawShadow_3_, int p_fontDrawShadow_4_) { + this.proxy.func_154319_c(p_fontDrawShadow_1_, p_fontDrawShadow_2_, p_fontDrawShadow_3_, p_fontDrawShadow_4_); + } + + public List fontSplit(String p_fontSplit_1_, int p_fontSplit_2_) { + return this.proxy.func_154323_a(p_fontSplit_1_, p_fontSplit_2_); + } + + public void buttonClicked(RealmsButton p_buttonClicked_1_) {} + + public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, String p_newButton_3_) { + return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_); + } + + public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, int p_newButton_3_, int p_newButton_4_, String p_newButton_5_) { + return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_, p_newButton_4_, p_newButton_5_); + } + + public void buttonsClear() { + this.proxy.func_154324_i(); + } + + public void buttonsAdd(RealmsButton p_buttonsAdd_1_) { + this.proxy.func_154327_a(p_buttonsAdd_1_); + } + + public List buttons() { + return this.proxy.func_154320_j(); + } + + public void buttonsRemove(RealmsButton p_buttonsRemove_1_) { + this.proxy.func_154328_b(p_buttonsRemove_1_); + } + + public RealmsEditBox newEditBox(int p_newEditBox_1_, int p_newEditBox_2_, int p_newEditBox_3_, int p_newEditBox_4_) { + return new RealmsEditBox(p_newEditBox_1_, p_newEditBox_2_, p_newEditBox_3_, p_newEditBox_4_); + } + + public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_) {} + + public void mouseEvent() {} + + public void keyboardEvent() {} + + public void mouseReleased(int p_mouseReleased_1_, int p_mouseReleased_2_, int p_mouseReleased_3_) {} + + public void mouseDragged(int p_mouseDragged_1_, int p_mouseDragged_2_, int p_mouseDragged_3_, long p_mouseDragged_4_) {} + + public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) {} + + public void confirmResult(boolean p_confirmResult_1_, int p_confirmResult_2_) {} + + public static String getLocalizedString(String p_getLocalizedString_0_) { + return I18n.format(p_getLocalizedString_0_); + } + + public static String getLocalizedString(String p_getLocalizedString_0_, Object ... p_getLocalizedString_1_) { + return I18n.format(p_getLocalizedString_0_, p_getLocalizedString_1_); + } + + public RealmsAnvilLevelStorageSource getLevelStorageSource() { + return new RealmsAnvilLevelStorageSource(Minecraft.getMinecraft().getSaveLoader()); + } + + public void removed() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsScrolledSelectionList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsScrolledSelectionList.java new file mode 100644 index 0000000..92fbec4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsScrolledSelectionList.java @@ -0,0 +1,54 @@ +package net.minecraft.realms; + +import net.minecraft.client.gui.GuiSlotRealmsProxy; + +public class RealmsScrolledSelectionList { + private final GuiSlotRealmsProxy proxy; + + + public RealmsScrolledSelectionList(int p_i1119_1_, int p_i1119_2_, int p_i1119_3_, int p_i1119_4_, int p_i1119_5_) { + this.proxy = new GuiSlotRealmsProxy(this, p_i1119_1_, p_i1119_2_, p_i1119_3_, p_i1119_4_, p_i1119_5_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) { + this.proxy.func_148128_a(p_render_1_, p_render_2_, p_render_3_); + } + + public int width() { + return this.proxy.func_154338_k(); + } + + public int ym() { + return this.proxy.func_154339_l(); + } + + public int xm() { + return this.proxy.func_154337_m(); + } + + protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_) {} + + public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_) { + this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_); + } + + public int getItemCount() { + return 0; + } + + public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_) {} + + public boolean isSelectedItem(int p_isSelectedItem_1_) { + return false; + } + + public void renderBackground() {} + + public int getMaxPosition() { + return 0; + } + + public int getScrollbarPosition() { + return this.proxy.func_154338_k() / 2 + 124; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsServerAddress.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsServerAddress.java new file mode 100644 index 0000000..ebdeb88 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsServerAddress.java @@ -0,0 +1,88 @@ +package net.minecraft.realms; + +import java.util.Hashtable; +import javax.naming.directory.Attributes; +import javax.naming.directory.InitialDirContext; + +public class RealmsServerAddress { + private final String host; + private final int port; + + + protected RealmsServerAddress(String p_i1121_1_, int p_i1121_2_) { + this.host = p_i1121_1_; + this.port = p_i1121_2_; + } + + public String getHost() { + return this.host; + } + + public int getPort() { + return this.port; + } + + public static RealmsServerAddress parseString(String p_parseString_0_) { + if (p_parseString_0_ == null) { + return null; + } else { + String[] var1 = p_parseString_0_.split(":"); + + if (p_parseString_0_.startsWith("[")) { + int var2 = p_parseString_0_.indexOf("]"); + + if (var2 > 0) { + String var3 = p_parseString_0_.substring(1, var2); + String var4 = p_parseString_0_.substring(var2 + 1).trim(); + + if (var4.startsWith(":") && var4.length() > 0) { + var4 = var4.substring(1); + var1 = new String[] {var3, var4}; + } else { + var1 = new String[] {var3}; + } + } + } + + if (var1.length > 2) { + var1 = new String[] {p_parseString_0_}; + } + + String var5 = var1[0]; + int var6 = var1.length > 1 ? parseInt(var1[1], 25565) : 25565; + + if (var6 == 25565) { + String[] var7 = lookupSrv(var5); + var5 = var7[0]; + var6 = parseInt(var7[1], 25565); + } + + return new RealmsServerAddress(var5, var6); + } + } + + private static String[] lookupSrv(String p_lookupSrv_0_) { + try { + String var1 = "com.sun.jndi.dns.DnsContextFactory"; + Class.forName("com.sun.jndi.dns.DnsContextFactory"); + Hashtable var2 = new Hashtable(); + var2.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory"); + var2.put("java.naming.provider.url", "dns:"); + var2.put("com.sun.jndi.dns.timeout.retries", "1"); + InitialDirContext var3 = new InitialDirContext(var2); + Attributes var4 = var3.getAttributes("_minecraft._tcp." + p_lookupSrv_0_, new String[] {"SRV"}); + String[] var5 = var4.get("srv").get().toString().split(" ", 4); + return new String[] {var5[3], var5[2]}; + } catch (Throwable var6) { + return new String[] {p_lookupSrv_0_, Integer.toString(25565)}; + } + } + + private static int parseInt(String p_parseInt_0_, int p_parseInt_1_) { + try { + return Integer.parseInt(p_parseInt_0_.trim()); + } catch (Exception var3) { + return p_parseInt_1_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsServerStatusPinger.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsServerStatusPinger.java new file mode 100644 index 0000000..a376663 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsServerStatusPinger.java @@ -0,0 +1,110 @@ +package net.minecraft.realms; + +import io.netty.util.concurrent.GenericFutureListener; +import java.io.IOException; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RealmsServerStatusPinger { + private static final Logger LOGGER = LogManager.getLogger(); + private final List connections = Collections.synchronizedList(new ArrayList()); + + + public void pingServer(final String p_pingServer_1_, final ServerPing p_pingServer_2_) throws IOException { + if (p_pingServer_1_ != null && !p_pingServer_1_.startsWith("0.0.0.0") && !p_pingServer_1_.isEmpty()) { + RealmsServerAddress var3 = RealmsServerAddress.parseString(p_pingServer_1_); + final NetworkManager var4 = NetworkManager.provideLanClient(InetAddress.getByName(var3.getHost()), var3.getPort()); + this.connections.add(var4); + var4.setNetHandler(new INetHandlerStatusClient() { + private boolean field_154345_e = false; + + public void handleServerInfo(S00PacketServerInfo p_147397_1_) { + ServerStatusResponse var2 = p_147397_1_.func_149294_c(); + + if (var2.func_151318_b() != null) { + p_pingServer_2_.nrOfPlayers = String.valueOf(var2.func_151318_b().func_151333_b()); + } + + var4.scheduleOutboundPacket(new C01PacketPing(Realms.currentTimeMillis())); + this.field_154345_e = true; + } + public void handlePong(S01PacketPong p_147398_1_) { + var4.closeChannel(new ChatComponentText("Finished")); + } + public void onDisconnect(IChatComponent p_147231_1_) { + if (!this.field_154345_e) { + RealmsServerStatusPinger.LOGGER.error("Can't ping " + p_pingServer_1_ + ": " + p_147231_1_.getUnformattedText()); + } + } + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + if (p_147232_2_ != EnumConnectionState.STATUS) { + throw new UnsupportedOperationException("Unexpected change in protocol to " + p_147232_2_); + } + } + public void onNetworkTick() {} + }); + + try { + var4.scheduleOutboundPacket(new C00Handshake(RealmsSharedConstants.NETWORK_PROTOCOL_VERSION, var3.getHost(), var3.getPort(), EnumConnectionState.STATUS)); + var4.scheduleOutboundPacket(new C00PacketServerQuery()); + } catch (Throwable var6) { + LOGGER.error(var6); + } + } + } + + public void tick() { + List var1 = this.connections; + + synchronized (this.connections) { + Iterator var2 = this.connections.iterator(); + + while (var2.hasNext()) { + NetworkManager var3 = (NetworkManager)var2.next(); + + if (var3.isChannelOpen()) { + var3.processReceivedPackets(); + } else { + var2.remove(); + + if (var3.getExitMessage() != null) { + var3.getNetHandler().onDisconnect(var3.getExitMessage()); + } + } + } + } + } + + public void removeAll() { + List var1 = this.connections; + + synchronized (this.connections) { + Iterator var2 = this.connections.iterator(); + + while (var2.hasNext()) { + NetworkManager var3 = (NetworkManager)var2.next(); + + if (var3.isChannelOpen()) { + var2.remove(); + var3.closeChannel(new ChatComponentText("Cancelled")); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsSharedConstants.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsSharedConstants.java new file mode 100644 index 0000000..aefe5b1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsSharedConstants.java @@ -0,0 +1,8 @@ +package net.minecraft.realms; + +public class RealmsSharedConstants { + public static int NETWORK_PROTOCOL_VERSION = 5; + public static int TICKS_PER_SECOND = 20; + public static String VERSION_STRING = "1.7.10"; + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsSliderButton.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsSliderButton.java new file mode 100644 index 0000000..fbd8a4c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RealmsSliderButton.java @@ -0,0 +1,102 @@ +package net.minecraft.realms; + +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class RealmsSliderButton extends RealmsButton { + public float value; + public boolean sliding; + private final float minValue; + private final float maxValue; + private int steps; + + + public RealmsSliderButton(int p_i1056_1_, int p_i1056_2_, int p_i1056_3_, int p_i1056_4_, int p_i1056_5_, int p_i1056_6_) { + this(p_i1056_1_, p_i1056_2_, p_i1056_3_, p_i1056_4_, p_i1056_6_, 0, 1.0F, (float)p_i1056_5_); + } + + public RealmsSliderButton(int p_i1057_1_, int p_i1057_2_, int p_i1057_3_, int p_i1057_4_, int p_i1057_5_, int p_i1057_6_, float p_i1057_7_, float p_i1057_8_) { + super(p_i1057_1_, p_i1057_2_, p_i1057_3_, p_i1057_4_, 20, ""); + this.value = 1.0F; + this.minValue = p_i1057_7_; + this.maxValue = p_i1057_8_; + this.value = this.toPct((float)p_i1057_6_); + this.getProxy().displayString = this.getMessage(); + } + + public String getMessage() { + return ""; + } + + public float toPct(float p_toPct_1_) { + return MathHelper.clamp_float((this.clamp(p_toPct_1_) - this.minValue) / (this.maxValue - this.minValue), 0.0F, 1.0F); + } + + public float toValue(float p_toValue_1_) { + return this.clamp(this.minValue + (this.maxValue - this.minValue) * MathHelper.clamp_float(p_toValue_1_, 0.0F, 1.0F)); + } + + public float clamp(float p_clamp_1_) { + p_clamp_1_ = this.clampSteps(p_clamp_1_); + return MathHelper.clamp_float(p_clamp_1_, this.minValue, this.maxValue); + } + + protected float clampSteps(float p_clampSteps_1_) { + if (this.steps > 0) { + p_clampSteps_1_ = (float)(this.steps * Math.round(p_clampSteps_1_ / (float)this.steps)); + } + + return p_clampSteps_1_; + } + + public int getYImage(boolean p_getYImage_1_) { + return 0; + } + + public void renderBg(int p_renderBg_1_, int p_renderBg_2_) { + if (this.getProxy().field_146125_m) { + if (this.sliding) { + this.value = (float)(p_renderBg_1_ - (this.getProxy().field_146128_h + 4)) / (float)(this.getProxy().func_146117_b() - 8); + + if (this.value < 0.0F) { + this.value = 0.0F; + } + + if (this.value > 1.0F) { + this.value = 1.0F; + } + + float var3 = this.toValue(this.value); + this.clicked(var3); + this.value = this.toPct(var3); + this.getProxy().displayString = this.getMessage(); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.blit(this.getProxy().field_146128_h + (int)(this.value * (float)(this.getProxy().func_146117_b() - 8)), this.getProxy().field_146129_i, 0, 66, 4, 20); + this.blit(this.getProxy().field_146128_h + (int)(this.value * (float)(this.getProxy().func_146117_b() - 8)) + 4, this.getProxy().field_146129_i, 196, 66, 4, 20); + } + } + + public void clicked(int p_clicked_1_, int p_clicked_2_) { + this.value = (float)(p_clicked_1_ - (this.getProxy().field_146128_h + 4)) / (float)(this.getProxy().func_146117_b() - 8); + + if (this.value < 0.0F) { + this.value = 0.0F; + } + + if (this.value > 1.0F) { + this.value = 1.0F; + } + + this.clicked(this.toValue(this.value)); + this.getProxy().displayString = this.getMessage(); + this.sliding = true; + } + + public void clicked(float p_clicked_1_) {} + + public void released(int p_released_1_, int p_released_2_) { + this.sliding = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RendererUtility.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RendererUtility.java new file mode 100644 index 0000000..e641f3c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/RendererUtility.java @@ -0,0 +1,9 @@ +package net.minecraft.realms; + +public class RendererUtility { + + + public static void render(RealmsButton p_render_0_, int p_render_1_, int p_render_2_) { + p_render_0_.render(p_render_1_, p_render_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/ServerPing.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/ServerPing.java new file mode 100644 index 0000000..c6e6652 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/ServerPing.java @@ -0,0 +1,7 @@ +package net.minecraft.realms; + +public class ServerPing { + public volatile String nrOfPlayers = "0"; + public volatile long lastPingSnapshot = 0L; + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/Tezzelator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/Tezzelator.java new file mode 100644 index 0000000..53c647c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/realms/Tezzelator.java @@ -0,0 +1,90 @@ +package net.minecraft.realms; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.shader.TesselatorVertexState; + +public class Tezzelator { + public static Tessellator t = Tessellator.instance; + public static final Tezzelator instance = new Tezzelator(); + + + public int end() { + return t.draw(); + } + + public void vertex(double p_vertex_1_, double p_vertex_3_, double p_vertex_5_) { + t.addVertex(p_vertex_1_, p_vertex_3_, p_vertex_5_); + } + + public void color(float p_color_1_, float p_color_2_, float p_color_3_, float p_color_4_) { + t.setColorRGBA_F(p_color_1_, p_color_2_, p_color_3_, p_color_4_); + } + + public void color(int p_color_1_, int p_color_2_, int p_color_3_) { + t.setColorOpaque(p_color_1_, p_color_2_, p_color_3_); + } + + public void tex2(int p_tex2_1_) { + t.setBrightness(p_tex2_1_); + } + + public void normal(float p_normal_1_, float p_normal_2_, float p_normal_3_) { + t.setNormal(p_normal_1_, p_normal_2_, p_normal_3_); + } + + public void noColor() { + t.disableColor(); + } + + public void color(int p_color_1_) { + t.setColorOpaque_I(p_color_1_); + } + + public void color(float p_color_1_, float p_color_2_, float p_color_3_) { + t.setColorOpaque_F(p_color_1_, p_color_2_, p_color_3_); + } + + public TesselatorVertexState sortQuads(float p_sortQuads_1_, float p_sortQuads_2_, float p_sortQuads_3_) { + return t.getVertexState(p_sortQuads_1_, p_sortQuads_2_, p_sortQuads_3_); + } + + public void restoreState(TesselatorVertexState p_restoreState_1_) { + t.setVertexState(p_restoreState_1_); + } + + public void begin(int p_begin_1_) { + t.startDrawing(p_begin_1_); + } + + public void begin() { + t.startDrawingQuads(); + } + + public void vertexUV(double p_vertexUV_1_, double p_vertexUV_3_, double p_vertexUV_5_, double p_vertexUV_7_, double p_vertexUV_9_) { + t.addVertexWithUV(p_vertexUV_1_, p_vertexUV_3_, p_vertexUV_5_, p_vertexUV_7_, p_vertexUV_9_); + } + + public void color(int p_color_1_, int p_color_2_) { + t.setColorRGBA_I(p_color_1_, p_color_2_); + } + + public void offset(double p_offset_1_, double p_offset_3_, double p_offset_5_) { + t.setTranslation(p_offset_1_, p_offset_3_, p_offset_5_); + } + + public void color(int p_color_1_, int p_color_2_, int p_color_3_, int p_color_4_) { + t.setColorRGBA(p_color_1_, p_color_2_, p_color_3_, p_color_4_); + } + + public void addOffset(float p_addOffset_1_, float p_addOffset_2_, float p_addOffset_3_) { + t.addTranslation(p_addOffset_1_, p_addOffset_2_, p_addOffset_3_); + } + + public void tex(double p_tex_1_, double p_tex_3_) { + t.setTextureUV(p_tex_1_, p_tex_3_); + } + + public void color(byte p_color_1_, byte p_color_2_, byte p_color_3_) { + t.func_154352_a(p_color_1_, p_color_2_, p_color_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java new file mode 100644 index 0000000..697d01a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java @@ -0,0 +1,20 @@ +package net.minecraft.scoreboard; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface IScoreObjectiveCriteria { + Map field_96643_a = new HashMap(); + IScoreObjectiveCriteria field_96641_b = new ScoreDummyCriteria("dummy"); + IScoreObjectiveCriteria deathCount = new ScoreDummyCriteria("deathCount"); + IScoreObjectiveCriteria playerKillCount = new ScoreDummyCriteria("playerKillCount"); + IScoreObjectiveCriteria totalKillCount = new ScoreDummyCriteria("totalKillCount"); + IScoreObjectiveCriteria health = new ScoreHealthCriteria("health"); + + String func_96636_a(); + + int func_96635_a(List p_96635_1_); + + boolean isReadOnly(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Score.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Score.java new file mode 100644 index 0000000..079cba8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Score.java @@ -0,0 +1,80 @@ +package net.minecraft.scoreboard; + +import java.util.Comparator; +import java.util.List; + +public class Score { + public static final Comparator field_96658_a = new Comparator() { + + public int compare(Score p_compare_1_, Score p_compare_2_) { + return p_compare_1_.getScorePoints() > p_compare_2_.getScorePoints() ? 1 : (p_compare_1_.getScorePoints() < p_compare_2_.getScorePoints() ? -1 : 0); + } + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((Score)p_compare_1_, (Score)p_compare_2_); + } + }; + private final Scoreboard theScoreboard; + private final ScoreObjective theScoreObjective; + private final String field_96654_d; + private int field_96655_e; + + + public Score(Scoreboard p_i2309_1_, ScoreObjective p_i2309_2_, String p_i2309_3_) { + this.theScoreboard = p_i2309_1_; + this.theScoreObjective = p_i2309_2_; + this.field_96654_d = p_i2309_3_; + } + + public void func_96649_a(int p_96649_1_) { + if (this.theScoreObjective.getCriteria().isReadOnly()) { + throw new IllegalStateException("Cannot modify read-only score"); + } else { + this.func_96647_c(this.getScorePoints() + p_96649_1_); + } + } + + public void func_96646_b(int p_96646_1_) { + if (this.theScoreObjective.getCriteria().isReadOnly()) { + throw new IllegalStateException("Cannot modify read-only score"); + } else { + this.func_96647_c(this.getScorePoints() - p_96646_1_); + } + } + + public void func_96648_a() { + if (this.theScoreObjective.getCriteria().isReadOnly()) { + throw new IllegalStateException("Cannot modify read-only score"); + } else { + this.func_96649_a(1); + } + } + + public int getScorePoints() { + return this.field_96655_e; + } + + public void func_96647_c(int p_96647_1_) { + int var2 = this.field_96655_e; + this.field_96655_e = p_96647_1_; + + if (var2 != p_96647_1_) { + this.func_96650_f().func_96536_a(this); + } + } + + public ScoreObjective func_96645_d() { + return this.theScoreObjective; + } + + public String getPlayerName() { + return this.field_96654_d; + } + + public Scoreboard func_96650_f() { + return this.theScoreboard; + } + + public void func_96651_a(List p_96651_1_) { + this.func_96647_c(this.theScoreObjective.getCriteria().func_96635_a(p_96651_1_)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java new file mode 100644 index 0000000..2145e7c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreDummyCriteria.java @@ -0,0 +1,25 @@ +package net.minecraft.scoreboard; + +import java.util.List; + +public class ScoreDummyCriteria implements IScoreObjectiveCriteria { + private final String field_96644_g; + + + public ScoreDummyCriteria(String p_i2311_1_) { + this.field_96644_g = p_i2311_1_; + IScoreObjectiveCriteria.field_96643_a.put(p_i2311_1_, this); + } + + public String func_96636_a() { + return this.field_96644_g; + } + + public int func_96635_a(List p_96635_1_) { + return 0; + } + + public boolean isReadOnly() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java new file mode 100644 index 0000000..fc635de --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreHealthCriteria.java @@ -0,0 +1,33 @@ +package net.minecraft.scoreboard; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; + +public class ScoreHealthCriteria extends ScoreDummyCriteria { + + + public ScoreHealthCriteria(String p_i2312_1_) { + super(p_i2312_1_); + } + + public int func_96635_a(List p_96635_1_) { + float var2 = 0.0F; + EntityPlayer var4; + + for (Iterator var3 = p_96635_1_.iterator(); var3.hasNext(); var2 += var4.getHealth() + var4.getAbsorptionAmount()) { + var4 = (EntityPlayer)var3.next(); + } + + if (p_96635_1_.size() > 0) { + var2 /= (float)p_96635_1_.size(); + } + + return MathHelper.ceiling_float_int(var2); + } + + public boolean isReadOnly() { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreObjective.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreObjective.java new file mode 100644 index 0000000..5d60afd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreObjective.java @@ -0,0 +1,39 @@ +package net.minecraft.scoreboard; + +public class ScoreObjective { + private final Scoreboard theScoreboard; + private final String name; + + /** The ScoreObjectiveCriteria for this objetive */ + private final IScoreObjectiveCriteria objectiveCriteria; + private String displayName; + + + public ScoreObjective(Scoreboard p_i2307_1_, String p_i2307_2_, IScoreObjectiveCriteria p_i2307_3_) { + this.theScoreboard = p_i2307_1_; + this.name = p_i2307_2_; + this.objectiveCriteria = p_i2307_3_; + this.displayName = p_i2307_2_; + } + + public Scoreboard getScoreboard() { + return this.theScoreboard; + } + + public String getName() { + return this.name; + } + + public IScoreObjectiveCriteria getCriteria() { + return this.objectiveCriteria; + } + + public String getDisplayName() { + return this.displayName; + } + + public void setDisplayName(String p_96681_1_) { + this.displayName = p_96681_1_; + this.theScoreboard.func_96532_b(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java new file mode 100644 index 0000000..4d96f04 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScorePlayerTeam.java @@ -0,0 +1,129 @@ +package net.minecraft.scoreboard; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +public class ScorePlayerTeam extends Team { + private final Scoreboard theScoreboard; + private final String field_96675_b; + + /** A set of all team member usernames. */ + private final Set membershipSet = new HashSet(); + private String teamNameSPT; + private String namePrefixSPT = ""; + private String colorSuffix = ""; + private boolean allowFriendlyFire = true; + private boolean canSeeFriendlyInvisibles = true; + + + public ScorePlayerTeam(Scoreboard p_i2308_1_, String p_i2308_2_) { + this.theScoreboard = p_i2308_1_; + this.field_96675_b = p_i2308_2_; + this.teamNameSPT = p_i2308_2_; + } + + /** + * Retrieve the name by which this team is registered in the scoreboard + */ + public String getRegisteredName() { + return this.field_96675_b; + } + + public String func_96669_c() { + return this.teamNameSPT; + } + + public void setTeamName(String p_96664_1_) { + if (p_96664_1_ == null) { + throw new IllegalArgumentException("Name cannot be null"); + } else { + this.teamNameSPT = p_96664_1_; + this.theScoreboard.func_96538_b(this); + } + } + + public Collection getMembershipCollection() { + return this.membershipSet; + } + + /** + * Returns the color prefix for the player's team name + */ + public String getColorPrefix() { + return this.namePrefixSPT; + } + + public void setNamePrefix(String p_96666_1_) { + if (p_96666_1_ == null) { + throw new IllegalArgumentException("Prefix cannot be null"); + } else { + this.namePrefixSPT = p_96666_1_; + this.theScoreboard.func_96538_b(this); + } + } + + /** + * Returns the color suffix for the player's team name + */ + public String getColorSuffix() { + return this.colorSuffix; + } + + public void setNameSuffix(String p_96662_1_) { + if (p_96662_1_ == null) { + throw new IllegalArgumentException("Suffix cannot be null"); + } else { + this.colorSuffix = p_96662_1_; + this.theScoreboard.func_96538_b(this); + } + } + + public String func_142053_d(String p_142053_1_) { + return this.getColorPrefix() + p_142053_1_ + this.getColorSuffix(); + } + + /** + * Returns the player name including the color prefixes and suffixes + */ + public static String formatPlayerName(Team p_96667_0_, String p_96667_1_) { + return p_96667_0_ == null ? p_96667_1_ : p_96667_0_.func_142053_d(p_96667_1_); + } + + public boolean getAllowFriendlyFire() { + return this.allowFriendlyFire; + } + + public void setAllowFriendlyFire(boolean p_96660_1_) { + this.allowFriendlyFire = p_96660_1_; + this.theScoreboard.func_96538_b(this); + } + + public boolean func_98297_h() { + return this.canSeeFriendlyInvisibles; + } + + public void setSeeFriendlyInvisiblesEnabled(boolean p_98300_1_) { + this.canSeeFriendlyInvisibles = p_98300_1_; + this.theScoreboard.func_96538_b(this); + } + + public int func_98299_i() { + int var1 = 0; + + if (this.getAllowFriendlyFire()) { + var1 |= 1; + } + + if (this.func_98297_h()) { + var1 |= 2; + } + + return var1; + } + + public void func_98298_a(int p_98298_1_) { + this.setAllowFriendlyFire((p_98298_1_ & 1) > 0); + this.setSeeFriendlyInvisiblesEnabled((p_98298_1_ & 2) > 0); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Scoreboard.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Scoreboard.java new file mode 100644 index 0000000..7f0b719 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Scoreboard.java @@ -0,0 +1,309 @@ +package net.minecraft.scoreboard; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +public class Scoreboard { + /** Map of objective names to ScoreObjective objects. */ + private final Map scoreObjectives = new HashMap(); + private final Map scoreObjectiveCriterias = new HashMap(); + private final Map field_96544_c = new HashMap(); + private final ScoreObjective[] field_96541_d = new ScoreObjective[3]; + + /** Map of teamnames to ScorePlayerTeam instances */ + private final Map teams = new HashMap(); + + /** Map of usernames to ScorePlayerTeam objects. */ + private final Map teamMemberships = new HashMap(); + + + /** + * Returns a ScoreObjective for the objective name + */ + public ScoreObjective getObjective(String p_96518_1_) { + return (ScoreObjective)this.scoreObjectives.get(p_96518_1_); + } + + public ScoreObjective addScoreObjective(String p_96535_1_, IScoreObjectiveCriteria p_96535_2_) { + try { + ScoreObjective var3 = new ScoreObjective(this, p_96535_1_, p_96535_2_); + Object var4 = this.scoreObjectiveCriterias.get(p_96535_2_); + + if (var4 == null) { + var4 = new ArrayList(); + this.scoreObjectiveCriterias.put(p_96535_2_, var4); + } + + ((List)var4).add(var3); + this.scoreObjectives.put(p_96535_1_, var3); + this.func_96522_a(var3); + return var3; + } catch (NullPointerException e) { + e.printStackTrace(); + } + return null; + } + + public Collection func_96520_a(IScoreObjectiveCriteria p_96520_1_) { + Collection var2 = (Collection)this.scoreObjectiveCriterias.get(p_96520_1_); + return var2 == null ? new ArrayList() : new ArrayList(var2); + } + + public Score func_96529_a(String p_96529_1_, ScoreObjective p_96529_2_) { + Object var3 = this.field_96544_c.get(p_96529_1_); + + if (var3 == null) { + var3 = new HashMap(); + this.field_96544_c.put(p_96529_1_, var3); + } + + Score var4 = (Score)((Map)var3).get(p_96529_2_); + + if (var4 == null) { + var4 = new Score(this, p_96529_2_, p_96529_1_); + ((Map)var3).put(p_96529_2_, var4); + } + + return var4; + } + + public Collection func_96534_i(ScoreObjective p_96534_1_) { + ArrayList var2 = new ArrayList(); + Iterator var3 = this.field_96544_c.values().iterator(); + + while (var3.hasNext()) { + Map var4 = (Map)var3.next(); + Score var5 = (Score)var4.get(p_96534_1_); + + if (var5 != null) { + var2.add(var5); + } + } + + Collections.sort(var2, Score.field_96658_a); + return var2; + } + + public Collection getScoreObjectives() { + return this.scoreObjectives.values(); + } + + public Collection getObjectiveNames() { + return this.field_96544_c.keySet(); + } + + public void func_96515_c(String p_96515_1_) { + Map var2 = (Map)this.field_96544_c.remove(p_96515_1_); + + if (var2 != null) { + this.func_96516_a(p_96515_1_); + } + } + + public Collection func_96528_e() { + Collection var1 = this.field_96544_c.values(); + ArrayList var2 = new ArrayList(); + Iterator var3 = var1.iterator(); + + while (var3.hasNext()) { + Map var4 = (Map)var3.next(); + var2.addAll(var4.values()); + } + + return var2; + } + + public Map func_96510_d(String p_96510_1_) { + Object var2 = this.field_96544_c.get(p_96510_1_); + + if (var2 == null) { + var2 = new HashMap(); + } + + return (Map)var2; + } + + public void func_96519_k(ScoreObjective p_96519_1_) { + if (p_96519_1_ == null) return; + + if (this.scoreObjectives.containsValue(p_96519_1_.getName())) { + this.scoreObjectives.remove(p_96519_1_.getName()); + } + + for (int var2 = 0; var2 < 3; ++var2) { + if (this.func_96539_a(var2) == p_96519_1_) { + this.func_96530_a(var2, null); + } + } + + List var5 = (List)this.scoreObjectiveCriterias.get(p_96519_1_.getCriteria()); + + if (var5 != null) { + var5.remove(p_96519_1_); + } + + Iterator var3 = this.field_96544_c.values().iterator(); + + while (var3.hasNext()) { + Map var4 = (Map)var3.next(); + var4.remove(p_96519_1_); + } + + this.func_96533_c(p_96519_1_); + } + + public void func_96530_a(int p_96530_1_, ScoreObjective p_96530_2_) { + this.field_96541_d[p_96530_1_] = p_96530_2_; + } + + public ScoreObjective func_96539_a(int p_96539_1_) { + return this.field_96541_d[p_96539_1_]; + } + + /** + * Retrieve the ScorePlayerTeam instance identified by the passed team name + */ + public ScorePlayerTeam getTeam(String p_96508_1_) { + return (ScorePlayerTeam)this.teams.get(p_96508_1_); + } + + /** + * Verifies that the given name doesn't already refer to an existing team, creates it otherwise and broadcasts the + * addition to all players + */ + public ScorePlayerTeam createTeam(String p_96527_1_) { + ScorePlayerTeam var2 = this.getTeam(p_96527_1_); + + if (var2 != null) { + throw new IllegalArgumentException("A team with the name '" + p_96527_1_ + "' already exists!"); + } else { + var2 = new ScorePlayerTeam(this, p_96527_1_); + this.teams.put(p_96527_1_, var2); + this.func_96523_a(var2); + return var2; + } + } + + /** + * Removes the team from the scoreboard, updates all player memberships and broadcasts the deletion to all players + */ + public void removeTeam(ScorePlayerTeam p_96511_1_) { + this.teams.remove(p_96511_1_.getRegisteredName()); + Iterator var2 = p_96511_1_.getMembershipCollection().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + this.teamMemberships.remove(var3); + } + + this.func_96513_c(p_96511_1_); + } + + public boolean func_151392_a(String p_151392_1_, String p_151392_2_) { + if (!this.teams.containsKey(p_151392_2_)) { + return false; + } else { + ScorePlayerTeam var3 = this.getTeam(p_151392_2_); + + if (this.getPlayersTeam(p_151392_1_) != null) { + this.func_96524_g(p_151392_1_); + } + + this.teamMemberships.put(p_151392_1_, var3); + var3.getMembershipCollection().add(p_151392_1_); + return true; + } + } + + public boolean func_96524_g(String p_96524_1_) { + ScorePlayerTeam var2 = this.getPlayersTeam(p_96524_1_); + + if (var2 != null) { + this.removePlayerFromTeam(p_96524_1_, var2); + return true; + } else { + return false; + } + } + + /** + * Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an + * IllegalStateException is thrown. + */ + public void removePlayerFromTeam(String p_96512_1_, ScorePlayerTeam p_96512_2_) { + if (this.getPlayersTeam(p_96512_1_) != p_96512_2_) { + throw new IllegalStateException("Player is either on another team or not on any team. Cannot remove from team '" + p_96512_2_.getRegisteredName() + "'."); + } else { + this.teamMemberships.remove(p_96512_1_); + p_96512_2_.getMembershipCollection().remove(p_96512_1_); + } + } + + /** + * Retrieve all registered ScorePlayerTeam names + */ + public Collection getTeamNames() { + return this.teams.keySet(); + } + + /** + * Retrieve all registered ScorePlayerTeam instances + */ + public Collection getTeams() { + return this.teams.values(); + } + + /** + * Gets the ScorePlayerTeam object for the given username. + */ + public ScorePlayerTeam getPlayersTeam(String p_96509_1_) { + return (ScorePlayerTeam)this.teamMemberships.get(p_96509_1_); + } + + public void func_96522_a(ScoreObjective p_96522_1_) {} + + public void func_96532_b(ScoreObjective p_96532_1_) {} + + public void func_96533_c(ScoreObjective p_96533_1_) {} + + public void func_96536_a(Score p_96536_1_) {} + + public void func_96516_a(String p_96516_1_) {} + + public void func_96523_a(ScorePlayerTeam p_96523_1_) {} + + public void func_96538_b(ScorePlayerTeam p_96538_1_) {} + + public void func_96513_c(ScorePlayerTeam p_96513_1_) {} + + /** + * Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2, otherwise null. + */ + public static String getObjectiveDisplaySlot(int p_96517_0_) { + switch (p_96517_0_) { + case 0: + return "list"; + + case 1: + return "sidebar"; + + case 2: + return "belowName"; + + default: + return null; + } + } + + /** + * Returns 0 for (case-insensitive) 'list', 1 for 'sidebar', 2 for 'belowName', otherwise -1. + */ + public static int getObjectiveDisplaySlotNumber(String p_96537_0_) { + return p_96537_0_.equalsIgnoreCase("list") ? 0 : (p_96537_0_.equalsIgnoreCase("sidebar") ? 1 : (p_96537_0_.equalsIgnoreCase("belowName") ? 2 : -1)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java new file mode 100644 index 0000000..7f2cbb8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ScoreboardSaveData.java @@ -0,0 +1,202 @@ +package net.minecraft.scoreboard; + +import java.util.Collection; +import java.util.Iterator; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.world.WorldSavedData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ScoreboardSaveData extends WorldSavedData { + private static final Logger logger = LogManager.getLogger(); + private Scoreboard theScoreboard; + private NBTTagCompound field_96506_b; + + + public ScoreboardSaveData() { + this("scoreboard"); + } + + public ScoreboardSaveData(String p_i2310_1_) { + super(p_i2310_1_); + } + + public void func_96499_a(Scoreboard p_96499_1_) { + this.theScoreboard = p_96499_1_; + + if (this.field_96506_b != null) { + this.readFromNBT(this.field_96506_b); + } + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbt) { + if (this.theScoreboard == null) { + this.field_96506_b = nbt; + } else { + this.func_96501_b(nbt.getTagList("Objectives", 10)); + this.func_96500_c(nbt.getTagList("PlayerScores", 10)); + + if (nbt.func_150297_b("DisplaySlots", 10)) { + this.func_96504_c(nbt.getCompoundTag("DisplaySlots")); + } + + if (nbt.func_150297_b("Teams", 9)) { + this.func_96498_a(nbt.getTagList("Teams", 10)); + } + } + } + + protected void func_96498_a(NBTTagList p_96498_1_) { + for (int var2 = 0; var2 < p_96498_1_.tagCount(); ++var2) { + NBTTagCompound var3 = p_96498_1_.getCompoundTagAt(var2); + ScorePlayerTeam var4 = this.theScoreboard.createTeam(var3.getString("Name")); + var4.setTeamName(var3.getString("DisplayName")); + var4.setNamePrefix(var3.getString("Prefix")); + var4.setNameSuffix(var3.getString("Suffix")); + + if (var3.func_150297_b("AllowFriendlyFire", 99)) { + var4.setAllowFriendlyFire(var3.getBoolean("AllowFriendlyFire")); + } + + if (var3.func_150297_b("SeeFriendlyInvisibles", 99)) { + var4.setSeeFriendlyInvisiblesEnabled(var3.getBoolean("SeeFriendlyInvisibles")); + } + + this.func_96502_a(var4, var3.getTagList("Players", 8)); + } + } + + protected void func_96502_a(ScorePlayerTeam p_96502_1_, NBTTagList p_96502_2_) { + for (int var3 = 0; var3 < p_96502_2_.tagCount(); ++var3) { + this.theScoreboard.func_151392_a(p_96502_2_.getStringTagAt(var3), p_96502_1_.getRegisteredName()); + } + } + + protected void func_96504_c(NBTTagCompound p_96504_1_) { + for (int var2 = 0; var2 < 3; ++var2) { + if (p_96504_1_.func_150297_b("slot_" + var2, 8)) { + String var3 = p_96504_1_.getString("slot_" + var2); + ScoreObjective var4 = this.theScoreboard.getObjective(var3); + this.theScoreboard.func_96530_a(var2, var4); + } + } + } + + protected void func_96501_b(NBTTagList p_96501_1_) { + for (int var2 = 0; var2 < p_96501_1_.tagCount(); ++var2) { + NBTTagCompound var3 = p_96501_1_.getCompoundTagAt(var2); + IScoreObjectiveCriteria var4 = (IScoreObjectiveCriteria)IScoreObjectiveCriteria.field_96643_a.get(var3.getString("CriteriaName")); + ScoreObjective var5 = this.theScoreboard.addScoreObjective(var3.getString("Name"), var4); + var5.setDisplayName(var3.getString("DisplayName")); + } + } + + protected void func_96500_c(NBTTagList p_96500_1_) { + for (int var2 = 0; var2 < p_96500_1_.tagCount(); ++var2) { + NBTTagCompound var3 = p_96500_1_.getCompoundTagAt(var2); + ScoreObjective var4 = this.theScoreboard.getObjective(var3.getString("Objective")); + Score var5 = this.theScoreboard.func_96529_a(var3.getString("Name"), var4); + var5.func_96647_c(var3.getInteger("Score")); + } + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbt) { + if (this.theScoreboard == null) { + logger.warn("Tried to save scoreboard without having a scoreboard..."); + } else { + nbt.setTag("Objectives", this.func_96505_b()); + nbt.setTag("PlayerScores", this.func_96503_e()); + nbt.setTag("Teams", this.func_96496_a()); + this.func_96497_d(nbt); + } + } + + protected NBTTagList func_96496_a() { + NBTTagList var1 = new NBTTagList(); + Collection var2 = this.theScoreboard.getTeams(); + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + ScorePlayerTeam var4 = (ScorePlayerTeam)var3.next(); + NBTTagCompound var5 = new NBTTagCompound(); + var5.setString("Name", var4.getRegisteredName()); + var5.setString("DisplayName", var4.func_96669_c()); + var5.setString("Prefix", var4.getColorPrefix()); + var5.setString("Suffix", var4.getColorSuffix()); + var5.setBoolean("AllowFriendlyFire", var4.getAllowFriendlyFire()); + var5.setBoolean("SeeFriendlyInvisibles", var4.func_98297_h()); + NBTTagList var6 = new NBTTagList(); + Iterator var7 = var4.getMembershipCollection().iterator(); + + while (var7.hasNext()) { + String var8 = (String)var7.next(); + var6.appendTag(new NBTTagString(var8)); + } + + var5.setTag("Players", var6); + var1.appendTag(var5); + } + + return var1; + } + + protected void func_96497_d(NBTTagCompound p_96497_1_) { + NBTTagCompound var2 = new NBTTagCompound(); + boolean var3 = false; + + for (int var4 = 0; var4 < 3; ++var4) { + ScoreObjective var5 = this.theScoreboard.func_96539_a(var4); + + if (var5 != null) { + var2.setString("slot_" + var4, var5.getName()); + var3 = true; + } + } + + if (var3) { + p_96497_1_.setTag("DisplaySlots", var2); + } + } + + protected NBTTagList func_96505_b() { + NBTTagList var1 = new NBTTagList(); + Collection var2 = this.theScoreboard.getScoreObjectives(); + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + ScoreObjective var4 = (ScoreObjective)var3.next(); + NBTTagCompound var5 = new NBTTagCompound(); + var5.setString("Name", var4.getName()); + var5.setString("CriteriaName", var4.getCriteria().func_96636_a()); + var5.setString("DisplayName", var4.getDisplayName()); + var1.appendTag(var5); + } + + return var1; + } + + protected NBTTagList func_96503_e() { + NBTTagList var1 = new NBTTagList(); + Collection var2 = this.theScoreboard.func_96528_e(); + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + Score var4 = (Score)var3.next(); + NBTTagCompound var5 = new NBTTagCompound(); + var5.setString("Name", var4.getPlayerName()); + var5.setString("Objective", var4.func_96645_d().getName()); + var5.setInteger("Score", var4.getScorePoints()); + var1.appendTag(var5); + } + + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java new file mode 100644 index 0000000..ab21b11 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java @@ -0,0 +1,218 @@ +package net.minecraft.scoreboard; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.server.MinecraftServer; + +public class ServerScoreboard extends Scoreboard { + private final MinecraftServer scoreboardMCServer; + private final Set field_96553_b = new HashSet(); + private ScoreboardSaveData field_96554_c; + + + public ServerScoreboard(MinecraftServer p_i1501_1_) { + this.scoreboardMCServer = p_i1501_1_; + } + + public void func_96536_a(Score p_96536_1_) { + super.func_96536_a(p_96536_1_); + + if (this.field_96553_b.contains(p_96536_1_.func_96645_d())) { + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3CPacketUpdateScore(p_96536_1_, 0)); + } + + this.func_96551_b(); + } + + public void func_96516_a(String p_96516_1_) { + super.func_96516_a(p_96516_1_); + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3CPacketUpdateScore(p_96516_1_)); + this.func_96551_b(); + } + + public void func_96530_a(int p_96530_1_, ScoreObjective p_96530_2_) { + ScoreObjective var3 = this.func_96539_a(p_96530_1_); + super.func_96530_a(p_96530_1_, p_96530_2_); + + if (var3 != p_96530_2_ && var3 != null) { + if (this.func_96552_h(var3) > 0) { + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3DPacketDisplayScoreboard(p_96530_1_, p_96530_2_)); + } else { + this.func_96546_g(var3); + } + } + + if (p_96530_2_ != null) { + if (this.field_96553_b.contains(p_96530_2_)) { + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3DPacketDisplayScoreboard(p_96530_1_, p_96530_2_)); + } else { + this.func_96549_e(p_96530_2_); + } + } + + this.func_96551_b(); + } + + public boolean func_151392_a(String p_151392_1_, String p_151392_2_) { + if (super.func_151392_a(p_151392_1_, p_151392_2_)) { + ScorePlayerTeam var3 = this.getTeam(p_151392_2_); + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3EPacketTeams(var3, Arrays.asList(p_151392_1_), 3)); + this.func_96551_b(); + return true; + } else { + return false; + } + } + + /** + * Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an + * IllegalStateException is thrown. + */ + public void removePlayerFromTeam(String p_96512_1_, ScorePlayerTeam p_96512_2_) { + super.removePlayerFromTeam(p_96512_1_, p_96512_2_); + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3EPacketTeams(p_96512_2_, Arrays.asList(p_96512_1_), 4)); + this.func_96551_b(); + } + + public void func_96522_a(ScoreObjective p_96522_1_) { + super.func_96522_a(p_96522_1_); + this.func_96551_b(); + } + + public void func_96532_b(ScoreObjective p_96532_1_) { + super.func_96532_b(p_96532_1_); + + if (this.field_96553_b.contains(p_96532_1_)) { + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3BPacketScoreboardObjective(p_96532_1_, 2)); + } + + this.func_96551_b(); + } + + public void func_96533_c(ScoreObjective p_96533_1_) { + super.func_96533_c(p_96533_1_); + + if (this.field_96553_b.contains(p_96533_1_)) { + this.func_96546_g(p_96533_1_); + } + + this.func_96551_b(); + } + + public void func_96523_a(ScorePlayerTeam p_96523_1_) { + super.func_96523_a(p_96523_1_); + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3EPacketTeams(p_96523_1_, 0)); + this.func_96551_b(); + } + + public void func_96538_b(ScorePlayerTeam p_96538_1_) { + super.func_96538_b(p_96538_1_); + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3EPacketTeams(p_96538_1_, 2)); + this.func_96551_b(); + } + + public void func_96513_c(ScorePlayerTeam p_96513_1_) { + super.func_96513_c(p_96513_1_); + this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3EPacketTeams(p_96513_1_, 1)); + this.func_96551_b(); + } + + public void func_96547_a(ScoreboardSaveData p_96547_1_) { + this.field_96554_c = p_96547_1_; + } + + protected void func_96551_b() { + if (this.field_96554_c != null) { + this.field_96554_c.markDirty(); + } + } + + public List func_96550_d(ScoreObjective p_96550_1_) { + ArrayList var2 = new ArrayList(); + var2.add(new S3BPacketScoreboardObjective(p_96550_1_, 0)); + + for (int var3 = 0; var3 < 3; ++var3) { + if (this.func_96539_a(var3) == p_96550_1_) { + var2.add(new S3DPacketDisplayScoreboard(var3, p_96550_1_)); + } + } + + Iterator var5 = this.func_96534_i(p_96550_1_).iterator(); + + while (var5.hasNext()) { + Score var4 = (Score)var5.next(); + var2.add(new S3CPacketUpdateScore(var4, 0)); + } + + return var2; + } + + public void func_96549_e(ScoreObjective p_96549_1_) { + List var2 = this.func_96550_d(p_96549_1_); + Iterator var3 = this.scoreboardMCServer.getConfigurationManager().playerEntityList.iterator(); + + while (var3.hasNext()) { + EntityPlayerMP var4 = (EntityPlayerMP)var3.next(); + Iterator var5 = var2.iterator(); + + while (var5.hasNext()) { + Packet var6 = (Packet)var5.next(); + var4.playerNetServerHandler.sendPacket(var6); + } + } + + this.field_96553_b.add(p_96549_1_); + } + + public List func_96548_f(ScoreObjective p_96548_1_) { + ArrayList var2 = new ArrayList(); + var2.add(new S3BPacketScoreboardObjective(p_96548_1_, 1)); + + for (int var3 = 0; var3 < 3; ++var3) { + if (this.func_96539_a(var3) == p_96548_1_) { + var2.add(new S3DPacketDisplayScoreboard(var3, p_96548_1_)); + } + } + + return var2; + } + + public void func_96546_g(ScoreObjective p_96546_1_) { + List var2 = this.func_96548_f(p_96546_1_); + Iterator var3 = this.scoreboardMCServer.getConfigurationManager().playerEntityList.iterator(); + + while (var3.hasNext()) { + EntityPlayerMP var4 = (EntityPlayerMP)var3.next(); + Iterator var5 = var2.iterator(); + + while (var5.hasNext()) { + Packet var6 = (Packet)var5.next(); + var4.playerNetServerHandler.sendPacket(var6); + } + } + + this.field_96553_b.remove(p_96546_1_); + } + + public int func_96552_h(ScoreObjective p_96552_1_) { + int var2 = 0; + + for (int var3 = 0; var3 < 3; ++var3) { + if (this.func_96539_a(var3) == p_96552_1_) { + ++var2; + } + } + + return var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Team.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Team.java new file mode 100644 index 0000000..df4005d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/scoreboard/Team.java @@ -0,0 +1,23 @@ +package net.minecraft.scoreboard; + +public abstract class Team { + + + /** + * Same as == + */ + public boolean isSameTeam(Team p_142054_1_) { + return p_142054_1_ != null && this == p_142054_1_; + } + + /** + * Retrieve the name by which this team is registered in the scoreboard + */ + public abstract String getRegisteredName(); + + public abstract String func_142053_d(String p_142053_1_); + + public abstract boolean func_98297_h(); + + public abstract boolean getAllowFriendlyFire(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/MinecraftServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/MinecraftServer.java new file mode 100644 index 0000000..83ffb45 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +1,1164 @@ +package net.minecraft.server; + +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.GameProfileRepository; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufOutputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import java.awt.GraphicsEnvironment; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.net.Proxy; +import java.security.KeyPair; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.Callable; +import javax.imageio.ImageIO; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.ServerCommandManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetworkSystem; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.profiler.IPlayerUsage; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.gui.IUpdatePlayerListBox; +import net.minecraft.server.management.PlayerProfileCache; +import net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldServerMulti; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.chunk.storage.AnvilSaveConverter; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage { + private static final Logger logger = LogManager.getLogger(); + public static final File field_152367_a = new File("usercache.json"); + + /** Instance of Minecraft Server. */ + private static MinecraftServer mcServer; + private final ISaveFormat anvilConverterForAnvilFile; + + /** The PlayerUsageSnooper instance. */ + private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("server", this, getSystemTimeMillis()); + private final File anvilFile; + + /** + * Collection of objects to update every tick. Type: List + */ + private final List tickables = new ArrayList(); + private final ICommandManager commandManager; + public final Profiler theProfiler = new Profiler(); + private final NetworkSystem field_147144_o; + private final ServerStatusResponse field_147147_p = new ServerStatusResponse(); + private final Random field_147146_q = new Random(); + + /** The server's port. */ + private final int serverPort = -1; + + /** The server world instances. */ + public WorldServer[] worldServers; + + /** The ServerConfigurationManager instance. */ + private ServerConfigurationManager serverConfigManager; + + /** + * Indicates whether the server is running or not. Set to false to initiate a shutdown. + */ + private boolean serverRunning = true; + + /** Indicates to other classes that the server is safely stopped. */ + private boolean serverStopped; + + /** Incremented every tick. */ + private int tickCounter; + protected final Proxy serverProxy; + + /** + * The task the server is currently working on(and will output on outputPercentRemaining). + */ + public String currentTask; + + /** The percentage of the current task finished so far. */ + public int percentDone; + + /** True if the server is in online mode. */ + private boolean onlineMode; + + /** True if the server has animals turned on. */ + private boolean canSpawnAnimals; + private boolean canSpawnNPCs; + + /** Indicates whether PvP is active on the server or not. */ + private boolean pvpEnabled; + + /** Determines if flight is allowed or not. */ + private boolean allowFlight; + + /** The server MOTD string. */ + private String motd; + + /** Maximum build height. */ + private int buildLimit; + private int field_143008_E = 0; + public final long[] tickTimeArray = new long[100]; + + /** Stats are [dimension][tick%100] system.nanoTime is stored. */ + public long[][] timeOfLastDimensionTick; + private KeyPair serverKeyPair; + + /** Username of the server owner (for integrated servers) */ + private String serverOwner; + private String folderName; + private String worldName; + private boolean isDemo; + private boolean enableBonusChest; + + /** + * If true, there is no need to save chunks or stop the server, because that is already being done. + */ + private boolean worldIsBeingDeleted; + private final String field_147141_M = ""; + private boolean serverIsRunning; + + /** + * Set when warned for "Can't keep up", which triggers again after 15 seconds. + */ + private long timeOfLastWarning; + private String userMessage; + private boolean startProfiling; + private boolean isGamemodeForced; + private final YggdrasilAuthenticationService field_152364_T; + private final MinecraftSessionService field_147143_S; + private long field_147142_T = 0L; + private final GameProfileRepository field_152365_W; + private final PlayerProfileCache field_152366_X; + + + public MinecraftServer(File p_i46400_1_, Proxy p_i46400_2_) { + this.field_152366_X = new PlayerProfileCache(this, field_152367_a); + mcServer = this; + this.serverProxy = p_i46400_2_; + this.anvilFile = p_i46400_1_; + this.field_147144_o = new NetworkSystem(this); + this.commandManager = new ServerCommandManager(); + this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i46400_1_); + this.field_152364_T = new YggdrasilAuthenticationService(p_i46400_2_, UUID.randomUUID().toString()); + this.field_147143_S = this.field_152364_T.createMinecraftSessionService(); + this.field_152365_W = this.field_152364_T.createProfileRepository(); + } + + /** + * Initialises the server and starts it. + */ + protected abstract boolean startServer() throws IOException; + + protected void convertMapIfNeeded(String p_71237_1_) { + if (this.getActiveAnvilConverter().isOldMapFormat(p_71237_1_)) { + logger.info("Converting map!"); + this.setUserMessage("menu.convertingLevel"); + this.getActiveAnvilConverter().convertMapFormat(p_71237_1_, new IProgressUpdate() { + private long field_96245_b = System.currentTimeMillis(); + + public void displayProgressMessage(String p_73720_1_) {} + public void resetProgressAndMessage(String p_73721_1_) {} + public void setLoadingProgress(int p_73718_1_) { + if (System.currentTimeMillis() - this.field_96245_b >= 1000L) { + this.field_96245_b = System.currentTimeMillis(); + MinecraftServer.logger.info("Converting... " + p_73718_1_ + "%"); + } + } + public void func_146586_a() {} + public void resetProgresAndWorkingMessage(String p_73719_1_) {} + }); + } + } + + /** + * Typically "menu.convertingLevel", "menu.loadingLevel" or others. + */ + protected synchronized void setUserMessage(String p_71192_1_) { + this.userMessage = p_71192_1_; + } + + public synchronized String getUserMessage() { + return this.userMessage; + } + + protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) { + this.convertMapIfNeeded(p_71247_1_); + this.setUserMessage("menu.loadingLevel"); + this.worldServers = new WorldServer[3]; + this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; + ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(p_71247_1_, true); + WorldInfo var9 = var7.loadWorldInfo(); + WorldSettings var8; + + if (var9 == null) { + var8 = new WorldSettings(p_71247_3_, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), p_71247_5_); + var8.func_82750_a(p_71247_6_); + } else { + var8 = new WorldSettings(var9); + } + + if (this.enableBonusChest) { + var8.enableBonusChest(); + } + + for (int var10 = 0; var10 < this.worldServers.length; ++var10) { + byte var11 = 0; + + if (var10 == 1) { + var11 = -1; + } + + if (var10 == 2) { + var11 = 1; + } + + if (var10 == 0) { + if (this.isDemo()) { + this.worldServers[var10] = new DemoWorldServer(this, var7, p_71247_2_, var11, this.theProfiler); + } else { + this.worldServers[var10] = new WorldServer(this, var7, p_71247_2_, var11, var8, this.theProfiler); + } + } else { + this.worldServers[var10] = new WorldServerMulti(this, var7, p_71247_2_, var11, var8, this.worldServers[0], this.theProfiler); + } + + this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10])); + + if (!this.isSinglePlayer()) { + this.worldServers[var10].getWorldInfo().setGameType(this.getGameType()); + } + + this.serverConfigManager.setPlayerManager(this.worldServers); + } + + this.func_147139_a(this.func_147135_j()); + this.initialWorldChunkLoad(); + } + + protected void initialWorldChunkLoad() { + boolean var1 = true; + boolean var2 = true; + boolean var3 = true; + boolean var4 = true; + int var5 = 0; + this.setUserMessage("menu.generatingTerrain"); + byte var6 = 0; + logger.info("Preparing start region for level " + var6); + WorldServer var7 = this.worldServers[var6]; + ChunkCoordinates var8 = var7.getSpawnPoint(); + long var9 = getSystemTimeMillis(); + + for (int var11 = -192; var11 <= 192 && this.isServerRunning(); var11 += 16) { + for (int var12 = -192; var12 <= 192 && this.isServerRunning(); var12 += 16) { + long var13 = getSystemTimeMillis(); + + if (var13 - var9 > 1000L) { + this.outputPercentRemaining("Preparing spawn area", var5 * 100 / 625); + var9 = var13; + } + + ++var5; + var7.theChunkProviderServer.loadChunk(var8.posX + var11 >> 4, var8.posZ + var12 >> 4); + } + } + + this.clearCurrentTask(); + } + + public abstract boolean canStructuresSpawn(); + + public abstract WorldSettings.GameType getGameType(); + + public abstract EnumDifficulty func_147135_j(); + + /** + * Defaults to false. + */ + public abstract boolean isHardcore(); + + public abstract int func_110455_j(); + + public abstract boolean func_152363_m(); + + /** + * Used to display a percent remaining given text and the percentage. + */ + protected void outputPercentRemaining(String p_71216_1_, int p_71216_2_) { + this.currentTask = p_71216_1_; + this.percentDone = p_71216_2_; + logger.info(p_71216_1_ + ": " + p_71216_2_ + "%"); + } + + /** + * Set current task to null and set its percentage to 0. + */ + protected void clearCurrentTask() { + this.currentTask = null; + this.percentDone = 0; + } + + /** + * par1 indicates if a log message should be output. + */ + protected void saveAllWorlds(boolean p_71267_1_) { + if (!this.worldIsBeingDeleted) { + WorldServer[] var2 = this.worldServers; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + WorldServer var5 = var2[var4]; + + if (var5 != null) { + if (!p_71267_1_) { + logger.info("Saving chunks for level '" + var5.getWorldInfo().getWorldName() + "'/" + var5.provider.getDimensionName()); + } + + try { + var5.saveAllChunks(true, null); + } catch (MinecraftException var7) { + logger.warn(var7.getMessage()); + } + } + } + } + } + + /** + * Saves all necessary data as preparation for stopping the server. + */ + public void stopServer() { + if (!this.worldIsBeingDeleted) { + logger.info("Stopping server"); + + if (this.func_147137_ag() != null) { + this.func_147137_ag().terminateEndpoints(); + } + + if (this.serverConfigManager != null) { + logger.info("Saving players"); + this.serverConfigManager.saveAllPlayerData(); + this.serverConfigManager.removeAllPlayers(); + } + + if (this.worldServers != null) { + logger.info("Saving worlds"); + this.saveAllWorlds(false); + + for (int var1 = 0; var1 < this.worldServers.length; ++var1) { + WorldServer var2 = this.worldServers[var1]; + var2.flush(); + } + } + + if (this.usageSnooper.isSnooperRunning()) { + this.usageSnooper.stopSnooper(); + } + } + } + + public boolean isServerRunning() { + return this.serverRunning; + } + + /** + * Sets the serverRunning variable to false, in order to get the server to shut down. + */ + public void initiateShutdown() { + this.serverRunning = false; + } + + public void run() { + try { + if (this.startServer()) { + long var1 = getSystemTimeMillis(); + long var50 = 0L; + this.field_147147_p.func_151315_a(new ChatComponentText(this.motd)); + this.field_147147_p.func_151321_a(new ServerStatusResponse.MinecraftProtocolVersionIdentifier("1.7.10", 5)); + this.func_147138_a(this.field_147147_p); + + while (this.serverRunning) { + long var5 = getSystemTimeMillis(); + long var7 = var5 - var1; + + if (var7 > 2000L && var1 - this.timeOfLastWarning >= 15000L) { + logger.warn("Can't keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", Long.valueOf(var7), Long.valueOf(var7 / 50L)); + var7 = 2000L; + this.timeOfLastWarning = var1; + } + + if (var7 < 0L) { + logger.warn("Time ran backwards! Did the system time change?"); + var7 = 0L; + } + + var50 += var7; + var1 = var5; + + if (this.worldServers[0].areAllPlayersAsleep()) { + this.tick(); + var50 = 0L; + } else { + while (var50 > 50L) { + var50 -= 50L; + this.tick(); + } + } + + Thread.sleep(Math.max(1L, 50L - var50)); + this.serverIsRunning = true; + } + } else { + this.finalTick(null); + } + } catch (Throwable var48) { + logger.error("Encountered an unexpected exception", var48); + CrashReport var2 = null; + + if (var48 instanceof ReportedException) { + var2 = this.addServerInfoToCrashReport(((ReportedException)var48).getCrashReport()); + } else { + var2 = this.addServerInfoToCrashReport(new CrashReport("Exception in server tick loop", var48)); + } + + File var3 = new File(new File(this.getDataDirectory(), "crash-reports"), "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-server.txt"); + + if (var2.saveToFile(var3)) { + logger.error("This crash report has been saved to: " + var3.getAbsolutePath()); + } else { + logger.error("We were unable to save this crash report to disk."); + } + + this.finalTick(var2); + } + finally { + try { + this.stopServer(); + this.serverStopped = true; + } catch (Throwable var46) { + logger.error("Exception stopping the server", var46); + } finally { + this.systemExitNow(); + } + } + } + + private void func_147138_a(ServerStatusResponse p_147138_1_) { + File var2 = this.getFile("server-icon.png"); + + if (var2.isFile()) { + ByteBuf var3 = Unpooled.buffer(); + + try { + BufferedImage var4 = ImageIO.read(var2); + Validate.validState(var4.getWidth() == 64, "Must be 64 pixels wide"); + Validate.validState(var4.getHeight() == 64, "Must be 64 pixels high"); + ImageIO.write(var4, "PNG", new ByteBufOutputStream(var3)); + ByteBuf var5 = Base64.encode(var3); + p_147138_1_.func_151320_a("data:image/png;base64," + var5.toString(Charsets.UTF_8)); + } catch (Exception var9) { + logger.error("Couldn't load server icon", var9); + } finally { + var3.release(); + } + } + } + + protected File getDataDirectory() { + return new File("."); + } + + /** + * Called on exit from the main run() loop. + */ + protected void finalTick(CrashReport p_71228_1_) {} + + /** + * Directly calls System.exit(0), instantly killing the program. + */ + protected void systemExitNow() {} + + /** + * Main function called by run() every loop. + */ + public void tick() { + long var1 = System.nanoTime(); + ++this.tickCounter; + + if (this.startProfiling) { + this.startProfiling = false; + this.theProfiler.profilingEnabled = true; + this.theProfiler.clearProfiling(); + } + + this.theProfiler.startSection("root"); + this.updateTimeLightAndEntities(); + + if (var1 - this.field_147142_T >= 5000000000L) { + this.field_147142_T = var1; + this.field_147147_p.func_151319_a(new ServerStatusResponse.PlayerCountData(this.getMaxPlayers(), this.getCurrentPlayerCount())); + GameProfile[] var3 = new GameProfile[Math.min(this.getCurrentPlayerCount(), 12)]; + int var4 = MathHelper.getRandomIntegerInRange(this.field_147146_q, 0, this.getCurrentPlayerCount() - var3.length); + + for (int var5 = 0; var5 < var3.length; ++var5) { + var3[var5] = ((EntityPlayerMP)this.serverConfigManager.playerEntityList.get(var4 + var5)).getGameProfile(); + } + + Collections.shuffle(Arrays.asList(var3)); + this.field_147147_p.func_151318_b().func_151330_a(var3); + } + + if (this.tickCounter % 900 == 0) { + this.theProfiler.startSection("save"); + this.serverConfigManager.saveAllPlayerData(); + this.saveAllWorlds(true); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tallying"); + this.tickTimeArray[this.tickCounter % 100] = System.nanoTime() - var1; + this.theProfiler.endSection(); + this.theProfiler.startSection("snooper"); + + if (!this.usageSnooper.isSnooperRunning() && this.tickCounter > 100) { + this.usageSnooper.startSnooper(); + } + + if (this.tickCounter % 6000 == 0) { + this.usageSnooper.addMemoryStatsToSnooper(); + } + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + public void updateTimeLightAndEntities() { + this.theProfiler.startSection("levels"); + int var1; + + for (var1 = 0; var1 < this.worldServers.length; ++var1) { + long var2 = System.nanoTime(); + + if (var1 == 0 || this.getAllowNether()) { + WorldServer var4 = this.worldServers[var1]; + this.theProfiler.startSection(var4.getWorldInfo().getWorldName()); + this.theProfiler.startSection("pools"); + this.theProfiler.endSection(); + + if (this.tickCounter % 20 == 0) { + this.theProfiler.startSection("timeSync"); + this.serverConfigManager.func_148537_a(new S03PacketTimeUpdate(var4.getTotalWorldTime(), var4.getWorldTime(), var4.getGameRules().getGameRuleBooleanValue("doDaylightCycle")), var4.provider.dimensionId); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tick"); + CrashReport var6; + + try { + var4.tick(); + } catch (Throwable var8) { + var6 = CrashReport.makeCrashReport(var8, "Exception ticking world"); + var4.addWorldInfoToCrashReport(var6); + throw new ReportedException(var6); + } + + try { + var4.updateEntities(); + } catch (Throwable var7) { + var6 = CrashReport.makeCrashReport(var7, "Exception ticking world entities"); + var4.addWorldInfoToCrashReport(var6); + throw new ReportedException(var6); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("tracker"); + var4.getEntityTracker().updateTrackedEntities(); + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + this.timeOfLastDimensionTick[var1][this.tickCounter % 100] = System.nanoTime() - var2; + } + + this.theProfiler.endStartSection("connection"); + this.func_147137_ag().networkTick(); + this.theProfiler.endStartSection("players"); + this.serverConfigManager.sendPlayerInfoToAllPlayers(); + this.theProfiler.endStartSection("tickables"); + + for (var1 = 0; var1 < this.tickables.size(); ++var1) { + ((IUpdatePlayerListBox)this.tickables.get(var1)).update(); + } + + this.theProfiler.endSection(); + } + + public boolean getAllowNether() { + return true; + } + + public void startServerThread() { + (new Thread("Server thread") { + + public void run() { + MinecraftServer.this.run(); + } + }).start(); + } + + /** + * Returns a File object from the specified string. + */ + public File getFile(String p_71209_1_) { + return new File(this.getDataDirectory(), p_71209_1_); + } + + /** + * Logs the message with a level of WARN. + */ + public void logWarning(String p_71236_1_) { + logger.warn(p_71236_1_); + } + + /** + * Gets the worldServer by the given dimension. + */ + public WorldServer worldServerForDimension(int p_71218_1_) { + return p_71218_1_ == -1 ? this.worldServers[1] : (p_71218_1_ == 1 ? this.worldServers[2] : this.worldServers[0]); + } + + /** + * Returns the server's Minecraft version as string. + */ + public String getMinecraftVersion() { + return "1.7.10"; + } + + /** + * Returns the number of players currently on the server. + */ + public int getCurrentPlayerCount() { + return this.serverConfigManager.getCurrentPlayerCount(); + } + + /** + * Returns the maximum number of players allowed on the server. + */ + public int getMaxPlayers() { + return this.serverConfigManager.getMaxPlayers(); + } + + /** + * Returns an array of the usernames of all the connected players. + */ + public String[] getAllUsernames() { + return this.serverConfigManager.getAllUsernames(); + } + + public GameProfile[] func_152357_F() { + return this.serverConfigManager.func_152600_g(); + } + + public String getServerModName() { + return "vanilla"; + } + + /** + * Adds the server info, including from theWorldServer, to the crash report. + */ + public CrashReport addServerInfoToCrashReport(CrashReport p_71230_1_) { + p_71230_1_.getCategory().addCrashSectionCallable("Profiler Position", new Callable() { + + public String call() { + return MinecraftServer.this.theProfiler.profilingEnabled ? MinecraftServer.this.theProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + }); + + if (this.worldServers != null && this.worldServers.length > 0 && this.worldServers[0] != null) { + p_71230_1_.getCategory().addCrashSectionCallable("Vec3 Pool Size", new Callable() { + + public String call() { + byte var1 = 0; + int var2 = 56 * var1; + int var3 = var2 / 1024 / 1024; + byte var4 = 0; + int var5 = 56 * var4; + int var6 = var5 / 1024 / 1024; + return var1 + " (" + var2 + " bytes; " + var3 + " MB) allocated, " + var4 + " (" + var5 + " bytes; " + var6 + " MB) used"; + } + }); + } + + if (this.serverConfigManager != null) { + p_71230_1_.getCategory().addCrashSectionCallable("Player Count", new Callable() { + + public String call() { + return MinecraftServer.this.serverConfigManager.getCurrentPlayerCount() + " / " + MinecraftServer.this.serverConfigManager.getMaxPlayers() + "; " + MinecraftServer.this.serverConfigManager.playerEntityList; + } + }); + } + + return p_71230_1_; + } + + /** + * If par2Str begins with /, then it searches for commands, otherwise it returns players. + */ + public List getPossibleCompletions(ICommandSender p_71248_1_, String p_71248_2_) { + ArrayList var3 = new ArrayList(); + + if (p_71248_2_.startsWith("/")) { + p_71248_2_ = p_71248_2_.substring(1); + boolean var10 = !p_71248_2_.contains(" "); + List var11 = this.commandManager.getPossibleCommands(p_71248_1_, p_71248_2_); + + if (var11 != null) { + Iterator var12 = var11.iterator(); + + while (var12.hasNext()) { + String var13 = (String)var12.next(); + + if (var10) { + var3.add("/" + var13); + } else { + var3.add(var13); + } + } + } + + return var3; + } else { + String[] var4 = p_71248_2_.split(" ", -1); + String var5 = var4[var4.length - 1]; + String[] var6 = this.serverConfigManager.getAllUsernames(); + int var7 = var6.length; + + for (int var8 = 0; var8 < var7; ++var8) { + String var9 = var6[var8]; + + if (CommandBase.doesStringStartWith(var5, var9)) { + var3.add(var9); + } + } + + return var3; + } + } + + /** + * Gets mcServer. + */ + public static MinecraftServer getServer() { + return mcServer; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() { + return "Server"; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent p_145747_1_) { + logger.info(p_145747_1_.getUnformattedText()); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_) { + return true; + } + + public ICommandManager getCommandManager() { + return this.commandManager; + } + + /** + * Gets KeyPair instanced in MinecraftServer. + */ + public KeyPair getKeyPair() { + return this.serverKeyPair; + } + + /** + * Returns the username of the server owner (for integrated servers) + */ + public String getServerOwner() { + return this.serverOwner; + } + + /** + * Sets the username of the owner of this server (in the case of an integrated server) + */ + public void setServerOwner(String p_71224_1_) { + this.serverOwner = p_71224_1_; + } + + public boolean isSinglePlayer() { + return this.serverOwner != null; + } + + public String getFolderName() { + return this.folderName; + } + + public void setFolderName(String p_71261_1_) { + this.folderName = p_71261_1_; + } + + public void setWorldName(String p_71246_1_) { + this.worldName = p_71246_1_; + } + + public String getWorldName() { + return this.worldName; + } + + public void setKeyPair(KeyPair p_71253_1_) { + this.serverKeyPair = p_71253_1_; + } + + public void func_147139_a(EnumDifficulty p_147139_1_) { + for (int var2 = 0; var2 < this.worldServers.length; ++var2) { + WorldServer var3 = this.worldServers[var2]; + + if (var3 != null) { + if (var3.getWorldInfo().isHardcoreModeEnabled()) { + var3.difficultySetting = EnumDifficulty.HARD; + var3.setAllowedSpawnTypes(true, true); + } else if (this.isSinglePlayer()) { + var3.difficultySetting = p_147139_1_; + var3.setAllowedSpawnTypes(var3.difficultySetting != EnumDifficulty.PEACEFUL, true); + } else { + var3.difficultySetting = p_147139_1_; + var3.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals); + } + } + } + } + + protected boolean allowSpawnMonsters() { + return true; + } + + /** + * Gets whether this is a demo or not. + */ + public boolean isDemo() { + return this.isDemo; + } + + /** + * Sets whether this is a demo or not. + */ + public void setDemo(boolean p_71204_1_) { + this.isDemo = p_71204_1_; + } + + public void canCreateBonusChest(boolean p_71194_1_) { + this.enableBonusChest = p_71194_1_; + } + + public ISaveFormat getActiveAnvilConverter() { + return this.anvilConverterForAnvilFile; + } + + /** + * WARNING : directly calls + * getActiveAnvilConverter().deleteWorldDirectory(theWorldServer[0].getSaveHandler().getWorldDirectoryName()); + */ + public void deleteWorldAndStopServer() { + this.worldIsBeingDeleted = true; + this.getActiveAnvilConverter().flushCache(); + + for (int var1 = 0; var1 < this.worldServers.length; ++var1) { + WorldServer var2 = this.worldServers[var1]; + + if (var2 != null) { + var2.flush(); + } + } + + this.getActiveAnvilConverter().deleteWorldDirectory(this.worldServers[0].getSaveHandler().getWorldDirectoryName()); + this.initiateShutdown(); + } + + public String func_147133_T() { + return this.field_147141_M; + } + + public void addServerStatsToSnooper(PlayerUsageSnooper p_70000_1_) { + p_70000_1_.func_152768_a("whitelist_enabled", Boolean.valueOf(false)); + p_70000_1_.func_152768_a("whitelist_count", Integer.valueOf(0)); + p_70000_1_.func_152768_a("players_current", Integer.valueOf(this.getCurrentPlayerCount())); + p_70000_1_.func_152768_a("players_max", Integer.valueOf(this.getMaxPlayers())); + p_70000_1_.func_152768_a("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); + p_70000_1_.func_152768_a("uses_auth", Boolean.valueOf(this.onlineMode)); + p_70000_1_.func_152768_a("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); + p_70000_1_.func_152768_a("run_time", Long.valueOf((getSystemTimeMillis() - p_70000_1_.getMinecraftStartTimeMillis()) / 60L * 1000L)); + p_70000_1_.func_152768_a("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D))); + int var2 = 0; + + for (int var3 = 0; var3 < this.worldServers.length; ++var3) { + if (this.worldServers[var3] != null) { + WorldServer var4 = this.worldServers[var3]; + WorldInfo var5 = var4.getWorldInfo(); + p_70000_1_.func_152768_a("world[" + var2 + "][dimension]", Integer.valueOf(var4.provider.dimensionId)); + p_70000_1_.func_152768_a("world[" + var2 + "][mode]", var5.getGameType()); + p_70000_1_.func_152768_a("world[" + var2 + "][difficulty]", var4.difficultySetting); + p_70000_1_.func_152768_a("world[" + var2 + "][hardcore]", Boolean.valueOf(var5.isHardcoreModeEnabled())); + p_70000_1_.func_152768_a("world[" + var2 + "][generator_name]", var5.getTerrainType().getWorldTypeName()); + p_70000_1_.func_152768_a("world[" + var2 + "][generator_version]", Integer.valueOf(var5.getTerrainType().getGeneratorVersion())); + p_70000_1_.func_152768_a("world[" + var2 + "][height]", Integer.valueOf(this.buildLimit)); + p_70000_1_.func_152768_a("world[" + var2 + "][chunks_loaded]", Integer.valueOf(var4.getChunkProvider().getLoadedChunkCount())); + ++var2; + } + } + + p_70000_1_.func_152768_a("worlds", Integer.valueOf(var2)); + } + + public void addServerTypeToSnooper(PlayerUsageSnooper p_70001_1_) { + p_70001_1_.func_152767_b("singleplayer", Boolean.valueOf(this.isSinglePlayer())); + p_70001_1_.func_152767_b("server_brand", this.getServerModName()); + p_70001_1_.func_152767_b("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); + p_70001_1_.func_152767_b("dedicated", Boolean.valueOf(this.isDedicatedServer())); + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() { + return true; + } + + public abstract boolean isDedicatedServer(); + + public boolean isServerInOnlineMode() { + return this.onlineMode; + } + + public void setOnlineMode(boolean p_71229_1_) { + this.onlineMode = p_71229_1_; + } + + public boolean getCanSpawnAnimals() { + return this.canSpawnAnimals; + } + + public void setCanSpawnAnimals(boolean p_71251_1_) { + this.canSpawnAnimals = p_71251_1_; + } + + public boolean getCanSpawnNPCs() { + return this.canSpawnNPCs; + } + + public void setCanSpawnNPCs(boolean p_71257_1_) { + this.canSpawnNPCs = p_71257_1_; + } + + public boolean isPVPEnabled() { + return this.pvpEnabled; + } + + public void setAllowPvp(boolean p_71188_1_) { + this.pvpEnabled = p_71188_1_; + } + + public boolean isFlightAllowed() { + return this.allowFlight; + } + + public void setAllowFlight(boolean p_71245_1_) { + this.allowFlight = p_71245_1_; + } + + /** + * Return whether command blocks are enabled. + */ + public abstract boolean isCommandBlockEnabled(); + + public String getMOTD() { + return this.motd; + } + + public void setMOTD(String p_71205_1_) { + this.motd = p_71205_1_; + } + + public int getBuildLimit() { + return this.buildLimit; + } + + public void setBuildLimit(int p_71191_1_) { + this.buildLimit = p_71191_1_; + } + + public ServerConfigurationManager getConfigurationManager() { + return this.serverConfigManager; + } + + public void func_152361_a(ServerConfigurationManager p_152361_1_) { + this.serverConfigManager = p_152361_1_; + } + + /** + * Sets the game type for all worlds. + */ + public void setGameType(WorldSettings.GameType p_71235_1_) { + for (int var2 = 0; var2 < this.worldServers.length; ++var2) { + getServer().worldServers[var2].getWorldInfo().setGameType(p_71235_1_); + } + } + + public NetworkSystem func_147137_ag() { + return this.field_147144_o; + } + + public boolean serverIsInRunLoop() { + return this.serverIsRunning; + } + + public boolean getGuiEnabled() { + return false; + } + + /** + * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. + */ + public abstract String shareToLAN(WorldSettings.GameType p_71206_1_, boolean p_71206_2_); + + public int getTickCounter() { + return this.tickCounter; + } + + public void enableProfiling() { + this.startProfiling = true; + } + + public PlayerUsageSnooper getPlayerUsageSnooper() { + return this.usageSnooper; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(0, 0, 0); + } + + public World getEntityWorld() { + return this.worldServers[0]; + } + + /** + * Return the spawn protection area's size. + */ + public int getSpawnProtectionSize() { + return 16; + } + + /** + * Returns true if a player does not have permission to edit the block at the given coordinates. + */ + public boolean isBlockProtected(World p_96290_1_, int p_96290_2_, int p_96290_3_, int p_96290_4_, EntityPlayer p_96290_5_) { + return false; + } + + public boolean getForceGamemode() { + return this.isGamemodeForced; + } + + public Proxy getServerProxy() { + return this.serverProxy; + } + + /** + * returns the difference, measured in milliseconds, between the current system time and midnight, January 1, 1970 + * UTC. + */ + public static long getSystemTimeMillis() { + return System.currentTimeMillis(); + } + + public int func_143007_ar() { + return this.field_143008_E; + } + + public void func_143006_e(int p_143006_1_) { + this.field_143008_E = p_143006_1_; + } + + public IChatComponent func_145748_c_() { + return new ChatComponentText(this.getCommandSenderName()); + } + + public boolean func_147136_ar() { + return true; + } + + public MinecraftSessionService func_147130_as() { + return this.field_147143_S; + } + + public GameProfileRepository func_152359_aw() { + return this.field_152365_W; + } + + public PlayerProfileCache func_152358_ax() { + return this.field_152366_X; + } + + public ServerStatusResponse func_147134_at() { + return this.field_147147_p; + } + + public void func_147132_au() { + this.field_147142_T = 0L; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/gui/IUpdatePlayerListBox.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/gui/IUpdatePlayerListBox.java new file mode 100644 index 0000000..0765e93 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/gui/IUpdatePlayerListBox.java @@ -0,0 +1,8 @@ +package net.minecraft.server.gui; + +public interface IUpdatePlayerListBox { + /** + * Updates the JList with a new model. + */ + void update(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/integrated/IntegratedPlayerList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/integrated/IntegratedPlayerList.java new file mode 100644 index 0000000..6cc2dd1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/integrated/IntegratedPlayerList.java @@ -0,0 +1,48 @@ +package net.minecraft.server.integrated; + +import com.mojang.authlib.GameProfile; +import java.net.SocketAddress; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ServerConfigurationManager; + +public class IntegratedPlayerList extends ServerConfigurationManager { + /** + * Holds the NBT data for the host player's save file, so this can be written to level.dat. + */ + private NBTTagCompound hostPlayerData; + + + public IntegratedPlayerList(IntegratedServer p_i1314_1_) { + super(p_i1314_1_); + this.func_152611_a(10); + } + + /** + * also stores the NBTTags if this is an intergratedPlayerList + */ + protected void writePlayerData(EntityPlayerMP p_72391_1_) { + if (p_72391_1_.getCommandSenderName().equals(this.getServerInstance().getServerOwner())) { + this.hostPlayerData = new NBTTagCompound(); + p_72391_1_.writeToNBT(this.hostPlayerData); + } + + super.writePlayerData(p_72391_1_); + } + + public String func_148542_a(SocketAddress p_148542_1_, GameProfile p_148542_2_) { + return p_148542_2_.getName().equalsIgnoreCase(this.getServerInstance().getServerOwner()) && this.func_152612_a(p_148542_2_.getName()) != null ? "That name is already taken." : super.func_148542_a(p_148542_1_, p_148542_2_); + } + + public IntegratedServer getServerInstance() { + return (IntegratedServer)super.getServerInstance(); + } + + /** + * On integrated servers, returns the host's player data to be written to level.dat. + */ + public NBTTagCompound getHostPlayerData() { + return this.hostPlayerData; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/integrated/IntegratedServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/integrated/IntegratedServer.java new file mode 100644 index 0000000..b982da5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/integrated/IntegratedServer.java @@ -0,0 +1,320 @@ +package net.minecraft.server.integrated; + +import java.io.File; +import java.io.IOException; +import java.net.InetAddress; +import java.util.concurrent.Callable; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ThreadLanServerPing; +import net.minecraft.crash.CrashReport; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.server.MinecraftServer; +import net.minecraft.src.Reflector; +import net.minecraft.src.WorldServerMultiOF; +import net.minecraft.src.WorldServerOF; +import net.minecraft.util.CryptManager; +import net.minecraft.util.HttpUtil; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.WorldSettings.GameType; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveHandler; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class IntegratedServer extends MinecraftServer { + private static final Logger logger = LogManager.getLogger(); + + /** The Minecraft instance. */ + private final Minecraft mc; + private final WorldSettings theWorldSettings; + private boolean isGamePaused; + private boolean isPublic; + private ThreadLanServerPing lanServerPing; + + public IntegratedServer(Minecraft par1Minecraft, String par2Str, String par3Str, WorldSettings par4WorldSettings) { + super(new File(par1Minecraft.mcDataDir, "saves"), par1Minecraft.getProxy()); + this.setServerOwner(par1Minecraft.getSession().getUsername()); + this.setFolderName(par2Str); + this.setWorldName(par3Str); + this.setDemo(par1Minecraft.isDemo()); + this.canCreateBonusChest(par4WorldSettings.isBonusChestEnabled()); + this.setBuildLimit(256); + this.func_152361_a(new IntegratedPlayerList(this)); + this.mc = par1Minecraft; + this.theWorldSettings = par4WorldSettings; + Reflector.callVoid(Reflector.ModLoader_registerServer, new Object[] {this}); + } + + protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str) { + this.convertMapIfNeeded(par1Str); + ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(par1Str, true); + + if (Reflector.DimensionManager.exists()) { + Object var8 = this.isDemo() ? new DemoWorldServer(this, var7, par2Str, 0, this.theProfiler) : new WorldServerOF(this, var7, par2Str, 0, this.theWorldSettings, this.theProfiler); + Integer[] var9 = (Integer[])((Integer[])Reflector.call(Reflector.DimensionManager_getStaticDimensionIDs, new Object[0])); + Integer[] arr$ = var9; + int len$ = var9.length; + + for (int i$ = 0; i$ < len$; ++i$) { + int dim = arr$[i$].intValue(); + Object world = dim == 0 ? var8 : new WorldServerMultiOF(this, var7, par2Str, dim, this.theWorldSettings, (WorldServer)var8, this.theProfiler); + ((WorldServer)world).addWorldAccess(new WorldManager(this, (WorldServer)world)); + + if (!this.isSinglePlayer()) { + ((WorldServer)world).getWorldInfo().setGameType(this.getGameType()); + } + + if (Reflector.EventBus.exists()) { + Reflector.postForgeBusEvent(Reflector.WorldEvent_Load_Constructor, new Object[] {world}); + } + } + + this.getConfigurationManager().setPlayerManager(new WorldServer[] {(WorldServer)var8}); + } else { + this.worldServers = new WorldServer[3]; + this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; + + for (int var15 = 0; var15 < this.worldServers.length; ++var15) { + byte var16 = 0; + + if (var15 == 1) { + var16 = -1; + } + + if (var15 == 2) { + var16 = 1; + } + + if (var15 == 0) { + if (this.isDemo()) { + this.worldServers[var15] = new DemoWorldServer(this, var7, par2Str, var16, this.theProfiler); + } else { + this.worldServers[var15] = new WorldServerOF(this, var7, par2Str, var16, this.theWorldSettings, this.theProfiler); + } + } else { + this.worldServers[var15] = new WorldServerMultiOF(this, var7, par2Str, var16, this.theWorldSettings, this.worldServers[0], this.theProfiler); + } + + this.worldServers[var15].addWorldAccess(new WorldManager(this, this.worldServers[var15])); + this.getConfigurationManager().setPlayerManager(this.worldServers); + } + } + + this.func_147139_a(this.func_147135_j()); + this.initialWorldChunkLoad(); + } + + /** + * Initialises the server and starts it. + */ + protected boolean startServer() throws IOException { + logger.info("Starting integrated minecraft server version 1.7.10"); + this.setOnlineMode(true); + this.setCanSpawnAnimals(true); + this.setCanSpawnNPCs(true); + this.setAllowPvp(true); + this.setAllowFlight(true); + logger.info("Generating keypair"); + this.setKeyPair(CryptManager.createNewKeyPair()); + Object inst; + + if (Reflector.FMLCommonHandler_handleServerAboutToStart.exists()) { + inst = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + + if (!Reflector.callBoolean(inst, Reflector.FMLCommonHandler_handleServerAboutToStart, new Object[] {this})) { + return false; + } + } + + this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j()); + this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName()); + + if (Reflector.FMLCommonHandler_handleServerStarting.exists()) { + inst = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]); + + if (Reflector.FMLCommonHandler_handleServerStarting.getReturnType() == Boolean.TYPE) { + return Reflector.callBoolean(inst, Reflector.FMLCommonHandler_handleServerStarting, new Object[] {this}); + } + + Reflector.callVoid(inst, Reflector.FMLCommonHandler_handleServerStarting, new Object[] {this}); + } + + return true; + } + + /** + * Main function called by run() every loop. + */ + public void tick() { + boolean var1 = this.isGamePaused; + this.isGamePaused = Minecraft.getMinecraft().getNetHandler() != null && Minecraft.getMinecraft().func_147113_T(); + + if (!var1 && this.isGamePaused) { + logger.info("Saving and pausing game..."); + this.getConfigurationManager().saveAllPlayerData(); + this.saveAllWorlds(false); + } + + if (!this.isGamePaused) { + super.tick(); + + if (this.mc.gameSettings.renderDistanceChunks != this.getConfigurationManager().getViewDistance()) { + logger.info("Changing view distance to {}, from {}", new Object[] {Integer.valueOf(this.mc.gameSettings.renderDistanceChunks), Integer.valueOf(this.getConfigurationManager().getViewDistance())}); + this.getConfigurationManager().func_152611_a(this.mc.gameSettings.renderDistanceChunks); + } + } + } + + public boolean canStructuresSpawn() { + return false; + } + + public GameType getGameType() { + return this.theWorldSettings.getGameType(); + } + + public EnumDifficulty func_147135_j() { + return this.mc.gameSettings.difficulty; + } + + /** + * Defaults to false. + */ + public boolean isHardcore() { + return this.theWorldSettings.getHardcoreEnabled(); + } + + public boolean func_152363_m() { + return false; + } + + protected File getDataDirectory() { + return this.mc.mcDataDir; + } + + public boolean isDedicatedServer() { + return false; + } + + /** + * Called on exit from the main run() loop. + */ + protected void finalTick(CrashReport par1CrashReport) { + this.mc.crashed(par1CrashReport); + } + + /** + * Adds the server info, including from theWorldServer, to the crash report. + */ + public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) { + par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport); + par1CrashReport.getCategory().addCrashSectionCallable("Type", () -> "Integrated Server (map_client.txt)"); + par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", () -> { + String var1 = ClientBrandRetriever.getClientModName(); + + if (!var1.equals("vanilla")) { + return "Definitely; Client brand changed to \'" + var1 + "\'"; + } else { + var1 = IntegratedServer.this.getServerModName(); + return !var1.equals("vanilla") ? "Definitely; Server brand changed to \'" + var1 + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and both client + server brands are untouched."); + } + }); + return par1CrashReport; + } + + public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { + super.addServerStatsToSnooper(par1PlayerUsageSnooper); + par1PlayerUsageSnooper.func_152768_a("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() { + return Minecraft.getMinecraft().isSnooperEnabled(); + } + + /** + * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. + */ + public String shareToLAN(GameType par1EnumGameType, boolean par2) { + try { + int var6 = -1; + + try { + var6 = HttpUtil.func_76181_a(); + } catch (IOException var5) { + ; + } + + if (var6 <= 0) { + var6 = 25564; + } + + this.func_147137_ag().addLanEndpoint((InetAddress)null, var6); + logger.info("Started on " + var6); + this.isPublic = true; + this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), var6 + ""); + this.lanServerPing.start(); + this.getConfigurationManager().func_152604_a(par1EnumGameType); + this.getConfigurationManager().setCommandsAllowedForAll(par2); + return var6 + ""; + } catch (IOException var61) { + return null; + } + } + + /** + * Saves all necessary data as preparation for stopping the server. + */ + public void stopServer() { + super.stopServer(); + + if (this.lanServerPing != null) { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } + } + + /** + * Sets the serverRunning variable to false, in order to get the server to shut down. + */ + public void initiateShutdown() { + super.initiateShutdown(); + + if (this.lanServerPing != null) { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } + } + + /** + * Returns true if this integrated server is open to LAN + */ + public boolean getPublic() { + return this.isPublic; + } + + /** + * Sets the game type for all worlds. + */ + public void setGameType(GameType par1EnumGameType) { + this.getConfigurationManager().func_152604_a(par1EnumGameType); + } + + /** + * Return whether command blocks are enabled. + */ + public boolean isCommandBlockEnabled() { + return true; + } + + public int func_110455_j() { + return 4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/BanEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/BanEntry.java new file mode 100644 index 0000000..7ccadff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/BanEntry.java @@ -0,0 +1,66 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +public abstract class BanEntry extends UserListEntry { + public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); + protected final Date banStartDate; + protected final String bannedBy; + protected final Date banEndDate; + protected final String reason; + + + public BanEntry(Object p_i46334_1_, Date p_i46334_2_, String p_i46334_3_, Date p_i46334_4_, String p_i46334_5_) { + super(p_i46334_1_); + this.banStartDate = p_i46334_2_ == null ? new Date() : p_i46334_2_; + this.bannedBy = p_i46334_3_ == null ? "(Unknown)" : p_i46334_3_; + this.banEndDate = p_i46334_4_; + this.reason = p_i46334_5_ == null ? "Banned by an operator." : p_i46334_5_; + } + + protected BanEntry(Object p_i1174_1_, JsonObject p_i1174_2_) { + super(p_i1174_1_, p_i1174_2_); + Date var3; + + try { + var3 = p_i1174_2_.has("created") ? dateFormat.parse(p_i1174_2_.get("created").getAsString()) : new Date(); + } catch (ParseException var7) { + var3 = new Date(); + } + + this.banStartDate = var3; + this.bannedBy = p_i1174_2_.has("source") ? p_i1174_2_.get("source").getAsString() : "(Unknown)"; + Date var4; + + try { + var4 = p_i1174_2_.has("expires") ? dateFormat.parse(p_i1174_2_.get("expires").getAsString()) : null; + } catch (ParseException var6) { + var4 = null; + } + + this.banEndDate = var4; + this.reason = p_i1174_2_.has("reason") ? p_i1174_2_.get("reason").getAsString() : "Banned by an operator."; + } + + public Date getBanEndDate() { + return this.banEndDate; + } + + public String getBanReason() { + return this.reason; + } + + boolean hasBanExpired() { + return this.banEndDate != null && this.banEndDate.before(new Date()); + } + + protected void func_152641_a(JsonObject p_152641_1_) { + p_152641_1_.addProperty("created", dateFormat.format(this.banStartDate)); + p_152641_1_.addProperty("source", this.bannedBy); + p_152641_1_.addProperty("expires", this.banEndDate == null ? "forever" : dateFormat.format(this.banEndDate)); + p_152641_1_.addProperty("reason", this.reason); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/BanList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/BanList.java new file mode 100644 index 0000000..ab162d0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/BanList.java @@ -0,0 +1,41 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.io.File; +import java.net.SocketAddress; + +public class BanList extends UserList { + + + public BanList(File p_i1490_1_) { + super(p_i1490_1_); + } + + protected UserListEntry func_152682_a(JsonObject p_152682_1_) { + return new IPBanEntry(p_152682_1_); + } + + public boolean func_152708_a(SocketAddress p_152708_1_) { + String var2 = this.func_152707_c(p_152708_1_); + return this.func_152692_d(var2); + } + + public IPBanEntry func_152709_b(SocketAddress p_152709_1_) { + String var2 = this.func_152707_c(p_152709_1_); + return (IPBanEntry)this.func_152683_b(var2); + } + + private String func_152707_c(SocketAddress p_152707_1_) { + String var2 = p_152707_1_.toString(); + + if (var2.contains("/")) { + var2 = var2.substring(var2.indexOf(47) + 1); + } + + if (var2.contains(":")) { + var2 = var2.substring(0, var2.indexOf(58)); + } + + return var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/IPBanEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/IPBanEntry.java new file mode 100644 index 0000000..f75da41 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/IPBanEntry.java @@ -0,0 +1,31 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.util.Date; + +public class IPBanEntry extends BanEntry { + + + public IPBanEntry(String p_i46330_1_) { + this(p_i46330_1_, null, null, null, null); + } + + public IPBanEntry(String p_i1159_1_, Date p_i1159_2_, String p_i1159_3_, Date p_i1159_4_, String p_i1159_5_) { + super(p_i1159_1_, p_i1159_2_, p_i1159_3_, p_i1159_4_, p_i1159_5_); + } + + public IPBanEntry(JsonObject p_i46331_1_) { + super(func_152647_b(p_i46331_1_), p_i46331_1_); + } + + private static String func_152647_b(JsonObject p_152647_0_) { + return p_152647_0_.has("ip") ? p_152647_0_.get("ip").getAsString() : null; + } + + protected void func_152641_a(JsonObject p_152641_1_) { + if (this.func_152640_f() != null) { + p_152641_1_.addProperty("ip", (String)this.func_152640_f()); + super.func_152641_a(p_152641_1_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/ItemInWorldManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/ItemInWorldManager.java new file mode 100644 index 0000000..55715f2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/ItemInWorldManager.java @@ -0,0 +1,302 @@ +package net.minecraft.server.management; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; + +public class ItemInWorldManager { + /** The world object that this object is connected to. */ + public World theWorld; + + /** The EntityPlayerMP object that this object is connected to. */ + public EntityPlayerMP thisPlayerMP; + private WorldSettings.GameType gameType; + + /** True if the player is destroying a block */ + private boolean isDestroyingBlock; + private int initialDamage; + private int partiallyDestroyedBlockX; + private int partiallyDestroyedBlockY; + private int partiallyDestroyedBlockZ; + private int curblockDamage; + + /** + * Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The + * block will not be destroyed while this is false. + */ + private boolean receivedFinishDiggingPacket; + private int posX; + private int posY; + private int posZ; + private int initialBlockDamage; + private int durabilityRemainingOnBlock; + + + public ItemInWorldManager(World p_i1524_1_) { + this.gameType = WorldSettings.GameType.NOT_SET; + this.durabilityRemainingOnBlock = -1; + this.theWorld = p_i1524_1_; + } + + public void setGameType(WorldSettings.GameType p_73076_1_) { + this.gameType = p_73076_1_; + p_73076_1_.configurePlayerCapabilities(this.thisPlayerMP.capabilities); + this.thisPlayerMP.sendPlayerAbilities(); + } + + public WorldSettings.GameType getGameType() { + return this.gameType; + } + + /** + * Get if we are in creative game mode. + */ + public boolean isCreative() { + return this.gameType.isCreative(); + } + + /** + * if the gameType is currently NOT_SET then change it to par1 + */ + public void initializeGameType(WorldSettings.GameType p_73077_1_) { + if (this.gameType == WorldSettings.GameType.NOT_SET) { + this.gameType = p_73077_1_; + } + + this.setGameType(this.gameType); + } + + public void updateBlockRemoving() { + ++this.curblockDamage; + float var3; + int var4; + + if (this.receivedFinishDiggingPacket) { + int var1 = this.curblockDamage - this.initialBlockDamage; + Block var2 = this.theWorld.getBlock(this.posX, this.posY, this.posZ); + + if (var2.getMaterial() == Material.air) { + this.receivedFinishDiggingPacket = false; + } else { + var3 = var2.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.posX, this.posY, this.posZ) * (float)(var1 + 1); + var4 = (int)(var3 * 10.0F); + + if (var4 != this.durabilityRemainingOnBlock) { + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.posX, this.posY, this.posZ, var4); + this.durabilityRemainingOnBlock = var4; + } + + if (var3 >= 1.0F) { + this.receivedFinishDiggingPacket = false; + this.tryHarvestBlock(this.posX, this.posY, this.posZ); + } + } + } else if (this.isDestroyingBlock) { + Block var5 = this.theWorld.getBlock(this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ); + + if (var5.getMaterial() == Material.air) { + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + this.durabilityRemainingOnBlock = -1; + this.isDestroyingBlock = false; + } else { + int var6 = this.curblockDamage - this.initialDamage; + var3 = var5.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ) * (float)(var6 + 1); + var4 = (int)(var3 * 10.0F); + + if (var4 != this.durabilityRemainingOnBlock) { + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, var4); + this.durabilityRemainingOnBlock = var4; + } + } + } + } + + /** + * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific + * side. tryHarvestBlock can also be the result of this call + */ + public void onBlockClicked(int p_73074_1_, int p_73074_2_, int p_73074_3_, int p_73074_4_) { + if (!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(p_73074_1_, p_73074_2_, p_73074_3_)) { + if (this.isCreative()) { + if (!this.theWorld.extinguishFire(null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_)) { + this.tryHarvestBlock(p_73074_1_, p_73074_2_, p_73074_3_); + } + } else { + this.theWorld.extinguishFire(null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + this.initialDamage = this.curblockDamage; + float var5 = 1.0F; + Block var6 = this.theWorld.getBlock(p_73074_1_, p_73074_2_, p_73074_3_); + + if (var6.getMaterial() != Material.air) { + var6.onBlockClicked(this.theWorld, p_73074_1_, p_73074_2_, p_73074_3_, this.thisPlayerMP); + var5 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, p_73074_1_, p_73074_2_, p_73074_3_); + } + + if (var6.getMaterial() != Material.air && var5 >= 1.0F) { + this.tryHarvestBlock(p_73074_1_, p_73074_2_, p_73074_3_); + } else { + this.isDestroyingBlock = true; + this.partiallyDestroyedBlockX = p_73074_1_; + this.partiallyDestroyedBlockY = p_73074_2_; + this.partiallyDestroyedBlockZ = p_73074_3_; + int var7 = (int)(var5 * 10.0F); + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), p_73074_1_, p_73074_2_, p_73074_3_, var7); + this.durabilityRemainingOnBlock = var7; + } + } + } + } + + public void uncheckedTryHarvestBlock(int p_73082_1_, int p_73082_2_, int p_73082_3_) { + if (p_73082_1_ == this.partiallyDestroyedBlockX && p_73082_2_ == this.partiallyDestroyedBlockY && p_73082_3_ == this.partiallyDestroyedBlockZ) { + int var4 = this.curblockDamage - this.initialDamage; + Block var5 = this.theWorld.getBlock(p_73082_1_, p_73082_2_, p_73082_3_); + + if (var5.getMaterial() != Material.air) { + float var6 = var5.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, p_73082_1_, p_73082_2_, p_73082_3_) * (float)(var4 + 1); + + if (var6 >= 0.7F) { + this.isDestroyingBlock = false; + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), p_73082_1_, p_73082_2_, p_73082_3_, -1); + this.tryHarvestBlock(p_73082_1_, p_73082_2_, p_73082_3_); + } else if (!this.receivedFinishDiggingPacket) { + this.isDestroyingBlock = false; + this.receivedFinishDiggingPacket = true; + this.posX = p_73082_1_; + this.posY = p_73082_2_; + this.posZ = p_73082_3_; + this.initialBlockDamage = this.initialDamage; + } + } + } + } + + /** + * note: this ignores the pars passed in and continues to destroy the onClickedBlock + */ + public void cancelDestroyingBlock(int p_73073_1_, int p_73073_2_, int p_73073_3_) { + this.isDestroyingBlock = false; + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + } + + /** + * Removes a block and triggers the appropriate events + */ + private boolean removeBlock(int p_73079_1_, int p_73079_2_, int p_73079_3_) { + Block var4 = this.theWorld.getBlock(p_73079_1_, p_73079_2_, p_73079_3_); + int var5 = this.theWorld.getBlockMetadata(p_73079_1_, p_73079_2_, p_73079_3_); + var4.onBlockHarvested(this.theWorld, p_73079_1_, p_73079_2_, p_73079_3_, var5, this.thisPlayerMP); + boolean var6 = this.theWorld.setBlockToAir(p_73079_1_, p_73079_2_, p_73079_3_); + + if (var6) { + var4.onBlockDestroyedByPlayer(this.theWorld, p_73079_1_, p_73079_2_, p_73079_3_, var5); + } + + return var6; + } + + /** + * Attempts to harvest a block at the given coordinate + */ + public boolean tryHarvestBlock(int p_73084_1_, int p_73084_2_, int p_73084_3_) { + if (this.gameType.isAdventure() && !this.thisPlayerMP.isCurrentToolAdventureModeExempt(p_73084_1_, p_73084_2_, p_73084_3_)) { + return false; + } else if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) { + return false; + } else { + Block var4 = this.theWorld.getBlock(p_73084_1_, p_73084_2_, p_73084_3_); + int var5 = this.theWorld.getBlockMetadata(p_73084_1_, p_73084_2_, p_73084_3_); + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, p_73084_1_, p_73084_2_, p_73084_3_, Block.getIdFromBlock(var4) + (this.theWorld.getBlockMetadata(p_73084_1_, p_73084_2_, p_73084_3_) << 12)); + boolean var6 = this.removeBlock(p_73084_1_, p_73084_2_, p_73084_3_); + + if (this.isCreative()) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73084_1_, p_73084_2_, p_73084_3_, this.theWorld)); + } else { + ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem(); + boolean var8 = this.thisPlayerMP.canHarvestBlock(var4); + + if (var7 != null) { + var7.func_150999_a(this.theWorld, var4, p_73084_1_, p_73084_2_, p_73084_3_, this.thisPlayerMP); + + if (var7.stackSize == 0) { + this.thisPlayerMP.destroyCurrentEquippedItem(); + } + } + + if (var6 && var8) { + var4.harvestBlock(this.theWorld, this.thisPlayerMP, p_73084_1_, p_73084_2_, p_73084_3_, var5); + } + } + + return var6; + } + } + + /** + * Attempts to right-click use an item by the given EntityPlayer in the given World + */ + public boolean tryUseItem(EntityPlayer p_73085_1_, World p_73085_2_, ItemStack p_73085_3_) { + int var4 = p_73085_3_.stackSize; + int var5 = p_73085_3_.getItemDamage(); + ItemStack var6 = p_73085_3_.useItemRightClick(p_73085_2_, p_73085_1_); + + if (var6 == p_73085_3_ && (var6 == null || var6.stackSize == var4 && var6.getMaxItemUseDuration() <= 0 && var6.getItemDamage() == var5)) { + return false; + } else { + p_73085_1_.inventory.mainInventory[p_73085_1_.inventory.currentItem] = var6; + + if (this.isCreative()) { + var6.stackSize = var4; + + if (var6.isItemStackDamageable()) { + var6.setItemDamage(var5); + } + } + + if (var6.stackSize == 0) { + p_73085_1_.inventory.mainInventory[p_73085_1_.inventory.currentItem] = null; + } + + if (!p_73085_1_.isUsingItem()) { + ((EntityPlayerMP)p_73085_1_).sendContainerToPlayer(p_73085_1_.inventoryContainer); + } + + return true; + } + } + + /** + * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, + * xOffset, yOffset, zOffset + */ + public boolean activateBlockOrUseItem(EntityPlayer p_73078_1_, World p_73078_2_, ItemStack p_73078_3_, int p_73078_4_, int p_73078_5_, int p_73078_6_, int p_73078_7_, float p_73078_8_, float p_73078_9_, float p_73078_10_) { + if ((!p_73078_1_.isSneaking() || p_73078_1_.getHeldItem() == null) && p_73078_2_.getBlock(p_73078_4_, p_73078_5_, p_73078_6_).onBlockActivated(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_1_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_)) { + return true; + } else if (p_73078_3_ == null) { + return false; + } else if (this.isCreative()) { + int var11 = p_73078_3_.getItemDamage(); + int var12 = p_73078_3_.stackSize; + boolean var13 = p_73078_3_.tryPlaceItemIntoWorld(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); + p_73078_3_.setItemDamage(var11); + p_73078_3_.stackSize = var12; + return var13; + } else { + return p_73078_3_.tryPlaceItemIntoWorld(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); + } + } + + /** + * Sets the world instance. + */ + public void setWorld(WorldServer p_73080_1_) { + this.theWorld = p_73080_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/LowerStringMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/LowerStringMap.java new file mode 100644 index 0000000..0e242b0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/LowerStringMap.java @@ -0,0 +1,70 @@ +package net.minecraft.server.management; + +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +public class LowerStringMap implements Map { + private final Map internalMap = new LinkedHashMap(); + + + public int size() { + return this.internalMap.size(); + } + + public boolean isEmpty() { + return this.internalMap.isEmpty(); + } + + public boolean containsKey(Object p_containsKey_1_) { + return this.internalMap.containsKey(p_containsKey_1_.toString().toLowerCase()); + } + + public boolean containsValue(Object p_containsValue_1_) { + return this.internalMap.containsKey(p_containsValue_1_); + } + + public Object get(Object p_get_1_) { + return this.internalMap.get(p_get_1_.toString().toLowerCase()); + } + + public Object put(String p_put_1_, Object p_put_2_) { + return this.internalMap.put(p_put_1_.toLowerCase(), p_put_2_); + } + + public Object remove(Object p_remove_1_) { + return this.internalMap.remove(p_remove_1_.toString().toLowerCase()); + } + + public void putAll(Map p_putAll_1_) { + Iterator var2 = p_putAll_1_.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + this.put((String)var3.getKey(), var3.getValue()); + } + } + + public void clear() { + this.internalMap.clear(); + } + + public Set keySet() { + return this.internalMap.keySet(); + } + + public Collection values() { + return this.internalMap.values(); + } + + public Set entrySet() { + return this.internalMap.entrySet(); + } + + public Object put(Object p_put_1_, Object p_put_2_) { + return this.put((String)p_put_1_, p_put_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerManager.java new file mode 100644 index 0000000..88cfb65 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerManager.java @@ -0,0 +1,582 @@ +package net.minecraft.server.management; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.src.CompactArrayList; +import net.minecraft.src.Config; +import net.minecraft.src.Reflector; +import net.minecraft.src.ReflectorForge; +import net.minecraft.src.WorldServerOF; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PlayerManager { + private static final Logger field_152627_a = LogManager.getLogger(); + private final WorldServer theWorldServer; + + /** players in the current instance */ + private final List players = new ArrayList(); + + /** + * A map of chunk position (two ints concatenated into a long) to PlayerInstance + */ + private final LongHashMap playerInstances = new LongHashMap(); + + /** + * contains a PlayerInstance for every chunk they can see. the "player instance" cotains a list of all players who + * can also that chunk + */ + private final List chunkWatcherWithPlayers = new ArrayList(); + + /** This field is using when chunk should be processed (every 8000 ticks) */ + private final List playerInstanceList = new ArrayList(); + public CompactArrayList chunkCoordsNotLoaded = new CompactArrayList(100, 0.8F); + + /** + * Number of chunks the server sends to the client. Valid 3<=x<=15. In server.properties. + */ + private int playerViewRadius; + + /** time what is using to check if InhabitedTime should be calculated */ + private long previousTotalWorldTime; + + /** x, z direction vectors: east, south, west, north */ + private final int[][] xzDirectionsConst = new int[][] {{1, 0}, {0, 1}, { -1, 0}, {0, -1}}; + + public PlayerManager(WorldServer par1Minecraft) { + this.theWorldServer = par1Minecraft; + this.func_152622_a(par1Minecraft.func_73046_m().getConfigurationManager().getViewDistance()); + } + + public WorldServer getWorldServer() { + return this.theWorldServer; + } + + /** + * updates all the player instances that need to be updated + */ + public void updatePlayerInstances() { + long var1 = this.theWorldServer.getTotalWorldTime(); + int var3; + PlayerManager.PlayerInstance var4; + + if (var1 - this.previousTotalWorldTime > 8000L) { + this.previousTotalWorldTime = var1; + + for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3) { + var4 = (PlayerManager.PlayerInstance)this.playerInstanceList.get(var3); + var4.sendChunkUpdate(); + var4.processChunk(); + } + } else { + for (var3 = 0; var3 < this.chunkWatcherWithPlayers.size(); ++var3) { + var4 = (PlayerManager.PlayerInstance)this.chunkWatcherWithPlayers.get(var3); + var4.sendChunkUpdate(); + } + } + + this.chunkWatcherWithPlayers.clear(); + + if (this.players.isEmpty()) { + WorldProvider ip = this.theWorldServer.provider; + + if (!ip.canRespawnHere()) { + this.theWorldServer.theChunkProviderServer.unloadAllChunks(); + } + } + + if (this.chunkCoordsNotLoaded.size() > 0) { + for (int var22 = 0; var22 < this.players.size(); ++var22) { + EntityPlayerMP player = (EntityPlayerMP)this.players.get(var22); + int px = player.chunkCoordX; + int pz = player.chunkCoordZ; + int maxRadius = this.playerViewRadius + 1; + int maxRadius2 = maxRadius / 2; + int maxDistSq = maxRadius * maxRadius + maxRadius2 * maxRadius2; + int bestDistSq = maxDistSq; + int bestIndex = -1; + PlayerManager.PlayerInstance bestCw = null; + ChunkCoordIntPair bestCoords = null; + + for (int chunk = 0; chunk < this.chunkCoordsNotLoaded.size(); ++chunk) { + ChunkCoordIntPair coords = (ChunkCoordIntPair)this.chunkCoordsNotLoaded.get(chunk); + + if (coords != null) { + PlayerManager.PlayerInstance cw = this.getOrCreateChunkWatcher(coords.chunkXPos, coords.chunkZPos, false); + + if (cw != null && !cw.chunkLoaded) { + int dx = px - coords.chunkXPos; + int dz = pz - coords.chunkZPos; + int distSq = dx * dx + dz * dz; + + if (distSq < bestDistSq) { + bestDistSq = distSq; + bestIndex = chunk; + bestCw = cw; + bestCoords = coords; + } + } else { + this.chunkCoordsNotLoaded.set(chunk, (Object)null); + } + } + } + + if (bestIndex >= 0) { + this.chunkCoordsNotLoaded.set(bestIndex, (Object)null); + } + + if (bestCw != null) { + bestCw.chunkLoaded = true; + this.getWorldServer().theChunkProviderServer.loadChunk(bestCoords.chunkXPos, bestCoords.chunkZPos); + bestCw.sendThisChunkToAllPlayers(); + break; + } + } + + this.chunkCoordsNotLoaded.compact(); + } + } + + public boolean func_152621_a(int p_152621_1_, int p_152621_2_) { + long var3 = (long)p_152621_1_ + 2147483647L | (long)p_152621_2_ + 2147483647L << 32; + return this.playerInstances.getValueByKey(var3) != null; + } + + public PlayerManager.PlayerInstance getOrCreateChunkWatcher(int par1, int par2, boolean par3) { + return this.getOrCreateChunkWatcher(par1, par2, par3, false); + } + + public PlayerManager.PlayerInstance getOrCreateChunkWatcher(int par1, int par2, boolean par3, boolean lazy) { + long var4 = (long)par1 + 2147483647L | (long)par2 + 2147483647L << 32; + PlayerManager.PlayerInstance var6 = (PlayerManager.PlayerInstance)this.playerInstances.getValueByKey(var4); + + if (var6 == null && par3) { + var6 = new PlayerManager.PlayerInstance(par1, par2, lazy); + this.playerInstances.add(var4, var6); + this.playerInstanceList.add(var6); + } + + return var6; + } + + public void func_151250_a(int p_151250_1_, int p_151250_2_, int p_151250_3_) { + int var4 = p_151250_1_ >> 4; + int var5 = p_151250_3_ >> 4; + PlayerManager.PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); + + if (var6 != null) { + var6.func_151253_a(p_151250_1_ & 15, p_151250_2_, p_151250_3_ & 15); + } + } + + /** + * Adds an EntityPlayerMP to the PlayerManager. + */ + public void addPlayer(EntityPlayerMP par1EntityPlayerMP) { + int var2 = (int)par1EntityPlayerMP.posX >> 4; + int var3 = (int)par1EntityPlayerMP.posZ >> 4; + par1EntityPlayerMP.managedPosX = par1EntityPlayerMP.posX; + par1EntityPlayerMP.managedPosZ = par1EntityPlayerMP.posZ; + ArrayList spawnList = new ArrayList(1); + + for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { + for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { + this.getOrCreateChunkWatcher(var4, var5, true).addPlayer(par1EntityPlayerMP); + + if (var4 >= var2 - 1 && var4 <= var2 + 1 && var5 >= var3 - 1 && var5 <= var3 + 1) { + Chunk spawnChunk = this.getWorldServer().theChunkProviderServer.loadChunk(var4, var5); + spawnList.add(spawnChunk); + } + } + } + + par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(spawnList)); + this.players.add(par1EntityPlayerMP); + this.filterChunkLoadQueue(par1EntityPlayerMP); + } + + /** + * Removes all chunks from the given player's chunk load queue that are not in viewing range of the player. + */ + public void filterChunkLoadQueue(EntityPlayerMP par1EntityPlayerMP) { + ArrayList var2 = new ArrayList(par1EntityPlayerMP.loadedChunks); + int var3 = 0; + int var4 = this.playerViewRadius; + int var5 = (int)par1EntityPlayerMP.posX >> 4; + int var6 = (int)par1EntityPlayerMP.posZ >> 4; + int var7 = 0; + int var8 = 0; + ChunkCoordIntPair var9 = this.getOrCreateChunkWatcher(var5, var6, true).chunkLocation; + par1EntityPlayerMP.loadedChunks.clear(); + + if (var2.contains(var9)) { + par1EntityPlayerMP.loadedChunks.add(var9); + } + + int var10; + + for (var10 = 1; var10 <= var4 * 2; ++var10) { + for (int var11 = 0; var11 < 2; ++var11) { + int[] var12 = this.xzDirectionsConst[var3++ % 4]; + + for (int var13 = 0; var13 < var10; ++var13) { + var7 += var12[0]; + var8 += var12[1]; + var9 = this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true).chunkLocation; + + if (var2.contains(var9)) { + par1EntityPlayerMP.loadedChunks.add(var9); + } + } + } + } + + var3 %= 4; + + for (var10 = 0; var10 < var4 * 2; ++var10) { + var7 += this.xzDirectionsConst[var3][0]; + var8 += this.xzDirectionsConst[var3][1]; + var9 = this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true).chunkLocation; + + if (var2.contains(var9)) { + par1EntityPlayerMP.loadedChunks.add(var9); + } + } + } + + /** + * Removes an EntityPlayerMP from the PlayerManager. + */ + public void removePlayer(EntityPlayerMP par1EntityPlayerMP) { + int var2 = (int)par1EntityPlayerMP.managedPosX >> 4; + int var3 = (int)par1EntityPlayerMP.managedPosZ >> 4; + + for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { + for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { + PlayerManager.PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); + + if (var6 != null) { + var6.removePlayer(par1EntityPlayerMP, false); + } + } + } + + this.players.remove(par1EntityPlayerMP); + } + + /** + * Determine if two rectangles centered at the given points overlap for the provided radius. Arguments: x1, z1, x2, + * z2, radius. + */ + private boolean overlaps(int par1, int par2, int par3, int par4, int par5) { + int var6 = par1 - par3; + int var7 = par2 - par4; + return var6 >= -par5 && var6 <= par5 ? var7 >= -par5 && var7 <= par5 : false; + } + + /** + * update chunks around a player being moved by server logic (e.g. cart, boat) + */ + public void updateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP) { + int var2 = (int)par1EntityPlayerMP.posX >> 4; + int var3 = (int)par1EntityPlayerMP.posZ >> 4; + double var4 = par1EntityPlayerMP.managedPosX - par1EntityPlayerMP.posX; + double var6 = par1EntityPlayerMP.managedPosZ - par1EntityPlayerMP.posZ; + double var8 = var4 * var4 + var6 * var6; + + if (var8 >= 64.0D) { + int var10 = (int)par1EntityPlayerMP.managedPosX >> 4; + int var11 = (int)par1EntityPlayerMP.managedPosZ >> 4; + int var12 = this.playerViewRadius; + int var13 = var2 - var10; + int var14 = var3 - var11; + + if (var13 != 0 || var14 != 0) { + WorldServerOF worldServerOf = null; + + if (this.theWorldServer instanceof WorldServerOF) { + worldServerOf = (WorldServerOF)this.theWorldServer; + } + + for (int var15 = var2 - var12; var15 <= var2 + var12; ++var15) { + for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16) { + if (!this.overlaps(var15, var16, var10, var11, var12)) { + this.getOrCreateChunkWatcher(var15, var16, true, true).addPlayer(par1EntityPlayerMP); + + if (worldServerOf != null) { + worldServerOf.addChunkToTickOnce(var15, var16); + } + } + + if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12)) { + PlayerManager.PlayerInstance var17 = this.getOrCreateChunkWatcher(var15 - var13, var16 - var14, false); + + if (var17 != null) { + var17.removePlayer(par1EntityPlayerMP); + } + } + } + } + + this.filterChunkLoadQueue(par1EntityPlayerMP); + par1EntityPlayerMP.managedPosX = par1EntityPlayerMP.posX; + par1EntityPlayerMP.managedPosZ = par1EntityPlayerMP.posZ; + } + } + } + + public boolean isPlayerWatchingChunk(EntityPlayerMP par1EntityPlayerMP, int par2, int par3) { + PlayerManager.PlayerInstance var4 = this.getOrCreateChunkWatcher(par2, par3, false); + return var4 != null && var4.playersWatchingChunk.contains(par1EntityPlayerMP) && !par1EntityPlayerMP.loadedChunks.contains(var4.chunkLocation); + } + + public void func_152622_a(int p_152622_1_) { + p_152622_1_ = MathHelper.clamp_int(p_152622_1_, 3, 32); + + if (p_152622_1_ != this.playerViewRadius) { + int var2 = p_152622_1_ - this.playerViewRadius; + + for (Object player : this.players) { + EntityPlayerMP var4 = (EntityPlayerMP) player; + int var5 = (int) var4.posX >> 4; + int var6 = (int) var4.posZ >> 4; + int var7; + int var8; + + if (var2 > 0) { + for (var7 = var5 - p_152622_1_; var7 <= var5 + p_152622_1_; ++var7) { + for (var8 = var6 - p_152622_1_; var8 <= var6 + p_152622_1_; ++var8) { + PlayerInstance var9 = this.getOrCreateChunkWatcher(var7, var8, true, true); + + if (!var9.playersWatchingChunk.contains(var4)) { + var9.addPlayer(var4); + } + } + } + } else { + for (var7 = var5 - this.playerViewRadius; var7 <= var5 + this.playerViewRadius; ++var7) { + for (var8 = var6 - this.playerViewRadius; var8 <= var6 + this.playerViewRadius; ++var8) { + if (!this.overlaps(var7, var8, var5, var6, p_152622_1_)) { + this.getOrCreateChunkWatcher(var7, var8, true).removePlayer(var4); + } + } + } + } + } + + this.playerViewRadius = p_152622_1_; + } + } + + /** + * Get the furthest viewable block given player's view distance + */ + public static int getFurthestViewableBlock(int par0) { + return par0 * 16 - 16; + } + + public class PlayerInstance { + private final List playersWatchingChunk; + private final ChunkCoordIntPair chunkLocation; + private short[] field_151254_d; + private int numberOfTilesToUpdate; + private int flagsYAreasToUpdate; + private long previousWorldTime; + public boolean chunkLoaded; + + public PlayerInstance(int par2, int par3) { + this(par2, par3, false); + } + + public PlayerInstance(int par2, int par3, boolean lazy) { + this.playersWatchingChunk = new ArrayList(); + this.field_151254_d = new short[64]; + this.chunkLoaded = false; + this.chunkLocation = new ChunkCoordIntPair(par2, par3); + boolean useLazy = lazy && Config.isLazyChunkLoading(); + + if (useLazy && !PlayerManager.this.getWorldServer().theChunkProviderServer.chunkExists(par2, par3)) { + PlayerManager.this.chunkCoordsNotLoaded.add(this.chunkLocation); + this.chunkLoaded = false; + } else { + PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(par2, par3); + this.chunkLoaded = true; + } + } + + public void addPlayer(EntityPlayerMP par1EntityPlayerMP) { + if (this.playersWatchingChunk.contains(par1EntityPlayerMP)) { + PlayerManager.field_152627_a.debug("Failed to add player. {} already is in chunk {}, {}", new Object[] {par1EntityPlayerMP, Integer.valueOf(this.chunkLocation.chunkXPos), Integer.valueOf(this.chunkLocation.chunkZPos)}); + } else { + if (this.playersWatchingChunk.isEmpty()) { + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + this.playersWatchingChunk.add(par1EntityPlayerMP); + par1EntityPlayerMP.loadedChunks.add(this.chunkLocation); + } + } + + public void removePlayer(EntityPlayerMP par1EntityPlayerMP) { + this.removePlayer(par1EntityPlayerMP, true); + } + + public void removePlayer(EntityPlayerMP par1EntityPlayerMP, boolean sendData) { + if (this.playersWatchingChunk.contains(par1EntityPlayerMP)) { + Chunk var2 = PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); + + if (sendData && var2.func_150802_k()) { + par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S21PacketChunkData(var2, true, 0)); + } + + this.playersWatchingChunk.remove(par1EntityPlayerMP); + par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); + + if (Reflector.EventBus.exists()) { + Reflector.postForgeBusEvent(Reflector.ChunkWatchEvent_UnWatch_Constructor, new Object[] {this.chunkLocation, par1EntityPlayerMP}); + } + + if (this.playersWatchingChunk.isEmpty()) { + long var3 = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; + this.increaseInhabitedTime(var2); + PlayerManager.this.playerInstances.remove(var3); + PlayerManager.this.playerInstanceList.remove(this); + + if (this.numberOfTilesToUpdate > 0) { + PlayerManager.this.chunkWatcherWithPlayers.remove(this); + } + + if (this.chunkLoaded) { + PlayerManager.this.getWorldServer().theChunkProviderServer.unloadChunksIfNotNearSpawn(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); + } + } + } + } + + public void processChunk() { + this.increaseInhabitedTime(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos)); + } + + private void increaseInhabitedTime(Chunk par1Chunk) { + par1Chunk.inhabitedTime += PlayerManager.this.theWorldServer.getTotalWorldTime() - this.previousWorldTime; + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + public void func_151253_a(int p_151253_1_, int p_151253_2_, int p_151253_3_) { + if (this.numberOfTilesToUpdate == 0) { + PlayerManager.this.chunkWatcherWithPlayers.add(this); + } + + this.flagsYAreasToUpdate |= 1 << (p_151253_2_ >> 4); + + if (this.numberOfTilesToUpdate < 64) { + short var4 = (short)(p_151253_1_ << 12 | p_151253_3_ << 8 | p_151253_2_); + + for (int var5 = 0; var5 < this.numberOfTilesToUpdate; ++var5) { + if (this.field_151254_d[var5] == var4) { + return; + } + } + + this.field_151254_d[this.numberOfTilesToUpdate++] = var4; + } + } + + public void func_151251_a(Packet p_151251_1_) { + for (int var2 = 0; var2 < this.playersWatchingChunk.size(); ++var2) { + EntityPlayerMP var3 = (EntityPlayerMP)this.playersWatchingChunk.get(var2); + + if (!var3.loadedChunks.contains(this.chunkLocation)) { + var3.playerNetServerHandler.sendPacket(p_151251_1_); + } + } + } + + public void sendChunkUpdate() { + if (this.numberOfTilesToUpdate != 0) { + int var1; + int var2; + int var3; + + if (this.numberOfTilesToUpdate == 1) { + var1 = this.chunkLocation.chunkXPos * 16 + (this.field_151254_d[0] >> 12 & 15); + var2 = this.field_151254_d[0] & 255; + var3 = this.chunkLocation.chunkZPos * 16 + (this.field_151254_d[0] >> 8 & 15); + this.func_151251_a(new S23PacketBlockChange(var1, var2, var3, PlayerManager.this.theWorldServer)); + + if (ReflectorForge.blockHasTileEntity(PlayerManager.this.theWorldServer, var1, var2, var3)) { + this.func_151252_a(PlayerManager.this.theWorldServer.getTileEntity(var1, var2, var3)); + } + } else { + int var4; + + if (this.numberOfTilesToUpdate == 64) { + var1 = this.chunkLocation.chunkXPos * 16; + var2 = this.chunkLocation.chunkZPos * 16; + this.func_151251_a(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); + + for (var3 = 0; var3 < 16; ++var3) { + if ((this.flagsYAreasToUpdate & 1 << var3) != 0) { + var4 = var3 << 4; + List var5 = PlayerManager.this.theWorldServer.func_147486_a(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16); + + for (int var6 = 0; var6 < var5.size(); ++var6) { + this.func_151252_a((TileEntity)var5.get(var6)); + } + } + } + } else { + this.func_151251_a(new S22PacketMultiBlockChange(this.numberOfTilesToUpdate, this.field_151254_d, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos))); + + for (var1 = 0; var1 < this.numberOfTilesToUpdate; ++var1) { + var2 = this.chunkLocation.chunkXPos * 16 + (this.field_151254_d[var1] >> 12 & 15); + var3 = this.field_151254_d[var1] & 255; + var4 = this.chunkLocation.chunkZPos * 16 + (this.field_151254_d[var1] >> 8 & 15); + + if (ReflectorForge.blockHasTileEntity(PlayerManager.this.theWorldServer, var2, var3, var4)) { + this.func_151252_a(PlayerManager.this.theWorldServer.getTileEntity(var2, var3, var4)); + } + } + } + } + + this.numberOfTilesToUpdate = 0; + this.flagsYAreasToUpdate = 0; + } + } + + private void func_151252_a(TileEntity p_151252_1_) { + if (p_151252_1_ != null) { + Packet var2 = p_151252_1_.getDescriptionPacket(); + + if (var2 != null) { + this.func_151251_a(var2); + } + } + } + + public void sendThisChunkToAllPlayers() { + for (int i = 0; i < this.playersWatchingChunk.size(); ++i) { + EntityPlayerMP player = (EntityPlayerMP)this.playersWatchingChunk.get(i); + Chunk chunk = PlayerManager.this.getWorldServer().getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); + ArrayList list = new ArrayList(1); + list.add(chunk); + player.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(list)); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerPositionComparator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerPositionComparator.java new file mode 100644 index 0000000..70f0b13 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerPositionComparator.java @@ -0,0 +1,24 @@ +package net.minecraft.server.management; + +import java.util.Comparator; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ChunkCoordinates; + +public class PlayerPositionComparator implements Comparator { + private final ChunkCoordinates theChunkCoordinates; + + + public PlayerPositionComparator(ChunkCoordinates p_i1499_1_) { + this.theChunkCoordinates = p_i1499_1_; + } + + public int compare(EntityPlayerMP p_compare_1_, EntityPlayerMP p_compare_2_) { + double var3 = p_compare_1_.getDistanceSq(this.theChunkCoordinates.posX, this.theChunkCoordinates.posY, this.theChunkCoordinates.posZ); + double var5 = p_compare_2_.getDistanceSq(this.theChunkCoordinates.posX, this.theChunkCoordinates.posY, this.theChunkCoordinates.posZ); + return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) { + return this.compare((EntityPlayerMP)p_compare_1_, (EntityPlayerMP)p_compare_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerProfileCache.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerProfileCache.java new file mode 100644 index 0000000..993ae8d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PlayerProfileCache.java @@ -0,0 +1,361 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.mojang.authlib.Agent; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.ProfileLookupCallback; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import org.apache.commons.io.IOUtils; + +public class PlayerProfileCache { + public static final SimpleDateFormat field_152659_a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); + private final Map field_152661_c = Maps.newHashMap(); + private final Map field_152662_d = Maps.newHashMap(); + private final LinkedList field_152663_e = Lists.newLinkedList(); + private final MinecraftServer field_152664_f; + protected final Gson field_152660_b; + private final File field_152665_g; + private static final ParameterizedType field_152666_h = new ParameterizedType() { + + public Type[] getActualTypeArguments() { + return new Type[] {PlayerProfileCache.ProfileEntry.class}; + } + public Type getRawType() { + return List.class; + } + public Type getOwnerType() { + return null; + } + }; + + + public PlayerProfileCache(MinecraftServer p_i1171_1_, File p_i1171_2_) { + this.field_152664_f = p_i1171_1_; + this.field_152665_g = p_i1171_2_; + GsonBuilder var3 = new GsonBuilder(); + var3.registerTypeHierarchyAdapter(PlayerProfileCache.ProfileEntry.class, new PlayerProfileCache.Serializer(null)); + this.field_152660_b = var3.create(); + this.func_152657_b(); + } + + private static GameProfile func_152650_a(MinecraftServer p_152650_0_, String p_152650_1_) { + final GameProfile[] var2 = new GameProfile[1]; + ProfileLookupCallback var3 = new ProfileLookupCallback() { + + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) { + var2[0] = p_onProfileLookupSucceeded_1_; + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) { + var2[0] = null; + } + }; + p_152650_0_.func_152359_aw().findProfilesByNames(new String[] {p_152650_1_}, Agent.MINECRAFT, var3); + + if (!p_152650_0_.isServerInOnlineMode() && var2[0] == null) { + UUID var4 = EntityPlayer.func_146094_a(new GameProfile(null, p_152650_1_)); + GameProfile var5 = new GameProfile(var4, p_152650_1_); + var3.onProfileLookupSucceeded(var5); + } + + return var2[0]; + } + + public void func_152649_a(GameProfile p_152649_1_) { + this.func_152651_a(p_152649_1_, null); + } + + private void func_152651_a(GameProfile p_152651_1_, Date p_152651_2_) { + UUID var3 = p_152651_1_.getId(); + + if (p_152651_2_ == null) { + Calendar var4 = Calendar.getInstance(); + var4.setTime(new Date()); + var4.add(2, 1); + p_152651_2_ = var4.getTime(); + } + + String var10 = p_152651_1_.getName().toLowerCase(Locale.ROOT); + PlayerProfileCache.ProfileEntry var5 = new PlayerProfileCache.ProfileEntry(p_152651_1_, p_152651_2_, null); + LinkedList var6 = this.field_152663_e; + + synchronized (this.field_152663_e) { + if (this.field_152662_d.containsKey(var3)) { + PlayerProfileCache.ProfileEntry var7 = (PlayerProfileCache.ProfileEntry)this.field_152662_d.get(var3); + this.field_152661_c.remove(var7.func_152668_a().getName().toLowerCase(Locale.ROOT)); + this.field_152661_c.put(p_152651_1_.getName().toLowerCase(Locale.ROOT), var5); + this.field_152663_e.remove(p_152651_1_); + } else { + this.field_152662_d.put(var3, var5); + this.field_152661_c.put(var10, var5); + } + + this.field_152663_e.addFirst(p_152651_1_); + } + } + + public GameProfile func_152655_a(String p_152655_1_) { + String var2 = p_152655_1_.toLowerCase(Locale.ROOT); + PlayerProfileCache.ProfileEntry var3 = (PlayerProfileCache.ProfileEntry)this.field_152661_c.get(var2); + + if (var3 != null && (new Date()).getTime() >= var3.field_152673_c.getTime()) { + this.field_152662_d.remove(var3.func_152668_a().getId()); + this.field_152661_c.remove(var3.func_152668_a().getName().toLowerCase(Locale.ROOT)); + LinkedList var4 = this.field_152663_e; + + synchronized (this.field_152663_e) { + this.field_152663_e.remove(var3.func_152668_a()); + } + + var3 = null; + } + + GameProfile var9; + + if (var3 != null) { + var9 = var3.func_152668_a(); + LinkedList var5 = this.field_152663_e; + + synchronized (this.field_152663_e) { + this.field_152663_e.remove(var9); + this.field_152663_e.addFirst(var9); + } + } else { + var9 = func_152650_a(this.field_152664_f, var2); + + if (var9 != null) { + this.func_152649_a(var9); + var3 = (PlayerProfileCache.ProfileEntry)this.field_152661_c.get(var2); + } + } + + this.func_152658_c(); + return var3 == null ? null : var3.func_152668_a(); + } + + public String[] func_152654_a() { + ArrayList var1 = Lists.newArrayList(this.field_152661_c.keySet()); + return (String[])var1.toArray(new String[var1.size()]); + } + + public GameProfile func_152652_a(UUID p_152652_1_) { + PlayerProfileCache.ProfileEntry var2 = (PlayerProfileCache.ProfileEntry)this.field_152662_d.get(p_152652_1_); + return var2 == null ? null : var2.func_152668_a(); + } + + private PlayerProfileCache.ProfileEntry func_152653_b(UUID p_152653_1_) { + PlayerProfileCache.ProfileEntry var2 = (PlayerProfileCache.ProfileEntry)this.field_152662_d.get(p_152653_1_); + + if (var2 != null) { + GameProfile var3 = var2.func_152668_a(); + LinkedList var4 = this.field_152663_e; + + synchronized (this.field_152663_e) { + this.field_152663_e.remove(var3); + this.field_152663_e.addFirst(var3); + } + } + + return var2; + } + + public void func_152657_b() { + List var1 = null; + BufferedReader var2 = null; + label81: { + try { + var2 = Files.newReader(this.field_152665_g, Charsets.UTF_8); + var1 = this.field_152660_b.fromJson(var2, field_152666_h); + break label81; + } catch (FileNotFoundException var10) { + } finally { + IOUtils.closeQuietly(var2); + } + + return; + } + + if (var1 != null) { + this.field_152661_c.clear(); + this.field_152662_d.clear(); + LinkedList var3 = this.field_152663_e; + + synchronized (this.field_152663_e) { + this.field_152663_e.clear(); + } + + var1 = Lists.reverse(var1); + Iterator var12 = var1.iterator(); + + while (var12.hasNext()) { + PlayerProfileCache.ProfileEntry var4 = (PlayerProfileCache.ProfileEntry)var12.next(); + + if (var4 != null) { + this.func_152651_a(var4.func_152668_a(), var4.func_152670_b()); + } + } + } + } + + public void func_152658_c() { + String var1 = this.field_152660_b.toJson(this.func_152656_a(1000)); + BufferedWriter var2 = null; + + try { + var2 = Files.newWriter(this.field_152665_g, Charsets.UTF_8); + var2.write(var1); + return; + } catch (FileNotFoundException var8) { + } catch (IOException var9) { + return; + } + finally { + IOUtils.closeQuietly(var2); + } + } + + private List func_152656_a(int p_152656_1_) { + ArrayList var2 = Lists.newArrayList(); + LinkedList var4 = this.field_152663_e; + ArrayList var3; + + synchronized (this.field_152663_e) { + var3 = Lists.newArrayList(Iterators.limit(this.field_152663_e.iterator(), p_152656_1_)); + } + + Iterator var8 = var3.iterator(); + + while (var8.hasNext()) { + GameProfile var5 = (GameProfile)var8.next(); + PlayerProfileCache.ProfileEntry var6 = this.func_152653_b(var5.getId()); + + if (var6 != null) { + var2.add(var6); + } + } + + return var2; + } + + class ProfileEntry { + private final GameProfile field_152672_b; + private final Date field_152673_c; + + + private ProfileEntry(GameProfile p_i46333_2_, Date p_i46333_3_) { + this.field_152672_b = p_i46333_2_; + this.field_152673_c = p_i46333_3_; + } + + public GameProfile func_152668_a() { + return this.field_152672_b; + } + + public Date func_152670_b() { + return this.field_152673_c; + } + + ProfileEntry(GameProfile p_i1166_2_, Date p_i1166_3_, Object p_i1166_4_) { + this(p_i1166_2_, p_i1166_3_); + } + } + + class Serializer implements JsonDeserializer, JsonSerializer { + + + private Serializer() {} + + public JsonElement func_152676_a(PlayerProfileCache.ProfileEntry p_152676_1_, Type p_152676_2_, JsonSerializationContext p_152676_3_) { + JsonObject var4 = new JsonObject(); + var4.addProperty("name", p_152676_1_.func_152668_a().getName()); + UUID var5 = p_152676_1_.func_152668_a().getId(); + var4.addProperty("uuid", var5 == null ? "" : var5.toString()); + var4.addProperty("expiresOn", PlayerProfileCache.field_152659_a.format(p_152676_1_.func_152670_b())); + return var4; + } + + public PlayerProfileCache.ProfileEntry func_152675_a(JsonElement p_152675_1_, Type p_152675_2_, JsonDeserializationContext p_152675_3_) { + if (p_152675_1_.isJsonObject()) { + JsonObject var4 = p_152675_1_.getAsJsonObject(); + JsonElement var5 = var4.get("name"); + JsonElement var6 = var4.get("uuid"); + JsonElement var7 = var4.get("expiresOn"); + + if (var5 != null && var6 != null) { + String var8 = var6.getAsString(); + String var9 = var5.getAsString(); + Date var10 = null; + + if (var7 != null) { + try { + var10 = PlayerProfileCache.field_152659_a.parse(var7.getAsString()); + } catch (ParseException var14) { + var10 = null; + } + } + + if (var9 != null && var8 != null) { + UUID var11; + + try { + var11 = UUID.fromString(var8); + } catch (Throwable var13) { + return null; + } + + PlayerProfileCache.ProfileEntry var12 = PlayerProfileCache.this.new ProfileEntry(new GameProfile(var11, var9), var10, null); + return var12; + } else { + return null; + } + } else { + return null; + } + } else { + return null; + } + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.func_152676_a((PlayerProfileCache.ProfileEntry)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + + public Object deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + return this.func_152675_a(p_deserialize_1_, p_deserialize_2_, p_deserialize_3_); + } + + Serializer(Object p_i46332_2_) { + this(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PreYggdrasilConverter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PreYggdrasilConverter.java new file mode 100644 index 0000000..f8c760b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/PreYggdrasilConverter.java @@ -0,0 +1,81 @@ +package net.minecraft.server.management; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.mojang.authlib.Agent; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.ProfileLookupCallback; +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.UUID; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PreYggdrasilConverter { + private static final Logger field_152732_e = LogManager.getLogger(); + public static final File field_152728_a = new File("banned-ips.txt"); + public static final File field_152729_b = new File("banned-players.txt"); + public static final File field_152730_c = new File("ops.txt"); + public static final File field_152731_d = new File("white-list.txt"); + + + private static void func_152717_a(MinecraftServer p_152717_0_, Collection p_152717_1_, ProfileLookupCallback p_152717_2_) { + String[] var3 = Iterators.toArray(Iterators.filter(p_152717_1_.iterator(), new Predicate() { + + public boolean func_152733_a(String p_152733_1_) { + return !StringUtils.isNullOrEmpty(p_152733_1_); + } + public boolean apply(Object p_apply_1_) { + return this.func_152733_a((String)p_apply_1_); + } + }), String.class); + + if (p_152717_0_.isServerInOnlineMode()) { + p_152717_0_.func_152359_aw().findProfilesByNames(var3, Agent.MINECRAFT, p_152717_2_); + } else { + String[] var4 = var3; + int var5 = var3.length; + + for (int var6 = 0; var6 < var5; ++var6) { + String var7 = var4[var6]; + UUID var8 = EntityPlayer.func_146094_a(new GameProfile(null, var7)); + GameProfile var9 = new GameProfile(var8, var7); + p_152717_2_.onProfileLookupSucceeded(var9); + } + } + } + + public static String func_152719_a(String p_152719_0_) { + if (!StringUtils.isNullOrEmpty(p_152719_0_) && p_152719_0_.length() <= 16) { + final MinecraftServer var1 = MinecraftServer.getServer(); + GameProfile var2 = var1.func_152358_ax().func_152655_a(p_152719_0_); + + if (var2 != null && var2.getId() != null) { + return var2.getId().toString(); + } else if (!var1.isSinglePlayer() && var1.isServerInOnlineMode()) { + final ArrayList var3 = Lists.newArrayList(); + ProfileLookupCallback var4 = new ProfileLookupCallback() { + + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) { + var1.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_); + var3.add(p_onProfileLookupSucceeded_1_); + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) { + PreYggdrasilConverter.field_152732_e.warn("Could not lookup user whitelist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_); + } + }; + func_152717_a(var1, Lists.newArrayList(p_152719_0_), var4); + return var3.size() > 0 && ((GameProfile)var3.get(0)).getId() != null ? ((GameProfile)var3.get(0)).getId().toString() : ""; + } else { + return EntityPlayer.func_146094_a(new GameProfile(null, p_152719_0_)).toString(); + } + } else { + return p_152719_0_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java new file mode 100644 index 0000000..6fefc14 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java @@ -0,0 +1,956 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.net.SocketAddress; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.demo.DemoWorldManager; +import net.minecraft.world.storage.IPlayerFileData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class ServerConfigurationManager { + public static final File field_152613_a = new File("banned-players.json"); + public static final File field_152614_b = new File("banned-ips.json"); + public static final File field_152615_c = new File("ops.json"); + public static final File field_152616_d = new File("whitelist.json"); + private static final Logger logger = LogManager.getLogger(); + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z"); + + /** Reference to the MinecraftServer object. */ + private final MinecraftServer mcServer; + + /** A list of player entities that exist on this server. */ + public final List playerEntityList = new ArrayList(); + private final UserListBans bannedPlayers; + private final BanList bannedIPs; + + /** A set containing the OPs. */ + private final UserListOps ops; + + /** The Set of all whitelisted players. */ + private final UserListWhitelist whiteListedPlayers; + private final Map field_148547_k; + + /** Reference to the PlayerNBTManager object. */ + private IPlayerFileData playerNBTManagerObj; + + /** + * Server setting to only allow OPs and whitelisted players to join the server. + */ + private boolean whiteListEnforced; + + /** The maximum number of players that can be connected at a time. */ + protected int maxPlayers; + private int viewDistance; + private WorldSettings.GameType gameType; + + /** True if all players are allowed to use commands (cheats). */ + private boolean commandsAllowedForAll; + + /** + * index into playerEntities of player to ping, updated every tick; currently hardcoded to max at 200 players + */ + private int playerPingIndex; + + + public ServerConfigurationManager(MinecraftServer p_i1500_1_) { + this.bannedPlayers = new UserListBans(field_152613_a); + this.bannedIPs = new BanList(field_152614_b); + this.ops = new UserListOps(field_152615_c); + this.whiteListedPlayers = new UserListWhitelist(field_152616_d); + this.field_148547_k = Maps.newHashMap(); + this.mcServer = p_i1500_1_; + this.bannedPlayers.func_152686_a(false); + this.bannedIPs.func_152686_a(false); + this.maxPlayers = 8; + } + + public void initializeConnectionToPlayer(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) { + GameProfile var3 = p_72355_2_.getGameProfile(); + PlayerProfileCache var4 = this.mcServer.func_152358_ax(); + GameProfile var5 = var4.func_152652_a(var3.getId()); + String var6 = var5 == null ? var3.getName() : var5.getName(); + var4.func_152649_a(var3); + NBTTagCompound var7 = this.readPlayerDataFromFile(p_72355_2_); + p_72355_2_.setWorld(this.mcServer.worldServerForDimension(p_72355_2_.dimension)); + p_72355_2_.theItemInWorldManager.setWorld((WorldServer)p_72355_2_.worldObj); + String var8 = "local"; + + if (p_72355_1_.getSocketAddress() != null) { + var8 = p_72355_1_.getSocketAddress().toString(); + } + + logger.info(p_72355_2_.getCommandSenderName() + "[" + var8 + "] logged in with entity id " + p_72355_2_.getEntityId() + " at (" + p_72355_2_.posX + ", " + p_72355_2_.posY + ", " + p_72355_2_.posZ + ")"); + WorldServer var9 = this.mcServer.worldServerForDimension(p_72355_2_.dimension); + ChunkCoordinates var10 = var9.getSpawnPoint(); + this.func_72381_a(p_72355_2_, null, var9); + NetHandlerPlayServer var11 = new NetHandlerPlayServer(this.mcServer, p_72355_1_, p_72355_2_); + var11.sendPacket(new S01PacketJoinGame(p_72355_2_.getEntityId(), p_72355_2_.theItemInWorldManager.getGameType(), var9.getWorldInfo().isHardcoreModeEnabled(), var9.provider.dimensionId, var9.difficultySetting, this.getMaxPlayers(), var9.getWorldInfo().getTerrainType())); + var11.sendPacket(new S3FPacketCustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8))); + var11.sendPacket(new S05PacketSpawnPosition(var10.posX, var10.posY, var10.posZ)); + var11.sendPacket(new S39PacketPlayerAbilities(p_72355_2_.capabilities)); + var11.sendPacket(new S09PacketHeldItemChange(p_72355_2_.inventory.currentItem)); + p_72355_2_.func_147099_x().func_150877_d(); + p_72355_2_.func_147099_x().func_150884_b(p_72355_2_); + this.func_96456_a((ServerScoreboard)var9.getScoreboard(), p_72355_2_); + this.mcServer.func_147132_au(); + ChatComponentTranslation var12; + + if (!p_72355_2_.getCommandSenderName().equalsIgnoreCase(var6)) { + var12 = new ChatComponentTranslation("multiplayer.player.joined.renamed", p_72355_2_.func_145748_c_(), var6); + } else { + var12 = new ChatComponentTranslation("multiplayer.player.joined", p_72355_2_.func_145748_c_()); + } + + var12.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.func_148539_a(var12); + this.playerLoggedIn(p_72355_2_); + var11.setPlayerLocation(p_72355_2_.posX, p_72355_2_.posY, p_72355_2_.posZ, p_72355_2_.rotationYaw, p_72355_2_.rotationPitch); + this.updateTimeAndWeatherForPlayer(p_72355_2_, var9); + + if (this.mcServer.func_147133_T().length() > 0) { + p_72355_2_.func_147095_a(this.mcServer.func_147133_T()); + } + + Iterator var13 = p_72355_2_.getActivePotionEffects().iterator(); + + while (var13.hasNext()) { + PotionEffect var14 = (PotionEffect)var13.next(); + var11.sendPacket(new S1DPacketEntityEffect(p_72355_2_.getEntityId(), var14)); + } + + p_72355_2_.addSelfToInternalCraftingInventory(); + + if (var7 != null && var7.func_150297_b("Riding", 10)) { + Entity var15 = EntityList.createEntityFromNBT(var7.getCompoundTag("Riding"), var9); + + if (var15 != null) { + var15.forceSpawn = true; + var9.spawnEntityInWorld(var15); + p_72355_2_.mountEntity(var15); + var15.forceSpawn = false; + } + } + } + + protected void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_) { + HashSet var3 = new HashSet(); + Iterator var4 = p_96456_1_.getTeams().iterator(); + + while (var4.hasNext()) { + ScorePlayerTeam var5 = (ScorePlayerTeam)var4.next(); + p_96456_2_.playerNetServerHandler.sendPacket(new S3EPacketTeams(var5, 0)); + } + + for (int var9 = 0; var9 < 3; ++var9) { + ScoreObjective var10 = p_96456_1_.func_96539_a(var9); + + if (var10 != null && !var3.contains(var10)) { + List var6 = p_96456_1_.func_96550_d(var10); + Iterator var7 = var6.iterator(); + + while (var7.hasNext()) { + Packet var8 = (Packet)var7.next(); + p_96456_2_.playerNetServerHandler.sendPacket(var8); + } + + var3.add(var10); + } + } + } + + /** + * Sets the NBT manager to the one for the WorldServer given. + */ + public void setPlayerManager(WorldServer[] p_72364_1_) { + this.playerNBTManagerObj = p_72364_1_[0].getSaveHandler().getSaveHandler(); + } + + public void func_72375_a(EntityPlayerMP p_72375_1_, WorldServer p_72375_2_) { + WorldServer var3 = p_72375_1_.getServerForPlayer(); + + if (p_72375_2_ != null) { + p_72375_2_.getPlayerManager().removePlayer(p_72375_1_); + } + + var3.getPlayerManager().addPlayer(p_72375_1_); + var3.theChunkProviderServer.loadChunk((int)p_72375_1_.posX >> 4, (int)p_72375_1_.posZ >> 4); + } + + public int getEntityViewDistance() { + return PlayerManager.getFurthestViewableBlock(this.getViewDistance()); + } + + /** + * called during player login. reads the player information from disk. + */ + public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP p_72380_1_) { + NBTTagCompound var2 = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); + NBTTagCompound var3; + + if (p_72380_1_.getCommandSenderName().equals(this.mcServer.getServerOwner()) && var2 != null) { + p_72380_1_.readFromNBT(var2); + var3 = var2; + logger.debug("loading single player"); + } else { + var3 = this.playerNBTManagerObj.readPlayerData(p_72380_1_); + } + + return var3; + } + + /** + * also stores the NBTTags if this is an intergratedPlayerList + */ + protected void writePlayerData(EntityPlayerMP p_72391_1_) { + this.playerNBTManagerObj.writePlayerData(p_72391_1_); + StatisticsFile var2 = (StatisticsFile)this.field_148547_k.get(p_72391_1_.getUniqueID()); + + if (var2 != null) { + var2.func_150883_b(); + } + } + + /** + * Called when a player successfully logs in. Reads player data from disk and inserts the player into the world. + */ + public void playerLoggedIn(EntityPlayerMP p_72377_1_) { + this.func_148540_a(new S38PacketPlayerListItem(p_72377_1_.getCommandSenderName(), true, 1000)); + this.playerEntityList.add(p_72377_1_); + WorldServer var2 = this.mcServer.worldServerForDimension(p_72377_1_.dimension); + var2.spawnEntityInWorld(p_72377_1_); + this.func_72375_a(p_72377_1_, null); + + for (int var3 = 0; var3 < this.playerEntityList.size(); ++var3) { + EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3); + p_72377_1_.playerNetServerHandler.sendPacket(new S38PacketPlayerListItem(var4.getCommandSenderName(), true, var4.ping)); + } + } + + /** + * using player's dimension, update their movement when in a vehicle (e.g. cart, boat) + */ + public void serverUpdateMountedMovingPlayer(EntityPlayerMP p_72358_1_) { + p_72358_1_.getServerForPlayer().getPlayerManager().updateMountedMovingPlayer(p_72358_1_); + } + + /** + * Called when a player disconnects from the game. Writes player data to disk and removes them from the world. + */ + public void playerLoggedOut(EntityPlayerMP p_72367_1_) { + p_72367_1_.triggerAchievement(StatList.leaveGameStat); + this.writePlayerData(p_72367_1_); + WorldServer var2 = p_72367_1_.getServerForPlayer(); + + if (p_72367_1_.ridingEntity != null) { + var2.removePlayerEntityDangerously(p_72367_1_.ridingEntity); + logger.debug("removing player mount"); + } + + var2.removeEntity(p_72367_1_); + var2.getPlayerManager().removePlayer(p_72367_1_); + this.playerEntityList.remove(p_72367_1_); + this.field_148547_k.remove(p_72367_1_.getUniqueID()); + this.func_148540_a(new S38PacketPlayerListItem(p_72367_1_.getCommandSenderName(), false, 9999)); + } + + public String func_148542_a(SocketAddress p_148542_1_, GameProfile p_148542_2_) { + String var4; + + if (this.bannedPlayers.func_152702_a(p_148542_2_)) { + UserListBansEntry var5 = (UserListBansEntry)this.bannedPlayers.func_152683_b(p_148542_2_); + var4 = "You are banned from this server!\nReason: " + var5.getBanReason(); + + if (var5.getBanEndDate() != null) { + var4 = var4 + "\nYour ban will be removed on " + dateFormat.format(var5.getBanEndDate()); + } + + return var4; + } else if (!this.func_152607_e(p_148542_2_)) { + return "You are not white-listed on this server!"; + } else if (this.bannedIPs.func_152708_a(p_148542_1_)) { + IPBanEntry var3 = this.bannedIPs.func_152709_b(p_148542_1_); + var4 = "Your IP address is banned from this server!\nReason: " + var3.getBanReason(); + + if (var3.getBanEndDate() != null) { + var4 = var4 + "\nYour ban will be removed on " + dateFormat.format(var3.getBanEndDate()); + } + + return var4; + } else { + return this.playerEntityList.size() >= this.maxPlayers ? "The server is full!" : null; + } + } + + public EntityPlayerMP func_148545_a(GameProfile p_148545_1_) { + UUID var2 = EntityPlayer.func_146094_a(p_148545_1_); + ArrayList var3 = Lists.newArrayList(); + EntityPlayerMP var5; + + for (int var4 = 0; var4 < this.playerEntityList.size(); ++var4) { + var5 = (EntityPlayerMP)this.playerEntityList.get(var4); + + if (var5.getUniqueID().equals(var2)) { + var3.add(var5); + } + } + + Iterator var6 = var3.iterator(); + + while (var6.hasNext()) { + var5 = (EntityPlayerMP)var6.next(); + var5.playerNetServerHandler.kickPlayerFromServer("You logged in from another location"); + } + + Object var7; + + if (this.mcServer.isDemo()) { + var7 = new DemoWorldManager(this.mcServer.worldServerForDimension(0)); + } else { + var7 = new ItemInWorldManager(this.mcServer.worldServerForDimension(0)); + } + + return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), p_148545_1_, (ItemInWorldManager)var7); + } + + /** + * creates and returns a respawned player based on the provided PlayerEntity. Args are the PlayerEntityMP to + * respawn, an INT for the dimension to respawn into (usually 0), and a boolean value that is true if the player + * beat the game rather than dying + */ + public EntityPlayerMP respawnPlayer(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) { + p_72368_1_.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(p_72368_1_); + p_72368_1_.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(p_72368_1_); + p_72368_1_.getServerForPlayer().getPlayerManager().removePlayer(p_72368_1_); + this.playerEntityList.remove(p_72368_1_); + this.mcServer.worldServerForDimension(p_72368_1_.dimension).removePlayerEntityDangerously(p_72368_1_); + ChunkCoordinates var4 = p_72368_1_.getBedLocation(); + boolean var5 = p_72368_1_.isSpawnForced(); + p_72368_1_.dimension = p_72368_2_; + Object var6; + + if (this.mcServer.isDemo()) { + var6 = new DemoWorldManager(this.mcServer.worldServerForDimension(p_72368_1_.dimension)); + } else { + var6 = new ItemInWorldManager(this.mcServer.worldServerForDimension(p_72368_1_.dimension)); + } + + EntityPlayerMP var7 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(p_72368_1_.dimension), p_72368_1_.getGameProfile(), (ItemInWorldManager)var6); + var7.playerNetServerHandler = p_72368_1_.playerNetServerHandler; + var7.clonePlayer(p_72368_1_, p_72368_3_); + var7.setEntityId(p_72368_1_.getEntityId()); + WorldServer var8 = this.mcServer.worldServerForDimension(p_72368_1_.dimension); + this.func_72381_a(var7, p_72368_1_, var8); + ChunkCoordinates var9; + + if (var4 != null) { + var9 = EntityPlayer.verifyRespawnCoordinates(this.mcServer.worldServerForDimension(p_72368_1_.dimension), var4, var5); + + if (var9 != null) { + var7.setLocationAndAngles((float)var9.posX + 0.5F, (float)var9.posY + 0.1F, (float)var9.posZ + 0.5F, 0.0F, 0.0F); + var7.setSpawnChunk(var4, var5); + } else { + var7.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(0, 0.0F)); + } + } + + var8.theChunkProviderServer.loadChunk((int)var7.posX >> 4, (int)var7.posZ >> 4); + + while (!var8.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty()) { + var7.setPosition(var7.posX, var7.posY + 1.0D, var7.posZ); + } + + var7.playerNetServerHandler.sendPacket(new S07PacketRespawn(var7.dimension, var7.worldObj.difficultySetting, var7.worldObj.getWorldInfo().getTerrainType(), var7.theItemInWorldManager.getGameType())); + var9 = var8.getSpawnPoint(); + var7.playerNetServerHandler.setPlayerLocation(var7.posX, var7.posY, var7.posZ, var7.rotationYaw, var7.rotationPitch); + var7.playerNetServerHandler.sendPacket(new S05PacketSpawnPosition(var9.posX, var9.posY, var9.posZ)); + var7.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(var7.experience, var7.experienceTotal, var7.experienceLevel)); + this.updateTimeAndWeatherForPlayer(var7, var8); + var8.getPlayerManager().addPlayer(var7); + var8.spawnEntityInWorld(var7); + this.playerEntityList.add(var7); + var7.addSelfToInternalCraftingInventory(); + var7.setHealth(var7.getHealth()); + return var7; + } + + public void transferPlayerToDimension(EntityPlayerMP p_72356_1_, int p_72356_2_) { + int var3 = p_72356_1_.dimension; + WorldServer var4 = this.mcServer.worldServerForDimension(p_72356_1_.dimension); + p_72356_1_.dimension = p_72356_2_; + WorldServer var5 = this.mcServer.worldServerForDimension(p_72356_1_.dimension); + p_72356_1_.playerNetServerHandler.sendPacket(new S07PacketRespawn(p_72356_1_.dimension, p_72356_1_.worldObj.difficultySetting, p_72356_1_.worldObj.getWorldInfo().getTerrainType(), p_72356_1_.theItemInWorldManager.getGameType())); + var4.removePlayerEntityDangerously(p_72356_1_); + p_72356_1_.isDead = false; + this.transferEntityToWorld(p_72356_1_, var3, var4, var5); + this.func_72375_a(p_72356_1_, var4); + p_72356_1_.playerNetServerHandler.setPlayerLocation(p_72356_1_.posX, p_72356_1_.posY, p_72356_1_.posZ, p_72356_1_.rotationYaw, p_72356_1_.rotationPitch); + p_72356_1_.theItemInWorldManager.setWorld(var5); + this.updateTimeAndWeatherForPlayer(p_72356_1_, var5); + this.syncPlayerInventory(p_72356_1_); + Iterator var6 = p_72356_1_.getActivePotionEffects().iterator(); + + while (var6.hasNext()) { + PotionEffect var7 = (PotionEffect)var6.next(); + p_72356_1_.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(p_72356_1_.getEntityId(), var7)); + } + } + + /** + * Transfers an entity from a world to another world. + */ + public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) { + double var5 = p_82448_1_.posX; + double var7 = p_82448_1_.posZ; + double var9 = 8.0D; + double var11 = p_82448_1_.posX; + double var13 = p_82448_1_.posY; + double var15 = p_82448_1_.posZ; + float var17 = p_82448_1_.rotationYaw; + p_82448_3_.theProfiler.startSection("moving"); + + if (p_82448_1_.dimension == -1) { + var5 /= var9; + var7 /= var9; + p_82448_1_.setLocationAndAngles(var5, p_82448_1_.posY, var7, p_82448_1_.rotationYaw, p_82448_1_.rotationPitch); + + if (p_82448_1_.isEntityAlive()) { + p_82448_3_.updateEntityWithOptionalForce(p_82448_1_, false); + } + } else if (p_82448_1_.dimension == 0) { + var5 *= var9; + var7 *= var9; + p_82448_1_.setLocationAndAngles(var5, p_82448_1_.posY, var7, p_82448_1_.rotationYaw, p_82448_1_.rotationPitch); + + if (p_82448_1_.isEntityAlive()) { + p_82448_3_.updateEntityWithOptionalForce(p_82448_1_, false); + } + } else { + ChunkCoordinates var18; + + if (p_82448_2_ == 1) { + var18 = p_82448_4_.getSpawnPoint(); + } else { + var18 = p_82448_4_.getEntrancePortalLocation(); + } + + var5 = var18.posX; + p_82448_1_.posY = var18.posY; + var7 = var18.posZ; + p_82448_1_.setLocationAndAngles(var5, p_82448_1_.posY, var7, 90.0F, 0.0F); + + if (p_82448_1_.isEntityAlive()) { + p_82448_3_.updateEntityWithOptionalForce(p_82448_1_, false); + } + } + + p_82448_3_.theProfiler.endSection(); + + if (p_82448_2_ != 1) { + p_82448_3_.theProfiler.startSection("placing"); + var5 = MathHelper.clamp_int((int)var5, -29999872, 29999872); + var7 = MathHelper.clamp_int((int)var7, -29999872, 29999872); + + if (p_82448_1_.isEntityAlive()) { + p_82448_1_.setLocationAndAngles(var5, p_82448_1_.posY, var7, p_82448_1_.rotationYaw, p_82448_1_.rotationPitch); + p_82448_4_.getDefaultTeleporter().placeInPortal(p_82448_1_, var11, var13, var15, var17); + p_82448_4_.spawnEntityInWorld(p_82448_1_); + p_82448_4_.updateEntityWithOptionalForce(p_82448_1_, false); + } + + p_82448_3_.theProfiler.endSection(); + } + + p_82448_1_.setWorld(p_82448_4_); + } + + /** + * sends 1 player per tick, but only sends a player once every 600 ticks + */ + public void sendPlayerInfoToAllPlayers() { + if (++this.playerPingIndex > 600) { + this.playerPingIndex = 0; + } + + if (this.playerPingIndex < this.playerEntityList.size()) { + EntityPlayerMP var1 = (EntityPlayerMP)this.playerEntityList.get(this.playerPingIndex); + this.func_148540_a(new S38PacketPlayerListItem(var1.getCommandSenderName(), true, var1.ping)); + } + } + + public void func_148540_a(Packet p_148540_1_) { + for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2) { + ((EntityPlayerMP)this.playerEntityList.get(var2)).playerNetServerHandler.sendPacket(p_148540_1_); + } + } + + public void func_148537_a(Packet p_148537_1_, int p_148537_2_) { + for (int var3 = 0; var3 < this.playerEntityList.size(); ++var3) { + EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3); + + if (var4.dimension == p_148537_2_) { + var4.playerNetServerHandler.sendPacket(p_148537_1_); + } + } + } + + public String func_152609_b(boolean p_152609_1_) { + String var2 = ""; + ArrayList var3 = Lists.newArrayList(this.playerEntityList); + + for (int var4 = 0; var4 < var3.size(); ++var4) { + if (var4 > 0) { + var2 = var2 + ", "; + } + + var2 = var2 + ((EntityPlayerMP)var3.get(var4)).getCommandSenderName(); + + if (p_152609_1_) { + var2 = var2 + " (" + ((EntityPlayerMP)var3.get(var4)).getUniqueID().toString() + ")"; + } + } + + return var2; + } + + /** + * Returns an array of the usernames of all the connected players. + */ + public String[] getAllUsernames() { + String[] var1 = new String[this.playerEntityList.size()]; + + for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2) { + var1[var2] = ((EntityPlayerMP)this.playerEntityList.get(var2)).getCommandSenderName(); + } + + return var1; + } + + public GameProfile[] func_152600_g() { + GameProfile[] var1 = new GameProfile[this.playerEntityList.size()]; + + for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2) { + var1[var2] = ((EntityPlayerMP)this.playerEntityList.get(var2)).getGameProfile(); + } + + return var1; + } + + public UserListBans func_152608_h() { + return this.bannedPlayers; + } + + public BanList getBannedIPs() { + return this.bannedIPs; + } + + public void func_152605_a(GameProfile p_152605_1_) { + this.ops.func_152687_a(new UserListOpsEntry(p_152605_1_, this.mcServer.func_110455_j())); + } + + public void func_152610_b(GameProfile p_152610_1_) { + this.ops.func_152684_c(p_152610_1_); + } + + public boolean func_152607_e(GameProfile p_152607_1_) { + return !this.whiteListEnforced || this.ops.func_152692_d(p_152607_1_) || this.whiteListedPlayers.func_152692_d(p_152607_1_); + } + + public boolean func_152596_g(GameProfile p_152596_1_) { + return this.ops.func_152692_d(p_152596_1_) || this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() && this.mcServer.getServerOwner().equalsIgnoreCase(p_152596_1_.getName()) || this.commandsAllowedForAll; + } + + public EntityPlayerMP func_152612_a(String p_152612_1_) { + Iterator var2 = this.playerEntityList.iterator(); + EntityPlayerMP var3; + + do { + if (!var2.hasNext()) { + return null; + } + + var3 = (EntityPlayerMP)var2.next(); + } + while (!var3.getCommandSenderName().equalsIgnoreCase(p_152612_1_)); + + return var3; + } + + /** + * Find all players in a specified range and narrowing down by other parameters + */ + public List findPlayers(ChunkCoordinates p_82449_1_, int p_82449_2_, int p_82449_3_, int p_82449_4_, int p_82449_5_, int p_82449_6_, int p_82449_7_, Map p_82449_8_, String p_82449_9_, String p_82449_10_, World p_82449_11_) { + if (this.playerEntityList.isEmpty()) { + return Collections.emptyList(); + } else { + Object var12 = new ArrayList(); + boolean var13 = p_82449_4_ < 0; + boolean var14 = p_82449_9_ != null && p_82449_9_.startsWith("!"); + boolean var15 = p_82449_10_ != null && p_82449_10_.startsWith("!"); + int var16 = p_82449_2_ * p_82449_2_; + int var17 = p_82449_3_ * p_82449_3_; + p_82449_4_ = MathHelper.abs_int(p_82449_4_); + + if (var14) { + p_82449_9_ = p_82449_9_.substring(1); + } + + if (var15) { + p_82449_10_ = p_82449_10_.substring(1); + } + + for (int var18 = 0; var18 < this.playerEntityList.size(); ++var18) { + EntityPlayerMP var19 = (EntityPlayerMP)this.playerEntityList.get(var18); + + if ((p_82449_11_ == null || var19.worldObj == p_82449_11_) && (p_82449_9_ == null || var14 != p_82449_9_.equalsIgnoreCase(var19.getCommandSenderName()))) { + if (p_82449_10_ != null) { + Team var20 = var19.getTeam(); + String var21 = var20 == null ? "" : var20.getRegisteredName(); + + if (var15 == p_82449_10_.equalsIgnoreCase(var21)) { + continue; + } + } + + if (p_82449_1_ != null && (p_82449_2_ > 0 || p_82449_3_ > 0)) { + float var22 = p_82449_1_.getDistanceSquaredToChunkCoordinates(var19.getPlayerCoordinates()); + + if (p_82449_2_ > 0 && var22 < (float)var16 || p_82449_3_ > 0 && var22 > (float)var17) { + continue; + } + } + + if (this.func_96457_a(var19, p_82449_8_) && (p_82449_5_ == WorldSettings.GameType.NOT_SET.getID() || p_82449_5_ == var19.theItemInWorldManager.getGameType().getID()) && (p_82449_6_ <= 0 || var19.experienceLevel >= p_82449_6_) && var19.experienceLevel <= p_82449_7_) { + ((List)var12).add(var19); + } + } + } + + if (p_82449_1_ != null) { + Collections.sort((List)var12, new PlayerPositionComparator(p_82449_1_)); + } + + if (var13) { + Collections.reverse((List)var12); + } + + if (p_82449_4_ > 0) { + var12 = ((List)var12).subList(0, Math.min(p_82449_4_, ((List)var12).size())); + } + + return (List)var12; + } + } + + private boolean func_96457_a(EntityPlayer p_96457_1_, Map p_96457_2_) { + if (p_96457_2_ != null && p_96457_2_.size() != 0) { + Iterator var3 = p_96457_2_.entrySet().iterator(); + Entry var4; + boolean var6; + int var10; + + do { + if (!var3.hasNext()) { + return true; + } + + var4 = (Entry)var3.next(); + String var5 = (String)var4.getKey(); + var6 = false; + + if (var5.endsWith("_min") && var5.length() > 4) { + var6 = true; + var5 = var5.substring(0, var5.length() - 4); + } + + Scoreboard var7 = p_96457_1_.getWorldScoreboard(); + ScoreObjective var8 = var7.getObjective(var5); + + if (var8 == null) { + return false; + } + + Score var9 = p_96457_1_.getWorldScoreboard().func_96529_a(p_96457_1_.getCommandSenderName(), var8); + var10 = var9.getScorePoints(); + + if (var10 < ((Integer)var4.getValue()).intValue() && var6) { + return false; + } + } + while (var10 <= ((Integer)var4.getValue()).intValue() || var6); + + return false; + } else { + return true; + } + } + + public void func_148541_a(double p_148541_1_, double p_148541_3_, double p_148541_5_, double p_148541_7_, int p_148541_9_, Packet p_148541_10_) { + this.func_148543_a(null, p_148541_1_, p_148541_3_, p_148541_5_, p_148541_7_, p_148541_9_, p_148541_10_); + } + + public void func_148543_a(EntityPlayer p_148543_1_, double p_148543_2_, double p_148543_4_, double p_148543_6_, double p_148543_8_, int p_148543_10_, Packet p_148543_11_) { + for (int var12 = 0; var12 < this.playerEntityList.size(); ++var12) { + EntityPlayerMP var13 = (EntityPlayerMP)this.playerEntityList.get(var12); + + if (var13 != p_148543_1_ && var13.dimension == p_148543_10_) { + double var14 = p_148543_2_ - var13.posX; + double var16 = p_148543_4_ - var13.posY; + double var18 = p_148543_6_ - var13.posZ; + + if (var14 * var14 + var16 * var16 + var18 * var18 < p_148543_8_ * p_148543_8_) { + var13.playerNetServerHandler.sendPacket(p_148543_11_); + } + } + } + } + + /** + * Saves all of the players' current states. + */ + public void saveAllPlayerData() { + for (int var1 = 0; var1 < this.playerEntityList.size(); ++var1) { + this.writePlayerData((EntityPlayerMP)this.playerEntityList.get(var1)); + } + } + + public void func_152601_d(GameProfile p_152601_1_) { + this.whiteListedPlayers.func_152687_a(new UserListWhitelistEntry(p_152601_1_)); + } + + public void func_152597_c(GameProfile p_152597_1_) { + this.whiteListedPlayers.func_152684_c(p_152597_1_); + } + + public UserListWhitelist func_152599_k() { + return this.whiteListedPlayers; + } + + public String[] func_152598_l() { + return this.whiteListedPlayers.func_152685_a(); + } + + public UserListOps func_152603_m() { + return this.ops; + } + + public String[] func_152606_n() { + return this.ops.func_152685_a(); + } + + /** + * Either does nothing, or calls readWhiteList. + */ + public void loadWhiteList() {} + + /** + * Updates the time and weather for the given player to those of the given world + */ + public void updateTimeAndWeatherForPlayer(EntityPlayerMP p_72354_1_, WorldServer p_72354_2_) { + p_72354_1_.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(p_72354_2_.getTotalWorldTime(), p_72354_2_.getWorldTime(), p_72354_2_.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); + + if (p_72354_2_.isRaining()) { + p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); + p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, p_72354_2_.getRainStrength(1.0F))); + p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, p_72354_2_.getWeightedThunderStrength(1.0F))); + } + } + + /** + * sends the players inventory to himself + */ + public void syncPlayerInventory(EntityPlayerMP p_72385_1_) { + p_72385_1_.sendContainerToPlayer(p_72385_1_.inventoryContainer); + p_72385_1_.setPlayerHealthUpdated(); + p_72385_1_.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(p_72385_1_.inventory.currentItem)); + } + + /** + * Returns the number of players currently on the server. + */ + public int getCurrentPlayerCount() { + return this.playerEntityList.size(); + } + + /** + * Returns the maximum number of players allowed on the server. + */ + public int getMaxPlayers() { + return this.maxPlayers; + } + + /** + * Returns an array of usernames for which player.dat exists for. + */ + public String[] getAvailablePlayerDat() { + return this.mcServer.worldServers[0].getSaveHandler().getSaveHandler().getAvailablePlayerDat(); + } + + public void setWhiteListEnabled(boolean p_72371_1_) { + this.whiteListEnforced = p_72371_1_; + } + + public List getPlayerList(String p_72382_1_) { + ArrayList var2 = new ArrayList(); + Iterator var3 = this.playerEntityList.iterator(); + + while (var3.hasNext()) { + EntityPlayerMP var4 = (EntityPlayerMP)var3.next(); + + if (var4.getPlayerIP().equals(p_72382_1_)) { + var2.add(var4); + } + } + + return var2; + } + + /** + * Gets the View Distance. + */ + public int getViewDistance() { + return this.viewDistance; + } + + public MinecraftServer getServerInstance() { + return this.mcServer; + } + + /** + * On integrated servers, returns the host's player data to be written to level.dat. + */ + public NBTTagCompound getHostPlayerData() { + return null; + } + + public void func_152604_a(WorldSettings.GameType p_152604_1_) { + this.gameType = p_152604_1_; + } + + private void func_72381_a(EntityPlayerMP p_72381_1_, EntityPlayerMP p_72381_2_, World p_72381_3_) { + if (p_72381_2_ != null) { + p_72381_1_.theItemInWorldManager.setGameType(p_72381_2_.theItemInWorldManager.getGameType()); + } else if (this.gameType != null) { + p_72381_1_.theItemInWorldManager.setGameType(this.gameType); + } + + p_72381_1_.theItemInWorldManager.initializeGameType(p_72381_3_.getWorldInfo().getGameType()); + } + + /** + * Sets whether all players are allowed to use commands (cheats) on the server. + */ + public void setCommandsAllowedForAll(boolean p_72387_1_) { + this.commandsAllowedForAll = p_72387_1_; + } + + /** + * Kicks everyone with "Server closed" as reason. + */ + public void removeAllPlayers() { + for (int var1 = 0; var1 < this.playerEntityList.size(); ++var1) { + ((EntityPlayerMP)this.playerEntityList.get(var1)).playerNetServerHandler.kickPlayerFromServer("Server closed"); + } + } + + public void func_148544_a(IChatComponent p_148544_1_, boolean p_148544_2_) { + this.mcServer.addChatMessage(p_148544_1_); + this.func_148540_a(new S02PacketChat(p_148544_1_, p_148544_2_)); + } + + public void func_148539_a(IChatComponent p_148539_1_) { + this.func_148544_a(p_148539_1_, true); + } + + public StatisticsFile func_152602_a(EntityPlayer p_152602_1_) { + UUID var2 = p_152602_1_.getUniqueID(); + StatisticsFile var3 = var2 == null ? null : (StatisticsFile)this.field_148547_k.get(var2); + + if (var3 == null) { + File var4 = new File(this.mcServer.worldServerForDimension(0).getSaveHandler().getWorldDirectory(), "stats"); + File var5 = new File(var4, var2.toString() + ".json"); + + if (!var5.exists()) { + File var6 = new File(var4, p_152602_1_.getCommandSenderName() + ".json"); + + if (var6.exists() && var6.isFile()) { + var6.renameTo(var5); + } + } + + var3 = new StatisticsFile(this.mcServer, var5); + var3.func_150882_a(); + this.field_148547_k.put(var2, var3); + } + + return var3; + } + + public void func_152611_a(int p_152611_1_) { + this.viewDistance = p_152611_1_; + + if (this.mcServer.worldServers != null) { + WorldServer[] var2 = this.mcServer.worldServers; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + WorldServer var5 = var2[var4]; + + if (var5 != null) { + var5.getPlayerManager().func_152622_a(p_152611_1_); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserList.java new file mode 100644 index 0000000..0d6253e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserList.java @@ -0,0 +1,176 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class UserList { + protected static final Logger field_152693_a = LogManager.getLogger(); + protected final Gson field_152694_b; + private final File field_152695_c; + private final Map field_152696_d = Maps.newHashMap(); + private boolean field_152697_e = true; + private static final ParameterizedType field_152698_f = new ParameterizedType() { + + public Type[] getActualTypeArguments() { + return new Type[] {UserListEntry.class}; + } + public Type getRawType() { + return List.class; + } + public Type getOwnerType() { + return null; + } + }; + + + public UserList(File p_i1144_1_) { + this.field_152695_c = p_i1144_1_; + GsonBuilder var2 = (new GsonBuilder()).setPrettyPrinting(); + var2.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer(null)); + this.field_152694_b = var2.create(); + } + + public boolean func_152689_b() { + return this.field_152697_e; + } + + public void func_152686_a(boolean p_152686_1_) { + this.field_152697_e = p_152686_1_; + } + + public void func_152687_a(UserListEntry p_152687_1_) { + this.field_152696_d.put(this.func_152681_a(p_152687_1_.func_152640_f()), p_152687_1_); + + try { + this.func_152678_f(); + } catch (IOException var3) { + field_152693_a.warn("Could not save the list after adding a user.", var3); + } + } + + public UserListEntry func_152683_b(Object p_152683_1_) { + this.func_152680_h(); + return (UserListEntry)this.field_152696_d.get(this.func_152681_a(p_152683_1_)); + } + + public void func_152684_c(Object p_152684_1_) { + this.field_152696_d.remove(this.func_152681_a(p_152684_1_)); + + try { + this.func_152678_f(); + } catch (IOException var3) { + field_152693_a.warn("Could not save the list after removing a user.", var3); + } + } + + public String[] func_152685_a() { + return (String[])this.field_152696_d.keySet().toArray(new String[this.field_152696_d.size()]); + } + + protected String func_152681_a(Object p_152681_1_) { + return p_152681_1_.toString(); + } + + protected boolean func_152692_d(Object p_152692_1_) { + return this.field_152696_d.containsKey(this.func_152681_a(p_152692_1_)); + } + + private void func_152680_h() { + ArrayList var1 = Lists.newArrayList(); + Iterator var2 = this.field_152696_d.values().iterator(); + + while (var2.hasNext()) { + UserListEntry var3 = (UserListEntry)var2.next(); + + if (var3.hasBanExpired()) { + var1.add(var3.func_152640_f()); + } + } + + var2 = var1.iterator(); + + while (var2.hasNext()) { + Object var4 = var2.next(); + this.field_152696_d.remove(var4); + } + } + + protected UserListEntry func_152682_a(JsonObject p_152682_1_) { + return new UserListEntry(null, p_152682_1_); + } + + protected Map func_152688_e() { + return this.field_152696_d; + } + + public void func_152678_f() throws IOException { + Collection var1 = this.field_152696_d.values(); + String var2 = this.field_152694_b.toJson(var1); + BufferedWriter var3 = null; + + try { + var3 = Files.newWriter(this.field_152695_c, Charsets.UTF_8); + var3.write(var2); + } + finally { + IOUtils.closeQuietly(var3); + } + } + + class Serializer implements JsonDeserializer, JsonSerializer { + + + private Serializer() {} + + public JsonElement func_152751_a(UserListEntry p_152751_1_, Type p_152751_2_, JsonSerializationContext p_152751_3_) { + JsonObject var4 = new JsonObject(); + p_152751_1_.func_152641_a(var4); + return var4; + } + + public UserListEntry func_152750_a(JsonElement p_152750_1_, Type p_152750_2_, JsonDeserializationContext p_152750_3_) { + if (p_152750_1_.isJsonObject()) { + JsonObject var4 = p_152750_1_.getAsJsonObject(); + UserListEntry var5 = UserList.this.func_152682_a(var4); + return var5; + } else { + return null; + } + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.func_152751_a((UserListEntry)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + + public Object deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + return this.func_152750_a(p_deserialize_1_, p_deserialize_2_, p_deserialize_3_); + } + + Serializer(Object p_i1141_2_) { + this(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListBans.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListBans.java new file mode 100644 index 0000000..7ec9fed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListBans.java @@ -0,0 +1,58 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.util.Iterator; + +public class UserListBans extends UserList { + + + public UserListBans(File p_i1138_1_) { + super(p_i1138_1_); + } + + protected UserListEntry func_152682_a(JsonObject p_152682_1_) { + return new UserListBansEntry(p_152682_1_); + } + + public boolean func_152702_a(GameProfile p_152702_1_) { + return this.func_152692_d(p_152702_1_); + } + + public String[] func_152685_a() { + String[] var1 = new String[this.func_152688_e().size()]; + int var2 = 0; + UserListBansEntry var4; + + for (Iterator var3 = this.func_152688_e().values().iterator(); var3.hasNext(); var1[var2++] = ((GameProfile)var4.func_152640_f()).getName()) { + var4 = (UserListBansEntry)var3.next(); + } + + return var1; + } + + protected String func_152701_b(GameProfile p_152701_1_) { + return p_152701_1_.getId().toString(); + } + + public GameProfile func_152703_a(String p_152703_1_) { + Iterator var2 = this.func_152688_e().values().iterator(); + UserListBansEntry var3; + + do { + if (!var2.hasNext()) { + return null; + } + + var3 = (UserListBansEntry)var2.next(); + } + while (!p_152703_1_.equalsIgnoreCase(((GameProfile)var3.func_152640_f()).getName())); + + return (GameProfile)var3.func_152640_f(); + } + + protected String func_152681_a(Object p_152681_1_) { + return this.func_152701_b((GameProfile)p_152681_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListBansEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListBansEntry.java new file mode 100644 index 0000000..52e362d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListBansEntry.java @@ -0,0 +1,47 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.Date; +import java.util.UUID; + +public class UserListBansEntry extends BanEntry { + + + public UserListBansEntry(GameProfile p_i1134_1_) { + this(p_i1134_1_, null, null, null, null); + } + + public UserListBansEntry(GameProfile p_i1135_1_, Date p_i1135_2_, String p_i1135_3_, Date p_i1135_4_, String p_i1135_5_) { + super(p_i1135_1_, p_i1135_4_, p_i1135_3_, p_i1135_4_, p_i1135_5_); + } + + public UserListBansEntry(JsonObject p_i1136_1_) { + super(func_152648_b(p_i1136_1_), p_i1136_1_); + } + + protected void func_152641_a(JsonObject p_152641_1_) { + if (this.func_152640_f() != null) { + p_152641_1_.addProperty("uuid", ((GameProfile)this.func_152640_f()).getId() == null ? "" : ((GameProfile)this.func_152640_f()).getId().toString()); + p_152641_1_.addProperty("name", ((GameProfile)this.func_152640_f()).getName()); + super.func_152641_a(p_152641_1_); + } + } + + private static GameProfile func_152648_b(JsonObject p_152648_0_) { + if (p_152648_0_.has("uuid") && p_152648_0_.has("name")) { + String var1 = p_152648_0_.get("uuid").getAsString(); + UUID var2; + + try { + var2 = UUID.fromString(var1); + } catch (Throwable var4) { + return null; + } + + return new GameProfile(var2, p_152648_0_.get("name").getAsString()); + } else { + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListEntry.java new file mode 100644 index 0000000..74e5ad0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListEntry.java @@ -0,0 +1,26 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; + +public class UserListEntry { + private final Object field_152642_a; + + + public UserListEntry(Object p_i1146_1_) { + this.field_152642_a = p_i1146_1_; + } + + protected UserListEntry(Object p_i1147_1_, JsonObject p_i1147_2_) { + this.field_152642_a = p_i1147_1_; + } + + Object func_152640_f() { + return this.field_152642_a; + } + + boolean hasBanExpired() { + return false; + } + + protected void func_152641_a(JsonObject p_152641_1_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListOps.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListOps.java new file mode 100644 index 0000000..880c32b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListOps.java @@ -0,0 +1,54 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.util.Iterator; + +public class UserListOps extends UserList { + + + public UserListOps(File p_i1152_1_) { + super(p_i1152_1_); + } + + protected UserListEntry func_152682_a(JsonObject p_152682_1_) { + return new UserListOpsEntry(p_152682_1_); + } + + public String[] func_152685_a() { + String[] var1 = new String[this.func_152688_e().size()]; + int var2 = 0; + UserListOpsEntry var4; + + for (Iterator var3 = this.func_152688_e().values().iterator(); var3.hasNext(); var1[var2++] = ((GameProfile)var4.func_152640_f()).getName()) { + var4 = (UserListOpsEntry)var3.next(); + } + + return var1; + } + + protected String func_152699_b(GameProfile p_152699_1_) { + return p_152699_1_.getId().toString(); + } + + public GameProfile func_152700_a(String p_152700_1_) { + Iterator var2 = this.func_152688_e().values().iterator(); + UserListOpsEntry var3; + + do { + if (!var2.hasNext()) { + return null; + } + + var3 = (UserListOpsEntry)var2.next(); + } + while (!p_152700_1_.equalsIgnoreCase(((GameProfile)var3.func_152640_f()).getName())); + + return (GameProfile)var3.func_152640_f(); + } + + protected String func_152681_a(Object p_152681_1_) { + return this.func_152699_b((GameProfile)p_152681_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListOpsEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListOpsEntry.java new file mode 100644 index 0000000..1da4373 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListOpsEntry.java @@ -0,0 +1,50 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.UUID; + +public class UserListOpsEntry extends UserListEntry { + private final int field_152645_a; + + + public UserListOpsEntry(GameProfile p_i46328_1_, int p_i46328_2_) { + super(p_i46328_1_); + this.field_152645_a = p_i46328_2_; + } + + public UserListOpsEntry(JsonObject p_i1150_1_) { + super(func_152643_b(p_i1150_1_), p_i1150_1_); + this.field_152645_a = p_i1150_1_.has("level") ? p_i1150_1_.get("level").getAsInt() : 0; + } + + public int func_152644_a() { + return this.field_152645_a; + } + + protected void func_152641_a(JsonObject p_152641_1_) { + if (this.func_152640_f() != null) { + p_152641_1_.addProperty("uuid", ((GameProfile)this.func_152640_f()).getId() == null ? "" : ((GameProfile)this.func_152640_f()).getId().toString()); + p_152641_1_.addProperty("name", ((GameProfile)this.func_152640_f()).getName()); + super.func_152641_a(p_152641_1_); + p_152641_1_.addProperty("level", Integer.valueOf(this.field_152645_a)); + } + } + + private static GameProfile func_152643_b(JsonObject p_152643_0_) { + if (p_152643_0_.has("uuid") && p_152643_0_.has("name")) { + String var1 = p_152643_0_.get("uuid").getAsString(); + UUID var2; + + try { + var2 = UUID.fromString(var1); + } catch (Throwable var4) { + return null; + } + + return new GameProfile(var2, p_152643_0_.get("name").getAsString()); + } else { + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListWhitelist.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListWhitelist.java new file mode 100644 index 0000000..babda71 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListWhitelist.java @@ -0,0 +1,54 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.util.Iterator; + +public class UserListWhitelist extends UserList { + + + public UserListWhitelist(File p_i1132_1_) { + super(p_i1132_1_); + } + + protected UserListEntry func_152682_a(JsonObject p_152682_1_) { + return new UserListWhitelistEntry(p_152682_1_); + } + + public String[] func_152685_a() { + String[] var1 = new String[this.func_152688_e().size()]; + int var2 = 0; + UserListWhitelistEntry var4; + + for (Iterator var3 = this.func_152688_e().values().iterator(); var3.hasNext(); var1[var2++] = ((GameProfile)var4.func_152640_f()).getName()) { + var4 = (UserListWhitelistEntry)var3.next(); + } + + return var1; + } + + protected String func_152704_b(GameProfile p_152704_1_) { + return p_152704_1_.getId().toString(); + } + + public GameProfile func_152706_a(String p_152706_1_) { + Iterator var2 = this.func_152688_e().values().iterator(); + UserListWhitelistEntry var3; + + do { + if (!var2.hasNext()) { + return null; + } + + var3 = (UserListWhitelistEntry)var2.next(); + } + while (!p_152706_1_.equalsIgnoreCase(((GameProfile)var3.func_152640_f()).getName())); + + return (GameProfile)var3.func_152640_f(); + } + + protected String func_152681_a(Object p_152681_1_) { + return this.func_152704_b((GameProfile)p_152681_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListWhitelistEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListWhitelistEntry.java new file mode 100644 index 0000000..d39cdc9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/management/UserListWhitelistEntry.java @@ -0,0 +1,42 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.UUID; + +public class UserListWhitelistEntry extends UserListEntry { + + + public UserListWhitelistEntry(GameProfile p_i1129_1_) { + super(p_i1129_1_); + } + + public UserListWhitelistEntry(JsonObject p_i1130_1_) { + super(func_152646_b(p_i1130_1_), p_i1130_1_); + } + + protected void func_152641_a(JsonObject p_152641_1_) { + if (this.func_152640_f() != null) { + p_152641_1_.addProperty("uuid", ((GameProfile)this.func_152640_f()).getId() == null ? "" : ((GameProfile)this.func_152640_f()).getId().toString()); + p_152641_1_.addProperty("name", ((GameProfile)this.func_152640_f()).getName()); + super.func_152641_a(p_152641_1_); + } + } + + private static GameProfile func_152646_b(JsonObject p_152646_0_) { + if (p_152646_0_.has("uuid") && p_152646_0_.has("name")) { + String var1 = p_152646_0_.get("uuid").getAsString(); + UUID var2; + + try { + var2 = UUID.fromString(var1); + } catch (Throwable var4) { + return null; + } + + return new GameProfile(var2, p_152646_0_.get("name").getAsString()); + } else { + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java new file mode 100644 index 0000000..315fcc1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java @@ -0,0 +1,95 @@ +package net.minecraft.server.network; + +import io.netty.util.concurrent.GenericFutureListener; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; + +public class NetHandlerHandshakeTCP implements INetHandlerHandshakeServer { + private final MinecraftServer field_147387_a; + private final NetworkManager field_147386_b; + + + public NetHandlerHandshakeTCP(MinecraftServer p_i45295_1_, NetworkManager p_i45295_2_) { + this.field_147387_a = p_i45295_1_; + this.field_147386_b = p_i45295_2_; + } + + /** + * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The + * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention + * must pass a versioncheck or receive a disconnect otherwise + */ + public void processHandshake(C00Handshake p_147383_1_) { + switch (NetHandlerHandshakeTCP.SwitchEnumConnectionState.field_151291_a[p_147383_1_.func_149594_c().ordinal()]) { + case 1: + this.field_147386_b.setConnectionState(EnumConnectionState.LOGIN); + ChatComponentText var2; + + if (p_147383_1_.func_149595_d() > 5) { + var2 = new ChatComponentText("Outdated server! I'm still on 1.7.10"); + this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(var2)); + this.field_147386_b.closeChannel(var2); + } else if (p_147383_1_.func_149595_d() < 5) { + var2 = new ChatComponentText("Outdated com.cheatbreaker.client! Please use 1.7.10"); + this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(var2)); + this.field_147386_b.closeChannel(var2); + } else { + this.field_147386_b.setNetHandler(new NetHandlerLoginServer(this.field_147387_a, this.field_147386_b)); + } + + break; + + case 2: + this.field_147386_b.setConnectionState(EnumConnectionState.STATUS); + this.field_147386_b.setNetHandler(new NetHandlerStatusServer(this.field_147387_a, this.field_147386_b)); + break; + + default: + throw new UnsupportedOperationException("Invalid intention " + p_147383_1_.func_149594_c()); + } + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent p_147231_1_) {} + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + if (p_147232_2_ != EnumConnectionState.LOGIN && p_147232_2_ != EnumConnectionState.STATUS) { + throw new UnsupportedOperationException("Invalid state " + p_147232_2_); + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + static final class SwitchEnumConnectionState { + static final int[] field_151291_a = new int[EnumConnectionState.values().length]; + + + static { + try { + field_151291_a[EnumConnectionState.LOGIN.ordinal()] = 1; + } catch (NoSuchFieldError var2) { + } + + try { + field_151291_a[EnumConnectionState.STATUS.ordinal()] = 2; + } catch (NoSuchFieldError var1) { + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java new file mode 100644 index 0000000..43d2154 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java @@ -0,0 +1,187 @@ +package net.minecraft.server.network; + +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; +import io.netty.util.concurrent.GenericFutureListener; +import java.math.BigInteger; +import java.security.PrivateKey; +import java.util.Arrays; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; +import javax.crypto.SecretKey; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.login.INetHandlerLoginServer; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.CryptManager; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetHandlerLoginServer implements INetHandlerLoginServer { + private static final AtomicInteger field_147331_b = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private static final Random field_147329_d = new Random(); + private final byte[] field_147330_e = new byte[4]; + private final MinecraftServer field_147327_f; + public final NetworkManager field_147333_a; + private NetHandlerLoginServer.LoginState field_147328_g; + private int field_147336_h; + private GameProfile field_147337_i; + private final String field_147334_j; + private SecretKey field_147335_k; + + + public NetHandlerLoginServer(MinecraftServer p_i45298_1_, NetworkManager p_i45298_2_) { + this.field_147328_g = NetHandlerLoginServer.LoginState.HELLO; + this.field_147334_j = ""; + this.field_147327_f = p_i45298_1_; + this.field_147333_a = p_i45298_2_; + field_147329_d.nextBytes(this.field_147330_e); + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() { + if (this.field_147328_g == NetHandlerLoginServer.LoginState.READY_TO_ACCEPT) { + this.func_147326_c(); + } + + if (this.field_147336_h++ == 600) { + this.func_147322_a("Took too long to log in"); + } + } + + public void func_147322_a(String p_147322_1_) { + try { + logger.info("Disconnecting " + this.func_147317_d() + ": " + p_147322_1_); + ChatComponentText var2 = new ChatComponentText(p_147322_1_); + this.field_147333_a.scheduleOutboundPacket(new S00PacketDisconnect(var2)); + this.field_147333_a.closeChannel(var2); + } catch (Exception var3) { + logger.error("Error whilst disconnecting player", var3); + } + } + + public void func_147326_c() { + if (!this.field_147337_i.isComplete()) { + this.field_147337_i = this.func_152506_a(this.field_147337_i); + } + + String var1 = this.field_147327_f.getConfigurationManager().func_148542_a(this.field_147333_a.getSocketAddress(), this.field_147337_i); + + if (var1 != null) { + this.func_147322_a(var1); + } else { + this.field_147328_g = NetHandlerLoginServer.LoginState.ACCEPTED; + this.field_147333_a.scheduleOutboundPacket(new S02PacketLoginSuccess(this.field_147337_i)); + this.field_147327_f.getConfigurationManager().initializeConnectionToPlayer(this.field_147333_a, this.field_147327_f.getConfigurationManager().func_148545_a(this.field_147337_i)); + } + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent p_147231_1_) { + logger.info(this.func_147317_d() + " lost connection: " + p_147231_1_.getUnformattedText()); + } + + public String func_147317_d() { + return this.field_147337_i != null ? this.field_147337_i + " (" + this.field_147333_a.getSocketAddress().toString() + ")" : String.valueOf(this.field_147333_a.getSocketAddress()); + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.ACCEPTED || this.field_147328_g == NetHandlerLoginServer.LoginState.HELLO, "Unexpected change in protocol"); + Validate.validState(p_147232_2_ == EnumConnectionState.PLAY || p_147232_2_ == EnumConnectionState.LOGIN, "Unexpected protocol " + p_147232_2_); + } + + public void processLoginStart(C00PacketLoginStart p_147316_1_) { + Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.HELLO, "Unexpected hello packet"); + this.field_147337_i = p_147316_1_.func_149304_c(); + + if (this.field_147327_f.isServerInOnlineMode() && !this.field_147333_a.isLocalChannel()) { + this.field_147328_g = NetHandlerLoginServer.LoginState.KEY; + this.field_147333_a.scheduleOutboundPacket(new S01PacketEncryptionRequest(this.field_147334_j, this.field_147327_f.getKeyPair().getPublic(), this.field_147330_e)); + } else { + this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + } + + public void processEncryptionResponse(C01PacketEncryptionResponse p_147315_1_) { + Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.KEY, "Unexpected key packet"); + PrivateKey var2 = this.field_147327_f.getKeyPair().getPrivate(); + + if (!Arrays.equals(this.field_147330_e, p_147315_1_.func_149299_b(var2))) { + throw new IllegalStateException("Invalid nonce!"); + } else { + this.field_147335_k = p_147315_1_.func_149300_a(var2); + this.field_147328_g = NetHandlerLoginServer.LoginState.AUTHENTICATING; + this.field_147333_a.enableEncryption(this.field_147335_k); + (new Thread("User Authenticator #" + field_147331_b.incrementAndGet()) { + + public void run() { + GameProfile var1 = NetHandlerLoginServer.this.field_147337_i; + + try { + String var2 = (new BigInteger(CryptManager.getServerIdHash(NetHandlerLoginServer.this.field_147334_j, NetHandlerLoginServer.this.field_147327_f.getKeyPair().getPublic(), NetHandlerLoginServer.this.field_147335_k))).toString(16); + NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.field_147327_f.func_147130_as().hasJoinedServer(new GameProfile(null, var1.getName()), var2); + + if (NetHandlerLoginServer.this.field_147337_i != null) { + NetHandlerLoginServer.logger.info("UUID of player " + NetHandlerLoginServer.this.field_147337_i.getName() + " is " + NetHandlerLoginServer.this.field_147337_i.getId()); + NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } else if (NetHandlerLoginServer.this.field_147327_f.isSinglePlayer()) { + NetHandlerLoginServer.logger.warn("Failed to verify username but will let them in anyway!"); + NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.func_152506_a(var1); + NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } else { + NetHandlerLoginServer.this.func_147322_a("Failed to verify username!"); + NetHandlerLoginServer.logger.error("Username '" + NetHandlerLoginServer.this.field_147337_i.getName() + "' tried to join with an invalid session"); + } + } catch (AuthenticationUnavailableException var3) { + if (NetHandlerLoginServer.this.field_147327_f.isSinglePlayer()) { + NetHandlerLoginServer.logger.warn("Authentication servers are down but will let them in anyway!"); + NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.func_152506_a(var1); + NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } else { + NetHandlerLoginServer.this.func_147322_a("Authentication servers are down. Please try again later, sorry!"); + NetHandlerLoginServer.logger.error("Couldn't verify username because servers are unavailable"); + } + } + } + }).start(); + } + } + + protected GameProfile func_152506_a(GameProfile p_152506_1_) { + UUID var2 = UUID.nameUUIDFromBytes(("OfflinePlayer:" + p_152506_1_.getName()).getBytes(Charsets.UTF_8)); + return new GameProfile(var2, p_152506_1_.getName()); + } + + enum LoginState { + HELLO("HELLO", 0), + KEY("KEY", 1), + AUTHENTICATING("AUTHENTICATING", 2), + READY_TO_ACCEPT("READY_TO_ACCEPT", 3), + ACCEPTED("ACCEPTED", 4); + + private static final NetHandlerLoginServer.LoginState[] $VALUES = new NetHandlerLoginServer.LoginState[]{HELLO, KEY, AUTHENTICATING, READY_TO_ACCEPT, ACCEPTED}; + + + LoginState(String p_i45297_1_, int p_i45297_2_) {} + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerStatusServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerStatusServer.java new file mode 100644 index 0000000..e27c93b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/server/network/NetHandlerStatusServer.java @@ -0,0 +1,52 @@ +package net.minecraft.server.network; + +import io.netty.util.concurrent.GenericFutureListener; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.status.INetHandlerStatusServer; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.IChatComponent; + +public class NetHandlerStatusServer implements INetHandlerStatusServer { + private final MinecraftServer field_147314_a; + private final NetworkManager field_147313_b; + + + public NetHandlerStatusServer(MinecraftServer p_i45299_1_, NetworkManager p_i45299_2_) { + this.field_147314_a = p_i45299_1_; + this.field_147313_b = p_i45299_2_; + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent p_147231_1_) {} + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState p_147232_1_, EnumConnectionState p_147232_2_) { + if (p_147232_2_ != EnumConnectionState.STATUS) { + throw new UnsupportedOperationException("Unexpected change in protocol to " + p_147232_2_); + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + public void processServerQuery(C00PacketServerQuery p_147312_1_) { + this.field_147313_b.scheduleOutboundPacket(new S00PacketServerInfo(this.field_147314_a.func_147134_at())); + } + + public void processPing(C01PacketPing p_147311_1_) { + this.field_147313_b.scheduleOutboundPacket(new S01PacketPong(p_147311_1_.func_149289_c())); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ArrayCache.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ArrayCache.java new file mode 100644 index 0000000..4a80495 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ArrayCache.java @@ -0,0 +1,37 @@ +package net.minecraft.src; + +import java.lang.reflect.Array; +import java.util.ArrayDeque; + +public class ArrayCache { + private Class elementClass = null; + private int maxCacheSize = 0; + private ArrayDeque cache = new ArrayDeque(); + + public ArrayCache(Class elementClass, int maxCacheSize) { + this.elementClass = elementClass; + this.maxCacheSize = maxCacheSize; + } + + public synchronized Object allocate(int size) { + Object arr = this.cache.pollLast(); + + if (arr == null || Array.getLength(arr) < size) { + arr = Array.newInstance(this.elementClass, size); + } + + return arr; + } + + public synchronized void free(Object arr) { + if (arr != null) { + Class cls = arr.getClass(); + + if (cls.getComponentType() != this.elementClass) { + throw new IllegalArgumentException("Wrong component type"); + } else if (this.cache.size() < this.maxCacheSize) { + this.cache.add(arr); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Blender.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Blender.java new file mode 100644 index 0000000..e373400 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Blender.java @@ -0,0 +1,121 @@ +package net.minecraft.src; + +import org.lwjgl.opengl.GL11; + +public class Blender { + public static final int BLEND_ALPHA = 0; + public static final int BLEND_ADD = 1; + public static final int BLEND_SUBSTRACT = 2; + public static final int BLEND_MULTIPLY = 3; + public static final int BLEND_DODGE = 4; + public static final int BLEND_BURN = 5; + public static final int BLEND_SCREEN = 6; + public static final int BLEND_OVERLAY = 7; + public static final int BLEND_REPLACE = 8; + public static final int BLEND_DEFAULT = 1; + + public static int parseBlend(String str) { + if (str == null) { + return 1; + } else { + str = str.toLowerCase().trim(); + + if (str.equals("alpha")) { + return 0; + } else if (str.equals("add")) { + return 1; + } else if (str.equals("subtract")) { + return 2; + } else if (str.equals("multiply")) { + return 3; + } else if (str.equals("dodge")) { + return 4; + } else if (str.equals("burn")) { + return 5; + } else if (str.equals("screen")) { + return 6; + } else if (str.equals("overlay")) { + return 7; + } else if (str.equals("replace")) { + return 8; + } else { + Config.warn("Unknown blend: " + str); + return 1; + } + } + } + + public static void setupBlend(int blend, float brightness) { + switch (blend) { + case 0: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, brightness); + break; + + case 1: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glColor4f(1.0F, 1.0F, 1.0F, brightness); + break; + + case 2: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ZERO); + GL11.glColor4f(brightness, brightness, brightness, 1.0F); + break; + + case 3: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(brightness, brightness, brightness, brightness); + break; + + case 4: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GL11.glColor4f(brightness, brightness, brightness, 1.0F); + break; + + case 5: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); + GL11.glColor4f(brightness, brightness, brightness, 1.0F); + break; + + case 6: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_COLOR); + GL11.glColor4f(brightness, brightness, brightness, 1.0F); + break; + + case 7: + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR); + GL11.glColor4f(brightness, brightness, brightness, 1.0F); + break; + + case 8: + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, brightness); + } + + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + public static void clearBlend(float rainBrightness) { + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glColor4f(1.0F, 1.0F, 1.0F, rainBrightness); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/BlockPos.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/BlockPos.java new file mode 100644 index 0000000..bf08208 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/BlockPos.java @@ -0,0 +1,52 @@ +package net.minecraft.src; + +public class BlockPos { + private final int x; + private final int y; + private final int z; + + public BlockPos(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public int getZ() { + return this.z; + } + + public BlockPos add(BlockPos pos) { + return new BlockPos(this.x + pos.x, this.y + pos.y, this.z + pos.z); + } + + public BlockPos sub(BlockPos pos) { + return new BlockPos(this.x - pos.x, this.y - pos.y, this.z - pos.z); + } + + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (!(obj instanceof BlockPos)) { + return false; + } else { + BlockPos blockPos = (BlockPos)obj; + return this.getX() != blockPos.getX() ? false : (this.getY() != blockPos.getY() ? false : this.getZ() == blockPos.getZ()); + } + } + + public int hashCode() { + return (this.getY() + this.getZ() * 31) * 31 + this.getX(); + } + + public String toString() { + return "" + this.x + ", " + this.y + ", " + this.z; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/BlockUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/BlockUtils.java new file mode 100644 index 0000000..a05d0d1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/BlockUtils.java @@ -0,0 +1,26 @@ +package net.minecraft.src; + +import net.minecraft.block.Block; + +public class BlockUtils { + private static ReflectorClass ForgeBlock = new ReflectorClass(Block.class); + private static ReflectorMethod ForgeBlock_setLightOpacity = new ReflectorMethod(ForgeBlock, "setLightOpacity"); + private static boolean directAccessValid = true; + + public static void setLightOpacity(Block block, int opacity) { + if (directAccessValid) { + try { + block.setLightOpacity(opacity); + return; + } catch (IllegalAccessError var3) { + directAccessValid = false; + + if (!ForgeBlock_setLightOpacity.exists()) { + throw var3; + } + } + } + + Reflector.callVoid(block, ForgeBlock_setLightOpacity, new Object[] {Integer.valueOf(opacity)}); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CacheLocal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CacheLocal.java new file mode 100644 index 0000000..b579b9c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CacheLocal.java @@ -0,0 +1,61 @@ +package net.minecraft.src; + +public class CacheLocal { + private int maxX = 18; + private int maxY = 128; + private int maxZ = 18; + private int offsetX = 0; + private int offsetY = 0; + private int offsetZ = 0; + private int[][][] cache = (int[][][])null; + private int[] lastZs = null; + private int lastDz = 0; + + public CacheLocal(int maxX, int maxY, int maxZ) { + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; + this.cache = new int[maxX][maxY][maxZ]; + this.resetCache(); + } + + public void resetCache() { + for (int x = 0; x < this.maxX; ++x) { + int[][] ys = this.cache[x]; + + for (int y = 0; y < this.maxY; ++y) { + int[] zs = ys[y]; + + for (int z = 0; z < this.maxZ; ++z) { + zs[z] = -1; + } + } + } + } + + public void setOffset(int x, int y, int z) { + this.offsetX = x; + this.offsetY = y; + this.offsetZ = z; + this.resetCache(); + } + + public int get(int x, int y, int z) { + try { + this.lastZs = this.cache[x - this.offsetX][y - this.offsetY]; + this.lastDz = z - this.offsetZ; + return this.lastZs[this.lastDz]; + } catch (ArrayIndexOutOfBoundsException var5) { + var5.printStackTrace(); + return -1; + } + } + + public void setLast(int val) { + try { + this.lastZs[this.lastDz] = val; + } catch (Exception var3) { + var3.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CacheLocalByte.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CacheLocalByte.java new file mode 100644 index 0000000..934f6da --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CacheLocalByte.java @@ -0,0 +1,61 @@ +package net.minecraft.src; + +public class CacheLocalByte { + private int maxX = 18; + private int maxY = 128; + private int maxZ = 18; + private int offsetX = 0; + private int offsetY = 0; + private int offsetZ = 0; + private byte[][][] cache = (byte[][][])null; + private byte[] lastZs = null; + private int lastDz = 0; + + public CacheLocalByte(int maxX, int maxY, int maxZ) { + this.maxX = maxX; + this.maxY = maxY; + this.maxZ = maxZ; + this.cache = new byte[maxX][maxY][maxZ]; + this.resetCache(); + } + + public void resetCache() { + for (int x = 0; x < this.maxX; ++x) { + byte[][] ys = this.cache[x]; + + for (int y = 0; y < this.maxY; ++y) { + byte[] zs = ys[y]; + + for (int z = 0; z < this.maxZ; ++z) { + zs[z] = -1; + } + } + } + } + + public void setOffset(int x, int y, int z) { + this.offsetX = x; + this.offsetY = y; + this.offsetZ = z; + this.resetCache(); + } + + public byte get(int x, int y, int z) { + try { + this.lastZs = this.cache[x - this.offsetX][y - this.offsetY]; + this.lastDz = z - this.offsetZ; + return this.lastZs[this.lastDz]; + } catch (ArrayIndexOutOfBoundsException var5) { + var5.printStackTrace(); + return (byte) - 1; + } + } + + public void setLast(byte val) { + try { + this.lastZs[this.lastDz] = val; + } catch (Exception var3) { + var3.printStackTrace(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CapeImageBuffer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CapeImageBuffer.java new file mode 100644 index 0000000..c04e0ce --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CapeImageBuffer.java @@ -0,0 +1,30 @@ +package net.minecraft.src; + +import java.awt.image.BufferedImage; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.util.ResourceLocation; + +public class CapeImageBuffer extends ImageBufferDownload { + private AbstractClientPlayer player; + private ResourceLocation resourceLocation; + + public CapeImageBuffer(AbstractClientPlayer player, ResourceLocation resourceLocation) { + this.player = player; + this.resourceLocation = resourceLocation; + } + + public BufferedImage parseUserSkin(BufferedImage var1) { + return CapeUtils.parseCape(var1); + } + + public void func_152634_a() { + if (this.player != null) { + this.player.setLocationOfCape(this.resourceLocation); + } + } + + public void cleanup() { + this.player = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CapeUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CapeUtils.java new file mode 100644 index 0000000..88d43cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CapeUtils.java @@ -0,0 +1,62 @@ +package net.minecraft.src; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.FilenameUtils; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.File; +import java.util.UUID; + +public class CapeUtils { + public static void downloadCape(AbstractClientPlayer player, UUID id) { + String username = player.getNameClear(); + + if (username != null && !username.isEmpty() && !username.contains("\u0000")) { + String ofCapeUrl = "http://s.optifine.net/capes/" + username + ".png"; + String mptHash = FilenameUtils.getBaseName(ofCapeUrl); + ResourceLocation rl = new ResourceLocation("capeof/" + mptHash); + TextureManager textureManager = Minecraft.getMinecraft().getTextureManager(); + ITextureObject tex = textureManager.getTexture(rl); + + if (tex != null && tex instanceof ThreadDownloadImageData) { + ThreadDownloadImageData cib = (ThreadDownloadImageData)tex; + + if (cib.imageFound != null) { + if (cib.imageFound.booleanValue()) { + player.setLocationOfCape(rl); + } + + return; + } + } + + CapeImageBuffer cib1 = new CapeImageBuffer(player, rl); + ThreadDownloadImageData textureCape = new ThreadDownloadImageData((File)null, ofCapeUrl, (ResourceLocation)null, cib1); + textureCape.pipeline = true; + textureManager.loadTexture(rl, textureCape); + } + } + + public static BufferedImage parseCape(BufferedImage img) { + int imageWidth = 64; + int imageHeight = 32; + int srcWidth = img.getWidth(); + + for (int srcHeight = img.getHeight(); imageWidth < srcWidth || imageHeight < srcHeight; imageHeight *= 2) { + imageWidth *= 2; + } + + BufferedImage imgNew = new BufferedImage(imageWidth, imageHeight, 2); + Graphics g = imgNew.getGraphics(); + g.drawImage(img, 0, 0, (ImageObserver)null); + g.dispose(); + return imgNew; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ChunkCacheOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ChunkCacheOF.java new file mode 100644 index 0000000..dc1209c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ChunkCacheOF.java @@ -0,0 +1,106 @@ +package net.minecraft.src; + +import java.util.Arrays; +import net.minecraft.block.Block; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class ChunkCacheOF extends ChunkCache { + private IBlockAccess blockAccess; + private BlockPos position; + private int[] combinedLights; + private Block[] blocks; + private static ArrayCache cacheCombinedLights = new ArrayCache(Integer.TYPE, 16); + private static ArrayCache cacheBlocks = new ArrayCache(Block.class, 16); + private static final int ARRAY_SIZE = 8000; + + public ChunkCacheOF(World world, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, int subIn) { + super(world, xMin, yMin, zMin, xMax, yMax, zMax, subIn); + this.blockAccess = world; + this.position = new BlockPos(xMin - subIn, yMin - subIn, zMin - subIn); + } + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + public int getLightBrightnessForSkyBlocks(int x, int y, int z, int lightValue) { + if (this.combinedLights == null) { + return this.getLightBrightnessForSkyBlocksRaw(x, y, z, lightValue); + } else { + int index = this.getPositionIndex(x, y, z); + + if (index >= 0 && index < this.combinedLights.length) { + int light = this.combinedLights[index]; + + if (light == -1) { + light = this.getLightBrightnessForSkyBlocksRaw(x, y, z, lightValue); + this.combinedLights[index] = light; + } + + return light; + } else { + return this.getLightBrightnessForSkyBlocksRaw(x, y, z, lightValue); + } + } + } + + private int getLightBrightnessForSkyBlocksRaw(int x, int y, int z, int lightValue) { + int light = this.blockAccess.getLightBrightnessForSkyBlocks(x, y, z, lightValue); + + if (Config.isDynamicLights() && !this.getBlock(x, y, z).isOpaqueCube()) { + light = DynamicLights.getCombinedLight(x, y, z, light); + } + + return light; + } + + public Block getBlock(int x, int y, int z) { + if (this.blocks == null) { + return this.blockAccess.getBlock(x, y, z); + } else { + int index = this.getPositionIndex(x, y, z); + + if (index >= 0 && index < this.blocks.length) { + Block block = this.blocks[index]; + + if (block == null) { + block = this.blockAccess.getBlock(x, y, z); + this.blocks[index] = block; + } + + return block; + } else { + return this.blockAccess.getBlock(x, y, z); + } + } + } + + private int getPositionIndex(int x, int y, int z) { + int i = x - this.position.getX(); + int j = y - this.position.getY(); + int k = z - this.position.getZ(); + return i >= 0 && j >= 0 && k >= 0 && i < 20 && j < 20 && k < 20 ? i * 400 + k * 20 + j : -1; + } + + public void renderStart() { + if (this.combinedLights == null) { + this.combinedLights = (int[])((int[])cacheCombinedLights.allocate(8000)); + } + + Arrays.fill(this.combinedLights, -1); + + if (this.blocks == null) { + this.blocks = (Block[])((Block[])cacheBlocks.allocate(8000)); + } + + Arrays.fill(this.blocks, (Object)null); + } + + public void renderFinish() { + cacheCombinedLights.free(this.combinedLights); + this.combinedLights = null; + cacheBlocks.free(this.blocks); + this.blocks = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ClearWater.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ClearWater.java new file mode 100644 index 0000000..c7d5f92 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ClearWater.java @@ -0,0 +1,96 @@ +package net.minecraft.src; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; + +public class ClearWater { + public static void updateWaterOpacity(GameSettings settings, World world) { + if (settings != null) { + byte cp = 3; + + if (settings.ofClearWater) { + cp = 1; + } + + BlockUtils.setLightOpacity(Blocks.water, cp); + BlockUtils.setLightOpacity(Blocks.flowing_water, cp); + } + + if (world != null) { + IChunkProvider var23 = world.getChunkProvider(); + + if (var23 != null) { + EntityLivingBase rve = Config.getMinecraft().renderViewEntity; + + if (rve != null) { + int cViewX = (int)rve.posX / 16; + int cViewZ = (int)rve.posZ / 16; + int cXMin = cViewX - 512; + int cXMax = cViewX + 512; + int cZMin = cViewZ - 512; + int cZMax = cViewZ + 512; + int countUpdated = 0; + + for (int threadName = cXMin; threadName < cXMax; ++threadName) { + for (int cz = cZMin; cz < cZMax; ++cz) { + if (var23.chunkExists(threadName, cz)) { + Chunk c = var23.provideChunk(threadName, cz); + + if (c != null && !(c instanceof EmptyChunk)) { + int x0 = threadName << 4; + int z0 = cz << 4; + int x1 = x0 + 16; + int z1 = z0 + 16; + + for (int x = x0; x < x1; ++x) { + int z = z0; + + while (z < z1) { + int posH = world.getPrecipitationHeight(x, z); + int y = 0; + + while (true) + { + if (y < posH) { + Block block = world.getBlock(x, y, z); + + if (block.getMaterial() != Material.water) { + ++y; + continue; + } + + world.markBlocksDirtyVertical(x, z, y, posH); + ++countUpdated; + } + + ++z; + break; + } + } + } + } + } + } + } + + if (countUpdated > 0) { + String var24 = "server"; + + if (Config.isMinecraftThread()) { + var24 = "client"; + } + + Config.dbg("ClearWater (" + var24 + ") relighted " + countUpdated + " chunks"); + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CompactArrayList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CompactArrayList.java new file mode 100644 index 0000000..f70aff5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CompactArrayList.java @@ -0,0 +1,124 @@ +package net.minecraft.src; + +import java.util.ArrayList; + +public class CompactArrayList { + private ArrayList list; + private int initialCapacity; + private float loadFactor; + private int countValid; + + public CompactArrayList() { + this(10, 0.75F); + } + + public CompactArrayList(int initialCapacity) { + this(initialCapacity, 0.75F); + } + + public CompactArrayList(int initialCapacity, float loadFactor) { + this.list = null; + this.initialCapacity = 0; + this.loadFactor = 1.0F; + this.countValid = 0; + this.list = new ArrayList(initialCapacity); + this.initialCapacity = initialCapacity; + this.loadFactor = loadFactor; + } + + public void add(int index, Object element) { + if (element != null) { + ++this.countValid; + } + + this.list.add(index, element); + } + + public boolean add(Object element) { + if (element != null) { + ++this.countValid; + } + + return this.list.add(element); + } + + public Object set(int index, Object element) { + Object oldElement = this.list.set(index, element); + + if (element != oldElement) { + if (oldElement == null) { + ++this.countValid; + } + + if (element == null) { + --this.countValid; + } + } + + return oldElement; + } + + public Object remove(int index) { + Object oldElement = this.list.remove(index); + + if (oldElement != null) { + --this.countValid; + } + + return oldElement; + } + + public void clear() { + this.list.clear(); + this.countValid = 0; + } + + public void compact() { + if (this.countValid <= 0 && this.list.size() <= 0) { + this.clear(); + } else if (this.list.size() > this.initialCapacity) { + float currentLoadFactor = (float)this.countValid * 1.0F / (float)this.list.size(); + + if (currentLoadFactor <= this.loadFactor) { + int dstIndex = 0; + int i; + + for (i = 0; i < this.list.size(); ++i) { + Object wr = this.list.get(i); + + if (wr != null) { + if (i != dstIndex) { + this.list.set(dstIndex, wr); + } + + ++dstIndex; + } + } + + for (i = this.list.size() - 1; i >= dstIndex; --i) { + this.list.remove(i); + } + } + } + } + + public boolean contains(Object elem) { + return this.list.contains(elem); + } + + public Object get(int index) { + return this.list.get(index); + } + + public boolean isEmpty() { + return this.list.isEmpty(); + } + + public int size() { + return this.list.size(); + } + + public int getCountValid() { + return this.countValid; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Config.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Config.java new file mode 100644 index 0000000..6c051eb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Config.java @@ -0,0 +1,1887 @@ +package net.minecraft.src; + +import net.minecraft.block.Block; +import net.minecraft.client.LoadingScreenRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.*; +import net.minecraft.client.resources.ResourcePackRepository.Entry; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.init.Blocks; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.util.Util; +import net.minecraft.util.*; +import net.minecraft.util.Util.EnumOS; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.*; +import org.lwjgl.util.glu.GLU; +import shadersmod.client.Shaders; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.*; +import java.lang.reflect.Array; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Config { + public static final String OF_NAME = "OptiFine"; + public static final String MC_VERSION = "1.7.10"; + public static final String OF_EDITION = "HD_U"; + public static final String OF_RELEASE = "E7"; + public static final String VERSION = "OptiFine_1.7.10_HD_U_E7"; + private static String newRelease = null; + private static boolean notify64BitJava = false; + public static String openGlVersion = null; + public static String openGlRenderer = null; + public static String openGlVendor = null; + public static String[] openGlExtensions = null; + public static GlVersion glVersion = null; + public static GlVersion glslVersion = null; + public static int minecraftVersionInt = -1; + public static boolean fancyFogAvailable = false; + public static boolean occlusionAvailable = false; + private static GameSettings gameSettings = null; + private static Minecraft minecraft = Minecraft.getMinecraft(); + private static boolean initialized = false; + private static Thread minecraftThread = null; + private static DisplayMode desktopDisplayMode = null; + private static DisplayMode[] displayModes = null; + private static int antialiasingLevel = 0; + private static int availableProcessors = 0; + public static boolean zoomMode = false; + private static int texturePackClouds = 0; + public static boolean waterOpacityChanged = false; + private static boolean fullscreenModeChecked = false; + private static boolean desktopModeChecked = false; + private static DefaultResourcePack defaultResourcePackLazy = null; + public static final Float DEF_ALPHA_FUNC_LEVEL = Float.valueOf(0.1F); + private static final Logger LOGGER = LogManager.getLogger(); + private static String mcDebugLast = null; + private static int fpsMinLast = 0; + public static float renderPartialTicks; + + public static String getVersion() { + return "OptiFine_1.7.10_HD_U_E7"; + } + + public static String getVersionDebug() { + StringBuffer sb = new StringBuffer(32); + + if (isDynamicLights()) { + sb.append("DL: "); + sb.append(String.valueOf(DynamicLights.getCount())); + sb.append(", "); + } + + sb.append("OptiFine_1.7.10_HD_U_E7"); + String shaderPack = Shaders.getShaderPackName(); + + if (shaderPack != null) { + sb.append(", "); + sb.append(shaderPack); + } + + return sb.toString(); + } + + public static void initGameSettings(GameSettings settings) { + if (gameSettings == null) { + gameSettings = settings; + desktopDisplayMode = Display.getDesktopDisplayMode(); + updateAvailableProcessors(); + ReflectorForge.putLaunchBlackboard("optifine.ForgeSplashCompatible", Boolean.TRUE); + } + } + + public static void initDisplay() { + checkInitialized(); + antialiasingLevel = gameSettings.ofAaLevel; + checkDisplaySettings(); + checkDisplayMode(); + minecraftThread = Thread.currentThread(); + updateThreadPriorities(); + Shaders.startup(Minecraft.getMinecraft()); + } + + public static void checkInitialized() { + if (!initialized) { + if (Display.isCreated()) { + initialized = true; + checkOpenGlCaps(); + startVersionCheckThread(); + } + } + } + + private static void checkOpenGlCaps() { + log(""); + log(getVersion()); + log("Build: " + getBuild()); + log("OS: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version")); + log("Java: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor")); + log("VM: " + System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor")); + log("LWJGL: " + Sys.getVersion()); + openGlVersion = GL11.glGetString(GL11.GL_VERSION); + openGlRenderer = GL11.glGetString(GL11.GL_RENDERER); + openGlVendor = GL11.glGetString(GL11.GL_VENDOR); + log("OpenGL: " + openGlRenderer + ", version " + openGlVersion + ", " + openGlVendor); + log("OpenGL Version: " + getOpenGlVersionString()); + + if (!GLContext.getCapabilities().OpenGL12) { + log("OpenGL Mipmap levels: Not available (GL12.GL_TEXTURE_MAX_LEVEL)"); + } + + fancyFogAvailable = GLContext.getCapabilities().GL_NV_fog_distance; + + if (!fancyFogAvailable) { + log("OpenGL Fancy fog: Not available (GL_NV_fog_distance)"); + } + + occlusionAvailable = GLContext.getCapabilities().GL_ARB_occlusion_query; + + if (!occlusionAvailable) { + log("OpenGL Occlussion culling: Not available (GL_ARB_occlusion_query)"); + } + + int maxTexSize = TextureUtils.getGLMaximumTextureSize(); + dbg("Maximum texture size: " + maxTexSize + "x" + maxTexSize); + } + + private static String getBuild() { + try { + InputStream e = Config.class.getResourceAsStream("/buildof.txt"); + + if (e == null) { + return null; + } else { + String build = readLines(e)[0]; + return build; + } + } catch (Exception var2) { + warn("" + var2.getClass().getName() + ": " + var2.getMessage()); + return null; + } + } + + public static boolean isFancyFogAvailable() { + return fancyFogAvailable; + } + + public static boolean isOcclusionAvailable() { + return occlusionAvailable; + } + + public static int getMinecraftVersionInt() { + if (minecraftVersionInt < 0) { + String[] verStrs = tokenize("1.7.10", "."); + int ver = 0; + + if (verStrs.length > 0) { + ver += 10000 * parseInt(verStrs[0], 0); + } + + if (verStrs.length > 1) { + ver += 100 * parseInt(verStrs[1], 0); + } + + if (verStrs.length > 2) { + ver += 1 * parseInt(verStrs[2], 0); + } + + minecraftVersionInt = ver; + } + + return minecraftVersionInt; + } + + public static String getOpenGlVersionString() { + GlVersion ver = getGlVersion(); + String verStr = "" + ver.getMajor() + "." + ver.getMinor() + "." + ver.getRelease(); + return verStr; + } + + private static GlVersion getGlVersionLwjgl() { + return GLContext.getCapabilities().OpenGL44 ? new GlVersion(4, 4) : (GLContext.getCapabilities().OpenGL43 ? new GlVersion(4, 3) : (GLContext.getCapabilities().OpenGL42 ? new GlVersion(4, 2) : (GLContext.getCapabilities().OpenGL41 ? new GlVersion(4, 1) : (GLContext.getCapabilities().OpenGL40 ? new GlVersion(4, 0) : (GLContext.getCapabilities().OpenGL33 ? new GlVersion(3, 3) : (GLContext.getCapabilities().OpenGL32 ? new GlVersion(3, 2) : (GLContext.getCapabilities().OpenGL31 ? new GlVersion(3, 1) : (GLContext.getCapabilities().OpenGL30 ? new GlVersion(3, 0) : (GLContext.getCapabilities().OpenGL21 ? new GlVersion(2, 1) : (GLContext.getCapabilities().OpenGL20 ? new GlVersion(2, 0) : (GLContext.getCapabilities().OpenGL15 ? new GlVersion(1, 5) : (GLContext.getCapabilities().OpenGL14 ? new GlVersion(1, 4) : (GLContext.getCapabilities().OpenGL13 ? new GlVersion(1, 3) : (GLContext.getCapabilities().OpenGL12 ? new GlVersion(1, 2) : (GLContext.getCapabilities().OpenGL11 ? new GlVersion(1, 1) : new GlVersion(1, 0)))))))))))))))); + } + + public static GlVersion getGlVersion() { + if (glVersion == null) { + String verStr = GL11.glGetString(GL11.GL_VERSION); + glVersion = parseGlVersion(verStr, (GlVersion)null); + + if (glVersion == null) { + glVersion = getGlVersionLwjgl(); + } + + if (glVersion == null) { + glVersion = new GlVersion(1, 0); + } + } + + return glVersion; + } + + public static GlVersion getGlslVersion() { + if (glslVersion == null) { + String verStr = GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION); + glslVersion = parseGlVersion(verStr, (GlVersion)null); + + if (glslVersion == null) { + glslVersion = new GlVersion(1, 10); + } + } + + return glslVersion; + } + + public static GlVersion parseGlVersion(String versionString, GlVersion def) { + try { + if (versionString == null) { + return def; + } else { + Pattern e = Pattern.compile("([0-9]+)\\.([0-9]+)(\\.([0-9]+))?(.+)?"); + Matcher matcher = e.matcher(versionString); + + if (!matcher.matches()) { + return def; + } else { + int major = Integer.parseInt(matcher.group(1)); + int minor = Integer.parseInt(matcher.group(2)); + int release = matcher.group(4) != null ? Integer.parseInt(matcher.group(4)) : 0; + String suffix = matcher.group(5); + return new GlVersion(major, minor, release, suffix); + } + } + } catch (Exception var8) { + var8.printStackTrace(); + return def; + } + } + + public static String[] getOpenGlExtensions() { + if (openGlExtensions == null) { + openGlExtensions = detectOpenGlExtensions(); + } + + return openGlExtensions; + } + + private static String[] detectOpenGlExtensions() { + try { + GlVersion e = getGlVersion(); + + if (e.getMajor() >= 3) { + int exts = GL11.glGetInteger(33309); + + if (exts > 0) { + String[] exts1 = new String[exts]; + + for (int i = 0; i < exts; ++i) { + exts1[i] = GL30.glGetStringi(7939, i); + } + + return exts1; + } + } + } catch (Exception var5) { + var5.printStackTrace(); + } + + try { + String var6 = GL11.glGetString(GL11.GL_EXTENSIONS); + String[] var7 = var6.split(" "); + return var7; + } catch (Exception var4) { + var4.printStackTrace(); + return new String[0]; + } + } + + public static void updateThreadPriorities() { + updateAvailableProcessors(); + boolean ELEVATED_PRIORITY = true; + + if (isSingleProcessor()) { + if (isSmoothWorld()) { + minecraftThread.setPriority(10); + setThreadPriority("Server thread", 1); + } else { + minecraftThread.setPriority(5); + setThreadPriority("Server thread", 5); + } + } else { + minecraftThread.setPriority(10); + setThreadPriority("Server thread", 5); + } + } + + private static void setThreadPriority(String prefix, int priority) { + try { + ThreadGroup e = Thread.currentThread().getThreadGroup(); + + if (e == null) { + return; + } + + int num = (e.activeCount() + 10) * 2; + Thread[] ts = new Thread[num]; + e.enumerate(ts, false); + + for (int i = 0; i < ts.length; ++i) { + Thread t = ts[i]; + + if (t != null && t.getName().startsWith(prefix)) { + t.setPriority(priority); + } + } + } catch (Throwable var7) { + warn(var7.getClass().getName() + ": " + var7.getMessage()); + } + } + + public static boolean isMinecraftThread() { + return Thread.currentThread() == minecraftThread; + } + + private static void startVersionCheckThread() { + VersionCheckThread vct = new VersionCheckThread(); + vct.start(); + } + + public static boolean isMipmaps() { + return gameSettings.mipmapLevels > 0; + } + + public static int getMipmapLevels() { + return gameSettings.mipmapLevels; + } + + public static int getMipmapType() { + switch (gameSettings.ofMipmapType) { + case 0: + return 9986; + + case 1: + return 9986; + + case 2: + if (isMultiTexture()) { + return 9985; + } + + return 9986; + + case 3: + if (isMultiTexture()) { + return 9987; + } + + return 9986; + + default: + return 9986; + } + } + + public static boolean isUseAlphaFunc() { + float alphaFuncLevel = getAlphaFuncLevel(); + return alphaFuncLevel > DEF_ALPHA_FUNC_LEVEL.floatValue() + 1.0E-5F; + } + + public static float getAlphaFuncLevel() { + return DEF_ALPHA_FUNC_LEVEL.floatValue(); + } + + public static boolean isFogFancy() { + return !isFancyFogAvailable() ? false : gameSettings.ofFogType == 2; + } + + public static boolean isFogFast() { + return gameSettings.ofFogType == 1; + } + + public static boolean isFogOff() { + return gameSettings.ofFogType == 3; + } + + public static float getFogStart() { + return gameSettings.ofFogStart; + } + + public static boolean isOcclusionEnabled() { + return gameSettings.advancedOpengl; + } + + public static boolean isOcclusionFancy() { + return !isOcclusionEnabled() ? false : gameSettings.ofOcclusionFancy; + } + + public static boolean isLoadChunksFar() { + return gameSettings.ofLoadFar; + } + + public static int getPreloadedChunks() { + return gameSettings.ofPreloadedChunks; + } + + public static void dbg(String s) { + LOGGER.info("[OptiFine] " + s); + } + + public static void warn(String s) { + LOGGER.warn("[OptiFine] " + s); + } + + public static void error(String s) { + LOGGER.error("[OptiFine] " + s); + } + + public static void log(String s) { + dbg(s); + } + + public static int getUpdatesPerFrame() { + return gameSettings.ofChunkUpdates; + } + + public static boolean isDynamicUpdates() { + return gameSettings.ofChunkUpdatesDynamic; + } + + public static boolean isRainFancy() { + return gameSettings.ofRain == 0 ? gameSettings.fancyGraphics : gameSettings.ofRain == 2; + } + + public static boolean isWaterFancy() { + return gameSettings.ofWater == 0 ? gameSettings.fancyGraphics : gameSettings.ofWater == 2; + } + + public static boolean isRainOff() { + return gameSettings.ofRain == 3; + } + + public static boolean isCloudsFancy() { + return gameSettings.ofClouds != 0 ? gameSettings.ofClouds == 2 : (isShaders() && !Shaders.shaderPackClouds.isDefault() ? Shaders.shaderPackClouds.isFancy() : (texturePackClouds != 0 ? texturePackClouds == 2 : gameSettings.fancyGraphics)); + } + + public static boolean isCloudsOff() { + return gameSettings.ofClouds != 0 ? gameSettings.ofClouds == 3 : (isShaders() && !Shaders.shaderPackClouds.isDefault() ? Shaders.shaderPackClouds.isOff() : (texturePackClouds != 0 ? texturePackClouds == 3 : false)); + } + + public static void updateTexturePackClouds() { + texturePackClouds = 0; + IResourceManager rm = getResourceManager(); + + if (rm != null) { + try { + InputStream e = rm.getResource(new ResourceLocation("mcpatcher/color.properties")).getInputStream(); + + if (e == null) { + return; + } + + Properties props = new Properties(); + props.load(e); + e.close(); + String cloudStr = props.getProperty("clouds"); + + if (cloudStr == null) { + return; + } + + dbg("Texture pack clouds: " + cloudStr); + cloudStr = cloudStr.toLowerCase(); + + if (cloudStr.equals("fast")) { + texturePackClouds = 1; + } + + if (cloudStr.equals("fancy")) { + texturePackClouds = 2; + } + + if (cloudStr.equals("off")) { + texturePackClouds = 3; + } + } catch (Exception var4) { + ; + } + } + } + + public static boolean isTreesFancy() { + return gameSettings.ofTrees == 0 ? gameSettings.fancyGraphics : gameSettings.ofTrees == 2; + } + + public static boolean isGrassFancy() { + return gameSettings.ofGrass == 0 ? gameSettings.fancyGraphics : gameSettings.ofGrass == 2; + } + + public static boolean isDroppedItemsFancy() { + return gameSettings.ofDroppedItems == 0 ? gameSettings.fancyGraphics : gameSettings.ofDroppedItems == 2; + } + + public static int limit(int val, int min, int max) { + return val < min ? min : (val > max ? max : val); + } + + public static float limit(float val, float min, float max) { + return val < min ? min : (val > max ? max : val); + } + + public static double limit(double val, double min, double max) { + return val < min ? min : (val > max ? max : val); + } + + public static float limitTo1(float val) { + return val < 0.0F ? 0.0F : (val > 1.0F ? 1.0F : val); + } + + public static boolean isAnimatedWater() { + return gameSettings.ofAnimatedWater != 2; + } + + public static boolean isGeneratedWater() { + return gameSettings.ofAnimatedWater == 1; + } + + public static boolean isAnimatedPortal() { + return gameSettings.ofAnimatedPortal; + } + + public static boolean isAnimatedLava() { + return gameSettings.ofAnimatedLava != 2; + } + + public static boolean isGeneratedLava() { + return gameSettings.ofAnimatedLava == 1; + } + + public static boolean isAnimatedFire() { + return gameSettings.ofAnimatedFire; + } + + public static boolean isAnimatedRedstone() { + return gameSettings.ofAnimatedRedstone; + } + + public static boolean isAnimatedExplosion() { + return gameSettings.ofAnimatedExplosion; + } + + public static boolean isAnimatedFlame() { + return gameSettings.ofAnimatedFlame; + } + + public static boolean isAnimatedSmoke() { + return gameSettings.ofAnimatedSmoke; + } + + public static boolean isVoidParticles() { + return gameSettings.ofVoidParticles; + } + + public static boolean isWaterParticles() { + return gameSettings.ofWaterParticles; + } + + public static boolean isRainSplash() { + return gameSettings.ofRainSplash; + } + + public static boolean isPortalParticles() { + return gameSettings.ofPortalParticles; + } + + public static boolean isPotionParticles() { + return gameSettings.ofPotionParticles; + } + + public static boolean isDepthFog() { + return gameSettings.ofDepthFog; + } + + public static float getAmbientOcclusionLevel() { + return isShaders() && Shaders.aoLevel >= 0.0F ? Shaders.aoLevel : gameSettings.ofAoLevel; + } + + public static String listToString(List list) { + return listToString(list, ", "); + } + + public static String listToString(List list, String separator) { + if (list == null) { + return ""; + } else { + StringBuffer buf = new StringBuffer(list.size() * 5); + + for (int i = 0; i < list.size(); ++i) { + Object obj = list.get(i); + + if (i > 0) { + buf.append(separator); + } + + buf.append(String.valueOf(obj)); + } + + return buf.toString(); + } + } + + public static String arrayToString(Object[] arr) { + return arrayToString(arr, ", "); + } + + public static String arrayToString(Object[] arr, String separator) { + if (arr == null) { + return ""; + } else { + StringBuffer buf = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) { + Object obj = arr[i]; + + if (i > 0) { + buf.append(separator); + } + + buf.append(String.valueOf(obj)); + } + + return buf.toString(); + } + } + + public static String arrayToString(int[] arr) { + return arrayToString(arr, ", "); + } + + public static String arrayToString(int[] arr, String separator) { + if (arr == null) { + return ""; + } else { + StringBuffer buf = new StringBuffer(arr.length * 5); + + for (int i = 0; i < arr.length; ++i) { + int x = arr[i]; + + if (i > 0) { + buf.append(separator); + } + + buf.append(String.valueOf(x)); + } + + return buf.toString(); + } + } + + public static Minecraft getMinecraft() { + return minecraft; + } + + public static TextureManager getTextureManager() { + return minecraft.getTextureManager(); + } + + public static IResourceManager getResourceManager() { + return minecraft.getResourceManager(); + } + + public static InputStream getResourceStream(ResourceLocation location) throws IOException { + return getResourceStream(minecraft.getResourceManager(), location); + } + + public static InputStream getResourceStream(IResourceManager resourceManager, ResourceLocation location) throws IOException { + IResource res = resourceManager.getResource(location); + return res == null ? null : res.getInputStream(); + } + + public static IResource getResource(ResourceLocation location) throws IOException { + return minecraft.getResourceManager().getResource(location); + } + + public static boolean hasResource(ResourceLocation location) { + try { + IResource e = getResource(location); + return e != null; + } catch (IOException var2) { + return false; + } + } + + public static boolean hasResource(IResourceManager resourceManager, ResourceLocation location) { + try { + IResource e = resourceManager.getResource(location); + return e != null; + } catch (IOException var3) { + return false; + } + } + + public static IResourcePack[] getResourcePacks() { + ResourcePackRepository rep = minecraft.getResourcePackRepository(); + List entries = rep.getRepositoryEntries(); + ArrayList list = new ArrayList(); + Iterator rps = entries.iterator(); + + while (rps.hasNext()) { + Entry entry = (Entry)rps.next(); + list.add(entry.getResourcePack()); + } + + if (rep.func_148530_e() != null) { + list.add(rep.func_148530_e()); + } + + IResourcePack[] rps1 = (IResourcePack[])((IResourcePack[])list.toArray(new IResourcePack[list.size()])); + return rps1; + } + + public static String getResourcePackNames() { + if (minecraft.getResourcePackRepository() == null) { + return ""; + } else { + IResourcePack[] rps = getResourcePacks(); + + if (rps.length <= 0) { + return getDefaultResourcePack().getPackName(); + } else { + String[] names = new String[rps.length]; + + for (int nameStr = 0; nameStr < rps.length; ++nameStr) { + names[nameStr] = rps[nameStr].getPackName(); + } + + String var3 = arrayToString((Object[])names); + return var3; + } + } + } + + public static IResourcePack getDefaultResourcePack() { + return minecraft.getResourcePackRepository().rprDefaultResourcePack; + } + + public static boolean isFromDefaultResourcePack(ResourceLocation loc) { + IResourcePack rp = getDefiningResourcePack(loc); + return rp == getDefaultResourcePack(); + } + + public static IResourcePack getDefiningResourcePack(ResourceLocation loc) { + IResourcePack[] rps = getResourcePacks(); + + for (int i = rps.length - 1; i >= 0; --i) { + IResourcePack rp = rps[i]; + + if (rp.resourceExists(loc)) { + return rp; + } + } + + if (getDefaultResourcePack().resourceExists(loc)) { + return getDefaultResourcePack(); + } else { + return null; + } + } + + public static RenderGlobal getRenderGlobal() { + return minecraft == null ? null : minecraft.renderGlobal; + } + + public static int getMaxDynamicTileWidth() { + return 64; + } + + public static IIcon getSideGrassTexture(IBlockAccess blockAccess, int x, int y, int z, int side, IIcon icon) { + if (!isBetterGrass()) { + return icon; + } else { + IIcon fullIcon = TextureUtils.iconGrassTop; + Object destBlock = Blocks.grass; + + if (icon == TextureUtils.iconMyceliumSide) { + fullIcon = TextureUtils.iconMyceliumTop; + destBlock = Blocks.mycelium; + } + + if (isBetterGrassFancy()) { + --y; + + switch (side) { + case 2: + --z; + break; + + case 3: + ++z; + break; + + case 4: + --x; + break; + + case 5: + ++x; + } + + Block block = blockAccess.getBlock(x, y, z); + + if (block != destBlock) { + return icon; + } + } + + return fullIcon; + } + } + + public static IIcon getSideSnowGrassTexture(IBlockAccess blockAccess, int x, int y, int z, int side) { + if (!isBetterGrass()) { + return TextureUtils.iconGrassSideSnowed; + } else { + if (isBetterGrassFancy()) { + switch (side) { + case 2: + --z; + break; + + case 3: + ++z; + break; + + case 4: + --x; + break; + + case 5: + ++x; + } + + Block block = blockAccess.getBlock(x, y, z); + + if (block != Blocks.snow_layer && block != Blocks.snow) { + return TextureUtils.iconGrassSideSnowed; + } + } + + return TextureUtils.iconSnow; + } + } + + public static boolean isBetterGrass() { + return gameSettings.ofBetterGrass != 3; + } + + public static boolean isBetterGrassFancy() { + return gameSettings.ofBetterGrass == 2; + } + + public static boolean isWeatherEnabled() { + return gameSettings.ofWeather; + } + + public static boolean isSkyEnabled() { + return gameSettings.ofSky; + } + + public static boolean isSunMoonEnabled() { + return gameSettings.ofSunMoon; + } + + public static boolean isSunTexture() { + return !isSunMoonEnabled() ? false : !isShaders() || Shaders.isSun(); + } + + public static boolean isMoonTexture() { + return !isSunMoonEnabled() ? false : !isShaders() || Shaders.isMoon(); + } + + public static boolean isVignetteEnabled() { + return isShaders() && !Shaders.isVignette() ? false : (gameSettings.ofVignette == 0 ? gameSettings.fancyGraphics : gameSettings.ofVignette == 2); + } + + public static boolean isStarsEnabled() { + return gameSettings.ofStars; + } + + public static void sleep(long ms) { + try { + Thread.sleep(ms); + } catch (InterruptedException var3) { + var3.printStackTrace(); + } + } + + public static boolean isTimeDayOnly() { + return gameSettings.ofTime == 1; + } + + public static boolean isTimeDefault() { + return gameSettings.ofTime == 0 || gameSettings.ofTime == 2; + } + + public static boolean isTimeNightOnly() { + return gameSettings.ofTime == 3; + } + + public static boolean isClearWater() { + return gameSettings.ofClearWater; + } + + public static int getAnisotropicFilterLevel() { + return gameSettings.anisotropicFiltering; + } + + public static boolean isAnisotropicFiltering() { + return getAnisotropicFilterLevel() > 1; + } + + public static int getAntialiasingLevel() { + return antialiasingLevel; + } + + public static boolean isAntialiasing() { + return false; + } + + public static boolean isAntialiasingConfigured() { + return false; + } + + public static boolean isMultiTexture() { + return false; + } + + public static boolean between(int val, int min, int max) { + return val >= min && val <= max; + } + + public static boolean isDrippingWaterLava() { + return gameSettings.ofDrippingWaterLava; + } + + public static boolean isBetterSnow() { + return gameSettings.ofBetterSnow; + } + + public static Dimension getFullscreenDimension() { + if (desktopDisplayMode == null) { + return null; + } else if (gameSettings == null) { + return new Dimension(desktopDisplayMode.getWidth(), desktopDisplayMode.getHeight()); + } else { + String dimStr = gameSettings.ofFullscreenMode; + + if (dimStr.equals("Default")) { + return new Dimension(desktopDisplayMode.getWidth(), desktopDisplayMode.getHeight()); + } else { + String[] dimStrs = tokenize(dimStr, " x"); + return dimStrs.length < 2 ? new Dimension(desktopDisplayMode.getWidth(), desktopDisplayMode.getHeight()) : new Dimension(parseInt(dimStrs[0], -1), parseInt(dimStrs[1], -1)); + } + } + } + + public static int parseInt(String str, int defVal) { + try { + if (str == null) { + return defVal; + } else { + str = str.trim(); + return Integer.parseInt(str); + } + } catch (NumberFormatException var3) { + return defVal; + } + } + + public static float parseFloat(String str, float defVal) { + try { + if (str == null) { + return defVal; + } else { + str = str.trim(); + return Float.parseFloat(str); + } + } catch (NumberFormatException var3) { + return defVal; + } + } + + public static boolean parseBoolean(String str, boolean defVal) { + try { + if (str == null) { + return defVal; + } else { + str = str.trim(); + return Boolean.parseBoolean(str); + } + } catch (NumberFormatException var3) { + return defVal; + } + } + + public static String[] tokenize(String str, String delim) { + StringTokenizer tok = new StringTokenizer(str, delim); + ArrayList list = new ArrayList(); + + while (tok.hasMoreTokens()) { + String strs = tok.nextToken(); + list.add(strs); + } + + String[] strs1 = (String[])((String[])list.toArray(new String[list.size()])); + return strs1; + } + + public static DisplayMode getDesktopDisplayMode() { + return desktopDisplayMode; + } + + public static DisplayMode[] getDisplayModes() { + if (displayModes == null) { + try { + DisplayMode[] e = Display.getAvailableDisplayModes(); + Set setDimensions = getDisplayModeDimensions(e); + ArrayList list = new ArrayList(); + Iterator fsModes = setDimensions.iterator(); + + while (fsModes.hasNext()) { + Dimension dim = (Dimension)fsModes.next(); + DisplayMode[] dimModes = getDisplayModes(e, dim); + DisplayMode dm = getDisplayMode(dimModes, desktopDisplayMode); + + if (dm != null) { + list.add(dm); + } + } + + DisplayMode[] fsModes1 = (DisplayMode[])((DisplayMode[])list.toArray(new DisplayMode[list.size()])); + Arrays.sort(fsModes1, new DisplayModeComparator()); + return fsModes1; + } catch (Exception var7) { + var7.printStackTrace(); + displayModes = new DisplayMode[] {desktopDisplayMode}; + } + } + + return displayModes; + } + + public static DisplayMode getLargestDisplayMode() { + DisplayMode[] modes = getDisplayModes(); + + if (modes != null && modes.length >= 1) { + DisplayMode mode = modes[modes.length - 1]; + return desktopDisplayMode.getWidth() > mode.getWidth() ? desktopDisplayMode : (desktopDisplayMode.getWidth() == mode.getWidth() && desktopDisplayMode.getHeight() > mode.getHeight() ? desktopDisplayMode : mode); + } else { + return desktopDisplayMode; + } + } + + private static Set getDisplayModeDimensions(DisplayMode[] modes) { + HashSet set = new HashSet(); + + for (int i = 0; i < modes.length; ++i) { + DisplayMode mode = modes[i]; + Dimension dim = new Dimension(mode.getWidth(), mode.getHeight()); + set.add(dim); + } + + return set; + } + + private static DisplayMode[] getDisplayModes(DisplayMode[] modes, Dimension dim) { + ArrayList list = new ArrayList(); + + for (int dimModes = 0; dimModes < modes.length; ++dimModes) { + DisplayMode mode = modes[dimModes]; + + if ((double)mode.getWidth() == dim.getWidth() && (double)mode.getHeight() == dim.getHeight()) { + list.add(mode); + } + } + + DisplayMode[] var5 = (DisplayMode[])((DisplayMode[])list.toArray(new DisplayMode[list.size()])); + return var5; + } + + private static DisplayMode getDisplayMode(DisplayMode[] modes, DisplayMode desktopMode) { + if (desktopMode != null) { + for (int i = 0; i < modes.length; ++i) { + DisplayMode mode = modes[i]; + + if (mode.getBitsPerPixel() == desktopMode.getBitsPerPixel() && mode.getFrequency() == desktopMode.getFrequency()) { + return mode; + } + } + } + + if (modes.length <= 0) { + return null; + } else { + Arrays.sort(modes, new DisplayModeComparator()); + return modes[modes.length - 1]; + } + } + + public static String[] getDisplayModeNames() { + DisplayMode[] modes = getDisplayModes(); + String[] names = new String[modes.length]; + + for (int i = 0; i < modes.length; ++i) { + DisplayMode mode = modes[i]; + String name = "" + mode.getWidth() + "x" + mode.getHeight(); + names[i] = name; + } + + return names; + } + + public static DisplayMode getDisplayMode(Dimension dim) throws LWJGLException { + DisplayMode[] modes = getDisplayModes(); + + for (int i = 0; i < modes.length; ++i) { + DisplayMode dm = modes[i]; + + if (dm.getWidth() == dim.width && dm.getHeight() == dim.height) { + return dm; + } + } + + return desktopDisplayMode; + } + + public static boolean isAnimatedTerrain() { + return gameSettings.ofAnimatedTerrain; + } + + public static boolean isAnimatedItems() { + return gameSettings.ofAnimatedItems; + } + + public static boolean isAnimatedTextures() { + return gameSettings.ofAnimatedTextures; + } + + public static boolean isSwampColors() { + return gameSettings.ofSwampColors; + } + + public static boolean isRandomMobs() { + return gameSettings.ofRandomMobs; + } + + public static void checkGlError(String loc) { + int i = GL11.glGetError(); + + if (i != 0) { + String text = GLU.gluErrorString(i); + error("OpenGlError: " + i + " (" + text + "), at: " + loc); + } + } + + public static boolean isSmoothBiomes() { + return gameSettings.ofSmoothBiomes; + } + + public static boolean isCustomColors() { + return gameSettings.ofCustomColors; + } + + public static boolean isCustomSky() { + return gameSettings.ofCustomSky; + } + + public static boolean isCustomFonts() { + return gameSettings.ofCustomFonts; + } + + public static boolean isShowCapes() { + return gameSettings.ofShowCapes; + } + + public static boolean isConnectedTextures() { + return gameSettings.ofConnectedTextures != 3; + } + + public static boolean isNaturalTextures() { + return gameSettings.ofNaturalTextures; + } + + public static boolean isConnectedTexturesFancy() { + return gameSettings.ofConnectedTextures == 2; + } + + public static boolean isFastRender() { + return gameSettings.ofFastRender; + } + + public static boolean isTranslucentBlocksFancy() { + return gameSettings.ofTranslucentBlocks == 2; + } + + public static boolean isShaders() { + return Shaders.shaderPackLoaded; + } + + public static String[] readLines(File file) throws IOException { + FileInputStream fis = new FileInputStream(file); + return readLines((InputStream)fis); + } + + public static String[] readLines(InputStream is) throws IOException { + ArrayList list = new ArrayList(); + InputStreamReader isr = new InputStreamReader(is, "ASCII"); + BufferedReader br = new BufferedReader(isr); + + while (true) { + String lines = br.readLine(); + + if (lines == null) { + String[] lines1 = (String[])((String[])list.toArray(new String[list.size()])); + return lines1; + } + + list.add(lines); + } + } + + public static String readFile(File file) throws IOException { + FileInputStream fin = new FileInputStream(file); + return readInputStream(fin, "ASCII"); + } + + public static String readInputStream(InputStream in) throws IOException { + return readInputStream(in, "ASCII"); + } + + public static String readInputStream(InputStream in, String encoding) throws IOException { + InputStreamReader inr = new InputStreamReader(in, encoding); + BufferedReader br = new BufferedReader(inr); + StringBuffer sb = new StringBuffer(); + + while (true) { + String line = br.readLine(); + + if (line == null) { + return sb.toString(); + } + + sb.append(line); + sb.append("\n"); + } + } + + public static byte[] readAll(InputStream is) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buf = new byte[1024]; + + while (true) { + int bytes = is.read(buf); + + if (bytes < 0) { + is.close(); + byte[] bytes1 = baos.toByteArray(); + return bytes1; + } + + baos.write(buf, 0, bytes); + } + } + + public static GameSettings getGameSettings() { + return gameSettings; + } + + public static String getNewRelease() { + return newRelease; + } + + public static void setNewRelease(String newRelease) { + newRelease = newRelease; + } + + public static int compareRelease(String rel1, String rel2) { + String[] rels1 = splitRelease(rel1); + String[] rels2 = splitRelease(rel2); + String branch1 = rels1[0]; + String branch2 = rels2[0]; + + if (!branch1.equals(branch2)) { + return branch1.compareTo(branch2); + } else { + int rev1 = parseInt(rels1[1], -1); + int rev2 = parseInt(rels2[1], -1); + + if (rev1 != rev2) { + return rev1 - rev2; + } else { + String suf1 = rels1[2]; + String suf2 = rels2[2]; + + if (!suf1.equals(suf2)) { + if (suf1.isEmpty()) { + return 1; + } + + if (suf2.isEmpty()) { + return -1; + } + } + + return suf1.compareTo(suf2); + } + } + } + + private static String[] splitRelease(String relStr) { + if (relStr != null && relStr.length() > 0) { + Pattern p = Pattern.compile("([A-Z])([0-9]+)(.*)"); + Matcher m = p.matcher(relStr); + + if (!m.matches()) { + return new String[] {"", "", ""}; + } else { + String branch = normalize(m.group(1)); + String revision = normalize(m.group(2)); + String suffix = normalize(m.group(3)); + return new String[] {branch, revision, suffix}; + } + } else { + return new String[] {"", "", ""}; + } + } + + public static int intHash(int x) { + x = x ^ 61 ^ x >> 16; + x += x << 3; + x ^= x >> 4; + x *= 668265261; + x ^= x >> 15; + return x; + } + + public static int getRandom(int x, int y, int z, int face) { + int rand = intHash(face + 37); + rand = intHash(rand + x); + rand = intHash(rand + z); + rand = intHash(rand + y); + return rand; + } + + public static WorldServer getWorldServer() { + WorldClient world = minecraft.theWorld; + + if (world == null) { + return null; + } else if (!minecraft.isIntegratedServerRunning()) { + return null; + } else { + IntegratedServer is = minecraft.getIntegratedServer(); + + if (is == null) { + return null; + } else { + WorldProvider wp = world.provider; + + if (wp == null) { + return null; + } else { + int wd = wp.dimensionId; + + try { + WorldServer e = is.worldServerForDimension(wd); + return e; + } catch (NullPointerException var5) { + return null; + } + } + } + } + } + + public static int getAvailableProcessors() { + return availableProcessors; + } + + public static void updateAvailableProcessors() { + availableProcessors = Runtime.getRuntime().availableProcessors(); + } + + public static boolean isSingleProcessor() { + return getAvailableProcessors() <= 1; + } + + public static boolean isSmoothWorld() { + return !isSingleProcessor() ? false : gameSettings.ofSmoothWorld; + } + + public static boolean isLazyChunkLoading() { + return gameSettings.ofLazyChunkLoading; + } + + public static int getChunkViewDistance() { + if (gameSettings == null) { + return 10; + } else { + int chunkDistance = gameSettings.renderDistanceChunks; + return chunkDistance; + } + } + + public static boolean equals(Object o1, Object o2) { + return o1 == o2 ? true : (o1 == null ? false : o1.equals(o2)); + } + + public static boolean equalsOne(Object a, Object[] bs) { + if (bs == null) { + return false; + } else { + for (int i = 0; i < bs.length; ++i) { + Object b = bs[i]; + + if (equals(a, b)) { + return true; + } + } + + return false; + } + } + + public static boolean equalsOne(int val, int[] vals) { + for (int i = 0; i < vals.length; ++i) { + if (vals[i] == val) { + return true; + } + } + + return false; + } + + public static boolean isSameOne(Object a, Object[] bs) { + if (bs == null) { + return false; + } else { + for (int i = 0; i < bs.length; ++i) { + Object b = bs[i]; + + if (a == b) { + return true; + } + } + + return false; + } + } + + public static String normalize(String s) { + return s == null ? "" : s; + } + + public static void checkDisplaySettings() { + int samples = getAntialiasingLevel(); + + if (samples > 0) { + DisplayMode displayMode = Display.getDisplayMode(); + dbg("FSAA Samples: " + samples); + + try { + Display.destroy(); + Display.setDisplayMode(displayMode); + Display.create((new PixelFormat()).withDepthBits(24).withSamples(samples)); + Display.setResizable(false); + Display.setResizable(true); + } catch (LWJGLException var9) { + warn("Error setting FSAA: " + samples + "x"); + var9.printStackTrace(); + + try { + Display.setDisplayMode(displayMode); + Display.create((new PixelFormat()).withDepthBits(24)); + Display.setResizable(false); + Display.setResizable(true); + } catch (LWJGLException var8) { + var8.printStackTrace(); + + try { + Display.setDisplayMode(displayMode); + Display.create(); + Display.setResizable(false); + Display.setResizable(true); + } catch (LWJGLException var7) { + var7.printStackTrace(); + } + } + } + + if (Util.getOSType() != EnumOS.OSX) { + try { + File e = new File(minecraft.mcDataDir, "assets"); + ByteBuffer bufIcon16 = readIconImage(new File(e, "/icons/icon_16x16.png")); + ByteBuffer bufIcon32 = readIconImage(new File(e, "/icons/icon_32x32.png")); + ByteBuffer[] buf = new ByteBuffer[] {bufIcon16, bufIcon32}; + Display.setIcon(buf); + } catch (IOException var6) { + warn(var6.getClass().getName() + ": " + var6.getMessage()); + } + } + } + } + + private static ByteBuffer readIconImage(File par1File) throws IOException { + BufferedImage var2 = ImageIO.read(par1File); + int[] var3 = var2.getRGB(0, 0, var2.getWidth(), var2.getHeight(), (int[])null, 0, var2.getWidth()); + ByteBuffer var4 = ByteBuffer.allocate(4 * var3.length); + int[] var5 = var3; + int var6 = var3.length; + + for (int var7 = 0; var7 < var6; ++var7) { + int var8 = var5[var7]; + var4.putInt(var8 << 8 | var8 >> 24 & 255); + } + + var4.flip(); + return var4; + } + + public static void checkDisplayMode() { + try { + if (minecraft.isFullScreen()) { + if (fullscreenModeChecked) { + return; + } + + fullscreenModeChecked = true; + desktopModeChecked = false; + DisplayMode e = Display.getDisplayMode(); + Dimension dim = getFullscreenDimension(); + + if (dim == null) { + return; + } + + if (e.getWidth() == dim.width && e.getHeight() == dim.height) { + return; + } + + DisplayMode newMode = getDisplayMode(dim); + + if (newMode == null) { + return; + } + + Display.setDisplayMode(newMode); + minecraft.displayWidth = Display.getDisplayMode().getWidth(); + minecraft.displayHeight = Display.getDisplayMode().getHeight(); + + if (minecraft.displayWidth <= 0) { + minecraft.displayWidth = 1; + } + + if (minecraft.displayHeight <= 0) { + minecraft.displayHeight = 1; + } + + if (minecraft.currentScreen != null) { + ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight); + int sw = sr.getScaledWidth(); + int sh = sr.getScaledHeight(); + minecraft.currentScreen.setWorldAndResolution(minecraft, sw, sh); + } + + minecraft.loadingScreen = new LoadingScreenRenderer(minecraft); + updateFramebufferSize(); + Display.setFullscreen(true); + minecraft.gameSettings.updateVSync(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } else { + if (desktopModeChecked) { + return; + } + + desktopModeChecked = true; + fullscreenModeChecked = false; + minecraft.gameSettings.updateVSync(); + Display.update(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + Display.setResizable(false); + Display.setResizable(true); + } + } catch (Exception var6) { + var6.printStackTrace(); + gameSettings.ofFullscreenMode = "Default"; + gameSettings.saveOfOptions(); + } + } + + public static void updateFramebufferSize() { + minecraft.getFramebuffer().createBindFramebuffer(minecraft.displayWidth, minecraft.displayHeight); + + if (minecraft.entityRenderer != null) { + minecraft.entityRenderer.updateShaderGroupSize(minecraft.displayWidth, minecraft.displayHeight); + } + } + + public static Object[] addObjectToArray(Object[] arr, Object obj) { + if (arr == null) { + throw new NullPointerException("The given array is NULL"); + } else { + int arrLen = arr.length; + int newLen = arrLen + 1; + Object[] newArr = (Object[])((Object[])Array.newInstance(arr.getClass().getComponentType(), newLen)); + System.arraycopy(arr, 0, newArr, 0, arrLen); + newArr[arrLen] = obj; + return newArr; + } + } + + public static Object[] addObjectToArray(Object[] arr, Object obj, int index) { + ArrayList list = new ArrayList(Arrays.asList(arr)); + list.add(index, obj); + Object[] newArr = (Object[])((Object[])Array.newInstance(arr.getClass().getComponentType(), list.size())); + return list.toArray(newArr); + } + + public static Object[] addObjectsToArray(Object[] arr, Object[] objs) { + if (arr == null) { + throw new NullPointerException("The given array is NULL"); + } else if (objs.length == 0) { + return arr; + } else { + int arrLen = arr.length; + int newLen = arrLen + objs.length; + Object[] newArr = (Object[])((Object[])Array.newInstance(arr.getClass().getComponentType(), newLen)); + System.arraycopy(arr, 0, newArr, 0, arrLen); + System.arraycopy(objs, 0, newArr, arrLen, objs.length); + return newArr; + } + } + + public static boolean isCustomItems() { + return false; + } + + public static void drawFps() { + String debugStr = minecraft.debug; + int pos = debugStr.indexOf(32); + + if (pos < 0) { + pos = 0; + } + + String fps = debugStr.substring(0, pos); + String updates = getUpdates(minecraft.debug); + int renderersActive = minecraft.renderGlobal.getCountActiveRenderers(); + int entities = minecraft.renderGlobal.getCountEntitiesRendered(); + int tileEntities = minecraft.renderGlobal.getCountTileEntitiesRendered(); + String fpsStr = fps + " fps, C: " + renderersActive + ", E: " + entities + "+" + tileEntities + ", U: " + updates; + minecraft.fontRenderer.drawString(fpsStr, 2, 2, -2039584); + } + + public static int getFpsMin() + { + if (minecraft.debug == mcDebugLast) + { + return fpsMinLast; + } + else + { + mcDebugLast = minecraft.debug; + FrameTimer frametimer = minecraft.getFrameTimer(); + long[] along = frametimer.getFrames(); + int i = frametimer.getIndex(); + int j = frametimer.getLastIndex(); + + if (i == j) + { + return fpsMinLast; + } + else + { + int k = Minecraft.debugFPS; + + if (k <= 0) + { + k = 1; + } + + long l = (long)(1.0D / (double)k * 1.0E9D); + long i1 = l; + long j1 = 0L; + + for (int k1 = MathHelper.normalizeAngle(i - 1, along.length); k1 != j && (double)j1 < 1.0E9D; k1 = MathHelper.normalizeAngle(k1 - 1, along.length)) + { + long l1 = along[k1]; + + if (l1 > i1) + { + i1 = l1; + } + + j1 += l1; + } + + double d0 = (double)i1 / 1.0E9D; + fpsMinLast = (int)(1.0D / d0); + return fpsMinLast; + } + } + } + + private static String getUpdates(String str) { + int pos1 = str.indexOf(", "); + + if (pos1 < 0) { + return ""; + } else { + pos1 += 2; + int pos2 = str.indexOf(32, pos1); + return pos2 < 0 ? "" : str.substring(pos1, pos2); + } + } + + public static int getBitsOs() { + String progFiles86 = System.getenv("ProgramFiles(X86)"); + return progFiles86 != null ? 64 : 32; + } + + public static int getBitsJre() { + String[] propNames = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; + + for (int i = 0; i < propNames.length; ++i) { + String propName = propNames[i]; + String propVal = System.getProperty(propName); + + if (propVal != null && propVal.contains("64")) { + return 64; + } + } + + return 32; + } + + public static boolean isNotify64BitJava() { + return notify64BitJava; + } + + public static void setNotify64BitJava(boolean flag) { + notify64BitJava = flag; + } + + public static boolean isConnectedModels() { + return false; + } + + public static void showGuiMessage(String line1, String line2) { + GuiMessage gui = new GuiMessage(minecraft.currentScreen, line1, line2); + minecraft.displayGuiScreen(gui); + } + + public static int[] addIntToArray(int[] intArray, int intValue) { + return addIntsToArray(intArray, new int[] {intValue}); + } + + public static int[] addIntsToArray(int[] intArray, int[] copyFrom) { + if (intArray != null && copyFrom != null) { + int arrLen = intArray.length; + int newLen = arrLen + copyFrom.length; + int[] newArray = new int[newLen]; + System.arraycopy(intArray, 0, newArray, 0, arrLen); + + for (int index = 0; index < copyFrom.length; ++index) { + newArray[index + arrLen] = copyFrom[index]; + } + + return newArray; + } else { + throw new NullPointerException("The given array is NULL"); + } + } + + public static DynamicTexture getMojangLogoTexture(DynamicTexture texDefault) { + try { + ResourceLocation e = new ResourceLocation("textures/gui/title/mojang.png"); + InputStream in = getResourceStream(e); + + if (in == null) { + return texDefault; + } else { + BufferedImage bi = ImageIO.read(in); + + if (bi == null) { + return texDefault; + } else { + DynamicTexture dt = new DynamicTexture(bi); + return dt; + } + } + } catch (Exception var5) { + warn(var5.getClass().getName() + ": " + var5.getMessage()); + return texDefault; + } + } + + public static void writeFile(File file, String str) throws IOException { + FileOutputStream fos = new FileOutputStream(file); + byte[] bytes = str.getBytes("ASCII"); + fos.write(bytes); + fos.close(); + } + + public static boolean isDynamicFov() { + return gameSettings.ofDynamicFov; + } + + public static TextureMap getTextureMap() { + return getMinecraft().getTextureMapBlocks(); + } + + public static boolean isDynamicLights() { + return gameSettings.ofDynamicLights != 3; + } + + public static boolean isDynamicLightsFast() { + return gameSettings.ofDynamicLights == 1; + } + + public static boolean isDynamicHandLight() { + return !isDynamicLights() ? false : (isShaders() ? Shaders.isDynamicHandLight() : true); + } + + public static int[] toPrimitive(Integer[] arr) { + if (arr == null) { + return null; + } else if (arr.length == 0) { + return new int[0]; + } else { + int[] intArr = new int[arr.length]; + + for (int i = 0; i < intArr.length; ++i) { + intArr[i] = arr[i].intValue(); + } + + return intArr; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedParser.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedParser.java new file mode 100644 index 0000000..372dab0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedParser.java @@ -0,0 +1,592 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import net.minecraft.block.Block; +import net.minecraft.world.biome.BiomeGenBase; + +public class ConnectedParser { + private String context = null; + public static final VillagerProfession[] PROFESSIONS_INVALID = new VillagerProfession[0]; + + public ConnectedParser(String context) { + this.context = context; + } + + public String parseName(String path) { + String str = path; + int pos = path.lastIndexOf(47); + + if (pos >= 0) { + str = path.substring(pos + 1); + } + + int pos2 = str.lastIndexOf(46); + + if (pos2 >= 0) { + str = str.substring(0, pos2); + } + + return str; + } + + public String parseBasePath(String path) { + int pos = path.lastIndexOf(47); + return pos < 0 ? "" : path.substring(0, pos); + } + + public MatchBlock[] parseMatchBlocks(String propMatchBlocks) { + if (propMatchBlocks == null) { + return null; + } else { + ArrayList list = new ArrayList(); + String[] blockStrs = Config.tokenize(propMatchBlocks, " "); + + for (int mbs = 0; mbs < blockStrs.length; ++mbs) { + String blockStr = blockStrs[mbs]; + MatchBlock[] mbs1 = this.parseMatchBlock(blockStr); + + if (mbs1 != null) { + list.addAll(Arrays.asList(mbs1)); + } + } + + MatchBlock[] var7 = (MatchBlock[])((MatchBlock[])list.toArray(new MatchBlock[list.size()])); + return var7; + } + } + + public MatchBlock[] parseMatchBlock(String blockStr) { + if (blockStr == null) { + return null; + } else { + blockStr = blockStr.trim(); + + if (blockStr.length() <= 0) { + return null; + } else { + String[] parts = Config.tokenize(blockStr, ":"); + String domain = "minecraft"; + boolean blockIndex = false; + byte var14; + + if (parts.length > 1 && this.isFullBlockName(parts)) { + domain = parts[0]; + var14 = 1; + } else { + domain = "minecraft"; + var14 = 0; + } + + String blockPart = parts[var14]; + String[] params = (String[])Arrays.copyOfRange(parts, var14 + 1, parts.length); + Block[] blocks = this.parseBlockPart(domain, blockPart); + + if (blocks == null) { + return null; + } else { + MatchBlock[] datas = new MatchBlock[blocks.length]; + + for (int i = 0; i < blocks.length; ++i) { + Block block = blocks[i]; + int blockId = Block.getIdFromBlock(block); + int[] metadatas = null; + + if (params.length > 0) { + metadatas = this.parseBlockMetadatas(block, params); + + if (metadatas == null) { + return null; + } + } + + MatchBlock bd = new MatchBlock(blockId, metadatas); + datas[i] = bd; + } + + return datas; + } + } + } + } + + public boolean isFullBlockName(String[] parts) { + if (parts.length < 2) { + return false; + } else { + String part1 = parts[1]; + return part1.length() < 1 ? false : (this.startsWithDigit(part1) ? false : !part1.contains("=")); + } + } + + public boolean startsWithDigit(String str) { + if (str == null) { + return false; + } else if (str.length() < 1) { + return false; + } else { + char ch = str.charAt(0); + return Character.isDigit(ch); + } + } + + public Block[] parseBlockPart(String domain, String blockPart) { + if (this.startsWithDigit(blockPart)) { + int[] var8 = this.parseIntList(blockPart); + + if (var8 == null) { + return null; + } else { + Block[] var9 = new Block[var8.length]; + + for (int var10 = 0; var10 < var8.length; ++var10) { + int id = var8[var10]; + Block block1 = Block.getBlockById(id); + + if (block1 == null) { + this.warn("Block not found for id: " + id); + return null; + } + + var9[var10] = block1; + } + + return var9; + } + } else { + String fullName = domain + ":" + blockPart; + Block block = Block.getBlockFromName(fullName); + + if (block == null) { + this.warn("Block not found for name: " + fullName); + return null; + } else { + Block[] blocks = new Block[] {block}; + return blocks; + } + } + } + + public int[] parseBlockMetadatas(Block block, String[] params) { + if (params.length <= 0) { + return null; + } else { + String param0 = params[0]; + + if (this.startsWithDigit(param0)) { + int[] mds = this.parseIntList(param0); + return mds; + } else { + this.warn("Invalid block metadata: " + param0); + return null; + } + } + } + + public BiomeGenBase[] parseBiomes(String str) { + if (str == null) { + return null; + } else { + str = str.trim(); + boolean negative = false; + + if (str.startsWith("!")) { + negative = true; + str = str.substring(1); + } + + String[] biomeNames = Config.tokenize(str, " "); + ArrayList list = new ArrayList(); + + for (int biomeArr = 0; biomeArr < biomeNames.length; ++biomeArr) { + String biomeName = biomeNames[biomeArr]; + BiomeGenBase biome = this.findBiome(biomeName); + + if (biome == null) { + this.warn("Biome not found: " + biomeName); + } else { + list.add(biome); + } + } + + if (negative) { + ArrayList var8 = new ArrayList(Arrays.asList(BiomeGenBase.getBiomeGenArray())); + var8.removeAll(list); + list = var8; + } + + BiomeGenBase[] var9 = (BiomeGenBase[])((BiomeGenBase[])list.toArray(new BiomeGenBase[list.size()])); + return var9; + } + } + + public BiomeGenBase findBiome(String biomeName) { + biomeName = biomeName.toLowerCase(); + + if (biomeName.equals("nether")) { + return BiomeGenBase.hell; + } else { + BiomeGenBase[] biomeList = BiomeGenBase.getBiomeGenArray(); + + for (int i = 0; i < biomeList.length; ++i) { + BiomeGenBase biome = biomeList[i]; + + if (biome != null) { + String name = biome.biomeName.replace(" ", "").toLowerCase(); + + if (name.equals(biomeName)) { + return biome; + } + } + } + + return null; + } + } + + public int parseInt(String str) { + if (str == null) { + return -1; + } else { + str = str.trim(); + int num = Config.parseInt(str, -1); + + if (num < 0) { + this.warn("Invalid number: " + str); + } + + return num; + } + } + + public int parseInt(String str, int defVal) { + if (str == null) { + return defVal; + } else { + str = str.trim(); + int num = Config.parseInt(str, -1); + + if (num < 0) { + this.warn("Invalid number: " + str); + return defVal; + } else { + return num; + } + } + } + + public int[] parseIntList(String str) { + if (str == null) { + return null; + } else { + ArrayList list = new ArrayList(); + String[] intStrs = Config.tokenize(str, " ,"); + + for (int ints = 0; ints < intStrs.length; ++ints) { + String i = intStrs[ints]; + + if (i.contains("-")) { + String[] val = Config.tokenize(i, "-"); + + if (val.length != 2) { + this.warn("Invalid interval: " + i + ", when parsing: " + str); + } else { + int min = Config.parseInt(val[0], -1); + int max = Config.parseInt(val[1], -1); + + if (min >= 0 && max >= 0 && min <= max) { + for (int n = min; n <= max; ++n) { + list.add(Integer.valueOf(n)); + } + } else { + this.warn("Invalid interval: " + i + ", when parsing: " + str); + } + } + } else { + int var12 = Config.parseInt(i, -1); + + if (var12 < 0) { + this.warn("Invalid number: " + i + ", when parsing: " + str); + } else { + list.add(Integer.valueOf(var12)); + } + } + } + + int[] var10 = new int[list.size()]; + + for (int var11 = 0; var11 < var10.length; ++var11) { + var10[var11] = ((Integer)list.get(var11)).intValue(); + } + + return var10; + } + } + + public void dbg(String str) { + Config.dbg("" + this.context + ": " + str); + } + + public void warn(String str) { + Config.warn("" + this.context + ": " + str); + } + + public RangeListInt parseRangeListInt(String str) { + if (str == null) { + return null; + } else { + RangeListInt list = new RangeListInt(); + String[] parts = Config.tokenize(str, " ,"); + + for (int i = 0; i < parts.length; ++i) { + String part = parts[i]; + RangeInt ri = this.parseRangeInt(part); + + if (ri == null) { + return null; + } + + list.addRange(ri); + } + + return list; + } + } + + private RangeInt parseRangeInt(String str) { + if (str == null) { + return null; + } else if (str.indexOf(45) >= 0) { + String[] val1 = Config.tokenize(str, "-"); + + if (val1.length != 2) { + this.warn("Invalid range: " + str); + return null; + } else { + int min = Config.parseInt(val1[0], -1); + int max = Config.parseInt(val1[1], -1); + + if (min >= 0 && max >= 0) { + return new RangeInt(min, max); + } else { + this.warn("Invalid range: " + str); + return null; + } + } + } else { + int val = Config.parseInt(str, -1); + + if (val < 0) { + this.warn("Invalid integer: " + str); + return null; + } else { + return new RangeInt(val, val); + } + } + } + + public boolean parseBoolean(String str) { + if (str == null) { + return false; + } else { + String strLower = str.toLowerCase().trim(); + return strLower.equals("true"); + } + } + + public Boolean parseBooleanObject(String str) { + if (str == null) { + return null; + } else { + String strLower = str.toLowerCase().trim(); + + if (strLower.equals("true")) { + return Boolean.TRUE; + } else if (strLower.equals("false")) { + return Boolean.FALSE; + } else { + this.warn("Invalid boolean: " + str); + return null; + } + } + } + + public static int parseColor(String str, int defVal) { + if (str == null) { + return defVal; + } else { + str = str.trim(); + + try { + int e = Integer.parseInt(str, 16) & 16777215; + return e; + } catch (NumberFormatException var3) { + return defVal; + } + } + } + + public NbtTagValue parseNbtTagValue(String path, String value) { + return path != null && value != null ? new NbtTagValue(path, value) : null; + } + + public VillagerProfession[] parseProfessions(String profStr) { + if (profStr == null) { + return null; + } else { + ArrayList list = new ArrayList(); + String[] tokens = Config.tokenize(profStr, " "); + + for (int arr = 0; arr < tokens.length; ++arr) { + String str = tokens[arr]; + VillagerProfession prof = this.parseProfession(str); + + if (prof == null) { + this.warn("Invalid profession: " + str); + return PROFESSIONS_INVALID; + } + + list.add(prof); + } + + if (list.isEmpty()) { + return null; + } else { + VillagerProfession[] var7 = (VillagerProfession[])((VillagerProfession[])list.toArray(new VillagerProfession[list.size()])); + return var7; + } + } + } + + private VillagerProfession parseProfession(String str) { + str = str.toLowerCase(); + String[] parts = Config.tokenize(str, ":"); + + if (parts.length > 2) { + return null; + } else { + String profStr = parts[0]; + String carStr = null; + + if (parts.length > 1) { + carStr = parts[1]; + } + + int prof = parseProfessionId(profStr); + + if (prof < 0) { + return null; + } else { + int[] cars = null; + + if (carStr != null) { + cars = parseCareerIds(prof, carStr); + + if (cars == null) { + return null; + } + } + + return new VillagerProfession(prof, cars); + } + } + } + + private static int parseProfessionId(String str) { + int id = Config.parseInt(str, -1); + return id >= 0 ? id : (str.equals("farmer") ? 0 : (str.equals("librarian") ? 1 : (str.equals("priest") ? 2 : (str.equals("blacksmith") ? 3 : (str.equals("butcher") ? 4 : (str.equals("nitwit") ? 5 : -1)))))); + } + + private static int[] parseCareerIds(int prof, String str) { + HashSet set = new HashSet(); + String[] parts = Config.tokenize(str, ","); + int i; + + for (int integerArr = 0; integerArr < parts.length; ++integerArr) { + String arr = parts[integerArr]; + i = parseCareerId(prof, arr); + + if (i < 0) { + return null; + } + + set.add(Integer.valueOf(i)); + } + + Integer[] var7 = (Integer[])((Integer[])set.toArray(new Integer[set.size()])); + int[] var8 = new int[var7.length]; + + for (i = 0; i < var8.length; ++i) { + var8[i] = var7[i].intValue(); + } + + return var8; + } + + private static int parseCareerId(int prof, String str) { + int id = Config.parseInt(str, -1); + + if (id >= 0) { + return id; + } else { + if (prof == 0) { + if (str.equals("farmer")) { + return 1; + } + + if (str.equals("fisherman")) { + return 2; + } + + if (str.equals("shepherd")) { + return 3; + } + + if (str.equals("fletcher")) { + return 4; + } + } + + if (prof == 1) { + if (str.equals("librarian")) { + return 1; + } + + if (str.equals("cartographer")) { + return 2; + } + } + + if (prof == 2 && str.equals("cleric")) { + return 1; + } else { + if (prof == 3) { + if (str.equals("armor")) { + return 1; + } + + if (str.equals("weapon")) { + return 2; + } + + if (str.equals("tool")) { + return 3; + } + } + + if (prof == 4) { + if (str.equals("butcher")) { + return 1; + } + + if (str.equals("leather")) { + return 2; + } + } + + return prof == 5 && str.equals("nitwit") ? 1 : -1; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedProperties.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedProperties.java new file mode 100644 index 0000000..3e169b4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedProperties.java @@ -0,0 +1,846 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.Properties; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; + +public class ConnectedProperties { + public String name = null; + public String basePath = null; + public int[] matchBlocks = null; + public String[] matchTiles = null; + public int method = 0; + public String[] tiles = null; + public int connect = 0; + public int faces = 63; + public int[] metadatas = null; + public BiomeGenBase[] biomes = null; + public RangeListInt heights = null; + public int renderPass = 0; + public boolean innerSeams = false; + public int width = 0; + public int height = 0; + public int[] weights = null; + public int symmetry = 1; + public boolean linked = false; + public int[] sumWeights = null; + public int sumAllWeights = 1; + public IIcon[] matchTileIcons = null; + public IIcon[] tileIcons = null; + public static final int METHOD_NONE = 0; + public static final int METHOD_CTM = 1; + public static final int METHOD_HORIZONTAL = 2; + public static final int METHOD_TOP = 3; + public static final int METHOD_RANDOM = 4; + public static final int METHOD_REPEAT = 5; + public static final int METHOD_VERTICAL = 6; + public static final int METHOD_FIXED = 7; + public static final int METHOD_HORIZONTAL_VERTICAL = 8; + public static final int METHOD_VERTICAL_HORIZONTAL = 9; + public static final int CONNECT_NONE = 0; + public static final int CONNECT_BLOCK = 1; + public static final int CONNECT_TILE = 2; + public static final int CONNECT_MATERIAL = 3; + public static final int CONNECT_UNKNOWN = 128; + public static final int FACE_BOTTOM = 1; + public static final int FACE_TOP = 2; + public static final int FACE_EAST = 4; + public static final int FACE_WEST = 8; + public static final int FACE_NORTH = 16; + public static final int FACE_SOUTH = 32; + public static final int FACE_SIDES = 60; + public static final int FACE_ALL = 63; + public static final int FACE_UNKNOWN = 128; + public static final int SYMMETRY_NONE = 1; + public static final int SYMMETRY_OPPOSITE = 2; + public static final int SYMMETRY_ALL = 6; + public static final int SYMMETRY_UNKNOWN = 128; + + public ConnectedProperties(Properties props, String path) { + ConnectedParser cp = new ConnectedParser("ConnectedTextures"); + this.name = parseName(path); + this.basePath = parseBasePath(path); + this.matchBlocks = parseBlockIds(props.getProperty("matchBlocks")); + this.matchTiles = this.parseMatchTiles(props.getProperty("matchTiles")); + this.method = parseMethod(props.getProperty("method")); + this.tiles = this.parseTileNames(props.getProperty("tiles")); + this.connect = parseConnect(props.getProperty("connect")); + this.faces = parseFaces(props.getProperty("faces")); + this.metadatas = parseInts(props.getProperty("metadata")); + this.biomes = cp.parseBiomes(props.getProperty("biomes")); + this.heights = cp.parseRangeListInt(props.getProperty("heights")); + + if (this.heights == null) { + int minHeight = cp.parseInt(props.getProperty("minHeight"), -1); + int maxHeight = cp.parseInt(props.getProperty("maxHeight"), 1024); + + if (minHeight != -1 || maxHeight != 1024) { + this.heights = new RangeListInt(new RangeInt(minHeight, maxHeight)); + } + } + + this.renderPass = parseInt(props.getProperty("renderPass")); + this.innerSeams = parseBoolean(props.getProperty("innerSeams")); + this.width = parseInt(props.getProperty("width")); + this.height = parseInt(props.getProperty("height")); + this.weights = parseInts(props.getProperty("weights")); + this.symmetry = parseSymmetry(props.getProperty("symmetry")); + } + + private String[] parseMatchTiles(String str) { + if (str == null) { + return null; + } else { + String[] names = Config.tokenize(str, " "); + + for (int i = 0; i < names.length; ++i) { + String iconName = names[i]; + + if (iconName.endsWith(".png")) { + iconName = iconName.substring(0, iconName.length() - 4); + } + + iconName = TextureUtils.fixResourcePath(iconName, this.basePath); + names[i] = iconName; + } + + return names; + } + } + + private static String parseName(String path) { + String str = path; + int pos = path.lastIndexOf(47); + + if (pos >= 0) { + str = path.substring(pos + 1); + } + + int pos2 = str.lastIndexOf(46); + + if (pos2 >= 0) { + str = str.substring(0, pos2); + } + + return str; + } + + private static String parseBasePath(String path) { + int pos = path.lastIndexOf(47); + return pos < 0 ? "" : path.substring(0, pos); + } + + private static BiomeGenBase[] parseBiomes(String str) { + if (str == null) { + return null; + } else { + String[] biomeNames = Config.tokenize(str, " "); + ArrayList list = new ArrayList(); + + for (int biomeArr = 0; biomeArr < biomeNames.length; ++biomeArr) { + String biomeName = biomeNames[biomeArr]; + BiomeGenBase biome = findBiome(biomeName); + + if (biome == null) { + Config.warn("Biome not found: " + biomeName); + } else { + list.add(biome); + } + } + + BiomeGenBase[] var6 = (BiomeGenBase[])((BiomeGenBase[])list.toArray(new BiomeGenBase[list.size()])); + return var6; + } + } + + private static BiomeGenBase findBiome(String biomeName) { + biomeName = biomeName.toLowerCase(); + BiomeGenBase[] biomeList = BiomeGenBase.getBiomeGenArray(); + + for (int i = 0; i < biomeList.length; ++i) { + BiomeGenBase biome = biomeList[i]; + + if (biome != null) { + String name = biome.biomeName.replace(" ", "").toLowerCase(); + + if (name.equals(biomeName)) { + return biome; + } + } + } + + return null; + } + + private String[] parseTileNames(String str) { + if (str == null) { + return null; + } else { + ArrayList list = new ArrayList(); + String[] iconStrs = Config.tokenize(str, " ,"); + label67: + + for (int names = 0; names < iconStrs.length; ++names) { + String i = iconStrs[names]; + + if (i.contains("-")) { + String[] iconName = Config.tokenize(i, "-"); + + if (iconName.length == 2) { + int pathBlocks = Config.parseInt(iconName[0], -1); + int max = Config.parseInt(iconName[1], -1); + + if (pathBlocks >= 0 && max >= 0) { + if (pathBlocks <= max) { + int n = pathBlocks; + + while (true) { + if (n > max) { + continue label67; + } + + list.add(String.valueOf(n)); + ++n; + } + } + + Config.warn("Invalid interval: " + i + ", when parsing: " + str); + continue; + } + } + } + + list.add(i); + } + + String[] var10 = (String[])((String[])list.toArray(new String[list.size()])); + + for (int var11 = 0; var11 < var10.length; ++var11) { + String var12 = var10[var11]; + var12 = TextureUtils.fixResourcePath(var12, this.basePath); + + if (!var12.startsWith(this.basePath) && !var12.startsWith("textures/") && !var12.startsWith("mcpatcher/")) { + var12 = this.basePath + "/" + var12; + } + + if (var12.endsWith(".png")) { + var12 = var12.substring(0, var12.length() - 4); + } + + String var13 = "textures/blocks/"; + + if (var12.startsWith(var13)) { + var12 = var12.substring(var13.length()); + } + + if (var12.startsWith("/")) { + var12 = var12.substring(1); + } + + var10[var11] = var12; + } + + return var10; + } + } + + private static int parseInt(String str) { + if (str == null) { + return -1; + } else { + int num = Config.parseInt(str, -1); + + if (num < 0) { + Config.warn("Invalid number: " + str); + } + + return num; + } + } + + private static int parseInt(String str, int defVal) { + if (str == null) { + return defVal; + } else { + int num = Config.parseInt(str, -1); + + if (num < 0) { + Config.warn("Invalid number: " + str); + return defVal; + } else { + return num; + } + } + } + + private static boolean parseBoolean(String str) { + return str == null ? false : str.toLowerCase().equals("true"); + } + + private static int parseSymmetry(String str) { + if (str == null) { + return 1; + } else { + str = str.trim(); + + if (str.equals("opposite")) { + return 2; + } else if (str.equals("all")) { + return 6; + } else { + Config.warn("Unknown symmetry: " + str); + return 1; + } + } + } + + private static int parseFaces(String str) { + if (str == null) { + return 63; + } else { + String[] faceStrs = Config.tokenize(str, " ,"); + int facesMask = 0; + + for (int i = 0; i < faceStrs.length; ++i) { + String faceStr = faceStrs[i]; + int faceMask = parseFace(faceStr); + facesMask |= faceMask; + } + + return facesMask; + } + } + + private static int parseFace(String str) { + str = str.toLowerCase(); + + if (str.equals("bottom")) { + return 1; + } else if (str.equals("top")) { + return 2; + } else if (str.equals("north")) { + return 4; + } else if (str.equals("south")) { + return 8; + } else if (str.equals("east")) { + return 32; + } else if (str.equals("west")) { + return 16; + } else if (str.equals("sides")) { + return 60; + } else if (str.equals("all")) { + return 63; + } else { + Config.warn("Unknown face: " + str); + return 128; + } + } + + private static int parseConnect(String str) { + if (str == null) { + return 0; + } else { + str = str.trim(); + + if (str.equals("block")) { + return 1; + } else if (str.equals("tile")) { + return 2; + } else if (str.equals("material")) { + return 3; + } else { + Config.warn("Unknown connect: " + str); + return 128; + } + } + } + + private static int[] parseInts(String str) { + if (str == null) { + return null; + } else { + ArrayList list = new ArrayList(); + String[] intStrs = Config.tokenize(str, " ,"); + + for (int ints = 0; ints < intStrs.length; ++ints) { + String i = intStrs[ints]; + + if (i.contains("-")) { + String[] val = Config.tokenize(i, "-"); + + if (val.length != 2) { + Config.warn("Invalid interval: " + i + ", when parsing: " + str); + } else { + int min = Config.parseInt(val[0], -1); + int max = Config.parseInt(val[1], -1); + + if (min >= 0 && max >= 0 && min <= max) { + for (int n = min; n <= max; ++n) { + list.add(Integer.valueOf(n)); + } + } else { + Config.warn("Invalid interval: " + i + ", when parsing: " + str); + } + } + } else { + int var11 = Config.parseInt(i, -1); + + if (var11 < 0) { + Config.warn("Invalid number: " + i + ", when parsing: " + str); + } else { + list.add(Integer.valueOf(var11)); + } + } + } + + int[] var9 = new int[list.size()]; + + for (int var10 = 0; var10 < var9.length; ++var10) { + var9[var10] = ((Integer)list.get(var10)).intValue(); + } + + return var9; + } + } + + private static int[] parseBlockIds(String str) { + if (str == null) { + return null; + } else { + ArrayList list = new ArrayList(); + String[] intStrs = Config.tokenize(str, " ,"); + + for (int ints = 0; ints < intStrs.length; ++ints) { + String i = intStrs[ints]; + + if (i.contains("-")) { + String[] val = Config.tokenize(i, "-"); + + if (val.length != 2) { + Config.warn("Invalid interval: " + i + ", when parsing: " + str); + } else { + int min = parseBlockId(val[0]); + int max = parseBlockId(val[1]); + + if (min >= 0 && max >= 0 && min <= max) { + for (int n = min; n <= max; ++n) { + list.add(Integer.valueOf(n)); + } + } else { + Config.warn("Invalid interval: " + i + ", when parsing: " + str); + } + } + } else { + int var11 = parseBlockId(i); + + if (var11 < 0) { + Config.warn("Invalid block ID: " + i + ", when parsing: " + str); + } else { + list.add(Integer.valueOf(var11)); + } + } + } + + int[] var9 = new int[list.size()]; + + for (int var10 = 0; var10 < var9.length; ++var10) { + var9[var10] = ((Integer)list.get(var10)).intValue(); + } + + return var9; + } + } + + private static int parseBlockId(String blockStr) { + int val = Config.parseInt(blockStr, -1); + + if (val >= 0) { + return val; + } else { + Block block = Block.getBlockFromName(blockStr); + return block != null ? Block.getIdFromBlock(block) : -1; + } + } + + private static int parseMethod(String str) { + if (str == null) { + return 1; + } else { + str = str.trim(); + + if (!str.equals("ctm") && !str.equals("glass")) { + if (!str.equals("horizontal") && !str.equals("bookshelf")) { + if (str.equals("vertical")) { + return 6; + } else if (str.equals("top")) { + return 3; + } else if (str.equals("random")) { + return 4; + } else if (str.equals("repeat")) { + return 5; + } else if (str.equals("fixed")) { + return 7; + } else if (!str.equals("horizontal+vertical") && !str.equals("h+v")) { + if (!str.equals("vertical+horizontal") && !str.equals("v+h")) { + Config.warn("Unknown method: " + str); + return 0; + } else { + return 9; + } + } else { + return 8; + } + } else { + return 2; + } + } else { + return 1; + } + } + } + + public boolean isValid(String path) { + if (this.name != null && this.name.length() > 0) { + if (this.basePath == null) { + Config.warn("No base path found: " + path); + return false; + } else { + if (this.matchBlocks == null) { + this.matchBlocks = this.detectMatchBlocks(); + } + + if (this.matchTiles == null && this.matchBlocks == null) { + this.matchTiles = this.detectMatchTiles(); + } + + if (this.matchBlocks == null && this.matchTiles == null) { + Config.warn("No matchBlocks or matchTiles specified: " + path); + return false; + } else if (this.method == 0) { + Config.warn("No method: " + path); + return false; + } else if (this.tiles != null && this.tiles.length > 0) { + if (this.connect == 0) { + this.connect = this.detectConnect(); + } + + if (this.connect == 128) { + Config.warn("Invalid connect in: " + path); + return false; + } else if (this.renderPass > 0) { + Config.warn("Render pass not supported: " + this.renderPass); + return false; + } else if ((this.faces & 128) != 0) { + Config.warn("Invalid faces in: " + path); + return false; + } else if ((this.symmetry & 128) != 0) { + Config.warn("Invalid symmetry in: " + path); + return false; + } else { + switch (this.method) { + case 1: + return this.isValidCtm(path); + + case 2: + return this.isValidHorizontal(path); + + case 3: + return this.isValidTop(path); + + case 4: + return this.isValidRandom(path); + + case 5: + return this.isValidRepeat(path); + + case 6: + return this.isValidVertical(path); + + case 7: + return this.isValidFixed(path); + + case 8: + return this.isValidHorizontalVertical(path); + + case 9: + return this.isValidVerticalHorizontal(path); + + default: + Config.warn("Unknown method: " + path); + return false; + } + } + } else { + Config.warn("No tiles specified: " + path); + return false; + } + } + } else { + Config.warn("No name found: " + path); + return false; + } + } + + private int detectConnect() { + return this.matchBlocks != null ? 1 : (this.matchTiles != null ? 2 : 128); + } + + private int[] detectMatchBlocks() { + if (!this.name.startsWith("block")) { + return null; + } else { + int startPos = "block".length(); + int pos; + + for (pos = startPos; pos < this.name.length(); ++pos) { + char idStr = this.name.charAt(pos); + + if (idStr < 48 || idStr > 57) { + break; + } + } + + if (pos == startPos) { + return null; + } else { + String var5 = this.name.substring(startPos, pos); + int id = Config.parseInt(var5, -1); + return id < 0 ? null : new int[] {id}; + } + } + } + + private String[] detectMatchTiles() { + IIcon icon = getIcon(this.name); + return icon == null ? null : new String[] {this.name}; + } + + private static IIcon getIcon(String iconName) { + return TextureMap.textureMapBlocks.getIconSafe(iconName); + } + + private boolean isValidCtm(String path) { + if (this.tiles == null) { + this.tiles = this.parseTileNames("0-11 16-27 32-43 48-58"); + } + + if (this.tiles.length < 47) { + Config.warn("Invalid tiles, must be at least 47: " + path); + return false; + } else { + return true; + } + } + + private boolean isValidHorizontal(String path) { + if (this.tiles == null) { + this.tiles = this.parseTileNames("12-15"); + } + + if (this.tiles.length != 4) { + Config.warn("Invalid tiles, must be exactly 4: " + path); + return false; + } else { + return true; + } + } + + private boolean isValidVertical(String path) { + if (this.tiles == null) { + Config.warn("No tiles defined for vertical: " + path); + return false; + } else if (this.tiles.length != 4) { + Config.warn("Invalid tiles, must be exactly 4: " + path); + return false; + } else { + return true; + } + } + + private boolean isValidHorizontalVertical(String path) { + if (this.tiles == null) { + Config.warn("No tiles defined for horizontal+vertical: " + path); + return false; + } else if (this.tiles.length != 7) { + Config.warn("Invalid tiles, must be exactly 7: " + path); + return false; + } else { + return true; + } + } + + private boolean isValidVerticalHorizontal(String path) { + if (this.tiles == null) { + Config.warn("No tiles defined for vertical+horizontal: " + path); + return false; + } else if (this.tiles.length != 7) { + Config.warn("Invalid tiles, must be exactly 7: " + path); + return false; + } else { + return true; + } + } + + private boolean isValidRandom(String path) { + if (this.tiles != null && this.tiles.length > 0) { + if (this.weights != null) { + int[] sum; + + if (this.weights.length > this.tiles.length) { + Config.warn("More weights defined than tiles, trimming weights: " + path); + sum = new int[this.tiles.length]; + System.arraycopy(this.weights, 0, sum, 0, sum.length); + this.weights = sum; + } + + int i; + + if (this.weights.length < this.tiles.length) { + Config.warn("Less weights defined than tiles, expanding weights: " + path); + sum = new int[this.tiles.length]; + System.arraycopy(this.weights, 0, sum, 0, this.weights.length); + i = this.getAverage(this.weights); + + for (int i1 = this.weights.length; i1 < sum.length; ++i1) { + sum[i1] = i; + } + + this.weights = sum; + } + + this.sumWeights = new int[this.weights.length]; + int var5 = 0; + + for (i = 0; i < this.weights.length; ++i) { + var5 += this.weights[i]; + this.sumWeights[i] = var5; + } + + this.sumAllWeights = var5; + + if (this.sumAllWeights <= 0) { + Config.warn("Invalid sum of all weights: " + var5); + this.sumAllWeights = 1; + } + } + + return true; + } else { + Config.warn("Tiles not defined: " + path); + return false; + } + } + + private int getAverage(int[] vals) { + if (vals.length <= 0) { + return 0; + } else { + int sum = 0; + int avg; + + for (avg = 0; avg < vals.length; ++avg) { + int val = vals[avg]; + sum += val; + } + + avg = sum / vals.length; + return avg; + } + } + + private boolean isValidRepeat(String path) { + if (this.tiles == null) { + Config.warn("Tiles not defined: " + path); + return false; + } else if (this.width > 0 && this.width <= 16) { + if (this.height > 0 && this.height <= 16) { + if (this.tiles.length != this.width * this.height) { + Config.warn("Number of tiles does not equal width x height: " + path); + return false; + } else { + return true; + } + } else { + Config.warn("Invalid height: " + path); + return false; + } + } else { + Config.warn("Invalid width: " + path); + return false; + } + } + + private boolean isValidFixed(String path) { + if (this.tiles == null) { + Config.warn("Tiles not defined: " + path); + return false; + } else if (this.tiles.length != 1) { + Config.warn("Number of tiles should be 1 for method: fixed."); + return false; + } else { + return true; + } + } + + private boolean isValidTop(String path) { + if (this.tiles == null) { + this.tiles = this.parseTileNames("66"); + } + + if (this.tiles.length != 1) { + Config.warn("Invalid tiles, must be exactly 1: " + path); + return false; + } else { + return true; + } + } + + public void updateIcons(TextureMap textureMap) { + if (this.matchTiles != null) { + this.matchTileIcons = registerIcons(this.matchTiles, textureMap); + } + + if (this.tiles != null) { + this.tileIcons = registerIcons(this.tiles, textureMap); + } + } + + private static IIcon[] registerIcons(String[] tileNames, TextureMap textureMap) { + if (tileNames == null) { + return null; + } else { + ArrayList iconList = new ArrayList(); + + for (int icons = 0; icons < tileNames.length; ++icons) { + String iconName = tileNames[icons]; + String fullName = iconName; + + if (!iconName.contains("/")) { + fullName = "textures/blocks/" + iconName; + } + + String fileName = fullName + ".png"; + ResourceLocation loc = new ResourceLocation(fileName); + boolean exists = Config.hasResource(loc); + + if (!exists) { + Config.warn("File not found: " + fileName); + } + + IIcon icon = textureMap.registerIcon(iconName); + iconList.add(icon); + } + + IIcon[] var10 = (IIcon[])((IIcon[])iconList.toArray(new IIcon[iconList.size()])); + return var10; + } + } + + public String toString() { + return "CTM name: " + this.name + ", basePath: " + this.basePath + ", matchBlocks: " + Config.arrayToString(this.matchBlocks) + ", matchTiles: " + Config.arrayToString((Object[])this.matchTiles); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedTextures.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedTextures.java new file mode 100644 index 0000000..fbf1f7b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ConnectedTextures.java @@ -0,0 +1,1238 @@ +package net.minecraft.src; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import net.minecraft.block.Block; +import net.minecraft.block.BlockQuartz; +import net.minecraft.block.BlockRotatedPillar; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.AbstractResourcePack; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.biome.BiomeGenBase; + +public class ConnectedTextures { + private static ConnectedProperties[][] blockProperties = (ConnectedProperties[][])null; + private static ConnectedProperties[][] tileProperties = (ConnectedProperties[][])null; + private static boolean multipass = false; + private static final int BOTTOM = 0; + private static final int TOP = 1; + private static final int EAST = 2; + private static final int WEST = 3; + private static final int NORTH = 4; + private static final int SOUTH = 5; + private static final int Y_NEG = 0; + private static final int Y_POS = 1; + private static final int Z_NEG = 2; + private static final int Z_POS = 3; + private static final int X_NEG = 4; + private static final int X_POS = 5; + private static final int Y_AXIS = 0; + private static final int Z_AXIS = 1; + private static final int X_AXIS = 2; + private static final String[] propSuffixes = new String[] {"", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; + private static final int[] ctmIndexes = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 0, 0, 0, 0, 0}; + + public static IIcon getConnectedTexture(IBlockAccess blockAccess, Block block, int x, int y, int z, int side, IIcon icon) { + if (blockAccess == null) { + return icon; + } else { + IIcon newIcon = getConnectedTextureSingle(blockAccess, block, x, y, z, side, icon, true); + + if (!multipass) { + return newIcon; + } else if (newIcon == icon) { + return newIcon; + } else { + IIcon mpIcon = newIcon; + + for (int i = 0; i < 3; ++i) { + IIcon newMpIcon = getConnectedTextureSingle(blockAccess, block, x, y, z, side, mpIcon, false); + + if (newMpIcon == mpIcon) { + break; + } + + mpIcon = newMpIcon; + } + + return mpIcon; + } + } + } + + public static IIcon getConnectedTextureSingle(IBlockAccess blockAccess, Block block, int x, int y, int z, int side, IIcon icon, boolean checkBlocks) { + if (!(icon instanceof TextureAtlasSprite)) { + return icon; + } else { + TextureAtlasSprite ts = (TextureAtlasSprite)icon; + int iconId = ts.getIndexInMap(); + int metadata = -1; + + if (tileProperties != null && Tessellator.instance.defaultTexture && iconId >= 0 && iconId < tileProperties.length) { + ConnectedProperties[] blockId = tileProperties[iconId]; + + if (blockId != null) { + if (metadata < 0) { + metadata = blockAccess.getBlockMetadata(x, y, z); + } + + IIcon cps = getConnectedTexture(blockId, blockAccess, block, x, y, z, side, ts, metadata); + + if (cps != null) { + return cps; + } + } + } + + if (blockProperties != null && checkBlocks) { + int blockId1 = Block.getIdFromBlock(block); + + if (blockId1 >= 0 && blockId1 < blockProperties.length) { + ConnectedProperties[] cps1 = blockProperties[blockId1]; + + if (cps1 != null) { + if (metadata < 0) { + metadata = blockAccess.getBlockMetadata(x, y, z); + } + + IIcon newIcon = getConnectedTexture(cps1, blockAccess, block, x, y, z, side, ts, metadata); + + if (newIcon != null) { + return newIcon; + } + } + } + } + + return icon; + } + } + + public static ConnectedProperties getConnectedProperties(IBlockAccess blockAccess, Block block, int x, int y, int z, int side, IIcon icon) { + if (blockAccess == null) { + return null; + } else if (!(icon instanceof TextureAtlasSprite)) { + return null; + } else { + TextureAtlasSprite ts = (TextureAtlasSprite)icon; + int iconId = ts.getIndexInMap(); + int metadata = -1; + + if (tileProperties != null && Tessellator.instance.defaultTexture && iconId >= 0 && iconId < tileProperties.length) { + ConnectedProperties[] blockId = tileProperties[iconId]; + + if (blockId != null) { + if (metadata < 0) { + metadata = blockAccess.getBlockMetadata(x, y, z); + } + + ConnectedProperties cps = getConnectedProperties(blockId, blockAccess, block, x, y, z, side, ts, metadata); + + if (cps != null) { + return cps; + } + } + } + + if (blockProperties != null) { + int blockId1 = Block.getIdFromBlock(block); + + if (blockId1 >= 0 && blockId1 < blockProperties.length) { + ConnectedProperties[] cps1 = blockProperties[blockId1]; + + if (cps1 != null) { + if (metadata < 0) { + metadata = blockAccess.getBlockMetadata(x, y, z); + } + + ConnectedProperties cp = getConnectedProperties(cps1, blockAccess, block, x, y, z, side, ts, metadata); + + if (cp != null) { + return cp; + } + } + } + } + + return null; + } + } + + private static IIcon getConnectedTexture(ConnectedProperties[] cps, IBlockAccess blockAccess, Block block, int x, int y, int z, int side, IIcon icon, int metadata) { + for (int i = 0; i < cps.length; ++i) { + ConnectedProperties cp = cps[i]; + + if (cp != null) { + IIcon newIcon = getConnectedTexture(cp, blockAccess, block, x, y, z, side, icon, metadata); + + if (newIcon != null) { + return newIcon; + } + } + } + + return null; + } + + private static ConnectedProperties getConnectedProperties(ConnectedProperties[] cps, IBlockAccess blockAccess, Block block, int x, int y, int z, int side, IIcon icon, int metadata) { + for (int i = 0; i < cps.length; ++i) { + ConnectedProperties cp = cps[i]; + + if (cp != null) { + IIcon newIcon = getConnectedTexture(cp, blockAccess, block, x, y, z, side, icon, metadata); + + if (newIcon != null) { + return cp; + } + } + } + + return null; + } + + private static IIcon getConnectedTexture(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int side, IIcon icon, int metadata) { + if (cp.heights != null && !cp.heights.isInRange(y)) { + return null; + } else { + int mds; + + if (cp.biomes != null) { + BiomeGenBase vertAxis = blockAccess.getBiomeGenForCoords(x, z); + boolean metadataCheck = false; + + for (mds = 0; mds < cp.biomes.length; ++mds) { + BiomeGenBase metadataFound = cp.biomes[mds]; + + if (vertAxis == metadataFound) { + metadataCheck = true; + break; + } + } + + if (!metadataCheck) { + return null; + } + } + + int var14 = 0; + int var15 = metadata; + + if (block instanceof BlockRotatedPillar) { + var14 = getWoodAxis(side, metadata); + var15 = metadata & 3; + } + + if (block instanceof BlockQuartz) { + var14 = getQuartzAxis(side, metadata); + + if (var15 > 2) { + var15 = 2; + } + } + + if (side >= 0 && cp.faces != 63) { + mds = side; + + if (var14 != 0) { + mds = fixSideByAxis(side, var14); + } + + if ((1 << mds & cp.faces) == 0) { + return null; + } + } + + if (cp.metadatas != null) { + int[] var16 = cp.metadatas; + boolean var17 = false; + + for (int i = 0; i < var16.length; ++i) { + if (var16[i] == var15) { + var17 = true; + break; + } + } + + if (!var17) { + return null; + } + } + + switch (cp.method) { + case 1: + return getConnectedTextureCtm(cp, blockAccess, block, x, y, z, side, icon, metadata); + + case 2: + return getConnectedTextureHorizontal(cp, blockAccess, block, x, y, z, var14, side, icon, metadata); + + case 3: + return getConnectedTextureTop(cp, blockAccess, block, x, y, z, var14, side, icon, metadata); + + case 4: + return getConnectedTextureRandom(cp, blockAccess, block, x, y, z, side); + + case 5: + return getConnectedTextureRepeat(cp, x, y, z, side); + + case 6: + return getConnectedTextureVertical(cp, blockAccess, block, x, y, z, var14, side, icon, metadata); + + case 7: + return getConnectedTextureFixed(cp); + + case 8: + return getConnectedTextureHorizontalVertical(cp, blockAccess, block, x, y, z, var14, side, icon, metadata); + + case 9: + return getConnectedTextureVerticalHorizontal(cp, blockAccess, block, x, y, z, var14, side, icon, metadata); + + default: + return null; + } + } + } + + private static int fixSideByAxis(int side, int vertAxis) { + switch (vertAxis) { + case 0: + return side; + + case 1: + switch (side) { + case 0: + return 2; + + case 1: + return 3; + + case 2: + return 1; + + case 3: + return 0; + + default: + return side; + } + + case 2: + switch (side) { + case 0: + return 4; + + case 1: + return 5; + + case 2: + case 3: + default: + return side; + + case 4: + return 1; + + case 5: + return 0; + } + + default: + return side; + } + } + + private static int getWoodAxis(int side, int metadata) { + int orient = (metadata & 12) >> 2; + + switch (orient) { + case 1: + return 2; + + case 2: + return 1; + + default: + return 0; + } + } + + private static int getQuartzAxis(int side, int metadata) { + switch (metadata) { + case 3: + return 2; + + case 4: + return 1; + + default: + return 0; + } + } + + private static IIcon getConnectedTextureRandom(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int side) { + if (cp.tileIcons.length == 1) { + return cp.tileIcons[0]; + } else { + int face = side / cp.symmetry * cp.symmetry; + int rand; + + if (cp.linked) { + rand = y - 1; + + for (Block index = blockAccess.getBlock(x, rand, z); index == block; index = blockAccess.getBlock(x, rand, z)) { + y = rand--; + + if (rand < 0) { + break; + } + } + } + + rand = Config.getRandom(x, y, z, face) & Integer.MAX_VALUE; + int var13 = 0; + + if (cp.weights == null) { + var13 = rand % cp.tileIcons.length; + } else { + int randWeight = rand % cp.sumAllWeights; + int[] sumWeights = cp.sumWeights; + + for (int i = 0; i < sumWeights.length; ++i) { + if (randWeight < sumWeights[i]) { + var13 = i; + break; + } + } + } + + return cp.tileIcons[var13]; + } + } + + private static IIcon getConnectedTextureFixed(ConnectedProperties cp) { + return cp.tileIcons[0]; + } + + private static IIcon getConnectedTextureRepeat(ConnectedProperties cp, int x, int y, int z, int side) { + if (cp.tileIcons.length == 1) { + return cp.tileIcons[0]; + } else { + int nx = 0; + int ny = 0; + + switch (side) { + case 0: + nx = x; + ny = z; + break; + + case 1: + nx = x; + ny = z; + break; + + case 2: + nx = -x - 1; + ny = -y; + break; + + case 3: + nx = x; + ny = -y; + break; + + case 4: + nx = z; + ny = -y; + break; + + case 5: + nx = -z - 1; + ny = -y; + } + + nx %= cp.width; + ny %= cp.height; + + if (nx < 0) { + nx += cp.width; + } + + if (ny < 0) { + ny += cp.height; + } + + int index = ny * cp.width + nx; + return cp.tileIcons[index]; + } + } + + private static IIcon getConnectedTextureCtm(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int side, IIcon icon, int metadata) { + boolean[] borders = new boolean[6]; + + switch (side) { + case 0: + case 1: + borders[0] = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + borders[1] = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + borders[2] = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + borders[3] = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + break; + + case 2: + borders[0] = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + borders[1] = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + borders[2] = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + borders[3] = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + break; + + case 3: + borders[0] = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + borders[1] = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + borders[2] = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + borders[3] = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + break; + + case 4: + borders[0] = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + borders[1] = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + borders[2] = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + borders[3] = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + break; + + case 5: + borders[0] = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + borders[1] = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + borders[2] = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + borders[3] = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + } + + byte index = 0; + + if (borders[0] & !borders[1] & !borders[2] & !borders[3]) { + index = 3; + } else if (!borders[0] & borders[1] & !borders[2] & !borders[3]) { + index = 1; + } else if (!borders[0] & !borders[1] & borders[2] & !borders[3]) { + index = 12; + } else if (!borders[0] & !borders[1] & !borders[2] & borders[3]) { + index = 36; + } else if (borders[0] & borders[1] & !borders[2] & !borders[3]) { + index = 2; + } else if (!borders[0] & !borders[1] & borders[2] & borders[3]) { + index = 24; + } else if (borders[0] & !borders[1] & borders[2] & !borders[3]) { + index = 15; + } else if (borders[0] & !borders[1] & !borders[2] & borders[3]) { + index = 39; + } else if (!borders[0] & borders[1] & borders[2] & !borders[3]) { + index = 13; + } else if (!borders[0] & borders[1] & !borders[2] & borders[3]) { + index = 37; + } else if (!borders[0] & borders[1] & borders[2] & borders[3]) { + index = 25; + } else if (borders[0] & !borders[1] & borders[2] & borders[3]) { + index = 27; + } else if (borders[0] & borders[1] & !borders[2] & borders[3]) { + index = 38; + } else if (borders[0] & borders[1] & borders[2] & !borders[3]) { + index = 14; + } else if (borders[0] & borders[1] & borders[2] & borders[3]) { + index = 26; + } + + if (index == 0) { + return cp.tileIcons[index]; + } else if (!Config.isConnectedTexturesFancy()) { + return cp.tileIcons[index]; + } else { + boolean[] edges = new boolean[6]; + + switch (side) { + case 0: + case 1: + edges[0] = !isNeighbour(cp, blockAccess, block, x + 1, y, z + 1, side, icon, metadata); + edges[1] = !isNeighbour(cp, blockAccess, block, x - 1, y, z + 1, side, icon, metadata); + edges[2] = !isNeighbour(cp, blockAccess, block, x + 1, y, z - 1, side, icon, metadata); + edges[3] = !isNeighbour(cp, blockAccess, block, x - 1, y, z - 1, side, icon, metadata); + break; + + case 2: + edges[0] = !isNeighbour(cp, blockAccess, block, x - 1, y - 1, z, side, icon, metadata); + edges[1] = !isNeighbour(cp, blockAccess, block, x + 1, y - 1, z, side, icon, metadata); + edges[2] = !isNeighbour(cp, blockAccess, block, x - 1, y + 1, z, side, icon, metadata); + edges[3] = !isNeighbour(cp, blockAccess, block, x + 1, y + 1, z, side, icon, metadata); + break; + + case 3: + edges[0] = !isNeighbour(cp, blockAccess, block, x + 1, y - 1, z, side, icon, metadata); + edges[1] = !isNeighbour(cp, blockAccess, block, x - 1, y - 1, z, side, icon, metadata); + edges[2] = !isNeighbour(cp, blockAccess, block, x + 1, y + 1, z, side, icon, metadata); + edges[3] = !isNeighbour(cp, blockAccess, block, x - 1, y + 1, z, side, icon, metadata); + break; + + case 4: + edges[0] = !isNeighbour(cp, blockAccess, block, x, y - 1, z + 1, side, icon, metadata); + edges[1] = !isNeighbour(cp, blockAccess, block, x, y - 1, z - 1, side, icon, metadata); + edges[2] = !isNeighbour(cp, blockAccess, block, x, y + 1, z + 1, side, icon, metadata); + edges[3] = !isNeighbour(cp, blockAccess, block, x, y + 1, z - 1, side, icon, metadata); + break; + + case 5: + edges[0] = !isNeighbour(cp, blockAccess, block, x, y - 1, z - 1, side, icon, metadata); + edges[1] = !isNeighbour(cp, blockAccess, block, x, y - 1, z + 1, side, icon, metadata); + edges[2] = !isNeighbour(cp, blockAccess, block, x, y + 1, z - 1, side, icon, metadata); + edges[3] = !isNeighbour(cp, blockAccess, block, x, y + 1, z + 1, side, icon, metadata); + } + + if (index == 13 && edges[0]) { + index = 4; + } else if (index == 15 && edges[1]) { + index = 5; + } else if (index == 37 && edges[2]) { + index = 16; + } else if (index == 39 && edges[3]) { + index = 17; + } else if (index == 14 && edges[0] && edges[1]) { + index = 7; + } else if (index == 25 && edges[0] && edges[2]) { + index = 6; + } else if (index == 27 && edges[3] && edges[1]) { + index = 19; + } else if (index == 38 && edges[3] && edges[2]) { + index = 18; + } else if (index == 14 && !edges[0] && edges[1]) { + index = 31; + } else if (index == 25 && edges[0] && !edges[2]) { + index = 30; + } else if (index == 27 && !edges[3] && edges[1]) { + index = 41; + } else if (index == 38 && edges[3] && !edges[2]) { + index = 40; + } else if (index == 14 && edges[0] && !edges[1]) { + index = 29; + } else if (index == 25 && !edges[0] && edges[2]) { + index = 28; + } else if (index == 27 && edges[3] && !edges[1]) { + index = 43; + } else if (index == 38 && !edges[3] && edges[2]) { + index = 42; + } else if (index == 26 && edges[0] && edges[1] && edges[2] && edges[3]) { + index = 46; + } else if (index == 26 && !edges[0] && edges[1] && edges[2] && edges[3]) { + index = 9; + } else if (index == 26 && edges[0] && !edges[1] && edges[2] && edges[3]) { + index = 21; + } else if (index == 26 && edges[0] && edges[1] && !edges[2] && edges[3]) { + index = 8; + } else if (index == 26 && edges[0] && edges[1] && edges[2] && !edges[3]) { + index = 20; + } else if (index == 26 && edges[0] && edges[1] && !edges[2] && !edges[3]) { + index = 11; + } else if (index == 26 && !edges[0] && !edges[1] && edges[2] && edges[3]) { + index = 22; + } else if (index == 26 && !edges[0] && edges[1] && !edges[2] && edges[3]) { + index = 23; + } else if (index == 26 && edges[0] && !edges[1] && edges[2] && !edges[3]) { + index = 10; + } else if (index == 26 && edges[0] && !edges[1] && !edges[2] && edges[3]) { + index = 34; + } else if (index == 26 && !edges[0] && edges[1] && edges[2] && !edges[3]) { + index = 35; + } else if (index == 26 && edges[0] && !edges[1] && !edges[2] && !edges[3]) { + index = 32; + } else if (index == 26 && !edges[0] && edges[1] && !edges[2] && !edges[3]) { + index = 33; + } else if (index == 26 && !edges[0] && !edges[1] && edges[2] && !edges[3]) { + index = 44; + } else if (index == 26 && !edges[0] && !edges[1] && !edges[2] && edges[3]) { + index = 45; + } + + return cp.tileIcons[index]; + } + } + + private static boolean isNeighbour(ConnectedProperties cp, IBlockAccess iblockaccess, Block block, int x, int y, int z, int side, IIcon icon, int metadata) { + Block neighbourBlock = iblockaccess.getBlock(x, y, z); + + if (cp.connect == 2) { + if (neighbourBlock == null) { + return false; + } else { + int neighbourMetadata = iblockaccess.getBlockMetadata(x, y, z); + IIcon neighbourIcon; + + if (side >= 0) { + neighbourIcon = neighbourBlock.getIcon(side, neighbourMetadata); + } else { + neighbourIcon = neighbourBlock.getIcon(1, neighbourMetadata); + } + + return neighbourIcon == icon; + } + } else { + return cp.connect == 3 ? (neighbourBlock == null ? false : neighbourBlock.getMaterial() == block.getMaterial()) : neighbourBlock == block && iblockaccess.getBlockMetadata(x, y, z) == metadata; + } + } + + private static IIcon getConnectedTextureHorizontal(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int vertAxis, int side, IIcon icon, int metadata) { + boolean left; + boolean right; + left = false; + right = false; + label46: + + switch (vertAxis) { + case 0: + switch (side) { + case 0: + case 1: + return null; + + case 2: + left = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + break label46; + + case 3: + left = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + break label46; + + case 4: + left = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + break label46; + + case 5: + left = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + + default: + break label46; + } + + case 1: + switch (side) { + case 0: + left = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + break label46; + + case 1: + left = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + break label46; + + case 2: + case 3: + return null; + + case 4: + left = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + break label46; + + case 5: + left = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + + default: + break label46; + } + + case 2: + switch (side) { + case 0: + left = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + break; + + case 1: + left = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + break; + + case 2: + left = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + break; + + case 3: + left = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + right = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + break; + + case 4: + case 5: + return null; + } + } + + boolean index = true; + byte index1; + + if (left) { + if (right) { + index1 = 1; + } else { + index1 = 2; + } + } else if (right) { + index1 = 0; + } else { + index1 = 3; + } + + return cp.tileIcons[index1]; + } + + private static IIcon getConnectedTextureVertical(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int vertAxis, int side, IIcon icon, int metadata) { + boolean bottom = false; + boolean top = false; + + switch (vertAxis) { + case 0: + if (side == 1 || side == 0) { + return null; + } + + bottom = isNeighbour(cp, blockAccess, block, x, y - 1, z, side, icon, metadata); + top = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + break; + + case 1: + if (side == 3 || side == 2) { + return null; + } + + bottom = isNeighbour(cp, blockAccess, block, x, y, z - 1, side, icon, metadata); + top = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + break; + + case 2: + if (side == 5 || side == 4) { + return null; + } + + bottom = isNeighbour(cp, blockAccess, block, x - 1, y, z, side, icon, metadata); + top = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + } + + boolean index = true; + byte index1; + + if (bottom) { + if (top) { + index1 = 1; + } else { + index1 = 2; + } + } else if (top) { + index1 = 0; + } else { + index1 = 3; + } + + return cp.tileIcons[index1]; + } + + private static IIcon getConnectedTextureHorizontalVertical(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int vertAxis, int side, IIcon icon, int metadata) { + IIcon[] tileIcons = cp.tileIcons; + IIcon iconH = getConnectedTextureHorizontal(cp, blockAccess, block, x, y, z, vertAxis, side, icon, metadata); + + if (iconH != null && iconH != icon && iconH != tileIcons[3]) { + return iconH; + } else { + IIcon iconV = getConnectedTextureVertical(cp, blockAccess, block, x, y, z, vertAxis, side, icon, metadata); + return iconV == tileIcons[0] ? tileIcons[4] : (iconV == tileIcons[1] ? tileIcons[5] : (iconV == tileIcons[2] ? tileIcons[6] : iconV)); + } + } + + private static IIcon getConnectedTextureVerticalHorizontal(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int vertAxis, int side, IIcon icon, int metadata) { + IIcon[] tileIcons = cp.tileIcons; + IIcon iconV = getConnectedTextureVertical(cp, blockAccess, block, x, y, z, vertAxis, side, icon, metadata); + + if (iconV != null && iconV != icon && iconV != tileIcons[3]) { + return iconV; + } else { + IIcon iconH = getConnectedTextureHorizontal(cp, blockAccess, block, x, y, z, vertAxis, side, icon, metadata); + return iconH == tileIcons[0] ? tileIcons[4] : (iconH == tileIcons[1] ? tileIcons[5] : (iconH == tileIcons[2] ? tileIcons[6] : iconH)); + } + } + + private static IIcon getConnectedTextureTop(ConnectedProperties cp, IBlockAccess blockAccess, Block block, int x, int y, int z, int vertAxis, int side, IIcon icon, int metadata) { + boolean top = false; + + switch (vertAxis) { + case 0: + if (side == 1 || side == 0) { + return null; + } + + top = isNeighbour(cp, blockAccess, block, x, y + 1, z, side, icon, metadata); + break; + + case 1: + if (side == 3 || side == 2) { + return null; + } + + top = isNeighbour(cp, blockAccess, block, x, y, z + 1, side, icon, metadata); + break; + + case 2: + if (side == 5 || side == 4) { + return null; + } + + top = isNeighbour(cp, blockAccess, block, x + 1, y, z, side, icon, metadata); + } + + return top ? cp.tileIcons[0] : null; + } + + public static void updateIcons(TextureMap textureMap) { + blockProperties = (ConnectedProperties[][])null; + tileProperties = (ConnectedProperties[][])null; + IResourcePack[] rps = Config.getResourcePacks(); + + for (int i = rps.length - 1; i >= 0; --i) { + IResourcePack rp = rps[i]; + updateIcons(textureMap, rp); + } + + updateIcons(textureMap, Config.getDefaultResourcePack()); + } + + public static void updateIcons(TextureMap textureMap, IResourcePack rp) { + String[] names = collectFiles(rp, "mcpatcher/ctm/", ".properties"); + Arrays.sort(names); + List tileList = makePropertyList(tileProperties); + List blockList = makePropertyList(blockProperties); + + for (int i = 0; i < names.length; ++i) { + String name = names[i]; + Config.dbg("ConnectedTextures: " + name); + + try { + ResourceLocation e = new ResourceLocation(name); + InputStream in = rp.getInputStream(e); + + if (in == null) { + Config.warn("ConnectedTextures file not found: " + name); + } else { + Properties props = new Properties(); + props.load(in); + ConnectedProperties cp = new ConnectedProperties(props, name); + + if (cp.isValid(name)) { + cp.updateIcons(textureMap); + addToTileList(cp, tileList); + addToBlockList(cp, blockList); + } + } + } catch (FileNotFoundException var11) { + Config.warn("ConnectedTextures file not found: " + name); + } catch (IOException var12) { + var12.printStackTrace(); + } + } + + blockProperties = propertyListToArray(blockList); + tileProperties = propertyListToArray(tileList); + multipass = detectMultipass(); + Config.dbg("Multipass connected textures: " + multipass); + } + + private static List makePropertyList(ConnectedProperties[][] propsArr) { + ArrayList list = new ArrayList(); + + if (propsArr != null) { + for (int i = 0; i < propsArr.length; ++i) { + ConnectedProperties[] props = propsArr[i]; + ArrayList propList = null; + + if (props != null) { + propList = new ArrayList(Arrays.asList(props)); + } + + list.add(propList); + } + } + + return list; + } + + private static boolean detectMultipass() { + ArrayList propList = new ArrayList(); + int props; + ConnectedProperties[] matchIconSet; + + for (props = 0; props < tileProperties.length; ++props) { + matchIconSet = tileProperties[props]; + + if (matchIconSet != null) { + propList.addAll(Arrays.asList(matchIconSet)); + } + } + + for (props = 0; props < blockProperties.length; ++props) { + matchIconSet = blockProperties[props]; + + if (matchIconSet != null) { + propList.addAll(Arrays.asList(matchIconSet)); + } + } + + ConnectedProperties[] var6 = (ConnectedProperties[])((ConnectedProperties[])propList.toArray(new ConnectedProperties[propList.size()])); + HashSet var7 = new HashSet(); + HashSet tileIconSet = new HashSet(); + + for (int i = 0; i < var6.length; ++i) { + ConnectedProperties cp = var6[i]; + + if (cp.matchTileIcons != null) { + var7.addAll(Arrays.asList(cp.matchTileIcons)); + } + + if (cp.tileIcons != null) { + tileIconSet.addAll(Arrays.asList(cp.tileIcons)); + } + } + + var7.retainAll(tileIconSet); + return !var7.isEmpty(); + } + + private static ConnectedProperties[][] propertyListToArray(List list) { + ConnectedProperties[][] propArr = new ConnectedProperties[list.size()][]; + + for (int i = 0; i < list.size(); ++i) { + List subList = (List)list.get(i); + + if (subList != null) { + ConnectedProperties[] subArr = (ConnectedProperties[])((ConnectedProperties[])subList.toArray(new ConnectedProperties[subList.size()])); + propArr[i] = subArr; + } + } + + return propArr; + } + + private static void addToTileList(ConnectedProperties cp, List tileList) { + if (cp.matchTileIcons != null) { + for (int i = 0; i < cp.matchTileIcons.length; ++i) { + IIcon icon = cp.matchTileIcons[i]; + + if (!(icon instanceof TextureAtlasSprite)) { + Config.warn("IIcon is not TextureAtlasSprite: " + icon + ", name: " + icon.getIconName()); + } else { + TextureAtlasSprite ts = (TextureAtlasSprite)icon; + int tileId = ts.getIndexInMap(); + + if (tileId < 0) { + Config.warn("Invalid tile ID: " + tileId + ", icon: " + ts.getIconName()); + } else { + addToList(cp, tileList, tileId); + } + } + } + } + } + + private static void addToBlockList(ConnectedProperties cp, List blockList) { + if (cp.matchBlocks != null) { + for (int i = 0; i < cp.matchBlocks.length; ++i) { + int blockId = cp.matchBlocks[i]; + + if (blockId < 0) { + Config.warn("Invalid block ID: " + blockId); + } else { + addToList(cp, blockList, blockId); + } + } + } + } + + private static void addToList(ConnectedProperties cp, List list, int id) { + while (id >= list.size()) { + list.add((Object)null); + } + + Object subList = (List)list.get(id); + + if (subList == null) { + subList = new ArrayList(); + list.set(id, subList); + } + + ((List)subList).add(cp); + } + + private static String[] collectFiles(IResourcePack rp, String prefix, String suffix) { + if (rp instanceof DefaultResourcePack) { + return collectFilesDefault(rp); + } else if (!(rp instanceof AbstractResourcePack)) { + return new String[0]; + } else { + AbstractResourcePack arp = (AbstractResourcePack)rp; + File tpFile = ResourceUtils.getResourcePackFile(arp); + return tpFile == null ? new String[0] : (tpFile.isDirectory() ? collectFilesFolder(tpFile, "", prefix, suffix) : (tpFile.isFile() ? collectFilesZIP(tpFile, prefix, suffix) : new String[0])); + } + } + + private static String[] collectFilesDefault(IResourcePack rp) { + ArrayList list = new ArrayList(); + String[] names = getDefaultCtmPaths(); + + for (int nameArr = 0; nameArr < names.length; ++nameArr) { + String name = names[nameArr]; + ResourceLocation loc = new ResourceLocation(name); + + if (rp.resourceExists(loc)) { + list.add(name); + } + } + + String[] var6 = (String[])((String[])list.toArray(new String[list.size()])); + return var6; + } + + private static String[] getDefaultCtmPaths() { + ArrayList list = new ArrayList(); + String defPath = "mcpatcher/ctm/default/"; + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/glass.png"))) { + list.add(defPath + "glass.properties"); + list.add(defPath + "glasspane.properties"); + } + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/bookshelf.png"))) { + list.add(defPath + "bookshelf.properties"); + } + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/sandstone_normal.png"))) { + list.add(defPath + "sandstone.properties"); + } + + String[] colors = new String[] {"white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "silver", "cyan", "purple", "blue", "brown", "green", "red", "black"}; + + for (int paths = 0; paths < colors.length; ++paths) { + String color = colors[paths]; + + if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/glass_" + color + ".png"))) { + list.add(defPath + paths + "_glass_" + color + "/glass_" + color + ".properties"); + list.add(defPath + paths + "_glass_" + color + "/glass_pane_" + color + ".properties"); + } + } + + String[] var5 = (String[])((String[])list.toArray(new String[list.size()])); + return var5; + } + + private static String[] collectFilesFolder(File tpFile, String basePath, String prefix, String suffix) { + ArrayList list = new ArrayList(); + String prefixAssets = "assets/minecraft/"; + File[] files = tpFile.listFiles(); + + if (files == null) { + return new String[0]; + } else { + for (int names = 0; names < files.length; ++names) { + File file = files[names]; + String dirPath; + + if (file.isFile()) { + dirPath = basePath + file.getName(); + + if (dirPath.startsWith(prefixAssets)) { + dirPath = dirPath.substring(prefixAssets.length()); + + if (dirPath.startsWith(prefix) && dirPath.endsWith(suffix)) { + list.add(dirPath); + } + } + } else if (file.isDirectory()) { + dirPath = basePath + file.getName() + "/"; + String[] names1 = collectFilesFolder(file, dirPath, prefix, suffix); + + for (int n = 0; n < names1.length; ++n) { + String name = names1[n]; + list.add(name); + } + } + } + + String[] var13 = (String[])((String[])list.toArray(new String[list.size()])); + return var13; + } + } + + private static String[] collectFilesZIP(File tpFile, String prefix, String suffix) { + ArrayList list = new ArrayList(); + String prefixAssets = "assets/minecraft/"; + + try { + ZipFile e = new ZipFile(tpFile); + Enumeration en = e.entries(); + + while (en.hasMoreElements()) { + ZipEntry names = (ZipEntry)en.nextElement(); + String name = names.getName(); + + if (name.startsWith(prefixAssets)) { + name = name.substring(prefixAssets.length()); + + if (name.startsWith(prefix) && name.endsWith(suffix)) { + list.add(name); + } + } + } + + e.close(); + String[] names1 = (String[])((String[])list.toArray(new String[list.size()])); + return names1; + } catch (IOException var9) { + var9.printStackTrace(); + return new String[0]; + } + } + + public static int getPaneTextureIndex(boolean linkP, boolean linkN, boolean linkYp, boolean linkYn) { + return linkN && linkP ? (linkYp ? (linkYn ? 34 : 50) : (linkYn ? 18 : 2)) : (linkN && !linkP ? (linkYp ? (linkYn ? 35 : 51) : (linkYn ? 19 : 3)) : (!linkN && linkP ? (linkYp ? (linkYn ? 33 : 49) : (linkYn ? 17 : 1)) : (linkYp ? (linkYn ? 32 : 48) : (linkYn ? 16 : 0)))); + } + + public static int getReversePaneTextureIndex(int texNum) { + int col = texNum % 16; + return col == 1 ? texNum + 2 : (col == 3 ? texNum - 2 : texNum); + } + + public static IIcon getCtmTexture(ConnectedProperties cp, int ctmIndex, IIcon icon) { + if (cp.method != 1) { + return icon; + } else if (ctmIndex >= 0 && ctmIndex < ctmIndexes.length) { + int index = ctmIndexes[ctmIndex]; + IIcon[] ctmIcons = cp.tileIcons; + return index >= 0 && index < ctmIcons.length ? ctmIcons[index] : icon; + } else { + return icon; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CrashReporter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CrashReporter.java new file mode 100644 index 0000000..87615aa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CrashReporter.java @@ -0,0 +1,100 @@ +package net.minecraft.src; + +import java.util.HashMap; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import shadersmod.client.Shaders; + +public class CrashReporter { + public static void onCrashReport(CrashReport crashReport, CrashReportCategory category) { + try { + GameSettings e = Config.getGameSettings(); + + if (e == null) { + return; + } + + if (!e.snooperEnabled) { + return; + } + + Throwable cause = crashReport.getCrashCause(); + + if (cause == null) { + return; + } + + if (cause.getClass() == Throwable.class) { + return; + } + + if (cause.getClass().getName().contains(".fml.client.SplashProgress")) { + return; + } + + extendCrashReport(category); + String url = "http://optifine.net/crashReport"; + String reportStr = makeReport(crashReport); + byte[] content = reportStr.getBytes("ASCII"); + IFileUploadListener listener = new IFileUploadListener() { + public void fileUploadFinished(String url, byte[] content, Throwable exception) {} + }; + HashMap headers = new HashMap(); + headers.put("OF-Version", Config.getVersion()); + headers.put("OF-Summary", makeSummary(crashReport)); + FileUploadThread fut = new FileUploadThread(url, headers, content, listener); + fut.setPriority(10); + fut.start(); + Thread.sleep(1000L); + } catch (Exception var10) { + Config.dbg(var10.getClass().getName() + ": " + var10.getMessage()); + } + } + + private static String makeReport(CrashReport crashReport) { + StringBuffer sb = new StringBuffer(); + sb.append("OptiFineVersion: " + Config.getVersion() + "\n"); + sb.append("Summary: " + makeSummary(crashReport) + "\n"); + sb.append("\n"); + sb.append(crashReport.getCompleteReport()); + sb.append("\n"); + return sb.toString(); + } + + private static String makeSummary(CrashReport crashReport) { + Throwable t = crashReport.getCrashCause(); + + if (t == null) { + return "Unknown"; + } else { + StackTraceElement[] traces = t.getStackTrace(); + String firstTrace = "unknown"; + + if (traces.length > 0) { + firstTrace = traces[0].toString().trim(); + } + + String sum = t.getClass().getName() + ": " + t.getMessage() + " (" + crashReport.getDescription() + ")" + " [" + firstTrace + "]"; + return sum; + } + } + + public static void extendCrashReport(CrashReportCategory cat) { + cat.addCrashSection("OptiFine Version", Config.getVersion()); + + if (Config.getGameSettings() != null) { + cat.addCrashSection("Render Distance Chunks", "" + Config.getChunkViewDistance()); + cat.addCrashSection("Mipmaps", "" + Config.getMipmapLevels()); + cat.addCrashSection("Anisotropic Filtering", "" + Config.getAnisotropicFilterLevel()); + cat.addCrashSection("Antialiasing", "" + Config.getAntialiasingLevel()); + cat.addCrashSection("Multitexture", "" + Config.isMultiTexture()); + } + + cat.addCrashSection("Shaders", "" + Shaders.getShaderPackName()); + cat.addCrashSection("OpenGlVersion", "" + Config.openGlVersion); + cat.addCrashSection("OpenGlRenderer", "" + Config.openGlRenderer); + cat.addCrashSection("OpenGlVendor", "" + Config.openGlVendor); + cat.addCrashSection("CpuCount", "" + Config.getAvailableProcessors()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomColorizer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomColorizer.java new file mode 100644 index 0000000..a5c084f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomColorizer.java @@ -0,0 +1,969 @@ +package net.minecraft.src; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.block.Block; +import net.minecraft.block.BlockStem; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; + +public class CustomColorizer { + private static int[] grassColors = null; + private static int[] waterColors = null; + private static int[] foliageColors = null; + private static int[] foliagePineColors = null; + private static int[] foliageBirchColors = null; + private static int[] swampFoliageColors = null; + private static int[] swampGrassColors = null; + private static int[][] blockPalettes = (int[][])null; + private static int[][] paletteColors = (int[][])null; + private static int[] skyColors = null; + private static int[] fogColors = null; + private static int[] underwaterColors = null; + private static float[][][] lightMapsColorsRgb = (float[][][])null; + private static int[] lightMapsHeight = null; + private static float[][] sunRgbs = new float[16][3]; + private static float[][] torchRgbs = new float[16][3]; + private static int[] redstoneColors = null; + private static int[] stemColors = null; + private static int[] myceliumParticleColors = null; + private static boolean useDefaultColorMultiplier = true; + private static int particleWaterColor = -1; + private static int particlePortalColor = -1; + private static int lilyPadColor = -1; + private static Vec3 fogColorNether = null; + private static Vec3 fogColorEnd = null; + private static Vec3 skyColorEnd = null; + private static int[] textColors = null; + private static final int TYPE_NONE = 0; + private static final int TYPE_GRASS = 1; + private static final int TYPE_FOLIAGE = 2; + private static Random random = new Random(); + + public static void update() { + grassColors = null; + waterColors = null; + foliageColors = null; + foliageBirchColors = null; + foliagePineColors = null; + swampGrassColors = null; + swampFoliageColors = null; + skyColors = null; + fogColors = null; + underwaterColors = null; + redstoneColors = null; + stemColors = null; + myceliumParticleColors = null; + lightMapsColorsRgb = (float[][][])null; + lightMapsHeight = null; + lilyPadColor = -1; + particleWaterColor = -1; + particlePortalColor = -1; + fogColorNether = null; + fogColorEnd = null; + skyColorEnd = null; + textColors = null; + blockPalettes = (int[][])null; + paletteColors = (int[][])null; + useDefaultColorMultiplier = true; + String mcpColormap = "mcpatcher/colormap/"; + grassColors = getCustomColors("textures/colormap/grass.png", 65536); + foliageColors = getCustomColors("textures/colormap/foliage.png", 65536); + String[] waterPaths = new String[] {"water.png", "watercolorX.png"}; + waterColors = getCustomColors(mcpColormap, waterPaths, 65536); + + if (Config.isCustomColors()) { + String[] pinePaths = new String[] {"pine.png", "pinecolor.png"}; + foliagePineColors = getCustomColors(mcpColormap, pinePaths, 65536); + String[] birchPaths = new String[] {"birch.png", "birchcolor.png"}; + foliageBirchColors = getCustomColors(mcpColormap, birchPaths, 65536); + String[] swampGrassPaths = new String[] {"swampgrass.png", "swampgrasscolor.png"}; + swampGrassColors = getCustomColors(mcpColormap, swampGrassPaths, 65536); + String[] swampFoliagePaths = new String[] {"swampfoliage.png", "swampfoliagecolor.png"}; + swampFoliageColors = getCustomColors(mcpColormap, swampFoliagePaths, 65536); + String[] sky0Paths = new String[] {"sky0.png", "skycolor0.png"}; + skyColors = getCustomColors(mcpColormap, sky0Paths, 65536); + String[] fog0Paths = new String[] {"fog0.png", "fogcolor0.png"}; + fogColors = getCustomColors(mcpColormap, fog0Paths, 65536); + String[] underwaterPaths = new String[] {"underwater.png", "underwatercolor.png"}; + underwaterColors = getCustomColors(mcpColormap, underwaterPaths, 65536); + String[] redstonePaths = new String[] {"redstone.png", "redstonecolor.png"}; + redstoneColors = getCustomColors(mcpColormap, redstonePaths, 16); + String[] stemPaths = new String[] {"stem.png", "stemcolor.png"}; + stemColors = getCustomColors(mcpColormap, stemPaths, 8); + String[] myceliumPaths = new String[] {"myceliumparticle.png", "myceliumparticlecolor.png"}; + myceliumParticleColors = getCustomColors(mcpColormap, myceliumPaths, -1); + int[][] lightMapsColors = new int[3][]; + lightMapsColorsRgb = new float[3][][]; + lightMapsHeight = new int[3]; + + for (int i = 0; i < lightMapsColors.length; ++i) { + String path = "mcpatcher/lightmap/world" + (i - 1) + ".png"; + lightMapsColors[i] = getCustomColors(path, -1); + + if (lightMapsColors[i] != null) { + lightMapsColorsRgb[i] = toRgb(lightMapsColors[i]); + } + + lightMapsHeight[i] = getTextureHeight(path, 32); + } + + readColorProperties("mcpatcher/color.properties"); + updateUseDefaultColorMultiplier(); + } + } + + private static int getTextureHeight(String path, int defHeight) { + try { + InputStream e = Config.getResourceStream(new ResourceLocation(path)); + + if (e == null) { + return defHeight; + } else { + BufferedImage bi = ImageIO.read(e); + return bi == null ? defHeight : bi.getHeight(); + } + } catch (IOException var4) { + return defHeight; + } + } + + private static float[][] toRgb(int[] cols) { + float[][] colsRgb = new float[cols.length][3]; + + for (int i = 0; i < cols.length; ++i) { + int col = cols[i]; + float rf = (float)(col >> 16 & 255) / 255.0F; + float gf = (float)(col >> 8 & 255) / 255.0F; + float bf = (float)(col & 255) / 255.0F; + float[] colRgb = colsRgb[i]; + colRgb[0] = rf; + colRgb[1] = gf; + colRgb[2] = bf; + } + + return colsRgb; + } + + private static void readColorProperties(String fileName) { + try { + ResourceLocation e = new ResourceLocation(fileName); + InputStream in = Config.getResourceStream(e); + + if (in == null) { + return; + } + + Config.log("Loading " + fileName); + Properties props = new Properties(); + props.load(in); + lilyPadColor = readColor(props, "lilypad"); + particleWaterColor = readColor(props, new String[] {"particle.water", "drop.water"}); + particlePortalColor = readColor(props, "particle.portal"); + fogColorNether = readColorVec3(props, "fog.nether"); + fogColorEnd = readColorVec3(props, "fog.end"); + skyColorEnd = readColorVec3(props, "sky.end"); + textColors = readTextColors(props, fileName, "text.code.", "Text"); + readCustomPalettes(props, fileName); + } catch (FileNotFoundException var4) { + return; + } catch (IOException var5) { + var5.printStackTrace(); + } + } + + private static void readCustomPalettes(Properties props, String fileName) { + blockPalettes = new int[256][1]; + + for (int palettePrefix = 0; palettePrefix < 256; ++palettePrefix) { + blockPalettes[palettePrefix][0] = -1; + } + + String var18 = "palette.block."; + HashMap map = new HashMap(); + Set keys = props.keySet(); + Iterator propNames = keys.iterator(); + String name; + + while (propNames.hasNext()) { + String i = (String)propNames.next(); + name = props.getProperty(i); + + if (i.startsWith(var18)) { + map.put(i, name); + } + } + + String[] var19 = (String[])((String[])map.keySet().toArray(new String[map.size()])); + paletteColors = new int[var19.length][]; + + for (int var20 = 0; var20 < var19.length; ++var20) { + name = var19[var20]; + String value = props.getProperty(name); + Config.log("Block palette: " + name + " = " + value); + String path = name.substring(var18.length()); + String basePath = TextureUtils.getBasePath(fileName); + path = TextureUtils.fixResourcePath(path, basePath); + int[] colors = getCustomColors(path, 65536); + paletteColors[var20] = colors; + String[] indexStrs = Config.tokenize(value, " ,;"); + + for (int ix = 0; ix < indexStrs.length; ++ix) { + String blockStr = indexStrs[ix]; + int metadata = -1; + + if (blockStr.contains(":")) { + String[] blockIndex = Config.tokenize(blockStr, ":"); + blockStr = blockIndex[0]; + String metadataStr = blockIndex[1]; + metadata = Config.parseInt(metadataStr, -1); + + if (metadata < 0 || metadata > 15) { + Config.log("Invalid block metadata: " + blockStr + " in palette: " + name); + continue; + } + } + + int var21 = Config.parseInt(blockStr, -1); + + if (var21 >= 0 && var21 <= 255) { + if (var21 != Block.getIdFromBlock(Blocks.grass) && var21 != Block.getIdFromBlock(Blocks.tallgrass) && var21 != Block.getIdFromBlock(Blocks.leaves) && var21 != Block.getIdFromBlock(Blocks.vine)) { + if (metadata == -1) { + blockPalettes[var21][0] = var20; + } else { + if (blockPalettes[var21].length < 16) { + blockPalettes[var21] = new int[16]; + Arrays.fill(blockPalettes[var21], -1); + } + + blockPalettes[var21][metadata] = var20; + } + } + } else { + Config.log("Invalid block index: " + var21 + " in palette: " + name); + } + } + } + } + + private static int readColor(Properties props, String[] names) { + for (int i = 0; i < names.length; ++i) { + String name = names[i]; + int col = readColor(props, name); + + if (col >= 0) { + return col; + } + } + + return -1; + } + + private static int readColor(Properties props, String name) { + String str = props.getProperty(name); + + if (str == null) { + return -1; + } else { + try { + int e = Integer.parseInt(str, 16) & 16777215; + Config.log("Custom color: " + name + " = " + str); + return e; + } catch (NumberFormatException var4) { + Config.log("Invalid custom color: " + name + " = " + str); + return -1; + } + } + } + + private static Vec3 readColorVec3(Properties props, String name) { + int col = readColor(props, name); + + if (col < 0) { + return null; + } else { + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + return Vec3.createVectorHelper((double)redF, (double)greenF, (double)blueF); + } + } + + private static int[] getCustomColors(String basePath, String[] paths, int length) { + for (int i = 0; i < paths.length; ++i) { + String path = paths[i]; + path = basePath + path; + int[] cols = getCustomColors(path, length); + + if (cols != null) { + return cols; + } + } + + return null; + } + + private static int[] getCustomColors(String path, int length) { + try { + ResourceLocation e = new ResourceLocation(path); + InputStream in = Config.getResourceStream(e); + + if (in == null) { + return null; + } else { + int[] colors = TextureUtil.readImageData(Config.getResourceManager(), e); + + if (colors == null) { + return null; + } else if (length > 0 && colors.length != length) { + Config.log("Invalid custom colors length: " + colors.length + ", path: " + path); + return null; + } else { + Config.log("Loading custom colors: " + path); + return colors; + } + } + } catch (FileNotFoundException var5) { + return null; + } catch (IOException var6) { + var6.printStackTrace(); + return null; + } + } + + public static void updateUseDefaultColorMultiplier() { + useDefaultColorMultiplier = foliageBirchColors == null && foliagePineColors == null && swampGrassColors == null && swampFoliageColors == null && blockPalettes == null && Config.isSwampColors() && Config.isSmoothBiomes(); + } + + public static int getColorMultiplier(Block block, IBlockAccess blockAccess, int x, int y, int z) { + if (useDefaultColorMultiplier) { + return block.colorMultiplier(blockAccess, x, y, z); + } else { + int[] colors = null; + int[] swampColors = null; + int metadata; + + if (blockPalettes != null) { + int useSwampColors = Block.getIdFromBlock(block); + + if (useSwampColors >= 0 && useSwampColors < 256) { + int[] smoothColors = blockPalettes[useSwampColors]; + boolean type = true; + int type1; + + if (smoothColors.length > 1) { + metadata = blockAccess.getBlockMetadata(x, y, z); + type1 = smoothColors[metadata]; + } else { + type1 = smoothColors[0]; + } + + if (type1 >= 0) { + colors = paletteColors[type1]; + } + } + + if (colors != null) { + if (Config.isSmoothBiomes()) { + return getSmoothColorMultiplier(block, blockAccess, x, y, z, colors, colors, 0, 0); + } + + return getCustomColor(colors, blockAccess, x, y, z); + } + } + + boolean useSwampColors1 = Config.isSwampColors(); + boolean smoothColors1 = false; + byte type2 = 0; + metadata = 0; + + if (block != Blocks.grass && block != Blocks.tallgrass) { + if (block == Blocks.leaves) { + type2 = 2; + smoothColors1 = Config.isSmoothBiomes(); + metadata = blockAccess.getBlockMetadata(x, y, z); + + if ((metadata & 3) == 1) { + colors = foliagePineColors; + } else if ((metadata & 3) == 2) { + colors = foliageBirchColors; + } else { + colors = foliageColors; + + if (useSwampColors1) { + swampColors = swampFoliageColors; + } else { + swampColors = colors; + } + } + } else if (block == Blocks.vine) { + type2 = 2; + smoothColors1 = Config.isSmoothBiomes(); + colors = foliageColors; + + if (useSwampColors1) { + swampColors = swampFoliageColors; + } else { + swampColors = colors; + } + } + } else { + type2 = 1; + smoothColors1 = Config.isSmoothBiomes(); + colors = grassColors; + + if (useSwampColors1) { + swampColors = swampGrassColors; + } else { + swampColors = colors; + } + } + + if (smoothColors1) { + return getSmoothColorMultiplier(block, blockAccess, x, y, z, colors, swampColors, type2, metadata); + } else { + if (swampColors != colors && blockAccess.getBiomeGenForCoords(x, z) == BiomeGenBase.swampland) { + colors = swampColors; + } + + return colors != null ? getCustomColor(colors, blockAccess, x, y, z) : block.colorMultiplier(blockAccess, x, y, z); + } + } + } + + private static int getSmoothColorMultiplier(Block block, IBlockAccess blockAccess, int x, int y, int z, int[] colors, int[] swampColors, int type, int metadata) { + int sumRed = 0; + int sumGreen = 0; + int sumBlue = 0; + int r; + int g; + + for (r = x - 1; r <= x + 1; ++r) { + for (g = z - 1; g <= z + 1; ++g) { + int[] b = colors; + + if (swampColors != colors && blockAccess.getBiomeGenForCoords(r, g) == BiomeGenBase.swampland) { + b = swampColors; + } + + boolean col = false; + int var17; + + if (b == null) { + switch (type) { + case 1: + var17 = blockAccess.getBiomeGenForCoords(r, g).getBiomeGrassColor(x, y, z); + break; + + case 2: + if ((metadata & 3) == 1) { + var17 = ColorizerFoliage.getFoliageColorPine(); + } else if ((metadata & 3) == 2) { + var17 = ColorizerFoliage.getFoliageColorBirch(); + } else { + var17 = blockAccess.getBiomeGenForCoords(r, g).getBiomeFoliageColor(x, y, z); + } + + break; + + default: + var17 = block.colorMultiplier(blockAccess, r, y, g); + } + } else { + var17 = getCustomColor(b, blockAccess, r, y, g); + } + + sumRed += var17 >> 16 & 255; + sumGreen += var17 >> 8 & 255; + sumBlue += var17 & 255; + } + } + + r = sumRed / 9; + g = sumGreen / 9; + int var16 = sumBlue / 9; + return r << 16 | g << 8 | var16; + } + + public static int getFluidColor(Block block, IBlockAccess blockAccess, int x, int y, int z) { + return block.getMaterial() != Material.water ? block.colorMultiplier(blockAccess, x, y, z) : (waterColors != null ? (Config.isSmoothBiomes() ? getSmoothColor(waterColors, blockAccess, (double)x, (double)y, (double)z, 3, 1) : getCustomColor(waterColors, blockAccess, x, y, z)) : (!Config.isSwampColors() ? 16777215 : block.colorMultiplier(blockAccess, x, y, z))); + } + + private static int getCustomColor(int[] colors, IBlockAccess blockAccess, int x, int y, int z) { + BiomeGenBase bgb = blockAccess.getBiomeGenForCoords(x, z); + double temperature = (double)MathHelper.clamp_float(bgb.getFloatTemperature(x, y, z), 0.0F, 1.0F); + double rainfall = (double)MathHelper.clamp_float(bgb.getFloatRainfall(), 0.0F, 1.0F); + rainfall *= temperature; + int cx = (int)((1.0D - temperature) * 255.0D); + int cy = (int)((1.0D - rainfall) * 255.0D); + return colors[cy << 8 | cx] & 16777215; + } + + public static void updatePortalFX(EntityFX fx) { + if (particlePortalColor >= 0) { + int col = particlePortalColor; + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + fx.setRBGColorF(redF, greenF, blueF); + } + } + + public static void updateMyceliumFX(EntityFX fx) { + if (myceliumParticleColors != null) { + int col = myceliumParticleColors[random.nextInt(myceliumParticleColors.length)]; + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + fx.setRBGColorF(redF, greenF, blueF); + } + } + + public static void updateReddustFX(EntityFX fx, IBlockAccess blockAccess, double x, double y, double z) { + if (redstoneColors != null) { + int level = blockAccess.getBlockMetadata((int)x, (int)y, (int)z); + int col = getRedstoneColor(level); + + if (col != -1) { + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + fx.setRBGColorF(redF, greenF, blueF); + } + } + } + + public static int getRedstoneColor(int level) { + return redstoneColors == null ? -1 : (level >= 0 && level <= 15 ? redstoneColors[level] & 16777215 : -1); + } + + public static void updateWaterFX(EntityFX fx, IBlockAccess blockAccess) { + if (waterColors != null) { + int x = (int)fx.posX; + int y = (int)fx.posY; + int z = (int)fx.posZ; + int col = getFluidColor(Blocks.water, blockAccess, x, y, z); + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + + if (particleWaterColor >= 0) { + int redDrop = particleWaterColor >> 16 & 255; + int greenDrop = particleWaterColor >> 8 & 255; + int blueDrop = particleWaterColor & 255; + redF *= (float)redDrop / 255.0F; + greenF *= (float)greenDrop / 255.0F; + blueF *= (float)blueDrop / 255.0F; + } + + fx.setRBGColorF(redF, greenF, blueF); + } + } + + public static int getLilypadColor() { + return lilyPadColor < 0 ? Blocks.waterlily.getBlockColor() : lilyPadColor; + } + + public static Vec3 getFogColorNether(Vec3 col) { + return fogColorNether == null ? col : fogColorNether; + } + + public static Vec3 getFogColorEnd(Vec3 col) { + return fogColorEnd == null ? col : fogColorEnd; + } + + public static Vec3 getSkyColorEnd(Vec3 col) { + return skyColorEnd == null ? col : skyColorEnd; + } + + public static Vec3 getSkyColor(Vec3 skyColor3d, IBlockAccess blockAccess, double x, double y, double z) { + if (skyColors == null) { + return skyColor3d; + } else { + int col = getSmoothColor(skyColors, blockAccess, x, y, z, 10, 1); + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + float cRed = (float)skyColor3d.xCoord / 0.5F; + float cGreen = (float)skyColor3d.yCoord / 0.66275F; + float cBlue = (float)skyColor3d.zCoord; + redF *= cRed; + greenF *= cGreen; + blueF *= cBlue; + return Vec3.createVectorHelper((double)redF, (double)greenF, (double)blueF); + } + } + + public static Vec3 getFogColor(Vec3 fogColor3d, IBlockAccess blockAccess, double x, double y, double z) { + if (fogColors == null) { + return fogColor3d; + } else { + int col = getSmoothColor(fogColors, blockAccess, x, y, z, 10, 1); + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + float cRed = (float)fogColor3d.xCoord / 0.753F; + float cGreen = (float)fogColor3d.yCoord / 0.8471F; + float cBlue = (float)fogColor3d.zCoord; + redF *= cRed; + greenF *= cGreen; + blueF *= cBlue; + return Vec3.createVectorHelper((double)redF, (double)greenF, (double)blueF); + } + } + + private static int[] readTextColors(Properties props, String fileName, String prefix, String logName) { + int[] colors = new int[32]; + Arrays.fill(colors, -1); + int countColors = 0; + Set keys = props.keySet(); + Iterator iter = keys.iterator(); + + while (iter.hasNext()) { + String key = (String)iter.next(); + String value = props.getProperty(key); + + if (key.startsWith(prefix)) { + String name = StrUtils.removePrefix(key, prefix); + int code = Config.parseInt(name, -1); + int color = parseColor(value); + + if (code >= 0 && code < colors.length && color >= 0) { + colors[code] = color; + ++countColors; + } else { + warn("Invalid color: " + key + " = " + value); + } + } + } + + if (countColors <= 0) { + return null; + } else { + dbg(logName + " colors: " + countColors); + return colors; + } + } + + public static int getTextColor(int index, int color) { + if (textColors == null) { + return color; + } else if (index >= 0 && index < textColors.length) { + int customColor = textColors[index]; + return customColor < 0 ? color : customColor; + } else { + return color; + } + } + + private static int parseColor(String str) { + if (str == null) { + return -1; + } else { + str = str.trim(); + + try { + int e = Integer.parseInt(str, 16) & 16777215; + return e; + } catch (NumberFormatException var2) { + return -1; + } + } + } + + public static Vec3 getUnderwaterColor(IBlockAccess blockAccess, double x, double y, double z) { + if (underwaterColors == null) { + return null; + } else { + int col = getSmoothColor(underwaterColors, blockAccess, x, y, z, 10, 1); + int red = col >> 16 & 255; + int green = col >> 8 & 255; + int blue = col & 255; + float redF = (float)red / 255.0F; + float greenF = (float)green / 255.0F; + float blueF = (float)blue / 255.0F; + return Vec3.createVectorHelper((double)redF, (double)greenF, (double)blueF); + } + } + + public static int getSmoothColor(int[] colors, IBlockAccess blockAccess, double x, double y, double z, int samples, int step) { + if (colors == null) { + return -1; + } else { + int x0 = (int)Math.floor(x); + int y0 = (int)Math.floor(y); + int z0 = (int)Math.floor(z); + int n = samples * step / 2; + int sumRed = 0; + int sumGreen = 0; + int sumBlue = 0; + int count = 0; + int r; + int g; + int b; + + for (r = x0 - n; r <= x0 + n; r += step) { + for (g = z0 - n; g <= z0 + n; g += step) { + b = getCustomColor(colors, blockAccess, r, y0, g); + sumRed += b >> 16 & 255; + sumGreen += b >> 8 & 255; + sumBlue += b & 255; + ++count; + } + } + + r = sumRed / count; + g = sumGreen / count; + b = sumBlue / count; + return r << 16 | g << 8 | b; + } + } + + public static int mixColors(int c1, int c2, float w1) { + if (w1 <= 0.0F) { + return c2; + } else if (w1 >= 1.0F) { + return c1; + } else { + float w2 = 1.0F - w1; + int r1 = c1 >> 16 & 255; + int g1 = c1 >> 8 & 255; + int b1 = c1 & 255; + int r2 = c2 >> 16 & 255; + int g2 = c2 >> 8 & 255; + int b2 = c2 & 255; + int r = (int)((float)r1 * w1 + (float)r2 * w2); + int g = (int)((float)g1 * w1 + (float)g2 * w2); + int b = (int)((float)b1 * w1 + (float)b2 * w2); + return r << 16 | g << 8 | b; + } + } + + private static int averageColor(int c1, int c2) { + int r1 = c1 >> 16 & 255; + int g1 = c1 >> 8 & 255; + int b1 = c1 & 255; + int r2 = c2 >> 16 & 255; + int g2 = c2 >> 8 & 255; + int b2 = c2 & 255; + int r = (r1 + r2) / 2; + int g = (g1 + g2) / 2; + int b = (b1 + b2) / 2; + return r << 16 | g << 8 | b; + } + + public static int getStemColorMultiplier(BlockStem blockStem, IBlockAccess blockAccess, int x, int y, int z) { + if (stemColors == null) { + return blockStem.colorMultiplier(blockAccess, x, y, z); + } else { + int level = blockAccess.getBlockMetadata(x, y, z); + + if (level < 0) { + level = 0; + } + + if (level >= stemColors.length) { + level = stemColors.length - 1; + } + + return stemColors[level]; + } + } + + public static boolean updateLightmap(World world, float torchFlickerX, int[] lmColors, boolean nightvision) { + if (world == null) { + return false; + } else if (lightMapsColorsRgb == null) { + return false; + } else if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().enableFpsBoost.getValue() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().fullBright.getValue()) { + return false; + } else if (!Config.isCustomColors()) { + return false; + } else { + int worldType = world.provider.dimensionId; + + if (worldType >= -1 && worldType <= 1) { + int lightMapIndex = worldType + 1; + float[][] lightMapRgb = lightMapsColorsRgb[lightMapIndex]; + + if (lightMapRgb == null) { + return false; + } else { + int height = lightMapsHeight[lightMapIndex]; + + if (nightvision && height < 64) { + return false; + } else { + int width = lightMapRgb.length / height; + + if (width < 16) { + Config.warn("Invalid lightmap width: " + width + " for: /environment/lightmap" + worldType + ".png"); + lightMapsColorsRgb[lightMapIndex] = (float[][])null; + return false; + } else { + int startIndex = 0; + + if (nightvision) { + startIndex = width * 16 * 2; + } + + float sun = 1.1666666F * (world.getSunBrightness(1.0F) - 0.2F); + + if (world.lastLightningBolt > 0) { + sun = 1.0F; + } + + sun = Config.limitTo1(sun); + float sunX = sun * (float)(width - 1); + float torchX = Config.limitTo1(torchFlickerX + 0.5F) * (float)(width - 1); + float gamma = Config.limitTo1(Config.getGameSettings().getGamma()); + boolean hasGamma = gamma > 1.0E-4F; + getLightMapColumn(lightMapRgb, sunX, startIndex, width, sunRgbs); + getLightMapColumn(lightMapRgb, torchX, startIndex + 16 * width, width, torchRgbs); + float[] rgb = new float[3]; + + for (int is = 0; is < 16; ++is) { + for (int it = 0; it < 16; ++it) { + int r; + + for (r = 0; r < 3; ++r) { + float g = Config.limitTo1(sunRgbs[is][r] + torchRgbs[it][r]); + + if (hasGamma) { + float b = 1.0F - g; + b = 1.0F - b * b * b * b; + g = gamma * b + (1.0F - gamma) * g; + } + + rgb[r] = g; + } + + r = (int)(rgb[0] * 255.0F); + int var21 = (int)(rgb[1] * 255.0F); + int var22 = (int)(rgb[2] * 255.0F); + lmColors[is * 16 + it] = -16777216 | r << 16 | var21 << 8 | var22; + } + } + + return true; + } + } + } + } else { + return false; + } + } + } + + private static void getLightMapColumn(float[][] origMap, float x, int offset, int width, float[][] colRgb) { + int xLow = (int)Math.floor((double)x); + int xHigh = (int)Math.ceil((double)x); + + if (xLow == xHigh) { + for (int var14 = 0; var14 < 16; ++var14) { + float[] var15 = origMap[offset + var14 * width + xLow]; + float[] var16 = colRgb[var14]; + + for (int var17 = 0; var17 < 3; ++var17) { + var16[var17] = var15[var17]; + } + } + } else { + float dLow = 1.0F - (x - (float)xLow); + float dHigh = 1.0F - ((float)xHigh - x); + + for (int y = 0; y < 16; ++y) { + float[] rgbLow = origMap[offset + y * width + xLow]; + float[] rgbHigh = origMap[offset + y * width + xHigh]; + float[] rgb = colRgb[y]; + + for (int i = 0; i < 3; ++i) { + rgb[i] = rgbLow[i] * dLow + rgbHigh[i] * dHigh; + } + } + } + } + + public static Vec3 getWorldFogColor(Vec3 fogVec, WorldClient world, float partialTicks) { + int worldType = world.provider.dimensionId; + + switch (worldType) { + case -1: + fogVec = getFogColorNether(fogVec); + break; + + case 0: + Minecraft mc = Minecraft.getMinecraft(); + fogVec = getFogColor(fogVec, mc.theWorld, mc.renderViewEntity.posX, mc.renderViewEntity.posY + 1.0D, mc.renderViewEntity.posZ); + break; + + case 1: + fogVec = getFogColorEnd(fogVec); + } + + return fogVec; + } + + public static Vec3 getWorldSkyColor(Vec3 skyVec, World world, Entity renderViewEntity, float partialTicks) { + int worldType = world.provider.dimensionId; + + switch (worldType) { + case 0: + Minecraft mc = Minecraft.getMinecraft(); + skyVec = getSkyColor(skyVec, mc.theWorld, mc.renderViewEntity.posX, mc.renderViewEntity.posY + 1.0D, mc.renderViewEntity.posZ); + break; + + case 1: + skyVec = getSkyColorEnd(skyVec); + } + + return skyVec; + } + + private static void dbg(String str) { + Config.dbg("CustomColors: " + str); + } + + private static void warn(String str) { + Config.warn("CustomColors: " + str); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItemProperties.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItemProperties.java new file mode 100644 index 0000000..7b62862 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItemProperties.java @@ -0,0 +1,462 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class CustomItemProperties { + public String name = null; + public String basePath = null; + public int type = 1; + public int[] items = null; + public String texture = null; + public Map mapTextures = null; + public RangeListInt damage = null; + public boolean damagePercent = false; + public int damageMask = 0; + public RangeListInt stackSize = null; + public RangeListInt enchantmentIds = null; + public RangeListInt enchantmentLevels = null; + public NbtTagValue[] nbtTagValues = null; + public int blend = 1; + public int speed = 0; + public int rotation = 0; + public int layer = 0; + public int duration = 1; + public int weight = 0; + public IIcon textureIcon = null; + public Map mapTextureIcons = null; + public static final int TYPE_UNKNOWN = 0; + public static final int TYPE_ITEM = 1; + public static final int TYPE_ENCHANTMENT = 2; + public static final int TYPE_ARMOR = 3; + + public CustomItemProperties(Properties props, String path) { + this.name = parseName(path); + this.basePath = parseBasePath(path); + this.type = this.parseType(props.getProperty("type")); + this.items = this.parseItems(props.getProperty("items"), props.getProperty("matchItems")); + this.texture = parseTexture(props.getProperty("texture"), props.getProperty("tile"), props.getProperty("source"), path, this.basePath); + this.mapTextures = parseTextures(props, this.basePath); + String damageStr = props.getProperty("damage"); + + if (damageStr != null) { + this.damagePercent = damageStr.contains("%"); + damageStr.replace("%", ""); + this.damage = this.parseRangeListInt(damageStr); + this.damageMask = this.parseInt(props.getProperty("damageMask"), 0); + } + + this.stackSize = this.parseRangeListInt(props.getProperty("stackSize")); + this.enchantmentIds = this.parseRangeListInt(props.getProperty("enchantmentIDs")); + this.enchantmentLevels = this.parseRangeListInt(props.getProperty("enchantmentLevels")); + this.nbtTagValues = this.parseNbtTagValues(props); + this.blend = Blender.parseBlend(props.getProperty("blend")); + this.speed = this.parseInt(props.getProperty("speed"), 0); + this.rotation = this.parseInt(props.getProperty("rotation"), 0); + this.layer = this.parseInt(props.getProperty("layer"), 0); + this.weight = this.parseInt(props.getProperty("weight"), 0); + this.duration = this.parseInt(props.getProperty("duration"), 1); + } + + private static String parseName(String path) { + String str = path; + int pos = path.lastIndexOf(47); + + if (pos >= 0) { + str = path.substring(pos + 1); + } + + int pos2 = str.lastIndexOf(46); + + if (pos2 >= 0) { + str = str.substring(0, pos2); + } + + return str; + } + + private static String parseBasePath(String path) { + int pos = path.lastIndexOf(47); + return pos < 0 ? "" : path.substring(0, pos); + } + + private int parseType(String str) { + if (str == null) { + return 1; + } else if (str.equals("item")) { + return 1; + } else if (str.equals("enchantment")) { + return 2; + } else if (str.equals("armor")) { + return 3; + } else { + Config.warn("Unknown method: " + str); + return 0; + } + } + + private int[] parseItems(String str, String str2) { + if (str == null) { + str = str2; + } + + if (str == null) { + return null; + } else { + str = str.trim(); + TreeSet setItemIds = new TreeSet(); + String[] tokens = Config.tokenize(str, " "); + int i; + label58: + + for (int integers = 0; integers < tokens.length; ++integers) { + String ints = tokens[integers]; + i = Config.parseInt(ints, -1); + + if (i >= 0) { + setItemIds.add(new Integer(i)); + } else { + int id; + + if (ints.contains("-")) { + String[] itemObj = Config.tokenize(ints, "-"); + + if (itemObj.length == 2) { + int item = Config.parseInt(itemObj[0], -1); + id = Config.parseInt(itemObj[1], -1); + + if (item >= 0 && id >= 0) { + int min = Math.min(item, id); + int max = Math.max(item, id); + int x = min; + + while (true) { + if (x > max) { + continue label58; + } + + setItemIds.add(new Integer(x)); + ++x; + } + } + } + } + + Object var16 = Item.itemRegistry.getObject(ints); + + if (!(var16 instanceof Item)) { + Config.dbg("Item not found: " + ints); + } else { + Item var17 = (Item)var16; + id = Item.getIdFromItem(var17); + + if (id < 0) { + Config.dbg("Item not found: " + ints); + } else { + setItemIds.add(new Integer(id)); + } + } + } + } + + Integer[] var14 = (Integer[])((Integer[])setItemIds.toArray(new Integer[setItemIds.size()])); + int[] var15 = new int[var14.length]; + + for (i = 0; i < var15.length; ++i) { + var15[i] = var14[i].intValue(); + } + + return var15; + } + } + + private static String parseTexture(String texStr, String texStr2, String texStr3, String path, String basePath) { + if (texStr == null) { + texStr = texStr2; + } + + if (texStr == null) { + texStr = texStr3; + } + + String str; + + if (texStr != null) { + str = ".png"; + + if (texStr.endsWith(str)) { + texStr = texStr.substring(0, texStr.length() - str.length()); + } + + texStr = fixTextureName(texStr, basePath); + return texStr; + } else { + str = path; + int pos = path.lastIndexOf(47); + + if (pos >= 0) { + str = path.substring(pos + 1); + } + + int pos2 = str.lastIndexOf(46); + + if (pos2 >= 0) { + str = str.substring(0, pos2); + } + + str = fixTextureName(str, basePath); + return str; + } + } + + private static Map parseTextures(Properties props, String basePath) { + String prefix = "texture."; + Map mapProps = getMatchingProperties(props, prefix); + + if (mapProps.size() <= 0) { + return null; + } else { + Set keySet = mapProps.keySet(); + LinkedHashMap mapTex = new LinkedHashMap(); + String key; + String val; + + for (Iterator it = keySet.iterator(); it.hasNext(); mapTex.put(key, val)) { + key = (String)it.next(); + val = (String)mapProps.get(key); + val = fixTextureName(val, basePath); + + if (key.startsWith(prefix)) { + key = key.substring(prefix.length()); + } + } + + return mapTex; + } + } + + private static String fixTextureName(String iconName, String basePath) { + iconName = TextureUtils.fixResourcePath(iconName, basePath); + + if (!iconName.startsWith(basePath) && !iconName.startsWith("textures/") && !iconName.startsWith("mcpatcher/")) { + iconName = basePath + "/" + iconName; + } + + if (iconName.endsWith(".png")) { + iconName = iconName.substring(0, iconName.length() - 4); + } + + String pathBlocks = "textures/blocks/"; + + if (iconName.startsWith(pathBlocks)) { + iconName = iconName.substring(pathBlocks.length()); + } + + if (iconName.startsWith("/")) { + iconName = iconName.substring(1); + } + + return iconName; + } + + private int parseInt(String str, int defVal) { + if (str == null) { + return defVal; + } else { + str = str.trim(); + int val = Config.parseInt(str, Integer.MIN_VALUE); + + if (val == Integer.MIN_VALUE) { + Config.warn("Invalid integer: " + str); + return defVal; + } else { + return val; + } + } + } + + private RangeListInt parseRangeListInt(String str) { + if (str == null) { + return null; + } else { + String[] tokens = Config.tokenize(str, " "); + RangeListInt rangeList = new RangeListInt(); + + for (int i = 0; i < tokens.length; ++i) { + String token = tokens[i]; + RangeInt range = this.parseRangeInt(token); + + if (range == null) { + Config.warn("Invalid range list: " + str); + return null; + } + + rangeList.addRange(range); + } + + return rangeList; + } + } + + private RangeInt parseRangeInt(String str) { + if (str == null) { + return null; + } else { + str = str.trim(); + int countMinus = str.length() - str.replace("-", "").length(); + + if (countMinus > 1) { + Config.warn("Invalid range: " + str); + return null; + } else { + String[] tokens = Config.tokenize(str, "- "); + int[] vals = new int[tokens.length]; + int min; + + for (min = 0; min < tokens.length; ++min) { + String max = tokens[min]; + int val = Config.parseInt(max, -1); + + if (val < 0) { + Config.warn("Invalid range: " + str); + return null; + } + + vals[min] = val; + } + + if (vals.length == 1) { + min = vals[0]; + + if (str.startsWith("-")) { + return new RangeInt(-1, min); + } else if (str.endsWith("-")) { + return new RangeInt(min, -1); + } else { + return new RangeInt(min, min); + } + } else if (vals.length == 2) { + min = Math.min(vals[0], vals[1]); + int var8 = Math.max(vals[0], vals[1]); + return new RangeInt(min, var8); + } else { + Config.warn("Invalid range: " + str); + return null; + } + } + } + } + + private NbtTagValue[] parseNbtTagValues(Properties props) { + Map mapNbt = getMatchingProperties(props, "nbt."); + + if (mapNbt.size() <= 0) { + return null; + } else { + ArrayList listNbts = new ArrayList(); + Set keySet = mapNbt.keySet(); + Iterator nbts = keySet.iterator(); + + while (nbts.hasNext()) { + String key = (String)nbts.next(); + String val = (String)mapNbt.get(key); + NbtTagValue nbt = new NbtTagValue(key, val); + listNbts.add(nbt); + } + + NbtTagValue[] nbts1 = (NbtTagValue[])((NbtTagValue[])listNbts.toArray(new NbtTagValue[listNbts.size()])); + return nbts1; + } + } + + private static Map getMatchingProperties(Properties props, String keyPrefix) { + LinkedHashMap map = new LinkedHashMap(); + Set keySet = props.keySet(); + Iterator it = keySet.iterator(); + + while (it.hasNext()) { + String key = (String)it.next(); + String val = props.getProperty(key); + + if (key.startsWith(keyPrefix)) { + map.put(key, val); + } + } + + return map; + } + + public boolean isValid(String path) { + if (this.name != null && this.name.length() > 0) { + if (this.basePath == null) { + Config.warn("No base path found: " + path); + return false; + } else if (this.type == 0) { + Config.warn("No type defined: " + path); + return false; + } else if ((this.type == 1 || this.type == 3) && this.items == null) { + Config.warn("No items defined: " + path); + return false; + } else if (this.texture == null && this.mapTextures == null) { + Config.warn("No texture specified: " + path); + return false; + } else { + return true; + } + } else { + Config.warn("No name found: " + path); + return false; + } + } + + public void updateIcons(TextureMap textureMap) { + if (this.texture != null) { + this.textureIcon = registerIcon(this.texture, textureMap); + } + + if (this.mapTextures != null) { + this.mapTextureIcons = new LinkedHashMap(); + Set keySet = this.mapTextures.keySet(); + Iterator it = keySet.iterator(); + + while (it.hasNext()) { + String key = (String)it.next(); + String val = (String)this.mapTextures.get(key); + IIcon icon = registerIcon(val, textureMap); + this.mapTextureIcons.put(key, icon); + } + } + } + + private static IIcon registerIcon(String tileName, TextureMap textureMap) { + if (tileName == null) { + return null; + } else { + String fullName = tileName; + + if (!tileName.contains("/")) { + fullName = "textures/blocks/" + tileName; + } + + String fileName = fullName + ".png"; + ResourceLocation loc = new ResourceLocation(fileName); + boolean exists = Config.hasResource(loc); + + if (!exists) { + Config.warn("File not found: " + fileName); + } + + IIcon icon = textureMap.registerIcon(tileName); + return icon; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItems.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItems.java new file mode 100644 index 0000000..86bcc4e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItems.java @@ -0,0 +1,566 @@ +package net.minecraft.src; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.AbstractResourcePack; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class CustomItems { + private static CustomItemProperties[][] itemProperties = (CustomItemProperties[][])null; + private static Map mapPotionIds = null; + + public static void updateIcons(TextureMap textureMap) { + itemProperties = (CustomItemProperties[][])null; + + if (Config.isCustomItems()) { + IResourcePack[] rps = Config.getResourcePacks(); + + for (int i = rps.length - 1; i >= 0; --i) { + IResourcePack rp = rps[i]; + updateIcons(textureMap, rp); + } + + updateIcons(textureMap, Config.getDefaultResourcePack()); + } + } + + public static void updateIcons(TextureMap textureMap, IResourcePack rp) { + String[] names = collectFiles(rp, "mcpatcher/cit/", ".properties"); + Map mapAutoProperties = makeAutoImageProperties(rp); + + if (mapAutoProperties.size() > 0) { + Set itemList = mapAutoProperties.keySet(); + String[] i = (String[])((String[])itemList.toArray(new String[itemList.size()])); + names = (String[])((String[])Config.addObjectsToArray(names, i)); + } + + Arrays.sort(names); + List var13 = makePropertyList(itemProperties); + + for (int var14 = 0; var14 < names.length; ++var14) { + String name = names[var14]; + Config.dbg("CustomItems: " + name); + + try { + CustomItemProperties e = null; + + if (mapAutoProperties.containsKey(name)) { + e = (CustomItemProperties)mapAutoProperties.get(name); + } + + if (e == null) { + ResourceLocation locFile = new ResourceLocation(name); + InputStream in = rp.getInputStream(locFile); + + if (in == null) { + Config.warn("CustomItems file not found: " + name); + continue; + } + + Properties props = new Properties(); + props.load(in); + e = new CustomItemProperties(props, name); + } + + if (e.isValid(name)) { + e.updateIcons(textureMap); + addToItemList(e, var13); + } + } catch (FileNotFoundException var11) { + Config.warn("CustomItems file not found: " + name); + } catch (IOException var12) { + var12.printStackTrace(); + } + } + + itemProperties = propertyListToArray(var13); + } + + private static Map makeAutoImageProperties(IResourcePack rp) { + HashMap map = new HashMap(); + map.putAll(makePotionImageProperties(rp, false)); + map.putAll(makePotionImageProperties(rp, true)); + return map; + } + + private static Map makePotionImageProperties(IResourcePack rp, boolean splash) { + HashMap map = new HashMap(); + String prefix = "mcpatcher/cit/potion/"; + + if (splash) { + prefix = prefix + "splash/"; + } else { + prefix = prefix + "normal/"; + } + + String suffix = ".png"; + String[] names = collectFiles(rp, prefix, suffix); + + for (int i = 0; i < names.length; ++i) { + String path = names[i]; + + if (path.startsWith(prefix) && path.endsWith(suffix)) { + String name = path.substring(prefix.length(), path.length() - suffix.length()); + Properties props = makePotionProperties(name, splash, path); + + if (props != null) { + String pathProp = path.substring(0, path.length() - suffix.length()) + ".properties"; + CustomItemProperties cip = new CustomItemProperties(props, pathProp); + map.put(pathProp, cip); + } + } else { + Config.warn("Invalid potion name: " + path); + } + } + + return map; + } + + private static Properties makePotionProperties(String name, boolean splash, String path) { + int potionItemId; + + if (name.equals("empty") && !splash) { + potionItemId = Item.getIdFromItem(Items.glass_bottle); + Properties var8 = new Properties(); + var8.put("type", "item"); + var8.put("items", "" + potionItemId); + return var8; + } else { + potionItemId = Item.getIdFromItem(Items.potionitem); + int[] damages = (int[])((int[])getMapPotionIds().get(name)); + + if (damages == null) { + Config.warn("Potion not found for image: " + path); + return null; + } else { + StringBuffer bufDamage = new StringBuffer(); + + for (int damageMask = 0; damageMask < damages.length; ++damageMask) { + int props = damages[damageMask]; + + if (splash) { + props |= 16384; + } + + if (damageMask > 0) { + bufDamage.append(" "); + } + + bufDamage.append(props); + } + + short var9 = 16447; + Properties var10 = new Properties(); + var10.put("type", "item"); + var10.put("items", "" + potionItemId); + var10.put("damage", "" + bufDamage.toString()); + var10.put("damageMask", "" + var9); + return var10; + } + } + } + + private static Map getMapPotionIds() { + if (mapPotionIds == null) { + mapPotionIds = new LinkedHashMap(); + mapPotionIds.put("water", new int[] {0}); + mapPotionIds.put("awkward", new int[] {16}); + mapPotionIds.put("thick", new int[] {32}); + mapPotionIds.put("potent", new int[] {48}); + mapPotionIds.put("regeneration", getPotionIds(1)); + mapPotionIds.put("moveSpeed", getPotionIds(2)); + mapPotionIds.put("fireResistance", getPotionIds(3)); + mapPotionIds.put("poison", getPotionIds(4)); + mapPotionIds.put("heal", getPotionIds(5)); + mapPotionIds.put("nightVision", getPotionIds(6)); + mapPotionIds.put("clear", getPotionIds(7)); + mapPotionIds.put("bungling", getPotionIds(23)); + mapPotionIds.put("charming", getPotionIds(39)); + mapPotionIds.put("rank", getPotionIds(55)); + mapPotionIds.put("weakness", getPotionIds(8)); + mapPotionIds.put("damageBoost", getPotionIds(9)); + mapPotionIds.put("moveSlowdown", getPotionIds(10)); + mapPotionIds.put("diffuse", getPotionIds(11)); + mapPotionIds.put("smooth", getPotionIds(27)); + mapPotionIds.put("refined", getPotionIds(43)); + mapPotionIds.put("acrid", getPotionIds(59)); + mapPotionIds.put("harm", getPotionIds(12)); + mapPotionIds.put("waterBreathing", getPotionIds(13)); + mapPotionIds.put("invisibility", getPotionIds(14)); + mapPotionIds.put("thin", getPotionIds(15)); + mapPotionIds.put("debonair", getPotionIds(31)); + mapPotionIds.put("sparkling", getPotionIds(47)); + mapPotionIds.put("stinky", getPotionIds(63)); + } + + return mapPotionIds; + } + + private static int[] getPotionIds(int baseId) { + return new int[] {baseId, baseId + 16, baseId + 32, baseId + 48}; + } + + private static int getPotionNameDamage(String name) { + String fullName = "potion." + name; + Potion[] effectPotions = Potion.potionTypes; + + for (int i = 0; i < effectPotions.length; ++i) { + Potion potion = effectPotions[i]; + + if (potion != null) { + String potionName = potion.getName(); + + if (fullName.equals(potionName)) { + return potion.getId(); + } + } + } + + return -1; + } + + private static List makePropertyList(CustomItemProperties[][] propsArr) { + ArrayList list = new ArrayList(); + + if (propsArr != null) { + for (int i = 0; i < propsArr.length; ++i) { + CustomItemProperties[] props = propsArr[i]; + ArrayList propList = null; + + if (props != null) { + propList = new ArrayList(Arrays.asList(props)); + } + + list.add(propList); + } + } + + return list; + } + + private static String[] collectFiles(IResourcePack rp, String prefix, String suffix) { + if (rp instanceof DefaultResourcePack) { + return collectFilesDefault(rp); + } else if (!(rp instanceof AbstractResourcePack)) { + return new String[0]; + } else { + AbstractResourcePack arp = (AbstractResourcePack)rp; + File tpFile = ResourceUtils.getResourcePackFile(arp); + return tpFile == null ? new String[0] : (tpFile.isDirectory() ? collectFilesFolder(tpFile, "", prefix, suffix) : (tpFile.isFile() ? collectFilesZIP(tpFile, prefix, suffix) : new String[0])); + } + } + + private static String[] collectFilesDefault(IResourcePack rp) { + return new String[0]; + } + + private static String[] collectFilesFolder(File tpFile, String basePath, String prefix, String suffix) { + ArrayList list = new ArrayList(); + String prefixAssets = "assets/minecraft/"; + File[] files = tpFile.listFiles(); + + if (files == null) { + return new String[0]; + } else { + for (int names = 0; names < files.length; ++names) { + File file = files[names]; + String dirPath; + + if (file.isFile()) { + dirPath = basePath + file.getName(); + + if (dirPath.startsWith(prefixAssets)) { + dirPath = dirPath.substring(prefixAssets.length()); + + if (dirPath.startsWith(prefix) && dirPath.endsWith(suffix)) { + list.add(dirPath); + } + } + } else if (file.isDirectory()) { + dirPath = basePath + file.getName() + "/"; + String[] names1 = collectFilesFolder(file, dirPath, prefix, suffix); + + for (int n = 0; n < names1.length; ++n) { + String name = names1[n]; + list.add(name); + } + } + } + + String[] var13 = (String[])((String[])list.toArray(new String[list.size()])); + return var13; + } + } + + private static String[] collectFilesZIP(File tpFile, String prefix, String suffix) { + ArrayList list = new ArrayList(); + String prefixAssets = "assets/minecraft/"; + + try { + ZipFile e = new ZipFile(tpFile); + Enumeration en = e.entries(); + + while (en.hasMoreElements()) { + ZipEntry names = (ZipEntry)en.nextElement(); + String name = names.getName(); + + if (name.startsWith(prefixAssets)) { + name = name.substring(prefixAssets.length()); + + if (name.startsWith(prefix) && name.endsWith(suffix)) { + list.add(name); + } + } + } + + e.close(); + String[] names1 = (String[])((String[])list.toArray(new String[list.size()])); + return names1; + } catch (IOException var9) { + var9.printStackTrace(); + return new String[0]; + } + } + + private static CustomItemProperties[][] propertyListToArray(List list) { + CustomItemProperties[][] propArr = new CustomItemProperties[list.size()][]; + + for (int i = 0; i < list.size(); ++i) { + List subList = (List)list.get(i); + + if (subList != null) { + CustomItemProperties[] subArr = (CustomItemProperties[])((CustomItemProperties[])subList.toArray(new CustomItemProperties[subList.size()])); + Arrays.sort(subArr, new CustomItemsComparator()); + propArr[i] = subArr; + } + } + + return propArr; + } + + private static void addToItemList(CustomItemProperties cp, List itemList) { + if (cp.items != null) { + for (int i = 0; i < cp.items.length; ++i) { + int itemId = cp.items[i]; + + if (itemId <= 0) { + Config.warn("Invalid item ID: " + itemId); + } else { + addToList(cp, itemList, itemId); + } + } + } + } + + private static void addToList(CustomItemProperties cp, List list, int id) { + while (id >= list.size()) { + list.add((Object)null); + } + + Object subList = (List)list.get(id); + + if (subList == null) { + subList = new ArrayList(); + list.set(id, subList); + } + + ((List)subList).add(cp); + } + + public static IIcon getCustomItemTexture(ItemStack itemStack, IIcon icon) { + if (itemProperties == null) { + return icon; + } else if (itemStack == null) { + return icon; + } else { + Item item = itemStack.getItem(); + int itemId = Item.getIdFromItem(item); + + if (itemId >= 0 && itemId < itemProperties.length) { + CustomItemProperties[] cips = itemProperties[itemId]; + + if (cips != null) { + for (int i = 0; i < cips.length; ++i) { + CustomItemProperties cip = cips[i]; + IIcon iconNew = getCustomItemTexture(cip, itemStack, icon); + + if (iconNew != null) { + return iconNew; + } + } + } + } + + return icon; + } + } + + public static IIcon getCustomPotionTexture(ItemPotion item, int damage) { + if (itemProperties == null) { + return null; + } else { + int itemId = Item.getIdFromItem(item); + + if (itemId >= 0 && itemId < itemProperties.length) { + CustomItemProperties[] cips = itemProperties[itemId]; + + if (cips != null) { + for (int i = 0; i < cips.length; ++i) { + CustomItemProperties cip = cips[i]; + IIcon iconNew = getCustomPotionTexture(cip, item, damage); + + if (iconNew != null) { + return iconNew; + } + } + } + } + + return null; + } + } + + private static IIcon getCustomPotionTexture(CustomItemProperties cip, ItemPotion item, int damage) { + if (cip.damage != null) { + if (cip.damageMask != 0) { + damage &= cip.damageMask; + } + + if (!cip.damage.isInRange(damage)) { + return null; + } + } + + return cip.textureIcon; + } + + private static IIcon getCustomItemTexture(CustomItemProperties cip, ItemStack itemStack, IIcon icon) { + Item item = itemStack.getItem(); + + if (cip.damage != null) { + int levels = itemStack.getItemDamage(); + + if (cip.damageMask != 0) { + levels &= cip.damageMask; + } + + int levelMatch = item.getMaxDamage(); + + if (cip.damagePercent) { + levels = (int)((double)(levels * 100) / (double)levelMatch); + } + + if (!cip.damage.isInRange(levels)) { + return null; + } + } + + if (cip.stackSize != null && !cip.stackSize.isInRange(itemStack.stackSize)) { + return null; + } else { + int i; + int level; + int[] var8; + boolean var9; + + if (cip.enchantmentIds != null) { + var8 = getEnchantmentIds(itemStack); + var9 = false; + + for (i = 0; i < var8.length; ++i) { + level = var8[i]; + + if (cip.enchantmentIds.isInRange(level)) { + var9 = true; + break; + } + } + + if (!var9) { + return null; + } + } + + if (cip.enchantmentLevels != null) { + var8 = getEnchantmentLevels(itemStack); + var9 = false; + + for (i = 0; i < var8.length; ++i) { + level = var8[i]; + + if (cip.enchantmentLevels.isInRange(level)) { + var9 = true; + break; + } + } + + if (!var9) { + return null; + } + } + + if (cip.nbtTagValues != null) { + ; + } + + return cip.textureIcon; + } + } + + private static int[] getEnchantmentIds(ItemStack itemStack) { + Map map = EnchantmentHelper.getEnchantments(itemStack); + Set keySet = map.keySet(); + int[] ids = new int[keySet.size()]; + int index = 0; + + for (Iterator it = keySet.iterator(); it.hasNext(); ++index) { + Integer id = (Integer)it.next(); + ids[index] = id.intValue(); + } + + return ids; + } + + private static int[] getEnchantmentLevels(ItemStack itemStack) { + Map map = EnchantmentHelper.getEnchantments(itemStack); + Collection values = map.values(); + int[] levels = new int[values.size()]; + int index = 0; + + for (Iterator it = values.iterator(); it.hasNext(); ++index) { + Integer level = (Integer)it.next(); + levels[index] = level.intValue(); + } + + return levels; + } + + public static ResourceLocation getLocationItemGlint(ItemStack par2ItemStack, ResourceLocation resItemGlint) { + return resItemGlint; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItemsComparator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItemsComparator.java new file mode 100644 index 0000000..5fbfd44 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomItemsComparator.java @@ -0,0 +1,11 @@ +package net.minecraft.src; + +import java.util.Comparator; + +public class CustomItemsComparator implements Comparator { + public int compare(Object o1, Object o2) { + CustomItemProperties p1 = (CustomItemProperties)o1; + CustomItemProperties p2 = (CustomItemProperties)o2; + return p1.weight != p2.weight ? p2.weight - p1.weight : (!Config.equals(p1.basePath, p2.basePath) ? p1.basePath.compareTo(p2.basePath) : p1.name.compareTo(p2.name)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomSky.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomSky.java new file mode 100644 index 0000000..cc75219 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomSky.java @@ -0,0 +1,156 @@ +package net.minecraft.src; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Properties; + +import lombok.Getter; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class CustomSky { + @Getter private static CustomSkyLayer[][] worldSkyLayers = (CustomSkyLayer[][])null; + + public static void reset() { + worldSkyLayers = (CustomSkyLayer[][])null; + } + + public static void update() { + reset(); + + if (Config.isCustomSky()) { + worldSkyLayers = readCustomSkies(); + } + } + + private static CustomSkyLayer[][] readCustomSkies() { + CustomSkyLayer[][] wsls = new CustomSkyLayer[10][0]; + String prefix = "mcpatcher/sky/world"; + int lastWorldId = -1; + int worldCount = 0; + + while (worldCount < wsls.length) { + String wslsTrim = prefix + worldCount + "/sky"; + ArrayList i = new ArrayList(); + int sls = 1; + + while (true) { + if (sls < 1000) { + label69: { + String path = wslsTrim + sls + ".properties"; + + try { + ResourceLocation e = new ResourceLocation(path); + InputStream in = Config.getResourceStream(e); + + if (in == null) { + break label69; + } + + Properties props = new Properties(); + props.load(in); + in.close(); + Config.dbg("CustomSky properties: " + path); + String defSource = wslsTrim + sls + ".png"; + CustomSkyLayer sl = new CustomSkyLayer(props, defSource); + + if (sl.isValid(path)) { + ResourceLocation locSource = new ResourceLocation(sl.source); + ITextureObject tex = TextureUtils.getTexture(locSource); + + if (tex == null) { + Config.log("CustomSky: Texture not found: " + locSource); + } else { + sl.textureId = tex.getGlTextureId(); + i.add(sl); + in.close(); + } + } + } catch (FileNotFoundException var15) { + break label69; + } catch (IOException var16) { + var16.printStackTrace(); + } + + ++sls; + continue; + } + } + + if (i.size() > 0) { + CustomSkyLayer[] var19 = (CustomSkyLayer[])((CustomSkyLayer[])i.toArray(new CustomSkyLayer[i.size()])); + wsls[worldCount] = var19; + lastWorldId = worldCount; + } + + ++worldCount; + break; + } + } + + if (lastWorldId < 0) { + return (CustomSkyLayer[][])null; + } else { + worldCount = lastWorldId + 1; + CustomSkyLayer[][] var17 = new CustomSkyLayer[worldCount][0]; + + for (int var18 = 0; var18 < var17.length; ++var18) { + var17[var18] = wsls[var18]; + } + + return var17; + } + } + + public static void renderSky(World world, TextureManager re, float partialTicks) { + if (worldSkyLayers != null) { + int dimId = world.provider.dimensionId; + + if (dimId >= 0 && dimId < worldSkyLayers.length) { + CustomSkyLayer[] sls = worldSkyLayers[dimId]; + + if (sls != null) { + long time = world.getWorldTime(); + int timeOfDay = (int)(time % 24000L); + float celestialAngle = world.getCelestialAngle(partialTicks); + float rainStrength = world.getRainStrength(partialTicks); + float thunderStrength = world.getWeightedThunderStrength(partialTicks); + + if (rainStrength > 0.0F) { + thunderStrength /= rainStrength; + } + + for (int rainBrightness = 0; rainBrightness < sls.length; ++rainBrightness) { + CustomSkyLayer sl = sls[rainBrightness]; + + if (sl.isActive(world, timeOfDay)) { + sl.render(world, timeOfDay, celestialAngle, rainStrength, thunderStrength); + } + } + + float var13 = 1.0F - rainStrength; + Blender.clearBlend(var13); + } + } + } + } + + public static boolean hasSkyLayers(World world) { + if (worldSkyLayers == null) { + return false; + } else { + int dimId = world.provider.dimensionId; + + if (dimId >= 0 && dimId < worldSkyLayers.length) { + CustomSkyLayer[] sls = worldSkyLayers[dimId]; + return sls == null ? false : sls.length > 0; + } else { + return false; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomSkyLayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomSkyLayer.java new file mode 100644 index 0000000..d2d46d1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/CustomSkyLayer.java @@ -0,0 +1,422 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import org.lwjgl.opengl.GL11; + +public class CustomSkyLayer { + public String source = null; + private int startFadeIn = -1; + private int endFadeIn = -1; + private int startFadeOut = -1; + private int endFadeOut = -1; + private int blend = 1; + private boolean rotate = false; + private float speed = 1.0F; + private float[] axis; + private RangeListInt days; + private int daysLoop; + private boolean weatherClear; + private boolean weatherRain; + private boolean weatherThunder; + public BiomeGenBase[] biomes; + public RangeListInt heights; + private float transition; + private SmoothFloat smoothPositionBrightness; + public int textureId; + private World lastWorld; + public static final float[] DEFAULT_AXIS = new float[] {1.0F, 0.0F, 0.0F}; + private static final String WEATHER_CLEAR = "clear"; + private static final String WEATHER_RAIN = "rain"; + private static final String WEATHER_THUNDER = "thunder"; + + public CustomSkyLayer(Properties props, String defSource) { + this.axis = DEFAULT_AXIS; + this.days = null; + this.daysLoop = 8; + this.weatherClear = true; + this.weatherRain = false; + this.weatherThunder = false; + this.biomes = null; + this.heights = null; + this.transition = 1.0F; + this.smoothPositionBrightness = null; + this.textureId = -1; + this.lastWorld = null; + ConnectedParser cp = new ConnectedParser("CustomSky"); + this.source = props.getProperty("source", defSource); + this.startFadeIn = this.parseTime(props.getProperty("startFadeIn")); + this.endFadeIn = this.parseTime(props.getProperty("endFadeIn")); + this.startFadeOut = this.parseTime(props.getProperty("startFadeOut")); + this.endFadeOut = this.parseTime(props.getProperty("endFadeOut")); + this.blend = Blender.parseBlend(props.getProperty("blend")); + this.rotate = this.parseBoolean(props.getProperty("rotate"), true); + this.speed = this.parseFloat(props.getProperty("speed"), 1.0F); + this.axis = this.parseAxis(props.getProperty("axis"), DEFAULT_AXIS); + this.days = cp.parseRangeListInt(props.getProperty("days")); + this.daysLoop = cp.parseInt(props.getProperty("daysLoop"), 8); + List weatherList = this.parseWeatherList(props.getProperty("weather", "clear")); + this.weatherClear = weatherList.contains("clear"); + this.weatherRain = weatherList.contains("rain"); + this.weatherThunder = weatherList.contains("thunder"); + this.biomes = cp.parseBiomes(props.getProperty("biomes")); + this.heights = cp.parseRangeListInt(props.getProperty("heights")); + this.transition = this.parseFloat(props.getProperty("transition"), 1.0F); + } + + private List parseWeatherList(String str) { + List weatherAllowedList = Arrays.asList(new String[] {"clear", "rain", "thunder"}); + ArrayList weatherList = new ArrayList(); + String[] weatherStrs = Config.tokenize(str, " "); + + for (int i = 0; i < weatherStrs.length; ++i) { + String token = weatherStrs[i]; + + if (!weatherAllowedList.contains(token)) { + Config.warn("Unknown weather: " + token); + } else { + weatherList.add(token); + } + } + + return weatherList; + } + + private int parseTime(String str) { + if (str == null) { + return -1; + } else { + String[] strs = Config.tokenize(str, ":"); + + if (strs.length != 2) { + Config.warn("Invalid time: " + str); + return -1; + } else { + String hourStr = strs[0]; + String minStr = strs[1]; + int hour = Config.parseInt(hourStr, -1); + int min = Config.parseInt(minStr, -1); + + if (hour >= 0 && hour <= 23 && min >= 0 && min <= 59) { + hour -= 6; + + if (hour < 0) { + hour += 24; + } + + int time = hour * 1000 + (int)((double)min / 60.0D * 1000.0D); + return time; + } else { + Config.warn("Invalid time: " + str); + return -1; + } + } + } + } + + private boolean parseBoolean(String str, boolean defVal) { + if (str == null) { + return defVal; + } else if (str.toLowerCase().equals("true")) { + return true; + } else if (str.toLowerCase().equals("false")) { + return false; + } else { + Config.warn("Unknown boolean: " + str); + return defVal; + } + } + + private float parseFloat(String str, float defVal) { + if (str == null) { + return defVal; + } else { + float val = Config.parseFloat(str, Float.MIN_VALUE); + + if (val == Float.MIN_VALUE) { + Config.warn("Invalid value: " + str); + return defVal; + } else { + return val; + } + } + } + + private float[] parseAxis(String str, float[] defVal) { + if (str == null) { + return defVal; + } else { + String[] strs = Config.tokenize(str, " "); + + if (strs.length != 3) { + Config.warn("Invalid axis: " + str); + return defVal; + } else { + float[] fs = new float[3]; + + for (int ax = 0; ax < strs.length; ++ax) { + fs[ax] = Config.parseFloat(strs[ax], Float.MIN_VALUE); + + if (fs[ax] == Float.MIN_VALUE) { + Config.warn("Invalid axis: " + str); + return defVal; + } + + if (fs[ax] < -1.0F || fs[ax] > 1.0F) { + Config.warn("Invalid axis values: " + str); + return defVal; + } + } + + float var9 = fs[0]; + float ay = fs[1]; + float az = fs[2]; + + if (var9 * var9 + ay * ay + az * az < 1.0E-5F) { + Config.warn("Invalid axis values: " + str); + return defVal; + } else { + float[] as = new float[] {az, ay, -var9}; + return as; + } + } + } + } + + public boolean isValid(String path) { + if (this.source == null) { + Config.warn("No source texture: " + path); + return false; + } else { + this.source = TextureUtils.fixResourcePath(this.source, TextureUtils.getBasePath(path)); + + if (this.startFadeIn >= 0 && this.endFadeIn >= 0 && this.endFadeOut >= 0) { + int timeFadeIn = this.normalizeTime(this.endFadeIn - this.startFadeIn); + + if (this.startFadeOut < 0) { + this.startFadeOut = this.normalizeTime(this.endFadeOut - timeFadeIn); + + if (this.timeBetween(this.startFadeOut, this.startFadeIn, this.endFadeIn)) { + this.startFadeOut = this.endFadeIn; + } + } + + int timeOn = this.normalizeTime(this.startFadeOut - this.endFadeIn); + int timeFadeOut = this.normalizeTime(this.endFadeOut - this.startFadeOut); + int timeOff = this.normalizeTime(this.startFadeIn - this.endFadeOut); + int timeSum = timeFadeIn + timeOn + timeFadeOut + timeOff; + + if (timeSum != 24000) { + Config.warn("Invalid fadeIn/fadeOut times, sum is not 24h: " + timeSum); + return false; + } else if (this.speed < 0.0F) { + Config.warn("Invalid speed: " + this.speed); + return false; + } else if (this.daysLoop <= 0) { + Config.warn("Invalid daysLoop: " + this.daysLoop); + return false; + } else { + return true; + } + } else { + Config.warn("Invalid times, required are: startFadeIn, endFadeIn and endFadeOut."); + return false; + } + } + } + + private int normalizeTime(int timeMc) { + while (timeMc >= 24000) { + timeMc -= 24000; + } + + while (timeMc < 0) { + timeMc += 24000; + } + + return timeMc; + } + + public void render(World world, int timeOfDay, float celestialAngle, float rainStrength, float thunderStrength) { + float positionBrightness = this.getPositionBrightness(world); + float weatherBrightness = this.getWeatherBrightness(rainStrength, thunderStrength); + float fadeBrightness = this.getFadeBrightness(timeOfDay); + float brightness = positionBrightness * weatherBrightness * fadeBrightness; + brightness = Config.limit(brightness, 0.0F, 1.0F); + + if (brightness >= 1.0E-4F) { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.textureId); + Blender.setupBlend(this.blend, brightness); + GL11.glPushMatrix(); + + if (this.rotate) { + float tess = 0.0F; + + if (this.speed != (float)Math.round(this.speed)) { + long worldDay = (world.getWorldTime() + 18000L) / 24000L; + double anglePerDay = (double)(this.speed % 1.0F); + double angleDayNow = (double)worldDay * anglePerDay; + tess = (float)(angleDayNow % 1.0D); + } + + GL11.glRotatef(360.0F * (tess + celestialAngle * this.speed), this.axis[0], this.axis[1], this.axis[2]); + } + + Tessellator tess1 = Tessellator.instance; + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tess1, 4); + GL11.glPushMatrix(); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + this.renderSide(tess1, 1); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + this.renderSide(tess1, 0); + GL11.glPopMatrix(); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tess1, 5); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tess1, 2); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + this.renderSide(tess1, 3); + GL11.glPopMatrix(); + } + } + + private float getPositionBrightness(World world) { + if (this.biomes == null && this.heights == null) { + return 1.0F; + } else { + float positionBrightness = this.getPositionBrightnessRaw(world); + + if (this.smoothPositionBrightness == null) { + this.smoothPositionBrightness = new SmoothFloat(positionBrightness, this.transition); + } + + positionBrightness = this.smoothPositionBrightness.getSmoothValue(positionBrightness); + return positionBrightness; + } + } + + private float getPositionBrightnessRaw(World world) { + EntityLivingBase renderViewEntity = Minecraft.getMinecraft().renderViewEntity; + + if (renderViewEntity == null) { + return 0.0F; + } else { + double posX = renderViewEntity.posX; + double posY = renderViewEntity.posY; + double posZ = renderViewEntity.posZ; + + if (this.biomes != null) { + BiomeGenBase biome = world.getBiomeGenForCoords((int)posX, (int)posZ); + + if (biome == null) { + return 0.0F; + } + + if (!Matches.biome(biome, this.biomes)) { + return 0.0F; + } + } + + return this.heights != null && !this.heights.isInRange((int)posY) ? 0.0F : 1.0F; + } + } + + private float getWeatherBrightness(float rainStrength, float thunderStrength) { + float clearBrightness = 1.0F - rainStrength; + float rainBrightness = rainStrength - thunderStrength; + float weatherBrightness = 0.0F; + + if (this.weatherClear) { + weatherBrightness += clearBrightness; + } + + if (this.weatherRain) { + weatherBrightness += rainBrightness; + } + + if (this.weatherThunder) { + weatherBrightness += thunderStrength; + } + + weatherBrightness = NumUtils.limit(weatherBrightness, 0.0F, 1.0F); + return weatherBrightness; + } + + private float getFadeBrightness(int timeOfDay) { + int timeFadeOut; + int timeDiff; + + if (this.timeBetween(timeOfDay, this.startFadeIn, this.endFadeIn)) { + timeFadeOut = this.normalizeTime(this.endFadeIn - this.startFadeIn); + timeDiff = this.normalizeTime(timeOfDay - this.startFadeIn); + return (float)timeDiff / (float)timeFadeOut; + } else if (this.timeBetween(timeOfDay, this.endFadeIn, this.startFadeOut)) { + return 1.0F; + } else if (this.timeBetween(timeOfDay, this.startFadeOut, this.endFadeOut)) { + timeFadeOut = this.normalizeTime(this.endFadeOut - this.startFadeOut); + timeDiff = this.normalizeTime(timeOfDay - this.startFadeOut); + return 1.0F - (float)timeDiff / (float)timeFadeOut; + } else { + return 0.0F; + } + } + + private void renderSide(Tessellator tess, int side) { + double tx = (double)(side % 3) / 3.0D; + double ty = (double)(side / 3) / 2.0D; + tess.startDrawingQuads(); + tess.addVertexWithUV(-70.0D, -70.0D, -70.0D, tx, ty); + tess.addVertexWithUV(-70.0D, -70.0D, 70.0D, tx, ty + 0.5D); + tess.addVertexWithUV(70.0D, -70.0D, 70.0D, tx + 0.3333333333333333D, ty + 0.5D); + tess.addVertexWithUV(70.0D, -70.0D, -70.0D, tx + 0.3333333333333333D, ty); + tess.draw(); + } + + public boolean isActive(World world, int timeOfDay) { + if (world != this.lastWorld) { + this.lastWorld = world; + this.smoothPositionBrightness = null; + } + + if (this.timeBetween(timeOfDay, this.endFadeOut, this.startFadeIn)) { + return false; + } else { + if (this.days != null) { + long time = world.getWorldTime(); + long timeShift; + + for (timeShift = time - (long)this.startFadeIn; timeShift < 0L; timeShift += (long)(24000 * this.daysLoop)) { + ; + } + + int day = (int)(timeShift / 24000L); + int dayOfLoop = day % this.daysLoop; + + if (!this.days.isInRange(dayOfLoop)) { + return false; + } + } + + return true; + } + } + + private boolean timeBetween(int timeOfDay, int timeStart, int timeEnd) { + return timeStart <= timeEnd ? timeOfDay >= timeStart && timeOfDay <= timeEnd : timeOfDay >= timeStart || timeOfDay <= timeEnd; + } + + public String toString() { + return "" + this.source + ", " + this.startFadeIn + "-" + this.endFadeIn + " " + this.startFadeOut + "-" + this.endFadeOut; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DisplayModeComparator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DisplayModeComparator.java new file mode 100644 index 0000000..85726cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DisplayModeComparator.java @@ -0,0 +1,12 @@ +package net.minecraft.src; + +import java.util.Comparator; +import org.lwjgl.opengl.DisplayMode; + +public class DisplayModeComparator implements Comparator { + public int compare(Object o1, Object o2) { + DisplayMode dm1 = (DisplayMode)o1; + DisplayMode dm2 = (DisplayMode)o2; + return dm1.getWidth() != dm2.getWidth() ? dm1.getWidth() - dm2.getWidth() : (dm1.getHeight() != dm2.getHeight() ? dm1.getHeight() - dm2.getHeight() : (dm1.getBitsPerPixel() != dm2.getBitsPerPixel() ? dm1.getBitsPerPixel() - dm2.getBitsPerPixel() : (dm1.getFrequency() != dm2.getFrequency() ? dm1.getFrequency() - dm2.getFrequency() : 0))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLight.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLight.java new file mode 100644 index 0000000..b23a5cb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLight.java @@ -0,0 +1,219 @@ +package net.minecraft.src; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; + +public class DynamicLight { + private Entity entity = null; + private double offsetY = 0.0D; + private double lastPosX = -2.147483648E9D; + private double lastPosY = -2.147483648E9D; + private double lastPosZ = -2.147483648E9D; + private int lastLightLevel = 0; + private boolean underwater = false; + private long timeCheckMs = 0L; + private Set setLitChunkPos = new HashSet(); + + public DynamicLight(Entity entity) { + this.entity = entity; + this.offsetY = (double)entity.getEyeHeight(); + } + + public void update(RenderGlobal renderGlobal) { + if (Config.isDynamicLightsFast()) { + long posX = System.currentTimeMillis(); + + if (posX < this.timeCheckMs + 500L) { + return; + } + + this.timeCheckMs = posX; + } + + double posX1 = this.entity.posX - 0.5D; + double posY = this.entity.posY - 0.5D + this.offsetY; + double posZ = this.entity.posZ - 0.5D; + int lightLevel = DynamicLights.getLightLevel(this.entity); + double dx = posX1 - this.lastPosX; + double dy = posY - this.lastPosY; + double dz = posZ - this.lastPosZ; + double delta = 0.1D; + + if (Math.abs(dx) > delta || Math.abs(dy) > delta || Math.abs(dz) > delta || this.lastLightLevel != lightLevel) { + this.lastPosX = posX1; + this.lastPosY = posY; + this.lastPosZ = posZ; + this.lastLightLevel = lightLevel; + this.underwater = false; + WorldClient world = renderGlobal.theWorld; + + if (world != null) { + Block setNewPos = world.getBlock(MathHelper.floor_double(posX1), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)); + this.underwater = setNewPos == Blocks.water; + } + + HashSet setNewPos1 = new HashSet(); + + if (lightLevel > 0) { + EnumFacing dirX = (MathHelper.floor_double(posX1) & 15) >= 8 ? EnumFacing.EAST : EnumFacing.WEST; + EnumFacing dirY = (MathHelper.floor_double(posY) & 15) >= 8 ? EnumFacing.UP : EnumFacing.DOWN; + EnumFacing dirZ = (MathHelper.floor_double(posZ) & 15) >= 8 ? EnumFacing.SOUTH : EnumFacing.NORTH; + dirX = this.getOpposite(dirX); + BlockPos pos = new BlockPos(MathHelper.floor_double(posX1), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)); + BlockPos chunkView = new BlockPos(MathHelper.bucketInt(pos.getX(), 16) * 16, MathHelper.bucketInt(pos.getY(), 16) * 16, MathHelper.bucketInt(pos.getZ(), 16) * 16); + BlockPos chunkX = getRenderChunk(chunkView, dirX); + BlockPos chunkZ = getRenderChunk(chunkView, dirZ); + BlockPos chunkXZ = getRenderChunk(chunkX, dirZ); + BlockPos chunkY = getRenderChunk(chunkView, dirY); + BlockPos chunkYX = getRenderChunk(chunkY, dirX); + BlockPos chunkYZ = getRenderChunk(chunkY, dirZ); + BlockPos chunkYXZ = getRenderChunk(chunkYX, dirZ); + this.updateChunkLight(renderGlobal, chunkView, this.setLitChunkPos, setNewPos1); + this.updateChunkLight(renderGlobal, chunkX, this.setLitChunkPos, setNewPos1); + this.updateChunkLight(renderGlobal, chunkZ, this.setLitChunkPos, setNewPos1); + this.updateChunkLight(renderGlobal, chunkXZ, this.setLitChunkPos, setNewPos1); + this.updateChunkLight(renderGlobal, chunkY, this.setLitChunkPos, setNewPos1); + this.updateChunkLight(renderGlobal, chunkYX, this.setLitChunkPos, setNewPos1); + this.updateChunkLight(renderGlobal, chunkYZ, this.setLitChunkPos, setNewPos1); + this.updateChunkLight(renderGlobal, chunkYXZ, this.setLitChunkPos, setNewPos1); + } + + this.updateLitChunks(renderGlobal); + this.setLitChunkPos = setNewPos1; + } + } + + private EnumFacing getOpposite(EnumFacing facing) { + switch (DynamicLight.NamelessClass1740550997.$SwitchMap$net$minecraft$util$EnumFacing[facing.ordinal()]) { + case 1: + return EnumFacing.UP; + + case 2: + return EnumFacing.DOWN; + + case 3: + return EnumFacing.SOUTH; + + case 4: + return EnumFacing.NORTH; + + case 5: + return EnumFacing.WEST; + + case 6: + return EnumFacing.EAST; + + default: + return EnumFacing.DOWN; + } + } + + private static BlockPos getRenderChunk(BlockPos pos, EnumFacing facing) { + return new BlockPos(pos.getX() + facing.getFrontOffsetX() * 16, pos.getY() + facing.getFrontOffsetY() * 16, pos.getZ() + facing.getFrontOffsetZ() * 16); + } + + private void updateChunkLight(RenderGlobal renderGlobal, BlockPos pos, Set setPrevPos, Set setNewPos) { + if (pos != null) { + renderGlobal.markBlockForUpdate(pos.getX() + 8, pos.getY() + 8, pos.getZ() + 8); + + if (setPrevPos != null) { + setPrevPos.remove(pos); + } + + if (setNewPos != null) { + setNewPos.add(pos); + } + } + } + + public void updateLitChunks(RenderGlobal renderGlobal) { + Iterator it = this.setLitChunkPos.iterator(); + + while (it.hasNext()) { + BlockPos posOld = (BlockPos)it.next(); + this.updateChunkLight(renderGlobal, posOld, (Set)null, (Set)null); + } + } + + public Entity getEntity() { + return this.entity; + } + + public double getLastPosX() { + return this.lastPosX; + } + + public double getLastPosY() { + return this.lastPosY; + } + + public double getLastPosZ() { + return this.lastPosZ; + } + + public int getLastLightLevel() { + return this.lastLightLevel; + } + + public boolean isUnderwater() { + return this.underwater; + } + + public double getOffsetY() { + return this.offsetY; + } + + public String toString() { + return "Entity: " + this.entity + ", offsetY: " + this.offsetY; + } + + static class NamelessClass1740550997 { + static final int[] $SwitchMap$net$minecraft$util$EnumFacing = new int[EnumFacing.values().length]; + + static { + try { + $SwitchMap$net$minecraft$util$EnumFacing[EnumFacing.DOWN.ordinal()] = 1; + } catch (NoSuchFieldError var6) { + ; + } + + try { + $SwitchMap$net$minecraft$util$EnumFacing[EnumFacing.UP.ordinal()] = 2; + } catch (NoSuchFieldError var5) { + ; + } + + try { + $SwitchMap$net$minecraft$util$EnumFacing[EnumFacing.NORTH.ordinal()] = 3; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$net$minecraft$util$EnumFacing[EnumFacing.SOUTH.ordinal()] = 4; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$net$minecraft$util$EnumFacing[EnumFacing.EAST.ordinal()] = 5; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$net$minecraft$util$EnumFacing[EnumFacing.WEST.ordinal()] = 6; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLights.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLights.java new file mode 100644 index 0000000..ac1de46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLights.java @@ -0,0 +1,270 @@ +package net.minecraft.src; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class DynamicLights { + private static DynamicLightsMap mapDynamicLights = new DynamicLightsMap(); + private static long timeUpdateMs = 0L; + private static final double MAX_DIST = 7.5D; + private static final double MAX_DIST_SQ = 56.25D; + private static final int LIGHT_LEVEL_MAX = 15; + private static final int LIGHT_LEVEL_FIRE = 15; + private static final int LIGHT_LEVEL_BLAZE = 10; + private static final int LIGHT_LEVEL_MAGMA_CUBE = 8; + private static final int LIGHT_LEVEL_MAGMA_CUBE_CORE = 13; + private static final int LIGHT_LEVEL_GLOWSTONE_DUST = 8; + private static final int LIGHT_LEVEL_PRISMARINE_CRYSTALS = 8; + private static ReflectorField ItemBlock_block = Reflector.getReflectorField(ItemBlock.class, Block.class); + + public static void entityAdded(Entity entityIn, RenderGlobal renderGlobal) {} + + public static void entityRemoved(Entity entityIn, RenderGlobal renderGlobal) { + DynamicLightsMap var2 = mapDynamicLights; + + synchronized (mapDynamicLights) { + DynamicLight dynamicLight = mapDynamicLights.remove(entityIn.getEntityId()); + + if (dynamicLight != null) { + dynamicLight.updateLitChunks(renderGlobal); + } + } + } + + public static void update(RenderGlobal renderGlobal) { + long timeNowMs = System.currentTimeMillis(); + + if (timeNowMs >= timeUpdateMs + 50L) { + timeUpdateMs = timeNowMs; + DynamicLightsMap var3 = mapDynamicLights; + + synchronized (mapDynamicLights) { + updateMapDynamicLights(renderGlobal); + + if (mapDynamicLights.size() > 0) { + List dynamicLights = mapDynamicLights.valueList(); + + for (int i = 0; i < dynamicLights.size(); ++i) { + DynamicLight dynamicLight = (DynamicLight)dynamicLights.get(i); + dynamicLight.update(renderGlobal); + } + } + } + } + } + + private static void updateMapDynamicLights(RenderGlobal renderGlobal) { + WorldClient world = renderGlobal.theWorld; + + if (world != null) { + List entities = world.getLoadedEntityList(); + Iterator it = entities.iterator(); + + while (it.hasNext()) { + Entity entity = (Entity)it.next(); + int lightLevel = getLightLevel(entity); + int key; + DynamicLight dynamicLight; + + if (lightLevel > 0) { + key = entity.getEntityId(); + dynamicLight = mapDynamicLights.get(key); + + if (dynamicLight == null) { + dynamicLight = new DynamicLight(entity); + mapDynamicLights.put(key, dynamicLight); + } + } else { + key = entity.getEntityId(); + dynamicLight = mapDynamicLights.remove(key); + + if (dynamicLight != null) { + dynamicLight.updateLitChunks(renderGlobal); + } + } + } + } + } + + public static int getCombinedLight(int x, int y, int z, int combinedLight) { + double lightPlayer = getLightLevel(x, y, z); + combinedLight = getCombinedLight(lightPlayer, combinedLight); + return combinedLight; + } + + public static int getCombinedLight(Entity entity, int combinedLight) { + double lightPlayer = (double)getLightLevel(entity); + combinedLight = getCombinedLight(lightPlayer, combinedLight); + return combinedLight; + } + + public static int getCombinedLight(double lightPlayer, int combinedLight) { + if (lightPlayer > 0.0D) { + int lightPlayerFF = (int)(lightPlayer * 16.0D); + int lightBlockFF = combinedLight & 255; + + if (lightPlayerFF > lightBlockFF) { + combinedLight &= -256; + combinedLight |= lightPlayerFF; + } + } + + return combinedLight; + } + + public static double getLightLevel(int x, int y, int z) { + double lightLevelMax = 0.0D; + DynamicLightsMap lightPlayer = mapDynamicLights; + + synchronized (mapDynamicLights) { + List dynamicLights = mapDynamicLights.valueList(); + + for (int i = 0; i < dynamicLights.size(); ++i) { + DynamicLight dynamicLight = (DynamicLight)dynamicLights.get(i); + int dynamicLightLevel = dynamicLight.getLastLightLevel(); + + if (dynamicLightLevel > 0) { + double px = dynamicLight.getLastPosX(); + double py = dynamicLight.getLastPosY(); + double pz = dynamicLight.getLastPosZ(); + double dx = (double)x - px; + double dy = (double)y - py; + double dz = (double)z - pz; + double distSq = dx * dx + dy * dy + dz * dz; + + if (dynamicLight.isUnderwater() && !Config.isClearWater()) { + dynamicLightLevel = Config.limit(dynamicLightLevel - 2, 0, 15); + distSq *= 2.0D; + } + + if (distSq <= 56.25D) { + double dist = Math.sqrt(distSq); + double light = 1.0D - dist / 7.5D; + double lightLevel = light * (double)dynamicLightLevel; + + if (lightLevel > lightLevelMax) { + lightLevelMax = lightLevel; + } + } + } + } + } + + double var32 = Config.limit(lightLevelMax, 0.0D, 15.0D); + return var32; + } + + public static int getLightLevel(ItemStack itemStack) { + if (itemStack == null) { + return 0; + } else { + Item item = itemStack.getItem(); + + if (item instanceof ItemBlock) { + ItemBlock itemBlock = (ItemBlock)item; + Block block = (Block)Reflector.getFieldValue(itemBlock, ItemBlock_block); + + if (block != null) { + return block.getLightValue(); + } + } + + return item == Items.lava_bucket ? Blocks.lava.getLightValue() : (item != Items.blaze_rod && item != Items.blaze_powder ? (item == Items.glowstone_dust ? 8 : (item == Items.magma_cream ? 8 : (item == Items.nether_star ? Blocks.beacon.getLightValue() / 2 : 0))) : 10); + } + } + + public static int getLightLevel(Entity entity) { + if (entity == Config.getMinecraft().renderViewEntity && !Config.isDynamicHandLight()) { + return 0; + } else if (entity.isBurning()) { + return 15; + } else if (entity instanceof EntityFireball) { + return 15; + } else if (entity instanceof EntityTNTPrimed) { + return 15; + } else if (entity instanceof EntityBlaze) { + EntityBlaze entityItem4 = (EntityBlaze)entity; + return entityItem4.func_70845_n() ? 15 : 10; + } else if (entity instanceof EntityMagmaCube) { + EntityMagmaCube entityItem3 = (EntityMagmaCube)entity; + return (double)entityItem3.squishFactor > 0.6D ? 13 : 8; + } else { + if (entity instanceof EntityCreeper) { + EntityCreeper entityItem = (EntityCreeper)entity; + + if (entityItem.getCreeperState() > 0) { + return 15; + } + } + + ItemStack itemStack; + + if (entity instanceof EntityLivingBase) { + EntityLivingBase entityItem2 = (EntityLivingBase)entity; + itemStack = entityItem2.getHeldItem(); + int levelMain = getLightLevel(itemStack); + ItemStack stackHead = entityItem2.getEquipmentInSlot(4); + int levelHead = getLightLevel(stackHead); + return Math.max(levelMain, levelHead); + } else if (entity instanceof EntityItem) { + EntityItem entityItem1 = (EntityItem)entity; + itemStack = getItemStack(entityItem1); + return getLightLevel(itemStack); + } else { + return 0; + } + } + } + + public static void removeLights(RenderGlobal renderGlobal) { + DynamicLightsMap var1 = mapDynamicLights; + + synchronized (mapDynamicLights) { + List dynamicLights = mapDynamicLights.valueList(); + + for (int i = 0; i < dynamicLights.size(); ++i) { + DynamicLight dynamicLight = (DynamicLight)dynamicLights.get(i); + dynamicLight.updateLitChunks(renderGlobal); + } + + dynamicLights.clear(); + } + } + + public static void clear() { + DynamicLightsMap var0 = mapDynamicLights; + + synchronized (mapDynamicLights) { + mapDynamicLights.clear(); + } + } + + public static int getCount() { + DynamicLightsMap var0 = mapDynamicLights; + + synchronized (mapDynamicLights) { + return mapDynamicLights.size(); + } + } + + public static ItemStack getItemStack(EntityItem entityItem) { + ItemStack itemstack = entityItem.getDataWatcher().getWatchableObjectItemStack(10); + return itemstack; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLightsMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLightsMap.java new file mode 100644 index 0000000..ab7e993 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/DynamicLightsMap.java @@ -0,0 +1,55 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DynamicLightsMap { + private Map map = new HashMap(); + private List list = new ArrayList(); + private boolean dirty = false; + + public DynamicLight put(int id, DynamicLight dynamicLight) { + DynamicLight old = (DynamicLight)this.map.put(Integer.valueOf(id), dynamicLight); + this.setDirty(); + return old; + } + + public DynamicLight get(int id) { + return (DynamicLight)this.map.get(Integer.valueOf(id)); + } + + public int size() { + return this.map.size(); + } + + public DynamicLight remove(int id) { + DynamicLight old = (DynamicLight)this.map.remove(Integer.valueOf(id)); + + if (old != null) { + this.setDirty(); + } + + return old; + } + + public void clear() { + this.map.clear(); + this.setDirty(); + } + + private void setDirty() { + this.dirty = true; + } + + public List valueList() { + if (this.dirty) { + this.list.clear(); + this.list.addAll(this.map.values()); + this.dirty = false; + } + + return this.list; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/EntitySorterFast.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/EntitySorterFast.java new file mode 100644 index 0000000..f8e799c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/EntitySorterFast.java @@ -0,0 +1,30 @@ +package net.minecraft.src; + +import java.util.Comparator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.Entity; + +public class EntitySorterFast implements Comparator { + private Entity entity; + + public EntitySorterFast(Entity par1Entity) { + this.entity = par1Entity; + } + + public void prepareToSort(WorldRenderer[] renderers, int countWorldRenderers) { + for (int i = 0; i < countWorldRenderers; ++i) { + WorldRenderer wr = renderers[i]; + wr.updateDistanceToEntitySquared(this.entity); + } + } + + public int compare(WorldRenderer par1WorldRenderer, WorldRenderer par2WorldRenderer) { + float dist1 = par1WorldRenderer.sortDistanceToEntitySquared; + float dist2 = par2WorldRenderer.sortDistanceToEntitySquared; + return dist1 == dist2 ? 0 : (dist1 > dist2 ? 1 : -1); + } + + public int compare(Object par1Obj, Object par2Obj) { + return this.compare((WorldRenderer)par1Obj, (WorldRenderer)par2Obj); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/EntityUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/EntityUtils.java new file mode 100644 index 0000000..109ffce --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/EntityUtils.java @@ -0,0 +1,63 @@ +package net.minecraft.src; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; + +public class EntityUtils { + private static ReflectorClass ForgeEntityLivingBase = new ReflectorClass(EntityLivingBase.class); + private static ReflectorField ForgeEntityLivingBase_entityAge = new ReflectorField(ForgeEntityLivingBase, "entityAge"); + private static boolean directEntityAge = true; + private static ReflectorClass ForgeEntityLiving = new ReflectorClass(EntityLiving.class); + private static ReflectorMethod ForgeEntityLiving_despawnEntity = new ReflectorMethod(ForgeEntityLiving, "despawnEntity"); + private static boolean directDespawnEntity = true; + + public static int getEntityAge(EntityLivingBase elb) { + if (directEntityAge) { + try { + return elb.entityAge; + } catch (IllegalAccessError var2) { + directEntityAge = false; + + if (!ForgeEntityLivingBase_entityAge.exists()) { + throw var2; + } + } + } + + return ((Integer)Reflector.getFieldValue(elb, ForgeEntityLivingBase_entityAge)).intValue(); + } + + public static void setEntityAge(EntityLivingBase elb, int age) { + if (directEntityAge) { + try { + elb.entityAge = age; + return; + } catch (IllegalAccessError var3) { + directEntityAge = false; + + if (!ForgeEntityLivingBase_entityAge.exists()) { + throw var3; + } + } + } + + Reflector.setFieldValue(elb, ForgeEntityLivingBase_entityAge, Integer.valueOf(age)); + } + + public static void despawnEntity(EntityLiving el) { + if (directDespawnEntity) { + try { + el.despawnEntity(); + return; + } catch (IllegalAccessError var2) { + directDespawnEntity = false; + + if (!ForgeEntityLiving_despawnEntity.exists()) { + throw var2; + } + } + } + + Reflector.callVoid(el, ForgeEntityLiving_despawnEntity, new Object[0]); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorFixed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorFixed.java new file mode 100644 index 0000000..45458c0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorFixed.java @@ -0,0 +1,15 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; + +public class FieldLocatorFixed implements IFieldLocator { + private Field field; + + public FieldLocatorFixed(Field field) { + this.field = field; + } + + public Field getField() { + return this.field; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorName.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorName.java new file mode 100644 index 0000000..25c33ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorName.java @@ -0,0 +1,54 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; + +public class FieldLocatorName implements IFieldLocator { + private ReflectorClass reflectorClass = null; + private String targetFieldName = null; + + public FieldLocatorName(ReflectorClass reflectorClass, String targetFieldName) { + this.reflectorClass = reflectorClass; + this.targetFieldName = targetFieldName; + } + + public Field getField() { + Class cls = this.reflectorClass.getTargetClass(); + + if (cls == null) { + return null; + } else { + try { + Field e = this.getDeclaredField(cls, this.targetFieldName); + e.setAccessible(true); + return e; + } catch (NoSuchFieldException var3) { + Config.log("(Reflector) Field not present: " + cls.getName() + "." + this.targetFieldName); + return null; + } catch (SecurityException var4) { + var4.printStackTrace(); + return null; + } catch (Throwable var5) { + var5.printStackTrace(); + return null; + } + } + } + + private Field getDeclaredField(Class cls, String name) throws NoSuchFieldException { + Field[] fields = cls.getDeclaredFields(); + + for (int i = 0; i < fields.length; ++i) { + Field field = fields[i]; + + if (field.getName().equals(name)) { + return field; + } + } + + if (cls == Object.class) { + throw new NoSuchFieldException(name); + } else { + return this.getDeclaredField(cls.getSuperclass(), name); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorType.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorType.java new file mode 100644 index 0000000..d05b510 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorType.java @@ -0,0 +1,56 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; + +public class FieldLocatorType implements IFieldLocator { + private ReflectorClass reflectorClass; + private Class targetFieldType; + private int targetFieldIndex; + + public FieldLocatorType(ReflectorClass reflectorClass, Class targetFieldType) { + this(reflectorClass, targetFieldType, 0); + } + + public FieldLocatorType(ReflectorClass reflectorClass, Class targetFieldType, int targetFieldIndex) { + this.reflectorClass = null; + this.targetFieldType = null; + this.reflectorClass = reflectorClass; + this.targetFieldType = targetFieldType; + this.targetFieldIndex = targetFieldIndex; + } + + public Field getField() { + Class cls = this.reflectorClass.getTargetClass(); + + if (cls == null) { + return null; + } else { + try { + Field[] e = cls.getDeclaredFields(); + int fieldIndex = 0; + + for (int i = 0; i < e.length; ++i) { + Field field = e[i]; + + if (field.getType() == this.targetFieldType) { + if (fieldIndex == this.targetFieldIndex) { + field.setAccessible(true); + return field; + } + + ++fieldIndex; + } + } + + Config.log("(Reflector) Field not present: " + cls.getName() + ".(type: " + this.targetFieldType + ", index: " + this.targetFieldIndex + ")"); + return null; + } catch (SecurityException var6) { + var6.printStackTrace(); + return null; + } catch (Throwable var7) { + var7.printStackTrace(); + return null; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorTypes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorTypes.java new file mode 100644 index 0000000..abb79d4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FieldLocatorTypes.java @@ -0,0 +1,43 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; + +public class FieldLocatorTypes implements IFieldLocator { + private Field field = null; + + public FieldLocatorTypes(Class cls, Class[] preTypes, Class type, Class[] postTypes, String errorName) { + Field[] fs = cls.getDeclaredFields(); + ArrayList types = new ArrayList(); + + for (int typesMatch = 0; typesMatch < fs.length; ++typesMatch) { + Field index = fs[typesMatch]; + types.add(index.getType()); + } + + ArrayList var12 = new ArrayList(); + var12.addAll(Arrays.asList(preTypes)); + var12.add(type); + var12.addAll(Arrays.asList(postTypes)); + int var13 = Collections.indexOfSubList(types, var12); + + if (var13 < 0) { + Config.warn("Field not found: " + errorName); + } else { + int index2 = Collections.indexOfSubList(types.subList(var13 + 1, types.size()), var12); + + if (index2 >= 0) { + Config.warn("More than one match found for field: " + errorName); + } else { + int indexField = var13 + preTypes.length; + this.field = fs[indexField]; + } + } + } + + public Field getField() { + return this.field; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FileDownloadThread.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FileDownloadThread.java new file mode 100644 index 0000000..59318fa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FileDownloadThread.java @@ -0,0 +1,30 @@ +package net.minecraft.src; + +import net.minecraft.client.Minecraft; + +public class FileDownloadThread extends Thread { + private String urlString = null; + private IFileDownloadListener listener = null; + + public FileDownloadThread(String urlString, IFileDownloadListener listener) { + this.urlString = urlString; + this.listener = listener; + } + + public void run() { + try { + byte[] e = HttpPipeline.get(this.urlString, Minecraft.getMinecraft().getProxy()); + this.listener.fileDownloadFinished(this.urlString, e, (Throwable)null); + } catch (Exception var2) { + this.listener.fileDownloadFinished(this.urlString, (byte[])null, var2); + } + } + + public String getUrlString() { + return this.urlString; + } + + public IFileDownloadListener getListener() { + return this.listener; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FileUploadThread.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FileUploadThread.java new file mode 100644 index 0000000..b9ff078 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FileUploadThread.java @@ -0,0 +1,38 @@ +package net.minecraft.src; + +import java.util.Map; + +public class FileUploadThread extends Thread { + private String urlString; + private Map headers; + private byte[] content; + private IFileUploadListener listener; + + public FileUploadThread(String urlString, Map headers, byte[] content, IFileUploadListener listener) { + this.urlString = urlString; + this.headers = headers; + this.content = content; + this.listener = listener; + } + + public void run() { + try { + HttpUtils.post(this.urlString, this.headers, this.content); + this.listener.fileUploadFinished(this.urlString, this.content, (Throwable)null); + } catch (Exception var2) { + this.listener.fileUploadFinished(this.urlString, this.content, var2); + } + } + + public String getUrlString() { + return this.urlString; + } + + public byte[] getContent() { + return this.content; + } + + public IFileUploadListener getListener() { + return this.listener; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FontUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FontUtils.java new file mode 100644 index 0000000..7332753 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/FontUtils.java @@ -0,0 +1,126 @@ +package net.minecraft.src; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.Properties; +import java.util.Set; +import net.minecraft.util.ResourceLocation; + +public class FontUtils { + public static Properties readFontProperties(ResourceLocation locationFontTexture) { + String fontFileName = locationFontTexture.getResourcePath(); + Properties props = new Properties(); + String suffix = ".png"; + + if (!fontFileName.endsWith(suffix)) { + return props; + } else { + String fileName = fontFileName.substring(0, fontFileName.length() - suffix.length()) + ".properties"; + + try { + ResourceLocation e = new ResourceLocation(locationFontTexture.getResourceDomain(), fileName); + InputStream in = Config.getResourceStream(Config.getResourceManager(), e); + + if (in == null) { + return props; + } + + Config.log("Loading " + fileName); + props.load(in); + } catch (FileNotFoundException var7) { + ; + } catch (IOException var8) { + var8.printStackTrace(); + } + + return props; + } + } + + public static void readCustomCharWidths(Properties props, float[] charWidth) { + Set keySet = props.keySet(); + Iterator iter = keySet.iterator(); + + while (iter.hasNext()) { + String key = (String)iter.next(); + String prefix = "width."; + + if (key.startsWith(prefix)) { + String numStr = key.substring(prefix.length()); + int num = Config.parseInt(numStr, -1); + + if (num >= 0 && num < charWidth.length) { + String value = props.getProperty(key); + float width = Config.parseFloat(value, -1.0F); + + if (width >= 0.0F) { + charWidth[num] = width; + } + } + } + } + } + + public static float readFloat(Properties props, String key, float defOffset) { + String str = props.getProperty(key); + + if (str == null) { + return defOffset; + } else { + float offset = Config.parseFloat(str, Float.MIN_VALUE); + + if (offset == Float.MIN_VALUE) { + Config.warn("Invalid value for " + key + ": " + str); + return defOffset; + } else { + return offset; + } + } + } + + public static boolean readBoolean(Properties props, String key, boolean defVal) { + String str = props.getProperty(key); + + if (str == null) { + return defVal; + } else { + String strLow = str.toLowerCase().trim(); + + if (!strLow.equals("true") && !strLow.equals("on")) { + if (!strLow.equals("false") && !strLow.equals("off")) { + Config.warn("Invalid value for " + key + ": " + str); + return defVal; + } else { + return false; + } + } else { + return true; + } + } + } + + public static ResourceLocation getHdFontLocation(ResourceLocation fontLoc) { + if (!Config.isCustomFonts()) { + return fontLoc; + } else if (fontLoc == null) { + return fontLoc; + } else if (!Config.isMinecraftThread()) { + return fontLoc; + } else { + String fontName = fontLoc.getResourcePath(); + String texturesStr = "textures/"; + String mcpatcherStr = "mcpatcher/"; + + if (!fontName.startsWith(texturesStr)) { + return fontLoc; + } else { + fontName = fontName.substring(texturesStr.length()); + fontName = mcpatcherStr + fontName; + ResourceLocation fontLocHD = new ResourceLocation(fontLoc.getResourceDomain(), fontName); + return Config.hasResource(Config.getResourceManager(), fontLocHD) ? fontLocHD : fontLoc; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GlStateManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GlStateManager.java new file mode 100644 index 0000000..5020c79 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GlStateManager.java @@ -0,0 +1,170 @@ +package net.minecraft.src; + +import java.nio.IntBuffer; +import net.minecraft.client.renderer.OpenGlHelper; +import org.lwjgl.opengl.GL11; + +public class GlStateManager { + public static int activeTextureUnit = 0; + public static int GL_FRAMEBUFFER = OpenGlHelper.field_153198_e; + public static int GL_RENDERBUFFER = OpenGlHelper.field_153199_f; + public static int GL_COLOR_ATTACHMENT0 = OpenGlHelper.field_153200_g; + public static int GL_DEPTH_ATTACHMENT = OpenGlHelper.field_153201_h; + + public static int getActiveTextureUnit() { + return activeTextureUnit; + } + + public static void bindTexture(int tex) { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex); + } + + public static void deleteTexture(int tex) { + if (tex != 0) { + GL11.glDeleteTextures(tex); + } + } + + public static void deleteTextures(IntBuffer buf) { + buf.rewind(); + + while (buf.position() < buf.limit()) { + int texId = buf.get(); + deleteTexture(texId); + } + + buf.rewind(); + } + + public static void setActiveTexture(int tex) { + OpenGlHelper.setActiveTexture(tex); + } + + public static void colorMask(boolean red, boolean green, boolean blue, boolean alpha) { + GL11.glColorMask(red, green, blue, alpha); + } + + public static void enableCull() { + GL11.glEnable(GL11.GL_CULL_FACE); + } + + public static void disableCull() { + GL11.glDisable(GL11.GL_CULL_FACE); + } + + public static void enableDepth() { + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + + public static void disableDepth() { + GL11.glDisable(GL11.GL_DEPTH_TEST); + } + + public static void enableTexture2D() { + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + public static void disableTexture2D() { + GL11.glDisable(GL11.GL_TEXTURE_2D); + } + + public static void enableAlpha() { + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + public static void disableAlpha() { + GL11.glDisable(GL11.GL_ALPHA_TEST); + } + + public static void enableBlend() { + GL11.glEnable(GL11.GL_BLEND); + } + + public static void disableBlend() { + GL11.glDisable(GL11.GL_BLEND); + } + + public static void depthFunc(int func) { + GL11.glDepthFunc(func); + } + + public static void depthMask(boolean mask) { + GL11.glDepthMask(mask); + } + + public static void enableLighting() { + GL11.glEnable(GL11.GL_LIGHTING); + } + + public static void disableLighting() { + GL11.glDisable(GL11.GL_LIGHTING); + } + + public static void color(float p_179131_0_, float p_179131_1_, float p_179131_2_, float p_179131_3_) { + GL11.glColor4f(p_179131_0_, p_179131_1_, p_179131_2_, p_179131_3_); + } + + public static void color(float p_179124_0_, float p_179124_1_, float p_179124_2_) { + color(p_179124_0_, p_179124_1_, p_179124_2_, 1.0F); + } + + public static void clearColor(float red, float green, float blue, float alpha) { + GL11.glClearColor(red, green, blue, alpha); + } + + public static void alphaFunc(int func, float ref) { + GL11.glAlphaFunc(func, ref); + } + + public static void blendFunc(int sfactor, int dfactor) { + GL11.glBlendFunc(sfactor, dfactor); + } + + public static void setFog(int p_179093_0_) { + GL11.glFogi(GL11.GL_FOG_MODE, p_179093_0_); + } + + public static void setFogDensity(float p_179095_0_) { + GL11.glFogf(GL11.GL_FOG_DENSITY, p_179095_0_); + } + + public static void setFogStart(float p_179102_0_) { + GL11.glFogf(GL11.GL_FOG_START, p_179102_0_); + } + + public static void setFogEnd(float p_179153_0_) { + GL11.glFogf(GL11.GL_FOG_END, p_179153_0_); + } + + public static void shadeModel(int p_179103_0_) { + GL11.glShadeModel(p_179103_0_); + } + + public static void clear(int p_179086_0_) { + GL11.glClear(p_179086_0_); + } + + public static void matrixMode(int p_179128_0_) { + GL11.glMatrixMode(p_179128_0_); + } + + public static void loadIdentity() { + GL11.glLoadIdentity(); + } + + public static void pushMatrix() { + GL11.glPushMatrix(); + } + + public static void popMatrix() { + GL11.glPopMatrix(); + } + + public static void tryBlendFuncSeparate(int p_179120_0_, int p_179120_1_, int p_179120_2_, int p_179120_3_) { + OpenGlHelper.glBlendFunc(p_179120_0_, p_179120_1_, p_179120_2_, p_179120_3_); + } + + public static void rotate(float p_179114_0_, float p_179114_1_, float p_179114_2_, float p_179114_3_) { + GL11.glRotatef(p_179114_0_, p_179114_1_, p_179114_2_, p_179114_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GlVersion.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GlVersion.java new file mode 100644 index 0000000..5a667ff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GlVersion.java @@ -0,0 +1,43 @@ +package net.minecraft.src; + +public class GlVersion { + private int major; + private int minor; + private int release; + private String suffix; + + public GlVersion(int major, int minor) { + this(major, minor, 0); + } + + public GlVersion(int major, int minor, int release) { + this(major, minor, release, (String)null); + } + + public GlVersion(int major, int minor, int release, String suffix) { + this.major = major; + this.minor = minor; + this.release = release; + this.suffix = suffix; + } + + public int getMajor() { + return this.major; + } + + public int getMinor() { + return this.minor; + } + + public int getRelease() { + return this.release; + } + + public int toInt() { + return this.minor > 9 ? this.major * 100 + this.minor : (this.release > 9 ? this.major * 100 + this.minor * 10 + 9 : this.major * 100 + this.minor * 10 + this.release); + } + + public String toString() { + return this.suffix == null ? "" + this.major + "." + this.minor + "." + this.release : "" + this.major + "." + this.minor + "." + this.release + this.suffix; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiAnimationSettingsOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiAnimationSettingsOF.java new file mode 100644 index 0000000..fa30266 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiAnimationSettingsOF.java @@ -0,0 +1,78 @@ +package net.minecraft.src; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiAnimationSettingsOF extends GuiScreen { + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.ANIMATED_WATER, GameSettings.Options.ANIMATED_LAVA, GameSettings.Options.ANIMATED_FIRE, GameSettings.Options.ANIMATED_PORTAL, GameSettings.Options.ANIMATED_REDSTONE, GameSettings.Options.ANIMATED_EXPLOSION, GameSettings.Options.ANIMATED_FLAME, GameSettings.Options.ANIMATED_SMOKE, GameSettings.Options.VOID_PARTICLES, GameSettings.Options.WATER_PARTICLES, GameSettings.Options.RAIN_SPLASH, GameSettings.Options.PORTAL_PARTICLES, GameSettings.Options.POTION_PARTICLES, GameSettings.Options.DRIPPING_WATER_LAVA, GameSettings.Options.ANIMATED_TERRAIN, GameSettings.Options.ANIMATED_ITEMS, GameSettings.Options.ANIMATED_TEXTURES, GameSettings.Options.PARTICLES}; + + public GuiAnimationSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.title = I18n.format("of.options.animationsTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) { + GameSettings.Options opt = enumOptions[i]; + int x = this.width / 2 - 155 + i % 2 * 160; + int y = this.height / 6 + 21 * (i / 2) - 12; + + if (!opt.getEnumFloat()) { + this.buttonList.add(new GuiOptionButtonOF(opt.returnEnumOrdinal(), x, y, opt, this.settings.getKeyBinding(opt))); + } else { + this.buttonList.add(new GuiOptionSliderOF(opt.returnEnumOrdinal(), x, y, opt)); + } + } + + this.buttonList.add(new GuiButton(210, this.width / 2 - 155, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOn"))); + this.buttonList.add(new GuiButton(211, this.width / 2 - 155 + 80, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOff"))); + this.buttonList.add(new GuiOptionButton(200, this.width / 2 + 5, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.enabled) { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) { + this.settings.setOptionValue(((GuiOptionButton)guibutton).func_146136_c(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + + if (guibutton.id == 210) { + this.mc.gameSettings.setAllAnimations(true); + } + + if (guibutton.id == 211) { + this.mc.gameSettings.setAllAnimations(false); + } + + ScaledResolution sr = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + this.setWorldAndResolution(this.mc, sr.getScaledWidth(), sr.getScaledHeight()); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int x, int y, float f) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiDetailSettingsOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiDetailSettingsOF.java new file mode 100644 index 0000000..f4b651b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiDetailSettingsOF.java @@ -0,0 +1,66 @@ +package net.minecraft.src; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiDetailSettingsOF extends GuiScreen { + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.CLOUDS, GameSettings.Options.CLOUD_HEIGHT, GameSettings.Options.TREES, GameSettings.Options.GRASS, GameSettings.Options.WATER, GameSettings.Options.RAIN, GameSettings.Options.SKY, GameSettings.Options.STARS, GameSettings.Options.SUN_MOON, GameSettings.Options.SHOW_CAPES, GameSettings.Options.FOG_FANCY, GameSettings.Options.FOG_START, GameSettings.Options.DEPTH_FOG, GameSettings.Options.HELD_ITEM_TOOLTIPS, GameSettings.Options.TRANSLUCENT_BLOCKS, GameSettings.Options.DROPPED_ITEMS, GameSettings.Options.VIGNETTE}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiDetailSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.title = I18n.format("of.options.detailsTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) { + GameSettings.Options opt = enumOptions[i]; + int x = this.width / 2 - 155 + i % 2 * 160; + int y = this.height / 6 + 21 * (i / 2) - 12; + + if (!opt.getEnumFloat()) { + this.buttonList.add(new GuiOptionButtonOF(opt.returnEnumOrdinal(), x, y, opt, this.settings.getKeyBinding(opt))); + } else { + this.buttonList.add(new GuiOptionSliderOF(opt.returnEnumOrdinal(), x, y, opt)); + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.enabled) { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) { + this.settings.setOptionValue(((GuiOptionButton)guibutton).func_146136_c(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int x, int y, float f) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiMessage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiMessage.java new file mode 100644 index 0000000..f4ba006 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiMessage.java @@ -0,0 +1,77 @@ +package net.minecraft.src; + +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +public class GuiMessage extends GuiScreen { + private GuiScreen parentScreen; + private String messageLine1; + private String messageLine2; + private final List listLines2 = Lists.newArrayList(); + protected String confirmButtonText; + private int ticksUntilEnable; + + public GuiMessage(GuiScreen parentScreen, String line1, String line2) { + this.parentScreen = parentScreen; + this.messageLine1 = line1; + this.messageLine2 = line2; + this.confirmButtonText = I18n.format("gui.done", new Object[0]); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 74, this.height / 6 + 96, this.confirmButtonText)); + this.listLines2.clear(); + this.listLines2.addAll(this.fontRendererObj.listFormattedStringToWidth(this.messageLine2, this.width - 50)); + } + + protected void actionPerformed(GuiButton button) { + Config.getMinecraft().displayGuiScreen(this.parentScreen); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.messageLine1, this.width / 2, 70, 16777215); + int var4 = 90; + + for (Iterator var5 = this.listLines2.iterator(); var5.hasNext(); var4 += this.fontRendererObj.FONT_HEIGHT) { + String var6 = (String)var5.next(); + this.drawCenteredString(this.fontRendererObj, var6, this.width / 2, var4, 16777215); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void setButtonDelay(int ticksUntilEnable) { + this.ticksUntilEnable = ticksUntilEnable; + GuiButton var3; + + for (Iterator var2 = this.buttonList.iterator(); var2.hasNext(); var3.enabled = false) { + var3 = (GuiButton)var2.next(); + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + GuiButton var2; + + if (--this.ticksUntilEnable == 0) { + for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) { + var2 = (GuiButton)var1.next(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOptionButtonOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOptionButtonOF.java new file mode 100644 index 0000000..83a3727 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOptionButtonOF.java @@ -0,0 +1,17 @@ +package net.minecraft.src; + +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionButtonOF extends GuiOptionButton implements IOptionControl { + private GameSettings.Options option = null; + + public GuiOptionButtonOF(int id, int x, int y, GameSettings.Options option, String text) { + super(id, x, y, option, text); + this.option = option; + } + + public GameSettings.Options getOption() { + return this.option; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOptionSliderOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOptionSliderOF.java new file mode 100644 index 0000000..80c8ecd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOptionSliderOF.java @@ -0,0 +1,17 @@ +package net.minecraft.src; + +import net.minecraft.client.gui.GuiOptionSlider; +import net.minecraft.client.settings.GameSettings; + +public class GuiOptionSliderOF extends GuiOptionSlider implements IOptionControl { + private GameSettings.Options option = null; + + public GuiOptionSliderOF(int id, int x, int y, GameSettings.Options option) { + super(id, x, y, option); + this.option = option; + } + + public GameSettings.Options getOption() { + return this.option; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOtherSettingsOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOtherSettingsOF.java new file mode 100644 index 0000000..65c8140 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiOtherSettingsOF.java @@ -0,0 +1,83 @@ +package net.minecraft.src; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiOtherSettingsOF extends GuiScreen implements GuiYesNoCallback { + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.LAGOMETER, GameSettings.Options.PROFILER, GameSettings.Options.SHOW_FPS, GameSettings.Options.AUTOSAVE_TICKS, GameSettings.Options.WEATHER, GameSettings.Options.TIME, GameSettings.Options.USE_FULLSCREEN, GameSettings.Options.FULLSCREEN_MODE, GameSettings.Options.ANAGLYPH}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiOtherSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.title = I18n.format("of.options.otherTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) { + GameSettings.Options enumoptions = enumOptions[i]; + int x = this.width / 2 - 155 + i % 2 * 160; + int y = this.height / 6 + 21 * (i / 2) - 12; + + if (!enumoptions.getEnumFloat()) { + this.buttonList.add(new GuiOptionButtonOF(enumoptions.returnEnumOrdinal(), x, y, enumoptions, this.settings.getKeyBinding(enumoptions))); + } else { + this.buttonList.add(new GuiOptionSliderOF(enumoptions.returnEnumOrdinal(), x, y, enumoptions)); + } + } + + this.buttonList.add(new GuiButton(210, this.width / 2 - 100, this.height / 6 + 168 + 11 - 44, I18n.format("of.options.other.reset", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.enabled) { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) { + this.settings.setOptionValue(((GuiOptionButton)guibutton).func_146136_c(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + + if (guibutton.id == 210) { + this.mc.gameSettings.saveOptions(); + GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("of.message.other.reset", new Object[0]), "", 9999); + this.mc.displayGuiScreen(guiyesno); + } + } + } + + public void confirmClicked(boolean flag, int i) { + if (flag) { + this.mc.gameSettings.resetSettings(); + } + + this.mc.displayGuiScreen(this); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int x, int y, float f) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiPerformanceSettingsOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiPerformanceSettingsOF.java new file mode 100644 index 0000000..44cc625 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiPerformanceSettingsOF.java @@ -0,0 +1,66 @@ +package net.minecraft.src; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiPerformanceSettingsOF extends GuiScreen { + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.SMOOTH_FPS, GameSettings.Options.SMOOTH_WORLD, GameSettings.Options.LOAD_FAR, GameSettings.Options.PRELOADED_CHUNKS, GameSettings.Options.CHUNK_UPDATES, GameSettings.Options.CHUNK_UPDATES_DYNAMIC, GameSettings.Options.FAST_MATH, GameSettings.Options.LAZY_CHUNK_LOADING, GameSettings.Options.FAST_RENDER}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiPerformanceSettingsOF(GuiScreen guiscreen, GameSettings gamesettings) { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.title = I18n.format("of.options.performanceTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) { + GameSettings.Options enumoptions = enumOptions[i]; + int x = this.width / 2 - 155 + i % 2 * 160; + int y = this.height / 6 + 21 * (i / 2) - 12; + + if (!enumoptions.getEnumFloat()) { + this.buttonList.add(new GuiOptionButtonOF(enumoptions.returnEnumOrdinal(), x, y, enumoptions, this.settings.getKeyBinding(enumoptions))); + } else { + this.buttonList.add(new GuiOptionSliderOF(enumoptions.returnEnumOrdinal(), x, y, enumoptions)); + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.enabled) { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) { + this.settings.setOptionValue(((GuiOptionButton)guibutton).func_146136_c(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int x, int y, float f) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiQualitySettingsOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiQualitySettingsOF.java new file mode 100644 index 0000000..02da89f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiQualitySettingsOF.java @@ -0,0 +1,72 @@ +package net.minecraft.src; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +public class GuiQualitySettingsOF extends GuiScreen { + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.MIPMAP_LEVELS, GameSettings.Options.MIPMAP_TYPE, GameSettings.Options.ANISOTROPIC_FILTERING, GameSettings.Options.AA_LEVEL, GameSettings.Options.CLEAR_WATER, GameSettings.Options.RANDOM_MOBS, GameSettings.Options.BETTER_GRASS, GameSettings.Options.BETTER_SNOW, GameSettings.Options.CUSTOM_FONTS, GameSettings.Options.CUSTOM_COLORS, GameSettings.Options.SWAMP_COLORS, GameSettings.Options.SMOOTH_BIOMES, GameSettings.Options.CONNECTED_TEXTURES, GameSettings.Options.NATURAL_TEXTURES, GameSettings.Options.CUSTOM_SKY}; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderOptions()); + + public GuiQualitySettingsOF(GuiScreen guiscreen, GameSettings gamesettings) { + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.title = I18n.format("of.options.qualityTitle", new Object[0]); + this.buttonList.clear(); + + for (int i = 0; i < enumOptions.length; ++i) { + GameSettings.Options opt = enumOptions[i]; + int x = this.width / 2 - 155 + i % 2 * 160; + int y = this.height / 6 + 21 * (i / 2) - 12; + + if (!opt.getEnumFloat()) { + this.buttonList.add(new GuiOptionButtonOF(opt.returnEnumOrdinal(), x, y, opt, this.settings.getKeyBinding(opt))); + } else { + this.buttonList.add(new GuiOptionSliderOF(opt.returnEnumOrdinal(), x, y, opt)); + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.enabled) { + if (guibutton.id < 200 && guibutton instanceof GuiOptionButton) { + this.settings.setOptionValue(((GuiOptionButton)guibutton).func_146136_c(), 1); + guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id)); + } + + if (guibutton.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.prevScreen); + } + + if (guibutton.id != GameSettings.Options.AA_LEVEL.ordinal()) { + ScaledResolution sr = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + this.setWorldAndResolution(this.mc, sr.getScaledWidth(), sr.getScaledHeight()); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int x, int y, float f) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiScreenOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiScreenOF.java new file mode 100644 index 0000000..88ab629 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/GuiScreenOF.java @@ -0,0 +1,43 @@ +package net.minecraft.src; + +import java.util.List; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiVideoSettings; + +public class GuiScreenOF extends GuiScreen { + protected void actionPerformedRightClick(GuiButton button) {} + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) { + super.mouseClicked(mouseX, mouseY, mouseButton); + + if (mouseButton == 1) { + GuiButton btn = getSelectedButton(mouseX, mouseY, this.buttonList); + + if (btn != null && btn.enabled) { + btn.func_146113_a(this.mc.getSoundHandler()); + this.actionPerformedRightClick(btn); + } + } + } + + public static GuiButton getSelectedButton(int x, int y, List listButtons) { + for (int i = 0; i < listButtons.size(); ++i) { + GuiButton btn = (GuiButton)listButtons.get(i); + + if (btn.field_146125_m) { + int btnWidth = GuiVideoSettings.getButtonWidth(btn); + int btnHeight = GuiVideoSettings.getButtonHeight(btn); + + if (x >= btn.field_146128_h && y >= btn.field_146129_i && x < btn.field_146128_h + btnWidth && y < btn.field_146129_i + btnHeight) { + return btn; + } + } + } + + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpListener.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpListener.java new file mode 100644 index 0000000..9a86d0f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpListener.java @@ -0,0 +1,7 @@ +package net.minecraft.src; + +public interface HttpListener { + void finished(HttpRequest var1, HttpResponse var2); + + void failed(HttpRequest var1, Exception var2); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipeline.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipeline.java new file mode 100644 index 0000000..7447a74 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipeline.java @@ -0,0 +1,190 @@ +package net.minecraft.src; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InterruptedIOException; +import java.net.Proxy; +import java.net.URL; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; + +public class HttpPipeline { + private static Map mapConnections = new HashMap(); + public static final String HEADER_USER_AGENT = "User-Agent"; + public static final String HEADER_HOST = "Host"; + public static final String HEADER_ACCEPT = "Accept"; + public static final String HEADER_LOCATION = "Location"; + public static final String HEADER_KEEP_ALIVE = "Keep-Alive"; + public static final String HEADER_CONNECTION = "Connection"; + public static final String HEADER_VALUE_KEEP_ALIVE = "keep-alive"; + public static final String HEADER_TRANSFER_ENCODING = "Transfer-Encoding"; + public static final String HEADER_VALUE_CHUNKED = "chunked"; + + public static void addRequest(String urlStr, HttpListener listener) throws IOException { + addRequest(urlStr, listener, Proxy.NO_PROXY); + } + + public static void addRequest(String urlStr, HttpListener listener, Proxy proxy) throws IOException { + HttpRequest hr = makeRequest(urlStr, proxy); + HttpPipelineRequest hpr = new HttpPipelineRequest(hr, listener); + addRequest(hpr); + } + + public static HttpRequest makeRequest(String urlStr, Proxy proxy) throws IOException { + URL url = new URL(urlStr); + + if (!url.getProtocol().equals("http")) { + throw new IOException("Only protocol http is supported: " + url); + } else { + String file = url.getFile(); + String host = url.getHost(); + int port = url.getPort(); + + if (port <= 0) { + port = 80; + } + + String method = "GET"; + String http = "HTTP/1.1"; + LinkedHashMap headers = new LinkedHashMap(); + headers.put("User-Agent", "Java/" + System.getProperty("java.version")); + headers.put("Host", host); + headers.put("Accept", "text/html, image/gif, image/png"); + headers.put("Connection", "keep-alive"); + byte[] body = new byte[0]; + HttpRequest req = new HttpRequest(host, port, proxy, method, file, http, headers, body); + return req; + } + } + + public static void addRequest(HttpPipelineRequest pr) { + HttpRequest hr = pr.getHttpRequest(); + + for (HttpPipelineConnection conn = getConnection(hr.getHost(), hr.getPort(), hr.getProxy()); !conn.addRequest(pr); conn = getConnection(hr.getHost(), hr.getPort(), hr.getProxy())) { + removeConnection(hr.getHost(), hr.getPort(), hr.getProxy(), conn); + } + } + + private static synchronized HttpPipelineConnection getConnection(String host, int port, Proxy proxy) { + String key = makeConnectionKey(host, port, proxy); + HttpPipelineConnection conn = (HttpPipelineConnection)mapConnections.get(key); + + if (conn == null) { + conn = new HttpPipelineConnection(host, port, proxy); + mapConnections.put(key, conn); + } + + return conn; + } + + private static synchronized void removeConnection(String host, int port, Proxy proxy, HttpPipelineConnection hpc) { + String key = makeConnectionKey(host, port, proxy); + HttpPipelineConnection conn = (HttpPipelineConnection)mapConnections.get(key); + + if (conn == hpc) { + mapConnections.remove(key); + } + } + + private static String makeConnectionKey(String host, int port, Proxy proxy) { + String hostPort = host + ":" + port + "-" + proxy; + return hostPort; + } + + public static byte[] get(String urlStr) throws IOException { + return get(urlStr, Proxy.NO_PROXY); + } + + public static byte[] get(String urlStr, Proxy proxy) throws IOException { + if (urlStr.startsWith("file:")) { + URL req1 = new URL(urlStr); + InputStream resp1 = req1.openStream(); + byte[] bytes = Config.readAll(resp1); + return bytes; + } else { + HttpRequest req = makeRequest(urlStr, proxy); + HttpResponse resp = executeRequest(req); + + if (resp.getStatus() / 100 != 2) { + throw new IOException("HTTP response: " + resp.getStatus()); + } else { + return resp.getBody(); + } + } + } + + public static HttpResponse executeRequest(HttpRequest req) throws IOException { + final HashMap map = new HashMap(); + String KEY_RESPONSE = "Response"; + String KEY_EXCEPTION = "Exception"; + HttpListener l = new HttpListener() { + public void finished(HttpRequest req, HttpResponse resp) { + Map var3 = map; + + synchronized (map) { + map.put("Response", resp); + map.notifyAll(); + } + } + public void failed(HttpRequest req, Exception e) { + Map var3 = map; + + synchronized (map) { + map.put("Exception", e); + map.notifyAll(); + } + } + }; + + synchronized (map) { + HttpPipelineRequest hpr = new HttpPipelineRequest(req, l); + addRequest(hpr); + + try { + map.wait(); + } catch (InterruptedException var10) { + throw new InterruptedIOException("Interrupted"); + } + + Exception e = (Exception)map.get("Exception"); + + if (e != null) { + if (e instanceof IOException) { + throw(IOException)e; + } else if (e instanceof RuntimeException) { + throw(RuntimeException)e; + } else { + throw new RuntimeException(e.getMessage(), e); + } + } else { + HttpResponse resp = (HttpResponse)map.get("Response"); + + if (resp == null) { + throw new IOException("Response is null"); + } else { + return resp; + } + } + } + } + + public static boolean hasActiveRequests() { + Collection conns = mapConnections.values(); + Iterator it = conns.iterator(); + HttpPipelineConnection conn; + + do { + if (!it.hasNext()) { + return false; + } + + conn = (HttpPipelineConnection)it.next(); + } + while (!conn.hasActiveRequests()); + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineConnection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineConnection.java new file mode 100644 index 0000000..3580554 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineConnection.java @@ -0,0 +1,348 @@ +package net.minecraft.src; + +import java.io.BufferedOutputStream; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Proxy; +import java.net.Socket; +import java.util.LinkedList; +import java.util.List; +import java.util.regex.Pattern; + +public class HttpPipelineConnection { + private String host; + private int port; + private Proxy proxy; + private List listRequests; + private List listRequestsSend; + private Socket socket; + private InputStream inputStream; + private OutputStream outputStream; + private HttpPipelineSender httpPipelineSender; + private HttpPipelineReceiver httpPipelineReceiver; + private int countRequests; + private boolean responseReceived; + private long keepaliveTimeoutMs; + private int keepaliveMaxCount; + private long timeLastActivityMs; + private boolean terminated; + private static final String LF = "\n"; + public static final int TIMEOUT_CONNECT_MS = 5000; + public static final int TIMEOUT_READ_MS = 5000; + private static final Pattern patternFullUrl = Pattern.compile("^[a-zA-Z]+://.*"); + + public HttpPipelineConnection(String host, int port) { + this(host, port, Proxy.NO_PROXY); + } + + public HttpPipelineConnection(String host, int port, Proxy proxy) { + this.host = null; + this.port = 0; + this.proxy = Proxy.NO_PROXY; + this.listRequests = new LinkedList(); + this.listRequestsSend = new LinkedList(); + this.socket = null; + this.inputStream = null; + this.outputStream = null; + this.httpPipelineSender = null; + this.httpPipelineReceiver = null; + this.countRequests = 0; + this.responseReceived = false; + this.keepaliveTimeoutMs = 5000L; + this.keepaliveMaxCount = 1000; + this.timeLastActivityMs = System.currentTimeMillis(); + this.terminated = false; + this.host = host; + this.port = port; + this.proxy = proxy; + this.httpPipelineSender = new HttpPipelineSender(this); + this.httpPipelineSender.start(); + this.httpPipelineReceiver = new HttpPipelineReceiver(this); + this.httpPipelineReceiver.start(); + } + + public synchronized boolean addRequest(HttpPipelineRequest pr) { + if (this.isClosed()) { + return false; + } else { + this.addRequest(pr, this.listRequests); + this.addRequest(pr, this.listRequestsSend); + ++this.countRequests; + return true; + } + } + + private void addRequest(HttpPipelineRequest pr, List list) { + list.add(pr); + this.notifyAll(); + } + + public synchronized void setSocket(Socket s) throws IOException { + if (!this.terminated) { + if (this.socket != null) { + throw new IllegalArgumentException("Already connected"); + } else { + this.socket = s; + this.socket.setTcpNoDelay(true); + this.inputStream = this.socket.getInputStream(); + this.outputStream = new BufferedOutputStream(this.socket.getOutputStream()); + this.onActivity(); + this.notifyAll(); + } + } + } + + public synchronized OutputStream getOutputStream() throws IOException, InterruptedException { + while (this.outputStream == null) { + this.checkTimeout(); + this.wait(1000L); + } + + return this.outputStream; + } + + public synchronized InputStream getInputStream() throws IOException, InterruptedException { + while (this.inputStream == null) { + this.checkTimeout(); + this.wait(1000L); + } + + return this.inputStream; + } + + public synchronized HttpPipelineRequest getNextRequestSend() throws InterruptedException, IOException { + if (this.listRequestsSend.size() <= 0 && this.outputStream != null) { + this.outputStream.flush(); + } + + return this.getNextRequest(this.listRequestsSend, true); + } + + public synchronized HttpPipelineRequest getNextRequestReceive() throws InterruptedException { + return this.getNextRequest(this.listRequests, false); + } + + private HttpPipelineRequest getNextRequest(List list, boolean remove) throws InterruptedException { + while (list.size() <= 0) { + this.checkTimeout(); + this.wait(1000L); + } + + this.onActivity(); + + if (remove) { + return (HttpPipelineRequest)list.remove(0); + } else { + return (HttpPipelineRequest)list.get(0); + } + } + + private void checkTimeout() { + if (this.socket != null) { + long timeoutMs = this.keepaliveTimeoutMs; + + if (this.listRequests.size() > 0) { + timeoutMs = 5000L; + } + + long timeNowMs = System.currentTimeMillis(); + + if (timeNowMs > this.timeLastActivityMs + timeoutMs) { + this.terminate(new InterruptedException("Timeout " + timeoutMs)); + } + } + } + + private void onActivity() { + this.timeLastActivityMs = System.currentTimeMillis(); + } + + public synchronized void onRequestSent(HttpPipelineRequest pr) { + if (!this.terminated) { + this.onActivity(); + } + } + + public synchronized void onResponseReceived(HttpPipelineRequest pr, HttpResponse resp) { + if (!this.terminated) { + this.responseReceived = true; + this.onActivity(); + + if (this.listRequests.size() > 0 && this.listRequests.get(0) == pr) { + this.listRequests.remove(0); + pr.setClosed(true); + String location = resp.getHeader("Location"); + + if (resp.getStatus() / 100 == 3 && location != null && pr.getHttpRequest().getRedirects() < 5) { + try { + location = this.normalizeUrl(location, pr.getHttpRequest()); + HttpRequest listener1 = HttpPipeline.makeRequest(location, pr.getHttpRequest().getProxy()); + listener1.setRedirects(pr.getHttpRequest().getRedirects() + 1); + HttpPipelineRequest hpr2 = new HttpPipelineRequest(listener1, pr.getHttpListener()); + HttpPipeline.addRequest(hpr2); + } catch (IOException var6) { + pr.getHttpListener().failed(pr.getHttpRequest(), var6); + } + } else { + HttpListener listener = pr.getHttpListener(); + listener.finished(pr.getHttpRequest(), resp); + } + + this.checkResponseHeader(resp); + } else { + throw new IllegalArgumentException("Response out of order: " + pr); + } + } + } + + private String normalizeUrl(String url, HttpRequest hr) { + if (patternFullUrl.matcher(url).matches()) { + return url; + } else if (url.startsWith("//")) { + return "http:" + url; + } else { + String server = hr.getHost(); + + if (hr.getPort() != 80) { + server = server + ":" + hr.getPort(); + } + + if (url.startsWith("/")) { + return "http://" + server + url; + } else { + String file = hr.getFile(); + int pos = file.lastIndexOf("/"); + return pos >= 0 ? "http://" + server + file.substring(0, pos + 1) + url : "http://" + server + "/" + url; + } + } + } + + private void checkResponseHeader(HttpResponse resp) { + String connStr = resp.getHeader("Connection"); + + if (connStr != null && !connStr.toLowerCase().equals("keep-alive")) { + this.terminate(new EOFException("Connection not keep-alive")); + } + + String keepAliveStr = resp.getHeader("Keep-Alive"); + + if (keepAliveStr != null) { + String[] parts = Config.tokenize(keepAliveStr, ",;"); + + for (int i = 0; i < parts.length; ++i) { + String part = parts[i]; + String[] tokens = this.split(part, '='); + + if (tokens.length >= 2) { + int max; + + if (tokens[0].equals("timeout")) { + max = Config.parseInt(tokens[1], -1); + + if (max > 0) { + this.keepaliveTimeoutMs = (long)(max * 1000); + } + } + + if (tokens[0].equals("max")) { + max = Config.parseInt(tokens[1], -1); + + if (max > 0) { + this.keepaliveMaxCount = max; + } + } + } + } + } + } + + private String[] split(String str, char separator) { + int pos = str.indexOf(separator); + + if (pos < 0) { + return new String[] {str}; + } else { + String str1 = str.substring(0, pos); + String str2 = str.substring(pos + 1); + return new String[] {str1, str2}; + } + } + + public synchronized void onExceptionSend(HttpPipelineRequest pr, Exception e) { + this.terminate(e); + } + + public synchronized void onExceptionReceive(HttpPipelineRequest pr, Exception e) { + this.terminate(e); + } + + private synchronized void terminate(Exception e) { + if (!this.terminated) { + this.terminated = true; + this.terminateRequests(e); + + if (this.httpPipelineSender != null) { + this.httpPipelineSender.interrupt(); + } + + if (this.httpPipelineReceiver != null) { + this.httpPipelineReceiver.interrupt(); + } + + try { + if (this.socket != null) { + this.socket.close(); + } + } catch (IOException var3) { + ; + } + + this.socket = null; + this.inputStream = null; + this.outputStream = null; + } + } + + private void terminateRequests(Exception e) { + if (this.listRequests.size() > 0) { + HttpPipelineRequest pr; + + if (!this.responseReceived) { + pr = (HttpPipelineRequest)this.listRequests.remove(0); + pr.getHttpListener().failed(pr.getHttpRequest(), e); + pr.setClosed(true); + } + + while (this.listRequests.size() > 0) { + pr = (HttpPipelineRequest)this.listRequests.remove(0); + HttpPipeline.addRequest(pr); + } + } + } + + public synchronized boolean isClosed() { + return this.terminated ? true : this.countRequests >= this.keepaliveMaxCount; + } + + public int getCountRequests() { + return this.countRequests; + } + + public synchronized boolean hasActiveRequests() { + return this.listRequests.size() > 0; + } + + public String getHost() { + return this.host; + } + + public int getPort() { + return this.port; + } + + public Proxy getProxy() { + return this.proxy; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineReceiver.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineReceiver.java new file mode 100644 index 0000000..22bd688 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineReceiver.java @@ -0,0 +1,149 @@ +package net.minecraft.src; + +import java.io.ByteArrayOutputStream; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.util.LinkedHashMap; + +public class HttpPipelineReceiver extends Thread { + private HttpPipelineConnection httpPipelineConnection = null; + private static final Charset ASCII = Charset.forName("ASCII"); + private static final String HEADER_CONTENT_LENGTH = "Content-Length"; + private static final char CR = '\r'; + private static final char LF = '\n'; + + public HttpPipelineReceiver(HttpPipelineConnection httpPipelineConnection) { + super("HttpPipelineReceiver"); + this.httpPipelineConnection = httpPipelineConnection; + } + + public void run() { + while (!Thread.interrupted()) { + HttpPipelineRequest currentRequest = null; + + try { + currentRequest = this.httpPipelineConnection.getNextRequestReceive(); + InputStream e = this.httpPipelineConnection.getInputStream(); + HttpResponse resp = this.readResponse(e); + this.httpPipelineConnection.onResponseReceived(currentRequest, resp); + } catch (InterruptedException var4) { + return; + } catch (Exception var5) { + this.httpPipelineConnection.onExceptionReceive(currentRequest, var5); + } + } + } + + private HttpResponse readResponse(InputStream in) throws IOException { + String statusLine = this.readLine(in); + String[] parts = Config.tokenize(statusLine, " "); + + if (parts.length < 3) { + throw new IOException("Invalid status line: " + statusLine); + } else { + String http = parts[0]; + int status = Config.parseInt(parts[1], 0); + String message = parts[2]; + LinkedHashMap headers = new LinkedHashMap(); + + while (true) { + String body = this.readLine(in); + String enc; + + if (body.length() <= 0) { + byte[] body1 = null; + String lenStr1 = (String)headers.get("Content-Length"); + + if (lenStr1 != null) { + int enc1 = Config.parseInt(lenStr1, -1); + + if (enc1 > 0) { + body1 = new byte[enc1]; + this.readFull(body1, in); + } + } else { + enc = (String)headers.get("Transfer-Encoding"); + + if (Config.equals(enc, "chunked")) { + body1 = this.readContentChunked(in); + } + } + + return new HttpResponse(status, statusLine, headers, body1); + } + + int lenStr = body.indexOf(":"); + + if (lenStr > 0) { + enc = body.substring(0, lenStr).trim(); + String val = body.substring(lenStr + 1).trim(); + headers.put(enc, val); + } + } + } + } + + private byte[] readContentChunked(InputStream in) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + int len; + + do { + String line = this.readLine(in); + String[] parts = Config.tokenize(line, "; "); + len = Integer.parseInt(parts[0], 16); + byte[] buf = new byte[len]; + this.readFull(buf, in); + baos.write(buf); + this.readLine(in); + } + while (len != 0); + + return baos.toByteArray(); + } + + private void readFull(byte[] buf, InputStream in) throws IOException { + int len; + + for (int pos = 0; pos < buf.length; pos += len) { + len = in.read(buf, pos, buf.length - pos); + + if (len < 0) { + throw new EOFException(); + } + } + } + + private String readLine(InputStream in) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + int prev = -1; + boolean hasCRLF = false; + + while (true) { + int bytes = in.read(); + + if (bytes < 0) { + break; + } + + baos.write(bytes); + + if (prev == 13 && bytes == 10) { + hasCRLF = true; + break; + } + + prev = bytes; + } + + byte[] bytes1 = baos.toByteArray(); + String str = new String(bytes1, ASCII); + + if (hasCRLF) { + str = str.substring(0, str.length() - 2); + } + + return str; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineRequest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineRequest.java new file mode 100644 index 0000000..14ae0ed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineRequest.java @@ -0,0 +1,28 @@ +package net.minecraft.src; + +public class HttpPipelineRequest { + private HttpRequest httpRequest = null; + private HttpListener httpListener = null; + private boolean closed = false; + + public HttpPipelineRequest(HttpRequest httpRequest, HttpListener httpListener) { + this.httpRequest = httpRequest; + this.httpListener = httpListener; + } + + public HttpRequest getHttpRequest() { + return this.httpRequest; + } + + public HttpListener getHttpListener() { + return this.httpListener; + } + + public boolean isClosed() { + return this.closed; + } + + public void setClosed(boolean closed) { + this.closed = closed; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineSender.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineSender.java new file mode 100644 index 0000000..e3684ed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpPipelineSender.java @@ -0,0 +1,71 @@ +package net.minecraft.src; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.Socket; +import java.nio.charset.Charset; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +public class HttpPipelineSender extends Thread { + private HttpPipelineConnection httpPipelineConnection = null; + private static final String CRLF = "\r\n"; + private static Charset ASCII = Charset.forName("ASCII"); + + public HttpPipelineSender(HttpPipelineConnection httpPipelineConnection) { + super("HttpPipelineSender"); + this.httpPipelineConnection = httpPipelineConnection; + } + + public void run() { + HttpPipelineRequest hpr = null; + + try { + this.connect(); + + while (!Thread.interrupted()) { + hpr = this.httpPipelineConnection.getNextRequestSend(); + HttpRequest e = hpr.getHttpRequest(); + OutputStream out = this.httpPipelineConnection.getOutputStream(); + this.writeRequest(e, out); + this.httpPipelineConnection.onRequestSent(hpr); + } + } catch (InterruptedException var4) { + return; + } catch (Exception var5) { + this.httpPipelineConnection.onExceptionSend(hpr, var5); + } + } + + private void connect() throws IOException { + String host = this.httpPipelineConnection.getHost(); + int port = this.httpPipelineConnection.getPort(); + Proxy proxy = this.httpPipelineConnection.getProxy(); + Socket socket = new Socket(proxy); + socket.connect(new InetSocketAddress(host, port), 5000); + this.httpPipelineConnection.setSocket(socket); + } + + private void writeRequest(HttpRequest req, OutputStream out) throws IOException { + this.write(out, req.getMethod() + " " + req.getFile() + " " + req.getHttp() + "\r\n"); + Map headers = req.getHeaders(); + Set keySet = headers.keySet(); + Iterator it = keySet.iterator(); + + while (it.hasNext()) { + String key = (String)it.next(); + String val = (String)req.getHeaders().get(key); + this.write(out, key + ": " + val + "\r\n"); + } + + this.write(out, "\r\n"); + } + + private void write(OutputStream out, String str) throws IOException { + byte[] bytes = str.getBytes(ASCII); + out.write(bytes); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpRequest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpRequest.java new file mode 100644 index 0000000..7f3fe61 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpRequest.java @@ -0,0 +1,80 @@ +package net.minecraft.src; + +import java.net.Proxy; +import java.util.LinkedHashMap; +import java.util.Map; + +public class HttpRequest { + private String host = null; + private int port = 0; + private Proxy proxy; + private String method; + private String file; + private String http; + private Map headers; + private byte[] body; + private int redirects; + public static final String METHOD_GET = "GET"; + public static final String METHOD_HEAD = "HEAD"; + public static final String METHOD_POST = "POST"; + public static final String HTTP_1_0 = "HTTP/1.0"; + public static final String HTTP_1_1 = "HTTP/1.1"; + + public HttpRequest(String host, int port, Proxy proxy, String method, String file, String http, Map headers, byte[] body) { + this.proxy = Proxy.NO_PROXY; + this.method = null; + this.file = null; + this.http = null; + this.headers = new LinkedHashMap(); + this.body = null; + this.redirects = 0; + this.host = host; + this.port = port; + this.proxy = proxy; + this.method = method; + this.file = file; + this.http = http; + this.headers = headers; + this.body = body; + } + + public String getHost() { + return this.host; + } + + public int getPort() { + return this.port; + } + + public String getMethod() { + return this.method; + } + + public String getFile() { + return this.file; + } + + public String getHttp() { + return this.http; + } + + public Map getHeaders() { + return this.headers; + } + + public byte[] getBody() { + return this.body; + } + + public int getRedirects() { + return this.redirects; + } + + public void setRedirects(int redirects) { + this.redirects = redirects; + } + + public Proxy getProxy() { + return this.proxy; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpResponse.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpResponse.java new file mode 100644 index 0000000..bcb27c8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpResponse.java @@ -0,0 +1,38 @@ +package net.minecraft.src; + +import java.util.LinkedHashMap; +import java.util.Map; + +public class HttpResponse { + private int status = 0; + private String statusLine = null; + private Map headers = new LinkedHashMap(); + private byte[] body = null; + + public HttpResponse(int status, String statusLine, Map headers, byte[] body) { + this.status = status; + this.statusLine = statusLine; + this.headers = headers; + this.body = body; + } + + public int getStatus() { + return this.status; + } + + public String getStatusLine() { + return this.statusLine; + } + + public Map getHeaders() { + return this.headers; + } + + public String getHeader(String key) { + return (String)this.headers.get(key); + } + + public byte[] getBody() { + return this.body; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpUtils.java new file mode 100644 index 0000000..f390cfd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/HttpUtils.java @@ -0,0 +1,136 @@ +package net.minecraft.src; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import net.minecraft.client.Minecraft; + +public class HttpUtils { + private static String playerItemsUrl = null; + public static final String SERVER_URL = "http://s.optifine.net"; + public static final String POST_URL = "http://optifine.net"; + + public static byte[] get(String urlStr) throws IOException { + HttpURLConnection conn = null; + + try { + URL url = new URL(urlStr); + conn = (HttpURLConnection)url.openConnection(Minecraft.getMinecraft().getProxy()); + conn.setDoInput(true); + conn.setDoOutput(false); + conn.connect(); + + if (conn.getResponseCode() / 100 != 2) { + if (conn.getErrorStream() != null) { + Config.readAll(conn.getErrorStream()); + } + + throw new IOException("HTTP response: " + conn.getResponseCode()); + } else { + InputStream in = conn.getInputStream(); + byte[] bytes = new byte[conn.getContentLength()]; + int pos = 0; + + do { + int len = in.read(bytes, pos, bytes.length - pos); + + if (len < 0) { + throw new IOException("Input stream closed: " + urlStr); + } + + pos += len; + } + while (pos < bytes.length); + + byte[] len1 = bytes; + return len1; + } + } + finally { + if (conn != null) { + conn.disconnect(); + } + } + } + + public static String post(String urlStr, Map headers, byte[] content) throws IOException { + HttpURLConnection conn = null; + + try { + URL url = new URL(urlStr); + conn = (HttpURLConnection)url.openConnection(Minecraft.getMinecraft().getProxy()); + conn.setRequestMethod("POST"); + + if (headers != null) { + Set os = headers.keySet(); + Iterator in = os.iterator(); + + while (in.hasNext()) { + String isr = (String)in.next(); + String br = "" + headers.get(isr); + conn.setRequestProperty(isr, br); + } + } + + conn.setRequestProperty("Content-Type", "text/plain"); + conn.setRequestProperty("Content-Length", "" + content.length); + conn.setRequestProperty("Content-Language", "en-US"); + conn.setUseCaches(false); + conn.setDoInput(true); + conn.setDoOutput(true); + OutputStream os1 = conn.getOutputStream(); + os1.write(content); + os1.flush(); + os1.close(); + InputStream in1 = conn.getInputStream(); + InputStreamReader isr1 = new InputStreamReader(in1, "ASCII"); + BufferedReader br1 = new BufferedReader(isr1); + StringBuffer sb = new StringBuffer(); + String line; + + while ((line = br1.readLine()) != null) { + sb.append(line); + sb.append('\r'); + } + + br1.close(); + String var11 = sb.toString(); + return var11; + } + finally { + if (conn != null) { + conn.disconnect(); + } + } + } + + public static synchronized String getPlayerItemsUrl() { + if (playerItemsUrl == null) { + try { + boolean e = Config.parseBoolean(System.getProperty("player.models.local"), false); + + if (e) { + File dirMc = Minecraft.getMinecraft().mcDataDir; + File dirModels = new File(dirMc, "playermodels"); + playerItemsUrl = dirModels.toURI().toURL().toExternalForm(); + } + } catch (Exception var3) { + Config.warn("" + var3.getClass().getName() + ": " + var3.getMessage()); + } + + if (playerItemsUrl == null) { + playerItemsUrl = "http://s.optifine.net"; + } + } + + return playerItemsUrl; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFieldLocator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFieldLocator.java new file mode 100644 index 0000000..9c788ac --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFieldLocator.java @@ -0,0 +1,7 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; + +public interface IFieldLocator { + Field getField(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFileDownloadListener.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFileDownloadListener.java new file mode 100644 index 0000000..a0cb380 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFileDownloadListener.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface IFileDownloadListener { + void fileDownloadFinished(String var1, byte[] var2, Throwable var3); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFileUploadListener.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFileUploadListener.java new file mode 100644 index 0000000..1578865 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IFileUploadListener.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface IFileUploadListener { + void fileUploadFinished(String var1, byte[] var2, Throwable var3); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IOptionControl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IOptionControl.java new file mode 100644 index 0000000..97c1a73 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IOptionControl.java @@ -0,0 +1,7 @@ +package net.minecraft.src; + +import net.minecraft.client.settings.GameSettings; + +public interface IOptionControl { + GameSettings.Options getOption(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdateControl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdateControl.java new file mode 100644 index 0000000..c40a604 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdateControl.java @@ -0,0 +1,7 @@ +package net.minecraft.src; + +public interface IWrUpdateControl { + void pause(); + + void resume(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdateListener.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdateListener.java new file mode 100644 index 0000000..4e5faaa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdateListener.java @@ -0,0 +1,5 @@ +package net.minecraft.src; + +public interface IWrUpdateListener { + void updating(IWrUpdateControl var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdater.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdater.java new file mode 100644 index 0000000..96de204 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IWrUpdater.java @@ -0,0 +1,29 @@ +package net.minecraft.src; + +import java.util.List; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public interface IWrUpdater { + void initialize(); + + WorldRenderer makeWorldRenderer(World var1, List var2, int var3, int var4, int var5, int var6); + + void preRender(RenderGlobal var1, EntityLivingBase var2); + + void postRender(); + + boolean updateRenderers(RenderGlobal var1, EntityLivingBase var2, boolean var3); + + void resumeBackgroundUpdates(); + + void pauseBackgroundUpdates(); + + void finishCurrentUpdate(); + + void clearAllUpdates(); + + void terminate(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IntegerCache.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IntegerCache.java new file mode 100644 index 0000000..47e3203 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/IntegerCache.java @@ -0,0 +1,20 @@ +package net.minecraft.src; + +public class IntegerCache { + private static final int CACHE_SIZE = 65535; + private static final Integer[] cache = makeCache(65535); + + private static Integer[] makeCache(int size) { + Integer[] arr = new Integer[size]; + + for (int i = 0; i < size; ++i) { + arr[i] = new Integer(i); + } + + return arr; + } + + public static Integer valueOf(int value) { + return value >= 0 && value < 65535 ? cache[value] : new Integer(value); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ItemRendererOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ItemRendererOF.java new file mode 100644 index 0000000..38edbbf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ItemRendererOF.java @@ -0,0 +1,182 @@ +package net.minecraft.src; + +import com.cheatbreaker.client.CheatBreaker; +import com.cheatbreaker.client.module.impl.normal.vanilla.ModuleEnchantmentGlint; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import shadersmod.client.Shaders; + +import java.lang.reflect.Field; + +public class ItemRendererOF extends ItemRenderer { + private Minecraft mc = null; + private RenderBlocks renderBlocksIr = null; + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + private static Field ItemRenderer_renderBlockInstance = Reflector.getField(ItemRenderer.class, RenderBlocks.class); + + public ItemRendererOF(Minecraft par1Minecraft) { + super(par1Minecraft); + this.mc = par1Minecraft; + + if (ItemRenderer_renderBlockInstance == null) { + Config.error("ItemRenderOF not initialized"); + } + + try { + this.renderBlocksIr = (RenderBlocks)ItemRenderer_renderBlockInstance.get(this); + } catch (IllegalAccessException var3) { + throw new RuntimeException(var3); + } + } + + /** + * Renders the item stack for being in an entity's hand Args: itemStack + */ + public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3) { + GL11.glPushMatrix(); + TextureManager var4 = this.mc.getTextureManager(); + Item var5 = par2ItemStack.getItem(); + Block var6 = Block.getBlockFromItem(var5); + + if (par2ItemStack != null && var6 != null && var6.getRenderBlockPass() != 0) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + Object type = null; + Object customRenderer = null; + + if (Reflector.MinecraftForgeClient_getItemRenderer.exists()) { + type = Reflector.getFieldValue(Reflector.ItemRenderType_EQUIPPED); + customRenderer = Reflector.call(Reflector.MinecraftForgeClient_getItemRenderer, new Object[] {par2ItemStack, type}); + } + + if (customRenderer != null) { + var4.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); + Reflector.callVoid(Reflector.ForgeHooksClient_renderEquippedItem, new Object[] {type, customRenderer, this.renderBlocksIr, par1EntityLivingBase, par2ItemStack}); + } else if (par2ItemStack.getItemSpriteNumber() == 0 && var5 instanceof ItemBlock && RenderBlocks.renderItemIn3d(var6.getRenderType())) { + var4.bindTexture(var4.getResourceLocation(0)); + + if (par2ItemStack != null && var6 != null && var6.getRenderBlockPass() != 0) { + if (!Config.isShaders() || !Shaders.renderItemKeepDepthMask) { + GL11.glDepthMask(false); + } + + this.renderBlocksIr.renderBlockAsItem(var6, par2ItemStack.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + } else { + this.renderBlocksIr.renderBlockAsItem(var6, par2ItemStack.getItemDamage(), 1.0F); + } + } else { + IIcon var7 = par1EntityLivingBase.getItemIcon(par2ItemStack, par3); + + if (var7 == null) { + GL11.glPopMatrix(); + return; + } + + var4.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator var8 = Tessellator.instance; + float var9 = var7.getMinU(); + float var10 = var7.getMaxU(); + float var11 = var7.getMinV(); + float var12 = var7.getMaxV(); + float var13 = 0.0F; + float var14 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glTranslatef(-var13, -var14, 0.0F); + float var15 = 1.5F; + GL11.glScalef(var15, var15, var15); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); + renderItemIn2D(var8, var10, var11, var9, var12, var7.getIconWidth(), var7.getIconHeight(), 0.0625F); + boolean renderEffect = false; + + if (Reflector.ForgeItemStack_hasEffect.exists()) { + renderEffect = Reflector.callBoolean(par2ItemStack, Reflector.ForgeItemStack_hasEffect, new Object[] {Integer.valueOf(par3)}); + } else { + renderEffect = par2ItemStack.hasEffect() && par3 == 0; + } + + ModuleEnchantmentGlint glintMod = CheatBreaker.getInstance().getModuleManager().enchantmentGlintMod; + if (renderEffect && glintMod.isEnabled() && (Boolean)glintMod.heldItemGlint.getValue()) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + var4.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_LINES, GL11.GL_LINES, GL11.GL_POINTS); + int getGlintColor = glintMod.heldItemGlintColor.getColorValue(); + float glintA = (float)(getGlintColor >> 24 & 255) / 255.0F; + float glintR = (float)(getGlintColor >> 16 & 255) / 255.0F; + float glintG = (float)(getGlintColor >> 8 & 255) / 255.0F; + float glintB = (float)(getGlintColor & 255) / 255.0F; + float alpha = glintA * 0.76F; + GL11.glColor4f(glintR * alpha, glintG * alpha, glintB * alpha, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float scale = 0.125F; + GL11.glScalef(scale, scale, scale); + float var18 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(var18, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 16, 16, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(scale, scale, scale); + var18 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-var18, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 16, 16, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + var4.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + + if (par2ItemStack != null && var6 != null && var6.getRenderBlockPass() != 0) { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glPopMatrix(); + } + + /** + * Renders the active item in the player's hand when in first person mode. Args: partialTickTime + */ + public void renderItemInFirstPerson(float par1) { + this.mc.theWorld.renderItemInFirstPerson = true; + super.renderItemInFirstPerson(par1); + this.mc.theWorld.renderItemInFirstPerson = false; + } + + public void updateEquippedItem() { + super.updateEquippedItem(); + + if (Config.isShaders()) { + Shaders.setItemToRenderMain((ItemStack)Reflector.getFieldValue(this, Reflector.ItemRenderer_itemToRender)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Json.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Json.java new file mode 100644 index 0000000..d7b6789 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Json.java @@ -0,0 +1,75 @@ +package net.minecraft.src; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +public class Json { + public static float getFloat(JsonObject obj, String field, float def) { + JsonElement elem = obj.get(field); + return elem == null ? def : elem.getAsFloat(); + } + + public static boolean getBoolean(JsonObject obj, String field, boolean def) { + JsonElement elem = obj.get(field); + return elem == null ? def : elem.getAsBoolean(); + } + + public static String getString(JsonObject jsonObj, String field) { + return getString(jsonObj, field, (String)null); + } + + public static String getString(JsonObject jsonObj, String field, String def) { + JsonElement jsonElement = jsonObj.get(field); + return jsonElement == null ? def : jsonElement.getAsString(); + } + + public static float[] parseFloatArray(JsonElement jsonElement, int len) { + return parseFloatArray(jsonElement, len, (float[])null); + } + + public static float[] parseFloatArray(JsonElement jsonElement, int len, float[] def) { + if (jsonElement == null) { + return def; + } else { + JsonArray arr = jsonElement.getAsJsonArray(); + + if (arr.size() != len) { + throw new JsonParseException("Wrong array length: " + arr.size() + ", should be: " + len + ", array: " + arr); + } else { + float[] floatArr = new float[arr.size()]; + + for (int i = 0; i < floatArr.length; ++i) { + floatArr[i] = arr.get(i).getAsFloat(); + } + + return floatArr; + } + } + } + + public static int[] parseIntArray(JsonElement jsonElement, int len) { + return parseIntArray(jsonElement, len, (int[])null); + } + + public static int[] parseIntArray(JsonElement jsonElement, int len, int[] def) { + if (jsonElement == null) { + return def; + } else { + JsonArray arr = jsonElement.getAsJsonArray(); + + if (arr.size() != len) { + throw new JsonParseException("Wrong array length: " + arr.size() + ", should be: " + len + ", array: " + arr); + } else { + int[] intArr = new int[arr.size()]; + + for (int i = 0; i < intArr.length; ++i) { + intArr[i] = arr.get(i).getAsInt(); + } + + return intArr; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Lang.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Lang.java new file mode 100644 index 0000000..a269784 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Lang.java @@ -0,0 +1,108 @@ +package net.minecraft.src; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Map; +import java.util.regex.Pattern; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +public class Lang { + private static final Splitter splitter = Splitter.on('=').limit(2); + private static final Pattern pattern = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + + public static void resourcesReloaded() { + Map localeProperties = I18n.getLocaleProperties(); + ArrayList listFiles = new ArrayList(); + String PREFIX = "optifine/lang/"; + String EN_US = "en_US"; + String SUFFIX = ".lang"; + listFiles.add(PREFIX + EN_US + SUFFIX); + + if (!Config.getGameSettings().language.equals(EN_US)) { + listFiles.add(PREFIX + Config.getGameSettings().language + SUFFIX); + } + + String[] files = (String[])((String[])listFiles.toArray(new String[listFiles.size()])); + loadResources(Config.getDefaultResourcePack(), files, localeProperties); + IResourcePack[] resourcePacks = Config.getResourcePacks(); + + for (int i = 0; i < resourcePacks.length; ++i) { + IResourcePack rp = resourcePacks[i]; + loadResources(rp, files, localeProperties); + } + } + + private static void loadResources(IResourcePack rp, String[] files, Map localeProperties) { + try { + for (int e = 0; e < files.length; ++e) { + String file = files[e]; + ResourceLocation loc = new ResourceLocation(file); + + if (rp.resourceExists(loc)) { + InputStream in = rp.getInputStream(loc); + + if (in != null) { + loadLocaleData(in, localeProperties); + } + } + } + } catch (IOException var7) { + var7.printStackTrace(); + } + } + + public static void loadLocaleData(InputStream is, Map localeProperties) throws IOException { + Iterator it = IOUtils.readLines(is, Charsets.UTF_8).iterator(); + + while (it.hasNext()) { + String line = (String)it.next(); + + if (!line.isEmpty() && line.charAt(0) != 35) { + String[] parts = (String[])((String[])Iterables.toArray(splitter.split(line), String.class)); + + if (parts != null && parts.length == 2) { + String key = parts[0]; + String value = pattern.matcher(parts[1]).replaceAll("%$1s"); + localeProperties.put(key, value); + } + } + } + } + + public static String get(String key) { + return I18n.format(key, new Object[0]); + } + + public static String get(String key, String def) { + String str = I18n.format(key, new Object[0]); + return str != null && !str.equals(key) ? str : def; + } + + public static String getOn() { + return I18n.format("options.on", new Object[0]); + } + + public static String getOff() { + return I18n.format("options.off", new Object[0]); + } + + public static String getFast() { + return I18n.format("options.graphics.fast", new Object[0]); + } + + public static String getFancy() { + return I18n.format("options.graphics.fancy", new Object[0]); + } + + public static String getDefault() { + return I18n.format("generator.default", new Object[0]); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/MatchBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/MatchBlock.java new file mode 100644 index 0000000..5921e54 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/MatchBlock.java @@ -0,0 +1,74 @@ +package net.minecraft.src; + +public class MatchBlock { + private int blockId = -1; + private int[] metadatas = null; + + public MatchBlock(int blockId) { + this.blockId = blockId; + } + + public MatchBlock(int blockId, int metadata) { + this.blockId = blockId; + + if (metadata >= 0 && metadata <= 15) { + this.metadatas = new int[] {metadata}; + } + } + + public MatchBlock(int blockId, int[] metadatas) { + this.blockId = blockId; + this.metadatas = metadatas; + } + + public int getBlockId() { + return this.blockId; + } + + public int[] getMetadatas() { + return this.metadatas; + } + + public boolean matches(int id, int metadata) { + if (id != this.blockId) { + return false; + } else { + if (this.metadatas != null) { + boolean matchMetadata = false; + + for (int i = 0; i < this.metadatas.length; ++i) { + int md = this.metadatas[i]; + + if (md == metadata) { + matchMetadata = true; + break; + } + } + + if (!matchMetadata) { + return false; + } + } + + return true; + } + } + + public void addMetadata(int metadata) { + if (this.metadatas != null) { + if (metadata >= 0 && metadata <= 15) { + for (int i = 0; i < this.metadatas.length; ++i) { + if (this.metadatas[i] == metadata) { + return; + } + } + + this.metadatas = Config.addIntToArray(this.metadatas, metadata); + } + } + } + + public String toString() { + return "" + this.blockId + ":" + Config.arrayToString(this.metadatas); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Matches.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Matches.java new file mode 100644 index 0000000..899e8db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Matches.java @@ -0,0 +1,80 @@ +package net.minecraft.src; + +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.world.biome.BiomeGenBase; + +public class Matches { + public static boolean block(int blockId, int metadata, MatchBlock[] matchBlocks) { + if (matchBlocks == null) { + return true; + } else { + for (int i = 0; i < matchBlocks.length; ++i) { + MatchBlock mb = matchBlocks[i]; + + if (mb.matches(blockId, metadata)) { + return true; + } + } + + return false; + } + } + + public static boolean blockId(int blockId, MatchBlock[] matchBlocks) { + if (matchBlocks == null) { + return true; + } else { + for (int i = 0; i < matchBlocks.length; ++i) { + MatchBlock mb = matchBlocks[i]; + + if (mb.getBlockId() == blockId) { + return true; + } + } + + return false; + } + } + + public static boolean metadata(int metadata, int[] metadatas) { + if (metadatas == null) { + return true; + } else { + for (int i = 0; i < metadatas.length; ++i) { + if (metadatas[i] == metadata) { + return true; + } + } + + return false; + } + } + + public static boolean sprite(TextureAtlasSprite sprite, TextureAtlasSprite[] sprites) { + if (sprites == null) { + return true; + } else { + for (int i = 0; i < sprites.length; ++i) { + if (sprites[i] == sprite) { + return true; + } + } + + return false; + } + } + + public static boolean biome(BiomeGenBase biome, BiomeGenBase[] biomes) { + if (biomes == null) { + return true; + } else { + for (int i = 0; i < biomes.length; ++i) { + if (biomes[i] == biome) { + return true; + } + } + + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/MathUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/MathUtils.java new file mode 100644 index 0000000..32ff703 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/MathUtils.java @@ -0,0 +1,47 @@ +package net.minecraft.src; + +import net.minecraft.util.MathHelper; + +public class MathUtils { + public static int getAverage(int[] vals) { + if (vals.length <= 0) { + return 0; + } else { + int sum = getSum(vals); + int avg = sum / vals.length; + return avg; + } + } + + public static int getSum(int[] vals) { + if (vals.length <= 0) { + return 0; + } else { + int sum = 0; + + for (int i = 0; i < vals.length; ++i) { + int val = vals[i]; + sum += val; + } + + return sum; + } + } + + public static int roundDownToPowerOfTwo(int val) { + int po2 = MathHelper.roundUpToPowerOfTwo(val); + return val == po2 ? po2 : po2 / 2; + } + + public static boolean equalsDelta(float f1, float f2, float delta) { + return Math.abs(f1 - f2) <= delta; + } + + public static float toDeg(float angle) { + return angle * 180.0F / (float)Math.PI; + } + + public static float toRad(float angle) { + return angle / 180.0F * (float)Math.PI; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Mipmaps.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Mipmaps.java new file mode 100644 index 0000000..8e6c8fb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Mipmaps.java @@ -0,0 +1,185 @@ +package net.minecraft.src; + +import java.awt.Dimension; +import java.nio.IntBuffer; +import java.util.ArrayList; +import net.minecraft.client.renderer.GLAllocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class Mipmaps { + private final String iconName; + private final int width; + private final int height; + private final int[] data; + private final boolean direct; + private int[][] mipmapDatas; + private IntBuffer[] mipmapBuffers; + private Dimension[] mipmapDimensions; + + public Mipmaps(String iconName, int width, int height, int[] data, boolean direct) { + this.iconName = iconName; + this.width = width; + this.height = height; + this.data = data; + this.direct = direct; + this.mipmapDimensions = makeMipmapDimensions(width, height, iconName); + this.mipmapDatas = generateMipMapData(data, width, height, this.mipmapDimensions); + + if (direct) { + this.mipmapBuffers = makeMipmapBuffers(this.mipmapDimensions, this.mipmapDatas); + } + } + + public static Dimension[] makeMipmapDimensions(int width, int height, String iconName) { + int texWidth = TextureUtils.ceilPowerOfTwo(width); + int texHeight = TextureUtils.ceilPowerOfTwo(height); + + if (texWidth == width && texHeight == height) { + ArrayList listDims = new ArrayList(); + int mipWidth = texWidth; + int mipHeight = texHeight; + + while (true) { + mipWidth /= 2; + mipHeight /= 2; + + if (mipWidth <= 0 && mipHeight <= 0) { + Dimension[] mipmapDimensions1 = (Dimension[])((Dimension[])listDims.toArray(new Dimension[listDims.size()])); + return mipmapDimensions1; + } + + if (mipWidth <= 0) { + mipWidth = 1; + } + + if (mipHeight <= 0) { + mipHeight = 1; + } + + int mipmapDimensions = mipWidth * mipHeight * 4; + Dimension dim = new Dimension(mipWidth, mipHeight); + listDims.add(dim); + } + } else { + Config.warn("Mipmaps not possible (power of 2 dimensions needed), texture: " + iconName + ", dim: " + width + "x" + height); + return new Dimension[0]; + } + } + + public static int[][] generateMipMapData(int[] data, int width, int height, Dimension[] mipmapDimensions) { + int[] parMipData = data; + int parWidth = width; + boolean scale = true; + int[][] mipmapDatas = new int[mipmapDimensions.length][]; + + for (int i = 0; i < mipmapDimensions.length; ++i) { + Dimension dim = mipmapDimensions[i]; + int mipWidth = dim.width; + int mipHeight = dim.height; + int[] mipData = new int[mipWidth * mipHeight]; + mipmapDatas[i] = mipData; + int level = i + 1; + + if (scale) { + for (int mipX = 0; mipX < mipWidth; ++mipX) { + for (int mipY = 0; mipY < mipHeight; ++mipY) { + int p1 = parMipData[mipX * 2 + 0 + (mipY * 2 + 0) * parWidth]; + int p2 = parMipData[mipX * 2 + 1 + (mipY * 2 + 0) * parWidth]; + int p3 = parMipData[mipX * 2 + 1 + (mipY * 2 + 1) * parWidth]; + int p4 = parMipData[mipX * 2 + 0 + (mipY * 2 + 1) * parWidth]; + int pixel = alphaBlend(p1, p2, p3, p4); + mipData[mipX + mipY * mipWidth] = pixel; + } + } + } + + parMipData = mipData; + parWidth = mipWidth; + + if (mipWidth <= 1 || mipHeight <= 1) { + scale = false; + } + } + + return mipmapDatas; + } + + public static int alphaBlend(int c1, int c2, int c3, int c4) { + int cx1 = alphaBlend(c1, c2); + int cx2 = alphaBlend(c3, c4); + int cx = alphaBlend(cx1, cx2); + return cx; + } + + private static int alphaBlend(int c1, int c2) { + int a1 = (c1 & -16777216) >> 24 & 255; + int a2 = (c2 & -16777216) >> 24 & 255; + int ax = (a1 + a2) / 2; + + if (a1 == 0 && a2 == 0) { + a1 = 1; + a2 = 1; + } else { + if (a1 == 0) { + c1 = c2; + ax /= 2; + } + + if (a2 == 0) { + c2 = c1; + ax /= 2; + } + } + + int r1 = (c1 >> 16 & 255) * a1; + int g1 = (c1 >> 8 & 255) * a1; + int b1 = (c1 & 255) * a1; + int r2 = (c2 >> 16 & 255) * a2; + int g2 = (c2 >> 8 & 255) * a2; + int b2 = (c2 & 255) * a2; + int rx = (r1 + r2) / (a1 + a2); + int gx = (g1 + g2) / (a1 + a2); + int bx = (b1 + b2) / (a1 + a2); + return ax << 24 | rx << 16 | gx << 8 | bx; + } + + private int averageColor(int i, int j) { + int k = (i & -16777216) >> 24 & 255; + int l = (j & -16777216) >> 24 & 255; + return (k + l >> 1 << 24) + ((i & 16711422) + (j & 16711422) >> 1); + } + + public static IntBuffer[] makeMipmapBuffers(Dimension[] mipmapDimensions, int[][] mipmapDatas) { + if (mipmapDimensions == null) { + return null; + } else { + IntBuffer[] mipmapBuffers = new IntBuffer[mipmapDimensions.length]; + + for (int i = 0; i < mipmapDimensions.length; ++i) { + Dimension dim = mipmapDimensions[i]; + int bufLen = dim.width * dim.height; + IntBuffer buf = GLAllocation.createDirectIntBuffer(bufLen); + int[] data = mipmapDatas[i]; + buf.clear(); + buf.put(data); + buf.clear(); + mipmapBuffers[i] = buf; + } + + return mipmapBuffers; + } + } + + public static void allocateMipmapTextures(int width, int height, String name) { + Dimension[] dims = makeMipmapDimensions(width, height, name); + + for (int i = 0; i < dims.length; ++i) { + Dimension dim = dims[i]; + int mipWidth = dim.width; + int mipHeight = dim.height; + int level = i + 1; + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, level, GL11.GL_RGBA, mipWidth, mipHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ModelPlayerItem.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ModelPlayerItem.java new file mode 100644 index 0000000..f05c398 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ModelPlayerItem.java @@ -0,0 +1,9 @@ +package net.minecraft.src; + +import net.minecraft.client.model.ModelBase; + +public class ModelPlayerItem extends ModelBase { + public ModelPlayerItem() { + this.isChild = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ModelSprite.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ModelSprite.java new file mode 100644 index 0000000..c898c4e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ModelSprite.java @@ -0,0 +1,146 @@ +package net.minecraft.src; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +public class ModelSprite { + private ModelRenderer modelRenderer = null; + private int textureOffsetX = 0; + private int textureOffsetY = 0; + private float posX = 0.0F; + private float posY = 0.0F; + private float posZ = 0.0F; + private int sizeX = 0; + private int sizeY = 0; + private int sizeZ = 0; + private float sizeAdd = 0.0F; + private float minU = 0.0F; + private float minV = 0.0F; + private float maxU = 0.0F; + private float maxV = 0.0F; + + public ModelSprite(ModelRenderer modelRenderer, int textureOffsetX, int textureOffsetY, float posX, float posY, float posZ, int sizeX, int sizeY, int sizeZ, float sizeAdd) { + this.modelRenderer = modelRenderer; + this.textureOffsetX = textureOffsetX; + this.textureOffsetY = textureOffsetY; + this.posX = posX; + this.posY = posY; + this.posZ = posZ; + this.sizeX = sizeX; + this.sizeY = sizeY; + this.sizeZ = sizeZ; + this.sizeAdd = sizeAdd; + this.minU = (float)textureOffsetX / modelRenderer.textureWidth; + this.minV = (float)textureOffsetY / modelRenderer.textureHeight; + this.maxU = (float)(textureOffsetX + sizeX) / modelRenderer.textureWidth; + this.maxV = (float)(textureOffsetY + sizeY) / modelRenderer.textureHeight; + } + + public void render(Tessellator tessellator, float scale) { + GL11.glTranslatef(this.posX * scale, this.posY * scale, this.posZ * scale); + float rMinU = this.minU; + float rMaxU = this.maxU; + float rMinV = this.minV; + float rMaxV = this.maxV; + + if (this.modelRenderer.mirror) { + rMinU = this.maxU; + rMaxU = this.minU; + } + + if (this.modelRenderer.mirrorV) { + rMinV = this.maxV; + rMaxV = this.minV; + } + + renderItemIn2D(tessellator, rMinU, rMinV, rMaxU, rMaxV, this.sizeX, this.sizeY, scale * (float)this.sizeZ, this.modelRenderer.textureWidth, this.modelRenderer.textureHeight); + GL11.glTranslatef(-this.posX * scale, -this.posY * scale, -this.posZ * scale); + } + + public static void renderItemIn2D(Tessellator tessellator, float minU, float minV, float maxU, float maxV, int sizeX, int sizeY, float width, float texWidth, float texHeight) { + if (width < 6.25E-4F) { + width = 6.25E-4F; + } + + float dU = maxU - minU; + float dV = maxV - minV; + double dimX = (double)(MathHelper.abs(dU) * (texWidth / 16.0F)); + double dimY = (double)(MathHelper.abs(dV) * (texHeight / 16.0F)); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addVertexWithUV(0.0D, dimY, 0.0D, (double)minU, (double)maxV); + tessellator.addVertexWithUV(dimX, dimY, 0.0D, (double)maxU, (double)maxV); + tessellator.addVertexWithUV(dimX, 0.0D, 0.0D, (double)maxU, (double)minV); + tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)minU, (double)minV); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addVertexWithUV(0.0D, 0.0D, (double)width, (double)minU, (double)minV); + tessellator.addVertexWithUV(dimX, 0.0D, (double)width, (double)maxU, (double)minV); + tessellator.addVertexWithUV(dimX, dimY, (double)width, (double)maxU, (double)maxV); + tessellator.addVertexWithUV(0.0D, dimY, (double)width, (double)minU, (double)maxV); + tessellator.draw(); + float var8 = 0.5F * dU / (float)sizeX; + float var9 = 0.5F * dV / (float)sizeY; + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + int var10; + float var11; + float var12; + + for (var10 = 0; var10 < sizeX; ++var10) { + var11 = (float)var10 / (float)sizeX; + var12 = minU + dU * var11 + var8; + tessellator.addVertexWithUV((double)var11 * dimX, dimY, (double)width, (double)var12, (double)maxV); + tessellator.addVertexWithUV((double)var11 * dimX, dimY, 0.0D, (double)var12, (double)maxV); + tessellator.addVertexWithUV((double)var11 * dimX, 0.0D, 0.0D, (double)var12, (double)minV); + tessellator.addVertexWithUV((double)var11 * dimX, 0.0D, (double)width, (double)var12, (double)minV); + } + + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + float var13; + + for (var10 = 0; var10 < sizeX; ++var10) { + var11 = (float)var10 / (float)sizeX; + var12 = minU + dU * var11 + var8; + var13 = var11 + 1.0F / (float)sizeX; + tessellator.addVertexWithUV((double)var13 * dimX, 0.0D, (double)width, (double)var12, (double)minV); + tessellator.addVertexWithUV((double)var13 * dimX, 0.0D, 0.0D, (double)var12, (double)minV); + tessellator.addVertexWithUV((double)var13 * dimX, dimY, 0.0D, (double)var12, (double)maxV); + tessellator.addVertexWithUV((double)var13 * dimX, dimY, (double)width, (double)var12, (double)maxV); + } + + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + + for (var10 = 0; var10 < sizeY; ++var10) { + var11 = (float)var10 / (float)sizeY; + var12 = minV + dV * var11 + var9; + var13 = var11 + 1.0F / (float)sizeY; + tessellator.addVertexWithUV(0.0D, (double)var13 * dimY, (double)width, (double)minU, (double)var12); + tessellator.addVertexWithUV(dimX, (double)var13 * dimY, (double)width, (double)maxU, (double)var12); + tessellator.addVertexWithUV(dimX, (double)var13 * dimY, 0.0D, (double)maxU, (double)var12); + tessellator.addVertexWithUV(0.0D, (double)var13 * dimY, 0.0D, (double)minU, (double)var12); + } + + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + + for (var10 = 0; var10 < sizeY; ++var10) { + var11 = (float)var10 / (float)sizeY; + var12 = minV + dV * var11 + var9; + tessellator.addVertexWithUV(dimX, (double)var11 * dimY, (double)width, (double)maxU, (double)var12); + tessellator.addVertexWithUV(0.0D, (double)var11 * dimY, (double)width, (double)minU, (double)var12); + tessellator.addVertexWithUV(0.0D, (double)var11 * dimY, 0.0D, (double)minU, (double)var12); + tessellator.addVertexWithUV(dimX, (double)var11 * dimY, 0.0D, (double)maxU, (double)var12); + } + + tessellator.draw(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NaturalProperties.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NaturalProperties.java new file mode 100644 index 0000000..e21fb13 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NaturalProperties.java @@ -0,0 +1,28 @@ +package net.minecraft.src; + +public class NaturalProperties { + public int rotation = 1; + public boolean flip = false; + + public NaturalProperties(String type) { + if (type.equals("4")) { + this.rotation = 4; + } else if (type.equals("2")) { + this.rotation = 2; + } else if (type.equals("F")) { + this.flip = true; + } else if (type.equals("4F")) { + this.rotation = 4; + this.flip = true; + } else if (type.equals("2F")) { + this.rotation = 2; + this.flip = true; + } else { + Config.warn("NaturalTextures: Unknown type: " + type); + } + } + + public boolean isValid() { + return this.rotation != 2 && this.rotation != 4 ? this.flip : true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NaturalTextures.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NaturalTextures.java new file mode 100644 index 0000000..974bc92 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NaturalTextures.java @@ -0,0 +1,175 @@ +package net.minecraft.src; + +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class NaturalTextures { + private static NaturalProperties[] propertiesByIndex = new NaturalProperties[0]; + + public static void update() { + propertiesByIndex = new NaturalProperties[0]; + + if (Config.isNaturalTextures()) { + String fileName = "optifine/natural.properties"; + + try { + ResourceLocation e = new ResourceLocation(fileName); + + if (!Config.hasResource(e)) { + Config.dbg("NaturalTextures: configuration \"" + fileName + "\" not found"); + propertiesByIndex = makeDefaultProperties(); + return; + } + + InputStream in = Config.getResourceStream(e); + ArrayList list = new ArrayList(256); + String configStr = Config.readInputStream(in); + in.close(); + String[] configLines = Config.tokenize(configStr, "\n\r"); + Config.dbg("Natural Textures: Parsing configuration \"" + fileName + "\""); + + for (int i = 0; i < configLines.length; ++i) { + String line = configLines[i].trim(); + + if (!line.startsWith("#")) { + String[] strs = Config.tokenize(line, "="); + + if (strs.length != 2) { + Config.warn("Natural Textures: Invalid \"" + fileName + "\" line: " + line); + } else { + String key = strs[0].trim(); + String type = strs[1].trim(); + TextureAtlasSprite ts = TextureMap.textureMapBlocks.getIconSafe(key); + + if (ts == null) { + Config.warn("Natural Textures: Texture not found: \"" + fileName + "\" line: " + line); + } else { + int tileNum = ts.getIndexInMap(); + + if (tileNum < 0) { + Config.warn("Natural Textures: Invalid \"" + fileName + "\" line: " + line); + } else { + NaturalProperties props = new NaturalProperties(type); + + if (props.isValid()) { + while (list.size() <= tileNum) { + list.add((Object)null); + } + + list.set(tileNum, props); + Config.dbg("NaturalTextures: " + key + " = " + type); + } + } + } + } + } + } + + propertiesByIndex = (NaturalProperties[])((NaturalProperties[])list.toArray(new NaturalProperties[list.size()])); + } catch (FileNotFoundException var15) { + Config.warn("NaturalTextures: configuration \"" + fileName + "\" not found"); + propertiesByIndex = makeDefaultProperties(); + return; + } catch (Exception var16) { + var16.printStackTrace(); + } + } + } + + public static NaturalProperties getNaturalProperties(IIcon icon) { + if (!(icon instanceof TextureAtlasSprite)) { + return null; + } else { + TextureAtlasSprite ts = (TextureAtlasSprite)icon; + int tileNum = ts.getIndexInMap(); + + if (tileNum >= 0 && tileNum < propertiesByIndex.length) { + NaturalProperties props = propertiesByIndex[tileNum]; + return props; + } else { + return null; + } + } + } + + private static NaturalProperties[] makeDefaultProperties() { + Config.dbg("NaturalTextures: Checking default configuration."); + ArrayList propsList = new ArrayList(); + setIconProperties(propsList, "grass_top", "4F"); + setIconProperties(propsList, "stone", "2F"); + setIconProperties(propsList, "dirt", "4F"); + setIconProperties(propsList, "grass_side", "F"); + setIconProperties(propsList, "grass_side_overlay", "F"); + setIconProperties(propsList, "stone_slab_top", "F"); + setIconProperties(propsList, "bedrock", "2F"); + setIconProperties(propsList, "sand", "4F"); + setIconProperties(propsList, "gravel", "2"); + setIconProperties(propsList, "log_oak", "2F"); + setIconProperties(propsList, "log_oak_top", "4F"); + setIconProperties(propsList, "gold_ore", "2F"); + setIconProperties(propsList, "iron_ore", "2F"); + setIconProperties(propsList, "coal_ore", "2F"); + setIconProperties(propsList, "diamond_ore", "2F"); + setIconProperties(propsList, "redstone_ore", "2F"); + setIconProperties(propsList, "lapis_ore", "2F"); + setIconProperties(propsList, "obsidian", "4F"); + setIconProperties(propsList, "leaves_oak", "2F"); + setIconProperties(propsList, "leaves_oak_opaque", "2F"); + setIconProperties(propsList, "leaves_jungle", "2"); + setIconProperties(propsList, "leaves_jungle_opaque", "2"); + setIconProperties(propsList, "snow", "4F"); + setIconProperties(propsList, "grass_side_snowed", "F"); + setIconProperties(propsList, "cactus_side", "2F"); + setIconProperties(propsList, "clay", "4F"); + setIconProperties(propsList, "mycelium_side", "F"); + setIconProperties(propsList, "mycelium_top", "4F"); + setIconProperties(propsList, "farmland_wet", "2F"); + setIconProperties(propsList, "farmland_dry", "2F"); + setIconProperties(propsList, "netherrack", "4F"); + setIconProperties(propsList, "soul_sand", "4F"); + setIconProperties(propsList, "glowstone", "4"); + setIconProperties(propsList, "log_spruce", "2F"); + setIconProperties(propsList, "log_birch", "F"); + setIconProperties(propsList, "leaves_spruce", "2F"); + setIconProperties(propsList, "leaves_spruce_opaque", "2F"); + setIconProperties(propsList, "log_jungle", "2F"); + setIconProperties(propsList, "end_stone", "4"); + setIconProperties(propsList, "sandstone_top", "4"); + setIconProperties(propsList, "sandstone_bottom", "4F"); + setIconProperties(propsList, "redstone_lamp_on", "4F"); + NaturalProperties[] terrainProps = (NaturalProperties[])((NaturalProperties[])propsList.toArray(new NaturalProperties[propsList.size()])); + return terrainProps; + } + + private static void setIconProperties(List propsList, String iconName, String propStr) { + TextureMap terrainMap = TextureMap.textureMapBlocks; + TextureAtlasSprite icon = terrainMap.getIconSafe(iconName); + + if (icon == null) { + Config.warn("*** NaturalProperties: Icon not found: " + iconName + " ***"); + } else if (!(icon instanceof TextureAtlasSprite)) { + Config.warn("*** NaturalProperties: Icon is not IconStitched: " + iconName + ": " + icon.getClass().getName() + " ***"); + } else { + TextureAtlasSprite ts = (TextureAtlasSprite)icon; + int index = ts.getIndexInMap(); + + if (index < 0) { + Config.warn("*** NaturalProperties: Invalid index for icon: " + iconName + ": " + index + " ***"); + } else if (Config.isFromDefaultResourcePack(new ResourceLocation("textures/blocks/" + iconName + ".png"))) { + while (index >= propsList.size()) { + propsList.add((Object)null); + } + + NaturalProperties props = new NaturalProperties(propStr); + propsList.set(index, props); + Config.dbg("NaturalTextures: " + iconName + " = " + propStr); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NbtTagValue.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NbtTagValue.java new file mode 100644 index 0000000..64a45b4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NbtTagValue.java @@ -0,0 +1,254 @@ +package net.minecraft.src; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.Set; +import java.util.regex.Pattern; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagByte; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagLong; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.nbt.NBTTagString; +import org.apache.commons.lang3.StringEscapeUtils; + +public class NbtTagValue { + private String[] parents = null; + private String name = null; + private boolean negative = false; + private int type = 0; + private String value = null; + private int valueFormat = 0; + private static final int TYPE_TEXT = 0; + private static final int TYPE_PATTERN = 1; + private static final int TYPE_IPATTERN = 2; + private static final int TYPE_REGEX = 3; + private static final int TYPE_IREGEX = 4; + private static final String PREFIX_PATTERN = "pattern:"; + private static final String PREFIX_IPATTERN = "ipattern:"; + private static final String PREFIX_REGEX = "regex:"; + private static final String PREFIX_IREGEX = "iregex:"; + private static final int FORMAT_DEFAULT = 0; + private static final int FORMAT_HEX_COLOR = 1; + private static final String PREFIX_HEX_COLOR = "#"; + private static final Pattern PATTERN_HEX_COLOR = Pattern.compile("^#[0-9a-f]{6}+$"); + + public NbtTagValue(String tag, String value) { + String[] names = Config.tokenize(tag, "."); + this.parents = (String[])Arrays.copyOfRange(names, 0, names.length - 1); + this.name = names[names.length - 1]; + + if (value.startsWith("!")) { + this.negative = true; + value = value.substring(1); + } + + if (value.startsWith("pattern:")) { + this.type = 1; + value = value.substring("pattern:".length()); + } else if (value.startsWith("ipattern:")) { + this.type = 2; + value = value.substring("ipattern:".length()).toLowerCase(); + } else if (value.startsWith("regex:")) { + this.type = 3; + value = value.substring("regex:".length()); + } else if (value.startsWith("iregex:")) { + this.type = 4; + value = value.substring("iregex:".length()).toLowerCase(); + } else { + this.type = 0; + } + + value = StringEscapeUtils.unescapeJava(value); + + if (this.type == 0 && PATTERN_HEX_COLOR.matcher(value).matches()) { + this.valueFormat = 1; + } + + this.value = value; + } + + public boolean matches(NBTTagCompound nbt) { + return this.negative ? !this.matchesCompound(nbt) : this.matchesCompound(nbt); + } + + public boolean matchesCompound(NBTTagCompound nbt) { + if (nbt == null) { + return false; + } else { + Object tagBase = nbt; + + for (int i = 0; i < this.parents.length; ++i) { + String tag = this.parents[i]; + tagBase = getChildTag((NBTBase)tagBase, tag); + + if (tagBase == null) { + return false; + } + } + + if (this.name.equals("*")) { + return this.matchesAnyChild((NBTBase)tagBase); + } else { + NBTBase var5 = getChildTag((NBTBase)tagBase, this.name); + + if (var5 == null) { + return false; + } else if (this.matchesBase(var5)) { + return true; + } else { + return false; + } + } + } + } + + private boolean matchesAnyChild(NBTBase tagBase) { + if (tagBase instanceof NBTTagCompound) { + NBTTagCompound tagList = (NBTTagCompound)tagBase; + Set count = tagList.func_150296_c(); + Iterator i = count.iterator(); + + while (i.hasNext()) { + String nbtBase = (String)i.next(); + NBTBase nbtBase1 = tagList.getTag(nbtBase); + + if (this.matchesBase(nbtBase1)) { + return true; + } + } + } + + if (tagBase instanceof NBTTagList) { + NBTTagList var7 = (NBTTagList)tagBase; + int var8 = var7.tagCount(); + + for (int var9 = 0; var9 < var8; ++var9) { + NBTTagCompound var10 = var7.getCompoundTagAt(var9); + + if (this.matchesBase(var10)) { + return true; + } + } + } + + return false; + } + + private static NBTBase getChildTag(NBTBase tagBase, String tag) { + if (tagBase instanceof NBTTagCompound) { + NBTTagCompound tagList1 = (NBTTagCompound)tagBase; + return tagList1.getTag(tag); + } else if (tagBase instanceof NBTTagList) { + NBTTagList tagList = (NBTTagList)tagBase; + + if (tag.equals("count")) { + return new NBTTagInt(tagList.tagCount()); + } else { + int index = Config.parseInt(tag, -1); + return index < 0 ? null : tagList.getCompoundTagAt(index); + } + } else { + return null; + } + } + + public boolean matchesBase(NBTBase nbtBase) { + if (nbtBase == null) { + return false; + } else { + String nbtValue = getNbtString(nbtBase, this.valueFormat); + return this.matchesValue(nbtValue); + } + } + + public boolean matchesValue(String nbtValue) { + if (nbtValue == null) { + return false; + } else { + switch (this.type) { + case 0: + return nbtValue.equals(this.value); + + case 1: + return this.matchesPattern(nbtValue, this.value); + + case 2: + return this.matchesPattern(nbtValue.toLowerCase(), this.value); + + case 3: + return this.matchesRegex(nbtValue, this.value); + + case 4: + return this.matchesRegex(nbtValue.toLowerCase(), this.value); + + default: + throw new IllegalArgumentException("Unknown NbtTagValue type: " + this.type); + } + } + } + + private boolean matchesPattern(String str, String pattern) { + return StrUtils.equalsMask(str, pattern, '*', '?'); + } + + private boolean matchesRegex(String str, String regex) { + return str.matches(regex); + } + + private static String getNbtString(NBTBase nbtBase, int format) { + if (nbtBase == null) { + return null; + } else if (nbtBase instanceof NBTTagString) { + NBTTagString d6 = (NBTTagString)nbtBase; + return d6.func_150285_a_(); + } else if (nbtBase instanceof NBTTagInt) { + NBTTagInt d5 = (NBTTagInt)nbtBase; + return format == 1 ? "#" + StrUtils.fillLeft(Integer.toHexString(d5.func_150287_d()), 6, '0') : Integer.toString(d5.func_150287_d()); + } else if (nbtBase instanceof NBTTagByte) { + NBTTagByte d4 = (NBTTagByte)nbtBase; + return Byte.toString(d4.func_150290_f()); + } else if (nbtBase instanceof NBTTagShort) { + NBTTagShort d3 = (NBTTagShort)nbtBase; + return Short.toString(d3.func_150289_e()); + } else if (nbtBase instanceof NBTTagLong) { + NBTTagLong d2 = (NBTTagLong)nbtBase; + return Long.toString(d2.func_150291_c()); + } else if (nbtBase instanceof NBTTagFloat) { + NBTTagFloat d1 = (NBTTagFloat)nbtBase; + return Float.toString(d1.func_150288_h()); + } else if (nbtBase instanceof NBTTagDouble) { + NBTTagDouble d = (NBTTagDouble)nbtBase; + return Double.toString(d.func_150286_g()); + } else { + return nbtBase.toString(); + } + } + + public String toString() { + StringBuffer sb = new StringBuffer(); + + for (int i = 0; i < this.parents.length; ++i) { + String parent = this.parents[i]; + + if (i > 0) { + sb.append("."); + } + + sb.append(parent); + } + + if (sb.length() > 0) { + sb.append("."); + } + + sb.append(this.name); + sb.append(" = "); + sb.append(this.value); + return sb.toString(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NextTickHashSet.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NextTickHashSet.java new file mode 100644 index 0000000..e33ba2c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NextTickHashSet.java @@ -0,0 +1,114 @@ +package net.minecraft.src; + +import java.util.AbstractSet; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import net.minecraft.util.LongHashMap; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.NextTickListEntry; + +public class NextTickHashSet extends AbstractSet { + private LongHashMap longHashMap = new LongHashMap(); + private int size = 0; + private HashSet emptySet = new HashSet(); + + public NextTickHashSet(Set oldSet) { + this.addAll(oldSet); + } + + public int size() { + return this.size; + } + + public boolean contains(Object obj) { + if (!(obj instanceof NextTickListEntry)) { + return false; + } else { + NextTickListEntry entry = (NextTickListEntry)obj; + + if (entry == null) { + return false; + } else { + long key = ChunkCoordIntPair.chunkXZ2Int(entry.xCoord >> 4, entry.zCoord >> 4); + HashSet set = (HashSet)this.longHashMap.getValueByKey(key); + return set == null ? false : set.contains(entry); + } + } + } + + public boolean add(Object obj) { + if (!(obj instanceof NextTickListEntry)) { + return false; + } else { + NextTickListEntry entry = (NextTickListEntry)obj; + + if (entry == null) { + return false; + } else { + long key = ChunkCoordIntPair.chunkXZ2Int(entry.xCoord >> 4, entry.zCoord >> 4); + HashSet set = (HashSet)this.longHashMap.getValueByKey(key); + + if (set == null) { + set = new HashSet(); + this.longHashMap.add(key, set); + } + + boolean added = set.add(entry); + + if (added) { + ++this.size; + } + + return added; + } + } + } + + public boolean remove(Object obj) { + if (!(obj instanceof NextTickListEntry)) { + return false; + } else { + NextTickListEntry entry = (NextTickListEntry)obj; + + if (entry == null) { + return false; + } else { + long key = ChunkCoordIntPair.chunkXZ2Int(entry.xCoord >> 4, entry.zCoord >> 4); + HashSet set = (HashSet)this.longHashMap.getValueByKey(key); + + if (set == null) { + return false; + } else { + boolean removed = set.remove(entry); + + if (removed) { + --this.size; + } + + return removed; + } + } + } + } + + public Iterator getNextTickEntries(int chunkX, int chunkZ) { + HashSet set = this.getNextTickEntriesSet(chunkX, chunkZ); + return set.iterator(); + } + + public HashSet getNextTickEntriesSet(int chunkX, int chunkZ) { + long key = ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ); + HashSet set = (HashSet)this.longHashMap.getValueByKey(key); + + if (set == null) { + set = this.emptySet; + } + + return set; + } + + public Iterator iterator() { + throw new UnsupportedOperationException("Not implemented"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NumUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NumUtils.java new file mode 100644 index 0000000..c23e7df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/NumUtils.java @@ -0,0 +1,7 @@ +package net.minecraft.src; + +public class NumUtils { + public static float limit(float val, float min, float max) { + return val < min ? min : (val > max ? max : val); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfiguration.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfiguration.java new file mode 100644 index 0000000..bd80420 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfiguration.java @@ -0,0 +1,34 @@ +package net.minecraft.src; + +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; + +public class PlayerConfiguration { + private PlayerItemModel[] playerItemModels = new PlayerItemModel[0]; + private boolean initialized = false; + + public void renderPlayerItems(ModelBiped modelBiped, AbstractClientPlayer player, float scale, float partialTicks) { + if (this.initialized) { + for (int i = 0; i < this.playerItemModels.length; ++i) { + PlayerItemModel model = this.playerItemModels[i]; + model.render(modelBiped, player, scale, partialTicks); + } + } + } + + public boolean isInitialized() { + return this.initialized; + } + + public void setInitialized(boolean initialized) { + this.initialized = initialized; + } + + public PlayerItemModel[] getPlayerItemModels() { + return this.playerItemModels; + } + + public void addPlayerItemModel(PlayerItemModel playerItemModel) { + this.playerItemModels = (PlayerItemModel[])((PlayerItemModel[])Config.addObjectToArray(this.playerItemModels, playerItemModel)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurationParser.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurationParser.java new file mode 100644 index 0000000..fd28158 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurationParser.java @@ -0,0 +1,111 @@ +package net.minecraft.src; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; + +public class PlayerConfigurationParser { + private String player = null; + public static final String CONFIG_ITEMS = "items"; + public static final String ITEM_TYPE = "type"; + public static final String ITEM_ACTIVE = "active"; + + public PlayerConfigurationParser(String player) { + this.player = player; + } + + public PlayerConfiguration parsePlayerConfiguration(JsonElement je) { + if (je == null) { + throw new JsonParseException("JSON object is null, player: " + this.player); + } else { + JsonObject jo = (JsonObject)je; + PlayerConfiguration pc = new PlayerConfiguration(); + JsonArray items = (JsonArray)jo.get("items"); + + if (items != null) { + for (int i = 0; i < items.size(); ++i) { + JsonObject item = (JsonObject)items.get(i); + boolean active = Json.getBoolean(item, "active", true); + + if (active) { + String type = Json.getString(item, "type"); + + if (type == null) { + Config.warn("Item type is null, player: " + this.player); + } else { + String modelPath = Json.getString(item, "model"); + + if (modelPath == null) { + modelPath = "items/" + type + "/model.cfg"; + } + + PlayerItemModel model = this.downloadModel(modelPath); + + if (model != null) { + if (!model.isUsePlayerTexture()) { + String texturePath = Json.getString(item, "texture"); + + if (texturePath == null) { + texturePath = "items/" + type + "/users/" + this.player + ".png"; + } + + BufferedImage image = this.downloadTextureImage(texturePath); + + if (image == null) { + continue; + } + + model.setTextureImage(image); + ResourceLocation loc = new ResourceLocation("optifine.net", texturePath); + model.setTextureLocation(loc); + } + + pc.addPlayerItemModel(model); + } + } + } + } + } + + return pc; + } + } + + private BufferedImage downloadTextureImage(String texturePath) { + String textureUrl = HttpUtils.getPlayerItemsUrl() + "/" + texturePath; + + try { + byte[] e = HttpPipeline.get(textureUrl, Minecraft.getMinecraft().getProxy()); + BufferedImage image = ImageIO.read(new ByteArrayInputStream(e)); + return image; + } catch (IOException var5) { + Config.warn("Error loading item texture " + texturePath + ": " + var5.getClass().getName() + ": " + var5.getMessage()); + return null; + } + } + + private PlayerItemModel downloadModel(String modelPath) { + String modelUrl = HttpUtils.getPlayerItemsUrl() + "/" + modelPath; + + try { + byte[] e = HttpPipeline.get(modelUrl, Minecraft.getMinecraft().getProxy()); + String jsonStr = new String(e, "ASCII"); + JsonParser jp = new JsonParser(); + JsonObject jo = (JsonObject)jp.parse(jsonStr); + PlayerItemParser pip = new PlayerItemParser(); + PlayerItemModel pim = PlayerItemParser.parseItemModel(jo); + return pim; + } catch (Exception var9) { + Config.warn("Error loading item model " + modelPath + ": " + var9.getClass().getName() + ": " + var9.getMessage()); + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurationReceiver.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurationReceiver.java new file mode 100644 index 0000000..e31dcff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurationReceiver.java @@ -0,0 +1,31 @@ +package net.minecraft.src; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + +public class PlayerConfigurationReceiver implements IFileDownloadListener { + private String player = null; + + public PlayerConfigurationReceiver(String player) { + this.player = player; + } + + public void fileDownloadFinished(String url, byte[] bytes, Throwable exception) { + if (bytes != null) { + try { + String e = new String(bytes, "ASCII"); + JsonParser jp = new JsonParser(); + JsonElement je = jp.parse(e); + PlayerConfigurationParser pcp = new PlayerConfigurationParser(this.player); + PlayerConfiguration pc = pcp.parsePlayerConfiguration(je); + + if (pc != null) { + pc.setInitialized(true); + PlayerConfigurations.setPlayerConfiguration(this.player, pc); + } + } catch (Exception var9) { + Config.dbg("Error parsing configuration: " + url + ", " + var9.getClass().getName() + ": " + var9.getMessage()); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurations.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurations.java new file mode 100644 index 0000000..e2a4610 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerConfigurations.java @@ -0,0 +1,64 @@ +package net.minecraft.src; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.model.ModelBiped; + +public class PlayerConfigurations { + private static Map mapConfigurations = null; + private static boolean reloadPlayerItems = Boolean.getBoolean("player.models.reload"); + private static long timeReloadPlayerItemsMs = System.currentTimeMillis(); + + public static void renderPlayerItems(ModelBiped modelBiped, AbstractClientPlayer player, float scale, float partialTicks) { + PlayerConfiguration cfg = getPlayerConfiguration(player); + + if (cfg != null) { + cfg.renderPlayerItems(modelBiped, player, scale, partialTicks); + } + } + + public static synchronized PlayerConfiguration getPlayerConfiguration(AbstractClientPlayer player) { + if (reloadPlayerItems && System.currentTimeMillis() > timeReloadPlayerItemsMs + 5000L) { + EntityClientPlayerMP name = Minecraft.getMinecraft().thePlayer; + + if (name != null) { + setPlayerConfiguration(name.getNameClear(), (PlayerConfiguration)null); + timeReloadPlayerItemsMs = System.currentTimeMillis(); + } + } + + String name1 = player.getNameClear(); + + if (name1 == null) { + return null; + } else { + PlayerConfiguration pc = (PlayerConfiguration)getMapConfigurations().get(name1); + + if (pc == null) { + pc = new PlayerConfiguration(); + getMapConfigurations().put(name1, pc); + PlayerConfigurationReceiver pcl = new PlayerConfigurationReceiver(name1); + String url = HttpUtils.getPlayerItemsUrl() + "/users/" + name1 + ".cfg"; + FileDownloadThread fdt = new FileDownloadThread(url, pcl); + fdt.start(); + } + + return pc; + } + } + + public static synchronized void setPlayerConfiguration(String player, PlayerConfiguration pc) { + getMapConfigurations().put(player, pc); + } + + private static Map getMapConfigurations() { + if (mapConfigurations == null) { + mapConfigurations = new HashMap(); + } + + return mapConfigurations; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemModel.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemModel.java new file mode 100644 index 0000000..ea659db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemModel.java @@ -0,0 +1,113 @@ +package net.minecraft.src; + +import java.awt.Dimension; +import java.awt.image.BufferedImage; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class PlayerItemModel { + private Dimension textureSize = null; + private boolean usePlayerTexture = false; + private PlayerItemRenderer[] modelRenderers = new PlayerItemRenderer[0]; + private ResourceLocation textureLocation = null; + private BufferedImage textureImage = null; + private DynamicTexture texture = null; + private ResourceLocation locationMissing = new ResourceLocation("textures/blocks/wool_colored_red.png"); + public static final int ATTACH_BODY = 0; + public static final int ATTACH_HEAD = 1; + public static final int ATTACH_LEFT_ARM = 2; + public static final int ATTACH_RIGHT_ARM = 3; + public static final int ATTACH_LEFT_LEG = 4; + public static final int ATTACH_RIGHT_LEG = 5; + public static final int ATTACH_CAPE = 6; + + public PlayerItemModel(Dimension textureSize, boolean usePlayerTexture, PlayerItemRenderer[] modelRenderers) { + this.textureSize = textureSize; + this.usePlayerTexture = usePlayerTexture; + this.modelRenderers = modelRenderers; + } + + public void render(ModelBiped modelBiped, AbstractClientPlayer player, float scale, float partialTicks) { + TextureManager textureManager = Config.getTextureManager(); + + if (this.usePlayerTexture) { + textureManager.bindTexture(player.getLocationSkin()); + } else if (this.textureLocation != null) { + if (this.texture == null && this.textureImage != null) { + this.texture = new DynamicTexture(this.textureImage); + Minecraft.getMinecraft().getTextureManager().loadTexture(this.textureLocation, this.texture); + } + + textureManager.bindTexture(this.textureLocation); + } else { + textureManager.bindTexture(this.locationMissing); + } + + for (int i = 0; i < this.modelRenderers.length; ++i) { + PlayerItemRenderer pir = this.modelRenderers[i]; + GL11.glPushMatrix(); + + if (player.isSneaking()) { + GL11.glTranslatef(0.0F, 0.2F, 0.0F); + } + + pir.render(modelBiped, scale); + GL11.glPopMatrix(); + } + } + + public static ModelRenderer getAttachModel(ModelBiped modelBiped, int attachTo) { + switch (attachTo) { + case 0: + return modelBiped.bipedBody; + + case 1: + return modelBiped.bipedHead; + + case 2: + return modelBiped.bipedLeftArm; + + case 3: + return modelBiped.bipedRightArm; + + case 4: + return modelBiped.bipedLeftLeg; + + case 5: + return modelBiped.bipedRightLeg; + + default: + return null; + } + } + + public BufferedImage getTextureImage() { + return this.textureImage; + } + + public void setTextureImage(BufferedImage textureImage) { + this.textureImage = textureImage; + } + + public DynamicTexture getTexture() { + return this.texture; + } + + public ResourceLocation getTextureLocation() { + return this.textureLocation; + } + + public void setTextureLocation(ResourceLocation textureLocation) { + this.textureLocation = textureLocation; + } + + public boolean isUsePlayerTexture() { + return this.usePlayerTexture; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemParser.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemParser.java new file mode 100644 index 0000000..19ae0ff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemParser.java @@ -0,0 +1,309 @@ +package net.minecraft.src; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.awt.Dimension; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.util.ResourceLocation; + +public class PlayerItemParser { + private static JsonParser jsonParser = new JsonParser(); + public static final String ITEM_TYPE = "type"; + public static final String ITEM_TEXTURE_SIZE = "textureSize"; + public static final String ITEM_USE_PLAYER_TEXTURE = "usePlayerTexture"; + public static final String ITEM_MODELS = "models"; + public static final String MODEL_ID = "id"; + public static final String MODEL_BASE_ID = "baseId"; + public static final String MODEL_TYPE = "type"; + public static final String MODEL_ATTACH_TO = "attachTo"; + public static final String MODEL_INVERT_AXIS = "invertAxis"; + public static final String MODEL_MIRROR_TEXTURE = "mirrorTexture"; + public static final String MODEL_TRANSLATE = "translate"; + public static final String MODEL_ROTATE = "rotate"; + public static final String MODEL_SCALE = "scale"; + public static final String MODEL_BOXES = "boxes"; + public static final String MODEL_SPRITES = "sprites"; + public static final String MODEL_SUBMODEL = "submodel"; + public static final String MODEL_SUBMODELS = "submodels"; + public static final String BOX_TEXTURE_OFFSET = "textureOffset"; + public static final String BOX_COORDINATES = "coordinates"; + public static final String BOX_SIZE_ADD = "sizeAdd"; + public static final String ITEM_TYPE_MODEL = "PlayerItem"; + public static final String MODEL_TYPE_BOX = "ModelBox"; + + public static PlayerItemModel parseItemModel(JsonObject obj) { + String type = Json.getString(obj, "type"); + + if (!Config.equals(type, "PlayerItem")) { + throw new JsonParseException("Unknown model type: " + type); + } else { + int[] textureSize = Json.parseIntArray(obj.get("textureSize"), 2); + checkNull(textureSize, "Missing texture size"); + Dimension textureDim = new Dimension(textureSize[0], textureSize[1]); + boolean usePlayerTexture = Json.getBoolean(obj, "usePlayerTexture", false); + JsonArray models = (JsonArray)obj.get("models"); + checkNull(models, "Missing elements"); + HashMap mapModelJsons = new HashMap(); + ArrayList listModels = new ArrayList(); + new ArrayList(); + + for (int modelRenderers = 0; modelRenderers < models.size(); ++modelRenderers) { + JsonObject elem = (JsonObject)models.get(modelRenderers); + String baseId = Json.getString(elem, "baseId"); + + if (baseId != null) { + JsonObject id = (JsonObject)mapModelJsons.get(baseId); + + if (id == null) { + Config.warn("BaseID not found: " + baseId); + continue; + } + + Set mr = id.entrySet(); + Iterator iterator = mr.iterator(); + + while (iterator.hasNext()) { + Entry entry = (Entry)iterator.next(); + + if (!elem.has((String)entry.getKey())) { + elem.add((String)entry.getKey(), (JsonElement)entry.getValue()); + } + } + } + + String var17 = Json.getString(elem, "id"); + + if (var17 != null) { + if (!mapModelJsons.containsKey(var17)) { + mapModelJsons.put(var17, elem); + } else { + Config.warn("Duplicate model ID: " + var17); + } + } + + PlayerItemRenderer var18 = parseItemRenderer(elem, textureDim); + + if (var18 != null) { + listModels.add(var18); + } + } + + PlayerItemRenderer[] var16 = (PlayerItemRenderer[])((PlayerItemRenderer[])listModels.toArray(new PlayerItemRenderer[listModels.size()])); + return new PlayerItemModel(textureDim, usePlayerTexture, var16); + } + } + + private static void checkNull(Object obj, String msg) { + if (obj == null) { + throw new JsonParseException(msg); + } + } + + private static ResourceLocation makeResourceLocation(String texture) { + int pos = texture.indexOf(58); + + if (pos < 0) { + return new ResourceLocation(texture); + } else { + String domain = texture.substring(0, pos); + String path = texture.substring(pos + 1); + return new ResourceLocation(domain, path); + } + } + + private static int parseAttachModel(String attachModelStr) { + if (attachModelStr == null) { + return 0; + } else if (attachModelStr.equals("body")) { + return 0; + } else if (attachModelStr.equals("head")) { + return 1; + } else if (attachModelStr.equals("leftArm")) { + return 2; + } else if (attachModelStr.equals("rightArm")) { + return 3; + } else if (attachModelStr.equals("leftLeg")) { + return 4; + } else if (attachModelStr.equals("rightLeg")) { + return 5; + } else if (attachModelStr.equals("cape")) { + return 6; + } else { + Config.warn("Unknown attachModel: " + attachModelStr); + return 0; + } + } + + private static PlayerItemRenderer parseItemRenderer(JsonObject elem, Dimension textureDim) { + String type = Json.getString(elem, "type"); + + if (!Config.equals(type, "ModelBox")) { + Config.warn("Unknown model type: " + type); + return null; + } else { + String attachToStr = Json.getString(elem, "attachTo"); + int attachTo = parseAttachModel(attachToStr); + float scale = Json.getFloat(elem, "scale", 1.0F); + ModelPlayerItem modelBase = new ModelPlayerItem(); + modelBase.textureWidth = textureDim.width; + modelBase.textureHeight = textureDim.height; + ModelRenderer mr = parseModelRenderer(elem, modelBase); + PlayerItemRenderer pir = new PlayerItemRenderer(attachTo, scale, mr); + return pir; + } + } + + private static ModelRenderer parseModelRenderer(JsonObject elem, ModelBase modelBase) { + ModelRenderer mr = new ModelRenderer(modelBase); + String invertAxis = Json.getString(elem, "invertAxis", "").toLowerCase(); + boolean invertX = invertAxis.contains("x"); + boolean invertY = invertAxis.contains("y"); + boolean invertZ = invertAxis.contains("z"); + float[] translate = Json.parseFloatArray(elem.get("translate"), 3, new float[3]); + + if (invertX) { + translate[0] = -translate[0]; + } + + if (invertY) { + translate[1] = -translate[1]; + } + + if (invertZ) { + translate[2] = -translate[2]; + } + + float[] rotateAngles = Json.parseFloatArray(elem.get("rotate"), 3, new float[3]); + + for (int mirrorTexture = 0; mirrorTexture < rotateAngles.length; ++mirrorTexture) { + rotateAngles[mirrorTexture] = rotateAngles[mirrorTexture] / 180.0F * (float)Math.PI; + } + + if (invertX) { + rotateAngles[0] = -rotateAngles[0]; + } + + if (invertY) { + rotateAngles[1] = -rotateAngles[1]; + } + + if (invertZ) { + rotateAngles[2] = -rotateAngles[2]; + } + + mr.setRotationPoint(translate[0], translate[1], translate[2]); + mr.rotateAngleX = rotateAngles[0]; + mr.rotateAngleY = rotateAngles[1]; + mr.rotateAngleZ = rotateAngles[2]; + String var19 = Json.getString(elem, "mirrorTexture", "").toLowerCase(); + boolean invertU = var19.contains("u"); + boolean invertV = var19.contains("v"); + + if (invertU) { + mr.mirror = true; + } + + if (invertV) { + mr.mirrorV = true; + } + + JsonArray boxes = elem.getAsJsonArray("boxes"); + JsonObject submodel; + + if (boxes != null) { + for (int sprites = 0; sprites < boxes.size(); ++sprites) { + submodel = boxes.get(sprites).getAsJsonObject(); + int[] submodels = Json.parseIntArray(submodel.get("textureOffset"), 2); + + if (submodels == null) { + throw new JsonParseException("Texture offset not specified"); + } + + float[] i = Json.parseFloatArray(submodel.get("coordinates"), 6); + + if (i == null) { + throw new JsonParseException("Coordinates not specified"); + } + + if (invertX) { + i[0] = -i[0] - i[3]; + } + + if (invertY) { + i[1] = -i[1] - i[4]; + } + + if (invertZ) { + i[2] = -i[2] - i[5]; + } + + float sm = Json.getFloat(submodel, "sizeAdd", 0.0F); + mr.setTextureOffset(submodels[0], submodels[1]); + mr.addBox(i[0], i[1], i[2], (int)i[3], (int)i[4], (int)i[5], sm); + } + } + + JsonArray var20 = elem.getAsJsonArray("sprites"); + + if (var20 != null) { + for (int var21 = 0; var21 < var20.size(); ++var21) { + JsonObject var22 = var20.get(var21).getAsJsonObject(); + int[] var25 = Json.parseIntArray(var22.get("textureOffset"), 2); + + if (var25 == null) { + throw new JsonParseException("Texture offset not specified"); + } + + float[] var27 = Json.parseFloatArray(var22.get("coordinates"), 6); + + if (var27 == null) { + throw new JsonParseException("Coordinates not specified"); + } + + if (invertX) { + var27[0] = -var27[0] - var27[3]; + } + + if (invertY) { + var27[1] = -var27[1] - var27[4]; + } + + if (invertZ) { + var27[2] = -var27[2] - var27[5]; + } + + float subMr = Json.getFloat(var22, "sizeAdd", 0.0F); + mr.setTextureOffset(var25[0], var25[1]); + mr.addSprite(var27[0], var27[1], var27[2], (int)var27[3], (int)var27[4], (int)var27[5], subMr); + } + } + + submodel = (JsonObject)elem.get("submodel"); + + if (submodel != null) { + ModelRenderer var23 = parseModelRenderer(submodel, modelBase); + mr.addChild(var23); + } + + JsonArray var24 = (JsonArray)elem.get("submodels"); + + if (var24 != null) { + for (int var26 = 0; var26 < var24.size(); ++var26) { + JsonObject var28 = (JsonObject)var24.get(var26); + ModelRenderer var29 = parseModelRenderer(var28, modelBase); + mr.addChild(var29); + } + } + + return mr; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemRenderer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemRenderer.java new file mode 100644 index 0000000..2171da7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PlayerItemRenderer.java @@ -0,0 +1,30 @@ +package net.minecraft.src; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; + +public class PlayerItemRenderer { + private int attachTo = 0; + private float scaleFactor = 0.0F; + private ModelRenderer modelRenderer = null; + + public PlayerItemRenderer(int attachTo, float scaleFactor, ModelRenderer modelRenderer) { + this.attachTo = attachTo; + this.scaleFactor = scaleFactor; + this.modelRenderer = modelRenderer; + } + + public ModelRenderer getModelRenderer() { + return this.modelRenderer; + } + + public void render(ModelBiped modelBiped, float scale) { + ModelRenderer attachModel = PlayerItemModel.getAttachModel(modelBiped, this.attachTo); + + if (attachModel != null) { + attachModel.postRender(scale); + } + + this.modelRenderer.render(scale * this.scaleFactor); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PropertiesOrdered.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PropertiesOrdered.java new file mode 100644 index 0000000..867a29b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/PropertiesOrdered.java @@ -0,0 +1,26 @@ +package net.minecraft.src; + +import java.util.Collections; +import java.util.Enumeration; +import java.util.LinkedHashSet; +import java.util.Properties; +import java.util.Set; + +public class PropertiesOrdered extends Properties { + private Set keysOrdered = new LinkedHashSet(); + + public synchronized Object put(Object key, Object value) { + this.keysOrdered.add(key); + return super.put(key, value); + } + + public Set keySet() { + Set keysParent = super.keySet(); + this.keysOrdered.retainAll(keysParent); + return Collections.unmodifiableSet(this.keysOrdered); + } + + public synchronized Enumeration keys() { + return Collections.enumeration(this.keySet()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobs.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobs.java new file mode 100644 index 0000000..4dee309 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobs.java @@ -0,0 +1,354 @@ +package net.minecraft.src; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Random; +import java.util.UUID; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class RandomMobs { + private static Map locationProperties = new HashMap(); + private static RenderGlobal renderGlobal = null; + private static boolean initialized = false; + private static Random random = new Random(); + private static boolean working = false; + public static final String SUFFIX_PNG = ".png"; + public static final String SUFFIX_PROPERTIES = ".properties"; + public static final String PREFIX_TEXTURES_ENTITY = "textures/entity/"; + public static final String PREFIX_MCPATCHER_MOB = "mcpatcher/mob/"; + private static final String[] DEPENDANT_SUFFIXES = new String[] {"_armor", "_eyes", "_exploding", "_shooting", "_fur", "_eyes", "_invulnerable", "_angry", "_tame", "_collar"}; + + public static void entityLoaded(Entity entity, World world) { + if (entity instanceof EntityLiving) { + if (world != null) { + EntityLiving el = (EntityLiving)entity; + el.spawnPosition = new BlockPos((int)el.posX, (int)el.posY, (int)el.posZ); + el.spawnBiome = world.getBiomeGenForCoords((int)el.posX, (int)el.posZ); + WorldServer ws = Config.getWorldServer(); + + if (ws != null) { + Entity es = ws.getEntityByID(entity.getEntityId()); + + if (es instanceof EntityLiving) { + EntityLiving els = (EntityLiving)es; + UUID uuid = els.getUniqueID(); + + if (el instanceof EntityVillager && es instanceof EntityVillager) { + updateEntityVillager((EntityVillager)el, (EntityVillager)els); + } + + long uuidLow = uuid.getLeastSignificantBits(); + int id = (int)(uuidLow & 2147483647L); + el.randomMobsId = id; + } + } + } + } + } + + private static void updateEntityVillager(EntityVillager ev, EntityVillager evs) { + int profSev = evs.getProfession(); + ev.setProfession(profSev); + } + + public static void worldChanged(World oldWorld, World newWorld) { + if (newWorld != null) { + List entityList = newWorld.getLoadedEntityList(); + + for (int e = 0; e < entityList.size(); ++e) { + Entity entity = (Entity)entityList.get(e); + entityLoaded(entity, newWorld); + } + } + } + + public static ResourceLocation getTextureLocation(ResourceLocation loc) { + if (working) { + return loc; + } else { + ResourceLocation entityLiving; + + try { + working = true; + + if (!initialized) { + initialize(); + } + + if (renderGlobal == null) { + ResourceLocation entity1 = loc; + return entity1; + } + + Entity entity = renderGlobal.renderedEntity; + + if (entity instanceof EntityLiving) { + EntityLiving entityLiving1 = (EntityLiving)entity; + String name = loc.getResourcePath(); + + if (!name.startsWith("textures/entity/")) { + ResourceLocation props1 = loc; + return props1; + } + + RandomMobsProperties props = getProperties(loc); + ResourceLocation var5; + + if (props == null) { + var5 = loc; + return var5; + } + + var5 = props.getTextureLocation(loc, entityLiving1); + return var5; + } + + entityLiving = loc; + } finally { + working = false; + } + + return entityLiving; + } + } + + private static RandomMobsProperties getProperties(ResourceLocation loc) { + String name = loc.getResourcePath(); + RandomMobsProperties props = (RandomMobsProperties)locationProperties.get(name); + + if (props == null) { + props = makeProperties(loc); + locationProperties.put(name, props); + } + + return props; + } + + private static RandomMobsProperties makeProperties(ResourceLocation loc) { + String path = loc.getResourcePath(); + ResourceLocation propLoc = getPropertyLocation(loc); + + if (propLoc != null) { + RandomMobsProperties variants = parseProperties(propLoc, loc); + + if (variants != null) { + return variants; + } + } + + ResourceLocation[] variants1 = getTextureVariants(loc); + return new RandomMobsProperties(path, variants1); + } + + private static RandomMobsProperties parseProperties(ResourceLocation propLoc, ResourceLocation resLoc) { + try { + String e = propLoc.getResourcePath(); + Config.dbg("RandomMobs: " + resLoc.getResourcePath() + ", variants: " + e); + InputStream in = Config.getResourceStream(propLoc); + + if (in == null) { + Config.warn("RandomMobs properties not found: " + e); + return null; + } else { + Properties props = new Properties(); + props.load(in); + in.close(); + RandomMobsProperties rmp = new RandomMobsProperties(props, e, resLoc); + return !rmp.isValid(e) ? null : rmp; + } + } catch (FileNotFoundException var6) { + Config.warn("RandomMobs file not found: " + resLoc.getResourcePath()); + return null; + } catch (IOException var7) { + var7.printStackTrace(); + return null; + } + } + + private static ResourceLocation getPropertyLocation(ResourceLocation loc) { + ResourceLocation locMcp = getMcpatcherLocation(loc); + + if (locMcp == null) { + return null; + } else { + String domain = locMcp.getResourceDomain(); + String path = locMcp.getResourcePath(); + String pathBase = path; + + if (path.endsWith(".png")) { + pathBase = path.substring(0, path.length() - ".png".length()); + } + + String pathProps = pathBase + ".properties"; + ResourceLocation locProps = new ResourceLocation(domain, pathProps); + + if (Config.hasResource(locProps)) { + return locProps; + } else { + String pathParent = getParentPath(pathBase); + + if (pathParent == null) { + return null; + } else { + ResourceLocation locParentProps = new ResourceLocation(domain, pathParent + ".properties"); + return Config.hasResource(locParentProps) ? locParentProps : null; + } + } + } + } + + public static ResourceLocation getMcpatcherLocation(ResourceLocation loc) { + String path = loc.getResourcePath(); + + if (!path.startsWith("textures/entity/")) { + return null; + } else { + String pathMcp = "mcpatcher/mob/" + path.substring("textures/entity/".length()); + return new ResourceLocation(loc.getResourceDomain(), pathMcp); + } + } + + public static ResourceLocation getLocationIndexed(ResourceLocation loc, int index) { + if (loc == null) { + return null; + } else { + String path = loc.getResourcePath(); + int pos = path.lastIndexOf(46); + + if (pos < 0) { + return null; + } else { + String prefix = path.substring(0, pos); + String suffix = path.substring(pos); + String pathNew = prefix + index + suffix; + ResourceLocation locNew = new ResourceLocation(loc.getResourceDomain(), pathNew); + return locNew; + } + } + } + + private static String getParentPath(String path) { + for (int i = 0; i < DEPENDANT_SUFFIXES.length; ++i) { + String suffix = DEPENDANT_SUFFIXES[i]; + + if (path.endsWith(suffix)) { + String pathParent = path.substring(0, path.length() - suffix.length()); + return pathParent; + } + } + + return null; + } + + private static ResourceLocation[] getTextureVariants(ResourceLocation loc) { + ArrayList list = new ArrayList(); + list.add(loc); + ResourceLocation locMcp = getMcpatcherLocation(loc); + + if (locMcp == null) { + return null; + } else { + for (int locs = 1; locs < list.size() + 10; ++locs) { + int index = locs + 1; + ResourceLocation locIndex = getLocationIndexed(locMcp, index); + + if (Config.hasResource(locIndex)) { + list.add(locIndex); + } + } + + if (list.size() <= 1) { + return null; + } else { + ResourceLocation[] var6 = (ResourceLocation[])((ResourceLocation[])list.toArray(new ResourceLocation[list.size()])); + Config.dbg("RandomMobs: " + loc.getResourcePath() + ", variants: " + var6.length); + return var6; + } + } + } + + public static void resetTextures() { + locationProperties.clear(); + + if (Config.isRandomMobs()) { + initialize(); + } + } + + private static void initialize() { + renderGlobal = Config.getRenderGlobal(); + + if (renderGlobal != null) { + initialized = true; + ArrayList list = new ArrayList(); + list.add("bat"); + list.add("blaze"); + list.add("cat/black"); + list.add("cat/ocelot"); + list.add("cat/red"); + list.add("cat/siamese"); + list.add("chicken"); + list.add("cow/cow"); + list.add("cow/mooshroom"); + list.add("creeper/creeper"); + list.add("enderman/enderman"); + list.add("enderman/enderman_eyes"); + list.add("ghast/ghast"); + list.add("ghast/ghast_shooting"); + list.add("iron_golem"); + list.add("pig/pig"); + list.add("sheep/sheep"); + list.add("sheep/sheep_fur"); + list.add("silverfish"); + list.add("skeleton/skeleton"); + list.add("skeleton/wither_skeleton"); + list.add("slime/slime"); + list.add("slime/magmacube"); + list.add("snowman"); + list.add("spider/cave_spider"); + list.add("spider/spider"); + list.add("spider_eyes"); + list.add("squid"); + list.add("villager/villager"); + list.add("villager/butcher"); + list.add("villager/farmer"); + list.add("villager/librarian"); + list.add("villager/priest"); + list.add("villager/smith"); + list.add("wither/wither"); + list.add("wither/wither_armor"); + list.add("wither/wither_invulnerable"); + list.add("wolf/wolf"); + list.add("wolf/wolf_angry"); + list.add("wolf/wolf_collar"); + list.add("wolf/wolf_tame"); + list.add("zombie_pigman"); + list.add("zombie/zombie"); + list.add("zombie/zombie_villager"); + + for (int i = 0; i < list.size(); ++i) { + String name = (String)list.get(i); + String tex = "textures/entity/" + name + ".png"; + ResourceLocation texLoc = new ResourceLocation(tex); + + if (!Config.hasResource(texLoc)) { + Config.warn("Not found: " + texLoc); + } + + getProperties(texLoc); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobsProperties.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobsProperties.java new file mode 100644 index 0000000..b6dba60 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobsProperties.java @@ -0,0 +1,154 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.Properties; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; + +public class RandomMobsProperties { + public String name = null; + public String basePath = null; + public ResourceLocation[] resourceLocations = null; + public RandomMobsRule[] rules = null; + + public RandomMobsProperties(String path, ResourceLocation[] variants) { + ConnectedParser cp = new ConnectedParser("RandomMobs"); + this.name = cp.parseName(path); + this.basePath = cp.parseBasePath(path); + this.resourceLocations = variants; + } + + public RandomMobsProperties(Properties props, String path, ResourceLocation baseResLoc) { + ConnectedParser cp = new ConnectedParser("RandomMobs"); + this.name = cp.parseName(path); + this.basePath = cp.parseBasePath(path); + this.rules = this.parseRules(props, path, baseResLoc, cp); + } + + public ResourceLocation getTextureLocation(ResourceLocation loc, EntityLiving el) { + int randomId; + + if (this.rules != null) { + for (randomId = 0; randomId < this.rules.length; ++randomId) { + RandomMobsRule index = this.rules[randomId]; + + if (index.matches(el)) { + return index.getTextureLocation(loc, el.randomMobsId); + } + } + } + + if (this.resourceLocations != null) { + randomId = el.randomMobsId; + int var5 = randomId % this.resourceLocations.length; + return this.resourceLocations[var5]; + } else { + return loc; + } + } + + private RandomMobsRule[] parseRules(Properties props, String path, ResourceLocation baseResLoc, ConnectedParser cp) { + ArrayList list = new ArrayList(); + int count = props.size(); + + for (int rules = 0; rules < count; ++rules) { + int index = rules + 1; + String valSkins = props.getProperty("skins." + index); + + if (valSkins != null) { + int[] skins = cp.parseIntList(valSkins); + int[] weights = cp.parseIntList(props.getProperty("weights." + index)); + BiomeGenBase[] biomes = cp.parseBiomes(props.getProperty("biomes." + index)); + RangeListInt heights = cp.parseRangeListInt(props.getProperty("heights." + index)); + + if (heights == null) { + heights = this.parseMinMaxHeight(props, index); + } + + NbtTagValue nbtName = cp.parseNbtTagValue("name", props.getProperty("name." + index)); + VillagerProfession[] professions = cp.parseProfessions(props.getProperty("professions." + index)); + RandomMobsRule rule = new RandomMobsRule(baseResLoc, index, skins, weights, biomes, heights, nbtName, professions); + + if (rule.isValid(path)) { + list.add(rule); + } + } + } + + RandomMobsRule[] var17 = (RandomMobsRule[])((RandomMobsRule[])list.toArray(new RandomMobsRule[list.size()])); + return var17; + } + + private RangeListInt parseMinMaxHeight(Properties props, int index) { + String minHeightStr = props.getProperty("minHeight." + index); + String maxHeightStr = props.getProperty("maxHeight." + index); + + if (minHeightStr == null && maxHeightStr == null) { + return null; + } else { + int minHeight = 0; + + if (minHeightStr != null) { + minHeight = Config.parseInt(minHeightStr, -1); + + if (minHeight < 0) { + Config.warn("Invalid minHeight: " + minHeightStr); + return null; + } + } + + int maxHeight = 256; + + if (maxHeightStr != null) { + maxHeight = Config.parseInt(maxHeightStr, -1); + + if (maxHeight < 0) { + Config.warn("Invalid maxHeight: " + maxHeightStr); + return null; + } + } + + if (maxHeight < 0) { + Config.warn("Invalid minHeight, maxHeight: " + minHeightStr + ", " + maxHeightStr); + return null; + } else { + RangeListInt list = new RangeListInt(); + list.addRange(new RangeInt(minHeight, maxHeight)); + return list; + } + } + } + + public boolean isValid(String path) { + if (this.resourceLocations == null && this.rules == null) { + Config.warn("No skins specified: " + path); + return false; + } else { + int i; + + if (this.rules != null) { + for (i = 0; i < this.rules.length; ++i) { + RandomMobsRule loc = this.rules[i]; + + if (!loc.isValid(path)) { + return false; + } + } + } + + if (this.resourceLocations != null) { + for (i = 0; i < this.resourceLocations.length; ++i) { + ResourceLocation var4 = this.resourceLocations[i]; + + if (!Config.hasResource(var4)) { + Config.warn("Texture not found: " + var4.getResourcePath()); + return false; + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobsRule.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobsRule.java new file mode 100644 index 0000000..3733649 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RandomMobsRule.java @@ -0,0 +1,208 @@ +package net.minecraft.src; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; + +public class RandomMobsRule { + private ResourceLocation baseResLoc = null; + private int index; + private int[] skins = null; + private ResourceLocation[] resourceLocations = null; + private int[] weights = null; + private BiomeGenBase[] biomes = null; + private RangeListInt heights = null; + private NbtTagValue nbtName = null; + public int[] sumWeights = null; + public int sumAllWeights = 1; + private VillagerProfession[] professions = null; + + public RandomMobsRule(ResourceLocation baseResLoc, int index, int[] skins, int[] weights, BiomeGenBase[] biomes, RangeListInt heights, NbtTagValue nbtName, VillagerProfession[] professions) { + this.baseResLoc = baseResLoc; + this.index = index; + this.skins = skins; + this.weights = weights; + this.biomes = biomes; + this.heights = heights; + this.nbtName = nbtName; + this.professions = professions; + } + + public boolean isValid(String path) { + if (this.skins != null && this.skins.length != 0) { + if (this.resourceLocations != null) { + return true; + } else { + this.resourceLocations = new ResourceLocation[this.skins.length]; + ResourceLocation locMcp = RandomMobs.getMcpatcherLocation(this.baseResLoc); + + if (locMcp == null) { + Config.warn("Invalid path: " + this.baseResLoc.getResourcePath()); + return false; + } else { + int sum; + int i; + + for (sum = 0; sum < this.resourceLocations.length; ++sum) { + i = this.skins[sum]; + + if (i <= 1) { + this.resourceLocations[sum] = this.baseResLoc; + } else { + ResourceLocation i1 = RandomMobs.getLocationIndexed(locMcp, i); + + if (i1 == null) { + Config.warn("Invalid path: " + this.baseResLoc.getResourcePath()); + return false; + } + + if (!Config.hasResource(i1)) { + Config.warn("Texture not found: " + i1.getResourcePath()); + return false; + } + + this.resourceLocations[sum] = i1; + } + } + + if (this.weights != null) { + int[] var6; + + if (this.weights.length > this.resourceLocations.length) { + Config.warn("More weights defined than skins, trimming weights: " + path); + var6 = new int[this.resourceLocations.length]; + System.arraycopy(this.weights, 0, var6, 0, var6.length); + this.weights = var6; + } + + if (this.weights.length < this.resourceLocations.length) { + Config.warn("Less weights defined than skins, expanding weights: " + path); + var6 = new int[this.resourceLocations.length]; + System.arraycopy(this.weights, 0, var6, 0, this.weights.length); + i = MathUtils.getAverage(this.weights); + + for (int var7 = this.weights.length; var7 < var6.length; ++var7) { + var6[var7] = i; + } + + this.weights = var6; + } + + this.sumWeights = new int[this.weights.length]; + sum = 0; + + for (i = 0; i < this.weights.length; ++i) { + if (this.weights[i] < 0) { + Config.warn("Invalid weight: " + this.weights[i]); + return false; + } + + sum += this.weights[i]; + this.sumWeights[i] = sum; + } + + this.sumAllWeights = sum; + + if (this.sumAllWeights <= 0) { + Config.warn("Invalid sum of all weights: " + sum); + this.sumAllWeights = 1; + } + } + + if (this.professions == ConnectedParser.PROFESSIONS_INVALID) { + Config.warn("Invalid professions or careers: " + path); + return false; + } else { + return true; + } + } + } + } else { + Config.warn("Invalid skins for rule: " + this.index); + return false; + } + } + + public boolean matches(EntityLiving el) { + if (this.biomes != null) { + BiomeGenBase entityVillager = el.spawnBiome; + boolean profInt = false; + + for (int careerInt = 0; careerInt < this.biomes.length; ++careerInt) { + BiomeGenBase matchProfession = this.biomes[careerInt]; + + if (matchProfession == entityVillager) { + profInt = true; + break; + } + } + + if (!profInt) { + return false; + } + } + + if (this.heights != null && el.spawnPosition != null) { + return this.heights.isInRange(el.spawnPosition.getY()); + } else { + if (this.nbtName != null) { + String var8 = el.hasCustomNameTag() ? el.getCustomNameTag() : null; + + if (!this.nbtName.matchesValue(var8)) { + return false; + } + } + + if (this.professions != null && el instanceof EntityVillager) { + EntityVillager var9 = (EntityVillager)el; + int var10 = var9.getProfession(); + byte var11 = 0; + + if (var10 < 0 || var11 < 0) { + return false; + } + + boolean var12 = false; + + for (int i = 0; i < this.professions.length; ++i) { + VillagerProfession prof = this.professions[i]; + + if (prof.matches(var10, var11)) { + var12 = true; + break; + } + } + + if (!var12) { + return false; + } + } + + return true; + } + } + + public ResourceLocation getTextureLocation(ResourceLocation loc, int randomId) { + if (this.resourceLocations != null && this.resourceLocations.length != 0) { + int index = 0; + + if (this.weights == null) { + index = randomId % this.resourceLocations.length; + } else { + int randWeight = randomId % this.sumAllWeights; + + for (int i = 0; i < this.sumWeights.length; ++i) { + if (this.sumWeights[i] > randWeight) { + index = i; + break; + } + } + } + + return this.resourceLocations[index]; + } else { + return loc; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RangeInt.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RangeInt.java new file mode 100644 index 0000000..8670bec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RangeInt.java @@ -0,0 +1,27 @@ +package net.minecraft.src; + +public class RangeInt { + private int min; + private int max; + + public RangeInt(int min, int max) { + this.min = Math.min(min, max); + this.max = Math.max(min, max); + } + + public boolean isInRange(int val) { + return val < this.min ? false : val <= this.max; + } + + public int getMin() { + return this.min; + } + + public int getMax() { + return this.max; + } + + public String toString() { + return "min: " + this.min + ", max: " + this.max; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RangeListInt.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RangeListInt.java new file mode 100644 index 0000000..fed9ade --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RangeListInt.java @@ -0,0 +1,53 @@ +package net.minecraft.src; + +public class RangeListInt { + private RangeInt[] ranges = new RangeInt[0]; + + public RangeListInt() {} + + public RangeListInt(RangeInt ri) { + this.addRange(ri); + } + + public void addRange(RangeInt ri) { + this.ranges = (RangeInt[])((RangeInt[])Config.addObjectToArray(this.ranges, ri)); + } + + public boolean isInRange(int val) { + for (int i = 0; i < this.ranges.length; ++i) { + RangeInt ri = this.ranges[i]; + + if (ri.isInRange(val)) { + return true; + } + } + + return false; + } + + public int getCountRanges() { + return this.ranges.length; + } + + public RangeInt getRange(int i) { + return this.ranges[i]; + } + + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("["); + + for (int i = 0; i < this.ranges.length; ++i) { + RangeInt ri = this.ranges[i]; + + if (i > 0) { + sb.append(", "); + } + + sb.append(ri.toString()); + } + + sb.append("]"); + return sb.toString(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Reflector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Reflector.java new file mode 100644 index 0000000..c70bcfd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/Reflector.java @@ -0,0 +1,700 @@ +package net.minecraft.src; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import net.minecraft.block.Block; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemRecord; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; + +public class Reflector { + public static ReflectorClass ModLoader = new ReflectorClass("ModLoader"); + public static ReflectorMethod ModLoader_renderWorldBlock = new ReflectorMethod(ModLoader, "renderWorldBlock"); + public static ReflectorMethod ModLoader_renderInvBlock = new ReflectorMethod(ModLoader, "renderInvBlock"); + public static ReflectorMethod ModLoader_renderBlockIsItemFull3D = new ReflectorMethod(ModLoader, "renderBlockIsItemFull3D"); + public static ReflectorMethod ModLoader_registerServer = new ReflectorMethod(ModLoader, "registerServer"); + public static ReflectorMethod ModLoader_getCustomAnimationLogic = new ReflectorMethod(ModLoader, "getCustomAnimationLogic"); + public static ReflectorClass FMLRenderAccessLibrary = findReflectorClass(new String[] {"FMLRenderAccessLibrary", "net.minecraft.src.FMLRenderAccessLibrary"}); + public static ReflectorMethod FMLRenderAccessLibrary_renderWorldBlock = new ReflectorMethod(FMLRenderAccessLibrary, "renderWorldBlock"); + public static ReflectorMethod FMLRenderAccessLibrary_renderInventoryBlock = new ReflectorMethod(FMLRenderAccessLibrary, "renderInventoryBlock"); + public static ReflectorMethod FMLRenderAccessLibrary_renderItemAsFull3DBlock = new ReflectorMethod(FMLRenderAccessLibrary, "renderItemAsFull3DBlock"); + public static ReflectorClass LightCache = new ReflectorClass("LightCache"); + public static ReflectorField LightCache_cache = new ReflectorField(LightCache, "cache"); + public static ReflectorMethod LightCache_clear = new ReflectorMethod(LightCache, "clear"); + public static ReflectorClass BlockCoord = new ReflectorClass("BlockCoord"); + public static ReflectorMethod BlockCoord_resetPool = new ReflectorMethod(BlockCoord, "resetPool"); + public static ReflectorClass MinecraftForge = new ReflectorClass("net.minecraftforge.common.MinecraftForge"); + public static ReflectorField MinecraftForge_EVENT_BUS = new ReflectorField(MinecraftForge, "EVENT_BUS"); + public static ReflectorClass ForgeHooks = new ReflectorClass("net.minecraftforge.common.ForgeHooks"); + public static ReflectorMethod ForgeHooks_onLivingSetAttackTarget = new ReflectorMethod(ForgeHooks, "onLivingSetAttackTarget"); + public static ReflectorMethod ForgeHooks_onLivingUpdate = new ReflectorMethod(ForgeHooks, "onLivingUpdate"); + public static ReflectorMethod ForgeHooks_onLivingAttack = new ReflectorMethod(ForgeHooks, "onLivingAttack"); + public static ReflectorMethod ForgeHooks_onLivingHurt = new ReflectorMethod(ForgeHooks, "onLivingHurt"); + public static ReflectorMethod ForgeHooks_onLivingDeath = new ReflectorMethod(ForgeHooks, "onLivingDeath"); + public static ReflectorMethod ForgeHooks_onLivingDrops = new ReflectorMethod(ForgeHooks, "onLivingDrops"); + public static ReflectorMethod ForgeHooks_onLivingFall = new ReflectorMethod(ForgeHooks, "onLivingFall"); + public static ReflectorMethod ForgeHooks_onLivingJump = new ReflectorMethod(ForgeHooks, "onLivingJump"); + public static ReflectorClass MinecraftForgeClient = new ReflectorClass("net.minecraftforge.client.MinecraftForgeClient"); + public static ReflectorMethod MinecraftForgeClient_getRenderPass = new ReflectorMethod(MinecraftForgeClient, "getRenderPass"); + public static ReflectorMethod MinecraftForgeClient_getItemRenderer = new ReflectorMethod(MinecraftForgeClient, "getItemRenderer"); + public static ReflectorClass ForgeHooksClient = new ReflectorClass("net.minecraftforge.client.ForgeHooksClient"); + public static ReflectorMethod ForgeHooksClient_onDrawBlockHighlight = new ReflectorMethod(ForgeHooksClient, "onDrawBlockHighlight"); + public static ReflectorMethod ForgeHooksClient_orientBedCamera = new ReflectorMethod(ForgeHooksClient, "orientBedCamera"); + public static ReflectorMethod ForgeHooksClient_renderEquippedItem = new ReflectorMethod(ForgeHooksClient, "renderEquippedItem"); + public static ReflectorMethod ForgeHooksClient_dispatchRenderLast = new ReflectorMethod(ForgeHooksClient, "dispatchRenderLast"); + public static ReflectorMethod ForgeHooksClient_onTextureLoadPre = new ReflectorMethod(ForgeHooksClient, "onTextureLoadPre"); + public static ReflectorMethod ForgeHooksClient_setRenderPass = new ReflectorMethod(ForgeHooksClient, "setRenderPass"); + public static ReflectorMethod ForgeHooksClient_onTextureStitchedPre = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPre"); + public static ReflectorMethod ForgeHooksClient_onTextureStitchedPost = new ReflectorMethod(ForgeHooksClient, "onTextureStitchedPost"); + public static ReflectorMethod ForgeHooksClient_renderFirstPersonHand = new ReflectorMethod(ForgeHooksClient, "renderFirstPersonHand"); + public static ReflectorMethod ForgeHooksClient_setWorldRendererRB = new ReflectorMethod(ForgeHooksClient, "setWorldRendererRB"); + public static ReflectorMethod ForgeHooksClient_onPreRenderWorld = new ReflectorMethod(ForgeHooksClient, "onPreRenderWorld"); + public static ReflectorMethod ForgeHooksClient_onPostRenderWorld = new ReflectorMethod(ForgeHooksClient, "onPostRenderWorld"); + public static ReflectorClass FMLCommonHandler = new ReflectorClass("cpw.mods.fml.common.FMLCommonHandler"); + public static ReflectorMethod FMLCommonHandler_instance = new ReflectorMethod(FMLCommonHandler, "instance"); + public static ReflectorMethod FMLCommonHandler_handleServerStarting = new ReflectorMethod(FMLCommonHandler, "handleServerStarting"); + public static ReflectorMethod FMLCommonHandler_handleServerAboutToStart = new ReflectorMethod(FMLCommonHandler, "handleServerAboutToStart"); + public static ReflectorMethod FMLCommonHandler_enhanceCrashReport = new ReflectorMethod(FMLCommonHandler, "enhanceCrashReport"); + public static ReflectorClass FMLClientHandler = new ReflectorClass("cpw.mods.fml.client.FMLClientHandler"); + public static ReflectorMethod FMLClientHandler_instance = new ReflectorMethod(FMLClientHandler, "instance"); + public static ReflectorMethod FMLClientHandler_isLoading = new ReflectorMethod(FMLClientHandler, "isLoading"); + public static ReflectorMethod FMLClientHandler_trackBrokenTexture = new ReflectorMethod(FMLClientHandler, "trackBrokenTexture"); + public static ReflectorMethod FMLClientHandler_trackMissingTexture = new ReflectorMethod(FMLClientHandler, "trackMissingTexture"); + public static ReflectorClass ItemRenderType = new ReflectorClass("net.minecraftforge.client.IItemRenderer$ItemRenderType"); + public static ReflectorField ItemRenderType_EQUIPPED = new ReflectorField(ItemRenderType, "EQUIPPED"); + public static ReflectorClass ForgeWorldProvider = new ReflectorClass(WorldProvider.class); + public static ReflectorMethod ForgeWorldProvider_getSkyRenderer = new ReflectorMethod(ForgeWorldProvider, "getSkyRenderer"); + public static ReflectorMethod ForgeWorldProvider_getCloudRenderer = new ReflectorMethod(ForgeWorldProvider, "getCloudRenderer"); + public static ReflectorMethod ForgeWorldProvider_getWeatherRenderer = new ReflectorMethod(ForgeWorldProvider, "getWeatherRenderer"); + public static ReflectorClass ForgeWorld = new ReflectorClass(World.class); + public static ReflectorMethod ForgeWorld_countEntities = new ReflectorMethod(ForgeWorld, "countEntities", new Class[] {EnumCreatureType.class, Boolean.TYPE}); + public static ReflectorMethod ForgeWorld_finishSetup = new ReflectorMethod(ForgeWorld, "finishSetup"); + public static ReflectorClass IRenderHandler = new ReflectorClass("net.minecraftforge.client.IRenderHandler"); + public static ReflectorMethod IRenderHandler_render = new ReflectorMethod(IRenderHandler, "render"); + public static ReflectorClass DimensionManager = new ReflectorClass("net.minecraftforge.common.DimensionManager"); + public static ReflectorMethod DimensionManager_getStaticDimensionIDs = new ReflectorMethod(DimensionManager, "getStaticDimensionIDs"); + public static ReflectorClass WorldEvent_Load = new ReflectorClass("net.minecraftforge.event.world.WorldEvent$Load"); + public static ReflectorConstructor WorldEvent_Load_Constructor = new ReflectorConstructor(WorldEvent_Load, new Class[] {World.class}); + public static ReflectorClass DrawScreenEvent_Pre = new ReflectorClass("net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Pre"); + public static ReflectorConstructor DrawScreenEvent_Pre_Constructor = new ReflectorConstructor(DrawScreenEvent_Pre, new Class[] {GuiScreen.class, Integer.TYPE, Integer.TYPE, Float.TYPE}); + public static ReflectorClass DrawScreenEvent_Post = new ReflectorClass("net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Post"); + public static ReflectorConstructor DrawScreenEvent_Post_Constructor = new ReflectorConstructor(DrawScreenEvent_Post, new Class[] {GuiScreen.class, Integer.TYPE, Integer.TYPE, Float.TYPE}); + public static ReflectorClass EntityViewRenderEvent_FogColors = new ReflectorClass("net.minecraftforge.client.event.EntityViewRenderEvent$FogColors"); + public static ReflectorConstructor EntityViewRenderEvent_FogColors_Constructor = new ReflectorConstructor(EntityViewRenderEvent_FogColors, new Class[] {EntityRenderer.class, EntityLivingBase.class, Block.class, Double.TYPE, Float.TYPE, Float.TYPE, Float.TYPE}); + public static ReflectorField EntityViewRenderEvent_FogColors_red = new ReflectorField(EntityViewRenderEvent_FogColors, "red"); + public static ReflectorField EntityViewRenderEvent_FogColors_green = new ReflectorField(EntityViewRenderEvent_FogColors, "green"); + public static ReflectorField EntityViewRenderEvent_FogColors_blue = new ReflectorField(EntityViewRenderEvent_FogColors, "blue"); + public static ReflectorClass EntityViewRenderEvent_FogDensity = new ReflectorClass("net.minecraftforge.client.event.EntityViewRenderEvent$FogDensity"); + public static ReflectorConstructor EntityViewRenderEvent_FogDensity_Constructor = new ReflectorConstructor(EntityViewRenderEvent_FogDensity, new Class[] {EntityRenderer.class, EntityLivingBase.class, Block.class, Double.TYPE, Float.TYPE}); + public static ReflectorField EntityViewRenderEvent_FogDensity_density = new ReflectorField(EntityViewRenderEvent_FogDensity, "density"); + public static ReflectorClass EntityViewRenderEvent_RenderFogEvent = new ReflectorClass("net.minecraftforge.client.event.EntityViewRenderEvent$RenderFogEvent"); + public static ReflectorConstructor EntityViewRenderEvent_RenderFogEvent_Constructor = new ReflectorConstructor(EntityViewRenderEvent_RenderFogEvent, new Class[] {EntityRenderer.class, EntityLivingBase.class, Block.class, Double.TYPE, Integer.TYPE, Float.TYPE}); + public static ReflectorClass RenderItemInFrameEvent = new ReflectorClass("net.minecraftforge.client.event.RenderItemInFrameEvent"); + public static ReflectorConstructor RenderItemInFrameEvent_Constructor = new ReflectorConstructor(RenderItemInFrameEvent, new Class[] {EntityItemFrame.class, RenderItemFrame.class}); + public static ReflectorClass RenderLivingEvent_Pre = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Pre"); + public static ReflectorConstructor RenderLivingEvent_Pre_Constructor = new ReflectorConstructor(RenderLivingEvent_Pre, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass RenderLivingEvent_Post = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Post"); + public static ReflectorConstructor RenderLivingEvent_Post_Constructor = new ReflectorConstructor(RenderLivingEvent_Post, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass RenderLivingEvent_Specials_Pre = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Specials$Pre"); + public static ReflectorConstructor RenderLivingEvent_Specials_Pre_Constructor = new ReflectorConstructor(RenderLivingEvent_Specials_Pre, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass RenderLivingEvent_Specials_Post = new ReflectorClass("net.minecraftforge.client.event.RenderLivingEvent$Specials$Post"); + public static ReflectorConstructor RenderLivingEvent_Specials_Post_Constructor = new ReflectorConstructor(RenderLivingEvent_Specials_Post, new Class[] {EntityLivingBase.class, RendererLivingEntity.class, Double.TYPE, Double.TYPE, Double.TYPE}); + public static ReflectorClass EventBus = new ReflectorClass("cpw.mods.fml.common.eventhandler.EventBus"); + public static ReflectorMethod EventBus_post = new ReflectorMethod(EventBus, "post"); + public static ReflectorClass Event_Result = new ReflectorClass("cpw.mods.fml.common.eventhandler.Event$Result"); + public static ReflectorField Event_Result_DENY = new ReflectorField(Event_Result, "DENY"); + public static ReflectorField Event_Result_ALLOW = new ReflectorField(Event_Result, "ALLOW"); + public static ReflectorField Event_Result_DEFAULT = new ReflectorField(Event_Result, "DEFAULT"); + public static ReflectorClass ForgeEventFactory = new ReflectorClass("net.minecraftforge.event.ForgeEventFactory"); + public static ReflectorMethod ForgeEventFactory_canEntitySpawn = new ReflectorMethod(ForgeEventFactory, "canEntitySpawn"); + public static ReflectorMethod ForgeEventFactory_canEntityDespawn = new ReflectorMethod(ForgeEventFactory, "canEntityDespawn"); + public static ReflectorClass ChunkWatchEvent_UnWatch = new ReflectorClass("net.minecraftforge.event.world.ChunkWatchEvent$UnWatch"); + public static ReflectorConstructor ChunkWatchEvent_UnWatch_Constructor = new ReflectorConstructor(ChunkWatchEvent_UnWatch, new Class[] {ChunkCoordIntPair.class, EntityPlayerMP.class}); + public static ReflectorClass ForgeBlock = new ReflectorClass(Block.class); + public static ReflectorMethod ForgeBlock_getBedDirection = new ReflectorMethod(ForgeBlock, "getBedDirection"); + public static ReflectorMethod ForgeBlock_isBed = new ReflectorMethod(ForgeBlock, "isBed"); + public static ReflectorMethod ForgeBlock_isBedFoot = new ReflectorMethod(ForgeBlock, "isBedFoot"); + public static ReflectorMethod ForgeBlock_canRenderInPass = new ReflectorMethod(ForgeBlock, "canRenderInPass"); + public static ReflectorMethod ForgeBlock_hasTileEntity = new ReflectorMethod(ForgeBlock, "hasTileEntity", new Class[] {Integer.TYPE}); + public static ReflectorMethod ForgeBlock_canCreatureSpawn = new ReflectorMethod(ForgeBlock, "canCreatureSpawn"); + public static ReflectorClass ForgeEntity = new ReflectorClass(Entity.class); + public static ReflectorField ForgeEntity_captureDrops = new ReflectorField(ForgeEntity, "captureDrops"); + public static ReflectorField ForgeEntity_capturedDrops = new ReflectorField(ForgeEntity, "capturedDrops"); + public static ReflectorMethod ForgeEntity_shouldRenderInPass = new ReflectorMethod(ForgeEntity, "shouldRenderInPass"); + public static ReflectorMethod ForgeEntity_canRiderInteract = new ReflectorMethod(ForgeEntity, "canRiderInteract"); + public static ReflectorClass ForgeTileEntity = new ReflectorClass(TileEntity.class); + public static ReflectorMethod ForgeTileEntity_shouldRenderInPass = new ReflectorMethod(ForgeTileEntity, "shouldRenderInPass"); + public static ReflectorMethod ForgeTileEntity_getRenderBoundingBox = new ReflectorMethod(ForgeTileEntity, "getRenderBoundingBox"); + public static ReflectorClass ForgeItem = new ReflectorClass(Item.class); + public static ReflectorMethod ForgeItem_onEntitySwing = new ReflectorMethod(ForgeItem, "onEntitySwing"); + public static ReflectorClass ForgePotionEffect = new ReflectorClass(PotionEffect.class); + public static ReflectorMethod ForgePotionEffect_isCurativeItem = new ReflectorMethod(ForgePotionEffect, "isCurativeItem"); + public static ReflectorClass ForgeItemStack = new ReflectorClass(ItemStack.class); + public static ReflectorMethod ForgeItemStack_hasEffect = new ReflectorMethod(ForgeItemStack, "hasEffect", new Class[] {Integer.TYPE}); + public static ReflectorClass ForgeItemRecord = new ReflectorClass(ItemRecord.class); + public static ReflectorMethod ForgeItemRecord_getRecordResource = new ReflectorMethod(ForgeItemRecord, "getRecordResource", new Class[] {String.class}); + public static ReflectorClass Launch = new ReflectorClass("net.minecraft.launchwrapper.Launch"); + public static ReflectorField Launch_blackboard = new ReflectorField(Launch, "blackboard"); + public static ReflectorClass SplashScreen = new ReflectorClass("cpw.mods.fml.client.SplashProgress"); + public static ReflectorClass OptiFineClassTransformer = new ReflectorClass("optifine.OptiFineClassTransformer"); + public static ReflectorField OptiFineClassTransformer_instance = new ReflectorField(OptiFineClassTransformer, "instance"); + public static ReflectorMethod OptiFineClassTransformer_getOptiFineResource = new ReflectorMethod(OptiFineClassTransformer, "getOptiFineResource"); + public static ReflectorClass ItemBlock = new ReflectorClass(ItemBlock.class); + public static ReflectorField ItemBlock_block = new ReflectorField(ItemBlock, Block.class, 0); + public static ReflectorClass ItemRenderer = new ReflectorClass(ItemRenderer.class); + public static ReflectorField ItemRenderer_itemToRender = new ReflectorField(ItemRenderer, ItemStack.class); + public static ReflectorClass Loader = new ReflectorClass("net.minecraftforge.fml.common.Loader"); + public static ReflectorMethod Loader_getActiveModList = new ReflectorMethod(Loader, "getActiveModList"); + public static ReflectorMethod Loader_instance = new ReflectorMethod(Loader, "instance"); + public static ReflectorClass ModContainer = new ReflectorClass("net.minecraftforge.fml.common.ModContainer"); + public static ReflectorMethod ModContainer_getModId = new ReflectorMethod(ModContainer, "getModId"); + + public static void callVoid(ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return; + } + + e.invoke((Object)null, params); + } catch (Throwable var3) { + handleException(var3, (Object)null, refMethod, params); + } + } + + private static ReflectorClass findReflectorClass(String[] strings) { + ReflectorClass rcFirst = null; + + for (int i = 0; i < strings.length; ++i) { + String className = strings[i]; + ReflectorClass rc = new ReflectorClass(className); + + if (rcFirst == null) { + rcFirst = rc; + } + + if (rc.exists()) { + return rc; + } + } + + return rcFirst; + } + + public static boolean callBoolean(ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return false; + } else { + Boolean retVal = (Boolean)e.invoke((Object)null, params); + return retVal.booleanValue(); + } + } catch (Throwable var4) { + handleException(var4, (Object)null, refMethod, params); + return false; + } + } + + public static int callInt(ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return 0; + } else { + Integer retVal = (Integer)e.invoke((Object)null, params); + return retVal.intValue(); + } + } catch (Throwable var4) { + handleException(var4, (Object)null, refMethod, params); + return 0; + } + } + + public static float callFloat(ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return 0.0F; + } else { + Float retVal = (Float)e.invoke((Object)null, params); + return retVal.floatValue(); + } + } catch (Throwable var4) { + handleException(var4, (Object)null, refMethod, params); + return 0.0F; + } + } + + public static double callDouble(ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return 0.0D; + } else { + Double retVal = (Double)e.invoke((Object)null, params); + return retVal.doubleValue(); + } + } catch (Throwable var4) { + handleException(var4, (Object)null, refMethod, params); + return 0.0D; + } + } + + public static String callString(ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return null; + } else { + String retVal = (String)e.invoke((Object)null, params); + return retVal; + } + } catch (Throwable var4) { + handleException(var4, (Object)null, refMethod, params); + return null; + } + } + + public static Object call(ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return null; + } else { + Object retVal = e.invoke((Object)null, params); + return retVal; + } + } catch (Throwable var4) { + handleException(var4, (Object)null, refMethod, params); + return null; + } + } + + public static void callVoid(Object obj, ReflectorMethod refMethod, Object ... params) { + try { + if (obj == null) { + return; + } + + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return; + } + + e.invoke(obj, params); + } catch (Throwable var4) { + handleException(var4, obj, refMethod, params); + } + } + + public static boolean callBoolean(Object obj, ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return false; + } else { + Boolean retVal = (Boolean)e.invoke(obj, params); + return retVal.booleanValue(); + } + } catch (Throwable var5) { + handleException(var5, obj, refMethod, params); + return false; + } + } + + public static int callInt(Object obj, ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return 0; + } else { + Integer retVal = (Integer)e.invoke(obj, params); + return retVal.intValue(); + } + } catch (Throwable var5) { + handleException(var5, obj, refMethod, params); + return 0; + } + } + + public static float callFloat(Object obj, ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return 0.0F; + } else { + Float retVal = (Float)e.invoke(obj, params); + return retVal.floatValue(); + } + } catch (Throwable var5) { + handleException(var5, obj, refMethod, params); + return 0.0F; + } + } + + public static double callDouble(Object obj, ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return 0.0D; + } else { + Double retVal = (Double)e.invoke(obj, params); + return retVal.doubleValue(); + } + } catch (Throwable var5) { + handleException(var5, obj, refMethod, params); + return 0.0D; + } + } + + public static String callString(Object obj, ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return null; + } else { + String retVal = (String)e.invoke(obj, params); + return retVal; + } + } catch (Throwable var5) { + handleException(var5, obj, refMethod, params); + return null; + } + } + + public static Object call(Object obj, ReflectorMethod refMethod, Object ... params) { + try { + Method e = refMethod.getTargetMethod(); + + if (e == null) { + return null; + } else { + Object retVal = e.invoke(obj, params); + return retVal; + } + } catch (Throwable var5) { + handleException(var5, obj, refMethod, params); + return null; + } + } + + public static Object getFieldValue(ReflectorField refField) { + return getFieldValue((Object)null, refField); + } + + public static Object getFieldValue(Object obj, ReflectorField refField) { + try { + Field e = refField.getTargetField(); + + if (e == null) { + return null; + } else { + Object value = e.get(obj); + return value; + } + } catch (Throwable var4) { + var4.printStackTrace(); + return null; + } + } + + public static float getFieldValueFloat(Object obj, ReflectorField refField, float def) { + Object val = getFieldValue(obj, refField); + + if (!(val instanceof Float)) { + return def; + } else { + Float valFloat = (Float)val; + return valFloat.floatValue(); + } + } + + public static void setFieldValue(ReflectorField refField, Object value) { + setFieldValue((Object)null, refField, value); + } + + public static boolean setFieldValue(Object obj, ReflectorField refField, Object value) { + try { + Field e = refField.getTargetField(); + + if (e == null) { + return false; + } else { + e.set(obj, value); + return true; + } + } catch (Throwable var4) { + var4.printStackTrace(); + return false; + } + } + + public static boolean postForgeBusEvent(ReflectorConstructor constr, Object ... params) { + Object event = newInstance(constr, params); + return event == null ? false : postForgeBusEvent(event); + } + + public static boolean postForgeBusEvent(Object event) { + if (event == null) { + return false; + } else { + Object eventBus = getFieldValue(MinecraftForge_EVENT_BUS); + + if (eventBus == null) { + return false; + } else { + Object ret = call(eventBus, EventBus_post, new Object[] {event}); + + if (!(ret instanceof Boolean)) { + return false; + } else { + Boolean retBool = (Boolean)ret; + return retBool.booleanValue(); + } + } + } + } + + public static Object newInstance(ReflectorConstructor constr, Object ... params) { + Constructor c = constr.getTargetConstructor(); + + if (c == null) { + return null; + } else { + try { + Object e = c.newInstance(params); + return e; + } catch (Throwable var4) { + handleException(var4, constr, params); + return null; + } + } + } + + public static Method getMethod(Class cls, String methodName, Class[] paramTypes) { + Method[] ms = cls.getDeclaredMethods(); + + for (int i = 0; i < ms.length; ++i) { + Method m = ms[i]; + + if (m.getName().equals(methodName)) { + Class[] types = m.getParameterTypes(); + + if (matchesTypes(paramTypes, types)) { + return m; + } + } + } + + return null; + } + + public static Method[] getMethods(Class cls, String methodName) { + ArrayList listMethods = new ArrayList(); + Method[] ms = cls.getDeclaredMethods(); + + for (int methods = 0; methods < ms.length; ++methods) { + Method m = ms[methods]; + + if (m.getName().equals(methodName)) { + listMethods.add(m); + } + } + + Method[] var6 = (Method[])((Method[])listMethods.toArray(new Method[listMethods.size()])); + return var6; + } + + public static boolean matchesTypes(Class[] pTypes, Class[] cTypes) { + if (pTypes.length != cTypes.length) { + return false; + } else { + for (int i = 0; i < cTypes.length; ++i) { + Class pType = pTypes[i]; + Class cType = cTypes[i]; + + if (pType != cType) { + return false; + } + } + + return true; + } + } + + private static void dbgCall(boolean isStatic, String callType, ReflectorMethod refMethod, Object[] params, Object retVal) { + String className = refMethod.getTargetMethod().getDeclaringClass().getName(); + String methodName = refMethod.getTargetMethod().getName(); + String staticStr = ""; + + if (isStatic) { + staticStr = " static"; + } + + Config.dbg(callType + staticStr + " " + className + "." + methodName + "(" + Config.arrayToString(params) + ") => " + retVal); + } + + private static void dbgCallVoid(boolean isStatic, String callType, ReflectorMethod refMethod, Object[] params) { + String className = refMethod.getTargetMethod().getDeclaringClass().getName(); + String methodName = refMethod.getTargetMethod().getName(); + String staticStr = ""; + + if (isStatic) { + staticStr = " static"; + } + + Config.dbg(callType + staticStr + " " + className + "." + methodName + "(" + Config.arrayToString(params) + ")"); + } + + private static void dbgFieldValue(boolean isStatic, String accessType, ReflectorField refField, Object val) { + String className = refField.getTargetField().getDeclaringClass().getName(); + String fieldName = refField.getTargetField().getName(); + String staticStr = ""; + + if (isStatic) { + staticStr = " static"; + } + + Config.dbg(accessType + staticStr + " " + className + "." + fieldName + " => " + val); + } + + private static void handleException(Throwable e, Object obj, ReflectorMethod refMethod, Object[] params) { + if (e instanceof InvocationTargetException) { + e.printStackTrace(); + } else { + if (e instanceof IllegalArgumentException) { + Config.warn("*** IllegalArgumentException ***"); + Config.warn("Method: " + refMethod.getTargetMethod()); + Config.warn("Object: " + obj); + Config.warn("Parameter classes: " + Config.arrayToString(getClasses(params))); + Config.warn("Parameters: " + Config.arrayToString(params)); + } + + Config.warn("*** Exception outside of method ***"); + Config.warn("Method deactivated: " + refMethod.getTargetMethod()); + refMethod.deactivate(); + e.printStackTrace(); + } + } + + private static void handleException(Throwable e, ReflectorConstructor refConstr, Object[] params) { + if (e instanceof InvocationTargetException) { + e.printStackTrace(); + } else { + if (e instanceof IllegalArgumentException) { + Config.warn("*** IllegalArgumentException ***"); + Config.warn("Constructor: " + refConstr.getTargetConstructor()); + Config.warn("Parameter classes: " + Config.arrayToString(getClasses(params))); + Config.warn("Parameters: " + Config.arrayToString(params)); + } + + Config.warn("*** Exception outside of constructor ***"); + Config.warn("Constructor deactivated: " + refConstr.getTargetConstructor()); + refConstr.deactivate(); + e.printStackTrace(); + } + } + + private static Object[] getClasses(Object[] objs) { + if (objs == null) { + return new Class[0]; + } else { + Class[] classes = new Class[objs.length]; + + for (int i = 0; i < classes.length; ++i) { + Object obj = objs[i]; + + if (obj != null) { + classes[i] = obj.getClass(); + } + } + + return classes; + } + } + + public static Field getField(Class cls, Class fieldType) { + try { + Field[] e = cls.getDeclaredFields(); + + for (int i = 0; i < e.length; ++i) { + Field field = e[i]; + + if (field.getType() == fieldType) { + field.setAccessible(true); + return field; + } + } + + return null; + } catch (Exception var5) { + return null; + } + } + + public static Field[] getFields(Class cls, Class fieldType) { + ArrayList list = new ArrayList(); + + try { + Field[] e = cls.getDeclaredFields(); + + for (int fields = 0; fields < e.length; ++fields) { + Field field = e[fields]; + + if (field.getType() == fieldType) { + field.setAccessible(true); + list.add(field); + } + } + + Field[] var7 = (Field[])((Field[])list.toArray(new Field[list.size()])); + return var7; + } catch (Exception var6) { + return null; + } + } + + public static ReflectorField getReflectorField(Class cls, Class fieldType) { + Field field = getField(cls, fieldType); + + if (field == null) { + return null; + } else { + ReflectorClass rc = new ReflectorClass(cls); + return new ReflectorField(rc, field.getName()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorClass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorClass.java new file mode 100644 index 0000000..7b52536 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorClass.java @@ -0,0 +1,77 @@ +package net.minecraft.src; + +public class ReflectorClass { + private String targetClassName; + private boolean checked; + private Class targetClass; + + public ReflectorClass(String targetClassName) { + this(targetClassName, false); + } + + public ReflectorClass(String targetClassName, boolean lazyResolve) { + this.targetClassName = null; + this.checked = false; + this.targetClass = null; + this.targetClassName = targetClassName; + + if (!lazyResolve) { + Class cls = this.getTargetClass(); + } + } + + public ReflectorClass(Class targetClass) { + this.targetClassName = null; + this.checked = false; + this.targetClass = null; + this.targetClass = targetClass; + this.targetClassName = targetClass.getName(); + this.checked = true; + } + + public Class getTargetClass() { + if (this.checked) { + return this.targetClass; + } else { + this.checked = true; + + try { + this.targetClass = Class.forName(this.targetClassName); + } catch (ClassNotFoundException var2) { + Config.log("(Reflector) Class not present: " + this.targetClassName); + } catch (Throwable var3) { + var3.printStackTrace(); + } + + return this.targetClass; + } + } + + public boolean exists() { + return this.getTargetClass() != null; + } + + public String getTargetClassName() { + return this.targetClassName; + } + + public boolean isInstance(Object obj) { + return this.getTargetClass() == null ? false : this.getTargetClass().isInstance(obj); + } + + public ReflectorField makeField(String name) { + return new ReflectorField(this, name); + } + + public ReflectorMethod makeMethod(String name) { + return new ReflectorMethod(this, name); + } + + public ReflectorMethod makeMethod(String name, Class[] paramTypes) { + return new ReflectorMethod(this, name, paramTypes); + } + + public ReflectorMethod makeMethod(String name, Class[] paramTypes, boolean lazyResolve) { + return new ReflectorMethod(this, name, paramTypes, lazyResolve); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorConstructor.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorConstructor.java new file mode 100644 index 0000000..0b3f6ce --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorConstructor.java @@ -0,0 +1,69 @@ +package net.minecraft.src; + +import java.lang.reflect.Constructor; + +public class ReflectorConstructor { + private ReflectorClass reflectorClass = null; + private Class[] parameterTypes = null; + private boolean checked = false; + private Constructor targetConstructor = null; + + public ReflectorConstructor(ReflectorClass reflectorClass, Class[] parameterTypes) { + this.reflectorClass = reflectorClass; + this.parameterTypes = parameterTypes; + Constructor c = this.getTargetConstructor(); + } + + public Constructor getTargetConstructor() { + if (this.checked) { + return this.targetConstructor; + } else { + this.checked = true; + Class cls = this.reflectorClass.getTargetClass(); + + if (cls == null) { + return null; + } else { + try { + this.targetConstructor = findConstructor(cls, this.parameterTypes); + + if (this.targetConstructor == null) { + Config.dbg("(Reflector) Constructor not present: " + cls.getName() + ", params: " + Config.arrayToString((Object[])this.parameterTypes)); + } + + if (this.targetConstructor != null) { + this.targetConstructor.setAccessible(true); + } + } catch (Throwable var3) { + var3.printStackTrace(); + } + + return this.targetConstructor; + } + } + } + + private static Constructor findConstructor(Class cls, Class[] paramTypes) { + Constructor[] cs = cls.getDeclaredConstructors(); + + for (int i = 0; i < cs.length; ++i) { + Constructor c = cs[i]; + Class[] types = c.getParameterTypes(); + + if (Reflector.matchesTypes(paramTypes, types)) { + return c; + } + } + + return null; + } + + public boolean exists() { + return this.checked ? this.targetConstructor != null : this.getTargetConstructor() != null; + } + + public void deactivate() { + this.checked = true; + this.targetConstructor = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorField.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorField.java new file mode 100644 index 0000000..2f18ad7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorField.java @@ -0,0 +1,75 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; + +public class ReflectorField { + private IFieldLocator fieldLocator; + private boolean checked; + private Field targetField; + + public ReflectorField(ReflectorClass reflectorClass, String targetFieldName) { + this((IFieldLocator)(new FieldLocatorName(reflectorClass, targetFieldName))); + } + + public ReflectorField(ReflectorClass reflectorClass, String targetFieldName, boolean lazyResolve) { + this(new FieldLocatorName(reflectorClass, targetFieldName), lazyResolve); + } + + public ReflectorField(ReflectorClass reflectorClass, Class targetFieldType) { + this(reflectorClass, targetFieldType, 0); + } + + public ReflectorField(ReflectorClass reflectorClass, Class targetFieldType, int targetFieldIndex) { + this((IFieldLocator)(new FieldLocatorType(reflectorClass, targetFieldType, targetFieldIndex))); + } + + public ReflectorField(Field field) { + this((IFieldLocator)(new FieldLocatorFixed(field))); + } + + public ReflectorField(IFieldLocator fieldLocator) { + this(fieldLocator, false); + } + + public ReflectorField(IFieldLocator fieldLocator, boolean lazyResolve) { + this.fieldLocator = null; + this.checked = false; + this.targetField = null; + this.fieldLocator = fieldLocator; + + if (!lazyResolve) { + this.getTargetField(); + } + } + + public Field getTargetField() { + if (this.checked) { + return this.targetField; + } else { + this.checked = true; + this.targetField = this.fieldLocator.getField(); + + if (this.targetField != null) { + this.targetField.setAccessible(true); + } + + return this.targetField; + } + } + + public Object getValue() { + return Reflector.getFieldValue((Object)null, this); + } + + public void setValue(Object value) { + Reflector.setFieldValue((Object)null, this, value); + } + + public void setValue(Object obj, Object value) { + Reflector.setFieldValue(obj, this, value); + } + + public boolean exists() { + return this.getTargetField() != null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorFields.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorFields.java new file mode 100644 index 0000000..728bc60 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorFields.java @@ -0,0 +1,39 @@ +package net.minecraft.src; + +public class ReflectorFields { + private ReflectorClass reflectorClass; + private Class fieldType; + private int fieldCount; + private ReflectorField[] reflectorFields; + + public ReflectorFields(ReflectorClass reflectorClass, Class fieldType, int fieldCount) { + this.reflectorClass = reflectorClass; + this.fieldType = fieldType; + + if (reflectorClass.exists()) { + if (fieldType != null) { + this.reflectorFields = new ReflectorField[fieldCount]; + + for (int i = 0; i < this.reflectorFields.length; ++i) { + this.reflectorFields[i] = new ReflectorField(reflectorClass, fieldType, i); + } + } + } + } + + public ReflectorClass getReflectorClass() { + return this.reflectorClass; + } + + public Class getFieldType() { + return this.fieldType; + } + + public int getFieldCount() { + return this.fieldCount; + } + + public ReflectorField getReflectorField(int index) { + return index >= 0 && index < this.reflectorFields.length ? this.reflectorFields[index] : null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorForge.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorForge.java new file mode 100644 index 0000000..d34779b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorForge.java @@ -0,0 +1,107 @@ +package net.minecraft.src; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class ReflectorForge { + public static void FMLClientHandler_trackBrokenTexture(ResourceLocation loc, String message) { + if (!Reflector.FMLClientHandler_trackBrokenTexture.exists()) { + Object instance = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); + Reflector.call(instance, Reflector.FMLClientHandler_trackBrokenTexture, new Object[] {loc, message}); + } + } + + public static void FMLClientHandler_trackMissingTexture(ResourceLocation loc) { + if (!Reflector.FMLClientHandler_trackMissingTexture.exists()) { + Object instance = Reflector.call(Reflector.FMLClientHandler_instance, new Object[0]); + Reflector.call(instance, Reflector.FMLClientHandler_trackMissingTexture, new Object[] {loc}); + } + } + + public static void putLaunchBlackboard(String key, Object value) { + Map blackboard = (Map)Reflector.getFieldValue(Reflector.Launch_blackboard); + + if (blackboard != null) { + blackboard.put(key, value); + } + } + + public static boolean renderFirstPersonHand(RenderGlobal renderGlobal, float partialTicks, int pass) { + return !Reflector.ForgeHooksClient_renderFirstPersonHand.exists() ? false : Reflector.callBoolean(Reflector.ForgeHooksClient_renderFirstPersonHand, new Object[] {renderGlobal, Float.valueOf(partialTicks), Integer.valueOf(pass)}); + } + + public static InputStream getOptiFineResourceStream(String path) { + if (!Reflector.OptiFineClassTransformer_instance.exists()) { + return null; + } else { + Object instance = Reflector.getFieldValue(Reflector.OptiFineClassTransformer_instance); + + if (instance == null) { + return null; + } else { + if (path.startsWith("/")) { + path = path.substring(1); + } + + byte[] bytes = (byte[])((byte[])Reflector.call(instance, Reflector.OptiFineClassTransformer_getOptiFineResource, new Object[] {path})); + + if (bytes == null) { + return null; + } else { + ByteArrayInputStream in = new ByteArrayInputStream(bytes); + return in; + } + } + } + } + + public static boolean blockHasTileEntity(World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); + + if (!Reflector.ForgeBlock_hasTileEntity.exists()) { + return block.hasTileEntity(); + } else { + int metadata = world.getBlockMetadata(x, y, z); + return Reflector.callBoolean(block, Reflector.ForgeBlock_hasTileEntity, new Object[] {Integer.valueOf(metadata)}); + } + } + + public static String[] getForgeModIds() { + if (!Reflector.Loader.exists()) { + return new String[0]; + } else { + Object loader = Reflector.call(Reflector.Loader_instance, new Object[0]); + List listActiveMods = (List)Reflector.call(loader, Reflector.Loader_getActiveModList, new Object[0]); + + if (listActiveMods == null) { + return new String[0]; + } else { + ArrayList listModIds = new ArrayList(); + Iterator modIds = listActiveMods.iterator(); + + while (modIds.hasNext()) { + Object modContainer = modIds.next(); + + if (Reflector.ModContainer.isInstance(modContainer)) { + String modId = Reflector.callString(modContainer, Reflector.ModContainer_getModId, new Object[0]); + + if (modId != null) { + listModIds.add(modId); + } + } + } + + String[] modIds1 = (String[])((String[])listModIds.toArray(new String[listModIds.size()])); + return modIds1; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorMethod.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorMethod.java new file mode 100644 index 0000000..fcb9b8d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorMethod.java @@ -0,0 +1,133 @@ +package net.minecraft.src; + +import java.lang.reflect.Method; +import java.util.ArrayList; + +public class ReflectorMethod { + private ReflectorClass reflectorClass; + private String targetMethodName; + private Class[] targetMethodParameterTypes; + private boolean checked; + private Method targetMethod; + + public ReflectorMethod(ReflectorClass reflectorClass, String targetMethodName) { + this(reflectorClass, targetMethodName, (Class[])null, false); + } + + public ReflectorMethod(ReflectorClass reflectorClass, String targetMethodName, Class[] targetMethodParameterTypes) { + this(reflectorClass, targetMethodName, targetMethodParameterTypes, false); + } + + public ReflectorMethod(ReflectorClass reflectorClass, String targetMethodName, Class[] targetMethodParameterTypes, boolean lazyResolve) { + this.reflectorClass = null; + this.targetMethodName = null; + this.targetMethodParameterTypes = null; + this.checked = false; + this.targetMethod = null; + this.reflectorClass = reflectorClass; + this.targetMethodName = targetMethodName; + this.targetMethodParameterTypes = targetMethodParameterTypes; + + if (!lazyResolve) { + Method m = this.getTargetMethod(); + } + } + + public Method getTargetMethod() { + if (this.checked) { + return this.targetMethod; + } else { + this.checked = true; + Class cls = this.reflectorClass.getTargetClass(); + + if (cls == null) { + return null; + } else { + try { + if (this.targetMethodParameterTypes == null) { + Method[] e = getMethods(cls, this.targetMethodName); + + if (e.length <= 0) { + Config.log("(Reflector) Method not present: " + cls.getName() + "." + this.targetMethodName); + return null; + } + + if (e.length > 1) { + Config.warn("(Reflector) More than one method found: " + cls.getName() + "." + this.targetMethodName); + + for (int i = 0; i < e.length; ++i) { + Method m = e[i]; + Config.warn("(Reflector) - " + m); + } + + return null; + } + + this.targetMethod = e[0]; + } else { + this.targetMethod = getMethod(cls, this.targetMethodName, this.targetMethodParameterTypes); + } + + if (this.targetMethod == null) { + Config.log("(Reflector) Method not present: " + cls.getName() + "." + this.targetMethodName); + return null; + } else { + this.targetMethod.setAccessible(true); + return this.targetMethod; + } + } catch (Throwable var5) { + var5.printStackTrace(); + return null; + } + } + } + } + + public boolean exists() { + return this.checked ? this.targetMethod != null : this.getTargetMethod() != null; + } + + public Class getReturnType() { + Method tm = this.getTargetMethod(); + return tm == null ? null : tm.getReturnType(); + } + + public void deactivate() { + this.checked = true; + this.targetMethod = null; + } + + public static Method getMethod(Class cls, String methodName, Class[] paramTypes) { + Method[] ms = cls.getDeclaredMethods(); + + for (int i = 0; i < ms.length; ++i) { + Method m = ms[i]; + + if (m.getName().equals(methodName)) { + Class[] types = m.getParameterTypes(); + + if (Reflector.matchesTypes(paramTypes, types)) { + return m; + } + } + } + + return null; + } + + public static Method[] getMethods(Class cls, String methodName) { + ArrayList listMethods = new ArrayList(); + Method[] ms = cls.getDeclaredMethods(); + + for (int methods = 0; methods < ms.length; ++methods) { + Method m = ms[methods]; + + if (m.getName().equals(methodName)) { + listMethods.add(m); + } + } + + Method[] var6 = (Method[])((Method[])listMethods.toArray(new Method[listMethods.size()])); + return var6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorRaw.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorRaw.java new file mode 100644 index 0000000..1da5d6f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ReflectorRaw.java @@ -0,0 +1,157 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ReflectorRaw { + public static Field getField(Class cls, Class fieldType) { + try { + Field[] e = cls.getDeclaredFields(); + + for (int i = 0; i < e.length; ++i) { + Field field = e[i]; + + if (field.getType() == fieldType) { + field.setAccessible(true); + return field; + } + } + + return null; + } catch (Exception var5) { + return null; + } + } + + public static Field[] getFields(Class cls, Class fieldType) { + try { + Field[] e = cls.getDeclaredFields(); + return getFields(e, fieldType); + } catch (Exception var3) { + return null; + } + } + + public static Field[] getFields(Field[] fields, Class fieldType) { + try { + ArrayList e = new ArrayList(); + + for (int fs = 0; fs < fields.length; ++fs) { + Field field = fields[fs]; + + if (field.getType() == fieldType) { + field.setAccessible(true); + e.add(field); + } + } + + Field[] var6 = (Field[])((Field[])e.toArray(new Field[e.size()])); + return var6; + } catch (Exception var5) { + return null; + } + } + + public static Field[] getFieldsAfter(Class cls, Field field, Class fieldType) { + try { + Field[] e = cls.getDeclaredFields(); + List list = Arrays.asList(e); + int posStart = list.indexOf(field); + + if (posStart < 0) { + return new Field[0]; + } else { + List listAfter = list.subList(posStart + 1, list.size()); + Field[] fieldsAfter = (Field[])((Field[])listAfter.toArray(new Field[listAfter.size()])); + return getFields(fieldsAfter, fieldType); + } + } catch (Exception var8) { + return null; + } + } + + public static Field[] getFields(Object obj, Field[] fields, Class fieldType, Object value) { + try { + ArrayList e = new ArrayList(); + + for (int fs = 0; fs < fields.length; ++fs) { + Field field = fields[fs]; + + if (field.getType() == fieldType) { + boolean staticField = Modifier.isStatic(field.getModifiers()); + + if ((obj != null || staticField) && (obj == null || !staticField)) { + field.setAccessible(true); + Object fieldVal = field.get(obj); + + if (fieldVal == value) { + e.add(field); + } else if (fieldVal != null && value != null && fieldVal.equals(value)) { + e.add(field); + } + } + } + } + + Field[] var10 = (Field[])((Field[])e.toArray(new Field[e.size()])); + return var10; + } catch (Exception var9) { + return null; + } + } + + public static Field getField(Class cls, Class fieldType, int index) { + Field[] fields = getFields(cls, fieldType); + return index >= 0 && index < fields.length ? fields[index] : null; + } + + public static Field getFieldAfter(Class cls, Field field, Class fieldType, int index) { + Field[] fields = getFieldsAfter(cls, field, fieldType); + return index >= 0 && index < fields.length ? fields[index] : null; + } + + public static Object getFieldValue(Object obj, Class cls, Class fieldType) { + ReflectorField field = getReflectorField(cls, fieldType); + return field == null ? null : (!field.exists() ? null : Reflector.getFieldValue(obj, field)); + } + + public static Object getFieldValue(Object obj, Class cls, Class fieldType, int index) { + ReflectorField field = getReflectorField(cls, fieldType, index); + return field == null ? null : (!field.exists() ? null : Reflector.getFieldValue(obj, field)); + } + + public static boolean setFieldValue(Object obj, Class cls, Class fieldType, Object value) { + ReflectorField field = getReflectorField(cls, fieldType); + return field == null ? false : (!field.exists() ? false : Reflector.setFieldValue(obj, field, value)); + } + + public static boolean setFieldValue(Object obj, Class cls, Class fieldType, int index, Object value) { + ReflectorField field = getReflectorField(cls, fieldType, index); + return field == null ? false : (!field.exists() ? false : Reflector.setFieldValue(obj, field, value)); + } + + public static ReflectorField getReflectorField(Class cls, Class fieldType) { + Field field = getField(cls, fieldType); + + if (field == null) { + return null; + } else { + ReflectorClass rc = new ReflectorClass(cls); + return new ReflectorField(rc, field.getName()); + } + } + + public static ReflectorField getReflectorField(Class cls, Class fieldType, int index) { + Field field = getField(cls, fieldType, index); + + if (field == null) { + return null; + } else { + ReflectorClass rc = new ReflectorClass(cls); + return new ReflectorField(rc, field.getName()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RenderPlayerOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RenderPlayerOF.java new file mode 100644 index 0000000..a1f14b0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/RenderPlayerOF.java @@ -0,0 +1,73 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; +import java.util.Map; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class RenderPlayerOF extends RenderPlayer { + protected void renderEquippedItems(EntityLivingBase entityLiving, float partialTicks) { + super.renderEquippedItems(entityLiving, partialTicks); + this.renderEquippedItems(entityLiving, 0.0625F, partialTicks); + } + + private void renderEquippedItems(EntityLivingBase entityLiving, float scale, float partialTicks) { + if (Config.isShowCapes() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().showOptifineHats.getValue()) { + if (entityLiving instanceof AbstractClientPlayer) { + AbstractClientPlayer player = (AbstractClientPlayer)entityLiving; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GlStateManager.enableCull(); + ModelBiped modelBipedMain = (ModelBiped)this.mainModel; + PlayerConfigurations.renderPlayerItems(modelBipedMain, player, scale, partialTicks); + GlStateManager.disableCull(); + } + } + } + + public static void register() { + RenderManager rm = RenderManager.instance; + Map mapRenderTypes = getMapRenderTypes(rm); + + if (mapRenderTypes == null) { + Config.warn("RenderPlayerOF init() failed: RenderManager.MapRenderTypes not found"); + } else { + RenderPlayerOF rpof = new RenderPlayerOF(); + rpof.setRenderManager(rm); + mapRenderTypes.put(EntityPlayer.class, rpof); + } + } + + private static Map getMapRenderTypes(RenderManager rm) { + try { + Field[] e = Reflector.getFields(RenderManager.class, Map.class); + + for (int i = 0; i < e.length; ++i) { + Field field = e[i]; + Map map = (Map)field.get(rm); + + if (map != null) { + Object renderSteve = map.get(EntityPlayer.class); + + if (renderSteve instanceof RenderPlayer) { + return map; + } + } + } + + return null; + } catch (Exception var6) { + Config.warn("Error getting RenderManager.mapRenderTypes"); + Config.warn(var6.getClass().getName() + ": " + var6.getMessage()); + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ResUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ResUtils.java new file mode 100644 index 0000000..deb7fd1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ResUtils.java @@ -0,0 +1,153 @@ +package net.minecraft.src; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.LinkedHashSet; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import net.minecraft.client.resources.AbstractResourcePack; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.util.ResourceLocation; + +public class ResUtils { + public static String[] collectFiles(String prefix, String suffix) { + return collectFiles(new String[] {prefix}, new String[] {suffix}); + } + + public static String[] collectFiles(String[] prefixes, String[] suffixes) { + LinkedHashSet setPaths = new LinkedHashSet(); + IResourcePack[] rps = Config.getResourcePacks(); + + for (int paths = 0; paths < rps.length; ++paths) { + IResourcePack rp = rps[paths]; + String[] ps = collectFiles(rp, prefixes, suffixes, (String[])null); + setPaths.addAll(Arrays.asList(ps)); + } + + String[] var7 = (String[])setPaths.toArray(new String[setPaths.size()]); + return var7; + } + + public static String[] collectFiles(IResourcePack rp, String prefix, String suffix, String[] defaultPaths) { + return collectFiles(rp, new String[] {prefix}, new String[] {suffix}, defaultPaths); + } + + public static String[] collectFiles(IResourcePack rp, String[] prefixes, String[] suffixes) { + return collectFiles(rp, prefixes, suffixes, (String[])null); + } + + public static String[] collectFiles(IResourcePack rp, String[] prefixes, String[] suffixes, String[] defaultPaths) { + if (rp instanceof DefaultResourcePack) { + return collectFilesFixed(rp, defaultPaths); + } else if (!(rp instanceof AbstractResourcePack)) { + Config.warn("Unknown resource pack type: " + rp); + return new String[0]; + } else { + AbstractResourcePack arp = (AbstractResourcePack)rp; + File tpFile = ResourceUtils.getResourcePackFile(arp); + + if (tpFile == null) { + return new String[0]; + } else if (tpFile.isDirectory()) { + return collectFilesFolder(tpFile, "", prefixes, suffixes); + } else if (tpFile.isFile()) { + return collectFilesZIP(tpFile, prefixes, suffixes); + } else { + Config.warn("Unknown resource pack file: " + tpFile); + return new String[0]; + } + } + } + + private static String[] collectFilesFixed(IResourcePack rp, String[] paths) { + if (paths == null) { + return new String[0]; + } else { + ArrayList list = new ArrayList(); + + for (int pathArr = 0; pathArr < paths.length; ++pathArr) { + String path = paths[pathArr]; + ResourceLocation loc = new ResourceLocation(path); + + if (rp.resourceExists(loc)) { + list.add(path); + } + } + + String[] var6 = (String[])((String[])list.toArray(new String[list.size()])); + return var6; + } + } + + private static String[] collectFilesFolder(File tpFile, String basePath, String[] prefixes, String[] suffixes) { + ArrayList list = new ArrayList(); + String prefixAssets = "assets/minecraft/"; + File[] files = tpFile.listFiles(); + + if (files == null) { + return new String[0]; + } else { + for (int names = 0; names < files.length; ++names) { + File file = files[names]; + String dirPath; + + if (file.isFile()) { + dirPath = basePath + file.getName(); + + if (dirPath.startsWith(prefixAssets)) { + dirPath = dirPath.substring(prefixAssets.length()); + + if (StrUtils.startsWith(dirPath, prefixes) && StrUtils.endsWith(dirPath, suffixes)) { + list.add(dirPath); + } + } + } else if (file.isDirectory()) { + dirPath = basePath + file.getName() + "/"; + String[] names1 = collectFilesFolder(file, dirPath, prefixes, suffixes); + + for (int n = 0; n < names1.length; ++n) { + String name = names1[n]; + list.add(name); + } + } + } + + String[] var13 = (String[])((String[])list.toArray(new String[list.size()])); + return var13; + } + } + + private static String[] collectFilesZIP(File tpFile, String[] prefixes, String[] suffixes) { + ArrayList list = new ArrayList(); + String prefixAssets = "assets/minecraft/"; + + try { + ZipFile e = new ZipFile(tpFile); + Enumeration en = e.entries(); + + while (en.hasMoreElements()) { + ZipEntry names = (ZipEntry)en.nextElement(); + String name = names.getName(); + + if (name.startsWith(prefixAssets)) { + name = name.substring(prefixAssets.length()); + + if (StrUtils.startsWith(name, prefixes) && StrUtils.endsWith(name, suffixes)) { + list.add(name); + } + } + } + + e.close(); + String[] names1 = (String[])((String[])list.toArray(new String[list.size()])); + return names1; + } catch (IOException var9) { + var9.printStackTrace(); + return new String[0]; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ResourceUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ResourceUtils.java new file mode 100644 index 0000000..46bdbce --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/ResourceUtils.java @@ -0,0 +1,26 @@ +package net.minecraft.src; + +import java.io.File; +import net.minecraft.client.resources.AbstractResourcePack; + +public class ResourceUtils { + private static ReflectorClass ForgeAbstractResourcePack = new ReflectorClass(AbstractResourcePack.class); + private static ReflectorField ForgeAbstractResourcePack_resourcePackFile = new ReflectorField(ForgeAbstractResourcePack, "resourcePackFile"); + private static boolean directAccessValid = true; + + public static File getResourcePackFile(AbstractResourcePack arp) { + if (directAccessValid) { + try { + return arp.resourcePackFile; + } catch (IllegalAccessError var2) { + directAccessValid = false; + + if (!ForgeAbstractResourcePack_resourcePackFile.exists()) { + throw var2; + } + } + } + + return (File)Reflector.getFieldValue(arp, ForgeAbstractResourcePack_resourcePackFile); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/SmoothFloat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/SmoothFloat.java new file mode 100644 index 0000000..6b318a0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/SmoothFloat.java @@ -0,0 +1,71 @@ +package net.minecraft.src; + +public class SmoothFloat { + private float valueLast; + private final float timeFadeUpSec; + private final float timeFadeDownSec; + private long timeLastMs; + + public SmoothFloat(float valueLast, float timeFadeSec) { + this(valueLast, timeFadeSec, timeFadeSec); + } + + public SmoothFloat(float valueLast, float timeFadeUpSec, float timeFadeDownSec) { + this.valueLast = valueLast; + this.timeFadeUpSec = timeFadeUpSec; + this.timeFadeDownSec = timeFadeDownSec; + this.timeLastMs = System.currentTimeMillis(); + } + + public float getValueLast() { + return this.valueLast; + } + + public float getTimeFadeUpSec() { + return this.timeFadeUpSec; + } + + public float getTimeFadeDownSec() { + return this.timeFadeDownSec; + } + + public long getTimeLastMs() { + return this.timeLastMs; + } + + public float getSmoothValue(float value) { + long timeNowMs = System.currentTimeMillis(); + float valPrev = this.valueLast; + long timePrevMs = this.timeLastMs; + float timeDeltaSec = (float)(timeNowMs - timePrevMs) / 1000.0F; + float timeFadeSec = value >= valPrev ? this.timeFadeUpSec : this.timeFadeDownSec; + float valSmooth = getSmoothValue(valPrev, value, timeDeltaSec, timeFadeSec); + this.valueLast = valSmooth; + this.timeLastMs = timeNowMs; + return valSmooth; + } + + public static float getSmoothValue(float valPrev, float value, float timeDeltaSec, float timeFadeSec) { + if (timeDeltaSec <= 0.0F) { + return valPrev; + } else { + float valDelta = value - valPrev; + float valSmooth; + + if (timeFadeSec > 0.0F && timeDeltaSec < timeFadeSec && Math.abs(valDelta) > 1.0E-6F) { + float countUpdates = timeFadeSec / timeDeltaSec; + float k1 = 4.61F; + float k2 = 0.13F; + float k3 = 10.0F; + float kCorr = k1 - 1.0F / (k2 + countUpdates / k3); + float kTime = timeDeltaSec / timeFadeSec * kCorr; + kTime = NumUtils.limit(kTime, 0.0F, 1.0F); + valSmooth = valPrev + valDelta * kTime; + } else { + valSmooth = value; + } + + return valSmooth; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/StrUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/StrUtils.java new file mode 100644 index 0000000..aa59bdf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/StrUtils.java @@ -0,0 +1,554 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.StringTokenizer; + +public class StrUtils { + public static boolean equalsMask(String str, String mask, char wildChar, char wildCharSingle) { + if (mask != null && str != null) { + if (mask.indexOf(wildChar) < 0) { + return mask.indexOf(wildCharSingle) < 0 ? mask.equals(str) : equalsMaskSingle(str, mask, wildCharSingle); + } else { + ArrayList tokens = new ArrayList(); + String wildCharStr = "" + wildChar; + + if (mask.startsWith(wildCharStr)) { + tokens.add(""); + } + + StringTokenizer tok = new StringTokenizer(mask, wildCharStr); + + while (tok.hasMoreElements()) { + tokens.add(tok.nextToken()); + } + + if (mask.endsWith(wildCharStr)) { + tokens.add(""); + } + + String startTok = (String)tokens.get(0); + + if (!startsWithMaskSingle(str, startTok, wildCharSingle)) { + return false; + } else { + String endTok = (String)tokens.get(tokens.size() - 1); + + if (!endsWithMaskSingle(str, endTok, wildCharSingle)) { + return false; + } else { + int currPos = 0; + + for (int i = 0; i < tokens.size(); ++i) { + String token = (String)tokens.get(i); + + if (token.length() > 0) { + int foundPos = indexOfMaskSingle(str, token, currPos, wildCharSingle); + + if (foundPos < 0) { + return false; + } + + currPos = foundPos + token.length(); + } + } + + return true; + } + } + } + } else { + return mask == str; + } + } + + private static boolean equalsMaskSingle(String str, String mask, char wildCharSingle) { + if (str != null && mask != null) { + if (str.length() != mask.length()) { + return false; + } else { + for (int i = 0; i < mask.length(); ++i) { + char maskChar = mask.charAt(i); + + if (maskChar != wildCharSingle && str.charAt(i) != maskChar) { + return false; + } + } + + return true; + } + } else { + return str == mask; + } + } + + private static int indexOfMaskSingle(String str, String mask, int startPos, char wildCharSingle) { + if (str != null && mask != null) { + if (startPos >= 0 && startPos <= str.length()) { + if (str.length() < startPos + mask.length()) { + return -1; + } else { + for (int i = startPos; i + mask.length() <= str.length(); ++i) { + String subStr = str.substring(i, i + mask.length()); + + if (equalsMaskSingle(subStr, mask, wildCharSingle)) { + return i; + } + } + + return -1; + } + } else { + return -1; + } + } else { + return -1; + } + } + + private static boolean endsWithMaskSingle(String str, String mask, char wildCharSingle) { + if (str != null && mask != null) { + if (str.length() < mask.length()) { + return false; + } else { + String subStr = str.substring(str.length() - mask.length(), str.length()); + return equalsMaskSingle(subStr, mask, wildCharSingle); + } + } else { + return str == mask; + } + } + + private static boolean startsWithMaskSingle(String str, String mask, char wildCharSingle) { + if (str != null && mask != null) { + if (str.length() < mask.length()) { + return false; + } else { + String subStr = str.substring(0, mask.length()); + return equalsMaskSingle(subStr, mask, wildCharSingle); + } + } else { + return str == mask; + } + } + + public static boolean equalsMask(String str, String[] masks, char wildChar) { + for (int i = 0; i < masks.length; ++i) { + String mask = masks[i]; + + if (equalsMask(str, mask, wildChar)) { + return true; + } + } + + return false; + } + + public static boolean equalsMask(String str, String mask, char wildChar) { + if (mask != null && str != null) { + if (mask.indexOf(wildChar) < 0) { + return mask.equals(str); + } else { + ArrayList tokens = new ArrayList(); + String wildCharStr = "" + wildChar; + + if (mask.startsWith(wildCharStr)) { + tokens.add(""); + } + + StringTokenizer tok = new StringTokenizer(mask, wildCharStr); + + while (tok.hasMoreElements()) { + tokens.add(tok.nextToken()); + } + + if (mask.endsWith(wildCharStr)) { + tokens.add(""); + } + + String startTok = (String)tokens.get(0); + + if (!str.startsWith(startTok)) { + return false; + } else { + String endTok = (String)tokens.get(tokens.size() - 1); + + if (!str.endsWith(endTok)) { + return false; + } else { + int currPos = 0; + + for (int i = 0; i < tokens.size(); ++i) { + String token = (String)tokens.get(i); + + if (token.length() > 0) { + int foundPos = str.indexOf(token, currPos); + + if (foundPos < 0) { + return false; + } + + currPos = foundPos + token.length(); + } + } + + return true; + } + } + } + } else { + return mask == str; + } + } + + public static String[] split(String str, String separators) { + if (str != null && str.length() > 0) { + if (separators == null) { + return new String[] {str}; + } else { + ArrayList tokens = new ArrayList(); + int startPos = 0; + + for (int i = 0; i < str.length(); ++i) { + char ch = str.charAt(i); + + if (equals(ch, separators)) { + tokens.add(str.substring(startPos, i)); + startPos = i + 1; + } + } + + tokens.add(str.substring(startPos, str.length())); + return (String[])((String[])tokens.toArray(new String[tokens.size()])); + } + } else { + return new String[0]; + } + } + + private static boolean equals(char ch, String matches) { + for (int i = 0; i < matches.length(); ++i) { + if (matches.charAt(i) == ch) { + return true; + } + } + + return false; + } + + public static boolean equalsTrim(String a, String b) { + if (a != null) { + a = a.trim(); + } + + if (b != null) { + b = b.trim(); + } + + return equals(a, b); + } + + public static boolean isEmpty(String string) { + return string == null ? true : string.trim().length() <= 0; + } + + public static String stringInc(String str) { + int val = parseInt(str, -1); + + if (val == -1) { + return ""; + } else { + ++val; + String test = "" + val; + return test.length() > str.length() ? "" : fillLeft("" + val, str.length(), '0'); + } + } + + public static int parseInt(String s, int defVal) { + if (s == null) { + return defVal; + } else { + try { + return Integer.parseInt(s); + } catch (NumberFormatException var3) { + return defVal; + } + } + } + + public static boolean isFilled(String string) { + return !isEmpty(string); + } + + public static String addIfNotContains(String target, String source) { + for (int i = 0; i < source.length(); ++i) { + if (target.indexOf(source.charAt(i)) < 0) { + target = target + source.charAt(i); + } + } + + return target; + } + + public static String fillLeft(String s, int len, char fillChar) { + if (s == null) { + s = ""; + } + + if (s.length() >= len) { + return s; + } else { + StringBuffer buf = new StringBuffer(); + int bufLen = len - s.length(); + + while (buf.length() < bufLen) { + buf.append(fillChar); + } + + return buf.toString() + s; + } + } + + public static String fillRight(String s, int len, char fillChar) { + if (s == null) { + s = ""; + } + + if (s.length() >= len) { + return s; + } else { + StringBuffer buf = new StringBuffer(s); + + while (buf.length() < len) { + buf.append(fillChar); + } + + return buf.toString(); + } + } + + public static boolean equals(Object a, Object b) { + return a == b ? true : (a != null && a.equals(b) ? true : b != null && b.equals(a)); + } + + public static boolean startsWith(String str, String[] prefixes) { + if (str == null) { + return false; + } else if (prefixes == null) { + return false; + } else { + for (int i = 0; i < prefixes.length; ++i) { + String prefix = prefixes[i]; + + if (str.startsWith(prefix)) { + return true; + } + } + + return false; + } + } + + public static boolean endsWith(String str, String[] suffixes) { + if (str == null) { + return false; + } else if (suffixes == null) { + return false; + } else { + for (int i = 0; i < suffixes.length; ++i) { + String suffix = suffixes[i]; + + if (str.endsWith(suffix)) { + return true; + } + } + + return false; + } + } + + public static String removePrefix(String str, String prefix) { + if (str != null && prefix != null) { + if (str.startsWith(prefix)) { + str = str.substring(prefix.length()); + } + + return str; + } else { + return str; + } + } + + public static String removeSuffix(String str, String suffix) { + if (str != null && suffix != null) { + if (str.endsWith(suffix)) { + str = str.substring(0, str.length() - suffix.length()); + } + + return str; + } else { + return str; + } + } + + public static String replaceSuffix(String str, String suffix, String suffixNew) { + if (str != null && suffix != null) { + if (!str.endsWith(suffix)) { + return str; + } else { + if (suffixNew == null) { + suffixNew = ""; + } + + str = str.substring(0, str.length() - suffix.length()); + return str + suffixNew; + } + } else { + return str; + } + } + + public static String replacePrefix(String str, String prefix, String prefixNew) { + if (str != null && prefix != null) { + if (!str.startsWith(prefix)) { + return str; + } else { + if (prefixNew == null) { + prefixNew = ""; + } + + str = str.substring(prefix.length()); + return prefixNew + str; + } + } else { + return str; + } + } + + public static int findPrefix(String[] strs, String prefix) { + if (strs != null && prefix != null) { + for (int i = 0; i < strs.length; ++i) { + String str = strs[i]; + + if (str.startsWith(prefix)) { + return i; + } + } + + return -1; + } else { + return -1; + } + } + + public static int findSuffix(String[] strs, String suffix) { + if (strs != null && suffix != null) { + for (int i = 0; i < strs.length; ++i) { + String str = strs[i]; + + if (str.endsWith(suffix)) { + return i; + } + } + + return -1; + } else { + return -1; + } + } + + public static String[] remove(String[] strs, int start, int end) { + if (strs == null) { + return strs; + } else if (end > 0 && start < strs.length) { + if (start >= end) { + return strs; + } else { + ArrayList list = new ArrayList(strs.length); + + for (int strsNew = 0; strsNew < strs.length; ++strsNew) { + String str = strs[strsNew]; + + if (strsNew < start || strsNew >= end) { + list.add(str); + } + } + + String[] var6 = (String[])list.toArray(new String[list.size()]); + return var6; + } + } else { + return strs; + } + } + + public static String removeSuffix(String str, String[] suffixes) { + if (str != null && suffixes != null) { + int strLen = str.length(); + + for (int i = 0; i < suffixes.length; ++i) { + String suffix = suffixes[i]; + str = removeSuffix(str, suffix); + + if (str.length() != strLen) { + break; + } + } + + return str; + } else { + return str; + } + } + + public static String removePrefix(String str, String[] prefixes) { + if (str != null && prefixes != null) { + int strLen = str.length(); + + for (int i = 0; i < prefixes.length; ++i) { + String prefix = prefixes[i]; + str = removePrefix(str, prefix); + + if (str.length() != strLen) { + break; + } + } + + return str; + } else { + return str; + } + } + + public static String removePrefixSuffix(String str, String[] prefixes, String[] suffixes) { + str = removePrefix(str, prefixes); + str = removeSuffix(str, suffixes); + return str; + } + + public static String removePrefixSuffix(String str, String prefix, String suffix) { + return removePrefixSuffix(str, new String[] {prefix}, new String[] {suffix}); + } + + public static String getSegment(String str, String start, String end) { + if (str != null && start != null && end != null) { + int posStart = str.indexOf(start); + + if (posStart < 0) { + return null; + } else { + int posEnd = str.indexOf(end, posStart); + return posEnd < 0 ? null : str.substring(posStart, posEnd + end.length()); + } + } else { + return null; + } + } + + public static String addSuffixCheck(String str, String suffix) { + return str != null && suffix != null ? (str.endsWith(suffix) ? str : str + suffix) : str; + } + + public static String addPrefixCheck(String str, String prefix) { + return str != null && prefix != null ? (str.endsWith(prefix) ? str : prefix + str) : str; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimation.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimation.java new file mode 100644 index 0000000..24f1deb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimation.java @@ -0,0 +1,150 @@ +package net.minecraft.src; + +import java.nio.ByteBuffer; +import java.util.Properties; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class TextureAnimation { + private String srcTex = null; + private String dstTex = null; + ResourceLocation dstTexLoc = null; + private int dstTextId = -1; + private int dstX = 0; + private int dstY = 0; + private int frameWidth = 0; + private int frameHeight = 0; + private TextureAnimationFrame[] frames = null; + private int activeFrame = 0; + byte[] srcData = null; + private ByteBuffer imageData = null; + + public TextureAnimation(String texFrom, byte[] srcData, String texTo, ResourceLocation locTexTo, int dstX, int dstY, int frameWidth, int frameHeight, Properties props, int durDef) { + this.srcTex = texFrom; + this.dstTex = texTo; + this.dstTexLoc = locTexTo; + this.dstX = dstX; + this.dstY = dstY; + this.frameWidth = frameWidth; + this.frameHeight = frameHeight; + int frameLen = frameWidth * frameHeight * 4; + + if (srcData.length % frameLen != 0) { + Config.warn("Invalid animated texture length: " + srcData.length + ", frameWidth: " + frameWidth + ", frameHeight: " + frameHeight); + } + + this.srcData = srcData; + int numFrames = srcData.length / frameLen; + + if (props.get("tile.0") != null) { + for (int durationDefStr = 0; props.get("tile." + durationDefStr) != null; ++durationDefStr) { + numFrames = durationDefStr + 1; + } + } + + String var21 = (String)props.get("duration"); + int durationDef = Config.parseInt(var21, durDef); + this.frames = new TextureAnimationFrame[numFrames]; + + for (int i = 0; i < this.frames.length; ++i) { + String indexStr = (String)props.get("tile." + i); + int index = Config.parseInt(indexStr, i); + String durationStr = (String)props.get("duration." + i); + int duration = Config.parseInt(durationStr, durationDef); + TextureAnimationFrame frm = new TextureAnimationFrame(index, duration); + this.frames[i] = frm; + } + } + + public boolean nextFrame() { + if (this.frames.length <= 0) { + return false; + } else { + if (this.activeFrame >= this.frames.length) { + this.activeFrame = 0; + } + + TextureAnimationFrame frame = this.frames[this.activeFrame]; + ++frame.counter; + + if (frame.counter < frame.duration) { + return false; + } else { + frame.counter = 0; + ++this.activeFrame; + + if (this.activeFrame >= this.frames.length) { + this.activeFrame = 0; + } + + return true; + } + } + } + + public int getActiveFrameIndex() { + if (this.frames.length <= 0) { + return 0; + } else { + if (this.activeFrame >= this.frames.length) { + this.activeFrame = 0; + } + + TextureAnimationFrame frame = this.frames[this.activeFrame]; + return frame.index; + } + } + + public int getFrameCount() { + return this.frames.length; + } + + public boolean updateTexture() { + if (this.dstTextId < 0) { + ITextureObject frameLen = TextureUtils.getTexture(this.dstTexLoc); + + if (frameLen == null) { + return false; + } + + this.dstTextId = frameLen.getGlTextureId(); + } + + if (this.imageData == null) { + this.imageData = GLAllocation.createDirectByteBuffer(this.srcData.length); + this.imageData.put(this.srcData); + this.srcData = null; + } + + if (!this.nextFrame()) { + return false; + } else { + int frameLen1 = this.frameWidth * this.frameHeight * 4; + int imgNum = this.getActiveFrameIndex(); + int offset = frameLen1 * imgNum; + + if (offset + frameLen1 > this.imageData.capacity()) { + return false; + } else { + this.imageData.position(offset); + GlStateManager.bindTexture(this.dstTextId); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, this.dstX, this.dstY, this.frameWidth, this.frameHeight, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, this.imageData); + return true; + } + } + } + + public String getSrcTex() { + return this.srcTex; + } + + public String getDstTex() { + return this.dstTex; + } + + public ResourceLocation getDstTexLoc() { + return this.dstTexLoc; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimationFrame.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimationFrame.java new file mode 100644 index 0000000..ab278b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimationFrame.java @@ -0,0 +1,12 @@ +package net.minecraft.src; + +public class TextureAnimationFrame { + public int index = 0; + public int duration = 0; + public int counter = 0; + + public TextureAnimationFrame(int index, int duration) { + this.index = index; + this.duration = duration; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimations.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimations.java new file mode 100644 index 0000000..14bb076 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureAnimations.java @@ -0,0 +1,255 @@ +package net.minecraft.src; + +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Properties; +import javax.imageio.ImageIO; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; + +public class TextureAnimations { + private static TextureAnimation[] textureAnimations = null; + + public static void reset() { + textureAnimations = null; + } + + public static void update() { + textureAnimations = null; + IResourcePack[] rps = Config.getResourcePacks(); + textureAnimations = getTextureAnimations(rps); + + if (Config.isAnimatedTextures()) { + updateAnimations(); + } + } + + public static void updateCustomAnimations() { + if (textureAnimations != null) { + if (Config.isAnimatedTextures()) { + updateAnimations(); + } + } + } + + public static void updateAnimations() { + if (textureAnimations != null) { + for (int i = 0; i < textureAnimations.length; ++i) { + TextureAnimation anim = textureAnimations[i]; + anim.updateTexture(); + } + } + } + + public static TextureAnimation[] getTextureAnimations(IResourcePack[] rps) { + ArrayList list = new ArrayList(); + + for (int anims = 0; anims < rps.length; ++anims) { + IResourcePack rp = rps[anims]; + TextureAnimation[] tas = getTextureAnimations(rp); + + if (tas != null) { + list.addAll(Arrays.asList(tas)); + } + } + + TextureAnimation[] var5 = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()])); + return var5; + } + + public static TextureAnimation[] getTextureAnimations(IResourcePack rp) { + String[] animPropNames = ResUtils.collectFiles(rp, "mcpatcher/anim/", ".properties", (String[])null); + + if (animPropNames.length <= 0) { + return null; + } else { + ArrayList list = new ArrayList(); + + for (int anims = 0; anims < animPropNames.length; ++anims) { + String propName = animPropNames[anims]; + Config.dbg("Texture animation: " + propName); + + try { + ResourceLocation e = new ResourceLocation(propName); + InputStream in = rp.getInputStream(e); + Properties props = new Properties(); + props.load(in); + TextureAnimation anim = makeTextureAnimation(props, e); + + if (anim != null) { + ResourceLocation locDstTex = new ResourceLocation(anim.getDstTex()); + + if (Config.getDefiningResourcePack(locDstTex) != rp) { + Config.dbg("Skipped: " + propName + ", target texture not loaded from same resource pack"); + } else { + list.add(anim); + } + } + } catch (FileNotFoundException var10) { + Config.warn("File not found: " + var10.getMessage()); + } catch (IOException var11) { + var11.printStackTrace(); + } + } + + TextureAnimation[] var12 = (TextureAnimation[])((TextureAnimation[])list.toArray(new TextureAnimation[list.size()])); + return var12; + } + } + + public static TextureAnimation makeTextureAnimation(Properties props, ResourceLocation propLoc) { + String texFrom = props.getProperty("from"); + String texTo = props.getProperty("to"); + int x = Config.parseInt(props.getProperty("x"), -1); + int y = Config.parseInt(props.getProperty("y"), -1); + int width = Config.parseInt(props.getProperty("w"), -1); + int height = Config.parseInt(props.getProperty("h"), -1); + + if (texFrom != null && texTo != null) { + if (x >= 0 && y >= 0 && width >= 0 && height >= 0) { + texFrom = texFrom.trim(); + texTo = texTo.trim(); + String basePath = TextureUtils.getBasePath(propLoc.getResourcePath()); + texFrom = TextureUtils.fixResourcePath(texFrom, basePath); + texTo = TextureUtils.fixResourcePath(texTo, basePath); + byte[] imageBytes = getCustomTextureData(texFrom, width); + + if (imageBytes == null) { + Config.warn("TextureAnimation: Source texture not found: " + texTo); + return null; + } else { + int countPixels = imageBytes.length / 4; + int countFrames = countPixels / (width * height); + int countPixelsAllFrames = countFrames * width * height; + + if (countPixels != countPixelsAllFrames) { + Config.warn("TextureAnimation: Source texture has invalid number of frames: " + texFrom + ", frames: " + (float)countPixels / (float)(width * height)); + return null; + } else { + ResourceLocation locTexTo = new ResourceLocation(texTo); + + try { + InputStream e = Config.getResourceStream(locTexTo); + + if (e == null) { + Config.warn("TextureAnimation: Target texture not found: " + texTo); + return null; + } else { + BufferedImage imgTexTo = readTextureImage(e); + + if (x + width <= imgTexTo.getWidth() && y + height <= imgTexTo.getHeight()) { + TextureAnimation anim = new TextureAnimation(texFrom, imageBytes, texTo, locTexTo, x, y, width, height, props, 1); + return anim; + } else { + Config.warn("TextureAnimation: Animation coordinates are outside the target texture: " + texTo); + return null; + } + } + } catch (IOException var17) { + Config.warn("TextureAnimation: Target texture not found: " + texTo); + return null; + } + } + } + } else { + Config.warn("TextureAnimation: Invalid coordinates"); + return null; + } + } else { + Config.warn("TextureAnimation: Source or target texture not specified"); + return null; + } + } + + public static byte[] getCustomTextureData(String imagePath, int tileWidth) { + byte[] imageBytes = loadImage(imagePath, tileWidth); + + if (imageBytes == null) { + imageBytes = loadImage("/anim" + imagePath, tileWidth); + } + + return imageBytes; + } + + private static byte[] loadImage(String name, int targetWidth) { + GameSettings options = Config.getGameSettings(); + + try { + ResourceLocation e = new ResourceLocation(name); + InputStream in = Config.getResourceStream(e); + + if (in == null) { + return null; + } else { + BufferedImage image = readTextureImage(in); + in.close(); + + if (image == null) { + return null; + } else { + if (targetWidth > 0 && image.getWidth() != targetWidth) { + double width = (double)(image.getHeight() / image.getWidth()); + int ai = (int)((double)targetWidth * width); + image = scaleBufferedImage(image, targetWidth, ai); + } + + int var20 = image.getWidth(); + int height = image.getHeight(); + int[] var21 = new int[var20 * height]; + byte[] byteBuf = new byte[var20 * height * 4]; + image.getRGB(0, 0, var20, height, var21, 0, var20); + + for (int l = 0; l < var21.length; ++l) { + int alpha = var21[l] >> 24 & 255; + int red = var21[l] >> 16 & 255; + int green = var21[l] >> 8 & 255; + int blue = var21[l] & 255; + + if (options != null && options.anaglyph) { + int j3 = (red * 30 + green * 59 + blue * 11) / 100; + int l3 = (red * 30 + green * 70) / 100; + int j4 = (red * 30 + blue * 70) / 100; + red = j3; + green = l3; + blue = j4; + } + + byteBuf[l * 4 + 0] = (byte)red; + byteBuf[l * 4 + 1] = (byte)green; + byteBuf[l * 4 + 2] = (byte)blue; + byteBuf[l * 4 + 3] = (byte)alpha; + } + + return byteBuf; + } + } + } catch (FileNotFoundException var18) { + return null; + } catch (Exception var19) { + var19.printStackTrace(); + return null; + } + } + + private static BufferedImage readTextureImage(InputStream par1InputStream) throws IOException { + BufferedImage var2 = ImageIO.read(par1InputStream); + par1InputStream.close(); + return var2; + } + + public static BufferedImage scaleBufferedImage(BufferedImage image, int width, int height) { + BufferedImage scaledImage = new BufferedImage(width, height, 2); + Graphics2D gr = scaledImage.createGraphics(); + gr.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); + gr.drawImage(image, 0, 0, width, height, (ImageObserver)null); + return scaledImage; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureUtils.java new file mode 100644 index 0000000..0fba52e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TextureUtils.java @@ -0,0 +1,364 @@ +package net.minecraft.src; + +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.io.IOException; +import java.io.InputStream; +import java.nio.IntBuffer; +import javax.imageio.ImageIO; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.ITickableTextureObject; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IReloadableResourceManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.lwjgl.opengl.GL11; +import shadersmod.client.MultiTexID; +import shadersmod.client.Shaders; + +public class TextureUtils { + public static final String texGrassTop = "grass_top"; + public static final String texStone = "stone"; + public static final String texDirt = "dirt"; + public static final String texGrassSide = "grass_side"; + public static final String texStoneslabSide = "stone_slab_side"; + public static final String texStoneslabTop = "stone_slab_top"; + public static final String texBedrock = "bedrock"; + public static final String texSand = "sand"; + public static final String texGravel = "gravel"; + public static final String texLogOak = "log_oak"; + public static final String texLogOakTop = "log_oak_top"; + public static final String texGoldOre = "gold_ore"; + public static final String texIronOre = "iron_ore"; + public static final String texCoalOre = "coal_ore"; + public static final String texObsidian = "obsidian"; + public static final String texGrassSideOverlay = "grass_side_overlay"; + public static final String texSnow = "snow"; + public static final String texGrassSideSnowed = "grass_side_snowed"; + public static final String texMyceliumSide = "mycelium_side"; + public static final String texMyceliumTop = "mycelium_top"; + public static final String texDiamondOre = "diamond_ore"; + public static final String texRedstoneOre = "redstone_ore"; + public static final String texLapisOre = "lapis_ore"; + public static final String texLeavesOak = "leaves_oak"; + public static final String texLeavesOakOpaque = "leaves_oak_opaque"; + public static final String texLeavesJungle = "leaves_jungle"; + public static final String texLeavesJungleOpaque = "leaves_jungle_opaque"; + public static final String texCactusSide = "cactus_side"; + public static final String texClay = "clay"; + public static final String texFarmlandWet = "farmland_wet"; + public static final String texFarmlandDry = "farmland_dry"; + public static final String texNetherrack = "netherrack"; + public static final String texSoulSand = "soul_sand"; + public static final String texGlowstone = "glowstone"; + public static final String texLogSpruce = "log_spruce"; + public static final String texLogBirch = "log_birch"; + public static final String texLeavesSpruce = "leaves_spruce"; + public static final String texLeavesSpruceOpaque = "leaves_spruce_opaque"; + public static final String texLogJungle = "log_jungle"; + public static final String texEndStone = "end_stone"; + public static final String texSandstoneTop = "sandstone_top"; + public static final String texSandstoneBottom = "sandstone_bottom"; + public static final String texRedstoneLampOff = "redstone_lamp_off"; + public static final String texRedstoneLampOn = "redstone_lamp_on"; + public static final String texWaterStill = "water_still"; + public static final String texWaterFlow = "water_flow"; + public static final String texLavaStill = "lava_still"; + public static final String texLavaFlow = "lava_flow"; + public static final String texFireLayer0 = "fire_layer_0"; + public static final String texFireLayer1 = "fire_layer_1"; + public static final String texPortal = "portal"; + public static final String texGlass = "glass"; + public static final String texGlassPaneTop = "glass_pane_top"; + public static final String texCompass = "compass"; + public static final String texClock = "clock"; + public static IIcon iconGrassTop; + public static IIcon iconGrassSide; + public static IIcon iconGrassSideOverlay; + public static IIcon iconSnow; + public static IIcon iconGrassSideSnowed; + public static IIcon iconMyceliumSide; + public static IIcon iconMyceliumTop; + public static IIcon iconWaterStill; + public static IIcon iconWaterFlow; + public static IIcon iconLavaStill; + public static IIcon iconLavaFlow; + public static IIcon iconPortal; + public static IIcon iconFireLayer0; + public static IIcon iconFireLayer1; + public static IIcon iconGlass; + public static IIcon iconGlassPaneTop; + public static IIcon iconCompass; + public static IIcon iconClock; + private static IntBuffer staticBuffer = GLAllocation.createDirectIntBuffer(256); + + public static void update() { + TextureMap mapBlocks = TextureMap.textureMapBlocks; + + if (mapBlocks != null) { + iconGrassTop = mapBlocks.getIconSafe("grass_top"); + iconGrassSide = mapBlocks.getIconSafe("grass_side"); + iconGrassSideOverlay = mapBlocks.getIconSafe("grass_side_overlay"); + iconSnow = mapBlocks.getIconSafe("snow"); + iconGrassSideSnowed = mapBlocks.getIconSafe("grass_side_snowed"); + iconMyceliumSide = mapBlocks.getIconSafe("mycelium_side"); + iconMyceliumTop = mapBlocks.getIconSafe("mycelium_top"); + iconWaterStill = mapBlocks.getIconSafe("water_still"); + iconWaterFlow = mapBlocks.getIconSafe("water_flow"); + iconLavaStill = mapBlocks.getIconSafe("lava_still"); + iconLavaFlow = mapBlocks.getIconSafe("lava_flow"); + iconFireLayer0 = mapBlocks.getIconSafe("fire_layer_0"); + iconFireLayer1 = mapBlocks.getIconSafe("fire_layer_1"); + iconPortal = mapBlocks.getIconSafe("portal"); + iconGlass = mapBlocks.getIconSafe("glass"); + iconGlassPaneTop = mapBlocks.getIconSafe("glass_pane_top"); + TextureMap mapItems = TextureMap.textureMapItems; + + if (mapItems != null) { + iconCompass = mapItems.getIconSafe("compass"); + iconClock = mapItems.getIconSafe("clock"); + } + } + } + + public static BufferedImage fixTextureDimensions(String name, BufferedImage bi) { + if (name.startsWith("/mob/zombie") || name.startsWith("/mob/pigzombie")) { + int width = bi.getWidth(); + int height = bi.getHeight(); + + if (width == height * 2) { + BufferedImage scaledImage = new BufferedImage(width, height * 2, 2); + Graphics2D gr = scaledImage.createGraphics(); + gr.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); + gr.drawImage(bi, 0, 0, width, height, (ImageObserver)null); + return scaledImage; + } + } + + return bi; + } + + public static TextureAtlasSprite getTextureAtlasSprite(IIcon icon) { + return icon instanceof TextureAtlasSprite ? (TextureAtlasSprite)icon : null; + } + + public static int ceilPowerOfTwo(int val) { + int i; + + for (i = 1; i < val; i *= 2) { + ; + } + + return i; + } + + public static int getPowerOfTwo(int val) { + int i = 1; + int po2; + + for (po2 = 0; i < val; ++po2) { + i *= 2; + } + + return po2; + } + + public static int twoToPower(int power) { + int val = 1; + + for (int i = 0; i < power; ++i) { + val *= 2; + } + + return val; + } + + public static void refreshBlockTextures() { + Config.dbg("*** Reloading block textures ***"); + WrUpdates.finishCurrentUpdate(); + TextureMap.textureMapBlocks.loadTextureSafe(Config.getResourceManager()); + update(); + NaturalTextures.update(); + TextureMap.textureMapBlocks.updateAnimations(); + } + + public static ITextureObject getTexture(String path) { + return getTexture(new ResourceLocation(path)); + } + + public static ITextureObject getTexture(ResourceLocation loc) { + ITextureObject tex = Config.getTextureManager().getTexture(loc); + + if (tex != null) { + return tex; + } else if (!Config.hasResource(loc)) { + return null; + } else { + SimpleTexture tex1 = new SimpleTexture(loc); + Config.getTextureManager().loadTexture(loc, tex1); + return tex1; + } + } + + public static void resourcesReloaded(IResourceManager rm) { + if (TextureMap.textureMapBlocks != null) { + Config.dbg("*** Reloading custom textures ***"); + CustomSky.reset(); + TextureAnimations.reset(); + WrUpdates.finishCurrentUpdate(); + update(); + NaturalTextures.update(); + TextureAnimations.update(); + CustomColorizer.update(); + CustomSky.update(); + RandomMobs.resetTextures(); + Shaders.resourcesReloaded(); + Lang.resourcesReloaded(); + Config.updateTexturePackClouds(); + Config.getTextureManager().tick(); + } + } + + public static void refreshTextureMaps(IResourceManager rm) { + TextureMap.textureMapBlocks.loadTextureSafe(rm); + TextureMap.textureMapItems.loadTextureSafe(rm); + update(); + NaturalTextures.update(); + } + + public static void registerResourceListener() { + IResourceManager rm = Config.getResourceManager(); + + if (rm instanceof IReloadableResourceManager) { + IReloadableResourceManager tto = (IReloadableResourceManager)rm; + IResourceManagerReloadListener ttol = new IResourceManagerReloadListener() { + public void onResourceManagerReload(IResourceManager var1) { + TextureUtils.resourcesReloaded(var1); + } + }; + tto.registerReloadListener(ttol); + } + + ITickableTextureObject tto1 = new ITickableTextureObject() { + public void tick() { + TextureAnimations.updateCustomAnimations(); + } + public void loadTexture(IResourceManager var1) throws IOException {} + public int getGlTextureId() { + return 0; + } + public MultiTexID getMultiTexID() { + return null; + } + }; + ResourceLocation ttol1 = new ResourceLocation("optifine/TickableTextures"); + Config.getTextureManager().loadTickableTexture(ttol1, tto1); + } + + public static ResourceLocation fixResourceLocation(ResourceLocation loc, String basePath) { + if (!loc.getResourceDomain().equals("minecraft")) { + return loc; + } else { + String path = loc.getResourcePath(); + String pathFixed = fixResourcePath(path, basePath); + + if (pathFixed != path) { + loc = new ResourceLocation(loc.getResourceDomain(), pathFixed); + } + + return loc; + } + } + + public static String fixResourcePath(String path, String basePath) { + String strAssMc = "assets/minecraft/"; + + if (path.startsWith(strAssMc)) { + path = path.substring(strAssMc.length()); + return path; + } else if (path.startsWith("./")) { + path = path.substring(2); + + if (!basePath.endsWith("/")) { + basePath = basePath + "/"; + } + + path = basePath + path; + return path; + } else { + if (path.startsWith("/~")) { + path = path.substring(1); + } + + String strMcpatcher = "mcpatcher/"; + + if (path.startsWith("~/")) { + path = path.substring(2); + path = strMcpatcher + path; + return path; + } else if (path.startsWith("/")) { + path = strMcpatcher + path.substring(1); + return path; + } else { + return path; + } + } + } + + public static String getBasePath(String path) { + int pos = path.lastIndexOf(47); + return pos < 0 ? "" : path.substring(0, pos); + } + + public static BufferedImage readBufferedImage(InputStream is) throws IOException { + BufferedImage var1; + + try { + var1 = ImageIO.read(is); + } + finally { + IOUtils.closeQuietly(is); + } + + return var1; + } + + public static BufferedImage scaleImage(BufferedImage bi, int w2) { + int w = bi.getWidth(); + int h = bi.getHeight(); + int h2 = h * w2 / w; + BufferedImage bi2 = new BufferedImage(w2, h2, 2); + Graphics2D g2 = bi2.createGraphics(); + Object method = RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR; + + if (w2 < w || w2 % w != 0) { + method = RenderingHints.VALUE_INTERPOLATION_BILINEAR; + } + + g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, method); + g2.drawImage(bi, 0, 0, w2, h2, (ImageObserver)null); + return bi2; + } + + public static int getGLMaximumTextureSize() { + for (int i = 65536; i > 0; i >>= 1) { + GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (IntBuffer)null); + int err = GL11.glGetError(); + int width = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); + + if (width != 0) { + return i; + } + } + + return -1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TimedEvent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TimedEvent.java new file mode 100644 index 0000000..473f209 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TimedEvent.java @@ -0,0 +1,31 @@ +package net.minecraft.src; + +import java.util.HashMap; +import java.util.Map; + +public class TimedEvent { + private static Map mapEventTimes = new HashMap(); + + public static boolean isActive(String name, long timeIntervalMs) { + Map var3 = mapEventTimes; + + synchronized (mapEventTimes) { + long timeNowMs = System.currentTimeMillis(); + Long timeLastMsObj = (Long)mapEventTimes.get(name); + + if (timeLastMsObj == null) { + timeLastMsObj = new Long(timeNowMs); + mapEventTimes.put(name, timeLastMsObj); + } + + long timeLastMs = timeLastMsObj.longValue(); + + if (timeNowMs < timeLastMs + timeIntervalMs) { + return false; + } else { + mapEventTimes.put(name, new Long(timeNowMs)); + return true; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipManager.java new file mode 100644 index 0000000..71b8998 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipManager.java @@ -0,0 +1,71 @@ +package net.minecraft.src; + +import java.awt.Rectangle; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class TooltipManager { + private GuiScreen guiScreen; + private TooltipProvider tooltipProvider; + private int lastMouseX = 0; + private int lastMouseY = 0; + private long mouseStillTime = 0L; + + public TooltipManager(GuiScreen guiScreen, TooltipProvider tooltipProvider) { + this.guiScreen = guiScreen; + this.tooltipProvider = tooltipProvider; + } + + public void drawTooltips(int x, int y, List buttonList) { + if (Math.abs(x - this.lastMouseX) <= 5 && Math.abs(y - this.lastMouseY) <= 5) { + short activateDelay = 700; + + if (System.currentTimeMillis() >= this.mouseStillTime + (long)activateDelay) { + GuiButton btn = GuiScreenOF.getSelectedButton(x, y, buttonList); + + if (btn != null) { + Rectangle rect = this.tooltipProvider.getTooltipBounds(this.guiScreen, x, y); + String[] lines = this.tooltipProvider.getTooltipLines(btn, rect.width); + + if (lines != null) { + int i; + + if (this.tooltipProvider.isRenderBorder()) { + i = -528449408; + this.drawRectBorder(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, i); + } + + Gui.drawRect(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, -536870912); + + for (i = 0; i < lines.length; ++i) { + String line = lines[i]; + int col = 14540253; + + if (line.endsWith("!")) { + col = 16719904; + } + + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + fontRenderer.drawStringWithShadow(line, rect.x + 5, rect.y + 5 + i * 11, col); + } + } + } + } + } else { + this.lastMouseX = x; + this.lastMouseY = y; + this.mouseStillTime = System.currentTimeMillis(); + } + } + + private void drawRectBorder(int x1, int y1, int x2, int y2, int col) { + Gui.drawRect(x1, y1 - 1, x2, y1, col); + Gui.drawRect(x1, y2, x2, y2 + 1, col); + Gui.drawRect(x1 - 1, y1, x1, y2, col); + Gui.drawRect(x2, y1, x2 + 1, y2, col); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProvider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProvider.java new file mode 100644 index 0000000..1ed2f8d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProvider.java @@ -0,0 +1,13 @@ +package net.minecraft.src; + +import java.awt.Rectangle; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public interface TooltipProvider { + Rectangle getTooltipBounds(GuiScreen var1, int var2, int var3); + + String[] getTooltipLines(GuiButton var1, int var2); + + boolean isRenderBorder(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderEnumShaderOptions.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderEnumShaderOptions.java new file mode 100644 index 0000000..f96d140 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderEnumShaderOptions.java @@ -0,0 +1,45 @@ +package net.minecraft.src; + +import java.awt.Rectangle; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import shadersmod.client.EnumShaderOption; +import shadersmod.client.GuiButtonEnumShaderOption; + +public class TooltipProviderEnumShaderOptions implements TooltipProvider { + public Rectangle getTooltipBounds(GuiScreen guiScreen, int x, int y) { + int x1 = guiScreen.width - 450; + int y1 = 35; + + if (x1 < 10) { + x1 = 10; + } + + if (y <= y1 + 94) { + y1 += 100; + } + + int x2 = x1 + 150 + 150; + int y2 = y1 + 84 + 10; + return new Rectangle(x1, y1, x2 - x1, y2 - y1); + } + + public boolean isRenderBorder() { + return true; + } + + public String[] getTooltipLines(GuiButton btn, int width) { + if (!(btn instanceof GuiButtonEnumShaderOption)) { + return null; + } else { + GuiButtonEnumShaderOption gbeso = (GuiButtonEnumShaderOption)btn; + EnumShaderOption option = gbeso.getEnumShaderOption(); + String[] lines = this.getTooltipLines(option); + return lines; + } + } + + private String[] getTooltipLines(EnumShaderOption option) { + return TooltipProviderOptions.getTooltipLines(option.getResourceKey()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderOptions.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderOptions.java new file mode 100644 index 0000000..323515a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderOptions.java @@ -0,0 +1,59 @@ +package net.minecraft.src; + +import java.awt.Rectangle; +import java.util.ArrayList; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.settings.GameSettings; + +public class TooltipProviderOptions implements TooltipProvider { + public Rectangle getTooltipBounds(GuiScreen guiScreen, int x, int y) { + int x1 = guiScreen.width / 2 - 150; + int y1 = guiScreen.height / 6 - 7; + + if (y <= y1 + 98) { + y1 += 105; + } + + int x2 = x1 + 150 + 150; + int y2 = y1 + 84 + 10; + return new Rectangle(x1, y1, x2 - x1, y2 - y1); + } + + public boolean isRenderBorder() { + return false; + } + + public String[] getTooltipLines(GuiButton btn, int width) { + if (!(btn instanceof IOptionControl)) { + return null; + } else { + IOptionControl ctl = (IOptionControl)btn; + GameSettings.Options option = ctl.getOption(); + String[] lines = getTooltipLines(option.getEnumString()); + return lines; + } + } + + public static String[] getTooltipLines(String key) { + ArrayList list = new ArrayList(); + + for (int lines = 0; lines < 10; ++lines) { + String lineKey = key + ".tooltip." + (lines + 1); + String line = Lang.get(lineKey, (String)null); + + if (line == null) { + break; + } + + list.add(line); + } + + if (list.size() <= 0) { + return null; + } else { + String[] var5 = (String[])((String[])list.toArray(new String[list.size()])); + return var5; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderShaderOptions.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderShaderOptions.java new file mode 100644 index 0000000..b6f92a1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/TooltipProviderShaderOptions.java @@ -0,0 +1,111 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.settings.GameSettings; +import shadersmod.client.GuiButtonShaderOption; +import shadersmod.client.ShaderOption; +import shadersmod.client.ShaderOptionProfile; + +public class TooltipProviderShaderOptions extends TooltipProviderOptions { + public String[] getTooltipLines(GuiButton btn, int width) { + if (!(btn instanceof GuiButtonShaderOption)) { + return null; + } else { + GuiButtonShaderOption btnSo = (GuiButtonShaderOption)btn; + ShaderOption so = btnSo.getShaderOption(); + String[] lines = this.makeTooltipLines(so, width); + return lines; + } + } + + private String[] makeTooltipLines(ShaderOption so, int width) { + if (so instanceof ShaderOptionProfile) { + return null; + } else { + String name = so.getNameText(); + String desc = Config.normalize(so.getDescriptionText()).trim(); + String[] descs = this.splitDescription(desc); + GameSettings settings = Config.getGameSettings(); + String id = null; + + if (!name.equals(so.getName()) && settings.advancedItemTooltips) { + id = "\u00a78" + Lang.get("of.general.id") + ": " + so.getName(); + } + + String source = null; + + if (so.getPaths() != null && settings.advancedItemTooltips) { + source = "\u00a78" + Lang.get("of.general.from") + ": " + Config.arrayToString((Object[])so.getPaths()); + } + + String def = null; + + if (so.getValueDefault() != null && settings.advancedItemTooltips) { + String list = so.isEnabled() ? so.getValueText(so.getValueDefault()) : Lang.get("of.general.ambiguous"); + def = "\u00a78" + Lang.getDefault() + ": " + list; + } + + ArrayList list1 = new ArrayList(); + list1.add(name); + list1.addAll(Arrays.asList(descs)); + + if (id != null) { + list1.add(id); + } + + if (source != null) { + list1.add(source); + } + + if (def != null) { + list1.add(def); + } + + String[] lines = this.makeTooltipLines(width, list1); + return lines; + } + } + + private String[] splitDescription(String desc) { + if (desc.length() <= 0) { + return new String[0]; + } else { + desc = StrUtils.removePrefix(desc, "//"); + String[] descs = desc.split("\\. "); + + for (int i = 0; i < descs.length; ++i) { + descs[i] = "- " + descs[i].trim(); + descs[i] = StrUtils.removeSuffix(descs[i], "."); + } + + return descs; + } + } + + private String[] makeTooltipLines(int width, List args) { + FontRenderer fr = Config.getMinecraft().fontRenderer; + ArrayList list = new ArrayList(); + + for (int lines = 0; lines < args.size(); ++lines) { + String arg = (String)args.get(lines); + + if (arg != null && arg.length() > 0) { + List parts = fr.listFormattedStringToWidth(arg, width); + Iterator it = parts.iterator(); + + while (it.hasNext()) { + String part = (String)it.next(); + list.add(part); + } + } + } + + String[] var10 = (String[])((String[])list.toArray(new String[list.size()])); + return var10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VersionCheckThread.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VersionCheckThread.java new file mode 100644 index 0000000..3d0cb6d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VersionCheckThread.java @@ -0,0 +1,58 @@ +package net.minecraft.src; + +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import net.minecraft.client.ClientBrandRetriever; + +public class VersionCheckThread extends Thread { + public void run() { + HttpURLConnection conn = null; + + try { + Config.dbg("Checking for new version"); + URL e = new URL("http://optifine.net/version/1.7.10/HD_U.txt"); + conn = (HttpURLConnection)e.openConnection(); + + if (Config.getGameSettings().snooperEnabled) { + conn.setRequestProperty("OF-MC-Version", "1.7.10"); + conn.setRequestProperty("OF-MC-Brand", "" + ClientBrandRetriever.getClientModName()); + conn.setRequestProperty("OF-Edition", "HD_U"); + conn.setRequestProperty("OF-Release", "E7"); + conn.setRequestProperty("OF-Java-Version", "" + System.getProperty("java.version")); + conn.setRequestProperty("OF-CpuCount", "" + Config.getAvailableProcessors()); + conn.setRequestProperty("OF-OpenGL-Version", "" + Config.openGlVersion); + conn.setRequestProperty("OF-OpenGL-Vendor", "" + Config.openGlVendor); + } + + conn.setDoInput(true); + conn.setDoOutput(false); + conn.connect(); + + try { + InputStream in = conn.getInputStream(); + String verStr = Config.readInputStream(in); + in.close(); + String[] verLines = Config.tokenize(verStr, "\n\r"); + + if (verLines.length >= 1) { + String newVer = verLines[0].trim(); + Config.dbg("Version found: " + newVer); + + if (Config.compareRelease(newVer, "E7") <= 0) { + return; + } + + Config.setNewRelease(newVer); + return; + } + } finally { + if (conn != null) { + conn.disconnect(); + } + } + } catch (Exception var11) { + Config.dbg(var11.getClass().getName() + ": " + var11.getMessage()); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VertexData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VertexData.java new file mode 100644 index 0000000..c93be13 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VertexData.java @@ -0,0 +1,11 @@ +package net.minecraft.src; + +public class VertexData { + public double x; + public double y; + public double z; + public double u; + public double v; + public int color; + public int brightness; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VillagerProfession.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VillagerProfession.java new file mode 100644 index 0000000..ba360e2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/VillagerProfession.java @@ -0,0 +1,51 @@ +package net.minecraft.src; + +public class VillagerProfession { + private int profession; + private int[] careers; + + public VillagerProfession(int profession) { + this(profession, (int[])null); + } + + public VillagerProfession(int profession, int career) { + this(profession, new int[] {career}); + } + + public VillagerProfession(int profession, int[] careers) { + this.profession = profession; + this.careers = careers; + } + + public boolean matches(int prof, int car) { + return this.profession != prof ? false : this.careers == null || Config.equalsOne(car, this.careers); + } + + private boolean hasCareer(int car) { + return this.careers == null ? false : Config.equalsOne(car, this.careers); + } + + public boolean addCareer(int car) { + if (this.careers == null) { + this.careers = new int[] {car}; + return true; + } else if (this.hasCareer(car)) { + return false; + } else { + this.careers = Config.addIntToArray(this.careers, car); + return true; + } + } + + public int getProfession() { + return this.profession; + } + + public int[] getCareers() { + return this.careers; + } + + public String toString() { + return this.careers == null ? "" + this.profession : "" + this.profession + ":" + Config.arrayToString(this.careers); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldRendererSmooth.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldRendererSmooth.java new file mode 100644 index 0000000..c2936c3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldRendererSmooth.java @@ -0,0 +1,360 @@ +package net.minecraft.src; + +import java.util.HashSet; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.shader.TesselatorVertexState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import org.lwjgl.opengl.GL11; + +public class WorldRendererSmooth extends WorldRenderer { + private WrUpdateState updateState = new WrUpdateState(); + public int activeSet = 0; + public int[] activeListIndex = new int[] {0, 0}; + public int[][][] glWorkLists = new int[2][2][16]; + public boolean[] tempSkipRenderPass = new boolean[2]; + public TesselatorVertexState tempVertexState; + + public WorldRendererSmooth(World par1World, List par2List, int par3, int par4, int par5, int par6) { + super(par1World, par2List, par3, par4, par5, par6); + } + + private void checkGlWorkLists() { + if (this.glWorkLists[0][0][0] <= 0) { + int glWorkBase = this.renderGlobal.displayListAllocator.allocateDisplayLists(64); + + for (int set = 0; set < 2; ++set) { + int setBase = glWorkBase + set * 2 * 16; + + for (int pass = 0; pass < 2; ++pass) { + int passBase = setBase + pass * 16; + + for (int t = 0; t < 16; ++t) { + this.glWorkLists[set][pass][t] = passBase + t; + } + } + } + } + } + + /** + * Sets a new position for the renderer and setting it up so it can be reloaded with the new data for that position + */ + public void setPosition(int px, int py, int pz) { + if (this.isUpdating) { + WrUpdates.finishCurrentUpdate(); + } + + super.setPosition(px, py, pz); + } + + public void updateRenderer() { + if (this.worldObj != null) { + this.updateRenderer(0L); + this.finishUpdate(); + } + } + + public boolean updateRenderer(long finishTime) { + if (this.worldObj == null) { + return true; + } else { + this.needsUpdate = false; + + if (!this.isUpdating) { + if (this.needsBoxUpdate) { + GL11.glNewList(this.glRenderList + 2, GL11.GL_COMPILE); + RenderItem.renderAABB(AxisAlignedBB.getBoundingBox((double)this.posXClip, (double)this.posYClip, (double)this.posZClip, (double)(this.posXClip + 16), (double)(this.posYClip + 16), (double)(this.posZClip + 16))); + GL11.glEndList(); + this.needsBoxUpdate = false; + } + + if (Reflector.LightCache.exists()) { + Object xMin = Reflector.getFieldValue(Reflector.LightCache_cache); + Reflector.callVoid(xMin, Reflector.LightCache_clear, new Object[0]); + Reflector.callVoid(Reflector.BlockCoord_resetPool, new Object[0]); + } + + Chunk.isLit = false; + } + + int var27 = this.posX; + int yMin = this.posY; + int zMin = this.posZ; + int xMax = this.posX + 16; + int yMax = this.posY + 16; + int zMax = this.posZ + 16; + ChunkCacheOF chunkcache = null; + RenderBlocks renderblocks = null; + HashSet setOldEntityRenders = null; + int viewEntityPosX = 0; + int viewEntityPosY = 0; + int viewEntityPosZ = 0; + + if (!this.isUpdating) { + for (int setNewEntityRenderers = 0; setNewEntityRenderers < 2; ++setNewEntityRenderers) { + this.tempSkipRenderPass[setNewEntityRenderers] = true; + } + + this.tempVertexState = null; + Minecraft var28 = Minecraft.getMinecraft(); + EntityLivingBase renderPass = var28.renderViewEntity; + viewEntityPosX = MathHelper.floor_double(renderPass.posX); + viewEntityPosY = MathHelper.floor_double(renderPass.posY); + viewEntityPosZ = MathHelper.floor_double(renderPass.posZ); + byte renderNextPass = 1; + chunkcache = new ChunkCacheOF(this.worldObj, var27 - renderNextPass, yMin - renderNextPass, zMin - renderNextPass, xMax + renderNextPass, yMax + renderNextPass, zMax + renderNextPass, renderNextPass); + renderblocks = new RenderBlocks(chunkcache); + Reflector.callVoid(Reflector.ForgeHooksClient_setWorldRendererRB, new Object[] {renderblocks}); + setOldEntityRenders = new HashSet(); + setOldEntityRenders.addAll(this.tileEntityRenderers); + this.tileEntityRenderers.clear(); + } + + if (this.isUpdating || !chunkcache.extendedLevelsInChunkCache()) { + this.bytesDrawn = 0; + + if (!this.isUpdating) { + chunkcache.renderStart(); + } + + this.tessellator = Tessellator.instance; + boolean var29 = Reflector.ForgeHooksClient.exists(); + this.checkGlWorkLists(); + + for (int var31 = 0; var31 < 2; ++var31) { + boolean var32 = false; + boolean hasRenderedBlocks = false; + boolean hasGlList = false; + + for (int y = yMin; y < yMax; ++y) { + if (this.isUpdating) { + this.isUpdating = false; + chunkcache = this.updateState.chunkcache; + renderblocks = this.updateState.renderblocks; + Reflector.callVoid(Reflector.ForgeHooksClient_setWorldRendererRB, new Object[] {renderblocks}); + setOldEntityRenders = this.updateState.setOldEntityRenders; + viewEntityPosX = this.updateState.viewEntityPosX; + viewEntityPosY = this.updateState.viewEntityPosY; + viewEntityPosZ = this.updateState.viewEntityPosZ; + var31 = this.updateState.renderPass; + y = this.updateState.y; + var32 = this.updateState.flag; + hasRenderedBlocks = this.updateState.hasRenderedBlocks; + hasGlList = this.updateState.hasGlList; + + if (hasGlList) { + this.preRenderBlocksSmooth(var31); + } + } else if (hasGlList && finishTime != 0L && System.nanoTime() - finishTime > 0L && this.activeListIndex[var31] < 15) { + if (hasRenderedBlocks) { + this.tempSkipRenderPass[var31] = false; + } + + this.postRenderBlocksSmooth(var31, this.renderGlobal.renderViewEntity, false); + ++this.activeListIndex[var31]; + this.updateState.chunkcache = chunkcache; + this.updateState.renderblocks = renderblocks; + this.updateState.setOldEntityRenders = setOldEntityRenders; + this.updateState.viewEntityPosX = viewEntityPosX; + this.updateState.viewEntityPosY = viewEntityPosY; + this.updateState.viewEntityPosZ = viewEntityPosZ; + this.updateState.renderPass = var31; + this.updateState.y = y; + this.updateState.flag = var32; + this.updateState.hasRenderedBlocks = hasRenderedBlocks; + this.updateState.hasGlList = hasGlList; + this.isUpdating = true; + return false; + } + + for (int z = zMin; z < zMax; ++z) { + for (int x = var27; x < xMax; ++x) { + Block block = chunkcache.getBlock(x, y, z); + + if (block.getMaterial() != Material.air) { + if (!hasGlList) { + hasGlList = true; + this.preRenderBlocksSmooth(var31); + } + + boolean hasTileEntity = false; + + if (var29) { + hasTileEntity = Reflector.callBoolean(block, Reflector.ForgeBlock_hasTileEntity, new Object[] {Integer.valueOf(chunkcache.getBlockMetadata(x, y, z))}); + } + else { + hasTileEntity = block.hasTileEntity(); + } + + if (var31 == 0 && hasTileEntity) { + TileEntity blockPass = chunkcache.getTileEntity(x, y, z); + + if (TileEntityRendererDispatcher.instance.hasSpecialRenderer(blockPass)) { + this.tileEntityRenderers.add(blockPass); + } + } + + int var33 = block.getRenderBlockPass(); + + if (var33 > var31) { + var32 = true; + } + + boolean canRender = var33 == var31; + + if (Reflector.ForgeBlock_canRenderInPass.exists()) { + canRender = Reflector.callBoolean(block, Reflector.ForgeBlock_canRenderInPass, new Object[] {Integer.valueOf(var31)}); + } + + if (canRender) { + hasRenderedBlocks |= renderblocks.renderBlockByRenderType(block, x, y, z); + + if (block.getRenderType() == 0 && x == viewEntityPosX && y == viewEntityPosY && z == viewEntityPosZ) { + renderblocks.setRenderFromInside(true); + renderblocks.setRenderAllFaces(true); + renderblocks.renderBlockByRenderType(block, x, y, z); + renderblocks.setRenderFromInside(false); + renderblocks.setRenderAllFaces(false); + } + } + } + } + } + } + + if (hasRenderedBlocks) { + this.tempSkipRenderPass[var31] = false; + } + + if (hasGlList) { + this.postRenderBlocksSmooth(var31, this.renderGlobal.renderViewEntity, true); + } else { + hasRenderedBlocks = false; + } + + if (!var32) { + break; + } + } + + Reflector.callVoid(Reflector.ForgeHooksClient_setWorldRendererRB, new Object[] {(RenderBlocks)null}); + chunkcache.renderFinish(); + } + + HashSet var30 = new HashSet(); + var30.addAll(this.tileEntityRenderers); + var30.removeAll(setOldEntityRenders); + this.tileEntities.addAll(var30); + setOldEntityRenders.removeAll(this.tileEntityRenderers); + this.tileEntities.removeAll(setOldEntityRenders); + this.isChunkLit = Chunk.isLit; + this.isInitialized = true; + ++chunksUpdated; + this.isVisible = true; + this.isVisibleFromPosition = false; + this.skipRenderPass[0] = this.tempSkipRenderPass[0]; + this.skipRenderPass[1] = this.tempSkipRenderPass[1]; + this.skipAllRenderPasses = this.skipRenderPass[0] && this.skipRenderPass[1]; + this.vertexState = this.tempVertexState; + this.isUpdating = false; + this.updateFinished(); + return true; + } + } + + protected void preRenderBlocksSmooth(int renderpass) { + GL11.glNewList(this.glWorkLists[this.activeSet][renderpass][this.activeListIndex[renderpass]], GL11.GL_COMPILE); + this.tessellator.setRenderingChunk(true); + + if (Config.isFastRender()) { + Reflector.callVoid(Reflector.ForgeHooksClient_onPreRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.startDrawingQuads(); + this.tessellator.setTranslation((double)(-globalChunkOffsetX), 0.0D, (double)(-globalChunkOffsetZ)); + } else { + GL11.glPushMatrix(); + this.setupGLTranslation(); + float var2 = 1.000001F; + GL11.glTranslatef(-8.0F, -8.0F, -8.0F); + GL11.glScalef(var2, var2, var2); + GL11.glTranslatef(8.0F, 8.0F, 8.0F); + Reflector.callVoid(Reflector.ForgeHooksClient_onPreRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.startDrawingQuads(); + this.tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); + } + } + + protected void postRenderBlocksSmooth(int renderpass, EntityLivingBase entityLiving, boolean updateFinished) { + if (Config.isTranslucentBlocksFancy() && renderpass == 1 && !this.tempSkipRenderPass[renderpass]) { + TesselatorVertexState tsv = this.tessellator.getVertexState((float)entityLiving.posX, (float)entityLiving.posY, (float)entityLiving.posZ); + + if (this.tempVertexState == null) { + this.tempVertexState = tsv; + } else { + this.tempVertexState.addTessellatorVertexState(tsv); + } + } + + this.bytesDrawn += this.tessellator.draw(); + Reflector.callVoid(Reflector.ForgeHooksClient_onPostRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.setRenderingChunk(false); + + if (!Config.isFastRender()) { + GL11.glPopMatrix(); + } + + GL11.glEndList(); + this.tessellator.setTranslation(0.0D, 0.0D, 0.0D); + } + + public void finishUpdate() { + int pass; + int i; + int list; + + for (pass = 0; pass < 2; ++pass) { + if (!this.skipRenderPass[pass]) { + GL11.glNewList(this.glRenderList + pass, GL11.GL_COMPILE); + + for (i = 0; i <= this.activeListIndex[pass]; ++i) { + list = this.glWorkLists[this.activeSet][pass][i]; + GL11.glCallList(list); + } + + GL11.glEndList(); + } + } + + if (this.activeSet == 0) { + this.activeSet = 1; + } else { + this.activeSet = 0; + } + + for (pass = 0; pass < 2; ++pass) { + if (!this.skipRenderPass[pass]) { + for (i = 0; i <= this.activeListIndex[pass]; ++i) { + list = this.glWorkLists[this.activeSet][pass][i]; + GL11.glNewList(list, GL11.GL_COMPILE); + GL11.glEndList(); + } + } + } + + for (pass = 0; pass < 2; ++pass) { + this.activeListIndex[pass] = 0; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldRendererThreaded.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldRendererThreaded.java new file mode 100644 index 0000000..887f392 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldRendererThreaded.java @@ -0,0 +1,277 @@ +package net.minecraft.src; + +import java.util.HashSet; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.shader.TesselatorVertexState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import org.lwjgl.opengl.GL11; + +public class WorldRendererThreaded extends WorldRenderer { + private int glRenderListWork; + private int glRenderListBoundingBox; + public boolean[] tempSkipRenderPass = new boolean[2]; + public TesselatorVertexState tempVertexState; + private Tessellator tessellatorWork = null; + + public WorldRendererThreaded(World par1World, List par2List, int par3, int par4, int par5, int par6) { + super(par1World, par2List, par3, par4, par5, par6); + RenderGlobal renderGlobal = Minecraft.getMinecraft().renderGlobal; + this.glRenderListWork = renderGlobal.displayListAllocator.allocateDisplayLists(2); + this.glRenderListBoundingBox = this.glRenderList + 2; + } + + /** + * Sets a new position for the renderer and setting it up so it can be reloaded with the new data for that position + */ + public void setPosition(int px, int py, int pz) { + if (this.isUpdating) { + WrUpdates.finishCurrentUpdate(); + } + + super.setPosition(px, py, pz); + } + + public void updateRenderer() { + if (this.worldObj != null) { + this.updateRenderer((IWrUpdateListener)null); + this.finishUpdate(); + } + } + + public void updateRenderer(IWrUpdateListener updateListener) { + if (this.worldObj != null) { + this.needsUpdate = false; + int xMin = this.posX; + int yMin = this.posY; + int zMin = this.posZ; + int xMax = this.posX + 16; + int yMax = this.posY + 16; + int zMax = this.posZ + 16; + + for (int hashset = 0; hashset < this.tempSkipRenderPass.length; ++hashset) { + this.tempSkipRenderPass[hashset] = true; + } + + Chunk.isLit = false; + HashSet var30 = new HashSet(); + var30.addAll(this.tileEntityRenderers); + this.tileEntityRenderers.clear(); + Minecraft var9 = Minecraft.getMinecraft(); + EntityLivingBase var10 = var9.renderViewEntity; + int viewEntityPosX = MathHelper.floor_double(var10.posX); + int viewEntityPosY = MathHelper.floor_double(var10.posY); + int viewEntityPosZ = MathHelper.floor_double(var10.posZ); + byte one = 1; + ChunkCacheOF chunkcache = new ChunkCacheOF(this.worldObj, xMin - one, yMin - one, zMin - one, xMax + one, yMax + one, zMax + one, one); + + if (!chunkcache.extendedLevelsInChunkCache()) { + ++chunksUpdated; + chunkcache.renderStart(); + RenderBlocks hashset1 = new RenderBlocks(chunkcache); + Reflector.callVoid(Reflector.ForgeHooksClient_setWorldRendererRB, new Object[] {hashset1}); + this.bytesDrawn = 0; + this.tempVertexState = null; + this.tessellator = Tessellator.instance; + boolean hasForge = Reflector.ForgeHooksClient.exists(); + WrUpdateControl uc = new WrUpdateControl(); + + for (int renderPass = 0; renderPass < 2; ++renderPass) { + uc.setRenderPass(renderPass); + boolean renderNextPass = false; + boolean hasRenderedBlocks = false; + boolean hasGlList = false; + + for (int y = yMin; y < yMax; ++y) { + if (hasRenderedBlocks && updateListener != null) { + updateListener.updating(uc); + this.tessellator = Tessellator.instance; + } + + for (int z = zMin; z < zMax; ++z) { + for (int x = xMin; x < xMax; ++x) { + Block block = chunkcache.getBlock(x, y, z); + + if (block.getMaterial() != Material.air) { + if (!hasGlList) { + hasGlList = true; + this.preRenderBlocksThreaded(renderPass); + } + + boolean hasTileEntity = false; + + if (hasForge) { + hasTileEntity = Reflector.callBoolean(block, Reflector.ForgeBlock_hasTileEntity, new Object[] {Integer.valueOf(chunkcache.getBlockMetadata(x, y, z))}); + } + else { + hasTileEntity = block.hasTileEntity(); + } + + if (renderPass == 0 && hasTileEntity) { + TileEntity blockPass = chunkcache.getTileEntity(x, y, z); + + if (TileEntityRendererDispatcher.instance.hasSpecialRenderer(blockPass)) { + this.tileEntityRenderers.add(blockPass); + } + } + + int var32 = block.getRenderBlockPass(); + + if (var32 > renderPass) { + renderNextPass = true; + } + + boolean canRender = var32 == renderPass; + + if (Reflector.ForgeBlock_canRenderInPass.exists()) { + canRender = Reflector.callBoolean(block, Reflector.ForgeBlock_canRenderInPass, new Object[] {Integer.valueOf(renderPass)}); + } + + if (canRender) { + hasRenderedBlocks |= hashset1.renderBlockByRenderType(block, x, y, z); + + if (block.getRenderType() == 0 && x == viewEntityPosX && y == viewEntityPosY && z == viewEntityPosZ) { + hashset1.setRenderFromInside(true); + hashset1.setRenderAllFaces(true); + hashset1.renderBlockByRenderType(block, x, y, z); + hashset1.setRenderFromInside(false); + hashset1.setRenderAllFaces(false); + } + } + } + } + } + } + + if (hasRenderedBlocks) { + this.tempSkipRenderPass[renderPass] = false; + } + + if (hasGlList) { + if (updateListener != null) { + updateListener.updating(uc); + } + + this.tessellator = Tessellator.instance; + this.postRenderBlocksThreaded(renderPass, this.renderGlobal.renderViewEntity); + } else { + hasRenderedBlocks = false; + } + + if (!renderNextPass) { + break; + } + } + + Reflector.callVoid(Reflector.ForgeHooksClient_setWorldRendererRB, new Object[] {(RenderBlocks)null}); + chunkcache.renderFinish(); + } + + HashSet var31 = new HashSet(); + var31.addAll(this.tileEntityRenderers); + var31.removeAll(var30); + this.tileEntities.addAll(var31); + var30.removeAll(this.tileEntityRenderers); + this.tileEntities.removeAll(var30); + this.isChunkLit = Chunk.isLit; + this.isInitialized = true; + } + } + + protected void preRenderBlocksThreaded(int renderpass) { + GL11.glNewList(this.glRenderListWork + renderpass, GL11.GL_COMPILE); + this.tessellator.setRenderingChunk(true); + + if (Config.isFastRender()) { + Reflector.callVoid(Reflector.ForgeHooksClient_onPreRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.startDrawingQuads(); + this.tessellator.setTranslation((double)(-globalChunkOffsetX), 0.0D, (double)(-globalChunkOffsetZ)); + } else { + GL11.glPushMatrix(); + this.setupGLTranslation(); + float var2 = 1.000001F; + GL11.glTranslatef(-8.0F, -8.0F, -8.0F); + GL11.glScalef(var2, var2, var2); + GL11.glTranslatef(8.0F, 8.0F, 8.0F); + Reflector.callVoid(Reflector.ForgeHooksClient_onPreRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.startDrawingQuads(); + this.tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); + } + } + + protected void postRenderBlocksThreaded(int renderpass, EntityLivingBase entityLiving) { + if (Config.isTranslucentBlocksFancy() && renderpass == 1 && !this.tempSkipRenderPass[renderpass]) { + this.tempVertexState = this.tessellator.getVertexState((float)entityLiving.posX, (float)entityLiving.posY, (float)entityLiving.posZ); + } + + this.bytesDrawn += this.tessellator.draw(); + Reflector.callVoid(Reflector.ForgeHooksClient_onPostRenderWorld, new Object[] {this, Integer.valueOf(renderpass)}); + this.tessellator.setRenderingChunk(false); + + if (!Config.isFastRender()) { + GL11.glPopMatrix(); + } + + GL11.glEndList(); + this.tessellator.setTranslation(0.0D, 0.0D, 0.0D); + } + + public void finishUpdate() { + int temp = this.glRenderList; + this.glRenderList = this.glRenderListWork; + this.glRenderListWork = temp; + int lightCache; + + for (lightCache = 0; lightCache < 2; ++lightCache) { + if (!this.skipRenderPass[lightCache]) { + GL11.glNewList(this.glRenderListWork + lightCache, GL11.GL_COMPILE); + GL11.glEndList(); + } + } + + for (lightCache = 0; lightCache < 2; ++lightCache) { + this.skipRenderPass[lightCache] = this.tempSkipRenderPass[lightCache]; + } + + this.skipAllRenderPasses = this.skipRenderPass[0] && this.skipRenderPass[1]; + + if (this.needsBoxUpdate && !this.skipAllRenderPasses()) { + GL11.glNewList(this.glRenderListBoundingBox, GL11.GL_COMPILE); + RenderItem.renderAABB(AxisAlignedBB.getBoundingBox((double)this.posXClip, (double)this.posYClip, (double)this.posZClip, (double)(this.posXClip + 16), (double)(this.posYClip + 16), (double)(this.posZClip + 16))); + GL11.glEndList(); + this.needsBoxUpdate = false; + } + + this.vertexState = this.tempVertexState; + this.isVisible = true; + this.isVisibleFromPosition = false; + + if (Reflector.LightCache.exists()) { + Object var3 = Reflector.getFieldValue(Reflector.LightCache_cache); + Reflector.callVoid(var3, Reflector.LightCache_clear, new Object[0]); + Reflector.callVoid(Reflector.BlockCoord_resetPool, new Object[0]); + } + + this.updateFinished(); + } + + /** + * Renders the occlusion query GL List + */ + public void callOcclusionQueryList() { + GL11.glCallList(this.glRenderListBoundingBox); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldServerMultiOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldServerMultiOF.java new file mode 100644 index 0000000..296ec4c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldServerMultiOF.java @@ -0,0 +1,23 @@ +package net.minecraft.src; + +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.DerivedWorldInfo; +import net.minecraft.world.storage.ISaveHandler; + +public class WorldServerMultiOF extends WorldServerOF { + public WorldServerMultiOF(MinecraftServer p_i45283_1_, ISaveHandler p_i45283_2_, String p_i45283_3_, int p_i45283_4_, WorldSettings p_i45283_5_, WorldServer p_i45283_6_, Profiler p_i45283_7_) { + super(p_i45283_1_, p_i45283_2_, p_i45283_3_, p_i45283_4_, p_i45283_5_, p_i45283_7_); + this.mapStorage = p_i45283_6_.mapStorage; + this.worldScoreboard = p_i45283_6_.getScoreboard(); + this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo()); + } + + /** + * Saves the chunks to disk. + */ + protected void saveLevel() throws MinecraftException {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldServerOF.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldServerOF.java new file mode 100644 index 0000000..e7443b5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WorldServerOF.java @@ -0,0 +1,327 @@ +package net.minecraft.src; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.ISaveHandler; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class WorldServerOF extends WorldServer { + private NextTickHashSet pendingTickListEntriesHashSet; + private TreeSet pendingTickListEntriesTreeSet; + private List pendingTickListEntriesThisTick = new ArrayList(); + private int lastViewDistance = 0; + private boolean allChunksTicked = false; + public Set setChunkCoordsToTickOnce = new HashSet(); + private Set limitedChunkSet = new HashSet(); + private static final Logger logger = LogManager.getLogger(); + + public WorldServerOF(MinecraftServer par1MinecraftServer, ISaveHandler par2iSaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler) { + super(par1MinecraftServer, par2iSaveHandler, par3Str, par4, par5WorldSettings, par6Profiler); + this.fixSetNextTicks(); + } + + protected void initialize(WorldSettings par1WorldSettings) { + super.initialize(par1WorldSettings); + this.fixSetNextTicks(); + } + + private void fixSetNextTicks() { + try { + Field[] e = WorldServer.class.getDeclaredFields(); + int posSet = this.findField(e, Set.class, 0); + int posTreeSet = this.findField(e, TreeSet.class, posSet); + int posList = this.findField(e, List.class, posTreeSet); + + if (posSet >= 0 && posTreeSet >= 0 && posList >= 0) { + Field fieldSet = e[posSet]; + Field fieldTreeSet = e[posTreeSet]; + Field fieldList = e[posList]; + fieldSet.setAccessible(true); + fieldTreeSet.setAccessible(true); + fieldList.setAccessible(true); + this.pendingTickListEntriesTreeSet = (TreeSet)fieldTreeSet.get(this); + this.pendingTickListEntriesThisTick = (List)fieldList.get(this); + Set oldSet = (Set)fieldSet.get(this); + + if (oldSet instanceof NextTickHashSet) { + return; + } + + this.pendingTickListEntriesHashSet = new NextTickHashSet(oldSet); + fieldSet.set(this, this.pendingTickListEntriesHashSet); + Config.dbg("WorldServer.nextTickSet updated"); + return; + } + + Config.warn("Error updating WorldServer.nextTickSet"); + } catch (Exception var9) { + Config.warn("Error setting WorldServer.nextTickSet: " + var9.getMessage()); + } + } + + private int findField(Field[] fields, Class cls, int startPos) { + if (startPos < 0) { + return -1; + } else { + for (int i = startPos; i < fields.length; ++i) { + Field field = fields[i]; + + if (field.getType() == cls) { + return i; + } + } + + return -1; + } + } + + public List getPendingBlockUpdates(Chunk par1Chunk, boolean par2) { + if (this.pendingTickListEntriesHashSet != null && this.pendingTickListEntriesTreeSet != null && this.pendingTickListEntriesThisTick != null) { + ArrayList var3 = null; + ChunkCoordIntPair var4 = par1Chunk.getChunkCoordIntPair(); + int var5 = (var4.chunkXPos << 4) - 2; + int var6 = var5 + 16 + 2; + int var7 = (var4.chunkZPos << 4) - 2; + int var8 = var7 + 16 + 2; + + for (int var9 = 0; var9 < 2; ++var9) { + Iterator var10; + + if (var9 == 0) { + TreeSet var11 = new TreeSet(); + + for (int dx = -1; dx <= 1; ++dx) { + for (int dz = -1; dz <= 1; ++dz) { + HashSet set = this.pendingTickListEntriesHashSet.getNextTickEntriesSet(var4.chunkXPos + dx, var4.chunkZPos + dz); + var11.addAll(set); + } + } + + var10 = var11.iterator(); + } else { + var10 = this.pendingTickListEntriesThisTick.iterator(); + + if (!this.pendingTickListEntriesThisTick.isEmpty()) { + logger.debug("toBeTicked = " + this.pendingTickListEntriesThisTick.size()); + } + } + + while (var10.hasNext()) { + NextTickListEntry var15 = (NextTickListEntry)var10.next(); + + if (var15.xCoord >= var5 && var15.xCoord < var6 && var15.zCoord >= var7 && var15.zCoord < var8) { + if (par2) { + this.pendingTickListEntriesHashSet.remove(var15); + this.pendingTickListEntriesTreeSet.remove(var15); + var10.remove(); + } + + if (var3 == null) { + var3 = new ArrayList(); + } + + var3.add(var15); + } + } + } + + return var3; + } else { + return super.getPendingBlockUpdates(par1Chunk, par2); + } + } + + /** + * Runs a single tick for the world + */ + public void tick() { + super.tick(); + + if (!Config.isTimeDefault()) { + this.fixWorldTime(); + } + + if (Config.waterOpacityChanged) { + Config.waterOpacityChanged = false; + ClearWater.updateWaterOpacity(Config.getGameSettings(), this); + } + } + + /** + * Updates all weather states. + */ + protected void updateWeather() { + if (!Config.isWeatherEnabled()) { + this.fixWorldWeather(); + } + + super.updateWeather(); + } + + private void fixWorldWeather() { + if (this.worldInfo.isRaining() || this.worldInfo.isThundering()) { + this.worldInfo.setRainTime(0); + this.worldInfo.setRaining(false); + this.setRainStrength(0.0F); + this.worldInfo.setThunderTime(0); + this.worldInfo.setThundering(false); + this.setThunderStrength(0.0F); + this.func_73046_m().getConfigurationManager().func_148540_a(new S2BPacketChangeGameState(2, 0.0F)); + this.func_73046_m().getConfigurationManager().func_148540_a(new S2BPacketChangeGameState(7, 0.0F)); + this.func_73046_m().getConfigurationManager().func_148540_a(new S2BPacketChangeGameState(8, 0.0F)); + } + } + + private void fixWorldTime() { + if (this.worldInfo.getGameType().getID() == 1) { + long time = this.getWorldTime(); + long timeOfDay = time % 24000L; + + if (Config.isTimeDayOnly()) { + if (timeOfDay <= 1000L) { + this.setWorldTime(time - timeOfDay + 1001L); + } + + if (timeOfDay >= 11000L) { + this.setWorldTime(time - timeOfDay + 24001L); + } + } + + if (Config.isTimeNightOnly()) { + if (timeOfDay <= 14000L) { + this.setWorldTime(time - timeOfDay + 14001L); + } + + if (timeOfDay >= 22000L) { + this.setWorldTime(time - timeOfDay + 24000L + 14001L); + } + } + } + } + + public void g(Entity par1Entity) { + if (this.canSkipEntityUpdate(par1Entity) && par1Entity instanceof EntityLivingBase) { + EntityLivingBase elb = (EntityLivingBase)par1Entity; + int entityAge = EntityUtils.getEntityAge(elb); + ++entityAge; + + if (elb instanceof EntityMob) { + float el = elb.getBrightness(1.0F); + + if (el > 0.5F) { + entityAge += 2; + } + } + + EntityUtils.setEntityAge(elb, entityAge); + + if (elb instanceof EntityLiving) { + EntityLiving var5 = (EntityLiving)elb; + EntityUtils.despawnEntity(var5); + } + } else { + super.updateEntity(par1Entity); + + if (Config.isSmoothWorld()) { + Thread.currentThread(); + Thread.yield(); + } + } + } + + private boolean canSkipEntityUpdate(Entity entity) { + if (!(entity instanceof EntityLivingBase)) { + return false; + } else { + EntityLivingBase entityLiving = (EntityLivingBase)entity; + + if (entityLiving.isChild()) { + return false; + } else if (entityLiving.hurtTime > 0) { + return false; + } else if (entity.ticksExisted < 20) { + return false; + } else if (this.playerEntities.size() != 1) { + return false; + } else { + Entity player = (Entity)this.playerEntities.get(0); + double dx = Math.max(Math.abs(entity.posX - player.posX) - 16.0D, 0.0D); + double dz = Math.max(Math.abs(entity.posZ - player.posZ) - 16.0D, 0.0D); + double distSq = dx * dx + dz * dz; + return !entity.isInRangeToRenderDist(distSq); + } + } + } + + protected void setActivePlayerChunksAndCheckLight() { + super.setActivePlayerChunksAndCheckLight(); + this.limitedChunkSet.clear(); + int viewDistance = this.func_152379_p(); + + if (viewDistance > 10) { + if (viewDistance != this.lastViewDistance) { + this.lastViewDistance = viewDistance; + this.allChunksTicked = false; + } else if (!this.allChunksTicked) { + this.allChunksTicked = true; + } else { + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer player = (EntityPlayer)this.playerEntities.get(i); + int pcx = MathHelper.floor_double(player.posX / 16.0D); + int pcz = MathHelper.floor_double(player.posZ / 16.0D); + byte dist = 10; + + for (int cx = -dist; cx <= dist; ++cx) { + for (int cz = -dist; cz <= dist; ++cz) { + this.limitedChunkSet.add(new ChunkCoordIntPair(cx + pcx, cz + pcz)); + } + } + } + + if (this.setChunkCoordsToTickOnce.size() > 0) { + this.limitedChunkSet.addAll(this.setChunkCoordsToTickOnce); + this.setChunkCoordsToTickOnce.clear(); + } + } + } + } + + public void addChunkToTickOnce(int cx, int cz) { + int viewDistance = this.func_152379_p(); + + if (viewDistance > 10) { + this.setChunkCoordsToTickOnce.add(new ChunkCoordIntPair(cx, cz)); + } + } + + protected void func_147456_g() { + Set oldSet = this.activeChunkSet; + + if (this.limitedChunkSet.size() > 0) { + this.activeChunkSet = this.limitedChunkSet; + } + + super.func_147456_g(); + this.activeChunkSet = oldSet; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrDisplayListAllocator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrDisplayListAllocator.java new file mode 100644 index 0000000..16d0282 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrDisplayListAllocator.java @@ -0,0 +1,54 @@ +package net.minecraft.src; + +import java.util.ArrayList; +import java.util.List; + +public class WrDisplayListAllocator { + private List listBlocks = new ArrayList(); + private WrDisplayListBlock currentBlock = null; + private int blockIndex = -1; + + public int allocateDisplayLists(int len) { + if (len > 0 && len <= 16384) { + if (this.currentBlock == null || !this.currentBlock.canAllocate(len)) { + if (this.blockIndex + 1 < this.listBlocks.size()) { + ++this.blockIndex; + this.currentBlock = (WrDisplayListBlock)this.listBlocks.get(this.blockIndex); + } else { + this.currentBlock = new WrDisplayListBlock(); + this.blockIndex = this.listBlocks.size(); + this.listBlocks.add(this.currentBlock); + } + + if (!this.currentBlock.canAllocate(len)) { + throw new IllegalArgumentException("Can not allocate: " + len); + } + } + + return this.currentBlock.allocate(len); + } else { + throw new IllegalArgumentException("Invalid display list length: " + len); + } + } + + public void resetAllocatedLists() { + this.currentBlock = null; + this.blockIndex = -1; + + for (int i = 0; i < this.listBlocks.size(); ++i) { + WrDisplayListBlock block = (WrDisplayListBlock)this.listBlocks.get(i); + block.reset(); + } + } + + public void deleteDisplayLists() { + for (int i = 0; i < this.listBlocks.size(); ++i) { + WrDisplayListBlock block = (WrDisplayListBlock)this.listBlocks.get(i); + block.deleteDisplayLists(); + } + + this.listBlocks.clear(); + this.currentBlock = null; + this.blockIndex = -1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrDisplayListBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrDisplayListBlock.java new file mode 100644 index 0000000..65b743e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrDisplayListBlock.java @@ -0,0 +1,50 @@ +package net.minecraft.src; + +import net.minecraft.client.renderer.GLAllocation; + +public class WrDisplayListBlock { + private int start = -1; + private int used = -1; + private int end = -1; + public static final int BLOCK_LENGTH = 16384; + + public WrDisplayListBlock() { + this.start = GLAllocation.generateDisplayLists(16384); + this.used = this.start; + this.end = this.start + 16384; + } + + public boolean canAllocate(int len) { + return this.used + len < this.end; + } + + public int allocate(int len) { + if (!this.canAllocate(len)) { + return -1; + } else { + int allocated = this.used; + this.used += len; + return allocated; + } + } + + public void reset() { + this.used = this.start; + } + + public void deleteDisplayLists() { + GLAllocation.deleteDisplayLists(this.start); + } + + public int getStart() { + return this.start; + } + + public int getUsed() { + return this.used; + } + + public int getEnd() { + return this.end; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateControl.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateControl.java new file mode 100644 index 0000000..6d64bbe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateControl.java @@ -0,0 +1,19 @@ +package net.minecraft.src; + +public class WrUpdateControl implements IWrUpdateControl { + private boolean hasForge; + private int renderPass; + + public WrUpdateControl() { + this.hasForge = Reflector.ForgeHooksClient.exists(); + this.renderPass = 0; + } + + public void resume() {} + + public void pause() {} + + public void setRenderPass(int renderPass) { + this.renderPass = renderPass; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateState.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateState.java new file mode 100644 index 0000000..a0f4d5e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateState.java @@ -0,0 +1,18 @@ +package net.minecraft.src; + +import java.util.HashSet; +import net.minecraft.client.renderer.RenderBlocks; + +public class WrUpdateState { + public ChunkCacheOF chunkcache = null; + public RenderBlocks renderblocks = null; + public HashSet setOldEntityRenders = null; + int viewEntityPosX = 0; + int viewEntityPosY = 0; + int viewEntityPosZ = 0; + public int renderPass = 0; + public int y = 0; + public boolean flag = false; + public boolean hasRenderedBlocks = false; + public boolean hasGlList = false; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateThread.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateThread.java new file mode 100644 index 0000000..5e75935 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdateThread.java @@ -0,0 +1,351 @@ +package net.minecraft.src; + +import java.util.LinkedList; +import java.util.List; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import org.lwjgl.opengl.Pbuffer; + +public class WrUpdateThread extends Thread { + private Pbuffer pbuffer = null; + private Object lock = new Object(); + private List updateList = new LinkedList(); + private List updatedList = new LinkedList(); + private int updateCount = 0; + private Tessellator mainTessellator; + private Tessellator threadTessellator; + private boolean working; + private WorldRendererThreaded currentRenderer; + private boolean canWork; + private boolean canWorkToEndOfUpdate; + private boolean terminated; + private static final int MAX_UPDATE_CAPACITY = 10; + + public WrUpdateThread(Pbuffer pbuffer) { + super("WrUpdateThread"); + this.mainTessellator = Tessellator.instance; + this.threadTessellator = new Tessellator(2097152); + this.working = false; + this.currentRenderer = null; + this.canWork = false; + this.canWorkToEndOfUpdate = false; + this.terminated = false; + this.pbuffer = pbuffer; + } + + public void run() { + try { + this.pbuffer.makeCurrent(); + } catch (Exception var8) { + var8.printStackTrace(); + } + + WrUpdateThread.ThreadUpdateListener updateListener = new WrUpdateThread.ThreadUpdateListener((WrUpdateThread.NamelessClass178628546)null); + + while (!Thread.interrupted() && !this.terminated) { + try { + WorldRendererThreaded e = this.getRendererToUpdate(); + + if (e == null) { + return; + } + + this.checkCanWork((IWrUpdateControl)null); + + try { + this.currentRenderer = e; + Tessellator.instance = this.threadTessellator; + e.updateRenderer(updateListener); + } + finally { + Tessellator.instance = this.mainTessellator; + } + + this.rendererUpdated(e); + } catch (Exception var9) { + var9.printStackTrace(); + + if (this.currentRenderer != null) { + this.currentRenderer.isUpdating = false; + this.currentRenderer.needsUpdate = true; + } + + this.currentRenderer = null; + this.working = false; + } + } + } + + public void addRendererToUpdate(WorldRenderer wr, boolean first) { + Object var3 = this.lock; + + synchronized (this.lock) { + if (wr.isUpdating) { + throw new IllegalArgumentException("Renderer already updating"); + } else { + if (first) { + this.updateList.add(0, wr); + } else { + this.updateList.add(wr); + } + + wr.isUpdating = true; + this.lock.notifyAll(); + } + } + } + + private WorldRendererThreaded getRendererToUpdate() { + Object var1 = this.lock; + + synchronized (this.lock) { + while (this.updateList.size() <= 0) { + try { + this.lock.wait(2000L); + + if (this.terminated) { + Object var10000 = null; + return (WorldRendererThreaded)var10000; + } + } catch (InterruptedException var4) { + ; + } + } + + WorldRendererThreaded wrt = (WorldRendererThreaded)this.updateList.remove(0); + this.lock.notifyAll(); + return wrt; + } + } + + public boolean hasWorkToDo() { + Object var1 = this.lock; + + synchronized (this.lock) { + return this.updateList.size() > 0 ? true : (this.currentRenderer != null ? true : this.working); + } + } + + public int getUpdateCapacity() { + Object var1 = this.lock; + + synchronized (this.lock) { + return this.updateList.size() > 10 ? 0 : 10 - this.updateList.size(); + } + } + + private void rendererUpdated(WorldRenderer wr) { + Object var2 = this.lock; + + synchronized (this.lock) { + this.updatedList.add(wr); + ++this.updateCount; + this.currentRenderer = null; + this.working = false; + this.lock.notifyAll(); + } + } + + private void finishUpdatedRenderers() { + Object var1 = this.lock; + + synchronized (this.lock) { + for (int i = 0; i < this.updatedList.size(); ++i) { + WorldRendererThreaded wr = (WorldRendererThreaded)this.updatedList.get(i); + wr.finishUpdate(); + wr.isUpdating = false; + } + + this.updatedList.clear(); + } + } + + public void pause() { + Object var1 = this.lock; + + synchronized (this.lock) { + this.canWork = false; + this.canWorkToEndOfUpdate = false; + this.lock.notifyAll(); + + while (this.working) { + try { + this.lock.wait(); + } catch (InterruptedException var4) { + ; + } + } + + this.finishUpdatedRenderers(); + } + } + + public void unpause() { + Object var1 = this.lock; + + synchronized (this.lock) { + if (this.working) { + Config.warn("UpdateThread still working in unpause()!!!"); + } + + this.canWork = true; + this.canWorkToEndOfUpdate = false; + this.lock.notifyAll(); + } + } + + public void unpauseToEndOfUpdate() { + Object var1 = this.lock; + + synchronized (this.lock) { + if (this.working) { + Config.warn("UpdateThread still working in unpause()!!!"); + } + + if (this.currentRenderer != null) { + while (this.currentRenderer != null) { + this.canWork = false; + this.canWorkToEndOfUpdate = true; + this.lock.notifyAll(); + + try { + this.lock.wait(); + } catch (InterruptedException var4) { + ; + } + } + + this.pause(); + } + } + } + + private void checkCanWork(IWrUpdateControl uc) { + Thread.yield(); + Object var2 = this.lock; + + synchronized (this.lock) { + while (!this.canWork && (!this.canWorkToEndOfUpdate || this.currentRenderer == null)) { + if (uc != null) { + uc.pause(); + } + + this.working = false; + this.lock.notifyAll(); + + try { + this.lock.wait(); + } catch (InterruptedException var5) { + ; + } + } + + this.working = true; + + if (uc != null) { + uc.resume(); + } + + this.lock.notifyAll(); + } + } + + public void clearAllUpdates() { + Object var1 = this.lock; + + synchronized (this.lock) { + this.unpauseToEndOfUpdate(); + + for (int i = 0; i < this.updateList.size(); ++i) { + WorldRenderer wr = (WorldRenderer)this.updateList.get(i); + wr.needsUpdate = true; + wr.isUpdating = false; + } + + this.updateList.clear(); + this.lock.notifyAll(); + } + } + + public int getPendingUpdatesCount() { + Object var1 = this.lock; + + synchronized (this.lock) { + int count = this.updateList.size(); + + if (this.currentRenderer != null) { + ++count; + } + + return count; + } + } + + public int resetUpdateCount() { + Object var1 = this.lock; + + synchronized (this.lock) { + int count = this.updateCount; + this.updateCount = 0; + return count; + } + } + + public void terminate() { + this.terminated = true; + } + + static class NamelessClass178628546 { + } + + private class ThreadUpdateControl implements IWrUpdateControl { + private IWrUpdateControl updateControl; + private boolean paused; + + private ThreadUpdateControl() { + this.updateControl = null; + this.paused = false; + } + + public void pause() { + if (!this.paused) { + this.paused = true; + this.updateControl.pause(); + Tessellator.instance = WrUpdateThread.this.mainTessellator; + } + } + + public void resume() { + if (this.paused) { + this.paused = false; + Tessellator.instance = WrUpdateThread.this.threadTessellator; + this.updateControl.resume(); + } + } + + public void setUpdateControl(IWrUpdateControl updateControl) { + this.updateControl = updateControl; + } + + ThreadUpdateControl(WrUpdateThread.NamelessClass178628546 x1) { + this(); + } + } + + private class ThreadUpdateListener implements IWrUpdateListener { + private WrUpdateThread.ThreadUpdateControl tuc; + + private ThreadUpdateListener() { + this.tuc = WrUpdateThread.this.new ThreadUpdateControl((WrUpdateThread.NamelessClass178628546)null); + } + + public void updating(IWrUpdateControl uc) { + this.tuc.setUpdateControl(uc); + WrUpdateThread.this.checkCanWork(this.tuc); + } + + ThreadUpdateListener(WrUpdateThread.NamelessClass178628546 x1) { + this(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdaterSmooth.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdaterSmooth.java new file mode 100644 index 0000000..96f5d3a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdaterSmooth.java @@ -0,0 +1,228 @@ +package net.minecraft.src; + +import java.util.List; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public class WrUpdaterSmooth implements IWrUpdater { + private long lastUpdateStartTimeNs = 0L; + private long updateStartTimeNs = 0L; + private long updateTimeNs = 10000000L; + private WorldRendererSmooth currentUpdateRenderer = null; + private int renderersUpdated = 0; + private int renderersFound = 0; + + public void initialize() {} + + public void terminate() {} + + public WorldRenderer makeWorldRenderer(World worldObj, List tileEntities, int x, int y, int z, int glRenderListBase) { + return new WorldRendererSmooth(worldObj, tileEntities, x, y, z, glRenderListBase); + } + + public boolean updateRenderers(RenderGlobal rg, EntityLivingBase entityliving, boolean flag) { + this.lastUpdateStartTimeNs = this.updateStartTimeNs; + this.updateStartTimeNs = System.nanoTime(); + long finishTimeNs = this.updateStartTimeNs + this.updateTimeNs; + int maxNum = Config.getUpdatesPerFrame(); + + if (Config.isDynamicUpdates() && !rg.isMoving(entityliving)) { + maxNum *= 3; + } + + this.renderersUpdated = 0; + + do { + this.renderersFound = 0; + this.updateRenderersImpl(rg, entityliving, flag); + } + while (this.renderersFound > 0 && System.nanoTime() - finishTimeNs < 0L); + + if (this.renderersFound > 0) { + maxNum = Math.min(maxNum, this.renderersFound); + long diff = 400000L; + + if (this.renderersUpdated > maxNum) { + this.updateTimeNs -= 2L * diff; + } + + if (this.renderersUpdated < maxNum) { + this.updateTimeNs += diff; + } + } else { + this.updateTimeNs = 0L; + this.updateTimeNs -= 200000L; + } + + if (this.updateTimeNs < 0L) { + this.updateTimeNs = 0L; + } + + return this.renderersUpdated > 0; + } + + private void updateRenderersImpl(RenderGlobal rg, EntityLivingBase entityliving, boolean flag) { + this.renderersFound = 0; + boolean currentUpdateFinished = true; + + if (this.currentUpdateRenderer != null) { + ++this.renderersFound; + currentUpdateFinished = this.updateRenderer(this.currentUpdateRenderer); + + if (currentUpdateFinished) { + ++this.renderersUpdated; + } + } + + if (rg.worldRenderersToUpdate.size() > 0) { + byte NOT_IN_FRUSTRUM_MUL = 4; + WorldRendererSmooth wrBest = null; + float distSqBest = Float.MAX_VALUE; + int indexBest = -1; + int dstIndex; + + for (dstIndex = 0; dstIndex < rg.worldRenderersToUpdate.size(); ++dstIndex) { + WorldRendererSmooth i = (WorldRendererSmooth)rg.worldRenderersToUpdate.get(dstIndex); + + if (i != null) { + ++this.renderersFound; + + if (!i.needsUpdate) { + rg.worldRenderersToUpdate.set(dstIndex, (Object)null); + } else { + float wr = i.distanceToEntitySquared(entityliving); + + if (wr <= 256.0F && rg.isActingNow()) { + i.updateRenderer(); + i.needsUpdate = false; + rg.worldRenderersToUpdate.set(dstIndex, (Object)null); + ++this.renderersUpdated; + } else { + if (!i.isInFrustum) { + wr *= (float)NOT_IN_FRUSTRUM_MUL; + } + + if (wrBest == null) { + wrBest = i; + distSqBest = wr; + indexBest = dstIndex; + } else if (wr < distSqBest) { + wrBest = i; + distSqBest = wr; + indexBest = dstIndex; + } + } + } + } + } + + if (this.currentUpdateRenderer == null || currentUpdateFinished) { + int var15; + + if (wrBest != null) { + rg.worldRenderersToUpdate.set(indexBest, (Object)null); + + if (!this.updateRenderer(wrBest)) { + return; + } + + ++this.renderersUpdated; + + if (System.nanoTime() > this.updateStartTimeNs + this.updateTimeNs) { + return; + } + + float var14 = distSqBest / 5.0F; + + for (var15 = 0; var15 < rg.worldRenderersToUpdate.size(); ++var15) { + WorldRendererSmooth var16 = (WorldRendererSmooth)rg.worldRenderersToUpdate.get(var15); + + if (var16 != null) { + float distSq = var16.distanceToEntitySquared(entityliving); + + if (!var16.isInFrustum) { + distSq *= (float)NOT_IN_FRUSTRUM_MUL; + } + + float diffDistSq = Math.abs(distSq - distSqBest); + + if (diffDistSq < var14) { + rg.worldRenderersToUpdate.set(var15, (Object)null); + + if (!this.updateRenderer(var16)) { + return; + } + + ++this.renderersUpdated; + + if (System.nanoTime() > this.updateStartTimeNs + this.updateTimeNs) { + break; + } + } + } + } + } + + if (this.renderersFound == 0) { + rg.worldRenderersToUpdate.clear(); + } + + if (rg.worldRenderersToUpdate.size() > 100 && this.renderersFound < rg.worldRenderersToUpdate.size() * 4 / 5) { + dstIndex = 0; + + for (var15 = 0; var15 < rg.worldRenderersToUpdate.size(); ++var15) { + Object var17 = rg.worldRenderersToUpdate.get(var15); + + if (var17 != null) { + if (var15 != dstIndex) { + rg.worldRenderersToUpdate.set(dstIndex, var17); + } + + ++dstIndex; + } + } + + for (var15 = rg.worldRenderersToUpdate.size() - 1; var15 >= dstIndex; --var15) { + rg.worldRenderersToUpdate.remove(var15); + } + } + } + } + } + + private boolean updateRenderer(WorldRendererSmooth wr) { + long finishTime = this.updateStartTimeNs + this.updateTimeNs; + wr.needsUpdate = false; + boolean ready = wr.updateRenderer(finishTime); + + if (!ready) { + this.currentUpdateRenderer = wr; + return false; + } else { + wr.finishUpdate(); + this.currentUpdateRenderer = null; + return true; + } + } + + public void finishCurrentUpdate() { + if (this.currentUpdateRenderer != null) { + this.currentUpdateRenderer.updateRenderer(); + this.currentUpdateRenderer = null; + } + } + + public void resumeBackgroundUpdates() {} + + public void pauseBackgroundUpdates() {} + + public void preRender(RenderGlobal rg, EntityLivingBase player) {} + + public void postRender() {} + + public void clearAllUpdates() { + this.finishCurrentUpdate(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdaterThreaded.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdaterThreaded.java new file mode 100644 index 0000000..afa3716 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdaterThreaded.java @@ -0,0 +1,311 @@ +package net.minecraft.src; + +import java.util.List; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.Drawable; +import org.lwjgl.opengl.Pbuffer; +import org.lwjgl.opengl.PixelFormat; + +public class WrUpdaterThreaded implements IWrUpdater { + private WrUpdateThread updateThread = null; + private float timePerUpdateMs = 10.0F; + private long updateStartTimeNs = 0L; + private boolean firstUpdate = true; + private int updateTargetNum = 0; + + public void terminate() { + if (this.updateThread != null) { + this.updateThread.terminate(); + this.updateThread.unpauseToEndOfUpdate(); + } + } + + public void initialize() {} + + private void delayedInit() { + if (this.updateThread == null) { + this.createUpdateThread(Display.getDrawable()); + } + } + + public WorldRenderer makeWorldRenderer(World worldObj, List tileEntities, int x, int y, int z, int glRenderListBase) { + return new WorldRendererThreaded(worldObj, tileEntities, x, y, z, glRenderListBase); + } + + public WrUpdateThread createUpdateThread(Drawable displayDrawable) { + if (this.updateThread != null) { + throw new IllegalStateException("UpdateThread is already existing"); + } else { + try { + Pbuffer e = new Pbuffer(1, 1, new PixelFormat(), displayDrawable); + this.updateThread = new WrUpdateThread(e); + this.updateThread.setPriority(1); + this.updateThread.start(); + this.updateThread.pause(); + return this.updateThread; + } catch (Exception var3) { + throw new RuntimeException(var3); + } + } + } + + public boolean isUpdateThread() { + return Thread.currentThread() == this.updateThread; + } + + public static boolean isBackgroundChunkLoading() { + return true; + } + + public void preRender(RenderGlobal rg, EntityLivingBase player) { + this.updateTargetNum = 0; + + if (this.updateThread != null) { + if (this.updateStartTimeNs == 0L) { + this.updateStartTimeNs = System.nanoTime(); + } + + if (this.updateThread.hasWorkToDo()) { + this.updateTargetNum = Config.getUpdatesPerFrame(); + + if (Config.isDynamicUpdates() && !rg.isMoving(player)) { + this.updateTargetNum *= 3; + } + + this.updateTargetNum = Math.min(this.updateTargetNum, this.updateThread.getPendingUpdatesCount()); + + if (this.updateTargetNum > 0) { + this.updateThread.unpause(); + } + } + } + } + + public void postRender() { + if (this.updateThread != null) { + float sleepTimeMs = 0.0F; + + if (this.updateTargetNum > 0) { + long deltaTime = System.nanoTime() - this.updateStartTimeNs; + float targetRunTime = this.timePerUpdateMs * (1.0F + (float)(this.updateTargetNum - 1) / 2.0F); + + if (targetRunTime > 0.0F) { + int sleepTimeMsInt = (int)targetRunTime; + Config.sleep((long)sleepTimeMsInt); + } + + this.updateThread.pause(); + } + + float deltaTime1 = 0.2F; + + if (this.updateTargetNum > 0) { + int updateCount = this.updateThread.resetUpdateCount(); + + if (updateCount < this.updateTargetNum) { + this.timePerUpdateMs += deltaTime1; + } + + if (updateCount > this.updateTargetNum) { + this.timePerUpdateMs -= deltaTime1; + } + + if (updateCount == this.updateTargetNum) { + this.timePerUpdateMs -= deltaTime1; + } + } else { + this.timePerUpdateMs -= deltaTime1 / 5.0F; + } + + if (this.timePerUpdateMs < 0.0F) { + this.timePerUpdateMs = 0.0F; + } + + this.updateStartTimeNs = System.nanoTime(); + } + } + + public boolean updateRenderers(RenderGlobal rg, EntityLivingBase entityliving, boolean flag) { + this.delayedInit(); + + if (rg.worldRenderersToUpdate.size() <= 0) { + return true; + } else { + int num = 0; + byte NOT_IN_FRUSTRUM_MUL = 4; + int numValid = 0; + WorldRenderer wrBest = null; + float distSqBest = Float.MAX_VALUE; + int indexBest = -1; + int maxUpdateNum; + float dstIndex; + + for (maxUpdateNum = 0; maxUpdateNum < rg.worldRenderersToUpdate.size(); ++maxUpdateNum) { + WorldRenderer turboMode = (WorldRenderer)rg.worldRenderersToUpdate.get(maxUpdateNum); + + if (turboMode != null) { + ++numValid; + + if (!turboMode.isUpdating) { + if (!turboMode.needsUpdate) { + rg.worldRenderersToUpdate.set(maxUpdateNum, (Object)null); + } else { + dstIndex = turboMode.distanceToEntitySquared(entityliving); + + if (dstIndex < 512.0F) { + if (dstIndex < 256.0F && rg.isActingNow() && turboMode.isInFrustum || this.firstUpdate) { + if (this.updateThread != null) { + this.updateThread.unpauseToEndOfUpdate(); + } + + turboMode.updateRenderer(entityliving); + turboMode.needsUpdate = false; + rg.worldRenderersToUpdate.set(maxUpdateNum, (Object)null); + ++num; + continue; + } + + if (this.updateThread != null) { + this.updateThread.addRendererToUpdate(turboMode, true); + turboMode.needsUpdate = false; + rg.worldRenderersToUpdate.set(maxUpdateNum, (Object)null); + ++num; + continue; + } + } + + if (!turboMode.isInFrustum) { + dstIndex *= (float)NOT_IN_FRUSTRUM_MUL; + } + + if (wrBest == null) { + wrBest = turboMode; + distSqBest = dstIndex; + indexBest = maxUpdateNum; + } else if (dstIndex < distSqBest) { + wrBest = turboMode; + distSqBest = dstIndex; + indexBest = maxUpdateNum; + } + } + } + } + } + + maxUpdateNum = Config.getUpdatesPerFrame(); + boolean var17 = false; + + if (Config.isDynamicUpdates() && !rg.isMoving(entityliving)) { + maxUpdateNum *= 3; + var17 = true; + } + + if (this.updateThread != null) { + maxUpdateNum = this.updateThread.getUpdateCapacity(); + + if (maxUpdateNum <= 0) { + return true; + } + } + + int i; + + if (wrBest != null) { + this.updateRenderer(wrBest, entityliving); + rg.worldRenderersToUpdate.set(indexBest, (Object)null); + ++num; + dstIndex = distSqBest / 5.0F; + + for (i = 0; i < rg.worldRenderersToUpdate.size() && num < maxUpdateNum; ++i) { + WorldRenderer wr = (WorldRenderer)rg.worldRenderersToUpdate.get(i); + + if (wr != null && !wr.isUpdating) { + float distSq = wr.distanceToEntitySquared(entityliving); + + if (!wr.isInFrustum) { + distSq *= (float)NOT_IN_FRUSTRUM_MUL; + } + + float diffDistSq = Math.abs(distSq - distSqBest); + + if (diffDistSq < dstIndex) { + this.updateRenderer(wr, entityliving); + rg.worldRenderersToUpdate.set(i, (Object)null); + ++num; + } + } + } + } + + if (numValid == 0) { + rg.worldRenderersToUpdate.clear(); + } + + if (rg.worldRenderersToUpdate.size() > 100 && numValid < rg.worldRenderersToUpdate.size() * 4 / 5) { + int var18 = 0; + + for (i = 0; i < rg.worldRenderersToUpdate.size(); ++i) { + Object var19 = rg.worldRenderersToUpdate.get(i); + + if (var19 != null) { + if (i != var18) { + rg.worldRenderersToUpdate.set(var18, var19); + } + + ++var18; + } + } + + for (i = rg.worldRenderersToUpdate.size() - 1; i >= var18; --i) { + rg.worldRenderersToUpdate.remove(i); + } + } + + this.firstUpdate = false; + return true; + } + } + + private void updateRenderer(WorldRenderer wr, EntityLivingBase entityLiving) { + WrUpdateThread ut = this.updateThread; + + if (ut != null) { + ut.addRendererToUpdate(wr, false); + wr.needsUpdate = false; + } else { + wr.updateRenderer(entityLiving); + wr.needsUpdate = false; + wr.isUpdating = false; + } + } + + public void finishCurrentUpdate() { + if (this.updateThread != null) { + this.updateThread.unpauseToEndOfUpdate(); + } + } + + public void resumeBackgroundUpdates() { + if (this.updateThread != null) { + this.updateThread.unpause(); + } + } + + public void pauseBackgroundUpdates() { + if (this.updateThread != null) { + this.updateThread.pause(); + } + } + + public void clearAllUpdates() { + if (this.updateThread != null) { + this.updateThread.clearAllUpdates(); + } + + this.firstUpdate = true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdates.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdates.java new file mode 100644 index 0000000..bf72a56 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/src/WrUpdates.java @@ -0,0 +1,86 @@ +package net.minecraft.src; + +import java.util.List; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public class WrUpdates { + private static IWrUpdater wrUpdater = null; + + public static void setWrUpdater(IWrUpdater updater) { + if (wrUpdater != null) { + wrUpdater.terminate(); + } + + wrUpdater = updater; + + if (wrUpdater != null) { + try { + wrUpdater.initialize(); + } catch (Exception var2) { + wrUpdater = null; + var2.printStackTrace(); + } + } + } + + public static boolean hasWrUpdater() { + return wrUpdater != null; + } + + public static IWrUpdater getWrUpdater() { + return wrUpdater; + } + + public static WorldRenderer makeWorldRenderer(World worldObj, List tileEntities, int x, int y, int z, int glRenderListBase) { + return wrUpdater == null ? new WorldRenderer(worldObj, tileEntities, x, y, z, glRenderListBase) : wrUpdater.makeWorldRenderer(worldObj, tileEntities, x, y, z, glRenderListBase); + } + + public static boolean updateRenderers(RenderGlobal rg, EntityLivingBase entityliving, boolean flag) { + try { + return wrUpdater.updateRenderers(rg, entityliving, flag); + } catch (Exception var4) { + var4.printStackTrace(); + setWrUpdater((IWrUpdater)null); + return false; + } + } + + public static void resumeBackgroundUpdates() { + if (wrUpdater != null) { + wrUpdater.resumeBackgroundUpdates(); + } + } + + public static void pauseBackgroundUpdates() { + if (wrUpdater != null) { + wrUpdater.pauseBackgroundUpdates(); + } + } + + public static void finishCurrentUpdate() { + if (wrUpdater != null) { + wrUpdater.finishCurrentUpdate(); + } + } + + public static void preRender(RenderGlobal rg, EntityLivingBase player) { + if (wrUpdater != null) { + wrUpdater.preRender(rg, player); + } + } + + public static void postRender() { + if (wrUpdater != null) { + wrUpdater.postRender(); + } + } + + public static void clearAllUpdates() { + if (wrUpdater != null) { + wrUpdater.clearAllUpdates(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/Achievement.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/Achievement.java new file mode 100644 index 0000000..6236d25 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/Achievement.java @@ -0,0 +1,150 @@ +package net.minecraft.stats; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StatCollector; + +public class Achievement extends StatBase { + /** + * Is the column (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. + */ + public final int displayColumn; + + /** + * Is the row (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. + */ + public final int displayRow; + + /** + * Holds the parent achievement, that must be taken before this achievement is avaiable. + */ + public final Achievement parentAchievement; + + /** + * Holds the description of the achievement, ready to be formatted and/or displayed. + */ + private final String achievementDescription; + + /** + * Holds a string formatter for the achievement, some of then needs extra dynamic info - like the key used to open + * the inventory. + */ + private IStatStringFormat statStringFormatter; + + /** + * Holds the ItemStack that will be used to draw the achievement into the GUI. + */ + public final ItemStack theItemStack; + + /** + * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to + * achieve. + */ + private boolean isSpecial; + + + public Achievement(String p_i46327_1_, String p_i46327_2_, int p_i46327_3_, int p_i46327_4_, Item p_i46327_5_, Achievement p_i46327_6_) { + this(p_i46327_1_, p_i46327_2_, p_i46327_3_, p_i46327_4_, new ItemStack(p_i46327_5_), p_i46327_6_); + } + + public Achievement(String p_i45301_1_, String p_i45301_2_, int p_i45301_3_, int p_i45301_4_, Block p_i45301_5_, Achievement p_i45301_6_) { + this(p_i45301_1_, p_i45301_2_, p_i45301_3_, p_i45301_4_, new ItemStack(p_i45301_5_), p_i45301_6_); + } + + public Achievement(String p_i45302_1_, String p_i45302_2_, int p_i45302_3_, int p_i45302_4_, ItemStack p_i45302_5_, Achievement p_i45302_6_) { + super(p_i45302_1_, new ChatComponentTranslation("achievement." + p_i45302_2_)); + this.theItemStack = p_i45302_5_; + this.achievementDescription = "achievement." + p_i45302_2_ + ".desc"; + this.displayColumn = p_i45302_3_; + this.displayRow = p_i45302_4_; + + if (p_i45302_3_ < AchievementList.minDisplayColumn) { + AchievementList.minDisplayColumn = p_i45302_3_; + } + + if (p_i45302_4_ < AchievementList.minDisplayRow) { + AchievementList.minDisplayRow = p_i45302_4_; + } + + if (p_i45302_3_ > AchievementList.maxDisplayColumn) { + AchievementList.maxDisplayColumn = p_i45302_3_; + } + + if (p_i45302_4_ > AchievementList.maxDisplayRow) { + AchievementList.maxDisplayRow = p_i45302_4_; + } + + this.parentAchievement = p_i45302_6_; + } + + /** + * Initializes the current stat as independent (i.e., lacking prerequisites for being updated) and returns the + * current instance. + */ + public Achievement initIndependentStat() { + this.isIndependent = true; + return this; + } + + /** + * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to + * achieve. + */ + public Achievement setSpecial() { + this.isSpecial = true; + return this; + } + + /** + * Register the stat into StatList. + */ + public Achievement registerStat() { + super.registerStat(); + AchievementList.achievementList.add(this); + return this; + } + + /** + * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). + */ + public boolean isAchievement() { + return true; + } + + public IChatComponent func_150951_e() { + IChatComponent var1 = super.func_150951_e(); + var1.getChatStyle().setColor(this.getSpecial() ? EnumChatFormatting.DARK_PURPLE : EnumChatFormatting.GREEN); + return var1; + } + + public Achievement func_150953_b(Class p_150953_1_) { + return (Achievement)super.func_150953_b(p_150953_1_); + } + + /** + * Returns the fully description of the achievement - ready to be displayed on screen. + */ + public String getDescription() { + return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) : StatCollector.translateToLocal(this.achievementDescription); + } + + /** + * Defines a string formatter for the achievement. + */ + public Achievement setStatStringFormatter(IStatStringFormat p_75988_1_) { + this.statStringFormatter = p_75988_1_; + return this; + } + + /** + * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to + * achieve. + */ + public boolean getSpecial() { + return this.isSpecial; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/AchievementList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/AchievementList.java new file mode 100644 index 0000000..4ef3c7c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/AchievementList.java @@ -0,0 +1,116 @@ +package net.minecraft.stats; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.JsonSerializableSet; + +public class AchievementList { + /** Is the smallest column used to display a achievement on the GUI. */ + public static int minDisplayColumn; + + /** Is the smallest row used to display a achievement on the GUI. */ + public static int minDisplayRow; + + /** Is the biggest column used to display a achievement on the GUI. */ + public static int maxDisplayColumn; + + /** Is the biggest row used to display a achievement on the GUI. */ + public static int maxDisplayRow; + + /** Holds a list of all registered achievements. */ + public static List achievementList = new ArrayList(); + + /** Is the 'open inventory' achievement. */ + public static Achievement openInventory = (new Achievement("achievement.openInventory", "openInventory", 0, 0, Items.book, null)).initIndependentStat().registerStat(); + + /** Is the 'getting wood' achievement. */ + public static Achievement mineWood = (new Achievement("achievement.mineWood", "mineWood", 2, 1, Blocks.log, openInventory)).registerStat(); + + /** Is the 'benchmarking' achievement. */ + public static Achievement buildWorkBench = (new Achievement("achievement.buildWorkBench", "buildWorkBench", 4, -1, Blocks.crafting_table, mineWood)).registerStat(); + + /** Is the 'time to mine' achievement. */ + public static Achievement buildPickaxe = (new Achievement("achievement.buildPickaxe", "buildPickaxe", 4, 2, Items.wooden_pickaxe, buildWorkBench)).registerStat(); + + /** Is the 'hot topic' achievement. */ + public static Achievement buildFurnace = (new Achievement("achievement.buildFurnace", "buildFurnace", 3, 4, Blocks.furnace, buildPickaxe)).registerStat(); + + /** Is the 'acquire hardware' achievement. */ + public static Achievement acquireIron = (new Achievement("achievement.acquireIron", "acquireIron", 1, 4, Items.iron_ingot, buildFurnace)).registerStat(); + + /** Is the 'time to farm' achievement. */ + public static Achievement buildHoe = (new Achievement("achievement.buildHoe", "buildHoe", 2, -3, Items.wooden_hoe, buildWorkBench)).registerStat(); + + /** Is the 'bake bread' achievement. */ + public static Achievement makeBread = (new Achievement("achievement.makeBread", "makeBread", -1, -3, Items.bread, buildHoe)).registerStat(); + + /** Is the 'the lie' achievement. */ + public static Achievement bakeCake = (new Achievement("achievement.bakeCake", "bakeCake", 0, -5, Items.cake, buildHoe)).registerStat(); + + /** Is the 'getting a upgrade' achievement. */ + public static Achievement buildBetterPickaxe = (new Achievement("achievement.buildBetterPickaxe", "buildBetterPickaxe", 6, 2, Items.stone_pickaxe, buildPickaxe)).registerStat(); + + /** Is the 'delicious fish' achievement. */ + public static Achievement cookFish = (new Achievement("achievement.cookFish", "cookFish", 2, 6, Items.cooked_fished, buildFurnace)).registerStat(); + + /** Is the 'on a rail' achievement */ + public static Achievement onARail = (new Achievement("achievement.onARail", "onARail", 2, 3, Blocks.rail, acquireIron)).setSpecial().registerStat(); + + /** Is the 'time to strike' achievement. */ + public static Achievement buildSword = (new Achievement("achievement.buildSword", "buildSword", 6, -1, Items.wooden_sword, buildWorkBench)).registerStat(); + + /** Is the 'monster hunter' achievement. */ + public static Achievement killEnemy = (new Achievement("achievement.killEnemy", "killEnemy", 8, -1, Items.bone, buildSword)).registerStat(); + + /** is the 'cow tipper' achievement. */ + public static Achievement killCow = (new Achievement("achievement.killCow", "killCow", 7, -3, Items.leather, buildSword)).registerStat(); + + /** Is the 'when pig fly' achievement. */ + public static Achievement flyPig = (new Achievement("achievement.flyPig", "flyPig", 9, -3, Items.saddle, killCow)).setSpecial().registerStat(); + + /** The achievement for killing a Skeleton from 50 meters aways. */ + public static Achievement snipeSkeleton = (new Achievement("achievement.snipeSkeleton", "snipeSkeleton", 7, 0, Items.bow, killEnemy)).setSpecial().registerStat(); + + /** Is the 'DIAMONDS!' achievement */ + public static Achievement diamonds = (new Achievement("achievement.diamonds", "diamonds", -1, 5, Blocks.diamond_ore, acquireIron)).registerStat(); + public static Achievement field_150966_x = (new Achievement("achievement.diamondsToYou", "diamondsToYou", -1, 2, Items.diamond, diamonds)).registerStat(); + + /** Is the 'We Need to Go Deeper' achievement */ + public static Achievement portal = (new Achievement("achievement.portal", "portal", -1, 7, Blocks.obsidian, diamonds)).registerStat(); + + /** Is the 'Return to Sender' achievement */ + public static Achievement ghast = (new Achievement("achievement.ghast", "ghast", -4, 8, Items.ghast_tear, portal)).setSpecial().registerStat(); + + /** Is the 'Into Fire' achievement */ + public static Achievement blazeRod = (new Achievement("achievement.blazeRod", "blazeRod", 0, 9, Items.blaze_rod, portal)).registerStat(); + + /** Is the 'Local Brewery' achievement */ + public static Achievement potion = (new Achievement("achievement.potion", "potion", 2, 8, Items.potionitem, blazeRod)).registerStat(); + + /** Is the 'The End?' achievement */ + public static Achievement theEnd = (new Achievement("achievement.theEnd", "theEnd", 3, 10, Items.ender_eye, blazeRod)).setSpecial().registerStat(); + + /** Is the 'The End.' achievement */ + public static Achievement theEnd2 = (new Achievement("achievement.theEnd2", "theEnd2", 4, 13, Blocks.dragon_egg, theEnd)).setSpecial().registerStat(); + + /** Is the 'Enchanter' achievement */ + public static Achievement enchantments = (new Achievement("achievement.enchantments", "enchantments", -4, 4, Blocks.enchanting_table, diamonds)).registerStat(); + public static Achievement overkill = (new Achievement("achievement.overkill", "overkill", -4, 1, Items.diamond_sword, enchantments)).setSpecial().registerStat(); + + /** Is the 'Librarian' achievement */ + public static Achievement bookcase = (new Achievement("achievement.bookcase", "bookcase", -3, 6, Blocks.bookshelf, enchantments)).registerStat(); + public static Achievement field_150962_H = (new Achievement("achievement.breedCow", "breedCow", 7, -5, Items.wheat, killCow)).registerStat(); + public static Achievement field_150963_I = (new Achievement("achievement.spawnWither", "spawnWither", 7, 12, new ItemStack(Items.skull, 1, 1), theEnd2)).registerStat(); + public static Achievement field_150964_J = (new Achievement("achievement.killWither", "killWither", 7, 10, Items.nether_star, field_150963_I)).registerStat(); + public static Achievement field_150965_K = (new Achievement("achievement.fullBeacon", "fullBeacon", 7, 8, Blocks.beacon, field_150964_J)).setSpecial().registerStat(); + public static Achievement field_150961_L = (new Achievement("achievement.exploreAllBiomes", "exploreAllBiomes", 4, 8, Items.diamond_boots, theEnd)).func_150953_b(JsonSerializableSet.class).setSpecial().registerStat(); + + + /** + * A stub functions called to make the static initializer for this class run. + */ + public static void init() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/IStatStringFormat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/IStatStringFormat.java new file mode 100644 index 0000000..c1194c0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/IStatStringFormat.java @@ -0,0 +1,8 @@ +package net.minecraft.stats; + +public interface IStatStringFormat { + /** + * Formats the strings based on 'IStatStringFormat' interface. + */ + String formatString(String p_74535_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/IStatType.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/IStatType.java new file mode 100644 index 0000000..a810982 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/IStatType.java @@ -0,0 +1,8 @@ +package net.minecraft.stats; + +public interface IStatType { + /** + * Formats a given stat for human consumption. + */ + String format(int p_75843_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/ObjectiveStat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/ObjectiveStat.java new file mode 100644 index 0000000..c9f207c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/ObjectiveStat.java @@ -0,0 +1,13 @@ +package net.minecraft.stats; + +import net.minecraft.scoreboard.ScoreDummyCriteria; + +public class ObjectiveStat extends ScoreDummyCriteria { + private final StatBase field_151459_g; + + + public ObjectiveStat(StatBase p_i45483_1_) { + super(p_i45483_1_.statId); + this.field_151459_g = p_i45483_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatBase.java new file mode 100644 index 0000000..1a9be46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatBase.java @@ -0,0 +1,147 @@ +package net.minecraft.stats; + +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.Locale; +import net.minecraft.event.HoverEvent; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class StatBase { + /** The Stat ID */ + public final String statId; + + /** The Stat name */ + private final IChatComponent statName; + public boolean isIndependent; + private final IStatType type; + private final IScoreObjectiveCriteria field_150957_c; + private Class field_150956_d; + private static final NumberFormat numberFormat = NumberFormat.getIntegerInstance(Locale.US); + public static IStatType simpleStatType = new IStatType() { + + public String format(int p_75843_1_) { + return StatBase.numberFormat.format(p_75843_1_); + } + }; + private static final DecimalFormat decimalFormat = new DecimalFormat("########0.00"); + public static IStatType timeStatType = new IStatType() { + + public String format(int p_75843_1_) { + double var2 = (double)p_75843_1_ / 20.0D; + double var4 = var2 / 60.0D; + double var6 = var4 / 60.0D; + double var8 = var6 / 24.0D; + double var10 = var8 / 365.0D; + return var10 > 0.5D ? StatBase.decimalFormat.format(var10) + " y" : (var8 > 0.5D ? StatBase.decimalFormat.format(var8) + " d" : (var6 > 0.5D ? StatBase.decimalFormat.format(var6) + " h" : (var4 > 0.5D ? StatBase.decimalFormat.format(var4) + " m" : var2 + " s"))); + } + }; + public static IStatType distanceStatType = new IStatType() { + + public String format(int p_75843_1_) { + double var2 = (double)p_75843_1_ / 100.0D; + double var4 = var2 / 1000.0D; + return var4 > 0.5D ? StatBase.decimalFormat.format(var4) + " km" : (var2 > 0.5D ? StatBase.decimalFormat.format(var2) + " m" : p_75843_1_ + " cm"); + } + }; + public static IStatType field_111202_k = new IStatType() { + + public String format(int p_75843_1_) { + return StatBase.decimalFormat.format((double)p_75843_1_ * 0.1D); + } + }; + + + public StatBase(String p_i45307_1_, IChatComponent p_i45307_2_, IStatType p_i45307_3_) { + this.statId = p_i45307_1_; + this.statName = p_i45307_2_; + this.type = p_i45307_3_; + this.field_150957_c = new ObjectiveStat(this); + IScoreObjectiveCriteria.field_96643_a.put(this.field_150957_c.func_96636_a(), this.field_150957_c); + } + + public StatBase(String p_i45308_1_, IChatComponent p_i45308_2_) { + this(p_i45308_1_, p_i45308_2_, simpleStatType); + } + + /** + * Initializes the current stat as independent (i.e., lacking prerequisites for being updated) and returns the + * current instance. + */ + public StatBase initIndependentStat() { + this.isIndependent = true; + return this; + } + + /** + * Register the stat into StatList. + */ + public StatBase registerStat() { + if (StatList.oneShotStats.containsKey(this.statId)) { + throw new RuntimeException("Duplicate stat id: \"" + ((StatBase)StatList.oneShotStats.get(this.statId)).statName + "\" and \"" + this.statName + "\" at id " + this.statId); + } else { + StatList.allStats.add(this); + StatList.oneShotStats.put(this.statId, this); + return this; + } + } + + /** + * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). + */ + public boolean isAchievement() { + return false; + } + + public String func_75968_a(int p_75968_1_) { + return this.type.format(p_75968_1_); + } + + public IChatComponent func_150951_e() { + IChatComponent var1 = this.statName.createCopy(); + var1.getChatStyle().setColor(EnumChatFormatting.GRAY); + var1.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ACHIEVEMENT, new ChatComponentText(this.statId))); + return var1; + } + + public IChatComponent func_150955_j() { + IChatComponent var1 = this.func_150951_e(); + IChatComponent var2 = (new ChatComponentText("[")).appendSibling(var1).appendText("]"); + var2.setChatStyle(var1.getChatStyle()); + return var2; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) { + StatBase var2 = (StatBase)p_equals_1_; + return this.statId.equals(var2.statId); + } else { + return false; + } + } + + public int hashCode() { + return this.statId.hashCode(); + } + + public String toString() { + return "Stat{id=" + this.statId + ", nameId=" + this.statName + ", awardLocallyOnly=" + this.isIndependent + ", formatter=" + this.type + ", objectiveCriteria=" + this.field_150957_c + '}'; + } + + public IScoreObjectiveCriteria func_150952_k() { + return this.field_150957_c; + } + + public Class func_150954_l() { + return this.field_150956_d; + } + + public StatBase func_150953_b(Class p_150953_1_) { + this.field_150956_d = p_150953_1_; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatBasic.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatBasic.java new file mode 100644 index 0000000..6ac14d1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatBasic.java @@ -0,0 +1,24 @@ +package net.minecraft.stats; + +import net.minecraft.util.IChatComponent; + +public class StatBasic extends StatBase { + + + public StatBasic(String p_i45303_1_, IChatComponent p_i45303_2_, IStatType p_i45303_3_) { + super(p_i45303_1_, p_i45303_2_, p_i45303_3_); + } + + public StatBasic(String p_i45304_1_, IChatComponent p_i45304_2_) { + super(p_i45304_1_, p_i45304_2_); + } + + /** + * Register the stat into StatList. + */ + public StatBase registerStat() { + super.registerStat(); + StatList.generalStats.add(this); + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatCrafting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatCrafting.java new file mode 100644 index 0000000..9bc40a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatCrafting.java @@ -0,0 +1,18 @@ +package net.minecraft.stats; + +import net.minecraft.item.Item; +import net.minecraft.util.IChatComponent; + +public class StatCrafting extends StatBase { + private final Item field_150960_a; + + + public StatCrafting(String p_i45305_1_, IChatComponent p_i45305_2_, Item p_i45305_3_) { + super(p_i45305_1_, p_i45305_2_); + this.field_150960_a = p_i45305_3_; + } + + public Item func_150959_a() { + return this.field_150960_a; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatFileWriter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatFileWriter.java new file mode 100644 index 0000000..1846313 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatFileWriter.java @@ -0,0 +1,79 @@ +package net.minecraft.stats; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.TupleIntJsonSerializable; + +public class StatFileWriter { + protected final Map field_150875_a = Maps.newConcurrentMap(); + + + /** + * Returns true if the achievement has been unlocked. + */ + public boolean hasAchievementUnlocked(Achievement p_77443_1_) { + return this.writeStat(p_77443_1_) > 0; + } + + /** + * Returns true if the parent has been unlocked, or there is no parent + */ + public boolean canUnlockAchievement(Achievement p_77442_1_) { + return p_77442_1_.parentAchievement == null || this.hasAchievementUnlocked(p_77442_1_.parentAchievement); + } + + public int func_150874_c(Achievement p_150874_1_) { + if (this.hasAchievementUnlocked(p_150874_1_)) { + return 0; + } else { + int var2 = 0; + + for (Achievement var3 = p_150874_1_.parentAchievement; var3 != null && !this.hasAchievementUnlocked(var3); ++var2) { + var3 = var3.parentAchievement; + } + + return var2; + } + } + + public void func_150871_b(EntityPlayer p_150871_1_, StatBase p_150871_2_, int p_150871_3_) { + if (!p_150871_2_.isAchievement() || this.canUnlockAchievement((Achievement)p_150871_2_)) { + this.func_150873_a(p_150871_1_, p_150871_2_, this.writeStat(p_150871_2_) + p_150871_3_); + } + } + + public void func_150873_a(EntityPlayer p_150873_1_, StatBase p_150873_2_, int p_150873_3_) { + TupleIntJsonSerializable var4 = (TupleIntJsonSerializable)this.field_150875_a.get(p_150873_2_); + + if (var4 == null) { + var4 = new TupleIntJsonSerializable(); + this.field_150875_a.put(p_150873_2_, var4); + } + + var4.setIntegerValue(p_150873_3_); + } + + public int writeStat(StatBase p_77444_1_) { + TupleIntJsonSerializable var2 = (TupleIntJsonSerializable)this.field_150875_a.get(p_77444_1_); + return var2 == null ? 0 : var2.getIntegerValue(); + } + + public IJsonSerializable func_150870_b(StatBase p_150870_1_) { + TupleIntJsonSerializable var2 = (TupleIntJsonSerializable)this.field_150875_a.get(p_150870_1_); + return var2 != null ? var2.getJsonSerializableValue() : null; + } + + public IJsonSerializable func_150872_a(StatBase p_150872_1_, IJsonSerializable p_150872_2_) { + TupleIntJsonSerializable var3 = (TupleIntJsonSerializable)this.field_150875_a.get(p_150872_1_); + + if (var3 == null) { + var3 = new TupleIntJsonSerializable(); + this.field_150875_a.put(p_150872_1_, var3); + } + + var3.setJsonSerializableValue(p_150872_2_); + return p_150872_2_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatList.java new file mode 100644 index 0000000..f9274de --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatList.java @@ -0,0 +1,249 @@ +package net.minecraft.stats; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ChatComponentTranslation; + +public class StatList { + /** Tracks one-off stats. */ + protected static Map oneShotStats = new HashMap(); + public static List allStats = new ArrayList(); + public static List generalStats = new ArrayList(); + public static List itemStats = new ArrayList(); + + /** Tracks the number of times a given block or item has been mined. */ + public static List objectMineStats = new ArrayList(); + + /** number of times you've left a game */ + public static StatBase leaveGameStat = (new StatBasic("stat.leaveGame", new ChatComponentTranslation("stat.leaveGame"))).initIndependentStat().registerStat(); + + /** number of minutes you have played */ + public static StatBase minutesPlayedStat = (new StatBasic("stat.playOneMinute", new ChatComponentTranslation("stat.playOneMinute"), StatBase.timeStatType)).initIndependentStat().registerStat(); + + /** distance you've walked */ + public static StatBase distanceWalkedStat = (new StatBasic("stat.walkOneCm", new ChatComponentTranslation("stat.walkOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** distance you have swam */ + public static StatBase distanceSwumStat = (new StatBasic("stat.swimOneCm", new ChatComponentTranslation("stat.swimOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the distance you have fallen */ + public static StatBase distanceFallenStat = (new StatBasic("stat.fallOneCm", new ChatComponentTranslation("stat.fallOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the distance you've climbed */ + public static StatBase distanceClimbedStat = (new StatBasic("stat.climbOneCm", new ChatComponentTranslation("stat.climbOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the distance you've flown */ + public static StatBase distanceFlownStat = (new StatBasic("stat.flyOneCm", new ChatComponentTranslation("stat.flyOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the distance you've dived */ + public static StatBase distanceDoveStat = (new StatBasic("stat.diveOneCm", new ChatComponentTranslation("stat.diveOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the distance you've traveled by minecart */ + public static StatBase distanceByMinecartStat = (new StatBasic("stat.minecartOneCm", new ChatComponentTranslation("stat.minecartOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the distance you've traveled by boat */ + public static StatBase distanceByBoatStat = (new StatBasic("stat.boatOneCm", new ChatComponentTranslation("stat.boatOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the distance you've traveled by pig */ + public static StatBase distanceByPigStat = (new StatBasic("stat.pigOneCm", new ChatComponentTranslation("stat.pigOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase field_151185_q = (new StatBasic("stat.horseOneCm", new ChatComponentTranslation("stat.horseOneCm"), StatBase.distanceStatType)).initIndependentStat().registerStat(); + + /** the times you've jumped */ + public static StatBase jumpStat = (new StatBasic("stat.jump", new ChatComponentTranslation("stat.jump"))).initIndependentStat().registerStat(); + + /** the distance you've dropped (or times you've fallen?) */ + public static StatBase dropStat = (new StatBasic("stat.drop", new ChatComponentTranslation("stat.drop"))).initIndependentStat().registerStat(); + + /** the amount of damage you've dealt */ + public static StatBase damageDealtStat = (new StatBasic("stat.damageDealt", new ChatComponentTranslation("stat.damageDealt"), StatBase.field_111202_k)).registerStat(); + + /** the amount of damage you have taken */ + public static StatBase damageTakenStat = (new StatBasic("stat.damageTaken", new ChatComponentTranslation("stat.damageTaken"), StatBase.field_111202_k)).registerStat(); + + /** the number of times you have died */ + public static StatBase deathsStat = (new StatBasic("stat.deaths", new ChatComponentTranslation("stat.deaths"))).registerStat(); + + /** the number of mobs you have killed */ + public static StatBase mobKillsStat = (new StatBasic("stat.mobKills", new ChatComponentTranslation("stat.mobKills"))).registerStat(); + public static StatBase field_151186_x = (new StatBasic("stat.animalsBred", new ChatComponentTranslation("stat.animalsBred"))).registerStat(); + + /** counts the number of times you've killed a player */ + public static StatBase playerKillsStat = (new StatBasic("stat.playerKills", new ChatComponentTranslation("stat.playerKills"))).registerStat(); + public static StatBase fishCaughtStat = (new StatBasic("stat.fishCaught", new ChatComponentTranslation("stat.fishCaught"))).registerStat(); + public static StatBase field_151183_A = (new StatBasic("stat.junkFished", new ChatComponentTranslation("stat.junkFished"))).registerStat(); + public static StatBase field_151184_B = (new StatBasic("stat.treasureFished", new ChatComponentTranslation("stat.treasureFished"))).registerStat(); + public static final StatBase[] mineBlockStatArray = new StatBase[4096]; + + /** Tracks the number of items a given block or item has been crafted. */ + public static final StatBase[] objectCraftStats = new StatBase[32000]; + + /** Tracks the number of times a given block or item has been used. */ + public static final StatBase[] objectUseStats = new StatBase[32000]; + + /** Tracks the number of times a given block or item has been broken. */ + public static final StatBase[] objectBreakStats = new StatBase[32000]; + + + public static void func_151178_a() { + func_151181_c(); + initStats(); + func_151179_e(); + initCraftableStats(); + AchievementList.init(); + EntityList.func_151514_a(); + } + + /** + * Initializes statistics related to craftable items. Is only called after both block and item stats have been + * initialized. + */ + private static void initCraftableStats() { + HashSet var0 = new HashSet(); + Iterator var1 = CraftingManager.getInstance().getRecipeList().iterator(); + + while (var1.hasNext()) { + IRecipe var2 = (IRecipe)var1.next(); + + if (var2.getRecipeOutput() != null) { + var0.add(var2.getRecipeOutput().getItem()); + } + } + + var1 = FurnaceRecipes.smelting().getSmeltingList().values().iterator(); + + while (var1.hasNext()) { + ItemStack var4 = (ItemStack)var1.next(); + var0.add(var4.getItem()); + } + + var1 = var0.iterator(); + + while (var1.hasNext()) { + Item var5 = (Item)var1.next(); + + if (var5 != null) { + int var3 = Item.getIdFromItem(var5); + objectCraftStats[var3] = (new StatCrafting("stat.craftItem." + var3, new ChatComponentTranslation("stat.craftItem", (new ItemStack(var5)).func_151000_E()), var5)).registerStat(); + } + } + + replaceAllSimilarBlocks(objectCraftStats); + } + + private static void func_151181_c() { + Iterator var0 = Block.blockRegistry.iterator(); + + while (var0.hasNext()) { + Block var1 = (Block)var0.next(); + + if (Item.getItemFromBlock(var1) != null) { + int var2 = Block.getIdFromBlock(var1); + + if (var1.getEnableStats()) { + mineBlockStatArray[var2] = (new StatCrafting("stat.mineBlock." + var2, new ChatComponentTranslation("stat.mineBlock", (new ItemStack(var1)).func_151000_E()), Item.getItemFromBlock(var1))).registerStat(); + objectMineStats.add(mineBlockStatArray[var2]); + } + } + } + + replaceAllSimilarBlocks(mineBlockStatArray); + } + + private static void initStats() { + Iterator var0 = Item.itemRegistry.iterator(); + + while (var0.hasNext()) { + Item var1 = (Item)var0.next(); + + if (var1 != null) { + int var2 = Item.getIdFromItem(var1); + objectUseStats[var2] = (new StatCrafting("stat.useItem." + var2, new ChatComponentTranslation("stat.useItem", (new ItemStack(var1)).func_151000_E()), var1)).registerStat(); + + if (!(var1 instanceof ItemBlock)) { + itemStats.add(objectUseStats[var2]); + } + } + } + + replaceAllSimilarBlocks(objectUseStats); + } + + private static void func_151179_e() { + Iterator var0 = Item.itemRegistry.iterator(); + + while (var0.hasNext()) { + Item var1 = (Item)var0.next(); + + if (var1 != null) { + int var2 = Item.getIdFromItem(var1); + + if (var1.isDamageable()) { + objectBreakStats[var2] = (new StatCrafting("stat.breakItem." + var2, new ChatComponentTranslation("stat.breakItem", (new ItemStack(var1)).func_151000_E()), var1)).registerStat(); + } + } + } + + replaceAllSimilarBlocks(objectBreakStats); + } + + /** + * Forces all dual blocks to count for each other on the stats list + */ + private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_) { + func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water); + func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava); + func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin); + func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace); + func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore); + func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater); + func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator); + func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch); + func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp); + func_151180_a(p_75924_0_, Blocks.red_mushroom, Blocks.brown_mushroom); + func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab); + func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab); + func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt); + func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt); + } + + private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_) { + int var3 = Block.getIdFromBlock(p_151180_1_); + int var4 = Block.getIdFromBlock(p_151180_2_); + + if (p_151180_0_[var3] != null && p_151180_0_[var4] == null) { + p_151180_0_[var4] = p_151180_0_[var3]; + } else { + allStats.remove(p_151180_0_[var3]); + objectMineStats.remove(p_151180_0_[var3]); + generalStats.remove(p_151180_0_[var3]); + p_151180_0_[var3] = p_151180_0_[var4]; + } + } + + public static StatBase func_151182_a(EntityList.EntityEggInfo p_151182_0_) { + String var1 = EntityList.getStringFromID(p_151182_0_.spawnedID); + return var1 == null ? null : (new StatBase("stat.killEntity." + var1, new ChatComponentTranslation("stat.entityKill", new ChatComponentTranslation("entity." + var1 + ".name")))).registerStat(); + } + + public static StatBase func_151176_b(EntityList.EntityEggInfo p_151176_0_) { + String var1 = EntityList.getStringFromID(p_151176_0_.spawnedID); + return var1 == null ? null : (new StatBase("stat.entityKilledBy." + var1, new ChatComponentTranslation("stat.entityKilledBy", new ChatComponentTranslation("entity." + var1 + ".name")))).registerStat(); + } + + public static StatBase func_151177_a(String p_151177_0_) { + return (StatBase)oneShotStats.get(p_151177_0_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatisticsFile.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatisticsFile.java new file mode 100644 index 0000000..d40c34e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/stats/StatisticsFile.java @@ -0,0 +1,204 @@ +package net.minecraft.stats; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.TupleIntJsonSerializable; +import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class StatisticsFile extends StatFileWriter { + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer field_150890_c; + private final File field_150887_d; + private final Set field_150888_e = Sets.newHashSet(); + private int field_150885_f = -300; + private boolean field_150886_g = false; + + + public StatisticsFile(MinecraftServer p_i45306_1_, File p_i45306_2_) { + this.field_150890_c = p_i45306_1_; + this.field_150887_d = p_i45306_2_; + } + + public void func_150882_a() { + if (this.field_150887_d.isFile()) { + try { + this.field_150875_a.clear(); + this.field_150875_a.putAll(this.func_150881_a(FileUtils.readFileToString(this.field_150887_d))); + } catch (IOException var2) { + logger.error("Couldn't read statistics file " + this.field_150887_d, var2); + } catch (JsonParseException var3) { + logger.error("Couldn't parse statistics file " + this.field_150887_d, var3); + } + } + } + + public void func_150883_b() { + try { + FileUtils.writeStringToFile(this.field_150887_d, func_150880_a(this.field_150875_a)); + } catch (IOException var2) { + logger.error("Couldn't save stats", var2); + } + } + + public void func_150873_a(EntityPlayer p_150873_1_, StatBase p_150873_2_, int p_150873_3_) { + int var4 = p_150873_2_.isAchievement() ? this.writeStat(p_150873_2_) : 0; + super.func_150873_a(p_150873_1_, p_150873_2_, p_150873_3_); + this.field_150888_e.add(p_150873_2_); + + if (p_150873_2_.isAchievement() && var4 == 0 && p_150873_3_ > 0) { + this.field_150886_g = true; + + if (this.field_150890_c.func_147136_ar()) { + this.field_150890_c.getConfigurationManager().func_148539_a(new ChatComponentTranslation("chat.type.achievement", p_150873_1_.func_145748_c_(), p_150873_2_.func_150955_j())); + } + } + } + + public Set func_150878_c() { + HashSet var1 = Sets.newHashSet(this.field_150888_e); + this.field_150888_e.clear(); + this.field_150886_g = false; + return var1; + } + + public Map func_150881_a(String p_150881_1_) { + JsonElement var2 = (new JsonParser()).parse(p_150881_1_); + + if (!var2.isJsonObject()) { + return Maps.newHashMap(); + } else { + JsonObject var3 = var2.getAsJsonObject(); + HashMap var4 = Maps.newHashMap(); + Iterator var5 = var3.entrySet().iterator(); + + while (var5.hasNext()) { + Entry var6 = (Entry)var5.next(); + StatBase var7 = StatList.func_151177_a((String)var6.getKey()); + + if (var7 != null) { + TupleIntJsonSerializable var8 = new TupleIntJsonSerializable(); + + if (((JsonElement)var6.getValue()).isJsonPrimitive() && ((JsonElement)var6.getValue()).getAsJsonPrimitive().isNumber()) { + var8.setIntegerValue(((JsonElement)var6.getValue()).getAsInt()); + } else if (((JsonElement)var6.getValue()).isJsonObject()) { + JsonObject var9 = ((JsonElement)var6.getValue()).getAsJsonObject(); + + if (var9.has("value") && var9.get("value").isJsonPrimitive() && var9.get("value").getAsJsonPrimitive().isNumber()) { + var8.setIntegerValue(var9.getAsJsonPrimitive("value").getAsInt()); + } + + if (var9.has("progress") && var7.func_150954_l() != null) { + try { + Constructor var10 = var7.func_150954_l().getConstructor(); + IJsonSerializable var11 = (IJsonSerializable)var10.newInstance(new Object[0]); + var11.func_152753_a(var9.get("progress")); + var8.setJsonSerializableValue(var11); + } catch (Throwable var12) { + logger.warn("Invalid statistic progress in " + this.field_150887_d, var12); + } + } + } + + var4.put(var7, var8); + } else { + logger.warn("Invalid statistic in " + this.field_150887_d + ": Don't know what " + var6.getKey() + " is"); + } + } + + return var4; + } + } + + public static String func_150880_a(Map p_150880_0_) { + JsonObject var1 = new JsonObject(); + Iterator var2 = p_150880_0_.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + + if (((TupleIntJsonSerializable)var3.getValue()).getJsonSerializableValue() != null) { + JsonObject var4 = new JsonObject(); + var4.addProperty("value", Integer.valueOf(((TupleIntJsonSerializable)var3.getValue()).getIntegerValue())); + + try { + var4.add("progress", ((TupleIntJsonSerializable)var3.getValue()).getJsonSerializableValue().getSerializableElement()); + } catch (Throwable var6) { + logger.warn("Couldn't save statistic " + ((StatBase)var3.getKey()).func_150951_e() + ": error serializing progress", var6); + } + + var1.add(((StatBase)var3.getKey()).statId, var4); + } else { + var1.addProperty(((StatBase)var3.getKey()).statId, Integer.valueOf(((TupleIntJsonSerializable)var3.getValue()).getIntegerValue())); + } + } + + return var1.toString(); + } + + public void func_150877_d() { + Iterator var1 = this.field_150875_a.keySet().iterator(); + + while (var1.hasNext()) { + StatBase var2 = (StatBase)var1.next(); + this.field_150888_e.add(var2); + } + } + + public void func_150876_a(EntityPlayerMP p_150876_1_) { + int var2 = this.field_150890_c.getTickCounter(); + HashMap var3 = Maps.newHashMap(); + + if (this.field_150886_g || var2 - this.field_150885_f > 300) { + this.field_150885_f = var2; + Iterator var4 = this.func_150878_c().iterator(); + + while (var4.hasNext()) { + StatBase var5 = (StatBase)var4.next(); + var3.put(var5, Integer.valueOf(this.writeStat(var5))); + } + } + + p_150876_1_.playerNetServerHandler.sendPacket(new S37PacketStatistics(var3)); + } + + public void func_150884_b(EntityPlayerMP p_150884_1_) { + HashMap var2 = Maps.newHashMap(); + Iterator var3 = AchievementList.achievementList.iterator(); + + while (var3.hasNext()) { + Achievement var4 = (Achievement)var3.next(); + + if (this.hasAchievementUnlocked(var4)) { + var2.put(var4, Integer.valueOf(this.writeStat(var4))); + this.field_150888_e.remove(var4); + } + } + + p_150884_1_.playerNetServerHandler.sendPacket(new S37PacketStatistics(var2)); + } + + public boolean func_150879_e() { + return this.field_150886_g; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/IHopper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/IHopper.java new file mode 100644 index 0000000..405c08f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/IHopper.java @@ -0,0 +1,26 @@ +package net.minecraft.tileentity; + +import net.minecraft.inventory.IInventory; +import net.minecraft.world.World; + +public interface IHopper extends IInventory { + /** + * Returns the worldObj for this tileEntity. + */ + World getWorldObj(); + + /** + * Gets the world X position for this hopper entity. + */ + double getXPos(); + + /** + * Gets the world Y position for this hopper entity. + */ + double getYPos(); + + /** + * Gets the world Z position for this hopper entity. + */ + double getZPos(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java new file mode 100644 index 0000000..08ea0a9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java @@ -0,0 +1,387 @@ +package net.minecraft.tileentity; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.World; + +public abstract class MobSpawnerBaseLogic { + /** The delay to spawn. */ + public int spawnDelay = 20; + private String mobID = "Pig"; + + /** List of minecart to spawn. */ + private List minecartToSpawn; + private MobSpawnerBaseLogic.WeightedRandomMinecart randomMinecart; + public double field_98287_c; + public double field_98284_d; + private int minSpawnDelay = 200; + private int maxSpawnDelay = 800; + + /** A counter for spawn tries. */ + private int spawnCount = 4; + private Entity field_98291_j; + private int maxNearbyEntities = 6; + + /** The distance from which a player activates the spawner. */ + private int activatingRangeFromPlayer = 16; + + /** The range coefficient for spawning entities around. */ + private int spawnRange = 4; + + + /** + * Gets the entity name that should be spawned. + */ + public String getEntityNameToSpawn() { + if (this.getRandomMinecart() == null) { + if (this.mobID.equals("Minecart")) { + this.mobID = "MinecartRideable"; + } + + return this.mobID; + } else { + return this.getRandomMinecart().minecartName; + } + } + + public void setMobID(String p_98272_1_) { + this.mobID = p_98272_1_; + } + + /** + * Returns true if there's a player close enough to this mob spawner to activate it. + */ + public boolean canRun() { + return this.getSpawnerWorld().getClosestPlayer((double)this.getSpawnerX() + 0.5D, (double)this.getSpawnerY() + 0.5D, (double)this.getSpawnerZ() + 0.5D, this.activatingRangeFromPlayer) != null; + } + + public void updateSpawner() { + if (this.canRun()) { + double var5; + + if (this.getSpawnerWorld().isClient) { + double var1 = (float)this.getSpawnerX() + this.getSpawnerWorld().rand.nextFloat(); + double var3 = (float)this.getSpawnerY() + this.getSpawnerWorld().rand.nextFloat(); + var5 = (float)this.getSpawnerZ() + this.getSpawnerWorld().rand.nextFloat(); + this.getSpawnerWorld().spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); + this.getSpawnerWorld().spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); + + if (this.spawnDelay > 0) { + --this.spawnDelay; + } + + this.field_98284_d = this.field_98287_c; + this.field_98287_c = (this.field_98287_c + (double)(1000.0F / ((float)this.spawnDelay + 200.0F))) % 360.0D; + } else { + if (this.spawnDelay == -1) { + this.resetTimer(); + } + + if (this.spawnDelay > 0) { + --this.spawnDelay; + return; + } + + boolean var12 = false; + + for (int var2 = 0; var2 < this.spawnCount; ++var2) { + Entity var13 = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); + + if (var13 == null) { + return; + } + + int var4 = this.getSpawnerWorld().getEntitiesWithinAABB(var13.getClass(), AxisAlignedBB.getBoundingBox(this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), this.getSpawnerX() + 1, this.getSpawnerY() + 1, this.getSpawnerZ() + 1).expand(this.spawnRange * 2, 4.0D, this.spawnRange * 2)).size(); + + if (var4 >= this.maxNearbyEntities) { + this.resetTimer(); + return; + } + + var5 = (double)this.getSpawnerX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; + double var7 = this.getSpawnerY() + this.getSpawnerWorld().rand.nextInt(3) - 1; + double var9 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; + EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving)var13 : null; + var13.setLocationAndAngles(var5, var7, var9, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); + + if (var11 == null || var11.getCanSpawnHere()) { + this.func_98265_a(var13); + this.getSpawnerWorld().playAuxSFX(2004, this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 0); + + if (var11 != null) { + var11.spawnExplosionParticle(); + } + + var12 = true; + } + } + + if (var12) { + this.resetTimer(); + } + } + } + } + + public Entity func_98265_a(Entity p_98265_1_) { + if (this.getRandomMinecart() != null) { + NBTTagCompound var2 = new NBTTagCompound(); + p_98265_1_.writeToNBTOptional(var2); + Iterator var3 = this.getRandomMinecart().field_98222_b.func_150296_c().iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + NBTBase var5 = this.getRandomMinecart().field_98222_b.getTag(var4); + var2.setTag(var4, var5.copy()); + } + + p_98265_1_.readFromNBT(var2); + + if (p_98265_1_.worldObj != null) { + p_98265_1_.worldObj.spawnEntityInWorld(p_98265_1_); + } + + NBTTagCompound var11; + + for (Entity var10 = p_98265_1_; var2.func_150297_b("Riding", 10); var2 = var11) { + var11 = var2.getCompoundTag("Riding"); + Entity var12 = EntityList.createEntityByName(var11.getString("id"), p_98265_1_.worldObj); + + if (var12 != null) { + NBTTagCompound var6 = new NBTTagCompound(); + var12.writeToNBTOptional(var6); + Iterator var7 = var11.func_150296_c().iterator(); + + while (var7.hasNext()) { + String var8 = (String)var7.next(); + NBTBase var9 = var11.getTag(var8); + var6.setTag(var8, var9.copy()); + } + + var12.readFromNBT(var6); + var12.setLocationAndAngles(var10.posX, var10.posY, var10.posZ, var10.rotationYaw, var10.rotationPitch); + + if (p_98265_1_.worldObj != null) { + p_98265_1_.worldObj.spawnEntityInWorld(var12); + } + + var10.mountEntity(var12); + } + + var10 = var12; + } + } else if (p_98265_1_ instanceof EntityLivingBase && p_98265_1_.worldObj != null) { + ((EntityLiving)p_98265_1_).onSpawnWithEgg(null); + this.getSpawnerWorld().spawnEntityInWorld(p_98265_1_); + } + + return p_98265_1_; + } + + private void resetTimer() { + if (this.maxSpawnDelay <= this.minSpawnDelay) { + this.spawnDelay = this.minSpawnDelay; + } else { + int var10003 = this.maxSpawnDelay - this.minSpawnDelay; + this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(var10003); + } + + if (this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { + this.setRandomMinecart((MobSpawnerBaseLogic.WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().rand, this.minecartToSpawn)); + } + + this.func_98267_a(1); + } + + public void readFromNBT(NBTTagCompound p_98270_1_) { + this.mobID = p_98270_1_.getString("EntityId"); + this.spawnDelay = p_98270_1_.getShort("Delay"); + + if (p_98270_1_.func_150297_b("SpawnPotentials", 9)) { + this.minecartToSpawn = new ArrayList(); + NBTTagList var2 = p_98270_1_.getTagList("SpawnPotentials", 10); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + this.minecartToSpawn.add(new MobSpawnerBaseLogic.WeightedRandomMinecart(var2.getCompoundTagAt(var3))); + } + } else { + this.minecartToSpawn = null; + } + + if (p_98270_1_.func_150297_b("SpawnData", 10)) { + this.setRandomMinecart(new MobSpawnerBaseLogic.WeightedRandomMinecart(p_98270_1_.getCompoundTag("SpawnData"), this.mobID)); + } else { + this.setRandomMinecart(null); + } + + if (p_98270_1_.func_150297_b("MinSpawnDelay", 99)) { + this.minSpawnDelay = p_98270_1_.getShort("MinSpawnDelay"); + this.maxSpawnDelay = p_98270_1_.getShort("MaxSpawnDelay"); + this.spawnCount = p_98270_1_.getShort("SpawnCount"); + } + + if (p_98270_1_.func_150297_b("MaxNearbyEntities", 99)) { + this.maxNearbyEntities = p_98270_1_.getShort("MaxNearbyEntities"); + this.activatingRangeFromPlayer = p_98270_1_.getShort("RequiredPlayerRange"); + } + + if (p_98270_1_.func_150297_b("SpawnRange", 99)) { + this.spawnRange = p_98270_1_.getShort("SpawnRange"); + } + + if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isClient) { + this.field_98291_j = null; + } + } + + public void writeToNBT(NBTTagCompound p_98280_1_) { + p_98280_1_.setString("EntityId", this.getEntityNameToSpawn()); + p_98280_1_.setShort("Delay", (short)this.spawnDelay); + p_98280_1_.setShort("MinSpawnDelay", (short)this.minSpawnDelay); + p_98280_1_.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); + p_98280_1_.setShort("SpawnCount", (short)this.spawnCount); + p_98280_1_.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); + p_98280_1_.setShort("RequiredPlayerRange", (short)this.activatingRangeFromPlayer); + p_98280_1_.setShort("SpawnRange", (short)this.spawnRange); + + if (this.getRandomMinecart() != null) { + p_98280_1_.setTag("SpawnData", this.getRandomMinecart().field_98222_b.copy()); + } + + if (this.getRandomMinecart() != null || this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { + NBTTagList var2 = new NBTTagList(); + + if (this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { + Iterator var3 = this.minecartToSpawn.iterator(); + + while (var3.hasNext()) { + MobSpawnerBaseLogic.WeightedRandomMinecart var4 = (MobSpawnerBaseLogic.WeightedRandomMinecart)var3.next(); + var2.appendTag(var4.func_98220_a()); + } + } else { + var2.appendTag(this.getRandomMinecart().func_98220_a()); + } + + p_98280_1_.setTag("SpawnPotentials", var2); + } + } + + public Entity func_98281_h() { + if (this.field_98291_j == null) { + Entity var1 = EntityList.createEntityByName(this.getEntityNameToSpawn(), null); + var1 = this.func_98265_a(var1); + this.field_98291_j = var1; + } + + return this.field_98291_j; + } + + /** + * Sets the delay to minDelay if parameter given is 1, else return false. + */ + public boolean setDelayToMin(int p_98268_1_) { + if (p_98268_1_ == 1 && this.getSpawnerWorld().isClient) { + this.spawnDelay = this.minSpawnDelay; + return true; + } else { + return false; + } + } + + public MobSpawnerBaseLogic.WeightedRandomMinecart getRandomMinecart() { + return this.randomMinecart; + } + + public void setRandomMinecart(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) { + this.randomMinecart = p_98277_1_; + } + + public abstract void func_98267_a(int p_98267_1_); + + public abstract World getSpawnerWorld(); + + public abstract int getSpawnerX(); + + public abstract int getSpawnerY(); + + public abstract int getSpawnerZ(); + + public class WeightedRandomMinecart extends WeightedRandom.Item { + public final NBTTagCompound field_98222_b; + public final String minecartName; + + + public WeightedRandomMinecart(NBTTagCompound p_i1945_2_) { + super(p_i1945_2_.getInteger("Weight")); + NBTTagCompound var3 = p_i1945_2_.getCompoundTag("Properties"); + String var4 = p_i1945_2_.getString("Type"); + + if (var4.equals("Minecart")) { + if (var3 != null) { + switch (var3.getInteger("Type")) { + case 0: + var4 = "MinecartRideable"; + break; + + case 1: + var4 = "MinecartChest"; + break; + + case 2: + var4 = "MinecartFurnace"; + } + } else { + var4 = "MinecartRideable"; + } + } + + this.field_98222_b = var3; + this.minecartName = var4; + } + + public WeightedRandomMinecart(NBTTagCompound p_i1946_2_, String p_i1946_3_) { + super(1); + + if (p_i1946_3_.equals("Minecart")) { + if (p_i1946_2_ != null) { + switch (p_i1946_2_.getInteger("Type")) { + case 0: + p_i1946_3_ = "MinecartRideable"; + break; + + case 1: + p_i1946_3_ = "MinecartChest"; + break; + + case 2: + p_i1946_3_ = "MinecartFurnace"; + } + } else { + p_i1946_3_ = "MinecartRideable"; + } + } + + this.field_98222_b = p_i1946_2_; + this.minecartName = p_i1946_3_; + } + + public NBTTagCompound func_98220_a() { + NBTTagCompound var1 = new NBTTagCompound(); + var1.setTag("Properties", this.field_98222_b); + var1.setString("Type", this.minecartName); + var1.setInteger("Weight", this.itemWeight); + return var1; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntity.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntity.java new file mode 100644 index 0000000..b398e30 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntity.java @@ -0,0 +1,255 @@ +package net.minecraft.tileentity; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockJukebox; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class TileEntity { + private static final Logger logger = LogManager.getLogger(); + + /** + * A HashMap storing string names of classes mapping to the actual java.lang.Class type. + */ + private static final Map nameToClassMap = new HashMap(); + + /** + * A HashMap storing the classes and mapping to the string names (reverse of nameToClassMap). + */ + private static final Map classToNameMap = new HashMap(); + + /** the instance of the world the tile entity is in. */ + protected World worldObj; + public int field_145851_c; + public int field_145848_d; + public int field_145849_e; + protected boolean tileEntityInvalid; + public int blockMetadata = -1; + + /** the Block type that this TileEntity is contained within */ + public Block blockType; + + + private static void func_145826_a(Class p_145826_0_, String p_145826_1_) { + if (nameToClassMap.containsKey(p_145826_1_)) { + throw new IllegalArgumentException("Duplicate id: " + p_145826_1_); + } else { + nameToClassMap.put(p_145826_1_, p_145826_0_); + classToNameMap.put(p_145826_0_, p_145826_1_); + } + } + + /** + * Returns the worldObj for this tileEntity. + */ + public World getWorldObj() { + return this.worldObj; + } + + /** + * Sets the worldObj for this tileEntity. + */ + public void setWorldObj(World p_145834_1_) { + this.worldObj = p_145834_1_; + } + + /** + * Returns true if the worldObj isn't null. + */ + public boolean hasWorldObj() { + return this.worldObj != null; + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + this.field_145851_c = p_145839_1_.getInteger("x"); + this.field_145848_d = p_145839_1_.getInteger("y"); + this.field_145849_e = p_145839_1_.getInteger("z"); + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + String var2 = (String)classToNameMap.get(this.getClass()); + + if (var2 == null) { + throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!"); + } else { + p_145841_1_.setString("id", var2); + p_145841_1_.setInteger("x", this.field_145851_c); + p_145841_1_.setInteger("y", this.field_145848_d); + p_145841_1_.setInteger("z", this.field_145849_e); + } + } + + public void updateEntity() {} + + /** + * Creates a new entity and loads its data from the specified NBT. + */ + public static TileEntity createAndLoadEntity(NBTTagCompound p_145827_0_) { + TileEntity var1 = null; + + try { + Class var2 = (Class)nameToClassMap.get(p_145827_0_.getString("id")); + + if (var2 != null) { + var1 = (TileEntity)var2.newInstance(); + } + } catch (Exception var3) { + var3.printStackTrace(); + } + + if (var1 != null) { + var1.readFromNBT(p_145827_0_); + } else { + logger.warn("Skipping BlockEntity with id " + p_145827_0_.getString("id")); + } + + return var1; + } + + public int getBlockMetadata() { + if (this.blockMetadata == -1) { + this.blockMetadata = this.worldObj.getBlockMetadata(this.field_145851_c, this.field_145848_d, this.field_145849_e); + } + + return this.blockMetadata; + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() { + if (this.worldObj != null) { + this.blockMetadata = this.worldObj.getBlockMetadata(this.field_145851_c, this.field_145848_d, this.field_145849_e); + this.worldObj.func_147476_b(this.field_145851_c, this.field_145848_d, this.field_145849_e, this); + + if (this.getBlockType() != Blocks.air) { + this.worldObj.func_147453_f(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.getBlockType()); + } + } + } + + /** + * Returns the square of the distance between this entity and the passed in coordinates. + */ + public double getDistanceFrom(double p_145835_1_, double p_145835_3_, double p_145835_5_) { + double var7 = (double)this.field_145851_c + 0.5D - p_145835_1_; + double var9 = (double)this.field_145848_d + 0.5D - p_145835_3_; + double var11 = (double)this.field_145849_e + 0.5D - p_145835_5_; + return var7 * var7 + var9 * var9 + var11 * var11; + } + + public double getMaxRenderDistanceSquared() { + return 4096.0D; + } + + /** + * Gets the block type at the location of this entity (com.cheatbreaker.client-only). + */ + public Block getBlockType() { + if (this.blockType == null) { + this.blockType = this.worldObj.getBlock(this.field_145851_c, this.field_145848_d, this.field_145849_e); + } + + return this.blockType; + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() { + return null; + } + + public boolean isInvalid() { + return this.tileEntityInvalid; + } + + /** + * invalidates a tile entity + */ + public void invalidate() { + this.tileEntityInvalid = true; + } + + /** + * validates a tile entity + */ + public void validate() { + this.tileEntityInvalid = false; + } + + public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) { + return false; + } + + public void updateContainingBlockInfo() { + this.blockType = null; + this.blockMetadata = -1; + } + + public void func_145828_a(CrashReportCategory p_145828_1_) { + p_145828_1_.addCrashSectionCallable("Name", new Callable() { + + public String call() { + return TileEntity.classToNameMap.get(TileEntity.this.getClass()) + " // " + TileEntity.this.getClass().getCanonicalName(); + } + }); + CrashReportCategory.func_147153_a(p_145828_1_, this.field_145851_c, this.field_145848_d, this.field_145849_e, this.getBlockType(), this.getBlockMetadata()); + p_145828_1_.addCrashSectionCallable("Actual block type", new Callable() { + + public String call() { + int var1 = Block.getIdFromBlock(TileEntity.this.worldObj.getBlock(TileEntity.this.field_145851_c, TileEntity.this.field_145848_d, TileEntity.this.field_145849_e)); + + try { + return String.format("ID #%d (%s // %s)", Integer.valueOf(var1), Block.getBlockById(var1).getUnlocalizedName(), Block.getBlockById(var1).getClass().getCanonicalName()); + } catch (Throwable var3) { + return "ID #" + var1; + } + } + }); + p_145828_1_.addCrashSectionCallable("Actual block data value", new Callable() { + + public String call() { + int var1 = TileEntity.this.worldObj.getBlockMetadata(TileEntity.this.field_145851_c, TileEntity.this.field_145848_d, TileEntity.this.field_145849_e); + + if (var1 < 0) { + return "Unknown? (Got " + var1 + ")"; + } else { + String var2 = String.format("%4s", new Object[] {Integer.toBinaryString(var1)}).replace(" ", "0"); + return String.format("%1$d / 0x%1$X / 0b%2$s", Integer.valueOf(var1), var2); + } + } + }); + } + + static { + func_145826_a(TileEntityFurnace.class, "Furnace"); + func_145826_a(TileEntityChest.class, "Chest"); + func_145826_a(TileEntityEnderChest.class, "EnderChest"); + func_145826_a(BlockJukebox.TileEntityJukebox.class, "RecordPlayer"); + func_145826_a(TileEntityDispenser.class, "Trap"); + func_145826_a(TileEntityDropper.class, "Dropper"); + func_145826_a(TileEntitySign.class, "Sign"); + func_145826_a(TileEntityMobSpawner.class, "MobSpawner"); + func_145826_a(TileEntityNote.class, "Music"); + func_145826_a(TileEntityPiston.class, "Piston"); + func_145826_a(TileEntityBrewingStand.class, "Cauldron"); + func_145826_a(TileEntityEnchantmentTable.class, "EnchantTable"); + func_145826_a(TileEntityEndPortal.class, "Airportal"); + func_145826_a(TileEntityCommandBlock.class, "Control"); + func_145826_a(TileEntityBeacon.class, "Beacon"); + func_145826_a(TileEntitySkull.class, "Skull"); + func_145826_a(TileEntityDaylightDetector.class, "DLDetector"); + func_145826_a(TileEntityHopper.class, "Hopper"); + func_145826_a(TileEntityComparator.class, "Comparator"); + func_145826_a(TileEntityFlowerPot.class, "FlowerPot"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java new file mode 100644 index 0000000..e030424 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java @@ -0,0 +1,323 @@ +package net.minecraft.tileentity; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityBeacon extends TileEntity implements IInventory { + public static final Potion[][] field_146009_a = new Potion[][] {{Potion.moveSpeed, Potion.digSpeed}, {Potion.resistance, Potion.jump}, {Potion.damageBoost}, {Potion.regeneration}}; + private long field_146016_i; + private float field_146014_j; + private boolean field_146015_k; + private int field_146012_l = -1; + private int field_146013_m; + private int field_146010_n; + private ItemStack field_146011_o; + private String field_146008_p; + + + public void updateEntity() { + if (this.worldObj.getTotalWorldTime() % 80L == 0L) { + this.func_146003_y(); + this.func_146000_x(); + } + } + + private void func_146000_x() { + if (this.field_146015_k && this.field_146012_l > 0 && !this.worldObj.isClient && this.field_146013_m > 0) { + double var1 = this.field_146012_l * 10 + 10; + byte var3 = 0; + + if (this.field_146012_l >= 4 && this.field_146013_m == this.field_146010_n) { + var3 = 1; + } + + AxisAlignedBB var4 = AxisAlignedBB.getBoundingBox(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.field_145851_c + 1, this.field_145848_d + 1, this.field_145849_e + 1).expand(var1, var1, var1); + var4.maxY = this.worldObj.getHeight(); + List var5 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, var4); + Iterator var6 = var5.iterator(); + EntityPlayer var7; + + while (var6.hasNext()) { + var7 = (EntityPlayer)var6.next(); + var7.addPotionEffect(new PotionEffect(this.field_146013_m, 180, var3, true)); + } + + if (this.field_146012_l >= 4 && this.field_146013_m != this.field_146010_n && this.field_146010_n > 0) { + var6 = var5.iterator(); + + while (var6.hasNext()) { + var7 = (EntityPlayer)var6.next(); + var7.addPotionEffect(new PotionEffect(this.field_146010_n, 180, 0, true)); + } + } + } + } + + private void func_146003_y() { + int var1 = this.field_146012_l; + + if (!this.worldObj.canBlockSeeTheSky(this.field_145851_c, this.field_145848_d + 1, this.field_145849_e)) { + this.field_146015_k = false; + this.field_146012_l = 0; + } else { + this.field_146015_k = true; + this.field_146012_l = 0; + + for (int var2 = 1; var2 <= 4; this.field_146012_l = var2++) { + int var3 = this.field_145848_d - var2; + + if (var3 < 0) { + break; + } + + boolean var4 = true; + + for (int var5 = this.field_145851_c - var2; var5 <= this.field_145851_c + var2 && var4; ++var5) { + for (int var6 = this.field_145849_e - var2; var6 <= this.field_145849_e + var2; ++var6) { + Block var7 = this.worldObj.getBlock(var5, var3, var6); + + if (var7 != Blocks.emerald_block && var7 != Blocks.gold_block && var7 != Blocks.diamond_block && var7 != Blocks.iron_block) { + var4 = false; + break; + } + } + } + + if (!var4) { + break; + } + } + + if (this.field_146012_l == 0) { + this.field_146015_k = false; + } + } + + if (!this.worldObj.isClient && this.field_146012_l == 4 && var1 < this.field_146012_l) { + Iterator var8 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.field_145851_c, this.field_145848_d - 4, this.field_145849_e).expand(10.0D, 5.0D, 10.0D)).iterator(); + + while (var8.hasNext()) { + EntityPlayer var9 = (EntityPlayer)var8.next(); + var9.triggerAchievement(AchievementList.field_150965_K); + } + } + } + + public float func_146002_i() { + if (!this.field_146015_k) { + return 0.0F; + } else { + int var1 = (int)(this.worldObj.getTotalWorldTime() - this.field_146016_i); + this.field_146016_i = this.worldObj.getTotalWorldTime(); + + if (var1 > 1) { + this.field_146014_j -= (float)var1 / 40.0F; + + if (this.field_146014_j < 0.0F) { + this.field_146014_j = 0.0F; + } + } + + this.field_146014_j += 0.025F; + + if (this.field_146014_j > 1.0F) { + this.field_146014_j = 1.0F; + } + + return this.field_146014_j; + } + } + + public int func_146007_j() { + return this.field_146013_m; + } + + public int func_146006_k() { + return this.field_146010_n; + } + + public int func_145998_l() { + return this.field_146012_l; + } + + public void func_146005_c(int p_146005_1_) { + this.field_146012_l = p_146005_1_; + } + + public void func_146001_d(int p_146001_1_) { + this.field_146013_m = 0; + + for (int var2 = 0; var2 < this.field_146012_l && var2 < 3; ++var2) { + Potion[] var3 = field_146009_a[var2]; + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Potion var6 = var3[var5]; + + if (var6.id == p_146001_1_) { + this.field_146013_m = p_146001_1_; + return; + } + } + } + } + + public void func_146004_e(int p_146004_1_) { + this.field_146010_n = 0; + + if (this.field_146012_l >= 4) { + for (int var2 = 0; var2 < 4; ++var2) { + Potion[] var3 = field_146009_a[var2]; + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Potion var6 = var3[var5]; + + if (var6.id == p_146004_1_) { + this.field_146010_n = p_146004_1_; + return; + } + } + } + } + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() { + NBTTagCompound var1 = new NBTTagCompound(); + this.writeToNBT(var1); + return new S35PacketUpdateTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e, 3, var1); + } + + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_146013_m = p_145839_1_.getInteger("Primary"); + this.field_146010_n = p_145839_1_.getInteger("Secondary"); + this.field_146012_l = p_145839_1_.getInteger("Levels"); + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setInteger("Primary", this.field_146013_m); + p_145841_1_.setInteger("Secondary", this.field_146010_n); + p_145841_1_.setInteger("Levels", this.field_146012_l); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 1; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return p_70301_1_ == 0 ? this.field_146011_o : null; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (p_70298_1_ == 0 && this.field_146011_o != null) { + if (p_70298_2_ >= this.field_146011_o.stackSize) { + ItemStack var3 = this.field_146011_o; + this.field_146011_o = null; + return var3; + } else { + this.field_146011_o.stackSize -= p_70298_2_; + return new ItemStack(this.field_146011_o.getItem(), p_70298_2_, this.field_146011_o.getItemDamage()); + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (p_70304_1_ == 0 && this.field_146011_o != null) { + ItemStack var2 = this.field_146011_o; + this.field_146011_o = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + if (p_70299_1_ == 0) { + this.field_146011_o = p_70299_2_; + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.field_146008_p : "container.beacon"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.field_146008_p != null && this.field_146008_p.length() > 0; + } + + public void func_145999_a(String p_145999_1_) { + this.field_146008_p = p_145999_1_; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 1; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) == this && p_70300_1_.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D, (double) this.field_145849_e + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return p_94041_2_.getItem() == Items.emerald || p_94041_2_.getItem() == Items.diamond || p_94041_2_.getItem() == Items.gold_ingot || p_94041_2_.getItem() == Items.iron_ingot; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java new file mode 100644 index 0000000..922457a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -0,0 +1,305 @@ +package net.minecraft.tileentity; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.PotionHelper; + +public class TileEntityBrewingStand extends TileEntity implements ISidedInventory { + private static final int[] field_145941_a = new int[] {3}; + private static final int[] field_145947_i = new int[] {0, 1, 2}; + private ItemStack[] field_145945_j = new ItemStack[4]; + private int field_145946_k; + private int field_145943_l; + private Item field_145944_m; + private String field_145942_n; + + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.field_145942_n : "container.brewing"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.field_145942_n != null && this.field_145942_n.length() > 0; + } + + public void func_145937_a(String p_145937_1_) { + this.field_145942_n = p_145937_1_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.field_145945_j.length; + } + + public void updateEntity() { + if (this.field_145946_k > 0) { + --this.field_145946_k; + + if (this.field_145946_k == 0) { + this.func_145940_l(); + this.onInventoryChanged(); + } else if (!this.func_145934_k()) { + this.field_145946_k = 0; + this.onInventoryChanged(); + } else if (this.field_145944_m != this.field_145945_j[3].getItem()) { + this.field_145946_k = 0; + this.onInventoryChanged(); + } + } else if (this.func_145934_k()) { + this.field_145946_k = 400; + this.field_145944_m = this.field_145945_j[3].getItem(); + } + + int var1 = this.func_145939_j(); + + if (var1 != this.field_145943_l) { + this.field_145943_l = var1; + this.worldObj.setBlockMetadataWithNotify(this.field_145851_c, this.field_145848_d, this.field_145849_e, var1, 2); + } + + super.updateEntity(); + } + + public int func_145935_i() { + return this.field_145946_k; + } + + private boolean func_145934_k() { + if (this.field_145945_j[3] != null && this.field_145945_j[3].stackSize > 0) { + ItemStack var1 = this.field_145945_j[3]; + + if (!var1.getItem().isPotionIngredient(var1)) { + return false; + } else { + boolean var2 = false; + + for (int var3 = 0; var3 < 3; ++var3) { + if (this.field_145945_j[var3] != null && this.field_145945_j[var3].getItem() == Items.potionitem) { + int var4 = this.field_145945_j[var3].getItemDamage(); + int var5 = this.func_145936_c(var4, var1); + + if (!ItemPotion.isSplash(var4) && ItemPotion.isSplash(var5)) { + var2 = true; + break; + } + + List var6 = Items.potionitem.getEffects(var4); + List var7 = Items.potionitem.getEffects(var5); + + if ((var4 <= 0 || var6 != var7) && (var6 == null || !var6.equals(var7) && var7 != null) && var4 != var5) { + var2 = true; + break; + } + } + } + + return var2; + } + } else { + return false; + } + } + + private void func_145940_l() { + if (this.func_145934_k()) { + ItemStack var1 = this.field_145945_j[3]; + + for (int var2 = 0; var2 < 3; ++var2) { + if (this.field_145945_j[var2] != null && this.field_145945_j[var2].getItem() == Items.potionitem) { + int var3 = this.field_145945_j[var2].getItemDamage(); + int var4 = this.func_145936_c(var3, var1); + List var5 = Items.potionitem.getEffects(var3); + List var6 = Items.potionitem.getEffects(var4); + + if ((var3 <= 0 || var5 != var6) && (var5 == null || !var5.equals(var6) && var6 != null)) { + if (var3 != var4) { + this.field_145945_j[var2].setItemDamage(var4); + } + } else if (!ItemPotion.isSplash(var3) && ItemPotion.isSplash(var4)) { + this.field_145945_j[var2].setItemDamage(var4); + } + } + } + + if (var1.getItem().hasContainerItem()) { + this.field_145945_j[3] = new ItemStack(var1.getItem().getContainerItem()); + } else { + --this.field_145945_j[3].stackSize; + + if (this.field_145945_j[3].stackSize <= 0) { + this.field_145945_j[3] = null; + } + } + } + } + + private int func_145936_c(int p_145936_1_, ItemStack p_145936_2_) { + return p_145936_2_ == null ? p_145936_1_ : (p_145936_2_.getItem().isPotionIngredient(p_145936_2_) ? PotionHelper.applyIngredient(p_145936_1_, p_145936_2_.getItem().getPotionEffect(p_145936_2_)) : p_145936_1_); + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList var2 = p_145839_1_.getTagList("Items", 10); + this.field_145945_j = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + byte var5 = var4.getByte("Slot"); + + if (var5 >= 0 && var5 < this.field_145945_j.length) { + this.field_145945_j[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + + this.field_145946_k = p_145839_1_.getShort("BrewTime"); + + if (p_145839_1_.func_150297_b("CustomName", 8)) { + this.field_145942_n = p_145839_1_.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setShort("BrewTime", (short)this.field_145946_k); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.field_145945_j.length; ++var3) { + if (this.field_145945_j[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.field_145945_j[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + p_145841_1_.setTag("Items", var2); + + if (this.isInventoryNameLocalized()) { + p_145841_1_.setString("CustomName", this.field_145942_n); + } + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return p_70301_1_ >= 0 && p_70301_1_ < this.field_145945_j.length ? this.field_145945_j[p_70301_1_] : null; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (p_70298_1_ >= 0 && p_70298_1_ < this.field_145945_j.length) { + ItemStack var3 = this.field_145945_j[p_70298_1_]; + this.field_145945_j[p_70298_1_] = null; + return var3; + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (p_70304_1_ >= 0 && p_70304_1_ < this.field_145945_j.length) { + ItemStack var2 = this.field_145945_j[p_70304_1_]; + this.field_145945_j[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + if (p_70299_1_ >= 0 && p_70299_1_ < this.field_145945_j.length) { + this.field_145945_j[p_70299_1_] = p_70299_2_; + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) == this && p_70300_1_.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D, (double) this.field_145849_e + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return p_94041_1_ == 3 ? p_94041_2_.getItem().isPotionIngredient(p_94041_2_) : p_94041_2_.getItem() == Items.potionitem || p_94041_2_.getItem() == Items.glass_bottle; + } + + public void func_145938_d(int p_145938_1_) { + this.field_145946_k = p_145938_1_; + } + + public int func_145939_j() { + int var1 = 0; + + for (int var2 = 0; var2 < 3; ++var2) { + if (this.field_145945_j[var2] != null) { + var1 |= 1 << var2; + } + } + + return var1; + } + + /** + * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this + * block. + */ + public int[] getAccessibleSlotsFromSide(int p_94128_1_) { + return p_94128_1_ == 1 ? field_145941_a : field_145947_i; + } + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { + return this.isItemValidForSlot(p_102007_1_, p_102007_2_); + } + + /** + * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityChest.java new file mode 100644 index 0000000..722918a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityChest.java @@ -0,0 +1,405 @@ +package net.minecraft.tileentity; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryLargeChest; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityChest extends TileEntity implements IInventory { + private ItemStack[] field_145985_p = new ItemStack[36]; + public boolean field_145984_a; + public TileEntityChest field_145992_i; + public TileEntityChest field_145990_j; + public TileEntityChest field_145991_k; + public TileEntityChest field_145988_l; + public float field_145989_m; + public float field_145986_n; + public int field_145987_o; + private int field_145983_q; + private int field_145982_r; + private String field_145981_s; + + + public TileEntityChest() { + this.field_145982_r = -1; + } + + public TileEntityChest(int p_i2350_1_) { + this.field_145982_r = p_i2350_1_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 27; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return this.field_145985_p[p_70301_1_]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.field_145985_p[p_70298_1_] != null) { + ItemStack var3; + + if (this.field_145985_p[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.field_145985_p[p_70298_1_]; + this.field_145985_p[p_70298_1_] = null; + this.onInventoryChanged(); + return var3; + } else { + var3 = this.field_145985_p[p_70298_1_].splitStack(p_70298_2_); + + if (this.field_145985_p[p_70298_1_].stackSize == 0) { + this.field_145985_p[p_70298_1_] = null; + } + + this.onInventoryChanged(); + return var3; + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.field_145985_p[p_70304_1_] != null) { + ItemStack var2 = this.field_145985_p[p_70304_1_]; + this.field_145985_p[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.field_145985_p[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + + this.onInventoryChanged(); + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.field_145981_s : "container.chest"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.field_145981_s != null && this.field_145981_s.length() > 0; + } + + public void func_145976_a(String p_145976_1_) { + this.field_145981_s = p_145976_1_; + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList var2 = p_145839_1_.getTagList("Items", 10); + this.field_145985_p = new ItemStack[this.getSizeInventory()]; + + if (p_145839_1_.func_150297_b("CustomName", 8)) { + this.field_145981_s = p_145839_1_.getString("CustomName"); + } + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + int var5 = var4.getByte("Slot") & 255; + + if (var5 >= 0 && var5 < this.field_145985_p.length) { + this.field_145985_p[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.field_145985_p.length; ++var3) { + if (this.field_145985_p[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.field_145985_p[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + p_145841_1_.setTag("Items", var2); + + if (this.isInventoryNameLocalized()) { + p_145841_1_.setString("CustomName", this.field_145981_s); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) == this && p_70300_1_.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D, (double) this.field_145849_e + 0.5D) <= 64.0D; + } + + public void updateContainingBlockInfo() { + super.updateContainingBlockInfo(); + this.field_145984_a = false; + } + + private void func_145978_a(TileEntityChest p_145978_1_, int p_145978_2_) { + if (p_145978_1_.isInvalid()) { + this.field_145984_a = false; + } else if (this.field_145984_a) { + switch (p_145978_2_) { + case 0: + if (this.field_145988_l != p_145978_1_) { + this.field_145984_a = false; + } + + break; + + case 1: + if (this.field_145991_k != p_145978_1_) { + this.field_145984_a = false; + } + + break; + + case 2: + if (this.field_145992_i != p_145978_1_) { + this.field_145984_a = false; + } + + break; + + case 3: + if (this.field_145990_j != p_145978_1_) { + this.field_145984_a = false; + } + } + } + } + + public void func_145979_i() { + if (!this.field_145984_a) { + this.field_145984_a = true; + this.field_145992_i = null; + this.field_145990_j = null; + this.field_145991_k = null; + this.field_145988_l = null; + + if (this.func_145977_a(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e)) { + this.field_145991_k = (TileEntityChest)this.worldObj.getTileEntity(this.field_145851_c - 1, this.field_145848_d, this.field_145849_e); + } + + if (this.func_145977_a(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e)) { + this.field_145990_j = (TileEntityChest)this.worldObj.getTileEntity(this.field_145851_c + 1, this.field_145848_d, this.field_145849_e); + } + + if (this.func_145977_a(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1)) { + this.field_145992_i = (TileEntityChest)this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e - 1); + } + + if (this.func_145977_a(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1)) { + this.field_145988_l = (TileEntityChest)this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e + 1); + } + + if (this.field_145992_i != null) { + this.field_145992_i.func_145978_a(this, 0); + } + + if (this.field_145988_l != null) { + this.field_145988_l.func_145978_a(this, 2); + } + + if (this.field_145990_j != null) { + this.field_145990_j.func_145978_a(this, 1); + } + + if (this.field_145991_k != null) { + this.field_145991_k.func_145978_a(this, 3); + } + } + } + + private boolean func_145977_a(int p_145977_1_, int p_145977_2_, int p_145977_3_) { + if (this.worldObj == null) { + return false; + } else { + Block var4 = this.worldObj.getBlock(p_145977_1_, p_145977_2_, p_145977_3_); + return var4 instanceof BlockChest && ((BlockChest)var4).field_149956_a == this.func_145980_j(); + } + } + + public void updateEntity() { + super.updateEntity(); + this.func_145979_i(); + ++this.field_145983_q; + float var1; + + if (!this.worldObj.isClient && this.field_145987_o != 0 && (this.field_145983_q + this.field_145851_c + this.field_145848_d + this.field_145849_e) % 200 == 0) { + this.field_145987_o = 0; + var1 = 5.0F; + List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((float)this.field_145851_c - var1, (float)this.field_145848_d - var1, (float)this.field_145849_e - var1, (float)(this.field_145851_c + 1) + var1, (float)(this.field_145848_d + 1) + var1, (float)(this.field_145849_e + 1) + var1)); + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + EntityPlayer var4 = (EntityPlayer)var3.next(); + + if (var4.openContainer instanceof ContainerChest) { + IInventory var5 = ((ContainerChest)var4.openContainer).getLowerChestInventory(); + + if (var5 == this || var5 instanceof InventoryLargeChest && ((InventoryLargeChest)var5).isPartOfLargeChest(this)) { + ++this.field_145987_o; + } + } + } + } + + this.field_145986_n = this.field_145989_m; + var1 = 0.1F; + double var11; + + if (this.field_145987_o > 0 && this.field_145989_m == 0.0F && this.field_145992_i == null && this.field_145991_k == null) { + double var8 = (double)this.field_145851_c + 0.5D; + var11 = (double)this.field_145849_e + 0.5D; + + if (this.field_145988_l != null) { + var11 += 0.5D; + } + + if (this.field_145990_j != null) { + var8 += 0.5D; + } + + this.worldObj.playSoundEffect(var8, (double)this.field_145848_d + 0.5D, var11, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.field_145987_o == 0 && this.field_145989_m > 0.0F || this.field_145987_o > 0 && this.field_145989_m < 1.0F) { + float var9 = this.field_145989_m; + + if (this.field_145987_o > 0) { + this.field_145989_m += var1; + } else { + this.field_145989_m -= var1; + } + + if (this.field_145989_m > 1.0F) { + this.field_145989_m = 1.0F; + } + + float var10 = 0.5F; + + if (this.field_145989_m < var10 && var9 >= var10 && this.field_145992_i == null && this.field_145991_k == null) { + var11 = (double)this.field_145851_c + 0.5D; + double var6 = (double)this.field_145849_e + 0.5D; + + if (this.field_145988_l != null) { + var6 += 0.5D; + } + + if (this.field_145990_j != null) { + var11 += 0.5D; + } + + this.worldObj.playSoundEffect(var11, (double)this.field_145848_d + 0.5D, var6, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.field_145989_m < 0.0F) { + this.field_145989_m = 0.0F; + } + } + } + + public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) { + if (p_145842_1_ == 1) { + this.field_145987_o = p_145842_2_; + return true; + } else { + return super.receiveClientEvent(p_145842_1_, p_145842_2_); + } + } + + public void openInventory() { + if (this.field_145987_o < 0) { + this.field_145987_o = 0; + } + + ++this.field_145987_o; + this.worldObj.func_147452_c(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.getBlockType(), 1, this.field_145987_o); + this.worldObj.notifyBlocksOfNeighborChange(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.getBlockType()); + this.worldObj.notifyBlocksOfNeighborChange(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e, this.getBlockType()); + } + + public void closeInventory() { + if (this.getBlockType() instanceof BlockChest) { + --this.field_145987_o; + this.worldObj.func_147452_c(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.getBlockType(), 1, this.field_145987_o); + this.worldObj.notifyBlocksOfNeighborChange(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.getBlockType()); + this.worldObj.notifyBlocksOfNeighborChange(this.field_145851_c, this.field_145848_d - 1, this.field_145849_e, this.getBlockType()); + } + } + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } + + /** + * invalidates a tile entity + */ + public void invalidate() { + super.invalidate(); + this.updateContainingBlockInfo(); + this.func_145979_i(); + } + + public int func_145980_j() { + if (this.field_145982_r == -1) { + if (this.worldObj == null || !(this.getBlockType() instanceof BlockChest)) { + return 0; + } + + this.field_145982_r = ((BlockChest)this.getBlockType()).field_149956_a; + } + + return this.field_145982_r; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java new file mode 100644 index 0000000..d895e11 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java @@ -0,0 +1,60 @@ +package net.minecraft.tileentity; + +import io.netty.buffer.ByteBuf; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + +public class TileEntityCommandBlock extends TileEntity { + private final CommandBlockLogic field_145994_a = new CommandBlockLogic() { + + public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(TileEntityCommandBlock.this.field_145851_c, TileEntityCommandBlock.this.field_145848_d, TileEntityCommandBlock.this.field_145849_e); + } + public World getEntityWorld() { + return TileEntityCommandBlock.this.getWorldObj(); + } + public void func_145752_a(String p_145752_1_) { + super.func_145752_a(p_145752_1_); + TileEntityCommandBlock.this.onInventoryChanged(); + } + public void func_145756_e() { + TileEntityCommandBlock.this.getWorldObj().func_147471_g(TileEntityCommandBlock.this.field_145851_c, TileEntityCommandBlock.this.field_145848_d, TileEntityCommandBlock.this.field_145849_e); + } + public int func_145751_f() { + return 0; + } + public void func_145757_a(ByteBuf p_145757_1_) { + p_145757_1_.writeInt(TileEntityCommandBlock.this.field_145851_c); + p_145757_1_.writeInt(TileEntityCommandBlock.this.field_145848_d); + p_145757_1_.writeInt(TileEntityCommandBlock.this.field_145849_e); + } + }; + + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + this.field_145994_a.func_145758_a(p_145841_1_); + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_145994_a.func_145759_b(p_145839_1_); + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() { + NBTTagCompound var1 = new NBTTagCompound(); + this.writeToNBT(var1); + return new S35PacketUpdateTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e, 2, var1); + } + + public CommandBlockLogic func_145993_a() { + return this.field_145994_a; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityComparator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityComparator.java new file mode 100644 index 0000000..dfceb36 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityComparator.java @@ -0,0 +1,26 @@ +package net.minecraft.tileentity; + +import net.minecraft.nbt.NBTTagCompound; + +public class TileEntityComparator extends TileEntity { + private int field_145997_a; + + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setInteger("OutputSignal", this.field_145997_a); + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_145997_a = p_145839_1_.getInteger("OutputSignal"); + } + + public int func_145996_a() { + return this.field_145997_a; + } + + public void func_145995_a(int p_145995_1_) { + this.field_145997_a = p_145995_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java new file mode 100644 index 0000000..d3c39a9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java @@ -0,0 +1,17 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.BlockDaylightDetector; + +public class TileEntityDaylightDetector extends TileEntity { + + + public void updateEntity() { + if (this.worldObj != null && !this.worldObj.isClient && this.worldObj.getTotalWorldTime() % 20L == 0L) { + this.blockType = this.getBlockType(); + + if (this.blockType instanceof BlockDaylightDetector) { + ((BlockDaylightDetector)this.blockType).func_149957_e(this.worldObj, this.field_145851_c, this.field_145848_d, this.field_145849_e); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java new file mode 100644 index 0000000..2a7c914 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDispenser.java @@ -0,0 +1,190 @@ +package net.minecraft.tileentity; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class TileEntityDispenser extends TileEntity implements IInventory { + private ItemStack[] field_146022_i = new ItemStack[9]; + private final Random field_146021_j = new Random(); + protected String field_146020_a; + + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return 9; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return this.field_146022_i[p_70301_1_]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.field_146022_i[p_70298_1_] != null) { + ItemStack var3; + + if (this.field_146022_i[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.field_146022_i[p_70298_1_]; + this.field_146022_i[p_70298_1_] = null; + this.onInventoryChanged(); + return var3; + } else { + var3 = this.field_146022_i[p_70298_1_].splitStack(p_70298_2_); + + if (this.field_146022_i[p_70298_1_].stackSize == 0) { + this.field_146022_i[p_70298_1_] = null; + } + + this.onInventoryChanged(); + return var3; + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.field_146022_i[p_70304_1_] != null) { + ItemStack var2 = this.field_146022_i[p_70304_1_]; + this.field_146022_i[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + public int func_146017_i() { + int var1 = -1; + int var2 = 1; + + for (int var3 = 0; var3 < this.field_146022_i.length; ++var3) { + if (this.field_146022_i[var3] != null && this.field_146021_j.nextInt(var2++) == 0) { + var1 = var3; + } + } + + return var1; + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.field_146022_i[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + + this.onInventoryChanged(); + } + + public int func_146019_a(ItemStack p_146019_1_) { + for (int var2 = 0; var2 < this.field_146022_i.length; ++var2) { + if (this.field_146022_i[var2] == null || this.field_146022_i[var2].getItem() == null) { + this.setInventorySlotContents(var2, p_146019_1_); + return var2; + } + } + + return -1; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.field_146020_a : "container.dispenser"; + } + + public void func_146018_a(String p_146018_1_) { + this.field_146020_a = p_146018_1_; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.field_146020_a != null; + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList var2 = p_145839_1_.getTagList("Items", 10); + this.field_146022_i = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + int var5 = var4.getByte("Slot") & 255; + + if (var5 >= 0 && var5 < this.field_146022_i.length) { + this.field_146022_i[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + + if (p_145839_1_.func_150297_b("CustomName", 8)) { + this.field_146020_a = p_145839_1_.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.field_146022_i.length; ++var3) { + if (this.field_146022_i[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.field_146022_i[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + p_145841_1_.setTag("Items", var2); + + if (this.isInventoryNameLocalized()) { + p_145841_1_.setString("CustomName", this.field_146020_a); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) == this && p_70300_1_.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D, (double) this.field_145849_e + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDropper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDropper.java new file mode 100644 index 0000000..d89172e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityDropper.java @@ -0,0 +1,12 @@ +package net.minecraft.tileentity; + +public class TileEntityDropper extends TileEntityDispenser { + + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.field_146020_a : "container.dropper"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java new file mode 100644 index 0000000..93388ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java @@ -0,0 +1,126 @@ +package net.minecraft.tileentity; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public class TileEntityEnchantmentTable extends TileEntity { + public int field_145926_a; + public float field_145933_i; + public float field_145931_j; + public float field_145932_k; + public float field_145929_l; + public float field_145930_m; + public float field_145927_n; + public float field_145928_o; + public float field_145925_p; + public float field_145924_q; + private static final Random field_145923_r = new Random(); + private String field_145922_s; + + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + + if (this.func_145921_b()) { + p_145841_1_.setString("CustomName", this.field_145922_s); + } + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + + if (p_145839_1_.func_150297_b("CustomName", 8)) { + this.field_145922_s = p_145839_1_.getString("CustomName"); + } + } + + public void updateEntity() { + super.updateEntity(); + this.field_145927_n = this.field_145930_m; + this.field_145925_p = this.field_145928_o; + EntityPlayer var1 = this.worldObj.getClosestPlayer((float)this.field_145851_c + 0.5F, (float)this.field_145848_d + 0.5F, (float)this.field_145849_e + 0.5F, 3.0D); + + if (var1 != null) { + double var2 = var1.posX - (double)((float)this.field_145851_c + 0.5F); + double var4 = var1.posZ - (double)((float)this.field_145849_e + 0.5F); + this.field_145924_q = (float)Math.atan2(var4, var2); + this.field_145930_m += 0.1F; + + if (this.field_145930_m < 0.5F || field_145923_r.nextInt(40) == 0) { + float var6 = this.field_145932_k; + + do { + this.field_145932_k += (float)(field_145923_r.nextInt(4) - field_145923_r.nextInt(4)); + } + while (var6 == this.field_145932_k); + } + } else { + this.field_145924_q += 0.02F; + this.field_145930_m -= 0.1F; + } + + while (this.field_145928_o >= (float)Math.PI) { + this.field_145928_o -= ((float)Math.PI * 2F); + } + + while (this.field_145928_o < -(float)Math.PI) { + this.field_145928_o += ((float)Math.PI * 2F); + } + + while (this.field_145924_q >= (float)Math.PI) { + this.field_145924_q -= ((float)Math.PI * 2F); + } + + while (this.field_145924_q < -(float)Math.PI) { + this.field_145924_q += ((float)Math.PI * 2F); + } + + float var7; + + for (var7 = this.field_145924_q - this.field_145928_o; var7 >= (float)Math.PI; var7 -= ((float)Math.PI * 2F)) { + } + + while (var7 < -(float)Math.PI) { + var7 += ((float)Math.PI * 2F); + } + + this.field_145928_o += var7 * 0.4F; + + if (this.field_145930_m < 0.0F) { + this.field_145930_m = 0.0F; + } + + if (this.field_145930_m > 1.0F) { + this.field_145930_m = 1.0F; + } + + ++this.field_145926_a; + this.field_145931_j = this.field_145933_i; + float var3 = (this.field_145932_k - this.field_145933_i) * 0.4F; + float var8 = 0.2F; + + if (var3 < -var8) { + var3 = -var8; + } + + if (var3 > var8) { + var3 = var8; + } + + this.field_145929_l += (var3 - this.field_145929_l) * 0.9F; + this.field_145933_i += this.field_145929_l; + } + + public String func_145919_a() { + return this.func_145921_b() ? this.field_145922_s : "container.enchant"; + } + + public boolean func_145921_b() { + return this.field_145922_s != null && this.field_145922_s.length() > 0; + } + + public void func_145920_a(String p_145920_1_) { + this.field_145922_s = p_145920_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java new file mode 100644 index 0000000..d7e88e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEndPortal.java @@ -0,0 +1,5 @@ +package net.minecraft.tileentity; + +public class TileEntityEndPortal extends TileEntity { + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java new file mode 100644 index 0000000..091ad2f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityEnderChest.java @@ -0,0 +1,87 @@ +package net.minecraft.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; + +public class TileEntityEnderChest extends TileEntity { + public float field_145972_a; + public float field_145975_i; + public int field_145973_j; + private int field_145974_k; + + + public void updateEntity() { + super.updateEntity(); + + if (++this.field_145974_k % 20 * 4 == 0) { + this.worldObj.func_147452_c(this.field_145851_c, this.field_145848_d, this.field_145849_e, Blocks.ender_chest, 1, this.field_145973_j); + } + + this.field_145975_i = this.field_145972_a; + float var1 = 0.1F; + double var4; + + if (this.field_145973_j > 0 && this.field_145972_a == 0.0F) { + double var2 = (double)this.field_145851_c + 0.5D; + var4 = (double)this.field_145849_e + 0.5D; + this.worldObj.playSoundEffect(var2, (double)this.field_145848_d + 0.5D, var4, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.field_145973_j == 0 && this.field_145972_a > 0.0F || this.field_145973_j > 0 && this.field_145972_a < 1.0F) { + float var8 = this.field_145972_a; + + if (this.field_145973_j > 0) { + this.field_145972_a += var1; + } else { + this.field_145972_a -= var1; + } + + if (this.field_145972_a > 1.0F) { + this.field_145972_a = 1.0F; + } + + float var3 = 0.5F; + + if (this.field_145972_a < var3 && var8 >= var3) { + var4 = (double)this.field_145851_c + 0.5D; + double var6 = (double)this.field_145849_e + 0.5D; + this.worldObj.playSoundEffect(var4, (double)this.field_145848_d + 0.5D, var6, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.field_145972_a < 0.0F) { + this.field_145972_a = 0.0F; + } + } + } + + public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) { + if (p_145842_1_ == 1) { + this.field_145973_j = p_145842_2_; + return true; + } else { + return super.receiveClientEvent(p_145842_1_, p_145842_2_); + } + } + + /** + * invalidates a tile entity + */ + public void invalidate() { + this.updateContainingBlockInfo(); + super.invalidate(); + } + + public void func_145969_a() { + ++this.field_145973_j; + this.worldObj.func_147452_c(this.field_145851_c, this.field_145848_d, this.field_145849_e, Blocks.ender_chest, 1, this.field_145973_j); + } + + public void func_145970_b() { + --this.field_145973_j; + this.worldObj.func_147452_c(this.field_145851_c, this.field_145848_d, this.field_145849_e, Blocks.ender_chest, 1, this.field_145973_j); + } + + public boolean func_145971_a(EntityPlayer p_145971_1_) { + return this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) == this && p_145971_1_.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D, (double) this.field_145849_e + 0.5D) <= 64.0D; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java new file mode 100644 index 0000000..055bce4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityFlowerPot.java @@ -0,0 +1,53 @@ +package net.minecraft.tileentity; + +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; + +public class TileEntityFlowerPot extends TileEntity { + private Item field_145967_a; + private int field_145968_i; + + + public TileEntityFlowerPot() {} + + public TileEntityFlowerPot(Item p_i45442_1_, int p_i45442_2_) { + this.field_145967_a = p_i45442_1_; + this.field_145968_i = p_i45442_2_; + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setInteger("Item", Item.getIdFromItem(this.field_145967_a)); + p_145841_1_.setInteger("Data", this.field_145968_i); + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_145967_a = Item.getItemById(p_145839_1_.getInteger("Item")); + this.field_145968_i = p_145839_1_.getInteger("Data"); + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() { + NBTTagCompound var1 = new NBTTagCompound(); + this.writeToNBT(var1); + return new S35PacketUpdateTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e, 5, var1); + } + + public void func_145964_a(Item p_145964_1_, int p_145964_2_) { + this.field_145967_a = p_145964_1_; + this.field_145968_i = p_145964_2_; + } + + public Item func_145965_a() { + return this.field_145967_a; + } + + public int func_145966_b() { + return this.field_145968_i; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java new file mode 100644 index 0000000..f8117b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java @@ -0,0 +1,331 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.item.ItemTool; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class TileEntityFurnace extends TileEntity implements ISidedInventory { + private static final int[] field_145962_k = new int[] {0}; + private static final int[] field_145959_l = new int[] {2, 1}; + private static final int[] field_145960_m = new int[] {1}; + private ItemStack[] field_145957_n = new ItemStack[3]; + public int field_145956_a; + public int field_145963_i; + public int field_145961_j; + private String field_145958_o; + + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.field_145957_n.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return this.field_145957_n[p_70301_1_]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.field_145957_n[p_70298_1_] != null) { + ItemStack var3; + + if (this.field_145957_n[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.field_145957_n[p_70298_1_]; + this.field_145957_n[p_70298_1_] = null; + return var3; + } else { + var3 = this.field_145957_n[p_70298_1_].splitStack(p_70298_2_); + + if (this.field_145957_n[p_70298_1_].stackSize == 0) { + this.field_145957_n[p_70298_1_] = null; + } + + return var3; + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.field_145957_n[p_70304_1_] != null) { + ItemStack var2 = this.field_145957_n[p_70304_1_]; + this.field_145957_n[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.field_145957_n[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.field_145958_o : "container.furnace"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.field_145958_o != null && this.field_145958_o.length() > 0; + } + + public void func_145951_a(String p_145951_1_) { + this.field_145958_o = p_145951_1_; + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList var2 = p_145839_1_.getTagList("Items", 10); + this.field_145957_n = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + byte var5 = var4.getByte("Slot"); + + if (var5 >= 0 && var5 < this.field_145957_n.length) { + this.field_145957_n[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + + this.field_145956_a = p_145839_1_.getShort("BurnTime"); + this.field_145961_j = p_145839_1_.getShort("CookTime"); + this.field_145963_i = func_145952_a(this.field_145957_n[1]); + + if (p_145839_1_.func_150297_b("CustomName", 8)) { + this.field_145958_o = p_145839_1_.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setShort("BurnTime", (short)this.field_145956_a); + p_145841_1_.setShort("CookTime", (short)this.field_145961_j); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.field_145957_n.length; ++var3) { + if (this.field_145957_n[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.field_145957_n[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + p_145841_1_.setTag("Items", var2); + + if (this.isInventoryNameLocalized()) { + p_145841_1_.setString("CustomName", this.field_145958_o); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + public int func_145953_d(int p_145953_1_) { + return this.field_145961_j * p_145953_1_ / 200; + } + + public int func_145955_e(int p_145955_1_) { + if (this.field_145963_i == 0) { + this.field_145963_i = 200; + } + + return this.field_145956_a * p_145955_1_ / this.field_145963_i; + } + + public boolean func_145950_i() { + return this.field_145956_a > 0; + } + + public void updateEntity() { + boolean var1 = this.field_145956_a > 0; + boolean var2 = false; + + if (this.field_145956_a > 0) { + --this.field_145956_a; + } + + if (!this.worldObj.isClient) { + if (this.field_145956_a != 0 || this.field_145957_n[1] != null && this.field_145957_n[0] != null) { + if (this.field_145956_a == 0 && this.func_145948_k()) { + this.field_145963_i = this.field_145956_a = func_145952_a(this.field_145957_n[1]); + + if (this.field_145956_a > 0) { + var2 = true; + + if (this.field_145957_n[1] != null) { + --this.field_145957_n[1].stackSize; + + if (this.field_145957_n[1].stackSize == 0) { + Item var3 = this.field_145957_n[1].getItem().getContainerItem(); + this.field_145957_n[1] = var3 != null ? new ItemStack(var3) : null; + } + } + } + } + + if (this.func_145950_i() && this.func_145948_k()) { + ++this.field_145961_j; + + if (this.field_145961_j == 200) { + this.field_145961_j = 0; + this.func_145949_j(); + var2 = true; + } + } else { + this.field_145961_j = 0; + } + } + + if (var1 != this.field_145956_a > 0) { + var2 = true; + BlockFurnace.func_149931_a(this.field_145956_a > 0, this.worldObj, this.field_145851_c, this.field_145848_d, this.field_145849_e); + } + } + + if (var2) { + this.onInventoryChanged(); + } + } + + private boolean func_145948_k() { + if (this.field_145957_n[0] == null) { + return false; + } else { + ItemStack var1 = FurnaceRecipes.smelting().func_151395_a(this.field_145957_n[0]); + return var1 != null && (this.field_145957_n[2] == null || (this.field_145957_n[2].isItemEqual(var1) && (this.field_145957_n[2].stackSize < this.getInventoryStackLimit() && this.field_145957_n[2].stackSize < this.field_145957_n[2].getMaxStackSize() || this.field_145957_n[2].stackSize < var1.getMaxStackSize()))); + } + } + + public void func_145949_j() { + if (this.func_145948_k()) { + ItemStack var1 = FurnaceRecipes.smelting().func_151395_a(this.field_145957_n[0]); + + if (this.field_145957_n[2] == null) { + this.field_145957_n[2] = var1.copy(); + } else if (this.field_145957_n[2].getItem() == var1.getItem()) { + ++this.field_145957_n[2].stackSize; + } + + --this.field_145957_n[0].stackSize; + + if (this.field_145957_n[0].stackSize <= 0) { + this.field_145957_n[0] = null; + } + } + } + + public static int func_145952_a(ItemStack p_145952_0_) { + if (p_145952_0_ == null) { + return 0; + } else { + Item var1 = p_145952_0_.getItem(); + + if (var1 instanceof ItemBlock && Block.getBlockFromItem(var1) != Blocks.air) { + Block var2 = Block.getBlockFromItem(var1); + + if (var2 == Blocks.wooden_slab) { + return 150; + } + + if (var2.getMaterial() == Material.wood) { + return 300; + } + + if (var2 == Blocks.coal_block) { + return 16000; + } + } + + return var1 instanceof ItemTool && ((ItemTool)var1).getToolMaterialName().equals("WOOD") ? 200 : (var1 instanceof ItemSword && ((ItemSword)var1).func_150932_j().equals("WOOD") ? 200 : (var1 instanceof ItemHoe && ((ItemHoe)var1).getMaterialName().equals("WOOD") ? 200 : (var1 == Items.stick ? 100 : (var1 == Items.coal ? 1600 : (var1 == Items.lava_bucket ? 20000 : (var1 == Item.getItemFromBlock(Blocks.sapling) ? 100 : (var1 == Items.blaze_rod ? 2400 : 0))))))); + } + } + + public static boolean func_145954_b(ItemStack p_145954_0_) { + return func_145952_a(p_145954_0_) > 0; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) == this && p_70300_1_.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D, (double) this.field_145849_e + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return p_94041_1_ != 2 && (p_94041_1_ != 1 || func_145954_b(p_94041_2_)); + } + + /** + * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this + * block. + */ + public int[] getAccessibleSlotsFromSide(int p_94128_1_) { + return p_94128_1_ == 0 ? field_145959_l : (p_94128_1_ == 1 ? field_145962_k : field_145960_m); + } + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { + return this.isItemValidForSlot(p_102007_1_, p_102007_2_); + } + + /** + * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { + return p_102008_3_ != 0 || p_102008_1_ != 1 || p_102008_2_.getItem() == Items.bucket; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityHopper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityHopper.java new file mode 100644 index 0000000..06ff977 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityHopper.java @@ -0,0 +1,546 @@ +package net.minecraft.tileentity; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockHopper; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class TileEntityHopper extends TileEntity implements IHopper { + private ItemStack[] field_145900_a = new ItemStack[5]; + private String field_145902_i; + private int field_145901_j = -1; + + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList var2 = p_145839_1_.getTagList("Items", 10); + this.field_145900_a = new ItemStack[this.getSizeInventory()]; + + if (p_145839_1_.func_150297_b("CustomName", 8)) { + this.field_145902_i = p_145839_1_.getString("CustomName"); + } + + this.field_145901_j = p_145839_1_.getInteger("TransferCooldown"); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + byte var5 = var4.getByte("Slot"); + + if (var5 >= 0 && var5 < this.field_145900_a.length) { + this.field_145900_a[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.field_145900_a.length; ++var3) { + if (this.field_145900_a[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.field_145900_a[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + p_145841_1_.setTag("Items", var2); + p_145841_1_.setInteger("TransferCooldown", this.field_145901_j); + + if (this.isInventoryNameLocalized()) { + p_145841_1_.setString("CustomName", this.field_145902_i); + } + } + + /** + * Called when an the contents of an Inventory change, usually + */ + public void onInventoryChanged() { + super.onInventoryChanged(); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() { + return this.field_145900_a.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int p_70301_1_) { + return this.field_145900_a[p_70301_1_]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { + if (this.field_145900_a[p_70298_1_] != null) { + ItemStack var3; + + if (this.field_145900_a[p_70298_1_].stackSize <= p_70298_2_) { + var3 = this.field_145900_a[p_70298_1_]; + this.field_145900_a[p_70298_1_] = null; + return var3; + } else { + var3 = this.field_145900_a[p_70298_1_].splitStack(p_70298_2_); + + if (this.field_145900_a[p_70298_1_].stackSize == 0) { + this.field_145900_a[p_70298_1_] = null; + } + + return var3; + } + } else { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int p_70304_1_) { + if (this.field_145900_a[p_70304_1_] != null) { + ItemStack var2 = this.field_145900_a[p_70304_1_]; + this.field_145900_a[p_70304_1_] = null; + return var2; + } else { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { + this.field_145900_a[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() { + return this.isInventoryNameLocalized() ? this.field_145902_i : "container.hopper"; + } + + /** + * Returns if the inventory name is localized + */ + public boolean isInventoryNameLocalized() { + return this.field_145902_i != null && this.field_145902_i.length() > 0; + } + + public void func_145886_a(String p_145886_1_) { + this.field_145902_i = p_145886_1_; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return this.worldObj.getTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) == this && p_70300_1_.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D, (double) this.field_145849_e + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } + + public void updateEntity() { + if (this.worldObj != null && !this.worldObj.isClient) { + --this.field_145901_j; + + if (!this.func_145888_j()) { + this.func_145896_c(0); + this.func_145887_i(); + } + } + } + + public boolean func_145887_i() { + if (this.worldObj != null && !this.worldObj.isClient) { + if (!this.func_145888_j() && BlockHopper.func_149917_c(this.getBlockMetadata())) { + boolean var1 = false; + + if (!this.func_152104_k()) { + var1 = this.func_145883_k(); + } + + if (!this.func_152105_l()) { + var1 = func_145891_a(this) || var1; + } + + if (var1) { + this.func_145896_c(8); + this.onInventoryChanged(); + return true; + } + } + + return false; + } else { + return false; + } + } + + private boolean func_152104_k() { + ItemStack[] var1 = this.field_145900_a; + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + ItemStack var4 = var1[var3]; + + if (var4 != null) { + return false; + } + } + + return true; + } + + private boolean func_152105_l() { + ItemStack[] var1 = this.field_145900_a; + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + ItemStack var4 = var1[var3]; + + if (var4 == null || var4.stackSize != var4.getMaxStackSize()) { + return false; + } + } + + return true; + } + + private boolean func_145883_k() { + IInventory var1 = this.func_145895_l(); + + if (var1 == null) { + return false; + } else { + int var2 = Facing.oppositeSide[BlockHopper.func_149918_b(this.getBlockMetadata())]; + + if (this.func_152102_a(var1, var2)) { + return false; + } else { + for (int var3 = 0; var3 < this.getSizeInventory(); ++var3) { + if (this.getStackInSlot(var3) != null) { + ItemStack var4 = this.getStackInSlot(var3).copy(); + ItemStack var5 = func_145889_a(var1, this.decrStackSize(var3, 1), var2); + + if (var5 == null || var5.stackSize == 0) { + var1.onInventoryChanged(); + return true; + } + + this.setInventorySlotContents(var3, var4); + } + } + + return false; + } + } + } + + private boolean func_152102_a(IInventory p_152102_1_, int p_152102_2_) { + if (p_152102_1_ instanceof ISidedInventory && p_152102_2_ > -1) { + ISidedInventory var7 = (ISidedInventory)p_152102_1_; + int[] var8 = var7.getAccessibleSlotsFromSide(p_152102_2_); + + for (int var9 = 0; var9 < var8.length; ++var9) { + ItemStack var6 = var7.getStackInSlot(var8[var9]); + + if (var6 == null || var6.stackSize != var6.getMaxStackSize()) { + return false; + } + } + } else { + int var3 = p_152102_1_.getSizeInventory(); + + for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = p_152102_1_.getStackInSlot(var4); + + if (var5 == null || var5.stackSize != var5.getMaxStackSize()) { + return false; + } + } + } + + return true; + } + + private static boolean func_152103_b(IInventory p_152103_0_, int p_152103_1_) { + if (p_152103_0_ instanceof ISidedInventory && p_152103_1_ > -1) { + ISidedInventory var5 = (ISidedInventory)p_152103_0_; + int[] var6 = var5.getAccessibleSlotsFromSide(p_152103_1_); + + for (int var4 = 0; var4 < var6.length; ++var4) { + if (var5.getStackInSlot(var6[var4]) != null) { + return false; + } + } + } else { + int var2 = p_152103_0_.getSizeInventory(); + + for (int var3 = 0; var3 < var2; ++var3) { + if (p_152103_0_.getStackInSlot(var3) != null) { + return false; + } + } + } + + return true; + } + + public static boolean func_145891_a(IHopper p_145891_0_) { + IInventory var1 = func_145884_b(p_145891_0_); + + if (var1 != null) { + byte var2 = 0; + + if (func_152103_b(var1, var2)) { + return false; + } + + if (var1 instanceof ISidedInventory && var2 > -1) { + ISidedInventory var7 = (ISidedInventory)var1; + int[] var8 = var7.getAccessibleSlotsFromSide(var2); + + for (int var5 = 0; var5 < var8.length; ++var5) { + if (func_145892_a(p_145891_0_, var1, var8[var5], var2)) { + return true; + } + } + } else { + int var3 = var1.getSizeInventory(); + + for (int var4 = 0; var4 < var3; ++var4) { + if (func_145892_a(p_145891_0_, var1, var4, var2)) { + return true; + } + } + } + } else { + EntityItem var6 = func_145897_a(p_145891_0_.getWorldObj(), p_145891_0_.getXPos(), p_145891_0_.getYPos() + 1.0D, p_145891_0_.getZPos()); + + if (var6 != null) { + return func_145898_a(p_145891_0_, var6); + } + } + + return false; + } + + private static boolean func_145892_a(IHopper p_145892_0_, IInventory p_145892_1_, int p_145892_2_, int p_145892_3_) { + ItemStack var4 = p_145892_1_.getStackInSlot(p_145892_2_); + + if (var4 != null && func_145890_b(p_145892_1_, var4, p_145892_2_, p_145892_3_)) { + ItemStack var5 = var4.copy(); + ItemStack var6 = func_145889_a(p_145892_0_, p_145892_1_.decrStackSize(p_145892_2_, 1), -1); + + if (var6 == null || var6.stackSize == 0) { + p_145892_1_.onInventoryChanged(); + return true; + } + + p_145892_1_.setInventorySlotContents(p_145892_2_, var5); + } + + return false; + } + + public static boolean func_145898_a(IInventory p_145898_0_, EntityItem p_145898_1_) { + boolean var2 = false; + + if (p_145898_1_ == null) { + return false; + } else { + ItemStack var3 = p_145898_1_.getEntityItem().copy(); + ItemStack var4 = func_145889_a(p_145898_0_, var3, -1); + + if (var4 != null && var4.stackSize != 0) { + p_145898_1_.setEntityItemStack(var4); + } else { + var2 = true; + p_145898_1_.setDead(); + } + + return var2; + } + } + + public static ItemStack func_145889_a(IInventory p_145889_0_, ItemStack p_145889_1_, int p_145889_2_) { + if (p_145889_0_ instanceof ISidedInventory && p_145889_2_ > -1) { + ISidedInventory var6 = (ISidedInventory)p_145889_0_; + int[] var7 = var6.getAccessibleSlotsFromSide(p_145889_2_); + + for (int var5 = 0; var5 < var7.length && p_145889_1_ != null && p_145889_1_.stackSize > 0; ++var5) { + p_145889_1_ = func_145899_c(p_145889_0_, p_145889_1_, var7[var5], p_145889_2_); + } + } else { + int var3 = p_145889_0_.getSizeInventory(); + + for (int var4 = 0; var4 < var3 && p_145889_1_ != null && p_145889_1_.stackSize > 0; ++var4) { + p_145889_1_ = func_145899_c(p_145889_0_, p_145889_1_, var4, p_145889_2_); + } + } + + if (p_145889_1_ != null && p_145889_1_.stackSize == 0) { + p_145889_1_ = null; + } + + return p_145889_1_; + } + + private static boolean func_145885_a(IInventory p_145885_0_, ItemStack p_145885_1_, int p_145885_2_, int p_145885_3_) { + return p_145885_0_.isItemValidForSlot(p_145885_2_, p_145885_1_) && (!(p_145885_0_ instanceof ISidedInventory) || ((ISidedInventory) p_145885_0_).canInsertItem(p_145885_2_, p_145885_1_, p_145885_3_)); + } + + private static boolean func_145890_b(IInventory p_145890_0_, ItemStack p_145890_1_, int p_145890_2_, int p_145890_3_) { + return !(p_145890_0_ instanceof ISidedInventory) || ((ISidedInventory)p_145890_0_).canExtractItem(p_145890_2_, p_145890_1_, p_145890_3_); + } + + private static ItemStack func_145899_c(IInventory p_145899_0_, ItemStack p_145899_1_, int p_145899_2_, int p_145899_3_) { + ItemStack var4 = p_145899_0_.getStackInSlot(p_145899_2_); + + if (func_145885_a(p_145899_0_, p_145899_1_, p_145899_2_, p_145899_3_)) { + boolean var5 = false; + + if (var4 == null) { + p_145899_0_.setInventorySlotContents(p_145899_2_, p_145899_1_); + p_145899_1_ = null; + var5 = true; + } else if (func_145894_a(var4, p_145899_1_)) { + int var6 = p_145899_1_.getMaxStackSize() - var4.stackSize; + int var7 = Math.min(p_145899_1_.stackSize, var6); + p_145899_1_.stackSize -= var7; + var4.stackSize += var7; + var5 = var7 > 0; + } + + if (var5) { + if (p_145899_0_ instanceof TileEntityHopper) { + ((TileEntityHopper)p_145899_0_).func_145896_c(8); + p_145899_0_.onInventoryChanged(); + } + + p_145899_0_.onInventoryChanged(); + } + } + + return p_145899_1_; + } + + private IInventory func_145895_l() { + int var1 = BlockHopper.func_149918_b(this.getBlockMetadata()); + return func_145893_b(this.getWorldObj(), this.field_145851_c + Facing.offsetsXForSide[var1], this.field_145848_d + Facing.offsetsYForSide[var1], this.field_145849_e + Facing.offsetsZForSide[var1]); + } + + public static IInventory func_145884_b(IHopper p_145884_0_) { + return func_145893_b(p_145884_0_.getWorldObj(), p_145884_0_.getXPos(), p_145884_0_.getYPos() + 1.0D, p_145884_0_.getZPos()); + } + + public static EntityItem func_145897_a(World p_145897_0_, double p_145897_1_, double p_145897_3_, double p_145897_5_) { + List var7 = p_145897_0_.selectEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(p_145897_1_, p_145897_3_, p_145897_5_, p_145897_1_ + 1.0D, p_145897_3_ + 1.0D, p_145897_5_ + 1.0D), IEntitySelector.selectAnything); + return var7.size() > 0 ? (EntityItem)var7.get(0) : null; + } + + public static IInventory func_145893_b(World p_145893_0_, double p_145893_1_, double p_145893_3_, double p_145893_5_) { + IInventory var7 = null; + int var8 = MathHelper.floor_double(p_145893_1_); + int var9 = MathHelper.floor_double(p_145893_3_); + int var10 = MathHelper.floor_double(p_145893_5_); + TileEntity var11 = p_145893_0_.getTileEntity(var8, var9, var10); + + if (var11 != null && var11 instanceof IInventory) { + var7 = (IInventory)var11; + + if (var7 instanceof TileEntityChest) { + Block var12 = p_145893_0_.getBlock(var8, var9, var10); + + if (var12 instanceof BlockChest) { + var7 = ((BlockChest)var12).func_149951_m(p_145893_0_, var8, var9, var10); + } + } + } + + if (var7 == null) { + List var13 = p_145893_0_.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(p_145893_1_, p_145893_3_, p_145893_5_, p_145893_1_ + 1.0D, p_145893_3_ + 1.0D, p_145893_5_ + 1.0D), IEntitySelector.selectInventories); + + if (var13 != null && var13.size() > 0) { + var7 = (IInventory)var13.get(p_145893_0_.rand.nextInt(var13.size())); + } + } + + return var7; + } + + private static boolean func_145894_a(ItemStack p_145894_0_, ItemStack p_145894_1_) { + return p_145894_0_.getItem() == p_145894_1_.getItem() && (p_145894_0_.getItemDamage() == p_145894_1_.getItemDamage() && (p_145894_0_.stackSize <= p_145894_0_.getMaxStackSize() && ItemStack.areItemStackTagsEqual(p_145894_0_, p_145894_1_))); + } + + /** + * Gets the world X position for this hopper entity. + */ + public double getXPos() { + return this.field_145851_c; + } + + /** + * Gets the world Y position for this hopper entity. + */ + public double getYPos() { + return this.field_145848_d; + } + + /** + * Gets the world Z position for this hopper entity. + */ + public double getZPos() { + return this.field_145849_e; + } + + public void func_145896_c(int p_145896_1_) { + this.field_145901_j = p_145896_1_; + } + + public boolean func_145888_j() { + return this.field_145901_j > 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java new file mode 100644 index 0000000..b929960 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityMobSpawner.java @@ -0,0 +1,69 @@ +package net.minecraft.tileentity; + +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.world.World; + +public class TileEntityMobSpawner extends TileEntity { + private final MobSpawnerBaseLogic field_145882_a = new MobSpawnerBaseLogic() { + + public void func_98267_a(int p_98267_1_) { + TileEntityMobSpawner.this.worldObj.func_147452_c(TileEntityMobSpawner.this.field_145851_c, TileEntityMobSpawner.this.field_145848_d, TileEntityMobSpawner.this.field_145849_e, Blocks.mob_spawner, p_98267_1_, 0); + } + public World getSpawnerWorld() { + return TileEntityMobSpawner.this.worldObj; + } + public int getSpawnerX() { + return TileEntityMobSpawner.this.field_145851_c; + } + public int getSpawnerY() { + return TileEntityMobSpawner.this.field_145848_d; + } + public int getSpawnerZ() { + return TileEntityMobSpawner.this.field_145849_e; + } + public void setRandomMinecart(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) { + super.setRandomMinecart(p_98277_1_); + + if (this.getSpawnerWorld() != null) { + this.getSpawnerWorld().func_147471_g(TileEntityMobSpawner.this.field_145851_c, TileEntityMobSpawner.this.field_145848_d, TileEntityMobSpawner.this.field_145849_e); + } + } + }; + + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_145882_a.readFromNBT(p_145839_1_); + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + this.field_145882_a.writeToNBT(p_145841_1_); + } + + public void updateEntity() { + this.field_145882_a.updateSpawner(); + super.updateEntity(); + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() { + NBTTagCompound var1 = new NBTTagCompound(); + this.writeToNBT(var1); + var1.removeTag("SpawnPotentials"); + return new S35PacketUpdateTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e, 1, var1); + } + + public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) { + return this.field_145882_a.setDelayToMin(p_145842_1_) || super.receiveClientEvent(p_145842_1_, p_145842_2_); + } + + public MobSpawnerBaseLogic func_145881_a() { + return this.field_145882_a; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityNote.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityNote.java new file mode 100644 index 0000000..a05da30 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityNote.java @@ -0,0 +1,60 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class TileEntityNote extends TileEntity { + public byte field_145879_a; + public boolean field_145880_i; + + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setByte("note", this.field_145879_a); + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_145879_a = p_145839_1_.getByte("note"); + + if (this.field_145879_a < 0) { + this.field_145879_a = 0; + } + + if (this.field_145879_a > 24) { + this.field_145879_a = 24; + } + } + + public void func_145877_a() { + this.field_145879_a = (byte)((this.field_145879_a + 1) % 25); + this.onInventoryChanged(); + } + + public void func_145878_a(World p_145878_1_, int p_145878_2_, int p_145878_3_, int p_145878_4_) { + if (p_145878_1_.getBlock(p_145878_2_, p_145878_3_ + 1, p_145878_4_).getMaterial() == Material.air) { + Material var5 = p_145878_1_.getBlock(p_145878_2_, p_145878_3_ - 1, p_145878_4_).getMaterial(); + byte var6 = 0; + + if (var5 == Material.rock) { + var6 = 1; + } + + if (var5 == Material.sand) { + var6 = 2; + } + + if (var5 == Material.glass) { + var6 = 3; + } + + if (var5 == Material.wood) { + var6 = 4; + } + + p_145878_1_.func_147452_c(p_145878_2_, p_145878_3_, p_145878_4_, Blocks.noteblock, var6, this.field_145879_a); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityPiston.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityPiston.java new file mode 100644 index 0000000..0d6aa66 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntityPiston.java @@ -0,0 +1,155 @@ +package net.minecraft.tileentity; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; + +public class TileEntityPiston extends TileEntity { + private Block field_145869_a; + private int field_145876_i; + private int field_145874_j; + private boolean field_145875_k; + private boolean field_145872_l; + private float field_145873_m; + private float field_145870_n; + private final List field_145871_o = new ArrayList(); + + + public TileEntityPiston() {} + + public TileEntityPiston(Block p_i45444_1_, int p_i45444_2_, int p_i45444_3_, boolean p_i45444_4_, boolean p_i45444_5_) { + this.field_145869_a = p_i45444_1_; + this.field_145876_i = p_i45444_2_; + this.field_145874_j = p_i45444_3_; + this.field_145875_k = p_i45444_4_; + this.field_145872_l = p_i45444_5_; + } + + public Block func_145861_a() { + return this.field_145869_a; + } + + public int getBlockMetadata() { + return this.field_145876_i; + } + + public boolean func_145868_b() { + return this.field_145875_k; + } + + public int func_145864_c() { + return this.field_145874_j; + } + + public boolean func_145867_d() { + return this.field_145872_l; + } + + public float func_145860_a(float p_145860_1_) { + if (p_145860_1_ > 1.0F) { + p_145860_1_ = 1.0F; + } + + return this.field_145870_n + (this.field_145873_m - this.field_145870_n) * p_145860_1_; + } + + public float func_145865_b(float p_145865_1_) { + return this.field_145875_k ? (this.func_145860_a(p_145865_1_) - 1.0F) * (float)Facing.offsetsXForSide[this.field_145874_j] : (1.0F - this.func_145860_a(p_145865_1_)) * (float)Facing.offsetsXForSide[this.field_145874_j]; + } + + public float func_145862_c(float p_145862_1_) { + return this.field_145875_k ? (this.func_145860_a(p_145862_1_) - 1.0F) * (float)Facing.offsetsYForSide[this.field_145874_j] : (1.0F - this.func_145860_a(p_145862_1_)) * (float)Facing.offsetsYForSide[this.field_145874_j]; + } + + public float func_145859_d(float p_145859_1_) { + return this.field_145875_k ? (this.func_145860_a(p_145859_1_) - 1.0F) * (float)Facing.offsetsZForSide[this.field_145874_j] : (1.0F - this.func_145860_a(p_145859_1_)) * (float)Facing.offsetsZForSide[this.field_145874_j]; + } + + private void func_145863_a(float p_145863_1_, float p_145863_2_) { + if (this.field_145875_k) { + p_145863_1_ = 1.0F - p_145863_1_; + } else { + --p_145863_1_; + } + + AxisAlignedBB var3 = Blocks.piston_extension.func_149964_a(this.worldObj, this.field_145851_c, this.field_145848_d, this.field_145849_e, this.field_145869_a, p_145863_1_, this.field_145874_j); + + if (var3 != null) { + List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, var3); + + if (!var4.isEmpty()) { + this.field_145871_o.addAll(var4); + Iterator var5 = this.field_145871_o.iterator(); + + while (var5.hasNext()) { + Entity var6 = (Entity)var5.next(); + var6.moveEntity(p_145863_2_ * (float)Facing.offsetsXForSide[this.field_145874_j], p_145863_2_ * (float)Facing.offsetsYForSide[this.field_145874_j], p_145863_2_ * (float)Facing.offsetsZForSide[this.field_145874_j]); + } + + this.field_145871_o.clear(); + } + } + } + + public void func_145866_f() { + if (this.field_145870_n < 1.0F && this.worldObj != null) { + this.field_145870_n = this.field_145873_m = 1.0F; + this.worldObj.removeTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e); + this.invalidate(); + + if (this.worldObj.getBlock(this.field_145851_c, this.field_145848_d, this.field_145849_e) == Blocks.piston_extension) { + this.worldObj.setBlock(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.field_145869_a, this.field_145876_i, 3); + this.worldObj.func_147460_e(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.field_145869_a); + } + } + } + + public void updateEntity() { + this.field_145870_n = this.field_145873_m; + + if (this.field_145870_n >= 1.0F) { + this.func_145863_a(1.0F, 0.25F); + this.worldObj.removeTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e); + this.invalidate(); + + if (this.worldObj.getBlock(this.field_145851_c, this.field_145848_d, this.field_145849_e) == Blocks.piston_extension) { + this.worldObj.setBlock(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.field_145869_a, this.field_145876_i, 3); + this.worldObj.func_147460_e(this.field_145851_c, this.field_145848_d, this.field_145849_e, this.field_145869_a); + } + } else { + this.field_145873_m += 0.5F; + + if (this.field_145873_m >= 1.0F) { + this.field_145873_m = 1.0F; + } + + if (this.field_145875_k) { + this.func_145863_a(this.field_145873_m, this.field_145873_m - this.field_145870_n + 0.0625F); + } + } + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_145869_a = Block.getBlockById(p_145839_1_.getInteger("blockId")); + this.field_145876_i = p_145839_1_.getInteger("blockData"); + this.field_145874_j = p_145839_1_.getInteger("facing"); + this.field_145870_n = this.field_145873_m = p_145839_1_.getFloat("progress"); + this.field_145875_k = p_145839_1_.getBoolean("extending"); + } + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setInteger("blockId", Block.getIdFromBlock(this.field_145869_a)); + p_145841_1_.setInteger("blockData", this.field_145876_i); + p_145841_1_.setInteger("facing", this.field_145874_j); + p_145841_1_.setFloat("progress", this.field_145870_n); + p_145841_1_.setBoolean("extending", this.field_145875_k); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntitySign.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntitySign.java new file mode 100644 index 0000000..ccef111 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntitySign.java @@ -0,0 +1,64 @@ +package net.minecraft.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S33PacketUpdateSign; + +public class TileEntitySign extends TileEntity { + public String[] field_145915_a = new String[] {"", "", "", ""}; + public int field_145918_i = -1; + private boolean field_145916_j = true; + private EntityPlayer field_145917_k; + + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setString("Text1", this.field_145915_a[0]); + p_145841_1_.setString("Text2", this.field_145915_a[1]); + p_145841_1_.setString("Text3", this.field_145915_a[2]); + p_145841_1_.setString("Text4", this.field_145915_a[3]); + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + this.field_145916_j = false; + super.readFromNBT(p_145839_1_); + + for (int var2 = 0; var2 < 4; ++var2) { + this.field_145915_a[var2] = p_145839_1_.getString("Text" + (var2 + 1)); + + if (this.field_145915_a[var2].length() > 15) { + this.field_145915_a[var2] = this.field_145915_a[var2].substring(0, 15); + } + } + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() { + String[] var1 = new String[4]; + System.arraycopy(this.field_145915_a, 0, var1, 0, 4); + return new S33PacketUpdateSign(this.field_145851_c, this.field_145848_d, this.field_145849_e, var1); + } + + public boolean func_145914_a() { + return this.field_145916_j; + } + + public void func_145913_a(boolean p_145913_1_) { + this.field_145916_j = p_145913_1_; + + if (!p_145913_1_) { + this.field_145917_k = null; + } + } + + public void func_145912_a(EntityPlayer p_145912_1_) { + this.field_145917_k = p_145912_1_; + } + + public EntityPlayer func_145911_b() { + return this.field_145917_k; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntitySkull.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntitySkull.java new file mode 100644 index 0000000..8cd615d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/tileentity/TileEntitySkull.java @@ -0,0 +1,101 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Iterables; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import java.util.UUID; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.StringUtils; + +public class TileEntitySkull extends TileEntity { + private int field_145908_a; + private int field_145910_i; + private GameProfile field_152110_j = null; + + + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + p_145841_1_.setByte("SkullType", (byte)(this.field_145908_a & 255)); + p_145841_1_.setByte("Rot", (byte)(this.field_145910_i & 255)); + + if (this.field_152110_j != null) { + NBTTagCompound var2 = new NBTTagCompound(); + NBTUtil.func_152460_a(var2, this.field_152110_j); + p_145841_1_.setTag("Owner", var2); + } + } + + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + this.field_145908_a = p_145839_1_.getByte("SkullType"); + this.field_145910_i = p_145839_1_.getByte("Rot"); + + if (this.field_145908_a == 3) { + if (p_145839_1_.func_150297_b("Owner", 10)) { + this.field_152110_j = NBTUtil.func_152459_a(p_145839_1_.getCompoundTag("Owner")); + } else if (p_145839_1_.func_150297_b("ExtraType", 8) && !StringUtils.isNullOrEmpty(p_145839_1_.getString("ExtraType"))) { + this.field_152110_j = new GameProfile(null, p_145839_1_.getString("ExtraType")); + this.func_152109_d(); + } + } + } + + public GameProfile func_152108_a() { + return this.field_152110_j; + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() { + NBTTagCompound var1 = new NBTTagCompound(); + this.writeToNBT(var1); + return new S35PacketUpdateTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e, 4, var1); + } + + public void func_152107_a(int p_152107_1_) { + this.field_145908_a = p_152107_1_; + this.field_152110_j = null; + } + + public void func_152106_a(GameProfile p_152106_1_) { + this.field_145908_a = 3; + this.field_152110_j = p_152106_1_; + this.func_152109_d(); + } + + private void func_152109_d() { + if (this.field_152110_j != null && !StringUtils.isNullOrEmpty(this.field_152110_j.getName())) { + if (!this.field_152110_j.isComplete() || !this.field_152110_j.getProperties().containsKey("textures")) { + GameProfile var1 = MinecraftServer.getServer().func_152358_ax().func_152655_a(this.field_152110_j.getName()); + + if (var1 != null) { + Property var2 = (Property)Iterables.getFirst(var1.getProperties().get("textures"), (Object)null); + + if (var2 == null) { + var1 = MinecraftServer.getServer().func_147130_as().fillProfileProperties(var1, true); + } + + this.field_152110_j = var1; + this.onInventoryChanged(); + } + } + } + } + + public int func_145904_a() { + return this.field_145908_a; + } + + public int func_145906_b() { + return this.field_145910_i; + } + + public void func_145903_a(int p_145903_1_) { + this.field_145910_i = p_145903_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/AxisAlignedBB.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/AxisAlignedBB.java new file mode 100644 index 0000000..dabc06e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/AxisAlignedBB.java @@ -0,0 +1,400 @@ +package net.minecraft.util; + +public class AxisAlignedBB { + public double minX; + public double minY; + public double minZ; + public double maxX; + public double maxY; + public double maxZ; + + + /** + * Returns a bounding box with the specified bounds. Args: minX, minY, minZ, maxX, maxY, maxZ + */ + public static AxisAlignedBB getBoundingBox(double p_72330_0_, double p_72330_2_, double p_72330_4_, double p_72330_6_, double p_72330_8_, double p_72330_10_) { + return new AxisAlignedBB(p_72330_0_, p_72330_2_, p_72330_4_, p_72330_6_, p_72330_8_, p_72330_10_); + } + + public AxisAlignedBB(double p_i2300_1_, double p_i2300_3_, double p_i2300_5_, double p_i2300_7_, double p_i2300_9_, double p_i2300_11_) { + this.minX = p_i2300_1_; + this.minY = p_i2300_3_; + this.minZ = p_i2300_5_; + this.maxX = p_i2300_7_; + this.maxY = p_i2300_9_; + this.maxZ = p_i2300_11_; + } + + /** + * Sets the bounds of the bounding box. Args: minX, minY, minZ, maxX, maxY, maxZ + */ + public AxisAlignedBB setBounds(double p_72324_1_, double p_72324_3_, double p_72324_5_, double p_72324_7_, double p_72324_9_, double p_72324_11_) { + this.minX = p_72324_1_; + this.minY = p_72324_3_; + this.minZ = p_72324_5_; + this.maxX = p_72324_7_; + this.maxY = p_72324_9_; + this.maxZ = p_72324_11_; + return this; + } + + /** + * Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z + */ + public AxisAlignedBB addCoord(double p_72321_1_, double p_72321_3_, double p_72321_5_) { + double var7 = this.minX; + double var9 = this.minY; + double var11 = this.minZ; + double var13 = this.maxX; + double var15 = this.maxY; + double var17 = this.maxZ; + + if (p_72321_1_ < 0.0D) { + var7 += p_72321_1_; + } + + if (p_72321_1_ > 0.0D) { + var13 += p_72321_1_; + } + + if (p_72321_3_ < 0.0D) { + var9 += p_72321_3_; + } + + if (p_72321_3_ > 0.0D) { + var15 += p_72321_3_; + } + + if (p_72321_5_ < 0.0D) { + var11 += p_72321_5_; + } + + if (p_72321_5_ > 0.0D) { + var17 += p_72321_5_; + } + + return getBoundingBox(var7, var9, var11, var13, var15, var17); + } + + /** + * Returns a bounding box expanded by the specified vector (if negative numbers are given it will shrink). Args: x, + * y, z + */ + public AxisAlignedBB expand(double p_72314_1_, double p_72314_3_, double p_72314_5_) { + double var7 = this.minX - p_72314_1_; + double var9 = this.minY - p_72314_3_; + double var11 = this.minZ - p_72314_5_; + double var13 = this.maxX + p_72314_1_; + double var15 = this.maxY + p_72314_3_; + double var17 = this.maxZ + p_72314_5_; + return getBoundingBox(var7, var9, var11, var13, var15, var17); + } + + public AxisAlignedBB func_111270_a(AxisAlignedBB p_111270_1_) { + double var2 = Math.min(this.minX, p_111270_1_.minX); + double var4 = Math.min(this.minY, p_111270_1_.minY); + double var6 = Math.min(this.minZ, p_111270_1_.minZ); + double var8 = Math.max(this.maxX, p_111270_1_.maxX); + double var10 = Math.max(this.maxY, p_111270_1_.maxY); + double var12 = Math.max(this.maxZ, p_111270_1_.maxZ); + return getBoundingBox(var2, var4, var6, var8, var10, var12); + } + + /** + * Returns a bounding box offseted by the specified vector (if negative numbers are given it will shrink). Args: x, + * y, z + */ + public AxisAlignedBB getOffsetBoundingBox(double p_72325_1_, double p_72325_3_, double p_72325_5_) { + return getBoundingBox(this.minX + p_72325_1_, this.minY + p_72325_3_, this.minZ + p_72325_5_, this.maxX + p_72325_1_, this.maxY + p_72325_3_, this.maxZ + p_72325_5_); + } + + /** + * if instance and the argument bounding boxes overlap in the Y and Z dimensions, calculate the offset between them + * in the X dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the + * calculated offset. Otherwise return the calculated offset. + */ + public double calculateXOffset(AxisAlignedBB p_72316_1_, double p_72316_2_) { + if (p_72316_1_.maxY > this.minY && p_72316_1_.minY < this.maxY) { + if (p_72316_1_.maxZ > this.minZ && p_72316_1_.minZ < this.maxZ) { + double var4; + + if (p_72316_2_ > 0.0D && p_72316_1_.maxX <= this.minX) { + var4 = this.minX - p_72316_1_.maxX; + + if (var4 < p_72316_2_) { + p_72316_2_ = var4; + } + } + + if (p_72316_2_ < 0.0D && p_72316_1_.minX >= this.maxX) { + var4 = this.maxX - p_72316_1_.minX; + + if (var4 > p_72316_2_) { + p_72316_2_ = var4; + } + } + + return p_72316_2_; + } else { + return p_72316_2_; + } + } else { + return p_72316_2_; + } + } + + /** + * if instance and the argument bounding boxes overlap in the X and Z dimensions, calculate the offset between them + * in the Y dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the + * calculated offset. Otherwise return the calculated offset. + */ + public double calculateYOffset(AxisAlignedBB p_72323_1_, double p_72323_2_) { + if (p_72323_1_.maxX > this.minX && p_72323_1_.minX < this.maxX) { + if (p_72323_1_.maxZ > this.minZ && p_72323_1_.minZ < this.maxZ) { + double var4; + + if (p_72323_2_ > 0.0D && p_72323_1_.maxY <= this.minY) { + var4 = this.minY - p_72323_1_.maxY; + + if (var4 < p_72323_2_) { + p_72323_2_ = var4; + } + } + + if (p_72323_2_ < 0.0D && p_72323_1_.minY >= this.maxY) { + var4 = this.maxY - p_72323_1_.minY; + + if (var4 > p_72323_2_) { + p_72323_2_ = var4; + } + } + + return p_72323_2_; + } else { + return p_72323_2_; + } + } else { + return p_72323_2_; + } + } + + /** + * if instance and the argument bounding boxes overlap in the Y and X dimensions, calculate the offset between them + * in the Z dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the + * calculated offset. Otherwise return the calculated offset. + */ + public double calculateZOffset(AxisAlignedBB p_72322_1_, double p_72322_2_) { + if (p_72322_1_.maxX > this.minX && p_72322_1_.minX < this.maxX) { + if (p_72322_1_.maxY > this.minY && p_72322_1_.minY < this.maxY) { + double var4; + + if (p_72322_2_ > 0.0D && p_72322_1_.maxZ <= this.minZ) { + var4 = this.minZ - p_72322_1_.maxZ; + + if (var4 < p_72322_2_) { + p_72322_2_ = var4; + } + } + + if (p_72322_2_ < 0.0D && p_72322_1_.minZ >= this.maxZ) { + var4 = this.maxZ - p_72322_1_.minZ; + + if (var4 > p_72322_2_) { + p_72322_2_ = var4; + } + } + + return p_72322_2_; + } else { + return p_72322_2_; + } + } else { + return p_72322_2_; + } + } + + /** + * Returns whether the given bounding box intersects with this one. Args: axisAlignedBB + */ + public boolean intersectsWith(AxisAlignedBB p_72326_1_) { + return p_72326_1_.maxX > this.minX && p_72326_1_.minX < this.maxX && (p_72326_1_.maxY > this.minY && p_72326_1_.minY < this.maxY && p_72326_1_.maxZ > this.minZ && p_72326_1_.minZ < this.maxZ); + } + + /** + * Offsets the current bounding box by the specified coordinates. Args: x, y, z + */ + public AxisAlignedBB offset(double p_72317_1_, double p_72317_3_, double p_72317_5_) { + this.minX += p_72317_1_; + this.minY += p_72317_3_; + this.minZ += p_72317_5_; + this.maxX += p_72317_1_; + this.maxY += p_72317_3_; + this.maxZ += p_72317_5_; + return this; + } + + /** + * Returns if the supplied Vec3D is completely inside the bounding box + */ + public boolean isVecInside(Vec3 p_72318_1_) { + return p_72318_1_.xCoord > this.minX && p_72318_1_.xCoord < this.maxX && (p_72318_1_.yCoord > this.minY && p_72318_1_.yCoord < this.maxY && p_72318_1_.zCoord > this.minZ && p_72318_1_.zCoord < this.maxZ); + } + + /** + * Returns the average length of the edges of the bounding box. + */ + public double getAverageEdgeLength() { + double var1 = this.maxX - this.minX; + double var3 = this.maxY - this.minY; + double var5 = this.maxZ - this.minZ; + return (var1 + var3 + var5) / 3.0D; + } + + /** + * Returns a bounding box that is inset by the specified amounts + */ + public AxisAlignedBB contract(double p_72331_1_, double p_72331_3_, double p_72331_5_) { + double var7 = this.minX + p_72331_1_; + double var9 = this.minY + p_72331_3_; + double var11 = this.minZ + p_72331_5_; + double var13 = this.maxX - p_72331_1_; + double var15 = this.maxY - p_72331_3_; + double var17 = this.maxZ - p_72331_5_; + return getBoundingBox(var7, var9, var11, var13, var15, var17); + } + + /** + * Returns a copy of the bounding box. + */ + public AxisAlignedBB copy() { + return getBoundingBox(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); + } + + public MovingObjectPosition calculateIntercept(Vec3 p_72327_1_, Vec3 p_72327_2_) { + Vec3 var3 = p_72327_1_.getIntermediateWithXValue(p_72327_2_, this.minX); + Vec3 var4 = p_72327_1_.getIntermediateWithXValue(p_72327_2_, this.maxX); + Vec3 var5 = p_72327_1_.getIntermediateWithYValue(p_72327_2_, this.minY); + Vec3 var6 = p_72327_1_.getIntermediateWithYValue(p_72327_2_, this.maxY); + Vec3 var7 = p_72327_1_.getIntermediateWithZValue(p_72327_2_, this.minZ); + Vec3 var8 = p_72327_1_.getIntermediateWithZValue(p_72327_2_, this.maxZ); + + if (!this.isVecInYZ(var3)) { + var3 = null; + } + + if (!this.isVecInYZ(var4)) { + var4 = null; + } + + if (!this.isVecInXZ(var5)) { + var5 = null; + } + + if (!this.isVecInXZ(var6)) { + var6 = null; + } + + if (!this.isVecInXY(var7)) { + var7 = null; + } + + if (!this.isVecInXY(var8)) { + var8 = null; + } + + Vec3 var9 = null; + + if (var3 != null && (var9 == null || p_72327_1_.squareDistanceTo(var3) < p_72327_1_.squareDistanceTo(var9))) { + var9 = var3; + } + + if (var4 != null && (var9 == null || p_72327_1_.squareDistanceTo(var4) < p_72327_1_.squareDistanceTo(var9))) { + var9 = var4; + } + + if (var5 != null && (var9 == null || p_72327_1_.squareDistanceTo(var5) < p_72327_1_.squareDistanceTo(var9))) { + var9 = var5; + } + + if (var6 != null && (var9 == null || p_72327_1_.squareDistanceTo(var6) < p_72327_1_.squareDistanceTo(var9))) { + var9 = var6; + } + + if (var7 != null && (var9 == null || p_72327_1_.squareDistanceTo(var7) < p_72327_1_.squareDistanceTo(var9))) { + var9 = var7; + } + + if (var8 != null && (var9 == null || p_72327_1_.squareDistanceTo(var8) < p_72327_1_.squareDistanceTo(var9))) { + var9 = var8; + } + + if (var9 == null) { + return null; + } else { + byte var10 = -1; + + if (var9 == var3) { + var10 = 4; + } + + if (var9 == var4) { + var10 = 5; + } + + if (var9 == var5) { + var10 = 0; + } + + if (var9 == var6) { + var10 = 1; + } + + if (var9 == var7) { + var10 = 2; + } + + if (var9 == var8) { + var10 = 3; + } + + return new MovingObjectPosition(0, 0, 0, var10, var9); + } + } + + /** + * Checks if the specified vector is within the YZ dimensions of the bounding box. Args: Vec3D + */ + private boolean isVecInYZ(Vec3 p_72333_1_) { + return p_72333_1_ != null && p_72333_1_.yCoord >= this.minY && p_72333_1_.yCoord <= this.maxY && p_72333_1_.zCoord >= this.minZ && p_72333_1_.zCoord <= this.maxZ; + } + + /** + * Checks if the specified vector is within the XZ dimensions of the bounding box. Args: Vec3D + */ + private boolean isVecInXZ(Vec3 p_72315_1_) { + return p_72315_1_ != null && p_72315_1_.xCoord >= this.minX && p_72315_1_.xCoord <= this.maxX && p_72315_1_.zCoord >= this.minZ && p_72315_1_.zCoord <= this.maxZ; + } + + /** + * Checks if the specified vector is within the XY dimensions of the bounding box. Args: Vec3D + */ + private boolean isVecInXY(Vec3 p_72319_1_) { + return p_72319_1_ != null && p_72319_1_.xCoord >= this.minX && p_72319_1_.xCoord <= this.maxX && p_72319_1_.yCoord >= this.minY && p_72319_1_.yCoord <= this.maxY; + } + + /** + * Sets the bounding box to the same bounds as the bounding box passed in. Args: axisAlignedBB + */ + public void setBB(AxisAlignedBB p_72328_1_) { + this.minX = p_72328_1_.minX; + this.minY = p_72328_1_.minY; + this.minZ = p_72328_1_.minZ; + this.maxX = p_72328_1_.maxX; + this.maxY = p_72328_1_.maxY; + this.maxZ = p_72328_1_.maxZ; + } + + public String toString() { + return "box[" + this.minX + ", " + this.minY + ", " + this.minZ + " -> " + this.maxX + ", " + this.maxY + ", " + this.maxZ + "]"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatAllowedCharacters.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatAllowedCharacters.java new file mode 100644 index 0000000..67ee58d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatAllowedCharacters.java @@ -0,0 +1,32 @@ +package net.minecraft.util; + +public class ChatAllowedCharacters { + /** + * Array of the special characters that are allowed in any text drawing of Minecraft. + */ + public static final char[] allowedCharacters = new char[] {'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'}; + + + public static boolean isAllowedCharacter(char p_71566_0_) { + return p_71566_0_ != 167 && p_71566_0_ >= 32 && p_71566_0_ != 127; + } + + /** + * Filter string by only keeping those characters for which isAllowedCharacter() returns true. + */ + public static String filerAllowedCharacters(String p_71565_0_) { + StringBuilder var1 = new StringBuilder(); + char[] var2 = p_71565_0_.toCharArray(); + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + char var5 = var2[var4]; + + if (isAllowedCharacter(var5)) { + var1.append(var5); + } + } + + return var1.toString(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentStyle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentStyle.java new file mode 100644 index 0000000..d561602 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentStyle.java @@ -0,0 +1,150 @@ +package net.minecraft.util; + +import com.google.common.base.Function; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.Iterator; +import java.util.List; + +public abstract class ChatComponentStyle implements IChatComponent { + /** + * The later siblings of this component. If this component turns the text bold, that will apply to all the siblings + * until a later sibling turns the text something else. + */ + protected List siblings = Lists.newArrayList(); + private ChatStyle style; + + + /** + * Appends the given component to the end of this one. + */ + public IChatComponent appendSibling(IChatComponent p_150257_1_) { + p_150257_1_.getChatStyle().setParentStyle(this.getChatStyle()); + this.siblings.add(p_150257_1_); + return this; + } + + /** + * Gets the sibling components of this one. + */ + public List getSiblings() { + return this.siblings; + } + + /** + * Appends the given text to the end of this component. + */ + public IChatComponent appendText(String p_150258_1_) { + return this.appendSibling(new ChatComponentText(p_150258_1_)); + } + + public IChatComponent setChatStyle(ChatStyle p_150255_1_) { + this.style = p_150255_1_; + Iterator var2 = this.siblings.iterator(); + + while (var2.hasNext()) { + IChatComponent var3 = (IChatComponent)var2.next(); + var3.getChatStyle().setParentStyle(this.getChatStyle()); + } + + return this; + } + + public ChatStyle getChatStyle() { + if (this.style == null) { + this.style = new ChatStyle(); + Iterator var1 = this.siblings.iterator(); + + while (var1.hasNext()) { + IChatComponent var2 = (IChatComponent)var1.next(); + var2.getChatStyle().setParentStyle(this.style); + } + } + + return this.style; + } + + public Iterator iterator() { + return Iterators.concat(Iterators.forArray(this), createDeepCopyIterator(this.siblings)); + } + + /** + * Gets the text of this component, without any special formatting codes added. TODO: why is this two different + * methods? + */ + public final String getUnformattedText() { + StringBuilder var1 = new StringBuilder(); + Iterator var2 = this.iterator(); + + while (var2.hasNext()) { + IChatComponent var3 = (IChatComponent)var2.next(); + var1.append(var3.getUnformattedTextForChat()); + } + + return var1.toString(); + } + + /** + * Gets the text of this component, with formatting codes added for rendering. + */ + public final String getFormattedText() { + StringBuilder var1 = new StringBuilder(); + Iterator var2 = this.iterator(); + + while (var2.hasNext()) { + IChatComponent var3 = (IChatComponent)var2.next(); + var1.append(var3.getChatStyle().getFormattingCode()); + var1.append(var3.getUnformattedTextForChat()); + var1.append(EnumChatFormatting.RESET); + } + + return var1.toString(); + } + + /** + * Creates an iterator that iterates over the given components, returning deep copies of each component in turn so + * that the properties of the returned objects will remain externally consistent after being returned. + */ + public static Iterator createDeepCopyIterator(Iterable p_150262_0_) { + Iterator var1 = Iterators.concat(Iterators.transform(p_150262_0_.iterator(), new Function() { + + public Iterator apply(IChatComponent p_apply_1_) { + return p_apply_1_.iterator(); + } + public Object apply(Object p_apply_1_) { + return this.apply((IChatComponent)p_apply_1_); + } + })); + var1 = Iterators.transform(var1, new Function() { + + public IChatComponent apply(IChatComponent p_apply_1_) { + IChatComponent var2 = p_apply_1_.createCopy(); + var2.setChatStyle(var2.getChatStyle().createDeepCopy()); + return var2; + } + public Object apply(Object p_apply_1_) { + return this.apply((IChatComponent)p_apply_1_); + } + }); + return var1; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (!(p_equals_1_ instanceof ChatComponentStyle)) { + return false; + } else { + ChatComponentStyle var2 = (ChatComponentStyle)p_equals_1_; + return this.siblings.equals(var2.siblings) && this.getChatStyle().equals(var2.getChatStyle()); + } + } + + public int hashCode() { + return 31 * this.style.hashCode() + this.siblings.hashCode(); + } + + public String toString() { + return "BaseComponent{style=" + this.style + ", siblings=" + this.siblings + '}'; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentText.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentText.java new file mode 100644 index 0000000..87b8728 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentText.java @@ -0,0 +1,62 @@ +package net.minecraft.util; + +import lombok.Getter; +import lombok.Setter; + +import java.util.Iterator; + +public class ChatComponentText extends ChatComponentStyle { + private final String text; + @Getter @Setter private boolean branded; + + public ChatComponentText(String p_i45159_1_) { + this.text = p_i45159_1_; + } + + /** + * Gets the text value of this ChatComponentText. TODO: what are getUnformattedText and getUnformattedTextForChat + * missing that made someone decide to create a third equivalent method that only ChatComponentText can implement? + */ + public String getChatComponentText_TextValue() { + return this.text; + } + + /** + * Gets the text of this component, without any special formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() { + return this.text; + } + + /** + * Creates a copy of this component. Almost a deep copy, except the style is shallow-copied. + */ + public ChatComponentText createCopy() { + ChatComponentText var1 = new ChatComponentText(this.text); + var1.setChatStyle(this.getChatStyle().createShallowCopy()); + Iterator var2 = this.getSiblings().iterator(); + + while (var2.hasNext()) { + IChatComponent var3 = (IChatComponent)var2.next(); + var1.appendSibling(var3.createCopy()); + } + + return var1; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (!(p_equals_1_ instanceof ChatComponentText)) { + return false; + } else { + ChatComponentText var2 = (ChatComponentText)p_equals_1_; + return this.text.equals(var2.getChatComponentText_TextValue()) && super.equals(p_equals_1_); + } + } + + public String toString() { + return "TextComponent{text='" + this.text + '\'' + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentTranslation.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentTranslation.java new file mode 100644 index 0000000..539637e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentTranslation.java @@ -0,0 +1,242 @@ +package net.minecraft.util; + +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.IllegalFormatException; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ChatComponentTranslation extends ChatComponentStyle { + private final String key; + private final Object[] formatArgs; + private final Object syncLock = new Object(); + private long lastTranslationUpdateTimeInMilliseconds = -1L; + + /** + * The discrete elements that make up this component. For example, this would be ["Prefix, ", "FirstArg", + * "SecondArg", " again ", "SecondArg", " and ", "FirstArg", " lastly ", "ThirdArg", " and also ", "FirstArg", " + * again!"] for "translation.test.complex" (see en-US.lang) + */ + List children = Lists.newArrayList(); + public static final Pattern stringVariablePattern = Pattern.compile("%(?:(\\d+)\\$)?([A-Za-z%]|$)"); + + + public ChatComponentTranslation(String p_i45160_1_, Object ... p_i45160_2_) { + this.key = p_i45160_1_; + this.formatArgs = p_i45160_2_; + Object[] var3 = p_i45160_2_; + int var4 = p_i45160_2_.length; + + for (int var5 = 0; var5 < var4; ++var5) { + Object var6 = var3[var5]; + + if (var6 instanceof IChatComponent) { + ((IChatComponent)var6).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + } + + /** + * ensures that our children are initialized from the most recent string translation mapping. + */ + synchronized void ensureInitialized() { + Object var1 = this.syncLock; + + synchronized (this.syncLock) { + long var2 = StatCollector.getLastTranslationUpdateTimeInMilliseconds(); + + if (var2 == this.lastTranslationUpdateTimeInMilliseconds) { + return; + } + + this.lastTranslationUpdateTimeInMilliseconds = var2; + this.children.clear(); + } + + try { + this.initializeFromFormat(StatCollector.translateToLocal(this.key)); + } catch (ChatComponentTranslationFormatException var6) { + this.children.clear(); + + try { + this.initializeFromFormat(StatCollector.translateToFallback(this.key)); + } catch (ChatComponentTranslationFormatException var5) { + throw var6; + } + } + } + + /** + * initializes our children from a format string, using the format args to fill in the placeholder variables. + */ + protected void initializeFromFormat(String p_150269_1_) { + boolean var2 = false; + Matcher var3 = stringVariablePattern.matcher(p_150269_1_); + int var4 = 0; + int var5 = 0; + + try { + int var7; + + for (; var3.find(var5); var5 = var7) { + int var6 = var3.start(); + var7 = var3.end(); + + if (var6 > var5) { + ChatComponentText var8 = new ChatComponentText(String.format(p_150269_1_.substring(var5, var6))); + var8.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(var8); + } + + String var14 = var3.group(2); + String var9 = p_150269_1_.substring(var6, var7); + + if ("%".equals(var14) && "%%".equals(var9)) { + ChatComponentText var15 = new ChatComponentText("%"); + var15.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(var15); + } else { + if (!"s".equals(var14)) { + throw new ChatComponentTranslationFormatException(this, "Unsupported format: '" + var9 + "'"); + } + + String var10 = var3.group(1); + int var11 = var10 != null ? Integer.parseInt(var10) - 1 : var4++; + this.children.add(this.getFormatArgumentAsComponent(var11)); + } + } + + if (var5 < p_150269_1_.length()) { + ChatComponentText var13 = new ChatComponentText(String.format(p_150269_1_.substring(var5))); + var13.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(var13); + } + } catch (IllegalFormatException var12) { + throw new ChatComponentTranslationFormatException(this, var12); + } + } + + private IChatComponent getFormatArgumentAsComponent(int p_150272_1_) { + if (p_150272_1_ >= this.formatArgs.length) { + throw new ChatComponentTranslationFormatException(this, p_150272_1_); + } else { + Object var2 = this.formatArgs[p_150272_1_]; + Object var3; + + if (var2 instanceof IChatComponent) { + var3 = var2; + } else { + var3 = new ChatComponentText(var2 == null ? "null" : var2.toString()); + ((IChatComponent)var3).getChatStyle().setParentStyle(this.getChatStyle()); + } + + return (IChatComponent)var3; + } + } + + public IChatComponent setChatStyle(ChatStyle p_150255_1_) { + super.setChatStyle(p_150255_1_); + Object[] var2 = this.formatArgs; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + Object var5 = var2[var4]; + + if (var5 instanceof IChatComponent) { + ((IChatComponent)var5).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + + if (this.lastTranslationUpdateTimeInMilliseconds > -1L) { + Iterator var6 = this.children.iterator(); + + while (var6.hasNext()) { + IChatComponent var7 = (IChatComponent)var6.next(); + var7.getChatStyle().setParentStyle(p_150255_1_); + } + } + + return this; + } + + public Iterator iterator() { + this.ensureInitialized(); + return Iterators.concat(createDeepCopyIterator(this.children), createDeepCopyIterator(this.siblings)); + } + + /** + * Gets the text of this component, without any special formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() { + this.ensureInitialized(); + StringBuilder var1 = new StringBuilder(); + Iterator var2 = this.children.iterator(); + + while (var2.hasNext()) { + IChatComponent var3 = (IChatComponent)var2.next(); + var1.append(var3.getUnformattedTextForChat()); + } + + return var1.toString(); + } + + /** + * Creates a copy of this component. Almost a deep copy, except the style is shallow-copied. + */ + public ChatComponentTranslation createCopy() { + Object[] var1 = new Object[this.formatArgs.length]; + + for (int var2 = 0; var2 < this.formatArgs.length; ++var2) { + if (this.formatArgs[var2] instanceof IChatComponent) { + var1[var2] = ((IChatComponent)this.formatArgs[var2]).createCopy(); + } else { + var1[var2] = this.formatArgs[var2]; + } + } + + ChatComponentTranslation var5 = new ChatComponentTranslation(this.key, var1); + var5.setChatStyle(this.getChatStyle().createShallowCopy()); + Iterator var3 = this.getSiblings().iterator(); + + while (var3.hasNext()) { + IChatComponent var4 = (IChatComponent)var3.next(); + var5.appendSibling(var4.createCopy()); + } + + return var5; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (!(p_equals_1_ instanceof ChatComponentTranslation)) { + return false; + } else { + ChatComponentTranslation var2 = (ChatComponentTranslation)p_equals_1_; + return Arrays.equals(this.formatArgs, var2.formatArgs) && this.key.equals(var2.key) && super.equals(p_equals_1_); + } + } + + public int hashCode() { + int var1 = super.hashCode(); + var1 = 31 * var1 + this.key.hashCode(); + var1 = 31 * var1 + Arrays.hashCode(this.formatArgs); + return var1; + } + + public String toString() { + return "TranslatableComponent{key='" + this.key + '\'' + ", args=" + Arrays.toString(this.formatArgs) + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } + + public String getKey() { + return this.key; + } + + public Object[] getFormatArgs() { + return this.formatArgs; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java new file mode 100644 index 0000000..714480f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatComponentTranslationFormatException.java @@ -0,0 +1,17 @@ +package net.minecraft.util; + +public class ChatComponentTranslationFormatException extends IllegalArgumentException { + + + public ChatComponentTranslationFormatException(ChatComponentTranslation p_i45161_1_, String p_i45161_2_) { + super(String.format("Error parsing: %s: %s", p_i45161_1_, p_i45161_2_)); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation p_i45162_1_, int p_i45162_2_) { + super(String.format("Invalid index %d requested for %s", Integer.valueOf(p_i45162_2_), p_i45162_1_)); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation p_i45163_1_, Throwable p_i45163_2_) { + super(String.format("Error while parsing: %s", p_i45163_1_), p_i45163_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatStyle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatStyle.java new file mode 100644 index 0000000..08d8887 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChatStyle.java @@ -0,0 +1,497 @@ +package net.minecraft.util; + +import com.google.gson.*; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; + +import java.lang.reflect.Type; + +public class ChatStyle { + /** + * The parent of this ChatStyle. Used for looking up values that this instance does not override. + */ + private ChatStyle parentStyle; + private EnumChatFormatting color; + private Boolean bold; + private Boolean italic; + private Boolean underlined; + private Boolean strikethrough; + private Boolean obfuscated; + private ClickEvent chatClickEvent; + private HoverEvent chatHoverEvent; + + /** + * The base of the ChatStyle hierarchy. All ChatStyle instances are implicitly children of this. + */ + private static final ChatStyle rootStyle = new ChatStyle() { + + public EnumChatFormatting getColor() { + return null; + } + public boolean getBold() { + return false; + } + public boolean getItalic() { + return false; + } + public boolean getStrikethrough() { + return false; + } + public boolean getUnderlined() { + return false; + } + public boolean getObfuscated() { + return false; + } + public ClickEvent getChatClickEvent() { + return null; + } + public HoverEvent getChatHoverEvent() { + return null; + } + public ChatStyle setColor(EnumChatFormatting p_150238_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setBold(Boolean p_150227_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setItalic(Boolean p_150217_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setStrikethrough(Boolean p_150225_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setUnderlined(Boolean p_150228_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setObfuscated(Boolean p_150237_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setChatClickEvent(ClickEvent p_150241_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setChatHoverEvent(HoverEvent p_150209_1_) { + throw new UnsupportedOperationException(); + } + public ChatStyle setParentStyle(ChatStyle p_150221_1_) { + throw new UnsupportedOperationException(); + } + public String toString() { + return "Style.ROOT"; + } + public ChatStyle createShallowCopy() { + return this; + } + public ChatStyle createDeepCopy() { + return this; + } + public String getFormattingCode() { + return ""; + } + }; + + + /** + * Gets the effective color of this ChatStyle. + */ + public EnumChatFormatting getColor() { + return this.color == null ? this.getParent().getColor() : this.color; + } + + /** + * Whether or not text of this ChatStyle should be in bold. + */ + public boolean getBold() { + return this.bold == null ? this.getParent().getBold() : this.bold.booleanValue(); + } + + /** + * Whether or not text of this ChatStyle should be italicized. + */ + public boolean getItalic() { + return this.italic == null ? this.getParent().getItalic() : this.italic.booleanValue(); + } + + /** + * Whether or not to format text of this ChatStyle using strikethrough. + */ + public boolean getStrikethrough() { + return this.strikethrough == null ? this.getParent().getStrikethrough() : this.strikethrough.booleanValue(); + } + + /** + * Whether or not text of this ChatStyle should be underlined. + */ + public boolean getUnderlined() { + return this.underlined == null ? this.getParent().getUnderlined() : this.underlined.booleanValue(); + } + + /** + * Whether or not text of this ChatStyle should be obfuscated. + */ + public boolean getObfuscated() { + return this.obfuscated == null ? this.getParent().getObfuscated() : this.obfuscated.booleanValue(); + } + + /** + * Whether or not this style is empty (inherits everything from the parent). + */ + public boolean isEmpty() { + return this.bold == null && this.italic == null && this.strikethrough == null && this.underlined == null && this.obfuscated == null && this.color == null && this.chatClickEvent == null && this.chatHoverEvent == null; + } + + /** + * The effective chat click event. + */ + public ClickEvent getChatClickEvent() { + return this.chatClickEvent == null ? this.getParent().getChatClickEvent() : this.chatClickEvent; + } + + /** + * The effective chat hover event. + */ + public HoverEvent getChatHoverEvent() { + return this.chatHoverEvent == null ? this.getParent().getChatHoverEvent() : this.chatHoverEvent; + } + + /** + * Sets the color for this ChatStyle to the given value. Only use color values for this; set other values using the + * specific methods. + */ + public ChatStyle setColor(EnumChatFormatting p_150238_1_) { + this.color = p_150238_1_; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be in bold. Set to false if, e.g., the parent style is bold + * and you want text of this style to be unbolded. + */ + public ChatStyle setBold(Boolean p_150227_1_) { + this.bold = p_150227_1_; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be italicized. Set to false if, e.g., the parent style is + * italicized and you want to override that for this style. + */ + public ChatStyle setItalic(Boolean p_150217_1_) { + this.italic = p_150217_1_; + return this; + } + + /** + * Sets whether or not to format text of this ChatStyle using strikethrough. Set to false if, e.g., the parent + * style uses strikethrough and you want to override that for this style. + */ + public ChatStyle setStrikethrough(Boolean p_150225_1_) { + this.strikethrough = p_150225_1_; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be underlined. Set to false if, e.g., the parent style is + * underlined and you want to override that for this style. + */ + public ChatStyle setUnderlined(Boolean p_150228_1_) { + this.underlined = p_150228_1_; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be obfuscated. Set to false if, e.g., the parent style is + * obfuscated and you want to override that for this style. + */ + public ChatStyle setObfuscated(Boolean p_150237_1_) { + this.obfuscated = p_150237_1_; + return this; + } + + /** + * Sets the event that should be run when text of this ChatStyle is clicked on. + */ + public ChatStyle setChatClickEvent(ClickEvent p_150241_1_) { + this.chatClickEvent = p_150241_1_; + return this; + } + + /** + * Sets the event that should be run when text of this ChatStyle is hovered over. + */ + public ChatStyle setChatHoverEvent(HoverEvent p_150209_1_) { + this.chatHoverEvent = p_150209_1_; + return this; + } + + /** + * Sets the fallback ChatStyle to use if this ChatStyle does not override some value. Without a parent, obvious + * defaults are used (bold: false, underlined: false, etc). + */ + public ChatStyle setParentStyle(ChatStyle p_150221_1_) { + this.parentStyle = p_150221_1_; + return this; + } + + /** + * Gets the equivalent text formatting code for this style, without the initial section sign (U+00A7) character. + */ + public String getFormattingCode() { + if (this.isEmpty()) { + return this.parentStyle != null ? this.parentStyle.getFormattingCode() : ""; + } else { + StringBuilder var1 = new StringBuilder(); + + if (this.getColor() != null) { + var1.append(this.getColor()); + } + + if (this.getBold()) { + var1.append(EnumChatFormatting.BOLD); + } + + if (this.getItalic()) { + var1.append(EnumChatFormatting.ITALIC); + } + + if (this.getUnderlined()) { + var1.append(EnumChatFormatting.UNDERLINE); + } + + if (this.getObfuscated()) { + var1.append(EnumChatFormatting.OBFUSCATED); + } + + if (this.getStrikethrough()) { + var1.append(EnumChatFormatting.STRIKETHROUGH); + } + + return var1.toString(); + } + } + + /** + * Gets the immediate parent of this ChatStyle. + */ + private ChatStyle getParent() { + return this.parentStyle == null ? rootStyle : this.parentStyle; + } + + public String toString() { + return "Style{hasParent=" + (this.parentStyle != null) + ", color=" + this.color + ", bold=" + this.bold + ", italic=" + this.italic + ", underlined=" + this.underlined + ", obfuscated=" + this.obfuscated + ", clickEvent=" + this.getChatClickEvent() + ", hoverEvent=" + this.getChatHoverEvent() + '}'; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (!(p_equals_1_ instanceof ChatStyle)) { + return false; + } else { + ChatStyle var2 = (ChatStyle)p_equals_1_; + boolean var10000; + + if (this.getBold() == var2.getBold() && this.getColor() == var2.getColor() && this.getItalic() == var2.getItalic() && this.getObfuscated() == var2.getObfuscated() && this.getStrikethrough() == var2.getStrikethrough() && this.getUnderlined() == var2.getUnderlined()) { + label56: { + if (this.getChatClickEvent() != null) { + if (!this.getChatClickEvent().equals(var2.getChatClickEvent())) { + break label56; + } + } else if (var2.getChatClickEvent() != null) { + break label56; + } + + if (this.getChatHoverEvent() != null) { + if (!this.getChatHoverEvent().equals(var2.getChatHoverEvent())) { + break label56; + } + } else if (var2.getChatHoverEvent() != null) { + break label56; + } + + var10000 = true; + return var10000; + } + } + + var10000 = false; + return var10000; + } + } + + public int hashCode() { + int var1 = this.color.hashCode(); + var1 = 31 * var1 + this.bold.hashCode(); + var1 = 31 * var1 + this.italic.hashCode(); + var1 = 31 * var1 + this.underlined.hashCode(); + var1 = 31 * var1 + this.strikethrough.hashCode(); + var1 = 31 * var1 + this.obfuscated.hashCode(); + var1 = 31 * var1 + this.chatClickEvent.hashCode(); + var1 = 31 * var1 + this.chatHoverEvent.hashCode(); + return var1; + } + + /** + * Creates a shallow copy of this style. Changes to this instance's values will not be reflected in the copy, but + * changes to the parent style's values WILL be reflected in both this instance and the copy, wherever either does + * not override a value. + */ + public ChatStyle createShallowCopy() { + ChatStyle var1 = new ChatStyle(); + var1.bold = this.bold; + var1.italic = this.italic; + var1.strikethrough = this.strikethrough; + var1.underlined = this.underlined; + var1.obfuscated = this.obfuscated; + var1.color = this.color; + var1.chatClickEvent = this.chatClickEvent; + var1.chatHoverEvent = this.chatHoverEvent; + var1.parentStyle = this.parentStyle; + return var1; + } + + /** + * Creates a deep copy of this style. No changes to this instance or its parent style will be reflected in the + * copy. + */ + public ChatStyle createDeepCopy() { + ChatStyle var1 = new ChatStyle(); + var1.setBold(Boolean.valueOf(this.getBold())); + var1.setItalic(Boolean.valueOf(this.getItalic())); + var1.setStrikethrough(Boolean.valueOf(this.getStrikethrough())); + var1.setUnderlined(Boolean.valueOf(this.getUnderlined())); + var1.setObfuscated(Boolean.valueOf(this.getObfuscated())); + var1.setColor(this.getColor()); + var1.setChatClickEvent(this.getChatClickEvent()); + var1.setChatHoverEvent(this.getChatHoverEvent()); + return var1; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer { + + + public ChatStyle deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + if (p_deserialize_1_.isJsonObject()) { + ChatStyle var4 = new ChatStyle(); + JsonObject var5 = p_deserialize_1_.getAsJsonObject(); + + if (var5 == null) { + return null; + } else { + if (var5.has("bold")) { + var4.bold = Boolean.valueOf(var5.get("bold").getAsBoolean()); + } + + if (var5.has("italic")) { + var4.italic = Boolean.valueOf(var5.get("italic").getAsBoolean()); + } + + if (var5.has("underlined")) { + var4.underlined = Boolean.valueOf(var5.get("underlined").getAsBoolean()); + } + + if (var5.has("strikethrough")) { + var4.strikethrough = Boolean.valueOf(var5.get("strikethrough").getAsBoolean()); + } + + if (var5.has("obfuscated")) { + var4.obfuscated = Boolean.valueOf(var5.get("obfuscated").getAsBoolean()); + } + + if (var5.has("color")) { + var4.color = p_deserialize_3_.deserialize(var5.get("color"), EnumChatFormatting.class); + } + + JsonObject var6; + JsonPrimitive var7; + + if (var5.has("clickEvent")) { + var6 = var5.getAsJsonObject("clickEvent"); + + if (var6 != null) { + var7 = var6.getAsJsonPrimitive("action"); + ClickEvent.Action var8 = var7 == null ? null : ClickEvent.Action.getValueByCanonicalName(var7.getAsString()); + JsonPrimitive var9 = var6.getAsJsonPrimitive("value"); + String var10 = var9 == null ? null : var9.getAsString(); + + if (var8 != null && var10 != null && var8.shouldAllowInChat()) { + var4.chatClickEvent = new ClickEvent(var8, var10); + } + } + } + + if (var5.has("hoverEvent")) { + var6 = var5.getAsJsonObject("hoverEvent"); + + if (var6 != null) { + var7 = var6.getAsJsonPrimitive("action"); + HoverEvent.Action var11 = var7 == null ? null : HoverEvent.Action.getValueByCanonicalName(var7.getAsString()); + IChatComponent var12 = p_deserialize_3_.deserialize(var6.get("value"), IChatComponent.class); + + if (var11 != null && var12 != null && var11.shouldAllowInChat()) { + var4.chatHoverEvent = new HoverEvent(var11, var12); + } + } + } + + return var4; + } + } else { + return null; + } + } + + public JsonElement serialize(ChatStyle p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + if (p_serialize_1_.isEmpty()) { + return null; + } else { + JsonObject var4 = new JsonObject(); + + if (p_serialize_1_.bold != null) { + var4.addProperty("bold", p_serialize_1_.bold); + } + + if (p_serialize_1_.italic != null) { + var4.addProperty("italic", p_serialize_1_.italic); + } + + if (p_serialize_1_.underlined != null) { + var4.addProperty("underlined", p_serialize_1_.underlined); + } + + if (p_serialize_1_.strikethrough != null) { + var4.addProperty("strikethrough", p_serialize_1_.strikethrough); + } + + if (p_serialize_1_.obfuscated != null) { + var4.addProperty("obfuscated", p_serialize_1_.obfuscated); + } + + if (p_serialize_1_.color != null) { + var4.add("color", p_serialize_3_.serialize(p_serialize_1_.color)); + } + + JsonObject var5; + + if (p_serialize_1_.chatClickEvent != null) { + var5 = new JsonObject(); + var5.addProperty("action", p_serialize_1_.chatClickEvent.getAction().getCanonicalName()); + var5.addProperty("value", p_serialize_1_.chatClickEvent.getValue()); + var4.add("clickEvent", var5); + } + + if (p_serialize_1_.chatHoverEvent != null) { + var5 = new JsonObject(); + var5.addProperty("action", p_serialize_1_.chatHoverEvent.getAction().getCanonicalName()); + var5.add("value", p_serialize_3_.serialize(p_serialize_1_.chatHoverEvent.getValue())); + var4.add("hoverEvent", var5); + } + + return var4; + } + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.serialize((ChatStyle)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChunkCoordinates.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChunkCoordinates.java new file mode 100644 index 0000000..b05dd88 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ChunkCoordinates.java @@ -0,0 +1,74 @@ +package net.minecraft.util; + +public class ChunkCoordinates implements Comparable { + public int posX; + + /** the y coordinate */ + public int posY; + + /** the z coordinate */ + public int posZ; + + + public ChunkCoordinates() {} + + public ChunkCoordinates(int p_i1354_1_, int p_i1354_2_, int p_i1354_3_) { + this.posX = p_i1354_1_; + this.posY = p_i1354_2_; + this.posZ = p_i1354_3_; + } + + public ChunkCoordinates(ChunkCoordinates p_i1355_1_) { + this.posX = p_i1355_1_.posX; + this.posY = p_i1355_1_.posY; + this.posZ = p_i1355_1_.posZ; + } + + public boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof ChunkCoordinates)) { + return false; + } else { + ChunkCoordinates var2 = (ChunkCoordinates)p_equals_1_; + return this.posX == var2.posX && this.posY == var2.posY && this.posZ == var2.posZ; + } + } + + public int hashCode() { + return this.posX + this.posZ << 8 + this.posY << 16; + } + + public int compareTo(ChunkCoordinates p_compareTo_1_) { + return this.posY == p_compareTo_1_.posY ? (this.posZ == p_compareTo_1_.posZ ? this.posX - p_compareTo_1_.posX : this.posZ - p_compareTo_1_.posZ) : this.posY - p_compareTo_1_.posY; + } + + public void set(int p_71571_1_, int p_71571_2_, int p_71571_3_) { + this.posX = p_71571_1_; + this.posY = p_71571_2_; + this.posZ = p_71571_3_; + } + + /** + * Returns the squared distance between this coordinates and the coordinates given as argument. + */ + public float getDistanceSquared(int p_71569_1_, int p_71569_2_, int p_71569_3_) { + float var4 = (float)(this.posX - p_71569_1_); + float var5 = (float)(this.posY - p_71569_2_); + float var6 = (float)(this.posZ - p_71569_3_); + return var4 * var4 + var5 * var5 + var6 * var6; + } + + /** + * Return the squared distance between this coordinates and the ChunkCoordinates given as argument. + */ + public float getDistanceSquaredToChunkCoordinates(ChunkCoordinates p_82371_1_) { + return this.getDistanceSquared(p_82371_1_.posX, p_82371_1_.posY, p_82371_1_.posZ); + } + + public String toString() { + return "Pos{x=" + this.posX + ", y=" + this.posY + ", z=" + this.posZ + '}'; + } + + public int compareTo(Object p_compareTo_1_) { + return this.compareTo((ChunkCoordinates)p_compareTo_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CombatEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CombatEntry.java new file mode 100644 index 0000000..f099cc7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CombatEntry.java @@ -0,0 +1,49 @@ +package net.minecraft.util; + +import net.minecraft.entity.EntityLivingBase; + +public class CombatEntry { + private final DamageSource damageSrc; + private final int field_94567_b; + private final float field_94568_c; + private final float field_94565_d; + private final String field_94566_e; + private final float field_94564_f; + + + public CombatEntry(DamageSource p_i1564_1_, int p_i1564_2_, float p_i1564_3_, float p_i1564_4_, String p_i1564_5_, float p_i1564_6_) { + this.damageSrc = p_i1564_1_; + this.field_94567_b = p_i1564_2_; + this.field_94568_c = p_i1564_4_; + this.field_94565_d = p_i1564_3_; + this.field_94566_e = p_i1564_5_; + this.field_94564_f = p_i1564_6_; + } + + /** + * Get the DamageSource of the CombatEntry instance. + */ + public DamageSource getDamageSrc() { + return this.damageSrc; + } + + public float func_94563_c() { + return this.field_94568_c; + } + + public boolean func_94559_f() { + return this.damageSrc.getEntity() instanceof EntityLivingBase; + } + + public String func_94562_g() { + return this.field_94566_e; + } + + public IChatComponent func_151522_h() { + return this.getDamageSrc().getEntity() == null ? null : this.getDamageSrc().getEntity().func_145748_c_(); + } + + public float func_94561_i() { + return this.damageSrc == DamageSource.outOfWorld ? Float.MAX_VALUE : this.field_94564_f; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CombatTracker.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CombatTracker.java new file mode 100644 index 0000000..f631b8d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CombatTracker.java @@ -0,0 +1,194 @@ +package net.minecraft.util; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class CombatTracker { + /** The CombatEntry objects that we've tracked so far. */ + private final List combatEntries = new ArrayList(); + + /** The entity tracked. */ + private final EntityLivingBase fighter; + private int field_94555_c; + private int field_152775_d; + private int field_152776_e; + private boolean field_94552_d; + private boolean field_94553_e; + private String field_94551_f; + + + public CombatTracker(EntityLivingBase p_i1565_1_) { + this.fighter = p_i1565_1_; + } + + public void func_94545_a() { + this.func_94542_g(); + + if (this.fighter.isOnLadder()) { + Block var1 = this.fighter.worldObj.getBlock(MathHelper.floor_double(this.fighter.posX), MathHelper.floor_double(this.fighter.boundingBox.minY), MathHelper.floor_double(this.fighter.posZ)); + + if (var1 == Blocks.ladder) { + this.field_94551_f = "ladder"; + } else if (var1 == Blocks.vine) { + this.field_94551_f = "vines"; + } + } else if (this.fighter.isInWater()) { + this.field_94551_f = "water"; + } + } + + public void func_94547_a(DamageSource p_94547_1_, float p_94547_2_, float p_94547_3_) { + this.func_94549_h(); + this.func_94545_a(); + CombatEntry var4 = new CombatEntry(p_94547_1_, this.fighter.ticksExisted, p_94547_2_, p_94547_3_, this.field_94551_f, this.fighter.fallDistance); + this.combatEntries.add(var4); + this.field_94555_c = this.fighter.ticksExisted; + this.field_94553_e = true; + + if (var4.func_94559_f() && !this.field_94552_d && this.fighter.isEntityAlive()) { + this.field_94552_d = true; + this.field_152775_d = this.fighter.ticksExisted; + this.field_152776_e = this.field_152775_d; + this.fighter.func_152111_bt(); + } + } + + public IChatComponent func_151521_b() { + if (this.combatEntries.size() == 0) { + return new ChatComponentTranslation("death.attack.generic", this.fighter.func_145748_c_()); + } else { + CombatEntry var1 = this.func_94544_f(); + CombatEntry var2 = (CombatEntry)this.combatEntries.get(this.combatEntries.size() - 1); + IChatComponent var4 = var2.func_151522_h(); + Entity var5 = var2.getDamageSrc().getEntity(); + Object var3; + + if (var1 != null && var2.getDamageSrc() == DamageSource.fall) { + IChatComponent var6 = var1.func_151522_h(); + + if (var1.getDamageSrc() != DamageSource.fall && var1.getDamageSrc() != DamageSource.outOfWorld) { + if (var6 != null && (var4 == null || !var6.equals(var4))) { + Entity var9 = var1.getDamageSrc().getEntity(); + ItemStack var8 = var9 instanceof EntityLivingBase ? ((EntityLivingBase)var9).getHeldItem() : null; + + if (var8 != null && var8.hasDisplayName()) { + var3 = new ChatComponentTranslation("death.fell.assist.item", this.fighter.func_145748_c_(), var6, var8.func_151000_E()); + } else { + var3 = new ChatComponentTranslation("death.fell.assist", this.fighter.func_145748_c_(), var6); + } + } else if (var4 != null) { + ItemStack var7 = var5 instanceof EntityLivingBase ? ((EntityLivingBase)var5).getHeldItem() : null; + + if (var7 != null && var7.hasDisplayName()) { + var3 = new ChatComponentTranslation("death.fell.finish.item", this.fighter.func_145748_c_(), var4, var7.func_151000_E()); + } else { + var3 = new ChatComponentTranslation("death.fell.finish", this.fighter.func_145748_c_(), var4); + } + } else { + var3 = new ChatComponentTranslation("death.fell.killer", this.fighter.func_145748_c_()); + } + } else { + var3 = new ChatComponentTranslation("death.fell.accident." + this.func_94548_b(var1), this.fighter.func_145748_c_()); + } + } else { + var3 = var2.getDamageSrc().func_151519_b(this.fighter); + } + + return (IChatComponent)var3; + } + } + + public EntityLivingBase func_94550_c() { + EntityLivingBase var1 = null; + EntityPlayer var2 = null; + float var3 = 0.0F; + float var4 = 0.0F; + Iterator var5 = this.combatEntries.iterator(); + + while (var5.hasNext()) { + CombatEntry var6 = (CombatEntry)var5.next(); + + if (var6.getDamageSrc().getEntity() instanceof EntityPlayer && (var2 == null || var6.func_94563_c() > var4)) { + var4 = var6.func_94563_c(); + var2 = (EntityPlayer)var6.getDamageSrc().getEntity(); + } + + if (var6.getDamageSrc().getEntity() instanceof EntityLivingBase && (var1 == null || var6.func_94563_c() > var3)) { + var3 = var6.func_94563_c(); + var1 = (EntityLivingBase)var6.getDamageSrc().getEntity(); + } + } + + if (var2 != null && var4 >= var3 / 3.0F) { + return var2; + } else { + return var1; + } + } + + private CombatEntry func_94544_f() { + CombatEntry var1 = null; + CombatEntry var2 = null; + byte var3 = 0; + float var4 = 0.0F; + + for (int var5 = 0; var5 < this.combatEntries.size(); ++var5) { + CombatEntry var6 = (CombatEntry)this.combatEntries.get(var5); + CombatEntry var7 = var5 > 0 ? (CombatEntry)this.combatEntries.get(var5 - 1) : null; + + if ((var6.getDamageSrc() == DamageSource.fall || var6.getDamageSrc() == DamageSource.outOfWorld) && var6.func_94561_i() > 0.0F && (var1 == null || var6.func_94561_i() > var4)) { + if (var5 > 0) { + var1 = var7; + } else { + var1 = var6; + } + + var4 = var6.func_94561_i(); + } + + if (var6.func_94562_g() != null && (var2 == null || var6.func_94563_c() > (float)var3)) { + var2 = var6; + } + } + + if (var4 > 5.0F && var1 != null) { + return var1; + } else if (var3 > 5 && var2 != null) { + return var2; + } else { + return null; + } + } + + private String func_94548_b(CombatEntry p_94548_1_) { + return p_94548_1_.func_94562_g() == null ? "generic" : p_94548_1_.func_94562_g(); + } + + private void func_94542_g() { + this.field_94551_f = null; + } + + public void func_94549_h() { + int var1 = this.field_94552_d ? 300 : 100; + + if (this.field_94553_e && (!this.fighter.isEntityAlive() || this.fighter.ticksExisted - this.field_94555_c > var1)) { + boolean var2 = this.field_94552_d; + this.field_94553_e = false; + this.field_94552_d = false; + this.field_152776_e = this.fighter.ticksExisted; + + if (var2) { + this.fighter.func_152112_bu(); + } + + this.combatEntries.clear(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CryptManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CryptManager.java new file mode 100644 index 0000000..8abac4b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/CryptManager.java @@ -0,0 +1,168 @@ +package net.minecraft.util; + +import java.io.UnsupportedEncodingException; +import java.security.GeneralSecurityException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.KeyGenerator; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class CryptManager { + + + /** + * Generate a new shared secret AES key from a secure random source + */ + public static SecretKey createNewSharedKey() { + try { + KeyGenerator var0 = KeyGenerator.getInstance("AES"); + var0.init(128); + return var0.generateKey(); + } catch (NoSuchAlgorithmException var1) { + throw new Error(var1); + } + } + + public static KeyPair createNewKeyPair() { + try { + KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA"); + var0.initialize(1024); + return var0.generateKeyPair(); + } catch (NoSuchAlgorithmException var1) { + var1.printStackTrace(); + System.err.println("Key pair generation failed!"); + return null; + } + } + + /** + * Compute a serverId hash for use by sendSessionRequest() + */ + public static byte[] getServerIdHash(String p_75895_0_, PublicKey p_75895_1_, SecretKey p_75895_2_) { + try { + return digestOperation("SHA-1", p_75895_0_.getBytes("ISO_8859_1"), p_75895_2_.getEncoded(), p_75895_1_.getEncoded()); + } catch (UnsupportedEncodingException var4) { + var4.printStackTrace(); + return null; + } + } + + /** + * Compute a message digest on arbitrary byte[] data + */ + private static byte[] digestOperation(String p_75893_0_, byte[] ... p_75893_1_) { + try { + MessageDigest var2 = MessageDigest.getInstance(p_75893_0_); + byte[][] var3 = p_75893_1_; + int var4 = p_75893_1_.length; + + for (int var5 = 0; var5 < var4; ++var5) { + byte[] var6 = var3[var5]; + var2.update(var6); + } + + return var2.digest(); + } catch (NoSuchAlgorithmException var7) { + var7.printStackTrace(); + return null; + } + } + + /** + * Create a new PublicKey from encoded X.509 data + */ + public static PublicKey decodePublicKey(byte[] p_75896_0_) { + try { + X509EncodedKeySpec var1 = new X509EncodedKeySpec(p_75896_0_); + KeyFactory var2 = KeyFactory.getInstance("RSA"); + return var2.generatePublic(var1); + } catch (NoSuchAlgorithmException var3) { + } catch (InvalidKeySpecException var4) { + } + + System.err.println("Public key reconstitute failed!"); + return null; + } + + /** + * Decrypt shared secret AES key using RSA private key + */ + public static SecretKey decryptSharedKey(PrivateKey p_75887_0_, byte[] p_75887_1_) { + return new SecretKeySpec(decryptData(p_75887_0_, p_75887_1_), "AES"); + } + + /** + * Encrypt byte[] data with RSA public key + */ + public static byte[] encryptData(Key p_75894_0_, byte[] p_75894_1_) { + return cipherOperation(1, p_75894_0_, p_75894_1_); + } + + /** + * Decrypt byte[] data with RSA private key + */ + public static byte[] decryptData(Key p_75889_0_, byte[] p_75889_1_) { + return cipherOperation(2, p_75889_0_, p_75889_1_); + } + + /** + * Encrypt or decrypt byte[] data using the specified key + */ + private static byte[] cipherOperation(int p_75885_0_, Key p_75885_1_, byte[] p_75885_2_) { + try { + return createTheCipherInstance(p_75885_0_, p_75885_1_.getAlgorithm(), p_75885_1_).doFinal(p_75885_2_); + } catch (IllegalBlockSizeException var4) { + var4.printStackTrace(); + } catch (BadPaddingException var5) { + var5.printStackTrace(); + } + + System.err.println("Cipher data failed!"); + return null; + } + + /** + * Creates the Cipher Instance. + */ + private static Cipher createTheCipherInstance(int p_75886_0_, String p_75886_1_, Key p_75886_2_) { + try { + Cipher var3 = Cipher.getInstance(p_75886_1_); + var3.init(p_75886_0_, p_75886_2_); + return var3; + } catch (InvalidKeyException var4) { + var4.printStackTrace(); + } catch (NoSuchAlgorithmException var5) { + var5.printStackTrace(); + } catch (NoSuchPaddingException var6) { + var6.printStackTrace(); + } + + System.err.println("Cipher creation failed!"); + return null; + } + + public static Cipher func_151229_a(int p_151229_0_, Key p_151229_1_) { + try { + Cipher var2 = Cipher.getInstance("AES/CFB8/NoPadding"); + var2.init(p_151229_0_, p_151229_1_, new IvParameterSpec(p_151229_1_.getEncoded())); + return var2; + } catch (GeneralSecurityException var3) { + throw new RuntimeException(var3); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/DamageSource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/DamageSource.java new file mode 100644 index 0000000..863a92a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/DamageSource.java @@ -0,0 +1,232 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.world.Explosion; + +public class DamageSource { + public static DamageSource inFire = (new DamageSource("inFire")).setFireDamage(); + public static DamageSource onFire = (new DamageSource("onFire")).setDamageBypassesArmor().setFireDamage(); + public static DamageSource lava = (new DamageSource("lava")).setFireDamage(); + public static DamageSource inWall = (new DamageSource("inWall")).setDamageBypassesArmor(); + public static DamageSource drown = (new DamageSource("drown")).setDamageBypassesArmor(); + public static DamageSource starve = (new DamageSource("starve")).setDamageBypassesArmor().setDamageIsAbsolute(); + public static DamageSource cactus = new DamageSource("cactus"); + public static DamageSource fall = (new DamageSource("fall")).setDamageBypassesArmor(); + public static DamageSource outOfWorld = (new DamageSource("outOfWorld")).setDamageBypassesArmor().setDamageAllowedInCreativeMode(); + public static DamageSource generic = (new DamageSource("generic")).setDamageBypassesArmor(); + public static DamageSource magic = (new DamageSource("magic")).setDamageBypassesArmor().setMagicDamage(); + public static DamageSource wither = (new DamageSource("wither")).setDamageBypassesArmor(); + public static DamageSource anvil = new DamageSource("anvil"); + public static DamageSource fallingBlock = new DamageSource("fallingBlock"); + + /** This kind of damage can be blocked or not. */ + private boolean isUnblockable; + private boolean isDamageAllowedInCreativeMode; + + /** + * Whether or not the damage ignores modification by potion effects or enchantments. + */ + private boolean damageIsAbsolute; + private float hungerDamage = 0.3F; + + /** This kind of damage is based on fire or not. */ + private boolean fireDamage; + + /** This kind of damage is based on a projectile or not. */ + private boolean projectile; + + /** + * Whether this damage source will have its damage amount scaled based on the current difficulty. + */ + private boolean difficultyScaled; + private boolean magicDamage; + private boolean explosion; + public String damageType; + + + public static DamageSource causeMobDamage(EntityLivingBase p_76358_0_) { + return new EntityDamageSource("mob", p_76358_0_); + } + + /** + * returns an EntityDamageSource of type player + */ + public static DamageSource causePlayerDamage(EntityPlayer p_76365_0_) { + return new EntityDamageSource("player", p_76365_0_); + } + + /** + * returns EntityDamageSourceIndirect of an arrow + */ + public static DamageSource causeArrowDamage(EntityArrow p_76353_0_, Entity p_76353_1_) { + return (new EntityDamageSourceIndirect("arrow", p_76353_0_, p_76353_1_)).setProjectile(); + } + + /** + * returns EntityDamageSourceIndirect of a fireball + */ + public static DamageSource causeFireballDamage(EntityFireball p_76362_0_, Entity p_76362_1_) { + return p_76362_1_ == null ? (new EntityDamageSourceIndirect("onFire", p_76362_0_, p_76362_0_)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", p_76362_0_, p_76362_1_)).setFireDamage().setProjectile(); + } + + public static DamageSource causeThrownDamage(Entity p_76356_0_, Entity p_76356_1_) { + return (new EntityDamageSourceIndirect("thrown", p_76356_0_, p_76356_1_)).setProjectile(); + } + + public static DamageSource causeIndirectMagicDamage(Entity p_76354_0_, Entity p_76354_1_) { + return (new EntityDamageSourceIndirect("indirectMagic", p_76354_0_, p_76354_1_)).setDamageBypassesArmor().setMagicDamage(); + } + + /** + * Returns the EntityDamageSource of the Thorns enchantment + */ + public static DamageSource causeThornsDamage(Entity p_92087_0_) { + return (new EntityDamageSource("thorns", p_92087_0_)).setMagicDamage(); + } + + public static DamageSource setExplosionSource(Explosion p_94539_0_) { + return p_94539_0_ != null && p_94539_0_.getExplosivePlacedBy() != null ? (new EntityDamageSource("explosion.player", p_94539_0_.getExplosivePlacedBy())).setDifficultyScaled().setExplosion() : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); + } + + /** + * Returns true if the damage is projectile based. + */ + public boolean isProjectile() { + return this.projectile; + } + + /** + * Define the damage type as projectile based. + */ + public DamageSource setProjectile() { + this.projectile = true; + return this; + } + + public boolean isExplosion() { + return this.explosion; + } + + public DamageSource setExplosion() { + this.explosion = true; + return this; + } + + public boolean isUnblockable() { + return this.isUnblockable; + } + + /** + * How much satiate(food) is consumed by this DamageSource + */ + public float getHungerDamage() { + return this.hungerDamage; + } + + public boolean canHarmInCreative() { + return this.isDamageAllowedInCreativeMode; + } + + /** + * Whether or not the damage ignores modification by potion effects or enchantments. + */ + public boolean isDamageAbsolute() { + return this.damageIsAbsolute; + } + + protected DamageSource(String p_i1566_1_) { + this.damageType = p_i1566_1_; + } + + public Entity getSourceOfDamage() { + return this.getEntity(); + } + + public Entity getEntity() { + return null; + } + + protected DamageSource setDamageBypassesArmor() { + this.isUnblockable = true; + this.hungerDamage = 0.0F; + return this; + } + + protected DamageSource setDamageAllowedInCreativeMode() { + this.isDamageAllowedInCreativeMode = true; + return this; + } + + /** + * Sets a value indicating whether the damage is absolute (ignores modification by potion effects or enchantments), + * and also clears out hunger damage. + */ + protected DamageSource setDamageIsAbsolute() { + this.damageIsAbsolute = true; + this.hungerDamage = 0.0F; + return this; + } + + /** + * Define the damage type as fire based. + */ + protected DamageSource setFireDamage() { + this.fireDamage = true; + return this; + } + + public IChatComponent func_151519_b(EntityLivingBase p_151519_1_) { + EntityLivingBase var2 = p_151519_1_.func_94060_bK(); + String var3 = "death.attack." + this.damageType; + String var4 = var3 + ".player"; + return var2 != null && StatCollector.canTranslate(var4) ? new ChatComponentTranslation(var4, p_151519_1_.func_145748_c_(), var2.func_145748_c_()): new ChatComponentTranslation(var3, p_151519_1_.func_145748_c_()); + } + + /** + * Returns true if the damage is fire based. + */ + public boolean isFireDamage() { + return this.fireDamage; + } + + /** + * Return the name of damage type. + */ + public String getDamageType() { + return this.damageType; + } + + /** + * Set whether this damage source will have its damage amount scaled based on the current difficulty. + */ + public DamageSource setDifficultyScaled() { + this.difficultyScaled = true; + return this; + } + + /** + * Return whether this damage source will have its damage amount scaled based on the current difficulty. + */ + public boolean isDifficultyScaled() { + return this.difficultyScaled; + } + + /** + * Returns true if the damage is magic based. + */ + public boolean isMagicDamage() { + return this.magicDamage; + } + + /** + * Define the damage type as magic based. + */ + public DamageSource setMagicDamage() { + this.magicDamage = true; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Direction.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Direction.java new file mode 100644 index 0000000..f5b3a93 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Direction.java @@ -0,0 +1,31 @@ +package net.minecraft.util; + +public class Direction { + public static final int[] offsetX = new int[] {0, -1, 0, 1}; + public static final int[] offsetZ = new int[] {1, 0, -1, 0}; + public static final String[] directions = new String[] {"SOUTH", "WEST", "NORTH", "EAST"}; + + /** Maps a Direction value (2D) to a Facing value (3D). */ + public static final int[] directionToFacing = new int[] {3, 4, 2, 5}; + + /** Maps a Facing value (3D) to a Direction value (2D). */ + public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3}; + + /** Maps a direction to that opposite of it. */ + public static final int[] rotateOpposite = new int[] {2, 3, 0, 1}; + + /** Maps a direction to that to the right of it. */ + public static final int[] rotateRight = new int[] {1, 2, 3, 0}; + + /** Maps a direction to that to the left of it. */ + public static final int[] rotateLeft = new int[] {3, 0, 1, 2}; + public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; + + + /** + * Returns the movement direction from a velocity vector. + */ + public static int getMovementDirection(double p_82372_0_, double p_82372_2_) { + return MathHelper.abs((float)p_82372_0_) > MathHelper.abs((float)p_82372_2_) ? (p_82372_0_ > 0.0D ? 1 : 3) : (p_82372_2_ > 0.0D ? 2 : 0); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnchantmentNameParts.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnchantmentNameParts.java new file mode 100644 index 0000000..7a1d459 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnchantmentNameParts.java @@ -0,0 +1,35 @@ +package net.minecraft.util; + +import java.util.Random; + +public class EnchantmentNameParts { + public static final EnchantmentNameParts instance = new EnchantmentNameParts(); + private final Random rand = new Random(); + private final String[] namePartsArray = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); + + + /** + * Randomly generates a new name built up of 3 or 4 randomly selected words. + */ + public String generateNewRandomName() { + int var1 = this.rand.nextInt(2) + 3; + String var2 = ""; + + for (int var3 = 0; var3 < var1; ++var3) { + if (var3 > 0) { + var2 = var2 + " "; + } + + var2 = var2 + this.namePartsArray[this.rand.nextInt(this.namePartsArray.length)]; + } + + return var2; + } + + /** + * Resets the underlying random number generator using a given seed. + */ + public void reseedRandomGenerator(long p_148335_1_) { + this.rand.setSeed(p_148335_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EntityDamageSource.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EntityDamageSource.java new file mode 100644 index 0000000..30e7a19 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EntityDamageSource.java @@ -0,0 +1,34 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class EntityDamageSource extends DamageSource { + protected Entity damageSourceEntity; + + + public EntityDamageSource(String p_i1567_1_, Entity p_i1567_2_) { + super(p_i1567_1_); + this.damageSourceEntity = p_i1567_2_; + } + + public Entity getEntity() { + return this.damageSourceEntity; + } + + public IChatComponent func_151519_b(EntityLivingBase p_151519_1_) { + ItemStack var2 = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItem() : null; + String var3 = "death.attack." + this.damageType; + String var4 = var3 + ".item"; + return var2 != null && var2.hasDisplayName() && StatCollector.canTranslate(var4) ? new ChatComponentTranslation(var4, p_151519_1_.func_145748_c_(), this.damageSourceEntity.func_145748_c_(), var2.func_151000_E()): new ChatComponentTranslation(var3, p_151519_1_.func_145748_c_(), this.damageSourceEntity.func_145748_c_()); + } + + /** + * Return whether this damage source will have its damage amount scaled based on the current difficulty. + */ + public boolean isDifficultyScaled() { + return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLivingBase && !(this.damageSourceEntity instanceof EntityPlayer); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java new file mode 100644 index 0000000..50cc259 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EntityDamageSourceIndirect.java @@ -0,0 +1,31 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +public class EntityDamageSourceIndirect extends EntityDamageSource { + private final Entity indirectEntity; + + + public EntityDamageSourceIndirect(String p_i1568_1_, Entity p_i1568_2_, Entity p_i1568_3_) { + super(p_i1568_1_, p_i1568_2_); + this.indirectEntity = p_i1568_3_; + } + + public Entity getSourceOfDamage() { + return this.damageSourceEntity; + } + + public Entity getEntity() { + return this.indirectEntity; + } + + public IChatComponent func_151519_b(EntityLivingBase p_151519_1_) { + IChatComponent var2 = this.indirectEntity == null ? this.damageSourceEntity.func_145748_c_() : this.indirectEntity.func_145748_c_(); + ItemStack var3 = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItem() : null; + String var4 = "death.attack." + this.damageType; + String var5 = var4 + ".item"; + return var3 != null && var3.hasDisplayName() && StatCollector.canTranslate(var5) ? new ChatComponentTranslation(var5, p_151519_1_.func_145748_c_(), var2, var3.func_151000_E()): new ChatComponentTranslation(var4, p_151519_1_.func_145748_c_(), var2); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumChatFormatting.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumChatFormatting.java new file mode 100644 index 0000000..19e5721 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumChatFormatting.java @@ -0,0 +1,171 @@ +package net.minecraft.util; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public enum EnumChatFormatting { + BLACK('0'), + DARK_BLUE('1'), + DARK_GREEN('2'), + DARK_AQUA('3'), + DARK_RED('4'), + DARK_PURPLE('5'), + GOLD('6'), + GRAY('7'), + DARK_GRAY('8'), + BLUE('9'), + GREEN('a'), + AQUA('b'), + RED('c'), + LIGHT_PURPLE('d'), + YELLOW('e'), + WHITE('f'), + OBFUSCATED('k', true), + BOLD('l', true), + STRIKETHROUGH('m', true), + UNDERLINE('n', true), + ITALIC('o', true), + RESET('r'); + + /** + * Maps a formatting code (e.g., 'f') to its corresponding enum value (e.g., WHITE). + */ + private static final Map formattingCodeMapping = new HashMap(); + + /** + * Maps a name (e.g., 'underline') to its corresponding enum value (e.g., UNDERLINE). + */ + private static final Map nameMapping = new HashMap(); + + /** + * Matches formatting codes that indicate that the client should treat the following text as bold, recolored, + * obfuscated, etc. + */ + private static final Pattern formattingCodePattern = Pattern.compile("(?i)" + '\u00a7' + "[0-9A-FK-OR]"); + private static final Pattern formattingCodePatternReversed = Pattern.compile("[0-9A-FK-OR]" + '\u00a7' + "(?i)"); + + + /** The formatting code that produces this format. */ + private final char formattingCode; + private final boolean fancyStyling; + + /** + * The control string (section sign + formatting code) that can be inserted into com.cheatbreaker.client-side text to display + * subsequent text in this format. + */ + private final String controlString; + + /** + * CheatBreaker - Matches formatting codes that indicate that the client should treat the following text as recolored. + */ + private static final Pattern CBformattingCodePattern = Pattern.compile("(?i)" + '§' + "[0-9A-FR]"); + + + EnumChatFormatting(char p_i1336_3_) { + this(p_i1336_3_, false); + } + + EnumChatFormatting(char p_i1337_3_, boolean p_i1337_4_) { + this.formattingCode = p_i1337_3_; + this.fancyStyling = p_i1337_4_; + this.controlString = "\u00a7" + p_i1337_3_; + } + + /** + * Gets the formatting code that produces this format. + */ + public char getFormattingCode() { + return this.formattingCode; + } + + /** + * False if this is just changing the color or resetting; true otherwise. + */ + public boolean isFancyStyling() { + return this.fancyStyling; + } + + /** + * Checks if typo is a color. + */ + public boolean isColor() { + return !this.fancyStyling && this != RESET; + } + + /** + * Gets the friendly name of this value. + */ + public String getFriendlyName() { + return this.name().toLowerCase(); + } + + public String toString() { + return this.controlString; + } + + /** + * Returns a copy of the given string, with formatting codes stripped away. + */ + public static String getTextWithoutFormattingCodes(String p_110646_0_) { + return p_110646_0_ == null ? null : formattingCodePattern.matcher(p_110646_0_).replaceAll(""); + } + + /** + * Returns a copy of the given string, with formatting codes stripped away. + */ + public static String getTextWithoutFormattingCodesReversed(String p_110646_0_) { + return p_110646_0_ == null ? null : formattingCodePattern.matcher(p_110646_0_).replaceAll(""); + } + + + /** + * Gets a value by its friendly name; null if the given name does not map to a defined value. + */ + public static EnumChatFormatting getValueByName(String p_96300_0_) { + return p_96300_0_ == null ? null : (EnumChatFormatting)nameMapping.get(p_96300_0_.toLowerCase()); + } + + /** + * Gets all the valid values. Args: @param par0: Whether or not to include color values. @param par1: Whether or not + * to include fancy-styling values (anything that isn't a color value or the "reset" value). + */ + public static Collection getValidValues(boolean p_96296_0_, boolean p_96296_1_) { + ArrayList var2 = new ArrayList(); + EnumChatFormatting[] var3 = values(); + int var4 = var3.length; + + for (int var5 = 0; var5 < var4; ++var5) { + EnumChatFormatting var6 = var3[var5]; + + if ((!var6.isColor() || p_96296_0_) && (!var6.isFancyStyling() || p_96296_1_)) { + var2.add(var6.getFriendlyName()); + } + } + + return var2; + } + + static { + EnumChatFormatting[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + EnumChatFormatting var3 = var0[var2]; + formattingCodeMapping.put(Character.valueOf(var3.getFormattingCode()), var3); + nameMapping.put(var3.getFriendlyName(), var3); + } + } + + public static String formatColor(String input) { + Matcher matcher = CBformattingCodePattern.matcher(input); + String group = ""; + while (matcher.find()) { + group = matcher.group(); + } + return group; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumFacing.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumFacing.java new file mode 100644 index 0000000..1f35e48 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumFacing.java @@ -0,0 +1,66 @@ +package net.minecraft.util; + +public enum EnumFacing { + DOWN(0, 1, 0, -1, 0), + UP(1, 0, 0, 1, 0), + NORTH(2, 3, 0, 0, -1), + SOUTH(3, 2, 0, 0, 1), + EAST(4, 5, -1, 0, 0), + WEST(5, 4, 1, 0, 0); + + /** Face order for D-U-N-S-E-W. */ + private final int order_a; + + /** Face order for U-D-S-N-W-E. */ + private final int order_b; + private final int frontOffsetX; + private final int frontOffsetY; + private final int frontOffsetZ; + + /** List of all values in EnumFacing. Order is D-U-N-S-E-W. */ + private static final EnumFacing[] faceList = new EnumFacing[6]; + + + EnumFacing(int p_i1367_3_, int p_i1367_4_, int p_i1367_5_, int p_i1367_6_, int p_i1367_7_) { + this.order_a = p_i1367_3_; + this.order_b = p_i1367_4_; + this.frontOffsetX = p_i1367_5_; + this.frontOffsetY = p_i1367_6_; + this.frontOffsetZ = p_i1367_7_; + } + + /** + * Returns a offset that addresses the block in front of this facing. + */ + public int getFrontOffsetX() { + return this.frontOffsetX; + } + + public int getFrontOffsetY() { + return this.frontOffsetY; + } + + /** + * Returns a offset that addresses the block in front of this facing. + */ + public int getFrontOffsetZ() { + return this.frontOffsetZ; + } + + /** + * Returns the facing that represents the block in front of it. + */ + public static EnumFacing getFront(int p_82600_0_) { + return faceList[p_82600_0_ % faceList.length]; + } + + static { + EnumFacing[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + EnumFacing var3 = var0[var2]; + faceList[var3.order_a] = var3; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumTypeAdapterFactory.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumTypeAdapterFactory.java new file mode 100644 index 0000000..70ea16f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/EnumTypeAdapterFactory.java @@ -0,0 +1,56 @@ +package net.minecraft.util; + +import com.google.gson.Gson; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonToken; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Locale; + +public class EnumTypeAdapterFactory implements TypeAdapterFactory { + + + public TypeAdapter create(Gson p_create_1_, TypeToken p_create_2_) { + Class var3 = p_create_2_.getRawType(); + + if (!var3.isEnum()) { + return null; + } else { + final HashMap var4 = new HashMap(); + Object[] var5 = var3.getEnumConstants(); + int var6 = var5.length; + + for (int var7 = 0; var7 < var6; ++var7) { + Object var8 = var5[var7]; + var4.put(this.func_151232_a(var8), var8); + } + + return new TypeAdapter() { + + public void write(JsonWriter p_write_1_, Object p_write_2_) throws IOException { + if (p_write_2_ == null) { + p_write_1_.nullValue(); + } else { + p_write_1_.value(EnumTypeAdapterFactory.this.func_151232_a(p_write_2_)); + } + } + public Object read(JsonReader p_read_1_) throws IOException { + if (p_read_1_.peek() == JsonToken.NULL) { + p_read_1_.nextNull(); + return null; + } else { + return var4.get(p_read_1_.nextString()); + } + } + }; + } + } + + private String func_151232_a(Object p_151232_1_) { + return p_151232_1_ instanceof Enum ? ((Enum)p_151232_1_).name().toLowerCase(Locale.US) : p_151232_1_.toString().toLowerCase(Locale.US); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Facing.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Facing.java new file mode 100644 index 0000000..f9f62b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Facing.java @@ -0,0 +1,25 @@ +package net.minecraft.util; + +public class Facing { + /** + * Converts a side to the opposite side. This is the same as XOR'ing it with 1. + */ + public static final int[] oppositeSide = new int[] {1, 0, 3, 2, 5, 4}; + + /** + * gives the offset required for this axis to get the block at that side. + */ + public static final int[] offsetsXForSide = new int[] {0, 0, 0, 0, -1, 1}; + + /** + * gives the offset required for this axis to get the block at that side. + */ + public static final int[] offsetsYForSide = new int[] { -1, 1, 0, 0, 0, 0}; + + /** + * gives the offset required for this axis to get the block at that side. + */ + public static final int[] offsetsZForSide = new int[] {0, 0, -1, 1, 0, 0}; + public static final String[] facings = new String[] {"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"}; + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/FoodStats.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/FoodStats.java new file mode 100644 index 0000000..cd55b0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/FoodStats.java @@ -0,0 +1,137 @@ +package net.minecraft.util; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.EnumDifficulty; + +public class FoodStats { + /** The player's food level. */ + private int foodLevel = 20; + + /** The player's food saturation. */ + private float foodSaturationLevel = 5.0F; + + /** The player's food exhaustion. */ + private float foodExhaustionLevel; + + /** The player's food timer value. */ + private int foodTimer; + private int prevFoodLevel = 20; + + + /** + * Args: int foodLevel, float foodSaturationModifier + */ + public void addStats(int p_75122_1_, float p_75122_2_) { + this.foodLevel = Math.min(p_75122_1_ + this.foodLevel, 20); + this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)p_75122_1_ * p_75122_2_ * 2.0F, (float)this.foodLevel); + } + + public void func_151686_a(ItemFood p_151686_1_, ItemStack p_151686_2_) { + this.addStats(p_151686_1_.func_150905_g(p_151686_2_), p_151686_1_.func_150906_h(p_151686_2_)); + } + + /** + * Handles the food game logic. + */ + public void onUpdate(EntityPlayer p_75118_1_) { + EnumDifficulty var2 = p_75118_1_.worldObj.difficultySetting; + this.prevFoodLevel = this.foodLevel; + + if (this.foodExhaustionLevel > 4.0F) { + this.foodExhaustionLevel -= 4.0F; + + if (this.foodSaturationLevel > 0.0F) { + this.foodSaturationLevel = Math.max(this.foodSaturationLevel - 1.0F, 0.0F); + } else if (var2 != EnumDifficulty.PEACEFUL) { + this.foodLevel = Math.max(this.foodLevel - 1, 0); + } + } + + if (p_75118_1_.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.foodLevel >= 18 && p_75118_1_.shouldHeal()) { + ++this.foodTimer; + + if (this.foodTimer >= 80) { + p_75118_1_.heal(1.0F); + this.addExhaustion(3.0F); + this.foodTimer = 0; + } + } else if (this.foodLevel <= 0) { + ++this.foodTimer; + + if (this.foodTimer >= 80) { + if (p_75118_1_.getHealth() > 10.0F || var2 == EnumDifficulty.HARD || p_75118_1_.getHealth() > 1.0F && var2 == EnumDifficulty.NORMAL) { + p_75118_1_.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.foodTimer = 0; + } + } else { + this.foodTimer = 0; + } + } + + /** + * Reads food stats from an NBT object. + */ + public void readNBT(NBTTagCompound p_75112_1_) { + if (p_75112_1_.func_150297_b("foodLevel", 99)) { + this.foodLevel = p_75112_1_.getInteger("foodLevel"); + this.foodTimer = p_75112_1_.getInteger("foodTickTimer"); + this.foodSaturationLevel = p_75112_1_.getFloat("foodSaturationLevel"); + this.foodExhaustionLevel = p_75112_1_.getFloat("foodExhaustionLevel"); + } + } + + /** + * Writes food stats to an NBT object. + */ + public void writeNBT(NBTTagCompound p_75117_1_) { + p_75117_1_.setInteger("foodLevel", this.foodLevel); + p_75117_1_.setInteger("foodTickTimer", this.foodTimer); + p_75117_1_.setFloat("foodSaturationLevel", this.foodSaturationLevel); + p_75117_1_.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); + } + + /** + * Get the player's food level. + */ + public int getFoodLevel() { + return this.foodLevel; + } + + public int getPrevFoodLevel() { + return this.prevFoodLevel; + } + + /** + * If foodLevel is not max. + */ + public boolean needFood() { + return this.foodLevel < 20; + } + + /** + * adds input to foodExhaustionLevel to a max of 40 + */ + public void addExhaustion(float p_75113_1_) { + this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + p_75113_1_, 40.0F); + } + + /** + * Get the player's food saturation level. + */ + public float getSaturationLevel() { + return this.foodSaturationLevel; + } + + public void setFoodLevel(int p_75114_1_) { + this.foodLevel = p_75114_1_; + } + + public void setFoodSaturationLevel(float p_75119_1_) { + this.foodSaturationLevel = p_75119_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/FrameTimer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/FrameTimer.java new file mode 100644 index 0000000..9590c4c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/FrameTimer.java @@ -0,0 +1,56 @@ +package net.minecraft.util; + +public class FrameTimer +{ + private final long[] frames = new long[240]; + private int lastIndex; + private int counter; + private int index; + + public void addFrame(long runningTime) + { + this.frames[this.index] = runningTime; + ++this.index; + + if (this.index == 240) + { + this.index = 0; + } + + if (this.counter < 240) + { + this.lastIndex = 0; + ++this.counter; + } + else + { + this.lastIndex = this.parseIndex(this.index + 1); + } + } + + public int getLagometerValue(long time, int multiplier) + { + double d0 = (double)time / 1.6666666E7D; + return (int)(d0 * (double)multiplier); + } + + public int getLastIndex() + { + return this.lastIndex; + } + + public int getIndex() + { + return this.index; + } + + public int parseIndex(int rawIndex) + { + return rawIndex % 240; + } + + public long[] getFrames() + { + return this.frames; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/HttpUtil.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/HttpUtil.java new file mode 100644 index 0000000..6d05bda --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/HttpUtil.java @@ -0,0 +1,269 @@ +package net.minecraft.util; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.Proxy; +import java.net.ServerSocket; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.atomic.AtomicInteger; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class HttpUtil { + /** The number of download threads that we have started so far. */ + private static final AtomicInteger downloadThreadsStarted = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + + + /** + * Builds an encoded HTTP POST content string from a string map + */ + public static String buildPostString(Map p_76179_0_) { + StringBuilder var1 = new StringBuilder(); + Iterator var2 = p_76179_0_.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + + if (var1.length() > 0) { + var1.append('&'); + } + + try { + var1.append(URLEncoder.encode((String)var3.getKey(), "UTF-8")); + } catch (UnsupportedEncodingException var6) { + var6.printStackTrace(); + } + + if (var3.getValue() != null) { + var1.append('='); + + try { + var1.append(URLEncoder.encode(var3.getValue().toString(), "UTF-8")); + } catch (UnsupportedEncodingException var5) { + var5.printStackTrace(); + } + } + } + + return var1.toString(); + } + + public static String func_151226_a(URL p_151226_0_, Map p_151226_1_, boolean p_151226_2_) { + return func_151225_a(p_151226_0_, buildPostString(p_151226_1_), p_151226_2_); + } + + private static String func_151225_a(URL p_151225_0_, String p_151225_1_, boolean p_151225_2_) { + try { + Proxy var3 = MinecraftServer.getServer() == null ? null : MinecraftServer.getServer().getServerProxy(); + + if (var3 == null) { + var3 = Proxy.NO_PROXY; + } + + HttpURLConnection var4 = (HttpURLConnection)p_151225_0_.openConnection(var3); + var4.setRequestMethod("POST"); + var4.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + var4.setRequestProperty("Content-Length", "" + p_151225_1_.getBytes().length); + var4.setRequestProperty("Content-Language", "en-US"); + var4.setUseCaches(false); + var4.setDoInput(true); + var4.setDoOutput(true); + DataOutputStream var5 = new DataOutputStream(var4.getOutputStream()); + var5.writeBytes(p_151225_1_); + var5.flush(); + var5.close(); + BufferedReader var6 = new BufferedReader(new InputStreamReader(var4.getInputStream())); + StringBuffer var8 = new StringBuffer(); + String var7; + + while ((var7 = var6.readLine()) != null) { + var8.append(var7); + var8.append('\r'); + } + + var6.close(); + return var8.toString(); + } catch (Exception var9) { + if (!p_151225_2_) { + logger.error("Could not post to " + p_151225_0_, var9); + } + + return ""; + } + } + + public static void func_151223_a(final File p_151223_0_, final String p_151223_1_, final HttpUtil.DownloadListener p_151223_2_, final Map p_151223_3_, final int p_151223_4_, final IProgressUpdate p_151223_5_, final Proxy p_151223_6_) { + Thread var7 = new Thread(new Runnable() { + + public void run() { + URLConnection var1 = null; + InputStream var2 = null; + DataOutputStream var3 = null; + + if (p_151223_5_ != null) { + p_151223_5_.resetProgressAndMessage("Downloading Texture Pack"); + p_151223_5_.resetProgresAndWorkingMessage("Making Request..."); + } + + try { + try { + byte[] var4 = new byte[4096]; + URL var5 = new URL(p_151223_1_); + var1 = var5.openConnection(p_151223_6_); + float var6 = 0.0F; + float var7 = (float)p_151223_3_.entrySet().size(); + Iterator var8 = p_151223_3_.entrySet().iterator(); + + while (var8.hasNext()) { + Entry var9 = (Entry)var8.next(); + var1.setRequestProperty((String)var9.getKey(), (String)var9.getValue()); + + if (p_151223_5_ != null) { + p_151223_5_.setLoadingProgress((int)(++var6 / var7 * 100.0F)); + } + } + + var2 = var1.getInputStream(); + var7 = (float)var1.getContentLength(); + int var28 = var1.getContentLength(); + + if (p_151223_5_ != null) { + p_151223_5_.resetProgresAndWorkingMessage(String.format("Downloading file (%.2f MB)...", Float.valueOf(var7 / 1000.0F / 1000.0F))); + } + + if (p_151223_0_.exists()) { + long var29 = p_151223_0_.length(); + + if (var29 == (long)var28) { + p_151223_2_.func_148522_a(p_151223_0_); + + if (p_151223_5_ != null) { + p_151223_5_.func_146586_a(); + } + + return; + } + + HttpUtil.logger.warn("Deleting " + p_151223_0_ + " as it does not match what we currently have (" + var28 + " vs our " + var29 + ")."); + p_151223_0_.delete(); + } else if (p_151223_0_.getParentFile() != null) { + p_151223_0_.getParentFile().mkdirs(); + } + + var3 = new DataOutputStream(new FileOutputStream(p_151223_0_)); + + if (p_151223_4_ > 0 && var7 > (float)p_151223_4_) { + if (p_151223_5_ != null) { + p_151223_5_.func_146586_a(); + } + + throw new IOException("Filesize is bigger than maximum allowed (file is " + var6 + ", limit is " + p_151223_4_ + ")"); + } + + boolean var30 = false; + int var31; + + while ((var31 = var2.read(var4)) >= 0) { + var6 += (float)var31; + + if (p_151223_5_ != null) { + p_151223_5_.setLoadingProgress((int)(var6 / var7 * 100.0F)); + } + + if (p_151223_4_ > 0 && var6 > (float)p_151223_4_) { + if (p_151223_5_ != null) { + p_151223_5_.func_146586_a(); + } + + throw new IOException("Filesize was bigger than maximum allowed (got >= " + var6 + ", limit was " + p_151223_4_ + ")"); + } + + var3.write(var4, 0, var31); + } + + p_151223_2_.func_148522_a(p_151223_0_); + + if (p_151223_5_ != null) { + p_151223_5_.func_146586_a(); + return; + } + } catch (Throwable var26) { + var26.printStackTrace(); + } + } + finally { + try { + if (var2 != null) { + var2.close(); + } + } catch (IOException var25) { + } + + try { + if (var3 != null) { + var3.close(); + } + } catch (IOException var24) { + } + } + } + }, "File Downloader #" + downloadThreadsStarted.incrementAndGet()); + var7.setDaemon(true); + var7.start(); + } + + public static int func_76181_a() throws IOException { + ServerSocket var0 = null; + boolean var1 = true; + int var10; + + try { + var0 = new ServerSocket(0); + var10 = var0.getLocalPort(); + } + finally { + try { + if (var0 != null) { + var0.close(); + } + } catch (IOException var8) { + } + } + + return var10; + } + + public static String func_152755_a(URL p_152755_0_) throws IOException { + HttpURLConnection var1 = (HttpURLConnection)p_152755_0_.openConnection(); + var1.setRequestMethod("GET"); + BufferedReader var2 = new BufferedReader(new InputStreamReader(var1.getInputStream())); + StringBuilder var4 = new StringBuilder(); + String var3; + + while ((var3 = var2.readLine()) != null) { + var4.append(var3); + var4.append('\r'); + } + + var2.close(); + return var4.toString(); + } + + public interface DownloadListener { + void func_148522_a(File p_148522_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IChatComponent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IChatComponent.java new file mode 100644 index 0000000..e95eca2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IChatComponent.java @@ -0,0 +1,230 @@ +package net.minecraft.util; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; + +public interface IChatComponent extends Iterable { + IChatComponent setChatStyle(ChatStyle p_150255_1_); + + ChatStyle getChatStyle(); + + /** + * Appends the given text to the end of this component. + */ + IChatComponent appendText(String p_150258_1_); + + /** + * Appends the given component to the end of this one. + */ + IChatComponent appendSibling(IChatComponent p_150257_1_); + + /** + * Gets the text of this component, without any special formatting codes added, for chat. TODO: why is this two + * different methods? + */ + String getUnformattedTextForChat(); + + /** + * Gets the text of this component, without any special formatting codes added. TODO: why is this two different + * methods? + */ + String getUnformattedText(); + + /** + * Gets the text of this component, with formatting codes added for rendering. + */ + String getFormattedText(); + + /** + * Gets the sibling components of this one. + */ + List getSiblings(); + + /** + * Creates a copy of this component. Almost a deep copy, except the style is shallow-copied. + */ + IChatComponent createCopy(); + + class Serializer implements JsonDeserializer, JsonSerializer { + private static final Gson field_150700_a; + + + public IChatComponent deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) { + if (p_deserialize_1_.isJsonPrimitive()) { + return new ChatComponentText(p_deserialize_1_.getAsString()); + } else if (!p_deserialize_1_.isJsonObject()) { + if (p_deserialize_1_.isJsonArray()) { + JsonArray var11 = p_deserialize_1_.getAsJsonArray(); + IChatComponent var12 = null; + Iterator var14 = var11.iterator(); + + while (var14.hasNext()) { + JsonElement var16 = (JsonElement)var14.next(); + IChatComponent var17 = this.deserialize(var16, var16.getClass(), p_deserialize_3_); + + if (var12 == null) { + var12 = var17; + } else { + var12.appendSibling(var17); + } + } + + return var12; + } else { + throw new JsonParseException("Don't know how to turn " + p_deserialize_1_ + " into a Component"); + } + } else { + JsonObject var4 = p_deserialize_1_.getAsJsonObject(); + Object var5; + + if (var4.has("text")) { + var5 = new ChatComponentText(var4.get("text").getAsString()); + } else { + if (!var4.has("translate")) { + throw new JsonParseException("Don't know how to turn " + p_deserialize_1_ + " into a Component"); + } + + String var6 = var4.get("translate").getAsString(); + + if (var4.has("with")) { + JsonArray var7 = var4.getAsJsonArray("with"); + Object[] var8 = new Object[var7.size()]; + + for (int var9 = 0; var9 < var8.length; ++var9) { + var8[var9] = this.deserialize(var7.get(var9), p_deserialize_2_, p_deserialize_3_); + + if (var8[var9] instanceof ChatComponentText) { + ChatComponentText var10 = (ChatComponentText)var8[var9]; + + if (var10.getChatStyle().isEmpty() && var10.getSiblings().isEmpty()) { + var8[var9] = var10.getChatComponentText_TextValue(); + } + } + } + + var5 = new ChatComponentTranslation(var6, var8); + } else { + var5 = new ChatComponentTranslation(var6); + } + } + + if (var4.has("extra")) { + JsonArray var13 = var4.getAsJsonArray("extra"); + + if (var13.size() <= 0) { + throw new JsonParseException("Unexpected empty array of components"); + } + + for (int var15 = 0; var15 < var13.size(); ++var15) { + ((IChatComponent)var5).appendSibling(this.deserialize(var13.get(var15), p_deserialize_2_, p_deserialize_3_)); + } + } + + ((IChatComponent)var5).setChatStyle(p_deserialize_3_.deserialize(p_deserialize_1_, ChatStyle.class)); + return (IChatComponent)var5; + } + } + + private void func_150695_a(ChatStyle p_150695_1_, JsonObject p_150695_2_, JsonSerializationContext p_150695_3_) { + JsonElement var4 = p_150695_3_.serialize(p_150695_1_); + + if (var4.isJsonObject()) { + JsonObject var5 = (JsonObject)var4; + Iterator var6 = var5.entrySet().iterator(); + + while (var6.hasNext()) { + Entry var7 = (Entry)var6.next(); + p_150695_2_.add((String)var7.getKey(), (JsonElement)var7.getValue()); + } + } + } + + public JsonElement serialize(IChatComponent p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + if (p_serialize_1_ instanceof ChatComponentText && p_serialize_1_.getChatStyle().isEmpty() && p_serialize_1_.getSiblings().isEmpty()) { + return new JsonPrimitive(((ChatComponentText)p_serialize_1_).getChatComponentText_TextValue()); + } else { + JsonObject var4 = new JsonObject(); + + if (!p_serialize_1_.getChatStyle().isEmpty()) { + this.func_150695_a(p_serialize_1_.getChatStyle(), var4, p_serialize_3_); + } + + if (!p_serialize_1_.getSiblings().isEmpty()) { + JsonArray var5 = new JsonArray(); + Iterator var6 = p_serialize_1_.getSiblings().iterator(); + + while (var6.hasNext()) { + IChatComponent var7 = (IChatComponent)var6.next(); + var5.add(this.serialize(var7, var7.getClass(), p_serialize_3_)); + } + + var4.add("extra", var5); + } + + if (p_serialize_1_ instanceof ChatComponentText) { + var4.addProperty("text", ((ChatComponentText)p_serialize_1_).getChatComponentText_TextValue()); + } else { + if (!(p_serialize_1_ instanceof ChatComponentTranslation)) { + throw new IllegalArgumentException("Don't know how to serialize " + p_serialize_1_ + " as a Component"); + } + + ChatComponentTranslation var11 = (ChatComponentTranslation)p_serialize_1_; + var4.addProperty("translate", var11.getKey()); + + if (var11.getFormatArgs() != null && var11.getFormatArgs().length > 0) { + JsonArray var12 = new JsonArray(); + Object[] var13 = var11.getFormatArgs(); + int var8 = var13.length; + + for (int var9 = 0; var9 < var8; ++var9) { + Object var10 = var13[var9]; + + if (var10 instanceof IChatComponent) { + var12.add(this.serialize((IChatComponent)var10, var10.getClass(), p_serialize_3_)); + } else { + var12.add(new JsonPrimitive(String.valueOf(var10))); + } + } + + var4.add("with", var12); + } + } + + return var4; + } + } + + public static String func_150696_a(IChatComponent p_150696_0_) { + return field_150700_a.toJson(p_150696_0_); + } + + public static IChatComponent func_150699_a(String p_150699_0_) { + return field_150700_a.fromJson(p_150699_0_, IChatComponent.class); + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) { + return this.serialize((IChatComponent)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + + static { + GsonBuilder var0 = new GsonBuilder(); + var0.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()); + var0.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()); + var0.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); + field_150700_a = var0.create(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IIcon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IIcon.java new file mode 100644 index 0000000..cb3b872 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IIcon.java @@ -0,0 +1,45 @@ +package net.minecraft.util; + +public interface IIcon { + /** + * Returns the width of the icon, in pixels. + */ + int getIconWidth(); + + /** + * Returns the height of the icon, in pixels. + */ + int getIconHeight(); + + /** + * Returns the minimum U coordinate to use when rendering with this icon. + */ + float getMinU(); + + /** + * Returns the maximum U coordinate to use when rendering with this icon. + */ + float getMaxU(); + + /** + * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. + */ + float getInterpolatedU(double p_94214_1_); + + /** + * Returns the minimum V coordinate to use when rendering with this icon. + */ + float getMinV(); + + /** + * Returns the maximum V coordinate to use when rendering with this icon. + */ + float getMaxV(); + + /** + * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. + */ + float getInterpolatedV(double p_94207_1_); + + String getIconName(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IJsonSerializable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IJsonSerializable.java new file mode 100644 index 0000000..6c3c3e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IJsonSerializable.java @@ -0,0 +1,12 @@ +package net.minecraft.util; + +import com.google.gson.JsonElement; + +public interface IJsonSerializable { + void func_152753_a(JsonElement p_152753_1_); + + /** + * Gets the JsonElement that can be serialized. + */ + JsonElement getSerializableElement(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IObjectIntIterable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IObjectIntIterable.java new file mode 100644 index 0000000..c41c7ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IObjectIntIterable.java @@ -0,0 +1,6 @@ +package net.minecraft.util; + +import net.minecraft.block.Block; + +public interface IObjectIntIterable extends Iterable { +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IProgressUpdate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IProgressUpdate.java new file mode 100644 index 0000000..af4bc75 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IProgressUpdate.java @@ -0,0 +1,26 @@ +package net.minecraft.util; + +public interface IProgressUpdate { + /** + * "Saving level", or the loading,or downloading equivelent + */ + void displayProgressMessage(String p_73720_1_); + + /** + * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, + * and the WorkingString to "working...". + */ + void resetProgressAndMessage(String p_73721_1_); + + /** + * This is called with "Working..." by resetProgressAndMessage + */ + void resetProgresAndWorkingMessage(String p_73719_1_); + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + void setLoadingProgress(int p_73718_1_); + + void func_146586_a(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IRegistry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IRegistry.java new file mode 100644 index 0000000..d2bc7ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IRegistry.java @@ -0,0 +1,10 @@ +package net.minecraft.util; + +public interface IRegistry { + Object getObject(Object p_82594_1_); + + /** + * Register an object on this registry. + */ + void putObject(Object p_82595_1_, Object p_82595_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IntHashMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IntHashMap.java new file mode 100644 index 0000000..e21b15b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/IntHashMap.java @@ -0,0 +1,256 @@ +package net.minecraft.util; + +import java.util.HashSet; +import java.util.Set; + +public class IntHashMap { + /** An array of HashEntries representing the heads of hash slot lists */ + private transient IntHashMap.Entry[] slots = new IntHashMap.Entry[16]; + + /** The number of items stored in this map */ + private transient int count; + + /** The grow threshold */ + private int threshold = 12; + + /** The scale factor used to determine when to grow the table */ + private final float growFactor = 0.75F; + + /** A serial stamp used to mark changes */ + private transient volatile int versionStamp; + + /** The set of all the keys stored in this MCHash object */ + private final Set keySet = new HashSet(); + + + /** + * Makes the passed in integer suitable for hashing by a number of shifts + */ + private static int computeHash(int p_76044_0_) { + p_76044_0_ ^= p_76044_0_ >>> 20 ^ p_76044_0_ >>> 12; + return p_76044_0_ ^ p_76044_0_ >>> 7 ^ p_76044_0_ >>> 4; + } + + /** + * Computes the index of the slot for the hash and slot count passed in. + */ + private static int getSlotIndex(int p_76043_0_, int p_76043_1_) { + return p_76043_0_ & p_76043_1_ - 1; + } + + /** + * Returns the object associated to a key + */ + public Object lookup(int p_76041_1_) { + int var2 = computeHash(p_76041_1_); + + for (IntHashMap.Entry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { + if (var3.hashEntry == p_76041_1_) { + return var3.valueEntry; + } + } + + return null; + } + + /** + * Return true if an object is associated with the given key + */ + public boolean containsItem(int p_76037_1_) { + return this.lookupEntry(p_76037_1_) != null; + } + + /** + * Returns the key/object mapping for a given key as a MCHashEntry + */ + final IntHashMap.Entry lookupEntry(int p_76045_1_) { + int var2 = computeHash(p_76045_1_); + + for (IntHashMap.Entry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { + if (var3.hashEntry == p_76045_1_) { + return var3; + } + } + + return null; + } + + /** + * Adds a key and associated value to this map + */ + public void addKey(int p_76038_1_, Object p_76038_2_) { + this.keySet.add(Integer.valueOf(p_76038_1_)); + int var3 = computeHash(p_76038_1_); + int var4 = getSlotIndex(var3, this.slots.length); + + for (IntHashMap.Entry var5 = this.slots[var4]; var5 != null; var5 = var5.nextEntry) { + if (var5.hashEntry == p_76038_1_) { + var5.valueEntry = p_76038_2_; + return; + } + } + + ++this.versionStamp; + this.insert(var3, p_76038_1_, p_76038_2_, var4); + } + + /** + * Increases the number of hash slots + */ + private void grow(int p_76047_1_) { + IntHashMap.Entry[] var2 = this.slots; + int var3 = var2.length; + + if (var3 == 1073741824) { + this.threshold = Integer.MAX_VALUE; + } else { + IntHashMap.Entry[] var4 = new IntHashMap.Entry[p_76047_1_]; + this.copyTo(var4); + this.slots = var4; + this.threshold = (int)((float)p_76047_1_ * this.growFactor); + } + } + + /** + * Copies the hash slots to a new array + */ + private void copyTo(IntHashMap.Entry[] p_76048_1_) { + IntHashMap.Entry[] var2 = this.slots; + int var3 = p_76048_1_.length; + + for (int var4 = 0; var4 < var2.length; ++var4) { + IntHashMap.Entry var5 = var2[var4]; + + if (var5 != null) { + var2[var4] = null; + IntHashMap.Entry var6; + + do { + var6 = var5.nextEntry; + int var7 = getSlotIndex(var5.slotHash, var3); + var5.nextEntry = p_76048_1_[var7]; + p_76048_1_[var7] = var5; + var5 = var6; + } + while (var6 != null); + } + } + } + + /** + * Removes the specified object from the map and returns it + */ + public Object removeObject(int p_76049_1_) { + this.keySet.remove(Integer.valueOf(p_76049_1_)); + IntHashMap.Entry var2 = this.removeEntry(p_76049_1_); + return var2 == null ? null : var2.valueEntry; + } + + /** + * Removes the specified entry from the map and returns it + */ + final IntHashMap.Entry removeEntry(int p_76036_1_) { + int var2 = computeHash(p_76036_1_); + int var3 = getSlotIndex(var2, this.slots.length); + IntHashMap.Entry var4 = this.slots[var3]; + IntHashMap.Entry var5; + IntHashMap.Entry var6; + + for (var5 = var4; var5 != null; var5 = var6) { + var6 = var5.nextEntry; + + if (var5.hashEntry == p_76036_1_) { + ++this.versionStamp; + --this.count; + + if (var4 == var5) { + this.slots[var3] = var6; + } else { + var4.nextEntry = var6; + } + + return var5; + } + + var4 = var5; + } + + return var5; + } + + /** + * Removes all entries from the map + */ + public void clearMap() { + ++this.versionStamp; + IntHashMap.Entry[] var1 = this.slots; + + for (int var2 = 0; var2 < var1.length; ++var2) { + var1[var2] = null; + } + + this.count = 0; + } + + /** + * Adds an object to a slot + */ + private void insert(int p_76040_1_, int p_76040_2_, Object p_76040_3_, int p_76040_4_) { + IntHashMap.Entry var5 = this.slots[p_76040_4_]; + this.slots[p_76040_4_] = new IntHashMap.Entry(p_76040_1_, p_76040_2_, p_76040_3_, var5); + + if (this.count++ >= this.threshold) { + this.grow(2 * this.slots.length); + } + } + + static class Entry { + final int hashEntry; + Object valueEntry; + IntHashMap.Entry nextEntry; + final int slotHash; + + + Entry(int p_i1552_1_, int p_i1552_2_, Object p_i1552_3_, IntHashMap.Entry p_i1552_4_) { + this.valueEntry = p_i1552_3_; + this.nextEntry = p_i1552_4_; + this.hashEntry = p_i1552_2_; + this.slotHash = p_i1552_1_; + } + + public final int getHash() { + return this.hashEntry; + } + + public final Object getValue() { + return this.valueEntry; + } + + public final boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof IntHashMap.Entry)) { + return false; + } else { + IntHashMap.Entry var2 = (IntHashMap.Entry)p_equals_1_; + Integer var3 = Integer.valueOf(this.getHash()); + Integer var4 = Integer.valueOf(var2.getHash()); + + if (var3 == var4 || var3 != null && var3.equals(var4)) { + Object var5 = this.getValue(); + Object var6 = var2.getValue(); + + return var5 == var6 || var5 != null && var5.equals(var6); + } + + return false; + } + } + + public final int hashCode() { + return IntHashMap.computeHash(this.hashEntry); + } + + public final String toString() { + return this.getHash() + "=" + this.getValue(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/JsonSerializableSet.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/JsonSerializableSet.java new file mode 100644 index 0000000..be21d8b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/JsonSerializableSet.java @@ -0,0 +1,46 @@ +package net.minecraft.util; + +import com.google.common.collect.ForwardingSet; +import com.google.common.collect.Sets; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonPrimitive; +import java.util.Collection; +import java.util.Iterator; +import java.util.Set; + +public class JsonSerializableSet extends ForwardingSet implements IJsonSerializable { + /** The set for this ForwardingSet to forward methods to. */ + private final Set underlyingSet = Sets.newHashSet(); + + + public void func_152753_a(JsonElement p_152753_1_) { + if (p_152753_1_.isJsonArray()) { + Iterator var2 = p_152753_1_.getAsJsonArray().iterator(); + + while (var2.hasNext()) { + JsonElement var3 = (JsonElement)var2.next(); + this.add(var3.getAsString()); + } + } + } + + /** + * Gets the JsonElement that can be serialized. + */ + public JsonElement getSerializableElement() { + JsonArray var1 = new JsonArray(); + Iterator var2 = this.iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + var1.add(new JsonPrimitive(var3)); + } + + return var1; + } + + protected Set delegate() { + return this.underlyingSet; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/JsonUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/JsonUtils.java new file mode 100644 index 0000000..cb68a64 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/JsonUtils.java @@ -0,0 +1,261 @@ +package net.minecraft.util; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSyntaxException; + +public class JsonUtils { + + + /** + * Does the given JsonObject contain a string field with the given name? + */ + public static boolean jsonObjectFieldTypeIsString(JsonObject p_151205_0_, String p_151205_1_) { + return jsonObjectFieldTypeIsPrimitive(p_151205_0_, p_151205_1_) && p_151205_0_.getAsJsonPrimitive(p_151205_1_).isString(); + } + + /** + * Is the given JsonElement a string? + */ + public static boolean jsonElementTypeIsString(JsonElement p_151211_0_) { + return p_151211_0_.isJsonPrimitive() && p_151211_0_.getAsJsonPrimitive().isString(); + } + + /** + * Does the given JsonObject contain an array field with the given name? + */ + public static boolean jsonObjectFieldTypeIsArray(JsonObject p_151202_0_, String p_151202_1_) { + return jsonObjectHasNamedField(p_151202_0_, p_151202_1_) && p_151202_0_.get(p_151202_1_).isJsonArray(); + } + + /** + * Does the given JsonObject contain a field with the given name whose type is primitive (String, Java primitive, or + * Java primitive wrapper)? + */ + public static boolean jsonObjectFieldTypeIsPrimitive(JsonObject p_151201_0_, String p_151201_1_) { + return jsonObjectHasNamedField(p_151201_0_, p_151201_1_) && p_151201_0_.get(p_151201_1_).isJsonPrimitive(); + } + + /** + * Does the given JsonObject contain a field with the given name? + */ + public static boolean jsonObjectHasNamedField(JsonObject p_151204_0_, String p_151204_1_) { + return p_151204_0_ != null && p_151204_0_.get(p_151204_1_) != null; + } + + /** + * Gets the string value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + public static String getJsonElementStringValue(JsonElement p_151206_0_, String p_151206_1_) { + if (p_151206_0_.isJsonPrimitive()) { + return p_151206_0_.getAsString(); + } else { + throw new JsonSyntaxException("Expected " + p_151206_1_ + " to be a string, was " + getJsonElementTypeDescription(p_151206_0_)); + } + } + + /** + * Gets the string value of the field on the JsonObject with the given name. + */ + public static String getJsonObjectStringFieldValue(JsonObject p_151200_0_, String p_151200_1_) { + if (p_151200_0_.has(p_151200_1_)) { + return getJsonElementStringValue(p_151200_0_.get(p_151200_1_), p_151200_1_); + } else { + throw new JsonSyntaxException("Missing " + p_151200_1_ + ", expected to find a string"); + } + } + + /** + * Gets the string value of the field on the JsonObject with the given name, or the given default value if the field + * is missing. + */ + public static String getJsonObjectStringFieldValueOrDefault(JsonObject p_151219_0_, String p_151219_1_, String p_151219_2_) { + return p_151219_0_.has(p_151219_1_) ? getJsonElementStringValue(p_151219_0_.get(p_151219_1_), p_151219_1_) : p_151219_2_; + } + + /** + * Gets the boolean value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + public static boolean getJsonElementBooleanValue(JsonElement p_151216_0_, String p_151216_1_) { + if (p_151216_0_.isJsonPrimitive()) { + return p_151216_0_.getAsBoolean(); + } else { + throw new JsonSyntaxException("Expected " + p_151216_1_ + " to be a Boolean, was " + getJsonElementTypeDescription(p_151216_0_)); + } + } + + /** + * Gets the boolean value of the field on the JsonObject with the given name. + */ + public static boolean getJsonObjectBooleanFieldValue(JsonObject p_151212_0_, String p_151212_1_) { + if (p_151212_0_.has(p_151212_1_)) { + return getJsonElementBooleanValue(p_151212_0_.get(p_151212_1_), p_151212_1_); + } else { + throw new JsonSyntaxException("Missing " + p_151212_1_ + ", expected to find a Boolean"); + } + } + + /** + * Gets the boolean value of the field on the JsonObject with the given name, or the given default value if the + * field is missing. + */ + public static boolean getJsonObjectBooleanFieldValueOrDefault(JsonObject p_151209_0_, String p_151209_1_, boolean p_151209_2_) { + return p_151209_0_.has(p_151209_1_) ? getJsonElementBooleanValue(p_151209_0_.get(p_151209_1_), p_151209_1_) : p_151209_2_; + } + + /** + * Gets the float value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + public static float getJsonElementFloatValue(JsonElement p_151220_0_, String p_151220_1_) { + if (p_151220_0_.isJsonPrimitive() && p_151220_0_.getAsJsonPrimitive().isNumber()) { + return p_151220_0_.getAsFloat(); + } else { + throw new JsonSyntaxException("Expected " + p_151220_1_ + " to be a Float, was " + getJsonElementTypeDescription(p_151220_0_)); + } + } + + /** + * Gets the float value of the field on the JsonObject with the given name. + */ + public static float getJsonObjectFloatFieldValue(JsonObject p_151217_0_, String p_151217_1_) { + if (p_151217_0_.has(p_151217_1_)) { + return getJsonElementFloatValue(p_151217_0_.get(p_151217_1_), p_151217_1_); + } else { + throw new JsonSyntaxException("Missing " + p_151217_1_ + ", expected to find a Float"); + } + } + + /** + * Gets the float value of the field on the JsonObject with the given name, or the given default value if the field + * is missing. + */ + public static float getJsonObjectFloatFieldValueOrDefault(JsonObject p_151221_0_, String p_151221_1_, float p_151221_2_) { + return p_151221_0_.has(p_151221_1_) ? getJsonElementFloatValue(p_151221_0_.get(p_151221_1_), p_151221_1_) : p_151221_2_; + } + + /** + * Gets the integer value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + public static int getJsonElementIntegerValue(JsonElement p_151215_0_, String p_151215_1_) { + if (p_151215_0_.isJsonPrimitive() && p_151215_0_.getAsJsonPrimitive().isNumber()) { + return p_151215_0_.getAsInt(); + } else { + throw new JsonSyntaxException("Expected " + p_151215_1_ + " to be a Int, was " + getJsonElementTypeDescription(p_151215_0_)); + } + } + + /** + * Gets the integer value of the field on the JsonObject with the given name. + */ + public static int getJsonObjectIntegerFieldValue(JsonObject p_151203_0_, String p_151203_1_) { + if (p_151203_0_.has(p_151203_1_)) { + return getJsonElementIntegerValue(p_151203_0_.get(p_151203_1_), p_151203_1_); + } else { + throw new JsonSyntaxException("Missing " + p_151203_1_ + ", expected to find a Int"); + } + } + + /** + * Gets the integer value of the field on the JsonObject with the given name, or the given default value if the + * field is missing. + */ + public static int getJsonObjectIntegerFieldValueOrDefault(JsonObject p_151208_0_, String p_151208_1_, int p_151208_2_) { + return p_151208_0_.has(p_151208_1_) ? getJsonElementIntegerValue(p_151208_0_.get(p_151208_1_), p_151208_1_) : p_151208_2_; + } + + /** + * Gets the given JsonElement as a JsonObject. Expects the second parameter to be the name of the element's field + * if an error message needs to be thrown. + */ + public static JsonObject getJsonElementAsJsonObject(JsonElement p_151210_0_, String p_151210_1_) { + if (p_151210_0_.isJsonObject()) { + return p_151210_0_.getAsJsonObject(); + } else { + throw new JsonSyntaxException("Expected " + p_151210_1_ + " to be a JsonObject, was " + getJsonElementTypeDescription(p_151210_0_)); + } + } + + public static JsonObject func_152754_s(JsonObject p_152754_0_, String p_152754_1_) { + if (p_152754_0_.has(p_152754_1_)) { + return getJsonElementAsJsonObject(p_152754_0_.get(p_152754_1_), p_152754_1_); + } else { + throw new JsonSyntaxException("Missing " + p_152754_1_ + ", expected to find a JsonObject"); + } + } + + /** + * Gets the JsonObject field on the JsonObject with the given name, or the given default value if the field is + * missing. + */ + public static JsonObject getJsonObjectFieldOrDefault(JsonObject p_151218_0_, String p_151218_1_, JsonObject p_151218_2_) { + return p_151218_0_.has(p_151218_1_) ? getJsonElementAsJsonObject(p_151218_0_.get(p_151218_1_), p_151218_1_) : p_151218_2_; + } + + /** + * Gets the given JsonElement as a JsonArray. Expects the second parameter to be the name of the element's field if + * an error message needs to be thrown. + */ + public static JsonArray getJsonElementAsJsonArray(JsonElement p_151207_0_, String p_151207_1_) { + if (p_151207_0_.isJsonArray()) { + return p_151207_0_.getAsJsonArray(); + } else { + throw new JsonSyntaxException("Expected " + p_151207_1_ + " to be a JsonArray, was " + getJsonElementTypeDescription(p_151207_0_)); + } + } + + /** + * Gets the JsonArray field on the JsonObject with the given name. + */ + public static JsonArray getJsonObjectJsonArrayField(JsonObject p_151214_0_, String p_151214_1_) { + if (p_151214_0_.has(p_151214_1_)) { + return getJsonElementAsJsonArray(p_151214_0_.get(p_151214_1_), p_151214_1_); + } else { + throw new JsonSyntaxException("Missing " + p_151214_1_ + ", expected to find a JsonArray"); + } + } + + /** + * Gets the JsonArray field on the JsonObject with the given name, or the given default value if the field is + * missing. + */ + public static JsonArray getJsonObjectJsonArrayFieldOrDefault(JsonObject p_151213_0_, String p_151213_1_, JsonArray p_151213_2_) { + return p_151213_0_.has(p_151213_1_) ? getJsonElementAsJsonArray(p_151213_0_.get(p_151213_1_), p_151213_1_) : p_151213_2_; + } + + /** + * Gets a human-readable description of the given JsonElement's type. For example: "a number (4)" + */ + public static String getJsonElementTypeDescription(JsonElement p_151222_0_) { + String var1 = org.apache.commons.lang3.StringUtils.abbreviateMiddle(String.valueOf(p_151222_0_), "...", 10); + + if (p_151222_0_ == null) { + return "null (missing)"; + } else if (p_151222_0_.isJsonNull()) { + return "null (json)"; + } else if (p_151222_0_.isJsonArray()) { + return "an array (" + var1 + ")"; + } else if (p_151222_0_.isJsonObject()) { + return "an object (" + var1 + ")"; + } else { + if (p_151222_0_.isJsonPrimitive()) { + JsonPrimitive var2 = p_151222_0_.getAsJsonPrimitive(); + + if (var2.isNumber()) { + return "a number (" + var1 + ")"; + } + + if (var2.isBoolean()) { + return "a boolean (" + var1 + ")"; + } + } + + return var1; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/LongHashMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/LongHashMap.java new file mode 100644 index 0000000..bacbe0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/LongHashMap.java @@ -0,0 +1,262 @@ +package net.minecraft.util; + +public class LongHashMap { + /** the array of all elements in the hash */ + private transient LongHashMap.Entry[] hashArray = new LongHashMap.Entry[1024]; + + /** the number of elements in the hash array */ + private transient int numHashElements; + + /** + * the maximum amount of elements in the hash (probably 3/4 the size due to meh hashing function) + */ + private int capacity; + + /** + * percent of the hasharray that can be used without hash colliding probably + */ + private final float percentUseable; + + /** count of times elements have been added/removed */ + private transient volatile int modCount; + + public LongHashMap() { + this.capacity = (int)(0.75F * (float)this.hashArray.length); + this.percentUseable = 0.75F; + } + + /** + * returns the hashed key given the original key + */ + private static int getHashedKey(long par0) { + return (int)(par0 ^ par0 >>> 27); + } + + /** + * the hash function + */ + private static int hash(int par0) { + par0 ^= par0 >>> 20 ^ par0 >>> 12; + return par0 ^ par0 >>> 7 ^ par0 >>> 4; + } + + /** + * gets the index in the hash given the array length and the hashed key + */ + private static int getHashIndex(int par0, int par1) { + return par0 & par1 - 1; + } + + public int getNumHashElements() { + return this.numHashElements; + } + + /** + * get the value from the map given the key + */ + public Object getValueByKey(long par1) { + int var3 = getHashedKey(par1); + + for (LongHashMap.Entry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { + if (var4.key == par1) { + return var4.value; + } + } + + return null; + } + + public boolean containsItem(long par1) { + return this.getEntry(par1) != null; + } + + final LongHashMap.Entry getEntry(long par1) { + int var3 = getHashedKey(par1); + + for (LongHashMap.Entry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { + if (var4.key == par1) { + return var4; + } + } + + return null; + } + + /** + * Add a key-value pair. + */ + public void add(long par1, Object par3Obj) { + int var4 = getHashedKey(par1); + int var5 = getHashIndex(var4, this.hashArray.length); + + for (LongHashMap.Entry var6 = this.hashArray[var5]; var6 != null; var6 = var6.nextEntry) { + if (var6.key == par1) { + var6.value = par3Obj; + return; + } + } + + ++this.modCount; + this.createKey(var4, par1, par3Obj, var5); + } + + /** + * resizes the table + */ + private void resizeTable(int par1) { + LongHashMap.Entry[] var2 = this.hashArray; + int var3 = var2.length; + + if (var3 == 1073741824) { + this.capacity = Integer.MAX_VALUE; + } else { + LongHashMap.Entry[] var4 = new LongHashMap.Entry[par1]; + this.copyHashTableTo(var4); + this.hashArray = var4; + float var10001 = (float)par1; + this.getClass(); + this.capacity = (int)(var10001 * 0.75F); + } + } + + /** + * copies the hash table to the specified array + */ + private void copyHashTableTo(LongHashMap.Entry[] par1ArrayOfLongHashMapEntry) { + LongHashMap.Entry[] var2 = this.hashArray; + int var3 = par1ArrayOfLongHashMapEntry.length; + + for (int var4 = 0; var4 < var2.length; ++var4) { + LongHashMap.Entry var5 = var2[var4]; + + if (var5 != null) { + var2[var4] = null; + LongHashMap.Entry var6; + + do { + var6 = var5.nextEntry; + int var7 = getHashIndex(var5.hash, var3); + var5.nextEntry = par1ArrayOfLongHashMapEntry[var7]; + par1ArrayOfLongHashMapEntry[var7] = var5; + var5 = var6; + } + while (var6 != null); + } + } + } + + /** + * calls the removeKey method and returns removed object + */ + public Object remove(long par1) { + LongHashMap.Entry var3 = this.removeKey(par1); + return var3 == null ? null : var3.value; + } + + /** + * removes the key from the hash linked list + */ + final LongHashMap.Entry removeKey(long par1) { + int var3 = getHashedKey(par1); + int var4 = getHashIndex(var3, this.hashArray.length); + LongHashMap.Entry var5 = this.hashArray[var4]; + LongHashMap.Entry var6; + LongHashMap.Entry var7; + + for (var6 = var5; var6 != null; var6 = var7) { + var7 = var6.nextEntry; + + if (var6.key == par1) { + ++this.modCount; + --this.numHashElements; + + if (var5 == var6) { + this.hashArray[var4] = var7; + } else { + var5.nextEntry = var7; + } + + return var6; + } + + var5 = var6; + } + + return var6; + } + + /** + * creates the key in the hash table + */ + private void createKey(int par1, long par2, Object par4Obj, int par5) { + LongHashMap.Entry var6 = this.hashArray[par5]; + this.hashArray[par5] = new LongHashMap.Entry(par1, par2, par4Obj, var6); + + if (this.numHashElements++ >= this.capacity) { + this.resizeTable(2 * this.hashArray.length); + } + } + + public double getKeyDistribution() { + int countValid = 0; + + for (int i = 0; i < this.hashArray.length; ++i) { + if (this.hashArray[i] != null) { + ++countValid; + } + } + + return 1.0D * (double)countValid / (double)this.numHashElements; + } + + static class Entry { + final long key; + Object value; + LongHashMap.Entry nextEntry; + final int hash; + + Entry(int par1, long par2, Object par4Obj, LongHashMap.Entry par5LongHashMapEntry) { + this.value = par4Obj; + this.nextEntry = par5LongHashMapEntry; + this.key = par2; + this.hash = par1; + } + + public final long getKey() { + return this.key; + } + + public final Object getValue() { + return this.value; + } + + public final boolean equals(Object par1Obj) { + if (!(par1Obj instanceof LongHashMap.Entry)) { + return false; + } else { + LongHashMap.Entry var2 = (LongHashMap.Entry)par1Obj; + Long var3 = Long.valueOf(this.getKey()); + Long var4 = Long.valueOf(var2.getKey()); + + if (var3 == var4 || var3 != null && var3.equals(var4)) { + Object var5 = this.getValue(); + Object var6 = var2.getValue(); + + if (var5 == var6 || var5 != null && var5.equals(var6)) { + return true; + } + } + + return false; + } + } + + public final int hashCode() { + return LongHashMap.getHashedKey(this.key); + } + + public final String toString() { + return this.getKey() + "=" + this.getValue(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MathHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MathHelper.java new file mode 100644 index 0000000..b948e07 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MathHelper.java @@ -0,0 +1,362 @@ +package net.minecraft.util; + +import java.util.Random; + +public class MathHelper { + private static final int SIN_BITS = 12; + private static final int SIN_MASK = 4095; + private static final int SIN_COUNT = 4096; + public static final float PI = (float)Math.PI; + public static final float PI2 = ((float)Math.PI * 2F); + public static final float PId2 = ((float)Math.PI / 2F); + private static final float radFull = ((float)Math.PI * 2F); + private static final float degFull = 360.0F; + private static final float radToIndex = 651.8986F; + private static final float degToIndex = 11.377778F; + public static final float deg2Rad = 0.017453292F; + private static final float[] SIN_TABLE_FAST = new float[4096]; + public static boolean fastMath = false; + + /** + * A table of sin values computed from 0 (inclusive) to 2*pi (exclusive), with steps of 2*PI / 65536. + */ + private static float[] SIN_TABLE = new float[65536]; + + /** + * Though it looks like an array, this is really more like a mapping. Key (index of this array) is the upper 5 bits + * of the result of multiplying a 32-bit unsigned integer by the B(2, 5) De Bruijn sequence 0x077CB531. Value + * (value stored in the array) is the unique index (from the right) of the leftmost one-bit in a 32-bit unsigned + * integer that can cause the upper 5 bits to get that value. Used for highly optimized "find the log-base-2 of + * this number" calculations. + */ + private static final int[] multiplyDeBruijnBitPosition; + + /** + * sin looked up in a table + */ + public static final float sin(float par0) { + return fastMath ? SIN_TABLE_FAST[(int)(par0 * 651.8986F) & 4095] : SIN_TABLE[(int)(par0 * 10430.378F) & 65535]; + } + + /** + * cos looked up in the sin table with the appropriate offset + */ + public static final float cos(float par0) { + return fastMath ? SIN_TABLE_FAST[(int)((par0 + ((float)Math.PI / 2F)) * 651.8986F) & 4095] : SIN_TABLE[(int)(par0 * 10430.378F + 16384.0F) & 65535]; + } + + public static final float sqrt_float(float par0) { + return (float)Math.sqrt((double)par0); + } + + public static final float sqrt_double(double par0) { + return (float)Math.sqrt(par0); + } + + /** + * Returns the greatest integer less than or equal to the float argument + */ + public static int floor_float(float par0) { + int var1 = (int)par0; + return par0 < (float)var1 ? var1 - 1 : var1; + } + + /** + * returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024 + */ + public static int truncateDoubleToInt(double par0) { + return (int)(par0 + 1024.0D) - 1024; + } + + /** + * Returns the greatest integer less than or equal to the double argument + */ + public static int floor_double(double par0) { + int var2 = (int)par0; + return par0 < (double)var2 ? var2 - 1 : var2; + } + + /** + * Long version of floor_double + */ + public static long floor_double_long(double par0) { + long var2 = (long)par0; + return par0 < (double)var2 ? var2 - 1L : var2; + } + + public static int func_154353_e(double p_154353_0_) { + return (int)(p_154353_0_ >= 0.0D ? p_154353_0_ : -p_154353_0_ + 1.0D); + } + + public static float abs(float par0) { + return par0 >= 0.0F ? par0 : -par0; + } + + /** + * Returns the unsigned value of an int. + */ + public static int abs_int(int par0) { + return par0 >= 0 ? par0 : -par0; + } + + public static int ceiling_float_int(float par0) { + int var1 = (int)par0; + return par0 > (float)var1 ? var1 + 1 : var1; + } + + public static int ceiling_double_int(double par0) { + int var2 = (int)par0; + return par0 > (double)var2 ? var2 + 1 : var2; + } + + /** + * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and + * third parameters. + */ + public static int clamp_int(int par0, int par1, int par2) { + return par0 < par1 ? par1 : (par0 > par2 ? par2 : par0); + } + + /** + * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and + * third parameters + */ + public static float clamp_float(float par0, float par1, float par2) { + return par0 < par1 ? par1 : (par0 > par2 ? par2 : par0); + } + + public static double clamp_double(double p_151237_0_, double p_151237_2_, double p_151237_4_) { + return p_151237_0_ < p_151237_2_ ? p_151237_2_ : (p_151237_0_ > p_151237_4_ ? p_151237_4_ : p_151237_0_); + } + + public static double denormalizeClamp(double p_151238_0_, double p_151238_2_, double p_151238_4_) { + return p_151238_4_ < 0.0D ? p_151238_0_ : (p_151238_4_ > 1.0D ? p_151238_2_ : p_151238_0_ + (p_151238_2_ - p_151238_0_) * p_151238_4_); + } + + /** + * Maximum of the absolute value of two numbers. + */ + public static double abs_max(double par0, double par2) { + if (par0 < 0.0D) { + par0 = -par0; + } + + if (par2 < 0.0D) { + par2 = -par2; + } + + return par0 > par2 ? par0 : par2; + } + + /** + * Buckets an integer with specifed bucket sizes. Args: i, bucketSize + */ + public static int bucketInt(int par0, int par1) { + return par0 < 0 ? -((-par0 - 1) / par1) - 1 : par0 / par1; + } + + /** + * Tests if a string is null or of length zero + */ + public static boolean stringNullOrLengthZero(String par0Str) { + return par0Str == null || par0Str.length() == 0; + } + + public static int getRandomIntegerInRange(Random par0Random, int par1, int par2) { + return par1 >= par2 ? par1 : par0Random.nextInt(par2 - par1 + 1) + par1; + } + + public static float randomFloatClamp(Random p_151240_0_, float p_151240_1_, float p_151240_2_) { + return p_151240_1_ >= p_151240_2_ ? p_151240_1_ : p_151240_0_.nextFloat() * (p_151240_2_ - p_151240_1_) + p_151240_1_; + } + + public static double getRandomDoubleInRange(Random par0Random, double par1, double par3) { + return par1 >= par3 ? par1 : par0Random.nextDouble() * (par3 - par1) + par1; + } + + public static double average(long[] par0ArrayOfLong) { + long var1 = 0L; + long[] var3 = par0ArrayOfLong; + int var4 = par0ArrayOfLong.length; + + for (int var5 = 0; var5 < var4; ++var5) { + long var6 = var3[var5]; + var1 += var6; + } + + return (double)var1 / (double)par0ArrayOfLong.length; + } + + public static int normalizeAngle(int p_180184_0_, int p_180184_1_) + { + return (p_180184_0_ % p_180184_1_ + p_180184_1_) % p_180184_1_; + } + + /** + * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check + */ + public static float wrapAngleTo180_float(float par0) { + par0 %= 360.0F; + + if (par0 >= 180.0F) { + par0 -= 360.0F; + } + + if (par0 < -180.0F) { + par0 += 360.0F; + } + + return par0; + } + + /** + * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check + */ + public static double wrapAngleTo180_double(double par0) { + par0 %= 360.0D; + + if (par0 >= 180.0D) { + par0 -= 360.0D; + } + + if (par0 < -180.0D) { + par0 += 360.0D; + } + + return par0; + } + + /** + * parses the string as integer or returns the second parameter if it fails + */ + public static int parseIntWithDefault(String par0Str, int par1) { + int var2 = par1; + + try { + var2 = Integer.parseInt(par0Str); + } catch (Throwable var4) { + ; + } + + return var2; + } + + /** + * parses the string as integer or returns the second parameter if it fails. this value is capped to par2 + */ + public static int parseIntWithDefaultAndMax(String par0Str, int par1, int par2) { + int var3 = par1; + + try { + var3 = Integer.parseInt(par0Str); + } catch (Throwable var5) { + ; + } + + if (var3 < par2) { + var3 = par2; + } + + return var3; + } + + /** + * parses the string as double or returns the second parameter if it fails. + */ + public static double parseDoubleWithDefault(String par0Str, double par1) { + double var3 = par1; + + try { + var3 = Double.parseDouble(par0Str); + } catch (Throwable var6) { + ; + } + + return var3; + } + + public static double parseDoubleWithDefaultAndMax(String par0Str, double par1, double par3) { + double var5 = par1; + + try { + var5 = Double.parseDouble(par0Str); + } catch (Throwable var8) { + ; + } + + if (var5 < par3) { + var5 = par3; + } + + return var5; + } + + /** + * Returns the input value rounded up to the next highest power of two. + */ + public static int roundUpToPowerOfTwo(int p_151236_0_) { + int var1 = p_151236_0_ - 1; + var1 |= var1 >> 1; + var1 |= var1 >> 2; + var1 |= var1 >> 4; + var1 |= var1 >> 8; + var1 |= var1 >> 16; + return var1 + 1; + } + + /** + * Is the given value a power of two? (1, 2, 4, 8, 16, ...) + */ + private static boolean isPowerOfTwo(int p_151235_0_) { + return p_151235_0_ != 0 && (p_151235_0_ & p_151235_0_ - 1) == 0; + } + + /** + * Uses a B(2, 5) De Bruijn sequence and a lookup table to efficiently calculate the log-base-two of the given + * value. Optimized for cases where the input value is a power-of-two. If the input value is not a power-of-two, + * then subtract 1 from the return value. + */ + private static int calculateLogBaseTwoDeBruijn(int p_151241_0_) { + p_151241_0_ = isPowerOfTwo(p_151241_0_) ? p_151241_0_ : roundUpToPowerOfTwo(p_151241_0_); + return multiplyDeBruijnBitPosition[(int)((long)p_151241_0_ * 125613361L >> 27) & 31]; + } + + /** + * Efficiently calculates the floor of the base-2 log of an integer value. This is effectively the index of the + * highest bit that is set. For example, if the number in binary is 0...100101, this will return 5. + */ + public static int calculateLogBaseTwo(int p_151239_0_) { + return calculateLogBaseTwoDeBruijn(p_151239_0_) - (isPowerOfTwo(p_151239_0_) ? 0 : 1); + } + + public static int func_154354_b(int p_154354_0_, int p_154354_1_) { + if (p_154354_1_ == 0) { + return 0; + } else { + if (p_154354_0_ < 0) { + p_154354_1_ *= -1; + } + + int var2 = p_154354_0_ % p_154354_1_; + return var2 == 0 ? p_154354_0_ : p_154354_0_ + p_154354_1_ - var2; + } + } + + static { + int i; + + for (i = 0; i < 65536; ++i) { + SIN_TABLE[i] = (float)Math.sin((double)i * Math.PI * 2.0D / 65536.0D); + } + + multiplyDeBruijnBitPosition = new int[] {0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9}; + + for (i = 0; i < 4096; ++i) { + SIN_TABLE_FAST[i] = (float)Math.sin((double)(((float)i + 0.5F) / 4096.0F * ((float)Math.PI * 2F))); + } + + for (i = 0; i < 360; i += 90) { + SIN_TABLE_FAST[(int)((float)i * 11.377778F) & 4095] = (float)Math.sin((double)((float)i * 0.017453292F)); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageDeserializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageDeserializer.java new file mode 100644 index 0000000..8bc87ba --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageDeserializer.java @@ -0,0 +1,54 @@ +package net.minecraft.util; + +import com.google.common.collect.BiMap; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +import java.io.IOException; +import java.util.List; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.NetworkStatistics; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class MessageDeserializer extends ByteToMessageDecoder { + private static final Logger logger = LogManager.getLogger(); + private static final Marker field_150799_b = MarkerManager.getMarker("PACKET_RECEIVED", NetworkManager.logMarkerPackets); + private final NetworkStatistics field_152499_c; + + + public MessageDeserializer(NetworkStatistics p_i1183_1_) { + this.field_152499_c = p_i1183_1_; + } + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws IOException { + int var4 = p_decode_2_.readableBytes(); + + if (var4 != 0) { + PacketBuffer var5 = new PacketBuffer(p_decode_2_); + int var6 = var5.readVarIntFromBuffer(); + Packet var7 = Packet.generatePacket((BiMap)p_decode_1_.channel().attr(NetworkManager.attrKeyReceivable).get(), var6); + + if (var7 == null) { + throw new IOException("Bad packet id " + var6); + } else { + var7.readPacketData(var5); + + if (var5.readableBytes() > 0) { + throw new IOException("Packet was larger than I expected, found " + var5.readableBytes() + " bytes extra whilst reading packet " + var6); + } else { + p_decode_3_.add(var7); + this.field_152499_c.func_152469_a(var6, var4); + + if (logger.isDebugEnabled()) { + logger.debug(field_150799_b, " IN: [{}:{}] {}[{}]", p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), Integer.valueOf(var6), var7.getClass().getName(), var7.serialize()); + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageDeserializer2.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageDeserializer2.java new file mode 100644 index 0000000..5b52001 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageDeserializer2.java @@ -0,0 +1,49 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.handler.codec.CorruptedFrameException; +import java.util.List; +import net.minecraft.network.PacketBuffer; + +public class MessageDeserializer2 extends ByteToMessageDecoder { + + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) { + p_decode_2_.markReaderIndex(); + byte[] var4 = new byte[3]; + + for (int var5 = 0; var5 < var4.length; ++var5) { + if (!p_decode_2_.isReadable()) { + p_decode_2_.resetReaderIndex(); + return; + } + + var4[var5] = p_decode_2_.readByte(); + + if (var4[var5] >= 0) { + PacketBuffer var6 = new PacketBuffer(Unpooled.wrappedBuffer(var4)); + + try { + int var7 = var6.readVarIntFromBuffer(); + + if (p_decode_2_.readableBytes() < var7) { + p_decode_2_.resetReaderIndex(); + return; + } + + p_decode_3_.add(p_decode_2_.readBytes(var7)); + } + finally { + var6.release(); + } + + return; + } + } + + throw new CorruptedFrameException("length wider than 21-bit"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageSerializer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageSerializer.java new file mode 100644 index 0000000..24c6d47 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageSerializer.java @@ -0,0 +1,47 @@ +package net.minecraft.util; + +import com.google.common.collect.BiMap; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import java.io.IOException; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.NetworkStatistics; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class MessageSerializer extends MessageToByteEncoder { + private static final Logger logger = LogManager.getLogger(); + private static final Marker field_150797_b = MarkerManager.getMarker("PACKET_SENT", NetworkManager.logMarkerPackets); + private final NetworkStatistics field_152500_c; + + + public MessageSerializer(NetworkStatistics p_i46391_1_) { + this.field_152500_c = p_i46391_1_; + } + + protected void encode(ChannelHandlerContext p_encode_1_, Packet p_encode_2_, ByteBuf p_encode_3_) throws IOException { + Integer var4 = (Integer)((BiMap)p_encode_1_.channel().attr(NetworkManager.attrKeySendable).get()).inverse().get(p_encode_2_.getClass()); + + if (logger.isDebugEnabled()) { + logger.debug(field_150797_b, "OUT: [{}:{}] {}[{}]", p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), var4, p_encode_2_.getClass().getName(), p_encode_2_.serialize()); + } + + if (var4 == null) { + throw new IOException("Can't serialize unregistered packet"); + } else { + PacketBuffer var5 = new PacketBuffer(p_encode_3_); + var5.writeVarIntToBuffer(var4.intValue()); + p_encode_2_.writePacketData(var5); + this.field_152500_c.func_152464_b(var4.intValue(), var5.readableBytes()); + } + } + + protected void encode(ChannelHandlerContext p_encode_1_, Object p_encode_2_, ByteBuf p_encode_3_) throws IOException { + this.encode(p_encode_1_, (Packet)p_encode_2_, p_encode_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageSerializer2.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageSerializer2.java new file mode 100644 index 0000000..999917a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MessageSerializer2.java @@ -0,0 +1,28 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import net.minecraft.network.PacketBuffer; + +public class MessageSerializer2 extends MessageToByteEncoder { + + + protected void encode(ChannelHandlerContext p_encode_1_, ByteBuf p_encode_2_, ByteBuf p_encode_3_) { + int var4 = p_encode_2_.readableBytes(); + int var5 = PacketBuffer.getVarIntSize(var4); + + if (var5 > 3) { + throw new IllegalArgumentException("unable to fit " + var4 + " into " + 3); + } else { + PacketBuffer var6 = new PacketBuffer(p_encode_3_); + var6.ensureWritable(var5 + var4); + var6.writeVarIntToBuffer(var4); + var6.writeBytes(p_encode_2_, p_encode_2_.readerIndex(), var4); + } + } + + protected void encode(ChannelHandlerContext p_encode_1_, Object p_encode_2_, ByteBuf p_encode_3_) { + this.encode(p_encode_1_, (ByteBuf)p_encode_2_, p_encode_3_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MinecraftError.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MinecraftError.java new file mode 100644 index 0000000..057fe0c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MinecraftError.java @@ -0,0 +1,5 @@ +package net.minecraft.util; + +public class MinecraftError extends Error { + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MouseFilter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MouseFilter.java new file mode 100644 index 0000000..a89ac4a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MouseFilter.java @@ -0,0 +1,24 @@ +package net.minecraft.util; + +public class MouseFilter { + private float field_76336_a; + private float field_76334_b; + private float field_76335_c; + + + /** + * Smooths mouse input + */ + public float smooth(float p_76333_1_, float p_76333_2_) { + this.field_76336_a += p_76333_1_; + p_76333_1_ = (this.field_76336_a - this.field_76334_b) * p_76333_2_; + this.field_76335_c += (p_76333_1_ - this.field_76335_c) * 0.5F; + + if (p_76333_1_ > 0.0F && p_76333_1_ > this.field_76335_c || p_76333_1_ < 0.0F && p_76333_1_ < this.field_76335_c) { + p_76333_1_ = this.field_76335_c; + } + + this.field_76334_b += p_76333_1_; + return p_76333_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MouseHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MouseHelper.java new file mode 100644 index 0000000..61ee239 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MouseHelper.java @@ -0,0 +1,35 @@ +package net.minecraft.util; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; + +public class MouseHelper { + /** Mouse delta X this frame */ + public int deltaX; + + /** Mouse delta Y this frame */ + public int deltaY; + + + /** + * Grabs the mouse cursor it doesn't move and isn't seen. + */ + public void grabMouseCursor() { + Mouse.setGrabbed(true); + this.deltaX = 0; + this.deltaY = 0; + } + + /** + * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen + */ + public void ungrabMouseCursor() { + Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); + Mouse.setGrabbed(false); + } + + public void mouseXYChange() { + this.deltaX = Mouse.getDX(); + this.deltaY = Mouse.getDY(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovementInput.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovementInput.java new file mode 100644 index 0000000..9ada2d9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovementInput.java @@ -0,0 +1,18 @@ +package net.minecraft.util; + +public class MovementInput { + /** + * The speed at which the player is strafing. Postive numbers to the left and negative to the right. + */ + public float moveStrafe; + + /** + * The speed at which the player is moving forward. Negative numbers will move backwards. + */ + public float moveForward; + public boolean jump; + public boolean sneak; + + + public void updatePlayerMoveState() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovementInputFromOptions.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovementInputFromOptions.java new file mode 100644 index 0000000..156f944 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovementInputFromOptions.java @@ -0,0 +1,41 @@ +package net.minecraft.util; + +import net.minecraft.client.settings.GameSettings; + +public class MovementInputFromOptions extends MovementInput { + private final GameSettings gameSettings; + + + public MovementInputFromOptions(GameSettings p_i1237_1_) { + this.gameSettings = p_i1237_1_; + } + + public void updatePlayerMoveState() { + this.moveStrafe = 0.0F; + this.moveForward = 0.0F; + + if (this.gameSettings.keyBindForward.getIsKeyPressed()) { + ++this.moveForward; + } + + if (this.gameSettings.keyBindBack.getIsKeyPressed()) { + --this.moveForward; + } + + if (this.gameSettings.keyBindLeft.getIsKeyPressed()) { + ++this.moveStrafe; + } + + if (this.gameSettings.keyBindRight.getIsKeyPressed()) { + --this.moveStrafe; + } + + this.jump = this.gameSettings.keyBindJump.getIsKeyPressed(); + this.sneak = this.gameSettings.keyBindSneak.getIsKeyPressed(); + + if (this.sneak) { + this.moveStrafe = (float)((double)this.moveStrafe * 0.3D); + this.moveForward = (float)((double)this.moveForward * 0.3D); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovingObjectPosition.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovingObjectPosition.java new file mode 100644 index 0000000..4e36150 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/MovingObjectPosition.java @@ -0,0 +1,68 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; + +public class MovingObjectPosition { + /** What type of ray trace hit was this? 0 = block, 1 = entity */ + public MovingObjectPosition.MovingObjectType typeOfHit; + + /** x coordinate of the block ray traced against */ + public int blockX; + + /** y coordinate of the block ray traced against */ + public int blockY; + + /** z coordinate of the block ray traced against */ + public int blockZ; + + /** + * Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West + * = 3, North = 4, South = 5. + */ + public int sideHit; + + /** The vector position of the hit */ + public Vec3 hitVec; + + /** The hit entity */ + public Entity entityHit; + + + public MovingObjectPosition(int p_i2303_1_, int p_i2303_2_, int p_i2303_3_, int p_i2303_4_, Vec3 p_i2303_5_) { + this(p_i2303_1_, p_i2303_2_, p_i2303_3_, p_i2303_4_, p_i2303_5_, true); + } + + public MovingObjectPosition(int p_i45481_1_, int p_i45481_2_, int p_i45481_3_, int p_i45481_4_, Vec3 p_i45481_5_, boolean p_i45481_6_) { + this.typeOfHit = p_i45481_6_ ? MovingObjectPosition.MovingObjectType.BLOCK : MovingObjectPosition.MovingObjectType.MISS; + this.blockX = p_i45481_1_; + this.blockY = p_i45481_2_; + this.blockZ = p_i45481_3_; + this.sideHit = p_i45481_4_; + this.hitVec = Vec3.createVectorHelper(p_i45481_5_.xCoord, p_i45481_5_.yCoord, p_i45481_5_.zCoord); + } + + public MovingObjectPosition(Entity p_i2304_1_) { + this(p_i2304_1_, Vec3.createVectorHelper(p_i2304_1_.posX, p_i2304_1_.posY, p_i2304_1_.posZ)); + } + + public MovingObjectPosition(Entity p_i45482_1_, Vec3 p_i45482_2_) { + this.typeOfHit = MovingObjectPosition.MovingObjectType.ENTITY; + this.entityHit = p_i45482_1_; + this.hitVec = p_i45482_2_; + } + + public String toString() { + return "HitResult{type=" + this.typeOfHit + ", x=" + this.blockX + ", y=" + this.blockY + ", z=" + this.blockZ + ", f=" + this.sideHit + ", pos=" + this.hitVec + ", entity=" + this.entityHit + '}'; + } + + public enum MovingObjectType { + MISS("MISS", 0), + BLOCK("BLOCK", 1), + ENTITY("ENTITY", 2); + + private static final MovingObjectPosition.MovingObjectType[] $VALUES = new MovingObjectPosition.MovingObjectType[]{MISS, BLOCK, ENTITY}; + + + MovingObjectType(String p_i2302_1_, int p_i2302_2_) {} + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java new file mode 100644 index 0000000..6e3af9e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ObjectIntIdentityMap.java @@ -0,0 +1,41 @@ +package net.minecraft.util; + +import com.google.common.base.Predicates; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.IdentityHashMap; +import java.util.Iterator; +import java.util.List; + +public class ObjectIntIdentityMap implements IObjectIntIterable { + private final IdentityHashMap field_148749_a = new IdentityHashMap(512); + private final List field_148748_b = Lists.newArrayList(); + + + public void func_148746_a(Object p_148746_1_, int p_148746_2_) { + this.field_148749_a.put(p_148746_1_, Integer.valueOf(p_148746_2_)); + + while (this.field_148748_b.size() <= p_148746_2_) { + this.field_148748_b.add(null); + } + + this.field_148748_b.set(p_148746_2_, p_148746_1_); + } + + public int func_148747_b(Object p_148747_1_) { + Integer var2 = (Integer)this.field_148749_a.get(p_148747_1_); + return var2 == null ? -1 : var2.intValue(); + } + + public Object func_148745_a(int p_148745_1_) { + return p_148745_1_ >= 0 && p_148745_1_ < this.field_148748_b.size() ? this.field_148748_b.get(p_148745_1_) : null; + } + + public Iterator iterator() { + return Iterators.filter(this.field_148748_b.iterator(), Predicates.notNull()); + } + + public boolean func_148744_b(int p_148744_1_) { + return this.func_148745_a(p_148744_1_) != null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryDefaulted.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryDefaulted.java new file mode 100644 index 0000000..15546d8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryDefaulted.java @@ -0,0 +1,18 @@ +package net.minecraft.util; + +public class RegistryDefaulted extends RegistrySimple { + /** + * Default object for this registry, returned when an object is not found. + */ + private final Object defaultObject; + + + public RegistryDefaulted(Object p_i1366_1_) { + this.defaultObject = p_i1366_1_; + } + + public Object getObject(Object p_82594_1_) { + Object var2 = super.getObject(p_82594_1_); + return var2 == null ? this.defaultObject : var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryNamespaced.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryNamespaced.java new file mode 100644 index 0000000..b40fca9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryNamespaced.java @@ -0,0 +1,95 @@ +package net.minecraft.util; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import java.util.Iterator; +import java.util.Map; + +public class RegistryNamespaced extends RegistrySimple implements IObjectIntIterable { + /** The backing store that maps Integers to objects. */ + protected final ObjectIntIdentityMap underlyingIntegerMap = new ObjectIntIdentityMap(); + protected final Map field_148758_b; + + + public RegistryNamespaced() { + this.field_148758_b = ((BiMap)this.registryObjects).inverse(); + } + + /** + * Adds a new object to this registry, keyed by both the given integer ID and the given string. + */ + public void addObject(int p_148756_1_, String p_148756_2_, Object p_148756_3_) { + this.underlyingIntegerMap.func_148746_a(p_148756_3_, p_148756_1_); + this.putObject(ensureNamespaced(p_148756_2_), p_148756_3_); + } + + /** + * Creates the Map we will use to map keys to their registered values. + */ + protected Map createUnderlyingMap() { + return HashBiMap.create(); + } + + public Object getObject(String p_82594_1_) { + return super.getObject(ensureNamespaced(p_82594_1_)); + } + + /** + * Gets the name we use to identify the given object. + */ + public String getNameForObject(Object p_148750_1_) { + return (String)this.field_148758_b.get(p_148750_1_); + } + + /** + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(String p_148741_1_) { + return super.containsKey(ensureNamespaced(p_148741_1_)); + } + + /** + * Gets the integer ID we use to identify the given object. + */ + public int getIDForObject(Object p_148757_1_) { + return this.underlyingIntegerMap.func_148747_b(p_148757_1_); + } + + /** + * Gets the object identified by the given ID. + */ + public Object getObjectForID(int p_148754_1_) { + return this.underlyingIntegerMap.func_148745_a(p_148754_1_); + } + + public Iterator iterator() { + return this.underlyingIntegerMap.iterator(); + } + + /** + * Gets a value indicating whether this registry contains an object that can be identified by the given integer + * value + */ + public boolean containsID(int p_148753_1_) { + return this.underlyingIntegerMap.func_148744_b(p_148753_1_); + } + + /** + * Ensures that the given name is indicated by a colon-delimited namespace, prepending "minecraft:" if it is not + * already. + */ + private static String ensureNamespaced(String p_148755_0_) { + return p_148755_0_.indexOf(58) == -1 ? "minecraft:" + p_148755_0_ : p_148755_0_; + } + + /** + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(Object p_148741_1_) { + return this.containsKey((String)p_148741_1_); + } + + public Object getObject(Object p_82594_1_) { + return this.getObject((String)p_82594_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java new file mode 100644 index 0000000..50f9f0b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java @@ -0,0 +1,39 @@ +package net.minecraft.util; + +public class RegistryNamespacedDefaultedByKey extends RegistryNamespaced { + private final String field_148760_d; + private Object field_148761_e; + + + public RegistryNamespacedDefaultedByKey(String p_i45127_1_) { + this.field_148760_d = p_i45127_1_; + } + + /** + * Adds a new object to this registry, keyed by both the given integer ID and the given string. + */ + public void addObject(int p_148756_1_, String p_148756_2_, Object p_148756_3_) { + if (this.field_148760_d.equals(p_148756_2_)) { + this.field_148761_e = p_148756_3_; + } + + super.addObject(p_148756_1_, p_148756_2_, p_148756_3_); + } + + public Object getObject(String p_82594_1_) { + Object var2 = super.getObject(p_82594_1_); + return var2 == null ? this.field_148761_e : var2; + } + + /** + * Gets the object identified by the given ID. + */ + public Object getObjectForID(int p_148754_1_) { + Object var2 = super.getObjectForID(p_148754_1_); + return var2 == null ? this.field_148761_e : var2; + } + + public Object getObject(Object p_82594_1_) { + return this.getObject((String)p_82594_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistrySimple.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistrySimple.java new file mode 100644 index 0000000..196325d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/RegistrySimple.java @@ -0,0 +1,52 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RegistrySimple implements IRegistry { + private static final Logger logger = LogManager.getLogger(); + + /** Objects registered on this registry. */ + protected final Map registryObjects = this.createUnderlyingMap(); + + + /** + * Creates the Map we will use to map keys to their registered values. + */ + protected Map createUnderlyingMap() { + return Maps.newHashMap(); + } + + public Object getObject(Object p_82594_1_) { + return this.registryObjects.get(p_82594_1_); + } + + /** + * Register an object on this registry. + */ + public void putObject(Object p_82595_1_, Object p_82595_2_) { + if (this.registryObjects.containsKey(p_82595_1_)) { + logger.debug("Adding duplicate key '" + p_82595_1_ + "' to registry"); + } + + this.registryObjects.put(p_82595_1_, p_82595_2_); + } + + /** + * Gets all the keys recognized by this registry. + */ + public Set getKeys() { + return Collections.unmodifiableSet(this.registryObjects.keySet()); + } + + /** + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(Object p_148741_1_) { + return this.registryObjects.containsKey(p_148741_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ReportedException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ReportedException.java new file mode 100644 index 0000000..c44182c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ReportedException.java @@ -0,0 +1,28 @@ +package net.minecraft.util; + +import net.minecraft.crash.CrashReport; + +public class ReportedException extends RuntimeException { + /** Instance of CrashReport. */ + private final CrashReport theReportedExceptionCrashReport; + + + public ReportedException(CrashReport p_i1356_1_) { + this.theReportedExceptionCrashReport = p_i1356_1_; + } + + /** + * Gets the CrashReport wrapped by this exception. + */ + public CrashReport getCrashReport() { + return this.theReportedExceptionCrashReport; + } + + public Throwable getCause() { + return this.theReportedExceptionCrashReport.getCrashCause(); + } + + public String getMessage() { + return this.theReportedExceptionCrashReport.getDescription(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ResourceLocation.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ResourceLocation.java new file mode 100644 index 0000000..936e700 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ResourceLocation.java @@ -0,0 +1,65 @@ +package net.minecraft.util; + +import org.apache.commons.lang3.Validate; + +public class ResourceLocation { + private final String resourceDomain; + private final String resourcePath; + + + public ResourceLocation(String p_i1292_1_, String p_i1292_2_) { + Validate.notNull(p_i1292_2_); + + if (p_i1292_1_ != null && p_i1292_1_.length() != 0) { + this.resourceDomain = p_i1292_1_; + } else { + this.resourceDomain = "minecraft"; + } + + this.resourcePath = p_i1292_2_; + } + + public ResourceLocation(String p_i1293_1_) { + String var2 = "minecraft"; + String var3 = p_i1293_1_; + int var4 = p_i1293_1_.indexOf(58); + + if (var4 >= 0) { + var3 = p_i1293_1_.substring(var4 + 1); + + if (var4 > 1) { + var2 = p_i1293_1_.substring(0, var4); + } + } + + this.resourceDomain = var2.toLowerCase(); + this.resourcePath = var3; + } + + public String getResourcePath() { + return this.resourcePath; + } + + public String getResourceDomain() { + return this.resourceDomain; + } + + public String toString() { + return this.resourceDomain + ":" + this.resourcePath; + } + + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { + return true; + } else if (!(p_equals_1_ instanceof ResourceLocation)) { + return false; + } else { + ResourceLocation var2 = (ResourceLocation)p_equals_1_; + return this.resourceDomain.equals(var2.resourceDomain) && this.resourcePath.equals(var2.resourcePath); + } + } + + public int hashCode() { + return 31 * this.resourceDomain.hashCode() + this.resourcePath.hashCode(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ScreenShotHelper.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ScreenShotHelper.java new file mode 100644 index 0000000..0f049da --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ScreenShotHelper.java @@ -0,0 +1,212 @@ +package net.minecraft.util; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.shader.FrameBuffer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.image.BufferedImage; +import java.awt.image.RenderedImage; +import java.io.File; +import java.io.IOException; +import java.nio.IntBuffer; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ScreenShotHelper { + private static final Logger logger = LogManager.getLogger(); + private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"); + private static IntBuffer pixelBuffer; + private static int[] pixelValues; + + public static IChatComponent lIIIIlIIllIIlIIlIIIlIIllI(File file, int n, int n2, FrameBuffer frameBuffer) { + return ScreenShotHelper.lIIIIlIIllIIlIIlIIIlIIllI(file, null, n, n2, frameBuffer); + } + + public static void saveScreenshot(File file, int n, int n2, FrameBuffer frameBuffer) { + try { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().shutterSound.getValue()) { + CheatBreaker.getInstance().getAudioManager().playSound("shutter"); + } + File file2 = new File(file, "screenshots"); + if (!file2.exists()) { + file2.mkdir(); + } + if (OpenGlHelper.isFramebufferEnabled()) { + n = frameBuffer.framebufferTextureWidth; + n2 = frameBuffer.framebufferTextureHeight; + } + int n3 = n * n2; + if (pixelBuffer == null || pixelBuffer.capacity() < n3) { + pixelBuffer = BufferUtils.createIntBuffer(n3); + pixelValues = new int[n3]; + } + GL11.glPixelStorei(3333, 1); + GL11.glPixelStorei(3317, 1); + pixelBuffer.clear(); + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glBindTexture(3553, frameBuffer.framebufferTexture); + GL11.glGetTexImage(3553, 0, 32993, 33639, pixelBuffer); + } else { + GL11.glReadPixels(0, 0, n, n2, 32993, 33639, pixelBuffer); + } + pixelBuffer.get(pixelValues); + int n4 = n; + int n5 = n2; + new Thread(() -> { + TextureUtil.func_147953_a(pixelValues, n4, n5); + BufferedImage bufferedImage = null; + if (OpenGlHelper.isFramebufferEnabled()) { + int n33; + bufferedImage = new BufferedImage(frameBuffer.framebufferWidth, frameBuffer.framebufferHeight, 1); + for (int i = n33 = frameBuffer.framebufferTextureHeight - frameBuffer.framebufferHeight; i < frameBuffer.framebufferTextureHeight; ++i) { + for (int j = 0; j < frameBuffer.framebufferWidth; ++j) { + bufferedImage.setRGB(j, i - n33, pixelValues[i * frameBuffer.framebufferTextureWidth + j]); + } + } + } else { + bufferedImage = new BufferedImage(n4, n5, 1); + bufferedImage.setRGB(0, 0, n4, n5, pixelValues, 0, n4); + } + File file22 = ScreenShotHelper.getTimestampedPNGFileForDirectory(file2); + try { + ImageIO.write(bufferedImage, "png", file22); + ChatComponentText open = new ChatComponentText(EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().compactOptions.getValue() ? " [OPN]" : " [Open]")); + open.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, file22.getCanonicalPath())); + open.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(file22.getName()))); + ChatComponentText copy = new ChatComponentText(EnumChatFormatting.BLUE + "" + EnumChatFormatting.BOLD + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().compactOptions.getValue() ? " [CPY]" : " [Copy]")); + copy.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.COPY_SCREENSHOT, file22.getName())); + copy.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("Copy the screenshot"))); + ChatComponentText upload = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().compactOptions.getValue() ? " [UPL]" : " [Upload]")); + upload.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.UPLOAD_SCREENSHOT, file22.getName())); + upload.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("Upload to " + EnumChatFormatting.GREEN + "imgur.com & open"))); + ChatComponentText savedMessage = new ChatComponentText("Saved" + ((Boolean) CheatBreaker.getInstance().getGlobalSettings().copyAutomatically.getValue() ? " and copied " : " ") + "screenshot"); + savedMessage.getChatStyle().setUnderlined(true); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().openOption.getValue()) savedMessage.appendSibling(open); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().copyOption.getValue()) savedMessage.appendSibling(copy); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().uploadOption.getValue()) savedMessage.appendSibling(upload); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().copyAutomatically.getValue()) IllIlIIIllllIIllIIlllIIlI(file22.getName()); + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().sendScreenshotMessage.getValue()) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().func_146227_a(savedMessage); + } + + } catch (IOException iOException) { + logger.warn("Couldn't save screenshot"); + } + }).start(); + } catch (Exception exception) { + logger.warn("Couldn't save screenshot", exception); + } + } + + public static void IllIlIIIllllIIllIIlllIIlI(String var1) { + File var2 = new File(Minecraft.getMinecraft().mcDataDir + File.separator + "screenshots" + File.separator + var1); + List listOfFiles = new ArrayList(); + listOfFiles.add(var2); + + CheatBreaker.getInstance().getModuleManager().notificationsMod.send("Info", "&9Copied &fscreenshot.", 2000L); + + IllIlIIIllllIIIllIIlllIIll ft = new IllIlIIIllllIIIllIIlllIIll(listOfFiles); + + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ft, (clipboard, contents) -> System.out.println("Lost ownership")); + } + + public static class IllIlIIIllllIIIllIIlllIIll implements Transferable { + + private final List n; + + public IllIlIIIllllIIIllIIlllIIll(List n) { + this.n = n; + } + + @Override + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[]{DataFlavor.javaFileListFlavor}; + } + + @Override + public boolean isDataFlavorSupported(DataFlavor flavor) { + return DataFlavor.javaFileListFlavor.equals(flavor); + } + + @Override + public Object getTransferData(DataFlavor flavor) { + return n; + } + } + + public static IChatComponent lIIIIlIIllIIlIIlIIIlIIllI(File file, String string, int n, int n2, FrameBuffer frameBuffer) { + try { + File file2 = new File(file, "screenshots"); + if (!file2.exists()) { + file2.mkdir(); + } + if (OpenGlHelper.isFramebufferEnabled()) { + n = frameBuffer.framebufferTextureWidth; + n2 = frameBuffer.framebufferTextureHeight; + } + int n3 = n * n2; + if (pixelBuffer == null || pixelBuffer.capacity() < n3) { + pixelBuffer = BufferUtils.createIntBuffer(n3); + pixelValues = new int[n3]; + } + GL11.glPixelStorei(3333, 1); + GL11.glPixelStorei(3317, 1); + pixelBuffer.clear(); + if (OpenGlHelper.isFramebufferEnabled()) { + GL11.glBindTexture(3553, frameBuffer.framebufferTexture); + GL11.glGetTexImage(3553, 0, 32993, 33639, pixelBuffer); + } else { + GL11.glReadPixels(0, 0, n, n2, 32993, 33639, pixelBuffer); + } + pixelBuffer.get(pixelValues); + TextureUtil.func_147953_a(pixelValues, n, n2); + BufferedImage bufferedImage = null; + if (OpenGlHelper.isFramebufferEnabled()) { + int n4; + bufferedImage = new BufferedImage(frameBuffer.framebufferWidth, frameBuffer.framebufferHeight, 1); + for (int i = n4 = frameBuffer.framebufferTextureHeight - frameBuffer.framebufferHeight; i < frameBuffer.framebufferTextureHeight; ++i) { + for (int j = 0; j < frameBuffer.framebufferWidth; ++j) { + bufferedImage.setRGB(j, i - n4, pixelValues[i * frameBuffer.framebufferTextureWidth + j]); + } + } + } else { + bufferedImage = new BufferedImage(n, n2, 1); + bufferedImage.setRGB(0, 0, n, n2, pixelValues, 0, n); + } + File file3 = string == null ? ScreenShotHelper.getTimestampedPNGFileForDirectory(file2) : new File(file2, string); + ImageIO.write(bufferedImage, "png", file3); + ChatComponentText chatComponentText = new ChatComponentText(file3.getName()); + chatComponentText.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, file3.getAbsolutePath())); + chatComponentText.getChatStyle().setUnderlined(true); + return new ChatComponentTranslation("screenshot.success", chatComponentText); + } catch (Exception exception) { + logger.warn("Couldn't save screenshot", exception); + return new ChatComponentTranslation("screenshot.failure", exception.getMessage()); + } + } + + private static File getTimestampedPNGFileForDirectory(File file) { + String string = dateFormat.format(new Date()); + int n = 1; + File file2; + while ((file2 = new File(file, string + (n == 1 ? "" : "_" + n) + ".png")).exists()) { + ++n; + } + return file2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Session.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Session.java new file mode 100644 index 0000000..3d746f9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Session.java @@ -0,0 +1,83 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import com.mojang.util.UUIDTypeAdapter; +import java.util.Map; +import java.util.UUID; + +public class Session { + private final String username; + private final String playerID; + private final String token; + private final Session.Type field_152429_d; + + + public Session(String p_i1098_1_, String p_i1098_2_, String p_i1098_3_, String p_i1098_4_) { + this.username = p_i1098_1_; + this.playerID = p_i1098_2_; + this.token = p_i1098_3_; + this.field_152429_d = Session.Type.func_152421_a(p_i1098_4_); + } + + public String getSessionID() { + return "token:" + this.token + ":" + this.playerID; + } + + public String getPlayerID() { + return this.playerID; + } + + public String getUsername() { + return this.username; + } + + public String getToken() { + return this.token; + } + + public GameProfile func_148256_e() { + try { + UUID var1 = UUIDTypeAdapter.fromString(this.getPlayerID()); + return new GameProfile(var1, this.getUsername()); + } catch (IllegalArgumentException var2) { + return new GameProfile(null, this.getUsername()); + } + } + + public Session.Type func_152428_f() { + return this.field_152429_d; + } + + public UUID getUniqueID() { + return func_148256_e().getId(); + } + + public enum Type { + LEGACY("LEGACY", 0, "legacy"), + MOJANG("MOJANG", 1, "mojang"); + private static final Map field_152425_c = Maps.newHashMap(); + private final String field_152426_d; + + private static final Session.Type[] $VALUES = new Session.Type[]{LEGACY, MOJANG}; + + + Type(String p_i1096_1_, int p_i1096_2_, String p_i1096_3_) { + this.field_152426_d = p_i1096_3_; + } + + public static Session.Type func_152421_a(String p_152421_0_) { + return (Session.Type)field_152425_c.get(p_152421_0_.toLowerCase()); + } + + static { + Session.Type[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + Session.Type var3 = var0[var2]; + field_152425_c.put(var3.field_152426_d, var3); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StatCollector.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StatCollector.java new file mode 100644 index 0000000..9544d7a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StatCollector.java @@ -0,0 +1,48 @@ +package net.minecraft.util; + +public class StatCollector { + private static final StringTranslate localizedName = StringTranslate.getInstance(); + + /** + * A StringTranslate instance using the hardcoded default locale (en_US). Used as a fallback in case the shared + * StringTranslate singleton instance fails to translate a key. + */ + private static final StringTranslate fallbackTranslator = new StringTranslate(); + + + /** + * Translates a Stat name + */ + public static String translateToLocal(String p_74838_0_) { + return localizedName.translateKey(p_74838_0_); + } + + /** + * Translates a Stat name with format args + */ + public static String translateToLocalFormatted(String p_74837_0_, Object ... p_74837_1_) { + return localizedName.translateKeyFormat(p_74837_0_, p_74837_1_); + } + + /** + * Translates a Stat name using the fallback (hardcoded en_US) locale. Looks like it's only intended to be used if + * translateToLocal fails. + */ + public static String translateToFallback(String p_150826_0_) { + return fallbackTranslator.translateKey(p_150826_0_); + } + + /** + * Determines whether or not translateToLocal will find a translation for the given key. + */ + public static boolean canTranslate(String p_94522_0_) { + return localizedName.containsTranslateKey(p_94522_0_); + } + + /** + * Gets the time, in milliseconds since epoch, that the translation mapping was last updated + */ + public static long getLastTranslationUpdateTimeInMilliseconds() { + return localizedName.getLastUpdateTimeInMilliseconds(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StringTranslate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StringTranslate.java new file mode 100644 index 0000000..db9cdf0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StringTranslate.java @@ -0,0 +1,109 @@ +package net.minecraft.util; + +import com.cheatbreaker.client.network.agent.AgentResources; +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.IllegalFormatException; +import java.util.Map; +import java.util.regex.Pattern; + +public class StringTranslate { + /** + * Pattern that matches numeric variable placeholders in a resource string, such as "%d", "%3$d", "%.2f" + */ + private static final Pattern numericVariablePattern = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + + /** + * A Splitter that splits a string on the first "=". For example, "a=b=c" would split into ["a", "b=c"]. + */ + private static final Splitter equalSignSplitter = Splitter.on('=').limit(2); + + /** Is the private singleton instance of StringTranslate. */ + private static final StringTranslate instance = new StringTranslate(); + private final Map languageList = Maps.newHashMap(); + + /** + * The time, in milliseconds since epoch, that this instance was last updated + */ + private long lastUpdateTimeInMilliseconds; + + + public StringTranslate() { + try { + InputStream inputStream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); + if (inputStream == null && AgentResources.existsBytes("assets/minecraft/lang/en_US.lang")) { + inputStream = new ByteArrayInputStream(AgentResources.getBytesNative("assets/minecraft/lang/en_US.lang")); + } + for (String string : IOUtils.readLines(inputStream, Charsets.UTF_8)) { + String[] arrstring; + if (string.isEmpty() || string.charAt(0) == '#' || (arrstring = Iterables.toArray(equalSignSplitter.split(string), String.class)) == null || arrstring.length != 2) continue; + String string2 = arrstring[0]; + String string3 = numericVariablePattern.matcher(arrstring[1]).replaceAll("%$1s"); + this.languageList.put(string2, string3); + } + this.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } catch (IOException ignored) {} + } + + /** + * Return the StringTranslate singleton instance + */ + static StringTranslate getInstance() { + return instance; + } + + /** + * Replaces all the current instance's translations with the ones that are passed in. + */ + public static synchronized void replaceWith(Map p_135063_0_) { + instance.languageList.clear(); + instance.languageList.putAll(p_135063_0_); + instance.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } + + /** + * Translate a key to current language. + */ + public synchronized String translateKey(String p_74805_1_) { + return this.tryTranslateKey(p_74805_1_); + } + + /** + * Translate a key to current language applying String.format() + */ + public synchronized String translateKeyFormat(String p_74803_1_, Object ... p_74803_2_) { + String var3 = this.tryTranslateKey(p_74803_1_); + + try { + return String.format(var3, p_74803_2_); + } catch (IllegalFormatException var5) { + return "Format error: " + var3; + } + } + + /** + * Tries to look up a translation for the given key; spits back the key if no result was found. + */ + private String tryTranslateKey(String p_135064_1_) { + String var2 = (String)this.languageList.get(p_135064_1_); + return var2 == null ? p_135064_1_ : var2; + } + + public synchronized boolean containsTranslateKey(String p_94520_1_) { + return this.languageList.containsKey(p_94520_1_); + } + + /** + * Gets the time, in milliseconds since epoch, that this instance was last updated + */ + public long getLastUpdateTimeInMilliseconds() { + return this.lastUpdateTimeInMilliseconds; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StringUtils.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StringUtils.java new file mode 100644 index 0000000..f720eb0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/StringUtils.java @@ -0,0 +1,29 @@ +package net.minecraft.util; + +import java.util.regex.Pattern; + +public class StringUtils { + private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); + + + /** + * Returns the time elapsed for the given number of ticks, in "mm:ss" format. + */ + public static String ticksToElapsedTime(int p_76337_0_) { + int var1 = p_76337_0_ / 20; + int var2 = var1 / 60; + var1 %= 60; + return var1 < 10 ? var2 + ":0" + var1 : var2 + ":" + var1; + } + + public static String stripControlCodes(String p_76338_0_) { + return patternControlCode.matcher(p_76338_0_).replaceAll(""); + } + + /** + * Returns a value indicating whether the given string is null or empty. + */ + public static boolean isNullOrEmpty(String p_151246_0_) { + return p_151246_0_ == null || "".equals(p_151246_0_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ThreadSafeBoundList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ThreadSafeBoundList.java new file mode 100644 index 0000000..28e630d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/ThreadSafeBoundList.java @@ -0,0 +1,57 @@ +package net.minecraft.util; + +import java.lang.reflect.Array; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +public class ThreadSafeBoundList { + private final Object[] field_152759_a; + private final Class field_152760_b; + private final ReadWriteLock field_152761_c = new ReentrantReadWriteLock(); + private int field_152762_d; + private int field_152763_e; + + + public ThreadSafeBoundList(Class p_i1126_1_, int p_i1126_2_) { + this.field_152760_b = p_i1126_1_; + this.field_152759_a = (Object[]) Array.newInstance(p_i1126_1_, p_i1126_2_); + } + + public Object func_152757_a(Object p_152757_1_) { + this.field_152761_c.writeLock().lock(); + this.field_152759_a[this.field_152763_e] = p_152757_1_; + this.field_152763_e = (this.field_152763_e + 1) % this.func_152758_b(); + + if (this.field_152762_d < this.func_152758_b()) { + ++this.field_152762_d; + } + + this.field_152761_c.writeLock().unlock(); + return p_152757_1_; + } + + public int func_152758_b() { + this.field_152761_c.readLock().lock(); + int var1 = this.field_152759_a.length; + this.field_152761_c.readLock().unlock(); + return var1; + } + + public Object[] func_152756_c() { + Object[] var1 = (Object[]) Array.newInstance(this.field_152760_b, this.field_152762_d); + this.field_152761_c.readLock().lock(); + + for (int var2 = 0; var2 < this.field_152762_d; ++var2) { + int var3 = (this.field_152763_e - this.field_152762_d + var2) % this.func_152758_b(); + + if (var3 < 0) { + var3 += this.func_152758_b(); + } + + var1[var2] = this.field_152759_a[var3]; + } + + this.field_152761_c.readLock().unlock(); + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Timer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Timer.java new file mode 100644 index 0000000..b2e5aa3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Timer.java @@ -0,0 +1,108 @@ +package net.minecraft.util; + +import net.minecraft.client.Minecraft; + +public class Timer { + /** The number of timer ticks per second of real time */ + float ticksPerSecond; + + /** + * The time reported by the high-resolution clock at the last call of updateTimer(), in seconds + */ + private double lastHRTime; + + /** + * How many full ticks have turned over since the last call to updateTimer(), capped at 10. + */ + public int elapsedTicks; + + /** + * How much time has elapsed since the last tick, in ticks, for use by display rendering routines (range: 0.0 - + * 1.0). This field is frozen if the display is paused to eliminate jitter. + */ + public float renderPartialTicks; + + /** + * A multiplier to make the timer (and therefore the game) go faster or slower. 0.5 makes the game run at half- + * speed. + */ + public float timerSpeed = 1.0F; + + /** + * How much time has elapsed since the last tick, in ticks (range: 0.0 - 1.0). + */ + public float elapsedPartialTicks; + + /** + * The time reported by the system clock at the last sync, in milliseconds + */ + private long lastSyncSysClock; + + /** + * The time reported by the high-resolution clock at the last sync, in milliseconds + */ + private long lastSyncHRClock; + private long field_74285_i; + + /** + * A ratio used to sync the high-resolution clock to the system clock, updated once per second + */ + private double timeSyncAdjustment = 1.0D; + + + public Timer(float p_i1018_1_) { + this.ticksPerSecond = p_i1018_1_; + this.lastSyncSysClock = Minecraft.getSystemTime(); + this.lastSyncHRClock = System.nanoTime() / 1000000L; + } + + /** + * Updates all fields of the Timer using the current time + */ + public void updateTimer() { + long var1 = Minecraft.getSystemTime(); + long var3 = var1 - this.lastSyncSysClock; + long var5 = System.nanoTime() / 1000000L; + double var7 = (double)var5 / 1000.0D; + + if (var3 <= 1000L && var3 >= 0L) { + this.field_74285_i += var3; + + if (this.field_74285_i > 1000L) { + long var9 = var5 - this.lastSyncHRClock; + double var11 = (double)this.field_74285_i / (double)var9; + this.timeSyncAdjustment += (var11 - this.timeSyncAdjustment) * 0.20000000298023224D; + this.lastSyncHRClock = var5; + this.field_74285_i = 0L; + } + + if (this.field_74285_i < 0L) { + this.lastSyncHRClock = var5; + } + } else { + this.lastHRTime = var7; + } + + this.lastSyncSysClock = var1; + double var13 = (var7 - this.lastHRTime) * this.timeSyncAdjustment; + this.lastHRTime = var7; + + if (var13 < 0.0D) { + var13 = 0.0D; + } + + if (var13 > 1.0D) { + var13 = 1.0D; + } + + this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + var13 * (double)this.timerSpeed * (double)this.ticksPerSecond); + this.elapsedTicks = (int)this.elapsedPartialTicks; + this.elapsedPartialTicks -= (float)this.elapsedTicks; + + if (this.elapsedTicks > 10) { + this.elapsedTicks = 10; + } + + this.renderPartialTicks = this.elapsedPartialTicks; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Tuple.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Tuple.java new file mode 100644 index 0000000..f182c94 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Tuple.java @@ -0,0 +1,29 @@ +package net.minecraft.util; + +public class Tuple { + /** First Object in the Tuple */ + private final Object first; + + /** Second Object in the Tuple */ + private final Object second; + + + public Tuple(Object p_i1555_1_, Object p_i1555_2_) { + this.first = p_i1555_1_; + this.second = p_i1555_2_; + } + + /** + * Get the first Object in the Tuple + */ + public Object getFirst() { + return this.first; + } + + /** + * Get the second Object in the Tuple + */ + public Object getSecond() { + return this.second; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java new file mode 100644 index 0000000..1e911b8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/TupleIntJsonSerializable.java @@ -0,0 +1,35 @@ +package net.minecraft.util; + +public class TupleIntJsonSerializable { + private int integerValue; + private IJsonSerializable jsonSerializableValue; + + + /** + * Gets the integer value stored in this tuple. + */ + public int getIntegerValue() { + return this.integerValue; + } + + /** + * Sets this tuple's integer value to the given value. + */ + public void setIntegerValue(int p_151188_1_) { + this.integerValue = p_151188_1_; + } + + /** + * Gets the JsonSerializable value stored in this tuple. + */ + public IJsonSerializable getJsonSerializableValue() { + return this.jsonSerializableValue; + } + + /** + * Sets this tuple's JsonSerializable value to the given value. + */ + public void setJsonSerializableValue(IJsonSerializable p_151190_1_) { + this.jsonSerializableValue = p_151190_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Util.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Util.java new file mode 100644 index 0000000..1d8dd02 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Util.java @@ -0,0 +1,23 @@ +package net.minecraft.util; + +public class Util { + + + public static Util.EnumOS getOSType() { + String var0 = System.getProperty("os.name").toLowerCase(); + return var0.contains("win") ? Util.EnumOS.WINDOWS : (var0.contains("mac") ? Util.EnumOS.OSX : (var0.contains("solaris") ? Util.EnumOS.SOLARIS : (var0.contains("sunos") ? Util.EnumOS.SOLARIS : (var0.contains("linux") ? Util.EnumOS.LINUX : (var0.contains("unix") ? Util.EnumOS.LINUX : Util.EnumOS.UNKNOWN))))); + } + + public enum EnumOS { + LINUX("LINUX", 0), + SOLARIS("SOLARIS", 1), + WINDOWS("WINDOWS", 2), + OSX("OSX", 3), + UNKNOWN("UNKNOWN", 4); + + private static final Util.EnumOS[] $VALUES = new Util.EnumOS[]{LINUX, SOLARIS, WINDOWS, OSX, UNKNOWN}; + + + EnumOS(String p_i1357_1_, int p_i1357_2_) {} + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Vec3.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Vec3.java new file mode 100644 index 0000000..959a099 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/Vec3.java @@ -0,0 +1,211 @@ +package net.minecraft.util; + +public class Vec3 { + /** X coordinate of Vec3D */ + public double xCoord; + + /** Y coordinate of Vec3D */ + public double yCoord; + + /** Z coordinate of Vec3D */ + public double zCoord; + + + /** + * Static method for creating a new Vec3D given the three x,y,z values. This is only called from the other static + * method which creates and places it in the list. + */ + public static Vec3 createVectorHelper(double p_72443_0_, double p_72443_2_, double p_72443_4_) { + return new Vec3(p_72443_0_, p_72443_2_, p_72443_4_); + } + + public Vec3(double p_i1108_1_, double p_i1108_3_, double p_i1108_5_) { + if (p_i1108_1_ == -0.0D) { + p_i1108_1_ = 0.0D; + } + + if (p_i1108_3_ == -0.0D) { + p_i1108_3_ = 0.0D; + } + + if (p_i1108_5_ == -0.0D) { + p_i1108_5_ = 0.0D; + } + + this.xCoord = p_i1108_1_; + this.yCoord = p_i1108_3_; + this.zCoord = p_i1108_5_; + } + + /** + * Sets the x,y,z components of the vector as specified. + */ + protected Vec3 setComponents(double p_72439_1_, double p_72439_3_, double p_72439_5_) { + this.xCoord = p_72439_1_; + this.yCoord = p_72439_3_; + this.zCoord = p_72439_5_; + return this; + } + + /** + * Returns a new vector with the result of the specified vector minus this. + */ + public Vec3 subtract(Vec3 p_72444_1_) { + return createVectorHelper(p_72444_1_.xCoord - this.xCoord, p_72444_1_.yCoord - this.yCoord, p_72444_1_.zCoord - this.zCoord); + } + + /** + * Normalizes the vector to a length of 1 (except if it is the zero vector) + */ + public Vec3 normalize() { + double var1 = MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + return var1 < 1.0E-4D ? createVectorHelper(0.0D, 0.0D, 0.0D) : createVectorHelper(this.xCoord / var1, this.yCoord / var1, this.zCoord / var1); + } + + public double dotProduct(Vec3 p_72430_1_) { + return this.xCoord * p_72430_1_.xCoord + this.yCoord * p_72430_1_.yCoord + this.zCoord * p_72430_1_.zCoord; + } + + /** + * Returns a new vector with the result of this vector x the specified vector. + */ + public Vec3 crossProduct(Vec3 p_72431_1_) { + return createVectorHelper(this.yCoord * p_72431_1_.zCoord - this.zCoord * p_72431_1_.yCoord, this.zCoord * p_72431_1_.xCoord - this.xCoord * p_72431_1_.zCoord, this.xCoord * p_72431_1_.yCoord - this.yCoord * p_72431_1_.xCoord); + } + + /** + * Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this + * vector. + */ + public Vec3 addVector(double p_72441_1_, double p_72441_3_, double p_72441_5_) { + return createVectorHelper(this.xCoord + p_72441_1_, this.yCoord + p_72441_3_, this.zCoord + p_72441_5_); + } + + /** + * Euclidean distance between this and the specified vector, returned as double. + */ + public double distanceTo(Vec3 p_72438_1_) { + double var2 = p_72438_1_.xCoord - this.xCoord; + double var4 = p_72438_1_.yCoord - this.yCoord; + double var6 = p_72438_1_.zCoord - this.zCoord; + return MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6); + } + + /** + * The square of the Euclidean distance between this and the specified vector. + */ + public double squareDistanceTo(Vec3 p_72436_1_) { + double var2 = p_72436_1_.xCoord - this.xCoord; + double var4 = p_72436_1_.yCoord - this.yCoord; + double var6 = p_72436_1_.zCoord - this.zCoord; + return var2 * var2 + var4 * var4 + var6 * var6; + } + + /** + * The square of the Euclidean distance between this and the vector of x,y,z components passed in. + */ + public double squareDistanceTo(double p_72445_1_, double p_72445_3_, double p_72445_5_) { + double var7 = p_72445_1_ - this.xCoord; + double var9 = p_72445_3_ - this.yCoord; + double var11 = p_72445_5_ - this.zCoord; + return var7 * var7 + var9 * var9 + var11 * var11; + } + + /** + * Returns the length of the vector. + */ + public double lengthVector() { + return MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + } + + /** + * Returns a new vector with x value equal to the second parameter, along the line between this vector and the + * passed in vector, or null if not possible. + */ + public Vec3 getIntermediateWithXValue(Vec3 p_72429_1_, double p_72429_2_) { + double var4 = p_72429_1_.xCoord - this.xCoord; + double var6 = p_72429_1_.yCoord - this.yCoord; + double var8 = p_72429_1_.zCoord - this.zCoord; + + if (var4 * var4 < 1.0000000116860974E-7D) { + return null; + } else { + double var10 = (p_72429_2_ - this.xCoord) / var4; + return var10 >= 0.0D && var10 <= 1.0D ? createVectorHelper(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; + } + } + + /** + * Returns a new vector with y value equal to the second parameter, along the line between this vector and the + * passed in vector, or null if not possible. + */ + public Vec3 getIntermediateWithYValue(Vec3 p_72435_1_, double p_72435_2_) { + double var4 = p_72435_1_.xCoord - this.xCoord; + double var6 = p_72435_1_.yCoord - this.yCoord; + double var8 = p_72435_1_.zCoord - this.zCoord; + + if (var6 * var6 < 1.0000000116860974E-7D) { + return null; + } else { + double var10 = (p_72435_2_ - this.yCoord) / var6; + return var10 >= 0.0D && var10 <= 1.0D ? createVectorHelper(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; + } + } + + /** + * Returns a new vector with z value equal to the second parameter, along the line between this vector and the + * passed in vector, or null if not possible. + */ + public Vec3 getIntermediateWithZValue(Vec3 p_72434_1_, double p_72434_2_) { + double var4 = p_72434_1_.xCoord - this.xCoord; + double var6 = p_72434_1_.yCoord - this.yCoord; + double var8 = p_72434_1_.zCoord - this.zCoord; + + if (var8 * var8 < 1.0000000116860974E-7D) { + return null; + } else { + double var10 = (p_72434_2_ - this.zCoord) / var8; + return var10 >= 0.0D && var10 <= 1.0D ? createVectorHelper(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; + } + } + + public String toString() { + return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")"; + } + + /** + * Rotates the vector around the x axis by the specified angle. + */ + public void rotateAroundX(float p_72440_1_) { + float var2 = MathHelper.cos(p_72440_1_); + float var3 = MathHelper.sin(p_72440_1_); + double var4 = this.xCoord; + double var6 = this.yCoord * (double)var2 + this.zCoord * (double)var3; + double var8 = this.zCoord * (double)var2 - this.yCoord * (double)var3; + this.setComponents(var4, var6, var8); + } + + /** + * Rotates the vector around the y axis by the specified angle. + */ + public void rotateAroundY(float p_72442_1_) { + float var2 = MathHelper.cos(p_72442_1_); + float var3 = MathHelper.sin(p_72442_1_); + double var4 = this.xCoord * (double)var2 + this.zCoord * (double)var3; + double var6 = this.yCoord; + double var8 = this.zCoord * (double)var2 - this.xCoord * (double)var3; + this.setComponents(var4, var6, var8); + } + + /** + * Rotates the vector around the z axis by the specified angle. + */ + public void rotateAroundZ(float p_72446_1_) { + float var2 = MathHelper.cos(p_72446_1_); + float var3 = MathHelper.sin(p_72446_1_); + double var4 = this.xCoord * (double)var2 + this.yCoord * (double)var3; + double var6 = this.yCoord * (double)var2 - this.xCoord * (double)var3; + double var8 = this.zCoord; + this.setComponents(var4, var6, var8); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandom.java new file mode 100644 index 0000000..21e9336 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandom.java @@ -0,0 +1,111 @@ +package net.minecraft.util; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Random; + +public class WeightedRandom { + + + /** + * Returns the total weight of all items in a collection. + */ + public static int getTotalWeight(Collection p_76272_0_) { + int var1 = 0; + WeightedRandom.Item var3; + + for (Iterator var2 = p_76272_0_.iterator(); var2.hasNext(); var1 += var3.itemWeight) { + var3 = (WeightedRandom.Item)var2.next(); + } + + return var1; + } + + /** + * Returns a random choice from the input items, with a total weight value. + */ + public static WeightedRandom.Item getRandomItem(Random p_76273_0_, Collection p_76273_1_, int p_76273_2_) { + if (p_76273_2_ <= 0) { + throw new IllegalArgumentException(); + } else { + int var3 = p_76273_0_.nextInt(p_76273_2_); + Iterator var4 = p_76273_1_.iterator(); + WeightedRandom.Item var5; + + do { + if (!var4.hasNext()) { + return null; + } + + var5 = (WeightedRandom.Item)var4.next(); + var3 -= var5.itemWeight; + } + while (var3 >= 0); + + return var5; + } + } + + /** + * Returns a random choice from the input items. + */ + public static WeightedRandom.Item getRandomItem(Random p_76271_0_, Collection p_76271_1_) { + return getRandomItem(p_76271_0_, p_76271_1_, getTotalWeight(p_76271_1_)); + } + + /** + * Returns the total weight of all items in a array. + */ + public static int getTotalWeight(WeightedRandom.Item[] p_76270_0_) { + int var1 = 0; + WeightedRandom.Item[] var2 = p_76270_0_; + int var3 = p_76270_0_.length; + + for (int var4 = 0; var4 < var3; ++var4) { + WeightedRandom.Item var5 = var2[var4]; + var1 += var5.itemWeight; + } + + return var1; + } + + /** + * Returns a random choice from the input array of items, with a total weight value. + */ + public static WeightedRandom.Item getRandomItem(Random p_76269_0_, WeightedRandom.Item[] p_76269_1_, int p_76269_2_) { + if (p_76269_2_ <= 0) { + throw new IllegalArgumentException(); + } else { + int var3 = p_76269_0_.nextInt(p_76269_2_); + WeightedRandom.Item[] var4 = p_76269_1_; + int var5 = p_76269_1_.length; + + for (int var6 = 0; var6 < var5; ++var6) { + WeightedRandom.Item var7 = var4[var6]; + var3 -= var7.itemWeight; + + if (var3 < 0) { + return var7; + } + } + + return null; + } + } + + /** + * Returns a random choice from the input items. + */ + public static WeightedRandom.Item getRandomItem(Random p_76274_0_, WeightedRandom.Item[] p_76274_1_) { + return getRandomItem(p_76274_0_, p_76274_1_, getTotalWeight(p_76274_1_)); + } + + public static class Item { + protected int itemWeight; + + + public Item(int p_i1556_1_) { + this.itemWeight = p_i1556_1_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandomChestContent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandomChestContent.java new file mode 100644 index 0000000..86854d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandomChestContent.java @@ -0,0 +1,93 @@ +package net.minecraft.util; + +import java.util.Random; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityDispenser; + +public class WeightedRandomChestContent extends WeightedRandom.Item { + /** The Item/Block ID to generate in the Chest. */ + private final ItemStack theItemId; + + /** The minimum chance of item generating. */ + private final int theMinimumChanceToGenerateItem; + + /** The maximum chance of item generating. */ + private final int theMaximumChanceToGenerateItem; + + + public WeightedRandomChestContent(Item p_i45311_1_, int p_i45311_2_, int p_i45311_3_, int p_i45311_4_, int p_i45311_5_) { + super(p_i45311_5_); + this.theItemId = new ItemStack(p_i45311_1_, 1, p_i45311_2_); + this.theMinimumChanceToGenerateItem = p_i45311_3_; + this.theMaximumChanceToGenerateItem = p_i45311_4_; + } + + public WeightedRandomChestContent(ItemStack p_i1558_1_, int p_i1558_2_, int p_i1558_3_, int p_i1558_4_) { + super(p_i1558_4_); + this.theItemId = p_i1558_1_; + this.theMinimumChanceToGenerateItem = p_i1558_2_; + this.theMaximumChanceToGenerateItem = p_i1558_3_; + } + + /** + * Generates the Chest contents. + */ + public static void generateChestContents(Random p_76293_0_, WeightedRandomChestContent[] p_76293_1_, IInventory p_76293_2_, int p_76293_3_) { + for (int var4 = 0; var4 < p_76293_3_; ++var4) { + WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(p_76293_0_, p_76293_1_); + int var6 = var5.theMinimumChanceToGenerateItem + p_76293_0_.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1); + + if (var5.theItemId.getMaxStackSize() >= var6) { + ItemStack var7 = var5.theItemId.copy(); + var7.stackSize = var6; + p_76293_2_.setInventorySlotContents(p_76293_0_.nextInt(p_76293_2_.getSizeInventory()), var7); + } else { + for (int var9 = 0; var9 < var6; ++var9) { + ItemStack var8 = var5.theItemId.copy(); + var8.stackSize = 1; + p_76293_2_.setInventorySlotContents(p_76293_0_.nextInt(p_76293_2_.getSizeInventory()), var8); + } + } + } + } + + public static void func_150706_a(Random p_150706_0_, WeightedRandomChestContent[] p_150706_1_, TileEntityDispenser p_150706_2_, int p_150706_3_) { + for (int var4 = 0; var4 < p_150706_3_; ++var4) { + WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(p_150706_0_, p_150706_1_); + int var6 = var5.theMinimumChanceToGenerateItem + p_150706_0_.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1); + + if (var5.theItemId.getMaxStackSize() >= var6) { + ItemStack var7 = var5.theItemId.copy(); + var7.stackSize = var6; + p_150706_2_.setInventorySlotContents(p_150706_0_.nextInt(p_150706_2_.getSizeInventory()), var7); + } else { + for (int var9 = 0; var9 < var6; ++var9) { + ItemStack var8 = var5.theItemId.copy(); + var8.stackSize = 1; + p_150706_2_.setInventorySlotContents(p_150706_0_.nextInt(p_150706_2_.getSizeInventory()), var8); + } + } + } + } + + public static WeightedRandomChestContent[] func_92080_a(WeightedRandomChestContent[] p_92080_0_, WeightedRandomChestContent ... p_92080_1_) { + WeightedRandomChestContent[] var2 = new WeightedRandomChestContent[p_92080_0_.length + p_92080_1_.length]; + int var3 = 0; + + for (int var4 = 0; var4 < p_92080_0_.length; ++var4) { + var2[var3++] = p_92080_0_[var4]; + } + + WeightedRandomChestContent[] var8 = p_92080_1_; + int var5 = p_92080_1_.length; + + for (int var6 = 0; var6 < var5; ++var6) { + WeightedRandomChestContent var7 = var8[var6]; + var2[var3++] = var7; + } + + return var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandomFishable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandomFishable.java new file mode 100644 index 0000000..ab0cc53 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/util/WeightedRandomFishable.java @@ -0,0 +1,52 @@ +package net.minecraft.util; + +import java.util.Random; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.item.ItemStack; + +public class WeightedRandomFishable extends WeightedRandom.Item { + private final ItemStack field_150711_b; + private float field_150712_c; + private boolean field_150710_d; + + + public WeightedRandomFishable(ItemStack p_i45317_1_, int p_i45317_2_) { + super(p_i45317_2_); + this.field_150711_b = p_i45317_1_; + } + + public ItemStack func_150708_a(Random p_150708_1_) { + ItemStack var2 = this.field_150711_b.copy(); + + if (this.field_150712_c > 0.0F) { + int var3 = (int)(this.field_150712_c * (float)this.field_150711_b.getMaxDamage()); + int var4 = var2.getMaxDamage() - p_150708_1_.nextInt(p_150708_1_.nextInt(var3) + 1); + + if (var4 > var3) { + var4 = var3; + } + + if (var4 < 1) { + var4 = 1; + } + + var2.setItemDamage(var4); + } + + if (this.field_150710_d) { + EnchantmentHelper.addRandomEnchantment(p_150708_1_, var2, 30); + } + + return var2; + } + + public WeightedRandomFishable func_150709_a(float p_150709_1_) { + this.field_150712_c = p_150709_1_; + return this; + } + + public WeightedRandomFishable func_150707_a() { + this.field_150710_d = true; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/MerchantRecipe.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/MerchantRecipe.java new file mode 100644 index 0000000..d2cd610 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/MerchantRecipe.java @@ -0,0 +1,137 @@ +package net.minecraft.village; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class MerchantRecipe { + /** Item the Villager buys. */ + private ItemStack itemToBuy; + + /** Second Item the Villager buys. */ + private ItemStack secondItemToBuy; + + /** Item the Villager sells. */ + private ItemStack itemToSell; + + /** + * Saves how much has been tool used when put into to slot to be enchanted. + */ + private int toolUses; + + /** Maximum times this trade can be used. */ + private int maxTradeUses; + + + public MerchantRecipe(NBTTagCompound p_i1940_1_) { + this.readFromTags(p_i1940_1_); + } + + public MerchantRecipe(ItemStack p_i1941_1_, ItemStack p_i1941_2_, ItemStack p_i1941_3_) { + this.itemToBuy = p_i1941_1_; + this.secondItemToBuy = p_i1941_2_; + this.itemToSell = p_i1941_3_; + this.maxTradeUses = 7; + } + + public MerchantRecipe(ItemStack p_i1942_1_, ItemStack p_i1942_2_) { + this(p_i1942_1_, null, p_i1942_2_); + } + + public MerchantRecipe(ItemStack p_i1943_1_, Item p_i1943_2_) { + this(p_i1943_1_, new ItemStack(p_i1943_2_)); + } + + /** + * Gets the itemToBuy. + */ + public ItemStack getItemToBuy() { + return this.itemToBuy; + } + + /** + * Gets secondItemToBuy. + */ + public ItemStack getSecondItemToBuy() { + return this.secondItemToBuy; + } + + /** + * Gets if Villager has secondItemToBuy. + */ + public boolean hasSecondItemToBuy() { + return this.secondItemToBuy != null; + } + + /** + * Gets itemToSell. + */ + public ItemStack getItemToSell() { + return this.itemToSell; + } + + /** + * checks if both the first and second ItemToBuy IDs are the same + */ + public boolean hasSameIDsAs(MerchantRecipe p_77393_1_) { + return this.itemToBuy.getItem() == p_77393_1_.itemToBuy.getItem() && this.itemToSell.getItem() == p_77393_1_.itemToSell.getItem() && (this.secondItemToBuy == null && p_77393_1_.secondItemToBuy == null || this.secondItemToBuy != null && p_77393_1_.secondItemToBuy != null && this.secondItemToBuy.getItem() == p_77393_1_.secondItemToBuy.getItem()); + } + + /** + * checks first and second ItemToBuy ID's and count. Calls hasSameIDs + */ + public boolean hasSameItemsAs(MerchantRecipe p_77391_1_) { + return this.hasSameIDsAs(p_77391_1_) && (this.itemToBuy.stackSize < p_77391_1_.itemToBuy.stackSize || this.secondItemToBuy != null && this.secondItemToBuy.stackSize < p_77391_1_.secondItemToBuy.stackSize); + } + + public void incrementToolUses() { + ++this.toolUses; + } + + public void func_82783_a(int p_82783_1_) { + this.maxTradeUses += p_82783_1_; + } + + public boolean isRecipeDisabled() { + return this.toolUses >= this.maxTradeUses; + } + + public void func_82785_h() { + this.toolUses = this.maxTradeUses; + } + + public void readFromTags(NBTTagCompound p_77390_1_) { + NBTTagCompound var2 = p_77390_1_.getCompoundTag("buy"); + this.itemToBuy = ItemStack.loadItemStackFromNBT(var2); + NBTTagCompound var3 = p_77390_1_.getCompoundTag("sell"); + this.itemToSell = ItemStack.loadItemStackFromNBT(var3); + + if (p_77390_1_.func_150297_b("buyB", 10)) { + this.secondItemToBuy = ItemStack.loadItemStackFromNBT(p_77390_1_.getCompoundTag("buyB")); + } + + if (p_77390_1_.func_150297_b("uses", 99)) { + this.toolUses = p_77390_1_.getInteger("uses"); + } + + if (p_77390_1_.func_150297_b("maxUses", 99)) { + this.maxTradeUses = p_77390_1_.getInteger("maxUses"); + } else { + this.maxTradeUses = 7; + } + } + + public NBTTagCompound writeToTags() { + NBTTagCompound var1 = new NBTTagCompound(); + var1.setTag("buy", this.itemToBuy.writeToNBT(new NBTTagCompound())); + var1.setTag("sell", this.itemToSell.writeToNBT(new NBTTagCompound())); + + if (this.secondItemToBuy != null) { + var1.setTag("buyB", this.secondItemToBuy.writeToNBT(new NBTTagCompound())); + } + + var1.setInteger("uses", this.toolUses); + var1.setInteger("maxUses", this.maxTradeUses); + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/MerchantRecipeList.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/MerchantRecipeList.java new file mode 100644 index 0000000..e264869 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/MerchantRecipeList.java @@ -0,0 +1,123 @@ +package net.minecraft.village; + +import java.io.IOException; +import java.util.ArrayList; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.PacketBuffer; + +public class MerchantRecipeList extends ArrayList { + + + public MerchantRecipeList() {} + + public MerchantRecipeList(NBTTagCompound p_i1944_1_) { + this.readRecipiesFromTags(p_i1944_1_); + } + + /** + * can par1,par2 be used to in crafting recipe par3 + */ + public MerchantRecipe canRecipeBeUsed(ItemStack p_77203_1_, ItemStack p_77203_2_, int p_77203_3_) { + if (p_77203_3_ > 0 && p_77203_3_ < this.size()) { + MerchantRecipe var6 = (MerchantRecipe)this.get(p_77203_3_); + return p_77203_1_.getItem() == var6.getItemToBuy().getItem() && (p_77203_2_ == null && !var6.hasSecondItemToBuy() || var6.hasSecondItemToBuy() && p_77203_2_ != null && var6.getSecondItemToBuy().getItem() == p_77203_2_.getItem()) && p_77203_1_.stackSize >= var6.getItemToBuy().stackSize && (!var6.hasSecondItemToBuy() || p_77203_2_.stackSize >= var6.getSecondItemToBuy().stackSize) ? var6 : null; + } else { + for (int var4 = 0; var4 < this.size(); ++var4) { + MerchantRecipe var5 = (MerchantRecipe)this.get(var4); + + if (p_77203_1_.getItem() == var5.getItemToBuy().getItem() && p_77203_1_.stackSize >= var5.getItemToBuy().stackSize && (!var5.hasSecondItemToBuy() && p_77203_2_ == null || var5.hasSecondItemToBuy() && p_77203_2_ != null && var5.getSecondItemToBuy().getItem() == p_77203_2_.getItem() && p_77203_2_.stackSize >= var5.getSecondItemToBuy().stackSize)) { + return var5; + } + } + + return null; + } + } + + /** + * checks if there is a recipie for the same ingredients already on the list, and replaces it. otherwise, adds it + */ + public void addToListWithCheck(MerchantRecipe p_77205_1_) { + for (int var2 = 0; var2 < this.size(); ++var2) { + MerchantRecipe var3 = (MerchantRecipe)this.get(var2); + + if (p_77205_1_.hasSameIDsAs(var3)) { + if (p_77205_1_.hasSameItemsAs(var3)) { + this.set(var2, p_77205_1_); + } + + return; + } + } + + this.add(p_77205_1_); + } + + public void func_151391_a(PacketBuffer p_151391_1_) throws IOException { + p_151391_1_.writeByte((byte)(this.size() & 255)); + + for (int var2 = 0; var2 < this.size(); ++var2) { + MerchantRecipe var3 = (MerchantRecipe)this.get(var2); + p_151391_1_.writeItemStackToBuffer(var3.getItemToBuy()); + p_151391_1_.writeItemStackToBuffer(var3.getItemToSell()); + ItemStack var4 = var3.getSecondItemToBuy(); + p_151391_1_.writeBoolean(var4 != null); + + if (var4 != null) { + p_151391_1_.writeItemStackToBuffer(var4); + } + + p_151391_1_.writeBoolean(var3.isRecipeDisabled()); + } + } + + public static MerchantRecipeList func_151390_b(PacketBuffer p_151390_0_) throws IOException { + MerchantRecipeList var1 = new MerchantRecipeList(); + int var2 = p_151390_0_.readByte() & 255; + + for (int var3 = 0; var3 < var2; ++var3) { + ItemStack var4 = p_151390_0_.readItemStackFromBuffer(); + ItemStack var5 = p_151390_0_.readItemStackFromBuffer(); + ItemStack var6 = null; + + if (p_151390_0_.readBoolean()) { + var6 = p_151390_0_.readItemStackFromBuffer(); + } + + boolean var7 = p_151390_0_.readBoolean(); + MerchantRecipe var8 = new MerchantRecipe(var4, var6, var5); + + if (var7) { + var8.func_82785_h(); + } + + var1.add(var8); + } + + return var1; + } + + public void readRecipiesFromTags(NBTTagCompound p_77201_1_) { + NBTTagList var2 = p_77201_1_.getTagList("Recipes", 10); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + this.add(new MerchantRecipe(var4)); + } + } + + public NBTTagCompound getRecipiesAsTags() { + NBTTagCompound var1 = new NBTTagCompound(); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.size(); ++var3) { + MerchantRecipe var4 = (MerchantRecipe)this.get(var3); + var2.appendTag(var4.writeToTags()); + } + + var1.setTag("Recipes", var2); + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/Village.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/Village.java new file mode 100644 index 0000000..5281e6c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/Village.java @@ -0,0 +1,518 @@ +package net.minecraft.village; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class Village { + private World worldObj; + + /** list of VillageDoorInfo objects */ + private final List villageDoorInfoList = new ArrayList(); + + /** + * This is the sum of all door coordinates and used to calculate the actual village center by dividing by the number + * of doors. + */ + private final ChunkCoordinates centerHelper = new ChunkCoordinates(0, 0, 0); + + /** This is the actual village center. */ + private final ChunkCoordinates center = new ChunkCoordinates(0, 0, 0); + private int villageRadius; + private int lastAddDoorTimestamp; + private int tickCounter; + private int numVillagers; + + /** Timestamp of tick count when villager last bred */ + private int noBreedTicks; + + /** List of player reputations with this village */ + private final TreeMap playerReputation = new TreeMap(); + private final List villageAgressors = new ArrayList(); + private int numIronGolems; + + + public Village() {} + + public Village(World p_i1675_1_) { + this.worldObj = p_i1675_1_; + } + + public void func_82691_a(World p_82691_1_) { + this.worldObj = p_82691_1_; + } + + /** + * Called periodically by VillageCollection + */ + public void tick(int p_75560_1_) { + this.tickCounter = p_75560_1_; + this.removeDeadAndOutOfRangeDoors(); + this.removeDeadAndOldAgressors(); + + if (p_75560_1_ % 20 == 0) { + this.updateNumVillagers(); + } + + if (p_75560_1_ % 30 == 0) { + this.updateNumIronGolems(); + } + + int var2 = this.numVillagers / 10; + + if (this.numIronGolems < var2 && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0) { + Vec3 var3 = this.tryGetIronGolemSpawningLocation(MathHelper.floor_float((float)this.center.posX), MathHelper.floor_float((float)this.center.posY), MathHelper.floor_float((float)this.center.posZ), 2, 4, 2); + + if (var3 != null) { + EntityIronGolem var4 = new EntityIronGolem(this.worldObj); + var4.setPosition(var3.xCoord, var3.yCoord, var3.zCoord); + this.worldObj.spawnEntityInWorld(var4); + ++this.numIronGolems; + } + } + } + + /** + * Tries up to 10 times to get a valid spawning location before eventually failing and returning null. + */ + private Vec3 tryGetIronGolemSpawningLocation(int p_75559_1_, int p_75559_2_, int p_75559_3_, int p_75559_4_, int p_75559_5_, int p_75559_6_) { + for (int var7 = 0; var7 < 10; ++var7) { + int var8 = p_75559_1_ + this.worldObj.rand.nextInt(16) - 8; + int var9 = p_75559_2_ + this.worldObj.rand.nextInt(6) - 3; + int var10 = p_75559_3_ + this.worldObj.rand.nextInt(16) - 8; + + if (this.isInRange(var8, var9, var10) && this.isValidIronGolemSpawningLocation(var8, var9, var10, p_75559_4_, p_75559_5_, p_75559_6_)) { + return Vec3.createVectorHelper(var8, var9, var10); + } + } + + return null; + } + + private boolean isValidIronGolemSpawningLocation(int p_75563_1_, int p_75563_2_, int p_75563_3_, int p_75563_4_, int p_75563_5_, int p_75563_6_) { + if (!World.doesBlockHaveSolidTopSurface(this.worldObj, p_75563_1_, p_75563_2_ - 1, p_75563_3_)) { + return false; + } else { + int var7 = p_75563_1_ - p_75563_4_ / 2; + int var8 = p_75563_3_ - p_75563_6_ / 2; + + for (int var9 = var7; var9 < var7 + p_75563_4_; ++var9) { + for (int var10 = p_75563_2_; var10 < p_75563_2_ + p_75563_5_; ++var10) { + for (int var11 = var8; var11 < var8 + p_75563_6_; ++var11) { + if (this.worldObj.getBlock(var9, var10, var11).isNormalCube()) { + return false; + } + } + } + } + + return true; + } + } + + private void updateNumIronGolems() { + List var1 = this.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, AxisAlignedBB.getBoundingBox(this.center.posX - this.villageRadius, this.center.posY - 4, this.center.posZ - this.villageRadius, this.center.posX + this.villageRadius, this.center.posY + 4, this.center.posZ + this.villageRadius)); + this.numIronGolems = var1.size(); + } + + private void updateNumVillagers() { + List var1 = this.worldObj.getEntitiesWithinAABB(EntityVillager.class, AxisAlignedBB.getBoundingBox(this.center.posX - this.villageRadius, this.center.posY - 4, this.center.posZ - this.villageRadius, this.center.posX + this.villageRadius, this.center.posY + 4, this.center.posZ + this.villageRadius)); + this.numVillagers = var1.size(); + + if (this.numVillagers == 0) { + this.playerReputation.clear(); + } + } + + public ChunkCoordinates getCenter() { + return this.center; + } + + public int getVillageRadius() { + return this.villageRadius; + } + + /** + * Actually get num village door info entries, but that boils down to number of doors. Called by + * EntityAIVillagerMate and VillageSiege + */ + public int getNumVillageDoors() { + return this.villageDoorInfoList.size(); + } + + public int getTicksSinceLastDoorAdding() { + return this.tickCounter - this.lastAddDoorTimestamp; + } + + public int getNumVillagers() { + return this.numVillagers; + } + + /** + * Returns true, if the given coordinates are within the bounding box of the village. + */ + public boolean isInRange(int p_75570_1_, int p_75570_2_, int p_75570_3_) { + return this.center.getDistanceSquared(p_75570_1_, p_75570_2_, p_75570_3_) < (float)(this.villageRadius * this.villageRadius); + } + + /** + * called only by class EntityAIMoveThroughVillage + */ + public List getVillageDoorInfoList() { + return this.villageDoorInfoList; + } + + public VillageDoorInfo findNearestDoor(int p_75564_1_, int p_75564_2_, int p_75564_3_) { + VillageDoorInfo var4 = null; + int var5 = Integer.MAX_VALUE; + Iterator var6 = this.villageDoorInfoList.iterator(); + + while (var6.hasNext()) { + VillageDoorInfo var7 = (VillageDoorInfo)var6.next(); + int var8 = var7.getDistanceSquared(p_75564_1_, p_75564_2_, p_75564_3_); + + if (var8 < var5) { + var4 = var7; + var5 = var8; + } + } + + return var4; + } + + /** + * Find a door suitable for shelter. If there are more doors in a distance of 16 blocks, then the least restricted + * one (i.e. the one protecting the lowest number of villagers) of them is chosen, else the nearest one regardless + * of restriction. + */ + public VillageDoorInfo findNearestDoorUnrestricted(int p_75569_1_, int p_75569_2_, int p_75569_3_) { + VillageDoorInfo var4 = null; + int var5 = Integer.MAX_VALUE; + Iterator var6 = this.villageDoorInfoList.iterator(); + + while (var6.hasNext()) { + VillageDoorInfo var7 = (VillageDoorInfo)var6.next(); + int var8 = var7.getDistanceSquared(p_75569_1_, p_75569_2_, p_75569_3_); + + if (var8 > 256) { + var8 *= 1000; + } else { + var8 = var7.getDoorOpeningRestrictionCounter(); + } + + if (var8 < var5) { + var4 = var7; + var5 = var8; + } + } + + return var4; + } + + public VillageDoorInfo getVillageDoorAt(int p_75578_1_, int p_75578_2_, int p_75578_3_) { + if (this.center.getDistanceSquared(p_75578_1_, p_75578_2_, p_75578_3_) > (float)(this.villageRadius * this.villageRadius)) { + return null; + } else { + Iterator var4 = this.villageDoorInfoList.iterator(); + VillageDoorInfo var5; + + do { + if (!var4.hasNext()) { + return null; + } + + var5 = (VillageDoorInfo)var4.next(); + } + while (var5.posX != p_75578_1_ || var5.posZ != p_75578_3_ || Math.abs(var5.posY - p_75578_2_) > 1); + + return var5; + } + } + + public void addVillageDoorInfo(VillageDoorInfo p_75576_1_) { + this.villageDoorInfoList.add(p_75576_1_); + this.centerHelper.posX += p_75576_1_.posX; + this.centerHelper.posY += p_75576_1_.posY; + this.centerHelper.posZ += p_75576_1_.posZ; + this.updateVillageRadiusAndCenter(); + this.lastAddDoorTimestamp = p_75576_1_.lastActivityTimestamp; + } + + /** + * Returns true, if there is not a single village door left. Called by VillageCollection + */ + public boolean isAnnihilated() { + return this.villageDoorInfoList.isEmpty(); + } + + public void addOrRenewAgressor(EntityLivingBase p_75575_1_) { + Iterator var2 = this.villageAgressors.iterator(); + Village.VillageAgressor var3; + + do { + if (!var2.hasNext()) { + this.villageAgressors.add(new Village.VillageAgressor(p_75575_1_, this.tickCounter)); + return; + } + + var3 = (Village.VillageAgressor)var2.next(); + } + while (var3.agressor != p_75575_1_); + + var3.agressionTime = this.tickCounter; + } + + public EntityLivingBase findNearestVillageAggressor(EntityLivingBase p_75571_1_) { + double var2 = Double.MAX_VALUE; + Village.VillageAgressor var4 = null; + + for (int var5 = 0; var5 < this.villageAgressors.size(); ++var5) { + Village.VillageAgressor var6 = (Village.VillageAgressor)this.villageAgressors.get(var5); + double var7 = var6.agressor.getDistanceSqToEntity(p_75571_1_); + + if (var7 <= var2) { + var4 = var6; + var2 = var7; + } + } + + return var4 != null ? var4.agressor : null; + } + + public EntityPlayer func_82685_c(EntityLivingBase p_82685_1_) { + double var2 = Double.MAX_VALUE; + EntityPlayer var4 = null; + Iterator var5 = this.playerReputation.keySet().iterator(); + + while (var5.hasNext()) { + String var6 = (String)var5.next(); + + if (this.isPlayerReputationTooLow(var6)) { + EntityPlayer var7 = this.worldObj.getPlayerEntityByName(var6); + + if (var7 != null) { + double var8 = var7.getDistanceSqToEntity(p_82685_1_); + + if (var8 <= var2) { + var4 = var7; + var2 = var8; + } + } + } + } + + return var4; + } + + private void removeDeadAndOldAgressors() { + Iterator var1 = this.villageAgressors.iterator(); + + while (var1.hasNext()) { + Village.VillageAgressor var2 = (Village.VillageAgressor)var1.next(); + + if (!var2.agressor.isEntityAlive() || Math.abs(this.tickCounter - var2.agressionTime) > 300) { + var1.remove(); + } + } + } + + private void removeDeadAndOutOfRangeDoors() { + boolean var1 = false; + boolean var2 = this.worldObj.rand.nextInt(50) == 0; + Iterator var3 = this.villageDoorInfoList.iterator(); + + while (var3.hasNext()) { + VillageDoorInfo var4 = (VillageDoorInfo)var3.next(); + + if (var2) { + var4.resetDoorOpeningRestrictionCounter(); + } + + if (!this.isBlockDoor(var4.posX, var4.posY, var4.posZ) || Math.abs(this.tickCounter - var4.lastActivityTimestamp) > 1200) { + this.centerHelper.posX -= var4.posX; + this.centerHelper.posY -= var4.posY; + this.centerHelper.posZ -= var4.posZ; + var1 = true; + var4.isDetachedFromVillageFlag = true; + var3.remove(); + } + } + + if (var1) { + this.updateVillageRadiusAndCenter(); + } + } + + private boolean isBlockDoor(int p_75574_1_, int p_75574_2_, int p_75574_3_) { + return this.worldObj.getBlock(p_75574_1_, p_75574_2_, p_75574_3_) == Blocks.wooden_door; + } + + private void updateVillageRadiusAndCenter() { + int var1 = this.villageDoorInfoList.size(); + + if (var1 == 0) { + this.center.set(0, 0, 0); + this.villageRadius = 0; + } else { + this.center.set(this.centerHelper.posX / var1, this.centerHelper.posY / var1, this.centerHelper.posZ / var1); + int var2 = 0; + VillageDoorInfo var4; + + for (Iterator var3 = this.villageDoorInfoList.iterator(); var3.hasNext(); var2 = Math.max(var4.getDistanceSquared(this.center.posX, this.center.posY, this.center.posZ), var2)) { + var4 = (VillageDoorInfo)var3.next(); + } + + this.villageRadius = Math.max(32, (int)Math.sqrt(var2) + 1); + } + } + + /** + * Return the village reputation for a player + */ + public int getReputationForPlayer(String p_82684_1_) { + Integer var2 = (Integer)this.playerReputation.get(p_82684_1_); + return var2 != null ? var2.intValue() : 0; + } + + /** + * Set the village reputation for a player. + */ + public int setReputationForPlayer(String p_82688_1_, int p_82688_2_) { + int var3 = this.getReputationForPlayer(p_82688_1_); + int var4 = MathHelper.clamp_int(var3 + p_82688_2_, -30, 10); + this.playerReputation.put(p_82688_1_, Integer.valueOf(var4)); + return var4; + } + + /** + * Return whether this player has a too low reputation with this village. + */ + public boolean isPlayerReputationTooLow(String p_82687_1_) { + return this.getReputationForPlayer(p_82687_1_) <= -15; + } + + /** + * Read this village's data from NBT. + */ + public void readVillageDataFromNBT(NBTTagCompound p_82690_1_) { + this.numVillagers = p_82690_1_.getInteger("PopSize"); + this.villageRadius = p_82690_1_.getInteger("Radius"); + this.numIronGolems = p_82690_1_.getInteger("Golems"); + this.lastAddDoorTimestamp = p_82690_1_.getInteger("Stable"); + this.tickCounter = p_82690_1_.getInteger("Tick"); + this.noBreedTicks = p_82690_1_.getInteger("MTick"); + this.center.posX = p_82690_1_.getInteger("CX"); + this.center.posY = p_82690_1_.getInteger("CY"); + this.center.posZ = p_82690_1_.getInteger("CZ"); + this.centerHelper.posX = p_82690_1_.getInteger("ACX"); + this.centerHelper.posY = p_82690_1_.getInteger("ACY"); + this.centerHelper.posZ = p_82690_1_.getInteger("ACZ"); + NBTTagList var2 = p_82690_1_.getTagList("Doors", 10); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + VillageDoorInfo var5 = new VillageDoorInfo(var4.getInteger("X"), var4.getInteger("Y"), var4.getInteger("Z"), var4.getInteger("IDX"), var4.getInteger("IDZ"), var4.getInteger("TS")); + this.villageDoorInfoList.add(var5); + } + + NBTTagList var6 = p_82690_1_.getTagList("Players", 10); + + for (int var7 = 0; var7 < var6.tagCount(); ++var7) { + NBTTagCompound var8 = var6.getCompoundTagAt(var7); + this.playerReputation.put(var8.getString("Name"), Integer.valueOf(var8.getInteger("S"))); + } + } + + /** + * Write this village's data to NBT. + */ + public void writeVillageDataToNBT(NBTTagCompound p_82689_1_) { + p_82689_1_.setInteger("PopSize", this.numVillagers); + p_82689_1_.setInteger("Radius", this.villageRadius); + p_82689_1_.setInteger("Golems", this.numIronGolems); + p_82689_1_.setInteger("Stable", this.lastAddDoorTimestamp); + p_82689_1_.setInteger("Tick", this.tickCounter); + p_82689_1_.setInteger("MTick", this.noBreedTicks); + p_82689_1_.setInteger("CX", this.center.posX); + p_82689_1_.setInteger("CY", this.center.posY); + p_82689_1_.setInteger("CZ", this.center.posZ); + p_82689_1_.setInteger("ACX", this.centerHelper.posX); + p_82689_1_.setInteger("ACY", this.centerHelper.posY); + p_82689_1_.setInteger("ACZ", this.centerHelper.posZ); + NBTTagList var2 = new NBTTagList(); + Iterator var3 = this.villageDoorInfoList.iterator(); + + while (var3.hasNext()) { + VillageDoorInfo var4 = (VillageDoorInfo)var3.next(); + NBTTagCompound var5 = new NBTTagCompound(); + var5.setInteger("X", var4.posX); + var5.setInteger("Y", var4.posY); + var5.setInteger("Z", var4.posZ); + var5.setInteger("IDX", var4.insideDirectionX); + var5.setInteger("IDZ", var4.insideDirectionZ); + var5.setInteger("TS", var4.lastActivityTimestamp); + var2.appendTag(var5); + } + + p_82689_1_.setTag("Doors", var2); + NBTTagList var7 = new NBTTagList(); + Iterator var8 = this.playerReputation.keySet().iterator(); + + while (var8.hasNext()) { + String var9 = (String)var8.next(); + NBTTagCompound var6 = new NBTTagCompound(); + var6.setString("Name", var9); + var6.setInteger("S", ((Integer)this.playerReputation.get(var9)).intValue()); + var7.appendTag(var6); + } + + p_82689_1_.setTag("Players", var7); + } + + /** + * Prevent villager breeding for a fixed interval of time + */ + public void endMatingSeason() { + this.noBreedTicks = this.tickCounter; + } + + /** + * Return whether villagers mating refractory period has passed + */ + public boolean isMatingSeason() { + return this.noBreedTicks == 0 || this.tickCounter - this.noBreedTicks >= 3600; + } + + public void setDefaultPlayerReputation(int p_82683_1_) { + Iterator var2 = this.playerReputation.keySet().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + this.setReputationForPlayer(var3, p_82683_1_); + } + } + + class VillageAgressor { + public EntityLivingBase agressor; + public int agressionTime; + + + VillageAgressor(EntityLivingBase p_i1674_2_, int p_i1674_3_) { + this.agressor = p_i1674_2_; + this.agressionTime = p_i1674_3_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageCollection.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageCollection.java new file mode 100644 index 0000000..812a7d8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageCollection.java @@ -0,0 +1,316 @@ +package net.minecraft.village; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.BlockDoor; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + +public class VillageCollection extends WorldSavedData { + private World worldObj; + + /** + * This is a black hole. You can add data to this list through a public interface, but you can't query that + * information in any way and it's not used internally either. + */ + private final List villagerPositionsList = new ArrayList(); + private final List newDoors = new ArrayList(); + private final List villageList = new ArrayList(); + private int tickCounter; + + + public VillageCollection(String p_i1677_1_) { + super(p_i1677_1_); + } + + public VillageCollection(World p_i1678_1_) { + super("villages"); + this.worldObj = p_i1678_1_; + this.markDirty(); + } + + public void func_82566_a(World p_82566_1_) { + this.worldObj = p_82566_1_; + Iterator var2 = this.villageList.iterator(); + + while (var2.hasNext()) { + Village var3 = (Village)var2.next(); + var3.func_82691_a(p_82566_1_); + } + } + + /** + * This is a black hole. You can add data to this list through a public interface, but you can't query that + * information in any way and it's not used internally either. + */ + public void addVillagerPosition(int p_75551_1_, int p_75551_2_, int p_75551_3_) { + if (this.villagerPositionsList.size() <= 64) { + if (!this.isVillagerPositionPresent(p_75551_1_, p_75551_2_, p_75551_3_)) { + this.villagerPositionsList.add(new ChunkCoordinates(p_75551_1_, p_75551_2_, p_75551_3_)); + } + } + } + + /** + * Runs a single tick for the village collection + */ + public void tick() { + ++this.tickCounter; + Iterator var1 = this.villageList.iterator(); + + while (var1.hasNext()) { + Village var2 = (Village)var1.next(); + var2.tick(this.tickCounter); + } + + this.removeAnnihilatedVillages(); + this.dropOldestVillagerPosition(); + this.addNewDoorsToVillageOrCreateVillage(); + + if (this.tickCounter % 400 == 0) { + this.markDirty(); + } + } + + private void removeAnnihilatedVillages() { + Iterator var1 = this.villageList.iterator(); + + while (var1.hasNext()) { + Village var2 = (Village)var1.next(); + + if (var2.isAnnihilated()) { + var1.remove(); + this.markDirty(); + } + } + } + + /** + * Get a list of villages. + */ + public List getVillageList() { + return this.villageList; + } + + /** + * Finds the nearest village, but only the given coordinates are withing it's bounding box plus the given the + * distance. + */ + public Village findNearestVillage(int p_75550_1_, int p_75550_2_, int p_75550_3_, int p_75550_4_) { + Village var5 = null; + float var6 = Float.MAX_VALUE; + Iterator var7 = this.villageList.iterator(); + + while (var7.hasNext()) { + Village var8 = (Village)var7.next(); + float var9 = var8.getCenter().getDistanceSquared(p_75550_1_, p_75550_2_, p_75550_3_); + + if (var9 < var6) { + float var10 = (float)(p_75550_4_ + var8.getVillageRadius()); + + if (var9 <= var10 * var10) { + var5 = var8; + var6 = var9; + } + } + } + + return var5; + } + + private void dropOldestVillagerPosition() { + if (!this.villagerPositionsList.isEmpty()) { + this.addUnassignedWoodenDoorsAroundToNewDoorsList((ChunkCoordinates)this.villagerPositionsList.remove(0)); + } + } + + private void addNewDoorsToVillageOrCreateVillage() { + int var1 = 0; + + while (var1 < this.newDoors.size()) { + VillageDoorInfo var2 = (VillageDoorInfo)this.newDoors.get(var1); + boolean var3 = false; + Iterator var4 = this.villageList.iterator(); + + while (true) { + if (var4.hasNext()) { + Village var5 = (Village)var4.next(); + int var6 = (int)var5.getCenter().getDistanceSquared(var2.posX, var2.posY, var2.posZ); + int var7 = 32 + var5.getVillageRadius(); + + if (var6 > var7 * var7) { + continue; + } + + var5.addVillageDoorInfo(var2); + var3 = true; + } + + if (!var3) { + Village var8 = new Village(this.worldObj); + var8.addVillageDoorInfo(var2); + this.villageList.add(var8); + this.markDirty(); + } + + ++var1; + break; + } + } + + this.newDoors.clear(); + } + + private void addUnassignedWoodenDoorsAroundToNewDoorsList(ChunkCoordinates p_75546_1_) { + byte var2 = 16; + byte var3 = 4; + byte var4 = 16; + + for (int var5 = p_75546_1_.posX - var2; var5 < p_75546_1_.posX + var2; ++var5) { + for (int var6 = p_75546_1_.posY - var3; var6 < p_75546_1_.posY + var3; ++var6) { + for (int var7 = p_75546_1_.posZ - var4; var7 < p_75546_1_.posZ + var4; ++var7) { + if (this.isWoodenDoorAt(var5, var6, var7)) { + VillageDoorInfo var8 = this.getVillageDoorAt(var5, var6, var7); + + if (var8 == null) { + this.addDoorToNewListIfAppropriate(var5, var6, var7); + } else { + var8.lastActivityTimestamp = this.tickCounter; + } + } + } + } + } + } + + private VillageDoorInfo getVillageDoorAt(int p_75547_1_, int p_75547_2_, int p_75547_3_) { + Iterator var4 = this.newDoors.iterator(); + VillageDoorInfo var5; + + do { + if (!var4.hasNext()) { + var4 = this.villageList.iterator(); + VillageDoorInfo var6; + + do { + if (!var4.hasNext()) { + return null; + } + + Village var7 = (Village)var4.next(); + var6 = var7.getVillageDoorAt(p_75547_1_, p_75547_2_, p_75547_3_); + } + while (var6 == null); + + return var6; + } + + var5 = (VillageDoorInfo)var4.next(); + } + while (var5.posX != p_75547_1_ || var5.posZ != p_75547_3_ || Math.abs(var5.posY - p_75547_2_) > 1); + + return var5; + } + + private void addDoorToNewListIfAppropriate(int p_75542_1_, int p_75542_2_, int p_75542_3_) { + int var4 = ((BlockDoor)Blocks.wooden_door).func_150013_e(this.worldObj, p_75542_1_, p_75542_2_, p_75542_3_); + int var5; + int var6; + + if (var4 != 0 && var4 != 2) { + var5 = 0; + + for (var6 = -5; var6 < 0; ++var6) { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_, p_75542_2_, p_75542_3_ + var6)) { + --var5; + } + } + + for (var6 = 1; var6 <= 5; ++var6) { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_, p_75542_2_, p_75542_3_ + var6)) { + ++var5; + } + } + + if (var5 != 0) { + this.newDoors.add(new VillageDoorInfo(p_75542_1_, p_75542_2_, p_75542_3_, 0, var5 > 0 ? -2 : 2, this.tickCounter)); + } + } else { + var5 = 0; + + for (var6 = -5; var6 < 0; ++var6) { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_ + var6, p_75542_2_, p_75542_3_)) { + --var5; + } + } + + for (var6 = 1; var6 <= 5; ++var6) { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_ + var6, p_75542_2_, p_75542_3_)) { + ++var5; + } + } + + if (var5 != 0) { + this.newDoors.add(new VillageDoorInfo(p_75542_1_, p_75542_2_, p_75542_3_, var5 > 0 ? -2 : 2, 0, this.tickCounter)); + } + } + } + + private boolean isVillagerPositionPresent(int p_75548_1_, int p_75548_2_, int p_75548_3_) { + Iterator var4 = this.villagerPositionsList.iterator(); + ChunkCoordinates var5; + + do { + if (!var4.hasNext()) { + return false; + } + + var5 = (ChunkCoordinates)var4.next(); + } + while (var5.posX != p_75548_1_ || var5.posY != p_75548_2_ || var5.posZ != p_75548_3_); + + return true; + } + + private boolean isWoodenDoorAt(int p_75541_1_, int p_75541_2_, int p_75541_3_) { + return this.worldObj.getBlock(p_75541_1_, p_75541_2_, p_75541_3_) == Blocks.wooden_door; + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbt) { + this.tickCounter = nbt.getInteger("Tick"); + NBTTagList var2 = nbt.getTagList("Villages", 10); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + Village var5 = new Village(); + var5.readVillageDataFromNBT(var4); + this.villageList.add(var5); + } + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbt) { + nbt.setInteger("Tick", this.tickCounter); + NBTTagList var2 = new NBTTagList(); + Iterator var3 = this.villageList.iterator(); + + while (var3.hasNext()) { + Village var4 = (Village)var3.next(); + NBTTagCompound var5 = new NBTTagCompound(); + var4.writeVillageDataToNBT(var5); + var2.appendTag(var5); + } + + nbt.setTag("Villages", var2); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageDoorInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageDoorInfo.java new file mode 100644 index 0000000..e8b9f0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageDoorInfo.java @@ -0,0 +1,73 @@ +package net.minecraft.village; + +public class VillageDoorInfo { + public final int posX; + public final int posY; + public final int posZ; + public final int insideDirectionX; + public final int insideDirectionZ; + public int lastActivityTimestamp; + public boolean isDetachedFromVillageFlag; + private int doorOpeningRestrictionCounter; + + + public VillageDoorInfo(int p_i1673_1_, int p_i1673_2_, int p_i1673_3_, int p_i1673_4_, int p_i1673_5_, int p_i1673_6_) { + this.posX = p_i1673_1_; + this.posY = p_i1673_2_; + this.posZ = p_i1673_3_; + this.insideDirectionX = p_i1673_4_; + this.insideDirectionZ = p_i1673_5_; + this.lastActivityTimestamp = p_i1673_6_; + } + + /** + * Returns the squared distance between this door and the given coordinate. + */ + public int getDistanceSquared(int p_75474_1_, int p_75474_2_, int p_75474_3_) { + int var4 = p_75474_1_ - this.posX; + int var5 = p_75474_2_ - this.posY; + int var6 = p_75474_3_ - this.posZ; + return var4 * var4 + var5 * var5 + var6 * var6; + } + + /** + * Get the square of the distance from a location 2 blocks away from the door considered 'inside' and the given + * arguments + */ + public int getInsideDistanceSquare(int p_75469_1_, int p_75469_2_, int p_75469_3_) { + int var4 = p_75469_1_ - this.posX - this.insideDirectionX; + int var5 = p_75469_2_ - this.posY; + int var6 = p_75469_3_ - this.posZ - this.insideDirectionZ; + return var4 * var4 + var5 * var5 + var6 * var6; + } + + public int getInsidePosX() { + return this.posX + this.insideDirectionX; + } + + public int getInsidePosY() { + return this.posY; + } + + public int getInsidePosZ() { + return this.posZ + this.insideDirectionZ; + } + + public boolean isInside(int p_75467_1_, int p_75467_2_) { + int var3 = p_75467_1_ - this.posX; + int var4 = p_75467_2_ - this.posZ; + return var3 * this.insideDirectionX + var4 * this.insideDirectionZ >= 0; + } + + public void resetDoorOpeningRestrictionCounter() { + this.doorOpeningRestrictionCounter = 0; + } + + public void incrementDoorOpeningRestrictionCounter() { + ++this.doorOpeningRestrictionCounter; + } + + public int getDoorOpeningRestrictionCounter() { + return this.doorOpeningRestrictionCounter; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageSiege.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageSiege.java new file mode 100644 index 0000000..f611de7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/village/VillageSiege.java @@ -0,0 +1,187 @@ +package net.minecraft.village; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; + +public class VillageSiege { + private final World worldObj; + private boolean field_75535_b; + private int field_75536_c = -1; + private int field_75533_d; + private int field_75534_e; + + /** Instance of Village. */ + private Village theVillage; + private int field_75532_g; + private int field_75538_h; + private int field_75539_i; + + + public VillageSiege(World p_i1676_1_) { + this.worldObj = p_i1676_1_; + } + + /** + * Runs a single tick for the village siege + */ + public void tick() { + boolean var1 = false; + + if (var1) { + if (this.field_75536_c == 2) { + this.field_75533_d = 100; + return; + } + } else { + if (this.worldObj.isDaytime()) { + this.field_75536_c = 0; + return; + } + + if (this.field_75536_c == 2) { + return; + } + + if (this.field_75536_c == 0) { + float var2 = this.worldObj.getCelestialAngle(0.0F); + + if ((double)var2 < 0.5D || (double)var2 > 0.501D) { + return; + } + + this.field_75536_c = this.worldObj.rand.nextInt(10) == 0 ? 1 : 2; + this.field_75535_b = false; + + if (this.field_75536_c == 2) { + return; + } + } + } + + if (!this.field_75535_b) { + if (!this.func_75529_b()) { + return; + } + + this.field_75535_b = true; + } + + if (this.field_75534_e > 0) { + --this.field_75534_e; + } else { + this.field_75534_e = 2; + + if (this.field_75533_d > 0) { + this.spawnZombie(); + --this.field_75533_d; + } else { + this.field_75536_c = 2; + } + } + } + + private boolean func_75529_b() { + List var1 = this.worldObj.playerEntities; + Iterator var2 = var1.iterator(); + + while (var2.hasNext()) { + EntityPlayer var3 = (EntityPlayer)var2.next(); + this.theVillage = this.worldObj.villageCollectionObj.findNearestVillage((int)var3.posX, (int)var3.posY, (int)var3.posZ, 1); + + if (this.theVillage != null && this.theVillage.getNumVillageDoors() >= 10 && this.theVillage.getTicksSinceLastDoorAdding() >= 20 && this.theVillage.getNumVillagers() >= 20) { + ChunkCoordinates var4 = this.theVillage.getCenter(); + float var5 = (float)this.theVillage.getVillageRadius(); + boolean var6 = false; + int var7 = 0; + + while (true) { + if (var7 < 10) { + this.field_75532_g = var4.posX + (int)((double)(MathHelper.cos(this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F) * var5) * 0.9D); + this.field_75538_h = var4.posY; + this.field_75539_i = var4.posZ + (int)((double)(MathHelper.sin(this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F) * var5) * 0.9D); + var6 = false; + Iterator var8 = this.worldObj.villageCollectionObj.getVillageList().iterator(); + + while (var8.hasNext()) { + Village var9 = (Village)var8.next(); + + if (var9 != this.theVillage && var9.isInRange(this.field_75532_g, this.field_75538_h, this.field_75539_i)) { + var6 = true; + break; + } + } + + if (var6) { + ++var7; + continue; + } + } + + if (var6) { + return false; + } + + Vec3 var10 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i); + + if (var10 != null) { + this.field_75534_e = 0; + this.field_75533_d = 20; + return true; + } + + break; + } + } + } + + return false; + } + + private boolean spawnZombie() { + Vec3 var1 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i); + + if (var1 == null) { + return false; + } else { + EntityZombie var2; + + try { + var2 = new EntityZombie(this.worldObj); + var2.onSpawnWithEgg(null); + var2.setVillager(false); + } catch (Exception var4) { + var4.printStackTrace(); + return false; + } + + var2.setLocationAndAngles(var1.xCoord, var1.yCoord, var1.zCoord, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(var2); + ChunkCoordinates var3 = this.theVillage.getCenter(); + var2.setHomeArea(var3.posX, var3.posY, var3.posZ, this.theVillage.getVillageRadius()); + return true; + } + } + + private Vec3 func_75527_a(int p_75527_1_, int p_75527_2_, int p_75527_3_) { + for (int var4 = 0; var4 < 10; ++var4) { + int var5 = p_75527_1_ + this.worldObj.rand.nextInt(16) - 8; + int var6 = p_75527_2_ + this.worldObj.rand.nextInt(6) - 3; + int var7 = p_75527_3_ + this.worldObj.rand.nextInt(16) - 8; + + if (this.theVillage.isInRange(var5, var6, var7) && SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, this.worldObj, var5, var6, var7)) { + Vec3.createVectorHelper(var5, var6, var7); + } + } + + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkCache.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkCache.java new file mode 100644 index 0000000..eddc7d5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkCache.java @@ -0,0 +1,219 @@ +package net.minecraft.world; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +public class ChunkCache implements IBlockAccess { + private final int chunkX; + private final int chunkZ; + private final Chunk[][] chunkArray; + + /** True if the chunk cache is empty. */ + private boolean isEmpty; + + /** Reference to the World object. */ + private final World worldObj; + + + public ChunkCache(World p_i1964_1_, int p_i1964_2_, int p_i1964_3_, int p_i1964_4_, int p_i1964_5_, int p_i1964_6_, int p_i1964_7_, int p_i1964_8_) { + this.worldObj = p_i1964_1_; + this.chunkX = p_i1964_2_ - p_i1964_8_ >> 4; + this.chunkZ = p_i1964_4_ - p_i1964_8_ >> 4; + int var9 = p_i1964_5_ + p_i1964_8_ >> 4; + int var10 = p_i1964_7_ + p_i1964_8_ >> 4; + this.chunkArray = new Chunk[var9 - this.chunkX + 1][var10 - this.chunkZ + 1]; + this.isEmpty = true; + int var11; + int var12; + Chunk var13; + + for (var11 = this.chunkX; var11 <= var9; ++var11) { + for (var12 = this.chunkZ; var12 <= var10; ++var12) { + var13 = p_i1964_1_.getChunkFromChunkCoords(var11, var12); + + if (var13 != null) { + this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ] = var13; + } + } + } + + for (var11 = p_i1964_2_ >> 4; var11 <= p_i1964_5_ >> 4; ++var11) { + for (var12 = p_i1964_4_ >> 4; var12 <= p_i1964_7_ >> 4; ++var12) { + var13 = this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ]; + + if (var13 != null && !var13.getAreLevelsEmpty(p_i1964_3_, p_i1964_6_)) { + this.isEmpty = false; + } + } + } + } + + /** + * set by !chunk.getAreLevelsEmpty + */ + public boolean extendedLevelsInChunkCache() { + return this.isEmpty; + } + + public Block getBlock(int p_147439_1_, int p_147439_2_, int p_147439_3_) { + Block var4 = Blocks.air; + + if (p_147439_2_ >= 0 && p_147439_2_ < 256) { + int var5 = (p_147439_1_ >> 4) - this.chunkX; + int var6 = (p_147439_3_ >> 4) - this.chunkZ; + + if (var5 >= 0 && var5 < this.chunkArray.length && var6 >= 0 && var6 < this.chunkArray[var5].length) { + Chunk var7 = this.chunkArray[var5][var6]; + + if (var7 != null) { + var4 = var7.func_150810_a(p_147439_1_ & 15, p_147439_2_, p_147439_3_ & 15); + } + } + } + + return var4; + } + + public TileEntity getTileEntity(int p_147438_1_, int p_147438_2_, int p_147438_3_) { + int var4 = (p_147438_1_ >> 4) - this.chunkX; + int var5 = (p_147438_3_ >> 4) - this.chunkZ; + return this.chunkArray[var4][var5].func_150806_e(p_147438_1_ & 15, p_147438_2_, p_147438_3_ & 15); + } + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + public int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_) { + int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, p_72802_1_, p_72802_2_, p_72802_3_); + int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, p_72802_1_, p_72802_2_, p_72802_3_); + + if (var6 < p_72802_4_) { + var6 = p_72802_4_; + } + + return var5 << 20 | var6 << 4; + } + + /** + * Returns the block metadata at coords x,y,z + */ + public int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_) { + if (p_72805_2_ < 0) { + return 0; + } else if (p_72805_2_ >= 256) { + return 0; + } else { + int var4 = (p_72805_1_ >> 4) - this.chunkX; + int var5 = (p_72805_3_ >> 4) - this.chunkZ; + return this.chunkArray[var4][var5].getBlockMetadata(p_72805_1_ & 15, p_72805_2_, p_72805_3_ & 15); + } + } + + /** + * Gets the biome for a given set of x/z coordinates + */ + public BiomeGenBase getBiomeGenForCoords(int p_72807_1_, int p_72807_2_) { + return this.worldObj.getBiomeGenForCoords(p_72807_1_, p_72807_2_); + } + + /** + * Returns true if the block at the specified coordinates is empty + */ + public boolean isAirBlock(int p_147437_1_, int p_147437_2_, int p_147437_3_) { + return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).getMaterial() == Material.air; + } + + /** + * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. + * Brightness for SkyBlock.Block is yellowish and independent. + */ + public int getSkyBlockTypeBrightness(EnumSkyBlock p_72810_1_, int p_72810_2_, int p_72810_3_, int p_72810_4_) { + if (p_72810_3_ < 0) { + p_72810_3_ = 0; + } + + if (p_72810_3_ >= 256) { + p_72810_3_ = 255; + } + + if (p_72810_3_ >= 0 && p_72810_3_ < 256 && p_72810_2_ >= -30000000 && p_72810_4_ >= -30000000 && p_72810_2_ < 30000000 && p_72810_4_ <= 30000000) { + if (p_72810_1_ == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky) { + return 0; + } else { + int var5; + int var6; + + if (this.getBlock(p_72810_2_, p_72810_3_, p_72810_4_).func_149710_n()) { + var5 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_, p_72810_3_ + 1, p_72810_4_); + var6 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_ + 1, p_72810_3_, p_72810_4_); + int var7 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_ - 1, p_72810_3_, p_72810_4_); + int var8 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_, p_72810_3_, p_72810_4_ + 1); + int var9 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_, p_72810_3_, p_72810_4_ - 1); + + if (var6 > var5) { + var5 = var6; + } + + if (var7 > var5) { + var5 = var7; + } + + if (var8 > var5) { + var5 = var8; + } + + if (var9 > var5) { + var5 = var9; + } + + return var5; + } else { + var5 = (p_72810_2_ >> 4) - this.chunkX; + var6 = (p_72810_4_ >> 4) - this.chunkZ; + return this.chunkArray[var5][var6].getSavedLightValue(p_72810_1_, p_72810_2_ & 15, p_72810_3_, p_72810_4_ & 15); + } + } + } else { + return p_72810_1_.defaultLightValue; + } + } + + /** + * is only used on stairs and tilled fields + */ + public int getSpecialBlockBrightness(EnumSkyBlock p_72812_1_, int p_72812_2_, int p_72812_3_, int p_72812_4_) { + if (p_72812_3_ < 0) { + p_72812_3_ = 0; + } + + if (p_72812_3_ >= 256) { + p_72812_3_ = 255; + } + + if (p_72812_3_ >= 0 && p_72812_3_ < 256 && p_72812_2_ >= -30000000 && p_72812_4_ >= -30000000 && p_72812_2_ < 30000000 && p_72812_4_ <= 30000000) { + int var5 = (p_72812_2_ >> 4) - this.chunkX; + int var6 = (p_72812_4_ >> 4) - this.chunkZ; + return this.chunkArray[var5][var6].getSavedLightValue(p_72812_1_, p_72812_2_ & 15, p_72812_3_, p_72812_4_ & 15); + } else { + return p_72812_1_.defaultLightValue; + } + } + + /** + * Returns current world height. + */ + public int getHeight() { + return 256; + } + + /** + * Is this block powering in the specified direction Args: x, y, z, direction + */ + public int isBlockProvidingPowerTo(int p_72879_1_, int p_72879_2_, int p_72879_3_, int p_72879_4_) { + return this.getBlock(p_72879_1_, p_72879_2_, p_72879_3_).isProvidingStrongPower(this, p_72879_1_, p_72879_2_, p_72879_3_, p_72879_4_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkCoordIntPair.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkCoordIntPair.java new file mode 100644 index 0000000..40ff4ee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkCoordIntPair.java @@ -0,0 +1,59 @@ +package net.minecraft.world; + +public class ChunkCoordIntPair { + /** The X position of this Chunk Coordinate Pair */ + public final int chunkXPos; + + /** The Z position of this Chunk Coordinate Pair */ + public final int chunkZPos; + private int cachedHashCode = 0; + + public ChunkCoordIntPair(int par1, int par2) { + this.chunkXPos = par1; + this.chunkZPos = par2; + } + + /** + * converts a chunk coordinate pair to an integer (suitable for hashing) + */ + public static long chunkXZ2Int(int par0, int par1) { + return (long)par0 & 4294967295L | ((long)par1 & 4294967295L) << 32; + } + + public int hashCode() { + if (this.cachedHashCode == 0) { + int var1 = 1664525 * this.chunkXPos + 1013904223; + int var2 = 1664525 * (this.chunkZPos ^ -559038737) + 1013904223; + this.cachedHashCode = var1 ^ var2; + } + + return this.cachedHashCode; + } + + public boolean equals(Object par1Obj) { + if (this == par1Obj) { + return true; + } else if (!(par1Obj instanceof ChunkCoordIntPair)) { + return false; + } else { + ChunkCoordIntPair var2 = (ChunkCoordIntPair)par1Obj; + return this.chunkXPos == var2.chunkXPos && this.chunkZPos == var2.chunkZPos; + } + } + + public int getCenterXPos() { + return (this.chunkXPos << 4) + 8; + } + + public int getCenterZPosition() { + return (this.chunkZPos << 4) + 8; + } + + public ChunkPosition func_151349_a(int p_151349_1_) { + return new ChunkPosition(this.getCenterXPos(), p_151349_1_, this.getCenterZPosition()); + } + + public String toString() { + return "[" + this.chunkXPos + ", " + this.chunkZPos + "]"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkPosition.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkPosition.java new file mode 100644 index 0000000..1f4f332 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ChunkPosition.java @@ -0,0 +1,34 @@ +package net.minecraft.world; + +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class ChunkPosition { + public final int field_151329_a; + public final int field_151327_b; + public final int field_151328_c; + + + public ChunkPosition(int p_i45363_1_, int p_i45363_2_, int p_i45363_3_) { + this.field_151329_a = p_i45363_1_; + this.field_151327_b = p_i45363_2_; + this.field_151328_c = p_i45363_3_; + } + + public ChunkPosition(Vec3 p_i45364_1_) { + this(MathHelper.floor_double(p_i45364_1_.xCoord), MathHelper.floor_double(p_i45364_1_.yCoord), MathHelper.floor_double(p_i45364_1_.zCoord)); + } + + public boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof ChunkPosition)) { + return false; + } else { + ChunkPosition var2 = (ChunkPosition)p_equals_1_; + return var2.field_151329_a == this.field_151329_a && var2.field_151327_b == this.field_151327_b && var2.field_151328_c == this.field_151328_c; + } + } + + public int hashCode() { + return this.field_151329_a * 8976890 + this.field_151327_b * 981131 + this.field_151328_c; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ColorizerFoliage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ColorizerFoliage.java new file mode 100644 index 0000000..249e8f6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ColorizerFoliage.java @@ -0,0 +1,39 @@ +package net.minecraft.world; + +public class ColorizerFoliage { + /** Color buffer for foliage */ + private static int[] foliageBuffer = new int[65536]; + + + public static void setFoliageBiomeColorizer(int[] p_77467_0_) { + foliageBuffer = p_77467_0_; + } + + /** + * Gets foliage color from temperature and humidity. Args: temperature, humidity + */ + public static int getFoliageColor(double p_77470_0_, double p_77470_2_) { + p_77470_2_ *= p_77470_0_; + int var4 = (int)((1.0D - p_77470_0_) * 255.0D); + int var5 = (int)((1.0D - p_77470_2_) * 255.0D); + return foliageBuffer[var5 << 8 | var4]; + } + + /** + * Gets the foliage color for pine type (metadata 1) trees + */ + public static int getFoliageColorPine() { + return 6396257; + } + + /** + * Gets the foliage color for birch type (metadata 2) trees + */ + public static int getFoliageColorBirch() { + return 8431445; + } + + public static int getFoliageColorBasic() { + return 4764952; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ColorizerGrass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ColorizerGrass.java new file mode 100644 index 0000000..d58bcc3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/ColorizerGrass.java @@ -0,0 +1,21 @@ +package net.minecraft.world; + +public class ColorizerGrass { + /** Color buffer for grass */ + private static int[] grassBuffer = new int[65536]; + + + public static void setGrassBiomeColorizer(int[] p_77479_0_) { + grassBuffer = p_77479_0_; + } + + /** + * Gets grass color from temperature and humidity. Args: temperature, humidity + */ + public static int getGrassColor(double p_77480_0_, double p_77480_2_) { + p_77480_2_ *= p_77480_0_; + int var4 = (int)((1.0D - p_77480_0_) * 255.0D); + int var5 = (int)((1.0D - p_77480_2_) * 255.0D); + return grassBuffer[var5 << 8 | var4]; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/EnumDifficulty.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/EnumDifficulty.java new file mode 100644 index 0000000..227ff95 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/EnumDifficulty.java @@ -0,0 +1,39 @@ +package net.minecraft.world; + +public enum EnumDifficulty { + PEACEFUL(0, "options.difficulty.peaceful"), + EASY(1, "options.difficulty.easy"), + NORMAL(2, "options.difficulty.normal"), + HARD(3, "options.difficulty.hard"); + private static final EnumDifficulty[] difficultyEnums = new EnumDifficulty[values().length]; + private final int difficultyId; + private final String difficultyResourceKey; + + + EnumDifficulty(int p_i45312_3_, String p_i45312_4_) { + this.difficultyId = p_i45312_3_; + this.difficultyResourceKey = p_i45312_4_; + } + + public int getDifficultyId() { + return this.difficultyId; + } + + public static EnumDifficulty getDifficultyEnum(int p_151523_0_) { + return difficultyEnums[p_151523_0_ % difficultyEnums.length]; + } + + public String getDifficultyResourceKey() { + return this.difficultyResourceKey; + } + + static { + EnumDifficulty[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + EnumDifficulty var3 = var0[var2]; + difficultyEnums[var3.difficultyId] = var3; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/EnumSkyBlock.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/EnumSkyBlock.java new file mode 100644 index 0000000..9e916f3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/EnumSkyBlock.java @@ -0,0 +1,12 @@ +package net.minecraft.world; + +public enum EnumSkyBlock { + Sky(15), + Block(0); + public final int defaultLightValue; + + + EnumSkyBlock(int p_i1961_3_) { + this.defaultLightValue = p_i1961_3_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/Explosion.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/Explosion.java new file mode 100644 index 0000000..bc93085 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/Explosion.java @@ -0,0 +1,236 @@ +package net.minecraft.world; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentProtection; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class Explosion { + /** whether or not the explosion sets fire to blocks around it */ + public boolean isFlaming; + + /** whether or not this explosion spawns smoke particles */ + public boolean isSmoking = true; + private final int field_77289_h = 16; + private final Random explosionRNG = new Random(); + private final World worldObj; + public double explosionX; + public double explosionY; + public double explosionZ; + public Entity exploder; + public float explosionSize; + + /** A list of ChunkPositions of blocks affected by this explosion */ + public List affectedBlockPositions = new ArrayList(); + private final Map field_77288_k = new HashMap(); + + + public Explosion(World p_i1948_1_, Entity p_i1948_2_, double p_i1948_3_, double p_i1948_5_, double p_i1948_7_, float p_i1948_9_) { + this.worldObj = p_i1948_1_; + this.exploder = p_i1948_2_; + this.explosionSize = p_i1948_9_; + this.explosionX = p_i1948_3_; + this.explosionY = p_i1948_5_; + this.explosionZ = p_i1948_7_; + } + + /** + * Does the first part of the explosion (destroy blocks) + */ + public void doExplosionA() { + float var1 = this.explosionSize; + HashSet var2 = new HashSet(); + int var3; + int var4; + int var5; + double var15; + double var17; + double var19; + + for (var3 = 0; var3 < this.field_77289_h; ++var3) { + for (var4 = 0; var4 < this.field_77289_h; ++var4) { + for (var5 = 0; var5 < this.field_77289_h; ++var5) { + if (var3 == 0 || var3 == this.field_77289_h - 1 || var4 == 0 || var4 == this.field_77289_h - 1 || var5 == 0 || var5 == this.field_77289_h - 1) { + double var6 = (float)var3 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F; + double var8 = (float)var4 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F; + double var10 = (float)var5 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F; + double var12 = Math.sqrt(var6 * var6 + var8 * var8 + var10 * var10); + var6 /= var12; + var8 /= var12; + var10 /= var12; + float var14 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); + var15 = this.explosionX; + var17 = this.explosionY; + var19 = this.explosionZ; + + for (float var21 = 0.3F; var14 > 0.0F; var14 -= var21 * 0.75F) { + int var22 = MathHelper.floor_double(var15); + int var23 = MathHelper.floor_double(var17); + int var24 = MathHelper.floor_double(var19); + Block var25 = this.worldObj.getBlock(var22, var23, var24); + + if (var25.getMaterial() != Material.air) { + float var26 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, var22, var23, var24, var25) : var25.getExplosionResistance(this.exploder); + var14 -= (var26 + 0.3F) * var21; + } + + if (var14 > 0.0F && (this.exploder == null || this.exploder.func_145774_a(this, this.worldObj, var22, var23, var24, var25, var14))) { + var2.add(new ChunkPosition(var22, var23, var24)); + } + + var15 += var6 * (double)var21; + var17 += var8 * (double)var21; + var19 += var10 * (double)var21; + } + } + } + } + } + + this.affectedBlockPositions.addAll(var2); + this.explosionSize *= 2.0F; + var3 = MathHelper.floor_double(this.explosionX - (double)this.explosionSize - 1.0D); + var4 = MathHelper.floor_double(this.explosionX + (double)this.explosionSize + 1.0D); + var5 = MathHelper.floor_double(this.explosionY - (double)this.explosionSize - 1.0D); + int var29 = MathHelper.floor_double(this.explosionY + (double)this.explosionSize + 1.0D); + int var7 = MathHelper.floor_double(this.explosionZ - (double)this.explosionSize - 1.0D); + int var30 = MathHelper.floor_double(this.explosionZ + (double)this.explosionSize + 1.0D); + List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getBoundingBox(var3, var5, var7, var4, var29, var30)); + Vec3 var31 = Vec3.createVectorHelper(this.explosionX, this.explosionY, this.explosionZ); + + for (int var11 = 0; var11 < var9.size(); ++var11) { + Entity var32 = (Entity)var9.get(var11); + double var13 = var32.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double)this.explosionSize; + + if (var13 <= 1.0D) { + var15 = var32.posX - this.explosionX; + var17 = var32.posY + (double)var32.getEyeHeight() - this.explosionY; + var19 = var32.posZ - this.explosionZ; + double var33 = MathHelper.sqrt_double(var15 * var15 + var17 * var17 + var19 * var19); + + if (var33 != 0.0D) { + var15 /= var33; + var17 /= var33; + var19 /= var33; + double var34 = this.worldObj.getBlockDensity(var31, var32.boundingBox); + double var35 = (1.0D - var13) * var34; + var32.attackEntityFrom(DamageSource.setExplosionSource(this), (float)((int)((var35 * var35 + var35) / 2.0D * 8.0D * (double)this.explosionSize + 1.0D))); + double var27 = EnchantmentProtection.func_92092_a(var32, var35); + var32.motionX += var15 * var27; + var32.motionY += var17 * var27; + var32.motionZ += var19 * var27; + + if (var32 instanceof EntityPlayer) { + this.field_77288_k.put(var32, Vec3.createVectorHelper(var15 * var35, var17 * var35, var19 * var35)); + } + } + } + } + + this.explosionSize = var1; + } + + /** + * Does the second part of the explosion (sound, particles, drop spawn) + */ + public void doExplosionB(boolean p_77279_1_) { + this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + + if (this.explosionSize >= 2.0F && this.isSmoking) { + this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); + } else { + this.worldObj.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); + } + + Iterator var2; + ChunkPosition var3; + int var4; + int var5; + int var6; + Block var7; + + if (this.isSmoking) { + var2 = this.affectedBlockPositions.iterator(); + + while (var2.hasNext()) { + var3 = (ChunkPosition)var2.next(); + var4 = var3.field_151329_a; + var5 = var3.field_151327_b; + var6 = var3.field_151328_c; + var7 = this.worldObj.getBlock(var4, var5, var6); + + if (p_77279_1_) { + double var8 = (float)var4 + this.worldObj.rand.nextFloat(); + double var10 = (float)var5 + this.worldObj.rand.nextFloat(); + double var12 = (float)var6 + this.worldObj.rand.nextFloat(); + double var14 = var8 - this.explosionX; + double var16 = var10 - this.explosionY; + double var18 = var12 - this.explosionZ; + double var20 = MathHelper.sqrt_double(var14 * var14 + var16 * var16 + var18 * var18); + var14 /= var20; + var16 /= var20; + var18 /= var20; + double var22 = 0.5D / (var20 / (double)this.explosionSize + 0.1D); + var22 *= this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F; + var14 *= var22; + var16 *= var22; + var18 *= var22; + this.worldObj.spawnParticle("explode", (var8 + this.explosionX * 1.0D) / 2.0D, (var10 + this.explosionY * 1.0D) / 2.0D, (var12 + this.explosionZ * 1.0D) / 2.0D, var14, var16, var18); + this.worldObj.spawnParticle("smoke", var8, var10, var12, var14, var16, var18); + } + + if (var7.getMaterial() != Material.air) { + if (var7.canDropFromExplosion(this)) { + var7.dropBlockAsItemWithChance(this.worldObj, var4, var5, var6, this.worldObj.getBlockMetadata(var4, var5, var6), 1.0F / this.explosionSize, 0); + } + + this.worldObj.setBlock(var4, var5, var6, Blocks.air, 0, 3); + var7.onBlockDestroyedByExplosion(this.worldObj, var4, var5, var6, this); + } + } + } + + if (this.isFlaming) { + var2 = this.affectedBlockPositions.iterator(); + + while (var2.hasNext()) { + var3 = (ChunkPosition)var2.next(); + var4 = var3.field_151329_a; + var5 = var3.field_151327_b; + var6 = var3.field_151328_c; + var7 = this.worldObj.getBlock(var4, var5, var6); + Block var24 = this.worldObj.getBlock(var4, var5 - 1, var6); + + if (var7.getMaterial() == Material.air && var24.func_149730_j() && this.explosionRNG.nextInt(3) == 0) { + this.worldObj.setBlock(var4, var5, var6, Blocks.fire); + } + } + } + } + + public Map func_77277_b() { + return this.field_77288_k; + } + + /** + * Returns either the entity that placed the explosive block, the entity that caused the explosion or null. + */ + public EntityLivingBase getExplosivePlacedBy() { + return this.exploder == null ? null : (this.exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/GameRules.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/GameRules.java new file mode 100644 index 0000000..c67811f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/GameRules.java @@ -0,0 +1,148 @@ +package net.minecraft.world; + +import java.util.Iterator; +import java.util.Set; +import java.util.TreeMap; +import net.minecraft.nbt.NBTTagCompound; + +public class GameRules { + private TreeMap theGameRules = new TreeMap(); + + public GameRules() { + this.addGameRule("doFireTick", "true"); + this.addGameRule("mobGriefing", "true"); + this.addGameRule("keepInventory", "false"); + this.addGameRule("doMobSpawning", "true"); + this.addGameRule("doMobLoot", "true"); + this.addGameRule("doTileDrops", "true"); + this.addGameRule("commandBlockOutput", "true"); + this.addGameRule("naturalRegeneration", "true"); + this.addGameRule("doDaylightCycle", "true"); + } + + /** + * Define a game rule and its default value. + */ + public void addGameRule(String par1Str, String par2Str) { + this.theGameRules.put(par1Str, new GameRules.Value(par2Str)); + } + + public void setOrCreateGameRule(String par1Str, String par2Str) { + GameRules.Value var3 = (GameRules.Value)this.theGameRules.get(par1Str); + + if (var3 != null) { + var3.setValue(par2Str); + } else { + this.addGameRule(par1Str, par2Str); + } + } + + /** + * Gets the string Game Rule value. + */ + public String getGameRuleStringValue(String par1Str) { + GameRules.Value var2 = (GameRules.Value)this.theGameRules.get(par1Str); + return var2 != null ? var2.getGameRuleStringValue() : ""; + } + + /** + * Gets the boolean Game Rule value. + */ + public boolean getGameRuleBooleanValue(String par1Str) { + GameRules.Value var2 = (GameRules.Value)this.theGameRules.get(par1Str); + return var2 != null ? var2.getGameRuleBooleanValue() : false; + } + + /** + * Return the defined game rules as NBT. + */ + public NBTTagCompound writeGameRulesToNBT() { + NBTTagCompound var1 = new NBTTagCompound(); + Iterator var2 = this.theGameRules.keySet().iterator(); + + while (var2.hasNext()) { + String var3 = (String)var2.next(); + GameRules.Value var4 = (GameRules.Value)this.theGameRules.get(var3); + var1.setString(var3, var4.getGameRuleStringValue()); + } + + return var1; + } + + /** + * Set defined game rules from NBT. + */ + public void readGameRulesFromNBT(NBTTagCompound par1NBTTagCompound) { + Set var2 = par1NBTTagCompound.func_150296_c(); + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + String var6 = par1NBTTagCompound.getString(var4); + this.setOrCreateGameRule(var4, var6); + } + } + + /** + * Return the defined game rules. + */ + public String[] getRules() { + return (String[])((String[])this.theGameRules.keySet().toArray(new String[0])); + } + + /** + * Return whether the specified game rule is defined. + */ + public boolean hasRule(String par1Str) { + return this.theGameRules.containsKey(par1Str); + } + + static class Value { + private String valueString; + private boolean valueBoolean; + private int valueInteger; + private double valueDouble; + + public Value(String par1Str) { + this.setValue(par1Str); + } + + public void setValue(String par1Str) { + this.valueString = par1Str; + + if (par1Str != null) { + if (par1Str.equals("false")) { + this.valueBoolean = false; + return; + } + + if (par1Str.equals("true")) { + this.valueBoolean = true; + return; + } + } + + this.valueBoolean = Boolean.parseBoolean(par1Str); + + try { + this.valueInteger = Integer.parseInt(par1Str); + } catch (NumberFormatException var4) { + ; + } + + try { + this.valueDouble = Double.parseDouble(par1Str); + } catch (NumberFormatException var3) { + ; + } + } + + public String getGameRuleStringValue() { + return this.valueString; + } + + public boolean getGameRuleBooleanValue() { + return this.valueBoolean; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/IBlockAccess.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/IBlockAccess.java new file mode 100644 index 0000000..9d41e8f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/IBlockAccess.java @@ -0,0 +1,46 @@ +package net.minecraft.world; + +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.biome.BiomeGenBase; + +public interface IBlockAccess { + Block getBlock(int p_147439_1_, int p_147439_2_, int p_147439_3_); + + TileEntity getTileEntity(int p_147438_1_, int p_147438_2_, int p_147438_3_); + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_); + + /** + * Returns the block metadata at coords x,y,z + */ + int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_); + + /** + * Returns true if the block at the specified coordinates is empty + */ + boolean isAirBlock(int p_147437_1_, int p_147437_2_, int p_147437_3_); + + /** + * Gets the biome for a given set of x/z coordinates + */ + BiomeGenBase getBiomeGenForCoords(int p_72807_1_, int p_72807_2_); + + /** + * Returns current world height. + */ + int getHeight(); + + /** + * set by !chunk.getAreLevelsEmpty + */ + boolean extendedLevelsInChunkCache(); + + /** + * Is this block powering in the specified direction Args: x, y, z, direction + */ + int isBlockProvidingPowerTo(int p_72879_1_, int p_72879_2_, int p_72879_3_, int p_72879_4_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/IWorldAccess.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/IWorldAccess.java new file mode 100644 index 0000000..963f9d6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/IWorldAccess.java @@ -0,0 +1,70 @@ +package net.minecraft.world; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +public interface IWorldAccess { + /** + * On the com.cheatbreaker.client, re-renders the block. On the server, sends the block to the com.cheatbreaker.client (which will re-render it), + * including the tile entity description packet if applicable. Args: x, y, z + */ + void markBlockForUpdate(int p_147586_1_, int p_147586_2_, int p_147586_3_); + + /** + * On the com.cheatbreaker.client, re-renders this block. On the server, does nothing. Used for lighting updates. + */ + void markBlockForRenderUpdate(int p_147588_1_, int p_147588_2_, int p_147588_3_); + + /** + * On the com.cheatbreaker.client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + void markBlockRangeForRenderUpdate(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_); + + /** + * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch + */ + void playSound(String p_72704_1_, double p_72704_2_, double p_72704_4_, double p_72704_6_, float p_72704_8_, float p_72704_9_); + + /** + * Plays sound to all near players except the player reference given + */ + void playSoundToNearExcept(EntityPlayer p_85102_1_, String p_85102_2_, double p_85102_3_, double p_85102_5_, double p_85102_7_, float p_85102_9_, float p_85102_10_); + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + void spawnParticle(String p_72708_1_, double p_72708_2_, double p_72708_4_, double p_72708_6_, double p_72708_8_, double p_72708_10_, double p_72708_12_); + + /** + * Called on all IWorldAccesses when an entity is created or loaded. On com.cheatbreaker.client worlds, starts downloading any + * necessary textures. On server worlds, adds the entity to the entity tracker. + */ + void onEntityCreate(Entity p_72703_1_); + + /** + * Called on all IWorldAccesses when an entity is unloaded or destroyed. On com.cheatbreaker.client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the entity tracker. + */ + void onEntityDestroy(Entity p_72709_1_); + + /** + * Plays the specified record. Arg: recordName, x, y, z + */ + void playRecord(String p_72702_1_, int p_72702_2_, int p_72702_3_, int p_72702_4_); + + void broadcastSound(int p_82746_1_, int p_82746_2_, int p_82746_3_, int p_82746_4_, int p_82746_5_); + + /** + * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). + */ + void playAuxSFX(EntityPlayer p_72706_1_, int p_72706_2_, int p_72706_3_, int p_72706_4_, int p_72706_5_, int p_72706_6_); + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value + */ + void destroyBlockPartially(int p_147587_1_, int p_147587_2_, int p_147587_3_, int p_147587_4_, int p_147587_5_); + + void onStaticEntitiesChanged(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/MinecraftException.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/MinecraftException.java new file mode 100644 index 0000000..a6193a0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/MinecraftException.java @@ -0,0 +1,9 @@ +package net.minecraft.world; + +public class MinecraftException extends Exception { + + + public MinecraftException(String p_i1955_1_) { + super(p_i1955_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/NextTickListEntry.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/NextTickListEntry.java new file mode 100644 index 0000000..9b63fba --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/NextTickListEntry.java @@ -0,0 +1,75 @@ +package net.minecraft.world; + +import net.minecraft.block.Block; + +public class NextTickListEntry implements Comparable { + /** The id number for the next tick entry */ + private static long nextTickEntryID; + private final Block field_151352_g; + + /** X position this tick is occuring at */ + public int xCoord; + + /** Y position this tick is occuring at */ + public int yCoord; + + /** Z position this tick is occuring at */ + public int zCoord; + + /** Time this tick is scheduled to occur at */ + public long scheduledTime; + public int priority; + + /** The id of the tick entry */ + private final long tickEntryID; + + + public NextTickListEntry(int p_i45370_1_, int p_i45370_2_, int p_i45370_3_, Block p_i45370_4_) { + this.tickEntryID = nextTickEntryID++; + this.xCoord = p_i45370_1_; + this.yCoord = p_i45370_2_; + this.zCoord = p_i45370_3_; + this.field_151352_g = p_i45370_4_; + } + + public boolean equals(Object p_equals_1_) { + if (!(p_equals_1_ instanceof NextTickListEntry)) { + return false; + } else { + NextTickListEntry var2 = (NextTickListEntry)p_equals_1_; + return this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord && Block.isEqualTo(this.field_151352_g, var2.field_151352_g); + } + } + + public int hashCode() { + return (this.xCoord * 1024 * 1024 + this.zCoord * 1024 + this.yCoord) * 256; + } + + /** + * Sets the scheduled time for this tick entry + */ + public NextTickListEntry setScheduledTime(long p_77176_1_) { + this.scheduledTime = p_77176_1_; + return this; + } + + public void setPriority(int p_82753_1_) { + this.priority = p_82753_1_; + } + + public int compareTo(NextTickListEntry p_compareTo_1_) { + return this.scheduledTime < p_compareTo_1_.scheduledTime ? -1 : (this.scheduledTime > p_compareTo_1_.scheduledTime ? 1 : (this.priority != p_compareTo_1_.priority ? this.priority - p_compareTo_1_.priority : (this.tickEntryID < p_compareTo_1_.tickEntryID ? -1 : (this.tickEntryID > p_compareTo_1_.tickEntryID ? 1 : 0)))); + } + + public String toString() { + return Block.getIdFromBlock(this.field_151352_g) + ": (" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + "), " + this.scheduledTime + ", " + this.priority + ", " + this.tickEntryID; + } + + public Block func_151351_a() { + return this.field_151352_g; + } + + public int compareTo(Object p_compareTo_1_) { + return this.compareTo((NextTickListEntry)p_compareTo_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/SpawnerAnimals.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/SpawnerAnimals.java new file mode 100644 index 0000000..90710e1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/SpawnerAnimals.java @@ -0,0 +1,281 @@ +package net.minecraft.world; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.src.Reflector; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +import net.minecraft.world.chunk.Chunk; + +public final class SpawnerAnimals { + /** The 17x17 area around the player where mobs can spawn */ + private HashMap eligibleChunksForSpawning = new HashMap(); + private Map mapSampleEntitiesByClass = new HashMap(); + private int lastPlayerChunkX = Integer.MAX_VALUE; + private int lastPlayerChunkZ = Integer.MAX_VALUE; + + protected static ChunkPosition func_151350_a(World p_151350_0_, int p_151350_1_, int p_151350_2_) { + Chunk var3 = p_151350_0_.getChunkFromChunkCoords(p_151350_1_, p_151350_2_); + int var4 = p_151350_1_ * 16 + p_151350_0_.rand.nextInt(16); + int var5 = p_151350_2_ * 16 + p_151350_0_.rand.nextInt(16); + int var6 = p_151350_0_.rand.nextInt(var3 == null ? p_151350_0_.getActualHeight() : var3.getTopFilledSegment() + 16 - 1); + return new ChunkPosition(var4, var6, var5); + } + + /** + * adds all chunks within the spawn radius of the players to eligibleChunksForSpawning. pars: the world, + * hostileCreatures, passiveCreatures. returns number of eligible chunks. + */ + public int findChunksForSpawning(WorldServer par1WorldServer, boolean par2, boolean par3, boolean par4) { + if (!par2 && !par3) { + return 0; + } else { + EntityPlayer player = null; + + if (par1WorldServer.playerEntities.size() == 1) { + player = (EntityPlayer)par1WorldServer.playerEntities.get(0); + } + + int var5; + int var8; + int countEntities; + ChunkCoordIntPair var39; + + if (player == null || player.chunkCoordX != this.lastPlayerChunkX || player.chunkCoordZ != this.lastPlayerChunkZ || this.eligibleChunksForSpawning.size() <= 0) { + this.eligibleChunksForSpawning.clear(); + + for (var5 = 0; var5 < par1WorldServer.playerEntities.size(); ++var5) { + EntityPlayer var34 = (EntityPlayer)par1WorldServer.playerEntities.get(var5); + int var35 = MathHelper.floor_double(var34.posX / 16.0D); + var8 = MathHelper.floor_double(var34.posZ / 16.0D); + byte var36 = 8; + + for (int var37 = -var36; var37 <= var36; ++var37) { + for (countEntities = -var36; countEntities <= var36; ++countEntities) { + boolean var38 = var37 == -var36 || var37 == var36 || countEntities == -var36 || countEntities == var36; + var39 = new ChunkCoordIntPair(var37 + var35, countEntities + var8); + + if (!var38) { + this.eligibleChunksForSpawning.put(var39, Boolean.valueOf(false)); + } else if (!this.eligibleChunksForSpawning.containsKey(var39)) { + this.eligibleChunksForSpawning.put(var39, Boolean.valueOf(true)); + } + } + } + } + + if (player != null) { + this.lastPlayerChunkX = player.chunkCoordX; + this.lastPlayerChunkZ = player.chunkCoordZ; + } + } + + var5 = 0; + ChunkCoordinates var411 = par1WorldServer.getSpawnPoint(); + EnumCreatureType[] var42 = EnumCreatureType.values(); + var8 = var42.length; + + for (int var43 = 0; var43 < var8; ++var43) { + EnumCreatureType var44 = var42[var43]; + boolean var45 = false; + + if (Reflector.ForgeWorld_countEntities.exists()) { + countEntities = Reflector.callInt(par1WorldServer, Reflector.ForgeWorld_countEntities, new Object[] {var44, Boolean.valueOf(true)}); + } else { + countEntities = par1WorldServer.countEntities(var44.getCreatureClass()); + } + + if ((!var44.getPeacefulCreature() || par3) && (var44.getPeacefulCreature() || par2) && (!var44.getAnimal() || par4) && countEntities <= var44.getMaxNumberOfCreature() * this.eligibleChunksForSpawning.size() / 256) { + Iterator var46 = this.eligibleChunksForSpawning.keySet().iterator(); + label143: + + while (var46.hasNext()) { + var39 = (ChunkCoordIntPair)var46.next(); + + if (!((Boolean)this.eligibleChunksForSpawning.get(var39)).booleanValue()) { + Chunk chunk = par1WorldServer.getChunkFromChunkCoords(var39.chunkXPos, var39.chunkZPos); + int var14 = var39.chunkXPos * 16 + par1WorldServer.rand.nextInt(16); + int var16 = var39.chunkZPos * 16 + par1WorldServer.rand.nextInt(16); + int var15 = par1WorldServer.rand.nextInt(chunk == null ? par1WorldServer.getActualHeight() : chunk.getTopFilledSegment() + 16 - 1); + + if (!par1WorldServer.getBlock(var14, var15, var16).isNormalCube() && par1WorldServer.getBlock(var14, var15, var16).getMaterial() == var44.getCreatureMaterial()) { + int var17 = 0; + int var18 = 0; + + while (var18 < 3) { + int var19 = var14; + int var20 = var15; + int var21 = var16; + byte var22 = 6; + SpawnListEntry var23 = null; + IEntityLivingData var24 = null; + int var25 = 0; + + while (true) { + if (var25 < 4) { + label136: + { + var19 += par1WorldServer.rand.nextInt(var22) - par1WorldServer.rand.nextInt(var22); + var20 += par1WorldServer.rand.nextInt(1) - par1WorldServer.rand.nextInt(1); + var21 += par1WorldServer.rand.nextInt(var22) - par1WorldServer.rand.nextInt(var22); + + if (canCreatureTypeSpawnAtLocation(var44, par1WorldServer, var19, var20, var21)) { + float var26 = (float)var19 + 0.5F; + float var27 = (float)var20; + float var28 = (float)var21 + 0.5F; + + if (par1WorldServer.getClosestPlayer((double)var26, (double)var27, (double)var28, 24.0D) == null) { + float var29 = var26 - (float)var411.posX; + float var30 = var27 - (float)var411.posY; + float var31 = var28 - (float)var411.posZ; + float var32 = var29 * var29 + var30 * var30 + var31 * var31; + + if (var32 >= 576.0F) { + if (var23 == null) { + var23 = par1WorldServer.spawnRandomCreature(var44, var19, var20, var21); + + if (var23 == null) { + break label136; + } + } + + EntityLiving var41; + + try { + var41 = (EntityLiving)this.mapSampleEntitiesByClass.get(var23.entityClass); + + if (var41 == null) { + var41 = (EntityLiving)var23.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1WorldServer}); + this.mapSampleEntitiesByClass.put(var23.entityClass, var41); + } + } catch (Exception var40) { + var40.printStackTrace(); + return var5; + } + + var41.setLocationAndAngles((double)var26, (double)var27, (double)var28, par1WorldServer.rand.nextFloat() * 360.0F, 0.0F); + boolean canSpawn = false; + + if (Reflector.ForgeEventFactory_canEntitySpawn.exists()) { + Object result = Reflector.call(Reflector.ForgeEventFactory_canEntitySpawn, new Object[] {var41, par1WorldServer, Float.valueOf(var26), Float.valueOf(var27), Float.valueOf(var28)}); + Object result_ALLOW = Reflector.getFieldValue(Reflector.Event_Result_ALLOW); + Object result_DEFAULT = Reflector.getFieldValue(Reflector.Event_Result_DEFAULT); + canSpawn = result == result_ALLOW || result == result_DEFAULT && var41.getCanSpawnHere(); + } else { + canSpawn = var41.getCanSpawnHere(); + } + + if (canSpawn) { + this.mapSampleEntitiesByClass.put(var23.entityClass, (Object)null); + ++var17; + par1WorldServer.spawnEntityInWorld(var41); + var24 = var41.onSpawnWithEgg(var24); + + if (var17 >= var41.getMaxSpawnedInChunk()) { + continue label143; + } + } + + var5 += var17; + } + } + } + + ++var25; + continue; + } + } + + ++var18; + break; + } + } + } + } + } + } + } + + return var5; + } + } + + /** + * Returns whether or not the specified creature type can spawn at the specified location. + */ + public static boolean canCreatureTypeSpawnAtLocation(EnumCreatureType par0EnumCreatureType, World par1World, int par2, int par3, int par4) { + if (par0EnumCreatureType.getCreatureMaterial() == Material.water) { + return par1World.getBlock(par2, par3, par4).getMaterial().isLiquid() && par1World.getBlock(par2, par3 - 1, par4).getMaterial().isLiquid() && !par1World.getBlock(par2, par3 + 1, par4).isNormalCube(); + } else if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4)) { + return false; + } else { + Block var5 = par1World.getBlock(par2, par3 - 1, par4); + return Reflector.ForgeBlock_canCreatureSpawn.exists() && !Reflector.callBoolean(var5, Reflector.ForgeBlock_canCreatureSpawn, new Object[] {par0EnumCreatureType, par1World, Integer.valueOf(par2), Integer.valueOf(par3), Integer.valueOf(par4)}) ? false : var5 != Blocks.bedrock && !par1World.getBlock(par2, par3, par4).isNormalCube() && !par1World.getBlock(par2, par3, par4).getMaterial().isLiquid() && !par1World.getBlock(par2, par3 + 1, par4).isNormalCube(); + } + } + + /** + * Called during chunk generation to spawn initial creatures. + */ + public static void performWorldGenSpawning(World par0World, BiomeGenBase par1BiomeGenBase, int par2, int par3, int par4, int par5, Random par6Random) { + List var7 = par1BiomeGenBase.getSpawnableList(EnumCreatureType.creature); + + if (!var7.isEmpty()) { + while (par6Random.nextFloat() < par1BiomeGenBase.getSpawningChance()) { + SpawnListEntry var8 = (SpawnListEntry)WeightedRandom.getRandomItem(par0World.rand, var7); + IEntityLivingData var9 = null; + int var10 = var8.minGroupCount + par6Random.nextInt(1 + var8.maxGroupCount - var8.minGroupCount); + int var11 = par2 + par6Random.nextInt(par4); + int var12 = par3 + par6Random.nextInt(par5); + int var13 = var11; + int var14 = var12; + + for (int var15 = 0; var15 < var10; ++var15) { + boolean var16 = false; + + for (int var17 = 0; !var16 && var17 < 4; ++var17) { + int var18 = par0World.getTopSolidOrLiquidBlock(var11, var12); + + if (canCreatureTypeSpawnAtLocation(EnumCreatureType.creature, par0World, var11, var18, var12)) { + float var19 = (float)var11 + 0.5F; + float var20 = (float)var18; + float var21 = (float)var12 + 0.5F; + EntityLiving var22; + + try { + var22 = (EntityLiving)var8.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par0World}); + } catch (Exception var24) { + var24.printStackTrace(); + continue; + } + + var22.setLocationAndAngles((double)var19, (double)var20, (double)var21, par6Random.nextFloat() * 360.0F, 0.0F); + par0World.spawnEntityInWorld(var22); + var9 = var22.onSpawnWithEgg(var9); + var16 = true; + } + + var11 += par6Random.nextInt(5) - par6Random.nextInt(5); + + for (var12 += par6Random.nextInt(5) - par6Random.nextInt(5); var11 < par2 || var11 >= par2 + par4 || var12 < par3 || var12 >= par3 + par4; var12 = var14 + par6Random.nextInt(5) - par6Random.nextInt(5)) { + var11 = var13 + par6Random.nextInt(5) - par6Random.nextInt(5); + } + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/Teleporter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/Teleporter.java new file mode 100644 index 0000000..ada101d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/Teleporter.java @@ -0,0 +1,439 @@ +package net.minecraft.world; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Direction; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; + +public class Teleporter { + private final WorldServer worldServerInstance; + + /** A private Random() function in Teleporter */ + private final Random random; + + /** Stores successful portal placement locations for rapid lookup. */ + private final LongHashMap destinationCoordinateCache = new LongHashMap(); + + /** + * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial + * location. + */ + private final List destinationCoordinateKeys = new ArrayList(); + + + public Teleporter(WorldServer p_i1963_1_) { + this.worldServerInstance = p_i1963_1_; + this.random = new Random(p_i1963_1_.getSeed()); + } + + /** + * Place an entity in a nearby portal, creating one if necessary. + */ + public void placeInPortal(Entity p_77185_1_, double p_77185_2_, double p_77185_4_, double p_77185_6_, float p_77185_8_) { + if (this.worldServerInstance.provider.dimensionId != 1) { + if (!this.placeInExistingPortal(p_77185_1_, p_77185_2_, p_77185_4_, p_77185_6_, p_77185_8_)) { + this.makePortal(p_77185_1_); + this.placeInExistingPortal(p_77185_1_, p_77185_2_, p_77185_4_, p_77185_6_, p_77185_8_); + } + } else { + int var9 = MathHelper.floor_double(p_77185_1_.posX); + int var10 = MathHelper.floor_double(p_77185_1_.posY) - 1; + int var11 = MathHelper.floor_double(p_77185_1_.posZ); + byte var12 = 1; + byte var13 = 0; + + for (int var14 = -2; var14 <= 2; ++var14) { + for (int var15 = -2; var15 <= 2; ++var15) { + for (int var16 = -1; var16 < 3; ++var16) { + int var17 = var9 + var15 * var12 + var14 * var13; + int var18 = var10 + var16; + int var19 = var11 + var15 * var13 - var14 * var12; + boolean var20 = var16 < 0; + this.worldServerInstance.setBlock(var17, var18, var19, var20 ? Blocks.obsidian : Blocks.air); + } + } + } + + p_77185_1_.setLocationAndAngles(var9, var10, var11, p_77185_1_.rotationYaw, 0.0F); + p_77185_1_.motionX = p_77185_1_.motionY = p_77185_1_.motionZ = 0.0D; + } + } + + /** + * Place an entity in a nearby portal which already exists. + */ + public boolean placeInExistingPortal(Entity p_77184_1_, double p_77184_2_, double p_77184_4_, double p_77184_6_, float p_77184_8_) { + short var9 = 128; + double var10 = -1.0D; + int var12 = 0; + int var13 = 0; + int var14 = 0; + int var15 = MathHelper.floor_double(p_77184_1_.posX); + int var16 = MathHelper.floor_double(p_77184_1_.posZ); + long var17 = ChunkCoordIntPair.chunkXZ2Int(var15, var16); + boolean var19 = true; + double var27; + int var48; + + if (this.destinationCoordinateCache.containsItem(var17)) { + Teleporter.PortalPosition var20 = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(var17); + var10 = 0.0D; + var12 = var20.posX; + var13 = var20.posY; + var14 = var20.posZ; + var20.lastUpdateTime = this.worldServerInstance.getTotalWorldTime(); + var19 = false; + } else { + for (var48 = var15 - var9; var48 <= var15 + var9; ++var48) { + double var21 = (double)var48 + 0.5D - p_77184_1_.posX; + + for (int var23 = var16 - var9; var23 <= var16 + var9; ++var23) { + double var24 = (double)var23 + 0.5D - p_77184_1_.posZ; + + for (int var26 = this.worldServerInstance.getActualHeight() - 1; var26 >= 0; --var26) { + if (this.worldServerInstance.getBlock(var48, var26, var23) == Blocks.portal) { + while (this.worldServerInstance.getBlock(var48, var26 - 1, var23) == Blocks.portal) { + --var26; + } + + var27 = (double)var26 + 0.5D - p_77184_1_.posY; + double var29 = var21 * var21 + var27 * var27 + var24 * var24; + + if (var10 < 0.0D || var29 < var10) { + var10 = var29; + var12 = var48; + var13 = var26; + var14 = var23; + } + } + } + } + } + } + + if (var10 >= 0.0D) { + if (var19) { + this.destinationCoordinateCache.add(var17, new Teleporter.PortalPosition(var12, var13, var14, this.worldServerInstance.getTotalWorldTime())); + this.destinationCoordinateKeys.add(Long.valueOf(var17)); + } + + double var49 = (double)var12 + 0.5D; + double var25 = (double)var13 + 0.5D; + var27 = (double)var14 + 0.5D; + int var50 = -1; + + if (this.worldServerInstance.getBlock(var12 - 1, var13, var14) == Blocks.portal) { + var50 = 2; + } + + if (this.worldServerInstance.getBlock(var12 + 1, var13, var14) == Blocks.portal) { + var50 = 0; + } + + if (this.worldServerInstance.getBlock(var12, var13, var14 - 1) == Blocks.portal) { + var50 = 3; + } + + if (this.worldServerInstance.getBlock(var12, var13, var14 + 1) == Blocks.portal) { + var50 = 1; + } + + int var30 = p_77184_1_.getTeleportDirection(); + + if (var50 > -1) { + int var31 = Direction.rotateLeft[var50]; + int var32 = Direction.offsetX[var50]; + int var33 = Direction.offsetZ[var50]; + int var34 = Direction.offsetX[var31]; + int var35 = Direction.offsetZ[var31]; + boolean var36 = !this.worldServerInstance.isAirBlock(var12 + var32 + var34, var13, var14 + var33 + var35) || !this.worldServerInstance.isAirBlock(var12 + var32 + var34, var13 + 1, var14 + var33 + var35); + boolean var37 = !this.worldServerInstance.isAirBlock(var12 + var32, var13, var14 + var33) || !this.worldServerInstance.isAirBlock(var12 + var32, var13 + 1, var14 + var33); + + if (var36 && var37) { + var50 = Direction.rotateOpposite[var50]; + var31 = Direction.rotateOpposite[var31]; + var32 = Direction.offsetX[var50]; + var33 = Direction.offsetZ[var50]; + var34 = Direction.offsetX[var31]; + var35 = Direction.offsetZ[var31]; + var48 = var12 - var34; + var49 -= var34; + int var22 = var14 - var35; + var27 -= var35; + var36 = !this.worldServerInstance.isAirBlock(var48 + var32 + var34, var13, var22 + var33 + var35) || !this.worldServerInstance.isAirBlock(var48 + var32 + var34, var13 + 1, var22 + var33 + var35); + var37 = !this.worldServerInstance.isAirBlock(var48 + var32, var13, var22 + var33) || !this.worldServerInstance.isAirBlock(var48 + var32, var13 + 1, var22 + var33); + } + + float var38 = 0.5F; + float var39 = 0.5F; + + if (!var36 && var37) { + var38 = 1.0F; + } else if (var36 && !var37) { + var38 = 0.0F; + } else if (var36 && var37) { + var39 = 0.0F; + } + + var49 += (float)var34 * var38 + var39 * (float)var32; + var27 += (float)var35 * var38 + var39 * (float)var33; + float var40 = 0.0F; + float var41 = 0.0F; + float var42 = 0.0F; + float var43 = 0.0F; + + if (var50 == var30) { + var40 = 1.0F; + var41 = 1.0F; + } else if (var50 == Direction.rotateOpposite[var30]) { + var40 = -1.0F; + var41 = -1.0F; + } else if (var50 == Direction.rotateRight[var30]) { + var42 = 1.0F; + var43 = -1.0F; + } else { + var42 = -1.0F; + var43 = 1.0F; + } + + double var44 = p_77184_1_.motionX; + double var46 = p_77184_1_.motionZ; + p_77184_1_.motionX = var44 * (double)var40 + var46 * (double)var43; + p_77184_1_.motionZ = var44 * (double)var42 + var46 * (double)var41; + p_77184_1_.rotationYaw = p_77184_8_ - (float)(var30 * 90) + (float)(var50 * 90); + } else { + p_77184_1_.motionX = p_77184_1_.motionY = p_77184_1_.motionZ = 0.0D; + } + + p_77184_1_.setLocationAndAngles(var49, var25, var27, p_77184_1_.rotationYaw, p_77184_1_.rotationPitch); + return true; + } else { + return false; + } + } + + public boolean makePortal(Entity p_85188_1_) { + byte var2 = 16; + double var3 = -1.0D; + int var5 = MathHelper.floor_double(p_85188_1_.posX); + int var6 = MathHelper.floor_double(p_85188_1_.posY); + int var7 = MathHelper.floor_double(p_85188_1_.posZ); + int var8 = var5; + int var9 = var6; + int var10 = var7; + int var11 = 0; + int var12 = this.random.nextInt(4); + int var13; + double var14; + int var16; + double var17; + int var19; + int var20; + int var21; + int var22; + int var23; + int var24; + int var25; + int var26; + int var27; + double var31; + double var32; + + for (var13 = var5 - var2; var13 <= var5 + var2; ++var13) { + var14 = (double)var13 + 0.5D - p_85188_1_.posX; + + for (var16 = var7 - var2; var16 <= var7 + var2; ++var16) { + var17 = (double)var16 + 0.5D - p_85188_1_.posZ; + label274: + + for (var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) { + if (this.worldServerInstance.isAirBlock(var13, var19, var16)) { + while (var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) { + --var19; + } + + for (var20 = var12; var20 < var12 + 4; ++var20) { + var21 = var20 % 2; + var22 = 1 - var21; + + if (var20 % 4 >= 2) { + var21 = -var21; + var22 = -var22; + } + + for (var23 = 0; var23 < 3; ++var23) { + for (var24 = 0; var24 < 4; ++var24) { + for (var25 = -1; var25 < 4; ++var25) { + var26 = var13 + (var24 - 1) * var21 + var23 * var22; + var27 = var19 + var25; + int var28 = var16 + (var24 - 1) * var22 - var23 * var21; + + if (var25 < 0 && !this.worldServerInstance.getBlock(var26, var27, var28).getMaterial().isSolid() || var25 >= 0 && !this.worldServerInstance.isAirBlock(var26, var27, var28)) { + continue label274; + } + } + } + } + + var31 = (double)var19 + 0.5D - p_85188_1_.posY; + var32 = var14 * var14 + var31 * var31 + var17 * var17; + + if (var3 < 0.0D || var32 < var3) { + var3 = var32; + var8 = var13; + var9 = var19; + var10 = var16; + var11 = var20 % 4; + } + } + } + } + } + } + + if (var3 < 0.0D) { + for (var13 = var5 - var2; var13 <= var5 + var2; ++var13) { + var14 = (double)var13 + 0.5D - p_85188_1_.posX; + + for (var16 = var7 - var2; var16 <= var7 + var2; ++var16) { + var17 = (double)var16 + 0.5D - p_85188_1_.posZ; + label222: + + for (var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) { + if (this.worldServerInstance.isAirBlock(var13, var19, var16)) { + while (var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) { + --var19; + } + + for (var20 = var12; var20 < var12 + 2; ++var20) { + var21 = var20 % 2; + var22 = 1 - var21; + + for (var23 = 0; var23 < 4; ++var23) { + for (var24 = -1; var24 < 4; ++var24) { + var25 = var13 + (var23 - 1) * var21; + var26 = var19 + var24; + var27 = var16 + (var23 - 1) * var22; + + if (var24 < 0 && !this.worldServerInstance.getBlock(var25, var26, var27).getMaterial().isSolid() || var24 >= 0 && !this.worldServerInstance.isAirBlock(var25, var26, var27)) { + continue label222; + } + } + } + + var31 = (double)var19 + 0.5D - p_85188_1_.posY; + var32 = var14 * var14 + var31 * var31 + var17 * var17; + + if (var3 < 0.0D || var32 < var3) { + var3 = var32; + var8 = var13; + var9 = var19; + var10 = var16; + var11 = var20 % 2; + } + } + } + } + } + } + } + + int var29 = var8; + int var15 = var9; + var16 = var10; + int var30 = var11 % 2; + int var18 = 1 - var30; + + if (var11 % 4 >= 2) { + var30 = -var30; + var18 = -var18; + } + + boolean var33; + + if (var3 < 0.0D) { + if (var9 < 70) { + var9 = 70; + } + + if (var9 > this.worldServerInstance.getActualHeight() - 10) { + var9 = this.worldServerInstance.getActualHeight() - 10; + } + + var15 = var9; + + for (var19 = -1; var19 <= 1; ++var19) { + for (var20 = 1; var20 < 3; ++var20) { + for (var21 = -1; var21 < 3; ++var21) { + var22 = var29 + (var20 - 1) * var30 + var19 * var18; + var23 = var15 + var21; + var24 = var16 + (var20 - 1) * var18 - var19 * var30; + var33 = var21 < 0; + this.worldServerInstance.setBlock(var22, var23, var24, var33 ? Blocks.obsidian : Blocks.air); + } + } + } + } + + for (var19 = 0; var19 < 4; ++var19) { + for (var20 = 0; var20 < 4; ++var20) { + for (var21 = -1; var21 < 4; ++var21) { + var22 = var29 + (var20 - 1) * var30; + var23 = var15 + var21; + var24 = var16 + (var20 - 1) * var18; + var33 = var20 == 0 || var20 == 3 || var21 == -1 || var21 == 3; + this.worldServerInstance.setBlock(var22, var23, var24, var33 ? Blocks.obsidian : Blocks.portal, 0, 2); + } + } + + for (var20 = 0; var20 < 4; ++var20) { + for (var21 = -1; var21 < 4; ++var21) { + var22 = var29 + (var20 - 1) * var30; + var23 = var15 + var21; + var24 = var16 + (var20 - 1) * var18; + this.worldServerInstance.notifyBlocksOfNeighborChange(var22, var23, var24, this.worldServerInstance.getBlock(var22, var23, var24)); + } + } + } + + return true; + } + + /** + * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a + * WorldServer.getTotalWorldTime() value. + */ + public void removeStalePortalLocations(long p_85189_1_) { + if (p_85189_1_ % 100L == 0L) { + Iterator var3 = this.destinationCoordinateKeys.iterator(); + long var4 = p_85189_1_ - 600L; + + while (var3.hasNext()) { + Long var6 = (Long)var3.next(); + Teleporter.PortalPosition var7 = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(var6.longValue()); + + if (var7 == null || var7.lastUpdateTime < var4) { + var3.remove(); + this.destinationCoordinateCache.remove(var6.longValue()); + } + } + } + } + + public class PortalPosition extends ChunkCoordinates { + public long lastUpdateTime; + + + public PortalPosition(int p_i1962_2_, int p_i1962_3_, int p_i1962_4_, long p_i1962_5_) { + super(p_i1962_2_, p_i1962_3_, p_i1962_4_); + this.lastUpdateTime = p_i1962_5_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/World.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/World.java new file mode 100644 index 0000000..429f422 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/World.java @@ -0,0 +1,3411 @@ +package net.minecraft.world; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.block.*; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathFinder; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.*; +import net.minecraft.village.VillageCollection; +import net.minecraft.village.VillageSiege; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.MapStorage; +import net.minecraft.world.storage.WorldInfo; + +import java.util.*; +import java.util.concurrent.Callable; + +public abstract class World implements IBlockAccess { + /** + * boolean; if true updates scheduled by scheduleBlockUpdate happen immediately + */ + public boolean scheduledUpdatesAreImmediate; + + /** A list of all Entities in all currently-loaded chunks */ + public List loadedEntityList = new ArrayList(); + protected List unloadedEntityList = new ArrayList(); + public List field_147482_g = new ArrayList(); + private final List field_147484_a = new ArrayList(); + private final List field_147483_b = new ArrayList(); + + /** Array list of players in the world. */ + public List playerEntities = new ArrayList(); + + /** a list of all the lightning entities */ + public List weatherEffects = new ArrayList(); + private final long cloudColour = 16777215L; + + /** How much light is subtracted from full daylight */ + public int skylightSubtracted; + + /** + * Contains the current Linear Congruential Generator seed for block updates. Used with an A value of 3 and a C + * value of 0x3c6ef35f, producing a highly planar series of values ill-suited for choosing random blocks in a + * 16x128x16 field. + */ + protected int updateLCG = (new Random()).nextInt(); + + /** + * magic number used to generate fast random numbers for 3d distribution within a chunk + */ + protected final int DIST_HASH_MAGIC = 1013904223; + protected float prevRainingStrength; + protected float rainingStrength; + protected float prevThunderingStrength; + protected float thunderingStrength; + + /** + * Set to 2 whenever a lightning bolt is generated in SSP. Decrements if > 0 in updateWeather(). Value appears to be + * unused. + */ + public int lastLightningBolt; + + /** Option > Difficulty setting (0 - 3) */ + public EnumDifficulty difficultySetting; + + /** RNG for World. */ + public Random rand = new Random(); + + /** The WorldProvider instance that World uses. */ + public final WorldProvider provider; + protected List worldAccesses = new ArrayList(); + + /** Handles chunk operations and caching */ + protected IChunkProvider chunkProvider; + protected final ISaveHandler saveHandler; + + /** + * holds information about a world (size on disk, time, spawn point, seed, ...) + */ + protected WorldInfo worldInfo; + + /** Boolean that is set to true when trying to find a spawn point */ + public boolean findingSpawnPoint; + public MapStorage mapStorage; + public final VillageCollection villageCollectionObj; + protected final VillageSiege villageSiegeObj = new VillageSiege(this); + public final Profiler theProfiler; + private final Calendar theCalendar = Calendar.getInstance(); + protected Scoreboard worldScoreboard = new Scoreboard(); + + /** This is set to true for com.cheatbreaker.client worlds, and false for server worlds. */ + public boolean isClient; + + /** Positions to update */ + protected Set activeChunkSet = new HashSet(); + + /** number of ticks until the next random ambients play */ + private int ambientTickCountdown; + + /** indicates if enemies are spawned or not */ + protected boolean spawnHostileMobs; + + /** A flag indicating whether we should spawn peaceful mobs. */ + protected boolean spawnPeacefulMobs; + private final ArrayList collidingBoundingBoxes; + private boolean field_147481_N; + + /** + * is a temporary list of blocks and light values used when updating light levels. Holds up to 32x32x32 blocks (the + * maximum influence of a light source.) Every element is a packed bit value: 0000000000LLLLzzzzzzyyyyyyxxxxxx. The + * 4-bit L is a light level used when darkening blocks. 6-bit numbers x, y and z represent the block's offset from + * the original block, plus 32 (i.e. value of 31 would mean a -1 offset + */ + int[] lightUpdateBlockList; + + + /** + * Gets the biome for a given set of x/z coordinates + */ + public BiomeGenBase getBiomeGenForCoords(final int p_72807_1_, final int p_72807_2_) { + if (this.blockExists(p_72807_1_, 0, p_72807_2_)) { + Chunk var3 = this.getChunkFromBlockCoords(p_72807_1_, p_72807_2_); + + try { + return var3.getBiomeGenForWorldCoords(p_72807_1_ & 15, p_72807_2_ & 15, this.provider.worldChunkMgr); + } catch (Throwable var7) { + CrashReport var5 = CrashReport.makeCrashReport(var7, "Getting biome"); + CrashReportCategory var6 = var5.makeCategory("Coordinates of biome request"); + var6.addCrashSectionCallable("Location", new Callable() { + + public String call() { + return CrashReportCategory.getLocationInfo(p_72807_1_, 0, p_72807_2_); + } + }); + throw new ReportedException(var5); + } + } else { + return this.provider.worldChunkMgr.getBiomeGenAt(p_72807_1_, p_72807_2_); + } + } + + public WorldChunkManager getWorldChunkManager() { + return this.provider.worldChunkMgr; + } + + public World(ISaveHandler p_i45368_1_, String p_i45368_2_, WorldProvider p_i45368_3_, WorldSettings p_i45368_4_, Profiler p_i45368_5_) { + this.ambientTickCountdown = this.rand.nextInt(12000); + this.spawnHostileMobs = true; + this.spawnPeacefulMobs = true; + this.collidingBoundingBoxes = new ArrayList(); + this.lightUpdateBlockList = new int[32768]; + this.saveHandler = p_i45368_1_; + this.theProfiler = p_i45368_5_; + this.worldInfo = new WorldInfo(p_i45368_4_, p_i45368_2_); + this.provider = p_i45368_3_; + this.mapStorage = new MapStorage(p_i45368_1_); + VillageCollection var6 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); + + if (var6 == null) { + this.villageCollectionObj = new VillageCollection(this); + this.mapStorage.setData("villages", this.villageCollectionObj); + } else { + this.villageCollectionObj = var6; + this.villageCollectionObj.func_82566_a(this); + } + + p_i45368_3_.registerWorld(this); + this.chunkProvider = this.createChunkProvider(); + this.calculateInitialSkylight(); + this.calculateInitialWeather(); + } + + public World(ISaveHandler p_i45369_1_, String p_i45369_2_, WorldSettings p_i45369_3_, WorldProvider p_i45369_4_, Profiler p_i45369_5_) { + this.ambientTickCountdown = this.rand.nextInt(12000); + this.spawnHostileMobs = true; + this.spawnPeacefulMobs = true; + this.collidingBoundingBoxes = new ArrayList(); + this.lightUpdateBlockList = new int[32768]; + this.saveHandler = p_i45369_1_; + this.theProfiler = p_i45369_5_; + this.mapStorage = new MapStorage(p_i45369_1_); + this.worldInfo = p_i45369_1_.loadWorldInfo(); + + if (p_i45369_4_ != null) { + this.provider = p_i45369_4_; + } else if (this.worldInfo != null && this.worldInfo.getVanillaDimension() != 0) { + this.provider = WorldProvider.getProviderForDimension(this.worldInfo.getVanillaDimension()); + } else { + this.provider = WorldProvider.getProviderForDimension(0); + } + + if (this.worldInfo == null) { + this.worldInfo = new WorldInfo(p_i45369_3_, p_i45369_2_); + } else { + this.worldInfo.setWorldName(p_i45369_2_); + } + + this.provider.registerWorld(this); + this.chunkProvider = this.createChunkProvider(); + + if (!this.worldInfo.isInitialized()) { + try { + this.initialize(p_i45369_3_); + } catch (Throwable var10) { + CrashReport var7 = CrashReport.makeCrashReport(var10, "Exception initializing level"); + + try { + this.addWorldInfoToCrashReport(var7); + } catch (Throwable var9) { + } + + throw new ReportedException(var7); + } + + this.worldInfo.setServerInitialized(true); + } + + VillageCollection var6 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); + + if (var6 == null) { + this.villageCollectionObj = new VillageCollection(this); + this.mapStorage.setData("villages", this.villageCollectionObj); + } else { + this.villageCollectionObj = var6; + this.villageCollectionObj.func_82566_a(this); + } + + this.calculateInitialSkylight(); + this.calculateInitialWeather(); + } + + /** + * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? + */ + protected abstract IChunkProvider createChunkProvider(); + + protected void initialize(WorldSettings p_72963_1_) { + this.worldInfo.setServerInitialized(true); + } + + /** + * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk. + */ + public void setSpawnLocation() { + this.setSpawnLocation(8, 64, 8); + } + + public Block getTopBlock(int p_147474_1_, int p_147474_2_) { + int var3; + + for (var3 = 63; !this.isAirBlock(p_147474_1_, var3 + 1, p_147474_2_); ++var3) { + } + + return this.getBlock(p_147474_1_, var3, p_147474_2_); + } + + public Block getBlock(int p_147439_1_, int p_147439_2_, int p_147439_3_) { + if (p_147439_1_ >= -30000000 && p_147439_3_ >= -30000000 && p_147439_1_ < 30000000 && p_147439_3_ < 30000000 && p_147439_2_ >= 0 && p_147439_2_ < 256) { + Chunk var4 = null; + + try { + var4 = this.getChunkFromChunkCoords(p_147439_1_ >> 4, p_147439_3_ >> 4); + return var4.func_150810_a(p_147439_1_ & 15, p_147439_2_, p_147439_3_ & 15); + } catch (Throwable var8) { + CrashReport var6 = CrashReport.makeCrashReport(var8, "Exception getting block type in world"); + CrashReportCategory var7 = var6.makeCategory("Requested block coordinates"); + var7.addCrashSection("Found chunk", Boolean.valueOf(var4 == null)); + var7.addCrashSection("Location", CrashReportCategory.getLocationInfo(p_147439_1_, p_147439_2_, p_147439_3_)); + throw new ReportedException(var6); + } + } else { + return Blocks.air; + } + } + + /** + * Returns true if the block at the specified coordinates is empty + */ + public boolean isAirBlock(int p_147437_1_, int p_147437_2_, int p_147437_3_) { + return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).getMaterial() == Material.air; + } + + /** + * Returns whether a block exists at world coordinates x, y, z + */ + public boolean blockExists(int p_72899_1_, int p_72899_2_, int p_72899_3_) { + return p_72899_2_ >= 0 && p_72899_2_ < 256 && this.chunkExists(p_72899_1_ >> 4, p_72899_3_ >> 4); + } + + /** + * Checks if any of the chunks within distance (argument 4) blocks of the given block exist + */ + public boolean doChunksNearChunkExist(int p_72873_1_, int p_72873_2_, int p_72873_3_, int p_72873_4_) { + return this.checkChunksExist(p_72873_1_ - p_72873_4_, p_72873_2_ - p_72873_4_, p_72873_3_ - p_72873_4_, p_72873_1_ + p_72873_4_, p_72873_2_ + p_72873_4_, p_72873_3_ + p_72873_4_); + } + + /** + * Checks between a min and max all the chunks inbetween actually exist. Args: minX, minY, minZ, maxX, maxY, maxZ + */ + public boolean checkChunksExist(int p_72904_1_, int p_72904_2_, int p_72904_3_, int p_72904_4_, int p_72904_5_, int p_72904_6_) { + if (p_72904_5_ >= 0 && p_72904_2_ < 256) { + p_72904_1_ >>= 4; + p_72904_3_ >>= 4; + p_72904_4_ >>= 4; + p_72904_6_ >>= 4; + + for (int var7 = p_72904_1_; var7 <= p_72904_4_; ++var7) { + for (int var8 = p_72904_3_; var8 <= p_72904_6_; ++var8) { + if (!this.chunkExists(var7, var8)) { + return false; + } + } + } + + return true; + } else { + return false; + } + } + + /** + * Returns whether a chunk exists at chunk coordinates x, y + */ + protected boolean chunkExists(int p_72916_1_, int p_72916_2_) { + return this.chunkProvider.chunkExists(p_72916_1_, p_72916_2_); + } + + /** + * Returns a chunk looked up by block coordinates. Args: x, z + */ + public Chunk getChunkFromBlockCoords(int p_72938_1_, int p_72938_2_) { + return this.getChunkFromChunkCoords(p_72938_1_ >> 4, p_72938_2_ >> 4); + } + + /** + * Returns back a chunk looked up by chunk coordinates Args: x, y + */ + public Chunk getChunkFromChunkCoords(int p_72964_1_, int p_72964_2_) { + return this.chunkProvider.provideChunk(p_72964_1_, p_72964_2_); + } + + /** + * Sets the block ID and metadata at a given location. Args: X, Y, Z, new block ID, new metadata, flags. Flag 1 will + * cause a block update. Flag 2 will send the change to clients (you almost always want this). Flag 4 prevents the + * block from being re-rendered, if this is a com.cheatbreaker.client world. Flags can be added together. + */ + public boolean setBlock(int p_147465_1_, int p_147465_2_, int p_147465_3_, Block p_147465_4_, int p_147465_5_, int p_147465_6_) { + if (p_147465_1_ >= -30000000 && p_147465_3_ >= -30000000 && p_147465_1_ < 30000000 && p_147465_3_ < 30000000) { + if (p_147465_2_ < 0) { + return false; + } else if (p_147465_2_ >= 256) { + return false; + } else { + Chunk var7 = this.getChunkFromChunkCoords(p_147465_1_ >> 4, p_147465_3_ >> 4); + Block var8 = null; + + if ((p_147465_6_ & 1) != 0) { + var8 = var7.func_150810_a(p_147465_1_ & 15, p_147465_2_, p_147465_3_ & 15); + } + + boolean var9 = var7.func_150807_a(p_147465_1_ & 15, p_147465_2_, p_147465_3_ & 15, p_147465_4_, p_147465_5_); + this.theProfiler.startSection("checkLight"); + this.func_147451_t(p_147465_1_, p_147465_2_, p_147465_3_); + this.theProfiler.endSection(); + + if (var9) { + if ((p_147465_6_ & 2) != 0 && (!this.isClient || (p_147465_6_ & 4) == 0) && var7.func_150802_k()) { + this.func_147471_g(p_147465_1_, p_147465_2_, p_147465_3_); + } + + if (!this.isClient && (p_147465_6_ & 1) != 0) { + this.notifyBlockChange(p_147465_1_, p_147465_2_, p_147465_3_, var8); + + if (p_147465_4_.hasComparatorInputOverride()) { + this.func_147453_f(p_147465_1_, p_147465_2_, p_147465_3_, p_147465_4_); + } + } + } + + return var9; + } + } else { + return false; + } + } + + /** + * Returns the block metadata at coords x,y,z + */ + public int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_) { + if (p_72805_1_ >= -30000000 && p_72805_3_ >= -30000000 && p_72805_1_ < 30000000 && p_72805_3_ < 30000000) { + if (p_72805_2_ < 0) { + return 0; + } else if (p_72805_2_ >= 256) { + return 0; + } else { + Chunk var4 = this.getChunkFromChunkCoords(p_72805_1_ >> 4, p_72805_3_ >> 4); + p_72805_1_ &= 15; + p_72805_3_ &= 15; + return var4.getBlockMetadata(p_72805_1_, p_72805_2_, p_72805_3_); + } + } else { + return 0; + } + } + + /** + * Sets the blocks metadata and if set will then notify blocks that this block changed, depending on the flag. Args: + * x, y, z, metadata, flag. See setBlock for flag description + */ + public boolean setBlockMetadataWithNotify(int p_72921_1_, int p_72921_2_, int p_72921_3_, int p_72921_4_, int p_72921_5_) { + if (p_72921_1_ >= -30000000 && p_72921_3_ >= -30000000 && p_72921_1_ < 30000000 && p_72921_3_ < 30000000) { + if (p_72921_2_ < 0) { + return false; + } else if (p_72921_2_ >= 256) { + return false; + } else { + Chunk var6 = this.getChunkFromChunkCoords(p_72921_1_ >> 4, p_72921_3_ >> 4); + int var7 = p_72921_1_ & 15; + int var8 = p_72921_3_ & 15; + boolean var9 = var6.setBlockMetadata(var7, p_72921_2_, var8, p_72921_4_); + + if (var9) { + Block var10 = var6.func_150810_a(var7, p_72921_2_, var8); + + if ((p_72921_5_ & 2) != 0 && (!this.isClient || (p_72921_5_ & 4) == 0) && var6.func_150802_k()) { + this.func_147471_g(p_72921_1_, p_72921_2_, p_72921_3_); + } + + if (!this.isClient && (p_72921_5_ & 1) != 0) { + this.notifyBlockChange(p_72921_1_, p_72921_2_, p_72921_3_, var10); + + if (var10.hasComparatorInputOverride()) { + this.func_147453_f(p_72921_1_, p_72921_2_, p_72921_3_, var10); + } + } + } + + return var9; + } + } else { + return false; + } + } + + public boolean setBlockToAir(int p_147468_1_, int p_147468_2_, int p_147468_3_) { + return this.setBlock(p_147468_1_, p_147468_2_, p_147468_3_, Blocks.air, 0, 3); + } + + public boolean func_147480_a(int p_147480_1_, int p_147480_2_, int p_147480_3_, boolean p_147480_4_) { + Block var5 = this.getBlock(p_147480_1_, p_147480_2_, p_147480_3_); + + if (var5.getMaterial() == Material.air) { + return false; + } else { + int var6 = this.getBlockMetadata(p_147480_1_, p_147480_2_, p_147480_3_); + this.playAuxSFX(2001, p_147480_1_, p_147480_2_, p_147480_3_, Block.getIdFromBlock(var5) + (var6 << 12)); + + if (p_147480_4_) { + var5.dropBlockAsItem(this, p_147480_1_, p_147480_2_, p_147480_3_, var6, 0); + } + + return this.setBlock(p_147480_1_, p_147480_2_, p_147480_3_, Blocks.air, 0, 3); + } + } + + /** + * Sets a block by a coordinate + */ + public boolean setBlock(int p_147449_1_, int p_147449_2_, int p_147449_3_, Block p_147449_4_) { + return this.setBlock(p_147449_1_, p_147449_2_, p_147449_3_, p_147449_4_, 0, 3); + } + + public void func_147471_g(int p_147471_1_, int p_147471_2_, int p_147471_3_) { + for (int var4 = 0; var4 < this.worldAccesses.size(); ++var4) { + ((IWorldAccess)this.worldAccesses.get(var4)).markBlockForUpdate(p_147471_1_, p_147471_2_, p_147471_3_); + } + } + + /** + * The block type change and need to notify other systems Args: x, y, z, blockID + */ + public void notifyBlockChange(int p_147444_1_, int p_147444_2_, int p_147444_3_, Block p_147444_4_) { + this.notifyBlocksOfNeighborChange(p_147444_1_, p_147444_2_, p_147444_3_, p_147444_4_); + } + + /** + * marks a vertical line of blocks as dirty + */ + public void markBlocksDirtyVertical(int p_72975_1_, int p_72975_2_, int p_72975_3_, int p_72975_4_) { + int var5; + + if (p_72975_3_ > p_72975_4_) { + var5 = p_72975_4_; + p_72975_4_ = p_72975_3_; + p_72975_3_ = var5; + } + + if (!this.provider.hasNoSky) { + for (var5 = p_72975_3_; var5 <= p_72975_4_; ++var5) { + this.updateLightByType(EnumSkyBlock.Sky, p_72975_1_, var5, p_72975_2_); + } + } + + this.markBlockRangeForRenderUpdate(p_72975_1_, p_72975_3_, p_72975_2_, p_72975_1_, p_72975_4_, p_72975_2_); + } + + public void markBlockRangeForRenderUpdate(int p_147458_1_, int p_147458_2_, int p_147458_3_, int p_147458_4_, int p_147458_5_, int p_147458_6_) { + for (int var7 = 0; var7 < this.worldAccesses.size(); ++var7) { + ((IWorldAccess)this.worldAccesses.get(var7)).markBlockRangeForRenderUpdate(p_147458_1_, p_147458_2_, p_147458_3_, p_147458_4_, p_147458_5_, p_147458_6_); + } + } + + public void notifyBlocksOfNeighborChange(int p_147459_1_, int p_147459_2_, int p_147459_3_, Block p_147459_4_) { + this.func_147460_e(p_147459_1_ - 1, p_147459_2_, p_147459_3_, p_147459_4_); + this.func_147460_e(p_147459_1_ + 1, p_147459_2_, p_147459_3_, p_147459_4_); + this.func_147460_e(p_147459_1_, p_147459_2_ - 1, p_147459_3_, p_147459_4_); + this.func_147460_e(p_147459_1_, p_147459_2_ + 1, p_147459_3_, p_147459_4_); + this.func_147460_e(p_147459_1_, p_147459_2_, p_147459_3_ - 1, p_147459_4_); + this.func_147460_e(p_147459_1_, p_147459_2_, p_147459_3_ + 1, p_147459_4_); + } + + public void func_147441_b(int p_147441_1_, int p_147441_2_, int p_147441_3_, Block p_147441_4_, int p_147441_5_) { + if (p_147441_5_ != 4) { + this.func_147460_e(p_147441_1_ - 1, p_147441_2_, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 5) { + this.func_147460_e(p_147441_1_ + 1, p_147441_2_, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 0) { + this.func_147460_e(p_147441_1_, p_147441_2_ - 1, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 1) { + this.func_147460_e(p_147441_1_, p_147441_2_ + 1, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 2) { + this.func_147460_e(p_147441_1_, p_147441_2_, p_147441_3_ - 1, p_147441_4_); + } + + if (p_147441_5_ != 3) { + this.func_147460_e(p_147441_1_, p_147441_2_, p_147441_3_ + 1, p_147441_4_); + } + } + + public void func_147460_e(int p_147460_1_, int p_147460_2_, int p_147460_3_, final Block p_147460_4_) { + if (!this.isClient) { + Block var5 = this.getBlock(p_147460_1_, p_147460_2_, p_147460_3_); + + try { + var5.onNeighborBlockChange(this, p_147460_1_, p_147460_2_, p_147460_3_, p_147460_4_); + } catch (Throwable var12) { + CrashReport var7 = CrashReport.makeCrashReport(var12, "Exception while updating neighbours"); + CrashReportCategory var8 = var7.makeCategory("Block being updated"); + int var9; + + try { + var9 = this.getBlockMetadata(p_147460_1_, p_147460_2_, p_147460_3_); + } catch (Throwable var11) { + var9 = -1; + } + + var8.addCrashSectionCallable("Source block type", new Callable() { + + public String call() { + try { + return String.format("ID #%d (%s // %s)", Integer.valueOf(Block.getIdFromBlock(p_147460_4_)), p_147460_4_.getUnlocalizedName(), p_147460_4_.getClass().getCanonicalName()); + } catch (Throwable var2) { + return "ID #" + Block.getIdFromBlock(p_147460_4_); + } + } + }); + CrashReportCategory.func_147153_a(var8, p_147460_1_, p_147460_2_, p_147460_3_, var5, var9); + throw new ReportedException(var7); + } + } + } + + public boolean func_147477_a(int p_147477_1_, int p_147477_2_, int p_147477_3_, Block p_147477_4_) { + return false; + } + + /** + * Checks if the specified block is able to see the sky + */ + public boolean canBlockSeeTheSky(int p_72937_1_, int p_72937_2_, int p_72937_3_) { + return this.getChunkFromChunkCoords(p_72937_1_ >> 4, p_72937_3_ >> 4).canBlockSeeTheSky(p_72937_1_ & 15, p_72937_2_, p_72937_3_ & 15); + } + + /** + * Does the same as getBlockLightValue_do but without checking if its not a normal block + */ + public int getFullBlockLightValue(int p_72883_1_, int p_72883_2_, int p_72883_3_) { + if (p_72883_2_ < 0) { + return 0; + } else { + if (p_72883_2_ >= 256) { + p_72883_2_ = 255; + } + + return this.getChunkFromChunkCoords(p_72883_1_ >> 4, p_72883_3_ >> 4).getBlockLightValue(p_72883_1_ & 15, p_72883_2_, p_72883_3_ & 15, 0); + } + } + + /** + * Gets the light value of a block location + */ + public int getBlockLightValue(int p_72957_1_, int p_72957_2_, int p_72957_3_) { + return this.getBlockLightValue_do(p_72957_1_, p_72957_2_, p_72957_3_, true); + } + + /** + * Gets the light value of a block location. This is the actual function that gets the value and has a bool flag + * that indicates if its a half step block to get the maximum light value of a direct neighboring block (left, + * right, forward, back, and up) + */ + public int getBlockLightValue_do(int p_72849_1_, int p_72849_2_, int p_72849_3_, boolean p_72849_4_) { + if (p_72849_1_ >= -30000000 && p_72849_3_ >= -30000000 && p_72849_1_ < 30000000 && p_72849_3_ < 30000000) { + if (p_72849_4_ && this.getBlock(p_72849_1_, p_72849_2_, p_72849_3_).func_149710_n()) { + int var10 = this.getBlockLightValue_do(p_72849_1_, p_72849_2_ + 1, p_72849_3_, false); + int var6 = this.getBlockLightValue_do(p_72849_1_ + 1, p_72849_2_, p_72849_3_, false); + int var7 = this.getBlockLightValue_do(p_72849_1_ - 1, p_72849_2_, p_72849_3_, false); + int var8 = this.getBlockLightValue_do(p_72849_1_, p_72849_2_, p_72849_3_ + 1, false); + int var9 = this.getBlockLightValue_do(p_72849_1_, p_72849_2_, p_72849_3_ - 1, false); + + if (var6 > var10) { + var10 = var6; + } + + if (var7 > var10) { + var10 = var7; + } + + if (var8 > var10) { + var10 = var8; + } + + if (var9 > var10) { + var10 = var9; + } + + return var10; + } else if (p_72849_2_ < 0) { + return 0; + } else { + if (p_72849_2_ >= 256) { + p_72849_2_ = 255; + } + + Chunk var5 = this.getChunkFromChunkCoords(p_72849_1_ >> 4, p_72849_3_ >> 4); + p_72849_1_ &= 15; + p_72849_3_ &= 15; + return var5.getBlockLightValue(p_72849_1_, p_72849_2_, p_72849_3_, this.skylightSubtracted); + } + } else { + return 15; + } + } + + /** + * Returns the y coordinate with a block in it at this x, z coordinate + */ + public int getHeightValue(int p_72976_1_, int p_72976_2_) { + if (p_72976_1_ >= -30000000 && p_72976_2_ >= -30000000 && p_72976_1_ < 30000000 && p_72976_2_ < 30000000) { + if (!this.chunkExists(p_72976_1_ >> 4, p_72976_2_ >> 4)) { + return 0; + } else { + Chunk var3 = this.getChunkFromChunkCoords(p_72976_1_ >> 4, p_72976_2_ >> 4); + return var3.getHeightValue(p_72976_1_ & 15, p_72976_2_ & 15); + } + } else { + return 64; + } + } + + /** + * Gets the heightMapMinimum field of the given chunk, or 0 if the chunk is not loaded. Coords are in blocks. Args: + * X, Z + */ + public int getChunkHeightMapMinimum(int p_82734_1_, int p_82734_2_) { + if (p_82734_1_ >= -30000000 && p_82734_2_ >= -30000000 && p_82734_1_ < 30000000 && p_82734_2_ < 30000000) { + if (!this.chunkExists(p_82734_1_ >> 4, p_82734_2_ >> 4)) { + return 0; + } else { + Chunk var3 = this.getChunkFromChunkCoords(p_82734_1_ >> 4, p_82734_2_ >> 4); + return var3.heightMapMinimum; + } + } else { + return 64; + } + } + + /** + * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. + * Brightness for SkyBlock.Block is yellowish and independent. + */ + public int getSkyBlockTypeBrightness(EnumSkyBlock p_72925_1_, int p_72925_2_, int p_72925_3_, int p_72925_4_) { + if (this.provider.hasNoSky && p_72925_1_ == EnumSkyBlock.Sky) { + return 0; + } else { + if (p_72925_3_ < 0) { + p_72925_3_ = 0; + } + + if (p_72925_3_ >= 256) { + return p_72925_1_.defaultLightValue; + } else if (p_72925_2_ >= -30000000 && p_72925_4_ >= -30000000 && p_72925_2_ < 30000000 && p_72925_4_ < 30000000) { + int var5 = p_72925_2_ >> 4; + int var6 = p_72925_4_ >> 4; + + if (!this.chunkExists(var5, var6)) { + return p_72925_1_.defaultLightValue; + } else if (this.getBlock(p_72925_2_, p_72925_3_, p_72925_4_).func_149710_n()) { + int var12 = this.getSavedLightValue(p_72925_1_, p_72925_2_, p_72925_3_ + 1, p_72925_4_); + int var8 = this.getSavedLightValue(p_72925_1_, p_72925_2_ + 1, p_72925_3_, p_72925_4_); + int var9 = this.getSavedLightValue(p_72925_1_, p_72925_2_ - 1, p_72925_3_, p_72925_4_); + int var10 = this.getSavedLightValue(p_72925_1_, p_72925_2_, p_72925_3_, p_72925_4_ + 1); + int var11 = this.getSavedLightValue(p_72925_1_, p_72925_2_, p_72925_3_, p_72925_4_ - 1); + + if (var8 > var12) { + var12 = var8; + } + + if (var9 > var12) { + var12 = var9; + } + + if (var10 > var12) { + var12 = var10; + } + + if (var11 > var12) { + var12 = var11; + } + + return var12; + } else { + Chunk var7 = this.getChunkFromChunkCoords(var5, var6); + return var7.getSavedLightValue(p_72925_1_, p_72925_2_ & 15, p_72925_3_, p_72925_4_ & 15); + } + } else { + return p_72925_1_.defaultLightValue; + } + } + } + + /** + * Returns saved light value without taking into account the time of day. Either looks in the sky light map or + * block light map based on the enumSkyBlock arg. + */ + public int getSavedLightValue(EnumSkyBlock p_72972_1_, int p_72972_2_, int p_72972_3_, int p_72972_4_) { + if (p_72972_3_ < 0) { + p_72972_3_ = 0; + } + + if (p_72972_3_ >= 256) { + p_72972_3_ = 255; + } + + if (p_72972_2_ >= -30000000 && p_72972_4_ >= -30000000 && p_72972_2_ < 30000000 && p_72972_4_ < 30000000) { + int var5 = p_72972_2_ >> 4; + int var6 = p_72972_4_ >> 4; + + if (!this.chunkExists(var5, var6)) { + return p_72972_1_.defaultLightValue; + } else { + Chunk var7 = this.getChunkFromChunkCoords(var5, var6); + return var7.getSavedLightValue(p_72972_1_, p_72972_2_ & 15, p_72972_3_, p_72972_4_ & 15); + } + } else { + return p_72972_1_.defaultLightValue; + } + } + + /** + * Sets the light value either into the sky map or block map depending on if enumSkyBlock is set to sky or block. + * Args: enumSkyBlock, x, y, z, lightValue + */ + public void setLightValue(EnumSkyBlock p_72915_1_, int p_72915_2_, int p_72915_3_, int p_72915_4_, int p_72915_5_) { + if (p_72915_2_ >= -30000000 && p_72915_4_ >= -30000000 && p_72915_2_ < 30000000 && p_72915_4_ < 30000000) { + if (p_72915_3_ >= 0) { + if (p_72915_3_ < 256) { + if (this.chunkExists(p_72915_2_ >> 4, p_72915_4_ >> 4)) { + Chunk var6 = this.getChunkFromChunkCoords(p_72915_2_ >> 4, p_72915_4_ >> 4); + var6.setLightValue(p_72915_1_, p_72915_2_ & 15, p_72915_3_, p_72915_4_ & 15, p_72915_5_); + + for (int var7 = 0; var7 < this.worldAccesses.size(); ++var7) { + ((IWorldAccess)this.worldAccesses.get(var7)).markBlockForRenderUpdate(p_72915_2_, p_72915_3_, p_72915_4_); + } + } + } + } + } + } + + public void func_147479_m(int p_147479_1_, int p_147479_2_, int p_147479_3_) { + for (int var4 = 0; var4 < this.worldAccesses.size(); ++var4) { + ((IWorldAccess)this.worldAccesses.get(var4)).markBlockForRenderUpdate(p_147479_1_, p_147479_2_, p_147479_3_); + } + } + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + public int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_) { + int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, p_72802_1_, p_72802_2_, p_72802_3_); + int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, p_72802_1_, p_72802_2_, p_72802_3_); + + if (var6 < p_72802_4_) { + var6 = p_72802_4_; + } + + return var5 << 20 | var6 << 4; + } + + /** + * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light + * values aren't linear for brightness). Args: x, y, z + */ + public float getLightBrightness(int p_72801_1_, int p_72801_2_, int p_72801_3_) { + return this.provider.lightBrightnessTable[this.getBlockLightValue(p_72801_1_, p_72801_2_, p_72801_3_)]; + } + + /** + * Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4 + */ + public boolean isDaytime() { + return this.skylightSubtracted < 4; + } + + /** + * Performs a raycast against all blocks in the world except liquids. + */ + public MovingObjectPosition rayTraceBlocks(Vec3 p_72933_1_, Vec3 p_72933_2_) { + return this.func_147447_a(p_72933_1_, p_72933_2_, false, false, false); + } + + /** + * Performs a raycast against all blocks in the world, and optionally liquids. + */ + public MovingObjectPosition rayTraceBlocks(Vec3 p_72901_1_, Vec3 p_72901_2_, boolean p_72901_3_) { + return this.func_147447_a(p_72901_1_, p_72901_2_, p_72901_3_, false, false); + } + + public MovingObjectPosition func_147447_a(Vec3 p_147447_1_, Vec3 p_147447_2_, boolean p_147447_3_, boolean p_147447_4_, boolean p_147447_5_) { + if (!Double.isNaN(p_147447_1_.xCoord) && !Double.isNaN(p_147447_1_.yCoord) && !Double.isNaN(p_147447_1_.zCoord)) { + if (!Double.isNaN(p_147447_2_.xCoord) && !Double.isNaN(p_147447_2_.yCoord) && !Double.isNaN(p_147447_2_.zCoord)) { + int var6 = MathHelper.floor_double(p_147447_2_.xCoord); + int var7 = MathHelper.floor_double(p_147447_2_.yCoord); + int var8 = MathHelper.floor_double(p_147447_2_.zCoord); + int var9 = MathHelper.floor_double(p_147447_1_.xCoord); + int var10 = MathHelper.floor_double(p_147447_1_.yCoord); + int var11 = MathHelper.floor_double(p_147447_1_.zCoord); + Block var12 = this.getBlock(var9, var10, var11); + int var13 = this.getBlockMetadata(var9, var10, var11); + + if ((!p_147447_4_ || var12.getCollisionBoundingBoxFromPool(this, var9, var10, var11) != null) && var12.canCollideCheck(var13, p_147447_3_)) { + MovingObjectPosition var14 = var12.collisionRayTrace(this, var9, var10, var11, p_147447_1_, p_147447_2_); + + if (var14 != null) { + return var14; + } + } + + MovingObjectPosition var40 = null; + var13 = 200; + + while (var13-- >= 0) { + if (Double.isNaN(p_147447_1_.xCoord) || Double.isNaN(p_147447_1_.yCoord) || Double.isNaN(p_147447_1_.zCoord)) { + return null; + } + + if (var9 == var6 && var10 == var7 && var11 == var8) { + return p_147447_5_ ? var40 : null; + } + + boolean var41 = true; + boolean var15 = true; + boolean var16 = true; + double var17 = 999.0D; + double var19 = 999.0D; + double var21 = 999.0D; + + if (var6 > var9) { + var17 = (double)var9 + 1.0D; + } else if (var6 < var9) { + var17 = (double)var9 + 0.0D; + } else { + var41 = false; + } + + if (var7 > var10) { + var19 = (double)var10 + 1.0D; + } else if (var7 < var10) { + var19 = (double)var10 + 0.0D; + } else { + var15 = false; + } + + if (var8 > var11) { + var21 = (double)var11 + 1.0D; + } else if (var8 < var11) { + var21 = (double)var11 + 0.0D; + } else { + var16 = false; + } + + double var23 = 999.0D; + double var25 = 999.0D; + double var27 = 999.0D; + double var29 = p_147447_2_.xCoord - p_147447_1_.xCoord; + double var31 = p_147447_2_.yCoord - p_147447_1_.yCoord; + double var33 = p_147447_2_.zCoord - p_147447_1_.zCoord; + + if (var41) { + var23 = (var17 - p_147447_1_.xCoord) / var29; + } + + if (var15) { + var25 = (var19 - p_147447_1_.yCoord) / var31; + } + + if (var16) { + var27 = (var21 - p_147447_1_.zCoord) / var33; + } + + boolean var35 = false; + byte var42; + + if (var23 < var25 && var23 < var27) { + if (var6 > var9) { + var42 = 4; + } else { + var42 = 5; + } + + p_147447_1_.xCoord = var17; + p_147447_1_.yCoord += var31 * var23; + p_147447_1_.zCoord += var33 * var23; + } else if (var25 < var27) { + if (var7 > var10) { + var42 = 0; + } else { + var42 = 1; + } + + p_147447_1_.xCoord += var29 * var25; + p_147447_1_.yCoord = var19; + p_147447_1_.zCoord += var33 * var25; + } else { + if (var8 > var11) { + var42 = 2; + } else { + var42 = 3; + } + + p_147447_1_.xCoord += var29 * var27; + p_147447_1_.yCoord += var31 * var27; + p_147447_1_.zCoord = var21; + } + + Vec3 var36 = Vec3.createVectorHelper(p_147447_1_.xCoord, p_147447_1_.yCoord, p_147447_1_.zCoord); + var9 = (int)(var36.xCoord = MathHelper.floor_double(p_147447_1_.xCoord)); + + if (var42 == 5) { + --var9; + ++var36.xCoord; + } + + var10 = (int)(var36.yCoord = MathHelper.floor_double(p_147447_1_.yCoord)); + + if (var42 == 1) { + --var10; + ++var36.yCoord; + } + + var11 = (int)(var36.zCoord = MathHelper.floor_double(p_147447_1_.zCoord)); + + if (var42 == 3) { + --var11; + ++var36.zCoord; + } + + Block var37 = this.getBlock(var9, var10, var11); + int var38 = this.getBlockMetadata(var9, var10, var11); + + if (!p_147447_4_ || var37.getCollisionBoundingBoxFromPool(this, var9, var10, var11) != null) { + if (var37.canCollideCheck(var38, p_147447_3_)) { + MovingObjectPosition var39 = var37.collisionRayTrace(this, var9, var10, var11, p_147447_1_, p_147447_2_); + + if (var39 != null) { + return var39; + } + } else { + var40 = new MovingObjectPosition(var9, var10, var11, var42, p_147447_1_, false); + } + } + } + + return p_147447_5_ ? var40 : null; + } else { + return null; + } + } else { + return null; + } + } + + /** + * Plays a sound at the entity's position. Args: entity, sound, volume (relative to 1.0), and frequency (or pitch, + * also relative to 1.0). + */ + public void playSoundAtEntity(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_) { + for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) { + ((IWorldAccess)this.worldAccesses.get(var5)).playSound(p_72956_2_, p_72956_1_.posX, p_72956_1_.posY - (double)p_72956_1_.yOffset, p_72956_1_.posZ, p_72956_3_, p_72956_4_); + } + } + + /** + * Plays sound to all near players except the player reference given + */ + public void playSoundToNearExcept(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_) { + for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) { + ((IWorldAccess)this.worldAccesses.get(var5)).playSoundToNearExcept(p_85173_1_, p_85173_2_, p_85173_1_.posX, p_85173_1_.posY - (double)p_85173_1_.yOffset, p_85173_1_.posZ, p_85173_3_, p_85173_4_); + } + } + + /** + * Play a sound effect. Many many parameters for this function. Not sure what they do, but a classic call is : + * (double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, 'random.door_open', 1.0F, world.rand.nextFloat() * 0.1F + + * 0.9F with i,j,k position of the block. + */ + public void playSoundEffect(double p_72908_1_, double p_72908_3_, double p_72908_5_, String p_72908_7_, float p_72908_8_, float p_72908_9_) { + for (int var10 = 0; var10 < this.worldAccesses.size(); ++var10) { + ((IWorldAccess)this.worldAccesses.get(var10)).playSound(p_72908_7_, p_72908_1_, p_72908_3_, p_72908_5_, p_72908_8_, p_72908_9_); + } + } + + /** + * par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound + */ + public void playSound(double p_72980_1_, double p_72980_3_, double p_72980_5_, String p_72980_7_, float p_72980_8_, float p_72980_9_, boolean p_72980_10_) {} + + /** + * Plays a record at the specified coordinates of the specified name. Args: recordName, x, y, z + */ + public void playRecord(String p_72934_1_, int p_72934_2_, int p_72934_3_, int p_72934_4_) { + for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) { + ((IWorldAccess)this.worldAccesses.get(var5)).playRecord(p_72934_1_, p_72934_2_, p_72934_3_, p_72934_4_); + } + } + + /** + * Spawns a particle. Args particleName, x, y, z, velX, velY, velZ + */ + public void spawnParticle(String p_72869_1_, double p_72869_2_, double p_72869_4_, double p_72869_6_, double p_72869_8_, double p_72869_10_, double p_72869_12_) { + for (int var14 = 0; var14 < this.worldAccesses.size(); ++var14) { + ((IWorldAccess)this.worldAccesses.get(var14)).spawnParticle(p_72869_1_, p_72869_2_, p_72869_4_, p_72869_6_, p_72869_8_, p_72869_10_, p_72869_12_); + } + } + + /** + * adds a lightning bolt to the list of lightning bolts in this world. + */ + public boolean addWeatherEffect(Entity p_72942_1_) { + this.weatherEffects.add(p_72942_1_); + return true; + } + + /** + * Called to place all entities as part of a world + */ + public boolean spawnEntityInWorld(Entity p_72838_1_) { + int var2 = MathHelper.floor_double(p_72838_1_.posX / 16.0D); + int var3 = MathHelper.floor_double(p_72838_1_.posZ / 16.0D); + boolean var4 = p_72838_1_.forceSpawn; + + if (p_72838_1_ instanceof EntityPlayer) { + var4 = true; + } + + if (!var4 && !this.chunkExists(var2, var3)) { + return false; + } else { + if (p_72838_1_ instanceof EntityPlayer) { + EntityPlayer var5 = (EntityPlayer)p_72838_1_; + this.playerEntities.add(var5); + this.updateAllPlayersSleepingFlag(); + } + + this.getChunkFromChunkCoords(var2, var3).addEntity(p_72838_1_); + this.loadedEntityList.add(p_72838_1_); + this.onEntityAdded(p_72838_1_); + return true; + } + } + + protected void onEntityAdded(Entity p_72923_1_) { + for (int var2 = 0; var2 < this.worldAccesses.size(); ++var2) { + ((IWorldAccess)this.worldAccesses.get(var2)).onEntityCreate(p_72923_1_); + } + } + + protected void onEntityRemoved(Entity p_72847_1_) { + for (int var2 = 0; var2 < this.worldAccesses.size(); ++var2) { + ((IWorldAccess)this.worldAccesses.get(var2)).onEntityDestroy(p_72847_1_); + } + } + + /** + * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation. + */ + public void removeEntity(Entity p_72900_1_) { + if (p_72900_1_.riddenByEntity != null) { + p_72900_1_.riddenByEntity.mountEntity(null); + } + + if (p_72900_1_.ridingEntity != null) { + p_72900_1_.mountEntity(null); + } + + p_72900_1_.setDead(); + + if (p_72900_1_ instanceof EntityPlayer) { + this.playerEntities.remove(p_72900_1_); + this.updateAllPlayersSleepingFlag(); + this.onEntityRemoved(p_72900_1_); + } + } + + /** + * Do NOT use this method to remove normal entities- use normal removeEntity + */ + public void removePlayerEntityDangerously(Entity p_72973_1_) { + p_72973_1_.setDead(); + + if (p_72973_1_ instanceof EntityPlayer) { + this.playerEntities.remove(p_72973_1_); + this.updateAllPlayersSleepingFlag(); + } + + int var2 = p_72973_1_.chunkCoordX; + int var3 = p_72973_1_.chunkCoordZ; + + if (p_72973_1_.addedToChunk && this.chunkExists(var2, var3)) { + this.getChunkFromChunkCoords(var2, var3).removeEntity(p_72973_1_); + } + + this.loadedEntityList.remove(p_72973_1_); + this.onEntityRemoved(p_72973_1_); + } + + /** + * Adds a IWorldAccess to the list of worldAccesses + */ + public void addWorldAccess(IWorldAccess p_72954_1_) { + this.worldAccesses.add(p_72954_1_); + } + + /** + * Removes a worldAccess from the worldAccesses object + */ + public void removeWorldAccess(IWorldAccess p_72848_1_) { + this.worldAccesses.remove(p_72848_1_); + } + + /** + * Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision. Args: entity, + * aabb + */ + public List getCollidingBoundingBoxes(Entity p_72945_1_, AxisAlignedBB p_72945_2_) { + this.collidingBoundingBoxes.clear(); + int var3 = MathHelper.floor_double(p_72945_2_.minX); + int var4 = MathHelper.floor_double(p_72945_2_.maxX + 1.0D); + int var5 = MathHelper.floor_double(p_72945_2_.minY); + int var6 = MathHelper.floor_double(p_72945_2_.maxY + 1.0D); + int var7 = MathHelper.floor_double(p_72945_2_.minZ); + int var8 = MathHelper.floor_double(p_72945_2_.maxZ + 1.0D); + + for (int var9 = var3; var9 < var4; ++var9) { + for (int var10 = var7; var10 < var8; ++var10) { + if (this.blockExists(var9, 64, var10)) { + for (int var11 = var5 - 1; var11 < var6; ++var11) { + Block var12; + + if (var9 >= -30000000 && var9 < 30000000 && var10 >= -30000000 && var10 < 30000000) { + var12 = this.getBlock(var9, var11, var10); + } else { + var12 = Blocks.stone; + } + + var12.addCollisionBoxesToList(this, var9, var11, var10, p_72945_2_, this.collidingBoundingBoxes, p_72945_1_); + } + } + } + } + + double var14 = 0.25D; + List var15 = this.getEntitiesWithinAABBExcludingEntity(p_72945_1_, p_72945_2_.expand(var14, var14, var14)); + + for (int var16 = 0; var16 < var15.size(); ++var16) { + AxisAlignedBB var13 = ((Entity)var15.get(var16)).getBoundingBox(); + + if (var13 != null && var13.intersectsWith(p_72945_2_)) { + this.collidingBoundingBoxes.add(var13); + } + + var13 = p_72945_1_.getCollisionBox((Entity)var15.get(var16)); + + if (var13 != null && var13.intersectsWith(p_72945_2_)) { + this.collidingBoundingBoxes.add(var13); + } + } + + return this.collidingBoundingBoxes; + } + + public List func_147461_a(AxisAlignedBB p_147461_1_) { + this.collidingBoundingBoxes.clear(); + int var2 = MathHelper.floor_double(p_147461_1_.minX); + int var3 = MathHelper.floor_double(p_147461_1_.maxX + 1.0D); + int var4 = MathHelper.floor_double(p_147461_1_.minY); + int var5 = MathHelper.floor_double(p_147461_1_.maxY + 1.0D); + int var6 = MathHelper.floor_double(p_147461_1_.minZ); + int var7 = MathHelper.floor_double(p_147461_1_.maxZ + 1.0D); + + for (int var8 = var2; var8 < var3; ++var8) { + for (int var9 = var6; var9 < var7; ++var9) { + if (this.blockExists(var8, 64, var9)) { + for (int var10 = var4 - 1; var10 < var5; ++var10) { + Block var11; + + if (var8 >= -30000000 && var8 < 30000000 && var9 >= -30000000 && var9 < 30000000) { + var11 = this.getBlock(var8, var10, var9); + } else { + var11 = Blocks.bedrock; + } + + var11.addCollisionBoxesToList(this, var8, var10, var9, p_147461_1_, this.collidingBoundingBoxes, null); + } + } + } + } + + return this.collidingBoundingBoxes; + } + + /** + * Returns the amount of skylight subtracted for the current time + */ + public int calculateSkylightSubtracted(float p_72967_1_) { + float var2 = this.getCelestialAngle(p_72967_1_); + float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F); + + if (var3 < 0.0F) { + var3 = 0.0F; + } + + if (var3 > 1.0F) { + var3 = 1.0F; + } + + var3 = 1.0F - var3; + var3 = (float)((double)var3 * (1.0D - (double)(this.getRainStrength(p_72967_1_) * 5.0F) / 16.0D)); + var3 = (float)((double)var3 * (1.0D - (double)(this.getWeightedThunderStrength(p_72967_1_) * 5.0F) / 16.0D)); + var3 = 1.0F - var3; + return (int)(var3 * 11.0F); + } + + /** + * Returns the sun brightness - checks time of day, rain and thunder + */ + public float getSunBrightness(float p_72971_1_) { + float var2 = this.getCelestialAngle(p_72971_1_); + float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.2F); + + if (var3 < 0.0F) { + var3 = 0.0F; + } + + if (var3 > 1.0F) { + var3 = 1.0F; + } + + var3 = 1.0F - var3; + var3 = (float)((double)var3 * (1.0D - (double)(this.getRainStrength(p_72971_1_) * 5.0F) / 16.0D)); + var3 = (float)((double)var3 * (1.0D - (double)(this.getWeightedThunderStrength(p_72971_1_) * 5.0F) / 16.0D)); + return var3 * 0.8F + 0.2F; + } + + /** + * Calculates the color for the skybox + */ + public Vec3 getSkyColor(Entity p_72833_1_, float p_72833_2_) { + float var3 = this.getCelestialAngle(p_72833_2_); + float var4 = MathHelper.cos(var3 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (var4 < 0.0F) { + var4 = 0.0F; + } + + if (var4 > 1.0F) { + var4 = 1.0F; + } + + int var5 = MathHelper.floor_double(p_72833_1_.posX); + int var6 = MathHelper.floor_double(p_72833_1_.posY); + int var7 = MathHelper.floor_double(p_72833_1_.posZ); + BiomeGenBase var8 = this.getBiomeGenForCoords(var5, var7); + float var9 = var8.getFloatTemperature(var5, var6, var7); + int var10 = var8.getSkyColorByTemp(var9); + float var11 = (float)(var10 >> 16 & 255) / 255.0F; + float var12 = (float)(var10 >> 8 & 255) / 255.0F; + float var13 = (float)(var10 & 255) / 255.0F; + var11 *= var4; + var12 *= var4; + var13 *= var4; + float var14 = this.getRainStrength(p_72833_2_); + float var15; + float var16; + + if (var14 > 0.0F) { + var15 = (var11 * 0.3F + var12 * 0.59F + var13 * 0.11F) * 0.6F; + var16 = 1.0F - var14 * 0.75F; + var11 = var11 * var16 + var15 * (1.0F - var16); + var12 = var12 * var16 + var15 * (1.0F - var16); + var13 = var13 * var16 + var15 * (1.0F - var16); + } + + var15 = this.getWeightedThunderStrength(p_72833_2_); + + if (var15 > 0.0F) { + var16 = (var11 * 0.3F + var12 * 0.59F + var13 * 0.11F) * 0.2F; + float var17 = 1.0F - var15 * 0.75F; + var11 = var11 * var17 + var16 * (1.0F - var17); + var12 = var12 * var17 + var16 * (1.0F - var17); + var13 = var13 * var17 + var16 * (1.0F - var17); + } + + if (this.lastLightningBolt > 0) { + var16 = (float)this.lastLightningBolt - p_72833_2_; + + if (var16 > 1.0F) { + var16 = 1.0F; + } + + var16 *= 0.45F; + var11 = var11 * (1.0F - var16) + 0.8F * var16; + var12 = var12 * (1.0F - var16) + 0.8F * var16; + var13 = var13 * (1.0F - var16) + 1.0F * var16; + } + + return Vec3.createVectorHelper(var11, var12, var13); + } + + /** + * calls calculateCelestialAngle + */ + public float getCelestialAngle(float p_72826_1_) { + return this.provider.calculateCelestialAngle(this.worldInfo.getWorldTime(), p_72826_1_); + } + + public int getMoonPhase() { + return this.provider.getMoonPhase(this.worldInfo.getWorldTime()); + } + + /** + * gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25 + */ + public float getCurrentMoonPhaseFactor() { + return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; + } + + /** + * Return getCelestialAngle()*2*PI + */ + public float getCelestialAngleRadians(float p_72929_1_) { + float var2 = this.getCelestialAngle(p_72929_1_); + return var2 * (float)Math.PI * 2.0F; + } + + public Vec3 getCloudColour(float p_72824_1_) { + float var2 = this.getCelestialAngle(p_72824_1_); + float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (var3 < 0.0F) { + var3 = 0.0F; + } + + if (var3 > 1.0F) { + var3 = 1.0F; + } + + float var4 = (float)(this.cloudColour >> 16 & 255L) / 255.0F; + float var5 = (float)(this.cloudColour >> 8 & 255L) / 255.0F; + float var6 = (float)(this.cloudColour & 255L) / 255.0F; + float var7 = this.getRainStrength(p_72824_1_); + float var8; + float var9; + + if (var7 > 0.0F) { + var8 = (var4 * 0.3F + var5 * 0.59F + var6 * 0.11F) * 0.6F; + var9 = 1.0F - var7 * 0.95F; + var4 = var4 * var9 + var8 * (1.0F - var9); + var5 = var5 * var9 + var8 * (1.0F - var9); + var6 = var6 * var9 + var8 * (1.0F - var9); + } + + var4 *= var3 * 0.9F + 0.1F; + var5 *= var3 * 0.9F + 0.1F; + var6 *= var3 * 0.85F + 0.15F; + var8 = this.getWeightedThunderStrength(p_72824_1_); + + if (var8 > 0.0F) { + var9 = (var4 * 0.3F + var5 * 0.59F + var6 * 0.11F) * 0.2F; + float var10 = 1.0F - var8 * 0.95F; + var4 = var4 * var10 + var9 * (1.0F - var10); + var5 = var5 * var10 + var9 * (1.0F - var10); + var6 = var6 * var10 + var9 * (1.0F - var10); + } + + return Vec3.createVectorHelper(var4, var5, var6); + } + + /** + * Returns vector(ish) with R/G/B for fog + */ + public Vec3 getFogColor(float p_72948_1_) { + float var2 = this.getCelestialAngle(p_72948_1_); + return this.provider.getFogColor(var2, p_72948_1_); + } + + /** + * Gets the height to which rain/snow will fall. Calculates it if not already stored. + */ + public int getPrecipitationHeight(int p_72874_1_, int p_72874_2_) { + return this.getChunkFromBlockCoords(p_72874_1_, p_72874_2_).getPrecipitationHeight(p_72874_1_ & 15, p_72874_2_ & 15); + } + + /** + * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z + */ + public int getTopSolidOrLiquidBlock(int p_72825_1_, int p_72825_2_) { + Chunk var3 = this.getChunkFromBlockCoords(p_72825_1_, p_72825_2_); + int var4 = var3.getTopFilledSegment() + 15; + p_72825_1_ &= 15; + + for (p_72825_2_ &= 15; var4 > 0; --var4) { + Block var5 = var3.func_150810_a(p_72825_1_, var4, p_72825_2_); + + if (var5.getMaterial().blocksMovement() && var5.getMaterial() != Material.leaves) { + return var4 + 1; + } + } + + return -1; + } + + /** + * How bright are stars in the sky + */ + public float getStarBrightness(float p_72880_1_) { + float var2 = this.getCelestialAngle(p_72880_1_); + float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + + if (var3 < 0.0F) { + var3 = 0.0F; + } + + if (var3 > 1.0F) { + var3 = 1.0F; + } + + return var3 * var3 * 0.5F; + } + + /** + * Schedules a tick to a block with a delay (Most commonly the tick rate) + */ + public void scheduleBlockUpdate(int p_147464_1_, int p_147464_2_, int p_147464_3_, Block p_147464_4_, int p_147464_5_) {} + + public void func_147454_a(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) {} + + public void func_147446_b(int p_147446_1_, int p_147446_2_, int p_147446_3_, Block p_147446_4_, int p_147446_5_, int p_147446_6_) {} + + /** + * Updates (and cleans up) entities and tile entities + */ + public void updateEntities() { + this.theProfiler.startSection("entities"); + this.theProfiler.startSection("global"); + int var1; + Entity var2; + CrashReport var4; + CrashReportCategory var5; + + for (var1 = 0; var1 < this.weatherEffects.size(); ++var1) { + var2 = (Entity)this.weatherEffects.get(var1); + + try { + ++var2.ticksExisted; + var2.onUpdate(); + } catch (Throwable var8) { + var4 = CrashReport.makeCrashReport(var8, "Ticking entity"); + var5 = var4.makeCategory("Entity being ticked"); + + if (var2 == null) { + var5.addCrashSection("Entity", "~~NULL~~"); + } else { + var2.addEntityCrashInfo(var5); + } + + throw new ReportedException(var4); + } + + if (var2.isDead) { + this.weatherEffects.remove(var1--); + } + } + + this.theProfiler.endStartSection("remove"); + this.loadedEntityList.removeAll(this.unloadedEntityList); + int var3; + int var14; + + for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { + var2 = (Entity)this.unloadedEntityList.get(var1); + var3 = var2.chunkCoordX; + var14 = var2.chunkCoordZ; + + if (var2.addedToChunk && this.chunkExists(var3, var14)) { + this.getChunkFromChunkCoords(var3, var14).removeEntity(var2); + } + } + + for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { + this.onEntityRemoved((Entity)this.unloadedEntityList.get(var1)); + } + + this.unloadedEntityList.clear(); + this.theProfiler.endStartSection("regular"); + + for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1) { + var2 = (Entity)this.loadedEntityList.get(var1); + + if (var2.ridingEntity != null) { + if (!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) { + continue; + } + + var2.ridingEntity.riddenByEntity = null; + var2.ridingEntity = null; + } + + this.theProfiler.startSection("tick"); + + if (!var2.isDead) { + try { + this.updateEntity(var2); + } catch (Throwable var7) { + var4 = CrashReport.makeCrashReport(var7, "Ticking entity"); + var5 = var4.makeCategory("Entity being ticked"); + var2.addEntityCrashInfo(var5); + throw new ReportedException(var4); + } + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("remove"); + + if (var2.isDead) { + var3 = var2.chunkCoordX; + var14 = var2.chunkCoordZ; + + if (var2.addedToChunk && this.chunkExists(var3, var14)) { + this.getChunkFromChunkCoords(var3, var14).removeEntity(var2); + } + + this.loadedEntityList.remove(var1--); + this.onEntityRemoved(var2); + } + + this.theProfiler.endSection(); + } + + this.theProfiler.endStartSection("blockEntities"); + this.field_147481_N = true; + Iterator var9 = this.field_147482_g.iterator(); + + while (var9.hasNext()) { + TileEntity var10 = (TileEntity)var9.next(); + + if (!var10.isInvalid() && var10.hasWorldObj() && this.blockExists(var10.field_145851_c, var10.field_145848_d, var10.field_145849_e)) { + try { + var10.updateEntity(); + } catch (Throwable var6) { + var4 = CrashReport.makeCrashReport(var6, "Ticking block entity"); + var5 = var4.makeCategory("Block entity being ticked"); + var10.func_145828_a(var5); + throw new ReportedException(var4); + } + } + + if (var10.isInvalid()) { + var9.remove(); + + if (this.chunkExists(var10.field_145851_c >> 4, var10.field_145849_e >> 4)) { + Chunk var12 = this.getChunkFromChunkCoords(var10.field_145851_c >> 4, var10.field_145849_e >> 4); + + if (var12 != null) { + var12.removeTileEntity(var10.field_145851_c & 15, var10.field_145848_d, var10.field_145849_e & 15); + } + } + } + } + + this.field_147481_N = false; + + if (!this.field_147483_b.isEmpty()) { + this.field_147482_g.removeAll(this.field_147483_b); + this.field_147483_b.clear(); + } + + this.theProfiler.endStartSection("pendingBlockEntities"); + + if (!this.field_147484_a.isEmpty()) { + for (int var11 = 0; var11 < this.field_147484_a.size(); ++var11) { + TileEntity var13 = (TileEntity)this.field_147484_a.get(var11); + + if (!var13.isInvalid()) { + if (!this.field_147482_g.contains(var13)) { + this.field_147482_g.add(var13); + } + + if (this.chunkExists(var13.field_145851_c >> 4, var13.field_145849_e >> 4)) { + Chunk var15 = this.getChunkFromChunkCoords(var13.field_145851_c >> 4, var13.field_145849_e >> 4); + + if (var15 != null) { + var15.func_150812_a(var13.field_145851_c & 15, var13.field_145848_d, var13.field_145849_e & 15, var13); + } + } + + this.func_147471_g(var13.field_145851_c, var13.field_145848_d, var13.field_145849_e); + } + } + + this.field_147484_a.clear(); + } + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + public void func_147448_a(Collection p_147448_1_) { + if (this.field_147481_N) { + this.field_147484_a.addAll(p_147448_1_); + } else { + this.field_147482_g.addAll(p_147448_1_); + } + } + + /** + * Will update the entity in the world if the chunk the entity is in is currently loaded. Args: entity + */ + public void updateEntity(Entity p_72870_1_) { + this.updateEntityWithOptionalForce(p_72870_1_, true); + } + + /** + * Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. + * Args: entity, forceUpdate + */ + public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_) { + int var3 = MathHelper.floor_double(p_72866_1_.posX); + int var4 = MathHelper.floor_double(p_72866_1_.posZ); + byte var5 = 32; + + if (!p_72866_2_ || this.checkChunksExist(var3 - var5, 0, var4 - var5, var3 + var5, 0, var4 + var5)) { + p_72866_1_.lastTickPosX = p_72866_1_.posX; + p_72866_1_.lastTickPosY = p_72866_1_.posY; + p_72866_1_.lastTickPosZ = p_72866_1_.posZ; + p_72866_1_.prevRotationYaw = p_72866_1_.rotationYaw; + p_72866_1_.prevRotationPitch = p_72866_1_.rotationPitch; + + if (p_72866_2_ && p_72866_1_.addedToChunk) { + ++p_72866_1_.ticksExisted; + + if (p_72866_1_.ridingEntity != null) { + p_72866_1_.updateRidden(); + } else { + p_72866_1_.onUpdate(); + } + } + + this.theProfiler.startSection("chunkCheck"); + + if (Double.isNaN(p_72866_1_.posX) || Double.isInfinite(p_72866_1_.posX)) { + p_72866_1_.posX = p_72866_1_.lastTickPosX; + } + + if (Double.isNaN(p_72866_1_.posY) || Double.isInfinite(p_72866_1_.posY)) { + p_72866_1_.posY = p_72866_1_.lastTickPosY; + } + + if (Double.isNaN(p_72866_1_.posZ) || Double.isInfinite(p_72866_1_.posZ)) { + p_72866_1_.posZ = p_72866_1_.lastTickPosZ; + } + + if (Double.isNaN(p_72866_1_.rotationPitch) || Double.isInfinite(p_72866_1_.rotationPitch)) { + p_72866_1_.rotationPitch = p_72866_1_.prevRotationPitch; + } + + if (Double.isNaN(p_72866_1_.rotationYaw) || Double.isInfinite(p_72866_1_.rotationYaw)) { + p_72866_1_.rotationYaw = p_72866_1_.prevRotationYaw; + } + + int var6 = MathHelper.floor_double(p_72866_1_.posX / 16.0D); + int var7 = MathHelper.floor_double(p_72866_1_.posY / 16.0D); + int var8 = MathHelper.floor_double(p_72866_1_.posZ / 16.0D); + + if (!p_72866_1_.addedToChunk || p_72866_1_.chunkCoordX != var6 || p_72866_1_.chunkCoordY != var7 || p_72866_1_.chunkCoordZ != var8) { + if (p_72866_1_.addedToChunk && this.chunkExists(p_72866_1_.chunkCoordX, p_72866_1_.chunkCoordZ)) { + this.getChunkFromChunkCoords(p_72866_1_.chunkCoordX, p_72866_1_.chunkCoordZ).removeEntityAtIndex(p_72866_1_, p_72866_1_.chunkCoordY); + } + + if (this.chunkExists(var6, var8)) { + p_72866_1_.addedToChunk = true; + this.getChunkFromChunkCoords(var6, var8).addEntity(p_72866_1_); + } else { + p_72866_1_.addedToChunk = false; + } + } + + this.theProfiler.endSection(); + + if (p_72866_2_ && p_72866_1_.addedToChunk && p_72866_1_.riddenByEntity != null) { + if (!p_72866_1_.riddenByEntity.isDead && p_72866_1_.riddenByEntity.ridingEntity == p_72866_1_) { + this.updateEntity(p_72866_1_.riddenByEntity); + } else { + p_72866_1_.riddenByEntity.ridingEntity = null; + p_72866_1_.riddenByEntity = null; + } + } + } + } + + /** + * Returns true if there are no solid, live entities in the specified AxisAlignedBB + */ + public boolean checkNoEntityCollision(AxisAlignedBB p_72855_1_) { + return this.checkNoEntityCollision(p_72855_1_, null); + } + + /** + * Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity + */ + public boolean checkNoEntityCollision(AxisAlignedBB p_72917_1_, Entity p_72917_2_) { + List var3 = this.getEntitiesWithinAABBExcludingEntity(null, p_72917_1_); + + for (int var4 = 0; var4 < var3.size(); ++var4) { + Entity var5 = (Entity)var3.get(var4); + + if (!var5.isDead && var5.preventEntitySpawning && var5 != p_72917_2_) { + return false; + } + } + + return true; + } + + /** + * Returns true if there are any blocks in the region constrained by an AxisAlignedBB + */ + public boolean checkBlockCollision(AxisAlignedBB p_72829_1_) { + int var2 = MathHelper.floor_double(p_72829_1_.minX); + int var3 = MathHelper.floor_double(p_72829_1_.maxX + 1.0D); + int var4 = MathHelper.floor_double(p_72829_1_.minY); + int var5 = MathHelper.floor_double(p_72829_1_.maxY + 1.0D); + int var6 = MathHelper.floor_double(p_72829_1_.minZ); + int var7 = MathHelper.floor_double(p_72829_1_.maxZ + 1.0D); + + if (p_72829_1_.minX < 0.0D) { + --var2; + } + + if (p_72829_1_.minY < 0.0D) { + --var4; + } + + if (p_72829_1_.minZ < 0.0D) { + --var6; + } + + for (int var8 = var2; var8 < var3; ++var8) { + for (int var9 = var4; var9 < var5; ++var9) { + for (int var10 = var6; var10 < var7; ++var10) { + Block var11 = this.getBlock(var8, var9, var10); + + if (var11.getMaterial() != Material.air) { + return true; + } + } + } + } + + return false; + } + + /** + * Returns if any of the blocks within the aabb are liquids. Args: aabb + */ + public boolean isAnyLiquid(AxisAlignedBB p_72953_1_) { + int var2 = MathHelper.floor_double(p_72953_1_.minX); + int var3 = MathHelper.floor_double(p_72953_1_.maxX + 1.0D); + int var4 = MathHelper.floor_double(p_72953_1_.minY); + int var5 = MathHelper.floor_double(p_72953_1_.maxY + 1.0D); + int var6 = MathHelper.floor_double(p_72953_1_.minZ); + int var7 = MathHelper.floor_double(p_72953_1_.maxZ + 1.0D); + + if (p_72953_1_.minX < 0.0D) { + --var2; + } + + if (p_72953_1_.minY < 0.0D) { + --var4; + } + + if (p_72953_1_.minZ < 0.0D) { + --var6; + } + + for (int var8 = var2; var8 < var3; ++var8) { + for (int var9 = var4; var9 < var5; ++var9) { + for (int var10 = var6; var10 < var7; ++var10) { + Block var11 = this.getBlock(var8, var9, var10); + + if (var11.getMaterial().isLiquid()) { + return true; + } + } + } + } + + return false; + } + + public boolean func_147470_e(AxisAlignedBB p_147470_1_) { + int var2 = MathHelper.floor_double(p_147470_1_.minX); + int var3 = MathHelper.floor_double(p_147470_1_.maxX + 1.0D); + int var4 = MathHelper.floor_double(p_147470_1_.minY); + int var5 = MathHelper.floor_double(p_147470_1_.maxY + 1.0D); + int var6 = MathHelper.floor_double(p_147470_1_.minZ); + int var7 = MathHelper.floor_double(p_147470_1_.maxZ + 1.0D); + + if (this.checkChunksExist(var2, var4, var6, var3, var5, var7)) { + for (int var8 = var2; var8 < var3; ++var8) { + for (int var9 = var4; var9 < var5; ++var9) { + for (int var10 = var6; var10 < var7; ++var10) { + Block var11 = this.getBlock(var8, var9, var10); + + if (var11 == Blocks.fire || var11 == Blocks.flowing_lava || var11 == Blocks.lava) { + return true; + } + } + } + } + } + + return false; + } + + /** + * handles the acceleration of an object whilst in water. Not sure if it is used elsewhere. + */ + public boolean handleMaterialAcceleration(AxisAlignedBB p_72918_1_, Material p_72918_2_, Entity p_72918_3_) { + int var4 = MathHelper.floor_double(p_72918_1_.minX); + int var5 = MathHelper.floor_double(p_72918_1_.maxX + 1.0D); + int var6 = MathHelper.floor_double(p_72918_1_.minY); + int var7 = MathHelper.floor_double(p_72918_1_.maxY + 1.0D); + int var8 = MathHelper.floor_double(p_72918_1_.minZ); + int var9 = MathHelper.floor_double(p_72918_1_.maxZ + 1.0D); + + if (!this.checkChunksExist(var4, var6, var8, var5, var7, var9)) { + return false; + } else { + boolean var10 = false; + Vec3 var11 = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + + for (int var12 = var4; var12 < var5; ++var12) { + for (int var13 = var6; var13 < var7; ++var13) { + for (int var14 = var8; var14 < var9; ++var14) { + Block var15 = this.getBlock(var12, var13, var14); + + if (var15.getMaterial() == p_72918_2_) { + double var16 = (float)(var13 + 1) - BlockLiquid.func_149801_b(this.getBlockMetadata(var12, var13, var14)); + + if ((double)var7 >= var16) { + var10 = true; + var15.velocityToAddToEntity(this, var12, var13, var14, p_72918_3_, var11); + } + } + } + } + } + + if (var11.lengthVector() > 0.0D && p_72918_3_.isPushedByWater()) { + var11 = var11.normalize(); + double var18 = 0.014D; + p_72918_3_.motionX += var11.xCoord * var18; + p_72918_3_.motionY += var11.yCoord * var18; + p_72918_3_.motionZ += var11.zCoord * var18; + } + + return var10; + } + } + + /** + * Returns true if the given bounding box contains the given material + */ + public boolean isMaterialInBB(AxisAlignedBB p_72875_1_, Material p_72875_2_) { + int var3 = MathHelper.floor_double(p_72875_1_.minX); + int var4 = MathHelper.floor_double(p_72875_1_.maxX + 1.0D); + int var5 = MathHelper.floor_double(p_72875_1_.minY); + int var6 = MathHelper.floor_double(p_72875_1_.maxY + 1.0D); + int var7 = MathHelper.floor_double(p_72875_1_.minZ); + int var8 = MathHelper.floor_double(p_72875_1_.maxZ + 1.0D); + + for (int var9 = var3; var9 < var4; ++var9) { + for (int var10 = var5; var10 < var6; ++var10) { + for (int var11 = var7; var11 < var8; ++var11) { + if (this.getBlock(var9, var10, var11).getMaterial() == p_72875_2_) { + return true; + } + } + } + } + + return false; + } + + /** + * checks if the given AABB is in the material given. Used while swimming. + */ + public boolean isAABBInMaterial(AxisAlignedBB p_72830_1_, Material p_72830_2_) { + int var3 = MathHelper.floor_double(p_72830_1_.minX); + int var4 = MathHelper.floor_double(p_72830_1_.maxX + 1.0D); + int var5 = MathHelper.floor_double(p_72830_1_.minY); + int var6 = MathHelper.floor_double(p_72830_1_.maxY + 1.0D); + int var7 = MathHelper.floor_double(p_72830_1_.minZ); + int var8 = MathHelper.floor_double(p_72830_1_.maxZ + 1.0D); + + for (int var9 = var3; var9 < var4; ++var9) { + for (int var10 = var5; var10 < var6; ++var10) { + for (int var11 = var7; var11 < var8; ++var11) { + Block var12 = this.getBlock(var9, var10, var11); + + if (var12.getMaterial() == p_72830_2_) { + int var13 = this.getBlockMetadata(var9, var10, var11); + double var14 = var10 + 1; + + if (var13 < 8) { + var14 = (double)(var10 + 1) - (double)var13 / 8.0D; + } + + if (var14 >= p_72830_1_.minY) { + return true; + } + } + } + } + } + + return false; + } + + /** + * Creates an explosion. Args: entity, x, y, z, strength + */ + public Explosion createExplosion(Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_) { + return this.newExplosion(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_); + } + + /** + * returns a new explosion. Does initiation (at time of writing Explosion is not finished) + */ + public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { + Explosion var11 = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); + var11.isFlaming = p_72885_9_; + var11.isSmoking = p_72885_10_; + var11.doExplosionA(); + var11.doExplosionB(true); + return var11; + } + + /** + * Gets the percentage of real blocks within within a bounding box, along a specified vector. + */ + public float getBlockDensity(Vec3 p_72842_1_, AxisAlignedBB p_72842_2_) { + double var3 = 1.0D / ((p_72842_2_.maxX - p_72842_2_.minX) * 2.0D + 1.0D); + double var5 = 1.0D / ((p_72842_2_.maxY - p_72842_2_.minY) * 2.0D + 1.0D); + double var7 = 1.0D / ((p_72842_2_.maxZ - p_72842_2_.minZ) * 2.0D + 1.0D); + + if (var3 >= 0.0D && var5 >= 0.0D && var7 >= 0.0D) { + int var9 = 0; + int var10 = 0; + + for (float var11 = 0.0F; var11 <= 1.0F; var11 = (float)((double)var11 + var3)) { + for (float var12 = 0.0F; var12 <= 1.0F; var12 = (float)((double)var12 + var5)) { + for (float var13 = 0.0F; var13 <= 1.0F; var13 = (float)((double)var13 + var7)) { + double var14 = p_72842_2_.minX + (p_72842_2_.maxX - p_72842_2_.minX) * (double)var11; + double var16 = p_72842_2_.minY + (p_72842_2_.maxY - p_72842_2_.minY) * (double)var12; + double var18 = p_72842_2_.minZ + (p_72842_2_.maxZ - p_72842_2_.minZ) * (double)var13; + + if (this.rayTraceBlocks(Vec3.createVectorHelper(var14, var16, var18), p_72842_1_) == null) { + ++var9; + } + + ++var10; + } + } + } + + return (float)var9 / (float)var10; + } else { + return 0.0F; + } + } + + /** + * If the block in the given direction of the given coordinate is fire, extinguish it. Args: Player, X,Y,Z, + * blockDirection + */ + public boolean extinguishFire(EntityPlayer p_72886_1_, int p_72886_2_, int p_72886_3_, int p_72886_4_, int p_72886_5_) { + if (p_72886_5_ == 0) { + --p_72886_3_; + } + + if (p_72886_5_ == 1) { + ++p_72886_3_; + } + + if (p_72886_5_ == 2) { + --p_72886_4_; + } + + if (p_72886_5_ == 3) { + ++p_72886_4_; + } + + if (p_72886_5_ == 4) { + --p_72886_2_; + } + + if (p_72886_5_ == 5) { + ++p_72886_2_; + } + + if (this.getBlock(p_72886_2_, p_72886_3_, p_72886_4_) == Blocks.fire) { + this.playAuxSFXAtEntity(p_72886_1_, 1004, p_72886_2_, p_72886_3_, p_72886_4_, 0); + this.setBlockToAir(p_72886_2_, p_72886_3_, p_72886_4_); + return true; + } else { + return false; + } + } + + /** + * This string is 'All: (number of loaded entities)' Viewable by press ing F3 + */ + public String getDebugLoadedEntities() { + return "All: " + this.loadedEntityList.size(); + } + + /** + * Returns the name of the current chunk provider, by calling chunkprovider.makeString() + */ + public String getProviderName() { + return this.chunkProvider.makeString(); + } + + public TileEntity getTileEntity(int p_147438_1_, int p_147438_2_, int p_147438_3_) { + if (p_147438_2_ >= 0 && p_147438_2_ < 256) { + TileEntity var4 = null; + int var5; + TileEntity var6; + + if (this.field_147481_N) { + for (var5 = 0; var5 < this.field_147484_a.size(); ++var5) { + var6 = (TileEntity)this.field_147484_a.get(var5); + + if (!var6.isInvalid() && var6.field_145851_c == p_147438_1_ && var6.field_145848_d == p_147438_2_ && var6.field_145849_e == p_147438_3_) { + var4 = var6; + break; + } + } + } + + if (var4 == null) { + Chunk var7 = this.getChunkFromChunkCoords(p_147438_1_ >> 4, p_147438_3_ >> 4); + + if (var7 != null) { + var4 = var7.func_150806_e(p_147438_1_ & 15, p_147438_2_, p_147438_3_ & 15); + } + } + + if (var4 == null) { + for (var5 = 0; var5 < this.field_147484_a.size(); ++var5) { + var6 = (TileEntity)this.field_147484_a.get(var5); + + if (!var6.isInvalid() && var6.field_145851_c == p_147438_1_ && var6.field_145848_d == p_147438_2_ && var6.field_145849_e == p_147438_3_) { + var4 = var6; + break; + } + } + } + + return var4; + } else { + return null; + } + } + + public void setTileEntity(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) { + if (p_147455_4_ != null && !p_147455_4_.isInvalid()) { + if (this.field_147481_N) { + p_147455_4_.field_145851_c = p_147455_1_; + p_147455_4_.field_145848_d = p_147455_2_; + p_147455_4_.field_145849_e = p_147455_3_; + Iterator var5 = this.field_147484_a.iterator(); + + while (var5.hasNext()) { + TileEntity var6 = (TileEntity)var5.next(); + + if (var6.field_145851_c == p_147455_1_ && var6.field_145848_d == p_147455_2_ && var6.field_145849_e == p_147455_3_) { + var6.invalidate(); + var5.remove(); + } + } + + this.field_147484_a.add(p_147455_4_); + } else { + this.field_147482_g.add(p_147455_4_); + Chunk var7 = this.getChunkFromChunkCoords(p_147455_1_ >> 4, p_147455_3_ >> 4); + + if (var7 != null) { + var7.func_150812_a(p_147455_1_ & 15, p_147455_2_, p_147455_3_ & 15, p_147455_4_); + } + } + } + } + + public void removeTileEntity(int p_147475_1_, int p_147475_2_, int p_147475_3_) { + TileEntity var4 = this.getTileEntity(p_147475_1_, p_147475_2_, p_147475_3_); + + if (var4 != null && this.field_147481_N) { + var4.invalidate(); + this.field_147484_a.remove(var4); + } else { + if (var4 != null) { + this.field_147484_a.remove(var4); + this.field_147482_g.remove(var4); + } + + Chunk var5 = this.getChunkFromChunkCoords(p_147475_1_ >> 4, p_147475_3_ >> 4); + + if (var5 != null) { + var5.removeTileEntity(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); + } + } + } + + public void func_147457_a(TileEntity p_147457_1_) { + this.field_147483_b.add(p_147457_1_); + } + + public boolean func_147469_q(int p_147469_1_, int p_147469_2_, int p_147469_3_) { + AxisAlignedBB var4 = this.getBlock(p_147469_1_, p_147469_2_, p_147469_3_).getCollisionBoundingBoxFromPool(this, p_147469_1_, p_147469_2_, p_147469_3_); + return var4 != null && var4.getAverageEdgeLength() >= 1.0D; + } + + /** + * Returns true if the block at the given coordinate has a solid (buildable) top surface. + */ + public static boolean doesBlockHaveSolidTopSurface(IBlockAccess p_147466_0_, int p_147466_1_, int p_147466_2_, int p_147466_3_) { + Block var4 = p_147466_0_.getBlock(p_147466_1_, p_147466_2_, p_147466_3_); + int var5 = p_147466_0_.getBlockMetadata(p_147466_1_, p_147466_2_, p_147466_3_); + return var4.getMaterial().isOpaque() && var4.renderAsNormalBlock() || (var4 instanceof BlockStairs ? (var5 & 4) == 4 : (var4 instanceof BlockSlab ? (var5 & 8) == 8 : (var4 instanceof BlockHopper || (var4 instanceof BlockSnow && (var5 & 7) == 7)))); + } + + /** + * Checks if the block is a solid, normal cube. If the chunk does not exist, or is not loaded, it returns the + * boolean parameter + */ + public boolean isBlockNormalCubeDefault(int p_147445_1_, int p_147445_2_, int p_147445_3_, boolean p_147445_4_) { + if (p_147445_1_ >= -30000000 && p_147445_3_ >= -30000000 && p_147445_1_ < 30000000 && p_147445_3_ < 30000000) { + Chunk var5 = this.chunkProvider.provideChunk(p_147445_1_ >> 4, p_147445_3_ >> 4); + + if (var5 != null && !var5.isEmpty()) { + Block var6 = this.getBlock(p_147445_1_, p_147445_2_, p_147445_3_); + return var6.getMaterial().isOpaque() && var6.renderAsNormalBlock(); + } else { + return p_147445_4_; + } + } else { + return p_147445_4_; + } + } + + /** + * Called on construction of the World class to setup the initial skylight values + */ + public void calculateInitialSkylight() { + int var1 = this.calculateSkylightSubtracted(1.0F); + + if (var1 != this.skylightSubtracted) { + this.skylightSubtracted = var1; + } + } + + /** + * Set which types of mobs are allowed to spawn (peaceful vs hostile). + */ + public void setAllowedSpawnTypes(boolean p_72891_1_, boolean p_72891_2_) { + this.spawnHostileMobs = p_72891_1_; + this.spawnPeacefulMobs = p_72891_2_; + } + + /** + * Runs a single tick for the world + */ + public void tick() { + this.updateWeather(); + } + + /** + * Called from World constructor to set rainingStrength and thunderingStrength + */ + private void calculateInitialWeather() { + if (this.worldInfo.isRaining()) { + this.rainingStrength = 1.0F; + + if (this.worldInfo.isThundering()) { + this.thunderingStrength = 1.0F; + } + } + } + + /** + * Updates all weather states. + */ + protected void updateWeather() { + if (!this.provider.hasNoSky) { + if (!this.isClient) { + int var1 = this.worldInfo.getThunderTime(); + + if (var1 <= 0) { + if (this.worldInfo.isThundering()) { + this.worldInfo.setThunderTime(this.rand.nextInt(12000) + 3600); + } else { + this.worldInfo.setThunderTime(this.rand.nextInt(168000) + 12000); + } + } else { + --var1; + this.worldInfo.setThunderTime(var1); + + if (var1 <= 0) { + this.worldInfo.setThundering(!this.worldInfo.isThundering()); + } + } + + this.prevThunderingStrength = this.thunderingStrength; + + if (this.worldInfo.isThundering()) { + this.thunderingStrength = (float)((double)this.thunderingStrength + 0.01D); + } else { + this.thunderingStrength = (float)((double)this.thunderingStrength - 0.01D); + } + + this.thunderingStrength = MathHelper.clamp_float(this.thunderingStrength, 0.0F, 1.0F); + int var2 = this.worldInfo.getRainTime(); + + if (var2 <= 0) { + if (this.worldInfo.isRaining()) { + this.worldInfo.setRainTime(this.rand.nextInt(12000) + 12000); + } else { + this.worldInfo.setRainTime(this.rand.nextInt(168000) + 12000); + } + } else { + --var2; + this.worldInfo.setRainTime(var2); + + if (var2 <= 0) { + this.worldInfo.setRaining(!this.worldInfo.isRaining()); + } + } + + this.prevRainingStrength = this.rainingStrength; + + if (this.worldInfo.isRaining()) { + this.rainingStrength = (float)((double)this.rainingStrength + 0.01D); + } else { + this.rainingStrength = (float)((double)this.rainingStrength - 0.01D); + } + + this.rainingStrength = MathHelper.clamp_float(this.rainingStrength, 0.0F, 1.0F); + } + } + } + + protected void setActivePlayerChunksAndCheckLight() { + this.activeChunkSet.clear(); + this.theProfiler.startSection("buildList"); + int var1; + EntityPlayer var2; + int var3; + int var4; + int var5; + + for (var1 = 0; var1 < this.playerEntities.size(); ++var1) { + var2 = this.playerEntities.get(var1); + var3 = MathHelper.floor_double(var2.posX / 16.0D); + var4 = MathHelper.floor_double(var2.posZ / 16.0D); + var5 = this.func_152379_p(); + + for (int var6 = -var5; var6 <= var5; ++var6) { + for (int var7 = -var5; var7 <= var5; ++var7) { + this.activeChunkSet.add(new ChunkCoordIntPair(var6 + var3, var7 + var4)); + } + } + } + + this.theProfiler.endSection(); + + if (this.ambientTickCountdown > 0) { + --this.ambientTickCountdown; + } + + this.theProfiler.startSection("playerCheckLight"); + + if (!this.playerEntities.isEmpty()) { + var1 = this.rand.nextInt(this.playerEntities.size()); + var2 = this.playerEntities.get(var1); + var3 = MathHelper.floor_double(var2.posX) + this.rand.nextInt(11) - 5; + var4 = MathHelper.floor_double(var2.posY) + this.rand.nextInt(11) - 5; + var5 = MathHelper.floor_double(var2.posZ) + this.rand.nextInt(11) - 5; + this.func_147451_t(var3, var4, var5); + } + + this.theProfiler.endSection(); + } + + protected abstract int func_152379_p(); + + protected void func_147467_a(int p_147467_1_, int p_147467_2_, Chunk p_147467_3_) { + this.theProfiler.endStartSection("moodSound"); + + if (this.ambientTickCountdown == 0 && !this.isClient) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int var4 = this.updateLCG >> 2; + int var5 = var4 & 15; + int var6 = var4 >> 8 & 15; + int var7 = var4 >> 16 & 255; + Block var8 = p_147467_3_.func_150810_a(var5, var7, var6); + var5 += p_147467_1_; + var6 += p_147467_2_; + + if (var8.getMaterial() == Material.air && this.getFullBlockLightValue(var5, var7, var6) <= this.rand.nextInt(8) && this.getSavedLightValue(EnumSkyBlock.Sky, var5, var7, var6) <= 0) { + EntityPlayer var9 = this.getClosestPlayer((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D, 8.0D); + + if (var9 != null && var9.getDistanceSq((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D) > 4.0D) { + this.playSoundEffect((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.rand.nextFloat() * 0.2F); + this.ambientTickCountdown = this.rand.nextInt(12000) + 6000; + } + } + } + + this.theProfiler.endStartSection("checkLight"); + p_147467_3_.enqueueRelightChecks(); + } + + protected void func_147456_g() { + this.setActivePlayerChunksAndCheckLight(); + } + + /** + * checks to see if a given block is both water and is cold enough to freeze + */ + public boolean isBlockFreezable(int p_72884_1_, int p_72884_2_, int p_72884_3_) { + return this.canBlockFreeze(p_72884_1_, p_72884_2_, p_72884_3_, false); + } + + /** + * checks to see if a given block is both water and has at least one immediately adjacent non-water block + */ + public boolean isBlockFreezableNaturally(int p_72850_1_, int p_72850_2_, int p_72850_3_) { + return this.canBlockFreeze(p_72850_1_, p_72850_2_, p_72850_3_, true); + } + + /** + * checks to see if a given block is both water, and cold enough to freeze - if the par4 boolean is set, this will + * only return true if there is a non-water block immediately adjacent to the specified block + */ + public boolean canBlockFreeze(int p_72834_1_, int p_72834_2_, int p_72834_3_, boolean p_72834_4_) { + BiomeGenBase var5 = this.getBiomeGenForCoords(p_72834_1_, p_72834_3_); + float var6 = var5.getFloatTemperature(p_72834_1_, p_72834_2_, p_72834_3_); + + if (var6 > 0.15F) { + return false; + } else { + if (p_72834_2_ >= 0 && p_72834_2_ < 256 && this.getSavedLightValue(EnumSkyBlock.Block, p_72834_1_, p_72834_2_, p_72834_3_) < 10) { + Block var7 = this.getBlock(p_72834_1_, p_72834_2_, p_72834_3_); + + if ((var7 == Blocks.water || var7 == Blocks.flowing_water) && this.getBlockMetadata(p_72834_1_, p_72834_2_, p_72834_3_) == 0) { + if (!p_72834_4_) { + return true; + } + + boolean var8 = true; + + if (var8 && this.getBlock(p_72834_1_ - 1, p_72834_2_, p_72834_3_).getMaterial() != Material.water) { + var8 = false; + } + + if (var8 && this.getBlock(p_72834_1_ + 1, p_72834_2_, p_72834_3_).getMaterial() != Material.water) { + var8 = false; + } + + if (var8 && this.getBlock(p_72834_1_, p_72834_2_, p_72834_3_ - 1).getMaterial() != Material.water) { + var8 = false; + } + + if (var8 && this.getBlock(p_72834_1_, p_72834_2_, p_72834_3_ + 1).getMaterial() != Material.water) { + var8 = false; + } + + return !var8; + } + } + + return false; + } + } + + public boolean func_147478_e(int p_147478_1_, int p_147478_2_, int p_147478_3_, boolean p_147478_4_) { + BiomeGenBase var5 = this.getBiomeGenForCoords(p_147478_1_, p_147478_3_); + float var6 = var5.getFloatTemperature(p_147478_1_, p_147478_2_, p_147478_3_); + + if (var6 > 0.15F) { + return false; + } else if (!p_147478_4_) { + return true; + } else { + if (p_147478_2_ >= 0 && p_147478_2_ < 256 && this.getSavedLightValue(EnumSkyBlock.Block, p_147478_1_, p_147478_2_, p_147478_3_) < 10) { + Block var7 = this.getBlock(p_147478_1_, p_147478_2_, p_147478_3_); + + return var7.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, p_147478_1_, p_147478_2_, p_147478_3_); + } + + return false; + } + } + + public boolean func_147451_t(int p_147451_1_, int p_147451_2_, int p_147451_3_) { + boolean var4 = false; + + if (!this.provider.hasNoSky) { + var4 |= this.updateLightByType(EnumSkyBlock.Sky, p_147451_1_, p_147451_2_, p_147451_3_); + } + + var4 |= this.updateLightByType(EnumSkyBlock.Block, p_147451_1_, p_147451_2_, p_147451_3_); + return var4; + } + + private int computeLightValue(int p_98179_1_, int p_98179_2_, int p_98179_3_, EnumSkyBlock p_98179_4_) { + if (p_98179_4_ == EnumSkyBlock.Sky && this.canBlockSeeTheSky(p_98179_1_, p_98179_2_, p_98179_3_)) { + return 15; + } else { + Block var5 = this.getBlock(p_98179_1_, p_98179_2_, p_98179_3_); + int var6 = p_98179_4_ == EnumSkyBlock.Sky ? 0 : var5.getLightValue(); + int var7 = var5.getLightOpacity(); + + if (var7 >= 15 && var5.getLightValue() > 0) { + var7 = 1; + } + + if (var7 < 1) { + var7 = 1; + } + + if (var7 >= 15) { + return 0; + } else if (var6 >= 14) { + return var6; + } else { + for (int var8 = 0; var8 < 6; ++var8) { + int var9 = p_98179_1_ + Facing.offsetsXForSide[var8]; + int var10 = p_98179_2_ + Facing.offsetsYForSide[var8]; + int var11 = p_98179_3_ + Facing.offsetsZForSide[var8]; + int var12 = this.getSavedLightValue(p_98179_4_, var9, var10, var11) - var7; + + if (var12 > var6) { + var6 = var12; + } + + if (var6 >= 14) { + return var6; + } + } + + return var6; + } + } + } + + public boolean updateLightByType(EnumSkyBlock p_147463_1_, int p_147463_2_, int p_147463_3_, int p_147463_4_) { + if ((Boolean) CheatBreaker.getInstance().getGlobalSettings().enableFpsBoost.getValue() && (Boolean) CheatBreaker.getInstance().getGlobalSettings().fullBright.getValue()) { + return true; + } + if (!this.doChunksNearChunkExist(p_147463_2_, p_147463_3_, p_147463_4_, 17)) { + return false; + } else { + int var5 = 0; + int var6 = 0; + this.theProfiler.startSection("getBrightness"); + int var7 = this.getSavedLightValue(p_147463_1_, p_147463_2_, p_147463_3_, p_147463_4_); + int var8 = this.computeLightValue(p_147463_2_, p_147463_3_, p_147463_4_, p_147463_1_); + int var9; + int var10; + int var11; + int var12; + int var13; + int var14; + int var15; + int var16; + int var17; + + if (var8 > var7) { + this.lightUpdateBlockList[var6++] = 133152; + } else if (var8 < var7) { + this.lightUpdateBlockList[var6++] = 133152 | var7 << 18; + + while (var5 < var6) { + var9 = this.lightUpdateBlockList[var5++]; + var10 = (var9 & 63) - 32 + p_147463_2_; + var11 = (var9 >> 6 & 63) - 32 + p_147463_3_; + var12 = (var9 >> 12 & 63) - 32 + p_147463_4_; + var13 = var9 >> 18 & 15; + var14 = this.getSavedLightValue(p_147463_1_, var10, var11, var12); + + if (var14 == var13) { + this.setLightValue(p_147463_1_, var10, var11, var12, 0); + + if (var13 > 0) { + var15 = MathHelper.abs_int(var10 - p_147463_2_); + var16 = MathHelper.abs_int(var11 - p_147463_3_); + var17 = MathHelper.abs_int(var12 - p_147463_4_); + + if (var15 + var16 + var17 < 17) { + for (int var18 = 0; var18 < 6; ++var18) { + int var19 = var10 + Facing.offsetsXForSide[var18]; + int var20 = var11 + Facing.offsetsYForSide[var18]; + int var21 = var12 + Facing.offsetsZForSide[var18]; + int var22 = Math.max(1, this.getBlock(var19, var20, var21).getLightOpacity()); + var14 = this.getSavedLightValue(p_147463_1_, var19, var20, var21); + + if (var14 == var13 - var22 && var6 < this.lightUpdateBlockList.length) { + this.lightUpdateBlockList[var6++] = var19 - p_147463_2_ + 32 | var20 - p_147463_3_ + 32 << 6 | var21 - p_147463_4_ + 32 << 12 | var13 - var22 << 18; + } + } + } + } + } + } + + var5 = 0; + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("checkedPosition < toCheckCount"); + + while (var5 < var6) { + var9 = this.lightUpdateBlockList[var5++]; + var10 = (var9 & 63) - 32 + p_147463_2_; + var11 = (var9 >> 6 & 63) - 32 + p_147463_3_; + var12 = (var9 >> 12 & 63) - 32 + p_147463_4_; + var13 = this.getSavedLightValue(p_147463_1_, var10, var11, var12); + var14 = this.computeLightValue(var10, var11, var12, p_147463_1_); + + if (var14 != var13) { + this.setLightValue(p_147463_1_, var10, var11, var12, var14); + + if (var14 > var13) { + var15 = Math.abs(var10 - p_147463_2_); + var16 = Math.abs(var11 - p_147463_3_); + var17 = Math.abs(var12 - p_147463_4_); + boolean var23 = var6 < this.lightUpdateBlockList.length - 6; + + if (var15 + var16 + var17 < 17 && var23) { + if (this.getSavedLightValue(p_147463_1_, var10 - 1, var11, var12) < var14) { + this.lightUpdateBlockList[var6++] = var10 - 1 - p_147463_2_ + 32 + (var11 - p_147463_3_ + 32 << 6) + (var12 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, var10 + 1, var11, var12) < var14) { + this.lightUpdateBlockList[var6++] = var10 + 1 - p_147463_2_ + 32 + (var11 - p_147463_3_ + 32 << 6) + (var12 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, var10, var11 - 1, var12) < var14) { + this.lightUpdateBlockList[var6++] = var10 - p_147463_2_ + 32 + (var11 - 1 - p_147463_3_ + 32 << 6) + (var12 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, var10, var11 + 1, var12) < var14) { + this.lightUpdateBlockList[var6++] = var10 - p_147463_2_ + 32 + (var11 + 1 - p_147463_3_ + 32 << 6) + (var12 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, var10, var11, var12 - 1) < var14) { + this.lightUpdateBlockList[var6++] = var10 - p_147463_2_ + 32 + (var11 - p_147463_3_ + 32 << 6) + (var12 - 1 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, var10, var11, var12 + 1) < var14) { + this.lightUpdateBlockList[var6++] = var10 - p_147463_2_ + 32 + (var11 - p_147463_3_ + 32 << 6) + (var12 + 1 - p_147463_4_ + 32 << 12); + } + } + } + } + } + + this.theProfiler.endSection(); + return true; + } + } + + /** + * Runs through the list of updates to run and ticks them + */ + public boolean tickUpdates(boolean p_72955_1_) { + return false; + } + + public List getPendingBlockUpdates(Chunk p_72920_1_, boolean p_72920_2_) { + return null; + } + + /** + * Will get all entities within the specified AABB excluding the one passed into it. Args: entityToExclude, aabb + */ + public List getEntitiesWithinAABBExcludingEntity(Entity p_72839_1_, AxisAlignedBB p_72839_2_) { + return this.getEntitiesWithinAABBExcludingEntity(p_72839_1_, p_72839_2_, null); + } + + public List getEntitiesWithinAABBExcludingEntity(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_) { + ArrayList var4 = new ArrayList(); + int var5 = MathHelper.floor_double((p_94576_2_.minX - 2.0D) / 16.0D); + int var6 = MathHelper.floor_double((p_94576_2_.maxX + 2.0D) / 16.0D); + int var7 = MathHelper.floor_double((p_94576_2_.minZ - 2.0D) / 16.0D); + int var8 = MathHelper.floor_double((p_94576_2_.maxZ + 2.0D) / 16.0D); + + for (int var9 = var5; var9 <= var6; ++var9) { + for (int var10 = var7; var10 <= var8; ++var10) { + if (this.chunkExists(var9, var10)) { + this.getChunkFromChunkCoords(var9, var10).getEntitiesWithinAABBForEntity(p_94576_1_, p_94576_2_, var4, p_94576_3_); + } + } + } + + return var4; + } + + /** + * Returns all entities of the specified class type which intersect with the AABB. Args: entityClass, aabb + */ + public List getEntitiesWithinAABB(Class p_72872_1_, AxisAlignedBB p_72872_2_) { + return this.selectEntitiesWithinAABB(p_72872_1_, p_72872_2_, null); + } + + public List selectEntitiesWithinAABB(Class p_82733_1_, AxisAlignedBB p_82733_2_, IEntitySelector p_82733_3_) { + int var4 = MathHelper.floor_double((p_82733_2_.minX - 2.0D) / 16.0D); + int var5 = MathHelper.floor_double((p_82733_2_.maxX + 2.0D) / 16.0D); + int var6 = MathHelper.floor_double((p_82733_2_.minZ - 2.0D) / 16.0D); + int var7 = MathHelper.floor_double((p_82733_2_.maxZ + 2.0D) / 16.0D); + ArrayList var8 = new ArrayList(); + + for (int var9 = var4; var9 <= var5; ++var9) { + for (int var10 = var6; var10 <= var7; ++var10) { + if (this.chunkExists(var9, var10)) { + this.getChunkFromChunkCoords(var9, var10).getEntitiesOfTypeWithinAAAB(p_82733_1_, p_82733_2_, var8, p_82733_3_); + } + } + } + + return var8; + } + + public Entity findNearestEntityWithinAABB(Class p_72857_1_, AxisAlignedBB p_72857_2_, Entity p_72857_3_) { + List var4 = this.getEntitiesWithinAABB(p_72857_1_, p_72857_2_); + Entity var5 = null; + double var6 = Double.MAX_VALUE; + + for (int var8 = 0; var8 < var4.size(); ++var8) { + Entity var9 = (Entity)var4.get(var8); + + if (var9 != p_72857_3_) { + double var10 = p_72857_3_.getDistanceSqToEntity(var9); + + if (var10 <= var6) { + var5 = var9; + var6 = var10; + } + } + } + + return var5; + } + + /** + * Returns the Entity with the given ID, or null if it doesn't exist in this World. + */ + public abstract Entity getEntityByID(int p_73045_1_); + + /** + * Accessor for world Loaded Entity List + */ + public List getLoadedEntityList() { + return this.loadedEntityList; + } + + public void func_147476_b(int p_147476_1_, int p_147476_2_, int p_147476_3_, TileEntity p_147476_4_) { + if (this.blockExists(p_147476_1_, p_147476_2_, p_147476_3_)) { + this.getChunkFromBlockCoords(p_147476_1_, p_147476_3_).setChunkModified(); + } + } + + /** + * Counts how many entities of an entity class exist in the world. Args: entityClass + */ + public int countEntities(Class p_72907_1_) { + int var2 = 0; + + for (int var3 = 0; var3 < this.loadedEntityList.size(); ++var3) { + Entity var4 = (Entity)this.loadedEntityList.get(var3); + + if ((!(var4 instanceof EntityLiving) || !((EntityLiving)var4).isNoDespawnRequired()) && p_72907_1_.isAssignableFrom(var4.getClass())) { + ++var2; + } + } + + return var2; + } + + /** + * adds entities to the loaded entities list, and loads thier skins. + */ + public void addLoadedEntities(List p_72868_1_) { + this.loadedEntityList.addAll(p_72868_1_); + + for (int var2 = 0; var2 < p_72868_1_.size(); ++var2) { + this.onEntityAdded((Entity)p_72868_1_.get(var2)); + } + } + + /** + * Adds a list of entities to be unloaded on the next pass of World.updateEntities() + */ + public void unloadEntities(List p_72828_1_) { + this.unloadedEntityList.addAll(p_72828_1_); + } + + public boolean canPlaceEntityOnSide(Block p_147472_1_, int p_147472_2_, int p_147472_3_, int p_147472_4_, boolean p_147472_5_, int p_147472_6_, Entity p_147472_7_, ItemStack p_147472_8_) { + Block var9 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); + AxisAlignedBB var10 = p_147472_5_ ? null : p_147472_1_.getCollisionBoundingBoxFromPool(this, p_147472_2_, p_147472_3_, p_147472_4_); + return (var10 == null || this.checkNoEntityCollision(var10, p_147472_7_)) && (var9.getMaterial() == Material.circuits && p_147472_1_ == Blocks.anvil || var9.getMaterial().isReplaceable() && p_147472_1_.canReplace(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); + } + + public PathEntity getPathEntityToEntity(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_) { + this.theProfiler.startSection("pathfind"); + int var8 = MathHelper.floor_double(p_72865_1_.posX); + int var9 = MathHelper.floor_double(p_72865_1_.posY + 1.0D); + int var10 = MathHelper.floor_double(p_72865_1_.posZ); + int var11 = (int)(p_72865_3_ + 16.0F); + int var12 = var8 - var11; + int var13 = var9 - var11; + int var14 = var10 - var11; + int var15 = var8 + var11; + int var16 = var9 + var11; + int var17 = var10 + var11; + ChunkCache var18 = new ChunkCache(this, var12, var13, var14, var15, var16, var17, 0); + PathEntity var19 = (new PathFinder(var18, p_72865_4_, p_72865_5_, p_72865_6_, p_72865_7_)).createEntityPathTo(p_72865_1_, p_72865_2_, p_72865_3_); + this.theProfiler.endSection(); + return var19; + } + + public PathEntity getEntityPathToXYZ(Entity p_72844_1_, int p_72844_2_, int p_72844_3_, int p_72844_4_, float p_72844_5_, boolean p_72844_6_, boolean p_72844_7_, boolean p_72844_8_, boolean p_72844_9_) { + this.theProfiler.startSection("pathfind"); + int var10 = MathHelper.floor_double(p_72844_1_.posX); + int var11 = MathHelper.floor_double(p_72844_1_.posY); + int var12 = MathHelper.floor_double(p_72844_1_.posZ); + int var13 = (int)(p_72844_5_ + 8.0F); + int var14 = var10 - var13; + int var15 = var11 - var13; + int var16 = var12 - var13; + int var17 = var10 + var13; + int var18 = var11 + var13; + int var19 = var12 + var13; + ChunkCache var20 = new ChunkCache(this, var14, var15, var16, var17, var18, var19, 0); + PathEntity var21 = (new PathFinder(var20, p_72844_6_, p_72844_7_, p_72844_8_, p_72844_9_)).createEntityPathTo(p_72844_1_, p_72844_2_, p_72844_3_, p_72844_4_, p_72844_5_); + this.theProfiler.endSection(); + return var21; + } + + /** + * Is this block powering in the specified direction Args: x, y, z, direction + */ + public int isBlockProvidingPowerTo(int p_72879_1_, int p_72879_2_, int p_72879_3_, int p_72879_4_) { + return this.getBlock(p_72879_1_, p_72879_2_, p_72879_3_).isProvidingStrongPower(this, p_72879_1_, p_72879_2_, p_72879_3_, p_72879_4_); + } + + /** + * Returns the highest redstone signal strength powering the given block. Args: X, Y, Z. + */ + public int getBlockPowerInput(int p_94577_1_, int p_94577_2_, int p_94577_3_) { + byte var4 = 0; + int var5 = Math.max(var4, this.isBlockProvidingPowerTo(p_94577_1_, p_94577_2_ - 1, p_94577_3_, 0)); + + if (var5 >= 15) { + return var5; + } else { + var5 = Math.max(var5, this.isBlockProvidingPowerTo(p_94577_1_, p_94577_2_ + 1, p_94577_3_, 1)); + + if (var5 >= 15) { + return var5; + } else { + var5 = Math.max(var5, this.isBlockProvidingPowerTo(p_94577_1_, p_94577_2_, p_94577_3_ - 1, 2)); + + if (var5 >= 15) { + return var5; + } else { + var5 = Math.max(var5, this.isBlockProvidingPowerTo(p_94577_1_, p_94577_2_, p_94577_3_ + 1, 3)); + + if (var5 >= 15) { + return var5; + } else { + var5 = Math.max(var5, this.isBlockProvidingPowerTo(p_94577_1_ - 1, p_94577_2_, p_94577_3_, 4)); + + if (var5 >= 15) { + return var5; + } else { + var5 = Math.max(var5, this.isBlockProvidingPowerTo(p_94577_1_ + 1, p_94577_2_, p_94577_3_, 5)); + return var5; + } + } + } + } + } + } + + /** + * Returns the indirect signal strength being outputted by the given block in the *opposite* of the given direction. + * Args: X, Y, Z, direction + */ + public boolean getIndirectPowerOutput(int p_94574_1_, int p_94574_2_, int p_94574_3_, int p_94574_4_) { + return this.getIndirectPowerLevelTo(p_94574_1_, p_94574_2_, p_94574_3_, p_94574_4_) > 0; + } + + /** + * Gets the power level from a certain block face. Args: x, y, z, direction + */ + public int getIndirectPowerLevelTo(int p_72878_1_, int p_72878_2_, int p_72878_3_, int p_72878_4_) { + return this.getBlock(p_72878_1_, p_72878_2_, p_72878_3_).isNormalCube() ? this.getBlockPowerInput(p_72878_1_, p_72878_2_, p_72878_3_) : this.getBlock(p_72878_1_, p_72878_2_, p_72878_3_).isProvidingWeakPower(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_); + } + + /** + * Used to see if one of the blocks next to you or your block is getting power from a neighboring block. Used by + * items like TNT or Doors so they don't have redstone going straight into them. Args: x, y, z + */ + public boolean isBlockIndirectlyGettingPowered(int p_72864_1_, int p_72864_2_, int p_72864_3_) { + return this.getIndirectPowerLevelTo(p_72864_1_, p_72864_2_ - 1, p_72864_3_, 0) > 0 || (this.getIndirectPowerLevelTo(p_72864_1_, p_72864_2_ + 1, p_72864_3_, 1) > 0 || (this.getIndirectPowerLevelTo(p_72864_1_, p_72864_2_, p_72864_3_ - 1, 2) > 0 || (this.getIndirectPowerLevelTo(p_72864_1_, p_72864_2_, p_72864_3_ + 1, 3) > 0 || (this.getIndirectPowerLevelTo(p_72864_1_ - 1, p_72864_2_, p_72864_3_, 4) > 0 || this.getIndirectPowerLevelTo(p_72864_1_ + 1, p_72864_2_, p_72864_3_, 5) > 0)))); + } + + public int getStrongestIndirectPower(int p_94572_1_, int p_94572_2_, int p_94572_3_) { + int var4 = 0; + + for (int var5 = 0; var5 < 6; ++var5) { + int var6 = this.getIndirectPowerLevelTo(p_94572_1_ + Facing.offsetsXForSide[var5], p_94572_2_ + Facing.offsetsYForSide[var5], p_94572_3_ + Facing.offsetsZForSide[var5], var5); + + if (var6 >= 15) { + return 15; + } + + if (var6 > var4) { + var4 = var6; + } + } + + return var4; + } + + /** + * Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored). + * Args: entity, dist + */ + public EntityPlayer getClosestPlayerToEntity(Entity p_72890_1_, double p_72890_2_) { + return this.getClosestPlayer(p_72890_1_.posX, p_72890_1_.posY, p_72890_1_.posZ, p_72890_2_); + } + + /** + * Gets the closest player to the point within the specified distance (distance can be set to less than 0 to not + * limit the distance). Args: x, y, z, dist + */ + public EntityPlayer getClosestPlayer(double p_72977_1_, double p_72977_3_, double p_72977_5_, double p_72977_7_) { + double var9 = -1.0D; + EntityPlayer var11 = null; + + for (int var12 = 0; var12 < this.playerEntities.size(); ++var12) { + EntityPlayer var13 = this.playerEntities.get(var12); + double var14 = var13.getDistanceSq(p_72977_1_, p_72977_3_, p_72977_5_); + + if ((p_72977_7_ < 0.0D || var14 < p_72977_7_ * p_72977_7_) && (var9 == -1.0D || var14 < var9)) { + var9 = var14; + var11 = var13; + } + } + + return var11; + } + + /** + * Returns the closest vulnerable player to this entity within the given radius, or null if none is found + */ + public EntityPlayer getClosestVulnerablePlayerToEntity(Entity p_72856_1_, double p_72856_2_) { + return this.getClosestVulnerablePlayer(p_72856_1_.posX, p_72856_1_.posY, p_72856_1_.posZ, p_72856_2_); + } + + /** + * Returns the closest vulnerable player within the given radius, or null if none is found. + */ + public EntityPlayer getClosestVulnerablePlayer(double p_72846_1_, double p_72846_3_, double p_72846_5_, double p_72846_7_) { + double var9 = -1.0D; + EntityPlayer var11 = null; + + for (int var12 = 0; var12 < this.playerEntities.size(); ++var12) { + EntityPlayer var13 = this.playerEntities.get(var12); + + if (!var13.capabilities.disableDamage && var13.isEntityAlive()) { + double var14 = var13.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_); + double var16 = p_72846_7_; + + if (var13.isSneaking()) { + var16 = p_72846_7_ * 0.800000011920929D; + } + + if (var13.isInvisible()) { + float var18 = var13.getArmorVisibility(); + + if (var18 < 0.1F) { + var18 = 0.1F; + } + + var16 *= 0.7F * var18; + } + + if ((p_72846_7_ < 0.0D || var14 < var16 * var16) && (var9 == -1.0D || var14 < var9)) { + var9 = var14; + var11 = var13; + } + } + } + + return var11; + } + + /** + * Find a player by name in this world. + */ + public EntityPlayer getPlayerEntityByName(String p_72924_1_) { + for (int var2 = 0; var2 < this.playerEntities.size(); ++var2) { + EntityPlayer var3 = this.playerEntities.get(var2); + + if (p_72924_1_.equals(var3.getCommandSenderName())) { + return var3; + } + } + + return null; + } + + public EntityPlayer isPlayerTeamMate(String string) { + for (int i = 0; i < this.playerEntities.size(); ++i) { + EntityPlayer entityPlayer = this.playerEntities.get(i); + if (!entityPlayer.isEntityAlive() || !string.equals(entityPlayer.getGameProfile().getId().toString()) && !string.equals(entityPlayer.getGameProfile().getId().toString().replaceAll("-", ""))) continue; + return entityPlayer; + } + return null; + } + + public EntityPlayer func_152378_a(UUID p_152378_1_) { + for (int var2 = 0; var2 < this.playerEntities.size(); ++var2) { + EntityPlayer var3 = this.playerEntities.get(var2); + + if (p_152378_1_.equals(var3.getUniqueID())) { + return var3; + } + } + + return null; + } + + /** + * If on MP, sends a quitting packet. + */ + public void sendQuittingDisconnectingPacket() {} + + /** + * Checks whether the session lock file was modified by another process + */ + public void checkSessionLock() throws MinecraftException { + this.saveHandler.checkSessionLock(); + } + + public void func_82738_a(long p_82738_1_) { + this.worldInfo.incrementTotalWorldTime(p_82738_1_); + } + + /** + * Retrieve the world seed from level.dat + */ + public long getSeed() { + return this.worldInfo.getSeed(); + } + + public long getTotalWorldTime() { + return this.worldInfo.getWorldTotalTime(); + } + + public long getWorldTime() { + return this.worldInfo.getWorldTime(); + } + + /** + * Sets the world time. + */ + public void setWorldTime(long p_72877_1_) { + this.worldInfo.setWorldTime(p_72877_1_); + } + + /** + * Returns the coordinates of the spawn point + */ + public ChunkCoordinates getSpawnPoint() { + return new ChunkCoordinates(this.worldInfo.getSpawnX(), this.worldInfo.getSpawnY(), this.worldInfo.getSpawnZ()); + } + + public void setSpawnLocation(int p_72950_1_, int p_72950_2_, int p_72950_3_) { + this.worldInfo.setSpawnPosition(p_72950_1_, p_72950_2_, p_72950_3_); + } + + /** + * spwans an entity and loads surrounding chunks + */ + public void joinEntityInSurroundings(Entity p_72897_1_) { + int var2 = MathHelper.floor_double(p_72897_1_.posX / 16.0D); + int var3 = MathHelper.floor_double(p_72897_1_.posZ / 16.0D); + byte var4 = 2; + + for (int var5 = var2 - var4; var5 <= var2 + var4; ++var5) { + for (int var6 = var3 - var4; var6 <= var3 + var4; ++var6) { + this.getChunkFromChunkCoords(var5, var6); + } + } + + if (!this.loadedEntityList.contains(p_72897_1_)) { + this.loadedEntityList.add(p_72897_1_); + } + } + + /** + * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. + */ + public boolean canMineBlock(EntityPlayer p_72962_1_, int p_72962_2_, int p_72962_3_, int p_72962_4_) { + return true; + } + + /** + * sends a Packet 38 (Entity Status) to all tracked players of that entity + */ + public void setEntityState(Entity p_72960_1_, byte p_72960_2_) {} + + /** + * gets the IChunkProvider this world uses. + */ + public IChunkProvider getChunkProvider() { + return this.chunkProvider; + } + + public void func_147452_c(int p_147452_1_, int p_147452_2_, int p_147452_3_, Block p_147452_4_, int p_147452_5_, int p_147452_6_) { + p_147452_4_.onBlockEventReceived(this, p_147452_1_, p_147452_2_, p_147452_3_, p_147452_5_, p_147452_6_); + } + + /** + * Returns this world's current save handler + */ + public ISaveHandler getSaveHandler() { + return this.saveHandler; + } + + /** + * Gets the World's WorldInfo instance + */ + public WorldInfo getWorldInfo() { + return this.worldInfo; + } + + /** + * Gets the GameRules instance. + */ + public GameRules getGameRules() { + return this.worldInfo.getGameRulesInstance(); + } + + /** + * Updates the flag that indicates whether or not all players in the world are sleeping. + */ + public void updateAllPlayersSleepingFlag() {} + + public float getWeightedThunderStrength(float p_72819_1_) { + return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_); + } + + /** + * Sets the strength of the thunder. + */ + public void setThunderStrength(float p_147442_1_) { + this.prevThunderingStrength = p_147442_1_; + this.thunderingStrength = p_147442_1_; + } + + /** + * Not sure about this actually. Reverting this one myself. + */ + public float getRainStrength(float p_72867_1_) { + return this.prevRainingStrength + (this.rainingStrength - this.prevRainingStrength) * p_72867_1_; + } + + /** + * Sets the strength of the rain. + */ + public void setRainStrength(float p_72894_1_) { + this.prevRainingStrength = p_72894_1_; + this.rainingStrength = p_72894_1_; + } + + /** + * Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9 + */ + public boolean isThundering() { + return (double)this.getWeightedThunderStrength(1.0F) > 0.9D; + } + + /** + * Returns true if the current rain strength is greater than 0.2 + */ + public boolean isRaining() { + return (double)this.getRainStrength(1.0F) > 0.2D; + } + + public boolean canLightningStrikeAt(int p_72951_1_, int p_72951_2_, int p_72951_3_) { + if (!this.isRaining()) { + return false; + } else if (!this.canBlockSeeTheSky(p_72951_1_, p_72951_2_, p_72951_3_)) { + return false; + } else if (this.getPrecipitationHeight(p_72951_1_, p_72951_3_) > p_72951_2_) { + return false; + } else { + BiomeGenBase var4 = this.getBiomeGenForCoords(p_72951_1_, p_72951_3_); + return !var4.getEnableSnow() && (!this.func_147478_e(p_72951_1_, p_72951_2_, p_72951_3_, false) && var4.canSpawnLightningBolt()); + } + } + + /** + * Checks to see if the biome rainfall values for a given x,y,z coordinate set are extremely high + */ + public boolean isBlockHighHumidity(int p_72958_1_, int p_72958_2_, int p_72958_3_) { + BiomeGenBase var4 = this.getBiomeGenForCoords(p_72958_1_, p_72958_3_); + return var4.isHighHumidity(); + } + + /** + * Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same + * id. + */ + public void setItemData(String p_72823_1_, WorldSavedData p_72823_2_) { + this.mapStorage.setData(p_72823_1_, p_72823_2_); + } + + /** + * Loads an existing MapDataBase corresponding to the given String id from disk using the MapStorage, instantiating + * the given Class, or returns null if none such file exists. args: Class to instantiate, String dataid + */ + public WorldSavedData loadItemData(Class p_72943_1_, String p_72943_2_) { + return this.mapStorage.loadData(p_72943_1_, p_72943_2_); + } + + /** + * Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the + * 'idcounts' file. + */ + public int getUniqueDataId(String p_72841_1_) { + return this.mapStorage.getUniqueDataId(p_72841_1_); + } + + public void playBroadcastSound(int p_82739_1_, int p_82739_2_, int p_82739_3_, int p_82739_4_, int p_82739_5_) { + for (int var6 = 0; var6 < this.worldAccesses.size(); ++var6) { + ((IWorldAccess)this.worldAccesses.get(var6)).broadcastSound(p_82739_1_, p_82739_2_, p_82739_3_, p_82739_4_, p_82739_5_); + } + } + + /** + * See description for playAuxSFX. + */ + public void playAuxSFX(int p_72926_1_, int p_72926_2_, int p_72926_3_, int p_72926_4_, int p_72926_5_) { + this.playAuxSFXAtEntity(null, p_72926_1_, p_72926_2_, p_72926_3_, p_72926_4_, p_72926_5_); + } + + /** + * See description for playAuxSFX. + */ + public void playAuxSFXAtEntity(EntityPlayer p_72889_1_, int p_72889_2_, int p_72889_3_, int p_72889_4_, int p_72889_5_, int p_72889_6_) { + try { + for (int var7 = 0; var7 < this.worldAccesses.size(); ++var7) { + ((IWorldAccess)this.worldAccesses.get(var7)).playAuxSFX(p_72889_1_, p_72889_2_, p_72889_3_, p_72889_4_, p_72889_5_, p_72889_6_); + } + } catch (Throwable var10) { + CrashReport var8 = CrashReport.makeCrashReport(var10, "Playing level event"); + CrashReportCategory var9 = var8.makeCategory("Level event being played"); + var9.addCrashSection("Block coordinates", CrashReportCategory.getLocationInfo(p_72889_3_, p_72889_4_, p_72889_5_)); + var9.addCrashSection("Event source", p_72889_1_); + var9.addCrashSection("Event type", Integer.valueOf(p_72889_2_)); + var9.addCrashSection("Event data", Integer.valueOf(p_72889_6_)); + throw new ReportedException(var8); + } + } + + /** + * Returns current world height. + */ + public int getHeight() { + return 256; + } + + /** + * Returns current world height. + */ + public int getActualHeight() { + return this.provider.hasNoSky ? 128 : 256; + } + + /** + * puts the World Random seed to a specific state dependant on the inputs + */ + public Random setRandomSeed(int p_72843_1_, int p_72843_2_, int p_72843_3_) { + long var4 = (long)p_72843_1_ * 341873128712L + (long)p_72843_2_ * 132897987541L + this.getWorldInfo().getSeed() + (long)p_72843_3_; + this.rand.setSeed(var4); + return this.rand; + } + + /** + * Returns the location of the closest structure of the specified type. If not found returns null. + */ + public ChunkPosition findClosestStructure(String p_147440_1_, int p_147440_2_, int p_147440_3_, int p_147440_4_) { + return this.getChunkProvider().func_147416_a(this, p_147440_1_, p_147440_2_, p_147440_3_, p_147440_4_); + } + + /** + * set by !chunk.getAreLevelsEmpty + */ + public boolean extendedLevelsInChunkCache() { + return false; + } + + /** + * Returns horizon height for use in rendering the sky. + */ + public double getHorizon() { + return this.worldInfo.getTerrainType() == WorldType.FLAT ? 0.0D : 63.0D; + } + + /** + * Adds some basic stats of the world to the given crash report. + */ + public CrashReportCategory addWorldInfoToCrashReport(CrashReport p_72914_1_) { + CrashReportCategory var2 = p_72914_1_.makeCategoryDepth("Affected level", 1); + var2.addCrashSection("Level name", this.worldInfo == null ? "????" : this.worldInfo.getWorldName()); + var2.addCrashSectionCallable("All players", new Callable() { + + public String call() { + return World.this.playerEntities.size() + " total; " + World.this.playerEntities; + } + }); + var2.addCrashSectionCallable("Chunk stats", new Callable() { + + public String call() { + return World.this.chunkProvider.makeString(); + } + }); + + try { + this.worldInfo.addToCrashReport(var2); + } catch (Throwable var4) { + var2.addCrashSectionThrowable("Level Data Unobtainable", var4); + } + + return var2; + } + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value. + */ + public void destroyBlockInWorldPartially(int p_147443_1_, int p_147443_2_, int p_147443_3_, int p_147443_4_, int p_147443_5_) { + for (int var6 = 0; var6 < this.worldAccesses.size(); ++var6) { + IWorldAccess var7 = (IWorldAccess)this.worldAccesses.get(var6); + var7.destroyBlockPartially(p_147443_1_, p_147443_2_, p_147443_3_, p_147443_4_, p_147443_5_); + } + } + + /** + * returns a calendar object containing the current date + */ + public Calendar getCurrentDate() { + if (this.getTotalWorldTime() % 600L == 0L) { + this.theCalendar.setTimeInMillis(MinecraftServer.getSystemTimeMillis()); + } + + return this.theCalendar; + } + + public void makeFireworks(double p_92088_1_, double p_92088_3_, double p_92088_5_, double p_92088_7_, double p_92088_9_, double p_92088_11_, NBTTagCompound p_92088_13_) {} + + public Scoreboard getScoreboard() { + return this.worldScoreboard; + } + + public void func_147453_f(int p_147453_1_, int p_147453_2_, int p_147453_3_, Block p_147453_4_) { + for (int var5 = 0; var5 < 4; ++var5) { + int var6 = p_147453_1_ + Direction.offsetX[var5]; + int var7 = p_147453_3_ + Direction.offsetZ[var5]; + Block var8 = this.getBlock(var6, p_147453_2_, var7); + + if (Blocks.unpowered_comparator.func_149907_e(var8)) { + var8.onNeighborBlockChange(this, var6, p_147453_2_, var7, p_147453_4_); + } else if (var8.isNormalCube()) { + var6 += Direction.offsetX[var5]; + var7 += Direction.offsetZ[var5]; + Block var9 = this.getBlock(var6, p_147453_2_, var7); + + if (Blocks.unpowered_comparator.func_149907_e(var9)) { + var9.onNeighborBlockChange(this, var6, p_147453_2_, var7, p_147453_4_); + } + } + } + } + + public float func_147462_b(double p_147462_1_, double p_147462_3_, double p_147462_5_) { + return this.func_147473_B(MathHelper.floor_double(p_147462_1_), MathHelper.floor_double(p_147462_3_), MathHelper.floor_double(p_147462_5_)); + } + + public float func_147473_B(int p_147473_1_, int p_147473_2_, int p_147473_3_) { + float var4 = 0.0F; + boolean var5 = this.difficultySetting == EnumDifficulty.HARD; + + if (this.blockExists(p_147473_1_, p_147473_2_, p_147473_3_)) { + float var6 = this.getCurrentMoonPhaseFactor(); + var4 += MathHelper.clamp_float((float)this.getChunkFromBlockCoords(p_147473_1_, p_147473_3_).inhabitedTime / 3600000.0F, 0.0F, 1.0F) * (var5 ? 1.0F : 0.75F); + var4 += var6 * 0.25F; + } + + if (this.difficultySetting == EnumDifficulty.EASY || this.difficultySetting == EnumDifficulty.PEACEFUL) { + var4 *= (float)this.difficultySetting.getDifficultyId() / 2.0F; + } + + return MathHelper.clamp_float(var4, 0.0F, var5 ? 1.5F : 1.0F); + } + + public void func_147450_X() { + Iterator var1 = this.worldAccesses.iterator(); + + while (var1.hasNext()) { + IWorldAccess var2 = (IWorldAccess)var1.next(); + var2.onStaticEntitiesChanged(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldManager.java new file mode 100644 index 0000000..290da91 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldManager.java @@ -0,0 +1,118 @@ +package net.minecraft.world; + +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.server.MinecraftServer; + +public class WorldManager implements IWorldAccess { + /** Reference to the MinecraftServer object. */ + private final MinecraftServer mcServer; + + /** The WorldServer object. */ + private final WorldServer theWorldServer; + + + public WorldManager(MinecraftServer p_i1517_1_, WorldServer p_i1517_2_) { + this.mcServer = p_i1517_1_; + this.theWorldServer = p_i1517_2_; + } + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + public void spawnParticle(String p_72708_1_, double p_72708_2_, double p_72708_4_, double p_72708_6_, double p_72708_8_, double p_72708_10_, double p_72708_12_) {} + + /** + * Called on all IWorldAccesses when an entity is created or loaded. On com.cheatbreaker.client worlds, starts downloading any + * necessary textures. On server worlds, adds the entity to the entity tracker. + */ + public void onEntityCreate(Entity p_72703_1_) { + this.theWorldServer.getEntityTracker().addEntityToTracker(p_72703_1_); + } + + /** + * Called on all IWorldAccesses when an entity is unloaded or destroyed. On com.cheatbreaker.client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the entity tracker. + */ + public void onEntityDestroy(Entity p_72709_1_) { + this.theWorldServer.getEntityTracker().removeEntityFromAllTrackingPlayers(p_72709_1_); + } + + /** + * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch + */ + public void playSound(String p_72704_1_, double p_72704_2_, double p_72704_4_, double p_72704_6_, float p_72704_8_, float p_72704_9_) { + this.mcServer.getConfigurationManager().func_148541_a(p_72704_2_, p_72704_4_, p_72704_6_, p_72704_8_ > 1.0F ? (double)(16.0F * p_72704_8_) : 16.0D, this.theWorldServer.provider.dimensionId, new S29PacketSoundEffect(p_72704_1_, p_72704_2_, p_72704_4_, p_72704_6_, p_72704_8_, p_72704_9_)); + } + + /** + * Plays sound to all near players except the player reference given + */ + public void playSoundToNearExcept(EntityPlayer p_85102_1_, String p_85102_2_, double p_85102_3_, double p_85102_5_, double p_85102_7_, float p_85102_9_, float p_85102_10_) { + this.mcServer.getConfigurationManager().func_148543_a(p_85102_1_, p_85102_3_, p_85102_5_, p_85102_7_, p_85102_9_ > 1.0F ? (double)(16.0F * p_85102_9_) : 16.0D, this.theWorldServer.provider.dimensionId, new S29PacketSoundEffect(p_85102_2_, p_85102_3_, p_85102_5_, p_85102_7_, p_85102_9_, p_85102_10_)); + } + + /** + * On the com.cheatbreaker.client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + public void markBlockRangeForRenderUpdate(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) {} + + /** + * On the com.cheatbreaker.client, re-renders the block. On the server, sends the block to the com.cheatbreaker.client (which will re-render it), + * including the tile entity description packet if applicable. Args: x, y, z + */ + public void markBlockForUpdate(int p_147586_1_, int p_147586_2_, int p_147586_3_) { + this.theWorldServer.getPlayerManager().func_151250_a(p_147586_1_, p_147586_2_, p_147586_3_); + } + + /** + * On the com.cheatbreaker.client, re-renders this block. On the server, does nothing. Used for lighting updates. + */ + public void markBlockForRenderUpdate(int p_147588_1_, int p_147588_2_, int p_147588_3_) {} + + /** + * Plays the specified record. Arg: recordName, x, y, z + */ + public void playRecord(String p_72702_1_, int p_72702_2_, int p_72702_3_, int p_72702_4_) {} + + /** + * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). + */ + public void playAuxSFX(EntityPlayer p_72706_1_, int p_72706_2_, int p_72706_3_, int p_72706_4_, int p_72706_5_, int p_72706_6_) { + this.mcServer.getConfigurationManager().func_148543_a(p_72706_1_, p_72706_3_, p_72706_4_, p_72706_5_, 64.0D, this.theWorldServer.provider.dimensionId, new S28PacketEffect(p_72706_2_, p_72706_3_, p_72706_4_, p_72706_5_, p_72706_6_, false)); + } + + public void broadcastSound(int p_82746_1_, int p_82746_2_, int p_82746_3_, int p_82746_4_, int p_82746_5_) { + this.mcServer.getConfigurationManager().func_148540_a(new S28PacketEffect(p_82746_1_, p_82746_2_, p_82746_3_, p_82746_4_, p_82746_5_, true)); + } + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value + */ + public void destroyBlockPartially(int p_147587_1_, int p_147587_2_, int p_147587_3_, int p_147587_4_, int p_147587_5_) { + Iterator var6 = this.mcServer.getConfigurationManager().playerEntityList.iterator(); + + while (var6.hasNext()) { + EntityPlayerMP var7 = (EntityPlayerMP)var6.next(); + + if (var7 != null && var7.worldObj == this.theWorldServer && var7.getEntityId() != p_147587_1_) { + double var8 = (double)p_147587_2_ - var7.posX; + double var10 = (double)p_147587_3_ - var7.posY; + double var12 = (double)p_147587_4_ - var7.posZ; + + if (var8 * var8 + var10 * var10 + var12 * var12 < 1024.0D) { + var7.playerNetServerHandler.sendPacket(new S25PacketBlockBreakAnim(p_147587_1_, p_147587_2_, p_147587_3_, p_147587_4_, p_147587_5_)); + } + } + } + } + + public void onStaticEntitiesChanged() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProvider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProvider.java new file mode 100644 index 0000000..03b956c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProvider.java @@ -0,0 +1,233 @@ +package net.minecraft.world; + +import net.minecraft.init.Blocks; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderFlat; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.FlatGeneratorInfo; + +public abstract class WorldProvider { + public static final float[] moonPhaseFactors = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F}; + + /** world object being used */ + public World worldObj; + public WorldType terrainType; + public String field_82913_c; + + /** World chunk manager being used to generate chunks */ + public WorldChunkManager worldChunkMgr; + + /** + * States whether the Hell world provider is used(true) or if the normal world provider is used(false) + */ + public boolean isHellWorld; + + /** + * A boolean that tells if a world does not have a sky. Used in calculating weather and skylight + */ + public boolean hasNoSky; + + /** Light to brightness conversion table */ + public float[] lightBrightnessTable = new float[16]; + + /** The id for the dimension (ex. -1: Nether, 0: Overworld, 1: The End) */ + public int dimensionId; + + /** Array for sunrise/sunset colors (RGBA) */ + private final float[] colorsSunriseSunset = new float[4]; + + + /** + * associate an existing world with a World provider, and setup its lightbrightness table + */ + public final void registerWorld(World p_76558_1_) { + this.worldObj = p_76558_1_; + this.terrainType = p_76558_1_.getWorldInfo().getTerrainType(); + this.field_82913_c = p_76558_1_.getWorldInfo().getGeneratorOptions(); + this.registerWorldChunkManager(); + this.generateLightBrightnessTable(); + } + + /** + * Creates the light to brightness table + */ + protected void generateLightBrightnessTable() { + float var1 = 0.0F; + + for (int var2 = 0; var2 <= 15; ++var2) { + float var3 = 1.0F - (float)var2 / 15.0F; + this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1; + } + } + + /** + * creates a new world chunk manager for WorldProvider + */ + protected void registerWorldChunkManager() { + if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT) { + FlatGeneratorInfo var1 = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.func_150568_d(var1.getBiome()), 0.5F); + } else { + this.worldChunkMgr = new WorldChunkManager(this.worldObj); + } + } + + /** + * Returns a new chunk provider which generates chunks for this world + */ + public IChunkProvider createChunkGenerator() { + return this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.field_82913_c) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled()); + } + + /** + * Will check if the x, z position specified is alright to be set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int p_76566_1_, int p_76566_2_) { + return this.worldObj.getTopBlock(p_76566_1_, p_76566_2_) == Blocks.grass; + } + + /** + * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) + */ + public float calculateCelestialAngle(long p_76563_1_, float p_76563_3_) { + int var4 = (int)(p_76563_1_ % 24000L); + float var5 = ((float)var4 + p_76563_3_) / 24000.0F - 0.25F; + + if (var5 < 0.0F) { + ++var5; + } + + if (var5 > 1.0F) { + --var5; + } + + float var6 = var5; + var5 = 1.0F - (float)((Math.cos((double)var5 * Math.PI) + 1.0D) / 2.0D); + var5 = var6 + (var5 - var6) / 3.0F; + return var5; + } + + public int getMoonPhase(long p_76559_1_) { + return (int)(p_76559_1_ / 24000L % 8L + 8L) % 8; + } + + /** + * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() { + return true; + } + + /** + * Returns array with sunrise/sunset colors + */ + public float[] calcSunriseSunsetColors(float p_76560_1_, float p_76560_2_) { + float var3 = 0.4F; + float var4 = MathHelper.cos(p_76560_1_ * (float)Math.PI * 2.0F) - 0.0F; + float var5 = -0.0F; + + if (var4 >= var5 - var3 && var4 <= var5 + var3) { + float var6 = (var4 - var5) / var3 * 0.5F + 0.5F; + float var7 = 1.0F - (1.0F - MathHelper.sin(var6 * (float)Math.PI)) * 0.99F; + var7 *= var7; + this.colorsSunriseSunset[0] = var6 * 0.3F + 0.7F; + this.colorsSunriseSunset[1] = var6 * var6 * 0.7F + 0.2F; + this.colorsSunriseSunset[2] = var6 * var6 * 0.0F + 0.2F; + this.colorsSunriseSunset[3] = var7; + return this.colorsSunriseSunset; + } else { + return null; + } + } + + /** + * Return Vec3D with biome specific fog color + */ + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) { + float var3 = MathHelper.cos(p_76562_1_ * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (var3 < 0.0F) { + var3 = 0.0F; + } + + if (var3 > 1.0F) { + var3 = 1.0F; + } + + float var4 = 0.7529412F; + float var5 = 0.84705883F; + float var6 = 1.0F; + var4 *= var3 * 0.94F + 0.06F; + var5 *= var3 * 0.94F + 0.06F; + var6 *= var3 * 0.91F + 0.09F; + return Vec3.createVectorHelper(var4, var5, var6); + } + + /** + * True if the player can respawn in this dimension (true = overworld, false = nether). + */ + public boolean canRespawnHere() { + return true; + } + + public static WorldProvider getProviderForDimension(int p_76570_0_) { + return p_76570_0_ == -1 ? new WorldProviderHell() : (p_76570_0_ == 0 ? new WorldProviderSurface() : (p_76570_0_ == 1 ? new WorldProviderEnd() : null)); + } + + /** + * the y level at which clouds are rendered. + */ + public float getCloudHeight() { + return 128.0F; + } + + public boolean isSkyColored() { + return true; + } + + /** + * Gets the hard-coded portal location to use when entering this dimension. + */ + public ChunkCoordinates getEntrancePortalLocation() { + return null; + } + + public int getAverageGroundLevel() { + return this.terrainType == WorldType.FLAT ? 4 : 64; + } + + /** + * returns true if this dimension is supposed to display void particles and pull in the far plane based on the + * user's Y offset. + */ + public boolean getWorldHasVoidParticles() { + return this.terrainType != WorldType.FLAT && !this.hasNoSky; + } + + /** + * Returns a double value representing the Y value relative to the top of the map at which void fog is at its + * maximum. The default factor of 0.03125 relative to 256, for example, means the void fog will be at its maximum at + * (256*0.03125), or 8. + */ + public double getVoidFogYFactor() { + return this.terrainType == WorldType.FLAT ? 1.0D : 0.03125D; + } + + /** + * Returns true if the given X,Z coordinate should show environmental fog. + */ + public boolean doesXZShowFog(int p_76568_1_, int p_76568_2_) { + return false; + } + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public abstract String getDimensionName(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderEnd.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderEnd.java new file mode 100644 index 0000000..90f8aaa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderEnd.java @@ -0,0 +1,124 @@ +package net.minecraft.world; + +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderEnd; + +public class WorldProviderEnd extends WorldProvider { + + + /** + * creates a new world chunk manager for WorldProvider + */ + public void registerWorldChunkManager() { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F); + this.dimensionId = 1; + this.hasNoSky = true; + } + + /** + * Returns a new chunk provider which generates chunks for this world + */ + public IChunkProvider createChunkGenerator() { + return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); + } + + /** + * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) + */ + public float calculateCelestialAngle(long p_76563_1_, float p_76563_3_) { + return 0.0F; + } + + /** + * Returns array with sunrise/sunset colors + */ + public float[] calcSunriseSunsetColors(float p_76560_1_, float p_76560_2_) { + return null; + } + + /** + * Return Vec3D with biome specific fog color + */ + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) { + int var3 = 10518688; + float var4 = MathHelper.cos(p_76562_1_ * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (var4 < 0.0F) { + var4 = 0.0F; + } + + if (var4 > 1.0F) { + var4 = 1.0F; + } + + float var5 = (float)(var3 >> 16 & 255) / 255.0F; + float var6 = (float)(var3 >> 8 & 255) / 255.0F; + float var7 = (float)(var3 & 255) / 255.0F; + var5 *= var4 * 0.0F + 0.15F; + var6 *= var4 * 0.0F + 0.15F; + var7 *= var4 * 0.0F + 0.15F; + return Vec3.createVectorHelper(var5, var6, var7); + } + + public boolean isSkyColored() { + return false; + } + + /** + * True if the player can respawn in this dimension (true = overworld, false = nether). + */ + public boolean canRespawnHere() { + return false; + } + + /** + * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() { + return false; + } + + /** + * the y level at which clouds are rendered. + */ + public float getCloudHeight() { + return 8.0F; + } + + /** + * Will check if the x, z position specified is alright to be set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int p_76566_1_, int p_76566_2_) { + return this.worldObj.getTopBlock(p_76566_1_, p_76566_2_).getMaterial().blocksMovement(); + } + + /** + * Gets the hard-coded portal location to use when entering this dimension. + */ + public ChunkCoordinates getEntrancePortalLocation() { + return new ChunkCoordinates(100, 50, 0); + } + + public int getAverageGroundLevel() { + return 50; + } + + /** + * Returns true if the given X,Z coordinate should show environmental fog. + */ + public boolean doesXZShowFog(int p_76568_1_, int p_76568_2_) { + return true; + } + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public String getDimensionName() { + return "The End"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderHell.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderHell.java new file mode 100644 index 0000000..9379bcf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderHell.java @@ -0,0 +1,89 @@ +package net.minecraft.world; + +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderHell; + +public class WorldProviderHell extends WorldProvider { + + + /** + * creates a new world chunk manager for WorldProvider + */ + public void registerWorldChunkManager() { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F); + this.isHellWorld = true; + this.hasNoSky = true; + this.dimensionId = -1; + } + + /** + * Return Vec3D with biome specific fog color + */ + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) { + return Vec3.createVectorHelper(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D); + } + + /** + * Creates the light to brightness table + */ + protected void generateLightBrightnessTable() { + float var1 = 0.1F; + + for (int var2 = 0; var2 <= 15; ++var2) { + float var3 = 1.0F - (float)var2 / 15.0F; + this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1; + } + } + + /** + * Returns a new chunk provider which generates chunks for this world + */ + public IChunkProvider createChunkGenerator() { + return new ChunkProviderHell(this.worldObj, this.worldObj.getSeed()); + } + + /** + * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() { + return false; + } + + /** + * Will check if the x, z position specified is alright to be set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int p_76566_1_, int p_76566_2_) { + return false; + } + + /** + * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) + */ + public float calculateCelestialAngle(long p_76563_1_, float p_76563_3_) { + return 0.5F; + } + + /** + * True if the player can respawn in this dimension (true = overworld, false = nether). + */ + public boolean canRespawnHere() { + return false; + } + + /** + * Returns true if the given X,Z coordinate should show environmental fog. + */ + public boolean doesXZShowFog(int p_76568_1_, int p_76568_2_) { + return true; + } + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public String getDimensionName() { + return "Nether"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderSurface.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderSurface.java new file mode 100644 index 0000000..67868e7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldProviderSurface.java @@ -0,0 +1,12 @@ +package net.minecraft.world; + +public class WorldProviderSurface extends WorldProvider { + + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public String getDimensionName() { + return "Overworld"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldSavedData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldSavedData.java new file mode 100644 index 0000000..82dd6de --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldSavedData.java @@ -0,0 +1,47 @@ +package net.minecraft.world; + +import net.minecraft.nbt.NBTTagCompound; + +public abstract class WorldSavedData { + /** The name of the map data nbt */ + public final String mapName; + + /** Whether this MapDataBase needs saving to disk. */ + private boolean dirty; + + + public WorldSavedData(String mapName) { + this.mapName = mapName; + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public abstract void readFromNBT(NBTTagCompound nbt); + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public abstract void writeToNBT(NBTTagCompound nbt); + + /** + * Marks this MapDataBase dirty, to be saved to disk when the level next saves. + */ + public void markDirty() { + this.setDirty(true); + } + + /** + * Sets the dirty state of this MapDataBase, whether it needs saving to disk. + */ + public void setDirty(boolean dirty) { + this.dirty = dirty; + } + + /** + * Whether this MapDataBase needs saving to disk. + */ + public boolean isDirty() { + return this.dirty; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldServer.java new file mode 100644 index 0000000..9eef9a3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldServer.java @@ -0,0 +1,930 @@ +package net.minecraft.world; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.TreeSet; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEventData; +import net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityTracker; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.INpc; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityWaterMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.ScoreboardSaveData; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.PlayerManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraft.world.gen.feature.WorldGeneratorBonusChest; +import net.minecraft.world.storage.ISaveHandler; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class WorldServer extends World { + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer mcServer; + private final EntityTracker theEntityTracker; + private final PlayerManager thePlayerManager; + private Set pendingTickListEntriesHashSet; + + /** All work to do in future ticks. */ + private TreeSet pendingTickListEntriesTreeSet; + public ChunkProviderServer theChunkProviderServer; + + /** Whether or not level saving is enabled */ + public boolean levelSaving; + + /** is false if there are no players */ + private boolean allPlayersSleeping; + private int updateEntityTick; + + /** + * the teleporter to use when the entity is being transferred into the dimension + */ + private final Teleporter worldTeleporter; + private final SpawnerAnimals animalSpawner = new SpawnerAnimals(); + private final WorldServer.ServerBlockEventList[] field_147490_S = new WorldServer.ServerBlockEventList[] {new WorldServer.ServerBlockEventList(null), new WorldServer.ServerBlockEventList(null)}; + private int field_147489_T; + private static final WeightedRandomChestContent[] bonusChestContent = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.stick, 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.planks), 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log), 0, 1, 3, 10), new WeightedRandomChestContent(Items.stone_axe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_axe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.stone_pickaxe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.apple, 0, 2, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 2, 3, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log2), 0, 1, 3, 10)}; + private final List pendingTickListEntriesThisTick = new ArrayList(); + + /** An IntHashMap of entity IDs (integers) to their Entity objects. */ + private IntHashMap entityIdMap; + + + public WorldServer(MinecraftServer p_i45284_1_, ISaveHandler p_i45284_2_, String p_i45284_3_, int p_i45284_4_, WorldSettings p_i45284_5_, Profiler p_i45284_6_) { + super(p_i45284_2_, p_i45284_3_, p_i45284_5_, WorldProvider.getProviderForDimension(p_i45284_4_), p_i45284_6_); + this.mcServer = p_i45284_1_; + this.theEntityTracker = new EntityTracker(this); + this.thePlayerManager = new PlayerManager(this); + + if (this.entityIdMap == null) { + this.entityIdMap = new IntHashMap(); + } + + if (this.pendingTickListEntriesHashSet == null) { + this.pendingTickListEntriesHashSet = new HashSet(); + } + + if (this.pendingTickListEntriesTreeSet == null) { + this.pendingTickListEntriesTreeSet = new TreeSet(); + } + + this.worldTeleporter = new Teleporter(this); + this.worldScoreboard = new ServerScoreboard(p_i45284_1_); + ScoreboardSaveData var7 = (ScoreboardSaveData)this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard"); + + if (var7 == null) { + var7 = new ScoreboardSaveData(); + this.mapStorage.setData("scoreboard", var7); + } + + var7.func_96499_a(this.worldScoreboard); + ((ServerScoreboard)this.worldScoreboard).func_96547_a(var7); + } + + /** + * Runs a single tick for the world + */ + public void tick() { + super.tick(); + + if (this.getWorldInfo().isHardcoreModeEnabled() && this.difficultySetting != EnumDifficulty.HARD) { + this.difficultySetting = EnumDifficulty.HARD; + } + + this.provider.worldChunkMgr.cleanupCache(); + + if (this.areAllPlayersAsleep()) { + if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { + long var1 = this.worldInfo.getWorldTime() + 24000L; + this.worldInfo.setWorldTime(var1 - var1 % 24000L); + } + + this.wakeAllPlayers(); + } + + this.theProfiler.startSection("mobSpawner"); + + if (this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) { + this.animalSpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getWorldTotalTime() % 400L == 0L); + } + + this.theProfiler.endStartSection("chunkSource"); + this.chunkProvider.unloadQueuedChunks(); + int var3 = this.calculateSkylightSubtracted(1.0F); + + if (var3 != this.skylightSubtracted) { + this.skylightSubtracted = var3; + } + + this.worldInfo.incrementTotalWorldTime(this.worldInfo.getWorldTotalTime() + 1L); + + if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { + this.worldInfo.setWorldTime(this.worldInfo.getWorldTime() + 1L); + } + + this.theProfiler.endStartSection("tickPending"); + this.tickUpdates(false); + this.theProfiler.endStartSection("tickBlocks"); + this.func_147456_g(); + this.theProfiler.endStartSection("chunkMap"); + this.thePlayerManager.updatePlayerInstances(); + this.theProfiler.endStartSection("village"); + this.villageCollectionObj.tick(); + this.villageSiegeObj.tick(); + this.theProfiler.endStartSection("portalForcer"); + this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime()); + this.theProfiler.endSection(); + this.func_147488_Z(); + } + + /** + * only spawns creatures allowed by the chunkProvider + */ + public BiomeGenBase.SpawnListEntry spawnRandomCreature(EnumCreatureType p_73057_1_, int p_73057_2_, int p_73057_3_, int p_73057_4_) { + List var5 = this.getChunkProvider().getPossibleCreatures(p_73057_1_, p_73057_2_, p_73057_3_, p_73057_4_); + return var5 != null && !var5.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(this.rand, var5) : null; + } + + /** + * Updates the flag that indicates whether or not all players in the world are sleeping. + */ + public void updateAllPlayersSleepingFlag() { + this.allPlayersSleeping = !this.playerEntities.isEmpty(); + Iterator var1 = this.playerEntities.iterator(); + + while (var1.hasNext()) { + EntityPlayer var2 = (EntityPlayer)var1.next(); + + if (!var2.isPlayerSleeping()) { + this.allPlayersSleeping = false; + break; + } + } + } + + protected void wakeAllPlayers() { + this.allPlayersSleeping = false; + Iterator var1 = this.playerEntities.iterator(); + + while (var1.hasNext()) { + EntityPlayer var2 = (EntityPlayer)var1.next(); + + if (var2.isPlayerSleeping()) { + var2.wakeUpPlayer(false, false, true); + } + } + + this.resetRainAndThunder(); + } + + private void resetRainAndThunder() { + this.worldInfo.setRainTime(0); + this.worldInfo.setRaining(false); + this.worldInfo.setThunderTime(0); + this.worldInfo.setThundering(false); + } + + public boolean areAllPlayersAsleep() { + if (this.allPlayersSleeping && !this.isClient) { + Iterator var1 = this.playerEntities.iterator(); + EntityPlayer var2; + + do { + if (!var1.hasNext()) { + return true; + } + + var2 = (EntityPlayer)var1.next(); + } + while (var2.isPlayerFullyAsleep()); + + return false; + } else { + return false; + } + } + + /** + * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk. + */ + public void setSpawnLocation() { + if (this.worldInfo.getSpawnY() <= 0) { + this.worldInfo.setSpawnY(64); + } + + int var1 = this.worldInfo.getSpawnX(); + int var2 = this.worldInfo.getSpawnZ(); + int var3 = 0; + + while (this.getTopBlock(var1, var2).getMaterial() == Material.air) { + var1 += this.rand.nextInt(8) - this.rand.nextInt(8); + var2 += this.rand.nextInt(8) - this.rand.nextInt(8); + ++var3; + + if (var3 == 10000) { + break; + } + } + + this.worldInfo.setSpawnX(var1); + this.worldInfo.setSpawnZ(var2); + } + + protected void func_147456_g() { + super.func_147456_g(); + int var1 = 0; + int var2 = 0; + Iterator var3 = this.activeChunkSet.iterator(); + + while (var3.hasNext()) { + ChunkCoordIntPair var4 = (ChunkCoordIntPair)var3.next(); + int var5 = var4.chunkXPos * 16; + int var6 = var4.chunkZPos * 16; + this.theProfiler.startSection("getChunk"); + Chunk var7 = this.getChunkFromChunkCoords(var4.chunkXPos, var4.chunkZPos); + this.func_147467_a(var5, var6, var7); + this.theProfiler.endStartSection("tickChunk"); + var7.func_150804_b(false); + this.theProfiler.endStartSection("thunder"); + int var8; + int var9; + int var10; + int var11; + + if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + var8 = this.updateLCG >> 2; + var9 = var5 + (var8 & 15); + var10 = var6 + (var8 >> 8 & 15); + var11 = this.getPrecipitationHeight(var9, var10); + + if (this.canLightningStrikeAt(var9, var11, var10)) { + this.addWeatherEffect(new EntityLightningBolt(this, var9, var11, var10)); + } + } + + this.theProfiler.endStartSection("iceandsnow"); + + if (this.rand.nextInt(16) == 0) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + var8 = this.updateLCG >> 2; + var9 = var8 & 15; + var10 = var8 >> 8 & 15; + var11 = this.getPrecipitationHeight(var9 + var5, var10 + var6); + + if (this.isBlockFreezableNaturally(var9 + var5, var11 - 1, var10 + var6)) { + this.setBlock(var9 + var5, var11 - 1, var10 + var6, Blocks.ice); + } + + if (this.isRaining() && this.func_147478_e(var9 + var5, var11, var10 + var6, true)) { + this.setBlock(var9 + var5, var11, var10 + var6, Blocks.snow_layer); + } + + if (this.isRaining()) { + BiomeGenBase var12 = this.getBiomeGenForCoords(var9 + var5, var10 + var6); + + if (var12.canSpawnLightningBolt()) { + this.getBlock(var9 + var5, var11 - 1, var10 + var6).fillWithRain(this, var9 + var5, var11 - 1, var10 + var6); + } + } + } + + this.theProfiler.endStartSection("tickBlocks"); + ExtendedBlockStorage[] var18 = var7.getBlockStorageArray(); + var9 = var18.length; + + for (var10 = 0; var10 < var9; ++var10) { + ExtendedBlockStorage var19 = var18[var10]; + + if (var19 != null && var19.getNeedsRandomTick()) { + for (int var20 = 0; var20 < 3; ++var20) { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int var13 = this.updateLCG >> 2; + int var14 = var13 & 15; + int var15 = var13 >> 8 & 15; + int var16 = var13 >> 16 & 15; + ++var2; + Block var17 = var19.func_150819_a(var14, var16, var15); + + if (var17.getTickRandomly()) { + ++var1; + var17.updateTick(this, var14 + var5, var16 + var19.getYLocation(), var15 + var6, this.rand); + } + } + } + } + + this.theProfiler.endSection(); + } + } + + public boolean func_147477_a(int p_147477_1_, int p_147477_2_, int p_147477_3_, Block p_147477_4_) { + NextTickListEntry var5 = new NextTickListEntry(p_147477_1_, p_147477_2_, p_147477_3_, p_147477_4_); + return this.pendingTickListEntriesThisTick.contains(var5); + } + + /** + * Schedules a tick to a block with a delay (Most commonly the tick rate) + */ + public void scheduleBlockUpdate(int p_147464_1_, int p_147464_2_, int p_147464_3_, Block p_147464_4_, int p_147464_5_) { + this.func_147454_a(p_147464_1_, p_147464_2_, p_147464_3_, p_147464_4_, p_147464_5_, 0); + } + + public void func_147454_a(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) { + NextTickListEntry var7 = new NextTickListEntry(p_147454_1_, p_147454_2_, p_147454_3_, p_147454_4_); + byte var8 = 0; + + if (this.scheduledUpdatesAreImmediate && p_147454_4_.getMaterial() != Material.air) { + if (p_147454_4_.func_149698_L()) { + var8 = 8; + + if (this.checkChunksExist(var7.xCoord - var8, var7.yCoord - var8, var7.zCoord - var8, var7.xCoord + var8, var7.yCoord + var8, var7.zCoord + var8)) { + Block var9 = this.getBlock(var7.xCoord, var7.yCoord, var7.zCoord); + + if (var9.getMaterial() != Material.air && var9 == var7.func_151351_a()) { + var9.updateTick(this, var7.xCoord, var7.yCoord, var7.zCoord, this.rand); + } + } + + return; + } + + p_147454_5_ = 1; + } + + if (this.checkChunksExist(p_147454_1_ - var8, p_147454_2_ - var8, p_147454_3_ - var8, p_147454_1_ + var8, p_147454_2_ + var8, p_147454_3_ + var8)) { + if (p_147454_4_.getMaterial() != Material.air) { + var7.setScheduledTime((long)p_147454_5_ + this.worldInfo.getWorldTotalTime()); + var7.setPriority(p_147454_6_); + } + + if (!this.pendingTickListEntriesHashSet.contains(var7)) { + this.pendingTickListEntriesHashSet.add(var7); + this.pendingTickListEntriesTreeSet.add(var7); + } + } + } + + public void func_147446_b(int p_147446_1_, int p_147446_2_, int p_147446_3_, Block p_147446_4_, int p_147446_5_, int p_147446_6_) { + NextTickListEntry var7 = new NextTickListEntry(p_147446_1_, p_147446_2_, p_147446_3_, p_147446_4_); + var7.setPriority(p_147446_6_); + + if (p_147446_4_.getMaterial() != Material.air) { + var7.setScheduledTime((long)p_147446_5_ + this.worldInfo.getWorldTotalTime()); + } + + if (!this.pendingTickListEntriesHashSet.contains(var7)) { + this.pendingTickListEntriesHashSet.add(var7); + this.pendingTickListEntriesTreeSet.add(var7); + } + } + + /** + * Updates (and cleans up) entities and tile entities + */ + public void updateEntities() { + if (this.playerEntities.isEmpty()) { + if (this.updateEntityTick++ >= 1200) { + return; + } + } else { + this.resetUpdateEntityTick(); + } + + super.updateEntities(); + } + + /** + * Resets the updateEntityTick field to 0 + */ + public void resetUpdateEntityTick() { + this.updateEntityTick = 0; + } + + /** + * Runs through the list of updates to run and ticks them + */ + public boolean tickUpdates(boolean p_72955_1_) { + int var2 = this.pendingTickListEntriesTreeSet.size(); + + if (var2 != this.pendingTickListEntriesHashSet.size()) { + throw new IllegalStateException("TickNextTick list out of synch"); + } else { + if (var2 > 1000) { + var2 = 1000; + } + + this.theProfiler.startSection("cleaning"); + NextTickListEntry var4; + + for (int var3 = 0; var3 < var2; ++var3) { + var4 = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first(); + + if (!p_72955_1_ && var4.scheduledTime > this.worldInfo.getWorldTotalTime()) { + break; + } + + this.pendingTickListEntriesTreeSet.remove(var4); + this.pendingTickListEntriesHashSet.remove(var4); + this.pendingTickListEntriesThisTick.add(var4); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("ticking"); + Iterator var14 = this.pendingTickListEntriesThisTick.iterator(); + + while (var14.hasNext()) { + var4 = (NextTickListEntry)var14.next(); + var14.remove(); + byte var5 = 0; + + if (this.checkChunksExist(var4.xCoord - var5, var4.yCoord - var5, var4.zCoord - var5, var4.xCoord + var5, var4.yCoord + var5, var4.zCoord + var5)) { + Block var6 = this.getBlock(var4.xCoord, var4.yCoord, var4.zCoord); + + if (var6.getMaterial() != Material.air && Block.isEqualTo(var6, var4.func_151351_a())) { + try { + var6.updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.rand); + } catch (Throwable var13) { + CrashReport var8 = CrashReport.makeCrashReport(var13, "Exception while ticking a block"); + CrashReportCategory var9 = var8.makeCategory("Block being ticked"); + int var10; + + try { + var10 = this.getBlockMetadata(var4.xCoord, var4.yCoord, var4.zCoord); + } catch (Throwable var12) { + var10 = -1; + } + + CrashReportCategory.func_147153_a(var9, var4.xCoord, var4.yCoord, var4.zCoord, var6, var10); + throw new ReportedException(var8); + } + } + } else { + this.scheduleBlockUpdate(var4.xCoord, var4.yCoord, var4.zCoord, var4.func_151351_a(), 0); + } + } + + this.theProfiler.endSection(); + this.pendingTickListEntriesThisTick.clear(); + return !this.pendingTickListEntriesTreeSet.isEmpty(); + } + } + + public List getPendingBlockUpdates(Chunk p_72920_1_, boolean p_72920_2_) { + ArrayList var3 = null; + ChunkCoordIntPair var4 = p_72920_1_.getChunkCoordIntPair(); + int var5 = (var4.chunkXPos << 4) - 2; + int var6 = var5 + 16 + 2; + int var7 = (var4.chunkZPos << 4) - 2; + int var8 = var7 + 16 + 2; + + for (int var9 = 0; var9 < 2; ++var9) { + Iterator var10; + + if (var9 == 0) { + var10 = this.pendingTickListEntriesTreeSet.iterator(); + } else { + var10 = this.pendingTickListEntriesThisTick.iterator(); + + if (!this.pendingTickListEntriesThisTick.isEmpty()) { + logger.debug("toBeTicked = " + this.pendingTickListEntriesThisTick.size()); + } + } + + while (var10.hasNext()) { + NextTickListEntry var11 = (NextTickListEntry)var10.next(); + + if (var11.xCoord >= var5 && var11.xCoord < var6 && var11.zCoord >= var7 && var11.zCoord < var8) { + if (p_72920_2_) { + this.pendingTickListEntriesHashSet.remove(var11); + var10.remove(); + } + + if (var3 == null) { + var3 = new ArrayList(); + } + + var3.add(var11); + } + } + } + + return var3; + } + + /** + * Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. + * Args: entity, forceUpdate + */ + public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_) { + if (!this.mcServer.getCanSpawnAnimals() && (p_72866_1_ instanceof EntityAnimal || p_72866_1_ instanceof EntityWaterMob)) { + p_72866_1_.setDead(); + } + + if (!this.mcServer.getCanSpawnNPCs() && p_72866_1_ instanceof INpc) { + p_72866_1_.setDead(); + } + + super.updateEntityWithOptionalForce(p_72866_1_, p_72866_2_); + } + + /** + * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? + */ + protected IChunkProvider createChunkProvider() { + IChunkLoader var1 = this.saveHandler.getChunkLoader(this.provider); + this.theChunkProviderServer = new ChunkProviderServer(this, var1, this.provider.createChunkGenerator()); + return this.theChunkProviderServer; + } + + public List func_147486_a(int p_147486_1_, int p_147486_2_, int p_147486_3_, int p_147486_4_, int p_147486_5_, int p_147486_6_) { + ArrayList var7 = new ArrayList(); + + for (int var8 = 0; var8 < this.field_147482_g.size(); ++var8) { + TileEntity var9 = (TileEntity)this.field_147482_g.get(var8); + + if (var9.field_145851_c >= p_147486_1_ && var9.field_145848_d >= p_147486_2_ && var9.field_145849_e >= p_147486_3_ && var9.field_145851_c < p_147486_4_ && var9.field_145848_d < p_147486_5_ && var9.field_145849_e < p_147486_6_) { + var7.add(var9); + } + } + + return var7; + } + + /** + * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. + */ + public boolean canMineBlock(EntityPlayer p_72962_1_, int p_72962_2_, int p_72962_3_, int p_72962_4_) { + return !this.mcServer.isBlockProtected(this, p_72962_2_, p_72962_3_, p_72962_4_, p_72962_1_); + } + + protected void initialize(WorldSettings p_72963_1_) { + if (this.entityIdMap == null) { + this.entityIdMap = new IntHashMap(); + } + + if (this.pendingTickListEntriesHashSet == null) { + this.pendingTickListEntriesHashSet = new HashSet(); + } + + if (this.pendingTickListEntriesTreeSet == null) { + this.pendingTickListEntriesTreeSet = new TreeSet(); + } + + this.createSpawnPosition(p_72963_1_); + super.initialize(p_72963_1_); + } + + /** + * creates a spawn position at random within 256 blocks of 0,0 + */ + protected void createSpawnPosition(WorldSettings p_73052_1_) { + if (!this.provider.canRespawnHere()) { + this.worldInfo.setSpawnPosition(0, this.provider.getAverageGroundLevel(), 0); + } else { + this.findingSpawnPoint = true; + WorldChunkManager var2 = this.provider.worldChunkMgr; + List var3 = var2.getBiomesToSpawnIn(); + Random var4 = new Random(this.getSeed()); + ChunkPosition var5 = var2.func_150795_a(0, 0, 256, var3, var4); + int var6 = 0; + int var7 = this.provider.getAverageGroundLevel(); + int var8 = 0; + + if (var5 != null) { + var6 = var5.field_151329_a; + var8 = var5.field_151328_c; + } else { + logger.warn("Unable to find spawn biome"); + } + + int var9 = 0; + + while (!this.provider.canCoordinateBeSpawn(var6, var8)) { + var6 += var4.nextInt(64) - var4.nextInt(64); + var8 += var4.nextInt(64) - var4.nextInt(64); + ++var9; + + if (var9 == 1000) { + break; + } + } + + this.worldInfo.setSpawnPosition(var6, var7, var8); + this.findingSpawnPoint = false; + + if (p_73052_1_.isBonusChestEnabled()) { + this.createBonusChest(); + } + } + } + + /** + * Creates the bonus chest in the world. + */ + protected void createBonusChest() { + WorldGeneratorBonusChest var1 = new WorldGeneratorBonusChest(bonusChestContent, 10); + + for (int var2 = 0; var2 < 10; ++var2) { + int var3 = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6); + int var4 = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6); + int var5 = this.getTopSolidOrLiquidBlock(var3, var4) + 1; + + if (var1.generate(this, this.rand, var3, var5, var4)) { + break; + } + } + } + + /** + * Gets the hard-coded portal location to use when entering this dimension. + */ + public ChunkCoordinates getEntrancePortalLocation() { + return this.provider.getEntrancePortalLocation(); + } + + /** + * Saves all chunks to disk while updating progress bar. + */ + public void saveAllChunks(boolean p_73044_1_, IProgressUpdate p_73044_2_) throws MinecraftException { + if (this.chunkProvider.canSave()) { + if (p_73044_2_ != null) { + p_73044_2_.displayProgressMessage("Saving level"); + } + + this.saveLevel(); + + if (p_73044_2_ != null) { + p_73044_2_.resetProgresAndWorkingMessage("Saving chunks"); + } + + this.chunkProvider.saveChunks(p_73044_1_, p_73044_2_); + ArrayList var3 = Lists.newArrayList(this.theChunkProviderServer.func_152380_a()); + Iterator var4 = var3.iterator(); + + while (var4.hasNext()) { + Chunk var5 = (Chunk)var4.next(); + + if (var5 != null && !this.thePlayerManager.func_152621_a(var5.xPosition, var5.zPosition)) { + this.theChunkProviderServer.unloadChunksIfNotNearSpawn(var5.xPosition, var5.zPosition); + } + } + } + } + + /** + * saves chunk data - currently only called during execution of the Save All command + */ + public void saveChunkData() { + if (this.chunkProvider.canSave()) { + this.chunkProvider.saveExtraData(); + } + } + + /** + * Saves the chunks to disk. + */ + protected void saveLevel() throws MinecraftException { + this.checkSessionLock(); + this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); + this.mapStorage.saveAllData(); + } + + protected void onEntityAdded(Entity p_72923_1_) { + super.onEntityAdded(p_72923_1_); + this.entityIdMap.addKey(p_72923_1_.getEntityId(), p_72923_1_); + Entity[] var2 = p_72923_1_.getParts(); + + if (var2 != null) { + for (int var3 = 0; var3 < var2.length; ++var3) { + this.entityIdMap.addKey(var2[var3].getEntityId(), var2[var3]); + } + } + } + + protected void onEntityRemoved(Entity p_72847_1_) { + super.onEntityRemoved(p_72847_1_); + this.entityIdMap.removeObject(p_72847_1_.getEntityId()); + Entity[] var2 = p_72847_1_.getParts(); + + if (var2 != null) { + for (int var3 = 0; var3 < var2.length; ++var3) { + this.entityIdMap.removeObject(var2[var3].getEntityId()); + } + } + } + + /** + * Returns the Entity with the given ID, or null if it doesn't exist in this World. + */ + public Entity getEntityByID(int p_73045_1_) { + return (Entity)this.entityIdMap.lookup(p_73045_1_); + } + + /** + * adds a lightning bolt to the list of lightning bolts in this world. + */ + public boolean addWeatherEffect(Entity p_72942_1_) { + if (super.addWeatherEffect(p_72942_1_)) { + this.mcServer.getConfigurationManager().func_148541_a(p_72942_1_.posX, p_72942_1_.posY, p_72942_1_.posZ, 512.0D, this.provider.dimensionId, new S2CPacketSpawnGlobalEntity(p_72942_1_)); + return true; + } else { + return false; + } + } + + /** + * sends a Packet 38 (Entity Status) to all tracked players of that entity + */ + public void setEntityState(Entity p_72960_1_, byte p_72960_2_) { + this.getEntityTracker().func_151248_b(p_72960_1_, new S19PacketEntityStatus(p_72960_1_, p_72960_2_)); + } + + /** + * returns a new explosion. Does initiation (at time of writing Explosion is not finished) + */ + public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { + Explosion var11 = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); + var11.isFlaming = p_72885_9_; + var11.isSmoking = p_72885_10_; + var11.doExplosionA(); + var11.doExplosionB(false); + + if (!p_72885_10_) { + var11.affectedBlockPositions.clear(); + } + + Iterator var12 = this.playerEntities.iterator(); + + while (var12.hasNext()) { + EntityPlayer var13 = (EntityPlayer)var12.next(); + + if (var13.getDistanceSq(p_72885_2_, p_72885_4_, p_72885_6_) < 4096.0D) { + ((EntityPlayerMP)var13).playerNetServerHandler.sendPacket(new S27PacketExplosion(p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, var11.affectedBlockPositions, (Vec3)var11.func_77277_b().get(var13))); + } + } + + return var11; + } + + public void func_147452_c(int p_147452_1_, int p_147452_2_, int p_147452_3_, Block p_147452_4_, int p_147452_5_, int p_147452_6_) { + BlockEventData var7 = new BlockEventData(p_147452_1_, p_147452_2_, p_147452_3_, p_147452_4_, p_147452_5_, p_147452_6_); + Iterator var8 = this.field_147490_S[this.field_147489_T].iterator(); + BlockEventData var9; + + do { + if (!var8.hasNext()) { + this.field_147490_S[this.field_147489_T].add(var7); + return; + } + + var9 = (BlockEventData)var8.next(); + } + while (!var9.equals(var7)); + } + + private void func_147488_Z() { + while (!this.field_147490_S[this.field_147489_T].isEmpty()) { + int var1 = this.field_147489_T; + this.field_147489_T ^= 1; + Iterator var2 = this.field_147490_S[var1].iterator(); + + while (var2.hasNext()) { + BlockEventData var3 = (BlockEventData)var2.next(); + + if (this.func_147485_a(var3)) { + this.mcServer.getConfigurationManager().func_148541_a(var3.func_151340_a(), var3.func_151342_b(), var3.func_151341_c(), 64.0D, this.provider.dimensionId, new S24PacketBlockAction(var3.func_151340_a(), var3.func_151342_b(), var3.func_151341_c(), var3.getBlock(), var3.getEventID(), var3.getEventParameter())); + } + } + + this.field_147490_S[var1].clear(); + } + } + + private boolean func_147485_a(BlockEventData p_147485_1_) { + Block var2 = this.getBlock(p_147485_1_.func_151340_a(), p_147485_1_.func_151342_b(), p_147485_1_.func_151341_c()); + return var2 == p_147485_1_.getBlock() && var2.onBlockEventReceived(this, p_147485_1_.func_151340_a(), p_147485_1_.func_151342_b(), p_147485_1_.func_151341_c(), p_147485_1_.getEventID(), p_147485_1_.getEventParameter()); + } + + /** + * Syncs all changes to disk and wait for completion. + */ + public void flush() { + this.saveHandler.flush(); + } + + /** + * Updates all weather states. + */ + protected void updateWeather() { + boolean var1 = this.isRaining(); + super.updateWeather(); + + if (this.prevRainingStrength != this.rainingStrength) { + this.mcServer.getConfigurationManager().func_148537_a(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId); + } + + if (this.prevThunderingStrength != this.thunderingStrength) { + this.mcServer.getConfigurationManager().func_148537_a(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId); + } + + if (var1 != this.isRaining()) { + if (var1) { + this.mcServer.getConfigurationManager().func_148540_a(new S2BPacketChangeGameState(2, 0.0F)); + } else { + this.mcServer.getConfigurationManager().func_148540_a(new S2BPacketChangeGameState(1, 0.0F)); + } + + this.mcServer.getConfigurationManager().func_148540_a(new S2BPacketChangeGameState(7, this.rainingStrength)); + this.mcServer.getConfigurationManager().func_148540_a(new S2BPacketChangeGameState(8, this.thunderingStrength)); + } + } + + protected int func_152379_p() { + return this.mcServer.getConfigurationManager().getViewDistance(); + } + + public MinecraftServer func_73046_m() { + return this.mcServer; + } + + /** + * Gets the EntityTracker + */ + public EntityTracker getEntityTracker() { + return this.theEntityTracker; + } + + public PlayerManager getPlayerManager() { + return this.thePlayerManager; + } + + public Teleporter getDefaultTeleporter() { + return this.worldTeleporter; + } + + public void func_147487_a(String p_147487_1_, double p_147487_2_, double p_147487_4_, double p_147487_6_, int p_147487_8_, double p_147487_9_, double p_147487_11_, double p_147487_13_, double p_147487_15_) { + S2APacketParticles var17 = new S2APacketParticles(p_147487_1_, (float)p_147487_2_, (float)p_147487_4_, (float)p_147487_6_, (float)p_147487_9_, (float)p_147487_11_, (float)p_147487_13_, (float)p_147487_15_, p_147487_8_); + + for (int var18 = 0; var18 < this.playerEntities.size(); ++var18) { + EntityPlayerMP var19 = (EntityPlayerMP)this.playerEntities.get(var18); + ChunkCoordinates var20 = var19.getPlayerCoordinates(); + double var21 = p_147487_2_ - (double)var20.posX; + double var23 = p_147487_4_ - (double)var20.posY; + double var25 = p_147487_6_ - (double)var20.posZ; + double var27 = var21 * var21 + var23 * var23 + var25 * var25; + + if (var27 <= 256.0D) { + var19.playerNetServerHandler.sendPacket(var17); + } + } + } + + static class ServerBlockEventList extends ArrayList { + + + private ServerBlockEventList() {} + + ServerBlockEventList(Object p_i1521_1_) { + this(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldServerMulti.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldServerMulti.java new file mode 100644 index 0000000..d67baae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldServerMulti.java @@ -0,0 +1,22 @@ +package net.minecraft.world; + +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.storage.DerivedWorldInfo; +import net.minecraft.world.storage.ISaveHandler; + +public class WorldServerMulti extends WorldServer { + + + public WorldServerMulti(MinecraftServer p_i45283_1_, ISaveHandler p_i45283_2_, String p_i45283_3_, int p_i45283_4_, WorldSettings p_i45283_5_, WorldServer p_i45283_6_, Profiler p_i45283_7_) { + super(p_i45283_1_, p_i45283_2_, p_i45283_3_, p_i45283_4_, p_i45283_5_, p_i45283_7_); + this.mapStorage = p_i45283_6_.mapStorage; + this.worldScoreboard = p_i45283_6_.getScoreboard(); + this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo()); + } + + /** + * Saves the chunks to disk. + */ + protected void saveLevel() throws MinecraftException {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldSettings.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldSettings.java new file mode 100644 index 0000000..24985cd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldSettings.java @@ -0,0 +1,202 @@ +package net.minecraft.world; + +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.world.storage.WorldInfo; + +public final class WorldSettings { + /** The seed for the map. */ + private final long seed; + + /** The EnumGameType. */ + private final WorldSettings.GameType theGameType; + + /** + * Switch for the map features. 'true' for enabled, 'false' for disabled. + */ + private final boolean mapFeaturesEnabled; + + /** True if hardcore mode is enabled */ + private final boolean hardcoreEnabled; + private final WorldType terrainType; + + /** True if Commands (cheats) are allowed. */ + private boolean commandsAllowed; + + /** True if the Bonus Chest is enabled. */ + private boolean bonusChestEnabled; + private String field_82751_h; + + + public WorldSettings(long p_i1957_1_, WorldSettings.GameType p_i1957_3_, boolean p_i1957_4_, boolean p_i1957_5_, WorldType p_i1957_6_) { + this.field_82751_h = ""; + this.seed = p_i1957_1_; + this.theGameType = p_i1957_3_; + this.mapFeaturesEnabled = p_i1957_4_; + this.hardcoreEnabled = p_i1957_5_; + this.terrainType = p_i1957_6_; + } + + public WorldSettings(WorldInfo p_i1958_1_) { + this(p_i1958_1_.getSeed(), p_i1958_1_.getGameType(), p_i1958_1_.isMapFeaturesEnabled(), p_i1958_1_.isHardcoreModeEnabled(), p_i1958_1_.getTerrainType()); + } + + /** + * Enables the bonus chest. + */ + public WorldSettings enableBonusChest() { + this.bonusChestEnabled = true; + return this; + } + + /** + * Enables Commands (cheats). + */ + public WorldSettings enableCommands() { + this.commandsAllowed = true; + return this; + } + + public WorldSettings func_82750_a(String p_82750_1_) { + this.field_82751_h = p_82750_1_; + return this; + } + + /** + * Returns true if the Bonus Chest is enabled. + */ + public boolean isBonusChestEnabled() { + return this.bonusChestEnabled; + } + + /** + * Returns the seed for the world. + */ + public long getSeed() { + return this.seed; + } + + /** + * Gets the game type. + */ + public WorldSettings.GameType getGameType() { + return this.theGameType; + } + + /** + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean getHardcoreEnabled() { + return this.hardcoreEnabled; + } + + /** + * Get whether the map features (e.g. strongholds) generation is enabled or disabled. + */ + public boolean isMapFeaturesEnabled() { + return this.mapFeaturesEnabled; + } + + public WorldType getTerrainType() { + return this.terrainType; + } + + /** + * Returns true if Commands (cheats) are allowed. + */ + public boolean areCommandsAllowed() { + return this.commandsAllowed; + } + + /** + * Gets the GameType by ID + */ + public static WorldSettings.GameType getGameTypeById(int p_77161_0_) { + return WorldSettings.GameType.getByID(p_77161_0_); + } + + public String func_82749_j() { + return this.field_82751_h; + } + + public enum GameType { + NOT_SET("NOT_SET", 0, -1, ""), + SURVIVAL("SURVIVAL", 1, 0, "survival"), + CREATIVE("CREATIVE", 2, 1, "creative"), + ADVENTURE("ADVENTURE", 3, 2, "adventure"); + int id; + String name; + + private static final WorldSettings.GameType[] $VALUES = new WorldSettings.GameType[]{NOT_SET, SURVIVAL, CREATIVE, ADVENTURE}; + + + GameType(String p_i1956_1_, int p_i1956_2_, int p_i1956_3_, String p_i1956_4_) { + this.id = p_i1956_3_; + this.name = p_i1956_4_; + } + + public int getID() { + return this.id; + } + + public String getName() { + return this.name; + } + + public void configurePlayerCapabilities(PlayerCapabilities p_77147_1_) { + if (this == CREATIVE) { + p_77147_1_.allowFlying = true; + p_77147_1_.isCreativeMode = true; + p_77147_1_.disableDamage = true; + } else { + p_77147_1_.allowFlying = false; + p_77147_1_.isCreativeMode = false; + p_77147_1_.disableDamage = false; + p_77147_1_.isFlying = false; + } + + p_77147_1_.allowEdit = !this.isAdventure(); + } + + public boolean isAdventure() { + return this == ADVENTURE; + } + + public boolean isCreative() { + return this == CREATIVE; + } + + public boolean isSurvivalOrAdventure() { + return this == SURVIVAL || this == ADVENTURE; + } + + public static WorldSettings.GameType getByID(int p_77146_0_) { + WorldSettings.GameType[] var1 = values(); + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + WorldSettings.GameType var4 = var1[var3]; + + if (var4.id == p_77146_0_) { + return var4; + } + } + + return SURVIVAL; + } + + public static WorldSettings.GameType getByName(String p_77142_0_) { + WorldSettings.GameType[] var1 = values(); + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + WorldSettings.GameType var4 = var1[var3]; + + if (var4.name.equals(p_77142_0_)) { + return var4; + } + } + + return SURVIVAL; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldType.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldType.java new file mode 100644 index 0000000..4347b6c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/WorldType.java @@ -0,0 +1,129 @@ +package net.minecraft.world; + +public class WorldType { + /** List of world types. */ + public static final WorldType[] worldTypes = new WorldType[16]; + + /** Default world type. */ + public static final WorldType DEFAULT = (new WorldType(0, "default", 1)).setVersioned(); + + /** Flat world type. */ + public static final WorldType FLAT = new WorldType(1, "flat"); + + /** Large Biome world Type. */ + public static final WorldType LARGE_BIOMES = new WorldType(2, "largeBiomes"); + public static final WorldType field_151360_e = (new WorldType(3, "amplified")).func_151358_j(); + + /** Default (1.1) world type. */ + public static final WorldType DEFAULT_1_1 = (new WorldType(8, "default_1_1", 0)).setCanBeCreated(false); + + /** ID for this world type. */ + private final int worldTypeId; + + /** 'default' or 'flat' */ + private final String worldType; + + /** The int version of the ChunkProvider that generated this world. */ + private final int generatorVersion; + + /** + * Whether this world type can be generated. Normally true; set to false for out-of-date generator versions. + */ + private boolean canBeCreated; + + /** Whether this WorldType has a version or not. */ + private boolean isWorldTypeVersioned; + private boolean field_151361_l; + + + private WorldType(int p_i1959_1_, String p_i1959_2_) { + this(p_i1959_1_, p_i1959_2_, 0); + } + + private WorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) { + this.worldType = p_i1960_2_; + this.generatorVersion = p_i1960_3_; + this.canBeCreated = true; + this.worldTypeId = p_i1960_1_; + worldTypes[p_i1960_1_] = this; + } + + public String getWorldTypeName() { + return this.worldType; + } + + /** + * Gets the translation key for the name of this world type. + */ + public String getTranslateName() { + return "generator." + this.worldType; + } + + public String func_151359_c() { + return this.getTranslateName() + ".info"; + } + + /** + * Returns generatorVersion. + */ + public int getGeneratorVersion() { + return this.generatorVersion; + } + + public WorldType getWorldTypeForGeneratorVersion(int p_77132_1_) { + return this == DEFAULT && p_77132_1_ == 0 ? DEFAULT_1_1 : this; + } + + /** + * Sets canBeCreated to the provided value, and returns this. + */ + private WorldType setCanBeCreated(boolean p_77124_1_) { + this.canBeCreated = p_77124_1_; + return this; + } + + /** + * Gets whether this WorldType can be used to generate a new world. + */ + public boolean getCanBeCreated() { + return this.canBeCreated; + } + + /** + * Flags this world type as having an associated version. + */ + private WorldType setVersioned() { + this.isWorldTypeVersioned = true; + return this; + } + + /** + * Returns true if this world Type has a version associated with it. + */ + public boolean isVersioned() { + return this.isWorldTypeVersioned; + } + + public static WorldType parseWorldType(String p_77130_0_) { + for (int var1 = 0; var1 < worldTypes.length; ++var1) { + if (worldTypes[var1] != null && worldTypes[var1].worldType.equalsIgnoreCase(p_77130_0_)) { + return worldTypes[var1]; + } + } + + return null; + } + + public int getWorldTypeID() { + return this.worldTypeId; + } + + public boolean func_151357_h() { + return this.field_151361_l; + } + + private WorldType func_151358_j() { + this.field_151361_l = true; + return this; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeCache.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeCache.java new file mode 100644 index 0000000..edbd7fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeCache.java @@ -0,0 +1,103 @@ +package net.minecraft.world.biome; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.LongHashMap; + +public class BiomeCache { + /** Reference to the WorldChunkManager */ + private final WorldChunkManager chunkManager; + + /** The last time this BiomeCache was cleaned, in milliseconds. */ + private long lastCleanupTime; + + /** + * The map of keys to BiomeCacheBlocks. Keys are based on the chunk x, z coordinates as (x | z << 32). + */ + private final LongHashMap cacheMap = new LongHashMap(); + + /** The list of cached BiomeCacheBlocks */ + private final List cache = new ArrayList(); + + + public BiomeCache(WorldChunkManager p_i1973_1_) { + this.chunkManager = p_i1973_1_; + } + + /** + * Returns a biome cache block at location specified. + */ + public BiomeCache.Block getBiomeCacheBlock(int p_76840_1_, int p_76840_2_) { + p_76840_1_ >>= 4; + p_76840_2_ >>= 4; + long var3 = (long)p_76840_1_ & 4294967295L | ((long)p_76840_2_ & 4294967295L) << 32; + BiomeCache.Block var5 = (BiomeCache.Block)this.cacheMap.getValueByKey(var3); + + if (var5 == null) { + var5 = new BiomeCache.Block(p_76840_1_, p_76840_2_); + this.cacheMap.add(var3, var5); + this.cache.add(var5); + } + + var5.lastAccessTime = MinecraftServer.getSystemTimeMillis(); + return var5; + } + + /** + * Returns the BiomeGenBase related to the x, z position from the cache. + */ + public BiomeGenBase getBiomeGenAt(int p_76837_1_, int p_76837_2_) { + return this.getBiomeCacheBlock(p_76837_1_, p_76837_2_).getBiomeGenAt(p_76837_1_, p_76837_2_); + } + + /** + * Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds. + */ + public void cleanupCache() { + long var1 = MinecraftServer.getSystemTimeMillis(); + long var3 = var1 - this.lastCleanupTime; + + if (var3 > 7500L || var3 < 0L) { + this.lastCleanupTime = var1; + + for (int var5 = 0; var5 < this.cache.size(); ++var5) { + BiomeCache.Block var6 = (BiomeCache.Block)this.cache.get(var5); + long var7 = var1 - var6.lastAccessTime; + + if (var7 > 30000L || var7 < 0L) { + this.cache.remove(var5--); + long var9 = (long)var6.xPosition & 4294967295L | ((long)var6.zPosition & 4294967295L) << 32; + this.cacheMap.remove(var9); + } + } + } + } + + /** + * Returns the array of cached biome types in the BiomeCacheBlock at the given location. + */ + public BiomeGenBase[] getCachedBiomes(int p_76839_1_, int p_76839_2_) { + return this.getBiomeCacheBlock(p_76839_1_, p_76839_2_).biomes; + } + + public class Block { + public float[] rainfallValues = new float[256]; + public BiomeGenBase[] biomes = new BiomeGenBase[256]; + public int xPosition; + public int zPosition; + public long lastAccessTime; + + + public Block(int p_i1972_2_, int p_i1972_3_) { + this.xPosition = p_i1972_2_; + this.zPosition = p_i1972_3_; + BiomeCache.this.chunkManager.getRainfall(this.rainfallValues, p_i1972_2_ << 4, p_i1972_3_ << 4, 16, 16); + BiomeCache.this.chunkManager.getBiomeGenAt(this.biomes, p_i1972_2_ << 4, p_i1972_3_ << 4, 16, 16, false); + } + + public BiomeGenBase getBiomeGenAt(int p_76885_1_, int p_76885_2_) { + return this.biomes[p_76885_1_ & 15 | (p_76885_2_ & 15) << 4]; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeDecorator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeDecorator.java new file mode 100644 index 0000000..94cbb15 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeDecorator.java @@ -0,0 +1,383 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCactus; +import net.minecraft.world.gen.feature.WorldGenClay; +import net.minecraft.world.gen.feature.WorldGenDeadBush; +import net.minecraft.world.gen.feature.WorldGenFlowers; +import net.minecraft.world.gen.feature.WorldGenLiquids; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenPumpkin; +import net.minecraft.world.gen.feature.WorldGenReed; +import net.minecraft.world.gen.feature.WorldGenSand; +import net.minecraft.world.gen.feature.WorldGenWaterlily; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeDecorator { + /** The world the BiomeDecorator is currently decorating */ + protected World currentWorld; + + /** The Biome Decorator's random number generator. */ + protected Random randomGenerator; + + /** The X-coordinate of the chunk currently being decorated */ + protected int chunk_X; + + /** The Z-coordinate of the chunk currently being decorated */ + protected int chunk_Z; + + /** The clay generator. */ + protected WorldGenerator clayGen = new WorldGenClay(4); + + /** The sand generator. */ + protected WorldGenerator sandGen; + + /** The gravel generator. */ + protected WorldGenerator gravelAsSandGen; + + /** The dirt generator. */ + protected WorldGenerator dirtGen; + protected WorldGenerator gravelGen; + protected WorldGenerator coalGen; + protected WorldGenerator ironGen; + + /** Field that holds gold WorldGenMinable */ + protected WorldGenerator goldGen; + + /** Field that holds redstone WorldGenMinable */ + protected WorldGenerator redstoneGen; + + /** Field that holds diamond WorldGenMinable */ + protected WorldGenerator diamondGen; + + /** Field that holds Lapis WorldGenMinable */ + protected WorldGenerator lapisGen; + protected WorldGenFlowers field_150514_p; + + /** Field that holds mushroomBrown WorldGenFlowers */ + protected WorldGenerator mushroomBrownGen; + + /** Field that holds mushroomRed WorldGenFlowers */ + protected WorldGenerator mushroomRedGen; + + /** Field that holds big mushroom generator */ + protected WorldGenerator bigMushroomGen; + + /** Field that holds WorldGenReed */ + protected WorldGenerator reedGen; + + /** Field that holds WorldGenCactus */ + protected WorldGenerator cactusGen; + + /** The water lily generation! */ + protected WorldGenerator waterlilyGen; + + /** Amount of waterlilys per chunk. */ + protected int waterlilyPerChunk; + + /** + * The number of trees to attempt to generate per chunk. Up to 10 in forests, none in deserts. + */ + protected int treesPerChunk; + + /** + * The number of yellow flower patches to generate per chunk. The game generates much less than this number, since + * it attempts to generate them at a random altitude. + */ + protected int flowersPerChunk; + + /** The amount of tall grass to generate per chunk. */ + protected int grassPerChunk; + + /** + * The number of dead bushes to generate per chunk. Used in deserts and swamps. + */ + protected int deadBushPerChunk; + + /** + * The number of extra mushroom patches per chunk. It generates 1/4 this number in brown mushroom patches, and 1/8 + * this number in red mushroom patches. These mushrooms go beyond the default base number of mushrooms. + */ + protected int mushroomsPerChunk; + + /** + * The number of reeds to generate per chunk. Reeds won't generate if the randomly selected placement is unsuitable. + */ + protected int reedsPerChunk; + + /** + * The number of cactus plants to generate per chunk. Cacti only work on sand. + */ + protected int cactiPerChunk; + + /** + * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. + */ + protected int sandPerChunk; + + /** + * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. There + * appear to be two separate fields for this. + */ + protected int sandPerChunk2; + + /** + * The number of clay patches to generate per chunk. Only generates when part of it is underwater. + */ + protected int clayPerChunk; + + /** Amount of big mushrooms per chunk */ + protected int bigMushroomsPerChunk; + + /** True if decorator should generate surface lava & water */ + public boolean generateLakes; + + + public BiomeDecorator() { + this.sandGen = new WorldGenSand(Blocks.sand, 7); + this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6); + this.dirtGen = new WorldGenMinable(Blocks.dirt, 32); + this.gravelGen = new WorldGenMinable(Blocks.gravel, 32); + this.coalGen = new WorldGenMinable(Blocks.coal_ore, 16); + this.ironGen = new WorldGenMinable(Blocks.iron_ore, 8); + this.goldGen = new WorldGenMinable(Blocks.gold_ore, 8); + this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore, 7); + this.diamondGen = new WorldGenMinable(Blocks.diamond_ore, 7); + this.lapisGen = new WorldGenMinable(Blocks.lapis_ore, 6); + this.field_150514_p = new WorldGenFlowers(Blocks.yellow_flower); + this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom); + this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom); + this.bigMushroomGen = new WorldGenBigMushroom(); + this.reedGen = new WorldGenReed(); + this.cactusGen = new WorldGenCactus(); + this.waterlilyGen = new WorldGenWaterlily(); + this.flowersPerChunk = 2; + this.grassPerChunk = 1; + this.sandPerChunk = 1; + this.sandPerChunk2 = 3; + this.clayPerChunk = 1; + this.generateLakes = true; + } + + public void func_150512_a(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) { + if (this.currentWorld != null) { + throw new RuntimeException("Already decorating!!"); + } else { + this.currentWorld = p_150512_1_; + this.randomGenerator = p_150512_2_; + this.chunk_X = p_150512_4_; + this.chunk_Z = p_150512_5_; + this.func_150513_a(p_150512_3_); + this.currentWorld = null; + this.randomGenerator = null; + } + } + + protected void func_150513_a(BiomeGenBase p_150513_1_) { + this.generateOres(); + int var2; + int var3; + int var4; + + for (var2 = 0; var2 < this.sandPerChunk2; ++var2) { + var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.sandGen.generate(this.currentWorld, this.randomGenerator, var3, this.currentWorld.getTopSolidOrLiquidBlock(var3, var4), var4); + } + + for (var2 = 0; var2 < this.clayPerChunk; ++var2) { + var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.clayGen.generate(this.currentWorld, this.randomGenerator, var3, this.currentWorld.getTopSolidOrLiquidBlock(var3, var4), var4); + } + + for (var2 = 0; var2 < this.sandPerChunk; ++var2) { + var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, var3, this.currentWorld.getTopSolidOrLiquidBlock(var3, var4), var4); + } + + var2 = this.treesPerChunk; + + if (this.randomGenerator.nextInt(10) == 0) { + ++var2; + } + + int var5; + int var6; + + for (var3 = 0; var3 < var2; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.currentWorld.getHeightValue(var4, var5); + WorldGenAbstractTree var7 = p_150513_1_.func_150567_a(this.randomGenerator); + var7.setScale(1.0D, 1.0D, 1.0D); + + if (var7.generate(this.currentWorld, this.randomGenerator, var4, var6, var5)) { + var7.func_150524_b(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + } + + for (var3 = 0; var3 < this.bigMushroomsPerChunk; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, var4, this.currentWorld.getHeightValue(var4, var5), var5); + } + + for (var3 = 0; var3 < this.flowersPerChunk; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) + 32); + String var9 = p_150513_1_.func_150572_a(this.randomGenerator, var4, var6, var5); + BlockFlower var8 = BlockFlower.func_149857_e(var9); + + if (var8.getMaterial() != Material.air) { + this.field_150514_p.func_150550_a(var8, BlockFlower.func_149856_f(var9)); + this.field_150514_p.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + } + + for (var3 = 0; var3 < this.grassPerChunk; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) * 2); + WorldGenerator var10 = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator); + var10.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + + for (var3 = 0; var3 < this.deadBushPerChunk; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) * 2); + (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + + for (var3 = 0; var3 < this.waterlilyPerChunk; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + + for (var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) * 2); var6 > 0 && this.currentWorld.isAirBlock(var4, var6 - 1, var5); --var6) { + } + + this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + + for (var3 = 0; var3 < this.mushroomsPerChunk; ++var3) { + if (this.randomGenerator.nextInt(4) == 0) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.currentWorld.getHeightValue(var4, var5); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + + if (this.randomGenerator.nextInt(8) == 0) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) * 2); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + } + + if (this.randomGenerator.nextInt(4) == 0) { + var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var5 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var3, var4) * 2); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, var3, var5, var4); + } + + if (this.randomGenerator.nextInt(8) == 0) { + var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var5 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var3, var4) * 2); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, var3, var5, var4); + } + + for (var3 = 0; var3 < this.reedsPerChunk; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) * 2); + this.reedGen.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + + for (var3 = 0; var3 < 10; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) * 2); + this.reedGen.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + + if (this.randomGenerator.nextInt(32) == 0) { + var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var5 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var3, var4) * 2); + (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, var3, var5, var4); + } + + for (var3 = 0; var3 < this.cactiPerChunk; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var6 = this.randomGenerator.nextInt(this.currentWorld.getHeightValue(var4, var5) * 2); + this.cactusGen.generate(this.currentWorld, this.randomGenerator, var4, var6, var5); + } + + if (this.generateLakes) { + for (var3 = 0; var3 < 50; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8); + var6 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, var4, var5, var6); + } + + for (var3 = 0; var3 < 20; ++var3) { + var4 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + var5 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); + var6 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, var4, var5, var6); + } + } + } + + /** + * Standard ore generation helper. Generates most ores. + */ + protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) { + for (int var5 = 0; var5 < p_76795_1_; ++var5) { + int var6 = this.chunk_X + this.randomGenerator.nextInt(16); + int var7 = this.randomGenerator.nextInt(p_76795_4_ - p_76795_3_) + p_76795_3_; + int var8 = this.chunk_Z + this.randomGenerator.nextInt(16); + p_76795_2_.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); + } + } + + /** + * Standard ore generation helper. Generates Lapis Lazuli. + */ + protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) { + for (int var5 = 0; var5 < p_76793_1_; ++var5) { + int var6 = this.chunk_X + this.randomGenerator.nextInt(16); + int var7 = this.randomGenerator.nextInt(p_76793_4_) + this.randomGenerator.nextInt(p_76793_4_) + (p_76793_3_ - p_76793_4_); + int var8 = this.chunk_Z + this.randomGenerator.nextInt(16); + p_76793_2_.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); + } + } + + /** + * Generates ores in the current chunk + */ + protected void generateOres() { + this.genStandardOre1(20, this.dirtGen, 0, 256); + this.genStandardOre1(10, this.gravelGen, 0, 256); + this.genStandardOre1(20, this.coalGen, 0, 128); + this.genStandardOre1(20, this.ironGen, 0, 64); + this.genStandardOre1(2, this.goldGen, 0, 32); + this.genStandardOre1(8, this.redstoneGen, 0, 16); + this.genStandardOre1(1, this.diamondGen, 0, 16); + this.genStandardOre2(1, this.lapisGen, 16, 16); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java new file mode 100644 index 0000000..016b897 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java @@ -0,0 +1,32 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenSpikes; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeEndDecorator extends BiomeDecorator { + protected WorldGenerator spikeGen; + + + public BiomeEndDecorator() { + this.spikeGen = new WorldGenSpikes(Blocks.end_stone); + } + + protected void func_150513_a(BiomeGenBase p_150513_1_) { + this.generateOres(); + + if (this.randomGenerator.nextInt(5) == 0) { + int var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + int var3 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + int var4 = this.currentWorld.getTopSolidOrLiquidBlock(var2, var3); + this.spikeGen.generate(this.currentWorld, this.randomGenerator, var2, var4, var3); + } + + if (this.chunk_X == 0 && this.chunk_Z == 0) { + EntityDragon var5 = new EntityDragon(this.currentWorld); + var5.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F); + this.currentWorld.spawnEntityInWorld(var5); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenBase.java new file mode 100644 index 0000000..aba43ed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenBase.java @@ -0,0 +1,605 @@ +package net.minecraft.world.biome; + +import com.google.common.collect.Sets; +import java.awt.Color; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.World; +import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenDoublePlant; +import net.minecraft.world.gen.feature.WorldGenSwamp; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class BiomeGenBase { + private static final Logger logger = LogManager.getLogger(); + protected static final BiomeGenBase.Height field_150596_a = new BiomeGenBase.Height(0.1F, 0.2F); + protected static final BiomeGenBase.Height field_150594_b = new BiomeGenBase.Height(-0.5F, 0.0F); + protected static final BiomeGenBase.Height field_150595_c = new BiomeGenBase.Height(-1.0F, 0.1F); + protected static final BiomeGenBase.Height field_150592_d = new BiomeGenBase.Height(-1.8F, 0.1F); + protected static final BiomeGenBase.Height field_150593_e = new BiomeGenBase.Height(0.125F, 0.05F); + protected static final BiomeGenBase.Height field_150590_f = new BiomeGenBase.Height(0.2F, 0.2F); + protected static final BiomeGenBase.Height field_150591_g = new BiomeGenBase.Height(0.45F, 0.3F); + protected static final BiomeGenBase.Height field_150602_h = new BiomeGenBase.Height(1.5F, 0.025F); + protected static final BiomeGenBase.Height field_150603_i = new BiomeGenBase.Height(1.0F, 0.5F); + protected static final BiomeGenBase.Height field_150600_j = new BiomeGenBase.Height(0.0F, 0.025F); + protected static final BiomeGenBase.Height field_150601_k = new BiomeGenBase.Height(0.1F, 0.8F); + protected static final BiomeGenBase.Height field_150598_l = new BiomeGenBase.Height(0.2F, 0.3F); + protected static final BiomeGenBase.Height field_150599_m = new BiomeGenBase.Height(-0.2F, 0.1F); + + /** An array of all the biomes, indexed by biome id. */ + private static final BiomeGenBase[] biomeList = new BiomeGenBase[256]; + public static final Set field_150597_n = Sets.newHashSet(); + public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").func_150570_a(field_150595_c); + public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains"); + public static final BiomeGenBase desert = (new BiomeGenDesert(2)).setColor(16421912).setBiomeName("Desert").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).func_150570_a(field_150593_e); + public static final BiomeGenBase extremeHills = (new BiomeGenHills(3, false)).setColor(6316128).setBiomeName("Extreme Hills").func_150570_a(field_150603_i).setTemperatureRainfall(0.2F, 0.3F); + public static final BiomeGenBase forest = (new BiomeGenForest(4, 0)).setColor(353825).setBiomeName("Forest"); + public static final BiomeGenBase taiga = (new BiomeGenTaiga(5, 0)).setColor(747097).setBiomeName("Taiga").func_76733_a(5159473).setTemperatureRainfall(0.25F, 0.8F).func_150570_a(field_150590_f); + public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").func_76733_a(9154376).func_150570_a(field_150599_m).setTemperatureRainfall(0.8F, 0.9F); + public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").func_150570_a(field_150594_b); + public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F); + + /** Is the biome used for sky world. */ + public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("Sky").setDisableRain(); + public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().func_150570_a(field_150595_c).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().func_150570_a(field_150594_b).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase icePlains = (new BiomeGenSnow(12, false)).setColor(16777215).setBiomeName("Ice Plains").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).func_150570_a(field_150593_e); + public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13, false)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().func_150570_a(field_150591_g).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).func_150570_a(field_150598_l); + public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).func_150570_a(field_150600_j); + + /** Beach biome. */ + public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).func_150570_a(field_150600_j); + + /** Desert Hills biome. */ + public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).func_150570_a(field_150591_g); + + /** Forest Hills biome. */ + public static final BiomeGenBase forestHills = (new BiomeGenForest(18, 0)).setColor(2250012).setBiomeName("ForestHills").func_150570_a(field_150591_g); + + /** Taiga Hills biome. */ + public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19, 0)).setColor(1456435).setBiomeName("TaigaHills").func_76733_a(5159473).setTemperatureRainfall(0.25F, 0.8F).func_150570_a(field_150591_g); + + /** Extreme Hills Edge biome. */ + public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20, true)).setColor(7501978).setBiomeName("Extreme Hills Edge").func_150570_a(field_150603_i.func_150775_a()).setTemperatureRainfall(0.2F, 0.3F); + + /** Jungle biome identifier */ + public static final BiomeGenBase jungle = (new BiomeGenJungle(21, false)).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(0.95F, 0.9F); + public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22, false)).setColor(2900485).setBiomeName("JungleHills").func_76733_a(5470985).setTemperatureRainfall(0.95F, 0.9F).func_150570_a(field_150591_g); + public static final BiomeGenBase field_150574_L = (new BiomeGenJungle(23, true)).setColor(6458135).setBiomeName("JungleEdge").func_76733_a(5470985).setTemperatureRainfall(0.95F, 0.8F); + public static final BiomeGenBase field_150575_M = (new BiomeGenOcean(24)).setColor(48).setBiomeName("Deep Ocean").func_150570_a(field_150592_d); + public static final BiomeGenBase field_150576_N = (new BiomeGenStoneBeach(25)).setColor(10658436).setBiomeName("Stone Beach").setTemperatureRainfall(0.2F, 0.3F).func_150570_a(field_150601_k); + public static final BiomeGenBase field_150577_O = (new BiomeGenBeach(26)).setColor(16445632).setBiomeName("Cold Beach").setTemperatureRainfall(0.05F, 0.3F).func_150570_a(field_150600_j).setEnableSnow(); + public static final BiomeGenBase field_150583_P = (new BiomeGenForest(27, 2)).setBiomeName("Birch Forest").setColor(3175492); + public static final BiomeGenBase field_150582_Q = (new BiomeGenForest(28, 2)).setBiomeName("Birch Forest Hills").setColor(2055986).func_150570_a(field_150591_g); + public static final BiomeGenBase field_150585_R = (new BiomeGenForest(29, 3)).setColor(4215066).setBiomeName("Roofed Forest"); + public static final BiomeGenBase field_150584_S = (new BiomeGenTaiga(30, 0)).setColor(3233098).setBiomeName("Cold Taiga").func_76733_a(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).func_150570_a(field_150590_f).func_150563_c(16777215); + public static final BiomeGenBase field_150579_T = (new BiomeGenTaiga(31, 0)).setColor(2375478).setBiomeName("Cold Taiga Hills").func_76733_a(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).func_150570_a(field_150591_g).func_150563_c(16777215); + public static final BiomeGenBase field_150578_U = (new BiomeGenTaiga(32, 1)).setColor(5858897).setBiomeName("Mega Taiga").func_76733_a(5159473).setTemperatureRainfall(0.3F, 0.8F).func_150570_a(field_150590_f); + public static final BiomeGenBase field_150581_V = (new BiomeGenTaiga(33, 1)).setColor(4542270).setBiomeName("Mega Taiga Hills").func_76733_a(5159473).setTemperatureRainfall(0.3F, 0.8F).func_150570_a(field_150591_g); + public static final BiomeGenBase field_150580_W = (new BiomeGenHills(34, true)).setColor(5271632).setBiomeName("Extreme Hills+").func_150570_a(field_150603_i).setTemperatureRainfall(0.2F, 0.3F); + public static final BiomeGenBase field_150588_X = (new BiomeGenSavanna(35)).setColor(12431967).setBiomeName("Savanna").setTemperatureRainfall(1.2F, 0.0F).setDisableRain().func_150570_a(field_150593_e); + public static final BiomeGenBase field_150587_Y = (new BiomeGenSavanna(36)).setColor(10984804).setBiomeName("Savanna Plateau").setTemperatureRainfall(1.0F, 0.0F).setDisableRain().func_150570_a(field_150602_h); + public static final BiomeGenBase field_150589_Z = (new BiomeGenMesa(37, false, false)).setColor(14238997).setBiomeName("Mesa"); + public static final BiomeGenBase field_150607_aa = (new BiomeGenMesa(38, false, true)).setColor(11573093).setBiomeName("Mesa Plateau F").func_150570_a(field_150602_h); + public static final BiomeGenBase field_150608_ab = (new BiomeGenMesa(39, false, false)).setColor(13274213).setBiomeName("Mesa Plateau").func_150570_a(field_150602_h); + protected static final NoiseGeneratorPerlin field_150605_ac; + protected static final NoiseGeneratorPerlin field_150606_ad; + protected static final WorldGenDoublePlant field_150610_ae; + public String biomeName; + public int color; + public int field_150609_ah; + + /** The block expected to be on the top of this biome */ + public Block topBlock; + public int field_150604_aj; + + /** The block to fill spots in when not on the top */ + public Block fillerBlock; + public int field_76754_C; + + /** The minimum height of this biome. Default 0.1. */ + public float minHeight; + + /** The maximum height of this biome. Default 0.3. */ + public float maxHeight; + + /** The temperature of this biome. */ + public float temperature; + + /** The rainfall in this biome. */ + public float rainfall; + + /** Color tint applied to water depending on biome */ + public int waterColorMultiplier; + + /** The biome decorator. */ + public BiomeDecorator theBiomeDecorator; + + /** + * Holds the classes of IMobs (hostile mobs) that can be spawned in the biome. + */ + protected List spawnableMonsterList; + + /** + * Holds the classes of any creature that can be spawned in the biome as friendly creature. + */ + protected List spawnableCreatureList; + + /** + * Holds the classes of any aquatic creature that can be spawned in the water of the biome. + */ + protected List spawnableWaterCreatureList; + protected List spawnableCaveCreatureList; + + /** Set to true if snow is enabled for this biome. */ + protected boolean enableSnow; + + /** + * Is true (default) if the biome support rain (desert and nether can't have rain) + */ + protected boolean enableRain; + + /** The id number to this biome, and its index in the biomeList array. */ + public final int biomeID; + + /** The tree generator. */ + protected WorldGenTrees worldGeneratorTrees; + + /** The big tree generator. */ + protected WorldGenBigTree worldGeneratorBigTree; + + /** The swamp tree generator. */ + protected WorldGenSwamp worldGeneratorSwamp; + + + protected BiomeGenBase(int p_i1971_1_) { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + this.field_76754_C = 5169201; + this.minHeight = field_150596_a.field_150777_a; + this.maxHeight = field_150596_a.field_150776_b; + this.temperature = 0.5F; + this.rainfall = 0.5F; + this.waterColorMultiplier = 16777215; + this.spawnableMonsterList = new ArrayList(); + this.spawnableCreatureList = new ArrayList(); + this.spawnableWaterCreatureList = new ArrayList(); + this.spawnableCaveCreatureList = new ArrayList(); + this.enableRain = true; + this.worldGeneratorTrees = new WorldGenTrees(false); + this.worldGeneratorBigTree = new WorldGenBigTree(false); + this.worldGeneratorSwamp = new WorldGenSwamp(); + this.biomeID = p_i1971_1_; + biomeList[p_i1971_1_] = this; + this.theBiomeDecorator = this.createBiomeDecorator(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + } + + /** + * Allocate a new BiomeDecorator for this BiomeGenBase + */ + protected BiomeDecorator createBiomeDecorator() { + return new BiomeDecorator(); + } + + /** + * Sets the temperature and rainfall of this biome. + */ + protected BiomeGenBase setTemperatureRainfall(float p_76732_1_, float p_76732_2_) { + if (p_76732_1_ > 0.1F && p_76732_1_ < 0.2F) { + throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow"); + } else { + this.temperature = p_76732_1_; + this.rainfall = p_76732_2_; + return this; + } + } + + protected final BiomeGenBase func_150570_a(BiomeGenBase.Height p_150570_1_) { + this.minHeight = p_150570_1_.field_150777_a; + this.maxHeight = p_150570_1_.field_150776_b; + return this; + } + + /** + * Disable the rain for the biome. + */ + protected BiomeGenBase setDisableRain() { + this.enableRain = false; + return this; + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return p_150567_1_.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees; + } + + /** + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(Random p_76730_1_) { + return new WorldGenTallGrass(Blocks.tallgrass, 1); + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) { + return p_150572_1_.nextInt(3) > 0 ? BlockFlower.field_149858_b[0] : BlockFlower.field_149859_a[0]; + } + + /** + * sets enableSnow to true during biome initialization. returns BiomeGenBase. + */ + protected BiomeGenBase setEnableSnow() { + this.enableSnow = true; + return this; + } + + protected BiomeGenBase setBiomeName(String p_76735_1_) { + this.biomeName = p_76735_1_; + return this; + } + + protected BiomeGenBase func_76733_a(int p_76733_1_) { + this.field_76754_C = p_76733_1_; + return this; + } + + protected BiomeGenBase setColor(int p_76739_1_) { + this.func_150557_a(p_76739_1_, false); + return this; + } + + protected BiomeGenBase func_150563_c(int p_150563_1_) { + this.field_150609_ah = p_150563_1_; + return this; + } + + protected BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) { + this.color = p_150557_1_; + + if (p_150557_2_) { + this.field_150609_ah = (p_150557_1_ & 16711422) >> 1; + } else { + this.field_150609_ah = p_150557_1_; + } + + return this; + } + + /** + * takes temperature, returns color + */ + public int getSkyColorByTemp(float p_76731_1_) { + p_76731_1_ /= 3.0F; + + if (p_76731_1_ < -1.0F) { + p_76731_1_ = -1.0F; + } + + if (p_76731_1_ > 1.0F) { + p_76731_1_ = 1.0F; + } + + return Color.getHSBColor(0.62222224F - p_76731_1_ * 0.05F, 0.5F + p_76731_1_ * 0.1F, 1.0F).getRGB(); + } + + /** + * Returns the correspondent list of the EnumCreatureType informed. + */ + public List getSpawnableList(EnumCreatureType p_76747_1_) { + return p_76747_1_ == EnumCreatureType.monster ? this.spawnableMonsterList : (p_76747_1_ == EnumCreatureType.creature ? this.spawnableCreatureList : (p_76747_1_ == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (p_76747_1_ == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null))); + } + + /** + * Returns true if the biome have snowfall instead a normal rain. + */ + public boolean getEnableSnow() { + return this.func_150559_j(); + } + + /** + * Return true if the biome supports lightning bolt spawn, either by have the bolts enabled and have rain enabled. + */ + public boolean canSpawnLightningBolt() { + return !this.func_150559_j() && this.enableRain; + } + + /** + * Checks to see if the rainfall level of the biome is extremely high + */ + public boolean isHighHumidity() { + return this.rainfall > 0.85F; + } + + /** + * returns the chance a creature has to spawn. + */ + public float getSpawningChance() { + return 0.1F; + } + + /** + * Gets an integer representation of this biome's rainfall + */ + public final int getIntRainfall() { + return (int)(this.rainfall * 65536.0F); + } + + /** + * Gets a floating point representation of this biome's rainfall + */ + public final float getFloatRainfall() { + return this.rainfall; + } + + /** + * Gets a floating point representation of this biome's temperature + */ + public final float getFloatTemperature(int p_150564_1_, int p_150564_2_, int p_150564_3_) { + if (p_150564_2_ > 64) { + float var4 = (float)field_150605_ac.func_151601_a((double)p_150564_1_ * 1.0D / 8.0D, (double)p_150564_3_ * 1.0D / 8.0D) * 4.0F; + return this.temperature - (var4 + (float)p_150564_2_ - 64.0F) * 0.05F / 30.0F; + } else { + return this.temperature; + } + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + this.theBiomeDecorator.func_150512_a(p_76728_1_, p_76728_2_, this, p_76728_3_, p_76728_4_); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) { + double var4 = MathHelper.clamp_float(this.getFloatTemperature(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F); + double var6 = MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return ColorizerGrass.getGrassColor(var4, var6); + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) { + double var4 = MathHelper.clamp_float(this.getFloatTemperature(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F); + double var6 = MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return ColorizerFoliage.getFoliageColor(var4, var6); + } + + public boolean func_150559_j() { + return this.enableSnow; + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + this.func_150560_b(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + public final void func_150560_b(World p_150560_1_, Random p_150560_2_, Block[] p_150560_3_, byte[] p_150560_4_, int p_150560_5_, int p_150560_6_, double p_150560_7_) { + boolean var9 = true; + Block var10 = this.topBlock; + byte var11 = (byte)(this.field_150604_aj & 255); + Block var12 = this.fillerBlock; + int var13 = -1; + int var14 = (int)(p_150560_7_ / 3.0D + 3.0D + p_150560_2_.nextDouble() * 0.25D); + int var15 = p_150560_5_ & 15; + int var16 = p_150560_6_ & 15; + int var17 = p_150560_3_.length / 256; + + for (int var18 = 255; var18 >= 0; --var18) { + int var19 = (var16 * 16 + var15) * var17 + var18; + + if (var18 <= 0 + p_150560_2_.nextInt(5)) { + p_150560_3_[var19] = Blocks.bedrock; + } else { + Block var20 = p_150560_3_[var19]; + + if (var20 != null && var20.getMaterial() != Material.air) { + if (var20 == Blocks.stone) { + if (var13 == -1) { + if (var14 <= 0) { + var10 = null; + var11 = 0; + var12 = Blocks.stone; + } else if (var18 >= 59 && var18 <= 64) { + var10 = this.topBlock; + var11 = (byte)(this.field_150604_aj & 255); + var12 = this.fillerBlock; + } + + if (var18 < 63 && (var10 == null || var10.getMaterial() == Material.air)) { + if (this.getFloatTemperature(p_150560_5_, var18, p_150560_6_) < 0.15F) { + var10 = Blocks.ice; + var11 = 0; + } else { + var10 = Blocks.water; + var11 = 0; + } + } + + var13 = var14; + + if (var18 >= 62) { + p_150560_3_[var19] = var10; + p_150560_4_[var19] = var11; + } else if (var18 < 56 - var14) { + var10 = null; + var12 = Blocks.stone; + p_150560_3_[var19] = Blocks.gravel; + } else { + p_150560_3_[var19] = var12; + } + } else if (var13 > 0) { + --var13; + p_150560_3_[var19] = var12; + + if (var13 == 0 && var12 == Blocks.sand) { + var13 = p_150560_2_.nextInt(4) + Math.max(0, var18 - 63); + var12 = Blocks.sandstone; + } + } + } + } else { + var13 = -1; + } + } + } + } + + protected BiomeGenBase func_150566_k() { + return new BiomeGenMutated(this.biomeID + 128, this); + } + + public Class func_150562_l() { + return this.getClass(); + } + + public boolean func_150569_a(BiomeGenBase p_150569_1_) { + return p_150569_1_ == this || (p_150569_1_ != null && this.func_150562_l() == p_150569_1_.func_150562_l()); + } + + public BiomeGenBase.TempCategory func_150561_m() { + return (double)this.temperature < 0.2D ? BiomeGenBase.TempCategory.COLD : ((double)this.temperature < 1.0D ? BiomeGenBase.TempCategory.MEDIUM : BiomeGenBase.TempCategory.WARM); + } + + public static BiomeGenBase[] getBiomeGenArray() { + return biomeList; + } + + public static BiomeGenBase func_150568_d(int p_150568_0_) { + if (p_150568_0_ >= 0 && p_150568_0_ <= biomeList.length) { + return biomeList[p_150568_0_]; + } else { + logger.warn("Biome ID is out of bounds: " + p_150568_0_ + ", defaulting to 0 (Ocean)"); + return ocean; + } + } + + static { + plains.func_150566_k(); + desert.func_150566_k(); + forest.func_150566_k(); + taiga.func_150566_k(); + swampland.func_150566_k(); + icePlains.func_150566_k(); + jungle.func_150566_k(); + field_150574_L.func_150566_k(); + field_150584_S.func_150566_k(); + field_150588_X.func_150566_k(); + field_150587_Y.func_150566_k(); + field_150589_Z.func_150566_k(); + field_150607_aa.func_150566_k(); + field_150608_ab.func_150566_k(); + field_150583_P.func_150566_k(); + field_150582_Q.func_150566_k(); + field_150585_R.func_150566_k(); + field_150578_U.func_150566_k(); + extremeHills.func_150566_k(); + field_150580_W.func_150566_k(); + biomeList[field_150581_V.biomeID + 128] = biomeList[field_150578_U.biomeID + 128]; + BiomeGenBase[] var0 = biomeList; + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + BiomeGenBase var3 = var0[var2]; + + if (var3 != null && var3.biomeID < 128) { + field_150597_n.add(var3); + } + } + + field_150597_n.remove(hell); + field_150597_n.remove(sky); + field_150597_n.remove(frozenOcean); + field_150597_n.remove(extremeHillsEdge); + field_150605_ac = new NoiseGeneratorPerlin(new Random(1234L), 1); + field_150606_ad = new NoiseGeneratorPerlin(new Random(2345L), 1); + field_150610_ae = new WorldGenDoublePlant(); + } + + public static class Height { + public float field_150777_a; + public float field_150776_b; + + + public Height(float p_i45371_1_, float p_i45371_2_) { + this.field_150777_a = p_i45371_1_; + this.field_150776_b = p_i45371_2_; + } + + public BiomeGenBase.Height func_150775_a() { + return new BiomeGenBase.Height(this.field_150777_a * 0.8F, this.field_150776_b * 0.6F); + } + } + + public static class SpawnListEntry extends WeightedRandom.Item { + public Class entityClass; + public int minGroupCount; + public int maxGroupCount; + + + public SpawnListEntry(Class p_i1970_1_, int p_i1970_2_, int p_i1970_3_, int p_i1970_4_) { + super(p_i1970_2_); + this.entityClass = p_i1970_1_; + this.minGroupCount = p_i1970_3_; + this.maxGroupCount = p_i1970_4_; + } + + public String toString() { + return this.entityClass.getSimpleName() + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + this.itemWeight; + } + } + + public enum TempCategory { + OCEAN("OCEAN", 0), + COLD("COLD", 1), + MEDIUM("MEDIUM", 2), + WARM("WARM", 3); + + private static final BiomeGenBase.TempCategory[] $VALUES = new BiomeGenBase.TempCategory[]{OCEAN, COLD, MEDIUM, WARM}; + + + TempCategory(String p_i45372_1_, int p_i45372_2_) {} + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java new file mode 100644 index 0000000..81c2761 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java @@ -0,0 +1,18 @@ +package net.minecraft.world.biome; + +import net.minecraft.init.Blocks; + +public class BiomeGenBeach extends BiomeGenBase { + + + public BiomeGenBeach(int p_i1969_1_) { + super(p_i1969_1_); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand; + this.fillerBlock = Blocks.sand; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java new file mode 100644 index 0000000..5b57004 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java @@ -0,0 +1,33 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenDesertWells; + +public class BiomeGenDesert extends BiomeGenBase { + + + public BiomeGenDesert(int p_i1977_1_) { + super(p_i1977_1_); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand; + this.fillerBlock = Blocks.sand; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 2; + this.theBiomeDecorator.reedsPerChunk = 50; + this.theBiomeDecorator.cactiPerChunk = 10; + this.spawnableCreatureList.clear(); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + + if (p_76728_2_.nextInt(1000) == 0) { + int var5 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int var6 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + WorldGenDesertWells var7 = new WorldGenDesertWells(); + var7.generate(p_76728_1_, p_76728_2_, var5, p_76728_1_.getHeightValue(var5, var6) + 1, var6); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java new file mode 100644 index 0000000..400e02f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java @@ -0,0 +1,27 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.init.Blocks; + +public class BiomeGenEnd extends BiomeGenBase { + + + public BiomeGenEnd(int p_i1990_1_) { + super(p_i1990_1_); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4)); + this.topBlock = Blocks.dirt; + this.fillerBlock = Blocks.dirt; + this.theBiomeDecorator = new BiomeEndDecorator(); + } + + /** + * takes temperature, returns color + */ + public int getSkyColorByTemp(float p_76731_1_) { + return 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenForest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenForest.java new file mode 100644 index 0000000..854a410 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenForest.java @@ -0,0 +1,184 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; + +public class BiomeGenForest extends BiomeGenBase { + private final int field_150632_aF; + protected static final WorldGenForest field_150629_aC = new WorldGenForest(false, true); + protected static final WorldGenForest field_150630_aD = new WorldGenForest(false, false); + protected static final WorldGenCanopyTree field_150631_aE = new WorldGenCanopyTree(false); + + + public BiomeGenForest(int p_i45377_1_, int p_i45377_2_) { + super(p_i45377_1_); + this.field_150632_aF = p_i45377_2_; + this.theBiomeDecorator.treesPerChunk = 10; + this.theBiomeDecorator.grassPerChunk = 2; + + if (this.field_150632_aF == 1) { + this.theBiomeDecorator.treesPerChunk = 6; + this.theBiomeDecorator.flowersPerChunk = 100; + this.theBiomeDecorator.grassPerChunk = 1; + } + + this.func_76733_a(5159473); + this.setTemperatureRainfall(0.7F, 0.8F); + + if (this.field_150632_aF == 2) { + this.field_150609_ah = 353825; + this.color = 3175492; + this.setTemperatureRainfall(0.6F, 0.6F); + } + + if (this.field_150632_aF == 0) { + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 4, 4)); + } + + if (this.field_150632_aF == 3) { + this.theBiomeDecorator.treesPerChunk = -999; + } + } + + protected BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) { + if (this.field_150632_aF == 2) { + this.field_150609_ah = 353825; + this.color = p_150557_1_; + + if (p_150557_2_) { + this.field_150609_ah = (this.field_150609_ah & 16711422) >> 1; + } + + return this; + } else { + return super.func_150557_a(p_150557_1_, p_150557_2_); + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return this.field_150632_aF == 3 && p_150567_1_.nextInt(3) > 0 ? field_150631_aE : (this.field_150632_aF != 2 && p_150567_1_.nextInt(5) != 0 ? this.worldGeneratorTrees : field_150630_aD); + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) { + if (this.field_150632_aF == 1) { + double var5 = MathHelper.clamp_double((1.0D + field_150606_ad.func_151601_a((double)p_150572_2_ / 48.0D, (double)p_150572_4_ / 48.0D)) / 2.0D, 0.0D, 0.9999D); + int var7 = (int)(var5 * (double)BlockFlower.field_149859_a.length); + + if (var7 == 1) { + var7 = 0; + } + + return BlockFlower.field_149859_a[var7]; + } else { + return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_); + } + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + int var5; + int var6; + int var7; + int var8; + int var9; + + if (this.field_150632_aF == 3) { + for (var5 = 0; var5 < 4; ++var5) { + for (var6 = 0; var6 < 4; ++var6) { + var7 = p_76728_3_ + var5 * 4 + 1 + 8 + p_76728_2_.nextInt(3); + var8 = p_76728_4_ + var6 * 4 + 1 + 8 + p_76728_2_.nextInt(3); + var9 = p_76728_1_.getHeightValue(var7, var8); + + if (p_76728_2_.nextInt(20) == 0) { + WorldGenBigMushroom var10 = new WorldGenBigMushroom(); + var10.generate(p_76728_1_, p_76728_2_, var7, var9, var8); + } else { + WorldGenAbstractTree var12 = this.func_150567_a(p_76728_2_); + var12.setScale(1.0D, 1.0D, 1.0D); + + if (var12.generate(p_76728_1_, p_76728_2_, var7, var9, var8)) { + var12.func_150524_b(p_76728_1_, p_76728_2_, var7, var9, var8); + } + } + } + } + } + + var5 = p_76728_2_.nextInt(5) - 3; + + if (this.field_150632_aF == 1) { + var5 += 2; + } + + var6 = 0; + + while (var6 < var5) { + var7 = p_76728_2_.nextInt(3); + + if (var7 == 0) { + field_150610_ae.func_150548_a(1); + } else if (var7 == 1) { + field_150610_ae.func_150548_a(4); + } else if (var7 == 2) { + field_150610_ae.func_150548_a(5); + } + + var8 = 0; + + while (true) { + if (var8 < 5) { + var9 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int var13 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int var11 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(var9, var13) + 32); + + if (!field_150610_ae.generate(p_76728_1_, p_76728_2_, var9, var11, var13)) { + ++var8; + continue; + } + } + + ++var6; + break; + } + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) { + int var4 = super.getBiomeGrassColor(p_150558_1_, p_150558_2_, p_150558_3_); + return this.field_150632_aF == 3 ? (var4 & 16711422) + 2634762 >> 1 : var4; + } + + protected BiomeGenBase func_150566_k() { + if (this.biomeID == BiomeGenBase.forest.biomeID) { + BiomeGenForest var1 = new BiomeGenForest(this.biomeID + 128, 1); + var1.func_150570_a(new BiomeGenBase.Height(this.minHeight, this.maxHeight + 0.2F)); + var1.setBiomeName("Flower Forest"); + var1.func_150557_a(6976549, true); + var1.func_76733_a(8233509); + return var1; + } else { + return this.biomeID != BiomeGenBase.field_150583_P.biomeID && this.biomeID != BiomeGenBase.field_150582_Q.biomeID ? new BiomeGenMutated(this.biomeID + 128, this) { + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + this.field_150611_aD.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + }: new BiomeGenMutated(this.biomeID + 128, this) { + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return p_150567_1_.nextBoolean() ? BiomeGenForest.field_150629_aC : BiomeGenForest.field_150630_aD; + } + }; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenHell.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenHell.java new file mode 100644 index 0000000..d2d0109 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenHell.java @@ -0,0 +1,20 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; + +public class BiomeGenHell extends BiomeGenBase { + + + public BiomeGenHell(int p_i1981_1_) { + super(p_i1981_1_); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 50, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenHills.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenHills.java new file mode 100644 index 0000000..05f5eb8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenHills.java @@ -0,0 +1,93 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenHills extends BiomeGenBase { + private final WorldGenerator theWorldGenerator; + private final WorldGenTaiga2 field_150634_aD; + private final int field_150635_aE; + private final int field_150636_aF; + private final int field_150637_aG; + private int field_150638_aH; + + + protected BiomeGenHills(int p_i45373_1_, boolean p_i45373_2_) { + super(p_i45373_1_); + this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg, 8); + this.field_150634_aD = new WorldGenTaiga2(false); + this.field_150635_aE = 0; + this.field_150636_aF = 1; + this.field_150637_aG = 2; + this.field_150638_aH = this.field_150635_aE; + + if (p_i45373_2_) { + this.theBiomeDecorator.treesPerChunk = 3; + this.field_150638_aH = this.field_150636_aF; + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return p_150567_1_.nextInt(3) > 0 ? this.field_150634_aD : super.func_150567_a(p_150567_1_); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + int var5 = 3 + p_76728_2_.nextInt(6); + int var6; + int var7; + int var8; + + for (var6 = 0; var6 < var5; ++var6) { + var7 = p_76728_3_ + p_76728_2_.nextInt(16); + var8 = p_76728_2_.nextInt(28) + 4; + int var9 = p_76728_4_ + p_76728_2_.nextInt(16); + + if (p_76728_1_.getBlock(var7, var8, var9) == Blocks.stone) { + p_76728_1_.setBlock(var7, var8, var9, Blocks.emerald_ore, 0, 2); + } + } + + for (var5 = 0; var5 < 7; ++var5) { + var6 = p_76728_3_ + p_76728_2_.nextInt(16); + var7 = p_76728_2_.nextInt(64); + var8 = p_76728_4_ + p_76728_2_.nextInt(16); + this.theWorldGenerator.generate(p_76728_1_, p_76728_2_, var6, var7, var8); + } + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + + if ((p_150573_7_ < -1.0D || p_150573_7_ > 2.0D) && this.field_150638_aH == this.field_150637_aG) { + this.topBlock = Blocks.gravel; + this.fillerBlock = Blocks.gravel; + } else if (p_150573_7_ > 1.0D && this.field_150638_aH != this.field_150636_aF) { + this.topBlock = Blocks.stone; + this.fillerBlock = Blocks.stone; + } + + this.func_150560_b(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + private BiomeGenHills func_150633_b(BiomeGenBase p_150633_1_) { + this.field_150638_aH = this.field_150637_aG; + this.func_150557_a(p_150633_1_.color, true); + this.setBiomeName(p_150633_1_.biomeName + " M"); + this.func_150570_a(new BiomeGenBase.Height(p_150633_1_.minHeight, p_150633_1_.maxHeight)); + this.setTemperatureRainfall(p_150633_1_.temperature, p_150633_1_.rainfall); + return this; + } + + protected BiomeGenBase func_150566_k() { + return (new BiomeGenHills(this.biomeID + 128, false)).func_150633_b(this); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java new file mode 100644 index 0000000..cc58b1d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java @@ -0,0 +1,67 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMelon; +import net.minecraft.world.gen.feature.WorldGenShrub; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenVines; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenJungle extends BiomeGenBase { + private final boolean field_150614_aC; + + + public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_) { + super(p_i45379_1_); + this.field_150614_aC = p_i45379_2_; + + if (p_i45379_2_) { + this.theBiomeDecorator.treesPerChunk = 2; + } else { + this.theBiomeDecorator.treesPerChunk = 50; + } + + this.theBiomeDecorator.grassPerChunk = 25; + this.theBiomeDecorator.flowersPerChunk = 4; + + if (!p_i45379_2_) { + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1)); + } + + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return p_150567_1_.nextInt(10) == 0 ? this.worldGeneratorBigTree : (p_150567_1_.nextInt(2) == 0 ? new WorldGenShrub(3, 0) : (!this.field_150614_aC && p_150567_1_.nextInt(3) == 0 ? new WorldGenMegaJungle(false, 10, 20, 3, 3) : new WorldGenTrees(false, 4 + p_150567_1_.nextInt(7), 3, 3, true))); + } + + /** + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(Random p_76730_1_) { + return p_76730_1_.nextInt(4) == 0 ? new WorldGenTallGrass(Blocks.tallgrass, 2) : new WorldGenTallGrass(Blocks.tallgrass, 1); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + int var5 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int var6 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int var7 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(var5, var6) * 2); + (new WorldGenMelon()).generate(p_76728_1_, p_76728_2_, var5, var7, var6); + WorldGenVines var10 = new WorldGenVines(); + + for (var6 = 0; var6 < 50; ++var6) { + var7 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + short var8 = 128; + int var9 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + var10.generate(p_76728_1_, p_76728_2_, var7, var8, var9); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java new file mode 100644 index 0000000..4d8de1c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java @@ -0,0 +1,303 @@ +package net.minecraft.world.biome; + +import java.util.Arrays; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenMesa extends BiomeGenBase { + private byte[] field_150621_aC; + private long field_150622_aD; + private NoiseGeneratorPerlin field_150623_aE; + private NoiseGeneratorPerlin field_150624_aF; + private NoiseGeneratorPerlin field_150625_aG; + private final boolean field_150626_aH; + private final boolean field_150620_aI; + + + public BiomeGenMesa(int p_i45380_1_, boolean p_i45380_2_, boolean p_i45380_3_) { + super(p_i45380_1_); + this.field_150626_aH = p_i45380_2_; + this.field_150620_aI = p_i45380_3_; + this.setDisableRain(); + this.setTemperatureRainfall(2.0F, 0.0F); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand; + this.field_150604_aj = 1; + this.fillerBlock = Blocks.stained_hardened_clay; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 20; + this.theBiomeDecorator.reedsPerChunk = 3; + this.theBiomeDecorator.cactiPerChunk = 5; + this.theBiomeDecorator.flowersPerChunk = 0; + this.spawnableCreatureList.clear(); + + if (p_i45380_3_) { + this.theBiomeDecorator.treesPerChunk = 5; + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return this.worldGeneratorTrees; + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) { + return 10387789; + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) { + return 9470285; + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + if (this.field_150621_aC == null || this.field_150622_aD != p_150573_1_.getSeed()) { + this.func_150619_a(p_150573_1_.getSeed()); + } + + if (this.field_150623_aE == null || this.field_150624_aF == null || this.field_150622_aD != p_150573_1_.getSeed()) { + Random var9 = new Random(this.field_150622_aD); + this.field_150623_aE = new NoiseGeneratorPerlin(var9, 4); + this.field_150624_aF = new NoiseGeneratorPerlin(var9, 1); + } + + this.field_150622_aD = p_150573_1_.getSeed(); + double var25 = 0.0D; + int var11; + int var12; + + if (this.field_150626_aH) { + var11 = (p_150573_5_ & -16) + (p_150573_6_ & 15); + var12 = (p_150573_6_ & -16) + (p_150573_5_ & 15); + double var13 = Math.min(Math.abs(p_150573_7_), this.field_150623_aE.func_151601_a((double)var11 * 0.25D, (double)var12 * 0.25D)); + + if (var13 > 0.0D) { + double var15 = 0.001953125D; + double var17 = Math.abs(this.field_150624_aF.func_151601_a((double)var11 * var15, (double)var12 * var15)); + var25 = var13 * var13 * 2.5D; + double var19 = Math.ceil(var17 * 50.0D) + 14.0D; + + if (var25 > var19) { + var25 = var19; + } + + var25 += 64.0D; + } + } + + var11 = p_150573_5_ & 15; + var12 = p_150573_6_ & 15; + boolean var26 = true; + Block var14 = Blocks.stained_hardened_clay; + Block var27 = this.fillerBlock; + int var16 = (int)(p_150573_7_ / 3.0D + 3.0D + p_150573_2_.nextDouble() * 0.25D); + boolean var28 = Math.cos(p_150573_7_ / 3.0D * Math.PI) > 0.0D; + int var18 = -1; + boolean var29 = false; + int var20 = p_150573_3_.length / 256; + + for (int var21 = 255; var21 >= 0; --var21) { + int var22 = (var12 * 16 + var11) * var20 + var21; + + if ((p_150573_3_[var22] == null || p_150573_3_[var22].getMaterial() == Material.air) && var21 < (int)var25) { + p_150573_3_[var22] = Blocks.stone; + } + + if (var21 <= 0 + p_150573_2_.nextInt(5)) { + p_150573_3_[var22] = Blocks.bedrock; + } else { + Block var23 = p_150573_3_[var22]; + + if (var23 != null && var23.getMaterial() != Material.air) { + if (var23 == Blocks.stone) { + byte var24; + + if (var18 == -1) { + var29 = false; + + if (var16 <= 0) { + var14 = null; + var27 = Blocks.stone; + } else if (var21 >= 59 && var21 <= 64) { + var14 = Blocks.stained_hardened_clay; + var27 = this.fillerBlock; + } + + if (var21 < 63 && (var14 == null || var14.getMaterial() == Material.air)) { + var14 = Blocks.water; + } + + var18 = var16 + Math.max(0, var21 - 63); + + if (var21 >= 62) { + if (this.field_150620_aI && var21 > 86 + var16 * 2) { + if (var28) { + p_150573_3_[var22] = Blocks.dirt; + p_150573_4_[var22] = 1; + } + else { + p_150573_3_[var22] = Blocks.grass; + } + } else if (var21 > 66 + var16) { + var24 = 16; + + if (var21 >= 64 && var21 <= 127) { + if (!var28) { + var24 = this.func_150618_d(p_150573_5_, var21, p_150573_6_); + } + } + else { + var24 = 1; + } + + if (var24 < 16) { + p_150573_3_[var22] = Blocks.stained_hardened_clay; + p_150573_4_[var22] = var24; + } + else { + p_150573_3_[var22] = Blocks.hardened_clay; + } + } else { + p_150573_3_[var22] = this.topBlock; + p_150573_4_[var22] = (byte)this.field_150604_aj; + var29 = true; + } + } else { + p_150573_3_[var22] = var27; + + if (var27 == Blocks.stained_hardened_clay) { + p_150573_4_[var22] = 1; + } + } + } else if (var18 > 0) { + --var18; + + if (var29) { + p_150573_3_[var22] = Blocks.stained_hardened_clay; + p_150573_4_[var22] = 1; + } else { + var24 = this.func_150618_d(p_150573_5_, var21, p_150573_6_); + + if (var24 < 16) { + p_150573_3_[var22] = Blocks.stained_hardened_clay; + p_150573_4_[var22] = var24; + } else { + p_150573_3_[var22] = Blocks.hardened_clay; + } + } + } + } + } else { + var18 = -1; + } + } + } + } + + private void func_150619_a(long p_150619_1_) { + this.field_150621_aC = new byte[64]; + Arrays.fill(this.field_150621_aC, (byte)16); + Random var3 = new Random(p_150619_1_); + this.field_150625_aG = new NoiseGeneratorPerlin(var3, 1); + int var4; + + for (var4 = 0; var4 < 64; ++var4) { + var4 += var3.nextInt(5) + 1; + + if (var4 < 64) { + this.field_150621_aC[var4] = 1; + } + } + + var4 = var3.nextInt(4) + 2; + int var5; + int var6; + int var7; + int var8; + + for (var5 = 0; var5 < var4; ++var5) { + var6 = var3.nextInt(3) + 1; + var7 = var3.nextInt(64); + + for (var8 = 0; var7 + var8 < 64 && var8 < var6; ++var8) { + this.field_150621_aC[var7 + var8] = 4; + } + } + + var5 = var3.nextInt(4) + 2; + int var9; + + for (var6 = 0; var6 < var5; ++var6) { + var7 = var3.nextInt(3) + 2; + var8 = var3.nextInt(64); + + for (var9 = 0; var8 + var9 < 64 && var9 < var7; ++var9) { + this.field_150621_aC[var8 + var9] = 12; + } + } + + var6 = var3.nextInt(4) + 2; + + for (var7 = 0; var7 < var6; ++var7) { + var8 = var3.nextInt(3) + 1; + var9 = var3.nextInt(64); + + for (int var10 = 0; var9 + var10 < 64 && var10 < var8; ++var10) { + this.field_150621_aC[var9 + var10] = 14; + } + } + + var7 = var3.nextInt(3) + 3; + var8 = 0; + + for (var9 = 0; var9 < var7; ++var9) { + byte var12 = 1; + var8 += var3.nextInt(16) + 4; + + for (int var11 = 0; var8 + var11 < 64 && var11 < var12; ++var11) { + this.field_150621_aC[var8 + var11] = 0; + + if (var8 + var11 > 1 && var3.nextBoolean()) { + this.field_150621_aC[var8 + var11 - 1] = 8; + } + + if (var8 + var11 < 63 && var3.nextBoolean()) { + this.field_150621_aC[var8 + var11 + 1] = 8; + } + } + } + } + + private byte func_150618_d(int p_150618_1_, int p_150618_2_, int p_150618_3_) { + int var4 = (int)Math.round(this.field_150625_aG.func_151601_a((double)p_150618_1_ * 1.0D / 512.0D, (double)p_150618_1_ * 1.0D / 512.0D) * 2.0D); + return this.field_150621_aC[(p_150618_2_ + var4 + 64) % 64]; + } + + protected BiomeGenBase func_150566_k() { + boolean var1 = this.biomeID == BiomeGenBase.field_150589_Z.biomeID; + BiomeGenMesa var2 = new BiomeGenMesa(this.biomeID + 128, var1, this.field_150620_aI); + + if (!var1) { + var2.func_150570_a(field_150591_g); + var2.setBiomeName(this.biomeName + " M"); + } else { + var2.setBiomeName(this.biomeName + " (Bryce)"); + } + + var2.func_150557_a(this.color, true); + return var2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java new file mode 100644 index 0000000..a7dabfc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java @@ -0,0 +1,22 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.init.Blocks; + +public class BiomeGenMushroomIsland extends BiomeGenBase { + + + public BiomeGenMushroomIsland(int p_i1984_1_) { + super(p_i1984_1_); + this.theBiomeDecorator.treesPerChunk = -100; + this.theBiomeDecorator.flowersPerChunk = -100; + this.theBiomeDecorator.grassPerChunk = -100; + this.theBiomeDecorator.mushroomsPerChunk = 1; + this.theBiomeDecorator.bigMushroomsPerChunk = 1; + this.topBlock = Blocks.mycelium; + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java new file mode 100644 index 0000000..6bf613b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java @@ -0,0 +1,82 @@ +package net.minecraft.world.biome; + +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenMutated extends BiomeGenBase { + protected BiomeGenBase field_150611_aD; + + + public BiomeGenMutated(int p_i45381_1_, BiomeGenBase p_i45381_2_) { + super(p_i45381_1_); + this.field_150611_aD = p_i45381_2_; + this.func_150557_a(p_i45381_2_.color, true); + this.biomeName = p_i45381_2_.biomeName + " M"; + this.topBlock = p_i45381_2_.topBlock; + this.fillerBlock = p_i45381_2_.fillerBlock; + this.field_76754_C = p_i45381_2_.field_76754_C; + this.minHeight = p_i45381_2_.minHeight; + this.maxHeight = p_i45381_2_.maxHeight; + this.temperature = p_i45381_2_.temperature; + this.rainfall = p_i45381_2_.rainfall; + this.waterColorMultiplier = p_i45381_2_.waterColorMultiplier; + this.enableSnow = p_i45381_2_.enableSnow; + this.enableRain = p_i45381_2_.enableRain; + this.spawnableCreatureList = new ArrayList(p_i45381_2_.spawnableCreatureList); + this.spawnableMonsterList = new ArrayList(p_i45381_2_.spawnableMonsterList); + this.spawnableCaveCreatureList = new ArrayList(p_i45381_2_.spawnableCaveCreatureList); + this.spawnableWaterCreatureList = new ArrayList(p_i45381_2_.spawnableWaterCreatureList); + this.temperature = p_i45381_2_.temperature; + this.rainfall = p_i45381_2_.rainfall; + this.minHeight = p_i45381_2_.minHeight + 0.1F; + this.maxHeight = p_i45381_2_.maxHeight + 0.2F; + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + this.field_150611_aD.theBiomeDecorator.func_150512_a(p_76728_1_, p_76728_2_, this, p_76728_3_, p_76728_4_); + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + this.field_150611_aD.func_150573_a(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + /** + * returns the chance a creature has to spawn. + */ + public float getSpawningChance() { + return this.field_150611_aD.getSpawningChance(); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return this.field_150611_aD.func_150567_a(p_150567_1_); + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) { + return this.field_150611_aD.getBiomeFoliageColor(p_150571_1_, p_150571_2_, p_150571_2_); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) { + return this.field_150611_aD.getBiomeGrassColor(p_150558_1_, p_150558_2_, p_150558_2_); + } + + public Class func_150562_l() { + return this.field_150611_aD.func_150562_l(); + } + + public boolean func_150569_a(BiomeGenBase p_150569_1_) { + return this.field_150611_aD.func_150569_a(p_150569_1_); + } + + public BiomeGenBase.TempCategory func_150561_m() { + return this.field_150611_aD.func_150561_m(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java new file mode 100644 index 0000000..6f02661 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenOcean.java @@ -0,0 +1,22 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class BiomeGenOcean extends BiomeGenBase { + + + public BiomeGenOcean(int p_i1985_1_) { + super(p_i1985_1_); + this.spawnableCreatureList.clear(); + } + + public BiomeGenBase.TempCategory func_150561_m() { + return BiomeGenBase.TempCategory.OCEAN; + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + super.func_150573_a(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java new file mode 100644 index 0000000..17e3d3b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java @@ -0,0 +1,82 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.world.World; + +public class BiomeGenPlains extends BiomeGenBase { + protected boolean field_150628_aC; + + + protected BiomeGenPlains(int p_i1986_1_) { + super(p_i1986_1_); + this.setTemperatureRainfall(0.8F, 0.4F); + this.func_150570_a(field_150593_e); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 2, 6)); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) { + double var5 = field_150606_ad.func_151601_a((double)p_150572_2_ / 200.0D, (double)p_150572_4_ / 200.0D); + int var7; + + if (var5 < -0.8D) { + var7 = p_150572_1_.nextInt(4); + return BlockFlower.field_149859_a[4 + var7]; + } else if (p_150572_1_.nextInt(3) > 0) { + var7 = p_150572_1_.nextInt(3); + return var7 == 0 ? BlockFlower.field_149859_a[0] : (var7 == 1 ? BlockFlower.field_149859_a[3] : BlockFlower.field_149859_a[8]); + } else { + return BlockFlower.field_149858_b[0]; + } + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + double var5 = field_150606_ad.func_151601_a((double)(p_76728_3_ + 8) / 200.0D, (double)(p_76728_4_ + 8) / 200.0D); + int var7; + int var8; + int var9; + int var10; + + if (var5 < -0.8D) { + this.theBiomeDecorator.flowersPerChunk = 15; + this.theBiomeDecorator.grassPerChunk = 5; + } else { + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + field_150610_ae.func_150548_a(2); + + for (var7 = 0; var7 < 7; ++var7) { + var8 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + var9 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + var10 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(var8, var9) + 32); + field_150610_ae.generate(p_76728_1_, p_76728_2_, var8, var10, var9); + } + } + + if (this.field_150628_aC) { + field_150610_ae.func_150548_a(0); + + for (var7 = 0; var7 < 10; ++var7) { + var8 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + var9 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + var10 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(var8, var9) + 32); + field_150610_ae.generate(p_76728_1_, p_76728_2_, var8, var10, var9); + } + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + protected BiomeGenBase func_150566_k() { + BiomeGenPlains var1 = new BiomeGenPlains(this.biomeID + 128); + var1.setBiomeName("Sunflower Plains"); + var1.field_150628_aC = true; + var1.setColor(9286496); + var1.field_150609_ah = 14273354; + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java new file mode 100644 index 0000000..d16a92c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenRiver.java @@ -0,0 +1,10 @@ +package net.minecraft.world.biome; + +public class BiomeGenRiver extends BiomeGenBase { + + + public BiomeGenRiver(int p_i1987_1_) { + super(p_i1987_1_); + this.spawnableCreatureList.clear(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java new file mode 100644 index 0000000..a829009 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java @@ -0,0 +1,78 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; + +public class BiomeGenSavanna extends BiomeGenBase { + private static final WorldGenSavannaTree field_150627_aC = new WorldGenSavannaTree(false); + + + protected BiomeGenSavanna(int p_i45383_1_) { + super(p_i45383_1_); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 1, 2, 6)); + this.theBiomeDecorator.treesPerChunk = 1; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 20; + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return p_150567_1_.nextInt(5) > 0 ? field_150627_aC : this.worldGeneratorTrees; + } + + protected BiomeGenBase func_150566_k() { + BiomeGenSavanna.Mutated var1 = new BiomeGenSavanna.Mutated(this.biomeID + 128, this); + var1.temperature = (this.temperature + 1.0F) * 0.5F; + var1.minHeight = this.minHeight * 0.5F + 0.3F; + var1.maxHeight = this.maxHeight * 0.5F + 1.2F; + return var1; + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + field_150610_ae.func_150548_a(2); + + for (int var5 = 0; var5 < 7; ++var5) { + int var6 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int var7 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int var8 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(var6, var7) + 32); + field_150610_ae.generate(p_76728_1_, p_76728_2_, var6, var8, var7); + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public static class Mutated extends BiomeGenMutated { + + + public Mutated(int p_i45382_1_, BiomeGenBase p_i45382_2_) { + super(p_i45382_1_, p_i45382_2_); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 2; + this.theBiomeDecorator.grassPerChunk = 5; + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + + if (p_150573_7_ > 1.75D) { + this.topBlock = Blocks.stone; + this.fillerBlock = Blocks.stone; + } else if (p_150573_7_ > -0.5D) { + this.topBlock = Blocks.dirt; + this.field_150604_aj = 1; + } + + this.func_150560_b(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + this.theBiomeDecorator.func_150512_a(p_76728_1_, p_76728_2_, this, p_76728_3_, p_76728_4_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java new file mode 100644 index 0000000..cf7d9ce --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java @@ -0,0 +1,60 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenIcePath; +import net.minecraft.world.gen.feature.WorldGenIceSpike; +import net.minecraft.world.gen.feature.WorldGenTaiga2; + +public class BiomeGenSnow extends BiomeGenBase { + private final boolean field_150615_aC; + private final WorldGenIceSpike field_150616_aD = new WorldGenIceSpike(); + private final WorldGenIcePath field_150617_aE = new WorldGenIcePath(4); + + + public BiomeGenSnow(int p_i45378_1_, boolean p_i45378_2_) { + super(p_i45378_1_); + this.field_150615_aC = p_i45378_2_; + + if (p_i45378_2_) { + this.topBlock = Blocks.snow; + } + + this.spawnableCreatureList.clear(); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + if (this.field_150615_aC) { + int var5; + int var6; + int var7; + + for (var5 = 0; var5 < 3; ++var5) { + var6 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + var7 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + this.field_150616_aD.generate(p_76728_1_, p_76728_2_, var6, p_76728_1_.getHeightValue(var6, var7), var7); + } + + for (var5 = 0; var5 < 2; ++var5) { + var6 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + var7 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + this.field_150617_aE.generate(p_76728_1_, p_76728_2_, var6, p_76728_1_.getHeightValue(var6, var7), var7); + } + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return new WorldGenTaiga2(false); + } + + protected BiomeGenBase func_150566_k() { + BiomeGenBase var1 = (new BiomeGenSnow(this.biomeID + 128, true)).func_150557_a(13828095, true).setBiomeName(this.biomeName + " Spikes").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).func_150570_a(new BiomeGenBase.Height(this.minHeight + 0.1F, this.maxHeight + 0.1F)); + var1.minHeight = this.minHeight + 0.3F; + var1.maxHeight = this.maxHeight + 0.4F; + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java new file mode 100644 index 0000000..410111e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java @@ -0,0 +1,18 @@ +package net.minecraft.world.biome; + +import net.minecraft.init.Blocks; + +public class BiomeGenStoneBeach extends BiomeGenBase { + + + public BiomeGenStoneBeach(int p_i45384_1_) { + super(p_i45384_1_); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.stone; + this.fillerBlock = Blocks.stone; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java new file mode 100644 index 0000000..c076994 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java @@ -0,0 +1,81 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenSwamp extends BiomeGenBase { + + + protected BiomeGenSwamp(int p_i1988_1_) { + super(p_i1988_1_); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 1; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 8; + this.theBiomeDecorator.reedsPerChunk = 10; + this.theBiomeDecorator.clayPerChunk = 1; + this.theBiomeDecorator.waterlilyPerChunk = 4; + this.theBiomeDecorator.sandPerChunk2 = 0; + this.theBiomeDecorator.sandPerChunk = 0; + this.theBiomeDecorator.grassPerChunk = 5; + this.waterColorMultiplier = 14745518; + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1)); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return this.worldGeneratorSwamp; + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) { + double var4 = field_150606_ad.func_151601_a((double)p_150558_1_ * 0.0225D, (double)p_150558_3_ * 0.0225D); + return var4 < -0.1D ? 5011004 : 6975545; + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) { + return 6975545; + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) { + return BlockFlower.field_149859_a[1]; + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + double var9 = field_150606_ad.func_151601_a((double)p_150573_5_ * 0.25D, (double)p_150573_6_ * 0.25D); + + if (var9 > 0.0D) { + int var11 = p_150573_5_ & 15; + int var12 = p_150573_6_ & 15; + int var13 = p_150573_3_.length / 256; + + for (int var14 = 255; var14 >= 0; --var14) { + int var15 = (var12 * 16 + var11) * var13 + var14; + + if (p_150573_3_[var15] == null || p_150573_3_[var15].getMaterial() != Material.air) { + if (var14 == 62 && p_150573_3_[var15] != Blocks.water) { + p_150573_3_[var15] = Blocks.water; + + if (var9 < 0.12D) { + p_150573_3_[var15 + 1] = Blocks.waterlily; + } + } + + break; + } + } + } + + this.func_150560_b(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java new file mode 100644 index 0000000..b68f6c0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java @@ -0,0 +1,102 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBlockBlob; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenTaiga1; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenTaiga extends BiomeGenBase { + private static final WorldGenTaiga1 field_150639_aC = new WorldGenTaiga1(); + private static final WorldGenTaiga2 field_150640_aD = new WorldGenTaiga2(false); + private static final WorldGenMegaPineTree field_150641_aE = new WorldGenMegaPineTree(false, false); + private static final WorldGenMegaPineTree field_150642_aF = new WorldGenMegaPineTree(false, true); + private static final WorldGenBlockBlob field_150643_aG = new WorldGenBlockBlob(Blocks.mossy_cobblestone, 0); + private final int field_150644_aH; + + + public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_) { + super(p_i45385_1_); + this.field_150644_aH = p_i45385_2_; + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4)); + this.theBiomeDecorator.treesPerChunk = 10; + + if (p_i45385_2_ != 1 && p_i45385_2_ != 2) { + this.theBiomeDecorator.grassPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 1; + } else { + this.theBiomeDecorator.grassPerChunk = 7; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 3; + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) { + return (this.field_150644_aH == 1 || this.field_150644_aH == 2) && p_150567_1_.nextInt(3) == 0 ? (this.field_150644_aH != 2 && p_150567_1_.nextInt(13) != 0 ? field_150641_aE : field_150642_aF) : (p_150567_1_.nextInt(3) == 0 ? field_150639_aC : field_150640_aD); + } + + /** + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(Random p_76730_1_) { + return p_76730_1_.nextInt(5) > 0 ? new WorldGenTallGrass(Blocks.tallgrass, 2) : new WorldGenTallGrass(Blocks.tallgrass, 1); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) { + int var5; + int var6; + int var7; + int var8; + + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) { + var5 = p_76728_2_.nextInt(3); + + for (var6 = 0; var6 < var5; ++var6) { + var7 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + var8 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int var9 = p_76728_1_.getHeightValue(var7, var8); + field_150643_aG.generate(p_76728_1_, p_76728_2_, var7, var9, var8); + } + } + + field_150610_ae.func_150548_a(3); + + for (var5 = 0; var5 < 7; ++var5) { + var6 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + var7 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + var8 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(var6, var7) + 32); + field_150610_ae.generate(p_76728_1_, p_76728_2_, var6, var8, var7); + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public void func_150573_a(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) { + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + + if (p_150573_7_ > 1.75D) { + this.topBlock = Blocks.dirt; + this.field_150604_aj = 1; + } else if (p_150573_7_ > -0.95D) { + this.topBlock = Blocks.dirt; + this.field_150604_aj = 2; + } + } + + this.func_150560_b(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + protected BiomeGenBase func_150566_k() { + return this.biomeID == BiomeGenBase.field_150578_U.biomeID ? (new BiomeGenTaiga(this.biomeID + 128, 2)).func_150557_a(5858897, true).setBiomeName("Mega Spruce Taiga").func_76733_a(5159473).setTemperatureRainfall(0.25F, 0.8F).func_150570_a(new BiomeGenBase.Height(this.minHeight, this.maxHeight)) : super.func_150566_k(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/WorldChunkManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/WorldChunkManager.java new file mode 100644 index 0000000..0873717 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/WorldChunkManager.java @@ -0,0 +1,240 @@ +package net.minecraft.world.biome; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; + +public class WorldChunkManager { + private GenLayer genBiomes; + + /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */ + private GenLayer biomeIndexLayer; + + /** The BiomeCache object for this world. */ + private final BiomeCache biomeCache; + + /** A list of biomes that the player can spawn in. */ + private final List biomesToSpawnIn; + + + protected WorldChunkManager() { + this.biomeCache = new BiomeCache(this); + this.biomesToSpawnIn = new ArrayList(); + this.biomesToSpawnIn.add(BiomeGenBase.forest); + this.biomesToSpawnIn.add(BiomeGenBase.plains); + this.biomesToSpawnIn.add(BiomeGenBase.taiga); + this.biomesToSpawnIn.add(BiomeGenBase.taigaHills); + this.biomesToSpawnIn.add(BiomeGenBase.forestHills); + this.biomesToSpawnIn.add(BiomeGenBase.jungle); + this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); + } + + public WorldChunkManager(long p_i1975_1_, WorldType p_i1975_3_) { + this(); + GenLayer[] var4 = GenLayer.initializeAllBiomeGenerators(p_i1975_1_, p_i1975_3_); + this.genBiomes = var4[0]; + this.biomeIndexLayer = var4[1]; + } + + public WorldChunkManager(World p_i1976_1_) { + this(p_i1976_1_.getSeed(), p_i1976_1_.getWorldInfo().getTerrainType()); + } + + /** + * Gets the list of valid biomes for the player to spawn in. + */ + public List getBiomesToSpawnIn() { + return this.biomesToSpawnIn; + } + + /** + * Returns the BiomeGenBase related to the x, z position on the world. + */ + public BiomeGenBase getBiomeGenAt(int p_76935_1_, int p_76935_2_) { + return this.biomeCache.getBiomeGenAt(p_76935_1_, p_76935_2_); + } + + /** + * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. + */ + public float[] getRainfall(float[] p_76936_1_, int p_76936_2_, int p_76936_3_, int p_76936_4_, int p_76936_5_) { + IntCache.resetIntCache(); + + if (p_76936_1_ == null || p_76936_1_.length < p_76936_4_ * p_76936_5_) { + p_76936_1_ = new float[p_76936_4_ * p_76936_5_]; + } + + int[] var6 = this.biomeIndexLayer.getInts(p_76936_2_, p_76936_3_, p_76936_4_, p_76936_5_); + + for (int var7 = 0; var7 < p_76936_4_ * p_76936_5_; ++var7) { + try { + float var8 = (float)BiomeGenBase.func_150568_d(var6[var7]).getIntRainfall() / 65536.0F; + + if (var8 > 1.0F) { + var8 = 1.0F; + } + + p_76936_1_[var7] = var8; + } catch (Throwable var11) { + CrashReport var9 = CrashReport.makeCrashReport(var11, "Invalid Biome id"); + CrashReportCategory var10 = var9.makeCategory("DownfallBlock"); + var10.addCrashSection("biome id", Integer.valueOf(var7)); + var10.addCrashSection("downfalls[] size", Integer.valueOf(p_76936_1_.length)); + var10.addCrashSection("x", Integer.valueOf(p_76936_2_)); + var10.addCrashSection("z", Integer.valueOf(p_76936_3_)); + var10.addCrashSection("w", Integer.valueOf(p_76936_4_)); + var10.addCrashSection("h", Integer.valueOf(p_76936_5_)); + throw new ReportedException(var9); + } + } + + return p_76936_1_; + } + + /** + * Return an adjusted version of a given temperature based on the y height + */ + public float getTemperatureAtHeight(float p_76939_1_, int p_76939_2_) { + return p_76939_1_; + } + + /** + * Returns an array of biomes for the location input. + */ + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] p_76937_1_, int p_76937_2_, int p_76937_3_, int p_76937_4_, int p_76937_5_) { + IntCache.resetIntCache(); + + if (p_76937_1_ == null || p_76937_1_.length < p_76937_4_ * p_76937_5_) { + p_76937_1_ = new BiomeGenBase[p_76937_4_ * p_76937_5_]; + } + + int[] var6 = this.genBiomes.getInts(p_76937_2_, p_76937_3_, p_76937_4_, p_76937_5_); + + try { + for (int var7 = 0; var7 < p_76937_4_ * p_76937_5_; ++var7) { + p_76937_1_[var7] = BiomeGenBase.func_150568_d(var6[var7]); + } + + return p_76937_1_; + } catch (Throwable var10) { + CrashReport var8 = CrashReport.makeCrashReport(var10, "Invalid Biome id"); + CrashReportCategory var9 = var8.makeCategory("RawBiomeBlock"); + var9.addCrashSection("biomes[] size", Integer.valueOf(p_76937_1_.length)); + var9.addCrashSection("x", Integer.valueOf(p_76937_2_)); + var9.addCrashSection("z", Integer.valueOf(p_76937_3_)); + var9.addCrashSection("w", Integer.valueOf(p_76937_4_)); + var9.addCrashSection("h", Integer.valueOf(p_76937_5_)); + throw new ReportedException(var8); + } + } + + /** + * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the + * WorldChunkManager Args: oldBiomeList, x, z, width, depth + */ + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] p_76933_1_, int p_76933_2_, int p_76933_3_, int p_76933_4_, int p_76933_5_) { + return this.getBiomeGenAt(p_76933_1_, p_76933_2_, p_76933_3_, p_76933_4_, p_76933_5_, true); + } + + /** + * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, + * don't check biomeCache to avoid infinite loop in BiomeCacheBlock) + */ + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] p_76931_1_, int p_76931_2_, int p_76931_3_, int p_76931_4_, int p_76931_5_, boolean p_76931_6_) { + IntCache.resetIntCache(); + + if (p_76931_1_ == null || p_76931_1_.length < p_76931_4_ * p_76931_5_) { + p_76931_1_ = new BiomeGenBase[p_76931_4_ * p_76931_5_]; + } + + if (p_76931_6_ && p_76931_4_ == 16 && p_76931_5_ == 16 && (p_76931_2_ & 15) == 0 && (p_76931_3_ & 15) == 0) { + BiomeGenBase[] var9 = this.biomeCache.getCachedBiomes(p_76931_2_, p_76931_3_); + System.arraycopy(var9, 0, p_76931_1_, 0, p_76931_4_ * p_76931_5_); + return p_76931_1_; + } else { + int[] var7 = this.biomeIndexLayer.getInts(p_76931_2_, p_76931_3_, p_76931_4_, p_76931_5_); + + for (int var8 = 0; var8 < p_76931_4_ * p_76931_5_; ++var8) { + p_76931_1_[var8] = BiomeGenBase.func_150568_d(var7[var8]); + } + + return p_76931_1_; + } + } + + /** + * checks given Chunk's Biomes against List of allowed ones + */ + public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List p_76940_4_) { + IntCache.resetIntCache(); + int var5 = p_76940_1_ - p_76940_3_ >> 2; + int var6 = p_76940_2_ - p_76940_3_ >> 2; + int var7 = p_76940_1_ + p_76940_3_ >> 2; + int var8 = p_76940_2_ + p_76940_3_ >> 2; + int var9 = var7 - var5 + 1; + int var10 = var8 - var6 + 1; + int[] var11 = this.genBiomes.getInts(var5, var6, var9, var10); + + try { + for (int var12 = 0; var12 < var9 * var10; ++var12) { + BiomeGenBase var16 = BiomeGenBase.func_150568_d(var11[var12]); + + if (!p_76940_4_.contains(var16)) { + return false; + } + } + + return true; + } catch (Throwable var15) { + CrashReport var13 = CrashReport.makeCrashReport(var15, "Invalid Biome id"); + CrashReportCategory var14 = var13.makeCategory("Layer"); + var14.addCrashSection("Layer", this.genBiomes.toString()); + var14.addCrashSection("x", Integer.valueOf(p_76940_1_)); + var14.addCrashSection("z", Integer.valueOf(p_76940_2_)); + var14.addCrashSection("radius", Integer.valueOf(p_76940_3_)); + var14.addCrashSection("allowed", p_76940_4_); + throw new ReportedException(var13); + } + } + + public ChunkPosition func_150795_a(int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) { + IntCache.resetIntCache(); + int var6 = p_150795_1_ - p_150795_3_ >> 2; + int var7 = p_150795_2_ - p_150795_3_ >> 2; + int var8 = p_150795_1_ + p_150795_3_ >> 2; + int var9 = p_150795_2_ + p_150795_3_ >> 2; + int var10 = var8 - var6 + 1; + int var11 = var9 - var7 + 1; + int[] var12 = this.genBiomes.getInts(var6, var7, var10, var11); + ChunkPosition var13 = null; + int var14 = 0; + + for (int var15 = 0; var15 < var10 * var11; ++var15) { + int var16 = var6 + var15 % var10 << 2; + int var17 = var7 + var15 / var10 << 2; + BiomeGenBase var18 = BiomeGenBase.func_150568_d(var12[var15]); + + if (p_150795_4_.contains(var18) && (var13 == null || p_150795_5_.nextInt(var14 + 1) == 0)) { + var13 = new ChunkPosition(var16, 0, var17); + ++var14; + } + } + + return var13; + } + + /** + * Calls the WorldChunkManager's biomeCache.cleanupCache() + */ + public void cleanupCache() { + this.biomeCache.cleanupCache(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java new file mode 100644 index 0000000..035c22d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java @@ -0,0 +1,83 @@ +package net.minecraft.world.biome; + +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import net.minecraft.world.ChunkPosition; + +public class WorldChunkManagerHell extends WorldChunkManager { + /** The biome generator object. */ + private final BiomeGenBase biomeGenerator; + + /** The rainfall in the world */ + private final float rainfall; + + + public WorldChunkManagerHell(BiomeGenBase p_i45374_1_, float p_i45374_2_) { + this.biomeGenerator = p_i45374_1_; + this.rainfall = p_i45374_2_; + } + + /** + * Returns the BiomeGenBase related to the x, z position on the world. + */ + public BiomeGenBase getBiomeGenAt(int p_76935_1_, int p_76935_2_) { + return this.biomeGenerator; + } + + /** + * Returns an array of biomes for the location input. + */ + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] p_76937_1_, int p_76937_2_, int p_76937_3_, int p_76937_4_, int p_76937_5_) { + if (p_76937_1_ == null || p_76937_1_.length < p_76937_4_ * p_76937_5_) { + p_76937_1_ = new BiomeGenBase[p_76937_4_ * p_76937_5_]; + } + + Arrays.fill(p_76937_1_, 0, p_76937_4_ * p_76937_5_, this.biomeGenerator); + return p_76937_1_; + } + + /** + * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. + */ + public float[] getRainfall(float[] p_76936_1_, int p_76936_2_, int p_76936_3_, int p_76936_4_, int p_76936_5_) { + if (p_76936_1_ == null || p_76936_1_.length < p_76936_4_ * p_76936_5_) { + p_76936_1_ = new float[p_76936_4_ * p_76936_5_]; + } + + Arrays.fill(p_76936_1_, 0, p_76936_4_ * p_76936_5_, this.rainfall); + return p_76936_1_; + } + + /** + * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the + * WorldChunkManager Args: oldBiomeList, x, z, width, depth + */ + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] p_76933_1_, int p_76933_2_, int p_76933_3_, int p_76933_4_, int p_76933_5_) { + if (p_76933_1_ == null || p_76933_1_.length < p_76933_4_ * p_76933_5_) { + p_76933_1_ = new BiomeGenBase[p_76933_4_ * p_76933_5_]; + } + + Arrays.fill(p_76933_1_, 0, p_76933_4_ * p_76933_5_, this.biomeGenerator); + return p_76933_1_; + } + + /** + * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, + * don't check biomeCache to avoid infinite loop in BiomeCacheBlock) + */ + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] p_76931_1_, int p_76931_2_, int p_76931_3_, int p_76931_4_, int p_76931_5_, boolean p_76931_6_) { + return this.loadBlockGeneratorData(p_76931_1_, p_76931_2_, p_76931_3_, p_76931_4_, p_76931_5_); + } + + public ChunkPosition func_150795_a(int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) { + return p_150795_4_.contains(this.biomeGenerator) ? new ChunkPosition(p_150795_1_ - p_150795_3_ + p_150795_5_.nextInt(p_150795_3_ * 2 + 1), 0, p_150795_2_ - p_150795_3_ + p_150795_5_.nextInt(p_150795_3_ * 2 + 1)) : null; + } + + /** + * checks given Chunk's Biomes against List of allowed ones + */ + public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List p_76940_4_) { + return p_76940_4_.contains(this.biomeGenerator); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/Chunk.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/Chunk.java new file mode 100644 index 0000000..514402b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/Chunk.java @@ -0,0 +1,1333 @@ +package net.minecraft.world.chunk; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Chunk { + private static final Logger logger = LogManager.getLogger(); + + /** + * Determines if the chunk is lit or not at a light value greater than 0. + */ + public static boolean isLit; + + /** + * Used to store block IDs, block MSBs, Sky-light maps, Block-light maps, and metadata. Each entry corresponds to a + * logical segment of 16x16x16 blocks, stacked vertically. + */ + private ExtendedBlockStorage[] storageArrays; + + /** + * Contains a 16x16 mapping on the X/Z plane of the biome ID to which each colum belongs. + */ + private byte[] blockBiomeArray; + + /** + * A map, similar to heightMap, that tracks how far down precipitation can fall. + */ + public int[] precipitationHeightMap; + + /** Which columns need their skylightMaps updated. */ + public boolean[] updateSkylightColumns; + + /** Whether or not this Chunk is currently loaded into the World */ + public boolean isChunkLoaded; + + /** Reference to the World object. */ + public World worldObj; + public int[] heightMap; + + /** The x coordinate of the chunk. */ + public final int xPosition; + + /** The z coordinate of the chunk. */ + public final int zPosition; + private boolean isGapLightingUpdated; + + /** A Map of ChunkPositions to TileEntities in this chunk */ + public Map chunkTileEntityMap; + + /** + * Array of Lists containing the entities in this Chunk. Each List represents a 16 block subchunk. + */ + public List[] entityLists; + + /** Boolean value indicating if the terrain is populated. */ + public boolean isTerrainPopulated; + public boolean isLightPopulated; + public boolean field_150815_m; + + /** + * Set to true if the chunk has been modified and needs to be updated internally. + */ + public boolean isModified; + + /** + * Whether this Chunk has any Entities and thus requires saving on every tick + */ + public boolean hasEntities; + + /** The time according to World.worldTime when this chunk was last saved */ + public long lastSaveTime; + + /** + * Updates to this chunk will not be sent to clients if this is false. This field is set to true the first time the + * chunk is sent to a com.cheatbreaker.client, and never set to false. + */ + public boolean sendUpdates; + + /** Lowest value in the heightmap. */ + public int heightMapMinimum; + + /** the cumulative number of ticks players have been in this chunk */ + public long inhabitedTime; + + /** + * Contains the current round-robin relight check index, and is implied as the relight check location as well. + */ + private int queuedLightChecks; + + + public Chunk(World p_i1995_1_, int p_i1995_2_, int p_i1995_3_) { + this.storageArrays = new ExtendedBlockStorage[16]; + this.blockBiomeArray = new byte[256]; + this.precipitationHeightMap = new int[256]; + this.updateSkylightColumns = new boolean[256]; + this.chunkTileEntityMap = new HashMap(); + this.queuedLightChecks = 4096; + this.entityLists = new List[16]; + this.worldObj = p_i1995_1_; + this.xPosition = p_i1995_2_; + this.zPosition = p_i1995_3_; + this.heightMap = new int[256]; + + for (int var4 = 0; var4 < this.entityLists.length; ++var4) { + this.entityLists[var4] = new ArrayList(); + } + + Arrays.fill(this.precipitationHeightMap, -999); + Arrays.fill(this.blockBiomeArray, (byte) - 1); + } + + public Chunk(World p_i45446_1_, Block[] p_i45446_2_, int p_i45446_3_, int p_i45446_4_) { + this(p_i45446_1_, p_i45446_3_, p_i45446_4_); + int var5 = p_i45446_2_.length / 256; + boolean var6 = !p_i45446_1_.provider.hasNoSky; + + for (int var7 = 0; var7 < 16; ++var7) { + for (int var8 = 0; var8 < 16; ++var8) { + for (int var9 = 0; var9 < var5; ++var9) { + Block var10 = p_i45446_2_[var7 << 11 | var8 << 7 | var9]; + + if (var10 != null && var10.getMaterial() != Material.air) { + int var11 = var9 >> 4; + + if (this.storageArrays[var11] == null) { + this.storageArrays[var11] = new ExtendedBlockStorage(var11 << 4, var6); + } + + this.storageArrays[var11].func_150818_a(var7, var9 & 15, var8, var10); + } + } + } + } + } + + public Chunk(World p_i45447_1_, Block[] p_i45447_2_, byte[] p_i45447_3_, int p_i45447_4_, int p_i45447_5_) { + this(p_i45447_1_, p_i45447_4_, p_i45447_5_); + int var6 = p_i45447_2_.length / 256; + boolean var7 = !p_i45447_1_.provider.hasNoSky; + + for (int var8 = 0; var8 < 16; ++var8) { + for (int var9 = 0; var9 < 16; ++var9) { + for (int var10 = 0; var10 < var6; ++var10) { + int var11 = var8 * var6 * 16 | var9 * var6 | var10; + Block var12 = p_i45447_2_[var11]; + + if (var12 != null && var12 != Blocks.air) { + int var13 = var10 >> 4; + + if (this.storageArrays[var13] == null) { + this.storageArrays[var13] = new ExtendedBlockStorage(var13 << 4, var7); + } + + this.storageArrays[var13].func_150818_a(var8, var10 & 15, var9, var12); + this.storageArrays[var13].setExtBlockMetadata(var8, var10 & 15, var9, p_i45447_3_[var11]); + } + } + } + } + } + + /** + * Checks whether the chunk is at the X/Z location specified + */ + public boolean isAtLocation(int p_76600_1_, int p_76600_2_) { + return p_76600_1_ == this.xPosition && p_76600_2_ == this.zPosition; + } + + /** + * Returns the value in the height map at this x, z coordinate in the chunk + */ + public int getHeightValue(int p_76611_1_, int p_76611_2_) { + return this.heightMap[p_76611_2_ << 4 | p_76611_1_]; + } + + /** + * Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block. + */ + public int getTopFilledSegment() { + for (int var1 = this.storageArrays.length - 1; var1 >= 0; --var1) { + if (this.storageArrays[var1] != null) { + return this.storageArrays[var1].getYLocation(); + } + } + + return 0; + } + + /** + * Returns the ExtendedBlockStorage array for this Chunk. + */ + public ExtendedBlockStorage[] getBlockStorageArray() { + return this.storageArrays; + } + + /** + * Generates the height map for a chunk from scratch + */ + public void generateHeightMap() { + int var1 = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int var2 = 0; var2 < 16; ++var2) { + int var3 = 0; + + while (var3 < 16) { + this.precipitationHeightMap[var2 + (var3 << 4)] = -999; + int var4 = var1 + 16 - 1; + + while (true) { + if (var4 > 0) { + Block var5 = this.func_150810_a(var2, var4 - 1, var3); + + if (var5.getLightOpacity() == 0) { + --var4; + continue; + } + + this.heightMap[var3 << 4 | var2] = var4; + + if (var4 < this.heightMapMinimum) { + this.heightMapMinimum = var4; + } + } + + ++var3; + break; + } + } + } + + this.isModified = true; + } + + /** + * Generates the initial skylight map for the chunk upon generation or load. + */ + public void generateSkylightMap() { + int var1 = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int var2 = 0; var2 < 16; ++var2) { + int var3 = 0; + + while (var3 < 16) { + this.precipitationHeightMap[var2 + (var3 << 4)] = -999; + int var4 = var1 + 16 - 1; + + while (true) { + if (var4 > 0) { + if (this.func_150808_b(var2, var4 - 1, var3) == 0) { + --var4; + continue; + } + + this.heightMap[var3 << 4 | var2] = var4; + + if (var4 < this.heightMapMinimum) { + this.heightMapMinimum = var4; + } + } + + if (!this.worldObj.provider.hasNoSky) { + var4 = 15; + int var5 = var1 + 16 - 1; + + do { + int var6 = this.func_150808_b(var2, var5, var3); + + if (var6 == 0 && var4 != 15) { + var6 = 1; + } + + var4 -= var6; + + if (var4 > 0) { + ExtendedBlockStorage var7 = this.storageArrays[var5 >> 4]; + + if (var7 != null) { + var7.setExtSkylightValue(var2, var5 & 15, var3, var4); + this.worldObj.func_147479_m((this.xPosition << 4) + var2, var5, (this.zPosition << 4) + var3); + } + } + + --var5; + } + while (var5 > 0 && var4 > 0); + } + + ++var3; + break; + } + } + } + + this.isModified = true; + } + + /** + * Propagates a given sky-visible block's light value downward and upward to neighboring blocks as necessary. + */ + private void propagateSkylightOcclusion(int p_76595_1_, int p_76595_2_) { + this.updateSkylightColumns[p_76595_1_ + p_76595_2_ * 16] = true; + this.isGapLightingUpdated = true; + } + + private void recheckGaps(boolean p_150803_1_) { + this.worldObj.theProfiler.startSection("recheckGaps"); + + if (this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) { + for (int var2 = 0; var2 < 16; ++var2) { + for (int var3 = 0; var3 < 16; ++var3) { + if (this.updateSkylightColumns[var2 + var3 * 16]) { + this.updateSkylightColumns[var2 + var3 * 16] = false; + int var4 = this.getHeightValue(var2, var3); + int var5 = this.xPosition * 16 + var2; + int var6 = this.zPosition * 16 + var3; + int var7 = this.worldObj.getChunkHeightMapMinimum(var5 - 1, var6); + int var8 = this.worldObj.getChunkHeightMapMinimum(var5 + 1, var6); + int var9 = this.worldObj.getChunkHeightMapMinimum(var5, var6 - 1); + int var10 = this.worldObj.getChunkHeightMapMinimum(var5, var6 + 1); + + if (var8 < var7) { + var7 = var8; + } + + if (var9 < var7) { + var7 = var9; + } + + if (var10 < var7) { + var7 = var10; + } + + this.checkSkylightNeighborHeight(var5, var6, var7); + this.checkSkylightNeighborHeight(var5 - 1, var6, var4); + this.checkSkylightNeighborHeight(var5 + 1, var6, var4); + this.checkSkylightNeighborHeight(var5, var6 - 1, var4); + this.checkSkylightNeighborHeight(var5, var6 + 1, var4); + + if (p_150803_1_) { + this.worldObj.theProfiler.endSection(); + return; + } + } + } + } + + this.isGapLightingUpdated = false; + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Checks the height of a block next to a sky-visible block and schedules a lighting update as necessary. + */ + private void checkSkylightNeighborHeight(int p_76599_1_, int p_76599_2_, int p_76599_3_) { + int var4 = this.worldObj.getHeightValue(p_76599_1_, p_76599_2_); + + if (var4 > p_76599_3_) { + this.updateSkylightNeighborHeight(p_76599_1_, p_76599_2_, p_76599_3_, var4 + 1); + } else if (var4 < p_76599_3_) { + this.updateSkylightNeighborHeight(p_76599_1_, p_76599_2_, var4, p_76599_3_ + 1); + } + } + + private void updateSkylightNeighborHeight(int p_76609_1_, int p_76609_2_, int p_76609_3_, int p_76609_4_) { + if (p_76609_4_ > p_76609_3_ && this.worldObj.doChunksNearChunkExist(p_76609_1_, 0, p_76609_2_, 16)) { + for (int var5 = p_76609_3_; var5 < p_76609_4_; ++var5) { + this.worldObj.updateLightByType(EnumSkyBlock.Sky, p_76609_1_, var5, p_76609_2_); + } + + this.isModified = true; + } + } + + /** + * Initiates the recalculation of both the block-light and sky-light for a given block inside a chunk. + */ + private void relightBlock(int p_76615_1_, int p_76615_2_, int p_76615_3_) { + int var4 = this.heightMap[p_76615_3_ << 4 | p_76615_1_] & 255; + int var5 = var4; + + if (p_76615_2_ > var4) { + var5 = p_76615_2_; + } + + while (var5 > 0 && this.func_150808_b(p_76615_1_, var5 - 1, p_76615_3_) == 0) { + --var5; + } + + if (var5 != var4) { + this.worldObj.markBlocksDirtyVertical(p_76615_1_ + this.xPosition * 16, p_76615_3_ + this.zPosition * 16, var5, var4); + this.heightMap[p_76615_3_ << 4 | p_76615_1_] = var5; + int var6 = this.xPosition * 16 + p_76615_1_; + int var7 = this.zPosition * 16 + p_76615_3_; + int var8; + int var12; + + if (!this.worldObj.provider.hasNoSky) { + ExtendedBlockStorage var9; + + if (var5 < var4) { + for (var8 = var5; var8 < var4; ++var8) { + var9 = this.storageArrays[var8 >> 4]; + + if (var9 != null) { + var9.setExtSkylightValue(p_76615_1_, var8 & 15, p_76615_3_, 15); + this.worldObj.func_147479_m((this.xPosition << 4) + p_76615_1_, var8, (this.zPosition << 4) + p_76615_3_); + } + } + } else { + for (var8 = var4; var8 < var5; ++var8) { + var9 = this.storageArrays[var8 >> 4]; + + if (var9 != null) { + var9.setExtSkylightValue(p_76615_1_, var8 & 15, p_76615_3_, 0); + this.worldObj.func_147479_m((this.xPosition << 4) + p_76615_1_, var8, (this.zPosition << 4) + p_76615_3_); + } + } + } + + var8 = 15; + + while (var5 > 0 && var8 > 0) { + --var5; + var12 = this.func_150808_b(p_76615_1_, var5, p_76615_3_); + + if (var12 == 0) { + var12 = 1; + } + + var8 -= var12; + + if (var8 < 0) { + var8 = 0; + } + + ExtendedBlockStorage var10 = this.storageArrays[var5 >> 4]; + + if (var10 != null) { + var10.setExtSkylightValue(p_76615_1_, var5 & 15, p_76615_3_, var8); + } + } + } + + var8 = this.heightMap[p_76615_3_ << 4 | p_76615_1_]; + var12 = var4; + int var13 = var8; + + if (var8 < var4) { + var12 = var8; + var13 = var4; + } + + if (var8 < this.heightMapMinimum) { + this.heightMapMinimum = var8; + } + + if (!this.worldObj.provider.hasNoSky) { + this.updateSkylightNeighborHeight(var6 - 1, var7, var12, var13); + this.updateSkylightNeighborHeight(var6 + 1, var7, var12, var13); + this.updateSkylightNeighborHeight(var6, var7 - 1, var12, var13); + this.updateSkylightNeighborHeight(var6, var7 + 1, var12, var13); + this.updateSkylightNeighborHeight(var6, var7, var12, var13); + } + + this.isModified = true; + } + } + + public int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) { + return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(); + } + + public Block func_150810_a(final int p_150810_1_, final int p_150810_2_, final int p_150810_3_) { + Block var4 = Blocks.air; + + if (p_150810_2_ >> 4 < this.storageArrays.length) { + ExtendedBlockStorage var5 = this.storageArrays[p_150810_2_ >> 4]; + + if (var5 != null) { + try { + var4 = var5.func_150819_a(p_150810_1_, p_150810_2_ & 15, p_150810_3_); + } catch (Throwable var9) { + CrashReport var7 = CrashReport.makeCrashReport(var9, "Getting block"); + CrashReportCategory var8 = var7.makeCategory("Block being got"); + var8.addCrashSectionCallable("Location", new Callable() { + + public String call() { + return CrashReportCategory.getLocationInfo(p_150810_1_, p_150810_2_, p_150810_3_); + } + }); + throw new ReportedException(var7); + } + } + } + + return var4; + } + + /** + * Return the metadata corresponding to the given coordinates inside a chunk. + */ + public int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_) { + if (p_76628_2_ >> 4 >= this.storageArrays.length) { + return 0; + } else { + ExtendedBlockStorage var4 = this.storageArrays[p_76628_2_ >> 4]; + return var4 != null ? var4.getExtBlockMetadata(p_76628_1_, p_76628_2_ & 15, p_76628_3_) : 0; + } + } + + public boolean func_150807_a(int p_150807_1_, int p_150807_2_, int p_150807_3_, Block p_150807_4_, int p_150807_5_) { + int var6 = p_150807_3_ << 4 | p_150807_1_; + + if (p_150807_2_ >= this.precipitationHeightMap[var6] - 1) { + this.precipitationHeightMap[var6] = -999; + } + + int var7 = this.heightMap[var6]; + Block var8 = this.func_150810_a(p_150807_1_, p_150807_2_, p_150807_3_); + int var9 = this.getBlockMetadata(p_150807_1_, p_150807_2_, p_150807_3_); + + if (var8 == p_150807_4_ && var9 == p_150807_5_) { + return false; + } else { + ExtendedBlockStorage var10 = this.storageArrays[p_150807_2_ >> 4]; + boolean var11 = false; + + if (var10 == null) { + if (p_150807_4_ == Blocks.air) { + return false; + } + + var10 = this.storageArrays[p_150807_2_ >> 4] = new ExtendedBlockStorage(p_150807_2_ >> 4 << 4, !this.worldObj.provider.hasNoSky); + var11 = p_150807_2_ >= var7; + } + + int var12 = this.xPosition * 16 + p_150807_1_; + int var13 = this.zPosition * 16 + p_150807_3_; + + if (!this.worldObj.isClient) { + var8.onBlockPreDestroy(this.worldObj, var12, p_150807_2_, var13, var9); + } + + var10.func_150818_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_4_); + + if (!this.worldObj.isClient) { + var8.breakBlock(this.worldObj, var12, p_150807_2_, var13, var8, var9); + } else if (var8 instanceof ITileEntityProvider && var8 != p_150807_4_) { + this.worldObj.removeTileEntity(var12, p_150807_2_, var13); + } + + if (var10.func_150819_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_) != p_150807_4_) { + return false; + } else { + var10.setExtBlockMetadata(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); + + if (var11) { + this.generateSkylightMap(); + } else { + int var14 = p_150807_4_.getLightOpacity(); + int var15 = var8.getLightOpacity(); + + if (var14 > 0) { + if (p_150807_2_ >= var7) { + this.relightBlock(p_150807_1_, p_150807_2_ + 1, p_150807_3_); + } + } else if (p_150807_2_ == var7 - 1) { + this.relightBlock(p_150807_1_, p_150807_2_, p_150807_3_); + } + + if (var14 != var15 && (var14 < var15 || this.getSavedLightValue(EnumSkyBlock.Sky, p_150807_1_, p_150807_2_, p_150807_3_) > 0 || this.getSavedLightValue(EnumSkyBlock.Block, p_150807_1_, p_150807_2_, p_150807_3_) > 0)) { + this.propagateSkylightOcclusion(p_150807_1_, p_150807_3_); + } + } + + TileEntity var16; + + if (var8 instanceof ITileEntityProvider) { + var16 = this.func_150806_e(p_150807_1_, p_150807_2_, p_150807_3_); + + if (var16 != null) { + var16.updateContainingBlockInfo(); + } + } + + if (!this.worldObj.isClient) { + p_150807_4_.onBlockAdded(this.worldObj, var12, p_150807_2_, var13); + } + + if (p_150807_4_ instanceof ITileEntityProvider) { + var16 = this.func_150806_e(p_150807_1_, p_150807_2_, p_150807_3_); + + if (var16 == null) { + var16 = ((ITileEntityProvider)p_150807_4_).createNewTileEntity(this.worldObj, p_150807_5_); + this.worldObj.setTileEntity(var12, p_150807_2_, var13, var16); + } + + if (var16 != null) { + var16.updateContainingBlockInfo(); + } + } + + this.isModified = true; + return true; + } + } + } + + /** + * Set the metadata of a block in the chunk + */ + public boolean setBlockMetadata(int p_76589_1_, int p_76589_2_, int p_76589_3_, int p_76589_4_) { + ExtendedBlockStorage var5 = this.storageArrays[p_76589_2_ >> 4]; + + if (var5 == null) { + return false; + } else { + int var6 = var5.getExtBlockMetadata(p_76589_1_, p_76589_2_ & 15, p_76589_3_); + + if (var6 == p_76589_4_) { + return false; + } else { + this.isModified = true; + var5.setExtBlockMetadata(p_76589_1_, p_76589_2_ & 15, p_76589_3_, p_76589_4_); + + if (var5.func_150819_a(p_76589_1_, p_76589_2_ & 15, p_76589_3_) instanceof ITileEntityProvider) { + TileEntity var7 = this.func_150806_e(p_76589_1_, p_76589_2_, p_76589_3_); + + if (var7 != null) { + var7.updateContainingBlockInfo(); + var7.blockMetadata = p_76589_4_; + } + } + + return true; + } + } + } + + /** + * Gets the amount of light saved in this block (doesn't adjust for daylight) + */ + public int getSavedLightValue(EnumSkyBlock p_76614_1_, int p_76614_2_, int p_76614_3_, int p_76614_4_) { + ExtendedBlockStorage var5 = this.storageArrays[p_76614_3_ >> 4]; + return var5 == null ? (this.canBlockSeeTheSky(p_76614_2_, p_76614_3_, p_76614_4_) ? p_76614_1_.defaultLightValue : 0) : (p_76614_1_ == EnumSkyBlock.Sky ? (this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(p_76614_2_, p_76614_3_ & 15, p_76614_4_)) : (p_76614_1_ == EnumSkyBlock.Block ? var5.getExtBlocklightValue(p_76614_2_, p_76614_3_ & 15, p_76614_4_) : p_76614_1_.defaultLightValue)); + } + + /** + * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a + * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue + */ + public void setLightValue(EnumSkyBlock p_76633_1_, int p_76633_2_, int p_76633_3_, int p_76633_4_, int p_76633_5_) { + ExtendedBlockStorage var6 = this.storageArrays[p_76633_3_ >> 4]; + + if (var6 == null) { + var6 = this.storageArrays[p_76633_3_ >> 4] = new ExtendedBlockStorage(p_76633_3_ >> 4 << 4, !this.worldObj.provider.hasNoSky); + this.generateSkylightMap(); + } + + this.isModified = true; + + if (p_76633_1_ == EnumSkyBlock.Sky) { + if (!this.worldObj.provider.hasNoSky) { + var6.setExtSkylightValue(p_76633_2_, p_76633_3_ & 15, p_76633_4_, p_76633_5_); + } + } else if (p_76633_1_ == EnumSkyBlock.Block) { + var6.setExtBlocklightValue(p_76633_2_, p_76633_3_ & 15, p_76633_4_, p_76633_5_); + } + } + + /** + * Gets the amount of light on a block taking into account sunlight + */ + public int getBlockLightValue(int p_76629_1_, int p_76629_2_, int p_76629_3_, int p_76629_4_) { + ExtendedBlockStorage var5 = this.storageArrays[p_76629_2_ >> 4]; + + if (var5 == null) { + return !this.worldObj.provider.hasNoSky && p_76629_4_ < EnumSkyBlock.Sky.defaultLightValue ? EnumSkyBlock.Sky.defaultLightValue - p_76629_4_ : 0; + } else { + int var6 = this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(p_76629_1_, p_76629_2_ & 15, p_76629_3_); + + if (var6 > 0) { + isLit = true; + } + + var6 -= p_76629_4_; + int var7 = var5.getExtBlocklightValue(p_76629_1_, p_76629_2_ & 15, p_76629_3_); + + if (var7 > var6) { + var6 = var7; + } + + return var6; + } + } + + /** + * Adds an entity to the chunk. Args: entity + */ + public void addEntity(Entity p_76612_1_) { + this.hasEntities = true; + int var2 = MathHelper.floor_double(p_76612_1_.posX / 16.0D); + int var3 = MathHelper.floor_double(p_76612_1_.posZ / 16.0D); + + if (var2 != this.xPosition || var3 != this.zPosition) { + logger.warn("Wrong location! " + p_76612_1_ + " (at " + var2 + ", " + var3 + " instead of " + this.xPosition + ", " + this.zPosition + ")"); + Thread.dumpStack(); + } + + int var4 = MathHelper.floor_double(p_76612_1_.posY / 16.0D); + + if (var4 < 0) { + var4 = 0; + } + + if (var4 >= this.entityLists.length) { + var4 = this.entityLists.length - 1; + } + + p_76612_1_.addedToChunk = true; + p_76612_1_.chunkCoordX = this.xPosition; + p_76612_1_.chunkCoordY = var4; + p_76612_1_.chunkCoordZ = this.zPosition; + this.entityLists[var4].add(p_76612_1_); + } + + /** + * removes entity using its y chunk coordinate as its index + */ + public void removeEntity(Entity p_76622_1_) { + this.removeEntityAtIndex(p_76622_1_, p_76622_1_.chunkCoordY); + } + + /** + * Removes entity at the specified index from the entity array. + */ + public void removeEntityAtIndex(Entity p_76608_1_, int p_76608_2_) { + if (p_76608_2_ < 0) { + p_76608_2_ = 0; + } + + if (p_76608_2_ >= this.entityLists.length) { + p_76608_2_ = this.entityLists.length - 1; + } + + this.entityLists[p_76608_2_].remove(p_76608_1_); + } + + /** + * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) + */ + public boolean canBlockSeeTheSky(int p_76619_1_, int p_76619_2_, int p_76619_3_) { + return p_76619_2_ >= this.heightMap[p_76619_3_ << 4 | p_76619_1_]; + } + + public TileEntity func_150806_e(int p_150806_1_, int p_150806_2_, int p_150806_3_) { + ChunkPosition var4 = new ChunkPosition(p_150806_1_, p_150806_2_, p_150806_3_); + TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(var4); + + if (var5 == null) { + Block var6 = this.func_150810_a(p_150806_1_, p_150806_2_, p_150806_3_); + + if (!var6.hasTileEntity()) { + return null; + } + + var5 = ((ITileEntityProvider)var6).createNewTileEntity(this.worldObj, this.getBlockMetadata(p_150806_1_, p_150806_2_, p_150806_3_)); + this.worldObj.setTileEntity(this.xPosition * 16 + p_150806_1_, p_150806_2_, this.zPosition * 16 + p_150806_3_, var5); + } + + if (var5 != null && var5.isInvalid()) { + this.chunkTileEntityMap.remove(var4); + return null; + } else { + return var5; + } + } + + public void addTileEntity(TileEntity p_150813_1_) { + int var2 = p_150813_1_.field_145851_c - this.xPosition * 16; + int var3 = p_150813_1_.field_145848_d; + int var4 = p_150813_1_.field_145849_e - this.zPosition * 16; + this.func_150812_a(var2, var3, var4, p_150813_1_); + + if (this.isChunkLoaded) { + this.worldObj.field_147482_g.add(p_150813_1_); + } + } + + public void func_150812_a(int p_150812_1_, int p_150812_2_, int p_150812_3_, TileEntity p_150812_4_) { + ChunkPosition var5 = new ChunkPosition(p_150812_1_, p_150812_2_, p_150812_3_); + p_150812_4_.setWorldObj(this.worldObj); + p_150812_4_.field_145851_c = this.xPosition * 16 + p_150812_1_; + p_150812_4_.field_145848_d = p_150812_2_; + p_150812_4_.field_145849_e = this.zPosition * 16 + p_150812_3_; + + if (this.func_150810_a(p_150812_1_, p_150812_2_, p_150812_3_) instanceof ITileEntityProvider) { + if (this.chunkTileEntityMap.containsKey(var5)) { + ((TileEntity)this.chunkTileEntityMap.get(var5)).invalidate(); + } + + p_150812_4_.validate(); + this.chunkTileEntityMap.put(var5, p_150812_4_); + } + } + + public void removeTileEntity(int p_150805_1_, int p_150805_2_, int p_150805_3_) { + ChunkPosition var4 = new ChunkPosition(p_150805_1_, p_150805_2_, p_150805_3_); + + if (this.isChunkLoaded) { + TileEntity var5 = (TileEntity)this.chunkTileEntityMap.remove(var4); + + if (var5 != null) { + var5.invalidate(); + } + } + } + + /** + * Called when this Chunk is loaded by the ChunkProvider + */ + public void onChunkLoad() { + this.isChunkLoaded = true; + this.worldObj.func_147448_a(this.chunkTileEntityMap.values()); + + for (int var1 = 0; var1 < this.entityLists.length; ++var1) { + Iterator var2 = this.entityLists[var1].iterator(); + + while (var2.hasNext()) { + Entity var3 = (Entity)var2.next(); + var3.onChunkLoad(); + } + + this.worldObj.addLoadedEntities(this.entityLists[var1]); + } + } + + /** + * Called when this Chunk is unloaded by the ChunkProvider + */ + public void onChunkUnload() { + this.isChunkLoaded = false; + Iterator var1 = this.chunkTileEntityMap.values().iterator(); + + while (var1.hasNext()) { + TileEntity var2 = (TileEntity)var1.next(); + this.worldObj.func_147457_a(var2); + } + + for (int var3 = 0; var3 < this.entityLists.length; ++var3) { + this.worldObj.unloadEntities(this.entityLists[var3]); + } + } + + /** + * Sets the isModified flag for this Chunk + */ + public void setChunkModified() { + this.isModified = true; + } + + /** + * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity + * Args: entity, aabb, listToFill + */ + public void getEntitiesWithinAABBForEntity(Entity p_76588_1_, AxisAlignedBB p_76588_2_, List p_76588_3_, IEntitySelector p_76588_4_) { + int var5 = MathHelper.floor_double((p_76588_2_.minY - 2.0D) / 16.0D); + int var6 = MathHelper.floor_double((p_76588_2_.maxY + 2.0D) / 16.0D); + var5 = MathHelper.clamp_int(var5, 0, this.entityLists.length - 1); + var6 = MathHelper.clamp_int(var6, 0, this.entityLists.length - 1); + + for (int var7 = var5; var7 <= var6; ++var7) { + List var8 = this.entityLists[var7]; + + for (int var9 = 0; var9 < var8.size(); ++var9) { + Entity var10 = (Entity)var8.get(var9); + + if (var10 != p_76588_1_ && var10.boundingBox.intersectsWith(p_76588_2_) && (p_76588_4_ == null || p_76588_4_.isEntityApplicable(var10))) { + p_76588_3_.add(var10); + Entity[] var11 = var10.getParts(); + + if (var11 != null) { + for (int var12 = 0; var12 < var11.length; ++var12) { + var10 = var11[var12]; + + if (var10 != p_76588_1_ && var10.boundingBox.intersectsWith(p_76588_2_) && (p_76588_4_ == null || p_76588_4_.isEntityApplicable(var10))) { + p_76588_3_.add(var10); + } + } + } + } + } + } + } + + /** + * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill + */ + public void getEntitiesOfTypeWithinAAAB(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_) { + int var5 = MathHelper.floor_double((p_76618_2_.minY - 2.0D) / 16.0D); + int var6 = MathHelper.floor_double((p_76618_2_.maxY + 2.0D) / 16.0D); + var5 = MathHelper.clamp_int(var5, 0, this.entityLists.length - 1); + var6 = MathHelper.clamp_int(var6, 0, this.entityLists.length - 1); + + for (int var7 = var5; var7 <= var6; ++var7) { + List var8 = this.entityLists[var7]; + + for (int var9 = 0; var9 < var8.size(); ++var9) { + Entity var10 = (Entity)var8.get(var9); + + if (p_76618_1_.isAssignableFrom(var10.getClass()) && var10.boundingBox.intersectsWith(p_76618_2_) && (p_76618_4_ == null || p_76618_4_.isEntityApplicable(var10))) { + p_76618_3_.add(var10); + } + } + } + } + + /** + * Returns true if this Chunk needs to be saved + */ + public boolean needsSaving(boolean p_76601_1_) { + if (p_76601_1_) { + if (this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) { + return true; + } + } else if (this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) { + return true; + } + + return this.isModified; + } + + public Random getRandomWithSeed(long p_76617_1_) { + return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ p_76617_1_); + } + + public boolean isEmpty() { + return false; + } + + public void populateChunk(IChunkProvider p_76624_1_, IChunkProvider p_76624_2_, int p_76624_3_, int p_76624_4_) { + if (!this.isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_)) { + p_76624_1_.populate(p_76624_2_, p_76624_3_, p_76624_4_); + } + + if (p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_) && !p_76624_1_.provideChunk(p_76624_3_ - 1, p_76624_4_).isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_ + 1)) { + p_76624_1_.populate(p_76624_2_, p_76624_3_ - 1, p_76624_4_); + } + + if (p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ - 1) && !p_76624_1_.provideChunk(p_76624_3_, p_76624_4_ - 1).isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_ - 1) && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_ - 1) && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_)) { + p_76624_1_.populate(p_76624_2_, p_76624_3_, p_76624_4_ - 1); + } + + if (p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_ - 1) && !p_76624_1_.provideChunk(p_76624_3_ - 1, p_76624_4_ - 1).isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ - 1) && p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_)) { + p_76624_1_.populate(p_76624_2_, p_76624_3_ - 1, p_76624_4_ - 1); + } + } + + /** + * Gets the height to which rain/snow will fall. Calculates it if not already stored. + */ + public int getPrecipitationHeight(int p_76626_1_, int p_76626_2_) { + int var3 = p_76626_1_ | p_76626_2_ << 4; + int var4 = this.precipitationHeightMap[var3]; + + if (var4 == -999) { + int var5 = this.getTopFilledSegment() + 15; + var4 = -1; + + while (var5 > 0 && var4 == -1) { + Block var6 = this.func_150810_a(p_76626_1_, var5, p_76626_2_); + Material var7 = var6.getMaterial(); + + if (!var7.blocksMovement() && !var7.isLiquid()) { + --var5; + } else { + var4 = var5 + 1; + } + } + + this.precipitationHeightMap[var3] = var4; + } + + return var4; + } + + public void func_150804_b(boolean p_150804_1_) { + if (this.isGapLightingUpdated && !this.worldObj.provider.hasNoSky && !p_150804_1_) { + this.recheckGaps(this.worldObj.isClient); + } + + this.field_150815_m = true; + + if (!this.isLightPopulated && this.isTerrainPopulated) { + this.func_150809_p(); + } + } + + public boolean func_150802_k() { + return this.field_150815_m && this.isTerrainPopulated && this.isLightPopulated; + } + + /** + * Gets a ChunkCoordIntPair representing the Chunk's position. + */ + public ChunkCoordIntPair getChunkCoordIntPair() { + return new ChunkCoordIntPair(this.xPosition, this.zPosition); + } + + /** + * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty + * (true) or not (false). + */ + public boolean getAreLevelsEmpty(int p_76606_1_, int p_76606_2_) { + if (p_76606_1_ < 0) { + p_76606_1_ = 0; + } + + if (p_76606_2_ >= 256) { + p_76606_2_ = 255; + } + + for (int var3 = p_76606_1_; var3 <= p_76606_2_; var3 += 16) { + ExtendedBlockStorage var4 = this.storageArrays[var3 >> 4]; + + if (var4 != null && !var4.isEmpty()) { + return false; + } + } + + return true; + } + + public void setStorageArrays(ExtendedBlockStorage[] p_76602_1_) { + this.storageArrays = p_76602_1_; + } + + /** + * Initialise this chunk with new binary data + */ + public void fillChunk(byte[] p_76607_1_, int p_76607_2_, int p_76607_3_, boolean p_76607_4_) { + int var5 = 0; + boolean var6 = !this.worldObj.provider.hasNoSky; + int var7; + + for (var7 = 0; var7 < this.storageArrays.length; ++var7) { + if ((p_76607_2_ & 1 << var7) != 0) { + if (this.storageArrays[var7] == null) { + this.storageArrays[var7] = new ExtendedBlockStorage(var7 << 4, var6); + } + + byte[] var8 = this.storageArrays[var7].getBlockLSBArray(); + System.arraycopy(p_76607_1_, var5, var8, 0, var8.length); + var5 += var8.length; + } else if (p_76607_4_ && this.storageArrays[var7] != null) { + this.storageArrays[var7] = null; + } + } + + NibbleArray var10; + + for (var7 = 0; var7 < this.storageArrays.length; ++var7) { + if ((p_76607_2_ & 1 << var7) != 0 && this.storageArrays[var7] != null) { + var10 = this.storageArrays[var7].getMetadataArray(); + System.arraycopy(p_76607_1_, var5, var10.data, 0, var10.data.length); + var5 += var10.data.length; + } + } + + for (var7 = 0; var7 < this.storageArrays.length; ++var7) { + if ((p_76607_2_ & 1 << var7) != 0 && this.storageArrays[var7] != null) { + var10 = this.storageArrays[var7].getBlocklightArray(); + System.arraycopy(p_76607_1_, var5, var10.data, 0, var10.data.length); + var5 += var10.data.length; + } + } + + if (var6) { + for (var7 = 0; var7 < this.storageArrays.length; ++var7) { + if ((p_76607_2_ & 1 << var7) != 0 && this.storageArrays[var7] != null) { + var10 = this.storageArrays[var7].getSkylightArray(); + System.arraycopy(p_76607_1_, var5, var10.data, 0, var10.data.length); + var5 += var10.data.length; + } + } + } + + for (var7 = 0; var7 < this.storageArrays.length; ++var7) { + if ((p_76607_3_ & 1 << var7) != 0) { + if (this.storageArrays[var7] == null) { + var5 += 2048; + } else { + var10 = this.storageArrays[var7].getBlockMSBArray(); + + if (var10 == null) { + var10 = this.storageArrays[var7].createBlockMSBArray(); + } + + System.arraycopy(p_76607_1_, var5, var10.data, 0, var10.data.length); + var5 += var10.data.length; + } + } else if (p_76607_4_ && this.storageArrays[var7] != null && this.storageArrays[var7].getBlockMSBArray() != null) { + this.storageArrays[var7].clearMSBArray(); + } + } + + if (p_76607_4_) { + System.arraycopy(p_76607_1_, var5, this.blockBiomeArray, 0, this.blockBiomeArray.length); + int var10000 = var5 + this.blockBiomeArray.length; + } + + for (var7 = 0; var7 < this.storageArrays.length; ++var7) { + if (this.storageArrays[var7] != null && (p_76607_2_ & 1 << var7) != 0) { + this.storageArrays[var7].removeInvalidBlocks(); + } + } + + this.isLightPopulated = true; + this.isTerrainPopulated = true; + this.generateHeightMap(); + Iterator var9 = this.chunkTileEntityMap.values().iterator(); + + while (var9.hasNext()) { + TileEntity var11 = (TileEntity)var9.next(); + var11.updateContainingBlockInfo(); + } + } + + /** + * This method retrieves the biome at a set of coordinates + */ + public BiomeGenBase getBiomeGenForWorldCoords(int p_76591_1_, int p_76591_2_, WorldChunkManager p_76591_3_) { + int var4 = this.blockBiomeArray[p_76591_2_ << 4 | p_76591_1_] & 255; + + if (var4 == 255) { + BiomeGenBase var5 = p_76591_3_.getBiomeGenAt((this.xPosition << 4) + p_76591_1_, (this.zPosition << 4) + p_76591_2_); + var4 = var5.biomeID; + this.blockBiomeArray[p_76591_2_ << 4 | p_76591_1_] = (byte)(var4 & 255); + } + + return BiomeGenBase.func_150568_d(var4) == null ? BiomeGenBase.plains : BiomeGenBase.func_150568_d(var4); + } + + /** + * Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs. + */ + public byte[] getBiomeArray() { + return this.blockBiomeArray; + } + + /** + * Accepts a 256-entry array that contains a 16x16 mapping on the X/Z plane of block positions in this Chunk to + * biome IDs. + */ + public void setBiomeArray(byte[] p_76616_1_) { + this.blockBiomeArray = p_76616_1_; + } + + /** + * Resets the relight check index to 0 for this Chunk. + */ + public void resetRelightChecks() { + this.queuedLightChecks = 0; + } + + /** + * Called once-per-chunk-per-tick, and advances the round-robin relight check index per-storage-block by up to 8 + * blocks at a time. In a worst-case scenario, can potentially take up to 1.6 seconds, calculated via + * (4096/(8*16))/20, to re-check all blocks in a chunk, which could explain both lagging light updates in certain + * cases as well as Nether relight + */ + public void enqueueRelightChecks() { + for (int var1 = 0; var1 < 8; ++var1) { + if (this.queuedLightChecks >= 4096) { + return; + } + + int var2 = this.queuedLightChecks % 16; + int var3 = this.queuedLightChecks / 16 % 16; + int var4 = this.queuedLightChecks / 256; + ++this.queuedLightChecks; + int var5 = (this.xPosition << 4) + var3; + int var6 = (this.zPosition << 4) + var4; + + for (int var7 = 0; var7 < 16; ++var7) { + int var8 = (var2 << 4) + var7; + + if (this.storageArrays[var2] == null && (var7 == 0 || var7 == 15 || var3 == 0 || var3 == 15 || var4 == 0 || var4 == 15) || this.storageArrays[var2] != null && this.storageArrays[var2].func_150819_a(var3, var7, var4).getMaterial() == Material.air) { + if (this.worldObj.getBlock(var5, var8 - 1, var6).getLightValue() > 0) { + this.worldObj.func_147451_t(var5, var8 - 1, var6); + } + + if (this.worldObj.getBlock(var5, var8 + 1, var6).getLightValue() > 0) { + this.worldObj.func_147451_t(var5, var8 + 1, var6); + } + + if (this.worldObj.getBlock(var5 - 1, var8, var6).getLightValue() > 0) { + this.worldObj.func_147451_t(var5 - 1, var8, var6); + } + + if (this.worldObj.getBlock(var5 + 1, var8, var6).getLightValue() > 0) { + this.worldObj.func_147451_t(var5 + 1, var8, var6); + } + + if (this.worldObj.getBlock(var5, var8, var6 - 1).getLightValue() > 0) { + this.worldObj.func_147451_t(var5, var8, var6 - 1); + } + + if (this.worldObj.getBlock(var5, var8, var6 + 1).getLightValue() > 0) { + this.worldObj.func_147451_t(var5, var8, var6 + 1); + } + + this.worldObj.func_147451_t(var5, var8, var6); + } + } + } + } + + public void func_150809_p() { + this.isTerrainPopulated = true; + this.isLightPopulated = true; + + if (!this.worldObj.provider.hasNoSky) { + if (this.worldObj.checkChunksExist(this.xPosition * 16 - 1, 0, this.zPosition * 16 - 1, this.xPosition * 16 + 1, 63, this.zPosition * 16 + 1)) { + for (int var1 = 0; var1 < 16; ++var1) { + for (int var2 = 0; var2 < 16; ++var2) { + if (!this.func_150811_f(var1, var2)) { + this.isLightPopulated = false; + break; + } + } + } + + if (this.isLightPopulated) { + Chunk var3 = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16 - 1, this.zPosition * 16); + var3.func_150801_a(3); + var3 = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16 + 16, this.zPosition * 16); + var3.func_150801_a(1); + var3 = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16, this.zPosition * 16 - 1); + var3.func_150801_a(0); + var3 = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16, this.zPosition * 16 + 16); + var3.func_150801_a(2); + } + } else { + this.isLightPopulated = false; + } + } + } + + private void func_150801_a(int p_150801_1_) { + if (this.isTerrainPopulated) { + int var2; + + if (p_150801_1_ == 3) { + for (var2 = 0; var2 < 16; ++var2) { + this.func_150811_f(15, var2); + } + } else if (p_150801_1_ == 1) { + for (var2 = 0; var2 < 16; ++var2) { + this.func_150811_f(0, var2); + } + } else if (p_150801_1_ == 0) { + for (var2 = 0; var2 < 16; ++var2) { + this.func_150811_f(var2, 15); + } + } else if (p_150801_1_ == 2) { + for (var2 = 0; var2 < 16; ++var2) { + this.func_150811_f(var2, 0); + } + } + } + } + + private boolean func_150811_f(int p_150811_1_, int p_150811_2_) { + int var3 = this.getTopFilledSegment(); + boolean var4 = false; + boolean var5 = false; + int var6; + + for (var6 = var3 + 16 - 1; var6 > 63 || var6 > 0 && !var5; --var6) { + int var7 = this.func_150808_b(p_150811_1_, var6, p_150811_2_); + + if (var7 == 255 && var6 < 63) { + var5 = true; + } + + if (!var4 && var7 > 0) { + var4 = true; + } else if (var4 && var7 == 0 && !this.worldObj.func_147451_t(this.xPosition * 16 + p_150811_1_, var6, this.zPosition * 16 + p_150811_2_)) { + return false; + } + } + + for (; var6 > 0; --var6) { + if (this.func_150810_a(p_150811_1_, var6, p_150811_2_).getLightValue() > 0) { + this.worldObj.func_147451_t(this.xPosition * 16 + p_150811_1_, var6, this.zPosition * 16 + p_150811_2_); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/EmptyChunk.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/EmptyChunk.java new file mode 100644 index 0000000..15c4109 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/EmptyChunk.java @@ -0,0 +1,171 @@ +package net.minecraft.world.chunk; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public class EmptyChunk extends Chunk { + + + public EmptyChunk(World p_i1994_1_, int p_i1994_2_, int p_i1994_3_) { + super(p_i1994_1_, p_i1994_2_, p_i1994_3_); + } + + /** + * Checks whether the chunk is at the X/Z location specified + */ + public boolean isAtLocation(int p_76600_1_, int p_76600_2_) { + return p_76600_1_ == this.xPosition && p_76600_2_ == this.zPosition; + } + + /** + * Returns the value in the height map at this x, z coordinate in the chunk + */ + public int getHeightValue(int p_76611_1_, int p_76611_2_) { + return 0; + } + + /** + * Generates the height map for a chunk from scratch + */ + public void generateHeightMap() {} + + /** + * Generates the initial skylight map for the chunk upon generation or load. + */ + public void generateSkylightMap() {} + + public Block func_150810_a(int p_150810_1_, int p_150810_2_, int p_150810_3_) { + return Blocks.air; + } + + public int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) { + return 255; + } + + public boolean func_150807_a(int p_150807_1_, int p_150807_2_, int p_150807_3_, Block p_150807_4_, int p_150807_5_) { + return true; + } + + /** + * Return the metadata corresponding to the given coordinates inside a chunk. + */ + public int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_) { + return 0; + } + + /** + * Set the metadata of a block in the chunk + */ + public boolean setBlockMetadata(int p_76589_1_, int p_76589_2_, int p_76589_3_, int p_76589_4_) { + return false; + } + + /** + * Gets the amount of light saved in this block (doesn't adjust for daylight) + */ + public int getSavedLightValue(EnumSkyBlock p_76614_1_, int p_76614_2_, int p_76614_3_, int p_76614_4_) { + return 0; + } + + /** + * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a + * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue + */ + public void setLightValue(EnumSkyBlock p_76633_1_, int p_76633_2_, int p_76633_3_, int p_76633_4_, int p_76633_5_) {} + + /** + * Gets the amount of light on a block taking into account sunlight + */ + public int getBlockLightValue(int p_76629_1_, int p_76629_2_, int p_76629_3_, int p_76629_4_) { + return 0; + } + + /** + * Adds an entity to the chunk. Args: entity + */ + public void addEntity(Entity p_76612_1_) {} + + /** + * removes entity using its y chunk coordinate as its index + */ + public void removeEntity(Entity p_76622_1_) {} + + /** + * Removes entity at the specified index from the entity array. + */ + public void removeEntityAtIndex(Entity p_76608_1_, int p_76608_2_) {} + + /** + * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) + */ + public boolean canBlockSeeTheSky(int p_76619_1_, int p_76619_2_, int p_76619_3_) { + return false; + } + + public TileEntity func_150806_e(int p_150806_1_, int p_150806_2_, int p_150806_3_) { + return null; + } + + public void addTileEntity(TileEntity p_150813_1_) {} + + public void func_150812_a(int p_150812_1_, int p_150812_2_, int p_150812_3_, TileEntity p_150812_4_) {} + + public void removeTileEntity(int p_150805_1_, int p_150805_2_, int p_150805_3_) {} + + /** + * Called when this Chunk is loaded by the ChunkProvider + */ + public void onChunkLoad() {} + + /** + * Called when this Chunk is unloaded by the ChunkProvider + */ + public void onChunkUnload() {} + + /** + * Sets the isModified flag for this Chunk + */ + public void setChunkModified() {} + + /** + * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity + * Args: entity, aabb, listToFill + */ + public void getEntitiesWithinAABBForEntity(Entity p_76588_1_, AxisAlignedBB p_76588_2_, List p_76588_3_, IEntitySelector p_76588_4_) {} + + /** + * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill + */ + public void getEntitiesOfTypeWithinAAAB(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_) {} + + /** + * Returns true if this Chunk needs to be saved + */ + public boolean needsSaving(boolean p_76601_1_) { + return false; + } + + public Random getRandomWithSeed(long p_76617_1_) { + return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ p_76617_1_); + } + + public boolean isEmpty() { + return true; + } + + /** + * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty + * (true) or not (false). + */ + public boolean getAreLevelsEmpty(int p_76606_1_, int p_76606_2_) { + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/IChunkProvider.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/IChunkProvider.java new file mode 100644 index 0000000..0d9c822 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/IChunkProvider.java @@ -0,0 +1,68 @@ +package net.minecraft.world.chunk; + +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public interface IChunkProvider { + /** + * Checks to see if a chunk exists at x, y + */ + boolean chunkExists(int p_73149_1_, int p_73149_2_); + + /** + * Will return back a chunk, if it doesn't exist and its not a MP com.cheatbreaker.client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + Chunk provideChunk(int p_73154_1_, int p_73154_2_); + + /** + * loads or generates the chunk at the chunk location specified + */ + Chunk loadChunk(int p_73158_1_, int p_73158_2_); + + /** + * Populates chunk with ores etc etc + */ + void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_); + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_); + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + boolean unloadQueuedChunks(); + + /** + * Returns if the IChunkProvider supports saving. + */ + boolean canSave(); + + /** + * Converts the instance data to a readable string. + */ + String makeString(); + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_); + + ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_); + + int getLoadedChunkCount(); + + void recreateStructures(int p_82695_1_, int p_82695_2_); + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + void saveExtraData(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/NibbleArray.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/NibbleArray.java new file mode 100644 index 0000000..250595d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/NibbleArray.java @@ -0,0 +1,57 @@ +package net.minecraft.world.chunk; + +public class NibbleArray { + /** + * Byte array of data stored in this holder. Possibly a light map or some chunk data. Data is accessed in 4-bit + * pieces. + */ + public final byte[] data; + + /** + * Log base 2 of the chunk height (128); applied as a shift on Z coordinate + */ + private final int depthBits; + + /** + * Log base 2 of the chunk height (128) * width (16); applied as a shift on X coordinate + */ + private final int depthBitsPlusFour; + + + public NibbleArray(int p_i1992_1_, int p_i1992_2_) { + this.data = new byte[p_i1992_1_ >> 1]; + this.depthBits = p_i1992_2_; + this.depthBitsPlusFour = p_i1992_2_ + 4; + } + + public NibbleArray(byte[] p_i1993_1_, int p_i1993_2_) { + this.data = p_i1993_1_; + this.depthBits = p_i1993_2_; + this.depthBitsPlusFour = p_i1993_2_ + 4; + } + + /** + * Returns the nibble of data corresponding to the passed in x, y, z. y is at most 6 bits, z is at most 4. + */ + public int get(int p_76582_1_, int p_76582_2_, int p_76582_3_) { + int var4 = p_76582_2_ << this.depthBitsPlusFour | p_76582_3_ << this.depthBits | p_76582_1_; + int var5 = var4 >> 1; + int var6 = var4 & 1; + return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15; + } + + /** + * Arguments are x, y, z, val. Sets the nibble of data at x << 11 | z << 7 | y to val. + */ + public void set(int p_76581_1_, int p_76581_2_, int p_76581_3_, int p_76581_4_) { + int var5 = p_76581_2_ << this.depthBitsPlusFour | p_76581_3_ << this.depthBits | p_76581_1_; + int var6 = var5 >> 1; + int var7 = var5 & 1; + + if (var7 == 0) { + this.data[var6] = (byte)(this.data[var6] & 240 | p_76581_4_ & 15); + } else { + this.data[var6] = (byte)(this.data[var6] & 15 | (p_76581_4_ & 15) << 4); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java new file mode 100644 index 0000000..23c022b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -0,0 +1,393 @@ +package net.minecraft.world.chunk.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.NibbleArray; +import net.minecraft.world.storage.IThreadedFileIO; +import net.minecraft.world.storage.ThreadedFileIOBase; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO { + private static final Logger logger = LogManager.getLogger(); + private final List chunksToRemove = new ArrayList(); + private final Set pendingAnvilChunksCoordinates = new HashSet(); + private final Object syncLockObject = new Object(); + + /** Save directory for chunks using the Anvil format */ + private final File chunkSaveLocation; + + + public AnvilChunkLoader(File p_i2003_1_) { + this.chunkSaveLocation = p_i2003_1_; + } + + /** + * Loads the specified(XZ) chunk into the specified world. + */ + public Chunk loadChunk(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException { + NBTTagCompound var4 = null; + ChunkCoordIntPair var5 = new ChunkCoordIntPair(p_75815_2_, p_75815_3_); + Object var6 = this.syncLockObject; + + synchronized (this.syncLockObject) { + if (this.pendingAnvilChunksCoordinates.contains(var5)) { + for (int var7 = 0; var7 < this.chunksToRemove.size(); ++var7) { + if (((AnvilChunkLoader.PendingChunk)this.chunksToRemove.get(var7)).chunkCoordinate.equals(var5)) { + var4 = ((AnvilChunkLoader.PendingChunk)this.chunksToRemove.get(var7)).nbtTags; + break; + } + } + } + } + + if (var4 == null) { + DataInputStream var10 = RegionFileCache.getChunkInputStream(this.chunkSaveLocation, p_75815_2_, p_75815_3_); + + if (var10 == null) { + return null; + } + + var4 = CompressedStreamTools.read(var10); + } + + return this.checkedReadChunkFromNBT(p_75815_1_, p_75815_2_, p_75815_3_, var4); + } + + /** + * Wraps readChunkFromNBT. Checks the coordinates and several NBT tags. + */ + protected Chunk checkedReadChunkFromNBT(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) { + if (!p_75822_4_.func_150297_b("Level", 10)) { + logger.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is missing level data, skipping"); + return null; + } else if (!p_75822_4_.getCompoundTag("Level").func_150297_b("Sections", 9)) { + logger.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is missing block data, skipping"); + return null; + } else { + Chunk var5 = this.readChunkFromNBT(p_75822_1_, p_75822_4_.getCompoundTag("Level")); + + if (!var5.isAtLocation(p_75822_2_, p_75822_3_)) { + logger.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is in the wrong location; relocating. (Expected " + p_75822_2_ + ", " + p_75822_3_ + ", got " + var5.xPosition + ", " + var5.zPosition + ")"); + p_75822_4_.setInteger("xPos", p_75822_2_); + p_75822_4_.setInteger("zPos", p_75822_3_); + var5 = this.readChunkFromNBT(p_75822_1_, p_75822_4_.getCompoundTag("Level")); + } + + return var5; + } + } + + public void saveChunk(World p_75816_1_, Chunk p_75816_2_) throws MinecraftException, IOException { + p_75816_1_.checkSessionLock(); + + try { + NBTTagCompound var3 = new NBTTagCompound(); + NBTTagCompound var4 = new NBTTagCompound(); + var3.setTag("Level", var4); + this.writeChunkToNBT(p_75816_2_, p_75816_1_, var4); + this.addChunkToPending(p_75816_2_.getChunkCoordIntPair(), var3); + } catch (Exception var5) { + var5.printStackTrace(); + } + } + + protected void addChunkToPending(ChunkCoordIntPair p_75824_1_, NBTTagCompound p_75824_2_) { + Object var3 = this.syncLockObject; + + synchronized (this.syncLockObject) { + if (this.pendingAnvilChunksCoordinates.contains(p_75824_1_)) { + for (int var4 = 0; var4 < this.chunksToRemove.size(); ++var4) { + if (((AnvilChunkLoader.PendingChunk)this.chunksToRemove.get(var4)).chunkCoordinate.equals(p_75824_1_)) { + this.chunksToRemove.set(var4, new AnvilChunkLoader.PendingChunk(p_75824_1_, p_75824_2_)); + return; + } + } + } + + this.chunksToRemove.add(new AnvilChunkLoader.PendingChunk(p_75824_1_, p_75824_2_)); + this.pendingAnvilChunksCoordinates.add(p_75824_1_); + ThreadedFileIOBase.threadedIOInstance.queueIO(this); + } + } + + /** + * Returns a boolean stating if the write was unsuccessful. + */ + public boolean writeNextIO() { + AnvilChunkLoader.PendingChunk var1 = null; + Object var2 = this.syncLockObject; + + synchronized (this.syncLockObject) { + if (this.chunksToRemove.isEmpty()) { + return false; + } + + var1 = (AnvilChunkLoader.PendingChunk)this.chunksToRemove.remove(0); + this.pendingAnvilChunksCoordinates.remove(var1.chunkCoordinate); + } + + if (var1 != null) { + try { + this.writeChunkNBTTags(var1); + } catch (Exception var4) { + var4.printStackTrace(); + } + } + + return true; + } + + private void writeChunkNBTTags(AnvilChunkLoader.PendingChunk p_75821_1_) throws IOException { + DataOutputStream var2 = RegionFileCache.getChunkOutputStream(this.chunkSaveLocation, p_75821_1_.chunkCoordinate.chunkXPos, p_75821_1_.chunkCoordinate.chunkZPos); + CompressedStreamTools.write(p_75821_1_.nbtTags, var2); + var2.close(); + } + + /** + * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. + * Currently unused. + */ + public void saveExtraChunkData(World p_75819_1_, Chunk p_75819_2_) {} + + /** + * Called every World.tick() + */ + public void chunkTick() {} + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unused. + */ + public void saveExtraData() { + while (this.writeNextIO()) { + } + } + + /** + * Writes the Chunk passed as an argument to the NBTTagCompound also passed, using the World argument to retrieve + * the Chunk's last update time. + */ + private void writeChunkToNBT(Chunk p_75820_1_, World p_75820_2_, NBTTagCompound p_75820_3_) { + p_75820_3_.setByte("V", (byte)1); + p_75820_3_.setInteger("xPos", p_75820_1_.xPosition); + p_75820_3_.setInteger("zPos", p_75820_1_.zPosition); + p_75820_3_.setLong("LastUpdate", p_75820_2_.getTotalWorldTime()); + p_75820_3_.setIntArray("HeightMap", p_75820_1_.heightMap); + p_75820_3_.setBoolean("TerrainPopulated", p_75820_1_.isTerrainPopulated); + p_75820_3_.setBoolean("LightPopulated", p_75820_1_.isLightPopulated); + p_75820_3_.setLong("InhabitedTime", p_75820_1_.inhabitedTime); + ExtendedBlockStorage[] var4 = p_75820_1_.getBlockStorageArray(); + NBTTagList var5 = new NBTTagList(); + boolean var6 = !p_75820_2_.provider.hasNoSky; + ExtendedBlockStorage[] var7 = var4; + int var8 = var4.length; + NBTTagCompound var11; + + for (int var9 = 0; var9 < var8; ++var9) { + ExtendedBlockStorage var10 = var7[var9]; + + if (var10 != null) { + var11 = new NBTTagCompound(); + var11.setByte("Y", (byte)(var10.getYLocation() >> 4 & 255)); + var11.setByteArray("Blocks", var10.getBlockLSBArray()); + + if (var10.getBlockMSBArray() != null) { + var11.setByteArray("Add", var10.getBlockMSBArray().data); + } + + var11.setByteArray("Data", var10.getMetadataArray().data); + var11.setByteArray("BlockLight", var10.getBlocklightArray().data); + + if (var6) { + var11.setByteArray("SkyLight", var10.getSkylightArray().data); + } else { + var11.setByteArray("SkyLight", new byte[var10.getBlocklightArray().data.length]); + } + + var5.appendTag(var11); + } + } + + p_75820_3_.setTag("Sections", var5); + p_75820_3_.setByteArray("Biomes", p_75820_1_.getBiomeArray()); + p_75820_1_.hasEntities = false; + NBTTagList var16 = new NBTTagList(); + Iterator var18; + + for (var8 = 0; var8 < p_75820_1_.entityLists.length; ++var8) { + var18 = p_75820_1_.entityLists[var8].iterator(); + + while (var18.hasNext()) { + Entity var20 = (Entity)var18.next(); + var11 = new NBTTagCompound(); + + if (var20.writeToNBTOptional(var11)) { + p_75820_1_.hasEntities = true; + var16.appendTag(var11); + } + } + } + + p_75820_3_.setTag("Entities", var16); + NBTTagList var17 = new NBTTagList(); + var18 = p_75820_1_.chunkTileEntityMap.values().iterator(); + + while (var18.hasNext()) { + TileEntity var21 = (TileEntity)var18.next(); + var11 = new NBTTagCompound(); + var21.writeToNBT(var11); + var17.appendTag(var11); + } + + p_75820_3_.setTag("TileEntities", var17); + List var19 = p_75820_2_.getPendingBlockUpdates(p_75820_1_, false); + + if (var19 != null) { + long var22 = p_75820_2_.getTotalWorldTime(); + NBTTagList var12 = new NBTTagList(); + Iterator var13 = var19.iterator(); + + while (var13.hasNext()) { + NextTickListEntry var14 = (NextTickListEntry)var13.next(); + NBTTagCompound var15 = new NBTTagCompound(); + var15.setInteger("i", Block.getIdFromBlock(var14.func_151351_a())); + var15.setInteger("x", var14.xCoord); + var15.setInteger("y", var14.yCoord); + var15.setInteger("z", var14.zCoord); + var15.setInteger("t", (int)(var14.scheduledTime - var22)); + var15.setInteger("p", var14.priority); + var12.appendTag(var15); + } + + p_75820_3_.setTag("TileTicks", var12); + } + } + + /** + * Reads the data stored in the passed NBTTagCompound and creates a Chunk with that data in the passed World. + * Returns the created Chunk. + */ + private Chunk readChunkFromNBT(World p_75823_1_, NBTTagCompound p_75823_2_) { + int var3 = p_75823_2_.getInteger("xPos"); + int var4 = p_75823_2_.getInteger("zPos"); + Chunk var5 = new Chunk(p_75823_1_, var3, var4); + var5.heightMap = p_75823_2_.getIntArray("HeightMap"); + var5.isTerrainPopulated = p_75823_2_.getBoolean("TerrainPopulated"); + var5.isLightPopulated = p_75823_2_.getBoolean("LightPopulated"); + var5.inhabitedTime = p_75823_2_.getLong("InhabitedTime"); + NBTTagList var6 = p_75823_2_.getTagList("Sections", 10); + byte var7 = 16; + ExtendedBlockStorage[] var8 = new ExtendedBlockStorage[var7]; + boolean var9 = !p_75823_1_.provider.hasNoSky; + + for (int var10 = 0; var10 < var6.tagCount(); ++var10) { + NBTTagCompound var11 = var6.getCompoundTagAt(var10); + byte var12 = var11.getByte("Y"); + ExtendedBlockStorage var13 = new ExtendedBlockStorage(var12 << 4, var9); + var13.setBlockLSBArray(var11.getByteArray("Blocks")); + + if (var11.func_150297_b("Add", 7)) { + var13.setBlockMSBArray(new NibbleArray(var11.getByteArray("Add"), 4)); + } + + var13.setBlockMetadataArray(new NibbleArray(var11.getByteArray("Data"), 4)); + var13.setBlocklightArray(new NibbleArray(var11.getByteArray("BlockLight"), 4)); + + if (var9) { + var13.setSkylightArray(new NibbleArray(var11.getByteArray("SkyLight"), 4)); + } + + var13.removeInvalidBlocks(); + var8[var12] = var13; + } + + var5.setStorageArrays(var8); + + if (p_75823_2_.func_150297_b("Biomes", 7)) { + var5.setBiomeArray(p_75823_2_.getByteArray("Biomes")); + } + + NBTTagList var17 = p_75823_2_.getTagList("Entities", 10); + + if (var17 != null) { + for (int var18 = 0; var18 < var17.tagCount(); ++var18) { + NBTTagCompound var20 = var17.getCompoundTagAt(var18); + Entity var23 = EntityList.createEntityFromNBT(var20, p_75823_1_); + var5.hasEntities = true; + + if (var23 != null) { + var5.addEntity(var23); + Entity var14 = var23; + + for (NBTTagCompound var15 = var20; var15.func_150297_b("Riding", 10); var15 = var15.getCompoundTag("Riding")) { + Entity var16 = EntityList.createEntityFromNBT(var15.getCompoundTag("Riding"), p_75823_1_); + + if (var16 != null) { + var5.addEntity(var16); + var14.mountEntity(var16); + } + + var14 = var16; + } + } + } + } + + NBTTagList var19 = p_75823_2_.getTagList("TileEntities", 10); + + if (var19 != null) { + for (int var21 = 0; var21 < var19.tagCount(); ++var21) { + NBTTagCompound var24 = var19.getCompoundTagAt(var21); + TileEntity var26 = TileEntity.createAndLoadEntity(var24); + + if (var26 != null) { + var5.addTileEntity(var26); + } + } + } + + if (p_75823_2_.func_150297_b("TileTicks", 9)) { + NBTTagList var22 = p_75823_2_.getTagList("TileTicks", 10); + + if (var22 != null) { + for (int var25 = 0; var25 < var22.tagCount(); ++var25) { + NBTTagCompound var27 = var22.getCompoundTagAt(var25); + p_75823_1_.func_147446_b(var27.getInteger("x"), var27.getInteger("y"), var27.getInteger("z"), Block.getBlockById(var27.getInteger("i")), var27.getInteger("t"), var27.getInteger("p")); + } + } + } + + return var5; + } + + static class PendingChunk { + public final ChunkCoordIntPair chunkCoordinate; + public final NBTTagCompound nbtTags; + + + public PendingChunk(ChunkCoordIntPair p_i2002_1_, NBTTagCompound p_i2002_2_) { + this.chunkCoordinate = p_i2002_1_; + this.nbtTags = p_i2002_2_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java new file mode 100644 index 0000000..4a62289 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java @@ -0,0 +1,251 @@ +package net.minecraft.world.chunk.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.SaveFormatOld; +import net.minecraft.world.storage.WorldInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class AnvilSaveConverter extends SaveFormatOld { + private static final Logger logger = LogManager.getLogger(); + + + public AnvilSaveConverter(File p_i2144_1_) { + super(p_i2144_1_); + } + + public String func_154333_a() { + return "Anvil"; + } + + public List getSaveList() throws AnvilConverterException { + if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory()) { + ArrayList var1 = new ArrayList(); + File[] var2 = this.savesDirectory.listFiles(); + File[] var3 = var2; + int var4 = var2.length; + + for (int var5 = 0; var5 < var4; ++var5) { + File var6 = var3[var5]; + + if (var6.isDirectory()) { + String var7 = var6.getName(); + WorldInfo var8 = this.getWorldInfo(var7); + + if (var8 != null && (var8.getSaveVersion() == 19132 || var8.getSaveVersion() == 19133)) { + boolean var9 = var8.getSaveVersion() != this.getSaveVersion(); + String var10 = var8.getWorldName(); + + if (var10 == null || MathHelper.stringNullOrLengthZero(var10)) { + var10 = var7; + } + + long var11 = 0L; + var1.add(new SaveFormatComparator(var7, var10, var8.getLastTimePlayed(), var11, var8.getGameType(), var9, var8.isHardcoreModeEnabled(), var8.areCommandsAllowed())); + } + } + } + + return var1; + } else { + throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!"); + } + } + + protected int getSaveVersion() { + return 19133; + } + + public void flushCache() { + RegionFileCache.clearRegionFileReferences(); + } + + /** + * Returns back a loader for the specified save directory + */ + public ISaveHandler getSaveLoader(String p_75804_1_, boolean p_75804_2_) { + return new AnvilSaveHandler(this.savesDirectory, p_75804_1_, p_75804_2_); + } + + public boolean func_154334_a(String p_154334_1_) { + WorldInfo var2 = this.getWorldInfo(p_154334_1_); + return var2 != null && var2.getSaveVersion() == 19132; + } + + /** + * Checks if the save directory uses the old map format + */ + public boolean isOldMapFormat(String p_75801_1_) { + WorldInfo var2 = this.getWorldInfo(p_75801_1_); + return var2 != null && var2.getSaveVersion() != this.getSaveVersion(); + } + + /** + * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + public boolean convertMapFormat(String p_75805_1_, IProgressUpdate p_75805_2_) { + p_75805_2_.setLoadingProgress(0); + ArrayList var3 = new ArrayList(); + ArrayList var4 = new ArrayList(); + ArrayList var5 = new ArrayList(); + File var6 = new File(this.savesDirectory, p_75805_1_); + File var7 = new File(var6, "DIM-1"); + File var8 = new File(var6, "DIM1"); + logger.info("Scanning folders..."); + this.addRegionFilesToCollection(var6, var3); + + if (var7.exists()) { + this.addRegionFilesToCollection(var7, var4); + } + + if (var8.exists()) { + this.addRegionFilesToCollection(var8, var5); + } + + int var9 = var3.size() + var4.size() + var5.size(); + logger.info("Total conversion count is " + var9); + WorldInfo var10 = this.getWorldInfo(p_75805_1_); + Object var11 = null; + + if (var10.getTerrainType() == WorldType.FLAT) { + var11 = new WorldChunkManagerHell(BiomeGenBase.plains, 0.5F); + } else { + var11 = new WorldChunkManager(var10.getSeed(), var10.getTerrainType()); + } + + this.convertFile(new File(var6, "region"), var3, (WorldChunkManager)var11, 0, var9, p_75805_2_); + this.convertFile(new File(var7, "region"), var4, new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F), var3.size(), var9, p_75805_2_); + this.convertFile(new File(var8, "region"), var5, new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F), var3.size() + var4.size(), var9, p_75805_2_); + var10.setSaveVersion(19133); + + if (var10.getTerrainType() == WorldType.DEFAULT_1_1) { + var10.setTerrainType(WorldType.DEFAULT); + } + + this.createFile(p_75805_1_); + ISaveHandler var12 = this.getSaveLoader(p_75805_1_, false); + var12.saveWorldInfo(var10); + return true; + } + + /** + * par: filename for the level.dat_mcr backup + */ + private void createFile(String p_75809_1_) { + File var2 = new File(this.savesDirectory, p_75809_1_); + + if (!var2.exists()) { + logger.warn("Unable to create level.dat_mcr backup"); + } else { + File var3 = new File(var2, "level.dat"); + + if (!var3.exists()) { + logger.warn("Unable to create level.dat_mcr backup"); + } else { + File var4 = new File(var2, "level.dat_mcr"); + + if (!var3.renameTo(var4)) { + logger.warn("Unable to create level.dat_mcr backup"); + } + } + } + } + + private void convertFile(File p_75813_1_, Iterable p_75813_2_, WorldChunkManager p_75813_3_, int p_75813_4_, int p_75813_5_, IProgressUpdate p_75813_6_) { + Iterator var7 = p_75813_2_.iterator(); + + while (var7.hasNext()) { + File var8 = (File)var7.next(); + this.convertChunks(p_75813_1_, var8, p_75813_3_, p_75813_4_, p_75813_5_, p_75813_6_); + ++p_75813_4_; + int var9 = (int)Math.round(100.0D * (double)p_75813_4_ / (double)p_75813_5_); + p_75813_6_.setLoadingProgress(var9); + } + } + + /** + * copies a 32x32 chunk set from par2File to par1File, via AnvilConverterData + */ + private void convertChunks(File p_75811_1_, File p_75811_2_, WorldChunkManager p_75811_3_, int p_75811_4_, int p_75811_5_, IProgressUpdate p_75811_6_) { + try { + String var7 = p_75811_2_.getName(); + RegionFile var8 = new RegionFile(p_75811_2_); + RegionFile var9 = new RegionFile(new File(p_75811_1_, var7.substring(0, var7.length() - ".mcr".length()) + ".mca")); + + for (int var10 = 0; var10 < 32; ++var10) { + int var11; + + for (var11 = 0; var11 < 32; ++var11) { + if (var8.isChunkSaved(var10, var11) && !var9.isChunkSaved(var10, var11)) { + DataInputStream var12 = var8.getChunkDataInputStream(var10, var11); + + if (var12 == null) { + logger.warn("Failed to fetch input stream"); + } else { + NBTTagCompound var13 = CompressedStreamTools.read(var12); + var12.close(); + NBTTagCompound var14 = var13.getCompoundTag("Level"); + ChunkLoader.AnvilConverterData var15 = ChunkLoader.load(var14); + NBTTagCompound var16 = new NBTTagCompound(); + NBTTagCompound var17 = new NBTTagCompound(); + var16.setTag("Level", var17); + ChunkLoader.convertToAnvilFormat(var15, var17, p_75811_3_); + DataOutputStream var18 = var9.getChunkDataOutputStream(var10, var11); + CompressedStreamTools.write(var16, var18); + var18.close(); + } + } + } + + var11 = (int)Math.round(100.0D * (double)(p_75811_4_ * 1024) / (double)(p_75811_5_ * 1024)); + int var20 = (int)Math.round(100.0D * (double)((var10 + 1) * 32 + p_75811_4_ * 1024) / (double)(p_75811_5_ * 1024)); + + if (var20 > var11) { + p_75811_6_.setLoadingProgress(var20); + } + } + + var8.close(); + var9.close(); + } catch (IOException var19) { + var19.printStackTrace(); + } + } + + /** + * filters the files in the par1 directory, and adds them to the par2 collections + */ + private void addRegionFilesToCollection(File p_75810_1_, Collection p_75810_2_) { + File var3 = new File(p_75810_1_, "region"); + File[] var4 = var3.listFiles(new FilenameFilter() { + + public boolean accept(File p_accept_1_, String p_accept_2_) { + return p_accept_2_.endsWith(".mcr"); + } + }); + + if (var4 != null) { + Collections.addAll(p_75810_2_, var4); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java new file mode 100644 index 0000000..a5e76c1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java @@ -0,0 +1,59 @@ +package net.minecraft.world.chunk.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldProviderEnd; +import net.minecraft.world.WorldProviderHell; +import net.minecraft.world.storage.SaveHandler; +import net.minecraft.world.storage.ThreadedFileIOBase; +import net.minecraft.world.storage.WorldInfo; + +public class AnvilSaveHandler extends SaveHandler { + + + public AnvilSaveHandler(File p_i2142_1_, String p_i2142_2_, boolean p_i2142_3_) { + super(p_i2142_1_, p_i2142_2_, p_i2142_3_); + } + + /** + * Returns the chunk loader with the provided world provider + */ + public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) { + File var2 = this.getWorldDirectory(); + File var3; + + if (p_75763_1_ instanceof WorldProviderHell) { + var3 = new File(var2, "DIM-1"); + var3.mkdirs(); + return new AnvilChunkLoader(var3); + } else if (p_75763_1_ instanceof WorldProviderEnd) { + var3 = new File(var2, "DIM1"); + var3.mkdirs(); + return new AnvilChunkLoader(var3); + } else { + return new AnvilChunkLoader(var2); + } + } + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + public void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_) { + p_75755_1_.setSaveVersion(19133); + super.saveWorldInfoWithPlayer(p_75755_1_, p_75755_2_); + } + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + public void flush() { + try { + ThreadedFileIOBase.threadedIOInstance.waitForFinish(); + } catch (InterruptedException var2) { + var2.printStackTrace(); + } + + RegionFileCache.clearRegionFileReferences(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java new file mode 100644 index 0000000..cd1f71f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java @@ -0,0 +1,144 @@ +package net.minecraft.world.chunk.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.NibbleArray; + +public class ChunkLoader { + + + public static ChunkLoader.AnvilConverterData load(NBTTagCompound p_76691_0_) { + int var1 = p_76691_0_.getInteger("xPos"); + int var2 = p_76691_0_.getInteger("zPos"); + ChunkLoader.AnvilConverterData var3 = new ChunkLoader.AnvilConverterData(var1, var2); + var3.blocks = p_76691_0_.getByteArray("Blocks"); + var3.data = new NibbleArrayReader(p_76691_0_.getByteArray("Data"), 7); + var3.skyLight = new NibbleArrayReader(p_76691_0_.getByteArray("SkyLight"), 7); + var3.blockLight = new NibbleArrayReader(p_76691_0_.getByteArray("BlockLight"), 7); + var3.heightmap = p_76691_0_.getByteArray("HeightMap"); + var3.terrainPopulated = p_76691_0_.getBoolean("TerrainPopulated"); + var3.entities = p_76691_0_.getTagList("Entities", 10); + var3.field_151564_i = p_76691_0_.getTagList("TileEntities", 10); + var3.field_151563_j = p_76691_0_.getTagList("TileTicks", 10); + + try { + var3.lastUpdated = p_76691_0_.getLong("LastUpdate"); + } catch (ClassCastException var5) { + var3.lastUpdated = p_76691_0_.getInteger("LastUpdate"); + } + + return var3; + } + + public static void convertToAnvilFormat(ChunkLoader.AnvilConverterData p_76690_0_, NBTTagCompound p_76690_1_, WorldChunkManager p_76690_2_) { + p_76690_1_.setInteger("xPos", p_76690_0_.x); + p_76690_1_.setInteger("zPos", p_76690_0_.z); + p_76690_1_.setLong("LastUpdate", p_76690_0_.lastUpdated); + int[] var3 = new int[p_76690_0_.heightmap.length]; + + for (int var4 = 0; var4 < p_76690_0_.heightmap.length; ++var4) { + var3[var4] = p_76690_0_.heightmap[var4]; + } + + p_76690_1_.setIntArray("HeightMap", var3); + p_76690_1_.setBoolean("TerrainPopulated", p_76690_0_.terrainPopulated); + NBTTagList var16 = new NBTTagList(); + int var7; + + for (int var5 = 0; var5 < 8; ++var5) { + boolean var6 = true; + + for (var7 = 0; var7 < 16 && var6; ++var7) { + int var8 = 0; + + while (var8 < 16 && var6) { + int var9 = 0; + + while (true) { + if (var9 < 16) { + int var10 = var7 << 11 | var9 << 7 | var8 + (var5 << 4); + byte var11 = p_76690_0_.blocks[var10]; + + if (var11 == 0) { + ++var9; + continue; + } + + var6 = false; + } + + ++var8; + break; + } + } + } + + if (!var6) { + byte[] var19 = new byte[4096]; + NibbleArray var20 = new NibbleArray(var19.length, 4); + NibbleArray var21 = new NibbleArray(var19.length, 4); + NibbleArray var22 = new NibbleArray(var19.length, 4); + + for (int var23 = 0; var23 < 16; ++var23) { + for (int var12 = 0; var12 < 16; ++var12) { + for (int var13 = 0; var13 < 16; ++var13) { + int var14 = var23 << 11 | var13 << 7 | var12 + (var5 << 4); + byte var15 = p_76690_0_.blocks[var14]; + var19[var12 << 8 | var13 << 4 | var23] = (byte)(var15 & 255); + var20.set(var23, var12, var13, p_76690_0_.data.get(var23, var12 + (var5 << 4), var13)); + var21.set(var23, var12, var13, p_76690_0_.skyLight.get(var23, var12 + (var5 << 4), var13)); + var22.set(var23, var12, var13, p_76690_0_.blockLight.get(var23, var12 + (var5 << 4), var13)); + } + } + } + + NBTTagCompound var24 = new NBTTagCompound(); + var24.setByte("Y", (byte)(var5 & 255)); + var24.setByteArray("Blocks", var19); + var24.setByteArray("Data", var20.data); + var24.setByteArray("SkyLight", var21.data); + var24.setByteArray("BlockLight", var22.data); + var16.appendTag(var24); + } + } + + p_76690_1_.setTag("Sections", var16); + byte[] var17 = new byte[256]; + + for (int var18 = 0; var18 < 16; ++var18) { + for (var7 = 0; var7 < 16; ++var7) { + var17[var7 << 4 | var18] = (byte)(p_76690_2_.getBiomeGenAt(p_76690_0_.x << 4 | var18, p_76690_0_.z << 4 | var7).biomeID & 255); + } + } + + p_76690_1_.setByteArray("Biomes", var17); + p_76690_1_.setTag("Entities", p_76690_0_.entities); + p_76690_1_.setTag("TileEntities", p_76690_0_.field_151564_i); + + if (p_76690_0_.field_151563_j != null) { + p_76690_1_.setTag("TileTicks", p_76690_0_.field_151563_j); + } + } + + public static class AnvilConverterData { + public long lastUpdated; + public boolean terrainPopulated; + public byte[] heightmap; + public NibbleArrayReader blockLight; + public NibbleArrayReader skyLight; + public NibbleArrayReader data; + public byte[] blocks; + public NBTTagList entities; + public NBTTagList field_151564_i; + public NBTTagList field_151563_j; + public final int x; + public final int z; + + + public AnvilConverterData(int p_i1999_1_, int p_i1999_2_) { + this.x = p_i1999_1_; + this.z = p_i1999_2_; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java new file mode 100644 index 0000000..b8d205b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java @@ -0,0 +1,267 @@ +package net.minecraft.world.chunk.storage; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.chunk.NibbleArray; + +public class ExtendedBlockStorage { + /** + * Contains the bottom-most Y block represented by this ExtendedBlockStorage. Typically a multiple of 16. + */ + private final int yBase; + + /** + * A total count of the number of non-air blocks in this block storage's Chunk. + */ + private int blockRefCount; + + /** + * Contains the number of blocks in this block storage's parent chunk that require random ticking. Used to cull the + * Chunk from random tick updates for performance reasons. + */ + private int tickRefCount; + + /** + * Contains the least significant 8 bits of each block ID belonging to this block storage's parent Chunk. + */ + private byte[] blockLSBArray; + + /** + * Contains the most significant 4 bits of each block ID belonging to this block storage's parent Chunk. + */ + private NibbleArray blockMSBArray; + + /** + * Stores the metadata associated with blocks in this ExtendedBlockStorage. + */ + private NibbleArray blockMetadataArray; + + /** The NibbleArray containing a block of Block-light data. */ + private NibbleArray blocklightArray; + + /** The NibbleArray containing a block of Sky-light data. */ + private NibbleArray skylightArray; + + + public ExtendedBlockStorage(int p_i1997_1_, boolean p_i1997_2_) { + this.yBase = p_i1997_1_; + this.blockLSBArray = new byte[4096]; + this.blockMetadataArray = new NibbleArray(this.blockLSBArray.length, 4); + this.blocklightArray = new NibbleArray(this.blockLSBArray.length, 4); + + if (p_i1997_2_) { + this.skylightArray = new NibbleArray(this.blockLSBArray.length, 4); + } + } + + public Block func_150819_a(int p_150819_1_, int p_150819_2_, int p_150819_3_) { + int var4 = this.blockLSBArray[p_150819_2_ << 8 | p_150819_3_ << 4 | p_150819_1_] & 255; + + if (this.blockMSBArray != null) { + var4 |= this.blockMSBArray.get(p_150819_1_, p_150819_2_, p_150819_3_) << 8; + } + + return Block.getBlockById(var4); + } + + public void func_150818_a(int p_150818_1_, int p_150818_2_, int p_150818_3_, Block p_150818_4_) { + int var5 = this.blockLSBArray[p_150818_2_ << 8 | p_150818_3_ << 4 | p_150818_1_] & 255; + + if (this.blockMSBArray != null) { + var5 |= this.blockMSBArray.get(p_150818_1_, p_150818_2_, p_150818_3_) << 8; + } + + Block var6 = Block.getBlockById(var5); + + if (var6 != Blocks.air) { + --this.blockRefCount; + + if (var6.getTickRandomly()) { + --this.tickRefCount; + } + } + + if (p_150818_4_ != Blocks.air) { + ++this.blockRefCount; + + if (p_150818_4_.getTickRandomly()) { + ++this.tickRefCount; + } + } + + int var7 = Block.getIdFromBlock(p_150818_4_); + this.blockLSBArray[p_150818_2_ << 8 | p_150818_3_ << 4 | p_150818_1_] = (byte)(var7 & 255); + + if (var7 > 255) { + if (this.blockMSBArray == null) { + this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); + } + + this.blockMSBArray.set(p_150818_1_, p_150818_2_, p_150818_3_, (var7 & 3840) >> 8); + } else if (this.blockMSBArray != null) { + this.blockMSBArray.set(p_150818_1_, p_150818_2_, p_150818_3_, 0); + } + } + + /** + * Returns the metadata associated with the block at the given coordinates in this ExtendedBlockStorage. + */ + public int getExtBlockMetadata(int p_76665_1_, int p_76665_2_, int p_76665_3_) { + return this.blockMetadataArray.get(p_76665_1_, p_76665_2_, p_76665_3_); + } + + /** + * Sets the metadata of the Block at the given coordinates in this ExtendedBlockStorage to the given metadata. + */ + public void setExtBlockMetadata(int p_76654_1_, int p_76654_2_, int p_76654_3_, int p_76654_4_) { + this.blockMetadataArray.set(p_76654_1_, p_76654_2_, p_76654_3_, p_76654_4_); + } + + /** + * Returns whether or not this block storage's Chunk is fully empty, based on its internal reference count. + */ + public boolean isEmpty() { + return this.blockRefCount == 0; + } + + /** + * Returns whether or not this block storage's Chunk will require random ticking, used to avoid looping through + * random block ticks when there are no blocks that would randomly tick. + */ + public boolean getNeedsRandomTick() { + return this.tickRefCount > 0; + } + + /** + * Returns the Y location of this ExtendedBlockStorage. + */ + public int getYLocation() { + return this.yBase; + } + + /** + * Sets the saved Sky-light value in the extended block storage structure. + */ + public void setExtSkylightValue(int p_76657_1_, int p_76657_2_, int p_76657_3_, int p_76657_4_) { + this.skylightArray.set(p_76657_1_, p_76657_2_, p_76657_3_, p_76657_4_); + } + + /** + * Gets the saved Sky-light value in the extended block storage structure. + */ + public int getExtSkylightValue(int p_76670_1_, int p_76670_2_, int p_76670_3_) { + return this.skylightArray.get(p_76670_1_, p_76670_2_, p_76670_3_); + } + + /** + * Sets the saved Block-light value in the extended block storage structure. + */ + public void setExtBlocklightValue(int p_76677_1_, int p_76677_2_, int p_76677_3_, int p_76677_4_) { + this.blocklightArray.set(p_76677_1_, p_76677_2_, p_76677_3_, p_76677_4_); + } + + /** + * Gets the saved Block-light value in the extended block storage structure. + */ + public int getExtBlocklightValue(int p_76674_1_, int p_76674_2_, int p_76674_3_) { + return this.blocklightArray.get(p_76674_1_, p_76674_2_, p_76674_3_); + } + + public void removeInvalidBlocks() { + this.blockRefCount = 0; + this.tickRefCount = 0; + + for (int var1 = 0; var1 < 16; ++var1) { + for (int var2 = 0; var2 < 16; ++var2) { + for (int var3 = 0; var3 < 16; ++var3) { + Block var4 = this.func_150819_a(var1, var2, var3); + + if (var4 != Blocks.air) { + ++this.blockRefCount; + + if (var4.getTickRandomly()) { + ++this.tickRefCount; + } + } + } + } + } + } + + public byte[] getBlockLSBArray() { + return this.blockLSBArray; + } + + public void clearMSBArray() { + this.blockMSBArray = null; + } + + /** + * Returns the block ID MSB (bits 11..8) array for this storage array's Chunk. + */ + public NibbleArray getBlockMSBArray() { + return this.blockMSBArray; + } + + public NibbleArray getMetadataArray() { + return this.blockMetadataArray; + } + + /** + * Returns the NibbleArray instance containing Block-light data. + */ + public NibbleArray getBlocklightArray() { + return this.blocklightArray; + } + + /** + * Returns the NibbleArray instance containing Sky-light data. + */ + public NibbleArray getSkylightArray() { + return this.skylightArray; + } + + /** + * Sets the array of block ID least significant bits for this ExtendedBlockStorage. + */ + public void setBlockLSBArray(byte[] p_76664_1_) { + this.blockLSBArray = p_76664_1_; + } + + /** + * Sets the array of blockID most significant bits (blockMSBArray) for this ExtendedBlockStorage. + */ + public void setBlockMSBArray(NibbleArray p_76673_1_) { + this.blockMSBArray = p_76673_1_; + } + + /** + * Sets the NibbleArray of block metadata (blockMetadataArray) for this ExtendedBlockStorage. + */ + public void setBlockMetadataArray(NibbleArray p_76668_1_) { + this.blockMetadataArray = p_76668_1_; + } + + /** + * Sets the NibbleArray instance used for Block-light values in this particular storage block. + */ + public void setBlocklightArray(NibbleArray p_76659_1_) { + this.blocklightArray = p_76659_1_; + } + + /** + * Sets the NibbleArray instance used for Sky-light values in this particular storage block. + */ + public void setSkylightArray(NibbleArray p_76666_1_) { + this.skylightArray = p_76666_1_; + } + + /** + * Called by a Chunk to initialize the MSB array if getBlockMSBArray returns null. Returns the newly-created + * NibbleArray instance. + */ + public NibbleArray createBlockMSBArray() { + this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); + return this.blockMSBArray; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java new file mode 100644 index 0000000..a3632fe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java @@ -0,0 +1,32 @@ +package net.minecraft.world.chunk.storage; + +import java.io.IOException; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public interface IChunkLoader { + /** + * Loads the specified(XZ) chunk into the specified world. + */ + Chunk loadChunk(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException; + + void saveChunk(World p_75816_1_, Chunk p_75816_2_) throws MinecraftException, IOException; + + /** + * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. + * Currently unused. + */ + void saveExtraChunkData(World p_75819_1_, Chunk p_75819_2_); + + /** + * Called every World.tick() + */ + void chunkTick(); + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unused. + */ + void saveExtraData(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java new file mode 100644 index 0000000..d32fba1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java @@ -0,0 +1,21 @@ +package net.minecraft.world.chunk.storage; + +public class NibbleArrayReader { + public final byte[] data; + private final int depthBits; + private final int depthBitsPlusFour; + + + public NibbleArrayReader(byte[] p_i1998_1_, int p_i1998_2_) { + this.data = p_i1998_1_; + this.depthBits = p_i1998_2_; + this.depthBitsPlusFour = p_i1998_2_ + 4; + } + + public int get(int p_76686_1_, int p_76686_2_, int p_76686_3_) { + int var4 = p_76686_1_ << this.depthBitsPlusFour | p_76686_3_ << this.depthBits | p_76686_2_; + int var5 = var4 >> 1; + int var6 = var4 & 1; + return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/RegionFile.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/RegionFile.java new file mode 100644 index 0000000..55a383e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/RegionFile.java @@ -0,0 +1,299 @@ +package net.minecraft.world.chunk.storage; + +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.ArrayList; +import java.util.zip.DeflaterOutputStream; +import java.util.zip.GZIPInputStream; +import java.util.zip.InflaterInputStream; +import net.minecraft.server.MinecraftServer; + +public class RegionFile { + private static final byte[] emptySector = new byte[4096]; + private final File fileName; + private RandomAccessFile dataFile; + private final int[] offsets = new int[1024]; + private final int[] chunkTimestamps = new int[1024]; + private ArrayList sectorFree; + + /** McRegion sizeDelta */ + private int sizeDelta; + private long lastModified; + + + public RegionFile(File p_i2001_1_) { + this.fileName = p_i2001_1_; + this.sizeDelta = 0; + + try { + if (p_i2001_1_.exists()) { + this.lastModified = p_i2001_1_.lastModified(); + } + + this.dataFile = new RandomAccessFile(p_i2001_1_, "rw"); + int var2; + + if (this.dataFile.length() < 4096L) { + for (var2 = 0; var2 < 1024; ++var2) { + this.dataFile.writeInt(0); + } + + for (var2 = 0; var2 < 1024; ++var2) { + this.dataFile.writeInt(0); + } + + this.sizeDelta += 8192; + } + + if ((this.dataFile.length() & 4095L) != 0L) { + for (var2 = 0; (long)var2 < (this.dataFile.length() & 4095L); ++var2) { + this.dataFile.write(0); + } + } + + var2 = (int)this.dataFile.length() / 4096; + this.sectorFree = new ArrayList(var2); + int var3; + + for (var3 = 0; var3 < var2; ++var3) { + this.sectorFree.add(Boolean.valueOf(true)); + } + + this.sectorFree.set(0, Boolean.valueOf(false)); + this.sectorFree.set(1, Boolean.valueOf(false)); + this.dataFile.seek(0L); + int var4; + + for (var3 = 0; var3 < 1024; ++var3) { + var4 = this.dataFile.readInt(); + this.offsets[var3] = var4; + + if (var4 != 0 && (var4 >> 8) + (var4 & 255) <= this.sectorFree.size()) { + for (int var5 = 0; var5 < (var4 & 255); ++var5) { + this.sectorFree.set((var4 >> 8) + var5, Boolean.valueOf(false)); + } + } + } + + for (var3 = 0; var3 < 1024; ++var3) { + var4 = this.dataFile.readInt(); + this.chunkTimestamps[var3] = var4; + } + } catch (IOException var6) { + var6.printStackTrace(); + } + } + + /** + * args: x, y - get uncompressed chunk stream from the region file + */ + public synchronized DataInputStream getChunkDataInputStream(int p_76704_1_, int p_76704_2_) { + if (this.outOfBounds(p_76704_1_, p_76704_2_)) { + return null; + } else { + try { + int var3 = this.getOffset(p_76704_1_, p_76704_2_); + + if (var3 == 0) { + return null; + } else { + int var4 = var3 >> 8; + int var5 = var3 & 255; + + if (var4 + var5 > this.sectorFree.size()) { + return null; + } else { + this.dataFile.seek(var4 * 4096); + int var6 = this.dataFile.readInt(); + + if (var6 > 4096 * var5) { + return null; + } else if (var6 <= 0) { + return null; + } else { + byte var7 = this.dataFile.readByte(); + byte[] var8; + + if (var7 == 1) { + var8 = new byte[var6 - 1]; + this.dataFile.read(var8); + return new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(var8)))); + } else if (var7 == 2) { + var8 = new byte[var6 - 1]; + this.dataFile.read(var8); + return new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(var8)))); + } else { + return null; + } + } + } + } + } catch (IOException var9) { + return null; + } + } + } + + /** + * args: x, z - get an output stream used to write chunk data, data is on disk when the returned stream is closed + */ + public DataOutputStream getChunkDataOutputStream(int p_76710_1_, int p_76710_2_) { + return this.outOfBounds(p_76710_1_, p_76710_2_) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFile.ChunkBuffer(p_76710_1_, p_76710_2_))); + } + + /** + * args: x, z, data, length - write chunk data at (x, z) to disk + */ + protected synchronized void write(int p_76706_1_, int p_76706_2_, byte[] p_76706_3_, int p_76706_4_) { + try { + int var5 = this.getOffset(p_76706_1_, p_76706_2_); + int var6 = var5 >> 8; + int var7 = var5 & 255; + int var8 = (p_76706_4_ + 5) / 4096 + 1; + + if (var8 >= 256) { + return; + } + + if (var6 != 0 && var7 == var8) { + this.write(var6, p_76706_3_, p_76706_4_); + } else { + int var9; + + for (var9 = 0; var9 < var7; ++var9) { + this.sectorFree.set(var6 + var9, Boolean.valueOf(true)); + } + + var9 = this.sectorFree.indexOf(Boolean.valueOf(true)); + int var10 = 0; + int var11; + + if (var9 != -1) { + for (var11 = var9; var11 < this.sectorFree.size(); ++var11) { + if (var10 != 0) { + if (((Boolean)this.sectorFree.get(var11)).booleanValue()) { + ++var10; + } else { + var10 = 0; + } + } else if (((Boolean)this.sectorFree.get(var11)).booleanValue()) { + var9 = var11; + var10 = 1; + } + + if (var10 >= var8) { + break; + } + } + } + + if (var10 >= var8) { + var6 = var9; + this.setOffset(p_76706_1_, p_76706_2_, var9 << 8 | var8); + + for (var11 = 0; var11 < var8; ++var11) { + this.sectorFree.set(var6 + var11, Boolean.valueOf(false)); + } + + this.write(var6, p_76706_3_, p_76706_4_); + } else { + this.dataFile.seek(this.dataFile.length()); + var6 = this.sectorFree.size(); + + for (var11 = 0; var11 < var8; ++var11) { + this.dataFile.write(emptySector); + this.sectorFree.add(Boolean.valueOf(false)); + } + + this.sizeDelta += 4096 * var8; + this.write(var6, p_76706_3_, p_76706_4_); + this.setOffset(p_76706_1_, p_76706_2_, var6 << 8 | var8); + } + } + + this.setChunkTimestamp(p_76706_1_, p_76706_2_, (int)(MinecraftServer.getSystemTimeMillis() / 1000L)); + } catch (IOException var12) { + var12.printStackTrace(); + } + } + + /** + * args: sectorNumber, data, length - write the chunk data to this RegionFile + */ + private void write(int p_76712_1_, byte[] p_76712_2_, int p_76712_3_) throws IOException { + this.dataFile.seek(p_76712_1_ * 4096); + this.dataFile.writeInt(p_76712_3_ + 1); + this.dataFile.writeByte(2); + this.dataFile.write(p_76712_2_, 0, p_76712_3_); + } + + /** + * args: x, z - check region bounds + */ + private boolean outOfBounds(int p_76705_1_, int p_76705_2_) { + return p_76705_1_ < 0 || p_76705_1_ >= 32 || p_76705_2_ < 0 || p_76705_2_ >= 32; + } + + /** + * args: x, y - get chunk's offset in region file + */ + private int getOffset(int p_76707_1_, int p_76707_2_) { + return this.offsets[p_76707_1_ + p_76707_2_ * 32]; + } + + /** + * args: x, z, - true if chunk has been saved / converted + */ + public boolean isChunkSaved(int p_76709_1_, int p_76709_2_) { + return this.getOffset(p_76709_1_, p_76709_2_) != 0; + } + + /** + * args: x, z, offset - sets the chunk's offset in the region file + */ + private void setOffset(int p_76711_1_, int p_76711_2_, int p_76711_3_) throws IOException { + this.offsets[p_76711_1_ + p_76711_2_ * 32] = p_76711_3_; + this.dataFile.seek((p_76711_1_ + p_76711_2_ * 32) * 4); + this.dataFile.writeInt(p_76711_3_); + } + + /** + * args: x, z, timestamp - sets the chunk's write timestamp + */ + private void setChunkTimestamp(int p_76713_1_, int p_76713_2_, int p_76713_3_) throws IOException { + this.chunkTimestamps[p_76713_1_ + p_76713_2_ * 32] = p_76713_3_; + this.dataFile.seek(4096 + (p_76713_1_ + p_76713_2_ * 32) * 4); + this.dataFile.writeInt(p_76713_3_); + } + + /** + * close this RegionFile and prevent further writes + */ + public void close() throws IOException { + if (this.dataFile != null) { + this.dataFile.close(); + } + } + + class ChunkBuffer extends ByteArrayOutputStream { + private final int chunkX; + private final int chunkZ; + + + public ChunkBuffer(int p_i2000_2_, int p_i2000_3_) { + super(8096); + this.chunkX = p_i2000_2_; + this.chunkZ = p_i2000_3_; + } + + public void close() throws IOException { + RegionFile.this.write(this.chunkX, this.chunkZ, this.buf, this.count); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/RegionFileCache.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/RegionFileCache.java new file mode 100644 index 0000000..54efbee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/chunk/storage/RegionFileCache.java @@ -0,0 +1,74 @@ +package net.minecraft.world.chunk.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +public class RegionFileCache { + /** A map containing Files as keys and RegionFiles as values */ + private static final Map regionsByFilename = new HashMap(); + + + public static synchronized RegionFile createOrLoadRegionFile(File p_76550_0_, int p_76550_1_, int p_76550_2_) { + File var3 = new File(p_76550_0_, "region"); + File var4 = new File(var3, "r." + (p_76550_1_ >> 5) + "." + (p_76550_2_ >> 5) + ".mca"); + RegionFile var5 = (RegionFile)regionsByFilename.get(var4); + + if (var5 != null) { + return var5; + } else { + if (!var3.exists()) { + var3.mkdirs(); + } + + if (regionsByFilename.size() >= 256) { + clearRegionFileReferences(); + } + + RegionFile var6 = new RegionFile(var4); + regionsByFilename.put(var4, var6); + return var6; + } + } + + /** + * Saves the current Chunk Map Cache + */ + public static synchronized void clearRegionFileReferences() { + Iterator var0 = regionsByFilename.values().iterator(); + + while (var0.hasNext()) { + RegionFile var1 = (RegionFile)var0.next(); + + try { + if (var1 != null) { + var1.close(); + } + } catch (IOException var3) { + var3.printStackTrace(); + } + } + + regionsByFilename.clear(); + } + + /** + * Returns an input stream for the specified chunk. Args: worldDir, chunkX, chunkZ + */ + public static DataInputStream getChunkInputStream(File p_76549_0_, int p_76549_1_, int p_76549_2_) { + RegionFile var3 = createOrLoadRegionFile(p_76549_0_, p_76549_1_, p_76549_2_); + return var3.getChunkDataInputStream(p_76549_1_ & 31, p_76549_2_ & 31); + } + + /** + * Returns an output stream for the specified chunk. Args: worldDir, chunkX, chunkZ + */ + public static DataOutputStream getChunkOutputStream(File p_76552_0_, int p_76552_1_, int p_76552_2_) { + RegionFile var3 = createOrLoadRegionFile(p_76552_0_, p_76552_1_, p_76552_2_); + return var3.getChunkDataOutputStream(p_76552_1_ & 31, p_76552_2_ & 31); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/demo/DemoWorldManager.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/demo/DemoWorldManager.java new file mode 100644 index 0000000..6ff6e49 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/demo/DemoWorldManager.java @@ -0,0 +1,114 @@ +package net.minecraft.world.demo; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; + +public class DemoWorldManager extends ItemInWorldManager { + private boolean field_73105_c; + private boolean demoTimeExpired; + private int field_73104_e; + private int field_73102_f; + + + public DemoWorldManager(World p_i1513_1_) { + super(p_i1513_1_); + } + + public void updateBlockRemoving() { + super.updateBlockRemoving(); + ++this.field_73102_f; + long var1 = this.theWorld.getTotalWorldTime(); + long var3 = var1 / 24000L + 1L; + + if (!this.field_73105_c && this.field_73102_f > 20) { + this.field_73105_c = true; + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 0.0F)); + } + + this.demoTimeExpired = var1 > 120500L; + + if (this.demoTimeExpired) { + ++this.field_73104_e; + } + + if (var1 % 24000L == 500L) { + if (var3 <= 6L) { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day." + var3)); + } + } else if (var3 == 1L) { + if (var1 == 100L) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 101.0F)); + } else if (var1 == 175L) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 102.0F)); + } else if (var1 == 250L) { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 103.0F)); + } + } else if (var3 == 5L && var1 % 24000L == 22000L) { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day.warning")); + } + } + + /** + * Sends a message to the player reminding them that this is the demo version + */ + private void sendDemoReminder() { + if (this.field_73104_e > 100) { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.reminder")); + this.field_73104_e = 0; + } + } + + /** + * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific + * side. tryHarvestBlock can also be the result of this call + */ + public void onBlockClicked(int p_73074_1_, int p_73074_2_, int p_73074_3_, int p_73074_4_) { + if (this.demoTimeExpired) { + this.sendDemoReminder(); + } else { + super.onBlockClicked(p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + } + } + + public void uncheckedTryHarvestBlock(int p_73082_1_, int p_73082_2_, int p_73082_3_) { + if (!this.demoTimeExpired) { + super.uncheckedTryHarvestBlock(p_73082_1_, p_73082_2_, p_73082_3_); + } + } + + /** + * Attempts to harvest a block at the given coordinate + */ + public boolean tryHarvestBlock(int p_73084_1_, int p_73084_2_, int p_73084_3_) { + return !this.demoTimeExpired && super.tryHarvestBlock(p_73084_1_, p_73084_2_, p_73084_3_); + } + + /** + * Attempts to right-click use an item by the given EntityPlayer in the given World + */ + public boolean tryUseItem(EntityPlayer p_73085_1_, World p_73085_2_, ItemStack p_73085_3_) { + if (this.demoTimeExpired) { + this.sendDemoReminder(); + return false; + } else { + return super.tryUseItem(p_73085_1_, p_73085_2_, p_73085_3_); + } + } + + /** + * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, + * xOffset, yOffset, zOffset + */ + public boolean activateBlockOrUseItem(EntityPlayer p_73078_1_, World p_73078_2_, ItemStack p_73078_3_, int p_73078_4_, int p_73078_5_, int p_73078_6_, int p_73078_7_, float p_73078_8_, float p_73078_9_, float p_73078_10_) { + if (this.demoTimeExpired) { + this.sendDemoReminder(); + return false; + } else { + return super.activateBlockOrUseItem(p_73078_1_, p_73078_2_, p_73078_3_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/demo/DemoWorldServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/demo/DemoWorldServer.java new file mode 100644 index 0000000..77989ba --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/demo/DemoWorldServer.java @@ -0,0 +1,18 @@ +package net.minecraft.world.demo; + +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveHandler; + +public class DemoWorldServer extends WorldServer { + private static final long demoWorldSeed = "North Carolina".hashCode(); + public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, WorldSettings.GameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest(); + + + public DemoWorldServer(MinecraftServer p_i45282_1_, ISaveHandler p_i45282_2_, String p_i45282_3_, int p_i45282_4_, Profiler p_i45282_5_) { + super(p_i45282_1_, p_i45282_2_, p_i45282_3_, p_i45282_4_, demoWorldSettings, p_i45282_5_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java new file mode 100644 index 0000000..ff1875d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java @@ -0,0 +1,365 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +public class ChunkProviderEnd implements IChunkProvider { + private final Random endRNG; + private final NoiseGeneratorOctaves noiseGen1; + private final NoiseGeneratorOctaves noiseGen2; + private final NoiseGeneratorOctaves noiseGen3; + public NoiseGeneratorOctaves noiseGen4; + public NoiseGeneratorOctaves noiseGen5; + private final World endWorld; + private double[] densities; + + /** The biomes that are used to generate the chunk */ + private BiomeGenBase[] biomesForGeneration; + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + int[][] field_73203_h = new int[32][32]; + + + public ChunkProviderEnd(World p_i2007_1_, long p_i2007_2_) { + this.endWorld = p_i2007_1_; + this.endRNG = new Random(p_i2007_2_); + this.noiseGen1 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen2 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); + this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); + this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); + } + + public void func_147420_a(int p_147420_1_, int p_147420_2_, Block[] p_147420_3_, BiomeGenBase[] p_147420_4_) { + byte var5 = 2; + int var6 = var5 + 1; + byte var7 = 33; + int var8 = var5 + 1; + this.densities = this.initializeNoiseField(this.densities, p_147420_1_ * var5, 0, p_147420_2_ * var5, var6, var7, var8); + + for (int var9 = 0; var9 < var5; ++var9) { + for (int var10 = 0; var10 < var5; ++var10) { + for (int var11 = 0; var11 < 32; ++var11) { + double var12 = 0.25D; + double var14 = this.densities[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0]; + double var16 = this.densities[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0]; + double var18 = this.densities[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 0]; + double var20 = this.densities[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 0]; + double var22 = (this.densities[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 1] - var14) * var12; + double var24 = (this.densities[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 1] - var16) * var12; + double var26 = (this.densities[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12; + double var28 = (this.densities[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12; + + for (int var30 = 0; var30 < 4; ++var30) { + double var31 = 0.125D; + double var33 = var14; + double var35 = var16; + double var37 = (var18 - var14) * var31; + double var39 = (var20 - var16) * var31; + + for (int var41 = 0; var41 < 8; ++var41) { + int var42 = var41 + var9 * 8 << 11 | 0 + var10 * 8 << 7 | var11 * 4 + var30; + short var43 = 128; + double var44 = 0.125D; + double var46 = var33; + double var48 = (var35 - var33) * var44; + + for (int var50 = 0; var50 < 8; ++var50) { + Block var51 = null; + + if (var46 > 0.0D) { + var51 = Blocks.end_stone; + } + + p_147420_3_[var42] = var51; + var42 += var43; + var46 += var48; + } + + var33 += var37; + var35 += var39; + } + + var14 += var22; + var16 += var24; + var18 += var26; + var20 += var28; + } + } + } + } + } + + public void func_147421_b(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_) { + for (int var5 = 0; var5 < 16; ++var5) { + for (int var6 = 0; var6 < 16; ++var6) { + byte var7 = 1; + int var8 = -1; + Block var9 = Blocks.end_stone; + Block var10 = Blocks.end_stone; + + for (int var11 = 127; var11 >= 0; --var11) { + int var12 = (var6 * 16 + var5) * 128 + var11; + Block var13 = p_147421_3_[var12]; + + if (var13 != null && var13.getMaterial() != Material.air) { + if (var13 == Blocks.stone) { + if (var8 == -1) { + if (var7 <= 0) { + var9 = null; + var10 = Blocks.end_stone; + } + + var8 = var7; + + if (var11 >= 0) { + p_147421_3_[var12] = var9; + } else { + p_147421_3_[var12] = var10; + } + } else if (var8 > 0) { + --var8; + p_147421_3_[var12] = var10; + } + } + } else { + var8 = -1; + } + } + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP com.cheatbreaker.client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + this.endRNG.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] var3 = new Block[32768]; + this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + this.func_147420_a(p_73154_1_, p_73154_2_, var3, this.biomesForGeneration); + this.func_147421_b(p_73154_1_, p_73154_2_, var3, this.biomesForGeneration); + Chunk var4 = new Chunk(this.endWorld, var3, p_73154_1_, p_73154_2_); + byte[] var5 = var4.getBiomeArray(); + + for (int var6 = 0; var6 < var5.length; ++var6) { + var5[var6] = (byte)this.biomesForGeneration[var6].biomeID; + } + + var4.generateSkylightMap(); + return var4; + } + + /** + * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the + * size. + */ + private double[] initializeNoiseField(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) { + if (p_73187_1_ == null) { + p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; + } + + double var8 = 684.412D; + double var10 = 684.412D; + this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, p_73187_2_, p_73187_4_, p_73187_5_, p_73187_7_, 1.121D, 1.121D, 0.5D); + this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, p_73187_2_, p_73187_4_, p_73187_5_, p_73187_7_, 200.0D, 200.0D, 0.5D); + var8 *= 2.0D; + this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D); + this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, var8, var10, var8); + this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, var8, var10, var8); + int var12 = 0; + int var13 = 0; + + for (int var14 = 0; var14 < p_73187_5_; ++var14) { + for (int var15 = 0; var15 < p_73187_7_; ++var15) { + double var16 = (this.noiseData4[var13] + 256.0D) / 512.0D; + + if (var16 > 1.0D) { + var16 = 1.0D; + } + + double var18 = this.noiseData5[var13] / 8000.0D; + + if (var18 < 0.0D) { + var18 = -var18 * 0.3D; + } + + var18 = var18 * 3.0D - 2.0D; + float var20 = (float)(var14 + p_73187_2_ - 0) / 1.0F; + float var21 = (float)(var15 + p_73187_4_ - 0) / 1.0F; + float var22 = 100.0F - MathHelper.sqrt_float(var20 * var20 + var21 * var21) * 8.0F; + + if (var22 > 80.0F) { + var22 = 80.0F; + } + + if (var22 < -100.0F) { + var22 = -100.0F; + } + + if (var18 > 1.0D) { + var18 = 1.0D; + } + + var18 /= 8.0D; + var18 = 0.0D; + + if (var16 < 0.0D) { + var16 = 0.0D; + } + + var16 += 0.5D; + var18 = var18 * (double)p_73187_6_ / 16.0D; + ++var13; + double var23 = (double)p_73187_6_ / 2.0D; + + for (int var25 = 0; var25 < p_73187_6_; ++var25) { + double var26 = 0.0D; + double var28 = ((double)var25 - var23) * 8.0D / var16; + + if (var28 < 0.0D) { + var28 *= -1.0D; + } + + double var30 = this.noiseData2[var12] / 512.0D; + double var32 = this.noiseData3[var12] / 512.0D; + double var34 = (this.noiseData1[var12] / 10.0D + 1.0D) / 2.0D; + + if (var34 < 0.0D) { + var26 = var30; + } else if (var34 > 1.0D) { + var26 = var32; + } else { + var26 = var30 + (var32 - var30) * var34; + } + + var26 -= 8.0D; + var26 += var22; + byte var36 = 2; + double var37; + + if (var25 > p_73187_6_ / 2 - var36) { + var37 = (float)(var25 - (p_73187_6_ / 2 - var36)) / 64.0F; + + if (var37 < 0.0D) { + var37 = 0.0D; + } + + if (var37 > 1.0D) { + var37 = 1.0D; + } + + var26 = var26 * (1.0D - var37) + -3000.0D * var37; + } + + var36 = 8; + + if (var25 < var36) { + var37 = (float)(var36 - var25) / ((float)var36 - 1.0F); + var26 = var26 * (1.0D - var37) + -30.0D * var37; + } + + p_73187_1_[var12] = var26; + ++var12; + } + } + } + + return p_73187_1_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { + BlockFalling.field_149832_M = true; + int var4 = p_73153_2_ * 16; + int var5 = p_73153_3_ * 16; + BiomeGenBase var6 = this.endWorld.getBiomeGenForCoords(var4 + 16, var5 + 16); + var6.decorate(this.endWorld, this.endWorld.rand, var4, var5); + BlockFalling.field_149832_M = false; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() { + return "RandomLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + BiomeGenBase var5 = this.endWorld.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return var5.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + return null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java new file mode 100644 index 0000000..2d22e72 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java @@ -0,0 +1,284 @@ +package net.minecraft.world.gen; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.MapGenVillage; + +public class ChunkProviderFlat implements IChunkProvider { + private final World worldObj; + private final Random random; + private final Block[] cachedBlockIDs = new Block[256]; + private final byte[] cachedBlockMetadata = new byte[256]; + private final FlatGeneratorInfo flatWorldGenInfo; + private final List structureGenerators = new ArrayList(); + private final boolean hasDecoration; + private final boolean hasDungeons; + private WorldGenLakes waterLakeGenerator; + private WorldGenLakes lavaLakeGenerator; + + + public ChunkProviderFlat(World p_i2004_1_, long p_i2004_2_, boolean p_i2004_4_, String p_i2004_5_) { + this.worldObj = p_i2004_1_; + this.random = new Random(p_i2004_2_); + this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(p_i2004_5_); + + if (p_i2004_4_) { + Map var6 = this.flatWorldGenInfo.getWorldFeatures(); + + if (var6.containsKey("village")) { + Map var7 = (Map)var6.get("village"); + + if (!var7.containsKey("size")) { + var7.put("size", "1"); + } + + this.structureGenerators.add(new MapGenVillage(var7)); + } + + if (var6.containsKey("biome_1")) { + this.structureGenerators.add(new MapGenScatteredFeature((Map)var6.get("biome_1"))); + } + + if (var6.containsKey("mineshaft")) { + this.structureGenerators.add(new MapGenMineshaft((Map)var6.get("mineshaft"))); + } + + if (var6.containsKey("stronghold")) { + this.structureGenerators.add(new MapGenStronghold((Map)var6.get("stronghold"))); + } + } + + this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration"); + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) { + this.waterLakeGenerator = new WorldGenLakes(Blocks.water); + } + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) { + this.lavaLakeGenerator = new WorldGenLakes(Blocks.lava); + } + + this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon"); + Iterator var9 = this.flatWorldGenInfo.getFlatLayers().iterator(); + + while (var9.hasNext()) { + FlatLayerInfo var10 = (FlatLayerInfo)var9.next(); + + for (int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8) { + this.cachedBlockIDs[var8] = var10.func_151536_b(); + this.cachedBlockMetadata[var8] = (byte)var10.getFillBlockMeta(); + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP com.cheatbreaker.client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + Chunk var3 = new Chunk(this.worldObj, p_73154_1_, p_73154_2_); + int var6; + + for (int var4 = 0; var4 < this.cachedBlockIDs.length; ++var4) { + Block var5 = this.cachedBlockIDs[var4]; + + if (var5 != null) { + var6 = var4 >> 4; + ExtendedBlockStorage var7 = var3.getBlockStorageArray()[var6]; + + if (var7 == null) { + var7 = new ExtendedBlockStorage(var4, !this.worldObj.provider.hasNoSky); + var3.getBlockStorageArray()[var6] = var7; + } + + for (int var8 = 0; var8 < 16; ++var8) { + for (int var9 = 0; var9 < 16; ++var9) { + var7.func_150818_a(var8, var4 & 15, var9, var5); + var7.setExtBlockMetadata(var8, var4 & 15, var9, this.cachedBlockMetadata[var4]); + } + } + } + } + + var3.generateSkylightMap(); + BiomeGenBase[] var10 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + byte[] var11 = var3.getBiomeArray(); + + for (var6 = 0; var6 < var11.length; ++var6) { + var11[var6] = (byte)var10[var6].biomeID; + } + + Iterator var12 = this.structureGenerators.iterator(); + + while (var12.hasNext()) { + MapGenBase var13 = (MapGenBase)var12.next(); + var13.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, null); + } + + var3.generateSkylightMap(); + return var3; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { + int var4 = p_73153_2_ * 16; + int var5 = p_73153_3_ * 16; + BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); + boolean var7 = false; + this.random.setSeed(this.worldObj.getSeed()); + long var8 = this.random.nextLong() / 2L * 2L + 1L; + long var10 = this.random.nextLong() / 2L * 2L + 1L; + this.random.setSeed((long)p_73153_2_ * var8 + (long)p_73153_3_ * var10 ^ this.worldObj.getSeed()); + Iterator var12 = this.structureGenerators.iterator(); + + while (var12.hasNext()) { + MapGenStructure var13 = (MapGenStructure)var12.next(); + boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.random, p_73153_2_, p_73153_3_); + + if (var13 instanceof MapGenVillage) { + var7 |= var14; + } + } + + int var16; + int var17; + int var18; + + if (this.waterLakeGenerator != null && !var7 && this.random.nextInt(4) == 0) { + var16 = var4 + this.random.nextInt(16) + 8; + var17 = this.random.nextInt(256); + var18 = var5 + this.random.nextInt(16) + 8; + this.waterLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18); + } + + if (this.lavaLakeGenerator != null && !var7 && this.random.nextInt(8) == 0) { + var16 = var4 + this.random.nextInt(16) + 8; + var17 = this.random.nextInt(this.random.nextInt(248) + 8); + var18 = var5 + this.random.nextInt(16) + 8; + + if (var17 < 63 || this.random.nextInt(10) == 0) { + this.lavaLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18); + } + } + + if (this.hasDungeons) { + for (var16 = 0; var16 < 8; ++var16) { + var17 = var4 + this.random.nextInt(16) + 8; + var18 = this.random.nextInt(256); + int var15 = var5 + this.random.nextInt(16) + 8; + (new WorldGenDungeons()).generate(this.worldObj, this.random, var17, var18, var15); + } + } + + if (this.hasDecoration) { + var6.decorate(this.worldObj, this.random, var4, var5); + } + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() { + return "FlatLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return var5.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + if ("Stronghold".equals(p_147416_2_)) { + Iterator var6 = this.structureGenerators.iterator(); + + while (var6.hasNext()) { + MapGenStructure var7 = (MapGenStructure)var6.next(); + + if (var7 instanceof MapGenStronghold) { + return var7.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_, p_147416_5_); + } + } + } + + return null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) { + Iterator var3 = this.structureGenerators.iterator(); + + while (var3.hasNext()) { + MapGenStructure var4 = (MapGenStructure)var3.next(); + var4.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, null); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java new file mode 100644 index 0000000..80e8122 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -0,0 +1,455 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenVillage; + +public class ChunkProviderGenerate implements IChunkProvider { + /** RNG. */ + private final Random rand; + private final NoiseGeneratorOctaves field_147431_j; + private final NoiseGeneratorOctaves field_147432_k; + private final NoiseGeneratorOctaves field_147429_l; + private final NoiseGeneratorPerlin field_147430_m; + + /** A NoiseGeneratorOctaves used in generating terrain */ + public NoiseGeneratorOctaves noiseGen5; + + /** A NoiseGeneratorOctaves used in generating terrain */ + public NoiseGeneratorOctaves noiseGen6; + public NoiseGeneratorOctaves mobSpawnerNoise; + + /** Reference to the World object. */ + private final World worldObj; + + /** are map structures going to be generated (e.g. strongholds) */ + private final boolean mapFeaturesEnabled; + private final WorldType field_147435_p; + private final double[] field_147434_q; + private final float[] parabolicField; + private double[] stoneNoise = new double[256]; + private final MapGenBase caveGenerator = new MapGenCaves(); + + /** Holds Stronghold Generator */ + private final MapGenStronghold strongholdGenerator = new MapGenStronghold(); + + /** Holds Village Generator */ + private final MapGenVillage villageGenerator = new MapGenVillage(); + + /** Holds Mineshaft Generator */ + private final MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); + private final MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); + + /** Holds ravine generator */ + private final MapGenBase ravineGenerator = new MapGenRavine(); + + /** The biomes that are used to generate the chunk */ + private BiomeGenBase[] biomesForGeneration; + double[] field_147427_d; + double[] field_147428_e; + double[] field_147425_f; + double[] field_147426_g; + int[][] field_73219_j = new int[32][32]; + + + public ChunkProviderGenerate(World p_i2006_1_, long p_i2006_2_, boolean p_i2006_4_) { + this.worldObj = p_i2006_1_; + this.mapFeaturesEnabled = p_i2006_4_; + this.field_147435_p = p_i2006_1_.getWorldInfo().getTerrainType(); + this.rand = new Random(p_i2006_2_); + this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); + this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); + this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); + this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147434_q = new double[825]; + this.parabolicField = new float[25]; + + for (int var5 = -2; var5 <= 2; ++var5) { + for (int var6 = -2; var6 <= 2; ++var6) { + float var7 = 10.0F / MathHelper.sqrt_float((float)(var5 * var5 + var6 * var6) + 0.2F); + this.parabolicField[var5 + 2 + (var6 + 2) * 5] = var7; + } + } + } + + public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) { + byte var4 = 63; + this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, p_147424_1_ * 4 - 2, p_147424_2_ * 4 - 2, 10, 10); + this.func_147423_a(p_147424_1_ * 4, 0, p_147424_2_ * 4); + + for (int var5 = 0; var5 < 4; ++var5) { + int var6 = var5 * 5; + int var7 = (var5 + 1) * 5; + + for (int var8 = 0; var8 < 4; ++var8) { + int var9 = (var6 + var8) * 33; + int var10 = (var6 + var8 + 1) * 33; + int var11 = (var7 + var8) * 33; + int var12 = (var7 + var8 + 1) * 33; + + for (int var13 = 0; var13 < 32; ++var13) { + double var14 = 0.125D; + double var16 = this.field_147434_q[var9 + var13]; + double var18 = this.field_147434_q[var10 + var13]; + double var20 = this.field_147434_q[var11 + var13]; + double var22 = this.field_147434_q[var12 + var13]; + double var24 = (this.field_147434_q[var9 + var13 + 1] - var16) * var14; + double var26 = (this.field_147434_q[var10 + var13 + 1] - var18) * var14; + double var28 = (this.field_147434_q[var11 + var13 + 1] - var20) * var14; + double var30 = (this.field_147434_q[var12 + var13 + 1] - var22) * var14; + + for (int var32 = 0; var32 < 8; ++var32) { + double var33 = 0.25D; + double var35 = var16; + double var37 = var18; + double var39 = (var20 - var16) * var33; + double var41 = (var22 - var18) * var33; + + for (int var43 = 0; var43 < 4; ++var43) { + int var44 = var43 + var5 * 4 << 12 | 0 + var8 * 4 << 8 | var13 * 8 + var32; + short var45 = 256; + var44 -= var45; + double var46 = 0.25D; + double var50 = (var37 - var35) * var46; + double var48 = var35 - var50; + + for (int var52 = 0; var52 < 4; ++var52) { + if ((var48 += var50) > 0.0D) { + p_147424_3_[var44 += var45] = Blocks.stone; + } else if (var13 * 8 + var32 < var4) { + p_147424_3_[var44 += var45] = Blocks.water; + } else { + p_147424_3_[var44 += var45] = null; + } + } + + var35 += var39; + var37 += var41; + } + + var16 += var24; + var18 += var26; + var20 += var28; + var22 += var30; + } + } + } + } + } + + public void func_147422_a(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) { + double var6 = 0.03125D; + this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, p_147422_1_ * 16, p_147422_2_ * 16, 16, 16, var6 * 2.0D, var6 * 2.0D, 1.0D); + + for (int var8 = 0; var8 < 16; ++var8) { + for (int var9 = 0; var9 < 16; ++var9) { + BiomeGenBase var10 = p_147422_5_[var9 + var8 * 16]; + var10.func_150573_a(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + var8, p_147422_2_ * 16 + var9, this.stoneNoise[var9 + var8 * 16]); + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP com.cheatbreaker.client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + this.rand.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] var3 = new Block[65536]; + byte[] var4 = new byte[65536]; + this.func_147424_a(p_73154_1_, p_73154_2_, var3); + this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + this.func_147422_a(p_73154_1_, p_73154_2_, var3, var4, this.biomesForGeneration); + this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + this.ravineGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + + if (this.mapFeaturesEnabled) { + this.mineshaftGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + this.villageGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + this.strongholdGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + } + + Chunk var5 = new Chunk(this.worldObj, var3, var4, p_73154_1_, p_73154_2_); + byte[] var6 = var5.getBiomeArray(); + + for (int var7 = 0; var7 < var6.length; ++var7) { + var6[var7] = (byte)this.biomesForGeneration[var7].biomeID; + } + + var5.generateSkylightMap(); + return var5; + } + + private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) { + double var4 = 684.412D; + double var6 = 684.412D; + double var8 = 512.0D; + double var10 = 512.0D; + this.field_147426_g = this.noiseGen6.generateNoiseOctaves(this.field_147426_g, p_147423_1_, p_147423_3_, 5, 5, 200.0D, 200.0D, 0.5D); + this.field_147427_d = this.field_147429_l.generateNoiseOctaves(this.field_147427_d, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D); + this.field_147428_e = this.field_147431_j.generateNoiseOctaves(this.field_147428_e, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); + this.field_147425_f = this.field_147432_k.generateNoiseOctaves(this.field_147425_f, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); + boolean var45 = false; + boolean var44 = false; + int var12 = 0; + int var13 = 0; + double var14 = 8.5D; + + for (int var16 = 0; var16 < 5; ++var16) { + for (int var17 = 0; var17 < 5; ++var17) { + float var18 = 0.0F; + float var19 = 0.0F; + float var20 = 0.0F; + byte var21 = 2; + BiomeGenBase var22 = this.biomesForGeneration[var16 + 2 + (var17 + 2) * 10]; + + for (int var23 = -var21; var23 <= var21; ++var23) { + for (int var24 = -var21; var24 <= var21; ++var24) { + BiomeGenBase var25 = this.biomesForGeneration[var16 + var23 + 2 + (var17 + var24 + 2) * 10]; + float var26 = var25.minHeight; + float var27 = var25.maxHeight; + + if (this.field_147435_p == WorldType.field_151360_e && var26 > 0.0F) { + var26 = 1.0F + var26 * 2.0F; + var27 = 1.0F + var27 * 4.0F; + } + + float var28 = this.parabolicField[var23 + 2 + (var24 + 2) * 5] / (var26 + 2.0F); + + if (var25.minHeight > var22.minHeight) { + var28 /= 2.0F; + } + + var18 += var27 * var28; + var19 += var26 * var28; + var20 += var28; + } + } + + var18 /= var20; + var19 /= var20; + var18 = var18 * 0.9F + 0.1F; + var19 = (var19 * 4.0F - 1.0F) / 8.0F; + double var46 = this.field_147426_g[var13] / 8000.0D; + + if (var46 < 0.0D) { + var46 = -var46 * 0.3D; + } + + var46 = var46 * 3.0D - 2.0D; + + if (var46 < 0.0D) { + var46 /= 2.0D; + + if (var46 < -1.0D) { + var46 = -1.0D; + } + + var46 /= 1.4D; + var46 /= 2.0D; + } else { + if (var46 > 1.0D) { + var46 = 1.0D; + } + + var46 /= 8.0D; + } + + ++var13; + double var47 = var19; + double var48 = var18; + var47 += var46 * 0.2D; + var47 = var47 * 8.5D / 8.0D; + double var29 = 8.5D + var47 * 4.0D; + + for (int var31 = 0; var31 < 33; ++var31) { + double var32 = ((double)var31 - var29) * 12.0D * 128.0D / 256.0D / var48; + + if (var32 < 0.0D) { + var32 *= 4.0D; + } + + double var34 = this.field_147428_e[var12] / 512.0D; + double var36 = this.field_147425_f[var12] / 512.0D; + double var38 = (this.field_147427_d[var12] / 10.0D + 1.0D) / 2.0D; + double var40 = MathHelper.denormalizeClamp(var34, var36, var38) - var32; + + if (var31 > 29) { + double var42 = (float)(var31 - 29) / 3.0F; + var40 = var40 * (1.0D - var42) + -10.0D * var42; + } + + this.field_147434_q[var12] = var40; + ++var12; + } + } + } + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { + BlockFalling.field_149832_M = true; + int var4 = p_73153_2_ * 16; + int var5 = p_73153_3_ * 16; + BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); + this.rand.setSeed(this.worldObj.getSeed()); + long var7 = this.rand.nextLong() / 2L * 2L + 1L; + long var9 = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed((long)p_73153_2_ * var7 + (long)p_73153_3_ * var9 ^ this.worldObj.getSeed()); + boolean var11 = false; + + if (this.mapFeaturesEnabled) { + this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + } + + int var12; + int var13; + int var14; + + if (var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.rand.nextInt(4) == 0) { + var12 = var4 + this.rand.nextInt(16) + 8; + var13 = this.rand.nextInt(256); + var14 = var5 + this.rand.nextInt(16) + 8; + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, var12, var13, var14); + } + + if (!var11 && this.rand.nextInt(8) == 0) { + var12 = var4 + this.rand.nextInt(16) + 8; + var13 = this.rand.nextInt(this.rand.nextInt(248) + 8); + var14 = var5 + this.rand.nextInt(16) + 8; + + if (var13 < 63 || this.rand.nextInt(10) == 0) { + (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, var12, var13, var14); + } + } + + for (var12 = 0; var12 < 8; ++var12) { + var13 = var4 + this.rand.nextInt(16) + 8; + var14 = this.rand.nextInt(256); + int var15 = var5 + this.rand.nextInt(16) + 8; + (new WorldGenDungeons()).generate(this.worldObj, this.rand, var13, var14, var15); + } + + var6.decorate(this.worldObj, this.rand, var4, var5); + SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.rand); + var4 += 8; + var5 += 8; + + for (var12 = 0; var12 < 16; ++var12) { + for (var13 = 0; var13 < 16; ++var13) { + var14 = this.worldObj.getPrecipitationHeight(var4 + var12, var5 + var13); + + if (this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) { + this.worldObj.setBlock(var12 + var4, var14 - 1, var13 + var5, Blocks.ice, 0, 2); + } + + if (this.worldObj.func_147478_e(var12 + var4, var14, var13 + var5, true)) { + this.worldObj.setBlock(var12 + var4, var14, var13 + var5, Blocks.snow_layer, 0, 2); + } + } + } + + BlockFalling.field_149832_M = false; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() { + return "RandomLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return p_73155_1_ == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(p_73155_2_, p_73155_3_, p_73155_4_) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : var5.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + return "Stronghold".equals(p_147416_2_) && this.strongholdGenerator != null ? this.strongholdGenerator.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_, p_147416_5_) : null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) { + if (this.mapFeaturesEnabled) { + this.mineshaftGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, null); + this.villageGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, null); + this.strongholdGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, null); + this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, null); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java new file mode 100644 index 0000000..ad01b01 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java @@ -0,0 +1,515 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenFire; +import net.minecraft.world.gen.feature.WorldGenFlowers; +import net.minecraft.world.gen.feature.WorldGenGlowStone1; +import net.minecraft.world.gen.feature.WorldGenGlowStone2; +import net.minecraft.world.gen.feature.WorldGenHellLava; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.structure.MapGenNetherBridge; + +public class ChunkProviderHell implements IChunkProvider { + private final Random hellRNG; + + /** A NoiseGeneratorOctaves used in generating nether terrain */ + private final NoiseGeneratorOctaves netherNoiseGen1; + private final NoiseGeneratorOctaves netherNoiseGen2; + private final NoiseGeneratorOctaves netherNoiseGen3; + + /** Determines whether slowsand or gravel can be generated at a location */ + private final NoiseGeneratorOctaves slowsandGravelNoiseGen; + + /** + * Determines whether something other than nettherack can be generated at a location + */ + private final NoiseGeneratorOctaves netherrackExculsivityNoiseGen; + public NoiseGeneratorOctaves netherNoiseGen6; + public NoiseGeneratorOctaves netherNoiseGen7; + + /** Is the world that the nether is getting generated. */ + private final World worldObj; + private double[] noiseField; + public MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); + + /** + * Holds the noise used to determine whether slowsand can be generated at a location + */ + private double[] slowsandNoise = new double[256]; + private double[] gravelNoise = new double[256]; + + /** + * Holds the noise used to determine whether something other than netherrack can be generated at a location + */ + private double[] netherrackExclusivityNoise = new double[256]; + private final MapGenBase netherCaveGenerator = new MapGenCavesHell(); + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + + + public ChunkProviderHell(World p_i2005_1_, long p_i2005_2_) { + this.worldObj = p_i2005_1_; + this.hellRNG = new Random(p_i2005_2_); + this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); + this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); + this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); + } + + public void func_147419_a(int p_147419_1_, int p_147419_2_, Block[] p_147419_3_) { + byte var4 = 4; + byte var5 = 32; + int var6 = var4 + 1; + byte var7 = 17; + int var8 = var4 + 1; + this.noiseField = this.initializeNoiseField(this.noiseField, p_147419_1_ * var4, 0, p_147419_2_ * var4, var6, var7, var8); + + for (int var9 = 0; var9 < var4; ++var9) { + for (int var10 = 0; var10 < var4; ++var10) { + for (int var11 = 0; var11 < 16; ++var11) { + double var12 = 0.125D; + double var14 = this.noiseField[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0]; + double var16 = this.noiseField[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0]; + double var18 = this.noiseField[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 0]; + double var20 = this.noiseField[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 0]; + double var22 = (this.noiseField[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 1] - var14) * var12; + double var24 = (this.noiseField[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 1] - var16) * var12; + double var26 = (this.noiseField[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12; + double var28 = (this.noiseField[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12; + + for (int var30 = 0; var30 < 8; ++var30) { + double var31 = 0.25D; + double var33 = var14; + double var35 = var16; + double var37 = (var18 - var14) * var31; + double var39 = (var20 - var16) * var31; + + for (int var41 = 0; var41 < 4; ++var41) { + int var42 = var41 + var9 * 4 << 11 | 0 + var10 * 4 << 7 | var11 * 8 + var30; + short var43 = 128; + double var44 = 0.25D; + double var46 = var33; + double var48 = (var35 - var33) * var44; + + for (int var50 = 0; var50 < 4; ++var50) { + Block var51 = null; + + if (var11 * 8 + var30 < var5) { + var51 = Blocks.lava; + } + + if (var46 > 0.0D) { + var51 = Blocks.netherrack; + } + + p_147419_3_[var42] = var51; + var42 += var43; + var46 += var48; + } + + var33 += var37; + var35 += var39; + } + + var14 += var22; + var16 += var24; + var18 += var26; + var20 += var28; + } + } + } + } + } + + public void func_147418_b(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_) { + byte var4 = 64; + double var5 = 0.03125D; + this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_147418_1_ * 16, p_147418_2_ * 16, 0, 16, 16, 1, var5, var5, 1.0D); + this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, p_147418_1_ * 16, 109, p_147418_2_ * 16, 16, 1, 16, var5, 1.0D, var5); + this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, p_147418_1_ * 16, p_147418_2_ * 16, 0, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D); + + for (int var7 = 0; var7 < 16; ++var7) { + for (int var8 = 0; var8 < 16; ++var8) { + boolean var9 = this.slowsandNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D); + int var12 = -1; + Block var13 = Blocks.netherrack; + Block var14 = Blocks.netherrack; + + for (int var15 = 127; var15 >= 0; --var15) { + int var16 = (var8 * 16 + var7) * 128 + var15; + + if (var15 < 127 - this.hellRNG.nextInt(5) && var15 > 0 + this.hellRNG.nextInt(5)) { + Block var17 = p_147418_3_[var16]; + + if (var17 != null && var17.getMaterial() != Material.air) { + if (var17 == Blocks.netherrack) { + if (var12 == -1) { + if (var11 <= 0) { + var13 = null; + var14 = Blocks.netherrack; + } + else if (var15 >= var4 - 4 && var15 <= var4 + 1) { + var13 = Blocks.netherrack; + var14 = Blocks.netherrack; + + if (var10) { + var13 = Blocks.gravel; + var14 = Blocks.netherrack; + } + + if (var9) { + var13 = Blocks.soul_sand; + var14 = Blocks.soul_sand; + } + } + + if (var15 < var4 && (var13 == null || var13.getMaterial() == Material.air)) { + var13 = Blocks.lava; + } + + var12 = var11; + + if (var15 >= var4 - 1) { + p_147418_3_[var16] = var13; + } + else { + p_147418_3_[var16] = var14; + } + } else if (var12 > 0) { + --var12; + p_147418_3_[var16] = var14; + } + } + } else { + var12 = -1; + } + } else { + p_147418_3_[var16] = Blocks.bedrock; + } + } + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP com.cheatbreaker.client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + this.hellRNG.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] var3 = new Block[32768]; + this.func_147419_a(p_73154_1_, p_73154_2_, var3); + this.func_147418_b(p_73154_1_, p_73154_2_, var3); + this.netherCaveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + this.genNetherBridge.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, var3); + Chunk var4 = new Chunk(this.worldObj, var3, p_73154_1_, p_73154_2_); + BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + byte[] var6 = var4.getBiomeArray(); + + for (int var7 = 0; var7 < var6.length; ++var7) { + var6[var7] = (byte)var5[var7].biomeID; + } + + var4.resetRelightChecks(); + return var4; + } + + /** + * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the + * size. + */ + private double[] initializeNoiseField(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) { + if (p_73164_1_ == null) { + p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; + } + + double var8 = 684.412D; + double var10 = 2053.236D; + this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 1.0D, 0.0D, 1.0D); + this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 100.0D, 0.0D, 100.0D); + this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D); + this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, var8, var10, var8); + this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, var8, var10, var8); + int var12 = 0; + int var13 = 0; + double[] var14 = new double[p_73164_6_]; + int var15; + + for (var15 = 0; var15 < p_73164_6_; ++var15) { + var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)p_73164_6_) * 2.0D; + double var16 = var15; + + if (var15 > p_73164_6_ / 2) { + var16 = p_73164_6_ - 1 - var15; + } + + if (var16 < 4.0D) { + var16 = 4.0D - var16; + var14[var15] -= var16 * var16 * var16 * 10.0D; + } + } + + for (var15 = 0; var15 < p_73164_5_; ++var15) { + for (int var36 = 0; var36 < p_73164_7_; ++var36) { + double var17 = (this.noiseData4[var13] + 256.0D) / 512.0D; + + if (var17 > 1.0D) { + var17 = 1.0D; + } + + double var19 = 0.0D; + double var21 = this.noiseData5[var13] / 8000.0D; + + if (var21 < 0.0D) { + var21 = -var21; + } + + var21 = var21 * 3.0D - 3.0D; + + if (var21 < 0.0D) { + var21 /= 2.0D; + + if (var21 < -1.0D) { + var21 = -1.0D; + } + + var21 /= 1.4D; + var21 /= 2.0D; + var17 = 0.0D; + } else { + if (var21 > 1.0D) { + var21 = 1.0D; + } + + var21 /= 6.0D; + } + + var17 += 0.5D; + var21 = var21 * (double)p_73164_6_ / 16.0D; + ++var13; + + for (int var23 = 0; var23 < p_73164_6_; ++var23) { + double var24 = 0.0D; + double var26 = var14[var23]; + double var28 = this.noiseData2[var12] / 512.0D; + double var30 = this.noiseData3[var12] / 512.0D; + double var32 = (this.noiseData1[var12] / 10.0D + 1.0D) / 2.0D; + + if (var32 < 0.0D) { + var24 = var28; + } else if (var32 > 1.0D) { + var24 = var30; + } else { + var24 = var28 + (var30 - var28) * var32; + } + + var24 -= var26; + double var34; + + if (var23 > p_73164_6_ - 4) { + var34 = (float)(var23 - (p_73164_6_ - 4)) / 3.0F; + var24 = var24 * (1.0D - var34) + -10.0D * var34; + } + + if ((double)var23 < var19) { + var34 = (var19 - (double)var23) / 4.0D; + + if (var34 < 0.0D) { + var34 = 0.0D; + } + + if (var34 > 1.0D) { + var34 = 1.0D; + } + + var24 = var24 * (1.0D - var34) + -10.0D * var34; + } + + p_73164_1_[var12] = var24; + ++var12; + } + } + } + + return p_73164_1_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { + BlockFalling.field_149832_M = true; + int var4 = p_73153_2_ * 16; + int var5 = p_73153_3_ * 16; + this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.hellRNG, p_73153_2_, p_73153_3_); + int var6; + int var7; + int var8; + int var9; + + for (var6 = 0; var6 < 8; ++var6) { + var7 = var4 + this.hellRNG.nextInt(16) + 8; + var8 = this.hellRNG.nextInt(120) + 4; + var9 = var5 + this.hellRNG.nextInt(16) + 8; + (new WorldGenHellLava(Blocks.flowing_lava, false)).generate(this.worldObj, this.hellRNG, var7, var8, var9); + } + + var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; + int var10; + + for (var7 = 0; var7 < var6; ++var7) { + var8 = var4 + this.hellRNG.nextInt(16) + 8; + var9 = this.hellRNG.nextInt(120) + 4; + var10 = var5 + this.hellRNG.nextInt(16) + 8; + (new WorldGenFire()).generate(this.worldObj, this.hellRNG, var8, var9, var10); + } + + var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); + + for (var7 = 0; var7 < var6; ++var7) { + var8 = var4 + this.hellRNG.nextInt(16) + 8; + var9 = this.hellRNG.nextInt(120) + 4; + var10 = var5 + this.hellRNG.nextInt(16) + 8; + (new WorldGenGlowStone1()).generate(this.worldObj, this.hellRNG, var8, var9, var10); + } + + for (var7 = 0; var7 < 10; ++var7) { + var8 = var4 + this.hellRNG.nextInt(16) + 8; + var9 = this.hellRNG.nextInt(128); + var10 = var5 + this.hellRNG.nextInt(16) + 8; + (new WorldGenGlowStone2()).generate(this.worldObj, this.hellRNG, var8, var9, var10); + } + + if (this.hellRNG.nextInt(1) == 0) { + var7 = var4 + this.hellRNG.nextInt(16) + 8; + var8 = this.hellRNG.nextInt(128); + var9 = var5 + this.hellRNG.nextInt(16) + 8; + (new WorldGenFlowers(Blocks.brown_mushroom)).generate(this.worldObj, this.hellRNG, var7, var8, var9); + } + + if (this.hellRNG.nextInt(1) == 0) { + var7 = var4 + this.hellRNG.nextInt(16) + 8; + var8 = this.hellRNG.nextInt(128); + var9 = var5 + this.hellRNG.nextInt(16) + 8; + (new WorldGenFlowers(Blocks.red_mushroom)).generate(this.worldObj, this.hellRNG, var7, var8, var9); + } + + WorldGenMinable var12 = new WorldGenMinable(Blocks.quartz_ore, 13, Blocks.netherrack); + int var11; + + for (var8 = 0; var8 < 16; ++var8) { + var9 = var4 + this.hellRNG.nextInt(16); + var10 = this.hellRNG.nextInt(108) + 10; + var11 = var5 + this.hellRNG.nextInt(16); + var12.generate(this.worldObj, this.hellRNG, var9, var10, var11); + } + + for (var8 = 0; var8 < 16; ++var8) { + var9 = var4 + this.hellRNG.nextInt(16); + var10 = this.hellRNG.nextInt(108) + 10; + var11 = var5 + this.hellRNG.nextInt(16); + (new WorldGenHellLava(Blocks.flowing_lava, true)).generate(this.worldObj, this.hellRNG, var9, var10, var11); + } + + BlockFalling.field_149832_M = false; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() { + return "HellRandomLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + if (p_73155_1_ == EnumCreatureType.monster) { + if (this.genNetherBridge.hasStructureAt(p_73155_2_, p_73155_3_, p_73155_4_)) { + return this.genNetherBridge.getSpawnList(); + } + + if (this.genNetherBridge.func_142038_b(p_73155_2_, p_73155_3_, p_73155_4_) && this.worldObj.getBlock(p_73155_2_, p_73155_3_ - 1, p_73155_4_) == Blocks.nether_brick) { + return this.genNetherBridge.getSpawnList(); + } + } + + BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return var5.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + return null; + } + + public int getLoadedChunkCount() { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) { + this.genNetherBridge.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, null); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderServer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderServer.java new file mode 100644 index 0000000..1c4ca4c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/ChunkProviderServer.java @@ -0,0 +1,316 @@ +package net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ChunkProviderServer implements IChunkProvider { + private static final Logger logger = LogManager.getLogger(); + + /** + * used by unload100OldestChunks to iterate the loadedChunkHashMap for unload (underlying assumption, first in, + * first out) + */ + private final Set chunksToUnload = Collections.newSetFromMap(new ConcurrentHashMap()); + private final Chunk defaultEmptyChunk; + private final IChunkProvider currentChunkProvider; + private final IChunkLoader currentChunkLoader; + + /** + * if this is false, the defaultEmptyChunk will be returned by the provider + */ + public boolean loadChunkOnProvideRequest = true; + private final LongHashMap loadedChunkHashMap = new LongHashMap(); + private final List loadedChunks = new ArrayList(); + private final WorldServer worldObj; + + + public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_) { + this.defaultEmptyChunk = new EmptyChunk(p_i1520_1_, 0, 0); + this.worldObj = p_i1520_1_; + this.currentChunkLoader = p_i1520_2_; + this.currentChunkProvider = p_i1520_3_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) { + return this.loadedChunkHashMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(p_73149_1_, p_73149_2_)); + } + + public List func_152380_a() { + return this.loadedChunks; + } + + /** + * marks chunk for unload by "unload100OldestChunks" if there is no spawn point, or if the center of the chunk is + * outside 200 blocks (x or z) of the spawn + */ + public void unloadChunksIfNotNearSpawn(int p_73241_1_, int p_73241_2_) { + if (this.worldObj.provider.canRespawnHere()) { + ChunkCoordinates var3 = this.worldObj.getSpawnPoint(); + int var4 = p_73241_1_ * 16 + 8 - var3.posX; + int var5 = p_73241_2_ * 16 + 8 - var3.posZ; + short var6 = 128; + + if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) { + this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_73241_1_, p_73241_2_))); + } + } else { + this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_73241_1_, p_73241_2_))); + } + } + + /** + * marks all chunks for unload, ignoring those near the spawn + */ + public void unloadAllChunks() { + Iterator var1 = this.loadedChunks.iterator(); + + while (var1.hasNext()) { + Chunk var2 = (Chunk)var1.next(); + this.unloadChunksIfNotNearSpawn(var2.xPosition, var2.zPosition); + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) { + long var3 = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_); + this.chunksToUnload.remove(Long.valueOf(var3)); + Chunk var5 = (Chunk)this.loadedChunkHashMap.getValueByKey(var3); + + if (var5 == null) { + var5 = this.safeLoadChunk(p_73158_1_, p_73158_2_); + + if (var5 == null) { + if (this.currentChunkProvider == null) { + var5 = this.defaultEmptyChunk; + } else { + try { + var5 = this.currentChunkProvider.provideChunk(p_73158_1_, p_73158_2_); + } catch (Throwable var9) { + CrashReport var7 = CrashReport.makeCrashReport(var9, "Exception generating new chunk"); + CrashReportCategory var8 = var7.makeCategory("Chunk to be generated"); + var8.addCrashSection("Location", String.format("%d,%d", Integer.valueOf(p_73158_1_), Integer.valueOf(p_73158_2_))); + var8.addCrashSection("Position hash", Long.valueOf(var3)); + var8.addCrashSection("Generator", this.currentChunkProvider.makeString()); + throw new ReportedException(var7); + } + } + } + + this.loadedChunkHashMap.add(var3, var5); + this.loadedChunks.add(var5); + var5.onChunkLoad(); + var5.populateChunk(this, this, p_73158_1_, p_73158_2_); + } + + return var5; + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP com.cheatbreaker.client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { + Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(p_73154_1_, p_73154_2_)); + return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(p_73154_1_, p_73154_2_)) : var3; + } + + /** + * used by loadChunk, but catches any exceptions if the load fails. + */ + private Chunk safeLoadChunk(int p_73239_1_, int p_73239_2_) { + if (this.currentChunkLoader == null) { + return null; + } else { + try { + Chunk var3 = this.currentChunkLoader.loadChunk(this.worldObj, p_73239_1_, p_73239_2_); + + if (var3 != null) { + var3.lastSaveTime = this.worldObj.getTotalWorldTime(); + + if (this.currentChunkProvider != null) { + this.currentChunkProvider.recreateStructures(p_73239_1_, p_73239_2_); + } + } + + return var3; + } catch (Exception var4) { + logger.error("Couldn't load chunk", var4); + return null; + } + } + } + + /** + * used by saveChunks, but catches any exceptions if the save fails. + */ + private void safeSaveExtraChunkData(Chunk p_73243_1_) { + if (this.currentChunkLoader != null) { + try { + this.currentChunkLoader.saveExtraChunkData(this.worldObj, p_73243_1_); + } catch (Exception var3) { + logger.error("Couldn't save entities", var3); + } + } + } + + /** + * used by saveChunks, but catches any exceptions if the save fails. + */ + private void safeSaveChunk(Chunk p_73242_1_) { + if (this.currentChunkLoader != null) { + try { + p_73242_1_.lastSaveTime = this.worldObj.getTotalWorldTime(); + this.currentChunkLoader.saveChunk(this.worldObj, p_73242_1_); + } catch (IOException var3) { + logger.error("Couldn't save chunk", var3); + } catch (MinecraftException var4) { + logger.error("Couldn't save chunk; already in use by another instance of Minecraft?", var4); + } + } + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { + Chunk var4 = this.provideChunk(p_73153_2_, p_73153_3_); + + if (!var4.isTerrainPopulated) { + var4.func_150809_p(); + + if (this.currentChunkProvider != null) { + this.currentChunkProvider.populate(p_73153_1_, p_73153_2_, p_73153_3_); + var4.setChunkModified(); + } + } + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) { + int var3 = 0; + ArrayList var4 = Lists.newArrayList(this.loadedChunks); + + for (int var5 = 0; var5 < var4.size(); ++var5) { + Chunk var6 = (Chunk)var4.get(var5); + + if (p_73151_1_) { + this.safeSaveExtraChunkData(var6); + } + + if (var6.needsSaving(p_73151_1_)) { + this.safeSaveChunk(var6); + var6.isModified = false; + ++var3; + + if (var3 == 24 && !p_73151_1_) { + return false; + } + } + } + + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() { + if (this.currentChunkLoader != null) { + this.currentChunkLoader.saveExtraData(); + } + } + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() { + if (!this.worldObj.levelSaving) { + for (int var1 = 0; var1 < 100; ++var1) { + if (!this.chunksToUnload.isEmpty()) { + Long var2 = (Long)this.chunksToUnload.iterator().next(); + Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(var2.longValue()); + + if (var3 != null) { + var3.onChunkUnload(); + this.safeSaveChunk(var3); + this.safeSaveExtraChunkData(var3); + this.loadedChunks.remove(var3); + } + + this.chunksToUnload.remove(var2); + this.loadedChunkHashMap.remove(var2.longValue()); + } + } + + if (this.currentChunkLoader != null) { + this.currentChunkLoader.chunkTick(); + } + } + + return this.currentChunkProvider.unloadQueuedChunks(); + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() { + return !this.worldObj.levelSaving; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() { + return "ServerChunkCache: " + this.loadedChunkHashMap.getNumHashElements() + " Drop: " + this.chunksToUnload.size(); + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { + return this.currentChunkProvider.getPossibleCreatures(p_73155_1_, p_73155_2_, p_73155_3_, p_73155_4_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + return this.currentChunkProvider.func_147416_a(p_147416_1_, p_147416_2_, p_147416_3_, p_147416_4_, p_147416_5_); + } + + public int getLoadedChunkCount() { + return this.loadedChunkHashMap.getNumHashElements(); + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java new file mode 100644 index 0000000..4a4bbb9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/FlatGeneratorInfo.java @@ -0,0 +1,268 @@ +package net.minecraft.world.gen; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.biome.BiomeGenBase; + +public class FlatGeneratorInfo { + /** List of layers on this preset. */ + private final List flatLayers = new ArrayList(); + + /** List of world features enabled on this preset. */ + private final Map worldFeatures = new HashMap(); + private int biomeToUse; + + + /** + * Return the biome used on this preset. + */ + public int getBiome() { + return this.biomeToUse; + } + + /** + * Set the biome used on this preset. + */ + public void setBiome(int p_82647_1_) { + this.biomeToUse = p_82647_1_; + } + + /** + * Return the list of world features enabled on this preset. + */ + public Map getWorldFeatures() { + return this.worldFeatures; + } + + /** + * Return the list of layers on this preset. + */ + public List getFlatLayers() { + return this.flatLayers; + } + + public void func_82645_d() { + int var1 = 0; + FlatLayerInfo var3; + + for (Iterator var2 = this.flatLayers.iterator(); var2.hasNext(); var1 += var3.getLayerCount()) { + var3 = (FlatLayerInfo)var2.next(); + var3.setMinY(var1); + } + } + + public String toString() { + StringBuilder var1 = new StringBuilder(); + var1.append(2); + var1.append(";"); + int var2; + + for (var2 = 0; var2 < this.flatLayers.size(); ++var2) { + if (var2 > 0) { + var1.append(","); + } + + var1.append(this.flatLayers.get(var2).toString()); + } + + var1.append(";"); + var1.append(this.biomeToUse); + + if (!this.worldFeatures.isEmpty()) { + var1.append(";"); + var2 = 0; + Iterator var3 = this.worldFeatures.entrySet().iterator(); + + while (var3.hasNext()) { + Entry var4 = (Entry)var3.next(); + + if (var2++ > 0) { + var1.append(","); + } + + var1.append(((String)var4.getKey()).toLowerCase()); + Map var5 = (Map)var4.getValue(); + + if (!var5.isEmpty()) { + var1.append("("); + int var6 = 0; + Iterator var7 = var5.entrySet().iterator(); + + while (var7.hasNext()) { + Entry var8 = (Entry)var7.next(); + + if (var6++ > 0) { + var1.append(" "); + } + + var1.append((String)var8.getKey()); + var1.append("="); + var1.append((String)var8.getValue()); + } + + var1.append(")"); + } + } + } else { + var1.append(";"); + } + + return var1.toString(); + } + + private static FlatLayerInfo func_82646_a(String p_82646_0_, int p_82646_1_) { + String[] var2 = p_82646_0_.split("x", 2); + int var3 = 1; + int var5 = 0; + + if (var2.length == 2) { + try { + var3 = Integer.parseInt(var2[0]); + + if (p_82646_1_ + var3 >= 256) { + var3 = 256 - p_82646_1_; + } + + if (var3 < 0) { + var3 = 0; + } + } catch (Throwable var7) { + return null; + } + } + + int var4; + + try { + String var6 = var2[var2.length - 1]; + var2 = var6.split(":", 2); + var4 = Integer.parseInt(var2[0]); + + if (var2.length > 1) { + var5 = Integer.parseInt(var2[1]); + } + + if (Block.getBlockById(var4) == Blocks.air) { + var4 = 0; + var5 = 0; + } + + if (var5 < 0 || var5 > 15) { + var5 = 0; + } + } catch (Throwable var8) { + return null; + } + + FlatLayerInfo var9 = new FlatLayerInfo(var3, Block.getBlockById(var4), var5); + var9.setMinY(p_82646_1_); + return var9; + } + + private static List func_82652_b(String p_82652_0_) { + if (p_82652_0_ != null && p_82652_0_.length() >= 1) { + ArrayList var1 = new ArrayList(); + String[] var2 = p_82652_0_.split(","); + int var3 = 0; + String[] var4 = var2; + int var5 = var2.length; + + for (int var6 = 0; var6 < var5; ++var6) { + String var7 = var4[var6]; + FlatLayerInfo var8 = func_82646_a(var7, var3); + + if (var8 == null) { + return null; + } + + var1.add(var8); + var3 += var8.getLayerCount(); + } + + return var1; + } else { + return null; + } + } + + public static FlatGeneratorInfo createFlatGeneratorFromString(String p_82651_0_) { + if (p_82651_0_ == null) { + return getDefaultFlatGenerator(); + } else { + String[] var1 = p_82651_0_.split(";", -1); + int var2 = var1.length == 1 ? 0 : MathHelper.parseIntWithDefault(var1[0], 0); + + if (var2 >= 0 && var2 <= 2) { + FlatGeneratorInfo var3 = new FlatGeneratorInfo(); + int var4 = var1.length == 1 ? 0 : 1; + List var5 = func_82652_b(var1[var4++]); + + if (var5 != null && !var5.isEmpty()) { + var3.getFlatLayers().addAll(var5); + var3.func_82645_d(); + int var6 = BiomeGenBase.plains.biomeID; + + if (var2 > 0 && var1.length > var4) { + var6 = MathHelper.parseIntWithDefault(var1[var4++], var6); + } + + var3.setBiome(var6); + + if (var2 > 0 && var1.length > var4) { + String[] var7 = var1[var4++].toLowerCase().split(","); + String[] var8 = var7; + int var9 = var7.length; + + for (int var10 = 0; var10 < var9; ++var10) { + String var11 = var8[var10]; + String[] var12 = var11.split("\\(", 2); + HashMap var13 = new HashMap(); + + if (var12[0].length() > 0) { + var3.getWorldFeatures().put(var12[0], var13); + + if (var12.length > 1 && var12[1].endsWith(")") && var12[1].length() > 1) { + String[] var14 = var12[1].substring(0, var12[1].length() - 1).split(" "); + + for (int var15 = 0; var15 < var14.length; ++var15) { + String[] var16 = var14[var15].split("=", 2); + + if (var16.length == 2) { + var13.put(var16[0], var16[1]); + } + } + } + } + } + } else { + var3.getWorldFeatures().put("village", new HashMap()); + } + + return var3; + } else { + return getDefaultFlatGenerator(); + } + } else { + return getDefaultFlatGenerator(); + } + } + } + + public static FlatGeneratorInfo getDefaultFlatGenerator() { + FlatGeneratorInfo var0 = new FlatGeneratorInfo(); + var0.setBiome(BiomeGenBase.plains.biomeID); + var0.getFlatLayers().add(new FlatLayerInfo(1, Blocks.bedrock)); + var0.getFlatLayers().add(new FlatLayerInfo(2, Blocks.dirt)); + var0.getFlatLayers().add(new FlatLayerInfo(1, Blocks.grass)); + var0.func_82645_d(); + var0.getWorldFeatures().put("village", new HashMap()); + return var0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java new file mode 100644 index 0000000..51a6a2e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java @@ -0,0 +1,72 @@ +package net.minecraft.world.gen; + +import net.minecraft.block.Block; + +public class FlatLayerInfo { + private final Block field_151537_a; + + /** Amount of layers for this set of layers. */ + private int layerCount; + + /** Block metadata used on this set of laeyrs. */ + private int layerFillBlockMeta; + private int layerMinimumY; + + + public FlatLayerInfo(int p_i45467_1_, Block p_i45467_2_) { + this.layerCount = 1; + this.layerCount = p_i45467_1_; + this.field_151537_a = p_i45467_2_; + } + + public FlatLayerInfo(int p_i45468_1_, Block p_i45468_2_, int p_i45468_3_) { + this(p_i45468_1_, p_i45468_2_); + this.layerFillBlockMeta = p_i45468_3_; + } + + /** + * Return the amount of layers for this set of layers. + */ + public int getLayerCount() { + return this.layerCount; + } + + public Block func_151536_b() { + return this.field_151537_a; + } + + /** + * Return the block metadata used on this set of layers. + */ + public int getFillBlockMeta() { + return this.layerFillBlockMeta; + } + + /** + * Return the minimum Y coordinate for this layer, set during generation. + */ + public int getMinY() { + return this.layerMinimumY; + } + + /** + * Set the minimum Y coordinate for this layer. + */ + public void setMinY(int p_82660_1_) { + this.layerMinimumY = p_82660_1_; + } + + public String toString() { + String var1 = Integer.toString(Block.getIdFromBlock(this.field_151537_a)); + + if (this.layerCount > 1) { + var1 = this.layerCount + "x" + var1; + } + + if (this.layerFillBlockMeta > 0) { + var1 = var1 + ":" + this.layerFillBlockMeta; + } + + return var1; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenBase.java new file mode 100644 index 0000000..09aaa79 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenBase.java @@ -0,0 +1,37 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public class MapGenBase { + /** The number of Chunks to gen-check in any given direction. */ + protected int range = 8; + + /** The RNG used by the MapGen classes. */ + protected Random rand = new Random(); + + /** This world object. */ + protected World worldObj; + + + public void func_151539_a(IChunkProvider p_151539_1_, World p_151539_2_, int p_151539_3_, int p_151539_4_, Block[] p_151539_5_) { + int var6 = this.range; + this.worldObj = p_151539_2_; + this.rand.setSeed(p_151539_2_.getSeed()); + long var7 = this.rand.nextLong(); + long var9 = this.rand.nextLong(); + + for (int var11 = p_151539_3_ - var6; var11 <= p_151539_3_ + var6; ++var11) { + for (int var12 = p_151539_4_ - var6; var12 <= p_151539_4_ + var6; ++var12) { + long var13 = (long)var11 * var7; + long var15 = (long)var12 * var9; + this.rand.setSeed(var13 ^ var15 ^ p_151539_2_.getSeed()); + this.func_151538_a(p_151539_2_, var11, var12, p_151539_3_, p_151539_4_, p_151539_5_); + } + } + } + + protected void func_151538_a(World p_151538_1_, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenCaves.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenCaves.java new file mode 100644 index 0000000..7db3462 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenCaves.java @@ -0,0 +1,213 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class MapGenCaves extends MapGenBase { + + + protected void func_151542_a(long p_151542_1_, int p_151542_3_, int p_151542_4_, Block[] p_151542_5_, double p_151542_6_, double p_151542_8_, double p_151542_10_) { + this.func_151541_a(p_151542_1_, p_151542_3_, p_151542_4_, p_151542_5_, p_151542_6_, p_151542_8_, p_151542_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_151541_a(long p_151541_1_, int p_151541_3_, int p_151541_4_, Block[] p_151541_5_, double p_151541_6_, double p_151541_8_, double p_151541_10_, float p_151541_12_, float p_151541_13_, float p_151541_14_, int p_151541_15_, int p_151541_16_, double p_151541_17_) { + double var19 = p_151541_3_ * 16 + 8; + double var21 = p_151541_4_ * 16 + 8; + float var23 = 0.0F; + float var24 = 0.0F; + Random var25 = new Random(p_151541_1_); + + if (p_151541_16_ <= 0) { + int var26 = this.range * 16 - 16; + p_151541_16_ = var26 - var25.nextInt(var26 / 4); + } + + boolean var54 = false; + + if (p_151541_15_ == -1) { + p_151541_15_ = p_151541_16_ / 2; + var54 = true; + } + + int var27 = var25.nextInt(p_151541_16_ / 2) + p_151541_16_ / 4; + + for (boolean var28 = var25.nextInt(6) == 0; p_151541_15_ < p_151541_16_; ++p_151541_15_) { + double var29 = 1.5D + (double)(MathHelper.sin((float)p_151541_15_ * (float)Math.PI / (float)p_151541_16_) * p_151541_12_ * 1.0F); + double var31 = var29 * p_151541_17_; + float var33 = MathHelper.cos(p_151541_14_); + float var34 = MathHelper.sin(p_151541_14_); + p_151541_6_ += MathHelper.cos(p_151541_13_) * var33; + p_151541_8_ += var34; + p_151541_10_ += MathHelper.sin(p_151541_13_) * var33; + + if (var28) { + p_151541_14_ *= 0.92F; + } else { + p_151541_14_ *= 0.7F; + } + + p_151541_14_ += var24 * 0.1F; + p_151541_13_ += var23 * 0.1F; + var24 *= 0.9F; + var23 *= 0.75F; + var24 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 2.0F; + var23 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 4.0F; + + if (!var54 && p_151541_15_ == var27 && p_151541_12_ > 1.0F && p_151541_16_ > 0) { + this.func_151541_a(var25.nextLong(), p_151541_3_, p_151541_4_, p_151541_5_, p_151541_6_, p_151541_8_, p_151541_10_, var25.nextFloat() * 0.5F + 0.5F, p_151541_13_ - ((float)Math.PI / 2F), p_151541_14_ / 3.0F, p_151541_15_, p_151541_16_, 1.0D); + this.func_151541_a(var25.nextLong(), p_151541_3_, p_151541_4_, p_151541_5_, p_151541_6_, p_151541_8_, p_151541_10_, var25.nextFloat() * 0.5F + 0.5F, p_151541_13_ + ((float)Math.PI / 2F), p_151541_14_ / 3.0F, p_151541_15_, p_151541_16_, 1.0D); + return; + } + + if (var54 || var25.nextInt(4) != 0) { + double var35 = p_151541_6_ - var19; + double var37 = p_151541_10_ - var21; + double var39 = p_151541_16_ - p_151541_15_; + double var41 = p_151541_12_ + 2.0F + 16.0F; + + if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { + return; + } + + if (p_151541_6_ >= var19 - 16.0D - var29 * 2.0D && p_151541_10_ >= var21 - 16.0D - var29 * 2.0D && p_151541_6_ <= var19 + 16.0D + var29 * 2.0D && p_151541_10_ <= var21 + 16.0D + var29 * 2.0D) { + int var55 = MathHelper.floor_double(p_151541_6_ - var29) - p_151541_3_ * 16 - 1; + int var36 = MathHelper.floor_double(p_151541_6_ + var29) - p_151541_3_ * 16 + 1; + int var56 = MathHelper.floor_double(p_151541_8_ - var31) - 1; + int var38 = MathHelper.floor_double(p_151541_8_ + var31) + 1; + int var57 = MathHelper.floor_double(p_151541_10_ - var29) - p_151541_4_ * 16 - 1; + int var40 = MathHelper.floor_double(p_151541_10_ + var29) - p_151541_4_ * 16 + 1; + + if (var55 < 0) { + var55 = 0; + } + + if (var36 > 16) { + var36 = 16; + } + + if (var56 < 1) { + var56 = 1; + } + + if (var38 > 248) { + var38 = 248; + } + + if (var57 < 0) { + var57 = 0; + } + + if (var40 > 16) { + var40 = 16; + } + + boolean var58 = false; + int var42; + int var45; + + for (var42 = var55; !var58 && var42 < var36; ++var42) { + for (int var43 = var57; !var58 && var43 < var40; ++var43) { + for (int var44 = var38 + 1; !var58 && var44 >= var56 - 1; --var44) { + var45 = (var42 * 16 + var43) * 256 + var44; + + if (var44 >= 0 && var44 < 256) { + Block var46 = p_151541_5_[var45]; + + if (var46 == Blocks.flowing_water || var46 == Blocks.water) { + var58 = true; + } + + if (var44 != var56 - 1 && var42 != var55 && var42 != var36 - 1 && var43 != var57 && var43 != var40 - 1) { + var44 = var56; + } + } + } + } + } + + if (!var58) { + for (var42 = var55; var42 < var36; ++var42) { + double var59 = ((double)(var42 + p_151541_3_ * 16) + 0.5D - p_151541_6_) / var29; + + for (var45 = var57; var45 < var40; ++var45) { + double var60 = ((double)(var45 + p_151541_4_ * 16) + 0.5D - p_151541_10_) / var29; + int var48 = (var42 * 16 + var45) * 256 + var38; + boolean var49 = false; + + if (var59 * var59 + var60 * var60 < 1.0D) { + for (int var50 = var38 - 1; var50 >= var56; --var50) { + double var51 = ((double)var50 + 0.5D - p_151541_8_) / var31; + + if (var51 > -0.7D && var59 * var59 + var51 * var51 + var60 * var60 < 1.0D) { + Block var53 = p_151541_5_[var48]; + + if (var53 == Blocks.grass) + { + var49 = true; + } + + if (var53 == Blocks.stone || var53 == Blocks.dirt || var53 == Blocks.grass) + { + if (var50 < 10) { + p_151541_5_[var48] = Blocks.lava; + } + else { + p_151541_5_[var48] = null; + + if (var49 && p_151541_5_[var48 - 1] == Blocks.dirt) { + p_151541_5_[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + p_151541_3_ * 16, var45 + p_151541_4_ * 16).topBlock; + } + } + } + } + + --var48; + } + } + } + } + + if (var54) { + break; + } + } + } + } + } + } + + protected void func_151538_a(World p_151538_1_, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) { + int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(15) + 1) + 1); + + if (this.rand.nextInt(7) != 0) { + var7 = 0; + } + + for (int var8 = 0; var8 < var7; ++var8) { + double var9 = p_151538_2_ * 16 + this.rand.nextInt(16); + double var11 = this.rand.nextInt(this.rand.nextInt(120) + 8); + double var13 = p_151538_3_ * 16 + this.rand.nextInt(16); + int var15 = 1; + + if (this.rand.nextInt(4) == 0) { + this.func_151542_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, var9, var11, var13); + var15 += this.rand.nextInt(4); + } + + for (int var16 = 0; var16 < var15; ++var16) { + float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + + if (this.rand.nextInt(10) == 0) { + var19 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; + } + + this.func_151541_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenCavesHell.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenCavesHell.java new file mode 100644 index 0000000..7f4674f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenCavesHell.java @@ -0,0 +1,190 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class MapGenCavesHell extends MapGenBase { + + + protected void func_151544_a(long p_151544_1_, int p_151544_3_, int p_151544_4_, Block[] p_151544_5_, double p_151544_6_, double p_151544_8_, double p_151544_10_) { + this.func_151543_a(p_151544_1_, p_151544_3_, p_151544_4_, p_151544_5_, p_151544_6_, p_151544_8_, p_151544_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_151543_a(long p_151543_1_, int p_151543_3_, int p_151543_4_, Block[] p_151543_5_, double p_151543_6_, double p_151543_8_, double p_151543_10_, float p_151543_12_, float p_151543_13_, float p_151543_14_, int p_151543_15_, int p_151543_16_, double p_151543_17_) { + double var19 = p_151543_3_ * 16 + 8; + double var21 = p_151543_4_ * 16 + 8; + float var23 = 0.0F; + float var24 = 0.0F; + Random var25 = new Random(p_151543_1_); + + if (p_151543_16_ <= 0) { + int var26 = this.range * 16 - 16; + p_151543_16_ = var26 - var25.nextInt(var26 / 4); + } + + boolean var53 = false; + + if (p_151543_15_ == -1) { + p_151543_15_ = p_151543_16_ / 2; + var53 = true; + } + + int var27 = var25.nextInt(p_151543_16_ / 2) + p_151543_16_ / 4; + + for (boolean var28 = var25.nextInt(6) == 0; p_151543_15_ < p_151543_16_; ++p_151543_15_) { + double var29 = 1.5D + (double)(MathHelper.sin((float)p_151543_15_ * (float)Math.PI / (float)p_151543_16_) * p_151543_12_ * 1.0F); + double var31 = var29 * p_151543_17_; + float var33 = MathHelper.cos(p_151543_14_); + float var34 = MathHelper.sin(p_151543_14_); + p_151543_6_ += MathHelper.cos(p_151543_13_) * var33; + p_151543_8_ += var34; + p_151543_10_ += MathHelper.sin(p_151543_13_) * var33; + + if (var28) { + p_151543_14_ *= 0.92F; + } else { + p_151543_14_ *= 0.7F; + } + + p_151543_14_ += var24 * 0.1F; + p_151543_13_ += var23 * 0.1F; + var24 *= 0.9F; + var23 *= 0.75F; + var24 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 2.0F; + var23 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 4.0F; + + if (!var53 && p_151543_15_ == var27 && p_151543_12_ > 1.0F) { + this.func_151543_a(var25.nextLong(), p_151543_3_, p_151543_4_, p_151543_5_, p_151543_6_, p_151543_8_, p_151543_10_, var25.nextFloat() * 0.5F + 0.5F, p_151543_13_ - ((float)Math.PI / 2F), p_151543_14_ / 3.0F, p_151543_15_, p_151543_16_, 1.0D); + this.func_151543_a(var25.nextLong(), p_151543_3_, p_151543_4_, p_151543_5_, p_151543_6_, p_151543_8_, p_151543_10_, var25.nextFloat() * 0.5F + 0.5F, p_151543_13_ + ((float)Math.PI / 2F), p_151543_14_ / 3.0F, p_151543_15_, p_151543_16_, 1.0D); + return; + } + + if (var53 || var25.nextInt(4) != 0) { + double var35 = p_151543_6_ - var19; + double var37 = p_151543_10_ - var21; + double var39 = p_151543_16_ - p_151543_15_; + double var41 = p_151543_12_ + 2.0F + 16.0F; + + if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { + return; + } + + if (p_151543_6_ >= var19 - 16.0D - var29 * 2.0D && p_151543_10_ >= var21 - 16.0D - var29 * 2.0D && p_151543_6_ <= var19 + 16.0D + var29 * 2.0D && p_151543_10_ <= var21 + 16.0D + var29 * 2.0D) { + int var54 = MathHelper.floor_double(p_151543_6_ - var29) - p_151543_3_ * 16 - 1; + int var36 = MathHelper.floor_double(p_151543_6_ + var29) - p_151543_3_ * 16 + 1; + int var55 = MathHelper.floor_double(p_151543_8_ - var31) - 1; + int var38 = MathHelper.floor_double(p_151543_8_ + var31) + 1; + int var56 = MathHelper.floor_double(p_151543_10_ - var29) - p_151543_4_ * 16 - 1; + int var40 = MathHelper.floor_double(p_151543_10_ + var29) - p_151543_4_ * 16 + 1; + + if (var54 < 0) { + var54 = 0; + } + + if (var36 > 16) { + var36 = 16; + } + + if (var55 < 1) { + var55 = 1; + } + + if (var38 > 120) { + var38 = 120; + } + + if (var56 < 0) { + var56 = 0; + } + + if (var40 > 16) { + var40 = 16; + } + + boolean var57 = false; + int var42; + int var45; + + for (var42 = var54; !var57 && var42 < var36; ++var42) { + for (int var43 = var56; !var57 && var43 < var40; ++var43) { + for (int var44 = var38 + 1; !var57 && var44 >= var55 - 1; --var44) { + var45 = (var42 * 16 + var43) * 128 + var44; + + if (var44 >= 0 && var44 < 128) { + Block var46 = p_151543_5_[var45]; + + if (var46 == Blocks.flowing_lava || var46 == Blocks.lava) { + var57 = true; + } + + if (var44 != var55 - 1 && var42 != var54 && var42 != var36 - 1 && var43 != var56 && var43 != var40 - 1) { + var44 = var55; + } + } + } + } + } + + if (!var57) { + for (var42 = var54; var42 < var36; ++var42) { + double var58 = ((double)(var42 + p_151543_3_ * 16) + 0.5D - p_151543_6_) / var29; + + for (var45 = var56; var45 < var40; ++var45) { + double var59 = ((double)(var45 + p_151543_4_ * 16) + 0.5D - p_151543_10_) / var29; + int var48 = (var42 * 16 + var45) * 128 + var38; + + for (int var49 = var38 - 1; var49 >= var55; --var49) { + double var50 = ((double)var49 + 0.5D - p_151543_8_) / var31; + + if (var50 > -0.7D && var58 * var58 + var50 * var50 + var59 * var59 < 1.0D) { + Block var52 = p_151543_5_[var48]; + + if (var52 == Blocks.netherrack || var52 == Blocks.dirt || var52 == Blocks.grass) { + p_151543_5_[var48] = null; + } + } + + --var48; + } + } + } + + if (var53) { + break; + } + } + } + } + } + } + + protected void func_151538_a(World p_151538_1_, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) { + int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(10) + 1) + 1); + + if (this.rand.nextInt(5) != 0) { + var7 = 0; + } + + for (int var8 = 0; var8 < var7; ++var8) { + double var9 = p_151538_2_ * 16 + this.rand.nextInt(16); + double var11 = this.rand.nextInt(128); + double var13 = p_151538_3_ * 16 + this.rand.nextInt(16); + int var15 = 1; + + if (this.rand.nextInt(4) == 0) { + this.func_151544_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, var9, var11, var13); + var15 += this.rand.nextInt(4); + } + + for (int var16 = 0; var16 < var15; ++var16) { + float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + this.func_151543_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, var9, var11, var13, var19 * 2.0F, var17, var18, 0, 0, 0.5D); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenRavine.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenRavine.java new file mode 100644 index 0000000..863f761 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/MapGenRavine.java @@ -0,0 +1,192 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class MapGenRavine extends MapGenBase { + private final float[] field_75046_d = new float[1024]; + + + protected void func_151540_a(long p_151540_1_, int p_151540_3_, int p_151540_4_, Block[] p_151540_5_, double p_151540_6_, double p_151540_8_, double p_151540_10_, float p_151540_12_, float p_151540_13_, float p_151540_14_, int p_151540_15_, int p_151540_16_, double p_151540_17_) { + Random var19 = new Random(p_151540_1_); + double var20 = p_151540_3_ * 16 + 8; + double var22 = p_151540_4_ * 16 + 8; + float var24 = 0.0F; + float var25 = 0.0F; + + if (p_151540_16_ <= 0) { + int var26 = this.range * 16 - 16; + p_151540_16_ = var26 - var19.nextInt(var26 / 4); + } + + boolean var53 = false; + + if (p_151540_15_ == -1) { + p_151540_15_ = p_151540_16_ / 2; + var53 = true; + } + + float var27 = 1.0F; + + for (int var28 = 0; var28 < 256; ++var28) { + if (var28 == 0 || var19.nextInt(3) == 0) { + var27 = 1.0F + var19.nextFloat() * var19.nextFloat() * 1.0F; + } + + this.field_75046_d[var28] = var27 * var27; + } + + for (; p_151540_15_ < p_151540_16_; ++p_151540_15_) { + double var54 = 1.5D + (double)(MathHelper.sin((float)p_151540_15_ * (float)Math.PI / (float)p_151540_16_) * p_151540_12_ * 1.0F); + double var30 = var54 * p_151540_17_; + var54 *= (double)var19.nextFloat() * 0.25D + 0.75D; + var30 *= (double)var19.nextFloat() * 0.25D + 0.75D; + float var32 = MathHelper.cos(p_151540_14_); + float var33 = MathHelper.sin(p_151540_14_); + p_151540_6_ += MathHelper.cos(p_151540_13_) * var32; + p_151540_8_ += var33; + p_151540_10_ += MathHelper.sin(p_151540_13_) * var32; + p_151540_14_ *= 0.7F; + p_151540_14_ += var25 * 0.05F; + p_151540_13_ += var24 * 0.05F; + var25 *= 0.8F; + var24 *= 0.5F; + var25 += (var19.nextFloat() - var19.nextFloat()) * var19.nextFloat() * 2.0F; + var24 += (var19.nextFloat() - var19.nextFloat()) * var19.nextFloat() * 4.0F; + + if (var53 || var19.nextInt(4) != 0) { + double var34 = p_151540_6_ - var20; + double var36 = p_151540_10_ - var22; + double var38 = p_151540_16_ - p_151540_15_; + double var40 = p_151540_12_ + 2.0F + 16.0F; + + if (var34 * var34 + var36 * var36 - var38 * var38 > var40 * var40) { + return; + } + + if (p_151540_6_ >= var20 - 16.0D - var54 * 2.0D && p_151540_10_ >= var22 - 16.0D - var54 * 2.0D && p_151540_6_ <= var20 + 16.0D + var54 * 2.0D && p_151540_10_ <= var22 + 16.0D + var54 * 2.0D) { + int var55 = MathHelper.floor_double(p_151540_6_ - var54) - p_151540_3_ * 16 - 1; + int var35 = MathHelper.floor_double(p_151540_6_ + var54) - p_151540_3_ * 16 + 1; + int var56 = MathHelper.floor_double(p_151540_8_ - var30) - 1; + int var37 = MathHelper.floor_double(p_151540_8_ + var30) + 1; + int var57 = MathHelper.floor_double(p_151540_10_ - var54) - p_151540_4_ * 16 - 1; + int var39 = MathHelper.floor_double(p_151540_10_ + var54) - p_151540_4_ * 16 + 1; + + if (var55 < 0) { + var55 = 0; + } + + if (var35 > 16) { + var35 = 16; + } + + if (var56 < 1) { + var56 = 1; + } + + if (var37 > 248) { + var37 = 248; + } + + if (var57 < 0) { + var57 = 0; + } + + if (var39 > 16) { + var39 = 16; + } + + boolean var58 = false; + int var41; + int var44; + + for (var41 = var55; !var58 && var41 < var35; ++var41) { + for (int var42 = var57; !var58 && var42 < var39; ++var42) { + for (int var43 = var37 + 1; !var58 && var43 >= var56 - 1; --var43) { + var44 = (var41 * 16 + var42) * 256 + var43; + + if (var43 >= 0 && var43 < 256) { + Block var45 = p_151540_5_[var44]; + + if (var45 == Blocks.flowing_water || var45 == Blocks.water) { + var58 = true; + } + + if (var43 != var56 - 1 && var41 != var55 && var41 != var35 - 1 && var42 != var57 && var42 != var39 - 1) { + var43 = var56; + } + } + } + } + } + + if (!var58) { + for (var41 = var55; var41 < var35; ++var41) { + double var59 = ((double)(var41 + p_151540_3_ * 16) + 0.5D - p_151540_6_) / var54; + + for (var44 = var57; var44 < var39; ++var44) { + double var60 = ((double)(var44 + p_151540_4_ * 16) + 0.5D - p_151540_10_) / var54; + int var47 = (var41 * 16 + var44) * 256 + var37; + boolean var48 = false; + + if (var59 * var59 + var60 * var60 < 1.0D) { + for (int var49 = var37 - 1; var49 >= var56; --var49) { + double var50 = ((double)var49 + 0.5D - p_151540_8_) / var30; + + if ((var59 * var59 + var60 * var60) * (double)this.field_75046_d[var49] + var50 * var50 / 6.0D < 1.0D) { + Block var52 = p_151540_5_[var47]; + + if (var52 == Blocks.grass) + { + var48 = true; + } + + if (var52 == Blocks.stone || var52 == Blocks.dirt || var52 == Blocks.grass) + { + if (var49 < 10) { + p_151540_5_[var47] = Blocks.flowing_lava; + } + else { + p_151540_5_[var47] = null; + + if (var48 && p_151540_5_[var47 - 1] == Blocks.dirt) { + p_151540_5_[var47 - 1] = this.worldObj.getBiomeGenForCoords(var41 + p_151540_3_ * 16, var44 + p_151540_4_ * 16).topBlock; + } + } + } + } + + --var47; + } + } + } + } + + if (var53) { + break; + } + } + } + } + } + } + + protected void func_151538_a(World p_151538_1_, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) { + if (this.rand.nextInt(50) == 0) { + double var7 = p_151538_2_ * 16 + this.rand.nextInt(16); + double var9 = this.rand.nextInt(this.rand.nextInt(40) + 8) + 20; + double var11 = p_151538_3_ * 16 + this.rand.nextInt(16); + byte var13 = 1; + + for (int var14 = 0; var14 < var13; ++var14) { + float var15 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float var16 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float var17 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F; + this.func_151540_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, var7, var9, var11, var17, var15, var16, 0, 0, 3.0D); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGenerator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGenerator.java new file mode 100644 index 0000000..067865b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGenerator.java @@ -0,0 +1,5 @@ +package net.minecraft.world.gen; + +public abstract class NoiseGenerator { + +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java new file mode 100644 index 0000000..f92262b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorImproved.java @@ -0,0 +1,190 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorImproved extends NoiseGenerator { + private final int[] permutations; + public double xCoord; + public double yCoord; + public double zCoord; + private static final double[] field_152381_e = new double[] {1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D}; + private static final double[] field_152382_f = new double[] {1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D}; + private static final double[] field_152383_g = new double[] {0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D}; + private static final double[] field_152384_h = new double[] {1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D}; + private static final double[] field_152385_i = new double[] {0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D}; + + + public NoiseGeneratorImproved() { + this(new Random()); + } + + public NoiseGeneratorImproved(Random p_i45469_1_) { + this.permutations = new int[512]; + this.xCoord = p_i45469_1_.nextDouble() * 256.0D; + this.yCoord = p_i45469_1_.nextDouble() * 256.0D; + this.zCoord = p_i45469_1_.nextDouble() * 256.0D; + int var2; + + for (var2 = 0; var2 < 256; this.permutations[var2] = var2++) { + } + + for (var2 = 0; var2 < 256; ++var2) { + int var3 = p_i45469_1_.nextInt(256 - var2) + var2; + int var4 = this.permutations[var2]; + this.permutations[var2] = this.permutations[var3]; + this.permutations[var3] = var4; + this.permutations[var2 + 256] = this.permutations[var2]; + } + } + + public final double lerp(double p_76311_1_, double p_76311_3_, double p_76311_5_) { + return p_76311_3_ + p_76311_1_ * (p_76311_5_ - p_76311_3_); + } + + public final double func_76309_a(int p_76309_1_, double p_76309_2_, double p_76309_4_) { + int var6 = p_76309_1_ & 15; + return field_152384_h[var6] * p_76309_2_ + field_152385_i[var6] * p_76309_4_; + } + + public final double grad(int p_76310_1_, double p_76310_2_, double p_76310_4_, double p_76310_6_) { + int var8 = p_76310_1_ & 15; + return field_152381_e[var8] * p_76310_2_ + field_152382_f[var8] * p_76310_4_ + field_152383_g[var8] * p_76310_6_; + } + + /** + * pars: noiseArray , xOffset , yOffset , zOffset , xSize , ySize , zSize , xScale, yScale , zScale , noiseScale. + * noiseArray should be xSize*ySize*zSize in size + */ + public void populateNoiseArray(double[] p_76308_1_, double p_76308_2_, double p_76308_4_, double p_76308_6_, int p_76308_8_, int p_76308_9_, int p_76308_10_, double p_76308_11_, double p_76308_13_, double p_76308_15_, double p_76308_17_) { + int var19; + int var22; + double var31; + double var35; + int var37; + double var38; + int var40; + int var41; + double var42; + int var75; + int var10001; + + if (p_76308_9_ == 1) { + boolean var64 = false; + boolean var65 = false; + boolean var21 = false; + boolean var68 = false; + double var70 = 0.0D; + double var73 = 0.0D; + var75 = 0; + double var77 = 1.0D / p_76308_17_; + + for (int var30 = 0; var30 < p_76308_8_; ++var30) { + var31 = p_76308_2_ + (double)var30 * p_76308_11_ + this.xCoord; + int var78 = (int)var31; + + if (var31 < (double)var78) { + --var78; + } + + int var34 = var78 & 255; + var31 -= var78; + var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D); + + for (var37 = 0; var37 < p_76308_10_; ++var37) { + var38 = p_76308_6_ + (double)var37 * p_76308_15_ + this.zCoord; + var40 = (int)var38; + + if (var38 < (double)var40) { + --var40; + } + + var41 = var40 & 255; + var38 -= var40; + var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D); + var19 = this.permutations[var34] + 0; + int var66 = this.permutations[var19] + var41; + int var67 = this.permutations[var34 + 1] + 0; + var22 = this.permutations[var67] + var41; + var70 = this.lerp(var35, this.func_76309_a(this.permutations[var66], var31, var38), this.grad(this.permutations[var22], var31 - 1.0D, 0.0D, var38)); + var73 = this.lerp(var35, this.grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), this.grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D)); + double var79 = this.lerp(var42, var70, var73); + var10001 = var75++; + p_76308_1_[var10001] += var79 * var77; + } + } + } else { + var19 = 0; + double var20 = 1.0D / p_76308_17_; + var22 = -1; + boolean var23 = false; + boolean var24 = false; + boolean var25 = false; + boolean var26 = false; + boolean var27 = false; + boolean var28 = false; + double var29 = 0.0D; + var31 = 0.0D; + double var33 = 0.0D; + var35 = 0.0D; + + for (var37 = 0; var37 < p_76308_8_; ++var37) { + var38 = p_76308_2_ + (double)var37 * p_76308_11_ + this.xCoord; + var40 = (int)var38; + + if (var38 < (double)var40) { + --var40; + } + + var41 = var40 & 255; + var38 -= var40; + var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D); + + for (int var44 = 0; var44 < p_76308_10_; ++var44) { + double var45 = p_76308_6_ + (double)var44 * p_76308_15_ + this.zCoord; + int var47 = (int)var45; + + if (var45 < (double)var47) { + --var47; + } + + int var48 = var47 & 255; + var45 -= var47; + double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D); + + for (int var51 = 0; var51 < p_76308_9_; ++var51) { + double var52 = p_76308_4_ + (double)var51 * p_76308_13_ + this.yCoord; + int var54 = (int)var52; + + if (var52 < (double)var54) { + --var54; + } + + int var55 = var54 & 255; + var52 -= var54; + double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D); + + if (var51 == 0 || var55 != var22) { + var22 = var55; + int var69 = this.permutations[var41] + var55; + int var71 = this.permutations[var69] + var48; + int var72 = this.permutations[var69 + 1] + var48; + int var74 = this.permutations[var41 + 1] + var55; + var75 = this.permutations[var74] + var48; + int var76 = this.permutations[var74 + 1] + var48; + var29 = this.lerp(var42, this.grad(this.permutations[var71], var38, var52, var45), this.grad(this.permutations[var75], var38 - 1.0D, var52, var45)); + var31 = this.lerp(var42, this.grad(this.permutations[var72], var38, var52 - 1.0D, var45), this.grad(this.permutations[var76], var38 - 1.0D, var52 - 1.0D, var45)); + var33 = this.lerp(var42, this.grad(this.permutations[var71 + 1], var38, var52, var45 - 1.0D), this.grad(this.permutations[var75 + 1], var38 - 1.0D, var52, var45 - 1.0D)); + var35 = this.lerp(var42, this.grad(this.permutations[var72 + 1], var38, var52 - 1.0D, var45 - 1.0D), this.grad(this.permutations[var76 + 1], var38 - 1.0D, var52 - 1.0D, var45 - 1.0D)); + } + + double var58 = this.lerp(var56, var29, var31); + double var60 = this.lerp(var56, var33, var35); + double var62 = this.lerp(var49, var58, var60); + var10001 = var19++; + p_76308_1_[var10001] += var62 * var20; + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java new file mode 100644 index 0000000..1d56bca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java @@ -0,0 +1,63 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.util.MathHelper; + +public class NoiseGeneratorOctaves extends NoiseGenerator { + /** + * Collection of noise generation functions. Output is combined to produce different octaves of noise. + */ + private final NoiseGeneratorImproved[] generatorCollection; + private final int octaves; + + + public NoiseGeneratorOctaves(Random p_i2111_1_, int p_i2111_2_) { + this.octaves = p_i2111_2_; + this.generatorCollection = new NoiseGeneratorImproved[p_i2111_2_]; + + for (int var3 = 0; var3 < p_i2111_2_; ++var3) { + this.generatorCollection[var3] = new NoiseGeneratorImproved(p_i2111_1_); + } + } + + /** + * pars:(par2,3,4=noiseOffset ; so that adjacent noise segments connect) (pars5,6,7=x,y,zArraySize),(pars8,10,12 = + * x,y,z noiseScale) + */ + public double[] generateNoiseOctaves(double[] p_76304_1_, int p_76304_2_, int p_76304_3_, int p_76304_4_, int p_76304_5_, int p_76304_6_, int p_76304_7_, double p_76304_8_, double p_76304_10_, double p_76304_12_) { + if (p_76304_1_ == null) { + p_76304_1_ = new double[p_76304_5_ * p_76304_6_ * p_76304_7_]; + } else { + for (int var14 = 0; var14 < p_76304_1_.length; ++var14) { + p_76304_1_[var14] = 0.0D; + } + } + + double var27 = 1.0D; + + for (int var16 = 0; var16 < this.octaves; ++var16) { + double var17 = (double)p_76304_2_ * var27 * p_76304_8_; + double var19 = (double)p_76304_3_ * var27 * p_76304_10_; + double var21 = (double)p_76304_4_ * var27 * p_76304_12_; + long var23 = MathHelper.floor_double_long(var17); + long var25 = MathHelper.floor_double_long(var21); + var17 -= (double)var23; + var21 -= (double)var25; + var23 %= 16777216L; + var25 %= 16777216L; + var17 += (double)var23; + var21 += (double)var25; + this.generatorCollection[var16].populateNoiseArray(p_76304_1_, var17, var19, var21, p_76304_5_, p_76304_6_, p_76304_7_, p_76304_8_ * var27, p_76304_10_ * var27, p_76304_12_ * var27, var27); + var27 /= 2.0D; + } + + return p_76304_1_; + } + + /** + * Bouncer function to the main one with some default arguments. + */ + public double[] generateNoiseOctaves(double[] p_76305_1_, int p_76305_2_, int p_76305_3_, int p_76305_4_, int p_76305_5_, double p_76305_6_, double p_76305_8_, double p_76305_10_) { + return this.generateNoiseOctaves(p_76305_1_, p_76305_2_, 10, p_76305_3_, p_76305_4_, 1, p_76305_5_, p_76305_6_, 1.0D, p_76305_8_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java new file mode 100644 index 0000000..ab7a3fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java @@ -0,0 +1,55 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorPerlin extends NoiseGenerator { + private final NoiseGeneratorSimplex[] field_151603_a; + private final int field_151602_b; + + + public NoiseGeneratorPerlin(Random p_i45470_1_, int p_i45470_2_) { + this.field_151602_b = p_i45470_2_; + this.field_151603_a = new NoiseGeneratorSimplex[p_i45470_2_]; + + for (int var3 = 0; var3 < p_i45470_2_; ++var3) { + this.field_151603_a[var3] = new NoiseGeneratorSimplex(p_i45470_1_); + } + } + + public double func_151601_a(double p_151601_1_, double p_151601_3_) { + double var5 = 0.0D; + double var7 = 1.0D; + + for (int var9 = 0; var9 < this.field_151602_b; ++var9) { + var5 += this.field_151603_a[var9].func_151605_a(p_151601_1_ * var7, p_151601_3_ * var7) / var7; + var7 /= 2.0D; + } + + return var5; + } + + public double[] func_151599_a(double[] p_151599_1_, double p_151599_2_, double p_151599_4_, int p_151599_6_, int p_151599_7_, double p_151599_8_, double p_151599_10_, double p_151599_12_) { + return this.func_151600_a(p_151599_1_, p_151599_2_, p_151599_4_, p_151599_6_, p_151599_7_, p_151599_8_, p_151599_10_, p_151599_12_, 0.5D); + } + + public double[] func_151600_a(double[] p_151600_1_, double p_151600_2_, double p_151600_4_, int p_151600_6_, int p_151600_7_, double p_151600_8_, double p_151600_10_, double p_151600_12_, double p_151600_14_) { + if (p_151600_1_ != null && p_151600_1_.length >= p_151600_6_ * p_151600_7_) { + for (int var16 = 0; var16 < p_151600_1_.length; ++var16) { + p_151600_1_[var16] = 0.0D; + } + } else { + p_151600_1_ = new double[p_151600_6_ * p_151600_7_]; + } + + double var21 = 1.0D; + double var18 = 1.0D; + + for (int var20 = 0; var20 < this.field_151602_b; ++var20) { + this.field_151603_a[var20].func_151606_a(p_151600_1_, p_151600_2_, p_151600_4_, p_151600_6_, p_151600_7_, p_151600_8_ * var18 * var21, p_151600_10_ * var18 * var21, 0.55D / var21); + var18 *= p_151600_12_; + var21 *= p_151600_14_; + } + + return p_151600_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java new file mode 100644 index 0000000..cc0f6b5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java @@ -0,0 +1,182 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorSimplex { + private static final int[][] field_151611_e = new int[][] {{1, 1, 0}, { -1, 1, 0}, {1, -1, 0}, { -1, -1, 0}, {1, 0, 1}, { -1, 0, 1}, {1, 0, -1}, { -1, 0, -1}, {0, 1, 1}, {0, -1, 1}, {0, 1, -1}, {0, -1, -1}}; + public static final double field_151614_a = Math.sqrt(3.0D); + private final int[] field_151608_f; + public double field_151612_b; + public double field_151613_c; + public double field_151610_d; + private static final double field_151609_g = 0.5D * (field_151614_a - 1.0D); + private static final double field_151615_h = (3.0D - field_151614_a) / 6.0D; + + + public NoiseGeneratorSimplex() { + this(new Random()); + } + + public NoiseGeneratorSimplex(Random p_i45471_1_) { + this.field_151608_f = new int[512]; + this.field_151612_b = p_i45471_1_.nextDouble() * 256.0D; + this.field_151613_c = p_i45471_1_.nextDouble() * 256.0D; + this.field_151610_d = p_i45471_1_.nextDouble() * 256.0D; + int var2; + + for (var2 = 0; var2 < 256; this.field_151608_f[var2] = var2++) { + } + + for (var2 = 0; var2 < 256; ++var2) { + int var3 = p_i45471_1_.nextInt(256 - var2) + var2; + int var4 = this.field_151608_f[var2]; + this.field_151608_f[var2] = this.field_151608_f[var3]; + this.field_151608_f[var3] = var4; + this.field_151608_f[var2 + 256] = this.field_151608_f[var2]; + } + } + + private static int func_151607_a(double p_151607_0_) { + return p_151607_0_ > 0.0D ? (int)p_151607_0_ : (int)p_151607_0_ - 1; + } + + private static double func_151604_a(int[] p_151604_0_, double p_151604_1_, double p_151604_3_) { + return (double)p_151604_0_[0] * p_151604_1_ + (double)p_151604_0_[1] * p_151604_3_; + } + + public double func_151605_a(double p_151605_1_, double p_151605_3_) { + double var11 = 0.5D * (field_151614_a - 1.0D); + double var13 = (p_151605_1_ + p_151605_3_) * var11; + int var15 = func_151607_a(p_151605_1_ + var13); + int var16 = func_151607_a(p_151605_3_ + var13); + double var17 = (3.0D - field_151614_a) / 6.0D; + double var19 = (double)(var15 + var16) * var17; + double var21 = (double)var15 - var19; + double var23 = (double)var16 - var19; + double var25 = p_151605_1_ - var21; + double var27 = p_151605_3_ - var23; + byte var29; + byte var30; + + if (var25 > var27) { + var29 = 1; + var30 = 0; + } else { + var29 = 0; + var30 = 1; + } + + double var31 = var25 - (double)var29 + var17; + double var33 = var27 - (double)var30 + var17; + double var35 = var25 - 1.0D + 2.0D * var17; + double var37 = var27 - 1.0D + 2.0D * var17; + int var39 = var15 & 255; + int var40 = var16 & 255; + int var41 = this.field_151608_f[var39 + this.field_151608_f[var40]] % 12; + int var42 = this.field_151608_f[var39 + var29 + this.field_151608_f[var40 + var30]] % 12; + int var43 = this.field_151608_f[var39 + 1 + this.field_151608_f[var40 + 1]] % 12; + double var44 = 0.5D - var25 * var25 - var27 * var27; + double var5; + + if (var44 < 0.0D) { + var5 = 0.0D; + } else { + var44 *= var44; + var5 = var44 * var44 * func_151604_a(field_151611_e[var41], var25, var27); + } + + double var46 = 0.5D - var31 * var31 - var33 * var33; + double var7; + + if (var46 < 0.0D) { + var7 = 0.0D; + } else { + var46 *= var46; + var7 = var46 * var46 * func_151604_a(field_151611_e[var42], var31, var33); + } + + double var48 = 0.5D - var35 * var35 - var37 * var37; + double var9; + + if (var48 < 0.0D) { + var9 = 0.0D; + } else { + var48 *= var48; + var9 = var48 * var48 * func_151604_a(field_151611_e[var43], var35, var37); + } + + return 70.0D * (var5 + var7 + var9); + } + + public void func_151606_a(double[] p_151606_1_, double p_151606_2_, double p_151606_4_, int p_151606_6_, int p_151606_7_, double p_151606_8_, double p_151606_10_, double p_151606_12_) { + int var14 = 0; + + for (int var15 = 0; var15 < p_151606_7_; ++var15) { + double var16 = (p_151606_4_ + (double)var15) * p_151606_10_ + this.field_151613_c; + + for (int var18 = 0; var18 < p_151606_6_; ++var18) { + double var19 = (p_151606_2_ + (double)var18) * p_151606_8_ + this.field_151612_b; + double var27 = (var19 + var16) * field_151609_g; + int var29 = func_151607_a(var19 + var27); + int var30 = func_151607_a(var16 + var27); + double var31 = (double)(var29 + var30) * field_151615_h; + double var33 = (double)var29 - var31; + double var35 = (double)var30 - var31; + double var37 = var19 - var33; + double var39 = var16 - var35; + byte var41; + byte var42; + + if (var37 > var39) { + var41 = 1; + var42 = 0; + } else { + var41 = 0; + var42 = 1; + } + + double var43 = var37 - (double)var41 + field_151615_h; + double var45 = var39 - (double)var42 + field_151615_h; + double var47 = var37 - 1.0D + 2.0D * field_151615_h; + double var49 = var39 - 1.0D + 2.0D * field_151615_h; + int var51 = var29 & 255; + int var52 = var30 & 255; + int var53 = this.field_151608_f[var51 + this.field_151608_f[var52]] % 12; + int var54 = this.field_151608_f[var51 + var41 + this.field_151608_f[var52 + var42]] % 12; + int var55 = this.field_151608_f[var51 + 1 + this.field_151608_f[var52 + 1]] % 12; + double var56 = 0.5D - var37 * var37 - var39 * var39; + double var21; + + if (var56 < 0.0D) { + var21 = 0.0D; + } else { + var56 *= var56; + var21 = var56 * var56 * func_151604_a(field_151611_e[var53], var37, var39); + } + + double var58 = 0.5D - var43 * var43 - var45 * var45; + double var23; + + if (var58 < 0.0D) { + var23 = 0.0D; + } else { + var58 *= var58; + var23 = var58 * var58 * func_151604_a(field_151611_e[var54], var43, var45); + } + + double var60 = 0.5D - var47 * var47 - var49 * var49; + double var25; + + if (var60 < 0.0D) { + var25 = 0.0D; + } else { + var60 *= var60; + var25 = var60 * var60 * func_151604_a(field_151611_e[var55], var47, var49); + } + + int var10001 = var14++; + p_151606_1_[var10001] += 70.0D * (var21 + var23 + var25) * p_151606_12_; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java new file mode 100644 index 0000000..2eeaf2b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java @@ -0,0 +1,21 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public abstract class WorldGenAbstractTree extends WorldGenerator { + + + public WorldGenAbstractTree(boolean p_i45448_1_) { + super(p_i45448_1_); + } + + protected boolean func_150523_a(Block p_150523_1_) { + return p_150523_1_.getMaterial() == Material.air || p_150523_1_.getMaterial() == Material.leaves || p_150523_1_ == Blocks.grass || p_150523_1_ == Blocks.dirt || p_150523_1_ == Blocks.log || p_150523_1_ == Blocks.log2 || p_150523_1_ == Blocks.sapling || p_150523_1_ == Blocks.vine; + } + + public void func_150524_b(World p_150524_1_, Random p_150524_2_, int p_150524_3_, int p_150524_4_, int p_150524_5_) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java new file mode 100644 index 0000000..6139c03 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -0,0 +1,168 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenBigMushroom extends WorldGenerator { + /** The mushroom type. 0 for brown, 1 for red. */ + private int mushroomType = -1; + + + public WorldGenBigMushroom(int p_i2017_1_) { + super(true); + this.mushroomType = p_i2017_1_; + } + + public WorldGenBigMushroom() { + super(false); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_2_.nextInt(2); + + if (this.mushroomType >= 0) { + var6 = this.mushroomType; + } + + int var7 = p_76484_2_.nextInt(3) + 4; + boolean var8 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var7 + 1 < 256) { + int var11; + int var12; + + for (int var9 = p_76484_4_; var9 <= p_76484_4_ + 1 + var7; ++var9) { + byte var10 = 3; + + if (var9 <= p_76484_4_ + 3) { + var10 = 0; + } + + for (var11 = p_76484_3_ - var10; var11 <= p_76484_3_ + var10 && var8; ++var11) { + for (var12 = p_76484_5_ - var10; var12 <= p_76484_5_ + var10 && var8; ++var12) { + if (var9 >= 0 && var9 < 256) { + Block var13 = p_76484_1_.getBlock(var11, var9, var12); + + if (var13.getMaterial() != Material.air && var13.getMaterial() != Material.leaves) { + var8 = false; + } + } else { + var8 = false; + } + } + } + } + + if (!var8) { + return false; + } else { + Block var16 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if (var16 != Blocks.dirt && var16 != Blocks.grass && var16 != Blocks.mycelium) { + return false; + } else { + int var17 = p_76484_4_ + var7; + + if (var6 == 1) { + var17 = p_76484_4_ + var7 - 3; + } + + for (var11 = var17; var11 <= p_76484_4_ + var7; ++var11) { + var12 = 1; + + if (var11 < p_76484_4_ + var7) { + ++var12; + } + + if (var6 == 0) { + var12 = 3; + } + + for (int var19 = p_76484_3_ - var12; var19 <= p_76484_3_ + var12; ++var19) { + for (int var14 = p_76484_5_ - var12; var14 <= p_76484_5_ + var12; ++var14) { + int var15 = 5; + + if (var19 == p_76484_3_ - var12) { + --var15; + } + + if (var19 == p_76484_3_ + var12) { + ++var15; + } + + if (var14 == p_76484_5_ - var12) { + var15 -= 3; + } + + if (var14 == p_76484_5_ + var12) { + var15 += 3; + } + + if (var6 == 0 || var11 < p_76484_4_ + var7) { + if ((var19 == p_76484_3_ - var12 || var19 == p_76484_3_ + var12) && (var14 == p_76484_5_ - var12 || var14 == p_76484_5_ + var12)) { + continue; + } + + if (var19 == p_76484_3_ - (var12 - 1) && var14 == p_76484_5_ - var12) { + var15 = 1; + } + + if (var19 == p_76484_3_ - var12 && var14 == p_76484_5_ - (var12 - 1)) { + var15 = 1; + } + + if (var19 == p_76484_3_ + (var12 - 1) && var14 == p_76484_5_ - var12) { + var15 = 3; + } + + if (var19 == p_76484_3_ + var12 && var14 == p_76484_5_ - (var12 - 1)) { + var15 = 3; + } + + if (var19 == p_76484_3_ - (var12 - 1) && var14 == p_76484_5_ + var12) { + var15 = 7; + } + + if (var19 == p_76484_3_ - var12 && var14 == p_76484_5_ + (var12 - 1)) { + var15 = 7; + } + + if (var19 == p_76484_3_ + (var12 - 1) && var14 == p_76484_5_ + var12) { + var15 = 9; + } + + if (var19 == p_76484_3_ + var12 && var14 == p_76484_5_ + (var12 - 1)) { + var15 = 9; + } + } + + if (var15 == 5 && var11 < p_76484_4_ + var7) { + var15 = 0; + } + + if ((var15 != 0 || p_76484_4_ >= p_76484_4_ + var7 - 1) && !p_76484_1_.getBlock(var19, var11, var14).func_149730_j()) { + this.func_150516_a(p_76484_1_, var19, var11, var14, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + var6), var15); + } + } + } + } + + for (var11 = 0; var11 < var7; ++var11) { + Block var18 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var11, p_76484_5_); + + if (!var18.func_149730_j()) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var11, p_76484_5_, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + var6), 10); + } + } + + return true; + } + } + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java new file mode 100644 index 0000000..93714c0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java @@ -0,0 +1,429 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenBigTree extends WorldGenAbstractTree { + /** + * Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 + * and 2 for 1, and 0 and 1 for 2. + */ + static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1}; + + /** random seed for GenBigTree */ + Random rand = new Random(); + + /** Reference to the World object. */ + World worldObj; + int[] basePos = new int[] {0, 0, 0}; + int heightLimit; + int height; + double heightAttenuation = 0.618D; + double branchDensity = 1.0D; + double branchSlope = 0.381D; + double scaleWidth = 1.0D; + double leafDensity = 1.0D; + + /** + * Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. + */ + int trunkSize = 1; + + /** + * Sets the limit of the random value used to initialize the height limit. + */ + int heightLimitLimit = 12; + + /** + * Sets the distance limit for how far away the generator will populate leaves from the base leaf node. + */ + int leafDistanceLimit = 4; + + /** Contains a list of a points at which to generate groups of leaves. */ + int[][] leafNodes; + + + public WorldGenBigTree(boolean p_i2008_1_) { + super(p_i2008_1_); + } + + /** + * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. + */ + void generateLeafNodeList() { + this.height = (int)((double)this.heightLimit * this.heightAttenuation); + + if (this.height >= this.heightLimit) { + this.height = this.heightLimit - 1; + } + + int var1 = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D)); + + if (var1 < 1) { + var1 = 1; + } + + int[][] var2 = new int[var1 * this.heightLimit][4]; + int var3 = this.basePos[1] + this.heightLimit - this.leafDistanceLimit; + int var4 = 1; + int var5 = this.basePos[1] + this.height; + int var6 = var3 - this.basePos[1]; + var2[0][0] = this.basePos[0]; + var2[0][1] = var3; + var2[0][2] = this.basePos[2]; + var2[0][3] = var5; + --var3; + + while (var6 >= 0) { + int var7 = 0; + float var8 = this.layerSize(var6); + + if (var8 < 0.0F) { + --var3; + --var6; + } else { + for (double var9 = 0.5D; var7 < var1; ++var7) { + double var11 = this.scaleWidth * (double)var8 * ((double)this.rand.nextFloat() + 0.328D); + double var13 = (double)this.rand.nextFloat() * 2.0D * Math.PI; + int var15 = MathHelper.floor_double(var11 * Math.sin(var13) + (double)this.basePos[0] + var9); + int var16 = MathHelper.floor_double(var11 * Math.cos(var13) + (double)this.basePos[2] + var9); + int[] var17 = new int[] {var15, var3, var16}; + int[] var18 = new int[] {var15, var3 + this.leafDistanceLimit, var16}; + + if (this.checkBlockLine(var17, var18) == -1) { + int[] var19 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; + double var20 = Math.sqrt(Math.pow(Math.abs(this.basePos[0] - var17[0]), 2.0D) + Math.pow(Math.abs(this.basePos[2] - var17[2]), 2.0D)); + double var22 = var20 * this.branchSlope; + + if ((double)var17[1] - var22 > (double)var5) { + var19[1] = var5; + } else { + var19[1] = (int)((double)var17[1] - var22); + } + + if (this.checkBlockLine(var19, var17) == -1) { + var2[var4][0] = var15; + var2[var4][1] = var3; + var2[var4][2] = var16; + var2[var4][3] = var19[1]; + ++var4; + } + } + } + + --var3; + --var6; + } + } + + this.leafNodes = new int[var4][4]; + System.arraycopy(var2, 0, this.leafNodes, 0, var4); + } + + void func_150529_a(int p_150529_1_, int p_150529_2_, int p_150529_3_, float p_150529_4_, byte p_150529_5_, Block p_150529_6_) { + int var7 = (int)((double)p_150529_4_ + 0.618D); + byte var8 = otherCoordPairs[p_150529_5_]; + byte var9 = otherCoordPairs[p_150529_5_ + 3]; + int[] var10 = new int[] {p_150529_1_, p_150529_2_, p_150529_3_}; + int[] var11 = new int[] {0, 0, 0}; + int var12 = -var7; + int var13 = -var7; + + for (var11[p_150529_5_] = var10[p_150529_5_]; var12 <= var7; ++var12) { + var11[var8] = var10[var8] + var12; + var13 = -var7; + + while (var13 <= var7) { + double var15 = Math.pow((double)Math.abs(var12) + 0.5D, 2.0D) + Math.pow((double)Math.abs(var13) + 0.5D, 2.0D); + + if (var15 > (double)(p_150529_4_ * p_150529_4_)) { + ++var13; + } else { + var11[var9] = var10[var9] + var13; + Block var14 = this.worldObj.getBlock(var11[0], var11[1], var11[2]); + + if (var14.getMaterial() != Material.air && var14.getMaterial() != Material.leaves) { + ++var13; + } else { + this.func_150516_a(this.worldObj, var11[0], var11[1], var11[2], p_150529_6_, 0); + ++var13; + } + } + } + } + } + + /** + * Gets the rough size of a layer of the tree. + */ + float layerSize(int p_76490_1_) { + if ((double)p_76490_1_ < (double)((float)this.heightLimit) * 0.3D) { + return -1.618F; + } else { + float var2 = (float)this.heightLimit / 2.0F; + float var3 = (float)this.heightLimit / 2.0F - (float)p_76490_1_; + float var4; + + if (var3 == 0.0F) { + var4 = var2; + } else if (Math.abs(var3) >= var2) { + var4 = 0.0F; + } else { + var4 = (float)Math.sqrt(Math.pow(Math.abs(var2), 2.0D) - Math.pow(Math.abs(var3), 2.0D)); + } + + var4 *= 0.5F; + return var4; + } + } + + float leafSize(int p_76495_1_) { + return p_76495_1_ >= 0 && p_76495_1_ < this.leafDistanceLimit ? (p_76495_1_ != 0 && p_76495_1_ != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; + } + + /** + * Generates the leaves surrounding an individual entry in the leafNodes list. + */ + void generateLeafNode(int p_76491_1_, int p_76491_2_, int p_76491_3_) { + int var4 = p_76491_2_; + + for (int var5 = p_76491_2_ + this.leafDistanceLimit; var4 < var5; ++var4) { + float var6 = this.leafSize(var4 - p_76491_2_); + this.func_150529_a(p_76491_1_, var4, p_76491_3_, var6, (byte)1, Blocks.leaves); + } + } + + void func_150530_a(int[] p_150530_1_, int[] p_150530_2_, Block p_150530_3_) { + int[] var4 = new int[] {0, 0, 0}; + byte var5 = 0; + byte var6; + + for (var6 = 0; var5 < 3; ++var5) { + var4[var5] = p_150530_2_[var5] - p_150530_1_[var5]; + + if (Math.abs(var4[var5]) > Math.abs(var4[var6])) { + var6 = var5; + } + } + + if (var4[var6] != 0) { + byte var7 = otherCoordPairs[var6]; + byte var8 = otherCoordPairs[var6 + 3]; + byte var9; + + if (var4[var6] > 0) { + var9 = 1; + } else { + var9 = -1; + } + + double var10 = (double)var4[var7] / (double)var4[var6]; + double var12 = (double)var4[var8] / (double)var4[var6]; + int[] var14 = new int[] {0, 0, 0}; + int var15 = 0; + + for (int var16 = var4[var6] + var9; var15 != var16; var15 += var9) { + var14[var6] = MathHelper.floor_double((double)(p_150530_1_[var6] + var15) + 0.5D); + var14[var7] = MathHelper.floor_double((double)p_150530_1_[var7] + (double)var15 * var10 + 0.5D); + var14[var8] = MathHelper.floor_double((double)p_150530_1_[var8] + (double)var15 * var12 + 0.5D); + byte var17 = 0; + int var18 = Math.abs(var14[0] - p_150530_1_[0]); + int var19 = Math.abs(var14[2] - p_150530_1_[2]); + int var20 = Math.max(var18, var19); + + if (var20 > 0) { + if (var18 == var20) { + var17 = 4; + } else if (var19 == var20) { + var17 = 8; + } + } + + this.func_150516_a(this.worldObj, var14[0], var14[1], var14[2], p_150530_3_, var17); + } + } + } + + /** + * Generates the leaf portion of the tree as specified by the leafNodes list. + */ + void generateLeaves() { + int var1 = 0; + + for (int var2 = this.leafNodes.length; var1 < var2; ++var1) { + int var3 = this.leafNodes[var1][0]; + int var4 = this.leafNodes[var1][1]; + int var5 = this.leafNodes[var1][2]; + this.generateLeafNode(var3, var4, var5); + } + } + + /** + * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. + */ + boolean leafNodeNeedsBase(int p_76493_1_) { + return (double)p_76493_1_ >= (double)this.heightLimit * 0.2D; + } + + /** + * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a + * field that is always 1 to 2. + */ + void generateTrunk() { + int var1 = this.basePos[0]; + int var2 = this.basePos[1]; + int var3 = this.basePos[1] + this.height; + int var4 = this.basePos[2]; + int[] var5 = new int[] {var1, var2, var4}; + int[] var6 = new int[] {var1, var3, var4}; + this.func_150530_a(var5, var6, Blocks.log); + + if (this.trunkSize == 2) { + ++var5[0]; + ++var6[0]; + this.func_150530_a(var5, var6, Blocks.log); + ++var5[2]; + ++var6[2]; + this.func_150530_a(var5, var6, Blocks.log); + var5[0] += -1; + var6[0] += -1; + this.func_150530_a(var5, var6, Blocks.log); + } + } + + /** + * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. + */ + void generateLeafNodeBases() { + int var1 = 0; + int var2 = this.leafNodes.length; + + for (int[] var3 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; var1 < var2; ++var1) { + int[] var4 = this.leafNodes[var1]; + int[] var5 = new int[] {var4[0], var4[1], var4[2]}; + var3[1] = var4[3]; + int var6 = var3[1] - this.basePos[1]; + + if (this.leafNodeNeedsBase(var6)) { + this.func_150530_a(var3, var5, Blocks.log); + } + } + } + + /** + * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance + * (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. + */ + int checkBlockLine(int[] p_76496_1_, int[] p_76496_2_) { + int[] var3 = new int[] {0, 0, 0}; + byte var4 = 0; + byte var5; + + for (var5 = 0; var4 < 3; ++var4) { + var3[var4] = p_76496_2_[var4] - p_76496_1_[var4]; + + if (Math.abs(var3[var4]) > Math.abs(var3[var5])) { + var5 = var4; + } + } + + if (var3[var5] == 0) { + return -1; + } else { + byte var6 = otherCoordPairs[var5]; + byte var7 = otherCoordPairs[var5 + 3]; + byte var8; + + if (var3[var5] > 0) { + var8 = 1; + } else { + var8 = -1; + } + + double var9 = (double)var3[var6] / (double)var3[var5]; + double var11 = (double)var3[var7] / (double)var3[var5]; + int[] var13 = new int[] {0, 0, 0}; + int var14 = 0; + int var15; + + for (var15 = var3[var5] + var8; var14 != var15; var14 += var8) { + var13[var5] = p_76496_1_[var5] + var14; + var13[var6] = MathHelper.floor_double((double)p_76496_1_[var6] + (double)var14 * var9); + var13[var7] = MathHelper.floor_double((double)p_76496_1_[var7] + (double)var14 * var11); + Block var16 = this.worldObj.getBlock(var13[0], var13[1], var13[2]); + + if (!this.func_150523_a(var16)) { + break; + } + } + + return var14 == var15 ? -1 : Math.abs(var14); + } + } + + /** + * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height + * limit, is valid. + */ + boolean validTreeLocation() { + int[] var1 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; + int[] var2 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; + Block var3 = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); + + if (var3 != Blocks.dirt && var3 != Blocks.grass && var3 != Blocks.farmland) { + return false; + } else { + int var4 = this.checkBlockLine(var1, var2); + + if (var4 == -1) { + return true; + } else if (var4 < 6) { + return false; + } else { + this.heightLimit = var4; + return true; + } + } + } + + /** + * Rescales the generator settings, only used in WorldGenBigTree + */ + public void setScale(double p_76487_1_, double p_76487_3_, double p_76487_5_) { + this.heightLimitLimit = (int)(p_76487_1_ * 12.0D); + + if (p_76487_1_ > 0.5D) { + this.leafDistanceLimit = 5; + } + + this.scaleWidth = p_76487_3_; + this.leafDensity = p_76487_5_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + this.worldObj = p_76484_1_; + long var6 = p_76484_2_.nextLong(); + this.rand.setSeed(var6); + this.basePos[0] = p_76484_3_; + this.basePos[1] = p_76484_4_; + this.basePos[2] = p_76484_5_; + + if (this.heightLimit == 0) { + this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); + } + + if (!this.validTreeLocation()) { + return false; + } else { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java new file mode 100644 index 0000000..8da9fca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java @@ -0,0 +1,70 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenBlockBlob extends WorldGenerator { + private final Block field_150545_a; + private final int field_150544_b; + + + public WorldGenBlockBlob(Block p_i45450_1_, int p_i45450_2_) { + super(false); + this.field_150545_a = p_i45450_1_; + this.field_150544_b = p_i45450_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + while (true) { + if (p_76484_4_ > 3) { + label63: { + if (!p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_)) { + Block var6 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if (var6 == Blocks.grass || var6 == Blocks.dirt || var6 == Blocks.stone) { + break label63; + } + } + + --p_76484_4_; + continue; + } + } + + if (p_76484_4_ <= 3) { + return false; + } + + int var18 = this.field_150544_b; + + for (int var7 = 0; var18 >= 0 && var7 < 3; ++var7) { + int var8 = var18 + p_76484_2_.nextInt(2); + int var9 = var18 + p_76484_2_.nextInt(2); + int var10 = var18 + p_76484_2_.nextInt(2); + float var11 = (float)(var8 + var9 + var10) * 0.333F + 0.5F; + + for (int var12 = p_76484_3_ - var8; var12 <= p_76484_3_ + var8; ++var12) { + for (int var13 = p_76484_5_ - var10; var13 <= p_76484_5_ + var10; ++var13) { + for (int var14 = p_76484_4_ - var9; var14 <= p_76484_4_ + var9; ++var14) { + float var15 = (float)(var12 - p_76484_3_); + float var16 = (float)(var13 - p_76484_5_); + float var17 = (float)(var14 - p_76484_4_); + + if (var15 * var15 + var16 * var16 + var17 * var17 <= var11 * var11) { + p_76484_1_.setBlock(var12, var14, var13, this.field_150545_a, 0, 4); + } + } + } + } + + p_76484_3_ += -(var18 + 1) + p_76484_2_.nextInt(2 + var18 * 2); + p_76484_5_ += -(var18 + 1) + p_76484_2_.nextInt(2 + var18 * 2); + p_76484_4_ += 0 - p_76484_2_.nextInt(2); + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java new file mode 100644 index 0000000..e7b43fe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java @@ -0,0 +1,29 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenCactus extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + for (int var6 = 0; var6 < 10; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var7, var8, var9)) { + int var10 = 1 + p_76484_2_.nextInt(p_76484_2_.nextInt(3) + 1); + + for (int var11 = 0; var11 < var10; ++var11) { + if (Blocks.cactus.canBlockStay(p_76484_1_, var7, var8 + var11, var9)) { + p_76484_1_.setBlock(var7, var8 + var11, var9, Blocks.cactus, 0, 2); + } + } + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java new file mode 100644 index 0000000..d513856 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java @@ -0,0 +1,169 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; + +public class WorldGenCanopyTree extends WorldGenAbstractTree { + + + public WorldGenCanopyTree(boolean p_i45461_1_) { + super(p_i45461_1_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_2_.nextInt(3) + p_76484_2_.nextInt(2) + 6; + boolean var7 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var6 + 1 <= 256) { + int var10; + int var11; + + for (int var8 = p_76484_4_; var8 <= p_76484_4_ + 1 + var6; ++var8) { + byte var9 = 1; + + if (var8 == p_76484_4_) { + var9 = 0; + } + + if (var8 >= p_76484_4_ + 1 + var6 - 2) { + var9 = 2; + } + + for (var10 = p_76484_3_ - var9; var10 <= p_76484_3_ + var9 && var7; ++var10) { + for (var11 = p_76484_5_ - var9; var11 <= p_76484_5_ + var9 && var7; ++var11) { + if (var8 >= 0 && var8 < 256) { + Block var12 = p_76484_1_.getBlock(var10, var8, var11); + + if (!this.func_150523_a(var12)) { + var7 = false; + } + } else { + var7 = false; + } + } + } + } + + if (!var7) { + return false; + } else { + Block var20 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if ((var20 == Blocks.grass || var20 == Blocks.dirt) && p_76484_4_ < 256 - var6 - 1) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + this.func_150515_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + this.func_150515_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_ + 1, Blocks.dirt); + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_ + 1, Blocks.dirt); + int var21 = p_76484_2_.nextInt(4); + var10 = var6 - p_76484_2_.nextInt(4); + var11 = 2 - p_76484_2_.nextInt(3); + int var22 = p_76484_3_; + int var13 = p_76484_5_; + int var14 = 0; + int var15; + int var16; + + for (var15 = 0; var15 < var6; ++var15) { + var16 = p_76484_4_ + var15; + + if (var15 >= var10 && var11 > 0) { + var22 += Direction.offsetX[var21]; + var13 += Direction.offsetZ[var21]; + --var11; + } + + Block var17 = p_76484_1_.getBlock(var22, var16, var13); + + if (var17.getMaterial() == Material.air || var17.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, var22, var16, var13, Blocks.log2, 1); + this.func_150516_a(p_76484_1_, var22 + 1, var16, var13, Blocks.log2, 1); + this.func_150516_a(p_76484_1_, var22, var16, var13 + 1, Blocks.log2, 1); + this.func_150516_a(p_76484_1_, var22 + 1, var16, var13 + 1, Blocks.log2, 1); + var14 = var16; + } + } + + for (var15 = -2; var15 <= 0; ++var15) { + for (var16 = -2; var16 <= 0; ++var16) { + byte var23 = -1; + this.func_150526_a(p_76484_1_, var22 + var15, var14 + var23, var13 + var16); + this.func_150526_a(p_76484_1_, 1 + var22 - var15, var14 + var23, var13 + var16); + this.func_150526_a(p_76484_1_, var22 + var15, var14 + var23, 1 + var13 - var16); + this.func_150526_a(p_76484_1_, 1 + var22 - var15, var14 + var23, 1 + var13 - var16); + + if ((var15 > -2 || var16 > -1) && (var15 != -1 || var16 != -2)) { + byte var24 = 1; + this.func_150526_a(p_76484_1_, var22 + var15, var14 + var24, var13 + var16); + this.func_150526_a(p_76484_1_, 1 + var22 - var15, var14 + var24, var13 + var16); + this.func_150526_a(p_76484_1_, var22 + var15, var14 + var24, 1 + var13 - var16); + this.func_150526_a(p_76484_1_, 1 + var22 - var15, var14 + var24, 1 + var13 - var16); + } + } + } + + if (p_76484_2_.nextBoolean()) { + this.func_150526_a(p_76484_1_, var22, var14 + 2, var13); + this.func_150526_a(p_76484_1_, var22 + 1, var14 + 2, var13); + this.func_150526_a(p_76484_1_, var22 + 1, var14 + 2, var13 + 1); + this.func_150526_a(p_76484_1_, var22, var14 + 2, var13 + 1); + } + + for (var15 = -3; var15 <= 4; ++var15) { + for (var16 = -3; var16 <= 4; ++var16) { + if ((var15 != -3 || var16 != -3) && (var15 != -3 || var16 != 4) && (var15 != 4 || var16 != -3) && (var15 != 4 || var16 != 4) && (Math.abs(var15) < 3 || Math.abs(var16) < 3)) { + this.func_150526_a(p_76484_1_, var22 + var15, var14, var13 + var16); + } + } + } + + for (var15 = -1; var15 <= 2; ++var15) { + for (var16 = -1; var16 <= 2; ++var16) { + if ((var15 < 0 || var15 > 1 || var16 < 0 || var16 > 1) && p_76484_2_.nextInt(3) <= 0) { + int var25 = p_76484_2_.nextInt(3) + 2; + int var18; + + for (var18 = 0; var18 < var25; ++var18) { + this.func_150516_a(p_76484_1_, p_76484_3_ + var15, var14 - var18 - 1, p_76484_5_ + var16, Blocks.log2, 1); + } + + int var19; + + for (var18 = -1; var18 <= 1; ++var18) { + for (var19 = -1; var19 <= 1; ++var19) { + this.func_150526_a(p_76484_1_, var22 + var15 + var18, var14 - 0, var13 + var16 + var19); + } + } + + for (var18 = -2; var18 <= 2; ++var18) { + for (var19 = -2; var19 <= 2; ++var19) { + if (Math.abs(var18) != 2 || Math.abs(var19) != 2) { + this.func_150526_a(p_76484_1_, var22 + var15 + var18, var14 - 1, var13 + var16 + var19); + } + } + } + } + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } + + private void func_150526_a(World p_150526_1_, int p_150526_2_, int p_150526_3_, int p_150526_4_) { + Block var5 = p_150526_1_.getBlock(p_150526_2_, p_150526_3_, p_150526_4_); + + if (var5.getMaterial() == Material.air) { + this.func_150516_a(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_, Blocks.leaves2, 1); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java new file mode 100644 index 0000000..e82047d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java @@ -0,0 +1,48 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenClay extends WorldGenerator { + private final Block field_150546_a; + + /** The number of blocks to generate. */ + private final int numberOfBlocks; + + + public WorldGenClay(int p_i2011_1_) { + this.field_150546_a = Blocks.clay; + this.numberOfBlocks = p_i2011_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.water) { + return false; + } else { + int var6 = p_76484_2_.nextInt(this.numberOfBlocks - 2) + 2; + byte var7 = 1; + + for (int var8 = p_76484_3_ - var6; var8 <= p_76484_3_ + var6; ++var8) { + for (int var9 = p_76484_5_ - var6; var9 <= p_76484_5_ + var6; ++var9) { + int var10 = var8 - p_76484_3_; + int var11 = var9 - p_76484_5_; + + if (var10 * var10 + var11 * var11 <= var6 * var6) { + for (int var12 = p_76484_4_ - var7; var12 <= p_76484_4_ + var7; ++var12) { + Block var13 = p_76484_1_.getBlock(var8, var12, var9); + + if (var13 == Blocks.dirt || var13 == Blocks.clay) { + p_76484_1_.setBlock(var8, var12, var9, this.field_150546_a, 0, 2); + } + } + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java new file mode 100644 index 0000000..3704916 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java @@ -0,0 +1,35 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.world.World; + +public class WorldGenDeadBush extends WorldGenerator { + private final Block field_150547_a; + + + public WorldGenDeadBush(Block p_i45451_1_) { + this.field_150547_a = p_i45451_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + Block var6; + + while (((var6 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_)).getMaterial() == Material.air || var6.getMaterial() == Material.leaves) && p_76484_4_ > 0) { + --p_76484_4_; + } + + for (int var7 = 0; var7 < 4; ++var7) { + int var8 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var9 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var10 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var8, var9, var10) && this.field_150547_a.canBlockStay(p_76484_1_, var8, var9, var10)) { + p_76484_1_.setBlock(var8, var9, var10, this.field_150547_a, 0, 2); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java new file mode 100644 index 0000000..99ac689 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java @@ -0,0 +1,76 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenDesertWells extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + while (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_4_ > 2) { + --p_76484_4_; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.sand) { + return false; + } else { + int var6; + int var7; + + for (var6 = -2; var6 <= 2; ++var6) { + for (var7 = -2; var7 <= 2; ++var7) { + if (p_76484_1_.isAirBlock(p_76484_3_ + var6, p_76484_4_ - 1, p_76484_5_ + var7) && p_76484_1_.isAirBlock(p_76484_3_ + var6, p_76484_4_ - 2, p_76484_5_ + var7)) { + return false; + } + } + } + + for (var6 = -1; var6 <= 0; ++var6) { + for (var7 = -2; var7 <= 2; ++var7) { + for (int var8 = -2; var8 <= 2; ++var8) { + p_76484_1_.setBlock(p_76484_3_ + var7, p_76484_4_ + var6, p_76484_5_ + var8, Blocks.sandstone, 0, 2); + } + } + } + + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1, Blocks.flowing_water, 0, 2); + + for (var6 = -2; var6 <= 2; ++var6) { + for (var7 = -2; var7 <= 2; ++var7) { + if (var6 == -2 || var6 == 2 || var7 == -2 || var7 == 2) { + p_76484_1_.setBlock(p_76484_3_ + var6, p_76484_4_ + 1, p_76484_5_ + var7, Blocks.sandstone, 0, 2); + } + } + } + + p_76484_1_.setBlock(p_76484_3_ + 2, p_76484_4_ + 1, p_76484_5_, Blocks.stone_slab, 1, 2); + p_76484_1_.setBlock(p_76484_3_ - 2, p_76484_4_ + 1, p_76484_5_, Blocks.stone_slab, 1, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_ + 2, Blocks.stone_slab, 1, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_ - 2, Blocks.stone_slab, 1, 2); + + for (var6 = -1; var6 <= 1; ++var6) { + for (var7 = -1; var7 <= 1; ++var7) { + if (var6 == 0 && var7 == 0) { + p_76484_1_.setBlock(p_76484_3_ + var6, p_76484_4_ + 4, p_76484_5_ + var7, Blocks.sandstone, 0, 2); + } else { + p_76484_1_.setBlock(p_76484_3_ + var6, p_76484_4_ + 4, p_76484_5_ + var7, Blocks.stone_slab, 1, 2); + } + } + } + + for (var6 = 1; var6 <= 3; ++var6) { + p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_ + var6, p_76484_5_ - 1, Blocks.sandstone, 0, 2); + p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_ + var6, p_76484_5_ + 1, Blocks.sandstone, 0, 2); + p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_ + var6, p_76484_5_ - 1, Blocks.sandstone, 0, 2); + p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_ + var6, p_76484_5_ + 1, Blocks.sandstone, 0, 2); + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java new file mode 100644 index 0000000..c79a131 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java @@ -0,0 +1,31 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenDoublePlant extends WorldGenerator { + private int field_150549_a; + + + public void func_150548_a(int p_150548_1_) { + this.field_150549_a = p_150548_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + boolean var6 = false; + + for (int var7 = 0; var7 < 64; ++var7) { + int var8 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var9 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var10 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var8, var9, var10) && (!p_76484_1_.provider.hasNoSky || var9 < 254) && Blocks.double_plant.canPlaceBlockAt(p_76484_1_, var8, var9, var10)) { + Blocks.double_plant.func_149889_c(p_76484_1_, var8, var9, var10, this.field_150549_a, 2); + var6 = true; + } + } + + return var6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java new file mode 100644 index 0000000..411465d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java @@ -0,0 +1,139 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class WorldGenDungeons extends WorldGenerator { + private static final WeightedRandomChestContent[] field_111189_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 4, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 1, 10), new WeightedRandomChestContent(Items.wheat, 0, 1, 4, 10), new WeightedRandomChestContent(Items.gunpowder, 0, 1, 4, 10), new WeightedRandomChestContent(Items.string, 0, 1, 4, 10), new WeightedRandomChestContent(Items.bucket, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), new WeightedRandomChestContent(Items.redstone, 0, 1, 4, 10), new WeightedRandomChestContent(Items.record_13, 0, 1, 1, 10), new WeightedRandomChestContent(Items.record_cat, 0, 1, 1, 10), new WeightedRandomChestContent(Items.name_tag, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 2), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + byte var6 = 3; + int var7 = p_76484_2_.nextInt(2) + 2; + int var8 = p_76484_2_.nextInt(2) + 2; + int var9 = 0; + int var10; + int var11; + int var12; + + for (var10 = p_76484_3_ - var7 - 1; var10 <= p_76484_3_ + var7 + 1; ++var10) { + for (var11 = p_76484_4_ - 1; var11 <= p_76484_4_ + var6 + 1; ++var11) { + for (var12 = p_76484_5_ - var8 - 1; var12 <= p_76484_5_ + var8 + 1; ++var12) { + Material var13 = p_76484_1_.getBlock(var10, var11, var12).getMaterial(); + + if (var11 == p_76484_4_ - 1 && !var13.isSolid()) { + return false; + } + + if (var11 == p_76484_4_ + var6 + 1 && !var13.isSolid()) { + return false; + } + + if ((var10 == p_76484_3_ - var7 - 1 || var10 == p_76484_3_ + var7 + 1 || var12 == p_76484_5_ - var8 - 1 || var12 == p_76484_5_ + var8 + 1) && var11 == p_76484_4_ && p_76484_1_.isAirBlock(var10, var11, var12) && p_76484_1_.isAirBlock(var10, var11 + 1, var12)) { + ++var9; + } + } + } + } + + if (var9 >= 1 && var9 <= 5) { + for (var10 = p_76484_3_ - var7 - 1; var10 <= p_76484_3_ + var7 + 1; ++var10) { + for (var11 = p_76484_4_ + var6; var11 >= p_76484_4_ - 1; --var11) { + for (var12 = p_76484_5_ - var8 - 1; var12 <= p_76484_5_ + var8 + 1; ++var12) { + if (var10 != p_76484_3_ - var7 - 1 && var11 != p_76484_4_ - 1 && var12 != p_76484_5_ - var8 - 1 && var10 != p_76484_3_ + var7 + 1 && var11 != p_76484_4_ + var6 + 1 && var12 != p_76484_5_ + var8 + 1) { + p_76484_1_.setBlockToAir(var10, var11, var12); + } else if (var11 >= 0 && !p_76484_1_.getBlock(var10, var11 - 1, var12).getMaterial().isSolid()) { + p_76484_1_.setBlockToAir(var10, var11, var12); + } else if (p_76484_1_.getBlock(var10, var11, var12).getMaterial().isSolid()) { + if (var11 == p_76484_4_ - 1 && p_76484_2_.nextInt(4) != 0) { + p_76484_1_.setBlock(var10, var11, var12, Blocks.mossy_cobblestone, 0, 2); + } else { + p_76484_1_.setBlock(var10, var11, var12, Blocks.cobblestone, 0, 2); + } + } + } + } + } + + var10 = 0; + + while (var10 < 2) { + var11 = 0; + + while (true) { + if (var11 < 3) { + label101: { + var12 = p_76484_3_ + p_76484_2_.nextInt(var7 * 2 + 1) - var7; + int var14 = p_76484_5_ + p_76484_2_.nextInt(var8 * 2 + 1) - var8; + + if (p_76484_1_.isAirBlock(var12, p_76484_4_, var14)) { + int var15 = 0; + + if (p_76484_1_.getBlock(var12 - 1, p_76484_4_, var14).getMaterial().isSolid()) { + ++var15; + } + + if (p_76484_1_.getBlock(var12 + 1, p_76484_4_, var14).getMaterial().isSolid()) { + ++var15; + } + + if (p_76484_1_.getBlock(var12, p_76484_4_, var14 - 1).getMaterial().isSolid()) { + ++var15; + } + + if (p_76484_1_.getBlock(var12, p_76484_4_, var14 + 1).getMaterial().isSolid()) { + ++var15; + } + + if (var15 == 1) { + p_76484_1_.setBlock(var12, p_76484_4_, var14, Blocks.chest, 0, 2); + WeightedRandomChestContent[] var16 = WeightedRandomChestContent.func_92080_a(field_111189_a, Items.enchanted_book.func_92114_b(p_76484_2_)); + TileEntityChest var17 = (TileEntityChest)p_76484_1_.getTileEntity(var12, p_76484_4_, var14); + + if (var17 != null) { + WeightedRandomChestContent.generateChestContents(p_76484_2_, var16, var17, 8); + } + + break label101; + } + } + + ++var11; + continue; + } + } + + ++var10; + break; + } + } + + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner var18 = (TileEntityMobSpawner)p_76484_1_.getTileEntity(p_76484_3_, p_76484_4_, p_76484_5_); + + if (var18 != null) { + var18.func_145881_a().setMobID(this.pickMobSpawner(p_76484_2_)); + } else { + System.err.println("Failed to fetch mob spawner entity at (" + p_76484_3_ + ", " + p_76484_4_ + ", " + p_76484_5_ + ")"); + } + + return true; + } else { + return false; + } + } + + /** + * Randomly decides which spawner to use in a dungeon + */ + private String pickMobSpawner(Random p_76543_1_) { + int var2 = p_76543_1_.nextInt(4); + return var2 == 0 ? "Skeleton" : (var2 == 1 ? "Zombie" : (var2 == 2 ? "Zombie" : (var2 == 3 ? "Spider" : ""))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java new file mode 100644 index 0000000..b9c5916 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java @@ -0,0 +1,23 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenFire extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + for (int var6 = 0; var6 < 64; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var7, var8, var9) && p_76484_1_.getBlock(var7, var8 - 1, var9) == Blocks.netherrack) { + p_76484_1_.setBlock(var7, var8, var9, Blocks.fire, 0, 2); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java new file mode 100644 index 0000000..868842a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java @@ -0,0 +1,34 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class WorldGenFlowers extends WorldGenerator { + private Block field_150552_a; + private int field_150551_b; + + + public WorldGenFlowers(Block p_i45452_1_) { + this.field_150552_a = p_i45452_1_; + } + + public void func_150550_a(Block p_150550_1_, int p_150550_2_) { + this.field_150552_a = p_150550_1_; + this.field_150551_b = p_150550_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + for (int var6 = 0; var6 < 64; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var7, var8, var9) && (!p_76484_1_.provider.hasNoSky || var8 < 255) && this.field_150552_a.canBlockStay(p_76484_1_, var7, var8, var9)) { + p_76484_1_.setBlock(var7, var8, var9, this.field_150552_a, this.field_150551_b, 2); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java new file mode 100644 index 0000000..6a56da3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java @@ -0,0 +1,104 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenForest extends WorldGenAbstractTree { + private final boolean field_150531_a; + + + public WorldGenForest(boolean p_i45449_1_, boolean p_i45449_2_) { + super(p_i45449_1_); + this.field_150531_a = p_i45449_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_2_.nextInt(3) + 5; + + if (this.field_150531_a) { + var6 += p_76484_2_.nextInt(7); + } + + boolean var7 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var6 + 1 <= 256) { + int var10; + int var11; + + for (int var8 = p_76484_4_; var8 <= p_76484_4_ + 1 + var6; ++var8) { + byte var9 = 1; + + if (var8 == p_76484_4_) { + var9 = 0; + } + + if (var8 >= p_76484_4_ + 1 + var6 - 2) { + var9 = 2; + } + + for (var10 = p_76484_3_ - var9; var10 <= p_76484_3_ + var9 && var7; ++var10) { + for (var11 = p_76484_5_ - var9; var11 <= p_76484_5_ + var9 && var7; ++var11) { + if (var8 >= 0 && var8 < 256) { + Block var12 = p_76484_1_.getBlock(var10, var8, var11); + + if (!this.func_150523_a(var12)) { + var7 = false; + } + } else { + var7 = false; + } + } + } + } + + if (!var7) { + return false; + } else { + Block var17 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if ((var17 == Blocks.grass || var17 == Blocks.dirt || var17 == Blocks.farmland) && p_76484_4_ < 256 - var6 - 1) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + int var18; + + for (var18 = p_76484_4_ - 3 + var6; var18 <= p_76484_4_ + var6; ++var18) { + var10 = var18 - (p_76484_4_ + var6); + var11 = 1 - var10 / 2; + + for (int var20 = p_76484_3_ - var11; var20 <= p_76484_3_ + var11; ++var20) { + int var13 = var20 - p_76484_3_; + + for (int var14 = p_76484_5_ - var11; var14 <= p_76484_5_ + var11; ++var14) { + int var15 = var14 - p_76484_5_; + + if (Math.abs(var13) != var11 || Math.abs(var15) != var11 || p_76484_2_.nextInt(2) != 0 && var10 != 0) { + Block var16 = p_76484_1_.getBlock(var20, var18, var14); + + if (var16.getMaterial() == Material.air || var16.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, var20, var18, var14, Blocks.leaves, 2); + } + } + } + } + } + + for (var18 = 0; var18 < var6; ++var18) { + Block var19 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var18, p_76484_5_); + + if (var19.getMaterial() == Material.air || var19.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var18, p_76484_5_, Blocks.log, 2); + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java new file mode 100644 index 0000000..d9bae76 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java @@ -0,0 +1,69 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenGlowStone1 extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + if (!p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_)) { + return false; + } else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.netherrack) { + return false; + } else { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.glowstone, 0, 2); + + for (int var6 = 0; var6 < 1500; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ - p_76484_2_.nextInt(12); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.getBlock(var7, var8, var9).getMaterial() == Material.air) { + int var10 = 0; + + for (int var11 = 0; var11 < 6; ++var11) { + Block var12 = null; + + if (var11 == 0) { + var12 = p_76484_1_.getBlock(var7 - 1, var8, var9); + } + + if (var11 == 1) { + var12 = p_76484_1_.getBlock(var7 + 1, var8, var9); + } + + if (var11 == 2) { + var12 = p_76484_1_.getBlock(var7, var8 - 1, var9); + } + + if (var11 == 3) { + var12 = p_76484_1_.getBlock(var7, var8 + 1, var9); + } + + if (var11 == 4) { + var12 = p_76484_1_.getBlock(var7, var8, var9 - 1); + } + + if (var11 == 5) { + var12 = p_76484_1_.getBlock(var7, var8, var9 + 1); + } + + if (var12 == Blocks.glowstone) { + ++var10; + } + } + + if (var10 == 1) { + p_76484_1_.setBlock(var7, var8, var9, Blocks.glowstone, 0, 2); + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java new file mode 100644 index 0000000..d3a8985 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java @@ -0,0 +1,69 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenGlowStone2 extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + if (!p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_)) { + return false; + } else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.netherrack) { + return false; + } else { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.glowstone, 0, 2); + + for (int var6 = 0; var6 < 1500; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ - p_76484_2_.nextInt(12); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.getBlock(var7, var8, var9).getMaterial() == Material.air) { + int var10 = 0; + + for (int var11 = 0; var11 < 6; ++var11) { + Block var12 = null; + + if (var11 == 0) { + var12 = p_76484_1_.getBlock(var7 - 1, var8, var9); + } + + if (var11 == 1) { + var12 = p_76484_1_.getBlock(var7 + 1, var8, var9); + } + + if (var11 == 2) { + var12 = p_76484_1_.getBlock(var7, var8 - 1, var9); + } + + if (var11 == 3) { + var12 = p_76484_1_.getBlock(var7, var8 + 1, var9); + } + + if (var11 == 4) { + var12 = p_76484_1_.getBlock(var7, var8, var9 - 1); + } + + if (var11 == 5) { + var12 = p_76484_1_.getBlock(var7, var8, var9 + 1); + } + + if (var12 == Blocks.glowstone) { + ++var10; + } + } + + if (var10 == 1) { + p_76484_1_.setBlock(var7, var8, var9, Blocks.glowstone, 0, 2); + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java new file mode 100644 index 0000000..b4e6fec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java @@ -0,0 +1,79 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenHellLava extends WorldGenerator { + private final Block field_150553_a; + private final boolean field_94524_b; + + + public WorldGenHellLava(Block p_i45453_1_, boolean p_i45453_2_) { + this.field_150553_a = p_i45453_1_; + this.field_94524_b = p_i45453_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.netherrack) { + return false; + } else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.air && p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.netherrack) { + return false; + } else { + int var6 = 0; + + if (p_76484_1_.getBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_) == Blocks.netherrack) { + ++var6; + } + + if (p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_) == Blocks.netherrack) { + ++var6; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1) == Blocks.netherrack) { + ++var6; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1) == Blocks.netherrack) { + ++var6; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) == Blocks.netherrack) { + ++var6; + } + + int var7 = 0; + + if (p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_)) { + ++var7; + } + + if (p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_)) { + ++var7; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1)) { + ++var7; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1)) { + ++var7; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_)) { + ++var7; + } + + if (!this.field_94524_b && var6 == 4 && var7 == 1 || var6 == 5) { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, this.field_150553_a, 0, 2); + p_76484_1_.scheduledUpdatesAreImmediate = true; + this.field_150553_a.updateTick(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, p_76484_2_); + p_76484_1_.scheduledUpdatesAreImmediate = false; + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java new file mode 100644 index 0000000..3388da8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java @@ -0,0 +1,134 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public abstract class WorldGenHugeTrees extends WorldGenAbstractTree { + /** The base height of the tree */ + protected final int baseHeight; + + /** Sets the metadata for the wood blocks used */ + protected final int woodMetadata; + + /** Sets the metadata for the leaves used in huge trees */ + protected final int leavesMetadata; + protected int field_150538_d; + + + public WorldGenHugeTrees(boolean p_i45458_1_, int p_i45458_2_, int p_i45458_3_, int p_i45458_4_, int p_i45458_5_) { + super(p_i45458_1_); + this.baseHeight = p_i45458_2_; + this.field_150538_d = p_i45458_3_; + this.woodMetadata = p_i45458_4_; + this.leavesMetadata = p_i45458_5_; + } + + protected int func_150533_a(Random p_150533_1_) { + int var2 = p_150533_1_.nextInt(3) + this.baseHeight; + + if (this.field_150538_d > 1) { + var2 += p_150533_1_.nextInt(this.field_150538_d); + } + + return var2; + } + + private boolean func_150536_b(World p_150536_1_, Random p_150536_2_, int p_150536_3_, int p_150536_4_, int p_150536_5_, int p_150536_6_) { + boolean var7 = true; + + if (p_150536_4_ >= 1 && p_150536_4_ + p_150536_6_ + 1 <= 256) { + for (int var8 = p_150536_4_; var8 <= p_150536_4_ + 1 + p_150536_6_; ++var8) { + byte var9 = 2; + + if (var8 == p_150536_4_) { + var9 = 1; + } + + if (var8 >= p_150536_4_ + 1 + p_150536_6_ - 2) { + var9 = 2; + } + + for (int var10 = p_150536_3_ - var9; var10 <= p_150536_3_ + var9 && var7; ++var10) { + for (int var11 = p_150536_5_ - var9; var11 <= p_150536_5_ + var9 && var7; ++var11) { + if (var8 >= 0 && var8 < 256) { + Block var12 = p_150536_1_.getBlock(var10, var8, var11); + + if (!this.func_150523_a(var12)) { + var7 = false; + } + } else { + var7 = false; + } + } + } + } + + return var7; + } else { + return false; + } + } + + private boolean func_150532_c(World p_150532_1_, Random p_150532_2_, int p_150532_3_, int p_150532_4_, int p_150532_5_) { + Block var6 = p_150532_1_.getBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_); + + if ((var6 == Blocks.grass || var6 == Blocks.dirt) && p_150532_4_ >= 2) { + p_150532_1_.setBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); + p_150532_1_.setBlock(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); + p_150532_1_.setBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); + p_150532_1_.setBlock(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); + return true; + } else { + return false; + } + } + + protected boolean func_150537_a(World p_150537_1_, Random p_150537_2_, int p_150537_3_, int p_150537_4_, int p_150537_5_, int p_150537_6_) { + return this.func_150536_b(p_150537_1_, p_150537_2_, p_150537_3_, p_150537_4_, p_150537_5_, p_150537_6_) && this.func_150532_c(p_150537_1_, p_150537_2_, p_150537_3_, p_150537_4_, p_150537_5_); + } + + protected void func_150535_a(World p_150535_1_, int p_150535_2_, int p_150535_3_, int p_150535_4_, int p_150535_5_, Random p_150535_6_) { + int var7 = p_150535_5_ * p_150535_5_; + + for (int var8 = p_150535_2_ - p_150535_5_; var8 <= p_150535_2_ + p_150535_5_ + 1; ++var8) { + int var9 = var8 - p_150535_2_; + + for (int var10 = p_150535_4_ - p_150535_5_; var10 <= p_150535_4_ + p_150535_5_ + 1; ++var10) { + int var11 = var10 - p_150535_4_; + int var12 = var9 - 1; + int var13 = var11 - 1; + + if (var9 * var9 + var11 * var11 <= var7 || var12 * var12 + var13 * var13 <= var7 || var9 * var9 + var13 * var13 <= var7 || var12 * var12 + var11 * var11 <= var7) { + Block var14 = p_150535_1_.getBlock(var8, p_150535_3_, var10); + + if (var14.getMaterial() == Material.air || var14.getMaterial() == Material.leaves) { + this.func_150516_a(p_150535_1_, var8, p_150535_3_, var10, Blocks.leaves, this.leavesMetadata); + } + } + } + } + } + + protected void func_150534_b(World p_150534_1_, int p_150534_2_, int p_150534_3_, int p_150534_4_, int p_150534_5_, Random p_150534_6_) { + int var7 = p_150534_5_ * p_150534_5_; + + for (int var8 = p_150534_2_ - p_150534_5_; var8 <= p_150534_2_ + p_150534_5_; ++var8) { + int var9 = var8 - p_150534_2_; + + for (int var10 = p_150534_4_ - p_150534_5_; var10 <= p_150534_4_ + p_150534_5_; ++var10) { + int var11 = var10 - p_150534_4_; + + if (var9 * var9 + var11 * var11 <= var7) { + Block var12 = p_150534_1_.getBlock(var8, p_150534_3_, var10); + + if (var12.getMaterial() == Material.air || var12.getMaterial() == Material.leaves) { + this.func_150516_a(p_150534_1_, var8, p_150534_3_, var10, Blocks.leaves, this.leavesMetadata); + } + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java new file mode 100644 index 0000000..67004df --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java @@ -0,0 +1,49 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenIcePath extends WorldGenerator { + private final Block field_150555_a; + private final int field_150554_b; + + + public WorldGenIcePath(int p_i45454_1_) { + this.field_150555_a = Blocks.packed_ice; + this.field_150554_b = p_i45454_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + while (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_4_ > 2) { + --p_76484_4_; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.snow) { + return false; + } else { + int var6 = p_76484_2_.nextInt(this.field_150554_b - 2) + 2; + byte var7 = 1; + + for (int var8 = p_76484_3_ - var6; var8 <= p_76484_3_ + var6; ++var8) { + for (int var9 = p_76484_5_ - var6; var9 <= p_76484_5_ + var6; ++var9) { + int var10 = var8 - p_76484_3_; + int var11 = var9 - p_76484_5_; + + if (var10 * var10 + var11 * var11 <= var6 * var6) { + for (int var12 = p_76484_4_ - var7; var12 <= p_76484_4_ + var7; ++var12) { + Block var13 = p_76484_1_.getBlock(var8, var12, var9); + + if (var13 == Blocks.dirt || var13 == Blocks.snow || var13 == Blocks.ice) { + p_76484_1_.setBlock(var8, var12, var9, this.field_150555_a, 0, 2); + } + } + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java new file mode 100644 index 0000000..d07c913 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java @@ -0,0 +1,108 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenIceSpike extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + while (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_4_ > 2) { + --p_76484_4_; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.snow) { + return false; + } else { + p_76484_4_ += p_76484_2_.nextInt(4); + int var6 = p_76484_2_.nextInt(4) + 7; + int var7 = var6 / 4 + p_76484_2_.nextInt(2); + + if (var7 > 1 && p_76484_2_.nextInt(60) == 0) { + p_76484_4_ += 10 + p_76484_2_.nextInt(30); + } + + int var8; + int var10; + int var11; + + for (var8 = 0; var8 < var6; ++var8) { + float var9 = (1.0F - (float)var8 / (float)var6) * (float)var7; + var10 = MathHelper.ceiling_float_int(var9); + + for (var11 = -var10; var11 <= var10; ++var11) { + float var12 = (float)MathHelper.abs_int(var11) - 0.25F; + + for (int var13 = -var10; var13 <= var10; ++var13) { + float var14 = (float)MathHelper.abs_int(var13) - 0.25F; + + if ((var11 == 0 && var13 == 0 || var12 * var12 + var14 * var14 <= var9 * var9) && (var11 != -var10 && var11 != var10 && var13 != -var10 && var13 != var10 || p_76484_2_.nextFloat() <= 0.75F)) { + Block var15 = p_76484_1_.getBlock(p_76484_3_ + var11, p_76484_4_ + var8, p_76484_5_ + var13); + + if (var15.getMaterial() == Material.air || var15 == Blocks.dirt || var15 == Blocks.snow || var15 == Blocks.ice) { + this.func_150515_a(p_76484_1_, p_76484_3_ + var11, p_76484_4_ + var8, p_76484_5_ + var13, Blocks.packed_ice); + } + + if (var8 != 0 && var10 > 1) { + var15 = p_76484_1_.getBlock(p_76484_3_ + var11, p_76484_4_ - var8, p_76484_5_ + var13); + + if (var15.getMaterial() == Material.air || var15 == Blocks.dirt || var15 == Blocks.snow || var15 == Blocks.ice) { + this.func_150515_a(p_76484_1_, p_76484_3_ + var11, p_76484_4_ - var8, p_76484_5_ + var13, Blocks.packed_ice); + } + } + } + } + } + } + + var8 = var7 - 1; + + if (var8 < 0) { + var8 = 0; + } else if (var8 > 1) { + var8 = 1; + } + + for (int var16 = -var8; var16 <= var8; ++var16) { + var10 = -var8; + + while (var10 <= var8) { + var11 = p_76484_4_ - 1; + int var17 = 50; + + if (Math.abs(var16) == 1 && Math.abs(var10) == 1) { + var17 = p_76484_2_.nextInt(5); + } + + while (true) { + if (var11 > 50) { + Block var18 = p_76484_1_.getBlock(p_76484_3_ + var16, var11, p_76484_5_ + var10); + + if (var18.getMaterial() == Material.air || var18 == Blocks.dirt || var18 == Blocks.snow || var18 == Blocks.ice || var18 == Blocks.packed_ice) { + this.func_150515_a(p_76484_1_, p_76484_3_ + var16, var11, p_76484_5_ + var10, Blocks.packed_ice); + --var11; + --var17; + + if (var17 <= 0) { + var11 -= p_76484_2_.nextInt(5) + 1; + var17 = p_76484_2_.nextInt(5); + } + + continue; + } + } + + ++var10; + break; + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java new file mode 100644 index 0000000..f26cd23 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java @@ -0,0 +1,136 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class WorldGenLakes extends WorldGenerator { + private final Block field_150556_a; + + + public WorldGenLakes(Block p_i45455_1_) { + this.field_150556_a = p_i45455_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + p_76484_3_ -= 8; + + for (p_76484_5_ -= 8; p_76484_4_ > 5 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_); --p_76484_4_) { + } + + if (p_76484_4_ <= 4) { + return false; + } else { + p_76484_4_ -= 4; + boolean[] var6 = new boolean[2048]; + int var7 = p_76484_2_.nextInt(4) + 4; + int var8; + + for (var8 = 0; var8 < var7; ++var8) { + double var9 = p_76484_2_.nextDouble() * 6.0D + 3.0D; + double var11 = p_76484_2_.nextDouble() * 4.0D + 2.0D; + double var13 = p_76484_2_.nextDouble() * 6.0D + 3.0D; + double var15 = p_76484_2_.nextDouble() * (16.0D - var9 - 2.0D) + 1.0D + var9 / 2.0D; + double var17 = p_76484_2_.nextDouble() * (8.0D - var11 - 4.0D) + 2.0D + var11 / 2.0D; + double var19 = p_76484_2_.nextDouble() * (16.0D - var13 - 2.0D) + 1.0D + var13 / 2.0D; + + for (int var21 = 1; var21 < 15; ++var21) { + for (int var22 = 1; var22 < 15; ++var22) { + for (int var23 = 1; var23 < 7; ++var23) { + double var24 = ((double)var21 - var15) / (var9 / 2.0D); + double var26 = ((double)var23 - var17) / (var11 / 2.0D); + double var28 = ((double)var22 - var19) / (var13 / 2.0D); + double var30 = var24 * var24 + var26 * var26 + var28 * var28; + + if (var30 < 1.0D) { + var6[(var21 * 16 + var22) * 8 + var23] = true; + } + } + } + } + } + + int var10; + int var32; + boolean var34; + + for (var8 = 0; var8 < 16; ++var8) { + for (var32 = 0; var32 < 16; ++var32) { + for (var10 = 0; var10 < 8; ++var10) { + var34 = !var6[(var8 * 16 + var32) * 8 + var10] && (var8 < 15 && var6[((var8 + 1) * 16 + var32) * 8 + var10] || var8 > 0 && var6[((var8 - 1) * 16 + var32) * 8 + var10] || var32 < 15 && var6[(var8 * 16 + var32 + 1) * 8 + var10] || var32 > 0 && var6[(var8 * 16 + (var32 - 1)) * 8 + var10] || var10 < 7 && var6[(var8 * 16 + var32) * 8 + var10 + 1] || var10 > 0 && var6[(var8 * 16 + var32) * 8 + (var10 - 1)]); + + if (var34) { + Material var12 = p_76484_1_.getBlock(p_76484_3_ + var8, p_76484_4_ + var10, p_76484_5_ + var32).getMaterial(); + + if (var10 >= 4 && var12.isLiquid()) { + return false; + } + + if (var10 < 4 && !var12.isSolid() && p_76484_1_.getBlock(p_76484_3_ + var8, p_76484_4_ + var10, p_76484_5_ + var32) != this.field_150556_a) { + return false; + } + } + } + } + } + + for (var8 = 0; var8 < 16; ++var8) { + for (var32 = 0; var32 < 16; ++var32) { + for (var10 = 0; var10 < 8; ++var10) { + if (var6[(var8 * 16 + var32) * 8 + var10]) { + p_76484_1_.setBlock(p_76484_3_ + var8, p_76484_4_ + var10, p_76484_5_ + var32, var10 >= 4 ? Blocks.air : this.field_150556_a, 0, 2); + } + } + } + } + + for (var8 = 0; var8 < 16; ++var8) { + for (var32 = 0; var32 < 16; ++var32) { + for (var10 = 4; var10 < 8; ++var10) { + if (var6[(var8 * 16 + var32) * 8 + var10] && p_76484_1_.getBlock(p_76484_3_ + var8, p_76484_4_ + var10 - 1, p_76484_5_ + var32) == Blocks.dirt && p_76484_1_.getSavedLightValue(EnumSkyBlock.Sky, p_76484_3_ + var8, p_76484_4_ + var10, p_76484_5_ + var32) > 0) { + BiomeGenBase var35 = p_76484_1_.getBiomeGenForCoords(p_76484_3_ + var8, p_76484_5_ + var32); + + if (var35.topBlock == Blocks.mycelium) { + p_76484_1_.setBlock(p_76484_3_ + var8, p_76484_4_ + var10 - 1, p_76484_5_ + var32, Blocks.mycelium, 0, 2); + } else { + p_76484_1_.setBlock(p_76484_3_ + var8, p_76484_4_ + var10 - 1, p_76484_5_ + var32, Blocks.grass, 0, 2); + } + } + } + } + } + + if (this.field_150556_a.getMaterial() == Material.lava) { + for (var8 = 0; var8 < 16; ++var8) { + for (var32 = 0; var32 < 16; ++var32) { + for (var10 = 0; var10 < 8; ++var10) { + var34 = !var6[(var8 * 16 + var32) * 8 + var10] && (var8 < 15 && var6[((var8 + 1) * 16 + var32) * 8 + var10] || var8 > 0 && var6[((var8 - 1) * 16 + var32) * 8 + var10] || var32 < 15 && var6[(var8 * 16 + var32 + 1) * 8 + var10] || var32 > 0 && var6[(var8 * 16 + (var32 - 1)) * 8 + var10] || var10 < 7 && var6[(var8 * 16 + var32) * 8 + var10 + 1] || var10 > 0 && var6[(var8 * 16 + var32) * 8 + (var10 - 1)]); + + if (var34 && (var10 < 4 || p_76484_2_.nextInt(2) != 0) && p_76484_1_.getBlock(p_76484_3_ + var8, p_76484_4_ + var10, p_76484_5_ + var32).getMaterial().isSolid()) { + p_76484_1_.setBlock(p_76484_3_ + var8, p_76484_4_ + var10, p_76484_5_ + var32, Blocks.stone, 0, 2); + } + } + } + } + } + + if (this.field_150556_a.getMaterial() == Material.water) { + for (var8 = 0; var8 < 16; ++var8) { + for (var32 = 0; var32 < 16; ++var32) { + byte var33 = 4; + + if (p_76484_1_.isBlockFreezable(p_76484_3_ + var8, p_76484_4_ + var33, p_76484_5_ + var32)) { + p_76484_1_.setBlock(p_76484_3_ + var8, p_76484_4_ + var33, p_76484_5_ + var32, Blocks.ice, 0, 2); + } + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java new file mode 100644 index 0000000..eb9cc9e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java @@ -0,0 +1,71 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenLiquids extends WorldGenerator { + private final Block field_150521_a; + + + public WorldGenLiquids(Block p_i45465_1_) { + this.field_150521_a = p_i45465_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.stone) { + return false; + } else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) != Blocks.stone) { + return false; + } else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.air && p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.stone) { + return false; + } else { + int var6 = 0; + + if (p_76484_1_.getBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_) == Blocks.stone) { + ++var6; + } + + if (p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_) == Blocks.stone) { + ++var6; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1) == Blocks.stone) { + ++var6; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1) == Blocks.stone) { + ++var6; + } + + int var7 = 0; + + if (p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_)) { + ++var7; + } + + if (p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_)) { + ++var7; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1)) { + ++var7; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1)) { + ++var7; + } + + if (var6 == 3 && var7 == 1) { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, this.field_150521_a, 0, 2); + p_76484_1_.scheduledUpdatesAreImmediate = true; + this.field_150521_a.updateTick(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, p_76484_2_); + p_76484_1_.scheduledUpdatesAreImmediate = false; + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java new file mode 100644 index 0000000..366d5b5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -0,0 +1,126 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMegaJungle extends WorldGenHugeTrees { + + + public WorldGenMegaJungle(boolean p_i45456_1_, int p_i45456_2_, int p_i45456_3_, int p_i45456_4_, int p_i45456_5_) { + super(p_i45456_1_, p_i45456_2_, p_i45456_3_, p_i45456_4_, p_i45456_5_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = this.func_150533_a(p_76484_2_); + + if (!this.func_150537_a(p_76484_1_, p_76484_2_, p_76484_3_, p_76484_4_, p_76484_5_, var6)) { + return false; + } else { + this.func_150543_c(p_76484_1_, p_76484_3_, p_76484_5_, p_76484_4_ + var6, 2, p_76484_2_); + + for (int var7 = p_76484_4_ + var6 - 2 - p_76484_2_.nextInt(4); var7 > p_76484_4_ + var6 / 2; var7 -= 2 + p_76484_2_.nextInt(4)) { + float var8 = p_76484_2_.nextFloat() * (float)Math.PI * 2.0F; + int var9 = p_76484_3_ + (int)(0.5F + MathHelper.cos(var8) * 4.0F); + int var10 = p_76484_5_ + (int)(0.5F + MathHelper.sin(var8) * 4.0F); + int var11; + + for (var11 = 0; var11 < 5; ++var11) { + var9 = p_76484_3_ + (int)(1.5F + MathHelper.cos(var8) * (float)var11); + var10 = p_76484_5_ + (int)(1.5F + MathHelper.sin(var8) * (float)var11); + this.func_150516_a(p_76484_1_, var9, var7 - 3 + var11 / 2, var10, Blocks.log, this.woodMetadata); + } + + var11 = 1 + p_76484_2_.nextInt(2); + int var12 = var7; + + for (int var13 = var7 - var11; var13 <= var12; ++var13) { + int var14 = var13 - var12; + this.func_150534_b(p_76484_1_, var9, var13, var10, 1 - var14, p_76484_2_); + } + } + + for (int var15 = 0; var15 < var6; ++var15) { + Block var16 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var15, p_76484_5_); + + if (var16.getMaterial() == Material.air || var16.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var15, p_76484_5_, Blocks.log, this.woodMetadata); + + if (var15 > 0) { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_ + var15, p_76484_5_)) { + this.func_150516_a(p_76484_1_, p_76484_3_ - 1, p_76484_4_ + var15, p_76484_5_, Blocks.vine, 8); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + var15, p_76484_5_ - 1)) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var15, p_76484_5_ - 1, Blocks.vine, 1); + } + } + } + + if (var15 < var6 - 1) { + var16 = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_); + + if (var16.getMaterial() == Material.air || var16.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_, Blocks.log, this.woodMetadata); + + if (var15 > 0) { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 2, p_76484_4_ + var15, p_76484_5_)) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 2, p_76484_4_ + var15, p_76484_5_, Blocks.vine, 2); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_ - 1)) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_ - 1, Blocks.vine, 1); + } + } + } + + var16 = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_ + 1); + + if (var16.getMaterial() == Material.air || var16.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + + if (var15 > 0) { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 2, p_76484_4_ + var15, p_76484_5_ + 1)) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 2, p_76484_4_ + var15, p_76484_5_ + 1, Blocks.vine, 2); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_ + 2)) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + var15, p_76484_5_ + 2, Blocks.vine, 4); + } + } + } + + var16 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var15, p_76484_5_ + 1); + + if (var16.getMaterial() == Material.air || var16.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var15, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + + if (var15 > 0) { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_ + var15, p_76484_5_ + 1)) { + this.func_150516_a(p_76484_1_, p_76484_3_ - 1, p_76484_4_ + var15, p_76484_5_ + 1, Blocks.vine, 8); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + var15, p_76484_5_ + 2)) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var15, p_76484_5_ + 2, Blocks.vine, 4); + } + } + } + } + } + + return true; + } + } + + private void func_150543_c(World p_150543_1_, int p_150543_2_, int p_150543_3_, int p_150543_4_, int p_150543_5_, Random p_150543_6_) { + byte var7 = 2; + + for (int var8 = p_150543_4_ - var7; var8 <= p_150543_4_; ++var8) { + int var9 = var8 - p_150543_4_; + this.func_150535_a(p_150543_1_, p_150543_2_, var8, p_150543_3_, p_150543_5_ + 1 - var9, p_150543_6_); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java new file mode 100644 index 0000000..4ba4e79 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java @@ -0,0 +1,119 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMegaPineTree extends WorldGenHugeTrees { + private final boolean field_150542_e; + + + public WorldGenMegaPineTree(boolean p_i45457_1_, boolean p_i45457_2_) { + super(p_i45457_1_, 13, 15, 1, 1); + this.field_150542_e = p_i45457_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = this.func_150533_a(p_76484_2_); + + if (!this.func_150537_a(p_76484_1_, p_76484_2_, p_76484_3_, p_76484_4_, p_76484_5_, var6)) { + return false; + } else { + this.func_150541_c(p_76484_1_, p_76484_3_, p_76484_5_, p_76484_4_ + var6, 0, p_76484_2_); + + for (int var7 = 0; var7 < var6; ++var7) { + Block var8 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var7, p_76484_5_); + + if (var8.getMaterial() == Material.air || var8.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var7, p_76484_5_, Blocks.log, this.woodMetadata); + } + + if (var7 < var6 - 1) { + var8 = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + var7, p_76484_5_); + + if (var8.getMaterial() == Material.air || var8.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + var7, p_76484_5_, Blocks.log, this.woodMetadata); + } + + var8 = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + var7, p_76484_5_ + 1); + + if (var8.getMaterial() == Material.air || var8.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + var7, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + } + + var8 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var7, p_76484_5_ + 1); + + if (var8.getMaterial() == Material.air || var8.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var7, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + } + } + } + + return true; + } + } + + private void func_150541_c(World p_150541_1_, int p_150541_2_, int p_150541_3_, int p_150541_4_, int p_150541_5_, Random p_150541_6_) { + int var7 = p_150541_6_.nextInt(5); + + if (this.field_150542_e) { + var7 += this.baseHeight; + } else { + var7 += 3; + } + + int var8 = 0; + + for (int var9 = p_150541_4_ - var7; var9 <= p_150541_4_; ++var9) { + int var10 = p_150541_4_ - var9; + int var11 = p_150541_5_ + MathHelper.floor_float((float)var10 / (float)var7 * 3.5F); + this.func_150535_a(p_150541_1_, p_150541_2_, var9, p_150541_3_, var11 + (var10 > 0 && var11 == var8 && (var9 & 1) == 0 ? 1 : 0), p_150541_6_); + var8 = var11; + } + } + + public void func_150524_b(World p_150524_1_, Random p_150524_2_, int p_150524_3_, int p_150524_4_, int p_150524_5_) { + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ - 1, p_150524_4_, p_150524_5_ - 1); + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ + 2, p_150524_4_, p_150524_5_ - 1); + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ - 1, p_150524_4_, p_150524_5_ + 2); + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ + 2, p_150524_4_, p_150524_5_ + 2); + + for (int var6 = 0; var6 < 5; ++var6) { + int var7 = p_150524_2_.nextInt(64); + int var8 = var7 % 8; + int var9 = var7 / 8; + + if (var8 == 0 || var8 == 7 || var9 == 0 || var9 == 7) { + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ - 3 + var8, p_150524_4_, p_150524_5_ - 3 + var9); + } + } + } + + private void func_150539_c(World p_150539_1_, Random p_150539_2_, int p_150539_3_, int p_150539_4_, int p_150539_5_) { + for (int var6 = -2; var6 <= 2; ++var6) { + for (int var7 = -2; var7 <= 2; ++var7) { + if (Math.abs(var6) != 2 || Math.abs(var7) != 2) { + this.func_150540_a(p_150539_1_, p_150539_3_ + var6, p_150539_4_, p_150539_5_ + var7); + } + } + } + } + + private void func_150540_a(World p_150540_1_, int p_150540_2_, int p_150540_3_, int p_150540_4_) { + for (int var5 = p_150540_3_ + 2; var5 >= p_150540_3_ - 3; --var5) { + Block var6 = p_150540_1_.getBlock(p_150540_2_, var5, p_150540_4_); + + if (var6 == Blocks.grass || var6 == Blocks.dirt) { + this.func_150516_a(p_150540_1_, p_150540_2_, var5, p_150540_4_, Blocks.dirt, 2); + break; + } + + if (var6.getMaterial() != Material.air && var5 < p_150540_3_) { + break; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java new file mode 100644 index 0000000..c6167cc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java @@ -0,0 +1,23 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenMelon extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + for (int var6 = 0; var6 < 64; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (Blocks.melon_block.canPlaceBlockAt(p_76484_1_, var7, var8, var9) && p_76484_1_.getBlock(var7, var8 - 1, var9) == Blocks.grass) { + p_76484_1_.setBlock(var7, var8, var9, Blocks.melon_block, 0, 2); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java new file mode 100644 index 0000000..2e3f135 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java @@ -0,0 +1,73 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMinable extends WorldGenerator { + private final Block field_150519_a; + + /** The number of blocks to generate. */ + private final int numberOfBlocks; + private final Block field_150518_c; + + + public WorldGenMinable(Block p_i45459_1_, int p_i45459_2_) { + this(p_i45459_1_, p_i45459_2_, Blocks.stone); + } + + public WorldGenMinable(Block p_i45460_1_, int p_i45460_2_, Block p_i45460_3_) { + this.field_150519_a = p_i45460_1_; + this.numberOfBlocks = p_i45460_2_; + this.field_150518_c = p_i45460_3_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + float var6 = p_76484_2_.nextFloat() * (float)Math.PI; + double var7 = (float)(p_76484_3_ + 8) + MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F; + double var9 = (float)(p_76484_3_ + 8) - MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F; + double var11 = (float)(p_76484_5_ + 8) + MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F; + double var13 = (float)(p_76484_5_ + 8) - MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F; + double var15 = p_76484_4_ + p_76484_2_.nextInt(3) - 2; + double var17 = p_76484_4_ + p_76484_2_.nextInt(3) - 2; + + for (int var19 = 0; var19 <= this.numberOfBlocks; ++var19) { + double var20 = var7 + (var9 - var7) * (double)var19 / (double)this.numberOfBlocks; + double var22 = var15 + (var17 - var15) * (double)var19 / (double)this.numberOfBlocks; + double var24 = var11 + (var13 - var11) * (double)var19 / (double)this.numberOfBlocks; + double var26 = p_76484_2_.nextDouble() * (double)this.numberOfBlocks / 16.0D; + double var28 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D; + double var30 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D; + int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); + int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); + int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); + int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); + int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); + int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); + + for (int var38 = var32; var38 <= var35; ++var38) { + double var39 = ((double)var38 + 0.5D - var20) / (var28 / 2.0D); + + if (var39 * var39 < 1.0D) { + for (int var41 = var33; var41 <= var36; ++var41) { + double var42 = ((double)var41 + 0.5D - var22) / (var30 / 2.0D); + + if (var39 * var39 + var42 * var42 < 1.0D) { + for (int var44 = var34; var44 <= var37; ++var44) { + double var45 = ((double)var44 + 0.5D - var24) / (var28 / 2.0D); + + if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && p_76484_1_.getBlock(var38, var41, var44) == this.field_150518_c) { + p_76484_1_.setBlock(var38, var41, var44, this.field_150519_a, 0, 2); + } + } + } + } + } + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java new file mode 100644 index 0000000..2cef339 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java @@ -0,0 +1,23 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenPumpkin extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + for (int var6 = 0; var6 < 64; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var7, var8, var9) && p_76484_1_.getBlock(var7, var8 - 1, var9) == Blocks.grass && Blocks.pumpkin.canPlaceBlockAt(p_76484_1_, var7, var8, var9)) { + p_76484_1_.setBlock(var7, var8, var9, Blocks.pumpkin, p_76484_2_.nextInt(4), 2); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java new file mode 100644 index 0000000..cb05fcc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java @@ -0,0 +1,30 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenReed extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + for (int var6 = 0; var6 < 20; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var8 = p_76484_4_; + int var9 = p_76484_5_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + + if (p_76484_1_.isAirBlock(var7, p_76484_4_, var9) && (p_76484_1_.getBlock(var7 - 1, p_76484_4_ - 1, var9).getMaterial() == Material.water || p_76484_1_.getBlock(var7 + 1, p_76484_4_ - 1, var9).getMaterial() == Material.water || p_76484_1_.getBlock(var7, p_76484_4_ - 1, var9 - 1).getMaterial() == Material.water || p_76484_1_.getBlock(var7, p_76484_4_ - 1, var9 + 1).getMaterial() == Material.water)) { + int var10 = 2 + p_76484_2_.nextInt(p_76484_2_.nextInt(3) + 1); + + for (int var11 = 0; var11 < var10; ++var11) { + if (Blocks.reeds.canBlockStay(p_76484_1_, var7, var8 + var11, var9)) { + p_76484_1_.setBlock(var7, var8 + var11, var9, Blocks.reeds, 0, 2); + } + } + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java new file mode 100644 index 0000000..020b93b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java @@ -0,0 +1,48 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenSand extends WorldGenerator { + private final Block field_150517_a; + + /** The maximum radius used when generating a patch of blocks. */ + private final int radius; + + + public WorldGenSand(Block p_i45462_1_, int p_i45462_2_) { + this.field_150517_a = p_i45462_1_; + this.radius = p_i45462_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.water) { + return false; + } else { + int var6 = p_76484_2_.nextInt(this.radius - 2) + 2; + byte var7 = 2; + + for (int var8 = p_76484_3_ - var6; var8 <= p_76484_3_ + var6; ++var8) { + for (int var9 = p_76484_5_ - var6; var9 <= p_76484_5_ + var6; ++var9) { + int var10 = var8 - p_76484_3_; + int var11 = var9 - p_76484_5_; + + if (var10 * var10 + var11 * var11 <= var6 * var6) { + for (int var12 = p_76484_4_ - var7; var12 <= p_76484_4_ + var7; ++var12) { + Block var13 = p_76484_1_.getBlock(var8, var12, var9); + + if (var13 == Blocks.dirt || var13 == Blocks.grass) { + p_76484_1_.setBlock(var8, var12, var9, this.field_150517_a, 0, 2); + } + } + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java new file mode 100644 index 0000000..95c9c5e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java @@ -0,0 +1,164 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; + +public class WorldGenSavannaTree extends WorldGenAbstractTree { + + + public WorldGenSavannaTree(boolean p_i45463_1_) { + super(p_i45463_1_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_2_.nextInt(3) + p_76484_2_.nextInt(3) + 5; + boolean var7 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var6 + 1 <= 256) { + int var10; + int var11; + + for (int var8 = p_76484_4_; var8 <= p_76484_4_ + 1 + var6; ++var8) { + byte var9 = 1; + + if (var8 == p_76484_4_) { + var9 = 0; + } + + if (var8 >= p_76484_4_ + 1 + var6 - 2) { + var9 = 2; + } + + for (var10 = p_76484_3_ - var9; var10 <= p_76484_3_ + var9 && var7; ++var10) { + for (var11 = p_76484_5_ - var9; var11 <= p_76484_5_ + var9 && var7; ++var11) { + if (var8 >= 0 && var8 < 256) { + Block var12 = p_76484_1_.getBlock(var10, var8, var11); + + if (!this.func_150523_a(var12)) { + var7 = false; + } + } else { + var7 = false; + } + } + } + } + + if (!var7) { + return false; + } else { + Block var21 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if ((var21 == Blocks.grass || var21 == Blocks.dirt) && p_76484_4_ < 256 - var6 - 1) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + int var22 = p_76484_2_.nextInt(4); + var10 = var6 - p_76484_2_.nextInt(4) - 1; + var11 = 3 - p_76484_2_.nextInt(3); + int var23 = p_76484_3_; + int var13 = p_76484_5_; + int var14 = 0; + int var15; + int var16; + + for (var15 = 0; var15 < var6; ++var15) { + var16 = p_76484_4_ + var15; + + if (var15 >= var10 && var11 > 0) { + var23 += Direction.offsetX[var22]; + var13 += Direction.offsetZ[var22]; + --var11; + } + + Block var17 = p_76484_1_.getBlock(var23, var16, var13); + + if (var17.getMaterial() == Material.air || var17.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, var23, var16, var13, Blocks.log2, 0); + var14 = var16; + } + } + + for (var15 = -1; var15 <= 1; ++var15) { + for (var16 = -1; var16 <= 1; ++var16) { + this.func_150525_a(p_76484_1_, var23 + var15, var14 + 1, var13 + var16); + } + } + + this.func_150525_a(p_76484_1_, var23 + 2, var14 + 1, var13); + this.func_150525_a(p_76484_1_, var23 - 2, var14 + 1, var13); + this.func_150525_a(p_76484_1_, var23, var14 + 1, var13 + 2); + this.func_150525_a(p_76484_1_, var23, var14 + 1, var13 - 2); + + for (var15 = -3; var15 <= 3; ++var15) { + for (var16 = -3; var16 <= 3; ++var16) { + if (Math.abs(var15) != 3 || Math.abs(var16) != 3) { + this.func_150525_a(p_76484_1_, var23 + var15, var14, var13 + var16); + } + } + } + + var23 = p_76484_3_; + var13 = p_76484_5_; + var15 = p_76484_2_.nextInt(4); + + if (var15 != var22) { + var16 = var10 - p_76484_2_.nextInt(2) - 1; + int var24 = 1 + p_76484_2_.nextInt(3); + var14 = 0; + int var18; + int var19; + + for (var18 = var16; var18 < var6 && var24 > 0; --var24) { + if (var18 >= 1) { + var19 = p_76484_4_ + var18; + var23 += Direction.offsetX[var15]; + var13 += Direction.offsetZ[var15]; + Block var20 = p_76484_1_.getBlock(var23, var19, var13); + + if (var20.getMaterial() == Material.air || var20.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, var23, var19, var13, Blocks.log2, 0); + var14 = var19; + } + } + + ++var18; + } + + if (var14 > 0) { + for (var18 = -1; var18 <= 1; ++var18) { + for (var19 = -1; var19 <= 1; ++var19) { + this.func_150525_a(p_76484_1_, var23 + var18, var14 + 1, var13 + var19); + } + } + + for (var18 = -2; var18 <= 2; ++var18) { + for (var19 = -2; var19 <= 2; ++var19) { + if (Math.abs(var18) != 2 || Math.abs(var19) != 2) { + this.func_150525_a(p_76484_1_, var23 + var18, var14, var13 + var19); + } + } + } + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } + + private void func_150525_a(World p_150525_1_, int p_150525_2_, int p_150525_3_, int p_150525_4_) { + Block var5 = p_150525_1_.getBlock(p_150525_2_, p_150525_3_, p_150525_4_); + + if (var5.getMaterial() == Material.air || var5.getMaterial() == Material.leaves) { + this.func_150516_a(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_, Blocks.leaves2, 0); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java new file mode 100644 index 0000000..b4d7473 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java @@ -0,0 +1,53 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenShrub extends WorldGenTrees { + private final int field_150528_a; + private final int field_150527_b; + + + public WorldGenShrub(int p_i2015_1_, int p_i2015_2_) { + super(false); + this.field_150527_b = p_i2015_1_; + this.field_150528_a = p_i2015_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + Block var6; + + while (((var6 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_)).getMaterial() == Material.air || var6.getMaterial() == Material.leaves) && p_76484_4_ > 0) { + --p_76484_4_; + } + + Block var7 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_); + + if (var7 == Blocks.dirt || var7 == Blocks.grass) { + ++p_76484_4_; + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, Blocks.log, this.field_150527_b); + + for (int var8 = p_76484_4_; var8 <= p_76484_4_ + 2; ++var8) { + int var9 = var8 - p_76484_4_; + int var10 = 2 - var9; + + for (int var11 = p_76484_3_ - var10; var11 <= p_76484_3_ + var10; ++var11) { + int var12 = var11 - p_76484_3_; + + for (int var13 = p_76484_5_ - var10; var13 <= p_76484_5_ + var10; ++var13) { + int var14 = var13 - p_76484_5_; + + if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || p_76484_2_.nextInt(2) != 0) && !p_76484_1_.getBlock(var11, var8, var13).func_149730_j()) { + this.func_150516_a(p_76484_1_, var11, var8, var13, Blocks.leaves, this.field_150528_a); + } + } + } + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java new file mode 100644 index 0000000..68308b1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java @@ -0,0 +1,59 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenSpikes extends WorldGenerator { + private final Block field_150520_a; + + + public WorldGenSpikes(Block p_i45464_1_) { + this.field_150520_a = p_i45464_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) == this.field_150520_a) { + int var6 = p_76484_2_.nextInt(32) + 6; + int var7 = p_76484_2_.nextInt(4) + 1; + int var8; + int var9; + int var10; + int var11; + + for (var8 = p_76484_3_ - var7; var8 <= p_76484_3_ + var7; ++var8) { + for (var9 = p_76484_5_ - var7; var9 <= p_76484_5_ + var7; ++var9) { + var10 = var8 - p_76484_3_; + var11 = var9 - p_76484_5_; + + if (var10 * var10 + var11 * var11 <= var7 * var7 + 1 && p_76484_1_.getBlock(var8, p_76484_4_ - 1, var9) != this.field_150520_a) { + return false; + } + } + } + + for (var8 = p_76484_4_; var8 < p_76484_4_ + var6 && var8 < 256; ++var8) { + for (var9 = p_76484_3_ - var7; var9 <= p_76484_3_ + var7; ++var9) { + for (var10 = p_76484_5_ - var7; var10 <= p_76484_5_ + var7; ++var10) { + var11 = var9 - p_76484_3_; + int var12 = var10 - p_76484_5_; + + if (var11 * var11 + var12 * var12 <= var7 * var7 + 1) { + p_76484_1_.setBlock(var9, var8, var10, Blocks.obsidian, 0, 2); + } + } + } + } + + EntityEnderCrystal var13 = new EntityEnderCrystal(p_76484_1_); + var13.setLocationAndAngles((float)p_76484_3_ + 0.5F, p_76484_4_ + var6, (float)p_76484_5_ + 0.5F, p_76484_2_.nextFloat() * 360.0F, 0.0F); + p_76484_1_.spawnEntityInWorld(var13); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + var6, p_76484_5_, Blocks.bedrock, 0, 2); + return true; + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java new file mode 100644 index 0000000..6d8762a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java @@ -0,0 +1,149 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenSwamp extends WorldGenAbstractTree { + + + public WorldGenSwamp() { + super(false); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6; + + for (var6 = p_76484_2_.nextInt(4) + 5; p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_).getMaterial() == Material.water; --p_76484_4_) { + } + + boolean var7 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var6 + 1 <= 256) { + int var10; + int var11; + + for (int var8 = p_76484_4_; var8 <= p_76484_4_ + 1 + var6; ++var8) { + byte var9 = 1; + + if (var8 == p_76484_4_) { + var9 = 0; + } + + if (var8 >= p_76484_4_ + 1 + var6 - 2) { + var9 = 3; + } + + for (var10 = p_76484_3_ - var9; var10 <= p_76484_3_ + var9 && var7; ++var10) { + for (var11 = p_76484_5_ - var9; var11 <= p_76484_5_ + var9 && var7; ++var11) { + if (var8 >= 0 && var8 < 256) { + Block var12 = p_76484_1_.getBlock(var10, var8, var11); + + if (var12.getMaterial() != Material.air && var12.getMaterial() != Material.leaves) { + if (var12 != Blocks.water && var12 != Blocks.flowing_water) { + var7 = false; + } else if (var8 > p_76484_4_) { + var7 = false; + } + } + } else { + var7 = false; + } + } + } + } + + if (!var7) { + return false; + } else { + Block var16 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if ((var16 == Blocks.grass || var16 == Blocks.dirt) && p_76484_4_ < 256 - var6 - 1) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + int var13; + int var17; + int var19; + + for (var17 = p_76484_4_ - 3 + var6; var17 <= p_76484_4_ + var6; ++var17) { + var10 = var17 - (p_76484_4_ + var6); + var11 = 2 - var10 / 2; + + for (var19 = p_76484_3_ - var11; var19 <= p_76484_3_ + var11; ++var19) { + var13 = var19 - p_76484_3_; + + for (int var14 = p_76484_5_ - var11; var14 <= p_76484_5_ + var11; ++var14) { + int var15 = var14 - p_76484_5_; + + if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || p_76484_2_.nextInt(2) != 0 && var10 != 0) && !p_76484_1_.getBlock(var19, var17, var14).func_149730_j()) { + this.func_150515_a(p_76484_1_, var19, var17, var14, Blocks.leaves); + } + } + } + } + + for (var17 = 0; var17 < var6; ++var17) { + Block var18 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var17, p_76484_5_); + + if (var18.getMaterial() == Material.air || var18.getMaterial() == Material.leaves || var18 == Blocks.flowing_water || var18 == Blocks.water) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ + var17, p_76484_5_, Blocks.log); + } + } + + for (var17 = p_76484_4_ - 3 + var6; var17 <= p_76484_4_ + var6; ++var17) { + var10 = var17 - (p_76484_4_ + var6); + var11 = 2 - var10 / 2; + + for (var19 = p_76484_3_ - var11; var19 <= p_76484_3_ + var11; ++var19) { + for (var13 = p_76484_5_ - var11; var13 <= p_76484_5_ + var11; ++var13) { + if (p_76484_1_.getBlock(var19, var17, var13).getMaterial() == Material.leaves) { + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var19 - 1, var17, var13).getMaterial() == Material.air) { + this.generateVines(p_76484_1_, var19 - 1, var17, var13, 8); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var19 + 1, var17, var13).getMaterial() == Material.air) { + this.generateVines(p_76484_1_, var19 + 1, var17, var13, 2); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var19, var17, var13 - 1).getMaterial() == Material.air) { + this.generateVines(p_76484_1_, var19, var17, var13 - 1, 1); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var19, var17, var13 + 1).getMaterial() == Material.air) { + this.generateVines(p_76484_1_, var19, var17, var13 + 1, 4); + } + } + } + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } + + /** + * Generates vines at the given position until it hits a block. + */ + private void generateVines(World p_76536_1_, int p_76536_2_, int p_76536_3_, int p_76536_4_, int p_76536_5_) { + this.func_150516_a(p_76536_1_, p_76536_2_, p_76536_3_, p_76536_4_, Blocks.vine, p_76536_5_); + int var6 = 4; + + while (true) { + --p_76536_3_; + + if (p_76536_1_.getBlock(p_76536_2_, p_76536_3_, p_76536_4_).getMaterial() != Material.air || var6 <= 0) { + return; + } + + this.func_150516_a(p_76536_1_, p_76536_2_, p_76536_3_, p_76536_4_, Blocks.vine, p_76536_5_); + --var6; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java new file mode 100644 index 0000000..cef111c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java @@ -0,0 +1,98 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenTaiga1 extends WorldGenAbstractTree { + + + public WorldGenTaiga1() { + super(false); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_2_.nextInt(5) + 7; + int var7 = var6 - p_76484_2_.nextInt(2) - 3; + int var8 = var6 - var7; + int var9 = 1 + p_76484_2_.nextInt(var8 + 1); + boolean var10 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var6 + 1 <= 256) { + int var13; + int var14; + int var19; + + for (int var11 = p_76484_4_; var11 <= p_76484_4_ + 1 + var6 && var10; ++var11) { + boolean var12 = true; + + if (var11 - p_76484_4_ < var7) { + var19 = 0; + } else { + var19 = var9; + } + + for (var13 = p_76484_3_ - var19; var13 <= p_76484_3_ + var19 && var10; ++var13) { + for (var14 = p_76484_5_ - var19; var14 <= p_76484_5_ + var19 && var10; ++var14) { + if (var11 >= 0 && var11 < 256) { + Block var15 = p_76484_1_.getBlock(var13, var11, var14); + + if (!this.func_150523_a(var15)) { + var10 = false; + } + } else { + var10 = false; + } + } + } + } + + if (!var10) { + return false; + } else { + Block var18 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if ((var18 == Blocks.grass || var18 == Blocks.dirt) && p_76484_4_ < 256 - var6 - 1) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + var19 = 0; + + for (var13 = p_76484_4_ + var6; var13 >= p_76484_4_ + var7; --var13) { + for (var14 = p_76484_3_ - var19; var14 <= p_76484_3_ + var19; ++var14) { + int var21 = var14 - p_76484_3_; + + for (int var16 = p_76484_5_ - var19; var16 <= p_76484_5_ + var19; ++var16) { + int var17 = var16 - p_76484_5_; + + if ((Math.abs(var21) != var19 || Math.abs(var17) != var19 || var19 <= 0) && !p_76484_1_.getBlock(var14, var13, var16).func_149730_j()) { + this.func_150516_a(p_76484_1_, var14, var13, var16, Blocks.leaves, 1); + } + } + } + + if (var19 >= 1 && var13 == p_76484_4_ + var7 + 1) { + --var19; + } else if (var19 < var9) { + ++var19; + } + } + + for (var13 = 0; var13 < var6 - 1; ++var13) { + Block var20 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var13, p_76484_5_); + + if (var20.getMaterial() == Material.air || var20.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var13, p_76484_5_, Blocks.log, 1); + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java new file mode 100644 index 0000000..b91337f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java @@ -0,0 +1,111 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenTaiga2 extends WorldGenAbstractTree { + + + public WorldGenTaiga2(boolean p_i2025_1_) { + super(p_i2025_1_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_2_.nextInt(4) + 6; + int var7 = 1 + p_76484_2_.nextInt(2); + int var8 = var6 - var7; + int var9 = 2 + p_76484_2_.nextInt(2); + boolean var10 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var6 + 1 <= 256) { + int var13; + int var22; + + for (int var11 = p_76484_4_; var11 <= p_76484_4_ + 1 + var6 && var10; ++var11) { + boolean var12 = true; + + if (var11 - p_76484_4_ < var7) { + var22 = 0; + } else { + var22 = var9; + } + + for (var13 = p_76484_3_ - var22; var13 <= p_76484_3_ + var22 && var10; ++var13) { + for (int var14 = p_76484_5_ - var22; var14 <= p_76484_5_ + var22 && var10; ++var14) { + if (var11 >= 0 && var11 < 256) { + Block var15 = p_76484_1_.getBlock(var13, var11, var14); + + if (var15.getMaterial() != Material.air && var15.getMaterial() != Material.leaves) { + var10 = false; + } + } else { + var10 = false; + } + } + } + } + + if (!var10) { + return false; + } else { + Block var21 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if ((var21 == Blocks.grass || var21 == Blocks.dirt || var21 == Blocks.farmland) && p_76484_4_ < 256 - var6 - 1) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + var22 = p_76484_2_.nextInt(2); + var13 = 1; + byte var23 = 0; + int var16; + int var24; + + for (var24 = 0; var24 <= var8; ++var24) { + var16 = p_76484_4_ + var6 - var24; + + for (int var17 = p_76484_3_ - var22; var17 <= p_76484_3_ + var22; ++var17) { + int var18 = var17 - p_76484_3_; + + for (int var19 = p_76484_5_ - var22; var19 <= p_76484_5_ + var22; ++var19) { + int var20 = var19 - p_76484_5_; + + if ((Math.abs(var18) != var22 || Math.abs(var20) != var22 || var22 <= 0) && !p_76484_1_.getBlock(var17, var16, var19).func_149730_j()) { + this.func_150516_a(p_76484_1_, var17, var16, var19, Blocks.leaves, 1); + } + } + } + + if (var22 >= var13) { + var22 = var23; + var23 = 1; + ++var13; + + if (var13 > var9) { + var13 = var9; + } + } else { + ++var22; + } + } + + var24 = p_76484_2_.nextInt(3); + + for (var16 = 0; var16 < var6 - var24; ++var16) { + Block var25 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var16, p_76484_5_); + + if (var25.getMaterial() == Material.air || var25.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var16, p_76484_5_, Blocks.log, 1); + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java new file mode 100644 index 0000000..1feb5a0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java @@ -0,0 +1,37 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.world.World; + +public class WorldGenTallGrass extends WorldGenerator { + private final Block field_150522_a; + private final int tallGrassMetadata; + + + public WorldGenTallGrass(Block p_i45466_1_, int p_i45466_2_) { + this.field_150522_a = p_i45466_1_; + this.tallGrassMetadata = p_i45466_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + Block var6; + + while (((var6 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_)).getMaterial() == Material.air || var6.getMaterial() == Material.leaves) && p_76484_4_ > 0) { + --p_76484_4_; + } + + for (int var7 = 0; var7 < 128; ++var7) { + int var8 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var9 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var10 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var8, var9, var10) && this.field_150522_a.canBlockStay(p_76484_1_, var8, var9, var10)) { + p_76484_1_.setBlock(var8, var9, var10, this.field_150522_a, this.tallGrassMetadata, 2); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java new file mode 100644 index 0000000..ef01ee9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java @@ -0,0 +1,200 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; + +public class WorldGenTrees extends WorldGenAbstractTree { + /** The minimum height of a generated tree. */ + private final int minTreeHeight; + + /** True if this tree should grow Vines. */ + private final boolean vinesGrow; + + /** The metadata value of the wood to use in tree generation. */ + private final int metaWood; + + /** The metadata value of the leaves to use in tree generation. */ + private final int metaLeaves; + + + public WorldGenTrees(boolean p_i2027_1_) { + this(p_i2027_1_, 4, 0, 0, false); + } + + public WorldGenTrees(boolean p_i2028_1_, int p_i2028_2_, int p_i2028_3_, int p_i2028_4_, boolean p_i2028_5_) { + super(p_i2028_1_); + this.minTreeHeight = p_i2028_2_; + this.metaWood = p_i2028_3_; + this.metaLeaves = p_i2028_4_; + this.vinesGrow = p_i2028_5_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_2_.nextInt(3) + this.minTreeHeight; + boolean var7 = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + var6 + 1 <= 256) { + byte var9; + int var11; + Block var12; + + for (int var8 = p_76484_4_; var8 <= p_76484_4_ + 1 + var6; ++var8) { + var9 = 1; + + if (var8 == p_76484_4_) { + var9 = 0; + } + + if (var8 >= p_76484_4_ + 1 + var6 - 2) { + var9 = 2; + } + + for (int var10 = p_76484_3_ - var9; var10 <= p_76484_3_ + var9 && var7; ++var10) { + for (var11 = p_76484_5_ - var9; var11 <= p_76484_5_ + var9 && var7; ++var11) { + if (var8 >= 0 && var8 < 256) { + var12 = p_76484_1_.getBlock(var10, var8, var11); + + if (!this.func_150523_a(var12)) { + var7 = false; + } + } else { + var7 = false; + } + } + } + } + + if (!var7) { + return false; + } else { + Block var19 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if ((var19 == Blocks.grass || var19 == Blocks.dirt || var19 == Blocks.farmland) && p_76484_4_ < 256 - var6 - 1) { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.dirt); + var9 = 3; + byte var20 = 0; + int var13; + int var14; + int var15; + int var21; + + for (var11 = p_76484_4_ - var9 + var6; var11 <= p_76484_4_ + var6; ++var11) { + var21 = var11 - (p_76484_4_ + var6); + var13 = var20 + 1 - var21 / 2; + + for (var14 = p_76484_3_ - var13; var14 <= p_76484_3_ + var13; ++var14) { + var15 = var14 - p_76484_3_; + + for (int var16 = p_76484_5_ - var13; var16 <= p_76484_5_ + var13; ++var16) { + int var17 = var16 - p_76484_5_; + + if (Math.abs(var15) != var13 || Math.abs(var17) != var13 || p_76484_2_.nextInt(2) != 0 && var21 != 0) { + Block var18 = p_76484_1_.getBlock(var14, var11, var16); + + if (var18.getMaterial() == Material.air || var18.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, var14, var11, var16, Blocks.leaves, this.metaLeaves); + } + } + } + } + } + + for (var11 = 0; var11 < var6; ++var11) { + var12 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + var11, p_76484_5_); + + if (var12.getMaterial() == Material.air || var12.getMaterial() == Material.leaves) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var11, p_76484_5_, Blocks.log, this.metaWood); + + if (this.vinesGrow && var11 > 0) { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_ + var11, p_76484_5_)) { + this.func_150516_a(p_76484_1_, p_76484_3_ - 1, p_76484_4_ + var11, p_76484_5_, Blocks.vine, 8); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_ + var11, p_76484_5_)) { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + var11, p_76484_5_, Blocks.vine, 2); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + var11, p_76484_5_ - 1)) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var11, p_76484_5_ - 1, Blocks.vine, 1); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + var11, p_76484_5_ + 1)) { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + var11, p_76484_5_ + 1, Blocks.vine, 4); + } + } + } + } + + if (this.vinesGrow) { + for (var11 = p_76484_4_ - 3 + var6; var11 <= p_76484_4_ + var6; ++var11) { + var21 = var11 - (p_76484_4_ + var6); + var13 = 2 - var21 / 2; + + for (var14 = p_76484_3_ - var13; var14 <= p_76484_3_ + var13; ++var14) { + for (var15 = p_76484_5_ - var13; var15 <= p_76484_5_ + var13; ++var15) { + if (p_76484_1_.getBlock(var14, var11, var15).getMaterial() == Material.leaves) { + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var14 - 1, var11, var15).getMaterial() == Material.air) { + this.growVines(p_76484_1_, var14 - 1, var11, var15, 8); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var14 + 1, var11, var15).getMaterial() == Material.air) { + this.growVines(p_76484_1_, var14 + 1, var11, var15, 2); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var14, var11, var15 - 1).getMaterial() == Material.air) { + this.growVines(p_76484_1_, var14, var11, var15 - 1, 1); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(var14, var11, var15 + 1).getMaterial() == Material.air) { + this.growVines(p_76484_1_, var14, var11, var15 + 1, 4); + } + } + } + } + } + + if (p_76484_2_.nextInt(5) == 0 && var6 > 5) { + for (var11 = 0; var11 < 2; ++var11) { + for (var21 = 0; var21 < 4; ++var21) { + if (p_76484_2_.nextInt(4 - var11) == 0) { + var13 = p_76484_2_.nextInt(3); + this.func_150516_a(p_76484_1_, p_76484_3_ + Direction.offsetX[Direction.rotateOpposite[var21]], p_76484_4_ + var6 - 5 + var11, p_76484_5_ + Direction.offsetZ[Direction.rotateOpposite[var21]], Blocks.cocoa, var13 << 2 | var21); + } + } + } + } + } + + return true; + } else { + return false; + } + } + } else { + return false; + } + } + + /** + * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length + */ + private void growVines(World p_76529_1_, int p_76529_2_, int p_76529_3_, int p_76529_4_, int p_76529_5_) { + this.func_150516_a(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_); + int var6 = 4; + + while (true) { + --p_76529_3_; + + if (p_76529_1_.getBlock(p_76529_2_, p_76529_3_, p_76529_4_).getMaterial() != Material.air || var6 <= 0) { + return; + } + + this.func_150516_a(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_); + --var6; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java new file mode 100644 index 0000000..d5014b4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java @@ -0,0 +1,31 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.util.Facing; +import net.minecraft.world.World; + +public class WorldGenVines extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + int var6 = p_76484_3_; + + for (int var7 = p_76484_5_; p_76484_4_ < 128; ++p_76484_4_) { + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_)) { + for (int var8 = 2; var8 <= 5; ++var8) { + if (Blocks.vine.canPlaceBlockOnSide(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, var8)) { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.vine, 1 << Direction.facingToDirection[Facing.oppositeSide[var8]], 2); + break; + } + } + } else { + p_76484_3_ = var6 + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + p_76484_5_ = var7 + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java new file mode 100644 index 0000000..79ba398 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java @@ -0,0 +1,23 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenWaterlily extends WorldGenerator { + + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + for (int var6 = 0; var6 < 10; ++var6) { + int var7 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int var8 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var9 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(var7, var8, var9) && Blocks.waterlily.canPlaceBlockAt(p_76484_1_, var7, var8, var9)) { + p_76484_1_.setBlock(var7, var8, var9, Blocks.waterlily, 0, 2); + } + } + + return true; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java new file mode 100644 index 0000000..927e631 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java @@ -0,0 +1,41 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public abstract class WorldGenerator { + /** + * Sets wither or not the generator should notify blocks of blocks it changes. When the world is first generated, + * this is false, when saplings grow, this is true. + */ + private final boolean doBlockNotify; + + + public WorldGenerator() { + this.doBlockNotify = false; + } + + public WorldGenerator(boolean p_i2013_1_) { + this.doBlockNotify = p_i2013_1_; + } + + public abstract boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_); + + /** + * Rescales the generator settings, only used in WorldGenBigTree + */ + public void setScale(double p_76487_1_, double p_76487_3_, double p_76487_5_) {} + + protected void func_150515_a(World p_150515_1_, int p_150515_2_, int p_150515_3_, int p_150515_4_, Block p_150515_5_) { + this.func_150516_a(p_150515_1_, p_150515_2_, p_150515_3_, p_150515_4_, p_150515_5_, 0); + } + + protected void func_150516_a(World p_150516_1_, int p_150516_2_, int p_150516_3_, int p_150516_4_, Block p_150516_5_, int p_150516_6_) { + if (this.doBlockNotify) { + p_150516_1_.setBlock(p_150516_2_, p_150516_3_, p_150516_4_, p_150516_5_, p_150516_6_, 3); + } else { + p_150516_1_.setBlock(p_150516_2_, p_150516_3_, p_150516_4_, p_150516_5_, p_150516_6_, 2); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java new file mode 100644 index 0000000..5f71f56 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java @@ -0,0 +1,76 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class WorldGeneratorBonusChest extends WorldGenerator { + /** + * Instance of WeightedRandomChestContent what will randomly generate items into the Bonus Chest. + */ + private final WeightedRandomChestContent[] theBonusChestGenerator; + + /** + * Value of this int will determine how much items gonna generate in Bonus Chest. + */ + private final int itemsToGenerateInBonusChest; + + + public WorldGeneratorBonusChest(WeightedRandomChestContent[] p_i2010_1_, int p_i2010_2_) { + this.theBonusChestGenerator = p_i2010_1_; + this.itemsToGenerateInBonusChest = p_i2010_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + Block var6; + + while (((var6 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_)).getMaterial() == Material.air || var6.getMaterial() == Material.leaves) && p_76484_4_ > 1) { + --p_76484_4_; + } + + if (p_76484_4_ < 1) { + return false; + } else { + ++p_76484_4_; + + for (int var7 = 0; var7 < 4; ++var7) { + int var8 = p_76484_3_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int var9 = p_76484_4_ + p_76484_2_.nextInt(3) - p_76484_2_.nextInt(3); + int var10 = p_76484_5_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + + if (p_76484_1_.isAirBlock(var8, var9, var10) && World.doesBlockHaveSolidTopSurface(p_76484_1_, var8, var9 - 1, var10)) { + p_76484_1_.setBlock(var8, var9, var10, Blocks.chest, 0, 2); + TileEntityChest var11 = (TileEntityChest)p_76484_1_.getTileEntity(var8, var9, var10); + + if (var11 != null && var11 != null) { + WeightedRandomChestContent.generateChestContents(p_76484_2_, this.theBonusChestGenerator, var11, this.itemsToGenerateInBonusChest); + } + + if (p_76484_1_.isAirBlock(var8 - 1, var9, var10) && World.doesBlockHaveSolidTopSurface(p_76484_1_, var8 - 1, var9 - 1, var10)) { + p_76484_1_.setBlock(var8 - 1, var9, var10, Blocks.torch, 0, 2); + } + + if (p_76484_1_.isAirBlock(var8 + 1, var9, var10) && World.doesBlockHaveSolidTopSurface(p_76484_1_, var8 - 1, var9 - 1, var10)) { + p_76484_1_.setBlock(var8 + 1, var9, var10, Blocks.torch, 0, 2); + } + + if (p_76484_1_.isAirBlock(var8, var9, var10 - 1) && World.doesBlockHaveSolidTopSurface(p_76484_1_, var8 - 1, var9 - 1, var10)) { + p_76484_1_.setBlock(var8, var9, var10 - 1, Blocks.torch, 0, 2); + } + + if (p_76484_1_.isAirBlock(var8, var9, var10 + 1) && World.doesBlockHaveSolidTopSurface(p_76484_1_, var8 - 1, var9 - 1, var10)) { + p_76484_1_.setBlock(var8, var9, var10 + 1, Blocks.torch, 0, 2); + } + + return true; + } + } + + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayer.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayer.java new file mode 100644 index 0000000..a30bb6f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayer.java @@ -0,0 +1,205 @@ +package net.minecraft.world.gen.layer; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; + +public abstract class GenLayer { + /** seed from World#getWorldSeed that is used in the LCG prng */ + private long worldGenSeed; + + /** parent GenLayer that was provided via the constructor */ + protected GenLayer parent; + + /** + * final part of the LCG prng that uses the chunk X, Z coords along with the other two seeds to generate + * pseudorandom numbers + */ + private long chunkSeed; + + /** base seed to the LCG prng provided via the constructor */ + protected long baseSeed; + + + /** + * the first array item is a linked list of the bioms, the second is the zoom function, the third is the same as the + * first. + */ + public static GenLayer[] initializeAllBiomeGenerators(long p_75901_0_, WorldType p_75901_2_) { + boolean var3 = false; + GenLayerIsland var4 = new GenLayerIsland(1L); + GenLayerFuzzyZoom var11 = new GenLayerFuzzyZoom(2000L, var4); + GenLayerAddIsland var12 = new GenLayerAddIsland(1L, var11); + GenLayerZoom var13 = new GenLayerZoom(2001L, var12); + var12 = new GenLayerAddIsland(2L, var13); + var12 = new GenLayerAddIsland(50L, var12); + var12 = new GenLayerAddIsland(70L, var12); + GenLayerRemoveTooMuchOcean var14 = new GenLayerRemoveTooMuchOcean(2L, var12); + GenLayerAddSnow var15 = new GenLayerAddSnow(2L, var14); + var12 = new GenLayerAddIsland(3L, var15); + GenLayerEdge var16 = new GenLayerEdge(2L, var12, GenLayerEdge.Mode.COOL_WARM); + var16 = new GenLayerEdge(2L, var16, GenLayerEdge.Mode.HEAT_ICE); + var16 = new GenLayerEdge(3L, var16, GenLayerEdge.Mode.SPECIAL); + var13 = new GenLayerZoom(2002L, var16); + var13 = new GenLayerZoom(2003L, var13); + var12 = new GenLayerAddIsland(4L, var13); + GenLayerAddMushroomIsland var17 = new GenLayerAddMushroomIsland(5L, var12); + GenLayerDeepOcean var18 = new GenLayerDeepOcean(4L, var17); + GenLayer var19 = GenLayerZoom.magnify(1000L, var18, 0); + byte var5 = 4; + + if (p_75901_2_ == WorldType.LARGE_BIOMES) { + var5 = 6; + } + + if (var3) { + var5 = 4; + } + + GenLayer var6 = GenLayerZoom.magnify(1000L, var19, 0); + GenLayerRiverInit var20 = new GenLayerRiverInit(100L, var6); + Object var7 = new GenLayerBiome(200L, var19, p_75901_2_); + + if (!var3) { + GenLayer var23 = GenLayerZoom.magnify(1000L, (GenLayer)var7, 2); + var7 = new GenLayerBiomeEdge(1000L, var23); + } + + GenLayer var8 = GenLayerZoom.magnify(1000L, var20, 2); + GenLayerHills var24 = new GenLayerHills(1000L, (GenLayer)var7, var8); + var6 = GenLayerZoom.magnify(1000L, var20, 2); + var6 = GenLayerZoom.magnify(1000L, var6, var5); + GenLayerRiver var21 = new GenLayerRiver(1L, var6); + GenLayerSmooth var22 = new GenLayerSmooth(1000L, var21); + var7 = new GenLayerRareBiome(1001L, var24); + + for (int var9 = 0; var9 < var5; ++var9) { + var7 = new GenLayerZoom(1000 + var9, (GenLayer)var7); + + if (var9 == 0) { + var7 = new GenLayerAddIsland(3L, (GenLayer)var7); + } + + if (var9 == 1) { + var7 = new GenLayerShore(1000L, (GenLayer)var7); + } + } + + GenLayerSmooth var25 = new GenLayerSmooth(1000L, (GenLayer)var7); + GenLayerRiverMix var26 = new GenLayerRiverMix(100L, var25, var22); + GenLayerVoronoiZoom var10 = new GenLayerVoronoiZoom(10L, var26); + var26.initWorldGenSeed(p_75901_0_); + var10.initWorldGenSeed(p_75901_0_); + return new GenLayer[] {var26, var10, var26}; + } + + public GenLayer(long p_i2125_1_) { + this.baseSeed = p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + } + + /** + * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an + * argument). + */ + public void initWorldGenSeed(long p_75905_1_) { + this.worldGenSeed = p_75905_1_; + + if (this.parent != null) { + this.parent.initWorldGenSeed(p_75905_1_); + } + + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + } + + /** + * Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates. + */ + public void initChunkSeed(long p_75903_1_, long p_75903_3_) { + this.chunkSeed = this.worldGenSeed; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_1_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_3_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_1_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_3_; + } + + /** + * returns a LCG pseudo random number from [0, x). Args: int x + */ + protected int nextInt(int p_75902_1_) { + int var2 = (int)((this.chunkSeed >> 24) % (long)p_75902_1_); + + if (var2 < 0) { + var2 += p_75902_1_; + } + + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += this.worldGenSeed; + return var2; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public abstract int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_); + + protected static boolean func_151616_a(final int p_151616_0_, final int p_151616_1_) { + if (p_151616_0_ == p_151616_1_) { + return true; + } else if (p_151616_0_ != BiomeGenBase.field_150607_aa.biomeID && p_151616_0_ != BiomeGenBase.field_150608_ab.biomeID) { + try { + return BiomeGenBase.func_150568_d(p_151616_0_) != null && BiomeGenBase.func_150568_d(p_151616_1_) != null && BiomeGenBase.func_150568_d(p_151616_0_).func_150569_a(BiomeGenBase.func_150568_d(p_151616_1_)); + } catch (Throwable var5) { + CrashReport var3 = CrashReport.makeCrashReport(var5, "Comparing biomes"); + CrashReportCategory var4 = var3.makeCategory("Biomes being compared"); + var4.addCrashSection("Biome A ID", Integer.valueOf(p_151616_0_)); + var4.addCrashSection("Biome B ID", Integer.valueOf(p_151616_1_)); + var4.addCrashSectionCallable("Biome A", new Callable() { + + public String call() { + return String.valueOf(BiomeGenBase.func_150568_d(p_151616_0_)); + } + }); + var4.addCrashSectionCallable("Biome B", new Callable() { + + public String call() { + return String.valueOf(BiomeGenBase.func_150568_d(p_151616_1_)); + } + }); + throw new ReportedException(var3); + } + } else { + return p_151616_1_ == BiomeGenBase.field_150607_aa.biomeID || p_151616_1_ == BiomeGenBase.field_150608_ab.biomeID; + } + } + + protected static boolean func_151618_b(int p_151618_0_) { + return p_151618_0_ == BiomeGenBase.ocean.biomeID || p_151618_0_ == BiomeGenBase.field_150575_M.biomeID || p_151618_0_ == BiomeGenBase.frozenOcean.biomeID; + } + + protected int func_151619_a(int ... p_151619_1_) { + return p_151619_1_[this.nextInt(p_151619_1_.length)]; + } + + protected int func_151617_b(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) { + return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.func_151619_a(p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_)))))))))); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java new file mode 100644 index 0000000..7df7a19 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java @@ -0,0 +1,77 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerAddIsland extends GenLayer { + + + public GenLayerAddIsland(long p_i2119_1_, GenLayer p_i2119_3_) { + super(p_i2119_1_); + this.parent = p_i2119_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ - 1; + int var6 = p_75904_2_ - 1; + int var7 = p_75904_3_ + 2; + int var8 = p_75904_4_ + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var11 = 0; var11 < p_75904_4_; ++var11) { + for (int var12 = 0; var12 < p_75904_3_; ++var12) { + int var13 = var9[var12 + 0 + (var11 + 0) * var7]; + int var14 = var9[var12 + 2 + (var11 + 0) * var7]; + int var15 = var9[var12 + 0 + (var11 + 2) * var7]; + int var16 = var9[var12 + 2 + (var11 + 2) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; + this.initChunkSeed(var12 + p_75904_1_, var11 + p_75904_2_); + + if (var17 == 0 && (var13 != 0 || var14 != 0 || var15 != 0 || var16 != 0)) { + int var18 = 1; + int var19 = 1; + + if (var13 != 0 && this.nextInt(var18++) == 0) { + var19 = var13; + } + + if (var14 != 0 && this.nextInt(var18++) == 0) { + var19 = var14; + } + + if (var15 != 0 && this.nextInt(var18++) == 0) { + var19 = var15; + } + + if (var16 != 0 && this.nextInt(var18++) == 0) { + var19 = var16; + } + + if (this.nextInt(3) == 0) { + var10[var12 + var11 * p_75904_3_] = var19; + } else if (var19 == 4) { + var10[var12 + var11 * p_75904_3_] = 4; + } else { + var10[var12 + var11 * p_75904_3_] = 0; + } + } else if (var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0)) { + if (this.nextInt(5) == 0) { + if (var17 == 4) { + var10[var12 + var11 * p_75904_3_] = 4; + } else { + var10[var12 + var11 * p_75904_3_] = 0; + } + } else { + var10[var12 + var11 * p_75904_3_] = var17; + } + } else { + var10[var12 + var11 * p_75904_3_] = var17; + } + } + } + + return var10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java new file mode 100644 index 0000000..ef2fdf6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java @@ -0,0 +1,44 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerAddMushroomIsland extends GenLayer { + + + public GenLayerAddMushroomIsland(long p_i2120_1_, GenLayer p_i2120_3_) { + super(p_i2120_1_); + this.parent = p_i2120_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ - 1; + int var6 = p_75904_2_ - 1; + int var7 = p_75904_3_ + 2; + int var8 = p_75904_4_ + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var11 = 0; var11 < p_75904_4_; ++var11) { + for (int var12 = 0; var12 < p_75904_3_; ++var12) { + int var13 = var9[var12 + 0 + (var11 + 0) * var7]; + int var14 = var9[var12 + 2 + (var11 + 0) * var7]; + int var15 = var9[var12 + 0 + (var11 + 2) * var7]; + int var16 = var9[var12 + 2 + (var11 + 2) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; + this.initChunkSeed(var12 + p_75904_1_, var11 + p_75904_2_); + + if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) { + var10[var12 + var11 * p_75904_3_] = BiomeGenBase.mushroomIsland.biomeID; + } else { + var10[var12 + var11 * p_75904_3_] = var17; + } + } + } + + return var10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java new file mode 100644 index 0000000..be88cfa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java @@ -0,0 +1,49 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerAddSnow extends GenLayer { + + + public GenLayerAddSnow(long p_i2121_1_, GenLayer p_i2121_3_) { + super(p_i2121_1_); + this.parent = p_i2121_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ - 1; + int var6 = p_75904_2_ - 1; + int var7 = p_75904_3_ + 2; + int var8 = p_75904_4_ + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var11 = 0; var11 < p_75904_4_; ++var11) { + for (int var12 = 0; var12 < p_75904_3_; ++var12) { + int var13 = var9[var12 + 1 + (var11 + 1) * var7]; + this.initChunkSeed(var12 + p_75904_1_, var11 + p_75904_2_); + + if (var13 == 0) { + var10[var12 + var11 * p_75904_3_] = 0; + } else { + int var14 = this.nextInt(6); + byte var15; + + if (var14 == 0) { + var15 = 4; + } else if (var14 <= 1) { + var15 = 3; + } else { + var15 = 1; + } + + var10[var12 + var11 * p_75904_3_] = var15; + } + } + } + + return var10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java new file mode 100644 index 0000000..951d335 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java @@ -0,0 +1,77 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerBiome extends GenLayer { + private BiomeGenBase[] field_151623_c; + private final BiomeGenBase[] field_151621_d; + private final BiomeGenBase[] field_151622_e; + private final BiomeGenBase[] field_151620_f; + + + public GenLayerBiome(long p_i2122_1_, GenLayer p_i2122_3_, WorldType p_i2122_4_) { + super(p_i2122_1_); + this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.field_150588_X, BiomeGenBase.field_150588_X, BiomeGenBase.plains}; + this.field_151621_d = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.field_150585_R, BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.field_150583_P, BiomeGenBase.swampland}; + this.field_151622_e = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.taiga, BiomeGenBase.plains}; + this.field_151620_f = new BiomeGenBase[] {BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.field_150584_S}; + this.parent = p_i2122_3_; + + if (p_i2122_4_ == WorldType.DEFAULT_1_1) { + this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; + } + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = this.parent.getInts(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_); + int[] var6 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var7 = 0; var7 < p_75904_4_; ++var7) { + for (int var8 = 0; var8 < p_75904_3_; ++var8) { + this.initChunkSeed(var8 + p_75904_1_, var7 + p_75904_2_); + int var9 = var5[var8 + var7 * p_75904_3_]; + int var10 = (var9 & 3840) >> 8; + var9 &= -3841; + + if (func_151618_b(var9)) { + var6[var8 + var7 * p_75904_3_] = var9; + } else if (var9 == BiomeGenBase.mushroomIsland.biomeID) { + var6[var8 + var7 * p_75904_3_] = var9; + } else if (var9 == 1) { + if (var10 > 0) { + if (this.nextInt(3) == 0) { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.field_150608_ab.biomeID; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.field_150607_aa.biomeID; + } + } else { + var6[var8 + var7 * p_75904_3_] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID; + } + } else if (var9 == 2) { + if (var10 > 0) { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.jungle.biomeID; + } else { + var6[var8 + var7 * p_75904_3_] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID; + } + } else if (var9 == 3) { + if (var10 > 0) { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.field_150578_U.biomeID; + } else { + var6[var8 + var7 * p_75904_3_] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID; + } + } else if (var9 == 4) { + var6[var8 + var7 * p_75904_3_] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.mushroomIsland.biomeID; + } + } + } + + return var6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java new file mode 100644 index 0000000..e270246 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java @@ -0,0 +1,117 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerBiomeEdge extends GenLayer { + + + public GenLayerBiomeEdge(long p_i45475_1_, GenLayer p_i45475_3_) { + super(p_i45475_1_); + this.parent = p_i45475_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = this.parent.getInts(p_75904_1_ - 1, p_75904_2_ - 1, p_75904_3_ + 2, p_75904_4_ + 2); + int[] var6 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var7 = 0; var7 < p_75904_4_; ++var7) { + for (int var8 = 0; var8 < p_75904_3_; ++var8) { + this.initChunkSeed(var8 + p_75904_1_, var7 + p_75904_2_); + int var9 = var5[var8 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + + if (!this.func_151636_a(var5, var6, var8, var7, p_75904_3_, var9, BiomeGenBase.extremeHills.biomeID, BiomeGenBase.extremeHillsEdge.biomeID) && !this.func_151635_b(var5, var6, var8, var7, p_75904_3_, var9, BiomeGenBase.field_150607_aa.biomeID, BiomeGenBase.field_150589_Z.biomeID) && !this.func_151635_b(var5, var6, var8, var7, p_75904_3_, var9, BiomeGenBase.field_150608_ab.biomeID, BiomeGenBase.field_150589_Z.biomeID) && !this.func_151635_b(var5, var6, var8, var7, p_75904_3_, var9, BiomeGenBase.field_150578_U.biomeID, BiomeGenBase.taiga.biomeID)) { + int var10; + int var11; + int var12; + int var13; + + if (var9 == BiomeGenBase.desert.biomeID) { + var10 = var5[var8 + 1 + (var7 + 1 - 1) * (p_75904_3_ + 2)]; + var11 = var5[var8 + 1 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var12 = var5[var8 + 1 - 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var13 = var5[var8 + 1 + (var7 + 1 + 1) * (p_75904_3_ + 2)]; + + if (var10 != BiomeGenBase.icePlains.biomeID && var11 != BiomeGenBase.icePlains.biomeID && var12 != BiomeGenBase.icePlains.biomeID && var13 != BiomeGenBase.icePlains.biomeID) { + var6[var8 + var7 * p_75904_3_] = var9; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.field_150580_W.biomeID; + } + } else if (var9 == BiomeGenBase.swampland.biomeID) { + var10 = var5[var8 + 1 + (var7 + 1 - 1) * (p_75904_3_ + 2)]; + var11 = var5[var8 + 1 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var12 = var5[var8 + 1 - 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var13 = var5[var8 + 1 + (var7 + 1 + 1) * (p_75904_3_ + 2)]; + + if (var10 != BiomeGenBase.desert.biomeID && var11 != BiomeGenBase.desert.biomeID && var12 != BiomeGenBase.desert.biomeID && var13 != BiomeGenBase.desert.biomeID && var10 != BiomeGenBase.field_150584_S.biomeID && var11 != BiomeGenBase.field_150584_S.biomeID && var12 != BiomeGenBase.field_150584_S.biomeID && var13 != BiomeGenBase.field_150584_S.biomeID && var10 != BiomeGenBase.icePlains.biomeID && var11 != BiomeGenBase.icePlains.biomeID && var12 != BiomeGenBase.icePlains.biomeID && var13 != BiomeGenBase.icePlains.biomeID) { + if (var10 != BiomeGenBase.jungle.biomeID && var13 != BiomeGenBase.jungle.biomeID && var11 != BiomeGenBase.jungle.biomeID && var12 != BiomeGenBase.jungle.biomeID) { + var6[var8 + var7 * p_75904_3_] = var9; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.field_150574_L.biomeID; + } + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.plains.biomeID; + } + } else { + var6[var8 + var7 * p_75904_3_] = var9; + } + } + } + } + + return var6; + } + + private boolean func_151636_a(int[] p_151636_1_, int[] p_151636_2_, int p_151636_3_, int p_151636_4_, int p_151636_5_, int p_151636_6_, int p_151636_7_, int p_151636_8_) { + if (!func_151616_a(p_151636_6_, p_151636_7_)) { + return false; + } else { + int var9 = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 - 1) * (p_151636_5_ + 2)]; + int var10 = p_151636_1_[p_151636_3_ + 1 + 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; + int var11 = p_151636_1_[p_151636_3_ + 1 - 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; + int var12 = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 + 1) * (p_151636_5_ + 2)]; + + if (this.func_151634_b(var9, p_151636_7_) && this.func_151634_b(var10, p_151636_7_) && this.func_151634_b(var11, p_151636_7_) && this.func_151634_b(var12, p_151636_7_)) { + p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_6_; + } else { + p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_8_; + } + + return true; + } + } + + private boolean func_151635_b(int[] p_151635_1_, int[] p_151635_2_, int p_151635_3_, int p_151635_4_, int p_151635_5_, int p_151635_6_, int p_151635_7_, int p_151635_8_) { + if (p_151635_6_ != p_151635_7_) { + return false; + } else { + int var9 = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 - 1) * (p_151635_5_ + 2)]; + int var10 = p_151635_1_[p_151635_3_ + 1 + 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; + int var11 = p_151635_1_[p_151635_3_ + 1 - 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; + int var12 = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 + 1) * (p_151635_5_ + 2)]; + + if (func_151616_a(var9, p_151635_7_) && func_151616_a(var10, p_151635_7_) && func_151616_a(var11, p_151635_7_) && func_151616_a(var12, p_151635_7_)) { + p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_6_; + } else { + p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_8_; + } + + return true; + } + } + + private boolean func_151634_b(int p_151634_1_, int p_151634_2_) { + if (func_151616_a(p_151634_1_, p_151634_2_)) { + return true; + } else if (BiomeGenBase.func_150568_d(p_151634_1_) != null && BiomeGenBase.func_150568_d(p_151634_2_) != null) { + BiomeGenBase.TempCategory var3 = BiomeGenBase.func_150568_d(p_151634_1_).func_150561_m(); + BiomeGenBase.TempCategory var4 = BiomeGenBase.func_150568_d(p_151634_2_).func_150561_m(); + return var3 == var4 || var3 == BiomeGenBase.TempCategory.MEDIUM || var4 == BiomeGenBase.TempCategory.MEDIUM; + } else { + return false; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java new file mode 100644 index 0000000..8d62bbe --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java @@ -0,0 +1,60 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerDeepOcean extends GenLayer { + + + public GenLayerDeepOcean(long p_i45472_1_, GenLayer p_i45472_3_) { + super(p_i45472_1_); + this.parent = p_i45472_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ - 1; + int var6 = p_75904_2_ - 1; + int var7 = p_75904_3_ + 2; + int var8 = p_75904_4_ + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var11 = 0; var11 < p_75904_4_; ++var11) { + for (int var12 = 0; var12 < p_75904_3_; ++var12) { + int var13 = var9[var12 + 1 + (var11 + 1 - 1) * (p_75904_3_ + 2)]; + int var14 = var9[var12 + 1 + 1 + (var11 + 1) * (p_75904_3_ + 2)]; + int var15 = var9[var12 + 1 - 1 + (var11 + 1) * (p_75904_3_ + 2)]; + int var16 = var9[var12 + 1 + (var11 + 1 + 1) * (p_75904_3_ + 2)]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; + int var18 = 0; + + if (var13 == 0) { + ++var18; + } + + if (var14 == 0) { + ++var18; + } + + if (var15 == 0) { + ++var18; + } + + if (var16 == 0) { + ++var18; + } + + if (var17 == 0 && var18 > 3) { + var10[var12 + var11 * p_75904_3_] = BiomeGenBase.field_150575_M.biomeID; + } else { + var10[var12 + var11 * p_75904_3_] = var17; + } + } + } + + return var10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java new file mode 100644 index 0000000..f2e5f55 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java @@ -0,0 +1,148 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerEdge extends GenLayer { + private final GenLayerEdge.Mode field_151627_c; + + + public GenLayerEdge(long p_i45474_1_, GenLayer p_i45474_3_, GenLayerEdge.Mode p_i45474_4_) { + super(p_i45474_1_); + this.parent = p_i45474_3_; + this.field_151627_c = p_i45474_4_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + switch (GenLayerEdge.SwitchMode.field_151642_a[this.field_151627_c.ordinal()]) { + case 1: + default: + return this.func_151626_c(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_); + + case 2: + return this.func_151624_d(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_); + + case 3: + return this.func_151625_e(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_); + } + } + + private int[] func_151626_c(int p_151626_1_, int p_151626_2_, int p_151626_3_, int p_151626_4_) { + int var5 = p_151626_1_ - 1; + int var6 = p_151626_2_ - 1; + int var7 = 1 + p_151626_3_ + 1; + int var8 = 1 + p_151626_4_ + 1; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_151626_3_ * p_151626_4_); + + for (int var11 = 0; var11 < p_151626_4_; ++var11) { + for (int var12 = 0; var12 < p_151626_3_; ++var12) { + this.initChunkSeed(var12 + p_151626_1_, var11 + p_151626_2_); + int var13 = var9[var12 + 1 + (var11 + 1) * var7]; + + if (var13 == 1) { + int var14 = var9[var12 + 1 + (var11 + 1 - 1) * var7]; + int var15 = var9[var12 + 1 + 1 + (var11 + 1) * var7]; + int var16 = var9[var12 + 1 - 1 + (var11 + 1) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1 + 1) * var7]; + boolean var18 = var14 == 3 || var15 == 3 || var16 == 3 || var17 == 3; + boolean var19 = var14 == 4 || var15 == 4 || var16 == 4 || var17 == 4; + + if (var18 || var19) { + var13 = 2; + } + } + + var10[var12 + var11 * p_151626_3_] = var13; + } + } + + return var10; + } + + private int[] func_151624_d(int p_151624_1_, int p_151624_2_, int p_151624_3_, int p_151624_4_) { + int var5 = p_151624_1_ - 1; + int var6 = p_151624_2_ - 1; + int var7 = 1 + p_151624_3_ + 1; + int var8 = 1 + p_151624_4_ + 1; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_151624_3_ * p_151624_4_); + + for (int var11 = 0; var11 < p_151624_4_; ++var11) { + for (int var12 = 0; var12 < p_151624_3_; ++var12) { + int var13 = var9[var12 + 1 + (var11 + 1) * var7]; + + if (var13 == 4) { + int var14 = var9[var12 + 1 + (var11 + 1 - 1) * var7]; + int var15 = var9[var12 + 1 + 1 + (var11 + 1) * var7]; + int var16 = var9[var12 + 1 - 1 + (var11 + 1) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1 + 1) * var7]; + boolean var18 = var14 == 2 || var15 == 2 || var16 == 2 || var17 == 2; + boolean var19 = var14 == 1 || var15 == 1 || var16 == 1 || var17 == 1; + + if (var19 || var18) { + var13 = 3; + } + } + + var10[var12 + var11 * p_151624_3_] = var13; + } + } + + return var10; + } + + private int[] func_151625_e(int p_151625_1_, int p_151625_2_, int p_151625_3_, int p_151625_4_) { + int[] var5 = this.parent.getInts(p_151625_1_, p_151625_2_, p_151625_3_, p_151625_4_); + int[] var6 = IntCache.getIntCache(p_151625_3_ * p_151625_4_); + + for (int var7 = 0; var7 < p_151625_4_; ++var7) { + for (int var8 = 0; var8 < p_151625_3_; ++var8) { + this.initChunkSeed(var8 + p_151625_1_, var7 + p_151625_2_); + int var9 = var5[var8 + var7 * p_151625_3_]; + + if (var9 != 0 && this.nextInt(13) == 0) { + var9 |= 1 + this.nextInt(15) << 8 & 3840; + } + + var6[var8 + var7 * p_151625_3_] = var9; + } + } + + return var6; + } + + public enum Mode { + COOL_WARM("COOL_WARM", 0), + HEAT_ICE("HEAT_ICE", 1), + SPECIAL("SPECIAL", 2); + + private static final GenLayerEdge.Mode[] $VALUES = new GenLayerEdge.Mode[]{COOL_WARM, HEAT_ICE, SPECIAL}; + + + Mode(String p_i45473_1_, int p_i45473_2_) {} + } + + static final class SwitchMode { + static final int[] field_151642_a = new int[GenLayerEdge.Mode.values().length]; + + + static { + try { + field_151642_a[GenLayerEdge.Mode.COOL_WARM.ordinal()] = 1; + } catch (NoSuchFieldError var3) { + } + + try { + field_151642_a[GenLayerEdge.Mode.HEAT_ICE.ordinal()] = 2; + } catch (NoSuchFieldError var2) { + } + + try { + field_151642_a[GenLayerEdge.Mode.SPECIAL.ordinal()] = 3; + } catch (NoSuchFieldError var1) { + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java new file mode 100644 index 0000000..226f0b2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java @@ -0,0 +1,13 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerFuzzyZoom extends GenLayerZoom { + + + public GenLayerFuzzyZoom(long p_i2123_1_, GenLayer p_i2123_3_) { + super(p_i2123_1_, p_i2123_3_); + } + + protected int func_151617_b(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) { + return this.func_151619_a(p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java new file mode 100644 index 0000000..ec9bc4f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java @@ -0,0 +1,137 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GenLayerHills extends GenLayer { + private static final Logger logger = LogManager.getLogger(); + private final GenLayer field_151628_d; + + + public GenLayerHills(long p_i45479_1_, GenLayer p_i45479_3_, GenLayer p_i45479_4_) { + super(p_i45479_1_); + this.parent = p_i45479_3_; + this.field_151628_d = p_i45479_4_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = this.parent.getInts(p_75904_1_ - 1, p_75904_2_ - 1, p_75904_3_ + 2, p_75904_4_ + 2); + int[] var6 = this.field_151628_d.getInts(p_75904_1_ - 1, p_75904_2_ - 1, p_75904_3_ + 2, p_75904_4_ + 2); + int[] var7 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var8 = 0; var8 < p_75904_4_; ++var8) { + for (int var9 = 0; var9 < p_75904_3_; ++var9) { + this.initChunkSeed(var9 + p_75904_1_, var8 + p_75904_2_); + int var10 = var5[var9 + 1 + (var8 + 1) * (p_75904_3_ + 2)]; + int var11 = var6[var9 + 1 + (var8 + 1) * (p_75904_3_ + 2)]; + boolean var12 = (var11 - 2) % 29 == 0; + + if (var10 > 255) { + logger.debug("old! " + var10); + } + + if (var10 != 0 && var11 >= 2 && (var11 - 2) % 29 == 1 && var10 < 128) { + if (BiomeGenBase.func_150568_d(var10 + 128) != null) { + var7[var9 + var8 * p_75904_3_] = var10 + 128; + } else { + var7[var9 + var8 * p_75904_3_] = var10; + } + } else if (this.nextInt(3) != 0 && !var12) { + var7[var9 + var8 * p_75904_3_] = var10; + } else { + int var13 = var10; + int var14; + + if (var10 == BiomeGenBase.desert.biomeID) { + var13 = BiomeGenBase.desertHills.biomeID; + } else if (var10 == BiomeGenBase.forest.biomeID) { + var13 = BiomeGenBase.forestHills.biomeID; + } else if (var10 == BiomeGenBase.field_150583_P.biomeID) { + var13 = BiomeGenBase.field_150582_Q.biomeID; + } else if (var10 == BiomeGenBase.field_150585_R.biomeID) { + var13 = BiomeGenBase.plains.biomeID; + } else if (var10 == BiomeGenBase.taiga.biomeID) { + var13 = BiomeGenBase.taigaHills.biomeID; + } else if (var10 == BiomeGenBase.field_150578_U.biomeID) { + var13 = BiomeGenBase.field_150581_V.biomeID; + } else if (var10 == BiomeGenBase.field_150584_S.biomeID) { + var13 = BiomeGenBase.field_150579_T.biomeID; + } else if (var10 == BiomeGenBase.plains.biomeID) { + if (this.nextInt(3) == 0) { + var13 = BiomeGenBase.forestHills.biomeID; + } else { + var13 = BiomeGenBase.forest.biomeID; + } + } else if (var10 == BiomeGenBase.icePlains.biomeID) { + var13 = BiomeGenBase.iceMountains.biomeID; + } else if (var10 == BiomeGenBase.jungle.biomeID) { + var13 = BiomeGenBase.jungleHills.biomeID; + } else if (var10 == BiomeGenBase.ocean.biomeID) { + var13 = BiomeGenBase.field_150575_M.biomeID; + } else if (var10 == BiomeGenBase.extremeHills.biomeID) { + var13 = BiomeGenBase.field_150580_W.biomeID; + } else if (var10 == BiomeGenBase.field_150588_X.biomeID) { + var13 = BiomeGenBase.field_150587_Y.biomeID; + } else if (func_151616_a(var10, BiomeGenBase.field_150607_aa.biomeID)) { + var13 = BiomeGenBase.field_150589_Z.biomeID; + } else if (var10 == BiomeGenBase.field_150575_M.biomeID && this.nextInt(3) == 0) { + var14 = this.nextInt(2); + + if (var14 == 0) { + var13 = BiomeGenBase.plains.biomeID; + } else { + var13 = BiomeGenBase.forest.biomeID; + } + } + + if (var12 && var13 != var10) { + if (BiomeGenBase.func_150568_d(var13 + 128) != null) { + var13 += 128; + } else { + var13 = var10; + } + } + + if (var13 == var10) { + var7[var9 + var8 * p_75904_3_] = var10; + } else { + var14 = var5[var9 + 1 + (var8 + 1 - 1) * (p_75904_3_ + 2)]; + int var15 = var5[var9 + 1 + 1 + (var8 + 1) * (p_75904_3_ + 2)]; + int var16 = var5[var9 + 1 - 1 + (var8 + 1) * (p_75904_3_ + 2)]; + int var17 = var5[var9 + 1 + (var8 + 1 + 1) * (p_75904_3_ + 2)]; + int var18 = 0; + + if (func_151616_a(var14, var10)) { + ++var18; + } + + if (func_151616_a(var15, var10)) { + ++var18; + } + + if (func_151616_a(var16, var10)) { + ++var18; + } + + if (func_151616_a(var17, var10)) { + ++var18; + } + + if (var18 >= 3) { + var7[var9 + var8 * p_75904_3_] = var13; + } else { + var7[var9 + var8 * p_75904_3_] = var10; + } + } + } + } + } + + return var7; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java new file mode 100644 index 0000000..7a7c773 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java @@ -0,0 +1,30 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerIsland extends GenLayer { + + + public GenLayerIsland(long p_i2124_1_) { + super(p_i2124_1_); + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var6 = 0; var6 < p_75904_4_; ++var6) { + for (int var7 = 0; var7 < p_75904_3_; ++var7) { + this.initChunkSeed(p_75904_1_ + var7, p_75904_2_ + var6); + var5[var7 + var6 * p_75904_3_] = this.nextInt(10) == 0 ? 1 : 0; + } + } + + if (p_75904_1_ > -p_75904_3_ && p_75904_1_ <= 0 && p_75904_2_ > -p_75904_4_ && p_75904_2_ <= 0) { + var5[-p_75904_1_ + -p_75904_2_ * p_75904_3_] = 1; + } + + return var5; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java new file mode 100644 index 0000000..249adec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java @@ -0,0 +1,40 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRareBiome extends GenLayer { + + + public GenLayerRareBiome(long p_i45478_1_, GenLayer p_i45478_3_) { + super(p_i45478_1_); + this.parent = p_i45478_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = this.parent.getInts(p_75904_1_ - 1, p_75904_2_ - 1, p_75904_3_ + 2, p_75904_4_ + 2); + int[] var6 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var7 = 0; var7 < p_75904_4_; ++var7) { + for (int var8 = 0; var8 < p_75904_3_; ++var8) { + this.initChunkSeed(var8 + p_75904_1_, var7 + p_75904_2_); + int var9 = var5[var8 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + + if (this.nextInt(57) == 0) { + if (var9 == BiomeGenBase.plains.biomeID) { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.plains.biomeID + 128; + } else { + var6[var8 + var7 * p_75904_3_] = var9; + } + } else { + var6[var8 + var7 * p_75904_3_] = var9; + } + } + } + + return var6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java new file mode 100644 index 0000000..d59b987 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java @@ -0,0 +1,41 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerRemoveTooMuchOcean extends GenLayer { + + + public GenLayerRemoveTooMuchOcean(long p_i45480_1_, GenLayer p_i45480_3_) { + super(p_i45480_1_); + this.parent = p_i45480_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ - 1; + int var6 = p_75904_2_ - 1; + int var7 = p_75904_3_ + 2; + int var8 = p_75904_4_ + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var11 = 0; var11 < p_75904_4_; ++var11) { + for (int var12 = 0; var12 < p_75904_3_; ++var12) { + int var13 = var9[var12 + 1 + (var11 + 1 - 1) * (p_75904_3_ + 2)]; + int var14 = var9[var12 + 1 + 1 + (var11 + 1) * (p_75904_3_ + 2)]; + int var15 = var9[var12 + 1 - 1 + (var11 + 1) * (p_75904_3_ + 2)]; + int var16 = var9[var12 + 1 + (var11 + 1 + 1) * (p_75904_3_ + 2)]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; + var10[var12 + var11 * p_75904_3_] = var17; + this.initChunkSeed(var12 + p_75904_1_, var11 + p_75904_2_); + + if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(2) == 0) { + var10[var12 + var11 * p_75904_3_] = 1; + } + } + } + + return var10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java new file mode 100644 index 0000000..b1394a5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java @@ -0,0 +1,47 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRiver extends GenLayer { + + + public GenLayerRiver(long p_i2128_1_, GenLayer p_i2128_3_) { + super(p_i2128_1_); + super.parent = p_i2128_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ - 1; + int var6 = p_75904_2_ - 1; + int var7 = p_75904_3_ + 2; + int var8 = p_75904_4_ + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var11 = 0; var11 < p_75904_4_; ++var11) { + for (int var12 = 0; var12 < p_75904_3_; ++var12) { + int var13 = this.func_151630_c(var9[var12 + 0 + (var11 + 1) * var7]); + int var14 = this.func_151630_c(var9[var12 + 2 + (var11 + 1) * var7]); + int var15 = this.func_151630_c(var9[var12 + 1 + (var11 + 0) * var7]); + int var16 = this.func_151630_c(var9[var12 + 1 + (var11 + 2) * var7]); + int var17 = this.func_151630_c(var9[var12 + 1 + (var11 + 1) * var7]); + + if (var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16) { + var10[var12 + var11 * p_75904_3_] = -1; + } else { + var10[var12 + var11 * p_75904_3_] = BiomeGenBase.river.biomeID; + } + } + } + + return var10; + } + + private int func_151630_c(int p_151630_1_) { + return p_151630_1_ >= 2 ? 2 + (p_151630_1_ & 1) : p_151630_1_; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java new file mode 100644 index 0000000..95d2363 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java @@ -0,0 +1,28 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerRiverInit extends GenLayer { + + + public GenLayerRiverInit(long p_i2127_1_, GenLayer p_i2127_3_) { + super(p_i2127_1_); + this.parent = p_i2127_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = this.parent.getInts(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_); + int[] var6 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var7 = 0; var7 < p_75904_4_; ++var7) { + for (int var8 = 0; var8 < p_75904_3_; ++var8) { + this.initChunkSeed(var8 + p_75904_1_, var7 + p_75904_2_); + var6[var8 + var7 * p_75904_3_] = var5[var8 + var7 * p_75904_3_] > 0 ? this.nextInt(299999) + 2 : 0; + } + } + + return var6; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java new file mode 100644 index 0000000..e1a8e1d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java @@ -0,0 +1,55 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRiverMix extends GenLayer { + private final GenLayer biomePatternGeneratorChain; + private final GenLayer riverPatternGeneratorChain; + + + public GenLayerRiverMix(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_) { + super(p_i2129_1_); + this.biomePatternGeneratorChain = p_i2129_3_; + this.riverPatternGeneratorChain = p_i2129_4_; + } + + /** + * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an + * argument). + */ + public void initWorldGenSeed(long p_75905_1_) { + this.biomePatternGeneratorChain.initWorldGenSeed(p_75905_1_); + this.riverPatternGeneratorChain.initWorldGenSeed(p_75905_1_); + super.initWorldGenSeed(p_75905_1_); + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = this.biomePatternGeneratorChain.getInts(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_); + int[] var6 = this.riverPatternGeneratorChain.getInts(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_); + int[] var7 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var8 = 0; var8 < p_75904_3_ * p_75904_4_; ++var8) { + if (var5[var8] != BiomeGenBase.ocean.biomeID && var5[var8] != BiomeGenBase.field_150575_M.biomeID) { + if (var6[var8] == BiomeGenBase.river.biomeID) { + if (var5[var8] == BiomeGenBase.icePlains.biomeID) { + var7[var8] = BiomeGenBase.frozenRiver.biomeID; + } else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID) { + var7[var8] = var6[var8] & 255; + } else { + var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } else { + var7[var8] = var5[var8]; + } + } else { + var7[var8] = var5[var8]; + } + } + + return var7; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java new file mode 100644 index 0000000..84a26c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java @@ -0,0 +1,126 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenJungle; +import net.minecraft.world.biome.BiomeGenMesa; + +public class GenLayerShore extends GenLayer { + + + public GenLayerShore(long p_i2130_1_, GenLayer p_i2130_3_) { + super(p_i2130_1_); + this.parent = p_i2130_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int[] var5 = this.parent.getInts(p_75904_1_ - 1, p_75904_2_ - 1, p_75904_3_ + 2, p_75904_4_ + 2); + int[] var6 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var7 = 0; var7 < p_75904_4_; ++var7) { + for (int var8 = 0; var8 < p_75904_3_; ++var8) { + this.initChunkSeed(var8 + p_75904_1_, var7 + p_75904_2_); + int var9 = var5[var8 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + BiomeGenBase var10 = BiomeGenBase.func_150568_d(var9); + int var11; + int var12; + int var13; + int var14; + + if (var9 == BiomeGenBase.mushroomIsland.biomeID) { + var11 = var5[var8 + 1 + (var7 + 1 - 1) * (p_75904_3_ + 2)]; + var12 = var5[var8 + 1 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var13 = var5[var8 + 1 - 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var14 = var5[var8 + 1 + (var7 + 1 + 1) * (p_75904_3_ + 2)]; + + if (var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID && var14 != BiomeGenBase.ocean.biomeID) { + var6[var8 + var7 * p_75904_3_] = var9; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } else if (var10 != null && var10.func_150562_l() == BiomeGenJungle.class) { + var11 = var5[var8 + 1 + (var7 + 1 - 1) * (p_75904_3_ + 2)]; + var12 = var5[var8 + 1 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var13 = var5[var8 + 1 - 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var14 = var5[var8 + 1 + (var7 + 1 + 1) * (p_75904_3_ + 2)]; + + if (this.func_151631_c(var11) && this.func_151631_c(var12) && this.func_151631_c(var13) && this.func_151631_c(var14)) { + if (!func_151618_b(var11) && !func_151618_b(var12) && !func_151618_b(var13) && !func_151618_b(var14)) { + var6[var8 + var7 * p_75904_3_] = var9; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.beach.biomeID; + } + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.field_150574_L.biomeID; + } + } else if (var9 != BiomeGenBase.extremeHills.biomeID && var9 != BiomeGenBase.field_150580_W.biomeID && var9 != BiomeGenBase.extremeHillsEdge.biomeID) { + if (var10 != null && var10.func_150559_j()) { + this.func_151632_a(var5, var6, var8, var7, p_75904_3_, var9, BiomeGenBase.field_150577_O.biomeID); + } else if (var9 != BiomeGenBase.field_150589_Z.biomeID && var9 != BiomeGenBase.field_150607_aa.biomeID) { + if (var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.field_150575_M.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID) { + var11 = var5[var8 + 1 + (var7 + 1 - 1) * (p_75904_3_ + 2)]; + var12 = var5[var8 + 1 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var13 = var5[var8 + 1 - 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var14 = var5[var8 + 1 + (var7 + 1 + 1) * (p_75904_3_ + 2)]; + + if (!func_151618_b(var11) && !func_151618_b(var12) && !func_151618_b(var13) && !func_151618_b(var14)) { + var6[var8 + var7 * p_75904_3_] = var9; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.beach.biomeID; + } + } else { + var6[var8 + var7 * p_75904_3_] = var9; + } + } else { + var11 = var5[var8 + 1 + (var7 + 1 - 1) * (p_75904_3_ + 2)]; + var12 = var5[var8 + 1 + 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var13 = var5[var8 + 1 - 1 + (var7 + 1) * (p_75904_3_ + 2)]; + var14 = var5[var8 + 1 + (var7 + 1 + 1) * (p_75904_3_ + 2)]; + + if (!func_151618_b(var11) && !func_151618_b(var12) && !func_151618_b(var13) && !func_151618_b(var14)) { + if (this.func_151633_d(var11) && this.func_151633_d(var12) && this.func_151633_d(var13) && this.func_151633_d(var14)) { + var6[var8 + var7 * p_75904_3_] = var9; + } else { + var6[var8 + var7 * p_75904_3_] = BiomeGenBase.desert.biomeID; + } + } else { + var6[var8 + var7 * p_75904_3_] = var9; + } + } + } else { + this.func_151632_a(var5, var6, var8, var7, p_75904_3_, var9, BiomeGenBase.field_150576_N.biomeID); + } + } + } + + return var6; + } + + private void func_151632_a(int[] p_151632_1_, int[] p_151632_2_, int p_151632_3_, int p_151632_4_, int p_151632_5_, int p_151632_6_, int p_151632_7_) { + if (func_151618_b(p_151632_6_)) { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; + } else { + int var8 = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 - 1) * (p_151632_5_ + 2)]; + int var9 = p_151632_1_[p_151632_3_ + 1 + 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; + int var10 = p_151632_1_[p_151632_3_ + 1 - 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; + int var11 = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 + 1) * (p_151632_5_ + 2)]; + + if (!func_151618_b(var8) && !func_151618_b(var9) && !func_151618_b(var10) && !func_151618_b(var11)) { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; + } else { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_7_; + } + } + } + + private boolean func_151631_c(int p_151631_1_) { + return BiomeGenBase.func_150568_d(p_151631_1_) != null && BiomeGenBase.func_150568_d(p_151631_1_).func_150562_l() == BiomeGenJungle.class || p_151631_1_ == BiomeGenBase.field_150574_L.biomeID || p_151631_1_ == BiomeGenBase.jungle.biomeID || p_151631_1_ == BiomeGenBase.jungleHills.biomeID || p_151631_1_ == BiomeGenBase.forest.biomeID || p_151631_1_ == BiomeGenBase.taiga.biomeID || func_151618_b(p_151631_1_); + } + + private boolean func_151633_d(int p_151633_1_) { + return BiomeGenBase.func_150568_d(p_151633_1_) != null && BiomeGenBase.func_150568_d(p_151633_1_) instanceof BiomeGenMesa; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java new file mode 100644 index 0000000..04f8c47 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java @@ -0,0 +1,55 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerSmooth extends GenLayer { + + + public GenLayerSmooth(long p_i2131_1_, GenLayer p_i2131_3_) { + super(p_i2131_1_); + super.parent = p_i2131_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ - 1; + int var6 = p_75904_2_ - 1; + int var7 = p_75904_3_ + 2; + int var8 = p_75904_4_ + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (int var11 = 0; var11 < p_75904_4_; ++var11) { + for (int var12 = 0; var12 < p_75904_3_; ++var12) { + int var13 = var9[var12 + 0 + (var11 + 1) * var7]; + int var14 = var9[var12 + 2 + (var11 + 1) * var7]; + int var15 = var9[var12 + 1 + (var11 + 0) * var7]; + int var16 = var9[var12 + 1 + (var11 + 2) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; + + if (var13 == var14 && var15 == var16) { + this.initChunkSeed(var12 + p_75904_1_, var11 + p_75904_2_); + + if (this.nextInt(2) == 0) { + var17 = var13; + } else { + var17 = var15; + } + } else { + if (var13 == var14) { + var17 = var13; + } + + if (var15 == var16) { + var17 = var15; + } + } + + var10[var12 + var11 * p_75904_3_] = var17; + } + } + + return var10; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java new file mode 100644 index 0000000..3c907d4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java @@ -0,0 +1,83 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerVoronoiZoom extends GenLayer { + + + public GenLayerVoronoiZoom(long p_i2133_1_, GenLayer p_i2133_3_) { + super(p_i2133_1_); + super.parent = p_i2133_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + p_75904_1_ -= 2; + p_75904_2_ -= 2; + int var5 = p_75904_1_ >> 2; + int var6 = p_75904_2_ >> 2; + int var7 = (p_75904_3_ >> 2) + 2; + int var8 = (p_75904_4_ >> 2) + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int var10 = var7 - 1 << 2; + int var11 = var8 - 1 << 2; + int[] var12 = IntCache.getIntCache(var10 * var11); + int var14; + + for (int var13 = 0; var13 < var8 - 1; ++var13) { + var14 = 0; + int var15 = var9[var14 + 0 + (var13 + 0) * var7]; + + for (int var16 = var9[var14 + 0 + (var13 + 1) * var7]; var14 < var7 - 1; ++var14) { + double var17 = 3.6D; + this.initChunkSeed(var14 + var5 << 2, var13 + var6 << 2); + double var19 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double var21 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed(var14 + var5 + 1 << 2, var13 + var6 << 2); + double var23 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double var25 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed(var14 + var5 << 2, var13 + var6 + 1 << 2); + double var27 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double var29 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + this.initChunkSeed(var14 + var5 + 1 << 2, var13 + var6 + 1 << 2); + double var31 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double var33 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + int var35 = var9[var14 + 1 + (var13 + 0) * var7] & 255; + int var36 = var9[var14 + 1 + (var13 + 1) * var7] & 255; + + for (int var37 = 0; var37 < 4; ++var37) { + int var38 = ((var13 << 2) + var37) * var10 + (var14 << 2); + + for (int var39 = 0; var39 < 4; ++var39) { + double var40 = ((double)var37 - var21) * ((double)var37 - var21) + ((double)var39 - var19) * ((double)var39 - var19); + double var42 = ((double)var37 - var25) * ((double)var37 - var25) + ((double)var39 - var23) * ((double)var39 - var23); + double var44 = ((double)var37 - var29) * ((double)var37 - var29) + ((double)var39 - var27) * ((double)var39 - var27); + double var46 = ((double)var37 - var33) * ((double)var37 - var33) + ((double)var39 - var31) * ((double)var39 - var31); + + if (var40 < var42 && var40 < var44 && var40 < var46) { + var12[var38++] = var15; + } else if (var42 < var40 && var42 < var44 && var42 < var46) { + var12[var38++] = var35; + } else if (var44 < var40 && var44 < var42 && var44 < var46) { + var12[var38++] = var16; + } else { + var12[var38++] = var36; + } + } + } + + var15 = var35; + var16 = var36; + } + } + + int[] var48 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (var14 = 0; var14 < p_75904_4_; ++var14) { + System.arraycopy(var12, (var14 + (p_75904_2_ & 3)) * var10 + (p_75904_1_ & 3), var48, var14 * p_75904_3_, p_75904_3_); + } + + return var48; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java new file mode 100644 index 0000000..06238d6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java @@ -0,0 +1,65 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerZoom extends GenLayer { + + + public GenLayerZoom(long p_i2134_1_, GenLayer p_i2134_3_) { + super(p_i2134_1_); + super.parent = p_i2134_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + int var5 = p_75904_1_ >> 1; + int var6 = p_75904_2_ >> 1; + int var7 = (p_75904_3_ >> 1) + 2; + int var8 = (p_75904_4_ >> 1) + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int var10 = var7 - 1 << 1; + int var11 = var8 - 1 << 1; + int[] var12 = IntCache.getIntCache(var10 * var11); + int var14; + + for (int var13 = 0; var13 < var8 - 1; ++var13) { + var14 = (var13 << 1) * var10; + int var15 = 0; + int var16 = var9[var15 + 0 + (var13 + 0) * var7]; + + for (int var17 = var9[var15 + 0 + (var13 + 1) * var7]; var15 < var7 - 1; ++var15) { + this.initChunkSeed(var15 + var5 << 1, var13 + var6 << 1); + int var18 = var9[var15 + 1 + (var13 + 0) * var7]; + int var19 = var9[var15 + 1 + (var13 + 1) * var7]; + var12[var14] = var16; + var12[var14++ + var10] = this.func_151619_a(var16, var17); + var12[var14] = this.func_151619_a(var16, var18); + var12[var14++ + var10] = this.func_151617_b(var16, var18, var17, var19); + var16 = var18; + var17 = var19; + } + } + + int[] var20 = IntCache.getIntCache(p_75904_3_ * p_75904_4_); + + for (var14 = 0; var14 < p_75904_4_; ++var14) { + System.arraycopy(var12, (var14 + (p_75904_2_ & 1)) * var10 + (p_75904_1_ & 1), var20, var14 * p_75904_3_, p_75904_3_); + } + + return var20; + } + + /** + * Magnify a layer. Parms are seed adjustment, layer, number of times to magnify + */ + public static GenLayer magnify(long p_75915_0_, GenLayer p_75915_2_, int p_75915_3_) { + Object var4 = p_75915_2_; + + for (int var5 = 0; var5 < p_75915_3_; ++var5) { + var4 = new GenLayerZoom(p_75915_0_ + (long)var5, (GenLayer)var4); + } + + return (GenLayer)var4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/IntCache.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/IntCache.java new file mode 100644 index 0000000..cabbd93 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/layer/IntCache.java @@ -0,0 +1,88 @@ +package net.minecraft.world.gen.layer; + +import java.util.ArrayList; +import java.util.List; + +public class IntCache { + private static int intCacheSize = 256; + + /** + * A list of pre-allocated int[256] arrays that are currently unused and can be returned by getIntCache() + */ + private static final List freeSmallArrays = new ArrayList(); + + /** + * A list of pre-allocated int[256] arrays that were previously returned by getIntCache() and which will not be re- + * used again until resetIntCache() is called. + */ + private static final List inUseSmallArrays = new ArrayList(); + + /** + * A list of pre-allocated int[cacheSize] arrays that are currently unused and can be returned by getIntCache() + */ + private static final List freeLargeArrays = new ArrayList(); + + /** + * A list of pre-allocated int[cacheSize] arrays that were previously returned by getIntCache() and which will not + * be re-used again until resetIntCache() is called. + */ + private static final List inUseLargeArrays = new ArrayList(); + + + public static synchronized int[] getIntCache(int p_76445_0_) { + int[] var1; + + if (p_76445_0_ <= 256) { + if (freeSmallArrays.isEmpty()) { + var1 = new int[256]; + inUseSmallArrays.add(var1); + return var1; + } else { + var1 = (int[])freeSmallArrays.remove(freeSmallArrays.size() - 1); + inUseSmallArrays.add(var1); + return var1; + } + } else if (p_76445_0_ > intCacheSize) { + intCacheSize = p_76445_0_; + freeLargeArrays.clear(); + inUseLargeArrays.clear(); + var1 = new int[intCacheSize]; + inUseLargeArrays.add(var1); + return var1; + } else if (freeLargeArrays.isEmpty()) { + var1 = new int[intCacheSize]; + inUseLargeArrays.add(var1); + return var1; + } else { + var1 = (int[])freeLargeArrays.remove(freeLargeArrays.size() - 1); + inUseLargeArrays.add(var1); + return var1; + } + } + + /** + * Mark all pre-allocated arrays as available for re-use by moving them to the appropriate free lists. + */ + public static synchronized void resetIntCache() { + if (!freeLargeArrays.isEmpty()) { + freeLargeArrays.remove(freeLargeArrays.size() - 1); + } + + if (!freeSmallArrays.isEmpty()) { + freeSmallArrays.remove(freeSmallArrays.size() - 1); + } + + freeLargeArrays.addAll(inUseLargeArrays); + freeSmallArrays.addAll(inUseSmallArrays); + inUseLargeArrays.clear(); + inUseSmallArrays.clear(); + } + + /** + * Gets a human-readable string that indicates the sizes of all the cache fields. Basically a synchronized static + * toString. + */ + public static synchronized String getCacheSizes() { + return "cache: " + freeLargeArrays.size() + ", tcache: " + freeSmallArrays.size() + ", allocated: " + inUseLargeArrays.size() + ", tallocated: " + inUseSmallArrays.size(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java new file mode 100644 index 0000000..a4f0291 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java @@ -0,0 +1,630 @@ +package net.minecraft.world.gen.structure; + +import java.util.Random; +import net.minecraft.block.BlockLever; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Direction; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class ComponentScatteredFeaturePieces { + + + public static void func_143045_a() { + MapGenStructureIO.func_143031_a(ComponentScatteredFeaturePieces.DesertPyramid.class, "TeDP"); + MapGenStructureIO.func_143031_a(ComponentScatteredFeaturePieces.JunglePyramid.class, "TeJP"); + MapGenStructureIO.func_143031_a(ComponentScatteredFeaturePieces.SwampHut.class, "TeSH"); + } + + public static class DesertPyramid extends ComponentScatteredFeaturePieces.Feature { + private final boolean[] field_74940_h = new boolean[4]; + private static final WeightedRandomChestContent[] itemsToGenerateInTemple = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + + + public DesertPyramid() {} + + public DesertPyramid(Random p_i2062_1_, int p_i2062_2_, int p_i2062_3_) { + super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("hasPlacedChest0", this.field_74940_h[0]); + p_143012_1_.setBoolean("hasPlacedChest1", this.field_74940_h[1]); + p_143012_1_.setBoolean("hasPlacedChest2", this.field_74940_h[2]); + p_143012_1_.setBoolean("hasPlacedChest3", this.field_74940_h[3]); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.field_74940_h[0] = p_143011_1_.getBoolean("hasPlacedChest0"); + this.field_74940_h[1] = p_143011_1_.getBoolean("hasPlacedChest1"); + this.field_74940_h[2] = p_143011_1_.getBoolean("hasPlacedChest2"); + this.field_74940_h[3] = p_143011_1_.getBoolean("hasPlacedChest3"); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Blocks.sandstone, Blocks.sandstone, false); + int var4; + + for (var4 = 1; var4 <= 9; ++var4) { + this.func_151549_a(p_74875_1_, p_74875_3_, var4, var4, var4, this.scatteredFeatureSizeX - 1 - var4, var4, this.scatteredFeatureSizeZ - 1 - var4, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, var4 + 1, var4, var4 + 1, this.scatteredFeatureSizeX - 2 - var4, var4, this.scatteredFeatureSizeZ - 2 - var4, Blocks.air, Blocks.air, false); + } + + int var5; + + for (var4 = 0; var4 < this.scatteredFeatureSizeX; ++var4) { + for (var5 = 0; var5 < this.scatteredFeatureSizeZ; ++var5) { + byte var6 = -5; + this.func_151554_b(p_74875_1_, Blocks.sandstone, 0, var4, var6, var5, p_74875_3_); + } + } + + var4 = this.func_151555_a(Blocks.sandstone_stairs, 3); + var5 = this.func_151555_a(Blocks.sandstone_stairs, 2); + int var13 = this.func_151555_a(Blocks.sandstone_stairs, 0); + int var7 = this.func_151555_a(Blocks.sandstone_stairs, 1); + byte var8 = 1; + byte var9 = 11; + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 9, 4, Blocks.sandstone, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 10, 1, 3, 10, 3, Blocks.sandstone, Blocks.sandstone, false); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var4, 2, 10, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var5, 2, 10, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var13, 0, 10, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var7, 4, 10, 2, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Blocks.sandstone, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Blocks.sandstone, Blocks.sandstone, false); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var4, this.scatteredFeatureSizeX - 3, 10, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var5, this.scatteredFeatureSizeX - 3, 10, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var13, this.scatteredFeatureSizeX - 5, 10, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var7, this.scatteredFeatureSizeX - 1, 10, 2, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 0, 0, 12, 4, 4, Blocks.sandstone, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 1, 0, 11, 3, 4, Blocks.air, Blocks.air, false); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 9, 1, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 9, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 9, 3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 10, 3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 11, 3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 11, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 11, 1, 1, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 1, 8, 3, 3, Blocks.sandstone, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 2, 8, 2, 2, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 1, 1, 16, 3, 3, Blocks.sandstone, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 1, 2, 16, 2, 2, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 4, 9, 11, 4, 11, Blocks.air, Blocks.air, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 8, 1, 8, 8, 3, 8, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 12, 1, 8, 12, 3, 8, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 8, 1, 12, 8, 3, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 12, 1, 12, 12, 3, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 5, 4, 4, 11, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 7, 9, 6, 7, 11, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Blocks.sandstone, Blocks.sandstone, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 5, 5, 9, 5, 7, 11, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151556_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 5, 5, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 5, 6, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 6, 6, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, this.scatteredFeatureSizeX - 6, 5, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, this.scatteredFeatureSizeX - 6, 6, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, this.scatteredFeatureSizeX - 7, 6, 10, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 4, 4, 2, 6, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, Blocks.air, Blocks.air, false); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var4, 2, 4, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var4, 2, 3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var4, this.scatteredFeatureSizeX - 3, 4, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var4, this.scatteredFeatureSizeX - 3, 3, 4, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 3, 2, 2, 3, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Blocks.sandstone, Blocks.sandstone, false); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, 0, 1, 1, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, 0, this.scatteredFeatureSizeX - 2, 1, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 1, 1, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 1, this.scatteredFeatureSizeX - 2, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var7, 2, 1, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone_stairs, var13, this.scatteredFeatureSizeX - 3, 1, 2, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 3, 5, 4, 3, 18, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 5, 4, 2, 16, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, Blocks.air, Blocks.air, false); + int var10; + + for (var10 = 5; var10 <= 17; var10 += 2) { + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 4, 1, var10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, 4, 2, var10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, this.scatteredFeatureSizeX - 5, 1, var10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, this.scatteredFeatureSizeX - 5, 2, var10, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 10, 0, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 10, 0, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 9, 0, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 11, 0, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 8, 0, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 12, 0, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 7, 0, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 13, 0, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 9, 0, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 11, 0, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 10, 0, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 10, 0, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var9, 10, 0, 10, p_74875_3_); + + for (var10 = 0; var10 <= this.scatteredFeatureSizeX - 1; var10 += this.scatteredFeatureSizeX - 1) { + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 4, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, var10, 4, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 5, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 5, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 5, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 6, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, var10, 6, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 6, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 7, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 7, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 7, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 8, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 8, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 8, 3, p_74875_3_); + } + + for (var10 = 2; var10 <= this.scatteredFeatureSizeX - 3; var10 += this.scatteredFeatureSizeX - 3 - 2) { + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 - 1, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 + 1, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 - 1, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 + 1, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10 - 1, 4, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, var10, 4, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10 + 1, 4, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 - 1, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 + 1, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10 - 1, 6, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, var10, 6, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10 + 1, 6, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10 - 1, 7, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10, 7, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, var10 + 1, 7, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 - 1, 8, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10, 8, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, var10 + 1, 8, 0, p_74875_3_); + } + + this.func_151556_a(p_74875_1_, p_74875_3_, 8, 4, 0, 12, 6, 0, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 8, 6, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 12, 6, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 9, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, 10, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, var8, 11, 5, 0, p_74875_3_); + this.func_151556_a(p_74875_1_, p_74875_3_, 8, -14, 8, 12, -11, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 8, -10, 8, 12, -10, 12, Blocks.sandstone, 1, Blocks.sandstone, 1, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 8, -9, 8, 12, -9, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, -8, 8, 12, -1, 12, Blocks.sandstone, Blocks.sandstone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, -11, 9, 11, -1, 11, Blocks.air, Blocks.air, false); + this.func_151550_a(p_74875_1_, Blocks.stone_pressure_plate, 0, 10, -11, 10, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, -13, 9, 11, -13, 11, Blocks.tnt, Blocks.air, false); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 8, -11, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 8, -10, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, 7, -10, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 7, -11, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 12, -11, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 12, -10, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, 13, -10, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 13, -11, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 10, -11, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 10, -10, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, 10, -10, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 10, -11, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 10, -11, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 10, -10, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 1, 10, -10, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sandstone, 2, 10, -11, 13, p_74875_3_); + + for (var10 = 0; var10 < 4; ++var10) { + if (!this.field_74940_h[var10]) { + int var11 = Direction.offsetX[var10] * 2; + int var12 = Direction.offsetZ[var10] * 2; + this.field_74940_h[var10] = this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 10 + var11, -11, 10 + var12, WeightedRandomChestContent.func_92080_a(itemsToGenerateInTemple, Items.enchanted_book.func_92114_b(p_74875_2_)), 2 + p_74875_2_.nextInt(5)); + } + } + + return true; + } + } + + abstract static class Feature extends StructureComponent { + protected int scatteredFeatureSizeX; + protected int scatteredFeatureSizeY; + protected int scatteredFeatureSizeZ; + protected int field_74936_d = -1; + + + public Feature() {} + + protected Feature(Random p_i2065_1_, int p_i2065_2_, int p_i2065_3_, int p_i2065_4_, int p_i2065_5_, int p_i2065_6_, int p_i2065_7_) { + super(0); + this.scatteredFeatureSizeX = p_i2065_5_; + this.scatteredFeatureSizeY = p_i2065_6_; + this.scatteredFeatureSizeZ = p_i2065_7_; + this.coordBaseMode = p_i2065_1_.nextInt(4); + + switch (this.coordBaseMode) { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_5_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_7_ - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_7_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_5_ - 1); + } + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + p_143012_1_.setInteger("Width", this.scatteredFeatureSizeX); + p_143012_1_.setInteger("Height", this.scatteredFeatureSizeY); + p_143012_1_.setInteger("Depth", this.scatteredFeatureSizeZ); + p_143012_1_.setInteger("HPos", this.field_74936_d); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + this.scatteredFeatureSizeX = p_143011_1_.getInteger("Width"); + this.scatteredFeatureSizeY = p_143011_1_.getInteger("Height"); + this.scatteredFeatureSizeZ = p_143011_1_.getInteger("Depth"); + this.field_74936_d = p_143011_1_.getInteger("HPos"); + } + + protected boolean func_74935_a(World p_74935_1_, StructureBoundingBox p_74935_2_, int p_74935_3_) { + if (this.field_74936_d >= 0) { + return true; + } else { + int var4 = 0; + int var5 = 0; + + for (int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { + for (int var7 = this.boundingBox.minX; var7 <= this.boundingBox.maxX; ++var7) { + if (p_74935_2_.isVecInside(var7, 64, var6)) { + var4 += Math.max(p_74935_1_.getTopSolidOrLiquidBlock(var7, var6), p_74935_1_.provider.getAverageGroundLevel()); + ++var5; + } + } + } + + if (var5 == 0) { + return false; + } else { + this.field_74936_d = var4 / var5; + this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + p_74935_3_, 0); + return true; + } + } + } + } + + public static class JunglePyramid extends ComponentScatteredFeaturePieces.Feature { + private boolean field_74947_h; + private boolean field_74948_i; + private boolean field_74945_j; + private boolean field_74946_k; + private static final WeightedRandomChestContent[] junglePyramidsChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + private static final WeightedRandomChestContent[] junglePyramidsDispenserContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.arrow, 0, 2, 7, 30)}; + private static final ComponentScatteredFeaturePieces.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(null); + + + public JunglePyramid() {} + + public JunglePyramid(Random p_i2064_1_, int p_i2064_2_, int p_i2064_3_) { + super(p_i2064_1_, p_i2064_2_, 64, p_i2064_3_, 12, 10, 15); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("placedMainChest", this.field_74947_h); + p_143012_1_.setBoolean("placedHiddenChest", this.field_74948_i); + p_143012_1_.setBoolean("placedTrap1", this.field_74945_j); + p_143012_1_.setBoolean("placedTrap2", this.field_74946_k); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.field_74947_h = p_143011_1_.getBoolean("placedMainChest"); + this.field_74948_i = p_143011_1_.getBoolean("placedHiddenChest"); + this.field_74945_j = p_143011_1_.getBoolean("placedTrap1"); + this.field_74946_k = p_143011_1_.getBoolean("placedTrap2"); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (!this.func_74935_a(p_74875_1_, p_74875_3_, 0)) { + return false; + } else { + int var4 = this.func_151555_a(Blocks.stone_stairs, 3); + int var5 = this.func_151555_a(Blocks.stone_stairs, 2); + int var6 = this.func_151555_a(Blocks.stone_stairs, 0); + int var7 = this.func_151555_a(Blocks.stone_stairs, 1); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 1, 2, 9, 2, 2, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 1, 12, 9, 2, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 1, 3, 2, 2, 11, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 1, 3, 9, 2, 11, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 1, 10, 6, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 13, 10, 6, 13, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 2, 1, 6, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 10, 3, 2, 10, 6, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 3, 2, 9, 3, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 6, 2, 9, 6, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 3, 7, 3, 8, 7, 11, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 8, 4, 7, 8, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithAir(p_74875_1_, p_74875_3_, 3, 1, 3, 8, 2, 11); + this.fillWithAir(p_74875_1_, p_74875_3_, 4, 3, 6, 7, 3, 9); + this.fillWithAir(p_74875_1_, p_74875_3_, 2, 4, 2, 9, 5, 12); + this.fillWithAir(p_74875_1_, p_74875_3_, 4, 6, 5, 7, 6, 9); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 7, 6, 6, 7, 8); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 1, 2, 6, 2, 2); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 2, 12, 6, 2, 12); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 5, 1, 6, 5, 1); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 5, 13, 6, 5, 13); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, 5, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 10, 5, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, 5, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 10, 5, 9, p_74875_3_); + int var8; + + for (var8 = 0; var8 <= 14; var8 += 14) { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 4, var8, 2, 5, var8, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 4, var8, 4, 5, var8, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 4, var8, 7, 5, var8, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 4, var8, 9, 5, var8, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 6, 0, 6, 6, 0, false, p_74875_2_, junglePyramidsRandomScatteredStones); + + for (var8 = 0; var8 <= 11; var8 += 11) { + for (int var9 = 2; var9 <= 12; var9 += 2) { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, var8, 4, var9, var8, 5, var9, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, var8, 6, 5, var8, 6, 5, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, var8, 6, 9, var8, 6, 9, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 7, 2, 2, 9, 2, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 7, 2, 9, 9, 2, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 7, 12, 2, 9, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 7, 12, 9, 9, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 9, 4, 4, 9, 4, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 9, 4, 7, 9, 4, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 9, 10, 4, 9, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 9, 10, 7, 9, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 9, 7, 6, 9, 7, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 5, 9, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 6, 9, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var5, 5, 9, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var5, 6, 9, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 4, 0, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 5, 0, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 6, 0, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 7, 0, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 4, 1, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 4, 2, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 4, 3, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 7, 1, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 7, 2, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 7, 3, 10, p_74875_3_); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 9, 4, 1, 9, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 1, 9, 7, 1, 9, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 10, 7, 2, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 4, 5, 6, 4, 5, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var6, 4, 4, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var7, 7, 4, 5, p_74875_3_); + + for (var8 = 0; var8 < 4; ++var8) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var5, 5, 0 - var8, 6 + var8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var5, 6, 0 - var8, 6 + var8, p_74875_3_); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 0 - var8, 7 + var8, 6, 0 - var8, 9 + var8); + } + + this.fillWithAir(p_74875_1_, p_74875_3_, 1, -3, 12, 10, -1, 13); + this.fillWithAir(p_74875_1_, p_74875_3_, 1, -3, 1, 3, -1, 13); + this.fillWithAir(p_74875_1_, p_74875_3_, 1, -3, 1, 9, -1, 5); + + for (var8 = 1; var8 <= 13; var8 += 2) { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, -3, var8, 1, -2, var8, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + for (var8 = 2; var8 <= 12; var8 += 2) { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, -1, var8, 3, -1, var8, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, -2, 1, 5, -2, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, -2, 1, 9, -2, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 6, -3, 1, 6, -3, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 6, -1, 1, 6, -1, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.func_151550_a(p_74875_1_, Blocks.tripwire_hook, this.func_151555_a(Blocks.tripwire_hook, 3) | 4, 1, -3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire_hook, this.func_151555_a(Blocks.tripwire_hook, 1) | 4, 4, -3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire, 4, 2, -3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire, 4, 3, -3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 4, -3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 3, -3, 1, p_74875_3_); + + if (!this.field_74945_j) { + this.field_74945_j = this.generateStructureDispenserContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, 2, junglePyramidsDispenserContents, 2); + } + + this.func_151550_a(p_74875_1_, Blocks.vine, 15, 3, -2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire_hook, this.func_151555_a(Blocks.tripwire_hook, 2) | 4, 7, -3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire_hook, this.func_151555_a(Blocks.tripwire_hook, 0) | 4, 7, -3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire, 4, 7, -3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire, 4, 7, -3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.tripwire, 4, 7, -3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 8, -3, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 9, -3, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 9, -3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 9, -3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 9, -2, 4, p_74875_3_); + + if (!this.field_74946_k) { + this.field_74946_k = this.generateStructureDispenserContents(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, 4, junglePyramidsDispenserContents, 2); + } + + this.func_151550_a(p_74875_1_, Blocks.vine, 15, 8, -1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.vine, 15, 8, -2, 3, p_74875_3_); + + if (!this.field_74947_h) { + this.field_74947_h = this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, Items.enchanted_book.func_92114_b(p_74875_2_)), 2 + p_74875_2_.nextInt(5)); + } + + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 9, -3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 8, -3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 4, -3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 5, -2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 5, -1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 6, -3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 7, -2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 7, -1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 8, -3, 5, p_74875_3_); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, -1, 1, 9, -1, 5, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithAir(p_74875_1_, p_74875_3_, 8, -3, 8, 10, -1, 10); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 3, 8, -2, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 3, 9, -2, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 3, 10, -2, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.lever, BlockLever.func_149819_b(this.func_151555_a(Blocks.lever, 2)), 8, -2, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.lever, BlockLever.func_149819_b(this.func_151555_a(Blocks.lever, 2)), 9, -2, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.lever, BlockLever.func_149819_b(this.func_151555_a(Blocks.lever, 2)), 10, -2, 12, p_74875_3_); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 8, -3, 8, 8, -3, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 10, -3, 8, 10, -3, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.func_151550_a(p_74875_1_, Blocks.mossy_cobblestone, 0, 10, -2, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 8, -2, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 8, -2, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.redstone_wire, 0, 10, -1, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sticky_piston, 1, 9, -2, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sticky_piston, this.func_151555_a(Blocks.sticky_piston, 4), 10, -2, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.sticky_piston, this.func_151555_a(Blocks.sticky_piston, 4), 10, -1, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.unpowered_repeater, this.func_151555_a(Blocks.unpowered_repeater, 2), 10, -2, 10, p_74875_3_); + + if (!this.field_74948_i) { + this.field_74948_i = this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, Items.enchanted_book.func_92114_b(p_74875_2_)), 2 + p_74875_2_.nextInt(5)); + } + + return true; + } + } + + static class Stones extends StructureComponent.BlockSelector { + + + private Stones() {} + + public void selectBlocks(Random p_75062_1_, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + if (p_75062_1_.nextFloat() < 0.4F) { + this.field_151562_a = Blocks.cobblestone; + } else { + this.field_151562_a = Blocks.mossy_cobblestone; + } + } + + Stones(Object p_i2063_1_) { + this(); + } + } + } + + public static class SwampHut extends ComponentScatteredFeaturePieces.Feature { + private boolean hasWitch; + + + public SwampHut() {} + + public SwampHut(Random p_i2066_1_, int p_i2066_2_, int p_i2066_3_) { + super(p_i2066_1_, p_i2066_2_, 64, p_i2066_3_, 7, 5, 9); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Witch", this.hasWitch); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.hasWitch = p_143011_1_.getBoolean("Witch"); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (!this.func_74935_a(p_74875_1_, p_74875_3_, 0)) { + return false; + } else { + this.func_151556_a(p_74875_1_, p_74875_3_, 1, 1, 1, 5, 1, 7, Blocks.planks, 1, Blocks.planks, 1, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 1, 4, 2, 5, 4, 7, Blocks.planks, 1, Blocks.planks, 1, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 2, 1, 0, 4, 1, 0, Blocks.planks, 1, Blocks.planks, 1, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 2, 2, 2, 3, 3, 2, Blocks.planks, 1, Blocks.planks, 1, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 1, 2, 3, 1, 3, 6, Blocks.planks, 1, Blocks.planks, 1, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 5, 2, 3, 5, 3, 6, Blocks.planks, 1, Blocks.planks, 1, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 2, 2, 7, 4, 3, 7, Blocks.planks, 1, Blocks.planks, 1, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 2, 1, 3, 2, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 0, 2, 5, 3, 2, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 7, 1, 3, 7, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 0, 7, 5, 3, 7, Blocks.log, Blocks.log, false); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 2, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 3, 3, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, 3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 5, 3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 5, 3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.flower_pot, 7, 1, 3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.crafting_table, 0, 3, 2, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cauldron, 0, 4, 2, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 5, 2, 1, p_74875_3_); + int var4 = this.func_151555_a(Blocks.oak_stairs, 3); + int var5 = this.func_151555_a(Blocks.oak_stairs, 1); + int var6 = this.func_151555_a(Blocks.oak_stairs, 0); + int var7 = this.func_151555_a(Blocks.oak_stairs, 2); + this.func_151556_a(p_74875_1_, p_74875_3_, 0, 4, 1, 6, 4, 1, Blocks.spruce_stairs, var4, Blocks.spruce_stairs, var4, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 0, 4, 2, 0, 4, 7, Blocks.spruce_stairs, var6, Blocks.spruce_stairs, var6, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 6, 4, 2, 6, 4, 7, Blocks.spruce_stairs, var5, Blocks.spruce_stairs, var5, false); + this.func_151556_a(p_74875_1_, p_74875_3_, 0, 4, 8, 6, 4, 8, Blocks.spruce_stairs, var7, Blocks.spruce_stairs, var7, false); + int var8; + int var9; + + for (var8 = 2; var8 <= 7; var8 += 5) { + for (var9 = 1; var9 <= 5; var9 += 4) { + this.func_151554_b(p_74875_1_, Blocks.log, 0, var9, -1, var8, p_74875_3_); + } + } + + if (!this.hasWitch) { + var8 = this.getXWithOffset(2, 5); + var9 = this.getYWithOffset(2); + int var10 = this.getZWithOffset(2, 5); + + if (p_74875_3_.isVecInside(var8, var9, var10)) { + this.hasWitch = true; + EntityWitch var11 = new EntityWitch(p_74875_1_); + var11.setLocationAndAngles((double)var8 + 0.5D, var9, (double)var10 + 0.5D, 0.0F, 0.0F); + var11.onSpawnWithEgg(null); + p_74875_1_.spawnEntityInWorld(var11); + } + } + + return true; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java new file mode 100644 index 0000000..f6ad460 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java @@ -0,0 +1,37 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.MathHelper; + +public class MapGenMineshaft extends MapGenStructure { + private double field_82673_e = 0.004D; + + + public MapGenMineshaft() {} + + public String func_143025_a() { + return "Mineshaft"; + } + + public MapGenMineshaft(Map p_i2034_1_) { + Iterator var2 = p_i2034_1_.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + + if (var3.getKey().equals("chance")) { + this.field_82673_e = MathHelper.parseDoubleWithDefault((String)var3.getValue(), this.field_82673_e); + } + } + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { + return this.rand.nextDouble() < this.field_82673_e && this.rand.nextInt(80) < Math.max(Math.abs(p_75047_1_), Math.abs(p_75047_2_)); + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) { + return new StructureMineshaftStart(this.worldObj, this.rand, p_75049_1_, p_75049_2_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java new file mode 100644 index 0000000..7abb510 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java @@ -0,0 +1,66 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenNetherBridge extends MapGenStructure { + private final List spawnList = new ArrayList(); + + + public MapGenNetherBridge() { + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityBlaze.class, 10, 2, 3)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); + } + + public String func_143025_a() { + return "Fortress"; + } + + public List getSpawnList() { + return this.spawnList; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { + int var3 = p_75047_1_ >> 4; + int var4 = p_75047_2_ >> 4; + this.rand.setSeed((long)(var3 ^ var4 << 4) ^ this.worldObj.getSeed()); + this.rand.nextInt(); + return this.rand.nextInt(3) == 0 && (p_75047_1_ == (var3 << 4) + 4 + this.rand.nextInt(8) && p_75047_2_ == (var4 << 4) + 4 + this.rand.nextInt(8)); + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) { + return new MapGenNetherBridge.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_); + } + + public static class Start extends StructureStart { + + + public Start() {} + + public Start(World p_i2040_1_, Random p_i2040_2_, int p_i2040_3_, int p_i2040_4_) { + super(p_i2040_3_, p_i2040_4_); + StructureNetherBridgePieces.Start var5 = new StructureNetherBridgePieces.Start(p_i2040_2_, (p_i2040_3_ << 4) + 2, (p_i2040_4_ << 4) + 2); + this.components.add(var5); + var5.buildComponent(var5, this.components, p_i2040_2_); + ArrayList var6 = var5.field_74967_d; + + while (!var6.isEmpty()) { + int var7 = p_i2040_2_.nextInt(var6.size()); + StructureComponent var8 = (StructureComponent)var6.remove(var7); + var8.buildComponent(var5, this.components, p_i2040_2_); + } + + this.updateBoundingBox(); + this.setRandomHeight(p_i2040_1_, p_i2040_2_, 48, 70); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java new file mode 100644 index 0000000..dcaf254 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java @@ -0,0 +1,135 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenScatteredFeature extends MapGenStructure { + private static final List biomelist = Arrays.asList(BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland); + + /** contains possible spawns for scattered features */ + private final List scatteredFeatureSpawnList; + + /** the maximum distance between scattered features */ + private int maxDistanceBetweenScatteredFeatures; + + /** the minimum distance between scattered features */ + private final int minDistanceBetweenScatteredFeatures; + + + public MapGenScatteredFeature() { + this.scatteredFeatureSpawnList = new ArrayList(); + this.maxDistanceBetweenScatteredFeatures = 32; + this.minDistanceBetweenScatteredFeatures = 8; + this.scatteredFeatureSpawnList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 1, 1, 1)); + } + + public MapGenScatteredFeature(Map p_i2061_1_) { + this(); + Iterator var2 = p_i2061_1_.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + + if (var3.getKey().equals("distance")) { + this.maxDistanceBetweenScatteredFeatures = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.maxDistanceBetweenScatteredFeatures, this.minDistanceBetweenScatteredFeatures + 1); + } + } + } + + public String func_143025_a() { + return "Temple"; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { + int var3 = p_75047_1_; + int var4 = p_75047_2_; + + if (p_75047_1_ < 0) { + p_75047_1_ -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + if (p_75047_2_ < 0) { + p_75047_2_ -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + int var5 = p_75047_1_ / this.maxDistanceBetweenScatteredFeatures; + int var6 = p_75047_2_ / this.maxDistanceBetweenScatteredFeatures; + Random var7 = this.worldObj.setRandomSeed(var5, var6, 14357617); + var5 *= this.maxDistanceBetweenScatteredFeatures; + var6 *= this.maxDistanceBetweenScatteredFeatures; + var5 += var7.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + var6 += var7.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + + if (var3 == var5 && var4 == var6) { + BiomeGenBase var8 = this.worldObj.getWorldChunkManager().getBiomeGenAt(var3 * 16 + 8, var4 * 16 + 8); + Iterator var9 = biomelist.iterator(); + + while (var9.hasNext()) { + BiomeGenBase var10 = (BiomeGenBase)var9.next(); + + if (var8 == var10) { + return true; + } + } + } + + return false; + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) { + return new MapGenScatteredFeature.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_); + } + + public boolean func_143030_a(int p_143030_1_, int p_143030_2_, int p_143030_3_) { + StructureStart var4 = this.func_143028_c(p_143030_1_, p_143030_2_, p_143030_3_); + + if (var4 != null && var4 instanceof MapGenScatteredFeature.Start && !var4.components.isEmpty()) { + StructureComponent var5 = (StructureComponent)var4.components.getFirst(); + return var5 instanceof ComponentScatteredFeaturePieces.SwampHut; + } else { + return false; + } + } + + /** + * returns possible spawns for scattered features + */ + public List getScatteredFeatureSpawnList() { + return this.scatteredFeatureSpawnList; + } + + public static class Start extends StructureStart { + + + public Start() {} + + public Start(World p_i2060_1_, Random p_i2060_2_, int p_i2060_3_, int p_i2060_4_) { + super(p_i2060_3_, p_i2060_4_); + BiomeGenBase var5 = p_i2060_1_.getBiomeGenForCoords(p_i2060_3_ * 16 + 8, p_i2060_4_ * 16 + 8); + + if (var5 != BiomeGenBase.jungle && var5 != BiomeGenBase.jungleHills) { + if (var5 == BiomeGenBase.swampland) { + ComponentScatteredFeaturePieces.SwampHut var7 = new ComponentScatteredFeaturePieces.SwampHut(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(var7); + } else { + ComponentScatteredFeaturePieces.DesertPyramid var8 = new ComponentScatteredFeaturePieces.DesertPyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(var8); + } + } else { + ComponentScatteredFeaturePieces.JunglePyramid var6 = new ComponentScatteredFeaturePieces.JunglePyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(var6); + } + + this.updateBoundingBox(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java new file mode 100644 index 0000000..5ff6f8a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java @@ -0,0 +1,161 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenStronghold extends MapGenStructure { + private final List field_151546_e; + + /** + * is spawned false and set true once the defined BiomeGenBases were compared with the present ones + */ + private boolean ranBiomeCheck; + private ChunkCoordIntPair[] structureCoords; + private double field_82671_h; + private int field_82672_i; + + + public MapGenStronghold() { + this.structureCoords = new ChunkCoordIntPair[3]; + this.field_82671_h = 32.0D; + this.field_82672_i = 3; + this.field_151546_e = new ArrayList(); + BiomeGenBase[] var1 = BiomeGenBase.getBiomeGenArray(); + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) { + BiomeGenBase var4 = var1[var3]; + + if (var4 != null && var4.minHeight > 0.0F) { + this.field_151546_e.add(var4); + } + } + } + + public MapGenStronghold(Map p_i2068_1_) { + this(); + Iterator var2 = p_i2068_1_.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + + if (var3.getKey().equals("distance")) { + this.field_82671_h = MathHelper.parseDoubleWithDefaultAndMax((String)var3.getValue(), this.field_82671_h, 1.0D); + } else if (var3.getKey().equals("count")) { + this.structureCoords = new ChunkCoordIntPair[MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.structureCoords.length, 1)]; + } else if (var3.getKey().equals("spread")) { + this.field_82672_i = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.field_82672_i, 1); + } + } + } + + public String func_143025_a() { + return "Stronghold"; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { + if (!this.ranBiomeCheck) { + Random var3 = new Random(); + var3.setSeed(this.worldObj.getSeed()); + double var4 = var3.nextDouble() * Math.PI * 2.0D; + int var6 = 1; + + for (int var7 = 0; var7 < this.structureCoords.length; ++var7) { + double var8 = (1.25D * (double)var6 + var3.nextDouble()) * this.field_82671_h * (double)var6; + int var10 = (int)Math.round(Math.cos(var4) * var8); + int var11 = (int)Math.round(Math.sin(var4) * var8); + ChunkPosition var12 = this.worldObj.getWorldChunkManager().func_150795_a((var10 << 4) + 8, (var11 << 4) + 8, 112, this.field_151546_e, var3); + + if (var12 != null) { + var10 = var12.field_151329_a >> 4; + var11 = var12.field_151328_c >> 4; + } + + this.structureCoords[var7] = new ChunkCoordIntPair(var10, var11); + var4 += (Math.PI * 2D) * (double)var6 / (double)this.field_82672_i; + + if (var7 == this.field_82672_i) { + var6 += 2 + var3.nextInt(5); + this.field_82672_i += 1 + var3.nextInt(2); + } + } + + this.ranBiomeCheck = true; + } + + ChunkCoordIntPair[] var13 = this.structureCoords; + int var14 = var13.length; + + for (int var5 = 0; var5 < var14; ++var5) { + ChunkCoordIntPair var15 = var13[var5]; + + if (p_75047_1_ == var15.chunkXPos && p_75047_2_ == var15.chunkZPos) { + return true; + } + } + + return false; + } + + /** + * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this + * structure generator. + */ + protected List getCoordList() { + ArrayList var1 = new ArrayList(); + ChunkCoordIntPair[] var2 = this.structureCoords; + int var3 = var2.length; + + for (int var4 = 0; var4 < var3; ++var4) { + ChunkCoordIntPair var5 = var2[var4]; + + if (var5 != null) { + var1.add(var5.func_151349_a(64)); + } + } + + return var1; + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) { + MapGenStronghold.Start var3; + + for (var3 = new MapGenStronghold.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_); var3.getComponents().isEmpty() || ((StructureStrongholdPieces.Stairs2)var3.getComponents().get(0)).strongholdPortalRoom == null; var3 = new MapGenStronghold.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_)) { + } + + return var3; + } + + public static class Start extends StructureStart { + + + public Start() {} + + public Start(World p_i2067_1_, Random p_i2067_2_, int p_i2067_3_, int p_i2067_4_) { + super(p_i2067_3_, p_i2067_4_); + StructureStrongholdPieces.prepareStructurePieces(); + StructureStrongholdPieces.Stairs2 var5 = new StructureStrongholdPieces.Stairs2(0, p_i2067_2_, (p_i2067_3_ << 4) + 2, (p_i2067_4_ << 4) + 2); + this.components.add(var5); + var5.buildComponent(var5, this.components, p_i2067_2_); + List var6 = var5.field_75026_c; + + while (!var6.isEmpty()) { + int var7 = p_i2067_2_.nextInt(var6.size()); + StructureComponent var8 = (StructureComponent)var6.remove(var7); + var8.buildComponent(var5, this.components, p_i2067_2_); + } + + this.updateBoundingBox(); + this.markAvailableHeight(p_i2067_1_, p_i2067_2_, 10); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java new file mode 100644 index 0000000..d4ca84a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java @@ -0,0 +1,257 @@ +package net.minecraft.world.gen.structure; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.gen.MapGenBase; + +public abstract class MapGenStructure extends MapGenBase { + private MapGenStructureData field_143029_e; + + /** + * Used to store a list of all structures that have been recursively generated. Used so that during recursive + * generation, the structure generator can avoid generating structures that intersect ones that have already been + * placed. + */ + protected Map structureMap = new HashMap(); + + + public abstract String func_143025_a(); + + protected final void func_151538_a(World p_151538_1_, final int p_151538_2_, final int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) { + this.func_143027_a(p_151538_1_); + + if (!this.structureMap.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_151538_2_, p_151538_3_)))) { + this.rand.nextInt(); + + try { + if (this.canSpawnStructureAtCoords(p_151538_2_, p_151538_3_)) { + StructureStart var7 = this.getStructureStart(p_151538_2_, p_151538_3_); + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_151538_2_, p_151538_3_)), var7); + this.func_143026_a(p_151538_2_, p_151538_3_, var7); + } + } catch (Throwable var10) { + CrashReport var8 = CrashReport.makeCrashReport(var10, "Exception preparing structure feature"); + CrashReportCategory var9 = var8.makeCategory("Feature being prepared"); + var9.addCrashSectionCallable("Is feature chunk", new Callable() { + + public String call() { + return MapGenStructure.this.canSpawnStructureAtCoords(p_151538_2_, p_151538_3_) ? "True" : "False"; + } + }); + var9.addCrashSection("Chunk location", String.format("%d,%d", Integer.valueOf(p_151538_2_), Integer.valueOf(p_151538_3_))); + var9.addCrashSectionCallable("Chunk pos hash", new Callable() { + + public String call() { + return String.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_151538_2_, p_151538_3_)); + } + }); + var9.addCrashSectionCallable("Structure type", new Callable() { + + public String call() { + return MapGenStructure.this.getClass().getCanonicalName(); + } + }); + throw new ReportedException(var8); + } + } + } + + /** + * Generates structures in specified chunk next to existing structures. Does *not* generate StructureStarts. + */ + public boolean generateStructuresInChunk(World p_75051_1_, Random p_75051_2_, int p_75051_3_, int p_75051_4_) { + this.func_143027_a(p_75051_1_); + int var5 = (p_75051_3_ << 4) + 8; + int var6 = (p_75051_4_ << 4) + 8; + boolean var7 = false; + Iterator var8 = this.structureMap.values().iterator(); + + while (var8.hasNext()) { + StructureStart var9 = (StructureStart)var8.next(); + + if (var9.isSizeableStructure() && var9.getBoundingBox().intersectsWith(var5, var6, var5 + 15, var6 + 15)) { + var9.generateStructure(p_75051_1_, p_75051_2_, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15)); + var7 = true; + this.func_143026_a(var9.func_143019_e(), var9.func_143018_f(), var9); + } + } + + return var7; + } + + /** + * Returns true if the structure generator has generated a structure located at the given position tuple. + */ + public boolean hasStructureAt(int p_75048_1_, int p_75048_2_, int p_75048_3_) { + this.func_143027_a(this.worldObj); + return this.func_143028_c(p_75048_1_, p_75048_2_, p_75048_3_) != null; + } + + protected StructureStart func_143028_c(int p_143028_1_, int p_143028_2_, int p_143028_3_) { + Iterator var4 = this.structureMap.values().iterator(); + + while (var4.hasNext()) { + StructureStart var5 = (StructureStart)var4.next(); + + if (var5.isSizeableStructure() && var5.getBoundingBox().intersectsWith(p_143028_1_, p_143028_3_, p_143028_1_, p_143028_3_)) { + Iterator var6 = var5.getComponents().iterator(); + + while (var6.hasNext()) { + StructureComponent var7 = (StructureComponent)var6.next(); + + if (var7.getBoundingBox().isVecInside(p_143028_1_, p_143028_2_, p_143028_3_)) { + return var5; + } + } + } + } + + return null; + } + + public boolean func_142038_b(int p_142038_1_, int p_142038_2_, int p_142038_3_) { + this.func_143027_a(this.worldObj); + Iterator var4 = this.structureMap.values().iterator(); + StructureStart var5; + + do { + if (!var4.hasNext()) { + return false; + } + + var5 = (StructureStart)var4.next(); + } + while (!var5.isSizeableStructure()); + + return var5.getBoundingBox().intersectsWith(p_142038_1_, p_142038_3_, p_142038_1_, p_142038_3_); + } + + public ChunkPosition func_151545_a(World p_151545_1_, int p_151545_2_, int p_151545_3_, int p_151545_4_) { + this.worldObj = p_151545_1_; + this.func_143027_a(p_151545_1_); + this.rand.setSeed(p_151545_1_.getSeed()); + long var5 = this.rand.nextLong(); + long var7 = this.rand.nextLong(); + long var9 = (long)(p_151545_2_ >> 4) * var5; + long var11 = (long)(p_151545_4_ >> 4) * var7; + this.rand.setSeed(var9 ^ var11 ^ p_151545_1_.getSeed()); + this.func_151538_a(p_151545_1_, p_151545_2_ >> 4, p_151545_4_ >> 4, 0, 0, null); + double var13 = Double.MAX_VALUE; + ChunkPosition var15 = null; + Iterator var16 = this.structureMap.values().iterator(); + ChunkPosition var19; + int var20; + int var21; + int var22; + double var23; + + while (var16.hasNext()) { + StructureStart var17 = (StructureStart)var16.next(); + + if (var17.isSizeableStructure()) { + StructureComponent var18 = (StructureComponent)var17.getComponents().get(0); + var19 = var18.func_151553_a(); + var20 = var19.field_151329_a - p_151545_2_; + var21 = var19.field_151327_b - p_151545_3_; + var22 = var19.field_151328_c - p_151545_4_; + var23 = var20 * var20 + var21 * var21 + var22 * var22; + + if (var23 < var13) { + var13 = var23; + var15 = var19; + } + } + } + + if (var15 != null) { + return var15; + } else { + List var25 = this.getCoordList(); + + if (var25 != null) { + ChunkPosition var26 = null; + Iterator var27 = var25.iterator(); + + while (var27.hasNext()) { + var19 = (ChunkPosition)var27.next(); + var20 = var19.field_151329_a - p_151545_2_; + var21 = var19.field_151327_b - p_151545_3_; + var22 = var19.field_151328_c - p_151545_4_; + var23 = var20 * var20 + var21 * var21 + var22 * var22; + + if (var23 < var13) { + var13 = var23; + var26 = var19; + } + } + + return var26; + } else { + return null; + } + } + } + + /** + * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this + * structure generator. + */ + protected List getCoordList() { + return null; + } + + private void func_143027_a(World p_143027_1_) { + if (this.field_143029_e == null) { + this.field_143029_e = (MapGenStructureData)p_143027_1_.loadItemData(MapGenStructureData.class, this.func_143025_a()); + + if (this.field_143029_e == null) { + this.field_143029_e = new MapGenStructureData(this.func_143025_a()); + p_143027_1_.setItemData(this.func_143025_a(), this.field_143029_e); + } else { + NBTTagCompound var2 = this.field_143029_e.func_143041_a(); + Iterator var3 = var2.func_150296_c().iterator(); + + while (var3.hasNext()) { + String var4 = (String)var3.next(); + NBTBase var5 = var2.getTag(var4); + + if (var5.getId() == 10) { + NBTTagCompound var6 = (NBTTagCompound)var5; + + if (var6.hasKey("ChunkX") && var6.hasKey("ChunkZ")) { + int var7 = var6.getInteger("ChunkX"); + int var8 = var6.getInteger("ChunkZ"); + StructureStart var9 = MapGenStructureIO.func_143035_a(var6, p_143027_1_); + + if (var9 != null) { + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var7, var8)), var9); + } + } + } + } + } + } + } + + private void func_143026_a(int p_143026_1_, int p_143026_2_, StructureStart p_143026_3_) { + this.field_143029_e.func_143043_a(p_143026_3_.func_143021_a(p_143026_1_, p_143026_2_), p_143026_1_, p_143026_2_); + this.field_143029_e.markDirty(); + } + + protected abstract boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_); + + protected abstract StructureStart getStructureStart(int p_75049_1_, int p_75049_2_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java new file mode 100644 index 0000000..17a84f8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java @@ -0,0 +1,39 @@ +package net.minecraft.world.gen.structure; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldSavedData; + +public class MapGenStructureData extends WorldSavedData { + private NBTTagCompound field_143044_a = new NBTTagCompound(); + + + public MapGenStructureData(String p_i43001_1_) { + super(p_i43001_1_); + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbt) { + this.field_143044_a = nbt.getCompoundTag("Features"); + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbt) { + nbt.setTag("Features", this.field_143044_a); + } + + public void func_143043_a(NBTTagCompound p_143043_1_, int p_143043_2_, int p_143043_3_) { + this.field_143044_a.setTag(func_143042_b(p_143043_2_, p_143043_3_), p_143043_1_); + } + + public static String func_143042_b(int p_143042_0_, int p_143042_1_) { + return "[" + p_143042_0_ + "," + p_143042_1_ + "]"; + } + + public NBTTagCompound func_143041_a() { + return this.field_143044_a; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java new file mode 100644 index 0000000..02c0543 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java @@ -0,0 +1,94 @@ +package net.minecraft.world.gen.structure; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class MapGenStructureIO { + private static final Logger logger = LogManager.getLogger(); + private static final Map field_143040_a = new HashMap(); + private static final Map field_143038_b = new HashMap(); + private static final Map field_143039_c = new HashMap(); + private static final Map field_143037_d = new HashMap(); + + + private static void func_143034_b(Class p_143034_0_, String p_143034_1_) { + field_143040_a.put(p_143034_1_, p_143034_0_); + field_143038_b.put(p_143034_0_, p_143034_1_); + } + + static void func_143031_a(Class p_143031_0_, String p_143031_1_) { + field_143039_c.put(p_143031_1_, p_143031_0_); + field_143037_d.put(p_143031_0_, p_143031_1_); + } + + public static String func_143033_a(StructureStart p_143033_0_) { + return (String)field_143038_b.get(p_143033_0_.getClass()); + } + + public static String func_143036_a(StructureComponent p_143036_0_) { + return (String)field_143037_d.get(p_143036_0_.getClass()); + } + + public static StructureStart func_143035_a(NBTTagCompound p_143035_0_, World p_143035_1_) { + StructureStart var2 = null; + + try { + Class var3 = (Class)field_143040_a.get(p_143035_0_.getString("id")); + + if (var3 != null) { + var2 = (StructureStart)var3.newInstance(); + } + } catch (Exception var4) { + logger.warn("Failed Start with id " + p_143035_0_.getString("id")); + var4.printStackTrace(); + } + + if (var2 != null) { + var2.func_143020_a(p_143035_1_, p_143035_0_); + } else { + logger.warn("Skipping Structure with id " + p_143035_0_.getString("id")); + } + + return var2; + } + + public static StructureComponent func_143032_b(NBTTagCompound p_143032_0_, World p_143032_1_) { + StructureComponent var2 = null; + + try { + Class var3 = (Class)field_143039_c.get(p_143032_0_.getString("id")); + + if (var3 != null) { + var2 = (StructureComponent)var3.newInstance(); + } + } catch (Exception var4) { + logger.warn("Failed Piece with id " + p_143032_0_.getString("id")); + var4.printStackTrace(); + } + + if (var2 != null) { + var2.func_143009_a(p_143032_1_, p_143032_0_); + } else { + logger.warn("Skipping Piece with id " + p_143032_0_.getString("id")); + } + + return var2; + } + + static { + func_143034_b(StructureMineshaftStart.class, "Mineshaft"); + func_143034_b(MapGenVillage.Start.class, "Village"); + func_143034_b(MapGenNetherBridge.Start.class, "Fortress"); + func_143034_b(MapGenStronghold.Start.class, "Stronghold"); + func_143034_b(MapGenScatteredFeature.Start.class, "Temple"); + StructureMineshaftPieces.func_143048_a(); + StructureVillagePieces.func_143016_a(); + StructureNetherBridgePieces.func_143049_a(); + StructureStrongholdPieces.func_143046_a(); + ComponentScatteredFeaturePieces.func_143045_a(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java new file mode 100644 index 0000000..7d206c1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java @@ -0,0 +1,140 @@ +package net.minecraft.world.gen.structure; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenVillage extends MapGenStructure { + /** A list of all the biomes villages can spawn in. */ + public static final List villageSpawnBiomes = Arrays.asList(BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.field_150588_X); + + /** World terrain type, 0 for normal, 1 for flat map */ + private int terrainType; + private int field_82665_g; + private final int field_82666_h; + + + public MapGenVillage() { + this.field_82665_g = 32; + this.field_82666_h = 8; + } + + public MapGenVillage(Map p_i2093_1_) { + this(); + Iterator var2 = p_i2093_1_.entrySet().iterator(); + + while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + + if (var3.getKey().equals("size")) { + this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.terrainType, 0); + } else if (var3.getKey().equals("distance")) { + this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.field_82665_g, this.field_82666_h + 1); + } + } + } + + public String func_143025_a() { + return "Village"; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { + int var3 = p_75047_1_; + int var4 = p_75047_2_; + + if (p_75047_1_ < 0) { + p_75047_1_ -= this.field_82665_g - 1; + } + + if (p_75047_2_ < 0) { + p_75047_2_ -= this.field_82665_g - 1; + } + + int var5 = p_75047_1_ / this.field_82665_g; + int var6 = p_75047_2_ / this.field_82665_g; + Random var7 = this.worldObj.setRandomSeed(var5, var6, 10387312); + var5 *= this.field_82665_g; + var6 *= this.field_82665_g; + var5 += var7.nextInt(this.field_82665_g - this.field_82666_h); + var6 += var7.nextInt(this.field_82665_g - this.field_82666_h); + + if (var3 == var5 && var4 == var6) { + boolean var8 = this.worldObj.getWorldChunkManager().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, villageSpawnBiomes); + + return var8; + } + + return false; + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) { + return new MapGenVillage.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_, this.terrainType); + } + + public static class Start extends StructureStart { + private boolean hasMoreThanTwoComponents; + + + public Start() {} + + public Start(World p_i2092_1_, Random p_i2092_2_, int p_i2092_3_, int p_i2092_4_, int p_i2092_5_) { + super(p_i2092_3_, p_i2092_4_); + List var6 = StructureVillagePieces.getStructureVillageWeightedPieceList(p_i2092_2_, p_i2092_5_); + StructureVillagePieces.Start var7 = new StructureVillagePieces.Start(p_i2092_1_.getWorldChunkManager(), 0, p_i2092_2_, (p_i2092_3_ << 4) + 2, (p_i2092_4_ << 4) + 2, var6, p_i2092_5_); + this.components.add(var7); + var7.buildComponent(var7, this.components, p_i2092_2_); + List var8 = var7.field_74930_j; + List var9 = var7.field_74932_i; + int var10; + + while (!var8.isEmpty() || !var9.isEmpty()) { + StructureComponent var11; + + if (var8.isEmpty()) { + var10 = p_i2092_2_.nextInt(var9.size()); + var11 = (StructureComponent)var9.remove(var10); + var11.buildComponent(var7, this.components, p_i2092_2_); + } else { + var10 = p_i2092_2_.nextInt(var8.size()); + var11 = (StructureComponent)var8.remove(var10); + var11.buildComponent(var7, this.components, p_i2092_2_); + } + } + + this.updateBoundingBox(); + var10 = 0; + Iterator var13 = this.components.iterator(); + + while (var13.hasNext()) { + StructureComponent var12 = (StructureComponent)var13.next(); + + if (!(var12 instanceof StructureVillagePieces.Road)) { + ++var10; + } + } + + this.hasMoreThanTwoComponents = var10 > 2; + } + + public boolean isSizeableStructure() { + return this.hasMoreThanTwoComponents; + } + + public void func_143022_a(NBTTagCompound p_143022_1_) { + super.func_143022_a(p_143022_1_); + p_143022_1_.setBoolean("Valid", this.hasMoreThanTwoComponents); + } + + public void func_143017_b(NBTTagCompound p_143017_1_) { + super.func_143017_b(p_143017_1_); + this.hasMoreThanTwoComponents = p_143017_1_.getBoolean("Valid"); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java new file mode 100644 index 0000000..68adc65 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java @@ -0,0 +1,179 @@ +package net.minecraft.world.gen.structure; + +import net.minecraft.nbt.NBTTagIntArray; + +public class StructureBoundingBox { + /** The first x coordinate of a bounding box. */ + public int minX; + + /** The first y coordinate of a bounding box. */ + public int minY; + + /** The first z coordinate of a bounding box. */ + public int minZ; + + /** The second x coordinate of a bounding box. */ + public int maxX; + + /** The second y coordinate of a bounding box. */ + public int maxY; + + /** The second z coordinate of a bounding box. */ + public int maxZ; + + + public StructureBoundingBox() {} + + public StructureBoundingBox(int[] p_i43000_1_) { + if (p_i43000_1_.length == 6) { + this.minX = p_i43000_1_[0]; + this.minY = p_i43000_1_[1]; + this.minZ = p_i43000_1_[2]; + this.maxX = p_i43000_1_[3]; + this.maxY = p_i43000_1_[4]; + this.maxZ = p_i43000_1_[5]; + } + } + + /** + * returns a new StructureBoundingBox with MAX values + */ + public static StructureBoundingBox getNewBoundingBox() { + return new StructureBoundingBox(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); + } + + /** + * used to project a possible new component Bounding Box - to check if it would cut anything already spawned + */ + public static StructureBoundingBox getComponentToAddBoundingBox(int p_78889_0_, int p_78889_1_, int p_78889_2_, int p_78889_3_, int p_78889_4_, int p_78889_5_, int p_78889_6_, int p_78889_7_, int p_78889_8_, int p_78889_9_) { + switch (p_78889_9_) { + case 0: + return new StructureBoundingBox(p_78889_0_ + p_78889_3_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_5_, p_78889_0_ + p_78889_6_ - 1 + p_78889_3_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_8_ - 1 + p_78889_5_); + + case 1: + return new StructureBoundingBox(p_78889_0_ - p_78889_8_ + 1 + p_78889_5_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_3_, p_78889_0_ + p_78889_5_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_6_ - 1 + p_78889_3_); + + case 2: + return new StructureBoundingBox(p_78889_0_ + p_78889_3_, p_78889_1_ + p_78889_4_, p_78889_2_ - p_78889_8_ + 1 + p_78889_5_, p_78889_0_ + p_78889_6_ - 1 + p_78889_3_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_5_); + + case 3: + return new StructureBoundingBox(p_78889_0_ + p_78889_5_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_3_, p_78889_0_ + p_78889_8_ - 1 + p_78889_5_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_6_ - 1 + p_78889_3_); + + default: + return new StructureBoundingBox(p_78889_0_ + p_78889_3_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_5_, p_78889_0_ + p_78889_6_ - 1 + p_78889_3_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_8_ - 1 + p_78889_5_); + } + } + + public StructureBoundingBox(StructureBoundingBox p_i2031_1_) { + this.minX = p_i2031_1_.minX; + this.minY = p_i2031_1_.minY; + this.minZ = p_i2031_1_.minZ; + this.maxX = p_i2031_1_.maxX; + this.maxY = p_i2031_1_.maxY; + this.maxZ = p_i2031_1_.maxZ; + } + + public StructureBoundingBox(int p_i2032_1_, int p_i2032_2_, int p_i2032_3_, int p_i2032_4_, int p_i2032_5_, int p_i2032_6_) { + this.minX = p_i2032_1_; + this.minY = p_i2032_2_; + this.minZ = p_i2032_3_; + this.maxX = p_i2032_4_; + this.maxY = p_i2032_5_; + this.maxZ = p_i2032_6_; + } + + public StructureBoundingBox(int p_i2033_1_, int p_i2033_2_, int p_i2033_3_, int p_i2033_4_) { + this.minX = p_i2033_1_; + this.minZ = p_i2033_2_; + this.maxX = p_i2033_3_; + this.maxZ = p_i2033_4_; + this.minY = 1; + this.maxY = 512; + } + + /** + * Returns whether the given bounding box intersects with this one. Args: structureboundingbox + */ + public boolean intersectsWith(StructureBoundingBox p_78884_1_) { + return this.maxX >= p_78884_1_.minX && this.minX <= p_78884_1_.maxX && this.maxZ >= p_78884_1_.minZ && this.minZ <= p_78884_1_.maxZ && this.maxY >= p_78884_1_.minY && this.minY <= p_78884_1_.maxY; + } + + /** + * Discover if a coordinate is inside the bounding box area. + */ + public boolean intersectsWith(int p_78885_1_, int p_78885_2_, int p_78885_3_, int p_78885_4_) { + return this.maxX >= p_78885_1_ && this.minX <= p_78885_3_ && this.maxZ >= p_78885_2_ && this.minZ <= p_78885_4_; + } + + /** + * Expands a bounding box's dimensions to include the supplied bounding box. + */ + public void expandTo(StructureBoundingBox p_78888_1_) { + this.minX = Math.min(this.minX, p_78888_1_.minX); + this.minY = Math.min(this.minY, p_78888_1_.minY); + this.minZ = Math.min(this.minZ, p_78888_1_.minZ); + this.maxX = Math.max(this.maxX, p_78888_1_.maxX); + this.maxY = Math.max(this.maxY, p_78888_1_.maxY); + this.maxZ = Math.max(this.maxZ, p_78888_1_.maxZ); + } + + /** + * Offsets the current bounding box by the specified coordinates. Args: x, y, z + */ + public void offset(int p_78886_1_, int p_78886_2_, int p_78886_3_) { + this.minX += p_78886_1_; + this.minY += p_78886_2_; + this.minZ += p_78886_3_; + this.maxX += p_78886_1_; + this.maxY += p_78886_2_; + this.maxZ += p_78886_3_; + } + + /** + * Returns true if block is inside bounding box + */ + public boolean isVecInside(int p_78890_1_, int p_78890_2_, int p_78890_3_) { + return p_78890_1_ >= this.minX && p_78890_1_ <= this.maxX && p_78890_3_ >= this.minZ && p_78890_3_ <= this.maxZ && p_78890_2_ >= this.minY && p_78890_2_ <= this.maxY; + } + + /** + * Returns width of a bounding box + */ + public int getXSize() { + return this.maxX - this.minX + 1; + } + + /** + * Returns height of a bounding box + */ + public int getYSize() { + return this.maxY - this.minY + 1; + } + + /** + * Returns length of a bounding box + */ + public int getZSize() { + return this.maxZ - this.minZ + 1; + } + + public int getCenterX() { + return this.minX + (this.maxX - this.minX + 1) / 2; + } + + public int getCenterY() { + return this.minY + (this.maxY - this.minY + 1) / 2; + } + + public int getCenterZ() { + return this.minZ + (this.maxZ - this.minZ + 1) / 2; + } + + public String toString() { + return "(" + this.minX + ", " + this.minY + ", " + this.minZ + "; " + this.maxX + ", " + this.maxY + ", " + this.maxZ + ")"; + } + + public NBTTagIntArray func_151535_h() { + return new NBTTagIntArray(new int[] {this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ}); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureComponent.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureComponent.java new file mode 100644 index 0000000..c295a44 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureComponent.java @@ -0,0 +1,662 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDoor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.Direction; +import net.minecraft.util.Facing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public abstract class StructureComponent { + protected StructureBoundingBox boundingBox; + + /** switches the Coordinate System base off the Bounding Box */ + protected int coordBaseMode; + + /** The type ID of this component. */ + protected int componentType; + + + public StructureComponent() {} + + protected StructureComponent(int p_i2091_1_) { + this.componentType = p_i2091_1_; + this.coordBaseMode = -1; + } + + public NBTTagCompound func_143010_b() { + NBTTagCompound var1 = new NBTTagCompound(); + var1.setString("id", MapGenStructureIO.func_143036_a(this)); + var1.setTag("BB", this.boundingBox.func_151535_h()); + var1.setInteger("O", this.coordBaseMode); + var1.setInteger("GD", this.componentType); + this.func_143012_a(var1); + return var1; + } + + protected abstract void func_143012_a(NBTTagCompound p_143012_1_); + + public void func_143009_a(World p_143009_1_, NBTTagCompound p_143009_2_) { + if (p_143009_2_.hasKey("BB")) { + this.boundingBox = new StructureBoundingBox(p_143009_2_.getIntArray("BB")); + } + + this.coordBaseMode = p_143009_2_.getInteger("O"); + this.componentType = p_143009_2_.getInteger("GD"); + this.func_143011_b(p_143009_2_); + } + + protected abstract void func_143011_b(NBTTagCompound p_143011_1_); + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) {} + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at + * the end, it adds Fences... + */ + public abstract boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_); + + public StructureBoundingBox getBoundingBox() { + return this.boundingBox; + } + + /** + * Returns the component type ID of this component. + */ + public int getComponentType() { + return this.componentType; + } + + /** + * Discover if bounding box can fit within the current bounding box object. + */ + public static StructureComponent findIntersecting(List p_74883_0_, StructureBoundingBox p_74883_1_) { + Iterator var2 = p_74883_0_.iterator(); + StructureComponent var3; + + do { + if (!var2.hasNext()) { + return null; + } + + var3 = (StructureComponent)var2.next(); + } + while (var3.getBoundingBox() == null || !var3.getBoundingBox().intersectsWith(p_74883_1_)); + + return var3; + } + + public ChunkPosition func_151553_a() { + return new ChunkPosition(this.boundingBox.getCenterX(), this.boundingBox.getCenterY(), this.boundingBox.getCenterZ()); + } + + /** + * checks the entire StructureBoundingBox for Liquids + */ + protected boolean isLiquidInStructureBoundingBox(World p_74860_1_, StructureBoundingBox p_74860_2_) { + int var3 = Math.max(this.boundingBox.minX - 1, p_74860_2_.minX); + int var4 = Math.max(this.boundingBox.minY - 1, p_74860_2_.minY); + int var5 = Math.max(this.boundingBox.minZ - 1, p_74860_2_.minZ); + int var6 = Math.min(this.boundingBox.maxX + 1, p_74860_2_.maxX); + int var7 = Math.min(this.boundingBox.maxY + 1, p_74860_2_.maxY); + int var8 = Math.min(this.boundingBox.maxZ + 1, p_74860_2_.maxZ); + int var9; + int var10; + + for (var9 = var3; var9 <= var6; ++var9) { + for (var10 = var5; var10 <= var8; ++var10) { + if (p_74860_1_.getBlock(var9, var4, var10).getMaterial().isLiquid()) { + return true; + } + + if (p_74860_1_.getBlock(var9, var7, var10).getMaterial().isLiquid()) { + return true; + } + } + } + + for (var9 = var3; var9 <= var6; ++var9) { + for (var10 = var4; var10 <= var7; ++var10) { + if (p_74860_1_.getBlock(var9, var10, var5).getMaterial().isLiquid()) { + return true; + } + + if (p_74860_1_.getBlock(var9, var10, var8).getMaterial().isLiquid()) { + return true; + } + } + } + + for (var9 = var5; var9 <= var8; ++var9) { + for (var10 = var4; var10 <= var7; ++var10) { + if (p_74860_1_.getBlock(var3, var10, var9).getMaterial().isLiquid()) { + return true; + } + + if (p_74860_1_.getBlock(var6, var10, var9).getMaterial().isLiquid()) { + return true; + } + } + } + + return false; + } + + protected int getXWithOffset(int p_74865_1_, int p_74865_2_) { + switch (this.coordBaseMode) { + case 0: + case 2: + return this.boundingBox.minX + p_74865_1_; + + case 1: + return this.boundingBox.maxX - p_74865_2_; + + case 3: + return this.boundingBox.minX + p_74865_2_; + + default: + return p_74865_1_; + } + } + + protected int getYWithOffset(int p_74862_1_) { + return this.coordBaseMode == -1 ? p_74862_1_ : p_74862_1_ + this.boundingBox.minY; + } + + protected int getZWithOffset(int p_74873_1_, int p_74873_2_) { + switch (this.coordBaseMode) { + case 0: + return this.boundingBox.minZ + p_74873_2_; + + case 1: + case 3: + return this.boundingBox.minZ + p_74873_1_; + + case 2: + return this.boundingBox.maxZ - p_74873_2_; + + default: + return p_74873_2_; + } + } + + protected int func_151555_a(Block p_151555_1_, int p_151555_2_) { + if (p_151555_1_ == Blocks.rail) { + if (this.coordBaseMode == 1 || this.coordBaseMode == 3) { + if (p_151555_2_ == 1) { + return 0; + } + + return 1; + } + } else if (p_151555_1_ != Blocks.wooden_door && p_151555_1_ != Blocks.iron_door) { + if (p_151555_1_ != Blocks.stone_stairs && p_151555_1_ != Blocks.oak_stairs && p_151555_1_ != Blocks.nether_brick_stairs && p_151555_1_ != Blocks.stone_brick_stairs && p_151555_1_ != Blocks.sandstone_stairs) { + if (p_151555_1_ == Blocks.ladder) { + if (this.coordBaseMode == 0) { + if (p_151555_2_ == 2) { + return 3; + } + + if (p_151555_2_ == 3) { + return 2; + } + } else if (this.coordBaseMode == 1) { + if (p_151555_2_ == 2) { + return 4; + } + + if (p_151555_2_ == 3) { + return 5; + } + + if (p_151555_2_ == 4) { + return 2; + } + + if (p_151555_2_ == 5) { + return 3; + } + } else if (this.coordBaseMode == 3) { + if (p_151555_2_ == 2) { + return 5; + } + + if (p_151555_2_ == 3) { + return 4; + } + + if (p_151555_2_ == 4) { + return 2; + } + + if (p_151555_2_ == 5) { + return 3; + } + } + } else if (p_151555_1_ == Blocks.stone_button) { + if (this.coordBaseMode == 0) { + if (p_151555_2_ == 3) { + return 4; + } + + if (p_151555_2_ == 4) { + return 3; + } + } else if (this.coordBaseMode == 1) { + if (p_151555_2_ == 3) { + return 1; + } + + if (p_151555_2_ == 4) { + return 2; + } + + if (p_151555_2_ == 2) { + return 3; + } + + if (p_151555_2_ == 1) { + return 4; + } + } else if (this.coordBaseMode == 3) { + if (p_151555_2_ == 3) { + return 2; + } + + if (p_151555_2_ == 4) { + return 1; + } + + if (p_151555_2_ == 2) { + return 3; + } + + if (p_151555_2_ == 1) { + return 4; + } + } + } else if (p_151555_1_ != Blocks.tripwire_hook && !(p_151555_1_ instanceof BlockDirectional)) { + if (p_151555_1_ == Blocks.piston || p_151555_1_ == Blocks.sticky_piston || p_151555_1_ == Blocks.lever || p_151555_1_ == Blocks.dispenser) { + if (this.coordBaseMode == 0) { + if (p_151555_2_ == 2 || p_151555_2_ == 3) { + return Facing.oppositeSide[p_151555_2_]; + } + } else if (this.coordBaseMode == 1) { + if (p_151555_2_ == 2) { + return 4; + } + + if (p_151555_2_ == 3) { + return 5; + } + + if (p_151555_2_ == 4) { + return 2; + } + + if (p_151555_2_ == 5) { + return 3; + } + } else if (this.coordBaseMode == 3) { + if (p_151555_2_ == 2) { + return 5; + } + + if (p_151555_2_ == 3) { + return 4; + } + + if (p_151555_2_ == 4) { + return 2; + } + + if (p_151555_2_ == 5) { + return 3; + } + } + } + } else if (this.coordBaseMode == 0) { + if (p_151555_2_ == 0 || p_151555_2_ == 2) { + return Direction.rotateOpposite[p_151555_2_]; + } + } else if (this.coordBaseMode == 1) { + if (p_151555_2_ == 2) { + return 1; + } + + if (p_151555_2_ == 0) { + return 3; + } + + if (p_151555_2_ == 1) { + return 2; + } + + if (p_151555_2_ == 3) { + return 0; + } + } else if (this.coordBaseMode == 3) { + if (p_151555_2_ == 2) { + return 3; + } + + if (p_151555_2_ == 0) { + return 1; + } + + if (p_151555_2_ == 1) { + return 2; + } + + if (p_151555_2_ == 3) { + return 0; + } + } + } else if (this.coordBaseMode == 0) { + if (p_151555_2_ == 2) { + return 3; + } + + if (p_151555_2_ == 3) { + return 2; + } + } else if (this.coordBaseMode == 1) { + if (p_151555_2_ == 0) { + return 2; + } + + if (p_151555_2_ == 1) { + return 3; + } + + if (p_151555_2_ == 2) { + return 0; + } + + if (p_151555_2_ == 3) { + return 1; + } + } else if (this.coordBaseMode == 3) { + if (p_151555_2_ == 0) { + return 2; + } + + if (p_151555_2_ == 1) { + return 3; + } + + if (p_151555_2_ == 2) { + return 1; + } + + if (p_151555_2_ == 3) { + return 0; + } + } + } else if (this.coordBaseMode == 0) { + if (p_151555_2_ == 0) { + return 2; + } + + if (p_151555_2_ == 2) { + return 0; + } + } else { + if (this.coordBaseMode == 1) { + return p_151555_2_ + 1 & 3; + } + + if (this.coordBaseMode == 3) { + return p_151555_2_ + 3 & 3; + } + } + + return p_151555_2_; + } + + protected void func_151550_a(World p_151550_1_, Block p_151550_2_, int p_151550_3_, int p_151550_4_, int p_151550_5_, int p_151550_6_, StructureBoundingBox p_151550_7_) { + int var8 = this.getXWithOffset(p_151550_4_, p_151550_6_); + int var9 = this.getYWithOffset(p_151550_5_); + int var10 = this.getZWithOffset(p_151550_4_, p_151550_6_); + + if (p_151550_7_.isVecInside(var8, var9, var10)) { + p_151550_1_.setBlock(var8, var9, var10, p_151550_2_, p_151550_3_, 2); + } + } + + protected Block func_151548_a(World p_151548_1_, int p_151548_2_, int p_151548_3_, int p_151548_4_, StructureBoundingBox p_151548_5_) { + int var6 = this.getXWithOffset(p_151548_2_, p_151548_4_); + int var7 = this.getYWithOffset(p_151548_3_); + int var8 = this.getZWithOffset(p_151548_2_, p_151548_4_); + return !p_151548_5_.isVecInside(var6, var7, var8) ? Blocks.air : p_151548_1_.getBlock(var6, var7, var8); + } + + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int + * maxZ) + */ + protected void fillWithAir(World p_74878_1_, StructureBoundingBox p_74878_2_, int p_74878_3_, int p_74878_4_, int p_74878_5_, int p_74878_6_, int p_74878_7_, int p_74878_8_) { + for (int var9 = p_74878_4_; var9 <= p_74878_7_; ++var9) { + for (int var10 = p_74878_3_; var10 <= p_74878_6_; ++var10) { + for (int var11 = p_74878_5_; var11 <= p_74878_8_; ++var11) { + this.func_151550_a(p_74878_1_, Blocks.air, 0, var10, var9, var11, p_74878_2_); + } + } + } + } + + protected void func_151549_a(World p_151549_1_, StructureBoundingBox p_151549_2_, int p_151549_3_, int p_151549_4_, int p_151549_5_, int p_151549_6_, int p_151549_7_, int p_151549_8_, Block p_151549_9_, Block p_151549_10_, boolean p_151549_11_) { + for (int var12 = p_151549_4_; var12 <= p_151549_7_; ++var12) { + for (int var13 = p_151549_3_; var13 <= p_151549_6_; ++var13) { + for (int var14 = p_151549_5_; var14 <= p_151549_8_; ++var14) { + if (!p_151549_11_ || this.func_151548_a(p_151549_1_, var13, var12, var14, p_151549_2_).getMaterial() != Material.air) { + if (var12 != p_151549_4_ && var12 != p_151549_7_ && var13 != p_151549_3_ && var13 != p_151549_6_ && var14 != p_151549_5_ && var14 != p_151549_8_) { + this.func_151550_a(p_151549_1_, p_151549_10_, 0, var13, var12, var14, p_151549_2_); + } else { + this.func_151550_a(p_151549_1_, p_151549_9_, 0, var13, var12, var14, p_151549_2_); + } + } + } + } + } + } + + protected void func_151556_a(World p_151556_1_, StructureBoundingBox p_151556_2_, int p_151556_3_, int p_151556_4_, int p_151556_5_, int p_151556_6_, int p_151556_7_, int p_151556_8_, Block p_151556_9_, int p_151556_10_, Block p_151556_11_, int p_151556_12_, boolean p_151556_13_) { + for (int var14 = p_151556_4_; var14 <= p_151556_7_; ++var14) { + for (int var15 = p_151556_3_; var15 <= p_151556_6_; ++var15) { + for (int var16 = p_151556_5_; var16 <= p_151556_8_; ++var16) { + if (!p_151556_13_ || this.func_151548_a(p_151556_1_, var15, var14, var16, p_151556_2_).getMaterial() != Material.air) { + if (var14 != p_151556_4_ && var14 != p_151556_7_ && var15 != p_151556_3_ && var15 != p_151556_6_ && var16 != p_151556_5_ && var16 != p_151556_8_) { + this.func_151550_a(p_151556_1_, p_151556_11_, p_151556_12_, var15, var14, var16, p_151556_2_); + } else { + this.func_151550_a(p_151556_1_, p_151556_9_, p_151556_10_, var15, var14, var16, p_151556_2_); + } + } + } + } + } + } + + /** + * arguments: World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int + * maxZ, boolean alwaysreplace, Random rand, StructurePieceBlockSelector blockselector + */ + protected void fillWithRandomizedBlocks(World p_74882_1_, StructureBoundingBox p_74882_2_, int p_74882_3_, int p_74882_4_, int p_74882_5_, int p_74882_6_, int p_74882_7_, int p_74882_8_, boolean p_74882_9_, Random p_74882_10_, StructureComponent.BlockSelector p_74882_11_) { + for (int var12 = p_74882_4_; var12 <= p_74882_7_; ++var12) { + for (int var13 = p_74882_3_; var13 <= p_74882_6_; ++var13) { + for (int var14 = p_74882_5_; var14 <= p_74882_8_; ++var14) { + if (!p_74882_9_ || this.func_151548_a(p_74882_1_, var13, var12, var14, p_74882_2_).getMaterial() != Material.air) { + p_74882_11_.selectBlocks(p_74882_10_, var13, var12, var14, var12 == p_74882_4_ || var12 == p_74882_7_ || var13 == p_74882_3_ || var13 == p_74882_6_ || var14 == p_74882_5_ || var14 == p_74882_8_); + this.func_151550_a(p_74882_1_, p_74882_11_.func_151561_a(), p_74882_11_.getSelectedBlockMetaData(), var13, var12, var14, p_74882_2_); + } + } + } + } + } + + protected void func_151551_a(World p_151551_1_, StructureBoundingBox p_151551_2_, Random p_151551_3_, float p_151551_4_, int p_151551_5_, int p_151551_6_, int p_151551_7_, int p_151551_8_, int p_151551_9_, int p_151551_10_, Block p_151551_11_, Block p_151551_12_, boolean p_151551_13_) { + for (int var14 = p_151551_6_; var14 <= p_151551_9_; ++var14) { + for (int var15 = p_151551_5_; var15 <= p_151551_8_; ++var15) { + for (int var16 = p_151551_7_; var16 <= p_151551_10_; ++var16) { + if (p_151551_3_.nextFloat() <= p_151551_4_ && (!p_151551_13_ || this.func_151548_a(p_151551_1_, var15, var14, var16, p_151551_2_).getMaterial() != Material.air)) { + if (var14 != p_151551_6_ && var14 != p_151551_9_ && var15 != p_151551_5_ && var15 != p_151551_8_ && var16 != p_151551_7_ && var16 != p_151551_10_) { + this.func_151550_a(p_151551_1_, p_151551_12_, 0, var15, var14, var16, p_151551_2_); + } else { + this.func_151550_a(p_151551_1_, p_151551_11_, 0, var15, var14, var16, p_151551_2_); + } + } + } + } + } + } + + protected void func_151552_a(World p_151552_1_, StructureBoundingBox p_151552_2_, Random p_151552_3_, float p_151552_4_, int p_151552_5_, int p_151552_6_, int p_151552_7_, Block p_151552_8_, int p_151552_9_) { + if (p_151552_3_.nextFloat() < p_151552_4_) { + this.func_151550_a(p_151552_1_, p_151552_8_, p_151552_9_, p_151552_5_, p_151552_6_, p_151552_7_, p_151552_2_); + } + } + + protected void func_151547_a(World p_151547_1_, StructureBoundingBox p_151547_2_, int p_151547_3_, int p_151547_4_, int p_151547_5_, int p_151547_6_, int p_151547_7_, int p_151547_8_, Block p_151547_9_, boolean p_151547_10_) { + float var11 = (float)(p_151547_6_ - p_151547_3_ + 1); + float var12 = (float)(p_151547_7_ - p_151547_4_ + 1); + float var13 = (float)(p_151547_8_ - p_151547_5_ + 1); + float var14 = (float)p_151547_3_ + var11 / 2.0F; + float var15 = (float)p_151547_5_ + var13 / 2.0F; + + for (int var16 = p_151547_4_; var16 <= p_151547_7_; ++var16) { + float var17 = (float)(var16 - p_151547_4_) / var12; + + for (int var18 = p_151547_3_; var18 <= p_151547_6_; ++var18) { + float var19 = ((float)var18 - var14) / (var11 * 0.5F); + + for (int var20 = p_151547_5_; var20 <= p_151547_8_; ++var20) { + float var21 = ((float)var20 - var15) / (var13 * 0.5F); + + if (!p_151547_10_ || this.func_151548_a(p_151547_1_, var18, var16, var20, p_151547_2_).getMaterial() != Material.air) { + float var22 = var19 * var19 + var17 * var17 + var21 * var21; + + if (var22 <= 1.05F) { + this.func_151550_a(p_151547_1_, p_151547_9_, 0, var18, var16, var20, p_151547_2_); + } + } + } + } + } + } + + /** + * Deletes all continuous blocks from selected position upwards. Stops at hitting air. + */ + protected void clearCurrentPositionBlocksUpwards(World p_74871_1_, int p_74871_2_, int p_74871_3_, int p_74871_4_, StructureBoundingBox p_74871_5_) { + int var6 = this.getXWithOffset(p_74871_2_, p_74871_4_); + int var7 = this.getYWithOffset(p_74871_3_); + int var8 = this.getZWithOffset(p_74871_2_, p_74871_4_); + + if (p_74871_5_.isVecInside(var6, var7, var8)) { + while (!p_74871_1_.isAirBlock(var6, var7, var8) && var7 < 255) { + p_74871_1_.setBlock(var6, var7, var8, Blocks.air, 0, 2); + ++var7; + } + } + } + + protected void func_151554_b(World p_151554_1_, Block p_151554_2_, int p_151554_3_, int p_151554_4_, int p_151554_5_, int p_151554_6_, StructureBoundingBox p_151554_7_) { + int var8 = this.getXWithOffset(p_151554_4_, p_151554_6_); + int var9 = this.getYWithOffset(p_151554_5_); + int var10 = this.getZWithOffset(p_151554_4_, p_151554_6_); + + if (p_151554_7_.isVecInside(var8, var9, var10)) { + while ((p_151554_1_.isAirBlock(var8, var9, var10) || p_151554_1_.getBlock(var8, var9, var10).getMaterial().isLiquid()) && var9 > 1) { + p_151554_1_.setBlock(var8, var9, var10, p_151554_2_, p_151554_3_, 2); + --var9; + } + } + } + + /** + * Used to generate chests with items in it. ex: Temple Chests, Village Blacksmith Chests, Mineshaft Chests. + */ + protected boolean generateStructureChestContents(World p_74879_1_, StructureBoundingBox p_74879_2_, Random p_74879_3_, int p_74879_4_, int p_74879_5_, int p_74879_6_, WeightedRandomChestContent[] p_74879_7_, int p_74879_8_) { + int var9 = this.getXWithOffset(p_74879_4_, p_74879_6_); + int var10 = this.getYWithOffset(p_74879_5_); + int var11 = this.getZWithOffset(p_74879_4_, p_74879_6_); + + if (p_74879_2_.isVecInside(var9, var10, var11) && p_74879_1_.getBlock(var9, var10, var11) != Blocks.chest) { + p_74879_1_.setBlock(var9, var10, var11, Blocks.chest, 0, 2); + TileEntityChest var12 = (TileEntityChest)p_74879_1_.getTileEntity(var9, var10, var11); + + if (var12 != null) { + WeightedRandomChestContent.generateChestContents(p_74879_3_, p_74879_7_, var12, p_74879_8_); + } + + return true; + } else { + return false; + } + } + + /** + * Used to generate dispenser contents for structures. ex: Jungle Temples. + */ + protected boolean generateStructureDispenserContents(World p_74869_1_, StructureBoundingBox p_74869_2_, Random p_74869_3_, int p_74869_4_, int p_74869_5_, int p_74869_6_, int p_74869_7_, WeightedRandomChestContent[] p_74869_8_, int p_74869_9_) { + int var10 = this.getXWithOffset(p_74869_4_, p_74869_6_); + int var11 = this.getYWithOffset(p_74869_5_); + int var12 = this.getZWithOffset(p_74869_4_, p_74869_6_); + + if (p_74869_2_.isVecInside(var10, var11, var12) && p_74869_1_.getBlock(var10, var11, var12) != Blocks.dispenser) { + p_74869_1_.setBlock(var10, var11, var12, Blocks.dispenser, this.func_151555_a(Blocks.dispenser, p_74869_7_), 2); + TileEntityDispenser var13 = (TileEntityDispenser)p_74869_1_.getTileEntity(var10, var11, var12); + + if (var13 != null) { + WeightedRandomChestContent.func_150706_a(p_74869_3_, p_74869_8_, var13, p_74869_9_); + } + + return true; + } else { + return false; + } + } + + protected void placeDoorAtCurrentPosition(World p_74881_1_, StructureBoundingBox p_74881_2_, Random p_74881_3_, int p_74881_4_, int p_74881_5_, int p_74881_6_, int p_74881_7_) { + int var8 = this.getXWithOffset(p_74881_4_, p_74881_6_); + int var9 = this.getYWithOffset(p_74881_5_); + int var10 = this.getZWithOffset(p_74881_4_, p_74881_6_); + + if (p_74881_2_.isVecInside(var8, var9, var10)) { + ItemDoor.func_150924_a(p_74881_1_, var8, var9, var10, p_74881_7_, Blocks.wooden_door); + } + } + + public abstract static class BlockSelector { + protected Block field_151562_a; + protected int selectedBlockMetaData; + + + protected BlockSelector() { + this.field_151562_a = Blocks.air; + } + + public abstract void selectBlocks(Random p_75062_1_, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_); + + public Block func_151561_a() { + return this.field_151562_a; + } + + public int getSelectedBlockMetaData() { + return this.selectedBlockMetaData; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java new file mode 100644 index 0000000..531f750 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java @@ -0,0 +1,676 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class StructureMineshaftPieces { + /** List of contents that can generate in Mineshafts. */ + private static final WeightedRandomChestContent[] mineshaftChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.dye, 4, 4, 9, 5), new WeightedRandomChestContent(Items.diamond, 0, 1, 2, 3), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.rail), 0, 4, 8, 1), new WeightedRandomChestContent(Items.melon_seeds, 0, 2, 4, 10), new WeightedRandomChestContent(Items.pumpkin_seeds, 0, 2, 4, 10), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1)}; + + + public static void func_143048_a() { + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Corridor.class, "MSCorridor"); + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Cross.class, "MSCrossing"); + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Room.class, "MSRoom"); + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Stairs.class, "MSStairs"); + } + + private static StructureComponent getRandomComponent(List p_78815_0_, Random p_78815_1_, int p_78815_2_, int p_78815_3_, int p_78815_4_, int p_78815_5_, int p_78815_6_) { + int var7 = p_78815_1_.nextInt(100); + StructureBoundingBox var8; + + if (var7 >= 80) { + var8 = StructureMineshaftPieces.Cross.findValidPlacement(p_78815_0_, p_78815_1_, p_78815_2_, p_78815_3_, p_78815_4_, p_78815_5_); + + if (var8 != null) { + return new StructureMineshaftPieces.Cross(p_78815_6_, p_78815_1_, var8, p_78815_5_); + } + } else if (var7 >= 70) { + var8 = StructureMineshaftPieces.Stairs.findValidPlacement(p_78815_0_, p_78815_1_, p_78815_2_, p_78815_3_, p_78815_4_, p_78815_5_); + + if (var8 != null) { + return new StructureMineshaftPieces.Stairs(p_78815_6_, p_78815_1_, var8, p_78815_5_); + } + } else { + var8 = StructureMineshaftPieces.Corridor.findValidPlacement(p_78815_0_, p_78815_1_, p_78815_2_, p_78815_3_, p_78815_4_, p_78815_5_); + + if (var8 != null) { + return new StructureMineshaftPieces.Corridor(p_78815_6_, p_78815_1_, var8, p_78815_5_); + } + } + + return null; + } + + private static StructureComponent getNextMineShaftComponent(StructureComponent p_78817_0_, List p_78817_1_, Random p_78817_2_, int p_78817_3_, int p_78817_4_, int p_78817_5_, int p_78817_6_, int p_78817_7_) { + if (p_78817_7_ > 8) { + return null; + } else if (Math.abs(p_78817_3_ - p_78817_0_.getBoundingBox().minX) <= 80 && Math.abs(p_78817_5_ - p_78817_0_.getBoundingBox().minZ) <= 80) { + StructureComponent var8 = getRandomComponent(p_78817_1_, p_78817_2_, p_78817_3_, p_78817_4_, p_78817_5_, p_78817_6_, p_78817_7_ + 1); + + if (var8 != null) { + p_78817_1_.add(var8); + var8.buildComponent(p_78817_0_, p_78817_1_, p_78817_2_); + } + + return var8; + } else { + return null; + } + } + + public static class Corridor extends StructureComponent { + private boolean hasRails; + private boolean hasSpiders; + private boolean spawnerPlaced; + private int sectionCount; + + + public Corridor() {} + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + p_143012_1_.setBoolean("hr", this.hasRails); + p_143012_1_.setBoolean("sc", this.hasSpiders); + p_143012_1_.setBoolean("hps", this.spawnerPlaced); + p_143012_1_.setInteger("Num", this.sectionCount); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + this.hasRails = p_143011_1_.getBoolean("hr"); + this.hasSpiders = p_143011_1_.getBoolean("sc"); + this.spawnerPlaced = p_143011_1_.getBoolean("hps"); + this.sectionCount = p_143011_1_.getInteger("Num"); + } + + public Corridor(int p_i2035_1_, Random p_i2035_2_, StructureBoundingBox p_i2035_3_, int p_i2035_4_) { + super(p_i2035_1_); + this.coordBaseMode = p_i2035_4_; + this.boundingBox = p_i2035_3_; + this.hasRails = p_i2035_2_.nextInt(3) == 0; + this.hasSpiders = !this.hasRails && p_i2035_2_.nextInt(23) == 0; + + if (this.coordBaseMode != 2 && this.coordBaseMode != 0) { + this.sectionCount = p_i2035_3_.getXSize() / 5; + } else { + this.sectionCount = p_i2035_3_.getZSize() / 5; + } + } + + public static StructureBoundingBox findValidPlacement(List p_74954_0_, Random p_74954_1_, int p_74954_2_, int p_74954_3_, int p_74954_4_, int p_74954_5_) { + StructureBoundingBox var6 = new StructureBoundingBox(p_74954_2_, p_74954_3_, p_74954_4_, p_74954_2_, p_74954_3_ + 2, p_74954_4_); + int var7; + + for (var7 = p_74954_1_.nextInt(3) + 2; var7 > 0; --var7) { + int var8 = var7 * 5; + + switch (p_74954_5_) { + case 0: + var6.maxX = p_74954_2_ + 2; + var6.maxZ = p_74954_4_ + (var8 - 1); + break; + + case 1: + var6.minX = p_74954_2_ - (var8 - 1); + var6.maxZ = p_74954_4_ + 2; + break; + + case 2: + var6.maxX = p_74954_2_ + 2; + var6.minZ = p_74954_4_ - (var8 - 1); + break; + + case 3: + var6.maxX = p_74954_2_ + (var8 - 1); + var6.maxZ = p_74954_4_ + 2; + } + + if (StructureComponent.findIntersecting(p_74954_0_, var6) == null) { + break; + } + } + + return var7 > 0 ? var6 : null; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + int var4 = this.getComponentType(); + int var5 = p_74861_3_.nextInt(4); + + switch (this.coordBaseMode) { + case 0: + if (var5 <= 1) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ + 1, this.coordBaseMode, var4); + } else if (var5 == 2) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ - 3, 1, var4); + } else { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ - 3, 3, var4); + } + + break; + + case 1: + if (var5 <= 1) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); + } else if (var5 == 2) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ - 1, 2, var4); + } else { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); + } + + break; + + case 2: + if (var5 <= 1) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ - 1, this.coordBaseMode, var4); + } else if (var5 == 2) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, 1, var4); + } else { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, 3, var4); + } + + break; + + case 3: + if (var5 <= 1) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); + } else if (var5 == 2) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ - 1, 2, var4); + } else { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); + } + } + + if (var4 < 8) { + int var6; + int var7; + + if (this.coordBaseMode != 2 && this.coordBaseMode != 0) { + for (var6 = this.boundingBox.minX + 3; var6 + 3 <= this.boundingBox.maxX; var6 += 5) { + var7 = p_74861_3_.nextInt(5); + + if (var7 == 0) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, var6, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4 + 1); + } else if (var7 == 1) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, var6, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4 + 1); + } + } + } else { + for (var6 = this.boundingBox.minZ + 3; var6 + 3 <= this.boundingBox.maxZ; var6 += 5) { + var7 = p_74861_3_.nextInt(5); + + if (var7 == 0) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, var6, 1, var4 + 1); + } else if (var7 == 1) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, var6, 3, var4 + 1); + } + } + } + } + } + + protected boolean generateStructureChestContents(World p_74879_1_, StructureBoundingBox p_74879_2_, Random p_74879_3_, int p_74879_4_, int p_74879_5_, int p_74879_6_, WeightedRandomChestContent[] p_74879_7_, int p_74879_8_) { + int var9 = this.getXWithOffset(p_74879_4_, p_74879_6_); + int var10 = this.getYWithOffset(p_74879_5_); + int var11 = this.getZWithOffset(p_74879_4_, p_74879_6_); + + if (p_74879_2_.isVecInside(var9, var10, var11) && p_74879_1_.getBlock(var9, var10, var11).getMaterial() == Material.air) { + int var12 = p_74879_3_.nextBoolean() ? 1 : 0; + p_74879_1_.setBlock(var9, var10, var11, Blocks.rail, this.func_151555_a(Blocks.rail, var12), 2); + EntityMinecartChest var13 = new EntityMinecartChest(p_74879_1_, (float)var9 + 0.5F, (float)var10 + 0.5F, (float)var11 + 0.5F); + WeightedRandomChestContent.generateChestContents(p_74879_3_, p_74879_7_, var13, p_74879_8_); + p_74879_1_.spawnEntityInWorld(var13); + return true; + } else { + return false; + } + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + boolean var4 = false; + boolean var5 = true; + boolean var6 = false; + boolean var7 = true; + int var8 = this.sectionCount * 5 - 1; + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 2, 1, var8, Blocks.air, Blocks.air, false); + this.func_151551_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.8F, 0, 2, 0, 2, 2, var8, Blocks.air, Blocks.air, false); + + if (this.hasSpiders) { + this.func_151551_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.6F, 0, 0, 0, 2, 1, var8, Blocks.web, Blocks.air, false); + } + + int var9; + int var10; + + for (var9 = 0; var9 < this.sectionCount; ++var9) { + var10 = 2 + var9 * 5; + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, var10, 0, 1, var10, Blocks.fence, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 0, var10, 2, 1, var10, Blocks.fence, Blocks.air, false); + + if (p_74875_2_.nextInt(4) == 0) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, var10, 0, 2, var10, Blocks.planks, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 2, var10, 2, 2, var10, Blocks.planks, Blocks.air, false); + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, var10, 2, 2, var10, Blocks.planks, Blocks.air, false); + } + + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, var10 - 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, var10 - 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, var10 + 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, var10 + 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, var10 - 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, var10 - 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, var10 + 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, var10 + 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, var10 - 1, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, var10 + 1, Blocks.torch, 0); + + if (p_74875_2_.nextInt(100) == 0) { + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, var10 - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.mineshaftChestContents, Items.enchanted_book.func_92114_b(p_74875_2_)), 3 + p_74875_2_.nextInt(4)); + } + + if (p_74875_2_.nextInt(100) == 0) { + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, var10 + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.mineshaftChestContents, Items.enchanted_book.func_92114_b(p_74875_2_)), 3 + p_74875_2_.nextInt(4)); + } + + if (this.hasSpiders && !this.spawnerPlaced) { + int var11 = this.getYWithOffset(0); + int var12 = var10 - 1 + p_74875_2_.nextInt(3); + int var13 = this.getXWithOffset(1, var12); + var12 = this.getZWithOffset(1, var12); + + if (p_74875_3_.isVecInside(var13, var11, var12)) { + this.spawnerPlaced = true; + p_74875_1_.setBlock(var13, var11, var12, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner var14 = (TileEntityMobSpawner)p_74875_1_.getTileEntity(var13, var11, var12); + + if (var14 != null) { + var14.func_145881_a().setMobID("CaveSpider"); + } + } + } + } + + for (var9 = 0; var9 <= 2; ++var9) { + for (var10 = 0; var10 <= var8; ++var10) { + byte var16 = -1; + Block var17 = this.func_151548_a(p_74875_1_, var9, var16, var10, p_74875_3_); + + if (var17.getMaterial() == Material.air) { + byte var18 = -1; + this.func_151550_a(p_74875_1_, Blocks.planks, 0, var9, var18, var10, p_74875_3_); + } + } + } + + if (this.hasRails) { + for (var9 = 0; var9 <= var8; ++var9) { + Block var15 = this.func_151548_a(p_74875_1_, 1, -1, var9, p_74875_3_); + + if (var15.getMaterial() != Material.air && var15.func_149730_j()) { + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.7F, 1, 0, var9, Blocks.rail, this.func_151555_a(Blocks.rail, 0)); + } + } + } + + return true; + } + } + } + + public static class Cross extends StructureComponent { + private int corridorDirection; + private boolean isMultipleFloors; + + + public Cross() {} + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + p_143012_1_.setBoolean("tf", this.isMultipleFloors); + p_143012_1_.setInteger("D", this.corridorDirection); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + this.isMultipleFloors = p_143011_1_.getBoolean("tf"); + this.corridorDirection = p_143011_1_.getInteger("D"); + } + + public Cross(int p_i2036_1_, Random p_i2036_2_, StructureBoundingBox p_i2036_3_, int p_i2036_4_) { + super(p_i2036_1_); + this.corridorDirection = p_i2036_4_; + this.boundingBox = p_i2036_3_; + this.isMultipleFloors = p_i2036_3_.getYSize() > 3; + } + + public static StructureBoundingBox findValidPlacement(List p_74951_0_, Random p_74951_1_, int p_74951_2_, int p_74951_3_, int p_74951_4_, int p_74951_5_) { + StructureBoundingBox var6 = new StructureBoundingBox(p_74951_2_, p_74951_3_, p_74951_4_, p_74951_2_, p_74951_3_ + 2, p_74951_4_); + + if (p_74951_1_.nextInt(4) == 0) { + var6.maxY += 4; + } + + switch (p_74951_5_) { + case 0: + var6.minX = p_74951_2_ - 1; + var6.maxX = p_74951_2_ + 3; + var6.maxZ = p_74951_4_ + 4; + break; + + case 1: + var6.minX = p_74951_2_ - 4; + var6.minZ = p_74951_4_ - 1; + var6.maxZ = p_74951_4_ + 3; + break; + + case 2: + var6.minX = p_74951_2_ - 1; + var6.maxX = p_74951_2_ + 3; + var6.minZ = p_74951_4_ - 4; + break; + + case 3: + var6.maxX = p_74951_2_ + 4; + var6.minZ = p_74951_4_ - 1; + var6.maxZ = p_74951_4_ + 3; + } + + return StructureComponent.findIntersecting(p_74951_0_, var6) != null ? null : var6; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + int var4 = this.getComponentType(); + + switch (this.corridorDirection) { + case 0: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); + break; + + case 1: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); + break; + + case 2: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); + break; + + case 3: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); + } + + if (this.isMultipleFloors) { + if (p_74861_3_.nextBoolean()) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, 2, var4); + } + + if (p_74861_3_.nextBoolean()) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 1, var4); + } + + if (p_74861_3_.nextBoolean()) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 3, var4); + } + + if (p_74861_3_.nextBoolean()) { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, 0, var4); + } + } + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + if (this.isMultipleFloors) { + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.maxY - 2, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Blocks.planks, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.planks, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Blocks.planks, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.planks, Blocks.air, false); + + for (int var4 = this.boundingBox.minX; var4 <= this.boundingBox.maxX; ++var4) { + for (int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { + if (this.func_151548_a(p_74875_1_, var4, this.boundingBox.minY - 1, var5, p_74875_3_).getMaterial() == Material.air) { + this.func_151550_a(p_74875_1_, Blocks.planks, 0, var4, this.boundingBox.minY - 1, var5, p_74875_3_); + } + } + } + + return true; + } + } + } + + public static class Room extends StructureComponent { + private final List roomsLinkedToTheRoom = new LinkedList(); + + + public Room() {} + + public Room(int p_i2037_1_, Random p_i2037_2_, int p_i2037_3_, int p_i2037_4_) { + super(p_i2037_1_); + this.boundingBox = new StructureBoundingBox(p_i2037_3_, 50, p_i2037_4_, p_i2037_3_ + 7 + p_i2037_2_.nextInt(6), 54 + p_i2037_2_.nextInt(6), p_i2037_4_ + 7 + p_i2037_2_.nextInt(6)); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + int var4 = this.getComponentType(); + int var6 = this.boundingBox.getYSize() - 3 - 1; + + if (var6 <= 0) { + var6 = 1; + } + + int var5; + StructureComponent var7; + StructureBoundingBox var8; + + for (var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { + var5 += p_74861_3_.nextInt(this.boundingBox.getXSize()); + + if (var5 + 3 > this.boundingBox.getXSize()) { + break; + } + + var7 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + var5, this.boundingBox.minY + p_74861_3_.nextInt(var6) + 1, this.boundingBox.minZ - 1, 2, var4); + + if (var7 != null) { + var8 = var7.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.minZ, var8.maxX, var8.maxY, this.boundingBox.minZ + 1)); + } + } + + for (var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { + var5 += p_74861_3_.nextInt(this.boundingBox.getXSize()); + + if (var5 + 3 > this.boundingBox.getXSize()) { + break; + } + + var7 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + var5, this.boundingBox.minY + p_74861_3_.nextInt(var6) + 1, this.boundingBox.maxZ + 1, 0, var4); + + if (var7 != null) { + var8 = var7.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.maxZ - 1, var8.maxX, var8.maxY, this.boundingBox.maxZ)); + } + } + + for (var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { + var5 += p_74861_3_.nextInt(this.boundingBox.getZSize()); + + if (var5 + 3 > this.boundingBox.getZSize()) { + break; + } + + var7 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74861_3_.nextInt(var6) + 1, this.boundingBox.minZ + var5, 1, var4); + + if (var7 != null) { + var8 = var7.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.minX, var8.minY, var8.minZ, this.boundingBox.minX + 1, var8.maxY, var8.maxZ)); + } + } + + for (var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { + var5 += p_74861_3_.nextInt(this.boundingBox.getZSize()); + + if (var5 + 3 > this.boundingBox.getZSize()) { + break; + } + + var7 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74861_3_.nextInt(var6) + 1, this.boundingBox.minZ + var5, 3, var4); + + if (var7 != null) { + var8 = var7.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.maxX - 1, var8.minY, var8.minZ, this.boundingBox.maxX, var8.maxY, var8.maxZ)); + } + } + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, Blocks.dirt, Blocks.air, true); + this.func_151549_a(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY + 1, this.boundingBox.minZ, this.boundingBox.maxX, Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + Iterator var4 = this.roomsLinkedToTheRoom.iterator(); + + while (var4.hasNext()) { + StructureBoundingBox var5 = (StructureBoundingBox)var4.next(); + this.func_151549_a(p_74875_1_, p_74875_3_, var5.minX, var5.maxY - 2, var5.minZ, var5.maxX, var5.maxY, var5.maxZ, Blocks.air, Blocks.air, false); + } + + this.func_151547_a(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air, false); + return true; + } + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + NBTTagList var2 = new NBTTagList(); + Iterator var3 = this.roomsLinkedToTheRoom.iterator(); + + while (var3.hasNext()) { + StructureBoundingBox var4 = (StructureBoundingBox)var3.next(); + var2.appendTag(var4.func_151535_h()); + } + + p_143012_1_.setTag("Entrances", var2); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + NBTTagList var2 = p_143011_1_.getTagList("Entrances", 11); + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(var2.func_150306_c(var3))); + } + } + } + + public static class Stairs extends StructureComponent { + + + public Stairs() {} + + public Stairs(int p_i2038_1_, Random p_i2038_2_, StructureBoundingBox p_i2038_3_, int p_i2038_4_) { + super(p_i2038_1_); + this.coordBaseMode = p_i2038_4_; + this.boundingBox = p_i2038_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) {} + + protected void func_143011_b(NBTTagCompound p_143011_1_) {} + + public static StructureBoundingBox findValidPlacement(List p_74950_0_, Random p_74950_1_, int p_74950_2_, int p_74950_3_, int p_74950_4_, int p_74950_5_) { + StructureBoundingBox var6 = new StructureBoundingBox(p_74950_2_, p_74950_3_ - 5, p_74950_4_, p_74950_2_, p_74950_3_ + 2, p_74950_4_); + + switch (p_74950_5_) { + case 0: + var6.maxX = p_74950_2_ + 2; + var6.maxZ = p_74950_4_ + 8; + break; + + case 1: + var6.minX = p_74950_2_ - 8; + var6.maxZ = p_74950_4_ + 2; + break; + + case 2: + var6.maxX = p_74950_2_ + 2; + var6.minZ = p_74950_4_ - 8; + break; + + case 3: + var6.maxX = p_74950_2_ + 8; + var6.maxZ = p_74950_4_ + 2; + } + + return StructureComponent.findIntersecting(p_74950_0_, var6) != null ? null : var6; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + int var4 = this.getComponentType(); + + switch (this.coordBaseMode) { + case 0: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); + break; + + case 1: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, var4); + break; + + case 2: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); + break; + + case 3: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, var4); + } + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 2, 7, 1, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 7, 2, 2, 8, Blocks.air, Blocks.air, false); + + for (int var4 = 0; var4 < 5; ++var4) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5 - var4 - (var4 < 4 ? 1 : 0), 2 + var4, 2, 7 - var4, 2 + var4, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java new file mode 100644 index 0000000..91e3684 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java @@ -0,0 +1,19 @@ +package net.minecraft.world.gen.structure; + +import java.util.Random; +import net.minecraft.world.World; + +public class StructureMineshaftStart extends StructureStart { + + + public StructureMineshaftStart() {} + + public StructureMineshaftStart(World p_i2039_1_, Random p_i2039_2_, int p_i2039_3_, int p_i2039_4_) { + super(p_i2039_3_, p_i2039_4_); + StructureMineshaftPieces.Room var5 = new StructureMineshaftPieces.Room(0, p_i2039_2_, (p_i2039_3_ << 4) + 2, (p_i2039_4_ << 4) + 2); + this.components.add(var5); + var5.buildComponent(var5, this.components, p_i2039_2_); + this.updateBoundingBox(); + this.markAvailableHeight(p_i2039_1_, p_i2039_2_, 10); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java new file mode 100644 index 0000000..09ba727 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java @@ -0,0 +1,1228 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class StructureNetherBridgePieces { + private static final StructureNetherBridgePieces.PieceWeight[] primaryComponents = new StructureNetherBridgePieces.PieceWeight[] {new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Straight.class, 30, 0, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing3.class, 10, 4), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing.class, 10, 4), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Stairs.class, 10, 3), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Throne.class, 5, 2), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Entrance.class, 5, 1)}; + private static final StructureNetherBridgePieces.PieceWeight[] secondaryComponents = new StructureNetherBridgePieces.PieceWeight[] {new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor5.class, 25, 0, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing2.class, 15, 5), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor2.class, 5, 10), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor.class, 5, 10), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor3.class, 10, 3, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor4.class, 7, 2), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.NetherStalkRoom.class, 5, 2)}; + + + public static void func_143049_a() { + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Crossing3.class, "NeBCr"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.End.class, "NeBEF"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Straight.class, "NeBS"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor3.class, "NeCCS"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor4.class, "NeCTB"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Entrance.class, "NeCE"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Crossing2.class, "NeSCSC"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor.class, "NeSCLT"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor5.class, "NeSC"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor2.class, "NeSCRT"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.NetherStalkRoom.class, "NeCSR"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Throne.class, "NeMT"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Crossing.class, "NeRC"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Stairs.class, "NeSR"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Start.class, "NeStart"); + } + + private static StructureNetherBridgePieces.Piece createNextComponentRandom(StructureNetherBridgePieces.PieceWeight p_78738_0_, List p_78738_1_, Random p_78738_2_, int p_78738_3_, int p_78738_4_, int p_78738_5_, int p_78738_6_, int p_78738_7_) { + Class var8 = p_78738_0_.weightClass; + Object var9 = null; + + if (var8 == StructureNetherBridgePieces.Straight.class) { + var9 = StructureNetherBridgePieces.Straight.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Crossing3.class) { + var9 = StructureNetherBridgePieces.Crossing3.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Crossing.class) { + var9 = StructureNetherBridgePieces.Crossing.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Stairs.class) { + var9 = StructureNetherBridgePieces.Stairs.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Throne.class) { + var9 = StructureNetherBridgePieces.Throne.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Entrance.class) { + var9 = StructureNetherBridgePieces.Entrance.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Corridor5.class) { + var9 = StructureNetherBridgePieces.Corridor5.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Corridor2.class) { + var9 = StructureNetherBridgePieces.Corridor2.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Corridor.class) { + var9 = StructureNetherBridgePieces.Corridor.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Corridor3.class) { + var9 = StructureNetherBridgePieces.Corridor3.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Corridor4.class) { + var9 = StructureNetherBridgePieces.Corridor4.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.Crossing2.class) { + var9 = StructureNetherBridgePieces.Crossing2.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } else if (var8 == StructureNetherBridgePieces.NetherStalkRoom.class) { + var9 = StructureNetherBridgePieces.NetherStalkRoom.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + + return (StructureNetherBridgePieces.Piece)var9; + } + + public static class Corridor extends StructureNetherBridgePieces.Piece { + private boolean field_111021_b; + + + public Corridor() {} + + public Corridor(int p_i2049_1_, Random p_i2049_2_, StructureBoundingBox p_i2049_3_, int p_i2049_4_) { + super(p_i2049_1_); + this.coordBaseMode = p_i2049_4_; + this.boundingBox = p_i2049_3_; + this.field_111021_b = p_i2049_2_.nextInt(3) == 0; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.field_111021_b = p_143011_1_.getBoolean("Chest"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.field_111021_b); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + } + + public static StructureNetherBridgePieces.Corridor createValidComponent(List p_74978_0_, Random p_74978_1_, int p_74978_2_, int p_74978_3_, int p_74978_4_, int p_74978_5_, int p_74978_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74978_2_, p_74978_3_, p_74978_4_, -1, 0, 0, 5, 7, 5, p_74978_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74978_0_, var7) == null ? new StructureNetherBridgePieces.Corridor(p_74978_6_, p_74978_1_, var7, p_74978_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 3, 1, 4, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 3, 3, 4, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 4, 3, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 3, 4, 1, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 3, 4, 3, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + int var4; + int var5; + + if (this.field_111021_b) { + var4 = this.getYWithOffset(2); + var5 = this.getXWithOffset(3, 3); + int var6 = this.getZWithOffset(3, 3); + + if (p_74875_3_.isVecInside(var5, var4, var6)) { + this.field_111021_b = false; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); + } + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (var4 = 0; var4 <= 4; ++var4) { + for (var5 = 0; var5 <= 4; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor2 extends StructureNetherBridgePieces.Piece { + private boolean field_111020_b; + + + public Corridor2() {} + + public Corridor2(int p_i2051_1_, Random p_i2051_2_, StructureBoundingBox p_i2051_3_, int p_i2051_4_) { + super(p_i2051_1_); + this.coordBaseMode = p_i2051_4_; + this.boundingBox = p_i2051_3_; + this.field_111020_b = p_i2051_2_.nextInt(3) == 0; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.field_111020_b = p_143011_1_.getBoolean("Chest"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.field_111020_b); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + } + + public static StructureNetherBridgePieces.Corridor2 createValidComponent(List p_74980_0_, Random p_74980_1_, int p_74980_2_, int p_74980_3_, int p_74980_4_, int p_74980_5_, int p_74980_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74980_2_, p_74980_3_, p_74980_4_, -1, 0, 0, 5, 7, 5, p_74980_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74980_0_, var7) == null ? new StructureNetherBridgePieces.Corridor2(p_74980_6_, p_74980_1_, var7, p_74980_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 1, 0, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 3, 0, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 4, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 3, 4, 1, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 3, 4, 3, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + int var4; + int var5; + + if (this.field_111020_b) { + var4 = this.getYWithOffset(2); + var5 = this.getXWithOffset(1, 3); + int var6 = this.getZWithOffset(1, 3); + + if (p_74875_3_.isVecInside(var5, var4, var6)) { + this.field_111020_b = false; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); + } + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (var4 = 0; var4 <= 4; ++var4) { + for (var5 = 0; var5 <= 4; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor3 extends StructureNetherBridgePieces.Piece { + + + public Corridor3() {} + + public Corridor3(int p_i2045_1_, Random p_i2045_2_, StructureBoundingBox p_i2045_3_, int p_i2045_4_) { + super(p_i2045_1_); + this.coordBaseMode = p_i2045_4_; + this.boundingBox = p_i2045_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 0, true); + } + + public static StructureNetherBridgePieces.Corridor3 createValidComponent(List p_74982_0_, Random p_74982_1_, int p_74982_2_, int p_74982_3_, int p_74982_4_, int p_74982_5_, int p_74982_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74982_2_, p_74982_3_, p_74982_4_, -1, -7, 0, 5, 14, 10, p_74982_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74982_0_, var7) == null ? new StructureNetherBridgePieces.Corridor3(p_74982_6_, p_74982_1_, var7, p_74982_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + int var4 = this.func_151555_a(Blocks.nether_brick_stairs, 2); + + for (int var5 = 0; var5 <= 9; ++var5) { + int var6 = Math.max(1, 7 - var5); + int var7 = Math.min(Math.max(var6 + 5, 14 - var5), 13); + int var8 = var5; + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, var5, 4, var6, var5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, var6 + 1, var5, 3, var7 - 1, var5, Blocks.air, Blocks.air, false); + + if (var5 <= 6) { + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var4, 1, var6 + 1, var5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var4, 2, var6 + 1, var5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var4, 3, var6 + 1, var5, p_74875_3_); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, var7, var5, 4, var7, var5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, var6 + 1, var5, 0, var7 - 1, var5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, var6 + 1, var5, 4, var7 - 1, var5, Blocks.nether_brick, Blocks.nether_brick, false); + + if ((var5 & 1) == 0) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, var6 + 2, var5, 0, var6 + 3, var5, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, var6 + 2, var5, 4, var6 + 3, var5, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + } + + for (int var9 = 0; var9 <= 4; ++var9) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var9, -1, var8, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor4 extends StructureNetherBridgePieces.Piece { + + + public Corridor4() {} + + public Corridor4(int p_i2046_1_, Random p_i2046_2_, StructureBoundingBox p_i2046_3_, int p_i2046_4_) { + super(p_i2046_1_); + this.coordBaseMode = p_i2046_4_; + this.boundingBox = p_i2046_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + byte var4 = 1; + + if (this.coordBaseMode == 1 || this.coordBaseMode == 2) { + var4 = 5; + } + + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, var4, p_74861_3_.nextInt(8) > 0); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, var4, p_74861_3_.nextInt(8) > 0); + } + + public static StructureNetherBridgePieces.Corridor4 createValidComponent(List p_74985_0_, Random p_74985_1_, int p_74985_2_, int p_74985_3_, int p_74985_4_, int p_74985_5_, int p_74985_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74985_2_, p_74985_3_, p_74985_4_, -3, 0, 0, 9, 7, 9, p_74985_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74985_0_, var7) == null ? new StructureNetherBridgePieces.Corridor4(p_74985_6_, p_74985_1_, var7, p_74985_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 8, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 8, 5, 8, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 0, 8, 6, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 2, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 2, 0, 8, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 3, 0, 1, 4, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 3, 0, 7, 4, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 4, 8, 2, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 4, 2, 2, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 1, 4, 7, 2, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 8, 8, 3, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 6, 0, 3, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 3, 6, 8, 3, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 4, 0, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 3, 4, 8, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 3, 5, 2, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 3, 5, 7, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 4, 5, 1, 5, 5, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 4, 5, 7, 5, 5, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + + for (int var4 = 0; var4 <= 5; ++var4) { + for (int var5 = 0; var5 <= 8; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var5, -1, var4, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor5 extends StructureNetherBridgePieces.Piece { + + + public Corridor5() {} + + public Corridor5(int p_i2050_1_, Random p_i2050_2_, StructureBoundingBox p_i2050_3_, int p_i2050_4_) { + super(p_i2050_1_); + this.coordBaseMode = p_i2050_4_; + this.boundingBox = p_i2050_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 0, true); + } + + public static StructureNetherBridgePieces.Corridor5 createValidComponent(List p_74981_0_, Random p_74981_1_, int p_74981_2_, int p_74981_3_, int p_74981_4_, int p_74981_5_, int p_74981_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74981_2_, p_74981_3_, p_74981_4_, -1, 0, 0, 5, 7, 5, p_74981_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74981_0_, var7) == null ? new StructureNetherBridgePieces.Corridor5(p_74981_6_, p_74981_1_, var7, p_74981_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 1, 0, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 3, 0, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 3, 1, 4, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 3, 3, 4, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (int var4 = 0; var4 <= 4; ++var4) { + for (int var5 = 0; var5 <= 4; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } + + public static class Crossing extends StructureNetherBridgePieces.Piece { + + + public Crossing() {} + + public Crossing(int p_i2057_1_, Random p_i2057_2_, StructureBoundingBox p_i2057_3_, int p_i2057_4_) { + super(p_i2057_1_); + this.coordBaseMode = p_i2057_4_; + this.boundingBox = p_i2057_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 2, 0, false); + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 2, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 2, false); + } + + public static StructureNetherBridgePieces.Crossing createValidComponent(List p_74974_0_, Random p_74974_1_, int p_74974_2_, int p_74974_3_, int p_74974_4_, int p_74974_5_, int p_74974_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74974_2_, p_74974_3_, p_74974_4_, -2, 0, 0, 7, 9, 7, p_74974_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74974_0_, var7) == null ? new StructureNetherBridgePieces.Crossing(p_74974_6_, p_74974_1_, var7, p_74974_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 6, 1, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 6, 7, 6, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 1, 6, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 6, 1, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 2, 0, 6, 6, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 2, 6, 6, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 6, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 5, 0, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 2, 0, 6, 6, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 2, 5, 6, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 6, 0, 4, 6, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 5, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 6, 6, 4, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 6, 4, 5, 6, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 2, 0, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 2, 0, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 6, 2, 6, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 5, 2, 6, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + + for (int var4 = 0; var4 <= 6; ++var4) { + for (int var5 = 0; var5 <= 6; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } + + public static class Crossing2 extends StructureNetherBridgePieces.Piece { + + + public Crossing2() {} + + public Crossing2(int p_i2048_1_, Random p_i2048_2_, StructureBoundingBox p_i2048_3_, int p_i2048_4_) { + super(p_i2048_1_); + this.coordBaseMode = p_i2048_4_; + this.boundingBox = p_i2048_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 0, true); + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + } + + public static StructureNetherBridgePieces.Crossing2 createValidComponent(List p_74979_0_, Random p_74979_1_, int p_74979_2_, int p_74979_3_, int p_74979_4_, int p_74979_5_, int p_74979_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74979_2_, p_74979_3_, p_74979_4_, -1, 0, 0, 5, 7, 5, p_74979_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74979_0_, var7) == null ? new StructureNetherBridgePieces.Crossing2(p_74979_6_, p_74979_1_, var7, p_74979_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 4, 0, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 4, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (int var4 = 0; var4 <= 4; ++var4) { + for (int var5 = 0; var5 <= 4; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } + + public static class Crossing3 extends StructureNetherBridgePieces.Piece { + + + public Crossing3() {} + + public Crossing3(int p_i2041_1_, Random p_i2041_2_, StructureBoundingBox p_i2041_3_, int p_i2041_4_) { + super(p_i2041_1_); + this.coordBaseMode = p_i2041_4_; + this.boundingBox = p_i2041_3_; + } + + protected Crossing3(Random p_i2042_1_, int p_i2042_2_, int p_i2042_3_) { + super(0); + this.coordBaseMode = p_i2042_1_.nextInt(4); + + switch (this.coordBaseMode) { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2042_2_, 64, p_i2042_3_, p_i2042_2_ + 19 - 1, 73, p_i2042_3_ + 19 - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2042_2_, 64, p_i2042_3_, p_i2042_2_ + 19 - 1, 73, p_i2042_3_ + 19 - 1); + } + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 8, 3, false); + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 3, 8, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 3, 8, false); + } + + public static StructureNetherBridgePieces.Crossing3 createValidComponent(List p_74966_0_, Random p_74966_1_, int p_74966_2_, int p_74966_3_, int p_74966_4_, int p_74966_5_, int p_74966_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74966_2_, p_74966_3_, p_74966_4_, -8, -3, 0, 19, 10, 19, p_74966_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74966_0_, var7) == null ? new StructureNetherBridgePieces.Crossing3(p_74966_6_, p_74966_1_, var7, p_74966_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 3, 0, 11, 4, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 7, 18, 4, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 5, 0, 10, 7, 18, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 8, 18, 7, 10, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 5, 0, 7, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 5, 11, 7, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 5, 0, 11, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 5, 11, 11, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 7, 7, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 5, 7, 18, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 11, 7, 5, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 5, 11, 18, 5, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 2, 0, 11, 2, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 2, 13, 11, 2, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 0, 0, 11, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 0, 15, 11, 1, 18, Blocks.nether_brick, Blocks.nether_brick, false); + int var4; + int var5; + + for (var4 = 7; var4 <= 11; ++var4) { + for (var5 = 0; var5 <= 2; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, 18 - var5, p_74875_3_); + } + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 7, 5, 2, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 13, 2, 7, 18, 2, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 7, 3, 1, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 15, 0, 7, 18, 1, 11, Blocks.nether_brick, Blocks.nether_brick, false); + + for (var4 = 0; var4 <= 2; ++var4) { + for (var5 = 7; var5 <= 11; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, 18 - var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } + + public static class End extends StructureNetherBridgePieces.Piece { + private int fillSeed; + + + public End() {} + + public End(int p_i2043_1_, Random p_i2043_2_, StructureBoundingBox p_i2043_3_, int p_i2043_4_) { + super(p_i2043_1_); + this.coordBaseMode = p_i2043_4_; + this.boundingBox = p_i2043_3_; + this.fillSeed = p_i2043_2_.nextInt(); + } + + public static StructureNetherBridgePieces.End func_74971_a(List p_74971_0_, Random p_74971_1_, int p_74971_2_, int p_74971_3_, int p_74971_4_, int p_74971_5_, int p_74971_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74971_2_, p_74971_3_, p_74971_4_, -1, -3, 0, 5, 10, 8, p_74971_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74971_0_, var7) == null ? new StructureNetherBridgePieces.End(p_74971_6_, p_74971_1_, var7, p_74971_5_) : null; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.fillSeed = p_143011_1_.getInteger("Seed"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Seed", this.fillSeed); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + Random var4 = new Random(this.fillSeed); + int var5; + int var6; + int var7; + + for (var5 = 0; var5 <= 4; ++var5) { + for (var6 = 3; var6 <= 4; ++var6) { + var7 = var4.nextInt(8); + this.func_151549_a(p_74875_1_, p_74875_3_, var5, var6, 0, var5, var6, var7, Blocks.nether_brick, Blocks.nether_brick, false); + } + } + + var5 = var4.nextInt(8); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 0, 5, var5, Blocks.nether_brick, Blocks.nether_brick, false); + var5 = var4.nextInt(8); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 5, 0, 4, 5, var5, Blocks.nether_brick, Blocks.nether_brick, false); + + for (var5 = 0; var5 <= 4; ++var5) { + var6 = var4.nextInt(5); + this.func_151549_a(p_74875_1_, p_74875_3_, var5, 2, 0, var5, 2, var6, Blocks.nether_brick, Blocks.nether_brick, false); + } + + for (var5 = 0; var5 <= 4; ++var5) { + for (var6 = 0; var6 <= 1; ++var6) { + var7 = var4.nextInt(3); + this.func_151549_a(p_74875_1_, p_74875_3_, var5, var6, 0, var5, var6, var7, Blocks.nether_brick, Blocks.nether_brick, false); + } + } + + return true; + } + } + + public static class Entrance extends StructureNetherBridgePieces.Piece { + + + public Entrance() {} + + public Entrance(int p_i2047_1_, Random p_i2047_2_, StructureBoundingBox p_i2047_3_, int p_i2047_4_) { + super(p_i2047_1_); + this.coordBaseMode = p_i2047_4_; + this.boundingBox = p_i2047_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 5, 3, true); + } + + public static StructureNetherBridgePieces.Entrance createValidComponent(List p_74984_0_, Random p_74984_1_, int p_74984_2_, int p_74984_3_, int p_74984_4_, int p_74984_5_, int p_74984_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74984_2_, p_74984_3_, p_74984_4_, -5, -3, 0, 13, 14, 13, p_74984_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74984_0_, var7) == null ? new StructureNetherBridgePieces.Entrance(p_74984_6_, p_74984_1_, var7, p_74984_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 0, 12, 4, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 12, 13, 12, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 1, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 5, 0, 12, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 11, 4, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 5, 11, 10, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 9, 11, 7, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 5, 0, 10, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 9, 0, 7, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 11, 2, 10, 12, 10, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 8, 0, 7, 8, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + int var4; + + for (var4 = 1; var4 <= 11; var4 += 2) { + this.func_151549_a(p_74875_1_, p_74875_3_, var4, 10, 0, var4, 11, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, var4, 10, 12, var4, 11, 12, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 10, var4, 0, 11, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 10, var4, 12, 11, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, var4, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, var4, 13, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, 0, 13, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, 12, 13, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, var4 + 1, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, var4 + 1, 13, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, var4 + 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, var4 + 1, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, 0, p_74875_3_); + + for (var4 = 3; var4 <= 9; var4 += 2) { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 7, var4, 1, 8, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 7, var4, 11, 8, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 0, 8, 2, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 4, 12, 2, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 0, 0, 8, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 0, 9, 8, 1, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 4, 3, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 0, 4, 12, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + int var5; + + for (var4 = 4; var4 <= 8; ++var4) { + for (var5 = 0; var5 <= 2; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, 12 - var5, p_74875_3_); + } + } + + for (var4 = 0; var4 <= 2; ++var4) { + for (var5 = 4; var5 <= 8; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, 12 - var4, -1, var5, p_74875_3_); + } + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 5, 5, 7, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 1, 6, 6, 4, 6, Blocks.air, Blocks.air, false); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, 6, 0, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.flowing_lava, 0, 6, 5, 6, p_74875_3_); + var4 = this.getXWithOffset(6, 6); + var5 = this.getYWithOffset(5); + int var6 = this.getZWithOffset(6, 6); + + if (p_74875_3_.isVecInside(var4, var5, var6)) { + p_74875_1_.scheduledUpdatesAreImmediate = true; + Blocks.flowing_lava.updateTick(p_74875_1_, var4, var5, var6, p_74875_2_); + p_74875_1_.scheduledUpdatesAreImmediate = false; + } + + return true; + } + } + + public static class NetherStalkRoom extends StructureNetherBridgePieces.Piece { + + + public NetherStalkRoom() {} + + public NetherStalkRoom(int p_i2052_1_, Random p_i2052_2_, StructureBoundingBox p_i2052_3_, int p_i2052_4_) { + super(p_i2052_1_); + this.coordBaseMode = p_i2052_4_; + this.boundingBox = p_i2052_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 5, 3, true); + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 5, 11, true); + } + + public static StructureNetherBridgePieces.NetherStalkRoom createValidComponent(List p_74977_0_, Random p_74977_1_, int p_74977_2_, int p_74977_3_, int p_74977_4_, int p_74977_5_, int p_74977_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74977_2_, p_74977_3_, p_74977_4_, -5, -3, 0, 13, 14, 13, p_74977_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74977_0_, var7) == null ? new StructureNetherBridgePieces.NetherStalkRoom(p_74977_6_, p_74977_1_, var7, p_74977_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 0, 12, 4, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 12, 13, 12, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 1, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 5, 0, 12, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 11, 4, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 5, 11, 10, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 9, 11, 7, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 5, 0, 10, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 9, 0, 7, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 11, 2, 10, 12, 10, Blocks.nether_brick, Blocks.nether_brick, false); + int var4; + + for (var4 = 1; var4 <= 11; var4 += 2) { + this.func_151549_a(p_74875_1_, p_74875_3_, var4, 10, 0, var4, 11, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, var4, 10, 12, var4, 11, 12, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 10, var4, 0, 11, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 10, var4, 12, 11, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, var4, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, var4, 13, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, 0, 13, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, 12, 13, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, var4 + 1, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, var4 + 1, 13, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, var4 + 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, var4 + 1, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, 0, p_74875_3_); + + for (var4 = 3; var4 <= 9; var4 += 2) { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 7, var4, 1, 8, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 11, 7, var4, 11, 8, var4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + } + + var4 = this.func_151555_a(Blocks.nether_brick_stairs, 3); + int var5; + int var6; + int var7; + + for (var5 = 0; var5 <= 6; ++var5) { + var6 = var5 + 4; + + for (var7 = 5; var7 <= 7; ++var7) { + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var4, var7, 5 + var5, var6, p_74875_3_); + } + + if (var6 >= 5 && var6 <= 8) { + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 5, var6, 7, var5 + 4, var6, Blocks.nether_brick, Blocks.nether_brick, false); + } else if (var6 >= 9 && var6 <= 10) { + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 8, var6, 7, var5 + 4, var6, Blocks.nether_brick, Blocks.nether_brick, false); + } + + if (var5 >= 1) { + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 6 + var5, var6, 7, 9 + var5, var6, Blocks.air, Blocks.air, false); + } + } + + for (var5 = 5; var5 <= 7; ++var5) { + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var4, var5, 12, 11, p_74875_3_); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 6, 7, 5, 7, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 6, 7, 7, 7, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 13, 12, 7, 13, 12, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 2, 3, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 9, 3, 5, 10, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 4, 2, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 5, 2, 10, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 5, 9, 10, 5, 10, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 10, 5, 4, 10, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + var5 = this.func_151555_a(Blocks.nether_brick_stairs, 0); + var6 = this.func_151555_a(Blocks.nether_brick_stairs, 1); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var6, 4, 5, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var6, 4, 5, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var6, 4, 5, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var6, 4, 5, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var5, 8, 5, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var5, 8, 5, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var5, 8, 5, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_stairs, var5, 8, 5, 10, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 4, 4, 4, 4, 8, Blocks.soul_sand, Blocks.soul_sand, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 4, 4, 9, 4, 8, Blocks.soul_sand, Blocks.soul_sand, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 5, 4, 4, 5, 8, Blocks.nether_wart, Blocks.nether_wart, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 5, 4, 9, 5, 8, Blocks.nether_wart, Blocks.nether_wart, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 0, 8, 2, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 4, 12, 2, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 0, 0, 8, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 0, 9, 8, 1, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 4, 3, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 0, 4, 12, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + int var8; + + for (var7 = 4; var7 <= 8; ++var7) { + for (var8 = 0; var8 <= 2; ++var8) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var7, -1, var8, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var7, -1, 12 - var8, p_74875_3_); + } + } + + for (var7 = 0; var7 <= 2; ++var7) { + for (var8 = 4; var8 <= 8; ++var8) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var7, -1, var8, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, 12 - var7, -1, var8, p_74875_3_); + } + } + + return true; + } + } + + abstract static class Piece extends StructureComponent { + protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3)}; + + + public Piece() {} + + protected Piece(int p_i2054_1_) { + super(p_i2054_1_); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) {} + + protected void func_143012_a(NBTTagCompound p_143012_1_) {} + + private int getTotalWeight(List p_74960_1_) { + boolean var2 = false; + int var3 = 0; + StructureNetherBridgePieces.PieceWeight var5; + + for (Iterator var4 = p_74960_1_.iterator(); var4.hasNext(); var3 += var5.field_78826_b) { + var5 = (StructureNetherBridgePieces.PieceWeight)var4.next(); + + if (var5.field_78824_d > 0 && var5.field_78827_c < var5.field_78824_d) { + var2 = true; + } + } + + return var2 ? var3 : -1; + } + + private StructureNetherBridgePieces.Piece getNextComponent(StructureNetherBridgePieces.Start p_74959_1_, List p_74959_2_, List p_74959_3_, Random p_74959_4_, int p_74959_5_, int p_74959_6_, int p_74959_7_, int p_74959_8_, int p_74959_9_) { + int var10 = this.getTotalWeight(p_74959_2_); + boolean var11 = var10 > 0 && p_74959_9_ <= 30; + int var12 = 0; + + while (var12 < 5 && var11) { + ++var12; + int var13 = p_74959_4_.nextInt(var10); + Iterator var14 = p_74959_2_.iterator(); + + while (var14.hasNext()) { + StructureNetherBridgePieces.PieceWeight var15 = (StructureNetherBridgePieces.PieceWeight)var14.next(); + var13 -= var15.field_78826_b; + + if (var13 < 0) { + if (!var15.func_78822_a(p_74959_9_) || var15 == p_74959_1_.theNetherBridgePieceWeight && !var15.field_78825_e) { + break; + } + + StructureNetherBridgePieces.Piece var16 = StructureNetherBridgePieces.createNextComponentRandom(var15, p_74959_3_, p_74959_4_, p_74959_5_, p_74959_6_, p_74959_7_, p_74959_8_, p_74959_9_); + + if (var16 != null) { + ++var15.field_78827_c; + p_74959_1_.theNetherBridgePieceWeight = var15; + + if (!var15.func_78823_a()) { + p_74959_2_.remove(var15); + } + + return var16; + } + } + } + } + + return StructureNetherBridgePieces.End.func_74971_a(p_74959_3_, p_74959_4_, p_74959_5_, p_74959_6_, p_74959_7_, p_74959_8_, p_74959_9_); + } + + private StructureComponent getNextComponent(StructureNetherBridgePieces.Start p_74962_1_, List p_74962_2_, Random p_74962_3_, int p_74962_4_, int p_74962_5_, int p_74962_6_, int p_74962_7_, int p_74962_8_, boolean p_74962_9_) { + if (Math.abs(p_74962_4_ - p_74962_1_.getBoundingBox().minX) <= 112 && Math.abs(p_74962_6_ - p_74962_1_.getBoundingBox().minZ) <= 112) { + List var10 = p_74962_1_.primaryWeights; + + if (p_74962_9_) { + var10 = p_74962_1_.secondaryWeights; + } + + StructureNetherBridgePieces.Piece var11 = this.getNextComponent(p_74962_1_, var10, p_74962_2_, p_74962_3_, p_74962_4_, p_74962_5_, p_74962_6_, p_74962_7_, p_74962_8_ + 1); + + if (var11 != null) { + p_74962_2_.add(var11); + p_74962_1_.field_74967_d.add(var11); + } + + return var11; + } else { + return StructureNetherBridgePieces.End.func_74971_a(p_74962_2_, p_74962_3_, p_74962_4_, p_74962_5_, p_74962_6_, p_74962_7_, p_74962_8_); + } + } + + protected StructureComponent getNextComponentNormal(StructureNetherBridgePieces.Start p_74963_1_, List p_74963_2_, Random p_74963_3_, int p_74963_4_, int p_74963_5_, boolean p_74963_6_) { + switch (this.coordBaseMode) { + case 0: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX + p_74963_4_, this.boundingBox.minY + p_74963_5_, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), p_74963_6_); + + case 1: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ + p_74963_4_, this.coordBaseMode, this.getComponentType(), p_74963_6_); + + case 2: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX + p_74963_4_, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), p_74963_6_); + + case 3: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ + p_74963_4_, this.coordBaseMode, this.getComponentType(), p_74963_6_); + + default: + return null; + } + } + + protected StructureComponent getNextComponentX(StructureNetherBridgePieces.Start p_74961_1_, List p_74961_2_, Random p_74961_3_, int p_74961_4_, int p_74961_5_, boolean p_74961_6_) { + switch (this.coordBaseMode) { + case 0: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ + p_74961_5_, 1, this.getComponentType(), p_74961_6_); + + case 1: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX + p_74961_5_, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ - 1, 2, this.getComponentType(), p_74961_6_); + + case 2: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ + p_74961_5_, 1, this.getComponentType(), p_74961_6_); + + case 3: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX + p_74961_5_, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ - 1, 2, this.getComponentType(), p_74961_6_); + + default: + return null; + } + } + + protected StructureComponent getNextComponentZ(StructureNetherBridgePieces.Start p_74965_1_, List p_74965_2_, Random p_74965_3_, int p_74965_4_, int p_74965_5_, boolean p_74965_6_) { + switch (this.coordBaseMode) { + case 0: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74965_4_, this.boundingBox.minZ + p_74965_5_, 3, this.getComponentType(), p_74965_6_); + + case 1: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.minX + p_74965_5_, this.boundingBox.minY + p_74965_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType(), p_74965_6_); + + case 2: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74965_4_, this.boundingBox.minZ + p_74965_5_, 3, this.getComponentType(), p_74965_6_); + + case 3: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.minX + p_74965_5_, this.boundingBox.minY + p_74965_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType(), p_74965_6_); + + default: + return null; + } + } + + protected static boolean isAboveGround(StructureBoundingBox p_74964_0_) { + return p_74964_0_ != null && p_74964_0_.minY > 10; + } + } + + static class PieceWeight { + public Class weightClass; + public final int field_78826_b; + public int field_78827_c; + public int field_78824_d; + public boolean field_78825_e; + + + public PieceWeight(Class p_i2055_1_, int p_i2055_2_, int p_i2055_3_, boolean p_i2055_4_) { + this.weightClass = p_i2055_1_; + this.field_78826_b = p_i2055_2_; + this.field_78824_d = p_i2055_3_; + this.field_78825_e = p_i2055_4_; + } + + public PieceWeight(Class p_i2056_1_, int p_i2056_2_, int p_i2056_3_) { + this(p_i2056_1_, p_i2056_2_, p_i2056_3_, false); + } + + public boolean func_78822_a(int p_78822_1_) { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + + public boolean func_78823_a() { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + } + + public static class Stairs extends StructureNetherBridgePieces.Piece { + + + public Stairs() {} + + public Stairs(int p_i2058_1_, Random p_i2058_2_, StructureBoundingBox p_i2058_3_, int p_i2058_4_) { + super(p_i2058_1_); + this.coordBaseMode = p_i2058_4_; + this.boundingBox = p_i2058_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 6, 2, false); + } + + public static StructureNetherBridgePieces.Stairs createValidComponent(List p_74973_0_, Random p_74973_1_, int p_74973_2_, int p_74973_3_, int p_74973_4_, int p_74973_5_, int p_74973_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74973_2_, p_74973_3_, p_74973_4_, -2, 0, 0, 7, 11, 7, p_74973_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74973_0_, var7) == null ? new StructureNetherBridgePieces.Stairs(p_74973_6_, p_74973_1_, var7, p_74973_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 6, 1, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 6, 10, 6, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 1, 8, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 2, 0, 6, 8, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 1, 0, 8, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 2, 1, 6, 8, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 6, 5, 8, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 2, 0, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 3, 2, 6, 5, 2, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 3, 4, 6, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151550_a(p_74875_1_, Blocks.nether_brick, 0, 5, 2, 5, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 2, 5, 4, 3, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 2, 5, 3, 4, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 2, 5, 2, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 5, 1, 6, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 7, 1, 5, 7, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 8, 2, 6, 8, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 6, 0, 4, 8, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 5, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + + for (int var4 = 0; var4 <= 6; ++var4) { + for (int var5 = 0; var5 <= 6; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } + + public static class Start extends StructureNetherBridgePieces.Crossing3 { + public StructureNetherBridgePieces.PieceWeight theNetherBridgePieceWeight; + public List primaryWeights; + public List secondaryWeights; + public ArrayList field_74967_d = new ArrayList(); + + + public Start() {} + + public Start(Random p_i2059_1_, int p_i2059_2_, int p_i2059_3_) { + super(p_i2059_1_, p_i2059_2_, p_i2059_3_); + this.primaryWeights = new ArrayList(); + StructureNetherBridgePieces.PieceWeight[] var4 = StructureNetherBridgePieces.primaryComponents; + int var5 = var4.length; + int var6; + StructureNetherBridgePieces.PieceWeight var7; + + for (var6 = 0; var6 < var5; ++var6) { + var7 = var4[var6]; + var7.field_78827_c = 0; + this.primaryWeights.add(var7); + } + + this.secondaryWeights = new ArrayList(); + var4 = StructureNetherBridgePieces.secondaryComponents; + var5 = var4.length; + + for (var6 = 0; var6 < var5; ++var6) { + var7 = var4[var6]; + var7.field_78827_c = 0; + this.secondaryWeights.add(var7); + } + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + } + } + + public static class Straight extends StructureNetherBridgePieces.Piece { + + + public Straight() {} + + public Straight(int p_i2044_1_, Random p_i2044_2_, StructureBoundingBox p_i2044_3_, int p_i2044_4_) { + super(p_i2044_1_); + this.coordBaseMode = p_i2044_4_; + this.boundingBox = p_i2044_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 3, false); + } + + public static StructureNetherBridgePieces.Straight createValidComponent(List p_74983_0_, Random p_74983_1_, int p_74983_2_, int p_74983_3_, int p_74983_4_, int p_74983_5_, int p_74983_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74983_2_, p_74983_3_, p_74983_4_, -1, -3, 0, 5, 10, 19, p_74983_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74983_0_, var7) == null ? new StructureNetherBridgePieces.Straight(p_74983_6_, p_74983_1_, var7, p_74983_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 0, 4, 4, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 0, 3, 7, 18, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 0, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 5, 0, 4, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 2, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 13, 4, 2, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 15, 4, 1, 18, Blocks.nether_brick, Blocks.nether_brick, false); + + for (int var4 = 0; var4 <= 4; ++var4) { + for (int var5 = 0; var5 <= 2; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, 18 - var5, p_74875_3_); + } + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 4, 0, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 14, 0, 4, 14, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 17, 0, 4, 17, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 3, 4, 4, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 3, 14, 4, 4, 14, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 17, 4, 4, 17, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + return true; + } + } + + public static class Throne extends StructureNetherBridgePieces.Piece { + private boolean hasSpawner; + + + public Throne() {} + + public Throne(int p_i2053_1_, Random p_i2053_2_, StructureBoundingBox p_i2053_3_, int p_i2053_4_) { + super(p_i2053_1_); + this.coordBaseMode = p_i2053_4_; + this.boundingBox = p_i2053_3_; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.hasSpawner = p_143011_1_.getBoolean("Mob"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Mob", this.hasSpawner); + } + + public static StructureNetherBridgePieces.Throne createValidComponent(List p_74975_0_, Random p_74975_1_, int p_74975_2_, int p_74975_3_, int p_74975_4_, int p_74975_5_, int p_74975_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74975_2_, p_74975_3_, p_74975_4_, -2, 0, 0, 7, 8, 9, p_74975_5_); + return isAboveGround(var7) && StructureComponent.findIntersecting(p_74975_0_, var7) == null ? new StructureNetherBridgePieces.Throne(p_74975_6_, p_74975_1_, var7, p_74975_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 6, 7, 7, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 0, 5, 1, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 1, 5, 2, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 3, 2, 5, 3, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 4, 3, 5, 4, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 0, 1, 4, 2, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 2, 0, 5, 4, 2, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 2, 1, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 5, 2, 5, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 3, 0, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 5, 3, 6, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 8, 5, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 1, 6, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.nether_brick_fence, 0, 5, 6, 3, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 3, 0, 6, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 6, 3, 6, 6, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 6, 8, 5, 7, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 8, 8, 4, 8, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + int var4; + int var5; + + if (!this.hasSpawner) { + var4 = this.getYWithOffset(5); + var5 = this.getXWithOffset(3, 5); + int var6 = this.getZWithOffset(3, 5); + + if (p_74875_3_.isVecInside(var5, var4, var6)) { + this.hasSpawner = true; + p_74875_1_.setBlock(var5, var4, var6, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner var7 = (TileEntityMobSpawner)p_74875_1_.getTileEntity(var5, var4, var6); + + if (var7 != null) { + var7.func_145881_a().setMobID("Blaze"); + } + } + } + + for (var4 = 0; var4 <= 6; ++var4) { + for (var5 = 0; var5 <= 6; ++var5) { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, var4, -1, var5, p_74875_3_); + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureStart.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureStart.java new file mode 100644 index 0000000..54dd6a6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureStart.java @@ -0,0 +1,157 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Random; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public abstract class StructureStart { + /** List of all StructureComponents that are part of this structure */ + protected LinkedList components = new LinkedList(); + protected StructureBoundingBox boundingBox; + private int field_143024_c; + private int field_143023_d; + + + public StructureStart() {} + + public StructureStart(int p_i43002_1_, int p_i43002_2_) { + this.field_143024_c = p_i43002_1_; + this.field_143023_d = p_i43002_2_; + } + + public StructureBoundingBox getBoundingBox() { + return this.boundingBox; + } + + public LinkedList getComponents() { + return this.components; + } + + /** + * Keeps iterating Structure Pieces and spawning them until the checks tell it to stop + */ + public void generateStructure(World p_75068_1_, Random p_75068_2_, StructureBoundingBox p_75068_3_) { + Iterator var4 = this.components.iterator(); + + while (var4.hasNext()) { + StructureComponent var5 = (StructureComponent)var4.next(); + + if (var5.getBoundingBox().intersectsWith(p_75068_3_) && !var5.addComponentParts(p_75068_1_, p_75068_2_, p_75068_3_)) { + var4.remove(); + } + } + } + + /** + * Calculates total bounding box based on components' bounding boxes and saves it to boundingBox + */ + protected void updateBoundingBox() { + this.boundingBox = StructureBoundingBox.getNewBoundingBox(); + Iterator var1 = this.components.iterator(); + + while (var1.hasNext()) { + StructureComponent var2 = (StructureComponent)var1.next(); + this.boundingBox.expandTo(var2.getBoundingBox()); + } + } + + public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) { + NBTTagCompound var3 = new NBTTagCompound(); + var3.setString("id", MapGenStructureIO.func_143033_a(this)); + var3.setInteger("ChunkX", p_143021_1_); + var3.setInteger("ChunkZ", p_143021_2_); + var3.setTag("BB", this.boundingBox.func_151535_h()); + NBTTagList var4 = new NBTTagList(); + Iterator var5 = this.components.iterator(); + + while (var5.hasNext()) { + StructureComponent var6 = (StructureComponent)var5.next(); + var4.appendTag(var6.func_143010_b()); + } + + var3.setTag("Children", var4); + this.func_143022_a(var3); + return var3; + } + + public void func_143022_a(NBTTagCompound p_143022_1_) {} + + public void func_143020_a(World p_143020_1_, NBTTagCompound p_143020_2_) { + this.field_143024_c = p_143020_2_.getInteger("ChunkX"); + this.field_143023_d = p_143020_2_.getInteger("ChunkZ"); + + if (p_143020_2_.hasKey("BB")) { + this.boundingBox = new StructureBoundingBox(p_143020_2_.getIntArray("BB")); + } + + NBTTagList var3 = p_143020_2_.getTagList("Children", 10); + + for (int var4 = 0; var4 < var3.tagCount(); ++var4) { + this.components.add(MapGenStructureIO.func_143032_b(var3.getCompoundTagAt(var4), p_143020_1_)); + } + + this.func_143017_b(p_143020_2_); + } + + public void func_143017_b(NBTTagCompound p_143017_1_) {} + + /** + * offsets the structure Bounding Boxes up to a certain height, typically 63 - 10 + */ + protected void markAvailableHeight(World p_75067_1_, Random p_75067_2_, int p_75067_3_) { + int var4 = 63 - p_75067_3_; + int var5 = this.boundingBox.getYSize() + 1; + + if (var5 < var4) { + var5 += p_75067_2_.nextInt(var4 - var5); + } + + int var6 = var5 - this.boundingBox.maxY; + this.boundingBox.offset(0, var6, 0); + Iterator var7 = this.components.iterator(); + + while (var7.hasNext()) { + StructureComponent var8 = (StructureComponent)var7.next(); + var8.getBoundingBox().offset(0, var6, 0); + } + } + + protected void setRandomHeight(World p_75070_1_, Random p_75070_2_, int p_75070_3_, int p_75070_4_) { + int var5 = p_75070_4_ - p_75070_3_ + 1 - this.boundingBox.getYSize(); + boolean var6 = true; + int var10; + + if (var5 > 1) { + var10 = p_75070_3_ + p_75070_2_.nextInt(var5); + } else { + var10 = p_75070_3_; + } + + int var7 = var10 - this.boundingBox.minY; + this.boundingBox.offset(0, var7, 0); + Iterator var8 = this.components.iterator(); + + while (var8.hasNext()) { + StructureComponent var9 = (StructureComponent)var8.next(); + var9.getBoundingBox().offset(0, var7, 0); + } + } + + /** + * currently only defined for Villages, returns true if Village has more than 2 non-road components + */ + public boolean isSizeableStructure() { + return true; + } + + public int func_143019_e() { + return this.field_143024_c; + } + + public int func_143018_f() { + return this.field_143023_d; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java new file mode 100644 index 0000000..8991a9c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java @@ -0,0 +1,1422 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public class StructureStrongholdPieces { + private static final StructureStrongholdPieces.PieceWeight[] pieceWeightArray = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) { + + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) { + return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 4; + } + }, new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.PortalRoom.class, 20, 1) { + + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) { + return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 5; + } + } + }; + private static List structurePieceList; + private static Class strongComponentType; + static int totalWeight; + private static final StructureStrongholdPieces.Stones strongholdStones = new StructureStrongholdPieces.Stones(null); + + + public static void func_143046_a() { + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.ChestCorridor.class, "SHCC"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Corridor.class, "SHFC"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Crossing.class, "SH5C"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.LeftTurn.class, "SHLT"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Library.class, "SHLi"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.PortalRoom.class, "SHPR"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Prison.class, "SHPH"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.RightTurn.class, "SHRT"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.RoomCrossing.class, "SHRC"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Stairs.class, "SHSD"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Stairs2.class, "SHStart"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Straight.class, "SHS"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.StairsStraight.class, "SHSSD"); + } + + /** + * sets up Arrays with the Structure pieces and their weights + */ + public static void prepareStructurePieces() { + structurePieceList = new ArrayList(); + StructureStrongholdPieces.PieceWeight[] var0 = pieceWeightArray; + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) { + StructureStrongholdPieces.PieceWeight var3 = var0[var2]; + var3.instancesSpawned = 0; + structurePieceList.add(var3); + } + + strongComponentType = null; + } + + private static boolean canAddStructurePieces() { + boolean var0 = false; + totalWeight = 0; + StructureStrongholdPieces.PieceWeight var2; + + for (Iterator var1 = structurePieceList.iterator(); var1.hasNext(); totalWeight += var2.pieceWeight) { + var2 = (StructureStrongholdPieces.PieceWeight)var1.next(); + + if (var2.instancesLimit > 0 && var2.instancesSpawned < var2.instancesLimit) { + var0 = true; + } + } + + return var0; + } + + /** + * translates the PieceWeight class to the Component class + */ + private static StructureStrongholdPieces.Stronghold getStrongholdComponentFromWeightedPiece(Class p_75200_0_, List p_75200_1_, Random p_75200_2_, int p_75200_3_, int p_75200_4_, int p_75200_5_, int p_75200_6_, int p_75200_7_) { + Object var8 = null; + + if (p_75200_0_ == StructureStrongholdPieces.Straight.class) { + var8 = StructureStrongholdPieces.Straight.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.Prison.class) { + var8 = StructureStrongholdPieces.Prison.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.LeftTurn.class) { + var8 = StructureStrongholdPieces.LeftTurn.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.RightTurn.class) { + var8 = StructureStrongholdPieces.RightTurn.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.RoomCrossing.class) { + var8 = StructureStrongholdPieces.RoomCrossing.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.StairsStraight.class) { + var8 = StructureStrongholdPieces.StairsStraight.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.Stairs.class) { + var8 = StructureStrongholdPieces.Stairs.getStrongholdStairsComponent(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.Crossing.class) { + var8 = StructureStrongholdPieces.Crossing.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.ChestCorridor.class) { + var8 = StructureStrongholdPieces.ChestCorridor.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.Library.class) { + var8 = StructureStrongholdPieces.Library.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } else if (p_75200_0_ == StructureStrongholdPieces.PortalRoom.class) { + var8 = StructureStrongholdPieces.PortalRoom.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + + return (StructureStrongholdPieces.Stronghold)var8; + } + + private static StructureStrongholdPieces.Stronghold getNextComponent(StructureStrongholdPieces.Stairs2 p_75201_0_, List p_75201_1_, Random p_75201_2_, int p_75201_3_, int p_75201_4_, int p_75201_5_, int p_75201_6_, int p_75201_7_) { + if (!canAddStructurePieces()) { + return null; + } else { + if (strongComponentType != null) { + StructureStrongholdPieces.Stronghold var8 = getStrongholdComponentFromWeightedPiece(strongComponentType, p_75201_1_, p_75201_2_, p_75201_3_, p_75201_4_, p_75201_5_, p_75201_6_, p_75201_7_); + strongComponentType = null; + + if (var8 != null) { + return var8; + } + } + + int var13 = 0; + + while (var13 < 5) { + ++var13; + int var9 = p_75201_2_.nextInt(totalWeight); + Iterator var10 = structurePieceList.iterator(); + + while (var10.hasNext()) { + StructureStrongholdPieces.PieceWeight var11 = (StructureStrongholdPieces.PieceWeight)var10.next(); + var9 -= var11.pieceWeight; + + if (var9 < 0) { + if (!var11.canSpawnMoreStructuresOfType(p_75201_7_) || var11 == p_75201_0_.strongholdPieceWeight) { + break; + } + + StructureStrongholdPieces.Stronghold var12 = getStrongholdComponentFromWeightedPiece(var11.pieceClass, p_75201_1_, p_75201_2_, p_75201_3_, p_75201_4_, p_75201_5_, p_75201_6_, p_75201_7_); + + if (var12 != null) { + ++var11.instancesSpawned; + p_75201_0_.strongholdPieceWeight = var11; + + if (!var11.canSpawnMoreStructures()) { + structurePieceList.remove(var11); + } + + return var12; + } + } + } + } + + StructureBoundingBox var14 = StructureStrongholdPieces.Corridor.func_74992_a(p_75201_1_, p_75201_2_, p_75201_3_, p_75201_4_, p_75201_5_, p_75201_6_); + + if (var14 != null && var14.minY > 1) { + return new StructureStrongholdPieces.Corridor(p_75201_7_, p_75201_2_, var14, p_75201_6_); + } else { + return null; + } + } + } + + private static StructureComponent getNextValidComponent(StructureStrongholdPieces.Stairs2 p_75196_0_, List p_75196_1_, Random p_75196_2_, int p_75196_3_, int p_75196_4_, int p_75196_5_, int p_75196_6_, int p_75196_7_) { + if (p_75196_7_ > 50) { + return null; + } else if (Math.abs(p_75196_3_ - p_75196_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75196_5_ - p_75196_0_.getBoundingBox().minZ) <= 112) { + StructureStrongholdPieces.Stronghold var8 = getNextComponent(p_75196_0_, p_75196_1_, p_75196_2_, p_75196_3_, p_75196_4_, p_75196_5_, p_75196_6_, p_75196_7_ + 1); + + if (var8 != null) { + p_75196_1_.add(var8); + p_75196_0_.field_75026_c.add(var8); + } + + return var8; + } else { + return null; + } + } + + public static class ChestCorridor extends StructureStrongholdPieces.Stronghold { + private static final WeightedRandomChestContent[] strongholdChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.ender_pearl, 0, 1, 1, 10), new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 1), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + private boolean hasMadeChest; + + + public ChestCorridor() {} + + public ChestCorridor(int p_i2071_1_, Random p_i2071_2_, StructureBoundingBox p_i2071_3_, int p_i2071_4_) { + super(p_i2071_1_); + this.coordBaseMode = p_i2071_4_; + this.field_143013_d = this.getRandomDoor(p_i2071_2_); + this.boundingBox = p_i2071_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.hasMadeChest); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.hasMadeChest = p_143011_1_.getBoolean("Chest"); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + public static StructureStrongholdPieces.ChestCorridor findValidPlacement(List p_75000_0_, Random p_75000_1_, int p_75000_2_, int p_75000_3_, int p_75000_4_, int p_75000_5_, int p_75000_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75000_2_, p_75000_3_, p_75000_4_, -1, -1, 0, 5, 5, 7, p_75000_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75000_0_, var7) == null ? new StructureStrongholdPieces.ChestCorridor(p_75000_6_, p_75000_1_, var7, p_75000_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 6, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 2, 3, 1, 4, Blocks.stonebrick, Blocks.stonebrick, false); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 5, 3, 1, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 5, 3, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 5, 3, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 5, 3, 2, 4, p_74875_3_); + int var4; + + for (var4 = 2; var4 <= 4; ++var4) { + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 5, 2, 1, var4, p_74875_3_); + } + + if (!this.hasMadeChest) { + var4 = this.getYWithOffset(2); + int var5 = this.getXWithOffset(3, 3); + int var6 = this.getZWithOffset(3, 3); + + if (p_74875_3_.isVecInside(var5, var4, var6)) { + this.hasMadeChest = true; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, WeightedRandomChestContent.func_92080_a(strongholdChestContents, Items.enchanted_book.func_92114_b(p_74875_2_)), 2 + p_74875_2_.nextInt(2)); + } + } + + return true; + } + } + } + + public static class Corridor extends StructureStrongholdPieces.Stronghold { + private int field_74993_a; + + + public Corridor() {} + + public Corridor(int p_i2072_1_, Random p_i2072_2_, StructureBoundingBox p_i2072_3_, int p_i2072_4_) { + super(p_i2072_1_); + this.coordBaseMode = p_i2072_4_; + this.boundingBox = p_i2072_3_; + this.field_74993_a = p_i2072_4_ != 2 && p_i2072_4_ != 0 ? p_i2072_3_.getXSize() : p_i2072_3_.getZSize(); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Steps", this.field_74993_a); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.field_74993_a = p_143011_1_.getInteger("Steps"); + } + + public static StructureBoundingBox func_74992_a(List p_74992_0_, Random p_74992_1_, int p_74992_2_, int p_74992_3_, int p_74992_4_, int p_74992_5_) { + boolean var6 = true; + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, 4, p_74992_5_); + StructureComponent var8 = StructureComponent.findIntersecting(p_74992_0_, var7); + + if (var8 == null) { + return null; + } else { + if (var8.getBoundingBox().minY == var7.minY) { + for (int var9 = 3; var9 >= 1; --var9) { + var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, var9 - 1, p_74992_5_); + + if (!var8.getBoundingBox().intersectsWith(var7)) { + return StructureBoundingBox.getComponentToAddBoundingBox(p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, var9, p_74992_5_); + } + } + } + + return null; + } + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + for (int var4 = 0; var4 < this.field_74993_a; ++var4) { + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 0, 0, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 0, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 2, 0, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3, 0, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 4, 0, var4, p_74875_3_); + + for (int var5 = 1; var5 <= 3; ++var5) { + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 0, var5, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, var5, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, var5, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 3, var5, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 4, var5, var4, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 0, 4, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 4, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 2, 4, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3, 4, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 4, 4, var4, p_74875_3_); + } + + return true; + } + } + } + + public static class Crossing extends StructureStrongholdPieces.Stronghold { + private boolean field_74996_b; + private boolean field_74997_c; + private boolean field_74995_d; + private boolean field_74999_h; + + + public Crossing() {} + + public Crossing(int p_i2073_1_, Random p_i2073_2_, StructureBoundingBox p_i2073_3_, int p_i2073_4_) { + super(p_i2073_1_); + this.coordBaseMode = p_i2073_4_; + this.field_143013_d = this.getRandomDoor(p_i2073_2_); + this.boundingBox = p_i2073_3_; + this.field_74996_b = p_i2073_2_.nextBoolean(); + this.field_74997_c = p_i2073_2_.nextBoolean(); + this.field_74995_d = p_i2073_2_.nextBoolean(); + this.field_74999_h = p_i2073_2_.nextInt(3) > 0; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("leftLow", this.field_74996_b); + p_143012_1_.setBoolean("leftHigh", this.field_74997_c); + p_143012_1_.setBoolean("rightLow", this.field_74995_d); + p_143012_1_.setBoolean("rightHigh", this.field_74999_h); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.field_74996_b = p_143011_1_.getBoolean("leftLow"); + this.field_74997_c = p_143011_1_.getBoolean("leftHigh"); + this.field_74995_d = p_143011_1_.getBoolean("rightLow"); + this.field_74999_h = p_143011_1_.getBoolean("rightHigh"); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + int var4 = 3; + int var5 = 5; + + if (this.coordBaseMode == 1 || this.coordBaseMode == 2) { + var4 = 8 - var4; + var5 = 8 - var5; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 5, 1); + + if (this.field_74996_b) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, var4, 1); + } + + if (this.field_74997_c) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, var5, 7); + } + + if (this.field_74995_d) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, var4, 1); + } + + if (this.field_74999_h) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, var5, 7); + } + } + + public static StructureStrongholdPieces.Crossing findValidPlacement(List p_74994_0_, Random p_74994_1_, int p_74994_2_, int p_74994_3_, int p_74994_4_, int p_74994_5_, int p_74994_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74994_2_, p_74994_3_, p_74994_4_, -4, -3, 0, 10, 9, 11, p_74994_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_74994_0_, var7) == null ? new StructureStrongholdPieces.Crossing(p_74994_6_, p_74994_1_, var7, p_74994_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 9, 8, 10, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 4, 3, 0); + + if (this.field_74996_b) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, 1, 0, 5, 3, Blocks.air, Blocks.air, false); + } + + if (this.field_74995_d) { + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 3, 1, 9, 5, 3, Blocks.air, Blocks.air, false); + } + + if (this.field_74997_c) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 7, 0, 7, 9, Blocks.air, Blocks.air, false); + } + + if (this.field_74999_h) { + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 5, 7, 9, 7, 9, Blocks.air, Blocks.air, false); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 1, 10, 7, 3, 10, Blocks.air, Blocks.air, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 2, 1, 8, 2, 6, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 5, 4, 4, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 8, 1, 5, 8, 4, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 4, 7, 3, 4, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 5, 3, 3, 6, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 3, 4, 3, 3, 4, Blocks.stone_slab, Blocks.stone_slab, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 4, 6, 3, 4, 6, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 1, 7, 7, 1, 8, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 1, 9, 7, 1, 9, Blocks.stone_slab, Blocks.stone_slab, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 2, 7, 7, 2, 7, Blocks.stone_slab, Blocks.stone_slab, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 5, 7, 4, 5, 9, Blocks.stone_slab, Blocks.stone_slab, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 5, 7, 8, 5, 9, Blocks.stone_slab, Blocks.stone_slab, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 5, 7, 7, 5, 9, Blocks.double_stone_slab, Blocks.double_stone_slab, false); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 6, 5, 6, p_74875_3_); + return true; + } + } + } + + public static class LeftTurn extends StructureStrongholdPieces.Stronghold { + + + public LeftTurn() {} + + public LeftTurn(int p_i2074_1_, Random p_i2074_2_, StructureBoundingBox p_i2074_3_, int p_i2074_4_) { + super(p_i2074_1_); + this.coordBaseMode = p_i2074_4_; + this.field_143013_d = this.getRandomDoor(p_i2074_2_); + this.boundingBox = p_i2074_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } else { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + } + + public static StructureStrongholdPieces.LeftTurn findValidPlacement(List p_75010_0_, Random p_75010_1_, int p_75010_2_, int p_75010_3_, int p_75010_4_, int p_75010_5_, int p_75010_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75010_2_, p_75010_3_, p_75010_4_, -1, -1, 0, 5, 5, 5, p_75010_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75010_0_, var7) == null ? new StructureStrongholdPieces.LeftTurn(p_75010_6_, p_75010_1_, var7, p_75010_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 4, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 3, Blocks.air, Blocks.air, false); + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } + + public static class Library extends StructureStrongholdPieces.Stronghold { + private static final WeightedRandomChestContent[] strongholdLibraryChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.book, 0, 1, 3, 20), new WeightedRandomChestContent(Items.paper, 0, 2, 7, 20), new WeightedRandomChestContent(Items.map, 0, 1, 1, 1), new WeightedRandomChestContent(Items.compass, 0, 1, 1, 1)}; + private boolean isLargeRoom; + + + public Library() {} + + public Library(int p_i2075_1_, Random p_i2075_2_, StructureBoundingBox p_i2075_3_, int p_i2075_4_) { + super(p_i2075_1_); + this.coordBaseMode = p_i2075_4_; + this.field_143013_d = this.getRandomDoor(p_i2075_2_); + this.boundingBox = p_i2075_3_; + this.isLargeRoom = p_i2075_3_.getYSize() > 6; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Tall", this.isLargeRoom); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.isLargeRoom = p_143011_1_.getBoolean("Tall"); + } + + public static StructureStrongholdPieces.Library findValidPlacement(List p_75006_0_, Random p_75006_1_, int p_75006_2_, int p_75006_3_, int p_75006_4_, int p_75006_5_, int p_75006_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75006_2_, p_75006_3_, p_75006_4_, -4, -1, 0, 14, 11, 15, p_75006_5_); + + if (!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(p_75006_0_, var7) != null) { + var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75006_2_, p_75006_3_, p_75006_4_, -4, -1, 0, 14, 6, 15, p_75006_5_); + + if (!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(p_75006_0_, var7) != null) { + return null; + } + } + + return new StructureStrongholdPieces.Library(p_75006_6_, p_75006_1_, var7, p_75006_5_); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + byte var4 = 11; + + if (!this.isLargeRoom) { + var4 = 6; + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 13, var4 - 1, 14, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 4, 1, 0); + this.func_151551_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.07F, 2, 1, 1, 11, 4, 13, Blocks.web, Blocks.web, false); + boolean var5 = true; + boolean var6 = true; + int var7; + + for (var7 = 1; var7 <= 13; ++var7) { + if ((var7 - 1) % 4 == 0) { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, var7, 1, 4, var7, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 1, var7, 12, 4, var7, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 2, 3, var7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 11, 3, var7, p_74875_3_); + + if (this.isLargeRoom) { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 6, var7, 1, 9, var7, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 6, var7, 12, 9, var7, Blocks.planks, Blocks.planks, false); + } + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, var7, 1, 4, var7, Blocks.bookshelf, Blocks.bookshelf, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 1, var7, 12, 4, var7, Blocks.bookshelf, Blocks.bookshelf, false); + + if (this.isLargeRoom) { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 6, var7, 1, 9, var7, Blocks.bookshelf, Blocks.bookshelf, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 6, var7, 12, 9, var7, Blocks.bookshelf, Blocks.bookshelf, false); + } + } + } + + for (var7 = 3; var7 < 12; var7 += 2) { + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, var7, 4, 3, var7, Blocks.bookshelf, Blocks.bookshelf, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 1, var7, 7, 3, var7, Blocks.bookshelf, Blocks.bookshelf, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 1, var7, 10, 3, var7, Blocks.bookshelf, Blocks.bookshelf, false); + } + + if (this.isLargeRoom) { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 1, 3, 5, 13, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 10, 5, 1, 12, 5, 13, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 5, 1, 9, 5, 2, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 5, 12, 9, 5, 13, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 9, 5, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 5, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 9, 5, 10, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 6, 2, 3, 6, 12, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 10, 6, 2, 10, 6, 10, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 6, 2, 9, 6, 2, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 6, 12, 8, 6, 12, Blocks.fence, Blocks.fence, false); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 9, 6, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 8, 6, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 9, 6, 10, p_74875_3_); + var7 = this.func_151555_a(Blocks.ladder, 3); + this.func_151550_a(p_74875_1_, Blocks.ladder, var7, 10, 1, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var7, 10, 2, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var7, 10, 3, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var7, 10, 4, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var7, 10, 5, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var7, 10, 6, 13, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var7, 10, 7, 13, p_74875_3_); + byte var8 = 7; + byte var9 = 7; + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8 - 1, 9, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8, 9, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8 - 1, 8, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8, 8, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8 - 1, 7, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8, 7, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8 - 2, 7, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8 + 1, 7, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8 - 1, 7, var9 - 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8 - 1, 7, var9 + 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8, 7, var9 - 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, var8, 7, var9 + 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, var8 - 2, 8, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, var8 + 1, 8, var9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, var8 - 1, 8, var9 - 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, var8 - 1, 8, var9 + 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, var8, 8, var9 - 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, var8, 8, var9 + 1, p_74875_3_); + } + + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, Items.enchanted_book.func_92112_a(p_74875_2_, 1, 5, 2)), 1 + p_74875_2_.nextInt(4)); + + if (this.isLargeRoom) { + this.func_151550_a(p_74875_1_, Blocks.air, 0, 12, 9, 1, p_74875_3_); + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, Items.enchanted_book.func_92112_a(p_74875_2_, 1, 5, 2)), 1 + p_74875_2_.nextInt(4)); + } + + return true; + } + } + } + + static class PieceWeight { + public Class pieceClass; + public final int pieceWeight; + public int instancesSpawned; + public int instancesLimit; + + + public PieceWeight(Class p_i2076_1_, int p_i2076_2_, int p_i2076_3_) { + this.pieceClass = p_i2076_1_; + this.pieceWeight = p_i2076_2_; + this.instancesLimit = p_i2076_3_; + } + + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + + public boolean canSpawnMoreStructures() { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + } + + public static class PortalRoom extends StructureStrongholdPieces.Stronghold { + private boolean hasSpawner; + + + public PortalRoom() {} + + public PortalRoom(int p_i2077_1_, Random p_i2077_2_, StructureBoundingBox p_i2077_3_, int p_i2077_4_) { + super(p_i2077_1_); + this.coordBaseMode = p_i2077_4_; + this.boundingBox = p_i2077_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Mob", this.hasSpawner); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.hasSpawner = p_143011_1_.getBoolean("Mob"); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + if (p_74861_1_ != null) { + ((StructureStrongholdPieces.Stairs2)p_74861_1_).strongholdPortalRoom = this; + } + } + + public static StructureStrongholdPieces.PortalRoom findValidPlacement(List p_75004_0_, Random p_75004_1_, int p_75004_2_, int p_75004_3_, int p_75004_4_, int p_75004_5_, int p_75004_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75004_2_, p_75004_3_, p_75004_4_, -4, -1, 0, 11, 8, 16, p_75004_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75004_0_, var7) == null ? new StructureStrongholdPieces.PortalRoom(p_75004_6_, p_75004_1_, var7, p_75004_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 10, 7, 15, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.GRATES, 4, 1, 0); + byte var4 = 6; + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, var4, 1, 1, var4, 14, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, var4, 1, 9, var4, 14, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, var4, 1, 8, var4, 2, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, var4, 14, 8, var4, 14, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 2, 1, 4, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 8, 1, 1, 9, 1, 4, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 1, 1, 1, 3, Blocks.flowing_lava, Blocks.flowing_lava, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 1, 1, 9, 1, 3, Blocks.flowing_lava, Blocks.flowing_lava, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 3, 1, 8, 7, 1, 12, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 9, 6, 1, 11, Blocks.flowing_lava, Blocks.flowing_lava, false); + int var5; + + for (var5 = 3; var5 < 14; var5 += 2) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 3, var5, 0, 4, var5, Blocks.iron_bars, Blocks.iron_bars, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 10, 3, var5, 10, 4, var5, Blocks.iron_bars, Blocks.iron_bars, false); + } + + for (var5 = 2; var5 < 9; var5 += 2) { + this.func_151549_a(p_74875_1_, p_74875_3_, var5, 3, 15, var5, 4, 15, Blocks.iron_bars, Blocks.iron_bars, false); + } + + var5 = this.func_151555_a(Blocks.stone_brick_stairs, 3); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 5, 6, 1, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 2, 6, 6, 2, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 3, 7, 6, 3, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + + for (int var6 = 4; var6 <= 6; ++var6) { + this.func_151550_a(p_74875_1_, Blocks.stone_brick_stairs, var5, var6, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_brick_stairs, var5, var6, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_brick_stairs, var5, var6, 3, 6, p_74875_3_); + } + + byte var14 = 2; + byte var7 = 0; + byte var8 = 3; + byte var9 = 1; + + switch (this.coordBaseMode) { + case 0: + var14 = 0; + var7 = 2; + break; + + case 1: + var14 = 1; + var7 = 3; + var8 = 0; + var9 = 2; + + case 2: + default: + break; + + case 3: + var14 = 3; + var7 = 1; + var8 = 0; + var9 = 2; + } + + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var14 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 4, 3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var14 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 5, 3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var14 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 6, 3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var7 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 4, 3, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var7 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 5, 3, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var7 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 6, 3, 12, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var8 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 3, 3, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var8 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 3, 3, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var8 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 3, 3, 11, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var9 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 7, 3, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var9 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 7, 3, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.end_portal_frame, var9 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 7, 3, 11, p_74875_3_); + + if (!this.hasSpawner) { + int var13 = this.getYWithOffset(3); + int var10 = this.getXWithOffset(5, 6); + int var11 = this.getZWithOffset(5, 6); + + if (p_74875_3_.isVecInside(var10, var13, var11)) { + this.hasSpawner = true; + p_74875_1_.setBlock(var10, var13, var11, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner var12 = (TileEntityMobSpawner)p_74875_1_.getTileEntity(var10, var13, var11); + + if (var12 != null) { + var12.func_145881_a().setMobID("Silverfish"); + } + } + } + + return true; + } + } + + public static class Prison extends StructureStrongholdPieces.Stronghold { + + + public Prison() {} + + public Prison(int p_i2078_1_, Random p_i2078_2_, StructureBoundingBox p_i2078_3_, int p_i2078_4_) { + super(p_i2078_1_); + this.coordBaseMode = p_i2078_4_; + this.field_143013_d = this.getRandomDoor(p_i2078_2_); + this.boundingBox = p_i2078_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + public static StructureStrongholdPieces.Prison findValidPlacement(List p_75016_0_, Random p_75016_1_, int p_75016_2_, int p_75016_3_, int p_75016_4_, int p_75016_5_, int p_75016_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75016_2_, p_75016_3_, p_75016_4_, -1, -1, 0, 9, 5, 11, p_75016_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75016_0_, var7) == null ? new StructureStrongholdPieces.Prison(p_75016_6_, p_75016_1_, var7, p_75016_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 8, 4, 10, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 10, 3, 3, 10, Blocks.air, Blocks.air, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 1, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 3, 4, 3, 3, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 7, 4, 3, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 9, 4, 3, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 4, 4, 3, 6, Blocks.iron_bars, Blocks.iron_bars, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 1, 5, 7, 3, 5, Blocks.iron_bars, Blocks.iron_bars, false); + this.func_151550_a(p_74875_1_, Blocks.iron_bars, 0, 4, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.iron_bars, 0, 4, 3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.iron_door, this.func_151555_a(Blocks.iron_door, 3), 4, 1, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.iron_door, this.func_151555_a(Blocks.iron_door, 3) + 8, 4, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.iron_door, this.func_151555_a(Blocks.iron_door, 3), 4, 1, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.iron_door, this.func_151555_a(Blocks.iron_door, 3) + 8, 4, 2, 8, p_74875_3_); + return true; + } + } + } + + public static class RightTurn extends StructureStrongholdPieces.LeftTurn { + + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } else { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 4, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.air, Blocks.air, false); + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 3, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } + + public static class RoomCrossing extends StructureStrongholdPieces.Stronghold { + private static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1)}; + protected int roomType; + + + public RoomCrossing() {} + + public RoomCrossing(int p_i2079_1_, Random p_i2079_2_, StructureBoundingBox p_i2079_3_, int p_i2079_4_) { + super(p_i2079_1_); + this.coordBaseMode = p_i2079_4_; + this.field_143013_d = this.getRandomDoor(p_i2079_2_); + this.boundingBox = p_i2079_3_; + this.roomType = p_i2079_2_.nextInt(5); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Type", this.roomType); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.roomType = p_143011_1_.getInteger("Type"); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 4, 1); + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 4); + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 4); + } + + public static StructureStrongholdPieces.RoomCrossing findValidPlacement(List p_75012_0_, Random p_75012_1_, int p_75012_2_, int p_75012_3_, int p_75012_4_, int p_75012_5_, int p_75012_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75012_2_, p_75012_3_, p_75012_4_, -4, -1, 0, 11, 7, 11, p_75012_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75012_0_, var7) == null ? new StructureStrongholdPieces.RoomCrossing(p_75012_6_, p_75012_1_, var7, p_75012_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 10, 6, 10, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 4, 1, 0); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 10, 6, 3, 10, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 4, 0, 3, 6, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 10, 1, 4, 10, 3, 6, Blocks.air, Blocks.air, false); + int var4; + + switch (this.roomType) { + case 0: + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 5, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 5, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 5, 3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 4, 3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 6, 3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 5, 3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 5, 3, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 4, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 4, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 4, 1, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 6, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 6, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 6, 1, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 5, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 5, 1, 6, p_74875_3_); + break; + + case 1: + for (var4 = 0; var4 < 5; ++var4) { + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3, 1, 3 + var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 7, 1, 3 + var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3 + var4, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3 + var4, 1, 7, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 5, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 5, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 5, 3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.flowing_water, 0, 5, 4, 5, p_74875_3_); + break; + + case 2: + for (var4 = 1; var4 <= 9; ++var4) { + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 1, 3, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 9, 3, var4, p_74875_3_); + } + + for (var4 = 1; var4 <= 9; ++var4) { + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, var4, 3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, var4, 3, 9, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 5, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 5, 1, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 5, 3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 5, 3, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 6, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 3, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 6, 3, 5, p_74875_3_); + + for (var4 = 1; var4 <= 3; ++var4) { + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, var4, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 6, var4, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, var4, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 6, var4, 6, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 5, 3, 5, p_74875_3_); + + for (var4 = 2; var4 <= 8; ++var4) { + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 2, 3, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 3, 3, var4, p_74875_3_); + + if (var4 <= 3 || var4 >= 7) { + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 4, 3, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 5, 3, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 6, 3, var4, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 7, 3, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 3, var4, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.ladder, this.func_151555_a(Blocks.ladder, 4), 9, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, this.func_151555_a(Blocks.ladder, 4), 9, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, this.func_151555_a(Blocks.ladder, 4), 9, 3, 3, p_74875_3_); + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, Items.enchanted_book.func_92114_b(p_74875_2_)), 1 + p_74875_2_.nextInt(4)); + } + + return true; + } + } + } + + public static class Stairs extends StructureStrongholdPieces.Stronghold { + private boolean field_75024_a; + + + public Stairs() {} + + public Stairs(int p_i2081_1_, Random p_i2081_2_, int p_i2081_3_, int p_i2081_4_) { + super(p_i2081_1_); + this.field_75024_a = true; + this.coordBaseMode = p_i2081_2_.nextInt(4); + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + + switch (this.coordBaseMode) { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1); + } + } + + public Stairs(int p_i2082_1_, Random p_i2082_2_, StructureBoundingBox p_i2082_3_, int p_i2082_4_) { + super(p_i2082_1_); + this.field_75024_a = false; + this.coordBaseMode = p_i2082_4_; + this.field_143013_d = this.getRandomDoor(p_i2082_2_); + this.boundingBox = p_i2082_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Source", this.field_75024_a); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.field_75024_a = p_143011_1_.getBoolean("Source"); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + if (this.field_75024_a) { + StructureStrongholdPieces.strongComponentType = StructureStrongholdPieces.Crossing.class; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + public static StructureStrongholdPieces.Stairs getStrongholdStairsComponent(List p_75022_0_, Random p_75022_1_, int p_75022_2_, int p_75022_3_, int p_75022_4_, int p_75022_5_, int p_75022_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75022_2_, p_75022_3_, p_75022_4_, -1, -7, 0, 5, 11, 5, p_75022_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75022_0_, var7) == null ? new StructureStrongholdPieces.Stairs(p_75022_6_, p_75022_1_, var7, p_75022_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 10, 4, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 7, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 4); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 2, 6, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 5, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 1, 6, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 5, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 1, 5, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 2, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3, 3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 3, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 3, 3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 2, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 1, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 1, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 1, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_slab, 0, 1, 1, 3, p_74875_3_); + return true; + } + } + } + + public static class Stairs2 extends StructureStrongholdPieces.Stairs { + public StructureStrongholdPieces.PieceWeight strongholdPieceWeight; + public StructureStrongholdPieces.PortalRoom strongholdPortalRoom; + public List field_75026_c = new ArrayList(); + + + public Stairs2() {} + + public Stairs2(int p_i2083_1_, Random p_i2083_2_, int p_i2083_3_, int p_i2083_4_) { + super(0, p_i2083_2_, p_i2083_3_, p_i2083_4_); + } + + public ChunkPosition func_151553_a() { + return this.strongholdPortalRoom != null ? this.strongholdPortalRoom.func_151553_a() : super.func_151553_a(); + } + } + + public static class StairsStraight extends StructureStrongholdPieces.Stronghold { + + + public StairsStraight() {} + + public StairsStraight(int p_i2085_1_, Random p_i2085_2_, StructureBoundingBox p_i2085_3_, int p_i2085_4_) { + super(p_i2085_1_); + this.coordBaseMode = p_i2085_4_; + this.field_143013_d = this.getRandomDoor(p_i2085_2_); + this.boundingBox = p_i2085_3_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + public static StructureStrongholdPieces.StairsStraight findValidPlacement(List p_75028_0_, Random p_75028_1_, int p_75028_2_, int p_75028_3_, int p_75028_4_, int p_75028_5_, int p_75028_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75028_2_, p_75028_3_, p_75028_4_, -1, -7, 0, 5, 11, 8, p_75028_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75028_0_, var7) == null ? new StructureStrongholdPieces.StairsStraight(p_75028_6_, p_75028_1_, var7, p_75028_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 10, 7, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 7, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 7); + int var4 = this.func_151555_a(Blocks.stone_stairs, 2); + + for (int var5 = 0; var5 < 6; ++var5) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 1, 6 - var5, 1 + var5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 2, 6 - var5, 1 + var5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, var4, 3, 6 - var5, 1 + var5, p_74875_3_); + + if (var5 < 5) { + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 1, 5 - var5, 1 + var5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 2, 5 - var5, 1 + var5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stonebrick, 0, 3, 5 - var5, 1 + var5, p_74875_3_); + } + } + + return true; + } + } + } + + static class Stones extends StructureComponent.BlockSelector { + + + private Stones() {} + + public void selectBlocks(Random p_75062_1_, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + if (p_75062_5_) { + this.field_151562_a = Blocks.stonebrick; + float var6 = p_75062_1_.nextFloat(); + + if (var6 < 0.2F) { + this.selectedBlockMetaData = 2; + } else if (var6 < 0.5F) { + this.selectedBlockMetaData = 1; + } else if (var6 < 0.55F) { + this.field_151562_a = Blocks.monster_egg; + this.selectedBlockMetaData = 2; + } else { + this.selectedBlockMetaData = 0; + } + } else { + this.field_151562_a = Blocks.air; + this.selectedBlockMetaData = 0; + } + } + + Stones(Object p_i2080_1_) { + this(); + } + } + + public static class Straight extends StructureStrongholdPieces.Stronghold { + private boolean expandsX; + private boolean expandsZ; + + + public Straight() {} + + public Straight(int p_i2084_1_, Random p_i2084_2_, StructureBoundingBox p_i2084_3_, int p_i2084_4_) { + super(p_i2084_1_); + this.coordBaseMode = p_i2084_4_; + this.field_143013_d = this.getRandomDoor(p_i2084_2_); + this.boundingBox = p_i2084_3_; + this.expandsX = p_i2084_2_.nextInt(2) == 0; + this.expandsZ = p_i2084_2_.nextInt(2) == 0; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Left", this.expandsX); + p_143012_1_.setBoolean("Right", this.expandsZ); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.expandsX = p_143011_1_.getBoolean("Left"); + this.expandsZ = p_143011_1_.getBoolean("Right"); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + + if (this.expandsX) { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 2); + } + + if (this.expandsZ) { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 2); + } + } + + public static StructureStrongholdPieces.Straight findValidPlacement(List p_75018_0_, Random p_75018_1_, int p_75018_2_, int p_75018_3_, int p_75018_4_, int p_75018_5_, int p_75018_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_75018_2_, p_75018_3_, p_75018_4_, -1, -1, 0, 5, 5, 7, p_75018_5_); + return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(p_75018_0_, var7) == null ? new StructureStrongholdPieces.Straight(p_75018_6_, p_75018_1_, var7, p_75018_5_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) { + return false; + } else { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 6, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 1, 2, 1, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 3, 2, 1, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 1, 2, 5, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 3, 2, 5, Blocks.torch, 0); + + if (this.expandsX) { + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 2, 0, 3, 4, Blocks.air, Blocks.air, false); + } + + if (this.expandsZ) { + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 2, 4, 3, 4, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } + + abstract static class Stronghold extends StructureComponent { + protected StructureStrongholdPieces.Stronghold.Door field_143013_d; + + + public Stronghold() { + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + } + + protected Stronghold(int p_i2087_1_) { + super(p_i2087_1_); + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + p_143012_1_.setString("EntryDoor", this.field_143013_d.name()); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.valueOf(p_143011_1_.getString("EntryDoor")); + } + + protected void placeDoor(World p_74990_1_, Random p_74990_2_, StructureBoundingBox p_74990_3_, StructureStrongholdPieces.Stronghold.Door p_74990_4_, int p_74990_5_, int p_74990_6_, int p_74990_7_) { + switch (StructureStrongholdPieces.SwitchDoor.doorEnum[p_74990_4_.ordinal()]) { + case 1: + default: + this.func_151549_a(p_74990_1_, p_74990_3_, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_5_ + 3 - 1, p_74990_6_ + 3 - 1, p_74990_7_, Blocks.air, Blocks.air, false); + break; + + case 2: + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.wooden_door, 0, p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.wooden_door, 8, p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + break; + + case 3: + this.func_151550_a(p_74990_1_, Blocks.air, 0, p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.air, 0, p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + break; + + case 4: + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_door, 0, p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.iron_door, 8, p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stone_button, this.func_151555_a(Blocks.stone_button, 4), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ + 1, p_74990_3_); + this.func_151550_a(p_74990_1_, Blocks.stone_button, this.func_151555_a(Blocks.stone_button, 3), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ - 1, p_74990_3_); + } + } + + protected StructureStrongholdPieces.Stronghold.Door getRandomDoor(Random p_74988_1_) { + int var2 = p_74988_1_.nextInt(5); + + switch (var2) { + case 0: + case 1: + default: + return StructureStrongholdPieces.Stronghold.Door.OPENING; + + case 2: + return StructureStrongholdPieces.Stronghold.Door.WOOD_DOOR; + + case 3: + return StructureStrongholdPieces.Stronghold.Door.GRATES; + + case 4: + return StructureStrongholdPieces.Stronghold.Door.IRON_DOOR; + } + } + + protected StructureComponent getNextComponentNormal(StructureStrongholdPieces.Stairs2 p_74986_1_, List p_74986_2_, Random p_74986_3_, int p_74986_4_, int p_74986_5_) { + switch (this.coordBaseMode) { + case 0: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); + + case 1: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType()); + + case 2: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); + + case 3: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType()); + + default: + return null; + } + } + + protected StructureComponent getNextComponentX(StructureStrongholdPieces.Stairs2 p_74989_1_, List p_74989_2_, Random p_74989_3_, int p_74989_4_, int p_74989_5_) { + switch (this.coordBaseMode) { + case 0: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, 1, this.getComponentType()); + + case 1: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + + case 2: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, 1, this.getComponentType()); + + case 3: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + + default: + return null; + } + } + + protected StructureComponent getNextComponentZ(StructureStrongholdPieces.Stairs2 p_74987_1_, List p_74987_2_, Random p_74987_3_, int p_74987_4_, int p_74987_5_) { + switch (this.coordBaseMode) { + case 0: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, 3, this.getComponentType()); + + case 1: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + + case 2: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, 3, this.getComponentType()); + + case 3: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + + default: + return null; + } + } + + protected static boolean canStrongholdGoDeeper(StructureBoundingBox p_74991_0_) { + return p_74991_0_ != null && p_74991_0_.minY > 10; + } + + public enum Door { + OPENING("OPENING", 0), + WOOD_DOOR("WOOD_DOOR", 1), + GRATES("GRATES", 2), + IRON_DOOR("IRON_DOOR", 3); + + private static final StructureStrongholdPieces.Stronghold.Door[] $VALUES = new StructureStrongholdPieces.Stronghold.Door[]{OPENING, WOOD_DOOR, GRATES, IRON_DOOR}; + + + Door(String p_i2086_1_, int p_i2086_2_) {} + } + } + + static final class SwitchDoor { + static final int[] doorEnum = new int[StructureStrongholdPieces.Stronghold.Door.values().length]; + + + static { + try { + doorEnum[StructureStrongholdPieces.Stronghold.Door.OPENING.ordinal()] = 1; + } catch (NoSuchFieldError var4) { + } + + try { + doorEnum[StructureStrongholdPieces.Stronghold.Door.WOOD_DOOR.ordinal()] = 2; + } catch (NoSuchFieldError var3) { + } + + try { + doorEnum[StructureStrongholdPieces.Stronghold.Door.GRATES.ordinal()] = 3; + } catch (NoSuchFieldError var2) { + } + + try { + doorEnum[StructureStrongholdPieces.Stronghold.Door.IRON_DOOR.ordinal()] = 4; + } catch (NoSuchFieldError var1) { + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java new file mode 100644 index 0000000..90221ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java @@ -0,0 +1,1649 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; + +public class StructureVillagePieces { + + + public static void func_143016_a() { + MapGenStructureIO.func_143031_a(StructureVillagePieces.House1.class, "ViBH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Field1.class, "ViDF"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Field2.class, "ViF"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Torch.class, "ViL"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Hall.class, "ViPH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.House4Garden.class, "ViSH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.WoodHut.class, "ViSmH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Church.class, "ViST"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.House2.class, "ViS"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Start.class, "ViStart"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Path.class, "ViSR"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.House3.class, "ViTRH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Well.class, "ViW"); + } + + public static List getStructureVillageWeightedPieceList(Random p_75084_0_, int p_75084_1_) { + ArrayList var2 = new ArrayList(); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House4Garden.class, 4, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Church.class, 20, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 1 + p_75084_1_))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House1.class, 20, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 2 + p_75084_1_))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.WoodHut.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 5 + p_75084_1_ * 3))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Hall.class, 15, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 2 + p_75084_1_))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field1.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 1 + p_75084_1_, 4 + p_75084_1_))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.getRandomIntegerInRange(p_75084_0_, 0, 1 + p_75084_1_))); + var2.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); + Iterator var3 = var2.iterator(); + + while (var3.hasNext()) { + if (((StructureVillagePieces.PieceWeight)var3.next()).villagePiecesLimit == 0) { + var3.remove(); + } + } + + return var2; + } + + private static int func_75079_a(List p_75079_0_) { + boolean var1 = false; + int var2 = 0; + StructureVillagePieces.PieceWeight var4; + + for (Iterator var3 = p_75079_0_.iterator(); var3.hasNext(); var2 += var4.villagePieceWeight) { + var4 = (StructureVillagePieces.PieceWeight)var3.next(); + + if (var4.villagePiecesLimit > 0 && var4.villagePiecesSpawned < var4.villagePiecesLimit) { + var1 = true; + } + } + + return var1 ? var2 : -1; + } + + private static StructureVillagePieces.Village func_75083_a(StructureVillagePieces.Start p_75083_0_, StructureVillagePieces.PieceWeight p_75083_1_, List p_75083_2_, Random p_75083_3_, int p_75083_4_, int p_75083_5_, int p_75083_6_, int p_75083_7_, int p_75083_8_) { + Class var9 = p_75083_1_.villagePieceClass; + Object var10 = null; + + if (var9 == StructureVillagePieces.House4Garden.class) { + var10 = StructureVillagePieces.House4Garden.func_74912_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.Church.class) { + var10 = StructureVillagePieces.Church.func_74919_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.House1.class) { + var10 = StructureVillagePieces.House1.func_74898_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.WoodHut.class) { + var10 = StructureVillagePieces.WoodHut.func_74908_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.Hall.class) { + var10 = StructureVillagePieces.Hall.func_74906_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.Field1.class) { + var10 = StructureVillagePieces.Field1.func_74900_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.Field2.class) { + var10 = StructureVillagePieces.Field2.func_74902_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.House2.class) { + var10 = StructureVillagePieces.House2.func_74915_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } else if (var9 == StructureVillagePieces.House3.class) { + var10 = StructureVillagePieces.House3.func_74921_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + + return (StructureVillagePieces.Village)var10; + } + + /** + * attempts to find a next Village Component to be spawned + */ + private static StructureVillagePieces.Village getNextVillageComponent(StructureVillagePieces.Start p_75081_0_, List p_75081_1_, Random p_75081_2_, int p_75081_3_, int p_75081_4_, int p_75081_5_, int p_75081_6_, int p_75081_7_) { + int var8 = func_75079_a(p_75081_0_.structureVillageWeightedPieceList); + + if (var8 <= 0) { + return null; + } else { + int var9 = 0; + + while (var9 < 5) { + ++var9; + int var10 = p_75081_2_.nextInt(var8); + Iterator var11 = p_75081_0_.structureVillageWeightedPieceList.iterator(); + + while (var11.hasNext()) { + StructureVillagePieces.PieceWeight var12 = (StructureVillagePieces.PieceWeight)var11.next(); + var10 -= var12.villagePieceWeight; + + if (var10 < 0) { + if (!var12.canSpawnMoreVillagePiecesOfType(p_75081_7_) || var12 == p_75081_0_.structVillagePieceWeight && p_75081_0_.structureVillageWeightedPieceList.size() > 1) { + break; + } + + StructureVillagePieces.Village var13 = func_75083_a(p_75081_0_, var12, p_75081_1_, p_75081_2_, p_75081_3_, p_75081_4_, p_75081_5_, p_75081_6_, p_75081_7_); + + if (var13 != null) { + ++var12.villagePiecesSpawned; + p_75081_0_.structVillagePieceWeight = var12; + + if (!var12.canSpawnMoreVillagePieces()) { + p_75081_0_.structureVillageWeightedPieceList.remove(var12); + } + + return var13; + } + } + } + } + + StructureBoundingBox var14 = StructureVillagePieces.Torch.func_74904_a(p_75081_0_, p_75081_1_, p_75081_2_, p_75081_3_, p_75081_4_, p_75081_5_, p_75081_6_); + + if (var14 != null) { + return new StructureVillagePieces.Torch(p_75081_0_, p_75081_7_, p_75081_2_, var14, p_75081_6_); + } else { + return null; + } + } + } + + /** + * attempts to find a next Structure Component to be spawned, private Village function + */ + private static StructureComponent getNextVillageStructureComponent(StructureVillagePieces.Start p_75077_0_, List p_75077_1_, Random p_75077_2_, int p_75077_3_, int p_75077_4_, int p_75077_5_, int p_75077_6_, int p_75077_7_) { + if (p_75077_7_ > 50) { + return null; + } else if (Math.abs(p_75077_3_ - p_75077_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75077_5_ - p_75077_0_.getBoundingBox().minZ) <= 112) { + StructureVillagePieces.Village var8 = getNextVillageComponent(p_75077_0_, p_75077_1_, p_75077_2_, p_75077_3_, p_75077_4_, p_75077_5_, p_75077_6_, p_75077_7_ + 1); + + if (var8 != null) { + int var9 = (var8.boundingBox.minX + var8.boundingBox.maxX) / 2; + int var10 = (var8.boundingBox.minZ + var8.boundingBox.maxZ) / 2; + int var11 = var8.boundingBox.maxX - var8.boundingBox.minX; + int var12 = var8.boundingBox.maxZ - var8.boundingBox.minZ; + int var13 = var11 > var12 ? var11 : var12; + + if (p_75077_0_.getWorldChunkManager().areBiomesViable(var9, var10, var13 / 2 + 4, MapGenVillage.villageSpawnBiomes)) { + p_75077_1_.add(var8); + p_75077_0_.field_74932_i.add(var8); + return var8; + } + } + + return null; + } else { + return null; + } + } + + private static StructureComponent getNextComponentVillagePath(StructureVillagePieces.Start p_75080_0_, List p_75080_1_, Random p_75080_2_, int p_75080_3_, int p_75080_4_, int p_75080_5_, int p_75080_6_, int p_75080_7_) { + if (p_75080_7_ > 3 + p_75080_0_.terrainType) { + return null; + } else if (Math.abs(p_75080_3_ - p_75080_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75080_5_ - p_75080_0_.getBoundingBox().minZ) <= 112) { + StructureBoundingBox var8 = StructureVillagePieces.Path.func_74933_a(p_75080_0_, p_75080_1_, p_75080_2_, p_75080_3_, p_75080_4_, p_75080_5_, p_75080_6_); + + if (var8 != null && var8.minY > 10) { + StructureVillagePieces.Path var9 = new StructureVillagePieces.Path(p_75080_0_, p_75080_7_, p_75080_2_, var8, p_75080_6_); + int var10 = (var9.boundingBox.minX + var9.boundingBox.maxX) / 2; + int var11 = (var9.boundingBox.minZ + var9.boundingBox.maxZ) / 2; + int var12 = var9.boundingBox.maxX - var9.boundingBox.minX; + int var13 = var9.boundingBox.maxZ - var9.boundingBox.minZ; + int var14 = var12 > var13 ? var12 : var13; + + if (p_75080_0_.getWorldChunkManager().areBiomesViable(var10, var11, var14 / 2 + 4, MapGenVillage.villageSpawnBiomes)) { + p_75080_1_.add(var9); + p_75080_0_.field_74930_j.add(var9); + return var9; + } + } + + return null; + } else { + return null; + } + } + + public static class Church extends StructureVillagePieces.Village { + + + public Church() {} + + public Church(StructureVillagePieces.Start p_i2102_1_, int p_i2102_2_, Random p_i2102_3_, StructureBoundingBox p_i2102_4_, int p_i2102_5_) { + super(p_i2102_1_, p_i2102_2_); + this.coordBaseMode = p_i2102_5_; + this.boundingBox = p_i2102_4_; + } + + public static StructureVillagePieces.Church func_74919_a(StructureVillagePieces.Start p_74919_0_, List p_74919_1_, Random p_74919_2_, int p_74919_3_, int p_74919_4_, int p_74919_5_, int p_74919_6_, int p_74919_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74919_3_, p_74919_4_, p_74919_5_, 0, 0, 0, 5, 12, 9, p_74919_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74919_1_, var8) == null ? new StructureVillagePieces.Church(p_74919_0_, p_74919_7_, p_74919_2_, var8, p_74919_6_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 12 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 1, 3, 3, 7, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 1, 3, 9, 3, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 0, 3, 0, 8, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 0, 3, 10, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 10, 3, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 10, 3, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 4, 0, 4, 7, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 0, 4, 4, 4, 7, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 8, 3, 4, 8, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 4, 3, 10, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 5, 3, 5, 7, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 9, 0, 4, 9, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 4, 0, 4, 4, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 0, 11, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 11, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 2, 11, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 2, 11, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 1, 1, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 1, 1, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 2, 1, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 3, 1, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 3, 1, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 1, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 2, 1, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 3, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 1), 1, 2, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 0), 3, 2, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 6, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 7, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 6, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 7, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 6, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 7, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 6, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 7, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 3, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 3, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 2, 4, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 1, 4, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 3, 4, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 2, 4, 5, p_74875_3_); + int var4 = this.func_151555_a(Blocks.ladder, 4); + int var5; + + for (var5 = 1; var5 <= 9; ++var5) { + this.func_151550_a(p_74875_1_, Blocks.ladder, var4, 3, var5, 3, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 2, 0, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 2, 1, 0, this.func_151555_a(Blocks.wooden_door, 1)); + + if (this.func_151548_a(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.func_151548_a(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + for (var5 = 0; var5 < 9; ++var5) { + for (int var6 = 0; var6 < 5; ++var6) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var6, 12, var5, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var6, -1, var5, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 2, 1, 2, 1); + return true; + } + + protected int getVillagerType(int p_74888_1_) { + return 2; + } + } + + public static class Field1 extends StructureVillagePieces.Village { + private Block cropTypeA; + private Block cropTypeB; + private Block cropTypeC; + private Block cropTypeD; + + + public Field1() {} + + public Field1(StructureVillagePieces.Start p_i2095_1_, int p_i2095_2_, Random p_i2095_3_, StructureBoundingBox p_i2095_4_, int p_i2095_5_) { + super(p_i2095_1_, p_i2095_2_); + this.coordBaseMode = p_i2095_5_; + this.boundingBox = p_i2095_4_; + this.cropTypeA = this.func_151559_a(p_i2095_3_); + this.cropTypeB = this.func_151559_a(p_i2095_3_); + this.cropTypeC = this.func_151559_a(p_i2095_3_); + this.cropTypeD = this.func_151559_a(p_i2095_3_); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + p_143012_1_.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + p_143012_1_.setInteger("CC", Block.blockRegistry.getIDForObject(this.cropTypeC)); + p_143012_1_.setInteger("CD", Block.blockRegistry.getIDForObject(this.cropTypeD)); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.cropTypeA = Block.getBlockById(p_143011_1_.getInteger("CA")); + this.cropTypeB = Block.getBlockById(p_143011_1_.getInteger("CB")); + this.cropTypeC = Block.getBlockById(p_143011_1_.getInteger("CC")); + this.cropTypeD = Block.getBlockById(p_143011_1_.getInteger("CD")); + } + + private Block func_151559_a(Random p_151559_1_) { + switch (p_151559_1_.nextInt(5)) { + case 0: + return Blocks.carrots; + + case 1: + return Blocks.potatoes; + + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field1 func_74900_a(StructureVillagePieces.Start p_74900_0_, List p_74900_1_, Random p_74900_2_, int p_74900_3_, int p_74900_4_, int p_74900_5_, int p_74900_6_, int p_74900_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74900_3_, p_74900_4_, p_74900_5_, 0, 0, 0, 13, 4, 9, p_74900_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74900_1_, var8) == null ? new StructureVillagePieces.Field1(p_74900_0_, p_74900_7_, p_74900_2_, var8, p_74900_6_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 0, 12, 4, 8, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 1, 2, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 0, 1, 5, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 0, 1, 8, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 10, 0, 1, 11, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 0, 8, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 0, 0, 6, 0, 8, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 12, 0, 0, 12, 0, 8, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 0, 11, 0, 0, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 8, 11, 0, 8, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 0, 1, 3, 0, 7, Blocks.water, Blocks.water, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 0, 1, 9, 0, 7, Blocks.water, Blocks.water, false); + int var4; + + for (var4 = 1; var4 <= 7; ++var4) { + this.func_151550_a(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 1, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 2, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 4, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 5, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeC, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 7, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeC, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 8, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeD, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 10, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeD, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 11, 1, var4, p_74875_3_); + } + + for (var4 = 0; var4 < 9; ++var4) { + for (int var5 = 0; var5 < 13; ++var5) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var5, 4, var4, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.dirt, 0, var5, -1, var4, p_74875_3_); + } + } + + return true; + } + } + + public static class Field2 extends StructureVillagePieces.Village { + private Block cropTypeA; + private Block cropTypeB; + + + public Field2() {} + + public Field2(StructureVillagePieces.Start p_i2096_1_, int p_i2096_2_, Random p_i2096_3_, StructureBoundingBox p_i2096_4_, int p_i2096_5_) { + super(p_i2096_1_, p_i2096_2_); + this.coordBaseMode = p_i2096_5_; + this.boundingBox = p_i2096_4_; + this.cropTypeA = this.func_151560_a(p_i2096_3_); + this.cropTypeB = this.func_151560_a(p_i2096_3_); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + p_143012_1_.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.cropTypeA = Block.getBlockById(p_143011_1_.getInteger("CA")); + this.cropTypeB = Block.getBlockById(p_143011_1_.getInteger("CB")); + } + + private Block func_151560_a(Random p_151560_1_) { + switch (p_151560_1_.nextInt(5)) { + case 0: + return Blocks.carrots; + + case 1: + return Blocks.potatoes; + + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field2 func_74902_a(StructureVillagePieces.Start p_74902_0_, List p_74902_1_, Random p_74902_2_, int p_74902_3_, int p_74902_4_, int p_74902_5_, int p_74902_6_, int p_74902_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74902_3_, p_74902_4_, p_74902_5_, 0, 0, 0, 7, 4, 9, p_74902_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74902_1_, var8) == null ? new StructureVillagePieces.Field2(p_74902_0_, p_74902_7_, p_74902_2_, var8, p_74902_6_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 0, 6, 4, 8, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 1, 2, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 0, 1, 5, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 0, 8, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 0, 0, 6, 0, 8, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 0, 5, 0, 0, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 8, 5, 0, 8, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 0, 1, 3, 0, 7, Blocks.water, Blocks.water, false); + int var4; + + for (var4 = 1; var4 <= 7; ++var4) { + this.func_151550_a(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 1, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 2, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 4, 1, var4, p_74875_3_); + this.func_151550_a(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 5, 1, var4, p_74875_3_); + } + + for (var4 = 0; var4 < 9; ++var4) { + for (int var5 = 0; var5 < 7; ++var5) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var5, 4, var4, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.dirt, 0, var5, -1, var4, p_74875_3_); + } + } + + return true; + } + } + + public static class Hall extends StructureVillagePieces.Village { + + + public Hall() {} + + public Hall(StructureVillagePieces.Start p_i2099_1_, int p_i2099_2_, Random p_i2099_3_, StructureBoundingBox p_i2099_4_, int p_i2099_5_) { + super(p_i2099_1_, p_i2099_2_); + this.coordBaseMode = p_i2099_5_; + this.boundingBox = p_i2099_4_; + } + + public static StructureVillagePieces.Hall func_74906_a(StructureVillagePieces.Start p_74906_0_, List p_74906_1_, Random p_74906_2_, int p_74906_3_, int p_74906_4_, int p_74906_5_, int p_74906_6_, int p_74906_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74906_3_, p_74906_4_, p_74906_5_, 0, 0, 0, 9, 7, 11, p_74906_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74906_1_, var8) == null ? new StructureVillagePieces.Hall(p_74906_0_, p_74906_7_, p_74906_2_, var8, p_74906_6_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 1, 7, 4, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 1, 6, 8, 4, 10, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 0, 6, 8, 0, 10, Blocks.dirt, Blocks.dirt, false); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 6, 0, 6, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 1, 6, 2, 1, 10, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 1, 6, 8, 1, 10, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 10, 7, 1, 10, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 1, 7, 0, 4, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 3, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 0, 0, 8, 3, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 0, 7, 1, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 5, 7, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 5, 7, 3, 5, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 4, 1, 8, 4, 1, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 4, 4, 8, 4, 4, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 2, 8, 5, 3, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 0, 4, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 0, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 4, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 4, 3, p_74875_3_); + int var4 = this.func_151555_a(Blocks.oak_stairs, 3); + int var5 = this.func_151555_a(Blocks.oak_stairs, 2); + int var6; + int var7; + + for (var6 = -1; var6 <= 2; ++var6) { + for (var7 = 0; var7 <= 8; ++var7) { + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var4, var7, 4 + var6, var6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var5, var7, 4 + var6, 5 - var6, p_74875_3_); + } + } + + this.func_151550_a(p_74875_1_, Blocks.log, 0, 0, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 0, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 8, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 8, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 3, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 6, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 2, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wooden_pressure_plate, 0, 2, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 1, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, this.func_151555_a(Blocks.oak_stairs, 3), 2, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, this.func_151555_a(Blocks.oak_stairs, 1), 1, 1, 3, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 0, 1, 7, 0, 3, Blocks.double_stone_slab, Blocks.double_stone_slab, false); + this.func_151550_a(p_74875_1_, Blocks.double_stone_slab, 0, 6, 1, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.double_stone_slab, 0, 6, 1, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 2, 3, 1, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 2, 1, 0, this.func_151555_a(Blocks.wooden_door, 1)); + + if (this.func_151548_a(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.func_151548_a(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.air, 0, 6, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 6, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 6, 3, 4, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 6, 1, 5, this.func_151555_a(Blocks.wooden_door, 1)); + + for (var6 = 0; var6 < 5; ++var6) { + for (var7 = 0; var7 < 9; ++var7) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var7, 7, var6, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var7, -1, var6, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 4, 1, 2, 2); + return true; + } + + protected int getVillagerType(int p_74888_1_) { + return p_74888_1_ == 0 ? 4 : 0; + } + } + + public static class House1 extends StructureVillagePieces.Village { + + + public House1() {} + + public House1(StructureVillagePieces.Start p_i2094_1_, int p_i2094_2_, Random p_i2094_3_, StructureBoundingBox p_i2094_4_, int p_i2094_5_) { + super(p_i2094_1_, p_i2094_2_); + this.coordBaseMode = p_i2094_5_; + this.boundingBox = p_i2094_4_; + } + + public static StructureVillagePieces.House1 func_74898_a(StructureVillagePieces.Start p_74898_0_, List p_74898_1_, Random p_74898_2_, int p_74898_3_, int p_74898_4_, int p_74898_5_, int p_74898_6_, int p_74898_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74898_3_, p_74898_4_, p_74898_5_, 0, 0, 0, 9, 9, 6, p_74898_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74898_1_, var8) == null ? new StructureVillagePieces.House1(p_74898_0_, p_74898_7_, p_74898_2_, var8, p_74898_6_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 9 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 1, 7, 5, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 8, 0, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 8, 5, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 6, 1, 8, 6, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 7, 2, 8, 7, 3, Blocks.cobblestone, Blocks.cobblestone, false); + int var4 = this.func_151555_a(Blocks.oak_stairs, 3); + int var5 = this.func_151555_a(Blocks.oak_stairs, 2); + int var6; + int var7; + + for (var6 = -1; var6 <= 2; ++var6) { + for (var7 = 0; var7 <= 8; ++var7) { + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var4, var7, 6 + var6, var6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var5, var7, 6 + var6, 5 - var6, p_74875_3_); + } + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 0, 0, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 5, 8, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 1, 0, 8, 1, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 1, 0, 7, 1, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 4, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 5, 0, 4, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 2, 5, 8, 4, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 2, 0, 8, 4, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 2, 1, 0, 4, 4, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 5, 7, 4, 5, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 2, 1, 8, 4, 4, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 0, 7, 4, 0, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 6, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 5, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 6, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 3, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 3, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 6, 2, 5, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 4, 1, 7, 4, 1, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 4, 4, 7, 4, 4, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 3, 4, 7, 3, 4, Blocks.bookshelf, Blocks.bookshelf, false); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 7, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, this.func_151555_a(Blocks.oak_stairs, 0), 7, 1, 3, p_74875_3_); + var6 = this.func_151555_a(Blocks.oak_stairs, 3); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var6, 6, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var6, 5, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var6, 4, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var6, 3, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 6, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wooden_pressure_plate, 0, 6, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wooden_pressure_plate, 0, 4, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.crafting_table, 0, 7, 1, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, 2, 0, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 1, 1, 0, this.func_151555_a(Blocks.wooden_door, 1)); + + if (this.func_151548_a(p_74875_1_, 1, 0, -1, p_74875_3_).getMaterial() == Material.air && this.func_151548_a(p_74875_1_, 1, -1, -1, p_74875_3_).getMaterial() != Material.air) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 1, 0, -1, p_74875_3_); + } + + for (var7 = 0; var7 < 6; ++var7) { + for (int var8 = 0; var8 < 9; ++var8) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var8, 9, var7, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var8, -1, var7, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 2, 1, 2, 1); + return true; + } + + protected int getVillagerType(int p_74888_1_) { + return 1; + } + } + + public static class House2 extends StructureVillagePieces.Village { + private static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 3, 7, 5), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + private boolean hasMadeChest; + + + public House2() {} + + public House2(StructureVillagePieces.Start p_i2103_1_, int p_i2103_2_, Random p_i2103_3_, StructureBoundingBox p_i2103_4_, int p_i2103_5_) { + super(p_i2103_1_, p_i2103_2_); + this.coordBaseMode = p_i2103_5_; + this.boundingBox = p_i2103_4_; + } + + public static StructureVillagePieces.House2 func_74915_a(StructureVillagePieces.Start p_74915_0_, List p_74915_1_, Random p_74915_2_, int p_74915_3_, int p_74915_4_, int p_74915_5_, int p_74915_6_, int p_74915_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74915_3_, p_74915_4_, p_74915_5_, 0, 0, 0, 10, 6, 7, p_74915_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74915_1_, var8) == null ? new StructureVillagePieces.House2(p_74915_0_, p_74915_7_, p_74915_2_, var8, p_74915_6_) : null; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.hasMadeChest); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.hasMadeChest = p_143011_1_.getBoolean("Chest"); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 0, 9, 4, 6, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 9, 0, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 4, 0, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 0, 9, 5, 6, Blocks.stone_slab, Blocks.stone_slab, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 1, 8, 5, 5, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 0, 2, 3, 0, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 0, 0, 4, 0, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 0, 3, 4, 0, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 6, 0, 4, 6, Blocks.log, Blocks.log, false); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 3, 3, 1, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 2, 3, 3, 2, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 3, 5, 3, 3, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 5, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 6, 5, 3, 6, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 1, 0, 5, 3, 0, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 9, 1, 0, 9, 3, 0, Blocks.fence, Blocks.fence, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 1, 4, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151550_a(p_74875_1_, Blocks.flowing_lava, 0, 7, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.flowing_lava, 0, 8, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.iron_bars, 0, 9, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.iron_bars, 0, 9, 2, 4, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 2, 4, 8, 2, 5, Blocks.air, Blocks.air, false); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 6, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.furnace, 0, 6, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.furnace, 0, 6, 3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.double_stone_slab, 0, 8, 1, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 2, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wooden_pressure_plate, 0, 2, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 1, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, this.func_151555_a(Blocks.oak_stairs, 3), 2, 1, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, this.func_151555_a(Blocks.oak_stairs, 1), 1, 1, 4, p_74875_3_); + int var4; + int var5; + + if (!this.hasMadeChest) { + var4 = this.getYWithOffset(1); + var5 = this.getXWithOffset(5, 5); + int var6 = this.getZWithOffset(5, 5); + + if (p_74875_3_.isVecInside(var5, var4, var6)) { + this.hasMadeChest = true; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, villageBlacksmithChestContents, 3 + p_74875_2_.nextInt(6)); + } + } + + for (var4 = 6; var4 <= 8; ++var4) { + if (this.func_151548_a(p_74875_1_, var4, 0, -1, p_74875_3_).getMaterial() == Material.air && this.func_151548_a(p_74875_1_, var4, -1, -1, p_74875_3_).getMaterial() != Material.air) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), var4, 0, -1, p_74875_3_); + } + } + + for (var4 = 0; var4 < 7; ++var4) { + for (var5 = 0; var5 < 10; ++var5) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var5, 6, var4, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var5, -1, var4, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 7, 1, 1, 1); + return true; + } + + protected int getVillagerType(int p_74888_1_) { + return 3; + } + } + + public static class House3 extends StructureVillagePieces.Village { + + + public House3() {} + + public House3(StructureVillagePieces.Start p_i2106_1_, int p_i2106_2_, Random p_i2106_3_, StructureBoundingBox p_i2106_4_, int p_i2106_5_) { + super(p_i2106_1_, p_i2106_2_); + this.coordBaseMode = p_i2106_5_; + this.boundingBox = p_i2106_4_; + } + + public static StructureVillagePieces.House3 func_74921_a(StructureVillagePieces.Start p_74921_0_, List p_74921_1_, Random p_74921_2_, int p_74921_3_, int p_74921_4_, int p_74921_5_, int p_74921_6_, int p_74921_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74921_3_, p_74921_4_, p_74921_5_, 0, 0, 0, 9, 7, 12, p_74921_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74921_1_, var8) == null ? new StructureVillagePieces.House3(p_74921_0_, p_74921_7_, p_74921_2_, var8, p_74921_6_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 1, 7, 4, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 1, 6, 8, 4, 10, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 0, 5, 8, 0, 10, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 1, 7, 0, 4, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 3, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 8, 0, 0, 8, 3, 10, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 0, 7, 2, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 5, 2, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 2, 0, 6, 2, 3, 10, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 0, 10, 7, 3, 10, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 2, 5, 2, 3, 5, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 4, 1, 8, 4, 1, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 4, 4, 3, 4, 4, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 5, 2, 8, 5, 3, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 0, 4, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 0, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 4, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 4, 4, p_74875_3_); + int var4 = this.func_151555_a(Blocks.oak_stairs, 3); + int var5 = this.func_151555_a(Blocks.oak_stairs, 2); + int var6; + int var7; + + for (var6 = -1; var6 <= 2; ++var6) { + for (var7 = 0; var7 <= 8; ++var7) { + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var4, var7, 4 + var6, var6, p_74875_3_); + + if ((var6 > -1 || var7 <= 1) && (var6 > 0 || var7 <= 3) && (var6 > 1 || var7 <= 4 || var7 >= 6)) { + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var5, var7, 4 + var6, 5 - var6, p_74875_3_); + } + } + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 4, 5, 3, 4, 10, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 7, 4, 2, 7, 4, 10, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 5, 4, 4, 5, 10, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 6, 5, 4, 6, 5, 10, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 5, 6, 3, 5, 6, 10, Blocks.planks, Blocks.planks, false); + var6 = this.func_151555_a(Blocks.oak_stairs, 0); + int var8; + + for (var7 = 4; var7 >= 1; --var7) { + this.func_151550_a(p_74875_1_, Blocks.planks, 0, var7, 2 + var7, 7 - var7, p_74875_3_); + + for (var8 = 8 - var7; var8 <= 10; ++var8) { + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var6, var7, 2 + var7, var8, p_74875_3_); + } + } + + var7 = this.func_151555_a(Blocks.oak_stairs, 1); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 6, 6, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 7, 5, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var7, 6, 6, 4, p_74875_3_); + int var9; + + for (var8 = 6; var8 <= 8; ++var8) { + for (var9 = 5; var9 <= 10; ++var9) { + this.func_151550_a(p_74875_1_, Blocks.oak_stairs, var7, var8, 12 - var8, var9, p_74875_3_); + } + } + + this.func_151550_a(p_74875_1_, Blocks.log, 0, 0, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 0, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 4, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 6, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 8, 2, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 8, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 8, 2, 5, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 8, 2, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 8, 2, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 2, 2, 6, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 7, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 8, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 2, 2, 9, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 4, 4, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 5, 4, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 6, 4, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 5, 5, 10, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 2, 3, 1, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 2, 1, 0, this.func_151555_a(Blocks.wooden_door, 1)); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, -1, 3, 2, -1, Blocks.air, Blocks.air, false); + + if (this.func_151548_a(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.func_151548_a(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + for (var8 = 0; var8 < 5; ++var8) { + for (var9 = 0; var9 < 9; ++var9) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var9, 7, var8, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var9, -1, var8, p_74875_3_); + } + } + + for (var8 = 5; var8 < 11; ++var8) { + for (var9 = 2; var9 < 9; ++var9) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var9, 7, var8, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var9, -1, var8, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 4, 1, 2, 2); + return true; + } + } + + public static class House4Garden extends StructureVillagePieces.Village { + private boolean isRoofAccessible; + + + public House4Garden() {} + + public House4Garden(StructureVillagePieces.Start p_i2100_1_, int p_i2100_2_, Random p_i2100_3_, StructureBoundingBox p_i2100_4_, int p_i2100_5_) { + super(p_i2100_1_, p_i2100_2_); + this.coordBaseMode = p_i2100_5_; + this.boundingBox = p_i2100_4_; + this.isRoofAccessible = p_i2100_3_.nextBoolean(); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Terrace", this.isRoofAccessible); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.isRoofAccessible = p_143011_1_.getBoolean("Terrace"); + } + + public static StructureVillagePieces.House4Garden func_74912_a(StructureVillagePieces.Start p_74912_0_, List p_74912_1_, Random p_74912_2_, int p_74912_3_, int p_74912_4_, int p_74912_5_, int p_74912_6_, int p_74912_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74912_3_, p_74912_4_, p_74912_5_, 0, 0, 0, 5, 6, 5, p_74912_6_); + return StructureComponent.findIntersecting(p_74912_1_, var8) != null ? null : new StructureVillagePieces.House4Garden(p_74912_0_, p_74912_7_, p_74912_2_, var8, p_74912_6_); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 0, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 4, 0, 4, 4, 4, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 4, 1, 3, 4, 3, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 0, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 0, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 0, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 0, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 0, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 0, 3, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 1, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.cobblestone, 0, 4, 3, 4, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 3, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 4, 3, 3, 4, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 1, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 1, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 1, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 2, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 3, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 3, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.planks, 0, 3, 1, 0, p_74875_3_); + + if (this.func_151548_a(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.func_151548_a(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 1, 3, 3, 3, Blocks.air, Blocks.air, false); + + if (this.isRoofAccessible) { + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 0, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 2, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 3, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 5, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 0, 5, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 5, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 2, 5, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 3, 5, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 5, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 5, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 5, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 5, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 0, 5, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 0, 5, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 0, 5, 3, p_74875_3_); + } + + int var4; + + if (this.isRoofAccessible) { + var4 = this.func_151555_a(Blocks.ladder, 3); + this.func_151550_a(p_74875_1_, Blocks.ladder, var4, 3, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var4, 3, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var4, 3, 3, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.ladder, var4, 3, 4, 3, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 2, 3, 1, p_74875_3_); + + for (var4 = 0; var4 < 5; ++var4) { + for (int var5 = 0; var5 < 5; ++var5) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var5, 6, var4, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var5, -1, var4, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 1, 1, 2, 1); + return true; + } + } + + public static class Path extends StructureVillagePieces.Road { + private int averageGroundLevel; + + + public Path() {} + + public Path(StructureVillagePieces.Start p_i2105_1_, int p_i2105_2_, Random p_i2105_3_, StructureBoundingBox p_i2105_4_, int p_i2105_5_) { + super(p_i2105_1_, p_i2105_2_); + this.coordBaseMode = p_i2105_5_; + this.boundingBox = p_i2105_4_; + this.averageGroundLevel = Math.max(p_i2105_4_.getXSize(), p_i2105_4_.getZSize()); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Length", this.averageGroundLevel); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.averageGroundLevel = p_143011_1_.getInteger("Length"); + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + boolean var4 = false; + int var5; + StructureComponent var6; + + for (var5 = p_74861_3_.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + p_74861_3_.nextInt(5)) { + var6 = this.getNextComponentNN((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, var5); + + if (var6 != null) { + var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); + var4 = true; + } + } + + for (var5 = p_74861_3_.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + p_74861_3_.nextInt(5)) { + var6 = this.getNextComponentPP((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, var5); + + if (var6 != null) { + var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); + var4 = true; + } + } + + if (var4 && p_74861_3_.nextInt(3) > 0) { + switch (this.coordBaseMode) { + case 0: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 1, this.getComponentType()); + break; + + case 1: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); + break; + + case 2: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, this.getComponentType()); + break; + + case 3: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); + } + } + + if (var4 && p_74861_3_.nextInt(3) > 0) { + switch (this.coordBaseMode) { + case 0: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 3, this.getComponentType()); + break; + + case 1: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + break; + + case 2: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, this.getComponentType()); + break; + + case 3: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + } + } + } + + public static StructureBoundingBox func_74933_a(StructureVillagePieces.Start p_74933_0_, List p_74933_1_, Random p_74933_2_, int p_74933_3_, int p_74933_4_, int p_74933_5_, int p_74933_6_) { + for (int var7 = 7 * MathHelper.getRandomIntegerInRange(p_74933_2_, 3, 5); var7 >= 7; var7 -= 7) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74933_3_, p_74933_4_, p_74933_5_, 0, 0, 0, 3, 3, var7, p_74933_6_); + + if (StructureComponent.findIntersecting(p_74933_1_, var8) == null) { + return var8; + } + } + + return null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + Block var4 = this.func_151558_b(Blocks.gravel, 0); + + for (int var5 = this.boundingBox.minX; var5 <= this.boundingBox.maxX; ++var5) { + for (int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { + if (p_74875_3_.isVecInside(var5, 64, var6)) { + int var7 = p_74875_1_.getTopSolidOrLiquidBlock(var5, var6) - 1; + p_74875_1_.setBlock(var5, var7, var6, var4, 0, 2); + } + } + } + + return true; + } + } + + public static class PieceWeight { + public Class villagePieceClass; + public final int villagePieceWeight; + public int villagePiecesSpawned; + public int villagePiecesLimit; + + + public PieceWeight(Class p_i2098_1_, int p_i2098_2_, int p_i2098_3_) { + this.villagePieceClass = p_i2098_1_; + this.villagePieceWeight = p_i2098_2_; + this.villagePiecesLimit = p_i2098_3_; + } + + public boolean canSpawnMoreVillagePiecesOfType(int p_75085_1_) { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + + public boolean canSpawnMoreVillagePieces() { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + } + + public abstract static class Road extends StructureVillagePieces.Village { + + + public Road() {} + + protected Road(StructureVillagePieces.Start p_i2108_1_, int p_i2108_2_) { + super(p_i2108_1_, p_i2108_2_); + } + } + + public static class Start extends StructureVillagePieces.Well { + public WorldChunkManager worldChunkMngr; + public boolean inDesert; + public int terrainType; + public StructureVillagePieces.PieceWeight structVillagePieceWeight; + public List structureVillageWeightedPieceList; + public List field_74932_i = new ArrayList(); + public List field_74930_j = new ArrayList(); + + + public Start() {} + + public Start(WorldChunkManager p_i2104_1_, int p_i2104_2_, Random p_i2104_3_, int p_i2104_4_, int p_i2104_5_, List p_i2104_6_, int p_i2104_7_) { + super(null, 0, p_i2104_3_, p_i2104_4_, p_i2104_5_); + this.worldChunkMngr = p_i2104_1_; + this.structureVillageWeightedPieceList = p_i2104_6_; + this.terrainType = p_i2104_7_; + BiomeGenBase var8 = p_i2104_1_.getBiomeGenAt(p_i2104_4_, p_i2104_5_); + this.inDesert = var8 == BiomeGenBase.desert || var8 == BiomeGenBase.desertHills; + } + + public WorldChunkManager getWorldChunkManager() { + return this.worldChunkMngr; + } + } + + public static class Torch extends StructureVillagePieces.Village { + + + public Torch() {} + + public Torch(StructureVillagePieces.Start p_i2097_1_, int p_i2097_2_, Random p_i2097_3_, StructureBoundingBox p_i2097_4_, int p_i2097_5_) { + super(p_i2097_1_, p_i2097_2_); + this.coordBaseMode = p_i2097_5_; + this.boundingBox = p_i2097_4_; + } + + public static StructureBoundingBox func_74904_a(StructureVillagePieces.Start p_74904_0_, List p_74904_1_, Random p_74904_2_, int p_74904_3_, int p_74904_4_, int p_74904_5_, int p_74904_6_) { + StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(p_74904_3_, p_74904_4_, p_74904_5_, 0, 0, 0, 3, 4, 2, p_74904_6_); + return StructureComponent.findIntersecting(p_74904_1_, var7) != null ? null : var7; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 2, 3, 1, Blocks.air, Blocks.air, false); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 0, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 2, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wool, 15, 1, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 0, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 1, 3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 2, 3, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.torch, 0, 1, 3, -1, p_74875_3_); + return true; + } + } + + abstract static class Village extends StructureComponent { + protected int field_143015_k = -1; + private int villagersSpawned; + private boolean field_143014_b; + + + public Village() {} + + protected Village(StructureVillagePieces.Start p_i2107_1_, int p_i2107_2_) { + super(p_i2107_2_); + + if (p_i2107_1_ != null) { + this.field_143014_b = p_i2107_1_.inDesert; + } + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + p_143012_1_.setInteger("HPos", this.field_143015_k); + p_143012_1_.setInteger("VCount", this.villagersSpawned); + p_143012_1_.setBoolean("Desert", this.field_143014_b); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + this.field_143015_k = p_143011_1_.getInteger("HPos"); + this.villagersSpawned = p_143011_1_.getInteger("VCount"); + this.field_143014_b = p_143011_1_.getBoolean("Desert"); + } + + protected StructureComponent getNextComponentNN(StructureVillagePieces.Start p_74891_1_, List p_74891_2_, Random p_74891_3_, int p_74891_4_, int p_74891_5_) { + switch (this.coordBaseMode) { + case 0: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, 1, this.getComponentType()); + + case 1: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + + case 2: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, 1, this.getComponentType()); + + case 3: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + + default: + return null; + } + } + + protected StructureComponent getNextComponentPP(StructureVillagePieces.Start p_74894_1_, List p_74894_2_, Random p_74894_3_, int p_74894_4_, int p_74894_5_) { + switch (this.coordBaseMode) { + case 0: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, 3, this.getComponentType()); + + case 1: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + + case 2: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, 3, this.getComponentType()); + + case 3: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + + default: + return null; + } + } + + protected int getAverageGroundLevel(World p_74889_1_, StructureBoundingBox p_74889_2_) { + int var3 = 0; + int var4 = 0; + + for (int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { + for (int var6 = this.boundingBox.minX; var6 <= this.boundingBox.maxX; ++var6) { + if (p_74889_2_.isVecInside(var6, 64, var5)) { + var3 += Math.max(p_74889_1_.getTopSolidOrLiquidBlock(var6, var5), p_74889_1_.provider.getAverageGroundLevel()); + ++var4; + } + } + } + + if (var4 == 0) { + return -1; + } else { + return var3 / var4; + } + } + + protected static boolean canVillageGoDeeper(StructureBoundingBox p_74895_0_) { + return p_74895_0_ != null && p_74895_0_.minY > 10; + } + + protected void spawnVillagers(World p_74893_1_, StructureBoundingBox p_74893_2_, int p_74893_3_, int p_74893_4_, int p_74893_5_, int p_74893_6_) { + if (this.villagersSpawned < p_74893_6_) { + for (int var7 = this.villagersSpawned; var7 < p_74893_6_; ++var7) { + int var8 = this.getXWithOffset(p_74893_3_ + var7, p_74893_5_); + int var9 = this.getYWithOffset(p_74893_4_); + int var10 = this.getZWithOffset(p_74893_3_ + var7, p_74893_5_); + + if (!p_74893_2_.isVecInside(var8, var9, var10)) { + break; + } + + ++this.villagersSpawned; + EntityVillager var11 = new EntityVillager(p_74893_1_, this.getVillagerType(var7)); + var11.setLocationAndAngles((double)var8 + 0.5D, var9, (double)var10 + 0.5D, 0.0F, 0.0F); + p_74893_1_.spawnEntityInWorld(var11); + } + } + } + + protected int getVillagerType(int p_74888_1_) { + return 0; + } + + protected Block func_151558_b(Block p_151558_1_, int p_151558_2_) { + if (this.field_143014_b) { + if (p_151558_1_ == Blocks.log || p_151558_1_ == Blocks.log2) { + return Blocks.sandstone; + } + + if (p_151558_1_ == Blocks.cobblestone) { + return Blocks.sandstone; + } + + if (p_151558_1_ == Blocks.planks) { + return Blocks.sandstone; + } + + if (p_151558_1_ == Blocks.oak_stairs) { + return Blocks.sandstone_stairs; + } + + if (p_151558_1_ == Blocks.stone_stairs) { + return Blocks.sandstone_stairs; + } + + if (p_151558_1_ == Blocks.gravel) { + return Blocks.sandstone; + } + } + + return p_151558_1_; + } + + protected int func_151557_c(Block p_151557_1_, int p_151557_2_) { + if (this.field_143014_b) { + if (p_151557_1_ == Blocks.log || p_151557_1_ == Blocks.log2) { + return 0; + } + + if (p_151557_1_ == Blocks.cobblestone) { + return 0; + } + + if (p_151557_1_ == Blocks.planks) { + return 2; + } + } + + return p_151557_2_; + } + + protected void func_151550_a(World p_151550_1_, Block p_151550_2_, int p_151550_3_, int p_151550_4_, int p_151550_5_, int p_151550_6_, StructureBoundingBox p_151550_7_) { + Block var8 = this.func_151558_b(p_151550_2_, p_151550_3_); + int var9 = this.func_151557_c(p_151550_2_, p_151550_3_); + super.func_151550_a(p_151550_1_, var8, var9, p_151550_4_, p_151550_5_, p_151550_6_, p_151550_7_); + } + + protected void func_151549_a(World p_151549_1_, StructureBoundingBox p_151549_2_, int p_151549_3_, int p_151549_4_, int p_151549_5_, int p_151549_6_, int p_151549_7_, int p_151549_8_, Block p_151549_9_, Block p_151549_10_, boolean p_151549_11_) { + Block var12 = this.func_151558_b(p_151549_9_, 0); + int var13 = this.func_151557_c(p_151549_9_, 0); + Block var14 = this.func_151558_b(p_151549_10_, 0); + int var15 = this.func_151557_c(p_151549_10_, 0); + super.func_151556_a(p_151549_1_, p_151549_2_, p_151549_3_, p_151549_4_, p_151549_5_, p_151549_6_, p_151549_7_, p_151549_8_, var12, var13, var14, var15, p_151549_11_); + } + + protected void func_151554_b(World p_151554_1_, Block p_151554_2_, int p_151554_3_, int p_151554_4_, int p_151554_5_, int p_151554_6_, StructureBoundingBox p_151554_7_) { + Block var8 = this.func_151558_b(p_151554_2_, p_151554_3_); + int var9 = this.func_151557_c(p_151554_2_, p_151554_3_); + super.func_151554_b(p_151554_1_, var8, var9, p_151554_4_, p_151554_5_, p_151554_6_, p_151554_7_); + } + } + + public static class Well extends StructureVillagePieces.Village { + + + public Well() {} + + public Well(StructureVillagePieces.Start p_i2109_1_, int p_i2109_2_, Random p_i2109_3_, int p_i2109_4_, int p_i2109_5_) { + super(p_i2109_1_, p_i2109_2_); + this.coordBaseMode = p_i2109_3_.nextInt(4); + + switch (this.coordBaseMode) { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2109_4_, 64, p_i2109_5_, p_i2109_4_ + 6 - 1, 78, p_i2109_5_ + 6 - 1); + break; + + default: + this.boundingBox = new StructureBoundingBox(p_i2109_4_, 64, p_i2109_5_, p_i2109_4_ + 6 - 1, 78, p_i2109_5_ + 6 - 1); + } + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) { + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 1, this.getComponentType()); + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 3, this.getComponentType()); + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, 2, this.getComponentType()); + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 3, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 1, 4, 12, 4, Blocks.cobblestone, Blocks.flowing_water, false); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 12, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 3, 12, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 2, 12, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 3, 12, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 13, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 14, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 13, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 14, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 13, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 1, 14, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 13, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.fence, 0, 4, 14, 4, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 15, 1, 4, 15, 4, Blocks.cobblestone, Blocks.cobblestone, false); + + for (int var4 = 0; var4 <= 5; ++var4) { + for (int var5 = 0; var5 <= 5; ++var5) { + if (var5 == 0 || var5 == 5 || var4 == 0 || var4 == 5) { + this.func_151550_a(p_74875_1_, Blocks.gravel, 0, var5, 11, var4, p_74875_3_); + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var5, 12, var4, p_74875_3_); + } + } + } + + return true; + } + } + + public static class WoodHut extends StructureVillagePieces.Village { + private boolean isTallHouse; + private int tablePosition; + + + public WoodHut() {} + + public WoodHut(StructureVillagePieces.Start p_i2101_1_, int p_i2101_2_, Random p_i2101_3_, StructureBoundingBox p_i2101_4_, int p_i2101_5_) { + super(p_i2101_1_, p_i2101_2_); + this.coordBaseMode = p_i2101_5_; + this.boundingBox = p_i2101_4_; + this.isTallHouse = p_i2101_3_.nextBoolean(); + this.tablePosition = p_i2101_3_.nextInt(3); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("T", this.tablePosition); + p_143012_1_.setBoolean("C", this.isTallHouse); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) { + super.func_143011_b(p_143011_1_); + this.tablePosition = p_143011_1_.getInteger("T"); + this.isTallHouse = p_143011_1_.getBoolean("C"); + } + + public static StructureVillagePieces.WoodHut func_74908_a(StructureVillagePieces.Start p_74908_0_, List p_74908_1_, Random p_74908_2_, int p_74908_3_, int p_74908_4_, int p_74908_5_, int p_74908_6_, int p_74908_7_) { + StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(p_74908_3_, p_74908_4_, p_74908_5_, 0, 0, 0, 4, 6, 5, p_74908_6_); + return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(p_74908_1_, var8) == null ? new StructureVillagePieces.WoodHut(p_74908_0_, p_74908_7_, p_74908_2_, var8, p_74908_6_) : null; + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 1, 3, 5, 4, Blocks.air, Blocks.air, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 0, 0, 3, 0, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 0, 1, 2, 0, 3, Blocks.dirt, Blocks.dirt, false); + + if (this.isTallHouse) { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 4, 1, 2, 4, 3, Blocks.log, Blocks.log, false); + } else { + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 5, 1, 2, 5, 3, Blocks.log, Blocks.log, false); + } + + this.func_151550_a(p_74875_1_, Blocks.log, 0, 1, 4, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 2, 4, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 1, 4, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 2, 4, 4, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 0, 4, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 0, 4, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 0, 4, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 3, 4, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 3, 4, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.log, 0, 3, 4, 3, p_74875_3_); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 0, 0, 3, 0, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 0, 3, 3, 0, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 4, 0, 3, 4, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 4, 3, 3, 4, Blocks.log, Blocks.log, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 3, 1, 1, 3, 3, 3, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 0, 2, 3, 0, Blocks.planks, Blocks.planks, false); + this.func_151549_a(p_74875_1_, p_74875_3_, 1, 1, 4, 2, 3, 4, Blocks.planks, Blocks.planks, false); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.glass_pane, 0, 3, 2, 2, p_74875_3_); + + if (this.tablePosition > 0) { + this.func_151550_a(p_74875_1_, Blocks.fence, 0, this.tablePosition, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.wooden_pressure_plate, 0, this.tablePosition, 2, 3, p_74875_3_); + } + + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, 1, 0, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.air, 0, 1, 2, 0, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 1, 1, 0, this.func_151555_a(Blocks.wooden_door, 1)); + + if (this.func_151548_a(p_74875_1_, 1, 0, -1, p_74875_3_).getMaterial() == Material.air && this.func_151548_a(p_74875_1_, 1, -1, -1, p_74875_3_).getMaterial() != Material.air) { + this.func_151550_a(p_74875_1_, Blocks.stone_stairs, this.func_151555_a(Blocks.stone_stairs, 3), 1, 0, -1, p_74875_3_); + } + + for (int var4 = 0; var4 < 5; ++var4) { + for (int var5 = 0; var5 < 4; ++var5) { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, var5, 6, var4, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, var5, -1, var4, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 1, 1, 2, 1); + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java new file mode 100644 index 0000000..0bdbbda --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java @@ -0,0 +1,244 @@ +package net.minecraft.world.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.GameRules; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class DerivedWorldInfo extends WorldInfo { + /** Instance of WorldInfo. */ + private final WorldInfo theWorldInfo; + + + public DerivedWorldInfo(WorldInfo p_i2145_1_) { + this.theWorldInfo = p_i2145_1_; + } + + /** + * Gets the NBTTagCompound for the worldInfo + */ + public NBTTagCompound getNBTTagCompound() { + return this.theWorldInfo.getNBTTagCompound(); + } + + /** + * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" + */ + public NBTTagCompound cloneNBTCompound(NBTTagCompound p_76082_1_) { + return this.theWorldInfo.cloneNBTCompound(p_76082_1_); + } + + /** + * Returns the seed of current world. + */ + public long getSeed() { + return this.theWorldInfo.getSeed(); + } + + /** + * Returns the x spawn position + */ + public int getSpawnX() { + return this.theWorldInfo.getSpawnX(); + } + + /** + * Return the Y axis spawning point of the player. + */ + public int getSpawnY() { + return this.theWorldInfo.getSpawnY(); + } + + /** + * Returns the z spawn position + */ + public int getSpawnZ() { + return this.theWorldInfo.getSpawnZ(); + } + + public long getWorldTotalTime() { + return this.theWorldInfo.getWorldTotalTime(); + } + + /** + * Get current world time + */ + public long getWorldTime() { + return this.theWorldInfo.getWorldTime(); + } + + public long getSizeOnDisk() { + return this.theWorldInfo.getSizeOnDisk(); + } + + /** + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() { + return this.theWorldInfo.getPlayerNBTTagCompound(); + } + + /** + * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer + * WorldProvider.dimensionID accessed from World.provider.dimensionID + */ + public int getVanillaDimension() { + return this.theWorldInfo.getVanillaDimension(); + } + + /** + * Get current world name + */ + public String getWorldName() { + return this.theWorldInfo.getWorldName(); + } + + /** + * Returns the save version of this world + */ + public int getSaveVersion() { + return this.theWorldInfo.getSaveVersion(); + } + + /** + * Return the last time the player was in this world. + */ + public long getLastTimePlayed() { + return this.theWorldInfo.getLastTimePlayed(); + } + + /** + * Returns true if it is thundering, false otherwise. + */ + public boolean isThundering() { + return this.theWorldInfo.isThundering(); + } + + /** + * Returns the number of ticks until next thunderbolt. + */ + public int getThunderTime() { + return this.theWorldInfo.getThunderTime(); + } + + /** + * Returns true if it is raining, false otherwise. + */ + public boolean isRaining() { + return this.theWorldInfo.isRaining(); + } + + /** + * Return the number of ticks until rain. + */ + public int getRainTime() { + return this.theWorldInfo.getRainTime(); + } + + /** + * Gets the GameType. + */ + public WorldSettings.GameType getGameType() { + return this.theWorldInfo.getGameType(); + } + + /** + * Set the x spawn position to the passed in value + */ + public void setSpawnX(int p_76058_1_) {} + + /** + * Sets the y spawn position + */ + public void setSpawnY(int p_76056_1_) {} + + /** + * Set the z spawn position to the passed in value + */ + public void setSpawnZ(int p_76087_1_) {} + + public void incrementTotalWorldTime(long p_82572_1_) {} + + /** + * Set current world time + */ + public void setWorldTime(long p_76068_1_) {} + + /** + * Sets the spawn zone position. Args: x, y, z + */ + public void setSpawnPosition(int p_76081_1_, int p_76081_2_, int p_76081_3_) {} + + public void setWorldName(String p_76062_1_) {} + + /** + * Sets the save version of the world + */ + public void setSaveVersion(int p_76078_1_) {} + + /** + * Sets whether it is thundering or not. + */ + public void setThundering(boolean p_76069_1_) {} + + /** + * Defines the number of ticks until next thunderbolt. + */ + public void setThunderTime(int p_76090_1_) {} + + /** + * Sets whether it is raining or not. + */ + public void setRaining(boolean p_76084_1_) {} + + /** + * Sets the number of ticks until rain. + */ + public void setRainTime(int p_76080_1_) {} + + /** + * Get whether the map features (e.g. strongholds) generation is enabled or disabled. + */ + public boolean isMapFeaturesEnabled() { + return this.theWorldInfo.isMapFeaturesEnabled(); + } + + /** + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean isHardcoreModeEnabled() { + return this.theWorldInfo.isHardcoreModeEnabled(); + } + + public WorldType getTerrainType() { + return this.theWorldInfo.getTerrainType(); + } + + public void setTerrainType(WorldType p_76085_1_) {} + + /** + * Returns true if commands are allowed on this World. + */ + public boolean areCommandsAllowed() { + return this.theWorldInfo.areCommandsAllowed(); + } + + /** + * Returns true if the World is initialized. + */ + public boolean isInitialized() { + return this.theWorldInfo.isInitialized(); + } + + /** + * Sets the initialization status of the World. + */ + public void setServerInitialized(boolean p_76091_1_) {} + + /** + * Gets the GameRules class Instance. + */ + public GameRules getGameRulesInstance() { + return this.theWorldInfo.getGameRulesInstance(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/IPlayerFileData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/IPlayerFileData.java new file mode 100644 index 0000000..4d4e13a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/IPlayerFileData.java @@ -0,0 +1,21 @@ +package net.minecraft.world.storage; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public interface IPlayerFileData { + /** + * Writes the player data to disk from the specified PlayerEntityMP. + */ + void writePlayerData(EntityPlayer p_75753_1_); + + /** + * Reads the player data from disk into the specified PlayerEntityMP. + */ + NBTTagCompound readPlayerData(EntityPlayer p_75752_1_); + + /** + * Returns an array of usernames for which player.dat exists for. + */ + String[] getAvailablePlayerDat(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ISaveFormat.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ISaveFormat.java new file mode 100644 index 0000000..135661c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ISaveFormat.java @@ -0,0 +1,55 @@ +package net.minecraft.world.storage; + +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.util.IProgressUpdate; + +public interface ISaveFormat { + String func_154333_a(); + + /** + * Returns back a loader for the specified save directory + */ + ISaveHandler getSaveLoader(String p_75804_1_, boolean p_75804_2_); + + List getSaveList() throws AnvilConverterException; + + void flushCache(); + + /** + * gets the world info + */ + WorldInfo getWorldInfo(String p_75803_1_); + + boolean func_154335_d(String p_154335_1_); + + /** + * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting + * the associated directory recursively. + */ + boolean deleteWorldDirectory(String p_75802_1_); + + /** + * @args: Takes two arguments - first the name of the directory containing the world and second the new name for + * that world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory + * containing the world data. + */ + void renameWorld(String p_75806_1_, String p_75806_2_); + + boolean func_154334_a(String p_154334_1_); + + /** + * Checks if the save directory uses the old map format + */ + boolean isOldMapFormat(String p_75801_1_); + + /** + * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + boolean convertMapFormat(String p_75805_1_, IProgressUpdate p_75805_2_); + + /** + * Return whether the given world can be loaded. + */ + boolean canLoadWorld(String p_90033_1_); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ISaveHandler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ISaveHandler.java new file mode 100644 index 0000000..fd382d4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ISaveHandler.java @@ -0,0 +1,59 @@ +package net.minecraft.world.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; + +public interface ISaveHandler { + /** + * Loads and returns the world info + */ + WorldInfo loadWorldInfo(); + + /** + * Checks the session lock to prevent save collisions + */ + void checkSessionLock() throws MinecraftException; + + /** + * Returns the chunk loader with the provided world provider + */ + IChunkLoader getChunkLoader(WorldProvider p_75763_1_); + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_); + + /** + * Saves the passed in world info. + */ + void saveWorldInfo(WorldInfo p_75761_1_); + + /** + * returns null if no saveHandler is relevent (eg. SMP) + */ + IPlayerFileData getSaveHandler(); + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + void flush(); + + /** + * Gets the File object corresponding to the base directory of this world. + */ + File getWorldDirectory(); + + /** + * Gets the file location of the given map + */ + File getMapFileFromName(String p_75758_1_); + + /** + * Returns the name of the directory where world information is saved. + */ + String getWorldDirectoryName(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java new file mode 100644 index 0000000..6da2a3f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/IThreadedFileIO.java @@ -0,0 +1,8 @@ +package net.minecraft.world.storage; + +public interface IThreadedFileIO { + /** + * Returns a boolean stating if the write was unsuccessful. + */ + boolean writeNextIO(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/MapData.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/MapData.java new file mode 100644 index 0000000..faec4fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/MapData.java @@ -0,0 +1,348 @@ +package net.minecraft.world.storage; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + +public class MapData extends WorldSavedData { + public int xCenter; + public int zCenter; + public byte dimension; + public byte scale; + + /** colours */ + public byte[] colors = new byte[16384]; + + /** + * Holds a reference to the MapInfo of the players who own a copy of the map + */ + public List playersArrayList = new ArrayList(); + + /** + * Holds a reference to the players who own a copy of the map and a reference to their MapInfo + */ + private final Map playersHashMap = new HashMap(); + public Map playersVisibleOnMap = new LinkedHashMap(); + + + public MapData(String p_i2140_1_) { + super(p_i2140_1_); + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound nbt) { + this.dimension = nbt.getByte("dimension"); + this.xCenter = nbt.getInteger("xCenter"); + this.zCenter = nbt.getInteger("zCenter"); + this.scale = nbt.getByte("scale"); + + if (this.scale < 0) { + this.scale = 0; + } + + if (this.scale > 4) { + this.scale = 4; + } + + short var2 = nbt.getShort("width"); + short var3 = nbt.getShort("height"); + + if (var2 == 128 && var3 == 128) { + this.colors = nbt.getByteArray("colors"); + } else { + byte[] var4 = nbt.getByteArray("colors"); + this.colors = new byte[16384]; + int var5 = (128 - var2) / 2; + int var6 = (128 - var3) / 2; + + for (int var7 = 0; var7 < var3; ++var7) { + int var8 = var7 + var6; + + if (var8 >= 0 || var8 < 128) { + for (int var9 = 0; var9 < var2; ++var9) { + int var10 = var9 + var5; + + if (var10 >= 0 || var10 < 128) { + this.colors[var10 + var8 * 128] = var4[var9 + var7 * var2]; + } + } + } + } + } + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound nbt) { + nbt.setByte("dimension", this.dimension); + nbt.setInteger("xCenter", this.xCenter); + nbt.setInteger("zCenter", this.zCenter); + nbt.setByte("scale", this.scale); + nbt.setShort("width", (short)128); + nbt.setShort("height", (short)128); + nbt.setByteArray("colors", this.colors); + } + + /** + * Adds the player passed to the list of visible players and checks to see which players are visible + */ + public void updateVisiblePlayers(EntityPlayer p_76191_1_, ItemStack p_76191_2_) { + if (!this.playersHashMap.containsKey(p_76191_1_)) { + MapData.MapInfo var3 = new MapData.MapInfo(p_76191_1_); + this.playersHashMap.put(p_76191_1_, var3); + this.playersArrayList.add(var3); + } + + if (!p_76191_1_.inventory.hasItemStack(p_76191_2_)) { + this.playersVisibleOnMap.remove(p_76191_1_.getCommandSenderName()); + } + + for (int var5 = 0; var5 < this.playersArrayList.size(); ++var5) { + MapData.MapInfo var4 = (MapData.MapInfo)this.playersArrayList.get(var5); + + if (!var4.entityplayerObj.isDead && (var4.entityplayerObj.inventory.hasItemStack(p_76191_2_) || p_76191_2_.isOnItemFrame())) { + if (!p_76191_2_.isOnItemFrame() && var4.entityplayerObj.dimension == this.dimension) { + this.func_82567_a(0, var4.entityplayerObj.worldObj, var4.entityplayerObj.getCommandSenderName(), var4.entityplayerObj.posX, var4.entityplayerObj.posZ, var4.entityplayerObj.rotationYaw); + } + } else { + this.playersHashMap.remove(var4.entityplayerObj); + this.playersArrayList.remove(var4); + } + } + + if (p_76191_2_.isOnItemFrame()) { + this.func_82567_a(1, p_76191_1_.worldObj, "frame-" + p_76191_2_.getItemFrame().getEntityId(), p_76191_2_.getItemFrame().field_146063_b, p_76191_2_.getItemFrame().field_146062_d, p_76191_2_.getItemFrame().hangingDirection * 90); + } + } + + private void func_82567_a(int p_82567_1_, World p_82567_2_, String p_82567_3_, double p_82567_4_, double p_82567_6_, double p_82567_8_) { + int var10 = 1 << this.scale; + float var11 = (float)(p_82567_4_ - (double)this.xCenter) / (float)var10; + float var12 = (float)(p_82567_6_ - (double)this.zCenter) / (float)var10; + byte var13 = (byte)((int)((double)(var11 * 2.0F) + 0.5D)); + byte var14 = (byte)((int)((double)(var12 * 2.0F) + 0.5D)); + byte var16 = 63; + byte var15; + + if (var11 >= (float)(-var16) && var12 >= (float)(-var16) && var11 <= (float)var16 && var12 <= (float)var16) { + p_82567_8_ += p_82567_8_ < 0.0D ? -8.0D : 8.0D; + var15 = (byte)((int)(p_82567_8_ * 16.0D / 360.0D)); + + if (this.dimension < 0) { + int var17 = (int)(p_82567_2_.getWorldInfo().getWorldTime() / 10L); + var15 = (byte)(var17 * var17 * 34187121 + var17 * 121 >> 15 & 15); + } + } else { + if (Math.abs(var11) >= 320.0F || Math.abs(var12) >= 320.0F) { + this.playersVisibleOnMap.remove(p_82567_3_); + return; + } + + p_82567_1_ = 6; + var15 = 0; + + if (var11 <= (float)(-var16)) { + var13 = (byte)((int)((double)(var16 * 2) + 2.5D)); + } + + if (var12 <= (float)(-var16)) { + var14 = (byte)((int)((double)(var16 * 2) + 2.5D)); + } + + if (var11 >= (float)var16) { + var13 = (byte)(var16 * 2 + 1); + } + + if (var12 >= (float)var16) { + var14 = (byte)(var16 * 2 + 1); + } + } + + this.playersVisibleOnMap.put(p_82567_3_, new MapData.MapCoord((byte)p_82567_1_, var13, var14, var15)); + } + + /** + * Get byte array of packet data to send to players on map for updating map data + */ + public byte[] getUpdatePacketData(ItemStack p_76193_1_, World p_76193_2_, EntityPlayer p_76193_3_) { + MapData.MapInfo var4 = (MapData.MapInfo)this.playersHashMap.get(p_76193_3_); + return var4 == null ? null : var4.getPlayersOnMap(p_76193_1_); + } + + /** + * Marks a vertical range of pixels as being modified so they will be resent to clients. Parameters: X, lowest Y, + * highest Y + */ + public void setColumnDirty(int p_76194_1_, int p_76194_2_, int p_76194_3_) { + super.markDirty(); + + for (int var4 = 0; var4 < this.playersArrayList.size(); ++var4) { + MapData.MapInfo var5 = (MapData.MapInfo)this.playersArrayList.get(var4); + + if (var5.field_76209_b[p_76194_1_] < 0 || var5.field_76209_b[p_76194_1_] > p_76194_2_) { + var5.field_76209_b[p_76194_1_] = p_76194_2_; + } + + if (var5.field_76210_c[p_76194_1_] < 0 || var5.field_76210_c[p_76194_1_] < p_76194_3_) { + var5.field_76210_c[p_76194_1_] = p_76194_3_; + } + } + } + + /** + * Updates the com.cheatbreaker.client's map with information from other players in MP + */ + public void updateMPMapData(byte[] p_76192_1_) { + int var2; + + if (p_76192_1_[0] == 0) { + var2 = p_76192_1_[1] & 255; + int var3 = p_76192_1_[2] & 255; + + for (int var4 = 0; var4 < p_76192_1_.length - 3; ++var4) { + this.colors[(var4 + var3) * 128 + var2] = p_76192_1_[var4 + 3]; + } + + this.markDirty(); + } else if (p_76192_1_[0] == 1) { + this.playersVisibleOnMap.clear(); + + for (var2 = 0; var2 < (p_76192_1_.length - 1) / 3; ++var2) { + byte var7 = (byte)(p_76192_1_[var2 * 3 + 1] >> 4); + byte var8 = p_76192_1_[var2 * 3 + 2]; + byte var5 = p_76192_1_[var2 * 3 + 3]; + byte var6 = (byte)(p_76192_1_[var2 * 3 + 1] & 15); + this.playersVisibleOnMap.put("icon-" + var2, new MapData.MapCoord(var7, var8, var5, var6)); + } + } else if (p_76192_1_[0] == 2) { + this.scale = p_76192_1_[1]; + } + } + + public MapData.MapInfo func_82568_a(EntityPlayer p_82568_1_) { + MapData.MapInfo var2 = (MapData.MapInfo)this.playersHashMap.get(p_82568_1_); + + if (var2 == null) { + var2 = new MapData.MapInfo(p_82568_1_); + this.playersHashMap.put(p_82568_1_, var2); + this.playersArrayList.add(var2); + } + + return var2; + } + + public class MapCoord { + public byte iconSize; + public byte centerX; + public byte centerZ; + public byte iconRotation; + + + public MapCoord(byte p_i2139_2_, byte p_i2139_3_, byte p_i2139_4_, byte p_i2139_5_) { + this.iconSize = p_i2139_2_; + this.centerX = p_i2139_3_; + this.centerZ = p_i2139_4_; + this.iconRotation = p_i2139_5_; + } + } + + public class MapInfo { + public final EntityPlayer entityplayerObj; + public int[] field_76209_b = new int[128]; + public int[] field_76210_c = new int[128]; + private int currentRandomNumber; + private int ticksUntilPlayerLocationMapUpdate; + private byte[] lastPlayerLocationOnMap; + public int field_82569_d; + private boolean field_82570_i; + + + public MapInfo(EntityPlayer p_i2138_2_) { + this.entityplayerObj = p_i2138_2_; + + for (int var3 = 0; var3 < this.field_76209_b.length; ++var3) { + this.field_76209_b[var3] = 0; + this.field_76210_c[var3] = 127; + } + } + + public byte[] getPlayersOnMap(ItemStack p_76204_1_) { + byte[] var2; + + if (!this.field_82570_i) { + var2 = new byte[] {(byte)2, MapData.this.scale}; + this.field_82570_i = true; + return var2; + } else { + int var3; + int var11; + + if (--this.ticksUntilPlayerLocationMapUpdate < 0) { + this.ticksUntilPlayerLocationMapUpdate = 4; + var2 = new byte[MapData.this.playersVisibleOnMap.size() * 3 + 1]; + var2[0] = 1; + var3 = 0; + + for (Iterator var4 = MapData.this.playersVisibleOnMap.values().iterator(); var4.hasNext(); ++var3) { + MapData.MapCoord var5 = (MapData.MapCoord)var4.next(); + var2[var3 * 3 + 1] = (byte)(var5.iconSize << 4 | var5.iconRotation & 15); + var2[var3 * 3 + 2] = var5.centerX; + var2[var3 * 3 + 3] = var5.centerZ; + } + + boolean var9 = !p_76204_1_.isOnItemFrame(); + + if (this.lastPlayerLocationOnMap != null && this.lastPlayerLocationOnMap.length == var2.length) { + for (var11 = 0; var11 < var2.length; ++var11) { + if (var2[var11] != this.lastPlayerLocationOnMap[var11]) { + var9 = false; + break; + } + } + } else { + var9 = false; + } + + if (!var9) { + this.lastPlayerLocationOnMap = var2; + return var2; + } + } + + for (int var8 = 0; var8 < 1; ++var8) { + var3 = this.currentRandomNumber++ * 11 % 128; + + if (this.field_76209_b[var3] >= 0) { + int var10 = this.field_76210_c[var3] - this.field_76209_b[var3] + 1; + var11 = this.field_76209_b[var3]; + byte[] var6 = new byte[var10 + 3]; + var6[0] = 0; + var6[1] = (byte)var3; + var6[2] = (byte)var11; + + for (int var7 = 0; var7 < var6.length - 3; ++var7) { + var6[var7 + 3] = MapData.this.colors[(var7 + var11) * 128 + var3]; + } + + this.field_76210_c[var3] = -1; + this.field_76209_b[var3] = -1; + return var6; + } + } + + return null; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/MapStorage.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/MapStorage.java new file mode 100644 index 0000000..5206ce5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/MapStorage.java @@ -0,0 +1,208 @@ +package net.minecraft.world.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.world.WorldSavedData; + +public class MapStorage { + private final ISaveHandler saveHandler; + + /** Map of item data String id to loaded MapDataBases */ + private final Map loadedDataMap = new HashMap(); + + /** List of loaded MapDataBases. */ + private final List loadedDataList = new ArrayList(); + + /** + * Map of MapDataBase id String prefixes ('map' etc) to max known unique Short id (the 0 part etc) for that prefix + */ + private final Map idCounts = new HashMap(); + + + public MapStorage(ISaveHandler p_i2162_1_) { + this.saveHandler = p_i2162_1_; + this.loadIdCounts(); + } + + /** + * Loads an existing MapDataBase corresponding to the given String id from disk, instantiating the given Class, or + * returns null if none such file exists. args: Class to instantiate, String dataid + */ + public WorldSavedData loadData(Class p_75742_1_, String p_75742_2_) { + WorldSavedData var3 = (WorldSavedData)this.loadedDataMap.get(p_75742_2_); + + if (var3 != null) { + return var3; + } else { + if (this.saveHandler != null) { + try { + File var4 = this.saveHandler.getMapFileFromName(p_75742_2_); + + if (var4 != null && var4.exists()) { + try { + var3 = (WorldSavedData)p_75742_1_.getConstructor(new Class[] {String.class}).newInstance(new Object[] {p_75742_2_}); + } catch (Exception var7) { + throw new RuntimeException("Failed to instantiate " + p_75742_1_.toString(), var7); + } + + FileInputStream var5 = new FileInputStream(var4); + NBTTagCompound var6 = CompressedStreamTools.readCompressed(var5); + var5.close(); + var3.readFromNBT(var6.getCompoundTag("data")); + } + } catch (Exception var8) { + var8.printStackTrace(); + } + } + + if (var3 != null) { + this.loadedDataMap.put(p_75742_2_, var3); + this.loadedDataList.add(var3); + } + + return var3; + } + } + + /** + * Assigns the given String id to the given MapDataBase, removing any existing ones of the same id. + */ + public void setData(String p_75745_1_, WorldSavedData p_75745_2_) { + if (p_75745_2_ == null) { + throw new RuntimeException("Can't set null data"); + } else { + if (this.loadedDataMap.containsKey(p_75745_1_)) { + this.loadedDataList.remove(this.loadedDataMap.remove(p_75745_1_)); + } + + this.loadedDataMap.put(p_75745_1_, p_75745_2_); + this.loadedDataList.add(p_75745_2_); + } + } + + /** + * Saves all dirty loaded MapDataBases to disk. + */ + public void saveAllData() { + for (int var1 = 0; var1 < this.loadedDataList.size(); ++var1) { + WorldSavedData var2 = (WorldSavedData)this.loadedDataList.get(var1); + + if (var2.isDirty()) { + this.saveData(var2); + var2.setDirty(false); + } + } + } + + /** + * Saves the given MapDataBase to disk. + */ + private void saveData(WorldSavedData p_75747_1_) { + if (this.saveHandler != null) { + try { + File var2 = this.saveHandler.getMapFileFromName(p_75747_1_.mapName); + + if (var2 != null) { + NBTTagCompound var3 = new NBTTagCompound(); + p_75747_1_.writeToNBT(var3); + NBTTagCompound var4 = new NBTTagCompound(); + var4.setTag("data", var3); + FileOutputStream var5 = new FileOutputStream(var2); + CompressedStreamTools.writeCompressed(var4, var5); + var5.close(); + } + } catch (Exception var6) { + var6.printStackTrace(); + } + } + } + + /** + * Loads the idCounts Map from the 'idcounts' file. + */ + private void loadIdCounts() { + try { + this.idCounts.clear(); + + if (this.saveHandler == null) { + return; + } + + File var1 = this.saveHandler.getMapFileFromName("idcounts"); + + if (var1 != null && var1.exists()) { + DataInputStream var2 = new DataInputStream(new FileInputStream(var1)); + NBTTagCompound var3 = CompressedStreamTools.read(var2); + var2.close(); + Iterator var4 = var3.func_150296_c().iterator(); + + while (var4.hasNext()) { + String var5 = (String)var4.next(); + NBTBase var6 = var3.getTag(var5); + + if (var6 instanceof NBTTagShort) { + NBTTagShort var7 = (NBTTagShort)var6; + short var9 = var7.func_150289_e(); + this.idCounts.put(var5, Short.valueOf(var9)); + } + } + } + } catch (Exception var10) { + var10.printStackTrace(); + } + } + + /** + * Returns an unique new data id for the given prefix and saves the idCounts map to the 'idcounts' file. + */ + public int getUniqueDataId(String p_75743_1_) { + Short var2 = (Short)this.idCounts.get(p_75743_1_); + + if (var2 == null) { + var2 = Short.valueOf((short)0); + } else { + var2 = Short.valueOf((short)(var2.shortValue() + 1)); + } + + this.idCounts.put(p_75743_1_, var2); + + if (this.saveHandler == null) { + return var2.shortValue(); + } else { + try { + File var3 = this.saveHandler.getMapFileFromName("idcounts"); + + if (var3 != null) { + NBTTagCompound var4 = new NBTTagCompound(); + Iterator var5 = this.idCounts.keySet().iterator(); + + while (var5.hasNext()) { + String var6 = (String)var5.next(); + short var7 = ((Short)this.idCounts.get(var6)).shortValue(); + var4.setShort(var6, var7); + } + + DataOutputStream var9 = new DataOutputStream(new FileOutputStream(var3)); + CompressedStreamTools.write(var4, var9); + var9.close(); + } + } catch (Exception var8) { + var8.printStackTrace(); + } + + return var2.shortValue(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java new file mode 100644 index 0000000..feaf0fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveFormatComparator.java @@ -0,0 +1,83 @@ +package net.minecraft.world.storage; + +import net.minecraft.world.WorldSettings; + +public class SaveFormatComparator implements Comparable { + /** the file name of this save */ + private final String fileName; + + /** the displayed name of this save file */ + private final String displayName; + private final long lastTimePlayed; + private final long sizeOnDisk; + private final boolean requiresConversion; + + /** Instance of EnumGameType. */ + private final WorldSettings.GameType theEnumGameType; + private final boolean hardcore; + private final boolean cheatsEnabled; + + + public SaveFormatComparator(String p_i2161_1_, String p_i2161_2_, long p_i2161_3_, long p_i2161_5_, WorldSettings.GameType p_i2161_7_, boolean p_i2161_8_, boolean p_i2161_9_, boolean p_i2161_10_) { + this.fileName = p_i2161_1_; + this.displayName = p_i2161_2_; + this.lastTimePlayed = p_i2161_3_; + this.sizeOnDisk = p_i2161_5_; + this.theEnumGameType = p_i2161_7_; + this.requiresConversion = p_i2161_8_; + this.hardcore = p_i2161_9_; + this.cheatsEnabled = p_i2161_10_; + } + + /** + * return the file name + */ + public String getFileName() { + return this.fileName; + } + + /** + * return the display name of the save + */ + public String getDisplayName() { + return this.displayName; + } + + public long func_154336_c() { + return this.sizeOnDisk; + } + + public boolean requiresConversion() { + return this.requiresConversion; + } + + public long getLastTimePlayed() { + return this.lastTimePlayed; + } + + public int compareTo(SaveFormatComparator p_compareTo_1_) { + return this.lastTimePlayed < p_compareTo_1_.lastTimePlayed ? 1 : (this.lastTimePlayed > p_compareTo_1_.lastTimePlayed ? -1 : this.fileName.compareTo(p_compareTo_1_.fileName)); + } + + /** + * Gets the EnumGameType. + */ + public WorldSettings.GameType getEnumGameType() { + return this.theEnumGameType; + } + + public boolean isHardcoreModeEnabled() { + return this.hardcore; + } + + /** + * @return {@code true} if cheats are enabled for this world + */ + public boolean getCheatsEnabled() { + return this.cheatsEnabled; + } + + public int compareTo(Object p_compareTo_1_) { + return this.compareTo((SaveFormatComparator)p_compareTo_1_); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveFormatOld.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveFormatOld.java new file mode 100644 index 0000000..0400e3e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveFormatOld.java @@ -0,0 +1,221 @@ +package net.minecraft.world.storage; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IProgressUpdate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SaveFormatOld implements ISaveFormat { + private static final Logger logger = LogManager.getLogger(); + + /** + * Reference to the File object representing the directory for the world saves + */ + protected final File savesDirectory; + + + public SaveFormatOld(File p_i2147_1_) { + if (!p_i2147_1_.exists()) { + p_i2147_1_.mkdirs(); + } + + this.savesDirectory = p_i2147_1_; + } + + public String func_154333_a() { + return "Old Format"; + } + + public List getSaveList() throws AnvilConverterException { + ArrayList var1 = new ArrayList(); + + for (int var2 = 0; var2 < 5; ++var2) { + String var3 = "World" + (var2 + 1); + WorldInfo var4 = this.getWorldInfo(var3); + + if (var4 != null) { + var1.add(new SaveFormatComparator(var3, "", var4.getLastTimePlayed(), var4.getSizeOnDisk(), var4.getGameType(), false, var4.isHardcoreModeEnabled(), var4.areCommandsAllowed())); + } + } + + return var1; + } + + public void flushCache() {} + + /** + * gets the world info + */ + public WorldInfo getWorldInfo(String p_75803_1_) { + File var2 = new File(this.savesDirectory, p_75803_1_); + + if (!var2.exists()) { + return null; + } else { + File var3 = new File(var2, "level.dat"); + NBTTagCompound var4; + NBTTagCompound var5; + + if (var3.exists()) { + try { + var4 = CompressedStreamTools.readCompressed(new FileInputStream(var3)); + var5 = var4.getCompoundTag("Data"); + return new WorldInfo(var5); + } catch (Exception var7) { + logger.error("Exception reading " + var3, var7); + } + } + + var3 = new File(var2, "level.dat_old"); + + if (var3.exists()) { + try { + var4 = CompressedStreamTools.readCompressed(new FileInputStream(var3)); + var5 = var4.getCompoundTag("Data"); + return new WorldInfo(var5); + } catch (Exception var6) { + logger.error("Exception reading " + var3, var6); + } + } + + return null; + } + } + + /** + * @args: Takes two arguments - first the name of the directory containing the world and second the new name for + * that world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory + * containing the world data. + */ + public void renameWorld(String p_75806_1_, String p_75806_2_) { + File var3 = new File(this.savesDirectory, p_75806_1_); + + if (var3.exists()) { + File var4 = new File(var3, "level.dat"); + + if (var4.exists()) { + try { + NBTTagCompound var5 = CompressedStreamTools.readCompressed(new FileInputStream(var4)); + NBTTagCompound var6 = var5.getCompoundTag("Data"); + var6.setString("LevelName", p_75806_2_); + CompressedStreamTools.writeCompressed(var5, new FileOutputStream(var4)); + } catch (Exception var7) { + var7.printStackTrace(); + } + } + } + } + + public boolean func_154335_d(String p_154335_1_) { + File var2 = new File(this.savesDirectory, p_154335_1_); + + if (var2.exists()) { + return false; + } else { + try { + var2.mkdir(); + var2.delete(); + return true; + } catch (Throwable var4) { + logger.warn("Couldn't make new level", var4); + return false; + } + } + } + + /** + * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting + * the associated directory recursively. + */ + public boolean deleteWorldDirectory(String p_75802_1_) { + File var2 = new File(this.savesDirectory, p_75802_1_); + + if (!var2.exists()) { + return true; + } else { + logger.info("Deleting level " + p_75802_1_); + + for (int var3 = 1; var3 <= 5; ++var3) { + logger.info("Attempt " + var3 + "..."); + + if (deleteFiles(var2.listFiles())) { + break; + } + + logger.warn("Unsuccessful in deleting contents."); + + if (var3 < 5) { + try { + Thread.sleep(500L); + } catch (InterruptedException var5) { + } + } + } + + return var2.delete(); + } + } + + /** + * @args: Takes one argument - the list of files and directories to delete. @desc: Deletes the files and directory + * listed in the list recursively. + */ + protected static boolean deleteFiles(File[] p_75807_0_) { + for (int var1 = 0; var1 < p_75807_0_.length; ++var1) { + File var2 = p_75807_0_[var1]; + logger.debug("Deleting " + var2); + + if (var2.isDirectory() && !deleteFiles(var2.listFiles())) { + logger.warn("Couldn't delete directory " + var2); + return false; + } + + if (!var2.delete()) { + logger.warn("Couldn't delete file " + var2); + return false; + } + } + + return true; + } + + /** + * Returns back a loader for the specified save directory + */ + public ISaveHandler getSaveLoader(String p_75804_1_, boolean p_75804_2_) { + return new SaveHandler(this.savesDirectory, p_75804_1_, p_75804_2_); + } + + public boolean func_154334_a(String p_154334_1_) { + return false; + } + + /** + * Checks if the save directory uses the old map format + */ + public boolean isOldMapFormat(String p_75801_1_) { + return false; + } + + /** + * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + public boolean convertMapFormat(String p_75805_1_, IProgressUpdate p_75805_2_) { + return false; + } + + /** + * Return whether the given world can be loaded. + */ + public boolean canLoadWorld(String p_90033_1_) { + File var2 = new File(this.savesDirectory, p_90033_1_); + return var2.isDirectory(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveHandler.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveHandler.java new file mode 100644 index 0000000..4453744 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveHandler.java @@ -0,0 +1,291 @@ +package net.minecraft.world.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SaveHandler implements ISaveHandler, IPlayerFileData { + private static final Logger logger = LogManager.getLogger(); + + /** The directory in which to save world data. */ + private final File worldDirectory; + + /** The directory in which to save player data. */ + private final File playersDirectory; + private final File mapDataDir; + + /** + * The time in milliseconds when this field was initialized. Stored in the session lock file. + */ + private final long initializationTime = MinecraftServer.getSystemTimeMillis(); + + /** The directory name of the world */ + private final String saveDirectoryName; + + + public SaveHandler(File p_i2146_1_, String p_i2146_2_, boolean p_i2146_3_) { + this.worldDirectory = new File(p_i2146_1_, p_i2146_2_); + this.worldDirectory.mkdirs(); + this.playersDirectory = new File(this.worldDirectory, "playerdata"); + this.mapDataDir = new File(this.worldDirectory, "data"); + this.mapDataDir.mkdirs(); + this.saveDirectoryName = p_i2146_2_; + + if (p_i2146_3_) { + this.playersDirectory.mkdirs(); + } + + this.setSessionLock(); + } + + /** + * Creates a session lock file for this process + */ + private void setSessionLock() { + try { + File var1 = new File(this.worldDirectory, "session.lock"); + DataOutputStream var2 = new DataOutputStream(new FileOutputStream(var1)); + + try { + var2.writeLong(this.initializationTime); + } finally { + var2.close(); + } + } catch (IOException var7) { + var7.printStackTrace(); + throw new RuntimeException("Failed to check session lock, aborting"); + } + } + + /** + * Gets the File object corresponding to the base directory of this world. + */ + public File getWorldDirectory() { + return this.worldDirectory; + } + + /** + * Checks the session lock to prevent save collisions + */ + public void checkSessionLock() throws MinecraftException { + try { + File var1 = new File(this.worldDirectory, "session.lock"); + DataInputStream var2 = new DataInputStream(new FileInputStream(var1)); + + try { + if (var2.readLong() != this.initializationTime) { + throw new MinecraftException("The save is being accessed from another location, aborting"); + } + } finally { + var2.close(); + } + } catch (IOException var7) { + throw new MinecraftException("Failed to check session lock, aborting"); + } + } + + /** + * Returns the chunk loader with the provided world provider + */ + public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) { + throw new RuntimeException("Old Chunk Storage is no longer supported."); + } + + /** + * Loads and returns the world info + */ + public WorldInfo loadWorldInfo() { + File var1 = new File(this.worldDirectory, "level.dat"); + NBTTagCompound var2; + NBTTagCompound var3; + + if (var1.exists()) { + try { + var2 = CompressedStreamTools.readCompressed(new FileInputStream(var1)); + var3 = var2.getCompoundTag("Data"); + return new WorldInfo(var3); + } catch (Exception var5) { + var5.printStackTrace(); + } + } + + var1 = new File(this.worldDirectory, "level.dat_old"); + + if (var1.exists()) { + try { + var2 = CompressedStreamTools.readCompressed(new FileInputStream(var1)); + var3 = var2.getCompoundTag("Data"); + return new WorldInfo(var3); + } catch (Exception var4) { + var4.printStackTrace(); + } + } + + return null; + } + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + public void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_) { + NBTTagCompound var3 = p_75755_1_.cloneNBTCompound(p_75755_2_); + NBTTagCompound var4 = new NBTTagCompound(); + var4.setTag("Data", var3); + + try { + File var5 = new File(this.worldDirectory, "level.dat_new"); + File var6 = new File(this.worldDirectory, "level.dat_old"); + File var7 = new File(this.worldDirectory, "level.dat"); + CompressedStreamTools.writeCompressed(var4, new FileOutputStream(var5)); + + if (var6.exists()) { + var6.delete(); + } + + var7.renameTo(var6); + + if (var7.exists()) { + var7.delete(); + } + + var5.renameTo(var7); + + if (var5.exists()) { + var5.delete(); + } + } catch (Exception var8) { + var8.printStackTrace(); + } + } + + /** + * Saves the passed in world info. + */ + public void saveWorldInfo(WorldInfo p_75761_1_) { + NBTTagCompound var2 = p_75761_1_.getNBTTagCompound(); + NBTTagCompound var3 = new NBTTagCompound(); + var3.setTag("Data", var2); + + try { + File var4 = new File(this.worldDirectory, "level.dat_new"); + File var5 = new File(this.worldDirectory, "level.dat_old"); + File var6 = new File(this.worldDirectory, "level.dat"); + CompressedStreamTools.writeCompressed(var3, new FileOutputStream(var4)); + + if (var5.exists()) { + var5.delete(); + } + + var6.renameTo(var5); + + if (var6.exists()) { + var6.delete(); + } + + var4.renameTo(var6); + + if (var4.exists()) { + var4.delete(); + } + } catch (Exception var7) { + var7.printStackTrace(); + } + } + + /** + * Writes the player data to disk from the specified PlayerEntityMP. + */ + public void writePlayerData(EntityPlayer p_75753_1_) { + try { + NBTTagCompound var2 = new NBTTagCompound(); + p_75753_1_.writeToNBT(var2); + File var3 = new File(this.playersDirectory, p_75753_1_.getUniqueID().toString() + ".dat.tmp"); + File var4 = new File(this.playersDirectory, p_75753_1_.getUniqueID().toString() + ".dat"); + CompressedStreamTools.writeCompressed(var2, new FileOutputStream(var3)); + + if (var4.exists()) { + var4.delete(); + } + + var3.renameTo(var4); + } catch (Exception var5) { + logger.warn("Failed to save player data for " + p_75753_1_.getCommandSenderName()); + } + } + + /** + * Reads the player data from disk into the specified PlayerEntityMP. + */ + public NBTTagCompound readPlayerData(EntityPlayer p_75752_1_) { + NBTTagCompound var2 = null; + + try { + File var3 = new File(this.playersDirectory, p_75752_1_.getUniqueID().toString() + ".dat"); + + if (var3.exists() && var3.isFile()) { + var2 = CompressedStreamTools.readCompressed(new FileInputStream(var3)); + } + } catch (Exception var4) { + logger.warn("Failed to load player data for " + p_75752_1_.getCommandSenderName()); + } + + if (var2 != null) { + p_75752_1_.readFromNBT(var2); + } + + return var2; + } + + /** + * returns null if no saveHandler is relevent (eg. SMP) + */ + public IPlayerFileData getSaveHandler() { + return this; + } + + /** + * Returns an array of usernames for which player.dat exists for. + */ + public String[] getAvailablePlayerDat() { + String[] var1 = this.playersDirectory.list(); + + for (int var2 = 0; var2 < var1.length; ++var2) { + if (var1[var2].endsWith(".dat")) { + var1[var2] = var1[var2].substring(0, var1[var2].length() - 4); + } + } + + return var1; + } + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + public void flush() {} + + /** + * Gets the file location of the given map + */ + public File getMapFileFromName(String p_75758_1_) { + return new File(this.mapDataDir, p_75758_1_ + ".dat"); + } + + /** + * Returns the name of the directory where world information is saved. + */ + public String getWorldDirectoryName() { + return this.saveDirectoryName; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java new file mode 100644 index 0000000..078a4db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java @@ -0,0 +1,73 @@ +package net.minecraft.world.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; + +public class SaveHandlerMP implements ISaveHandler { + + + /** + * Loads and returns the world info + */ + public WorldInfo loadWorldInfo() { + return null; + } + + /** + * Checks the session lock to prevent save collisions + */ + public void checkSessionLock() throws MinecraftException {} + + /** + * Returns the chunk loader with the provided world provider + */ + public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) { + return null; + } + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + public void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_) {} + + /** + * Saves the passed in world info. + */ + public void saveWorldInfo(WorldInfo p_75761_1_) {} + + /** + * returns null if no saveHandler is relevent (eg. SMP) + */ + public IPlayerFileData getSaveHandler() { + return null; + } + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + public void flush() {} + + /** + * Gets the file location of the given map + */ + public File getMapFileFromName(String p_75758_1_) { + return null; + } + + /** + * Returns the name of the directory where world information is saved. + */ + public String getWorldDirectoryName() { + return "none"; + } + + /** + * Gets the File object corresponding to the base directory of this world. + */ + public File getWorldDirectory() { + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ThreadedFileIOBase.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ThreadedFileIOBase.java new file mode 100644 index 0000000..08d4c6e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/ThreadedFileIOBase.java @@ -0,0 +1,76 @@ +package net.minecraft.world.storage; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ThreadedFileIOBase implements Runnable { + /** Instance of ThreadedFileIOBase */ + public static final ThreadedFileIOBase threadedIOInstance = new ThreadedFileIOBase(); + private final List threadedIOQueue = Collections.synchronizedList(new ArrayList()); + private volatile long writeQueuedCounter; + private volatile long savedIOCounter; + private volatile boolean isThreadWaiting; + + + private ThreadedFileIOBase() { + Thread var1 = new Thread(this, "File IO Thread"); + var1.setPriority(1); + var1.start(); + } + + public void run() { + while (true) { + this.processQueue(); + } + } + + /** + * Process the items that are in the queue + */ + private void processQueue() { + for (int var1 = 0; var1 < this.threadedIOQueue.size(); ++var1) { + IThreadedFileIO var2 = (IThreadedFileIO)this.threadedIOQueue.get(var1); + boolean var3 = var2.writeNextIO(); + + if (!var3) { + this.threadedIOQueue.remove(var1--); + ++this.savedIOCounter; + } + + try { + Thread.sleep(this.isThreadWaiting ? 0L : 10L); + } catch (InterruptedException var6) { + var6.printStackTrace(); + } + } + + if (this.threadedIOQueue.isEmpty()) { + try { + Thread.sleep(25L); + } catch (InterruptedException var5) { + var5.printStackTrace(); + } + } + } + + /** + * threaded io + */ + public void queueIO(IThreadedFileIO p_75735_1_) { + if (!this.threadedIOQueue.contains(p_75735_1_)) { + ++this.writeQueuedCounter; + this.threadedIOQueue.add(p_75735_1_); + } + } + + public void waitForFinish() throws InterruptedException { + this.isThreadWaiting = true; + + while (this.writeQueuedCounter != this.savedIOCounter) { + Thread.sleep(10L); + } + + this.isThreadWaiting = false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/WorldInfo.java b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/WorldInfo.java new file mode 100644 index 0000000..59a28c4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/minecraft/world/storage/WorldInfo.java @@ -0,0 +1,578 @@ +package net.minecraft.world.storage; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.GameRules; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class WorldInfo { + /** Holds the seed of the currently world. */ + private long randomSeed; + private WorldType terrainType; + private String generatorOptions; + + /** The spawn zone position X coordinate. */ + private int spawnX; + + /** The spawn zone position Y coordinate. */ + private int spawnY; + + /** The spawn zone position Z coordinate. */ + private int spawnZ; + + /** Total time for this world. */ + private long totalTime; + + /** The current world time in ticks, ranging from 0 to 23999. */ + private long worldTime; + + /** The last time the player was in this world. */ + private long lastTimePlayed; + + /** The size of entire save of current world on the disk, isn't exactly. */ + private long sizeOnDisk; + private NBTTagCompound playerTag; + private int dimension; + + /** The name of the save defined at world creation. */ + private String levelName; + + /** Introduced in beta 1.3, is the save version for future control. */ + private int saveVersion; + + /** True if it's raining, false otherwise. */ + private boolean raining; + + /** Number of ticks until next rain. */ + private int rainTime; + + /** Is thunderbolts failing now? */ + private boolean thundering; + + /** Number of ticks untils next thunderbolt. */ + private int thunderTime; + + /** The Game Type. */ + private WorldSettings.GameType theGameType; + + /** + * Whether the map features (e.g. strongholds) generation is enabled or disabled. + */ + private boolean mapFeaturesEnabled; + + /** Hardcore mode flag */ + private boolean hardcore; + private boolean allowCommands; + private boolean initialized; + private GameRules theGameRules; + + + protected WorldInfo() { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + } + + public WorldInfo(NBTTagCompound p_i2157_1_) { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + this.randomSeed = p_i2157_1_.getLong("RandomSeed"); + + if (p_i2157_1_.func_150297_b("generatorName", 8)) { + String var2 = p_i2157_1_.getString("generatorName"); + this.terrainType = WorldType.parseWorldType(var2); + + if (this.terrainType == null) { + this.terrainType = WorldType.DEFAULT; + } else if (this.terrainType.isVersioned()) { + int var3 = 0; + + if (p_i2157_1_.func_150297_b("generatorVersion", 99)) { + var3 = p_i2157_1_.getInteger("generatorVersion"); + } + + this.terrainType = this.terrainType.getWorldTypeForGeneratorVersion(var3); + } + + if (p_i2157_1_.func_150297_b("generatorOptions", 8)) { + this.generatorOptions = p_i2157_1_.getString("generatorOptions"); + } + } + + this.theGameType = WorldSettings.GameType.getByID(p_i2157_1_.getInteger("GameType")); + + if (p_i2157_1_.func_150297_b("MapFeatures", 99)) { + this.mapFeaturesEnabled = p_i2157_1_.getBoolean("MapFeatures"); + } else { + this.mapFeaturesEnabled = true; + } + + this.spawnX = p_i2157_1_.getInteger("SpawnX"); + this.spawnY = p_i2157_1_.getInteger("SpawnY"); + this.spawnZ = p_i2157_1_.getInteger("SpawnZ"); + this.totalTime = p_i2157_1_.getLong("Time"); + + if (p_i2157_1_.func_150297_b("DayTime", 99)) { + this.worldTime = p_i2157_1_.getLong("DayTime"); + } else { + this.worldTime = this.totalTime; + } + + this.lastTimePlayed = p_i2157_1_.getLong("LastPlayed"); + this.sizeOnDisk = p_i2157_1_.getLong("SizeOnDisk"); + this.levelName = p_i2157_1_.getString("LevelName"); + this.saveVersion = p_i2157_1_.getInteger("version"); + this.rainTime = p_i2157_1_.getInteger("rainTime"); + this.raining = p_i2157_1_.getBoolean("raining"); + this.thunderTime = p_i2157_1_.getInteger("thunderTime"); + this.thundering = p_i2157_1_.getBoolean("thundering"); + this.hardcore = p_i2157_1_.getBoolean("hardcore"); + + if (p_i2157_1_.func_150297_b("initialized", 99)) { + this.initialized = p_i2157_1_.getBoolean("initialized"); + } else { + this.initialized = true; + } + + if (p_i2157_1_.func_150297_b("allowCommands", 99)) { + this.allowCommands = p_i2157_1_.getBoolean("allowCommands"); + } else { + this.allowCommands = this.theGameType == WorldSettings.GameType.CREATIVE; + } + + if (p_i2157_1_.func_150297_b("Player", 10)) { + this.playerTag = p_i2157_1_.getCompoundTag("Player"); + this.dimension = this.playerTag.getInteger("Dimension"); + } + + if (p_i2157_1_.func_150297_b("GameRules", 10)) { + this.theGameRules.readGameRulesFromNBT(p_i2157_1_.getCompoundTag("GameRules")); + } + } + + public WorldInfo(WorldSettings p_i2158_1_, String p_i2158_2_) { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + this.randomSeed = p_i2158_1_.getSeed(); + this.theGameType = p_i2158_1_.getGameType(); + this.mapFeaturesEnabled = p_i2158_1_.isMapFeaturesEnabled(); + this.levelName = p_i2158_2_; + this.hardcore = p_i2158_1_.getHardcoreEnabled(); + this.terrainType = p_i2158_1_.getTerrainType(); + this.generatorOptions = p_i2158_1_.func_82749_j(); + this.allowCommands = p_i2158_1_.areCommandsAllowed(); + this.initialized = false; + } + + public WorldInfo(WorldInfo p_i2159_1_) { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + this.randomSeed = p_i2159_1_.randomSeed; + this.terrainType = p_i2159_1_.terrainType; + this.generatorOptions = p_i2159_1_.generatorOptions; + this.theGameType = p_i2159_1_.theGameType; + this.mapFeaturesEnabled = p_i2159_1_.mapFeaturesEnabled; + this.spawnX = p_i2159_1_.spawnX; + this.spawnY = p_i2159_1_.spawnY; + this.spawnZ = p_i2159_1_.spawnZ; + this.totalTime = p_i2159_1_.totalTime; + this.worldTime = p_i2159_1_.worldTime; + this.lastTimePlayed = p_i2159_1_.lastTimePlayed; + this.sizeOnDisk = p_i2159_1_.sizeOnDisk; + this.playerTag = p_i2159_1_.playerTag; + this.dimension = p_i2159_1_.dimension; + this.levelName = p_i2159_1_.levelName; + this.saveVersion = p_i2159_1_.saveVersion; + this.rainTime = p_i2159_1_.rainTime; + this.raining = p_i2159_1_.raining; + this.thunderTime = p_i2159_1_.thunderTime; + this.thundering = p_i2159_1_.thundering; + this.hardcore = p_i2159_1_.hardcore; + this.allowCommands = p_i2159_1_.allowCommands; + this.initialized = p_i2159_1_.initialized; + this.theGameRules = p_i2159_1_.theGameRules; + } + + /** + * Gets the NBTTagCompound for the worldInfo + */ + public NBTTagCompound getNBTTagCompound() { + NBTTagCompound var1 = new NBTTagCompound(); + this.updateTagCompound(var1, this.playerTag); + return var1; + } + + /** + * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" + */ + public NBTTagCompound cloneNBTCompound(NBTTagCompound p_76082_1_) { + NBTTagCompound var2 = new NBTTagCompound(); + this.updateTagCompound(var2, p_76082_1_); + return var2; + } + + private void updateTagCompound(NBTTagCompound p_76064_1_, NBTTagCompound p_76064_2_) { + p_76064_1_.setLong("RandomSeed", this.randomSeed); + p_76064_1_.setString("generatorName", this.terrainType.getWorldTypeName()); + p_76064_1_.setInteger("generatorVersion", this.terrainType.getGeneratorVersion()); + p_76064_1_.setString("generatorOptions", this.generatorOptions); + p_76064_1_.setInteger("GameType", this.theGameType.getID()); + p_76064_1_.setBoolean("MapFeatures", this.mapFeaturesEnabled); + p_76064_1_.setInteger("SpawnX", this.spawnX); + p_76064_1_.setInteger("SpawnY", this.spawnY); + p_76064_1_.setInteger("SpawnZ", this.spawnZ); + p_76064_1_.setLong("Time", this.totalTime); + p_76064_1_.setLong("DayTime", this.worldTime); + p_76064_1_.setLong("SizeOnDisk", this.sizeOnDisk); + p_76064_1_.setLong("LastPlayed", MinecraftServer.getSystemTimeMillis()); + p_76064_1_.setString("LevelName", this.levelName); + p_76064_1_.setInteger("version", this.saveVersion); + p_76064_1_.setInteger("rainTime", this.rainTime); + p_76064_1_.setBoolean("raining", this.raining); + p_76064_1_.setInteger("thunderTime", this.thunderTime); + p_76064_1_.setBoolean("thundering", this.thundering); + p_76064_1_.setBoolean("hardcore", this.hardcore); + p_76064_1_.setBoolean("allowCommands", this.allowCommands); + p_76064_1_.setBoolean("initialized", this.initialized); + p_76064_1_.setTag("GameRules", this.theGameRules.writeGameRulesToNBT()); + + if (p_76064_2_ != null) { + p_76064_1_.setTag("Player", p_76064_2_); + } + } + + /** + * Returns the seed of current world. + */ + public long getSeed() { + return this.randomSeed; + } + + /** + * Returns the x spawn position + */ + public int getSpawnX() { + return this.spawnX; + } + + /** + * Return the Y axis spawning point of the player. + */ + public int getSpawnY() { + return this.spawnY; + } + + /** + * Returns the z spawn position + */ + public int getSpawnZ() { + return this.spawnZ; + } + + public long getWorldTotalTime() { + return this.totalTime; + } + + /** + * Get current world time + */ + public long getWorldTime() { + return this.worldTime; + } + + public long getSizeOnDisk() { + return this.sizeOnDisk; + } + + /** + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() { + return this.playerTag; + } + + /** + * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer + * WorldProvider.dimensionID accessed from World.provider.dimensionID + */ + public int getVanillaDimension() { + return this.dimension; + } + + /** + * Set the x spawn position to the passed in value + */ + public void setSpawnX(int p_76058_1_) { + this.spawnX = p_76058_1_; + } + + /** + * Sets the y spawn position + */ + public void setSpawnY(int p_76056_1_) { + this.spawnY = p_76056_1_; + } + + /** + * Set the z spawn position to the passed in value + */ + public void setSpawnZ(int p_76087_1_) { + this.spawnZ = p_76087_1_; + } + + public void incrementTotalWorldTime(long p_82572_1_) { + this.totalTime = p_82572_1_; + } + + /** + * Set current world time + */ + public void setWorldTime(long p_76068_1_) { + this.worldTime = p_76068_1_; + } + + /** + * Sets the spawn zone position. Args: x, y, z + */ + public void setSpawnPosition(int p_76081_1_, int p_76081_2_, int p_76081_3_) { + this.spawnX = p_76081_1_; + this.spawnY = p_76081_2_; + this.spawnZ = p_76081_3_; + } + + /** + * Get current world name + */ + public String getWorldName() { + return this.levelName; + } + + public void setWorldName(String p_76062_1_) { + this.levelName = p_76062_1_; + } + + /** + * Returns the save version of this world + */ + public int getSaveVersion() { + return this.saveVersion; + } + + /** + * Sets the save version of the world + */ + public void setSaveVersion(int p_76078_1_) { + this.saveVersion = p_76078_1_; + } + + /** + * Return the last time the player was in this world. + */ + public long getLastTimePlayed() { + return this.lastTimePlayed; + } + + /** + * Returns true if it is thundering, false otherwise. + */ + public boolean isThundering() { + return this.thundering; + } + + /** + * Sets whether it is thundering or not. + */ + public void setThundering(boolean p_76069_1_) { + this.thundering = p_76069_1_; + } + + /** + * Returns the number of ticks until next thunderbolt. + */ + public int getThunderTime() { + return this.thunderTime; + } + + /** + * Defines the number of ticks until next thunderbolt. + */ + public void setThunderTime(int p_76090_1_) { + this.thunderTime = p_76090_1_; + } + + /** + * Returns true if it is raining, false otherwise. + */ + public boolean isRaining() { + return this.raining; + } + + /** + * Sets whether it is raining or not. + */ + public void setRaining(boolean p_76084_1_) { + this.raining = p_76084_1_; + } + + /** + * Return the number of ticks until rain. + */ + public int getRainTime() { + return this.rainTime; + } + + /** + * Sets the number of ticks until rain. + */ + public void setRainTime(int p_76080_1_) { + this.rainTime = p_76080_1_; + } + + /** + * Gets the GameType. + */ + public WorldSettings.GameType getGameType() { + return this.theGameType; + } + + /** + * Get whether the map features (e.g. strongholds) generation is enabled or disabled. + */ + public boolean isMapFeaturesEnabled() { + return this.mapFeaturesEnabled; + } + + /** + * Sets the GameType. + */ + public void setGameType(WorldSettings.GameType p_76060_1_) { + this.theGameType = p_76060_1_; + } + + /** + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean isHardcoreModeEnabled() { + return this.hardcore; + } + + public WorldType getTerrainType() { + return this.terrainType; + } + + public void setTerrainType(WorldType p_76085_1_) { + this.terrainType = p_76085_1_; + } + + public String getGeneratorOptions() { + return this.generatorOptions; + } + + /** + * Returns true if commands are allowed on this World. + */ + public boolean areCommandsAllowed() { + return this.allowCommands; + } + + /** + * Returns true if the World is initialized. + */ + public boolean isInitialized() { + return this.initialized; + } + + /** + * Sets the initialization status of the World. + */ + public void setServerInitialized(boolean p_76091_1_) { + this.initialized = p_76091_1_; + } + + /** + * Gets the GameRules class Instance. + */ + public GameRules getGameRulesInstance() { + return this.theGameRules; + } + + /** + * Adds this WorldInfo instance to the crash report. + */ + public void addToCrashReport(CrashReportCategory p_85118_1_) { + p_85118_1_.addCrashSectionCallable("Level seed", new Callable() { + + public String call() { + return String.valueOf(WorldInfo.this.getSeed()); + } + }); + p_85118_1_.addCrashSectionCallable("Level generator", new Callable() { + + public String call() { + return String.format("ID %02d - %s, ver %d. Features enabled: %b", Integer.valueOf(WorldInfo.this.terrainType.getWorldTypeID()), WorldInfo.this.terrainType.getWorldTypeName(), Integer.valueOf(WorldInfo.this.terrainType.getGeneratorVersion()), Boolean.valueOf(WorldInfo.this.mapFeaturesEnabled)); + } + }); + p_85118_1_.addCrashSectionCallable("Level generator options", new Callable() { + + public String call() { + return WorldInfo.this.generatorOptions; + } + }); + p_85118_1_.addCrashSectionCallable("Level spawn location", new Callable() { + + public String call() { + return CrashReportCategory.getLocationInfo(WorldInfo.this.spawnX, WorldInfo.this.spawnY, WorldInfo.this.spawnZ); + } + }); + p_85118_1_.addCrashSectionCallable("Level time", new Callable() { + + public String call() { + return String.format("%d game time, %d day time", Long.valueOf(WorldInfo.this.totalTime), Long.valueOf(WorldInfo.this.worldTime)); + } + }); + p_85118_1_.addCrashSectionCallable("Level dimension", new Callable() { + + public String call() { + return String.valueOf(WorldInfo.this.dimension); + } + }); + p_85118_1_.addCrashSectionCallable("Level storage version", new Callable() { + + public String call() { + String var1 = "Unknown?"; + + try { + switch (WorldInfo.this.saveVersion) { + case 19132: + var1 = "McRegion"; + break; + + case 19133: + var1 = "Anvil"; + } + } catch (Throwable var3) { + } + + return String.format("0x%05X - %s", Integer.valueOf(WorldInfo.this.saveVersion), var1); + } + }); + p_85118_1_.addCrashSectionCallable("Level weather", new Callable() { + + public String call() { + return String.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", Integer.valueOf(WorldInfo.this.rainTime), Boolean.valueOf(WorldInfo.this.raining), Integer.valueOf(WorldInfo.this.thunderTime), Boolean.valueOf(WorldInfo.this.thundering)); + } + }); + p_85118_1_.addCrashSectionCallable("Level game mode", new Callable() { + + public String call() { + return String.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", WorldInfo.this.theGameType.getName(), Integer.valueOf(WorldInfo.this.theGameType.getID()), Boolean.valueOf(WorldInfo.this.hardcore), Boolean.valueOf(WorldInfo.this.allowCommands)); + } + }); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ConstantFloat.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ConstantFloat.java new file mode 100644 index 0000000..51b5e36 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ConstantFloat.java @@ -0,0 +1,21 @@ +package net.optifine.entity.model.anim; + +public class ConstantFloat implements IExpressionFloat { + private float value; + + public ConstantFloat(float value) { + this.value = value; + } + + public float eval() { + return this.value; + } + + public ExpressionType getExpressionType() { + return ExpressionType.FLOAT; + } + + public String toString() { + return "" + this.value; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ExpressionParser.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ExpressionParser.java new file mode 100644 index 0000000..fd21ba0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ExpressionParser.java @@ -0,0 +1,356 @@ +package net.optifine.entity.model.anim; + +import java.io.IOException; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Deque; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import net.minecraft.src.Config; + +public class ExpressionParser { + private IExpressionResolver expressionResolver; + + public ExpressionParser(IExpressionResolver expressionResolver) { + this.expressionResolver = expressionResolver; + } + + public IExpressionFloat parseFloat(String str) throws ParseException { + IExpression expr = this.parse(str); + + if (!(expr instanceof IExpressionFloat)) { + throw new ParseException("Not a float expression: " + expr.getExpressionType()); + } else { + return (IExpressionFloat)expr; + } + } + + public IExpressionBool parseBool(String str) throws ParseException { + IExpression expr = this.parse(str); + + if (!(expr instanceof IExpressionBool)) { + throw new ParseException("Not a boolean expression: " + expr.getExpressionType()); + } else { + return (IExpressionBool)expr; + } + } + + public IExpression parse(String str) throws ParseException { + try { + Token[] e = TokenParser.parse(str); + + if (e == null) { + return null; + } else { + ArrayDeque deque = new ArrayDeque(Arrays.asList(e)); + return this.parseInfix(deque); + } + } catch (IOException var4) { + throw new ParseException(var4.getMessage(), var4); + } + } + + private IExpression parseInfix(Deque deque) throws ParseException { + if (deque.isEmpty()) { + return null; + } else { + LinkedList listExpr = new LinkedList(); + LinkedList listOperTokens = new LinkedList(); + IExpression expr = this.parseExpression(deque); + checkNull(expr, "Missing expression"); + listExpr.add(expr); + + while (true) { + Token tokenOper = (Token)deque.poll(); + + if (tokenOper == null) { + return this.makeInfix(listExpr, listOperTokens); + } + + if (tokenOper.getType() != TokenType.OPERATOR) { + throw new ParseException("Invalid operator: " + tokenOper); + } + + IExpression expr2 = this.parseExpression(deque); + checkNull(expr2, "Missing expression"); + listOperTokens.add(tokenOper); + listExpr.add(expr2); + } + } + } + + private IExpression makeInfix(List listExpr, List listOper) throws ParseException { + LinkedList listFunc = new LinkedList(); + Iterator it = listOper.iterator(); + + while (it.hasNext()) { + Token token = (Token)it.next(); + FunctionType type = FunctionType.parse(token.getText()); + checkNull(type, "Invalid operator: " + token); + listFunc.add(type); + } + + return this.makeInfixFunc(listExpr, listFunc); + } + + private IExpression makeInfixFunc(List listExpr, List listFunc) throws ParseException { + if (listExpr.size() != listFunc.size() + 1) { + throw new ParseException("Invalid infix expression, expressions: " + listExpr.size() + ", operators: " + listFunc.size()); + } else if (listExpr.size() == 1) { + return (IExpression)listExpr.get(0); + } else { + int minPrecedence = Integer.MAX_VALUE; + int maxPrecedence = Integer.MIN_VALUE; + FunctionType type; + + for (Iterator i = listFunc.iterator(); i.hasNext(); maxPrecedence = Math.max(type.getPrecedence(), maxPrecedence)) { + type = (FunctionType)i.next(); + minPrecedence = Math.min(type.getPrecedence(), minPrecedence); + } + + if (maxPrecedence >= minPrecedence && maxPrecedence - minPrecedence <= 10) { + for (int var7 = maxPrecedence; var7 >= minPrecedence; --var7) { + this.mergeOperators(listExpr, listFunc, var7); + } + + if (listExpr.size() == 1 && listFunc.size() == 0) { + return (IExpression)listExpr.get(0); + } else { + throw new ParseException("Error merging operators, expressions: " + listExpr.size() + ", operators: " + listFunc.size()); + } + } else { + throw new ParseException("Invalid infix precedence, min: " + minPrecedence + ", max: " + maxPrecedence); + } + } + } + + private void mergeOperators(List listExpr, List listFuncs, int precedence) throws ParseException { + for (int i = 0; i < listFuncs.size(); ++i) { + FunctionType type = (FunctionType)listFuncs.get(i); + + if (type.getPrecedence() == precedence) { + listFuncs.remove(i); + IExpression expr1 = (IExpression)listExpr.remove(i); + IExpression expr2 = (IExpression)listExpr.remove(i); + IExpression exprOper = makeFunction(type, new IExpression[] {expr1, expr2}); + listExpr.add(i, exprOper); + --i; + } + } + } + + private IExpression parseExpression(Deque deque) throws ParseException { + Token token = (Token)deque.poll(); + checkNull(token, "Missing expression"); + + switch (ExpressionParser.NamelessClass1693721543.$SwitchMap$net$optifine$entity$model$anim$TokenType[token.getType().ordinal()]) { + case 1: + return makeConstantFloat(token); + + case 2: + FunctionType type = this.getFunctionType(token, deque); + + if (type != null) { + return this.makeFunction(type, deque); + } + + return this.makeVariable(token); + + case 3: + return this.makeBracketed(token, deque); + + case 4: + FunctionType operType = FunctionType.parse(token.getText()); + checkNull(operType, "Invalid operator: " + token); + + if (operType == FunctionType.PLUS) { + return this.parseExpression(deque); + } else { + IExpression exprNot; + + if (operType == FunctionType.MINUS) { + exprNot = this.parseExpression(deque); + return makeFunction(FunctionType.NEG, new IExpression[] {exprNot}); + } else if (operType == FunctionType.NOT) { + exprNot = this.parseExpression(deque); + return makeFunction(FunctionType.NOT, new IExpression[] {exprNot}); + } + } + + default: + throw new ParseException("Invalid expression: " + token); + } + } + + private static IExpression makeConstantFloat(Token token) throws ParseException { + float val = Config.parseFloat(token.getText(), Float.NaN); + + if (val == Float.NaN) { + throw new ParseException("Invalid float value: " + token); + } else { + return new ConstantFloat(val); + } + } + + private FunctionType getFunctionType(Token token, Deque deque) throws ParseException { + Token tokenNext = (Token)deque.peek(); + FunctionType type; + + if (tokenNext != null && tokenNext.getType() == TokenType.BRACKET_OPEN) { + type = FunctionType.parse(token.getText()); + checkNull(type, "Unknown function: " + token); + return type; + } else { + type = FunctionType.parse(token.getText()); + + if (type == null) { + return null; + } else if (type.getParameterCount(new IExpression[0]) > 0) { + throw new ParseException("Missing arguments: " + type); + } else { + return type; + } + } + } + + private IExpression makeFunction(FunctionType type, Deque deque) throws ParseException { + if (type.getParameterCount(new IExpression[0]) == 0) { + return makeFunction(type, new IExpression[0]); + } else { + Token tokenOpen = (Token)deque.poll(); + Deque dequeBracketed = getGroup(deque, TokenType.BRACKET_CLOSE, true); + IExpression[] exprs = this.parseExpressions(dequeBracketed); + return makeFunction(type, exprs); + } + } + + private IExpression[] parseExpressions(Deque deque) throws ParseException { + ArrayList list = new ArrayList(); + + while (true) { + Deque exprs = getGroup(deque, TokenType.COMMA, false); + IExpression expr = this.parseInfix(exprs); + + if (expr == null) { + IExpression[] exprs1 = (IExpression[])((IExpression[])list.toArray(new IExpression[list.size()])); + return exprs1; + } + + list.add(expr); + } + } + + private static IExpression makeFunction(FunctionType type, IExpression[] args) throws ParseException { + ExpressionType[] funcParamTypes = type.getParameterTypes(args); + + if (args.length != funcParamTypes.length) { + throw new ParseException("Invalid number of arguments, function: \"" + type.getName() + "\", count arguments: " + args.length + ", should be: " + funcParamTypes.length); + } else { + for (int i = 0; i < args.length; ++i) { + IExpression arg = args[i]; + ExpressionType argType = arg.getExpressionType(); + ExpressionType funcParamType = funcParamTypes[i]; + + if (argType != funcParamType) { + throw new ParseException("Invalid argument type, function: \"" + type.getName() + "\", index: " + i + ", type: " + argType + ", should be: " + funcParamType); + } + } + + if (type.getExpressionType() == ExpressionType.FLOAT) { + return new FunctionFloat(type, args); + } else if (type.getExpressionType() == ExpressionType.BOOL) { + return new FunctionBool(type, args); + } else { + throw new ParseException("Unknown function type: " + type.getExpressionType() + ", function: " + type.getName()); + } + } + } + + private IExpression makeVariable(Token token) throws ParseException { + if (this.expressionResolver == null) { + throw new ParseException("Model variable not found: " + token); + } else { + IExpression expr = this.expressionResolver.getExpression(token.getText()); + + if (expr == null) { + throw new ParseException("Model variable not found: " + token); + } else { + return expr; + } + } + } + + private IExpression makeBracketed(Token token, Deque deque) throws ParseException { + Deque dequeBracketed = getGroup(deque, TokenType.BRACKET_CLOSE, true); + return this.parseInfix(dequeBracketed); + } + + private static Deque getGroup(Deque deque, TokenType tokenTypeEnd, boolean tokenEndRequired) throws ParseException { + ArrayDeque dequeGroup = new ArrayDeque(); + int level = 0; + Iterator it = deque.iterator(); + + while (it.hasNext()) { + Token token = (Token)it.next(); + it.remove(); + + if (level == 0 && token.getType() == tokenTypeEnd) { + return dequeGroup; + } + + dequeGroup.add(token); + + if (token.getType() == TokenType.BRACKET_OPEN) { + ++level; + } + + if (token.getType() == TokenType.BRACKET_CLOSE) { + --level; + } + } + + if (tokenEndRequired) { + throw new ParseException("Missing end token: " + tokenTypeEnd); + } else { + return dequeGroup; + } + } + + private static void checkNull(Object obj, String message) throws ParseException { + if (obj == null) { + throw new ParseException(message); + } + } + + static class NamelessClass1693721543 { + static final int[] $SwitchMap$net$optifine$entity$model$anim$TokenType = new int[TokenType.values().length]; + + static { + try { + $SwitchMap$net$optifine$entity$model$anim$TokenType[TokenType.NUMBER.ordinal()] = 1; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$TokenType[TokenType.IDENTIFIER.ordinal()] = 2; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$TokenType[TokenType.BRACKET_OPEN.ordinal()] = 3; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$TokenType[TokenType.OPERATOR.ordinal()] = 4; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ExpressionType.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ExpressionType.java new file mode 100644 index 0000000..d4b4765 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ExpressionType.java @@ -0,0 +1,6 @@ +package net.optifine.entity.model.anim; + +public enum ExpressionType { + FLOAT, + BOOL; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionBool.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionBool.java new file mode 100644 index 0000000..9b2ce11 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionBool.java @@ -0,0 +1,23 @@ +package net.optifine.entity.model.anim; + +public class FunctionBool implements IExpressionBool { + private FunctionType type; + private IExpression[] arguments; + + public FunctionBool(FunctionType type, IExpression[] arguments) { + this.type = type; + this.arguments = arguments; + } + + public boolean eval() { + return this.type.evalBool(this.arguments); + } + + public ExpressionType getExpressionType() { + return ExpressionType.BOOL; + } + + public String toString() { + return "" + this.type + "()"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionFloat.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionFloat.java new file mode 100644 index 0000000..e08fcfd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionFloat.java @@ -0,0 +1,23 @@ +package net.optifine.entity.model.anim; + +public class FunctionFloat implements IExpressionFloat { + private FunctionType type; + private IExpression[] arguments; + + public FunctionFloat(FunctionType type, IExpression[] arguments) { + this.type = type; + this.arguments = arguments; + } + + public float eval() { + return this.type.evalFloat(this.arguments); + } + + public ExpressionType getExpressionType() { + return ExpressionType.FLOAT; + } + + public String toString() { + return "" + this.type + "()"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionType.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionType.java new file mode 100644 index 0000000..414eb90 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/FunctionType.java @@ -0,0 +1,666 @@ +package net.optifine.entity.model.anim; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.src.Config; +import net.minecraft.src.MathUtils; +import net.minecraft.util.MathHelper; +import shadersmod.uniform.Smoother; + +public enum FunctionType { + PLUS(10, ExpressionType.FLOAT, "+", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + MINUS(10, ExpressionType.FLOAT, "-", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + MUL(11, ExpressionType.FLOAT, "*", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + DIV(11, ExpressionType.FLOAT, "/", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + MOD(11, ExpressionType.FLOAT, "%", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + NEG(12, ExpressionType.FLOAT, "neg", new ExpressionType[]{ExpressionType.FLOAT}), + PI(ExpressionType.FLOAT, "pi", new ExpressionType[0]), + SIN(ExpressionType.FLOAT, "sin", new ExpressionType[]{ExpressionType.FLOAT}), + COS(ExpressionType.FLOAT, "cos", new ExpressionType[]{ExpressionType.FLOAT}), + ASIN(ExpressionType.FLOAT, "asin", new ExpressionType[]{ExpressionType.FLOAT}), + ACOS(ExpressionType.FLOAT, "acos", new ExpressionType[]{ExpressionType.FLOAT}), + TAN(ExpressionType.FLOAT, "tan", new ExpressionType[]{ExpressionType.FLOAT}), + ATAN(ExpressionType.FLOAT, "atan", new ExpressionType[]{ExpressionType.FLOAT}), + ATAN2(ExpressionType.FLOAT, "atan2", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + TORAD(ExpressionType.FLOAT, "torad", new ExpressionType[]{ExpressionType.FLOAT}), + TODEG(ExpressionType.FLOAT, "todeg", new ExpressionType[]{ExpressionType.FLOAT}), + MIN(ExpressionType.FLOAT, "min", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT})), + MAX(ExpressionType.FLOAT, "max", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT})), + CLAMP(ExpressionType.FLOAT, "clamp", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}), + ABS(ExpressionType.FLOAT, "abs", new ExpressionType[]{ExpressionType.FLOAT}), + FLOOR(ExpressionType.FLOAT, "floor", new ExpressionType[]{ExpressionType.FLOAT}), + CEIL(ExpressionType.FLOAT, "ceil", new ExpressionType[]{ExpressionType.FLOAT}), + EXP(ExpressionType.FLOAT, "exp", new ExpressionType[]{ExpressionType.FLOAT}), + FRAC(ExpressionType.FLOAT, "frac", new ExpressionType[]{ExpressionType.FLOAT}), + LOG(ExpressionType.FLOAT, "log", new ExpressionType[]{ExpressionType.FLOAT}), + POW(ExpressionType.FLOAT, "pow", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + RANDOM(ExpressionType.FLOAT, "random", new ExpressionType[0]), + ROUND(ExpressionType.FLOAT, "round", new ExpressionType[]{ExpressionType.FLOAT}), + SIGNUM(ExpressionType.FLOAT, "signum", new ExpressionType[]{ExpressionType.FLOAT}), + SQRT(ExpressionType.FLOAT, "sqrt", new ExpressionType[]{ExpressionType.FLOAT}), + FMOD(ExpressionType.FLOAT, "fmod", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + TIME(ExpressionType.FLOAT, "time", new ExpressionType[0]), + IF(ExpressionType.FLOAT, "if", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.BOOL, ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.BOOL, ExpressionType.FLOAT}).last(new ExpressionType[]{ExpressionType.FLOAT})), + NOT(12, ExpressionType.BOOL, "!", new ExpressionType[]{ExpressionType.BOOL}), + AND(3, ExpressionType.BOOL, "&&", new ExpressionType[]{ExpressionType.BOOL, ExpressionType.BOOL}), + OR(2, ExpressionType.BOOL, "||", new ExpressionType[]{ExpressionType.BOOL, ExpressionType.BOOL}), + GREATER(8, ExpressionType.BOOL, ">", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + GREATER_OR_EQUAL(8, ExpressionType.BOOL, ">=", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + SMALLER(8, ExpressionType.BOOL, "<", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + SMALLER_OR_EQUAL(8, ExpressionType.BOOL, "<=", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + EQUAL(7, ExpressionType.BOOL, "==", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + NOT_EQUAL(7, ExpressionType.BOOL, "!=", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}), + BETWEEN(7, ExpressionType.BOOL, "between", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}), + EQUALS(7, ExpressionType.BOOL, "equals", new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT, ExpressionType.FLOAT}), + IN(ExpressionType.BOOL, "in", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT}).last(new ExpressionType[]{ExpressionType.FLOAT})), + SMOOTH(ExpressionType.FLOAT, "smooth", (new ParametersVariable()).first(new ExpressionType[]{ExpressionType.FLOAT, ExpressionType.FLOAT}).repeat(new ExpressionType[]{ExpressionType.FLOAT}).maxCount(4)), + TRUE(ExpressionType.BOOL, "true", new ExpressionType[0]), + FALSE(ExpressionType.BOOL, "false", new ExpressionType[0]); + private int precedence; + private ExpressionType expressionType; + private String name; + private IParameters parameters; + public static FunctionType[] VALUES = values(); + private static final Map mapSmooth = new HashMap(); + + private FunctionType(ExpressionType expressionType, String name, ExpressionType ... parameterTypes) { + this(0, expressionType, name, parameterTypes); + } + + private FunctionType(int precedence, ExpressionType expressionType, String name, ExpressionType ... parameterTypes) { + this(precedence, expressionType, name, (IParameters)(new Parameters(parameterTypes))); + } + + private FunctionType(ExpressionType expressionType, String name, IParameters parameters) { + this(0, expressionType, name, parameters); + } + + private FunctionType(int precedence, ExpressionType expressionType, String name, IParameters parameters) { + this.precedence = precedence; + this.expressionType = expressionType; + this.name = name; + this.parameters = parameters; + } + + public String getName() { + return this.name; + } + + public int getPrecedence() { + return this.precedence; + } + + public ExpressionType getExpressionType() { + return this.expressionType; + } + + public IParameters getParameters() { + return this.parameters; + } + + public int getParameterCount(IExpression[] arguments) { + return this.parameters.getParameterTypes(arguments).length; + } + + public ExpressionType[] getParameterTypes(IExpression[] arguments) { + return this.parameters.getParameterTypes(arguments); + } + + public float evalFloat(IExpression[] args) { + int id; + + switch (FunctionType.NamelessClass1084111997.$SwitchMap$net$optifine$entity$model$anim$FunctionType[this.ordinal()]) { + case 1: + return evalFloat(args, 0) + evalFloat(args, 1); + + case 2: + return evalFloat(args, 0) - evalFloat(args, 1); + + case 3: + return evalFloat(args, 0) * evalFloat(args, 1); + + case 4: + return evalFloat(args, 0) / evalFloat(args, 1); + + case 5: + float modX = evalFloat(args, 0); + float modY = evalFloat(args, 1); + return modX - modY * (float)((int)(modX / modY)); + + case 6: + return -evalFloat(args, 0); + + case 7: + return (float)Math.PI; + + case 8: + return MathHelper.sin(evalFloat(args, 0)); + + case 9: + return MathHelper.cos(evalFloat(args, 0)); + + case 10: + return (float)Math.asin((double)evalFloat(args, 0)); + + case 11: + return (float)Math.acos((double)evalFloat(args, 0)); + + case 12: + return (float)Math.tan((double)evalFloat(args, 0)); + + case 13: + return (float)Math.atan((double)evalFloat(args, 0)); + + case 14: + return (float)Math.atan2((double)evalFloat(args, 0), (double)evalFloat(args, 1)); + + case 15: + return MathUtils.toRad(evalFloat(args, 0)); + + case 16: + return MathUtils.toDeg(evalFloat(args, 0)); + + case 17: + return this.getMin(args); + + case 18: + return this.getMax(args); + + case 19: + return MathHelper.clamp_float(evalFloat(args, 0), evalFloat(args, 1), evalFloat(args, 2)); + + case 20: + return MathHelper.abs(evalFloat(args, 0)); + + case 21: + return (float)Math.exp((double)evalFloat(args, 0)); + + case 22: + return (float)MathHelper.floor_float(evalFloat(args, 0)); + + case 23: + return (float)MathHelper.ceiling_float_int(evalFloat(args, 0)); + + case 24: + float valFrac = evalFloat(args, 0); + return valFrac - (float)MathHelper.floor_float(valFrac); + + case 25: + return (float)Math.log((double)evalFloat(args, 0)); + + case 26: + return (float)Math.pow((double)evalFloat(args, 0), (double)evalFloat(args, 1)); + + case 27: + return (float)Math.random(); + + case 28: + return (float)Math.round(evalFloat(args, 0)); + + case 29: + return Math.signum(evalFloat(args, 0)); + + case 30: + return MathHelper.sqrt_float(evalFloat(args, 0)); + + case 31: + float fmodX = evalFloat(args, 0); + float fmodY = evalFloat(args, 1); + return fmodX - fmodY * (float)MathHelper.floor_float(fmodX / fmodY); + + case 32: + Minecraft mc = Minecraft.getMinecraft(); + WorldClient world = mc.theWorld; + + if (world == null) { + return 0.0F; + } + + return (float)(world.getTotalWorldTime() % 24000L) + Config.renderPartialTicks; + + case 33: + int countChecks = (args.length - 1) / 2; + + for (id = 0; id < countChecks; ++id) { + int var15 = id * 2; + + if (evalBool(args, var15)) { + return evalFloat(args, var15 + 1); + } + } + + return evalFloat(args, countChecks * 2); + + case 34: + id = (int)evalFloat(args, 0); + float valRaw = evalFloat(args, 1); + float valFadeUp = args.length > 2 ? evalFloat(args, 2) : 1.0F; + float valFadeDown = args.length > 3 ? evalFloat(args, 3) : valFadeUp; + float valSmooth = Smoother.getSmoothValue(id, valRaw, valFadeUp, valFadeDown); + return valSmooth; + + default: + Config.warn("Unknown function type: " + this); + return 0.0F; + } + } + + private float getMin(IExpression[] exprs) { + if (exprs.length == 2) { + return Math.min(evalFloat(exprs, 0), evalFloat(exprs, 1)); + } else { + float valMin = evalFloat(exprs, 0); + + for (int i = 1; i < exprs.length; ++i) { + float valExpr = evalFloat(exprs, i); + + if (valExpr < valMin) { + valMin = valExpr; + } + } + + return valMin; + } + } + + private float getMax(IExpression[] exprs) { + if (exprs.length == 2) { + return Math.max(evalFloat(exprs, 0), evalFloat(exprs, 1)); + } else { + float valMax = evalFloat(exprs, 0); + + for (int i = 1; i < exprs.length; ++i) { + float valExpr = evalFloat(exprs, i); + + if (valExpr > valMax) { + valMax = valExpr; + } + } + + return valMax; + } + } + + private static float evalFloat(IExpression[] exprs, int index) { + IExpressionFloat ef = (IExpressionFloat)exprs[index]; + float val = ef.eval(); + return val; + } + + public boolean evalBool(IExpression[] args) { + switch (FunctionType.NamelessClass1084111997.$SwitchMap$net$optifine$entity$model$anim$FunctionType[this.ordinal()]) { + case 35: + return true; + + case 36: + return false; + + case 37: + return !evalBool(args, 0); + + case 38: + return evalBool(args, 0) && evalBool(args, 1); + + case 39: + return evalBool(args, 0) || evalBool(args, 1); + + case 40: + return evalFloat(args, 0) > evalFloat(args, 1); + + case 41: + return evalFloat(args, 0) >= evalFloat(args, 1); + + case 42: + return evalFloat(args, 0) < evalFloat(args, 1); + + case 43: + return evalFloat(args, 0) <= evalFloat(args, 1); + + case 44: + return evalFloat(args, 0) == evalFloat(args, 1); + + case 45: + return evalFloat(args, 0) != evalFloat(args, 1); + + case 46: + float val = evalFloat(args, 0); + return val >= evalFloat(args, 1) && val <= evalFloat(args, 2); + + case 47: + float diff = evalFloat(args, 0) - evalFloat(args, 1); + float delta = evalFloat(args, 2); + return Math.abs(diff) <= delta; + + case 48: + float valIn = evalFloat(args, 0); + + for (int i = 1; i < args.length; ++i) { + float valCheck = evalFloat(args, i); + + if (valIn == valCheck) { + return true; + } + } + + return false; + + default: + Config.warn("Unknown function type: " + this); + return false; + } + } + + private static boolean evalBool(IExpression[] exprs, int index) { + IExpressionBool eb = (IExpressionBool)exprs[index]; + boolean val = eb.eval(); + return val; + } + + public static FunctionType parse(String str) { + for (int i = 0; i < VALUES.length; ++i) { + FunctionType ef = VALUES[i]; + + if (ef.getName().equals(str)) { + return ef; + } + } + + return null; + } + + static class NamelessClass1084111997 { + static final int[] $SwitchMap$net$optifine$entity$model$anim$FunctionType = new int[FunctionType.values().length]; + + static { + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.PLUS.ordinal()] = 1; + } catch (NoSuchFieldError var48) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.MINUS.ordinal()] = 2; + } catch (NoSuchFieldError var47) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.MUL.ordinal()] = 3; + } catch (NoSuchFieldError var46) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.DIV.ordinal()] = 4; + } catch (NoSuchFieldError var45) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.MOD.ordinal()] = 5; + } catch (NoSuchFieldError var44) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.NEG.ordinal()] = 6; + } catch (NoSuchFieldError var43) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.PI.ordinal()] = 7; + } catch (NoSuchFieldError var42) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.SIN.ordinal()] = 8; + } catch (NoSuchFieldError var41) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.COS.ordinal()] = 9; + } catch (NoSuchFieldError var40) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.ASIN.ordinal()] = 10; + } catch (NoSuchFieldError var39) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.ACOS.ordinal()] = 11; + } catch (NoSuchFieldError var38) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.TAN.ordinal()] = 12; + } catch (NoSuchFieldError var37) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.ATAN.ordinal()] = 13; + } catch (NoSuchFieldError var36) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.ATAN2.ordinal()] = 14; + } catch (NoSuchFieldError var35) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.TORAD.ordinal()] = 15; + } catch (NoSuchFieldError var34) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.TODEG.ordinal()] = 16; + } catch (NoSuchFieldError var33) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.MIN.ordinal()] = 17; + } catch (NoSuchFieldError var32) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.MAX.ordinal()] = 18; + } catch (NoSuchFieldError var31) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.CLAMP.ordinal()] = 19; + } catch (NoSuchFieldError var30) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.ABS.ordinal()] = 20; + } catch (NoSuchFieldError var29) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.EXP.ordinal()] = 21; + } catch (NoSuchFieldError var28) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.FLOOR.ordinal()] = 22; + } catch (NoSuchFieldError var27) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.CEIL.ordinal()] = 23; + } catch (NoSuchFieldError var26) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.FRAC.ordinal()] = 24; + } catch (NoSuchFieldError var25) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.LOG.ordinal()] = 25; + } catch (NoSuchFieldError var24) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.POW.ordinal()] = 26; + } catch (NoSuchFieldError var23) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.RANDOM.ordinal()] = 27; + } catch (NoSuchFieldError var22) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.ROUND.ordinal()] = 28; + } catch (NoSuchFieldError var21) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.SIGNUM.ordinal()] = 29; + } catch (NoSuchFieldError var20) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.SQRT.ordinal()] = 30; + } catch (NoSuchFieldError var19) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.FMOD.ordinal()] = 31; + } catch (NoSuchFieldError var18) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.TIME.ordinal()] = 32; + } catch (NoSuchFieldError var17) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.IF.ordinal()] = 33; + } catch (NoSuchFieldError var16) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.SMOOTH.ordinal()] = 34; + } catch (NoSuchFieldError var15) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.TRUE.ordinal()] = 35; + } catch (NoSuchFieldError var14) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.FALSE.ordinal()] = 36; + } catch (NoSuchFieldError var13) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.NOT.ordinal()] = 37; + } catch (NoSuchFieldError var12) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.AND.ordinal()] = 38; + } catch (NoSuchFieldError var11) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.OR.ordinal()] = 39; + } catch (NoSuchFieldError var10) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.GREATER.ordinal()] = 40; + } catch (NoSuchFieldError var9) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.GREATER_OR_EQUAL.ordinal()] = 41; + } catch (NoSuchFieldError var8) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.SMALLER.ordinal()] = 42; + } catch (NoSuchFieldError var7) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.SMALLER_OR_EQUAL.ordinal()] = 43; + } catch (NoSuchFieldError var6) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.EQUAL.ordinal()] = 44; + } catch (NoSuchFieldError var5) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.NOT_EQUAL.ordinal()] = 45; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.BETWEEN.ordinal()] = 46; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.EQUALS.ordinal()] = 47; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$net$optifine$entity$model$anim$FunctionType[FunctionType.IN.ordinal()] = 48; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpression.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpression.java new file mode 100644 index 0000000..d08f7dd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpression.java @@ -0,0 +1,5 @@ +package net.optifine.entity.model.anim; + +public interface IExpression { + ExpressionType getExpressionType(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionBool.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionBool.java new file mode 100644 index 0000000..f2abaf9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionBool.java @@ -0,0 +1,5 @@ +package net.optifine.entity.model.anim; + +public interface IExpressionBool extends IExpression { + boolean eval(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionFloat.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionFloat.java new file mode 100644 index 0000000..c2a7b87 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionFloat.java @@ -0,0 +1,5 @@ +package net.optifine.entity.model.anim; + +public interface IExpressionFloat extends IExpression { + float eval(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionResolver.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionResolver.java new file mode 100644 index 0000000..a616597 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IExpressionResolver.java @@ -0,0 +1,5 @@ +package net.optifine.entity.model.anim; + +public interface IExpressionResolver { + IExpression getExpression(String var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IParameters.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IParameters.java new file mode 100644 index 0000000..c7f560d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/IParameters.java @@ -0,0 +1,5 @@ +package net.optifine.entity.model.anim; + +public interface IParameters { + ExpressionType[] getParameterTypes(IExpression[] var1); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/Parameters.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/Parameters.java new file mode 100644 index 0000000..144038c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/Parameters.java @@ -0,0 +1,13 @@ +package net.optifine.entity.model.anim; + +public class Parameters implements IParameters { + private ExpressionType[] parameterTypes; + + public Parameters(ExpressionType[] parameterTypes) { + this.parameterTypes = parameterTypes; + } + + public ExpressionType[] getParameterTypes(IExpression[] params) { + return this.parameterTypes; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ParametersVariable.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ParametersVariable.java new file mode 100644 index 0000000..28cd62d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ParametersVariable.java @@ -0,0 +1,85 @@ +package net.optifine.entity.model.anim; + +import java.util.ArrayList; +import java.util.Arrays; + +public class ParametersVariable implements IParameters { + private ExpressionType[] first; + private ExpressionType[] repeat; + private ExpressionType[] last; + private int maxCount; + private static final ExpressionType[] EMPTY = new ExpressionType[0]; + + public ParametersVariable() { + this((ExpressionType[])null, (ExpressionType[])null, (ExpressionType[])null); + } + + public ParametersVariable(ExpressionType[] first, ExpressionType[] repeat, ExpressionType[] last) { + this(first, repeat, last, Integer.MAX_VALUE); + } + + public ParametersVariable(ExpressionType[] first, ExpressionType[] repeat, ExpressionType[] last, int maxCount) { + this.maxCount = Integer.MAX_VALUE; + this.first = normalize(first); + this.repeat = normalize(repeat); + this.last = normalize(last); + this.maxCount = maxCount; + } + + private static ExpressionType[] normalize(ExpressionType[] exprs) { + return exprs == null ? EMPTY : exprs; + } + + public ExpressionType[] getFirst() { + return this.first; + } + + public ExpressionType[] getRepeat() { + return this.repeat; + } + + public ExpressionType[] getLast() { + return this.last; + } + + public int getCountRepeat() { + return this.first == null ? 0 : this.first.length; + } + + public ExpressionType[] getParameterTypes(IExpression[] arguments) { + int countFixedParams = this.first.length + this.last.length; + int countVarArgs = arguments.length - countFixedParams; + int countRepeat = 0; + + for (int countVarParams = 0; countVarParams + this.repeat.length <= countVarArgs && countFixedParams + countVarParams + this.repeat.length <= this.maxCount; countVarParams += this.repeat.length) { + ++countRepeat; + } + + ArrayList list = new ArrayList(); + list.addAll(Arrays.asList(this.first)); + + for (int ets = 0; ets < countRepeat; ++ets) { + list.addAll(Arrays.asList(this.repeat)); + } + + list.addAll(Arrays.asList(this.last)); + ExpressionType[] var8 = (ExpressionType[])list.toArray(new ExpressionType[list.size()]); + return var8; + } + + public ParametersVariable first(ExpressionType ... first) { + return new ParametersVariable(first, this.repeat, this.last); + } + + public ParametersVariable repeat(ExpressionType ... repeat) { + return new ParametersVariable(this.first, repeat, this.last); + } + + public ParametersVariable last(ExpressionType ... last) { + return new ParametersVariable(this.first, this.repeat, last); + } + + public ParametersVariable maxCount(int maxCount) { + return new ParametersVariable(this.first, this.repeat, this.last, maxCount); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ParseException.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ParseException.java new file mode 100644 index 0000000..84f205a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/ParseException.java @@ -0,0 +1,11 @@ +package net.optifine.entity.model.anim; + +public class ParseException extends Exception { + public ParseException(String message, Throwable cause) { + super(message, cause); + } + + public ParseException(String message) { + super(message); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TestExpressions.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TestExpressions.java new file mode 100644 index 0000000..a7f81cf --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TestExpressions.java @@ -0,0 +1,40 @@ +package net.optifine.entity.model.anim; + +import java.io.BufferedReader; +import java.io.InputStreamReader; + +public class TestExpressions { + public static void main(String[] args) throws Exception { + ExpressionParser ep = new ExpressionParser((IExpressionResolver)null); + + while (true) { + try { + while (true) { + InputStreamReader e = new InputStreamReader(System.in); + BufferedReader br = new BufferedReader(e); + String line = br.readLine(); + + if (line.length() <= 0) { + return; + } + + IExpression expr = ep.parse(line); + + if (expr instanceof IExpressionFloat) { + IExpressionFloat eb = (IExpressionFloat)expr; + float val = eb.eval(); + System.out.println("" + val); + } + + if (expr instanceof IExpressionBool) { + IExpressionBool eb1 = (IExpressionBool)expr; + boolean val1 = eb1.eval(); + System.out.println("" + val1); + } + } + } catch (Exception var8) { + var8.printStackTrace(); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/Token.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/Token.java new file mode 100644 index 0000000..eff781f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/Token.java @@ -0,0 +1,23 @@ +package net.optifine.entity.model.anim; + +public class Token { + private TokenType type; + private String text; + + public Token(TokenType type, String text) { + this.type = type; + this.text = text; + } + + public TokenType getType() { + return this.type; + } + + public String getText() { + return this.text; + } + + public String toString() { + return this.text; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TokenParser.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TokenParser.java new file mode 100644 index 0000000..23c126f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TokenParser.java @@ -0,0 +1,60 @@ +package net.optifine.entity.model.anim; + +import java.io.IOException; +import java.io.PushbackReader; +import java.io.StringReader; +import java.util.ArrayList; + +public class TokenParser { + public static Token[] parse(String str) throws IOException, ParseException { + StringReader r = new StringReader(str); + PushbackReader pr = new PushbackReader(r); + ArrayList list = new ArrayList(); + + while (true) { + int tokens = pr.read(); + + if (tokens < 0) { + Token[] tokens1 = (Token[])((Token[])list.toArray(new Token[list.size()])); + return tokens1; + } + + char ch = (char)tokens; + + if (!Character.isWhitespace(ch)) { + TokenType type = TokenType.getTypeByFirstChar(ch); + + if (type == null) { + throw new ParseException("Invalid character: \'" + ch + "\', in: " + str); + } + + Token token = readToken(ch, type, pr); + list.add(token); + } + } + } + + private static Token readToken(char chFirst, TokenType type, PushbackReader pr) throws IOException { + StringBuffer sb = new StringBuffer(); + sb.append(chFirst); + + while (true) { + int i = pr.read(); + + if (i < 0) { + break; + } + + char ch = (char)i; + + if (!type.hasCharNext(ch)) { + pr.unread(ch); + break; + } + + sb.append(ch); + } + + return new Token(type, sb.toString()); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TokenType.java b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TokenType.java new file mode 100644 index 0000000..c8e195b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/net/optifine/entity/model/anim/TokenType.java @@ -0,0 +1,51 @@ +package net.optifine.entity.model.anim; + +public enum TokenType { + IDENTIFIER("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_:."), + NUMBER("0123456789", "0123456789."), + OPERATOR("+-*/%!&|<>=", "&|="), + COMMA(","), + BRACKET_OPEN("("), + BRACKET_CLOSE(")"); + private String charsFirst; + private String charsNext; + public static final TokenType[] VALUES = values(); + + private TokenType(String charsFirst) { + this(charsFirst, ""); + } + + private TokenType(String charsFirst, String charsNext) { + this.charsFirst = charsFirst; + this.charsNext = charsNext; + } + + public String getCharsFirst() { + return this.charsFirst; + } + + public String getCharsNext() { + return this.charsNext; + } + + public static TokenType getTypeByFirstChar(char ch) { + for (int i = 0; i < VALUES.length; ++i) { + TokenType type = VALUES[i]; + + if (type.getCharsFirst().indexOf(ch) >= 0) { + return type; + } + } + + return null; + } + + public boolean hasCharNext(char ch) { + return this.charsNext.indexOf(ch) >= 0; + } + + private static class Const { + static final String ALPHAS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + static final String DIGITS = "0123456789"; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/Differ.java b/Tellinq-CB-1.7.10/src/main/java/optifine/Differ.java new file mode 100644 index 0000000..8910013 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/Differ.java @@ -0,0 +1,129 @@ +package optifine; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.security.NoSuchAlgorithmException; +import java.util.Enumeration; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; +import optifine.xdelta.Delta; +import optifine.xdelta.DeltaException; +import optifine.xdelta.GDiffWriter; + +public class Differ { + public static void main(String[] args) throws Exception { + if (args.length < 3) { + Utils.dbg("Usage: Differ "); + } else { + File baseFile = new File(args[0]); + File modFile = new File(args[1]); + File diffFile = new File(args[2]); + + if (baseFile.getName().equals("AUTO")) { + baseFile = detectBaseFile(modFile); + } + + if (baseFile.exists() && baseFile.isFile()) { + if (modFile.exists() && modFile.isFile()) { + process(baseFile, modFile, diffFile); + } else { + throw new IOException("Mod file not found: " + modFile); + } + } else { + throw new IOException("Base file not found: " + baseFile); + } + } + } + + private static void process(File baseFile, File modFile, File diffFile) throws IOException, DeltaException, NoSuchAlgorithmException { + ZipFile modZip = new ZipFile(modFile); + Map cfgMap = Patcher.getConfigurationMap(modZip); + Pattern[] patterns = Patcher.getConfigurationPatterns(cfgMap); + ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(diffFile)); + ZipFile baseZip = new ZipFile(baseFile); + Enumeration modZipEntries = modZip.entries(); + + while (modZipEntries.hasMoreElements()) { + ZipEntry modZipEntry = (ZipEntry)modZipEntries.nextElement(); + InputStream in = modZip.getInputStream(modZipEntry); + byte[] bytes = Utils.readAll(in); + String name = modZipEntry.getName(); + byte[] bytesDiff = makeDiff(name, bytes, patterns, cfgMap, baseZip); + ZipEntry zipEntrySame; + + if (bytesDiff != bytes) { + zipEntrySame = new ZipEntry("patch/" + name + ".xdelta"); + zipOut.putNextEntry(zipEntrySame); + zipOut.write(bytesDiff); + zipOut.closeEntry(); + Utils.dbg("Delta: " + zipEntrySame.getName()); + byte[] md5 = HashUtils.getHashMd5(bytes); + String md5Str = HashUtils.toHexString(md5); + byte[] bytesMd5Str = md5Str.getBytes("ASCII"); + ZipEntry zipEntryMd5 = new ZipEntry("patch/" + name + ".md5"); + zipOut.putNextEntry(zipEntryMd5); + zipOut.write(bytesMd5Str); + zipOut.closeEntry(); + } else { + zipEntrySame = new ZipEntry(name); + zipOut.putNextEntry(zipEntrySame); + zipOut.write(bytes); + zipOut.closeEntry(); + Utils.dbg("Same: " + zipEntrySame.getName()); + } + } + + zipOut.close(); + } + + public static byte[] makeDiff(String name, byte[] bytesMod, Pattern[] patterns, Map cfgMap, ZipFile zipBase) throws IOException, DeltaException { + String baseName = Patcher.getPatchBase(name, patterns, cfgMap); + + if (baseName == null) { + return bytesMod; + } else { + ZipEntry baseEntry = zipBase.getEntry(baseName); + + if (baseEntry == null) { + throw new IOException("Base entry not found: " + baseName + " in: " + zipBase.getName()); + } else { + InputStream baseIn = zipBase.getInputStream(baseEntry); + byte[] baseBytes = Utils.readAll(baseIn); + ByteArrayInputStream baisTarget = new ByteArrayInputStream(bytesMod); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + GDiffWriter diffWriter = new GDiffWriter(new DataOutputStream(outputStream)); + Delta.computeDelta(baseBytes, baisTarget, bytesMod.length, diffWriter); + diffWriter.close(); + return outputStream.toByteArray(); + } + } + } + + public static File detectBaseFile(File modFile) throws IOException { + ZipFile modZip = new ZipFile(modFile); + String ofVer = Installer.getOptiFineVersion(modZip); + + if (ofVer == null) { + throw new IOException("Version not found"); + } else { + modZip.close(); + String mcVer = Installer.getMinecraftVersionFromOfVersion(ofVer); + + if (mcVer == null) { + throw new IOException("Version not found"); + } else { + File dirMc = Utils.getWorkingDirectory(); + File baseFile = new File(dirMc, "versions/" + mcVer + "/" + mcVer + ".jar"); + return baseFile; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/HashUtils.java b/Tellinq-CB-1.7.10/src/main/java/optifine/HashUtils.java new file mode 100644 index 0000000..01683ac --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/HashUtils.java @@ -0,0 +1,55 @@ +package optifine; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +public class HashUtils { + public static String getHashMd5(String data) { + return getHash(data, "MD5"); + } + + public static String getHashSha1(String data) { + return getHash(data, "SHA-1"); + } + + public static String getHashSha256(String data) { + return getHash(data, "SHA-256"); + } + + public static String getHash(String data, String digest) { + try { + byte[] e = getHash(data.getBytes("UTF-8"), digest); + return toHexString(e); + } catch (Exception var3) { + throw new RuntimeException(var3.getMessage(), var3); + } + } + + public static String toHexString(byte[] data) { + StringBuffer sb = new StringBuffer(); + + for (int i = 0; i < data.length; ++i) { + sb.append(Integer.toHexString(data[i] & 255 | 256).substring(1, 3)); + } + + return sb.toString(); + } + + public static byte[] getHashMd5(byte[] data) throws NoSuchAlgorithmException { + return getHash(data, "MD5"); + } + + public static byte[] getHashSha1(byte[] data) throws NoSuchAlgorithmException { + return getHash(data, "SHA-1"); + } + + public static byte[] getHashSha256(byte[] data) throws NoSuchAlgorithmException { + return getHash(data, "SHA-256"); + } + + public static byte[] getHash(byte[] data, String digest) throws NoSuchAlgorithmException { + MessageDigest md = MessageDigest.getInstance(digest); + byte[] array = md.digest(data); + return array; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/IResourceProvider.java b/Tellinq-CB-1.7.10/src/main/java/optifine/IResourceProvider.java new file mode 100644 index 0000000..b8738c9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/IResourceProvider.java @@ -0,0 +1,8 @@ +package optifine; + +import java.io.IOException; +import java.io.InputStream; + +public interface IResourceProvider { + InputStream getResourceStream(String var1) throws IOException; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/Installer.java b/Tellinq-CB-1.7.10/src/main/java/optifine/Installer.java new file mode 100644 index 0000000..34eb2fb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/Installer.java @@ -0,0 +1,351 @@ +package optifine; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.net.URI; +import java.net.URL; +import java.util.Enumeration; +import java.util.Locale; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import optifine.json.JSONArray; +import optifine.json.JSONObject; +import optifine.json.JSONParser; +import optifine.json.JSONWriter; +import optifine.json.ParseException; + +public class Installer { + public static void main(String[] args) { + try { + File e = Utils.getWorkingDirectory(); + doInstall(e); + } catch (Exception var8) { + String msg = var8.getMessage(); + + if (msg != null && msg.equals("QUIET")) { + return; + } + + var8.printStackTrace(); + String str = Utils.getExceptionStackTrace(var8); + str = str.replace("\t", " "); + JTextArea textArea = new JTextArea(str); + textArea.setEditable(false); + Font f = textArea.getFont(); + Font f2 = new Font("Monospaced", f.getStyle(), f.getSize()); + textArea.setFont(f2); + JScrollPane scrollPane = new JScrollPane(textArea); + scrollPane.setPreferredSize(new Dimension(600, 400)); + JOptionPane.showMessageDialog((Component)null, scrollPane, "Error", 0); + } + } + + public static void doInstall(File dirMc) throws Exception { + Utils.dbg("Dir minecraft: " + dirMc); + File dirMcLib = new File(dirMc, "libraries"); + Utils.dbg("Dir libraries: " + dirMcLib); + File dirMcVers = new File(dirMc, "versions"); + Utils.dbg("Dir versions: " + dirMcVers); + String ofVer = getOptiFineVersion(); + Utils.dbg("OptiFine Version: " + ofVer); + String[] ofVers = Utils.tokenize(ofVer, "_"); + String mcVer = ofVers[1]; + Utils.dbg("Minecraft Version: " + mcVer); + String ofEd = getOptiFineEdition(ofVers); + Utils.dbg("OptiFine Edition: " + ofEd); + String mcVerOf = mcVer + "-OptiFine_" + ofEd; + Utils.dbg("Minecraft_OptiFine Version: " + mcVerOf); + copyMinecraftVersion(mcVer, mcVerOf, dirMcVers); + installOptiFineLibrary(mcVer, ofEd, dirMcLib, false); + updateJson(dirMcVers, mcVerOf, dirMcLib, mcVer, ofEd); + updateLauncherJson(dirMc, mcVerOf); + } + + public static boolean doExtract(File dirMc) throws Exception { + Utils.dbg("Dir minecraft: " + dirMc); + File dirMcLib = new File(dirMc, "libraries"); + Utils.dbg("Dir libraries: " + dirMcLib); + File dirMcVers = new File(dirMc, "versions"); + Utils.dbg("Dir versions: " + dirMcVers); + String ofVer = getOptiFineVersion(); + Utils.dbg("OptiFine Version: " + ofVer); + String[] ofVers = Utils.tokenize(ofVer, "_"); + String mcVer = ofVers[1]; + Utils.dbg("Minecraft Version: " + mcVer); + String ofEd = getOptiFineEdition(ofVers); + Utils.dbg("OptiFine Edition: " + ofEd); + String mcVerOf = mcVer + "-OptiFine_" + ofEd; + Utils.dbg("Minecraft_OptiFine Version: " + mcVerOf); + return installOptiFineLibrary(mcVer, ofEd, dirMcLib, true); + } + + private static void updateLauncherJson(File dirMc, String mcVerOf) throws IOException, ParseException { + File fileJson = new File(dirMc, "launcher_profiles.json"); + + if (fileJson.exists() && fileJson.isFile()) { + String json = Utils.readFile(fileJson, "UTF-8"); + JSONParser jp = new JSONParser(); + JSONObject root = (JSONObject)jp.parse(json); + JSONObject profiles = (JSONObject)root.get("profiles"); + JSONObject prof = (JSONObject)profiles.get("OptiFine"); + + if (prof == null) { + prof = new JSONObject(); + prof.put("name", "OptiFine"); + profiles.put("OptiFine", prof); + } + + prof.put("lastVersionId", mcVerOf); + root.put("selectedProfile", "OptiFine"); + FileOutputStream fosJson = new FileOutputStream(fileJson); + OutputStreamWriter oswJson = new OutputStreamWriter(fosJson, "UTF-8"); + JSONWriter jw = new JSONWriter(oswJson); + jw.writeObject(root); + oswJson.flush(); + oswJson.close(); + } else { + Utils.showErrorMessage("File not found: " + fileJson); + throw new RuntimeException("QUIET"); + } + } + + private static void updateJson(File dirMcVers, String mcVerOf, File dirMcLib, String mcVer, String ofEd) throws IOException, ParseException { + File dirMcVersOf = new File(dirMcVers, mcVerOf); + File fileJson = new File(dirMcVersOf, mcVerOf + ".json"); + String json = Utils.readFile(fileJson, "UTF-8"); + JSONParser jp = new JSONParser(); + JSONObject root = (JSONObject)jp.parse(json); + root.put("id", mcVerOf); + JSONArray libs = (JSONArray)root.get("libraries"); + root.put("inheritsFrom", mcVer); + libs = new JSONArray(); + root.put("libraries", libs); + String mainClass = (String)root.get("mainClass"); + + if (!mainClass.startsWith("net.minecraft.launchwrapper.")) { + mainClass = "net.minecraft.launchwrapper.Launch"; + root.put("mainClass", mainClass); + String libOf = (String)root.get("minecraftArguments"); + libOf = libOf + " --tweakClass optifine.OptiFineTweaker"; + root.put("minecraftArguments", libOf); + JSONObject fosJson = new JSONObject(); + fosJson.put("name", "net.minecraft:launchwrapper:1.12"); + libs.add(0, fosJson); + } + + JSONObject libOf1 = new JSONObject(); + libOf1.put("name", "optifine:OptiFine:" + mcVer + "_" + ofEd); + libs.add(0, libOf1); + FileOutputStream fosJson1 = new FileOutputStream(fileJson); + OutputStreamWriter oswJson = new OutputStreamWriter(fosJson1, "UTF-8"); + JSONWriter jw = new JSONWriter(oswJson); + jw.writeObject(root); + oswJson.flush(); + oswJson.close(); + } + + public static String getOptiFineEdition(String[] ofVers) { + if (ofVers.length <= 2) { + return ""; + } else { + String ofEd = ""; + + for (int i = 2; i < ofVers.length; ++i) { + if (i > 2) { + ofEd = ofEd + "_"; + } + + ofEd = ofEd + ofVers[i]; + } + + return ofEd; + } + } + + private static boolean installOptiFineLibrary(String mcVer, String ofEd, File dirMcLib, boolean selectTarget) throws Exception { + File fileSrc = getOptiFineZipFile(); + File dirDest = new File(dirMcLib, "optifine/OptiFine/" + mcVer + "_" + ofEd); + File fileDest = new File(dirDest, "OptiFine-" + mcVer + "_" + ofEd + ".jar"); + + if (selectTarget) { + fileDest = new File(fileSrc.getParentFile(), "OptiFine_" + mcVer + "_" + ofEd + "_MOD.jar"); + JFileChooser dirMc = new JFileChooser(fileDest.getParentFile()); + dirMc.setSelectedFile(fileDest); + int fileBase = dirMc.showSaveDialog((Component)null); + + if (fileBase != 0) { + return false; + } + + fileDest = dirMc.getSelectedFile(); + + if (fileDest.exists()) { + JOptionPane.setDefaultLocale(Locale.ENGLISH); + int ret2 = JOptionPane.showConfirmDialog((Component)null, "The file \"" + fileDest.getName() + "\" already exists.\nDo you want to overwrite it?", "Save", 1); + + if (ret2 != 0) { + return false; + } + } + } + + if (fileDest.equals(fileSrc)) { + JOptionPane.showMessageDialog((Component)null, "Source and target file are the same.", "Save", 0); + return false; + } else { + Utils.dbg("Source: " + fileSrc); + Utils.dbg("Dest: " + fileDest); + File dirMc1 = dirMcLib.getParentFile(); + File fileBase1 = new File(dirMc1, "versions/" + mcVer + "/" + mcVer + ".jar"); + + if (!fileBase1.exists()) { + showMessageVersionNotFound(mcVer); + throw new RuntimeException("QUIET"); + } else { + if (fileDest.getParentFile() != null) { + fileDest.getParentFile().mkdirs(); + } + + Patcher.process(fileBase1, fileSrc, fileDest); + return true; + } + } + } + + public static File getOptiFineZipFile() throws Exception { + URL url = Installer.class.getProtectionDomain().getCodeSource().getLocation(); + Utils.dbg("URL: " + url); + URI uri = url.toURI(); + File fileZip = new File(uri); + return fileZip; + } + + public static boolean isPatchFile() throws Exception { + File fileZip = getOptiFineZipFile(); + ZipFile zipFile = new ZipFile(fileZip); + + try { + Enumeration entries = zipFile.entries(); + ZipEntry zipEntry; + + do { + if (!entries.hasMoreElements()) { + return false; + } + + zipEntry = (ZipEntry)entries.nextElement(); + } + while (!zipEntry.getName().startsWith("patch/")); + } + finally { + zipFile.close(); + } + + return true; + } + + private static void copyMinecraftVersion(String mcVer, String mcVerOf, File dirMcVer) throws IOException { + File dirVerMc = new File(dirMcVer, mcVer); + + if (!dirVerMc.exists()) { + showMessageVersionNotFound(mcVer); + throw new RuntimeException("QUIET"); + } else { + File dirVerMcOf = new File(dirMcVer, mcVerOf); + dirVerMcOf.mkdirs(); + Utils.dbg("Dir version MC: " + dirVerMc); + Utils.dbg("Dir version MC-OF: " + dirVerMcOf); + File fileJarMc = new File(dirVerMc, mcVer + ".jar"); + File fileJarMcOf = new File(dirVerMcOf, mcVerOf + ".jar"); + + if (!fileJarMc.exists()) { + showMessageVersionNotFound(mcVer); + throw new RuntimeException("QUIET"); + } else { + Utils.copyFile(fileJarMc, fileJarMcOf); + File fileJsonMc = new File(dirVerMc, mcVer + ".json"); + File fileJsonMcOf = new File(dirVerMcOf, mcVerOf + ".json"); + Utils.copyFile(fileJsonMc, fileJsonMcOf); + } + } + } + + private static void showMessageVersionNotFound(String mcVer) { + Utils.showErrorMessage("Minecraft version " + mcVer + " not found.\nYou need to start the version " + mcVer + " manually once."); + } + + public static String getOptiFineVersion() throws IOException { + InputStream in = Installer.class.getResourceAsStream("/Config.class"); + + if (in == null) { + in = Installer.class.getResourceAsStream("/VersionThread.class"); + } + + return getOptiFineVersion(in); + } + + public static String getOptiFineVersion(ZipFile zipFile) throws IOException { + ZipEntry zipEntry = zipFile.getEntry("Config.class"); + + if (zipEntry == null) { + zipEntry = zipFile.getEntry("VersionThread.class"); + } + + if (zipEntry == null) { + return null; + } else { + InputStream in = zipFile.getInputStream(zipEntry); + String ofVer = getOptiFineVersion(in); + in.close(); + return ofVer; + } + } + + public static String getOptiFineVersion(InputStream in) throws IOException { + byte[] bytes = Utils.readAll(in); + byte[] pattern = "OptiFine_".getBytes("ASCII"); + int pos = Utils.find(bytes, pattern); + + if (pos < 0) { + return null; + } else { + int startPos = pos; + + for (pos = pos; pos < bytes.length; ++pos) { + byte endPos = bytes[pos]; + + if (endPos < 32 || endPos > 122) { + break; + } + } + + String ver = new String(bytes, startPos, pos - startPos, "ASCII"); + return ver; + } + } + + public static String getMinecraftVersionFromOfVersion(String ofVer) { + if (ofVer == null) { + return null; + } else { + String[] ofVers = Utils.tokenize(ofVer, "_"); + + if (ofVers.length < 2) { + return null; + } else { + String mcVer = ofVers[1]; + return mcVer; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/InstallerFrame.java b/Tellinq-CB-1.7.10/src/main/java/optifine/InstallerFrame.java new file mode 100644 index 0000000..26b9b0e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/InstallerFrame.java @@ -0,0 +1,464 @@ +package optifine; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Insets; +import java.awt.LayoutManager; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.UIManager; + +public class InstallerFrame extends JFrame { + private JLabel ivjLabelOfVersion = null; + private JLabel ivjLabelMcVersion = null; + private JPanel ivjPanelCenter = null; + private JButton ivjButtonInstall = null; + private JButton ivjButtonClose = null; + private JPanel ivjPanelBottom = null; + private JPanel ivjPanelContentPane = null; + InstallerFrame.IvjEventHandler ivjEventHandler = new InstallerFrame.IvjEventHandler(); + private JTextArea ivjTextArea = null; + private JButton ivjButtonExtract = null; + private JLabel ivjLabelFolder = null; + private JTextField ivjFieldFolder = null; + private JButton ivjButtonFolder = null; + + public InstallerFrame() { + this.initialize(); + } + + private void customInit() { + try { + this.pack(); + this.setDefaultCloseOperation(3); + File e = Utils.getWorkingDirectory(); + this.getFieldFolder().setText(e.getPath()); + this.getButtonInstall().setEnabled(false); + this.getButtonExtract().setEnabled(false); + String ofVer = Installer.getOptiFineVersion(); + Utils.dbg("OptiFine Version: " + ofVer); + String[] ofVers = Utils.tokenize(ofVer, "_"); + String mcVer = ofVers[1]; + Utils.dbg("Minecraft Version: " + mcVer); + String ofEd = Installer.getOptiFineEdition(ofVers); + Utils.dbg("OptiFine Edition: " + ofEd); + String ofEdClear = ofEd.replace("_", " "); + ofEdClear = ofEdClear.replace(" U ", " Ultra "); + ofEdClear = ofEdClear.replace("L ", "Light "); + this.getLabelOfVersion().setText("OptiFine " + ofEdClear); + this.getLabelMcVersion().setText("for Minecraft " + mcVer); + this.getButtonInstall().setEnabled(true); + this.getButtonExtract().setEnabled(true); + this.getButtonInstall().requestFocus(); + + if (!Installer.isPatchFile()) { + this.getButtonExtract().setVisible(false); + } + } catch (Exception var7) { + var7.printStackTrace(); + } + } + + public static void main(String[] args) { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + InstallerFrame e = new InstallerFrame(); + Utils.centerWindow(e, (Component)null); + e.show(); + } catch (Exception var8) { + String msg = var8.getMessage(); + + if (msg != null && msg.equals("QUIET")) { + return; + } + + var8.printStackTrace(); + String str = Utils.getExceptionStackTrace(var8); + str = str.replace("\t", " "); + JTextArea textArea = new JTextArea(str); + textArea.setEditable(false); + Font f = textArea.getFont(); + Font f2 = new Font("Monospaced", f.getStyle(), f.getSize()); + textArea.setFont(f2); + JScrollPane scrollPane = new JScrollPane(textArea); + scrollPane.setPreferredSize(new Dimension(600, 400)); + JOptionPane.showMessageDialog((Component)null, scrollPane, "Error", 0); + } + } + + private void handleException(Throwable e) { + String msg = e.getMessage(); + + if (msg == null || !msg.equals("QUIET")) { + e.printStackTrace(); + String str = Utils.getExceptionStackTrace(e); + str = str.replace("\t", " "); + JTextArea textArea = new JTextArea(str); + textArea.setEditable(false); + Font f = textArea.getFont(); + Font f2 = new Font("Monospaced", f.getStyle(), f.getSize()); + textArea.setFont(f2); + JScrollPane scrollPane = new JScrollPane(textArea); + scrollPane.setPreferredSize(new Dimension(600, 400)); + JOptionPane.showMessageDialog((Component)null, scrollPane, "Error", 0); + } + } + + private JLabel getLabelOfVersion() { + if (this.ivjLabelOfVersion == null) { + try { + this.ivjLabelOfVersion = new JLabel(); + this.ivjLabelOfVersion.setName("LabelOfVersion"); + this.ivjLabelOfVersion.setBounds(2, 5, 385, 42); + this.ivjLabelOfVersion.setFont(new Font("Dialog", 1, 18)); + this.ivjLabelOfVersion.setHorizontalAlignment(0); + this.ivjLabelOfVersion.setPreferredSize(new Dimension(385, 42)); + this.ivjLabelOfVersion.setText("OptiFine ..."); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjLabelOfVersion; + } + + private JLabel getLabelMcVersion() { + if (this.ivjLabelMcVersion == null) { + try { + this.ivjLabelMcVersion = new JLabel(); + this.ivjLabelMcVersion.setName("LabelMcVersion"); + this.ivjLabelMcVersion.setBounds(2, 38, 385, 25); + this.ivjLabelMcVersion.setFont(new Font("Dialog", 1, 14)); + this.ivjLabelMcVersion.setHorizontalAlignment(0); + this.ivjLabelMcVersion.setPreferredSize(new Dimension(385, 25)); + this.ivjLabelMcVersion.setText("for Minecraft ..."); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjLabelMcVersion; + } + + private JPanel getPanelCenter() { + if (this.ivjPanelCenter == null) { + try { + this.ivjPanelCenter = new JPanel(); + this.ivjPanelCenter.setName("PanelCenter"); + this.ivjPanelCenter.setLayout((LayoutManager)null); + this.ivjPanelCenter.add(this.getLabelOfVersion(), this.getLabelOfVersion().getName()); + this.ivjPanelCenter.add(this.getLabelMcVersion(), this.getLabelMcVersion().getName()); + this.ivjPanelCenter.add(this.getTextArea(), this.getTextArea().getName()); + this.ivjPanelCenter.add(this.getLabelFolder(), this.getLabelFolder().getName()); + this.ivjPanelCenter.add(this.getFieldFolder(), this.getFieldFolder().getName()); + this.ivjPanelCenter.add(this.getButtonFolder(), this.getButtonFolder().getName()); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjPanelCenter; + } + + private JButton getButtonInstall() { + if (this.ivjButtonInstall == null) { + try { + this.ivjButtonInstall = new JButton(); + this.ivjButtonInstall.setName("ButtonInstall"); + this.ivjButtonInstall.setPreferredSize(new Dimension(100, 26)); + this.ivjButtonInstall.setText("Install"); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjButtonInstall; + } + + private JButton getButtonClose() { + if (this.ivjButtonClose == null) { + try { + this.ivjButtonClose = new JButton(); + this.ivjButtonClose.setName("ButtonClose"); + this.ivjButtonClose.setPreferredSize(new Dimension(100, 26)); + this.ivjButtonClose.setText("Cancel"); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjButtonClose; + } + + private JPanel getPanelBottom() { + if (this.ivjPanelBottom == null) { + try { + this.ivjPanelBottom = new JPanel(); + this.ivjPanelBottom.setName("PanelBottom"); + this.ivjPanelBottom.setLayout(new FlowLayout(1, 15, 10)); + this.ivjPanelBottom.setPreferredSize(new Dimension(390, 55)); + this.ivjPanelBottom.add(this.getButtonInstall(), this.getButtonInstall().getName()); + this.ivjPanelBottom.add(this.getButtonExtract(), this.getButtonExtract().getName()); + this.ivjPanelBottom.add(this.getButtonClose(), this.getButtonClose().getName()); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjPanelBottom; + } + + private JPanel getPanelContentPane() { + if (this.ivjPanelContentPane == null) { + try { + this.ivjPanelContentPane = new JPanel(); + this.ivjPanelContentPane.setName("PanelContentPane"); + this.ivjPanelContentPane.setLayout(new BorderLayout(5, 5)); + this.ivjPanelContentPane.setPreferredSize(new Dimension(394, 203)); + this.ivjPanelContentPane.add(this.getPanelCenter(), "Center"); + this.ivjPanelContentPane.add(this.getPanelBottom(), "South"); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjPanelContentPane; + } + + private void initialize() { + try { + this.setName("InstallerFrame"); + this.setSize(404, 236); + this.setDefaultCloseOperation(0); + this.setResizable(false); + this.setTitle("OptiFine Installer"); + this.setContentPane(this.getPanelContentPane()); + this.initConnections(); + } catch (Throwable var2) { + this.handleException(var2); + } + + this.customInit(); + } + + public void onInstall() { + try { + File e = new File(this.getFieldFolder().getText()); + + if (!e.exists()) { + Utils.showErrorMessage("Folder not found: " + e.getPath()); + return; + } + + if (!e.isDirectory()) { + Utils.showErrorMessage("Not a folder: " + e.getPath()); + return; + } + + Installer.doInstall(e); + Utils.showMessage("OptiFine is successfully installed."); + this.dispose(); + } catch (Exception var2) { + this.handleException(var2); + } + } + + public void onExtract() { + try { + File e = new File(this.getFieldFolder().getText()); + + if (!e.exists()) { + Utils.showErrorMessage("Folder not found: " + e.getPath()); + return; + } + + if (!e.isDirectory()) { + Utils.showErrorMessage("Not a folder: " + e.getPath()); + return; + } + + boolean ok = Installer.doExtract(e); + + if (ok) { + Utils.showMessage("OptiFine is successfully extracted."); + this.dispose(); + } + } catch (Exception var3) { + this.handleException(var3); + } + } + + public void onClose() { + this.dispose(); + } + + private void connEtoC1(ActionEvent arg1) { + try { + this.onInstall(); + } catch (Throwable var3) { + this.handleException(var3); + } + } + + private void connEtoC2(ActionEvent arg1) { + try { + this.onClose(); + } catch (Throwable var3) { + this.handleException(var3); + } + } + + private void initConnections() throws Exception { + this.getButtonFolder().addActionListener(this.ivjEventHandler); + this.getButtonInstall().addActionListener(this.ivjEventHandler); + this.getButtonExtract().addActionListener(this.ivjEventHandler); + this.getButtonClose().addActionListener(this.ivjEventHandler); + } + + private JTextArea getTextArea() { + if (this.ivjTextArea == null) { + try { + this.ivjTextArea = new JTextArea(); + this.ivjTextArea.setName("TextArea"); + this.ivjTextArea.setBounds(15, 66, 365, 44); + this.ivjTextArea.setEditable(false); + this.ivjTextArea.setEnabled(true); + this.ivjTextArea.setFont(new Font("Dialog", 0, 12)); + this.ivjTextArea.setLineWrap(true); + this.ivjTextArea.setOpaque(false); + this.ivjTextArea.setPreferredSize(new Dimension(365, 44)); + this.ivjTextArea.setText("This installer will install OptiFine in the official Minecraft launcher and will create a new profile \"OptiFine\" for it."); + this.ivjTextArea.setWrapStyleWord(true); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjTextArea; + } + + private JButton getButtonExtract() { + if (this.ivjButtonExtract == null) { + try { + this.ivjButtonExtract = new JButton(); + this.ivjButtonExtract.setName("ButtonExtract"); + this.ivjButtonExtract.setPreferredSize(new Dimension(100, 26)); + this.ivjButtonExtract.setText("Extract"); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjButtonExtract; + } + + private void connEtoC3(ActionEvent arg1) { + try { + this.onExtract(); + } catch (Throwable var3) { + this.handleException(var3); + } + } + + private JLabel getLabelFolder() { + if (this.ivjLabelFolder == null) { + try { + this.ivjLabelFolder = new JLabel(); + this.ivjLabelFolder.setName("LabelFolder"); + this.ivjLabelFolder.setBounds(15, 116, 47, 16); + this.ivjLabelFolder.setPreferredSize(new Dimension(47, 16)); + this.ivjLabelFolder.setText("Folder"); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjLabelFolder; + } + + private JTextField getFieldFolder() { + if (this.ivjFieldFolder == null) { + try { + this.ivjFieldFolder = new JTextField(); + this.ivjFieldFolder.setName("FieldFolder"); + this.ivjFieldFolder.setBounds(62, 114, 287, 20); + this.ivjFieldFolder.setEditable(false); + this.ivjFieldFolder.setPreferredSize(new Dimension(287, 20)); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjFieldFolder; + } + + private JButton getButtonFolder() { + if (this.ivjButtonFolder == null) { + try { + this.ivjButtonFolder = new JButton(); + this.ivjButtonFolder.setName("ButtonFolder"); + this.ivjButtonFolder.setBounds(350, 114, 25, 20); + this.ivjButtonFolder.setMargin(new Insets(2, 2, 2, 2)); + this.ivjButtonFolder.setPreferredSize(new Dimension(25, 20)); + this.ivjButtonFolder.setText("..."); + } catch (Throwable var2) { + this.handleException(var2); + } + } + + return this.ivjButtonFolder; + } + + public void onFolderSelect() { + File dirMc = new File(this.getFieldFolder().getText()); + JFileChooser jfc = new JFileChooser(dirMc); + jfc.setFileSelectionMode(1); + jfc.setAcceptAllFileFilterUsed(false); + + if (jfc.showOpenDialog(this) == 0) { + File dir = jfc.getSelectedFile(); + this.getFieldFolder().setText(dir.getPath()); + } + } + + private void connEtoC4(ActionEvent arg1) { + try { + this.onFolderSelect(); + } catch (Throwable var3) { + this.handleException(var3); + } + } + + class IvjEventHandler implements ActionListener { + public void actionPerformed(ActionEvent e) { + if (e.getSource() == InstallerFrame.this.getButtonClose()) { + InstallerFrame.this.connEtoC2(e); + } + + if (e.getSource() == InstallerFrame.this.getButtonExtract()) { + InstallerFrame.this.connEtoC3(e); + } + + if (e.getSource() == InstallerFrame.this.getButtonFolder()) { + InstallerFrame.this.connEtoC4(e); + } + + if (e.getSource() == InstallerFrame.this.getButtonInstall()) { + InstallerFrame.this.connEtoC1(e); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/Patcher.java b/Tellinq-CB-1.7.10/src/main/java/optifine/Patcher.java new file mode 100644 index 0000000..c2835a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/Patcher.java @@ -0,0 +1,190 @@ +package optifine; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Enumeration; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; +import optifine.xdelta.GDiffPatcher; +import optifine.xdelta.PatchException; + +public class Patcher { + public static final String CONFIG_FILE = "patch.cfg"; + public static final String PREFIX_PATCH = "patch/"; + public static final String SUFFIX_DELTA = ".xdelta"; + public static final String SUFFIX_MD5 = ".md5"; + + public static void main(String[] args) throws Exception { + if (args.length < 3) { + Utils.dbg("Usage: Patcher "); + } else { + File baseFile = new File(args[0]); + File diffFile = new File(args[1]); + File modFile = new File(args[2]); + + if (baseFile.getName().equals("AUTO")) { + baseFile = Differ.detectBaseFile(diffFile); + } + + if (baseFile.exists() && baseFile.isFile()) { + if (diffFile.exists() && diffFile.isFile()) { + process(baseFile, diffFile, modFile); + } else { + throw new IOException("Diff file not found: " + modFile); + } + } else { + throw new IOException("Base file not found: " + baseFile); + } + } + } + + public static void process(File baseFile, File diffFile, File modFile) throws Exception { + ZipFile diffZip = new ZipFile(diffFile); + Map cfgMap = getConfigurationMap(diffZip); + Pattern[] patterns = getConfigurationPatterns(cfgMap); + ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(modFile)); + ZipFile baseZip = new ZipFile(baseFile); + ZipResourceProvider zrp = new ZipResourceProvider(baseZip); + Enumeration diffZipEntries = diffZip.entries(); + + while (diffZipEntries.hasMoreElements()) { + ZipEntry diffZipEntry = (ZipEntry)diffZipEntries.nextElement(); + InputStream in = diffZip.getInputStream(diffZipEntry); + byte[] bytes = Utils.readAll(in); + String name = diffZipEntry.getName(); + + if (name.startsWith("patch/") && name.endsWith(".xdelta")) { + name = name.substring("patch/".length()); + name = name.substring(0, name.length() - ".xdelta".length()); + byte[] zipEntrySame1 = applyPatch(name, bytes, patterns, cfgMap, zrp); + String nameMd5 = "patch/" + name + ".md5"; + ZipEntry diffZipEntryMd5 = diffZip.getEntry(nameMd5); + + if (diffZipEntryMd5 != null) { + byte[] zipEntryMod = Utils.readAll(diffZip.getInputStream(diffZipEntryMd5)); + String md5Str = new String(zipEntryMod, "ASCII"); + byte[] md5Mod = HashUtils.getHashMd5(zipEntrySame1); + String md5ModStr = HashUtils.toHexString(md5Mod); + + if (!md5Str.equals(md5ModStr)) { + throw new Exception("MD5 not matching, name: " + name + ", saved: " + md5Str + ", patched: " + md5ModStr); + } + } + + ZipEntry zipEntryMod1 = new ZipEntry(name); + zipOut.putNextEntry(zipEntryMod1); + zipOut.write(zipEntrySame1); + zipOut.closeEntry(); + Utils.dbg("Mod: " + name); + } else if (!name.startsWith("patch/") || !name.endsWith(".md5")) { + ZipEntry zipEntrySame = new ZipEntry(name); + zipOut.putNextEntry(zipEntrySame); + zipOut.write(bytes); + zipOut.closeEntry(); + Utils.dbg("Same: " + zipEntrySame.getName()); + } + } + + zipOut.close(); + } + + public static byte[] applyPatch(String name, byte[] bytesDiff, Pattern[] patterns, Map cfgMap, IResourceProvider resourceProvider) throws IOException, PatchException { + name = Utils.removePrefix(name, "/"); + String baseName = getPatchBase(name, patterns, cfgMap); + + if (baseName == null) { + throw new IOException("No patch base, name: " + name + ", patterns: " + Utils.arrayToCommaSeparatedString(patterns)); + } else { + InputStream baseIn = resourceProvider.getResourceStream(baseName); + + if (baseIn == null) { + throw new IOException("Base resource not found: " + baseName); + } else { + byte[] baseBytes = Utils.readAll(baseIn); + ByteArrayInputStream patchStream = new ByteArrayInputStream(bytesDiff); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + new GDiffPatcher(baseBytes, patchStream, outputStream); + outputStream.close(); + return outputStream.toByteArray(); + } + } + } + + public static Pattern[] getConfigurationPatterns(Map cfgMap) { + String[] cfgKeys = (String[])cfgMap.keySet().toArray(new String[0]); + Pattern[] patterns = new Pattern[cfgKeys.length]; + + for (int i = 0; i < cfgKeys.length; ++i) { + String key = cfgKeys[i]; + patterns[i] = Pattern.compile(key); + } + + return patterns; + } + + public static Map getConfigurationMap(ZipFile modZip) throws IOException { + LinkedHashMap cfgMap = new LinkedHashMap(); + + if (modZip == null) { + return cfgMap; + } else { + ZipEntry entryPatch = modZip.getEntry("patch.cfg"); + + if (entryPatch == null) { + return cfgMap; + } else { + InputStream inPatch = modZip.getInputStream(entryPatch); + String[] lines = Utils.readLines(inPatch, "ASCII"); + inPatch.close(); + + for (int i = 0; i < lines.length; ++i) { + String line = lines[i].trim(); + + if (!line.startsWith("#") && line.length() > 0) { + String[] parts = Utils.tokenize(line, "="); + + if (parts.length != 2) { + throw new IOException("Invalid patch configuration: " + line); + } + + String key = parts[0].trim(); + String val = parts[1].trim(); + cfgMap.put(key, val); + } + } + + return cfgMap; + } + } + } + + public static String getPatchBase(String name, Pattern[] patterns, Map cfgMap) { + name = Utils.removePrefix(name, "/"); + + for (int i = 0; i < patterns.length; ++i) { + Pattern pattern = patterns[i]; + Matcher matcher = pattern.matcher(name); + + if (matcher.matches()) { + String base = (String)cfgMap.get(pattern.pattern()); + + if (base != null && base.trim().equals("*")) { + return name; + } + + return base; + } + } + + return null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/Utils.java b/Tellinq-CB-1.7.10/src/main/java/optifine/Utils.java new file mode 100644 index 0000000..652e4c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/Utils.java @@ -0,0 +1,388 @@ +package optifine; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.StringTokenizer; +import javax.swing.JOptionPane; + +public class Utils { + public static final String MAC_OS_HOME_PREFIX = "Library/Application Support"; + private static final char[] hexTable = new char[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + + private static int[] $SWITCH_TABLE$optifine$Utils$OS; + + public static File getWorkingDirectory() { + return getWorkingDirectory("minecraft"); + } + + public static File getWorkingDirectory(String applicationName) { + String userHome = System.getProperty("user.home", "."); + File workingDirectory = null; + + switch ($SWITCH_TABLE$optifine$Utils$OS()[getPlatform().ordinal()]) { + case 1: + case 2: + workingDirectory = new File(userHome, '.' + applicationName + '/'); + break; + + case 3: + String applicationData = System.getenv("APPDATA"); + + if (applicationData != null) { + workingDirectory = new File(applicationData, "." + applicationName + '/'); + } else { + workingDirectory = new File(userHome, '.' + applicationName + '/'); + } + + break; + + case 4: + workingDirectory = new File(userHome, "Library/Application Support/" + applicationName); + break; + + default: + workingDirectory = new File(userHome, applicationName + '/'); + } + + if (!workingDirectory.exists() && !workingDirectory.mkdirs()) { + throw new RuntimeException("The working directory could not be created: " + workingDirectory); + } else { + return workingDirectory; + } + } + + public static Utils.OS getPlatform() { + String osName = System.getProperty("os.name").toLowerCase(); + return osName.contains("win") ? Utils.OS.WINDOWS : (osName.contains("mac") ? Utils.OS.MACOS : (osName.contains("solaris") ? Utils.OS.SOLARIS : (osName.contains("sunos") ? Utils.OS.SOLARIS : (osName.contains("linux") ? Utils.OS.LINUX : (osName.contains("unix") ? Utils.OS.LINUX : Utils.OS.UNKNOWN))))); + } + + public static int find(byte[] buf, byte[] pattern) { + return find(buf, 0, pattern); + } + + public static int find(byte[] buf, int index, byte[] pattern) { + int i = index; + + while (i < buf.length - pattern.length) { + boolean found = true; + int pos = 0; + + while (true) { + if (pos < pattern.length) { + if (pattern[pos] == buf[i + pos]) { + ++pos; + continue; + } + + found = false; + } + + if (found) { + return i; + } + + ++i; + break; + } + } + + return -1; + } + + public static byte[] readAll(InputStream is) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buf = new byte[1024]; + + while (true) { + int bytes = is.read(buf); + + if (bytes < 0) { + is.close(); + byte[] bytes1 = baos.toByteArray(); + return bytes1; + } + + baos.write(buf, 0, bytes); + } + } + + public static void dbg(String str) { + System.out.println(str); + } + + public static String[] tokenize(String str, String delim) { + ArrayList list = new ArrayList(); + StringTokenizer tok = new StringTokenizer(str, delim); + + while (tok.hasMoreTokens()) { + String tokens = tok.nextToken(); + list.add(tokens); + } + + String[] tokens1 = (String[])list.toArray(new String[list.size()]); + return tokens1; + } + + public static String getExceptionStackTrace(Throwable e) { + StringWriter swr = new StringWriter(); + PrintWriter pwr = new PrintWriter(swr); + e.printStackTrace(pwr); + pwr.close(); + + try { + swr.close(); + } catch (IOException var4) { + ; + } + + return swr.getBuffer().toString(); + } + + public static void copyFile(File fileSrc, File fileDest) throws IOException { + if (!fileSrc.getCanonicalPath().equals(fileDest.getCanonicalPath())) { + FileInputStream fin = new FileInputStream(fileSrc); + FileOutputStream fout = new FileOutputStream(fileDest); + copyAll(fin, fout); + fout.flush(); + fin.close(); + fout.close(); + } + } + + public static void copyAll(InputStream is, OutputStream os) throws IOException { + byte[] buf = new byte[1024]; + + while (true) { + int len = is.read(buf); + + if (len < 0) { + return; + } + + os.write(buf, 0, len); + } + } + + public static void showMessage(String msg) { + JOptionPane.showMessageDialog((Component)null, msg, "OptiFine", 1); + } + + public static void showErrorMessage(String msg) { + JOptionPane.showMessageDialog((Component)null, msg, "Error", 0); + } + + public static String readFile(File file) throws IOException { + return readFile(file, "ASCII"); + } + + public static String readFile(File file, String encoding) throws IOException { + FileInputStream fin = new FileInputStream(file); + return readText(fin, encoding); + } + + public static String readText(InputStream in, String encoding) throws IOException { + InputStreamReader inr = new InputStreamReader(in, encoding); + BufferedReader br = new BufferedReader(inr); + StringBuffer sb = new StringBuffer(); + + while (true) { + String line = br.readLine(); + + if (line == null) { + br.close(); + inr.close(); + in.close(); + return sb.toString(); + } + + sb.append(line); + sb.append("\n"); + } + } + + public static String[] readLines(InputStream in, String encoding) throws IOException { + String str = readText(in, encoding); + String[] strs = tokenize(str, "\n\r"); + return strs; + } + + public static void centerWindow(Component c, Component par) { + if (c != null) { + Rectangle rect = c.getBounds(); + Rectangle parRect; + + if (par != null && par.isVisible()) { + parRect = par.getBounds(); + } else { + Dimension newX = Toolkit.getDefaultToolkit().getScreenSize(); + parRect = new Rectangle(0, 0, newX.width, newX.height); + } + + int newX1 = parRect.x + (parRect.width - rect.width) / 2; + int newY = parRect.y + (parRect.height - rect.height) / 2; + + if (newX1 < 0) { + newX1 = 0; + } + + if (newY < 0) { + newY = 0; + } + + c.setBounds(newX1, newY, rect.width, rect.height); + } + } + + public static String byteArrayToHexString(byte[] bytes) { + if (bytes == null) { + return ""; + } else { + StringBuffer buf = new StringBuffer(); + + for (int i = 0; i < bytes.length; ++i) { + byte b = bytes[i]; + buf.append(hexTable[b >> 4 & 15]); + buf.append(hexTable[b & 15]); + } + + return buf.toString(); + } + } + + public static String arrayToCommaSeparatedString(Object[] arr) { + if (arr == null) { + return ""; + } else { + StringBuffer buf = new StringBuffer(); + + for (int i = 0; i < arr.length; ++i) { + Object val = arr[i]; + + if (i > 0) { + buf.append(", "); + } + + if (val == null) { + buf.append("null"); + } else if (val.getClass().isArray()) { + buf.append("["); + + if (val instanceof Object[]) { + Object[] ai = (Object[])val; + buf.append(arrayToCommaSeparatedString(ai)); + } else { + for (int var5 = 0; var5 < Array.getLength(val); ++var5) { + if (var5 > 0) { + buf.append(", "); + } + + buf.append(Array.get(val, var5)); + } + } + + buf.append("]"); + } else { + buf.append(arr[i]); + } + } + + return buf.toString(); + } + } + + public static String removePrefix(String str, String prefix) { + if (str != null && prefix != null) { + if (str.startsWith(prefix)) { + str = str.substring(prefix.length()); + } + + return str; + } else { + return str; + } + } + + public static String ensurePrefix(String str, String prefix) { + if (str != null && prefix != null) { + if (!str.startsWith(prefix)) { + str = prefix + str; + } + + return str; + } else { + return str; + } + } + + public static boolean equals(Object o1, Object o2) { + return o1 == o2 ? true : (o1 == null ? false : o1.equals(o2)); + } + + static int[] $SWITCH_TABLE$optifine$Utils$OS() { + if ($SWITCH_TABLE$optifine$Utils$OS != null) { + return $SWITCH_TABLE$optifine$Utils$OS; + } else { + int[] var0 = new int[Utils.OS.values().length]; + + try { + var0[Utils.OS.LINUX.ordinal()] = 1; + } catch (NoSuchFieldError var5) { + ; + } + + try { + var0[Utils.OS.MACOS.ordinal()] = 4; + } catch (NoSuchFieldError var4) { + ; + } + + try { + var0[Utils.OS.SOLARIS.ordinal()] = 2; + } catch (NoSuchFieldError var3) { + ; + } + + try { + var0[Utils.OS.UNKNOWN.ordinal()] = 5; + } catch (NoSuchFieldError var2) { + ; + } + + try { + var0[Utils.OS.WINDOWS.ordinal()] = 3; + } catch (NoSuchFieldError var1) { + ; + } + + $SWITCH_TABLE$optifine$Utils$OS = var0; + return var0; + } + } + + public static enum OS { + LINUX("LINUX", 0), + SOLARIS("SOLARIS", 1), + WINDOWS("WINDOWS", 2), + MACOS("MACOS", 3), + UNKNOWN("UNKNOWN", 4); + + private static final Utils.OS[] ENUM$VALUES = new Utils.OS[]{LINUX, SOLARIS, WINDOWS, MACOS, UNKNOWN}; + + private OS(String var1, int var2) {} + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/ZipResourceProvider.java b/Tellinq-CB-1.7.10/src/main/java/optifine/ZipResourceProvider.java new file mode 100644 index 0000000..96b7373 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/ZipResourceProvider.java @@ -0,0 +1,26 @@ +package optifine; + +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +public class ZipResourceProvider implements IResourceProvider { + private ZipFile zipFile = null; + + public ZipResourceProvider(ZipFile zipFile) { + this.zipFile = zipFile; + } + + public InputStream getResourceStream(String path) throws IOException { + path = Utils.removePrefix(path, "/"); + ZipEntry zipEntry = this.zipFile.getEntry(path); + + if (zipEntry == null) { + return null; + } else { + InputStream in = this.zipFile.getInputStream(zipEntry); + return in; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/ContainerFactory.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ContainerFactory.java new file mode 100644 index 0000000..b989572 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ContainerFactory.java @@ -0,0 +1,10 @@ +package optifine.json; + +import java.util.List; +import java.util.Map; + +public interface ContainerFactory { + Map createObjectContainer(); + + List creatArrayContainer(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/ContentHandler.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ContentHandler.java new file mode 100644 index 0000000..9139392 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ContentHandler.java @@ -0,0 +1,23 @@ +package optifine.json; + +import java.io.IOException; + +public interface ContentHandler { + void startJSON() throws ParseException, IOException; + + void endJSON() throws ParseException, IOException; + + boolean startObject() throws ParseException, IOException; + + boolean endObject() throws ParseException, IOException; + + boolean startObjectEntry(String var1) throws ParseException, IOException; + + boolean endObjectEntry() throws ParseException, IOException; + + boolean startArray() throws ParseException, IOException; + + boolean endArray() throws ParseException, IOException; + + boolean primitive(Object var1) throws ParseException, IOException; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/ItemList.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ItemList.java new file mode 100644 index 0000000..1fa10b9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ItemList.java @@ -0,0 +1,138 @@ +package optifine.json; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +public class ItemList { + private String sp = ","; + List items = new ArrayList(); + + public ItemList() {} + + public ItemList(String s) { + this.split(s, this.sp, this.items); + } + + public ItemList(String s, String sp) { + this.sp = s; + this.split(s, sp, this.items); + } + + public ItemList(String s, String sp, boolean isMultiToken) { + this.split(s, sp, this.items, isMultiToken); + } + + public List getItems() { + return this.items; + } + + public String[] getArray() { + return (String[])this.items.toArray(); + } + + public void split(String s, String sp, List append, boolean isMultiToken) { + if (s != null && sp != null) { + if (isMultiToken) { + StringTokenizer tokens = new StringTokenizer(s, sp); + + while (tokens.hasMoreTokens()) { + append.add(tokens.nextToken().trim()); + } + } else { + this.split(s, sp, append); + } + } + } + + public void split(String s, String sp, List append) { + if (s != null && sp != null) { + int pos = 0; + boolean prevPos = false; + int prevPos1; + + do { + prevPos1 = pos; + pos = s.indexOf(sp, pos); + + if (pos == -1) { + break; + } + + append.add(s.substring(prevPos1, pos).trim()); + pos += sp.length(); + } + while (pos != -1); + + append.add(s.substring(prevPos1).trim()); + } + } + + public void setSP(String sp) { + this.sp = sp; + } + + public void add(int i, String item) { + if (item != null) { + this.items.add(i, item.trim()); + } + } + + public void add(String item) { + if (item != null) { + this.items.add(item.trim()); + } + } + + public void addAll(ItemList list) { + this.items.addAll(list.items); + } + + public void addAll(String s) { + this.split(s, this.sp, this.items); + } + + public void addAll(String s, String sp) { + this.split(s, sp, this.items); + } + + public void addAll(String s, String sp, boolean isMultiToken) { + this.split(s, sp, this.items, isMultiToken); + } + + public String get(int i) { + return (String)this.items.get(i); + } + + public int size() { + return this.items.size(); + } + + public String toString() { + return this.toString(this.sp); + } + + public String toString(String sp) { + StringBuffer sb = new StringBuffer(); + + for (int i = 0; i < this.items.size(); ++i) { + if (i == 0) { + sb.append(this.items.get(i)); + } else { + sb.append(sp); + sb.append(this.items.get(i)); + } + } + + return sb.toString(); + } + + public void clear() { + this.items.clear(); + } + + public void reset() { + this.sp = ","; + this.items.clear(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONArray.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONArray.java new file mode 100644 index 0000000..d430177 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONArray.java @@ -0,0 +1,81 @@ +package optifine.json; + +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class JSONArray extends ArrayList implements List, JSONAware, JSONStreamAware { + private static final long serialVersionUID = 3957988303675231981L; + + public static void writeJSONString(List list, Writer out) throws IOException { + if (list == null) { + out.write("null"); + } else { + boolean first = true; + Iterator iter = list.iterator(); + out.write(91); + + while (iter.hasNext()) { + if (first) { + first = false; + } else { + out.write(44); + } + + Object value = iter.next(); + + if (value == null) { + out.write("null"); + } else { + JSONValue.writeJSONString(value, out); + } + } + + out.write(93); + } + } + + public void writeJSONString(Writer out) throws IOException { + writeJSONString(this, out); + } + + public static String toJSONString(List list) { + if (list == null) { + return "null"; + } else { + boolean first = true; + StringBuffer sb = new StringBuffer(); + Iterator iter = list.iterator(); + sb.append('['); + + while (iter.hasNext()) { + if (first) { + first = false; + } else { + sb.append(','); + } + + Object value = iter.next(); + + if (value == null) { + sb.append("null"); + } else { + sb.append(JSONValue.toJSONString(value)); + } + } + + sb.append(']'); + return sb.toString(); + } + } + + public String toJSONString() { + return toJSONString(this); + } + + public String toString() { + return this.toJSONString(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONAware.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONAware.java new file mode 100644 index 0000000..d1b369e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONAware.java @@ -0,0 +1,5 @@ +package optifine.json; + +public interface JSONAware { + String toJSONString(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONObject.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONObject.java new file mode 100644 index 0000000..c469fad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONObject.java @@ -0,0 +1,100 @@ +package optifine.json; + +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; + +public class JSONObject extends LinkedHashMap implements Map, JSONAware, JSONStreamAware { + private static final long serialVersionUID = -503443796854799292L; + + public static void writeJSONString(Map map, Writer out) throws IOException { + if (map == null) { + out.write("null"); + } else { + boolean first = true; + Iterator iter = map.entrySet().iterator(); + out.write(123); + + while (iter.hasNext()) { + if (first) { + first = false; + } else { + out.write(44); + } + + Entry entry = (Entry)iter.next(); + out.write(34); + out.write(escape(String.valueOf(entry.getKey()))); + out.write(34); + out.write(58); + JSONValue.writeJSONString(entry.getValue(), out); + } + + out.write(125); + } + } + + public void writeJSONString(Writer out) throws IOException { + writeJSONString(this, out); + } + + public static String toJSONString(Map map) { + if (map == null) { + return "null"; + } else { + StringBuffer sb = new StringBuffer(); + boolean first = true; + Iterator iter = map.entrySet().iterator(); + sb.append('{'); + + while (iter.hasNext()) { + if (first) { + first = false; + } else { + sb.append(','); + } + + Entry entry = (Entry)iter.next(); + toJSONString(String.valueOf(entry.getKey()), entry.getValue(), sb); + } + + sb.append('}'); + return sb.toString(); + } + } + + public String toJSONString() { + return toJSONString(this); + } + + private static String toJSONString(String key, Object value, StringBuffer sb) { + sb.append('\"'); + + if (key == null) { + sb.append("null"); + } else { + JSONValue.escape(key, sb); + } + + sb.append('\"').append(':'); + sb.append(JSONValue.toJSONString(value)); + return sb.toString(); + } + + public String toString() { + return this.toJSONString(); + } + + public static String toString(String key, Object value) { + StringBuffer sb = new StringBuffer(); + toJSONString(key, value, sb); + return sb.toString(); + } + + public static String escape(String s) { + return JSONValue.escape(s); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONParser.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONParser.java new file mode 100644 index 0000000..1e73398 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONParser.java @@ -0,0 +1,574 @@ +package optifine.json; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +public class JSONParser { + public static final int S_INIT = 0; + public static final int S_IN_FINISHED_VALUE = 1; + public static final int S_IN_OBJECT = 2; + public static final int S_IN_ARRAY = 3; + public static final int S_PASSED_PAIR_KEY = 4; + public static final int S_IN_PAIR_VALUE = 5; + public static final int S_END = 6; + public static final int S_IN_ERROR = -1; + private LinkedList handlerStatusStack; + private Yylex lexer = new Yylex((Reader)null); + private Yytoken token = null; + private int status = 0; + + private int peekStatus(LinkedList statusStack) { + if (statusStack.size() == 0) { + return -1; + } else { + Integer status = (Integer)statusStack.getFirst(); + return status.intValue(); + } + } + + public void reset() { + this.token = null; + this.status = 0; + this.handlerStatusStack = null; + } + + public void reset(Reader in) { + this.lexer.yyreset(in); + this.reset(); + } + + public int getPosition() { + return this.lexer.getPosition(); + } + + public Object parse(String s) throws ParseException { + return this.parse(s, (ContainerFactory)null); + } + + public Object parse(String s, ContainerFactory containerFactory) throws ParseException { + StringReader in = new StringReader(s); + + try { + return this.parse((Reader)in, containerFactory); + } catch (IOException var5) { + throw new ParseException(-1, 2, var5); + } + } + + public Object parse(Reader in) throws IOException, ParseException { + return this.parse(in, (ContainerFactory)null); + } + + public Object parse(Reader in, ContainerFactory containerFactory) throws IOException, ParseException { + this.reset(in); + LinkedList statusStack = new LinkedList(); + LinkedList valueStack = new LinkedList(); + + try { + do { + this.nextToken(); + String ie; + Map newObject; + List newArray; + label65: + + switch (this.status) { + case -1: + throw new ParseException(this.getPosition(), 1, this.token); + + case 0: + switch (this.token.type) { + case 0: + this.status = 1; + statusStack.addFirst(new Integer(this.status)); + valueStack.addFirst(this.token.value); + break label65; + + case 1: + this.status = 2; + statusStack.addFirst(new Integer(this.status)); + valueStack.addFirst(this.createObjectContainer(containerFactory)); + break label65; + + case 2: + default: + this.status = -1; + break label65; + + case 3: + this.status = 3; + statusStack.addFirst(new Integer(this.status)); + valueStack.addFirst(this.createArrayContainer(containerFactory)); + break label65; + } + + case 1: + if (this.token.type == -1) { + return valueStack.removeFirst(); + } + + throw new ParseException(this.getPosition(), 1, this.token); + + case 2: + switch (this.token.type) { + case 0: + if (this.token.value instanceof String) { + ie = (String)this.token.value; + valueStack.addFirst(ie); + this.status = 4; + statusStack.addFirst(new Integer(this.status)); + } else { + this.status = -1; + } + + break label65; + + case 1: + case 3: + case 4: + default: + this.status = -1; + break label65; + + case 2: + if (valueStack.size() > 1) { + statusStack.removeFirst(); + valueStack.removeFirst(); + this.status = this.peekStatus(statusStack); + } else { + this.status = 1; + } + + case 5: + break label65; + } + + case 3: + List ie1; + + switch (this.token.type) { + case 0: + ie1 = (List)valueStack.getFirst(); + ie1.add(this.token.value); + break label65; + + case 1: + ie1 = (List)valueStack.getFirst(); + newObject = this.createObjectContainer(containerFactory); + ie1.add(newObject); + this.status = 2; + statusStack.addFirst(new Integer(this.status)); + valueStack.addFirst(newObject); + break label65; + + case 2: + default: + this.status = -1; + break label65; + + case 3: + ie1 = (List)valueStack.getFirst(); + newArray = this.createArrayContainer(containerFactory); + ie1.add(newArray); + this.status = 3; + statusStack.addFirst(new Integer(this.status)); + valueStack.addFirst(newArray); + break label65; + + case 4: + if (valueStack.size() > 1) { + statusStack.removeFirst(); + valueStack.removeFirst(); + this.status = this.peekStatus(statusStack); + } else { + this.status = 1; + } + + case 5: + break label65; + } + + case 4: + switch (this.token.type) { + case 0: + statusStack.removeFirst(); + ie = (String)valueStack.removeFirst(); + newObject = (Map)valueStack.getFirst(); + newObject.put(ie, this.token.value); + this.status = this.peekStatus(statusStack); + break; + + case 1: + statusStack.removeFirst(); + ie = (String)valueStack.removeFirst(); + newObject = (Map)valueStack.getFirst(); + Map newObject1 = this.createObjectContainer(containerFactory); + newObject.put(ie, newObject1); + this.status = 2; + statusStack.addFirst(new Integer(this.status)); + valueStack.addFirst(newObject1); + break; + + case 2: + case 4: + case 5: + default: + this.status = -1; + break; + + case 3: + statusStack.removeFirst(); + ie = (String)valueStack.removeFirst(); + newObject = (Map)valueStack.getFirst(); + newArray = this.createArrayContainer(containerFactory); + newObject.put(ie, newArray); + this.status = 3; + statusStack.addFirst(new Integer(this.status)); + valueStack.addFirst(newArray); + + case 6: + } + } + + if (this.status == -1) { + throw new ParseException(this.getPosition(), 1, this.token); + } + } + while (this.token.type != -1); + } catch (IOException var9) { + throw var9; + } + + throw new ParseException(this.getPosition(), 1, this.token); + } + + private void nextToken() throws ParseException, IOException { + this.token = this.lexer.yylex(); + + if (this.token == null) { + this.token = new Yytoken(-1, (Object)null); + } + } + + private Map createObjectContainer(ContainerFactory containerFactory) { + if (containerFactory == null) { + return new JSONObject(); + } else { + Map m = containerFactory.createObjectContainer(); + return (Map)(m == null ? new JSONObject() : m); + } + } + + private List createArrayContainer(ContainerFactory containerFactory) { + if (containerFactory == null) { + return new JSONArray(); + } else { + List l = containerFactory.creatArrayContainer(); + return (List)(l == null ? new JSONArray() : l); + } + } + + public void parse(String s, ContentHandler contentHandler) throws ParseException { + this.parse(s, contentHandler, false); + } + + public void parse(String s, ContentHandler contentHandler, boolean isResume) throws ParseException { + StringReader in = new StringReader(s); + + try { + this.parse((Reader)in, contentHandler, isResume); + } catch (IOException var6) { + throw new ParseException(-1, 2, var6); + } + } + + public void parse(Reader in, ContentHandler contentHandler) throws IOException, ParseException { + this.parse(in, contentHandler, false); + } + + public void parse(Reader in, ContentHandler contentHandler, boolean isResume) throws IOException, ParseException { + if (!isResume) { + this.reset(in); + this.handlerStatusStack = new LinkedList(); + } else if (this.handlerStatusStack == null) { + isResume = false; + this.reset(in); + this.handlerStatusStack = new LinkedList(); + } + + LinkedList statusStack = this.handlerStatusStack; + + try { + do { + label174: + + switch (this.status) { + case -1: + throw new ParseException(this.getPosition(), 1, this.token); + + case 0: + contentHandler.startJSON(); + this.nextToken(); + + switch (this.token.type) { + case 0: + this.status = 1; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.primitive(this.token.value)) { + return; + } + + break label174; + + case 1: + this.status = 2; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.startObject()) { + return; + } + + break label174; + + case 2: + default: + this.status = -1; + break label174; + + case 3: + this.status = 3; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.startArray()) { + return; + } + + break label174; + } + + case 1: + this.nextToken(); + + if (this.token.type == -1) { + contentHandler.endJSON(); + this.status = 6; + return; + } + + this.status = -1; + throw new ParseException(this.getPosition(), 1, this.token); + + case 2: + this.nextToken(); + + switch (this.token.type) { + case 0: + if (this.token.value instanceof String) { + String e = (String)this.token.value; + this.status = 4; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.startObjectEntry(e)) { + return; + } + } else { + this.status = -1; + } + + break label174; + + case 1: + case 3: + case 4: + default: + this.status = -1; + break label174; + + case 2: + if (statusStack.size() > 1) { + statusStack.removeFirst(); + this.status = this.peekStatus(statusStack); + } else { + this.status = 1; + } + + if (!contentHandler.endObject()) { + return; + } + + case 5: + break label174; + } + + case 3: + this.nextToken(); + + switch (this.token.type) { + case 0: + if (!contentHandler.primitive(this.token.value)) { + return; + } + + break label174; + + case 1: + this.status = 2; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.startObject()) { + return; + } + + break label174; + + case 2: + default: + this.status = -1; + break label174; + + case 3: + this.status = 3; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.startArray()) { + return; + } + + break label174; + + case 4: + if (statusStack.size() > 1) { + statusStack.removeFirst(); + this.status = this.peekStatus(statusStack); + } else { + this.status = 1; + } + + if (!contentHandler.endArray()) { + return; + } + + case 5: + break label174; + } + + case 4: + this.nextToken(); + + switch (this.token.type) { + case 0: + statusStack.removeFirst(); + this.status = this.peekStatus(statusStack); + + if (!contentHandler.primitive(this.token.value)) { + return; + } + + if (!contentHandler.endObjectEntry()) { + return; + } + + break label174; + + case 1: + statusStack.removeFirst(); + statusStack.addFirst(new Integer(5)); + this.status = 2; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.startObject()) { + return; + } + + break label174; + + case 2: + case 4: + case 5: + default: + this.status = -1; + break label174; + + case 3: + statusStack.removeFirst(); + statusStack.addFirst(new Integer(5)); + this.status = 3; + statusStack.addFirst(new Integer(this.status)); + + if (!contentHandler.startArray()) { + return; + } + + case 6: + break label174; + } + + case 5: + statusStack.removeFirst(); + this.status = this.peekStatus(statusStack); + + if (!contentHandler.endObjectEntry()) { + return; + } + + break; + + case 6: + return; + } + + if (this.status == -1) { + throw new ParseException(this.getPosition(), 1, this.token); + } + } + while (this.token.type != -1); + } catch (IOException var6) { + this.status = -1; + throw var6; + } catch (ParseException var7) { + this.status = -1; + throw var7; + } catch (RuntimeException var8) { + this.status = -1; + throw var8; + } catch (Error var9) { + this.status = -1; + throw var9; + } + + this.status = -1; + throw new ParseException(this.getPosition(), 1, this.token); + } + + public static Date parseDate(String input) { + if (input == null) { + return null; + } else { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd\'T\'HH:mm:ssz"); + + if (input.endsWith("Z")) { + input = input.substring(0, input.length() - 1) + "GMT-00:00"; + } else { + byte e = 6; + String s0 = input.substring(0, input.length() - e); + String s1 = input.substring(input.length() - e, input.length()); + input = s0 + "GMT" + s1; + } + + try { + return df.parse(input); + } catch (java.text.ParseException var5) { + System.out.println("Error parsing date: " + input); + System.out.println(var5.getClass().getName() + ": " + var5.getMessage()); + return null; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONStreamAware.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONStreamAware.java new file mode 100644 index 0000000..940c09e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONStreamAware.java @@ -0,0 +1,8 @@ +package optifine.json; + +import java.io.IOException; +import java.io.Writer; + +public interface JSONStreamAware { + void writeJSONString(Writer var1) throws IOException; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONValue.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONValue.java new file mode 100644 index 0000000..222023c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONValue.java @@ -0,0 +1,136 @@ +package optifine.json; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.Writer; +import java.util.List; +import java.util.Map; + +public class JSONValue { + public static Object parse(Reader in) { + try { + JSONParser e = new JSONParser(); + return e.parse(in); + } catch (Exception var2) { + return null; + } + } + + public static Object parse(String s) { + StringReader in = new StringReader(s); + return parse((Reader)in); + } + + public static Object parseWithException(Reader in) throws IOException, ParseException { + JSONParser parser = new JSONParser(); + return parser.parse(in); + } + + public static Object parseWithException(String s) throws ParseException { + JSONParser parser = new JSONParser(); + return parser.parse(s); + } + + public static void writeJSONString(Object value, Writer out) throws IOException { + if (value == null) { + out.write("null"); + } else if (value instanceof String) { + out.write(34); + out.write(escape((String)value)); + out.write(34); + } else if (value instanceof Double) { + if (!((Double)value).isInfinite() && !((Double)value).isNaN()) { + out.write(value.toString()); + } else { + out.write("null"); + } + } else if (!(value instanceof Float)) { + if (value instanceof Number) { + out.write(value.toString()); + } else if (value instanceof Boolean) { + out.write(value.toString()); + } else if (value instanceof JSONStreamAware) { + ((JSONStreamAware)value).writeJSONString(out); + } else if (value instanceof JSONAware) { + out.write(((JSONAware)value).toJSONString()); + } else if (value instanceof Map) { + JSONObject.writeJSONString((Map)value, out); + } else if (value instanceof List) { + JSONArray.writeJSONString((List)value, out); + } else { + out.write(value.toString()); + } + } else { + if (!((Float)value).isInfinite() && !((Float)value).isNaN()) { + out.write(value.toString()); + } else { + out.write("null"); + } + } + } + + public static String toJSONString(Object value) { + return value == null ? "null" : (value instanceof String ? "\"" + escape((String)value) + "\"" : (value instanceof Double ? (!((Double)value).isInfinite() && !((Double)value).isNaN() ? value.toString() : "null") : (value instanceof Float ? (!((Float)value).isInfinite() && !((Float)value).isNaN() ? value.toString() : "null") : (value instanceof Number ? value.toString() : (value instanceof Boolean ? value.toString() : (value instanceof JSONAware ? ((JSONAware)value).toJSONString() : (value instanceof Map ? JSONObject.toJSONString((Map)value) : (value instanceof List ? JSONArray.toJSONString((List)value) : value.toString())))))))); + } + + public static String escape(String s) { + if (s == null) { + return null; + } else { + StringBuffer sb = new StringBuffer(); + escape(s, sb); + return sb.toString(); + } + } + + static void escape(String s, StringBuffer sb) { + for (int i = 0; i < s.length(); ++i) { + char ch = s.charAt(i); + + switch (ch) { + case 8: + sb.append("\\b"); + break; + + case 9: + sb.append("\\t"); + break; + + case 10: + sb.append("\\n"); + break; + + case 12: + sb.append("\\f"); + break; + + case 13: + sb.append("\\r"); + break; + + case 34: + sb.append("\\\""); + break; + + case 92: + sb.append("\\\\"); + break; + + default: + if ((ch < 0 || ch > 31) && (ch < 127 || ch > 159) && (ch < 8192 || ch > 8447)) { + sb.append(ch); + } else { + String ss = Integer.toHexString(ch); + sb.append("\\u"); + + for (int k = 0; k < 4 - ss.length(); ++k) { + sb.append('0'); + } + + sb.append(ss.toUpperCase()); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONWriter.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONWriter.java new file mode 100644 index 0000000..0f504a5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/JSONWriter.java @@ -0,0 +1,113 @@ +package optifine.json; + +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; +import java.util.Set; + +public class JSONWriter { + private Writer writer = null; + private int indentStep = 2; + private int indent = 0; + + public JSONWriter(Writer writer) { + this.writer = writer; + } + + public JSONWriter(Writer writer, int indentStep) { + this.writer = writer; + this.indentStep = indentStep; + } + + public JSONWriter(Writer writer, int indentStep, int indent) { + this.writer = writer; + this.indentStep = indentStep; + this.indent = indent; + } + + public void writeObject(Object obj) throws IOException { + if (obj instanceof JSONObject) { + JSONObject jArr1 = (JSONObject)obj; + this.writeJsonObject(jArr1); + } else if (obj instanceof JSONArray) { + JSONArray jArr = (JSONArray)obj; + this.writeJsonArray(jArr); + } else { + this.writer.write(JSONValue.toJSONString(obj)); + } + } + + private void writeJsonArray(JSONArray jArr) throws IOException { + this.writeLine("["); + this.indentAdd(); + int num = jArr.size(); + + for (int i = 0; i < num; ++i) { + Object val = jArr.get(i); + this.writeIndent(); + this.writeObject(val); + + if (i < jArr.size() - 1) { + this.write(","); + } + + this.writeLine(""); + } + + this.indentRemove(); + this.writeIndent(); + this.writer.write("]"); + } + + private void writeJsonObject(JSONObject jObj) throws IOException { + this.writeLine("{"); + this.indentAdd(); + Set keys = jObj.keySet(); + int keyNum = keys.size(); + int count = 0; + Iterator it = keys.iterator(); + + while (it.hasNext()) { + String key = (String)it.next(); + Object val = jObj.get(key); + this.writeIndent(); + this.writer.write(JSONValue.toJSONString(key)); + this.writer.write(": "); + this.writeObject(val); + ++count; + + if (count < keyNum) { + this.writeLine(","); + } else { + this.writeLine(""); + } + } + + this.indentRemove(); + this.writeIndent(); + this.writer.write("}"); + } + + private void writeLine(String str) throws IOException { + this.writer.write(str); + this.writer.write("\n"); + } + + private void write(String str) throws IOException { + this.writer.write(str); + } + + private void writeIndent() throws IOException { + for (int i = 0; i < this.indent; ++i) { + this.writer.write(32); + } + } + + private void indentAdd() { + this.indent += this.indentStep; + } + + private void indentRemove() { + this.indent -= this.indentStep; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/ParseException.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ParseException.java new file mode 100644 index 0000000..009fc15 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/ParseException.java @@ -0,0 +1,72 @@ +package optifine.json; + +public class ParseException extends Exception { + private static final long serialVersionUID = -7880698968187728548L; + public static final int ERROR_UNEXPECTED_CHAR = 0; + public static final int ERROR_UNEXPECTED_TOKEN = 1; + public static final int ERROR_UNEXPECTED_EXCEPTION = 2; + private int errorType; + private Object unexpectedObject; + private int position; + + public ParseException(int errorType) { + this(-1, errorType, (Object)null); + } + + public ParseException(int errorType, Object unexpectedObject) { + this(-1, errorType, unexpectedObject); + } + + public ParseException(int position, int errorType, Object unexpectedObject) { + this.position = position; + this.errorType = errorType; + this.unexpectedObject = unexpectedObject; + } + + public int getErrorType() { + return this.errorType; + } + + public void setErrorType(int errorType) { + this.errorType = errorType; + } + + public int getPosition() { + return this.position; + } + + public void setPosition(int position) { + this.position = position; + } + + public Object getUnexpectedObject() { + return this.unexpectedObject; + } + + public void setUnexpectedObject(Object unexpectedObject) { + this.unexpectedObject = unexpectedObject; + } + + public String toString() { + StringBuffer sb = new StringBuffer(); + + switch (this.errorType) { + case 0: + sb.append("Unexpected character (").append(this.unexpectedObject).append(") at position ").append(this.position).append("."); + break; + + case 1: + sb.append("Unexpected token ").append(this.unexpectedObject).append(" at position ").append(this.position).append("."); + break; + + case 2: + sb.append("Unexpected exception at position ").append(this.position).append(": ").append(this.unexpectedObject); + break; + + default: + sb.append("Unkown error at position ").append(this.position).append("."); + } + + return sb.toString(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/Yylex.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/Yylex.java new file mode 100644 index 0000000..8e8cb30 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/Yylex.java @@ -0,0 +1,444 @@ +package optifine.json; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + +class Yylex { + public static final int YYEOF = -1; + private static final int ZZ_BUFFERSIZE = 16384; + public static final int YYINITIAL = 0; + public static final int STRING_BEGIN = 2; + private static final int[] ZZ_LEXSTATE = new int[] {0, 0, 1, 1}; + private static final String ZZ_CMAP_PACKED = "\t\u0000\u0001\u0007\u0001\u0007\u0002\u0000\u0001\u0007\u0012\u0000\u0001\u0007\u0001\u0000\u0001\t\b\u0000\u0001\u0006\u0001\u0019\u0001\u0002\u0001\u0004\u0001\n\n\u0003\u0001\u001a\u0006\u0000\u0004\u0001\u0001\u0005\u0001\u0001\u0014\u0000\u0001\u0017\u0001\b\u0001\u0018\u0003\u0000\u0001\u0012\u0001\u000b\u0002\u0001\u0001\u0011\u0001\f\u0005\u0000\u0001\u0013\u0001\u0000\u0001\r\u0003\u0000\u0001\u000e\u0001\u0014\u0001\u000f\u0001\u0010\u0005\u0000\u0001\u0015\u0001\u0000\u0001\u0016\uff82\u0000"; + private static final char[] ZZ_CMAP = zzUnpackCMap("\t\u0000\u0001\u0007\u0001\u0007\u0002\u0000\u0001\u0007\u0012\u0000\u0001\u0007\u0001\u0000\u0001\t\b\u0000\u0001\u0006\u0001\u0019\u0001\u0002\u0001\u0004\u0001\n\n\u0003\u0001\u001a\u0006\u0000\u0004\u0001\u0001\u0005\u0001\u0001\u0014\u0000\u0001\u0017\u0001\b\u0001\u0018\u0003\u0000\u0001\u0012\u0001\u000b\u0002\u0001\u0001\u0011\u0001\f\u0005\u0000\u0001\u0013\u0001\u0000\u0001\r\u0003\u0000\u0001\u000e\u0001\u0014\u0001\u000f\u0001\u0010\u0005\u0000\u0001\u0015\u0001\u0000\u0001\u0016\uff82\u0000"); + private static final int[] ZZ_ACTION = zzUnpackAction(); + private static final String ZZ_ACTION_PACKED_0 = "\u0002\u0000\u0002\u0001\u0001\u0002\u0001\u0003\u0001\u0004\u0003\u0001\u0001\u0005\u0001\u0006\u0001\u0007\u0001\b\u0001\t\u0001\n\u0001\u000b\u0001\f\u0001\r\u0005\u0000\u0001\f\u0001\u000e\u0001\u000f\u0001\u0010\u0001\u0011\u0001\u0012\u0001\u0013\u0001\u0014\u0001\u0000\u0001\u0015\u0001\u0000\u0001\u0015\u0004\u0000\u0001\u0016\u0001\u0017\u0002\u0000\u0001\u0018"; + private static final int[] ZZ_ROWMAP = zzUnpackRowMap(); + private static final String ZZ_ROWMAP_PACKED_0 = "\u0000\u0000\u0000\u001b\u00006\u0000Q\u0000l\u0000\u0087\u00006\u0000\u00a2\u0000\u00bd\u0000\u00d8\u00006\u00006\u00006\u00006\u00006\u00006\u0000\u00f3\u0000\u010e\u00006\u0000\u0129\u0000\u0144\u0000\u015f\u0000\u017a\u0000\u0195\u00006\u00006\u00006\u00006\u00006\u00006\u00006\u00006\u0000\u01b0\u0000\u01cb\u0000\u01e6\u0000\u01e6\u0000\u0201\u0000\u021c\u0000\u0237\u0000\u0252\u00006\u00006\u0000\u026d\u0000\u0288\u00006"; + private static final int[] ZZ_TRANS = new int[] {2, 2, 3, 4, 2, 2, 2, 5, 2, 6, 2, 2, 7, 8, 2, 9, 2, 2, 2, 2, 2, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, -1, -1, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, 39, -1, 39, -1, -1, -1, -1, -1, 39, 39, -1, -1, -1, -1, 39, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, -1, 42, -1, 42, -1, -1, -1, -1, -1, 42, 42, -1, -1, -1, -1, 42, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, 43, -1, 43, -1, -1, -1, -1, -1, 43, 43, -1, -1, -1, -1, 43, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, -1, 44, -1, 44, -1, -1, -1, -1, -1, 44, 44, -1, -1, -1, -1, 44, 44, -1, -1, -1, -1, -1, -1, -1, -1}; + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + private static final String[] ZZ_ERROR_MSG = new String[] {"Unkown internal scanner error", "Error: could not match input", "Error: pushback value was too large"}; + private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute(); + private static final String ZZ_ATTRIBUTE_PACKED_0 = "\u0002\u0000\u0001\t\u0003\u0001\u0001\t\u0003\u0001\u0006\t\u0002\u0001\u0001\t\u0005\u0000\b\t\u0001\u0000\u0001\u0001\u0001\u0000\u0001\u0001\u0004\u0000\u0002\t\u0002\u0000\u0001\t"; + private Reader zzReader; + private int zzState; + private int zzLexicalState; + private char[] zzBuffer; + private int zzMarkedPos; + private int zzCurrentPos; + private int zzStartRead; + private int zzEndRead; + private int yyline; + private int yychar; + private int yycolumn; + private boolean zzAtBOL; + private boolean zzAtEOF; + private StringBuffer sb; + + private static int[] zzUnpackAction() { + int[] result = new int[45]; + byte offset = 0; + zzUnpackAction("\u0002\u0000\u0002\u0001\u0001\u0002\u0001\u0003\u0001\u0004\u0003\u0001\u0001\u0005\u0001\u0006\u0001\u0007\u0001\b\u0001\t\u0001\n\u0001\u000b\u0001\f\u0001\r\u0005\u0000\u0001\f\u0001\u000e\u0001\u000f\u0001\u0010\u0001\u0011\u0001\u0012\u0001\u0013\u0001\u0014\u0001\u0000\u0001\u0015\u0001\u0000\u0001\u0015\u0004\u0000\u0001\u0016\u0001\u0017\u0002\u0000\u0001\u0018", offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int[] result) { + int i = 0; + int j = offset; + int l = packed.length(); + + while (i < l) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + + while (true) { + result[j++] = value; + --count; + + if (count <= 0) { + break; + } + } + } + + return j; + } + + private static int[] zzUnpackRowMap() { + int[] result = new int[45]; + byte offset = 0; + zzUnpackRowMap("\u0000\u0000\u0000\u001b\u00006\u0000Q\u0000l\u0000\u0087\u00006\u0000\u00a2\u0000\u00bd\u0000\u00d8\u00006\u00006\u00006\u00006\u00006\u00006\u0000\u00f3\u0000\u010e\u00006\u0000\u0129\u0000\u0144\u0000\u015f\u0000\u017a\u0000\u0195\u00006\u00006\u00006\u00006\u00006\u00006\u00006\u00006\u0000\u01b0\u0000\u01cb\u0000\u01e6\u0000\u01e6\u0000\u0201\u0000\u021c\u0000\u0237\u0000\u0252\u00006\u00006\u0000\u026d\u0000\u0288\u00006", offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int[] result) { + int i = 0; + int j = offset; + int high; + + for (int l = packed.length(); i < l; result[j++] = high | packed.charAt(i++)) { + high = packed.charAt(i++) << 16; + } + + return j; + } + + private static int[] zzUnpackAttribute() { + int[] result = new int[45]; + byte offset = 0; + zzUnpackAttribute("\u0002\u0000\u0001\t\u0003\u0001\u0001\t\u0003\u0001\u0006\t\u0002\u0001\u0001\t\u0005\u0000\b\t\u0001\u0000\u0001\u0001\u0001\u0000\u0001\u0001\u0004\u0000\u0002\t\u0002\u0000\u0001\t", offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int[] result) { + int i = 0; + int j = offset; + int l = packed.length(); + + while (i < l) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + + while (true) { + result[j++] = value; + --count; + + if (count <= 0) { + break; + } + } + } + + return j; + } + + int getPosition() { + return this.yychar; + } + + Yylex(Reader in) { + this.zzLexicalState = 0; + this.zzBuffer = new char[16384]; + this.zzAtBOL = true; + this.sb = new StringBuffer(); + this.zzReader = in; + } + + Yylex(InputStream in) { + this((Reader)(new InputStreamReader(in))); + } + + private static char[] zzUnpackCMap(String packed) { + char[] map = new char[65536]; + int i = 0; + int j = 0; + + while (i < 90) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + + while (true) { + map[j++] = value; + --count; + + if (count <= 0) { + break; + } + } + } + + return map; + } + + private boolean zzRefill() throws IOException { + if (this.zzStartRead > 0) { + System.arraycopy(this.zzBuffer, this.zzStartRead, this.zzBuffer, 0, this.zzEndRead - this.zzStartRead); + this.zzEndRead -= this.zzStartRead; + this.zzCurrentPos -= this.zzStartRead; + this.zzMarkedPos -= this.zzStartRead; + this.zzStartRead = 0; + } + + if (this.zzCurrentPos >= this.zzBuffer.length) { + char[] numRead = new char[this.zzCurrentPos * 2]; + System.arraycopy(this.zzBuffer, 0, numRead, 0, this.zzBuffer.length); + this.zzBuffer = numRead; + } + + int numRead1 = this.zzReader.read(this.zzBuffer, this.zzEndRead, this.zzBuffer.length - this.zzEndRead); + + if (numRead1 > 0) { + this.zzEndRead += numRead1; + return false; + } else if (numRead1 == 0) { + int c = this.zzReader.read(); + + if (c == -1) { + return true; + } else { + this.zzBuffer[this.zzEndRead++] = (char)c; + return false; + } + } else { + return true; + } + } + + public final void yyclose() throws IOException { + this.zzAtEOF = true; + this.zzEndRead = this.zzStartRead; + + if (this.zzReader != null) { + this.zzReader.close(); + } + } + + public final void yyreset(Reader reader) { + this.zzReader = reader; + this.zzAtBOL = true; + this.zzAtEOF = false; + this.zzEndRead = this.zzStartRead = 0; + this.zzCurrentPos = this.zzMarkedPos = 0; + this.yyline = this.yychar = this.yycolumn = 0; + this.zzLexicalState = 0; + } + + public final int yystate() { + return this.zzLexicalState; + } + + public final void yybegin(int newState) { + this.zzLexicalState = newState; + } + + public final String yytext() { + return new String(this.zzBuffer, this.zzStartRead, this.zzMarkedPos - this.zzStartRead); + } + + public final char yycharat(int pos) { + return this.zzBuffer[this.zzStartRead + pos]; + } + + public final int yylength() { + return this.zzMarkedPos - this.zzStartRead; + } + + private void zzScanError(int errorCode) { + String message; + + try { + message = ZZ_ERROR_MSG[errorCode]; + } catch (ArrayIndexOutOfBoundsException var4) { + message = ZZ_ERROR_MSG[0]; + } + + throw new Error(message); + } + + public void yypushback(int number) { + if (number > this.yylength()) { + this.zzScanError(2); + } + + this.zzMarkedPos -= number; + } + + public Yytoken yylex() throws IOException, ParseException { + int zzEndReadL = this.zzEndRead; + char[] zzBufferL = this.zzBuffer; + char[] zzCMapL = ZZ_CMAP; + int[] zzTransL = ZZ_TRANS; + int[] zzRowMapL = ZZ_ROWMAP; + int[] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + int zzMarkedPosL = this.zzMarkedPos; + this.yychar += zzMarkedPosL - this.zzStartRead; + int zzAction = -1; + int zzCurrentPosL = this.zzCurrentPos = this.zzStartRead = zzMarkedPosL; + this.zzState = ZZ_LEXSTATE[this.zzLexicalState]; + int zzInput; + int var14; + + while (true) { + if (zzCurrentPosL < zzEndReadL) { + zzInput = zzBufferL[zzCurrentPosL++]; + } else { + if (this.zzAtEOF) { + zzInput = -1; + break; + } + + this.zzCurrentPos = zzCurrentPosL; + this.zzMarkedPos = zzMarkedPosL; + boolean val = this.zzRefill(); + zzCurrentPosL = this.zzCurrentPos; + zzMarkedPosL = this.zzMarkedPos; + zzBufferL = this.zzBuffer; + zzEndReadL = this.zzEndRead; + + if (val) { + zzInput = -1; + break; + } + + zzInput = zzBufferL[zzCurrentPosL++]; + } + + var14 = zzTransL[zzRowMapL[this.zzState] + zzCMapL[zzInput]]; + + if (var14 != -1) { + this.zzState = var14; + int zzAttributes = zzAttrL[this.zzState]; + + if ((zzAttributes & 1) != 1) { + continue; + } + + zzAction = this.zzState; + zzMarkedPosL = zzCurrentPosL; + + if ((zzAttributes & 8) != 8) { + continue; + } + } + + break; + } + + this.zzMarkedPos = zzMarkedPosL; + + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + throw new ParseException(this.yychar, 0, new Character(this.yycharat(0))); + + case 2: + Long var17 = Long.valueOf(this.yytext()); + return new Yytoken(0, var17); + + case 3: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + break; + + case 4: + this.sb.delete(0, this.sb.length()); + this.yybegin(2); + break; + + case 5: + return new Yytoken(1, (Object)null); + + case 6: + return new Yytoken(2, (Object)null); + + case 7: + return new Yytoken(3, (Object)null); + + case 8: + return new Yytoken(4, (Object)null); + + case 9: + return new Yytoken(5, (Object)null); + + case 10: + return new Yytoken(6, (Object)null); + + case 11: + this.sb.append(this.yytext()); + break; + + case 12: + this.sb.append('\\'); + break; + + case 13: + this.yybegin(0); + return new Yytoken(0, this.sb.toString()); + + case 14: + this.sb.append('\"'); + break; + + case 15: + this.sb.append('/'); + break; + + case 16: + this.sb.append('\b'); + break; + + case 17: + this.sb.append('\f'); + break; + + case 18: + this.sb.append('\n'); + break; + + case 19: + this.sb.append('\r'); + break; + + case 20: + this.sb.append('\t'); + break; + + case 21: + Double var16 = Double.valueOf(this.yytext()); + return new Yytoken(0, var16); + + case 22: + return new Yytoken(0, (Object)null); + + case 23: + Boolean var15 = Boolean.valueOf(this.yytext()); + return new Yytoken(0, var15); + + case 24: + try { + var14 = Integer.parseInt(this.yytext().substring(2), 16); + this.sb.append((char)var14); + break; + } + catch (Exception var13) { + throw new ParseException(this.yychar, 2, var13); + } + + default: + if (zzInput == -1 && this.zzStartRead == this.zzCurrentPos) { + this.zzAtEOF = true; + return null; + } + + this.zzScanError(1); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/json/Yytoken.java b/Tellinq-CB-1.7.10/src/main/java/optifine/json/Yytoken.java new file mode 100644 index 0000000..24458d0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/json/Yytoken.java @@ -0,0 +1,58 @@ +package optifine.json; + +public class Yytoken { + public static final int TYPE_VALUE = 0; + public static final int TYPE_LEFT_BRACE = 1; + public static final int TYPE_RIGHT_BRACE = 2; + public static final int TYPE_LEFT_SQUARE = 3; + public static final int TYPE_RIGHT_SQUARE = 4; + public static final int TYPE_COMMA = 5; + public static final int TYPE_COLON = 6; + public static final int TYPE_EOF = -1; + public int type = 0; + public Object value = null; + + public Yytoken(int type, Object value) { + this.type = type; + this.value = value; + } + + public String toString() { + StringBuffer sb = new StringBuffer(); + + switch (this.type) { + case -1: + sb.append("END OF FILE"); + break; + + case 0: + sb.append("VALUE(").append(this.value).append(")"); + break; + + case 1: + sb.append("LEFT BRACE({)"); + break; + + case 2: + sb.append("RIGHT BRACE(})"); + break; + + case 3: + sb.append("LEFT SQUARE([)"); + break; + + case 4: + sb.append("RIGHT SQUARE(])"); + break; + + case 5: + sb.append("COMMA(,)"); + break; + + case 6: + sb.append("COLON(:)"); + } + + return sb.toString(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/BitArray.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/BitArray.java new file mode 100644 index 0000000..99f00fb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/BitArray.java @@ -0,0 +1,29 @@ +package optifine.xdelta; + +public class BitArray { + int[] implArray; + int size; + static final int INT_SIZE = 32; + + public BitArray(int size) { + int implSize = size / 32 + 1; + this.implArray = new int[implSize]; + } + + public void set(int pos, boolean value) { + int implPos = pos / 32; + int bitMask = 1 << (pos & 31); + + if (value) { + this.implArray[implPos] |= bitMask; + } else { + this.implArray[implPos] &= ~bitMask; + } + } + + public boolean get(int pos) { + int implPos = pos / 32; + int bitMask = 1 << (pos & 31); + return (this.implArray[implPos] & bitMask) != 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/ByteArraySeekableSource.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/ByteArraySeekableSource.java new file mode 100644 index 0000000..603a41a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/ByteArraySeekableSource.java @@ -0,0 +1,40 @@ +package optifine.xdelta; + +import java.io.IOException; + +public class ByteArraySeekableSource implements SeekableSource { + byte[] source; + long lastPos = 0L; + + public ByteArraySeekableSource(byte[] source) { + this.source = source; + } + + public void seek(long pos) throws IOException { + this.lastPos = pos; + } + + public int read(byte[] b, int off, int len) throws IOException { + int maxLength = this.source.length - (int)this.lastPos; + + if (maxLength <= 0) { + return -1; + } else { + if (maxLength < len) { + len = maxLength; + } + + System.arraycopy(this.source, (int)this.lastPos, b, off, len); + this.lastPos += (long)len; + return len; + } + } + + public long length() throws IOException { + return (long)this.source.length; + } + + public void close() throws IOException { + this.source = null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/Checksum.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/Checksum.java new file mode 100644 index 0000000..8018435 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/Checksum.java @@ -0,0 +1,146 @@ +package optifine.xdelta; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + +public class Checksum { + public static final int BASE = 65521; + public static final int S = 16; + public static boolean debug = false; + protected int[] hashtable; + protected long[] checksums; + protected int prime; + protected static final char[] single_hash = new char[] {48337, 47973, 17090, 57342, 38502, 17179, 34052, 60230, 25465, 54368, 53012, 21455, 56145, 56072, 4808, 62978, 59238, 9108, 9485, 56507, 42616, 687, 42438, 32422, 46661, 52045, 50251, 58844, 40934, 23388, 13813, 28698, 8719, 27704, 6742, 19619, 65478, 45394, 36193, 31320, 36901, 35645, 48911, 38307, 58868, 49447, 15341, 12811, 47091, 24660, 13116, 54147, 33108, 21058, 19981, 2708, 28712, 34441, 14882, 2432, 6215, 45297, 39772, 16758, 47192, 54594, 8044, 9367, 27226, 40873, 35930, 30531, 43177, 39426, 18712, 17292, 50056, 40491, 19629, 438, 43801, 63351, 13919, 7858, 2334, 31736, 31374, 21031, 60081, 8308, 17699, 59265, 419, 5693, 15150, 10365, 24191, 41059, 45364, 36782, 24206, 47031, 17736, 8026, 64086, 31268, 36879, 17116, 52329, 672, 2850, 56113, 29182, 3197, 5938, 4441, 51977, 57810, 4945, 21225, 62774, 23119, 49942, 27641, 35220, 46964, 24382, 63190, 14945, 63532, 52258, 40198, 10652, 2533, 7916, 20815, 36179, 42576, 23662, 50551, 31064, 29100, 35094, 39759, 11273, 21009, 63192, 51882, 63471, 10367, 31380, 43849, 64044, 29218, 58455, 55066, '\u00c3', 6774, 59788, 49207, 33288, 23597, 57306, 58869, 2885, 5582, 35454, 64685, 43565, 19292, 54318, 45649, 36990, 39495, 51622, 55615, 2142, 13774, 41299, 32379, 40715, 9642, 23967, 49229, 35342, 10357, 18972, 10591, 5011, 63328, 37240, 3931, 64125, 33716, 8322, 29213, 25698, 872, 26594, 34340, 6477, 8950, 30971, 26513, 45624, 45874, 29302, 62066, 18412, 17668, 43361, 40904, 16348, 46099, 'z', 2054, 29784, 38342, 52394, 6358, 58030, 6918, 62454, 20560, 51432, 62636, 49228, 62492, 39215, 44612, 24347, 4371, 5944, 55720, 6634, 11571, 38552, 12265, 12863, 52706, 28017, 58237, 46743, 11343, 17267, 37122, 1885, 36389, 5746, 60456, 27339, 34508, 6254, 37908, 54900, 53669}; + + public static long queryChecksum(byte[] buf, int len) { + int high = 0; + int low = 0; + + for (int i = 0; i < len; ++i) { + low += single_hash[buf[i] + 128]; + high += low; + } + + return (long)((high & 65535) << 16 | low & 65535); + } + + public static long incrementChecksum(long checksum, byte out, byte in) { + char old_c = single_hash[out + 128]; + char new_c = single_hash[in + 128]; + int low = (int)(checksum & 65535L) - old_c + new_c & 65535; + int high = (int)(checksum >> 16) - old_c * 16 + low & 65535; + return (long)(high << 16 | low & 65535); + } + + public static int generateHash(long checksum) { + long high = checksum >> 16 & 65535L; + long low = checksum & 65535L; + long it = (high >> 2) + (low << 3) + (high << 16); + int hash = (int)(it ^ high ^ low); + return hash > 0 ? hash : -hash; + } + + public void generateChecksums(File sourceFile, int length) throws IOException { + FileInputStream fis = new FileInputStream(sourceFile); + + try { + this.generateChecksums((InputStream)fis, length); + } catch (IOException var8) { + throw var8; + } + finally { + fis.close(); + } + } + + public void generateChecksums(InputStream sis, int length) throws IOException { + BufferedInputStream is = new BufferedInputStream(sis); + int checksumcount = length / 16; + + if (debug) { + System.out.println("generating checksum array of size " + checksumcount); + } + + this.checksums = new long[checksumcount]; + this.hashtable = new int[checksumcount]; + this.prime = findClosestPrime(checksumcount); + + if (debug) { + System.out.println("using prime " + this.prime); + } + + int i; + + for (i = 0; i < checksumcount; ++i) { + byte[] hash = new byte[16]; + is.read(hash, 0, 16); + this.checksums[i] = queryChecksum(hash, 16); + } + + for (i = 0; i < checksumcount; ++i) { + this.hashtable[i] = -1; + } + + for (i = 0; i < checksumcount; ++i) { + int var7 = generateHash(this.checksums[i]) % this.prime; + + if (debug) { + System.out.println("checking with hash: " + var7); + } + + if (this.hashtable[var7] != -1) { + if (debug) { + System.out.println("hash table collision for index " + i); + } + } else { + this.hashtable[var7] = i; + } + } + } + + public int findChecksumIndex(long checksum) { + return this.hashtable[generateHash(checksum) % this.prime]; + } + + private static int findClosestPrime(int size) { + int prime = (int)SimplePrime.belowOrEqual((long)(size - 1)); + return prime < 2 ? 1 : prime; + } + + private String printIntArray(int[] a) { + String result = ""; + result = result + "["; + + for (int i = 0; i < a.length; ++i) { + result = result + a[i]; + + if (i != a.length - 1) { + result = result + ","; + } else { + result = result + "]"; + } + } + + return result; + } + + private String printLongArray(long[] a) { + String result = ""; + result = result + "["; + + for (int i = 0; i < a.length; ++i) { + result = result + a[i]; + + if (i != a.length - 1) { + result = result + ","; + } else { + result = result + "]"; + } + } + + return result; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DebugDiffWriter.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DebugDiffWriter.java new file mode 100644 index 0000000..842e98f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DebugDiffWriter.java @@ -0,0 +1,43 @@ +package optifine.xdelta; + +import java.io.IOException; + +public class DebugDiffWriter implements DiffWriter { + byte[] buf = new byte[256]; + int buflen = 0; + + public void addCopy(int offset, int length) throws IOException { + if (this.buflen > 0) { + this.writeBuf(); + } + + System.err.println("COPY off: " + offset + ", len: " + length); + } + + public void addData(byte b) throws IOException { + if (this.buflen < 256) { + this.buf[this.buflen++] = b; + } else { + this.writeBuf(); + } + } + + private void writeBuf() { + System.err.print("DATA: "); + + for (int ix = 0; ix < this.buflen; ++ix) { + if (this.buf[ix] == 10) { + System.err.print("\\n"); + } else { + System.err.print(String.valueOf((char)this.buf[ix])); + } + } + + System.err.println(""); + this.buflen = 0; + } + + public void flush() throws IOException {} + + public void close() throws IOException {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/Delta.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/Delta.java new file mode 100644 index 0000000..401d96d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/Delta.java @@ -0,0 +1,224 @@ +package optifine.xdelta; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PushbackInputStream; +import java.io.RandomAccessFile; + +public class Delta { + public static final int S = 16; + public static final boolean debug = false; + public static final int buff_size = 1024; + + public static void computeDelta(SeekableSource source, InputStream targetIS, int targetLength, DiffWriter output) throws IOException, DeltaException { + int sourceLength = (int)source.length(); + Checksum checksum = new Checksum(); + checksum.generateChecksums((InputStream)(new SeekableSourceInputStream(source)), sourceLength); + source.seek(0L); + PushbackInputStream target = new PushbackInputStream(new BufferedInputStream(targetIS), 1024); + boolean done = false; + byte[] buf = new byte[16]; + long hashf = 0L; + byte[] b = new byte[1]; + byte[] sourcebyte = new byte[16]; + int bytesRead; + int targetidx; + + if (targetLength > 16 && sourceLength > 16) { + bytesRead = target.read(buf, 0, 16); + targetidx = bytesRead; + hashf = Checksum.queryChecksum(buf, 16); + long alternativehashf = hashf; + boolean sourceOutofBytes = false; + label124: + + while (!done) { + int index = checksum.findChecksumIndex(hashf); + + if (index != -1) { + boolean ix = true; + int offset = index * 16; + int length = 15; + source.seek((long)offset); + + if (!sourceOutofBytes && source.read(sourcebyte, 0, 16) != -1) { + for (int start = 0; start < 16; ++start) { + if (sourcebyte[start] != buf[start]) { + ix = false; + } + } + } else { + sourceOutofBytes = true; + } + + if (ix & !sourceOutofBytes) { + long var34 = System.currentTimeMillis(); + boolean ok = true; + byte[] sourceBuff = new byte[1024]; + byte[] targetBuff = new byte[1024]; + boolean source_idx = false; + boolean target_idx = false; + boolean tCount = false; + + while (true) { + int var35 = source.read(sourceBuff, 0, 1024); + int remaining; + + if (var35 == -1) { + sourceOutofBytes = true; + } else { + int var36 = target.read(targetBuff, 0, var35); + + if (var36 != -1) { + remaining = Math.min(var35, var36); + int readStatus = 0; + + do { + ++targetidx; + ++length; + ok = sourceBuff[readStatus] == targetBuff[readStatus]; + ++readStatus; + + if (!ok) { + b[0] = targetBuff[readStatus - 1]; + + if (var36 != -1) + { + target.unread(targetBuff, readStatus, var36 - readStatus); + } + } + } + while (readStatus < remaining && ok); + + b[0] = targetBuff[readStatus - 1]; + + if (ok && targetLength - targetidx > 0) { + continue; + } + } + } + + output.addCopy(offset, length); + + if (targetLength - targetidx > 15) { + buf[0] = b[0]; + target.read(buf, 1, 15); + targetidx += 15; + alternativehashf = hashf = Checksum.queryChecksum(buf, 16); + continue label124; + } + + buf[0] = b[0]; + remaining = targetLength - targetidx; + target.read(buf, 1, remaining); + targetidx += remaining; + + for (int ix1 = 0; ix1 < remaining + 1; ++ix1) { + output.addData(buf[ix1]); + } + + done = true; + continue label124; + } + } + } + + int var33; + + if (targetLength - targetidx > 0) { + target.read(b, 0, 1); + ++targetidx; + output.addData(buf[0]); + alternativehashf = Checksum.incrementChecksum(alternativehashf, buf[0], b[0]); + + for (var33 = 0; var33 < 15; ++var33) { + buf[var33] = buf[var33 + 1]; + } + + buf[15] = b[0]; + hashf = Checksum.queryChecksum(buf, 16); + } else { + for (var33 = 0; var33 < 16; ++var33) { + output.addData(buf[var33]); + } + + done = true; + } + } + } else { + while ((bytesRead = target.read(buf)) >= 0) { + for (targetidx = 0; targetidx < bytesRead; ++targetidx) { + output.addData(buf[targetidx]); + } + } + } + } + + public static void computeDelta(byte[] source, InputStream targetIS, int targetLength, DiffWriter output) throws IOException, DeltaException { + computeDelta((SeekableSource)(new ByteArraySeekableSource(source)), targetIS, targetLength, output); + } + + public static void computeDelta(File sourceFile, File targetFile, DiffWriter output) throws IOException, DeltaException { + int targetLength = (int)targetFile.length(); + RandomAccessFileSeekableSource source = new RandomAccessFileSeekableSource(new RandomAccessFile(sourceFile, "r")); + FileInputStream targetIS = new FileInputStream(targetFile); + + try { + computeDelta((SeekableSource)source, targetIS, targetLength, output); + } catch (IOException var11) { + throw var11; + } catch (DeltaException var12) { + throw var12; + } + finally { + output.flush(); + source.close(); + targetIS.close(); + output.close(); + } + } + + public static void main(String[] argv) { + new Delta(); + + if (argv.length != 3) { + System.err.println("usage Delta [-d] source target [output]"); + System.err.println("either -d or an output filename must be specified."); + System.err.println("aborting.."); + } else { + try { + Object e = null; + File sourceFile = null; + File targetFile = null; + + if (argv[0].equals("-d")) { + sourceFile = new File(argv[1]); + targetFile = new File(argv[2]); + e = new DebugDiffWriter(); + } else { + sourceFile = new File(argv[0]); + targetFile = new File(argv[1]); + e = new GDiffWriter(new DataOutputStream(new BufferedOutputStream(new FileOutputStream(new File(argv[2]))))); + } + + if (sourceFile.length() > 2147483647L || targetFile.length() > 2147483647L) { + System.err.println("source or target is too large, max length is 2147483647"); + System.err.println("aborting.."); + return; + } + + computeDelta(sourceFile, targetFile, (DiffWriter)e); + ((DiffWriter)e).flush(); + ((DiffWriter)e).close(); + } catch (Exception var5) { + System.err.println("error while generating delta: " + var5); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DeltaException.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DeltaException.java new file mode 100644 index 0000000..65ae8c8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DeltaException.java @@ -0,0 +1,9 @@ +package optifine.xdelta; + +public class DeltaException extends Exception { + public DeltaException() {} + + public DeltaException(String msg) { + super(msg); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DiffWriter.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DiffWriter.java new file mode 100644 index 0000000..d896831 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/DiffWriter.java @@ -0,0 +1,13 @@ +package optifine.xdelta; + +import java.io.IOException; + +public interface DiffWriter { + void addCopy(int var1, int var2) throws IOException; + + void addData(byte var1) throws IOException; + + void flush() throws IOException; + + void close() throws IOException; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/EratosthenesPrimes.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/EratosthenesPrimes.java new file mode 100644 index 0000000..fe32f7b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/EratosthenesPrimes.java @@ -0,0 +1,100 @@ +package optifine.xdelta; + +public class EratosthenesPrimes { + static BitArray sieve; + static int lastInit = -1; + + public static synchronized void reset() { + sieve = null; + lastInit = -1; + } + + public static synchronized void init(int maxNumber) { + if (maxNumber > lastInit) { + int sqrt = (int)Math.ceil(Math.sqrt((double)maxNumber)); + lastInit = maxNumber; + maxNumber >>= 1; + ++maxNumber; + sqrt >>= 1; + ++sqrt; + sieve = new BitArray(maxNumber + 1); + sieve.set(0, true); + + for (int i = 1; i <= sqrt; ++i) { + if (!sieve.get(i)) { + int currentPrime = (i << 1) + 1; + + for (int j = i * ((i << 1) + 2); j <= maxNumber; j += currentPrime) { + sieve.set(j, true); + } + } + } + } + } + + public static synchronized int[] getPrimes(int maxNumber) { + int primesNo = primesCount(maxNumber); + + if (primesNo <= 0) { + return new int[0]; + } else if (maxNumber == 2) { + return new int[] {2}; + } else { + init(maxNumber); + int[] primes = new int[primesNo]; + int maxNumber_2 = maxNumber - 1 >> 1; + byte prime = 0; + int var6 = prime + 1; + primes[prime] = 2; + + for (int i = 1; i <= maxNumber_2; ++i) { + if (!sieve.get(i)) { + primes[var6++] = (i << 1) + 1; + } + } + + return primes; + } + } + + public static synchronized int primesCount(int number) { + if (number < 2) { + return 0; + } else { + init(number); + int maxNumber_2 = number - 1 >> 1; + int primesNo = 1; + + for (int i = 1; i <= maxNumber_2; ++i) { + if (!sieve.get(i)) { + ++primesNo; + } + } + + return primesNo; + } + } + + public static synchronized int belowOrEqual(int number) { + if (number < 2) { + return -1; + } else if (number == 2) { + return 2; + } else { + init(number); + int maxNumber_2 = number - 1 >> 1; + + for (int i = maxNumber_2; i > 0; --i) { + if (!sieve.get(i)) { + return (i << 1) + 1; + } + } + + return -1; + } + } + + public static int below(int number) { + return belowOrEqual(number - 1); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/GDiffPatcher.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/GDiffPatcher.java new file mode 100644 index 0000000..597d5e5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/GDiffPatcher.java @@ -0,0 +1,204 @@ +package optifine.xdelta; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.RandomAccessFile; + +public class GDiffPatcher { + public GDiffPatcher(File sourceFile, File patchFile, File outputFile) throws IOException, PatchException { + RandomAccessFileSeekableSource source = new RandomAccessFileSeekableSource(new RandomAccessFile(sourceFile, "r")); + FileInputStream patch = new FileInputStream(patchFile); + FileOutputStream output = new FileOutputStream(outputFile); + + try { + runPatch(source, patch, output); + } catch (IOException var12) { + throw var12; + } catch (PatchException var13) { + throw var13; + } + finally { + source.close(); + patch.close(); + output.close(); + } + } + + public GDiffPatcher(byte[] source, InputStream patch, OutputStream output) throws IOException, PatchException { + this((SeekableSource)(new ByteArraySeekableSource(source)), patch, output); + } + + public GDiffPatcher(SeekableSource source, InputStream patch, OutputStream out) throws IOException, PatchException { + runPatch(source, patch, out); + } + + private static void runPatch(SeekableSource source, InputStream patch, OutputStream out) throws IOException, PatchException { + DataOutputStream outOS = new DataOutputStream(out); + DataInputStream patchIS = new DataInputStream(patch); + + try { + byte[] e = new byte[256]; + byte i = 0; + + if (patchIS.readUnsignedByte() == 209 && patchIS.readUnsignedByte() == 255 && patchIS.readUnsignedByte() == 209 && patchIS.readUnsignedByte() == 255 && patchIS.readUnsignedByte() == 4) { + int i1 = i + 5; + + while (patchIS.available() > 0) { + int command = patchIS.readUnsignedByte(); + boolean length = false; + boolean offset = false; + int length1; + int offset1; + + switch (command) { + case 0: + break; + + case 1: + append(1, patchIS, outOS); + i1 += 2; + break; + + case 2: + append(2, patchIS, outOS); + i1 += 3; + break; + + case 246: + append(246, patchIS, outOS); + i1 += 247; + break; + + case 247: + length1 = patchIS.readUnsignedShort(); + append(length1, patchIS, outOS); + i1 += length1 + 3; + break; + + case 248: + length1 = patchIS.readInt(); + append(length1, patchIS, outOS); + i1 += length1 + 5; + break; + + case 249: + offset1 = patchIS.readUnsignedShort(); + length1 = patchIS.readUnsignedByte(); + copy((long)offset1, length1, source, outOS); + i1 += 4; + break; + + case 250: + offset1 = patchIS.readUnsignedShort(); + length1 = patchIS.readUnsignedShort(); + copy((long)offset1, length1, source, outOS); + i1 += 5; + break; + + case 251: + offset1 = patchIS.readUnsignedShort(); + length1 = patchIS.readInt(); + copy((long)offset1, length1, source, outOS); + i1 += 7; + break; + + case 252: + offset1 = patchIS.readInt(); + length1 = patchIS.readUnsignedByte(); + copy((long)offset1, length1, source, outOS); + i1 += 8; + break; + + case 253: + offset1 = patchIS.readInt(); + length1 = patchIS.readUnsignedShort(); + copy((long)offset1, length1, source, outOS); + i1 += 7; + break; + + case 254: + offset1 = patchIS.readInt(); + length1 = patchIS.readInt(); + copy((long)offset1, length1, source, outOS); + i1 += 9; + break; + + case 255: + long loffset = patchIS.readLong(); + length1 = patchIS.readInt(); + copy(loffset, length1, source, outOS); + i1 += 13; + break; + + default: + append(command, patchIS, outOS); + i1 += command + 1; + } + } + } else { + System.err.println("magic string not found, aborting!"); + } + } catch (PatchException var15) { + throw var15; + } + finally { + outOS.flush(); + } + } + + protected static void copy(long offset, int length, SeekableSource source, OutputStream output) throws IOException, PatchException { + if (offset + (long)length > source.length()) { + throw new PatchException("truncated source file, aborting"); + } else { + byte[] buf = new byte[256]; + source.seek(offset); + + while (length > 0) { + int len = length > 256 ? 256 : length; + int res = source.read(buf, 0, len); + output.write(buf, 0, res); + length -= res; + } + } + } + + protected static void append(int length, InputStream patch, OutputStream output) throws IOException { + int res; + + for (byte[] buf = new byte[256]; length > 0; length -= res) { + int len = length > 256 ? 256 : length; + res = patch.read(buf, 0, len); + output.write(buf, 0, res); + } + } + + public static void main(String[] argv) { + if (argv.length != 3) { + System.err.println("usage GDiffPatch source patch output"); + System.err.println("aborting.."); + } else { + try { + File ioe = new File(argv[0]); + File patchFile = new File(argv[1]); + File outputFile = new File(argv[2]); + + if (ioe.length() > 2147483647L || patchFile.length() > 2147483647L) { + System.err.println("source or patch is too large, max length is 2147483647"); + System.err.println("aborting.."); + return; + } + + new GDiffPatcher(ioe, patchFile, outputFile); + System.out.println("finished patching file"); + } catch (Exception var5) { + System.err.println("error while patching: " + var5); + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/GDiffWriter.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/GDiffWriter.java new file mode 100644 index 0000000..cfc95e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/GDiffWriter.java @@ -0,0 +1,109 @@ +package optifine.xdelta; + +import java.io.DataOutputStream; +import java.io.IOException; + +public class GDiffWriter implements DiffWriter { + byte[] buf = new byte[256]; + int buflen = 0; + protected boolean debug = false; + DataOutputStream output = null; + + public GDiffWriter(DataOutputStream os) throws IOException { + this.output = os; + this.output.writeByte(209); + this.output.writeByte(255); + this.output.writeByte(209); + this.output.writeByte(255); + this.output.writeByte(4); + } + + public void setDebug(boolean flag) { + this.debug = flag; + } + + public void addCopy(int offset, int length) throws IOException { + if (this.buflen > 0) { + this.writeBuf(); + } + + if (this.debug) { + System.err.println("COPY off: " + offset + ", len: " + length); + } + + if (offset > Integer.MAX_VALUE) { + this.output.writeByte(255); + } else if (offset < 65536) { + if (length < 256) { + this.output.writeByte(249); + this.output.writeShort(offset); + this.output.writeByte(length); + } else if (length > 65535) { + this.output.writeByte(251); + this.output.writeShort(offset); + this.output.writeInt(length); + } else { + this.output.writeByte(250); + this.output.writeShort(offset); + this.output.writeShort(length); + } + } else if (length < 256) { + this.output.writeByte(252); + this.output.writeInt(offset); + this.output.writeByte(length); + } else if (length > 65535) { + this.output.writeByte(254); + this.output.writeInt(offset); + this.output.writeInt(length); + } else { + this.output.writeByte(253); + this.output.writeInt(offset); + this.output.writeShort(length); + } + } + + public void addData(byte b) throws IOException { + if (this.buflen >= 246) { + this.writeBuf(); + } + + this.buf[this.buflen] = b; + ++this.buflen; + } + + private void writeBuf() throws IOException { + if (this.debug) { + System.err.print("DATA:"); + + for (int ix = 0; ix < this.buflen; ++ix) { + if (this.buf[ix] == 10) { + System.err.print("\\n"); + } else { + System.err.print(String.valueOf((char)this.buf[ix])); + } + } + + System.err.println(""); + } + + if (this.buflen > 0) { + this.output.writeByte(this.buflen); + this.output.write(this.buf, 0, this.buflen); + } + + this.buflen = 0; + } + + public void flush() throws IOException { + if (this.buflen > 0) { + this.writeBuf(); + } + + this.buflen = 0; + this.output.flush(); + } + + public void close() throws IOException { + this.flush(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/PatchException.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/PatchException.java new file mode 100644 index 0000000..115a5f1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/PatchException.java @@ -0,0 +1,9 @@ +package optifine.xdelta; + +public class PatchException extends Exception { + public PatchException() {} + + public PatchException(String msg) { + super(msg); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/RandomAccessFileSeekableSource.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/RandomAccessFileSeekableSource.java new file mode 100644 index 0000000..c00aa53 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/RandomAccessFileSeekableSource.java @@ -0,0 +1,28 @@ +package optifine.xdelta; + +import java.io.IOException; +import java.io.RandomAccessFile; + +public class RandomAccessFileSeekableSource implements SeekableSource { + RandomAccessFile raf; + + public RandomAccessFileSeekableSource(RandomAccessFile raf) { + this.raf = raf; + } + + public void seek(long pos) throws IOException { + this.raf.seek(pos); + } + + public int read(byte[] b, int off, int len) throws IOException { + return this.raf.read(b, off, len); + } + + public long length() throws IOException { + return this.raf.length(); + } + + public void close() throws IOException { + this.raf.close(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SeekableSource.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SeekableSource.java new file mode 100644 index 0000000..8b36fcd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SeekableSource.java @@ -0,0 +1,13 @@ +package optifine.xdelta; + +import java.io.IOException; + +public interface SeekableSource { + void seek(long var1) throws IOException; + + int read(byte[] var1, int var2, int var3) throws IOException; + + void close() throws IOException; + + long length() throws IOException; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SeekableSourceInputStream.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SeekableSourceInputStream.java new file mode 100644 index 0000000..71f14cb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SeekableSourceInputStream.java @@ -0,0 +1,26 @@ +package optifine.xdelta; + +import java.io.IOException; +import java.io.InputStream; + +public class SeekableSourceInputStream extends InputStream { + SeekableSource ss; + + public SeekableSourceInputStream(SeekableSource ss) { + this.ss = ss; + } + + public int read() throws IOException { + byte[] b = new byte[1]; + this.ss.read(b, 0, 1); + return b[0]; + } + + public int read(byte[] b, int off, int len) throws IOException { + return this.ss.read(b, off, len); + } + + public void close() throws IOException { + this.ss.close(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SimplePrime.java b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SimplePrime.java new file mode 100644 index 0000000..9e0630f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/optifine/xdelta/SimplePrime.java @@ -0,0 +1,65 @@ +package optifine.xdelta; + +public class SimplePrime { + public static long belowOrEqual(long number) { + if (number < 2L) { + return 0L; + } else if (number == 2L) { + return 2L; + } else { + if ((number & 1L) == 0L) { + --number; + } + + while (!testPrime(number)) { + number -= 2L; + + if (number <= 2L) { + return 2L; + } + } + + return number; + } + } + + public static long aboveOrEqual(long number) { + if (number <= 2L) { + return 2L; + } else { + if ((number & 1L) == 0L) { + ++number; + } + + while (!testPrime(number)) { + number += 2L; + + if (number < 0L) { + return 0L; + } + } + + return number; + } + } + + public static boolean testPrime(long number) { + if (number == 2L) { + return true; + } else if (number < 2L) { + return false; + } else if ((number & 1L) == 0L) { + return false; + } else { + long sqrt = (long)Math.floor(Math.sqrt((double)number)); + + for (long i = 3L; i <= sqrt; i += 2L) { + if (number % i == 0L) { + return false; + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/BlockAlias.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/BlockAlias.java new file mode 100644 index 0000000..c84dd93 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/BlockAlias.java @@ -0,0 +1,65 @@ +package shadersmod.client; + +import java.util.ArrayList; +import java.util.HashSet; +import net.minecraft.src.Config; +import net.minecraft.src.MatchBlock; + +public class BlockAlias { + private int blockId; + private MatchBlock[] matchBlocks; + + public BlockAlias(int blockId, MatchBlock[] matchBlocks) { + this.blockId = blockId; + this.matchBlocks = matchBlocks; + } + + public int getBlockId() { + return this.blockId; + } + + public boolean matches(int id, int metadata) { + for (int i = 0; i < this.matchBlocks.length; ++i) { + MatchBlock matchBlock = this.matchBlocks[i]; + + if (matchBlock.matches(id, metadata)) { + return true; + } + } + + return false; + } + + public int[] getMatchBlockIds() { + HashSet blockIdSet = new HashSet(); + + for (int blockIdsArr = 0; blockIdsArr < this.matchBlocks.length; ++blockIdsArr) { + MatchBlock blockIds = this.matchBlocks[blockIdsArr]; + int blockId = blockIds.getBlockId(); + blockIdSet.add(Integer.valueOf(blockId)); + } + + Integer[] var5 = (Integer[])blockIdSet.toArray(new Integer[blockIdSet.size()]); + int[] var6 = Config.toPrimitive(var5); + return var6; + } + + public MatchBlock[] getMatchBlocks(int matchBlockId) { + ArrayList listMatchBlock = new ArrayList(); + + for (int mbs = 0; mbs < this.matchBlocks.length; ++mbs) { + MatchBlock mb = this.matchBlocks[mbs]; + + if (mb.getBlockId() == matchBlockId) { + listMatchBlock.add(mb); + } + } + + MatchBlock[] var5 = (MatchBlock[])((MatchBlock[])listMatchBlock.toArray(new MatchBlock[listMatchBlock.size()])); + return var5; + } + + public String toString() { + return "block." + this.blockId + "=" + Config.arrayToString((Object[])this.matchBlocks); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/BlockAliases.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/BlockAliases.java new file mode 100644 index 0000000..3b406d6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/BlockAliases.java @@ -0,0 +1,176 @@ +package shadersmod.client; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Config; +import net.minecraft.src.ConnectedParser; +import net.minecraft.src.MatchBlock; +import net.minecraft.src.PropertiesOrdered; +import net.minecraft.src.Reflector; +import net.minecraft.src.ReflectorForge; +import net.minecraft.src.StrUtils; +import net.minecraft.util.ResourceLocation; + +public class BlockAliases { + private static BlockAlias[][] blockAliases = (BlockAlias[][])null; + private static boolean updateOnResourcesReloaded; + + public static int getMappedBlockId(int blockId, int metadata) { + if (blockAliases == null) { + return blockId; + } else if (blockId >= 0 && blockId < blockAliases.length) { + BlockAlias[] aliases = blockAliases[blockId]; + + if (aliases == null) { + return blockId; + } else { + for (int i = 0; i < aliases.length; ++i) { + BlockAlias ba = aliases[i]; + + if (ba.matches(blockId, metadata)) { + return ba.getBlockId(); + } + } + + return blockId; + } + } else { + return blockId; + } + } + + public static void resourcesReloaded() { + if (updateOnResourcesReloaded) { + updateOnResourcesReloaded = false; + update(Shaders.shaderPack); + } + } + + public static void update(IShaderPack shaderPack) { + reset(); + + if (shaderPack != null) { + if (Reflector.Loader_getActiveModList.exists() && Minecraft.getMinecraft().getResourcePackRepository() == null) { + Config.dbg("[Shaders] Delayed loading of block mappings after resources are loaded"); + updateOnResourcesReloaded = true; + } else { + ArrayList listBlockAliases = new ArrayList(); + String path = "/shaders/block.properties"; + InputStream in = shaderPack.getResourceAsStream(path); + + if (in != null) { + loadBlockAliases(in, path, listBlockAliases); + } + + loadModBlockAliases(listBlockAliases); + + if (listBlockAliases.size() > 0) { + blockAliases = toArrays(listBlockAliases); + } + } + } + } + + private static void loadModBlockAliases(List> listBlockAliases) { + String[] modIds = ReflectorForge.getForgeModIds(); + + for (int i = 0; i < modIds.length; ++i) { + String modId = modIds[i]; + + try { + ResourceLocation e = new ResourceLocation(modId, "shaders/block.properties"); + InputStream in = Config.getResourceStream(e); + loadBlockAliases(in, e.toString(), listBlockAliases); + } catch (IOException var6) { + ; + } + } + } + + private static void loadBlockAliases(InputStream in, String path, List> listBlockAliases) { + if (in != null) { + try { + PropertiesOrdered e = new PropertiesOrdered(); + e.load(in); + in.close(); + Config.dbg("[Shaders] Parsing block mappings: " + path); + ConnectedParser cp = new ConnectedParser("Shaders"); + Set keys = e.keySet(); + Iterator it = keys.iterator(); + + while (it.hasNext()) { + String key = (String)it.next(); + String val = e.getProperty(key); + String prefix = "block."; + + if (!key.startsWith(prefix)) { + Config.warn("[Shaders] Invalid block ID: " + key); + } else { + String blockIdStr = StrUtils.removePrefix(key, prefix); + int blockId = Config.parseInt(blockIdStr, -1); + + if (blockId < 0) { + Config.warn("[Shaders] Invalid block ID: " + key); + } else { + MatchBlock[] matchBlocks = cp.parseMatchBlocks(val); + + if (matchBlocks != null && matchBlocks.length >= 1) { + BlockAlias ba = new BlockAlias(blockId, matchBlocks); + addToList(listBlockAliases, ba); + } else { + Config.warn("[Shaders] Invalid block ID mapping: " + key + "=" + val); + } + } + } + } + } catch (IOException var14) { + Config.warn("[Shaders] Error reading: " + path); + } + } + } + + private static void addToList(List> blocksAliases, BlockAlias ba) { + int[] blockIds = ba.getMatchBlockIds(); + + for (int i = 0; i < blockIds.length; ++i) { + int blockId = blockIds[i]; + + while (blockId >= blocksAliases.size()) { + blocksAliases.add(null); + } + + List blockAliases = (List)blocksAliases.get(blockId); + + if (blockAliases == null) { + blockAliases = new ArrayList(); + blocksAliases.set(blockId, blockAliases); + } + + BlockAlias baBlock = new BlockAlias(ba.getBlockId(), ba.getMatchBlocks(blockId)); + ((List)blockAliases).add(baBlock); + } + } + + private static BlockAlias[][] toArrays(List> listBlocksAliases) { + BlockAlias[][] bas = new BlockAlias[listBlocksAliases.size()][]; + + for (int i = 0; i < bas.length; ++i) { + List listBlockAliases = (List)listBlocksAliases.get(i); + + if (listBlockAliases != null) { + bas[i] = (BlockAlias[])((BlockAlias[])listBlockAliases.toArray(new BlockAlias[listBlockAliases.size()])); + } + } + + return bas; + } + + public static void reset() { + blockAliases = (BlockAlias[][])null; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ClippingHelperShadow.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ClippingHelperShadow.java new file mode 100644 index 0000000..0ee85ef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ClippingHelperShadow.java @@ -0,0 +1,265 @@ +package shadersmod.client; + +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.util.MathHelper; + +public class ClippingHelperShadow extends ClippingHelper { + private static ClippingHelperShadow instance = new ClippingHelperShadow(); + float[] frustumTest = new float[6]; + float[][] shadowClipPlanes = new float[10][4]; + int shadowClipPlaneCount; + float[] matInvMP = new float[16]; + float[] vecIntersection = new float[4]; + + /** + * Returns true if the box is inside all 6 clipping planes, otherwise returns false. + */ + public boolean isBoxInFrustum(double x1, double y1, double z1, double x2, double y2, double z2) { + for (int index = 0; index < this.shadowClipPlaneCount; ++index) { + float[] plane = this.shadowClipPlanes[index]; + + if (this.dot4(plane, x1, y1, z1) <= 0.0D && this.dot4(plane, x2, y1, z1) <= 0.0D && this.dot4(plane, x1, y2, z1) <= 0.0D && this.dot4(plane, x2, y2, z1) <= 0.0D && this.dot4(plane, x1, y1, z2) <= 0.0D && this.dot4(plane, x2, y1, z2) <= 0.0D && this.dot4(plane, x1, y2, z2) <= 0.0D && this.dot4(plane, x2, y2, z2) <= 0.0D) { + return false; + } + } + + return true; + } + + private double dot4(float[] plane, double x, double y, double z) { + return (double)plane[0] * x + (double)plane[1] * y + (double)plane[2] * z + (double)plane[3]; + } + + private double dot3(float[] vecA, float[] vecB) { + return (double)vecA[0] * (double)vecB[0] + (double)vecA[1] * (double)vecB[1] + (double)vecA[2] * (double)vecB[2]; + } + + public static ClippingHelper getInstance() { + instance.init(); + return instance; + } + + private void normalizePlane(float[] plane) { + float length = MathHelper.sqrt_float(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]); + plane[0] /= length; + plane[1] /= length; + plane[2] /= length; + plane[3] /= length; + } + + private void normalize3(float[] plane) { + float length = MathHelper.sqrt_float(plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2]); + + if (length == 0.0F) { + length = 1.0F; + } + + plane[0] /= length; + plane[1] /= length; + plane[2] /= length; + } + + private void assignPlane(float[] plane, float a, float b, float c, float d) { + float length = (float)Math.sqrt((double)(a * a + b * b + c * c)); + plane[0] = a / length; + plane[1] = b / length; + plane[2] = c / length; + plane[3] = d / length; + } + + private void copyPlane(float[] dst, float[] src) { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + } + + private void cross3(float[] out, float[] a, float[] b) { + out[0] = a[1] * b[2] - a[2] * b[1]; + out[1] = a[2] * b[0] - a[0] * b[2]; + out[2] = a[0] * b[1] - a[1] * b[0]; + } + + private void addShadowClipPlane(float[] plane) { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], plane); + } + + private float length(float x, float y, float z) { + return (float)Math.sqrt((double)(x * x + y * y + z * z)); + } + + private float distance(float x1, float y1, float z1, float x2, float y2, float z2) { + return this.length(x1 - x2, y1 - y2, z1 - z2); + } + + private void makeShadowPlane(float[] shadowPlane, float[] positivePlane, float[] negativePlane, float[] vecSun) { + this.cross3(this.vecIntersection, positivePlane, negativePlane); + this.cross3(shadowPlane, this.vecIntersection, vecSun); + this.normalize3(shadowPlane); + float dotPN = (float)this.dot3(positivePlane, negativePlane); + float dotSN = (float)this.dot3(shadowPlane, negativePlane); + float disSN = this.distance(shadowPlane[0], shadowPlane[1], shadowPlane[2], negativePlane[0] * dotSN, negativePlane[1] * dotSN, negativePlane[2] * dotSN); + float disPN = this.distance(positivePlane[0], positivePlane[1], positivePlane[2], negativePlane[0] * dotPN, negativePlane[1] * dotPN, negativePlane[2] * dotPN); + float k1 = disSN / disPN; + float dotSP = (float)this.dot3(shadowPlane, positivePlane); + float disSP = this.distance(shadowPlane[0], shadowPlane[1], shadowPlane[2], positivePlane[0] * dotSP, positivePlane[1] * dotSP, positivePlane[2] * dotSP); + float disNP = this.distance(negativePlane[0], negativePlane[1], negativePlane[2], positivePlane[0] * dotPN, positivePlane[1] * dotPN, positivePlane[2] * dotPN); + float k2 = disSP / disNP; + shadowPlane[3] = positivePlane[3] * k1 + negativePlane[3] * k2; + } + + public void init() { + float[] matPrj = this.projectionMatrix; + float[] matMdv = this.modelviewMatrix; + float[] matMP = this.clippingMatrix; + System.arraycopy(Shaders.faProjection, 0, matPrj, 0, 16); + System.arraycopy(Shaders.faModelView, 0, matMdv, 0, 16); + SMath.multiplyMat4xMat4(matMP, matMdv, matPrj); + this.assignPlane(this.frustum[0], matMP[3] - matMP[0], matMP[7] - matMP[4], matMP[11] - matMP[8], matMP[15] - matMP[12]); + this.assignPlane(this.frustum[1], matMP[3] + matMP[0], matMP[7] + matMP[4], matMP[11] + matMP[8], matMP[15] + matMP[12]); + this.assignPlane(this.frustum[2], matMP[3] + matMP[1], matMP[7] + matMP[5], matMP[11] + matMP[9], matMP[15] + matMP[13]); + this.assignPlane(this.frustum[3], matMP[3] - matMP[1], matMP[7] - matMP[5], matMP[11] - matMP[9], matMP[15] - matMP[13]); + this.assignPlane(this.frustum[4], matMP[3] - matMP[2], matMP[7] - matMP[6], matMP[11] - matMP[10], matMP[15] - matMP[14]); + this.assignPlane(this.frustum[5], matMP[3] + matMP[2], matMP[7] + matMP[6], matMP[11] + matMP[10], matMP[15] + matMP[14]); + float[] vecSun = Shaders.shadowLightPositionVector; + float test0 = (float)this.dot3(this.frustum[0], vecSun); + float test1 = (float)this.dot3(this.frustum[1], vecSun); + float test2 = (float)this.dot3(this.frustum[2], vecSun); + float test3 = (float)this.dot3(this.frustum[3], vecSun); + float test4 = (float)this.dot3(this.frustum[4], vecSun); + float test5 = (float)this.dot3(this.frustum[5], vecSun); + this.shadowClipPlaneCount = 0; + + if (test0 >= 0.0F) { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0]); + + if (test0 > 0.0F) { + if (test2 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[2], vecSun); + } + + if (test3 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[3], vecSun); + } + + if (test4 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[4], vecSun); + } + + if (test5 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[0], this.frustum[5], vecSun); + } + } + } + + if (test1 >= 0.0F) { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1]); + + if (test1 > 0.0F) { + if (test2 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[2], vecSun); + } + + if (test3 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[3], vecSun); + } + + if (test4 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[4], vecSun); + } + + if (test5 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[1], this.frustum[5], vecSun); + } + } + } + + if (test2 >= 0.0F) { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2]); + + if (test2 > 0.0F) { + if (test0 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[0], vecSun); + } + + if (test1 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[1], vecSun); + } + + if (test4 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[4], vecSun); + } + + if (test5 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[2], this.frustum[5], vecSun); + } + } + } + + if (test3 >= 0.0F) { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3]); + + if (test3 > 0.0F) { + if (test0 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[0], vecSun); + } + + if (test1 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[1], vecSun); + } + + if (test4 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[4], vecSun); + } + + if (test5 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[3], this.frustum[5], vecSun); + } + } + } + + if (test4 >= 0.0F) { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4]); + + if (test4 > 0.0F) { + if (test0 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[0], vecSun); + } + + if (test1 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[1], vecSun); + } + + if (test2 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[2], vecSun); + } + + if (test3 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[4], this.frustum[3], vecSun); + } + } + } + + if (test5 >= 0.0F) { + this.copyPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5]); + + if (test5 > 0.0F) { + if (test0 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[0], vecSun); + } + + if (test1 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[1], vecSun); + } + + if (test2 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[2], vecSun); + } + + if (test3 < 0.0F) { + this.makeShadowPlane(this.shadowClipPlanes[this.shadowClipPlaneCount++], this.frustum[5], this.frustum[3], vecSun); + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/CustomTexture.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/CustomTexture.java new file mode 100644 index 0000000..80f3e46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/CustomTexture.java @@ -0,0 +1,40 @@ +package shadersmod.client; + +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureUtil; + +public class CustomTexture implements ICustomTexture { + private int textureUnit = -1; + private String path = null; + private ITextureObject texture = null; + + public CustomTexture(int textureUnit, String path, ITextureObject texture) { + this.textureUnit = textureUnit; + this.path = path; + this.texture = texture; + } + + public int getTextureUnit() { + return this.textureUnit; + } + + public String getPath() { + return this.path; + } + + public ITextureObject getTexture() { + return this.texture; + } + + public int getTextureId() { + return this.texture.getGlTextureId(); + } + + public void deleteTexture() { + TextureUtil.deleteTexture(this.texture.getGlTextureId()); + } + + public String toString() { + return "textureUnit: " + this.textureUnit + ", path: " + this.path + ", glTextureId: " + this.texture.getGlTextureId(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/DefaultTexture.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/DefaultTexture.java new file mode 100644 index 0000000..0baa9fa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/DefaultTexture.java @@ -0,0 +1,15 @@ +package shadersmod.client; + +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.resources.IResourceManager; + +public class DefaultTexture extends AbstractTexture { + public DefaultTexture() { + this.loadTexture((IResourceManager)null); + } + + public void loadTexture(IResourceManager resourcemanager) { + int[] aint = ShadersTex.createAIntImage(1, -1); + ShadersTex.setupTexture(this.getMultiTexID(), aint, 1, 1, false, false); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/EnumShaderOption.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/EnumShaderOption.java new file mode 100644 index 0000000..bcb8457 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/EnumShaderOption.java @@ -0,0 +1,43 @@ +package shadersmod.client; + +public enum EnumShaderOption { + ANTIALIASING("of.options.shaders.ANTIALIASING", "antialiasingLevel", "0"), + NORMAL_MAP("of.options.shaders.NORMAL_MAP", "normalMapEnabled", "true"), + SPECULAR_MAP("of.options.shaders.SPECULAR_MAP", "specularMapEnabled", "true"), + RENDER_RES_MUL("of.options.shaders.RENDER_RES_MUL", "renderResMul", "1.0"), + SHADOW_RES_MUL("of.options.shaders.SHADOW_RES_MUL", "shadowResMul", "1.0"), + HAND_DEPTH_MUL("of.options.shaders.HAND_DEPTH_MUL", "handDepthMul", "0.125"), + CLOUD_SHADOW("of.options.shaders.CLOUD_SHADOW", "cloudShadow", "true"), + OLD_HAND_LIGHT("of.options.shaders.OLD_HAND_LIGHT", "oldHandLight", "default"), + OLD_LIGHTING("of.options.shaders.OLD_LIGHTING", "oldLighting", "default"), + SHADER_PACK("of.options.shaders.SHADER_PACK", "shaderPack", ""), + TWEAK_BLOCK_DAMAGE("of.options.shaders.TWEAK_BLOCK_DAMAGE", "tweakBlockDamage", "false"), + SHADOW_CLIP_FRUSTRUM("of.options.shaders.SHADOW_CLIP_FRUSTRUM", "shadowClipFrustrum", "true"), + TEX_MIN_FIL_B("of.options.shaders.TEX_MIN_FIL_B", "TexMinFilB", "0"), + TEX_MIN_FIL_N("of.options.shaders.TEX_MIN_FIL_N", "TexMinFilN", "0"), + TEX_MIN_FIL_S("of.options.shaders.TEX_MIN_FIL_S", "TexMinFilS", "0"), + TEX_MAG_FIL_B("of.options.shaders.TEX_MAG_FIL_B", "TexMagFilB", "0"), + TEX_MAG_FIL_N("of.options.shaders.TEX_MAG_FIL_N", "TexMagFilN", "0"), + TEX_MAG_FIL_S("of.options.shaders.TEX_MAG_FIL_S", "TexMagFilS", "0"); + private String resourceKey = null; + private String propertyKey = null; + private String valueDefault = null; + + private EnumShaderOption(String resourceKey, String propertyKey, String valueDefault) { + this.resourceKey = resourceKey; + this.propertyKey = propertyKey; + this.valueDefault = valueDefault; + } + + public String getResourceKey() { + return this.resourceKey; + } + + public String getPropertyKey() { + return this.propertyKey; + } + + public String getValueDefault() { + return this.valueDefault; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiButtonEnumShaderOption.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiButtonEnumShaderOption.java new file mode 100644 index 0000000..19d9016 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiButtonEnumShaderOption.java @@ -0,0 +1,135 @@ +package shadersmod.client; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.resources.I18n; + +public class GuiButtonEnumShaderOption extends GuiButton { + private EnumShaderOption enumShaderOption = null; + + public GuiButtonEnumShaderOption(EnumShaderOption enumShaderOption, int x, int y, int widthIn, int heightIn) { + super(enumShaderOption.ordinal(), x, y, widthIn, heightIn, getButtonText(enumShaderOption)); + this.enumShaderOption = enumShaderOption; + } + + public EnumShaderOption getEnumShaderOption() { + return this.enumShaderOption; + } + + private static String getButtonText(EnumShaderOption eso) { + String nameText = I18n.format(eso.getResourceKey(), new Object[0]) + ": "; + + switch (GuiButtonEnumShaderOption.NamelessClass225345066.$SwitchMap$shadersmod$client$EnumShaderOption[eso.ordinal()]) { + case 1: + return nameText + GuiShaders.toStringAa(Shaders.configAntialiasingLevel); + + case 2: + return nameText + GuiShaders.toStringOnOff(Shaders.configNormalMap); + + case 3: + return nameText + GuiShaders.toStringOnOff(Shaders.configSpecularMap); + + case 4: + return nameText + GuiShaders.toStringQuality(Shaders.configRenderResMul); + + case 5: + return nameText + GuiShaders.toStringQuality(Shaders.configShadowResMul); + + case 6: + return nameText + GuiShaders.toStringHandDepth(Shaders.configHandDepthMul); + + case 7: + return nameText + GuiShaders.toStringOnOff(Shaders.configCloudShadow); + + case 8: + return nameText + Shaders.configOldHandLight.getUserValue(); + + case 9: + return nameText + Shaders.configOldLighting.getUserValue(); + + case 10: + return nameText + GuiShaders.toStringOnOff(Shaders.configShadowClipFrustrum); + + case 11: + return nameText + GuiShaders.toStringOnOff(Shaders.configTweakBlockDamage); + + default: + return nameText + Shaders.getEnumShaderOption(eso); + } + } + + public void updateButtonText() { + this.displayString = getButtonText(this.enumShaderOption); + } + + static class NamelessClass225345066 { + static final int[] $SwitchMap$shadersmod$client$EnumShaderOption = new int[EnumShaderOption.values().length]; + + static { + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.ANTIALIASING.ordinal()] = 1; + } catch (NoSuchFieldError var11) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.NORMAL_MAP.ordinal()] = 2; + } catch (NoSuchFieldError var10) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SPECULAR_MAP.ordinal()] = 3; + } catch (NoSuchFieldError var9) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.RENDER_RES_MUL.ordinal()] = 4; + } catch (NoSuchFieldError var8) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SHADOW_RES_MUL.ordinal()] = 5; + } catch (NoSuchFieldError var7) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.HAND_DEPTH_MUL.ordinal()] = 6; + } catch (NoSuchFieldError var6) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.CLOUD_SHADOW.ordinal()] = 7; + } catch (NoSuchFieldError var5) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.OLD_HAND_LIGHT.ordinal()] = 8; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.OLD_LIGHTING.ordinal()] = 9; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SHADOW_CLIP_FRUSTRUM.ordinal()] = 10; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TWEAK_BLOCK_DAMAGE.ordinal()] = 11; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiButtonShaderOption.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiButtonShaderOption.java new file mode 100644 index 0000000..b34c974 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiButtonShaderOption.java @@ -0,0 +1,18 @@ +package shadersmod.client; + +import net.minecraft.client.gui.GuiButton; + +public class GuiButtonShaderOption extends GuiButton { + private ShaderOption shaderOption = null; + + public GuiButtonShaderOption(int buttonId, int x, int y, int widthIn, int heightIn, ShaderOption shaderOption, String text) { + super(buttonId, x, y, widthIn, heightIn, text); + this.shaderOption = shaderOption; + } + + public ShaderOption getShaderOption() { + return this.shaderOption; + } + + public void valueChanged() {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiShaderOptions.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiShaderOptions.java new file mode 100644 index 0000000..c172abc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiShaderOptions.java @@ -0,0 +1,229 @@ +package shadersmod.client; + +import java.util.Iterator; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.GuiScreenOF; +import net.minecraft.src.Lang; +import net.minecraft.src.TooltipManager; +import net.minecraft.src.TooltipProviderShaderOptions; +import net.minecraft.util.MathHelper; + +public class GuiShaderOptions extends GuiScreenOF { + private GuiScreen prevScreen; + protected String title; + private GameSettings settings; + private TooltipManager tooltipManager; + private String screenName; + private String screenText; + private boolean changed; + public static final String OPTION_PROFILE = ""; + public static final String OPTION_EMPTY = ""; + public static final String OPTION_REST = "*"; + + public GuiShaderOptions(GuiScreen guiscreen, GameSettings gamesettings) { + this.tooltipManager = new TooltipManager(this, new TooltipProviderShaderOptions()); + this.screenName = null; + this.screenText = null; + this.changed = false; + this.title = "Shader Options"; + this.prevScreen = guiscreen; + this.settings = gamesettings; + } + + public GuiShaderOptions(GuiScreen guiscreen, GameSettings gamesettings, String screenName) { + this(guiscreen, gamesettings); + this.screenName = screenName; + + if (screenName != null) { + this.screenText = Shaders.translate("screen." + screenName, screenName); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.title = I18n.format("of.options.shaderOptionsTitle", new Object[0]); + byte baseId = 100; + boolean baseX = false; + byte baseY = 30; + byte stepY = 20; + byte btnWidth = 120; + byte btnHeight = 20; + int columns = Shaders.getShaderPackColumns(this.screenName, 2); + ShaderOption[] ops = Shaders.getShaderPackOptions(this.screenName); + + if (ops != null) { + int colsMin = MathHelper.ceiling_double_int((double)ops.length / 9.0D); + + if (columns < colsMin) { + columns = colsMin; + } + + for (int i = 0; i < ops.length; ++i) { + ShaderOption so = ops[i]; + + if (so != null && so.isVisible()) { + int col = i % columns; + int row = i / columns; + int colWidth = Math.min(this.width / columns, 200); + int var21 = (this.width - colWidth * columns) / 2; + int x = col * colWidth + 5 + var21; + int y = baseY + row * stepY; + int w = colWidth - 10; + String text = getButtonText(so, w); + Object btn; + + if (Shaders.isShaderPackOptionSlider(so.getName())) { + btn = new GuiSliderShaderOption(baseId + i, x, y, w, btnHeight, so, text); + } else { + btn = new GuiButtonShaderOption(baseId + i, x, y, w, btnHeight, so, text); + } + + ((GuiButtonShaderOption)btn).enabled = so.isEnabled(); + this.buttonList.add((GuiButton) btn); + } + } + } + + this.buttonList.add(new GuiButton(201, this.width / 2 - btnWidth - 20, this.height / 6 + 168 + 11, btnWidth, btnHeight, I18n.format("controls.reset", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 + 20, this.height / 6 + 168 + 11, btnWidth, btnHeight, I18n.format("gui.done", new Object[0]))); + } + + public static String getButtonText(ShaderOption so, int btnWidth) { + String labelName = so.getNameText(); + + if (so instanceof ShaderOptionScreen) { + ShaderOptionScreen fr1 = (ShaderOptionScreen)so; + return labelName + "..."; + } else { + FontRenderer fr = Config.getMinecraft().fontRenderer; + + for (int lenSuffix = fr.getStringWidth(": " + Lang.getOff()) + 5; fr.getStringWidth(labelName) + lenSuffix >= btnWidth && labelName.length() > 0; labelName = labelName.substring(0, labelName.length() - 1)) { + ; + } + + String col = so.isChanged() ? so.getValueColor(so.getValue()) : ""; + String labelValue = so.getValueText(so.getValue()); + return labelName + ": " + col + labelValue; + } + } + + protected void actionPerformed(GuiButton guibutton) { + if (guibutton.enabled) { + if (guibutton.id < 200 && guibutton instanceof GuiButtonShaderOption) { + GuiButtonShaderOption opts = (GuiButtonShaderOption)guibutton; + ShaderOption i = opts.getShaderOption(); + + if (i instanceof ShaderOptionScreen) { + String var8 = i.getName(); + GuiShaderOptions scr = new GuiShaderOptions(this, this.settings, var8); + this.mc.displayGuiScreen(scr); + return; + } + + if (isShiftKeyDown()) { + i.resetValue(); + } else { + i.nextValue(); + } + + this.updateAllButtons(); + this.changed = true; + } + + if (guibutton.id == 201) { + ShaderOption[] var6 = Shaders.getChangedOptions(Shaders.getShaderPackOptions()); + + for (int var7 = 0; var7 < var6.length; ++var7) { + ShaderOption opt = var6[var7]; + opt.resetValue(); + this.changed = true; + } + + this.updateAllButtons(); + } + + if (guibutton.id == 200) { + if (this.changed) { + Shaders.saveShaderPackOptions(); + this.changed = false; + Shaders.uninit(); + } + + this.mc.displayGuiScreen(this.prevScreen); + } + } + } + + protected void actionPerformedRightClick(GuiButton btn) { + if (btn instanceof GuiButtonShaderOption) { + GuiButtonShaderOption btnSo = (GuiButtonShaderOption)btn; + ShaderOption so = btnSo.getShaderOption(); + + if (isShiftKeyDown()) { + so.resetValue(); + } else { + so.prevValue(); + } + + this.updateAllButtons(); + this.changed = true; + } + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + super.onGuiClosed(); + + if (this.changed) { + Shaders.saveShaderPackOptions(); + this.changed = false; + Shaders.uninit(); + } + } + + private void updateAllButtons() { + Iterator it = this.buttonList.iterator(); + + while (it.hasNext()) { + GuiButton btn = (GuiButton)it.next(); + + if (btn instanceof GuiButtonShaderOption) { + GuiButtonShaderOption gbso = (GuiButtonShaderOption)btn; + ShaderOption opt = gbso.getShaderOption(); + + if (opt instanceof ShaderOptionProfile) { + ShaderOptionProfile optProf = (ShaderOptionProfile)opt; + optProf.updateProfile(); + } + + gbso.displayString = getButtonText(opt, gbso.func_146117_b()); + gbso.valueChanged(); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int x, int y, float f) { + this.drawDefaultBackground(); + + if (this.screenText != null) { + this.drawCenteredString(this.fontRendererObj, this.screenText, this.width / 2, 15, 16777215); + } else { + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 16777215); + } + + super.drawScreen(x, y, f); + this.tooltipManager.drawTooltips(x, y, this.buttonList); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiShaders.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiShaders.java new file mode 100644 index 0000000..7ce0fdb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiShaders.java @@ -0,0 +1,479 @@ +package shadersmod.client; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.Iterator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.src.Config; +import net.minecraft.src.Lang; +import net.minecraft.src.TooltipManager; +import net.minecraft.src.TooltipProviderEnumShaderOptions; +import org.lwjgl.Sys; + +public class GuiShaders extends GuiScreen { + protected GuiScreen parentGui; + protected String screenTitle = "Shaders"; + private TooltipManager tooltipManager = new TooltipManager(this, new TooltipProviderEnumShaderOptions()); + private int updateTimer = -1; + private GuiSlotShaders shaderList; + private boolean saved = false; + private static float[] QUALITY_MULTIPLIERS = new float[] {0.5F, 0.70710677F, 1.0F, 1.4142135F, 2.0F}; + private static String[] QUALITY_MULTIPLIER_NAMES = new String[] {"0.5x", "0.7x", "1x", "1.5x", "2x"}; + private static float[] HAND_DEPTH_VALUES = new float[] {0.0625F, 0.125F, 0.25F}; + private static String[] HAND_DEPTH_NAMES = new String[] {"0.5x", "1x", "2x"}; + public static final int EnumOS_UNKNOWN = 0; + public static final int EnumOS_WINDOWS = 1; + public static final int EnumOS_OSX = 2; + public static final int EnumOS_SOLARIS = 3; + public static final int EnumOS_LINUX = 4; + + public GuiShaders(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { + this.parentGui = par1GuiScreen; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() { + this.screenTitle = I18n.format("of.options.shadersTitle", new Object[0]); + + if (Shaders.shadersConfig == null) { + Shaders.loadConfig(); + } + + byte btnWidth = 120; + byte btnHeight = 20; + int btnX = this.width - btnWidth - 10; + byte baseY = 30; + byte stepY = 20; + int shaderListWidth = this.width - btnWidth - 20; + this.shaderList = new GuiSlotShaders(this, shaderListWidth, this.height, baseY, this.height - 50, 16); + this.shaderList.func_148134_d(7, 8); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.ANTIALIASING, btnX, 0 * stepY + baseY, btnWidth, btnHeight)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.NORMAL_MAP, btnX, 1 * stepY + baseY, btnWidth, btnHeight)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.SPECULAR_MAP, btnX, 2 * stepY + baseY, btnWidth, btnHeight)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.RENDER_RES_MUL, btnX, 3 * stepY + baseY, btnWidth, btnHeight)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.SHADOW_RES_MUL, btnX, 4 * stepY + baseY, btnWidth, btnHeight)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.HAND_DEPTH_MUL, btnX, 5 * stepY + baseY, btnWidth, btnHeight)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.OLD_HAND_LIGHT, btnX, 6 * stepY + baseY, btnWidth, btnHeight)); + this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.OLD_LIGHTING, btnX, 7 * stepY + baseY, btnWidth, btnHeight)); + int btnFolderWidth = Math.min(150, shaderListWidth / 2 - 10); + this.buttonList.add(new GuiButton(201, shaderListWidth / 4 - btnFolderWidth / 2, this.height - 25, btnFolderWidth, btnHeight, Lang.get("of.options.shaders.shadersFolder"))); + this.buttonList.add(new GuiButton(202, shaderListWidth / 4 * 3 - btnFolderWidth / 2, this.height - 25, btnFolderWidth, btnHeight, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(203, btnX, this.height - 25, btnWidth, btnHeight, Lang.get("of.options.shaders.shaderOptions"))); + this.updateButtons(); + } + + public void updateButtons() { + boolean shaderActive = Config.isShaders(); + for (GuiButton button : this.buttonList) { + if (button.id != 201 && button.id != 202 && button.id != EnumShaderOption.ANTIALIASING.ordinal()) { + button.enabled = shaderActive; + } + } + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() { + super.handleMouseInput(); + } + + protected void actionPerformed(GuiButton button) { + if (button.enabled) { + if (button instanceof GuiButtonEnumShaderOption) { + GuiButtonEnumShaderOption var11 = (GuiButtonEnumShaderOption)button; + String[] names; + int index; + float var12; + float[] var14; + + switch (GuiShaders.NamelessClass1764978854.$SwitchMap$shadersmod$client$EnumShaderOption[var11.getEnumShaderOption().ordinal()]) { + case 1: + Shaders.nextAntialiasingLevel(); + Shaders.uninit(); + break; + + case 2: + Shaders.configNormalMap = !Shaders.configNormalMap; + Shaders.uninit(); + this.mc.scheduleResourcesRefresh(); + break; + + case 3: + Shaders.configSpecularMap = !Shaders.configSpecularMap; + Shaders.uninit(); + this.mc.scheduleResourcesRefresh(); + break; + + case 4: + var12 = Shaders.configRenderResMul; + var14 = QUALITY_MULTIPLIERS; + names = QUALITY_MULTIPLIER_NAMES; + index = getValueIndex(var12, var14); + + if (isShiftKeyDown()) { + --index; + + if (index < 0) { + index = var14.length - 1; + } + } else { + ++index; + + if (index >= var14.length) { + index = 0; + } + } + + Shaders.configRenderResMul = var14[index]; + Shaders.uninit(); + Shaders.scheduleResize(); + break; + + case 5: + var12 = Shaders.configShadowResMul; + var14 = QUALITY_MULTIPLIERS; + names = QUALITY_MULTIPLIER_NAMES; + index = getValueIndex(var12, var14); + + if (isShiftKeyDown()) { + --index; + + if (index < 0) { + index = var14.length - 1; + } + } else { + ++index; + + if (index >= var14.length) { + index = 0; + } + } + + Shaders.configShadowResMul = var14[index]; + Shaders.uninit(); + Shaders.scheduleResizeShadow(); + break; + + case 6: + var12 = Shaders.configHandDepthMul; + var14 = HAND_DEPTH_VALUES; + names = HAND_DEPTH_NAMES; + index = getValueIndex(var12, var14); + + if (isShiftKeyDown()) { + --index; + + if (index < 0) { + index = var14.length - 1; + } + } else { + ++index; + + if (index >= var14.length) { + index = 0; + } + } + + Shaders.configHandDepthMul = var14[index]; + Shaders.uninit(); + break; + + case 7: + Shaders.configOldHandLight.nextValue(); + Shaders.uninit(); + break; + + case 8: + Shaders.configOldLighting.nextValue(); + Shaders.updateBlockLightLevel(); + Shaders.uninit(); + this.mc.scheduleResourcesRefresh(); + break; + + case 9: + Shaders.configTweakBlockDamage = !Shaders.configTweakBlockDamage; + break; + + case 10: + Shaders.configCloudShadow = !Shaders.configCloudShadow; + break; + + case 11: + Shaders.configTexMinFilB = (Shaders.configTexMinFilB + 1) % 3; + Shaders.configTexMinFilN = Shaders.configTexMinFilS = Shaders.configTexMinFilB; + button.displayString = "Tex Min: " + Shaders.texMinFilDesc[Shaders.configTexMinFilB]; + ShadersTex.updateTextureMinMagFilter(); + break; + + case 12: + Shaders.configTexMagFilN = (Shaders.configTexMagFilN + 1) % 2; + button.displayString = "Tex_n Mag: " + Shaders.texMagFilDesc[Shaders.configTexMagFilN]; + ShadersTex.updateTextureMinMagFilter(); + break; + + case 13: + Shaders.configTexMagFilS = (Shaders.configTexMagFilS + 1) % 2; + button.displayString = "Tex_s Mag: " + Shaders.texMagFilDesc[Shaders.configTexMagFilS]; + ShadersTex.updateTextureMinMagFilter(); + break; + + case 14: + Shaders.configShadowClipFrustrum = !Shaders.configShadowClipFrustrum; + button.displayString = "ShadowClipFrustrum: " + toStringOnOff(Shaders.configShadowClipFrustrum); + ShadersTex.updateTextureMinMagFilter(); + } + + var11.updateButtonText(); + } else { + switch (button.id) { + case 201: + switch (getOSType()) { + case 1: + String gbeso = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {Shaders.shaderpacksdir.getAbsolutePath()}); + + try { + Runtime.getRuntime().exec(gbeso); + return; + } catch (IOException var8) { + var8.printStackTrace(); + break; + } + + case 2: + try { + Runtime.getRuntime().exec(new String[] {"/usr/bin/open", Shaders.shaderpacksdir.getAbsolutePath()}); + return; + } catch (IOException var9) { + var9.printStackTrace(); + } + } + + boolean var10 = false; + + try { + Class val = Class.forName("java.awt.Desktop"); + Object var13 = val.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + val.getMethod("browse", new Class[] {URI.class}).invoke(var13, new Object[] {(new File(this.mc.mcDataDir, Shaders.shaderpacksdirname)).toURI()}); + } catch (Throwable var7) { + var7.printStackTrace(); + var10 = true; + } + + if (var10) { + Config.dbg("Opening via system class!"); + Sys.openURL("file://" + Shaders.shaderpacksdir.getAbsolutePath()); + } + + break; + + case 202: + new File(Shaders.shadersdir, "current.cfg"); + Shaders.storeConfig(); + this.saved = true; + this.mc.displayGuiScreen(this.parentGui); + break; + + case 203: + GuiShaderOptions values = new GuiShaderOptions(this, Config.getGameSettings()); + Config.getMinecraft().displayGuiScreen(values); + break; + + default: + this.shaderList.func_148147_a(button); + } + } + } + } + + /** + * "Called when the screen is unloaded. Used to disable keyboard repeat events." + */ + public void onGuiClosed() { + super.onGuiClosed(); + + if (!this.saved) { + Shaders.storeConfig(); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + this.shaderList.func_148128_a(mouseX, mouseY, partialTicks); + + if (this.updateTimer <= 0) { + this.shaderList.updateList(); + this.updateTimer += 20; + } + + this.drawCenteredString(this.fontRendererObj, this.screenTitle + " ", this.width / 2, 15, 16777215); + String info = "OpenGL: " + Shaders.glVersionString + ", " + Shaders.glVendorString + ", " + Shaders.glRendererString; + int infoWidth = this.fontRendererObj.getStringWidth(info); + + if (infoWidth < this.width - 5) { + this.drawCenteredString(this.fontRendererObj, info, this.width / 2, this.height - 40, 8421504); + } else { + this.drawString(this.fontRendererObj, info, 5, this.height - 40, 8421504); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + this.tooltipManager.drawTooltips(mouseX, mouseY, this.buttonList); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + super.updateScreen(); + --this.updateTimer; + } + + public Minecraft getMc() { + return this.mc; + } + + public void drawCenteredString(String text, int x, int y, int color) { + this.drawCenteredString(this.fontRendererObj, text, x, y, color); + } + + public static String toStringOnOff(boolean value) { + String on = Lang.getOn(); + String off = Lang.getOff(); + return value ? on : off; + } + + public static String toStringAa(int value) { + return value == 2 ? "FXAA 2x" : (value == 4 ? "FXAA 4x" : Lang.getOff()); + } + + public static String toStringValue(float val, float[] values, String[] names) { + int index = getValueIndex(val, values); + return names[index]; + } + + public static int getValueIndex(float val, float[] values) { + for (int i = 0; i < values.length; ++i) { + float value = values[i]; + + if (value >= val) { + return i; + } + } + + return values.length - 1; + } + + public static String toStringQuality(float val) { + return toStringValue(val, QUALITY_MULTIPLIERS, QUALITY_MULTIPLIER_NAMES); + } + + public static String toStringHandDepth(float val) { + return toStringValue(val, HAND_DEPTH_VALUES, HAND_DEPTH_NAMES); + } + + public static int getOSType() { + String osName = System.getProperty("os.name").toLowerCase(); + return osName.contains("win") ? 1 : (osName.contains("mac") ? 2 : (osName.contains("solaris") ? 3 : (osName.contains("sunos") ? 3 : (osName.contains("linux") ? 4 : (osName.contains("unix") ? 4 : 0))))); + } + + static class NamelessClass1764978854 { + static final int[] $SwitchMap$shadersmod$client$EnumShaderOption = new int[EnumShaderOption.values().length]; + + static { + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.ANTIALIASING.ordinal()] = 1; + } catch (NoSuchFieldError var14) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.NORMAL_MAP.ordinal()] = 2; + } catch (NoSuchFieldError var13) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SPECULAR_MAP.ordinal()] = 3; + } catch (NoSuchFieldError var12) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.RENDER_RES_MUL.ordinal()] = 4; + } catch (NoSuchFieldError var11) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SHADOW_RES_MUL.ordinal()] = 5; + } catch (NoSuchFieldError var10) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.HAND_DEPTH_MUL.ordinal()] = 6; + } catch (NoSuchFieldError var9) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.OLD_HAND_LIGHT.ordinal()] = 7; + } catch (NoSuchFieldError var8) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.OLD_LIGHTING.ordinal()] = 8; + } catch (NoSuchFieldError var7) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TWEAK_BLOCK_DAMAGE.ordinal()] = 9; + } catch (NoSuchFieldError var6) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.CLOUD_SHADOW.ordinal()] = 10; + } catch (NoSuchFieldError var5) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MIN_FIL_B.ordinal()] = 11; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MAG_FIL_N.ordinal()] = 12; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MAG_FIL_S.ordinal()] = 13; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SHADOW_CLIP_FRUSTRUM.ordinal()] = 14; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiSliderShaderOption.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiSliderShaderOption.java new file mode 100644 index 0000000..0300d72 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiSliderShaderOption.java @@ -0,0 +1,70 @@ +package shadersmod.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.src.GlStateManager; +import net.minecraft.util.MathHelper; + +public class GuiSliderShaderOption extends GuiButtonShaderOption { + private float sliderValue = 1.0F; + public boolean dragging; + private ShaderOption shaderOption = null; + + public GuiSliderShaderOption(int buttonId, int x, int y, int w, int h, ShaderOption shaderOption, String text) { + super(buttonId, x, y, w, h, shaderOption, text); + this.shaderOption = shaderOption; + this.sliderValue = shaderOption.getIndexNormalized(); + this.displayString = GuiShaderOptions.getButtonText(shaderOption, this.field_146120_f); + } + + public int getHoverState(boolean mouseOver) { + return 0; + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) { + if (this.field_146125_m) { + if (this.dragging) { + this.sliderValue = (float)(mouseX - (this.field_146128_h + 4)) / (float)(this.field_146120_f - 8); + this.sliderValue = MathHelper.clamp_float(this.sliderValue, 0.0F, 1.0F); + this.shaderOption.setIndexNormalized(this.sliderValue); + this.sliderValue = this.shaderOption.getIndexNormalized(); + this.displayString = GuiShaderOptions.getButtonText(this.shaderOption, this.field_146120_f); + } + + mc.getTextureManager().bindTexture(field_146122_a); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.field_146128_h + (int)(this.sliderValue * (float)(this.field_146120_f - 8)), this.field_146129_i, 0, 66, 4, 20); + this.drawTexturedModalRect(this.field_146128_h + (int)(this.sliderValue * (float)(this.field_146120_f - 8)) + 4, this.field_146129_i, 196, 66, 4, 20); + } + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { + if (super.mousePressed(mc, mouseX, mouseY)) { + this.sliderValue = (float)(mouseX - (this.field_146128_h + 4)) / (float)(this.field_146120_f - 8); + this.sliderValue = MathHelper.clamp_float(this.sliderValue, 0.0F, 1.0F); + this.shaderOption.setIndexNormalized(this.sliderValue); + this.displayString = GuiShaderOptions.getButtonText(this.shaderOption, this.field_146120_f); + this.dragging = true; + return true; + } else { + return false; + } + } + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int mouseX, int mouseY) { + this.dragging = false; + } + + public void valueChanged() { + this.sliderValue = this.shaderOption.getIndexNormalized(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiSlotShaders.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiSlotShaders.java new file mode 100644 index 0000000..f1edfc5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/GuiSlotShaders.java @@ -0,0 +1,86 @@ +package shadersmod.client; + +import java.util.ArrayList; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.src.Lang; + +class GuiSlotShaders extends GuiSlot { + private ArrayList shaderslist; + private int selectedIndex; + private long lastClickedCached = 0L; + final GuiShaders shadersGui; + + public GuiSlotShaders(GuiShaders par1GuiShaders, int width, int height, int top, int bottom, int slotHeight) { + super(par1GuiShaders.getMc(), width, height, top, bottom, slotHeight); + this.shadersGui = par1GuiShaders; + this.updateList(); + int posYSelected = this.selectedIndex * slotHeight; + int wMid = (bottom - top) / 2; + + if (posYSelected > wMid) { + this.func_148145_f(posYSelected - wMid); + } + } + + public int func_148139_c() { + return this.field_148155_a - 20; + } + + public void updateList() { + this.shaderslist = Shaders.listOfShaders(); + this.selectedIndex = 0; + int i = 0; + + for (int n = this.shaderslist.size(); i < n; ++i) { + if (((String)this.shaderslist.get(i)).equals(Shaders.currentshadername)) { + this.selectedIndex = i; + break; + } + } + } + + protected int getSize() { + return this.shaderslist.size(); + } + + protected void elementClicked(int index, boolean doubleClicked, int mouseX, int mouseY) { + if (index != this.selectedIndex || this.lastClickedCached != System.currentTimeMillis()) { + this.selectedIndex = index; + this.lastClickedCached = System.currentTimeMillis(); + Shaders.setShaderPack((String)this.shaderslist.get(index)); + Shaders.uninit(); + this.shadersGui.updateButtons(); + } + } + + protected boolean isSelected(int index) { + return index == this.selectedIndex; + } + + protected int func_148137_d() { + return this.field_148155_a - 6; + } + + protected int func_148138_e() { + return this.getSize() * 18; + } + + protected void drawBackground() {} + + protected void drawSlot(int index, int posX, int posY, int contentY, Tessellator tess, int mouseX, int mouseY) { + String label = (String)this.shaderslist.get(index); + + if (label.equals(Shaders.packNameNone)) { + label = Lang.get("of.options.shaders.packNone"); + } else if (label.equals(Shaders.packNameDefault)) { + label = Lang.get("of.options.shaders.packDefault"); + } + + this.shadersGui.drawCenteredString(label, this.field_148155_a / 2, posY + 1, 14737632); + } + + public int getSelectedIndex() { + return this.selectedIndex; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/HFNoiseTexture.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/HFNoiseTexture.java new file mode 100644 index 0000000..3989e34 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/HFNoiseTexture.java @@ -0,0 +1,69 @@ +package shadersmod.client; + +import java.nio.ByteBuffer; +import net.minecraft.src.GlStateManager; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; + +public class HFNoiseTexture implements ICustomTexture { + private int texID = GL11.glGenTextures(); + private int textureUnit = 15; + + public HFNoiseTexture(int width, int height) { + byte[] image = this.genHFNoiseImage(width, height); + ByteBuffer data = BufferUtils.createByteBuffer(image.length); + data.put(image); + data.flip(); + GlStateManager.bindTexture(this.texID); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, width, height, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, data); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GlStateManager.bindTexture(0); + } + + public int getID() { + return this.texID; + } + + public void deleteTexture() { + GlStateManager.deleteTexture(this.texID); + this.texID = 0; + } + + private int random(int seed) { + seed ^= seed << 13; + seed ^= seed >> 17; + seed ^= seed << 5; + return seed; + } + + private byte random(int x, int y, int z) { + int seed = (this.random(x) + this.random(y * 19)) * this.random(z * 23) - z; + return (byte)(this.random(seed) % 128); + } + + private byte[] genHFNoiseImage(int width, int height) { + byte[] image = new byte[width * height * 3]; + int index = 0; + + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) { + for (int z = 1; z < 4; ++z) { + image[index++] = this.random(x, y, z); + } + } + } + + return image; + } + + public int getTextureId() { + return this.texID; + } + + public int getTextureUnit() { + return this.textureUnit; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ICustomTexture.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ICustomTexture.java new file mode 100644 index 0000000..f58a506 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ICustomTexture.java @@ -0,0 +1,9 @@ +package shadersmod.client; + +public interface ICustomTexture { + int getTextureId(); + + int getTextureUnit(); + + void deleteTexture(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/IShaderPack.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/IShaderPack.java new file mode 100644 index 0000000..553e032 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/IShaderPack.java @@ -0,0 +1,13 @@ +package shadersmod.client; + +import java.io.InputStream; + +public interface IShaderPack { + String getName(); + + InputStream getResourceAsStream(String var1); + + boolean hasDirectory(String var1); + + void close(); +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/MultiTexID.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/MultiTexID.java new file mode 100644 index 0000000..aa511db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/MultiTexID.java @@ -0,0 +1,13 @@ +package shadersmod.client; + +public class MultiTexID { + public int base; + public int norm; + public int spec; + + public MultiTexID(int baseTex, int normTex, int specTex) { + this.base = baseTex; + this.norm = normTex; + this.spec = specTex; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/Property.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/Property.java new file mode 100644 index 0000000..081c916 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/Property.java @@ -0,0 +1,108 @@ +package shadersmod.client; + +import java.util.Properties; +import net.minecraft.src.Config; +import org.apache.commons.lang3.ArrayUtils; + +public class Property { + private int[] values = null; + private int defaultValue = 0; + private String propertyName = null; + private String[] propertyValues = null; + private String userName = null; + private String[] userValues = null; + private int value = 0; + + public Property(String propertyName, String[] propertyValues, String userName, String[] userValues, int defaultValue) { + this.propertyName = propertyName; + this.propertyValues = propertyValues; + this.userName = userName; + this.userValues = userValues; + this.defaultValue = defaultValue; + + if (propertyValues.length != userValues.length) { + throw new IllegalArgumentException("Property and user values have different lengths: " + propertyValues.length + " != " + userValues.length); + } else if (defaultValue >= 0 && defaultValue < propertyValues.length) { + this.value = defaultValue; + } else { + throw new IllegalArgumentException("Invalid default value: " + defaultValue); + } + } + + public boolean setPropertyValue(String propVal) { + if (propVal == null) { + this.value = this.defaultValue; + return false; + } else { + this.value = ArrayUtils.indexOf(this.propertyValues, propVal); + + if (this.value >= 0 && this.value < this.propertyValues.length) { + return true; + } else { + this.value = this.defaultValue; + return false; + } + } + } + + public void nextValue() { + ++this.value; + + if (this.value < 0 || this.value >= this.propertyValues.length) { + this.value = 0; + } + } + + public void setValue(int val) { + this.value = val; + + if (this.value < 0 || this.value >= this.propertyValues.length) { + this.value = this.defaultValue; + } + } + + public int getValue() { + return this.value; + } + + public String getUserValue() { + return this.userValues[this.value]; + } + + public String getPropertyValue() { + return this.propertyValues[this.value]; + } + + public String getUserName() { + return this.userName; + } + + public String getPropertyName() { + return this.propertyName; + } + + public void resetValue() { + this.value = this.defaultValue; + } + + public boolean loadFrom(Properties props) { + this.resetValue(); + + if (props == null) { + return false; + } else { + String str = props.getProperty(this.propertyName); + return str == null ? false : this.setPropertyValue(str); + } + } + + public void saveTo(Properties props) { + if (props != null) { + props.setProperty(this.getPropertyName(), this.getPropertyValue()); + } + } + + public String toString() { + return "" + this.propertyName + "=" + this.getPropertyValue() + " [" + Config.arrayToString((Object[])this.propertyValues) + "], value: " + this.value; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/PropertyDefaultFastFancyOff.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/PropertyDefaultFastFancyOff.java new file mode 100644 index 0000000..a57abfa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/PropertyDefaultFastFancyOff.java @@ -0,0 +1,36 @@ +package shadersmod.client; + +import net.minecraft.src.Config; + +public class PropertyDefaultFastFancyOff extends Property { + public static final String[] PROPERTY_VALUES = new String[] {"default", "fast", "fancy", "off"}; + public static final String[] USER_VALUES = new String[] {"Default", "Fast", "Fancy", "OFF"}; + + public PropertyDefaultFastFancyOff(String propertyName, String userName, int defaultValue) { + super(propertyName, PROPERTY_VALUES, userName, USER_VALUES, defaultValue); + } + + public boolean isDefault() { + return this.getValue() == 0; + } + + public boolean isFast() { + return this.getValue() == 1; + } + + public boolean isFancy() { + return this.getValue() == 2; + } + + public boolean isOff() { + return this.getValue() == 3; + } + + public boolean setPropertyValue(String propVal) { + if (Config.equals(propVal, "none")) { + propVal = "off"; + } + + return super.setPropertyValue(propVal); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/PropertyDefaultTrueFalse.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/PropertyDefaultTrueFalse.java new file mode 100644 index 0000000..b805044 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/PropertyDefaultTrueFalse.java @@ -0,0 +1,28 @@ +package shadersmod.client; + +import net.minecraft.src.Lang; + +public class PropertyDefaultTrueFalse extends Property { + public static final String[] PROPERTY_VALUES = new String[] {"default", "true", "false"}; + public static final String[] USER_VALUES = new String[] {"Default", "ON", "OFF"}; + + public PropertyDefaultTrueFalse(String propertyName, String userName, int defaultValue) { + super(propertyName, PROPERTY_VALUES, userName, USER_VALUES, defaultValue); + } + + public String getUserValue() { + return this.isDefault() ? Lang.getDefault() : (this.isTrue() ? Lang.getOn() : (this.isFalse() ? Lang.getOff() : super.getUserValue())); + } + + public boolean isDefault() { + return this.getValue() == 0; + } + + public boolean isTrue() { + return this.getValue() == 1; + } + + public boolean isFalse() { + return this.getValue() == 2; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/SMath.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/SMath.java new file mode 100644 index 0000000..10d6b60 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/SMath.java @@ -0,0 +1,55 @@ +package shadersmod.client; + +import java.nio.FloatBuffer; +import java.util.Arrays; + +public class SMath { + static void multiplyMat4xMat4(float[] matOut, float[] matA, float[] matB) { + for (int co = 0; co < 4; ++co) { + for (int ro = 0; ro < 4; ++ro) { + matOut[4 * co + ro] = matA[4 * co + 0] * matB[0 + ro] + matA[4 * co + 1] * matB[4 + ro] + matA[4 * co + 2] * matB[8 + ro] + matA[4 * co + 3] * matB[12 + ro]; + } + } + } + + static void multiplyMat4xVec4(float[] vecOut, float[] matA, float[] vecB) { + vecOut[0] = matA[0] * vecB[0] + matA[4] * vecB[1] + matA[8] * vecB[2] + matA[12] * vecB[3]; + vecOut[1] = matA[1] * vecB[0] + matA[5] * vecB[1] + matA[9] * vecB[2] + matA[13] * vecB[3]; + vecOut[2] = matA[2] * vecB[0] + matA[6] * vecB[1] + matA[10] * vecB[2] + matA[14] * vecB[3]; + vecOut[3] = matA[3] * vecB[0] + matA[7] * vecB[1] + matA[11] * vecB[2] + matA[15] * vecB[3]; + } + + static void invertMat4(float[] matOut, float[] m) { + matOut[0] = m[5] * m[10] * m[15] - m[5] * m[11] * m[14] - m[9] * m[6] * m[15] + m[9] * m[7] * m[14] + m[13] * m[6] * m[11] - m[13] * m[7] * m[10]; + matOut[1] = -m[1] * m[10] * m[15] + m[1] * m[11] * m[14] + m[9] * m[2] * m[15] - m[9] * m[3] * m[14] - m[13] * m[2] * m[11] + m[13] * m[3] * m[10]; + matOut[2] = m[1] * m[6] * m[15] - m[1] * m[7] * m[14] - m[5] * m[2] * m[15] + m[5] * m[3] * m[14] + m[13] * m[2] * m[7] - m[13] * m[3] * m[6]; + matOut[3] = -m[1] * m[6] * m[11] + m[1] * m[7] * m[10] + m[5] * m[2] * m[11] - m[5] * m[3] * m[10] - m[9] * m[2] * m[7] + m[9] * m[3] * m[6]; + matOut[4] = -m[4] * m[10] * m[15] + m[4] * m[11] * m[14] + m[8] * m[6] * m[15] - m[8] * m[7] * m[14] - m[12] * m[6] * m[11] + m[12] * m[7] * m[10]; + matOut[5] = m[0] * m[10] * m[15] - m[0] * m[11] * m[14] - m[8] * m[2] * m[15] + m[8] * m[3] * m[14] + m[12] * m[2] * m[11] - m[12] * m[3] * m[10]; + matOut[6] = -m[0] * m[6] * m[15] + m[0] * m[7] * m[14] + m[4] * m[2] * m[15] - m[4] * m[3] * m[14] - m[12] * m[2] * m[7] + m[12] * m[3] * m[6]; + matOut[7] = m[0] * m[6] * m[11] - m[0] * m[7] * m[10] - m[4] * m[2] * m[11] + m[4] * m[3] * m[10] + m[8] * m[2] * m[7] - m[8] * m[3] * m[6]; + matOut[8] = m[4] * m[9] * m[15] - m[4] * m[11] * m[13] - m[8] * m[5] * m[15] + m[8] * m[7] * m[13] + m[12] * m[5] * m[11] - m[12] * m[7] * m[9]; + matOut[9] = -m[0] * m[9] * m[15] + m[0] * m[11] * m[13] + m[8] * m[1] * m[15] - m[8] * m[3] * m[13] - m[12] * m[1] * m[11] + m[12] * m[3] * m[9]; + matOut[10] = m[0] * m[5] * m[15] - m[0] * m[7] * m[13] - m[4] * m[1] * m[15] + m[4] * m[3] * m[13] + m[12] * m[1] * m[7] - m[12] * m[3] * m[5]; + matOut[11] = -m[0] * m[5] * m[11] + m[0] * m[7] * m[9] + m[4] * m[1] * m[11] - m[4] * m[3] * m[9] - m[8] * m[1] * m[7] + m[8] * m[3] * m[5]; + matOut[12] = -m[4] * m[9] * m[14] + m[4] * m[10] * m[13] + m[8] * m[5] * m[14] - m[8] * m[6] * m[13] - m[12] * m[5] * m[10] + m[12] * m[6] * m[9]; + matOut[13] = m[0] * m[9] * m[14] - m[0] * m[10] * m[13] - m[8] * m[1] * m[14] + m[8] * m[2] * m[13] + m[12] * m[1] * m[10] - m[12] * m[2] * m[9]; + matOut[14] = -m[0] * m[5] * m[14] + m[0] * m[6] * m[13] + m[4] * m[1] * m[14] - m[4] * m[2] * m[13] - m[12] * m[1] * m[6] + m[12] * m[2] * m[5]; + matOut[15] = m[0] * m[5] * m[10] - m[0] * m[6] * m[9] - m[4] * m[1] * m[10] + m[4] * m[2] * m[9] + m[8] * m[1] * m[6] - m[8] * m[2] * m[5]; + float det = m[0] * matOut[0] + m[1] * matOut[4] + m[2] * matOut[8] + m[3] * matOut[12]; + + if ((double)det != 0.0D) { + for (int i = 0; i < 16; ++i) { + matOut[i] /= det; + } + } else { + Arrays.fill(matOut, 0.0F); + } + } + + static void invertMat4FBFA(FloatBuffer fbInvOut, FloatBuffer fbMatIn, float[] faInv, float[] faMat) { + fbMatIn.get(faMat); + invertMat4(faInv, faMat); + fbInvOut.put(faInv); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ScreenShaderOptions.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ScreenShaderOptions.java new file mode 100644 index 0000000..435b11c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ScreenShaderOptions.java @@ -0,0 +1,25 @@ +package shadersmod.client; + +public class ScreenShaderOptions { + private String name; + private ShaderOption[] shaderOptions; + private int columns; + + public ScreenShaderOptions(String name, ShaderOption[] shaderOptions, int columns) { + this.name = name; + this.shaderOptions = shaderOptions; + this.columns = columns; + } + + public String getName() { + return this.name; + } + + public ShaderOption[] getShaderOptions() { + return this.shaderOptions; + } + + public int getColumns() { + return this.columns; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderLine.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderLine.java new file mode 100644 index 0000000..f15f976 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderLine.java @@ -0,0 +1,143 @@ +package shadersmod.client; + +public class ShaderLine { + private int type; + private String name; + private String value; + private String line; + public static final int TYPE_UNIFORM = 1; + public static final int TYPE_ATTRIBUTE = 2; + public static final int TYPE_CONST_INT = 3; + public static final int TYPE_CONST_FLOAT = 4; + public static final int TYPE_CONST_BOOL = 5; + public static final int TYPE_PROPERTY = 6; + + public ShaderLine(int type, String name, String value, String line) { + this.type = type; + this.name = name; + this.value = value; + this.line = line; + } + + public int getType() { + return this.type; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + public boolean isUniform() { + return this.type == 1; + } + + public boolean isUniform(String name) { + return this.isUniform() && name.equals(this.name); + } + + public boolean isAttribute() { + return this.type == 2; + } + + public boolean isAttribute(String name) { + return this.isAttribute() && name.equals(this.name); + } + + public boolean isProperty() { + return this.type == 6; + } + + public boolean isConstInt() { + return this.type == 3; + } + + public boolean isConstFloat() { + return this.type == 4; + } + + public boolean isConstBool() { + return this.type == 5; + } + + public boolean isProperty(String name) { + return this.isProperty() && name.equals(this.name); + } + + public boolean isProperty(String name, String value) { + return this.isProperty(name) && value.equals(this.value); + } + + public boolean isConstInt(String name) { + return this.isConstInt() && name.equals(this.name); + } + + public boolean isConstIntSuffix(String suffix) { + return this.isConstInt() && this.name.endsWith(suffix); + } + + public boolean isConstFloat(String name) { + return this.isConstFloat() && name.equals(this.name); + } + + public boolean isConstBool(String name) { + return this.isConstBool() && name.equals(this.name); + } + + public boolean isConstBoolSuffix(String suffix) { + return this.isConstBool() && this.name.endsWith(suffix); + } + + public boolean isConstBoolSuffix(String suffix, boolean val) { + return this.isConstBoolSuffix(suffix) && this.getValueBool() == val; + } + + public boolean isConstBool(String name1, String name2) { + return this.isConstBool(name1) || this.isConstBool(name2); + } + + public boolean isConstBool(String name1, String name2, String name3) { + return this.isConstBool(name1) || this.isConstBool(name2) || this.isConstBool(name3); + } + + public boolean isConstBool(String name, boolean val) { + return this.isConstBool(name) && this.getValueBool() == val; + } + + public boolean isConstBool(String name1, String name2, boolean val) { + return this.isConstBool(name1, name2) && this.getValueBool() == val; + } + + public boolean isConstBool(String name1, String name2, String name3, boolean val) { + return this.isConstBool(name1, name2, name3) && this.getValueBool() == val; + } + + public int getValueInt() { + try { + return Integer.parseInt(this.value); + } catch (NumberFormatException var2) { + throw new NumberFormatException("Invalid integer: " + this.value + ", line: " + this.line); + } + } + + public float getValueFloat() { + try { + return Float.parseFloat(this.value); + } catch (NumberFormatException var2) { + throw new NumberFormatException("Invalid float: " + this.value + ", line: " + this.line); + } + } + + public boolean getValueBool() { + String valLow = this.value.toLowerCase(); + + if (!valLow.equals("true") && !valLow.equals("false")) { + throw new RuntimeException("Invalid boolean: " + this.value + ", line: " + this.line); + } else { + return Boolean.valueOf(this.value).booleanValue(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderMacros.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderMacros.java new file mode 100644 index 0000000..bce5e06 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderMacros.java @@ -0,0 +1,178 @@ +package shadersmod.client; + +import net.minecraft.src.Config; +import net.minecraft.util.Util; +import net.minecraft.util.Util.EnumOS; + +public class ShaderMacros { + private static String PREFIX_MACRO = "MC_"; + public static final String MC_VERSION = "MC_VERSION"; + public static final String MC_GL_VERSION = "MC_GL_VERSION"; + public static final String MC_GLSL_VERSION = "MC_GLSL_VERSION"; + public static final String MC_OS_WINDOWS = "MC_OS_WINDOWS"; + public static final String MC_OS_MAC = "MC_OS_MAC"; + public static final String MC_OS_LINUX = "MC_OS_LINUX"; + public static final String MC_OS_OTHER = "MC_OS_OTHER"; + public static final String MC_GL_VENDOR_ATI = "MC_GL_VENDOR_ATI"; + public static final String MC_GL_VENDOR_INTEL = "MC_GL_VENDOR_INTEL"; + public static final String MC_GL_VENDOR_NVIDIA = "MC_GL_VENDOR_NVIDIA"; + public static final String MC_GL_VENDOR_XORG = "MC_GL_VENDOR_XORG"; + public static final String MC_GL_VENDOR_OTHER = "MC_GL_VENDOR_OTHER"; + public static final String MC_GL_RENDERER_RADEON = "MC_GL_RENDERER_RADEON"; + public static final String MC_GL_RENDERER_GEFORCE = "MC_GL_RENDERER_GEFORCE"; + public static final String MC_GL_RENDERER_QUADRO = "MC_GL_RENDERER_QUADRO"; + public static final String MC_GL_RENDERER_INTEL = "MC_GL_RENDERER_INTEL"; + public static final String MC_GL_RENDERER_GALLIUM = "MC_GL_RENDERER_GALLIUM"; + public static final String MC_GL_RENDERER_MESA = "MC_GL_RENDERER_MESA"; + public static final String MC_GL_RENDERER_OTHER = "MC_GL_RENDERER_OTHER"; + public static final String MC_FXAA_LEVEL = "MC_FXAA_LEVEL"; + public static final String MC_NORMAL_MAP = "MC_NORMAL_MAP"; + public static final String MC_SPECULAR_MAP = "MC_SPECULAR_MAP"; + public static final String MC_RENDER_QUALITY = "MC_RENDER_QUALITY"; + public static final String MC_SHADOW_QUALITY = "MC_SHADOW_QUALITY"; + public static final String MC_HAND_DEPTH = "MC_HAND_DEPTH"; + public static final String MC_OLD_HAND_LIGHT = "MC_OLD_HAND_LIGHT"; + public static final String MC_OLD_LIGHTING = "MC_OLD_LIGHTING"; + private static String[] extensionMacros; + + public static String getOs() { + EnumOS os = Util.getOSType(); + + switch (ShaderMacros.NamelessClass846372605.$SwitchMap$net$minecraft$util$Util$EnumOS[os.ordinal()]) { + case 1: + return "MC_OS_WINDOWS"; + + case 2: + return "MC_OS_MAC"; + + case 3: + return "MC_OS_LINUX"; + + default: + return "MC_OS_OTHER"; + } + } + + public static String getVendor() { + String vendor = Config.openGlVendor; + + if (vendor == null) { + return "MC_GL_VENDOR_OTHER"; + } else { + vendor = vendor.toLowerCase(); + return vendor.startsWith("ati") ? "MC_GL_VENDOR_ATI" : (vendor.startsWith("intel") ? "MC_GL_VENDOR_INTEL" : (vendor.startsWith("nvidia") ? "MC_GL_VENDOR_NVIDIA" : (vendor.startsWith("x.org") ? "MC_GL_VENDOR_XORG" : "MC_GL_VENDOR_OTHER"))); + } + } + + public static String getRenderer() { + String renderer = Config.openGlRenderer; + + if (renderer == null) { + return "MC_GL_RENDERER_OTHER"; + } else { + renderer = renderer.toLowerCase(); + return renderer.startsWith("amd") ? "MC_GL_RENDERER_RADEON" : (renderer.startsWith("ati") ? "MC_GL_RENDERER_RADEON" : (renderer.startsWith("radeon") ? "MC_GL_RENDERER_RADEON" : (renderer.startsWith("gallium") ? "MC_GL_RENDERER_GALLIUM" : (renderer.startsWith("intel") ? "MC_GL_RENDERER_INTEL" : (renderer.startsWith("geforce") ? "MC_GL_RENDERER_GEFORCE" : (renderer.startsWith("nvidia") ? "MC_GL_RENDERER_GEFORCE" : (renderer.startsWith("quadro") ? "MC_GL_RENDERER_QUADRO" : (renderer.startsWith("nvs") ? "MC_GL_RENDERER_QUADRO" : (renderer.startsWith("mesa") ? "MC_GL_RENDERER_MESA" : "MC_GL_RENDERER_OTHER"))))))))); + } + } + + public static String getPrefixMacro() { + return PREFIX_MACRO; + } + + public static String[] getExtensions() { + if (extensionMacros == null) { + String[] exts = Config.getOpenGlExtensions(); + String[] extMacros = new String[exts.length]; + + for (int i = 0; i < exts.length; ++i) { + extMacros[i] = PREFIX_MACRO + exts[i]; + } + + extensionMacros = extMacros; + } + + return extensionMacros; + } + + public static String getMacroLines() { + StringBuilder sb = new StringBuilder(); + addMacroLine(sb, "MC_VERSION", Config.getMinecraftVersionInt()); + addMacroLine(sb, "MC_GL_VERSION " + Config.getGlVersion().toInt()); + addMacroLine(sb, "MC_GLSL_VERSION " + Config.getGlslVersion().toInt()); + addMacroLine(sb, getOs()); + addMacroLine(sb, getVendor()); + addMacroLine(sb, getRenderer()); + + if (Shaders.configAntialiasingLevel > 0) { + addMacroLine(sb, "MC_FXAA_LEVEL", Shaders.configAntialiasingLevel); + } + + if (Shaders.configNormalMap) { + addMacroLine(sb, "MC_NORMAL_MAP"); + } + + if (Shaders.configSpecularMap) { + addMacroLine(sb, "MC_SPECULAR_MAP"); + } + + addMacroLine(sb, "MC_RENDER_QUALITY", Shaders.configRenderResMul); + addMacroLine(sb, "MC_SHADOW_QUALITY", Shaders.configShadowResMul); + addMacroLine(sb, "MC_HAND_DEPTH", Shaders.configHandDepthMul); + + if (Shaders.isOldHandLight()) { + addMacroLine(sb, "MC_OLD_HAND_LIGHT"); + } + + if (Shaders.isOldLighting()) { + addMacroLine(sb, "MC_OLD_LIGHTING"); + } + + return sb.toString(); + } + + private static void addMacroLine(StringBuilder sb, String name, int value) { + sb.append("#define "); + sb.append(name); + sb.append(" "); + sb.append(value); + sb.append("\n"); + } + + private static void addMacroLine(StringBuilder sb, String name, float value) { + sb.append("#define "); + sb.append(name); + sb.append(" "); + sb.append(value); + sb.append("\n"); + } + + private static void addMacroLine(StringBuilder sb, String name) { + sb.append("#define "); + sb.append(name); + sb.append("\n"); + } + + static class NamelessClass846372605 { + static final int[] $SwitchMap$net$minecraft$util$Util$EnumOS = new int[EnumOS.values().length]; + + static { + try { + $SwitchMap$net$minecraft$util$Util$EnumOS[EnumOS.WINDOWS.ordinal()] = 1; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$net$minecraft$util$Util$EnumOS[EnumOS.OSX.ordinal()] = 2; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$net$minecraft$util$Util$EnumOS[EnumOS.LINUX.ordinal()] = 3; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOption.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOption.java new file mode 100644 index 0000000..4674c8d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOption.java @@ -0,0 +1,203 @@ +package shadersmod.client; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.src.Config; +import net.minecraft.src.StrUtils; + +public abstract class ShaderOption { + private String name = null; + private String description = null; + private String value = null; + private String[] values = null; + private String valueDefault = null; + private String[] paths = null; + private boolean enabled = true; + private boolean visible = true; + public static final String COLOR_GREEN = "\u00a7a"; + public static final String COLOR_RED = "\u00a7c"; + public static final String COLOR_BLUE = "\u00a79"; + + public ShaderOption(String name, String description, String value, String[] values, String valueDefault, String path) { + this.name = name; + this.description = description; + this.value = value; + this.values = values; + this.valueDefault = valueDefault; + + if (path != null) { + this.paths = new String[] {path}; + } + } + + public String getName() { + return this.name; + } + + public String getDescription() { + return this.description; + } + + public String getDescriptionText() { + String desc = Config.normalize(this.description); + desc = StrUtils.removePrefix(desc, "//"); + desc = Shaders.translate("option." + this.getName() + ".comment", desc); + return desc; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getValue() { + return this.value; + } + + public boolean setValue(String value) { + int index = getIndex(value, this.values); + + if (index < 0) { + return false; + } else { + this.value = value; + return true; + } + } + + public String getValueDefault() { + return this.valueDefault; + } + + public void resetValue() { + this.value = this.valueDefault; + } + + public void nextValue() { + int index = getIndex(this.value, this.values); + + if (index >= 0) { + index = (index + 1) % this.values.length; + this.value = this.values[index]; + } + } + + public void prevValue() { + int index = getIndex(this.value, this.values); + + if (index >= 0) { + index = (index - 1 + this.values.length) % this.values.length; + this.value = this.values[index]; + } + } + + private static int getIndex(String str, String[] strs) { + for (int i = 0; i < strs.length; ++i) { + String s = strs[i]; + + if (s.equals(str)) { + return i; + } + } + + return -1; + } + + public String[] getPaths() { + return this.paths; + } + + public void addPaths(String[] newPaths) { + List pathList = Arrays.asList(this.paths); + + for (int i = 0; i < newPaths.length; ++i) { + String newPath = newPaths[i]; + + if (!pathList.contains(newPath)) { + this.paths = (String[])((String[])Config.addObjectToArray(this.paths, newPath)); + } + } + } + + public boolean isEnabled() { + return this.enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public boolean isChanged() { + return !Config.equals(this.value, this.valueDefault); + } + + public boolean isVisible() { + return this.visible; + } + + public void setVisible(boolean visible) { + this.visible = visible; + } + + public boolean isValidValue(String val) { + return getIndex(val, this.values) >= 0; + } + + public String getNameText() { + return Shaders.translate("option." + this.name, this.name); + } + + public String getValueText(String val) { + return Shaders.translate("value." + this.name + "." + val, val); + } + + public String getValueColor(String val) { + return ""; + } + + public boolean matchesLine(String line) { + return false; + } + + public boolean checkUsed() { + return false; + } + + public boolean isUsedInLine(String line) { + return false; + } + + public String getSourceLine() { + return null; + } + + public String[] getValues() { + return (String[])this.values.clone(); + } + + public float getIndexNormalized() { + if (this.values.length <= 1) { + return 0.0F; + } else { + int index = getIndex(this.value, this.values); + + if (index < 0) { + return 0.0F; + } else { + float f = 1.0F * (float)index / ((float)this.values.length - 1.0F); + return f; + } + } + } + + public void setIndexNormalized(float f) { + if (this.values.length > 1) { + f = Config.limit(f, 0.0F, 1.0F); + int index = Math.round(f * (float)(this.values.length - 1)); + this.value = this.values[index]; + } + } + + public String toString() { + return "" + this.name + ", value: " + this.value + ", valueDefault: " + this.valueDefault + ", paths: " + Config.arrayToString((Object[])this.paths); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionProfile.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionProfile.java new file mode 100644 index 0000000..5dc83e5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionProfile.java @@ -0,0 +1,112 @@ +package shadersmod.client; + +import java.util.ArrayList; +import net.minecraft.src.Lang; + +public class ShaderOptionProfile extends ShaderOption { + private ShaderProfile[] profiles = null; + private ShaderOption[] options = null; + private static final String NAME_PROFILE = ""; + private static final String VALUE_CUSTOM = ""; + + public ShaderOptionProfile(ShaderProfile[] profiles, ShaderOption[] options) { + super("", "", detectProfileName(profiles, options), getProfileNames(profiles), detectProfileName(profiles, options, true), (String)null); + this.profiles = profiles; + this.options = options; + } + + public void nextValue() { + super.nextValue(); + + if (this.getValue().equals("")) { + super.nextValue(); + } + + this.applyProfileOptions(); + } + + public void updateProfile() { + ShaderProfile prof = this.getProfile(this.getValue()); + + if (prof == null || !ShaderUtils.matchProfile(prof, this.options, false)) { + String val = detectProfileName(this.profiles, this.options); + this.setValue(val); + } + } + + private void applyProfileOptions() { + ShaderProfile prof = this.getProfile(this.getValue()); + + if (prof != null) { + String[] opts = prof.getOptions(); + + for (int i = 0; i < opts.length; ++i) { + String name = opts[i]; + ShaderOption so = this.getOption(name); + + if (so != null) { + String val = prof.getValue(name); + so.setValue(val); + } + } + } + } + + private ShaderOption getOption(String name) { + for (int i = 0; i < this.options.length; ++i) { + ShaderOption so = this.options[i]; + + if (so.getName().equals(name)) { + return so; + } + } + + return null; + } + + private ShaderProfile getProfile(String name) { + for (int i = 0; i < this.profiles.length; ++i) { + ShaderProfile prof = this.profiles[i]; + + if (prof.getName().equals(name)) { + return prof; + } + } + + return null; + } + + public String getNameText() { + return Lang.get("of.shaders.profile"); + } + + public String getValueText(String val) { + return val.equals("") ? Lang.get("of.general.custom", "") : Shaders.translate("profile." + val, val); + } + + public String getValueColor(String val) { + return val.equals("") ? "\u00a7c" : "\u00a7a"; + } + + private static String detectProfileName(ShaderProfile[] profs, ShaderOption[] opts) { + return detectProfileName(profs, opts, false); + } + + private static String detectProfileName(ShaderProfile[] profs, ShaderOption[] opts, boolean def) { + ShaderProfile prof = ShaderUtils.detectProfile(profs, opts, def); + return prof == null ? "" : prof.getName(); + } + + private static String[] getProfileNames(ShaderProfile[] profs) { + ArrayList list = new ArrayList(); + + for (int names = 0; names < profs.length; ++names) { + ShaderProfile prof = profs[names]; + list.add(prof.getName()); + } + + list.add(""); + String[] var4 = (String[])((String[])list.toArray(new String[list.size()])); + return var4; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionRest.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionRest.java new file mode 100644 index 0000000..ac8facb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionRest.java @@ -0,0 +1,7 @@ +package shadersmod.client; + +public class ShaderOptionRest extends ShaderOption { + public ShaderOptionRest(String name) { + super(name, name, (String)null, new String[] {null}, (String)null, (String)null); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionScreen.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionScreen.java new file mode 100644 index 0000000..9e186eb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionScreen.java @@ -0,0 +1,15 @@ +package shadersmod.client; + +public class ShaderOptionScreen extends ShaderOption { + public ShaderOptionScreen(String name) { + super(name, (String)null, (String)null, new String[0], (String)null, (String)null); + } + + public String getNameText() { + return Shaders.translate("screen." + this.getName(), this.getName()); + } + + public String getDescriptionText() { + return Shaders.translate("screen." + this.getName() + ".comment", (String)null); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionSwitch.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionSwitch.java new file mode 100644 index 0000000..48ff98e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionSwitch.java @@ -0,0 +1,84 @@ +package shadersmod.client; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.Config; +import net.minecraft.src.Lang; +import net.minecraft.src.StrUtils; + +public class ShaderOptionSwitch extends ShaderOption { + private static final Pattern PATTERN_DEFINE = Pattern.compile("^\\s*(//)?\\s*#define\\s+([A-Za-z0-9_]+)\\s*(//.*)?$"); + private static final Pattern PATTERN_IFDEF = Pattern.compile("^\\s*#if(n)?def\\s+([A-Za-z0-9_]+)(\\s*)?$"); + + public ShaderOptionSwitch(String name, String description, String value, String path) { + super(name, description, value, new String[] {"false", "true"}, value, path); + } + + public String getSourceLine() { + return isTrue(this.getValue()) ? "#define " + this.getName() + " // Shader option ON" : "//#define " + this.getName() + " // Shader option OFF"; + } + + public String getValueText(String val) { + String valTextRes = super.getValueText(val); + return valTextRes != val ? valTextRes : (isTrue(val) ? Lang.getOn() : Lang.getOff()); + } + + public String getValueColor(String val) { + return isTrue(val) ? "\u00a7a" : "\u00a7c"; + } + + public static ShaderOption parseOption(String line, String path) { + Matcher m = PATTERN_DEFINE.matcher(line); + + if (!m.matches()) { + return null; + } else { + String comment = m.group(1); + String name = m.group(2); + String description = m.group(3); + + if (name != null && name.length() > 0) { + boolean commented = Config.equals(comment, "//"); + boolean enabled = !commented; + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOptionSwitch so = new ShaderOptionSwitch(name, description, String.valueOf(enabled), path); + return so; + } else { + return null; + } + } + } + + public boolean matchesLine(String line) { + Matcher m = PATTERN_DEFINE.matcher(line); + + if (!m.matches()) { + return false; + } else { + String defName = m.group(2); + return defName.matches(this.getName()); + } + } + + public boolean checkUsed() { + return true; + } + + public boolean isUsedInLine(String line) { + Matcher mif = PATTERN_IFDEF.matcher(line); + + if (mif.matches()) { + String name = mif.group(2); + + if (name.equals(this.getName())) { + return true; + } + } + + return false; + } + + public static boolean isTrue(String val) { + return Boolean.valueOf(val).booleanValue(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionSwitchConst.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionSwitchConst.java new file mode 100644 index 0000000..b5c91a0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionSwitchConst.java @@ -0,0 +1,53 @@ +package shadersmod.client; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.StrUtils; + +public class ShaderOptionSwitchConst extends ShaderOptionSwitch { + private static final Pattern PATTERN_CONST = Pattern.compile("^\\s*const\\s*bool\\s*([A-Za-z0-9_]+)\\s*=\\s*(true|false)\\s*;\\s*(//.*)?$"); + + public ShaderOptionSwitchConst(String name, String description, String value, String path) { + super(name, description, value, path); + } + + public String getSourceLine() { + return "const bool " + this.getName() + " = " + this.getValue() + "; // Shader option " + this.getValue(); + } + + public static ShaderOption parseOption(String line, String path) { + Matcher m = PATTERN_CONST.matcher(line); + + if (!m.matches()) { + return null; + } else { + String name = m.group(1); + String value = m.group(2); + String description = m.group(3); + + if (name != null && name.length() > 0) { + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOptionSwitchConst so = new ShaderOptionSwitchConst(name, description, value, path); + so.setVisible(false); + return so; + } else { + return null; + } + } + } + + public boolean matchesLine(String line) { + Matcher m = PATTERN_CONST.matcher(line); + + if (!m.matches()) { + return false; + } else { + String defName = m.group(1); + return defName.matches(this.getName()); + } + } + + public boolean checkUsed() { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionVariable.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionVariable.java new file mode 100644 index 0000000..e9d0623 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionVariable.java @@ -0,0 +1,100 @@ +package shadersmod.client; + +import java.util.Arrays; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.Config; +import net.minecraft.src.StrUtils; + +public class ShaderOptionVariable extends ShaderOption { + private static final Pattern PATTERN_VARIABLE = Pattern.compile("^\\s*#define\\s+(\\w+)\\s+(-?[0-9\\.Ff]+|\\w+)\\s*(//.*)?$"); + + public ShaderOptionVariable(String name, String description, String value, String[] values, String path) { + super(name, description, value, values, value, path); + this.setVisible(this.getValues().length > 1); + } + + public String getSourceLine() { + return "#define " + this.getName() + " " + this.getValue() + " // Shader option " + this.getValue(); + } + + public String getValueText(String val) { + String prefix = Shaders.translate("prefix." + this.getName(), ""); + String text = super.getValueText(val); + String suffix = Shaders.translate("suffix." + this.getName(), ""); + String textFull = prefix + text + suffix; + return textFull; + } + + public String getValueColor(String val) { + String valLow = val.toLowerCase(); + return !valLow.equals("false") && !valLow.equals("off") ? "\u00a7a" : "\u00a7c"; + } + + public boolean matchesLine(String line) { + Matcher m = PATTERN_VARIABLE.matcher(line); + + if (!m.matches()) { + return false; + } else { + String defName = m.group(1); + return defName.matches(this.getName()); + } + } + + public static ShaderOption parseOption(String line, String path) { + Matcher m = PATTERN_VARIABLE.matcher(line); + + if (!m.matches()) { + return null; + } else { + String name = m.group(1); + String value = m.group(2); + String description = m.group(3); + String vals = StrUtils.getSegment(description, "[", "]"); + + if (vals != null && vals.length() > 0) { + description = description.replace(vals, "").trim(); + } + + String[] values = parseValues(value, vals); + + if (name != null && name.length() > 0) { + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOptionVariable so = new ShaderOptionVariable(name, description, value, values, path); + return so; + } else { + return null; + } + } + } + + public static String[] parseValues(String value, String valuesStr) { + String[] values = new String[] {value}; + + if (valuesStr == null) { + return values; + } else { + valuesStr = valuesStr.trim(); + valuesStr = StrUtils.removePrefix(valuesStr, "["); + valuesStr = StrUtils.removeSuffix(valuesStr, "]"); + valuesStr = valuesStr.trim(); + + if (valuesStr.length() <= 0) { + return values; + } else { + String[] parts = Config.tokenize(valuesStr, " "); + + if (parts.length <= 0) { + return values; + } else { + if (!Arrays.asList(parts).contains(value)) { + parts = (String[])((String[])Config.addObjectToArray(parts, value, 0)); + } + + return parts; + } + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionVariableConst.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionVariableConst.java new file mode 100644 index 0000000..9c66b87 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderOptionVariableConst.java @@ -0,0 +1,58 @@ +package shadersmod.client; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.StrUtils; + +public class ShaderOptionVariableConst extends ShaderOptionVariable { + private String type = null; + private static final Pattern PATTERN_CONST = Pattern.compile("^\\s*const\\s*(float|int)\\s*([A-Za-z0-9_]+)\\s*=\\s*(-?[0-9\\.]+f?F?)\\s*;\\s*(//.*)?$"); + + public ShaderOptionVariableConst(String name, String type, String description, String value, String[] values, String path) { + super(name, description, value, values, path); + this.type = type; + } + + public String getSourceLine() { + return "const " + this.type + " " + this.getName() + " = " + this.getValue() + "; // Shader option " + this.getValue(); + } + + public boolean matchesLine(String line) { + Matcher m = PATTERN_CONST.matcher(line); + + if (!m.matches()) { + return false; + } else { + String defName = m.group(2); + return defName.matches(this.getName()); + } + } + + public static ShaderOption parseOption(String line, String path) { + Matcher m = PATTERN_CONST.matcher(line); + + if (!m.matches()) { + return null; + } else { + String type = m.group(1); + String name = m.group(2); + String value = m.group(3); + String description = m.group(4); + String vals = StrUtils.getSegment(description, "[", "]"); + + if (vals != null && vals.length() > 0) { + description = description.replace(vals, "").trim(); + } + + String[] values = parseValues(value, vals); + + if (name != null && name.length() > 0) { + path = StrUtils.removePrefix(path, "/shaders/"); + ShaderOptionVariableConst so = new ShaderOptionVariableConst(name, type, description, value, values, path); + return so; + } else { + return null; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackDefault.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackDefault.java new file mode 100644 index 0000000..be356ab --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackDefault.java @@ -0,0 +1,19 @@ +package shadersmod.client; + +import java.io.InputStream; + +public class ShaderPackDefault implements IShaderPack { + public void close() {} + + public InputStream getResourceAsStream(String resName) { + return ShaderPackDefault.class.getResourceAsStream(resName); + } + + public String getName() { + return Shaders.packNameDefault; + } + + public boolean hasDirectory(String name) { + return false; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackFolder.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackFolder.java new file mode 100644 index 0000000..d9c8b8f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackFolder.java @@ -0,0 +1,36 @@ +package shadersmod.client; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import net.minecraft.src.StrUtils; + +public class ShaderPackFolder implements IShaderPack { + protected File packFile; + + public ShaderPackFolder(String name, File file) { + this.packFile = file; + } + + public void close() {} + + public InputStream getResourceAsStream(String resName) { + try { + String excp = StrUtils.removePrefixSuffix(resName, "/", "/"); + File resFile = new File(this.packFile, excp); + return !resFile.exists() ? null : new BufferedInputStream(new FileInputStream(resFile)); + } catch (Exception var4) { + return null; + } + } + + public boolean hasDirectory(String name) { + File resFile = new File(this.packFile, name.substring(1)); + return !resFile.exists() ? false : resFile.isDirectory(); + } + + public String getName() { + return this.packFile.getName(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackNone.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackNone.java new file mode 100644 index 0000000..67b13f1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackNone.java @@ -0,0 +1,19 @@ +package shadersmod.client; + +import java.io.InputStream; + +public class ShaderPackNone implements IShaderPack { + public void close() {} + + public InputStream getResourceAsStream(String resName) { + return null; + } + + public boolean hasDirectory(String name) { + return false; + } + + public String getName() { + return Shaders.packNameNone; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackParser.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackParser.java new file mode 100644 index 0000000..84d3e69 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackParser.java @@ -0,0 +1,631 @@ +package shadersmod.client; + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.CharArrayReader; +import java.io.CharArrayWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.src.Config; +import net.minecraft.src.StrUtils; +import net.optifine.entity.model.anim.ExpressionParser; +import net.optifine.entity.model.anim.ExpressionType; +import net.optifine.entity.model.anim.IExpression; +import net.optifine.entity.model.anim.ParseException; +import shadersmod.common.SMCLog; +import shadersmod.uniform.CustomUniform; +import shadersmod.uniform.CustomUniforms; +import shadersmod.uniform.ShaderExpressionResolver; +import shadersmod.uniform.UniformType; + +public class ShaderPackParser { + private static final Pattern PATTERN_VERSION = Pattern.compile("^\\s*#version\\s+.*$"); + private static final Pattern PATTERN_INCLUDE = Pattern.compile("^\\s*#include\\s+\"([A-Za-z0-9_/\\.]+)\".*$"); + private static final Set setConstNames = makeSetConstNames(); + + public static ShaderOption[] parseShaderPackOptions(IShaderPack shaderPack, String[] programNames, List listDimensions) { + if (shaderPack == null) { + return new ShaderOption[0]; + } else { + HashMap mapOptions = new HashMap(); + collectShaderOptions(shaderPack, "/shaders", programNames, mapOptions); + Iterator options = listDimensions.iterator(); + + while (options.hasNext()) { + int sos = ((Integer)options.next()).intValue(); + String comp = "/shaders/world" + sos; + collectShaderOptions(shaderPack, comp, programNames, mapOptions); + } + + Collection options1 = mapOptions.values(); + ShaderOption[] sos1 = (ShaderOption[])((ShaderOption[])options1.toArray(new ShaderOption[options1.size()])); + Comparator comp1 = new Comparator() { + public int compare(ShaderOption o1, ShaderOption o2) { + return o1.getName().compareToIgnoreCase(o2.getName()); + } + public int compare(Object x0, Object x1) { + return this.compare((ShaderOption)x0, (ShaderOption)x1); + } + }; + Arrays.sort(sos1, comp1); + return sos1; + } + } + + private static void collectShaderOptions(IShaderPack shaderPack, String dir, String[] programNames, Map mapOptions) { + for (int i = 0; i < programNames.length; ++i) { + String programName = programNames[i]; + + if (!programName.equals("")) { + String vsh = dir + "/" + programName + ".vsh"; + String fsh = dir + "/" + programName + ".fsh"; + collectShaderOptions(shaderPack, vsh, mapOptions); + collectShaderOptions(shaderPack, fsh, mapOptions); + } + } + } + + private static void collectShaderOptions(IShaderPack sp, String path, Map mapOptions) { + String[] lines = getLines(sp, path); + + for (int i = 0; i < lines.length; ++i) { + String line = lines[i]; + ShaderOption so = getShaderOption(line, path); + + if (so != null && !so.getName().startsWith(ShaderMacros.getPrefixMacro()) && (!so.checkUsed() || isOptionUsed(so, lines))) { + String key = so.getName(); + ShaderOption so2 = (ShaderOption)mapOptions.get(key); + + if (so2 != null) { + if (!Config.equals(so2.getValueDefault(), so.getValueDefault())) { + Config.warn("Ambiguous shader option: " + so.getName()); + Config.warn(" - in " + Config.arrayToString((Object[])so2.getPaths()) + ": " + so2.getValueDefault()); + Config.warn(" - in " + Config.arrayToString((Object[])so.getPaths()) + ": " + so.getValueDefault()); + so2.setEnabled(false); + } + + if (so2.getDescription() == null || so2.getDescription().length() <= 0) { + so2.setDescription(so.getDescription()); + } + + so2.addPaths(so.getPaths()); + } else { + mapOptions.put(key, so); + } + } + } + } + + private static boolean isOptionUsed(ShaderOption so, String[] lines) { + for (int i = 0; i < lines.length; ++i) { + String line = lines[i]; + + if (so.isUsedInLine(line)) { + return true; + } + } + + return false; + } + + private static String[] getLines(IShaderPack sp, String path) { + try { + ArrayList e = new ArrayList(); + String str = loadFile(path, sp, 0, e, 0); + + if (str == null) { + return new String[0]; + } else { + ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes()); + String[] lines = Config.readLines((InputStream)is); + return lines; + } + } catch (IOException var6) { + Config.dbg(var6.getClass().getName() + ": " + var6.getMessage()); + return new String[0]; + } + } + + private static ShaderOption getShaderOption(String line, String path) { + ShaderOption so = null; + + if (so == null) { + so = ShaderOptionSwitch.parseOption(line, path); + } + + if (so == null) { + so = ShaderOptionVariable.parseOption(line, path); + } + + if (so != null) { + return so; + } else { + if (so == null) { + so = ShaderOptionSwitchConst.parseOption(line, path); + } + + if (so == null) { + so = ShaderOptionVariableConst.parseOption(line, path); + } + + return so != null && setConstNames.contains(so.getName()) ? so : null; + } + } + + private static Set makeSetConstNames() { + HashSet set = new HashSet(); + set.add("shadowMapResolution"); + set.add("shadowMapFov"); + set.add("shadowDistance"); + set.add("shadowDistanceRenderMul"); + set.add("shadowIntervalSize"); + set.add("generateShadowMipmap"); + set.add("generateShadowColorMipmap"); + set.add("shadowHardwareFiltering"); + set.add("shadowHardwareFiltering0"); + set.add("shadowHardwareFiltering1"); + set.add("shadowtex0Mipmap"); + set.add("shadowtexMipmap"); + set.add("shadowtex1Mipmap"); + set.add("shadowcolor0Mipmap"); + set.add("shadowColor0Mipmap"); + set.add("shadowcolor1Mipmap"); + set.add("shadowColor1Mipmap"); + set.add("shadowtex0Nearest"); + set.add("shadowtexNearest"); + set.add("shadow0MinMagNearest"); + set.add("shadowtex1Nearest"); + set.add("shadow1MinMagNearest"); + set.add("shadowcolor0Nearest"); + set.add("shadowColor0Nearest"); + set.add("shadowColor0MinMagNearest"); + set.add("shadowcolor1Nearest"); + set.add("shadowColor1Nearest"); + set.add("shadowColor1MinMagNearest"); + set.add("wetnessHalflife"); + set.add("drynessHalflife"); + set.add("eyeBrightnessHalflife"); + set.add("centerDepthHalflife"); + set.add("sunPathRotation"); + set.add("ambientOcclusionLevel"); + set.add("superSamplingLevel"); + set.add("noiseTextureResolution"); + return set; + } + + public static ShaderProfile[] parseProfiles(Properties props, ShaderOption[] shaderOptions) { + String PREFIX_PROFILE = "profile."; + ArrayList list = new ArrayList(); + Set keys = props.keySet(); + Iterator profs = keys.iterator(); + + while (profs.hasNext()) { + String key = (String)profs.next(); + + if (key.startsWith(PREFIX_PROFILE)) { + String name = key.substring(PREFIX_PROFILE.length()); + props.getProperty(key); + HashSet parsedProfiles = new HashSet(); + ShaderProfile p = parseProfile(name, props, parsedProfiles, shaderOptions); + + if (p != null) { + list.add(p); + } + } + } + + if (list.size() <= 0) { + return null; + } else { + ShaderProfile[] profs1 = (ShaderProfile[])((ShaderProfile[])list.toArray(new ShaderProfile[list.size()])); + return profs1; + } + } + + public static Set parseOptionSliders(Properties props, ShaderOption[] shaderOptions) { + HashSet sliders = new HashSet(); + String value = props.getProperty("sliders"); + + if (value == null) { + return sliders; + } else { + String[] names = Config.tokenize(value, " "); + + for (int i = 0; i < names.length; ++i) { + String name = names[i]; + ShaderOption so = ShaderUtils.getShaderOption(name, shaderOptions); + + if (so == null) { + Config.warn("Invalid shader option: " + name); + } else { + sliders.add(name); + } + } + + return sliders; + } + } + + private static ShaderProfile parseProfile(String name, Properties props, Set parsedProfiles, ShaderOption[] shaderOptions) { + String PREFIX_PROFILE = "profile."; + String key = PREFIX_PROFILE + name; + + if (parsedProfiles.contains(key)) { + Config.warn("[Shaders] Profile already parsed: " + name); + return null; + } else { + parsedProfiles.add(name); + ShaderProfile prof = new ShaderProfile(name); + String val = props.getProperty(key); + String[] parts = Config.tokenize(val, " "); + + for (int i = 0; i < parts.length; ++i) { + String part = parts[i]; + + if (part.startsWith(PREFIX_PROFILE)) { + String tokens = part.substring(PREFIX_PROFILE.length()); + ShaderProfile option = parseProfile(tokens, props, parsedProfiles, shaderOptions); + + if (prof != null) { + prof.addOptionValues(option); + prof.addDisabledPrograms(option.getDisabledPrograms()); + } + } else { + String[] var16 = Config.tokenize(part, ":="); + String var17; + + if (var16.length == 1) { + var17 = var16[0]; + boolean value = true; + + if (var17.startsWith("!")) { + value = false; + var17 = var17.substring(1); + } + + String so = "program."; + + if (var17.startsWith(so)) { + String so1 = var17.substring(so.length()); + + if (!Shaders.isProgramPath(so1)) { + Config.warn("Invalid program: " + so1 + " in profile: " + prof.getName()); + } else if (value) { + prof.removeDisabledProgram(so1); + } else { + prof.addDisabledProgram(so1); + } + } else { + ShaderOption var20 = ShaderUtils.getShaderOption(var17, shaderOptions); + + if (!(var20 instanceof ShaderOptionSwitch)) { + Config.warn("[Shaders] Invalid option: " + var17); + } else { + prof.addOptionValue(var17, String.valueOf(value)); + var20.setVisible(true); + } + } + } else if (var16.length != 2) { + Config.warn("[Shaders] Invalid option value: " + part); + } else { + var17 = var16[0]; + String var18 = var16[1]; + ShaderOption var19 = ShaderUtils.getShaderOption(var17, shaderOptions); + + if (var19 == null) { + Config.warn("[Shaders] Invalid option: " + part); + } else if (!var19.isValidValue(var18)) { + Config.warn("[Shaders] Invalid value: " + part); + } else { + var19.setVisible(true); + prof.addOptionValue(var17, var18); + } + } + } + } + + return prof; + } + } + + public static Map parseGuiScreens(Properties props, ShaderProfile[] shaderProfiles, ShaderOption[] shaderOptions) { + HashMap map = new HashMap(); + parseGuiScreen("screen", props, map, shaderProfiles, shaderOptions); + return map.isEmpty() ? null : map; + } + + private static boolean parseGuiScreen(String key, Properties props, Map map, ShaderProfile[] shaderProfiles, ShaderOption[] shaderOptions) { + String val = props.getProperty(key); + + if (val == null) { + return false; + } else { + ArrayList list = new ArrayList(); + HashSet setNames = new HashSet(); + String[] opNames = Config.tokenize(val, " "); + String colStr; + + for (int scrOps = 0; scrOps < opNames.length; ++scrOps) { + colStr = opNames[scrOps]; + + if (colStr.equals("")) { + list.add((Object)null); + } else if (setNames.contains(colStr)) { + Config.warn("[Shaders] Duplicate option: " + colStr + ", key: " + key); + } else { + setNames.add(colStr); + + if (colStr.equals("")) { + if (shaderProfiles == null) { + Config.warn("[Shaders] Option profile can not be used, no profiles defined: " + colStr + ", key: " + key); + } else { + ShaderOptionProfile columns = new ShaderOptionProfile(shaderProfiles, shaderOptions); + list.add(columns); + } + } else if (colStr.equals("*")) { + ShaderOptionRest var14 = new ShaderOptionRest(""); + list.add(var14); + } else if (colStr.startsWith("[") && colStr.endsWith("]")) { + String var16 = StrUtils.removePrefixSuffix(colStr, "[", "]"); + + if (!var16.matches("^[a-zA-Z0-9_]+$")) { + Config.warn("[Shaders] Invalid screen: " + colStr + ", key: " + key); + } else if (!parseGuiScreen("screen." + var16, props, map, shaderProfiles, shaderOptions)) { + Config.warn("[Shaders] Invalid screen: " + colStr + ", key: " + key); + } else { + ShaderOptionScreen sso = new ShaderOptionScreen(var16); + list.add(sso); + } + } else { + ShaderOption var15 = ShaderUtils.getShaderOption(colStr, shaderOptions); + + if (var15 == null) { + Config.warn("[Shaders] Invalid option: " + colStr + ", key: " + key); + list.add((Object)null); + } else { + var15.setVisible(true); + list.add(var15); + } + } + } + } + + ShaderOption[] var13 = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + colStr = props.getProperty(key + ".columns"); + int var17 = Config.parseInt(colStr, 2); + ScreenShaderOptions var18 = new ScreenShaderOptions(key, var13, var17); + map.put(key, var18); + return true; + } + } + + public static BufferedReader resolveIncludes(BufferedReader reader, String filePath, IShaderPack shaderPack, int fileIndex, List listFiles, int includeLevel) throws IOException { + String fileDir = "/"; + int pos = filePath.lastIndexOf("/"); + + if (pos >= 0) { + fileDir = filePath.substring(0, pos); + } + + CharArrayWriter caw = new CharArrayWriter(); + int macroInsertPosition = -1; + LinkedHashSet setExtensions = new LinkedHashSet(); + int lineNumber = 1; + + while (true) { + String chars = reader.readLine(); + String strExt; + String sbAll; + String strAll; + + if (chars == null) { + char[] var18 = caw.toCharArray(); + + if (macroInsertPosition >= 0 && setExtensions.size() > 0) { + StringBuilder var19 = new StringBuilder(); + Iterator var22 = setExtensions.iterator(); + + while (var22.hasNext()) { + sbAll = (String)var22.next(); + var19.append("#define "); + var19.append(sbAll); + var19.append("\n"); + } + + strExt = var19.toString(); + StringBuilder var25 = new StringBuilder(new String(var18)); + var25.insert(macroInsertPosition, strExt); + strAll = var25.toString(); + var18 = strAll.toCharArray(); + } + + CharArrayReader var20 = new CharArrayReader(var18); + return new BufferedReader(var20); + } + + Matcher car; + + if (macroInsertPosition < 0) { + car = PATTERN_VERSION.matcher(chars); + + if (car.matches()) { + strExt = ShaderMacros.getMacroLines(); + sbAll = chars + "\n" + strExt; + strAll = "#line " + (lineNumber + 1) + " " + fileIndex; + chars = sbAll + strAll; + macroInsertPosition = caw.size() + sbAll.length(); + } + } + + car = PATTERN_INCLUDE.matcher(chars); + + if (car.matches()) { + strExt = car.group(1); + boolean var23 = strExt.startsWith("/"); + strAll = var23 ? "/shaders" + strExt : fileDir + "/" + strExt; + + if (!listFiles.contains(strAll)) { + listFiles.add(strAll); + } + + int includeFileIndex = listFiles.indexOf(strAll) + 1; + chars = loadFile(strAll, shaderPack, includeFileIndex, listFiles, includeLevel); + + if (chars == null) { + throw new IOException("Included file not found: " + filePath); + } + + if (chars.endsWith("\n")) { + chars = chars.substring(0, chars.length() - 1); + } + + chars = "#line 1 " + includeFileIndex + "\n" + chars + "\n" + "#line " + (lineNumber + 1) + " " + fileIndex; + } + + if (macroInsertPosition >= 0 && chars.contains(ShaderMacros.getPrefixMacro())) { + String[] var21 = findExtensions(chars, ShaderMacros.getExtensions()); + + for (int var24 = 0; var24 < var21.length; ++var24) { + strAll = var21[var24]; + setExtensions.add(strAll); + } + } + + caw.write(chars); + caw.write("\n"); + ++lineNumber; + } + } + + private static String[] findExtensions(String line, String[] extensions) { + ArrayList list = new ArrayList(); + + for (int exts = 0; exts < extensions.length; ++exts) { + String ext = extensions[exts]; + + if (line.contains(ext)) { + list.add(ext); + } + } + + String[] var5 = (String[])((String[])list.toArray(new String[list.size()])); + return var5; + } + + private static String loadFile(String filePath, IShaderPack shaderPack, int fileIndex, List listFiles, int includeLevel) throws IOException { + if (includeLevel >= 10) { + throw new IOException("#include depth exceeded: " + includeLevel + ", file: " + filePath); + } else { + ++includeLevel; + InputStream in = shaderPack.getResourceAsStream(filePath); + + if (in == null) { + return null; + } else { + InputStreamReader isr = new InputStreamReader(in, "ASCII"); + BufferedReader br = new BufferedReader(isr); + br = resolveIncludes(br, filePath, shaderPack, fileIndex, listFiles, includeLevel); + CharArrayWriter caw = new CharArrayWriter(); + + while (true) { + String line = br.readLine(); + + if (line == null) { + return caw.toString(); + } + + caw.write(line); + caw.write("\n"); + } + } + } + } + + public static CustomUniforms parseCustomUniforms(Properties props) { + String UNIFORM = "uniform"; + String VARIABLE = "variable"; + String PREFIX_UNIFORM = UNIFORM + "."; + String PREFIX_VARIABLE = VARIABLE + "."; + HashMap mapExpressions = new HashMap(); + ArrayList listUniforms = new ArrayList(); + Set keys = props.keySet(); + Iterator cusArr = keys.iterator(); + + while (cusArr.hasNext()) { + String cus = (String)cusArr.next(); + String[] keyParts = Config.tokenize(cus, "."); + + if (keyParts.length == 3) { + String kind = keyParts[0]; + String type = keyParts[1]; + String name = keyParts[2]; + String src = props.getProperty(cus).trim(); + + if (mapExpressions.containsKey(name)) { + SMCLog.warning("Expression already defined: " + name); + } else if (kind.equals(UNIFORM) || kind.equals(VARIABLE)) { + SMCLog.info("Custom " + kind + ": " + name); + CustomUniform cu = parseCustomUniform(kind, name, type, src, mapExpressions); + + if (cu != null) { + mapExpressions.put(name, cu.getExpression()); + + if (!kind.equals(VARIABLE)) { + listUniforms.add(cu); + } + } + } + } + } + + if (listUniforms.size() <= 0) { + return null; + } else { + CustomUniform[] cusArr1 = (CustomUniform[])((CustomUniform[])listUniforms.toArray(new CustomUniform[listUniforms.size()])); + CustomUniforms cus1 = new CustomUniforms(cusArr1); + return cus1; + } + } + + private static CustomUniform parseCustomUniform(String kind, String name, String type, String src, Map mapExpressions) { + try { + UniformType e = UniformType.parse(type); + + if (e == null) { + SMCLog.warning("Unknown " + kind + " type: " + e); + return null; + } else { + ShaderExpressionResolver resolver = new ShaderExpressionResolver(mapExpressions); + ExpressionParser parser = new ExpressionParser(resolver); + IExpression expr = parser.parse(src); + ExpressionType expressionType = expr.getExpressionType(); + + if (!e.matchesExpressionType(expressionType)) { + SMCLog.warning("Expression type does not match " + kind + " type, expression: " + expressionType + ", " + kind + ": " + e + " " + name); + return null; + } else { + CustomUniform cu = new CustomUniform(name, e, expr); + return cu; + } + } + } catch (ParseException var11) { + SMCLog.warning(var11.getClass().getName() + ": " + var11.getMessage()); + return null; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackZip.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackZip.java new file mode 100644 index 0000000..a29ab7f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderPackZip.java @@ -0,0 +1,62 @@ +package shadersmod.client; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import net.minecraft.src.StrUtils; + +public class ShaderPackZip implements IShaderPack { + protected File packFile; + protected ZipFile packZipFile; + + public ShaderPackZip(String name, File file) { + this.packFile = file; + this.packZipFile = null; + } + + public void close() { + if (this.packZipFile != null) { + try { + this.packZipFile.close(); + } catch (Exception var2) { + ; + } + + this.packZipFile = null; + } + } + + public InputStream getResourceAsStream(String resName) { + try { + if (this.packZipFile == null) { + this.packZipFile = new ZipFile(this.packFile); + } + + String excp = StrUtils.removePrefix(resName, "/"); + ZipEntry entry = this.packZipFile.getEntry(excp); + return entry == null ? null : this.packZipFile.getInputStream(entry); + } catch (Exception var4) { + return null; + } + } + + public boolean hasDirectory(String resName) { + try { + if (this.packZipFile == null) { + this.packZipFile = new ZipFile(this.packFile); + } + + String e = StrUtils.removePrefix(resName, "/"); + ZipEntry entry = this.packZipFile.getEntry(e); + return entry != null; + } catch (IOException var4) { + return false; + } + } + + public String getName() { + return this.packFile.getName(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderParser.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderParser.java new file mode 100644 index 0000000..aadad9b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderParser.java @@ -0,0 +1,96 @@ +package shadersmod.client; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ShaderParser { + public static Pattern PATTERN_UNIFORM = Pattern.compile("\\s*uniform\\s+\\w+\\s+(\\w+).*"); + public static Pattern PATTERN_ATTRIBUTE = Pattern.compile("\\s*attribute\\s+\\w+\\s+(\\w+).*"); + public static Pattern PATTERN_CONST_INT = Pattern.compile("\\s*const\\s+int\\s+(\\w+)\\s*=\\s*([-+.\\w]+)\\s*;.*"); + public static Pattern PATTERN_CONST_FLOAT = Pattern.compile("\\s*const\\s+float\\s+(\\w+)\\s*=\\s*([-+.\\w]+)\\s*;.*"); + public static Pattern PATTERN_CONST_BOOL = Pattern.compile("\\s*const\\s+bool\\s+(\\w+)\\s*=\\s*(\\w+)\\s*;.*"); + public static Pattern PATTERN_PROPERTY = Pattern.compile("\\s*(/\\*|//)?\\s*([A-Z]+):\\s*(\\w+)\\s*(\\*/.*|\\s*)"); + public static Pattern PATTERN_DEFERRED_FSH = Pattern.compile(".*deferred[0-9]?\\.fsh"); + public static Pattern PATTERN_COMPOSITE_FSH = Pattern.compile(".*composite[0-9]?\\.fsh"); + public static Pattern PATTERN_FINAL_FSH = Pattern.compile(".*final\\.fsh"); + public static Pattern PATTERN_DRAW_BUFFERS = Pattern.compile("[0-7N]*"); + + public static ShaderLine parseLine(String line) { + Matcher mu = PATTERN_UNIFORM.matcher(line); + + if (mu.matches()) { + return new ShaderLine(1, mu.group(1), "", line); + } else { + Matcher ma = PATTERN_ATTRIBUTE.matcher(line); + + if (ma.matches()) { + return new ShaderLine(2, ma.group(1), "", line); + } else { + Matcher mc = PATTERN_PROPERTY.matcher(line); + + if (mc.matches()) { + return new ShaderLine(6, mc.group(2), mc.group(3), line); + } else { + Matcher mci = PATTERN_CONST_INT.matcher(line); + + if (mci.matches()) { + return new ShaderLine(3, mci.group(1), mci.group(2), line); + } else { + Matcher mcf = PATTERN_CONST_FLOAT.matcher(line); + + if (mcf.matches()) { + return new ShaderLine(4, mcf.group(1), mcf.group(2), line); + } else { + Matcher mcb = PATTERN_CONST_BOOL.matcher(line); + return mcb.matches() ? new ShaderLine(5, mcb.group(1), mcb.group(2), line) : null; + } + } + } + } + } + } + + public static int getIndex(String uniform, String prefix, int minIndex, int maxIndex) { + if (uniform.length() != prefix.length() + 1) { + return -1; + } else if (!uniform.startsWith(prefix)) { + return -1; + } else { + int index = uniform.charAt(prefix.length()) - 48; + return index >= minIndex && index <= maxIndex ? index : -1; + } + } + + public static int getShadowDepthIndex(String uniform) { + return uniform.equals("shadow") ? 0 : (uniform.equals("watershadow") ? 1 : getIndex(uniform, "shadowtex", 0, 1)); + } + + public static int getShadowColorIndex(String uniform) { + return uniform.equals("shadowcolor") ? 0 : getIndex(uniform, "shadowcolor", 0, 1); + } + + public static int getDepthIndex(String uniform) { + return getIndex(uniform, "depthtex", 0, 2); + } + + public static int getColorIndex(String uniform) { + int gauxIndex = getIndex(uniform, "gaux", 1, 4); + return gauxIndex > 0 ? gauxIndex + 3 : getIndex(uniform, "colortex", 4, 7); + } + + public static boolean isDeferred(String filename) { + return PATTERN_DEFERRED_FSH.matcher(filename).matches(); + } + + public static boolean isComposite(String filename) { + return PATTERN_COMPOSITE_FSH.matcher(filename).matches(); + } + + public static boolean isFinal(String filename) { + return PATTERN_FINAL_FSH.matcher(filename).matches(); + } + + public static boolean isValidDrawBuffers(String str) { + return PATTERN_DRAW_BUFFERS.matcher(str).matches(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderProfile.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderProfile.java new file mode 100644 index 0000000..6135245 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderProfile.java @@ -0,0 +1,73 @@ +package shadersmod.client; + +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +public class ShaderProfile { + private String name = null; + private Map mapOptionValues = new LinkedHashMap(); + private Set disabledPrograms = new LinkedHashSet(); + + public ShaderProfile(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public void addOptionValue(String option, String value) { + this.mapOptionValues.put(option, value); + } + + public void addOptionValues(ShaderProfile prof) { + if (prof != null) { + this.mapOptionValues.putAll(prof.mapOptionValues); + } + } + + public void applyOptionValues(ShaderOption[] options) { + for (int i = 0; i < options.length; ++i) { + ShaderOption so = options[i]; + String key = so.getName(); + String val = (String)this.mapOptionValues.get(key); + + if (val != null) { + so.setValue(val); + } + } + } + + public String[] getOptions() { + Set keys = this.mapOptionValues.keySet(); + String[] opts = (String[])((String[])keys.toArray(new String[keys.size()])); + return opts; + } + + public String getValue(String key) { + return (String)this.mapOptionValues.get(key); + } + + public void addDisabledProgram(String program) { + this.disabledPrograms.add(program); + } + + public void removeDisabledProgram(String program) { + this.disabledPrograms.remove(program); + } + + public Collection getDisabledPrograms() { + return new LinkedHashSet(this.disabledPrograms); + } + + public void addDisabledPrograms(Collection programs) { + this.disabledPrograms.addAll(programs); + } + + public boolean isProgramDisabled(String program) { + return this.disabledPrograms.contains(program); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderProgramData.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderProgramData.java new file mode 100644 index 0000000..6c6bc9a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderProgramData.java @@ -0,0 +1,159 @@ +package shadersmod.client; + +import org.lwjgl.opengl.ARBShaderObjects; + +public class ShaderProgramData { + public int programIDGL; + public int uniform_texture; + public int uniform_lightmap; + public int uniform_normals; + public int uniform_specular; + public int uniform_shadow; + public int uniform_watershadow; + public int uniform_shadowtex0; + public int uniform_shadowtex1; + public int uniform_depthtex0; + public int uniform_depthtex1; + public int uniform_shadowcolor; + public int uniform_shadowcolor0; + public int uniform_shadowcolor1; + public int uniform_noisetex; + public int uniform_gcolor; + public int uniform_gdepth; + public int uniform_gnormal; + public int uniform_composite; + public int uniform_gaux1; + public int uniform_gaux2; + public int uniform_gaux3; + public int uniform_gaux4; + public int uniform_colortex0; + public int uniform_colortex1; + public int uniform_colortex2; + public int uniform_colortex3; + public int uniform_colortex4; + public int uniform_colortex5; + public int uniform_colortex6; + public int uniform_colortex7; + public int uniform_gdepthtex; + public int uniform_depthtex2; + public int uniform_tex; + public int uniform_heldItemId; + public int uniform_heldBlockLightValue; + public int uniform_fogMode; + public int uniform_fogColor; + public int uniform_skyColor; + public int uniform_worldTime; + public int uniform_moonPhase; + public int uniform_frameTimeCounter; + public int uniform_sunAngle; + public int uniform_shadowAngle; + public int uniform_rainStrength; + public int uniform_aspectRatio; + public int uniform_viewWidth; + public int uniform_viewHeight; + public int uniform_near; + public int uniform_far; + public int uniform_sunPosition; + public int uniform_moonPosition; + public int uniform_upPosition; + public int uniform_previousCameraPosition; + public int uniform_cameraPosition; + public int uniform_gbufferModelView; + public int uniform_gbufferModelViewInverse; + public int uniform_gbufferPreviousProjection; + public int uniform_gbufferProjection; + public int uniform_gbufferProjectionInverse; + public int uniform_gbufferPreviousModelView; + public int uniform_shadowProjection; + public int uniform_shadowProjectionInverse; + public int uniform_shadowModelView; + public int uniform_shadowModelViewInverse; + public int uniform_wetness; + public int uniform_eyeAltitude; + public int uniform_eyeBrightness; + public int uniform_eyeBrightnessSmooth; + public int uniform_terrainTextureSize; + public int uniform_terrainIconSize; + public int uniform_isEyeInWater; + public int uniform_hideGUI; + public int uniform_centerDepthSmooth; + public int uniform_atlasSize; + + public ShaderProgramData(int programID) { + this.programIDGL = programID; + this.uniform_texture = ARBShaderObjects.glGetUniformLocationARB(programID, "texture"); + this.uniform_lightmap = ARBShaderObjects.glGetUniformLocationARB(programID, "lightmap"); + this.uniform_normals = ARBShaderObjects.glGetUniformLocationARB(programID, "normals"); + this.uniform_specular = ARBShaderObjects.glGetUniformLocationARB(programID, "specular"); + this.uniform_shadow = ARBShaderObjects.glGetUniformLocationARB(programID, "shadow"); + this.uniform_watershadow = ARBShaderObjects.glGetUniformLocationARB(programID, "watershadow"); + this.uniform_shadowtex0 = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowtex0"); + this.uniform_shadowtex1 = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowtex1"); + this.uniform_depthtex0 = ARBShaderObjects.glGetUniformLocationARB(programID, "depthtex0"); + this.uniform_depthtex1 = ARBShaderObjects.glGetUniformLocationARB(programID, "depthtex1"); + this.uniform_shadowcolor = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowcolor"); + this.uniform_shadowcolor0 = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowcolor0"); + this.uniform_shadowcolor1 = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowcolor1"); + this.uniform_noisetex = ARBShaderObjects.glGetUniformLocationARB(programID, "noisetex"); + this.uniform_gcolor = ARBShaderObjects.glGetUniformLocationARB(programID, "gcolor"); + this.uniform_gdepth = ARBShaderObjects.glGetUniformLocationARB(programID, "gdepth"); + this.uniform_gnormal = ARBShaderObjects.glGetUniformLocationARB(programID, "gnormal"); + this.uniform_composite = ARBShaderObjects.glGetUniformLocationARB(programID, "composite"); + this.uniform_gaux1 = ARBShaderObjects.glGetUniformLocationARB(programID, "gaux1"); + this.uniform_gaux2 = ARBShaderObjects.glGetUniformLocationARB(programID, "gaux2"); + this.uniform_gaux3 = ARBShaderObjects.glGetUniformLocationARB(programID, "gaux3"); + this.uniform_gaux4 = ARBShaderObjects.glGetUniformLocationARB(programID, "gaux4"); + this.uniform_colortex0 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex0"); + this.uniform_colortex1 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex1"); + this.uniform_colortex2 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex2"); + this.uniform_colortex3 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex3"); + this.uniform_colortex4 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex4"); + this.uniform_colortex5 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex5"); + this.uniform_colortex6 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex6"); + this.uniform_colortex7 = ARBShaderObjects.glGetUniformLocationARB(programID, "colortex7"); + this.uniform_gdepthtex = ARBShaderObjects.glGetUniformLocationARB(programID, "gdepthtex"); + this.uniform_depthtex2 = ARBShaderObjects.glGetUniformLocationARB(programID, "depthtex2"); + this.uniform_tex = ARBShaderObjects.glGetUniformLocationARB(programID, "tex"); + this.uniform_heldItemId = ARBShaderObjects.glGetUniformLocationARB(programID, "heldItemId"); + this.uniform_heldBlockLightValue = ARBShaderObjects.glGetUniformLocationARB(programID, "heldBlockLightValue"); + this.uniform_fogMode = ARBShaderObjects.glGetUniformLocationARB(programID, "fogMode"); + this.uniform_fogColor = ARBShaderObjects.glGetUniformLocationARB(programID, "fogColor"); + this.uniform_skyColor = ARBShaderObjects.glGetUniformLocationARB(programID, "skyColor"); + this.uniform_worldTime = ARBShaderObjects.glGetUniformLocationARB(programID, "worldTime"); + this.uniform_moonPhase = ARBShaderObjects.glGetUniformLocationARB(programID, "moonPhase"); + this.uniform_frameTimeCounter = ARBShaderObjects.glGetUniformLocationARB(programID, "frameTimeCounter"); + this.uniform_sunAngle = ARBShaderObjects.glGetUniformLocationARB(programID, "sunAngle"); + this.uniform_shadowAngle = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowAngle"); + this.uniform_rainStrength = ARBShaderObjects.glGetUniformLocationARB(programID, "rainStrength"); + this.uniform_aspectRatio = ARBShaderObjects.glGetUniformLocationARB(programID, "aspectRatio"); + this.uniform_viewWidth = ARBShaderObjects.glGetUniformLocationARB(programID, "viewWidth"); + this.uniform_viewHeight = ARBShaderObjects.glGetUniformLocationARB(programID, "viewHeight"); + this.uniform_near = ARBShaderObjects.glGetUniformLocationARB(programID, "near"); + this.uniform_far = ARBShaderObjects.glGetUniformLocationARB(programID, "far"); + this.uniform_sunPosition = ARBShaderObjects.glGetUniformLocationARB(programID, "sunPosition"); + this.uniform_moonPosition = ARBShaderObjects.glGetUniformLocationARB(programID, "moonPosition"); + this.uniform_upPosition = ARBShaderObjects.glGetUniformLocationARB(programID, "upPosition"); + this.uniform_previousCameraPosition = ARBShaderObjects.glGetUniformLocationARB(programID, "previousCameraPosition"); + this.uniform_cameraPosition = ARBShaderObjects.glGetUniformLocationARB(programID, "cameraPosition"); + this.uniform_gbufferModelView = ARBShaderObjects.glGetUniformLocationARB(programID, "gbufferModelView"); + this.uniform_gbufferModelViewInverse = ARBShaderObjects.glGetUniformLocationARB(programID, "gbufferModelViewInverse"); + this.uniform_gbufferPreviousProjection = ARBShaderObjects.glGetUniformLocationARB(programID, "gbufferPreviousProjection"); + this.uniform_gbufferProjection = ARBShaderObjects.glGetUniformLocationARB(programID, "gbufferProjection"); + this.uniform_gbufferProjectionInverse = ARBShaderObjects.glGetUniformLocationARB(programID, "gbufferProjectionInverse"); + this.uniform_gbufferPreviousModelView = ARBShaderObjects.glGetUniformLocationARB(programID, "gbufferPreviousModelView"); + this.uniform_shadowProjection = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowProjection"); + this.uniform_shadowProjectionInverse = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowProjectionInverse"); + this.uniform_shadowModelView = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowModelView"); + this.uniform_shadowModelViewInverse = ARBShaderObjects.glGetUniformLocationARB(programID, "shadowModelViewInverse"); + this.uniform_wetness = ARBShaderObjects.glGetUniformLocationARB(programID, "wetness"); + this.uniform_eyeAltitude = ARBShaderObjects.glGetUniformLocationARB(programID, "eyeAltitude"); + this.uniform_eyeBrightness = ARBShaderObjects.glGetUniformLocationARB(programID, "eyeBrightness"); + this.uniform_eyeBrightnessSmooth = ARBShaderObjects.glGetUniformLocationARB(programID, "eyeBrightnessSmooth"); + this.uniform_terrainTextureSize = ARBShaderObjects.glGetUniformLocationARB(programID, "terrainTextureSize"); + this.uniform_terrainIconSize = ARBShaderObjects.glGetUniformLocationARB(programID, "terrainIconSize"); + this.uniform_isEyeInWater = ARBShaderObjects.glGetUniformLocationARB(programID, "isEyeInWater"); + this.uniform_hideGUI = ARBShaderObjects.glGetUniformLocationARB(programID, "hideGUI"); + this.uniform_centerDepthSmooth = ARBShaderObjects.glGetUniformLocationARB(programID, "centerDepthSmooth"); + this.uniform_atlasSize = ARBShaderObjects.glGetUniformLocationARB(programID, "atlasSize"); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderUtils.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderUtils.java new file mode 100644 index 0000000..d4cdba2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShaderUtils.java @@ -0,0 +1,63 @@ +package shadersmod.client; + +import net.minecraft.src.Config; + +public class ShaderUtils { + public static ShaderOption getShaderOption(String name, ShaderOption[] opts) { + if (opts == null) { + return null; + } else { + for (int i = 0; i < opts.length; ++i) { + ShaderOption so = opts[i]; + + if (so.getName().equals(name)) { + return so; + } + } + + return null; + } + } + + public static ShaderProfile detectProfile(ShaderProfile[] profs, ShaderOption[] opts, boolean def) { + if (profs == null) { + return null; + } else { + for (int i = 0; i < profs.length; ++i) { + ShaderProfile prof = profs[i]; + + if (matchProfile(prof, opts, def)) { + return prof; + } + } + + return null; + } + } + + public static boolean matchProfile(ShaderProfile prof, ShaderOption[] opts, boolean def) { + if (prof == null) { + return false; + } else if (opts == null) { + return false; + } else { + String[] optsProf = prof.getOptions(); + + for (int p = 0; p < optsProf.length; ++p) { + String opt = optsProf[p]; + ShaderOption so = getShaderOption(opt, opts); + + if (so != null) { + String optVal = def ? so.getValueDefault() : so.getValue(); + String profVal = prof.getValue(opt); + + if (!Config.equals(optVal, profVal)) { + return false; + } + } + } + + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/Shaders.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/Shaders.java new file mode 100644 index 0000000..7c7f721 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/Shaders.java @@ -0,0 +1,4441 @@ +package shadersmod.client; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.src.*; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import org.apache.commons.io.IOUtils; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.*; +import org.lwjgl.util.glu.GLU; +import shadersmod.common.SMCLog; +import shadersmod.uniform.*; + +import java.io.*; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Shaders { + static Minecraft mc; + static EntityRenderer entityRenderer; + public static boolean isInitializedOnce = false; + public static boolean isShaderPackInitialized = false; + public static ContextCapabilities capabilities; + public static String glVersionString; + public static String glVendorString; + public static String glRendererString; + public static boolean hasGlGenMipmap = false; + public static boolean hasForge = false; + public static int numberResetDisplayList = 0; + static boolean needResetModels = false; + private static int renderDisplayWidth = 0; + private static int renderDisplayHeight = 0; + public static int renderWidth = 0; + public static int renderHeight = 0; + public static boolean isRenderingWorld = false; + public static boolean isRenderingSky = false; + public static boolean isCompositeRendered = false; + public static boolean isRenderingDfb = false; + public static boolean isShadowPass = false; + public static boolean isSleeping; + private static boolean isRenderingFirstPersonHand; + private static boolean isHandRenderedMain; + public static boolean renderItemKeepDepthMask = false; + public static boolean itemToRenderMainTranslucent = false; + static float[] sunPosition = new float[4]; + static float[] moonPosition = new float[4]; + static float[] shadowLightPosition = new float[4]; + static float[] upPosition = new float[4]; + static float[] shadowLightPositionVector = new float[4]; + static float[] upPosModelView = new float[] {0.0F, 100.0F, 0.0F, 0.0F}; + static float[] sunPosModelView = new float[] {0.0F, 100.0F, 0.0F, 0.0F}; + static float[] moonPosModelView = new float[] {0.0F, -100.0F, 0.0F, 0.0F}; + private static float[] tempMat = new float[16]; + static float clearColorR; + static float clearColorG; + static float clearColorB; + static float skyColorR; + static float skyColorG; + static float skyColorB; + static long worldTime = 0L; + static long lastWorldTime = 0L; + static long diffWorldTime = 0L; + static float celestialAngle = 0.0F; + static float sunAngle = 0.0F; + static float shadowAngle = 0.0F; + static int moonPhase = 0; + static long systemTime = 0L; + static long lastSystemTime = 0L; + static long diffSystemTime = 0L; + static int frameCounter = 0; + static float frameTime = 0.0F; + static float frameTimeCounter = 0.0F; + static int systemTimeInt32 = 0; + static float rainStrength = 0.0F; + static float wetness = 0.0F; + public static float wetnessHalfLife = 600.0F; + public static float drynessHalfLife = 200.0F; + public static float eyeBrightnessHalflife = 10.0F; + static boolean usewetness = false; + static int isEyeInWater = 0; + static int eyeBrightness = 0; + static float eyeBrightnessFadeX = 0.0F; + static float eyeBrightnessFadeY = 0.0F; + static float eyePosY = 0.0F; + static float centerDepth = 0.0F; + static float centerDepthSmooth = 0.0F; + static float centerDepthSmoothHalflife = 1.0F; + static boolean centerDepthSmoothEnabled = false; + static int superSamplingLevel = 1; + static float nightVision = 0.0F; + static float blindness = 0.0F; + static boolean updateChunksErrorRecorded = false; + static boolean lightmapEnabled = false; + static boolean fogEnabled = true; + public static int entityAttrib = 10; + public static int midTexCoordAttrib = 11; + public static int tangentAttrib = 12; + public static boolean useEntityAttrib = false; + public static boolean useMidTexCoordAttrib = false; + public static boolean useMultiTexCoord3Attrib = false; + public static boolean useTangentAttrib = false; + public static boolean progUseEntityAttrib = false; + public static boolean progUseMidTexCoordAttrib = false; + public static boolean progUseTangentAttrib = false; + public static int atlasSizeX = 0; + public static int atlasSizeY = 0; + public static boolean useEntityColor = true; + public static ShaderUniformFloat4 uniformEntityColor = new ShaderUniformFloat4("entityColor"); + public static ShaderUniformInt uniformEntityId = new ShaderUniformInt("entityId"); + public static ShaderUniformInt uniformBlockEntityId = new ShaderUniformInt("blockEntityId"); + static double previousCameraPositionX; + static double previousCameraPositionY; + static double previousCameraPositionZ; + static double cameraPositionX; + static double cameraPositionY; + static double cameraPositionZ; + static int shadowPassInterval = 0; + public static boolean needResizeShadow = false; + static int shadowMapWidth = 1024; + static int shadowMapHeight = 1024; + static int spShadowMapWidth = 1024; + static int spShadowMapHeight = 1024; + static float shadowMapFOV = 90.0F; + static float shadowMapHalfPlane = 160.0F; + static boolean shadowMapIsOrtho = true; + static float shadowDistanceRenderMul = -1.0F; + static int shadowPassCounter = 0; + static int preShadowPassThirdPersonView; + public static boolean shouldSkipDefaultShadow = false; + static boolean waterShadowEnabled = false; + static final int MaxDrawBuffers = 8; + static final int MaxColorBuffers = 8; + static final int MaxDepthBuffers = 3; + static final int MaxShadowColorBuffers = 8; + static final int MaxShadowDepthBuffers = 2; + static int usedColorBuffers = 0; + static int usedDepthBuffers = 0; + static int usedShadowColorBuffers = 0; + static int usedShadowDepthBuffers = 0; + static int usedColorAttachs = 0; + static int usedDrawBuffers = 0; + static int dfb = 0; + static int sfb = 0; + private static int[] gbuffersFormat = new int[8]; + public static boolean[] gbuffersClear = new boolean[8]; + public static int activeProgram = 0; + public static final int ProgramNone = 0; + public static final int ProgramBasic = 1; + public static final int ProgramTextured = 2; + public static final int ProgramTexturedLit = 3; + public static final int ProgramSkyBasic = 4; + public static final int ProgramSkyTextured = 5; + public static final int ProgramClouds = 6; + public static final int ProgramTerrain = 7; + public static final int ProgramTerrainSolid = 8; + public static final int ProgramTerrainCutoutMip = 9; + public static final int ProgramTerrainCutout = 10; + public static final int ProgramDamagedBlock = 11; + public static final int ProgramWater = 12; + public static final int ProgramBlock = 13; + public static final int ProgramBeaconBeam = 14; + public static final int ProgramItem = 15; + public static final int ProgramEntities = 16; + public static final int ProgramArmorGlint = 17; + public static final int ProgramSpiderEyes = 18; + public static final int ProgramHand = 19; + public static final int ProgramWeather = 20; + public static final int ProgramComposite = 21; + public static final int ProgramComposite1 = 22; + public static final int ProgramComposite2 = 23; + public static final int ProgramComposite3 = 24; + public static final int ProgramComposite4 = 25; + public static final int ProgramComposite5 = 26; + public static final int ProgramComposite6 = 27; + public static final int ProgramComposite7 = 28; + public static final int ProgramFinal = 29; + public static final int ProgramShadow = 30; + public static final int ProgramShadowSolid = 31; + public static final int ProgramShadowCutout = 32; + public static final int ProgramDeferred = 33; + public static final int ProgramDeferred1 = 34; + public static final int ProgramDeferred2 = 35; + public static final int ProgramDeferred3 = 36; + public static final int ProgramDeferred4 = 37; + public static final int ProgramDeferred5 = 38; + public static final int ProgramDeferred6 = 39; + public static final int ProgramDeferred7 = 40; + public static final int ProgramHandWater = 41; + public static final int ProgramDeferredLast = 42; + public static final int ProgramCompositeLast = 43; + public static final int ProgramCount = 44; + public static final int MaxCompositePasses = 8; + public static final int MaxDeferredPasses = 8; + private static final String[] programNames = new String[] {"", "gbuffers_basic", "gbuffers_textured", "gbuffers_textured_lit", "gbuffers_skybasic", "gbuffers_skytextured", "gbuffers_clouds", "gbuffers_terrain", "gbuffers_terrain_solid", "gbuffers_terrain_cutout_mip", "gbuffers_terrain_cutout", "gbuffers_damagedblock", "gbuffers_water", "gbuffers_block", "gbuffers_beaconbeam", "gbuffers_item", "gbuffers_entities", "gbuffers_armor_glint", "gbuffers_spidereyes", "gbuffers_hand", "gbuffers_weather", "composite", "composite1", "composite2", "composite3", "composite4", "composite5", "composite6", "composite7", "final", "shadow", "shadow_solid", "shadow_cutout", "deferred", "deferred1", "deferred2", "deferred3", "deferred4", "deferred5", "deferred6", "deferred7", "gbuffers_hand_water", "deferred_last", "composite_last"}; + private static final int[] programBackups = new int[] {0, 0, 1, 2, 1, 2, 2, 3, 7, 7, 7, 7, 7, 7, 2, 3, 3, 2, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0}; + static int[] programsID = new int[44]; + private static int[] programsRef = new int[44]; + private static int programIDCopyDepth = 0; + private static boolean hasDeferredPrograms = false; + public static String[] programsDrawBufSettings = new String[44]; + private static String newDrawBufSetting = null; + static IntBuffer[] programsDrawBuffers = new IntBuffer[44]; + static IntBuffer activeDrawBuffers = null; + private static String[] programsColorAtmSettings = new String[44]; + private static String newColorAtmSetting = null; + private static String activeColorAtmSettings = null; + private static int[] programsCompositeMipmapSetting = new int[44]; + private static int newCompositeMipmapSetting = 0; + private static int activeCompositeMipmapSetting = 0; + public static Properties loadedShaders = null; + public static Properties shadersConfig = null; + public static ITextureObject defaultTexture = null; + public static boolean normalMapEnabled = false; + public static boolean[] shadowHardwareFilteringEnabled = new boolean[2]; + public static boolean[] shadowMipmapEnabled = new boolean[2]; + public static boolean[] shadowFilterNearest = new boolean[2]; + public static boolean[] shadowColorMipmapEnabled = new boolean[8]; + public static boolean[] shadowColorFilterNearest = new boolean[8]; + public static boolean configTweakBlockDamage = false; + public static boolean configCloudShadow = false; + public static float configHandDepthMul = 0.125F; + public static float configRenderResMul = 1.0F; + public static float configShadowResMul = 1.0F; + public static int configTexMinFilB = 0; + public static int configTexMinFilN = 0; + public static int configTexMinFilS = 0; + public static int configTexMagFilB = 0; + public static int configTexMagFilN = 0; + public static int configTexMagFilS = 0; + public static boolean configShadowClipFrustrum = true; + public static boolean configNormalMap = true; + public static boolean configSpecularMap = true; + public static PropertyDefaultTrueFalse configOldLighting = new PropertyDefaultTrueFalse("oldLighting", "Classic Lighting", 0); + public static PropertyDefaultTrueFalse configOldHandLight = new PropertyDefaultTrueFalse("oldHandLight", "Old Hand Light", 0); + public static int configAntialiasingLevel = 0; + public static final int texMinFilRange = 3; + public static final int texMagFilRange = 2; + public static final String[] texMinFilDesc = new String[] {"Nearest", "Nearest-Nearest", "Nearest-Linear"}; + public static final String[] texMagFilDesc = new String[] {"Nearest", "Linear"}; + public static final int[] texMinFilValue = new int[] {9728, 9984, 9986}; + public static final int[] texMagFilValue = new int[] {9728, 9729}; + static IShaderPack shaderPack = null; + public static boolean shaderPackLoaded = false; + static File currentshader; + static String currentshadername; + public static String packNameNone = "OFF"; + static String packNameDefault = "(internal)"; + static String shaderpacksdirname = "shaderpacks"; + static String optionsfilename = "optionsshaders.txt"; + static File shadersdir = new File(Minecraft.getMinecraft().mcDataDir, "shaders"); + static File shaderpacksdir = new File(Minecraft.getMinecraft().mcDataDir, shaderpacksdirname); + static File configFile = new File(Minecraft.getMinecraft().mcDataDir, optionsfilename); + static ShaderOption[] shaderPackOptions = null; + static Set shaderPackOptionSliders = null; + static ShaderProfile[] shaderPackProfiles = null; + static Map shaderPackGuiScreens = null; + public static PropertyDefaultFastFancyOff shaderPackClouds = new PropertyDefaultFastFancyOff("clouds", "Clouds", 0); + public static PropertyDefaultTrueFalse shaderPackOldLighting = new PropertyDefaultTrueFalse("oldLighting", "Classic Lighting", 0); + public static PropertyDefaultTrueFalse shaderPackOldHandLight = new PropertyDefaultTrueFalse("oldHandLight", "Old Hand Light", 0); + public static PropertyDefaultTrueFalse shaderPackDynamicHandLight = new PropertyDefaultTrueFalse("dynamicHandLight", "Dynamic Hand Light", 0); + public static PropertyDefaultTrueFalse shaderPackShadowTranslucent = new PropertyDefaultTrueFalse("shadowTranslucent", "Shadow Translucent", 0); + public static PropertyDefaultTrueFalse shaderPackUnderwaterOverlay = new PropertyDefaultTrueFalse("underwaterOverlay", "Underwater Overlay", 0); + public static PropertyDefaultTrueFalse shaderPackSun = new PropertyDefaultTrueFalse("sun", "Sun", 0); + public static PropertyDefaultTrueFalse shaderPackMoon = new PropertyDefaultTrueFalse("moon", "Moon", 0); + public static PropertyDefaultTrueFalse shaderPackVignette = new PropertyDefaultTrueFalse("vignette", "Vignette", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceSolid = new PropertyDefaultTrueFalse("backFace.solid", "Back-face Solid", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceCutout = new PropertyDefaultTrueFalse("backFace.cutout", "Back-face Cutout", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceCutoutMipped = new PropertyDefaultTrueFalse("backFace.cutoutMipped", "Back-face Cutout Mipped", 0); + public static PropertyDefaultTrueFalse shaderPackBackFaceTranslucent = new PropertyDefaultTrueFalse("backFace.translucent", "Back-face Translucent", 0); + private static Map shaderPackResources = new HashMap(); + private static World currentWorld = null; + private static List shaderPackDimensions = new ArrayList(); + private static CustomTexture[] customTexturesGbuffers = null; + private static CustomTexture[] customTexturesComposite = null; + private static CustomTexture[] customTexturesDeferred = null; + private static String noiseTexturePath = null; + private static CustomUniforms customUniforms = null; + private static final int STAGE_GBUFFERS = 0; + private static final int STAGE_COMPOSITE = 1; + private static final int STAGE_DEFERRED = 2; + private static final String[] STAGE_NAMES = new String[] {"gbuffers", "composite", "deferred"}; + public static final boolean enableShadersOption = true; + private static final boolean enableShadersDebug = true; + private static final boolean saveFinalShaders = System.getProperty("shaders.debug.save", "false").equals("true"); + public static float blockLightLevel05 = 0.5F; + public static float blockLightLevel06 = 0.6F; + public static float blockLightLevel08 = 0.8F; + public static float aoLevel = -1.0F; + public static float sunPathRotation = 0.0F; + public static float shadowAngleInterval = 0.0F; + public static int fogMode = 0; + public static float fogColorR; + public static float fogColorG; + public static float fogColorB; + public static float shadowIntervalSize = 2.0F; + public static int terrainIconSize = 16; + public static int[] terrainTextureSize = new int[2]; + private static ICustomTexture noiseTexture; + private static boolean noiseTextureEnabled = false; + private static int noiseTextureResolution = 256; + static final int[] dfbColorTexturesA = new int[16]; + static final int[] colorTexturesToggle = new int[8]; + static final int[] colorTextureTextureImageUnit = new int[] {0, 1, 2, 3, 7, 8, 9, 10}; + static final boolean[][] programsToggleColorTextures = new boolean[44][8]; + private static final int bigBufferSize = 2548; + private static final ByteBuffer bigBuffer = (ByteBuffer)BufferUtils.createByteBuffer(2548).limit(0); + static final float[] faProjection = new float[16]; + static final float[] faProjectionInverse = new float[16]; + static final float[] faModelView = new float[16]; + static final float[] faModelViewInverse = new float[16]; + static final float[] faShadowProjection = new float[16]; + static final float[] faShadowProjectionInverse = new float[16]; + static final float[] faShadowModelView = new float[16]; + static final float[] faShadowModelViewInverse = new float[16]; + static final FloatBuffer projection = nextFloatBuffer(16); + static final FloatBuffer projectionInverse = nextFloatBuffer(16); + static final FloatBuffer modelView = nextFloatBuffer(16); + static final FloatBuffer modelViewInverse = nextFloatBuffer(16); + static final FloatBuffer shadowProjection = nextFloatBuffer(16); + static final FloatBuffer shadowProjectionInverse = nextFloatBuffer(16); + static final FloatBuffer shadowModelView = nextFloatBuffer(16); + static final FloatBuffer shadowModelViewInverse = nextFloatBuffer(16); + static final FloatBuffer previousProjection = nextFloatBuffer(16); + static final FloatBuffer previousModelView = nextFloatBuffer(16); + static final FloatBuffer tempMatrixDirectBuffer = nextFloatBuffer(16); + static final FloatBuffer tempDirectFloatBuffer = nextFloatBuffer(16); + static final IntBuffer dfbColorTextures = nextIntBuffer(16); + static final IntBuffer dfbDepthTextures = nextIntBuffer(3); + static final IntBuffer sfbColorTextures = nextIntBuffer(8); + static final IntBuffer sfbDepthTextures = nextIntBuffer(2); + static final IntBuffer dfbDrawBuffers = nextIntBuffer(8); + static final IntBuffer sfbDrawBuffers = nextIntBuffer(8); + static final IntBuffer drawBuffersNone = nextIntBuffer(8); + static final IntBuffer drawBuffersAll = nextIntBuffer(8); + static final IntBuffer drawBuffersClear0 = nextIntBuffer(8); + static final IntBuffer drawBuffersClear1 = nextIntBuffer(8); + static final IntBuffer drawBuffersClearColor = nextIntBuffer(8); + static final IntBuffer drawBuffersColorAtt0 = nextIntBuffer(8); + static final IntBuffer[] drawBuffersBuffer = nextIntBufferArray(44, 8); + static Map mapBlockToEntityData; + private static final String[] formatNames; + private static final int[] formatIds; + private static final Pattern patternLoadEntityDataMap; + public static int[] entityData; + public static int entityDataIndex; + + private static ByteBuffer nextByteBuffer(int size) { + ByteBuffer buffer = bigBuffer; + int pos = buffer.limit(); + buffer.position(pos).limit(pos + size); + return buffer.slice(); + } + + private static IntBuffer nextIntBuffer(int size) { + ByteBuffer buffer = bigBuffer; + int pos = buffer.limit(); + buffer.position(pos).limit(pos + size * 4); + return buffer.asIntBuffer(); + } + + private static FloatBuffer nextFloatBuffer(int size) { + ByteBuffer buffer = bigBuffer; + int pos = buffer.limit(); + buffer.position(pos).limit(pos + size * 4); + return buffer.asFloatBuffer(); + } + + private static IntBuffer[] nextIntBufferArray(int count, int size) { + IntBuffer[] aib = new IntBuffer[count]; + + for (int i = 0; i < count; ++i) { + aib[i] = nextIntBuffer(size); + } + + return aib; + } + + public static void loadConfig() { + SMCLog.info("Load ShadersMod configuration."); + + try { + if (!shaderpacksdir.exists()) { + shaderpacksdir.mkdir(); + } + } catch (Exception var8) { + SMCLog.severe("Failed to open the shaderpacks directory: " + shaderpacksdir); + } + + shadersConfig = new PropertiesOrdered(); + shadersConfig.setProperty(EnumShaderOption.SHADER_PACK.getPropertyKey(), ""); + + if (configFile.exists()) { + try { + FileReader ops = new FileReader(configFile); + shadersConfig.load(ops); + ops.close(); + } catch (Exception var7) { + ; + } + } + + if (!configFile.exists()) { + try { + storeConfig(); + } catch (Exception var6) { + ; + } + } + + EnumShaderOption[] var9 = EnumShaderOption.values(); + + for (int i = 0; i < var9.length; ++i) { + EnumShaderOption op = var9[i]; + String key = op.getPropertyKey(); + String def = op.getValueDefault(); + String val = shadersConfig.getProperty(key, def); + setEnumShaderOption(op, val); + } + + loadShaderPack(); + } + + private static void setEnumShaderOption(EnumShaderOption eso, String str) { + if (str == null) { + str = eso.getValueDefault(); + } + + switch (Shaders.NamelessClass363063280.$SwitchMap$shadersmod$client$EnumShaderOption[eso.ordinal()]) { + case 1: + configAntialiasingLevel = Config.parseInt(str, 0); + break; + + case 2: + configNormalMap = Config.parseBoolean(str, true); + break; + + case 3: + configSpecularMap = Config.parseBoolean(str, true); + break; + + case 4: + configRenderResMul = Config.parseFloat(str, 1.0F); + break; + + case 5: + configShadowResMul = Config.parseFloat(str, 1.0F); + break; + + case 6: + configHandDepthMul = Config.parseFloat(str, 0.125F); + break; + + case 7: + configCloudShadow = Config.parseBoolean(str, true); + break; + + case 8: + configOldHandLight.setPropertyValue(str); + break; + + case 9: + configOldLighting.setPropertyValue(str); + break; + + case 10: + currentshadername = str; + break; + + case 11: + configTweakBlockDamage = Config.parseBoolean(str, true); + break; + + case 12: + configShadowClipFrustrum = Config.parseBoolean(str, true); + break; + + case 13: + configTexMinFilB = Config.parseInt(str, 0); + break; + + case 14: + configTexMinFilN = Config.parseInt(str, 0); + break; + + case 15: + configTexMinFilS = Config.parseInt(str, 0); + break; + + case 16: + configTexMagFilB = Config.parseInt(str, 0); + break; + + case 17: + configTexMagFilB = Config.parseInt(str, 0); + break; + + case 18: + configTexMagFilB = Config.parseInt(str, 0); + break; + + default: + throw new IllegalArgumentException("Unknown option: " + eso); + } + } + + public static void storeConfig() { + SMCLog.info("Save ShadersMod configuration."); + + if (shadersConfig == null) { + shadersConfig = new PropertiesOrdered(); + } + + EnumShaderOption[] ops = EnumShaderOption.values(); + + for (int ex = 0; ex < ops.length; ++ex) { + EnumShaderOption op = ops[ex]; + String key = op.getPropertyKey(); + String val = getEnumShaderOption(op); + shadersConfig.setProperty(key, val); + } + + try { + FileWriter var6 = new FileWriter(configFile); + shadersConfig.store(var6, (String)null); + var6.close(); + } catch (Exception var5) { + SMCLog.severe("Error saving configuration: " + var5.getClass().getName() + ": " + var5.getMessage()); + } + } + + public static String getEnumShaderOption(EnumShaderOption eso) { + switch (Shaders.NamelessClass363063280.$SwitchMap$shadersmod$client$EnumShaderOption[eso.ordinal()]) { + case 1: + return Integer.toString(configAntialiasingLevel); + + case 2: + return Boolean.toString(configNormalMap); + + case 3: + return Boolean.toString(configSpecularMap); + + case 4: + return Float.toString(configRenderResMul); + + case 5: + return Float.toString(configShadowResMul); + + case 6: + return Float.toString(configHandDepthMul); + + case 7: + return Boolean.toString(configCloudShadow); + + case 8: + return configOldHandLight.getPropertyValue(); + + case 9: + return configOldLighting.getPropertyValue(); + + case 10: + return currentshadername; + + case 11: + return Boolean.toString(configTweakBlockDamage); + + case 12: + return Boolean.toString(configShadowClipFrustrum); + + case 13: + return Integer.toString(configTexMinFilB); + + case 14: + return Integer.toString(configTexMinFilN); + + case 15: + return Integer.toString(configTexMinFilS); + + case 16: + return Integer.toString(configTexMagFilB); + + case 17: + return Integer.toString(configTexMagFilB); + + case 18: + return Integer.toString(configTexMagFilB); + + default: + throw new IllegalArgumentException("Unknown option: " + eso); + } + } + + public static void setShaderPack(String par1name) { + currentshadername = par1name; + shadersConfig.setProperty(EnumShaderOption.SHADER_PACK.getPropertyKey(), par1name); + loadShaderPack(); + } + + public static void loadShaderPack() { + boolean shaderPackLoadedPrev = shaderPackLoaded; + boolean oldLightingPrev = isOldLighting(); + shaderPackLoaded = false; + + if (shaderPack != null) { + shaderPack.close(); + shaderPack = null; + shaderPackResources.clear(); + shaderPackDimensions.clear(); + shaderPackOptions = null; + shaderPackOptionSliders = null; + shaderPackProfiles = null; + shaderPackGuiScreens = null; + shaderPackClouds.resetValue(); + shaderPackOldHandLight.resetValue(); + shaderPackDynamicHandLight.resetValue(); + shaderPackOldLighting.resetValue(); + resetCustomTextures(); + noiseTexturePath = null; + } + + boolean shadersBlocked = false; + + if (Config.isAntialiasing()) { + SMCLog.info("Shaders can not be loaded, Antialiasing is enabled: " + Config.getAntialiasingLevel() + "x"); + shadersBlocked = true; + } + + if (Config.isAnisotropicFiltering()) { + SMCLog.info("Shaders can not be loaded, Anisotropic Filtering is enabled: " + Config.getAnisotropicFilterLevel() + "x"); + shadersBlocked = true; + } + +// if (Config.isFastRender()) { +// SMCLog.info("Shaders can not be loaded, Fast Render is enabled."); +// shadersBlocked = true; +// } + + String packName = shadersConfig.getProperty(EnumShaderOption.SHADER_PACK.getPropertyKey(), packNameDefault); + + if (!packName.isEmpty() && !packName.equals(packNameNone) && !shadersBlocked) { + if (packName.equals(packNameDefault)) { + shaderPack = new ShaderPackDefault(); + shaderPackLoaded = true; + } else { + try { + File formatChanged = new File(shaderpacksdir, packName); + + if (formatChanged.isDirectory()) { + shaderPack = new ShaderPackFolder(packName, formatChanged); + shaderPackLoaded = true; + } else if (formatChanged.isFile() && packName.toLowerCase().endsWith(".zip")) { + shaderPack = new ShaderPackZip(packName, formatChanged); + shaderPackLoaded = true; + } + } catch (Exception var6) { + ; + } + } + } + + if (shaderPack != null) { + SMCLog.info("Loaded shaderpack: " + getShaderPackName()); + } else { + SMCLog.info("No shaderpack loaded."); + shaderPack = new ShaderPackNone(); + } + + loadShaderPackResources(); + loadShaderPackDimensions(); + shaderPackOptions = loadShaderPackOptions(); + loadShaderPackProperties(); + boolean formatChanged1 = shaderPackLoaded != shaderPackLoadedPrev; + boolean oldLightingChanged = isOldLighting() != oldLightingPrev; + + if ((formatChanged1 || oldLightingChanged) && mc.entityRenderer != null) { + mc.entityRenderer.setFxaaShader(0); + mc.refreshResources(); + } + } + + private static void loadShaderPackDimensions() { + shaderPackDimensions.clear(); + + for (int ids = -128; ids <= 128; ++ids) { + String worldDir = "/shaders/world" + ids; + + if (shaderPack.hasDirectory(worldDir)) { + shaderPackDimensions.add(Integer.valueOf(ids)); + } + } + + if (shaderPackDimensions.size() > 0) { + Integer[] var2 = (Integer[])((Integer[])shaderPackDimensions.toArray(new Integer[shaderPackDimensions.size()])); + Config.dbg("[Shaders] Worlds: " + Config.arrayToString((Object[])var2)); + } + } + + private static void loadShaderPackProperties() { + shaderPackClouds.resetValue(); + shaderPackOldHandLight.resetValue(); + shaderPackDynamicHandLight.resetValue(); + shaderPackOldLighting.resetValue(); + shaderPackShadowTranslucent.resetValue(); + shaderPackUnderwaterOverlay.resetValue(); + shaderPackSun.resetValue(); + shaderPackMoon.resetValue(); + shaderPackVignette.resetValue(); + shaderPackBackFaceSolid.resetValue(); + shaderPackBackFaceCutout.resetValue(); + shaderPackBackFaceCutoutMipped.resetValue(); + shaderPackBackFaceTranslucent.resetValue(); + BlockAliases.reset(); + customUniforms = null; + LegacyUniforms.reset(); + + if (shaderPack != null) { + BlockAliases.update(shaderPack); + String path = "/shaders/shaders.properties"; + + try { + InputStream e = shaderPack.getResourceAsStream(path); + + if (e == null) { + return; + } + + PropertiesOrdered props = new PropertiesOrdered(); + props.load(e); + e.close(); + shaderPackClouds.loadFrom(props); + shaderPackOldHandLight.loadFrom(props); + shaderPackDynamicHandLight.loadFrom(props); + shaderPackOldLighting.loadFrom(props); + shaderPackShadowTranslucent.loadFrom(props); + shaderPackUnderwaterOverlay.loadFrom(props); + shaderPackSun.loadFrom(props); + shaderPackVignette.loadFrom(props); + shaderPackMoon.loadFrom(props); + shaderPackBackFaceSolid.loadFrom(props); + shaderPackBackFaceCutout.loadFrom(props); + shaderPackBackFaceCutoutMipped.loadFrom(props); + shaderPackBackFaceTranslucent.loadFrom(props); + shaderPackOptionSliders = ShaderPackParser.parseOptionSliders(props, shaderPackOptions); + shaderPackProfiles = ShaderPackParser.parseProfiles(props, shaderPackOptions); + shaderPackGuiScreens = ShaderPackParser.parseGuiScreens(props, shaderPackProfiles, shaderPackOptions); + customTexturesGbuffers = loadCustomTextures(props, 0); + customTexturesComposite = loadCustomTextures(props, 1); + customTexturesDeferred = loadCustomTextures(props, 2); + noiseTexturePath = props.getProperty("texture.noise"); + + if (noiseTexturePath != null) { + noiseTextureEnabled = true; + } + + customUniforms = ShaderPackParser.parseCustomUniforms(props); + } catch (IOException var3) { + Config.warn("[Shaders] Error reading: " + path); + } + } + } + + private static CustomTexture[] loadCustomTextures(Properties props, int stage) { + String PREFIX_TEXTURE = "texture." + STAGE_NAMES[stage] + "."; + Set keys = props.keySet(); + ArrayList list = new ArrayList(); + Iterator cts = keys.iterator(); + + while (cts.hasNext()) { + String key = (String)cts.next(); + + if (key.startsWith(PREFIX_TEXTURE)) { + String name = key.substring(PREFIX_TEXTURE.length()); + String path = props.getProperty(key).trim(); + int index = getTextureIndex(stage, name); + + if (index < 0) { + SMCLog.warning("Invalid texture name: " + key); + } else { + CustomTexture ct = loadCustomTexture(index, path); + + if (ct != null) { + list.add(ct); + } + } + } + } + + if (list.size() <= 0) { + return null; + } else { + CustomTexture[] cts1 = (CustomTexture[])((CustomTexture[])list.toArray(new CustomTexture[list.size()])); + return cts1; + } + } + + private static CustomTexture loadCustomTexture(int index, String path) { + if (path == null) { + return null; + } else { + path = path.trim(); + + if (path.indexOf(46) < 0) { + path = path + ".png"; + } + + try { + String e = "shaders/" + StrUtils.removePrefix(path, "/"); + InputStream in = shaderPack.getResourceAsStream(e); + + if (in == null) { + SMCLog.warning("Texture not found: " + path); + return null; + } else { + IOUtils.closeQuietly(in); + SimpleShaderTexture tex = new SimpleShaderTexture(e); + tex.loadTexture(mc.getResourceManager()); + CustomTexture ct = new CustomTexture(index, e, tex); + return ct; + } + } catch (IOException var6) { + SMCLog.warning("Error loading texture: " + path); + SMCLog.warning("" + var6.getClass().getName() + ": " + var6.getMessage()); + return null; + } + } + } + + private static int getTextureIndex(int stage, String name) { + if (stage == 0) { + if (name.equals("texture")) { + return 0; + } + + if (name.equals("lightmap")) { + return 1; + } + + if (name.equals("normals")) { + return 2; + } + + if (name.equals("specular")) { + return 3; + } + + if (name.equals("shadowtex0") || name.equals("watershadow")) { + return 4; + } + + if (name.equals("shadow")) { + return waterShadowEnabled ? 5 : 4; + } + + if (name.equals("shadowtex1")) { + return 5; + } + + if (name.equals("depthtex0")) { + return 6; + } + + if (name.equals("gaux1")) { + return 7; + } + + if (name.equals("gaux2")) { + return 8; + } + + if (name.equals("gaux3")) { + return 9; + } + + if (name.equals("gaux4")) { + return 10; + } + + if (name.equals("depthtex1")) { + return 12; + } + + if (name.equals("shadowcolor0") || name.equals("shadowcolor")) { + return 13; + } + + if (name.equals("shadowcolor1")) { + return 14; + } + + if (name.equals("noisetex")) { + return 15; + } + } + + if (stage == 1 || stage == 2) { + if (name.equals("colortex0") || name.equals("colortex0")) { + return 0; + } + + if (name.equals("colortex1") || name.equals("gdepth")) { + return 1; + } + + if (name.equals("colortex2") || name.equals("gnormal")) { + return 2; + } + + if (name.equals("colortex3") || name.equals("composite")) { + return 3; + } + + if (name.equals("shadowtex0") || name.equals("watershadow")) { + return 4; + } + + if (name.equals("shadow")) { + return waterShadowEnabled ? 5 : 4; + } + + if (name.equals("shadowtex1")) { + return 5; + } + + if (name.equals("depthtex0") || name.equals("gdepthtex")) { + return 6; + } + + if (name.equals("colortex4") || name.equals("gaux1")) { + return 7; + } + + if (name.equals("colortex5") || name.equals("gaux2")) { + return 8; + } + + if (name.equals("colortex6") || name.equals("gaux3")) { + return 9; + } + + if (name.equals("colortex7") || name.equals("gaux4")) { + return 10; + } + + if (name.equals("depthtex1")) { + return 11; + } + + if (name.equals("depthtex2")) { + return 12; + } + + if (name.equals("shadowcolor0") || name.equals("shadowcolor")) { + return 13; + } + + if (name.equals("shadowcolor1")) { + return 14; + } + + if (name.equals("noisetex")) { + return 15; + } + } + + return -1; + } + + private static void bindCustomTextures(CustomTexture[] cts) { + if (cts != null) { + for (int i = 0; i < cts.length; ++i) { + CustomTexture ct = cts[i]; + GlStateManager.setActiveTexture(33984 + ct.getTextureUnit()); + ITextureObject tex = ct.getTexture(); + GlStateManager.bindTexture(tex.getGlTextureId()); + } + } + } + + private static void resetCustomTextures() { + deleteCustomTextures(customTexturesGbuffers); + deleteCustomTextures(customTexturesComposite); + deleteCustomTextures(customTexturesDeferred); + customTexturesGbuffers = null; + customTexturesComposite = null; + customTexturesDeferred = null; + } + + private static void deleteCustomTextures(CustomTexture[] cts) { + if (cts != null) { + for (int i = 0; i < cts.length; ++i) { + CustomTexture ct = cts[i]; + ct.deleteTexture(); + } + } + } + + public static ShaderOption[] getShaderPackOptions(String screenName) { + ShaderOption[] ops = (ShaderOption[])shaderPackOptions.clone(); + + if (shaderPackGuiScreens == null) { + if (shaderPackProfiles != null) { + ShaderOptionProfile var9 = new ShaderOptionProfile(shaderPackProfiles, ops); + ops = (ShaderOption[])((ShaderOption[])Config.addObjectToArray(ops, var9, 0)); + } + + ops = getVisibleOptions(ops); + return ops; + } else { + String key = screenName != null ? "screen." + screenName : "screen"; + ScreenShaderOptions sso = (ScreenShaderOptions)shaderPackGuiScreens.get(key); + + if (sso == null) { + return new ShaderOption[0]; + } else { + ShaderOption[] sos = sso.getShaderOptions(); + ArrayList list = new ArrayList(); + + for (int sosExp = 0; sosExp < sos.length; ++sosExp) { + ShaderOption so = sos[sosExp]; + + if (so == null) { + list.add((Object)null); + } else if (so instanceof ShaderOptionRest) { + ShaderOption[] restOps = getShaderOptionsRest(shaderPackGuiScreens, ops); + list.addAll(Arrays.asList(restOps)); + } else { + list.add(so); + } + } + + ShaderOption[] var10 = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + return var10; + } + } + } + + public static int getShaderPackColumns(String screenName, int def) { + String key = screenName != null ? "screen." + screenName : "screen"; + + if (shaderPackGuiScreens == null) { + return def; + } else { + ScreenShaderOptions sso = (ScreenShaderOptions)shaderPackGuiScreens.get(key); + return sso == null ? def : sso.getColumns(); + } + } + + private static ShaderOption[] getShaderOptionsRest(Map mapScreens, ShaderOption[] ops) { + HashSet setNames = new HashSet(); + Set keys = mapScreens.keySet(); + Iterator list = keys.iterator(); + + while (list.hasNext()) { + String sos = (String)list.next(); + ScreenShaderOptions so = (ScreenShaderOptions)mapScreens.get(sos); + ShaderOption[] name = so.getShaderOptions(); + + for (int v = 0; v < name.length; ++v) { + ShaderOption so1 = name[v]; + + if (so1 != null) { + setNames.add(so1.getName()); + } + } + } + + ArrayList var10 = new ArrayList(); + + for (int var11 = 0; var11 < ops.length; ++var11) { + ShaderOption var13 = ops[var11]; + + if (var13.isVisible()) { + String var14 = var13.getName(); + + if (!setNames.contains(var14)) { + var10.add(var13); + } + } + } + + ShaderOption[] var12 = (ShaderOption[])((ShaderOption[])var10.toArray(new ShaderOption[var10.size()])); + return var12; + } + + public static ShaderOption getShaderOption(String name) { + return ShaderUtils.getShaderOption(name, shaderPackOptions); + } + + public static ShaderOption[] getShaderPackOptions() { + return shaderPackOptions; + } + + public static boolean isShaderPackOptionSlider(String name) { + return shaderPackOptionSliders == null ? false : shaderPackOptionSliders.contains(name); + } + + private static ShaderOption[] getVisibleOptions(ShaderOption[] ops) { + ArrayList list = new ArrayList(); + + for (int sos = 0; sos < ops.length; ++sos) { + ShaderOption so = ops[sos]; + + if (so.isVisible()) { + list.add(so); + } + } + + ShaderOption[] var4 = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + return var4; + } + + public static void saveShaderPackOptions() { + saveShaderPackOptions(shaderPackOptions, shaderPack); + } + + private static void saveShaderPackOptions(ShaderOption[] sos, IShaderPack sp) { + Properties props = new Properties(); + + if (shaderPackOptions != null) { + for (int e = 0; e < sos.length; ++e) { + ShaderOption so = sos[e]; + + if (so.isChanged() && so.isEnabled()) { + props.setProperty(so.getName(), so.getValue()); + } + } + } + + try { + saveOptionProperties(sp, props); + } catch (IOException var5) { + Config.warn("[Shaders] Error saving configuration for " + shaderPack.getName()); + var5.printStackTrace(); + } + } + + private static void saveOptionProperties(IShaderPack sp, Properties props) throws IOException { + String path = shaderpacksdirname + "/" + sp.getName() + ".txt"; + File propFile = new File(Minecraft.getMinecraft().mcDataDir, path); + + if (props.isEmpty()) { + propFile.delete(); + } else { + FileOutputStream fos = new FileOutputStream(propFile); + props.store(fos, (String)null); + fos.flush(); + fos.close(); + } + } + + private static ShaderOption[] loadShaderPackOptions() { + try { + ShaderOption[] e = ShaderPackParser.parseShaderPackOptions(shaderPack, programNames, shaderPackDimensions); + Properties props = loadOptionProperties(shaderPack); + + for (int i = 0; i < e.length; ++i) { + ShaderOption so = e[i]; + String val = props.getProperty(so.getName()); + + if (val != null) { + so.resetValue(); + + if (!so.setValue(val)) { + Config.warn("[Shaders] Invalid value, option: " + so.getName() + ", value: " + val); + } + } + } + + return e; + } catch (IOException var5) { + Config.warn("[Shaders] Error reading configuration for " + shaderPack.getName()); + var5.printStackTrace(); + return null; + } + } + + private static Properties loadOptionProperties(IShaderPack sp) throws IOException { + Properties props = new Properties(); + String path = shaderpacksdirname + "/" + sp.getName() + ".txt"; + File propFile = new File(Minecraft.getMinecraft().mcDataDir, path); + + if (propFile.exists() && propFile.isFile() && propFile.canRead()) { + FileInputStream fis = new FileInputStream(propFile); + props.load(fis); + fis.close(); + return props; + } else { + return props; + } + } + + public static ShaderOption[] getChangedOptions(ShaderOption[] ops) { + ArrayList list = new ArrayList(); + + for (int cops = 0; cops < ops.length; ++cops) { + ShaderOption op = ops[cops]; + + if (op.isEnabled() && op.isChanged()) { + list.add(op); + } + } + + ShaderOption[] var4 = (ShaderOption[])((ShaderOption[])list.toArray(new ShaderOption[list.size()])); + return var4; + } + + private static String applyOptions(String line, ShaderOption[] ops) { + if (ops != null && ops.length > 0) { + for (int i = 0; i < ops.length; ++i) { + ShaderOption op = ops[i]; + String opName = op.getName(); + + if (op.matchesLine(line)) { + line = op.getSourceLine(); + break; + } + } + + return line; + } else { + return line; + } + } + + static ArrayList listOfShaders() { + ArrayList list = new ArrayList(); + list.add(packNameNone); + list.add(packNameDefault); + + try { + if (!shaderpacksdir.exists()) { + shaderpacksdir.mkdir(); + } + + File[] e = shaderpacksdir.listFiles(); + + for (int i = 0; i < e.length; ++i) { + File file = e[i]; + String name = file.getName(); + + if (file.isDirectory()) { + if (!name.equals("debug")) { + File subDir = new File(file, "shaders"); + + if (subDir.exists() && subDir.isDirectory()) { + list.add(name); + } + } + } else if (file.isFile() && name.toLowerCase().endsWith(".zip")) { + list.add(name); + } + } + } catch (Exception var6) { + ; + } + + return list; + } + + static String versiontostring(int vv) { + String vs = Integer.toString(vv); + return Integer.toString(Integer.parseInt(vs.substring(1, 3))) + "." + Integer.toString(Integer.parseInt(vs.substring(3, 5))) + "." + Integer.toString(Integer.parseInt(vs.substring(5))); + } + + static void checkOptifine() {} + + public static int checkFramebufferStatus(String location) { + int status = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (status != 36053) { + System.err.format("FramebufferStatus 0x%04X at %s\n", new Object[] {Integer.valueOf(status), location}); + } + + return status; + } + + public static int checkGLError(String location) { + int errorCode = GL11.glGetError(); + + if (errorCode != 0) { + boolean skipPrint = false; + + if (!skipPrint) { + if (errorCode == 1286) { + int status = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + System.err.format("GL error 0x%04X: %s (Fb status 0x%04X) at %s\n", new Object[] {Integer.valueOf(errorCode), GLU.gluErrorString(errorCode), Integer.valueOf(status), location}); + } else { + System.err.format("GL error 0x%04X: %s at %s\n", new Object[] {Integer.valueOf(errorCode), GLU.gluErrorString(errorCode), location}); + } + } + } + + return errorCode; + } + + public static int checkGLError(String location, String info) { + int errorCode = GL11.glGetError(); + + if (errorCode != 0) { + System.err.format("GL error 0x%04x: %s at %s %s\n", new Object[] {Integer.valueOf(errorCode), GLU.gluErrorString(errorCode), location, info}); + } + + return errorCode; + } + + public static int checkGLError(String location, String info1, String info2) { + int errorCode = GL11.glGetError(); + + if (errorCode != 0) { + System.err.format("GL error 0x%04x: %s at %s %s %s\n", new Object[] {Integer.valueOf(errorCode), GLU.gluErrorString(errorCode), location, info1, info2}); + } + + return errorCode; + } + + private static void printChat(String str) { + mc.ingameGUI.getChatGUI().func_146227_a(new ChatComponentText(str)); + } + + private static void printChatAndLogError(String str) { + SMCLog.severe(str); + mc.ingameGUI.getChatGUI().func_146227_a(new ChatComponentText(str)); + } + + public static void printIntBuffer(String title, IntBuffer buf) { + StringBuilder sb = new StringBuilder(128); + sb.append(title).append(" [pos ").append(buf.position()).append(" lim ").append(buf.limit()).append(" cap ").append(buf.capacity()).append(" :"); + int lim = buf.limit(); + + for (int i = 0; i < lim; ++i) { + sb.append(" ").append(buf.get(i)); + } + + sb.append("]"); + SMCLog.info(sb.toString()); + } + + public static void startup(Minecraft mcIn) { + checkShadersModInstalled(); + mc = mcIn; + mc = Minecraft.getMinecraft(); + capabilities = GLContext.getCapabilities(); + glVersionString = GL11.glGetString(GL11.GL_VERSION); + glVendorString = GL11.glGetString(GL11.GL_VENDOR); + glRendererString = GL11.glGetString(GL11.GL_RENDERER); + SMCLog.info("ShadersMod version: 2.4.12"); + SMCLog.info("OpenGL Version: " + glVersionString); + SMCLog.info("Vendor: " + glVendorString); + SMCLog.info("Renderer: " + glRendererString); + SMCLog.info("Capabilities: " + (capabilities.OpenGL20 ? " 2.0 " : " - ") + (capabilities.OpenGL21 ? " 2.1 " : " - ") + (capabilities.OpenGL30 ? " 3.0 " : " - ") + (capabilities.OpenGL32 ? " 3.2 " : " - ") + (capabilities.OpenGL40 ? " 4.0 " : " - ")); + SMCLog.info("GL_MAX_DRAW_BUFFERS: " + GL11.glGetInteger(GL20.GL_MAX_DRAW_BUFFERS)); + SMCLog.info("GL_MAX_COLOR_ATTACHMENTS_EXT: " + GL11.glGetInteger(36063)); + SMCLog.info("GL_MAX_TEXTURE_IMAGE_UNITS: " + GL11.glGetInteger(GL20.GL_MAX_TEXTURE_IMAGE_UNITS)); + hasGlGenMipmap = capabilities.OpenGL30; + loadConfig(); + } + + private static String toStringYN(boolean b) { + return b ? "Y" : "N"; + } + + public static void updateBlockLightLevel() { + if (isOldLighting()) { + blockLightLevel05 = 0.5F; + blockLightLevel06 = 0.6F; + blockLightLevel08 = 0.8F; + } else { + blockLightLevel05 = 1.0F; + blockLightLevel06 = 1.0F; + blockLightLevel08 = 1.0F; + } + } + + public static boolean isOldHandLight() { + return !configOldHandLight.isDefault() ? configOldHandLight.isTrue() : (!shaderPackOldHandLight.isDefault() ? shaderPackOldHandLight.isTrue() : true); + } + + public static boolean isDynamicHandLight() { + return !shaderPackDynamicHandLight.isDefault() ? shaderPackDynamicHandLight.isTrue() : true; + } + + public static boolean isOldLighting() { + return !configOldLighting.isDefault() ? configOldLighting.isTrue() : (!shaderPackOldLighting.isDefault() ? shaderPackOldLighting.isTrue() : true); + } + + public static boolean isRenderShadowTranslucent() { + return !shaderPackShadowTranslucent.isFalse(); + } + + public static boolean isUnderwaterOverlay() { + return !shaderPackUnderwaterOverlay.isFalse(); + } + + public static boolean isSun() { + return !shaderPackSun.isFalse(); + } + + public static boolean isMoon() { + return !shaderPackMoon.isFalse(); + } + + public static boolean isVignette() { + return !shaderPackVignette.isFalse(); + } + + public static void init() { + boolean firstInit; + + if (!isInitializedOnce) { + isInitializedOnce = true; + firstInit = true; + } else { + firstInit = false; + } + + if (!isShaderPackInitialized) { + checkGLError("Shaders.init pre"); + + if (getShaderPackName() != null) { + ; + } + + if (!capabilities.OpenGL20) { + printChatAndLogError("No OpenGL 2.0"); + } + + if (!capabilities.GL_EXT_framebuffer_object) { + printChatAndLogError("No EXT_framebuffer_object"); + } + + dfbDrawBuffers.position(0).limit(8); + dfbColorTextures.position(0).limit(16); + dfbDepthTextures.position(0).limit(3); + sfbDrawBuffers.position(0).limit(8); + sfbDepthTextures.position(0).limit(2); + sfbColorTextures.position(0).limit(8); + usedColorBuffers = 4; + usedDepthBuffers = 1; + usedShadowColorBuffers = 0; + usedShadowDepthBuffers = 0; + usedColorAttachs = 1; + usedDrawBuffers = 1; + Arrays.fill(gbuffersFormat, 6408); + Arrays.fill(gbuffersClear, true); + Arrays.fill(shadowHardwareFilteringEnabled, false); + Arrays.fill(shadowMipmapEnabled, false); + Arrays.fill(shadowFilterNearest, false); + Arrays.fill(shadowColorMipmapEnabled, false); + Arrays.fill(shadowColorFilterNearest, false); + centerDepthSmoothEnabled = false; + noiseTextureEnabled = false; + sunPathRotation = 0.0F; + shadowIntervalSize = 2.0F; + shadowMapWidth = 1024; + shadowMapHeight = 1024; + spShadowMapWidth = 1024; + spShadowMapHeight = 1024; + shadowMapFOV = 90.0F; + shadowMapHalfPlane = 160.0F; + shadowMapIsOrtho = true; + shadowDistanceRenderMul = -1.0F; + aoLevel = -1.0F; + useEntityAttrib = false; + useMidTexCoordAttrib = false; + useMultiTexCoord3Attrib = false; + useTangentAttrib = false; + waterShadowEnabled = false; + updateChunksErrorRecorded = false; + updateBlockLightLevel(); + Smoother.reset(); + LegacyUniforms.reset(); + ShaderProfile activeProfile = ShaderUtils.detectProfile(shaderPackProfiles, shaderPackOptions, false); + String worldPrefix = ""; + int maxDrawBuffers; + + if (currentWorld != null) { + maxDrawBuffers = currentWorld.provider.dimensionId; + + if (shaderPackDimensions.contains(Integer.valueOf(maxDrawBuffers))) { + worldPrefix = "world" + maxDrawBuffers + "/"; + } + } + + if (saveFinalShaders) { + clearDirectory(new File(shaderpacksdir, "debug")); + } + + String n; + + for (maxDrawBuffers = 0; maxDrawBuffers < 44; ++maxDrawBuffers) { + String drawBuffersMap = programNames[maxDrawBuffers]; + + if (drawBuffersMap.equals("")) { + programsID[maxDrawBuffers] = programsRef[maxDrawBuffers] = 0; + programsDrawBufSettings[maxDrawBuffers] = null; + programsColorAtmSettings[maxDrawBuffers] = null; + programsCompositeMipmapSetting[maxDrawBuffers] = 0; + } else { + newDrawBufSetting = null; + newColorAtmSetting = null; + newCompositeMipmapSetting = 0; + String i = worldPrefix + drawBuffersMap; + + if (activeProfile != null && activeProfile.isProgramDisabled(i)) { + SMCLog.info("Program disabled: " + i); + drawBuffersMap = ""; + i = worldPrefix + drawBuffersMap; + } + + n = "/shaders/" + i; + int intbuf = setupProgram(maxDrawBuffers, n + ".vsh", n + ".fsh"); + + if (intbuf > 0) { + SMCLog.info("Program loaded: " + i); + } + + programsID[maxDrawBuffers] = programsRef[maxDrawBuffers] = intbuf; + programsDrawBufSettings[maxDrawBuffers] = intbuf != 0 ? newDrawBufSetting : null; + programsColorAtmSettings[maxDrawBuffers] = intbuf != 0 ? newColorAtmSetting : null; + programsCompositeMipmapSetting[maxDrawBuffers] = intbuf != 0 ? newCompositeMipmapSetting : 0; + } + } + + maxDrawBuffers = GL11.glGetInteger(GL20.GL_MAX_DRAW_BUFFERS); + new HashMap(); + int var12; + + for (var12 = 0; var12 < 44; ++var12) { + Arrays.fill(programsToggleColorTextures[var12], false); + + if (var12 == 29) { + programsDrawBuffers[var12] = null; + } else if (programsID[var12] == 0) { + if (var12 == 30) { + programsDrawBuffers[var12] = drawBuffersNone; + } else { + programsDrawBuffers[var12] = drawBuffersColorAtt0; + } + } else { + n = programsDrawBufSettings[var12]; + + if (n != null) { + IntBuffer var14 = drawBuffersBuffer[var12]; + int numDB = n.length(); + + if (numDB > usedDrawBuffers) { + usedDrawBuffers = numDB; + } + + if (numDB > maxDrawBuffers) { + numDB = maxDrawBuffers; + } + + programsDrawBuffers[var12] = var14; + var14.limit(numDB); + + for (int i1 = 0; i1 < numDB; ++i1) { + int drawBuffer = 0; + + if (n.length() > i1) { + int ca = n.charAt(i1) - 48; + + if (var12 != 30) { + if (ca >= 0 && ca <= 7) { + programsToggleColorTextures[var12][ca] = true; + drawBuffer = ca + 36064; + + if (ca > usedColorAttachs) { + usedColorAttachs = ca; + } + + if (ca > usedColorBuffers) { + usedColorBuffers = ca; + } + } + } else if (ca >= 0 && ca <= 1) { + drawBuffer = ca + 36064; + + if (ca > usedShadowColorBuffers) { + usedShadowColorBuffers = ca; + } + } + } + + var14.put(i1, drawBuffer); + } + } else if (var12 != 30 && var12 != 31 && var12 != 32) { + programsDrawBuffers[var12] = dfbDrawBuffers; + usedDrawBuffers = usedColorBuffers; + Arrays.fill(programsToggleColorTextures[var12], 0, usedColorBuffers, true); + } else { + programsDrawBuffers[var12] = sfbDrawBuffers; + } + } + } + + hasDeferredPrograms = false; + + for (var12 = 0; var12 < 8; ++var12) { + if (programsID[33 + var12] != 0) { + hasDeferredPrograms = true; + break; + } + } + + usedColorAttachs = usedColorBuffers; + shadowPassInterval = usedShadowDepthBuffers > 0 ? 1 : 0; + shouldSkipDefaultShadow = usedShadowDepthBuffers > 0; + SMCLog.info("usedColorBuffers: " + usedColorBuffers); + SMCLog.info("usedDepthBuffers: " + usedDepthBuffers); + SMCLog.info("usedShadowColorBuffers: " + usedShadowColorBuffers); + SMCLog.info("usedShadowDepthBuffers: " + usedShadowDepthBuffers); + SMCLog.info("usedColorAttachs: " + usedColorAttachs); + SMCLog.info("usedDrawBuffers: " + usedDrawBuffers); + dfbDrawBuffers.position(0).limit(usedDrawBuffers); + dfbColorTextures.position(0).limit(usedColorBuffers * 2); + + for (var12 = 0; var12 < usedDrawBuffers; ++var12) { + dfbDrawBuffers.put(var12, 36064 + var12); + } + + if (usedDrawBuffers > maxDrawBuffers) { + printChatAndLogError("[Shaders] Error: Not enough draw buffers, needed: " + usedDrawBuffers + ", available: " + maxDrawBuffers); + } + + sfbDrawBuffers.position(0).limit(usedShadowColorBuffers); + + for (var12 = 0; var12 < usedShadowColorBuffers; ++var12) { + sfbDrawBuffers.put(var12, 36064 + var12); + } + + for (var12 = 0; var12 < 44; ++var12) { + int var13; + + for (var13 = var12; programsID[var13] == 0 && programBackups[var13] != var13; var13 = programBackups[var13]) { + ; + } + + if (var13 != var12 && var12 != 30) { + programsID[var12] = programsID[var13]; + programsDrawBufSettings[var12] = programsDrawBufSettings[var13]; + programsDrawBuffers[var12] = programsDrawBuffers[var13]; + } + } + + resize(); + resizeShadow(); + + if (noiseTextureEnabled) { + setupNoiseTexture(); + } + + if (defaultTexture == null) { + defaultTexture = ShadersTex.createDefaultTexture(); + } + + GlStateManager.pushMatrix(); + GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); + preCelestialRotate(); + postCelestialRotate(); + GlStateManager.popMatrix(); + isShaderPackInitialized = true; + loadEntityDataMap(); + resetDisplayList(); + + if (!firstInit) { + ; + } + + checkGLError("Shaders.init"); + } + } + + public static void resetDisplayList() { + ++numberResetDisplayList; + needResetModels = true; + SMCLog.info("Reset world renderers"); + mc.renderGlobal.loadRenderers(); + } + + public static void resetDisplayListModels() { + if (needResetModels) { + needResetModels = false; + SMCLog.info("Reset model renderers"); + Iterator it = RenderManager.instance.getEntityRenderMap().values().iterator(); + + while (it.hasNext()) { + Render ren = (Render)it.next(); + + if (ren instanceof RendererLivingEntity) { + RendererLivingEntity rle = (RendererLivingEntity)ren; + resetDisplayListModel(rle.mainModel); + } + } + } + } + + public static void resetDisplayListModel(ModelBase model) { + if (model != null) { + Iterator it = model.boxList.iterator(); + + while (it.hasNext()) { + Object obj = it.next(); + + if (obj instanceof ModelRenderer) { + resetDisplayListModelRenderer((ModelRenderer)obj); + } + } + } + } + + public static void resetDisplayListModelRenderer(ModelRenderer mrr) { + mrr.resetDisplayList(); + + if (mrr.childModels != null) { + int i = 0; + + for (int n = mrr.childModels.size(); i < n; ++i) { + resetDisplayListModelRenderer((ModelRenderer)mrr.childModels.get(i)); + } + } + } + + private static int setupProgram(int program, String vShaderPath, String fShaderPath) { + checkGLError("pre setupProgram"); + int programid = ARBShaderObjects.glCreateProgramObjectARB(); + checkGLError("create"); + + if (programid != 0) { + progUseEntityAttrib = false; + progUseMidTexCoordAttrib = false; + progUseTangentAttrib = false; + int vShader = createVertShader(vShaderPath); + int fShader = createFragShader(fShaderPath); + checkGLError("create"); + + if (vShader == 0 && fShader == 0) { + ARBShaderObjects.glDeleteObjectARB(programid); + programid = 0; + } else { + if (vShader != 0) { + ARBShaderObjects.glAttachObjectARB(programid, vShader); + checkGLError("attach"); + } + + if (fShader != 0) { + ARBShaderObjects.glAttachObjectARB(programid, fShader); + checkGLError("attach"); + } + + if (progUseEntityAttrib) { + ARBVertexShader.glBindAttribLocationARB(programid, entityAttrib, "mc_Entity"); + checkGLError("mc_Entity"); + } + + if (progUseMidTexCoordAttrib) { + ARBVertexShader.glBindAttribLocationARB(programid, midTexCoordAttrib, "mc_midTexCoord"); + checkGLError("mc_midTexCoord"); + } + + if (progUseTangentAttrib) { + ARBVertexShader.glBindAttribLocationARB(programid, tangentAttrib, "at_tangent"); + checkGLError("at_tangent"); + } + + ARBShaderObjects.glLinkProgramARB(programid); + + if (GL20.glGetProgrami(programid, 35714) != 1) { + SMCLog.severe("Error linking program: " + programid); + } + + printLogInfo(programid, vShaderPath + ", " + fShaderPath); + + if (vShader != 0) { + ARBShaderObjects.glDetachObjectARB(programid, vShader); + ARBShaderObjects.glDeleteObjectARB(vShader); + } + + if (fShader != 0) { + ARBShaderObjects.glDetachObjectARB(programid, fShader); + ARBShaderObjects.glDeleteObjectARB(fShader); + } + + programsID[program] = programid; + useProgram(program); + ARBShaderObjects.glValidateProgramARB(programid); + useProgram(0); + printLogInfo(programid, vShaderPath + ", " + fShaderPath); + int valid = GL20.glGetProgrami(programid, 35715); + + if (valid != 1) { + String Q = "\""; + printChatAndLogError("[Shaders] Error: Invalid program " + Q + programNames[program] + Q); + ARBShaderObjects.glDeleteObjectARB(programid); + programid = 0; + } + } + } + + return programid; + } + + private static int createVertShader(String filename) { + int vertShader = ARBShaderObjects.glCreateShaderObjectARB(ARBVertexShader.GL_VERTEX_SHADER_ARB); + + if (vertShader == 0) { + return 0; + } else { + StringBuilder vertexCode = new StringBuilder(131072); + BufferedReader reader = null; + + try { + reader = new BufferedReader(getShaderReader(filename)); + } catch (Exception var8) { + ARBShaderObjects.glDeleteObjectARB(vertShader); + return 0; + } + + ShaderOption[] activeOptions = getChangedOptions(shaderPackOptions); + ArrayList listFiles = new ArrayList(); + + if (reader != null) { + try { + reader = ShaderPackParser.resolveIncludes(reader, filename, shaderPack, 0, listFiles, 0); + + while (true) { + String e = reader.readLine(); + + if (e == null) { + reader.close(); + break; + } + + e = applyOptions(e, activeOptions); + vertexCode.append(e).append('\n'); + ShaderLine sl = ShaderParser.parseLine(e); + + if (sl != null) { + if (sl.isAttribute("mc_Entity")) { + useEntityAttrib = true; + progUseEntityAttrib = true; + } else if (sl.isAttribute("mc_midTexCoord")) { + useMidTexCoordAttrib = true; + progUseMidTexCoordAttrib = true; + } else if (e.contains("gl_MultiTexCoord3")) { + useMultiTexCoord3Attrib = true; + } else if (sl.isAttribute("at_tangent")) { + useTangentAttrib = true; + progUseTangentAttrib = true; + } + } + } + } catch (Exception var9) { + SMCLog.severe("Couldn\'t read " + filename + "!"); + var9.printStackTrace(); + ARBShaderObjects.glDeleteObjectARB(vertShader); + return 0; + } + } + + if (saveFinalShaders) { + saveShader(filename, vertexCode.toString()); + } + + ARBShaderObjects.glShaderSourceARB(vertShader, vertexCode); + ARBShaderObjects.glCompileShaderARB(vertShader); + + if (GL20.glGetShaderi(vertShader, 35713) != 1) { + SMCLog.severe("Error compiling vertex shader: " + filename); + } + + printShaderLogInfo(vertShader, filename, listFiles); + return vertShader; + } + } + + private static int createFragShader(String filename) { + int fragShader = ARBShaderObjects.glCreateShaderObjectARB(ARBFragmentShader.GL_FRAGMENT_SHADER_ARB); + + if (fragShader == 0) { + return 0; + } else { + StringBuilder fragCode = new StringBuilder(131072); + BufferedReader reader = null; + + try { + reader = new BufferedReader(getShaderReader(filename)); + } catch (Exception var12) { + ARBShaderObjects.glDeleteObjectARB(fragShader); + return 0; + } + + ShaderOption[] activeOptions = getChangedOptions(shaderPackOptions); + ArrayList listFiles = new ArrayList(); + + if (reader != null) { + try { + reader = ShaderPackParser.resolveIncludes(reader, filename, shaderPack, 0, listFiles, 0); + + while (true) { + String e = reader.readLine(); + + if (e == null) { + reader.close(); + break; + } + + e = applyOptions(e, activeOptions); + fragCode.append(e).append('\n'); + ShaderLine sl = ShaderParser.parseLine(e); + + if (sl != null) { + String val; + int bufferindex; + + if (sl.isUniform()) { + val = sl.getName(); + + if ((bufferindex = ShaderParser.getShadowDepthIndex(val)) >= 0) { + usedShadowDepthBuffers = Math.max(usedShadowDepthBuffers, bufferindex + 1); + } else if ((bufferindex = ShaderParser.getShadowColorIndex(val)) >= 0) { + usedShadowColorBuffers = Math.max(usedShadowColorBuffers, bufferindex + 1); + } else if ((bufferindex = ShaderParser.getDepthIndex(val)) >= 0) { + usedDepthBuffers = Math.max(usedDepthBuffers, bufferindex + 1); + } else if (val.equals("gdepth") && gbuffersFormat[1] == 6408) { + gbuffersFormat[1] = 34836; + } else if ((bufferindex = ShaderParser.getColorIndex(val)) >= 0) { + usedColorBuffers = Math.max(usedColorBuffers, bufferindex + 1); + } else if (val.equals("centerDepthSmooth")) { + centerDepthSmoothEnabled = true; + } + } else if (!sl.isConstInt("shadowMapResolution") && !sl.isProperty("SHADOWRES")) { + if (!sl.isConstFloat("shadowMapFov") && !sl.isProperty("SHADOWFOV")) { + if (!sl.isConstFloat("shadowDistance") && !sl.isProperty("SHADOWHPL")) { + if (sl.isConstFloat("shadowDistanceRenderMul")) { + shadowDistanceRenderMul = sl.getValueFloat(); + SMCLog.info("Shadow distance render mul: " + shadowDistanceRenderMul); + } + else if (sl.isConstFloat("shadowIntervalSize")) { + shadowIntervalSize = sl.getValueFloat(); + SMCLog.info("Shadow map interval size: " + shadowIntervalSize); + } + else if (sl.isConstBool("generateShadowMipmap", true)) { + Arrays.fill(shadowMipmapEnabled, true); + SMCLog.info("Generate shadow mipmap"); + } + else if (sl.isConstBool("generateShadowColorMipmap", true)) { + Arrays.fill(shadowColorMipmapEnabled, true); + SMCLog.info("Generate shadow color mipmap"); + } + else if (sl.isConstBool("shadowHardwareFiltering", true)) { + Arrays.fill(shadowHardwareFilteringEnabled, true); + SMCLog.info("Hardware shadow filtering enabled."); + } + else if (sl.isConstBool("shadowHardwareFiltering0", true)) { + shadowHardwareFilteringEnabled[0] = true; + SMCLog.info("shadowHardwareFiltering0"); + } + else if (sl.isConstBool("shadowHardwareFiltering1", true)) { + shadowHardwareFilteringEnabled[1] = true; + SMCLog.info("shadowHardwareFiltering1"); + } + else if (sl.isConstBool("shadowtex0Mipmap", "shadowtexMipmap", true)) { + shadowMipmapEnabled[0] = true; + SMCLog.info("shadowtex0Mipmap"); + } + else if (sl.isConstBool("shadowtex1Mipmap", true)) { + shadowMipmapEnabled[1] = true; + SMCLog.info("shadowtex1Mipmap"); + } + else if (sl.isConstBool("shadowcolor0Mipmap", "shadowColor0Mipmap", true)) { + shadowColorMipmapEnabled[0] = true; + SMCLog.info("shadowcolor0Mipmap"); + } + else if (sl.isConstBool("shadowcolor1Mipmap", "shadowColor1Mipmap", true)) { + shadowColorMipmapEnabled[1] = true; + SMCLog.info("shadowcolor1Mipmap"); + } + else if (sl.isConstBool("shadowtex0Nearest", "shadowtexNearest", "shadow0MinMagNearest", true)) { + shadowFilterNearest[0] = true; + SMCLog.info("shadowtex0Nearest"); + } + else if (sl.isConstBool("shadowtex1Nearest", "shadow1MinMagNearest", true)) { + shadowFilterNearest[1] = true; + SMCLog.info("shadowtex1Nearest"); + } + else if (sl.isConstBool("shadowcolor0Nearest", "shadowColor0Nearest", "shadowColor0MinMagNearest", true)) { + shadowColorFilterNearest[0] = true; + SMCLog.info("shadowcolor0Nearest"); + } + else if (sl.isConstBool("shadowcolor1Nearest", "shadowColor1Nearest", "shadowColor1MinMagNearest", true)) { + shadowColorFilterNearest[1] = true; + SMCLog.info("shadowcolor1Nearest"); + } + else if (!sl.isConstFloat("wetnessHalflife") && !sl.isProperty("WETNESSHL")) { + if (!sl.isConstFloat("drynessHalflife") && !sl.isProperty("DRYNESSHL")) + { + if (sl.isConstFloat("eyeBrightnessHalflife")) { + eyeBrightnessHalflife = sl.getValueFloat(); + SMCLog.info("Eye brightness halflife: " + eyeBrightnessHalflife); + } + else if (sl.isConstFloat("centerDepthHalflife")) { + centerDepthSmoothHalflife = sl.getValueFloat(); + SMCLog.info("Center depth halflife: " + centerDepthSmoothHalflife); + } + else if (sl.isConstFloat("sunPathRotation")) { + sunPathRotation = sl.getValueFloat(); + SMCLog.info("Sun path rotation: " + sunPathRotation); + } + else if (sl.isConstFloat("ambientOcclusionLevel")) { + aoLevel = Config.limit(sl.getValueFloat(), 0.0F, 1.0F); + SMCLog.info("AO Level: " + aoLevel); + } + else if (sl.isConstInt("superSamplingLevel")) { + int val1 = sl.getValueInt(); + + if (val1 > 1) { + SMCLog.info("Super sampling level: " + val1 + "x"); + superSamplingLevel = val1; + } + else { + superSamplingLevel = 1; + } + } + else if (sl.isConstInt("noiseTextureResolution")) { + noiseTextureResolution = sl.getValueInt(); + noiseTextureEnabled = true; + SMCLog.info("Noise texture enabled"); + SMCLog.info("Noise texture resolution: " + noiseTextureResolution); + } + else if (sl.isConstIntSuffix("Format")) { + val = StrUtils.removeSuffix(sl.getName(), "Format"); + String bufferindex2 = sl.getValue(); + int bufferindex1 = getBufferIndexFromString(val); + int format = getTextureFormatFromString(bufferindex2); + + if (bufferindex1 >= 0 && format != 0) { + gbuffersFormat[bufferindex1] = format; + SMCLog.info("%s format: %s", new Object[] {val, bufferindex2}); + } + } + else if (sl.isConstBoolSuffix("Clear", false)) { + if (ShaderParser.isComposite(filename) || ShaderParser.isDeferred(filename)) { + val = StrUtils.removeSuffix(sl.getName(), "Clear"); + bufferindex = getBufferIndexFromString(val); + + if (bufferindex >= 0) { + gbuffersClear[bufferindex] = false; + SMCLog.info("%s clear disabled", new Object[] {val}); + } + } + } + else if (sl.isProperty("GAUX4FORMAT", "RGBA32F")) { + gbuffersFormat[7] = 34836; + SMCLog.info("gaux4 format : RGB32AF"); + } + else if (sl.isProperty("GAUX4FORMAT", "RGB32F")) { + gbuffersFormat[7] = 34837; + SMCLog.info("gaux4 format : RGB32F"); + } + else if (sl.isProperty("GAUX4FORMAT", "RGB16")) { + gbuffersFormat[7] = 32852; + SMCLog.info("gaux4 format : RGB16"); + } + else if (sl.isConstBoolSuffix("MipmapEnabled", true)) { + if (ShaderParser.isComposite(filename) || ShaderParser.isDeferred(filename) || ShaderParser.isFinal(filename)) { + val = StrUtils.removeSuffix(sl.getName(), "MipmapEnabled"); + bufferindex = getBufferIndexFromString(val); + + if (bufferindex >= 0) { + newCompositeMipmapSetting |= 1 << bufferindex; + SMCLog.info("%s mipmap enabled", new Object[] {val}); + } + } + } + else if (sl.isProperty("DRAWBUFFERS")) { + val = sl.getValue(); + + if (ShaderParser.isValidDrawBuffers(val)) { + newDrawBufSetting = val; + } + else { + SMCLog.warning("Invalid draw buffers: " + val); + } + } + } + else + { + drynessHalfLife = sl.getValueFloat(); + SMCLog.info("Dryness halflife: " + drynessHalfLife); + } + } + else { + wetnessHalfLife = sl.getValueFloat(); + SMCLog.info("Wetness halflife: " + wetnessHalfLife); + } + } + else { + shadowMapHalfPlane = sl.getValueFloat(); + shadowMapIsOrtho = true; + SMCLog.info("Shadow map distance: " + shadowMapHalfPlane); + } + } else { + shadowMapFOV = sl.getValueFloat(); + shadowMapIsOrtho = false; + SMCLog.info("Shadow map field of view: " + shadowMapFOV); + } + } else { + spShadowMapWidth = spShadowMapHeight = sl.getValueInt(); + shadowMapWidth = shadowMapHeight = Math.round((float)spShadowMapWidth * configShadowResMul); + SMCLog.info("Shadow map resolution: " + spShadowMapWidth); + } + } + } + } catch (Exception var13) { + SMCLog.severe("Couldn\'t read " + filename + "!"); + var13.printStackTrace(); + ARBShaderObjects.glDeleteObjectARB(fragShader); + return 0; + } + } + + if (saveFinalShaders) { + saveShader(filename, fragCode.toString()); + } + + ARBShaderObjects.glShaderSourceARB(fragShader, fragCode); + ARBShaderObjects.glCompileShaderARB(fragShader); + + if (GL20.glGetShaderi(fragShader, 35713) != 1) { + SMCLog.severe("Error compiling fragment shader: " + filename); + } + + printShaderLogInfo(fragShader, filename, listFiles); + return fragShader; + } + } + + private static Reader getShaderReader(String filename) { + Reader r = ShadersBuiltIn.getShaderReader(filename); + return (Reader)(r != null ? r : new InputStreamReader(shaderPack.getResourceAsStream(filename))); + } + + private static void saveShader(String filename, String code) { + try { + File e = new File(shaderpacksdir, "debug/" + filename); + e.getParentFile().mkdirs(); + Config.writeFile(e, code); + } catch (IOException var3) { + Config.warn("Error saving: " + filename); + var3.printStackTrace(); + } + } + + private static void clearDirectory(File dir) { + if (dir.exists()) { + if (dir.isDirectory()) { + File[] files = dir.listFiles(); + + if (files != null) { + for (int i = 0; i < files.length; ++i) { + File file = files[i]; + + if (file.isDirectory()) { + clearDirectory(file); + } + + file.delete(); + } + } + } + } + } + + private static boolean printLogInfo(int obj, String name) { + IntBuffer iVal = BufferUtils.createIntBuffer(1); + ARBShaderObjects.glGetObjectParameterARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB, iVal); + int length = iVal.get(); + + if (length > 1) { + ByteBuffer infoLog = BufferUtils.createByteBuffer(length); + iVal.flip(); + ARBShaderObjects.glGetInfoLogARB(obj, iVal, infoLog); + byte[] infoBytes = new byte[length]; + infoLog.get(infoBytes); + + if (infoBytes[length - 1] == 0) { + infoBytes[length - 1] = 10; + } + + String out = new String(infoBytes); + SMCLog.info("Info log: " + name + "\n" + out); + return false; + } else { + return true; + } + } + + private static boolean printShaderLogInfo(int shader, String name, List listFiles) { + IntBuffer iVal = BufferUtils.createIntBuffer(1); + int length = GL20.glGetShaderi(shader, 35716); + + if (length <= 1) { + return true; + } else { + for (int log = 0; log < listFiles.size(); ++log) { + String path = (String)listFiles.get(log); + SMCLog.info("File: " + (log + 1) + " = " + path); + } + + String var7 = GL20.glGetShaderInfoLog(shader, length); + SMCLog.info("Shader info log: " + name + "\n" + var7); + return false; + } + } + + public static void setDrawBuffers(IntBuffer drawBuffers) { + if (drawBuffers == null) { + drawBuffers = drawBuffersNone; + } + + if (activeDrawBuffers != drawBuffers) { + activeDrawBuffers = drawBuffers; + GL20.glDrawBuffers(drawBuffers); + } + } + + public static void useProgram(int program) { + checkGLError("pre-useProgram"); + + if (isShadowPass) { + program = 30; + + if (programsID[30] == 0) { + normalMapEnabled = false; + return; + } + } + + if (activeProgram != program) { + activeProgram = program; + ARBShaderObjects.glUseProgramObjectARB(programsID[program]); + + if (programsID[program] == 0) { + normalMapEnabled = false; + } else { + if (checkGLError("useProgram ", programNames[program]) != 0) { + programsID[program] = 0; + } + + IntBuffer drawBuffers = programsDrawBuffers[program]; + + if (isRenderingDfb) { + setDrawBuffers(drawBuffers); + checkGLError(programNames[program], " draw buffers = ", programsDrawBufSettings[program]); + } + + activeCompositeMipmapSetting = programsCompositeMipmapSetting[program]; + uniformEntityColor.setProgram(programsID[activeProgram]); + uniformEntityId.setProgram(programsID[activeProgram]); + uniformBlockEntityId.setProgram(programsID[activeProgram]); + + switch (program) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 16: + case 18: + case 19: + case 20: + case 41: + normalMapEnabled = true; + setProgramUniform1i("texture", 0); + setProgramUniform1i("lightmap", 1); + setProgramUniform1i("normals", 2); + setProgramUniform1i("specular", 3); + setProgramUniform1i("shadow", waterShadowEnabled ? 5 : 4); + setProgramUniform1i("watershadow", 4); + setProgramUniform1i("shadowtex0", 4); + setProgramUniform1i("shadowtex1", 5); + setProgramUniform1i("depthtex0", 6); + + if (customTexturesGbuffers != null || hasDeferredPrograms) { + setProgramUniform1i("gaux1", 7); + setProgramUniform1i("gaux2", 8); + setProgramUniform1i("gaux3", 9); + setProgramUniform1i("gaux4", 10); + } + + setProgramUniform1i("depthtex1", 12); + setProgramUniform1i("shadowcolor", 13); + setProgramUniform1i("shadowcolor0", 13); + setProgramUniform1i("shadowcolor1", 14); + setProgramUniform1i("noisetex", 15); + break; + + case 14: + case 15: + case 17: + default: + normalMapEnabled = false; + break; + + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 42: + case 43: + normalMapEnabled = false; + setProgramUniform1i("gcolor", 0); + setProgramUniform1i("gdepth", 1); + setProgramUniform1i("gnormal", 2); + setProgramUniform1i("composite", 3); + setProgramUniform1i("gaux1", 7); + setProgramUniform1i("gaux2", 8); + setProgramUniform1i("gaux3", 9); + setProgramUniform1i("gaux4", 10); + setProgramUniform1i("colortex0", 0); + setProgramUniform1i("colortex1", 1); + setProgramUniform1i("colortex2", 2); + setProgramUniform1i("colortex3", 3); + setProgramUniform1i("colortex4", 7); + setProgramUniform1i("colortex5", 8); + setProgramUniform1i("colortex6", 9); + setProgramUniform1i("colortex7", 10); + setProgramUniform1i("shadow", waterShadowEnabled ? 5 : 4); + setProgramUniform1i("watershadow", 4); + setProgramUniform1i("shadowtex0", 4); + setProgramUniform1i("shadowtex1", 5); + setProgramUniform1i("gdepthtex", 6); + setProgramUniform1i("depthtex0", 6); + setProgramUniform1i("depthtex1", 11); + setProgramUniform1i("depthtex2", 12); + setProgramUniform1i("shadowcolor", 13); + setProgramUniform1i("shadowcolor0", 13); + setProgramUniform1i("shadowcolor1", 14); + setProgramUniform1i("noisetex", 15); + break; + + case 30: + case 31: + case 32: + setProgramUniform1i("tex", 0); + setProgramUniform1i("texture", 0); + setProgramUniform1i("lightmap", 1); + setProgramUniform1i("normals", 2); + setProgramUniform1i("specular", 3); + setProgramUniform1i("shadow", waterShadowEnabled ? 5 : 4); + setProgramUniform1i("watershadow", 4); + setProgramUniform1i("shadowtex0", 4); + setProgramUniform1i("shadowtex1", 5); + + if (customTexturesGbuffers != null) { + setProgramUniform1i("gaux1", 7); + setProgramUniform1i("gaux2", 8); + setProgramUniform1i("gaux3", 9); + setProgramUniform1i("gaux4", 10); + } + + setProgramUniform1i("shadowcolor", 13); + setProgramUniform1i("shadowcolor0", 13); + setProgramUniform1i("shadowcolor1", 14); + setProgramUniform1i("noisetex", 15); + } + + ItemStack stack = mc.thePlayer != null ? mc.thePlayer.getHeldItem() : null; + Item item = stack != null ? stack.getItem() : null; + int itemID = -1; + Block block = null; + + if (item != null) { + itemID = Item.itemRegistry.getIDForObject(item); + block = (Block)Block.blockRegistry.getObjectForID(itemID); + } + + int blockLight = block != null ? block.getLightValue() : 0; + setProgramUniform1i("heldItemId", itemID); + setProgramUniform1i("heldBlockLightValue", blockLight); + setProgramUniform1i("fogMode", fogEnabled ? fogMode : 0); + setProgramUniform3f("fogColor", fogColorR, fogColorG, fogColorB); + setProgramUniform3f("skyColor", skyColorR, skyColorG, skyColorB); + setProgramUniform1i("worldTime", (int)(worldTime % 24000L)); + setProgramUniform1i("worldDay", (int)(worldTime / 24000L)); + setProgramUniform1i("moonPhase", moonPhase); + setProgramUniform1i("frameCounter", frameCounter); + setProgramUniform1f("frameTime", frameTime); + setProgramUniform1f("frameTimeCounter", frameTimeCounter); + setProgramUniform1f("sunAngle", sunAngle); + setProgramUniform1f("shadowAngle", shadowAngle); + setProgramUniform1f("rainStrength", rainStrength); + setProgramUniform1f("aspectRatio", (float)renderWidth / (float)renderHeight); + setProgramUniform1f("viewWidth", (float)renderWidth); + setProgramUniform1f("viewHeight", (float)renderHeight); + setProgramUniform1f("near", 0.05F); + setProgramUniform1f("far", (float)(mc.gameSettings.renderDistanceChunks * 16)); + setProgramUniform3f("sunPosition", sunPosition[0], sunPosition[1], sunPosition[2]); + setProgramUniform3f("moonPosition", moonPosition[0], moonPosition[1], moonPosition[2]); + setProgramUniform3f("shadowLightPosition", shadowLightPosition[0], shadowLightPosition[1], shadowLightPosition[2]); + setProgramUniform3f("upPosition", upPosition[0], upPosition[1], upPosition[2]); + setProgramUniform3f("previousCameraPosition", (float)previousCameraPositionX, (float)previousCameraPositionY, (float)previousCameraPositionZ); + setProgramUniform3f("cameraPosition", (float)cameraPositionX, (float)cameraPositionY, (float)cameraPositionZ); + setProgramUniformMatrix4ARB("gbufferModelView", false, modelView); + setProgramUniformMatrix4ARB("gbufferModelViewInverse", false, modelViewInverse); + setProgramUniformMatrix4ARB("gbufferPreviousProjection", false, previousProjection); + setProgramUniformMatrix4ARB("gbufferProjection", false, projection); + setProgramUniformMatrix4ARB("gbufferProjectionInverse", false, projectionInverse); + setProgramUniformMatrix4ARB("gbufferPreviousModelView", false, previousModelView); + + if (usedShadowDepthBuffers > 0) { + setProgramUniformMatrix4ARB("shadowProjection", false, shadowProjection); + setProgramUniformMatrix4ARB("shadowProjectionInverse", false, shadowProjectionInverse); + setProgramUniformMatrix4ARB("shadowModelView", false, shadowModelView); + setProgramUniformMatrix4ARB("shadowModelViewInverse", false, shadowModelViewInverse); + } + + setProgramUniform1f("wetness", wetness); + setProgramUniform1f("eyeAltitude", eyePosY); + setProgramUniform2i("eyeBrightness", eyeBrightness & 65535, eyeBrightness >> 16); + setProgramUniform2i("eyeBrightnessSmooth", Math.round(eyeBrightnessFadeX), Math.round(eyeBrightnessFadeY)); + setProgramUniform2i("terrainTextureSize", terrainTextureSize[0], terrainTextureSize[1]); + setProgramUniform1i("terrainIconSize", terrainIconSize); + setProgramUniform1i("isEyeInWater", isEyeInWater); + setProgramUniform1f("nightVision", nightVision); + setProgramUniform1f("blindness", blindness); + setProgramUniform1f("screenBrightness", mc.gameSettings.gammaSetting); + setProgramUniform1i("hideGUI", mc.gameSettings.hideGUI ? 1 : 0); + setProgramUniform1f("centerDepthSmooth", centerDepthSmooth); + setProgramUniform2i("atlasSize", atlasSizeX, atlasSizeY); + + if (customUniforms != null) { + customUniforms.setProgram(programsID[activeProgram]); + customUniforms.update(); + } + + checkGLError("useProgram ", programNames[program]); + } + } + } + + public static void setProgramUniform1i(String name, int x) { + int gp = programsID[activeProgram]; + + if (gp != 0) { + int uniform = ARBShaderObjects.glGetUniformLocationARB(gp, name); + ARBShaderObjects.glUniform1iARB(uniform, x); + + if (isCustomUniforms()) { + LegacyUniforms.setInt(name, x); + } + + checkGLError(programNames[activeProgram], name); + } + } + + public static void setProgramUniform2i(String name, int x, int y) { + int gp = programsID[activeProgram]; + + if (gp != 0) { + int uniform = ARBShaderObjects.glGetUniformLocationARB(gp, name); + ARBShaderObjects.glUniform2iARB(uniform, x, y); + + if (isCustomUniforms()) { + LegacyUniforms.setIntXy(name, x, y); + } + + checkGLError(programNames[activeProgram], name); + } + } + + public static void setProgramUniform1f(String name, float x) { + int gp = programsID[activeProgram]; + + if (gp != 0) { + int uniform = ARBShaderObjects.glGetUniformLocationARB(gp, name); + ARBShaderObjects.glUniform1fARB(uniform, x); + + if (isCustomUniforms()) { + LegacyUniforms.setFloat(name, x); + } + + checkGLError(programNames[activeProgram], name); + } + } + + public static void setProgramUniform3f(String name, float x, float y, float z) { + int gp = programsID[activeProgram]; + + if (gp != 0) { + int uniform = ARBShaderObjects.glGetUniformLocationARB(gp, name); + ARBShaderObjects.glUniform3fARB(uniform, x, y, z); + + if (isCustomUniforms()) { + if (name.endsWith("Color")) { + LegacyUniforms.setFloatRgb(name, x, y, z); + } else { + LegacyUniforms.setFloatXyz(name, x, y, z); + } + } + + checkGLError(programNames[activeProgram], name); + } + } + + public static void setProgramUniformMatrix4ARB(String name, boolean transpose, FloatBuffer matrix) { + int gp = programsID[activeProgram]; + + if (gp != 0 && matrix != null) { + int uniform = ARBShaderObjects.glGetUniformLocationARB(gp, name); + ARBShaderObjects.glUniformMatrix4ARB(uniform, transpose, matrix); + checkGLError(programNames[activeProgram], name); + } + } + + private static int getBufferIndexFromString(String name) { + return !name.equals("colortex0") && !name.equals("gcolor") ? (!name.equals("colortex1") && !name.equals("gdepth") ? (!name.equals("colortex2") && !name.equals("gnormal") ? (!name.equals("colortex3") && !name.equals("composite") ? (!name.equals("colortex4") && !name.equals("gaux1") ? (!name.equals("colortex5") && !name.equals("gaux2") ? (!name.equals("colortex6") && !name.equals("gaux3") ? (!name.equals("colortex7") && !name.equals("gaux4") ? -1 : 7) : 6) : 5) : 4) : 3) : 2) : 1) : 0; + } + + private static int getTextureFormatFromString(String par) { + par = par.trim(); + + for (int i = 0; i < formatNames.length; ++i) { + String name = formatNames[i]; + + if (par.equals(name)) { + return formatIds[i]; + } + } + + return 0; + } + + private static void setupNoiseTexture() { + if (noiseTexture == null && noiseTexturePath != null) { + noiseTexture = loadCustomTexture(15, noiseTexturePath); + } + + if (noiseTexture == null) { + noiseTexture = new HFNoiseTexture(noiseTextureResolution, noiseTextureResolution); + } + } + + private static void loadEntityDataMap() { + mapBlockToEntityData = new IdentityHashMap(300); + String e; + + if (mapBlockToEntityData.isEmpty()) { + + for (Object block : Block.blockRegistry.getKeys()) { + e = (String) block; + Block m = (Block) Block.blockRegistry.getObject(e); + int name = Block.blockRegistry.getIDForObject(m); + mapBlockToEntityData.put(m, Integer.valueOf(name)); + } + } + + BufferedReader reader1 = null; + + try { + reader1 = new BufferedReader(new InputStreamReader(shaderPack.getResourceAsStream("/mc_Entity_x.txt"))); + } catch (Exception var8) { + ; + } + + if (reader1 != null) { + try { + while ((e = reader1.readLine()) != null) { + Matcher m1 = patternLoadEntityDataMap.matcher(e); + + if (m1.matches()) { + String name1 = m1.group(1); + String value = m1.group(2); + int id = Integer.parseInt(value); + Block block = Block.getBlockFromName(name1); + + if (block != null) { + mapBlockToEntityData.put(block, Integer.valueOf(id)); + } else { + SMCLog.warning("Unknown block name %s", new Object[] {name1}); + } + } else { + SMCLog.warning("unmatched %s\n", new Object[] {e}); + } + } + } catch (Exception var9) { + SMCLog.warning("Error parsing mc_Entity_x.txt"); + } + } + + if (reader1 != null) { + try { + reader1.close(); + } catch (Exception var7) { + ; + } + } + } + + private static IntBuffer fillIntBufferZero(IntBuffer buf) { + int limit = buf.limit(); + + for (int i = buf.position(); i < limit; ++i) { + buf.put(i, 0); + } + + return buf; + } + + public static void uninit() { + if (isShaderPackInitialized) { + checkGLError("Shaders.uninit pre"); + + for (int i = 0; i < 44; ++i) { + if (programsRef[i] != 0) { + ARBShaderObjects.glDeleteObjectARB(programsRef[i]); + checkGLError("del programRef"); + } + + programsRef[i] = 0; + programsID[i] = 0; + programsDrawBufSettings[i] = null; + programsDrawBuffers[i] = null; + programsCompositeMipmapSetting[i] = 0; + } + + hasDeferredPrograms = false; + + if (dfb != 0) { + EXTFramebufferObject.glDeleteFramebuffersEXT(dfb); + dfb = 0; + checkGLError("del dfb"); + } + + if (sfb != 0) { + EXTFramebufferObject.glDeleteFramebuffersEXT(sfb); + sfb = 0; + checkGLError("del sfb"); + } + + if (dfbDepthTextures != null) { + GlStateManager.deleteTextures(dfbDepthTextures); + fillIntBufferZero(dfbDepthTextures); + checkGLError("del dfbDepthTextures"); + } + + if (dfbColorTextures != null) { + GlStateManager.deleteTextures(dfbColorTextures); + fillIntBufferZero(dfbColorTextures); + checkGLError("del dfbTextures"); + } + + if (sfbDepthTextures != null) { + GlStateManager.deleteTextures(sfbDepthTextures); + fillIntBufferZero(sfbDepthTextures); + checkGLError("del shadow depth"); + } + + if (sfbColorTextures != null) { + GlStateManager.deleteTextures(sfbColorTextures); + fillIntBufferZero(sfbColorTextures); + checkGLError("del shadow color"); + } + + if (dfbDrawBuffers != null) { + fillIntBufferZero(dfbDrawBuffers); + } + + if (noiseTexture != null) { + noiseTexture.deleteTexture(); + noiseTexture = null; + } + + SMCLog.info("Uninit"); + shadowPassInterval = 0; + shouldSkipDefaultShadow = false; + isShaderPackInitialized = false; + checkGLError("Shaders.uninit"); + } + } + + public static void scheduleResize() { + renderDisplayHeight = 0; + } + + public static void scheduleResizeShadow() { + needResizeShadow = true; + } + + private static void resize() { + renderDisplayWidth = mc.displayWidth; + renderDisplayHeight = mc.displayHeight; + renderWidth = Math.round((float)renderDisplayWidth * configRenderResMul); + renderHeight = Math.round((float)renderDisplayHeight * configRenderResMul); + setupFrameBuffer(); + } + + private static void resizeShadow() { + needResizeShadow = false; + shadowMapWidth = Math.round((float)spShadowMapWidth * configShadowResMul); + shadowMapHeight = Math.round((float)spShadowMapHeight * configShadowResMul); + setupShadowFrameBuffer(); + } + + private static void setupFrameBuffer() { + if (dfb != 0) { + EXTFramebufferObject.glDeleteFramebuffersEXT(dfb); + GlStateManager.deleteTextures(dfbDepthTextures); + GlStateManager.deleteTextures(dfbColorTextures); + } + + dfb = EXTFramebufferObject.glGenFramebuffersEXT(); + GL11.glGenTextures((IntBuffer)dfbDepthTextures.clear().limit(usedDepthBuffers)); + GL11.glGenTextures((IntBuffer)dfbColorTextures.clear().limit(16)); + dfbDepthTextures.position(0); + dfbColorTextures.position(0); + dfbColorTextures.get(dfbColorTexturesA).position(0); + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + GL20.glDrawBuffers(0); + GL11.glReadBuffer(0); + int status; + + for (status = 0; status < usedDepthBuffers; ++status) { + GlStateManager.bindTexture(dfbDepthTextures.get(status)); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_DEPTH_TEXTURE_MODE, GL11.GL_LUMINANCE); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, renderWidth, renderHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)null); + } + + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, dfbDepthTextures.get(0), 0); + GL20.glDrawBuffers(dfbDrawBuffers); + GL11.glReadBuffer(0); + checkGLError("FT d"); + + for (status = 0; status < usedColorBuffers; ++status) { + GlStateManager.bindTexture(dfbColorTexturesA[status]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, gbuffersFormat[status], renderWidth, renderHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)null); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + status, 3553, dfbColorTexturesA[status], 0); + checkGLError("FT c"); + } + + for (status = 0; status < usedColorBuffers; ++status) { + GlStateManager.bindTexture(dfbColorTexturesA[8 + status]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, gbuffersFormat[status], renderWidth, renderHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)null); + checkGLError("FT ca"); + } + + status = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (status == 36058) { + printChatAndLogError("[Shaders] Error: Failed framebuffer incomplete formats"); + + for (int i = 0; i < usedColorBuffers; ++i) { + GlStateManager.bindTexture(dfbColorTextures.get(i)); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, renderWidth, renderHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)null); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + i, 3553, dfbColorTextures.get(i), 0); + checkGLError("FT c"); + } + + status = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (status == 36053) { + SMCLog.info("complete"); + } + } + + GlStateManager.bindTexture(0); + + if (status != 36053) { + printChatAndLogError("[Shaders] Error: Failed creating framebuffer! (Status " + status + ")"); + } else { + SMCLog.info("Framebuffer created."); + } + } + + private static void setupShadowFrameBuffer() { + if (usedShadowDepthBuffers != 0) { + if (sfb != 0) { + EXTFramebufferObject.glDeleteFramebuffersEXT(sfb); + GlStateManager.deleteTextures(sfbDepthTextures); + GlStateManager.deleteTextures(sfbColorTextures); + } + + sfb = EXTFramebufferObject.glGenFramebuffersEXT(); + EXTFramebufferObject.glBindFramebufferEXT(36160, sfb); + GL11.glDrawBuffer(0); + GL11.glReadBuffer(0); + GL11.glGenTextures((IntBuffer)sfbDepthTextures.clear().limit(usedShadowDepthBuffers)); + GL11.glGenTextures((IntBuffer)sfbColorTextures.clear().limit(usedShadowColorBuffers)); + sfbDepthTextures.position(0); + sfbColorTextures.position(0); + int status; + int filter; + + for (status = 0; status < usedShadowDepthBuffers; ++status) { + GlStateManager.bindTexture(sfbDepthTextures.get(status)); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F); + filter = shadowFilterNearest[status] ? 9728 : 9729; + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filter); + + if (shadowHardwareFilteringEnabled[status]) { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_COMPARE_MODE, GL14.GL_COMPARE_R_TO_TEXTURE); + } + + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, shadowMapWidth, shadowMapHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)null); + } + + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0); + checkGLError("FT sd"); + + for (status = 0; status < usedShadowColorBuffers; ++status) { + GlStateManager.bindTexture(sfbColorTextures.get(status)); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F); + filter = shadowColorFilterNearest[status] ? 9728 : 9729; + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filter); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, shadowMapWidth, shadowMapHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)null); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + status, 3553, sfbColorTextures.get(status), 0); + checkGLError("FT sc"); + } + + GlStateManager.bindTexture(0); + + if (usedShadowColorBuffers > 0) { + GL20.glDrawBuffers(sfbDrawBuffers); + } + + status = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); + + if (status != 36053) { + printChatAndLogError("[Shaders] Error: Failed creating shadow framebuffer! (Status " + status + ")"); + } else { + SMCLog.info("Shadow framebuffer created."); + } + } + } + + public static void beginRender(Minecraft minecraft, float partialTicks, long finishTimeNano) { + checkGLError("pre beginRender"); + checkWorldChanged(mc.theWorld); + mc = minecraft; + mc.mcProfiler.startSection("init"); + entityRenderer = mc.entityRenderer; + + if (!isShaderPackInitialized) { + try { + init(); + } catch (IllegalStateException var7) { + if (Config.normalize(var7.getMessage()).equals("Function is not supported")) { + printChatAndLogError("[Shaders] Error: " + var7.getMessage()); + var7.printStackTrace(); + setShaderPack(packNameNone); + return; + } + } + } + + if (mc.displayWidth != renderDisplayWidth || mc.displayHeight != renderDisplayHeight) { + resize(); + } + + if (needResizeShadow) { + resizeShadow(); + } + + worldTime = mc.theWorld.getWorldTime(); + diffWorldTime = (worldTime - lastWorldTime) % 24000L; + + if (diffWorldTime < 0L) { + diffWorldTime += 24000L; + } + + lastWorldTime = worldTime; + moonPhase = mc.theWorld.getMoonPhase(); + ++frameCounter; + + if (frameCounter >= 720720) { + frameCounter = 0; + } + + systemTime = System.currentTimeMillis(); + + if (lastSystemTime == 0L) { + lastSystemTime = systemTime; + } + + diffSystemTime = systemTime - lastSystemTime; + lastSystemTime = systemTime; + frameTime = (float)diffSystemTime / 1000.0F; + frameTimeCounter += frameTime; + frameTimeCounter %= 3600.0F; + rainStrength = minecraft.theWorld.getRainStrength(partialTicks); + float renderViewEntity = (float)diffSystemTime * 0.01F; + float i = (float)Math.exp(Math.log(0.5D) * (double)renderViewEntity / (double)(wetness < rainStrength ? drynessHalfLife : wetnessHalfLife)); + wetness = wetness * i + rainStrength * (1.0F - i); + EntityLivingBase var8 = mc.renderViewEntity; + int var9; + + if (var8 != null) { + isSleeping = var8.isPlayerSleeping(); + eyePosY = (float)var8.posY * partialTicks + (float)var8.lastTickPosY * (1.0F - partialTicks); + eyeBrightness = var8.getBrightnessForRender(partialTicks); + i = (float)diffSystemTime * 0.01F; + float temp2 = (float)Math.exp(Math.log(0.5D) * (double)i / (double)eyeBrightnessHalflife); + eyeBrightnessFadeX = eyeBrightnessFadeX * temp2 + (float)(eyeBrightness & 65535) * (1.0F - temp2); + eyeBrightnessFadeY = eyeBrightnessFadeY * temp2 + (float)(eyeBrightness >> 16) * (1.0F - temp2); + isEyeInWater = 0; + + if (mc.gameSettings.thirdPersonView == 0 && !isSleeping) { + if (var8.isInsideOfMaterial(Material.water)) { + isEyeInWater = 1; + } else if (var8.isInsideOfMaterial(Material.lava)) { + isEyeInWater = 2; + } + } + + if (mc.thePlayer != null) { + nightVision = 0.0F; + + if (mc.thePlayer.isPotionActive(Potion.nightVision)) { + nightVision = Config.getMinecraft().entityRenderer.getNightVisionBrightness(mc.thePlayer, partialTicks); + } + + blindness = 0.0F; + + if (mc.thePlayer.isPotionActive(Potion.blindness)) { + var9 = mc.thePlayer.getActivePotionEffect(Potion.blindness).getDuration(); + blindness = Config.limit((float)var9 / 20.0F, 0.0F, 1.0F); + } + } + + Vec3 var10 = mc.theWorld.getSkyColor(var8, partialTicks); + var10 = CustomColorizer.getWorldSkyColor(var10, currentWorld, var8, partialTicks); + skyColorR = (float)var10.xCoord; + skyColorG = (float)var10.yCoord; + skyColorB = (float)var10.zCoord; + } + + isRenderingWorld = true; + isCompositeRendered = false; + isHandRenderedMain = false; + + if (usedShadowDepthBuffers >= 1) { + GlStateManager.setActiveTexture(33988); + GlStateManager.bindTexture(sfbDepthTextures.get(0)); + + if (usedShadowDepthBuffers >= 2) { + GlStateManager.setActiveTexture(33989); + GlStateManager.bindTexture(sfbDepthTextures.get(1)); + } + } + + GlStateManager.setActiveTexture(33984); + + for (var9 = 0; var9 < usedColorBuffers; ++var9) { + GlStateManager.bindTexture(dfbColorTexturesA[var9]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GlStateManager.bindTexture(dfbColorTexturesA[8 + var9]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + } + + GlStateManager.bindTexture(0); + + for (var9 = 0; var9 < 4 && 4 + var9 < usedColorBuffers; ++var9) { + GlStateManager.setActiveTexture(33991 + var9); + GlStateManager.bindTexture(dfbColorTextures.get(4 + var9)); + } + + GlStateManager.setActiveTexture(33990); + GlStateManager.bindTexture(dfbDepthTextures.get(0)); + + if (usedDepthBuffers >= 2) { + GlStateManager.setActiveTexture(33995); + GlStateManager.bindTexture(dfbDepthTextures.get(1)); + + if (usedDepthBuffers >= 3) { + GlStateManager.setActiveTexture(33996); + GlStateManager.bindTexture(dfbDepthTextures.get(2)); + } + } + + for (var9 = 0; var9 < usedShadowColorBuffers; ++var9) { + GlStateManager.setActiveTexture(33997 + var9); + GlStateManager.bindTexture(sfbColorTextures.get(var9)); + } + + if (noiseTextureEnabled) { + GlStateManager.setActiveTexture(33984 + noiseTexture.getTextureUnit()); + GlStateManager.bindTexture(noiseTexture.getTextureId()); + } + + bindCustomTextures(customTexturesGbuffers); + GlStateManager.setActiveTexture(33984); + previousCameraPositionX = cameraPositionX; + previousCameraPositionY = cameraPositionY; + previousCameraPositionZ = cameraPositionZ; + previousProjection.position(0); + projection.position(0); + previousProjection.put(projection); + previousProjection.position(0); + projection.position(0); + previousModelView.position(0); + modelView.position(0); + previousModelView.put(modelView); + previousModelView.position(0); + modelView.position(0); + checkGLError("beginRender"); + ShadersRender.renderShadowMap(entityRenderer, 0, partialTicks, finishTimeNano); + mc.mcProfiler.endSection(); + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + + for (var9 = 0; var9 < usedColorBuffers; ++var9) { + colorTexturesToggle[var9] = 0; + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + var9, 3553, dfbColorTexturesA[var9], 0); + } + + checkGLError("end beginRender"); + } + + private static void checkWorldChanged(World world) { + if (currentWorld != world) { + World oldWorld = currentWorld; + currentWorld = world; + + if (oldWorld != null && world != null) { + int dimIdOld = oldWorld.provider.dimensionId; + int dimIdNew = world.provider.dimensionId; + boolean dimShadersOld = shaderPackDimensions.contains(Integer.valueOf(dimIdOld)); + boolean dimShadersNew = shaderPackDimensions.contains(Integer.valueOf(dimIdNew)); + + if (dimShadersOld || dimShadersNew) { + uninit(); + } + } + + Smoother.reset(); + } + } + + public static void beginRenderPass(int pass, float partialTicks, long finishTimeNano) { + if (!isShadowPass) { + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + GL11.glViewport(0, 0, renderWidth, renderHeight); + activeDrawBuffers = null; + ShadersTex.bindNSTextures(defaultTexture.getMultiTexID()); + useProgram(2); + checkGLError("end beginRenderPass"); + } + } + + public static void setViewport(int vx, int vy, int vw, int vh) { + GlStateManager.colorMask(true, true, true, true); + + if (isShadowPass) { + GL11.glViewport(0, 0, shadowMapWidth, shadowMapHeight); + } else { + GL11.glViewport(0, 0, renderWidth, renderHeight); + EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); + isRenderingDfb = true; + GlStateManager.enableCull(); + GlStateManager.enableDepth(); + setDrawBuffers(drawBuffersNone); + useProgram(2); + checkGLError("beginRenderPass"); + } + } + + public static int setFogMode(int val) { + fogMode = val; + return val; + } + + public static void setFogColor(float r, float g, float b) { + fogColorR = r; + fogColorG = g; + fogColorB = b; + setProgramUniform3f("fogColor", fogColorR, fogColorG, fogColorB); + } + + public static void setClearColor(float red, float green, float blue, float alpha) { + GlStateManager.clearColor(red, green, blue, alpha); + clearColorR = red; + clearColorG = green; + clearColorB = blue; + } + + public static void clearRenderBuffer() { + if (isShadowPass) { + checkGLError("shadow clear pre"); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0); + GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F); + GL20.glDrawBuffers(programsDrawBuffers[30]); + checkFramebufferStatus("shadow clear"); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + checkGLError("shadow clear"); + } else { + checkGLError("clear pre"); + + if (gbuffersClear[0]) { + GL20.glDrawBuffers(36064); + GL11.glClear(16384); + } + + if (gbuffersClear[1]) { + GL20.glDrawBuffers(36065); + GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glClear(16384); + } + + for (int i = 2; i < usedColorBuffers; ++i) { + if (gbuffersClear[i]) { + GL20.glDrawBuffers(36064 + i); + GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F); + GL11.glClear(16384); + } + } + + setDrawBuffers(dfbDrawBuffers); + checkFramebufferStatus("clear"); + checkGLError("clear"); + } + } + + public static void setCamera(float partialTicks) { + EntityLivingBase viewEntity = mc.renderViewEntity; + double x = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * (double)partialTicks; + double y = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * (double)partialTicks; + double z = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * (double)partialTicks; + cameraPositionX = x; + cameraPositionY = y; + cameraPositionZ = z; + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, (FloatBuffer)projection.position(0)); + SMath.invertMat4FBFA((FloatBuffer)projectionInverse.position(0), (FloatBuffer)projection.position(0), faProjectionInverse, faProjection); + projection.position(0); + projectionInverse.position(0); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)modelView.position(0)); + SMath.invertMat4FBFA((FloatBuffer)modelViewInverse.position(0), (FloatBuffer)modelView.position(0), faModelViewInverse, faModelView); + modelView.position(0); + modelViewInverse.position(0); + checkGLError("setCamera"); + } + + public static void setCameraShadow(float partialTicks) { + EntityLivingBase viewEntity = mc.renderViewEntity; + double x = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * (double)partialTicks; + double y = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * (double)partialTicks; + double z = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * (double)partialTicks; + cameraPositionX = x; + cameraPositionY = y; + cameraPositionZ = z; + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, (FloatBuffer)projection.position(0)); + SMath.invertMat4FBFA((FloatBuffer)projectionInverse.position(0), (FloatBuffer)projection.position(0), faProjectionInverse, faProjection); + projection.position(0); + projectionInverse.position(0); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)modelView.position(0)); + SMath.invertMat4FBFA((FloatBuffer)modelViewInverse.position(0), (FloatBuffer)modelView.position(0), faModelViewInverse, faModelView); + modelView.position(0); + modelViewInverse.position(0); + GL11.glViewport(0, 0, shadowMapWidth, shadowMapHeight); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + + if (shadowMapIsOrtho) { + GL11.glOrtho((double)(-shadowMapHalfPlane), (double)shadowMapHalfPlane, (double)(-shadowMapHalfPlane), (double)shadowMapHalfPlane, 0.05000000074505806D, 256.0D); + } else { + GLU.gluPerspective(shadowMapFOV, (float)shadowMapWidth / (float)shadowMapHeight, 0.05F, 256.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -100.0F); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + celestialAngle = mc.theWorld.getCelestialAngle(partialTicks); + sunAngle = celestialAngle < 0.75F ? celestialAngle + 0.25F : celestialAngle - 0.75F; + float angle = celestialAngle * -360.0F; + float angleInterval = shadowAngleInterval > 0.0F ? angle % shadowAngleInterval - shadowAngleInterval * 0.5F : 0.0F; + + if ((double)sunAngle <= 0.5D) { + GL11.glRotatef(angle - angleInterval, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(sunPathRotation, 1.0F, 0.0F, 0.0F); + shadowAngle = sunAngle; + } else { + GL11.glRotatef(angle + 180.0F - angleInterval, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(sunPathRotation, 1.0F, 0.0F, 0.0F); + shadowAngle = sunAngle - 0.5F; + } + + float raSun; + float x1; + + if (shadowMapIsOrtho) { + raSun = shadowIntervalSize; + x1 = raSun / 2.0F; + GL11.glTranslatef((float)x % raSun - x1, (float)y % raSun - x1, (float)z % raSun - x1); + } + + raSun = sunAngle * ((float)Math.PI * 2F); + x1 = (float)Math.cos((double)raSun); + float y1 = (float)Math.sin((double)raSun); + float raTilt = sunPathRotation * ((float)Math.PI * 2F); + float x2 = x1; + float y2 = y1 * (float)Math.cos((double)raTilt); + float z2 = y1 * (float)Math.sin((double)raTilt); + + if ((double)sunAngle > 0.5D) { + x2 = -x1; + y2 = -y2; + z2 = -z2; + } + + shadowLightPositionVector[0] = x2; + shadowLightPositionVector[1] = y2; + shadowLightPositionVector[2] = z2; + shadowLightPositionVector[3] = 0.0F; + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, (FloatBuffer)shadowProjection.position(0)); + SMath.invertMat4FBFA((FloatBuffer)shadowProjectionInverse.position(0), (FloatBuffer)shadowProjection.position(0), faShadowProjectionInverse, faShadowProjection); + shadowProjection.position(0); + shadowProjectionInverse.position(0); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)shadowModelView.position(0)); + SMath.invertMat4FBFA((FloatBuffer)shadowModelViewInverse.position(0), (FloatBuffer)shadowModelView.position(0), faShadowModelViewInverse, faShadowModelView); + shadowModelView.position(0); + shadowModelViewInverse.position(0); + setProgramUniformMatrix4ARB("gbufferProjection", false, projection); + setProgramUniformMatrix4ARB("gbufferProjectionInverse", false, projectionInverse); + setProgramUniformMatrix4ARB("gbufferPreviousProjection", false, previousProjection); + setProgramUniformMatrix4ARB("gbufferModelView", false, modelView); + setProgramUniformMatrix4ARB("gbufferModelViewInverse", false, modelViewInverse); + setProgramUniformMatrix4ARB("gbufferPreviousModelView", false, previousModelView); + setProgramUniformMatrix4ARB("shadowProjection", false, shadowProjection); + setProgramUniformMatrix4ARB("shadowProjectionInverse", false, shadowProjectionInverse); + setProgramUniformMatrix4ARB("shadowModelView", false, shadowModelView); + setProgramUniformMatrix4ARB("shadowModelViewInverse", false, shadowModelViewInverse); + mc.gameSettings.thirdPersonView = 1; + checkGLError("setCamera"); + } + + public static void preCelestialRotate() { + GL11.glRotatef(sunPathRotation * 1.0F, 0.0F, 0.0F, 1.0F); + checkGLError("preCelestialRotate"); + } + + public static void postCelestialRotate() { + FloatBuffer modelView = tempMatrixDirectBuffer; + modelView.clear(); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelView); + modelView.get(tempMat, 0, 16); + SMath.multiplyMat4xVec4(sunPosition, tempMat, sunPosModelView); + SMath.multiplyMat4xVec4(moonPosition, tempMat, moonPosModelView); + System.arraycopy(shadowAngle == sunAngle ? sunPosition : moonPosition, 0, shadowLightPosition, 0, 3); + setProgramUniform3f("sunPosition", sunPosition[0], sunPosition[1], sunPosition[2]); + setProgramUniform3f("moonPosition", moonPosition[0], moonPosition[1], moonPosition[2]); + setProgramUniform3f("shadowLightPosition", shadowLightPosition[0], shadowLightPosition[1], shadowLightPosition[2]); + checkGLError("postCelestialRotate"); + } + + public static void setUpPosition() { + FloatBuffer modelView = tempMatrixDirectBuffer; + modelView.clear(); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelView); + modelView.get(tempMat, 0, 16); + SMath.multiplyMat4xVec4(upPosition, tempMat, upPosModelView); + setProgramUniform3f("upPosition", upPosition[0], upPosition[1], upPosition[2]); + } + + public static void genCompositeMipmap() { + if (hasGlGenMipmap) { + for (int i = 0; i < usedColorBuffers; ++i) { + if ((activeCompositeMipmapSetting & 1 << i) != 0) { + GlStateManager.setActiveTexture(33984 + colorTextureTextureImageUnit[i]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR); + GL30.glGenerateMipmap(3553); + } + } + + GlStateManager.setActiveTexture(33984); + } + } + + public static void drawComposite() { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glBegin(GL11.GL_QUADS); + GL11.glTexCoord2f(0.0F, 0.0F); + GL11.glVertex3f(0.0F, 0.0F, 0.0F); + GL11.glTexCoord2f(1.0F, 0.0F); + GL11.glVertex3f(1.0F, 0.0F, 0.0F); + GL11.glTexCoord2f(1.0F, 1.0F); + GL11.glVertex3f(1.0F, 1.0F, 0.0F); + GL11.glTexCoord2f(0.0F, 1.0F); + GL11.glVertex3f(0.0F, 1.0F, 0.0F); + GL11.glEnd(); + } + + public static void renderDeferred() { + if (hasDeferredPrograms) { + checkGLError("pre-render Deferred"); + renderComposites(33, 8, false); + mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + } + } + + public static void renderCompositeFinal() { + checkGLError("pre-render CompositeFinal"); + renderComposites(21, 8, true); + } + + private static void renderComposites(int programBase, int countPrograms, boolean renderFinal) { + if (!isShadowPass) { + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, 1.0D, 0.0D, 1.0D, 0.0D, 1.0D); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(519); + GlStateManager.depthMask(false); + GlStateManager.disableLighting(); + + if (usedShadowDepthBuffers >= 1) { + GlStateManager.setActiveTexture(33988); + GlStateManager.bindTexture(sfbDepthTextures.get(0)); + + if (usedShadowDepthBuffers >= 2) { + GlStateManager.setActiveTexture(33989); + GlStateManager.bindTexture(sfbDepthTextures.get(1)); + } + } + + int enableAltBuffers; + + for (enableAltBuffers = 0; enableAltBuffers < usedColorBuffers; ++enableAltBuffers) { + GlStateManager.setActiveTexture(33984 + colorTextureTextureImageUnit[enableAltBuffers]); + GlStateManager.bindTexture(dfbColorTexturesA[enableAltBuffers]); + } + + GlStateManager.setActiveTexture(33990); + GlStateManager.bindTexture(dfbDepthTextures.get(0)); + + if (usedDepthBuffers >= 2) { + GlStateManager.setActiveTexture(33995); + GlStateManager.bindTexture(dfbDepthTextures.get(1)); + + if (usedDepthBuffers >= 3) { + GlStateManager.setActiveTexture(33996); + GlStateManager.bindTexture(dfbDepthTextures.get(2)); + } + } + + for (enableAltBuffers = 0; enableAltBuffers < usedShadowColorBuffers; ++enableAltBuffers) { + GlStateManager.setActiveTexture(33997 + enableAltBuffers); + GlStateManager.bindTexture(sfbColorTextures.get(enableAltBuffers)); + } + + if (noiseTextureEnabled) { + GlStateManager.setActiveTexture(33984 + noiseTexture.getTextureUnit()); + GlStateManager.bindTexture(noiseTexture.getTextureId()); + } + + if (renderFinal) { + bindCustomTextures(customTexturesComposite); + } else { + bindCustomTextures(customTexturesDeferred); + } + + GlStateManager.setActiveTexture(33984); + boolean var8 = true; + int programLast; + + for (programLast = 0; programLast < usedColorBuffers; ++programLast) { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + programLast, 3553, dfbColorTexturesA[8 + programLast], 0); + } + + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, dfbDepthTextures.get(0), 0); + GL20.glDrawBuffers(dfbDrawBuffers); + checkGLError("pre-composite"); + int i; + int t0; + int t1; + + for (programLast = 0; programLast < countPrograms; ++programLast) { + if (programsID[programBase + programLast] != 0) { + useProgram(programBase + programLast); + checkGLError(programNames[programBase + programLast]); + + if (activeCompositeMipmapSetting != 0) { + genCompositeMipmap(); + } + + drawComposite(); + + for (i = 0; i < usedColorBuffers; ++i) { + if (programsToggleColorTextures[programBase + programLast][i]) { + t0 = colorTexturesToggle[i]; + t1 = colorTexturesToggle[i] = 8 - t0; + GlStateManager.setActiveTexture(33984 + colorTextureTextureImageUnit[i]); + GlStateManager.bindTexture(dfbColorTexturesA[t1 + i]); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + i, 3553, dfbColorTexturesA[t0 + i], 0); + } + } + + GlStateManager.setActiveTexture(33984); + } + } + + checkGLError("composite"); + programLast = renderFinal ? 43 : 42; + + if (programsID[programLast] != 0) { + useProgram(programLast); + checkGLError(programNames[programLast]); + + if (activeCompositeMipmapSetting != 0) { + genCompositeMipmap(); + } + + drawComposite(); + + for (i = 0; i < usedColorBuffers; ++i) { + if (programsToggleColorTextures[programLast][i]) { + t0 = colorTexturesToggle[i]; + t1 = colorTexturesToggle[i] = 8 - t0; + GlStateManager.setActiveTexture(33984 + colorTextureTextureImageUnit[i]); + GlStateManager.bindTexture(dfbColorTexturesA[t1 + i]); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + i, 3553, dfbColorTexturesA[t0 + i], 0); + } + } + + GlStateManager.setActiveTexture(33984); + } + + if (renderFinal) { + renderFinal(); + } + + if (renderFinal) { + isCompositeRendered = true; + } + + if (!renderFinal) { + for (i = 0; i < usedColorBuffers; ++i) { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + i, 3553, dfbColorTexturesA[i], 0); + } + + setDrawBuffers(programsDrawBuffers[12]); + } + + GlStateManager.enableLighting(); + GlStateManager.enableTexture2D(); + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + useProgram(0); + } + } + + private static void renderFinal() { + isRenderingDfb = false; + mc.getFramebuffer().bindFramebuffer(true); + OpenGlHelper.func_153188_a(GlStateManager.GL_FRAMEBUFFER, GlStateManager.GL_COLOR_ATTACHMENT0, 3553, mc.getFramebuffer().framebufferTexture, 0); + GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight); + + if (EntityRenderer.anaglyphEnable) { + boolean maskR = EntityRenderer.anaglyphField != 0; + GlStateManager.colorMask(maskR, !maskR, !maskR, true); + } + + GlStateManager.depthMask(true); + GL11.glClearColor(clearColorR, clearColorG, clearColorB, 1.0F); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.enableTexture2D(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(519); + GlStateManager.depthMask(false); + checkGLError("pre-final"); + useProgram(29); + checkGLError("final"); + + if (activeCompositeMipmapSetting != 0) { + genCompositeMipmap(); + } + + drawComposite(); + checkGLError("renderCompositeFinal"); + } + + public static void endRender() { + if (isShadowPass) { + checkGLError("shadow endRender"); + } else { + if (!isCompositeRendered) { + renderCompositeFinal(); + } + + isRenderingWorld = false; + GlStateManager.colorMask(true, true, true, true); + useProgram(0); + RenderHelper.disableStandardItemLighting(); + checkGLError("endRender end"); + } + } + + public static void beginSky() { + isRenderingSky = true; + fogEnabled = true; + setDrawBuffers(dfbDrawBuffers); + useProgram(5); + pushEntity(-2, 0); + } + + public static void setSkyColor(Vec3 v3color) { + skyColorR = (float)v3color.xCoord; + skyColorG = (float)v3color.yCoord; + skyColorB = (float)v3color.zCoord; + setProgramUniform3f("skyColor", skyColorR, skyColorG, skyColorB); + } + + public static void drawHorizon() { + Tessellator tess = Tessellator.instance; + float farDistance = (float)(mc.gameSettings.renderDistanceChunks * 16); + double xzq = (double)farDistance * 0.9238D; + double xzp = (double)farDistance * 0.3826D; + double xzn = -xzp; + double xzm = -xzq; + double top = 16.0D; + double bot = -cameraPositionY; + tess.startDrawingQuads(); + tess.addVertex(xzn, bot, xzm); + tess.addVertex(xzn, top, xzm); + tess.addVertex(xzm, top, xzn); + tess.addVertex(xzm, bot, xzn); + tess.addVertex(xzm, bot, xzn); + tess.addVertex(xzm, top, xzn); + tess.addVertex(xzm, top, xzp); + tess.addVertex(xzm, bot, xzp); + tess.addVertex(xzm, bot, xzp); + tess.addVertex(xzm, top, xzp); + tess.addVertex(xzn, top, xzp); + tess.addVertex(xzn, bot, xzp); + tess.addVertex(xzn, bot, xzp); + tess.addVertex(xzn, top, xzp); + tess.addVertex(xzp, top, xzq); + tess.addVertex(xzp, bot, xzq); + tess.addVertex(xzp, bot, xzq); + tess.addVertex(xzp, top, xzq); + tess.addVertex(xzq, top, xzp); + tess.addVertex(xzq, bot, xzp); + tess.addVertex(xzq, bot, xzp); + tess.addVertex(xzq, top, xzp); + tess.addVertex(xzq, top, xzn); + tess.addVertex(xzq, bot, xzn); + tess.addVertex(xzq, bot, xzn); + tess.addVertex(xzq, top, xzn); + tess.addVertex(xzp, top, xzm); + tess.addVertex(xzp, bot, xzm); + tess.addVertex(xzp, bot, xzm); + tess.addVertex(xzp, top, xzm); + tess.addVertex(xzn, top, xzm); + tess.addVertex(xzn, bot, xzm); + tess.draw(); + } + + public static void preSkyList() { + setUpPosition(); + GL11.glColor3f(fogColorR, fogColorG, fogColorB); + drawHorizon(); + GL11.glColor3f(skyColorR, skyColorG, skyColorB); + } + + public static void endSky() { + isRenderingSky = false; + setDrawBuffers(dfbDrawBuffers); + useProgram(lightmapEnabled ? 3 : 2); + popEntity(); + } + + public static void beginUpdateChunks() { + checkGLError("beginUpdateChunks1"); + checkFramebufferStatus("beginUpdateChunks1"); + + if (!isShadowPass) { + useProgram(7); + } + + checkGLError("beginUpdateChunks2"); + checkFramebufferStatus("beginUpdateChunks2"); + } + + public static void endUpdateChunks() { + checkGLError("endUpdateChunks1"); + checkFramebufferStatus("endUpdateChunks1"); + + if (!isShadowPass) { + useProgram(7); + } + + checkGLError("endUpdateChunks2"); + checkFramebufferStatus("endUpdateChunks2"); + } + + public static boolean shouldRenderClouds(GameSettings gs) { + if (!shaderPackLoaded) { + return true; + } else { + checkGLError("shouldRenderClouds"); + return isShadowPass ? configCloudShadow : gs.clouds; + } + } + + public static void beginClouds() { + fogEnabled = true; + pushEntity(-3, 0); + useProgram(6); + } + + public static void endClouds() { + disableFog(); + popEntity(); + useProgram(lightmapEnabled ? 3 : 2); + } + + public static void beginTerrain() { + if (isRenderingWorld) { + if (isShadowPass) { + GL11.glDisable(GL11.GL_CULL_FACE); + } + + fogEnabled = true; + useProgram(7); + } + } + + public static void endTerrain() { + if (isRenderingWorld) { + if (isShadowPass) { + GL11.glEnable(GL11.GL_CULL_FACE); + } + + useProgram(lightmapEnabled ? 3 : 2); + } + } + + public static void beginEntities() { + if (isRenderingWorld) { + useProgram(16); + resetDisplayListModels(); + } + } + + public static void nextEntity(Entity entity) { + if (isRenderingWorld) { + useProgram(16); + setEntityId(entity); + } + } + + public static void setEntityId(Entity entity) { + if (isRenderingWorld && !isShadowPass && uniformEntityId.isDefined()) { + int id = EntityList.getEntityID(entity); + uniformEntityId.setValue(id); + } + } + + public static void beginSpiderEyes() { + if (isRenderingWorld && programsID[18] != programsID[0]) { + useProgram(18); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.0F); + GlStateManager.blendFunc(770, 771); + } + } + + public static void endSpiderEyes() { + if (isRenderingWorld && programsID[18] != programsID[0]) { + useProgram(16); + GlStateManager.disableAlpha(); + } + } + + public static void endEntities() { + if (isRenderingWorld) { + useProgram(lightmapEnabled ? 3 : 2); + } + } + + public static void setEntityColor(float r, float g, float b, float a) { + if (isRenderingWorld && !isShadowPass) { + uniformEntityColor.setValue(r, g, b, a); + } + } + + public static void beginLivingDamage() { + if (isRenderingWorld) { + ShadersTex.bindTexture(defaultTexture); + + if (!isShadowPass) { + setDrawBuffers(drawBuffersColorAtt0); + } + } + } + + public static void endLivingDamage() { + if (isRenderingWorld && !isShadowPass) { + setDrawBuffers(programsDrawBuffers[16]); + } + } + + public static void beginBlockEntities() { + if (isRenderingWorld) { + checkGLError("beginBlockEntities"); + useProgram(13); + } + } + + public static void nextBlockEntity(TileEntity tileEntity) { + if (isRenderingWorld) { + checkGLError("nextBlockEntity"); + useProgram(13); + setBlockEntityId(tileEntity); + } + } + + public static void setBlockEntityId(TileEntity tileEntity) { + if (isRenderingWorld && !isShadowPass && uniformBlockEntityId.isDefined()) { + Block block = tileEntity.getBlockType(); + int blockId = Block.getIdFromBlock(block); + uniformBlockEntityId.setValue(blockId); + } + } + + public static void endBlockEntities() { + if (isRenderingWorld) { + checkGLError("endBlockEntities"); + useProgram(lightmapEnabled ? 3 : 2); + ShadersTex.bindNSTextures(defaultTexture.getMultiTexID()); + } + } + + public static void beginBlockDestroyProgress() { + if (isRenderingWorld) { + useProgram(7); + + if (configTweakBlockDamage) { + setDrawBuffers(drawBuffersColorAtt0); + GL11.glDepthMask(false); + } + } + } + + public static void endBlockDestroyProgress() { + if (isRenderingWorld) { + GL11.glDepthMask(true); + useProgram(3); + } + } + + public static void beginLitParticles() { + useProgram(3); + } + + public static void beginParticles() { + useProgram(2); + } + + public static void endParticles() { + useProgram(3); + } + + public static void readCenterDepth() { + if (!isShadowPass && centerDepthSmoothEnabled) { + tempDirectFloatBuffer.clear(); + GL11.glReadPixels(renderWidth / 2, renderHeight / 2, 1, 1, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, tempDirectFloatBuffer); + centerDepth = tempDirectFloatBuffer.get(0); + float fadeScalar = (float)diffSystemTime * 0.01F; + float fadeFactor = (float)Math.exp(Math.log(0.5D) * (double)fadeScalar / (double)centerDepthSmoothHalflife); + centerDepthSmooth = centerDepthSmooth * fadeFactor + centerDepth * (1.0F - fadeFactor); + } + } + + public static void beginWeather() { + if (!isShadowPass) { + if (usedDepthBuffers >= 3) { + GlStateManager.setActiveTexture(33996); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, renderWidth, renderHeight); + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.enableDepth(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.enableAlpha(); + useProgram(20); + } + } + + public static void endWeather() { + GlStateManager.disableBlend(); + useProgram(3); + } + + public static void preWater() { + if (usedDepthBuffers >= 2) { + GlStateManager.setActiveTexture(33995); + checkGLError("pre copy depth"); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, renderWidth, renderHeight); + checkGLError("copy depth"); + GlStateManager.setActiveTexture(33984); + } + + ShadersTex.bindNSTextures(defaultTexture.getMultiTexID()); + } + + public static void beginWater() { + if (isRenderingWorld) { + if (!isShadowPass) { + renderDeferred(); + useProgram(12); + GlStateManager.enableBlend(); + GlStateManager.depthMask(true); + } else { + GlStateManager.depthMask(true); + } + } + } + + public static void endWater() { + if (isRenderingWorld) { + if (isShadowPass) { + ; + } + + useProgram(lightmapEnabled ? 3 : 2); + } + } + + public static void beginProjectRedHalo() { + if (isRenderingWorld) { + useProgram(1); + } + } + + public static void endProjectRedHalo() { + if (isRenderingWorld) { + useProgram(3); + } + } + + public static void applyHandDepth() { + if ((double)configHandDepthMul != 1.0D) { + GL11.glScaled(1.0D, 1.0D, (double)configHandDepthMul); + } + } + + public static void beginHand(boolean translucent) { + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + + if (translucent) { + useProgram(41); + } else { + useProgram(19); + } + + checkGLError("beginHand"); + checkFramebufferStatus("beginHand"); + } + + public static void endHand() { + checkGLError("pre endHand"); + checkFramebufferStatus("pre endHand"); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GlStateManager.blendFunc(770, 771); + checkGLError("endHand"); + } + + public static void beginFPOverlay() { + GlStateManager.disableLighting(); + GlStateManager.disableBlend(); + } + + public static void endFPOverlay() {} + + public static void glEnableWrapper(int cap) { + GL11.glEnable(cap); + + if (cap == 3553) { + enableTexture2D(); + } else if (cap == 2912) { + enableFog(); + } + } + + public static void glDisableWrapper(int cap) { + GL11.glDisable(cap); + + if (cap == 3553) { + disableTexture2D(); + } else if (cap == 2912) { + disableFog(); + } + } + + public static void sglEnableT2D(int cap) { + GL11.glEnable(cap); + enableTexture2D(); + } + + public static void sglDisableT2D(int cap) { + GL11.glDisable(cap); + disableTexture2D(); + } + + public static void sglEnableFog(int cap) { + GL11.glEnable(cap); + enableFog(); + } + + public static void sglDisableFog(int cap) { + GL11.glDisable(cap); + disableFog(); + } + + public static void enableTexture2D() { + if (isRenderingSky) { + useProgram(5); + } else if (activeProgram == 1) { + useProgram(lightmapEnabled ? 3 : 2); + } + } + + public static void disableTexture2D() { + if (isRenderingSky) { + useProgram(4); + } else if (activeProgram == 2 || activeProgram == 3) { + useProgram(1); + } + } + + public static void beginLeash() { + useProgram(1); + } + + public static void endLeash() { + useProgram(16); + } + + public static void enableFog() { + fogEnabled = true; + setProgramUniform1i("fogMode", fogMode); + } + + public static void disableFog() { + fogEnabled = false; + setProgramUniform1i("fogMode", 0); + } + + public static void setFog(int fogMode) { + GlStateManager.setFog(fogMode); + fogMode = fogMode; + + if (fogEnabled) { + setProgramUniform1i("fogMode", fogMode); + } + } + + public static void sglFogi(int pname, int param) { + GL11.glFogi(pname, param); + + if (pname == 2917) { + fogMode = param; + + if (fogEnabled) { + setProgramUniform1i("fogMode", fogMode); + } + } + } + + public static void enableLightmap() { + lightmapEnabled = true; + + if (activeProgram == 2) { + useProgram(3); + } + } + + public static void disableLightmap() { + lightmapEnabled = false; + + if (activeProgram == 3) { + useProgram(2); + } + } + + public static int getEntityData() { + return entityData[entityDataIndex * 2]; + } + + public static int getEntityData2() { + return entityData[entityDataIndex * 2 + 1]; + } + + public static int setEntityData1(int data1) { + entityData[entityDataIndex * 2] = entityData[entityDataIndex * 2] & 65535 | data1 << 16; + return data1; + } + + public static int setEntityData2(int data2) { + entityData[entityDataIndex * 2 + 1] = entityData[entityDataIndex * 2 + 1] & -65536 | data2 & 65535; + return data2; + } + + public static void pushEntity(int data0, int data1) { + ++entityDataIndex; + entityData[entityDataIndex * 2] = data0 & 65535 | data1 << 16; + entityData[entityDataIndex * 2 + 1] = 0; + } + + public static void pushEntity(int data0) { + ++entityDataIndex; + entityData[entityDataIndex * 2] = data0 & 65535; + entityData[entityDataIndex * 2 + 1] = 0; + } + + public static void pushEntity(Block block) { + int blockId = Block.blockRegistry.getIDForObject(block); + byte metadata = 0; + blockId = BlockAliases.getMappedBlockId(blockId, metadata); + ++entityDataIndex; + entityData[entityDataIndex * 2] = blockId & 65535 | block.getRenderType() << 16; + entityData[entityDataIndex * 2 + 1] = metadata; + } + + public static void pushEntity(RenderBlocks rb, Block block, int x, int y, int z) { + int blockId = Block.blockRegistry.getIDForObject(block); + int metadata = rb.blockAccess.getBlockMetadata(x, y, z); + blockId = BlockAliases.getMappedBlockId(blockId, metadata); + ++entityDataIndex; + entityData[entityDataIndex * 2] = blockId & 65535 | block.getRenderType() << 16; + entityData[entityDataIndex * 2 + 1] = metadata; + } + + public static void popEntity() { + entityData[entityDataIndex * 2] = 0; + entityData[entityDataIndex * 2 + 1] = 0; + --entityDataIndex; + } + + public static void mcProfilerEndSection() { + mc.mcProfiler.endSection(); + } + + public static String getShaderPackName() { + return shaderPack == null ? null : (shaderPack instanceof ShaderPackNone ? null : shaderPack.getName()); + } + + public static InputStream getShaderPackResourceStream(String path) { + return shaderPack == null ? null : shaderPack.getResourceAsStream(path); + } + + public static void nextAntialiasingLevel() { + configAntialiasingLevel += 2; + configAntialiasingLevel = configAntialiasingLevel / 2 * 2; + + if (configAntialiasingLevel > 4) { + configAntialiasingLevel = 0; + } + + configAntialiasingLevel = Config.limit(configAntialiasingLevel, 0, 4); + } + + public static void checkShadersModInstalled() { + Class cls = null; + + try { + cls = Class.forName("shadersmod.transform.SMCClassTransformer"); + } catch (Throwable var3) { + ; + } + + try { + cls = Class.forName("shadersmodcore.transform.SMCClassTransformer"); + } catch (Throwable var2) { + ; + } + + if (cls != null) { + throw new RuntimeException("Shaders Mod detected. Please remove it, OptiFine has built-in support for shaders."); + } + } + + public static void resourcesReloaded() { + loadShaderPackResources(); + + if (shaderPackLoaded) { + BlockAliases.resourcesReloaded(); + } + } + + private static void loadShaderPackResources() { + shaderPackResources = new HashMap(); + + if (shaderPackLoaded) { + ArrayList listFiles = new ArrayList(); + String PREFIX = "/shaders/lang/"; + String EN_US = "en_US"; + String SUFFIX = ".lang"; + listFiles.add(PREFIX + EN_US + SUFFIX); + + if (!Config.getGameSettings().language.equals(EN_US)) { + listFiles.add(PREFIX + Config.getGameSettings().language + SUFFIX); + } + + try { + Iterator e = listFiles.iterator(); + + while (e.hasNext()) { + String file = (String)e.next(); + InputStream in = shaderPack.getResourceAsStream(file); + + if (in != null) { + Properties props = new Properties(); + Lang.loadLocaleData(in, props); + in.close(); + Set keys = props.keySet(); + Iterator itp = keys.iterator(); + + while (itp.hasNext()) { + String key = (String)itp.next(); + String value = props.getProperty(key); + shaderPackResources.put(key, value); + } + } + } + } catch (IOException var12) { + var12.printStackTrace(); + } + } + } + + public static String translate(String key, String def) { + String str = (String)shaderPackResources.get(key); + return str == null ? def : str; + } + + public static boolean isProgramPath(String program) { + if (program == null) { + return false; + } else if (program.length() <= 0) { + return false; + } else { + int pos = program.lastIndexOf("/"); + + if (pos >= 0) { + program = program.substring(pos + 1); + } + + return Arrays.asList(programNames).contains(program); + } + } + + public static void setItemToRenderMain(ItemStack itemToRenderMain) { + itemToRenderMainTranslucent = isTranslucentBlock(itemToRenderMain); + } + + public static boolean isItemToRenderMainTranslucent() { + return itemToRenderMainTranslucent; + } + + private static boolean isTranslucentBlock(ItemStack stack) { + if (stack == null) { + return false; + } else { + Item item = stack.getItem(); + + if (item == null) { + return false; + } else if (!(item instanceof ItemBlock)) { + return false; + } else { + ItemBlock itemBlock = (ItemBlock)item; + Block block = (Block)Reflector.getFieldValue((ItemBlock)item, Reflector.ItemBlock_block); + + if (block == null) { + return false; + } else { + int renderPass = block.getRenderBlockPass(); + return renderPass != 0; + } + } + } + } + + public static boolean isRenderBothHands() { + return false; + } + + public static boolean isHandRenderedMain() { + return isHandRenderedMain; + } + + public static void setHandRenderedMain(boolean isHandRenderedMain) { + isHandRenderedMain = isHandRenderedMain; + } + + public static float getShadowRenderDistance() { + return shadowDistanceRenderMul < 0.0F ? -1.0F : shadowMapHalfPlane * shadowDistanceRenderMul; + } + + public static void setRenderingFirstPersonHand(boolean flag) { + isRenderingFirstPersonHand = flag; + } + + public static boolean isRenderingFirstPersonHand() { + return isRenderingFirstPersonHand; + } + + public static void beginBeacon() { + if (isRenderingWorld) { + useProgram(14); + } + } + + public static void endBeacon() { + if (isRenderingWorld) { + useProgram(13); + } + } + + public static World getCurrentWorld() { + return currentWorld; + } + + public static Vec3 getCameraPosition() { + return Vec3.createVectorHelper(cameraPositionX, cameraPositionY, cameraPositionZ); + } + + public static boolean isCustomUniforms() { + return customUniforms != null; + } + + static { + drawBuffersNone.limit(0); + drawBuffersColorAtt0.put(36064).position(0).limit(1); + formatNames = new String[] {"R8", "RG8", "RGB8", "RGBA8", "R8_SNORM", "RG8_SNORM", "RGB8_SNORM", "RGBA8_SNORM", "R16", "RG16", "RGB16", "RGBA16", "R16_SNORM", "RG16_SNORM", "RGB16_SNORM", "RGBA16_SNORM", "R16F", "RG16F", "RGB16F", "RGBA16F", "R32F", "RG32F", "RGB32F", "RGBA32F", "R32I", "RG32I", "RGB32I", "RGBA32I", "R32UI", "RG32UI", "RGB32UI", "RGBA32UI", "R3_G3_B2", "RGB5_A1", "RGB10_A2", "R11F_G11F_B10F", "RGB9_E5"}; + formatIds = new int[] {33321, 33323, 32849, 32856, 36756, 36757, 36758, 36759, 33322, 33324, 32852, 32859, 36760, 36761, 36762, 36763, 33325, 33327, 34843, 34842, 33326, 33328, 34837, 34836, 33333, 33339, 36227, 36226, 33334, 33340, 36209, 36208, 10768, 32855, 32857, 35898, 35901}; + patternLoadEntityDataMap = Pattern.compile("\\s*([\\w:]+)\\s*=\\s*([-]?\\d+)\\s*"); + entityData = new int[32]; + entityDataIndex = 0; + } + + static class NamelessClass363063280 { + static final int[] $SwitchMap$shadersmod$client$EnumShaderOption = new int[EnumShaderOption.values().length]; + + static { + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.ANTIALIASING.ordinal()] = 1; + } catch (NoSuchFieldError var18) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.NORMAL_MAP.ordinal()] = 2; + } catch (NoSuchFieldError var17) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SPECULAR_MAP.ordinal()] = 3; + } catch (NoSuchFieldError var16) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.RENDER_RES_MUL.ordinal()] = 4; + } catch (NoSuchFieldError var15) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SHADOW_RES_MUL.ordinal()] = 5; + } catch (NoSuchFieldError var14) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.HAND_DEPTH_MUL.ordinal()] = 6; + } catch (NoSuchFieldError var13) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.CLOUD_SHADOW.ordinal()] = 7; + } catch (NoSuchFieldError var12) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.OLD_HAND_LIGHT.ordinal()] = 8; + } catch (NoSuchFieldError var11) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.OLD_LIGHTING.ordinal()] = 9; + } catch (NoSuchFieldError var10) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SHADER_PACK.ordinal()] = 10; + } catch (NoSuchFieldError var9) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TWEAK_BLOCK_DAMAGE.ordinal()] = 11; + } catch (NoSuchFieldError var8) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.SHADOW_CLIP_FRUSTRUM.ordinal()] = 12; + } catch (NoSuchFieldError var7) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MIN_FIL_B.ordinal()] = 13; + } catch (NoSuchFieldError var6) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MIN_FIL_N.ordinal()] = 14; + } catch (NoSuchFieldError var5) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MIN_FIL_S.ordinal()] = 15; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MAG_FIL_B.ordinal()] = 16; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MAG_FIL_N.ordinal()] = 17; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$shadersmod$client$EnumShaderOption[EnumShaderOption.TEX_MAG_FIL_S.ordinal()] = 18; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersBuiltIn.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersBuiltIn.java new file mode 100644 index 0000000..2001b0b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersBuiltIn.java @@ -0,0 +1,169 @@ +package shadersmod.client; + +import java.io.Reader; +import java.io.StringReader; +import java.util.ArrayList; +import net.minecraft.src.Config; +import shadersmod.common.SMCLog; + +public class ShadersBuiltIn { + public static Reader getShaderReader(String filename) { + return filename.endsWith("/deferred_last.vsh") ? getCompositeShaderReader(true, true) : (filename.endsWith("/composite_last.vsh") ? getCompositeShaderReader(false, true) : (filename.endsWith("/deferred_last.fsh") ? getCompositeShaderReader(true, false) : (filename.endsWith("/composite_last.fsh") ? getCompositeShaderReader(false, false) : null))); + } + + private static Reader getCompositeShaderReader(boolean deferred, boolean vertex) { + if (!hasDeferredPrograms() && !hasSkipClear()) { + return null; + } else { + int[] flipBuffers = getLastFlipBuffers(deferred); + + if (flipBuffers == null) { + return null; + } else { + String shader; + + if (!vertex) { + shader = deferred ? "deferred" : "composite"; + SMCLog.info("flipped buffers after " + shader + ": " + Config.arrayToString(flipBuffers)); + } + + if (vertex) { + shader = getCompositeVertexShader(flipBuffers); + } else { + shader = getCompositeFragmentShader(flipBuffers); + } + + return new StringReader(shader); + } + } + } + + private static Reader getCompositeFragmentShaderReader(boolean deferred) { + if (!hasDeferredPrograms() && !hasSkipClear()) { + return null; + } else { + int[] flipBuffers = getLastFlipBuffers(deferred); + + if (flipBuffers == null) { + return null; + } else { + String shader = getCompositeFragmentShader(flipBuffers); + return new StringReader(shader); + } + } + } + + private static boolean hasDeferredPrograms() { + for (int i = 33; i < 41; ++i) { + if (Shaders.programsID[i] != 0) { + return true; + } + } + + return false; + } + + private static boolean hasSkipClear() { + for (int i = 0; i < Shaders.gbuffersClear.length; ++i) { + if (!Shaders.gbuffersClear[i]) { + return true; + } + } + + return false; + } + + private static String getCompositeVertexShader(int[] buffers) { + ArrayList list = new ArrayList(); + list.add("#version 120 "); + list.add("varying vec2 texcoord; "); + list.add("void main() "); + list.add("{ "); + list.add(" gl_Position = ftransform(); "); + list.add(" texcoord = gl_MultiTexCoord0.xy; "); + list.add("} "); + return Config.listToString(list, "\n"); + } + + private static String getCompositeFragmentShader(int[] buffers) { + ArrayList list = new ArrayList(); + String drawBuffers = Config.arrayToString(buffers, ""); + list.add("#version 120 "); + int i; + + for (i = 0; i < buffers.length; ++i) { + list.add("uniform sampler2D colortex" + buffers[i] + "; "); + } + + list.add("varying vec2 texcoord; "); + list.add("/* DRAWBUFFERS:" + drawBuffers + " */ "); + list.add("void main() "); + list.add("{ "); + + for (i = 0; i < buffers.length; ++i) { + list.add(" gl_FragData[" + i + "] = texture2D(colortex" + buffers[i] + ", texcoord); "); + } + + list.add("} "); + return Config.listToString(list, "\n"); + } + + private static int[] getLastFlipBuffers(boolean deferred) { + return deferred ? getLastFlipBuffers(33, 8) : getLastFlipBuffers(21, 8); + } + + private static int[] getLastFlipBuffers(int programStart, int programCount) { + ArrayList list = new ArrayList(); + boolean[] toggled = new boolean[8]; + int arr; + + for (arr = programStart; arr < programStart + programCount; ++arr) { + if (Shaders.programsID[arr] != 0) { + boolean[] toggle = getProgramTogglesTexture(arr); + + for (int t = 0; t < toggle.length; ++t) { + boolean toggle1 = toggle[t]; + + if (toggle1) { + toggled[t] = !toggled[t]; + } + } + } + } + + for (arr = 0; arr < toggled.length; ++arr) { + boolean var9 = toggled[arr]; + + if (var9) { + list.add(new Integer(arr)); + } + } + + if (list.isEmpty()) { + return null; + } else { + Integer[] var8 = (Integer[])list.toArray(new Integer[list.size()]); + return Config.toPrimitive(var8); + } + } + + private static boolean[] getProgramTogglesTexture(int program) { + boolean[] toggles = new boolean[8]; + String drawBufStr = Shaders.programsDrawBufSettings[program]; + + if (drawBufStr == null) { + return toggles; + } else { + for (int i = 0; i < drawBufStr.length(); ++i) { + char ch = drawBufStr.charAt(i); + int buf = ch - 48; + + if (buf >= 0 && buf < toggles.length) { + toggles[buf] = true; + } + } + + return toggles; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersRender.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersRender.java new file mode 100644 index 0000000..f2c4604 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersRender.java @@ -0,0 +1,404 @@ +package shadersmod.client; + +import java.nio.IntBuffer; + +import com.cheatbreaker.client.CheatBreaker; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.culling.ClippingHelper; +import net.minecraft.client.renderer.culling.Frustrum; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.src.Config; +import net.minecraft.src.GlStateManager; +import net.minecraft.src.Reflector; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.EXTFramebufferObject; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; +import org.lwjgl.opengl.GL30; + +public class ShadersRender { + private static final ResourceLocation END_PORTAL_TEXTURE = new ResourceLocation("textures/entity/end_portal.png"); + + public static void setFrustrumPosition(Frustrum frustrum, double x, double y, double z) { + frustrum.setPosition(x, y, z); + } + + public static void beginTerrainSolid() { + if (Shaders.isRenderingWorld) { + Shaders.fogEnabled = true; + Shaders.useProgram(7); + } + } + + public static void beginTerrainCutoutMipped() { + if (Shaders.isRenderingWorld) { + Shaders.useProgram(7); + } + } + + public static void beginTerrainCutout() { + if (Shaders.isRenderingWorld) { + Shaders.useProgram(7); + } + } + + public static void endTerrain() { + if (Shaders.isRenderingWorld) { + Shaders.useProgram(3); + } + } + + public static void beginTranslucent() { + if (Shaders.isRenderingWorld) { + if (Shaders.usedDepthBuffers >= 2) { + GlStateManager.setActiveTexture(33995); + Shaders.checkGLError("pre copy depth"); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, Shaders.renderWidth, Shaders.renderHeight); + Shaders.checkGLError("copy depth"); + GlStateManager.setActiveTexture(33984); + } + + Shaders.useProgram(12); + } + } + + public static void endTranslucent() { + if (Shaders.isRenderingWorld) { + Shaders.useProgram(3); + } + } + + public static void renderHand0(EntityRenderer er, float par1, int par2) { + if (!Shaders.isShadowPass) { + boolean blockTranslucentMain = Shaders.isItemToRenderMainTranslucent(); + + if (!blockTranslucentMain) { + Shaders.readCenterDepth(); + Shaders.beginHand(false); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + er.renderHand(par1, par2, true, false, false); + Shaders.endHand(); + Shaders.setHandRenderedMain(true); + } + } + } + + public static void renderHand1(EntityRenderer er, float par1, int par2) { + if (!Shaders.isShadowPass && !Shaders.isHandRenderedMain()) { + Shaders.readCenterDepth(); + GlStateManager.enableBlend(); + Shaders.beginHand(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + er.renderHand(par1, par2, true, false, true); + Shaders.endHand(); + Shaders.setHandRenderedMain(true); + } + } + + public static void renderItemFP(ItemRenderer itemRenderer, float par1, boolean renderTranslucent) { + Shaders.setRenderingFirstPersonHand(true); + GlStateManager.depthMask(true); + + if (renderTranslucent) { + GlStateManager.depthFunc(519); + GL11.glPushMatrix(); + IntBuffer drawBuffers = Shaders.activeDrawBuffers; + Shaders.setDrawBuffers(Shaders.drawBuffersNone); + Shaders.renderItemKeepDepthMask = true; + itemRenderer.renderItemInFirstPerson(par1); + Shaders.renderItemKeepDepthMask = false; + Shaders.setDrawBuffers(drawBuffers); + GL11.glPopMatrix(); + } + + GlStateManager.depthFunc(515); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + itemRenderer.renderItemInFirstPerson(par1); + Shaders.setRenderingFirstPersonHand(false); + } + + public static void renderFPOverlay(EntityRenderer er, float par1, int par2) { + if (!Shaders.isShadowPass) { + Shaders.beginFPOverlay(); + er.renderHand(par1, par2, false, true, false); + Shaders.endFPOverlay(); + } + } + + public static void beginBlockDamage() { + if (Shaders.isRenderingWorld) { + Shaders.useProgram(11); + + if (Shaders.programsID[11] == Shaders.programsID[7]) { + Shaders.setDrawBuffers(Shaders.drawBuffersColorAtt0); + GlStateManager.depthMask(false); + } + } + } + + public static void endBlockDamage() { + if (Shaders.isRenderingWorld) { + GlStateManager.depthMask(true); + Shaders.useProgram(3); + } + } + + public static void renderShadowMap(EntityRenderer entityRenderer, int pass, float partialTicks, long finishTimeNano) { + if (Shaders.usedShadowDepthBuffers > 0 && --Shaders.shadowPassCounter <= 0) { + Minecraft mc = Minecraft.getMinecraft(); + mc.mcProfiler.endStartSection("shadow pass"); + RenderGlobal renderGlobal = mc.renderGlobal; + Shaders.isShadowPass = true; + Shaders.shadowPassCounter = Shaders.shadowPassInterval; + Shaders.preShadowPassThirdPersonView = mc.gameSettings.thirdPersonView; + mc.gameSettings.thirdPersonView = 1; + Shaders.checkGLError("pre shadow"); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + mc.mcProfiler.endStartSection("shadow clear"); + EXTFramebufferObject.glBindFramebufferEXT(36160, Shaders.sfb); + Shaders.checkGLError("shadow bind sfb"); + Shaders.useProgram(30); + mc.mcProfiler.endStartSection("shadow camera"); + boolean dragToLookEnabled = CheatBreaker.getInstance().getModuleManager().dragToLook.enabled; + entityRenderer.setupCameraTransform(partialTicks, 2, dragToLookEnabled); + Shaders.setCameraShadow(partialTicks); + ActiveRenderInfo.updateRenderInfo(mc.thePlayer, mc.gameSettings.thirdPersonView == 2); + Shaders.checkGLError("shadow camera"); + GL20.glDrawBuffers(Shaders.sfbDrawBuffers); + Shaders.checkGLError("shadow drawbuffers"); + GL11.glReadBuffer(0); + Shaders.checkGLError("shadow readbuffer"); + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, Shaders.sfbDepthTextures.get(0), 0); + + if (Shaders.usedShadowColorBuffers != 0) { + EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064, 3553, Shaders.sfbColorTextures.get(0), 0); + } + + Shaders.checkFramebufferStatus("shadow fb"); + GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glClear(Shaders.usedShadowColorBuffers != 0 ? GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT : GL11.GL_DEPTH_BUFFER_BIT); + Shaders.checkGLError("shadow clear"); + mc.mcProfiler.endStartSection("shadow frustum"); + ClippingHelper clippingHelper = ClippingHelperShadow.getInstance(); + mc.mcProfiler.endStartSection("shadow culling"); + Frustrum frustum = new Frustrum(clippingHelper); + EntityLivingBase viewEntity = mc.renderViewEntity; + double viewPosX = viewEntity.lastTickPosX + (viewEntity.posX - viewEntity.lastTickPosX) * (double)partialTicks; + double viewPosY = viewEntity.lastTickPosY + (viewEntity.posY - viewEntity.lastTickPosY) * (double)partialTicks; + double viewPosZ = viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * (double)partialTicks; + frustum.setPosition(viewPosX, viewPosY, viewPosZ); + GlStateManager.shadeModel(7425); + GlStateManager.enableDepth(); + GlStateManager.depthFunc(515); + GlStateManager.depthMask(true); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.disableCull(); + mc.mcProfiler.endStartSection("shadow prepareterrain"); + mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + mc.mcProfiler.endStartSection("shadow setupterrain"); + boolean frameCount = false; + int var19 = entityRenderer.frameCount; + entityRenderer.frameCount = var19 + 1; + WorldRenderer[] worldRenderers = renderGlobal.worldRenderers; + + for (int i = 0; i < worldRenderers.length; ++i) { + if (!worldRenderers[i].skipAllRenderPasses()) { + worldRenderers[i].isInFrustum = true; + } + } + + mc.mcProfiler.endStartSection("shadow updatechunks"); + mc.mcProfiler.endStartSection("shadow terrain"); + GlStateManager.matrixMode(5888); + GlStateManager.pushMatrix(); + GlStateManager.enableAlpha(); + renderGlobal.renderAllSortedRenderers(0, (double)partialTicks); + Shaders.checkGLError("shadow terrain cutoutmipped"); + GlStateManager.shadeModel(7424); + GlStateManager.alphaFunc(516, 0.1F); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + mc.mcProfiler.endStartSection("shadow entities"); + + if (Reflector.ForgeHooksClient_setRenderPass.exists()) { + Reflector.callVoid(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(0)}); + } + + RenderHelper.enableStandardItemLighting(); + renderGlobal.renderEntities(viewEntity, frustum, partialTicks); + RenderHelper.disableStandardItemLighting(); + Shaders.checkGLError("shadow entities"); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + GlStateManager.enableCull(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.alphaFunc(516, 0.1F); + + if (Shaders.usedShadowDepthBuffers >= 2) { + GlStateManager.setActiveTexture(33989); + Shaders.checkGLError("pre copy shadow depth"); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, Shaders.shadowMapWidth, Shaders.shadowMapHeight); + Shaders.checkGLError("copy shadow depth"); + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.disableBlend(); + GlStateManager.depthMask(true); + mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + GlStateManager.shadeModel(7425); + Shaders.checkGLError("shadow pre-translucent"); + GL20.glDrawBuffers(Shaders.sfbDrawBuffers); + Shaders.checkGLError("shadow drawbuffers pre-translucent"); + Shaders.checkFramebufferStatus("shadow pre-translucent"); + + if (Shaders.isRenderShadowTranslucent()) { + mc.mcProfiler.endStartSection("shadow translucent"); + renderGlobal.renderAllSortedRenderers(1, (double)partialTicks); + Shaders.checkGLError("shadow translucent"); + } + + if (Reflector.ForgeHooksClient_setRenderPass.exists()) { + RenderHelper.enableStandardItemLighting(); + Reflector.call(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(1)}); + renderGlobal.renderEntities(viewEntity, frustum, partialTicks); + Reflector.call(Reflector.ForgeHooksClient_setRenderPass, new Object[] {Integer.valueOf(-1)}); + RenderHelper.disableStandardItemLighting(); + Shaders.checkGLError("shadow entities 1"); + } + + GlStateManager.shadeModel(7424); + GlStateManager.depthMask(true); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GL11.glFlush(); + Shaders.checkGLError("shadow flush"); + Shaders.isShadowPass = false; + mc.gameSettings.thirdPersonView = Shaders.preShadowPassThirdPersonView; + mc.mcProfiler.endStartSection("shadow postprocess"); + + if (Shaders.hasGlGenMipmap) { + if (Shaders.usedShadowDepthBuffers >= 1) { + if (Shaders.shadowMipmapEnabled[0]) { + GlStateManager.setActiveTexture(33988); + GlStateManager.bindTexture(Shaders.sfbDepthTextures.get(0)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowFilterNearest[0] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + if (Shaders.usedShadowDepthBuffers >= 2 && Shaders.shadowMipmapEnabled[1]) { + GlStateManager.setActiveTexture(33989); + GlStateManager.bindTexture(Shaders.sfbDepthTextures.get(1)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowFilterNearest[1] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + GlStateManager.setActiveTexture(33984); + } + + if (Shaders.usedShadowColorBuffers >= 1) { + if (Shaders.shadowColorMipmapEnabled[0]) { + GlStateManager.setActiveTexture(33997); + GlStateManager.bindTexture(Shaders.sfbColorTextures.get(0)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowColorFilterNearest[0] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + if (Shaders.usedShadowColorBuffers >= 2 && Shaders.shadowColorMipmapEnabled[1]) { + GlStateManager.setActiveTexture(33998); + GlStateManager.bindTexture(Shaders.sfbColorTextures.get(1)); + GL30.glGenerateMipmap(3553); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.shadowColorFilterNearest[1] ? GL11.GL_NEAREST_MIPMAP_NEAREST : GL11.GL_LINEAR_MIPMAP_LINEAR); + } + + GlStateManager.setActiveTexture(33984); + } + } + + Shaders.checkGLError("shadow postprocess"); + EXTFramebufferObject.glBindFramebufferEXT(36160, Shaders.dfb); + GL11.glViewport(0, 0, Shaders.renderWidth, Shaders.renderHeight); + Shaders.activeDrawBuffers = null; + mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + Shaders.useProgram(7); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + Shaders.checkGLError("shadow end"); + } + } + + public static void beaconBeamBegin() { + Shaders.useProgram(14); + } + + public static void beaconBeamStartQuad1() {} + + public static void beaconBeamStartQuad2() {} + + public static void beaconBeamDraw1() {} + + public static void beaconBeamDraw2() { + GlStateManager.disableBlend(); + } + + public static void renderEnchantedGlintBegin() { + Shaders.useProgram(17); + } + + public static void renderEnchantedGlintEnd() { + if (Shaders.isRenderingWorld) { + if (Shaders.isRenderingFirstPersonHand() && Shaders.isRenderBothHands()) { + Shaders.useProgram(19); + } else { + Shaders.useProgram(16); + } + } else { + Shaders.useProgram(0); + } + } + + public static boolean renderEndPortal(TileEntityEndPortal te, double x, double y, double z, float partialTicks, int destroyStage, float offset) { + if (!Shaders.isShadowPass && Shaders.programsID[Shaders.activeProgram] == 0) { + return false; + } else { + GlStateManager.disableLighting(); + Config.getTextureManager().bindTexture(END_PORTAL_TEXTURE); + Tessellator vertexbuffer = Tessellator.instance; + vertexbuffer.startDrawing(7); + float col = 0.5F; + float r = col * 0.15F; + float g = col * 0.3F; + float b = col * 0.4F; + float u0 = 0.0F; + float u1 = 0.2F; + float du = (float)(System.currentTimeMillis() % 100000L) / 100000.0F; + short lu = 240; + vertexbuffer.setColorRGBA_F(r, g, b, 1.0F); + vertexbuffer.setBrightness(lu << 16 | lu); + vertexbuffer.addVertexWithUV(x, y + (double)offset, z + 1.0D, (double)(u0 + du), (double)(u0 + du)); + vertexbuffer.addVertexWithUV(x + 1.0D, y + (double)offset, z + 1.0D, (double)(u0 + du), (double)(u1 + du)); + vertexbuffer.addVertexWithUV(x + 1.0D, y + (double)offset, z, (double)(u1 + du), (double)(u1 + du)); + vertexbuffer.addVertexWithUV(x, y + (double)offset, z, (double)(u1 + du), (double)(u0 + du)); + vertexbuffer.draw(); + GlStateManager.enableLighting(); + return true; + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersTess.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersTess.java new file mode 100644 index 0000000..d28bf58 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersTess.java @@ -0,0 +1,448 @@ +package shadersmod.client; + +import java.nio.FloatBuffer; +import java.nio.ShortBuffer; +import java.util.Arrays; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import org.lwjgl.opengl.ARBVertexShader; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; +import shadersmod.common.SMCLog; + +public class ShadersTess { + public static final int vertexStride = 18; + public float midTextureU; + public float midTextureV; + public float normalX; + public float normalY; + public float normalZ; + public float v0x; + public float v0y; + public float v0z; + public float v0u; + public float v0v; + public float v1x; + public float v1y; + public float v1z; + public float v1u; + public float v1v; + public float v2x; + public float v2y; + public float v2z; + public float v2u; + public float v2v; + public float v3x; + public float v3y; + public float v3z; + public float v3u; + public float v3v; + + public static int draw(Tessellator tess) { + if (!tess.isDrawing) { + throw new IllegalStateException("Not tesselating!"); + } else { + tess.isDrawing = false; + + if (tess.drawMode == 7 && tess.vertexCount % 4 != 0) { + SMCLog.warning("%s", new Object[] {"bad vertexCount"}); + } + + int voffset = 0; + int realDrawMode = tess.drawMode; + int n; + + while (voffset < tess.vertexCount) { + n = Math.min(tess.vertexCount - voffset, tess.byteBuffer.capacity() / 72); + + if (realDrawMode == 7) { + n = n / 4 * 4; + } + + tess.floatBuffer.clear(); + tess.shortBuffer.clear(); + tess.intBuffer.clear(); + tess.intBuffer.put(tess.rawBuffer, voffset * 18, n * 18); + tess.byteBuffer.position(0); + tess.byteBuffer.limit(n * 72); + voffset += n; + + if (tess.hasTexture) { + tess.floatBuffer.position(3); + GL11.glTexCoordPointer(2, 72, tess.floatBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (tess.hasBrightness) { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + tess.shortBuffer.position(12); + GL11.glTexCoordPointer(2, 72, tess.shortBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (tess.hasColor) { + tess.byteBuffer.position(20); + GL11.glColorPointer(4, true, 72, tess.byteBuffer); + GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + } + + if (tess.hasNormals) { + tess.floatBuffer.position(9); + GL11.glNormalPointer(72, tess.floatBuffer); + GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + } + + tess.floatBuffer.position(0); + GL11.glVertexPointer(3, 72, tess.floatBuffer); + preDrawArray(tess); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL11.glDrawArrays(realDrawMode, 0, n); + } + + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + postDrawArray(tess); + + if (tess.hasTexture) { + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (tess.hasBrightness) { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (tess.hasColor) { + GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + } + + if (tess.hasNormals) { + GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + } + + n = tess.rawBufferIndex * 4; + tess.reset(); + return n; + } + } + + public static void preDrawArray(Tessellator tess) { + if (Shaders.useMultiTexCoord3Attrib && tess.hasTexture) { + GL13.glClientActiveTexture(GL13.GL_TEXTURE3); + GL11.glTexCoordPointer(2, 72, (FloatBuffer)tess.floatBuffer.position(16)); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + GL13.glClientActiveTexture(GL13.GL_TEXTURE0); + } + + if (Shaders.useMidTexCoordAttrib && tess.hasTexture) { + ARBVertexShader.glVertexAttribPointerARB(Shaders.midTexCoordAttrib, 2, false, 72, (FloatBuffer)tess.floatBuffer.position(16)); + ARBVertexShader.glEnableVertexAttribArrayARB(Shaders.midTexCoordAttrib); + } + + if (Shaders.useTangentAttrib && tess.hasTexture) { + ARBVertexShader.glVertexAttribPointerARB(Shaders.tangentAttrib, 4, false, 72, (FloatBuffer)tess.floatBuffer.position(12)); + ARBVertexShader.glEnableVertexAttribArrayARB(Shaders.tangentAttrib); + } + + if (Shaders.useEntityAttrib) { + ARBVertexShader.glVertexAttribPointerARB(Shaders.entityAttrib, 3, false, false, 72, (ShortBuffer)tess.shortBuffer.position(14)); + ARBVertexShader.glEnableVertexAttribArrayARB(Shaders.entityAttrib); + } + } + + public static void preDrawArrayVBO(Tessellator tess) { + if (Shaders.useMultiTexCoord3Attrib && tess.hasTexture) { + GL13.glClientActiveTexture(GL13.GL_TEXTURE3); + GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 72, 64L); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + GL13.glClientActiveTexture(GL13.GL_TEXTURE0); + } + + if (Shaders.useMidTexCoordAttrib && tess.hasTexture) { + ARBVertexShader.glVertexAttribPointerARB(Shaders.midTexCoordAttrib, 2, 5126, false, 72, 64L); + ARBVertexShader.glEnableVertexAttribArrayARB(Shaders.midTexCoordAttrib); + } + + if (Shaders.useTangentAttrib && tess.hasTexture) { + ARBVertexShader.glVertexAttribPointerARB(Shaders.tangentAttrib, 4, 5126, false, 72, 48L); + ARBVertexShader.glEnableVertexAttribArrayARB(Shaders.tangentAttrib); + } + + if (Shaders.useEntityAttrib) { + ARBVertexShader.glVertexAttribPointerARB(Shaders.entityAttrib, 3, 5122, false, 72, 28L); + ARBVertexShader.glEnableVertexAttribArrayARB(Shaders.entityAttrib); + } + } + + public static void postDrawArray(Tessellator tess) { + if (Shaders.useEntityAttrib) { + ARBVertexShader.glDisableVertexAttribArrayARB(Shaders.entityAttrib); + } + + if (Shaders.useMidTexCoordAttrib && tess.hasTexture) { + ARBVertexShader.glDisableVertexAttribArrayARB(Shaders.midTexCoordAttrib); + } + + if (Shaders.useTangentAttrib && tess.hasTexture) { + ARBVertexShader.glDisableVertexAttribArrayARB(Shaders.tangentAttrib); + } + + if (Shaders.useMultiTexCoord3Attrib && tess.hasTexture) { + GL13.glClientActiveTexture(GL13.GL_TEXTURE3); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + GL13.glClientActiveTexture(GL13.GL_TEXTURE0); + } + } + + public static void addVertex(Tessellator tess, double parx, double pary, double parz) { + ShadersTess stess = tess.shadersTess; + int[] rawBuffer = tess.rawBuffer; + int rbi = tess.rawBufferIndex; + float fx = (float)(parx + tess.xOffset); + float fy = (float)(pary + tess.yOffset); + float fz = (float)(parz + tess.zOffset); + + if (rbi >= tess.bufferSize - 72) { + if (tess.bufferSize >= 16777216) { + if (tess.addedVertices % 4 == 0) { + tess.draw(); + tess.isDrawing = true; + } + } else if (tess.bufferSize > 0) { + tess.bufferSize *= 2; + tess.rawBuffer = rawBuffer = Arrays.copyOf(tess.rawBuffer, tess.bufferSize); + SMCLog.info("Expand tesselator buffer %d", new Object[] {Integer.valueOf(tess.bufferSize)}); + } else { + tess.bufferSize = 65536; + tess.rawBuffer = rawBuffer = new int[tess.bufferSize]; + } + } + + int i; + float x1; + float y1; + float z1; + float x2; + float y2; + float z2; + float vnx; + float vny; + float vnz; + float lensq; + float mult; + float u1; + float v1; + float u2; + float v2; + float d; + float r; + float tan1x; + float tan1y; + float tan1z; + float tan2x; + float tan2y; + float tan2z; + float tan3x; + float tan3y; + float tan3z; + float tan1w; + + if (tess.drawMode == 7) { + i = tess.addedVertices % 4; + + switch (i) { + case 0: + stess.v0x = fx; + stess.v0y = fy; + stess.v0z = fz; + stess.v0u = (float)tess.textureU; + stess.v0v = (float)tess.textureV; + break; + + case 1: + stess.v1x = fx; + stess.v1y = fy; + stess.v1z = fz; + stess.v1u = (float)tess.textureU; + stess.v1v = (float)tess.textureV; + break; + + case 2: + stess.v2x = fx; + stess.v2y = fy; + stess.v2z = fz; + stess.v2u = (float)tess.textureU; + stess.v2v = (float)tess.textureV; + break; + + case 3: + stess.v3x = fx; + stess.v3y = fy; + stess.v3z = fz; + stess.v3u = (float)tess.textureU; + stess.v3v = (float)tess.textureV; + x1 = stess.v2x - stess.v0x; + y1 = stess.v2y - stess.v0y; + z1 = stess.v2z - stess.v0z; + x2 = stess.v3x - stess.v1x; + y2 = stess.v3y - stess.v1y; + z2 = stess.v3z - stess.v1z; + vnx = y1 * z2 - y2 * z1; + vny = z1 * x2 - z2 * x1; + vnz = x1 * y2 - x2 * y1; + lensq = vnx * vnx + vny * vny + vnz * vnz; + mult = (double)lensq != 0.0D ? (float)(1.0D / Math.sqrt((double)lensq)) : 1.0F; + vnx *= mult; + vny *= mult; + vnz *= mult; + tess.hasNormals = true; + x1 = stess.v1x - stess.v0x; + y1 = stess.v1y - stess.v0y; + z1 = stess.v1z - stess.v0z; + u1 = stess.v1u - stess.v0u; + v1 = stess.v1v - stess.v0v; + x2 = stess.v2x - stess.v0x; + y2 = stess.v2y - stess.v0y; + z2 = stess.v2z - stess.v0z; + u2 = stess.v2u - stess.v0u; + v2 = stess.v2v - stess.v0v; + d = u1 * v2 - u2 * v1; + r = d != 0.0F ? 1.0F / d : 1.0F; + tan1x = (v2 * x1 - v1 * x2) * r; + tan1y = (v2 * y1 - v1 * y2) * r; + tan1z = (v2 * z1 - v1 * z2) * r; + tan2x = (u1 * x2 - u2 * x1) * r; + tan2y = (u1 * y2 - u2 * y1) * r; + tan2z = (u1 * z2 - u2 * z1) * r; + lensq = tan1x * tan1x + tan1y * tan1y + tan1z * tan1z; + mult = (double)lensq != 0.0D ? (float)(1.0D / Math.sqrt((double)lensq)) : 1.0F; + tan1x *= mult; + tan1y *= mult; + tan1z *= mult; + lensq = tan2x * tan2x + tan2y * tan2y + tan2z * tan2z; + mult = (double)lensq != 0.0D ? (float)(1.0D / Math.sqrt((double)lensq)) : 1.0F; + tan2x *= mult; + tan2y *= mult; + tan2z *= mult; + tan3x = vnz * tan1y - vny * tan1z; + tan3y = vnx * tan1z - vnz * tan1x; + tan3z = vny * tan1x - vnx * tan1y; + tan1w = tan2x * tan3x + tan2y * tan3y + tan2z * tan3z < 0.0F ? -1.0F : 1.0F; + rawBuffer[rbi + -45] = rawBuffer[rbi + -27] = rawBuffer[rbi + -9] = rawBuffer[rbi + 9] = Float.floatToRawIntBits(stess.normalX = vnx); + rawBuffer[rbi + -44] = rawBuffer[rbi + -26] = rawBuffer[rbi + -8] = rawBuffer[rbi + 10] = Float.floatToRawIntBits(stess.normalY = vny); + rawBuffer[rbi + -43] = rawBuffer[rbi + -25] = rawBuffer[rbi + -7] = rawBuffer[rbi + 11] = Float.floatToRawIntBits(stess.normalZ = vnz); + rawBuffer[rbi + -42] = rawBuffer[rbi + -24] = rawBuffer[rbi + -6] = rawBuffer[rbi + 12] = Float.floatToRawIntBits(tan1x); + rawBuffer[rbi + -41] = rawBuffer[rbi + -23] = rawBuffer[rbi + -5] = rawBuffer[rbi + 13] = Float.floatToRawIntBits(tan1y); + rawBuffer[rbi + -40] = rawBuffer[rbi + -22] = rawBuffer[rbi + -4] = rawBuffer[rbi + 14] = Float.floatToRawIntBits(tan1z); + rawBuffer[rbi + -39] = rawBuffer[rbi + -21] = rawBuffer[rbi + -3] = rawBuffer[rbi + 15] = Float.floatToRawIntBits(tan1w); + stess.midTextureU = (Float.intBitsToFloat(rawBuffer[rbi + -51]) + Float.intBitsToFloat(rawBuffer[rbi + -33]) + Float.intBitsToFloat(rawBuffer[rbi + -15]) + (float)tess.textureU) / 4.0F; + stess.midTextureV = (Float.intBitsToFloat(rawBuffer[rbi + -50]) + Float.intBitsToFloat(rawBuffer[rbi + -32]) + Float.intBitsToFloat(rawBuffer[rbi + -14]) + (float)tess.textureV) / 4.0F; + rawBuffer[rbi + -38] = rawBuffer[rbi + -20] = rawBuffer[rbi + -2] = rawBuffer[rbi + 16] = Float.floatToRawIntBits(stess.midTextureU); + rawBuffer[rbi + -37] = rawBuffer[rbi + -19] = rawBuffer[rbi + -1] = rawBuffer[rbi + 17] = Float.floatToRawIntBits(stess.midTextureV); + } + } else if (tess.drawMode == 4) { + i = tess.addedVertices % 3; + + switch (i) { + case 0: + stess.v0x = fx; + stess.v0y = fy; + stess.v0z = fz; + stess.v0u = (float)tess.textureU; + stess.v0v = (float)tess.textureV; + break; + + case 1: + stess.v1x = fx; + stess.v1y = fy; + stess.v1z = fz; + stess.v1u = (float)tess.textureU; + stess.v1v = (float)tess.textureV; + break; + + case 2: + stess.v2x = fx; + stess.v2y = fy; + stess.v2z = fz; + stess.v2u = (float)tess.textureU; + stess.v2v = (float)tess.textureV; + x1 = stess.v1x - stess.v0x; + y1 = stess.v1y - stess.v0y; + z1 = stess.v1z - stess.v0z; + x2 = stess.v2x - stess.v1x; + y2 = stess.v2y - stess.v1y; + z2 = stess.v2z - stess.v1z; + vnx = y1 * z2 - y2 * z1; + vny = z1 * x2 - z2 * x1; + vnz = x1 * y2 - x2 * y1; + lensq = vnx * vnx + vny * vny + vnz * vnz; + mult = (double)lensq != 0.0D ? (float)(1.0D / Math.sqrt((double)lensq)) : 1.0F; + vnx *= mult; + vny *= mult; + vnz *= mult; + tess.hasNormals = true; + x1 = stess.v1x - stess.v0x; + y1 = stess.v1y - stess.v0y; + z1 = stess.v1z - stess.v0z; + u1 = stess.v1u - stess.v0u; + v1 = stess.v1v - stess.v0v; + x2 = stess.v2x - stess.v0x; + y2 = stess.v2y - stess.v0y; + z2 = stess.v2z - stess.v0z; + u2 = stess.v2u - stess.v0u; + v2 = stess.v2v - stess.v0v; + d = u1 * v2 - u2 * v1; + r = d != 0.0F ? 1.0F / d : 1.0F; + tan1x = (v2 * x1 - v1 * x2) * r; + tan1y = (v2 * y1 - v1 * y2) * r; + tan1z = (v2 * z1 - v1 * z2) * r; + tan2x = (u1 * x2 - u2 * x1) * r; + tan2y = (u1 * y2 - u2 * y1) * r; + tan2z = (u1 * z2 - u2 * z1) * r; + lensq = tan1x * tan1x + tan1y * tan1y + tan1z * tan1z; + mult = (double)lensq != 0.0D ? (float)(1.0D / Math.sqrt((double)lensq)) : 1.0F; + tan1x *= mult; + tan1y *= mult; + tan1z *= mult; + lensq = tan2x * tan2x + tan2y * tan2y + tan2z * tan2z; + mult = (double)lensq != 0.0D ? (float)(1.0D / Math.sqrt((double)lensq)) : 1.0F; + tan2x *= mult; + tan2y *= mult; + tan2z *= mult; + tan3x = vnz * tan1y - vny * tan1z; + tan3y = vnx * tan1z - vnz * tan1x; + tan3z = vny * tan1x - vnx * tan1y; + tan1w = tan2x * tan3x + tan2y * tan3y + tan2z * tan3z < 0.0F ? -1.0F : 1.0F; + rawBuffer[rbi + -27] = rawBuffer[rbi + -9] = rawBuffer[rbi + 9] = Float.floatToRawIntBits(stess.normalX = vnx); + rawBuffer[rbi + -26] = rawBuffer[rbi + -8] = rawBuffer[rbi + 10] = Float.floatToRawIntBits(stess.normalY = vny); + rawBuffer[rbi + -25] = rawBuffer[rbi + -7] = rawBuffer[rbi + 11] = Float.floatToRawIntBits(stess.normalZ = vnz); + rawBuffer[rbi + -24] = rawBuffer[rbi + -6] = rawBuffer[rbi + 12] = Float.floatToRawIntBits(tan1x); + rawBuffer[rbi + -23] = rawBuffer[rbi + -5] = rawBuffer[rbi + 13] = Float.floatToRawIntBits(tan1y); + rawBuffer[rbi + -22] = rawBuffer[rbi + -4] = rawBuffer[rbi + 14] = Float.floatToRawIntBits(tan1z); + rawBuffer[rbi + -21] = rawBuffer[rbi + -3] = rawBuffer[rbi + 15] = Float.floatToRawIntBits(tan1w); + stess.midTextureU = (Float.intBitsToFloat(rawBuffer[rbi + -33]) + Float.intBitsToFloat(rawBuffer[rbi + -15]) + (float)tess.textureU) / 3.0F; + stess.midTextureV = (Float.intBitsToFloat(rawBuffer[rbi + -32]) + Float.intBitsToFloat(rawBuffer[rbi + -14]) + (float)tess.textureV) / 3.0F; + rawBuffer[rbi + -20] = rawBuffer[rbi + -2] = rawBuffer[rbi + 16] = Float.floatToRawIntBits(stess.midTextureU); + rawBuffer[rbi + -19] = rawBuffer[rbi + -1] = rawBuffer[rbi + 17] = Float.floatToRawIntBits(stess.midTextureV); + } + } + + ++tess.addedVertices; + rawBuffer[rbi + 0] = Float.floatToRawIntBits(fx); + rawBuffer[rbi + 1] = Float.floatToRawIntBits(fy); + rawBuffer[rbi + 2] = Float.floatToRawIntBits(fz); + rawBuffer[rbi + 3] = Float.floatToRawIntBits((float)tess.textureU); + rawBuffer[rbi + 4] = Float.floatToRawIntBits((float)tess.textureV); + rawBuffer[rbi + 5] = tess.color; + rawBuffer[rbi + 6] = tess.brightness; + rawBuffer[rbi + 7] = Shaders.getEntityData(); + rawBuffer[rbi + 8] = Shaders.getEntityData2(); + rawBuffer[rbi + 9] = Float.floatToRawIntBits(stess.normalX); + rawBuffer[rbi + 10] = Float.floatToRawIntBits(stess.normalY); + rawBuffer[rbi + 11] = Float.floatToRawIntBits(stess.normalZ); + rbi += 18; + tess.rawBufferIndex = rbi; + ++tess.vertexCount; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersTex.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersTex.java new file mode 100644 index 0000000..b5170a5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/ShadersTex.java @@ -0,0 +1,859 @@ +package shadersmod.client; + +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.LayeredTexture; +import net.minecraft.client.renderer.texture.Stitcher; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.src.Config; +import net.minecraft.src.GlStateManager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import shadersmod.common.SMCLog; + +public class ShadersTex { + public static final int initialBufferSize = 1048576; + public static ByteBuffer byteBuffer = BufferUtils.createByteBuffer(4194304); + public static IntBuffer intBuffer = byteBuffer.asIntBuffer(); + public static int[] intArray = new int[1048576]; + public static final int defBaseTexColor = 0; + public static final int defNormTexColor = -8421377; + public static final int defSpecTexColor = 0; + public static Map multiTexMap = new HashMap(); + public static TextureMap updatingTextureMap = null; + public static TextureAtlasSprite updatingSprite = null; + public static MultiTexID updatingTex = null; + public static MultiTexID boundTex = null; + public static int updatingPage = 0; + public static String iconName = null; + public static IResourceManager resManager = null; + static ResourceLocation resLocation = null; + static int imageSize = 0; + + public static IntBuffer getIntBuffer(int size) { + if (intBuffer.capacity() < size) { + int bufferSize = roundUpPOT(size); + byteBuffer = BufferUtils.createByteBuffer(bufferSize * 4); + intBuffer = byteBuffer.asIntBuffer(); + } + + return intBuffer; + } + + public static int[] getIntArray(int size) { + if (intArray == null) { + intArray = new int[1048576]; + } + + if (intArray.length < size) { + intArray = new int[roundUpPOT(size)]; + } + + return intArray; + } + + public static int roundUpPOT(int x) { + int i = x - 1; + i |= i >> 1; + i |= i >> 2; + i |= i >> 4; + i |= i >> 8; + i |= i >> 16; + return i + 1; + } + + public static int log2(int x) { + int log = 0; + + if ((x & -65536) != 0) { + log += 16; + x >>= 16; + } + + if ((x & 65280) != 0) { + log += 8; + x >>= 8; + } + + if ((x & 240) != 0) { + log += 4; + x >>= 4; + } + + if ((x & 6) != 0) { + log += 2; + x >>= 2; + } + + if ((x & 2) != 0) { + ++log; + } + + return log; + } + + public static IntBuffer fillIntBuffer(int size, int value) { + int[] aint = getIntArray(size); + IntBuffer intBuf = getIntBuffer(size); + Arrays.fill(intArray, 0, size, value); + intBuffer.put(intArray, 0, size); + return intBuffer; + } + + public static int[] createAIntImage(int size) { + int[] aint = new int[size * 3]; + Arrays.fill(aint, 0, size, 0); + Arrays.fill(aint, size, size * 2, -8421377); + Arrays.fill(aint, size * 2, size * 3, 0); + return aint; + } + + public static int[] createAIntImage(int size, int color) { + int[] aint = new int[size * 3]; + Arrays.fill(aint, 0, size, color); + Arrays.fill(aint, size, size * 2, -8421377); + Arrays.fill(aint, size * 2, size * 3, 0); + return aint; + } + + public static MultiTexID getMultiTexID(AbstractTexture tex) { + MultiTexID multiTex = tex.multiTex; + + if (multiTex == null) { + int baseTex = tex.getGlTextureId(); + multiTex = (MultiTexID)multiTexMap.get(Integer.valueOf(baseTex)); + + if (multiTex == null) { + multiTex = new MultiTexID(baseTex, GL11.glGenTextures(), GL11.glGenTextures()); + multiTexMap.put(Integer.valueOf(baseTex), multiTex); + } + + tex.multiTex = multiTex; + } + + return multiTex; + } + + public static void deleteTextures(AbstractTexture atex, int texid) { + MultiTexID multiTex = atex.multiTex; + + if (multiTex != null) { + atex.multiTex = null; + multiTexMap.remove(Integer.valueOf(multiTex.base)); + GlStateManager.deleteTexture(multiTex.norm); + GlStateManager.deleteTexture(multiTex.spec); + + if (multiTex.base != texid) { + SMCLog.warning("Error : MultiTexID.base mismatch: " + multiTex.base + ", texid: " + texid); + GlStateManager.deleteTexture(multiTex.base); + } + } + } + + public static void bindNSTextures(int normTex, int specTex) { + if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984) { + GlStateManager.setActiveTexture(33986); + GlStateManager.bindTexture(normTex); + GlStateManager.setActiveTexture(33987); + GlStateManager.bindTexture(specTex); + GlStateManager.setActiveTexture(33984); + } + } + + public static void bindNSTextures(MultiTexID multiTex) { + bindNSTextures(multiTex.norm, multiTex.spec); + } + + public static void bindTextures(int baseTex, int normTex, int specTex) { + if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984) { + GlStateManager.setActiveTexture(33986); + GlStateManager.bindTexture(normTex); + GlStateManager.setActiveTexture(33987); + GlStateManager.bindTexture(specTex); + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.bindTexture(baseTex); + } + + public static void bindTextures(MultiTexID multiTex) { + boundTex = multiTex; + + if (Shaders.isRenderingWorld && GlStateManager.getActiveTextureUnit() == 33984) { + if (Shaders.configNormalMap) { + GlStateManager.setActiveTexture(33986); + GlStateManager.bindTexture(multiTex.norm); + } + + if (Shaders.configSpecularMap) { + GlStateManager.setActiveTexture(33987); + GlStateManager.bindTexture(multiTex.spec); + } + + GlStateManager.setActiveTexture(33984); + } + + GlStateManager.bindTexture(multiTex.base); + } + + public static void bindTexture(ITextureObject tex) { + int texId = tex.getGlTextureId(); + + if (tex instanceof TextureMap) { + Shaders.atlasSizeX = ((TextureMap)tex).atlasWidth; + Shaders.atlasSizeY = ((TextureMap)tex).atlasHeight; + bindTextures(tex.getMultiTexID()); + } else { + Shaders.atlasSizeX = 0; + Shaders.atlasSizeY = 0; + bindTextures(tex.getMultiTexID()); + } + } + + public static void bindTextureMapForUpdateAndRender(TextureManager tm, ResourceLocation resLoc) { + TextureMap tex = (TextureMap)tm.getTexture(resLoc); + Shaders.atlasSizeX = tex.atlasWidth; + Shaders.atlasSizeY = tex.atlasHeight; + bindTextures(updatingTex = tex.getMultiTexID()); + } + + public static void bindTextures(int baseTex) { + MultiTexID multiTex = (MultiTexID)multiTexMap.get(Integer.valueOf(baseTex)); + bindTextures(multiTex); + } + + public static void initDynamicTexture(int texID, int width, int height, DynamicTexture tex) { + MultiTexID multiTex = tex.getMultiTexID(); + int[] aint = tex.getTextureData(); + int size = width * height; + Arrays.fill(aint, size, size * 2, -8421377); + Arrays.fill(aint, size * 2, size * 3, 0); + TextureUtil.allocateTexture(multiTex.base, width, height); + TextureUtil.func_147954_b(false, false); + TextureUtil.setTextureClamped(false); + TextureUtil.allocateTexture(multiTex.norm, width, height); + TextureUtil.func_147954_b(false, false); + TextureUtil.setTextureClamped(false); + TextureUtil.allocateTexture(multiTex.spec, width, height); + TextureUtil.func_147954_b(false, false); + TextureUtil.setTextureClamped(false); + GlStateManager.bindTexture(multiTex.base); + } + + public static void updateDynamicTexture(int texID, int[] src, int width, int height, DynamicTexture tex) { + MultiTexID multiTex = tex.getMultiTexID(); + GlStateManager.bindTexture(multiTex.base); + updateDynTexSubImage1(src, width, height, 0, 0, 0); + GlStateManager.bindTexture(multiTex.norm); + updateDynTexSubImage1(src, width, height, 0, 0, 1); + GlStateManager.bindTexture(multiTex.spec); + updateDynTexSubImage1(src, width, height, 0, 0, 2); + GlStateManager.bindTexture(multiTex.base); + } + + public static void updateDynTexSubImage1(int[] src, int width, int height, int posX, int posY, int page) { + int size = width * height; + IntBuffer intBuf = getIntBuffer(size); + intBuf.clear(); + int offset = page * size; + + if (src.length >= offset + size) { + intBuf.put(src, offset, size).position(0).limit(size); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + intBuf.clear(); + } + } + + public static ITextureObject createDefaultTexture() { + DynamicTexture tex = new DynamicTexture(1, 1); + tex.getTextureData()[0] = -1; + tex.updateDynamicTexture(); + return tex; + } + + public static void allocateTextureMap(int texID, int mipmapLevels, int width, int height, Stitcher stitcher, TextureMap tex) { + SMCLog.info("allocateTextureMap " + mipmapLevels + " " + width + " " + height + " "); + updatingTextureMap = tex; + tex.atlasWidth = width; + tex.atlasHeight = height; + MultiTexID multiTex = getMultiTexID(tex); + updatingTex = multiTex; + TextureUtil.allocateTextureImpl(multiTex.base, mipmapLevels, width, height); + + if (Shaders.configNormalMap) { + TextureUtil.allocateTextureImpl(multiTex.norm, mipmapLevels, width, height); + } + + if (Shaders.configSpecularMap) { + TextureUtil.allocateTextureImpl(multiTex.spec, mipmapLevels, width, height); + } + + GlStateManager.bindTexture(texID); + } + + public static TextureAtlasSprite setSprite(TextureAtlasSprite tas) { + updatingSprite = tas; + return tas; + } + + public static String setIconName(String name) { + iconName = name; + return name; + } + + public static void uploadTexSubForLoadAtlas(int[][] data, int width, int height, int xoffset, int yoffset, boolean linear, boolean clamp) { + TextureUtil.func_147955_a(data, width, height, xoffset, yoffset, linear, clamp); + boolean border = false; + int[][] aaint; + + if (Shaders.configNormalMap) { + aaint = readImageAndMipmaps(iconName + "_n", width, height, data.length, border, -8421377); + GlStateManager.bindTexture(updatingTex.norm); + TextureUtil.func_147955_a(aaint, width, height, xoffset, yoffset, linear, clamp); + } + + if (Shaders.configSpecularMap) { + aaint = readImageAndMipmaps(iconName + "_s", width, height, data.length, border, 0); + GlStateManager.bindTexture(updatingTex.spec); + TextureUtil.func_147955_a(aaint, width, height, xoffset, yoffset, linear, clamp); + } + + GlStateManager.bindTexture(updatingTex.base); + } + + public static int[][] readImageAndMipmaps(String name, int width, int height, int numLevels, boolean border, int defColor) { + int[][] aaint = new int[numLevels][]; + int[] aint; + aaint[0] = aint = new int[width * height]; + boolean goodImage = false; + BufferedImage image = readImage(updatingTextureMap.func_147634_a(new ResourceLocation(name), 0)); + + if (image != null) { + int imageWidth = image.getWidth(); + int imageHeight = image.getHeight(); + + if (imageWidth + (border ? 16 : 0) == width) { + goodImage = true; + image.getRGB(0, 0, imageWidth, imageWidth, aint, 0, imageWidth); + } + } + + if (!goodImage) { + Arrays.fill(aint, defColor); + } + + GlStateManager.bindTexture(updatingTex.spec); + aaint = genMipmapsSimple(aaint.length - 1, width, aaint); + return aaint; + } + + public static BufferedImage readImage(ResourceLocation resLoc) { + try { + if (!Config.hasResource(resLoc)) { + return null; + } else { + InputStream e = Config.getResourceStream(resLoc); + + if (e == null) { + return null; + } else { + BufferedImage image = ImageIO.read(e); + e.close(); + return image; + } + } + } catch (IOException var3) { + return null; + } + } + + public static int[][] genMipmapsSimple(int maxLevel, int width, int[][] data) { + for (int level = 1; level <= maxLevel; ++level) { + if (data[level] == null) { + int cw = width >> level; + int pw = cw * 2; + int[] aintp = data[level - 1]; + int[] aintc = data[level] = new int[cw * cw]; + + for (int y = 0; y < cw; ++y) { + for (int x = 0; x < cw; ++x) { + int ppos = y * 2 * pw + x * 2; + aintc[y * cw + x] = blend4Simple(aintp[ppos], aintp[ppos + 1], aintp[ppos + pw], aintp[ppos + pw + 1]); + } + } + } + } + + return data; + } + + public static void uploadTexSub(int[][] data, int width, int height, int xoffset, int yoffset, boolean linear, boolean clamp) { + TextureUtil.func_147955_a(data, width, height, xoffset, yoffset, linear, clamp); + + if (Shaders.configNormalMap || Shaders.configSpecularMap) { + if (Shaders.configNormalMap) { + GlStateManager.bindTexture(updatingTex.norm); + uploadTexSub1(data, width, height, xoffset, yoffset, 1); + } + + if (Shaders.configSpecularMap) { + GlStateManager.bindTexture(updatingTex.spec); + uploadTexSub1(data, width, height, xoffset, yoffset, 2); + } + + GlStateManager.bindTexture(updatingTex.base); + } + } + + public static void uploadTexSub1(int[][] src, int width, int height, int posX, int posY, int page) { + int size = width * height; + IntBuffer intBuf = getIntBuffer(size); + int numLevel = src.length; + int level = 0; + int lw = width; + int lh = height; + int px = posX; + + for (int py = posY; lw > 0 && lh > 0 && level < numLevel; ++level) { + int lsize = lw * lh; + int[] aint = src[level]; + intBuf.clear(); + + if (aint.length >= lsize * (page + 1)) { + intBuf.put(aint, lsize * page, lsize).position(0).limit(lsize); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, level, px, py, lw, lh, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + } + + lw >>= 1; + lh >>= 1; + px >>= 1; + py >>= 1; + } + + intBuf.clear(); + } + + public static int blend4Alpha(int c0, int c1, int c2, int c3) { + int a0 = c0 >>> 24 & 255; + int a1 = c1 >>> 24 & 255; + int a2 = c2 >>> 24 & 255; + int a3 = c3 >>> 24 & 255; + int as = a0 + a1 + a2 + a3; + int an = (as + 2) / 4; + int dv; + + if (as != 0) { + dv = as; + } else { + dv = 4; + a0 = 1; + a1 = 1; + a2 = 1; + a3 = 1; + } + + int frac = (dv + 1) / 2; + int color = an << 24 | ((c0 >>> 16 & 255) * a0 + (c1 >>> 16 & 255) * a1 + (c2 >>> 16 & 255) * a2 + (c3 >>> 16 & 255) * a3 + frac) / dv << 16 | ((c0 >>> 8 & 255) * a0 + (c1 >>> 8 & 255) * a1 + (c2 >>> 8 & 255) * a2 + (c3 >>> 8 & 255) * a3 + frac) / dv << 8 | ((c0 >>> 0 & 255) * a0 + (c1 >>> 0 & 255) * a1 + (c2 >>> 0 & 255) * a2 + (c3 >>> 0 & 255) * a3 + frac) / dv << 0; + return color; + } + + public static int blend4Simple(int c0, int c1, int c2, int c3) { + int color = ((c0 >>> 24 & 255) + (c1 >>> 24 & 255) + (c2 >>> 24 & 255) + (c3 >>> 24 & 255) + 2) / 4 << 24 | ((c0 >>> 16 & 255) + (c1 >>> 16 & 255) + (c2 >>> 16 & 255) + (c3 >>> 16 & 255) + 2) / 4 << 16 | ((c0 >>> 8 & 255) + (c1 >>> 8 & 255) + (c2 >>> 8 & 255) + (c3 >>> 8 & 255) + 2) / 4 << 8 | ((c0 >>> 0 & 255) + (c1 >>> 0 & 255) + (c2 >>> 0 & 255) + (c3 >>> 0 & 255) + 2) / 4 << 0; + return color; + } + + public static void genMipmapAlpha(int[] aint, int offset, int width, int height) { + Math.min(width, height); + int o2 = offset; + int w2 = width; + int h2 = height; + int o1 = 0; + int w1 = 0; + boolean h1 = false; + int level; + int p2; + int y; + int x; + + for (level = 0; w2 > 1 && h2 > 1; o2 = o1) { + o1 = o2 + w2 * h2; + w1 = w2 / 2; + int var16 = h2 / 2; + + for (p2 = 0; p2 < var16; ++p2) { + y = o1 + p2 * w1; + x = o2 + p2 * 2 * w2; + + for (int x1 = 0; x1 < w1; ++x1) { + aint[y + x1] = blend4Alpha(aint[x + x1 * 2], aint[x + x1 * 2 + 1], aint[x + w2 + x1 * 2], aint[x + w2 + x1 * 2 + 1]); + } + } + + ++level; + w2 = w1; + h2 = var16; + } + + while (level > 0) { + --level; + w2 = width >> level; + h2 = height >> level; + o2 = o1 - w2 * h2; + p2 = o2; + + for (y = 0; y < h2; ++y) { + for (x = 0; x < w2; ++x) { + if (aint[p2] == 0) { + aint[p2] = aint[o1 + y / 2 * w1 + x / 2] & 16777215; + } + + ++p2; + } + } + + o1 = o2; + w1 = w2; + } + } + + public static void genMipmapSimple(int[] aint, int offset, int width, int height) { + Math.min(width, height); + int o2 = offset; + int w2 = width; + int h2 = height; + int o1 = 0; + int w1 = 0; + boolean h1 = false; + int level; + int p2; + int y; + int x; + + for (level = 0; w2 > 1 && h2 > 1; o2 = o1) { + o1 = o2 + w2 * h2; + w1 = w2 / 2; + int var16 = h2 / 2; + + for (p2 = 0; p2 < var16; ++p2) { + y = o1 + p2 * w1; + x = o2 + p2 * 2 * w2; + + for (int x1 = 0; x1 < w1; ++x1) { + aint[y + x1] = blend4Simple(aint[x + x1 * 2], aint[x + x1 * 2 + 1], aint[x + w2 + x1 * 2], aint[x + w2 + x1 * 2 + 1]); + } + } + + ++level; + w2 = w1; + h2 = var16; + } + + while (level > 0) { + --level; + w2 = width >> level; + h2 = height >> level; + o2 = o1 - w2 * h2; + p2 = o2; + + for (y = 0; y < h2; ++y) { + for (x = 0; x < w2; ++x) { + if (aint[p2] == 0) { + aint[p2] = aint[o1 + y / 2 * w1 + x / 2] & 16777215; + } + + ++p2; + } + } + + o1 = o2; + w1 = w2; + } + } + + public static boolean isSemiTransparent(int[] aint, int width, int height) { + int size = width * height; + + if (aint[0] >>> 24 == 255 && aint[size - 1] == 0) { + return true; + } else { + for (int i = 0; i < size; ++i) { + int alpha = aint[i] >>> 24; + + if (alpha != 0 && alpha != 255) { + return true; + } + } + + return false; + } + } + + public static void updateSubTex1(int[] src, int width, int height, int posX, int posY) { + int level = 0; + int cw = width; + int ch = height; + int cx = posX; + + for (int cy = posY; cw > 0 && ch > 0; cy /= 2) { + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, level, cx, cy, 0, 0, cw, ch); + ++level; + cw /= 2; + ch /= 2; + cx /= 2; + } + } + + public static void setupTexture(MultiTexID multiTex, int[] src, int width, int height, boolean linear, boolean clamp) { + int mmfilter = linear ? 9729 : 9728; + int wraptype = clamp ? 10496 : 10497; + int size = width * height; + IntBuffer intBuf = getIntBuffer(size); + intBuf.clear(); + intBuf.put(src, 0, size).position(0).limit(size); + GlStateManager.bindTexture(multiTex.base); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, mmfilter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, mmfilter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wraptype); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wraptype); + intBuf.put(src, size, size).position(0).limit(size); + GlStateManager.bindTexture(multiTex.norm); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, mmfilter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, mmfilter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wraptype); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wraptype); + intBuf.put(src, size * 2, size).position(0).limit(size); + GlStateManager.bindTexture(multiTex.spec); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, mmfilter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, mmfilter); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wraptype); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wraptype); + GlStateManager.bindTexture(multiTex.base); + } + + public static void updateSubImage(MultiTexID multiTex, int[] src, int width, int height, int posX, int posY, boolean linear, boolean clamp) { + int size = width * height; + IntBuffer intBuf = getIntBuffer(size); + intBuf.clear(); + intBuf.put(src, 0, size); + intBuf.position(0).limit(size); + GlStateManager.bindTexture(multiTex.base); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + + if (src.length == size * 3) { + intBuf.clear(); + intBuf.put(src, size, size).position(0); + intBuf.position(0).limit(size); + } + + GlStateManager.bindTexture(multiTex.norm); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + + if (src.length == size * 3) { + intBuf.clear(); + intBuf.put(src, size * 2, size); + intBuf.position(0).limit(size); + } + + GlStateManager.bindTexture(multiTex.spec); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, intBuf); + GlStateManager.setActiveTexture(33984); + } + + public static ResourceLocation getNSMapLocation(ResourceLocation location, String mapName) { + String basename = location.getResourcePath(); + String[] basenameParts = basename.split(".png"); + String basenameNoFileType = basenameParts[0]; + return new ResourceLocation(location.getResourceDomain(), basenameNoFileType + "_" + mapName + ".png"); + } + + public static void loadNSMap(IResourceManager manager, ResourceLocation location, int width, int height, int[] aint) { + if (Shaders.configNormalMap) { + loadNSMap1(manager, getNSMapLocation(location, "n"), width, height, aint, width * height, -8421377); + } + + if (Shaders.configSpecularMap) { + loadNSMap1(manager, getNSMapLocation(location, "s"), width, height, aint, width * height * 2, 0); + } + } + + public static void loadNSMap1(IResourceManager manager, ResourceLocation location, int width, int height, int[] aint, int offset, int defaultColor) { + boolean good = false; + + try { + IResource ex = manager.getResource(location); + BufferedImage bufferedimage = ImageIO.read(ex.getInputStream()); + + if (bufferedimage != null && bufferedimage.getWidth() == width && bufferedimage.getHeight() == height) { + bufferedimage.getRGB(0, 0, width, height, aint, offset, width); + good = true; + } + } catch (IOException var10) { + ; + } + + if (!good) { + Arrays.fill(aint, offset, offset + width * height, defaultColor); + } + } + + public static int loadSimpleTexture(int textureID, BufferedImage bufferedimage, boolean linear, boolean clamp, IResourceManager resourceManager, ResourceLocation location, MultiTexID multiTex) { + int width = bufferedimage.getWidth(); + int height = bufferedimage.getHeight(); + int size = width * height; + int[] aint = getIntArray(size * 3); + bufferedimage.getRGB(0, 0, width, height, aint, 0, width); + loadNSMap(resourceManager, location, width, height, aint); + setupTexture(multiTex, aint, width, height, linear, clamp); + return textureID; + } + + public static void mergeImage(int[] aint, int dstoff, int srcoff, int size) {} + + public static int blendColor(int color1, int color2, int factor1) { + int factor2 = 255 - factor1; + return ((color1 >>> 24 & 255) * factor1 + (color2 >>> 24 & 255) * factor2) / 255 << 24 | ((color1 >>> 16 & 255) * factor1 + (color2 >>> 16 & 255) * factor2) / 255 << 16 | ((color1 >>> 8 & 255) * factor1 + (color2 >>> 8 & 255) * factor2) / 255 << 8 | ((color1 >>> 0 & 255) * factor1 + (color2 >>> 0 & 255) * factor2) / 255 << 0; + } + + public static void loadLayeredTexture(LayeredTexture tex, IResourceManager manager, List list) { + int width = 0; + int height = 0; + int size = 0; + int[] image = null; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { + String s = (String)iterator.next(); + + if (s != null) { + try { + ResourceLocation ex = new ResourceLocation(s); + InputStream inputstream = manager.getResource(ex).getInputStream(); + BufferedImage bufimg = ImageIO.read(inputstream); + + if (size == 0) { + width = bufimg.getWidth(); + height = bufimg.getHeight(); + size = width * height; + image = createAIntImage(size, 0); + } + + int[] aint = getIntArray(size * 3); + bufimg.getRGB(0, 0, width, height, aint, 0, width); + loadNSMap(manager, ex, width, height, aint); + + for (int i = 0; i < size; ++i) { + int alpha = aint[i] >>> 24 & 255; + image[size * 0 + i] = blendColor(aint[size * 0 + i], image[size * 0 + i], alpha); + image[size * 1 + i] = blendColor(aint[size * 1 + i], image[size * 1 + i], alpha); + image[size * 2 + i] = blendColor(aint[size * 2 + i], image[size * 2 + i], alpha); + } + } catch (IOException var15) { + var15.printStackTrace(); + } + } + } + + setupTexture(tex.getMultiTexID(), image, width, height, false, false); + } + + static void updateTextureMinMagFilter() { + TextureManager texman = Minecraft.getMinecraft().getTextureManager(); + ITextureObject texObj = texman.getTexture(TextureMap.locationBlocksTexture); + + if (texObj != null) { + MultiTexID multiTex = texObj.getMultiTexID(); + GlStateManager.bindTexture(multiTex.base); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilB]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilB]); + GlStateManager.bindTexture(multiTex.norm); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilN]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilN]); + GlStateManager.bindTexture(multiTex.spec); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilS]); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilS]); + GlStateManager.bindTexture(0); + } + } + + public static IResource loadResource(IResourceManager manager, ResourceLocation location) throws IOException { + resManager = manager; + resLocation = location; + return manager.getResource(location); + } + + public static int[] loadAtlasSprite(BufferedImage bufferedimage, int startX, int startY, int w, int h, int[] aint, int offset, int scansize) { + imageSize = w * h; + bufferedimage.getRGB(startX, startY, w, h, aint, offset, scansize); + loadNSMap(resManager, resLocation, w, h, aint); + return aint; + } + + public static int[][] getFrameTexData(int[][] src, int width, int height, int frameIndex) { + int numLevel = src.length; + int[][] dst = new int[numLevel][]; + + for (int level = 0; level < numLevel; ++level) { + int[] sr1 = src[level]; + + if (sr1 != null) { + int frameSize = (width >> level) * (height >> level); + int[] ds1 = new int[frameSize * 3]; + dst[level] = ds1; + int srcSize = sr1.length / 3; + int srcPos = frameSize * frameIndex; + byte dstPos = 0; + System.arraycopy(sr1, srcPos, ds1, dstPos, frameSize); + srcPos += srcSize; + int var13 = dstPos + frameSize; + System.arraycopy(sr1, srcPos, ds1, var13, frameSize); + srcPos += srcSize; + var13 += frameSize; + System.arraycopy(sr1, srcPos, ds1, var13, frameSize); + } + } + + return dst; + } + + public static int[][] prepareAF(TextureAtlasSprite tas, int[][] src, int width, int height) { + boolean skip = true; + return src; + } + + public static void fixTransparentColor(TextureAtlasSprite tas, int[] aint) {} +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/SimpleShaderTexture.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/SimpleShaderTexture.java new file mode 100644 index 0000000..f1c4795 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/client/SimpleShaderTexture.java @@ -0,0 +1,98 @@ +package shadersmod.client; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.client.resources.data.AnimationMetadataSectionSerializer; +import net.minecraft.client.resources.data.FontMetadataSection; +import net.minecraft.client.resources.data.FontMetadataSectionSerializer; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.LanguageMetadataSection; +import net.minecraft.client.resources.data.LanguageMetadataSectionSerializer; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.client.resources.data.PackMetadataSectionSerializer; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.client.resources.data.TextureMetadataSectionSerializer; +import net.minecraft.src.TextureUtils; +import org.apache.commons.io.IOUtils; +import shadersmod.common.SMCLog; + +public class SimpleShaderTexture extends AbstractTexture { + private String texturePath; + private static final IMetadataSerializer METADATA_SERIALIZER = makeMetadataSerializer(); + + public SimpleShaderTexture(String texturePath) { + this.texturePath = texturePath; + } + + public void loadTexture(IResourceManager resourceManager) throws IOException { + this.func_147631_c(); + InputStream inputStream = Shaders.getShaderPackResourceStream(this.texturePath); + + if (inputStream == null) { + throw new FileNotFoundException("Shader texture not found: " + this.texturePath); + } else { + try { + BufferedImage bufferedimage = TextureUtils.readBufferedImage(inputStream); + TextureMetadataSection tms = this.loadTextureMetadataSection(); + TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, tms.getTextureBlur(), tms.getTextureClamp()); + } finally { + IOUtils.closeQuietly(inputStream); + } + } + } + + private TextureMetadataSection loadTextureMetadataSection() { + String pathMeta = this.texturePath + ".mcmeta"; + String sectionName = "texture"; + InputStream inMeta = Shaders.getShaderPackResourceStream(pathMeta); + + if (inMeta != null) { + IMetadataSerializer ms = METADATA_SERIALIZER; + BufferedReader brMeta = new BufferedReader(new InputStreamReader(inMeta)); + TextureMetadataSection var8; + + try { + JsonObject re = (new JsonParser()).parse(brMeta).getAsJsonObject(); + TextureMetadataSection meta = (TextureMetadataSection)ms.parseMetadataSection(sectionName, re); + + if (meta == null) { + return new TextureMetadataSection(false, false, new ArrayList()); + } + + var8 = meta; + } catch (RuntimeException var12) { + SMCLog.warning("Error reading metadata: " + pathMeta); + SMCLog.warning("" + var12.getClass().getName() + ": " + var12.getMessage()); + return new TextureMetadataSection(false, false, new ArrayList()); + } finally { + IOUtils.closeQuietly(brMeta); + IOUtils.closeQuietly(inMeta); + } + + return var8; + } else { + return new TextureMetadataSection(false, false, new ArrayList()); + } + } + + private static IMetadataSerializer makeMetadataSerializer() { + IMetadataSerializer ms = new IMetadataSerializer(); + ms.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); + ms.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); + ms.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); + ms.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); + ms.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); + return ms; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/common/SMCLog.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/common/SMCLog.java new file mode 100644 index 0000000..0363218 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/common/SMCLog.java @@ -0,0 +1,45 @@ +package shadersmod.common; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class SMCLog { + private static final Logger LOGGER = LogManager.getLogger(); + private static final String PREFIX = "[Shaders] "; + + public static void severe(String message) { + LOGGER.error("[Shaders] " + message); + } + + public static void warning(String message) { + LOGGER.warn("[Shaders] " + message); + } + + public static void info(String message) { + LOGGER.info("[Shaders] " + message); + } + + public static void fine(String message) { + LOGGER.debug("[Shaders] " + message); + } + + public static void severe(String format, Object ... args) { + String message = String.format(format, args); + LOGGER.error("[Shaders] " + message); + } + + public static void warning(String format, Object ... args) { + String message = String.format(format, args); + LOGGER.warn("[Shaders] " + message); + } + + public static void info(String format, Object ... args) { + String message = String.format(format, args); + LOGGER.info("[Shaders] " + message); + } + + public static void fine(String format, Object ... args) { + String message = String.format(format, args); + LOGGER.debug("[Shaders] " + message); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/common/SMCVersion.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/common/SMCVersion.java new file mode 100644 index 0000000..ab5d0f1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/common/SMCVersion.java @@ -0,0 +1,8 @@ +package shadersmod.common; + +public class SMCVersion { + public static final String mcVersion = "1.7.10"; + public static final String versionString = "2.4.12"; + public static final int versionNumber = 132108; + public static final int buildNumber = 83; +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/CustomUniform.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/CustomUniform.java new file mode 100644 index 0000000..502d196 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/CustomUniform.java @@ -0,0 +1,41 @@ +package shadersmod.uniform; + +import net.optifine.entity.model.anim.IExpression; + +public class CustomUniform { + private String name; + private UniformType type; + private IExpression expression; + private ShaderUniformBase shaderUniform; + + public CustomUniform(String name, UniformType type, IExpression expression) { + this.name = name; + this.type = type; + this.expression = expression; + this.shaderUniform = type.makeShaderUniform(name); + } + + public void setProgram(int program) { + this.shaderUniform.setProgram(program); + } + + public void update() { + this.type.updateUniform(this.expression, this.shaderUniform); + } + + public String getName() { + return this.name; + } + + public UniformType getType() { + return this.type; + } + + public IExpression getExpression() { + return this.expression; + } + + public ShaderUniformBase getShaderUniform() { + return this.shaderUniform; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/CustomUniforms.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/CustomUniforms.java new file mode 100644 index 0000000..2697298 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/CustomUniforms.java @@ -0,0 +1,23 @@ +package shadersmod.uniform; + +public class CustomUniforms { + private CustomUniform[] uniforms; + + public CustomUniforms(CustomUniform[] uniforms) { + this.uniforms = uniforms; + } + + public void setProgram(int program) { + for (int i = 0; i < this.uniforms.length; ++i) { + CustomUniform uniform = this.uniforms[i]; + uniform.setProgram(program); + } + } + + public void update() { + for (int i = 0; i < this.uniforms.length; ++i) { + CustomUniform uniform = this.uniforms[i]; + uniform.update(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/LegacyUniforms.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/LegacyUniforms.java new file mode 100644 index 0000000..4f3dd28 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/LegacyUniforms.java @@ -0,0 +1,59 @@ +package shadersmod.uniform; + +import java.util.HashMap; +import java.util.Map; + +public class LegacyUniforms { + private static Map map = new HashMap(); + private static Map mapKeysX = new HashMap(); + private static Map mapKeysY = new HashMap(); + private static Map mapKeysZ = new HashMap(); + private static Map mapKeysR = new HashMap(); + private static Map mapKeysG = new HashMap(); + private static Map mapKeysB = new HashMap(); + + public static Number getNumber(String name) { + return (Number)map.get(name); + } + + public static void setFloat(String name, float val) { + map.put(name, Float.valueOf(val)); + } + + public static void setInt(String name, int val) { + map.put(name, Integer.valueOf(val)); + } + + public static void setIntXy(String name, int x, int y) { + setInt(getCompoundKey(name, "x", mapKeysX), x); + setInt(getCompoundKey(name, "y", mapKeysY), y); + } + + public static void setFloatXyz(String name, float x, float y, float z) { + setFloat(getCompoundKey(name, "x", mapKeysX), x); + setFloat(getCompoundKey(name, "y", mapKeysY), y); + setFloat(getCompoundKey(name, "z", mapKeysZ), z); + } + + public static void setFloatRgb(String name, float x, float y, float z) { + setFloat(getCompoundKey(name, "r", mapKeysR), x); + setFloat(getCompoundKey(name, "g", mapKeysG), y); + setFloat(getCompoundKey(name, "b", mapKeysB), z); + } + + private static String getCompoundKey(String name, String suffix, Map mapKeys) { + String key = (String)mapKeys.get(name); + + if (key != null) { + return key; + } else { + key = name + "." + suffix; + mapKeys.put(name, key); + return key; + } + } + + public static void reset() { + map.clear(); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderExpressionResolver.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderExpressionResolver.java new file mode 100644 index 0000000..d7ee972 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderExpressionResolver.java @@ -0,0 +1,75 @@ +package shadersmod.uniform; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.entity.model.anim.ConstantFloat; +import net.optifine.entity.model.anim.IExpression; +import net.optifine.entity.model.anim.IExpressionResolver; +import shadersmod.common.SMCLog; + +public class ShaderExpressionResolver implements IExpressionResolver { + private Map mapExpressions = new HashMap(); + + public ShaderExpressionResolver(Map map) { + this.registerExpressions(); + Set keys = map.keySet(); + Iterator it = keys.iterator(); + + while (it.hasNext()) { + String name = (String)it.next(); + IExpression expr = (IExpression)map.get(name); + this.registerExpression(name, expr); + } + } + + private void registerExpressions() { + ShaderParameterFloat[] spfs = ShaderParameterFloat.values(); + + for (int spbs = 0; spbs < spfs.length; ++spbs) { + ShaderParameterFloat biomeList = spfs[spbs]; + this.mapExpressions.put(biomeList.getName(), biomeList); + } + + ShaderParameterBool[] var9 = ShaderParameterBool.values(); + + for (int var10 = 0; var10 < var9.length; ++var10) { + ShaderParameterBool i = var9[var10]; + this.mapExpressions.put(i.getName(), i); + } + + BiomeGenBase[] var11 = BiomeGenBase.getBiomeGenArray(); + + for (int var12 = 0; var12 < var11.length; ++var12) { + BiomeGenBase biome = var11[var12]; + + if (biome != null) { + String name = biome.biomeName.trim(); + name = "BIOME_" + name.toUpperCase().replace(' ', '_'); + int id = biome.biomeID; + ConstantFloat expr = new ConstantFloat((float)id); + this.registerExpression(name, expr); + } + } + } + + public boolean registerExpression(String name, IExpression expr) { + if (this.mapExpressions.containsKey(name)) { + SMCLog.warning("Expression already defined: " + name); + return false; + } else { + this.mapExpressions.put(name, expr); + return true; + } + } + + public IExpression getExpression(String name) { + return (IExpression)this.mapExpressions.get(name); + } + + public boolean hasExpression(String name) { + return this.mapExpressions.containsKey(name); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderParameterBool.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderParameterBool.java new file mode 100644 index 0000000..06d6874 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderParameterBool.java @@ -0,0 +1,198 @@ +package shadersmod.uniform; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.EntityLivingBase; +import net.optifine.entity.model.anim.ExpressionType; +import net.optifine.entity.model.anim.IExpressionBool; + +public enum ShaderParameterBool implements IExpressionBool { + IS_ALIVE("is_alive"), + IS_BURNING("is_burning"), + IS_CHILD("is_child"), + IS_GLOWING("is_glowing"), + IS_HURT("is_hurt"), + IS_IN_LAVA("is_in_lava"), + IS_IN_WATER("is_in_water"), + IS_INVISIBLE("is_invisible"), + IS_ON_GROUND("is_on_ground"), + IS_RIDDEN("is_ridden"), + IS_RIDING("is_riding"), + IS_SNEAKING("is_sneaking"), + IS_SPRINTING("is_sprinting"), + IS_WET("is_wet"); + private String name; + private RenderManager renderManager; + private static final ShaderParameterBool[] VALUES = values(); + + private ShaderParameterBool(String name) { + this.name = name; + this.renderManager = RenderManager.instance; + } + + public String getName() { + return this.name; + } + + public ExpressionType getExpressionType() { + return ExpressionType.BOOL; + } + + public boolean eval() { + EntityLivingBase entityGeneral = Minecraft.getMinecraft().renderViewEntity; + + if (entityGeneral instanceof EntityLivingBase) { + EntityLivingBase entity = (EntityLivingBase)entityGeneral; + + switch (this) + { + case IS_ALIVE: + return entity.isEntityAlive(); + + case IS_BURNING: + return entity.isBurning(); + + case IS_CHILD: + return entity.isChild(); + + case IS_HURT: + return entity.hurtTime > 0; + + case IS_IN_LAVA: + return entity.handleLavaMovement(); + + case IS_IN_WATER: + return entity.isInWater(); + + case IS_INVISIBLE: + return entity.isInvisible(); + + case IS_ON_GROUND: + return entity.onGround; + + case IS_RIDDEN: + return entity.riddenByEntity != null; + + case IS_RIDING: + return entity.isRiding(); + + case IS_SNEAKING: + return entity.isSneaking(); + + case IS_SPRINTING: + return entity.isSprinting(); + + case IS_WET: + return entity.isWet(); + } + } + + return false; + } + + public static ShaderParameterBool parse(String str) { + if (str == null) { + return null; + } else { + for (int i = 0; i < VALUES.length; ++i) { + ShaderParameterBool type = VALUES[i]; + + if (type.getName().equals(str)) { + return type; + } + } + + return null; + } + } + + static class NamelessClass60144461 { + static final int[] $SwitchMap$shadersmod$uniform$ShaderParameterBool = new int[ShaderParameterBool.values().length]; + + static { + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_ALIVE.ordinal()] = 1; + } catch (NoSuchFieldError var14) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_BURNING.ordinal()] = 2; + } catch (NoSuchFieldError var13) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_CHILD.ordinal()] = 3; + } catch (NoSuchFieldError var12) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_GLOWING.ordinal()] = 4; + } catch (NoSuchFieldError var11) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_HURT.ordinal()] = 5; + } catch (NoSuchFieldError var10) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_IN_LAVA.ordinal()] = 6; + } catch (NoSuchFieldError var9) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_IN_WATER.ordinal()] = 7; + } catch (NoSuchFieldError var8) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_INVISIBLE.ordinal()] = 8; + } catch (NoSuchFieldError var7) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_ON_GROUND.ordinal()] = 9; + } catch (NoSuchFieldError var6) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_RIDDEN.ordinal()] = 10; + } catch (NoSuchFieldError var5) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_RIDING.ordinal()] = 11; + } catch (NoSuchFieldError var4) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_SNEAKING.ordinal()] = 12; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_SPRINTING.ordinal()] = 13; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$ShaderParameterBool[ShaderParameterBool.IS_WET.ordinal()] = 14; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderParameterFloat.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderParameterFloat.java new file mode 100644 index 0000000..7e7ead8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderParameterFloat.java @@ -0,0 +1,107 @@ +package shadersmod.uniform; + +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.optifine.entity.model.anim.ExpressionType; +import net.optifine.entity.model.anim.IExpressionFloat; +import shadersmod.client.Shaders; + +public enum ShaderParameterFloat implements IExpressionFloat { + BIOME("biome"), + HELD_ITEM_ID("heldItemId"), + HELD_BLOCK_LIGHT_VALUE("heldBlockLightValue"), + HELD_ITEM_ID2("heldItemId2"), + HELD_BLOCK_LIGHT_VALUE2("heldBlockLightValue2"), + FOG_MODE("fogMode"), + WORLD_TIME("worldTime"), + WORLD_DAY("worldDay"), + MOON_PHASE("moonPhase"), + FRAME_COUNTER("frameCounter"), + FRAME_TIME("frameTime"), + FRAME_TIME_COUNTER("frameTimeCounter"), + SUN_ANGLE("sunAngle"), + SHADOW_ANGLE("shadowAngle"), + RAIN_STRENGTH("rainStrength"), + ASPECT_RATIO("aspectRatio"), + VIEW_WIDTH("viewWidth"), + VIEW_HEIGHT("viewHeight"), + NEAR("near"), + FAR("far"), + WETNESS("wetness"), + EYE_ALTITUDE("eyeAltitude"), + EYE_BRIGHTNESS_X("eyeBrightness.x"), + EYE_BRIGHTNESS_Y("eyeBrightness.y"), + TERRAIN_TEXTURE_SIZE_X("terrainTextureSize.x"), + TERRAIN_TEXTURE_SIZE_Y("terrainTextureSize.y"), + TERRRAIN_ICON_SIZE("terrainIconSize"), + IS_EYE_IN_WATER("isEyeInWater"), + NIGHT_VISION("nightVision"), + BLINDNESS("blindness"), + SCREEN_BRIGHTNESS("screenBrightness"), + HIDE_GUI("hideGUI"), + CENTER_DEPT_SMOOTH("centerDepthSmooth"), + ATLAS_SIZE_X("atlasSize.x"), + ATLAS_SIZE_Y("atlasSize.y"), + CAMERA_POSITION_X("cameraPosition.x"), + CAMERA_POSITION_Y("cameraPosition.y"), + CAMERA_POSITION_Z("cameraPosition.z"), + PREVIOUS_CAMERA_POSITION_X("previousCameraPosition.x"), + PREVIOUS_CAMERA_POSITION_Y("previousCameraPosition.y"), + PREVIOUS_CAMERA_POSITION_Z("previousCameraPosition.z"), + SUN_POSITION_X("sunPosition.x"), + SUN_POSITION_Y("sunPosition.y"), + SUN_POSITION_Z("sunPosition.z"), + MOON_POSITION_X("moonPosition.x"), + MOON_POSITION_Y("moonPosition.y"), + MOON_POSITION_Z("moonPosition.z"), + SHADOW_LIGHT_POSITION_X("shadowLightPosition.x"), + SHADOW_LIGHT_POSITION_Y("shadowLightPosition.y"), + SHADOW_LIGHT_POSITION_Z("shadowLightPosition.z"), + UP_POSITION_X("upPosition.x"), + UP_POSITION_Y("upPosition.y"), + UP_POSITION_Z("upPosition.z"), + FOG_COLOR_R("fogColor.r"), + FOG_COLOR_G("fogColor.g"), + FOG_COLOR_B("fogColor.b"), + SKY_COLOR_R("skyColor.r"), + SKY_COLOR_G("skyColor.g"), + SKY_COLOR_B("skyColor.b"); + private String name; + + private ShaderParameterFloat(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public ExpressionType getExpressionType() { + return ExpressionType.FLOAT; + } + + public float eval() { + switch (ShaderParameterFloat.NamelessClass595222154.$SwitchMap$shadersmod$uniform$ShaderParameterFloat[this.ordinal()]) { + case 1: + Vec3 valLegacy = Shaders.getCameraPosition(); + BiomeGenBase biome = Shaders.getCurrentWorld().getBiomeGenForCoords((int)valLegacy.xCoord, (int)valLegacy.zCoord); + return (float)biome.biomeID; + + default: + Number valLegacy1 = LegacyUniforms.getNumber(this.name); + return valLegacy1 != null ? valLegacy1.floatValue() : 0.0F; + } + } + + static class NamelessClass595222154 { + static final int[] $SwitchMap$shadersmod$uniform$ShaderParameterFloat = new int[ShaderParameterFloat.values().length]; + + static { + try { + $SwitchMap$shadersmod$uniform$ShaderParameterFloat[ShaderParameterFloat.BIOME.ordinal()] = 1; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformBase.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformBase.java new file mode 100644 index 0000000..3e25983 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformBase.java @@ -0,0 +1,39 @@ +package shadersmod.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; + +public abstract class ShaderUniformBase { + private String name; + private int program = -1; + private int location = -1; + + public ShaderUniformBase(String name) { + this.name = name; + } + + public void setProgram(int program) { + if (this.program != program) { + this.program = program; + this.location = ARBShaderObjects.glGetUniformLocationARB(program, this.name); + this.onProgramChanged(); + } + } + + protected abstract void onProgramChanged(); + + public String getName() { + return this.name; + } + + public int getProgram() { + return this.program; + } + + public int getLocation() { + return this.location; + } + + public boolean isDefined() { + return this.location >= 0; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformFloat.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformFloat.java new file mode 100644 index 0000000..0d0a076 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformFloat.java @@ -0,0 +1,30 @@ +package shadersmod.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; +import shadersmod.client.Shaders; + +public class ShaderUniformFloat extends ShaderUniformBase { + private float value = -1.0F; + + public ShaderUniformFloat(String name) { + super(name); + } + + protected void onProgramChanged() { + this.value = -1.0F; + } + + public void setValue(float value) { + if (this.getLocation() >= 0) { + if (this.value != value) { + ARBShaderObjects.glUniform1fARB(this.getLocation(), value); + Shaders.checkGLError(this.getName()); + this.value = value; + } + } + } + + public float getValue() { + return this.value; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformFloat4.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformFloat4.java new file mode 100644 index 0000000..617d941 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformFloat4.java @@ -0,0 +1,36 @@ +package shadersmod.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; +import shadersmod.client.Shaders; + +public class ShaderUniformFloat4 extends ShaderUniformBase { + private float[] values = new float[4]; + + public ShaderUniformFloat4(String name) { + super(name); + } + + protected void onProgramChanged() { + this.values[0] = 0.0F; + this.values[1] = 0.0F; + this.values[2] = 0.0F; + this.values[3] = 0.0F; + } + + public void setValue(float f0, float f1, float f2, float f3) { + if (this.getLocation() >= 0) { + if (this.values[0] != f0 || this.values[1] != f1 || this.values[2] != f2 || this.values[3] != f3) { + ARBShaderObjects.glUniform4fARB(this.getLocation(), f0, f1, f2, f3); + Shaders.checkGLError(this.getName()); + this.values[0] = f0; + this.values[1] = f1; + this.values[2] = f2; + this.values[3] = f3; + } + } + } + + public float[] getValues() { + return this.values; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformInt.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformInt.java new file mode 100644 index 0000000..8e3f48f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/ShaderUniformInt.java @@ -0,0 +1,30 @@ +package shadersmod.uniform; + +import org.lwjgl.opengl.ARBShaderObjects; +import shadersmod.client.Shaders; + +public class ShaderUniformInt extends ShaderUniformBase { + private int value = -1; + + public ShaderUniformInt(String name) { + super(name); + } + + protected void onProgramChanged() { + this.value = -1; + } + + public void setValue(int value) { + if (this.getLocation() >= 0) { + if (this.value != value) { + ARBShaderObjects.glUniform1iARB(this.getLocation(), value); + Shaders.checkGLError(this.getName()); + this.value = value; + } + } + } + + public int getValue() { + return this.value; + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/Smoother.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/Smoother.java new file mode 100644 index 0000000..a72f045 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/Smoother.java @@ -0,0 +1,34 @@ +package shadersmod.uniform; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.src.SmoothFloat; + +public class Smoother { + private static Map mapSmoothValues = new HashMap(); + + public static float getSmoothValue(int id, float value, float timeFadeUpSec, float timeFadeDownSec) { + Map var4 = mapSmoothValues; + + synchronized (mapSmoothValues) { + Integer key = Integer.valueOf(id); + SmoothFloat sf = (SmoothFloat)mapSmoothValues.get(key); + + if (sf == null) { + sf = new SmoothFloat(value, timeFadeUpSec, timeFadeDownSec); + mapSmoothValues.put(key, sf); + } + + float valueSmooth = sf.getSmoothValue(value); + return valueSmooth; + } + } + + public static void reset() { + Map var0 = mapSmoothValues; + + synchronized (mapSmoothValues) { + mapSmoothValues.clear(); + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/UniformType.java b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/UniformType.java new file mode 100644 index 0000000..fd5b99f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/java/shadersmod/uniform/UniformType.java @@ -0,0 +1,117 @@ +package shadersmod.uniform; + +import net.optifine.entity.model.anim.ExpressionType; +import net.optifine.entity.model.anim.IExpression; +import net.optifine.entity.model.anim.IExpressionBool; +import net.optifine.entity.model.anim.IExpressionFloat; + +public enum UniformType { + BOOL, + INT, + FLOAT; + + public ShaderUniformBase makeShaderUniform(String name) { + switch (UniformType.NamelessClass1815720057.$SwitchMap$shadersmod$uniform$UniformType[this.ordinal()]) { + case 1: + return new ShaderUniformInt(name); + + case 2: + return new ShaderUniformInt(name); + + case 3: + return new ShaderUniformFloat(name); + + default: + throw new RuntimeException("Unknown uniform type: " + this); + } + } + + public void updateUniform(IExpression expression, ShaderUniformBase uniform) { + switch (UniformType.NamelessClass1815720057.$SwitchMap$shadersmod$uniform$UniformType[this.ordinal()]) { + case 1: + this.updateUniformBool((IExpressionBool)expression, (ShaderUniformInt)uniform); + return; + + case 2: + this.updateUniformInt((IExpressionFloat)expression, (ShaderUniformInt)uniform); + return; + + case 3: + this.updateUniformFloat((IExpressionFloat)expression, (ShaderUniformFloat)uniform); + return; + + default: + throw new RuntimeException("Unknown uniform type: " + this); + } + } + + private void updateUniformBool(IExpressionBool expression, ShaderUniformInt uniform) { + boolean val = expression.eval(); + int valInt = val ? 1 : 0; + uniform.setValue(valInt); + } + + private void updateUniformInt(IExpressionFloat expression, ShaderUniformInt uniform) { + int val = (int)expression.eval(); + uniform.setValue(val); + } + + private void updateUniformFloat(IExpressionFloat expression, ShaderUniformFloat uniform) { + float val = expression.eval(); + uniform.setValue(val); + } + + public boolean matchesExpressionType(ExpressionType expressionType) { + switch (UniformType.NamelessClass1815720057.$SwitchMap$shadersmod$uniform$UniformType[this.ordinal()]) { + case 1: + return expressionType == ExpressionType.BOOL; + + case 2: + return expressionType == ExpressionType.FLOAT; + + case 3: + return expressionType == ExpressionType.FLOAT; + + default: + throw new RuntimeException("Unknown uniform type: " + this); + } + } + + public static UniformType parse(String type) { + UniformType[] values = values(); + + for (int i = 0; i < values.length; ++i) { + UniformType uniformType = values[i]; + + if (uniformType.name().toLowerCase().equals(type)) { + return uniformType; + } + } + + return null; + } + + static class NamelessClass1815720057 { + static final int[] $SwitchMap$shadersmod$uniform$UniformType = new int[UniformType.values().length]; + + static { + try { + $SwitchMap$shadersmod$uniform$UniformType[UniformType.BOOL.ordinal()] = 1; + } catch (NoSuchFieldError var3) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$UniformType[UniformType.INT.ordinal()] = 2; + } catch (NoSuchFieldError var2) { + ; + } + + try { + $SwitchMap$shadersmod$uniform$UniformType[UniformType.FLOAT.ordinal()] = 3; + } catch (NoSuchFieldError var1) { + ; + } + } + } +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/indexes/1.7.10.json b/Tellinq-CB-1.7.10/src/main/resources/assets/indexes/1.7.10.json new file mode 100644 index 0000000..8fa3823 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/indexes/1.7.10.json @@ -0,0 +1,2748 @@ +{ + "objects": { + "realms/lang/de_DE.lang": { + "hash": "729b2c09d5c588787b23127eeda2730f9c039194", + "size": 7784 + }, + "realms/lang/cy_GB.lang": { + "hash": "7b52463b2df4685d2d82c5d257fd5ec79843d618", + "size": 7688 + }, + "minecraft/sounds/mob/chicken/step2.ogg": { + "hash": "bf7fadaf64945f6b31c803d086ac6a652aabef9b", + "size": 3838 + }, + "minecraft/sounds/dig/gravel3.ogg": { + "hash": "48f7e1bb098abd36b9760cca27b9d4391a23de26", + "size": 6905 + }, + "minecraft/lang/uk_UA.lang": { + "hash": "02ca127554fb1294b473bac256469a0d908ecd86", + "size": 97299 + }, + "minecraft/sounds/mob/cat/hitt3.ogg": { + "hash": "3d98b4b7c37a09101da00d8a3078e0acba6558f4", + "size": 7371 + }, + "minecraft/sounds/mob/horse/zombie/hit3.ogg": { + "hash": "ad126e435cca94054bf0d616301799a105526cde", + "size": 7043 + }, + "minecraft/sounds/mob/endermen/portal.ogg": { + "hash": "7b4b5323ef066caa1ae43cbe66fffd9dfce4ed32", + "size": 10010 + }, + "minecraft/sounds/random/glass2.ogg": { + "hash": "87c47bda3645c68f18a49e83cbf06e5302d087ff", + "size": 7532 + }, + "minecraft/sounds/mob/bat/hurt1.ogg": { + "hash": "fddba78b2426f8056be081c98fe82e8411a0a5cf", + "size": 4878 + }, + "minecraft/sounds/ambient/cave/cave9.ogg": { + "hash": "b463fa47816fe9a5dfe508093150e647403e4db6", + "size": 27096 + }, + "minecraft/sounds/records/13.ogg": { + "hash": "9cbed0e40296f68c61090c9b81816061e068a0ec", + "size": 1071028 + }, + "minecraft/sounds/mob/enderdragon/wings1.ogg": { + "hash": "5a368ed32b3357e31629451ace57eb30d90e8874", + "size": 10617 + }, + "minecraft/lang/ast_ES.lang": { + "hash": "fc2139572f55c973aedc694b8d633f2a4eb0907a", + "size": 72927 + }, + "realms/lang/ast_ES.lang": { + "hash": "3f0a1aea8af9451493927ecb8a18997881ad0e2f", + "size": 7608 + }, + "minecraft/sounds/mob/cow/step3.ogg": { + "hash": "482919bc631b317422ab44af3938259bea73fe83", + "size": 7923 + }, + "minecraft/sounds/step/cloth3.ogg": { + "hash": "9c63f2a3681832dc32d206f6830360bfe94b5bfc", + "size": 4897 + }, + "minecraft/sounds/mob/endermen/hit2.ogg": { + "hash": "cf60aefd0b742c3fa15e808c1a0c33aebd534cc5", + "size": 6491 + }, + "minecraft/sounds/random/eat3.ogg": { + "hash": "9f2c4bab5ed55f1714fffa223985c81babc8f6c0", + "size": 5813 + }, + "minecraft/sounds/step/sand5.ogg": { + "hash": "9fd6d2c633d276b952f2ff2aaa1fa7e5fb5efd2a", + "size": 5182 + }, + "minecraft/sounds/mob/creeper/say1.ogg": { + "hash": "74771428c2aa2acbd30638c6706867053bad64d3", + "size": 6647 + }, + "minecraft/sounds/mob/silverfish/say3.ogg": { + "hash": "e7f0f24c2c9f4bf83286b17109580d3e845d19e3", + "size": 7060 + }, + "minecraft/sounds/liquid/swim3.ogg": { + "hash": "b5f9075a8bf6977e7dfd3d316a673eaaa5834a99", + "size": 9868 + }, + "minecraft/lang/ga_IE.lang": { + "hash": "0e2933d361b38fc2aff7e7d09c6b723893e4dd5c", + "size": 75483 + }, + "minecraft/lang/lb_LU.lang": { + "hash": "1a498de545784868b5cb34705b4663c16292f837", + "size": 72764 + }, + "minecraft/sounds/records/mall.ogg": { + "hash": "83233451430516d839eaee855a2f789b8985d457", + "size": 1430016 + }, + "minecraft/sounds/mob/cat/hiss1.ogg": { + "hash": "9d2202fce7908dcc5b5c8758c5cd517d863d4dd3", + "size": 14666 + }, + "realms/lang/eu_ES.lang": { + "hash": "a448ca104c51d6934dd669ddac2ef03c0d35695f", + "size": 7839 + }, + "minecraft/sounds/ambient/cave/cave4.ogg": { + "hash": "48540d7788ce3d9e780cb448ce5676c53dbcfd23", + "size": 49499 + }, + "minecraft/sounds/music/menu/menu3.ogg": { + "hash": "87722a59c8d488370f3d430cd4c97a3161081785", + "size": 1724614 + }, + "minecraft/sounds/random/break.ogg": { + "hash": "8bf3ecb0fe9a6a615f5995e3dd21b6c39adc21d5", + "size": 6551 + }, + "minecraft/sounds/mob/silverfish/step1.ogg": { + "hash": "763cc79934a572b84c371cb49afad5912f29d2f1", + "size": 8382 + }, + "minecraft/sounds/mob/enderdragon/growl2.ogg": { + "hash": "d859c9c5be04ffc41479b306814a933983eaa235", + "size": 27101 + }, + "minecraft/sounds/music/game/hal1.ogg": { + "hash": "df1ff11b79757432c5c3f279e5ecde7b63ceda64", + "size": 1972217 + }, + "minecraft/sounds/mob/villager/idle2.ogg": { + "hash": "5df4a02b1ebc550514841fddb7d64b9c497d40b4", + "size": 10948 + }, + "minecraft/sounds/ambient/cave/cave13.ogg": { + "hash": "63bbe3921abd75b9f6cd1e20330360d164da169b", + "size": 29512 + }, + "realms/lang/th_TH.lang": { + "hash": "908cb8d352d2456ba427530dc242ff6dfa319780", + "size": 12281 + }, + "minecraft/sounds/mob/horse/angry1.ogg": { + "hash": "c80439669ee4c5ab6e236787f57fc6aa980dc6f9", + "size": 10409 + }, + "realms/lang/it_IT.lang": { + "hash": "74d3924ddd105231713694303a9c7ce070b58f9a", + "size": 7683 + }, + "realms/lang/sk_SK.lang": { + "hash": "6a69ee43b781f9b05d9965da7a7dd1adb9d3d4b4", + "size": 7716 + }, + "minecraft/lang/es_UY.lang": { + "hash": "4e5de18b13004b53cf8e5d46f36ab07b165e7362", + "size": 73666 + }, + "minecraft/sounds/music/game/creative/creative6.ogg": { + "hash": "6254527d626a2c7d80901cc2e62dce3ba4bd81f6", + "size": 5468843 + }, + "minecraft/sounds/random/anvil_use.ogg": { + "hash": "88a792430dfff97582ab49b8dc9477cd9d4e5ebb", + "size": 13633 + }, + "minecraft/sounds/ambient/weather/thunder2.ogg": { + "hash": "a20cbf2ddce541eaed520d7ec55665fe97428be6", + "size": 25571 + }, + "minecraft/sounds/mob/creeper/death.ogg": { + "hash": "fbc1b2c89c5c781e30d702b2885be3f485105869", + "size": 13005 + }, + "minecraft/sounds/step/sand3.ogg": { + "hash": "ab07279288fa49215bada5c17627e6a54ad0437c", + "size": 5144 + }, + "minecraft/sounds/dig/sand3.ogg": { + "hash": "c75589cc0087069f387de127dd1499580498738e", + "size": 5552 + }, + "minecraft/sounds/mob/cow/hurt3.ogg": { + "hash": "2a031f10c7dc24e75d5dc3a374ebe7f36fc3e143", + "size": 8934 + }, + "minecraft/sounds/liquid/swim2.ogg": { + "hash": "827d71834e69954e0a7fd7748998332e0b619d29", + "size": 9540 + }, + "minecraft/sounds/mob/enderdragon/wings4.ogg": { + "hash": "92488929c42221fb3f1dee397a32d2e4de615f3c", + "size": 11702 + }, + "minecraft/sounds/step/sand2.ogg": { + "hash": "bd1750c016f6bab40934eff0b0fb64c41c86e44b", + "size": 5114 + }, + "realms/lang/ru_RU.lang": { + "hash": "23e46a6151e9ef8cf970df137f914ecfedef97f7", + "size": 10417 + }, + "minecraft/sounds/mob/blaze/hit1.ogg": { + "hash": "cb1cf4b405d930ad27f09ea39d6a64f35fc13308", + "size": 7189 + }, + "minecraft/sounds/step/cloth4.ogg": { + "hash": "55da1856e77cfd31a7e8c3d358e1f856c5583198", + "size": 4844 + }, + "minecraft/sounds/mob/enderdragon/wings3.ogg": { + "hash": "eb58ef697b2cbaed218edc758e00412302c75962", + "size": 10373 + }, + "minecraft/sounds/step/stone1.ogg": { + "hash": "4a2e3795ffd4d3aab0834b7e41903af3a8f7d197", + "size": 8012 + }, + "minecraft/sounds/random/door_open.ogg": { + "hash": "5bb5a04e776d69ca12b1d7bc369975f9bf62e741", + "size": 7536 + }, + "minecraft/lang/mi_NZ.lang": { + "hash": "f149ea34fdfe2ffdbde2f7faa11eb2aa282fa6e2", + "size": 18231 + }, + "minecraft/sounds/random/glass1.ogg": { + "hash": "7274a2231ed4544a37e599b7b014e589e5377094", + "size": 7443 + }, + "minecraft/sounds/random/fizz.ogg": { + "hash": "c649e60ea9a99c97501a50d2dc4e579343e91ea8", + "size": 17002 + }, + "minecraft/sounds/mob/silverfish/kill.ogg": { + "hash": "24cdac5a80fdad7ab31dc0695b57ece55aecb21a", + "size": 10410 + }, + "minecraft/sounds/mob/skeleton/death.ogg": { + "hash": "641e601132b4adb67951e0d49c1004cf1b86eff2", + "size": 17073 + }, + "minecraft/sounds/random/chestclosed.ogg": { + "hash": "056393a33a9633685c3dc3be2887f5cbd7dbc63f", + "size": 7779 + }, + "minecraft/sounds/mob/skeleton/step1.ogg": { + "hash": "68e0a58848bbdad12ad2b216d7244754459c9516", + "size": 8444 + }, + "minecraft/sounds/mob/endermen/scream4.ogg": { + "hash": "bcc73584d83225383aaa6affce905392c96afe86", + "size": 10411 + }, + "minecraft/sounds/mob/horse/skeleton/idle2.ogg": { + "hash": "cd683396ccd955bfd218020dbb1892808def402e", + "size": 9173 + }, + "minecraft/sounds/mob/bat/hurt2.ogg": { + "hash": "573e565b7fda2c34fc972edd21a82fd2e09200f8", + "size": 5530 + }, + "icons/icon_32x32.png": { + "hash": "92750c5f93c312ba9ab413d546f32190c56d6f1f", + "size": 5362 + }, + "minecraft/sounds/random/wood_click.ogg": { + "hash": "b210a3c371441b77fe873133b2cb7b63e367b2f3", + "size": 4385 + }, + "minecraft/sounds/mob/zombie/metal3.ogg": { + "hash": "322374d89ed809e75005cdc4f6479c959e15aee2", + "size": 8843 + }, + "minecraft/sounds/mob/enderdragon/growl4.ogg": { + "hash": "c84b0cf222e7dcbedde8eb9deb98835032f4d402", + "size": 25574 + }, + "minecraft/sounds/mob/cow/hurt1.ogg": { + "hash": "989c3b614f736aa77bb2800821ea56936e98ca68", + "size": 7302 + }, + "minecraft/sounds/mob/cow/step4.ogg": { + "hash": "03063be15a77cc3f6815ec98090e351178190b33", + "size": 7394 + }, + "minecraft/sounds/mob/wolf/bark2.ogg": { + "hash": "9f1708a6409d04370ec12d0add015b11abbd5371", + "size": 5447 + }, + "minecraft/sounds/fireworks/blast_far1.ogg": { + "hash": "cd9062e9e81f7cd35164a99669e5db32891a5cb5", + "size": 14727 + }, + "realms/lang/id_ID.lang": { + "hash": "8a6901092669cae60fa67c2a62c5e9c4548fd056", + "size": 7650 + }, + "minecraft/sounds/mob/endermen/death.ogg": { + "hash": "d04dd6d1f050353ef9e3ba9c45f407f831903c69", + "size": 16232 + }, + "realms/lang/en_GB.lang": { + "hash": "c2d8994702c664a9bedd4f1961c585507752c7d2", + "size": 7276 + }, + "minecraft/sounds/random/explode3.ogg": { + "hash": "a94a69e56568f5789cab05382cfd81f601189fd1", + "size": 25298 + }, + "minecraft/sounds/mob/wolf/bark1.ogg": { + "hash": "2452c64a55eaef86bf1b668bb4d5f3b641cd8f25", + "size": 5398 + }, + "minecraft/sounds/mob/horse/skeleton/death.ogg": { + "hash": "3b11e7b50263049d7b7c384c622c8fdf28cf12d8", + "size": 19775 + }, + "minecraft/sounds/mob/endermen/hit4.ogg": { + "hash": "6e0f9074e049a6c30402d70cc75a5da99042e00c", + "size": 5573 + }, + "minecraft/sounds/mob/horse/zombie/idle3.ogg": { + "hash": "9d034bf3ba36b297487b2380b908713982a83a3a", + "size": 12120 + }, + "minecraft/sounds/mob/creeper/say2.ogg": { + "hash": "c46c7d2a84749bfcbcf576aea0d66fd3deccba31", + "size": 6768 + }, + "minecraft/sounds/note/bass.ogg": { + "hash": "e28d844995368de1d45c724a5d371c9952ae5ed4", + "size": 5479 + }, + "minecraft/sounds/dig/grass3.ogg": { + "hash": "f7d7e5c7089c9b45fa5d1b31542eb455fad995db", + "size": 7194 + }, + "minecraft/sounds/mob/slime/big3.ogg": { + "hash": "2c20816632caecf75f00bb968f51847e3a982e75", + "size": 9436 + }, + "minecraft/sounds/step/wood3.ogg": { + "hash": "27722125968ac60c0f191a961b17e406f1351c6e", + "size": 9368 + }, + "minecraft/sounds/step/sand4.ogg": { + "hash": "a474236fb0c75bd65a6010e87dbc000d345fc185", + "size": 5321 + }, + "minecraft/sounds/mob/blaze/breathe3.ogg": { + "hash": "24d643885f9b83d8f034f49e2c5e00e70d4f175a", + "size": 21883 + }, + "minecraft/sounds/liquid/water.ogg": { + "hash": "3483650440deb3934255e044ddabff5b01a65356", + "size": 36329 + }, + "minecraft/sounds/mob/silverfish/step2.ogg": { + "hash": "f1665747da14569c4de55e07884deeef18a40f62", + "size": 9498 + }, + "minecraft/sounds/mob/horse/hit4.ogg": { + "hash": "73909900231d6f994e92cea983eb34d20cdd6461", + "size": 7133 + }, + "minecraft/sounds/records/stal.ogg": { + "hash": "2c4f3f8f259dc782867727311fea30875ecc3917", + "size": 1180789 + }, + "minecraft/sounds/mob/irongolem/death.ogg": { + "hash": "770b3f1feb05b9b941d858eb72b9d04ffc5d52c9", + "size": 17766 + }, + "minecraft/sounds/mob/irongolem/hit4.ogg": { + "hash": "a2dbb90f23b0babe7c569ceca28db49d0c112714", + "size": 8686 + }, + "minecraft/sounds/mob/cat/meow3.ogg": { + "hash": "381f9e97a8a986ecab3e86431d6be6df5ff79c31", + "size": 9526 + }, + "minecraft/sounds/mob/zombie/say2.ogg": { + "hash": "bf5086623d5c6735271074b263116fb914ed79b5", + "size": 15423 + }, + "realms/lang/ga_IE.lang": { + "hash": "f57f766c0266d36d7fa8efb006aaa95fcd645a36", + "size": 8146 + }, + "minecraft/sounds/portal/portal.ogg": { + "hash": "9a20be18fed05330f745a54eb8aeba11aac5403b", + "size": 25153 + }, + "minecraft/sounds/random/anvil_break.ogg": { + "hash": "705a155201cc388a0c0c6f7435ddbc0fcc56b5f2", + "size": 13741 + }, + "minecraft/sounds/mob/skeleton/say1.ogg": { + "hash": "199c9f150822950385b9bc1d840605a6a795bd27", + "size": 8727 + }, + "minecraft/sounds/mob/pig/step4.ogg": { + "hash": "f5e1ba4ac271b4c2feee86a4d04e32279ea99c10", + "size": 4483 + }, + "minecraft/sounds/mob/pig/say1.ogg": { + "hash": "a99bf88163bcb576e31e6e2275145afba6d1b4c7", + "size": 5645 + }, + "minecraft/lang/bg_BG.lang": { + "hash": "1f8e5f3b70b781bbf6c2ebca61f6647f06b67603", + "size": 99873 + }, + "minecraft/sounds/mob/magmacube/big1.ogg": { + "hash": "430c65ac81151d873a27d611a9dff6c562e38c4f", + "size": 10917 + }, + "realms/lang/en_CA.lang": { + "hash": "cb94fec6672af40f5418fec044d32990ee96d7b9", + "size": 7292 + }, + "minecraft/sounds/mob/zombiepig/zpigangry3.ogg": { + "hash": "e0c88ca054666aae58b89abdcf377eae525aa13e", + "size": 9061 + }, + "minecraft/lang/ms_MY.lang": { + "hash": "33aea58cbd8d0a8ad7b1b88432de02709342e333", + "size": 73106 + }, + "minecraft/lang/sk_SK.lang": { + "hash": "977391fc150aed15bee60af375359f495a7f2521", + "size": 73814 + }, + "minecraft/sounds/mob/skeleton/step3.ogg": { + "hash": "000c82756fd54e40cb236199f2b479629d0aca2f", + "size": 8565 + }, + "minecraft/sounds/music/game/end/boss.ogg": { + "hash": "b9eef13c2337a6335c4523858619ca560dff4496", + "size": 3329788 + }, + "minecraft/sounds/mob/villager/hit3.ogg": { + "hash": "242114e81d0f4858d91fe06b7e78b86eec3127cd", + "size": 5424 + }, + "minecraft/sounds/mob/horse/donkey/hit3.ogg": { + "hash": "4081b6ba7b4e345a0c48d791c54b6f59c1e2e1dc", + "size": 7500 + }, + "minecraft/sounds/mob/blaze/breathe2.ogg": { + "hash": "c74368d2b978f570b4e7ce9645fd84b07f8f145c", + "size": 22547 + }, + "minecraft/sounds/random/successful_hit.ogg": { + "hash": "e9833a1512b57bcf88ac4fdcc8df4e5a7e9d701d", + "size": 7139 + }, + "minecraft/sounds/mob/magmacube/small2.ogg": { + "hash": "18237686efcaa1bf9084173c99d11ce0d37d4fc5", + "size": 5518 + }, + "minecraft/sounds/mob/villager/yes2.ogg": { + "hash": "32317250b0c0ee18ed1e0c4ae3364fa796433b0a", + "size": 11025 + }, + "minecraft/sounds/music/game/nether/nether1.ogg": { + "hash": "71cc853556f7ca5784c9e9fc8e0bd6778d13027b", + "size": 2731933 + }, + "minecraft/lang/tr_TR.lang": { + "hash": "2c38cb9ef9216a83da46136fde1128c43562aa89", + "size": 73350 + }, + "minecraft/sounds/mob/ghast/moan7.ogg": { + "hash": "cfb956ba9d26cbdacd16ef77d58764df783b2c7f", + "size": 9222 + }, + "minecraft/sounds/mob/horse/zombie/hit1.ogg": { + "hash": "75feac0fe57873c7f2e93d4cccf24014ab8dc905", + "size": 8800 + }, + "minecraft/sounds/portal/travel.ogg": { + "hash": "43388701fac432a567fe9fec421521e6348ad780", + "size": 54283 + }, + "minecraft/sounds/music/game/calm3.ogg": { + "hash": "14ae57a6bce3d4254daa8be2b098c2d99743cc3f", + "size": 2232651 + }, + "minecraft/sounds/mob/skeleton/hurt3.ogg": { + "hash": "acffab0bafe2c82ffc8723880aab5ec1682d4329", + "size": 8572 + }, + "minecraft/sounds/mob/skeleton/say3.ogg": { + "hash": "a11ac56ec61c17e99f4ee33d8712404edf442720", + "size": 8161 + }, + "realms/lang/gl_ES.lang": { + "hash": "e6cbbdefe6ce1fa4d5eb3387b097e1c24b3258ab", + "size": 7621 + }, + "minecraft/sounds/step/wood6.ogg": { + "hash": "944bc8b8e1e135340dc4afc6d3416a01222674a1", + "size": 9093 + }, + "minecraft/lang/fi_FI.lang": { + "hash": "ff77255b582c0bac2fb722d74b168d51345ab730", + "size": 74638 + }, + "minecraft/sounds/mob/creeper/say3.ogg": { + "hash": "0979bf115d081d70a985f1cfcab1b9274d6be74e", + "size": 6787 + }, + "minecraft/sounds/mob/zombie/infect.ogg": { + "hash": "c18fb5eacf0fdb33c05eb806bc41332cccee43d8", + "size": 20085 + }, + "minecraft/lang/la_LA.lang": { + "hash": "5dbf29b5f54015d771873e9bb02665c1128a56ff", + "size": 71730 + }, + "minecraft/icons/icon_16x16.png": { + "hash": "bdf48ef6b5d0d23bbb02e17d04865216179f510a", + "size": 3665 + }, + "minecraft/sounds/mob/horse/skeleton/hit4.ogg": { + "hash": "68f186d1e9890fd4ede56106bfca198e904b57e4", + "size": 8143 + }, + "minecraft/sounds/mob/zombiepig/zpigangry4.ogg": { + "hash": "c76dea473821e2ae9a1f006a4eddfdd0703eecdf", + "size": 9925 + }, + "minecraft/sounds/mob/ghast/moan5.ogg": { + "hash": "48fc6c25d0f1c1f0edd4eaca2b6f934d4117f440", + "size": 14107 + }, + "minecraft/sounds/dig/snow2.ogg": { + "hash": "5887d10234c4f244ec5468080412f3e6ef9522f3", + "size": 6567 + }, + "minecraft/sounds/mob/zombiepig/zpigangry2.ogg": { + "hash": "0349ce87fe856ddf8fdd94a559bb29061b002b6c", + "size": 5789 + }, + "realms/lang/fr_FR.lang": { + "hash": "5633f7496870e805b35ca06777de782f49160347", + "size": 8045 + }, + "minecraft/sounds/mob/pig/step5.ogg": { + "hash": "56d6fd65958fb25bf9b4033a87655b591e222005", + "size": 5493 + }, + "minecraft/sounds/step/stone4.ogg": { + "hash": "d5218034051a13322d7b5efc0b5a9af739615f04", + "size": 7520 + }, + "minecraft/sounds/damage/hit1.ogg": { + "hash": "8760ebb9d4b1fe9457ef272324ecd6b4329a593e", + "size": 6539 + }, + "minecraft/sounds/mob/endermen/hit3.ogg": { + "hash": "aaa8f1705c873ebc05da460657c8b83fa01ffd57", + "size": 6564 + }, + "minecraft/sounds/mob/horse/donkey/idle3.ogg": { + "hash": "be565339d494ce6ff788480a462bce0ec69c8ded", + "size": 11079 + }, + "minecraft/sounds/mob/wither/shoot.ogg": { + "hash": "78ee5b46b6615191b7a16d259fcbda273762297e", + "size": 11481 + }, + "minecraft/sounds/mob/skeleton/hurt4.ogg": { + "hash": "a88e0436e38512171a3ef819249c3d1a2650540f", + "size": 7848 + }, + "realms/lang/pt_BR.lang": { + "hash": "a568ea57eeca8e9494837d7eda1ea2ed362186cc", + "size": 7702 + }, + "minecraft/sounds/mob/magmacube/small5.ogg": { + "hash": "560dd97e6da8badbc8ac00b28c45312e60a525f2", + "size": 4826 + }, + "minecraft/sounds/mob/silverfish/step3.ogg": { + "hash": "47ad81223bcec870206484cd4d1a6202871df331", + "size": 9308 + }, + "minecraft/lang/th_TH.lang": { + "hash": "7fafdc20468e5104493072c6708b3f8f9326c3fb", + "size": 111984 + }, + "minecraft/sounds/mob/wolf/hurt3.ogg": { + "hash": "a5b3f3cdda4d6e13629ccd0e2a38e1f06baa491a", + "size": 6381 + }, + "minecraft/sounds/random/click.ogg": { + "hash": "2fe092579d9637e2d160319820ee08e60a237bb7", + "size": 7046 + }, + "minecraft/sounds/mob/horse/soft1.ogg": { + "hash": "a9a83e3f186b3af56a9844b8d4976c6251ba17eb", + "size": 6417 + }, + "minecraft/sounds/mob/pig/step2.ogg": { + "hash": "a69a66bfda52a42ea8cf712eb1caa8830046c14f", + "size": 4508 + }, + "minecraft/sounds/mob/zombie/say1.ogg": { + "hash": "b5bc9775243437d87317ab3a66ec8a4d5b96c83d", + "size": 16877 + }, + "minecraft/sounds/ambient/cave/cave6.ogg": { + "hash": "cf23204a9cca2ac7f9674168cc063cfb4dbe001f", + "size": 42176 + }, + "minecraft/sounds/mob/slime/small3.ogg": { + "hash": "3bc8225914b1be20db68fcdae202d5acee3234c2", + "size": 5314 + }, + "minecraft/sounds/random/bowhit1.ogg": { + "hash": "78f034d58779fb4d22b00ea249015a0dbf4e7b3f", + "size": 11106 + }, + "realms/lang/ms_MY.lang": { + "hash": "158ecc0a1b876b4f3c020288e492b2b7cddbd343", + "size": 7791 + }, + "minecraft/sounds/fireworks/twinkle1.ogg": { + "hash": "41b9c631e9c1c40800b3b02a0ac5855d6ad4846d", + "size": 14328 + }, + "minecraft/sounds/mob/spider/step4.ogg": { + "hash": "7d801582e08be973d1a41469d1b92916278d1e88", + "size": 9326 + }, + "minecraft/sounds/ambient/weather/rain1.ogg": { + "hash": "d68bae1949299ccd8297aaa423dd12e041e83773", + "size": 13185 + }, + "realms/lang/oc_FR.lang": { + "hash": "431d3ec2c3a969d30f982dda71ff3e9cec17d399", + "size": 8051 + }, + "minecraft/sounds/random/bowhit2.ogg": { + "hash": "c3cd0db760c980287b26ef9c0894f66c4250724e", + "size": 10640 + }, + "minecraft/sounds/dig/grass1.ogg": { + "hash": "41cbf5dd08e951ad65883854e74d2e034929f572", + "size": 7468 + }, + "realms/lang/ko_KR.lang": { + "hash": "66464e3f372f6abd434a27fbff7c03a729ebe9ac", + "size": 8024 + }, + "minecraft/sounds/tile/piston/in.ogg": { + "hash": "594be3eaea9a2b92095eeeb3b1e01e755dcb8ce2", + "size": 5900 + }, + "minecraft/sounds/mob/chicken/say1.ogg": { + "hash": "74e5422bd83bb2041a6f0d09644bc095c0e9e21a", + "size": 7956 + }, + "minecraft/sounds/note/pling.ogg": { + "hash": "20d06589bd5ab81a73989bdac8ca59ecd4d66932", + "size": 6274 + }, + "minecraft/sounds/fire/fire.ogg": { + "hash": "8b260108a73470c16cd244325242d4780cfb7d78", + "size": 28689 + }, + "minecraft/sounds/mob/chicken/step1.ogg": { + "hash": "e0f0ba416a5744036e11bb6a5fc5ac4b8c461873", + "size": 3702 + }, + "minecraft/lang/hr_HR.lang": { + "hash": "51ffb69a87c411dcde1f3f93f9b799458e66ee81", + "size": 72096 + }, + "minecraft/sounds/random/orb.ogg": { + "hash": "e9833a1512b57bcf88ac4fdcc8df4e5a7e9d701d", + "size": 7139 + }, + "minecraft/sounds/fireworks/launch1.ogg": { + "hash": "b1715242916d56140486c612056ea4d6dd5a4404", + "size": 15598 + }, + "minecraft/sounds/mob/wolf/step2.ogg": { + "hash": "4ba55627b6b9ce64b4a48a00c990d5855b6064cf", + "size": 4766 + }, + "minecraft/sounds/random/splash.ogg": { + "hash": "22a491f266f5c3cdd6e669a9493daaf40c9c8575", + "size": 11333 + }, + "minecraft/sounds/step/grass2.ogg": { + "hash": "5c971029d9284676dce1dda2c9d202f8c47163b2", + "size": 8131 + }, + "minecraft/sounds/mob/horse/hit3.ogg": { + "hash": "559a1c7dbf17f8357b6d505f2a072f22efe0f43c", + "size": 6227 + }, + "realms/lang/fil_PH.lang": { + "hash": "fde655cdabb7140e657ed69315579c210c43031e", + "size": 7991 + }, + "minecraft/sounds/step/grass3.ogg": { + "hash": "76de0a736928eac5003691d73bdc2eda92116198", + "size": 7013 + }, + "minecraft/sounds/mob/wolf/step3.ogg": { + "hash": "30e920526eb5855065b873e30d17b4d85bfbe570", + "size": 4745 + }, + "minecraft/lang/es_MX.lang": { + "hash": "33747279d2752138df2d80cc70771e042457017f", + "size": 73763 + }, + "minecraft/sounds/mob/irongolem/throw.ogg": { + "hash": "607d51883e137d5d423dde865232ab1ee78f2694", + "size": 5316 + }, + "minecraft/lang/pt_PT.lang": { + "hash": "88077f1e3a47d62cc77fd6e81f04ff3d55644ae1", + "size": 75377 + }, + "minecraft/sounds/mob/zombie/death.ogg": { + "hash": "6e0488ab07b9539fbaebc093f194bb6a95b2caec", + "size": 9836 + }, + "minecraft/sounds/mob/irongolem/hit1.ogg": { + "hash": "942937fcad0fefd61e019678e3710f3f077757d4", + "size": 9479 + }, + "minecraft/lang/es_VE.lang": { + "hash": "a224f70ea345fdb44f89a7c1b7c200b4239e6577", + "size": 74321 + }, + "minecraft/sounds/mob/bat/loop.ogg": { + "hash": "e260582909112ec3c255d1ec0375c7913df5f9f8", + "size": 16510 + }, + "minecraft/lang/gl_ES.lang": { + "hash": "323d7f116b2187c51ff76ae7dd1ac15c5d4d007d", + "size": 74594 + }, + "minecraft/sounds/fireworks/largeBlast1.ogg": { + "hash": "ef59205829f09ac4855c614a0e7046db820df18b", + "size": 17306 + }, + "realms/lang/ka_GE.lang": { + "hash": "84fa71ecc0af0dba3f20afa2d59e428c304367c6", + "size": 12877 + }, + "minecraft/sounds/mob/bat/death.ogg": { + "hash": "6df3b2c2b951863fc5200edf3ff3396b105ed897", + "size": 8726 + }, + "minecraft/sounds/random/classic_hurt.ogg": { + "hash": "9d485556b89bf776042080774679c37300bc744b", + "size": 11499 + }, + "minecraft/sounds/ambient/weather/thunder1.ogg": { + "hash": "671ef0ae7b59014a2f637d7af6d781324ab6309f", + "size": 24468 + }, + "minecraft/sounds/tile/piston/out.ogg": { + "hash": "cb017131516de9359cb81fb991f5b3694044f8db", + "size": 6059 + }, + "minecraft/sounds/mob/blaze/hit4.ogg": { + "hash": "3f447f3e331b59ad014d9bd4a6536f98cf3a08c3", + "size": 7383 + }, + "realms/lang/mi_NZ.lang": { + "hash": "16f20c44b1662917db565be399caf1d68e020430", + "size": 73 + }, + "minecraft/sounds/mob/bat/idle4.ogg": { + "hash": "a323a968296882e15c743ccdc8cb8057557ae712", + "size": 5274 + }, + "minecraft/sounds/mob/bat/takeoff.ogg": { + "hash": "ee6079d3826ac2994f3f58e62370f3c8ff9328e9", + "size": 8821 + }, + "minecraft/sounds/mob/zombie/hurt2.ogg": { + "hash": "bc85d96a99e84a234cbe23841f87e84e71198be3", + "size": 11005 + }, + "realms/lang/nl_NL.lang": { + "hash": "5c2894bb6941070ff3a014004326cc05dda28901", + "size": 7704 + }, + "minecraft/sounds/mob/bat/idle1.ogg": { + "hash": "c3c175d70372d8448c070d0716a8d88beec8b8b7", + "size": 5708 + }, + "minecraft/lang/eo_UY.lang": { + "hash": "c4daa64350971a7714218efc517de25e2a79ccc2", + "size": 71254 + }, + "minecraft/sounds/mob/magmacube/jump4.ogg": { + "hash": "500e2543034b4c026fb175d48c47196c5d013fe8", + "size": 12902 + }, + "minecraft/sounds/mob/horse/zombie/idle2.ogg": { + "hash": "fef8520e0d345fdc7c270687c8e4fca62be36c76", + "size": 13333 + }, + "minecraft/lang/hy_AM.lang": { + "hash": "fd0b95f772a7714597740f625cfd5cc29c9d3560", + "size": 81563 + }, + "minecraft/sounds/mob/magmacube/jump3.ogg": { + "hash": "5a2449cc3d4a6ad36598847e501f956e5a3528bd", + "size": 12258 + }, + "realms/lang/pt_PT.lang": { + "hash": "1c5095ce89d18162efa0cb42a5a91f8b4d970449", + "size": 7845 + }, + "minecraft/sounds/mob/wolf/death.ogg": { + "hash": "77a5d445ed9ee588846947ac3df63f84be6d569d", + "size": 7474 + }, + "minecraft/sounds/mob/wolf/panting.ogg": { + "hash": "c2e4001d9ae8fc1f066a914170faad4c45a84e1e", + "size": 7380 + }, + "minecraft/sounds/mob/horse/donkey/death.ogg": { + "hash": "ece3a1417e0eca0a748aafaf6cd9f5e99c314991", + "size": 13955 + }, + "minecraft/sounds/mob/spider/step1.ogg": { + "hash": "8f7ff84e460ca507f654168f1d24e82637517940", + "size": 8826 + }, + "minecraft/sounds/mob/horse/idle2.ogg": { + "hash": "ece0b410c81e9ba3e29440cc48005fc544aa5104", + "size": 8699 + }, + "minecraft/sounds/liquid/lava.ogg": { + "hash": "9272aef9f27dfcc10b6e3879b7a2a67f8faa1a83", + "size": 65328 + }, + "minecraft/lang/he_IL.lang": { + "hash": "f92ff2e7e9baf2de036c780dab96dc0d018fd3f3", + "size": 81991 + }, + "realms/lang/hy_AM.lang": { + "hash": "685f29bcdcc62c0c58f4d137d30fcc40123411f4", + "size": 4397 + }, + "minecraft/sounds/mob/zombie/step3.ogg": { + "hash": "33acf13c25f65a432348e9476eda67d6a34831e3", + "size": 11734 + }, + "minecraft/sounds/mob/irongolem/walk4.ogg": { + "hash": "88ae6c906f8f94add2fe904b59c94e844bbcef9a", + "size": 7021 + }, + "minecraft/sounds/mob/chicken/plop.ogg": { + "hash": "ab5a32b70ef1e7aafc550b20afdb7dc8c0d5d901", + "size": 4680 + }, + "minecraft/sounds/mob/wolf/growl3.ogg": { + "hash": "69ef2fe8d6a744689953fd692d0106b0b2d2a9ce", + "size": 13663 + }, + "minecraft/sounds/ambient/cave/cave11.ogg": { + "hash": "e367d1dfa1ce07374e0aeaecbfb1526142a0dcc1", + "size": 36963 + }, + "minecraft/sounds/mob/cat/hiss3.ogg": { + "hash": "c7e424eb00712614a183adf5d17b949175ff00df", + "size": 13708 + }, + "minecraft/lang/af_ZA.lang": { + "hash": "913dac82b2c852eb1b6f371fe14456901386cd13", + "size": 71178 + }, + "minecraft/sounds/dig/cloth3.ogg": { + "hash": "9c63f2a3681832dc32d206f6830360bfe94b5bfc", + "size": 4897 + }, + "minecraft/lang/vi_VN.lang": { + "hash": "a15b70c81e47f1c9dc8623e838dacddf001fa3c4", + "size": 82778 + }, + "minecraft/lang/nl_NL.lang": { + "hash": "d17c0896a1ecd39c49cf9870d29597bac3a42217", + "size": 72860 + }, + "minecraft/sounds/mob/zombiepig/zpighurt2.ogg": { + "hash": "d1917b9be91d60a40dd0bf804580c1f494e9ae6d", + "size": 6245 + }, + "minecraft/sounds/mob/villager/no1.ogg": { + "hash": "255f7e21123c3647bd80c973e6a73d7854b2a1be", + "size": 7715 + }, + "minecraft/sounds/step/cloth1.ogg": { + "hash": "5fd568d724ba7d53911b6cccf5636f859d2662e8", + "size": 4832 + }, + "minecraft/sounds/mob/zombiepig/zpig4.ogg": { + "hash": "e1187646b6256b92a1384f26ef2a7e56efcbe00d", + "size": 7066 + }, + "realms/lang/es_VE.lang": { + "hash": "8a1963013018a8f53d6a72376a5b265c0d2e5ec7", + "size": 7699 + }, + "minecraft/sounds/random/burp.ogg": { + "hash": "bdc648e04933df8ddcccc84b375d6556776d4331", + "size": 6337 + }, + "minecraft/sounds/mob/horse/land.ogg": { + "hash": "4632633263997de468f35d0227b5d56c22c911bd", + "size": 9513 + }, + "minecraft/sounds/mob/skeleton/step2.ogg": { + "hash": "4609ec723b4e724f44c653b82de40ec159d2eea1", + "size": 8333 + }, + "minecraft/sounds/mob/wither/death.ogg": { + "hash": "ae27c6817985a9acb0a0fdefab89ff5d82dbe009", + "size": 62674 + }, + "minecraft/sounds/mob/blaze/hit2.ogg": { + "hash": "00b38fae5d28d99514a3e73a913af16359b12b7a", + "size": 7356 + }, + "realms/lang/uk_UA.lang": { + "hash": "eeb9546344f37e2b8b48d0c7a173d677443aba4e", + "size": 10220 + }, + "realms/lang/lv_LV.lang": { + "hash": "147c0bfa040f23f8ffa6a0fe649d7d8f8c8aa303", + "size": 7943 + }, + "minecraft/sounds/mob/zombie/say3.ogg": { + "hash": "7eb3affa45f47f919e74523a55185e65c2081d12", + "size": 19806 + }, + "minecraft/sounds/mob/villager/no3.ogg": { + "hash": "9b8737d639df9e7ef99ceef49ce11df42eea9f12", + "size": 8697 + }, + "minecraft/sounds/dig/snow3.ogg": { + "hash": "a4bc069321a96236fde04a3820664cc23b2ea619", + "size": 6540 + }, + "minecraft/sounds/mob/horse/wood5.ogg": { + "hash": "52f58da2e750cf03137c968261b7af5cef599a00", + "size": 7930 + }, + "minecraft/sounds/mob/villager/haggle2.ogg": { + "hash": "d14112bd7351ef48f193aa27b4517d4b0960f7b1", + "size": 6911 + }, + "minecraft/sounds/mob/horse/soft3.ogg": { + "hash": "f85131ddb8e80f13d8917fcf9bd99256f8a7695a", + "size": 6128 + }, + "minecraft/sounds/mob/ghast/scream4.ogg": { + "hash": "edbc9e9cb9dfeabef93207fc0bdee6ceee5df7bc", + "size": 12220 + }, + "minecraft/sounds/mob/horse/wood2.ogg": { + "hash": "61112837c4cd7174fc0cf1ebc569275c45b089ca", + "size": 7988 + }, + "minecraft/lang/sl_SI.lang": { + "hash": "49f8946e2a41e2290bd1a73654550b1413b98fb6", + "size": 72883 + }, + "minecraft/sounds/mob/horse/skeleton/hit3.ogg": { + "hash": "df488adcf98b65d30473865945cb5ea1ee30108c", + "size": 8687 + }, + "minecraft/sounds/music/game/creative/creative3.ogg": { + "hash": "4f8c3f9b4f290f63c78bf3bbaad16906a3ccff29", + "size": 3834148 + }, + "minecraft/sounds/mob/cat/meow1.ogg": { + "hash": "5fdf1bd80b204245af760042d2e546d87666e288", + "size": 9820 + }, + "minecraft/sounds/mob/zombie/wood1.ogg": { + "hash": "fa73977dd28020544f7fe2553e5604a6865ec1a6", + "size": 7761 + }, + "minecraft/sounds/mob/skeleton/step4.ogg": { + "hash": "a89bdd809baa83cacd329f0219bca1f612ccda5a", + "size": 8508 + }, + "minecraft/sounds/dig/wood3.ogg": { + "hash": "45b2aef7b5049e81b39b58f8d631563fadcc778b", + "size": 6604 + }, + "minecraft/sounds/mob/ghast/moan6.ogg": { + "hash": "b3f91f243eceaa25cff7488ec2dac732e22cfec3", + "size": 18305 + }, + "minecraft/sounds/mob/horse/skeleton/hit2.ogg": { + "hash": "721dffeec54cec90bb07986342532f327185886f", + "size": 7232 + }, + "minecraft/lang/hu_HU.lang": { + "hash": "6ae665534a98ef5a051792a98ade7bf555407d7a", + "size": 75495 + }, + "minecraft/sounds/music/game/piano2.ogg": { + "hash": "98a918eb2694defd19726436d4b9dca9e7dd6a65", + "size": 824333 + }, + "minecraft/lang/sv_SE.lang": { + "hash": "c246c98daf08c0652972b7143fc3126ff9117703", + "size": 71228 + }, + "minecraft/lang/en_GB.lang": { + "hash": "81187dd7f36516de3a88d19c2f3903f74df1def0", + "size": 69867 + }, + "minecraft/sounds/dig/stone1.ogg": { + "hash": "4e094ed8dfa98656d8fec52a7d20c5ee6098b6ad", + "size": 6695 + }, + "minecraft/sounds/music/game/creative/creative1.ogg": { + "hash": "3fe4c878450d4dc2bf3ac304e547f20d4efabad8", + "size": 4271435 + }, + "realms/lang/es_UY.lang": { + "hash": "2dcc88a24fcc775602cb622006b02862d865def8", + "size": 7694 + }, + "minecraft/lang/pl_PL.lang": { + "hash": "6da5429aafecf40a160496adb1b3f4537a3a9c67", + "size": 75898 + }, + "minecraft/sounds/mob/spider/say4.ogg": { + "hash": "3cf3e8d3aab0a3092f6c6bf681ff156bc9653859", + "size": 6343 + }, + "minecraft/lang/sr_SP.lang": { + "hash": "5513fc89fd788c31ecea7d9a3e8a3ec165f0cb4d", + "size": 94989 + }, + "minecraft/sounds/fireworks/largeBlast_far1.ogg": { + "hash": "bfb0e14bf130de4ecda75d8e793260e8bbaca35b", + "size": 21914 + }, + "minecraft/sounds/mob/endermen/scream3.ogg": { + "hash": "dbab0094299eacbce86ad427edcb34b8342861af", + "size": 9843 + }, + "icons/icon_16x16.png": { + "hash": "bdf48ef6b5d0d23bbb02e17d04865216179f510a", + "size": 3665 + }, + "minecraft/sounds/mob/horse/soft5.ogg": { + "hash": "76aa158461bacbcd138f88c0338f56525bfd55b9", + "size": 7127 + }, + "minecraft/sounds/step/stone3.ogg": { + "hash": "a533e7ae975e62592de868e0d0572778614bd587", + "size": 6631 + }, + "minecraft/sounds/mob/zombie/wood4.ogg": { + "hash": "1028d0a373790e14c34786a925c4656bdaeb4c4d", + "size": 7608 + }, + "minecraft/sounds/dig/sand1.ogg": { + "hash": "9e59c3650c6c3fc0a475f1b753b2fcfef430bf81", + "size": 5543 + }, + "minecraft/sounds/mob/ghast/scream1.ogg": { + "hash": "a0e62d86e5899405df4e796fe648e091d828691d", + "size": 10828 + }, + "minecraft/sounds/mob/wither/idle1.ogg": { + "hash": "22ed26394cb6f6b5eeb2ceb54fb50608798d19e8", + "size": 19699 + }, + "minecraft/sounds/dig/stone2.ogg": { + "hash": "9c92f697142ae320584bf64c0d54381d59703528", + "size": 6728 + }, + "minecraft/sounds/dig/cloth1.ogg": { + "hash": "5fd568d724ba7d53911b6cccf5636f859d2662e8", + "size": 4832 + }, + "realms/lang/zh_TW.lang": { + "hash": "07711734555b8c1c1e0f1555f9090309a69a3a1b", + "size": 7258 + }, + "minecraft/sounds/mob/horse/gallop4.ogg": { + "hash": "11b2b7b9cac527ce8cfb1cee41285c163ad75869", + "size": 8320 + }, + "minecraft/sounds/step/stone2.ogg": { + "hash": "22a383d9c22342305a4f16fec0bb479a885f8da2", + "size": 7086 + }, + "minecraft/sounds/dig/sand2.ogg": { + "hash": "0fa4234797f336ada4e3735e013e44d1099afe57", + "size": 5553 + }, + "minecraft/sounds/mob/horse/soft4.ogg": { + "hash": "6efbe479d74614c5f824fa5aafa295ae936b3f9f", + "size": 7224 + }, + "minecraft/sounds/mob/endermen/idle1.ogg": { + "hash": "281b87984ddf8e94324bc86911a36c971cb3d831", + "size": 6793 + }, + "minecraft/lang/it_IT.lang": { + "hash": "e257258766f1430cd6e5a97def8ecac0207ae83b", + "size": 76779 + }, + "minecraft/lang/is_IS.lang": { + "hash": "b89e2223e2c867ed3077bbe4f233a84c63729c30", + "size": 72338 + }, + "minecraft/sounds/mob/irongolem/walk1.ogg": { + "hash": "4e3e9f37c1e0c12c2993d25c28b89e2f0797ba5a", + "size": 7064 + }, + "realms/lang/af_ZA.lang": { + "hash": "b81c9d77126abec7d7cc2ebb7491e25b6b861670", + "size": 7528 + }, + "minecraft/sounds/mob/zombiepig/zpighurt1.ogg": { + "hash": "a2cfbea288280419ec0c8fb75d8ee5395536ac02", + "size": 6935 + }, + "minecraft/sounds/mob/ghast/death.ogg": { + "hash": "725e5179c72444c6d885e39c27e6b31ed83d58bc", + "size": 26853 + }, + "minecraft/sounds/mob/spider/step2.ogg": { + "hash": "a8eb0b1ce4abb53334ab75be82dc465135c4a27a", + "size": 9695 + }, + "minecraft/sounds/mob/magmacube/small3.ogg": { + "hash": "65a1a69845133187d6b8689e6ce9707da10f21a6", + "size": 5314 + }, + "minecraft/sounds/mob/skeleton/hurt1.ogg": { + "hash": "4d03069c0e14794b463f563044da46433776da60", + "size": 9986 + }, + "minecraft/sounds/mob/zombie/metal1.ogg": { + "hash": "d5b2d34e0c07a6c09c1adb17a15e50a626a88bc1", + "size": 8632 + }, + "minecraft/sounds/mob/magmacube/small4.ogg": { + "hash": "a485082ed0820eeeb9df13f84f26b14744ceeb2a", + "size": 5387 + }, + "minecraft/sounds/music/game/piano3.ogg": { + "hash": "9528b6a76e7bac64ca1145cc682e8a8448cc04e5", + "size": 2665984 + }, + "minecraft/lang/ja_JP.lang": { + "hash": "c4e61eec725b91b5aa638b4e9155caecef57e56b", + "size": 84680 + }, + "minecraft/sounds/mob/endermen/idle3.ogg": { + "hash": "bc4c2e76d3b5a0e6f9d5837fe82ed26e808aa918", + "size": 10073 + }, + "minecraft/sounds/music/game/nuance2.ogg": { + "hash": "78152dc42b036e0de7616e6e669ce5a81d17f82a", + "size": 219029 + }, + "pack.mcmeta": { + "hash": "4fd07421acc4fb19088908f0c40b38cd4ad26f48", + "size": 10995 + }, + "minecraft/lang/zh_CN.lang": { + "hash": "eb206c38395f02f84e1062af3fab9e05cb15611f", + "size": 68917 + }, + "realms/lang/fa_IR.lang": { + "hash": "017c25f046e93918d0591bdd9628eb767494c8fd", + "size": 9468 + }, + "minecraft/sounds/random/explode1.ogg": { + "hash": "cd46e41023887558b134547e28327de6e7df189a", + "size": 19732 + }, + "minecraft/sounds/note/bassattack.ogg": { + "hash": "037b9fb7f74381f354739d015193dc4a6897f620", + "size": 5574 + }, + "minecraft/sounds/mob/enderdragon/hit2.ogg": { + "hash": "46e5db05b1e91ce33c9c4c63260227fa629230f4", + "size": 10880 + }, + "minecraft/sounds/step/stone6.ogg": { + "hash": "c4810a3de80cb57f9cdf8deaacfd36cb619cdf0b", + "size": 8178 + }, + "minecraft/sounds/damage/fallsmall.ogg": { + "hash": "09236e1a725cec0229b8c564f5b3e4fe05cd7a5f", + "size": 5232 + }, + "minecraft/lang/oc_FR.lang": { + "hash": "cfe9155cc562c3e805903ea67c32a62ac1bfe372", + "size": 75081 + }, + "minecraft/sounds/random/levelup.ogg": { + "hash": "b9c60e807ba770e8c4a2b1bae81d51813dc64b6c", + "size": 15799 + }, + "minecraft/sounds/mob/skeleton/say2.ogg": { + "hash": "529abcb09220f0ebeb595f32bb663d026a7e0ae5", + "size": 8485 + }, + "minecraft/sounds/step/snow3.ogg": { + "hash": "a4bc069321a96236fde04a3820664cc23b2ea619", + "size": 6540 + }, + "minecraft/sounds/mob/ghast/moan4.ogg": { + "hash": "935f1a575322bd0ec53a919fd061321216889104", + "size": 9393 + }, + "realms/lang/nds_DE.lang": { + "hash": "84e6480d18c99ad57099ae117a2f028c412bbb2b", + "size": 7546 + }, + "minecraft/sounds/mob/horse/zombie/hit2.ogg": { + "hash": "db6d67850ac177a7407748d7efa52fa1b7b57982", + "size": 6894 + }, + "minecraft/sounds/step/grass5.ogg": { + "hash": "813ebd91b9c3fe1ac8f89f13c85d0755678f2165", + "size": 7801 + }, + "minecraft/lang/ko_KR.lang": { + "hash": "f797f0bb31e043750ccaa7be27f60acd04b5c05f", + "size": 78938 + }, + "minecraft/sounds/mob/endermen/scream1.ogg": { + "hash": "c4b5265bbafbe058347058a257abe33a0afb5ab7", + "size": 11231 + }, + "minecraft/sounds/mob/silverfish/hit1.ogg": { + "hash": "84c3b008dc1d5e0dd5e8ad85a06eca29f0591e48", + "size": 7371 + }, + "minecraft/sounds/ambient/weather/rain4.ogg": { + "hash": "08e555782cb2785b24e08a417a5e58aa08bd0695", + "size": 13955 + }, + "minecraft/sounds/step/ladder4.ogg": { + "hash": "f78ede81160002fc0561218c7ecd97e91cccab7c", + "size": 6182 + }, + "minecraft/sounds/mob/horse/breathe3.ogg": { + "hash": "b6f6330f1a5c1a3a975e852c02b0543135295d86", + "size": 7205 + }, + "minecraft/sounds/note/bd.ogg": { + "hash": "1afefaa39a53606d2737bab9cb3409350cb2dc9f", + "size": 3850 + }, + "minecraft/sounds/mob/bat/idle2.ogg": { + "hash": "e9d023a54a6b514af496c8f253f5f3fa948fd4b6", + "size": 4767 + }, + "minecraft/sounds/random/anvil_land.ogg": { + "hash": "934b16e82b94d5790175615303594f0ec28da4a0", + "size": 9210 + }, + "realms/lang/nn_NO.lang": { + "hash": "8349f016bd3d5b42f45dc12d7e0adfb300e245c3", + "size": 7594 + }, + "minecraft/sounds/mob/wolf/howl1.ogg": { + "hash": "84556bac99c01ad006552cf5d96494817e9b1700", + "size": 16994 + }, + "minecraft/sounds/random/glass3.ogg": { + "hash": "ad7d770b7fff3b64121f75bd60cecfc4866d1cd6", + "size": 7592 + }, + "minecraft/sounds/music/menu/menu4.ogg": { + "hash": "15f38314274e759c44f50ac641d11bde12474a25", + "size": 2017245 + }, + "minecraft/sounds/mob/silverfish/say4.ogg": { + "hash": "4fce41a2d0890418ae1efb03d1142ca74d00aa61", + "size": 6394 + }, + "minecraft/sounds/mob/blaze/death.ogg": { + "hash": "17491c8dd9511e9d848c92b4b7ae047aed164072", + "size": 30155 + }, + "minecraft/sounds/mob/irongolem/walk3.ogg": { + "hash": "e0672d288b09996f7c7e1a0ca696de82b7a02d18", + "size": 6883 + }, + "minecraft/sounds/mob/pig/say2.ogg": { + "hash": "ab615a912fb8ea06648836e0ec1cbeeefe117da6", + "size": 6798 + }, + "minecraft/sounds/step/snow4.ogg": { + "hash": "e26fa3036cdab4c2264ceb19e1cd197a2a510227", + "size": 6501 + }, + "minecraft/sounds/mob/zombie/step2.ogg": { + "hash": "e8dcca0e494a3f479f58f581c9a8e297cc92f4e7", + "size": 12214 + }, + "minecraft/sounds/mob/horse/jump.ogg": { + "hash": "9e49d50a15b74ec6ac4745b0de3e1848178ea437", + "size": 7501 + }, + "minecraft/lang/de_DE.lang": { + "hash": "a5b9750a30629916c454b879246231ebd1cc9a2c", + "size": 73602 + }, + "minecraft/sounds/dig/stone4.ogg": { + "hash": "363545a76277e5e47538b2dd3a0d6aa4f7a87d34", + "size": 6516 + }, + "minecraft/sounds/dig/cloth4.ogg": { + "hash": "55da1856e77cfd31a7e8c3d358e1f856c5583198", + "size": 4844 + }, + "minecraft/sounds/mob/zombie/step5.ogg": { + "hash": "b88bd8618c05232a7287799ea9246ae12f5da9d5", + "size": 14377 + }, + "minecraft/sounds/mob/horse/gallop1.ogg": { + "hash": "b489c51eb82814562b6e288a889e36ccd018928c", + "size": 8070 + }, + "minecraft/sounds/dig/grass2.ogg": { + "hash": "86cb1bb0c45625b18e00a64098cd425a38f6d3f2", + "size": 7691 + }, + "minecraft/sounds/step/ladder1.ogg": { + "hash": "d6212a1d5feb88d76b9a83ce5a27ab4e6d4c20bb", + "size": 6021 + }, + "minecraft/lang/cs_CZ.lang": { + "hash": "22bb966ab55ae53b7d5960e13f7bc11920f380a3", + "size": 73182 + }, + "realms/lang/no_NO.lang": { + "hash": "bc4277498220c42b9b6266310c3616793aa17ae3", + "size": 7555 + }, + "minecraft/sounds/ambient/cave/cave3.ogg": { + "hash": "d4b06ccb8e331ece734f51d84a0a5fbc7164d8be", + "size": 50958 + }, + "minecraft/sounds/mob/cat/purr1.ogg": { + "hash": "315512d6027033c2a279841badb40a26d74efc81", + "size": 27911 + }, + "minecraft/sounds/mob/cat/hiss2.ogg": { + "hash": "063bf0fce35c547eb59f086dbb56c5fe329cbcf4", + "size": 13451 + }, + "minecraft/sounds/mob/wolf/step5.ogg": { + "hash": "3610feb2a1a575026cfa3ab44965d114e74ea583", + "size": 5143 + }, + "realms/lang/kw_GB.lang": { + "hash": "ac61acec46bb72c4e11b3fbe8317bd593d3c2120", + "size": 3021 + }, + "minecraft/sounds/step/wood2.ogg": { + "hash": "1e82a43c30cf8fcbe05d0bc2760ecba5d2320314", + "size": 9150 + }, + "minecraft/sounds/mob/villager/idle3.ogg": { + "hash": "9a7fe638bb8b3b1060b3830c63c3ce3d03cdbe1f", + "size": 7106 + }, + "minecraft/sounds/mob/spider/say3.ogg": { + "hash": "f9f79162efa6667b753c1fbb46ff9888e8ce5f32", + "size": 7709 + }, + "minecraft/sounds/mob/cat/hitt2.ogg": { + "hash": "ce499da6ec5dd226d50843890ca09f16018aff9a", + "size": 9180 + }, + "minecraft/sounds/mob/cow/say3.ogg": { + "hash": "05f429069e65d78f7e6609d070a3f294cc3128ab", + "size": 13330 + }, + "minecraft/sounds/fire/ignite.ogg": { + "hash": "a0d1fbff7e938e92c10c1576339dda668f40e111", + "size": 6418 + }, + "minecraft/sounds/step/gravel4.ogg": { + "hash": "a47adece748059294c5f563c0fcac02fa0e4bab4", + "size": 8075 + }, + "minecraft/lang/no_NO.lang": { + "hash": "47aee6e1766ea8127c5b17a9c0416583a836244f", + "size": 70936 + }, + "minecraft/sounds/music/game/creative/creative4.ogg": { + "hash": "4664de25eb2bfc88ebbd638cfae6934dd968ceaa", + "size": 3668042 + }, + "realms/lang/tr_TR.lang": { + "hash": "6d2d486beeecb68f3f1d0d884a11f47097e59457", + "size": 7911 + }, + "minecraft/sounds/mob/slime/small1.ogg": { + "hash": "5cde2500773323f7997d75062f8a26afcdf62b2e", + "size": 6269 + }, + "minecraft/sounds/mob/horse/idle3.ogg": { + "hash": "65bd63eb0e8056707f7f16f1a272187d3d32de15", + "size": 11142 + }, + "minecraft/sounds/music/game/end/end.ogg": { + "hash": "47800737d078e751698df291054adc596ba8195a", + "size": 9914930 + }, + "minecraft/sounds/mob/zombie/unfect.ogg": { + "hash": "403c56cd190fb7587a26bcd1b7d2abac598c3ec0", + "size": 19917 + }, + "minecraft/sounds/mob/wolf/bark3.ogg": { + "hash": "1ddae4e8dfa605e27ec8278b3e312597b674437e", + "size": 5645 + }, + "minecraft/sounds/mob/slime/big2.ogg": { + "hash": "00e06362a31ad7094e452c5bcea837b061825cb0", + "size": 7931 + }, + "minecraft/sounds/mob/chicken/say2.ogg": { + "hash": "3660e743db2bbbcff0866d3f1e606882f1aeb6ac", + "size": 9476 + }, + "minecraft/lang/val_ES.lang": { + "hash": "d6fab429585e927cc6ad7bc4363fe27580ea1a97", + "size": 73899 + }, + "minecraft/sounds/mob/sheep/shear.ogg": { + "hash": "5d9055cf25f126c47e18637aeef917fa1ef61a42", + "size": 6870 + }, + "minecraft/sounds/step/grass6.ogg": { + "hash": "b88cafe403394cdcd4de0e3aeb7b76f24170c6fe", + "size": 7709 + }, + "minecraft/sounds/mob/spider/say1.ogg": { + "hash": "65b49739d48ebc47879ca5528c8283329980b304", + "size": 9045 + }, + "minecraft/lang/nds_DE.lang": { + "hash": "0c423a8686c43541591a8283ce711f476d0d4074", + "size": 69855 + }, + "realms/lang/lb_LU.lang": { + "hash": "a7602156ac3a8a41e42b833fefafbe80f9914fd5", + "size": 7825 + }, + "minecraft/sounds/mob/chicken/say3.ogg": { + "hash": "49874e07369c3bb0bc8a2fba4f2096d2e9a36c9a", + "size": 7080 + }, + "minecraft/sounds/mob/horse/zombie/idle1.ogg": { + "hash": "ef1fea92382e98356a8c39e3c99b91d72d55f342", + "size": 13283 + }, + "minecraft/sounds/note/harp.ogg": { + "hash": "46244605b8663a29cdce7bccc5b2d038241e32ee", + "size": 6137 + }, + "minecraft/sounds/mob/sheep/say3.ogg": { + "hash": "c9ac72409cbe6093e84d72a2a5c719d9e4a0e6b2", + "size": 9150 + }, + "realms/lang/fr_CA.lang": { + "hash": "edf3b3dd02931f1630c3663c6d5082a71da4fe9c", + "size": 8187 + }, + "minecraft/sounds/mob/cat/hitt1.ogg": { + "hash": "28409652d939d2489d8b5317d51abb873821f0f4", + "size": 7595 + }, + "minecraft/sounds/random/fuse.ogg": { + "hash": "a92ba2b8f6abc41aa8d679ad808a81d0aafa04b2", + "size": 29271 + }, + "minecraft/sounds/mob/zombie/step1.ogg": { + "hash": "9680c9dcd637ddea8e10a0d73705aa155d04a132", + "size": 13871 + }, + "minecraft/sounds/mob/endermen/idle5.ogg": { + "hash": "e746ec4574aaa047be3076729753c2c75fd34630", + "size": 9108 + }, + "minecraft/sounds/step/ladder3.ogg": { + "hash": "3fee58d7b2c99ddbce962618176637574ae8d67b", + "size": 6281 + }, + "realms/lang/ro_RO.lang": { + "hash": "9e17737e7bc35766f674bf4b56be14a119fd09f5", + "size": 7785 + }, + "realms/lang/hi_IN.lang": { + "hash": "8c791963f3d67ee14e3f084da3d7a14c2b99fc6c", + "size": 7305 + }, + "minecraft/sounds/liquid/swim1.ogg": { + "hash": "6ea4e448fbc2a079acb0cf3564273083dadae165", + "size": 9227 + }, + "minecraft/sounds/mob/wolf/growl2.ogg": { + "hash": "f57577fe6915175f9e4576e8d73ad4077a381433", + "size": 10311 + }, + "minecraft/sounds/mob/villager/hit4.ogg": { + "hash": "1882f71dee4f377dde08a517adc5f3c585d2d526", + "size": 5160 + }, + "minecraft/sounds/mob/chicken/hurt1.ogg": { + "hash": "31b52151bf2a6fa35d2d2aa72f832285d9e7d70d", + "size": 7740 + }, + "minecraft/sounds/mob/endermen/hit1.ogg": { + "hash": "753a88c1d9b3b46210c18ff07974955463edd18b", + "size": 6883 + }, + "minecraft/sounds/step/snow2.ogg": { + "hash": "5887d10234c4f244ec5468080412f3e6ef9522f3", + "size": 6567 + }, + "minecraft/sounds/mob/horse/gallop3.ogg": { + "hash": "cf601e6c603b4186919f49462594da6e66edb7a2", + "size": 7660 + }, + "minecraft/sounds/mob/horse/wood3.ogg": { + "hash": "50733b9cb1042acc3bc38182d7ccaa65e538bb57", + "size": 6995 + }, + "minecraft/sounds/minecart/inside.ogg": { + "hash": "6a83b514027c328b74f8428448dc6589d4b16388", + "size": 57426 + }, + "minecraft/sounds/mob/horse/donkey/hit1.ogg": { + "hash": "9580708c276c3ad24703ea7843e317b2845d272f", + "size": 6952 + }, + "minecraft/sounds/mob/zombiepig/zpig1.ogg": { + "hash": "ec4b0396dd2fc2da8fab91ddc35218d3426349b3", + "size": 8536 + }, + "realms/lang/sl_SI.lang": { + "hash": "78ffefc12f41ac971ee33ba5f30bc1a12788bb9e", + "size": 7655 + }, + "minecraft/sounds/mob/magmacube/big3.ogg": { + "hash": "d5c4316d30feef5213077e3ee24a7f52c5bf6735", + "size": 9436 + }, + "minecraft/sounds/ambient/cave/cave8.ogg": { + "hash": "9024de3f1dd4bc1e8f445c7c5b812f25c7e31bf6", + "size": 49295 + }, + "minecraft/sounds/mob/horse/wood4.ogg": { + "hash": "69ca9738d02cd8476943060a66652496c6669742", + "size": 6706 + }, + "realms/lang/vi_VN.lang": { + "hash": "c73ea4893d2b64c11036209e7782e7fb005934ef", + "size": 8997 + }, + "minecraft/sounds/mob/cat/meow2.ogg": { + "hash": "9853be18df1a5b2642e33ba05e71bfd5099f9f04", + "size": 9349 + }, + "minecraft/sounds/mob/zombie/woodbreak.ogg": { + "hash": "4e94ed53b6059d150c3bb2322b4af9ca9514bae1", + "size": 10929 + }, + "minecraft/lang/ar_SA.lang": { + "hash": "2e51504c234ea51b194ddf26871d20ed457483ec", + "size": 86496 + }, + "minecraft/sounds/mob/horse/donkey/angry2.ogg": { + "hash": "44380f86e13a06b1f0c6feec2d6644b67e6c4d9c", + "size": 11133 + }, + "minecraft/sounds/mob/slime/small5.ogg": { + "hash": "35f0b3c9c462a6c21ec213fbda2437a0e6427883", + "size": 4826 + }, + "minecraft/sounds/mob/zombie/wood2.ogg": { + "hash": "dc86fbd59cf0e87cd35b22df2a2df899ab8c1f7f", + "size": 7649 + }, + "minecraft/sounds/mob/zombie/step4.ogg": { + "hash": "69b6e589ec3d2c9063972545e83ed1f07e665094", + "size": 9822 + }, + "minecraft/lang/ca_ES.lang": { + "hash": "3386789f844a747d348a42386ee941daffdf34d4", + "size": 75720 + }, + "minecraft/sounds/mob/zombiepig/zpig2.ogg": { + "hash": "2cbbcdfb97939c469cd4ccaaac74504497c56695", + "size": 10038 + }, + "minecraft/sounds/mob/ghast/affectionate_scream.ogg": { + "hash": "99cd73dda425ee03836c2274a0fcf331139773dc", + "size": 9367 + }, + "minecraft/sounds/records/mellohi.ogg": { + "hash": "6b44d0539073353b7a05330ccddc5735ba5efca4", + "size": 663709 + }, + "minecraft/sounds/mob/pig/death.ogg": { + "hash": "4bc87ab869e17732a20c7518a327136baf5b2c26", + "size": 13694 + }, + "minecraft/sounds/mob/sheep/step1.ogg": { + "hash": "5288cab96e26207edd31307c9c01b6902306e4f6", + "size": 4838 + }, + "minecraft/sounds/music/game/creative/creative5.ogg": { + "hash": "45cb6cbbff2d7fc1daefbd85b031fd9dcfc70e7b", + "size": 5532231 + }, + "minecraft/sounds/mob/cat/purreow1.ogg": { + "hash": "d00791807e913e57d58fd891cb4dd10186cfdf38", + "size": 11787 + }, + "minecraft/sounds/mob/silverfish/hit3.ogg": { + "hash": "5b1675279bbc245fc6bbb705de8ea09fb3f32b53", + "size": 7205 + }, + "minecraft/sounds/mob/zombiepig/zpig3.ogg": { + "hash": "c9f7fa36ae48eca0a1f6ce024fde5d3472d30b4d", + "size": 5916 + }, + "minecraft/lang/hi_IN.lang": { + "hash": "081d21bad358ef6922c43cecf5e0b8f30aa52e6c", + "size": 96609 + }, + "realms/lang/is_IS.lang": { + "hash": "c75f27495baf4b0374fcece255d665d1cbbbebbd", + "size": 7615 + }, + "minecraft/sounds/mob/enderdragon/hit1.ogg": { + "hash": "aedeb53dd3315f964ff4d10d0003e4c5f41d1bb0", + "size": 11056 + }, + "minecraft/sounds/mob/enderdragon/wings2.ogg": { + "hash": "7d5b3b403a11b6dd4c3801c4f4c8bf7ce9a8c771", + "size": 10481 + }, + "minecraft/sounds/ambient/weather/rain3.ogg": { + "hash": "4cdd8fc380e85409fd94b93abdcad077d75ec58f", + "size": 13322 + }, + "minecraft/sounds/mob/horse/wood6.ogg": { + "hash": "f4ed4c71699d853437c14fb9b3d236b78108bb53", + "size": 8074 + }, + "minecraft/sounds/random/eat2.ogg": { + "hash": "d26bde554d88f0ca156baf471c44ce2c0e68176c", + "size": 5677 + }, + "minecraft/sounds/dig/wood1.ogg": { + "hash": "9bc2a84d0aa98113fc52609976fae8fc88ea6333", + "size": 6541 + }, + "minecraft/sounds/ambient/cave/cave1.ogg": { + "hash": "29d4dccf3353334c7aa2a49cb6fed3780a51a1ba", + "size": 33948 + }, + "minecraft/sounds/mob/horse/skeleton/idle3.ogg": { + "hash": "083256ad8eede9ca7191b7667971070429d824cc", + "size": 12129 + }, + "minecraft/sounds/mob/endermen/portal2.ogg": { + "hash": "35461b6a4253db40973549e82d91f267c686be85", + "size": 7442 + }, + "minecraft/sounds/damage/fallbig.ogg": { + "hash": "1d183c36f596e85c4fb564ff2667332211e49659", + "size": 6079 + }, + "minecraft/sounds/mob/ghast/moan2.ogg": { + "hash": "02073c284f025653e55f9cde25a4a62723d395fa", + "size": 8909 + }, + "minecraft/sounds/mob/endermen/scream2.ogg": { + "hash": "c8cd465468a0fd41a1d5cc24cb499862b5ade2cb", + "size": 11020 + }, + "realms/lang/cs_CZ.lang": { + "hash": "332edac716a96977e2bb5a7995b7139dac08edda", + "size": 7703 + }, + "minecraft/sounds/mob/zombie/metal2.ogg": { + "hash": "6c5a03460012d7b76c16d0dbaa01c443a6ba094e", + "size": 8889 + }, + "icons/minecraft.icns": { + "hash": "991b421dfd401f115241601b2b373140a8d78572", + "size": 114786 + }, + "minecraft/sounds/mob/sheep/step5.ogg": { + "hash": "c289aa46fcbcfaf21c8080d57953fd45a4939294", + "size": 5185 + }, + "minecraft/sounds/mob/villager/no2.ogg": { + "hash": "f224168e178eca861af133c78209b662c4d1e452", + "size": 7051 + }, + "minecraft/lang/es_ES.lang": { + "hash": "428263c79973ad44876048f421511aed401cf2e6", + "size": 75554 + }, + "minecraft/sounds/mob/ghast/fireball4.ogg": { + "hash": "eafa60d7ec34f86e8f07a001ddcdf5c4600bb174", + "size": 8535 + }, + "minecraft/lang/ru_RU.lang": { + "hash": "17d6e34837dfa86757bed29c47820914745639d5", + "size": 98015 + }, + "minecraft/sounds/mob/silverfish/say2.ogg": { + "hash": "396b8b46e593cf55d843853b704dc054ef614e55", + "size": 9782 + }, + "minecraft/sounds/mob/endermen/idle4.ogg": { + "hash": "405e2f82caef7f79eb9e26886520711e446366ce", + "size": 11208 + }, + "minecraft/sounds/mob/wolf/hurt1.ogg": { + "hash": "71b5fc7aa050892f8c9a9ed2713cc1ad8874742a", + "size": 6164 + }, + "minecraft/sounds/mob/spider/step3.ogg": { + "hash": "efa5acfa08b210ba3087b535c40549c0ed8916f0", + "size": 9237 + }, + "minecraft/sounds/mob/ghast/scream3.ogg": { + "hash": "8f23820fa28830dd031188c20acb35af044aedb5", + "size": 9399 + }, + "minecraft/sounds/mob/wither/idle4.ogg": { + "hash": "e3f90fb5afaf84475dd31dca6f65378a455d17f7", + "size": 19355 + }, + "minecraft/sounds/mob/skeleton/hurt2.ogg": { + "hash": "d1ad2cbe6584d9cd9483483f8655966d25a251a0", + "size": 7798 + }, + "realms/lang/he_IL.lang": { + "hash": "2bc6dcd491a02649614e5ffee81958b1e8bdf813", + "size": 8564 + }, + "minecraft/sounds/mob/wither/hurt2.ogg": { + "hash": "8072827813f0bffb9847e636245edebb5ddab198", + "size": 16744 + }, + "minecraft/lang/tlh_AA.lang": { + "hash": "cc38d596bbd7a6f37e3edd0a533adc32d4f89215", + "size": 49205 + }, + "minecraft/sounds/step/stone5.ogg": { + "hash": "48dd05ab2e4626d74206c2b09a628a3d59ce15e9", + "size": 7752 + }, + "minecraft/sounds/music/game/hal2.ogg": { + "hash": "ceaaaa1d57dfdfbb0bd4da5ea39628b42897a687", + "size": 1754429 + }, + "minecraft/sounds/mob/slime/small4.ogg": { + "hash": "4dfe0b607c5de2e47f3b7950c56bbebbf3115957", + "size": 5387 + }, + "minecraft/lang/id_ID.lang": { + "hash": "10c8a862c62bac263807bf39ae191d39f8e54e35", + "size": 71241 + }, + "minecraft/sounds/mob/slime/small2.ogg": { + "hash": "5e2ef521293719bbe22bbb515bbcacf4c233a075", + "size": 5518 + }, + "minecraft/sounds/fireworks/blast1.ogg": { + "hash": "d9d7511e8944da0c7ab4ed2d3e3d964f98dd6997", + "size": 11071 + }, + "minecraft/lang/az_AZ.lang": { + "hash": "7dbc8bd8dc11c8011b38a682f8a127340634f02c", + "size": 66528 + }, + "minecraft/sounds/dig/grass4.ogg": { + "hash": "c7b1005d4926f6a2e2387a41ab1fb48a72f18e98", + "size": 7163 + }, + "minecraft/lang/ro_RO.lang": { + "hash": "6e3c6a4b10e1446b7b7ce5d7342361fcf9b8da0d", + "size": 76131 + }, + "minecraft/sounds/mob/bat/hurt3.ogg": { + "hash": "1599551814c141acd0c4a3c4a0ff83f4c4e3026d", + "size": 5249 + }, + "minecraft/sounds/music/menu/menu2.ogg": { + "hash": "783ddccf4681a0c50d3e651f4e6ac27a0f4ea76f", + "size": 1809290 + }, + "minecraft/sounds/step/wood4.ogg": { + "hash": "29586f60bfe6f521dbc748919d4f0dc5b28beefd", + "size": 9651 + }, + "realms/lang/ar_SA.lang": { + "hash": "4b3ecb81a2136dd4dc6a32120224dace03ea465c", + "size": 9353 + }, + "minecraft/sounds/records/far.ogg": { + "hash": "f46c38e7d6d7b19d5d68aa18b557215738deb36a", + "size": 1285938 + }, + "minecraft/sounds/random/bowhit4.ogg": { + "hash": "9e5e2369fc354a082c861494cfe8767d327813d4", + "size": 15430 + }, + "minecraft/sounds/dig/gravel4.ogg": { + "hash": "7bf3553a4fe41a0078f4988a13d6e1ed8663ef4c", + "size": 6728 + }, + "minecraft/sounds/mob/magmacube/big2.ogg": { + "hash": "4c4bcc6905430286f32a862ce69665c51bd9938f", + "size": 7931 + }, + "realms/lang/hr_HR.lang": { + "hash": "ddd313e9466974aff2b0e39edd819954edaa63f1", + "size": 7513 + }, + "minecraft/sounds/step/sand1.ogg": { + "hash": "9813c8185197f4a4296649f27a9d738c4a6dfc78", + "size": 5123 + }, + "minecraft/sounds/mob/sheep/step3.ogg": { + "hash": "101164ea1b442a8e1e8ca181d9cef833c57d7be3", + "size": 4843 + }, + "minecraft/sounds/mob/horse/hit2.ogg": { + "hash": "d6ceab79e5cb41ab8181188361bdb553b2f645a3", + "size": 5924 + }, + "minecraft/sounds/mob/ghast/moan1.ogg": { + "hash": "882d092b05faef1cfa6af43d642b9e8843f22756", + "size": 7986 + }, + "minecraft/sounds/mob/horse/death.ogg": { + "hash": "120def25aa3d41ceeae166c7572561b4fb345900", + "size": 15184 + }, + "realms/lang/val_ES.lang": { + "hash": "bd27bbd59ddc25ae24e1e5102b43ec7abe66fc3d", + "size": 7720 + }, + "minecraft/sounds/mob/irongolem/hit2.ogg": { + "hash": "bb92fd6971430a515f508a6734392511385826e1", + "size": 9140 + }, + "minecraft/sounds/mob/silverfish/step4.ogg": { + "hash": "a342f566600caf73464323b20b7770b5b9b7893a", + "size": 8842 + }, + "minecraft/sounds/mob/wolf/step1.ogg": { + "hash": "b6a62224be809aa0c0747bee94499f0ee51ca2b6", + "size": 4777 + }, + "minecraft/sounds/music/game/nether/nether3.ogg": { + "hash": "b0b12118a97ddd733a50e9382e91a21652568641", + "size": 2460079 + }, + "minecraft/sounds/music/game/hal3.ogg": { + "hash": "dd85fb564e96ee2dbd4754f711ae9deb08a169f9", + "size": 1923269 + }, + "minecraft/sounds/mob/sheep/say1.ogg": { + "hash": "a3ffeaa0a75b8d2bdc949c181a6f8db78f8976ca", + "size": 9784 + }, + "minecraft/sounds/dig/stone3.ogg": { + "hash": "8f23c02475d388b23e5faa680eafe6b991d7a9d4", + "size": 6627 + }, + "minecraft/sounds/mob/cow/say4.ogg": { + "hash": "80ce8d4b8d361b69e42d8d147e42a09d3c85a115", + "size": 12300 + }, + "minecraft/sounds/mob/horse/donkey/idle1.ogg": { + "hash": "d2cd73933fb1f6dbcb0dd170fde6fc8a49d709b9", + "size": 6269 + }, + "minecraft/sounds/mob/magmacube/big4.ogg": { + "hash": "a63fd7965328425a0a8111640de19428d841933e", + "size": 9871 + }, + "minecraft/sounds/step/cloth2.ogg": { + "hash": "56c1d0ac0de2265018b2c41cb571cc6631101484", + "size": 4862 + }, + "minecraft/sounds/mob/spider/death.ogg": { + "hash": "4c69a6edc25d973999aa0db2bb46b583a31da278", + "size": 14380 + }, + "minecraft/sounds/note/hat.ogg": { + "hash": "fd2b6f745b05a2cf44a4e010f72631de2e5099f6", + "size": 3880 + }, + "minecraft/sounds/mob/cat/purr2.ogg": { + "hash": "847ec719ee91e28d7bf58ab39a5d8d6bd5728314", + "size": 28974 + }, + "minecraft/sounds/liquid/swim4.ogg": { + "hash": "6a908e7c7d61e01bc4223b4991820bfc56f84c5e", + "size": 7836 + }, + "minecraft/sounds/mob/horse/zombie/hit4.ogg": { + "hash": "c093e925b560d3da4c9b1ef5679d1da2a5a8473b", + "size": 8030 + }, + "minecraft/sounds/mob/endermen/stare.ogg": { + "hash": "5738d7f49ef30adcfc4f2ab13e0b1d74f09a1289", + "size": 127738 + }, + "minecraft/sounds/step/gravel3.ogg": { + "hash": "c109b985a7e6d5d3828c92e00aefa49deca0eb8c", + "size": 7488 + }, + "minecraft/sounds/random/explode4.ogg": { + "hash": "f259be40364341edcaf88e339bc24ab01e49845a", + "size": 25090 + }, + "minecraft/sounds/mob/bat/idle3.ogg": { + "hash": "e641dd3d6607db86b7574fe82781a34ad74f6c77", + "size": 4777 + }, + "minecraft/sounds/mob/wolf/growl1.ogg": { + "hash": "0b29f5ce8c4c10fa4184e5d29244f3bc121468a0", + "size": 12761 + }, + "minecraft/sounds/dig/gravel1.ogg": { + "hash": "e8b89f316f3e9989a87f6e6ff12db9abe0f8b09f", + "size": 6851 + }, + "realms/lang/az_AZ.lang": { + "hash": "8a0664c68ad24590ad5836fe237f41275df25b5d", + "size": 3933 + }, + "minecraft/lang/gv_IM.lang": { + "hash": "00c71b8f15ddfaf958c0c31da003031b8789b3a6", + "size": 71834 + }, + "minecraft/sounds/mob/horse/armor.ogg": { + "hash": "2ccb16055e7974aba40987a46c4b6370b9296106", + "size": 15195 + }, + "minecraft/sounds/records/chirp.ogg": { + "hash": "ec8a2cbdf68b4e2136098ec33695e1c53625ddb8", + "size": 1379756 + }, + "minecraft/sounds/mob/wither/hurt1.ogg": { + "hash": "550da80d936e05a7bfda43ca5d8af5b3779320f1", + "size": 16650 + }, + "minecraft/sounds/mob/cow/say1.ogg": { + "hash": "e07a2da49011ef4cf9d6b1c80a91a06f808c1243", + "size": 9714 + }, + "minecraft/sounds/mob/wither/hurt4.ogg": { + "hash": "72a006be3bd693aa23cc2f8e9c9d13ea6f829aa1", + "size": 16699 + }, + "minecraft/lang/kw_GB.lang": { + "hash": "bef3b6a408db019403d8d756d0cf85b2c8ab61d9", + "size": 51140 + }, + "minecraft/sounds/ambient/cave/cave5.ogg": { + "hash": "18a992d93128bb2e2861930cff3140c6940c0127", + "size": 67196 + }, + "minecraft/sounds/mob/creeper/say4.ogg": { + "hash": "85c860ea8c55984bf6cabb75354c78f3a603f98d", + "size": 7111 + }, + "realms/lang/es_MX.lang": { + "hash": "de6c2b919476b9ba40a81fa54cc149cfcc1e25ac", + "size": 7700 + }, + "realms/lang/es_ES.lang": { + "hash": "f3f2bc5d9de49c43f1d65ddcfc4619ea43095d13", + "size": 7767 + }, + "minecraft/sounds/step/wood1.ogg": { + "hash": "afb01196e2179e3b15b48f3373cea4c155d56b84", + "size": 8985 + }, + "minecraft/sounds/music/menu/menu1.ogg": { + "hash": "c157c56846f0e50620f808fecd9d069423dd6c41", + "size": 1744657 + }, + "minecraft/sounds/mob/zombie/wood3.ogg": { + "hash": "8184e851170619de93aa56244fb12c472a2ddd7d", + "size": 8090 + }, + "minecraft/sounds/mob/villager/haggle3.ogg": { + "hash": "4e477f55b9c4875f69cb44a2aabab4b14aefd129", + "size": 6891 + }, + "minecraft/lang/qya_AA.lang": { + "hash": "08c19cb92fc7bb6c2445dd9743364960dcf9987b", + "size": 41781 + }, + "minecraft/sounds/minecart/base.ogg": { + "hash": "28f9973fcd8366ac9837dbe190b129a8fce15857", + "size": 15354 + }, + "minecraft/sounds.json": { + "hash": "fce0bb3e14ade7b292a7c1d5fa785533d8106d82", + "size": 34020 + }, + "minecraft/sounds/records/strad.ogg": { + "hash": "f34afa3ba5f756e90a1f61023bbe069ee8442608", + "size": 1558180 + }, + "minecraft/sounds/music/game/end/credits.ogg": { + "hash": "27fcacc68bb77f01b23ea9c9d36d9018f8509cdf", + "size": 6065908 + }, + "minecraft/sounds/mob/spider/say2.ogg": { + "hash": "501b40b97ee55cb7a97943ee620aa05131089fc2", + "size": 7405 + }, + "minecraft/sounds/liquid/splash2.ogg": { + "hash": "857abbbfb58186c2f1b5510a4072630950e518f6", + "size": 36747 + }, + "minecraft/sounds/portal/trigger.ogg": { + "hash": "301f32642b654addbd06a430768fead464fd24c4", + "size": 24992 + }, + "minecraft/sounds/mob/horse/wood1.ogg": { + "hash": "711c8d8e7a1a67ace08c33a544aa3a1157ab97e2", + "size": 8190 + }, + "minecraft/sounds/fireworks/twinkle_far1.ogg": { + "hash": "c8053e3b083b08840276de9a728202551302f416", + "size": 23987 + }, + "minecraft/sounds/dig/cloth2.ogg": { + "hash": "56c1d0ac0de2265018b2c41cb571cc6631101484", + "size": 4862 + }, + "minecraft/lang/ka_GE.lang": { + "hash": "34b4b3f6f4ea91b7d631395f00ce43219d025000", + "size": 124866 + }, + "minecraft/lang/lv_LV.lang": { + "hash": "8b39739932fda786e72567c68ac28ff7efe99e80", + "size": 74262 + }, + "minecraft/sounds/ambient/cave/cave7.ogg": { + "hash": "c8dd60f7e7087da52a431c1dbc0f397317b374fb", + "size": 45278 + }, + "minecraft/sounds/step/wood5.ogg": { + "hash": "85ff970401cb1ef2e812f943077ab96549315d0a", + "size": 11520 + }, + "minecraft/sounds/random/explode2.ogg": { + "hash": "a116e396d95a0ee245000dd4cdcc333d38ea9e3b", + "size": 25246 + }, + "minecraft/sounds/mob/cow/say2.ogg": { + "hash": "228bab6d9b09994dc407b9d022bebca791d81c16", + "size": 13553 + }, + "minecraft/lang/pt_BR.lang": { + "hash": "4eedcb87b68eb6c17cc6ad8bb32b381341da08ee", + "size": 75219 + }, + "minecraft/sounds/records/ward.ogg": { + "hash": "f685021d4f26d6b590bffb341908e25e92e18cef", + "size": 1987588 + }, + "minecraft/sounds/mob/zombie/hurt1.ogg": { + "hash": "f35e14af35d1d12244dac9e655f4e31d4ef84e1b", + "size": 11047 + }, + "minecraft/lang/en_CA.lang": { + "hash": "7197269073c558f5ae376f40eeae0ad29b05c5f5", + "size": 70192 + }, + "minecraft/lang/mt_MT.lang": { + "hash": "68a7eab92d03a6b1e432b8783b415271f31771a7", + "size": 75542 + }, + "minecraft/sounds/mob/horse/donkey/angry1.ogg": { + "hash": "a36f9c11ced9aa4364de7f26bb033e32adf9ad6f", + "size": 12515 + }, + "minecraft/sounds/mob/enderdragon/wings6.ogg": { + "hash": "e7e8d393fc03a476227890e9ec9319dcc4b400ea", + "size": 11150 + }, + "minecraft/sounds/mob/cow/step1.ogg": { + "hash": "fec7c7997f8eb6faaebd37f0eaed417118d3a498", + "size": 7411 + }, + "minecraft/sounds/ambient/weather/rain2.ogg": { + "hash": "ba58e1b6c8cc814a210db268d3e59a06b7ac62be", + "size": 13301 + }, + "minecraft/sounds/dig/wood4.ogg": { + "hash": "dc66978374a46ab2b87db6472804185824868095", + "size": 6817 + }, + "minecraft/sounds/step/ladder2.ogg": { + "hash": "fd446ad40d24edfe4fb789a6065276e164ea4b61", + "size": 6125 + }, + "minecraft/sounds/mob/bat/hurt4.ogg": { + "hash": "0ba4a7830ea8852bf7844872d7e2d2a408fb77e4", + "size": 5410 + }, + "minecraft/sounds/mob/magmacube/jump1.ogg": { + "hash": "86a2a7206c769aaa9435aabba70be201cb3e3a6b", + "size": 12540 + }, + "minecraft/sounds/ambient/cave/cave10.ogg": { + "hash": "79a5b53bf22cca182ddff2a670942c49867663ec", + "size": 22725 + }, + "realms/lang/sr_SP.lang": { + "hash": "9b84cea77437d7af38d50695543791cc5d9908ae", + "size": 9826 + }, + "minecraft/sounds/mob/slime/attack2.ogg": { + "hash": "f6e2067571631aae206000a501c9adebe862e32a", + "size": 7391 + }, + "minecraft/sounds/records/wait.ogg": { + "hash": "876655d1691803f4cef17a6288d971285be79c6a", + "size": 1845255 + }, + "minecraft/sounds/step/gravel2.ogg": { + "hash": "ac7a7c8d106e26abc775b1b46150c083825d8ddc", + "size": 7921 + }, + "minecraft/sounds/mob/cat/purreow2.ogg": { + "hash": "08573a1f11058b09c5855122dff47ceb209f771e", + "size": 12237 + }, + "minecraft/sounds/music/game/creative/creative2.ogg": { + "hash": "591f41a2c5f53bcc60d7ded982fe29e76223a8ca", + "size": 3704574 + }, + "minecraft/sounds/mob/sheep/step2.ogg": { + "hash": "59034eb696e186d973dcea0b162f01e38f1b4f31", + "size": 4819 + }, + "minecraft/sounds/mob/villager/hit1.ogg": { + "hash": "101e3535d3f482acb6d1d0259d53d12b25979788", + "size": 5843 + }, + "minecraft/sounds/mob/ghast/moan3.ogg": { + "hash": "dcec2d45fbc25f74a399ec9f8001e0ecd2d5d85e", + "size": 8925 + }, + "realms/lang/hu_HU.lang": { + "hash": "022b14caa9cdc6d43bec35792b9be19e3ad7c909", + "size": 8071 + }, + "minecraft/sounds/mob/silverfish/hit2.ogg": { + "hash": "38d4d36bbe40a48c3a8ef97735b59b37f013fd6e", + "size": 6717 + }, + "realms/lang/tlh_AA.lang": { + "hash": "d304de107112235ae44caf7f856f8bc668909146", + "size": 723 + }, + "minecraft/sounds/mob/zombie/remedy.ogg": { + "hash": "8ed3945df8b9264c6451c153357475482d9f2066", + "size": 38114 + }, + "minecraft/sounds/mob/horse/hit1.ogg": { + "hash": "dc6b3831d315eedb3e97823c9ab1ae5092dcecbd", + "size": 6014 + }, + "minecraft/sounds/mob/cow/hurt2.ogg": { + "hash": "758d2a1c36abc84d2744d697b76d5414ea96d9f3", + "size": 8430 + }, + "minecraft/sounds/step/ladder5.ogg": { + "hash": "e9a1caaddcde79cdac7aa8eabde50d4cfd1bc578", + "size": 6077 + }, + "minecraft/sounds/music/game/nuance1.ogg": { + "hash": "cc1a80b6becfc6d6489c069f053d0a8adc71c339", + "size": 156322 + }, + "minecraft/lang/zh_TW.lang": { + "hash": "d2f3c9c340a5cfe30fb7e333c81a4d853d9bbddd", + "size": 68697 + }, + "minecraft/sounds/random/eat1.ogg": { + "hash": "dfee39084c771182f6b9e7cfb8c8bc4e255747bc", + "size": 5678 + }, + "minecraft/icons/minecraft.icns": { + "hash": "991b421dfd401f115241601b2b373140a8d78572", + "size": 114786 + }, + "minecraft/lang/es_AR.lang": { + "hash": "e55edae0011215873faeba154c7d89f590ddb748", + "size": 74392 + }, + "minecraft/sounds/mob/wolf/step4.ogg": { + "hash": "d7d5be6092d00c2f7f68bdcbf10ea3ac3cfea30c", + "size": 4869 + }, + "minecraft/sounds/mob/ghast/scream2.ogg": { + "hash": "57008a7f564443d563968fd040fc13ab226fc8d1", + "size": 11455 + }, + "realms/lang/fi_FI.lang": { + "hash": "131da513b18868576c3eed5c3921a36c6fa15e45", + "size": 7425 + }, + "minecraft/sounds/mob/horse/soft6.ogg": { + "hash": "352118247b942b2c0df66f2a9a60cb1fb4792446", + "size": 6970 + }, + "minecraft/sounds/mob/magmacube/jump2.ogg": { + "hash": "3285a993220dcea1fc37e98b9aa9219422c2c095", + "size": 12973 + }, + "realms/lang/eo_UY.lang": { + "hash": "710afa6f2c33e1b7de74c260f1258337c19e6779", + "size": 7480 + }, + "minecraft/sounds/mob/slime/attack1.ogg": { + "hash": "075e1ea92d5564d7bdf267ae975044315a41a686", + "size": 7806 + }, + "realms/lang/el_GR.lang": { + "hash": "f2e1dc557bcea55b34430723dfb4e33120a2dda0", + "size": 11517 + }, + "minecraft/sounds/mob/ghast/charge.ogg": { + "hash": "6f1d403f47725af0f4c42a74cfec00ff59153160", + "size": 13415 + }, + "realms/lang/et_EE.lang": { + "hash": "720c15d04d7be115daf19b024a37b498b6f7730e", + "size": 7477 + }, + "minecraft/sounds/mob/enderdragon/growl3.ogg": { + "hash": "ba35053358ede7c3bf33a4c344d66680f09008c9", + "size": 27102 + }, + "minecraft/sounds/mob/blaze/breathe1.ogg": { + "hash": "4e398c518ae706ad4d90afd6914f748faf18a7b5", + "size": 22308 + }, + "minecraft/sounds/liquid/lavapop.ogg": { + "hash": "19a5aae31c3e0018a960b709a9f0240d8d47dda7", + "size": 5609 + }, + "minecraft/lang/eu_ES.lang": { + "hash": "34090e3d3a908122ff2734784575b5a35c51d911", + "size": 75034 + }, + "minecraft/sounds/random/bowhit3.ogg": { + "hash": "0369a1236a4b9ca219fd3ad7d19d0b5237510b1e", + "size": 13252 + }, + "minecraft/sounds/mob/enderdragon/growl1.ogg": { + "hash": "049a3049a5ac8631a6c5f367b7d824fc0d8de39b", + "size": 26384 + }, + "minecraft/sounds/mob/zombiepig/zpigangry1.ogg": { + "hash": "cadbc5c34979baab1a93f5cf68a50f9bd44ef5a8", + "size": 8946 + }, + "minecraft/lang/fr_FR.lang": { + "hash": "ea1403be012b32d2239796a3617de19b6774fe06", + "size": 77165 + }, + "minecraft/lang/cy_GB.lang": { + "hash": "999257ac419cf90ec067b750bfc074e57015aa75", + "size": 72575 + }, + "minecraft/sounds/random/drink.ogg": { + "hash": "857b75738992d25e338dee640ab191323bcbf798", + "size": 7734 + }, + "minecraft/sounds/mob/cat/meow4.ogg": { + "hash": "4bf7c7a08c1217de7b1f0faf82429665fbf18458", + "size": 9560 + }, + "minecraft/lang/en_PT.lang": { + "hash": "0ee5c0e080e6f34e291a604e2485aa2c710cc81f", + "size": 73830 + }, + "minecraft/sounds/records/11.ogg": { + "hash": "f86c466225dad2f32c90981485c1965671b3e8e6", + "size": 591997 + }, + "minecraft/sounds/mob/enderdragon/hit3.ogg": { + "hash": "e96237fdf5e5e1aca09496b9192243651525d0ac", + "size": 11158 + }, + "realms/lang/en_AU.lang": { + "hash": "37fb8e6e0b534c33bdaabb8d083c48a323858e8c", + "size": 7522 + }, + "realms/lang/es_AR.lang": { + "hash": "acfe947c1219eb7493130442ef184dc8025e8191", + "size": 7554 + }, + "minecraft/sounds/mob/irongolem/hit3.ogg": { + "hash": "27c78cd09f7fd1770a41d78247ccf57c77dbc773", + "size": 8947 + }, + "realms/lang/qya_AA.lang": { + "hash": "89e887e58fb533f7dcbbbcafabbe1e8051a4c6ca", + "size": 188 + }, + "minecraft/sounds/mob/wither/idle3.ogg": { + "hash": "79afbeabcdbb063cfa00d544dc00beac8543a581", + "size": 19307 + }, + "minecraft/sounds/mob/wolf/shake.ogg": { + "hash": "3d95ea49e91b4295859b193bb41b009b92250a44", + "size": 13502 + }, + "minecraft/sounds/mob/zombiepig/zpigdeath.ogg": { + "hash": "40b8e244d03ae17483edd4571bd851e10a97050f", + "size": 10357 + }, + "realms/lang/en_PT.lang": { + "hash": "f300aa5e8f7b943f9b8e2a901e2d4fb8f7b83295", + "size": 7780 + }, + "minecraft/sounds/mob/enderdragon/hit4.ogg": { + "hash": "d2c44730f6c93676d4e4316add92e424d0a71a33", + "size": 10812 + }, + "minecraft/sounds/dig/wood2.ogg": { + "hash": "98102533e6085617a2962157b4f3658f59aea018", + "size": 6294 + }, + "minecraft/lang/en_AU.lang": { + "hash": "4b0fb97083de71e8b23e144c7cd426fb3eb09e49", + "size": 69336 + }, + "realms/lang/mt_MT.lang": { + "hash": "5f839c343f353936498507a4f3da78ebf69182d0", + "size": 7824 + }, + "minecraft/sounds/dig/gravel2.ogg": { + "hash": "c3b3797d04cb9640e1d3a72d5e96edb410388fa3", + "size": 7501 + }, + "minecraft/icons/icon_32x32.png": { + "hash": "92750c5f93c312ba9ab413d546f32190c56d6f1f", + "size": 5362 + }, + "minecraft/sounds/mob/horse/skeleton/hit1.ogg": { + "hash": "f111af513ba90b246a872e995f4b1722368899a9", + "size": 7647 + }, + "minecraft/sounds/music/game/nether/nether4.ogg": { + "hash": "e2ee9a161e2d6ea2452e5320edf8b4b01b63e350", + "size": 2771287 + }, + "minecraft/sounds/ambient/cave/cave12.ogg": { + "hash": "a720e85e35be0dc3186d01cc599121b87e7ee9f7", + "size": 21193 + }, + "minecraft/sounds/mob/slime/big1.ogg": { + "hash": "b5eca1979e69271b2065ac67ba2c37b5afac0f98", + "size": 10917 + }, + "minecraft/sounds/mob/chicken/hurt2.ogg": { + "hash": "18752157f5d8718e2752805a657c74a73d2b88db", + "size": 6177 + }, + "realms/lang/ja_JP.lang": { + "hash": "c5cc8bd843d90b8ab4fec12a1ab023c1c1ce7afb", + "size": 8727 + }, + "minecraft/sounds/step/grass4.ogg": { + "hash": "bc28801224a0aa77fdc93bb7c6c94beacdf77331", + "size": 7377 + }, + "minecraft/sounds/mob/villager/hit2.ogg": { + "hash": "1d20194a6b2f883be478830f129e017257374629", + "size": 5455 + }, + "minecraft/sounds/mob/ghast/scream5.ogg": { + "hash": "77a7b79d4f2ada27640866ece1020b631f5bdc54", + "size": 11650 + }, + "minecraft/sounds/mob/villager/haggle1.ogg": { + "hash": "57aead4d024109b4ed37dcf4c73ae44ed06f04a8", + "size": 7104 + }, + "minecraft/sounds/mob/horse/breathe1.ogg": { + "hash": "a02c38569979cd6f4305f9e43a7a9fe26477d161", + "size": 10190 + }, + "minecraft/sounds/mob/pig/step3.ogg": { + "hash": "6226903c5dfd8ac388f9d64a5fa9968680ed3507", + "size": 4722 + }, + "minecraft/sounds/ambient/weather/thunder3.ogg": { + "hash": "9ead5c928f9122e3c2f5fc4f6ce7fb4054a2b578", + "size": 27653 + }, + "minecraft/lang/fr_CA.lang": { + "hash": "b968a786fb5ddd46e28e4bf5c9ecb9c6db13bb95", + "size": 78323 + }, + "realms/lang/sv_SE.lang": { + "hash": "b7312c5ef37ea6e0f7b51c18c9a53d53da0c9468", + "size": 7617 + }, + "realms/lang/pl_PL.lang": { + "hash": "d914f93e28eea9d7ccc225064c74147d993142b8", + "size": 7779 + }, + "realms/lang/la_LA.lang": { + "hash": "4ccb3009e24e1cc0bffe18f544e6fc7ae3cd3b64", + "size": 7289 + }, + "minecraft/sounds/mob/wither/idle2.ogg": { + "hash": "6b2f86a35a3cd88320b55c029d77659915f83239", + "size": 19332 + }, + "minecraft/lang/fil_PH.lang": { + "hash": "d8fc393426b1c67fcc0a867233874670b5755687", + "size": 71457 + }, + "minecraft/sounds/note/snare.ogg": { + "hash": "6967f0af60f480e81d32f1f8e5f88ccafec3a40c", + "size": 3969 + }, + "minecraft/sounds/mob/villager/idle1.ogg": { + "hash": "a772db3c8ac37dfeb3a761854fb96297257930ab", + "size": 8605 + }, + "minecraft/sounds/mob/wither/hurt3.ogg": { + "hash": "a4cf4ebe4c475cd6a4852d6b4228a4b64cf5cb00", + "size": 16731 + }, + "minecraft/sounds/ambient/cave/cave2.ogg": { + "hash": "5680749048457f5772ec95a73d856ad792fa1717", + "size": 48741 + }, + "minecraft/lang/el_GR.lang": { + "hash": "17567e7dc53a5e939b5bd0197fbf95d93c002c2a", + "size": 106705 + }, + "minecraft/sounds/liquid/splash.ogg": { + "hash": "4c14c40542e249c902d0cac710ab4c6d6debba28", + "size": 16702 + }, + "minecraft/sounds/mob/horse/skeleton/idle1.ogg": { + "hash": "195a4b987b0b97c238de9522eb74dd1bfeab202d", + "size": 13016 + }, + "realms/lang/gv_IM.lang": { + "hash": "8a0e1c7158c4c610eda89658128fe6cc7d6d8110", + "size": 6140 + }, + "realms/lang/da_DK.lang": { + "hash": "9795a729f333a3bbb269959fc21bde2731c474fc", + "size": 7547 + }, + "minecraft/lang/da_DK.lang": { + "hash": "a2fbcec6e56101db42bdcbbf93461917e3ff9a9b", + "size": 70973 + }, + "minecraft/sounds/step/grass1.ogg": { + "hash": "227ab99bf7c6cf0b2002e0f7957d0ff7e5cb0c96", + "size": 7126 + }, + "minecraft/sounds/random/door_close.ogg": { + "hash": "9ea8a9e105321891bda18b9007b383b40aa7c076", + "size": 6510 + }, + "minecraft/sounds/music/game/nether/nether2.ogg": { + "hash": "5a7ce2181203dd558cbd55d02081b9e95a07f16f", + "size": 2783300 + }, + "minecraft/sounds/mob/wolf/howl2.ogg": { + "hash": "cdb0293c5e2bdbda21798af4e61a4c171c8b1ec0", + "size": 18136 + }, + "minecraft/sounds/mob/wither/spawn.ogg": { + "hash": "d8caaead680c20a4f51361587aeddd57a3357a72", + "size": 151896 + }, + "minecraft/sounds/mob/horse/leather.ogg": { + "hash": "20abaa7d3b0baa105bc6023d5308f1e5d76acc41", + "size": 11577 + }, + "minecraft/sounds/mob/sheep/step4.ogg": { + "hash": "6ff26a1439fb6f9f353c2bd623edeb936e760855", + "size": 5018 + }, + "minecraft/sounds/music/game/hal4.ogg": { + "hash": "5e7d63e75c6e042f452bc5e151276911ef92fed8", + "size": 2558252 + }, + "minecraft/sounds/mob/horse/zombie/death.ogg": { + "hash": "aa914f7916d6f90042841cce5972b73043eb2101", + "size": 23103 + }, + "minecraft/sounds/mob/magmacube/small1.ogg": { + "hash": "5c633c345fe4cb87c36ada2fe2b5da1b80601cf3", + "size": 6269 + }, + "minecraft/sounds/step/gravel1.ogg": { + "hash": "1d761cb3bcb45498719e4fba0751e1630e134f1a", + "size": 7757 + }, + "minecraft/sounds/mob/silverfish/say1.ogg": { + "hash": "515dffc5d6dd216550d69e61b2eb9c3593b19a20", + "size": 6584 + }, + "minecraft/sounds/mob/horse/donkey/hit2.ogg": { + "hash": "dd1846c866f5ef87e056a3f14ac156959b637726", + "size": 5948 + }, + "minecraft/sounds/mob/horse/donkey/idle2.ogg": { + "hash": "6d7eeba0ba69cd68acf1e2ed5ae488c5aabbc9bf", + "size": 6299 + }, + "minecraft/sounds/random/breath.ogg": { + "hash": "dd2f7209c2a58b0886beb34d49b0512b49adbb7e", + "size": 14331 + }, + "minecraft/sounds/music/game/calm2.ogg": { + "hash": "74da65c99aa578486efa7b69983d3533e14c0d6e", + "size": 1976731 + }, + "minecraft/sounds/mob/wolf/hurt2.ogg": { + "hash": "bc2f6a5a1b6646eac1681b7414b098089aedf3c6", + "size": 6082 + }, + "minecraft/sounds/step/snow1.ogg": { + "hash": "e9bab7d3d15541f0aaa93fad31ad37fd07e03a6c", + "size": 6532 + }, + "minecraft/sounds/mob/horse/idle1.ogg": { + "hash": "fccee35ec3b76cf6cfbff0f269ed1a3b88459f22", + "size": 9846 + }, + "minecraft/sounds/mob/horse/gallop2.ogg": { + "hash": "2433e0f1cfd53dab77422aca9f60f3d9a86d9991", + "size": 8360 + }, + "minecraft/lang/fa_IR.lang": { + "hash": "20369b200cab4b4fb4975d8468395eafb62c50a1", + "size": 76732 + }, + "minecraft/sounds/mob/villager/death.ogg": { + "hash": "97c65b93b9bff839786e23d8cb7c98ef3be4fe2d", + "size": 8428 + }, + "realms/lang/zh_CN.lang": { + "hash": "ceae6cbd84813981937687c00b911ba385416fd6", + "size": 7268 + }, + "realms/lang/lt_LT.lang": { + "hash": "3f41ed39706e90a4babec03798387b38028be639", + "size": 8113 + }, + "minecraft/sounds/mob/wolf/whine.ogg": { + "hash": "fcf4f90c452b7b511d50e3959ae05036d13a7cf8", + "size": 7846 + }, + "minecraft/sounds/mob/slime/big4.ogg": { + "hash": "c906c18d26550ae15c75e23f2c5066e4fc678c89", + "size": 9871 + }, + "minecraft/sounds/mob/cat/purr3.ogg": { + "hash": "eed7a9305f5879448bb94355f25279b4aac403b6", + "size": 34965 + }, + "minecraft/sounds/mob/cow/step2.ogg": { + "hash": "555d33de143e6dcef2aa80ebf9a8f8b1481d42d0", + "size": 7885 + }, + "minecraft/sounds/random/bow.ogg": { + "hash": "87edc11141fb5a045f2ed830b545aaa73f96ee99", + "size": 6658 + }, + "minecraft/sounds/music/game/piano1.ogg": { + "hash": "0f374764aafba398f4ba90dba05a53a9e6166138", + "size": 542805 + }, + "minecraft/lang/et_EE.lang": { + "hash": "6c7a6c4bae01c22e67bed10b69d46e67d5d67895", + "size": 72085 + }, + "minecraft/sounds/mob/blaze/hit3.ogg": { + "hash": "97e09d51c82b78ab82fb3a4dbbb8cd701b2d0aeb", + "size": 7229 + }, + "minecraft/sounds/random/pop.ogg": { + "hash": "8f45b5faf6dfae2065846d26612f7552b73640dd", + "size": 4193 + }, + "minecraft/sounds/mob/horse/soft2.ogg": { + "hash": "2bdd1bc318559543fe0f2a8e7338ef44c0290900", + "size": 6254 + }, + "minecraft/sounds/music/game/calm1.ogg": { + "hash": "50a59a4f56e4046701b758ddbb1c1587efa4cadf", + "size": 2530812 + }, + "minecraft/sounds/mob/endermen/idle2.ogg": { + "hash": "9c7aaf49b3096a69a2d6ca62c1067400a2b70814", + "size": 8236 + }, + "minecraft/sounds/mob/villager/yes3.ogg": { + "hash": "893e37d8d608cccd9c2404e785597c6a7c5f3593", + "size": 6712 + }, + "minecraft/sounds/mob/pig/step1.ogg": { + "hash": "05baaf5ed0cbdab08292b3962e1b1385e13b9dba", + "size": 5285 + }, + "minecraft/sounds/dig/snow4.ogg": { + "hash": "e26fa3036cdab4c2264ceb19e1cd197a2a510227", + "size": 6501 + }, + "minecraft/sounds/mob/enderdragon/wings5.ogg": { + "hash": "fa6d89b586c5ca29efe85c8d373ff9ee19488d40", + "size": 11659 + }, + "minecraft/sounds/mob/horse/breathe2.ogg": { + "hash": "7bbbd6126bd37b4f2ec059d2784f95310bd55b75", + "size": 9545 + }, + "minecraft/lang/lt_LT.lang": { + "hash": "78f839189133203e8d22d93ef8c9f4d02cda3023", + "size": 77379 + }, + "minecraft/sounds/mob/sheep/say2.ogg": { + "hash": "1cfd864cbda555477ed9523e640de0d234c18858", + "size": 8875 + }, + "minecraft/sounds/records/blocks.ogg": { + "hash": "9b2a01e0d0456b8fbe33557fbc19d4fe342f94d6", + "size": 2587419 + }, + "minecraft/sounds/damage/hit3.ogg": { + "hash": "c73dcedde5031fcf242b08b3405f63098cd70641", + "size": 7660 + }, + "minecraft/sounds/dig/snow1.ogg": { + "hash": "e9bab7d3d15541f0aaa93fad31ad37fd07e03a6c", + "size": 6532 + }, + "minecraft/sounds/mob/irongolem/walk2.ogg": { + "hash": "356fdb6192cf96aa5d5d9c76413f412f6a4d66a4", + "size": 6945 + }, + "minecraft/sounds/damage/hit2.ogg": { + "hash": "144867e8792415e2873293f06ecce85cd32bb4e8", + "size": 6227 + }, + "minecraft/lang/nn_NO.lang": { + "hash": "63fd5d8c33370939afe79299bb3891fe17acb444", + "size": 69343 + }, + "realms/lang/bg_BG.lang": { + "hash": "b09ad1252f8d849367a1a7455cd97493287aefa7", + "size": 10371 + }, + "minecraft/sounds/records/cat.ogg": { + "hash": "d1eb3d2e39bf1f6289cfcbca44e1c9bb508b20f0", + "size": 1286636 + }, + "minecraft/sounds/random/chestopen.ogg": { + "hash": "186d5d9481d59cc99bc4be1b5fbb98d0ef877b8e", + "size": 8703 + }, + "minecraft/sounds/mob/villager/yes1.ogg": { + "hash": "be73a79fb1ab966887a8b88bed9aa6b3d9173d71", + "size": 9191 + }, + "minecraft/sounds/mob/pig/say3.ogg": { + "hash": "58efedf302e0203a6ff9e59a6535d300286c5594", + "size": 5602 + }, + "minecraft/sounds/mob/enderdragon/end.ogg": { + "hash": "53cc1890ebea833d3964c7dd1c90676650e34404", + "size": 257102 + }, + "realms/lang/ca_ES.lang": { + "hash": "cc96acd7c25af238059cbab1107648f8964648b6", + "size": 7793 + }, + "minecraft/sounds/mob/blaze/breathe4.ogg": { + "hash": "78d544a240d627005aaef6033fd646eafc66fe7a", + "size": 22054 + }, + "minecraft/sounds/dig/sand4.ogg": { + "hash": "37afa06f97d58767a1cd1382386db878be1532dd", + "size": 5491 + } + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_no_stars.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_no_stars.png new file mode 100644 index 0000000..db806ac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_no_stars.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_1.png new file mode 100644 index 0000000..012b18b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_2.png new file mode 100644 index 0000000..572ba45 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_3.png new file mode 100644 index 0000000..089efaf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_4.png new file mode 100644 index 0000000..4b3b102 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_5.png new file mode 100644 index 0000000..d15b1d0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_6.png new file mode 100644 index 0000000..57bd14c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_7.png new file mode 100644 index 0000000..612bb49 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_8.png new file mode 100644 index 0000000..e294dab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/128/logo_128_star_8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_no_stars.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_no_stars.png new file mode 100644 index 0000000..1d22080 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_no_stars.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_1.png new file mode 100644 index 0000000..2757c37 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_2.png new file mode 100644 index 0000000..8833ece Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_3.png new file mode 100644 index 0000000..ab0c98c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_4.png new file mode 100644 index 0000000..eaaaaa2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_5.png new file mode 100644 index 0000000..75ee1be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_6.png new file mode 100644 index 0000000..14ca58f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_7.png new file mode 100644 index 0000000..40ca7d7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_8.png new file mode 100644 index 0000000..7124738 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/animatedlogo/64/logo_64_star_8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb.png new file mode 100644 index 0000000..a9553c5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb2.png new file mode 100644 index 0000000..d3958a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb_gold.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb_gold.png new file mode 100644 index 0000000..4a2f62f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb_gold.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb_test.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb_test.png new file mode 100644 index 0000000..9bf1247 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/cb_test.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/classic/cb_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/classic/cb_black.png new file mode 100644 index 0000000..4a6fa34 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/classic/cb_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/classic/cb_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/classic/cb_white.png new file mode 100644 index 0000000..7cf80ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/classic/cb_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/ass.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/ass.png new file mode 100644 index 0000000..54feb11 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/ass.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/dack.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/dack.png new file mode 100644 index 0000000..e095dc7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/dack.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/qiir.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/qiir.png new file mode 100644 index 0000000..1887480 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/qiir.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/roses.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/roses.png new file mode 100644 index 0000000..829b7c2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/roses.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/turbine.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/turbine.png new file mode 100644 index 0000000..097d0f0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/turbine.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/waterfall.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/waterfall.png new file mode 100644 index 0000000..52435bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/custom/waterfall.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/blue.png new file mode 100644 index 0000000..74cc079 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/green.png new file mode 100644 index 0000000..a1ddc02 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/orange.png new file mode 100644 index 0000000..3653b85 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/pink.png new file mode 100644 index 0000000..b60aa72 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/purple.png new file mode 100644 index 0000000..90f334b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/red.png new file mode 100644 index 0000000..22703e8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/teal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/teal.png new file mode 100644 index 0000000..93e0f47 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/teal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/yellow.png new file mode 100644 index 0000000..3c2ac6f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark/yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/blue.png new file mode 100644 index 0000000..782955b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/green.png new file mode 100644 index 0000000..80f08b7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/light_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/light_blue.png new file mode 100644 index 0000000..22d0525 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/light_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/orange.png new file mode 100644 index 0000000..7afbf00 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/pink.png new file mode 100644 index 0000000..4d2f03d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/purple.png new file mode 100644 index 0000000..4ce3b0e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/red.png new file mode 100644 index 0000000..758942b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/yellow.png new file mode 100644 index 0000000..5ab10b5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/dark_gradient/yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/gapple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/gapple.png new file mode 100644 index 0000000..9c3f870 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/gapple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/golden_carrot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/golden_carrot.png new file mode 100644 index 0000000..ad42cae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/golden_carrot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/potion.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/potion.png new file mode 100644 index 0000000..99f13ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/potion.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/steak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/steak.png new file mode 100644 index 0000000..bd505e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/steak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/sword.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/sword.png new file mode 100644 index 0000000..d5ae299 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/items/sword.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/tiktok.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/tiktok.png new file mode 100644 index 0000000..ce5ec7d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/tiktok.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/twitch.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/twitch.png new file mode 100644 index 0000000..33020c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/twitch.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/twitch_purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/twitch_purple.png new file mode 100644 index 0000000..691d860 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/twitch_purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube.png new file mode 100644 index 0000000..30d7146 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube_black.png new file mode 100644 index 0000000..ad8860e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube_red.png new file mode 100644 index 0000000..3ac32fc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/media/youtube_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/trailer/black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/trailer/black.png new file mode 100644 index 0000000..17ed1d3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/trailer/black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/trailer/white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/trailer/white.png new file mode 100644 index 0000000..b2c4648 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/capes/trailer/white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/dash-logo-54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/dash-logo-54.png new file mode 100644 index 0000000..af8399c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/dash-logo-54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair.png new file mode 100644 index 0000000..25336bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_birch.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_birch.png new file mode 100644 index 0000000..25336bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_birch.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_desert.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_desert.png new file mode 100644 index 0000000..3dc877d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_desert.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_hills.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_hills.png new file mode 100644 index 0000000..0c03ca4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_hills.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_mesa.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_mesa.png new file mode 100644 index 0000000..aa59a44 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_mesa.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_nether.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_nether.png new file mode 100644 index 0000000..20a88ea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_nether.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_roofed.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_roofed.png new file mode 100644 index 0000000..299deff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_roofed.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_sky.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_sky.png new file mode 100644 index 0000000..8d7294a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_sky.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_swamp.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_swamp.png new file mode 100644 index 0000000..55c1aec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/crosshair_swamp.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/steve.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/steve.png new file mode 100644 index 0000000..3ea14f8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/defaults/steve.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/dab.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/dab.png new file mode 100644 index 0000000..2fab5df Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/dab.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/facepalm.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/facepalm.png new file mode 100644 index 0000000..4a62ba4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/facepalm.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/floss.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/floss.png new file mode 100644 index 0000000..fb4891e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/floss.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/handsup.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/handsup.png new file mode 100644 index 0000000..e0e3f9c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/handsup.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/narutorun.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/narutorun.png new file mode 100644 index 0000000..dd9893a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/narutorun.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/shrug.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/shrug.png new file mode 100644 index 0000000..354fb54 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/shrug.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/superfacepalm.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/superfacepalm.png new file mode 100644 index 0000000..93e51e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/superfacepalm.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/tpose.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/tpose.png new file mode 100644 index 0000000..81cc96a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/tpose.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/wave.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/wave.png new file mode 100644 index 0000000..d34117b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/emote/wave.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Play-Bold.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Play-Bold.ttf new file mode 100644 index 0000000..7b9d5bf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Play-Bold.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Play-Regular.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Play-Regular.ttf new file mode 100644 index 0000000..57ab4b1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Play-Regular.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-Black.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-Black.ttf new file mode 100644 index 0000000..6805f4f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-Black.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-ExtraBold.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-ExtraBold.ttf new file mode 100644 index 0000000..502ff86 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-ExtraBold.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-ExtraLight.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-ExtraLight.ttf new file mode 100644 index 0000000..7611e96 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-ExtraLight.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-Light.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-Light.ttf new file mode 100644 index 0000000..91aa0c7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-Light.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-SemiBold.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-SemiBold.ttf new file mode 100644 index 0000000..ed0a8b9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Raleway-SemiBold.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Bold.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Bold.ttf new file mode 100644 index 0000000..d3f01ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Bold.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Light.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Light.ttf new file mode 100644 index 0000000..219063a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Light.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Medium.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Medium.ttf new file mode 100644 index 0000000..1a7f3b0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Medium.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Regular.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Regular.ttf new file mode 100644 index 0000000..2c97eea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Roboto-Regular.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-B.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-B.ttf new file mode 100644 index 0000000..b173da2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-B.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-M.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-M.ttf new file mode 100644 index 0000000..ca9c03a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-M.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-R.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-R.ttf new file mode 100644 index 0000000..d748728 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/Ubuntu-R.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/minecraft-reg.ttf b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/minecraft-reg.ttf new file mode 100644 index 0000000..c1be72b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/font/minecraft-reg.ttf differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icon-1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icon-1.png new file mode 100644 index 0000000..be74ee1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icon-1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icon-2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icon-2.png new file mode 100644 index 0000000..625e25f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icon-2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/arrow-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/arrow-64.png new file mode 100644 index 0000000..aa21af7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/arrow-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/bossbar/blurred.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/bossbar/blurred.png new file mode 100644 index 0000000..7c3b218 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/bossbar/blurred.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/bossbar/default.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/bossbar/default.png new file mode 100644 index 0000000..1d212ed Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/bossbar/default.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/cb.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/cb.png new file mode 100644 index 0000000..18c774d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/cb.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/checkmark-32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/checkmark-32.png new file mode 100644 index 0000000..4520ba1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/checkmark-32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/checkmark-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/checkmark-64.png new file mode 100644 index 0000000..7d3a829 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/checkmark-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/circle-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/circle-64.png new file mode 100644 index 0000000..949bf1e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/circle-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/circle-hollow-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/circle-hollow-64.png new file mode 100644 index 0000000..62905c3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/circle-hollow-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/cog-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/cog-64.png new file mode 100644 index 0000000..ad627d4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/cog-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/compact-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/compact-64.png new file mode 100644 index 0000000..5754c09 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/compact-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/delete-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/delete-64.png new file mode 100644 index 0000000..192b33d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/delete-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/error-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/error-64.png new file mode 100644 index 0000000..55194fa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/error-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/exit-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/exit-64.png new file mode 100644 index 0000000..38f2f02 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/exit-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/eye-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/eye-64.png new file mode 100644 index 0000000..99d7aa4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/eye-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/folder.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/folder.png new file mode 100644 index 0000000..e1683d9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/folder.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/fps-52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/fps-52.png new file mode 100644 index 0000000..29cfa21 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/fps-52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/fps-inverse-52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/fps-inverse-52.png new file mode 100644 index 0000000..74c637b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/fps-inverse-52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/garbage-26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/garbage-26.png new file mode 100644 index 0000000..b2735ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/garbage-26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/garbage-32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/garbage-32.png new file mode 100644 index 0000000..e34f168 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/garbage-32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/globe-24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/globe-24.png new file mode 100644 index 0000000..d0c9a88 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/globe-24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/headphones.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/headphones.png new file mode 100644 index 0000000..0333749 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/headphones.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/info-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/info-64.png new file mode 100644 index 0000000..cdc57fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/info-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/left.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/left.png new file mode 100644 index 0000000..252d54a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/left.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/letter-t-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/letter-t-64.png new file mode 100644 index 0000000..b0e83ca Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/letter-t-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/microphone-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/microphone-64.png new file mode 100644 index 0000000..262f871 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/microphone-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/bossbar.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/bossbar.png new file mode 100644 index 0000000..5c0c027 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/bossbar.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/cooldowns.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/cooldowns.png new file mode 100644 index 0000000..4c15042 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/cooldowns.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/diamond_chestplate.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/diamond_chestplate.png new file mode 100644 index 0000000..0dab078 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/diamond_chestplate.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/dirhud.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/dirhud.png new file mode 100644 index 0000000..3c7fd3c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/dirhud.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/ench_sword.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/ench_sword.png new file mode 100644 index 0000000..f9e987b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/ench_sword.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/env-changer.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/env-changer.png new file mode 100644 index 0000000..444b7b2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/env-changer.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/hittint.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/hittint.png new file mode 100644 index 0000000..605f670 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/hittint.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/overlay.png new file mode 100644 index 0000000..c3189c0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/packtweaks.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/packtweaks.png new file mode 100644 index 0000000..b9a9cf7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/packtweaks.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/scoreb.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/scoreb.png new file mode 100644 index 0000000..5348544 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/scoreb.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/speed_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/speed_icon.png new file mode 100644 index 0000000..4771092 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/speed_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/swordblur.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/swordblur.png new file mode 100644 index 0000000..60f5854 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/swordblur.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/wasd.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/wasd.png new file mode 100644 index 0000000..acd0971 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/wasd.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/zans.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/zans.png new file mode 100644 index 0000000..29c8dea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mods/zans.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/moon-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/moon-64.png new file mode 100644 index 0000000..42793ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/moon-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mute.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mute.png new file mode 100644 index 0000000..9351e8b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/mute.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/pencil-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/pencil-64.png new file mode 100644 index 0000000..114ac16 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/pencil-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/play-24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/play-24.png new file mode 100644 index 0000000..f0809f8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/play-24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/play-32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/play-32.png new file mode 100644 index 0000000..9106c07 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/play-32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/plus-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/plus-64.png new file mode 100644 index 0000000..2c54d73 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/plus-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/profiles-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/profiles-64.png new file mode 100644 index 0000000..c9bd7f8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/profiles-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/reset-cog-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/reset-cog-64.png new file mode 100644 index 0000000..2ee37e8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/reset-cog-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/right.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/right.png new file mode 100644 index 0000000..f063123 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/right.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/servers/minehq.com.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/servers/minehq.com.png new file mode 100644 index 0000000..5690f05 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/servers/minehq.com.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/speaker-mute.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/speaker-mute.png new file mode 100644 index 0000000..2901004 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/speaker-mute.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/speaker.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/speaker.png new file mode 100644 index 0000000..9d4c8d0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/speaker.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-21.png new file mode 100644 index 0000000..3dde9c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-64.png new file mode 100644 index 0000000..6b5ce1c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-filled-21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-filled-21.png new file mode 100644 index 0000000..02849ac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/star-filled-21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/sun-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/sun-64.png new file mode 100644 index 0000000..9ddc42a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/sun-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/volume-mute-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/volume-mute-64.png new file mode 100644 index 0000000..7659a2c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/volume-mute-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/volume-up-64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/volume-up-64.png new file mode 100644 index 0000000..5352fff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/icons/volume-up-64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_108.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_108.png new file mode 100644 index 0000000..d8f31ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_108.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_108_inner.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_108_inner.png new file mode 100644 index 0000000..22392dd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_108_inner.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_160.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_160.png new file mode 100644 index 0000000..b90235b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_160.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_255_outer.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_255_outer.png new file mode 100644 index 0000000..8e723c6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_255_outer.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_26.png new file mode 100644 index 0000000..a9442f1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_32.png new file mode 100644 index 0000000..886e153 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_42.png new file mode 100644 index 0000000..79d4239 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_inner.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_inner.png new file mode 100644 index 0000000..dec2a5e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_inner.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_outer.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_outer.png new file mode 100644 index 0000000..09c0263 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_outer.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_red.png new file mode 100644 index 0000000..c0a651f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_red_circle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_red_circle.png new file mode 100644 index 0000000..e83cfd8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_red_circle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_redblack_circle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_redblack_circle.png new file mode 100644 index 0000000..9d86a43 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_redblack_circle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white.png new file mode 100644 index 0000000..9de1037 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white_1.png new file mode 100644 index 0000000..90f1404 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white_2.png new file mode 100644 index 0000000..b2c7dc6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/logo_white_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/0.png new file mode 100644 index 0000000..74780a7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/1.png new file mode 100644 index 0000000..a8dd000 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/2.png new file mode 100644 index 0000000..2da42f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/3.png new file mode 100644 index 0000000..76b74f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/4.png new file mode 100644 index 0000000..2daf050 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/5.png new file mode 100644 index 0000000..bf0df02 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/0.png new file mode 100644 index 0000000..e399d2a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/1.png new file mode 100644 index 0000000..04760a1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/2.png new file mode 100644 index 0000000..3aa7a4c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/3.png new file mode 100644 index 0000000..51c9066 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/4.png new file mode 100644 index 0000000..33e5c6c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/5.png new file mode 100644 index 0000000..0047236 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/splash.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/splash.png new file mode 100644 index 0000000..ff512a8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/panorama/christmas/splash.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/presets/Preset 1.cfg b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/presets/Preset 1.cfg new file mode 100644 index 0000000..67c3c69 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/presets/Preset 1.cfg @@ -0,0 +1,113 @@ +################################ +# MC_Client: MODULE SETTINGS +################################ + +[HUD Info] +-State=true +-Position=LEFT_TOP +-xTranslation=0 +-yTranslation=1 +Show While Typing=true +Coordinates=true +Direction=true +FPS=false +Coords Color=f +Direction Color=a +FPS Color=7 + +[Zans Minimap] +-State=false +-Position=RIGHT_TOP +-xTranslation=0 +-yTranslation=0 + +[ToggleSprint] +-State=true +-Position=LEFT_TOP +-xTranslation=1 +-yTranslation=12 +Toggle Sprint=true +Toggle Sneak=false +Show HUD Text=true +Text Color=f +Double Tap=false +Show While Typing=true +Fly Boost=true +Fly Boost Amount=4 + +[Potion Effects] +-State=true +-Position=LEFT_MIDDLE +-xTranslation=0 +-yTranslation=-2 +Show While Typing=true +Effect Name=true +Blink=true +Blink Duration=10 +Name Color=f +Duration Color=f + +[Armor Status] +-State=true +-Position=RIGHT_BOTTOM +-xTranslation=-3 +-yTranslation=-4 +List Mode=vertical +Item Name=false +Item Count=true +Equipped Item=true +Show While Typing=false +Damage Overlay=true +Show Item Damage=true +Show Armor Damage=true +Show Max Damage=false +Damage Display Type=value +Damage Threshold Type=percent + +[Key Strokes] +-State=false +-Position=RIGHT_TOP +-xTranslation=-8 +-yTranslation=5 +Show clicks=true +Show movement keys=true +Show spacebar=true + +[Scoreboard] +-State=false +-Position=RIGHT_MIDDLE +-xTranslation=0 +-yTranslation=0 +Scale=1.0 +Remove Scoreboard numbers=true + +[Cooldowns] +-State=false +-Position=MIDDLE_TOP +-xTranslation=0 +-yTranslation=5 +Color Theme=Bright +List Mode=horizontal + +[Notification] +-State=false +-Position=MIDDLE_MIDDLE +-xTranslation=0 +-yTranslation=-50 + +[Direction HUD] +-State=false +-Position=MIDDLE_BOTTOM_RIGHT +-xTranslation=25 +-yTranslation=-31 +Show While Typing=true +Marker Color=c + +[CPS] +-State=true +-Position=MIDDLE_TOP +-xTranslation=440 +-yTranslation=0 +Show Background=true +Text Color=f + diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/black.png new file mode 100644 index 0000000..1b07006 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/blue.png new file mode 100644 index 0000000..2133e48 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/bone.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/bone.png new file mode 100644 index 0000000..f76e12e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/bone.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/darkblue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/darkblue.png new file mode 100644 index 0000000..f08902b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/darkblue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/gold.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/gold.png new file mode 100644 index 0000000..f7e53c4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/gold.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/green.png new file mode 100644 index 0000000..bf20f35 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/indigo.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/indigo.png new file mode 100644 index 0000000..0c96559 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/indigo.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/orange.png new file mode 100644 index 0000000..4e61a05 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/pink.png new file mode 100644 index 0000000..43ce4b4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/purple.png new file mode 100644 index 0000000..1a106c9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/red.png new file mode 100644 index 0000000..895fbe4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/turquoise.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/turquoise.png new file mode 100644 index 0000000..260e9e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/turquoise.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/yellow.png new file mode 100644 index 0000000..ab92163 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/preview/wings/yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/message.ogg b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/message.ogg new file mode 100644 index 0000000..dc1ff71 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/message.ogg differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/short_whoosh1.ogg b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/short_whoosh1.ogg new file mode 100644 index 0000000..0358b94 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/short_whoosh1.ogg differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/shutter.ogg b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/shutter.ogg new file mode 100644 index 0000000..5c4a98b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/shutter.ogg differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/voice_down.ogg b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/voice_down.ogg new file mode 100644 index 0000000..58f8661 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/voice_down.ogg differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/voice_up.ogg b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/voice_up.ogg new file mode 100644 index 0000000..073cad2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/sound/voice_up.ogg differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/black.png new file mode 100644 index 0000000..b8a680c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/blue.png new file mode 100644 index 0000000..e83a36a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/dark_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/dark_blue.png new file mode 100644 index 0000000..4699a91 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/dark_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/green.png new file mode 100644 index 0000000..ff0ea2a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/purple.png new file mode 100644 index 0000000..bd45328 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/red.png new file mode 100644 index 0000000..3ee1706 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/turquoise.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/turquoise.png new file mode 100644 index 0000000..d31b639 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/turquoise.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/yellow.png new file mode 100644 index 0000000..687562d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/client/wings/yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/font/glyph_sizes.bin b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/font/glyph_sizes.bin new file mode 100644 index 0000000..69c857e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/font/glyph_sizes.bin differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/lang/en_US.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/lang/en_US.lang new file mode 100644 index 0000000..7da5e5b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/lang/en_US.lang @@ -0,0 +1,1799 @@ + +language.name=English +language.region=US +language.code=en_US + +minimap.ui.welcome1=Maintained by MamiyaOtaru +minimap.ui.welcome2=Translated by: If this is not your language, help translate! +minimap.ui.welcome3=Welcome to VoxelMap, there are a +minimap.ui.welcome4=number of features and commands available to you. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Options +minimap.ui.welcome6=Toggle full screen map. +minimap.ui.welcome7=Quickly add a waypoint. +minimap.ui.welcome8=Hide this message +minimap.ui.zoomlevel=Zoom Level: +minimap.ui.otheroptions=Other Options + +options.minimap.fade=Fade distance: +options.minimap.serverpoints=Server Waypoints: + +options.minimap.title=Minimap Options +options.minimap.showcoordinates=Display Coordinates +options.minimap.hideminimap=Hide Minimap +options.minimap.cavemode=Enable Cave Mode +options.minimap.dynamiclighting=Dynamic Lighting +options.minimap.terraindepth=Terrain Depth +options.minimap.squaremap=Square Map +options.minimap.oldnorth=Old North +options.minimap.ingamewaypoints=In-game Waypoints +options.minimap.ingamewaypoints.beacons=Beacons +options.minimap.ingamewaypoints.signs=Signs +options.minimap.ingamewaypoints.both=Both +options.minimap.location=Location +options.minimap.location.topleft=Top Left +options.minimap.location.topright=Top Right +options.minimap.location.bottomright=Bottom Right +options.minimap.location.bottomleft=Bottom Left +options.minimap.size=Size +options.minimap.size.small=Small +options.minimap.size.medium=Regular +options.minimap.size.large=Large +options.minimap.fontsize=Font Size +options.minimap.radar=Radar... +options.minimap.radar.title=Radar Options +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Show Hostiles +options.minimap.radar.showplayers=Show Players +options.minimap.radar.showneutrals=Show Neutrals +options.minimap.radar.iconoutlines=Icon Outlines +options.minimap.radar.iconfiltering=Icon Filtering +options.minimap.radar.showplayerhelmets=Show Player Helmets +options.minimap.radar.showmobhelmets=Show Mob Helmets +options.minimap.radar.showplayernames=Show Player Names +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Mobs to Display... +options.minimap.detailsperformance=Details/Performance... +options.minimap.terrain.height=Height +options.minimap.terrain.slope=Slope +options.minimap.terrain.both=Both +options.minimap.filtering=Filtering +options.minimap.watertransparency=Water Transparency +options.minimap.blocktransparency=Block Transparency +options.minimap.biomes=Biomes +options.minimap.biomeoverlay=Biome Overlay +options.minimap.biomeoverlay.transparent=Transparent +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Chunk Grid +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Waypoint Options +options.minimap.waypoints.distance=Max Distance +options.minimap.waypoints.infinite=Infinite +options.minimap.waypoints.deathpoints=Deathpoint(s) +options.minimap.waypoints.deathpoints.mostrecent=Most Recent +options.minimap.waypoints.deathpoints.all=All +options.minimap.waypoints.deathpoints.tooltip=Takes effect on next death +options.minimap.waypoints.showwaypointnames=Point Names on Map +options.minimap.mobs.title=Show or Hide Individual Mob Types +options.minimap.mobs.enable=Enable Mob Icon +options.minimap.mobs.disable=Disable Mob Icon +options.minimap.mobs.enabled=This icon is displayed. +options.minimap.mobs.disabled=This icon is not displayed. + +controls.minimap.title=Minimap Controls +controls.minimap.unbind1=To unbind a key, select it and press 'Escape'. +controls.minimap.unbind2=(Except for the Menu Key - it can't be unbound) +key.minimap.zoom=Minimap Zoom +key.minimap.togglefullscreen=Toggle Fullscreen Map +key.minimap.voxelmapmenu=VoxelMap Menu +key.minimap.menu=Menu +key.minimap.waypointhotkey=Waypoint Hotkey +key.minimap.togglemobs=Toggle Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teleport To +minimap.waypoints.highlight=Highlight +minimap.waypoints.newwaypoint=New Waypoint +minimap.waypoints.deleteconfirm=Are you sure you want to remove this waypoint? +minimap.waypoints.edit=Edit Waypoint +minimap.waypoints.new=New Waypoint +minimap.waypoints.name=Waypoint Name +minimap.waypoints.choosecolor=Choose Color: +minimap.waypoints.enabled=Enabled: +minimap.waypoints.enable=Enable Waypoint +minimap.waypoints.disable=Disable Waypoint +minimap.waypoints.applicabledimensions=Dimensions in which this waypoint will be visible +minimap.waypoints.dimension.applies=Visible in this dimension +minimap.waypoints.dimension.notapplies=Not visible in this dimension +minimap.waypoints.sortbyname=Name +minimap.waypoints.sortbydistance=Distance +minimap.waypoints.sortbycreated=Created +minimap.waypoints.sortbycolor=Color + +gui.done=Done +gui.cancel=Cancel +gui.back=Back +gui.toMenu=Back to title screen +gui.up=Up +gui.down=Down +gui.yes=Yes +gui.no=No + +translation.test.none=Hello, world! +translation.test.complex=Prefix, %s%2$s again %s and %1$s lastly %s and also %1$s again! +translation.test.escape=%%s %%%s %%%%s %%%%%s +translation.test.invalid=hi % +translation.test.invalid2=hi % s +translation.test.args=%s %s +translation.test.world=world + +menu.game=Game menu +menu.singleplayer=Singleplayer +menu.multiplayer=Multiplayer +menu.online=Minecraft Realms +menu.options=Options... +menu.quit=Quit Game +menu.returnToMenu=Save and Quit to Title +menu.disconnect=Disconnect +menu.returnToGame=Back to Game +menu.switchingLevel=Switching worlds +menu.generatingLevel=Generating world +menu.loadingLevel=Loading world +menu.generatingTerrain=Building terrain +menu.convertingLevel=Converting world +menu.simulating=Simulating the world for a bit +menu.respawning=Respawning +menu.shareToLan=Open to LAN + +selectWorld.title=Select World +selectWorld.empty=empty +selectWorld.world=World +selectWorld.select=Play Selected World +selectWorld.create=Create New World +selectWorld.recreate=Re-Create +selectWorld.createDemo=Play New Demo World +selectWorld.delete=Delete +selectWorld.rename=Rename +selectWorld.deleteQuestion=Are you sure you want to delete this world? +selectWorld.deleteWarning=will be lost forever! (A long time!) +selectWorld.deleteButton=Delete +selectWorld.renameButton=Rename +selectWorld.renameTitle=Rename World +selectWorld.conversion=Must be converted! +selectWorld.newWorld=New World +selectWorld.newWorld.copyOf=Copy of %s +selectWorld.enterName=World Name +selectWorld.resultFolder=Will be saved in: +selectWorld.enterSeed=Seed for the World Generator +selectWorld.seedInfo=Leave blank for a random seed +selectWorld.cheats=Cheats +selectWorld.customizeType=Customize + +createWorld.customize.presets=Presets +createWorld.customize.presets.title=Select a Preset +createWorld.customize.presets.select=Use Preset +createWorld.customize.presets.share=Want to share your preset with someone? Use the below box! +createWorld.customize.presets.list=Alternatively, here's some we made earlier! +createWorld.customize.flat.title=Superflat Customization +createWorld.customize.flat.tile=Layer Material +createWorld.customize.flat.height=Height +createWorld.customize.flat.addLayer=Add Layer +createWorld.customize.flat.editLayer=Edit Layer +createWorld.customize.flat.removeLayer=Remove Layer +createWorld.customize.flat.layer.top=Top - %d +createWorld.customize.flat.layer=%d +createWorld.customize.flat.layer.bottom=Bottom - %d + +gameMode.survival=Survival Mode +gameMode.creative=Creative Mode +gameMode.adventure=Adventure Mode +gameMode.hardcore=Hardcore Mode! +gameMode.changed=Your game mode has been updated + +selectWorld.gameMode=Game Mode +selectWorld.gameMode.survival=Survival +selectWorld.gameMode.survival.line1=Search for resources, crafting, gain +selectWorld.gameMode.survival.line2=levels, health and hunger +selectWorld.gameMode.creative=Creative +selectWorld.gameMode.creative.line1=Unlimited resources, free flying and +selectWorld.gameMode.creative.line2=destroy blocks instantly +selectWorld.gameMode.hardcore=Hardcore +selectWorld.gameMode.hardcore.line1=Same as survival mode, locked at hardest +selectWorld.gameMode.hardcore.line2=difficulty, and one life only +selectWorld.gameMode.adventure=Adventure +selectWorld.gameMode.adventure.line1=Same as survival mode, but blocks can't +selectWorld.gameMode.adventure.line2=be added or removed +selectWorld.moreWorldOptions=More World Options... +selectWorld.mapFeatures=Generate Structures: +selectWorld.mapFeatures.info=Villages, dungeons etc +selectWorld.mapType=World Type: +selectWorld.mapType.normal=Normal +selectWorld.allowCommands=Allow Cheats: +selectWorld.allowCommands.info=Commands like /gamemode, /xp +selectWorld.hardcoreMode=Hardcore: +selectWorld.hardcoreMode.info=World is deleted upon death +selectWorld.bonusItems=Bonus Chest: + +generator.default=Default +generator.flat=Superflat +generator.largeBiomes=Large Biomes +generator.amplified=Amplified + +generator.amplified.info=Notice: Just for fun, requires beefy computer + +selectServer.title=Select Server +selectServer.empty=empty +selectServer.select=Join Server +selectServer.direct=Direct Connect +selectServer.edit=Edit +selectServer.delete=Delete +selectServer.add=Add server +selectServer.defaultName=Minecraft Server +selectServer.deleteQuestion=Are you sure you want to remove this server? +selectServer.deleteWarning=will be lost forever! (A long time!) +selectServer.deleteButton=Delete +selectServer.refresh=Refresh +selectServer.hiddenAddress=(Hidden) +addServer.title=Edit Server Info +addServer.enterName=Server Name +addServer.enterIp=Server Address +addServer.add=Done +addServer.hideAddress=Hide Address +addServer.resourcePack=Server Resource Packs +addServer.resourcePack.enabled=Enabled +addServer.resourcePack.disabled=Disabled +addServer.resourcePack.prompt=Prompt +lanServer.title=LAN World +lanServer.scanning=Scanning for games on your local network +lanServer.start=Start LAN World +lanServer.otherPlayers=Settings for Other Players +mcoServer.title=Minecraft Online World + +multiplayer.title=Play Multiplayer +multiplayer.connect=Connect +multiplayer.info1=Minecraft Multiplayer is currently not finished, but there +multiplayer.info2=is some buggy early testing going on. +multiplayer.ipinfo=Enter the IP of a server to connect to it: +multiplayer.texturePrompt.line1=This server recommends the use of a custom resource pack. +multiplayer.texturePrompt.line2=Would you like to download and install it automagically? +multiplayer.downloadingTerrain=Downloading terrain +multiplayer.downloadingStats=Downloading statistics & achievements... +multiplayer.stopSleeping=Leave Bed +multiplayer.player.joined=%s joined the game +multiplayer.player.joined.renamed=%s (formerly known as %s) joined the game +multiplayer.player.left=%s left the game + +chat.cannotSend=Cannot send chat message +chat.type.text=<%s> %s +chat.type.emote=* %s %s +chat.type.announcement=[%s] %s +chat.type.admin=[%s: %s] +chat.type.achievement=%s has just earned the achievement %s +chat.link.confirm=Are you sure you want to open the following website? +chat.link.warning=Never open links from people that you don't trust! +chat.copy=Copy to Clipboard +chat.link.confirmTrusted=Do you want to open this link or copy it to your clipboard? +chat.link.open=Open in browser + +chat.stream.text=(%s) <%s> %s +chat.stream.emote=(%s) * %s %s + +menu.playdemo=Play Demo World +menu.resetdemo=Reset Demo World + +demo.day.1=This demo will last five game days, do your best! +demo.day.2=Day Two +demo.day.3=Day Three +demo.day.4=Day Four +demo.day.5=This is your last day! +demo.day.warning=Your time is almost up! +demo.day.6=You have passed your fifth day, use F2 to save a screenshot of your creation +demo.reminder=The demo time has expired, buy the game to continue or start a new world! +demo.remainingTime=Remaining time: %s +demo.demoExpired=Demo time's up! +demo.help.movement=Use %1$s, %2$s, %3$s, %4$s and the mouse to move around +demo.help.movementShort=Move by pressing %1$s, %2$s, %3$s, %4$s +demo.help.movementMouse=Look around using the mouse +demo.help.jump=Jump by pressing %1$s +demo.help.inventory=Use %1$s to open your inventory +demo.help.title=Minecraft Demo Mode +demo.help.fullWrapped=This demo will last 5 ingame days (about 1 hour and 40 minutes of real time). Check the achievements for hints! Have fun! +demo.help.buy=Purchase Now! +demo.help.later=Continue Playing! + +connect.connecting=Connecting to the server... +connect.authorizing=Logging in... +connect.failed=Failed to connect to the server + +disconnect.genericReason=%s +disconnect.disconnected=Disconnected by Server +disconnect.lost=Connection Lost +disconnect.kicked=Was kicked from the game +disconnect.timeout=Timed out +disconnect.closed=Connection closed +disconnect.loginFailed=Failed to login +disconnect.loginFailedInfo=Failed to login: %s +disconnect.loginFailedInfo.serversUnavailable=The authentication are currently down for maintenance. +disconnect.loginFailedInfo.invalidSession=Invalid session (Try restarting your game) +disconnect.quitting=Quitting +disconnect.endOfStream=End of stream +disconnect.overflow=Buffer overflow +disconnect.spam=Kicked for spamming + +soundCategory.master=Master Volume +soundCategory.music=Music +soundCategory.record=Jukebox/Noteblocks +soundCategory.weather=Weather +soundCategory.hostile=Hostile Creatures +soundCategory.neutral=Friendly Creatures +soundCategory.player=Players +soundCategory.block=Blocks +soundCategory.ambient=Ambient/Environment + +record.nowPlaying=Now playing: %s + +options.off=OFF +options.on=ON +options.visible=Shown +options.hidden=Hidden +options.title=Options +options.controls=Controls... +options.video=Video Settings... +options.language=Language... +options.stream=Broadcast Settings... +options.sounds=Music & Sounds... +options.sounds.title=Music & Sound Options +options.languageWarning=Language translations may not be 100%% accurate +options.videoTitle=Video Settings +options.music=Music +options.sound=Sound +options.invertMouse=Invert Mouse +options.fov=FOV +options.fov.min=Normal +options.fov.max=Quake Pro +options.saturation=Saturation +options.gamma=Brightness +options.gamma.min=Moody +options.gamma.max=Bright +options.sensitivity=Sensitivity +options.sensitivity.min=*yawn* +options.sensitivity.max=HYPERSPEED!!! +options.renderDistance=Render Distance +options.renderDistance.tiny=Tiny +options.renderDistance.short=Short +options.renderDistance.normal=Normal +options.renderDistance.far=Far +options.viewBobbing=View Bobbing +options.ao=Smooth Lighting +options.ao.off=OFF +options.ao.min=Minimum +options.ao.max=Maximum +options.anaglyph=3D Anaglyph +options.framerateLimit=Max Framerate +options.framerateLimit.max=Unlimited +options.difficulty=Difficulty +options.difficulty.peaceful=Peaceful +options.difficulty.easy=Easy +options.difficulty.normal=Normal +options.difficulty.hard=Hard +options.difficulty.hardcore=Hardcore +options.graphics=Graphics +options.graphics.fancy=Fancy +options.graphics.fast=Fast +options.guiScale=GUI Scale +options.guiScale.auto=Auto +options.guiScale.small=Small +options.guiScale.normal=Normal +options.guiScale.large=Large +options.advancedOpengl=Advanced OpenGL +options.fboEnable=Enable FBOs +options.postProcessEnable=Enable Post-Processing +options.aoDesc0=Enable faux ambient occlusion on blocks. +options.aoDesc1= +options.framerateLimitDesc0=Selects the maximum frame rate: +options.framerateLimitDesc1=35fps, 120fps, or 200+fps. +options.viewBobbingDesc0=Enables view-bob when moving. +options.viewBobbingDesc1= +options.renderCloudsDesc0=Enables the rendering of clouds. +options.renderCloudsDesc1= +options.graphicsDesc0='Fancy': Enables extra transparency. +options.graphicsDesc1='Fast': Suggested for lower-end hardware. +options.renderDistanceDesc0=Maximum render distance. Smaller values +options.renderDistanceDesc1=run better on lower-end hardware. +options.particlesDesc0=Selects the overall amount of particles. +options.particlesDesc1=On lower-end hardware, less is better. +options.advancedOpenglDesc0=Enables occlusion queries. On AMD and Intel +options.advancedOpenglDesc1=hardware, this may decrease performance. +options.fboEnableDesc0=Enables the use of Framebuffer Objects. +options.fboEnableDesc1=Necessary for certain Minecraft features. +options.postProcessEnableDesc0=Enables post-processing. Disabling will +options.postProcessEnableDesc1=result in reduction in Awesome Levels. +options.renderClouds=Clouds +options.qualityButton=Video Quality Settings... +options.qualityVideoTitle=Video Quality Settings +options.performanceButton=Video Performance Settings... +options.performanceVideoTitle=Video Performance Settings +options.advancedButton=Advanced Video Settings... +options.advancedVideoTitle=Advanced Video Settings +options.postButton=Post-Processing Settings... +options.postVideoTitle=Post-Processing Settings +options.farWarning1=A 64 bit Java installation is recommended +options.farWarning2=for 'Far' render distance (you have 32 bit) +options.particles=Particles +options.particles.all=All +options.particles.decreased=Decreased +options.particles.minimal=Minimal +options.multiplayer.title=Multiplayer Settings... +options.chat.title=Chat Settings... +options.chat.visibility=Chat +options.chat.visibility.full=Shown +options.chat.visibility.system=Commands Only +options.chat.visibility.hidden=Hidden +options.chat.color=Colors +options.chat.opacity=Opacity +options.chat.links=Web Links +options.chat.links.prompt=Prompt on Links +options.chat.scale=Scale +options.chat.width=Width +options.chat.height.focused=Focused Height +options.chat.height.unfocused=Unfocused Height +options.showCape=Show Cape +options.snooper=Allow Snooper +options.snooper.view=Snooper Settings... +options.snooper.title=Machine Specs Collection +options.snooper.desc=We want to collect information about your machine to help improve Minecraft by knowing what we can support and where the biggest problems are. All of this information is completely anonymous and viewable below. We promise we won't do anything bad with this data, but if you want to opt out then feel free to toggle it off! +options.resourcepack=Resource Packs... +options.fullscreen=Fullscreen +options.vsync=Use VSync +options.touchscreen=Touchscreen Mode + +options.mipmapLevels=Mipmap Levels +options.anisotropicFiltering=Anisotropic Filtering +options.forceUnicodeFont=Force Unicode Font + +options.stream.title=Twitch Broadcast Settings +options.stream.bytesPerPixel=Quality +options.stream.micVolumne=Mic Volume +options.stream.micToggleBehavior=Push To +options.stream.mic_toggle.mute=Mute +options.stream.mic_toggle.talk=Talk +options.stream.systemVolume=System Volume +options.stream.kbps=Bandwidth +options.stream.fps=Framerate +options.stream.sendMetadata=Send Metadata +options.stream.compression=Compression +options.stream.compression.low=Low +options.stream.compression.medium=Medium +options.stream.compression.high=High +options.stream.estimation=Estimated resolution: %dx%d +options.stream.changes=You may need to restart your stream for these changes to take place. +options.stream.ingestSelection=Broadcast Server List +options.stream.ingest.title=Twitch Broadcast Servers +options.stream.ingest.reset=Reset Preference +options.stream.chat.title=Twitch Chat Settings +options.stream.chat.enabled=Enable +options.stream.chat.enabled.streaming=Whilst Streaming +options.stream.chat.enabled.always=Always +options.stream.chat.enabled.never=Never +options.stream.chat.userFilter=User Filter +options.stream.chat.userFilter.all=All Viewers +options.stream.chat.userFilter.subs=Subscribers +options.stream.chat.userFilter.mods=Moderators + +title.oldgl1=Old graphics card detected; this may prevent you from +title.oldgl2=playing in the future as OpenGL 2.0 will be required. + +controls.title=Controls +controls.reset=Reset +controls.resetAll=Reset Keys + +key.sprint=Sprint +key.forward=Walk Forwards +key.left=Strafe Left +key.back=Walk Backwards +key.right=Strafe Right +key.jump=Jump +key.inventory=Inventory +key.drop=Drop Item +key.chat=Open Chat +key.sneak=Sneak +key.playerlist=List Players +key.attack=Attack/Destroy +key.use=Use Item/Place Block +key.pickItem=Pick Block +key.mouseButton=Button %1$s +key.command=Open Command +key.screenshot=Take Screenshot +key.togglePerspective=Toggle Perspective +key.smoothCamera=Toggle Cinematic Camera +key.fullscreen=Toggle Fullscreen +key.hotbar.1=Hotbar Slot 1 +key.hotbar.2=Hotbar Slot 2 +key.hotbar.3=Hotbar Slot 3 +key.hotbar.4=Hotbar Slot 4 +key.hotbar.5=Hotbar Slot 5 +key.hotbar.6=Hotbar Slot 6 +key.hotbar.7=Hotbar Slot 7 +key.hotbar.8=Hotbar Slot 8 +key.hotbar.9=Hotbar Slot 9 +key.streamStartStop=Start/Stop Stream +key.streamPauseUnpause=Pause/Unpause Stream +key.streamCommercial=Show Stream Commercials +key.streamToggleMic=Push To Talk/Mute + +key.categories.movement=Movement +key.categories.misc=Miscellaneous +key.categories.multiplayer=Multiplayer +key.categories.gameplay=Gameplay +key.categories.ui=Game Interface +key.categories.inventory=Inventory +key.categories.stream=Streaming + +resourcePack.openFolder=Open resource pack folder +resourcePack.title=Select Resource Packs +resourcePack.available.title=Available Resource Packs +resourcePack.selected.title=Selected Resource Packs +resourcePack.folderInfo=(Place resource pack files here) + +sign.edit=Edit sign message + +book.pageIndicator=Page %1$s of %2$s +book.byAuthor=by %1$s +book.signButton=Sign +book.editTitle=Enter Book Title: +book.finalizeButton=Sign and Close +book.finalizeWarning=Note! When you sign the book, it will no longer be editable. + +tile.stone.name=Stone +tile.hayBlock.name=Hay Bale +tile.grass.name=Grass Block +tile.dirt.default.name=Dirt +tile.dirt.podzol.name=Podzol +tile.stonebrick.name=Cobblestone +tile.wood.name=Wooden Planks +tile.wood.oak.name=Oak Wood Planks +tile.wood.spruce.name=Spruce Wood Planks +tile.wood.birch.name=Birch Wood Planks +tile.wood.jungle.name=Jungle Wood Planks +tile.wood.acacia.name=Acacia Wood Planks +tile.wood.big_oak.name=Dark Oak Wood Planks +tile.sapling.oak.name=Oak Sapling +tile.sapling.spruce.name=Spruce Sapling +tile.sapling.birch.name=Birch Sapling +tile.sapling.jungle.name=Jungle Sapling +tile.sapling.acacia.name=Acacia Sapling +tile.sapling.roofed_oak.name=Dark Oak Sapling +tile.deadbush.name=Dead Bush +tile.bedrock.name=Bedrock +tile.water.name=Water +tile.lava.name=Lava +tile.sand.default.name=Sand +tile.sand.red.name=Red Sand +tile.sandStone.name=Sandstone +tile.sandStone.default.name=Sandstone +tile.sandStone.chiseled.name=Chiseled Sandstone +tile.sandStone.smooth.name=Smooth Sandstone +tile.gravel.name=Gravel +tile.oreGold.name=Gold Ore +tile.oreIron.name=Iron Ore +tile.oreCoal.name=Coal Ore +tile.log.name=Wood +tile.log.oak.name=Oak Wood +tile.log.spruce.name=Spruce Wood +tile.log.birch.name=Birch Wood +tile.log.jungle.name=Jungle Wood +tile.log.acacia.name=Acacia Wood +tile.log.big_oak.name=Dark Oak Wood +tile.leaves.name=Leaves +tile.leaves.oak.name=Oak Leaves +tile.leaves.spruce.name=Spruce Leaves +tile.leaves.birch.name=Birch Leaves +tile.leaves.jungle.name=Jungle Leaves +tile.leaves.acacia.name=Acacia Leaves +tile.leaves.big_oak.name=Dark Oak Leaves +tile.tallgrass.name=Grass +tile.tallgrass.shrub.name=Shrub +tile.tallgrass.grass.name=Grass +tile.tallgrass.fern.name=Fern +tile.sponge.name=Sponge +tile.glass.name=Glass +tile.stainedGlass.name=Stained Glass +tile.stainedGlass.black.name=Black Stained Glass +tile.stainedGlass.red.name=Red Stained Glass +tile.stainedGlass.green.name=Green Stained Glass +tile.stainedGlass.brown.name=Brown Stained Glass +tile.stainedGlass.blue.name=Blue Stained Glass +tile.stainedGlass.purple.name=Purple Stained Glass +tile.stainedGlass.cyan.name=Cyan Stained Glass +tile.stainedGlass.silver.name=Light Gray Stained Glass +tile.stainedGlass.gray.name=Gray Stained Glass +tile.stainedGlass.pink.name=Pink Stained Glass +tile.stainedGlass.lime.name=Lime Stained Glass +tile.stainedGlass.yellow.name=Yellow Stained Glass +tile.stainedGlass.lightBlue.name=Light Blue Stained Glass +tile.stainedGlass.magenta.name=Magenta Stained Glass +tile.stainedGlass.orange.name=Orange Stained Glass +tile.stainedGlass.white.name=White Stained Glass +tile.thinStainedGlass.name=Stained Glass Pane +tile.thinStainedGlass.black.name=Black Stained Glass Pane +tile.thinStainedGlass.red.name=Red Stained Glass Pane +tile.thinStainedGlass.green.name=Green Stained Glass Pane +tile.thinStainedGlass.brown.name=Brown Stained Glass Pane +tile.thinStainedGlass.blue.name=Blue Stained Glass Pane +tile.thinStainedGlass.purple.name=Purple Stained Glass Pane +tile.thinStainedGlass.cyan.name=Cyan Stained Glass Pane +tile.thinStainedGlass.silver.name=Light Gray Stained Glass Pane +tile.thinStainedGlass.gray.name=Gray Stained Glass Pane +tile.thinStainedGlass.pink.name=Pink Stained Glass Pane +tile.thinStainedGlass.lime.name=Lime Stained Glass Pane +tile.thinStainedGlass.yellow.name=Yellow Stained Glass Pane +tile.thinStainedGlass.lightBlue.name=Light Blue Stained Glass Pane +tile.thinStainedGlass.magenta.name=Magenta Stained Glass Pane +tile.thinStainedGlass.orange.name=Orange Stained Glass Pane +tile.thinStainedGlass.white.name=White Stained Glass Pane +tile.thinGlass.name=Glass Pane +tile.cloth.name=Wool +tile.flower1.dandelion.name=Dandelion +tile.flower2.poppy.name=Poppy +tile.flower2.blueOrchid.name=Blue Orchid +tile.flower2.allium.name=Allium +tile.flower2.houstonia.name=Azure Bluet +tile.flower2.tulipRed.name=Red Tulip +tile.flower2.tulipOrange.name=Orange Tulip +tile.flower2.tulipWhite.name=White Tulip +tile.flower2.tulipPink.name=Pink Tulip +tile.flower2.oxeyeDaisy.name=Oxeye Daisy +tile.doublePlant.sunflower.name=Sunflower +tile.doublePlant.syringa.name=Lilac +tile.doublePlant.grass.name=Double Tallgrass +tile.doublePlant.fern.name=Large Fern +tile.doublePlant.rose.name=Rose Bush +tile.doublePlant.paeonia.name=Peony +tile.mushroom.name=Mushroom +tile.blockGold.name=Block of Gold +tile.blockIron.name=Block of Iron +tile.stoneSlab.stone.name=Stone Slab +tile.stoneSlab.sand.name=Sandstone Slab +tile.stoneSlab.wood.name=Wooden Slab +tile.stoneSlab.cobble.name=Cobblestone Slab +tile.stoneSlab.brick.name=Bricks Slab +tile.stoneSlab.smoothStoneBrick.name=Stone Bricks Slab +tile.stoneSlab.netherBrick.name=Nether Brick Slab +tile.stoneSlab.quartz.name=Quartz Slab +tile.woodSlab.oak.name=Oak Wood Slab +tile.woodSlab.spruce.name=Spruce Wood Slab +tile.woodSlab.birch.name=Birch Wood Slab +tile.woodSlab.jungle.name=Jungle Wood Slab +tile.woodSlab.acacia.name=Acacia Wood Slab +tile.woodSlab.big_oak.name=Dark Oak Wood Slab +tile.brick.name=Bricks +tile.tnt.name=TNT +tile.bookshelf.name=Bookshelf +tile.stoneMoss.name=Moss Stone +tile.obsidian.name=Obsidian +tile.torch.name=Torch +tile.fire.name=Fire +tile.mobSpawner.name=Monster Spawner +tile.stairsWood.name=Oak Wood Stairs +tile.stairsWoodSpruce.name=Spruce Wood Stairs +tile.stairsWoodBirch.name=Birch Wood Stairs +tile.stairsWoodJungle.name=Jungle Wood Stairs +tile.stairsWoodAcacia.name=Acacia Wood Stairs +tile.stairsWoodDarkOak.name=Dark Oak Wood Stairs +tile.chest.name=Chest +tile.chestTrap.name=Trapped Chest +tile.redstoneDust.name=Redstone Dust +tile.oreDiamond.name=Diamond Ore +tile.blockCoal.name=Block of Coal +tile.blockDiamond.name=Block of Diamond +tile.workbench.name=Crafting Table +tile.crops.name=Crops +tile.farmland.name=Farmland +tile.furnace.name=Furnace +tile.sign.name=Sign +tile.doorWood.name=Wooden Door +tile.ladder.name=Ladder +tile.rail.name=Rail +tile.goldenRail.name=Powered Rail +tile.activatorRail.name=Activator Rail +tile.detectorRail.name=Detector Rail +tile.stairsStone.name=Stone Stairs +tile.stairsSandStone.name=Sandstone Stairs +tile.lever.name=Lever +tile.pressurePlate.name=Pressure Plate +tile.weightedPlate_light.name=Weighted Pressure Plate (Light) +tile.weightedPlate_heavy.name=Weighted Pressure Plate (Heavy) +tile.doorIron.name=Iron Door +tile.oreRedstone.name=Redstone Ore +tile.notGate.name=Redstone Torch +tile.button.name=Button +tile.snow.name=Snow +tile.woolCarpet.black.name=Black Carpet +tile.woolCarpet.red.name=Red Carpet +tile.woolCarpet.green.name=Green Carpet +tile.woolCarpet.brown.name=Brown Carpet +tile.woolCarpet.blue.name=Blue Carpet +tile.woolCarpet.purple.name=Purple Carpet +tile.woolCarpet.cyan.name=Cyan Carpet +tile.woolCarpet.silver.name=Light Gray Carpet +tile.woolCarpet.gray.name=Gray Carpet +tile.woolCarpet.pink.name=Pink Carpet +tile.woolCarpet.lime.name=Lime Carpet +tile.woolCarpet.yellow.name=Yellow Carpet +tile.woolCarpet.lightBlue.name=Light Blue Carpet +tile.woolCarpet.magenta.name=Magenta Carpet +tile.woolCarpet.orange.name=Orange Carpet +tile.woolCarpet.white.name=Carpet +tile.ice.name=Ice +tile.icePacked.name=Packed Ice +tile.cactus.name=Cactus +tile.clay.name=Clay +tile.clayHardenedStained.black.name=Black Stained Clay +tile.clayHardenedStained.red.name=Red Stained Clay +tile.clayHardenedStained.green.name=Green Stained Clay +tile.clayHardenedStained.brown.name=Brown Stained Clay +tile.clayHardenedStained.blue.name=Blue Stained Clay +tile.clayHardenedStained.purple.name=Purple Stained Clay +tile.clayHardenedStained.cyan.name=Cyan Stained Clay +tile.clayHardenedStained.silver.name=Light Gray Stained Clay +tile.clayHardenedStained.gray.name=Gray Stained Clay +tile.clayHardenedStained.pink.name=Pink Stained Clay +tile.clayHardenedStained.lime.name=Lime Stained Clay +tile.clayHardenedStained.yellow.name=Yellow Stained Clay +tile.clayHardenedStained.lightBlue.name=Light Blue Stained Clay +tile.clayHardenedStained.magenta.name=Magenta Stained Clay +tile.clayHardenedStained.orange.name=Orange Stained Clay +tile.clayHardenedStained.white.name=White Stained Clay +tile.clayHardened.name=Hardened Clay +tile.reeds.name=Sugar cane +tile.jukebox.name=Jukebox +tile.fence.name=Fence +tile.fenceGate.name=Fence Gate +tile.pumpkin.name=Pumpkin +tile.litpumpkin.name=Jack o'Lantern +tile.hellrock.name=Netherrack +tile.hellsand.name=Soul Sand +tile.lightgem.name=Glowstone +tile.portal.name=Portal +tile.cloth.black.name=Black Wool +tile.cloth.red.name=Red Wool +tile.cloth.green.name=Green Wool +tile.cloth.brown.name=Brown Wool +tile.cloth.blue.name=Blue Wool +tile.cloth.purple.name=Purple Wool +tile.cloth.cyan.name=Cyan Wool +tile.cloth.silver.name=Light Gray Wool +tile.cloth.gray.name=Gray Wool +tile.cloth.pink.name=Pink Wool +tile.cloth.lime.name=Lime Wool +tile.cloth.yellow.name=Yellow Wool +tile.cloth.lightBlue.name=Light Blue Wool +tile.cloth.magenta.name=Magenta Wool +tile.cloth.orange.name=Orange Wool +tile.cloth.white.name=Wool +tile.oreLapis.name=Lapis Lazuli Ore +tile.blockLapis.name=Lapis Lazuli Block +tile.dispenser.name=Dispenser +tile.dropper.name=Dropper +tile.musicBlock.name=Note Block +tile.cake.name=Cake +tile.bed.name=Bed +tile.bed.occupied=This bed is occupied +tile.bed.noSleep=You can only sleep at night +tile.bed.notSafe=You may not rest now, there are monsters nearby +tile.bed.notValid=Your home bed was missing or obstructed +tile.lockedchest.name=Locked chest +tile.trapdoor.name=Trapdoor +tile.web.name=Cobweb +tile.stonebricksmooth.name=Stone Bricks +tile.stonebricksmooth.default.name=Stone Bricks +tile.stonebricksmooth.mossy.name=Mossy Stone Bricks +tile.stonebricksmooth.cracked.name=Cracked Stone Bricks +tile.stonebricksmooth.chiseled.name=Chiseled Stone Bricks +tile.monsterStoneEgg.stone.name=Stone Monster Egg +tile.monsterStoneEgg.cobble.name=Cobblestone Monster Egg +tile.monsterStoneEgg.brick.name=Stone Brick Monster Egg +tile.monsterStoneEgg.mossybrick.name=Mossy Stone Brick Monster Egg +tile.monsterStoneEgg.crackedbrick.name=Cracked Stone Brick Monster Egg +tile.monsterStoneEgg.chiseledbrick.name=Chiseled Stone Brick Monster Egg +tile.pistonBase.name=Piston +tile.pistonStickyBase.name=Sticky Piston +tile.fenceIron.name=Iron Bars +tile.melon.name=Melon +tile.stairsBrick.name=Brick Stairs +tile.stairsStoneBrickSmooth.name=Stone Brick Stairs +tile.vine.name=Vines +tile.netherBrick.name=Nether Brick +tile.netherFence.name=Nether Brick Fence +tile.stairsNetherBrick.name=Nether Brick Stairs +tile.netherStalk.name=Nether Wart +tile.cauldron.name=Cauldron +tile.enchantmentTable.name=Enchantment Table +tile.anvil.name=Anvil +tile.anvil.intact.name=Anvil +tile.anvil.slightlyDamaged.name=Slightly Damaged Anvil +tile.anvil.veryDamaged.name=Very Damaged Anvil +tile.whiteStone.name=End Stone +tile.endPortalFrame.name=End Portal +tile.mycel.name=Mycelium +tile.waterlily.name=Lily Pad +tile.dragonEgg.name=Dragon Egg +tile.redstoneLight.name=Redstone Lamp +tile.cocoa.name=Cocoa +tile.enderChest.name=Ender Chest +tile.oreRuby.name=Ruby Ore +tile.oreEmerald.name=Emerald Ore +tile.blockEmerald.name=Block of Emerald +tile.blockRedstone.name=Block of Redstone +tile.tripWire.name=Tripwire +tile.tripWireSource.name=Tripwire Hook +tile.commandBlock.name=Command Block +tile.beacon.name=Beacon +tile.beacon.primary=Primary Power +tile.beacon.secondary=Secondary Power +tile.cobbleWall.normal.name=Cobblestone Wall +tile.cobbleWall.mossy.name=Mossy Cobblestone Wall +tile.carrots.name=Carrots +tile.potatoes.name=Potatoes +tile.daylightDetector.name=Daylight Sensor +tile.netherquartz.name=Nether Quartz Ore +tile.hopper.name=Hopper +tile.quartzBlock.default.name=Block of Quartz +tile.quartzBlock.chiseled.name=Chiseled Quartz Block +tile.quartzBlock.lines.name=Pillar Quartz Block +tile.stairsQuartz.name=Quartz Stairs + +item.nameTag.name=Name Tag +item.leash.name=Lead +item.shovelIron.name=Iron Shovel +item.pickaxeIron.name=Iron Pickaxe +item.hatchetIron.name=Iron Axe +item.flintAndSteel.name=Flint and Steel +item.apple.name=Apple +item.cookie.name=Cookie +item.bow.name=Bow +item.arrow.name=Arrow +item.coal.name=Coal +item.charcoal.name=Charcoal +item.diamond.name=Diamond +item.emerald.name=Emerald +item.ingotIron.name=Iron Ingot +item.ingotGold.name=Gold Ingot +item.swordIron.name=Iron Sword +item.swordWood.name=Wooden Sword +item.shovelWood.name=Wooden Shovel +item.pickaxeWood.name=Wooden Pickaxe +item.hatchetWood.name=Wooden Axe +item.swordStone.name=Stone Sword +item.shovelStone.name=Stone Shovel +item.pickaxeStone.name=Stone Pickaxe +item.hatchetStone.name=Stone Axe +item.swordDiamond.name=Diamond Sword +item.shovelDiamond.name=Diamond Shovel +item.pickaxeDiamond.name=Diamond Pickaxe +item.hatchetDiamond.name=Diamond Axe +item.stick.name=Stick +item.bowl.name=Bowl +item.mushroomStew.name=Mushroom Stew +item.swordGold.name=Golden Sword +item.shovelGold.name=Golden Shovel +item.pickaxeGold.name=Golden Pickaxe +item.hatchetGold.name=Golden Axe +item.string.name=String +item.feather.name=Feather +item.sulphur.name=Gunpowder +item.hoeWood.name=Wooden Hoe +item.hoeStone.name=Stone Hoe +item.hoeIron.name=Iron Hoe +item.hoeDiamond.name=Diamond Hoe +item.hoeGold.name=Golden Hoe +item.seeds.name=Seeds +item.seeds_pumpkin.name=Pumpkin Seeds +item.seeds_melon.name=Melon Seeds +item.melon.name=Melon +item.wheat.name=Wheat +item.bread.name=Bread +item.helmetCloth.name=Leather Cap +item.chestplateCloth.name=Leather Tunic +item.leggingsCloth.name=Leather Pants +item.bootsCloth.name=Leather Boots +item.helmetChain.name=Chain Helmet +item.chestplateChain.name=Chain Chestplate +item.leggingsChain.name=Chain Leggings +item.bootsChain.name=Chain Boots +item.helmetIron.name=Iron Helmet +item.chestplateIron.name=Iron Chestplate +item.leggingsIron.name=Iron Leggings +item.bootsIron.name=Iron Boots +item.helmetDiamond.name=Diamond Helmet +item.chestplateDiamond.name=Diamond Chestplate +item.leggingsDiamond.name=Diamond Leggings +item.bootsDiamond.name=Diamond Boots +item.helmetGold.name=Golden Helmet +item.chestplateGold.name=Golden Chestplate +item.leggingsGold.name=Golden Leggings +item.bootsGold.name=Golden Boots +item.flint.name=Flint +item.porkchopRaw.name=Raw Porkchop +item.porkchopCooked.name=Cooked Porkchop +item.chickenRaw.name=Raw Chicken +item.chickenCooked.name=Cooked Chicken +item.beefRaw.name=Raw Beef +item.beefCooked.name=Steak +item.painting.name=Painting +item.frame.name=Item Frame +item.appleGold.name=Golden Apple +item.sign.name=Sign +item.doorWood.name=Wooden Door +item.bucket.name=Bucket +item.bucketWater.name=Water Bucket +item.bucketLava.name=Lava Bucket +item.minecart.name=Minecart +item.saddle.name=Saddle +item.doorIron.name=Iron Door +item.redstone.name=Redstone +item.snowball.name=Snowball +item.boat.name=Boat +item.leather.name=Leather +item.milk.name=Milk +item.brick.name=Brick +item.clay.name=Clay +item.reeds.name=Sugar Canes +item.paper.name=Paper +item.book.name=Book +item.slimeball.name=Slimeball +item.minecartChest.name=Minecart with Chest +item.minecartFurnace.name=Minecart with Furnace +item.minecartTnt.name=Minecart with TNT +item.minecartHopper.name=Minecart with Hopper +item.minecartCommandBlock.name=Minecart with Command Block +item.egg.name=Egg +item.compass.name=Compass +item.fishingRod.name=Fishing Rod +item.clock.name=Clock +item.yellowDust.name=Glowstone Dust +item.fish.cod.raw.name=Raw Fish +item.fish.salmon.raw.name=Raw Salmon +item.fish.pufferfish.raw.name=Pufferfish +item.fish.clownfish.raw.name=Clownfish +item.fish.cod.cooked.name=Cooked Fish +item.fish.salmon.cooked.name=Cooked Salmon +item.record.name=Music Disc +item.record.13.desc=C418 - 13 +item.record.cat.desc=C418 - cat +item.record.blocks.desc=C418 - blocks +item.record.chirp.desc=C418 - chirp +item.record.far.desc=C418 - far +item.record.mall.desc=C418 - mall +item.record.mellohi.desc=C418 - mellohi +item.record.stal.desc=C418 - stal +item.record.strad.desc=C418 - strad +item.record.ward.desc=C418 - ward +item.record.11.desc=C418 - 11 +item.record.wait.desc=C418 - wait +item.bone.name=Bone +item.dyePowder.black.name=Ink Sac +item.dyePowder.red.name=Rose Red +item.dyePowder.green.name=Cactus Green +item.dyePowder.brown.name=Cocoa Beans +item.dyePowder.blue.name=Lapis Lazuli +item.dyePowder.purple.name=Purple Dye +item.dyePowder.cyan.name=Cyan Dye +item.dyePowder.silver.name=Light Gray Dye +item.dyePowder.gray.name=Gray Dye +item.dyePowder.pink.name=Pink Dye +item.dyePowder.lime.name=Lime Dye +item.dyePowder.yellow.name=Dandelion Yellow +item.dyePowder.lightBlue.name=Light Blue Dye +item.dyePowder.magenta.name=Magenta Dye +item.dyePowder.orange.name=Orange Dye +item.dyePowder.white.name=Bone Meal +item.sugar.name=Sugar +item.cake.name=Cake +item.bed.name=Bed +item.diode.name=Redstone Repeater +item.comparator.name=Redstone Comparator +item.map.name=Map +item.leaves.name=Leaves +item.shears.name=Shears +item.rottenFlesh.name=Rotten Flesh +item.enderPearl.name=Ender Pearl +item.blazeRod.name=Blaze Rod +item.ghastTear.name=Ghast Tear +item.netherStalkSeeds.name=Nether Wart +item.potion.name=Potion +item.emptyPotion.name=Water Bottle +item.goldNugget.name=Gold Nugget +item.glassBottle.name=Glass Bottle +item.spiderEye.name=Spider Eye +item.fermentedSpiderEye.name=Fermented Spider Eye +item.blazePowder.name=Blaze Powder +item.magmaCream.name=Magma Cream +item.cauldron.name=Cauldron +item.brewingStand.name=Brewing Stand +item.eyeOfEnder.name=Eye of Ender +item.speckledMelon.name=Glistering Melon +item.monsterPlacer.name=Spawn +item.expBottle.name=Bottle o' Enchanting +item.fireball.name=Fire Charge +item.writingBook.name=Book and Quill +item.writtenBook.name=Written Book +item.ruby.name=Ruby +item.flowerPot.name=Flower Pot +item.emptyMap.name=Empty Map +item.carrots.name=Carrot +item.carrotGolden.name=Golden Carrot +item.potato.name=Potato +item.potatoBaked.name=Baked Potato +item.potatoPoisonous.name=Poisonous Potato +item.skull.skeleton.name=Skeleton Skull +item.skull.wither.name=Wither Skeleton Skull +item.skull.zombie.name=Zombie Head +item.skull.char.name=Head +item.skull.player.name=%s's Head +item.skull.creeper.name=Creeper Head +item.carrotOnAStick.name=Carrot on a Stick +item.netherStar.name=Nether Star +item.pumpkinPie.name=Pumpkin Pie +item.enchantedBook.name=Enchanted Book +item.fireworks.name=Firework Rocket +item.fireworks.flight=Flight Duration: +item.fireworksCharge.name=Firework Star +item.fireworksCharge.black=Black +item.fireworksCharge.red=Red +item.fireworksCharge.green=Green +item.fireworksCharge.brown=Brown +item.fireworksCharge.blue=Blue +item.fireworksCharge.purple=Purple +item.fireworksCharge.cyan=Cyan +item.fireworksCharge.silver=Light Gray +item.fireworksCharge.gray=Gray +item.fireworksCharge.pink=Pink +item.fireworksCharge.lime=Lime +item.fireworksCharge.yellow=Yellow +item.fireworksCharge.lightBlue=Light Blue +item.fireworksCharge.magenta=Magenta +item.fireworksCharge.orange=Orange +item.fireworksCharge.white=White +item.fireworksCharge.customColor=Custom +item.fireworksCharge.fadeTo=Fade to +item.fireworksCharge.flicker=Twinkle +item.fireworksCharge.trail=Trail +item.fireworksCharge.type.0=Small Ball +item.fireworksCharge.type.1=Large Ball +item.fireworksCharge.type.2=Star-shaped +item.fireworksCharge.type.3=Creeper-shaped +item.fireworksCharge.type.4=Burst +item.fireworksCharge.type=Unknown Shape +item.netherbrick.name=Nether Brick +item.netherquartz.name=Nether Quartz +item.horsearmormetal.name=Iron Horse Armor +item.horsearmorgold.name=Gold Horse Armor +item.horsearmordiamond.name=Diamond Horse Armor + +container.inventory=Inventory +container.hopper=Item Hopper +container.crafting=Crafting +container.dispenser=Dispenser +container.dropper=Dropper +container.furnace=Furnace +container.enchant=Enchant +container.repair=Repair & Name +container.repair.cost=Enchantment Cost: %1$d +container.repair.expensive=Too Expensive! +container.creative=Item Selection +container.brewing=Brewing Stand +container.chest=Chest +container.chestDouble=Large Chest +container.minecart=Minecart +container.enderchest=Ender Chest + +item.dyed=Dyed +item.unbreakable=Unbreakable + +entity.Item.name=Item +entity.XPOrb.name=Experience Orb +entity.SmallFireball.name=Small Fireball +entity.Fireball.name=Fireball + +entity.Arrow.name=Arrow +entity.Snowball.name=Snowball +entity.Painting.name=Painting + +entity.Mob.name=Mob +entity.Monster.name=Monster + +entity.Creeper.name=Creeper +entity.Skeleton.name=Skeleton +entity.Spider.name=Spider +entity.Giant.name=Giant +entity.Zombie.name=Zombie +entity.Slime.name=Slime +entity.Ghast.name=Ghast +entity.PigZombie.name=Zombie Pigman +entity.Enderman.name=Enderman +entity.Silverfish.name=Silverfish +entity.CaveSpider.name=Cave Spider +entity.Blaze.name=Blaze +entity.LavaSlime.name=Magma Cube +entity.MushroomCow.name=Mooshroom +entity.Villager.name=Villager +entity.VillagerGolem.name=Iron Golem +entity.SnowMan.name=Snow Golem +entity.EnderDragon.name=Ender Dragon +entity.WitherBoss.name=Wither +entity.Witch.name=Witch + +entity.Pig.name=Pig +entity.Sheep.name=Sheep +entity.Cow.name=Cow +entity.Chicken.name=Chicken +entity.Squid.name=Squid +entity.Wolf.name=Wolf +entity.Ozelot.name=Ocelot +entity.Cat.name=Cat +entity.Bat.name=Bat +entity.EntityHorse.name=Horse +entity.horse.name=Horse +entity.donkey.name=Donkey +entity.mule.name=Mule +entity.skeletonhorse.name=Skeleton Horse +entity.zombiehorse.name=Zombie Horse + +entity.PrimedTnt.name=Block of TNT +entity.FallingSand.name=Falling Block + +entity.Minecart.name=Minecart +entity.Boat.name=Boat + +entity.Arrow.name=arrow +entity.generic.name=unknown + +death.fell.accident.ladder=%1$s fell off a ladder +death.fell.accident.vines=%1$s fell off some vines +death.fell.accident.water=%1$s fell out of the water +death.fell.accident.generic=%1$s fell from a high place +death.fell.killer=%1$s was doomed to fall +death.fell.assist=%1$s was doomed to fall by %2$s +death.fell.assist.item=%1$s was doomed to fall by %2$s using %3$s +death.fell.finish=%1$s fell too far and was finished by %2$s +death.fell.finish.item=%1$s fell too far and was finished by %2$s using %3$s + +death.attack.inFire=%1$s went up in flames +death.attack.inFire.player=%1$s walked into fire whilst fighting %2$s +death.attack.onFire=%1$s burned to death +death.attack.onFire.player=%1$s was burnt to a crisp whilst fighting %2$s +death.attack.lava=%1$s tried to swim in lava +death.attack.lava.player=%1$s tried to swim in lava to escape %2$s +death.attack.inWall=%1$s suffocated in a wall +death.attack.drown=%1$s drowned +death.attack.drown.player=%1$s drowned whilst trying to escape %2$s +death.attack.starve=%1$s starved to death +death.attack.cactus=%1$s was pricked to death +death.attack.cactus.player=%1$s walked into a cactus whilst trying to escape %2$s +death.attack.generic=%1$s died +death.attack.explosion=%1$s blew up +death.attack.explosion.player=%1$s was blown up by %2$s +death.attack.magic=%1$s was killed by magic +death.attack.wither=%1$s withered away +death.attack.anvil=%1$s was squashed by a falling anvil +death.attack.fallingBlock=%1$s was squashed by a falling block +death.attack.mob=%1$s was slain by %2$s +death.attack.player=%1$s was slain by %2$s +death.attack.player.item=%1$s was slain by %2$s using %3$s +death.attack.arrow=%1$s was shot by %2$s +death.attack.arrow.item=%1$s was shot by %2$s using %3$s +death.attack.fireball=%1$s was fireballed by %2$s +death.attack.fireball.item=%1$s was fireballed by %2$s using %3$s +death.attack.thrown=%1$s was pummeled by %2$s +death.attack.thrown.item=%1$s was pummeled by %2$s using %3$s +death.attack.indirectMagic=%1$s was killed by %2$s using magic +death.attack.indirectMagic.item=%1$s was killed by %2$s using %3$s +death.attack.thorns=%1$s was killed trying to hurt %2$s +death.attack.fall=%1$s hit the ground too hard +death.attack.outOfWorld=%1$s fell out of the world + +deathScreen.respawn=Respawn +deathScreen.deleteWorld=Delete world +deathScreen.titleScreen=Title screen +deathScreen.score=Score +deathScreen.title.hardcore=Game over! +deathScreen.hardcoreInfo=You cannot respawn in hardcore mode! +deathScreen.title=You died! +deathScreen.leaveServer=Leave server +deathScreen.quit.confirm=Are you sure you want to quit? + +potion.effects.whenDrank=When Applied: +potion.empty=No Effects +potion.moveSpeed=Speed +potion.moveSlowdown=Slowness +potion.digSpeed=Haste +potion.digSlowDown=Mining Fatigue +potion.damageBoost=Strength +potion.weakness=Weakness +potion.heal=Instant Health +potion.harm=Instant Damage +potion.jump=Jump Boost +potion.confusion=Nausea +potion.regeneration=Regeneration +potion.resistance=Resistance +potion.fireResistance=Fire Resistance +potion.waterBreathing=Water Breathing +potion.invisibility=Invisibility +potion.blindness=Blindness +potion.nightVision=Night Vision +potion.hunger=Hunger +potion.poison=Poison +potion.wither=Wither +potion.healthBoost=Health Boost +potion.absorption=Absorption +potion.saturation=Saturation + +potion.moveSpeed.postfix=Potion of Swiftness +potion.moveSlowdown.postfix=Potion of Slowness +potion.digSpeed.postfix=Potion of Haste +potion.digSlowDown.postfix=Potion of Dullness +potion.damageBoost.postfix=Potion of Strength +potion.weakness.postfix=Potion of Weakness +potion.heal.postfix=Potion of Healing +potion.harm.postfix=Potion of Harming +potion.jump.postfix=Potion of Leaping +potion.confusion.postfix=Potion of Nausea +potion.regeneration.postfix=Potion of Regeneration +potion.resistance.postfix=Potion of Resistance +potion.fireResistance.postfix=Potion of Fire Resistance +potion.waterBreathing.postfix=Potion of Water Breathing +potion.invisibility.postfix=Potion of Invisibility +potion.blindness.postfix=Potion of Blindness +potion.nightVision.postfix=Potion of Night Vision +potion.hunger.postfix=Potion of Hunger +potion.poison.postfix=Potion of Poison +potion.wither.postfix=Potion of Decay +potion.healthBoost.postfix=Potion of Health Boost +potion.absorption.postfix=Potion of Absorption +potion.saturation.postfix=Potion of Saturation + +potion.potency.0= +potion.potency.1=II +potion.potency.2=III +potion.potency.3=IV + +potion.prefix.grenade=Splash +potion.prefix.mundane=Mundane +potion.prefix.uninteresting=Uninteresting +potion.prefix.bland=Bland +potion.prefix.clear=Clear +potion.prefix.milky=Milky +potion.prefix.diffuse=Diffuse +potion.prefix.artless=Artless +potion.prefix.thin=Thin +potion.prefix.awkward=Awkward +potion.prefix.flat=Flat +potion.prefix.bulky=Bulky +potion.prefix.bungling=Bungling +potion.prefix.buttered=Buttered +potion.prefix.smooth=Smooth +potion.prefix.suave=Suave +potion.prefix.debonair=Debonair +potion.prefix.thick=Thick +potion.prefix.elegant=Elegant +potion.prefix.fancy=Fancy +potion.prefix.charming=Charming +potion.prefix.dashing=Dashing +potion.prefix.refined=Refined +potion.prefix.cordial=Cordial +potion.prefix.sparkling=Sparkling +potion.prefix.potent=Potent +potion.prefix.foul=Foul +potion.prefix.odorless=Odorless +potion.prefix.rank=Rank +potion.prefix.harsh=Harsh +potion.prefix.acrid=Acrid +potion.prefix.gross=Gross +potion.prefix.stinky=Stinky + +enchantment.damage.all=Sharpness +enchantment.damage.undead=Smite +enchantment.damage.arthropods=Bane of Arthropods +enchantment.knockback=Knockback +enchantment.fire=Fire Aspect +enchantment.protect.all=Protection +enchantment.protect.fire=Fire Protection +enchantment.protect.fall=Feather Falling +enchantment.protect.explosion=Blast Protection +enchantment.protect.projectile=Projectile Protection +enchantment.oxygen=Respiration +enchantment.waterWorker=Aqua Affinity +enchantment.digging=Efficiency +enchantment.untouching=Silk Touch +enchantment.durability=Unbreaking +enchantment.lootBonus=Looting +enchantment.lootBonusDigger=Fortune +enchantment.lootBonusFishing=Luck of the Sea +enchantment.fishingSpeed=Lure +enchantment.arrowDamage=Power +enchantment.arrowFire=Flame +enchantment.arrowKnockback=Punch +enchantment.arrowInfinite=Infinity +enchantment.thorns=Thorns + +enchantment.level.1=I +enchantment.level.2=II +enchantment.level.3=III +enchantment.level.4=IV +enchantment.level.5=V +enchantment.level.6=VI +enchantment.level.7=VII +enchantment.level.8=VIII +enchantment.level.9=IX +enchantment.level.10=X + +gui.achievements=Achievements +gui.stats=Statistics + +stats.tooltip.type.achievement=Achievement +stats.tooltip.type.statistic=Statistic +stat.generalButton=General +stat.blocksButton=Blocks +stat.itemsButton=Items +stat.mobsButton=Mobs + +stat.used=Times Used +stat.mined=Times Mined +stat.depleted=Times Depleted +stat.crafted=Times Crafted +stat.entityKills=You killed %d %s +stat.entityKilledBy=%s killed you %d time(s) +stat.entityKills.none=You have never killed %s +stat.entityKilledBy.none=You have never been killed by %s + +stat.startGame=Times played +stat.createWorld=Worlds created +stat.loadWorld=Saves loaded +stat.joinMultiplayer=Multiplayer joins +stat.leaveGame=Games quit + +stat.playOneMinute=Minutes Played + +stat.walkOneCm=Distance Walked +stat.fallOneCm=Distance Fallen +stat.swimOneCm=Distance Swum +stat.flyOneCm=Distance Flown +stat.climbOneCm=Distance Climbed +stat.diveOneCm=Distance Dove +stat.minecartOneCm=Distance by Minecart +stat.boatOneCm=Distance by Boat +stat.pigOneCm=Distance by Pig +stat.horseOneCm=Distance by Horse +stat.jump=Jumps +stat.drop=Items Dropped + +stat.damageDealt=Damage Dealt +stat.damageTaken=Damage Taken +stat.deaths=Number of Deaths +stat.mobKills=Mob Kills +stat.animalsBred=Animals Bred +stat.playerKills=Player Kills +stat.fishCaught=Fish Caught +stat.treasureFished=Treasure Fished +stat.junkFished=Junk Fished + +stat.mineBlock=%1$s Mined +stat.craftItem=%1$s Crafted +stat.useItem=%1$s Used +stat.breakItem=%1$s Depleted + +achievement.get=Achievement get! + +achievement.taken=Taken! +achievement.unknown=??? + +achievement.requires=Requires '%1$s' +achievement.openInventory=Taking Inventory +achievement.openInventory.desc=Press '%1$s' to open your inventory. +achievement.mineWood=Getting Wood +achievement.mineWood.desc=Attack a tree until a block of wood pops out +achievement.buildWorkBench=Benchmarking +achievement.buildWorkBench.desc=Craft a workbench with four blocks of planks +achievement.buildPickaxe=Time to Mine! +achievement.buildPickaxe.desc=Use planks and sticks to make a pickaxe +achievement.buildFurnace=Hot Topic +achievement.buildFurnace.desc=Construct a furnace out of eight stone blocks +achievement.acquireIron=Acquire Hardware +achievement.acquireIron.desc=Smelt an iron ingot +achievement.buildHoe=Time to Farm! +achievement.buildHoe.desc=Use planks and sticks to make a hoe +achievement.makeBread=Bake Bread +achievement.makeBread.desc=Turn wheat into bread +achievement.bakeCake=The Lie +achievement.bakeCake.desc=Wheat, sugar, milk and eggs! +achievement.buildBetterPickaxe=Getting an Upgrade +achievement.buildBetterPickaxe.desc=Construct a better pickaxe +achievement.cookFish=Delicious Fish +achievement.cookFish.desc=Catch and cook fish! +achievement.onARail=On A Rail +achievement.onARail.desc=Travel by minecart at least 1 km from where you started +achievement.buildSword=Time to Strike! +achievement.buildSword.desc=Use planks and sticks to make a sword +achievement.killEnemy=Monster Hunter +achievement.killEnemy.desc=Attack and destroy a monster +achievement.killCow=Cow Tipper +achievement.killCow.desc=Harvest some leather +achievement.breedCow=Repopulation +achievement.breedCow.desc=Breed two cows with wheat +achievement.flyPig=When Pigs Fly +achievement.flyPig.desc=Fly a pig off a cliff +achievement.snipeSkeleton=Sniper Duel +achievement.snipeSkeleton.desc=Kill a skeleton with an arrow from more than 50 meters +achievement.diamonds=DIAMONDS! +achievement.diamonds.desc=Acquire diamonds with your iron tools +achievement.diamondsToYou=Diamonds to you! +achievement.diamondsToYou.desc=Throw diamonds at another player. +achievement.portal=We Need to Go Deeper +achievement.portal.desc=Build a portal to the Nether +achievement.ghast=Return to Sender +achievement.ghast.desc=Destroy a Ghast with a fireball +achievement.blazeRod=Into Fire +achievement.blazeRod.desc=Relieve a Blaze of its rod +achievement.potion=Local Brewery +achievement.potion.desc=Brew a potion +achievement.theEnd=The End? +achievement.theEnd.desc=Locate the End +achievement.theEnd2=The End. +achievement.theEnd2.desc=Defeat the Ender Dragon +achievement.spawnWither=The Beginning? +achievement.spawnWither.desc=Spawn the Wither +achievement.killWither=The Beginning. +achievement.killWither.desc=Kill the Wither +achievement.fullBeacon=Beaconator +achievement.fullBeacon.desc=Create a full beacon +achievement.exploreAllBiomes=Adventuring Time +achievement.exploreAllBiomes.desc=Discover all biomes +achievement.enchantments=Enchanter +achievement.enchantments.desc=Use a book, obsidian and diamonds to construct an enchantment table +achievement.overkill=Overkill +achievement.overkill.desc=Deal eight hearts of damage in a single hit +achievement.bookcase=Librarian +achievement.bookcase.desc=Build some bookshelves to improve your enchantment table + +commands.generic.exception=An unknown error occurred while attempting to perform this command +commands.generic.permission=You do not have permission to use this command +commands.generic.syntax=Invalid command syntax +commands.generic.player.notFound=That player cannot be found +commands.generic.notFound=Unknown command. Try /help for a list of commands +commands.generic.num.invalid='%s' is not a valid number +commands.generic.boolean.invalid='%s' is not true or false +commands.generic.num.tooSmall=The number you have entered (%d) is too small, it must be at least %d +commands.generic.num.tooBig=The number you have entered (%d) is too big, it must be at most %d +commands.generic.double.tooSmall=The number you have entered (%.2f) is too small, it must be at least %.2f +commands.generic.double.tooBig=The number you have entered (%.2f) is too big, it must be at most %.2f +commands.generic.usage=Usage: %s +commands.generic.deprecatedId=Warning: Using numeric IDs will not be supported in the future. Please use names, such as '%s' + +commands.setidletimeout.usage=/setidletimeout +commands.setidletimeout.success=Successfully set the idle timeout to %d minutes. +commands.xp.failure.widthdrawXp=Cannot give player negative experience points +commands.xp.success=Given %d experience to %s +commands.xp.success.levels=Given %d levels to %s +commands.xp.success.negative.levels=Taken %d levels from %s +commands.xp.usage=/xp [player] OR /xp L [player] +commands.playsound.usage=/playsound [x] [y] [z] [volume] [pitch] [minimumVolume] +commands.playsound.success=Played sound '%s' to %s +commands.playsound.playerTooFar=Player %s is too far away to hear the sound +commands.give.usage=/give [amount] [data] [dataTag] +commands.give.notFound=There is no such item with ID %d +commands.give.success=Given %s * %d to %s +commands.give.tagError=Data tag parsing failed: %s +commands.summon.usage=/summon [x] [y] [z] [dataTag] +commands.summon.success=Object successfully summoned +commands.summon.failed=Unable to summon object +commands.summon.tagError=Data tag parsing failed: %s +commands.summon.outOfWorld=Cannot summon the object out of the world +commands.testforblock.usage=/testforblock [dataValue] [dataTag] +commands.testforblock.failed.tile=The block at %d,%d,%d is %s (expected: %s). +commands.testforblock.failed.data=The block at %d,%d,%d had the data value of %s (expected: %s). +commands.testforblock.failed.nbt=The block at %d,%d,%d did not have the required NBT keys. +commands.testforblock.failed.tileEntity=The block at %d,%d,%d is not a tile entity and cannot support tag matching. +commands.testforblock.success=Successfully found the block at %d,%d,%d. +commands.testforblock.outOfWorld=Cannot test for block outside of the world +commands.setblock.usage=/setblock [dataValue] [oldBlockHandling] [dataTag] +commands.setblock.success=Block placed +commands.setblock.failed=Unable to place block +commands.setblock.tagError=Data tag parsing failed: %s +commands.setblock.outOfWorld=Cannot place block outside of the world +commands.setblock.notFound=There is no such block with ID/name %s +commands.setblock.noChange=The block couldn't be placed +commands.effect.usage=/effect [seconds] [amplifier] +commands.effect.notFound=There is no such mob effect with ID %d +commands.effect.success=Given %1$s (ID %2$d) * %3$d to %4$s for %5$d seconds +commands.effect.success.removed=Took %1$s from %2$s +commands.effect.success.removed.all=Took all effects from %s +commands.effect.failure.notActive=Couldn't take %1$s from %2$s as they do not have the effect +commands.effect.failure.notActive.all=Couldn't take any effects from %s as they do not have any +commands.enchant.usage=/enchant [level] +commands.enchant.notFound=There is no such enchantment with ID %d +commands.enchant.noItem=The target doesn't hold an item +commands.enchant.cantEnchant=The selected enchantment can't be added to the target item +commands.enchant.cantCombine=%1$s can't be combined with %2$s +commands.enchant.success=Enchanting succeeded +commands.clear.usage=/clear [item] [data] +commands.clear.success=Cleared the inventory of %s, removing %d items +commands.clear.failure=Could not clear the inventory of %s, no items to remove +commands.downfall.usage=/toggledownfall +commands.downfall.success=Toggled downfall +commands.time.usage=/time +commands.time.added=Added %d to the time +commands.time.set=Set the time to %d +commands.players.usage=/list +commands.players.list=There are %d/%d players online: +commands.banlist.ips=There are %d total banned IP addresses: +commands.banlist.players=There are %d total banned players: +commands.banlist.usage=/banlist [ips|players] +commands.kill.usage=/kill +commands.kill.success=Ouch! That looked like it hurt +commands.kick.success=Kicked %s from the game +commands.kick.success.reason=Kicked %s from the game: '%s' +commands.kick.usage=/kick [reason ...] +commands.op.success=Opped %s +commands.op.failed=Could not op %s +commands.op.usage=/op +commands.deop.success=De-opped %s +commands.deop.failed=Could not de-op %s +commands.deop.usage=/deop +commands.say.usage=/say +commands.ban.success=Banned player %s +commands.ban.failed=Could not ban player %s +commands.ban.usage=/ban [reason ...] +commands.unban.success=Unbanned player %s +commands.unban.failed=Could not unban player %s +commands.unban.usage=/pardon +commands.banip.invalid=You have entered an invalid IP address or a player that is not online +commands.banip.success=Banned IP address %s +commands.banip.success.players=Banned IP address %s belonging to %s +commands.banip.usage=/ban-ip [reason ...] +commands.unbanip.invalid=You have entered an invalid IP address +commands.unbanip.success=Unbanned IP address %s +commands.unbanip.usage=/pardon-ip
+commands.save.usage=/save-all +commands.save-on.alreadyOn=Saving is already turned on. +commands.save-on.usage=/save-on +commands.save-off.alreadyOff=Saving is already turned off. +commands.save-off.usage=/save-off +commands.save.enabled=Turned on world auto-saving +commands.save.disabled=Turned off world auto-saving +commands.save.start=Saving... +commands.save.success=Saved the world +commands.save.failed=Saving failed: %s +commands.stop.usage=/stop +commands.stop.start=Stopping the server +commands.tp.success=Teleported %s to %s +commands.tp.success.coordinates=Teleported %s to %.2f,%.2f,%.2f +commands.tp.usage=/tp [target player] OR /tp [target player] +commands.tp.notSameDimension=Unable to teleport because players are not in the same dimension +commands.whitelist.list=There are %d (out of %d seen) whitelisted players: +commands.whitelist.enabled=Turned on the whitelist +commands.whitelist.disabled=Turned off the whitelist +commands.whitelist.reloaded=Reloaded the whitelist +commands.whitelist.add.success=Added %s to the whitelist +commands.whitelist.add.failed=Could not add %s to the whitelist +commands.whitelist.add.usage=/whitelist add +commands.whitelist.remove.success=Removed %s from the whitelist +commands.whitelist.remove.failed=Could not remove %s from the whitelist +commands.whitelist.remove.usage=/whitelist remove +commands.whitelist.usage=/whitelist +commands.scoreboard.usage=/scoreboard +commands.scoreboard.teamNotFound=No team was found by the name '%s' +commands.scoreboard.objectiveNotFound=No objective was found by the name '%s' +commands.scoreboard.objectiveReadOnly=The objective '%s' is read-only and cannot be set +commands.scoreboard.objectives.usage=/scoreboard objectives +commands.scoreboard.objectives.setdisplay.usage=/scoreboard objectives setdisplay [objective] +commands.scoreboard.objectives.setdisplay.invalidSlot=No such display slot '%s' +commands.scoreboard.objectives.setdisplay.successCleared=Cleared objective display slot '%s' +commands.scoreboard.objectives.setdisplay.successSet=Set the display objective in slot '%s' to '%s' +commands.scoreboard.objectives.add.usage=/scoreboard objectives add [display name ...] +commands.scoreboard.objectives.add.wrongType=Invalid objective criteria type '%s' +commands.scoreboard.objectives.add.alreadyExists=An objective with the name '%s' already exists +commands.scoreboard.objectives.add.tooLong=The name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.displayTooLong=The display name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.success=Added new objective '%s' successfully +commands.scoreboard.objectives.remove.usage=/scoreboard objectives remove +commands.scoreboard.objectives.remove.success=Removed objective '%s' successfully +commands.scoreboard.objectives.list.count=Showing %d objective(s) on scoreboard: +commands.scoreboard.objectives.list.entry=- %s: displays as '%s' and is type '%s' +commands.scoreboard.objectives.list.empty=There are no objectives on the scoreboard +commands.scoreboard.players.usage=/scoreboard players +commands.scoreboard.players.set.success=Set score of %s for player %s to %d +commands.scoreboard.players.set.usage=/scoreboard players set +commands.scoreboard.players.add.usage=/scoreboard players add +commands.scoreboard.players.remove.usage=/scoreboard players remove +commands.scoreboard.players.reset.usage=/scoreboard players reset +commands.scoreboard.players.reset.success=Reset all scores of player %s +commands.scoreboard.players.list.usage=/scoreboard players list [name] +commands.scoreboard.players.list.count=Showing %d tracked players on the scoreboard: +commands.scoreboard.players.list.empty=There are no tracked players on the scoreboard +commands.scoreboard.players.list.player.count=Showing %d tracked objective(s) for %s: +commands.scoreboard.players.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.players.list.player.empty=Player %s has no scores recorded +commands.scoreboard.teams.usage=/scoreboard teams +commands.scoreboard.teams.add.usage=/scoreboard teams add [display name ...] +commands.scoreboard.teams.add.alreadyExists=A team with the name '%s' already exists +commands.scoreboard.teams.add.tooLong=The name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.displayTooLong=The display name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.success=Added new team '%s' successfully +commands.scoreboard.teams.list.usage=/scoreboard teams list [name] +commands.scoreboard.teams.list.count=Showing %d teams on the scoreboard: +commands.scoreboard.teams.list.entry=- %1$s: '%2$s' has %3$d players +commands.scoreboard.teams.list.empty=There are no teams registered on the scoreboard +commands.scoreboard.teams.list.player.count=Showing %d player(s) in team %s: +commands.scoreboard.teams.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.teams.list.player.empty=Team %s has no players +commands.scoreboard.teams.empty.usage=/scoreboard teams empty +commands.scoreboard.teams.empty.alreadyEmpty=Team %s is already empty, cannot remove nonexistant players +commands.scoreboard.teams.empty.success=Removed all %d player(s) from team %s +commands.scoreboard.teams.remove.usage=/scoreboard teams remove +commands.scoreboard.teams.remove.success=Removed team %s +commands.scoreboard.teams.join.usage=/scoreboard teams join [player] +commands.scoreboard.teams.join.success=Added %d player(s) to team %s: %s +commands.scoreboard.teams.join.failure=Could not add %d player(s) to team %s: %s +commands.scoreboard.teams.leave.usage=/scoreboard teams leave [player] +commands.scoreboard.teams.leave.success=Removed %d player(s) from their teams: %s +commands.scoreboard.teams.leave.failure=Could not remove %d player(s) from their teams: %s +commands.scoreboard.teams.leave.noTeam=You are not in a team +commands.scoreboard.teams.option.usage=/scoreboard teams option +commands.scoreboard.teams.option.noValue=Valid values for option %s are: %s +commands.scoreboard.teams.option.success=Set option %s for team %s to %s +commands.gamemode.success.self=Set own game mode to %s +commands.gamemode.success.other=Set %s's game mode to %s +commands.gamemode.usage=/gamemode [player] +commands.defaultgamemode.usage=/defaultgamemode +commands.defaultgamemode.success=The world's default game mode is now %s +commands.me.usage=/me +commands.help.header=--- Showing help page %d of %d (/help ) --- +commands.help.footer=Tip: Use the key while typing a command to auto-complete the command or its arguments +commands.help.usage=/help [page|command name] +commands.publish.usage=/publish +commands.publish.started=Local game hosted on port %s +commands.publish.failed=Unable to host local game +commands.debug.start=Started debug profiling +commands.debug.stop=Stopped debug profiling after %.2f seconds (%d ticks) +commands.debug.notStarted=Can't stop profiling when we haven't started yet! +commands.debug.usage=/debug +commands.tellraw.usage=/tellraw +commands.tellraw.jsonException=Invalid json: %s +commands.message.usage=/tell +commands.message.sameTarget=You can't send a private message to yourself! +commands.message.display.outgoing=You whisper to %s: %s +commands.message.display.incoming=%s whispers to you: %s +commands.difficulty.usage=/difficulty +commands.difficulty.success=Set game difficulty to %s +commands.spawnpoint.usage=/spawnpoint OR /spawnpoint OR /spawnpoint +commands.spawnpoint.success=Set %s's spawn point to (%d, %d, %d) +commands.setworldspawn.usage=/setworldspawn OR /setworldspawn +commands.setworldspawn.success=Set the world spawn point to (%d, %d, %d) +commands.gamerule.usage=/gamerule OR /gamerule +commands.gamerule.success=Game rule has been updated +commands.gamerule.norule=No game rule called '%s' is available +commands.weather.usage=/weather [duration in seconds] +commands.weather.clear=Changing to clear weather +commands.weather.rain=Changing to rainy weather +commands.weather.thunder=Changing to rain and thunder +commands.testfor.usage=/testfor +commands.testfor.failed=/testfor is only usable by commandblocks with analog output +commands.seed.usage=/seed +commands.seed.success=Seed: %s +commands.spreadplayers.usage=/spreadplayers +commands.spreadplayers.spreading.teams=Spreading %s teams %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.spreading.players=Spreading %s players %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.success.teams=Successfully spread %s teams around %s,%s +commands.spreadplayers.success.players=Successfully spread %s players around %s,%s +commands.spreadplayers.info.teams=(Average distance between teams is %s blocks apart after %s iterations) +commands.spreadplayers.info.players=(Average distance between players is %s blocks apart after %s iterations) +commands.spreadplayers.failure.teams=Could not spread %s teams around %s,%s (too many players for space - try using spread of at most %s) +commands.spreadplayers.failure.players=Could not spread %s players around %s,%s (too many players for space - try using spread of at most %s) +commands.achievement.usage=/achievement give [player] +commands.achievement.unknownAchievement=Unknown achievement or statistic '%s' +commands.achievement.give.success.all=Successfully given all achievements to %s +commands.achievement.give.success.one=Successfully given %s the stat %s +commands.achievement.statTooLow=Player %s does not have the stat %s + +itemGroup.buildingBlocks=Building Blocks +itemGroup.decorations=Decoration Blocks +itemGroup.redstone=Redstone +itemGroup.transportation=Transportation +itemGroup.misc=Miscellaneous +itemGroup.search=Search Items +itemGroup.food=Foodstuffs +itemGroup.tools=Tools +itemGroup.combat=Combat +itemGroup.brewing=Brewing +itemGroup.materials=Materials +itemGroup.inventory=Survival Inventory + +inventory.binSlot=Destroy Item + +advMode.setCommand=Set Console Command for Block +advMode.setCommand.success=Command set: %s +advMode.command=Console Command +advMode.nearestPlayer=Use "@p" to target nearest player +advMode.randomPlayer=Use "@r" to target random player +advMode.allPlayers=Use "@a" to target all players +advMode.previousOutput=Previous Output + +advMode.notEnabled=Command blocks are not enabled on this server +advMode.notAllowed=Must be an opped player in creative mode + +mount.onboard=Press %1$s to dismount + +build.tooHigh=Height limit for building is %s blocks + +attribute.modifier.plus.0=+%d %s +attribute.modifier.plus.1=+%d%% %s +attribute.modifier.plus.2=+%d%% %s +attribute.modifier.take.0=-%d %s +attribute.modifier.take.1=-%d%% %s +attribute.modifier.take.2=-%d%% %s + +attribute.name.horse.jumpStrength=Horse Jump Strength +attribute.name.zombie.spawnReinforcements=Zombie Reinforcements +attribute.name.generic.maxHealth=Max Health +attribute.name.generic.followRange=Mob Follow Range +attribute.name.generic.knockbackResistance=Knockback Resistance +attribute.name.generic.movementSpeed=Speed +attribute.name.generic.attackDamage=Attack Damage + +screenshot.success=Saved screenshot as %s +screenshot.failure=Couldn't save screenshot: %s + +stream.user.mode.moderator=Moderator +stream.user.mode.moderator.self=Moderator on your channel +stream.user.mode.moderator.other=Moderator on %s's channel +stream.user.mode.broadcaster=Broadcaster +stream.user.mode.broadcaster.self=Broadcaster (You!) +stream.user.mode.broadcaster.other=Broadcaster +stream.user.mode.administrator=Twitch Administrator +stream.user.mode.staff=Twitch Staff +stream.user.mode.banned=Banned +stream.user.mode.banned.self=Banned on your channel +stream.user.mode.banned.other=Banned on %s's channel +stream.user.subscription.subscriber=Subscriber +stream.user.subscription.subscriber.self=Subscriber to your channel +stream.user.subscription.subscriber.other=Subscriber to %s's channel +stream.user.subscription.turbo=Twitch Turbo + +stream.unavailable.title=Twitch Broadcasting Unavailable +stream.unavailable.report_to_mojang=Report to Mojang + +stream.confirm_start=Are you sure you want to start broadcasting? + +stream.unavailable.account_not_bound=Before you can broadcast Minecraft through Twitch, you will need to link your Twitch account on mojang.com. Would you like to do that now? +stream.unavailable.account_not_bound.okay=Link Accounts +stream.unavailable.account_not_migrated=Before you can broadcast Minecraft through Twitch, you will need to migrate your Minecraft account to a Mojang account. Would you like to do that now? +stream.unavailable.account_not_migrated.okay=Migrate Account +stream.unavailable.failed_auth=Authentication to Twitch failed. Please go to mojang.com and rebind your Twitch account. +stream.unavailable.failed_auth.okay=Rebind Accounts +stream.unavailable.failed_auth_error=Unable to authenticate to Twitch. Please try again later. +stream.unavailable.initialization_failure=Unable to initialize the Twitch SDK. +stream.unavailable.initialization_failure.extra=(Reason: %s) +stream.unavailable.library_arch_mismatch=The custom java version used to launch Minecraft has a different architecture than the one used to run the launcher. Please make sure these are the same, either 32-bit or 64-bit for both. +stream.unavailable.library_failure=Unable to load the libraries needed for the integrated Twitch broadcasting service. +stream.unavailable.no_fbo=Your video card needs to support at least OpenGL version 3.0 or support Framebuffer Objects via an extension to use the integrated Twitch broadcasting. +stream.unavailable.no_fbo.version=You are currently using: %s +stream.unavailable.no_fbo.blend=Separate blending support via EXT is: %s +stream.unavailable.no_fbo.arb=Framebuffer object support via ARB is: %s +stream.unavailable.no_fbo.ext=Framebuffer object support via EXT is: %s +stream.unavailable.not_supported.windows=Unfortunately the integrated Twitch broadcasting requires a newer version of Windows than you are on. You must have at least Windows Vista or newer. +stream.unavailable.not_supported.mac=Unfortunately the integrated Twitch broadcasting on Mac requires a version of OSX newer than the one you are on. You must use 10.7 (Mac OS X Lion) or newer to be able to use this service. Would you like to visit apple.com to learn about upgrading? +stream.unavailable.not_supported.mac.okay=Upgrade +stream.unavailable.not_supported.other=Unfortunately the integrated Twitch broadcasting service requires Windows (Vista or newer) or Mac OS X (10.7/Lion or newer) +stream.unavailable.unknown=Unfortunately you cannot broadcast to Twitch at this time. And we don't know why :'( +stream.unavailable.unknown.chat=Could not start stream: %s + +stream.unavailable.soundflower.chat=Soundflower is required to be able to stream on Mac. %s +stream.unavailable.soundflower.chat.link=Please click here to install it. + +stream.userinfo.chatTooltip=Click to manage user +stream.userinfo.timeout=Timeout +stream.userinfo.ban=Ban +stream.userinfo.unban=Unban +stream.userinfo.mod=Promote to Moderator +stream.userinfo.unmod=Demote from Moderator \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0.png new file mode 100644 index 0000000..acadb01 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/0.png new file mode 100644 index 0000000..482314c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/1.png new file mode 100644 index 0000000..e2a575c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/10.png new file mode 100644 index 0000000..aa7bea6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/11.png new file mode 100644 index 0000000..74f57a3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/16.png new file mode 100644 index 0000000..d8bf7d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/17.png new file mode 100644 index 0000000..0f82cfc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/18.png new file mode 100644 index 0000000..19290f4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/19.png new file mode 100644 index 0000000..ed7f623 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/2.png new file mode 100644 index 0000000..fb205fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/20.png new file mode 100644 index 0000000..4ddd184 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/21.png new file mode 100644 index 0000000..c033321 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/22.png new file mode 100644 index 0000000..551d863 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/23.png new file mode 100644 index 0000000..b51bed4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/24.png new file mode 100644 index 0000000..52ee206 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/25.png new file mode 100644 index 0000000..cc5fd49 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/26.png new file mode 100644 index 0000000..443b5b9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/27.png new file mode 100644 index 0000000..b7e1e8b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/3.png new file mode 100644 index 0000000..ab11024 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/32.png new file mode 100644 index 0000000..8a89dbb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/33.png new file mode 100644 index 0000000..f426e72 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/34.png new file mode 100644 index 0000000..8d51784 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/35.png new file mode 100644 index 0000000..201decc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/36.png new file mode 100644 index 0000000..97341db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/37.png new file mode 100644 index 0000000..0c091e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/38.png new file mode 100644 index 0000000..19589ae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/39.png new file mode 100644 index 0000000..3f24f73 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/4.png new file mode 100644 index 0000000..89313f3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/40.png new file mode 100644 index 0000000..684b05b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/41.png new file mode 100644 index 0000000..68935ec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/42.png new file mode 100644 index 0000000..02146e6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/43.png new file mode 100644 index 0000000..eb033a0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/48.png new file mode 100644 index 0000000..b9f9e15 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/49.png new file mode 100644 index 0000000..d8d43f3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/5.png new file mode 100644 index 0000000..dc8a5a2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/50.png new file mode 100644 index 0000000..34dfd51 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/51.png new file mode 100644 index 0000000..adce730 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/52.png new file mode 100644 index 0000000..b2642ee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/53.png new file mode 100644 index 0000000..b986b35 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/54.png new file mode 100644 index 0000000..51d3ace Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/55.png new file mode 100644 index 0000000..44c38f8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/56.png new file mode 100644 index 0000000..8323d93 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/57.png new file mode 100644 index 0000000..5a8a105 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/58.png new file mode 100644 index 0000000..8581ae8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/6.png new file mode 100644 index 0000000..80d0dba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/7.png new file mode 100644 index 0000000..128f2ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/8.png new file mode 100644 index 0000000..05db2b1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/9.png new file mode 100644 index 0000000..9f12d4f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_pane_white.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_pane_white.properties new file mode 100644 index 0000000..3e0b141 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_pane_white.properties @@ -0,0 +1,6 @@ +# Stained glass white +matchBlocks=160 +metadata=0 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_white.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_white.properties new file mode 100644 index 0000000..d762a6d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/0_glass_white/glass_white.properties @@ -0,0 +1,6 @@ +# Stained glass white +matchBlocks=95 +metadata=0 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1.png new file mode 100644 index 0000000..291d775 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10.png new file mode 100644 index 0000000..602786b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/0.png new file mode 100644 index 0000000..fcae3d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/1.png new file mode 100644 index 0000000..c6388c7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/10.png new file mode 100644 index 0000000..025cc5d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/11.png new file mode 100644 index 0000000..63222ea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/16.png new file mode 100644 index 0000000..71a93f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/17.png new file mode 100644 index 0000000..453b868 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/18.png new file mode 100644 index 0000000..c88f7b7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/19.png new file mode 100644 index 0000000..41de663 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/2.png new file mode 100644 index 0000000..3f58b21 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/20.png new file mode 100644 index 0000000..52c0ada Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/21.png new file mode 100644 index 0000000..623d894 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/22.png new file mode 100644 index 0000000..2b1cbaa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/23.png new file mode 100644 index 0000000..9cffa1b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/24.png new file mode 100644 index 0000000..bc6aa71 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/25.png new file mode 100644 index 0000000..eaef4e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/26.png new file mode 100644 index 0000000..f4633b2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/27.png new file mode 100644 index 0000000..85f4fea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/3.png new file mode 100644 index 0000000..6a12c18 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/32.png new file mode 100644 index 0000000..6161cf2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/33.png new file mode 100644 index 0000000..e17b7b3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/34.png new file mode 100644 index 0000000..99d1a53 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/35.png new file mode 100644 index 0000000..3543bc4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/36.png new file mode 100644 index 0000000..35986d9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/37.png new file mode 100644 index 0000000..f328c50 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/38.png new file mode 100644 index 0000000..219ab34 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/39.png new file mode 100644 index 0000000..5b7580a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/4.png new file mode 100644 index 0000000..4e202ca Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/40.png new file mode 100644 index 0000000..811321b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/41.png new file mode 100644 index 0000000..6f0e33f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/42.png new file mode 100644 index 0000000..1f6854a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/43.png new file mode 100644 index 0000000..f0a1fcc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/48.png new file mode 100644 index 0000000..9561168 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/49.png new file mode 100644 index 0000000..a32e9ae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/5.png new file mode 100644 index 0000000..35ae121 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/50.png new file mode 100644 index 0000000..532325c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/51.png new file mode 100644 index 0000000..f900cfa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/52.png new file mode 100644 index 0000000..b0de565 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/53.png new file mode 100644 index 0000000..3764a55 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/54.png new file mode 100644 index 0000000..5ab97a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/55.png new file mode 100644 index 0000000..ba3bc7c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/56.png new file mode 100644 index 0000000..5500739 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/57.png new file mode 100644 index 0000000..ff82291 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/58.png new file mode 100644 index 0000000..e8389d7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/6.png new file mode 100644 index 0000000..b81516b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/7.png new file mode 100644 index 0000000..0efca44 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/8.png new file mode 100644 index 0000000..fa3ab6b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/9.png new file mode 100644 index 0000000..b2d3050 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_pane_purple.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_pane_purple.properties new file mode 100644 index 0000000..58ff933 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_pane_purple.properties @@ -0,0 +1,6 @@ +# Stained glass purple +matchBlocks=160 +metadata=10 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_purple.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_purple.properties new file mode 100644 index 0000000..27d4480 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/10_glass_purple/glass_purple.properties @@ -0,0 +1,6 @@ +# Stained glass purple +matchBlocks=95 +metadata=10 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11.png new file mode 100644 index 0000000..a179881 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/0.png new file mode 100644 index 0000000..38885de Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/1.png new file mode 100644 index 0000000..78b8685 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/10.png new file mode 100644 index 0000000..f111abb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/11.png new file mode 100644 index 0000000..1682741 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/16.png new file mode 100644 index 0000000..b69e09e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/17.png new file mode 100644 index 0000000..696d771 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/18.png new file mode 100644 index 0000000..39676be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/19.png new file mode 100644 index 0000000..dfa2b62 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/2.png new file mode 100644 index 0000000..85232a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/20.png new file mode 100644 index 0000000..4ffc019 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/21.png new file mode 100644 index 0000000..58eb303 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/22.png new file mode 100644 index 0000000..5f88c04 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/23.png new file mode 100644 index 0000000..c52be72 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/24.png new file mode 100644 index 0000000..c60f717 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/25.png new file mode 100644 index 0000000..1f2b02c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/26.png new file mode 100644 index 0000000..e67b915 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/27.png new file mode 100644 index 0000000..e496c97 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/3.png new file mode 100644 index 0000000..274c3d4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/32.png new file mode 100644 index 0000000..28aef71 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/33.png new file mode 100644 index 0000000..aa469a2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/34.png new file mode 100644 index 0000000..b9e05b2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/35.png new file mode 100644 index 0000000..2e81675 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/36.png new file mode 100644 index 0000000..95efd6a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/37.png new file mode 100644 index 0000000..8052ce7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/38.png new file mode 100644 index 0000000..b022639 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/39.png new file mode 100644 index 0000000..9a6bf54 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/4.png new file mode 100644 index 0000000..c0a62e1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/40.png new file mode 100644 index 0000000..ad63f29 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/41.png new file mode 100644 index 0000000..efb34d8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/42.png new file mode 100644 index 0000000..d6a19d5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/43.png new file mode 100644 index 0000000..a6cf4c9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/48.png new file mode 100644 index 0000000..3fcc4b5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/49.png new file mode 100644 index 0000000..8f7ee1d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/5.png new file mode 100644 index 0000000..3882007 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/50.png new file mode 100644 index 0000000..6383a5e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/51.png new file mode 100644 index 0000000..5bbff6e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/52.png new file mode 100644 index 0000000..cc9ba7e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/53.png new file mode 100644 index 0000000..7752599 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/54.png new file mode 100644 index 0000000..fe34801 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/55.png new file mode 100644 index 0000000..cb2fce7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/56.png new file mode 100644 index 0000000..7e6c682 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/57.png new file mode 100644 index 0000000..3d261ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/58.png new file mode 100644 index 0000000..17de9bc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/6.png new file mode 100644 index 0000000..66f6fc8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/7.png new file mode 100644 index 0000000..70eaea5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/8.png new file mode 100644 index 0000000..4c13eea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/9.png new file mode 100644 index 0000000..16a4c83 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_blue.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_blue.properties new file mode 100644 index 0000000..b9441ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_blue.properties @@ -0,0 +1,6 @@ +# Stained glass blue +matchBlocks=95 +metadata=11 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_pane_blue.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_pane_blue.properties new file mode 100644 index 0000000..0bb8a38 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/11_glass_blue/glass_pane_blue.properties @@ -0,0 +1,6 @@ +# Stained glass blue +matchBlocks=160 +metadata=11 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12.png new file mode 100644 index 0000000..93a1003 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/0.png new file mode 100644 index 0000000..259b61c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/1.png new file mode 100644 index 0000000..2268ce6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/10.png new file mode 100644 index 0000000..7ac2776 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/11.png new file mode 100644 index 0000000..6dcaeac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/16.png new file mode 100644 index 0000000..d1d3741 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/17.png new file mode 100644 index 0000000..b94809b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/18.png new file mode 100644 index 0000000..5459fac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/19.png new file mode 100644 index 0000000..afb4bc8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/2.png new file mode 100644 index 0000000..c07848c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/20.png new file mode 100644 index 0000000..2f381e2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/21.png new file mode 100644 index 0000000..abaa5cd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/22.png new file mode 100644 index 0000000..666c8e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/23.png new file mode 100644 index 0000000..2447f12 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/24.png new file mode 100644 index 0000000..b017b2e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/25.png new file mode 100644 index 0000000..acaaf58 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/26.png new file mode 100644 index 0000000..70ec772 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/27.png new file mode 100644 index 0000000..c5e69d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/3.png new file mode 100644 index 0000000..b7f2e56 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/32.png new file mode 100644 index 0000000..e175b98 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/33.png new file mode 100644 index 0000000..799c6a1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/34.png new file mode 100644 index 0000000..ff9667f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/35.png new file mode 100644 index 0000000..f890940 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/36.png new file mode 100644 index 0000000..26d3a7a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/37.png new file mode 100644 index 0000000..5e2cd71 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/38.png new file mode 100644 index 0000000..ee987d8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/39.png new file mode 100644 index 0000000..940b86c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/4.png new file mode 100644 index 0000000..167feab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/40.png new file mode 100644 index 0000000..4610850 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/41.png new file mode 100644 index 0000000..e87f9cb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/42.png new file mode 100644 index 0000000..a007319 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/43.png new file mode 100644 index 0000000..62a6c95 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/48.png new file mode 100644 index 0000000..3003b36 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/49.png new file mode 100644 index 0000000..0c87b12 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/5.png new file mode 100644 index 0000000..363d09b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/50.png new file mode 100644 index 0000000..bff4e7a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/51.png new file mode 100644 index 0000000..85f2aba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/52.png new file mode 100644 index 0000000..1422a56 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/53.png new file mode 100644 index 0000000..4a08413 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/54.png new file mode 100644 index 0000000..43bcdb8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/55.png new file mode 100644 index 0000000..21487fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/56.png new file mode 100644 index 0000000..aaece81 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/57.png new file mode 100644 index 0000000..d4ba78d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/58.png new file mode 100644 index 0000000..746ae6a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/6.png new file mode 100644 index 0000000..ac145b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/7.png new file mode 100644 index 0000000..b9ad6b6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/8.png new file mode 100644 index 0000000..f9febbc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/9.png new file mode 100644 index 0000000..1a00286 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_brown.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_brown.properties new file mode 100644 index 0000000..0b33e3c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_brown.properties @@ -0,0 +1,6 @@ +# Stained glass brown +matchBlocks=95 +metadata=12 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_pane_brown.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_pane_brown.properties new file mode 100644 index 0000000..838f52c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/12_glass_brown/glass_pane_brown.properties @@ -0,0 +1,6 @@ +# Stained glass brown +matchBlocks=160 +metadata=12 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13.png new file mode 100644 index 0000000..d7f8277 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/0.png new file mode 100644 index 0000000..7c1f4e6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/1.png new file mode 100644 index 0000000..2040368 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/10.png new file mode 100644 index 0000000..3c9fdef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/11.png new file mode 100644 index 0000000..4bfcc6d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/16.png new file mode 100644 index 0000000..edc28eb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/17.png new file mode 100644 index 0000000..3b29a9e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/18.png new file mode 100644 index 0000000..f9513cb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/19.png new file mode 100644 index 0000000..83d1cd4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/2.png new file mode 100644 index 0000000..62f1d66 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/20.png new file mode 100644 index 0000000..f5d223a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/21.png new file mode 100644 index 0000000..001eba0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/22.png new file mode 100644 index 0000000..b1e8274 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/23.png new file mode 100644 index 0000000..a4d6cc3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/24.png new file mode 100644 index 0000000..d470857 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/25.png new file mode 100644 index 0000000..1c52d05 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/26.png new file mode 100644 index 0000000..e1a22b6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/27.png new file mode 100644 index 0000000..92eddbc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/3.png new file mode 100644 index 0000000..9efad31 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/32.png new file mode 100644 index 0000000..2d4ab46 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/33.png new file mode 100644 index 0000000..8d28289 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/34.png new file mode 100644 index 0000000..b2aa6f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/35.png new file mode 100644 index 0000000..120a9bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/36.png new file mode 100644 index 0000000..19ca5f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/37.png new file mode 100644 index 0000000..8a8c17e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/38.png new file mode 100644 index 0000000..8e6f98a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/39.png new file mode 100644 index 0000000..cb61692 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/4.png new file mode 100644 index 0000000..f3003ac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/40.png new file mode 100644 index 0000000..ccb2dc6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/41.png new file mode 100644 index 0000000..6373bf1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/42.png new file mode 100644 index 0000000..ccebff1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/43.png new file mode 100644 index 0000000..ae5e948 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/48.png new file mode 100644 index 0000000..a818c9f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/49.png new file mode 100644 index 0000000..7705c14 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/5.png new file mode 100644 index 0000000..c637517 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/50.png new file mode 100644 index 0000000..2c3c4b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/51.png new file mode 100644 index 0000000..ec24732 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/52.png new file mode 100644 index 0000000..dd1ae3b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/53.png new file mode 100644 index 0000000..50f722c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/54.png new file mode 100644 index 0000000..8cc645a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/55.png new file mode 100644 index 0000000..3a8aa9b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/56.png new file mode 100644 index 0000000..8298ffd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/57.png new file mode 100644 index 0000000..f81edbc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/58.png new file mode 100644 index 0000000..a3ff7e6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/6.png new file mode 100644 index 0000000..89bf889 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/7.png new file mode 100644 index 0000000..7d264a9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/8.png new file mode 100644 index 0000000..9a9725f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/9.png new file mode 100644 index 0000000..9645de2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_green.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_green.properties new file mode 100644 index 0000000..0e2e5b3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_green.properties @@ -0,0 +1,6 @@ +# Stained glass green +matchBlocks=95 +metadata=13 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_pane_green.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_pane_green.properties new file mode 100644 index 0000000..c22af49 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/13_glass_green/glass_pane_green.properties @@ -0,0 +1,6 @@ +# Stained glass green +matchBlocks=160 +metadata=13 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14.png new file mode 100644 index 0000000..ea6408b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/0.png new file mode 100644 index 0000000..db4c5eb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/1.png new file mode 100644 index 0000000..3e8c769 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/10.png new file mode 100644 index 0000000..247b815 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/11.png new file mode 100644 index 0000000..e4497bf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/16.png new file mode 100644 index 0000000..3d567be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/17.png new file mode 100644 index 0000000..b593cb8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/18.png new file mode 100644 index 0000000..42924ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/19.png new file mode 100644 index 0000000..db7d4e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/2.png new file mode 100644 index 0000000..72f461b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/20.png new file mode 100644 index 0000000..619b2e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/21.png new file mode 100644 index 0000000..363c81e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/22.png new file mode 100644 index 0000000..e60f627 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/23.png new file mode 100644 index 0000000..f439b47 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/24.png new file mode 100644 index 0000000..b62e65b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/25.png new file mode 100644 index 0000000..ae1c143 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/26.png new file mode 100644 index 0000000..cc952b3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/27.png new file mode 100644 index 0000000..32ad0f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/3.png new file mode 100644 index 0000000..69b8bb3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/32.png new file mode 100644 index 0000000..6f31642 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/33.png new file mode 100644 index 0000000..3bae303 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/34.png new file mode 100644 index 0000000..074a527 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/35.png new file mode 100644 index 0000000..336f054 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/36.png new file mode 100644 index 0000000..6aea777 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/37.png new file mode 100644 index 0000000..382bf64 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/38.png new file mode 100644 index 0000000..88faee4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/39.png new file mode 100644 index 0000000..c452b15 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/4.png new file mode 100644 index 0000000..de22d1e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/40.png new file mode 100644 index 0000000..da6f876 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/41.png new file mode 100644 index 0000000..a25b3af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/42.png new file mode 100644 index 0000000..c437e2c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/43.png new file mode 100644 index 0000000..dbff65d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/48.png new file mode 100644 index 0000000..c2aa088 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/49.png new file mode 100644 index 0000000..64f2e3c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/5.png new file mode 100644 index 0000000..64c2d64 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/50.png new file mode 100644 index 0000000..3903aab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/51.png new file mode 100644 index 0000000..5491189 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/52.png new file mode 100644 index 0000000..61a217d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/53.png new file mode 100644 index 0000000..de9db5e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/54.png new file mode 100644 index 0000000..3c3f5bb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/55.png new file mode 100644 index 0000000..b221b3d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/56.png new file mode 100644 index 0000000..b4799e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/57.png new file mode 100644 index 0000000..c0b5370 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/58.png new file mode 100644 index 0000000..fec4f8f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/6.png new file mode 100644 index 0000000..3d59656 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/7.png new file mode 100644 index 0000000..c83cac5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/8.png new file mode 100644 index 0000000..59e1bc3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/9.png new file mode 100644 index 0000000..eecb4a7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_pane_red.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_pane_red.properties new file mode 100644 index 0000000..fea8c53 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_pane_red.properties @@ -0,0 +1,6 @@ +# Stained glass red +matchBlocks=160 +metadata=14 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_red.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_red.properties new file mode 100644 index 0000000..cf43547 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/14_glass_red/glass_red.properties @@ -0,0 +1,6 @@ +# Stained glass red +matchBlocks=95 +metadata=14 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15.png new file mode 100644 index 0000000..4c87f0f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/0.png new file mode 100644 index 0000000..06f3427 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/1.png new file mode 100644 index 0000000..7e63ee7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/10.png new file mode 100644 index 0000000..9142b6f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/11.png new file mode 100644 index 0000000..f031f1c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/16.png new file mode 100644 index 0000000..273dc8c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/17.png new file mode 100644 index 0000000..0c36799 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/18.png new file mode 100644 index 0000000..6275d95 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/19.png new file mode 100644 index 0000000..8ba895b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/2.png new file mode 100644 index 0000000..32c6872 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/20.png new file mode 100644 index 0000000..bc2543e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/21.png new file mode 100644 index 0000000..2f7fe8e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/22.png new file mode 100644 index 0000000..0d5f9f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/23.png new file mode 100644 index 0000000..3aa27e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/24.png new file mode 100644 index 0000000..f0ded67 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/25.png new file mode 100644 index 0000000..dbb6121 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/26.png new file mode 100644 index 0000000..69bfbc0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/27.png new file mode 100644 index 0000000..07f46ac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/3.png new file mode 100644 index 0000000..011ca1e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/32.png new file mode 100644 index 0000000..5512cbb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/33.png new file mode 100644 index 0000000..239fd78 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/34.png new file mode 100644 index 0000000..defc068 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/35.png new file mode 100644 index 0000000..73dd6df Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/36.png new file mode 100644 index 0000000..8185b75 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/37.png new file mode 100644 index 0000000..f55e960 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/38.png new file mode 100644 index 0000000..6a12574 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/39.png new file mode 100644 index 0000000..f7dadbb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/4.png new file mode 100644 index 0000000..21e9e9e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/40.png new file mode 100644 index 0000000..a0f9b0a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/41.png new file mode 100644 index 0000000..a191e23 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/42.png new file mode 100644 index 0000000..d12d6b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/43.png new file mode 100644 index 0000000..8d55d97 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/48.png new file mode 100644 index 0000000..bf8fe4a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/49.png new file mode 100644 index 0000000..833a3e2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/5.png new file mode 100644 index 0000000..0b09c25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/50.png new file mode 100644 index 0000000..5814d06 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/51.png new file mode 100644 index 0000000..c2decd5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/52.png new file mode 100644 index 0000000..b87f6e4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/53.png new file mode 100644 index 0000000..99fd221 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/54.png new file mode 100644 index 0000000..7b5e630 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/55.png new file mode 100644 index 0000000..10be40b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/56.png new file mode 100644 index 0000000..96c8041 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/57.png new file mode 100644 index 0000000..5d2638a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/58.png new file mode 100644 index 0000000..9360f4a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/6.png new file mode 100644 index 0000000..143555f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/7.png new file mode 100644 index 0000000..443fa69 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/8.png new file mode 100644 index 0000000..6888680 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/9.png new file mode 100644 index 0000000..41b217d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_black.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_black.properties new file mode 100644 index 0000000..4566909 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_black.properties @@ -0,0 +1,6 @@ +# Stained glass black +matchBlocks=95 +metadata=15 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_pane_black.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_pane_black.properties new file mode 100644 index 0000000..b3a8335 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/15_glass_black/glass_pane_black.properties @@ -0,0 +1,6 @@ +# Stained glass black +matchBlocks=160 +metadata=15 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/16.png new file mode 100644 index 0000000..316522f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/17.png new file mode 100644 index 0000000..b3c3165 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/18.png new file mode 100644 index 0000000..70de401 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/19.png new file mode 100644 index 0000000..c8704a1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/0.png new file mode 100644 index 0000000..3a29e31 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/1.png new file mode 100644 index 0000000..ac20892 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/10.png new file mode 100644 index 0000000..5107903 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/11.png new file mode 100644 index 0000000..76a4ecb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/16.png new file mode 100644 index 0000000..34b4e01 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/17.png new file mode 100644 index 0000000..d5ba7a0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/18.png new file mode 100644 index 0000000..31ea8b5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/19.png new file mode 100644 index 0000000..3fa6a20 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/2.png new file mode 100644 index 0000000..da2c361 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/20.png new file mode 100644 index 0000000..2eb2915 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/21.png new file mode 100644 index 0000000..09652b3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/22.png new file mode 100644 index 0000000..92e199c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/23.png new file mode 100644 index 0000000..9068d19 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/24.png new file mode 100644 index 0000000..f07d979 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/25.png new file mode 100644 index 0000000..520102c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/26.png new file mode 100644 index 0000000..be490ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/27.png new file mode 100644 index 0000000..3eac57f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/3.png new file mode 100644 index 0000000..0cb6300 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/32.png new file mode 100644 index 0000000..38fe9f4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/33.png new file mode 100644 index 0000000..ad6398d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/34.png new file mode 100644 index 0000000..53d76db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/35.png new file mode 100644 index 0000000..c7adaab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/36.png new file mode 100644 index 0000000..de55e7b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/37.png new file mode 100644 index 0000000..1202c0d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/38.png new file mode 100644 index 0000000..8977b0f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/39.png new file mode 100644 index 0000000..c091f83 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/4.png new file mode 100644 index 0000000..595ce65 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/40.png new file mode 100644 index 0000000..f51e589 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/41.png new file mode 100644 index 0000000..663b197 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/42.png new file mode 100644 index 0000000..f6a65d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/43.png new file mode 100644 index 0000000..4b6a0d5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/48.png new file mode 100644 index 0000000..4e6c92a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/49.png new file mode 100644 index 0000000..1a5751d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/5.png new file mode 100644 index 0000000..c9353d4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/50.png new file mode 100644 index 0000000..b73c34f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/51.png new file mode 100644 index 0000000..ab60c8e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/52.png new file mode 100644 index 0000000..282c59d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/53.png new file mode 100644 index 0000000..3df68a2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/54.png new file mode 100644 index 0000000..36a6ae1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/55.png new file mode 100644 index 0000000..73ff42d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/56.png new file mode 100644 index 0000000..4bc7b52 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/57.png new file mode 100644 index 0000000..3df9c2a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/58.png new file mode 100644 index 0000000..067054d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/6.png new file mode 100644 index 0000000..f310397 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/7.png new file mode 100644 index 0000000..6d06d7b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/8.png new file mode 100644 index 0000000..ac561ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/9.png new file mode 100644 index 0000000..42034d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_orange.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_orange.properties new file mode 100644 index 0000000..41553be --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_orange.properties @@ -0,0 +1,6 @@ +# Stained glass orange +matchBlocks=95 +metadata=1 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_pane_orange.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_pane_orange.properties new file mode 100644 index 0000000..a25460f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/1_glass_orange/glass_pane_orange.properties @@ -0,0 +1,6 @@ +# Stained glass orange +matchBlocks=160 +metadata=1 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2.png new file mode 100644 index 0000000..dc088c6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/20.png new file mode 100644 index 0000000..8b54006 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/21.png new file mode 100644 index 0000000..193abdc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/22.png new file mode 100644 index 0000000..13940d4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/23.png new file mode 100644 index 0000000..a64d95f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/24.png new file mode 100644 index 0000000..0291a2e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/25.png new file mode 100644 index 0000000..ea459b6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/26.png new file mode 100644 index 0000000..683cfe1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/27.png new file mode 100644 index 0000000..45a0af6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/0.png new file mode 100644 index 0000000..5cd9945 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/1.png new file mode 100644 index 0000000..73799d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/10.png new file mode 100644 index 0000000..f307b82 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/11.png new file mode 100644 index 0000000..612745d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/16.png new file mode 100644 index 0000000..5eaccfc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/17.png new file mode 100644 index 0000000..1e206b4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/18.png new file mode 100644 index 0000000..30e55de Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/19.png new file mode 100644 index 0000000..7fa751c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/2.png new file mode 100644 index 0000000..dd37796 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/20.png new file mode 100644 index 0000000..145d9a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/21.png new file mode 100644 index 0000000..a389d82 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/22.png new file mode 100644 index 0000000..e1379a8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/23.png new file mode 100644 index 0000000..b9ba5b9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/24.png new file mode 100644 index 0000000..c80687a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/25.png new file mode 100644 index 0000000..39f403c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/26.png new file mode 100644 index 0000000..638b3da Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/27.png new file mode 100644 index 0000000..e88b2e6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/3.png new file mode 100644 index 0000000..12f1aa9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/32.png new file mode 100644 index 0000000..e4621f3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/33.png new file mode 100644 index 0000000..a64a170 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/34.png new file mode 100644 index 0000000..e642e14 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/35.png new file mode 100644 index 0000000..7ee2dba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/36.png new file mode 100644 index 0000000..c7e553e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/37.png new file mode 100644 index 0000000..5d91ebf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/38.png new file mode 100644 index 0000000..3a167e8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/39.png new file mode 100644 index 0000000..19fe7f1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/4.png new file mode 100644 index 0000000..b1ff09c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/40.png new file mode 100644 index 0000000..999f9c7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/41.png new file mode 100644 index 0000000..27a39e1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/42.png new file mode 100644 index 0000000..495859f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/43.png new file mode 100644 index 0000000..0de323b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/48.png new file mode 100644 index 0000000..c0cda90 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/49.png new file mode 100644 index 0000000..0acb361 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/5.png new file mode 100644 index 0000000..5f09b94 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/50.png new file mode 100644 index 0000000..8e138e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/51.png new file mode 100644 index 0000000..1b0d1ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/52.png new file mode 100644 index 0000000..3bc00be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/53.png new file mode 100644 index 0000000..f81704e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/54.png new file mode 100644 index 0000000..5520a91 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/55.png new file mode 100644 index 0000000..d83d0da Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/56.png new file mode 100644 index 0000000..3b2f2d6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/57.png new file mode 100644 index 0000000..492142e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/58.png new file mode 100644 index 0000000..30fc4c9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/6.png new file mode 100644 index 0000000..bce21a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/7.png new file mode 100644 index 0000000..659eb3a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/8.png new file mode 100644 index 0000000..0763cb6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/9.png new file mode 100644 index 0000000..6628eb8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_magenta.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_magenta.properties new file mode 100644 index 0000000..ddf78f7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_magenta.properties @@ -0,0 +1,6 @@ +# Stained glass magenta +matchBlocks=95 +metadata=2 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_pane_magenta.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_pane_magenta.properties new file mode 100644 index 0000000..9f5a428 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/2_glass_magenta/glass_pane_magenta.properties @@ -0,0 +1,6 @@ +# Stained glass magenta +matchBlocks=160 +metadata=2 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3.png new file mode 100644 index 0000000..6611ddc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/32.png new file mode 100644 index 0000000..6f2391c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/33.png new file mode 100644 index 0000000..9572123 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/34.png new file mode 100644 index 0000000..a620f44 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/35.png new file mode 100644 index 0000000..af69add Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/36.png new file mode 100644 index 0000000..5c7effd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/37.png new file mode 100644 index 0000000..663c27d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/38.png new file mode 100644 index 0000000..21b4b1b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/39.png new file mode 100644 index 0000000..8ded4a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/0.png new file mode 100644 index 0000000..b62703d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/1.png new file mode 100644 index 0000000..b54d3e0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/10.png new file mode 100644 index 0000000..61a2de6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/11.png new file mode 100644 index 0000000..0d65d44 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/16.png new file mode 100644 index 0000000..3e2154f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/17.png new file mode 100644 index 0000000..5bfc9b9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/18.png new file mode 100644 index 0000000..0eaf5fc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/19.png new file mode 100644 index 0000000..899033b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/2.png new file mode 100644 index 0000000..5ff1e34 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/20.png new file mode 100644 index 0000000..1053015 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/21.png new file mode 100644 index 0000000..2ca7ba6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/22.png new file mode 100644 index 0000000..972314f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/23.png new file mode 100644 index 0000000..471b0a1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/24.png new file mode 100644 index 0000000..60fc60d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/25.png new file mode 100644 index 0000000..c7a6d9b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/26.png new file mode 100644 index 0000000..881c659 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/27.png new file mode 100644 index 0000000..b7dfaa3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/3.png new file mode 100644 index 0000000..abd672d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/32.png new file mode 100644 index 0000000..63a1c25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/33.png new file mode 100644 index 0000000..d0c743f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/34.png new file mode 100644 index 0000000..98555c3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/35.png new file mode 100644 index 0000000..f2c50a2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/36.png new file mode 100644 index 0000000..21d6813 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/37.png new file mode 100644 index 0000000..cb54313 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/38.png new file mode 100644 index 0000000..a148c54 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/39.png new file mode 100644 index 0000000..6328228 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/4.png new file mode 100644 index 0000000..a996a89 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/40.png new file mode 100644 index 0000000..520b483 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/41.png new file mode 100644 index 0000000..6b68671 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/42.png new file mode 100644 index 0000000..84aaf0d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/43.png new file mode 100644 index 0000000..585fe05 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/48.png new file mode 100644 index 0000000..4734b0a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/49.png new file mode 100644 index 0000000..1b47e77 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/5.png new file mode 100644 index 0000000..40927d6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/50.png new file mode 100644 index 0000000..a806848 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/51.png new file mode 100644 index 0000000..b521d2f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/52.png new file mode 100644 index 0000000..eb9e2f6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/53.png new file mode 100644 index 0000000..dba86fd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/54.png new file mode 100644 index 0000000..58e9d74 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/55.png new file mode 100644 index 0000000..49f8af3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/56.png new file mode 100644 index 0000000..4729ae0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/57.png new file mode 100644 index 0000000..de1a51f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/58.png new file mode 100644 index 0000000..d7f7c6e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/6.png new file mode 100644 index 0000000..3005d8c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/7.png new file mode 100644 index 0000000..70c377b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/8.png new file mode 100644 index 0000000..4eeb2f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/9.png new file mode 100644 index 0000000..f6bb6ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_light_blue.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_light_blue.properties new file mode 100644 index 0000000..7f84e32 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_light_blue.properties @@ -0,0 +1,6 @@ +# Stained glass light_blue +matchBlocks=95 +metadata=3 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_pane_light_blue.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_pane_light_blue.properties new file mode 100644 index 0000000..c8ae52a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/3_glass_light_blue/glass_pane_light_blue.properties @@ -0,0 +1,6 @@ +# Stained glass light_blue +matchBlocks=160 +metadata=3 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4.png new file mode 100644 index 0000000..ba09a5e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/40.png new file mode 100644 index 0000000..1fb540b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/41.png new file mode 100644 index 0000000..1ae5be7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/42.png new file mode 100644 index 0000000..bd95188 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/43.png new file mode 100644 index 0000000..00e2097 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/48.png new file mode 100644 index 0000000..3b0c6ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/49.png new file mode 100644 index 0000000..72b55b5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/0.png new file mode 100644 index 0000000..8e48e12 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/1.png new file mode 100644 index 0000000..7ee50cf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/10.png new file mode 100644 index 0000000..d5e9266 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/11.png new file mode 100644 index 0000000..11561fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/16.png new file mode 100644 index 0000000..e1e7e8a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/17.png new file mode 100644 index 0000000..5c6b658 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/18.png new file mode 100644 index 0000000..f053791 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/19.png new file mode 100644 index 0000000..9d2c4d6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/2.png new file mode 100644 index 0000000..d7899b5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/20.png new file mode 100644 index 0000000..97ab9ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/21.png new file mode 100644 index 0000000..31a4fea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/22.png new file mode 100644 index 0000000..0e4844f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/23.png new file mode 100644 index 0000000..d3ba750 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/24.png new file mode 100644 index 0000000..5b54d6a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/25.png new file mode 100644 index 0000000..acd47fd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/26.png new file mode 100644 index 0000000..d975f89 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/27.png new file mode 100644 index 0000000..b544aba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/3.png new file mode 100644 index 0000000..c6cd55e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/32.png new file mode 100644 index 0000000..0500954 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/33.png new file mode 100644 index 0000000..92ec338 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/34.png new file mode 100644 index 0000000..499f061 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/35.png new file mode 100644 index 0000000..e0a0567 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/36.png new file mode 100644 index 0000000..a3f7fce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/37.png new file mode 100644 index 0000000..faf281b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/38.png new file mode 100644 index 0000000..77aa437 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/39.png new file mode 100644 index 0000000..ee7d8fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/4.png new file mode 100644 index 0000000..e19d2eb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/40.png new file mode 100644 index 0000000..fb1f1ae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/41.png new file mode 100644 index 0000000..7974f3c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/42.png new file mode 100644 index 0000000..6d999ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/43.png new file mode 100644 index 0000000..c85d599 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/48.png new file mode 100644 index 0000000..bf1e5f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/49.png new file mode 100644 index 0000000..63ffd31 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/5.png new file mode 100644 index 0000000..bc4916a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/50.png new file mode 100644 index 0000000..fd296c3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/51.png new file mode 100644 index 0000000..5989037 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/52.png new file mode 100644 index 0000000..849b498 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/53.png new file mode 100644 index 0000000..149ed0c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/54.png new file mode 100644 index 0000000..ff41948 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/55.png new file mode 100644 index 0000000..25ef075 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/56.png new file mode 100644 index 0000000..ac21fe8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/57.png new file mode 100644 index 0000000..82e59f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/58.png new file mode 100644 index 0000000..e9ec17d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/6.png new file mode 100644 index 0000000..9038f0c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/7.png new file mode 100644 index 0000000..55bbba6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/8.png new file mode 100644 index 0000000..7c65826 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/9.png new file mode 100644 index 0000000..f18633e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_pane_yellow.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_pane_yellow.properties new file mode 100644 index 0000000..b341462 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_pane_yellow.properties @@ -0,0 +1,6 @@ +# Stained glass yellow +matchBlocks=160 +metadata=4 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_yellow.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_yellow.properties new file mode 100644 index 0000000..064de85 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/4_glass_yellow/glass_yellow.properties @@ -0,0 +1,6 @@ +# Stained glass yellow +matchBlocks=95 +metadata=4 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5.png new file mode 100644 index 0000000..3f475db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/50.png new file mode 100644 index 0000000..9de42fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/51.png new file mode 100644 index 0000000..3eb78ec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/52.png new file mode 100644 index 0000000..c6deb56 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/53.png new file mode 100644 index 0000000..ccb3ad4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/54.png new file mode 100644 index 0000000..db2b9cc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/55.png new file mode 100644 index 0000000..c4ba83b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/56.png new file mode 100644 index 0000000..896a612 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/57.png new file mode 100644 index 0000000..40c7712 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/58.png new file mode 100644 index 0000000..66cf887 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/0.png new file mode 100644 index 0000000..f1d3c46 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/1.png new file mode 100644 index 0000000..28ff5aa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/10.png new file mode 100644 index 0000000..52548e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/11.png new file mode 100644 index 0000000..3fc29f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/16.png new file mode 100644 index 0000000..bef180c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/17.png new file mode 100644 index 0000000..365032b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/18.png new file mode 100644 index 0000000..99006ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/19.png new file mode 100644 index 0000000..3daa953 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/2.png new file mode 100644 index 0000000..2a5941b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/20.png new file mode 100644 index 0000000..da36e37 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/21.png new file mode 100644 index 0000000..158596d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/22.png new file mode 100644 index 0000000..68383dd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/23.png new file mode 100644 index 0000000..2d60be0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/24.png new file mode 100644 index 0000000..5a41ebe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/25.png new file mode 100644 index 0000000..4512b61 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/26.png new file mode 100644 index 0000000..6a34f7a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/27.png new file mode 100644 index 0000000..d50f751 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/3.png new file mode 100644 index 0000000..4ad6261 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/32.png new file mode 100644 index 0000000..4a477d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/33.png new file mode 100644 index 0000000..b3d3c4c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/34.png new file mode 100644 index 0000000..cdbf635 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/35.png new file mode 100644 index 0000000..8d04801 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/36.png new file mode 100644 index 0000000..96fe6bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/37.png new file mode 100644 index 0000000..7c6557a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/38.png new file mode 100644 index 0000000..d0f480b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/39.png new file mode 100644 index 0000000..6a84d7c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/4.png new file mode 100644 index 0000000..045109c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/40.png new file mode 100644 index 0000000..11542e1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/41.png new file mode 100644 index 0000000..99fd347 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/42.png new file mode 100644 index 0000000..a4dc944 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/43.png new file mode 100644 index 0000000..5d1eef1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/48.png new file mode 100644 index 0000000..cf228f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/49.png new file mode 100644 index 0000000..4256865 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/5.png new file mode 100644 index 0000000..ba16e32 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/50.png new file mode 100644 index 0000000..3b23cb5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/51.png new file mode 100644 index 0000000..c29337a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/52.png new file mode 100644 index 0000000..0f33f4d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/53.png new file mode 100644 index 0000000..b4887a3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/54.png new file mode 100644 index 0000000..797aaa1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/55.png new file mode 100644 index 0000000..9817194 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/56.png new file mode 100644 index 0000000..8e3eba1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/57.png new file mode 100644 index 0000000..b7454e1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/58.png new file mode 100644 index 0000000..f578645 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/6.png new file mode 100644 index 0000000..d2e9ade Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/7.png new file mode 100644 index 0000000..9f26f1b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/8.png new file mode 100644 index 0000000..6e44ca1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/9.png new file mode 100644 index 0000000..3a61657 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_lime.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_lime.properties new file mode 100644 index 0000000..968e822 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_lime.properties @@ -0,0 +1,6 @@ +# Stained glass lime +matchBlocks=95 +metadata=5 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_pane_lime.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_pane_lime.properties new file mode 100644 index 0000000..1526f27 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/5_glass_lime/glass_pane_lime.properties @@ -0,0 +1,6 @@ +# Stained glass lime +matchBlocks=160 +metadata=5 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6.png new file mode 100644 index 0000000..ffd366d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/66.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/66.png new file mode 100644 index 0000000..13d68d0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/66.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/0.png new file mode 100644 index 0000000..42d8739 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/1.png new file mode 100644 index 0000000..7744913 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/10.png new file mode 100644 index 0000000..a87f362 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/11.png new file mode 100644 index 0000000..9f572a8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/16.png new file mode 100644 index 0000000..9cc8ef9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/17.png new file mode 100644 index 0000000..947f4ac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/18.png new file mode 100644 index 0000000..fea9bca Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/19.png new file mode 100644 index 0000000..fd0ee45 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/2.png new file mode 100644 index 0000000..50ef16b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/20.png new file mode 100644 index 0000000..378e5ef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/21.png new file mode 100644 index 0000000..557d38d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/22.png new file mode 100644 index 0000000..a9f4eb0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/23.png new file mode 100644 index 0000000..6b74afc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/24.png new file mode 100644 index 0000000..d6bb643 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/25.png new file mode 100644 index 0000000..be3c1a2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/26.png new file mode 100644 index 0000000..7f87f51 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/27.png new file mode 100644 index 0000000..ac497a7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/3.png new file mode 100644 index 0000000..078a36a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/32.png new file mode 100644 index 0000000..2bb9b0d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/33.png new file mode 100644 index 0000000..88a776d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/34.png new file mode 100644 index 0000000..35c3098 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/35.png new file mode 100644 index 0000000..0ad4c4e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/36.png new file mode 100644 index 0000000..1360eea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/37.png new file mode 100644 index 0000000..3ba09fc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/38.png new file mode 100644 index 0000000..734a7cf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/39.png new file mode 100644 index 0000000..fd3329f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/4.png new file mode 100644 index 0000000..02d6d03 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/40.png new file mode 100644 index 0000000..2c41cc1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/41.png new file mode 100644 index 0000000..113d0c2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/42.png new file mode 100644 index 0000000..c1ab110 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/43.png new file mode 100644 index 0000000..600cfe2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/48.png new file mode 100644 index 0000000..80182e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/49.png new file mode 100644 index 0000000..f655fb9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/5.png new file mode 100644 index 0000000..b94667c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/50.png new file mode 100644 index 0000000..2314156 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/51.png new file mode 100644 index 0000000..bfda4f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/52.png new file mode 100644 index 0000000..3e16767 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/53.png new file mode 100644 index 0000000..37c84ec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/54.png new file mode 100644 index 0000000..c971dfc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/55.png new file mode 100644 index 0000000..c0f4df8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/56.png new file mode 100644 index 0000000..16374c3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/57.png new file mode 100644 index 0000000..68155ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/58.png new file mode 100644 index 0000000..016889e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/6.png new file mode 100644 index 0000000..5b0cb15 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/7.png new file mode 100644 index 0000000..4e3885e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/8.png new file mode 100644 index 0000000..a2c6f48 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/9.png new file mode 100644 index 0000000..0051d1d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pane_pink.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pane_pink.properties new file mode 100644 index 0000000..e4515fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pane_pink.properties @@ -0,0 +1,6 @@ +# Stained glass pink +matchBlocks=160 +metadata=6 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pink.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pink.properties new file mode 100644 index 0000000..1bbca38 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/6_glass_pink/glass_pink.properties @@ -0,0 +1,6 @@ +# Stained glass pink +matchBlocks=95 +metadata=6 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7.png new file mode 100644 index 0000000..7d0ffb2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/0.png new file mode 100644 index 0000000..3f07a5d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/1.png new file mode 100644 index 0000000..64fffa3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/10.png new file mode 100644 index 0000000..b0c0d27 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/11.png new file mode 100644 index 0000000..112c6ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/16.png new file mode 100644 index 0000000..5a5d27f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/17.png new file mode 100644 index 0000000..9479f0e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/18.png new file mode 100644 index 0000000..d5f2a66 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/19.png new file mode 100644 index 0000000..5c6b9e1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/2.png new file mode 100644 index 0000000..131366f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/20.png new file mode 100644 index 0000000..e4ffc2f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/21.png new file mode 100644 index 0000000..14cc29c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/22.png new file mode 100644 index 0000000..3b41dac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/23.png new file mode 100644 index 0000000..58a5125 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/24.png new file mode 100644 index 0000000..e1a4030 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/25.png new file mode 100644 index 0000000..736d80c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/26.png new file mode 100644 index 0000000..b2b0aa8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/27.png new file mode 100644 index 0000000..87549c4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/3.png new file mode 100644 index 0000000..f37a2c8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/32.png new file mode 100644 index 0000000..09c3d65 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/33.png new file mode 100644 index 0000000..fa44bdb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/34.png new file mode 100644 index 0000000..542b9f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/35.png new file mode 100644 index 0000000..5b157bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/36.png new file mode 100644 index 0000000..6d485e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/37.png new file mode 100644 index 0000000..1b5d8ec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/38.png new file mode 100644 index 0000000..a0fe8a1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/39.png new file mode 100644 index 0000000..92091b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/4.png new file mode 100644 index 0000000..6d822a4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/40.png new file mode 100644 index 0000000..5172ef3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/41.png new file mode 100644 index 0000000..a281ced Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/42.png new file mode 100644 index 0000000..62a50e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/43.png new file mode 100644 index 0000000..8fc8b05 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/48.png new file mode 100644 index 0000000..a40bbcd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/49.png new file mode 100644 index 0000000..5b337fb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/5.png new file mode 100644 index 0000000..82fcfc3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/50.png new file mode 100644 index 0000000..278e7eb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/51.png new file mode 100644 index 0000000..b6f30cc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/52.png new file mode 100644 index 0000000..f0ca09d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/53.png new file mode 100644 index 0000000..7396d2c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/54.png new file mode 100644 index 0000000..7958f25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/55.png new file mode 100644 index 0000000..8dcc4de Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/56.png new file mode 100644 index 0000000..b5f7d16 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/57.png new file mode 100644 index 0000000..82acb63 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/58.png new file mode 100644 index 0000000..c6bfce6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/6.png new file mode 100644 index 0000000..ccb1f6a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/7.png new file mode 100644 index 0000000..bf67595 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/8.png new file mode 100644 index 0000000..01acf18 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/9.png new file mode 100644 index 0000000..d237ab9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_gray.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_gray.properties new file mode 100644 index 0000000..5284f51 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_gray.properties @@ -0,0 +1,6 @@ +# Stained glass gray +matchBlocks=95 +metadata=7 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_pane_gray.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_pane_gray.properties new file mode 100644 index 0000000..8d37d35 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/7_glass_gray/glass_pane_gray.properties @@ -0,0 +1,6 @@ +# Stained glass gray +matchBlocks=160 +metadata=7 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8.png new file mode 100644 index 0000000..f9bf0fb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/0.png new file mode 100644 index 0000000..8461664 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/1.png new file mode 100644 index 0000000..12a88d0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/10.png new file mode 100644 index 0000000..e2c2673 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/11.png new file mode 100644 index 0000000..076bdbe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/16.png new file mode 100644 index 0000000..f1ce496 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/17.png new file mode 100644 index 0000000..ab39de7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/18.png new file mode 100644 index 0000000..23231db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/19.png new file mode 100644 index 0000000..5034a66 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/2.png new file mode 100644 index 0000000..fc9e60e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/20.png new file mode 100644 index 0000000..c885d28 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/21.png new file mode 100644 index 0000000..7db45f0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/22.png new file mode 100644 index 0000000..fefa27c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/23.png new file mode 100644 index 0000000..875306d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/24.png new file mode 100644 index 0000000..ba8e1ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/25.png new file mode 100644 index 0000000..c244eee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/26.png new file mode 100644 index 0000000..5789108 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/27.png new file mode 100644 index 0000000..13cd6f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/3.png new file mode 100644 index 0000000..9f22722 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/32.png new file mode 100644 index 0000000..f9f64d6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/33.png new file mode 100644 index 0000000..ab006a3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/34.png new file mode 100644 index 0000000..08dd059 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/35.png new file mode 100644 index 0000000..78ccad0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/36.png new file mode 100644 index 0000000..4606e7a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/37.png new file mode 100644 index 0000000..a6f7531 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/38.png new file mode 100644 index 0000000..bce4bcb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/39.png new file mode 100644 index 0000000..3f3b0ec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/4.png new file mode 100644 index 0000000..b93f9cd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/40.png new file mode 100644 index 0000000..662e200 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/41.png new file mode 100644 index 0000000..8fe077a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/42.png new file mode 100644 index 0000000..007d225 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/43.png new file mode 100644 index 0000000..9521d9d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/48.png new file mode 100644 index 0000000..3a492b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/49.png new file mode 100644 index 0000000..f81553a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/5.png new file mode 100644 index 0000000..b99c20e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/50.png new file mode 100644 index 0000000..3749f75 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/51.png new file mode 100644 index 0000000..a40c84f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/52.png new file mode 100644 index 0000000..99d2700 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/53.png new file mode 100644 index 0000000..1c5770d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/54.png new file mode 100644 index 0000000..7f80e64 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/55.png new file mode 100644 index 0000000..c003c7f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/56.png new file mode 100644 index 0000000..c28a131 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/57.png new file mode 100644 index 0000000..84540bc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/58.png new file mode 100644 index 0000000..5544bc9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/6.png new file mode 100644 index 0000000..1447715 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/7.png new file mode 100644 index 0000000..0e5a7a7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/8.png new file mode 100644 index 0000000..fe3a46f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/9.png new file mode 100644 index 0000000..267f2ae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_pane_silver.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_pane_silver.properties new file mode 100644 index 0000000..4957508 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_pane_silver.properties @@ -0,0 +1,6 @@ +# Stained glass silver +matchBlocks=160 +metadata=8 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_silver.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_silver.properties new file mode 100644 index 0000000..d2696f7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/8_glass_silver/glass_silver.properties @@ -0,0 +1,6 @@ +# Stained glass silver +matchBlocks=95 +metadata=8 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9.png new file mode 100644 index 0000000..d4f7c4e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/0.png new file mode 100644 index 0000000..d30caa4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/1.png new file mode 100644 index 0000000..941354d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/10.png new file mode 100644 index 0000000..e6e23b0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/11.png new file mode 100644 index 0000000..f0eddb7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/16.png new file mode 100644 index 0000000..fa7272e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/17.png new file mode 100644 index 0000000..beebe55 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/18.png new file mode 100644 index 0000000..59dd8a8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/19.png new file mode 100644 index 0000000..4961e39 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/2.png new file mode 100644 index 0000000..771ff3b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/20.png new file mode 100644 index 0000000..e8c3134 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/21.png new file mode 100644 index 0000000..bd9b84a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/22.png new file mode 100644 index 0000000..98f227d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/23.png new file mode 100644 index 0000000..dc7929e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/24.png new file mode 100644 index 0000000..c6c02d9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/25.png new file mode 100644 index 0000000..7c5e5ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/26.png new file mode 100644 index 0000000..b45b386 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/27.png new file mode 100644 index 0000000..ba47110 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/3.png new file mode 100644 index 0000000..81db31f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/32.png new file mode 100644 index 0000000..9cc6fda Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/33.png new file mode 100644 index 0000000..97c6860 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/34.png new file mode 100644 index 0000000..8790bd3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/35.png new file mode 100644 index 0000000..36aafff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/36.png new file mode 100644 index 0000000..533ce59 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/37.png new file mode 100644 index 0000000..21ea0a1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/38.png new file mode 100644 index 0000000..c804c82 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/39.png new file mode 100644 index 0000000..497a1ff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/4.png new file mode 100644 index 0000000..b1a0f02 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/40.png new file mode 100644 index 0000000..ab09ebd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/41.png new file mode 100644 index 0000000..d65c5de Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/42.png new file mode 100644 index 0000000..92184c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/43.png new file mode 100644 index 0000000..fb3587a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/48.png new file mode 100644 index 0000000..f6d84b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/49.png new file mode 100644 index 0000000..9016a5f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/5.png new file mode 100644 index 0000000..4469277 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/50.png new file mode 100644 index 0000000..bba832b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/51.png new file mode 100644 index 0000000..706c0bc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/52.png new file mode 100644 index 0000000..6dc0362 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/53.png new file mode 100644 index 0000000..1fcc91a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/54.png new file mode 100644 index 0000000..f1cfbd9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/55.png new file mode 100644 index 0000000..aec8126 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/56.png new file mode 100644 index 0000000..0ddd669 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/57.png new file mode 100644 index 0000000..7c7bc74 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/58.png new file mode 100644 index 0000000..6495fef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/6.png new file mode 100644 index 0000000..663a5d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/7.png new file mode 100644 index 0000000..9a120cb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/8.png new file mode 100644 index 0000000..39755b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/9.png new file mode 100644 index 0000000..74bddb4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_cyan.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_cyan.properties new file mode 100644 index 0000000..807c2d4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_cyan.properties @@ -0,0 +1,6 @@ +# Stained glass cyan +matchBlocks=95 +metadata=9 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_pane_cyan.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_pane_cyan.properties new file mode 100644 index 0000000..cc7d8d6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/9_glass_cyan/glass_pane_cyan.properties @@ -0,0 +1,6 @@ +# Stained glass cyan +matchBlocks=160 +metadata=9 +connect=block +method=ctm +tiles=0-11 16-27 32-43 48-58 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/bookshelf.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/bookshelf.properties new file mode 100644 index 0000000..9ce8074 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/bookshelf.properties @@ -0,0 +1,6 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchBlocks=47 +method=horizontal +tiles=12-15 +connect=block diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/empty.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/empty.png new file mode 100644 index 0000000..dbaa21c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/empty.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glass.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glass.properties new file mode 100644 index 0000000..8064c63 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glass.properties @@ -0,0 +1,6 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchBlocks=20 +method=ctm +tiles=0-11 16-27 32-43 48-58 +connect=block diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glasspane.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glasspane.properties new file mode 100644 index 0000000..17bceec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/glasspane.properties @@ -0,0 +1,6 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchBlocks=102 +method=ctm +tiles=0-11 16-27 32-43 48-58 +connect=block diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/sandstone.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/sandstone.properties new file mode 100644 index 0000000..9176eb9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/mcpatcher/ctm/default/sandstone.properties @@ -0,0 +1,7 @@ +# Converted from /ctm.png +# Individual tiles are in /ctm/default +matchTiles=sandstone_normal +metadata=0 +method=top +tiles=66 +connect=tile diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/cs_CZ.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/cs_CZ.lang new file mode 100644 index 0000000..d33d1a6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/cs_CZ.lang @@ -0,0 +1,602 @@ +# Hlavní +of.general.ambiguous=dvojznačný +of.general.custom=Vlastní +of.general.from=Z +of.general.id=Id +of.general.restart=restart +of.general.smart=Chytrá + +# Klávesy +of.key.zoom=Přiblížení + +# Zprávy +of.message.aa.shaders1=Antialiasing není kompatibilní se Stíny. +of.message.aa.shaders2=Prosím vypni Stíny pro použití téhle možnosti. + +of.message.af.shaders1=Anizotropní Filtrování není kompatibilní se Stíny. +of.message.af.shaders2=Prosím vypni Stíny pro použití téhle možnosti. + +of.message.fr.shaders1=Rychlý Render není kompatibilní se Stíny. +of.message.fr.shaders2=Prosím vypni Stíny pro použití téhle možnosti + +of.message.an.shaders1=3D zobrazení není kompatibilní se Stíny. +of.message.an.shaders2=Prosím vypni Stíny pro použití téhle možnosti. + +of.message.shaders.aa1=Stíny nejsou kompatibilní s Antialiasingem. +of.message.shaders.aa2=Jdi do nastavení Kvality -> Antialiasing na VYPNUTO a restartuj hru. + +of.message.shaders.af1=Stíny nejsou kompatibilní s Anizotropním Filtrováním. +of.message.shaders.af2=Jdi do nastavení Kvality -> Anizotropní Filtrování na VYPNUTO. + +of.message.shaders.fr1=Stíny nejsou komoatibilní s Rychlým Renderem. +of.message.shaders.fr2=Jdi do nastavení Výkonu -> Rychlý Render na VYPNUTO. + +of.message.shaders.an1=Stíny nejsou kompatibilní se 3D zobrazením. +of.message.shaders.an2=Jdi do nastavení Ostatního -> 3D zobrazení na VYPNUTO. + +of.message.newVersion=Nová verze §eOptiFinu§f je k dispozici: §e%s§f +of.message.java64Bit=Můžeš si nainstalovat §e64-bitovou Javu§f pro zvýšení výkonu. +of.message.openglError=§eChyba OpenGL§f: %s (%s) + +of.message.shaders.loading=Načítám stíny: %s + +of.message.other.reset=Vyresetovat všechno nastavení videa (grafiky) na výchozí hodnoty? + +of.message.loadingVisibleChunks=Načítám vididetlné chunky + +# Nastavení Grafiky + +options.graphics.tooltip.1=Vizuální kvalita +options.graphics.tooltip.2= Rychlá - nižší kvalita, rychlejší +options.graphics.tooltip.3= Pěkná - vyšší kvalita, pomalejší +options.graphics.tooltip.4=Mění vzhled mraků, listí, vody, +options.graphics.tooltip.5=stínů a stran trávníků. + +of.options.renderDistance.tiny=Maličký +of.options.renderDistance.short=Malý +of.options.renderDistance.normal=Normální +of.options.renderDistance.far=Velký +of.options.renderDistance.extreme=Extrémní + +options.renderDistance.tooltip.1=Dohled +options.renderDistance.tooltip.2= 2 Maličký - 32m (nejrychlejší) +options.renderDistance.tooltip.3= 4 Malý - 64m (rychlejší) +options.renderDistance.tooltip.4= 8 Normální - 128m +options.renderDistance.tooltip.5= 16 Velký - 256m (pomalejší) +options.renderDistance.tooltip.6= 32 Extrémní - 512m (nejpomalejší!) +options.renderDistance.tooltip.7=Extrémní Viditelná vzdálenost je velmi výkonově náročná! +options.renderDistance.tooltip.8=Hodnoty nad 16 Velká jsou pouze pro lokální světy. + +options.ao.tooltip.1=Vyhlazené osvětlení. +options.ao.tooltip.2= VYPNUTO - žádné vyhlazené osvětlení (rychlejší) +options.ao.tooltip.3= Minimální - jednoduše vyhlazené osvětlení (pomalejší) +options.ao.tooltip.4= Maximální - kompletně vyhlazené osvětlení (nejpomalejší) + +options.framerateLimit.tooltip.1=Maximální FPS +options.framerateLimit.tooltip.2= VSync - limitované pro max počet FPS pro monitor (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - nastavitelné +options.framerateLimit.tooltip.4= Neomezené - bez limitu (nejrychlejší) +options.framerateLimit.tooltip.5=FPS limit sníží FPS, i když +options.framerateLimit.tooltip.6=stanovená hodnota není překročena. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Úroveň Vyhlazeného Osvětlení +of.options.AO_LEVEL.tooltip.1=Úroveň vyhlazeného osvětlení +of.options.AO_LEVEL.tooltip.2= VYPNUTO - žádné stíny +of.options.AO_LEVEL.tooltip.3= 50%% - světlé stíny +of.options.AO_LEVEL.tooltip.4= 100%% - tmavé stíny + +options.viewBobbing.tooltip.1=Více realistický pohyb +options.viewBobbing.tooltip.2=Pokud používáš mipmapy, nastav na VYPNUTO pro nejlepší výsledky. + +options.guiScale.tooltip.1=Velikost GUI +options.guiScale.tooltip.2= Automatická - maximální velikost +options.guiScale.tooltip.3= Malá, Normální, Velká - 1x až 3x +options.guiScale.tooltip.4= 4x do 10x - dostupné na 4K obrazovkách +options.guiScale.tooltip.5=Liché hodnoty (1x, 3x, 5x ...) nejsou kompatibilní s písmem Unicode. +options.guiScale.tooltip.6=Menší GUI mohou být rychlejší. + +options.vbo.tooltip.1=VBO +options.vbo.tooltip.2=Používá alternativní model renderování, který je +options.vbo.tooltip.3=rychlejší (5-10%%) oproti výchozímu renderování. + +options.gamma.tooltip.1=Zvýší jas tmavých objektů. +options.gamma.tooltip.2= Tmavý - standardní jas +options.gamma.tooltip.3= 1-99%% - nastavitelné +options.gamma.tooltip.4= Jasný - maximální jas tmavých objektů +options.gamma.tooltip.5=Tato možnost nezmění jas +options.gamma.tooltip.6=dokonale černých objektů. + +options.anaglyph.tooltip.1=3D Zobrazení +options.anaglyph.tooltip.2=Zapne stereoskopické 3D, které používá rozdílné barvy +options.anaglyph.tooltip.3=pro každé oko. +options.anaglyph.tooltip.4=Vyžaduje červeno-modré brýle pro správné vidění. + +of.options.ALTERNATE_BLOCKS=Různé Bloky +options.blockAlternatives.tooltip.1=Alternativní Bloky +options.blockAlternatives.tooltip.2=Používá rozdílné modely bloku pro některé modely. +options.blockAlternatives.tooltip.3=Záleží na vybraném balíčku zdrojů. + +of.options.FOG_FANCY=Mlha +of.options.FOG_FANCY.tooltip.1=Typ mlhy +of.options.FOG_FANCY.tooltip.2= Rychlá - rychlejší mlha +of.options.FOG_FANCY.tooltip.3= Pěkná - pomalejší mlha, vypadá pěkněji +of.options.FOG_FANCY.tooltip.4= VYPNUTO - žádná mlha, rychlejší +of.options.FOG_FANCY.tooltip.5=Pěkná mlha se aktivuje jen když je podporována +of.options.FOG_FANCY.tooltip.6=grafickou kartou. + +of.options.FOG_START=Začátek Mlhy +of.options.FOG_START.tooltip.1=Start Mlhy +of.options.FOG_START.tooltip.2= 0.2 - mlha začne přímo u hráče +of.options.FOG_START.tooltip.3= 0.8 - mlha začne daleko od hráče +of.options.FOG_START.tooltip.4=Tato možnost většinou neovlivňuje výkon. + +of.options.CHUNK_LOADING=Načítaní Chunků +of.options.CHUNK_LOADING.tooltip.1= Načítaní Chunků +of.options.CHUNK_LOADING.tooltip.2= Výchozí - nestabilní FPS při načítání chunků +of.options.CHUNK_LOADING.tooltip.3= Plynulé - stabilní FPS +of.options.CHUNK_LOADING.tooltip.4= Více jader - stabilní FPS, 3x rychlejší načítání světa +of.options.CHUNK_LOADING.tooltip.5=Plynulé a Multi-Jádra - odstraní sekání a +of.options.CHUNK_LOADING.tooltip.6=zmrazování způsobené načítáním chunků. +of.options.CHUNK_LOADING.tooltip.7=Multi-Jádro může 3x zrychlit načítání světa a +of.options.CHUNK_LOADING.tooltip.8=zvýšit FPS používáním druhého jádra. +of.options.chunkLoading.smooth=Plynulé +of.options.chunkLoading.multiCore=Více jader + +of.options.shaders=Stíny... +of.options.shadersTitle=Stíny + +of.options.shaders.packNone=VYPNUTO +of.options.shaders.packDefault=(vložené) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.NORMAL_MAP=Normální Mapa +of.options.shaders.SPECULAR_MAP=Zrcadlová Mapa +of.options.shaders.RENDER_RES_MUL=Kvalita Renderu +of.options.shaders.SHADOW_RES_MUL=Kvalita Stínů +of.options.shaders.HAND_DEPTH_MUL=Ruční Hloubka +of.options.shaders.CLOUD_SHADOW=Stíny mraků +of.options.shaders.OLD_HAND_LIGHT=Staré Ruční Osvětlení +of.options.shaders.OLD_LIGHTING=Staré Osvětlení +of.options.shaders.SHADER_PACK=Balíček Stínů + +of.options.shaders.shadersFolder=Složka Stínů +of.options.shaders.shaderOptions=Možnosti Stínů... + +of.options.shaderOptionsTitle=Možnosti Stínů + +of.options.quality=Kvalita... +of.options.qualityTitle=Nastavení Kvality + +of.options.details=Detaily... +of.options.detailsTitle=Nastavení Detailů + +of.options.performance=Výkon... +of.options.performanceTitle=Nastavení Výkonu + +of.options.animations=Animace... +of.options.animationsTitle=Nastavení Animací + +of.options.other=Ostatní... +of.options.otherTitle=Zbytek Nastavení + +of.options.other.reset=Vyresetovat Nastavení Videa/Grafiky ... + +of.shaders.profile=Profil + +# Kvalita + +of.options.mipmap.bilinear=Bilineání +of.options.mipmap.linear=Lineární +of.options.mipmap.nearest=Nejbližší +of.options.mipmap.trilinear=Trilineární + +options.mipmapLevels.tooltip.1=Vizuální efekt, který dělá vzdálené objekty lepší +options.mipmapLevels.tooltip.2=vyhlazováním texturových detailů. +options.mipmapLevels.tooltip.3= VYPNUTO - žádné vyhlazování +options.mipmapLevels.tooltip.4= 1 - minimální vyhlazování +options.mipmapLevels.tooltip.5= 4 - maximální vyhlazování +options.mipmapLevels.tooltip.6=Tato možnost většinou neovlivňuje výkon. + +of.options.MIPMAP_TYPE=Typ Mipmapy +of.options.MIPMAP_TYPE.tooltip.1=Vizuální efekty mohou udělat vzdálenější objekty pěknější +of.options.MIPMAP_TYPE.tooltip.2=vyhlazováním a detailními texturami. +of.options.MIPMAP_TYPE.tooltip.3= Nejbližší - hrubé vyhlazování (nejrychlejší) +of.options.MIPMAP_TYPE.tooltip.4= Lineární - normální vyhlazování +of.options.MIPMAP_TYPE.tooltip.5= Bilineární - dobré vyhlazování +of.options.MIPMAP_TYPE.tooltip.6= Trilineární - nejlepší vyhlazování (nejpomalejší) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= VYPNUTO - (výchozí) žádný Antialiasing (rychlé) +of.options.AA_LEVEL.tooltip.3= 2-16 - vyhlazené hrany a linie (pomalé) +of.options.AA_LEVEL.tooltip.4=Antialiasing vyhlazuje rozviklané hrany a +of.options.AA_LEVEL.tooltip.5=přechody ostrých barev. +of.options.AA_LEVEL.tooltip.6=Pokud je zapnuto, může výrazně zmenší FPS. +of.options.AA_LEVEL.tooltip.7=Ne všechny úrovně jsou podporované všemi grafickými kartami. +of.options.AA_LEVEL.tooltip.8=Efektivní po RESTARTU! + +of.options.AF_LEVEL=Antizotropní Filtrování +of.options.AF_LEVEL.tooltip.1= Antizotropní Filtrování +of.options.AF_LEVEL.tooltip.2= VYPNUTO - (výchozí) standartní detaily textur (rychlé) +of.options.AF_LEVEL.tooltip.3= 2-16 - lepší detaily v mipmapovaných texturách (pomalé) +of.options.AF_LEVEL.tooltip.4= Antizotropní Filtrování obnoví všechny detaily v +of.options.AF_LEVEL.tooltip.5=mipmapovaných texturách. +of.options.AF_LEVEL.tooltip.6=Pokud je zapnuto, výrazně sníží FPS. + +of.options.CLEAR_WATER=Čistá Voda +of.options.CLEAR_WATER.tooltip.1= Čistá Voda +of.options.CLEAR_WATER.tooltip.2= ZAPNUTO - čistá, průhledná voda +of.options.CLEAR_WATER.tooltip.3= VYPNUTO - výchozí voda + +of.options.RANDOM_MOBS=Náhodní Mobové +of.options.RANDOM_MOBS.tooltip.1= Náhodní Mobové +of.options.RANDOM_MOBS.tooltip.2= VYPNUTO - žádní náhodní mobové, rychlejší +of.options.RANDOM_MOBS.tooltip.3= ZAPNUTO - náhodní mobové, pomalejší +of.options.RANDOM_MOBS.tooltip.4=Funkce náhodní mobové používá náhodně textury pro moby ve hře. +of.options.RANDOM_MOBS.tooltip.5=Vyžaduje balíček textur, který má více textur mobů. + +of.options.BETTER_GRASS=Lepší Trávník +of.options.BETTER_GRASS.tooltip.1=Lepší Trávník +of.options.BETTER_GRASS.tooltip.2= VYPNUTO - výchozí strana trávníku, rychlejší +of.options.BETTER_GRASS.tooltip.3= Rychlá - plná strana trávníku, pomalejší +of.options.BETTER_GRASS.tooltip.4= Pěkná - dynamická strana trávníku, nepomalejší + +of.options.BETTER_SNOW=Lepší Sníh +of.options.BETTER_SNOW.tooltip.1=Lepší sníh +of.options.BETTER_SNOW.tooltip.2= VYPNUTO - výchozí sníh, rychlejší +of.options.BETTER_SNOW.tooltip.3= ZAPNUTO - lepší sníh, pomalejší +of.options.BETTER_SNOW.tooltip.4=Zobrazuje sníh pod průhlednými bloky (plot, vysoká tráva) +of.options.BETTER_SNOW.tooltip.5=když sousedí se sněhovými bloky. + +of.options.CUSTOM_FONTS=Vlastní Písmo +of.options.CUSTOM_FONTS.tooltip.1= Vlastní Písmo +of.options.CUSTOM_FONTS.tooltip.2= ZAPNUTO - používá vlastní písmo (výchozí), pomalejší +of.options.CUSTOM_FONTS.tooltip.3= VYPNUTO - používá výchozí písmo, rychlejší +of.options.CUSTOM_FONTS.tooltip.4=Vlastní písmo záleží na vybraném +of.options.CUSTOM_FONTS.tooltip.5=balíčku zdrojů. + +of.options.CUSTOM_COLORS=Vlastní Barvy +of.options.CUSTOM_COLORS.tooltip.1= Vlastní Barvy +of.options.CUSTOM_COLORS.tooltip.2= ZAPNUTO - používá vlastní barvy (výchozí), pomalejší +of.options.CUSTOM_COLORS.tooltip.3= VYPNUTO - používá výchozí barvy, rychlejší +of.options.CUSTOM_COLORS.tooltip.4=Vlastní barvy záleží na vybraném +of.options.CUSTOM_COLORS.tooltip.5=balíčku zdrojů. + +of.options.SWAMP_COLORS=Barvy v Bažinách +of.options.SWAMP_COLORS.tooltip.1= Barvy v Bažinách +of.options.SWAMP_COLORS.tooltip.2= ZAPNUTO - používá barvy v bažinách (výchozí), pomalejší +of.options.SWAMP_COLORS.tooltip.3= VYPNUTO - nepoužívá barvy v bažinách, rychlejší +of.options.SWAMP_COLORS.tooltip.4=Barvy v bažinách ovlivňují trávník, listy, lijány a vodu. + +of.options.SMOOTH_BIOMES=Vyhlazené Biomy +of.options.SMOOTH_BIOMES.tooltip.1=Vyhlazené Biomy +of.options.SMOOTH_BIOMES.tooltip.2= ZAPNUTO - vyhlazování hranic biomů (výchozí), pomalejší +of.options.SMOOTH_BIOMES.tooltip.3= VYPNUTO - žádné vyhlazování hranic biomů, rychlejší. +of.options.SMOOTH_BIOMES.tooltip.4=Vyhlazování hranic biomů je uděláno vzorkováním +of.options.SMOOTH_BIOMES.tooltip.5=a průměrováním barev všech sousedících bloků. +of.options.SMOOTH_BIOMES.tooltip.6=Ovlivňuje trávník, listí, lijány a vodu. + +of.options.CONNECTED_TEXTURES=Spojené Textury +of.options.CONNECTED_TEXTURES.tooltip.1=Spojené Textury +of.options.CONNECTED_TEXTURES.tooltip.2= VYPNUTO - žádné spojené textury (výchozí), rychlejší +of.options.CONNECTED_TEXTURES.tooltip.3= Rychlá - rychle spojené textury +of.options.CONNECTED_TEXTURES.tooltip.4= Pěkná - pěkně spojené textury +of.options.CONNECTED_TEXTURES.tooltip.5=Spojené textury spojují textury skla, +of.options.CONNECTED_TEXTURES.tooltip.6=pískovce a knihoven když jsou +of.options.CONNECTED_TEXTURES.tooltip.7=vedle sebe. Spojené textury záleží +of.options.CONNECTED_TEXTURES.tooltip.8=na vybraném balíčku zdrojů. + +of.options.NATURAL_TEXTURES=Naturální Textury +of.options.NATURAL_TEXTURES.tooltip.1=Naturální Textury +of.options.NATURAL_TEXTURES.tooltip.2= VYPNUTO - žádné naturální textury, rychlejší +of.options.NATURAL_TEXTURES.tooltip.3= ZAPNUTO - používá naturální textury +of.options.NATURAL_TEXTURES.tooltip.4=Naturální textury odstraňují vzor na hranách +of.options.NATURAL_TEXTURES.tooltip.5=vytvořen bloky stejných typů vedle sebe. +of.options.NATURAL_TEXTURES.tooltip.6=Používá otočené a převrácené základy +of.options.NATURAL_TEXTURES.tooltip.7=textury bloků. Nastavení pro naturální textury +of.options.NATURAL_TEXTURES.tooltip.8=je ovlivňováno vybraným balíčkem zdrojů. + +of.options.EMISSIVE_TEXTURES=Emisivní Textury +of.options.EMISSIVE_TEXTURES.tooltip.1=Emisivní Textury +of.options.EMISSIVE_TEXTURES.tooltip.2= VYPNUTO - žádné emisivní textury (výchozí) +of.options.EMISSIVE_TEXTURES.tooltip.3= ZAPNUTO - použít emisivní textury +of.options.EMISSIVE_TEXTURES.tooltip.4=Emisivní textury jsou renderovány jako překrytí +of.options.EMISSIVE_TEXTURES.tooltip.5=(s maximální září) textur. Mohou být použity na simulování +of.options.EMISSIVE_TEXTURES.tooltip.6=ploch, které mají zářit na textuře bez překrytí. +of.options.EMISSIVE_TEXTURES.tooltip.7=Emisivní textury záleží na vybraném +of.options.EMISSIVE_TEXTURES.tooltip.8=balíčku zdrojů. + +of.options.CUSTOM_SKY=Vlastní Obloha +of.options.CUSTOM_SKY.tooltip.1=Vlastní Obloha +of.options.CUSTOM_SKY.tooltip.2= ZAPNUTO - používá vlastní textury oblohy (výchozí), pomalejší +of.options.CUSTOM_SKY.tooltip.3= VYPNUTO - výchozí obloha, rychlejší +of.options.CUSTOM_SKY.tooltip.4=Vlastní textura oblohy je ovlivňována vybraným +of.options.CUSTOM_SKY.tooltip.5=balíčkem zdrojů. + +of.options.CUSTOM_ITEMS=Vlastní Itemy +of.options.CUSTOM_ITEMS.tooltip.1=Vlastní Itemy +of.options.CUSTOM_ITEMS.tooltip.2= ZAPNUTO - vlastní textury itemů (výchozí), pomalejší +of.options.CUSTOM_ITEMS.tooltip.3= VYPNUTO - výchozí textury itemů, rychlejší +of.options.CUSTOM_ITEMS.tooltip.4=Vlastní itemy záleží na vybraném +of.options.CUSTOM_ITEMS.tooltip.5=balíčku zdrojů. + +of.options.CUSTOM_ENTITY_MODELS=Vlastní modely entit +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Vlastní modely entit +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ZAPNUTO - vlastní modely entit (výchozí), pomalé +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= VYPNUTO - výchozí modely entit, rychlejší +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Vlastní modely entit záleží na vybraném +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=balíčku zdrojů. + +of.options.CUSTOM_GUIS=Vlastní GUI +of.options.CUSTOM_GUIS.tooltip.1=Vlastní uživatelské rozhraní +of.options.CUSTOM_GUIS.tooltip.2= ON - vlastní GUI (výchozí), pomalejší +of.options.CUSTOM_GUIS.tooltip.3= OFF - výchozí GUI, rychlejší +of.options.CUSTOM_GUIS.tooltip.4=Vlastní GUI záleží na vybraném resource packu. + +# Detaily + +of.options.CLOUDS=Mraky +of.options.CLOUDS.tooltip.1=Mraky +of.options.CLOUDS.tooltip.2= Výchozí - z nastavení Grafiky +of.options.CLOUDS.tooltip.3= Rychlá - nižší kvalita, rychlejší +of.options.CLOUDS.tooltip.4= Pěkná - vyšší kvalita, pěknější +of.options.CLOUDS.tooltip.5= VYPNUTO - žádné mraky, nejrychlejší +of.options.CLOUDS.tooltip.6=Rychlé mraky jsou 2D. +of.options.CLOUDS.tooltip.7=Pěkné mraky jsou 3D. + +of.options.CLOUD_HEIGHT=Výška Mraků +of.options.CLOUD_HEIGHT.tooltip.1=Výška Mraků +of.options.CLOUD_HEIGHT.tooltip.2= VYPNUTO - výchozí výška +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - nad limitem stavění + +of.options.TREES=Stromy +of.options.TREES.tooltip.1=Stromy +of.options.TREES.tooltip.2= Výchozí - z nastavení Grafiky +of.options.TREES.tooltip.3= Rychlá - nejnižší kvalita, nejrychlejší +of.options.TREES.tooltip.4= Chytrá - vyšší kvalita, rychlé +of.options.TREES.tooltip.5= Pěkná - nejvyšší kvalita, nejpomalejší +of.options.TREES.tooltip.6=Rychlé stromy nemají průhledné listí. +of.options.TREES.tooltip.7=Pěkné a Chytré stromy mají průhledné listí. + +of.options.RAIN=Sníh a Déšť +of.options.RAIN.tooltip.1=Sníh a Déšť +of.options.RAIN.tooltip.2= Výchozí - z nastavení Grafiky +of.options.RAIN.tooltip.3= Rychlá - lehký sníh/déšť, rychlejší +of.options.RAIN.tooltip.4= Pěkná - velký sníh/déšť, pomalejší +of.options.RAIN.tooltip.5= VYPNUTO - žádný sníh/déšť, nejrychlejší +of.options.RAIN.tooltip.6=Pokud je déšť vypnutý, jeho zvuky a částice dopadu +of.options.RAIN.tooltip.7=se stále objevují. + +of.options.SKY=Obloha +of.options.SKY.tooltip.1=Obloha +of.options.SKY.tooltip.2= ZAPNUTO - obloha je viditelná, pomalejší +of.options.SKY.tooltip.3= VYPNUTO - obloha nejde vidět, rychlejší +of.options.SKY.tooltip.4=Pokud je obloha vypnutá, měsíc a slunce půjdou stále vidět. + +of.options.STARS=Hvězdy +of.options.STARS.tooltip.1=Hvězdy +of.options.STARS.tooltip.2= ZAPNUTO - hvězdy jsou viditelné, pomalejší +of.options.STARS.tooltip.3= VYPNUTO - hvězdy nejdou vidět, rychlejší + +of.options.SUN_MOON=Slunce a Měsíc +of.options.SUN_MOON.tooltip.1=Slunce a Měsíc +of.options.SUN_MOON.tooltip.2= ZAPNUTO - slunce a měsíc lze vidět (výchozí) +of.options.SUN_MOON.tooltip.3= VYPNUTO - slunce a měsíc nelze vidět, rychlejší + +of.options.SHOW_CAPES=Zobrazovat Kápě +of.options.SHOW_CAPES.tooltip.1=Zobrazovat Kápě +of.options.SHOW_CAPES.tooltip.2= ZAPNUTO - zobrazovat kápě hráčů (výchozí) +of.options.SHOW_CAPES.tooltip.3= VYPNUTO - nezobrazovat kápě hráčů + +of.options.TRANSLUCENT_BLOCKS=Průsvitné Bloky +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Průsvitné Bloky +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Pěkná - správné míchání barev (výchozí) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rychlá - rychlé míchání barev (rychlejší) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Ovládá míchání barev průhledných bloků +of.options.TRANSLUCENT_BLOCKS.tooltip.5=s rozdílnou barvou (barevné sklo, voda, led) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=když jsou položeny za sebou s mezerou mezi nimi. + +of.options.HELD_ITEM_TOOLTIPS=Popisek k Drženému Itemu +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Popisek k Drženému Itemu +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ZAPNUTO - zobrazovat popisky (výchozí) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= VYPNUTO - nezobrazovat popisky + +of.options.ADVANCED_TOOLTIPS=Pokročilé Popisky +of.options.ADVANCED_TOOLTIPS.tooltip.1=Pokročilé Popisky +of.options.ADVANCED_TOOLTIPS.tooltip.2= ZAPNUTO - zobrazit pokročilé popisky +of.options.ADVANCED_TOOLTIPS.tooltip.3= VYPNUTO - nezobrazovat pokročilé popisky (výchozí) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Pokročilé popisky zobrazí pokročilé informace pro +of.options.ADVANCED_TOOLTIPS.tooltip.5=itemy (id, durabilita) a pro možnosti stínů +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, zdroj, výchozí hodnota). + +of.options.DROPPED_ITEMS=Vyhozené Itemy +of.options.DROPPED_ITEMS.tooltip.1=Vyhozené Itemy +of.options.DROPPED_ITEMS.tooltip.2= Výchozí - podle nastavení Grafiky +of.options.DROPPED_ITEMS.tooltip.3= Rychlá - vyhozené itemy ve 2D, rychlejší +of.options.DROPPED_ITEMS.tooltip.4= Pěkná - vyhozené itemy ve 3D, pomalejší + +options.entityShadows.tooltip.1=Stíny Entit +options.entityShadows.tooltip.2= ZAPNUTO - zobrazovat stíny entit +options.entityShadows.tooltip.3= VYPNUTO - nezobrazovat stíny entit + +of.options.VIGNETTE=Ztmavení +of.options.VIGNETTE.tooltip.1=Vizuální efekt, který trochu ztmaví okraje obrazovky. +of.options.VIGNETTE.tooltip.2= Výchozí - záleží na nastavení Grafiky (výchozí) +of.options.VIGNETTE.tooltip.3= Rychlá - ztmavení vypnuto (rychlejší) +of.options.VIGNETTE.tooltip.4= Pěkná - ztmavení zapnuto (pomalejší) +of.options.VIGNETTE.tooltip.5=Ztmavení může mít veliký vliv na FPS, +of.options.VIGNETTE.tooltip.6=speciálně při hraní ve fullscreenu. +of.options.VIGNETTE.tooltip.7=Efekt ztmavení je velmi jemný a dá se bezpečně +of.options.VIGNETTE.tooltip.8=vypnout. + +of.options.DYNAMIC_FOV=Dynamické FOV +of.options.DYNAMIC_FOV.tooltip.1=Dynamické FOV +of.options.DYNAMIC_FOV.tooltip.2= ZAPNUTO - zapne dynamické FOV (výchozí) +of.options.DYNAMIC_FOV.tooltip.3= VYPNUTO - vypne dynamické FOV +of.options.DYNAMIC_FOV.tooltip.4=Mění pole pohledu (FOV) při létání, sprintování +of.options.DYNAMIC_FOV.tooltip.5=nebo při natahování luku. + +of.options.DYNAMIC_LIGHTS=Dynamické Světla +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamické Světla +of.options.DYNAMIC_LIGHTS.tooltip.2= VYPNUTO - žádná dynamícká světla (výchozí) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rychlá - rychlá dynamická světla (aktualizace každých 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Pěkná - pěkná dynamická světla (aktualizováno vždy) +of.options.DYNAMIC_LIGHTS.tooltip.5=Pokud je zapnuto a v ruce, na zemi nebo v ruce +of.options.DYNAMIC_LIGHTS.tooltip.6=jiného hráče je držen svítící item (louč, světlit, atd.) +of.options.DYNAMIC_LIGHTS.tooltip.7=tak se osvětlí vše kolem. + +# Výkon + +of.options.SMOOTH_FPS=Vyhlazené FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizuje FPS čištěním vyrovnávací paměti grafického ovladače. +of.options.SMOOTH_FPS.tooltip.2= VYPNUTO - žádná stabilizace, FPS mohou kolísat +of.options.SMOOTH_FPS.tooltip.3= ZAPNUTO - stabilizace FPS +of.options.SMOOTH_FPS.tooltip.4=Tato možnost záleží na grafickém adaptéru a jeho efekt +of.options.SMOOTH_FPS.tooltip.5=není vždy vidět. + +of.options.SMOOTH_WORLD=Vyhlazený Svět +of.options.SMOOTH_WORLD.tooltip.1=Odstraní lagy způsobené interním serverem. +of.options.SMOOTH_WORLD.tooltip.2= VYPNUTO - žádná stabilizace, FPS mohou kolísat +of.options.SMOOTH_WORLD.tooltip.3= ZAPNUTO - stabilizace FPS +of.options.SMOOTH_WORLD.tooltip.4=Stabilizuje FPS rozdělením načítání světa. +of.options.SMOOTH_WORLD.tooltip.5=Funguje jen na lokálních světech (hra pro jednoho hráče). + +of.options.FAST_RENDER=Rychlý Render +of.options.FAST_RENDER.tooltip.1=Rychlý Render +of.options.FAST_RENDER.tooltip.2= VYPNUTO - standardní render +of.options.FAST_RENDER.tooltip.3= ZAPNUTO - vyvážený render (rychlejší) +of.options.FAST_RENDER.tooltip.4=Používáním vyváženěho renderovacího algoritmu se může snížít +of.options.FAST_RENDER.tooltip.5=využití GPU, což může zvýšit FPS. + +of.options.FAST_MATH=Rychlá Matematika +of.options.FAST_MATH.tooltip.1=Rychlá Matematika +of.options.FAST_MATH.tooltip.2= VYPNUTO - standardní matematika +of.options.FAST_MATH.tooltip.3= ZAPNUTO - rychlá matematika +of.options.FAST_MATH.tooltip.4=Používá vyvážené sin() a cos() funkce, což může +of.options.FAST_MATH.tooltip.5=lépe uspořádat grafickou mezipaměť a zvýšit FPS. + +of.options.CHUNK_UPDATES=Načítání Chunků +of.options.CHUNK_UPDATES.tooltip.1=Načítání Chunků +of.options.CHUNK_UPDATES.tooltip.2= 1 - pomalejší načítání světa, vyšší FPS (výchozí) +of.options.CHUNK_UPDATES.tooltip.3= 3 - rychlejší načítání světa, nižší FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - nejrychlejší načítání světa, nejnižší FPS +of.options.CHUNK_UPDATES.tooltip.5=Číslo chunků načtených za 1 FPS, +of.options.CHUNK_UPDATES.tooltip.6=Vyšší hodnoty mohou FPS snížit. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamické Načítání +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamické načítání chunků +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= VYPNUTO - (výchozí) standardní počet chunků na FPS +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ZAPNUTO - více chunků, když se hráč nehýbe +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamické načítání načte více chunků +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=když se hráč nehýbe, svět se načte rychleji. + +of.options.LAZY_CHUNK_LOADING=Líné Načítání Chunků +of.options.LAZY_CHUNK_LOADING.tooltip.1=Pomalé načítání chunků +of.options.LAZY_CHUNK_LOADING.tooltip.2= VYPNUTO - výchozí načítání serverových chunků +of.options.LAZY_CHUNK_LOADING.tooltip.3= ZAPNUTO - pomalé načítání serverových chunků (plynulejší) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Udělá plynulejší načítání chunků na integrovaném serveru +of.options.LAZY_CHUNK_LOADING.tooltip.5=jejich rozdělováním na několik tiků. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Vypni to, pokud se některé části světa nenačtou správně. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efektivní pouze pro lokální světy (single-player). + +# Animace + +of.options.animation.allOn=Vše ZAPNUTO +of.options.animation.allOff=Vše VYPNUTO +of.options.animation.dynamic=Dynamické + +of.options.ANIMATED_WATER=Animovaná Voda +of.options.ANIMATED_LAVA=Animovaná Láva +of.options.ANIMATED_FIRE=Animovaný Oheň +of.options.ANIMATED_PORTAL=Animovaný Portál +of.options.ANIMATED_REDSTONE=Animovaný Redstone +of.options.ANIMATED_EXPLOSION=Animované Exploze +of.options.ANIMATED_FLAME=Animovaný Požár +of.options.ANIMATED_SMOKE=Animovaný Kouř +of.options.VOID_PARTICLES=Částice Voidu +of.options.WATER_PARTICLES=Částice Vody +of.options.RAIN_SPLASH=Částice Deště +of.options.PORTAL_PARTICLES=Částice Portálu +of.options.POTION_PARTICLES=Částice Lektvarů +of.options.DRIPPING_WATER_LAVA=Tekoucí Voda/Láva +of.options.ANIMATED_TERRAIN=Animovaný Terén +of.options.ANIMATED_TEXTURES=Animované Textury +of.options.FIREWORK_PARTICLES=Částice Rachejtle + +# Ostatní + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Zobrazí lagometer na ladící obrazovce (F3). +of.options.LAGOMETER.tooltip.2=* Oranžová - Nasbíraný odpad v RAM (garbage collector) +of.options.LAGOMETER.tooltip.3=* Světle Modrá - Tik +of.options.LAGOMETER.tooltip.4=* Modrá - Plánované soubory +of.options.LAGOMETER.tooltip.5=* Fialová - Načítání chunků +of.options.LAGOMETER.tooltip.6=* Červená - Přednačtené chunky +of.options.LAGOMETER.tooltip.7=* Žlutá - Kontrola viditelnosti +of.options.LAGOMETER.tooltip.8=* Zelená - Načítání terénu + +of.options.PROFILER=Ladící Profil +of.options.PROFILER.tooltip.1=Ladící Profil +of.options.PROFILER.tooltip.2= ZAPNUTO - ladící profil je aktivní, pomalejší +of.options.PROFILER.tooltip.3= VYPNUTO - ladící profil je neaktivní, rychlejší +of.options.PROFILER.tooltip.4=Ladící profil sbírá a zobrazuje informace když +of.options.PROFILER.tooltip.5=je otevřena ladící obrazovka (F3). + +of.options.WEATHER=Počasí +of.options.WEATHER.tooltip.1=Počasí +of.options.WEATHER.tooltip.2= ZAPNUTO - počasí je aktivní, pomalejší +of.options.WEATHER.tooltip.3= VYPNUTO - počasí je neaktivní, rychlejší +of.options.WEATHER.tooltip.4=Počasí ovládá deště, sněžení a bouřky. +of.options.WEATHER.tooltip.5=Ovládání počasí je možné pouze pro lokální světy. + +of.options.time.dayOnly=Pouze Den +of.options.time.nightOnly=Pouze Noc + +of.options.TIME=Čas +of.options.TIME.tooltip.1=Čas +of.options.TIME.tooltip.2= Výchozí - normální denní/noční cyklus +of.options.TIME.tooltip.3= Pouze Den - pouze den +of.options.TIME.tooltip.4= Pouze Noc - pouze noc +of.options.TIME.tooltip.5=Nastavení času je efektivní jen v KREATIVNíM módu +of.options.TIME.tooltip.6=a pro lokální světy. + +options.fullscreen.tooltip.1=Fullscreen +options.fullscreen.tooltip.2= ZAPNUTO - použít celoobrázkový mód +options.fullscreen.tooltip.3= VYPNUTO - použít mód v okně +options.fullscreen.tooltip.4=Fullscreen mód může být rychlejší nebo pomalejší než +options.fullscreen.tooltip.5=mód v okně, záleží na GPU. + +of.options.FULLSCREEN_MODE=Fullscreen Mód +of.options.FULLSCREEN_MODE.tooltip.1=Celoobrázkový mód +of.options.FULLSCREEN_MODE.tooltip.2= Výchozí - používá hlavní rozlišení, pomalejší +of.options.FULLSCREEN_MODE.tooltip.3= ŠxV - používá vlastní rozlišení, může být rychlejší +of.options.FULLSCREEN_MODE.tooltip.4=Vybrané rozlišení je používáno ve fullscreenu (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Nižší rozlišení by měli být většinou rychlejší. + +of.options.SHOW_FPS=Zobrazit FPS +of.options.SHOW_FPS.tooltip.1=Kompaktně zobrazí informace o FPS a renderu. +of.options.SHOW_FPS.tooltip.2= C: - načítání chunků +of.options.SHOW_FPS.tooltip.3= E: - načtené entity + blokové entity +of.options.SHOW_FPS.tooltip.4= U: - přednačtené chunky +of.options.SHOW_FPS.tooltip.5=Informace o FPS se zobrazí jen, +of.options.SHOW_FPS.tooltip.6=když je ladící obrazovka (F3) zneviditelněná. + +of.options.save.default=Výchozí (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Auto-ukládání +of.options.AUTOSAVE_TICKS.tooltip.1=Interval auto-ukládání +of.options.AUTOSAVE_TICKS.tooltip.2=Výchozí interval auto-ukládání (2s) se NEDOPORUčUJE +of.options.AUTOSAVE_TICKS.tooltip.3=Auto-ukládání způsobuje slavné sekací Smrti (Lag Spikes of Death). + +of.options.SCREENSHOT_SIZE=Velikost Screenshotu +of.options.SCREENSHOT_SIZE.tooltip.1=Velikost Snímku Obrazovky +of.options.SCREENSHOT_SIZE.tooltip.2= Výchozí - výchozí velikost screenshotu +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - vlastním velikost screenshotu +of.options.SCREENSHOT_SIZE.tooltip.4=Focení větších screenshotů může vyžadovat více RAM. +of.options.SCREENSHOT_SIZE.tooltip.5=Není kompatinilní s Rychlým Renderem a Antialiasingem. +of.options.SCREENSHOT_SIZE.tooltip.6=Vyžaduje podporu GPU framebufferu. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/de_DE.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/de_DE.lang new file mode 100644 index 0000000..26cd158 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/de_DE.lang @@ -0,0 +1,629 @@ +# Contributors of German localization # +# ThexXTURBOXx (Collaborator of Reforged) 2016-2-29 ---- 2016-3-3 +# RoiEXLab 2016-3-8 +# violine1101 (German Minecraft Wiki admin) 2016-4-4 ---- 2017-6-7 +# TheHADILP 2016-5-20 ---- 2017-11-19 + +# General +of.general.ambiguous=Unklar +of.general.custom=Anderes +of.general.from=Von +of.general.id=ID +of.general.restart=Neustart +of.general.smart=Fein + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing ist nicht mit Shader-Effekten kompatibel. +of.message.aa.shaders2=Bitte deaktiviere Shader-Effekte, um diese Einstellung zu aktivieren. + +of.message.af.shaders1=Anistropische Filterung ist nicht mit Shader-Effekten kompatibel. +of.message.af.shaders2=Bitte deaktiviere Shader-Effekte, um diese Einstellung zu aktivieren. + +of.message.fr.shaders1=Schnelles Rendern ist nicht mit Shader-Effekten kompatibel. +of.message.fr.shaders2=Bitte deaktiviere Shader-Effekte, um diese Einstellung zu aktivieren. + +of.message.an.shaders1=3D-Effekt ist nicht mit Shader-Effekten kompatibel. +of.message.an.shaders2=Bitte deaktiviere Shader-Effekte, um diese Einstellung zu aktivieren. + +of.message.shaders.aa1=Antialiasing ist nicht mit Shader-Effekten kompatibel. +of.message.shaders.aa2=Bitte deaktiviere Qualität -> Antialiasing und starte das Spiel neu. + +of.message.shaders.af1=Anistropische Filterung ist nicht mit Shader-Effekten kompatibel. +of.message.shaders.af2=Bitte deaktiviere Qualität -> Anistropische Filterung. + +of.message.shaders.fr1=Schnelles Rendern ist nicht mit Shader-Effekten kompatibel. +of.message.shaders.fr2=Bitte deaktiviere Leistung -> Schnelles Rendern. + +of.message.shaders.an1=Shader-Effekte sind nicht mit dem 3D-Effekt kompatibel. +of.message.shaders.an2=Bitte deaktiviere Sonstiges -> 3D-Effekt. + +of.message.newVersion=Eine neue Version von §eOptiFine§f ist verfügbar: §e%s§f +of.message.java64Bit=Du kannst die §e64-bit-Version von Java§f installieren, um die Leistung zu verbessern +of.message.openglError=§eOpenGL-Fehler§f: %s (%s) + +of.message.shaders.loading=Lade Shader-Effekte: %s + +of.message.other.reset=Alle Grafikeinstellungen auf die Standardwerte zurücksetzen? + +of.message.loadingVisibleChunks=Lade sichtbare Chunks + +# Video settings + +options.graphics.tooltip.1=Grafikmodus +options.graphics.tooltip.2= Schnell - Schlechtere Qualität, schneller +options.graphics.tooltip.3= Schön - Höhere Qualität, langsamer +options.graphics.tooltip.4=Verändert das Aussehen von Wolken, Blättern, Wasser, +options.graphics.tooltip.5=Schatten und Grasblöcken. + +of.options.renderDistance.tiny=Mini +of.options.renderDistance.short=Klein +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Weit +of.options.renderDistance.extreme=Extrem + +options.renderDistance.tooltip.1=Sichtweite +options.renderDistance.tooltip.2= 2 Mini - 32m (am schnellsten) +options.renderDistance.tooltip.3= 4 Klein - 64m (schnell) +options.renderDistance.tooltip.4= 8 Normal - 128m +options.renderDistance.tooltip.5= 16 Weit - 256m (langsam) +options.renderDistance.tooltip.6= 32 Extrem - 512m (am langsamsten!) +options.renderDistance.tooltip.7=Die extreme Sichtweite ist sehr ressourcenaufwendig! +options.renderDistance.tooltip.8=Werte über 16 funktionieren nur im Einzelspielermodus. + +options.ao.tooltip.1=Weiche Beleuchtung +options.ao.tooltip.2= Aus - Keine weiche Beleuchtung (schnell) +options.ao.tooltip.3= Minimum - Einfache weiche Beleuchtung (langsam) +options.ao.tooltip.4= Maximum - Komplexe weiche Beleuchtung (am langsamsten) + +options.framerateLimit.tooltip.1=Maximale Bildrate +options.framerateLimit.tooltip.2= V-Sync - Auf Monitor-Bildrate begrenzen (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - Auf eingestellte Bildrate begrenzen +options.framerateLimit.tooltip.4= Unendlich - Keine Begrenzung (am schnellsten) +options.framerateLimit.tooltip.5=Die Bildrate grenzt die FPS ein, sogar wenn +options.framerateLimit.tooltip.6=die Begrenzung nicht erreicht ist. +of.options.framerateLimit.vsync=V-Sync + +of.options.AO_LEVEL=Schattenhelligkeit +of.options.AO_LEVEL.tooltip.1=Schattenhelligkeit +of.options.AO_LEVEL.tooltip.2= Aus - Keine Schatten +of.options.AO_LEVEL.tooltip.3= 50%% - Helle Schatten +of.options.AO_LEVEL.tooltip.4= 100%% - Dunkle Schatten + +options.viewBobbing.tooltip.1=Gehbewegung +options.viewBobbing.tooltip.2=Wenn Mipmaps verwendet werden, deaktiviere diese +options.viewBobbing.tooltip.3=Einstellung für bessere Leitung. + +options.guiScale.tooltip.1=GUI-Größe +options.guiScale.tooltip.2= Auto - Maximale Größe +options.guiScale.tooltip.3= Klein, Normal, Groß - 1x-3x +options.guiScale.tooltip.4= 4x-10x - Verfügbar auf 4K-Monitoren +options.guiScale.tooltip.5=Ungerade Werte (1x, 3x, 5x ...) sind nicht mit +options.guiScale.tooltip.6=Unicode-Schrift kompatibel. +options.guiScale.tooltip.7=Ein kleineres GUI ist eventuell schneller. + +options.vbo.tooltip.1=Vertexbufferobjekte +options.vbo.tooltip.2=Benutzt ein alternatives Rendermodell, das normalerweise +options.vbo.tooltip.3=schneller (5-10%%) als das Standard-Rendermodell ist. + +options.gamma.tooltip.1=Ändert die Helligkeit dunkler Objekte +options.gamma.tooltip.2= Düster - Standardhelligkeit +options.gamma.tooltip.3= 1-99%% - veränderlich +options.gamma.tooltip.4= Hell - Maximale Helligkeit für dunkle Objekte +options.gamma.tooltip.5=Diese Einstellungen ändern nicht die Helligkeit von ganz +options.gamma.tooltip.6=schwarzen Objekten. + +options.anaglyph.tooltip.1=3D-Effekt +options.anaglyph.tooltip.2=Aktiviert einen stereoskopischen 3D-Effekt durch +options.anaglyph.tooltip.3=Verwenden unterschiedlicher Farben für jedes Auge. +options.anaglyph.tooltip.4=Kann nur mit einer Rot-Cyan-Brille benutzt werden. + +options.blockAlternatives.tooltip.1=Blockvarianten +options.blockAlternatives.tooltip.2=Benutzt alternative Blockmodelle für einige Blöcke. +options.blockAlternatives.tooltip.3=Hängt vom ausgewählten Ressourcenpaket ab. + +of.options.ALTERNATE_BLOCKS=Blockvarianten +of.options.ALTERNATE_BLOCKS.tooltip.1=Blockvarianten +of.options.ALTERNATE_BLOCKS.tooltip.2=Benutzt alternative Blockmodelle für einige Blöcke. +of.options.ALTERNATE_BLOCKS.tooltip.3=Abhängig vom ausgewählten Ressourcenpaket. + +of.options.FOG_FANCY=Nebel +of.options.FOG_FANCY.tooltip.1=Nebel +of.options.FOG_FANCY.tooltip.2= Schnell - Schneller Nebel +of.options.FOG_FANCY.tooltip.3= Schön - Langsamer Nebel, sieht besser aus +of.options.FOG_FANCY.tooltip.4= Aus - Kein Nebel, am schnellsten +of.options.FOG_FANCY.tooltip.5=Der schöne Nebel ist nur verfügbar, wenn er von der +of.options.FOG_FANCY.tooltip.6=Grafikkarte unterstützt wird. + +of.options.FOG_START=Nebelstart +of.options.FOG_START.tooltip.1=Nebelstart +of.options.FOG_START.tooltip.2= 0.2 - Der Nebel startet nahe beim Spieler +of.options.FOG_START.tooltip.3= 0.8 - Der Nebel startet weit weg vom Spieler +of.options.FOG_START.tooltip.4=Diese Einstellung beeinflusst normalerweise nicht die +of.options.FOG_START.tooltip.5=Leistung. + +of.options.CHUNK_LOADING=Chunkladen +of.options.CHUNK_LOADING.tooltip.1=Chunkladen +of.options.CHUNK_LOADING.tooltip.2= Standard - Instabile FPS, wenn Chunks geladen werden +of.options.CHUNK_LOADING.tooltip.3= Weich - Stabile FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - Stabile FPS, 3x schnelleres Weltladen +of.options.CHUNK_LOADING.tooltip.5=Weich und Multi-Core entfernen Ruckler und +of.options.CHUNK_LOADING.tooltip.6=Standbilder, welche durch Chunkladen verursacht werden. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core kann das Weltladen 3x schneller machen und +of.options.CHUNK_LOADING.tooltip.8=die FPS erhöhen, indem es einen zweiten CPU-Kern benutzt. +of.options.chunkLoading.smooth=Weich +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shader-Effekte ... +of.options.shadersTitle=Shader-Effekte + +of.options.shaders.packNone=Aus +of.options.shaders.packDefault=(Interner Shader-Effekt) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.NORMAL_MAP=Normale Karte +of.options.shaders.SPECULAR_MAP=Spiegelnde Karte +of.options.shaders.RENDER_RES_MUL=Renderqualität +of.options.shaders.SHADOW_RES_MUL=Schattenqualität +of.options.shaders.HAND_DEPTH_MUL=Handtiefe +of.options.shaders.CLOUD_SHADOW=Wolkenschatten +of.options.shaders.OLD_HAND_LIGHT=Alte Handbel. +of.options.shaders.OLD_LIGHTING=Alte Beleuchtung +of.options.shaders.SHADER_PACK=Shaderpaket + +of.options.shaders.shadersFolder=Shader-Effekt-Ordner +of.options.shaders.shaderOptions=Shadereinstellung ... + +of.options.shaderOptionsTitle=Shader-Effekte + +of.options.quality=Qualität ... +of.options.qualityTitle=Qualitätseinstellungen + +of.options.details=Details ... +of.options.detailsTitle=Detaileinstellungen + +of.options.performance=Leistung ... +of.options.performanceTitle=Leistungseinstellungen + +of.options.animations=Animationen ... +of.options.animationsTitle=Animationseinstellungen + +of.options.other=Sonstiges ... +of.options.otherTitle=Andere Einstellungen + +of.options.other.reset=Grafikeinstellungen zurücksetzen ... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Am nächsten +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Visueller Effekt, der weit entfernte Objekte besser aus- +options.mipmapLevels.tooltip.2=sehen lässt, indem Texturdetails verringert werden. +options.mipmapLevels.tooltip.3= Aus - Keine Verringerung von Details +options.mipmapLevels.tooltip.4= 1 - Minimale Verringerung von Details +options.mipmapLevels.tooltip.5= 4 - Maximale Verringerung von Details +options.mipmapLevels.tooltip.6=Diese Einstellung beeinflusst normalerweise nicht die +options.mipmapLevels.tooltip.7=Leistung. + +of.options.MIPMAP_TYPE=Mipmap-Typ +of.options.MIPMAP_TYPE.tooltip.1=Visueller Effekt, der weit entfernte Objekte besser aus- +of.options.MIPMAP_TYPE.tooltip.2=sehen lässt, indem Texturdetails verringert werden. +of.options.MIPMAP_TYPE.tooltip.3= Am nächsten - Grobe Verringerung (am schnellsten) +of.options.MIPMAP_TYPE.tooltip.4= Linear - Normale Verringerung +of.options.MIPMAP_TYPE.tooltip.5= Bilinear - Feine Verringerung +of.options.MIPMAP_TYPE.tooltip.6= Trilinear - Feinste Verringerung (am langsamsten) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= Aus - (Standard) Kein Antialiasing (schneller) +of.options.AA_LEVEL.tooltip.3= 2-16 - Antialiasierte Linien und Ecken (langsamer) +of.options.AA_LEVEL.tooltip.4=Das Antialiasing weicht gezackte Linien ab und schärft +of.options.AA_LEVEL.tooltip.5=Farbübergänge. Wenn aktiviert, kann es die Bildrate +of.options.AA_LEVEL.tooltip.6=erheblich beeinträchtigen. +of.options.AA_LEVEL.tooltip.7=Nicht alle Stufen werden von allen Grafikkarten unterstützt. +of.options.AA_LEVEL.tooltip.8=Änderung wird erst nach einem Neustart effektiv! + +of.options.AF_LEVEL=Anisotropische Filterung +of.options.AF_LEVEL.tooltip.1=Anisotropische Filterung +of.options.AF_LEVEL.tooltip.2= Aus - (Standard) Standard-Texturdetails (schneller) +of.options.AF_LEVEL.tooltip.3= 2-16 - Feinere Details in Texturen (langsamer) +of.options.AF_LEVEL.tooltip.4=Die anisotropische Filterung stellt Details in Texturen, +of.options.AF_LEVEL.tooltip.5=die durch Mipmap ihre Details verloren haben, wieder her. +of.options.AF_LEVEL.tooltip.6=Wenn aktiviert, kann es die FPS erheblich verringern. + +of.options.CLEAR_WATER=Klares Wasser +of.options.CLEAR_WATER.tooltip.1=Klares Wasser +of.options.CLEAR_WATER.tooltip.2= An - Klares, transparentes Wasser +of.options.CLEAR_WATER.tooltip.3= Aus - Normales Wasser + +of.options.RANDOM_MOBS=Kreaturvarianten +of.options.RANDOM_MOBS.tooltip.1=Kreaturvarianten +of.options.RANDOM_MOBS.tooltip.2= Aus - Keine Kreaturvarianten, schneller +of.options.RANDOM_MOBS.tooltip.3= An - Keine Kreaturvarianten, langsamer +of.options.RANDOM_MOBS.tooltip.4=Die gleichen Kreaturen können unterschiedliche Texturen +of.options.RANDOM_MOBS.tooltip.5=haben. Dies benötigt ein Ressourcenpaket mit entspre- +of.options.RANDOM_MOBS.tooltip.6=chenden Texturen. + +of.options.BETTER_GRASS=Besseres Gras +of.options.BETTER_GRASS.tooltip.1=Besseres Gras +of.options.BETTER_GRASS.tooltip.2= Aus - Standard-Grasseitentextur, am schnellsten +of.options.BETTER_GRASS.tooltip.3= Schnell - Volle Grasseitentextur, langsamer +of.options.BETTER_GRASS.tooltip.4= Schön - Dynamische Grasseitentextur, am langsamsten + +of.options.BETTER_SNOW=Besserer Schnee +of.options.BETTER_SNOW.tooltip.1=Besserer Schnee +of.options.BETTER_SNOW.tooltip.2= Aus - Normaler Schnee, schneller +of.options.BETTER_SNOW.tooltip.3= An - Besserer Schnee, langsamer +of.options.BETTER_SNOW.tooltip.4=Setzt Schnee unter transparente Blöcke (wie Zäune +of.options.BETTER_SNOW.tooltip.5=oder hohes Gras), wenn sie an Schneeblöcke grenzen. + +of.options.CUSTOM_FONTS=Schriftartressourcen +of.options.CUSTOM_FONTS.tooltip.1=Schriftartressourcen +of.options.CUSTOM_FONTS.tooltip.2= An - Ressourcenpaket-Schriftart (Standard), langsamer +of.options.CUSTOM_FONTS.tooltip.3= Aus - Standardschriftart, schneller +of.options.CUSTOM_FONTS.tooltip.4=Die Schriftart wird aus den aktivierten Ressourcenpaketen +of.options.CUSTOM_FONTS.tooltip.5=geladen. + +of.options.CUSTOM_COLORS=Farbressourcen +of.options.CUSTOM_COLORS.tooltip.1=Farbressourcen +of.options.CUSTOM_COLORS.tooltip.2= An - Ressourcenpaket-Farben (Standard), langsamer +of.options.CUSTOM_COLORS.tooltip.3= Aus - Standardfarben, schneller +of.options.CUSTOM_COLORS.tooltip.4=Die Farben werden aus den aktivierten Ressourcenpaketen +of.options.CUSTOM_COLORS.tooltip.5=geladen. + +of.options.SWAMP_COLORS=Sumpffarben +of.options.SWAMP_COLORS.tooltip.1=Sumpffarben +of.options.SWAMP_COLORS.tooltip.2= An - Färbt den Sumpf dunkler (Standard), langsamer +of.options.SWAMP_COLORS.tooltip.3= Aus - Färbt den Sumpf in normalen Farben, schneller +of.options.SWAMP_COLORS.tooltip.4=Die Sumpffarben betreffen Gras, Laub, Ranken und +of.options.SWAMP_COLORS.tooltip.5=Wasser. + +of.options.SMOOTH_BIOMES=Biomübergänge +of.options.SMOOTH_BIOMES.tooltip.1=Biomübergänge +of.options.SMOOTH_BIOMES.tooltip.2= An - Flüssige Biomübergänge (Standard), langsamer +of.options.SMOOTH_BIOMES.tooltip.3= Aus - Keine flüssigen Biomübergänge, schneller +of.options.SMOOTH_BIOMES.tooltip.4=Die Farbübergänge werden durch Probennahme und +of.options.SMOOTH_BIOMES.tooltip.5=Durchschnittsberechnung der Farben der umliegenden +of.options.SMOOTH_BIOMES.tooltip.6=Blöcke berechnet. Betroffen sind Gras, Laub, Ranken und +of.options.SMOOTH_BIOMES.tooltip.7=Wasser. + +of.options.CONNECTED_TEXTURES=Verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.1=Verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.2= Aus - Keine verbundenen Texturen (Standard) +of.options.CONNECTED_TEXTURES.tooltip.3= Schnell - Schnelle verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.4= Schöne - Schöne verbundene Texturen +of.options.CONNECTED_TEXTURES.tooltip.5=Verbundene Texturen verbinden die Texturen von Glas, +of.options.CONNECTED_TEXTURES.tooltip.6=Sandstein und Bücherregalen, wenn sie nebeneinander +of.options.CONNECTED_TEXTURES.tooltip.7=platziert werden. Die verbundenen Texturen werden aus +of.options.CONNECTED_TEXTURES.tooltip.8=den aktivierten Ressourcenpaketen geladen. + +of.options.EMISSIVE_TEXTURES=Leuchtende Texturen +of.options.EMISSIVE_TEXTURES.tooltip.1=Leuchtende Texturen +of.options.EMISSIVE_TEXTURES.tooltip.2= Aus - Keine lichtemittierenden Texturen (Standard) +of.options.EMISSIVE_TEXTURES.tooltip.3= An - Lichtemittierende Texturen +of.options.EMISSIVE_TEXTURES.tooltip.4=Die lichtemittierenden Texturen werden als Overlays mit +of.options.EMISSIVE_TEXTURES.tooltip.5=voller Helligkeit gerendert. Dadurch können leuchtende +of.options.EMISSIVE_TEXTURES.tooltip.6=Bereiche der Grund-Textur simuliert werden. +of.options.EMISSIVE_TEXTURES.tooltip.7=Die lichtemittierendenTexturen werden aus den +of.options.EMISSIVE_TEXTURES.tooltip.8=aktivierten Ressourcenpaketen geladen. + +of.options.NATURAL_TEXTURES=Natürliche Texturen +of.options.NATURAL_TEXTURES.tooltip.1=Natürliche Texturen +of.options.NATURAL_TEXTURES.tooltip.2= Aus - Keine natürlichen Texturen (Standard) +of.options.NATURAL_TEXTURES.tooltip.3= An - Benutzt natürliche Texturen +of.options.NATURAL_TEXTURES.tooltip.4=Natürliche Texturen entfernen die rasterartige Anordnung, +of.options.NATURAL_TEXTURES.tooltip.5=erzeugt durch Platzieren gleicher Blöcke. Dies benutzt +of.options.NATURAL_TEXTURES.tooltip.6=gedrehte und umgekehrte Varianten der Standard- +of.options.NATURAL_TEXTURES.tooltip.7=Blocktextur. Die Einstellungen für die natürlichen Texturen +of.options.NATURAL_TEXTURES.tooltip.8=werden aus den aktivierten Ressourcenpaketen geladen. + +of.options.CUSTOM_SKY=Himmelstexturen +of.options.CUSTOM_SKY.tooltip.1=Himmelstexturen +of.options.CUSTOM_SKY.tooltip.2= An - Ressourcenpaket-Himmel (Standard), langsam +of.options.CUSTOM_SKY.tooltip.3= Aus - Standardhimmel, schneller +of.options.CUSTOM_SKY.tooltip.4=Die Himmelstexturen werden aus den aktivierten +of.options.CUSTOM_SKY.tooltip.5=Ressourcenpaketen geladen. + +of.options.CUSTOM_ITEMS=Gegenstandstexturen +of.options.CUSTOM_ITEMS.tooltip.1=Gegenstandstexturen +of.options.CUSTOM_ITEMS.tooltip.2= An - Ressourcenpaket-G.texturen (Standard), langsam +of.options.CUSTOM_ITEMS.tooltip.3= Aus - Standard-Gegenstandstexturen, schneller +of.options.CUSTOM_ITEMS.tooltip.4=Die Gegenstandstexturen werden aus den aktivierten +of.options.CUSTOM_ITEMS.tooltip.5=Ressourcenpaketen geladen. + +of.options.CUSTOM_ENTITY_MODELS=Wesens- & Objektmodelle +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Wesens- und Objektmodelle +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= An - Ressourcenpaketmodelle (Standard), langsam +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Aus - Standardmodelle, schneller +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Die Wesens- und Objektmodelle werden aus den +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=aktivierten Ressourcenpaketen geladen. + +of.options.CUSTOM_GUIS=Ressourcenpaket-GUI +of.options.CUSTOM_GUIS.tooltip.1=Ressourcenpaket-GUI +of.options.CUSTOM_GUIS.tooltip.2= An - Ressourcenpaket-GUI (Standard), langsam +of.options.CUSTOM_GUIS.tooltip.3= Aus - Standard GUI, schneller +of.options.CUSTOM_GUIS.tooltip.4=Das GUI wird aus den aktivierten Ressourcenpaketen +of.options.CUSTOM_GUIS.tooltip.5=geladen. + +# Details + +of.options.CLOUDS=Wolken +of.options.CLOUDS.tooltip.1=Wolken +of.options.CLOUDS.tooltip.2= Standard - Wie Grafikmodus +of.options.CLOUDS.tooltip.3= Schnell - Schlechtere Qualität, schneller +of.options.CLOUDS.tooltip.4= Schön - Höhere Qualität, langsamer +of.options.CLOUDS.tooltip.5= Aus - Keine Wolken, am schnellsten +of.options.CLOUDS.tooltip.6=Schnelle Wolken werden zweidimensional dargestellt. +of.options.CLOUDS.tooltip.7=Schöne Wolken werden dreidimensional dargestellt. + +of.options.CLOUD_HEIGHT=Wolkenhöhe +of.options.CLOUD_HEIGHT.tooltip.1=Wolkenhöhe +of.options.CLOUD_HEIGHT.tooltip.2= Aus - Standardhöhe +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - Über der maximalen Welthöhe + +of.options.TREES=Bäume +of.options.TREES.tooltip.1=Bäume +of.options.TREES.tooltip.2= Standard - Wie Grafikmodus +of.options.TREES.tooltip.3= Schnell - Schlechtere Qualität, schneller +of.options.TREES.tooltip.4= Fein - Hohe Qualität, schnell +of.options.TREES.tooltip.5= Schön - Höchste Qualität, langsamer +of.options.TREES.tooltip.6=Schnelle Bäume haben solide Blätter. +of.options.TREES.tooltip.7=Schöne Bäume haben teilweise transparente Blätter. + +of.options.RAIN=Regen & Schnee +of.options.RAIN.tooltip.1=Regen & Schnee +of.options.RAIN.tooltip.2= Standard - Wie Grafikmodus +of.options.RAIN.tooltip.3= Schnell - Leichter Regen/Schnee, schneller +of.options.RAIN.tooltip.4= Schön - Starker Regen/Schnee, langsamer +of.options.RAIN.tooltip.5= Aus - Kein Regen/Schnee, am schnellsten +of.options.RAIN.tooltip.6=Wenn diese Einstellung deaktiviert ist, sind die Regen- +of.options.RAIN.tooltip.7=geräusche und -partikel dennoch zu hören bzw. zu sehen. + +of.options.SKY=Himmel +of.options.SKY.tooltip.1=Himmel +of.options.SKY.tooltip.2= An - Himmel ist sichtbar, langsamer +of.options.SKY.tooltip.3= Aus - Himmel ist nicht sichtbar, schneller +of.options.SKY.tooltip.4=Wenn dies deaktiviert ist, sind Mond und Sonne dennoch +of.options.SKY.tooltip.5=sichtbar. + +of.options.STARS=Sterne +of.options.STARS.tooltip.1=Sterne +of.options.STARS.tooltip.2= An - Sterne sind sichtbar, langsamer +of.options.STARS.tooltip.3= Aus - Sterne ist nicht sichtbar, schneller + +of.options.SUN_MOON=Sonne & Mond +of.options.SUN_MOON.tooltip.1=Sonne & Mond +of.options.SUN_MOON.tooltip.2= An - Sonne und Mond sind sichtbar (Standard) +of.options.SUN_MOON.tooltip.3= Aus - Sonne und Mond sind nicht sichtbar (schneller) + +of.options.SHOW_CAPES=Umhänge +of.options.SHOW_CAPES.tooltip.1=Umhänge +of.options.SHOW_CAPES.tooltip.2= An - Umhänge werden dargestellt (Standard) +of.options.SHOW_CAPES.tooltip.3= Aus - Umhänge werden nicht dargestellt + +of.options.TRANSLUCENT_BLOCKS=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Schön - Korrekte Farbmischung (Standard) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Schnell - Schnelle Farbmischung (schnell) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Kontrolliert die Farbmischung von transparenten Blöcken +of.options.TRANSLUCENT_BLOCKS.tooltip.5=mit verschiedenen Farben (Gefärbtes Glas, Wasser, Eis), +of.options.TRANSLUCENT_BLOCKS.tooltip.6=wenn sie hintereinander mit Luft dazwischen platziert +of.options.TRANSLUCENT_BLOCKS.tooltip.7=werden. + +of.options.HELD_ITEM_TOOLTIPS=Gegenstandsbeschr. +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Gegenstandsbeschreibung +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= An - Zeige Gegenstandsbeschreibung (Standard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Aus - Zeige keine Gegenstandsbeschreibung +of.options.HELD_ITEM_TOOLTIPS.tooltip.4=Wird über der Schnellzugriffsleiste angezeigt. + +of.options.ADVANCED_TOOLTIPS=Erweiterte Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.1=Erweiterte Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.2= An - Zeige erweiterte Schnellinfo +of.options.ADVANCED_TOOLTIPS.tooltip.3= Aus - Keine erweiterte Schnellinfo (Standard) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Zeigt ausführliche Informationen über Gegenstände +of.options.ADVANCED_TOOLTIPS.tooltip.5=(ID, Haltbarkeit) und Shader Einstellungen (ID, Quelle, +of.options.ADVANCED_TOOLTIPS.tooltip.6=Standardwert) an. + +of.options.DROPPED_ITEMS=Gegenstände +of.options.DROPPED_ITEMS.tooltip.1=Liegende Gegenstände +of.options.DROPPED_ITEMS.tooltip.2= Standard - Wie Grafikmodus +of.options.DROPPED_ITEMS.tooltip.3= Schnell - Zweidimensionale Animation, schneller +of.options.DROPPED_ITEMS.tooltip.4= Schön - Dreidimensionale Animation, langsamer + +options.entityShadows.tooltip.1=Objektschatten +options.entityShadows.tooltip.2= An - Zeige Objektschatten +options.entityShadows.tooltip.3= Aus - Zeige keine Objektschatten + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Visueller Effekt, der die Bildschirmecken abdunkelt +of.options.VIGNETTE.tooltip.2= Standard - Wie Grafikmodus (Standard) +of.options.VIGNETTE.tooltip.3= Schnell - Vignette deaktiviert (schneller) +of.options.VIGNETTE.tooltip.4= Schön - Vignette aktiviert (langsamer) +of.options.VIGNETTE.tooltip.5=Die Vignette kann sich extrem auf die Leistung auswirken, +of.options.VIGNETTE.tooltip.6=besonders im Vollbildschirmmodus. +of.options.VIGNETTE.tooltip.7=Der Vignetteneffekt ist fast unmerklich und kann sicher +of.options.VIGNETTE.tooltip.8=deaktiviert werden. + +of.options.DYNAMIC_FOV=Dynamisches Sichtfeld +of.options.DYNAMIC_FOV.tooltip.1=Dynamisches Sichtfeld +of.options.DYNAMIC_FOV.tooltip.2= An - Dynamisches Sichtfeld aktivieren (Standard) +of.options.DYNAMIC_FOV.tooltip.3= Aus - Dynamisches Sichtfeld ausschalten +of.options.DYNAMIC_FOV.tooltip.4=Ändert das Sichtfeld beim Fliegen, Sprinten oder beim +of.options.DYNAMIC_FOV.tooltip.5=Spannen eines Bogens. + +of.options.DYNAMIC_LIGHTS=Dyn. Beleuchtung +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamische Beleuchtung +of.options.DYNAMIC_LIGHTS.tooltip.2= Aus - Keine dynamische Beleuchtung (Standard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Schnell - Schnelle dyn. Beleuchtung (alle 500ms aktual.) +of.options.DYNAMIC_LIGHTS.tooltip.4= Schön - Schöne dyn. Beleuchtung (Echtzeitaktual.) +of.options.DYNAMIC_LIGHTS.tooltip.5=Leuchtende Gegenstände (Fackel, Glowstone, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=beleuchten die Umgebung, wenn sie in der Hand gehalten, +of.options.DYNAMIC_LIGHTS.tooltip.7=von anderen Spielern ausgerüstet oder gedroppt werden. + +# Performance + +of.options.SMOOTH_FPS=Stabile Bildrate +of.options.SMOOTH_FPS.tooltip.1=Stabilisiert Bildrate durch Grafiktreiberpuffer +of.options.SMOOTH_FPS.tooltip.2= Aus - Keine Stabilisierung, Bildrate könnte schwanken +of.options.SMOOTH_FPS.tooltip.3= An - Stabilisierung der Bildrate +of.options.SMOOTH_FPS.tooltip.4=Diese Einstellung ist abhängig vom Grafikkartentreiber. +of.options.SMOOTH_FPS.tooltip.5=Eine Wirkung ist nicht immer spürbar. + +of.options.SMOOTH_WORLD=Weltstabilisierung +of.options.SMOOTH_WORLD.tooltip.1=Entfernt vom internen Server verursachte starke Lags +of.options.SMOOTH_WORLD.tooltip.2= Aus - Keine Stabilisierung, Bildrate könnte schwanken +of.options.SMOOTH_WORLD.tooltip.3= An - Weltstabilisierung aktiviert +of.options.SMOOTH_WORLD.tooltip.4=Stabilisiert die Bildrate, indem die interne Server- +of.options.SMOOTH_WORLD.tooltip.5=auslastung aufgeteilt wird. +of.options.SMOOTH_WORLD.tooltip=6=Funktioniert nur im Einzelspielermodus. + +of.options.FAST_RENDER=Schnelles Rendern +of.options.FAST_RENDER.tooltip.1=Schnelles Rendern +of.options.FAST_RENDER.tooltip.2= Aus - Standard-Rendern (Standard) +of.options.FAST_RENDER.tooltip.3= An - Optimiertes Rendern (schneller) +of.options.FAST_RENDER.tooltip.4=Benutzt optimierte Renderalgorithmen, die die GPU-Aus- +of.options.FAST_RENDER.tooltip.5=lastung verringern und die Leistung erheblich steigern. + +of.options.FAST_MATH=Schnelle Mathematik +of.options.FAST_MATH.tooltip.1=Schnelle Mathematik +of.options.FAST_MATH.tooltip.2= Aus - Standard-Mathematik (Standard) +of.options.FAST_MATH.tooltip.3= An - Schnellere Mathematik +of.options.FAST_MATH.tooltip.4=Benutzt optimierte Sinus- und Kosinusfunktionen, die den +of.options.FAST_MATH.tooltip.5=CPU-Zwischenspeicher besser nutzen und die Leistung +of.options.FAST_MATH.tooltip.6=steigern. + +of.options.CHUNK_UPDATES=Chunk-Aktualisierungen +of.options.CHUNK_UPDATES.tooltip.1=Chunk-Aktualisierungen +of.options.CHUNK_UPDATES.tooltip.2= 1 - Langsameres Weltladen, höhere Bildrate (Standard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - Schnelleres Weltladen, niedrigere Bildrate +of.options.CHUNK_UPDATES.tooltip.4= 5 - Schnellstes Weltladen, niedrigste Bildrate +of.options.CHUNK_UPDATES.tooltip.5=Zahl an Chunk-Aktualisierungen pro gerendertem Bild. +of.options.CHUNK_UPDATES.tooltip.6=Höhere Werte könnten die Bildrate destabilisieren. + +of.options.CHUNK_UPDATES_DYNAMIC=Dyn. Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamische Chunk-Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Aus - (Standard) Normale Chunk-Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= An - Mehr Chunk-Aktualisierungen +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Wenn diese Einstellung aktiviert ist, werden mehr Chunk- +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=Aktualisierungen ausgeführt, während der Spieler still +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=steht, um die Welt schneller zu laden. + +of.options.LAZY_CHUNK_LOADING=Träges Chunkladen +of.options.LAZY_CHUNK_LOADING.tooltip.1=Träges Chunkladen +of.options.LAZY_CHUNK_LOADING.tooltip.2= Aus - Standard-Server-Chunkladen +of.options.LAZY_CHUNK_LOADING.tooltip.3= An - Träges Server-Chunkladen (flüssiger) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Server-Chunkladen wird flüssiger, indem die Chunks über +of.options.LAZY_CHUNK_LOADING.tooltip.5=ein paar Ticks hinweg geladen werden. Deaktiviere dies, +of.options.LAZY_CHUNK_LOADING.tooltip.6=wenn Teile der Welt nicht korrekt geladen werden. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Nur im Einzelspielermodus effektiv. + +# Animations + +of.options.animation.allOn=Alle an +of.options.animation.allOff=Alle aus +of.options.animation.dynamic=Dynamisch + +of.options.ANIMATED_WATER=Animiertes Wasser +of.options.ANIMATED_LAVA=Animierte Lava +of.options.ANIMATED_FIRE=Animiertes Feuer +of.options.ANIMATED_PORTAL=Animierte Portale +of.options.ANIMATED_REDSTONE=Animiertes Redstone +of.options.ANIMATED_EXPLOSION=Animierte Explosion +of.options.ANIMATED_FLAME=Animierte Flammen +of.options.ANIMATED_SMOKE=Animierter Rauch +of.options.VOID_PARTICLES=Leerepartikel +of.options.WATER_PARTICLES=Wasserpartikel +of.options.RAIN_SPLASH=Regengeplätscher +of.options.PORTAL_PARTICLES=Portalpartikel +of.options.POTION_PARTICLES=Trankpartikel +of.options.DRIPPING_WATER_LAVA=Wasser- & Lavatropfen +of.options.ANIMATED_TERRAIN=Animiertes Gelände +of.options.ANIMATED_TEXTURES=Animierte Texturen +of.options.FIREWORK_PARTICLES=Feuerwerkspartikel + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Zeigt das Lagometer auf dem Debugbildschirm (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Speichermüllsammlung +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Blau - Geplante Ausführungen +of.options.LAGOMETER.tooltip.5=* Lila - Chunks hochladen +of.options.LAGOMETER.tooltip.6=* Rot - Chunkaktualisierungen +of.options.LAGOMETER.tooltip.7=* Gelb - Sichtbarkeitstest +of.options.LAGOMETER.tooltip.8=* Grün - Gelände rendern + +of.options.PROFILER=Debug-Diagramm +of.options.PROFILER.tooltip.1=Debug-Diagramm +of.options.PROFILER.tooltip.2= An - Debug-Diagramm ist aktiviert, langsamer +of.options.PROFILER.tooltip.3= Aus - Debug-Diagramm ist nicht aktiviert, schneller +of.options.PROFILER.tooltip.4=Das Debug-Diagramm sammelt und stellt Debuginforma- +of.options.PROFILER.tooltip.5=tionen dar, wenn der Debugbildschirm geöffnet ist (F3). + +of.options.WEATHER=Wetter +of.options.WEATHER.tooltip.1=Wetter +of.options.WEATHER.tooltip.2= An - Wetter ist aktiv, langsamer +of.options.WEATHER.tooltip.3= Aus - Wetter ist nicht aktiv, schneller +of.options.WEATHER.tooltip.4=Das Wetter kontrolliert Regen, Schnee und Gewitter. +of.options.WEATHER.tooltip.5=Wetterkontrolle ist nur im Einzelspielermodus möglich. + +of.options.time.dayOnly=Nur Tag +of.options.time.nightOnly=Nur Nacht + +of.options.TIME=Zeit +of.options.TIME.tooltip.1=Zeit +of.options.TIME.tooltip.2= Standard - Normaler Tag-Nacht-Zyklus +of.options.TIME.tooltip.3= Nur Tag - Nur Tag +of.options.TIME.tooltip.4= Nur Nacht - Nur Nacht +of.options.TIME.tooltip.5=Diese Einstellung ist nur im Kreativmodus und +of.options.TIME.tooltip.6=im Einzelspielermodus wirksam. + +options.fullscreen.tooltip.1=Vollbildschirm +options.fullscreen.tooltip.2= An - Benutze Vollbildschirmmodus +options.fullscreen.tooltip.3= Aus - Benutze Fenstermodus +options.fullscreen.tooltip.4=Der Vollbildschirmmodus könnte schneller oder langsamer +options.fullscreen.tooltip.5=als der Fenstermodus sein, das kommt auf die Grafik- +options.fullscreen.tooltip.6=karte an. + +of.options.FULLSCREEN_MODE=Vollbild-Auflösung +of.options.FULLSCREEN_MODE.tooltip.1=Vollbild-Auflösung +of.options.FULLSCREEN_MODE.tooltip.2= Standard - Benutze Bildschirmauflösung, langsamer +of.options.FULLSCREEN_MODE.tooltip.3= BxH - Benutze andere Auflösung, könnte schneller sein +of.options.FULLSCREEN_MODE.tooltip.4=Die ausgewählte Auflösung wird im Vollbildschirmmodus +of.options.FULLSCREEN_MODE.tooltip.5=verwendet (F11). Kleinere Auflösungen sollten generell +of.options.FULLSCREEN_MODE.tooltip.6=schneller sein. + +of.options.SHOW_FPS=Bildrate anzeigen +of.options.SHOW_FPS.tooltip.1=Zeige kurze Bildrate- und Render-Informationen +of.options.SHOW_FPS.tooltip.2= C: - Chunkrenderer +of.options.SHOW_FPS.tooltip.3= E: - Objektrenderer + Blockrenderer +of.options.SHOW_FPS.tooltip.4= U: - Chunk-Aktualisierungen +of.options.SHOW_FPS.tooltip.5=Die Bildrate-Informationen werden nur gezeigt, wenn der +of.options.SHOW_FPS.tooltip.6=Debugbildschirm (F3) nicht sichtbar ist. + +of.options.save.default=Standard (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autospeichern +of.options.AUTOSAVE_TICKS.tooltip.1=Autospeicherintervall +of.options.AUTOSAVE_TICKS.tooltip.2=Normales Autospeicherintervall (2s) ist NICHT EMPFOHLEN. +of.options.AUTOSAVE_TICKS.tooltip.3=Autospeichern verursacht den berühmten Lag des Todes. + +of.options.SCREENSHOT_SIZE=Screenshot-Größe +of.options.SCREENSHOT_SIZE.tooltip.1=Screenshot-Auflösung +of.options.SCREENSHOT_SIZE.tooltip.2= Standard - Standard-Screenshot-Auflösung +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - Benutzerdefinierte Screenshot-Auflösung +of.options.SCREENSHOT_SIZE.tooltip.4=Das Aufnehmen größerer Screenshots kann mehr +of.options.SCREENSHOT_SIZE.tooltip.5=Speicher benötigen. +of.options.SCREENSHOT_SIZE.tooltip.6=Nicht kompatibel mit Schnellem Rendern und Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.7=Erfordert Grafiktreiberpuffer-Unterstützung. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/en_GB.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/en_GB.lang new file mode 100644 index 0000000..c506e51 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/en_GB.lang @@ -0,0 +1,36 @@ +# Video Settings + +options.anaglyph.tooltip.2=Enables a stereoscopic 3D effect using different colours + +# Quality + +of.options.AA_LEVEL.tooltip.5=sharp colour transitions. + +of.options.CUSTOM_COLORS=Custom Colours +of.options.CUSTOM_COLORS.tooltip.1=Custom Colours +of.options.CUSTOM_COLORS.tooltip.2= ON - uses custom colours (default), slower +of.options.CUSTOM_COLORS.tooltip.3= OFF - uses default colours, faster +of.options.CUSTOM_COLORS.tooltip.4=The custom colours are supplied by the current +of.options.CUSTOM_COLORS.tooltip.5=resource pack + +of.options.SWAMP_COLORS=Swamp Colours +of.options.SWAMP_COLORS.tooltip.1=Swamp Colours +of.options.SWAMP_COLORS.tooltip.2= ON - use swamp colours (default), slower +of.options.SWAMP_COLORS.tooltip.3= OFF - do not use swamp colours, faster +of.options.SWAMP_COLORS.tooltip.4=The swamp colours affect grass, leaves, vines and water. + +of.options.SMOOTH_BIOMES.tooltip.5=averaging the colour of all surrounding blocks. + +# Details + +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Fancy - correct colour blending (default) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Fast - fast colour blending (faster) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controls the colour blending of translucent blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.5=with different colour (stained glass, water, ice) + +# Performance + +of.options.FAST_MATH=Fast Maths +of.options.FAST_MATH.tooltip.1=Fast Maths +of.options.FAST_MATH.tooltip.2= OFF - standard maths (default) +of.options.FAST_MATH.tooltip.3= ON - faster maths \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/en_US.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/en_US.lang new file mode 100644 index 0000000..0224d3f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/en_US.lang @@ -0,0 +1,671 @@ +# General +of.general.ambiguous=ambiguous +of.general.custom=Custom +of.general.from=From +of.general.id=Id +of.general.restart=restart +of.general.smart=Smart + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing is not compatible with Shaders. +of.message.aa.shaders2=Please disable Shaders to enable this option. + +of.message.af.shaders1=Anisotropic Filtering is not compatible with Shaders. +of.message.af.shaders2=Please disable Shaders to enable this option. + +of.message.fr.shaders1=Fast Render is not compatible with Shaders. +of.message.fr.shaders2=Please disable Shaders to enable this option. + +of.message.an.shaders1=3D Anaglyph is not compatible with Shaders. +of.message.an.shaders2=Please disable Shaders to enable this option. + +of.message.shaders.aa1=Shaders are not compatible with Antialiasing. +of.message.shaders.aa2=Please set Quality -> Antialiasing to OFF and restart the game. + +of.message.shaders.af1=Shaders are not compatible with Anisotropic Filtering. +of.message.shaders.af2=Please set Quality -> Anisotropic Filtering to OFF. + +of.message.shaders.fr1=Shaders are not compatible with Fast Render. +of.message.shaders.fr2=Please set Performance -> Fast Render to OFF. + +of.message.shaders.an1=Shaders are not compatible with 3D Anaglyph. +of.message.shaders.an2=Please set Other -> 3D Anaglyph to OFF. + +of.message.newVersion=A new §eOptiFine§f version is available: §e%s§f +of.message.java64Bit=You can install §e64-bit Java§f to increase performance. +of.message.openglError=§eOpenGL Error§f: %s (%s) + +of.message.shaders.loading=Loading shaders: %s + +of.message.other.reset=Reset all video settings to their default values? + +of.message.loadingVisibleChunks=Loading visible chunks + +# Video settings + +options.graphics.tooltip.1=Visual quality +options.graphics.tooltip.2= Fast - lower quality, faster +options.graphics.tooltip.3= Fancy - higher quality, slower +options.graphics.tooltip.4=Changes the appearance of clouds, leaves, water, +options.graphics.tooltip.5=shadows and grass sides. + +of.options.renderDistance.extreme=Extreme + +options.renderDistance.tooltip.1=Visible distance +options.renderDistance.tooltip.2= 2 Tiny - 32m (fastest) +options.renderDistance.tooltip.3= 4 Short - 64m (faster) +options.renderDistance.tooltip.4= 8 Normal - 128m +options.renderDistance.tooltip.5= 16 Far - 256m (slower) +options.renderDistance.tooltip.6= 32 Extreme - 512m (slowest!) +options.renderDistance.tooltip.7=The Extreme view distance is very resource demanding! +options.renderDistance.tooltip.8=Values over 16 Far are only effective in local worlds. + +options.ao.tooltip.1=Smooth lighting +options.ao.tooltip.2= OFF - no smooth lighting (faster) +options.ao.tooltip.3= Minimum - simple smooth lighting (slower) +options.ao.tooltip.4= Maximum - complex smooth lighting (slowest) + +options.framerateLimit.tooltip.1=Max framerate +options.framerateLimit.tooltip.2= VSync - limit to monitor framerate (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variable +options.framerateLimit.tooltip.4= Unlimited - no limit (fastest) +options.framerateLimit.tooltip.5=The framerate limit decreases the FPS even if +options.framerateLimit.tooltip.6=the limit value is not reached. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Smooth Lighting Level +of.options.AO_LEVEL.tooltip.1=Smooth lighting level +of.options.AO_LEVEL.tooltip.2= OFF - no shadows +of.options.AO_LEVEL.tooltip.3= 50%% - light shadows +of.options.AO_LEVEL.tooltip.4= 100%% - dark shadows + +options.viewBobbing.tooltip.1=More realistic movement. +options.viewBobbing.tooltip.2=When using mipmaps set it to OFF for best results. + +options.guiScale.tooltip.1=GUI Scale +options.guiScale.tooltip.2= Auto - maximal size +options.guiScale.tooltip.3= Small, Normal, Large - 1x to 3x +options.guiScale.tooltip.4= 4x to 10x - available on 4K displays +options.guiScale.tooltip.5=Odd values (1x, 3x, 5x ...) are not compatible with Unicode. +options.guiScale.tooltip.6=A smaller GUI may be faster. + +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Uses an alternative rendering model which is usually +options.vbo.tooltip.3=faster (5-10%%) than the default rendering. + +options.gamma.tooltip.1=Changes the brightness of darker objects. +options.gamma.tooltip.2= Moody - standard brightness +options.gamma.tooltip.3= 1-99%% - variable +options.gamma.tooltip.4= Bright - maximum brightness for darker objects +options.gamma.tooltip.5=This option does not change the brightness of +options.gamma.tooltip.6=fully black objects. + +options.anaglyph.tooltip.1=3D Anaglyph +options.anaglyph.tooltip.2=Enables a stereoscopic 3D effect using different colors +options.anaglyph.tooltip.3=for each eye. +options.anaglyph.tooltip.4=Requires red-cyan glasses for proper viewing. + +options.blockAlternatives.tooltip.1=Alternate Blocks +options.blockAlternatives.tooltip.2=Uses alternative block models for some blocks. +options.blockAlternatives.tooltip.3=Depends on the selected resource pack. + +of.options.ALTERNATE_BLOCKS=Alternate Blocks +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternate Blocks +of.options.ALTERNATE_BLOCKS.tooltip.2=Uses alternative block models for some blocks. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depends on the selected resource pack. + +of.options.FOG_FANCY=Fog +of.options.FOG_FANCY.tooltip.1=Fog type +of.options.FOG_FANCY.tooltip.2= Fast - faster fog +of.options.FOG_FANCY.tooltip.3= Fancy - slower fog, looks better +of.options.FOG_FANCY.tooltip.4= OFF - no fog, fastest +of.options.FOG_FANCY.tooltip.5=The fancy fog is available only if it is supported by the +of.options.FOG_FANCY.tooltip.6=graphic card. + +of.options.FOG_START=Fog Start +of.options.FOG_START.tooltip.1=Fog start +of.options.FOG_START.tooltip.2= 0.2 - the fog starts near the player +of.options.FOG_START.tooltip.3= 0.8 - the fog starts far from the player +of.options.FOG_START.tooltip.4=This option usually does not affect the performance. + +of.options.CHUNK_LOADING=Chunk Loading +of.options.CHUNK_LOADING.tooltip.1=Chunk Loading +of.options.CHUNK_LOADING.tooltip.2= Default - unstable FPS when loading chunks +of.options.CHUNK_LOADING.tooltip.3= Smooth - stable FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - stable FPS, 3x faster world loading +of.options.CHUNK_LOADING.tooltip.5=Smooth and Multi-Core remove the stuttering and +of.options.CHUNK_LOADING.tooltip.6=freezes caused by chunk loading. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core can speed up 3x the world loading and +of.options.CHUNK_LOADING.tooltip.8=increase FPS by using a second CPU core. +of.options.chunkLoading.smooth=Smooth +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=OFF +of.options.shaders.packDefault=(internal) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.1=Antialiasing +of.options.shaders.ANTIALIASING.tooltip.2= OFF - (default) no antialiasing (faster) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - antialiased lines and edges (slower) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA is a post-processing effect which smooths +of.options.shaders.ANTIALIASING.tooltip.5=jagged lines and sharp color transitions. +of.options.shaders.ANTIALIASING.tooltip.6=It is faster than traditional antialiasing +of.options.shaders.ANTIALIASING.tooltip.7=and is compatible with shaders and Fast Render. + +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.1=Normal Map +of.options.shaders.NORMAL_MAP.tooltip.2= ON - (default) enable normal maps +of.options.shaders.NORMAL_MAP.tooltip.3= OFF - disable normal maps +of.options.shaders.NORMAL_MAP.tooltip.4=Normal maps can be used by the shader pack +of.options.shaders.NORMAL_MAP.tooltip.5=to simulate 3D geometry on flat model surfaces. +of.options.shaders.NORMAL_MAP.tooltip.6=The normal map textures are supplied by the +of.options.shaders.NORMAL_MAP.tooltip.7=current resource pack. + +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.1=Specular Map +of.options.shaders.SPECULAR_MAP.tooltip.2= ON - (default) enable specular maps +of.options.shaders.SPECULAR_MAP.tooltip.3= OFF - disable specular maps +of.options.shaders.SPECULAR_MAP.tooltip.4=Specular maps can be used by the shader pack +of.options.shaders.SPECULAR_MAP.tooltip.5=to simulate special reflection effects. +of.options.shaders.SPECULAR_MAP.tooltip.6=The specular map textures are supplied by the +of.options.shaders.SPECULAR_MAP.tooltip.7=current resource pack. + +of.options.shaders.RENDER_RES_MUL=Render Quality +of.options.shaders.RENDER_RES_MUL.tooltip.1=Render Quality +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - low (fastest) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (default) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - high (slowest) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Render quality controls the size of the texture +of.options.shaders.RENDER_RES_MUL.tooltip.6=that the shader pack is rendering to. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Lower values can be useful with 4K displays. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Higher values work as an antialiasing filter. + +of.options.shaders.SHADOW_RES_MUL=Shadow Quality +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Shadow Quality +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - low (fastest) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (default) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - high (slowest) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Shadow quality controls the size of the shadow map +of.options.shaders.SHADOW_RES_MUL.tooltip.6=texture used by the shader pack. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Lower values = unexact, coarser shadows. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Higher values = detailed, finer shadows. + +of.options.shaders.HAND_DEPTH_MUL=Hand Depth +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Hand Depth +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - hand near to the camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (default) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - hand far from the camera +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Hand depth controls how far the handheld objects are +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=from the camera. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=For shader packs using depth blur this should change +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=the blurring of handheld objects. + +of.options.shaders.CLOUD_SHADOW=Cloud Shadow + +of.options.shaders.OLD_HAND_LIGHT=Old Hand Light +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Old Hand Light +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Default - controlled by the shader pack +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= ON - use old handlight +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= OFF - use new handlight +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Old hand light allows shader packs which only +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=recognize light emitting items in the main hand +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=to also work with items in the off-hand. + +of.options.shaders.OLD_LIGHTING=Old Lighting +of.options.shaders.OLD_LIGHTING.tooltip.1=Old Lighting +of.options.shaders.OLD_LIGHTING.tooltip.2= Default - controlled by the shader pack +of.options.shaders.OLD_LIGHTING.tooltip.3= ON - use old lighting +of.options.shaders.OLD_LIGHTING.tooltip.4= OFF - do not use old lighting +of.options.shaders.OLD_LIGHTING.tooltip.5=Old lighting controls the fixed lighting applied +of.options.shaders.OLD_LIGHTING.tooltip.6=by vanilla to the block sides. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shader packs which use shadows usually provide +of.options.shaders.OLD_LIGHTING.tooltip.8=much better lighting depending on the sun position. + +of.options.shaders.SHADER_PACK=Shader Pack + +of.options.shaders.shadersFolder=Shaders Folder +of.options.shaders.shaderOptions=Shader Options... + +of.options.shaderOptionsTitle=Shader Options + +of.options.quality=Quality... +of.options.qualityTitle=Quality Settings + +of.options.details=Details... +of.options.detailsTitle=Detail Settings + +of.options.performance=Performance... +of.options.performanceTitle=Performance Settings + +of.options.animations=Animations... +of.options.animationsTitle=Animation Settings + +of.options.other=Other... +of.options.otherTitle=Other Settings + +of.options.other.reset=Reset Video Settings... + +of.shaders.profile=Profile + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Nearest +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Visual effect which makes distant objects look better +options.mipmapLevels.tooltip.2=by smoothing the texture details +options.mipmapLevels.tooltip.3= OFF - no smoothing +options.mipmapLevels.tooltip.4= 1 - minimum smoothing +options.mipmapLevels.tooltip.5= 4 - maximum smoothing +options.mipmapLevels.tooltip.6=This option usually does not affect the performance. + +of.options.MIPMAP_TYPE=Mipmap Type +of.options.MIPMAP_TYPE.tooltip.1=Visual effect which makes distant objects look better +of.options.MIPMAP_TYPE.tooltip.2=by smoothing the texture details +of.options.MIPMAP_TYPE.tooltip.3= Nearest - rough smoothing (fastest) +of.options.MIPMAP_TYPE.tooltip.4= Linear - normal smoothing +of.options.MIPMAP_TYPE.tooltip.5= Bilinear - fine smoothing +of.options.MIPMAP_TYPE.tooltip.6= Trilinear - finest smoothing (slowest) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= OFF - (default) no antialiasing (faster) +of.options.AA_LEVEL.tooltip.3= 2-16 - antialiased lines and edges (slower) +of.options.AA_LEVEL.tooltip.4=The Antialiasing smooths jagged lines and +of.options.AA_LEVEL.tooltip.5=sharp color transitions. +of.options.AA_LEVEL.tooltip.6=When enabled it may substantially decrease the FPS. +of.options.AA_LEVEL.tooltip.7=Not all levels are supported by all graphics cards. +of.options.AA_LEVEL.tooltip.8=Effective after a RESTART! + +of.options.AF_LEVEL=Anisotropic Filtering +of.options.AF_LEVEL.tooltip.1=Anisotropic Filtering +of.options.AF_LEVEL.tooltip.2= OFF - (default) standard texture detail (faster) +of.options.AF_LEVEL.tooltip.3= 2-16 - finer details in mipmapped textures (slower) +of.options.AF_LEVEL.tooltip.4=The Anisotropic Filtering restores details in +of.options.AF_LEVEL.tooltip.5=mipmapped textures. +of.options.AF_LEVEL.tooltip.6=When enabled it may substantially decrease the FPS. + +of.options.CLEAR_WATER=Clear Water +of.options.CLEAR_WATER.tooltip.1=Clear Water +of.options.CLEAR_WATER.tooltip.2= ON - clear, transparent water +of.options.CLEAR_WATER.tooltip.3= OFF - default water + +of.options.RANDOM_MOBS=Random Mobs +of.options.RANDOM_MOBS.tooltip.1=Random Mobs +of.options.RANDOM_MOBS.tooltip.2= OFF - no random mobs, faster +of.options.RANDOM_MOBS.tooltip.3= ON - random mobs, slower +of.options.RANDOM_MOBS.tooltip.4=Random mobs uses random textures for the game creatures. +of.options.RANDOM_MOBS.tooltip.5=It needs a resource pack which has multiple mob textures. + +of.options.BETTER_GRASS=Better Grass +of.options.BETTER_GRASS.tooltip.1=Better Grass +of.options.BETTER_GRASS.tooltip.2= OFF - default side grass texture, fastest +of.options.BETTER_GRASS.tooltip.3= Fast - full side grass texture, slower +of.options.BETTER_GRASS.tooltip.4= Fancy - dynamic side grass texture, slowest + +of.options.BETTER_SNOW=Better Snow +of.options.BETTER_SNOW.tooltip.1=Better Snow +of.options.BETTER_SNOW.tooltip.2= OFF - default snow, faster +of.options.BETTER_SNOW.tooltip.3= ON - better snow, slower +of.options.BETTER_SNOW.tooltip.4=Shows snow under transparent blocks (fence, tall grass) +of.options.BETTER_SNOW.tooltip.5=when bordering with snow blocks. + +of.options.CUSTOM_FONTS=Custom Fonts +of.options.CUSTOM_FONTS.tooltip.1=Custom Fonts +of.options.CUSTOM_FONTS.tooltip.2= ON - uses custom fonts (default), slower +of.options.CUSTOM_FONTS.tooltip.3= OFF - uses default font, faster +of.options.CUSTOM_FONTS.tooltip.4=The custom fonts are supplied by the current +of.options.CUSTOM_FONTS.tooltip.5=resource pack. + +of.options.CUSTOM_COLORS=Custom Colors +of.options.CUSTOM_COLORS.tooltip.1=Custom Colors +of.options.CUSTOM_COLORS.tooltip.2= ON - uses custom colors (default), slower +of.options.CUSTOM_COLORS.tooltip.3= OFF - uses default colors, faster +of.options.CUSTOM_COLORS.tooltip.4=The custom colors are supplied by the current +of.options.CUSTOM_COLORS.tooltip.5=resource pack. + +of.options.SWAMP_COLORS=Swamp Colors +of.options.SWAMP_COLORS.tooltip.1=Swamp Colors +of.options.SWAMP_COLORS.tooltip.2= ON - use swamp colors (default), slower +of.options.SWAMP_COLORS.tooltip.3= OFF - do not use swamp colors, faster +of.options.SWAMP_COLORS.tooltip.4=The swamp colors affect grass, leaves, vines and water. + +of.options.SMOOTH_BIOMES=Smooth Biomes +of.options.SMOOTH_BIOMES.tooltip.1=Smooth Biomes +of.options.SMOOTH_BIOMES.tooltip.2= ON - smoothing of biome borders (default), slower +of.options.SMOOTH_BIOMES.tooltip.3= OFF - no smoothing of biome borders, faster +of.options.SMOOTH_BIOMES.tooltip.4=The smoothing of biome borders is done by sampling and +of.options.SMOOTH_BIOMES.tooltip.5=averaging the color of all surrounding blocks. +of.options.SMOOTH_BIOMES.tooltip.6=Affected are grass, leaves, vines and water. + +of.options.CONNECTED_TEXTURES=Connected Textures +of.options.CONNECTED_TEXTURES.tooltip.1=Connected Textures +of.options.CONNECTED_TEXTURES.tooltip.2= OFF - no connected textures (default) +of.options.CONNECTED_TEXTURES.tooltip.3= Fast - fast connected textures +of.options.CONNECTED_TEXTURES.tooltip.4= Fancy - fancy connected textures +of.options.CONNECTED_TEXTURES.tooltip.5=Connected textures joins the textures of glass, +of.options.CONNECTED_TEXTURES.tooltip.6=sandstone and bookshelves when placed next to +of.options.CONNECTED_TEXTURES.tooltip.7=each other. The connected textures are supplied +of.options.CONNECTED_TEXTURES.tooltip.8=by the current resource pack. + +of.options.NATURAL_TEXTURES=Natural Textures +of.options.NATURAL_TEXTURES.tooltip.1=Natural Textures +of.options.NATURAL_TEXTURES.tooltip.2= OFF - no natural textures (default) +of.options.NATURAL_TEXTURES.tooltip.3= ON - use natural textures +of.options.NATURAL_TEXTURES.tooltip.4=Natural textures remove the gridlike pattern +of.options.NATURAL_TEXTURES.tooltip.5=created by repeating blocks of the same type. +of.options.NATURAL_TEXTURES.tooltip.6=It uses rotated and flipped variants of the base +of.options.NATURAL_TEXTURES.tooltip.7=block texture. The configuration for the natural +of.options.NATURAL_TEXTURES.tooltip.8=textures is supplied by the current resource pack. + +of.options.EMISSIVE_TEXTURES=Emissive Textures +of.options.EMISSIVE_TEXTURES.tooltip.1=Emissive Textures +of.options.EMISSIVE_TEXTURES.tooltip.2= OFF - no emissive textures (default) +of.options.EMISSIVE_TEXTURES.tooltip.3= ON - use emissive textures +of.options.EMISSIVE_TEXTURES.tooltip.4=The emissive textures are rendered as overlays +of.options.EMISSIVE_TEXTURES.tooltip.5=with full brightness. They can be used to simulate +of.options.EMISSIVE_TEXTURES.tooltip.6=light emitting parts of the base texture. +of.options.EMISSIVE_TEXTURES.tooltip.7=The emissive textures are supplied by the current +of.options.EMISSIVE_TEXTURES.tooltip.8=resource pack. + +of.options.CUSTOM_SKY=Custom Sky +of.options.CUSTOM_SKY.tooltip.1=Custom Sky +of.options.CUSTOM_SKY.tooltip.2= ON - custom sky textures (default), slow +of.options.CUSTOM_SKY.tooltip.3= OFF - default sky, faster +of.options.CUSTOM_SKY.tooltip.4=The custom sky textures are supplied by the current +of.options.CUSTOM_SKY.tooltip.5=resource pack. + +of.options.CUSTOM_ITEMS=Custom Items +of.options.CUSTOM_ITEMS.tooltip.1=Custom Items +of.options.CUSTOM_ITEMS.tooltip.2= ON - custom item textures (default), slow +of.options.CUSTOM_ITEMS.tooltip.3= OFF - default item textures, faster +of.options.CUSTOM_ITEMS.tooltip.4=The custom item textures are supplied by the current +of.options.CUSTOM_ITEMS.tooltip.5=resource pack. + +of.options.CUSTOM_ENTITY_MODELS=Custom Entity Models +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Custom Entity Models +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ON - custom entity models (default), slow +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= OFF - default entity models, faster +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=The custom entity models are supplied by the current +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=resource pack. + +of.options.CUSTOM_GUIS=Custom GUIs +of.options.CUSTOM_GUIS.tooltip.1=Custom GUIs +of.options.CUSTOM_GUIS.tooltip.2= ON - custom GUIs (default), slower +of.options.CUSTOM_GUIS.tooltip.3= OFF - default GUIs, faster +of.options.CUSTOM_GUIS.tooltip.4=The custom GUIs are supplied by the current resource pack. + +# Details + +of.options.CLOUDS=Clouds +of.options.CLOUDS.tooltip.1=Clouds +of.options.CLOUDS.tooltip.2= Default - as set by setting Graphics +of.options.CLOUDS.tooltip.3= Fast - lower quality, faster +of.options.CLOUDS.tooltip.4= Fancy - higher quality, slower +of.options.CLOUDS.tooltip.5= OFF - no clouds, fastest +of.options.CLOUDS.tooltip.6=Fast clouds are rendered 2D. +of.options.CLOUDS.tooltip.7=Fancy clouds are rendered 3D. + +of.options.CLOUD_HEIGHT=Cloud Height +of.options.CLOUD_HEIGHT.tooltip.1=Cloud Height +of.options.CLOUD_HEIGHT.tooltip.2= OFF - default height +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - above world height limit + +of.options.TREES=Trees +of.options.TREES.tooltip.1=Trees +of.options.TREES.tooltip.2= Default - as set by setting Graphics +of.options.TREES.tooltip.3= Fast - lower quality, faster +of.options.TREES.tooltip.4= Smart - higher quality, fast +of.options.TREES.tooltip.5= Fancy - highest quality, slower +of.options.TREES.tooltip.6=Fast trees have opaque leaves. +of.options.TREES.tooltip.7=Fancy and smart trees have transparent leaves. + +of.options.RAIN=Rain & Snow +of.options.RAIN.tooltip.1=Rain & Snow +of.options.RAIN.tooltip.2= Default - as set by setting Graphics +of.options.RAIN.tooltip.3= Fast - light rain/snow, faster +of.options.RAIN.tooltip.4= Fancy - heavy rain/snow, slower +of.options.RAIN.tooltip.5= OFF - no rain/snow, fastest +of.options.RAIN.tooltip.6=When rain is OFF the splashes and rain sounds +of.options.RAIN.tooltip.7=are still active. + +of.options.SKY=Sky +of.options.SKY.tooltip.1=Sky +of.options.SKY.tooltip.2= ON - sky is visible, slower +of.options.SKY.tooltip.3= OFF - sky is not visible, faster +of.options.SKY.tooltip.4=When sky is OFF the moon and sun are still visible. + +of.options.STARS=Stars +of.options.STARS.tooltip.1=Stars +of.options.STARS.tooltip.2= ON - stars are visible, slower +of.options.STARS.tooltip.3= OFF - stars are not visible, faster + +of.options.SUN_MOON=Sun & Moon +of.options.SUN_MOON.tooltip.1=Sun & Moon +of.options.SUN_MOON.tooltip.2= ON - sun and moon are visible (default) +of.options.SUN_MOON.tooltip.3= OFF - sun and moon are not visible (faster) + +of.options.SHOW_CAPES=Show Capes +of.options.SHOW_CAPES.tooltip.1=Show Capes +of.options.SHOW_CAPES.tooltip.2= ON - show player capes (default) +of.options.SHOW_CAPES.tooltip.3= OFF - do not show player capes + +of.options.TRANSLUCENT_BLOCKS=Translucent Blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Translucent Blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Fancy - correct color blending (default) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Fast - fast color blending (faster) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controls the color blending of translucent blocks +of.options.TRANSLUCENT_BLOCKS.tooltip.5=with different color (stained glass, water, ice) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=when placed behind each other with air between them. + +of.options.HELD_ITEM_TOOLTIPS=Held Item Tooltips +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Held item tooltips +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ON - show tooltips for held items (default) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= OFF - do not show tooltips for held items + +of.options.ADVANCED_TOOLTIPS=Advanced Tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.1=Advanced tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.2= ON - show advanced tooltips +of.options.ADVANCED_TOOLTIPS.tooltip.3= OFF - do not show advanced tooltips (default) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Advanced tooltips show extended information for +of.options.ADVANCED_TOOLTIPS.tooltip.5=items (id, durability) and for shader options +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, source, default value). + +of.options.DROPPED_ITEMS=Dropped Items +of.options.DROPPED_ITEMS.tooltip.1=Dropped Items +of.options.DROPPED_ITEMS.tooltip.2= Default - as set by setting Graphics +of.options.DROPPED_ITEMS.tooltip.3= Fast - 2D dropped items, faster +of.options.DROPPED_ITEMS.tooltip.4= Fancy - 3D dropped items, slower + +options.entityShadows.tooltip.1=Entity Shadows +options.entityShadows.tooltip.2= ON - show entity shadows +options.entityShadows.tooltip.3= OFF - do not show entity shadows + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Visual effect which slightly darkens the screen corners +of.options.VIGNETTE.tooltip.2= Default - as set by the setting Graphics (default) +of.options.VIGNETTE.tooltip.3= Fast - vignette disabled (faster) +of.options.VIGNETTE.tooltip.4= Fancy - vignette enabled (slower) +of.options.VIGNETTE.tooltip.5=The vignette may have a significant effect on the FPS, +of.options.VIGNETTE.tooltip.6=especially when playing fullscreen. +of.options.VIGNETTE.tooltip.7=The vignette effect is very subtle and can safely +of.options.VIGNETTE.tooltip.8=be disabled. + +of.options.DYNAMIC_FOV=Dynamic FOV +of.options.DYNAMIC_FOV.tooltip.1=Dynamic FOV +of.options.DYNAMIC_FOV.tooltip.2= ON - enable dynamic FOV (default) +of.options.DYNAMIC_FOV.tooltip.3= OFF - disable dynamic FOV +of.options.DYNAMIC_FOV.tooltip.4=Changes the field of view (FOV) when flying, sprinting +of.options.DYNAMIC_FOV.tooltip.5=or pulling a bow. + +of.options.DYNAMIC_LIGHTS=Dynamic Lights +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamic Lights +of.options.DYNAMIC_LIGHTS.tooltip.2= OFF - no dynamic lights (default) +of.options.DYNAMIC_LIGHTS.tooltip.3= Fast - fast dynamic lights (updated every 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Fancy - fancy dynamic lights (updated in real-time) +of.options.DYNAMIC_LIGHTS.tooltip.5=Enables light emitting items (torch, glowstone, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=to illuminate everything around them when held in hand, +of.options.DYNAMIC_LIGHTS.tooltip.7=equipped by other player or dropped on the ground. + +# Performance + +of.options.SMOOTH_FPS=Smooth FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizes FPS by flushing the graphic driver buffers. +of.options.SMOOTH_FPS.tooltip.2= OFF - no stabilization, FPS may fluctuate +of.options.SMOOTH_FPS.tooltip.3= ON - FPS stabilization +of.options.SMOOTH_FPS.tooltip.4=This option is graphics driver dependant and its effect +of.options.SMOOTH_FPS.tooltip.5=is not always visible. + +of.options.SMOOTH_WORLD=Smooth World +of.options.SMOOTH_WORLD.tooltip.1=Removes lag spikes caused by the internal server. +of.options.SMOOTH_WORLD.tooltip.2= OFF - no stabilization, FPS may fluctuate +of.options.SMOOTH_WORLD.tooltip.3= ON - FPS stabilization +of.options.SMOOTH_WORLD.tooltip.4=Stabilizes FPS by distributing the internal server load. +of.options.SMOOTH_WORLD.tooltip.5=Effective only for local worlds (single player). + +of.options.FAST_RENDER=Fast Render +of.options.FAST_RENDER.tooltip.1=Fast Render +of.options.FAST_RENDER.tooltip.2= OFF - standard rendering (default) +of.options.FAST_RENDER.tooltip.3= ON - optimized rendering (faster) +of.options.FAST_RENDER.tooltip.4=Uses optimized rendering algorithm which decreases +of.options.FAST_RENDER.tooltip.5=the GPU load and may substantially increase the FPS. + +of.options.FAST_MATH=Fast Math +of.options.FAST_MATH.tooltip.1=Fast Math +of.options.FAST_MATH.tooltip.2= OFF - standard math (default) +of.options.FAST_MATH.tooltip.3= ON - faster math +of.options.FAST_MATH.tooltip.4=Uses optimized sin() and cos() functions which can +of.options.FAST_MATH.tooltip.5=better utilize the CPU cache and increase the FPS. + +of.options.CHUNK_UPDATES=Chunk Updates +of.options.CHUNK_UPDATES.tooltip.1=Chunk updates +of.options.CHUNK_UPDATES.tooltip.2= 1 - slower world loading, higher FPS (default) +of.options.CHUNK_UPDATES.tooltip.3= 3 - faster world loading, lower FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - fastest world loading, lowest FPS +of.options.CHUNK_UPDATES.tooltip.5=Number of chunk updates per rendered frame, +of.options.CHUNK_UPDATES.tooltip.6=higher values may destabilize the framerate. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamic Updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamic chunk updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= OFF - (default) standard chunk updates per frame +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ON - more updates while the player is standing still +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamic updates force more chunk updates while +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=the player is standing still to load the world faster. + +of.options.LAZY_CHUNK_LOADING=Lazy Chunk Loading +of.options.LAZY_CHUNK_LOADING.tooltip.1=Lazy Chunk Loading +of.options.LAZY_CHUNK_LOADING.tooltip.2= OFF - default server chunk loading +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - lazy server chunk loading (smoother) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Smooths the integrated server chunk loading by +of.options.LAZY_CHUNK_LOADING.tooltip.5=distributing the chunks over several ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Turn it OFF if parts of the world do not load correctly. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Effective only for local worlds (single-player). + +# Animations + +of.options.animation.allOn=All ON +of.options.animation.allOff=All OFF +of.options.animation.dynamic=Dynamic + +of.options.ANIMATED_WATER=Water Animated +of.options.ANIMATED_LAVA=Lava Animated +of.options.ANIMATED_FIRE=Fire Animated +of.options.ANIMATED_PORTAL=Portal Animated +of.options.ANIMATED_REDSTONE=Redstone Animated +of.options.ANIMATED_EXPLOSION=Explosion Animated +of.options.ANIMATED_FLAME=Flame Animated +of.options.ANIMATED_SMOKE=Smoke Animated +of.options.VOID_PARTICLES=Void Particles +of.options.WATER_PARTICLES=Water Particles +of.options.RAIN_SPLASH=Rain Splash +of.options.PORTAL_PARTICLES=Portal Particles +of.options.POTION_PARTICLES=Potion Particles +of.options.DRIPPING_WATER_LAVA=Dripping Water/Lava +of.options.ANIMATED_TERRAIN=Terrain Animated +of.options.ANIMATED_TEXTURES=Textures Animated +of.options.FIREWORK_PARTICLES=Firework Particles + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Shows the lagometer on the debug screen (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Memory garbage collection +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Blue - Scheduled executables +of.options.LAGOMETER.tooltip.5=* Purple - Chunk upload +of.options.LAGOMETER.tooltip.6=* Red - Chunk updates +of.options.LAGOMETER.tooltip.7=* Yellow - Visibility check +of.options.LAGOMETER.tooltip.8=* Green - Render terrain + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= ON - debug profiler is active, slower +of.options.PROFILER.tooltip.3= OFF - debug profiler is not active, faster +of.options.PROFILER.tooltip.4=The debug profiler collects and shows debug information +of.options.PROFILER.tooltip.5=when the debug screen is open (F3). + +of.options.WEATHER=Weather +of.options.WEATHER.tooltip.1=Weather +of.options.WEATHER.tooltip.2= ON - weather is active, slower +of.options.WEATHER.tooltip.3= OFF - weather is not active, faster +of.options.WEATHER.tooltip.4=The weather controls rain, snow and thunderstorms. +of.options.WEATHER.tooltip.5=Weather control is only possible for local worlds. + +of.options.time.dayOnly=Day Only +of.options.time.nightOnly=Night Only + +of.options.TIME=Time +of.options.TIME.tooltip.1=Time +of.options.TIME.tooltip.2= Default - normal day/night cycles +of.options.TIME.tooltip.3= Day Only - day only +of.options.TIME.tooltip.4= Night Only - night only +of.options.TIME.tooltip.5=The time setting is only effective in CREATIVE mode +of.options.TIME.tooltip.6=and for local worlds. + +options.fullscreen.tooltip.1=Fullscreen +options.fullscreen.tooltip.2= ON - use fullscreen mode +options.fullscreen.tooltip.3= OFF - use window mode +options.fullscreen.tooltip.4=Fullscreen mode may be faster or slower than +options.fullscreen.tooltip.5=window mode, depending on the graphics card. + +of.options.FULLSCREEN_MODE=Fullscreen Mode +of.options.FULLSCREEN_MODE.tooltip.1=Fullscreen mode +of.options.FULLSCREEN_MODE.tooltip.2= Default - use desktop screen resolution, slower +of.options.FULLSCREEN_MODE.tooltip.3= WxH - use custom screen resolution, may be faster +of.options.FULLSCREEN_MODE.tooltip.4=The selected resolution is used in fullscreen mode (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Lower resolutions should generally be faster. + +of.options.SHOW_FPS=Show FPS +of.options.SHOW_FPS.tooltip.1=Shows compact FPS and render information. +of.options.SHOW_FPS.tooltip.2= C: - chunk renderers +of.options.SHOW_FPS.tooltip.3= E: - rendered entities + block entities +of.options.SHOW_FPS.tooltip.4= U: - chunk updates +of.options.SHOW_FPS.tooltip.5=The compact FPS information is only shown when the +of.options.SHOW_FPS.tooltip.6=debug screen is not visible. + +of.options.save.default=Default (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autosave +of.options.AUTOSAVE_TICKS.tooltip.1=Autosave interval +of.options.AUTOSAVE_TICKS.tooltip.2=Default autosave interval (2s) is NOT RECOMMENDED. +of.options.AUTOSAVE_TICKS.tooltip.3=Autosave causes the famous Lag Spike of Death. + +of.options.SCREENSHOT_SIZE=Screenshot Size +of.options.SCREENSHOT_SIZE.tooltip.1=Screenshot Size +of.options.SCREENSHOT_SIZE.tooltip.2= Default - default screenshot size +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - custom screenshot size +of.options.SCREENSHOT_SIZE.tooltip.4=Capturing bigger screenshots may need more memory. +of.options.SCREENSHOT_SIZE.tooltip.5=Not compatible with Fast Render and Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Requires GPU framebuffer support. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/es_ES.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/es_ES.lang new file mode 100644 index 0000000..7543d17 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/es_ES.lang @@ -0,0 +1,603 @@ +# General +of.general.ambiguous=ambiguo +of.general.custom=Personalizado +of.general.from=De +of.general.id=ID +of.general.restart=Reiniciar +of.general.smart=Inteligentes + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing no es compatible con shaders. +of.message.aa.shaders2=Desactívalas para usar esta función. + +of.message.af.shaders1=Anisotrópico no es compatible con shaders. +of.message.af.shaders2=Desactívalas para usar esta función. + +of.message.fr.shaders1=Renderizado rápido no es compatible con shaders. +of.message.fr.shaders2=Desactívalas para usar esta función. + +of.message.shaders.aa1=Las shaders no son compatibles con antialiasing. +of.message.shaders.aa2=Para desactivarlo, haz clic en Calidad -> Antialiasing. + +of.message.shaders.af1=Las shaders no son compatibles con anisotrópico. +of.message.shaders.af2=Para desactivarlo, haz clic en Calidad -> Anisotrópico. + +of.message.shaders.fr1=Las shaders no son compatibles con el renderizado rápido. +of.message.shaders.fr2=Para desactivarlo, haz clic en Rendimiento -> Renderizado rápido. + +of.message.newVersion=Hay una nueva versión de §eOptiFine§f disponible: §e%s§f +of.message.java64Bit=Instala §eJava de 64-bits§f para mejorar el rendimiento +of.message.openglError=§eError de OpenGL§f: %s (%s) + +of.message.shaders.loading=Cargando shader: %s + +of.message.other.reset=¿Restablecer toda la configuración gráfica? + +# Video settings + +options.graphics.tooltip.1=Gráficos +options.graphics.tooltip.2= Rápidos - peor calidad, mejor rendimiento +options.graphics.tooltip.3= Detallados - mejor calidad, peor rendimiento +options.graphics.tooltip.4= +options.graphics.tooltip.5=Los cambios se aprecian en las nubes, en las hojas, +options.graphics.tooltip.6=en la lluvia, en los objetos tirados y en las +options.graphics.tooltip.7=esquinas (o bordes) de la pantalla del juego. + +of.options.renderDistance.extreme=Extremo + +options.renderDistance.tooltip.1=Distancia de chunks renderizada +options.renderDistance.tooltip.2= 2 Mínimo - 32m (increíblemente rápido) +options.renderDistance.tooltip.3= 4 Corto - 64m (rápido) +options.renderDistance.tooltip.4= 8 Normal - 128m +options.renderDistance.tooltip.5= 16 Lejano - 256m (lento) +options.renderDistance.tooltip.6= 32 Extremo - 512m (¡extremadamente lento!) +options.renderDistance.tooltip.7=¡El renderizado extremo necesita un buen equipo! +options.renderDistance.tooltip.8=Los valores mayores de 16 no funcionan en multijugador. + +options.ao.tooltip.1=Iluminación suave +options.ao.tooltip.2= NO - sin iluminación suave (rápido) +options.ao.tooltip.3= Mínimo - iluminación suave simple (lento) +options.ao.tooltip.4= Máximo - iluminación suave avanzada (más lento) + +options.framerateLimit.tooltip.1=Límite de FPS +options.framerateLimit.tooltip.2= VSync - limita los FPS según tu monitor (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - límite personalizado +options.framerateLimit.tooltip.4= Sin límite - todos los FPS posibles (rápido) +options.framerateLimit.tooltip.5= +options.framerateLimit.tooltip.6=Al establecer un límite, los FPS pueden disminuir al +options.framerateLimit.tooltip.7=llegar a este. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Nivel de suavidad +of.options.AO_LEVEL.tooltip.1=Nivel de la iluminación suave +of.options.AO_LEVEL.tooltip.2= NO - sin sombras +of.options.AO_LEVEL.tooltip.3= 50%% - pocas sombras +of.options.AO_LEVEL.tooltip.4= 100%% - sombras oscuras + +options.viewBobbing.tooltip.1=Movimiento más realista. +options.viewBobbing.tooltip.2=Desactivar al usar mipmap para obtener mejor resultado. + +options.guiScale.tooltip.1=Escala de la interfaz (GUI) +options.guiScale.tooltip.2=Una interfaz más pequeña puede mejorar el rendimiento. + +options.vbo.tooltip.1=Vertex Buffer Objects (abreviado como VBO) +options.vbo.tooltip.2=Forma alternativa de renderizado que suele ser más +options.vbo.tooltip.3=rápida (5-10%%) que la predeterminada. + +options.gamma.tooltip.1=Modificar el brillo +options.gamma.tooltip.2= Oscuro - brillo por defecto +options.gamma.tooltip.3= 1-99%% - brillo personalizado +options.gamma.tooltip.4= Claro - brillo al máximo +options.gamma.tooltip.5= +options.gamma.tooltip.6=Esta opción no cambia completamente +options.gamma.tooltip.7=el brillo de los objetos más oscuros. + +options.anaglyph.tooltip.1=Visión en 3D +options.anaglyph.tooltip.2=Activar un efecto estereoscópico usando un color +options.anaglyph.tooltip.3=diferente para cada ojo. +options.anaglyph.tooltip.4=NOTA: Requiere gafas anaglíficas (rojas y azules). + +of.options.ALTERNATE_BLOCKS=Bloques alternos +of.options.ALTERNATE_BLOCKS.tooltip.1=Bloques con texturas alternas +of.options.ALTERNATE_BLOCKS.tooltip.2=Usar texturas alternativas para un mismo bloque. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depende del paquete de recursos usado. + +of.options.FOG_FANCY=Niebla +of.options.FOG_FANCY.tooltip.1=Tipo de niebla +of.options.FOG_FANCY.tooltip.2= Rápida - niebla más rápida, luce cutre +of.options.FOG_FANCY.tooltip.3= Detallada - niebla más lenta, luce mejor +of.options.FOG_FANCY.tooltip.4= NO - sin niebla, superrápido +of.options.FOG_FANCY.tooltip.5=La niebla detallada sólo está disponible si +of.options.FOG_FANCY.tooltip.6=tu tarjeta gráfica lo permite. + +of.options.FOG_START=Distancia de niebla +of.options.FOG_START.tooltip.1=Distancia a la que empieza la niebla +of.options.FOG_START.tooltip.2= 0.2 - la niebla empieza cerca del jugador +of.options.FOG_START.tooltip.3= 0.8 - la niebla empieza lejos del jugador +of.options.FOG_START.tooltip.4=Normalmente esta opción no afecta al rendimiento. + +of.options.CHUNK_LOADING=Carga de chunks +of.options.CHUNK_LOADING.tooltip.1=Velocidad de carga de chunks +of.options.CHUNK_LOADING.tooltip.2= Por defecto - FPS inestables al cargar chunks +of.options.CHUNK_LOADING.tooltip.3= Suave - FPS estables +of.options.CHUNK_LOADING.tooltip.4= Multinúcleo - FPS estables y una velocidad 3 veces superior +of.options.CHUNK_LOADING.tooltip.5=Las opciones "Suave" y "Multinúcleo" eliminan los tirones y la +of.options.CHUNK_LOADING.tooltip.6=lentitud causada por la carga de chunks. +of.options.CHUNK_LOADING.tooltip.7=Multinúcleo puede acelerar la carga hasta 3 veces más y mejorar +of.options.CHUNK_LOADING.tooltip.8=los FPS al usar un segundo núcleo del CPU. +of.options.chunkLoading.smooth=Suave +of.options.chunkLoading.multiCore=Multinúcleo + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=(SIN SHADERS) +of.options.shaders.packDefault=(SHADER INTERNA) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.NORMAL_MAP=Normal mapping +of.options.shaders.SPECULAR_MAP=Specular mapping +of.options.shaders.RENDER_RES_MUL=Calidad render. +of.options.shaders.SHADOW_RES_MUL=Calidad sombras +of.options.shaders.HAND_DEPTH_MUL=Prof. de campo +of.options.shaders.CLOUD_SHADOW=Sombras de nubes +of.options.shaders.OLD_HAND_LIGHT=LC en manos +of.options.shaders.OLD_LIGHTING=Luz clásica (LC) +of.options.shaders.SHADER_PACK=Paquete de shader + +of.options.shaders.shadersFolder=Carpeta de shaders +of.options.shaders.shaderOptions=Opciones de shader... + +of.options.shaderOptionsTitle=Opciones de shader + +of.options.quality=Calidad... +of.options.qualityTitle=Opciones de gráficos + +of.options.details=Detalles... +of.options.detailsTitle=Opciones de gráficos + +of.options.performance=Rendimiento... +of.options.performanceTitle=Opciones de rendimiento + +of.options.animations=Animaciones... +of.options.animationsTitle=Activar o desactivar animaciones + +of.options.other=Opciones varias... +of.options.otherTitle=Opciones varias + +of.options.other.reset=Restablecer toda la configuración... + +of.shaders.profile=Perfil + +# Quality + +of.options.mipmap.bilinear=Bilineal +of.options.mipmap.linear=Lineal +of.options.mipmap.nearest=Cercano +of.options.mipmap.trilinear=Trilineal + +options.mipmapLevels.tooltip.1=Efecto visual que hace que los objetos lejanos luzcan +options.mipmapLevels.tooltip.2=mejor gracias a que suaviza los detalles de su textura +options.mipmapLevels.tooltip.3= +options.mipmapLevels.tooltip.4= NO - sin suavizado +options.mipmapLevels.tooltip.5= 1 - suavizado mínimo +options.mipmapLevels.tooltip.6= 4 - suavizado máximo +options.mipmapLevels.tooltip.7= +options.mipmapLevels.tooltip.8=Normalmente esta opción no afecta al rendimiento. + +of.options.MIPMAP_TYPE=Tipo de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Efecto visual que hace que los objetos lejanos luzcan +of.options.MIPMAP_TYPE.tooltip.2=mejor gracias a que suaviza los detalles de su textura +of.options.MIPMAP_TYPE.tooltip.3= +of.options.MIPMAP_TYPE.tooltip.4= Cercano - suavizado bruto (más rápido) +of.options.MIPMAP_TYPE.tooltip.5= Lineal - suavizado normal +of.options.MIPMAP_TYPE.tooltip.6= Bilineal - suavizado fino +of.options.MIPMAP_TYPE.tooltip.7= Trilineal - suavizado muy fino (más lento) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing suaviza líneas y bordes de los bloques +of.options.AA_LEVEL.tooltip.2= NO - (por defecto) sin antialiasing (más rápido) +of.options.AA_LEVEL.tooltip.3= 2-16 - nivel de suavizado del antialiasing (más lento) +of.options.AA_LEVEL.tooltip.4= +of.options.AA_LEVEL.tooltip.5= Suaviza los dientes de sierra y mejora la nitidez. +of.options.AA_LEVEL.tooltip.6=Los FPS pueden disminuir considerablemente al activarse. +of.options.AA_LEVEL.tooltip.7=Algunas tarjetas gráficas no soportan todos los niveles. +of.options.AA_LEVEL.tooltip.8= ¡El cambio será aplicado al REINICIAR el juego! + +of.options.AF_LEVEL=Anisotrópico +of.options.AF_LEVEL.tooltip.1=Filtrado anisotrópico +of.options.AF_LEVEL.tooltip.2= NO - (por defecto) detalle normal de texturas (rápido) +of.options.AF_LEVEL.tooltip.3= 2-16 - refinar texturas al usar mipmap (más lento) +of.options.AF_LEVEL.tooltip.4= +of.options.AF_LEVEL.tooltip.6=Este filtro recupera detalles al usar mipmap. +of.options.AF_LEVEL.tooltip.7=Los FPS pueden disminuir considerablemente al activarse. + +of.options.CLEAR_WATER=Aguas cristalinas +of.options.CLEAR_WATER.tooltip.1=Aguas cristalinas +of.options.CLEAR_WATER.tooltip.2= SÍ - agua limpia y transparente +of.options.CLEAR_WATER.tooltip.3= NO - agua predeterminada del juego + +of.options.RANDOM_MOBS=Criaturas aleatorias +of.options.RANDOM_MOBS.tooltip.1=Aleatorizar las texturas de las criaturas +of.options.RANDOM_MOBS.tooltip.2= NO - sin aleatorizar, más rápido +of.options.RANDOM_MOBS.tooltip.3= SÍ - con aleatorización, más lento +of.options.RANDOM_MOBS.tooltip.4= +of.options.RANDOM_MOBS.tooltip.5=Esta opción permite que las criaturas cambien de textura. +of.options.RANDOM_MOBS.tooltip.6=Requiere un paquete de recursos que tenga varias texturas +of.options.RANDOM_MOBS.tooltip.7=para una misma criatura. + +of.options.BETTER_GRASS=Césped mejorado +of.options.BETTER_GRASS.tooltip.1=Textura de los lados del bloque de césped mejorada +of.options.BETTER_GRASS.tooltip.2= NO - césped normal (por defecto), más rápido +of.options.BETTER_GRASS.tooltip.3= Rápidos - todo el bloque lleno de césped, más lento +of.options.BETTER_GRASS.tooltip.4= Detallados - textura dinámica, mucho más lento + +of.options.BETTER_SNOW=Nieve mejorada +of.options.BETTER_SNOW.tooltip.1=Nieve mejorada +of.options.BETTER_SNOW.tooltip.2= NO - nieve predeterminada, más rápido +of.options.BETTER_SNOW.tooltip.3= SÍ - nieve mejorada, más lento +of.options.BETTER_SNOW.tooltip.4= +of.options.BETTER_SNOW.tooltip.5=Mostrar nieve debajo de los bloques transparantes +of.options.BETTER_SNOW.tooltip.6=(vallas, hierbas) al bordearlos con nieve. + +of.options.CUSTOM_FONTS=Fuentes personalizadas +of.options.CUSTOM_FONTS.tooltip.1=Fuentes personalizadas +of.options.CUSTOM_FONTS.tooltip.2= SÍ - usar personalizadas (por defecto), más lento +of.options.CUSTOM_FONTS.tooltip.3= NO - usar la predeterminada, más rápido +of.options.CUSTOM_FONTS.tooltip.4= +of.options.CUSTOM_FONTS.tooltip.5=Algunos paquetes de recursos tienen fuentes +of.options.CUSTOM_FONTS.tooltip.6=personalizadas. + +of.options.CUSTOM_COLORS=Colores personalizados +of.options.CUSTOM_COLORS.tooltip.1=Colores personalizados +of.options.CUSTOM_COLORS.tooltip.2= SÍ - usar colores personalizados (por defecto), más lento +of.options.CUSTOM_COLORS.tooltip.3= NO - usar colores predeterminados, más rápido +of.options.CUSTOM_COLORS.tooltip.4= +of.options.CUSTOM_COLORS.tooltip.5=Algunos paquetes de recursos tienen colores +of.options.CUSTOM_COLORS.tooltip.6=personalizados. + +of.options.SWAMP_COLORS=Color de pantanos +of.options.SWAMP_COLORS.tooltip.1=Color de pantanos +of.options.SWAMP_COLORS.tooltip.2= SÍ - color en pantanos (por defecto), más lento +of.options.SWAMP_COLORS.tooltip.3= NO - sin color en los pantanos, más rápido +of.options.SWAMP_COLORS.tooltip.4=Afecta a: césped, agua, hojas y enredaderas. + +of.options.SMOOTH_BIOMES=Suavizar biomas +of.options.SMOOTH_BIOMES.tooltip.1=Suavizar bordes de biomas +of.options.SMOOTH_BIOMES.tooltip.2= SÍ - suavizar bordes de biomas (por defecto), más lento +of.options.SMOOTH_BIOMES.tooltip.3= NO - no suavizar bordes de biomas, más rápido +of.options.SMOOTH_BIOMES.tooltip.4= +of.options.SMOOTH_BIOMES.tooltip.5=El suavizado se realiza mediante el degradado del color de +of.options.SMOOTH_BIOMES.tooltip.6=los bloques cercanos al borde. +of.options.SMOOTH_BIOMES.tooltip.7=Afecta a: césped, agua, hojas y enredaderas. + +of.options.CONNECTED_TEXTURES=Bloques unidos +of.options.CONNECTED_TEXTURES.tooltip.1=Unir texturas de ciertos bloques +of.options.CONNECTED_TEXTURES.tooltip.2= NO - no unirlas (por defecto) +of.options.CONNECTED_TEXTURES.tooltip.3= Rápidos - unirlas de forma rápida +of.options.CONNECTED_TEXTURES.tooltip.4= Detallados - unirlas de forma mejorada +of.options.CONNECTED_TEXTURES.tooltip.5= +of.options.CONNECTED_TEXTURES.tooltip.6=Unir las texturas de los cristales, de la arenisca y de +of.options.CONNECTED_TEXTURES.tooltip.7=las librerías al juntar los bloques. +of.options.CONNECTED_TEXTURES.tooltip.8=No todos los paquetes de recursos soportan esta opción. + +of.options.NATURAL_TEXTURES=Texturas naturales +of.options.NATURAL_TEXTURES.tooltip.1=Texturas naturales +of.options.NATURAL_TEXTURES.tooltip.2= NO - sin texturas naturales (por defecto) +of.options.NATURAL_TEXTURES.tooltip.3= SÍ - con texturas naturales +of.options.NATURAL_TEXTURES.tooltip.4=Esta opción elimina el patrón de los bloques +of.options.NATURAL_TEXTURES.tooltip.5=que se crea al poner bloques del mismo tipo. +of.options.NATURAL_TEXTURES.tooltip.6=Se usan variantes rotadas y voleteadas de la textura +of.options.NATURAL_TEXTURES.tooltip.7=base del bloque. +of.options.NATURAL_TEXTURES.tooltip.8=No todos los paquetes de recursos soportan esta opción. + +of.options.CUSTOM_SKY=Cielo personalizado +of.options.CUSTOM_SKY.tooltip.1=Textura personalizada del cielo +of.options.CUSTOM_SKY.tooltip.2= SÍ - cielo personalizado (por defecto), más lento +of.options.CUSTOM_SKY.tooltip.3= NO - cielo predeterminado, más rápido +of.options.CUSTOM_SKY.tooltip.4= +of.options.CUSTOM_SKY.tooltip.5=No todos los paquetes de recursos soportan esta opción. + +of.options.CUSTOM_ITEMS=Objetos personalizados +of.options.CUSTOM_ITEMS.tooltip.1=Textura personalizada de objetos (ítems) +of.options.CUSTOM_ITEMS.tooltip.2= SÍ - objetos personalizadas (por defecto), más lento +of.options.CUSTOM_ITEMS.tooltip.3= NO - objetos predeterminados, más rápido +of.options.CUSTOM_ITEMS.tooltip.4= +of.options.CUSTOM_ITEMS.tooltip.5=No todos los paquetes de recursos soportan esta opción. + +of.options.CUSTOM_ENTITY_MODELS=Entidades personalizadas +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Textura personalizada de las entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= SÍ - variar modelos de entidades (por defecto), más lento +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= NO - usar modelos predeterminados, más rápido +of.options.CUSTOM_ENTITY_MODELS.tooltip.4= +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=No todos los paquetes de recursos soportan esta opción. + +# Details + +of.options.CLOUDS=Nubes +of.options.CLOUDS.tooltip.1=Calidad de las nubes +of.options.CLOUDS.tooltip.2= Por defecto - depende del ajuste de la calidad gráfica +of.options.CLOUDS.tooltip.3= Rápidas - peor calidad, mejor rendimiento +of.options.CLOUDS.tooltip.4= Detalladas - mayor calidad, peor rendimiento +of.options.CLOUDS.tooltip.5= NO - sin nubes, rendimiento superrápido +of.options.CLOUDS.tooltip.6= +of.options.CLOUDS.tooltip.7=Las nubes rápidas se renderizan en 2D. +of.options.CLOUDS.tooltip.8=Las nubes detalladas se renderizan en 3D. + +of.options.CLOUD_HEIGHT=Elevación de nubes +of.options.CLOUD_HEIGHT.tooltip.1=Aumento en la altura de la capa de nubes +of.options.CLOUD_HEIGHT.tooltip.2= NO - altura por defecto +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - encima del límite del mundo + +of.options.TREES=Árboles +of.options.TREES.tooltip.1=Calidad de hojas de árboles +of.options.TREES.tooltip.2= Por defecto - depende del ajuste de la calidad gráfica +of.options.TREES.tooltip.3= Rápidos - baja calidad, mejor rendimiento +of.options.TREES.tooltip.4= Inteligentes - más calidad, rendimiento medio +of.options.TREES.tooltip.5= Detallados - máxima calidad, peor rendimiento +of.options.TREES.tooltip.6= +of.options.TREES.tooltip.7=La calidad rápida dejará las hojas sin transparencia. +of.options.TREES.tooltip.8="Detallados" e "Inteligentes" sí mantienen la transparencia. + +of.options.RAIN=Lluvia/Nieve +of.options.RAIN.tooltip.1=Lluvia y nieve +of.options.RAIN.tooltip.2= Por defecto - depende del ajuste de la calidad gráfica +of.options.RAIN.tooltip.3= Rápidos - lluvia/nieve ligera, más rápido +of.options.RAIN.tooltip.4= Detallados - lluvia/nieve intensa, más lento +of.options.RAIN.tooltip.5= NO - sin lluvia/nieve, fastest +of.options.RAIN.tooltip.6= +of.options.RAIN.tooltip.7=Aunque se desactive la lluvia, el sonido sigue estando +of.options.RAIN.tooltip.8=activado. + +of.options.SKY=Cielo +of.options.SKY.tooltip.1=Cielo +of.options.SKY.tooltip.2= SÍ - cielo visible, más lento +of.options.SKY.tooltip.3= NO - cielo no visible, más lento +of.options.SKY.tooltip.4= +of.options.SKY.tooltip.5=Aunque se desactive, la Luna y el Sol se podrán seguir +of.options.SKY.tooltip.6=viendo. + +of.options.STARS=Cielo estrellado +of.options.STARS.tooltip.1=Visibilidad de estrellas en el cielo nocturno +of.options.STARS.tooltip.2= SÍ - estrellas, más lento +of.options.STARS.tooltip.3= NO - sin estrellas, más rápido + +of.options.SUN_MOON=Sol/Luna +of.options.SUN_MOON.tooltip.1=Visibilidad del Sol y la Luna +of.options.SUN_MOON.tooltip.2= SÍ - el Sol y la Luna SÍ son visibles (por defecto) +of.options.SUN_MOON.tooltip.3= NO - el Sol y la Luna NO son visibles (rápido) + +of.options.SHOW_CAPES=Capas +of.options.SHOW_CAPES.tooltip.1=Capas de jugadores +of.options.SHOW_CAPES.tooltip.2= SÍ - mostrar las capas de los jugadores (por defecto) +of.options.SHOW_CAPES.tooltip.3= NO - ocultar las capas de los jugadores + +of.options.TRANSLUCENT_BLOCKS=Bloques translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Calidad de los bloques translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Detallados - mezcla de colores perfecta (por defecto) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rápidos - mezcla de colores cutre (más rápido) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Esta opción afecta a los bloques translúcidos que tienen +of.options.TRANSLUCENT_BLOCKS.tooltip.6=color pero sólo cuando se colocan uno detrás del otro con +of.options.TRANSLUCENT_BLOCKS.tooltip.7=un bloque vacío entre ambos. +of.options.TRANSLUCENT_BLOCKS.tooltip.8=Afecta a: cristal tintado, agua, hielo... + +of.options.HELD_ITEM_TOOLTIPS=Texto en barra inferior +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Nombre de objetos en la barra inferior +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= SÍ - mostrar nombres (por defecto) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= NO - no mostrar nombres (como antiguamente) + +of.options.DROPPED_ITEMS=Objetos +of.options.DROPPED_ITEMS.tooltip.1=Calidad de los objetos en el suelo sin recoger +of.options.DROPPED_ITEMS.tooltip.2= Por defecto - depende del ajuste de la calidad gráfica +of.options.DROPPED_ITEMS.tooltip.3= Rápidos - objetos en 2D, más rápido +of.options.DROPPED_ITEMS.tooltip.4= Detallados - objetos en 3D, más lento pero más bonito + +options.entityShadows.tooltip.1=Sombras de entidades +options.entityShadows.tooltip.2= SÍ - mostrar sombras en las entidades +options.entityShadows.tooltip.3= NO - no mostrar sombras en las entidades + +of.options.VIGNETTE=Bordes +of.options.VIGNETTE.tooltip.1=(Efecto viñeta) oscurece las esquinas de la pantalla +of.options.VIGNETTE.tooltip.2= Por defecto - depende del ajuste de la calidad gráfica +of.options.VIGNETTE.tooltip.3= Rápidos - efecto viñeta desactivado (más rápido) +of.options.VIGNETTE.tooltip.4= Detallados - efecto viñeta activado (más lento) +of.options.VIGNETTE.tooltip.5= +of.options.VIGNETTE.tooltip.6=Los FPS pueden disminuir considerablemente al activarse, +of.options.VIGNETTE.tooltip.7=sobretodo en pantalla completa. +of.options.VIGNETTE.tooltip.8=El efecto viñeta se puede deshabilitar sin ningún problema. + +of.options.DYNAMIC_FOV=Campo de visión dinámico +of.options.DYNAMIC_FOV.tooltip.1=Campo de visión dinámico +of.options.DYNAMIC_FOV.tooltip.2= SÍ - activarlo (por defecto) +of.options.DYNAMIC_FOV.tooltip.3= NO - desactivarlo +of.options.DYNAMIC_FOV.tooltip.4=Cambiar el campo de visión (FOV) al volar, correr o apuntar +of.options.DYNAMIC_FOV.tooltip.5=con un arco. + +of.options.DYNAMIC_LIGHTS=Iluminación dinámica +of.options.DYNAMIC_LIGHTS.tooltip.1=Iluminación dinámica +of.options.DYNAMIC_LIGHTS.tooltip.2= NO - sin i. dinámica (por defecto) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rápidos - i. dinámica rápida (se actualiza cada 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Detallados - i. dinámica detallada (se actualiza en tiempo real) +of.options.DYNAMIC_LIGHTS.tooltip.5= +of.options.DYNAMIC_LIGHTS.tooltip.6=Esta opción permite a algunos objetos emitir luz sin estar colocados. +of.options.DYNAMIC_LIGHTS.tooltip.7=Al equipar uno de esos objetos en la mano, o al tirarlos al suelo +of.options.DYNAMIC_LIGHTS.tooltip.8=el entorno se iluminará (afecta a: antorchas, piedra luminosa...). + +# Performance + +of.options.SMOOTH_FPS=Estabilizar FPS +of.options.SMOOTH_FPS.tooltip.1=Establizar FPS nivelando el búfer del controlador gráfico +of.options.SMOOTH_FPS.tooltip.2= NO - sin estabilización +of.options.SMOOTH_FPS.tooltip.3= SÍ - con estabilización +of.options.SMOOTH_FPS.tooltip.4= +of.options.SMOOTH_FPS.tooltip.5=Esta opción depende del controlador gráfico y su efecto +of.options.SMOOTH_FPS.tooltip.6=no siempre es notorio. + +of.options.SMOOTH_WORLD=Estabilizar mundos +of.options.SMOOTH_WORLD.tooltip.1=Eliminar los picos de lag causados por el servidor interno +of.options.SMOOTH_WORLD.tooltip.2= NO - sin estabilización +of.options.SMOOTH_WORLD.tooltip.3= SÍ - con estabilización +of.options.SMOOTH_WORLD.tooltip.4= +of.options.SMOOTH_WORLD.tooltip.5=Esta opción estabiliza los FPS distribuyendo la carga del +of.options.SMOOTH_WORLD.tooltip.6=servidor interno. +of.options.SMOOTH_WORLD.tooltip.7=No funciona en multijugador. + +of.options.FAST_RENDER=Renderizado rápido +of.options.FAST_RENDER.tooltip.1=Renderizar rápidamente +of.options.FAST_RENDER.tooltip.2= NO - renderizado estandar (por defecto) +of.options.FAST_RENDER.tooltip.3= SÍ - renderizado optimizado (rápido) +of.options.FAST_RENDER.tooltip.4= +of.options.FAST_RENDER.tooltip.5=Usa un algoritmo de renderizado mejorado que reduce el +of.options.FAST_RENDER.tooltip.6=consumo de GPU y aumenta los FPS. + +of.options.FAST_MATH=Matemática rápida +of.options.FAST_MATH.tooltip.1=Matemática rápida +of.options.FAST_MATH.tooltip.2= NO - estandar (por defecto) +of.options.FAST_MATH.tooltip.3= SÍ - sistema rápido +of.options.FAST_MATH.tooltip.4= +of.options.FAST_MATH.tooltip.5=Usar las funciones sin() y cos() de Java de forma +of.options.FAST_MATH.tooltip.6=optimizada para mejorar el uso de caché del CPU y mejorar +of.options.FAST_MATH.tooltip.7=los FPS. + +of.options.CHUNK_UPDATES=Actualizaciones de chunks +of.options.CHUNK_UPDATES.tooltip.1=Actualizaciones de chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - carga lenta, más FPS (por defecto) +of.options.CHUNK_UPDATES.tooltip.3= 3 - carga rápida, menos FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - carga superrápida, muchos menos FPS +of.options.CHUNK_UPDATES.tooltip.5= +of.options.CHUNK_UPDATES.tooltip.6=Número de chunks renderizados por cada fotograma. +of.options.CHUNK_UPDATES.tooltip.7=Los valores más altos pueden desestabilizar los FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Actualización dinámica +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Actualizaciones de chunks dinámicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= NO - (por defecto) carga normal por fotograma +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= SÍ - más actualizaciones mientras estés quieto +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4= +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=Esta opción fuerza la actualización de chunks mientras +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=estás quieto para cargar el mundo más rápidamente. + +of.options.LAZY_CHUNK_LOADING=Carga de chunks vaga +of.options.LAZY_CHUNK_LOADING.tooltip.1=Carga de chunks vaga +of.options.LAZY_CHUNK_LOADING.tooltip.2= NO - carga de chunks predeterminada +of.options.LAZY_CHUNK_LOADING.tooltip.3= SÍ - carga de chunks vaga (estabiliza la carga) +of.options.LAZY_CHUNK_LOADING.tooltip.4= +of.options.LAZY_CHUNK_LOADING.tooltip.5=Suaviza la carga interna de chunks distribuyéndola durante +of.options.LAZY_CHUNK_LOADING.tooltip.6=varios ticks. Desactívala si algunas partes del mundo no se +of.options.LAZY_CHUNK_LOADING.tooltip.7=cargan correctamente. +of.options.LAZY_CHUNK_LOADING.tooltip.8=Sólo funciona en mundos locales con CPUs de un núcleo. + +# Animations + +of.options.animation.allOn=TODO SÍ +of.options.animation.allOff=TODO NO +of.options.animation.dynamic=Dinámicas + +of.options.ANIMATED_WATER=Agua +of.options.ANIMATED_LAVA=Lava +of.options.ANIMATED_FIRE=Fuego +of.options.ANIMATED_PORTAL=Portales +of.options.ANIMATED_REDSTONE=Redstone +of.options.ANIMATED_EXPLOSION=Explosiones +of.options.ANIMATED_FLAME=Llamaradas +of.options.ANIMATED_SMOKE=Humo +of.options.VOID_PARTICLES=Partículas del vacío +of.options.WATER_PARTICLES=Partículas del agua +of.options.RAIN_SPLASH=Salpicaduras de lluvia +of.options.PORTAL_PARTICLES=Partículas de portales +of.options.POTION_PARTICLES=Partículas de pociones +of.options.DRIPPING_WATER_LAVA=Goteo de agua/lava +of.options.ANIMATED_TERRAIN=Terreno animado +of.options.ANIMATED_TEXTURES=Texturas animadas +of.options.FIREWORK_PARTICLES=Partículas de cohetes + +# Other + +of.options.LAGOMETER=Medidor de lag +of.options.LAGOMETER.tooltip.1=Muestra el medidor de lag al usar F3. +of.options.LAGOMETER.tooltip.2=* Naranja - Basura en la memoria +of.options.LAGOMETER.tooltip.3=* Cian - Ticks +of.options.LAGOMETER.tooltip.4=* Azul - Ejecutables programados +of.options.LAGOMETER.tooltip.5=* Morado - Carga de chunks +of.options.LAGOMETER.tooltip.6=* Rojo - Actualizaciones de chunks +of.options.LAGOMETER.tooltip.7=* Amarillo - Chequeo de visibilidad +of.options.LAGOMETER.tooltip.8=* Verde - Terreno renderizado + +of.options.PROFILER=Perfil debug +of.options.PROFILER.tooltip.1=Debug (también llamado depuración) +of.options.PROFILER.tooltip.2= SÍ - perfil debug activado, más lento +of.options.PROFILER.tooltip.3= NO - perfil debug desactivado, más rápido +of.options.PROFILER.tooltip.4=El perfil debug reúne y muestra más datos cuando se +of.options.PROFILER.tooltip.5=usa F3. + +of.options.WEATHER=Clima +of.options.WEATHER.tooltip.1=Clima (tiempo atmosférico) +of.options.WEATHER.tooltip.2= SÍ - clima activado, más lento +of.options.WEATHER.tooltip.3= NO - clima desactivado, más rápido +of.options.WEATHER.tooltip.4=El clima controla la lluvia, la nieve y las tormentas. +of.options.WEATHER.tooltip.5=Esta opción no funciona en multijugador. + +of.options.time.dayOnly=Sólo día +of.options.time.nightOnly=Sólo noche + +of.options.TIME=Reloj +of.options.TIME.tooltip.1=Reloj (tiempo) +of.options.TIME.tooltip.2= Por defecto - ciclos normales de día/noche +of.options.TIME.tooltip.3= Sólo día - sólo es de día +of.options.TIME.tooltip.4= Sólo noche - sólo es de noche +of.options.TIME.tooltip.5=Esta opción sólo funciona en modo creativo y solamente +of.options.TIME.tooltip.6=en mundos locales (en multijugador NO). + +options.fullscreen.tooltip.1=Pantalla completa +options.fullscreen.tooltip.2= SÍ - jugar en pantalla completa +options.fullscreen.tooltip.3= NO - jugar en una ventana +options.fullscreen.tooltip.4=Al jugar en pantalla completa el juego puede funcionar +options.fullscreen.tooltip.5=mejor o peor, depende de la tarjeta gráfica. + +of.options.FULLSCREEN_MODE=Resolución +of.options.FULLSCREEN_MODE.tooltip.1=Resolución de la pantalla completa +of.options.FULLSCREEN_MODE.tooltip.2= Por defecto - resolución del monitor, más lento +of.options.FULLSCREEN_MODE.tooltip.3= Ancho x alto - otra resolución, puede ir más rápido +of.options.FULLSCREEN_MODE.tooltip.4=La resolución cambiará en la pantalla completa (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Normalmente las más bajas aumentan el rendimiento. + +of.options.SHOW_FPS=Mostrar FPS +of.options.SHOW_FPS.tooltip.1=Mostrar FPS y datos de renderizado +of.options.SHOW_FPS.tooltip.2= C: - chunks renderizados +of.options.SHOW_FPS.tooltip.3= E: - entidades renderizadas + "block entities" +of.options.SHOW_FPS.tooltip.4= U: - actualizaciones de chunks +of.options.SHOW_FPS.tooltip.5= +of.options.SHOW_FPS.tooltip.6=Estos reducidos datos sólo se muestran cuando no se +of.options.SHOW_FPS.tooltip.7=usa F3. + +of.options.save.default=Original (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autoguardado +of.options.AUTOSAVE_TICKS.tooltip.1=Intervalo del autoguardado +of.options.AUTOSAVE_TICKS.tooltip.2=El intervalo original del juego (2s) NO SE RECOMIENDA. +of.options.AUTOSAVE_TICKS.tooltip.3=Un intervalo corto puede causar mal rendimiento. + +options.anaglyph.tooltip.1=Visión en 3D + +of.options.SCREENSHOT_SIZE=Capturas +of.options.SCREENSHOT_SIZE.tooltip.1=Tamaño de las capturas de pantalla +of.options.SCREENSHOT_SIZE.tooltip.2= Por defecto - tamaño normal +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - tamaños personalizados +of.options.SCREENSHOT_SIZE.tooltip.4=Las capturas ocuparán más espacio al aumentar el tamaño. +of.options.SCREENSHOT_SIZE.tooltip.5=No es compatible con Renderizado rápido ni con Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Requiere que tu tarjeta gráfica soporte Framebuffer. + +of.options.ADVANCED_TOOLTIPS=Descripciones de objetos +of.options.ADVANCED_TOOLTIPS.tooltip.1=Descripciones de objetos en el inventario +of.options.ADVANCED_TOOLTIPS.tooltip.2= SÍ - mostrar descripciones +of.options.ADVANCED_TOOLTIPS.tooltip.3= NO - no mostras descripciones (por defecto) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Esta opción permite ver información más detallada +of.options.ADVANCED_TOOLTIPS.tooltip.5=sobre los objetos (ID, durabilidad) y sobre las +of.options.ADVANCED_TOOLTIPS.tooltip.6=shaders (ID, fuente, valor predeterminado). diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/es_MX.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/es_MX.lang new file mode 100644 index 0000000..a4f419d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/es_MX.lang @@ -0,0 +1,527 @@ +# General +of.general.ambiguous=ambiguo +of.general.custom=Personalizado +of.general.from=De +of.general.id=ID +of.general.restart=reiniciar +of.general.smart=Dinámico + +# Message +of.message.aa.shaders1=El anti-aliasing no es compatible con Shaders. +of.message.aa.shaders2=Desactiva Shaders para habilitar esta opción. + +of.message.af.shaders1=El filtrado anisotrópico no es compatible con Shaders. +of.message.af.shaders2=Desactiva Shaders para habilitar esta opción. + +of.message.fr.shaders1=El renderizado rápido no es compatible con Shaders. +of.message.fr.shaders2=Desactiva Shaders para habilitar esta opción. + +of.message.shaders.aa1=Shaders no es compatible con el anti-aliasing activo. +of.message.shaders.aa2=Desactiva la opción ‘anti-aliasing’ en el menú ‘calidad’ y reinicia el juego. + +of.message.shaders.af1=Shaders no es compatible con el filtrado anisótropico activo. +of.message.shaders.af2=Desactiva la opción ‘filtrado antisotrópico’ en el menú ‘calidad’. + +of.message.shaders.fr1=Shaders no es compatible con el renderizado rapido activo. +of.message.shaders.fr2=Desactiva la opción ‘renderizado rapido' en el menú ‘rendimiento’. + +of.message.newVersion=§fUna nueva versión de §eOptiFine §festá disponible: §e%s§f +of.message.java64Bit=§fPrueba instalar §eJava versión de 64bits §fpara incrementar el rendimiento. +of.message.openglError=§eError de OpenGL§f: %s (%s) + +of.message.shaders.loading=Cargando shaders: %s + +of.message.other.reset=¿Quieres reiniciar la configuración de video a los valores de inicio? + +# Video settings + +options.graphics.tooltip.1=Calidad visual. +options.graphics.tooltip.2= Rápida - Mayor velocidad. +options.graphics.tooltip.3= Detallada - Mejor apariencia. +options.graphics.tooltip.4=Cambia la apariencia de nubes, hojas, agua, +options.graphics.tooltip.5=sombras y bloques con pasto. + +of.options.renderDistance.extreme=Extremo + +options.renderDistance.tooltip.1=Distancia de renderizado. +options.renderDistance.tooltip.2= 2 Mínimo - 32 bloques. (más rápido) +options.renderDistance.tooltip.3= 4 Corto - 64 bloques. +options.renderDistance.tooltip.4= 8 Normal - 128 bloques. +options.renderDistance.tooltip.5= 16 Lejano - 256 bloques. +options.renderDistance.tooltip.6= 32 Extremo - 512 bloques. (más lento) +options.renderDistance.tooltip.7=La distancia de renderizado extrema demanda más recursos. +options.renderDistance.tooltip.8=Valores sobre de 16 solo son efectivos en mundos locales. + +options.ao.tooltip.1=Iluminación suave. +options.ao.tooltip.2= NO - Sin suavizado de iluminación. (rápido) +options.ao.tooltip.3= Mínima - Simple, rudo, inceirto. (lento) +options.ao.tooltip.4= Máxima - Agradable, uniforme, neto. (más lento) + +options.framerateLimit.tooltip.1=Restricción de FPS. +options.framerateLimit.tooltip.2= VSync - Reduce los FPS a 60, 30 o 20. +options.framerateLimit.tooltip.3= 5-255 - Cambiante. +options.framerateLimit.tooltip.4= Ilimitados - Excento, sin límites. +options.framerateLimit.tooltip.5=Los cuadros por segundo son reducidos aun si el +options.framerateLimit.tooltip.6=límite no es alcanzado. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Suavizado de iluminación +of.options.AO_LEVEL.tooltip.1=Nivel de iluminación suave. +of.options.AO_LEVEL.tooltip.2= NO - Sin sombras. +of.options.AO_LEVEL.tooltip.3= 50%% - Sombras claras. +of.options.AO_LEVEL.tooltip.4= 100%% - Sombras oscuras. + +options.viewBobbing.tooltip.1=Movimiento de la cámara al caminar. Más realista. +options.viewBobbing.tooltip.2=Para mejores resultados, desactivar cundo utilice mipmaps. + +options.guiScale.tooltip.1=Escala de interfaz. +options.guiScale.tooltip.2=Entre más pequeño podría ser más rápido. + +options.vbo.tooltip.1=Vertex Buffer Objects (OpenGL). +options.vbo.tooltip.2=Utiliza un modelo alternativo de renderizado que incrementa +options.vbo.tooltip.3=la velocidad de 5 a 10%% que el renderizado habitual. + +options.gamma.tooltip.1=Incrementa el brillo en objetos oscuros. +options.gamma.tooltip.2= Moderado - Brillo por defecto. +options.gamma.tooltip.3= Claro - Máximo brillo. +options.gamma.tooltip.4=Esta opción no afecta el brillo de objetos +options.gamma.tooltip.5=completamente oscurecidos. + +options.anaglyph.tooltip.1=Anaglifo 3D. +options.anaglyph.tooltip.2=Habilita un efecto estereoscópico 3D con diferente color +options.anaglyph.tooltip.3=para cada ojo. +options.anaglyph.tooltip.4=Requiere de lentes 3D rojo-azul para una vista apropiada. + +options.blockAlternatives.tooltip.1=Bloques alternativos. +options.blockAlternatives.tooltip.2=Usa modelos alternativos en algunos bloques. +options.blockAlternatives.tooltip.3=Depende del paquete de texturas seleccionado. + +of.options.FOG_FANCY=Neblina +of.options.FOG_FANCY.tooltip.1=Tipo de neblina. +of.options.FOG_FANCY.tooltip.2= NO - Sin neblina, rápido. +of.options.FOG_FANCY.tooltip.3= Rápida - Neblina ligera. +of.options.FOG_FANCY.tooltip.4= Detallada - Neblina lenta, se ve mejor. +of.options.FOG_FANCY.tooltip.5=La neblina detallada solo está disponible si su tarjeta +of.options.FOG_FANCY.tooltip.6=de video lo soporta. + +of.options.FOG_START=Distancia de neblina +of.options.FOG_START.tooltip.1=Donde empieza a verse la neblina. +of.options.FOG_START.tooltip.2= 0.2 - Desde cerca del jugador. +of.options.FOG_START.tooltip.3= 0.8 - Desde lejos del jugador. +of.options.FOG_START.tooltip.4=Esta opción normalmente no afecta el rendimiento. + +of.options.CHUNK_LOADING=Carga de Chunks +of.options.CHUNK_LOADING.tooltip.1=Opción de carga de los pedazos del mapa (chunks). +of.options.CHUNK_LOADING.tooltip.2= Normal - Cuadros por segundo (FPS) inestables al cargar chunks. +of.options.CHUNK_LOADING.tooltip.3= Agradable - FPS constantes. +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - FPS invariables y acelera la carga de los mapas. +of.options.CHUNK_LOADING.tooltip.5=Las opciónes de Agradable y Multi-Core estabilizan y evitan que el juego +of.options.CHUNK_LOADING.tooltip.6=se trabe al cargar chunks. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core aumenta hasta tres veces la velocidad de carga de los mapas +of.options.CHUNK_LOADING.tooltip.8=y también aumenta los FPS ocupando un segundo núcleo del procesador. +of.options.chunkLoading.smooth=Agradable +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=NINGUNO +of.options.shaders.packDefault=(interno) + +of.options.shaders.ANTIALIASING=Anti-aliasing +of.options.shaders.NORMAL_MAP=Mapa normal +of.options.shaders.SPECULAR_MAP=Mapa espectacular +of.options.shaders.RENDER_RES_MUL=Rendimiento +of.options.shaders.SHADOW_RES_MUL=Sombras +of.options.shaders.HAND_DEPTH_MUL=Profundidad +of.options.shaders.CLOUD_SHADOW=Sombra de nubes +of.options.shaders.OLD_LIGHTING=Iluminación vieja +of.options.shaders.SHADER_PACK=Paquete de shader + +of.options.shaders.shadersFolder=Folder de Shaders +of.options.shaders.shaderOptions=Opciones del Shader... + +of.options.shaderOptionsTitle=Opciones del Shader + +of.options.quality=Calidad... +of.options.qualityTitle=Configurar calidad. + +of.options.details=Detalles... +of.options.detailsTitle=Configurar detalles. + +of.options.performance=Rendimiento... +of.options.performanceTitle=Configuración del rendimiento. + +of.options.animations=Animaciones... +of.options.animationsTitle=Configuraciones de animaciones. + +of.options.other=Otro... +of.options.otherTitle=Otras configuraciones + +of.options.other.reset=Reiniciar la configuracion de video... + +of.shaders.profile=Perfil + +# Quality + +of.options.mipmap.bilinear=Bilinial +of.options.mipmap.linear=Lineal +of.options.mipmap.nearest=Más cercano +of.options.mipmap.trilinear=Trilineal + +options.mipmapLevels.tooltip.1=Efecto visual que mejora la apariencia de objetos lejanos +options.mipmapLevels.tooltip.2=suavizando los detalles de la textura al redimensionarla. +options.mipmapLevels.tooltip.3= NO - Sin suavizar. +options.mipmapLevels.tooltip.4= 1 – Suavizado mínimo. +options.mipmapLevels.tooltip.5= 4 – Suavizado máximo. +options.mipmapLevels.tooltip.6=Esta opción no suele afectar el rendimiento. + +of.options.MIPMAP_TYPE=Tipo de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Efecto visual que mejora la apariencia de objetos lejanos +of.options.MIPMAP_TYPE.tooltip.2=suavizando los detalles de la textura. +of.options.MIPMAP_TYPE.tooltip.3= Más cercano - Suavizado mínimo. (más rápido) +of.options.MIPMAP_TYPE.tooltip.4= Lineal – Suavizado bajo. +of.options.MIPMAP_TYPE.tooltip.5= Bilineal – Suavizado alto. +of.options.MIPMAP_TYPE.tooltip.6= Trilineal – Suavizado máximo. (más lento) + + +of.options.AA_LEVEL=Anti-aliasing +of.options.AA_LEVEL.tooltip.1=Anti-aliasing. +of.options.AA_LEVEL.tooltip.2= NO - Por defecto. (rápido) +of.options.AA_LEVEL.tooltip.3= 2-16 – Líneas y esquinas más definidas. (lento) +of.options.AA_LEVEL.tooltip.4=El antialiasing mejora y define los bordes de las líneas +of.options.AA_LEVEL.tooltip.5=y las profundas trancisiones de color. +of.options.AA_LEVEL.tooltip.6=Esta opción puede sustancialemnte disminuir los FPS. +of.options.AA_LEVEL.tooltip.7=No todos los niveles son soportados por todas las tarjetas de video. +of.options.AA_LEVEL.tooltip.8=Los cambios serán efectivos al reinicio. + +of.options.AF_LEVEL=Filtro anisotrópico +of.options.AF_LEVEL.tooltip.1=Filtrado anisotrópico. +of.options.AF_LEVEL.tooltip.2= NO - Por defecto. Sin efectos. (rápido) +of.options.AF_LEVEL.tooltip.3= 2-16 – Detalles más finos en texturas con mipmap. (lento) +of.options.AF_LEVEL.tooltip.4=El filtro anisotrópico reafirma detalles en texturas +of.options.AF_LEVEL.tooltip.5=que usan mipmap. +of.options.AF_LEVEL.tooltip.6=Esta opción puede disminuir los FPS. + +of.options.CLEAR_WATER=Claridad del agua +of.options.CLEAR_WATER.tooltip.1=Al sumergirse en ella. +of.options.CLEAR_WATER.tooltip.2= NO – Agua normal. +of.options.CLEAR_WATER.tooltip.3= SÍ – Agua más transparente. + +of.options.RANDOM_MOBS=Mobs aleatorios +of.options.RANDOM_MOBS.tooltip.1=Mobs aleaotrios. +of.options.RANDOM_MOBS.tooltip.2= NO – Sin skins aleatorios de mobs. (rápido) +of.options.RANDOM_MOBS.tooltip.3= SÍ – Skins de mobs aleatorios. (lento) +of.options.RANDOM_MOBS.tooltip.4=Esta opción habilita el uso de skins aleatorias para mobs por +of.options.RANDOM_MOBS.tooltip.5=lo que requiere de un paquete de texturas que los contenga. + +of.options.BETTER_GRASS=Pasto bonito +of.options.BETTER_GRASS.tooltip.1=Modifica como se ven los lados de los bloques de tierra con pasto. +of.options.BETTER_GRASS.tooltip.2= NO – Predeterminada. (rápido) +of.options.BETTER_GRASS.tooltip.3= Rápida – Todos los lados se ven de pasto. +of.options.BETTER_GRASS.tooltip.4= Detallada – Textura dinámica de pasto en los lados. (lento) + +of.options.BETTER_SNOW=Mejora de nieve +of.options.BETTER_SNOW.tooltip.1=Nieve especial. +of.options.BETTER_SNOW.tooltip.2= NO – Nieve por defecto. (rápido) +of.options.BETTER_SNOW.tooltip.3= SÍ – Mejora la nieve. (lento) +of.options.BETTER_SNOW.tooltip.4=Muestra nieve debajo de los bloques transparentes como vallas, +of.options.BETTER_SNOW.tooltip.5=pasto alto, cuando su base está rodeada por bloques de nieve. + +of.options.CUSTOM_FONTS=Fuentes personalizadas +of.options.CUSTOM_FONTS.tooltip.1=Cambia la tipografía del texto. +of.options.CUSTOM_FONTS.tooltip.2= NO – Utiliza la fuente de letra por defecto. (rápido) +of.options.CUSTOM_FONTS.tooltip.3= SÍ – Usar fuentes de letra personalizadas. (lento) +of.options.CUSTOM_FONTS.tooltip.4=Esta opción utiliza la fuente de letra que contenga el +of.options.CUSTOM_FONTS.tooltip.5=paquete de texturas seleccionado. + +of.options.CUSTOM_COLORS=Colores personalizadas +of.options.CUSTOM_COLORS.tooltip.1=Cambia los colores. +of.options.CUSTOM_COLORS.tooltip.2= NO - Por defecto. (rápido) +of.options.CUSTOM_COLORS.tooltip.3= SÍ – Utiliza otros colores. (lento) +of.options.CUSTOM_COLORS.tooltip.4=Esta opción emplea los colores que disponga del +of.options.CUSTOM_COLORS.tooltip.5=paquete de texturas seleccionado. + +of.options.SWAMP_COLORS=Colores pantanosos +of.options.SWAMP_COLORS.tooltip.1=Colores pantanosos. +of.options.SWAMP_COLORS.tooltip.2= NO – No usa colores pantanosos. (rápido) +of.options.SWAMP_COLORS.tooltip.3= SÍ - Usa colores pantanosos. (lento) +of.options.SWAMP_COLORS.tooltip.4=Esta opción afecta los colores del pasto, lianas, hojas y agua. + +of.options.SMOOTH_BIOMES=Biomas suavizados +of.options.SMOOTH_BIOMES.tooltip.1=Cambio entre biomas moderado y suavizado. +of.options.SMOOTH_BIOMES.tooltip.2= NO – Sin suavizado. (rápido) +of.options.SMOOTH_BIOMES.tooltip.3= SÍ – Suavizado. (lento) +of.options.SMOOTH_BIOMES.tooltip.4=El suavizado de las fronteras de los biomas colindantes se realiza +of.options.SMOOTH_BIOMES.tooltip.5=combinando y contemplando el color de los bloques de alrededor. +of.options.SMOOTH_BIOMES.tooltip.6=Solo afecta a hojas, pastos, lianas y agua. + +of.options.CONNECTED_TEXTURES=Texturas conectadas +of.options.CONNECTED_TEXTURES.tooltip.1=Textruas conectadas. +of.options.CONNECTED_TEXTURES.tooltip.2= NO – Sin texturas conectadas. Por defecto. +of.options.CONNECTED_TEXTURES.tooltip.3= Rápido – Texturas conectadas rápidas. +of.options.CONNECTED_TEXTURES.tooltip.4= Detallada – Texturas conectadas finas. +of.options.CONNECTED_TEXTURES.tooltip.5=Es la forma en la que la textura de los bloques de cristal, +of.options.CONNECTED_TEXTURES.tooltip.6=arena, librerías, se conectan entre sí cuando son puestas +of.options.CONNECTED_TEXTURES.tooltip.7=junto a otras del mismo. Las texturas como se unen +of.options.CONNECTED_TEXTURES.tooltip.8=depende del paquete de texturas seleccionado. + +of.options.NATURAL_TEXTURES=Texturas naturales +of.options.NATURAL_TEXTURES.tooltip.1=Apariencia normal y natural de la textura. +of.options.NATURAL_TEXTURES.tooltip.2= NO – Sin texturas mejoradas. Por defecto. +of.options.NATURAL_TEXTURES.tooltip.3= SÍ – Mejora la textura. +of.options.NATURAL_TEXTURES.tooltip.4=Esta opción evita que se tenga una visión repetitiva +of.options.NATURAL_TEXTURES.tooltip.5=de los bloques al juntar bloques del mismo tipo. +of.options.NATURAL_TEXTURES.tooltip.6=Usa variantes en el giro y la rotacón de la textura del +of.options.NATURAL_TEXTURES.tooltip.7=bloque. La configuración del ajuste depende del paquete +of.options.NATURAL_TEXTURES.tooltip.8=de texturas seleccionado. + +of.options.CUSTOM_SKY=Cielo personalizado +of.options.CUSTOM_SKY.tooltip.1=Cielo personalizado. +of.options.CUSTOM_SKY.tooltip.2= NO – Cielo predeterminado. (rápido) +of.options.CUSTOM_SKY.tooltip.3= SÍ – Texturas del cielo personalizadas. Por defecto. (lento) +of.options.CUSTOM_SKY.tooltip.4=La textura para el cielo personalizado es obtenida del +of.options.CUSTOM_SKY.tooltip.5=paquete de texturas seleccionado. + +of.options.CUSTOM_ITEMS=Obejetos personalizados +of.options.CUSTOM_ITEMS.tooltip.1=Usa texturas para los objetos. +of.options.CUSTOM_ITEMS.tooltip.2= NO – Texturas de objetos predeterminadas. (rápido) +of.options.CUSTOM_ITEMS.tooltip.3= SÍ – Texturas de objetos personalizadas. Por defecto. (lento) +of.options.CUSTOM_ITEMS.tooltip.4=Las texturas de los objetos personalizados se obtienen del +of.options.CUSTOM_ITEMS.tooltip.5=paquete de texturas seleccionado. + +# Details + +of.options.CLOUDS=Nube +of.options.CLOUDS.tooltip.1=Como se ven las nubes. +of.options.CLOUDS.tooltip.2= NO - Sin nubes. (más rápido) +of.options.CLOUDS.tooltip.3= Normal - Establecido en la configuración de calidad visual. +of.options.CLOUDS.tooltip.4= Rápida - Menor calidad. (rápido) +of.options.CLOUDS.tooltip.5= Detallada - Alta calidad. (lento) +of.options.CLOUDS.tooltip.6=Las nubes con menor calidad son renderizadas en 2D. +of.options.CLOUDS.tooltip.7=Las nubes con calidad alta son renderizadas en 3D. + +of.options.CLOUD_HEIGHT=Altitud de nube +of.options.CLOUD_HEIGHT.tooltip.1=Que tan arriba se muestran las nubes. +of.options.CLOUD_HEIGHT.tooltip.2= NO - Altitud por defecto. +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - Por encima del límite de altitud. + +of.options.TREES=Árboles +of.options.TREES.tooltip.1=Como se ven las hojas de los árboles. +of.options.TREES.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.TREES.tooltip.3= Rápida - Menor calidad. (más rápido) +of.options.TREES.tooltip.4= Dinámico - Mayor calidad. +of.options.TREES.tooltip.5= Detallada - Calidad alta. (más lento) +of.options.TREES.tooltip.6=Los árboles con menor calidad tienen las hojas opacas. +of.options.TREES.tooltip.7=Los árboles con mayor calidad o dinámicos tienen hojas transparentes. + +of.options.RAIN=Nieve y lluvia +of.options.RAIN.tooltip.1=Lluvia y nieve. +of.options.RAIN.tooltip.2= NO - Sin nieve o lluvia. (más rápido) +of.options.RAIN.tooltip.3= Normal - Establecido en la configuración de calidad visual. +of.options.RAIN.tooltip.4= Rápida - Lluvia y nive ligera. (rápido) +of.options.RAIN.tooltip.5= Detallada - Lluvia y nieve pesada. (lento) +of.options.RAIN.tooltip.6=Esta opción no afecta a las salpicaduras o al ruido de la +of.options.RAIN.tooltip.7=lluvia que se siguen mostrando. + +of.options.SKY=Cielo +of.options.SKY.tooltip.1=Cielo. +of.options.SKY.tooltip.2= NO - No se ve el cielo. (rápido) +of.options.SKY.tooltip.3= SÍ - Se ve el cielo. (lento) +of.options.SKY.tooltip.4=Si se desactiva, el sol y la luna aun pueden estar visibles. + +of.options.STARS=Estrellas +of.options.STARS.tooltip.1=Visibilidad de estrellas del cielo nocturno. +of.options.STARS.tooltip.2= NO - Las estrellas no son visibles. (rápido) +of.options.STARS.tooltip.3= SÍ - Las estrellas son visibles. (lento) + +of.options.SUN_MOON=Sol y luna +of.options.SUN_MOON.tooltip.1=Visibilidad de la luna y del sol. +of.options.SUN_MOON.tooltip.2= NO - El sol y la luna no son visibles. (más rápido) +of.options.SUN_MOON.tooltip.3= SÍ - El sol y la luna son visibles. Por defecto. + +of.options.SHOW_CAPES=Mostrar capas +of.options.SHOW_CAPES.tooltip.1=Muestra las capas en los jugadores. +of.options.SHOW_CAPES.tooltip.2= NO - No mostrar la capa de los jugadores. +of.options.SHOW_CAPES.tooltip.3= SÍ - Mostrar la capa de los jugadores. Por defecto. + +of.options.TRANSLUCENT_BLOCKS=Bloque translúcido +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Bloques con transparencia. +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rápida - Mezcla de colores ligera. (rápido) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= Detallada - Corrección definida de colores. (lento) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Controla el cambio de color entre bloques translúcidos (cristal +of.options.TRANSLUCENT_BLOCKS.tooltip.6=teñido, agua, hielo) cuando son puestos separados por aire. + +of.options.HELD_ITEM_TOOLTIPS=Item en mano +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Muestra información encima del hotbar al cambiar de item en mano. +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= NO - No muestra información. +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= SÍ - Muestra información. Por defecto. + +of.options.DROPPED_ITEMS=Items caídos +of.options.DROPPED_ITEMS.tooltip.1=Afecta como se ven los items. +of.options.DROPPED_ITEMS.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.DROPPED_ITEMS.tooltip.3= Rápida - Los items caídos se ven en 2D. (rápido) +of.options.DROPPED_ITEMS.tooltip.4= Detallada - Los items caídos se ven en 3D. (lento) + +options.entityShadows.tooltip.1=Sombra de entidades (mobs, jugadores, etcétera). +options.entityShadows.tooltip.2= NO - No muestra sombras de entidades. +options.entityShadows.tooltip.3= SÍ - Muestra sombras de entidades. + +of.options.VIGNETTE=Viñeta +of.options.VIGNETTE.tooltip.1=Efecto visual, ligeramente oscurece las esquinas en la pantalla. +of.options.VIGNETTE.tooltip.2= Normal - Establecido en la configuración de calidad visual. +of.options.VIGNETTE.tooltip.3= Rápida - Efecto desactivado. (rápido) +of.options.VIGNETTE.tooltip.4= Detallda - Efecto activado. (lento) +of.options.VIGNETTE.tooltip.5=Esta opción puede tener un impacto significativo en los FPS, +of.options.VIGNETTE.tooltip.6=especialmente cuando juega en pantalla completa. +of.options.VIGNETTE.tooltip.7=Este efecto es liviano por lo que puede ser desactivado +of.options.VIGNETTE.tooltip.8=con seguridad en cualquier momento. + +# Performance + +of.options.SMOOTH_FPS=Estabilizar FPS +of.options.SMOOTH_FPS.tooltip.1=Fija los FPS nivelando el buffer del driver de video. +of.options.SMOOTH_FPS.tooltip.2= NO - Sin estabilización. FPS cambiantes. +of.options.SMOOTH_FPS.tooltip.3= SÍ - Estabilización de FPS. +of.options.SMOOTH_FPS.tooltip.4=Esta opción depende del controlador de la tarjeta de gráficos. +of.options.SMOOTH_FPS.tooltip.5=Su efecto podría no siempre ser notorio. + +of.options.SMOOTH_WORLD=Carga ágil +of.options.SMOOTH_WORLD.tooltip.1=Disminuye el lag repentino causado por el servidor interno. +of.options.SMOOTH_WORLD.tooltip.2= NO - Sin estabilización. FPS variantes. +of.options.SMOOTH_WORLD.tooltip.3= SÍ - Estabiliza los FPS. +of.options.SMOOTH_WORLD.tooltip.4=Estabiliza los FPS, dividiendo la carga del servidor interno. +of.options.SMOOTH_WORLD.tooltip.5=Efectivo solo en mundos locales. + +of.options.FAST_RENDER=Renderizado rápido +of.options.FAST_RENDER.tooltip.1=Renderizado rápido. +of.options.FAST_RENDER.tooltip.2= NO - Renderizado estandard. Por defecto. +of.options.FAST_RENDER.tooltip.3= SÍ - Renderizado optimizado. (rápido) +of.options.FAST_RENDER.tooltip.4=Utiliza un algoritmo de renderizado optimizado que reduce +of.options.FAST_RENDER.tooltip.5=la carga del GPU, aumentando sustancialmente los FPS. + +of.options.FAST_MATH=Matemática avanzada +of.options.FAST_MATH.tooltip.1=Matemática avanzada. +of.options.FAST_MATH.tooltip.2= NO - Matemática estandard. Por defecto. +of.options.FAST_MATH.tooltip.3= SÍ - Matemática rápida. +of.options.FAST_MATH.tooltip.4=Utiliza funciones sin() y cos() optimizadas usando +of.options.FAST_MATH.tooltip.5=el cache del CPU e incrementa los FPS. + +of.options.CHUNK_UPDATES=Actualizaciones de chunks +of.options.CHUNK_UPDATES.tooltip.1=Carga de chunks del mapa por FPS (cuadros por segundo). +of.options.CHUNK_UPDATES.tooltip.2= 1 - Carga del mundo lenta. Más FPS. Por defecto. +of.options.CHUNK_UPDATES.tooltip.3= 3 - Carga del mundo rápida. Menos FPS. +of.options.CHUNK_UPDATES.tooltip.4= 5 - Carga del mundo más rápida. Menos FPS. +of.options.CHUNK_UPDATES.tooltip.5=Es el número de actualizaciones de los pedazos del mapa renderizados +of.options.CHUNK_UPDATES.tooltip.6=por FPS, valores muy altos pueden desestabilizar los FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Actualizaciones dinámicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Actualizaciones dinámicas de chunks. +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= NO - Actualizaciones de chunks por FPS estandar. Por defecto. +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= SÍ - Actualizaciones incluso cuando el jugador no se mueve. +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Esta opción facilita actualizaciones de chunks incluso mientras el +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=jugador no se mueve, para cargar el mundo mucho más rápido. + +of.options.LAZY_CHUNK_LOADING=Carga retardada +of.options.LAZY_CHUNK_LOADING.tooltip.1=Carga de los pedazos del mapa con retardo. +of.options.LAZY_CHUNK_LOADING.tooltip.2= NO - Carga de chunks determinada por el servidor. +of.options.LAZY_CHUNK_LOADING.tooltip.3= SÍ - Carga de chunks lenta. Más atractiva. +of.options.LAZY_CHUNK_LOADING.tooltip.4=Retraza en varios ticks la carga de chunks integrada por el +of.options.LAZY_CHUNK_LOADING.tooltip.5=servidor. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Desactiva esta opción si el mapa no se carga correctamente. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efectivo solo en mundos locales y con procesadores de 1 solo núcleo. + +# Animations + +of.options.animation.allOn=Activar todo +of.options.animation.allOff=Desactivar todo +of.options.animation.dynamic=Dinámico + +of.options.ANIMATED_WATER=Animación de agua +of.options.ANIMATED_LAVA=Animación de lava +of.options.ANIMATED_FIRE=Animación de fuego +of.options.ANIMATED_PORTAL=Animación del portal +of.options.ANIMATED_REDSTONE=Animación del redstone +of.options.ANIMATED_EXPLOSION=Animación de explosiones +of.options.ANIMATED_FLAME=Animación de fuego +of.options.ANIMATED_SMOKE=Animación de humo +of.options.VOID_PARTICLES=Partículas del Fin +of.options.WATER_PARTICLES=Partículas de agua +of.options.RAIN_SPLASH=Salpicadura de lluvia +of.options.PORTAL_PARTICLES=Partículas de portal +of.options.POTION_PARTICLES=Partículas de pociones +of.options.DRIPPING_WATER_LAVA=Goteo de agua y lava +of.options.ANIMATED_TERRAIN=Animación del terreno +of.options.ANIMATED_TEXTURES=Animación de texturas +of.options.FIREWORK_PARTICLES=Partículas de cohetes + +# Other + +of.options.LAGOMETER=Medidor de lag +of.options.LAGOMETER.tooltip.1=Muestra una gráfica en la pantalla de depuración (F3). +of.options.LAGOMETER.tooltip.2=* Naranja - Memoria desperdiciada. +of.options.LAGOMETER.tooltip.3=* Cian - Tick. +of.options.LAGOMETER.tooltip.4=* Azul - Tareas programadas. +of.options.LAGOMETER.tooltip.5=* Purpura - Carga de chunks. +of.options.LAGOMETER.tooltip.6=* Rojo - Actualizaciones de chunks. +of.options.LAGOMETER.tooltip.7=* Amarillo - Visibilidad. +of.options.LAGOMETER.tooltip.8=* Verde - Terreno de renderizado. + +of.options.PROFILER=Debug +of.options.PROFILER.tooltip.1=Perfil de debug. +of.options.PROFILER.tooltip.2= NO - Debug desactivado. (rápido) +of.options.PROFILER.tooltip.3= SÍ - Debug activado. (lento) +of.options.PROFILER.tooltip.4=Recopila información de debug y la muestra en +of.options.PROFILER.tooltip.5=la pantalla de dupuración (F3). + +of.options.WEATHER=Clima +of.options.WEATHER.tooltip.1=Clima. +of.options.WEATHER.tooltip.2= NO - Desactiva el clima. (rápido) +of.options.WEATHER.tooltip.3= SÍ - Activa el clima. (lento) +of.options.WEATHER.tooltip.4=Esta opción afecta a las lluvias, la nieve y las tormentas. +of.options.WEATHER.tooltip.5=Solo funciona en mundos locales. + +of.options.time.dayOnly=Día +of.options.time.nightOnly=Noche + +of.options.TIME=Tiempo +of.options.TIME.tooltip.1=Establece el momento del día. +of.options.TIME.tooltip.2= Normal - Ciclo de dia y noche normal. +of.options.TIME.tooltip.3= Día - Siempre es de día. +of.options.TIME.tooltip.4= Noche - Siempre es de noche. +of.options.TIME.tooltip.5=Esta opción solo es efectiva estando en modo creativo +of.options.TIME.tooltip.6=y en mundos locales. + +options.fullscreen.tooltip.1=Pantalla completa. +options.fullscreen.tooltip.2= NO - Modo de ventana. +options.fullscreen.tooltip.3= SÍ - Modo de pantalla completa. +options.fullscreen.tooltip.4=En pantalla completa funciona más rapido que en modo +options.fullscreen.tooltip.5=de ventana, dependiendo de la tarjeta de video. + +of.options.FULLSCREEN_MODE=Resolución +of.options.FULLSCREEN_MODE.tooltip.1=Dimensiones al entrar en modo pantalla completa. +of.options.FULLSCREEN_MODE.tooltip.2= Default - Se ajusta a la pantalla. (lento) +of.options.FULLSCREEN_MODE.tooltip.3= Ancho por Altura - Utiliza la resolución personalizada. +of.options.FULLSCREEN_MODE.tooltip.4=La resoulución de pantalla seleccionada es usada al entrar en pantalla +of.options.FULLSCREEN_MODE.tooltip.5=completa. Resouluciónes pequeñas generalmente son más rápidas. + +of.options.SHOW_FPS=Medidor de FPS +of.options.SHOW_FPS.tooltip.1=Despliega los FPS, además de otra información, resumida. +of.options.SHOW_FPS.tooltip.2= C: - Renderizado de chunks. +of.options.SHOW_FPS.tooltip.3= E: - Entidades y de bloques renderizadas. +of.options.SHOW_FPS.tooltip.4= U: - Actualizaciones de chunks. +of.options.SHOW_FPS.tooltip.5=La información solo se muestra cuando la pantalla +of.options.SHOW_FPS.tooltip.6=de depuración (F3) no es visible. + +of.options.save.default=Predeterminado (2s) +of.options.save.20s=20 s +of.options.save.3min=3 min +of.options.save.30min=30 min + +of.options.AUTOSAVE_TICKS=Autoguardado +of.options.AUTOSAVE_TICKS.tooltip.1=Intervalo de autoguardado de mundos locales. +of.options.AUTOSAVE_TICKS.tooltip.2= Predeterminado - Intervalo por defecto. NO RECOMENDADO. +of.options.AUTOSAVE_TICKS.tooltip.3=Esta función causa el famoso lag de la muerte. + +options.anaglyph.tooltip.1=La función de anaglifo 3D requiere de lentes 3D rojo-azul. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/et_EE.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/et_EE.lang new file mode 100644 index 0000000..fbfcc75 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/et_EE.lang @@ -0,0 +1,606 @@ +# General +of.general.ambiguous=ebamäärane +of.general.custom=Kohandatud +of.general.from=Kohast +of.general.id=ID +of.general.restart=taaskäivita +of.general.smart=tark + +# Keys +of.key.zoom=Suum + +# Message +of.message.aa.shaders1=Anti-aliasing ei ühildu varjutajatega. +of.message.aa.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.af.shaders1=Anisotroopiline filtreerimine ei ühildu varjutajatega. +of.message.af.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.fr.shaders1=Kiire renderdus ei ühildu varjutajatega. +of.message.fr.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.an.shaders1=3D-anaglüüf ei ühildu varjutajatega. +of.message.an.shaders2=Palun keela varjutajad selle valiku lubamiseks. + +of.message.shaders.aa1=Varjutajad ei ühildu anti-aliasing'uga. +of.message.shaders.aa2=Palun lülita Kvaliteet -> Anti-aliasing VÄLJA ja taaskäivita mäng. + +of.message.shaders.af1=Varjutajad ei ühildu anisotroopilise filtreerimisega. +of.message.shaders.af2=Palun lülita Kvaliteet -> Anisotroopiline filtr. VÄLJA. + +of.message.shaders.fr1=Varjutajad ei ühildu kiire renderdusega. +of.message.shaders.fr2=Palun lülita Jõudlus -> Kiire renderdus VÄLJA. + +of.message.shaders.an1=Varjutajad ei ühildu 3D-anaglüüfiga. +of.message.shaders.an2=Palun lülita Muu -> 3D-anaglüüf VÄLJA. + +of.message.newVersion=Uus §eOptiFine§f'i versioon on saadaval: §e%s§f +of.message.java64Bit=Sa võid jõudluse parandamiseks installida §e64-bitise Java§f. +of.message.openglError=§eOpenGL'i viga§f: %s (%s) + +of.message.shaders.loading=Varjutajate laadimine: %s + +of.message.other.reset=Lähtestad kõik graafikaseaded vaikimisi väärtustele? + +of.message.loadingVisibleChunks=Laadin nähtavaid kamakaid + +# Video settings + +options.graphics.tooltip.1=Visuaalne kvaliteet +options.graphics.tooltip.2= Kiire - madalam kvaliteet, kiirem +options.graphics.tooltip.3= Uhke - kõrgem kvaliteet, aeglasem +options.graphics.tooltip.4=Muudab pilvede, lehtede, vee, varjude ja muru külgede +options.graphics.tooltip.5=välimust. + +of.options.renderDistance.tiny=pisike +of.options.renderDistance.short=lühike +of.options.renderDistance.normal=tavaline +of.options.renderDistance.far=kauge +of.options.renderDistance.extreme=ekstreemne + +options.renderDistance.tooltip.1=Nähtav kaugus +options.renderDistance.tooltip.2= 2 pisike - 32m (kiireim) +options.renderDistance.tooltip.3= 4 lühike - 64m (kiirem) +options.renderDistance.tooltip.4= 8 tavaline - 128m +options.renderDistance.tooltip.5= 16 kauge - 256m (aeglasem) +options.renderDistance.tooltip.6= 32 ekstreemne - 512m (aeglaseim!) +options.renderDistance.tooltip.7=Ekstreemne nähtavuskaugus on väga ressursinõudlik! +options.renderDistance.tooltip.8=Väärtused üle "16 kauge" toimivad ainult kohalikes maailmades. + +options.ao.tooltip.1=Sujuv valgustus +options.ao.tooltip.2= VÄLJAS - sujuv valgustus puudub (kiirem) +options.ao.tooltip.3= Minimaalne - lihtne sujuv valgustus (aeglasem) +options.ao.tooltip.4= Maksimaalne - keeruline sujuv valgustus (aeglaseim) + +options.framerateLimit.tooltip.1=Maksimaalne kaadrisagedus +options.framerateLimit.tooltip.2= VSync - piira kuvari kaadrisagedusele (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - muutuja +options.framerateLimit.tooltip.4= Piiramatu - piirang puudub (kiireim) +options.framerateLimit.tooltip.5=Kaadrisageduse piirang alandab kaadrisagedust ka siis, +options.framerateLimit.tooltip.6=kui piirväärtuseni pole jõutud. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Sujuva valgustuse tase +of.options.AO_LEVEL.tooltip.1=Sujuva valgustuse tase +of.options.AO_LEVEL.tooltip.2= VÄLJAS - varjud puuduvad +of.options.AO_LEVEL.tooltip.3= 50%% - heledad varjud +of.options.AO_LEVEL.tooltip.4= 100%% - tumedad varjud + +options.viewBobbing.tooltip.1=Realistlikum liikumine. +options.viewBobbing.tooltip.2=Mipmappimist kasutades lülita see VÄLJA parimate tulemuste +options.viewBobbing.tooltip.3=saavutamiseks. +# Added extra row to tooltip + +options.guiScale.tooltip.1=Kasutajaliidese suurus +options.guiScale.tooltip.2= automaatne - maksimaalsuurus +options.guiScale.tooltip.3= väike, keskmine, suur - 1x kuni 3x +options.guiScale.tooltip.4= 4x kuni 10x - saadaval 4K ekraanidel +options.guiScale.tooltip.5=Paaritud arvud (1x, 3x, 5x, ...) ei ühildu Unicode'ga. +options.guiScale.tooltip.6=Väiksem kasutajaliides võib olla kiirem. + +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Kasutab alternatiivset renderdusmudelit, mis on tavaliselt +options.vbo.tooltip.3=vaikimisi renderdusest kiirem (5-10%%). + +options.gamma.tooltip.1=Muudab tumedamate objektide heledust. +options.gamma.tooltip.2= Tujukas - standardne heledus +options.gamma.tooltip.3= 1-99%% - muutuja +options.gamma.tooltip.4= Hele - maksimaalne heledus tumedamatele objektidele +options.gamma.tooltip.5=See valik ei muuda täiesti mustade objektide heledust. +options.gamma.tooltip.6= + +options.anaglyph.tooltip.1=3D-anaglüüf +options.anaglyph.tooltip.2=Lubab stereoskoopilise 3D-efekti, kasutades erinevaid +options.anaglyph.tooltip.3=värve eri silmadel. +options.anaglyph.tooltip.4=Vajab punasiniseid prille korralikuks vaatamiseks. + +of.options.ALTERNATE_BLOCKS=Alternatiivsed plokid +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternatiivsed plokid +of.options.ALTERNATE_BLOCKS.tooltip.2=Kasutab alternatiivseid plokimudeleid teatud plokkidel. +of.options.ALTERNATE_BLOCKS.tooltip.3=Sõltub valitud ressursipakist. + +of.options.FOG_FANCY=Udu +of.options.FOG_FANCY.tooltip.1=Udu tüüp +of.options.FOG_FANCY.tooltip.2= Kiire - kiirem udu +of.options.FOG_FANCY.tooltip.3= Uhke - aeglasem udu, näeb parem välja +of.options.FOG_FANCY.tooltip.4= VÄLJAS - udu puudub, kiireim +of.options.FOG_FANCY.tooltip.5=Uhke udu on saadaval vaid siis, kui see on toetatud +of.options.FOG_FANCY.tooltip.6=graafikakaardi poolt. + +of.options.FOG_START=Udu algus +of.options.FOG_START.tooltip.1=Udu algus +of.options.FOG_START.tooltip.2= 0.2 - udu algab mängija lähedalt +of.options.FOG_START.tooltip.3= 0.8 - udu algab mängijast kaugel +of.options.FOG_START.tooltip.4=See valik ei mõjuta tavaliselt jõudlust. + +of.options.CHUNK_LOADING=Kamakate laadimine +of.options.CHUNK_LOADING.tooltip.1=Kamakate laadimine +of.options.CHUNK_LOADING.tooltip.2= Vaikimisi - ebastabiilne kaadrisagedus kamakate laadimisel +of.options.CHUNK_LOADING.tooltip.3= Sujuv - stabiilne kaadrisagedus +of.options.CHUNK_LOADING.tooltip.4= Mitme tuumaga - stabiilne kaadrisagedus, 3x kiirem maailma laadimine +of.options.CHUNK_LOADING.tooltip.5=Sujuv ja mitme tuumaga eemaldavad kamakate laadimiselt +of.options.CHUNK_LOADING.tooltip.6=hakkimise ja külmumise. +of.options.CHUNK_LOADING.tooltip.7=Mitme tuuma režiim võib kiirendada maailma laadimist kuni 3x +of.options.CHUNK_LOADING.tooltip.8=ja suurendada kaadrisagedust, kasutades teist protsessori tuuma. +of.options.chunkLoading.smooth=sujuv +of.options.chunkLoading.multiCore=mitme tuumaga + +of.options.shaders=Varjutajad... +of.options.shadersTitle=Varjutajad + +of.options.shaders.packNone=VÄLJAS +of.options.shaders.packDefault=(sisemised) + +of.options.shaders.ANTIALIASING=Anti-aliasing +of.options.shaders.NORMAL_MAP=Tavaline kaart +of.options.shaders.SPECULAR_MAP=Peegelduv kaart +of.options.shaders.RENDER_RES_MUL=Renderduskvaliteet +of.options.shaders.SHADOW_RES_MUL=Varjukvaliteet +of.options.shaders.HAND_DEPTH_MUL=Käesügavus +of.options.shaders.CLOUD_SHADOW=Pilvevari +of.options.shaders.OLD_HAND_LIGHT=Vana käevalgustus +of.options.shaders.OLD_LIGHTING=Vana valgustus +of.options.shaders.SHADER_PACK=Varjutajapakk + +of.options.shaders.shadersFolder=Varjutajate kaust +of.options.shaders.shaderOptions=Varjutajate valikud... + +of.options.shaderOptionsTitle=Varjutajate valikud + +of.options.quality=Kvaliteet... +of.options.qualityTitle=Kvaliteedi seaded + +of.options.details=Detailid... +of.options.detailsTitle=Detailiseaded + +of.options.performance=Jõudlus... +of.options.performanceTitle=Jõudluse seaded + +of.options.animations=Animatsioonid... +of.options.animationsTitle=Animatiooniseaded + +of.options.other=Muu... +of.options.otherTitle=Muud seaded + +of.options.other.reset=Lähtesta graafikaseaded... + +of.shaders.profile=Profiil + +# Quality + +of.options.mipmap.bilinear=bilineaarne +of.options.mipmap.linear=lineaarne +of.options.mipmap.nearest=lähim +of.options.mipmap.trilinear=trilineaarne + +options.mipmapLevels.tooltip.1=Visuaalne efekt, mis muudab kauged objektid ilusamaks, +options.mipmapLevels.tooltip.2=siludes tekstuuridetaile. +options.mipmapLevels.tooltip.3= VÄLJAS - silumine puudub +options.mipmapLevels.tooltip.4= 1 - minimaalne silumine +options.mipmapLevels.tooltip.5= 4 - maksimaalne silumine +options.mipmapLevels.tooltip.6=See valik ei mõjuta tavaliselt jõudlust. + +of.options.MIPMAP_TYPE=Mipmappimistüüp +of.options.MIPMAP_TYPE.tooltip.1=Visuaalne efekt, mis muudab kauged objektid ilusamaks, +of.options.MIPMAP_TYPE.tooltip.2=siludes tekstuuridetaile. +of.options.MIPMAP_TYPE.tooltip.3= Lähim - jäme silumine (kiireim) +of.options.MIPMAP_TYPE.tooltip.4= Lineaarne - tavaline silumine +of.options.MIPMAP_TYPE.tooltip.5= Bilineaarne - peen silumine +of.options.MIPMAP_TYPE.tooltip.6= Trilineaarne - peeneim silumine (aeglaseim) + + +of.options.AA_LEVEL=Anti-aliasing +of.options.AA_LEVEL.tooltip.1=Anti-aliasing filter +of.options.AA_LEVEL.tooltip.2= VÄLJAS - (vaikimisi) anti-aliasing puudub (kiirem) +of.options.AA_LEVEL.tooltip.3= 2-16 - anti-aliasetud jooned ja servad (aeglasem) +of.options.AA_LEVEL.tooltip.4=Anti-aliasing silub sakilisi jooni ja teravaid värviüleminekuid. +of.options.AA_LEVEL.tooltip.5=Lubamisel võib see oluliselt alandada kaadrisagedust. +of.options.AA_LEVEL.tooltip.6=Kõik tasemed pole toetatud kõikidel graafikakaartidel. +of.options.AA_LEVEL.tooltip.7= +of.options.AA_LEVEL.tooltip.8=Jõustub pärast TAASKÄIVITUST! + +of.options.AF_LEVEL=Anisotroopiline filtr. +of.options.AF_LEVEL.tooltip.1=Anisotroopiline filtreerimine +of.options.AF_LEVEL.tooltip.2= VÄLJAS - (vaikimisi) standardsed tekstuuridetailid (kiirem) +of.options.AF_LEVEL.tooltip.3= 2-16 - peenemad detailid mipmapitud tekstuurides (aeglasem) +of.options.AF_LEVEL.tooltip.4=Anisotroopiline filtreerimine taastab detailid mipmapitud +of.options.AF_LEVEL.tooltip.5=tekstuurides. +of.options.AF_LEVEL.tooltip.6=Lubamisel võib see oluliselt alandada kaadrisagedust. + +of.options.CLEAR_WATER=Selge vesi +of.options.CLEAR_WATER.tooltip.1=Selge vesi +of.options.CLEAR_WATER.tooltip.2= SEES - selge, läbipaistev vesi +of.options.CLEAR_WATER.tooltip.3= VÄLJAS - vaikimisi vesi + +of.options.RANDOM_MOBS=Juhuslikud elukad +of.options.RANDOM_MOBS.tooltip.1=Juhuslikud elukad +of.options.RANDOM_MOBS.tooltip.2= VÄLJAS - juhuslikud elukad puuduvad, kiirem +of.options.RANDOM_MOBS.tooltip.3= SEES - juhuslikud elukad, aeglasem +of.options.RANDOM_MOBS.tooltip.4=Juhuslikud elukad kasutab suvalisi tekstuure mängu olemitel. +of.options.RANDOM_MOBS.tooltip.5=Vajab ressursipakki, millel on mitu elukatekstuuri. + +of.options.BETTER_GRASS=Parem muru +of.options.BETTER_GRASS.tooltip.1=Parem muru +of.options.BETTER_GRASS.tooltip.2= VÄLJAS - vaikimisi muru küljetekstuur, kiireim +of.options.BETTER_GRASS.tooltip.3= Kiire - täielik muru küljetekstuur, aeglasem +of.options.BETTER_GRASS.tooltip.4= Uhke - dünaamiline muru küljetekstuur, aeglaseim + +of.options.BETTER_SNOW=Parem lumi +of.options.BETTER_SNOW.tooltip.1=Parem lumi +of.options.BETTER_SNOW.tooltip.2= VÄLJAS - vaikimisi lumi, kiirem +of.options.BETTER_SNOW.tooltip.3= SEES - parem lumi, aeglasem +of.options.BETTER_SNOW.tooltip.4=Näitab lund läbipaistvate plokkide all (aed, kõrge muru), +of.options.BETTER_SNOW.tooltip.5=kui ääristada lumeplokkidega. + +of.options.CUSTOM_FONTS=Kohandatud fondid +of.options.CUSTOM_FONTS.tooltip.1=Kohandatud fondid +of.options.CUSTOM_FONTS.tooltip.2= SEES - kasutab kohandatud fonte (vaikimisi), aeglasem +of.options.CUSTOM_FONTS.tooltip.3= VÄLJAS - kasutab vaikimisi fonte, kiirem +of.options.CUSTOM_FONTS.tooltip.4=Kohandatud fonte pakub kasutatav ressursipakk. +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Kohandatud värvid +of.options.CUSTOM_COLORS.tooltip.1=Kohandatud värvid +of.options.CUSTOM_COLORS.tooltip.2= SEES - kasutab kohandatud värve (vaikimisi), aeglasem +of.options.CUSTOM_COLORS.tooltip.3= VÄLJAS - kasutab vaikimisi värve, kiirem +of.options.CUSTOM_COLORS.tooltip.4=Kohandatud värve pakub kasutatav ressursipakk. +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Soo värvid +of.options.SWAMP_COLORS.tooltip.1=Soo värvid +of.options.SWAMP_COLORS.tooltip.2= SEES - kasuta soo värve (vaikimisi), aeglasem +of.options.SWAMP_COLORS.tooltip.3= VÄLJAS - ära kasuta soo värve, kiirem +of.options.SWAMP_COLORS.tooltip.4=Soo värvid mõjutavad muru, lehti, vääte ja vett. + +of.options.SMOOTH_BIOMES=Sujuvad bioomid +of.options.SMOOTH_BIOMES.tooltip.1=Sujuvad bioomid +of.options.SMOOTH_BIOMES.tooltip.2= SEES - bioomide äärte silumine (vaikimisi), aeglasem +of.options.SMOOTH_BIOMES.tooltip.3= VÄLJAS - bioomide äärte silumine puudub, kiirem +of.options.SMOOTH_BIOMES.tooltip.4=Bioomide äärte silumine toimub kõikide ümbritsevate plokkide +of.options.SMOOTH_BIOMES.tooltip.5=juhuslike värvide ja värvide keskmise leidmisega. +of.options.SMOOTH_BIOMES.tooltip.6=Mõjutab muru, lehti, vääte ja vett. + +of.options.CONNECTED_TEXTURES=Ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.1=Ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.2= VÄLJAS - ühendatud tekstuurid puuduvad (vaikimisi) +of.options.CONNECTED_TEXTURES.tooltip.3= Kiire - kiired ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.4= Uhke - uhked ühendatud tekstuurid +of.options.CONNECTED_TEXTURES.tooltip.5=Ühendatud tekstuurid ühendab klaasi, liivakivi ja +of.options.CONNECTED_TEXTURES.tooltip.6=raamaturiiulid, kui need on asetatud kõrvuti. +of.options.CONNECTED_TEXTURES.tooltip.7=Ühendatud tekstuure pakub kasutatav ressursipakk. +of.options.CONNECTED_TEXTURES.tooltip.8= + +of.options.NATURAL_TEXTURES=Naturaalsed tekstuurid +of.options.NATURAL_TEXTURES.tooltip.1=Naturaalsed tekstuurid +of.options.NATURAL_TEXTURES.tooltip.2= VÄLJAS - naturaalsed tekstuurid puuduvad (vaikimisi) +of.options.NATURAL_TEXTURES.tooltip.3= SEES - kasuta naturaalseid tekstuure +of.options.NATURAL_TEXTURES.tooltip.4=Naturaalsed tekstuurid eemaldavad võretaolise mustri, +of.options.NATURAL_TEXTURES.tooltip.5=mille loovad sama tüüpi korduvad plokid. See kasutab +of.options.NATURAL_TEXTURES.tooltip.6=pööratud ja peegeldatud variante põhiploki tekstuurist. +of.options.NATURAL_TEXTURES.tooltip.7=Naturaalsete tekstuuride konfiguratsiooni pakub +of.options.NATURAL_TEXTURES.tooltip.8=kasutatav ressursipakk. + +of.options.EMISSIVE_TEXTURES=Kiirgavad tekstuurid +of.options.EMISSIVE_TEXTURES.tooltip.1=Kiirgavad tekstuurid +of.options.EMISSIVE_TEXTURES.tooltip.2= OFF - kiirgavad tekstuurid puuduvad (vaikimisi) +of.options.EMISSIVE_TEXTURES.tooltip.3= ON - kasuta kiirgavaid tekstuure +of.options.EMISSIVE_TEXTURES.tooltip.4=Kiirgavad tekstuurid renderdatakse täisheledusega +of.options.EMISSIVE_TEXTURES.tooltip.5=kuvatud ülekatetena. Neid saab kasutada, et simuleerida +of.options.EMISSIVE_TEXTURES.tooltip.6=baastekstuuri valgust eritavaid osi. +of.options.EMISSIVE_TEXTURES.tooltip.7=Kiirgavaid teksuure pakub kasutatav ressursipakk. +of.options.EMISSIVE_TEXTURES.tooltip.8= + +of.options.CUSTOM_SKY=Kohandatud taevas +of.options.CUSTOM_SKY.tooltip.1=Kohandatud taevas +of.options.CUSTOM_SKY.tooltip.2= SEES - kohandatud taevatekstuurid (vaikimisi), aeglane +of.options.CUSTOM_SKY.tooltip.3= VÄLJAS - vaikimisi taevas, kiirem +of.options.CUSTOM_SKY.tooltip.4=Kohandatud taevatekstuure pakub kasutatav ressursipakk. +of.options.CUSTOM_SKY.tooltip.5= + +of.options.CUSTOM_ITEMS=Kohandatud esemed +of.options.CUSTOM_ITEMS.tooltip.1=Kohandatud esemed +of.options.CUSTOM_ITEMS.tooltip.2= SEES - kohandatud esemetekstuurid (vaikimisi), aeglane +of.options.CUSTOM_ITEMS.tooltip.3= VÄLJAS - vaikimisi esemetekstuurid, kiirem +of.options.CUSTOM_ITEMS.tooltip.4=Kohandatud esemetekstuure pakub kasutatav ressursipakk. +of.options.CUSTOM_ITEMS.tooltip.5= + +of.options.CUSTOM_ENTITY_MODELS=Kohandatud olemimudelid +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Kohandatud olemimudelid +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= SEES - kohandatud olemimudelid (vaikimisi), aeglane +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= VÄLJAS - vaikimisi olemimudelid, kiirem +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Kohandatud olemimudeleid pakub kasutatav ressursipakk. +of.options.CUSTOM_ENTITY_MODELS.tooltip.5= + +of.options.CUSTOM_GUIS=Kohandatud liidesed +of.options.CUSTOM_GUIS.tooltip.1=Kohandatud kasutajaliidesed +of.options.CUSTOM_GUIS.tooltip.2= SEES - kohandatud kasutajaliidesed (vaikimisi), aeglasem +of.options.CUSTOM_GUIS.tooltip.3= VÄLJAS - vaikimisi kasutajaliidesed, kiirem +of.options.CUSTOM_GUIS.tooltip.4=Kohandatud kasutajaliideseid pakub kasutatav ressursipakk. + +# Details + +of.options.CLOUDS=Pilved +of.options.CLOUDS.tooltip.1=Pilved +of.options.CLOUDS.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.CLOUDS.tooltip.3= Kiire - madalam kvaliteet, kiirem +of.options.CLOUDS.tooltip.4= Uhke - kõrgem kvaliteet, aeglasem +of.options.CLOUDS.tooltip.5= VÄLJAS - pilved puuduvad, kiireim +of.options.CLOUDS.tooltip.6=Kiired pilved renderdatakse 2Dna. +of.options.CLOUDS.tooltip.7=Uhked pilved renderdatakse 3Dna. + +of.options.CLOUD_HEIGHT=Pilvekõrgus +of.options.CLOUD_HEIGHT.tooltip.1=Pilvekõrgus +of.options.CLOUD_HEIGHT.tooltip.2= VÄLJAS - vaikimisi kõrgus +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - maailma kõrguspiirangust kõrgemal + +of.options.TREES=Puud +of.options.TREES.tooltip.1=Puud +of.options.TREES.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.TREES.tooltip.3= Kiire - madalam kvaliteet, kiirem +of.options.TREES.tooltip.4= Tark - kõrgem kvaliteet, kiire +of.options.TREES.tooltip.5= Uhke - kõrgeim kvaliteet, aeglasem +of.options.TREES.tooltip.6=Kiiretel puudel on läbipaistmatud lehed. +of.options.TREES.tooltip.7=Uhketel ja tarkadel puudel on läbipaistvad lehed. + +of.options.RAIN=Vihm ja lumi +of.options.RAIN.tooltip.1=Vihm ja lumi +of.options.RAIN.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.RAIN.tooltip.3= Kiire - kerge vihm/lumi, kiirem +of.options.RAIN.tooltip.4= Uhke - tugev vihm/lumi, aeglasem +of.options.RAIN.tooltip.5= VÄLJAS - vihm/lumi puuduvad, kiireim +of.options.RAIN.tooltip.6=Kui vihm on VÄLJAS, on vihma helid ja plärtsatused siiski +of.options.RAIN.tooltip.7=toimivad. + +of.options.SKY=Taevas +of.options.SKY.tooltip.1=Taevas +of.options.SKY.tooltip.2= SEES - taevas on nähtav, aeglasem +of.options.SKY.tooltip.3= VÄLJAS - taevas pole nähtav, kiirem +of.options.SKY.tooltip.4=Kui taevas on VÄLJAS, on kuu ja päike siiski nähtavad. + +of.options.STARS=Tähed +of.options.STARS.tooltip.1=Tähed +of.options.STARS.tooltip.2= SEES - tähed on nähtavad, aeglasem +of.options.STARS.tooltip.3= VÄLJAS - tähed pole nähtavad, kiirem + +of.options.SUN_MOON=Päike ja kuu +of.options.SUN_MOON.tooltip.1=Päike ja kuu +of.options.SUN_MOON.tooltip.2= SEES - päike ja kuu on nähtavad (vaikimisi) +of.options.SUN_MOON.tooltip.3= VÄLJAS - päike ja kuu pole nähtavad (kiirem) + +of.options.SHOW_CAPES=Keebid +of.options.SHOW_CAPES.tooltip.1=Keebid +of.options.SHOW_CAPES.tooltip.2= SEES - kuva mängijate keebid (vaikimisi) +of.options.SHOW_CAPES.tooltip.3= VÄLJAS - ära kuva mängijate keepe + +of.options.TRANSLUCENT_BLOCKS=Läbikumavad plokid +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Läbikumavad plokid +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Uhke - korrektne värvide üleminek (vaikimisi) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Kiire - kiire värvide üleminek (kiirem) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Juhib erinevate värvidega poolläbipaistvate plokkide +of.options.TRANSLUCENT_BLOCKS.tooltip.5=(toonitud klaas, vesi, jää) värvide üleminekut, +of.options.TRANSLUCENT_BLOCKS.tooltip.6=kui need on asetatud õhuvahega üksteise taha. + +of.options.HELD_ITEM_TOOLTIPS=Esemete näpunäited +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Käeshoitavate esemete näpunäited +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= SEES - kuva näpunäiteid käeshoitavatel esemetel (vaikimisi) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= VÄLJAS - ära kuva näpunäiteid käeshoitavatel esemetel + +of.options.ADVANCED_TOOLTIPS=Täpsemad näpunäited +of.options.ADVANCED_TOOLTIPS.tooltip.1=Täpsemad näpunäited +of.options.ADVANCED_TOOLTIPS.tooltip.2= SEES - kuva täpsemad näpunäited +of.options.ADVANCED_TOOLTIPS.tooltip.3= VÄLJAS - peida täpsemad näpunäited (vaikimisi) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Täpsemad näpunäited kuvavad laiendatud infot +of.options.ADVANCED_TOOLTIPS.tooltip.5=esemete kohta (ID, vastupidavus) ja varjutajate +of.options.ADVANCED_TOOLTIPS.tooltip.6=valikute kohta (ID, allikas, vaikeväärtus). + +of.options.DROPPED_ITEMS=Visatud esemed +of.options.DROPPED_ITEMS.tooltip.1=Maha visatud esemed +of.options.DROPPED_ITEMS.tooltip.2= Vaikimisi - nagu määrab seade Graafika +of.options.DROPPED_ITEMS.tooltip.3= Kiire - visatud esemed 2Dna, kiirem +of.options.DROPPED_ITEMS.tooltip.4= Uhke - visatud esemed 3Dna, aeglasem + +options.entityShadows.tooltip.1=Olemite varjud +options.entityShadows.tooltip.2= SEES - kuva olemite varje +options.entityShadows.tooltip.3= VÄLJAS - ära kuva olemite varje + +of.options.VIGNETTE=Vinjett +of.options.VIGNETTE.tooltip.1=Visuaalne efekt, mis tumendab kergelt ekraani nurki. +of.options.VIGNETTE.tooltip.2= Vaikimisi - nagu määrab seade Graafika (vaikimisi) +of.options.VIGNETTE.tooltip.3= Kiire - vinjett keelatud (kiirem) +of.options.VIGNETTE.tooltip.4= Uhke - vinjett lubatud (aeglasem) +of.options.VIGNETTE.tooltip.5=Vinjett võib oluliselt mõjutada kaadrisagedust, +of.options.VIGNETTE.tooltip.6=eriti kui mängida täisekraanil. +of.options.VIGNETTE.tooltip.7=Vinjetiefekt on vaevu hoomatav, seda võib ohutult keelata. +of.options.VIGNETTE.tooltip.8= + +of.options.DYNAMIC_FOV=Dünaamiline vaateväli +of.options.DYNAMIC_FOV.tooltip.1=Dünaamiline vaateväli +of.options.DYNAMIC_FOV.tooltip.2= SEES - luba dünaamiline vaateväli (vaikimisi) +of.options.DYNAMIC_FOV.tooltip.3= VÄLJAS - keela dünaamiline vaateväli +of.options.DYNAMIC_FOV.tooltip.4=Muudab vaatevälja lennates, joostes või vibu tõmmates. +of.options.DYNAMIC_FOV.tooltip.5= + +of.options.DYNAMIC_LIGHTS=Dünaamiline valgustus +of.options.DYNAMIC_LIGHTS.tooltip.1=Dünaamiline valgustus +of.options.DYNAMIC_LIGHTS.tooltip.2= VÄLJAS - dünaamiline valgustus puudub (vaikimisi) +of.options.DYNAMIC_LIGHTS.tooltip.3= Kiire - kiire dünaamiline valgustus (uuendatud 500 ms järel) +of.options.DYNAMIC_LIGHTS.tooltip.4= Uhke - uhke dünaamiline valgustus (uuendatud reaalajas) +of.options.DYNAMIC_LIGHTS.tooltip.5=Lubab valgust kiirgavatel esemetel (tõrvik, hõõgkivi jne) +of.options.DYNAMIC_LIGHTS.tooltip.6=käes hoides või maha visates valgustada ümbritsevat ala. +of.options.DYNAMIC_LIGHTS.tooltip.7= + +# Performance + +of.options.SMOOTH_FPS=Sujuv kaadrisagedus +of.options.SMOOTH_FPS.tooltip.1=Stabiliseerib ks, tühjendades graafikadraiveri puhvrit. +of.options.SMOOTH_FPS.tooltip.2= VÄLJAS - stabiliseerimine puudub, ks võib kõikuda +of.options.SMOOTH_FPS.tooltip.3= SEES - kaadrisageduse stabiliseerimine +of.options.SMOOTH_FPS.tooltip.4=See valik sõltub graafikadraiveritest ning selle efekt +of.options.SMOOTH_FPS.tooltip.5=ei pruugi alati nähtav olla. + +of.options.SMOOTH_WORLD=Sujuv maailm +of.options.SMOOTH_WORLD.tooltip.1=Eemaldab siseserveri poolt põhjustatud "latentsusokkaid". +of.options.SMOOTH_WORLD.tooltip.2= VÄLJAS - stabiliseerimine puudub, ks võib kõikuda +of.options.SMOOTH_WORLD.tooltip.3= SEES - kaadrisageduse stabiliseerimine +of.options.SMOOTH_WORLD.tooltip.4=Stabiliseerib kaadrisagedust, jaotades sisemise serveri +of.options.SMOOTH_WORLD.tooltip.5=koormust. Toimib ainult kohalikes maailmades (üksikmäng). + +of.options.FAST_RENDER=Kiire renderdus +of.options.FAST_RENDER.tooltip.1=Kiire renderdus +of.options.FAST_RENDER.tooltip.2= VÄLJAS - standardne renderdus (vaikimisi) +of.options.FAST_RENDER.tooltip.3= SEES - optimeeritud renderdus (kiirem) +of.options.FAST_RENDER.tooltip.4=Kasutab optimeeritud renderduse algoritmi, mis vähendab +of.options.FAST_RENDER.tooltip.5=graafikaprotsessori koormust ja võib oluliselt tõsta ks. + +of.options.FAST_MATH=Kiire matemaatika +of.options.FAST_MATH.tooltip.1=Kiire matemaatika +of.options.FAST_MATH.tooltip.2= VÄLJAS - standardne matemaatika (vaikimisi) +of.options.FAST_MATH.tooltip.3= SEES - kiirem matemaatika +of.options.FAST_MATH.tooltip.4=Kasutab optimeeritud sin() ja cos() funktsioone, mis võivad +of.options.FAST_MATH.tooltip.5=paremini rakendada protsessori vahemälu ja tõsta ks. + +of.options.CHUNK_UPDATES=Kamakauuendused +of.options.CHUNK_UPDATES.tooltip.1=Kamakate uuendused +of.options.CHUNK_UPDATES.tooltip.2= 1 - aeglasem maailma laadimine, kõrgem ks (vaikimisi) +of.options.CHUNK_UPDATES.tooltip.3= 3 - kiirem maailma laadimine, madalam ks +of.options.CHUNK_UPDATES.tooltip.4= 5 - kiireim maailma laadimine, madalaim ks +of.options.CHUNK_UPDATES.tooltip.5=Kamakate uuenduste arv renderdatud kaadri kohta, +of.options.CHUNK_UPDATES.tooltip.6=kõrgemad väärtused võivad ks destabiliseerida. + +of.options.CHUNK_UPDATES_DYNAMIC=Dünaamilised uuendused +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dünaamilised kamakauuendused +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= VÄLJAS - (vaikimisi) standardsed uuendused kaadri kohta +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= SEES - rohkem uuendusi, kuni mängija seisab paigal +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dünaamilised uuendused sunnivad rohkem kamakauuendusi, +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=kuni mängija seisab paigal, et laadida maailma kiiremini. + +of.options.LAZY_CHUNK_LOADING=Laisk kamakalaadimine +of.options.LAZY_CHUNK_LOADING.tooltip.1=Laisk kamakate laadimine +of.options.LAZY_CHUNK_LOADING.tooltip.2= VÄLJAS - vaikimisi serveri kamakalaadimine +of.options.LAZY_CHUNK_LOADING.tooltip.3= SEES - laisk serveri kamakalaadimine (sujuvam) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Silub integreeritud serveri kamakalaadimist, jaotades +of.options.LAZY_CHUNK_LOADING.tooltip.5=kamakaid mitmete tick'ide vahel. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Lülita VÄLJA, kui osa maailmast ei laadi korralikult. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Töötab ainult kohalikes maailmades (üksikmäng). + +# Animations + +of.options.animation.allOn=Kõik SISSE +of.options.animation.allOff=Kõik VÄLJA +of.options.animation.dynamic=Dünaamiline + +of.options.ANIMATED_WATER=Veeanimatsioon +of.options.ANIMATED_LAVA=Laavaanimatsioon +of.options.ANIMATED_FIRE=Tuleanimatsioon +of.options.ANIMATED_PORTAL=Portaalianimatsioon +of.options.ANIMATED_REDSTONE=Redstone-animatsioon +of.options.ANIMATED_EXPLOSION=Plahvatuse animatsioon +of.options.ANIMATED_FLAME=Leegi animatsioon +of.options.ANIMATED_SMOKE=Suitsuanimatsioon +of.options.VOID_PARTICLES=Tühjuse osakesed +of.options.WATER_PARTICLES=Veeosakesed +of.options.RAIN_SPLASH=Vihmaplärtsatused +of.options.PORTAL_PARTICLES=Portaaliosakesed +of.options.POTION_PARTICLES=Võlujoogiosakesed +of.options.DRIPPING_WATER_LAVA=Tilkuv vesi/laava +of.options.ANIMATED_TERRAIN=Maastikuanimatsioon +of.options.ANIMATED_TEXTURES=Tekstuurianimatsioon +of.options.FIREWORK_PARTICLES=Ilutulestiku osakesed + +# Other + +of.options.LAGOMETER=Latentsusmõõdik +of.options.LAGOMETER.tooltip.1=Kuvab latentsusmõõdikut silumisvaatel (F3). +of.options.LAGOMETER.tooltip.2=* Oranž - mälu prahikogumine +of.options.LAGOMETER.tooltip.3=* Tsüaansinine - tick'id +of.options.LAGOMETER.tooltip.4=* Sinine - ajastatud käivitatavad +of.options.LAGOMETER.tooltip.5=* Lilla - kamaka üleslaadimine +of.options.LAGOMETER.tooltip.6=* Punane - kamakauuendused +of.options.LAGOMETER.tooltip.7=* Kollane - nähtavuskontroll +of.options.LAGOMETER.tooltip.8=* Roheline - maastiku renderdus + +of.options.PROFILER=Silumisprofiilija +of.options.PROFILER.tooltip.1=Silumisprofiilija +of.options.PROFILER.tooltip.2= SEES - silumisprofiilija on aktiivne, aeglasem +of.options.PROFILER.tooltip.3= VÄLJAS - silumisprofiilija pole aktiivne, kiirem +of.options.PROFILER.tooltip.4=Silumisprofiilija kogub ja kuvab silumisinfot, kui +of.options.PROFILER.tooltip.5=silumisvaade on avatud (F3). + +of.options.WEATHER=Ilm +of.options.WEATHER.tooltip.1=Ilm +of.options.WEATHER.tooltip.2= SEES - ilm on aktiivne, aeglasem +of.options.WEATHER.tooltip.3= VÄLJAS - ilm pole aktiivne, kiirem +of.options.WEATHER.tooltip.4=Ilm juhib vihma, lund ja äikest. +of.options.WEATHER.tooltip.5=Ilma juhtimine on võimalik ainult kohalikes maailmades. + +of.options.time.dayOnly=ainult päev +of.options.time.nightOnly=ainult öö + +of.options.TIME=Aeg +of.options.TIME.tooltip.1=Aeg +of.options.TIME.tooltip.2= Vaikimisi - tavaline ööpäevatsükkel +of.options.TIME.tooltip.3= Ainult päev - ainult päev +of.options.TIME.tooltip.4= Ainult öö - ainult öö +of.options.TIME.tooltip.5=Aja seadistus töötab ainult kohalikes maailmades LOOMINGU- +of.options.TIME.tooltip.6=režiimis. + +options.fullscreen.tooltip.1=Täisekraan +options.fullscreen.tooltip.2= SEES - kasuta täisekraanirežiimi +options.fullscreen.tooltip.3= VÄLJAS - kasuta aknarežiimi +options.fullscreen.tooltip.4=Täisekraanirežiim võib olla kiirem või aeglasem +options.fullscreen.tooltip.5=aknarežiimist, olenevalt graafikakaardist. + +of.options.FULLSCREEN_MODE=Täisekraanirežiim +of.options.FULLSCREEN_MODE.tooltip.1=Täisekraanirežiim +of.options.FULLSCREEN_MODE.tooltip.2= Vaikimisi - kasuta töölaua ekraaniresolutsiooni, aeglasem +of.options.FULLSCREEN_MODE.tooltip.3= L x K - kasuta kohandatud ekraaniresolutsiooni, võib olla kiirem +of.options.FULLSCREEN_MODE.tooltip.4=Valitud resolutsiooni kasutatakse täisekraanirežiimis (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Madalamad resolutsioonid peaksid tavaliselt olema kiiremad. + +of.options.SHOW_FPS=Kaadrisageduse kuva +of.options.SHOW_FPS.tooltip.1=Kuvab kompaktselt kaadrisageduse ja renderduse infot. +of.options.SHOW_FPS.tooltip.2= C: - kamaka renderdajaid +of.options.SHOW_FPS.tooltip.3= E: - renderdatud olemeid + plokiolemeid +of.options.SHOW_FPS.tooltip.4= U: - kamakauuendusi +of.options.SHOW_FPS.tooltip.5=Kompaktset kaadrisageduse infot kuvatakse vaid siis, +of.options.SHOW_FPS.tooltip.6=kui silumisvaade pole nähtav. + +of.options.save.default=vaik. (2 s) +of.options.save.20s=20 s +of.options.save.3min=3 min +of.options.save.30min=30 min + +of.options.AUTOSAVE_TICKS=Automaatne salvestus +of.options.AUTOSAVE_TICKS.tooltip.1=Automaatse salvestuse intervall +of.options.AUTOSAVE_TICKS.tooltip.2=Vaikimisi automaatse salvestuse intervall (2 s) POLE +of.options.AUTOSAVE_TICKS.tooltip.3=SOOVITATAV. Automaatne salvestus põhjustab kurikuulsa +of.options.AUTOSAVE_TICKS.tooltip.4="surmava latentsusokka". +# Added extra row to tooltip + +of.options.SCREENSHOT_SIZE=Kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.1=Kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.2= Vaikimisi - vaikimisi kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - kohandatud kuvatõmmise suurus +of.options.SCREENSHOT_SIZE.tooltip.4=Suurema kuvatõmmise loomine võib vajada rohkem mälu. +of.options.SCREENSHOT_SIZE.tooltip.5=Ei ühildu kiire renderduse ega anti-aliasing'uga. +of.options.SCREENSHOT_SIZE.tooltip.6=Vajab graafikakaardi framebuffer'i tuge. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/fr_CA.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/fr_CA.lang new file mode 100644 index 0000000..d2affc8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/fr_CA.lang @@ -0,0 +1,592 @@ +#Traduit en français par Z0ul0u25 + +# General +of.general.ambiguous=Ambigue +of.general.custom=Personnalisé +of.general.from=De +of.general.id=ID +of.general.restart=Redémarer +of.general.smart=Intelligent + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=L'Anticrénelage n'est pas compatible avec les Shaders. +of.message.aa.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.af.shaders1=Le Filtrage Anisotropique n'est pas compatible avec les Shaders. +of.message.af.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.fr.shaders1=Le Rendu Rapide n'est pas compatible avec les Shaders. +of.message.fr.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.an.shaders1=L'Anaglyphe 3D n'est pas compatible avec les Shaders. +of.message.an.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.shaders.aa1=Les Shaders ne sont pas compatible avec l'Anticrénelage. +of.message.shaders.aa2=Veuillez fixé Qualité -> Anticrénelage à OFF puis redémarrer le jeu. + +of.message.shaders.af1=Les Shaders ne sont pas compatible avec le Filtrage Anisotropique. +of.message.shaders.af2=Veuillez fixé Qualité -> Filtrage Anisotropique à OFF. + +of.message.shaders.fr1=Les Shaders ne sont pas compatible avec le Rendu Rapide. +of.message.shaders.fr2=Veuillez fixé Performance -> Rendu Rapide à OFF. + +of.message.shaders.an1=Les Shaders ne sont pas compatible avec l'Anaglyphe 3D. +of.message.shaders.an2=Veuillez configurer Autre -> Anaglyphe 3D à OFF. + +of.message.newVersion=Une nouvelle version d'§eOptiFine§f est disponible: §e%s§f +of.message.java64Bit=Pour de meilleure performance, installer une version §e64-bit de Java§f +of.message.openglError=§eErreur OpenGL§f: %s (%s) + +of.message.shaders.loading=Chargement des Shaders: %s + +of.message.other.reset=Réinitialiser tous les réglages vidéos à leurs valeurs par défaut? + +of.message.loadingVisibleChunks=Chargement des Chunks visible + +# Video settings + +options.graphics.tooltip.1=Qualité visuel +options.graphics.tooltip.2= Rapide - Basse qualité (Rapide) +options.graphics.tooltip.3= Détaillée - Haute qualité (Lent) +options.graphics.tooltip.4=Change l'apparence des nuages, des feuilles, +options.graphics.tooltip.5=de l'eau, des ombres et du côté de l'herbe. + +of.options.renderDistance.tiny=Mini +of.options.renderDistance.short=Courte +of.options.renderDistance.normal=Normale +of.options.renderDistance.far=Loin +of.options.renderDistance.extreme=Extrême + +options.renderDistance.tooltip.1=Distance de Rendu +options.renderDistance.tooltip.2= 2 Mini - 32m (Très rapide) +options.renderDistance.tooltip.3= 4 courte - 64m (Rapide) +options.renderDistance.tooltip.4= 8 Normale - 128m +options.renderDistance.tooltip.5= 16 Loin - 256m (Lent) +options.renderDistance.tooltip.6= 32 Extrême - 512m (Très lent) +options.renderDistance.tooltip.7=La distance de rendu Extrême est très gourmande en ressources! +options.renderDistance.tooltip.8=Les valeurs au-dessus de 16 n'ont effet qu'en solo. + +options.ao.tooltip.1=Luminosité adoucie +options.ao.tooltip.2= OFF - aucun adoucissement (rapide) +options.ao.tooltip.3= Minimum - Adoucissement simple (Lent) +options.ao.tooltip.4= Maximum - Adoucissement complexe (Très lent) + +options.framerateLimit.tooltip.1=FPS Max +options.framerateLimit.tooltip.2= VSync - limite du moniteur (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variable +options.framerateLimit.tooltip.4= Illimitée - sans limite (Très rapide) +options.framerateLimit.tooltip.5=La limite de FPS diminue le taux d'image par seconde +options.framerateLimit.tooltip.6=même si la valeur limite n'est pas atteinte. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Ombres adoucies +of.options.AO_LEVEL.tooltip.1=Ombres adoucies +of.options.AO_LEVEL.tooltip.2= OFF - aucune ombre +of.options.AO_LEVEL.tooltip.3= 50%% - légères ombres +of.options.AO_LEVEL.tooltip.4= 100%% - fortes ombres + +options.viewBobbing.tooltip.1=Mouvements plus réalistes. +options.viewBobbing.tooltip.2=Lors de l'utilisation du mipmaps, configurer à OFF pour de meilleurs résultats. + +options.guiScale.tooltip.1=Taille du GUI +options.guiScale.tooltip.2= Auto - taille maximale +options.guiScale.tooltip.3= Petite, Normale, Grande - 1x à 3x +options.guiScale.tooltip.4= 4x à 10x - Disponible pour moniteur 4K +options.guiScale.tooltip.5=Les valeurs impaires (1x, 3x, 5x ...) ne sont pas compatible avec l'Unicode. +options.guiScale.tooltip.2=Un GUI petit serai plus rapide + +options.vbo.tooltip.1=Objets de Mémoire Tampon +options.vbo.tooltip.2=Utilises des modèles de rendu qui sont habituellement +options.vbo.tooltip.3=plus rapides (5-10%%) que le rendu par défaut. + +options.gamma.tooltip.1=Change la luminosité des endroits sombres +options.gamma.tooltip.2= Sombre - luminosité standard +options.gamma.tooltip.3= 1-99%% - variable +options.gamma.tooltip.4= Lumineux - luminosité maximale pour les objets sombres +options.gamma.tooltip.5=Cette option ne change pas la luminosité des +options.gamma.tooltip.6=objets complètement noirs + +options.anaglyph.tooltip.1=Anaglyphe 3D +options.anaglyph.tooltip.2=Active un effet stéréoscopique 3D utilisant différentes couleurs +options.anaglyph.tooltip.3=pour chaque œil. +options.anaglyph.tooltip.4=Nécessite des lunettes rouge-cyan pour une vue adéquate. + +of.options.ALTERNATE_BLOCKS=Blocs Alternatif +of.options.ALTERNATE_BLOCKS.tooltip.1=Alterne les Blocs +of.options.ALTERNATE_BLOCKS.tooltip.2=Utilises des modèles alternatifs pour certains blocs. +of.options.ALTERNATE_BLOCKS.tooltip.3=Dépend du pack de ressources sélectionné. + +of.options.FOG_FANCY=Brouillard +of.options.FOG_FANCY.tooltip.1=Type de Brouillard +of.options.FOG_FANCY.tooltip.2= Rapide - brouillard rapide +of.options.FOG_FANCY.tooltip.3= Détaillé - meilleure apparence (Plus lent) +of.options.FOG_FANCY.tooltip.4= OFF - Aucun Brouillard (très rapide) +of.options.FOG_FANCY.tooltip.5=Le brouillard détaillé n'est disponible que +of.options.FOG_FANCY.tooltip.6=si la carte graphique peut le supporter. + +of.options.FOG_START=Commencement de Brouillard +of.options.FOG_START.tooltip.1=Commencement de Brouillard +of.options.FOG_START.tooltip.2= 0.2 - commence proche du joueur +of.options.FOG_START.tooltip.3= 0.8 - commence loin du joueur +of.options.FOG_START.tooltip.4=Cette option n'affecte généralement pas les performances. + +of.options.CHUNK_LOADING=Chargement des Chunks +of.options.CHUNK_LOADING.tooltip.1=Chargement des Chunks +of.options.CHUNK_LOADING.tooltip.2= Défaut - FPS instable lors du chargement des chunks +of.options.CHUNK_LOADING.tooltip.3= Adoucie - FPS stable +of.options.CHUNK_LOADING.tooltip.4= Multi-Coeur - FPS stable, Chargement 3x plus rapide +of.options.CHUNK_LOADING.tooltip.5=Adoucie et Multi-Coeur évite le bégaiement et +of.options.CHUNK_LOADING.tooltip.6=les lags causés par le chargement des chunks. +of.options.CHUNK_LOADING.tooltip.7=Multi-Coeur peut augmenter de 3x la vitesse de chargement +of.options.CHUNK_LOADING.tooltip.8=et augmenter les FPS en utilisant un deuxième Coeur du CPU. +of.options.chunkLoading.smooth=Adoucie +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=OFF +of.options.shaders.packDefault=(interne) + +of.options.shaders.ANTIALIASING=Anticrénelage +of.options.shaders.NORMAL_MAP=Map Normale +of.options.shaders.SPECULAR_MAP=Map Spectaculaire +of.options.shaders.RENDER_RES_MUL=Qualité du Rendu +of.options.shaders.SHADOW_RES_MUL=Qualité des Ombres +of.options.shaders.HAND_DEPTH_MUL=Profondeur de la Main +of.options.shaders.CLOUD_SHADOW=Ombres des nuages +of.options.shaders.OLD_HAND_LIGHT=Ancien Éclairage de la Main +of.options.shaders.OLD_LIGHTING=Ancien Éclairage +of.options.shaders.SHADER_PACK=Pack de Shader + +of.options.shaders.shadersFolder=Dossier des Shaders +of.options.shaders.shaderOptions=Options du Shader... + +of.options.shaderOptionsTitle=Options du Shader + +of.options.quality=Qualité... +of.options.qualityTitle=Paramètre de la Qualité + +of.options.details=Détails... +of.options.detailsTitle=Paramètre des Détails + +of.options.performance=Performance... +of.options.performanceTitle=Paramètre des Performances + +of.options.animations=Animations... +of.options.animationsTitle=Paramètre des Animations + +of.options.other=Autre... +of.options.otherTitle=Autre Paramètre + +of.options.other.reset=Réinitialiser les réglages vidéos... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinéaire +of.options.mipmap.linear=Linéaire +of.options.mipmap.nearest=Rapproché +of.options.mipmap.trilinear=Trilinéaire + +options.mipmapLevels.tooltip.1=Effet visuelle qui rend les objets lointains plus beau +options.mipmapLevels.tooltip.2=en adoucissent les détails +options.mipmapLevels.tooltip.3= OFF - Aucun adoucissement +options.mipmapLevels.tooltip.4= 1 - adoucissement minimum +options.mipmapLevels.tooltip.5= 4 - adoucissement maximum +options.mipmapLevels.tooltip.6=Cette option n'affecte généralement pas les performances. + +of.options.MIPMAP_TYPE=Type de Mipmap +of.options.MIPMAP_TYPE.tooltip.1=Effet visuel qui rend les objets lointains plus beau +of.options.MIPMAP_TYPE.tooltip.2=en adoucissent les détails +of.options.MIPMAP_TYPE.tooltip.3= Rapproché - adoucissement esquissé (rapide) +of.options.MIPMAP_TYPE.tooltip.4= Linéaire - adoucissement normal +of.options.MIPMAP_TYPE.tooltip.5= Bilinéaire - adoucissement travaillé +of.options.MIPMAP_TYPE.tooltip.6= Trilinéaire - adoucissement magnifique (lent) + +of.options.AA_LEVEL=Anticrénelage +of.options.AA_LEVEL.tooltip.1=Anticrénelage +of.options.AA_LEVEL.tooltip.2= OFF - (défaut) sans anticrénelage (rapide) +of.options.AA_LEVEL.tooltip.3= 2-16 - anticrénelage les lignes et cotés (lent) +of.options.AA_LEVEL.tooltip.4=L'Anticrénelage adouci l'effet rugueux et +of.options.AA_LEVEL.tooltip.5=les transitions rapides de couleurs. +of.options.AA_LEVEL.tooltip.6=Lorsque activer, les FPS peuvent ralentir. +of.options.AA_LEVEL.tooltip.7=Tous les niveaux ne sont pas supportés par toutes les cartes graphiques. +of.options.AA_LEVEL.tooltip.8=N'a d'effets qu'après un REDÉMARRAGE! + +of.options.AF_LEVEL=Filtrage Anisotropique +of.options.AF_LEVEL.tooltip.1=Filtrage Anisotropique +of.options.AF_LEVEL.tooltip.2= OFF - (défaut) détail de texture standard (rapide) +of.options.AF_LEVEL.tooltip.3= 2-16 - détails plus fins dans les textures mipmappées (lent) +of.options.AF_LEVEL.tooltip.4=Le Filtrage Anisotropique rétablie les détails dans +of.options.AF_LEVEL.tooltip.5=les textures mipmappé. +of.options.AF_LEVEL.tooltip.6=Lorsque activer, les FPS peuvent ralentir. + +of.options.CLEAR_WATER=Eau Claire +of.options.CLEAR_WATER.tooltip.1=Eau Claire +of.options.CLEAR_WATER.tooltip.2= ON - claire, eau transparente +of.options.CLEAR_WATER.tooltip.3= OFF - eau par défaut + +of.options.RANDOM_MOBS=Mobs Aléatoires +of.options.RANDOM_MOBS.tooltip.1=Mobs Aléatoires +of.options.RANDOM_MOBS.tooltip.2= OFF - aucun mob aléatoire (rapide) +of.options.RANDOM_MOBS.tooltip.3= ON - avec mob aléatoire (lent) +of.options.RANDOM_MOBS.tooltip.4=Les Mobs utilisent des textures aléatoires +of.options.RANDOM_MOBS.tooltip.5=A besoin d'un pack de ressources avec plusieurs textures de mob + +of.options.BETTER_GRASS=Meilleur Gazon +of.options.BETTER_GRASS.tooltip.1=Meilleur Gazon +of.options.BETTER_GRASS.tooltip.2= OFF - texture par défaut (rapide) +of.options.BETTER_GRASS.tooltip.3= Rapide - bord de gazon complet (lent) +of.options.BETTER_GRASS.tooltip.4= Détaillé - bord de gazon détaillé (très lent) + +of.options.BETTER_SNOW=Meilleur Neige +of.options.BETTER_SNOW.tooltip.1=Meilleur Neige +of.options.BETTER_SNOW.tooltip.2= OFF - Neige par défaut (rapide) +of.options.BETTER_SNOW.tooltip.3= ON - Meilleure Neige (lent) +of.options.BETTER_SNOW.tooltip.4=Apparait en dessous des blocs transparents (clôture, haute herbe) +of.options.BETTER_SNOW.tooltip.5=lorsque qu'entouré de neige. + +of.options.CUSTOM_FONTS=Police Personnalisé +of.options.CUSTOM_FONTS.tooltip.1=Police Personnalisé +of.options.CUSTOM_FONTS.tooltip.2= ON - utilise la police personnalisée (défaut, lent) +of.options.CUSTOM_FONTS.tooltip.3= OFF - utilise la police par défaut (rapide) +of.options.CUSTOM_FONTS.tooltip.4=La Police Personnalisée est fournis par +of.options.CUSTOM_FONTS.tooltip.5=le pack de ressources utilisé. + +of.options.CUSTOM_COLORS=Couleurs Personnalisés +of.options.CUSTOM_COLORS.tooltip.1=Couleurs Personnalisés +of.options.CUSTOM_COLORS.tooltip.2= ON - utilise des couleurs personnalisées (défaut, lent) +of.options.CUSTOM_COLORS.tooltip.3= OFF - utilise les couleurs par défaut (rapide) +of.options.CUSTOM_COLORS.tooltip.4=Les Couleurs Personnalisées sont fournis par +of.options.CUSTOM_COLORS.tooltip.5=le pack de ressources utilisé. + +of.options.SWAMP_COLORS=Couleurs Marécageuses +of.options.SWAMP_COLORS.tooltip.1=Couleurs Marécageuses +of.options.SWAMP_COLORS.tooltip.2= ON - utilise les couleurs marécageuses (défaut, lent) +of.options.SWAMP_COLORS.tooltip.3= OFF - n'utilise pas les couleurs marécageuses (rapide) +of.options.SWAMP_COLORS.tooltip.4=La couleur marécageuse modifie le gazon, les feuilles, +of.options.SWAMP_COLORS.tooltip.5=les lianes et l'eau. + +of.options.SMOOTH_BIOMES=Biomes Adoucis +of.options.SMOOTH_BIOMES.tooltip.1=Biomes Adoucis +of.options.SMOOTH_BIOMES.tooltip.2= ON - adoucie la bordure des biomes (défaut, lent) +of.options.SMOOTH_BIOMES.tooltip.3= OFF - aucun adoucissement de bordure des biomes (rapide) +of.options.SMOOTH_BIOMES.tooltip.4=L'adoucissement des bordures de biomes est fait en échantillonnant et +of.options.SMOOTH_BIOMES.tooltip.5=moyenant la couleur des blocs aux frontières entre deux biomes. +of.options.SMOOTH_BIOMES.tooltip.6=N'affecte que le gazon, les feuilles, les lianes et l'eau. + +of.options.CONNECTED_TEXTURES=Textures Connectés +of.options.CONNECTED_TEXTURES.tooltip.1=Textures Connectés +of.options.CONNECTED_TEXTURES.tooltip.2= OFF - aucune connexion (défaut) +of.options.CONNECTED_TEXTURES.tooltip.3= Rapide - connexion rapide +of.options.CONNECTED_TEXTURES.tooltip.4= Fancy - connexion détaillée +of.options.CONNECTED_TEXTURES.tooltip.5=Les Textures Connectés connecte les textures de +of.options.CONNECTED_TEXTURES.tooltip.6=la vitre, le grès et les bibliothèques placés une +of.options.CONNECTED_TEXTURES.tooltip.7=à coté de l'autre. Les Textures Connectés sont +of.options.CONNECTED_TEXTURES.tooltip.8=fournis par le pack de ressources utilisé. + +of.options.NATURAL_TEXTURES=Textures Naturelles +of.options.NATURAL_TEXTURES.tooltip.1=Textures Naturelles +of.options.NATURAL_TEXTURES.tooltip.2= OFF - sans textures naturelles (défaut) +of.options.NATURAL_TEXTURES.tooltip.3= ON - avec textures naturelles +of.options.NATURAL_TEXTURES.tooltip.4=Les textures naturelles enlèvent le pattern grillagé +of.options.NATURAL_TEXTURES.tooltip.5=créé par la répétition de bloc identique. +of.options.NATURAL_TEXTURES.tooltip.6=L'utilisation de textures retournées et renversées +of.options.NATURAL_TEXTURES.tooltip.7=est utilisé. La configuration pour les textures naturelles +of.options.NATURAL_TEXTURES.tooltip.8=sont fournies par le pack de ressources utilisé. + +of.options.CUSTOM_SKY=Ciel Personnalisé +of.options.CUSTOM_SKY.tooltip.1=Ciel Personnalisé +of.options.CUSTOM_SKY.tooltip.2= ON - Texture personnalisée (défaut, lent) +of.options.CUSTOM_SKY.tooltip.3= OFF - ciel par défaut (rapide) +of.options.CUSTOM_SKY.tooltip.4=La texture du ciel personnalisé est +of.options.CUSTOM_SKY.tooltip.5=fourni par le pack de ressources utilisé. + +of.options.CUSTOM_ITEMS=Items Personnalisés +of.options.CUSTOM_ITEMS.tooltip.1=Items Personnalisés +of.options.CUSTOM_ITEMS.tooltip.2= ON - textures d'items personnalisés (défaut, lent) +of.options.CUSTOM_ITEMS.tooltip.3= OFF - textures d'items par défaut (rapide) +of.options.CUSTOM_ITEMS.tooltip.4=Les textures d'items personnalisés sont +of.options.CUSTOM_ITEMS.tooltip.5=fournis par le pack de ressources utilisé. + +of.options.CUSTOM_ENTITY_MODELS=Modèles d'Entités Personnalisées +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modèles d'Entités Personnalisées +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ON - modèles d'entités personnalisées (défaut, lent) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= OFF - modèles d'entités par défaut (rapide) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Les modèles d'entités personnalisées sont +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=fournis par le pack de ressources utilisé. + +# Details + +of.options.CLOUDS=Nuages +of.options.CLOUDS.tooltip.1=Nuages +of.options.CLOUDS.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.CLOUDS.tooltip.3= Rapides - basse qualité (rapde) +of.options.CLOUDS.tooltip.4= Détaillés - haute qualité (lent) +of.options.CLOUDS.tooltip.5= OFF - sans nuages (plus rapide) +of.options.CLOUDS.tooltip.6=Les nuages rapides sont rendus en 2D. +of.options.CLOUDS.tooltip.7=Les nuages détaillés sont rendus en 3D. + +of.options.CLOUD_HEIGHT=Hauteur des Nuages +of.options.CLOUD_HEIGHT.tooltip.1=Hauteur des Nuages +of.options.CLOUD_HEIGHT.tooltip.2= OFF - hauteur par défaut +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - au-dessus de la hauteur limite du monde + +of.options.TREES=Arbres +of.options.TREES.tooltip.1=Arbres +of.options.TREES.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.TREES.tooltip.3= Rapides - basse qualité (plus rapide) +of.options.TREES.tooltip.4= Intelligents - haute qualité (rapide) +of.options.TREES.tooltip.5= Détaillés - très haute qualité (lent) +of.options.TREES.tooltip.6=Les arbres rapides ont des feuilles opaques. +of.options.TREES.tooltip.7=Les arbres intelligents et détaillés +of.options.TREES.tooltip.8=ont des feuilles transparentes. + +of.options.RAIN=Pluie & Neige +of.options.RAIN.tooltip.1=Pluie & Neige +of.options.RAIN.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.RAIN.tooltip.3= Rapide - légère pluie/neige (rapide) +of.options.RAIN.tooltip.4= Détaillé - grosse pluie/neige (lent) +of.options.RAIN.tooltip.5= OFF - sans pluie/neige (plus rapide) +of.options.RAIN.tooltip.6=Même si la pluie & la neige est à OFF, +of.options.RAIN.tooltip.7=les éclaboussures et le son sont toujours actifs. + +of.options.SKY=Ciel +of.options.SKY.tooltip.1=Ciel +of.options.SKY.tooltip.2= ON - Le ciel est visible (lent) +of.options.SKY.tooltip.3= OFF - Le ciel n'est pas visible (rapide) +of.options.SKY.tooltip.4=Quand le ciel est à OFF, +of.options.SKY.tooltip.5=le soleil et la lune sont toujours visibles. + +of.options.STARS=Étoiles +of.options.STARS.tooltip.1=Étoiles +of.options.STARS.tooltip.2= ON - Les étoiles sont visible (lent) +of.options.STARS.tooltip.3= OFF - Les étoiles ne sont pas visibles (rapide) + +of.options.SUN_MOON=Soleil & lune +of.options.SUN_MOON.tooltip.1=Soleil & lune +of.options.SUN_MOON.tooltip.2= ON - le soleil et la lune sont visibles (défaut) +of.options.SUN_MOON.tooltip.3= OFF - le soleil et la lune ne sont pas visibles (rapide) + +of.options.SHOW_CAPES=Capes Visibles +of.options.SHOW_CAPES.tooltip.1=Capes visibles +of.options.SHOW_CAPES.tooltip.2= ON - voir la cape de joueurs (défaut) +of.options.SHOW_CAPES.tooltip.3= OFF - ne pas voir la cape des joueurs + +of.options.TRANSLUCENT_BLOCKS=Blocs Translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocs Translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Détaillés - mélange correct des couleurs (défaut) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rapides - mélange rapide ds couleurs (rapide) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controle le mélange des couleurs des blocs translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.5=avec différentes couleurs (verre teindu, eau, glace) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=lorsque placé un à côté de l'autre avec de l'air entre eux. + +of.options.HELD_ITEM_TOOLTIPS=Info-bulles d'Item +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Info-bulles d'Item +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ON - affiche des infos sur l'item en main (défaut) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= OFF - n'affiche pas d'info sur l'item en main + +of.options.ADVANCED_TOOLTIPS=Info-bulles Avancé +of.options.ADVANCED_TOOLTIPS.tooltip.1=Info-bulles Avancé +of.options.ADVANCED_TOOLTIPS.tooltip.2= ON - affiche les infobulles avancées +of.options.ADVANCED_TOOLTIPS.tooltip.3= OFF - n'affiche pas les infobulles avancées (défaut) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Les infobulles avancées affiche des informations détaillées +of.options.ADVANCED_TOOLTIPS.tooltip.5=sur l'item (id, durabilité) et les options des shaders +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, source, valeurs par défaut). + +of.options.DROPPED_ITEMS=Items Droppés +of.options.DROPPED_ITEMS.tooltip.1=Dropped Items +of.options.DROPPED_ITEMS.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.DROPPED_ITEMS.tooltip.3= Rapides - items 2D (rapide) +of.options.DROPPED_ITEMS.tooltip.4= Détaillés - items 3D (lent) + +options.entityShadows.tooltip.1=Ombres des Entités +options.entityShadows.tooltip.2= ON - affiche l'ombre des entités +options.entityShadows.tooltip.3= OFF - n'affiche pas l'ombre des entités + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Effet visuel qui assombrie les coins de l'écran +of.options.VIGNETTE.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.VIGNETTE.tooltip.3= Rapide - vignette désactivée (rapide) +of.options.VIGNETTE.tooltip.4= Détaillée - vignette activée (lent) +of.options.VIGNETTE.tooltip.5=La vignette à un effet significatif sur les FPS, +of.options.VIGNETTE.tooltip.6=surtout lorsque le jeu est en plein écran. +of.options.VIGNETTE.tooltip.7=L'effet de vignette est très subtile et +of.options.VIGNETTE.tooltip.8=peut être désactivé en toute sécurité. + +of.options.DYNAMIC_FOV=CV Dynamique +of.options.DYNAMIC_FOV.tooltip.1=CV Dynamique +of.options.DYNAMIC_FOV.tooltip.2= ON - activer le CV dynamique (défaut) +of.options.DYNAMIC_FOV.tooltip.3= OFF - désactiver le CV dynamique +of.options.DYNAMIC_FOV.tooltip.4=Changer le champ visuel (CV) lors du vol, du sprint +of.options.DYNAMIC_FOV.tooltip.5=de la nage et du bandage d'un arc. + +of.options.DYNAMIC_LIGHTS=Lumières Dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.1=Lumières Dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.2= OFF - aucune lumière dynamique (défaut) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapides - lumières dynamiques rapides (rafraichi à tous les 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Détaillées - Lumières dynamiques détaillées (rafraichi en temps réel) +of.options.DYNAMIC_LIGHTS.tooltip.5=Active la lumière des items (torche, pierre lumineuse, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=pour illuminer tout autour quand l'item et en main, +of.options.DYNAMIC_LIGHTS.tooltip.7=equipper par d'autres joueurs ou jeter au sol. + +# Performance + +of.options.SMOOTH_FPS=FPS Atténué +of.options.SMOOTH_FPS.tooltip.1=Stabilise les FPS en supprimant les tampons de mémoires graphiques. +of.options.SMOOTH_FPS.tooltip.2= OFF - aucune stabilisation, Les FPS peuvent varier +of.options.SMOOTH_FPS.tooltip.3= ON - stabilisation des FPS +of.options.SMOOTH_FPS.tooltip.4=Cette option dépend du gestionnaire graphique, les +of.options.SMOOTH_FPS.tooltip.5=effets ne sont pas toujours visibles. + +of.options.SMOOTH_WORLD=Monde Atténué +of.options.SMOOTH_WORLD.tooltip.1=Élimine les piques de lag causé par le serveur interne. +of.options.SMOOTH_WORLD.tooltip.2= OFF - aucune stabilisation, Les FPS peuvent varier +of.options.SMOOTH_WORLD.tooltip.3= ON - stabilisation des FPS +of.options.SMOOTH_WORLD.tooltip.4=Stabilises les FPS en distribuent les charges du serveur interne. +of.options.SMOOTH_WORLD.tooltip.5=Fonctionne seulement en local (monde solo). + +of.options.FAST_RENDER=Rendu Rapide +of.options.FAST_RENDER.tooltip.1=Rendu Rapide +of.options.FAST_RENDER.tooltip.2= OFF - rendu standard (défaut) +of.options.FAST_RENDER.tooltip.3= ON - rendu optimisé (rapide) +of.options.FAST_RENDER.tooltip.4=Utilise des algorithmes de rendu optimisé pour diminuer +of.options.FAST_RENDER.tooltip.5=la charge du GPU et peut augmenter les FPS. + +of.options.FAST_MATH=Maths Rapides +of.options.FAST_MATH.tooltip.1=Mats Rapides +of.options.FAST_MATH.tooltip.2= OFF - math standard (défaut) +of.options.FAST_MATH.tooltip.3= ON - math optimisé +of.options.FAST_MATH.tooltip.4=Utilise des fonctions optimisées de sin() et cos() qui peuvent +of.options.FAST_MATH.tooltip.5=mieu utilisé la cache du CPU et augmenter les FPS. + +of.options.CHUNK_UPDATES=Mise à Jour des Chunks +of.options.CHUNK_UPDATES.tooltip.1=Mise à Jour des Chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - chargement lent du monde, meilleur FPS (défaut) +of.options.CHUNK_UPDATES.tooltip.3= 3 - chargement rapide du monde, bas FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - chargement très rapide du monde, très bas FPS +of.options.CHUNK_UPDATES.tooltip.5=Nombre de Mise à jour par image de rendu (tick), +of.options.CHUNK_UPDATES.tooltip.6=Les valeurs élevées peut déstabilisé les FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Mises à Jour Dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Mises à Jours Dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= OFF - mise à jour standard (défaut) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ON - plus de mise à jour lorsque le joueur ne bouge pas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Les mises à jour dynamiques force plus de +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=chunks à ce mettre à jour quand le joueur +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=est inactif pour charger le monde plus vite. + +of.options.LAZY_CHUNK_LOADING=Chargement des Chunks Lâches +of.options.LAZY_CHUNK_LOADING.tooltip.1=Chargement Lâche des Chunks +of.options.LAZY_CHUNK_LOADING.tooltip.2= OFF - chargement des chunks serveurs par défaut +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - chargement des chunks serveur lâche (plus doux) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Adoucie le chargement des chunks serveurs intégrés +of.options.LAZY_CHUNK_LOADING.tooltip.5=en distribuant les chunks sur plusieurs ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Tourné à OFF si des parties du monde ne se charge pas correctement. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Fonctionne seulement en local (monde solo) et les CPU à un coeur. + +# Animations + +of.options.animation.allOn=Tous à ON +of.options.animation.allOff=Tous à OFF +of.options.animation.dynamic=Dynamique + +of.options.ANIMATED_WATER=Eau Animée +of.options.ANIMATED_LAVA=Lave Animée +of.options.ANIMATED_FIRE=Feux Animé +of.options.ANIMATED_PORTAL=Portail Animé +of.options.ANIMATED_REDSTONE=Redstone Animé +of.options.ANIMATED_EXPLOSION=Explosion Animée +of.options.ANIMATED_FLAME=Flamme Animé +of.options.ANIMATED_SMOKE=Fumée Animée +of.options.VOID_PARTICLES=Particules de Vide +of.options.WATER_PARTICLES=Particules d'Eau +of.options.RAIN_SPLASH=Particules de Pluie +of.options.PORTAL_PARTICLES=Particules de Portail +of.options.POTION_PARTICLES=Particules de Potion +of.options.DRIPPING_WATER_LAVA=Eau/Lave qui Coule +of.options.ANIMATED_TERRAIN=Terrain Animé +of.options.ANIMATED_TEXTURES=Textures Animées +of.options.FIREWORK_PARTICLES=Particules de Feux d'Artifice + +# Other + +of.options.LAGOMETER=Lagomèter +of.options.LAGOMETER.tooltip.1=Affiche le Lagomètre sur l'écran de débogage (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Récupérateur de mémoire +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Blue - Executables programmés +of.options.LAGOMETER.tooltip.5=* Purple - Chunk téléchargé +of.options.LAGOMETER.tooltip.6=* Red - Mises à jour de chunk +of.options.LAGOMETER.tooltip.7=* Yellow - Contrôle de visibilité +of.options.LAGOMETER.tooltip.8=* Green - Terrain rendu + +of.options.PROFILER=Profileur de Débogage +of.options.PROFILER.tooltip.1=Profileur de Débogage +of.options.PROFILER.tooltip.2= ON - profileur actif (lent) +of.options.PROFILER.tooltip.3= OFF - profileur non actif (rapide) +of.options.PROFILER.tooltip.4=Le profileur de débogage collecte et affiche des informations de +of.options.PROFILER.tooltip.5=débogage lorsque l'écran de débogage (F3) est ouvert. + +of.options.WEATHER=Météo +of.options.WEATHER.tooltip.1=Météo +of.options.WEATHER.tooltip.2= ON - Météo active (lent) +of.options.WEATHER.tooltip.3= OFF - Météo non active (rapide) +of.options.WEATHER.tooltip.4=La météo contrôle la pluie, la neige et l'orage. +of.options.WEATHER.tooltip.5=Le contrôle de la météo n'est possible qu'en local. + +of.options.time.dayOnly=Jour Seulement +of.options.time.nightOnly=Nuit Seulement + +of.options.TIME=temps +of.options.TIME.tooltip.1=Temps +of.options.TIME.tooltip.2= Défaut - Cycle jour/nuit normal +of.options.TIME.tooltip.3= Jour Seulement - jour seulement +of.options.TIME.tooltip.4= Nuit Seulement - nuit seulement +of.options.TIME.tooltip.5=La séléction du temps n'est possible qu'en CRÉATIF +of.options.TIME.tooltip.6=dans un monde local. + +options.fullscreen.tooltip.1=Plein Écran +options.fullscreen.tooltip.2= ON - jeu en plein écran +options.fullscreen.tooltip.3= OFF - jeu fenêtré +options.fullscreen.tooltip.4=Le mode plein écran peut être plus rapide ou plus lent +options.fullscreen.tooltip.5=que le mode fenêtré, cela dépend de la carte graphique. + +of.options.FULLSCREEN_MODE=Option Plein Écran +of.options.FULLSCREEN_MODE.tooltip.1=Option Plein Écran +of.options.FULLSCREEN_MODE.tooltip.2= Défaut - utilise la résolution du moniteur (lent) +of.options.FULLSCREEN_MODE.tooltip.3= LxH - utilise une résolution personnalisée (rapide) +of.options.FULLSCREEN_MODE.tooltip.4=La résolution sélectionnée est utilisé en mode plein écran (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Une résolution plus basse devrait être plus rapide. + +of.options.SHOW_FPS=Afficher les FPS +of.options.SHOW_FPS.tooltip.1=Affiche les FPS et informations de rendu. +of.options.SHOW_FPS.tooltip.2= C: - chunk rendu +of.options.SHOW_FPS.tooltip.3= E: - entités rendu + bloc entités +of.options.SHOW_FPS.tooltip.4= U: - mises à jour de chunk +of.options.SHOW_FPS.tooltip.5=Les informations sont présenté de manière compacte dans le coin +of.options.SHOW_FPS.tooltip.6=supérieur gauche lorsque l'écran de débogage n'est pas visible + +of.options.save.default=Défaut (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Sauvegarde Automatique +of.options.AUTOSAVE_TICKS.tooltip.1=Intervale entre les sauvegardes +of.options.AUTOSAVE_TICKS.tooltip.2=L'intervalle par défaut (2s) n'est PAS RECOMMENDER. +of.options.AUTOSAVE_TICKS.tooltip.3=Les sauvegardes automatiques sont la cause +of.options.AUTOSAVE_TICKS.tooltip.4=du Pique de Lag de la Mort qui Tue. + +of.options.SCREENSHOT_SIZE=Taille des Captures d'Écrans +of.options.SCREENSHOT_SIZE.tooltip.1=Taille des Captures d'Écrans +of.options.SCREENSHOT_SIZE.tooltip.2= Défaut - taille de la fenêtre +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - taille personnalisée +of.options.SCREENSHOT_SIZE.tooltip.4=Prendre une capture d'écran plus grande utilise plus de mémoire. +of.options.SCREENSHOT_SIZE.tooltip.5=Incompatible avec le Rendu Rapide et l'Anticrénelage. +of.options.SCREENSHOT_SIZE.tooltip.6=Nécessite un GPU avec un tampon d'image. \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/fr_FR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/fr_FR.lang new file mode 100644 index 0000000..af15604 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/fr_FR.lang @@ -0,0 +1,592 @@ +#Traduit en français par Z0ul0u25 + +# General +of.general.ambiguous=Ambigue +of.general.custom=Personnalisé +of.general.from=De +of.general.id=ID +of.general.restart=Redémarer +of.general.smart=Intelligent + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=L'Anticrénelage n'est pas compatible avec les Shaders. +of.message.aa.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.af.shaders1=Le Filtrage Anisotropique n'est pas compatible avec les Shaders. +of.message.af.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.fr.shaders1=Le Rendu Rapide n'est pas compatible avec les Shaders. +of.message.fr.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.an.shaders1=L'Anaglyphe 3D n'est pas compatible avec les Shaders. +of.message.an.shaders2=Veuillez désactivez les Shaders pour activer cette option. + +of.message.shaders.aa1=Les Shaders ne sont pas compatible avec l'Anticrénelage. +of.message.shaders.aa2=Veuillez fixé Qualité -> Anticrénelage à OFF puis redémarrer le jeu. + +of.message.shaders.af1=Les Shaders ne sont pas compatible avec le Filtrage Anisotropique. +of.message.shaders.af2=Veuillez fixé Qualité -> Filtrage Anisotropique à OFF. + +of.message.shaders.fr1=Les Shaders ne sont pas compatible avec le Rendu Rapide. +of.message.shaders.fr2=Veuillez fixé Performance -> Rendu Rapide à OFF. + +of.message.shaders.an1=Les Shaders ne sont pas compatible avec l'Anaglyphe 3D. +of.message.shaders.an2=Veuillez configurer Autre -> Anaglyphe 3D à OFF. + +of.message.newVersion=Une nouvelle version d'§eOptiFine§f est disponible: §e%s§f +of.message.java64Bit=Pour de meilleure performance, installer une version §e64-bit de Java§f +of.message.openglError=§eErreur OpenGL§f: %s (%s) + +of.message.shaders.loading=Chargement des Shaders: %s + +of.message.other.reset=Réinitialiser tous les réglages vidéos à leurs valeurs par défaut? + +of.message.loadingVisibleChunks=Chargement des Chunks visible + +# Video settings + +options.graphics.tooltip.1=Qualité visuel +options.graphics.tooltip.2= Rapide - Basse qualité (Rapide) +options.graphics.tooltip.3= Détaillée - Haute qualité (Lent) +options.graphics.tooltip.4=Change l'apparence des nuages, des feuilles, +options.graphics.tooltip.5=de l'eau, des ombres et du côté de l'herbe. + +of.options.renderDistance.tiny=Mini +of.options.renderDistance.short=Courte +of.options.renderDistance.normal=Normale +of.options.renderDistance.far=Loin +of.options.renderDistance.extreme=Extrême + +options.renderDistance.tooltip.1=Distance de Rendu +options.renderDistance.tooltip.2= 2 Mini - 32m (Très rapide) +options.renderDistance.tooltip.3= 4 courte - 64m (Rapide) +options.renderDistance.tooltip.4= 8 Normale - 128m +options.renderDistance.tooltip.5= 16 Loin - 256m (Lent) +options.renderDistance.tooltip.6= 32 Extrême - 512m (Très lent) +options.renderDistance.tooltip.7=La distance de rendu Extrême est très gourmande en ressources! +options.renderDistance.tooltip.8=Les valeurs au-dessus de 16 n'ont effet qu'en solo. + +options.ao.tooltip.1=Luminosité adoucie +options.ao.tooltip.2= OFF - aucun adoucissement (rapide) +options.ao.tooltip.3= Minimum - Adoucissement simple (Lent) +options.ao.tooltip.4= Maximum - Adoucissement complexe (Très lent) + +options.framerateLimit.tooltip.1=FPS Max +options.framerateLimit.tooltip.2= VSync - limite du moniteur (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variable +options.framerateLimit.tooltip.4= Illimitée - sans limite (Très rapide) +options.framerateLimit.tooltip.5=La limite de FPS diminue le taux d'image par seconde +options.framerateLimit.tooltip.6=même si la valeur limite n'est pas atteinte. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Ombres adoucies +of.options.AO_LEVEL.tooltip.1=Ombres adoucies +of.options.AO_LEVEL.tooltip.2= OFF - aucune ombre +of.options.AO_LEVEL.tooltip.3= 50%% - légères ombres +of.options.AO_LEVEL.tooltip.4= 100%% - fortes ombres + +options.viewBobbing.tooltip.1=Mouvements plus réalistes. +options.viewBobbing.tooltip.2=Lors de l'utilisation du mipmaps, configurer à OFF pour de meilleurs résultats. + +options.guiScale.tooltip.1=Taille du GUI +options.guiScale.tooltip.2= Auto - taille maximale +options.guiScale.tooltip.3= Petite, Normale, Grande - 1x à 3x +options.guiScale.tooltip.4= 4x à 10x - Disponible pour moniteur 4K +options.guiScale.tooltip.5=Les valeurs impaires (1x, 3x, 5x ...) ne sont pas compatible avec l'Unicode. +options.guiScale.tooltip.2=Un GUI petit serai plus rapide + +options.vbo.tooltip.1=Objets de Mémoire Tampon +options.vbo.tooltip.2=Utilises des modèles de rendu qui sont habituellement +options.vbo.tooltip.3=plus rapides (5-10%%) que le rendu par défaut. + +options.gamma.tooltip.1=Change la luminosité des endroits sombres +options.gamma.tooltip.2= Sombre - luminosité standard +options.gamma.tooltip.3= 1-99%% - variable +options.gamma.tooltip.4= Lumineux - luminosité maximale pour les objets sombres +options.gamma.tooltip.5=Cette option ne change pas la luminosité des +options.gamma.tooltip.6=objets complètement noirs + +options.anaglyph.tooltip.1=Anaglyphe 3D +options.anaglyph.tooltip.2=Active un effet stéréoscopique 3D utilisant différentes couleurs +options.anaglyph.tooltip.3=pour chaque œil. +options.anaglyph.tooltip.4=Nécessite des lunettes rouge-cyan pour une vue adéquate. + +of.options.ALTERNATE_BLOCKS=Blocs Alternatif +of.options.ALTERNATE_BLOCKS.tooltip.1=Alterne les Blocs +of.options.ALTERNATE_BLOCKS.tooltip.2=Utilises des modèles alternatifs pour certains blocs. +of.options.ALTERNATE_BLOCKS.tooltip.3=Dépend du pack de ressources sélectionné. + +of.options.FOG_FANCY=Brouillard +of.options.FOG_FANCY.tooltip.1=Type de Brouillard +of.options.FOG_FANCY.tooltip.2= Rapide - brouillard rapide +of.options.FOG_FANCY.tooltip.3= Détaillé - meilleure apparence (Plus lent) +of.options.FOG_FANCY.tooltip.4= OFF - Aucun Brouillard (très rapide) +of.options.FOG_FANCY.tooltip.5=Le brouillard détaillé n'est disponible que +of.options.FOG_FANCY.tooltip.6=si la carte graphique peut le supporter. + +of.options.FOG_START=Commencement de Brouillard +of.options.FOG_START.tooltip.1=Commencement de Brouillard +of.options.FOG_START.tooltip.2= 0.2 - commence proche du joueur +of.options.FOG_START.tooltip.3= 0.8 - commence loin du joueur +of.options.FOG_START.tooltip.4=Cette option n'affecte généralement pas les performances. + +of.options.CHUNK_LOADING=Chargement des Chunks +of.options.CHUNK_LOADING.tooltip.1=Chargement des Chunks +of.options.CHUNK_LOADING.tooltip.2= Défaut - FPS instable lors du chargement des chunks +of.options.CHUNK_LOADING.tooltip.3= Adoucie - FPS stable +of.options.CHUNK_LOADING.tooltip.4= Multi-Coeur - FPS stable, Chargement 3x plus rapide +of.options.CHUNK_LOADING.tooltip.5=Adoucie et Multi-Coeur évite le bégaiement et +of.options.CHUNK_LOADING.tooltip.6=les lags causés par le chargement des chunks. +of.options.CHUNK_LOADING.tooltip.7=Multi-Coeur peut augmenter de 3x la vitesse de chargement +of.options.CHUNK_LOADING.tooltip.8=et augmenter les FPS en utilisant un deuxième Coeur du CPU. +of.options.chunkLoading.smooth=Adoucie +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=OFF +of.options.shaders.packDefault=(interne) + +of.options.shaders.ANTIALIASING=Anticrénelage +of.options.shaders.NORMAL_MAP=Map Normale +of.options.shaders.SPECULAR_MAP=Map Spectaculaire +of.options.shaders.RENDER_RES_MUL=Qualité du Rendu +of.options.shaders.SHADOW_RES_MUL=Qualité des Ombres +of.options.shaders.HAND_DEPTH_MUL=Profondeur de la Main +of.options.shaders.CLOUD_SHADOW=Ombres des nuages +of.options.shaders.OLD_HAND_LIGHT=Ancien Éclairage de la Main +of.options.shaders.OLD_LIGHTING=Ancien Éclairage +of.options.shaders.SHADER_PACK=Pack de Shader + +of.options.shaders.shadersFolder=Dossier des Shaders +of.options.shaders.shaderOptions=Options du Shader... + +of.options.shaderOptionsTitle=Options du Shader + +of.options.quality=Qualité... +of.options.qualityTitle=Paramètre de la Qualité + +of.options.details=Détails... +of.options.detailsTitle=Paramètre des Détails + +of.options.performance=Performance... +of.options.performanceTitle=Paramètre des Performances + +of.options.animations=Animations... +of.options.animationsTitle=Paramètre des Animations + +of.options.other=Autre... +of.options.otherTitle=Autre Paramètre + +of.options.other.reset=Réinitialiser les réglages vidéos... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinéaire +of.options.mipmap.linear=Linéaire +of.options.mipmap.nearest=Rapproché +of.options.mipmap.trilinear=Trilinéaire + +options.mipmapLevels.tooltip.1=Effet visuelle qui rend les objets lointains plus beau +options.mipmapLevels.tooltip.2=en adoucissent les détails +options.mipmapLevels.tooltip.3= OFF - Aucun adoucissement +options.mipmapLevels.tooltip.4= 1 - adoucissement minimum +options.mipmapLevels.tooltip.5= 4 - adoucissement maximum +options.mipmapLevels.tooltip.6=Cette option n'affecte généralement pas les performances. + +of.options.MIPMAP_TYPE=Type de Mipmap +of.options.MIPMAP_TYPE.tooltip.1=Effet visuel qui rend les objets lointains plus beau +of.options.MIPMAP_TYPE.tooltip.2=en adoucissent les détails +of.options.MIPMAP_TYPE.tooltip.3= Rapproché - adoucissement esquissé (rapide) +of.options.MIPMAP_TYPE.tooltip.4= Linéaire - adoucissement normal +of.options.MIPMAP_TYPE.tooltip.5= Bilinéaire - adoucissement travaillé +of.options.MIPMAP_TYPE.tooltip.6= Trilinéaire - adoucissement magnifique (lent) + +of.options.AA_LEVEL=Anticrénelage +of.options.AA_LEVEL.tooltip.1=Anticrénelage +of.options.AA_LEVEL.tooltip.2= OFF - (défaut) sans anticrénelage (rapide) +of.options.AA_LEVEL.tooltip.3= 2-16 - anticrénelage les lignes et cotés (lent) +of.options.AA_LEVEL.tooltip.4=L'Anticrénelage adouci l'effet rugueux et +of.options.AA_LEVEL.tooltip.5=les transitions rapides de couleurs. +of.options.AA_LEVEL.tooltip.6=Lorsque activer, les FPS peuvent ralentir. +of.options.AA_LEVEL.tooltip.7=Tous les niveaux ne sont pas supportés par toutes les cartes graphiques. +of.options.AA_LEVEL.tooltip.8=N'a d'effets qu'après un REDÉMARRAGE! + +of.options.AF_LEVEL=Filtrage Anisotropique +of.options.AF_LEVEL.tooltip.1=Filtrage Anisotropique +of.options.AF_LEVEL.tooltip.2= OFF - (défaut) détail de texture standard (rapide) +of.options.AF_LEVEL.tooltip.3= 2-16 - détails plus fins dans les textures mipmappées (lent) +of.options.AF_LEVEL.tooltip.4=Le Filtrage Anisotropique rétablie les détails dans +of.options.AF_LEVEL.tooltip.5=les textures mipmappé. +of.options.AF_LEVEL.tooltip.6=Lorsque activer, les FPS peuvent ralentir. + +of.options.CLEAR_WATER=Eau Claire +of.options.CLEAR_WATER.tooltip.1=Eau Claire +of.options.CLEAR_WATER.tooltip.2= ON - claire, eau transparente +of.options.CLEAR_WATER.tooltip.3= OFF - eau par défaut + +of.options.RANDOM_MOBS=Mobs Aléatoires +of.options.RANDOM_MOBS.tooltip.1=Mobs Aléatoires +of.options.RANDOM_MOBS.tooltip.2= OFF - aucun mob aléatoire (rapide) +of.options.RANDOM_MOBS.tooltip.3= ON - avec mob aléatoire (lent) +of.options.RANDOM_MOBS.tooltip.4=Les Mobs utilisent des textures aléatoires +of.options.RANDOM_MOBS.tooltip.5=A besoin d'un pack de ressources avec plusieurs textures de mob + +of.options.BETTER_GRASS=Meilleur Gazon +of.options.BETTER_GRASS.tooltip.1=Meilleur Gazon +of.options.BETTER_GRASS.tooltip.2= OFF - texture par défaut (rapide) +of.options.BETTER_GRASS.tooltip.3= Rapide - bord de pelouse complet (lent) +of.options.BETTER_GRASS.tooltip.4= Détaillé - bord de pelouse détaillé (très lent) + +of.options.BETTER_SNOW=Meilleur Neige +of.options.BETTER_SNOW.tooltip.1=Meilleur Neige +of.options.BETTER_SNOW.tooltip.2= OFF - Neige par défaut (rapide) +of.options.BETTER_SNOW.tooltip.3= ON - Meilleure Neige (lent) +of.options.BETTER_SNOW.tooltip.4=Apparait en dessous des blocs transparents (clôture, haute herbe) +of.options.BETTER_SNOW.tooltip.5=lorsque qu'entouré de neige. + +of.options.CUSTOM_FONTS=Police Personnalisé +of.options.CUSTOM_FONTS.tooltip.1=Police Personnalisé +of.options.CUSTOM_FONTS.tooltip.2= ON - utilise la police personnalisée (défaut, lent) +of.options.CUSTOM_FONTS.tooltip.3= OFF - utilise la police par défaut (rapide) +of.options.CUSTOM_FONTS.tooltip.4=La Police Personnalisée est fournis par +of.options.CUSTOM_FONTS.tooltip.5=le pack de ressources utilisé. + +of.options.CUSTOM_COLORS=Couleurs Personnalisés +of.options.CUSTOM_COLORS.tooltip.1=Couleurs Personnalisés +of.options.CUSTOM_COLORS.tooltip.2= ON - utilise des couleurs personnalisées (défaut, lent) +of.options.CUSTOM_COLORS.tooltip.3= OFF - utilise les couleurs par défaut (rapide) +of.options.CUSTOM_COLORS.tooltip.4=Les Couleurs Personnalisées sont fournis par +of.options.CUSTOM_COLORS.tooltip.5=le pack de ressources utilisé. + +of.options.SWAMP_COLORS=Couleurs Marécageuses +of.options.SWAMP_COLORS.tooltip.1=Couleurs Marécageuses +of.options.SWAMP_COLORS.tooltip.2= ON - utilise les couleurs marécageuses (défaut, lent) +of.options.SWAMP_COLORS.tooltip.3= OFF - n'utilise pas les couleurs marécageuses (rapide) +of.options.SWAMP_COLORS.tooltip.4=La couleur marécageuse modifie la pelouse, les feuilles, +of.options.SWAMP_COLORS.tooltip.5=les lianes et l'eau. + +of.options.SMOOTH_BIOMES=Biomes Adoucis +of.options.SMOOTH_BIOMES.tooltip.1=Biomes Adoucis +of.options.SMOOTH_BIOMES.tooltip.2= ON - adoucie la bordure des biomes (défaut, lent) +of.options.SMOOTH_BIOMES.tooltip.3= OFF - aucun adoucissement de bordure des biomes (rapide) +of.options.SMOOTH_BIOMES.tooltip.4=L'adoucissement des bordures de biomes est fait en échantillonnant et +of.options.SMOOTH_BIOMES.tooltip.5=moyenant la couleur des blocs aux frontières entre deux biomes. +of.options.SMOOTH_BIOMES.tooltip.6=N'affecte que la pelouse, les feuilles, les lianes et l'eau. + +of.options.CONNECTED_TEXTURES=Textures Connectés +of.options.CONNECTED_TEXTURES.tooltip.1=Textures Connectés +of.options.CONNECTED_TEXTURES.tooltip.2= OFF - aucune connexion (défaut) +of.options.CONNECTED_TEXTURES.tooltip.3= Rapide - connexion rapide +of.options.CONNECTED_TEXTURES.tooltip.4= Fancy - connexion détaillée +of.options.CONNECTED_TEXTURES.tooltip.5=Les Textures Connectés connecte les textures de +of.options.CONNECTED_TEXTURES.tooltip.6=la vitre, le grès et les bibliothèques placés une +of.options.CONNECTED_TEXTURES.tooltip.7=à coté de l'autre. Les Textures Connectés sont +of.options.CONNECTED_TEXTURES.tooltip.8=fournis par le pack de ressources utilisé. + +of.options.NATURAL_TEXTURES=Textures Naturelles +of.options.NATURAL_TEXTURES.tooltip.1=Textures Naturelles +of.options.NATURAL_TEXTURES.tooltip.2= OFF - sans textures naturelles (défaut) +of.options.NATURAL_TEXTURES.tooltip.3= ON - avec textures naturelles +of.options.NATURAL_TEXTURES.tooltip.4=Les textures naturelles enlèvent le motif grillagé +of.options.NATURAL_TEXTURES.tooltip.5=créé par la répétition de bloc identique. +of.options.NATURAL_TEXTURES.tooltip.6=L'utilisation de textures retournées et renversées +of.options.NATURAL_TEXTURES.tooltip.7=est utilisé. La configuration pour les textures naturelles +of.options.NATURAL_TEXTURES.tooltip.8=sont fournies par le pack de ressources utilisé. + +of.options.CUSTOM_SKY=Ciel Personnalisé +of.options.CUSTOM_SKY.tooltip.1=Ciel Personnalisé +of.options.CUSTOM_SKY.tooltip.2= ON - Texture personnalisée (défaut, lent) +of.options.CUSTOM_SKY.tooltip.3= OFF - ciel par défaut (rapide) +of.options.CUSTOM_SKY.tooltip.4=La texture du ciel personnalisé est +of.options.CUSTOM_SKY.tooltip.5=fourni par le pack de ressources utilisé. + +of.options.CUSTOM_ITEMS=Items Personnalisés +of.options.CUSTOM_ITEMS.tooltip.1=Items Personnalisés +of.options.CUSTOM_ITEMS.tooltip.2= ON - textures d'items personnalisés (défaut, lent) +of.options.CUSTOM_ITEMS.tooltip.3= OFF - textures d'items par défaut (rapide) +of.options.CUSTOM_ITEMS.tooltip.4=Les textures d'items personnalisés sont +of.options.CUSTOM_ITEMS.tooltip.5=fournis par le pack de ressources utilisé. + +of.options.CUSTOM_ENTITY_MODELS=Modèles d'Entités Personnalisées +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modèles d'Entités Personnalisées +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ON - modèles d'entités personnalisées (défaut, lent) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= OFF - modèles d'entités par défaut (rapide) +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Les modèles d'entités personnalisées sont +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=fournis par le pack de ressources utilisé. + +# Details + +of.options.CLOUDS=Nuages +of.options.CLOUDS.tooltip.1=Nuages +of.options.CLOUDS.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.CLOUDS.tooltip.3= Rapides - basse qualité (rapde) +of.options.CLOUDS.tooltip.4= Détaillés - haute qualité (lent) +of.options.CLOUDS.tooltip.5= OFF - sans nuages (plus rapide) +of.options.CLOUDS.tooltip.6=Les nuages rapides sont rendus en 2D. +of.options.CLOUDS.tooltip.7=Les nuages détaillés sont rendus en 3D. + +of.options.CLOUD_HEIGHT=Hauteur des Nuages +of.options.CLOUD_HEIGHT.tooltip.1=Hauteur des Nuages +of.options.CLOUD_HEIGHT.tooltip.2= OFF - hauteur par défaut +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - au-dessus de la hauteur limite du monde + +of.options.TREES=Arbres +of.options.TREES.tooltip.1=Arbres +of.options.TREES.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.TREES.tooltip.3= Rapides - basse qualité (plus rapide) +of.options.TREES.tooltip.4= Intelligents - haute qualité (rapide) +of.options.TREES.tooltip.5= Détaillés - très haute qualité (lent) +of.options.TREES.tooltip.6=Les arbres rapides ont des feuilles opaques. +of.options.TREES.tooltip.7=Les arbres intelligents et détaillés +of.options.TREES.tooltip.8=ont des feuilles transparentes. + +of.options.RAIN=Pluie & Neige +of.options.RAIN.tooltip.1=Pluie & Neige +of.options.RAIN.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.RAIN.tooltip.3= Rapide - légère pluie/neige (rapide) +of.options.RAIN.tooltip.4= Détaillé - grosse pluie/neige (lent) +of.options.RAIN.tooltip.5= OFF - sans pluie/neige (plus rapide) +of.options.RAIN.tooltip.6=Même si la pluie & la neige est à OFF, +of.options.RAIN.tooltip.7=les éclaboussures et le son sont toujours actifs. + +of.options.SKY=Ciel +of.options.SKY.tooltip.1=Ciel +of.options.SKY.tooltip.2= ON - Le ciel est visible (lent) +of.options.SKY.tooltip.3= OFF - Le ciel n'est pas visible (rapide) +of.options.SKY.tooltip.4=Quand le ciel est à OFF, +of.options.SKY.tooltip.5=le soleil et la lune sont toujours visibles. + +of.options.STARS=Étoiles +of.options.STARS.tooltip.1=Étoiles +of.options.STARS.tooltip.2= ON - Les étoiles sont visible (lent) +of.options.STARS.tooltip.3= OFF - Les étoiles ne sont pas visibles (rapide) + +of.options.SUN_MOON=Soleil & lune +of.options.SUN_MOON.tooltip.1=Soleil & lune +of.options.SUN_MOON.tooltip.2= ON - le soleil et la lune sont visibles (défaut) +of.options.SUN_MOON.tooltip.3= OFF - le soleil et la lune ne sont pas visibles (rapide) + +of.options.SHOW_CAPES=Capes Visibles +of.options.SHOW_CAPES.tooltip.1=Capes visibles +of.options.SHOW_CAPES.tooltip.2= ON - voir la cape de joueurs (défaut) +of.options.SHOW_CAPES.tooltip.3= OFF - ne pas voir la cape des joueurs + +of.options.TRANSLUCENT_BLOCKS=Blocs Translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocs Translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Détaillés - mélange correct des couleurs (défaut) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rapides - mélange rapide ds couleurs (rapide) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controle le mélange des couleurs des blocs translucides +of.options.TRANSLUCENT_BLOCKS.tooltip.5=avec différentes couleurs (verre teindu, eau, glace) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=lorsque placé un à côté de l'autre avec de l'air entre eux. + +of.options.HELD_ITEM_TOOLTIPS=Info-bulles d'Item +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Info-bulles d'Item +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ON - affiche des infos sur l'item en main (défaut) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= OFF - n'affiche pas d'info sur l'item en main + +of.options.ADVANCED_TOOLTIPS=Info-bulles Avancé +of.options.ADVANCED_TOOLTIPS.tooltip.1=Info-bulles Avancé +of.options.ADVANCED_TOOLTIPS.tooltip.2= ON - affiche les infobulles avancées +of.options.ADVANCED_TOOLTIPS.tooltip.3= OFF - n'affiche pas les infobulles avancées (défaut) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Les infobulles avancées affiche des informations détaillées +of.options.ADVANCED_TOOLTIPS.tooltip.5=sur l'item (id, durabilité) et les options des shaders +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, source, valeurs par défaut). + +of.options.DROPPED_ITEMS=Items Droppés +of.options.DROPPED_ITEMS.tooltip.1=Dropped Items +of.options.DROPPED_ITEMS.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.DROPPED_ITEMS.tooltip.3= Rapides - items 2D (rapide) +of.options.DROPPED_ITEMS.tooltip.4= Détaillés - items 3D (lent) + +options.entityShadows.tooltip.1=Ombres des Entités +options.entityShadows.tooltip.2= ON - affiche l'ombre des entités +options.entityShadows.tooltip.3= OFF - n'affiche pas l'ombre des entités + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Effet visuel qui assombrie les coins de l'écran +of.options.VIGNETTE.tooltip.2= Défaut - comme dans les configurations Graphiques +of.options.VIGNETTE.tooltip.3= Rapide - vignette désactivée (rapide) +of.options.VIGNETTE.tooltip.4= Détaillée - vignette activée (lent) +of.options.VIGNETTE.tooltip.5=La vignette à un effet significatif sur les FPS, +of.options.VIGNETTE.tooltip.6=surtout lorsque le jeu est en plein écran. +of.options.VIGNETTE.tooltip.7=L'effet de vignette est très subtile et +of.options.VIGNETTE.tooltip.8=peut être désactivé en toute sécurité. + +of.options.DYNAMIC_FOV=CV Dynamique +of.options.DYNAMIC_FOV.tooltip.1=CV Dynamique +of.options.DYNAMIC_FOV.tooltip.2= ON - activer le CV dynamique (défaut) +of.options.DYNAMIC_FOV.tooltip.3= OFF - désactiver le CV dynamique +of.options.DYNAMIC_FOV.tooltip.4=Changer le champ visuel (CV) lors du vol, du sprint +of.options.DYNAMIC_FOV.tooltip.5=de la nage et du bandage d'un arc. + +of.options.DYNAMIC_LIGHTS=Lumières Dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.1=Lumières Dynamiques +of.options.DYNAMIC_LIGHTS.tooltip.2= OFF - aucune lumière dynamique (défaut) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapides - lumières dynamiques rapides (rafraichi à tous les 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Détaillées - Lumières dynamiques détaillées (rafraichi en temps réel) +of.options.DYNAMIC_LIGHTS.tooltip.5=Active la lumière des items (torche, pierre lumineuse, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=pour illuminer tout autour quand l'item et en main, +of.options.DYNAMIC_LIGHTS.tooltip.7=equipper par d'autres joueurs ou jeter au sol. + +# Performance + +of.options.SMOOTH_FPS=FPS Atténué +of.options.SMOOTH_FPS.tooltip.1=Stabilise les FPS en supprimant les tampons de mémoires graphiques. +of.options.SMOOTH_FPS.tooltip.2= OFF - aucune stabilisation, Les FPS peuvent varier +of.options.SMOOTH_FPS.tooltip.3= ON - stabilisation des FPS +of.options.SMOOTH_FPS.tooltip.4=Cette option dépend du gestionnaire graphique, les +of.options.SMOOTH_FPS.tooltip.5=effets ne sont pas toujours visibles. + +of.options.SMOOTH_WORLD=Monde Atténué +of.options.SMOOTH_WORLD.tooltip.1=Élimine les piques de lag causé par le serveur interne. +of.options.SMOOTH_WORLD.tooltip.2= OFF - aucune stabilisation, Les FPS peuvent varier +of.options.SMOOTH_WORLD.tooltip.3= ON - stabilisation des FPS +of.options.SMOOTH_WORLD.tooltip.4=Stabilises les FPS en distribuent les charges du serveur interne. +of.options.SMOOTH_WORLD.tooltip.5=Fonctionne seulement en local (monde solo). + +of.options.FAST_RENDER=Rendu Rapide +of.options.FAST_RENDER.tooltip.1=Rendu Rapide +of.options.FAST_RENDER.tooltip.2= OFF - rendu standard (défaut) +of.options.FAST_RENDER.tooltip.3= ON - rendu optimisé (rapide) +of.options.FAST_RENDER.tooltip.4=Utilise des algorithmes de rendu optimisé pour diminuer +of.options.FAST_RENDER.tooltip.5=la charge du GPU et peut augmenter les FPS. + +of.options.FAST_MATH=Maths Rapides +of.options.FAST_MATH.tooltip.1=Mats Rapides +of.options.FAST_MATH.tooltip.2= OFF - math standard (défaut) +of.options.FAST_MATH.tooltip.3= ON - math optimisé +of.options.FAST_MATH.tooltip.4=Utilise des fonctions optimisées de sin() et cos() qui peuvent +of.options.FAST_MATH.tooltip.5=mieu utilisé la cache du CPU et augmenter les FPS. + +of.options.CHUNK_UPDATES=Mise à Jour des Chunks +of.options.CHUNK_UPDATES.tooltip.1=Mise à Jour des Chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - chargement lent du monde, meilleur FPS (défaut) +of.options.CHUNK_UPDATES.tooltip.3= 3 - chargement rapide du monde, bas FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - chargement très rapide du monde, très bas FPS +of.options.CHUNK_UPDATES.tooltip.5=Nombre de Mise à jour par image de rendu (tick), +of.options.CHUNK_UPDATES.tooltip.6=Les valeurs élevées peut déstabilisé les FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Mises à Jour Dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Mises à Jours Dynamiques +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= OFF - mise à jour standard (défaut) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ON - plus de mise à jour lorsque le joueur ne bouge pas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Les mises à jour dynamiques force plus de +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=chunks à ce mettre à jour quand le joueur +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=est inactif pour charger le monde plus vite. + +of.options.LAZY_CHUNK_LOADING=Chargement des Chunks Lâches +of.options.LAZY_CHUNK_LOADING.tooltip.1=Chargement Lâche des Chunks +of.options.LAZY_CHUNK_LOADING.tooltip.2= OFF - chargement des chunks serveurs par défaut +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - chargement des chunks serveur lâche (plus doux) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Adoucie le chargement des chunks serveurs intégrés +of.options.LAZY_CHUNK_LOADING.tooltip.5=en distribuant les chunks sur plusieurs ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Tourné à OFF si des parties du monde ne se charge pas correctement. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Fonctionne seulement en local (monde solo) et les CPU à un coeur. + +# Animations + +of.options.animation.allOn=Tous à ON +of.options.animation.allOff=Tous à OFF +of.options.animation.dynamic=Dynamique + +of.options.ANIMATED_WATER=Eau Animée +of.options.ANIMATED_LAVA=Lave Animée +of.options.ANIMATED_FIRE=Feux Animé +of.options.ANIMATED_PORTAL=Portail Animé +of.options.ANIMATED_REDSTONE=Redstone Animé +of.options.ANIMATED_EXPLOSION=Explosion Animée +of.options.ANIMATED_FLAME=Flamme Animé +of.options.ANIMATED_SMOKE=Fumée Animée +of.options.VOID_PARTICLES=Particules de Vide +of.options.WATER_PARTICLES=Particules d'Eau +of.options.RAIN_SPLASH=Particules de Pluie +of.options.PORTAL_PARTICLES=Particules de Portail +of.options.POTION_PARTICLES=Particules de Potion +of.options.DRIPPING_WATER_LAVA=Eau/Lave qui Coule +of.options.ANIMATED_TERRAIN=Terrain Animé +of.options.ANIMATED_TEXTURES=Textures Animées +of.options.FIREWORK_PARTICLES=Particules de Feux d'Artifice + +# Other + +of.options.LAGOMETER=Lagomèter +of.options.LAGOMETER.tooltip.1=Affiche le Lagomètre sur l'écran de débogage (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Récupérateur de mémoire +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Blue - Executables programmés +of.options.LAGOMETER.tooltip.5=* Purple - Chunk téléchargé +of.options.LAGOMETER.tooltip.6=* Red - Mises à jour de chunk +of.options.LAGOMETER.tooltip.7=* Yellow - Contrôle de visibilité +of.options.LAGOMETER.tooltip.8=* Green - Terrain rendu + +of.options.PROFILER=Profileur de Débogage +of.options.PROFILER.tooltip.1=Profileur de Débogage +of.options.PROFILER.tooltip.2= ON - profileur actif (lent) +of.options.PROFILER.tooltip.3= OFF - profileur non actif (rapide) +of.options.PROFILER.tooltip.4=Le profileur de débogage collecte et affiche des informations de +of.options.PROFILER.tooltip.5=débogage lorsque l'écran de débogage (F3) est ouvert. + +of.options.WEATHER=Météo +of.options.WEATHER.tooltip.1=Météo +of.options.WEATHER.tooltip.2= ON - Météo active (lent) +of.options.WEATHER.tooltip.3= OFF - Météo non active (rapide) +of.options.WEATHER.tooltip.4=La météo contrôle la pluie, la neige et l'orage. +of.options.WEATHER.tooltip.5=Le contrôle de la météo n'est possible qu'en local. + +of.options.time.dayOnly=Jour Seulement +of.options.time.nightOnly=Nuit Seulement + +of.options.TIME=temps +of.options.TIME.tooltip.1=Temps +of.options.TIME.tooltip.2= Défaut - Cycle jour/nuit normal +of.options.TIME.tooltip.3= Jour Seulement - jour seulement +of.options.TIME.tooltip.4= Nuit Seulement - nuit seulement +of.options.TIME.tooltip.5=La séléction du temps n'est possible qu'en CRÉATIF +of.options.TIME.tooltip.6=dans un monde local. + +options.fullscreen.tooltip.1=Plein Écran +options.fullscreen.tooltip.2= ON - jeu en plein écran +options.fullscreen.tooltip.3= OFF - jeu fenêtré +options.fullscreen.tooltip.4=Le mode plein écran peut être plus rapide ou plus lent +options.fullscreen.tooltip.5=que le mode fenêtré, cela dépend de la carte graphique. + +of.options.FULLSCREEN_MODE=Option Plein Écran +of.options.FULLSCREEN_MODE.tooltip.1=Option Plein Écran +of.options.FULLSCREEN_MODE.tooltip.2= Défaut - utilise la résolution du moniteur (lent) +of.options.FULLSCREEN_MODE.tooltip.3= LxH - utilise une résolution personnalisée (rapide) +of.options.FULLSCREEN_MODE.tooltip.4=La résolution sélectionnée est utilisé en mode plein écran (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Une résolution plus basse devrait être plus rapide. + +of.options.SHOW_FPS=Afficher les FPS +of.options.SHOW_FPS.tooltip.1=Affiche les FPS et informations de rendu. +of.options.SHOW_FPS.tooltip.2= C: - chunk rendu +of.options.SHOW_FPS.tooltip.3= E: - entités rendu + bloc entités +of.options.SHOW_FPS.tooltip.4= U: - mises à jour de chunk +of.options.SHOW_FPS.tooltip.5=Les informations sont présenté de manière compacte dans le coin +of.options.SHOW_FPS.tooltip.6=supérieur gauche lorsque l'écran de débogage n'est pas visible + +of.options.save.default=Défaut (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Sauvegarde Automatique +of.options.AUTOSAVE_TICKS.tooltip.1=Intervale entre les sauvegardes +of.options.AUTOSAVE_TICKS.tooltip.2=L'intervalle par défaut (2s) n'est PAS RECOMMENDER. +of.options.AUTOSAVE_TICKS.tooltip.3=Les sauvegardes automatiques sont la cause +of.options.AUTOSAVE_TICKS.tooltip.4=du Pique de Lag de la Mort qui Tue. + +of.options.SCREENSHOT_SIZE=Taille des Captures d'Écrans +of.options.SCREENSHOT_SIZE.tooltip.1=Taille des Captures d'Écrans +of.options.SCREENSHOT_SIZE.tooltip.2= Défaut - taille de la fenêtre +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - taille personnalisée +of.options.SCREENSHOT_SIZE.tooltip.4=Prendre une capture d'écran plus grande utilise plus de mémoire. +of.options.SCREENSHOT_SIZE.tooltip.5=Incompatible avec le Rendu Rapide et l'Anticrénelage. +of.options.SCREENSHOT_SIZE.tooltip.6=Nécessite un GPU avec un tampon d'image. \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/hu_HU.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/hu_HU.lang new file mode 100644 index 0000000..b181ae5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/hu_HU.lang @@ -0,0 +1,559 @@ +# General +of.general.ambiguous=zavaros +of.general.custom=Egyéni +of.general.from=-ból +of.general.id=Id +of.general.restart=újraindítás +of.general.smart=Okos + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Az Élsimítás nem kompatibilis a shaderekkel. +of.message.aa.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.af.shaders1=Az Anizotróp Szűrés nem kompatibilis a shaderekkel. +of.message.af.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.fr.shaders1=A Gyors Renderelés nem kompatibilis a shaderekkel. +of.message.fr.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.an.shaders1=A Sztereoszkopikus 3D nem kompatibilis a shaderekkel. +of.message.an.shaders2=Kérlek kapcsold ki a shadereket a beállítás bekapcsolásához. + +of.message.shaders.aa1=A shaderek nem kompatibilisek az Élsimítással. +of.message.shaders.aa2=Kérlek kapcsold Minőség -> Élsimítás-t ki és indísd újra a játékot. + +of.message.shaders.af1=A shaderek nem kompatibilisek az Anizotróp Szűréssel. +of.message.shaders.af2=Kérlek kapcsold Minőség -> Anizotróp Szűrés-t ki. + +of.message.shaders.fr1=A shaderek nem kompatibilisek a Gyors Rendereléssel. +of.message.shaders.fr2=Kérlek kapcsold Teljesítmény -> Gyors Renderelés-t ki. + +of.message.shaders.an1=A shaderek nem kompatibilisek a sztereoszkopikus 3D-vel. +of.message.shaders.an2=Kérlek kapcsold Egyéb -> Sztereoszkopikus 3D-t ki. + +of.message.newVersion=Egy új §eOptiFine§f verzió elérhető: §e%s§f +of.message.java64Bit=Tudsz telepíteni §e64-bit Java§f -t a teljesítmény növeléséhez. +of.message.openglError=§eOpenGL Error§f: %s (%s) + +of.message.shaders.loading=Shader betöltése: %s + +of.message.other.reset=Törli az összes videóbeállítást az alapértelmezett értékekre? + +# Video settings + +options.graphics.tooltip.1=Vizuális minőség +options.graphics.tooltip.2= Gyors - alacsonyabb minőség, gyorsabb +options.graphics.tooltip.3= Szép - magasabb minőség, lassabb +options.graphics.tooltip.4=Megváltoztatja a megjelenését a felhőknek, leveleknek, víznek, +options.graphics.tooltip.5=árnyékoknak és a fű oldalainak. + +of.options.renderDistance.tiny=Apró +of.options.renderDistance.short=Rövid +of.options.renderDistance.normal=Normál +of.options.renderDistance.far=Messzi +of.options.renderDistance.extreme=Extrém + +options.renderDistance.tooltip.1=Látótávolság +options.renderDistance.tooltip.2= 2 Apró - 32m (leggyorsabb) +options.renderDistance.tooltip.3= 4 Rövid - 64m (gyorsabb) +options.renderDistance.tooltip.4= 8 Normál - 128m +options.renderDistance.tooltip.5= 16 Messzi - 256m (lassabb) +options.renderDistance.tooltip.6= 32 Extrém - 512m (leglassab!) +options.renderDistance.tooltip.7=Az Extrém látótávolság nagyon erőforrás igényes! +options.renderDistance.tooltip.8=Értékek 16 Messzi fölött csak helyi világokban effektív. + +options.ao.tooltip.1=Simított megvilágítás +options.ao.tooltip.2= KI - Nincs simított megvilágítás (gyorsabb) +options.ao.tooltip.3= Minimum - Egyszerű simított megvilágítás (lassabb) +options.ao.tooltip.4= Maximum - Bonyolult simított megvilágítás (leglassab) + +options.framerateLimit.tooltip.1=Maximum FPS +options.framerateLimit.tooltip.2= VSync - A monitor képkocka frissítéséhez szabott (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - változó +options.framerateLimit.tooltip.4= Korlátlan - nincs határ (leggyorsabb) +options.framerateLimit.tooltip.5=Az FPS korlátozás csökkenti az FPS-t akkor is, ha +options.framerateLimit.tooltip.6=a korlát érték nincs elérve. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Simított Megvilágítás Szintje +of.options.AO_LEVEL.tooltip.1=Simított megvilágítás szintje +of.options.AO_LEVEL.tooltip.2= KI - nincsenek árnyékok +of.options.AO_LEVEL.tooltip.3= 50%% - halvány árnyékok +of.options.AO_LEVEL.tooltip.4= 100%% - sötét árnyékok + +options.viewBobbing.tooltip.1=Valósághűbb mozgás. +options.viewBobbing.tooltip.2=Amikor MIP-leképzést használsz, kapcsold ki a legjobb eredményekért. + +options.guiScale.tooltip.1=GUI Mérete +options.guiScale.tooltip.2=Kisebb GUI gyorsabb lehet. + +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Egy alternatív renderelési mintát használ, ami általában +options.vbo.tooltip.3=gyorsabb (5-10%%) az alapértelmezett renderelésnél. + +options.gamma.tooltip.1=A sötétebb objektumok fényerejét változtatja +options.gamma.tooltip.2= Borongós - normál fényerő +options.gamma.tooltip.3= 1-99%% - változó +options.gamma.tooltip.4= Fényes - maximum fényerő a sötétebb objektumoknak +options.gamma.tooltip.5=Ez a beállítás nem változtatja a fényerejét a +options.gamma.tooltip.6=teljesen fekete objektumoknak. + +options.anaglyph.tooltip.1=Sztereoszkopikus 3D +options.anaglyph.tooltip.2=Bekapcsolja a sztereoszopikus 3D effektet különböző színek használatával +options.anaglyph.tooltip.3=szemenként. +options.anaglyph.tooltip.4=Vörös-cián szemüveget igényel a megfelelő látásért. + +of.options.ALTERNATE_BLOCKS=Váltakozó Blokkok +of.options.ALTERNATE_BLOCKS.tooltip.1=Váltakozó Blokkok +of.options.ALTERNATE_BLOCKS.tooltip.2=Alernatív blokk mintákat használ egyes blokkokhoz. +of.options.ALTERNATE_BLOCKS.tooltip.3=A kiválasztott forráscsomagtól függ. + +of.options.FOG_FANCY=Köd +of.options.FOG_FANCY.tooltip.1=Köd típusa +of.options.FOG_FANCY.tooltip.2= Gyors - gyorsabb köd +of.options.FOG_FANCY.tooltip.3= Szép - lassabb köd, jobban mutat +of.options.FOG_FANCY.tooltip.4= KI - nincs köd, leggyorsabb +of.options.FOG_FANCY.tooltip.5=A szép köd csak akkor elérhető, ha támogatja a +of.options.FOG_FANCY.tooltip.6=videókártya. + +of.options.FOG_START=Köd Kezdete +of.options.FOG_START.tooltip.1=Köd kezdete +of.options.FOG_START.tooltip.2= 0.2 - a köd a játékostól közel kezdődik +of.options.FOG_START.tooltip.3= 0.8 - a köd a játékostól messze kezdődik +of.options.FOG_START.tooltip.4=Ez a beállítás általában nem gyakorol hatást a teljesítményre. + +of.options.CHUNK_LOADING=Terület Betöltése +of.options.CHUNK_LOADING.tooltip.1=Terület Betöltése +of.options.CHUNK_LOADING.tooltip.2= Alapértelmezett - instabil FPS területek betöltésekor +of.options.CHUNK_LOADING.tooltip.3= Lágy - stabil FPS +of.options.CHUNK_LOADING.tooltip.4= Kétmagos - stabil FPS, 3x gyorsabb világbetöltés +of.options.CHUNK_LOADING.tooltip.5=A Lágy és Kétmagos eltávolítja az akadozásokat, és +of.options.CHUNK_LOADING.tooltip.6=a befagyásokat, amit a területbetöltés okoz. +of.options.CHUNK_LOADING.tooltip.7=A Kétmagos fel tudja gyorsítani a világbetöltést a 3x-osára, és +of.options.CHUNK_LOADING.tooltip.8=képes az FPS növelésére a 2. processzormag használatával. +of.options.chunkLoading.smooth=Lágy +of.options.chunkLoading.multiCore=Kétmagos + +of.options.shaders=Shaderek... +of.options.shadersTitle=Árnyékok és egyéb finomságok + +of.options.shaders.packNone=KI +of.options.shaders.packDefault=(belső) + +of.options.shaders.ANTIALIASING=Élsimítás +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.RENDER_RES_MUL=Render Minőség +of.options.shaders.SHADOW_RES_MUL=Árnyék Minőség +of.options.shaders.HAND_DEPTH_MUL=Kézmélység +of.options.shaders.CLOUD_SHADOW=Felhőárnyék +of.options.shaders.OLD_HAND_LIGHT=Régi Kézmegvilágítás +of.options.shaders.OLD_LIGHTING=Régi Megvilágítás +of.options.shaders.SHADER_PACK=Shader Csomag + +of.options.shaders.shadersFolder=Shaderek mappája +of.options.shaders.shaderOptions=Shader Beállítások... + +of.options.shaderOptionsTitle=Shader Beállítások + +of.options.quality=Minőség... +of.options.qualityTitle=Minőségi Beállítások + +of.options.details=Részletek... +of.options.detailsTitle=Részletbeállítások + +of.options.performance=Teljesítmény... +of.options.performanceTitle=Teljesítmény Beállítások + +of.options.animations=Animációk... +of.options.animationsTitle=Animáció Beállítások + +of.options.other=Egyéb... +of.options.otherTitle=Egyéb Beállítások + +of.options.other.reset=Videóbeállítások Törlése... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilineáris +of.options.mipmap.linear=Lineáris +of.options.mipmap.nearest=Legközelebbi +of.options.mipmap.trilinear=Trilineáris + +options.mipmapLevels.tooltip.1=Vizuális effekt, ami a távolabbi dolgokat szebbé teszi +options.mipmapLevels.tooltip.2=a textúrák részletességének simításával. +options.mipmapLevels.tooltip.3= KI - nincs simítás +options.mipmapLevels.tooltip.4= 1 - minimum simítás +options.mipmapLevels.tooltip.5= 4 - maximum simítás +options.mipmapLevels.tooltip.6=Ez a beállítás általában nem gyakorol hatást a teljesítményre. + +of.options.MIPMAP_TYPE=MIP-leképzés típusa +of.options.MIPMAP_TYPE.tooltip.1=Vizuális effekt, ami a távolabbi dolgokat szebbé teszi +of.options.MIPMAP_TYPE.tooltip.2=a textúrák részletességének simításával. +of.options.MIPMAP_TYPE.tooltip.3= Legközelebbi - durva simítás (leggyorsabb) +of.options.MIPMAP_TYPE.tooltip.4= Lineáris - normál simítás +of.options.MIPMAP_TYPE.tooltip.5= Bilineáris - finom simítás +of.options.MIPMAP_TYPE.tooltip.6= Trilineáris - legfinomabb simítás (leglassabb) + + +of.options.AA_LEVEL=Élsimítás +of.options.AA_LEVEL.tooltip.1=Élsimítás +of.options.AA_LEVEL.tooltip.2= KI - (alapértelmezett) nincs élsimítás (gyorsabb) +of.options.AA_LEVEL.tooltip.3= 2-16 - élsimított vonalak és élek (lassabb) +of.options.AA_LEVEL.tooltip.4=Az Élsimítás kisimítja az egyenletlen vonalakat, és +of.options.AA_LEVEL.tooltip.5=az éles színátmeneteket. +of.options.AA_LEVEL.tooltip.6=Bekapcsolás esetén lényegesen csökkentheti az FPS-t. +of.options.AA_LEVEL.tooltip.7=Nem minden szint támogatott egyes videókártyákon. +of.options.AA_LEVEL.tooltip.8=ÚJRAINDÍTÁS után effektív! + +of.options.AF_LEVEL=Aniszotróp Szűrés +of.options.AF_LEVEL.tooltip.1=Anizotróp Szűrés +of.options.AF_LEVEL.tooltip.2= KI - (alapértelmezett) alap textúra részletesség (gyorsabb) +of.options.AF_LEVEL.tooltip.3= 2-16 - finomabb részletek a MIP-leképzett textúrákon (lassabb) +of.options.AF_LEVEL.tooltip.4=Az Anizotróp Szűrés helyreállítja a részleteket a +of.options.AF_LEVEL.tooltip.5=MIP-leképzett textúrákon. +of.options.AF_LEVEL.tooltip.6=Bekapcsolás esetén lényegesen csökkentheti az FPS-t. + +of.options.CLEAR_WATER=Tiszta Víz +of.options.CLEAR_WATER.tooltip.1=Tiszta Víz +of.options.CLEAR_WATER.tooltip.2= BE - tiszta, átlátszó víz +of.options.CLEAR_WATER.tooltip.3= KI - alapértelmezett víz + +of.options.RANDOM_MOBS=Véletlenszerű Mobok +of.options.RANDOM_MOBS.tooltip.1=Véletlenszerű Mobok +of.options.RANDOM_MOBS.tooltip.2= KI - nincsenek véletlenszerű mobok, gyorsabb +of.options.RANDOM_MOBS.tooltip.3= BE - véletlenszerű mobok, lassabb +of.options.RANDOM_MOBS.tooltip.4=A véletlenszerű mobok véletlenszerű textúrákat használ a játék lényeinek. +of.options.RANDOM_MOBS.tooltip.5=Olyan erőforráscsomagot igényel, amiben vannak dupla mob textúrák . + +of.options.BETTER_GRASS=Jobb Fű +of.options.BETTER_GRASS.tooltip.1=Jobb Fű +of.options.BETTER_GRASS.tooltip.2= KI - alapértelmezett fű oldaltextúra, leggyorsabb +of.options.BETTER_GRASS.tooltip.3= Gyors - teljes fű oldaltextúra, lassabb +of.options.BETTER_GRASS.tooltip.4= Szép - dinamikus fű oldaltextúra, leglassabb + +of.options.BETTER_SNOW=Jobb Hó +of.options.BETTER_SNOW.tooltip.1=Jobb Hó +of.options.BETTER_SNOW.tooltip.2= KI - alapértelmezett hó, gyorsabb +of.options.BETTER_SNOW.tooltip.3= BE - jobb hó, lassabb +of.options.BETTER_SNOW.tooltip.4=Mutatja a havat az átlátszó blokkok alatt (kerítés, magas fú), +of.options.BETTER_SNOW.tooltip.5=amikor hóval van körülvéve. + +of.options.CUSTOM_FONTS=Egyéni Betűtípus +of.options.CUSTOM_FONTS.tooltip.1=Egyéni Betűtípus +of.options.CUSTOM_FONTS.tooltip.2= BE - egyéni betűtípust használ (alapértelmezett), lassabb +of.options.CUSTOM_FONTS.tooltip.3= KI - alapértelmezett betűtípust használ, gyorsabb +of.options.CUSTOM_FONTS.tooltip.4=Az egyéni betűtípust a jelenlegi forráscsomag +of.options.CUSTOM_FONTS.tooltip.5=biztosítja. + +of.options.CUSTOM_COLORS=Egyéni Színek +of.options.CUSTOM_COLORS.tooltip.1=Egyéni Színek +of.options.CUSTOM_COLORS.tooltip.2= BE - egyéni színeket használ (default), lassabb +of.options.CUSTOM_COLORS.tooltip.3= KI - alapértelmezett színeket használ, gyorsabb +of.options.CUSTOM_COLORS.tooltip.4=Az egyéni színeket a jelenlegi forráscsomag +of.options.CUSTOM_COLORS.tooltip.5=biztosítja. + +of.options.SWAMP_COLORS=Mocsár Színek +of.options.SWAMP_COLORS.tooltip.1=Mocsár Színek +of.options.SWAMP_COLORS.tooltip.2= BE - mocsárszíneket használ (alapértelmezett), lassabb +of.options.SWAMP_COLORS.tooltip.3= KI - nem használ mocsárszíneket, gyorsabb +of.options.SWAMP_COLORS.tooltip.4=A mocsár színek a füvet, leveleket, indákat és a vizet érintik. + +of.options.SMOOTH_BIOMES=Simított Biomok +of.options.SMOOTH_BIOMES.tooltip.1=Simított Biomok +of.options.SMOOTH_BIOMES.tooltip.2= BE - a biome szélek simítása (default), lassabb +of.options.SMOOTH_BIOMES.tooltip.3= KI - nincs simítás a biomok szélénél, gyorsabb +of.options.SMOOTH_BIOMES.tooltip.4=A simítás a biomok szélénél mintavétellel, és +of.options.SMOOTH_BIOMES.tooltip.5=a színek átlagosításával történik a környező blokkokon. +of.options.SMOOTH_BIOMES.tooltip.6=Érintettek: fű, levelek, indák és a víz. + +of.options.CONNECTED_TEXTURES=Csatlakozó Textúrák +of.options.CONNECTED_TEXTURES.tooltip.1=Csatlakozó Textúrák +of.options.CONNECTED_TEXTURES.tooltip.2= KI - nincsenek csatlakozó textúrák (alapértelmezett) +of.options.CONNECTED_TEXTURES.tooltip.3= Gyors - gyors csatlakozó textúrák +of.options.CONNECTED_TEXTURES.tooltip.4= Szép - szép csatlakozó textúrák +of.options.CONNECTED_TEXTURES.tooltip.5=A csatlakozó textúrák egybeköti az üveget, +of.options.CONNECTED_TEXTURES.tooltip.6=homokkövet és a könyvespolcokat, ha egymás mellet +of.options.CONNECTED_TEXTURES.tooltip.7=vannak. Acsatlakozó textúrákat a jelenlegi +of.options.CONNECTED_TEXTURES.tooltip.8=forráscsomag biztosítja. + +of.options.NATURAL_TEXTURES=Természetes Textúrák +of.options.NATURAL_TEXTURES.tooltip.1=Természetes Textúrák +of.options.NATURAL_TEXTURES.tooltip.2= KI - nincsenek természetes textúrák (alapértelmezett) +of.options.NATURAL_TEXTURES.tooltip.3= BE - természetes textúrákat használ +of.options.NATURAL_TEXTURES.tooltip.4=A természetes textúrák eltüntetik a rácsszerű mintázatot, +of.options.NATURAL_TEXTURES.tooltip.5=amit az azonos típusú irmétlődő blokkok okoznak. +of.options.NATURAL_TEXTURES.tooltip.6=A blokkok alaptextúráinak forgatott változatát +of.options.NATURAL_TEXTURES.tooltip.7=használja. A konfigurációját a természetes textúráknak +of.options.NATURAL_TEXTURES.tooltip.8=a jelenlegi forráscsomag biztosítja. + +of.options.CUSTOM_SKY=Egyéni Ég +of.options.CUSTOM_SKY.tooltip.1=Egyéni Ég +of.options.CUSTOM_SKY.tooltip.2= BE - egyéni ég textúrák (alapértelmezett), lassú +of.options.CUSTOM_SKY.tooltip.3= KI - alapértelmezett ég textúrák, gyorsabb +of.options.CUSTOM_SKY.tooltip.4=Az egyéni ég textúrákat a jelenlegi +of.options.CUSTOM_SKY.tooltip.5=erőforráscsomag biztosítja. + +of.options.CUSTOM_ITEMS=Egyéni Tárgyak +of.options.CUSTOM_ITEMS.tooltip.1=Egyéni Tárgyak +of.options.CUSTOM_ITEMS.tooltip.2= BE - egyéni tárgy textúrák (alapértelmezett), lassú +of.options.CUSTOM_ITEMS.tooltip.3= KI - alapértelmezett tárgy textúrák, gyorsabb +of.options.CUSTOM_ITEMS.tooltip.4=Az egyéni tárgy textúrákat a jelenlegi +of.options.CUSTOM_ITEMS.tooltip.5=erőforráscsomag biztosítja. + +# Details + +of.options.CLOUDS=Felhők +of.options.CLOUDS.tooltip.1=Felhők +of.options.CLOUDS.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.CLOUDS.tooltip.3= Gyors - alacsonyabb minőség, gyorsabb +of.options.CLOUDS.tooltip.4= Szép - magasabb minőség, lassabb +of.options.CLOUDS.tooltip.5= KI - nincsenek felhők, leggyorsabb +of.options.CLOUDS.tooltip.6=A gyors felhők 2D-sek. +of.options.CLOUDS.tooltip.7=A szép felhők 3D-sek. + +of.options.CLOUD_HEIGHT=Felhőmagasság +of.options.CLOUD_HEIGHT.tooltip.1=Felhőmagasság +of.options.CLOUD_HEIGHT.tooltip.2= KI - alapértelmezett magasság +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - a limitált világmagasság felett van + +of.options.TREES=Fák +of.options.TREES.tooltip.1=Fák +of.options.TREES.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.TREES.tooltip.3= Gyors - alacsonyabb minőség, gyorsabb +of.options.TREES.tooltip.4= Okos - magasabb minőség, gyors +of.options.TREES.tooltip.5= Szép - legmagasabb minőség, lassabb +of.options.TREES.tooltip.6=A gyors fáknak átlátszatlan levelei vannak. +of.options.TREES.tooltip.7=A szép és az okos fáknak átlátszó levelei vannak. + +of.options.RAIN=Eső & Hó +of.options.RAIN.tooltip.1=Eső & Hó +of.options.RAIN.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.RAIN.tooltip.3= Gyors - ritka eső/hó, gyorsabb +of.options.RAIN.tooltip.4= Szép - sűrű eső/hó, lassabb +of.options.RAIN.tooltip.5= KI - nincs eső/hó, leggyorsabb +of.options.RAIN.tooltip.6=Amikor az eső ki van kapcsolva, atól még a fröccsenések +of.options.RAIN.tooltip.7=és a hangok aktívak. + +of.options.SKY=Ég +of.options.SKY.tooltip.1=Ég +of.options.SKY.tooltip.2= BE - az ég látszik, lassabb +of.options.SKY.tooltip.3= KI - az ég nem látszik, gyorsabb +of.options.SKY.tooltip.4=Ha az ég ki van kapcsolva, attól még a nap és a hold látszik. + +of.options.STARS=Csillagok +of.options.STARS.tooltip.1=Csillagok +of.options.STARS.tooltip.2= BE - a csillagok látszódnak, lassabb +of.options.STARS.tooltip.3= KI - a csillagok nem látszódnak, gyorsabb + +of.options.SUN_MOON=Nap & Hold +of.options.SUN_MOON.tooltip.1=Nap & Hold +of.options.SUN_MOON.tooltip.2= BE - a hold és a nap látszik (alapértelmezett) +of.options.SUN_MOON.tooltip.3= KI - a hold és a nap nem látszik (gyorsabb) + +of.options.SHOW_CAPES=Köpeny Mutatása +of.options.SHOW_CAPES.tooltip.1=Köpeny Mutatása +of.options.SHOW_CAPES.tooltip.2= BE - mutatja ajátékosok köpenyeit (alapértelmezett) +of.options.SHOW_CAPES.tooltip.3= KI - nem mutatja ajátékosok köpenyeit + +of.options.TRANSLUCENT_BLOCKS=Áttetsző Blokkok +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Áttetsző Blokkok +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Szép - korrekt színhajlítás (alapértelmezett) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Gyors - gyors színhajlítás (gyorsabb) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Irányitja a színhajlását az áttetsző blokkoknak +of.options.TRANSLUCENT_BLOCKS.tooltip.5=különböző színekkel (színezett üveg, víz, jég), +of.options.TRANSLUCENT_BLOCKS.tooltip.6=amikor egymás mögé helyezzük őket levegővel közöttük. + +of.options.HELD_ITEM_TOOLTIPS=Fogott Tárgytippek +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Fogott Tárgytippek +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= BE - tippet mutat a tartott tárgynál (alapértelmezett) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= KI - nem mutat tippet mutat a tartott tárgynál + +of.options.DROPPED_ITEMS=Eldobott Tárgyak +of.options.DROPPED_ITEMS.tooltip.1=Eldobott Tárgyak +of.options.DROPPED_ITEMS.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában +of.options.DROPPED_ITEMS.tooltip.3= Gyors - 2D-s eldobott tárgyak, gyorsabb +of.options.DROPPED_ITEMS.tooltip.4= Szép - 3D-s eldobott tárgyak, lassabb + +options.entityShadows.tooltip.1=Entitás Árnyékok +options.entityShadows.tooltip.2= BE - entitás árnyékok mutatása +options.entityShadows.tooltip.3= KI - entitás árnyékok nem mutatása + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Vizuális effekt, ami kissé elsötétíti a képernyő sarkait +of.options.VIGNETTE.tooltip.2= Alapértelmezett - ahogy az be van állítva a Grafikában (alapértelmezett) +of.options.VIGNETTE.tooltip.3= Fast - vignette kikapcsolva (gyorsabb) +of.options.VIGNETTE.tooltip.4= Fancy - vignette bekapcsolva (lassabb) +of.options.VIGNETTE.tooltip.5=A vignette-nek jelentős nyoma lehet az FPS-en, +of.options.VIGNETTE.tooltip.6=főleg teljes képernyős módon játszva. +of.options.VIGNETTE.tooltip.7=A vignette effekt teljesen apró, és nyugodtan +of.options.VIGNETTE.tooltip.8=kikapcsolható + +of.options.DYNAMIC_FOV=Dinamikus FOV +of.options.DYNAMIC_FOV.tooltip.1=Dinamikus FOV +of.options.DYNAMIC_FOV.tooltip.2= BE - bekapcsolja a dinamikus FOV-t (alapértelmezett) +of.options.DYNAMIC_FOV.tooltip.3= KI - kikapcsolja a dinamikus FOV-t +of.options.DYNAMIC_FOV.tooltip.4=Megváltoztatja a látómezőt (FOV) repülés, futás +of.options.DYNAMIC_FOV.tooltip.5=vagy íjászkodás közben. + +of.options.DYNAMIC_LIGHTS=Dinamikus Fények +of.options.DYNAMIC_LIGHTS.tooltip.1=Dinamikus Fények +of.options.DYNAMIC_LIGHTS.tooltip.2= KI - nincs dinamikus fény (alapértelmezett) +of.options.DYNAMIC_LIGHTS.tooltip.3= Gyors - gyors dinamikus fény (frissítve minden 500ms-ként) +of.options.DYNAMIC_LIGHTS.tooltip.4= Szép - szép dinamikus fény (valós időben frissítve) +of.options.DYNAMIC_LIGHTS.tooltip.5=Engedélyezi a fénykibocsájtó tárgyaknak (fáklya, izzókő, stb.), +of.options.DYNAMIC_LIGHTS.tooltip.6=hogy fényt bocsássanak ki, mikor kézben cipelik, +of.options.DYNAMIC_LIGHTS.tooltip.7=másik karakter használja, vagy a füldre van dobva. + +# Performance + +of.options.SMOOTH_FPS=Sima FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizálja az FPS-t a grafikus beghajtő buffereinek öblítésével. +of.options.SMOOTH_FPS.tooltip.2= KI - nincs stabilizálás, FPS inoghat +of.options.SMOOTH_FPS.tooltip.3= BE - FPS stabilizáció +of.options.SMOOTH_FPS.tooltip.4=Ez a beállítás grafikus meghajtó függő, és a hatása +of.options.SMOOTH_FPS.tooltip.5=nem mindíg látható. + +of.options.SMOOTH_WORLD=Sima Világ +of.options.SMOOTH_WORLD.tooltip.1=Eltávolítja a "lagtüskéket", amit a helyi szerver okoz. +of.options.SMOOTH_WORLD.tooltip.2= OFF - nincs stabilizáció, FPS inoghat +of.options.SMOOTH_WORLD.tooltip.3= ON - FPS stabilizáció +of.options.SMOOTH_WORLD.tooltip.4=Stabilizálja az FPS-t, amit a helyi szerver okoz. +of.options.SMOOTH_WORLD.tooltip.5=Csak helyi világokban effektív (egyjátékos mód). + +of.options.FAST_RENDER=Gyors Renderelés +of.options.FAST_RENDER.tooltip.1=Gyors Renderelés +of.options.FAST_RENDER.tooltip.2= KI - alap renderelés (alapértelmezett) +of.options.FAST_RENDER.tooltip.3= BE - optimalizált renderelés (gyorsabb) +of.options.FAST_RENDER.tooltip.4=Optimalizált renderelési algoritmust használ, ami csökkenti +of.options.FAST_RENDER.tooltip.5=a GPU töltési időt, és lényegesen növelheti az FPS-t. + +of.options.FAST_MATH=Gyors Matek +of.options.FAST_MATH.tooltip.1=Gyors Matek +of.options.FAST_MATH.tooltip.2= KI - alap matek (alapértelmezett) +of.options.FAST_MATH.tooltip.3= BE - gyorsabb matek +of.options.FAST_MATH.tooltip.4=Optimalizált sin() és cos() függvényeket használ, ami jobban +of.options.FAST_MATH.tooltip.5=hasznosítja a CPU gyorsítótárat, és növelheti az FPS-t. + +of.options.CHUNK_UPDATES=Terület Frissítések +of.options.CHUNK_UPDATES.tooltip.1=Terület Frissítések +of.options.CHUNK_UPDATES.tooltip.2= 1 - lassabb világbetöltés, magasabb FPS (alapértelmezett) +of.options.CHUNK_UPDATES.tooltip.3= 3 - gyorsabb világbetöltés, alacsonyabb FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - leggyorsabb világbetöltés, legalacsonyabb FPS +of.options.CHUNK_UPDATES.tooltip.5=Terület frissítések száma lerenderelt képkockánként; +of.options.CHUNK_UPDATES.tooltip.6=magasabb értékek instabilizálhatja az FPS-t. + +of.options.CHUNK_UPDATES_DYNAMIC=Dinamikus Frissítések +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dinamikus terület frissítések +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= KI - (alapértelmezett) alap területfrissítések képkockánként +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= BE - több frissítés, amíg a játékos egy helyben áll +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=A Dinamikus Frissítések több területfrissítést eröltet, amíg +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=a játékos egy helyben áll, hogy a világ gyorsabban betöltsön. + +of.options.LAZY_CHUNK_LOADING="Lusta Területek" Betöltése +of.options.LAZY_CHUNK_LOADING.tooltip.1="Lusta Területek" betöltése +of.options.LAZY_CHUNK_LOADING.tooltip.2= KI - alapértelmezett szerver terület betöltés +of.options.LAZY_CHUNK_LOADING.tooltip.3= BE - "lusta" szerver terület betöltés (simább) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Simítja az inegrált szerver területbetöltését +of.options.LAZY_CHUNK_LOADING.tooltip.5=a területek idönközötti "kattogásának" lekötésével. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Kapcsold ki, ha a világ bizonyos részei nem töltenek be megfelelően. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Csak helyi világokban és egymagos CPU esetén effektív. + +# Animations + +of.options.animation.allOn=Mind BE +of.options.animation.allOff=Mind KI +of.options.animation.dynamic=Dinamikus + +of.options.ANIMATED_WATER=Animált Víz +of.options.ANIMATED_LAVA=Animált Láva +of.options.ANIMATED_FIRE=Animált Tűz +of.options.ANIMATED_PORTAL=Animált Portál +of.options.ANIMATED_REDSTONE=Animált Vöröskő +of.options.ANIMATED_EXPLOSION=Animált Robbanás +of.options.ANIMATED_FLAME=Animált Lángok +of.options.ANIMATED_SMOKE=Animált Füst +of.options.VOID_PARTICLES=Űr Részecskék +of.options.WATER_PARTICLES=Víz Részecskék +of.options.RAIN_SPLASH=Eső Felcsapódás +of.options.PORTAL_PARTICLES=Portál Részecskék +of.options.POTION_PARTICLES=Bájital Részecskék +of.options.DRIPPING_WATER_LAVA=Kicsapó Víz/Láva +of.options.ANIMATED_TERRAIN=Animált Terep +of.options.ANIMATED_TEXTURES=Animált Textúrák +of.options.FIREWORK_PARTICLES=Tüzijáték Részecskék + +# Other + +of.options.LAGOMETER=Lagmérő +of.options.LAGOMETER.tooltip.1=Mutatja a lagmérőt a hibakereső képernyőn (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Memóriaszemét gyűjtemény +of.options.LAGOMETER.tooltip.3=* Cyan - "kegyegés" +of.options.LAGOMETER.tooltip.4=* Blue - Ütemezett végrehajthatók +of.options.LAGOMETER.tooltip.5=* Purple - Területfeltöltés +of.options.LAGOMETER.tooltip.6=* Red - Terület frissítés +of.options.LAGOMETER.tooltip.7=* Yellow - Láthatóságfigyelő +of.options.LAGOMETER.tooltip.8=* Green - Terep renderelése + +of.options.PROFILER=Hibakereső Profil +of.options.PROFILER.tooltip.1=Hibakereső Profil +of.options.PROFILER.tooltip.2= BE - hibakereső profil aktív, lassabb +of.options.PROFILER.tooltip.3= KI - hibakereső profil nem aktív, gyorsabb +of.options.PROFILER.tooltip.4=A hibakereső profil hibakereső információkat gyűjt, és mutat, +of.options.PROFILER.tooltip.5=amikor a hibakereső képernyő aktív (F3) + +of.options.WEATHER=Időjárás +of.options.WEATHER.tooltip.1=Időjárás +of.options.WEATHER.tooltip.2= BE - az időjárás aktív, lassabb +of.options.WEATHER.tooltip.3= KI - az időjárás nem aktív, gyorsabb +of.options.WEATHER.tooltip.4=Az időjárás irányítja az esőket, havazásokat, és a viharokat. +of.options.WEATHER.tooltip.5=Az időjárás irányítása csak helyi világokban lehetséges. + +of.options.time.dayOnly=Csak Nappal +of.options.time.nightOnly=Csak Éjszaka + +of.options.TIME=Idő +of.options.TIME.tooltip.1=Idő +of.options.TIME.tooltip.2= Alapértelmezett - normális éjjel-nappal körforgás +of.options.TIME.tooltip.3= Csak Nappal - csak nappal +of.options.TIME.tooltip.4= Csak Éjszaka - csak éjszaka +of.options.TIME.tooltip.5=Az Idő beállítás csak KREATÍV módban, +of.options.TIME.tooltip.6=és helyi világokban effektív. + +options.fullscreen.tooltip.1=Teljes Képernyő +options.fullscreen.tooltip.2= BE - teljes képernyős mód használata +options.fullscreen.tooltip.3= KI - ablakos mód használata +options.fullscreen.tooltip.4=A teljes képergyős mód gyorsabb, vagy lassabb lehet, mint +options.fullscreen.tooltip.5=az ablakos mód a videókártyától függően. + +of.options.FULLSCREEN_MODE=Teljes Képernyős Mód +of.options.FULLSCREEN_MODE.tooltip.1=Teljes Képernyős mód +of.options.FULLSCREEN_MODE.tooltip.2= Alapértelmezett - asztal méretének használata, lassabb +of.options.FULLSCREEN_MODE.tooltip.3= WxH - egyéni felbontás használata, lehet gyorsabb +of.options.FULLSCREEN_MODE.tooltip.4=A kiválasztott felbontás a teljes képernyős módban használatos (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Kisebb felbontások általában gyorsabbak. + +of.options.SHOW_FPS=FPS Mutatása +of.options.SHOW_FPS.tooltip.1=Mutatja a jelenlegi FPS számot, és renderelési információkat +of.options.SHOW_FPS.tooltip.2= C: - területek renderelése +of.options.SHOW_FPS.tooltip.3= E: - lerenderelt entitások + blokk entitások +of.options.SHOW_FPS.tooltip.4= U: - terület frissítések +of.options.SHOW_FPS.tooltip.5=A jeéenlegi FPS információ csak akkor mutatkozik, ha a +of.options.SHOW_FPS.tooltip.6=a hibakeresési képernyő nem látszik. + +of.options.save.default=Alapértelmezett (2mp) +of.options.save.20s=20mp +of.options.save.3min=3p +of.options.save.30min=30p + +of.options.AUTOSAVE_TICKS=Auto mentés +of.options.AUTOSAVE_TICKS.tooltip.1=Az auto mentés intervalluma +of.options.AUTOSAVE_TICKS.tooltip.2=Az alapértelmezett auto mentés intervallum (2mp) NEM JAVASOLT. +of.options.AUTOSAVE_TICKS.tooltip.3=Az auto mentés okozza a híres "Halál lagtüskéjét" famous Lag Spike of Death. + +options.anaglyph.tooltip.1=A 3D mód piros-cián szemüveggel használatos. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/it_it.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/it_it.lang new file mode 100644 index 0000000..19e60ca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/it_it.lang @@ -0,0 +1,601 @@ +# General +of.general.ambiguous=ambiguo +of.general.custom=Personalizza +of.general.from=De +of.general.id=ID +of.general.restart=Riavvia +of.general.smart=Intelligente + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=L'Antialiasing non è compatibile con le Shaders. +of.message.aa.shaders2=Disattivale per usare questa funzione. + +of.message.af.shaders1=L'Anisotropico non è compatibile con le Shaders +of.message.af.shaders2=Disattivale per usare questa funzione. + +of.message.fr.shaders1=Il Rendering non è compatibile con le Shaders. +of.message.fr.shaders2=Disattivale per usare questa funzione. + +of.message.shaders.aa1=Le Shaders non sono compatibili con l'Antialiasing. +of.message.shaders.aa2=Per disattivarlo, fai clic su Qualità -> Antialiasing. + +of.message.shaders.af1=Le Shaders non sono compatibili con l'Anisotropico. +of.message.shaders.af2=Per disattivarlo, fai clic su Qualità -> Anisotropico. + +of.message.shaders.fr1=Le Shaders non sono compatibili col Rendering Veloce. +of.message.shaders.fr2=Per disattivarlo, fai clic su Prestazione -> Rendering Veloce. + +of.message.newVersion=C'è una nuova versione di §eOptiFine§f disponibile: §e%s§f +of.message.java64Bit=Installa §eJava da 64-bits§f per migliorare il Rendering +of.message.openglError=§eErrore di OpenGL§f: %s (%s) + +of.message.shaders.loading=Caricando le Shaders: %s + +of.message.other.reset=Ristabilire tutte le impostazioni grafiche? + +# Impostazioni Video + +options.graphics.tooltip.1=Grafica +options.graphics.tooltip.2= Rapida - qualità peggiore, prestazioni migliori +options.graphics.tooltip.3= Dettagliata - qualità migliore, prestazioni peggiori +options.graphics.tooltip.4= +options.graphics.tooltip.5=I cambiamenti sono visti nelle nuvole, nelle foglie, +options.graphics.tooltip.6=sotto la pioggia, negli oggetti buttati e negli +options.graphics.tooltip.7=angoli (o bordi) della schermata di gioco. + +of.options.renderDistance.extreme=Estrema + +options.renderDistance.tooltip.1=Distanza dei chuncks renderizzati +options.renderDistance.tooltip.2= 2 Minima - 32m (incredibilemente veloce) +options.renderDistance.tooltip.3= 4 Corta - 64m (veloce) +options.renderDistance.tooltip.4= 8 Normale - 128m +options.renderDistance.tooltip.5= 16 Lontana - 256m (lento) +options.renderDistance.tooltip.6= 32 Estrema - 512m (estremamente lento!) +options.renderDistance.tooltip.7=Il Rendering estremo ha bisogno di un buon computer! +options.renderDistance.tooltip.8=I valori superiori a 16 non funzionano in multigiocatore. + +options.ao.tooltip.1=Luci soffuse +options.ao.tooltip.2= No - senza luci soffuse (veloce) +options.ao.tooltip.3= Minimo - luci soffuse semplici (lento) +options.ao.tooltip.4= Massimo - luci soffuse avanzate (più lento) + +options.framerateLimit.tooltip.1=Limite di FPS +options.framerateLimit.tooltip.2= Sincronizzazione verticale - limita gli FPS secondo il tuo schermo (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - limite di FPS personalizzato +options.framerateLimit.tooltip.4= Senza limite - tutti gli FPS possibili (veloce) +options.framerateLimit.tooltip.5= +options.framerateLimit.tooltip.6=Impostando un limite di FPS, essi possono diminuire il +options.framerateLimit.tooltip.7=Raggiungimento ad esso. +of.options.framerateLimit.vsync=Sincronizzazione verticale + +of.options.AO_LEVEL=Livello di morbidezza +of.options.AO_LEVEL.tooltip.1=livello di illuminazione morbida +of.options.AO_LEVEL.tooltip.2= No - senza ombre +of.options.AO_LEVEL.tooltip.3= 50%% - poche ombre +of.options.AO_LEVEL.tooltip.4= 100%% - ombre scure +options.viewBobbing.tooltip.1=Movimento più realistico. +options.viewBobbing.tooltip.2=Disattivare l'utilizzo di mipmap per ottenere un miglior risultato. + +options.guiScale.tooltip.1=Scala dell'Interfaccia (GUI) +options.guiScale.tooltip.2=Un'interfaccia più piccola può migliorare le prestazioni. +options.vbo.tooltip.1=Vertex Buffer Objects (abbreviato in VBO) +options.vbo.tooltip.2=In alternativa è il rendering che di solito è più +options.vbo.tooltip.3=veloce (5-10%%) alla forma default. + +options.gamma.tooltip.1=Modificare la luminosità +options.gamma.tooltip.2= Scura - Luminosità di default +options.gamma.tooltip.3= 1-99%% - Luminosità personalizzata +options.gamma.tooltip.4= Luminoso - Luminosità al massimo +options.gamma.tooltip.5= +options.gamma.tooltip.6=Questa opzione non cambia particolarmente +options.gamma.tooltip.7=la luminosità degli oggetti più scuri. + +options.anaglyph.tooltip.1=Visione in 3D +options.anaglyph.tooltip.2=Attivare un effetto stereoscopico utilizzando un colore +options.anaglyph.tooltip.3=differente per ogni occhio. +options.anaglyph.tooltip.4=NOTA: Richiede occhiali anaglifi (rossi e blu). + +of.options.ALTERNATE_BLOCKS=Blocchi alternati +of.options.ALTERNATE_BLOCKS.tooltip.1=Blocchi con texture alternate +of.options.ALTERNATE_BLOCKS.tooltip.2=Utilizzare texture alternative per lo stesso blocco. +of.options.ALTERNATE_BLOCKS.tooltip.3=Dipende dal pacchetto di risorse usato. + +of.options.FOG_FANCY=Nebbia +of.options.FOG_FANCY.tooltip.1=Tipo di nebbia +of.options.FOG_FANCY.tooltip.2= Veloce - nebbia più veloce, sembra squallido +of.options.FOG_FANCY.tooltip.3= Dettagliata - nebbia più lenta, sembra migliore +of.options.FOG_FANCY.tooltip.4= No - senza foschia, super veloce +of.options.FOG_FANCY.tooltip.5=La nebbia dettagliata è disponibile solo se +of.options.FOG_FANCY.tooltip.6=la tua scheda grafica te lo permette. + +of.options.FOG_START=Distanza della nebbia +of.options.FOG_START.tooltip.1=Distanza in cui la nebbia comincia +of.options.FOG_START.tooltip.2= 0.2 - la nebbia inizia vicina al giocatore +of.options.FOG_START.tooltip.3= 0.8 - la nebbia inizia lontana dal giocatore +of.options.FOG_START.tooltip.4=Normalmente questa opzione non affligge le prestazioni. + +of.options.CHUNK_LOADING=Caricamento dei chuncks +of.options.CHUNK_LOADING.tooltip.1=Velocità del caricamento dei chuncks +of.options.CHUNK_LOADING.tooltip.2= Per default - FPS instabili al caricamento dei chuncks +of.options.CHUNK_LOADING.tooltip.3= Morbidi - FPS stabili +of.options.CHUNK_LOADING.tooltip.4= Multinucleo - FPS stabili e una velocità tre volte superiore +of.options.CHUNK_LOADING.tooltip.5=Le opzioni "Morbidi" e "Multinucleo" eliminano gli intoppi nella +of.options.CHUNK_LOADING.tooltip.6=lentezza causata nel carimento dei chuncks. +of.options.CHUNK_LOADING.tooltip.7=Il Multinucleo può accelerare il carico fino a tre volte e migliorare +of.options.CHUNK_LOADING.tooltip.8=gli FPS e usare un secondo nucleo della CPU. +of.options.chunkLoading.smooth=Morbido +of.options.chunkLoading.multiCore=Multinucleo + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=(SENZA SHADERS) +of.options.shaders.packDefault=(SHADERS INTERNE) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.NORMAL_MAP=Mappatura Normale +of.options.shaders.SPECULAR_MAP=Mappatura Speculare +of.options.shaders.RENDER_RES_MUL=Rendering di qualità. +of.options.shaders.SHADOW_RES_MUL=Ombre di qualità +of.options.shaders.HAND_DEPTH_MUL=Profondità di campo +of.options.shaders.CLOUD_SHADOW=Ombre delle nuvole +of.options.shaders.OLD_HAND_LIGHT=LC nelle mani +of.options.shaders.OLD_LIGHTING=Luce Classica (LC) +of.options.shaders.SHADER_PACK=Pacchetto di Shaders + +of.options.shaders.shadersFolder=Cartella Shaders +of.options.shaders.shaderOptions=Opzioni delle Shaders... + +of.options.shaderOptionsTitle=Opzioni delle Shaders + +of.options.quality=Qualità... +of.options.qualityTitle=Opzioni grafiche + +of.options.details=Dettagli... +of.options.detailsTitle=Opzioni grafiche + +of.options.performance=Prestazioni... +of.options.performanceTitle=Prestazioni + +of.options.animations=Animazioni... +of.options.animationsTitle=Attivare e disattivare le animazioni + +of.options.other=Opzioni varie... +of.options.otherTitle=Opzioni varie + +of.options.other.reset=Ripristinare tutte le impostazioni... + +of.shaders.profile=Profilo + +# Qualità + +of.options.mipmap.bilinear=Bilineare +of.options.mipmap.linear=Lineare +of.options.mipmap.nearest=Vicino +of.options.mipmap.trilinear=Trilinere + +options.mipmapLevels.tooltip.1=Effetto visivo che consente di visualizzare oggetti distanti +options.mipmapLevels.tooltip.2=migliori lisciando i dettagli della sua texture +options.mipmapLevels.tooltip.3= +options.mipmapLevels.tooltip.4= No - senza morbidezza +options.mipmapLevels.tooltip.5= 1 - morbidezza minima +options.mipmapLevels.tooltip.6= 4 - morbidezza massima +options.mipmapLevels.tooltip.7= +options.mipmapLevels.tooltip.8=Normalmente questa opzione non influisce sulle prestazioni. + +of.options.MIPMAP_TYPE=Tipo di mipmap +of.options.MIPMAP_TYPE.tooltip.1=Effetto visivo che consente di visualizzare oggetti distanti +of.options.MIPMAP_TYPE.tooltip.2=migliori lisciando i dettagli della sua texture +of.options.MIPMAP_TYPE.tooltip.3= +of.options.MIPMAP_TYPE.tooltip.4= Vicino - morbidezza brutta (più veloce) +of.options.MIPMAP_TYPE.tooltip.5= Lineare - morbidezza normale +of.options.MIPMAP_TYPE.tooltip.6= Bilineare - morbidezza sottile +of.options.MIPMAP_TYPE.tooltip.7= Trilineare - morbidezza molto sottile (più lenta) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing attenua linee e i bordi dei blocchi +of.options.AA_LEVEL.tooltip.2= No - (per default) senza antialiasing (più veloce) +of.options.AA_LEVEL.tooltip.3= 2-16 - livello di antialiasing morbido (più lento) +of.options.AA_LEVEL.tooltip.4= +of.options.AA_LEVEL.tooltip.5= Ammorbidisce i denti di sega e migliora la nitidezza. +of.options.AA_LEVEL.tooltip.6= Gli FPS può diminuire considerevolmente quando attivato. +of.options.AA_LEVEL.tooltip.7=Alcune schede grafiche non supportano tutti i livelli. +of.options.AA_LEVEL.tooltip.8= La modifica verrà applicata per RIAVVIARE il gioco! + +of.options.AF_LEVEL=Anisotropico +of.options.AF_LEVEL.tooltip.1=Anisotropico filtrato +of.options.AF_LEVEL.tooltip.2= No - (Default anisotropico) dettaglio texture Normale (veloce) +of.options.AF_LEVEL.tooltip.3= 2-16 - raffinare texture utilizzando mipmap (più lento) +of.options.AF_LEVEL.tooltip.4= +of.options.AF_LEVEL.tooltip.6=Questo filtro consente di recuperare i dettagli utilizzando mipmap +of.options.AF_LEVEL.tooltip.7=Gli FPS possono diminuire considerevolmente quando attivati. + +of.options.CLEAR_WATER=Acqua cristallina +of.options.CLEAR_WATER.tooltip.1=Acqua cristallina +of.options.CLEAR_WATER.tooltip.2= Sì - acqua limpida e trasparente +of.options.CLEAR_WATER.tooltip.3= No - acqua default + +of.options.RANDOM_MOBS=Creautre casuali +of.options.RANDOM_MOBS.tooltip.1=Randomizza texture delle creature +of.options.RANDOM_MOBS.tooltip.2= No - non casuale, più veloce +of.options.RANDOM_MOBS.tooltip.3= Sì - con randomizzazione, più lento +of.options.RANDOM_MOBS.tooltip.4= +of.options.RANDOM_MOBS.tooltip.5=Questa opzione permette alle creature di cambiare texture. +of.options.RANDOM_MOBS.tooltip.6=Richiede un pacchetto di risorse che abbia molteplici texture +of.options.RANDOM_MOBS.tooltip.7=per la stessa creatura. + +of.options.BETTER_GRASS=Prato migliorato +of.options.BETTER_GRASS.tooltip.1=Texture dei lati del blocco di terra migliorati aggiungendo prato +of.options.BETTER_GRASS.tooltip.2= No - prato normale (per default), più veloce +of.options.BETTER_GRASS.tooltip.3= Rapido - tutto il blocco è pieno d'erba +of.options.BETTER_GRASS.tooltip.4= Dettagliata - texture dinamica, molto lento + +of.options.BETTER_SNOW=Neve migliorata +of.options.BETTER_SNOW.tooltip.1=Neve migliorata +of.options.BETTER_SNOW.tooltip.2= No - neve default, più veloce +of.options.BETTER_SNOW.tooltip.3= Sì - neve dettagliata, più lento +of.options.BETTER_SNOW.tooltip.4= +of.options.BETTER_SNOW.tooltip.5=Mostra la neve sotto i blocchi trasparenti +of.options.BETTER_SNOW.tooltip.6=(Recinzioni, erbe) quando li si confina con la neve. + +of.options.CUSTOM_FONTS=Font personalizzabili +of.options.CUSTOM_FONTS.tooltip.1=Font personalizzabili +of.options.CUSTOM_FONTS.tooltip.2= Sì - utilizzare quelli personalizzati (per default), più lento +of.options.CUSTOM_FONTS.tooltip.3= No - utilizzare quelle default, più veloce +of.options.CUSTOM_FONTS.tooltip.4= +of.options.CUSTOM_FONTS.tooltip.5=Alcuni pacchetti di risorse contengono font +of.options.CUSTOM_FONTS.tooltip.6=personalizzabili + +of.options.CUSTOM_COLORS=Colori personalizzabili +of.options.CUSTOM_COLORS.tooltip.1=Colori personalizzati +of.options.CUSTOM_COLORS.tooltip.2= Sì - usare i colori personalizzati (per default), più lenti +of.options.CUSTOM_COLORS.tooltip.3= No - usare i colori default, più veloci +of.options.CUSTOM_COLORS.tooltip.4= +of.options.CUSTOM_COLORS.tooltip.5=Alcuni pacchetti di risorse contengono colori +of.options.CUSTOM_COLORS.tooltip.6=personalizzati. + +of.options.SWAMP_COLORS=Colore delle paludi +of.options.SWAMP_COLORS.tooltip.1=Colore delle paludi +of.options.SWAMP_COLORS.tooltip.2= Sì - colore delle paludi (per default), più lento +of.options.SWAMP_COLORS.tooltip.3= No - senza colori nelle paludi, più veloce +of.options.SWAMP_COLORS.tooltip.4=Colpisce: erba, acqua, foglie e viti. + +of.options.SMOOTH_BIOMES=Morbidezza dei biomi +of.options.SMOOTH_BIOMES.tooltip.1=Morbidezza dei confini dei biomi +of.options.SMOOTH_BIOMES.tooltip.2= Sì - bordi lisci bioma (default), più lento +of.options.SMOOTH_BIOMES.tooltip.3= No - senza bordi lisci dei biomi, più veloce +of.options.SMOOTH_BIOMES.tooltip.4= +of.options.SMOOTH_BIOMES.tooltip.5=Il livellamento viene eseguito +of.options.SMOOTH_BIOMES.tooltip.6=dai blocchi di colore gradiente vicino ai confini +of.options.SMOOTH_BIOMES.tooltip.7=Colpisce: erba, acqua, foglie e viti. + +of.options.CONNECTED_TEXTURES=Blocchi uniti +of.options.CONNECTED_TEXTURES.tooltip.1=Le texture uniscono blocchi determinati +of.options.CONNECTED_TEXTURES.tooltip.2= No - non unirli, più veloce +of.options.CONNECTED_TEXTURES.tooltip.3= Veloce - unirli in forma più semplice +of.options.CONNECTED_TEXTURES.tooltip.4= Detagliate - unirli in forma migliorata +of.options.CONNECTED_TEXTURES.tooltip.5= +of.options.CONNECTED_TEXTURES.tooltip.6=Unire le texture di vetro, pietra arenaria e +of.options.CONNECTED_TEXTURES.tooltip.7=biblioteche per ottenere i blocchi. +of.options.CONNECTED_TEXTURES.tooltip.8=Non tutti i pacchetti di risorse supportano questa azione. + +of.options.NATURAL_TEXTURES=Texture naturali +of.options.NATURAL_TEXTURES.tooltip.1=Texture naturali +of.options.NATURAL_TEXTURES.tooltip.2= No - senza texture naturali (per default) +of.options.NATURAL_TEXTURES.tooltip.3= Sì - con texture naturali +of.options.NATURAL_TEXTURES.tooltip.4=Questa opzione rimuove i blocchi del modello +of.options.NATURAL_TEXTURES.tooltip.5=che viene creato mettendo blocchi dello stesso tipo. +of.options.NATURAL_TEXTURES.tooltip.6=Si usano varianti ruotate della texture +of.options.NATURAL_TEXTURES.tooltip.7=base del blocco. +of.options.NATURAL_TEXTURES.tooltip.8=Non tutti i pacchetti di risorse supportano questa azione. + +of.options.CUSTOM_SKY=Cielo personalizzato +of.options.CUSTOM_SKY.tooltip.1=Texture personalizzata +of.options.CUSTOM_SKY.tooltip.2= Sì - cielo personalizzato, più lento +of.options.CUSTOM_SKY.tooltip.3= No - cielo default, più veloce +of.options.CUSTOM_SKY.tooltip.4= +of.options.CUSTOM_SKY.tooltip.5=Non tutti i pacchetti di risorse supportano questa azione. + +of.options.CUSTOM_ITEMS=Oggetti personalizzati +of.options.CUSTOM_ITEMS.tooltip.1=Texture personalizzata di oggetti (gli item) +of.options.CUSTOM_ITEMS.tooltip.2= Sì - oggetti personalizzati (per default), più lento +of.options.CUSTOM_ITEMS.tooltip.3= No - oggetti default, più veloce +of.options.CUSTOM_ITEMS.tooltip.4= +of.options.CUSTOM_ITEMS.tooltip.5=Non tutti i pacchetti di risorse supportano questa azione. + +of.options.CUSTOM_ENTITY_MODELS=Entità personalizzate +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Texture personalizzate delle entità +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Sì - variare modelli entità (default), più lento +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= No - modelli uso di default, più veloce +of.options.CUSTOM_ENTITY_MODELS.tooltip.4= +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=Non tutti i pacchetti di risorse supportano questa azione. + +# Details + +of.options.CLOUDS=Nuvole +of.options.CLOUDS.tooltip.1=Qualità delle nuvole +of.options.CLOUDS.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.CLOUDS.tooltip.3= Veloce - peggiore qualità, migliori prestazioni +of.options.CLOUDS.tooltip.4= Dettagliata - maggiore qualità, le prestazioni peggiori +of.options.CLOUDS.tooltip.5= No - senza nuvole, prestazioni super-veloci +of.options.CLOUDS.tooltip.6= +of.options.CLOUDS.tooltip.7=Le nubi veloci si renderizzano in 2D +of.options.CLOUDS.tooltip.8=Le nubi dettagliate si renderizzano in 3D + +of.options.CLOUD_HEIGHT=Altezza nuvole +of.options.CLOUD_HEIGHT.tooltip.1=Aumento dell'altezza dello strato di nubi +of.options.CLOUD_HEIGHT.tooltip.2= No - Altezza default +of.options.CLOUD_HEIGHT.tooltip.3= Verso il limite del mondo + +of.options.TREES=Alberi +of.options.TREES.tooltip.1=Qualità delle foglie +of.options.TREES.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.TREES.tooltip.3= Veloce - bassa qualità, migliori prestazioni +of.options.TREES.tooltip.4= Intelligente - più qualità, rendimento medio +of.options.TREES.tooltip.5= Dettagliata - alta qualità, le prestazioni peggiori +of.options.TREES.tooltip.6= +of.options.TREES.tooltip.7=La qualità veloce lascia le foglie senza trasparenza. +of.options.TREES.tooltip.8="Dettagliata" e "intelligente" fa mantenere la trasparenza. + +of.options.RAIN=Pioggia/Neve +of.options.RAIN.tooltip.1=Pioggia/Neve +of.options.RAIN.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.RAIN.tooltip.3= Rapida - pioggia / neve leggera, più veloce +of.options.RAIN.tooltip.4= Dettagliata - pioggia / neve pesante, lento +of.options.RAIN.tooltip.5= No - senza neve e pioggia, velocissimo +of.options.RAIN.tooltip.6= +of.options.RAIN.tooltip.7=Anche se la pioggia è spenta, i suoni di essa si sentono lo stesso +of.options.RAIN.tooltip.8=attivato. + +of.options.SKY=Cielo +of.options.SKY.tooltip.1=Cielo +of.options.SKY.tooltip.2= Sì - cielo visibile, più lento +of.options.SKY.tooltip.3= No - cielo non visibile, più veloce +of.options.SKY.tooltip.4= +of.options.SKY.tooltip.5=Anche se chiaro, la luna e il sole si continuano a vedere +of.options.SKY.tooltip.6=guardare. + +of.options.STARS=Cielo stellato +of.options.STARS.tooltip.1=Visibilità di stelle nel cielo notturno +of.options.STARS.tooltip.2= Sì - stellato, più lento +of.options.STARS.tooltip.3= No - senza stelle, più veloce + +of.options.SUN_MOON=Sole/Luna +of.options.SUN_MOON.tooltip.1=Visibilità del Sole e della Luna +of.options.SUN_MOON.tooltip.2= Sì - Il Sole e la Luna sono visibili (lento) +of.options.SUN_MOON.tooltip.3= No - Il Sole e la Luna non sono visibili (veloce) + +of.options.SHOW_CAPES=Mantelli +of.options.SHOW_CAPES.tooltip.1=Mantelli dei giocatori +of.options.SHOW_CAPES.tooltip.2= Sì - mostrare i mantelli dei giocatori +of.options.SHOW_CAPES.tooltip.3= No - occultare i mantelli dei giocatori + +of.options.TRANSLUCENT_BLOCKS=Blocchi traslucidi +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Qualità dei blocchi traslucidi +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Dettagliata - perfetta miscela di colori (default) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rapida - miscela di colori tatty (più veloce) +of.options.TRANSLUCENT_BLOCKS.tooltip.4= +of.options.TRANSLUCENT_BLOCKS.tooltip.5=Questa opzione riguarda i blocchi traslucidi che hanno +of.options.TRANSLUCENT_BLOCKS.tooltip.6=colore, ma solo quando posti uno dietro l'altro con +of.options.TRANSLUCENT_BLOCKS.tooltip.7=un blocco vuoto. +of.options.TRANSLUCENT_BLOCKS.tooltip.8=Influenza: vetrate, acqua, ghiaccio ... + +of.options.HELD_ITEM_TOOLTIPS=Testo barra in basso +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Numero di oggetti sulla barra inferiore +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Sì - mostrare i nomi (com'è tutt'ora) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= No - non mostrare i nomi (come anticamente) + +of.options.DROPPED_ITEMS=Oggetti +of.options.DROPPED_ITEMS.tooltip.1=Qualità degli oggetti a terra non raccolti +of.options.DROPPED_ITEMS.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.DROPPED_ITEMS.tooltip.3= Veloce - oggetti in 2D, più veloce ma più brutto +of.options.DROPPED_ITEMS.tooltip.4= Dettagliata - oggetti in 3D, più lento ma più bello + +options.entityShadows.tooltip.1=Ombre delle entità +options.entityShadows.tooltip.2= Sì - mostrare ombre alle enittà +options.entityShadows.tooltip.3= No - non mostrare ombre alle entità + +of.options.VIGNETTE=Bordi +of.options.VIGNETTE.tooltip.1=(Effetto proiettile) scurisce gli angoli dello schermo +of.options.VIGNETTE.tooltip.2= Predefinito - dipende dalle impostazioni della qualità grafica +of.options.VIGNETTE.tooltip.3= Effetto vignetta off (più veloce) - Veloce +of.options.VIGNETTE.tooltip.4= Dettagliata - effetto vignetta (più lento) +of.options.VIGNETTE.tooltip.5= +of.options.VIGNETTE.tooltip.6=Gli FPS possono diminuire drasticamente all'attivarsi, +of.options.VIGNETTE.tooltip.7=soprattutto a schermo intero. +of.options.VIGNETTE.tooltip.8=Effetto vignetta può essere disabilitato senza problemi. + +of.options.DYNAMIC_FOV=Visione campo dinamico +of.options.DYNAMIC_FOV.tooltip.1=Visione campo dinamico +of.options.DYNAMIC_FOV.tooltip.2= Sì - attivarlo (per default) +of.options.DYNAMIC_FOV.tooltip.3= No - disattivarlo +of.options.DYNAMIC_FOV.tooltip.4=Cambiare la visione del campo dinamio (FOV), quando si corre, cammina e si usa +of.options.DYNAMIC_FOV.tooltip.5=un arco. + +of.options.DYNAMIC_LIGHTS=Iluminazione dinamica +of.options.DYNAMIC_LIGHTS.tooltip.1=Iluminazione dinamica +of.options.DYNAMIC_LIGHTS.tooltip.2= No - senza illuminazione d. (per default) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapida - i. dinamica veloce (aggiornato ogni 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Dettagliata - i. dinamiche dettagliate (aggiornate in tempo reale) +of.options.DYNAMIC_LIGHTS.tooltip.5= +of.options.DYNAMIC_LIGHTS.tooltip.6=Questa opzione permette a certi oggetti che emettono luce di farlo anche non essendo piazzati +of.options.DYNAMIC_LIGHTS.tooltip.7=Quando metti uno di questi oggetti in mano o quando li butti +of.options.DYNAMIC_LIGHTS.tooltip.8=l'ambiente si accende (colpisce: torce, pietra luminosa ...). + +# Performance + +of.options.SMOOTH_FPS=Stabilizzare gli FPS +of.options.SMOOTH_FPS.tooltip.1=Stabilizzare l'FPS livellando il buffer driver grafico +of.options.SMOOTH_FPS.tooltip.2= No - senza stabilizzazione +of.options.SMOOTH_FPS.tooltip.3= Sì - con stabilizzazione +of.options.SMOOTH_FPS.tooltip.4= +of.options.SMOOTH_FPS.tooltip.5=Questa opzione dipende dal controller grafico e il suo effetto +of.options.SMOOTH_FPS.tooltip.6=non sempre è evidente. + +of.options.SMOOTH_WORLD=Stabilizzazione dei mondi +of.options.SMOOTH_WORLD.tooltip.1=Eliminare disturbi causati da lag server interno +of.options.SMOOTH_WORLD.tooltip.2= No - senza stabilizzazione +of.options.SMOOTH_WORLD.tooltip.3= Sì - con stabilizzazione +of.options.SMOOTH_WORLD.tooltip.4= +of.options.SMOOTH_WORLD.tooltip.5=Questa opzione stabilizza FPS e distribuisce il carico +of.options.SMOOTH_WORLD.tooltip.6=del server interno. +of.options.SMOOTH_WORLD.tooltip.7=Non funziona in multigiocatore + +of.options.FAST_RENDER=Rendering veloce +of.options.FAST_RENDER.tooltip.1=Rendering veloce +of.options.FAST_RENDER.tooltip.2= No - rendering standard (lento) +of.options.FAST_RENDER.tooltip.3= Sì - rendering ottimizzato (veloce) +of.options.FAST_RENDER.tooltip.4= +of.options.FAST_RENDER.tooltip.5=Usa un algoritmo di rendering migliorato diminuendo il +of.options.FAST_RENDER.tooltip.6=consumo di GPU e aumenta gli FPS. + +of.options.FAST_MATH=Matematica veloce +of.options.FAST_MATH.tooltip.1=Matematica veloce +of.options.FAST_MATH.tooltip.2= No - standard (per default) +of.options.FAST_MATH.tooltip.3= Sì - sistema veloce +of.options.FAST_MATH.tooltip.4= +of.options.FAST_MATH.tooltip.5=Utilizzare le funzioni sin() e cos() di Java in forma +of.options.FAST_MATH.tooltip.6=ottimizzata per migliorare l'uso della cache e della CPU per migliorare +of.options.FAST_MATH.tooltip.7=gli FPS. + +of.options.CHUNK_UPDATES=Aggiornamento dei chuncks +of.options.CHUNK_UPDATES.tooltip.1=Aggiornamento dei chuncks +of.options.CHUNK_UPDATES.tooltip.2= 1 - caricamento lento, FPS (default) +of.options.CHUNK_UPDATES.tooltip.3= 3 - caricamento più veloce, meno FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - caricamento super-veloce, pochissimi FPS +of.options.CHUNK_UPDATES.tooltip.5= +of.options.CHUNK_UPDATES.tooltip.6=Numero di chunks rendering per frame. +of.options.CHUNK_UPDATES.tooltip.7=Valori più alti possono destabilizzare l'FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Aggiornamento dinamico +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Aggiornamento dei chuncks in modo dinamico +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= No - (default) fotogramma di carico normale +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Sì - più aggiornamenti mentre si è fermi +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4= +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=Questa opzione forza l'aggiornamento dei chuncks mentre +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.6=si sta fermi per caricare il mondo più velocemente. + +of.options.LAZY_CHUNK_LOADING=Caricamento dei chuncks casuale +of.options.LAZY_CHUNK_LOADING.tooltip.1=Caricamento dei chuncks casuale +of.options.LAZY_CHUNK_LOADING.tooltip.2= No - caricamente dei chuncks in sitle default +of.options.LAZY_CHUNK_LOADING.tooltip.3= Sì - caricamento vago dei chuncks (stabilizza il caricamento) +of.options.LAZY_CHUNK_LOADING.tooltip.4= +of.options.LAZY_CHUNK_LOADING.tooltip.5=Ammorbidisce il caricamento interno dei chuncks distribuendola durante +of.options.LAZY_CHUNK_LOADING.tooltip.6=vari ticks. Disattivala se alcune parti del mondo non si sono +of.options.LAZY_CHUNK_LOADING.tooltip.7=caricate correttamente. +of.options.LAZY_CHUNK_LOADING.tooltip.8=Funziona solo su mondi locali con un core CPU. + +# Animations + +of.options.animation.allOn=TUTTI Sì +of.options.animation.allOff=TUTTI No +of.options.animation.dynamic=Dinamica + +of.options.ANIMATED_WATER=Acqua +of.options.ANIMATED_LAVA=Lava +of.options.ANIMATED_FIRE=Fuoco +of.options.ANIMATED_PORTAL=Portali +of.options.ANIMATED_REDSTONE=Pietra Rossa +of.options.ANIMATED_EXPLOSION=Esplosioni +of.options.ANIMATED_FLAME=Fuochi d'artificio +of.options.ANIMATED_SMOKE=Fumo +of.options.VOID_PARTICLES=Particelle del vuoto +of.options.WATER_PARTICLES=Particelle di acqua +of.options.RAIN_SPLASH=Pioggia +of.options.PORTAL_PARTICLES=Particelle dei portali +of.options.POTION_PARTICLES=Particelle delle pozioni +of.options.DRIPPING_WATER_LAVA=Gocce d'acqua/Bolle di lava +of.options.ANIMATED_TERRAIN=Terreno animato +of.options.ANIMATED_TEXTURES=Texture animate +of.options.FIREWORK_PARTICLES=Particelle dei fuochi d'artificio + +# Other + +of.options.LAGOMETER=Contatore di lag +of.options.LAGOMETER.tooltip.1=Mostra il contatore di lag premendo F3 +of.options.LAGOMETER.tooltip.2=* Arancione - Cestino nella memoria +of.options.LAGOMETER.tooltip.3=* Ciano - Ticks +of.options.LAGOMETER.tooltip.4=* Azzurro - Programmazione eseguibile +of.options.LAGOMETER.tooltip.5=* Porpora - Caricamento dei chuncks +of.options.LAGOMETER.tooltip.6=* Rosso - Aggiornamento dei chuncks +of.options.LAGOMETER.tooltip.7=* Giallo - Controllare la visibilità +of.options.LAGOMETER.tooltip.8=* Verde - Terreno renderizzato + +of.options.PROFILER=Profilo di debug +of.options.PROFILER.tooltip.1=Debug +of.options.PROFILER.tooltip.2= Sì - il profilo di debug attivato, più lento +of.options.PROFILER.tooltip.3= No - il profilo di debug disattivato, più veloce +of.options.PROFILER.tooltip.4=Il profilo di debug raccoglie e visualizza le ulteriori informazioni quando si +of.options.PROFILER.tooltip.5=usa F3. + +of.options.WEATHER=Tempo +of.options.WEATHER.tooltip.1= Tempo (tempo atmosferico) +of.options.WEATHER.tooltip.2= Sì - tempo attivato, più lento +of.options.WEATHER.tooltip.3= No - tempo disattivato, più veloce +of.options.WEATHER.tooltip.4=Il clima controlla pioggia, neve e tempeste. +of.options.WEATHER.tooltip.5=Questa opzione non funziona in multigiocatore. + +of.options.time.dayOnly=Sempre giorno +of.options.time.nightOnly=Sempre notte + +of.options.TIME=Tempo +of.options.TIME.tooltip.1=Tempo (orario, giorno o notte) +of.options.TIME.tooltip.2= Predefinito - cicli normali giorno / notte +of.options.TIME.tooltip.3= Sempre giorno - sempre è solo giorno +of.options.TIME.tooltip.4= Sempre notte - sempre e solo notte +of.options.TIME.tooltip.5=Questa opzione funziona solo in creativa e solamente +of.options.TIME.tooltip.6=in mondi locali (NON in multigiocatore). + +options.fullscreen.tooltip.1=Schermo intero +options.fullscreen.tooltip.2= Sì - giocare a schermo intero +options.fullscreen.tooltip.3= No - giocare a schermo normale +options.fullscreen.tooltip.4=Giocare a schermo intero può essere +options.fullscreen.tooltip.5=megliore o peggiore, dipende dalla scheda grafica. + +of.options.FULLSCREEN_MODE=Risoluzione +of.options.FULLSCREEN_MODE.tooltip.1=Risoluzione dello schermo intero +of.options.FULLSCREEN_MODE.tooltip.2= Predefinito - risoluzione del monitor, più lento +of.options.FULLSCREEN_MODE.tooltip.3= Wxh - un'altra risoluzione, in grado di andare più veloce +of.options.FULLSCREEN_MODE.tooltip.4=Modificare la risoluzione a schermo intero (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Normalmente il più basso incrementa le prestazioni. + +of.options.SHOW_FPS=Mostra FPS +of.options.SHOW_FPS.tooltip.1=Mostra FPS e i dati di rendering +of.options.SHOW_FPS.tooltip.2= C: - rendering dei chuncks +of.options.SHOW_FPS.tooltip.3= E: - enità rese + "block entities" +of.options.SHOW_FPS.tooltip.4= U: - aggiornamento dei chuncks +of.options.SHOW_FPS.tooltip.5= +of.options.SHOW_FPS.tooltip.6=Questi dati ridotti vengono visualizzati solo quando non si +of.options.SHOW_FPS.tooltip.7=usa F3. + +of.options.save.default=Originale (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autosalvataggio +of.options.AUTOSAVE_TICKS.tooltip.1=Intervallo dell'autosalvataggio +of.options.AUTOSAVE_TICKS.tooltip.2=L'intervallo di gioco originale (2s) non è raccomandato. +of.options.AUTOSAVE_TICKS.tooltip.3=Un breve intervallo può influire negativamente sulle prestazioni. + +options.anaglyph.tooltip.1=Visione in 3D + +of.options.SCREENSHOT_SIZE=Cattura (Screenshot) +of.options.SCREENSHOT_SIZE.tooltip.1= Dimensione Screenshot +of.options.SCREENSHOT_SIZE.tooltip.2= Predefinito - dimensioni normali +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - Formati personalizzati +of.options.SCREENSHOT_SIZE.tooltip.4=Gli Screenshots occupano più spazio aumentando la dimensione. +of.options.SCREENSHOT_SIZE.tooltip.5=Non è compatibile col Rendering veloce né col Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Richieda che la tua scheda grafica supporti Framebuffer + +of.options.ADVANCED_TOOLTIPS=Le descrizioni di oggetti +of.options.ADVANCED_TOOLTIPS.tooltip.1=Le descrizioni degli oggetti nell'inventario +of.options.ADVANCED_TOOLTIPS.tooltip.2= Sì - mostra le descrizioni +of.options.ADVANCED_TOOLTIPS.tooltip.3= No - non mostrare descrizioni (per default) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Questa opzione consente di visualizzare informazioni più dettagliate +of.options.ADVANCED_TOOLTIPS.tooltip.5=su oggetti (ID, durata) e le +of.options.ADVANCED_TOOLTIPS.tooltip.6=Shaders (ID, origine, di default). diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ja_JP.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ja_JP.lang new file mode 100644 index 0000000..83ec4e5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ja_JP.lang @@ -0,0 +1,676 @@ +# Contributors of Japanese localization # +# takanasayo 2012-12-01 ---- 2013-07-15 +# CrafterKina 2014-01-04 ---- 2017-12-04 + +# General +of.general.ambiguous=不明確 +of.general.custom=カスタム +of.general.from=から +of.general.id=ID +of.general.restart=再起動 +of.general.smart=スマート + +# Keys +of.key.zoom=ズーム + +# Message +of.message.aa.shaders1=アンチエイリアスはシェーダーと共存できません。 +of.message.aa.shaders2=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.af.shaders1=異方性フィルタリングはシェーダーと共存できません。 +of.message.af.shaders2=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.fr.shaders1=描画の最適化はシェーダーと共存できません。 +of.message.fr.shaders1=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.an.shaders1=3Dアナグリフはシェーダーと共存できません。 +of.message.an.shaders2=このオプションを有効にするには、シェーダを無効にしてください。 + +of.message.shaders.aa1=シェーダーはアンチエイリアスと共存できません。 +of.message.shaders.aa2=品質の設定 → アンチエイリアス をオフにし、ゲームを再起動してください。 + +of.message.shaders.af1=シェーダーは異方性フィルタリングと共存できません。 +of.message.shaders.af2=品質の設定 → 異方性フィルタリング をオフにしてください。 + +of.message.shaders.fr1=シェーダーは描画の最適化と共存できません。 +of.message.shaders.fr2=演出の設定 → 描画の最適化 をオフにしてください。 + +of.message.shaders.an1=シェーダーは3Dアナグリフと共存できません。 +of.message.shaders.an2=その他の設定 → 3Dアナグリフ をオフにしてください。 + +of.message.newVersion=新しい§eOptiFine§fが公開されました:§e%s§f +of.message.java64Bit=パフォーマンスを高めるために§e64-bit Java§fが利用できます。 +of.message.openglError=§eOpenGLエラー§f:%s(%s) + +of.message.shaders.loading=シェーダーをロード中:%s + +of.message.other.reset=全ての設定を元の状態に戻してもよろしいですか? + +of.message.loadingVisibleChunks=可視チャンクを読み込み中 + +# Video settings + +options.graphics.tooltip.1=グラフィックス +options.graphics.tooltip.2= 処理優先 - 低品質、 低負荷 +options.graphics.tooltip.3= 描画優先 - 高品質、 高負荷 +options.graphics.tooltip.4=葉の透過、アイテムやMobの影、ドロップアイテムの3D描写、 +options.graphics.tooltip.5=厚みのある雲、水の2パスレンダリング、といったグラフィック効果を変更します。 + +of.options.renderDistance.tiny=最短 +of.options.renderDistance.short=短い +of.options.renderDistance.normal=普通 +of.options.renderDistance.far=遠い +of.options.renderDistance.extreme=最遠 + +options.renderDistance.tooltip.1=描画距離 +options.renderDistance.tooltip.2= 2 最短 - 32m(より低負荷) +options.renderDistance.tooltip.3= 4 短い - 64m(低負荷) +options.renderDistance.tooltip.4= 8 普通 - 128m +options.renderDistance.tooltip.5= 16 遠い - 256m(高負荷) +options.renderDistance.tooltip.6= 32 最遠 - 512m(超高負荷!) +options.renderDistance.tooltip.7=最遠設定は非常に高いグラフィックス性能を要求します! +options.renderDistance.tooltip.8=遠いを超える描画距離はシングルのワールドでのみ効果があります。 + +options.ao.tooltip.1=スムースライティング +options.ao.tooltip.2= オフ - スムースライティングを使用しない(低負荷) +options.ao.tooltip.3= 最小 - 単純なスムースライティング(高負荷) +options.ao.tooltip.4= 最大 - 複雑なスムースライティング(最高負荷) + +options.framerateLimit.tooltip.1=最大のフレームレート +options.framerateLimit.tooltip.2= 垂直同期 - モニターのフレームレートに合わせる(60, 30, 20) +options.framerateLimit.tooltip.3= 5~255 - フレームレートを設定した値までに制限する +options.framerateLimit.tooltip.4= 無制限 - フレームレートを制限しない(最低負荷) +options.framerateLimit.tooltip.5=たとえ制限に達していなくとも、 +options.framerateLimit.tooltip.6=フレームレートを抑制します。 +of.options.framerateLimit.vsync=垂直同期 + +of.options.AO_LEVEL=スムースライティングの程度 +of.options.AO_LEVEL.tooltip.1=スムースライティングの程度 +of.options.AO_LEVEL.tooltip.2= オフ - 影なし +of.options.AO_LEVEL.tooltip.3= 50%% - 明るい影 +of.options.AO_LEVEL.tooltip.4= 100%% - 暗い影 + +options.viewBobbing.tooltip.1=より現実的な動き +options.viewBobbing.tooltip.2=ミップマップをオフにした時に最もよい結果が出ます。 + +options.guiScale.tooltip.1=GUIの大きさ +options.guiScale.tooltip.2= 自動 - 最大サイズ +options.guiScale.tooltip.3= 小さい,普通,大きい - 一倍から三倍 +options.guiScale.tooltip.4= 4x から 10x - 4k画面で有効 +options.guiScale.tooltip.5=奇数倍 (1x, 3x, 5x ...) はUnicodeフォントと互換がありません。 +options.guiScale.tooltip.6=GUIは小さいほうが処理が速くなるかもしれません。 + +options.vbo.tooltip.1=頂点バッファオブジェクト +options.vbo.tooltip.2=描画方式を新しいものに変更し、 +options.vbo.tooltip.3=5~10%%処理を軽くできます。 + +options.gamma.tooltip.1=暗い物体の明るさの変更 +options.gamma.tooltip.2= 暗い - 通常の明るさ +options.gamma.tooltip.3= 1~99%% - 明るさを調整する +options.gamma.tooltip.4= 明るい - 最大の明るさ +options.gamma.tooltip.5=完全に真っ暗な物体の明るさは、 +options.gamma.tooltip.6=変更できません。 + +options.anaglyph.tooltip.1=3Dアナグリフ +options.anaglyph.tooltip.2=それぞれの目に別々の色を使うことで +options.anaglyph.tooltip.3=立体視を可能にする機能を有効にします。 +options.anaglyph.tooltip.4=赤青3Dメガネが必要です。 + +options.blockAlternatives.tooltip.1=代替ブロック +options.blockAlternatives.tooltip.2=幾つかのブロックで代替モデルを使用します。 +options.blockAlternatives.tooltip.3=選択されたリソースパックに依存します。 + +of.options.ALTERNATE_BLOCKS=代替ブロック +of.options.ALTERNATE_BLOCKS.tooltip.1=代替ブロックの設定 +of.options.ALTERNATE_BLOCKS.tooltip.2=幾つかのブロックで代替モデルを使用します。 +of.options.ALTERNATE_BLOCKS.tooltip.3=選択されたリソースパックに依存します。 + +of.options.FOG_FANCY=霧の種類 +of.options.FOG_FANCY.tooltip.1=霧の種類の設定 +of.options.FOG_FANCY.tooltip.2= 処理優先 - 低負荷な霧 +of.options.FOG_FANCY.tooltip.3= 描画優先 - 高負荷な霧 より良く見える +of.options.FOG_FANCY.tooltip.4= オフ - 霧なし 最低負荷 +of.options.FOG_FANCY.tooltip.5=グラフィックカードが対応している場合のみ +of.options.FOG_FANCY.tooltip.6=美麗な霧を使用できます。 + +of.options.FOG_START=霧の距離 +of.options.FOG_START.tooltip.1=プレイヤーと霧の距離の設定 +of.options.FOG_START.tooltip.2= 0.2 - プレイヤーと霧の距離を最も近くする +of.options.FOG_START.tooltip.3= 0.8 - プレイヤーと霧の距離を最も遠くする +of.options.FOG_START.tooltip.4=この設定は大抵の場合パフォーマンスに影響を与えません。 + +of.options.CHUNK_LOADING=チャンク読込方法 +of.options.CHUNK_LOADING.tooltip.1=チャンクの読み込み方法 +of.options.CHUNK_LOADING.tooltip.2= デフォルト - チャンクロード時、FPSは安定しない。 +of.options.CHUNK_LOADING.tooltip.3= 滑らか - フレームレート低下を抑制。 +of.options.CHUNK_LOADING.tooltip.4= マルチコア - フレームレートのさらなる安定化 ワールドのロード処理が三倍ほど速くなる。 +of.options.CHUNK_LOADING.tooltip.5=滑らかやマルチコアであれば、チャンクロードに起因する +of.options.CHUNK_LOADING.tooltip.6=カクつきとフリーズを除けます。 +of.options.CHUNK_LOADING.tooltip.7=マルチコアでは二番目のCPUを用いることでワールドのロード処理が +of.options.CHUNK_LOADING.tooltip.8=三倍ほど速くでき、FPSも改善できます。 +of.options.chunkLoading.smooth=滑らか +of.options.chunkLoading.multiCore=マルチコア + +of.options.shaders=シェーダーの詳細設定... +of.options.shadersTitle=シェーダーの詳細設定 + +of.options.shaders.packNone=なし +of.options.shaders.packDefault=(内部シェーダー) + +of.options.shaders.ANTIALIASING=アンチエイリアス +of.options.shaders.ANTIALIASING.tooltip.1=アンチエイリアス +of.options.shaders.ANTIALIASING.tooltip.2= オフ - (初期値) アンチエイリアスを行わない(低負荷) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - アンチエイリアスされた輪郭(高負荷) +of.options.shaders.ANTIALIASING.tooltip.4=FXAAは輪郭のギザギザやシャープな色の変化を +of.options.shaders.ANTIALIASING.tooltip.5=滑らかにする後処理効果です。 +of.options.shaders.ANTIALIASING.tooltip.6=この機能は旧来のアンチエイリアス処理より低負荷で +of.options.shaders.ANTIALIASING.tooltip.7=シェーダーや描画の最適化機能と共存できます。 + +of.options.shaders.NORMAL_MAP=法線マップ +of.options.shaders.NORMAL_MAP.tooltip.1=法線マップ +of.options.shaders.NORMAL_MAP.tooltip.2= オン - (初期値) 法線マップを有効化 +of.options.shaders.NORMAL_MAP.tooltip.3= オフ - 法線マップを無効化 +of.options.shaders.NORMAL_MAP.tooltip.4=法線マップはシェーダーパックが平坦なモデルの表面における +of.options.shaders.NORMAL_MAP.tooltip.5=立体的な形状をシミュレーションするために用いられます。 +of.options.shaders.NORMAL_MAP.tooltip.6=法線マップテクスチャは現在使用中の +of.options.shaders.NORMAL_MAP.tooltip.7=リソースパックに依存します。 + +of.options.shaders.SPECULAR_MAP=鏡面反射マップ +of.options.shaders.SPECULAR_MAP.tooltip.1=鏡面反射マップ +of.options.shaders.SPECULAR_MAP.tooltip.2= オン - (初期値) 鏡面反射マップを有効化 +of.options.shaders.SPECULAR_MAP.tooltip.3= オフ - 鏡面反射マップを無効化 +of.options.shaders.SPECULAR_MAP.tooltip.4=鏡面反射マップはシェーダーパックが特殊な反射効果を +of.options.shaders.SPECULAR_MAP.tooltip.5=シミュレーションするために用いられます。 +of.options.shaders.SPECULAR_MAP.tooltip.6=法線マップテクスチャは現在使用中の +of.options.shaders.SPECULAR_MAP.tooltip.7=リソースパックに依存します。 + +of.options.shaders.RENDER_RES_MUL=描画の品質 +of.options.shaders.RENDER_RES_MUL.tooltip.1=描画の品質 +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - 低い(最低負荷) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - 標準 (初期値) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - 高い(最高負荷) +of.options.shaders.RENDER_RES_MUL.tooltip.5=描画の品質設定ではシェーダーパックに渡す +of.options.shaders.RENDER_RES_MUL.tooltip.6=テクスチャのサイズを制御します。 +of.options.shaders.RENDER_RES_MUL.tooltip.7=低い値は4Kディスプレイに有用でしょう。 +of.options.shaders.RENDER_RES_MUL.tooltip.8=高い値はアンチエイリアスをかけたかのように働きます。 + +of.options.shaders.SHADOW_RES_MUL=陰影の品質 +of.options.shaders.SHADOW_RES_MUL.tooltip.1=陰影の品質 +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - 低い(最低負荷) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - 標準 (初期値) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - 高い(最高負荷) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=陰影の品質設定ではシェーダーパックが用いる +of.options.shaders.SHADOW_RES_MUL.tooltip.6=シャドウマップテクスチャのサイズを制御します。 +of.options.shaders.SHADOW_RES_MUL.tooltip.7=低い値 = 厳格でない、荒い影。 +of.options.shaders.SHADOW_RES_MUL.tooltip.8=高い値 = 細密な、繊細な影. + +of.options.shaders.HAND_DEPTH_MUL=手部被写界深度 +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=手部被写界深度 +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - カメラに近い手 +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (初期値) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - カメラから遠い手 +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=手部被写界深度設定では手に持ったものがカメラから +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=どれだけ遠いかを制御します。 +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=シェーダーパックによるブラーは +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=手に持ったもののブラーも変更します。 + +of.options.shaders.CLOUD_SHADOW=雲の影 + +of.options.shaders.OLD_HAND_LIGHT=古い手持ち光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=古い手持ち光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= デフォルト - シェーダーパックによる制御 +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= オン - 古い手持ち光源システムを用いる +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= オフ - 新たな手持ち光源システムを用いる +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=古い手持ち光源システムはメインハンドの +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=光源アイテムしか認識できないシェーダーパックを +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=オフハンドも認識できるようにします。 + +of.options.shaders.OLD_LIGHTING=古い照明効果 +of.options.shaders.OLD_LIGHTING.tooltip.1=古い照明効果 +of.options.shaders.OLD_LIGHTING.tooltip.2= デフォルト - シェーダーパックによる制御 +of.options.shaders.OLD_LIGHTING.tooltip.3= オン - 古い照明効果を用いる +of.options.shaders.OLD_LIGHTING.tooltip.4= オフ - 古い照明効果を用いない +of.options.shaders.OLD_LIGHTING.tooltip.5=古い照明効果設定ではバニラがブロックの側面に +of.options.shaders.OLD_LIGHTING.tooltip.6=適用した明かりの描画を制御します。 +of.options.shaders.OLD_LIGHTING.tooltip.7=影を扱うシェーダーパックは多くの場合 +of.options.shaders.OLD_LIGHTING.tooltip.8=太陽の位置に基づくはるかに良い影を提供します。 + +of.options.shaders.SHADER_PACK=シェーダーパック + +of.options.shaders.shadersFolder=シェーダーのフォルダー +of.options.shaders.shaderOptions=シェーダーのオプション設定... + +of.options.shaderOptionsTitle=シェーダーのオプション設定 + +of.options.quality=品質の設定... +of.options.qualityTitle=品質 + +of.options.details=細部の設定... +of.options.detailsTitle=細部 + +of.options.performance=演出の設定... +of.options.performanceTitle=演出 + +of.options.animations=アニメーションの設定... +of.options.animationsTitle=アニメーション + +of.options.other=その他の設定... +of.options.otherTitle=その他 + +of.options.other.reset=ビデオ設定を初期化する... + +of.shaders.profile=プロファイル + +# Quality + +of.options.mipmap.bilinear=バイリニア補間 +of.options.mipmap.linear=線形補間 +of.options.mipmap.nearest=ニアレストネイバー補間 +of.options.mipmap.trilinear=トライリニア補間 + +options.mipmapLevels.tooltip.1=遠くの物体における視覚効果を +options.mipmapLevels.tooltip.2=テクスチャのスムージングによって改善します。 +options.mipmapLevels.tooltip.3= オフ - スムージングを行わない +options.mipmapLevels.tooltip.4= 1 - 最小限のスムージング +options.mipmapLevels.tooltip.5= 4 - 最大限のスムージング +options.mipmapLevels.tooltip.6=この設定は大抵の場合パフォーマンスに影響を与えません。 + +of.options.MIPMAP_TYPE=ミップマップの種類 +of.options.MIPMAP_TYPE.tooltip.1=遠くの物体における視覚効果を +of.options.MIPMAP_TYPE.tooltip.2=テクスチャのスムージングによって改善します。 +of.options.MIPMAP_TYPE.tooltip.3= ニアレストネイバー補間 - おおまかなスムージング(低負荷) +of.options.MIPMAP_TYPE.tooltip.4= 線形補間 - 通常のスムージング +of.options.MIPMAP_TYPE.tooltip.5= バイリニア補間 - 繊細なスムージング +of.options.MIPMAP_TYPE.tooltip.6= トライリニア補間 - 最高級のスムージング(高負荷) + +of.options.AA_LEVEL=アンチエイリアス +of.options.AA_LEVEL.tooltip.1=アンチエイリアス +of.options.AA_LEVEL.tooltip.2= オフ - (初期値) アンチエイリアスを行わない(低負荷) +of.options.AA_LEVEL.tooltip.3= 2~16 - アンチエイリアスされた輪郭(高負荷) +of.options.AA_LEVEL.tooltip.4=アンチエイリアスは輪郭のギザギザや +of.options.AA_LEVEL.tooltip.5=シャープな色の変化を滑らかにします。 +of.options.AA_LEVEL.tooltip.6=有効化すると実質的なFPSは下がります。 +of.options.AA_LEVEL.tooltip.7=すべてのレベルがすべてのグラフィックカードでサポートされているわけではありません。 +of.options.AA_LEVEL.tooltip.8=有効化は再起動後です! + +of.options.AF_LEVEL=異方性フィルタリング +of.options.AF_LEVEL.tooltip.1=異方性フィルタリング +of.options.AF_LEVEL.tooltip.2= オフ - 通常のテクスチャ描画(低負荷) +of.options.AF_LEVEL.tooltip.3= 2~16 - 滑らかなテクスチャ描画(高負荷) +of.options.AF_LEVEL.tooltip.4=ミップマップされたテクスチャにおいて、 +of.options.AF_LEVEL.tooltip.5=ちらつきを抑えます。 +of.options.AF_LEVEL.tooltip.6=有効化すると実質的にFPSは下がります。 + +of.options.CLEAR_WATER=水の透過 +of.options.CLEAR_WATER.tooltip.1=水の透過 +of.options.CLEAR_WATER.tooltip.2= オン - すっきりとした透明な水 +of.options.CLEAR_WATER.tooltip.3= オフ - 普通の水 + +of.options.RANDOM_MOBS=Random Mobs +of.options.RANDOM_MOBS.tooltip.1=Random Mobs +of.options.RANDOM_MOBS.tooltip.2= オフ - Mobにランダムなテクスチャを適応しない 低負荷 +of.options.RANDOM_MOBS.tooltip.3= オン - Mobにランダムなテクスチャを適応する 高負荷 +of.options.RANDOM_MOBS.tooltip.4=Random mobsはランダムなテクスチャを生物に適用します。 +of.options.RANDOM_MOBS.tooltip.5=複数のMobテクスチャを含むリソースパックが必要です。 + +of.options.BETTER_GRASS=より良い芝生 +of.options.BETTER_GRASS.tooltip.1=より良い芝生 +of.options.BETTER_GRASS.tooltip.2= オフ - 通常の側面のテクスチャを用いる 低負荷 +of.options.BETTER_GRASS.tooltip.3= 処理優先 - 側面も草で覆う 高負荷 +of.options.BETTER_GRASS.tooltip.4= 描画優先 - 草ブロックと繋がるように側面を草で覆う 最高負荷 + +of.options.BETTER_SNOW=より良い雪 +of.options.BETTER_SNOW.tooltip.1=より良い雪 +of.options.BETTER_SNOW.tooltip.2= オフ - 通常の雪 低負荷 +of.options.BETTER_SNOW.tooltip.3= オン - より良い雪 高負荷 +of.options.BETTER_SNOW.tooltip.4=隣接したブロックに雪が積もっているものがあった時に +of.options.BETTER_SNOW.tooltip.5=透過性のあるブロック(フェンス, 背の高い草)の下でも雪を描画します。 + +of.options.CUSTOM_FONTS=カスタムフォント +of.options.CUSTOM_FONTS.tooltip.1=カスタムフォント +of.options.CUSTOM_FONTS.tooltip.2= オン - カスタムフォントを使う(初期値) 高負荷 +of.options.CUSTOM_FONTS.tooltip.3= オフ - デフォルトのフォントを使う 低負荷 +of.options.CUSTOM_FONTS.tooltip.4=カスタムフォントは現在使用中の +of.options.CUSTOM_FONTS.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_COLORS=カスタムカラー +of.options.CUSTOM_COLORS.tooltip.1=カスタムカラー +of.options.CUSTOM_COLORS.tooltip.2= オン - カスタムカラーを使う(初期値) 高負荷 +of.options.CUSTOM_COLORS.tooltip.3= オフ - デフォルトの色を使う 低負荷 +of.options.CUSTOM_COLORS.tooltip.4=カスタムカラーは現在使用中の +of.options.CUSTOM_COLORS.tooltip.5=リソースパックに依存します。 + +of.options.SWAMP_COLORS=湿地帯色 +of.options.SWAMP_COLORS.tooltip.1=湿地帯色 +of.options.SWAMP_COLORS.tooltip.2= オン - 湿地帯色を使う 高負荷 +of.options.SWAMP_COLORS.tooltip.3= オフ - 湿地帯色を使わない 低負荷 +of.options.SWAMP_COLORS.tooltip.4=湿地帯色は草,葉,蔦,水に影響を与えます。 + +of.options.SMOOTH_BIOMES=バイオームを滑らかに表示 +of.options.SMOOTH_BIOMES.tooltip.1=バイオームを滑らかに表示 +of.options.SMOOTH_BIOMES.tooltip.2= オン - バイオームの境界を滑らかにする(初期値) 高負荷 +of.options.SMOOTH_BIOMES.tooltip.3= オフ - バイオームの境界を滑らかにしない 低負荷 +of.options.SMOOTH_BIOMES.tooltip.4=周囲の色の平均をとって +of.options.SMOOTH_BIOMES.tooltip.5=バイオーム間の境界を滑らかにします。 +of.options.SMOOTH_BIOMES.tooltip.6=草,葉,蔦,水に影響を与えます。 + +of.options.CONNECTED_TEXTURES=継ぎ目ないテクスチャ +of.options.CONNECTED_TEXTURES.tooltip.1=継ぎ目ないテクスチャ +of.options.CONNECTED_TEXTURES.tooltip.2= オフ - テクスチャの継ぎ目をなくさない(初期値) +of.options.CONNECTED_TEXTURES.tooltip.3= 処理優先 - 処理優先でテクスチャの継ぎ目をなくす +of.options.CONNECTED_TEXTURES.tooltip.4= 描画優先 - 描画優先でテクスチャの継ぎ目をなくす +of.options.CONNECTED_TEXTURES.tooltip.5=草、砂岩、本棚で隣り合ったものを +of.options.CONNECTED_TEXTURES.tooltip.6=つなぎあわせて表示します。 +of.options.CONNECTED_TEXTURES.tooltip.7=つながった状態のテクスチャは現在使用中の +of.options.CONNECTED_TEXTURES.tooltip.8=リソースパックに依存します。 + +of.options.NATURAL_TEXTURES=自然なテクスチャ +of.options.NATURAL_TEXTURES.tooltip.1=自然なテクスチャ +of.options.NATURAL_TEXTURES.tooltip.2= オフ - 自然なテクスチャを用いない(初期値) +of.options.NATURAL_TEXTURES.tooltip.3= オン - 自然なテクスチャを用いる +of.options.NATURAL_TEXTURES.tooltip.4=ブロックのテクスチャが同じ形を繰り返し、 +of.options.NATURAL_TEXTURES.tooltip.5=格子状の模様が形成される現象を除去します。 +of.options.NATURAL_TEXTURES.tooltip.6=基となるブロックのテクスチャを回転したり裏返したり +of.options.NATURAL_TEXTURES.tooltip.7=するのに用いられます。自然なテクスチャの設定は +of.options.NATURAL_TEXTURES.tooltip.8=現在使用中のリソースパックに依存します。 + +of.options.EMISSIVE_TEXTURES=発光効果テクスチャ +of.options.EMISSIVE_TEXTURES.tooltip.1=発光効果テクスチャ +of.options.EMISSIVE_TEXTURES.tooltip.2= オフ - 発光効果テクスチャを用いない(初期値) +of.options.EMISSIVE_TEXTURES.tooltip.3= オン - 発光効果テクスチャを用いる +of.options.EMISSIVE_TEXTURES.tooltip.4=発光効果テクスチャは最大の明るさを持ったオーバーレイとして +of.options.EMISSIVE_TEXTURES.tooltip.5=描画されます。また、基となるテクスチャの +of.options.EMISSIVE_TEXTURES.tooltip.6=発光部分のシミュレーションにも用いられます。 +of.options.EMISSIVE_TEXTURES.tooltip.7=発光効果テクスチャは現在使用中の +of.options.EMISSIVE_TEXTURES.tooltip.8=リソースパックに依存します。 + +of.options.CUSTOM_SKY=カスタムスカイ +of.options.CUSTOM_SKY.tooltip.1=カスタムスカイ +of.options.CUSTOM_SKY.tooltip.2= オン - カスタムスカイを用いる(初期値) 高負荷 +of.options.CUSTOM_SKY.tooltip.3= オフ - 通常の空 低負荷 +of.options.CUSTOM_SKY.tooltip.4=カスタムスカイ用のテクスチャは現在使用中の +of.options.CUSTOM_SKY.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_ITEMS=カスタムアイテム +of.options.CUSTOM_ITEMS.tooltip.1=カスタムアイテム +of.options.CUSTOM_ITEMS.tooltip.2= オン - カスタムアイテムを用いる(初期値) 高負荷 +of.options.CUSTOM_ITEMS.tooltip.3= オフ - 通常のアイテムテクスチャを用いる 低負荷 +of.options.CUSTOM_ITEMS.tooltip.4=カスタムアイテム用のテクスチャは現在使用中の +of.options.CUSTOM_ITEMS.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_ENTITY_MODELS=カスタムエンティティモデル +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=カスタムエンティティモデル +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= オン - カスタムエンティティモデルを用いる(初期値), 高負荷 +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= オフ - 通常のエンティティモデル, 低負荷 +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=カスタムエンティティモデルは現在使用中の +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=リソースパックに依存します。 + +of.options.CUSTOM_GUIS=カスタムGUI +of.options.CUSTOM_GUIS.tooltip.1=カスタムGUI +of.options.CUSTOM_GUIS.tooltip.2= オン - カスタムGUI(初期値),高負荷 +of.options.CUSTOM_GUIS.tooltip.3= オフ - 通常のGUI,低負荷 +of.options.CUSTOM_GUIS.tooltip.4=カスタムGUIは現在使用中のリソースパックに依存します。 + +# Details + +of.options.CLOUDS=雲 +of.options.CLOUDS.tooltip.1=雲 +of.options.CLOUDS.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.CLOUDS.tooltip.3= 処理優先 - 低品質 低負荷 +of.options.CLOUDS.tooltip.4= 描画優先 - 高品質 高負荷 +of.options.CLOUDS.tooltip.5= オフ - 雲なし 最低負荷 +of.options.CLOUDS.tooltip.6=処理優先の雲は平面的に描画されます。 +of.options.CLOUDS.tooltip.7=描画優先の雲は立体的に描画されます。 + +of.options.CLOUD_HEIGHT=雲の高さ +of.options.CLOUD_HEIGHT.tooltip.1=雲の高さの設定 +of.options.CLOUD_HEIGHT.tooltip.2= オフ - 通常の高さ +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - ワールドの高さ上限 + +of.options.TREES=樹 +of.options.TREES.tooltip.1=樹 +of.options.TREES.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.TREES.tooltip.3= 処理優先 - 低品質 最低負荷 +of.options.TREES.tooltip.4= スマート - 高品質 低負荷 +of.options.TREES.tooltip.5= 描画優先 - 高品質 高負荷 +of.options.TREES.tooltip.6=処理優先の木の葉は透過しません。 +of.options.TREES.tooltip.7=描画優先や賢く描画された木の葉は透過します。 + +of.options.RAIN=雨と雪 +of.options.RAIN.tooltip.1=雨と雪 +of.options.RAIN.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.RAIN.tooltip.3= 処理優先 - 小雨/小雪 低負荷 +of.options.RAIN.tooltip.4= 描画優先 - 大雨/大雪 高負荷 +of.options.RAIN.tooltip.5= オフ - 雨や雪を描画しない 最低負荷 +of.options.RAIN.tooltip.6=オフにしても地面での雨の飛び散りや雨音 +of.options.RAIN.tooltip.7=は有効のままです。 + +of.options.SKY=空 +of.options.SKY.tooltip.1=空 +of.options.SKY.tooltip.2= オン - 空を描画する 高負荷 +of.options.SKY.tooltip.3= オフ - 空を描画しない 低負荷 +of.options.SKY.tooltip.4=オフにしても太陽や月はそのままです。 + +of.options.STARS=星 +of.options.STARS.tooltip.1=星 +of.options.STARS.tooltip.2= オン - 星を描画する(初期値) +of.options.STARS.tooltip.3= オフ - 星を描画しない(低負荷) +of.options.SUN_MOON=太陽と月 +of.options.SUN_MOON.tooltip.1=太陽と月 +of.options.SUN_MOON.tooltip.2= オン - 太陽と月を描画する(初期値) +of.options.SUN_MOON.tooltip.3= オフ - 太陽と月を描画しない(低負荷) +of.options.SHOW_CAPES=Optifineマントの表示 +of.options.SHOW_CAPES.tooltip.1=Optifineマントの表示 +of.options.SHOW_CAPES.tooltip.2= オン - Optifineマントを表示する(初期値) +of.options.SHOW_CAPES.tooltip.3= オフ - Optifineマントを表示しない + +of.options.TRANSLUCENT_BLOCKS=半透明のブロック +of.options.TRANSLUCENT_BLOCKS.tooltip.1=半透明のブロック +of.options.TRANSLUCENT_BLOCKS.tooltip.2= 描画優先 - 完全なカラーブレンド(初期値) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 処理優先 - 速さ重視のカラーブレンド(低負荷) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=違う色を持った半透明ブロック(色付きガラス,水,氷) +of.options.TRANSLUCENT_BLOCKS.tooltip.5=が空気を挟んで隣接した際の +of.options.TRANSLUCENT_BLOCKS.tooltip.6=カラーブレンドの設定です。 + +of.options.HELD_ITEM_TOOLTIPS=持ち替え時アイテム名表示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=持ち替え時アイテム名表示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= オン - 持ち替え時にアイテム名を表示する(初期値) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= オフ - 持ち替え時にアイテム名を表示しない + +of.options.ADVANCED_TOOLTIPS=高度なツールチップ +of.options.ADVANCED_TOOLTIPS.tooltip.1=高度なツールチップ +of.options.ADVANCED_TOOLTIPS.tooltip.2= オン - 高度なツールチップを表示 +of.options.ADVANCED_TOOLTIPS.tooltip.3= オフ - 高度なツールチップを非表示(初期値) +of.options.ADVANCED_TOOLTIPS.tooltip.4=高度なツールチップはアイテム(ID,耐久値)と +of.options.ADVANCED_TOOLTIPS.tooltip.5=シェーダーのオプション(ID,source,default value)において +of.options.ADVANCED_TOOLTIPS.tooltip.6=拡張された情報を表示します。 + +of.options.DROPPED_ITEMS=落ちているアイテムの表示 +of.options.DROPPED_ITEMS.tooltip.1=落ちているアイテムの表示 +of.options.DROPPED_ITEMS.tooltip.2= デフォルト - グラフィックスの設定に合わせる +of.options.DROPPED_ITEMS.tooltip.3= 処理優先 - 落ちているアイテムを2Dで表示する 低負荷 +of.options.DROPPED_ITEMS.tooltip.4= 描画優先 - 落ちているアイテムを3Dで表示する 高負荷 + +options.entityShadows.tooltip.1=Entityの影 +options.entityShadows.tooltip.2= オン - Entityの影を表示する +options.entityShadows.tooltip.3= オフ - Entityの影を表示しない + +of.options.VIGNETTE=視界端の影 +of.options.VIGNETTE.tooltip.1=スクリーンの角を少し暗くさせる視覚効果 +of.options.VIGNETTE.tooltip.2= デフォルト - グラフィックスの設定に合わせる(初期値) +of.options.VIGNETTE.tooltip.3= 処理優先 - 視界端の影を表示しない(低負荷) +of.options.VIGNETTE.tooltip.4= 描画優先 - 視界端の影を表示する(高負荷) +of.options.VIGNETTE.tooltip.5=視界端の影はFPSにとって重要な視覚効果です。 +of.options.VIGNETTE.tooltip.6=例外としてフルスクリーンで遊ぶ際には、 +of.options.VIGNETTE.tooltip.7=視界端の影は非常に微かであるため、 +of.options.VIGNETTE.tooltip.8=無効にしても無害です。 + +of.options.DYNAMIC_FOV=臨場感ある視野角 +of.options.DYNAMIC_FOV.tooltip.1=臨場感ある視野角 +of.options.DYNAMIC_FOV.tooltip.2= オン - 臨場感ある視野角を有効化(初期値) +of.options.DYNAMIC_FOV.tooltip.3= オフ - 臨場感ある視野角を無効化 +of.options.DYNAMIC_FOV.tooltip.4=飛翔時や、ダッシュ時、弓の引き絞り時に、 +of.options.DYNAMIC_FOV.tooltip.5=視野角(FOV)を変えます。 + +of.options.DYNAMIC_LIGHTS=臨場感ある光源 +of.options.DYNAMIC_LIGHTS.tooltip.1=臨場感ある光源 +of.options.DYNAMIC_LIGHTS.tooltip.2= オフ - 持っている光源を光らせない(初期値) +of.options.DYNAMIC_LIGHTS.tooltip.3= 処理優先 - 500ミリ秒ごとに位置を更新する +of.options.DYNAMIC_LIGHTS.tooltip.4= 描画優先 - リアルタイムに位置を更新する +of.options.DYNAMIC_LIGHTS.tooltip.5=光源となるアイテム(松明、グローストーンなど)について、 +of.options.DYNAMIC_LIGHTS.tooltip.6=手に持っているか、他のプレイヤーが装備しているか、 +of.options.DYNAMIC_LIGHTS.tooltip.7=地上に投げ出されている時に、周囲を照らします。 + +# Performance + +of.options.SMOOTH_FPS=FPS安定化処理 +of.options.SMOOTH_FPS.tooltip.1=バッファを使ってFPSを安定化する。 +of.options.SMOOTH_FPS.tooltip.2= オフ - 安定化しない。FPSは変動的になるでしょう。 +of.options.SMOOTH_FPS.tooltip.3= オン - 安定化する。 +of.options.SMOOTH_FPS.tooltip.4=この設定はグラフィックドライバーに依存し、 +of.options.SMOOTH_FPS.tooltip.5=常には有効ではありません。 + +of.options.SMOOTH_WORLD=サーバー負荷を分散 +of.options.SMOOTH_WORLD.tooltip.1=内部サーバーによるラグの除去。 +of.options.SMOOTH_WORLD.tooltip.2= オフ - 安定化しない。FPSは変動的になるでしょう。 +of.options.SMOOTH_WORLD.tooltip.3= オン - 安定化する。 +of.options.SMOOTH_WORLD.tooltip.4=内部サーバーロードを安定化。 +of.options.SMOOTH_WORLD.tooltip.5=シングルプレイの時のみ効果があります。 + +of.options.FAST_RENDER=描画の最適化 +of.options.FAST_RENDER.tooltip.1=描画の最適化 +of.options.FAST_RENDER.tooltip.2= オフ - 通常の描画(初期値) +of.options.FAST_RENDER.tooltip.3= オン - 最適化された描画(低負荷) +of.options.FAST_RENDER.tooltip.4=GPUのロード回数を減らした方式によって +of.options.FAST_RENDER.tooltip.5=実質的なFPSを向上します。 + +of.options.FAST_MATH=計算の最適化 +of.options.FAST_MATH.tooltip.1=計算の最適化 +of.options.FAST_MATH.tooltip.2= オフ - 通常の処理(初期値) +of.options.FAST_MATH.tooltip.3= オン - 最適化された計算方式 +of.options.FAST_MATH.tooltip.4=CPUのキャッシュをうまく使った +of.options.FAST_MATH.tooltip.5=FPSを向上させる計算処理を使用します。 + +of.options.CHUNK_UPDATES=チャンク読込方法 +of.options.CHUNK_UPDATES.tooltip.1=チャンク読込方法 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 高負荷なチャンク読み込み 高いFPS(初期値) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 低負荷めなチャンク読み込み 低めのFPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - 低負荷なチャンク読み込み 低いFPS +of.options.CHUNK_UPDATES.tooltip.5=1フレームごとに行われるチャンク読み込み回数を指定します。 +of.options.CHUNK_UPDATES.tooltip.6=高い値はフレームレートの非安定化を招きます。 + +of.options.CHUNK_UPDATES_DYNAMIC=動的な読み込み +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=動的な読み込み +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= オフ - (初期値) 1フレームに通常の回数のチャンク読み込み処理 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= オン - 静止中により多くのアップデート処理を行う。 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=プレイヤーが静止している時に +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=素早くチャンク読み込むようになります。 + +of.options.LAZY_CHUNK_LOADING=チャンク読み込みの遅延 +of.options.LAZY_CHUNK_LOADING.tooltip.1=チャンク読み込みの遅延 +of.options.LAZY_CHUNK_LOADING.tooltip.2= オフ - 通常のサーバーチャンク読み込み +of.options.LAZY_CHUNK_LOADING.tooltip.3= オン - 遅延サーバーチャンク読み込み(滑らか) +of.options.LAZY_CHUNK_LOADING.tooltip.4=チャンク読み込み処理を数Tickに分散させることで +of.options.LAZY_CHUNK_LOADING.tooltip.5=総合的にサーバーのチャンク読み込み処理を滑らかにします。 +of.options.LAZY_CHUNK_LOADING.tooltip.6=ワールドの一部に欠けが発生するようならOFFにしてください。 +of.options.LAZY_CHUNK_LOADING.tooltip.7=ローカルワールド(シングルプレイヤー)の時のみ有効です。 + +# Animations + +of.options.animation.allOn=全てオン +of.options.animation.allOff=全てオフ +of.options.animation.dynamic=動的 + +of.options.ANIMATED_WATER=水 +of.options.ANIMATED_LAVA=溶岩 +of.options.ANIMATED_FIRE=炎 +of.options.ANIMATED_PORTAL=ネザーゲート +of.options.ANIMATED_REDSTONE=レッドストーン +of.options.ANIMATED_EXPLOSION=爆発 +of.options.ANIMATED_FLAME=松明やかまど +of.options.ANIMATED_SMOKE=煙 +of.options.VOID_PARTICLES=奈落のパーティクル +of.options.WATER_PARTICLES=水中のパーティクル +of.options.RAIN_SPLASH=雨の水しぶき +of.options.PORTAL_PARTICLES=ポータルのパーティクル +of.options.POTION_PARTICLES=ポーションのパーティクル +of.options.DRIPPING_WATER_LAVA=水/溶岩の滴り +of.options.ANIMATED_TERRAIN=地形アニメーション +of.options.ANIMATED_TEXTURES=テクスチャアニメーション +of.options.FIREWORK_PARTICLES=花火のパーティクル + +# Other + +of.options.LAGOMETER=ラグメーター +of.options.LAGOMETER.tooltip.1=デバッグ画面(F3)にラグメーターを表示する。 +of.options.LAGOMETER.tooltip.2=* 橙 - ガベージコレクション +of.options.LAGOMETER.tooltip.3=* 藍 - Tick処理 +of.options.LAGOMETER.tooltip.4=* 青 - スケジューリングされた処理 +of.options.LAGOMETER.tooltip.5=* 紫 - チャンクアップローディング +of.options.LAGOMETER.tooltip.6=* 赤 - チャンクアップデート +of.options.LAGOMETER.tooltip.7=* 黄 - 描画確認 +of.options.LAGOMETER.tooltip.8=* 緑 - 地形描画 + +of.options.PROFILER=デバッグプロファイラ +of.options.PROFILER.tooltip.1=デバッグプロファイラ +of.options.PROFILER.tooltip.2= オン - デバッグプロファイラは有効 高負荷 +of.options.PROFILER.tooltip.3= オフ - デバッグプロファイラは無効 低負荷 +of.options.PROFILER.tooltip.4=デバッグ画面(F3)が開かれている時に +of.options.PROFILER.tooltip.5=デバッグ情報を収集し円グラフ上に表示します。 + +of.options.WEATHER=天候 +of.options.WEATHER.tooltip.1=天候 +of.options.WEATHER.tooltip.2= オン - 天候あり 高負荷 +of.options.WEATHER.tooltip.3= オフ - 天候なし 低負荷 +of.options.WEATHER.tooltip.4=天候コントロール機能の有効/無効。 +of.options.WEATHER.tooltip.5=シングルプレイでのみ有効。 + +of.options.time.dayOnly=昼のみ +of.options.time.nightOnly=夜のみ + +of.options.TIME=クリエイティブの時刻 +of.options.TIME.tooltip.1=クリエイティブの時刻 +of.options.TIME.tooltip.2= デフォルト - 通常の昼夜サイクル +of.options.TIME.tooltip.3= 昼のみ - 昼のみ +of.options.TIME.tooltip.4= 夜のみ - 夜のみ +of.options.TIME.tooltip.5=クリエイティブモードで +of.options.TIME.tooltip.6=シングルプレイの時のみ有効。 + +options.fullscreen.tooltip.1=フルスクリーン +options.fullscreen.tooltip.2= オン - フルスクリーンモード +options.fullscreen.tooltip.3= オフ - ウィンドウモード +options.fullscreen.tooltip.4=フルスクリーンではグラフィックカードによって +options.fullscreen.tooltip.5=処理の速い遅いが変わります。 + +of.options.FULLSCREEN_MODE=フルスクリーンの種類 +of.options.FULLSCREEN_MODE.tooltip.1=フルスクリーンの種類 +of.options.FULLSCREEN_MODE.tooltip.2= デフォルト - デスクトップスクリーンの解像度 高負荷 +of.options.FULLSCREEN_MODE.tooltip.3= WxH - カスタム解像度 おそらく低負荷 +of.options.FULLSCREEN_MODE.tooltip.4=フルスクリーンモードにて使用される解像度です。 +of.options.FULLSCREEN_MODE.tooltip.5=一般的に、低い解像度は速い処理に繋がります。 + +of.options.SHOW_FPS=FPSを表示 +of.options.SHOW_FPS.tooltip.1=コンパクトなFPSと描画情報を表示 +of.options.SHOW_FPS.tooltip.2= C: - チャンク描画 +of.options.SHOW_FPS.tooltip.3= E: - エンティティ描画 +of.options.SHOW_FPS.tooltip.4= U: - チャンクアップデート +of.options.SHOW_FPS.tooltip.5=コンパクトなFPS情報は +of.options.SHOW_FPS.tooltip.6=デバッグ画面が非表示の時のみ表示されます。 + +of.options.save.default=デフォルト(2秒) +of.options.save.20s=20秒 +of.options.save.3min=3分 +of.options.save.30min=30分 + +of.options.AUTOSAVE_TICKS=オートセーブ +of.options.AUTOSAVE_TICKS.tooltip.1=セーブ間隔 +of.options.AUTOSAVE_TICKS.tooltip.2=2秒ごとのセーブは推奨されません。 +of.options.AUTOSAVE_TICKS.tooltip.3=オートセーブはラグを引き起こします。 + +of.options.SCREENSHOT_SIZE=スクリーンショットのサイズ +of.options.SCREENSHOT_SIZE.tooltip.1=スクリーンショットのサイズ +of.options.SCREENSHOT_SIZE.tooltip.2= デフォルト - 通常の大きさ +of.options.SCREENSHOT_SIZE.tooltip.3= 2x~4x - 任意の大きさ +of.options.SCREENSHOT_SIZE.tooltip.4=より大きなスクリーンショットの撮影には、より多くのメモリが必要です。 +of.options.SCREENSHOT_SIZE.tooltip.5=描画の最適化、アンチエイリアスとは競合します。 +of.options.SCREENSHOT_SIZE.tooltip.6=GPUがフレームバッファをサポートしている必要があります。 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ko_KR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ko_KR.lang new file mode 100644 index 0000000..168d6e9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ko_KR.lang @@ -0,0 +1,591 @@ +# Contributors of Korean localization # +# auth ---- 2017-06-09 ---- 2017-06-24 +# Final Child ---- 2017-06-09 ---- 2017-06-24 +# SRA PLY ---- 2017-06-09 ---- 2017-06-24 + +# General +of.general.ambiguous=불분명 +of.general.custom=맞춤 +of.general.from=출처 +of.general.id=아이디 +of.general.restart=재시작 +of.general.smart=멋지게 + +# Keys +of.key.zoom=확대 + +# Message +of.message.aa.shaders1=안티에일리어싱은 셰이더와 호환되지 않습니다. +of.message.aa.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.af.shaders1=비등방성 필터링은 셰이더와 호환되지 않습니다. +of.message.af.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.fr.shaders1=빠른 렌더는 셰이더와 호환되지 않습니다. +of.message.fr.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.an.shaders1=3D 애너글리프는 셰이더와 호환되지 않습니다. +of.message.an.shaders2=이 설정을 켜려면 먼저 셰이더를 꺼주십시오. + +of.message.shaders.aa1=셰이더는 안티에일리어싱과 호환되지 않습니다. +of.message.shaders.aa2=품질 > 안티에일리어싱을 꺼짐으로 설정한 후 게임을 다시 시작해 주십시오. + +of.message.shaders.af1=셰이더는 비등방성 필터링과 호환되지 않습니다. +of.message.shaders.af2=품질 > 비등방성 필터링을 꺼짐으로 설정해 주십시오. + +of.message.shaders.fr1=셰이더는 빠른 렌더와 호환되지 않습니다. +of.message.shaders.fr2=성능 > 빠른 렌더를 꺼짐으로 설정해 주십시오. + +of.message.shaders.an1=셰이더는 3D 애너글리프와 호환되지 않습니다. +of.message.shaders.an2=기타 > 3D 애너글리프를 꺼짐으로 설정해 주십시오. + +of.message.newVersion=새로운 §eOptiFine§f 버전을 사용할 수 있습니다: §e%s§f +of.message.java64Bit=§e64비트 Java§f를 설치해 성능을 향상할 수 있습니다. +of.message.openglError=§eOpenGL 오류§f: %s (%s) + +of.message.shaders.loading=셰이더 불러오는 중: %s + +of.message.other.reset=모든 비디오 설정을 기본값으로 재설정하시겠습니까? + +of.message.loadingVisibleChunks=보이는 청크 불러오는 중 + +# Video settings + +options.graphics.tooltip.1=시각 품질 +options.graphics.tooltip.2= 빠르게 - 낮은 품질, 빠름 +options.graphics.tooltip.3= 화려하게 - 높은 품질, 느림 +options.graphics.tooltip.4=구름, 잎, 물, 그림자, 풀의 +options.graphics.tooltip.5=외형을 변경합니다. + +of.options.renderDistance.tiny=아주 작게 +of.options.renderDistance.short=짧게 +of.options.renderDistance.normal=보통 +of.options.renderDistance.far=멀리 +of.options.renderDistance.extreme=극도 + +options.renderDistance.tooltip.1=시야 거리 +options.renderDistance.tooltip.2= 2 아주 작게 - 32m (가장 빠름) +options.renderDistance.tooltip.3= 4 짧게 - 64m (빠름) +options.renderDistance.tooltip.4= 8 보통 - 128m +options.renderDistance.tooltip.5= 16 멀리 - 256m (느림) +options.renderDistance.tooltip.6= 32 극도 - 512m (가장 느림!) +options.renderDistance.tooltip.7=극도 시야 거리는 상당한 성능이 요구됩니다! +options.renderDistance.tooltip.8=16 멀리를 넘는 값은 로컬 세계에서만 효과가 있습니다. + +options.ao.tooltip.1=부드러운 조명 효과 +options.ao.tooltip.2= 꺼짐 - 부드러운 조명 효과 없음 (빠름) +options.ao.tooltip.3= 최소 - 간단한 부드러운 조명 효과 (느림) +options.ao.tooltip.4= 최대 - 복잡한 부드러운 조명 효과 (가장 느림) + +options.framerateLimit.tooltip.1=최대 프레임률 +options.framerateLimit.tooltip.2= VSync - 모니터 프레임률로 제한 (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - 조절 가능 +options.framerateLimit.tooltip.4= 무제한 - 제한 없음 (가장 빠름) +options.framerateLimit.tooltip.5=프레임률 제한은 제한 값에 도달하지 않았을 때도 +options.framerateLimit.tooltip.6=FPS를 감소시킵니다. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=부드러운 조명 효과 레벨 +of.options.AO_LEVEL.tooltip.1=부드러운 조명 효과 레벨 +of.options.AO_LEVEL.tooltip.2= 꺼짐 - 그림자 없음 +of.options.AO_LEVEL.tooltip.3= 50%% - 옅은 그림자 +of.options.AO_LEVEL.tooltip.4= 100%% - 짙은 그림자 + +options.viewBobbing.tooltip.1=더 사실적인 움직임. +options.viewBobbing.tooltip.2=밉맵을 사용할 때 최상의 결과를 위해 밉맵을 꺼짐으로 설정하십시오. + +options.guiScale.tooltip.1=GUI 크기 +options.guiScale.tooltip.2= 자동 - 최대 크기 +options.guiScale.tooltip.3= 작게, 보통, 크게 - 1x에서 3x까지 +options.guiScale.tooltip.4= 4x에서 10x까지 - 4K 디스플레이에서 사용 가능 +options.guiScale.tooltip.5=홀수 값(1x, 3x, 5x ...)은 유니코드와 호환되지 않습니다. +options.guiScale.tooltip.6=작은 GUI가 빠를 수 있습니다. + +options.vbo.tooltip.1=정점 버퍼 객체 +options.vbo.tooltip.2=기본 렌더링보다 보통 빠른 (5-10%%) +options.vbo.tooltip.3=다른 렌더링 모델을 사용합니다. + +options.gamma.tooltip.1=어두운 물체의 밝기를 바꿉니다. +options.gamma.tooltip.2= 어둡게 - 표준 밝기 +options.gamma.tooltip.3= 1-99%% - 조절 가능 +options.gamma.tooltip.4= 밝게 - 어두운 물체를 최대 밝기로 +options.gamma.tooltip.5=이 설정은 완전히 검은 물체의 밝기를 +options.gamma.tooltip.6=변경하지는 않습니다. + +options.anaglyph.tooltip.1=3D 애너글리프 +options.anaglyph.tooltip.2=양쪽 눈에 다른 색상을 사용함으로써 +options.anaglyph.tooltip.3=입체적인 3D 효과를 낼 수 있습니다. +options.anaglyph.tooltip.4=올바르게 보기 위해서는 적청 안경이 필요합니다. + +of.options.ALTERNATE_BLOCKS=대체 블록 +of.options.ALTERNATE_BLOCKS.tooltip.1=대체 블록 +of.options.ALTERNATE_BLOCKS.tooltip.2=몇몇 블록에 대체 블록 모델을 사용합니다. +of.options.ALTERNATE_BLOCKS.tooltip.3=선택한 리소스 팩에 따라 달라집니다. + +of.options.FOG_FANCY=안개 +of.options.FOG_FANCY.tooltip.1=안개 유형 +of.options.FOG_FANCY.tooltip.2= 빠르게 - 빠른 안개 +of.options.FOG_FANCY.tooltip.3= 화려하게 - 느린 안개, 좋아 보임 +of.options.FOG_FANCY.tooltip.4= 꺼짐 - 안개 없음, 가장 빠름 +of.options.FOG_FANCY.tooltip.5=화려한 안개는 지원되는 그래픽 카드에서만 +of.options.FOG_FANCY.tooltip.6=사용할 수 있습니다. + +of.options.FOG_START=안개 시작 +of.options.FOG_START.tooltip.1=안개 시작 +of.options.FOG_START.tooltip.2= 0.2 - 안개가 플레이어 가까이에서 시작함 +of.options.FOG_START.tooltip.3= 0.8 - 안개가 플레이어에서 멀리 떨어진 곳부터 시작함 +of.options.FOG_START.tooltip.4=이 설정은 보통 성능에 영향을 주지 않습니다. + +of.options.CHUNK_LOADING=청크 불러오기 +of.options.CHUNK_LOADING.tooltip.1=청크 불러오기 +of.options.CHUNK_LOADING.tooltip.2= 기본 - 청크를 불러올 때 불안정한 FPS +of.options.CHUNK_LOADING.tooltip.3= 부드럽게 - 안정적인 FPS +of.options.CHUNK_LOADING.tooltip.4= 멀티코어 - 안정적인 FPS, 3배 빠른 세계 불러오기 +of.options.CHUNK_LOADING.tooltip.5=부드럽게와 멀티코어는 청크를 불러오는 중 발생하는 +of.options.CHUNK_LOADING.tooltip.6=버벅거림 및 멈춤 현상을 제거합니다. +of.options.CHUNK_LOADING.tooltip.7=멀티코어는 두 번째 CPU를 사용하여 +of.options.CHUNK_LOADING.tooltip.8=3배 빠르게 세계를 불러오고 FPS를 늘릴 수 있습니다. +of.options.chunkLoading.smooth=부드럽게 +of.options.chunkLoading.multiCore=멀티코어 + +of.options.shaders=셰이더... +of.options.shadersTitle=셰이더 + +of.options.shaders.packNone=꺼짐 +of.options.shaders.packDefault=(내부) + +of.options.shaders.ANTIALIASING=안티에일리어싱 +of.options.shaders.NORMAL_MAP=법선 맵 +of.options.shaders.SPECULAR_MAP=반사 맵 +of.options.shaders.RENDER_RES_MUL=렌더 품질 +of.options.shaders.SHADOW_RES_MUL=그림자 품질 +of.options.shaders.HAND_DEPTH_MUL=손 깊이 +of.options.shaders.CLOUD_SHADOW=구름 그림자 +of.options.shaders.OLD_HAND_LIGHT=구 손 조명 +of.options.shaders.OLD_LIGHTING=구 조명 +of.options.shaders.SHADER_PACK=셰이더 팩 + +of.options.shaders.shadersFolder=셰이더 폴더 +of.options.shaders.shaderOptions=셰이더 설정... + +of.options.shaderOptionsTitle=셰이더 설정 + +of.options.quality=품질... +of.options.qualityTitle=품질 설정 + +of.options.details=세부... +of.options.detailsTitle=세부 설정 + +of.options.performance=성능... +of.options.performanceTitle=성능 설정 + +of.options.animations=애니메이션... +of.options.animationsTitle=애니메이션 설정 + +of.options.other=기타... +of.options.otherTitle=기타 설정 + +of.options.other.reset=비디오 설정 초기화... + +of.shaders.profile=프로필 + +# Quality + +of.options.mipmap.bilinear=쌍선형 +of.options.mipmap.linear=선형 +of.options.mipmap.nearest=가장 가까움 +of.options.mipmap.trilinear=삼선형 + +options.mipmapLevels.tooltip.1=세부 텍스처를 부드럽게 해 +options.mipmapLevels.tooltip.2=멀리 있는 물체를 더 좋아 보이게 하는 시각 효과입니다. +options.mipmapLevels.tooltip.3= 꺼짐 - 부드러움 효과 없음 +options.mipmapLevels.tooltip.4= 1 - 최소 부드러움 효과 +options.mipmapLevels.tooltip.5= 4 - 최대 부드러움 효과 +options.mipmapLevels.tooltip.6=이 설정은 성능에 영향을 주지 않습니다. + +of.options.MIPMAP_TYPE=밉맵 유형 +of.options.MIPMAP_TYPE.tooltip.1=세부 텍스처를 부드럽게 해 +of.options.MIPMAP_TYPE.tooltip.2=멀리 있는 물체를 더 좋아 보이게 하는 시각 효과입니다. +of.options.MIPMAP_TYPE.tooltip.3= 가장 가까움 - 거친 부드러움 효과 (가장 빠름) +of.options.MIPMAP_TYPE.tooltip.4= 선형 - 보통 부드러움 효과 +of.options.MIPMAP_TYPE.tooltip.5= 쌍선형 - 좋은 부드러움 효과 +of.options.MIPMAP_TYPE.tooltip.6= 삼선형 - 가장 좋은 부드러움 효과 (가장 느림) + + +of.options.AA_LEVEL=안티에일리어싱 +of.options.AA_LEVEL.tooltip.1=안티에일리어싱 +of.options.AA_LEVEL.tooltip.2= 꺼짐 - (기본) 안티에일리어싱 없음 (빠름) +of.options.AA_LEVEL.tooltip.3= 2-16 - 선과 모서리를 안티에일리어싱 (느림) +of.options.AA_LEVEL.tooltip.4=안티에일리어싱은 삐죽삐죽한 선과 +of.options.AA_LEVEL.tooltip.5=급격한 색상 변화를 부드럽게 합니다. +of.options.AA_LEVEL.tooltip.6=이 기능을 켤 경우 FPS가 상당히 감소할 수 있습니다. +of.options.AA_LEVEL.tooltip.7=모든 그래픽 카드가 모든 레벨을 지원하지는 않습니다. +of.options.AA_LEVEL.tooltip.8=재시작 후 적용됩니다! + +of.options.AF_LEVEL=비등방성 필터링 +of.options.AF_LEVEL.tooltip.1=비등방성 필터링 +of.options.AF_LEVEL.tooltip.2= 꺼짐 - (기본) 표준 세부 텍스처 (빠름) +of.options.AF_LEVEL.tooltip.3= 2-16 - 밉맵된 텍스처에서 더 나은 세부 텍스처 (느림) +of.options.AF_LEVEL.tooltip.4=비등방성 필터링은 밉맵된 텍스처의 +of.options.AF_LEVEL.tooltip.5=세부 양식을 복원합니다. +of.options.AF_LEVEL.tooltip.6=이 기능을 켤 경우 FPS가 상당히 감소할 수 있습니다. + +of.options.CLEAR_WATER=맑은 물 +of.options.CLEAR_WATER.tooltip.1=맑은 물 +of.options.CLEAR_WATER.tooltip.2= 켜짐 - 맑고 투명한 물 +of.options.CLEAR_WATER.tooltip.3= 꺼짐 - 기본 물 + +of.options.RANDOM_MOBS=무작위 몹 +of.options.RANDOM_MOBS.tooltip.1=무작위 몹 +of.options.RANDOM_MOBS.tooltip.2= 꺼짐 - 무작위 몹 없음, 빠름 +of.options.RANDOM_MOBS.tooltip.3= 켜짐 - 무작위 몹, 느림 +of.options.RANDOM_MOBS.tooltip.4=무작위 몹은 게임의 생명체에 무작위 텍스처를 사용합니다. +of.options.RANDOM_MOBS.tooltip.5=다수의 몹 텍스처가 있는 리소스 팩이 필요합니다. + +of.options.BETTER_GRASS=잔디 개선 +of.options.BETTER_GRASS.tooltip.1=잔디 개선 +of.options.BETTER_GRASS.tooltip.2= 꺼짐 - 기본 측면 잔디 텍스처, 가장 빠름 +of.options.BETTER_GRASS.tooltip.3= 빠르게 - 전체 측면 잔디 텍스처, 느림 +of.options.BETTER_GRASS.tooltip.4= 화려하게 - 동적 측면 잔디 텍스처, 가장 느림 + +of.options.BETTER_SNOW=눈 개선 +of.options.BETTER_SNOW.tooltip.1=눈 개선 +of.options.BETTER_SNOW.tooltip.2= 꺼짐 - 기본 눈, 빠름 +of.options.BETTER_SNOW.tooltip.3= 켜짐 - 눈 개선, 느림 +of.options.BETTER_SNOW.tooltip.4=투명한 블록(울타리, 큰 잔디)이 눈 블록과 접할 때 +of.options.BETTER_SNOW.tooltip.5=눈을 투명한 블록 밑에 보이게 합니다. + +of.options.CUSTOM_FONTS=맞춤 폰트 +of.options.CUSTOM_FONTS.tooltip.1=맞춤 폰트 +of.options.CUSTOM_FONTS.tooltip.2= 켜짐 - 맞춤 글꼴 사용 (기본), 느림 +of.options.CUSTOM_FONTS.tooltip.3= 꺼짐 - 기본 글꼴 사용, 빠름 +of.options.CUSTOM_FONTS.tooltip.4=맞춤 폰트는 현재 리소스 팩이 +of.options.CUSTOM_FONTS.tooltip.5=제공합니다. + +of.options.CUSTOM_COLORS=맞춤 색깔 +of.options.CUSTOM_COLORS.tooltip.1=맞춤 색깔 +of.options.CUSTOM_COLORS.tooltip.2= 켜짐 - 맞춤 색깔 사용 (기본), 느림 +of.options.CUSTOM_COLORS.tooltip.3= 꺼짐 - 기본 색깔 사용, 빠름 +of.options.CUSTOM_COLORS.tooltip.4=맞춤 색깔은 현재 리소스팩이 +of.options.CUSTOM_COLORS.tooltip.5=제공합니다. + +of.options.SWAMP_COLORS=늪 색깔 +of.options.SWAMP_COLORS.tooltip.1=늪 색깔 +of.options.SWAMP_COLORS.tooltip.2= 켜짐 - 늪 색깔 사용 (기본), 느림 +of.options.SWAMP_COLORS.tooltip.3= 꺼짐 - 늪 색깔 사용하지 않음, 빠름 +of.options.SWAMP_COLORS.tooltip.4=늪 색깔은 잔디와 잎, 덩굴, 물에 영향을 줍니다. + +of.options.SMOOTH_BIOMES=부드러운 생물군계 +of.options.SMOOTH_BIOMES.tooltip.1=부드러운 생물군계 +of.options.SMOOTH_BIOMES.tooltip.2= 켜짐 - 생물군계 경계를 부드럽게 함 (기본), 느림 +of.options.SMOOTH_BIOMES.tooltip.3= 꺼짐 - 생물군계 경계를 부드럽게 하지 않음, 빠름 +of.options.SMOOTH_BIOMES.tooltip.4=주위 블록의 색깔을 샘플링하고 평균화해 +of.options.SMOOTH_BIOMES.tooltip.5=바이옴 경계를 부드럽게 합니다. +of.options.SMOOTH_BIOMES.tooltip.6=잔디, 잎, 덩굴과 물에 영향을 줍니다. + +of.options.CONNECTED_TEXTURES=텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.1=텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.2= 꺼짐 - 텍스처 연결 없음 (기본) +of.options.CONNECTED_TEXTURES.tooltip.3= 빠르게 - 빠른 텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.4= 화려하게 - 화려한 텍스처 연결 +of.options.CONNECTED_TEXTURES.tooltip.5=잔디와 사암, 책장이 서로의 옆에 놓인 경우 +of.options.CONNECTED_TEXTURES.tooltip.6=텍스처를 연결합니다. +of.options.CONNECTED_TEXTURES.tooltip.7=텍스처 연결은 +of.options.CONNECTED_TEXTURES.tooltip.8=현재 리소스 팩이 제공합니다. + +of.options.NATURAL_TEXTURES=자연스러운 텍스처 +of.options.NATURAL_TEXTURES.tooltip.1=자연스러운 텍스처 +of.options.NATURAL_TEXTURES.tooltip.2= 꺼짐 - 자연스러운 텍스처 없음 (기본) +of.options.NATURAL_TEXTURES.tooltip.3= 켜짐 - 자연스러운 텍스처 사용 +of.options.NATURAL_TEXTURES.tooltip.4=자연스러운 텍스처는 동일한 블록의 반복으로 인해 +of.options.NATURAL_TEXTURES.tooltip.5=생기는 격자 무늬를 제거합니다. +of.options.NATURAL_TEXTURES.tooltip.6=회전하거나 뒤집은 기본 블록 텍스처 +of.options.NATURAL_TEXTURES.tooltip.7=변종을 사용합니다. 자연스러운 텍스처의 설정은 +of.options.NATURAL_TEXTURES.tooltip.8=현재 리소스팩이 제공합니다. + +of.options.CUSTOM_SKY=맞춤 하늘 +of.options.CUSTOM_SKY.tooltip.1=맞춤 하늘 +of.options.CUSTOM_SKY.tooltip.2= 켜짐 - 맞춤 하늘 텍스처 (기본), 느림 +of.options.CUSTOM_SKY.tooltip.3= 꺼짐 - 기본 하늘, 빠름 +of.options.CUSTOM_SKY.tooltip.4=기본 하늘 텍스처는 현재 리소스 팩이 +of.options.CUSTOM_SKY.tooltip.5=제공합니다. + +of.options.CUSTOM_ITEMS=맞춤 아이템 +of.options.CUSTOM_ITEMS.tooltip.1=맞춤 아이템 +of.options.CUSTOM_ITEMS.tooltip.2= 켜짐 - 맞춤 아이템 텍스처 (기본), 느림 +of.options.CUSTOM_ITEMS.tooltip.3= 꺼짐 - 기본 아이템 텍스처, 빠름 +of.options.CUSTOM_ITEMS.tooltip.4=맞춤 아이템 텍스처는 현재 리소스팩이 +of.options.CUSTOM_ITEMS.tooltip.5=제공합니다. + +of.options.CUSTOM_ENTITY_MODELS=맞춤 개체 모델 +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=맞춤 개체 모델 +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= 켜짐 - 맞춤 개체 모델 (기본), 느림 +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= 꺼짐 - 기본 개체 모델, 빠름 +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=맞춤 개체 모델은 현재 리소스팩이 +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=제공합니다. + +# Details + +of.options.CLOUDS=구름 +of.options.CLOUDS.tooltip.1=구름 +of.options.CLOUDS.tooltip.2= 기본 - 그래픽 설정대로 +of.options.CLOUDS.tooltip.3= 빠르게 - 더 낮은 품질, 빠름 +of.options.CLOUDS.tooltip.4= 화려하게 - 더 높은 품질, 느림 +of.options.CLOUDS.tooltip.5= 꺼짐 - 구름 없음, 가장 빠름 +of.options.CLOUDS.tooltip.6=빠르게 구름은 2D로 렌더됩니다. +of.options.CLOUDS.tooltip.7=화려하게 구름은 3D로 렌더됩니다. + +of.options.CLOUD_HEIGHT=구름 높이 +of.options.CLOUD_HEIGHT.tooltip.1=구름 높이 +of.options.CLOUD_HEIGHT.tooltip.2= 꺼짐 - 기본 높이 +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - 세계 높이 제한보다 위 + +of.options.TREES=나무 +of.options.TREES.tooltip.1=나무 +of.options.TREES.tooltip.2= 기본 - 그래픽 설정대로 +of.options.TREES.tooltip.3= 빠르게 - 더 낮은 품질, 더 빠름 +of.options.TREES.tooltip.4= 멋지게 - 더 높은 품질, 빠름 +of.options.TREES.tooltip.5= 화려하게 - 가장 높은 품질, 느림 +of.options.TREES.tooltip.6=빠르게로 설정하면 나뭇잎이 불투명해집니다. +of.options.TREES.tooltip.7=화려하게, 멋지게로 설정하면 나뭇잎이 투명해집니다. + +of.options.RAIN=비와 눈 +of.options.RAIN.tooltip.1=비와 눈 +of.options.RAIN.tooltip.2= 기본 - 그래픽 설정대로 +of.options.RAIN.tooltip.3= 빠르게 - 약한 비/눈, 빠름 +of.options.RAIN.tooltip.4= 화려하게 - 큰 비/눈, 느림 +of.options.RAIN.tooltip.5= 꺼짐 - 비와 눈 없음, 가장 빠름 +of.options.RAIN.tooltip.6=비가 꺼짐이여도 비 튀김과 빗소리는 +of.options.RAIN.tooltip.7=여전히 있습니다. + +of.options.SKY=하늘 +of.options.SKY.tooltip.1=하늘 +of.options.SKY.tooltip.2= 켜짐 - 하늘이 보임, 느림 +of.options.SKY.tooltip.3= 꺼짐 - 하늘이 보이지 않음, 빠름 +of.options.SKY.tooltip.4=하늘이 꺼짐이여도 태양과 달은 여전히 보입니다. + +of.options.STARS=별 +of.options.STARS.tooltip.1=별 +of.options.STARS.tooltip.2= 켜짐 - 별이 보임, 느림 +of.options.STARS.tooltip.3= 꺼짐 - 별이 보이지 않음, 빠름 + +of.options.SUN_MOON=해와 달 +of.options.SUN_MOON.tooltip.1=해와 달 +of.options.SUN_MOON.tooltip.2= 켜짐 - 해와 달이 보임 (기본) +of.options.SUN_MOON.tooltip.3= 꺼짐 - 태양과 달이 보이지 않음 (빠름) + +of.options.SHOW_CAPES=망토 표시 +of.options.SHOW_CAPES.tooltip.1=망토 표시 +of.options.SHOW_CAPES.tooltip.2= 켜짐 - 플레이어 망토 표시 (기본) +of.options.SHOW_CAPES.tooltip.3= 꺼짐 - 플레이어의 망토 표시 안 함 + +of.options.TRANSLUCENT_BLOCKS=반투명 블록 +of.options.TRANSLUCENT_BLOCKS.tooltip.1=반투명 블록 +of.options.TRANSLUCENT_BLOCKS.tooltip.2= 화려하게 - 정확한 색깔 혼합 (기본) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 빠르게 - 빠른 색깔 혼합 (빠름) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=다른 색깔의 반투명 블록(염색된 유리, 물, 얼음)이 +of.options.TRANSLUCENT_BLOCKS.tooltip.5=공기를 사이에 두고 놓였을 때의 +of.options.TRANSLUCENT_BLOCKS.tooltip.6=색상 혼합을 조정합니다. + +of.options.HELD_ITEM_TOOLTIPS=손에 든 아이템 설명 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=손에 든 아이템 설명 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= 켜짐 - 손에 들고 있는 아이템의 설명 표시 (기본) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= 꺼짐 - 손에 들고 있는 아이템의 설명 표시 안 함 + +of.options.ADVANCED_TOOLTIPS=고급 설명 +of.options.ADVANCED_TOOLTIPS.tooltip.1=고급 설명 +of.options.ADVANCED_TOOLTIPS.tooltip.2= 켜짐 - 고급 설명 표시 +of.options.ADVANCED_TOOLTIPS.tooltip.3= 꺼짐 - 고급 설명 표시 안 함 (기본) +of.options.ADVANCED_TOOLTIPS.tooltip.4=고급 설명은 아이템(id, 내구도)과 +of.options.ADVANCED_TOOLTIPS.tooltip.5=셰이더 설정(ID, 출처, 기본 값)의 +of.options.ADVANCED_TOOLTIPS.tooltip.6=확장 정보를 표시합니다. + +of.options.DROPPED_ITEMS=떨어진 아이템 +of.options.DROPPED_ITEMS.tooltip.1=떨어진 아이템 +of.options.DROPPED_ITEMS.tooltip.2= 기본 - 그래픽 설정대로 +of.options.DROPPED_ITEMS.tooltip.3= 빠르게 - 2D 떨어진 아이템, 빠름 +of.options.DROPPED_ITEMS.tooltip.4= 화려하게 - 3D 떨어진 아이템, 느림 + +options.entityShadows.tooltip.1=개체 그림자 +options.entityShadows.tooltip.2= 켜짐 - 개체 그림자 표시 +options.entityShadows.tooltip.3= 꺼짐 - 개체 그림자 표시 안 함 + +of.options.VIGNETTE=비네팅 +of.options.VIGNETTE.tooltip.1=화면 모서리를 살짝 어둡게 하는 시각 효과 +of.options.VIGNETTE.tooltip.2= 기본 - 그래픽 설정대로 (기본) +of.options.VIGNETTE.tooltip.3= 빠르게 - 비네팅 비활성화 (빠름) +of.options.VIGNETTE.tooltip.4= 화려하게 - 비네팅 활성화 (느림) +of.options.VIGNETTE.tooltip.5=비네팅은 FPS에 커다란 영향을, 특히 전체 화면으로 +of.options.VIGNETTE.tooltip.6=플레이할 때, 줄 수 있습니다. +of.options.VIGNETTE.tooltip.7=비네팅 효과는 미세하며 안전히 비활성화할 +of.options.VIGNETTE.tooltip.8=수 있습니다. + +of.options.DYNAMIC_FOV=동적 FOV +of.options.DYNAMIC_FOV.tooltip.1=동적 FOV +of.options.DYNAMIC_FOV.tooltip.2= 켜짐 - 동적 FOV 활성화 (기본) +of.options.DYNAMIC_FOV.tooltip.3= 꺼짐 - 동적 FOV 비활성화 +of.options.DYNAMIC_FOV.tooltip.4=날거나, 달리거나, 활을 당길 때 +of.options.DYNAMIC_FOV.tooltip.5=시야(FOV)를 바꿉니다. + +of.options.DYNAMIC_LIGHTS=동적 조명 +of.options.DYNAMIC_LIGHTS.tooltip.1=동적 조명 +of.options.DYNAMIC_LIGHTS.tooltip.2= 꺼짐 - 동적 조명 없음 (기본) +of.options.DYNAMIC_LIGHTS.tooltip.3= 빠르게 - 빠른 동적 조명 (500ms마다 갱신) +of.options.DYNAMIC_LIGHTS.tooltip.4= 화려하게 - 화려한 동적 조명 (실시간으로 갱신) +of.options.DYNAMIC_LIGHTS.tooltip.5=빛을 내는 아이템(횃불, 발광석 등)을 활성화해 손에 +of.options.DYNAMIC_LIGHTS.tooltip.6=들렸거나 다른 플레이어에게 장착됐거나 바닥에 +of.options.DYNAMIC_LIGHTS.tooltip.7=떨어졌을 때 주변을 비추도록 합니다. + +# Performance + +of.options.SMOOTH_FPS=부드러운 FPS +of.options.SMOOTH_FPS.tooltip.1=그래픽 드라이버 버퍼를 비워 FPS를 안정화합니다. +of.options.SMOOTH_FPS.tooltip.2= 꺼짐 - 안정화 없음, FPS가 요동칠 수 있음 +of.options.SMOOTH_FPS.tooltip.3= 켜짐 - FPS 안정화 +of.options.SMOOTH_FPS.tooltip.4=이 설정은 그래픽 드라이버 의존적이며 +of.options.SMOOTH_FPS.tooltip.5=효과가 향상 보이지는 않습니다. + +of.options.SMOOTH_WORLD=부드러운 세계 +of.options.SMOOTH_WORLD.tooltip.1=내부 서버에서 일어나는 랙 급증을 제거합니다. +of.options.SMOOTH_WORLD.tooltip.2= 꺼짐 - 안정화 없음, FPS가 요동칠 수 있음 +of.options.SMOOTH_WORLD.tooltip.3= 켜짐 - FPS 안정화 +of.options.SMOOTH_WORLD.tooltip.4=내부 서버 부하를 분배해 FPS를 안정화합니다. +of.options.SMOOTH_WORLD.tooltip.5=로컬 세계(싱글플레이)에서만 효과가 있습니다. + +of.options.FAST_RENDER=빠른 렌더 +of.options.FAST_RENDER.tooltip.1=빠른 렌더 +of.options.FAST_RENDER.tooltip.2= 꺼짐 - 표준 렌더링 (기본) +of.options.FAST_RENDER.tooltip.3= 켜짐 - 최적화된 렌더링 (빠름) +of.options.FAST_RENDER.tooltip.4=렌더링 알고리즘 최적화로 GPU 로드를 줄여 +of.options.FAST_RENDER.tooltip.5=FPS를 크게 향상시킬 수 있습니다. + +of.options.FAST_MATH=빠른 계산 +of.options.FAST_MATH.tooltip.1=빠른 계산 +of.options.FAST_MATH.tooltip.2= 꺼짐 - 표준 계산 (기본) +of.options.FAST_MATH.tooltip.3= 켜짐 - 빠른 계산 +of.options.FAST_MATH.tooltip.4=최적화된 sin()과 cos() 함수를 사용하여 CPU 캐시를 더 +of.options.FAST_MATH.tooltip.5=잘 활용하고 FPS를 높입니다. + +of.options.CHUNK_UPDATES=청크 갱신 +of.options.CHUNK_UPDATES.tooltip.1=청크 갱신 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 더 느린 세계 불러오기, 더 높은 FPS (기본) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 빠른 세계 불러오기, 느린 FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - 가장 빠른 세계 불러오기, 가장 느린 FPS +of.options.CHUNK_UPDATES.tooltip.5=렌더된 프레임당 청크 갱신 수를 지정합니다. +of.options.CHUNK_UPDATES.tooltip.6=높은 값은 프레임률을 불안정하게 만들 수 있습니다. + +of.options.CHUNK_UPDATES_DYNAMIC=동적 갱신 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=동적 청크 갱신 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= 꺼짐 - 표준 프레임당 청크 갱신 (기본) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= 켜짐 - 플레이어가 가만히 서있을 때 더 많은 갱신 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=동적 갱신은 플레이어가 가만히 서있을 때 더 많은 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=청크 갱신을 강제해 세계를 빠르게 불러옵니다. + +of.options.LAZY_CHUNK_LOADING=느긋하게 청크 불러오기 +of.options.LAZY_CHUNK_LOADING.tooltip.1=느긋하게 청크 불러오기 +of.options.LAZY_CHUNK_LOADING.tooltip.2= 꺼짐 - 기본 서버 청크 불러오기 +of.options.LAZY_CHUNK_LOADING.tooltip.3= 켜짐 - 느긋하게 서버 청크 불러오기 (부드러움) +of.options.LAZY_CHUNK_LOADING.tooltip.4=청크를 여러 틱으로 분배해 통합 서버 청크 +of.options.LAZY_CHUNK_LOADING.tooltip.5=불러오기를 부드럽게 합니다. +of.options.LAZY_CHUNK_LOADING.tooltip.6=세계의 일부를 정확히 불러오지 않으면 꺼짐으로 설정해 주십시오. +of.options.LAZY_CHUNK_LOADING.tooltip.7=로컬 세계와 싱글코어 CPU에만 효과가 있습니다. + +# Animations + +of.options.animation.allOn=모두 켜짐으로 +of.options.animation.allOff=모두 꺼짐으로 +of.options.animation.dynamic=동적 + +of.options.ANIMATED_WATER=물 애니메이션 +of.options.ANIMATED_LAVA=용암 애니메이션 +of.options.ANIMATED_FIRE=불 애니메이션 +of.options.ANIMATED_PORTAL=관문 애니메이션 +of.options.ANIMATED_REDSTONE=레드스톤 애니메이션 +of.options.ANIMATED_EXPLOSION=폭발 애니메이션 +of.options.ANIMATED_FLAME=화염 애니메이션 +of.options.ANIMATED_SMOKE=연기 애니메이션 +of.options.VOID_PARTICLES=공허 입자 +of.options.WATER_PARTICLES=물 입자 +of.options.RAIN_SPLASH=비 튀김 +of.options.PORTAL_PARTICLES=관문 입자 +of.options.POTION_PARTICLES=물약 입자 +of.options.DRIPPING_WATER_LAVA=물/용암 방울 +of.options.ANIMATED_TERRAIN=지형 애니메이션 +of.options.ANIMATED_TEXTURES=텍스처 애니메이션 +of.options.FIREWORK_PARTICLES=폭죽 입자 + +# Other + +of.options.LAGOMETER=지연계 +of.options.LAGOMETER.tooltip.1=디버그 화면(F3)에 지연계를 표시합니다. +of.options.LAGOMETER.tooltip.2=* 주황색 - 메모리 쓰레기 수집 +of.options.LAGOMETER.tooltip.3=* 청록색 - 틱 +of.options.LAGOMETER.tooltip.4=* 파란색 - 예약된 실행 +of.options.LAGOMETER.tooltip.5=* 보라색 - 청크 업로드 +of.options.LAGOMETER.tooltip.6=* 빨간색 - 청크 갱신 +of.options.LAGOMETER.tooltip.7=* 노란색 - 가시성 검사 +of.options.LAGOMETER.tooltip.8=* 초록색 - 지형 렌더 + +of.options.PROFILER=디버그 프로파일러 +of.options.PROFILER.tooltip.1=디버그 프로파일러 +of.options.PROFILER.tooltip.2= 켜짐 - 디버그 프로파일러가 켜짐, 느림 +of.options.PROFILER.tooltip.3= 꺼짐 - 디버그 프로파일러가 꺼짐, 빠름 +of.options.PROFILER.tooltip.4=디버그 프로파일러는 디버그 화면(F3)이 열려 +of.options.PROFILER.tooltip.5=있을 때 디버그 정보를 수집해 표시합니다. + +of.options.WEATHER=날씨 +of.options.WEATHER.tooltip.1=날씨 +of.options.WEATHER.tooltip.2= 켜짐 - 날씨가 켜짐, 느림 +of.options.WEATHER.tooltip.3= 꺼짐 - 날씨가 꺼짐, 빠름 +of.options.WEATHER.tooltip.4=날씨는 비와 눈, 뇌우를 조정합니다. +of.options.WEATHER.tooltip.5=날씨 조정은 로컬 세계에서만 가능합니다. + +of.options.time.dayOnly=낮만 +of.options.time.nightOnly=밤만 + +of.options.TIME=시간 +of.options.TIME.tooltip.1=시간 +of.options.TIME.tooltip.2= 기본 - 보통 낮/밤 주기 +of.options.TIME.tooltip.3= 낮만 - 낮만 +of.options.TIME.tooltip.4= 밤만 - 밤만 +of.options.TIME.tooltip.5=시간 설정은 크리에이티브 모드와 로컬 세게에서만 +of.options.TIME.tooltip.6=효과가 있습니다. + +options.fullscreen.tooltip.1=전체 화면 +options.fullscreen.tooltip.2= 켜짐 - 전체 화면 모드 사용 +options.fullscreen.tooltip.3= 꺼짐 - 창 모드 사용 +options.fullscreen.tooltip.4=전체 화면 모드는 그래픽 카드에 따라 +options.fullscreen.tooltip.5=창 모드보다 빠르거나 느릴 수 있습니다. + +of.options.FULLSCREEN_MODE=전체 화면 모드 +of.options.FULLSCREEN_MODE.tooltip.1=전체 화면 모드 +of.options.FULLSCREEN_MODE.tooltip.2= 기본 - 데스크톱 화면 해상도 사용, 느림 +of.options.FULLSCREEN_MODE.tooltip.3= 너비x높이 - 사용자 지정 해상도 사용, 더 빠를 수 있음 +of.options.FULLSCREEN_MODE.tooltip.4=선택한 해상도를 전체 화면 모드(F11)에서 사용합니다. +of.options.FULLSCREEN_MODE.tooltip.5=낮은 해상도가 일반적으로 빠릅니다. + +of.options.SHOW_FPS=FPS 표시 +of.options.SHOW_FPS.tooltip.1=소형 FPS 및 렌더 정보를 표시합니다. +of.options.SHOW_FPS.tooltip.2= C: - 청크 렌더러 +of.options.SHOW_FPS.tooltip.3= E: - 렌더된 개체 + 블록 개체 +of.options.SHOW_FPS.tooltip.4= U: - 청크 갱신 +of.options.SHOW_FPS.tooltip.5=소형 FPS 정보는 디버그 화면이 +of.options.SHOW_FPS.tooltip.6=보이지 않을 때에만 표시됩니다. + +of.options.save.default=기본 (2초) +of.options.save.20s=20초 +of.options.save.3min=3분 +of.options.save.30min=30분 + +of.options.AUTOSAVE_TICKS=자동 저장 +of.options.AUTOSAVE_TICKS.tooltip.1=자동 저장 간격 +of.options.AUTOSAVE_TICKS.tooltip.2=기본 자동 저장 간격(2초)을 권장하지 않습니다. +of.options.AUTOSAVE_TICKS.tooltip.3=자동 저장은 그 유명한 죽음의 랙 급증을 야기합니다. + +of.options.SCREENSHOT_SIZE=스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.1=스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.2= 기본 - 기본 스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - 사용자 지정 스크린샷 크기 +of.options.SCREENSHOT_SIZE.tooltip.4=큰 스크린샷을 캡쳐하는 데 많은 메모리가 필요할 수 있습니다. +of.options.SCREENSHOT_SIZE.tooltip.5=빠른 렌더와 안티에일리어싱과 호환되지 않습니다. +of.options.SCREENSHOT_SIZE.tooltip.6=GPU 프레임버퍼 지원이 필요합니다. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/lb_LU.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/lb_LU.lang new file mode 100644 index 0000000..5e3f385 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/lb_LU.lang @@ -0,0 +1,578 @@ +# Contributors of Luxembourgish localization # +# Hyperspacemaster ---- 2016-4-6 ---- 2016-9-12 + +# General +of.general.ambiguous=onkloer +of.general.custom=Aneres +of.general.from=Vun +of.general.id=ID +of.general.restart=Neistart +of.general.smart=Fein + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing ass net kompatibel mat de Shader. +of.message.aa.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.af.shaders1=Anisotropescht Filteren ass net kompatibel mat de Shader. +of.message.af.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.fr.shaders1=Schnellt Renderen ass net kompatibel mat de de Shader. +of.message.fr.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.an.shaders1=3D Anaglyph ass net kompatibel mat de Shader. +of.message.an.shaders2=W.e.g. schalt de Shader aus fir des Optioun ze aktivéieren. + +of.message.shaders.aa1=Antialiasing ass net kompatibel mat de Shader . +of.message.shaders.aa2=W.e.g desaktivéier Qualitéit -> Antialiasing a start däi Spill nei. + +of.message.shaders.af1=Anisotropescht Filteren ass net kompatibel mat de Shader. +of.message.shaders.af2=W.e.g desaktivéier Qualitéit -> Anisotropescht Filteren. + +of.message.shaders.fr1=Shader sinn net kompatibel mat schnellem Renderen. +of.message.shaders.fr2=W.e.g desaktivéier Qualitéit -> Schnellt Renderen. + +of.message.shaders.an1=Shader sinn net kompatibel mam 3D Anaglyph. +of.message.shaders.an2=W.e.g desaktivéier Verschiddenes -> 3D Anaglyph. + +of.message.newVersion=Eng nei §eOptiFine§f Versioun ass verfügbar: §e%s§f +of.message.java64Bit=Du kanns §e64-bit Java§f installéiere fir eng besser Performance. +of.message.openglError=§eOpenGL Fehler§f: %s (%s) + +of.message.shaders.loading=D'Shader gi gelueden: %s + +of.message.other.reset=All Videoastellungen zerécksetzen ob hier Standardwäerter? + +# Video settings + +options.graphics.tooltip.1=Grafikmodus +options.graphics.tooltip.2= Schnell - méi schlecht Qualitéit, méi schnell +options.graphics.tooltip.3= Schéin - héich Qualitéit, méi lues +options.graphics.tooltip.4=Verännert d'Ausgesi vun de Wolleken, Blieder, Grasbléck, +options.graphics.tooltip.5=Schieter a vum Waasser. + +of.options.renderDistance.tiny=Winzeg +of.options.renderDistance.short=Geréng +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Wéit +of.options.renderDistance.extreme=Extrem + +options.renderDistance.tooltip.1=Siichtwéit +options.renderDistance.tooltip.2= 2 Winzeg - 32m (am schnellsten) +options.renderDistance.tooltip.3= 4 Geréng - 64m (schnell) +options.renderDistance.tooltip.4= 8 Normal - 128m +options.renderDistance.tooltip.5= 16 Wéit - 256m (lues) +options.renderDistance.tooltip.6= 32 Extrem - 512m (am luesten!) +options.renderDistance.tooltip.7=D'extrem Siichtwéit erfuerdert vill Ressource. +options.renderDistance.tooltip.8=Wäerter iwwer 16 funktionéieren nëmmen am Singleplayer + +options.ao.tooltip.1=Fléissend Beliichtung +options.ao.tooltip.2= Aus - keng fléissend Beliichtung (schnell) +options.ao.tooltip.3= Minimum - einfach fléissend Beliichtung (lues) +options.ao.tooltip.4= Maximum - komplexe fléissend Beliichtung (am luesten) + +options.framerateLimit.tooltip.1=Max. FPS +options.framerateLimit.tooltip.2= VSync - limitéiert ob d'Bildfrequenz vum +options.framerateLimit.tooltip.3= Monitor (60, 30, 20) +options.framerateLimit.tooltip.4= 5-255 - variabel +options.framerateLimit.tooltip.5= Illimitéiert - keng Begrenzung (am schnellsten) +options.framerateLimit.tooltip.6=D'Bildfrequenz grenzt FPS an, souguer wann +options.framerateLimit.tooltip.7=d'Begrenzung net erreecht ass. +of.options.framerateLimit.vsync=V-Sync + +of.options.AO_LEVEL=Schiet-Hellegkeet +of.options.AO_LEVEL.tooltip.1=Hellegkeet vun de Schieter +of.options.AO_LEVEL.tooltip.2= Aus - keng Schieter +of.options.AO_LEVEL.tooltip.3= 50%% - hell Schieter +of.options.AO_LEVEL.tooltip.4= 100%% - donkel Schieter + +options.viewBobbing.tooltip.1=Realistesch Bewegungen +options.viewBobbing.tooltip.2=Wann Mipmaps genotzt ginn deaktivéiert d'Astellung +options.viewBobbing.tooltip.3=fir eng besser Leeschtung + +options.guiScale.tooltip.1=GUI-Gréisst +options.guiScale.tooltip.2=Ee méi klengt GUI ka méi schnell sinn. + +options.vbo.tooltip.1=Vertexbufferobjeten +options.vbo.tooltip.2=Benotz een alternative Rendermodel, deen normalerweis +options.vbo.tooltip.3=méi schnell (5-10%%) wei d'Standard-Renderen ass. + +options.gamma.tooltip.1=Erhéicht Hellegkeet vun donkelen Objeten +options.gamma.tooltip.2= Aus - Standardhellegkeet +options.gamma.tooltip.3= 1-99%% - variabel +options.gamma.tooltip.4= Hell - maximal Hellegkeet fir donkel Objeten +options.gamma.tooltip.5=Dës Optioun ännert Hellegkeet vun ganz donkelen +options.gamma.tooltip.6=Objeten net. + +options.anaglyph.tooltip.1=3D Anaglyph +options.anaglyph.tooltip.2=Aktivéiert ee stereoskopeschen 3D-Effekt duerch +options.anaglyph.tooltip.3=benotze vun ënnerschiddleche Faarwe fir d'Aen. +options.anaglyph.tooltip.4=Kann nëmme mat engem Roud-Turquoise-Brëll benotzt ginn. + +options.blockAlternatives.tooltip.1=Block Variatiounen +options.blockAlternatives.tooltip.2=Benotz Variatioune fir puer Bléck +options.blockAlternatives.tooltip.3=Hänkt vum ausgewielte Ressourcenpack of. + +of.options.ALTERNATE_BLOCKS=Block Variatiounen +of.options.ALTERNATE_BLOCKS.tooltip.1=Block Variatiounen +of.options.ALTERNATE_BLOCKS.tooltip.2=Benotz Variatioune fir puer Bléck +of.options.ALTERNATE_BLOCKS.tooltip.3=Hänkt vum ausgewielte Ressourcenpack of. + +of.options.FOG_FANCY=Niwwel +of.options.FOG_FANCY.tooltip.1=Niwwel +of.options.FOG_FANCY.tooltip.2= Schnell - schnellen Niwwel +of.options.FOG_FANCY.tooltip.3= Schéin - luesen Niwwel, gesäit besser aus +of.options.FOG_FANCY.tooltip.4= Aus - keen Niwwel, am schnellsten +of.options.FOG_FANCY.tooltip.5=De schéinen Niwwel ass nëmme verfügbar, wann en vun +of.options.FOG_FANCY.tooltip.6=der Grafikkaart ënnerstëtzt gëtt. + +of.options.FOG_START=Niwwel Startpunkt +of.options.FOG_START.tooltip.1=Niwwel Startpunkt +of.options.FOG_START.tooltip.2= 0.2 - Niwwel start no beim Spiller +of.options.FOG_START.tooltip.3= 0.8 - Niwwel start weit vum Spiller ewech +of.options.FOG_START.tooltip.4=Dës Optioun beaflosst normalerweis net d'Leeschtung + +of.options.CHUNK_LOADING=Chunklueden +of.options.CHUNK_LOADING.tooltip.1=Chunklueden +of.options.CHUNK_LOADING.tooltip.2= Standard - onstabil FPS beim luede vun de Chunks +of.options.CHUNK_LOADING.tooltip.3= Fléissend - stabil FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - stabil FPS, 3x méi schnellt luede vun der Welt +of.options.CHUNK_LOADING.tooltip.5=Fléissend a Multi-Core mécht Ruckler a Standbiller +of.options.CHUNK_LOADING.tooltip.6=fort déi durch d'Luede vun de Chunks verursaacht ginn. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core kann d'Luede vun der Welt bis zu 3x méi schnell +of.options.CHUNK_LOADING.tooltip.8=maachen a FPS erhéijen duerch een zweete CPU-Kär. +of.options.chunkLoading.smooth=Fléissend +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Schieter ... +of.options.shadersTitle=Schieter + +of.options.shaders.packNone=Aus +of.options.shaders.packDefault=(intern) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.NORMAL_MAP=Normal Kaart +of.options.shaders.SPECULAR_MAP=Spiegelnd Kaart +of.options.shaders.RENDER_RES_MUL=Render Qualitéit +of.options.shaders.SHADOW_RES_MUL=Schiet Qualitéit +of.options.shaders.HAND_DEPTH_MUL=Handdéift +of.options.shaders.CLOUD_SHADOW=Wolleke schiet +of.options.shaders.OLD_HAND_LIGHT=Aal Handbel. +of.options.shaders.OLD_LIGHTING=Aal Beliichtung +of.options.shaders.SHADER_PACK=Shaderpack + +of.options.shaders.shadersFolder=Shader-Fichier +of.options.shaders.shaderOptions=Shaderastellungen ... + +of.options.shaderOptionsTitle=Shaderastellungen + +of.options.quality=Qualitéit ... +of.options.qualityTitle=Qualitéitsastellungen + +of.options.details=Detailer ... +of.options.detailsTitle=Detailastellungen + +of.options.performance=Performance ... +of.options.performanceTitle=Performanceastellungen + +of.options.animations=Animatiounen ... +of.options.animationsTitle=Animatiounsastellungen + +of.options.other=Verschiddenes ... +of.options.otherTitle=Veschidden Astellungen + +of.options.other.reset=Videoastellungen zerécksetzen ... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Am noosten +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Visuellen Effekt dee weit entfernten Objete besser +options.mipmapLevels.tooltip.2=ausgesi léisst duerch verréngere vun den Texturdetailer. +options.mipmapLevels.tooltip.3= Aus - keng Verréngerung vun Detailer +options.mipmapLevels.tooltip.4= 1 - minimal Verréngerung vun Detailler +options.mipmapLevels.tooltip.5= 4 - maximal Verréngerung vun Detailler +options.mipmapLevels.tooltip.6=Dës Optioun beaflosst normalerweis d'Performance net. + +of.options.MIPMAP_TYPE=Mipmap-Typ +of.options.MIPMAP_TYPE.tooltip.1=Visuellen Effekt dee weit distanzéiert Objete besser +of.options.MIPMAP_TYPE.tooltip.2=ausgesi léisst duerch verréngere vun den Texturdetailer. +of.options.MIPMAP_TYPE.tooltip.3= Am noosten - graff Verréngerung (am schnellsten) +of.options.MIPMAP_TYPE.tooltip.4= Linear - normal Verréngerung (schnell) +of.options.MIPMAP_TYPE.tooltip.5= Bilinear - fein Verréngerung (lues) +of.options.MIPMAP_TYPE.tooltip.6= Trilinear - feinst Verréngerung (am luesten) + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= Aus - (Standard) Keen Antialiasing (méi schnell) +of.options.AA_LEVEL.tooltip.3= 2-16 - antialiséiert Kanten an Ecker (méi lues) +of.options.AA_LEVEL.tooltip.4=Den Antialiasing mécht Kanten a Faarfiwergäng +of.options.AA_LEVEL.tooltip.5=méi fléissend. +of.options.AA_LEVEL.tooltip.6=Wann aktivéiert kënnen deng FPS staark erof goen. +of.options.AA_LEVEL.tooltip.7=Net all Stufe gi vun all Grafikaart ënnerstëtzt +of.options.AA_LEVEL.tooltip.8=Ännerunge sinn ereicht no engem Neistart effektiv! + +of.options.AF_LEVEL=Anisotropescht Filteren +of.options.AF_LEVEL.tooltip.1=Anisotropescht Filteren +of.options.AF_LEVEL.tooltip.2= Aus - (Standard) Standard-Texturdetailer (méi schnell) +of.options.AF_LEVEL.tooltip.3= 2-16 - méi fein Texturdetailer (méi lues) +of.options.AF_LEVEL.tooltip.4=D'anisoptropescht Filtere stellt Texturdetailer +of.options.AF_LEVEL.tooltip.5=déi duerch Mipmap verluer gaange sinn erëm hier. +of.options.AF_LEVEL.tooltip.6=Wann aktivéiert kenne FPS staark erof goen. + +of.options.CLEAR_WATER=Kloert Waasser +of.options.CLEAR_WATER.tooltip.1=Kloert Waasser +of.options.CLEAR_WATER.tooltip.2= Un - kloer, transparent Waasser +of.options.CLEAR_WATER.tooltip.3= Aus - normaalt Waasser + +of.options.RANDOM_MOBS=Zoufälleg Mobs +of.options.RANDOM_MOBS.tooltip.1=Zoufälleg Mobs +of.options.RANDOM_MOBS.tooltip.2= Aus - keng zoufälleg Mobs, méi schnell +of.options.RANDOM_MOBS.tooltip.3= Un - zoufälleg Mobs, méi lues +of.options.RANDOM_MOBS.tooltip.4=Zoufälleg Mobs benotzt zoufälleg Texture fir Kreaturen +of.options.RANDOM_MOBS.tooltip.5=am Spill. +of.options.RANDOM_MOBS.tooltip.6=Et braucht een ee Ressourcepak mat e puer Mobtexturen. + +of.options.BETTER_GRASS=Bessert Grass +of.options.BETTER_GRASS.tooltip.1=Bessert Grass +of.options.BETTER_GRASS.tooltip.2= Aus - Standard-Säitentextur vum Gras, am schnellsten +of.options.BETTER_GRASS.tooltip.3= Schnell - komplett Säitentextur vum Gras, lues +of.options.BETTER_GRASS.tooltip.4= Schéin - dynamesch Säitentextur vum Gras, am luesten + +of.options.BETTER_SNOW=Bessere Schnéi +of.options.BETTER_SNOW.tooltip.1=Bessere Schnéi +of.options.BETTER_SNOW.tooltip.2= Aus - normale Schnéi, méi schnell +of.options.BETTER_SNOW.tooltip.3= Un - bessere Schnéi, méi lues +of.options.BETTER_SNOW.tooltip.4=Wéist Schnéi ënnert transparente Bléck (Zonk, +of.options.BETTER_SNOW.tooltip.5=héijem Grass) un wann se un Schnéibléck ugrenzen. + +of.options.CUSTOM_FONTS=Schrëftressource +of.options.CUSTOM_FONTS.tooltip.1=Schrëftressource +of.options.CUSTOM_FONTS.tooltip.2= Un - Ressourcepak-Schrëft (Standard), méi lues +of.options.CUSTOM_FONTS.tooltip.3= Aus - Standardschrëft, méi schnell +of.options.CUSTOM_FONTS.tooltip.4=D'Schrëft gëtt vum ausgewielte Ressourcepak gelueden +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Faarfressource +of.options.CUSTOM_COLORS.tooltip.1=Faarfressource +of.options.CUSTOM_COLORS.tooltip.2= Un - Ressourcepak-Faarwen (Standard), méi lues +of.options.CUSTOM_COLORS.tooltip.3= Aus - Standardfaarwen, méi schnell +of.options.CUSTOM_COLORS.tooltip.4=Faarwe gi vum ausgewielte Ressourcepak gelueden +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Sumpffaarwen +of.options.SWAMP_COLORS.tooltip.1=Sumpffaarwen +of.options.SWAMP_COLORS.tooltip.2= Un - Sumpffaarwe benotzen (Standard), méi lues +of.options.SWAMP_COLORS.tooltip.3= Aus - Sumpffaarwen nëtt benotzen, méi schnell +of.options.SWAMP_COLORS.tooltip.4=Sumpfaarwe concernéiere Grass, Blieder, Lianen +of.options.SWAMP_COLORS.tooltip.5=a Waasser. + +of.options.SMOOTH_BIOMES=Biomeiwwergäng +of.options.SMOOTH_BIOMES.tooltip.1= Biomeiwwergäng +of.options.SMOOTH_BIOMES.tooltip.2= Un - fléissenden Iwwergang (Standard), méi lues +of.options.SMOOTH_BIOMES.tooltip.3= Aus - kee fléissenden Iwwergang, méi schnell +of.options.SMOOTH_BIOMES.tooltip.4=De fléissenden Iwwergang gëtt duerch Prouwen an +of.options.SMOOTH_BIOMES.tooltip.5=Duerchschnëttsfaarfwäerter vun den ugrenzende +of.options.SMOOTH_BIOMES.tooltip.6=Bléck realiséiert +of.options.SMOOTH_BIOMES.tooltip.7=Concernéiert si Grass, Blieder, Lianen a Waasser + +of.options.CONNECTED_TEXTURES=Verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.1=Verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.2= Aus - keng verbonnen Texturen (Standard) +of.options.CONNECTED_TEXTURES.tooltip.3= Schnell - schnell verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.4= Schéin - schéi verbonnen Texturen +of.options.CONNECTED_TEXTURES.tooltip.5=Verbonnen Texture verbënnt d'Texture vu Glas, +of.options.CONNECTED_TEXTURES.tooltip.6=Sandsteen a Bicherregaler wann se niewenteneen +of.options.CONNECTED_TEXTURES.tooltip.7=plazéiert ginn. D'verbonnen Texture gi vum +of.options.CONNECTED_TEXTURES.tooltip.8=Ressourcepak gelueden. + +of.options.NATURAL_TEXTURES=Natierlech Texturen +of.options.NATURAL_TEXTURES.tooltip.1=Natierlech Texturen +of.options.NATURAL_TEXTURES.tooltip.2= Aus - keng natierlech Texturen (Standard) +of.options.NATURAL_TEXTURES.tooltip.3= Un - benotz natierlech Texturen +of.options.NATURAL_TEXTURES.tooltip.4=Natierlech Texture maachen d'Raster-Unuerdnung +of.options.NATURAL_TEXTURES.tooltip.5=déi duerch widderhuele vum selwechte Block entsti fort. +of.options.NATURAL_TEXTURES.tooltip.6=Et gi rotéiert a gespigelt Variante vun der +of.options.NATURAL_TEXTURES.tooltip.7=Basisblocktextur genotzt. Konfiguratioun fir natierlech +of.options.NATURAL_TEXTURES.tooltip.8=Texture gi vum Ressourcepak gelueden. + +of.options.CUSTOM_SKY=Himmeltexturen +of.options.CUSTOM_SKY.tooltip.1=Himmeltexturen +of.options.CUSTOM_SKY.tooltip.2= Un - Ressourcepak-Himmeltexturen (Standard), lues +of.options.CUSTOM_SKY.tooltip.3= Aus - Standardhimmel, méi schnell +of.options.CUSTOM_SKY.tooltip.4=D'Himmeltexture gi vum Ressourcepak gelueden +of.options.CUSTOM_SKY.tooltip.5= + +of.options.CUSTOM_ITEMS=Géigestänntexturen +of.options.CUSTOM_ITEMS.tooltip.1=Géigestänntexturen +of.options.CUSTOM_ITEMS.tooltip.2= Un - Géigestänntexturen aus dem Ressourcepak +of.options.CUSTOM_ITEMS.tooltip.3= (Standard), lues +of.options.CUSTOM_ITEMS.tooltip.4= Aus - Standard-Géigestänntexturen, méi schnell +of.options.CUSTOM_ITEMS.tooltip.5=Géigestänntexture gi vum Ressourcepak gelueden + +# Details + +of.options.CLOUDS=Wolleken +of.options.CLOUDS.tooltip.1=Wolleken +of.options.CLOUDS.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.CLOUDS.tooltip.3= Schnell - méi geréng Qualitéit, méi schnell +of.options.CLOUDS.tooltip.4= Schéin - héich Qualitéit, méi lues +of.options.CLOUDS.tooltip.5= Aus - keng Wolleken, am schnellsten +of.options.CLOUDS.tooltip.6=Schnell Wolleke sinn am 2D gerendert. +of.options.CLOUDS.tooltip.7=Schéi Wolleke sinn am 3D gerendert. + +of.options.CLOUD_HEIGHT=Wollekenhéicht +of.options.CLOUD_HEIGHT.tooltip.1=Wollekenhéicht +of.options.CLOUD_HEIGHT.tooltip.2= Aus - Standardhéicht +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - iwwert der max. Welt héicht + +of.options.TREES=Beem +of.options.TREES.tooltip.1=Beem +of.options.TREES.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.TREES.tooltip.3= Schnell - méi geréng Qualitéit, méi schnell +of.options.TREES.tooltip.4= Fein - méi héich Qualitéit, schnell +of.options.TREES.tooltip.5= Schéin - héchste Qualitéit, méi lues +of.options.TREES.tooltip.6=Schnell Beem hunn onduerchsichteg Blieder +of.options.TREES.tooltip.7=Schéin a fein Beem hunn transparent Blieder. + +of.options.RAIN=Reen a Schnéi +of.options.RAIN.tooltip.1=Reen a Schnéi +of.options.RAIN.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.RAIN.tooltip.3= Schnell - liichte Reen/Schnéi, méi schnell +of.options.RAIN.tooltip.4= Schéin - heftege Reen/Schnéi, méi lues +of.options.RAIN.tooltip.5= Aus - keen Reen/Schnéi, schnellst +of.options.RAIN.tooltip.6=Och wann de Reen aus ass, héiert een nach ëmmer +of.options.RAIN.tooltip.7=Geräischer + +of.options.SKY=Himmel +of.options.SKY.tooltip.1=Himmel +of.options.SKY.tooltip.2= Un - Himmel siichtbar, méi lues +of.options.SKY.tooltip.3= Aus - Himmel net siichtbar, méi schnell +of.options.SKY.tooltip.4=Och wann den Himmel aus ass, sinn de Mount an d'Sonn +of.options.SKY.tooltip.5=nach ëmmer siichtbar. + +of.options.STARS=Stären +of.options.STARS.tooltip.1=Stären +of.options.STARS.tooltip.2= Un - Stäre siichtbar, méi lues +of.options.STARS.tooltip.3= Aus - Stären net siichtbar, méi schnell + +of.options.SUN_MOON=Sonn a Mound +of.options.SUN_MOON.tooltip.1=Sonn a Mound +of.options.SUN_MOON.tooltip.2= Un - Sonn a Mound siichtbar (Standard) +of.options.SUN_MOON.tooltip.3= Aus - Sonn a Mound net siichtbar (méi schnell) + +of.options.SHOW_CAPES=Emhang weisen +of.options.SHOW_CAPES.tooltip.1=Emhang weisen +of.options.SHOW_CAPES.tooltip.2= Un - weis d'Emhäng vun de Spiller (Standard) +of.options.SHOW_CAPES.tooltip.3= Aus - d'Emhäng vun de Spiller ginn net ugewisen + +of.options.TRANSLUCENT_BLOCKS=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocktransparenz +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Schéin - korrekt Faarfmëschung (Standard) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Schnell - schnell Faarfmëschung (méi schnell) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Kontrolléiert Faarfmëschung vun transparente Bléck +of.options.TRANSLUCENT_BLOCKS.tooltip.5=aus verschiddene Faarwen (gefierfte Glas, Waasser, Äis) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=wann se hannert ënne placéiert sinn oder Loft +of.options.TRANSLUCENT_BLOCKS.tooltip.7=dertëschent ass. + +of.options.HELD_ITEM_TOOLTIPS=Géigestandbeschreiw. +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Géigestandbeschreiwung +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Un - weis Géigestandbeschreiwung un (Standard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Aus - weis keng Géigestandbeschreiwung + +of.options.DROPPED_ITEMS=Géigenstänn +of.options.DROPPED_ITEMS.tooltip.1=Falengelosse Géigenstänn +of.options.DROPPED_ITEMS.tooltip.2= Standard - wéi vum Grafikmodus definéiert +of.options.DROPPED_ITEMS.tooltip.3= Schnell - 2D falengelosse Géigestänn, méi schnell +of.options.DROPPED_ITEMS.tooltip.4= Schéin - 3D falengelosse Géigestänn, méi lues + +options.entityShadows.tooltip.1=Objetschieter +options.entityShadows.tooltip.2= Un - weis Objetschieter un +options.entityShadows.tooltip.3= Aus - keng Objetschieter + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Visuellen Effekt deen d'Ecker liicht ofdonkelt +of.options.VIGNETTE.tooltip.2= Standard - wéi vum Grafikmodus definéiert (Standard) +of.options.VIGNETTE.tooltip.3= Schnell - Vignette deaktivéiert (méi schnell) +of.options.VIGNETTE.tooltip.4= Schéin - Vignette aktivéiert (méi lues) +of.options.VIGNETTE.tooltip.5=D'Vignette kann ee staarken Impakt ob d'FPS hunn, +of.options.VIGNETTE.tooltip.6=virun allem wann am Vollbildmodus gespillt gëtt. +of.options.VIGNETTE.tooltip.7=De Vignette Effekt ass relativ geréng a kann dofir +of.options.VIGNETTE.tooltip.8=ouni Problem deaktivéiert ginn. + +of.options.DYNAMIC_FOV=Dynamescht Siichtfeld +of.options.DYNAMIC_FOV.tooltip.1=Dynamescht Siichtfeld +of.options.DYNAMIC_FOV.tooltip.2= Un - dynamescht Siichtfeld un (Standard) +of.options.DYNAMIC_FOV.tooltip.3= Aus - dynamescht Siichtfeld aus +of.options.DYNAMIC_FOV.tooltip.4=Wiesselt Siichtfeld beim Fléien, Sprinten +of.options.DYNAMIC_FOV.tooltip.5=oder spannen vun engem Bou. + +of.options.DYNAMIC_LIGHTS=Dyn. Beliichtung +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamesch Beliichtung +of.options.DYNAMIC_LIGHTS.tooltip.2= Un - keng dyn. Beliichtung (Standard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Schnell - schnell dyn- Beliichtung (Update all 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Schéin - schéin dyn. Beliichtung (Update a Realzäit) +of.options.DYNAMIC_LIGHTS.tooltip.5=Liicht-Géigestänn (Fackelen, Glowstone etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=beliichten d'Ëmgéigend wann se an der Hand gehalen, +of.options.DYNAMIC_LIGHTS.tooltip.7=een anere Spiller se equipéiert huet oder se +of.options.DYNAMIC_LIGHTS.tooltip.8=um Buedem Leien. + +# Performance + +of.options.SMOOTH_FPS=Stabil FPS +of.options.SMOOTH_FPS.tooltip.1=Stabiliséiert FPS duerch eidel maache +of.options.SMOOTH_FPS.tooltip.2=vum Grafikdreiwerpuffer +of.options.SMOOTH_FPS.tooltip.3= Aus - keng Stabilisatioun, FPS kënnen onstabil sinn +of.options.SMOOTH_FPS.tooltip.4= Un - FPS stabiliséiert +of.options.SMOOTH_FPS.tooltip.5=Dës Optioun hänkt vun de Grafikdreiwer of an d'Effekter +of.options.SMOOTH_FPS.tooltip.6=sinn net ëmmer siichtbar. + +of.options.SMOOTH_WORLD=Welt Stabiliséierung +of.options.SMOOTH_WORLD.tooltip.1=Hellt Lag Spëtzten déi duerch den interne Server +of.options.SMOOTH_WORLD.tooltip.2=verursaacht gi fort. +of.options.SMOOTH_WORLD.tooltip.3= Aus - keng Stabilisatioun, FPS kënnen onstabil sinn +of.options.SMOOTH_WORLD.tooltip.4= Un - FPS stabiliséiert +of.options.SMOOTH_WORLD.tooltip.5=Stabiliséiert FPS duerch verdeele vun der Laascht ob +of.options.SMOOTH_WORLD.tooltip.6=den interne Server. +of.options.SMOOTH_WORLD.tooltip.7=Nëmmen effektiv am Singleplayer. + +of.options.FAST_RENDER=Schnellt Renderen +of.options.FAST_RENDER.tooltip.1=Schnellt Renderen +of.options.FAST_RENDER.tooltip.2= Aus - Standard-Renderen (Standard) +of.options.FAST_RENDER.tooltip.3= Un - optiméiert Renderen (méi schnell) +of.options.FAST_RENDER.tooltip.4=Benotzt een optimiséierte Renderalgorithmus dee GPU +of.options.FAST_RENDER.tooltip.5=Laascht verklengert an domadder méi héich FPS +of.options.FAST_RENDER.tooltip.6=erméiglecht. + +of.options.FAST_MATH=Schnell Mathematik +of.options.FAST_MATH.tooltip.1=Schnell Mathematik +of.options.FAST_MATH.tooltip.2= Aus - Standard-Mathematik (Standard) +of.options.FAST_MATH.tooltip.3= Un - schnell Mathematik +of.options.FAST_MATH.tooltip.4=Benotzt optiméiert sin() a cos() Funktiounen déi de +of.options.FAST_MATH.tooltip.5=CPU cache stabiliséieren a méi héich FPS erméiglechen. + +of.options.CHUNK_UPDATES=Chunk Updates +of.options.CHUNK_UPDATES.tooltip.1=Chunk Updates +of.options.CHUNK_UPDATES.tooltip.2= 1 - luest Luede vun der Welt, héich FPS (Standard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - schnellt Luede vun der Welt, manner FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - schnellst Luede vun der Welt, am mannste FPS +of.options.CHUNK_UPDATES.tooltip.5=Unzuel vu Chunk Updates pro gerendert Bild. +of.options.CHUNK_UPDATES.tooltip.6=Méi héicht Wäerter kënnen d'Billerunzuel destabiliséieren. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamesch Updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamesch Chunk Updates +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Aus - (Standard) Standard Chunk Updates pro Bild +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Un - méi Updates wann de Spiller roueg steet +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamesch Updates forcéiert méi Chunk Updates während +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=de Spiller roueg steet fir d'Welt méi schnell ze lueden. + +of.options.LAZY_CHUNK_LOADING=Faulenzeg Chunklueden +of.options.LAZY_CHUNK_LOADING.tooltip.1=Faulenzeg Chunklueden +of.options.LAZY_CHUNK_LOADING.tooltip.2= Aus - normaalt Server-Chunklueden +of.options.LAZY_CHUNK_LOADING.tooltip.3= Un - faulenzeg Server-Chunklueden (méi fléissend) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Mécht datt d'integréiert Luede vun de Server-Chunks méi +of.options.LAZY_CHUNK_LOADING.tooltip.5=fléissend ass duerch Verdeelung vun de Chunks iwwer +of.options.LAZY_CHUNK_LOADING.tooltip.6=puer Ticks. Deaktivéier et wann Deeler vun der Welt net +of.options.LAZY_CHUNK_LOADING.tooltip.7=richteg lueden. Nëmmen effektiv am Singleplayer a bei +of.options.LAZY_CHUNK_LOADING.tooltip.8=engem Enzel-Kär CPU. + +# Animations + +of.options.animation.allOn=All un +of.options.animation.allOff=All aus +of.options.animation.dynamic=Dynamesch + +of.options.ANIMATED_WATER=Waasser animéiert +of.options.ANIMATED_LAVA=Lava animéiert +of.options.ANIMATED_FIRE=Féier animéiert +of.options.ANIMATED_PORTAL=Portal animéiert +of.options.ANIMATED_REDSTONE=Redstone animéiert +of.options.ANIMATED_EXPLOSION=Explosiounen animéiert +of.options.ANIMATED_FLAME=Flamen animéiert +of.options.ANIMATED_SMOKE=Damp animéiert +of.options.VOID_PARTICLES=Voidpartikel +of.options.WATER_PARTICLES=Waasserpartikel +of.options.RAIN_SPLASH=Reengeplätscher +of.options.PORTAL_PARTICLES=Portalpartikel +of.options.POTION_PARTICLES=Dronkpartikel +of.options.DRIPPING_WATER_LAVA=Waasser/Lavadrëpsen +of.options.ANIMATED_TERRAIN=Terrain animéiert +of.options.ANIMATED_TEXTURES=Texturen animéiert +of.options.FIREWORK_PARTICLES=Féierwierkpartikel + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Wéist de Lagometer um Debugbildschierm un (F3). +of.options.LAGOMETER.tooltip.2=* Orange - Memoiredrécksammlung +of.options.LAGOMETER.tooltip.3=* Turqoise - Tick +of.options.LAGOMETER.tooltip.4=* Blo - geplangten Ausféierungen +of.options.LAGOMETER.tooltip.5=* Mof - Chunk eroplueden +of.options.LAGOMETER.tooltip.6=* Roud - Chunk updaten +of.options.LAGOMETER.tooltip.7=* Giel - Siichtbarkeetstest +of.options.LAGOMETER.tooltip.8=* Gréng - Terrain rendern + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= Un - Debug Profiler ass aktiv, méi lues +of.options.PROFILER.tooltip.3= Aus - Debug Profiler ass net aktiv, méi schnell +of.options.PROFILER.tooltip.4=Den Debug Profiler sammel a weist Debug Informatiounen +of.options.PROFILER.tooltip.5=un wann den Debugbildschierm un ass (F3) + +of.options.WEATHER=Wieder +of.options.WEATHER.tooltip.1=Wieder +of.options.WEATHER.tooltip.2= Un - Wieder ass aktiv, méi lues +of.options.WEATHER.tooltip.3= Aus - Wieder ass net aktiv, méi schnell +of.options.WEATHER.tooltip.4=D'Wieder kontrolléiert de Reen, Schnéi an Donnerwieder. +of.options.WEATHER.tooltip.5=D'Wiederkontroll ass nëmmen am Singleplayer méiglech. + +of.options.time.dayOnly=Nëmmen Dag +of.options.time.nightOnly=Nëmmen Nuecht + +of.options.TIME=Zäit +of.options.TIME.tooltip.1=Zäit +of.options.TIME.tooltip.2= Standard - normalen Dag/Nuecht Zyklus +of.options.TIME.tooltip.3= Nëmmen Dag - Nëmmen Dag +of.options.TIME.tooltip.4= Nëmmen Nuecht - Nëmmen Nuecht +of.options.TIME.tooltip.5=D'Zäitastellunge sinn nëmmen effektiven am Kreativemodus +of.options.TIME.tooltip.6=an am Singleplayer. + +options.fullscreen.tooltip.1=Vollbild +options.fullscreen.tooltip.2= Un - benotz de Vollbildmodus +options.fullscreen.tooltip.3= Aus - benotz de Fenstermodus +options.fullscreen.tooltip.4=De Vollbildmodus ka méi schnell oder awer méi lues sinn +options.fullscreen.tooltip.5=wéi de Fenstermodus ofhängeg vun denger Grafikkaart. + +of.options.FULLSCREEN_MODE=Vollbildmodus +of.options.FULLSCREEN_MODE.tooltip.1=Vollbildmodus +of.options.FULLSCREEN_MODE.tooltip.2= Standard - benotz d'Desktop-Opléisung, méi lues +of.options.FULLSCREEN_MODE.tooltip.3= WxH - benotz eng eege Opléisung, ka méi schnell sinn +of.options.FULLSCREEN_MODE.tooltip.4=D'ausgewielten Opléisung gëtt am Vollbildmodus +of.options.FULLSCREEN_MODE.tooltip.5=benotzt (F11). +of.options.FULLSCREEN_MODE.tooltip.6=Eng méi eng geréng Opléisung sollt méi schnell sinn. + +of.options.SHOW_FPS=FPS uweisen +of.options.SHOW_FPS.tooltip.1=Weis kompriméiert FPS a Render Informatiounen +of.options.SHOW_FPS.tooltip.2= C: - gerendert Chunks +of.options.SHOW_FPS.tooltip.3= E: - gerendert Objet a Bléck +of.options.SHOW_FPS.tooltip.4= U: - Chunk Updates +of.options.SHOW_FPS.tooltip.5=D'kompakt FPS Informatioune ginn nëmmen ugewisen +of.options.SHOW_FPS.tooltip.6=wann de Debug-Bildschierm net siichtbar ass. + +of.options.save.default=Standard (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autospäicheren +of.options.AUTOSAVE_TICKS.tooltip.1=Autospäicher Intervall +of.options.AUTOSAVE_TICKS.tooltip.2=Den normalen Autospäicher Intervall (2s) ass net +of.options.AUTOSAVE_TICKS.tooltip.3=recommandéiert +of.options.AUTOSAVE_TICKS.tooltip.4=Autospäichere verursaacht de bekannte Lag vum Doud. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/pl_PL.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/pl_PL.lang new file mode 100644 index 0000000..11f91e5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/pl_PL.lang @@ -0,0 +1,586 @@ +# Contributors of Polish localization # +# Kamil7430 2016-03-14 -- 2017-03-12 # +# Puuska 2017.07.15 -- ????? # + +# General +of.general.ambiguous=dwuznaczny +of.general.custom=Inny +of.general.from=Od +of.general.id=Id +of.general.restart=restart +of.general.smart=Smart + +# Keys +of.key.zoom=Zoom (przybliżenie) + +# Message +of.message.aa.shaders1=Antyaliasing nie jest kompatybilny z Shaderami. +of.message.aa.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.af.shaders1=Filtrowanie anizotropowe nie jest kompatybilne z Shaderami. +of.message.af.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.fr.shaders1=Szybkie renderowanie nie jest kompatybilne z Shaderami. +of.message.fr.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.an.shaders1=Anaglifowe 3D nie jest kompatybilne z Shaderami. +of.message.an.shaders2=Proszę, wyłącz Shadery, aby używać tej opcji. + +of.message.shaders.aa1=Shadery nie są kompatybilne z antyaliasingiem. +of.message.shaders.aa2=Proszę, wyłącz opcję Jakość -> Antyaliasing, a następnie zrestartuj grę. + +of.message.shaders.af1=Shadery nie są kompatybilne z filtrowaniem anizotropowym. +of.message.shaders.af2=Proszę, wyłącz opcję Jakość -> Filtrowanie anizotropowe. + +of.message.shaders.fr1=Shadery nie są kompatybilne z szybkim renderowaniem. +of.message.shaders.fr2=Proszę, wyłącz opcję Wydajność -> Szybkie renderowanie. + +of.message.shaders.an1=Shadery nie są kompatybilne z anaglifowym 3D. +of.message.shaders.an2=Proszę, wyłącz opcję Inne -> Anaglifowe 3D. + +of.message.newVersion=Nowa wersja §eOptiFine§f jest dostępna: §e%s§f +of.message.java64Bit=Zalecamy zainstalowanie §e64-bitowego środowiska Java§f, aby podwyższyć wydajność. +of.message.openglError=§eBłąd OpenGL§f: %s (%s) + +of.message.shaders.loading=Wczytuję shadery: %s + +of.message.other.reset=Czy chcesz przywrócić wszystkie ustawienia graficzne do ich domyślnych wartości? + +of.message.loadingVisibleChunks=Wczytywanie widzialnych chunków + +# Video settings + +options.graphics.tooltip.1=Jakość grafiki +options.graphics.tooltip.2= Szybka - niższa jakość, większa wydajność +options.graphics.tooltip.3= Dokładna - wyższa jakość, mniejsza wydajność +options.graphics.tooltip.4=Zmienia wygląd chmur, liści, wody, +options.graphics.tooltip.5=cieni oraz boków bloków trawy. + +of.options.renderDistance.extreme=Ekstremalna + +options.renderDistance.tooltip.1=Odległość renderowania +options.renderDistance.tooltip.2= 2 Niewielka - 32m (najwyższa wydajność) +options.renderDistance.tooltip.3= 4 Krótka - 64m (wysoka wydajność) +options.renderDistance.tooltip.4= 8 Normalna - 128m +options.renderDistance.tooltip.5= 16 Długa - 256m (niska wydajność) +options.renderDistance.tooltip.6= 32 Ekstremalna - 512m (najniższa wydajność) +options.renderDistance.tooltip.7=Odległość renderowania ekstremalna jest bardzo zasobożerna! +options.renderDistance.tooltip.8=Wartości powyżej 16 Długa są zalecane tylko do lokalnych światów. + +options.ao.tooltip.1=Gładkie oświetlenie +options.ao.tooltip.2= Wył. - brak wygładzania oświetlenia (wysoka wydajność) +options.ao.tooltip.3= Min. - podstawowe wygładzanie oświetlenia (niska wydajność) +options.ao.tooltip.4= Maks. - pełne wygładzanie oświetlenia (najniższa wydajność) + +options.framerateLimit.tooltip.1=Limit klatek/s (FPS) +options.framerateLimit.tooltip.2= VSync - ograniczone do możliwości monitora (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - ograniczone do podanej wartości +options.framerateLimit.tooltip.4= Nielimitowane - brak limitu (najwyższa wydajność) +options.framerateLimit.tooltip.5=Limit klatek zmiejsza FPS, nawet, gdy wartość +options.framerateLimit.tooltip.6=graniczna nie została osiągnięta. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Poziom wygładzania oświetlenia +of.options.AO_LEVEL.tooltip.1=Poziom wygładzania oświetlenia +of.options.AO_LEVEL.tooltip.2= Wył. - brak cieni +of.options.AO_LEVEL.tooltip.3= 50%% - jasne cienie +of.options.AO_LEVEL.tooltip.4= 100%% - ciemne cienie + +options.viewBobbing.tooltip.1=Bardziej realistyczne poruszanie się. +options.viewBobbing.tooltip.2=Gdy uzywasz mipmap, wyłącz tę opcję, aby podwyższyć wydajność. + +options.guiScale.tooltip.1=Wielkość Interfejsu +options.guiScale.tooltip.2=Mniejszy interfejs może podwyższyć wydajność + +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Używa alternatywnej metody renderowania, która jest +options.vbo.tooltip.3=szybsza (o 5-10%%) niż zwykła metoda. + +options.gamma.tooltip.1=Podwyższa jasność ciemnych obiektów +options.gamma.tooltip.2= Nastrojowa - standardowa jasność +options.gamma.tooltip.3= 1%%-99%% - możliwość dostosowania jasności +options.gamma.tooltip.4= Jaskrawa - maksymalna jasność ciemnych obiektów +options.gamma.tooltip.5=Ta opcja nie podwyższa jasności obiektów, które +options.gamma.tooltip.6=są w pełni czarne. + +options.anaglyph.tooltip.1=Anaglify 3D +options.anaglyph.tooltip.2=Włącza stereoskopowy efekt 3D używając różnych kolorów +options.anaglyph.tooltip.3=dla każdego oka. +options.anaglyph.tooltip.4=Wymaga czerwono-niebieskich okularów. + +options.blockAlternatives.tooltip.1=Alternatywne bloki +options.blockAlternatives.tooltip.2=Używa alternatywnych modeli dla niektóych bloków. +options.blockAlternatives.tooltip.3=Bazowane na wybranyej paczce tekstur. + +of.options.ALTERNATE_BLOCKS=Alternatywne bloki +of.options.blockAlternatives.tooltip.1=Alternatywne bloki +of.options.blockAlternatives.tooltip.2=Używa alternatywnych modeli dla niektóych bloków. +of.options.blockAlternatives.tooltip.3=Bazowane na wybranyej paczce tekstur. + +of.options.FOG_FANCY=Mgła +of.options.FOG_FANCY.tooltip.1=Typ mgły +of.options.FOG_FANCY.tooltip.2= Szybka - szybka mgła +of.options.FOG_FANCY.tooltip.3= Dokładna - ładniejsza mgła, zmniejsza wydajność +of.options.FOG_FANCY.tooltip.4= Wył. - brak mgły, najwyższa wydajność +of.options.FOG_FANCY.tooltip.5=Dokładna mgła jest dostępna jedynie, jeżeli +of.options.FOG_FANCY.tooltip.6=obsługuje ją karta graficzna. + +of.options.FOG_START=Początkowa mgła +of.options.FOG_START.tooltip.1=Początkowa mgła +of.options.FOG_START.tooltip.2= 0.2 - mgła startuje w pobliżu gracza +of.options.FOG_START.tooltip.3= 0.8 - mgła startuje z dala od gracza +of.options.FOG_START.tooltip.4=Ta opcja zazwyczaj nie zmienia wydajności. + +of.options.CHUNK_LOADING=Ładowanie chunków +of.options.CHUNK_LOADING.tooltip.1=Ładowanie chunków +of.options.CHUNK_LOADING.tooltip.2= Domyślne - niestabilne FPS podczas ładowania chunków +of.options.CHUNK_LOADING.tooltip.3= Gładkie - stabilne FPS +of.options.CHUNK_LOADING.tooltip.4= Wielordzeniowe - stabilne FPS, 3 razy szybsze ładowanie świata +of.options.CHUNK_LOADING.tooltip.5=Opcje Gładkie i Wielordzeniowe zredukują +of.options.CHUNK_LOADING.tooltip.6=przycięcia spowodowane ładowaniem chunków. +of.options.CHUNK_LOADING.tooltip.7=Opcja Wielordzeniowe może trzykrotnie przyspieszyć ładowanie +of.options.CHUNK_LOADING.tooltip.8=oraz podwyższyć FPS używając dodatkowego rdzenia. +of.options.chunkLoading.smooth=Gładkie +of.options.chunkLoading.multiCore=Wielordzeniowe + +of.options.shaders=Shadery... +of.options.shadersTitle=Shadery + +of.options.shaders.packNone=Wyłączone +of.options.shaders.packDefault=Wewnętrzne + +of.options.shaders.ANTIALIASING=Antyaliasing +of.options.shaders.NORMAL_MAP=Normalna mapa +of.options.shaders.SPECULAR_MAP=Lustrzana mapa +of.options.shaders.RENDER_RES_MUL=Jakość renderowania +of.options.shaders.SHADOW_RES_MUL=Jakość cieni +of.options.shaders.HAND_DEPTH_MUL=Głębokość ręki +of.options.shaders.CLOUD_SHADOW=Cienie chmur +of.options.shaders.OLD_HAND_LIGHT=Stare oświetlanie ręki +of.options.shaders.OLD_LIGHTING=Stare oświetlanie +of.options.shaders.SHADER_PACK=Paczka shaderów + +of.options.shaders.shadersFolder=Folder na shadery +of.options.shaders.shaderOptions=Ustawienia shaderów... + +of.options.shaderOptionsTitle=Ustawienia shaderów + +of.options.quality=Jakość... +of.options.qualityTitle=Ustawienia jakości + +of.options.details=Detale... +of.options.detailsTitle=Ustawienia detali + +of.options.performance=Wydajność... +of.options.performanceTitle=Ustawienia wydajności + +of.options.animations=Animacje... +of.options.animationsTitle=Ustawienia animacji + +of.options.other=Inne... +of.options.otherTitle=Inne ustawienia + +of.options.other.reset=Przywróć domyślne ustawienia graficzne... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Dwuliniowe +of.options.mipmap.linear=Liniowy +of.options.mipmap.nearest=Najbliższy +of.options.mipmap.trilinear=Trójliniowy + +options.mipmapLevels.tooltip.1=Efekt wizualny, który sprawia, że odległe bloki wyglądają +options.mipmapLevels.tooltip.2=lepiej poprzez wygładzanie detali tekstur +options.mipmapLevels.tooltip.3= Wył. - brak wygładzania +options.mipmapLevels.tooltip.4= 1 - minimalne wygładzanie +options.mipmapLevels.tooltip.5= 4 - maksymalne wygładzanie +options.mipmapLevels.tooltip.6=Ta opcja nie ma wpływu na wydajność. + +of.options.MIPMAP_TYPE=Typ mipmapy +of.options.MIPMAP_TYPE.tooltip.1=Efekt wizualny, który sprawia, że odległe bloki wyglądają +of.options.MIPMAP_TYPE.tooltip.2=lepiej poprzez wygładzanie detali tekstur +of.options.MIPMAP_TYPE.tooltip.3= Najbliższy - szorstkie wygładzanie (najwyższa wydajność) +of.options.MIPMAP_TYPE.tooltip.4= Liniowy - normalne wygładzanie +of.options.MIPMAP_TYPE.tooltip.5= Dwuliniowy - ładne wygładzanie +of.options.MIPMAP_TYPE.tooltip.6= Trójliniowe - najładniejsze wygładzanie (najniższa wydajność) + + +of.options.AA_LEVEL=Antyaliasing +of.options.AA_LEVEL.tooltip.1=Antyaliasing +of.options.AA_LEVEL.tooltip.2= OFF - (domyślne) brak antyaliasingu (wyższa wydajność) +of.options.AA_LEVEL.tooltip.3= 2-16 - antyaliasing linii i rogów (nizsza wydajność) +of.options.AA_LEVEL.tooltip.4=Antyaliasing wygładza poszarpane linie i +of.options.AA_LEVEL.tooltip.5=ostre przejścia kolorów. +of.options.AA_LEVEL.tooltip.6=Gdy włączone, może mocno obniżyć ilość FPS. +of.options.AA_LEVEL.tooltip.7=Niektóre poziomy są nieobsługiwane przez niektóre karty graficzne. +of.options.AA_LEVEL.tooltip.8=Wymaga restartu! + +of.options.AF_LEVEL=Wygładzanie Anizotropowe +of.options.AF_LEVEL.tooltip.1=Wygładzanie anizotropowe +of.options.AF_LEVEL.tooltip.2= Wył. - (domyślne) standarowe detale tekstur (najwyższa wydajność) +of.options.AF_LEVEL.tooltip.3= 2-16 - ładniejsze detale w mipmapowanych teksturach (niższa wydajność) +of.options.AF_LEVEL.tooltip.4=Filtrowanie anizotropowe pokazuje detale w +of.options.AF_LEVEL.tooltip.5=mipmapowanych teksturach. +of.options.AF_LEVEL.tooltip.6=Gdy włączone, może mocno obniżyć FPS. + +of.options.CLEAR_WATER=Czysta woda +of.options.CLEAR_WATER.tooltip.1=Czysta woda +of.options.CLEAR_WATER.tooltip.2= Wł. - czysta, przezroczysta woda +of.options.CLEAR_WATER.tooltip.3= Wył. - domyślna woda + +of.options.RANDOM_MOBS=Losowe moby +of.options.RANDOM_MOBS.tooltip.1=Losowe tekstury mobów +of.options.RANDOM_MOBS.tooltip.2= Wył. - brak losowych tekstur mobów, wyższa wydajność +of.options.RANDOM_MOBS.tooltip.3= Wł. - włączone losowe tekstury mobów, niższa wydajność +of.options.RANDOM_MOBS.tooltip.4=Ta opcja używa losowych tekstur dla mobów w grze. +of.options.RANDOM_MOBS.tooltip.5=Wymaga paczki tesktur z wieloma teksturami dla jednego moba. + +of.options.BETTER_GRASS=Ładniejsza trawa +of.options.BETTER_GRASS.tooltip.1=Ładniejsza trawa +of.options.BETTER_GRASS.tooltip.2= Wył. - domyślne boki bloków trawy, najwyższa wydajność +of.options.BETTER_GRASS.tooltip.3= Szybka - pełne boki bloków trawy, niższa wydajność +of.options.BETTER_GRASS.tooltip.4= Dokładna - dynamiczne boki bloków trawy, najniższa wydajność + +of.options.BETTER_SNOW=Ładniejszy śnieg +of.options.BETTER_SNOW.tooltip.1=Ładniejszy śnieg +of.options.BETTER_SNOW.tooltip.2= Wył. - domyślny śnieg, wyższa wydajność +of.options.BETTER_SNOW.tooltip.3= Wł. - ładniejszy śnieg, mniejsza wydajność +of.options.BETTER_SNOW.tooltip.4=Pokazuje śnieg pod przezroczystymi blokami (płot, wysoka +of.options.BETTER_SNOW.tooltip.5=trawa) gdy graniczą ze śniegiem + +of.options.CUSTOM_FONTS=Własne czcionki +of.options.CUSTOM_FONTS.tooltip.1=Własne czcionki +of.options.CUSTOM_FONTS.tooltip.2= Wł. - używa innych czcionek (domyślne), niższa wydajność +of.options.CUSTOM_FONTS.tooltip.3= Wył. - używa domyślnej czcionki, wyższa wydajność +of.options.CUSTOM_FONTS.tooltip.4=Własne czcionki są często dodawane do +of.options.CUSTOM_FONTS.tooltip.5=paczek tekstur + +of.options.CUSTOM_COLORS=Własne kolory +of.options.CUSTOM_COLORS.tooltip.1=Własne kolory +of.options.CUSTOM_COLORS.tooltip.2= Wł. - używa własnych kolorów (domyślne), nizsza wydajność +of.options.CUSTOM_COLORS.tooltip.3= Wył. - uzywa domyślnych kolorów, wyższa wydajność +of.options.CUSTOM_COLORS.tooltip.4=Własne kolory są często dodawane do +of.options.CUSTOM_COLORS.tooltip.5=paczek tekstur + +of.options.SWAMP_COLORS=Bagienne kolory +of.options.SWAMP_COLORS.tooltip.1=Bagienne kolory +of.options.SWAMP_COLORS.tooltip.2= Wł. - używa kolorów bagiennych (domyślne), niższa wydajność +of.options.SWAMP_COLORS.tooltip.3= Wył. - nie używa kolorów baginnych, wyższa wydajność +of.options.SWAMP_COLORS.tooltip.4=Kolory bagienne są użwane na liściach, trawie, winoroślach oraz wodzie. + +of.options.SMOOTH_BIOMES=Gładkie biomy +of.options.SMOOTH_BIOMES.tooltip.1=Gładkie przejścia biomów +of.options.SMOOTH_BIOMES.tooltip.2= Wł. - gładkie przejścia biomów (domyślne), niższa wydajność +of.options.SMOOTH_BIOMES.tooltip.3= Wył. - brak gładkiego przejścia biomów, wyższa wydajność +of.options.SMOOTH_BIOMES.tooltip.4=Wygładzanie krawędzi biomów działa na zasadzie +of.options.SMOOTH_BIOMES.tooltip.5=gładkiego przejścia kolorów liści, winorośli, +of.options.SMOOTH_BIOMES.tooltip.6=wody oraz trawy. + +of.options.CONNECTED_TEXTURES=Połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.1=Połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.2= Wył. - brak połączonych tekstur (domyślne) +of.options.CONNECTED_TEXTURES.tooltip.3= Szybka - szybkie połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.4= Dokładna - ładne połączone tekstury +of.options.CONNECTED_TEXTURES.tooltip.5=Ta opcja łączy postawione obok siebie szkło, +of.options.CONNECTED_TEXTURES.tooltip.6=piaskowiec i biblioteczki. +of.options.CONNECTED_TEXTURES.tooltip.7=Połączone tekstury są pobierane z +of.options.CONNECTED_TEXTURES.tooltip.8=aktualnej paczki tekstur. + +of.options.NATURAL_TEXTURES=Naturalne tekstury +of.options.NATURAL_TEXTURES.tooltip.1=Naturalne tekstury +of.options.NATURAL_TEXTURES.tooltip.2= Wył. - brak naturalnych tekstur (domyślne) +of.options.NATURAL_TEXTURES.tooltip.3= Wł. - używa naturalnych tekstur +of.options.NATURAL_TEXTURES.tooltip.4=Ta opcja usuwa wyglądające jak siatka tekstury +of.options.NATURAL_TEXTURES.tooltip.5=stworzone poprzez używanie w kółko tej samej tekstury. +of.options.NATURAL_TEXTURES.tooltip.6=Ta opcje używa obróconych tekstur bloków. +of.options.NATURAL_TEXTURES.tooltip.7=Konfiguracja naturalnych tekstur jest pobierana +of.options.NATURAL_TEXTURES.tooltip.8=z aktualnej paczki tekstur. + +of.options.CUSTOM_SKY=Własne niebo +of.options.CUSTOM_SKY.tooltip.1=Własne niebo +of.options.CUSTOM_SKY.tooltip.2= Wł. - tekstury własnego nieba włączone (domyślne), niższa wydajność +of.options.CUSTOM_SKY.tooltip.3= Wył. - domyślne niebo, wyższa wydajność +of.options.CUSTOM_SKY.tooltip.4=Własne niebo jest pobierane +of.options.CUSTOM_SKY.tooltip.5=z aktualnej paczki tesktur. + +of.options.CUSTOM_ITEMS=Własne przedmioty +of.options.CUSTOM_ITEMS.tooltip.1=Własne przedmioty +of.options.CUSTOM_ITEMS.tooltip.2= Wł. - własne tekstury przedmiotów (domyślne), niższa wydajność +of.options.CUSTOM_ITEMS.tooltip.3= Wył. - domyślne tesktury przedmiotów, wyższa wydajność +of.options.CUSTOM_ITEMS.tooltip.4=Własne tekstury przedmiotów są pobierane +of.options.CUSTOM_ITEMS.tooltip.5=z aktualnej paczki tekstur. + +of.options.CUSTOM_ENTITY_MODELS=Własne modele mobów +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Własne modele mobów i innych podmiotów +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Wł. - opcja włączona (domyślne), wolniej +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Wył. - opcja wyłączona, szybciej +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Własne modele są pobierane z +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=aktualnej paczki tekstur. + +# Details + +of.options.CLOUDS=Chmury +of.options.CLOUDS.tooltip.1=Chmury +of.options.CLOUDS.tooltip.2= Domyślne - dopasowane do ustawienia graficznego +of.options.CLOUDS.tooltip.3= Szybka - niska jakość, wysoka wydajność +of.options.CLOUDS.tooltip.4= Dokładna - wyższa jakość, niska wydajność +of.options.CLOUDS.tooltip.5= Wył. - brak chmur, najwyższa wydajność +of.options.CLOUDS.tooltip.6=Szybkie chmury są renderowane w 2D. +of.options.CLOUDS.tooltip.7=Dokładne chmury są renderowane w 3D. + +of.options.CLOUD_HEIGHT=Wysokość chmur +of.options.CLOUD_HEIGHT.tooltip.1=Wyskość chmur +of.options.CLOUD_HEIGHT.tooltip.2= Wył. - domyślna wysokość +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - powyżej limitu wysokości świata + +of.options.TREES=Drzewa +of.options.TREES.tooltip.1=Drzewa +of.options.TREES.tooltip.2= Domyślne - dostosowane do ustawienia graficznego +of.options.TREES.tooltip.3= Szybka - niższa jakość, wyższa wydajność +of.options.TREES.tooltip.4= Smart - wyższa jakość, niższa wydajność +of.options.TREES.tooltip.5= Dokładna - najwyższa jakość, najniższa wydajność +of.options.TREES.tooltip.6=Szybkie drzewa mają wypełnione liście. +of.options.TREES.tooltip.7=Szybkie i smart drzewa mają przezroczyste liście. + +of.options.RAIN=Deszcz i śnieg +of.options.RAIN.tooltip.1=Deszcz i śnieg +of.options.RAIN.tooltip.2= Domyślne - dostosowane do ustawienia graficznego +of.options.RAIN.tooltip.3= Szybka - lekki deszcz/śnieg, wyższa wydajność +of.options.RAIN.tooltip.4= Dokładna - ciężki deszcz/śnieg, niższa wydajność +of.options.RAIN.tooltip.5= Wył. - brak deszczu/śniegu, najwyższa wydajność +of.options.RAIN.tooltip.6=Gdy deszcz jest wyłączony, dźwięki nadal +of.options.RAIN.tooltip.7=są aktywne. + +of.options.SKY=Niebo +of.options.SKY.tooltip.1=Niebo +of.options.SKY.tooltip.2= Wł. - niebo jest widoczne, niższa wydajność +of.options.SKY.tooltip.3= Wył. - niebo jest niewidoczne, wyższa wydajność +of.options.SKY.tooltip.4=Gdy niebo jest wyłączone, słońce i księżyc nadal są widoczne. + +of.options.STARS=Gwiazdy +of.options.STARS.tooltip.1=Gwiazdy +of.options.STARS.tooltip.2= Wł. - gwiazdy są widoczne, niższa wydajność +of.options.STARS.tooltip.3= Wył. - gwiazdy są niewidoczne, wyższa wydajność + +of.options.SUN_MOON=Słońce i Księżyc +of.options.SUN_MOON.tooltip.1=Słońce i Księżyc +of.options.SUN_MOON.tooltip.2= Wł. - słońce i księżyc są widoczne (domyślne) +of.options.SUN_MOON.tooltip.3= Wył. - słońce i księżyc są niewidoczne (wyższa wydajność) + +of.options.SHOW_CAPES=Pokazuj peleryny +of.options.SHOW_CAPES.tooltip.1=Pokazuj peleryny +of.options.SHOW_CAPES.tooltip.2= Wł. - pokazuje peleryny graczy (domyślne) +of.options.SHOW_CAPES.tooltip.3= Wył. - nie pokazuje peleryn graczy + +of.options.TRANSLUCENT_BLOCKS=Prześwitujące bloki +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Prześwitujące bloki +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Dokładna - poprawne mieszanie kolorów (domyślne) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Szybka - szybkie mieszanie kolorów (wyższa wydajność) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Kontroluje mieszanie kolorów bloków przezroczystych +of.options.TRANSLUCENT_BLOCKS.tooltip.5=w różnych kolorach (utawrdzone szkło, woda, lód) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=gdy pod nimi są bloki inne niż powietrze. + +of.options.HELD_ITEM_TOOLTIPS=Nazwy trzym. przedm. +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Nazwy trzymanych przedmiotów nad interfejsem +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Wł. - pokazuj nazwy przedmiotów (domyślne) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Wył. - nie pokazuj nazw przedmiotów + +of.options.ADVANCED_TOOLTIPS=Dokładne dane przedmiotów +of.options.ADVANCED_TOOLTIPS.tooltip.1=Dokładne dane przedmiotów, bloków oraz narzędzi +of.options.ADVANCED_TOOLTIPS.tooltip.2= Wł. - pokazuj dokładne dane +of.options.ADVANCED_TOOLTIPS.tooltip.3= Wył. - nie pokazuj dokładnych danych (domyślne) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Ta opcja pokazuje więcej informacji o dowolnym +of.options.ADVANCED_TOOLTIPS.tooltip.5=przedmiocie (id, wytrzymałość), a także dane o nim +of.options.ADVANCED_TOOLTIPS.tooltip.6=dla shaderów (id, źródło, domyślna wartość). + +of.options.DROPPED_ITEMS=Upuszczone przedmioty +of.options.DROPPED_ITEMS.tooltip.1=Upuszczone przedmioty +of.options.DROPPED_ITEMS.tooltip.2= Domyślne - przystosowane do ustawienia graficznego +of.options.DROPPED_ITEMS.tooltip.3= Szybka - upuszczone przedmioty w 2D, wyższa wydajność +of.options.DROPPED_ITEMS.tooltip.4= Dokładna - upuszczone przedmioty w 3D, niższa wydajność + +options.entityShadows.tooltip.1=Cienie bytów +options.entityShadows.tooltip.2= Wł. - Włącza cienie pod bytami +options.entityShadows.tooltip.3= Wył. - Wyłącza cienie pod bytami + +of.options.VIGNETTE=Winieta +of.options.VIGNETTE.tooltip.1=Efekt wizualny, który delikatnie przyciemnia rogi ekranu +of.options.VIGNETTE.tooltip.2= Domyślne - dostosowane do ustawienia graficznego (domyślne) +of.options.VIGNETTE.tooltip.3= Szybka - winieta wyłączona (wyższa wydajność) +of.options.VIGNETTE.tooltip.4= Dokładna - winieta włączona (niższa wydajność) +of.options.VIGNETTE.tooltip.5=Winieta może w małym stopniu obniżyć FPS, +of.options.VIGNETTE.tooltip.6=szczególnie przy grze na pełnym ekranie. +of.options.VIGNETTE.tooltip.7=Efekt winiety jest subtelny i może być +of.options.VIGNETTE.tooltip.8=bezproblemowo wyłączony. + +of.options.DYNAMIC_FOV=Dynamiczny FOV +of.options.DYNAMIC_FOV.tooltip.1=Dynamiczne FOV +of.options.DYNAMIC_FOV.tooltip.2= Wł. - włącza dynamiczny FOV (domyślne) +of.options.DYNAMIC_FOV.tooltip.3= Wył. - wyłącza dynamiczny FOV +of.options.DYNAMIC_FOV.tooltip.4=Zmienia pole widzenia (FOV), gdy latasz +of.options.DYNAMIC_FOV.tooltip.5=sprintujesz lub naciągasz łuk. + +of.options.DYNAMIC_LIGHTS=Dynamiczne światło +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamiczne światło +of.options.DYNAMIC_LIGHTS.tooltip.2= Wył. - funkcja dynamicznego światła wyłączona (domyślne) +of.options.DYNAMIC_LIGHTS.tooltip.3= Szybka - proste dynamiczne światła - aktualizowane co 500ms +of.options.DYNAMIC_LIGHTS.tooltip.4= Dokładna - zaawansowane dynamiczne światło - aktualizowane na bieżąco +of.options.DYNAMIC_LIGHTS.tooltip.5=Przedmioty świecące (pochodnia, jasnopył, itp.) +of.options.DYNAMIC_LIGHTS.tooltip.6=oświetlają teren, gdy są w Twojej dłoni, +of.options.DYNAMIC_LIGHTS.tooltip.7=dłoni innego gracza lub gdy są upuszczone na podłoże. + +# Performance + +of.options.SMOOTH_FPS=Stabilne FPS +of.options.SMOOTH_FPS.tooltip.1=Stablilizuje FPS poprzez oczyszczanie buforów sterownika +of.options.SMOOTH_FPS.tooltip.2= Wył. - brak stabilizacji, FPS mogą oscylować +of.options.SMOOTH_FPS.tooltip.3= Wł. - FPS jest stabilizowane +of.options.SMOOTH_FPS.tooltip.4=Ta opcja jest zależna od karty graficznej, więc +of.options.SMOOTH_FPS.tooltip.5=różnica nie zawsze może być zauważalna + +of.options.SMOOTH_WORLD=Stabilny świat +of.options.SMOOTH_WORLD.tooltip.1=Usuwa nagłe lagi spowodowane serwerem wewnętrznym. +of.options.SMOOTH_WORLD.tooltip.2= Wył. - brak stabilizacji, FPS mogą oscylować +of.options.SMOOTH_WORLD.tooltip.3= Wł. - FPS jest stabilizowane +of.options.SMOOTH_WORLD.tooltip.4=Stabilizuje FPS poprzez rozdzielenie obciążenia wewnętrznego serwera. +of.options.SMOOTH_WORLD.tooltip.5=Działa tylko w lokalnych światach (tryb jednoosobowy). + +of.options.FAST_RENDER=Szybkie renderowanie +of.options.FAST_RENDER.tooltip.1=Szybkie renderowanie +of.options.FAST_RENDER.tooltip.2= Wył. - standardowe rederowanie (domyślne) +of.options.FAST_RENDER.tooltip.3= Wł. - zoptymalizowane renderowanie (wyższa wydajność) +of.options.FAST_RENDER.tooltip.4=Używa zoptymalizowanego algorytmu renderowania, który zmniejsza +of.options.FAST_RENDER.tooltip.5=obciązenie CPU, a tym samym zwiększa FPS. + +of.options.FAST_MATH=Szybka matematyka +of.options.FAST_MATH.tooltip.1=Szybka matematyka +of.options.FAST_MATH.tooltip.2= Wył. - standardowa matematyka (domyślne) +of.options.FAST_MATH.tooltip.3= Wł. - przyspieszona matematyka +of.options.FAST_MATH.tooltip.4=Używa zoptymalizowanych działań sin() i cos(), które +of.options.FAST_MATH.tooltip.5=lepiej wykorzystują pamięć procesora i zwiększa FPS. + +of.options.CHUNK_UPDATES=Aktualizacje chunków +of.options.CHUNK_UPDATES.tooltip.1=Aktualizacje chunków +of.options.CHUNK_UPDATES.tooltip.2= 1 - wolniejsze wczytywanie świata, więcej FPS (domyślne) +of.options.CHUNK_UPDATES.tooltip.3= 3 - szybsze wczytywanie świata, mniej FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - najszybsze wczytywanie świata, najmniej FPS +of.options.CHUNK_UPDATES.tooltip.5=Liczba aktualizowanych chunków na klatkę, +of.options.CHUNK_UPDATES.tooltip.6=większa ilość może zmniejszyć stabilność FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamiczne Aktualizacje +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamiczne aktualizacje chunków +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Wył. - (domyślne) standardowa aktualizacja chunków na klatkę +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Wł. - więcej aktualizacji, gdy gracz stoi w miejscu +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamiczna aktualizacja wczytuje więcej chunków, +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=gdy gracz stoi w miejscu, aby szybciej załadować świat. + +of.options.LAZY_CHUNK_LOADING=Leniwe ładow. chunków +of.options.LAZY_CHUNK_LOADING.tooltip.1=Leniwe ładowanie chunków +of.options.LAZY_CHUNK_LOADING.tooltip.2= Wył. - domyślne wczytywanie chunków na serwerze +of.options.LAZY_CHUNK_LOADING.tooltip.3= Wł. - leniwe ładowanie chunków na serwerze (płynniej) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Wygładza zintegrowane ładowanie serwerowych chunków +of.options.LAZY_CHUNK_LOADING.tooltip.5=rozdzielając chunki na kilka ticków. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Wyłącz to, jeżeli części świata nie ładują się prawidłowo. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efektyne tylko na lokalnych światach i jednordzeniowych komputerach. + +# Animations + +of.options.animation.allOn=Włącz wszystko +of.options.animation.allOff=Wyłącz wszystko +of.options.animation.dynamic=Dynamicznie + +of.options.ANIMATED_WATER=Animacja wody +of.options.ANIMATED_LAVA=Animacja lawy +of.options.ANIMATED_FIRE=Animacja ognia +of.options.ANIMATED_PORTAL=Animacja portali +of.options.ANIMATED_REDSTONE=Animacja czerwonego proszku +of.options.ANIMATED_EXPLOSION=Animacja eksplozji +of.options.ANIMATED_FLAME=Animacja płomieni +of.options.ANIMATED_SMOKE=Animacja dymu +of.options.VOID_PARTICLES=Cząsteczki próżni +of.options.WATER_PARTICLES=Cząsteczki wody +of.options.RAIN_SPLASH=Cząsteczki deszczu +of.options.PORTAL_PARTICLES=Cząsteczki portali +of.options.POTION_PARTICLES=Cząsteczki mikstur +of.options.DRIPPING_WATER_LAVA=Kapiąca woda/lawa +of.options.ANIMATED_TERRAIN=Animacja terenu +of.options.ANIMATED_TEXTURES=Animacja tekstur +of.options.FIREWORK_PARTICLES=Cząsteczki fajerwerków + +# Other + +of.options.LAGOMETER=Lagomierz +of.options.LAGOMETER.tooltip.1=Pokazuje lagomierz na ekranie debugowania (F3). +of.options.LAGOMETER.tooltip.2=* Pomarańczowy - Zajęta pamięć +of.options.LAGOMETER.tooltip.3=* Błękitny - Ticki +of.options.LAGOMETER.tooltip.4=* Niebieski - Zaplanowane działania +of.options.LAGOMETER.tooltip.5=* Fioletowy - Przesyłanie chunków +of.options.LAGOMETER.tooltip.6=* Czerwony - Aktualizacje chunków +of.options.LAGOMETER.tooltip.7=* Żółty - Kontrola widoczności +of.options.LAGOMETER.tooltip.8=* Zielony - Renderowanie terenu + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= Wł. - debug profiler jest aktywny, niższa wydajność +of.options.PROFILER.tooltip.3= Wył. - debug profiler jest nieaktywny, wyższa wydajność +of.options.PROFILER.tooltip.4=Debug profiler zbiera i pokazuje informacje debugowania, +of.options.PROFILER.tooltip.5=gdy ekran debugowania jest włączony. (F3) + +of.options.WEATHER=Pogoda +of.options.WEATHER.tooltip.1=Pogoda +of.options.WEATHER.tooltip.2= Wł. - pogoda jest aktywna, niższa wydajność +of.options.WEATHER.tooltip.3= Wył. - pogoda jest nieaktywna, wyższa wydajność +of.options.WEATHER.tooltip.4=Pogoda kontroluje słońce, deszcz i burzę. +of.options.WEATHER.tooltip.5=Kontrola pogody jest aktywna tylko w trybie jednoosobowym. + +of.options.time.dayOnly=Tylko dzień +of.options.time.nightOnly=Tylko noc + +of.options.TIME=Czas +of.options.TIME.tooltip.1=Ustawienia cyklu dnia i nocy +of.options.TIME.tooltip.2= Domyślne - normalny cykl dnia i nocy +of.options.TIME.tooltip.3= Jedynie dzień - czas zatryma się na dniu +of.options.TIME.tooltip.4= Jedynie noc - czas zatrzyma się na nocy +of.options.TIME.tooltip.5=To ustawienie działa tylko w trybie kreatywnym +of.options.TIME.tooltip.6=i tylko w lokalnych światach. + +options.fullscreen.tooltip.1=Pełny ekran +options.fullscreen.tooltip.2= Wł. - uzywa trybu pełny ekran +options.fullscreen.tooltip.3= Wył. - używa trybu okienkowego +options.fullscreen.tooltip.4=Tryb pełnoekranowy może być szybszy lub wolniejszy +options.fullscreen.tooltip.5=niż tryb okienkowy, w zależności od karty graficznej. + +of.options.FULLSCREEN_MODE=Tryb pełnego ekranu +of.options.FULLSCREEN_MODE.tooltip.1=Tryby pełnego ekranu +of.options.FULLSCREEN_MODE.tooltip.2= Domyślne - używa rozdzielczości pulpitu, niższa wydajność +of.options.FULLSCREEN_MODE.tooltip.3= WxH - używa wybranej rozdzielczości, może podwyższyć wydajność +of.options.FULLSCREEN_MODE.tooltip.4=Wybrana rozdzielczość jest używana w trybie pełnoekranowym (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Niższe rozdzielczości mogą przyspieszyć grę. + +of.options.SHOW_FPS=Pokazuj FPS +of.options.SHOW_FPS.tooltip.1=Pokazuje kompaktową nakładkę FPS i informacje o renderowaniu +of.options.SHOW_FPS.tooltip.2= C: - renderzy chunków +of.options.SHOW_FPS.tooltip.3= E: - zrenderowane byty + bloki +of.options.SHOW_FPS.tooltip.4= U: - aktualizacje chunków +of.options.SHOW_FPS.tooltip.5=Ta nakładka jest wyświetlana tylko wtedy, +of.options.SHOW_FPS.tooltip.6=gdy ekran debugowania jest niewidoczny. + +of.options.save.default=Domyślne (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autozapis +of.options.AUTOSAVE_TICKS.tooltip.1=Częstotliwość autozapisu +of.options.AUTOSAVE_TICKS.tooltip.2=Domyślna częstotliwość (2s) jest NIEZALECANA. +of.options.AUTOSAVE_TICKS.tooltip.3=Autozapisy często powodują ścięcia gry. + +of.options.SCREENSHOT_SIZE=Rozmiar zrzutów ekranu +of.options.SCREENSHOT_SIZE.tooltip.1=Rozmiar zrzutów ekranu +of.options.SCREENSHOT_SIZE.tooltip.2= Domyślne - domyślny rozmiar +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - własny rozmiar +of.options.SCREENSHOT_SIZE.tooltip.4=Zapisywanie większych zrzutów może wymagać więcej pamięci, +of.options.SCREENSHOT_SIZE.tooltip.5=opcja nie jest kompatybilna z szybkim renderowaniem ani +of.options.SCREENSHOT_SIZE.tooltip.6=antyaliasingiem. Wymaga wsparcia bufora ramki GPU. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/pt_br.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/pt_br.lang new file mode 100644 index 0000000..a8d04d3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/pt_br.lang @@ -0,0 +1,588 @@ +# Contributor/translator of Portuguese localization +# Inky1003 08-30-2017 + +# General +of.general.ambiguous=ambíguo +of.general.custom=Personalizado +of.general.from=De +of.general.id=ID +of.general.restart=reiniciar +of.general.smart=Inteligente + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Antialiasing não é compatível com Shaders. +of.message.aa.shaders2=Por favor, desative-o para usar esta opção. + +of.message.af.shaders1=A Filtragem Ansiltrópica não é compatível com Shaders. +of.message.af.shaders2=Por favor, desative-o para ativar esta opção. + +of.message.fr.shaders1=A Renderização Rápida não é compatível com Shaders. +of.message.fr.shaders2=Por favor, desative-o para ativar esta opção. + +of.message.an.shaders1=3D Anaglífico não é compatível com Shaders. +of.message.an.shaders2=Por favor, desative-o para ativar esta opção. + +of.message.shaders.aa1=O Shaders não é compatível com Antialiasing. +of.message.shaders.aa2=Vá em Qualidade, desative o Antialiasing e reinicie o jogo. + +of.message.shaders.af1=O Shaders não é compatível com a Filtragem Ansiltrópica. +of.message.shaders.af2=Vá em Qualidade e desative a Filtragem Ansiltrópica. + +of.message.shaders.fr1=O Shaders não é compatível com a Renderização Rápida. +of.message.shaders.fr2=Vá em qualidade e desative a Renderização Rápida. + +of.message.shaders.an1=Shaders não é compatível com o 3D Anaglífico. +of.message.shaders.an2=Vá em Outros e desative o 3D Anaglífico. + +of.message.newVersion=Uma nova versão do §eOptiFine§f está disponível: a §e%s§f +of.message.java64Bit=Você pode instalar o §eJava de 64-bit§f para ampliar o desempenho. +of.message.openglError=§eErro do OpenGL§f: %s (%s) + +of.message.shaders.loading=Carregando Shaders: %s + +of.message.other.reset=Reiniciar todas as configurações de vídeo para seus valores padrões? + +of.message.loadingVisibleChunks=Carregando chunks visíveis + +# Video settings + +options.graphics.tooltip.1=Qualidade visual +options.graphics.tooltip.2= Rápida - menor qualidade, rápido +options.graphics.tooltip.3= Bonita - maior qualidade, lento +options.graphics.tooltip.4=Muda a aparência de nuvens, folhas, água, +options.graphics.tooltip.5=sombras e grama. + +of.options.renderDistance.tiny=Mínima +of.options.renderDistance.short=Pequena +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Longa +of.options.renderDistance.extreme=Máxima + +options.renderDistance.tooltip.1=Distância visível +options.renderDistance.tooltip.2= 2 Mínima - 32m (muito rápido) +options.renderDistance.tooltip.3= 4 Pequena - 64m (rápido) +options.renderDistance.tooltip.4= 8 Normal - 128m +options.renderDistance.tooltip.5= 16 Longa - 256m (lento) +options.renderDistance.tooltip.6= 32 Máxima - 512m (muito lento!) +options.renderDistance.tooltip.7=A distância Máxima exige muitos recursos! +options.renderDistance.tooltip.8=Valores acima de 16 Longa funcionam apenas no Singleplayer. + +options.ao.tooltip.1=Iluminação Suave +options.ao.tooltip.2= Desligado - sem iluminação suave (rápido) +options.ao.tooltip.3= Mínima - iluminação simples (lento) +options.ao.tooltip.4= Máximo - iluminação refinada (muito lento) + +options.framerateLimit.tooltip.1=Limite de FPS +options.framerateLimit.tooltip.2= VSync - Limita a taxa de FPS (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variável +options.framerateLimit.tooltip.4= Ilimitado - ilimitado (rápido) +options.framerateLimit.tooltip.5=A taxa de FPS cairá se o valor definido +options.framerateLimit.tooltip.6=não for atingido. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Nível da iluminação suave +of.options.AO_LEVEL.tooltip.1=Nível da iluminação suave +of.options.AO_LEVEL.tooltip.2= Desl. - Sem sombras +of.options.AO_LEVEL.tooltip.3= 50%% - sombras claras +of.options.AO_LEVEL.tooltip.4= 100%% - sombras escuras + +options.viewBobbing.tooltip.1=Movimentos mais realistas. +options.viewBobbing.tooltip.2=Quando usando mipmaps, desative essa opção para melhores resultados. + +options.guiScale.tooltip.1=Escala da Interface +options.guiScale.tooltip.2= Automática - maior possível +options.guiScale.tooltip.3= Pequeno, Normal, Grande - 1x para 3x +options.guiScale.tooltip.4= 4x para 10x - disponível em monitores 4K +options.guiScale.tooltip.5=Valores estranhos (1x, 3x, 5x ...) Não são compatíveis com unicode. +options.guiScale.tooltip.6=Uma pequena interface pode ampliar o desempenho. + +options.vbo.tooltip.1=Armazenamento de objetos Vertex +options.vbo.tooltip.2=Usa um modelo de renderização que é +options.vbo.tooltip.3=mais rápido (5-10%%) do que o modelo normal. + +options.gamma.tooltip.1=Muda o brilho de objetos escuros. +options.gamma.tooltip.2= Escuro - brilho normal +options.gamma.tooltip.3= 1-99%% - variável +options.gamma.tooltip.4= Claro - maior brilho para objetos escuros +options.gamma.tooltip.5=Essa opção não clareia +options.gamma.tooltip.6=objetos totalmente negros. + +options.anaglyph.tooltip.1=3D Anaglífico +options.anaglyph.tooltip.2=Ativa um Efeito 3D Esteroscópico usando cores diferentes +options.anaglyph.tooltip.3=para cada olho. +options.anaglyph.tooltip.4=É necessário um óculos vermelho-ciano para ver melhor. + +of.options.ALTERNATE_BLOCKS=Blocos alternados +of.options.ALTERNATE_BLOCKS.tooltip.1=Blocos alternados +of.options.ALTERNATE_BLOCKS.tooltip.2=Usa modelos alternados para alguns blocos. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depende da textura escolhida pelo jogador. + +of.options.FOG_FANCY=Névoa +of.options.FOG_FANCY.tooltip.1=Tipo de névoa +of.options.FOG_FANCY.tooltip.2= Rápida - não reduz a taxa de FPS. +of.options.FOG_FANCY.tooltip.3= Suave - reduz a taxa de FPS. +of.options.FOG_FANCY.tooltip.4= Desligada - sem névoa +of.options.FOG_FANCY.tooltip.5=A névoa suave estará disponível apenas se sua placa +of.options.FOG_FANCY.tooltip.6=de vídeo permitir. + +of.options.FOG_START=Início da névoa +of.options.FOG_START.tooltip.1=Início da névoa +of.options.FOG_START.tooltip.2= 0.2 - a névoa começa perto de você +of.options.FOG_START.tooltip.3= 0.8 - a névoa começa longe de você +of.options.FOG_START.tooltip.4=Normalmente, essa opção não altera o desempenho. + +of.options.CHUNK_LOADING=Carregamento de chunks +of.options.CHUNK_LOADING.tooltip.1=Carregamento de chunks +of.options.CHUNK_LOADING.tooltip.2= Padrão - FPS instável quando os chunks carregam +of.options.CHUNK_LOADING.tooltip.3= Suave - FPS estável +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - FPS estável e carregamento 3x+ rápido +of.options.CHUNK_LOADING.tooltip.5=Smooth e Multi-Core reduzem a latência +of.options.CHUNK_LOADING.tooltip.6=causada pelo carregamento de chunks. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core pode aumentar em 3 vezes o carregamento +of.options.CHUNK_LOADING.tooltip.8=e o FPS usando outro processador. +of.options.chunkLoading.smooth=Suave +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=OFF +of.options.shaders.packDefault=(interno do Optifine) + +of.options.shaders.ANTIALIASING=Antialiasing +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.RENDER_RES_MUL=Qualidade de renderização +of.options.shaders.SHADOW_RES_MUL=Qualidade da sombra +of.options.shaders.HAND_DEPTH_MUL=Hand Depth +of.options.shaders.CLOUD_SHADOW=Sombra das nuvens +of.options.shaders.OLD_HAND_LIGHT=Old Hand Light +of.options.shaders.OLD_LIGHTING=Old Lighting +of.options.shaders.SHADER_PACK=Shader Pack + +of.options.shaders.shadersFolder=Pasta do Shaders +of.options.shaders.shaderOptions=Opções do Shaders... + +of.options.shaderOptionsTitle=Opções do Shaders + +of.options.quality=Qualidade... +of.options.qualityTitle=Configurações de Qualidade + +of.options.details=Detalhes... +of.options.detailsTitle=Configurações de Detalhes + +of.options.performance=Desempenho... +of.options.performanceTitle=Configurações de Desempenho + +of.options.animations=Animações... +of.options.animationsTitle=Configurações de Animação + +of.options.other=Outras... +of.options.otherTitle=Outras configurações + +of.options.other.reset=Reiniciar configurações de vídeo... + +of.shaders.profile=Perfil + +# Quality + +of.options.mipmap.bilinear=Bilinear +of.options.mipmap.linear=Linear +of.options.mipmap.nearest=Nearest +of.options.mipmap.trilinear=Trilinear + +options.mipmapLevels.tooltip.1=Efeito visual que melhora a aparência de objetos distantes, +options.mipmapLevels.tooltip.2=suavizando os detalhes das texturas +options.mipmapLevels.tooltip.3= Desl. - Nenhuma suavização +options.mipmapLevels.tooltip.4= 1 - Suavização mínima +options.mipmapLevels.tooltip.5= 4 - Suavização máxima +options.mipmapLevels.tooltip.6=Essa opção não afeta o desempenho. + +of.options.MIPMAP_TYPE=Tipo de mipmap +of.options.MIPMAP_TYPE.tooltip.1=Efeito visual que melhora a aparência de objetos distantes, +of.options.MIPMAP_TYPE.tooltip.2=suavizando os detalhes das texturas +of.options.MIPMAP_TYPE.tooltip.3= Nearest - suavização ruim (rápida) +of.options.MIPMAP_TYPE.tooltip.4= Linear - suavização normal +of.options.MIPMAP_TYPE.tooltip.5= Bilinear - suavização fina +of.options.MIPMAP_TYPE.tooltip.6= Trilinear - suavização mais fina (lentA) + + +of.options.AA_LEVEL=Antialiasing +of.options.AA_LEVEL.tooltip.1=Antialiasing +of.options.AA_LEVEL.tooltip.2= OFF. - (padrão) sem antialiasing (rápido) +of.options.AA_LEVEL.tooltip.3= 2-16 - linhas e bordas antializadas (lento) +of.options.AA_LEVEL.tooltip.4=O Antialising suaviza linhas irregulares e +of.options.AA_LEVEL.tooltip.5=transição de cores. +of.options.AA_LEVEL.tooltip.6=Quando ativada, pode reduzir a taxa de FPS. +of.options.AA_LEVEL.tooltip.7=Nem todos os níveis acima são suportados por todas as placas de vídeo. +of.options.AA_LEVEL.tooltip.8=REINICIE ao alterar! + +of.options.AF_LEVEL=Filtragem Ansiltrópica +of.options.AF_LEVEL.tooltip.1=Filtragem Ansiltrópica +of.options.AF_LEVEL.tooltip.2= OFF. - (padrão) detalhes da textura padrão (rápido) +of.options.AF_LEVEL.tooltip.3= 2-16 - melhores detalhes em texturas de mipmap (lento) +of.options.AF_LEVEL.tooltip.4=A Filtragem Ansiltrópica restaura detalhes em +of.options.AF_LEVEL.tooltip.5=texturas de mimpmap. +of.options.AF_LEVEL.tooltip.6=Quando ativada, pode reduzir a taxa de FPS. + +of.options.CLEAR_WATER=Água límpida +of.options.CLEAR_WATER.tooltip.1=Água límpida +of.options.CLEAR_WATER.tooltip.2= Ligado - água clara e transparente +of.options.CLEAR_WATER.tooltip.3= Desligado - água normal + +of.options.RANDOM_MOBS=Mobs Aleatórios +of.options.RANDOM_MOBS.tooltip.1=Mobs Aleatórios +of.options.RANDOM_MOBS.tooltip.2= Desligado - sem mobs aleatórios, rápido +of.options.RANDOM_MOBS.tooltip.3= Ligado - mobs aleatórios, lento +of.options.RANDOM_MOBS.tooltip.4=Essa opção muda as texturas aleatórias dos mobs do jogo. +of.options.RANDOM_MOBS.tooltip.5=É necessário uma textura com múltiplas texturas de mobs. + +of.options.BETTER_GRASS=Grama Suavizada +of.options.BETTER_GRASS.tooltip.1=Grama Suavizada +of.options.BETTER_GRASS.tooltip.2= OFF. - textura normal da grama, rápido +of.options.BETTER_GRASS.tooltip.3= Rápido - textura refinada da grama, lento +of.options.BETTER_GRASS.tooltip.4= Bonito - textura dinâmica da grama, mais lento + +of.options.BETTER_SNOW=Neve Suavizada +of.options.BETTER_SNOW.tooltip.1=Neve Suavizada +of.options.BETTER_SNOW.tooltip.2= OFF - neve normal, rápido +of.options.BETTER_SNOW.tooltip.3= Ligado - neve refinada, lento +of.options.BETTER_SNOW.tooltip.4=Exibe a neve em blocos transparentes (cerca, arbustos) +of.options.BETTER_SNOW.tooltip.5=quando há blocos ao lado de neve. + +of.options.CUSTOM_FONTS=Fontes personalizadas +of.options.CUSTOM_FONTS.tooltip.1=Fontes personalizadas +of.options.CUSTOM_FONTS.tooltip.2= Lig. - Usa fontes personalizadas (padrão), lento +of.options.CUSTOM_FONTS.tooltip.3= Desl. - Usa a fonte normal, rápido +of.options.CUSTOM_FONTS.tooltip.4=As fontes personalizadas são fornecidas pela +of.options.CUSTOM_FONTS.tooltip.5=textura atual, se disponíveis. + +of.options.CUSTOM_COLORS=Cores Personalizadas +of.options.CUSTOM_COLORS.tooltip.1=Cores Personalizadas +of.options.CUSTOM_COLORS.tooltip.2= Lig. - usar cores personalizadas (padrão), lento +of.options.CUSTOM_COLORS.tooltip.3= Desl. - usar cores normais, rápido +of.options.CUSTOM_COLORS.tooltip.4=As cores personalizadas são fornecidas pela +of.options.CUSTOM_COLORS.tooltip.5=textura atual. + +of.options.SWAMP_COLORS=Cores do bioma Pântano +of.options.SWAMP_COLORS.tooltip.1=Cores do bioma Pântano +of.options.SWAMP_COLORS.tooltip.2= Ligado - Cores padrões dos pântanos (padrão), lento +of.options.SWAMP_COLORS.tooltip.3= Desligado - sem cores dos pântanos, rápido +of.options.SWAMP_COLORS.tooltip.4=As cores afetam grama, folhas, vinhas e água. + +of.options.SMOOTH_BIOMES=Biomas Suavizados +of.options.SMOOTH_BIOMES.tooltip.1=Biomas Suavizados +of.options.SMOOTH_BIOMES.tooltip.2= Ligado - suavização das bordas dos biomas (padrão), lento +of.options.SMOOTH_BIOMES.tooltip.3= Desligado - suavização das bordas dos biomas desligada, rápido +of.options.SMOOTH_BIOMES.tooltip.4=A suavização das bordas dos biomas é feita com a +of.options.SMOOTH_BIOMES.tooltip.5=média das cores dos blocos ao redor. +of.options.SMOOTH_BIOMES.tooltip.6=Afeta grama, folhas, vinhas e água. + +of.options.CONNECTED_TEXTURES=Texturas conectadas +of.options.CONNECTED_TEXTURES.tooltip.1=Texturas conectadas +of.options.CONNECTED_TEXTURES.tooltip.2= Desl. - nenhuma textura conectada (padrão) +of.options.CONNECTED_TEXTURES.tooltip.3= Rápidas -texturas conectadas rápidas +of.options.CONNECTED_TEXTURES.tooltip.4= Bonitas - texturas conectadas suaves +of.options.CONNECTED_TEXTURES.tooltip.5=As texturas conectadas unem texturas de vidro, +of.options.CONNECTED_TEXTURES.tooltip.6=arenito e estantes quando colocadas lado a +of.options.CONNECTED_TEXTURES.tooltip.7=lado. As texturas conectadas são fornecidas +of.options.CONNECTED_TEXTURES.tooltip.8=pela textura atual. + +of.options.NATURAL_TEXTURES=Texturas Naturais +of.options.NATURAL_TEXTURES.tooltip.1=Texturas Naturais +of.options.NATURAL_TEXTURES.tooltip.2= Desl. - texturas naturais desativadas (padrão) +of.options.NATURAL_TEXTURES.tooltip.3= Lig. - texturas naturais ativadas +of.options.NATURAL_TEXTURES.tooltip.4=As texturas naturais reduzem a aparência linear +of.options.NATURAL_TEXTURES.tooltip.5=dos blocos do mesmo tipo. +of.options.NATURAL_TEXTURES.tooltip.6=Isso usa variantes da base da +of.options.NATURAL_TEXTURES.tooltip.7=textura do bloco. A configuração é fornecida +of.options.NATURAL_TEXTURES.tooltip.8=pela textura atual. + +of.options.CUSTOM_SKY=Céu Personalizado +of.options.CUSTOM_SKY.tooltip.1=Céu Personalizado +of.options.CUSTOM_SKY.tooltip.2= Ligado - textura do céu personalizada (padrão), lento +of.options.CUSTOM_SKY.tooltip.3= Desl. - céu normal, rápido +of.options.CUSTOM_SKY.tooltip.4=As texturas do céu personalizado são fornecidas pela +of.options.CUSTOM_SKY.tooltip.5=textura atual. + +of.options.CUSTOM_ITEMS=Itens Personalizados +of.options.CUSTOM_ITEMS.tooltip.1=Itens Personalizados +of.options.CUSTOM_ITEMS.tooltip.2= Ligado - texturas dos itens personalizadas (padrão), lento +of.options.CUSTOM_ITEMS.tooltip.3= Deslig. - texturas normais dos itens, rápido +of.options.CUSTOM_ITEMS.tooltip.4=Αs texturas de itens personalizadas são fornecidas pela +of.options.CUSTOM_ITEMS.tooltip.5=textura atual. + +of.options.CUSTOM_ENTITY_MODELS=Modelos Personalizados de entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modelos Personalizados de entidades +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Ligado - modelos personalizados de entidades (padrão), lento +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Desl. - modelos padrões de entidades, rápido +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Os modelos personalizados de entidades são fornecidos +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=pela textura atual. + +# Details + +of.options.CLOUDS=Nuvens +of.options.CLOUDS.tooltip.1=Nuvens +of.options.CLOUDS.tooltip.2= Padrão - como o configurado +of.options.CLOUDS.tooltip.3= Rápidas - menor qualidade, rápido +of.options.CLOUDS.tooltip.4= Bonitas - maior qualidade, lento +of.options.CLOUDS.tooltip.5= OFF - sem nuvens, mais rápido +of.options.CLOUDS.tooltip.6=Nuvens Rápidas são em 2D. +of.options.CLOUDS.tooltip.7=Nuvens Bonitas são em 3D. + +of.options.CLOUD_HEIGHT=Altitude da nuvem +of.options.CLOUD_HEIGHT.tooltip.1=Altitude da nuvem +of.options.CLOUD_HEIGHT.tooltip.2= Desl. - padrão +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - acima do limite de altura do mundo + +of.options.TREES=Árvores +of.options.TREES.tooltip.1=Árvores +of.options.TREES.tooltip.2= Padrão - como o configurado +of.options.TREES.tooltip.3= Rápidas - menor qualidade, mais rápido +of.options.TREES.tooltip.4= Inteligentes - maior qualidade, rápido +of.options.TREES.tooltip.5= Bonitas - maior qualidade, lento +of.options.TREES.tooltip.6=Árvores na opção Rápidas têm folhas opacas. +of.options.TREES.tooltip.7=Folhas de árvores bonitas e inteligentes são transparentes. + +of.options.RAIN=Chuva e Neve +of.options.RAIN.tooltip.1=Chuva e Neve +of.options.RAIN.tooltip.2= Padrão - como o configurado +of.options.RAIN.tooltip.3= Rápidas - chuva/neve claras, rápido +of.options.RAIN.tooltip.4= Bonitas - chuva/neve escuras, lento +of.options.RAIN.tooltip.5= Desl. - sem chuva/neve, mais rápido +of.options.RAIN.tooltip.6=Mesmo com a opção desativada, os barulhos +of.options.RAIN.tooltip.7=de chuva podem estar ativados + +of.options.SKY=Céu +of.options.SKY.tooltip.1=Céu +of.options.SKY.tooltip.2= Ligado - céu visível, lento +of.options.SKY.tooltip.3= Desl. - céu não visível, rápido +of.options.SKY.tooltip.4=Quando o céu está desligado, a Lua e o Sol ainda podem ser visíveis. + +of.options.STARS=Estrelas +of.options.STARS.tooltip.1=Estrelas +of.options.STARS.tooltip.2= Ligadas - estrelas visíveis, lento +of.options.STARS.tooltip.3= Desl. - estrelas não visíveis, rápido + +of.options.SUN_MOON=Sol e Lua +of.options.SUN_MOON.tooltip.1=Sol e Lua +of.options.SUN_MOON.tooltip.2= Lig - Sol e Lua visíveis (padrão) +of.options.SUN_MOON.tooltip.3= OFF - Sol e Lua não visíveis (mais rápido) + +of.options.SHOW_CAPES=Mostrar Capas +of.options.SHOW_CAPES.tooltip.1=Mostrar Capas +of.options.SHOW_CAPES.tooltip.2= Lig - mostrar capas de jogadores (padrão) +of.options.SHOW_CAPES.tooltip.3= Desl. - não mostrar capas de jogadores + +of.options.TRANSLUCENT_BLOCKS=Blocos translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocos translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Bonitos - mistura suave das cores (padrão) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rápidos - mistura rápida das cores (faster) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controla a combinação de cores dos blocos translúcidos +of.options.TRANSLUCENT_BLOCKS.tooltip.5=com cores diferentes (vidro colorido, água, gelo) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=quando posicionados atrás de outros com espaço entre eles + +of.options.HELD_ITEM_TOOLTIPS=Dicas sobre itens +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Dicas sobre itens +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Ligado - mostrar dicas (padrão) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Desl. - não mostrar dicas + +of.options.ADVANCED_TOOLTIPS=Dicas avançadas +of.options.ADVANCED_TOOLTIPS.tooltip.1=Dicas avançadas +of.options.ADVANCED_TOOLTIPS.tooltip.2= Ligado - dicas avançadas +of.options.ADVANCED_TOOLTIPS.tooltip.3= Desl. - dicas simples (padrão) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Dicas avançadas exibem mais informações sobre +of.options.ADVANCED_TOOLTIPS.tooltip.5=itens (ID, durabilidade) e para o Shaders +of.options.ADVANCED_TOOLTIPS.tooltip.6=(ID, fonte, valor padrão). + +of.options.DROPPED_ITEMS=Itens no chão +of.options.DROPPED_ITEMS.tooltip.1=Itens no chão +of.options.DROPPED_ITEMS.tooltip.2= Padrão - como o configurado +of.options.DROPPED_ITEMS.tooltip.3= Rápido - Itens no chão em 2D, rápido +of.options.DROPPED_ITEMS.tooltip.4= Bonito - Itens no chão em 3D, lento + +options.entityShadows.tooltip.1=Sombras de Entidades +options.entityShadows.tooltip.2= Ligado - mostrar sombras de entidades +options.entityShadows.tooltip.3= Desl. - não mostrar sombras de entidades + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Efeito visual que escurece as bordas da tela do jogo +of.options.VIGNETTE.tooltip.2= Padrão - como o configurado (padrão) +of.options.VIGNETTE.tooltip.3= rápido - vinheta desativada (rápido) +of.options.VIGNETTE.tooltip.4= bonito - vinheta ativada (lento) +of.options.VIGNETTE.tooltip.5=A vinheta pode ter um efeito significante na taxa de FPS, +of.options.VIGNETTE.tooltip.6=especialmente quando em tela cheia. +of.options.VIGNETTE.tooltip.7=O efeito da vinheta é muito sútil e pode ser +of.options.VIGNETTE.tooltip.8=facilmente desativado. + +of.options.DYNAMIC_FOV=FOV dinâmico +of.options.DYNAMIC_FOV.tooltip.1=FOV dinâmico +of.options.DYNAMIC_FOV.tooltip.2= Ligado - ativa o FOV dinâmico (padrão) +of.options.DYNAMIC_FOV.tooltip.3= Desl. - desativa o FOV dinâmico +of.options.DYNAMIC_FOV.tooltip.4=Altera o campo de visão (FOV) quando voando, +of.options.DYNAMIC_FOV.tooltip.5=correndo ou disparando com um arco. + +of.options.DYNAMIC_LIGHTS=Luzes dinâmicas +of.options.DYNAMIC_LIGHTS.tooltip.1=Luzes dinâmicas +of.options.DYNAMIC_LIGHTS.tooltip.2= Desl. - luzes não dinâmicas (padrão) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rápido - luzes dinâmicas rápidas (atualizadas a cada 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Bonito - luzes dinâmicas suaves (atualizadas em tempo real) +of.options.DYNAMIC_LIGHTS.tooltip.5=Ativa a iluminação de objetos que emitem luz +of.options.DYNAMIC_LIGHTS.tooltip.6=(tochas, pedras luminosas etc.) quando +of.options.DYNAMIC_LIGHTS.tooltip.7=segurados ou caídos no chão. + +# Performance + +of.options.SMOOTH_FPS=Suavização de FPS +of.options.SMOOTH_FPS.tooltip.1=Estabiliza a taxa de FPS liberando os buffers da placa de vídeo. +of.options.SMOOTH_FPS.tooltip.2= Desl. - sem estabilização de FPS, a taxa pode ficar instável +of.options.SMOOTH_FPS.tooltip.3= Ligado - estabilização de FPS ligada +of.options.SMOOTH_FPS.tooltip.4=Essa opção depende da placa de vídeo e seu efeito +of.options.SMOOTH_FPS.tooltip.5=não é sempre visível. + +of.options.SMOOTH_WORLD=Mundo Suavizado +of.options.SMOOTH_WORLD.tooltip.1=Reduz o lag causado pelo servidor interno. +of.options.SMOOTH_WORLD.tooltip.2= Desl. - sem estabilização, a taxa de FPS pode ficar instável +of.options.SMOOTH_WORLD.tooltip.3= Ligado - estabilização da taxa de FPS ligada +of.options.SMOOTH_WORLD.tooltip.4=Estabiliza a taxa de FPS particionando o carregamento interno do servidor. +of.options.SMOOTH_WORLD.tooltip.5=Funciona apenas no modo Singleplayer. + +of.options.FAST_RENDER=Renderização Rápida +of.options.FAST_RENDER.tooltip.1=Renderização Rápida +of.options.FAST_RENDER.tooltip.2= Desl. - renderização normal (padrão) +of.options.FAST_RENDER.tooltip.3= Ligado - renderização melhorada (rápido) +of.options.FAST_RENDER.tooltip.4=Utiliza um algoritmo especial de renderização que reduz +of.options.FAST_RENDER.tooltip.5=o uso da GPU e aumenta o FPS. + +of.options.FAST_MATH=Fast Math +of.options.FAST_MATH.tooltip.1=Fast Math +of.options.FAST_MATH.tooltip.2= Desl. - cálculos normais (padrão) +of.options.FAST_MATH.tooltip.3= Ligado - cálculos mais rápidos +of.options.FAST_MATH.tooltip.4=Utiliza funções especiais seno() e cosseno() +of.options.FAST_MATH.tooltip.5=que otimizam o cache da CPU e aumentam a taxa de FPS. + +of.options.CHUNK_UPDATES=Atualização de Chunks +of.options.CHUNK_UPDATES.tooltip.1=Atualização de Chunks +of.options.CHUNK_UPDATES.tooltip.2= 1 - carregamento lento do mundo, FPS maior (padrão) +of.options.CHUNK_UPDATES.tooltip.3= 3 - carregamento rápido do mundo, FPS menor +of.options.CHUNK_UPDATES.tooltip.4= 5 - carrega o mundo instantaneamente, FPS muito menor +of.options.CHUNK_UPDATES.tooltip.5=Número de atualizações de chunks por frame renderizada, +of.options.CHUNK_UPDATES.tooltip.6=valores grandes podem desestabilizar a taxa de FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Atualizações dinâmicas +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Atualizações dinâmicas dos chunks +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= OFF - (padrão) atualização normal de chunks por frames +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ON - mais atualizações durante o jogo +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Atualizações dinâmicas forçam mais atualizações +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=para carregar o mundo mais rapidamente. + +of.options.LAZY_CHUNK_LOADING=Carregamento Reduzido +of.options.LAZY_CHUNK_LOADING.tooltip.1=Carregamento Reduzido +of.options.LAZY_CHUNK_LOADING.tooltip.2= OFF - carregamento normal do servidor +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - carregamento reduzido (mais suave) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Suaviza o carregamento de chunks interno +of.options.LAZY_CHUNK_LOADING.tooltip.5=distribuindo os chunks em vários ticks. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Desative-o se algumas partes do mundo não carregarem corretamente. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Funciona apenas no modo Singleplayer com CPUs de núcleo único + +# Animations + +of.options.animation.allOn=Ligar tudo +of.options.animation.allOff=Desligar tudo +of.options.animation.dynamic=Dinâmico + +of.options.ANIMATED_WATER=Água Animada +of.options.ANIMATED_LAVA=Lava Animada +of.options.ANIMATED_FIRE=Fogo Animada +of.options.ANIMATED_PORTAL=Portal Animado +of.options.ANIMATED_REDSTONE=Redstone Animado +of.options.ANIMATED_EXPLOSION=Explosão Animada +of.options.ANIMATED_FLAME=Chama Animada +of.options.ANIMATED_SMOKE=Fumaça Animada +of.options.VOID_PARTICLES=Partículas do Vácuo +of.options.WATER_PARTICLES=Partículas da água +of.options.RAIN_SPLASH=Respingos da chuva +of.options.PORTAL_PARTICLES=Partículas do portal +of.options.POTION_PARTICLES=Partículas de poções +of.options.DRIPPING_WATER_LAVA=Água/Lava pingando +of.options.ANIMATED_TERRAIN=Terreno Animado +of.options.ANIMATED_TEXTURES=Texturas Animadas +of.options.FIREWORK_PARTICLES=Partículas dos fogos de artifício. + +# Other + +of.options.LAGOMETER=Lagômetro +of.options.LAGOMETER.tooltip.1=Exibe o lagômetro na janela de depuração (F3). +of.options.LAGOMETER.tooltip.2=* Laranja - Memory garbage collection +of.options.LAGOMETER.tooltip.3=* Ciano - Tick +of.options.LAGOMETER.tooltip.4=* Azul - Scheduled executables +of.options.LAGOMETER.tooltip.5=* Roxo - Chunk upload +of.options.LAGOMETER.tooltip.6=* Vermelho - Chunk updates +of.options.LAGOMETER.tooltip.7=* Amarelo - Visibility check +of.options.LAGOMETER.tooltip.8=* Verde - Render terrain + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= Ligado - debug profiler ativado, lento +of.options.PROFILER.tooltip.3= Desl. - debug profiler desativado, rápido +of.options.PROFILER.tooltip.4=O Debug Profiler coleta e exibe informações de depuração +of.options.PROFILER.tooltip.5=quando o modo de depuração é ativado (F3). + +of.options.WEATHER=Clima +of.options.WEATHER.tooltip.1=Clima +of.options.WEATHER.tooltip.2= Ligado - clima ligado, lento +of.options.WEATHER.tooltip.3= Desl. - clima desligado, rápido +of.options.WEATHER.tooltip.4=O clima controla a chuva, neve e trovões. +of.options.WEATHER.tooltip.5=Disponível apenas em mundos locais (singleplayer). + +of.options.time.dayOnly=Somente dia +of.options.time.nightOnly=Somente noite + +of.options.TIME=Tempo +of.options.TIME.tooltip.1=Tempo +of.options.TIME.tooltip.2= Padrão - ciclos de dia/noite normais +of.options.TIME.tooltip.3= Somente dia - somente dia +of.options.TIME.tooltip.4= Somente noite - somente noite +of.options.TIME.tooltip.5=Disponível apenas em mundos locais (singleplayer). + +options.fullscreen.tooltip.1=Tela cheia +options.fullscreen.tooltip.2= Ligado - usar tela cheia +options.fullscreen.tooltip.3= Desl. - abrir janela +options.fullscreen.tooltip.4=O modo de tela cheia pode ser mais lento do que o +options.fullscreen.tooltip.5=de janela, dependendo da placa de vídeo. + +of.options.FULLSCREEN_MODE=Resolução da tela cheia +of.options.FULLSCREEN_MODE.tooltip.1=Resolução da tela cheia +of.options.FULLSCREEN_MODE.tooltip.2= Normal - usa a resolução do seu monitor, lento +of.options.FULLSCREEN_MODE.tooltip.3= WxH - usar resolução personalizada, pode ser mais rápido +of.options.FULLSCREEN_MODE.tooltip.4=A resolução escolhida será usada no modo de tela cheia (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Resoluções menores normalmente são rápidas. + +of.options.SHOW_FPS=Exibir FPS +of.options.SHOW_FPS.tooltip.1=Exibir FPS e informações de renderização no canto superior esquerdo. +of.options.SHOW_FPS.tooltip.2= C: - renderização de chunks +of.options.SHOW_FPS.tooltip.3= E: - entidades e blocos renderizados +of.options.SHOW_FPS.tooltip.4= U: - atualização de chunks +of.options.SHOW_FPS.tooltip.5=O display de FPS só é visível quando a +of.options.SHOW_FPS.tooltip.6=tela de depuração não está ativada. + +of.options.save.default=Padrão (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autosalve +of.options.AUTOSAVE_TICKS.tooltip.1=Autosalve interno +of.options.AUTOSAVE_TICKS.tooltip.2=Intervalo padrão para autosalve (2 seg.) NÃO É RECOMENDADO. +of.options.AUTOSAVE_TICKS.tooltip.3=O Autosave pode causar o Lag Spike of Death. + +of.options.SCREENSHOT_SIZE=Tamanho da Screenshot +of.options.SCREENSHOT_SIZE.tooltip.1=Tamanho da Screenshot +of.options.SCREENSHOT_SIZE.tooltip.2= Padrão - tamanho padrão da screenshot +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - tamanho personalizado +of.options.SCREENSHOT_SIZE.tooltip.4=Tamanhos maiores requerem mais memória. +of.options.SCREENSHOT_SIZE.tooltip.5=Não é compatível com Renderização Rápida e Antialiasing. +of.options.SCREENSHOT_SIZE.tooltip.6=É necessário o suporte de framebuffer de GPU. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ro_RO.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ro_RO.lang new file mode 100644 index 0000000..d71f4fd --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ro_RO.lang @@ -0,0 +1,589 @@ +#Tradus in romana de nicuch + +# General +of.general.ambiguous=ambiguu +of.general.custom=Personalizat +of.general.from=Din +of.general.id=Id +of.general.restart=restart +of.general.smart=Destept + +# Keys +of.key.zoom=Zoom + +# Message +of.message.aa.shaders1=Anti-aliasing nu este compatibil cu Shader. +of.message.aa.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.af.shaders1=Filtrul Anisotropic nu este compatibil cu Shader. +of.message.af.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.fr.shaders1=Redarea Rapida nu este compatibila cu Shader. +of.message.fr.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.an.shaders1=Viziunea 3D nu este compatibila cu Shader. +of.message.an.shaders2=Dezactiveaza Shader pentru a activa aceasta optiune. + +of.message.shaders.aa1=Shaderul nu este compatibil cu Anti-aliasing. +of.message.shaders.aa2=Seteaza Calitate -> Anti-aliasing pe DEZACTIVAT si restarteaza jocul. + +of.message.shaders.af1=Shaderul nu este compatibil cu Filtrul Anisotropic. +of.message.shaders.af2=Seteaza Calitate -> Filtrul Anisotropic pe DEZACTIVAT. + +of.message.shaders.fr1=Shaderul nu este compatibil cu Redarea Rapida. +of.message.shaders.fr2=Seteaza Performanta -> Redare Rapida pe DEZACTIVAT. + +of.message.shaders.an1=Shaderul nu este compatibil cu Viziunea 3D. +of.message.shaders.an2=Seteaza Altele -> Viziune 3D pe DEZACTIVAT. + +of.message.newVersion=O versiune noua de §eOptiFine§f este valabila: §e%s§f +of.message.java64Bit=Poti instala versiunea de §e64-bit Java§f pentru a creste performanta. +of.message.openglError=§eEroare OpenGL§f: %s (%s) + +of.message.shaders.loading=Shaderul se incarca: %s + +of.message.other.reset=Resetezi toate setarile video in valorile implicite? + +of.message.loadingVisibleChunks=Incarca chunk-urile vizibile + +# Video settings + +options.graphics.tooltip.1=Calitate vizuala +options.graphics.tooltip.2= Rapid - calitate mica, rapid +options.graphics.tooltip.3= Atractiv - calitate mare, lent +options.graphics.tooltip.4=Schimba aspectul norilor, frunzelor, apei, +options.graphics.tooltip.5=umbrelor si fetele ierbii. + +of.options.renderDistance.tiny=Mic +of.options.renderDistance.short=Scurt +of.options.renderDistance.normal=Normal +of.options.renderDistance.far=Departe +of.options.renderDistance.extreme=Extrem + +options.renderDistance.tooltip.1=Distanta vizibila +options.renderDistance.tooltip.2= 2 Mic - 32m (rapid) +options.renderDistance.tooltip.3= 4 Scurt - 64m (rapid) +options.renderDistance.tooltip.4= 8 Normal - 128m +options.renderDistance.tooltip.5= 16 Departe - 256m (lent) +options.renderDistance.tooltip.6= 32 Extrem - 512m (foarte lent!) +options.renderDistance.tooltip.7=Vederea la distanta Extrem este foarte solicitant pentru resurse! +options.renderDistance.tooltip.8=Valorile peste 16 Departe are efect doar intr-o lume locala. + +options.ao.tooltip.1=Lumina neteda +options.ao.tooltip.2= DEZACTIVAT - fara lumina neteda (rapid) +options.ao.tooltip.3= Minim - lumina neteda simpla (lent) +options.ao.tooltip.4= Maxim - lumina neteda complexa (foarte lent) + +options.framerateLimit.tooltip.1=Rata de cadre maxima +options.framerateLimit.tooltip.2= VSync - limiteaza rata de cadre a monitorului (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variabile +options.framerateLimit.tooltip.4= Nelimitat - fara limita (foarte rapid) +options.framerateLimit.tooltip.5=Limita de cadre scade chiar daca +options.framerateLimit.tooltip.6=valoarea limitei nu este atinsa. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Nivel de lumina neteda +of.options.AO_LEVEL.tooltip.1=Nivel de lumina neteda +of.options.AO_LEVEL.tooltip.2= DEZACTIVAT - fara umbre +of.options.AO_LEVEL.tooltip.3= 50%% - umbre deschise +of.options.AO_LEVEL.tooltip.4= 100%% - umbre inchise + +options.viewBobbing.tooltip.1=Miscare mai realista. +options.viewBobbing.tooltip.2=Cand utilizati mip-maps, setati-l pe DEZACTIVAT pentru rezultate optime. + +options.guiScale.tooltip.1=Dimensiune GUI +options.guiScale.tooltip.2= Automat - marime maxima +options.guiScale.tooltip.3= Mic, Normal, Larg - 1x la 3x +options.guiScale.tooltip.4= 4x la 10x - valabil pe ecranele 4K +options.guiScale.tooltip.5=Valorile impare (1x, 3x, 5x ...) nu sunt compatibile cu Unicode. +options.guiScale.tooltip.6=Un GUI mic poate fi mai rapid. + +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Foloseste un model de render alternativ care de obicei +options.vbo.tooltip.3=este mai rapid (5-10%%) fata de renderul implicit. + +options.gamma.tooltip.1=Schimba luminozitatea obiectelor negre. +options.gamma.tooltip.2= Intunecos - luminozitate standard +options.gamma.tooltip.3= 1-99%% - variabile +options.gamma.tooltip.4= Luminos - luminozitate maxima pentru obiecte negre. +options.gamma.tooltip.5=Aceasta optiune nu schimba luminozitatea +options.gamma.tooltip.6=obiectelor total negre. + +options.anaglyph.tooltip.1=Viziune 3D +options.anaglyph.tooltip.2=Activeaza un efect stereoscopic 3D folosind culori diferite +options.anaglyph.tooltip.3=pentru fiecare ochi. +options.anaglyph.tooltip.4=Necesita ochelari cu lentile rosu-cyan pentru vizualizarea adecvata. + +of.options.ALTERNATE_BLOCKS=Blocuri Succesive +of.options.ALTERNATE_BLOCKS.tooltip.1=Blocuri Succesive +of.options.ALTERNATE_BLOCKS.tooltip.2=Foloseste modele succesive (alternate) pentru unele blocuri. +of.options.ALTERNATE_BLOCKS.tooltip.3=Depinde de pachetul de resurse selectat. + +of.options.FOG_FANCY=Ceata +of.options.FOG_FANCY.tooltip.1=Tip de ceata +of.options.FOG_FANCY.tooltip.2= Rapid - ceata rara +of.options.FOG_FANCY.tooltip.3= Atractiv - ceata deasa, arata mai bine +of.options.FOG_FANCY.tooltip.4= DEZACTIVAT - fara ceata, rapid +of.options.FOG_FANCY.tooltip.5=Ceata eleganta este valabila doar pentru +of.options.FOG_FANCY.tooltip.6=placa grafica care suporta. + +of.options.FOG_START=Pornire ceata +of.options.FOG_START.tooltip.1=Pornire ceata +of.options.FOG_START.tooltip.2= 0.2 - ceata incepe aproape fata de jucator +of.options.FOG_START.tooltip.3= 0.8 - ceata incepe departe fata de jucator +of.options.FOG_START.tooltip.4=Aceasta optiune nu afecteaza de obicei performanta. + +of.options.CHUNK_LOADING=Incarcare Chunk-uri +of.options.CHUNK_LOADING.tooltip.1=Incarcare Chunk-uri +of.options.CHUNK_LOADING.tooltip.2= Implicit - FPS instabil cand chunk-urile sunt incarcate +of.options.CHUNK_LOADING.tooltip.3= Neted - FPS stabil +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - FPS stabil, de 3 ori mai rapida incarcarea chunk-urilor +of.options.CHUNK_LOADING.tooltip.5=Neted si Multi-Core elimina impiedicarea si +of.options.CHUNK_LOADING.tooltip.6=inghetarea cauzata de incarcarea chunk-urilor. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core poate accelera incarcarea lumii de 3 ori +of.options.CHUNK_LOADING.tooltip.8=crescand FPS utilizand un al 2-lea necleu al CPU-ului. +of.options.chunkLoading.smooth=Neted +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Shadere... +of.options.shadersTitle=Shadere + +of.options.shaders.packNone=DEZACTIVAT +of.options.shaders.packDefault=(internal) + +of.options.shaders.ANTIALIASING=Anti-aliasing +of.options.shaders.NORMAL_MAP=Normal Map +of.options.shaders.SPECULAR_MAP=Specular Map +of.options.shaders.RENDER_RES_MUL=Calitate Render +of.options.shaders.SHADOW_RES_MUL=Calitate Umbre +of.options.shaders.HAND_DEPTH_MUL=Adancime Mana +of.options.shaders.CLOUD_SHADOW=Umbre Nori +of.options.shaders.OLD_HAND_LIGHT=Lumina Mana Veche +of.options.shaders.OLD_LIGHTING=Lumina Veche +of.options.shaders.SHADER_PACK=Pachet Shader + +of.options.shaders.shadersFolder=Dosar Shadere +of.options.shaders.shaderOptions=Optiuni Shader... + +of.options.shaderOptionsTitle=Optiuni Shader + +of.options.quality=Calitate... +of.options.qualityTitle=Setari Calitate + +of.options.details=Detalii... +of.options.detailsTitle=Setari Detalii + +of.options.performance=Performanta... +of.options.performanceTitle=Setari Performanta + +of.options.animations=Animatii... +of.options.animationsTitle=Setari animatii + +of.options.other=Altele... +of.options.otherTitle=Alte Setari + +of.options.other.reset=Reseteaza Setarile Video... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Biliniar +of.options.mipmap.linear=Liniar +of.options.mipmap.nearest=Apropiat +of.options.mipmap.trilinear=Triliniar + +options.mipmapLevels.tooltip.1=Efect vizual care face obiectele la distanta sa arate bine +options.mipmapLevels.tooltip.2=prin netezirea detaliilor texturii. +options.mipmapLevels.tooltip.3= DEZACTIVAT - fara netezire +options.mipmapLevels.tooltip.4= 1 - netezire minima +options.mipmapLevels.tooltip.5= 4 - netezire maxima +options.mipmapLevels.tooltip.6=Aceasta optiune de obicei nu afecteaza performanta. + +of.options.MIPMAP_TYPE=Tip Mip-maping +of.options.MIPMAP_TYPE.tooltip.1=Efect vizual care face obiectele la distanta sa arate bine +of.options.MIPMAP_TYPE.tooltip.2=prin netezirea detaliilor texturii. +of.options.MIPMAP_TYPE.tooltip.3= Apropiat - netezire aspra (foarte rapid) +of.options.MIPMAP_TYPE.tooltip.4= Liniar - netezire normala +of.options.MIPMAP_TYPE.tooltip.5= Biliniar - netezire fina +of.options.MIPMAP_TYPE.tooltip.6= Triliniar - netezire foarte fina (foarte lent) + + +of.options.AA_LEVEL=Anti-aliasing +of.options.AA_LEVEL.tooltip.1=Anti-aliasing +of.options.AA_LEVEL.tooltip.2= DEZACTIVAT - (implicit) fara antialiasing (rapid) +of.options.AA_LEVEL.tooltip.3= 2-16 - linii si margini fara crestare (slower) +of.options.AA_LEVEL.tooltip.4=Anti-aliasing-ul netezeste liniile crestate si +of.options.AA_LEVEL.tooltip.5=ascute tranzitiile culori. +of.options.AA_LEVEL.tooltip.6=Cand este activat va scadea substantial si FPS-ul. +of.options.AA_LEVEL.tooltip.7=Nu toate nivelele sunt suportate de toate placile video. +of.options.AA_LEVEL.tooltip.8=Functioneaza dupa un RESTART! + +of.options.AF_LEVEL=Filtru Anisotropic +of.options.AF_LEVEL.tooltip.1=Filtru Anisotropic +of.options.AF_LEVEL.tooltip.2= DEZACTIVAT - (implicit) detali textura standard (rapid) +of.options.AF_LEVEL.tooltip.3= 2-16 - detalii fine in texturile mip-map (lent) +of.options.AF_LEVEL.tooltip.4=Filtru Anisotropic restaureaza detaliile in +of.options.AF_LEVEL.tooltip.5=texturile mip-map. +of.options.AF_LEVEL.tooltip.6=Cand este activat va scadea substantial si FPS-ul. + +of.options.CLEAR_WATER=Apa Curata +of.options.CLEAR_WATER.tooltip.1=Apa Curata +of.options.CLEAR_WATER.tooltip.2= ACTIVAT - curat, apa transparenta +of.options.CLEAR_WATER.tooltip.3= DEZACTIVAT - apa implicita + +of.options.RANDOM_MOBS=Entitati Aleatoare +of.options.RANDOM_MOBS.tooltip.1=Entitati Aleatoare +of.options.RANDOM_MOBS.tooltip.2= DEZACTIVAT - fara entitati aleatoare, rapid +of.options.RANDOM_MOBS.tooltip.3= ON - entitati aleatoare, lent +of.options.RANDOM_MOBS.tooltip.4=Entitatile aleatoare foloseste texturi aleatoare pentru creaturile jocului. +of.options.RANDOM_MOBS.tooltip.5=Este necesar de un pachet de resurse ce foloseste multiple texturi pentru entitati. + +of.options.BETTER_GRASS=Gazon Imbunatatit +of.options.BETTER_GRASS.tooltip.1=Gazon Imbunatatit +of.options.BETTER_GRASS.tooltip.2= DEZACTIVAT - textura fetelor gazonului implicita, rapid +of.options.BETTER_GRASS.tooltip.3= Rapid - textura fetelor gazonului plina, lent +of.options.BETTER_GRASS.tooltip.4= Atractiv - textura fetelor gazonului dinamica, foarte lent + +of.options.BETTER_SNOW=Zapada Imbunatatita +of.options.BETTER_SNOW.tooltip.1=Zapada Imbunatatita +of.options.BETTER_SNOW.tooltip.2= DEZACTIVAT - zapada implicita, rapid +of.options.BETTER_SNOW.tooltip.3= ACTIVAT - zapada imbunatatita, lent +of.options.BETTER_SNOW.tooltip.4=Zapada sub blocurile transparente (gard, iarba) +of.options.BETTER_SNOW.tooltip.5=cand sunt invecinate cu blocuri de zapada. + +of.options.CUSTOM_FONTS=Fonturi Personalizate +of.options.CUSTOM_FONTS.tooltip.1=Fonturi Personalizate +of.options.CUSTOM_FONTS.tooltip.2= ACTIVAT - foloseste fonturi personalizate (implicit), lent +of.options.CUSTOM_FONTS.tooltip.3= DEZACTIVAT - foloseste fontul implicit, rapid +of.options.CUSTOM_FONTS.tooltip.4=Fonturile personalizate sunt furnizate de +of.options.CUSTOM_FONTS.tooltip.5=pachetul de resurse. + +of.options.CUSTOM_COLORS=Culori Personalizate +of.options.CUSTOM_COLORS.tooltip.1=Culori Personalizate +of.options.CUSTOM_COLORS.tooltip.2= ACTIVAT - foloseste culori personalizate (implicit), lent +of.options.CUSTOM_COLORS.tooltip.3= DEZACTIVAT - foloseste culori implicite, rapid +of.options.CUSTOM_COLORS.tooltip.4=Culorile personalizate sunt furnizate de +of.options.CUSTOM_COLORS.tooltip.5=pachetul de resurse. + +of.options.SWAMP_COLORS=Culorile Mlastinei +of.options.SWAMP_COLORS.tooltip.1=Culorile Mlastinei +of.options.SWAMP_COLORS.tooltip.2= ACTIVAT - foloseste culori mlastinei (implicit), lent +of.options.SWAMP_COLORS.tooltip.3= DEZACTIVAT - nu foloseste culori mlastinei, rapid +of.options.SWAMP_COLORS.tooltip.4=Culorile mlastinei afecteaza gazonul, frunzele, lianele si apa. + +of.options.SMOOTH_BIOMES=Biomuri Netede +of.options.SMOOTH_BIOMES.tooltip.1=Biomuri Netede +of.options.SMOOTH_BIOMES.tooltip.2= ACTIVAT - netezeste bordurile biomurilor (implicit), lent +of.options.SMOOTH_BIOMES.tooltip.3= DEZACTIVAT - fara netezire a bordurilor biomurilor, rapid +of.options.SMOOTH_BIOMES.tooltip.4=Netezirea bordurilor biomurilor este facuta de +of.options.SMOOTH_BIOMES.tooltip.5=media culorii blocurilor incojuratoare aflate in fiecare biom. +of.options.SMOOTH_BIOMES.tooltip.6=Afecteaza gazonul, frunzele, lianele si apa. + +of.options.CONNECTED_TEXTURES=Texturi Conectate +of.options.CONNECTED_TEXTURES.tooltip.1=CTexturi Conectate +of.options.CONNECTED_TEXTURES.tooltip.2= DEZACTIVAT - fara texturi conectate (implicit) +of.options.CONNECTED_TEXTURES.tooltip.3= Rapid - conecteaza texturile rapid +of.options.CONNECTED_TEXTURES.tooltip.4= Atractiv - conecteaza texturile elegant +of.options.CONNECTED_TEXTURES.tooltip.5=Texturile conectate ataseaza texturile sticlei, +of.options.CONNECTED_TEXTURES.tooltip.6=gresiei si a rafturilor cu carti cand sunt puse +of.options.CONNECTED_TEXTURES.tooltip.7=una langa alta. Texturile conectate sunt furnizate +of.options.CONNECTED_TEXTURES.tooltip.8=de pachetul de resurse curent. + +of.options.NATURAL_TEXTURES=Texturi Naturale +of.options.NATURAL_TEXTURES.tooltip.1=Texturi Naturale +of.options.NATURAL_TEXTURES.tooltip.2= DEZACTIVAT - fara texturi naturale (implicit) +of.options.NATURAL_TEXTURES.tooltip.3= ACTIVAT - foloseste texturi naturale +of.options.NATURAL_TEXTURES.tooltip.4=Texturile naturale elimina modelul de grid +of.options.NATURAL_TEXTURES.tooltip.5=creat de blocurilor repetate de acelasi tip. +of.options.NATURAL_TEXTURES.tooltip.6=Foloseste variante rotite si in oglinda a texturii +of.options.NATURAL_TEXTURES.tooltip.7=blocului. Configuratia pentru texturile naturale +of.options.NATURAL_TEXTURES.tooltip.8=sunt furnizate de pachetul de resurse curent. + +of.options.CUSTOM_SKY=Cer Personalizat +of.options.CUSTOM_SKY.tooltip.1=Cer Personalizat +of.options.CUSTOM_SKY.tooltip.2= ACTIVAT - texturi al cerului personalizate (implicit), lent +of.options.CUSTOM_SKY.tooltip.3= DEZACTIVAT - cer implicit, rapid +of.options.CUSTOM_SKY.tooltip.4=Cerul personalizat este furnizat de +of.options.CUSTOM_SKY.tooltip.5=pachetul de resurse curent. + +of.options.CUSTOM_ITEMS=Obiecte Personalizate +of.options.CUSTOM_ITEMS.tooltip.1=Obiecte Personalizate +of.options.CUSTOM_ITEMS.tooltip.2= ACTIVAT - texturi ale obiectelor personalizate (implicit), lent +of.options.CUSTOM_ITEMS.tooltip.3= DEZACTIVAT - texturi ale obiectelor implicite, rapid +of.options.CUSTOM_ITEMS.tooltip.4=Obiectele personalizate sunt furnizate de +of.options.CUSTOM_ITEMS.tooltip.5=pachetul de resurse curent. + +of.options.CUSTOM_ENTITY_MODELS=Modele Entitati Personalizate +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Modele Entitati Personalizate +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= ACTIVAT - modele entitati personalizate (implicit), lent +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= DEZACTIVAT - modele entitati implicite, rapid +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Modelele entitatilor personalizate sunt furnizate de +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=pachetul de resurse curent. + +# Details + + +of.options.CLOUDS=Nori +of.options.CLOUDS.tooltip.1=Nori +of.options.CLOUDS.tooltip.2= Implicit - setat prin setarea graficii. +of.options.CLOUDS.tooltip.3= Rapid - calitate mica, rapid +of.options.CLOUDS.tooltip.4= Atractiv - calitate mare, lent +of.options.CLOUDS.tooltip.5= DEZACTIVAT - fara nori, foarte rapid +of.options.CLOUDS.tooltip.6=Norii rapizi sunt redati 2D. +of.options.CLOUDS.tooltip.7=Norii atractivi sunt redati 3D. + +of.options.CLOUD_HEIGHT=Inaltime Nori +of.options.CLOUD_HEIGHT.tooltip.1=Inaltime Nori +of.options.CLOUD_HEIGHT.tooltip.2= DEZACTIVAT - inaltime implicita +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - deasupra inaltimitii limita a lumii. + +of.options.TREES=Copaci +of.options.TREES.tooltip.1=Copaci +of.options.TREES.tooltip.2= Implicit - setat prin setarea graficii. +of.options.TREES.tooltip.3= Rapid - calitate mica, rapid +of.options.TREES.tooltip.4= Destept - calitate mare, rapid +of.options.TREES.tooltip.5= Atractiv - calitate mare, lent +of.options.TREES.tooltip.6=Copacii rapizi au frunzele opace. +of.options.TREES.tooltip.7=Copacii atractivi si destepti au frunze transparente. + +of.options.RAIN=Ploaie si Zapada +of.options.RAIN.tooltip.1=Ploaie si Zapada +of.options.RAIN.tooltip.2= Implicit - setat prin setarea graficii. +of.options.RAIN.tooltip.3= Rapid - ploaie/zapada usoara, rapid +of.options.RAIN.tooltip.4= Atractiv - ploaie/zapada grea, lent +of.options.RAIN.tooltip.5= DEZACTIVAT - fara ploaie/zapada, foarte rapid +of.options.RAIN.tooltip.6=Cand ploaia este DEZACTIVATA stopii si sunetele ploii +of.options.RAIN.tooltip.7=raman inca active. + +of.options.SKY=Cer +of.options.SKY.tooltip.1=Cer +of.options.SKY.tooltip.2= ACTIVAT - cerul este vizibil, lent +of.options.SKY.tooltip.3= DEZACTIVAT - cerul nu este vizibil, rapid +of.options.SKY.tooltip.4=Cand cerul este DEZACTIVAT luna si soarele raman inca vizibile. + +of.options.STARS=Stele +of.options.STARS.tooltip.1=Stele +of.options.STARS.tooltip.2= ACTIVAT - stelele sunt vizibile, lent +of.options.STARS.tooltip.3= DEZACTIVAT - stelele nu sunt vizibile, rapid + +of.options.SUN_MOON=Soarele si Luna +of.options.SUN_MOON.tooltip.1=Soarele si Luna +of.options.SUN_MOON.tooltip.2= ACTIVAT - soarele si luna sunt vizibile (implicit) +of.options.SUN_MOON.tooltip.3= DEZACTIVAT - soarele si luna nu sunt vizibile (lent) + +of.options.SHOW_CAPES=Arata Cape +of.options.SHOW_CAPES.tooltip.1=Arata Cape +of.options.SHOW_CAPES.tooltip.2= ACTIVAT - arata capele jucatorilor (implicit) +of.options.SHOW_CAPES.tooltip.3= DEZACTIVAT - nu arata capele jucatorilor + +of.options.TRANSLUCENT_BLOCKS=Blocuri Transparente +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Blocuri Transparente +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Atractiv - amestecare corectă a culorii (implicit) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Rapid - amestecarea rapida a culorii (rapid) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Controleaza amestecarea culorii blocurilor trasparente +of.options.TRANSLUCENT_BLOCKS.tooltip.5=cu diferite culori (sticla colorata, apa, gheata) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=cand sunt puse una in spatele celelalte cu aer intre ele. + +of.options.HELD_ITEM_TOOLTIPS=Informatii Obiect Detinut +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Informatii Obiect Detinut +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= ACTIVAT - arata informatii despre obiectul detinut (implicit) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= DEZACTIVAT - nu arata informatii despre obiectul detinut + +of.options.ADVANCED_TOOLTIPS=Informatii Avansate +of.options.ADVANCED_TOOLTIPS.tooltip.1=Informatii Avansate +of.options.ADVANCED_TOOLTIPS.tooltip.2= ACTIVAT - arata informatii avansate +of.options.ADVANCED_TOOLTIPS.tooltip.3= DEZACTIVAT - nu arata informatii avansate (implicit) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Extinde informatiile despre +of.options.ADVANCED_TOOLTIPS.tooltip.5=obiecte (id, durabilitate) si optiunile shaderului +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, sursa, valori implicite). + +of.options.DROPPED_ITEMS=Obiecte Aruncate +of.options.DROPPED_ITEMS.tooltip.1=Obiecte Aruncate +of.options.DROPPED_ITEMS.tooltip.2= Implicit - setat prin setarea graficii. +of.options.DROPPED_ITEMS.tooltip.3= Rapid - obiecte aruncate 2D, rapid +of.options.DROPPED_ITEMS.tooltip.4= Fancy - obiecte aruncate 3D, lent + +options.entityShadows.tooltip.1=Umbre Entitati +options.entityShadows.tooltip.2= ACTIVAT - arata umbrele entitatilor +options.entityShadows.tooltip.3= DEZACTIVAT - nu arata umbrele entitatilor + +of.options.VIGNETTE=Vignette +of.options.VIGNETTE.tooltip.1=Efect vizual ce face colutile ecranului putin inchise. +of.options.VIGNETTE.tooltip.2= Implicit - setat prin setarea graficii (implicit) +of.options.VIGNETTE.tooltip.3= Rapid - vignette dezactivat (rapid) +of.options.VIGNETTE.tooltip.4= Atractiv - vignette activat (lent) +of.options.VIGNETTE.tooltip.5=Vignette poate avea un efect semnificativ FPS-ului, +of.options.VIGNETTE.tooltip.6=in special jucat in ecran complet. +of.options.VIGNETTE.tooltip.7=Efectul vignette este foarte subtil si poate fi +of.options.VIGNETTE.tooltip.8=dezactivat fara probleme. + +of.options.DYNAMIC_FOV=Camp De Vizualizare +of.options.DYNAMIC_FOV.tooltip.1=Camp De Vizualizare +of.options.DYNAMIC_FOV.tooltip.2= ACTIVAT - activeaza campul de vizualizare (impilcit) +of.options.DYNAMIC_FOV.tooltip.3= DEZACTIVAT - dezactiveaza campul de vizualizare +of.options.DYNAMIC_FOV.tooltip.4=Schimba campul de vizualizare in timpul zborului, alergatului +of.options.DYNAMIC_FOV.tooltip.5=sau trasului cu arcul. + +of.options.DYNAMIC_LIGHTS=Lumini Dinamice +of.options.DYNAMIC_LIGHTS.tooltip.1=Lumini Dinamice +of.options.DYNAMIC_LIGHTS.tooltip.2= DEZACTIVAT - fara lumini dinamice (implicit) +of.options.DYNAMIC_LIGHTS.tooltip.3= Rapid - lumini dinamice rapide (actualizate fiecare 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Atractiv - lumini dinamice atractive (actualizate in timp real) +of.options.DYNAMIC_LIGHTS.tooltip.5=Activeaza obiectele luminoase (torte, piatra luminoasa, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=sa emita lumina in jurul lor cand sunt tinute in mana, +of.options.DYNAMIC_LIGHTS.tooltip.7=echipate de alti jucatori sau aruncate pe pamant. + +# Performance + +of.options.SMOOTH_FPS=FPS-uri Constante +of.options.SMOOTH_FPS.tooltip.1=Stabilizeaza FPS-ul prin curatarea bufferelor placii grafice. +of.options.SMOOTH_FPS.tooltip.2= DEZACTIVAT - fara stabilizare, FPS-ul poate fluctua +of.options.SMOOTH_FPS.tooltip.3= ACTIVAT - FPS-ul stabilizat +of.options.SMOOTH_FPS.tooltip.4=Aceasta optiune este dependenta de placa grafica +of.options.SMOOTH_FPS.tooltip.5=si nu are mereu un efect vizibil. + +of.options.SMOOTH_WORLD=Lume Constanta +of.options.SMOOTH_WORLD.tooltip.1=Elimina lagul cauzat de serverul internal. +of.options.SMOOTH_WORLD.tooltip.2= DEZACTIVAT - fara stabilizare, FPS-ul poate fluctua +of.options.SMOOTH_WORLD.tooltip.3= ACTIVAT - FPS-ul stabilizat +of.options.SMOOTH_WORLD.tooltip.4=Stabilizeaza FPS-ul prin distribuirea incarcarii serverului internal. +of.options.SMOOTH_WORLD.tooltip.5=Are efect doar in lumine locale (single player). + +of.options.FAST_RENDER=Render Rapid +of.options.FAST_RENDER.tooltip.1=Render Rapid +of.options.FAST_RENDER.tooltip.2= DEZACTIVAT - render standard (implicit) +of.options.FAST_RENDER.tooltip.3= ACTIVAT - render optimizat (rapid) +of.options.FAST_RENDER.tooltip.4=Foloseste un algoritm optimizat pentru render care scade +of.options.FAST_RENDER.tooltip.5=incarcarea GPU-ului si substatinal creste FPS-ul. + +of.options.FAST_MATH=Matematica Rapida +of.options.FAST_MATH.tooltip.1=Matematica Rapida +of.options.FAST_MATH.tooltip.2= DEZACTIVAT - matematica standard (implicit) +of.options.FAST_MATH.tooltip.3= ACTIVAT - matematica rapida +of.options.FAST_MATH.tooltip.4=Foloseste functii sin() si cos() optimizate care +of.options.FAST_MATH.tooltip.5=utilizeaza cache-ul CPU-ului mai bine si creste FPS-ul. + +of.options.CHUNK_UPDATES=Actualizare Chunk-uri +of.options.CHUNK_UPDATES.tooltip.1=Actualizare Chunk-uri +of.options.CHUNK_UPDATES.tooltip.2= 1 - incarcarea lumii lenta, FPS mare (implicit) +of.options.CHUNK_UPDATES.tooltip.3= 3 - incarcarea lumii rapida, FPS mic +of.options.CHUNK_UPDATES.tooltip.4= 5 - incarcarea lumii foarte rapida, FPS foarte mic +of.options.CHUNK_UPDATES.tooltip.5=Numarul de actualizari ale chunk-urilor per frame rendate, +of.options.CHUNK_UPDATES.tooltip.6=valorile mari pot destabiliza rata de frameuri. + +of.options.CHUNK_UPDATES_DYNAMIC=Actualizari Dinamice +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Actualizari dinamice ale chunk-urilor +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= DEZACTIVAT - (implicit) actualizari standard ale chunk-urilor per frame +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= ACTIVAT - mai multe actualizari cand jucatorul sta nemiscat +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Actualizarile dinamice forteaza mai multe chunk-uri sa fie actualizate +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=cat timp jucatorul sta nemiscat pentru o mai buna incarcare a lumii. + +of.options.LAZY_CHUNK_LOADING=Chunk-uri Lenese +of.options.LAZY_CHUNK_LOADING.tooltip.1=Incarcare Lenesa a Chunk-urilor +of.options.LAZY_CHUNK_LOADING.tooltip.2= DEZACTIVAT - incarcarea implicita a chunk-urlor serverului +of.options.LAZY_CHUNK_LOADING.tooltip.3= ON - incarcarea lenesa a chunk-urlor serverului (lin) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Usureaza incarcarea chunk-urilor serverului +of.options.LAZY_CHUNK_LOADING.tooltip.5=distribuind chunk-urile peste cateva tick-uri. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Dezactiva-l daca parti ale lumii nu sunt incarcate corect. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Efectiv doar pentru lumile locale si pentru CPU-urile cu un singur nucleu. + +# Animations + +of.options.animation.allOn=Toate ACTIVATE +of.options.animation.allOff=Toate DEZACTIVATE +of.options.animation.dynamic=Dinamic + +of.options.ANIMATED_WATER=Animatie Apa +of.options.ANIMATED_LAVA=Animatie Lava +of.options.ANIMATED_FIRE=Animatie Foc +of.options.ANIMATED_PORTAL=Animatie Portal +of.options.ANIMATED_REDSTONE=Animatie Redstone +of.options.ANIMATED_EXPLOSION=Animatie Explozie +of.options.ANIMATED_FLAME=Animatie Flacara +of.options.ANIMATED_SMOKE=Animatie Fum +of.options.VOID_PARTICLES=Particule de Void +of.options.WATER_PARTICLES=Particule de Apa +of.options.RAIN_SPLASH=Stopi de Ploaie +of.options.PORTAL_PARTICLES=Particule de Portal +of.options.POTION_PARTICLES=Particule de Potiuni +of.options.DRIPPING_WATER_LAVA=Picaturi de Apa/Lava +of.options.ANIMATED_TERRAIN=Teren Animat +of.options.ANIMATED_TEXTURES=Texturi Animate +of.options.FIREWORK_PARTICLES=Particule de Artificii + +# Other + +of.options.LAGOMETER=Lagometru +of.options.LAGOMETER.tooltip.1=Arata lagometrul in ecranul de debug (F3). +of.options.LAGOMETER.tooltip.2=* Portocaliu - Colectie de memorie gunoi +of.options.LAGOMETER.tooltip.3=* Cyan - Tick +of.options.LAGOMETER.tooltip.4=* Albastru - Programe executabile +of.options.LAGOMETER.tooltip.5=* Purpuriu - Incarcare chunk-uri +of.options.LAGOMETER.tooltip.6=* Rosu - Actualizare chunk-uri +of.options.LAGOMETER.tooltip.7=* Galben - Verificarea vizibilitatii +of.options.LAGOMETER.tooltip.8=* Verde - Teren rendat + +of.options.PROFILER=Debug Profiler +of.options.PROFILER.tooltip.1=Debug Profiler +of.options.PROFILER.tooltip.2= ACTIVAT - debug profiler este activ, lent +of.options.PROFILER.tooltip.3= DEZACTIVAT - debug profiler nu este activ, rapid +of.options.PROFILER.tooltip.4=Debug profiler colecteaza si arata informatii pentru +of.options.PROFILER.tooltip.5=debug cat timp ecranul de debug este deschis (F3). + +of.options.WEATHER=Stare Atmosferica +of.options.WEATHER.tooltip.1=Stare Atmosferica +of.options.WEATHER.tooltip.2= ACTIVAT - starea atmosferica este activa, lent +of.options.WEATHER.tooltip.3= DEZACTIVAT - starea atmosferica nu este activa, rapid +of.options.WEATHER.tooltip.4=Starea atmosferica controleaza ploaia si furtunile. +of.options.WEATHER.tooltip.5=Controlul starii atmosferice este posibila doar pentru lumile locale. + +of.options.time.dayOnly=Doar Zi +of.options.time.nightOnly=Doar Noapte + +of.options.TIME=Timp +of.options.TIME.tooltip.1=Timp +of.options.TIME.tooltip.2= Implicit - ciclu normal de zi/noapte +of.options.TIME.tooltip.3= Doar Zi - doar zi +of.options.TIME.tooltip.4= Doar Noapte - doar noapte +of.options.TIME.tooltip.5=Setarea timpului are efect doar in modul CREATIV +of.options.TIME.tooltip.6=si pentru lumile locale. + +options.fullscreen.tooltip.1=Ecran complet +options.fullscreen.tooltip.2= ACTIVAT - foloseste modul ecran complet +options.fullscreen.tooltip.3= DEZACTIVAT - foloseste modul fereastra +options.fullscreen.tooltip.4=Fullscreen mode may be faster or slower than Modul ecran complet poate fi mai rapid sau mai incet +options.fullscreen.tooltip.5=window mode, depending on the graphics card. decat modul fereastra, in functie de placa grafica. + +of.options.FULLSCREEN_MODE=Modul Ecran Complet +of.options.FULLSCREEN_MODE.tooltip.1=Modul ecran complet +of.options.FULLSCREEN_MODE.tooltip.2= Implicit - foloseste rezolutia desktop-ului, lent +of.options.FULLSCREEN_MODE.tooltip.3= WxH - foloseste rezolutia personalizata, poate fi mai rapid +of.options.FULLSCREEN_MODE.tooltip.4=Rezolutia selectata este folosita in modul ecran complet (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Rezolutiile mici ar trebuii in general sa fie mai rapide. + +of.options.SHOW_FPS=Arata FPS +of.options.SHOW_FPS.tooltip.1=Arata FPS-ul compact si informatii despre render. +of.options.SHOW_FPS.tooltip.2= C: - chunk-uri rendate +of.options.SHOW_FPS.tooltip.3= E: - entitati rendate + entitati blocuri +of.options.SHOW_FPS.tooltip.4= U: - actualizari chunk-uri +of.options.SHOW_FPS.tooltip.5=Informatiile FPS-ului compat sunt vizibile doar cand +of.options.SHOW_FPS.tooltip.6=ecranul de debug nu este vizibil. + +of.options.save.default=Implicit (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Auto-Salvare +of.options.AUTOSAVE_TICKS.tooltip.1=Interval auto-salvare +of.options.AUTOSAVE_TICKS.tooltip.2=Intervalul implicit de auto-salvare (2s) NU ESTE RECOMANDAT. +of.options.AUTOSAVE_TICKS.tooltip.3=Auto-savarea cauzeaza faimosul Lag Spike al Mortii. + +of.options.SCREENSHOT_SIZE=Marime Screenshot +of.options.SCREENSHOT_SIZE.tooltip.1=Marime Screenshot +of.options.SCREENSHOT_SIZE.tooltip.2= Implicit - marima implicita de screenshot +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - marime personalizata de screenshot +of.options.SCREENSHOT_SIZE.tooltip.4=Se poate ca, capturand screenshot-uri mai mari sa fie nevoe de mai multa memorie. +of.options.SCREENSHOT_SIZE.tooltip.5=Nu este compatibil cu Render Rapid si Anti-aliasing. +of.options.SCREENSHOT_SIZE.tooltip.6=Necesita suport GPU framebuffer. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ru_RU.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ru_RU.lang new file mode 100644 index 0000000..d584bf9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/ru_RU.lang @@ -0,0 +1,684 @@ +# Contributors of Russian localization # +# Jerozgen 01-Mar-2016 — 29-Nov-2017 +# Dibro 20-Mar-2016 + +# Общее +of.general.ambiguous=Неопределено +of.general.custom=По выбору +of.general.from=Файл +of.general.id=ID +of.general.restart=⟲ +of.general.smart=Умно + +# Управление +of.key.zoom=Приблизить + +# Сообщения +of.message.aa.shaders1=Антиалиасинг не совместим с шейдерами. +of.message.aa.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.af.shaders1=Анизотропная фильтрация не совместима с шейдерами. +of.message.af.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.fr.shaders1=Быстрый рендер не совместим с шейдерами. +of.message.fr.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.an.shaders1=3D анаглиф не совместим с шейдерами. +of.message.an.shaders2=Отключите шейдеры, чтобы включить этот параметр. + +of.message.shaders.aa1=Шейдеры не совместимы с антиалиасингом. +of.message.shaders.aa2=Переключите «Качество» → «Антиалиасинг» на «Выкл» и перезапустите игру. + +of.message.shaders.af1=Шейдеры не совместимы с анизотропной фильтрацией. +of.message.shaders.af2=Переключите «Качество» → «Анизотропная фильтрация» на «Выкл». + +of.message.shaders.fr1=Шейдеры не совместимы с быстрым рендером. +of.message.shaders.fr2=Переключите «Производительность» → «Быстрый рендер» на «Выкл». + +of.message.shaders.an1=Шейдеры не совместимы с анаглифом. +of.message.shaders.an2=Переключите «Прочее» → «3D анаглиф» на «Выкл». + +of.message.newVersion=Доступна новая версия §eOptiFine§f: §e%s§f +of.message.java64Bit=Установите §e64-битную Java§f, чтобы повысить производительность. +of.message.openglError=§eОшибка OpenGL§f: %s (%s) + +of.message.shaders.loading=Загрузка шейдеров: %s + +of.message.other.reset=Сбросить все настройки графики к первоначальным значениям? + +of.message.loadingVisibleChunks=Загрузка видимых чанков + +# Настройки графики + +options.graphics.tooltip.1=Качество графики +options.graphics.tooltip.2= Быстро - низкое качество, быстрее +options.graphics.tooltip.3= Детально - высокое качество, медленнее +options.graphics.tooltip.4=Изменяет облик дёрна, листьев, воды, теней и облаков. +options.graphics.tooltip.5= + +of.options.renderDistance.tiny=Минимальная +of.options.renderDistance.short=Малая +of.options.renderDistance.normal=Нормальная +of.options.renderDistance.far=Дальняя +of.options.renderDistance.extreme=Предельная +of.options.renderDistance.insane=Безумная +of.options.renderDistance.ludicrous=Абсурдная! + +options.renderDistance.tooltip.1=Дальность прорисовки +options.renderDistance.tooltip.2= 2 Очень маленькая - 32м (ещё быстрее) +options.renderDistance.tooltip.3= 4 Малая - 64м (быстрее) +options.renderDistance.tooltip.4= 8 Нормальная - 128м +options.renderDistance.tooltip.5= 16 Дальняя - 256м (медленнее) +options.renderDistance.tooltip.6= 32 Предельная - 512м (ещё медленнее!) +options.renderDistance.tooltip.7=Предельная прорисовка очень требовательна к ресурсам компьютера! +options.renderDistance.tooltip.8=Значения более 16 эффективны только в локальных мирах. + +options.ao.tooltip.1=Мягкое освещение +options.ao.tooltip.2= Выкл - без мягкого освещения, быстрее +options.ao.tooltip.3= Минимум - простое мягкое освещение, медленнее +options.ao.tooltip.4= Максимум - сложное мягкое освещение, ещё медленнее + +options.framerateLimit.tooltip.1=Частота кадров +options.framerateLimit.tooltip.2= V-Sync - частота обновления монитора +options.framerateLimit.tooltip.3= 5–255 - пользовательские значения +options.framerateLimit.tooltip.4= Максимум - без ограничений, быстрее +options.framerateLimit.tooltip.5=Уменьшает частоту кадров до указанной. +options.framerateLimit.tooltip.6= +of.options.framerateLimit.vsync=V-Sync + +of.options.AO_LEVEL=Мягкое освещение +of.options.AO_LEVEL.tooltip.1=Уровень мягкого освещения +of.options.AO_LEVEL.tooltip.2= Выкл - без теней +of.options.AO_LEVEL.tooltip.3= 50%% - светлые тени +of.options.AO_LEVEL.tooltip.4= 100%% - тёмные тени + +options.viewBobbing.tooltip.1=Более реалистичное движение. +options.viewBobbing.tooltip.2=При использовании рекомендуется выключить +options.viewBobbing.tooltip.3=MIP-текстурирование. + +options.guiScale.tooltip.1=Размер интерфейса +options.guiScale.tooltip.2= Авто - максимальный размер +options.guiScale.tooltip.3= Мелкий, обычный, крупный - 1x, 2x и 3x соответственно +options.guiScale.tooltip.4= с 4x до 10x - на мониторах с разрешением 4K +options.guiScale.tooltip.5=Нечётные значения не совместимы со шрифтом Unicode. +options.guiScale.tooltip.6=Чем меньше интерфейс, тем он быстрее. + +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Использует альтернативную модель рендеринга, +options.vbo.tooltip.3=которая обычно быстрее стандартной на 5–10%%. + +options.gamma.tooltip.1=Яркость тёмных объектов +options.gamma.tooltip.2= Тускло - стандартная яркость +options.gamma.tooltip.3= 1–99%% - пользовательские значения +options.gamma.tooltip.4= Ярко - максимальная яркость +options.gamma.tooltip.5=Не изменяет яркость полностью чёрных объектов. +options.gamma.tooltip.6= + +of.options.DYNAMIC_LIGHTS=Динам. освещение +of.options.DYNAMIC_LIGHTS.tooltip.1=Динамическое освещение +of.options.DYNAMIC_LIGHTS.tooltip.2= Выкл - динамическое освещение отключено (по умолчанию) +of.options.DYNAMIC_LIGHTS.tooltip.3= Быстро - обновляется каждые 500 мс., медленнее +of.options.DYNAMIC_LIGHTS.tooltip.4= Детально - обновляется в реальном времени, ещё медленнее +of.options.DYNAMIC_LIGHTS.tooltip.5=Заставляет экипированные и выброшенные предметы, +of.options.DYNAMIC_LIGHTS.tooltip.6=излучающие свет (факел, светокамень и т. д.), освещать +of.options.DYNAMIC_LIGHTS.tooltip.7=территорию вокруг. + +of.options.DYNAMIC_FOV=Динамика поля зрения +of.options.DYNAMIC_FOV.tooltip.1=Динамика поля зрения +of.options.DYNAMIC_FOV.tooltip.2= Вкл - подвижное поле зрения (по умолчанию) +of.options.DYNAMIC_FOV.tooltip.3= Выкл - фиксированное поле зрения +of.options.DYNAMIC_FOV.tooltip.4=Изменяет поле зрения во время полёта, бега +of.options.DYNAMIC_FOV.tooltip.5=и стрельбы из лука. + +of.options.CHUNK_LOADING=Загрузка чанков +of.options.CHUNK_LOADING.tooltip.1=Загрузка чанков +of.options.CHUNK_LOADING.tooltip.2= По умолчанию - нестабильный FPS при загрузке чанков +of.options.CHUNK_LOADING.tooltip.3= Плавная - стабильный FPS +of.options.CHUNK_LOADING.tooltip.4= Многоядерная - стабильный FPS, загрузка мира в 3 раза быстрее +of.options.CHUNK_LOADING.tooltip.5=Плавная и многоядерная загрузки убирают подвисания и лаги, +of.options.CHUNK_LOADING.tooltip.6=вызванные загрузкой чанков. +of.options.CHUNK_LOADING.tooltip.7=Многоядерная загрузка способна ускорить загрузку мира в 3 раза +of.options.CHUNK_LOADING.tooltip.8=и увеличить FPS, используя второе ядро процессора. +of.options.chunkLoading.smooth=Плавная +of.options.chunkLoading.multiCore=Мультиядерная + +of.options.shaders=Шейдеры... +of.options.shadersTitle=Шейдеры + +of.options.shaders.packNone=Нет +of.options.shaders.packDefault=(встроенный) + +of.options.shaders.ANTIALIASING=Антиалиасинг +of.options.shaders.ANTIALIASING.tooltip.1=Антиалиасинг +of.options.shaders.ANTIALIASING.tooltip.2= Выкл - сглаживание отключено (по умолчанию) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - сглаживание линий и краёв, медленнее +of.options.shaders.ANTIALIASING.tooltip.4=FXAA — это эффект постобработки, сглаживающий +of.options.shaders.ANTIALIASING.tooltip.5=неровные линии и резкие цветовые переходы. Данный +of.options.shaders.ANTIALIASING.tooltip.6=метод быстрее, чем традиционное сглаживание, и +of.options.shaders.ANTIALIASING.tooltip.7=он совместим с шейдерами и быстрым рендером. + +of.options.shaders.NORMAL_MAP=Карта нормалей +of.options.shaders.NORMAL_MAP.tooltip.1=Карта нормалей +of.options.shaders.NORMAL_MAP.tooltip.2= Вкл - карта нормалей включена (по умолчанию) +of.options.shaders.NORMAL_MAP.tooltip.3= Выкл - карта нормалей отключена +of.options.shaders.NORMAL_MAP.tooltip.4=Карта нормалей может использоваться шейдерами для +of.options.shaders.NORMAL_MAP.tooltip.5=моделирования трёхмерной геометрии на плоских +of.options.shaders.NORMAL_MAP.tooltip.6=поверхностях моделей. +of.options.shaders.NORMAL_MAP.tooltip.7=Предоставляется пакетами ресурсов. + +of.options.shaders.SPECULAR_MAP=Карта отражений +of.options.shaders.SPECULAR_MAP.tooltip.1=Карта отражений +of.options.shaders.SPECULAR_MAP.tooltip.2= Вкл - карта отражений включена (по умолчанию) +of.options.shaders.SPECULAR_MAP.tooltip.3= Выкл - карта отражений отключена +of.options.shaders.SPECULAR_MAP.tooltip.4=Карта отражений может использоваться шейдерами для +of.options.shaders.SPECULAR_MAP.tooltip.5=создания особого эффекта отражения. +of.options.shaders.SPECULAR_MAP.tooltip.6=Предоставляется пакетами ресурсов. +of.options.shaders.SPECULAR_MAP.tooltip.7= + +of.options.shaders.RENDER_RES_MUL=Качество рендера +of.options.shaders.RENDER_RES_MUL.tooltip.1=Качество рендеринга +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - низкое качество +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - стандартное качество (по умолчанию) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - высокое качество +of.options.shaders.RENDER_RES_MUL.tooltip.5=Управляет размером текстур, которые визуализируют +of.options.shaders.RENDER_RES_MUL.tooltip.6=шейдеры. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Низкие значения могут быть полезны для дисплеев 4K. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Высокие значения работают как фильтр сглаживания. + +of.options.shaders.SHADOW_RES_MUL=Качество теней +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Качество теней +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - нечёткие, грубые тени +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - стандартное качество (по умолчанию) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - детализированные, качественные тени +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Управляет размером текстуры карты теней, которая +of.options.shaders.SHADOW_RES_MUL.tooltip.6=используется шейдерами. +of.options.shaders.SHADOW_RES_MUL.tooltip.7= +of.options.shaders.SHADOW_RES_MUL.tooltip.8= + +of.options.shaders.HAND_DEPTH_MUL=Глубина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Глубина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - рука около камеры +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (по умолчанию) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - рука далеко от камеры +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Управляет удалённостью от камеры объектов, которые +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=находятся в руке. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=У шейдеров, использующих глубину резкости, должна +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=измениться резкость объектов, находящихся в руке. + +of.options.shaders.CLOUD_SHADOW=Тени облаков + +of.options.shaders.OLD_HAND_LIGHT=СО руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Старое освещение руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= По умолчанию - управление от шейдера +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Вкл - старое освещение руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Выкл - новое освещение руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Позволяет шейдерам, которые распознают предметы, +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=излучающие свет, только в основной руке, также +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=работать с предметами во второй руке. + +of.options.shaders.OLD_LIGHTING=Ст. освещ. +of.options.shaders.OLD_LIGHTING.tooltip.1=Старое освещение +of.options.shaders.OLD_LIGHTING.tooltip.2= По умолчанию - управление от шейдера +of.options.shaders.OLD_LIGHTING.tooltip.3= Вкл - использовать старое освещение +of.options.shaders.OLD_LIGHTING.tooltip.4= Выкл - не использовать старое освещение +of.options.shaders.OLD_LIGHTING.tooltip.5=Управляет постоянным освещением, применяемым +of.options.shaders.OLD_LIGHTING.tooltip.6=игрой к сторонам блоков. +of.options.shaders.OLD_LIGHTING.tooltip.7=Шейдеры со встроенными тенями обычно гораздо лучше +of.options.shaders.OLD_LIGHTING.tooltip.8=показывают освещение, зависящее от положения солнца. + +of.options.shaders.SHADER_PACK=Пакет шейдеров + +of.options.shaders.shadersFolder=Папка с шейдерами +of.options.shaders.shaderOptions=Настройки шейдера... + +of.options.shaderOptionsTitle=Настройки шейдера + +of.options.quality=Качество... +of.options.qualityTitle=Настройки качества + +of.options.details=Элементы игры... +of.options.detailsTitle=Настройки элементов игры + +of.options.performance=Производительность... +of.options.performanceTitle=Настройки производительности + +of.options.animations=Анимация... +of.options.animationsTitle=Настройки анимации + +of.options.other=Прочее... +of.options.otherTitle=Прочие настройки + +of.options.other.reset=Сбросить настройки графики... + +of.shaders.profile=Настройки + +# Качество + +options.mipmapLevels.tooltip.1=Уровни детализации +options.mipmapLevels.tooltip.2= Выкл - без сглаживания +options.mipmapLevels.tooltip.3= 1 - минимальное сглаживание +options.mipmapLevels.tooltip.4= 4 - максимальное сглаживание +options.mipmapLevels.tooltip.5=Заставляет удалённые объекты выглядеть лучше +options.mipmapLevels.tooltip.6=посредством сглаживания деталей текстуры. +options.mipmapLevels.tooltip.7=Обычно не влияет на производительность. + +of.options.MIPMAP_TYPE=MIP-текстурир. +of.options.MIPMAP_TYPE.tooltip.1=MIP-текстурирование +of.options.MIPMAP_TYPE.tooltip.2= Ближнее - грубое сглаживание, быстрее +of.options.MIPMAP_TYPE.tooltip.3= Линейное - нормальное сглаживание +of.options.MIPMAP_TYPE.tooltip.4= Билинейное - хорошее сглаживание +of.options.MIPMAP_TYPE.tooltip.5= Трилинейное - лучшее сглаживание, медленнее +of.options.MIPMAP_TYPE.tooltip.6=Заставляет удалённые объекты выглядеть лучше +of.options.MIPMAP_TYPE.tooltip.7=посредством сглаживания деталей текстуры. + +of.options.mipmap.bilinear=Билинейное +of.options.mipmap.linear=Линейное +of.options.mipmap.nearest=Ближнее +of.options.mipmap.trilinear=Трилинейное + +of.options.AF_LEVEL=Анизотроп. фильтрация +of.options.AF_LEVEL.tooltip.1=Анизотропная фильтрация +of.options.AF_LEVEL.tooltip.2= Выкл - стандартная детализация (по умолчанию), быстрее +of.options.AF_LEVEL.tooltip.3= 2–16 - улучшенная детализация, медленнее +of.options.AF_LEVEL.tooltip.4=Улучшает качество деталей в MIP-текстурах. +of.options.AF_LEVEL.tooltip.5=Может существенно понизить производительность. +of.options.AF_LEVEL.tooltip.6= + +of.options.AA_LEVEL=Антиалиасинг +of.options.AA_LEVEL.tooltip.1=Антиалиасинг +of.options.AA_LEVEL.tooltip.2= Выкл - сглаживание отключено (по умолчанию), быстрее +of.options.AA_LEVEL.tooltip.3= 2–16 - сглаживание линий и краёв, медленнее +of.options.AA_LEVEL.tooltip.4=Сглаживает неровные линии и цветовые переходы. +of.options.AA_LEVEL.tooltip.5=Может существенно понизить производительность. +of.options.AA_LEVEL.tooltip.6=Не все видеокарты поддерживают все уровни антиалиасинга. +of.options.AA_LEVEL.tooltip.7= +of.options.AA_LEVEL.tooltip.8=⟲ Изменения вступят в силу только после ПЕРЕЗАПУСКА! + +of.options.CLEAR_WATER=Очищенная вода +of.options.CLEAR_WATER.tooltip.1=Очищенная вода +of.options.CLEAR_WATER.tooltip.2= Вкл - чистая, прозрачная вода +of.options.CLEAR_WATER.tooltip.3= Выкл - стандартная вода + +of.options.RANDOM_MOBS=Случайные мобы +of.options.RANDOM_MOBS.tooltip.1=Случайные текстуры мобов +of.options.RANDOM_MOBS.tooltip.2= Выкл - случайные мобы отключены, быстрее +of.options.RANDOM_MOBS.tooltip.3= Вкл - случайные мобы включены, медленнее +of.options.RANDOM_MOBS.tooltip.4=Используются случайные текстуры для мобов. +of.options.RANDOM_MOBS.tooltip.5=Требуется пакет ресурсов, в котором они есть. + +of.options.BETTER_GRASS=Улучшенный дёрн +of.options.BETTER_GRASS.tooltip.1=Улучшенный дёрн +of.options.BETTER_GRASS.tooltip.2= Выкл - стандартный дёрн, быстрее +of.options.BETTER_GRASS.tooltip.3= Быстро - полное изменение текстур, медленнее +of.options.BETTER_GRASS.tooltip.4= Детально - динамичное изменение текстур, ещё медленнее +of.options.BETTER_GRASS.tooltip.5=Изменяет текстуры сторон дёрна на верхнюю. + +of.options.BETTER_SNOW=Улучшенный снег +of.options.BETTER_SNOW.tooltip.1=Улучшенный снег +of.options.BETTER_SNOW.tooltip.2= Выкл - стандартный снег, быстрее +of.options.BETTER_SNOW.tooltip.3= Вкл - улучшенный снег, медленнее +of.options.BETTER_SNOW.tooltip.4=Показывает снег под прилегающими к нему прозрачными +of.options.BETTER_SNOW.tooltip.5=блоками (забор, трава). + +of.options.CUSTOM_FONTS=Шрифт +of.options.CUSTOM_FONTS.tooltip.1=Пользовательский шрифт +of.options.CUSTOM_FONTS.tooltip.2= Вкл - пользовательский шрифт (по умолчанию) +of.options.CUSTOM_FONTS.tooltip.3= Выкл - стандартный шрифт, быстрее +of.options.CUSTOM_FONTS.tooltip.4=Предоставляется пакетами ресурсов. +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Цвета +of.options.CUSTOM_COLORS.tooltip.1=Пользовательские цвета +of.options.CUSTOM_COLORS.tooltip.2= Вкл - пользовательские цвета (по умолчанию) +of.options.CUSTOM_COLORS.tooltip.3= Выкл - стандартные цвета, быстрее +of.options.CUSTOM_COLORS.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Болотные цвета +of.options.SWAMP_COLORS.tooltip.1=Болотные цвета +of.options.SWAMP_COLORS.tooltip.2= Вкл - болотные цвета (по умолчанию), медленнее +of.options.SWAMP_COLORS.tooltip.3= Выкл - болотные цвета не отображаются, быстрее +of.options.SWAMP_COLORS.tooltip.4=Влияет на цвет травы, листьев, лиан и воды в болоте. + +of.options.SMOOTH_BIOMES=Сглаженные биомы +of.options.SMOOTH_BIOMES.tooltip.1=Сглаживание цветов границ биомов +of.options.SMOOTH_BIOMES.tooltip.2= Вкл - сглаженные цвета (по умолчанию), медленнее +of.options.SMOOTH_BIOMES.tooltip.3= Выкл - несглаженные цвета, быстрее +of.options.SMOOTH_BIOMES.tooltip.4=Осуществляется путём выбора и усреднения значений +of.options.SMOOTH_BIOMES.tooltip.5=цветов всех окружающих блоков. +of.options.SMOOTH_BIOMES.tooltip.6=Влияет на цвет травы, листьев, лиан и воды. + +of.options.CONNECTED_TEXTURES=Соедин. текстур +of.options.CONNECTED_TEXTURES.tooltip.1=Соединение текстур +of.options.CONNECTED_TEXTURES.tooltip.2= Выкл - несоединённые текстуры (по умолчанию) +of.options.CONNECTED_TEXTURES.tooltip.3= Быстро - быстрое соединение +of.options.CONNECTED_TEXTURES.tooltip.4= Детально - качественное соединение +of.options.CONNECTED_TEXTURES.tooltip.5=Cоединяет текстуры (по умолчанию стекла, песчаника +of.options.CONNECTED_TEXTURES.tooltip.6=и книжных полок) друг с другом. +of.options.CONNECTED_TEXTURES.tooltip.7=Предоставляется пакетами ресурсов. +of.options.CONNECTED_TEXTURES.tooltip.8= + +of.options.NATURAL_TEXTURES=Естествен. текстуры +of.options.NATURAL_TEXTURES.tooltip.1=Естественные текстуры +of.options.NATURAL_TEXTURES.tooltip.2= Выкл - без естественных текстур (по умолчанию) +of.options.NATURAL_TEXTURES.tooltip.3= Вкл - использование естественных текстур +of.options.NATURAL_TEXTURES.tooltip.4=Убирает повторяющиеся текстуры блоков и вместо +of.options.NATURAL_TEXTURES.tooltip.5=них использует повёрнутые и отражённые варианты. +of.options.NATURAL_TEXTURES.tooltip.6=Предоставляются пакетами ресурсов. +of.options.NATURAL_TEXTURES.tooltip.7= +of.options.NATURAL_TEXTURES.tooltip.8= + +of.options.EMISSIVE_TEXTURES=Светящиеся текстуры +of.options.EMISSIVE_TEXTURES.tooltip.1=Светящиеся текстуры +of.options.EMISSIVE_TEXTURES.tooltip.2= Выкл - без светящихся текстур (по умолчанию) +of.options.EMISSIVE_TEXTURES.tooltip.3= Вкл - использование светящихся текстур +of.options.EMISSIVE_TEXTURES.tooltip.4=Светящиеся текстуры отображаются с полной яркостью. +of.options.EMISSIVE_TEXTURES.tooltip.5=Их можно использовать для имитации светоизлучения +of.options.EMISSIVE_TEXTURES.tooltip.6=частей основной текстуры. +of.options.EMISSIVE_TEXTURES.tooltip.7=Предоставляются пакетами ресурсов. +of.options.EMISSIVE_TEXTURES.tooltip.8= + +of.options.CUSTOM_SKY=Текстуры неба +of.options.CUSTOM_SKY.tooltip.1=Пользовательские текстуры неба +of.options.CUSTOM_SKY.tooltip.2= Вкл - небо с пользоват. текстурами (по умолчанию) +of.options.CUSTOM_SKY.tooltip.3= Выкл - стандартные текстуры неба, быстрее +of.options.CUSTOM_SKY.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_SKY.tooltip.5= + +of.options.CUSTOM_ITEMS=Текстуры предметов +of.options.CUSTOM_ITEMS.tooltip.1=Пользовательские текстуры предметов +of.options.CUSTOM_ITEMS.tooltip.2= Вкл - предметы с пользоват. текстурами (по умолчанию) +of.options.CUSTOM_ITEMS.tooltip.3= Выкл - стандартные текстуры предметов, быстрее +of.options.CUSTOM_ITEMS.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_ITEMS.tooltip.5= + +of.options.CUSTOM_ENTITY_MODELS=Модели сущностей +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Пользовательские модели сущностей +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Вкл - сущности с пользоват. моделями (по умолчанию) +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Выкл - стандартные модели сущностей, быстрее +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Предоставляются пакетами ресурсов. +of.options.CUSTOM_ENTITY_MODELS.tooltip.5= + +of.options.CUSTOM_GUIS=Интерфейс +of.options.CUSTOM_GUIS.tooltip.1=Пользовательский интерфейс +of.options.CUSTOM_GUIS.tooltip.2= Вкл - пользовательский интерфейс (по умолчанию) +of.options.CUSTOM_GUIS.tooltip.3= Выкл - стандартный интерфейс, быстрее +of.options.CUSTOM_GUIS.tooltip.4=Предоставляется пакетами ресурсов. + +# Элементы игры + +of.options.CLOUDS=Облака +of.options.CLOUDS.tooltip.1=Отображение облаков +of.options.CLOUDS.tooltip.2= По умолчанию - согласно настройкам графики +of.options.CLOUDS.tooltip.3= Быстро - двухмерные облака, быстрее +of.options.CLOUDS.tooltip.4= Детально - трёхмерные облака, медленнее +of.options.CLOUDS.tooltip.5= Выкл - облака отключены, ещё быстрее +of.options.CLOUDS.tooltip.6= +of.options.CLOUDS.tooltip.7= + +of.options.CLOUD_HEIGHT=Высота облаков +of.options.CLOUD_HEIGHT.tooltip.1=Высота облаков +of.options.CLOUD_HEIGHT.tooltip.2= Выкл - высота по умолчанию +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - над ограничением высоты мира + +of.options.TREES=Листья +of.options.TREES.tooltip.1=Отображение листьев +of.options.TREES.tooltip.2= По умолчанию - согласно настройкам графики +of.options.TREES.tooltip.3= Быстро - непрозрачные листья, быстрее +of.options.TREES.tooltip.4= Умно - прозрачные листья без текстур между ними +of.options.TREES.tooltip.5= Детально - прозрачные листья, медленнее +of.options.TREES.tooltip.6= +of.options.TREES.tooltip.7= + +of.options.RAIN=Дождь и снег +of.options.RAIN.tooltip.1=Отображение дождя и снега +of.options.RAIN.tooltip.2= По умолчанию - согласно настройкам графики +of.options.RAIN.tooltip.3= Быстро - лёгкий дождь/снег, быстрее +of.options.RAIN.tooltip.4= Детально - сильный дождь/снег, медленнее +of.options.RAIN.tooltip.5= Выкл - без дождя/снега, ещё быстрее +of.options.RAIN.tooltip.6=Не влияет на брызги и звуки дождя. +of.options.RAIN.tooltip.7= + +of.options.SKY=Небо +of.options.SKY.tooltip.1=Отображение неба +of.options.SKY.tooltip.2= Вкл - небо видно, медленнее +of.options.SKY.tooltip.3= Выкл - небо не видно, быстрее +of.options.SKY.tooltip.4=Не влияет на солнце и луну. + +of.options.STARS=Звёзды +of.options.STARS.tooltip.1=Отображение звёзд +of.options.STARS.tooltip.2= Вкл - звёзды видны, медленнее +of.options.STARS.tooltip.3= Выкл - звёзды не видны, быстрее + +of.options.SUN_MOON=Солнце и луна +of.options.SUN_MOON.tooltip.1=Отображение солнца и луны +of.options.SUN_MOON.tooltip.2= Вкл - солнце и луна видны (по умолчанию) +of.options.SUN_MOON.tooltip.3= Выкл - солнце и луна не видны, быстрее + +of.options.SHOW_CAPES=Плащи +of.options.SHOW_CAPES.tooltip.1=Отображение плащей игроков +of.options.SHOW_CAPES.tooltip.2= Вкл - плащи видны (по умолчанию) +of.options.SHOW_CAPES.tooltip.3= Выкл - плащи не видны + +of.options.FOG_FANCY=Туман +of.options.FOG_FANCY.tooltip.1=Тип тумана +of.options.FOG_FANCY.tooltip.2= Быстро - быстрый туман +of.options.FOG_FANCY.tooltip.3= Детально - густой туман +of.options.FOG_FANCY.tooltip.4= Выкл - туман отключён, быстрее +of.options.FOG_FANCY.tooltip.5=Густой туман должен поддерживаться видеокартой. +of.options.FOG_FANCY.tooltip.6= + +of.options.FOG_START=Удалённость тумана +of.options.FOG_START.tooltip.1=Удалённость тумана +of.options.FOG_START.tooltip.2= 0.2 - начало тумана рядом с игроком +of.options.FOG_START.tooltip.3= 0.8 - начало тумана вдали от игрока +of.options.FOG_START.tooltip.4=Обычно не влияет на производительность. + +of.options.TRANSLUCENT_BLOCKS=Прозрачность +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Прозрачность блоков +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Детально - правильное смешивание (по умолчанию) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Быстро - быстрое смешивание, быстрее +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Управляет смешиванием цветов прозрачных блоков +of.options.TRANSLUCENT_BLOCKS.tooltip.5=разного цвета (стекло, вода, лёд), размещённых друг +of.options.TRANSLUCENT_BLOCKS.tooltip.6=за другом с воздухом между ними. + +of.options.HELD_ITEM_TOOLTIPS=Подсказка о предмете +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Всплывающая подсказка об удерживаемом предмете. +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Вкл - показывать всплывающую подсказку (по умолчанию) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Выкл - не показывать всплывающую подсказку + +of.options.DROPPED_ITEMS=Предметы +of.options.DROPPED_ITEMS.tooltip.1=Отображение выкинутых предметов +of.options.DROPPED_ITEMS.tooltip.2= По умолчанию - согласно настройкам графики +of.options.DROPPED_ITEMS.tooltip.3= Быстро - двухмерные предметы, быстрее +of.options.DROPPED_ITEMS.tooltip.4= Детально - трёхмерные предметы, медленнее + +options.entityShadows.tooltip.1=Тени сущностей +options.entityShadows.tooltip.2= Вкл - тени сущностей видны +options.entityShadows.tooltip.3= Выкл - тени сущностей не видны + +of.options.VIGNETTE=Виньетка +of.options.VIGNETTE.tooltip.1=Виньетирование +of.options.VIGNETTE.tooltip.2= По умолчанию - согласно настройкам графики +of.options.VIGNETTE.tooltip.3= Быстро - виньетирование отключено, быстрее +of.options.VIGNETTE.tooltip.4= Детально - виньетирование включено, медленнее +of.options.VIGNETTE.tooltip.5=Слегка затемняет края экрана. +of.options.VIGNETTE.tooltip.6=Может оказывать значительное влияние на частоту +of.options.VIGNETTE.tooltip.7=кадров, особенно при игре в полноэкранном режиме. +of.options.VIGNETTE.tooltip.8= + +of.options.ALTERNATE_BLOCKS=Альтернативные блоки +of.options.ALTERNATE_BLOCKS.tooltip.1=Альтернативные модели блоков +of.options.ALTERNATE_BLOCKS.tooltip.2=Использует альтернативные модели блоков. +of.options.ALTERNATE_BLOCKS.tooltip.3=Зависит от выбранного пакета ресурсов. + +# Производительность + +of.options.SMOOTH_FPS=Стабилизизация FPS +of.options.SMOOTH_FPS.tooltip.1=Стабилизизация частоты кадров +of.options.SMOOTH_FPS.tooltip.2= Выкл - частота кадров может колебаться +of.options.SMOOTH_FPS.tooltip.3= Вкл - частота кадров стабилизируется +of.options.SMOOTH_FPS.tooltip.4=Стабилизирует частоту кадров посредством очистки +of.options.SMOOTH_FPS.tooltip.5=буфера видеокарты. Зависит от видеодрайвера; +of.options.SMOOTH_FPS.tooltip.6=результат стабилизации не всегда виден. + +of.options.SMOOTH_WORLD=Стабилизация мира +of.options.SMOOTH_WORLD.tooltip.1=Стабилизация мира +of.options.SMOOTH_WORLD.tooltip.2= Выкл - частота кадров может колебаться +of.options.SMOOTH_WORLD.tooltip.3= Вкл - частота кадров стабилизируется +of.options.SMOOTH_WORLD.tooltip.4=Убирает задержки, созданные внутренним сервером. +of.options.SMOOTH_WORLD.tooltip.5=Распределяет нагрузку на внутренний сервер. +of.options.SMOOTH_WORLD.tooltip.6=Действует только в локальных мирах (одиночная игра). + +of.options.FAST_RENDER=Быстрый рендер +of.options.FAST_RENDER.tooltip.1=Быстрый рендеринг +of.options.FAST_RENDER.tooltip.2= Выкл - стандартный рендеринг (по умолчанию) +of.options.FAST_RENDER.tooltip.3= Вкл - оптимизированный рендеринг, быстрее +of.options.FAST_RENDER.tooltip.4=Использует оптимизированный алгоритм рендеринга, +of.options.FAST_RENDER.tooltip.5=который уменьшает нагрузку на ГП и может существенно +of.options.FAST_RENDER.tooltip.6=повысить частоту кадров. + +of.options.FAST_MATH=Быстрое вычисление +of.options.FAST_MATH.tooltip.1=Быстрое вычисление +of.options.FAST_MATH.tooltip.2= Выкл - стандартное вычисление (по умолчанию) +of.options.FAST_MATH.tooltip.3= Вкл - быстрое вычисление +of.options.FAST_MATH.tooltip.4=Использует оптимизированные функции sin() и cos(), +of.options.FAST_MATH.tooltip.5=из-за чего появляется возможность лучше использовать +of.options.FAST_MATH.tooltip.6=кэш процессора и повысить частоту кадров. + +of.options.CHUNK_UPDATES=Обновление чанков +of.options.CHUNK_UPDATES.tooltip.1=Частота обновления чанков +of.options.CHUNK_UPDATES.tooltip.2= 1 - стандартная загрузка мира, высокая частота кадров +of.options.CHUNK_UPDATES.tooltip.3= 3 - быстрая загрузка мира, пониженная частота кадров +of.options.CHUNK_UPDATES.tooltip.4= 5 - быстрейшая загрузка мира, низкая частота кадров +of.options.CHUNK_UPDATES.tooltip.5=Количество обновлений чанков за один кадр. +of.options.CHUNK_UPDATES.tooltip.6=Высокие значения могут дестабилизировать частоту кадров. + +of.options.CHUNK_UPDATES_DYNAMIC=Динамич. обновление +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Динамическое обновление чанков +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Выкл - стандартное обновление чанков (по умолчанию) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Вкл - динамическое обновление чанков +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Когда игрок стоит на месте, чанки обновляются чаще +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=для того, чтобы мир загрузился быстрее. + +of.options.LAZY_CHUNK_LOADING=Медленные чанки +of.options.LAZY_CHUNK_LOADING.tooltip.1=Медленная загрузка чанков +of.options.LAZY_CHUNK_LOADING.tooltip.2= Выкл - стандартная загрузка чанков сервера +of.options.LAZY_CHUNK_LOADING.tooltip.3= Вкл - медленная загрузка чанков сервера (плавнее) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Стабилизирует загрузку чанков внутреннего сервера, +of.options.LAZY_CHUNK_LOADING.tooltip.5=распределяя её на несколько тактов. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Выключите, если части мира загружаются некорректно. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Действует только в локальных мирах (одиночная игра). + +# Анимация + +of.options.animation.allOn=Включить всё +of.options.animation.allOff=Выключить всё +of.options.animation.dynamic=Динамическая + +of.options.ANIMATED_WATER=Анимация воды +of.options.ANIMATED_LAVA=Анимация лавы +of.options.ANIMATED_FIRE=Анимация огня +of.options.ANIMATED_PORTAL=Анимация портала +of.options.ANIMATED_REDSTONE=Анимация редстоуна +of.options.ANIMATED_EXPLOSION=Анимация взрыва +of.options.ANIMATED_FLAME=Анимация пламени +of.options.ANIMATED_SMOKE=Анимация дыма +of.options.VOID_PARTICLES=Частицы пустоты +of.options.WATER_PARTICLES=Частицы воды +of.options.RAIN_SPLASH=Брызги дождя +of.options.PORTAL_PARTICLES=Частицы портала +of.options.POTION_PARTICLES=Частицы зелья +of.options.DRIPPING_WATER_LAVA=Капающая вода/лава +of.options.ANIMATED_TERRAIN=Анимация местности +of.options.ANIMATED_TEXTURES=Анимация текстур +of.options.FIREWORK_PARTICLES=Частицы фейерверка + +# Прочее + +of.options.LAGOMETER=Лагометр +of.options.LAGOMETER.tooltip.1=Показывает лагометр на экране отладки (F3). +of.options.LAGOMETER.tooltip.2=* §4Красный§r - обновление чанков +of.options.LAGOMETER.tooltip.3=* §6Оранжевый§r - сборщик мусора памяти +of.options.LAGOMETER.tooltip.4=* §eЖёлтый§r - проверка видимости +of.options.LAGOMETER.tooltip.5=* §aЗелёный§r - рендеринг местности +of.options.LAGOMETER.tooltip.6=* §bГолубой§r - такт +of.options.LAGOMETER.tooltip.7=* §9Синий§r - запланированные исполняемые файлы +of.options.LAGOMETER.tooltip.8=* §5Фиолетовый§r - загрузка чанков + +of.options.PROFILER=Профайлер +of.options.PROFILER.tooltip.1=Отладочный профайлер +of.options.PROFILER.tooltip.2= Вкл - профайлер активен, медленнее +of.options.PROFILER.tooltip.3= Выкл - профайлер неактивен, быстрее +of.options.PROFILER.tooltip.4=Собирает и показывает дополнительную информацию на +of.options.PROFILER.tooltip.5=экране отладки (F3). + +of.options.SHOW_FPS=Отображение FPS +of.options.SHOW_FPS.tooltip.1=Отображение компактной информации о рендере +of.options.SHOW_FPS.tooltip.2= C: - отображаемые чанки +of.options.SHOW_FPS.tooltip.3= E: - отображаемые сущности + блоки-сущности +of.options.SHOW_FPS.tooltip.4= U: - обновление чанка +of.options.SHOW_FPS.tooltip.5=Отображает компактную информацию о рендере, когда +of.options.SHOW_FPS.tooltip.6=отключён экран отладки. + +of.options.ADVANCED_TOOLTIPS=Расширен. подсказки +of.options.ADVANCED_TOOLTIPS.tooltip.1=Расширенные подсказки +of.options.ADVANCED_TOOLTIPS.tooltip.2= Вкл - доп. информация включена +of.options.ADVANCED_TOOLTIPS.tooltip.3= Выкл - доп. информация отключена (по умолчанию) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Показывает дополнительную информацию о предметах +of.options.ADVANCED_TOOLTIPS.tooltip.5=и о параметрах шейдеров (ID, файл и т. д.). +of.options.ADVANCED_TOOLTIPS.tooltip.6= + +of.options.WEATHER=Погода +of.options.WEATHER.tooltip.1=Погода +of.options.WEATHER.tooltip.2= Вкл - погода активна, медленнее +of.options.WEATHER.tooltip.3= Выкл - погода неактивна, быстрее +of.options.WEATHER.tooltip.4=Контролирует дождь, снег и грозу. +of.options.WEATHER.tooltip.5=Действует только в локальных мирах. + +of.options.TIME=Время суток +of.options.TIME.tooltip.1=Время суток +of.options.TIME.tooltip.2= По умолчанию - нормальный цикл дня и ночи +of.options.TIME.tooltip.3= Всегда день - только дневное время +of.options.TIME.tooltip.4= Всегда ночь - только ночное время +of.options.TIME.tooltip.5=Действует только в ТВОРЧЕСКОМ режиме игры и только +of.options.TIME.tooltip.6=в локальных мирах. + +of.options.time.dayOnly=Всегда день +of.options.time.nightOnly=Всегда ночь + +options.fullscreen.tooltip.1=Полноэкранный режим +options.fullscreen.tooltip.2= Вкл - использовать полноэкранный режим +options.fullscreen.tooltip.3= Выкл - использовать оконный режим +options.fullscreen.tooltip.4=Полноэкранный режим может быть как производительнее +options.fullscreen.tooltip.5=оконного, так и нет — всё зависит от видеокарты. + +of.options.FULLSCREEN_MODE=Разрешение +of.options.FULLSCREEN_MODE.tooltip.1=Разрешение экрана в полноэкранном режиме +of.options.FULLSCREEN_MODE.tooltip.2= По умолчанию - разрешение рабочего стола, медленнее +of.options.FULLSCREEN_MODE.tooltip.3= ШxВ - выбранное разрешение, возможно быстрее +of.options.FULLSCREEN_MODE.tooltip.4=Выбранное разрешение используется в полноэкранном +of.options.FULLSCREEN_MODE.tooltip.5=режиме (F11). Чем меньше значение, тем быстрее. + +options.anaglyph.tooltip.1=Анаглиф +options.anaglyph.tooltip.2=Стереоизображение, использующее различные цвета +options.anaglyph.tooltip.3=для каждого глаза. +options.anaglyph.tooltip.4=Для просмотра потребуются анаглифические очки. + +of.options.AUTOSAVE_TICKS=Автосохранение +of.options.AUTOSAVE_TICKS.tooltip.1=Интервал автосохранений +of.options.AUTOSAVE_TICKS.tooltip.2=Значение по умолчанию (2 секунды) НЕ РЕКОМЕНДУЕТСЯ. +of.options.AUTOSAVE_TICKS.tooltip.3=Может создавать кратковременные зависания. + +of.options.save.default=2 секунды +of.options.save.20s=20 секунд +of.options.save.3min=3 минуты +of.options.save.30min=30 минут + +of.options.SCREENSHOT_SIZE=Скриншот +of.options.SCREENSHOT_SIZE.tooltip.1=Разрешение скриншота +of.options.SCREENSHOT_SIZE.tooltip.2= По умолчанию - стандартное разрешение скриншота +of.options.SCREENSHOT_SIZE.tooltip.3= 2x–4x - множитель разрешения скриншота +of.options.SCREENSHOT_SIZE.tooltip.4=Чем больше значение, тем больше потребуется памяти. +of.options.SCREENSHOT_SIZE.tooltip.5=Необходима поддержка кадрового буфера ГП. +of.options.SCREENSHOT_SIZE.tooltip.6=Не совместимо с быстрым рендером и антиалиасингом. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/sv_SE.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/sv_SE.lang new file mode 100644 index 0000000..ddffba5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/sv_SE.lang @@ -0,0 +1,684 @@ +# Contributors of Swedish localization # +# Regnander (_Spitz) 2016-01-18 ---- 2017-11-28 + +# General +of.general.ambiguous=tvetydig +of.general.custom=Anpassad +of.general.from=Från +of.general.id=ID +of.general.restart=starta om +of.general.smart=Smart + +# Keys +of.key.zoom=Zooma in + +# Message +of.message.aa.shaders1=Kantutjämning är inte kompatibel med Shaders. +of.message.aa.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.af.shaders1=Anisotropisk filtrering är inte kompatibel med Shaders. +of.message.af.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.fr.shaders1=Snabb rendering är inte kompatibel med Shaders. +of.message.fr.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.an.shaders1=3D-effekt är inte kompatibel med Shaders. +of.message.an.shaders2=Inaktivera Shaders för att aktivera detta alternativ. + +of.message.shaders.aa1=Shaders är inte kompatibla med Kantutjämning. +of.message.shaders.aa2=Ändra "Kvalitet -> Kantutjämning" till AV och starta om spelet. + +of.message.shaders.af1=Shaders är inte kompatibla med Anisotropisk filtrering. +of.message.shaders.af2=Ändra "Kvalitet -> Anisotropisk filtrering" till AV. + +of.message.shaders.fr1=Shaders är inte kompatibla med Snabb rendering. +of.message.shaders.fr2=Ändra "Prestanda -> Snabb rendering" till AV. + +of.message.shaders.an1=Shaders är inte kompatibla med 3D-effekt. +of.message.shaders.an2=Ändra "Övrigt -> 3D-effekt" till AV. + +of.message.newVersion=En ny version av §eOptiFine§f finns tillgänglig: §e%s§f +of.message.java64Bit=Du kan installera §e64-bitarsversionen av Java§f för att förbättra prestandan. +of.message.openglError=§eOpenGL-fel§f: %s (%s) + +of.message.shaders.loading=Läser in shaders: %s + +of.message.other.reset=Återställ alla grafikinställningar till dess standardvärden? + +of.message.loadingVisibleChunks=Läser in synliga chunkar + +# Video settings + +options.graphics.tooltip.1=Visuell kvalitet +options.graphics.tooltip.2= Snabbt - lägre kvalitet, snabbare +options.graphics.tooltip.3= Snyggt - högre kvalitet, långsammare +options.graphics.tooltip.4=Ändrar utseendet för moln, löv, vatten, skuggor och +options.graphics.tooltip.5=gräskanter. + +of.options.renderDistance.tiny=Litet +of.options.renderDistance.short=Kort +of.options.renderDistance.normal=Normalt +of.options.renderDistance.far=Långt +of.options.renderDistance.extreme=Extremt +of.options.renderDistance.insane=Galet +of.options.renderDistance.ludicrous=Löjligt + +options.renderDistance.tooltip.1=Synligt avstånd +options.renderDistance.tooltip.2= 2 Litet - 32m (snabbast) +options.renderDistance.tooltip.3= 4 Kort - 64m (snabbare) +options.renderDistance.tooltip.4= 8 Normalt - 128m +options.renderDistance.tooltip.5= 16 Långt - 256m (långsammare) +options.renderDistance.tooltip.6= 32 Extremt - 512m (långsammast!) +options.renderDistance.tooltip.7=Avståndet Extremt är mycket resurskrävande! +options.renderDistance.tooltip.8=Värden över 16 fungerar endast i lokala världar. + +options.ao.tooltip.1=Ljusutjämning +options.ao.tooltip.2= AV - ingen ljusutjämning (snabbast) +options.ao.tooltip.3= Minimum - enkel ljusutjämning (långsammare) +options.ao.tooltip.4= Maximum - avancerad ljusutjämning (långsammast) + +options.framerateLimit.tooltip.1=Maximal bildfrekvens +options.framerateLimit.tooltip.2= VSync - använder skärmens bildfrekvens (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - variabel +options.framerateLimit.tooltip.4= Oändlig - ingen begränsning (snabbast) +options.framerateLimit.tooltip.5=Bildfrekvensens gräns reducerar bildfrekvensen även +options.framerateLimit.tooltip.6=om gränsens värde inte nås. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Ljusutjämningsnivå +of.options.AO_LEVEL.tooltip.1=Ljusutjämningsnivå +of.options.AO_LEVEL.tooltip.2= AV - inga skuggor +of.options.AO_LEVEL.tooltip.3= 50%% - ljusa skuggor +of.options.AO_LEVEL.tooltip.4= 100%% - mörka skuggor + +options.viewBobbing.tooltip.1=Mer verklighetstrogna rörelser. +options.viewBobbing.tooltip.2=Inaktivera detta om mipmaps används för bästa resultat. + +options.guiScale.tooltip.1=GUI-skala +options.guiScale.tooltip.2= Automatisk - maximal storlek +options.guiScale.tooltip.3= Liten, Normal, Stor - 1x till 3x +options.guiScale.tooltip.4= 4x till 10x - tillgänglig på 4K-skärmar +options.guiScale.tooltip.5=Udda värden (1x, 3x, 5x...) är inte kompatibla med Unicode. +options.guiScale.tooltip.6=Ett mindre GUI kan vara snabbare. + +options.vbo.tooltip.1=Vertex Buffer Objects +options.vbo.tooltip.2=Använder en alternativ renderingsmodell som vanligtvis +options.vbo.tooltip.3=är snabbare (5-10%%) än standardrenderingen. + +options.gamma.tooltip.1=Ändrar ljusstyrkan för mörkare objekt. +options.gamma.tooltip.2= Mörkt - standardljusstyrka +options.gamma.tooltip.3= 1-99%% - variabel +options.gamma.tooltip.4= Ljust - maximal ljusstyrka för mörkare objekt +options.gamma.tooltip.5=Detta alternativ ändrar inte ljusstyrkan för helt svarta +options.gamma.tooltip.6=objekt. + +options.anaglyph.tooltip.1=3D-effekt +options.anaglyph.tooltip.2=Aktiverar en stereoskopisk 3D-effekt med hjälp av olika +options.anaglyph.tooltip.3=färger för varje öga. +options.anaglyph.tooltip.4=Kräver röd-turkosa glasögon för bästa resultat. + +options.blockAlternatives.tooltip.1=Alternativa block +options.blockAlternatives.tooltip.2=Använder alternativa blockmodeller för samma block. +options.blockAlternatives.tooltip.3=Beror på valt resurspaket. + +of.options.ALTERNATE_BLOCKS=Alternerade block +of.options.ALTERNATE_BLOCKS.tooltip.1=Alternerade block +of.options.ALTERNATE_BLOCKS.tooltip.2=Använder alternativa blockmodeller för en del block. +of.options.ALTERNATE_BLOCKS.tooltip.3=Förlitar sig på aktuellt resurspaket. + +of.options.FOG_FANCY=Dimma +of.options.FOG_FANCY.tooltip.1=Typ av dimma +of.options.FOG_FANCY.tooltip.2= Snabbt - snabbare dimma +of.options.FOG_FANCY.tooltip.3= Snyggt - långsammare dimma, ser bättre ut +of.options.FOG_FANCY.tooltip.4= AV - ingen dimma, snabbast +of.options.FOG_FANCY.tooltip.5=Snygg dimma finns bara tillgänglig om det stöds av +of.options.FOG_FANCY.tooltip.6=grafikkortet. + +of.options.FOG_START=Startgräns för dimma +of.options.FOG_START.tooltip.1=Startgräns för dimma +of.options.FOG_START.tooltip.2= 0.2 - dimman börjar nära spelaren +of.options.FOG_START.tooltip.3= 0.8 - dimman börjar långt bort från spelaren +of.options.FOG_START.tooltip.4=Detta alternativ påverkar vanligtvis inte prestandan. + +of.options.CHUNK_LOADING=Chunkinläsning +of.options.CHUNK_LOADING.tooltip.1=Chunkinläsning +of.options.CHUNK_LOADING.tooltip.2= Standard - ostabil bildfrekvens när chunks läses in +of.options.CHUNK_LOADING.tooltip.3= Jämn - stabil bildfrekvens +of.options.CHUNK_LOADING.tooltip.4= Flerkärnig - stabil bildfrekvens, 3x snabbare inläsning +of.options.CHUNK_LOADING.tooltip.5=Jämn och Flerkärnig tar bort ryckningar och +of.options.CHUNK_LOADING.tooltip.6=frysningar som orsakas av inlästa chunkar. +of.options.CHUNK_LOADING.tooltip.7=Flerkärnig kan påskynda världens inläsning med 3x +of.options.CHUNK_LOADING.tooltip.8=och höja bildfrekvensen med en andra processorkärna. +of.options.chunkLoading.smooth=Jämn +of.options.chunkLoading.multiCore=Flerkärnig + +of.options.shaders=Shaders... +of.options.shadersTitle=Shaders + +of.options.shaders.packNone=AV +of.options.shaders.packDefault=(intern) + +of.options.shaders.ANTIALIASING=Kantutjämning +of.options.shaders.ANTIALIASING.tooltip.1=Kantutjämning +of.options.shaders.ANTIALIASING.tooltip.2= AV - (standard) ingen kantutjämning (snabbare) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - utjämnade linjer och kanter (långsammare) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA är en efterbehandlingseffekt som jämnar ut +of.options.shaders.ANTIALIASING.tooltip.5=taggiga linjer och skarpa färgskiftningar. +of.options.shaders.ANTIALIASING.tooltip.6=Den är snabbare än den traditionella kantutjämningen +of.options.shaders.ANTIALIASING.tooltip.7=samt är kompatibel med shaders och Snabb rendering. + +of.options.shaders.NORMAL_MAP=Normal map +of.options.shaders.NORMAL_MAP.tooltip.1=Normal map +of.options.shaders.NORMAL_MAP.tooltip.2= PÅ - (standard) aktivera normal maps +of.options.shaders.NORMAL_MAP.tooltip.3= AV - inaktivera normal maps +of.options.shaders.NORMAL_MAP.tooltip.4=Shaderpaketet kan använda normal maps för att simulera +of.options.shaders.NORMAL_MAP.tooltip.5=3D-geometri på platta modellytor. +of.options.shaders.NORMAL_MAP.tooltip.6=Texturer för normal maps tillhandahålls av det aktuella +of.options.shaders.NORMAL_MAP.tooltip.7=resurspaketet. + +of.options.shaders.SPECULAR_MAP=Specular map +of.options.shaders.SPECULAR_MAP.tooltip.1=Specular map +of.options.shaders.SPECULAR_MAP.tooltip.2= PÅ - (standard) aktivera specular maps +of.options.shaders.SPECULAR_MAP.tooltip.3= AV - inaktivera specular maps +of.options.shaders.SPECULAR_MAP.tooltip.4=Shaderpaketet kan använda specular maps för att +of.options.shaders.SPECULAR_MAP.tooltip.5=simulera speciella reflektionseffekter. +of.options.shaders.SPECULAR_MAP.tooltip.6=Texturer för specular maps tillhandahålls av det +of.options.shaders.SPECULAR_MAP.tooltip.7=aktuella resurspaketet. + +of.options.shaders.RENDER_RES_MUL=Renderingskvalitet +of.options.shaders.RENDER_RES_MUL.tooltip.1=Renderingskvalitet +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - låg (snabbast) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - standard (standard) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - hög (långsammast) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Renderingskvalitet kontrollerar storleken på texturen +of.options.shaders.RENDER_RES_MUL.tooltip.6=som shaderpaketet renderar till. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Lägre värden kan vara användbara på 4K-skärmar. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Högre värden fungerar som ett kantutjämnande filter. + +of.options.shaders.SHADOW_RES_MUL=Skuggkvalitet +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Skuggkvalitet +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - låg (snabbast) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - standard (standard) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - hög (långsammast) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Skuggkvalitet kontrollerar storleken på texturen för +of.options.shaders.SHADOW_RES_MUL.tooltip.6=shadow map som används i shaderpaketet. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Lägre kvalitet = enkla grova skuggor. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Högre kvalitet = detaljerade fina skuggor. + +of.options.shaders.HAND_DEPTH_MUL=Handdjup +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Handdjup +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - handen är nära kameran +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (standard) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - handen är långt bort från kameran +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Handdjup kontrollerar hur långt bort handhållna +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=föremål är från kameran. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=För shaderpaket som använder skärpedjup bör detta +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=ändra hur suddiga handhålla föremål blir. + +of.options.shaders.CLOUD_SHADOW=Molnskugga + +of.options.shaders.OLD_HAND_LIGHT=G. handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Gammalt handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Standard - kontrolleras av shaderpaketet +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= PÅ - använd gammalt handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= AV - använd nytt handljus +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Gammalt handljus låter shaderpaket som endast känner +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=igen ljusavgivande föremål i den primära handen också +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=fungera med föremål i den sekundära handen. + +of.options.shaders.OLD_LIGHTING=Gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.1=Gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.2= Standard - kontrolleras av shaderpaketet +of.options.shaders.OLD_LIGHTING.tooltip.3= PÅ - använd gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.4= AV - använd inte gammalt ljus +of.options.shaders.OLD_LIGHTING.tooltip.5=Gammalt ljus kontrollerar det fasta ljuset som tillämpas +of.options.shaders.OLD_LIGHTING.tooltip.6=på blocksidor som standard. +of.options.shaders.OLD_LIGHTING.tooltip.7=Shaderpaket som använder skuggor ger vanligtvis +of.options.shaders.OLD_LIGHTING.tooltip.8=mycket bättre ljus som är beroende av solens position. + +of.options.shaders.SHADER_PACK=Shaderpaket + +of.options.shaders.shadersFolder=Shadermapp +of.options.shaders.shaderOptions=Shaderalternativ... + +of.options.shaderOptionsTitle=Shaderalternativ + +of.options.quality=Kvalitet... +of.options.qualityTitle=Kvalitetsinställningar + +of.options.details=Detaljer... +of.options.detailsTitle=Detaljinställningar + +of.options.performance=Prestanda... +of.options.performanceTitle=Prestandainställningar + +of.options.animations=Animeringar... +of.options.animationsTitle=Animeringsinställningar + +of.options.other=Övrigt... +of.options.otherTitle=Övriga inställningar + +of.options.other.reset=Återställ grafikinställningar... + +of.shaders.profile=Profil + +# Quality + +of.options.mipmap.bilinear=Bilinjärt +of.options.mipmap.linear=Linjärt +of.options.mipmap.nearest=Närmast +of.options.mipmap.trilinear=Trilinjärt + +options.mipmapLevels.tooltip.1=Visuell effekt som gör att objekt på avstånd ser bättre +options.mipmapLevels.tooltip.2=ut genom att jämna ut texturdetaljerna. +options.mipmapLevels.tooltip.3= AV - ingen utjämning +options.mipmapLevels.tooltip.4= 1 - minimal utjämning +options.mipmapLevels.tooltip.5= 4 - maximal utjämning +options.mipmapLevels.tooltip.6=Detta alternativ påverkar vanligtvis inte prestandan. + +of.options.MIPMAP_TYPE=Mipmaptyp +of.options.MIPMAP_TYPE.tooltip.1=Visuell effekt som gör att objekt på avstånd ser bättre +of.options.MIPMAP_TYPE.tooltip.2=ut genom att jämna ut texturdetaljerna. +of.options.MIPMAP_TYPE.tooltip.3= Närmast - grov utjämning (snabbast) +of.options.MIPMAP_TYPE.tooltip.4= Linjärt - normal utjämning +of.options.MIPMAP_TYPE.tooltip.5= Bilinjärt - fin utjämning +of.options.MIPMAP_TYPE.tooltip.6= Trilinjärt - finast utjämning (långsammast) + + +of.options.AA_LEVEL=Kantutjämning +of.options.AA_LEVEL.tooltip.1=Kantutjämning +of.options.AA_LEVEL.tooltip.2= AV - ingen kantutjämning (standard, snabbare) +of.options.AA_LEVEL.tooltip.3= 2-16 - kantutjämnade linjer och kanter (långsammare) +of.options.AA_LEVEL.tooltip.4=Kantutjämningen jämnar ur ojämna linjer och skarpa +of.options.AA_LEVEL.tooltip.5=färgövergångar. +of.options.AA_LEVEL.tooltip.6=Bildfrekvensen kan sjunka avsevärt när detta aktiveras. +of.options.AA_LEVEL.tooltip.7=Alla nivåer stöds inte av alla grafikkort. +of.options.AA_LEVEL.tooltip.8=Kräver OMSTART! + +of.options.AF_LEVEL=Anisotropisk filtrering +of.options.AF_LEVEL.tooltip.1=Anisotropisk filtrering +of.options.AF_LEVEL.tooltip.2= AV - standarddetaljer för texturer (standard, snabbare) +of.options.AF_LEVEL.tooltip.3= 2-16 - finare detaljer i mipmaptexturer (långsammare) +of.options.AF_LEVEL.tooltip.4=Den anisotropiska filtreringen återställer detaljer i +of.options.AF_LEVEL.tooltip.5=mipmaptexturer. +of.options.AF_LEVEL.tooltip.6=Bildfrekvensen kan sjunka avsevärt när detta aktiveras. + +of.options.CLEAR_WATER=Kristallklart vatten +of.options.CLEAR_WATER.tooltip.1=Kristallklart vatten +of.options.CLEAR_WATER.tooltip.2= PÅ - kristallklart, genomskinligt vatten +of.options.CLEAR_WATER.tooltip.3= AV - standardvatten + +of.options.RANDOM_MOBS=Slumpade monster +of.options.RANDOM_MOBS.tooltip.1=Slumpade monster +of.options.RANDOM_MOBS.tooltip.2= AV - inga slumpade monster, snabbare +of.options.RANDOM_MOBS.tooltip.3= PÅ - slumpade monster, långsammare +of.options.RANDOM_MOBS.tooltip.4=Använder slumpade texturer för spelets varelser. +of.options.RANDOM_MOBS.tooltip.5=Kräver ett resurspaket med flera monstertexturer. + +of.options.BETTER_GRASS=Bättre gräs +of.options.BETTER_GRASS.tooltip.1=Bättre gräs +of.options.BETTER_GRASS.tooltip.2= AV - standardtextur för gräskanter, snabbast +of.options.BETTER_GRASS.tooltip.3= Snabbt - fullständig textur för gräskanter, långsammare +of.options.BETTER_GRASS.tooltip.4= Snyggt - dynamisk textur för gräskanter, långsammast + +of.options.BETTER_SNOW=Bättre snö +of.options.BETTER_SNOW.tooltip.1=Bättre snö +of.options.BETTER_SNOW.tooltip.2= AV - standardsnö, snabbare +of.options.BETTER_SNOW.tooltip.3= PÅ - bättre snö, långsammare +of.options.BETTER_SNOW.tooltip.4=Visar snö under genomskinliga block (staket, högt gräs) +of.options.BETTER_SNOW.tooltip.5=som angränsar till snöblock. + +of.options.CUSTOM_FONTS=Anpassade typsnitt +of.options.CUSTOM_FONTS.tooltip.1=Anpassade typsnitt +of.options.CUSTOM_FONTS.tooltip.2= PÅ - använd anpassade typsnitt (standard), långsammare +of.options.CUSTOM_FONTS.tooltip.3= AV - använd standardtypsnittet, snabbare +of.options.CUSTOM_FONTS.tooltip.4=De anpassade typsnitten tillhandahålls av det aktuella +of.options.CUSTOM_FONTS.tooltip.5=resurspaketet. + +of.options.CUSTOM_COLORS=Anpassade färger +of.options.CUSTOM_COLORS.tooltip.1=Anpassade färger +of.options.CUSTOM_COLORS.tooltip.2= PÅ - anpassade färger används (standard), långsammare +of.options.CUSTOM_COLORS.tooltip.3= AV - standardfärger används, snabbare +of.options.CUSTOM_COLORS.tooltip.4=De anpassade färgerna tillhandahålls av det aktuella +of.options.CUSTOM_COLORS.tooltip.5=resurspaketet + +of.options.SWAMP_COLORS=Träskfärger +of.options.SWAMP_COLORS.tooltip.1=Träskfärger +of.options.SWAMP_COLORS.tooltip.2= PÅ - använd träskfärger (standard), långsammare +of.options.SWAMP_COLORS.tooltip.3= AV - använd inte träskfärger, snabbare +of.options.SWAMP_COLORS.tooltip.4=Träskfärgerna påverkar gräs, löv, klätterväxter och +of.options.SWAMP_COLORS.tooltip.5=vatten. + +of.options.SMOOTH_BIOMES=Utjämnade biomer +of.options.SMOOTH_BIOMES.tooltip.1=Utjämnade biomer +of.options.SMOOTH_BIOMES.tooltip.2= PÅ - biomkanter jämnas ut (standard), långsammare +of.options.SMOOTH_BIOMES.tooltip.3= AV - biomkanter jämnas inte ut, snabbare +of.options.SMOOTH_BIOMES.tooltip.4=Biomkanterna jämnas ut genom att sampla och beräkna +of.options.SMOOTH_BIOMES.tooltip.5=medelvärdet av färgen för alla block runtomkring. +of.options.SMOOTH_BIOMES.tooltip.6=Gräs, löv, klätterväxter och vatten påverkas. + +of.options.CONNECTED_TEXTURES=Anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.1=Anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.2= AV - inga anslutande texturer (standard) +of.options.CONNECTED_TEXTURES.tooltip.3= Snabbt - snabba anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.4= Snyggt - snygga anslutande texturer +of.options.CONNECTED_TEXTURES.tooltip.5=Anslutande texturer sammanfogar texturerna för glas, +of.options.CONNECTED_TEXTURES.tooltip.6=sandsten och bokhyllor när de placeras intill varandra. +of.options.CONNECTED_TEXTURES.tooltip.7=De anslutande texturerna tillhandahålls av det aktuella +of.options.CONNECTED_TEXTURES.tooltip.8=resurspaketet. + +of.options.NATURAL_TEXTURES=Naturliga texturer +of.options.NATURAL_TEXTURES.tooltip.1=Naturliga texturer +of.options.NATURAL_TEXTURES.tooltip.2= AV - inga naturliga texturer (standard) +of.options.NATURAL_TEXTURES.tooltip.3= PÅ - använd naturliga texturer +of.options.NATURAL_TEXTURES.tooltip.4=Naturliga texturer tar bort rutnätsliknande mönster som +of.options.NATURAL_TEXTURES.tooltip.5=skapas från upprepade block av samma typ. +of.options.NATURAL_TEXTURES.tooltip.6=Den använder roterade och speglade varianter av den +of.options.NATURAL_TEXTURES.tooltip.7=ursprungliga blocktexturen. Konfigurationen för naturliga +of.options.NATURAL_TEXTURES.tooltip.8=texturer tillhandahålls av det aktuella resurspaketet. + +of.options.EMISSIVE_TEXTURES=Upplysta texturer +of.options.EMISSIVE_TEXTURES.tooltip.1=Upplysta texturer +of.options.EMISSIVE_TEXTURES.tooltip.2= AV - inga upplysta texturer (standard) +of.options.EMISSIVE_TEXTURES.tooltip.3= PÅ - använd upplysta texturer +of.options.EMISSIVE_TEXTURES.tooltip.4=De upplysta texturerna renderas som ett överlägg med +of.options.EMISSIVE_TEXTURES.tooltip.5=full ljusstyrka. De kan användas för att simulera +of.options.EMISSIVE_TEXTURES.tooltip.6=belysta delar av grundtexturen. +of.options.EMISSIVE_TEXTURES.tooltip.7=Upplysta texturer tillhandahålls av det aktuella +of.options.EMISSIVE_TEXTURES.tooltip.8=resurspaketet. + +of.options.CUSTOM_SKY=Anpassad himmel +of.options.CUSTOM_SKY.tooltip.1=Anpassad himmel +of.options.CUSTOM_SKY.tooltip.2= PÅ - anpassade himmeltexturer (standard), långsamt +of.options.CUSTOM_SKY.tooltip.3= AV - standardhimmel, snabbare +of.options.CUSTOM_SKY.tooltip.4=Texturerna för den anpassade himlen tillhandahålls av +of.options.CUSTOM_SKY.tooltip.5=det aktuella resurspaketet. + +of.options.CUSTOM_ITEMS=Anpassade föremål +of.options.CUSTOM_ITEMS.tooltip.1=Anpassade föremål +of.options.CUSTOM_ITEMS.tooltip.2= PÅ - anpassade föremålstexturer (standard), långsamt +of.options.CUSTOM_ITEMS.tooltip.3= AV - standardtexturer för föremål, snabbare +of.options.CUSTOM_ITEMS.tooltip.4=Det anpassade föremålstexturerna tillhandahålls av det +of.options.CUSTOM_ITEMS.tooltip.5=aktuella texturpaketet. + +of.options.CUSTOM_ENTITY_MODELS=Anp. entitetsmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Anpassade entitetsmodeller +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= PÅ - anpassade entitetsmodeller (standard), långsamt +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= AV - standardentitetsmodeller, snabbare +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=De anpassade entitetsmodellerna tillhandahålls av det +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=aktuella resurspaketet. + +of.options.CUSTOM_GUIS=Anpassade gränssnitt +of.options.CUSTOM_GUIS.tooltip.1=Anpassade gränssnitt +of.options.CUSTOM_GUIS.tooltip.2= PÅ - anpassade gränssnitt (standard), långsammare +of.options.CUSTOM_GUIS.tooltip.3= AV - standardgränssnitt, snabbare +of.options.CUSTOM_GUIS.tooltip.4=De anpassade gränssnitten tillhandahålls av det +of.options.CUSTOM_GUIS.tooltip.5=aktuella resurspaketet. + +# Details + +of.options.CLOUDS=Moln +of.options.CLOUDS.tooltip.1=Moln +of.options.CLOUDS.tooltip.2= Standard - följer grafikinställningarna +of.options.CLOUDS.tooltip.3= Snabbt - lägre kvalitet, snabbare +of.options.CLOUDS.tooltip.4= Snyggt - högre kvalitet, långsammare +of.options.CLOUDS.tooltip.5= AV - inga moln, snabbast +of.options.CLOUDS.tooltip.6=Snabba moln renderas i 2D. +of.options.CLOUDS.tooltip.7=Snygga moln renderas i 3D. + +of.options.CLOUD_HEIGHT=Molnhöjd +of.options.CLOUD_HEIGHT.tooltip.1=Molnhöjd +of.options.CLOUD_HEIGHT.tooltip.2= AV - standardhöjd +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - ovanför världens höjdgräns + +of.options.TREES=Träd +of.options.TREES.tooltip.1=Träd +of.options.TREES.tooltip.2= Standard - följer grafikinställningarna +of.options.TREES.tooltip.3= Snabbt - lägre kvalitet, snabbare +of.options.TREES.tooltip.4= Smart - högre kvalitet, snabbt +of.options.TREES.tooltip.5= Snyggt - högst kvalitet, långsammare +of.options.TREES.tooltip.6=Snabba träd har ogenomskinliga löv. +of.options.TREES.tooltip.7=Snygga och smarta träd har genomskinliga löv. + +of.options.RAIN=Regn och snö +of.options.RAIN.tooltip.1=Regn och snö +of.options.RAIN.tooltip.2= Standard - följer grafikinställningarna +of.options.RAIN.tooltip.3= Snabbt - lätt regn/snö, snabbare +of.options.RAIN.tooltip.4= Snyggt - tungt regn/snö, långsammare +of.options.RAIN.tooltip.5= AV - inget regn/snö, snabbast +of.options.RAIN.tooltip.6=Regnljud och regnstänk kommer fortfarande höras och +of.options.RAIN.tooltip.7=synas om regn stängs av. + +of.options.SKY=Himmel +of.options.SKY.tooltip.1=Himmel +of.options.SKY.tooltip.2= PÅ - himlen syns, långsammare +of.options.SKY.tooltip.3= AV - himlen syns inte, snabbare +of.options.SKY.tooltip.4=Om himlen inaktiveras syns fortfarande månen och solen. + +of.options.STARS=Stjärnor +of.options.STARS.tooltip.1=Stjärnor +of.options.STARS.tooltip.2= PÅ - stjärnor syns, långsammare +of.options.STARS.tooltip.3= AV - stjärnor syns inte, snabbare + +of.options.SUN_MOON=Sol och måne +of.options.SUN_MOON.tooltip.1=Sol och måne +of.options.SUN_MOON.tooltip.2= PÅ - solen och månen syns (standard) +of.options.SUN_MOON.tooltip.3= AV - solen och månen syns inte (snabbare) + +of.options.SHOW_CAPES=Visa mantlar +of.options.SHOW_CAPES.tooltip.1=Visa mantlar +of.options.SHOW_CAPES.tooltip.2= PÅ - visa spelarmantlar (standard) +of.options.SHOW_CAPES.tooltip.3= AV - visa inte spelarmantlar + +of.options.TRANSLUCENT_BLOCKS=Genomskinliga block +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Genomskinliga block +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Snyggt - korrekt färgblandning (standard) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Snabbt - snabb färgblandning (snabbare) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Kontrollerar färgblandningen för genomskinliga block med +of.options.TRANSLUCENT_BLOCKS.tooltip.5=olika färger (färgat glas, vatten, is) när de placeras +of.options.TRANSLUCENT_BLOCKS.tooltip.6=bakom varandra med luft emellan. + +of.options.HELD_ITEM_TOOLTIPS=Infotext för föremål +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Infotext för föremål +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= PÅ - visa infotext för hållna föremål (standard) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= AV - visa inte infotext för hållna föremål + +of.options.ADVANCED_TOOLTIPS=Avancerade inforutor +of.options.ADVANCED_TOOLTIPS.tooltip.1=Avancerade inforutor +of.options.ADVANCED_TOOLTIPS.tooltip.2= PÅ - visa avancerade inforutor +of.options.ADVANCED_TOOLTIPS.tooltip.3= AV - visa inte avancerade inforutor (standard) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Avancerade inforutor visar ytterligare information om +of.options.ADVANCED_TOOLTIPS.tooltip.5=föremål (id, hållbarhet) och shaderalternativ +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, källa, standardvärden). + +of.options.DROPPED_ITEMS=Släppta föremål +of.options.DROPPED_ITEMS.tooltip.1=Släppta föremål +of.options.DROPPED_ITEMS.tooltip.2= Standard - följer grafikinställningarna +of.options.DROPPED_ITEMS.tooltip.3= Snabbt - renderas i 2D, snabbare +of.options.DROPPED_ITEMS.tooltip.4= Snyggt - renderas i 3D, långsammare + +options.entityShadows.tooltip.1=Entitetsskuggor +options.entityShadows.tooltip.2= PÅ - visa entitetsskuggor +options.entityShadows.tooltip.3= AV - visa inte entitetsskuggor + +of.options.VIGNETTE=Vinjett +of.options.VIGNETTE.tooltip.1=Visuell effekt som mörklägger skärmens hörn en aning +of.options.VIGNETTE.tooltip.2= Standard - följer grafikinställningarna (standard) +of.options.VIGNETTE.tooltip.3= Snabbt - vinjetten är inaktiverad (snabbare) +of.options.VIGNETTE.tooltip.4= Snyggt - vinjetten är aktiverad (långsammare) +of.options.VIGNETTE.tooltip.5=Vinjetten kan ha en betydande verkan på bildfrekvensen, +of.options.VIGNETTE.tooltip.6=speciellt när fullskärm är aktiverad. +of.options.VIGNETTE.tooltip.7=Vinjetteffekten är riktigt diskret och kan stängas av +of.options.VIGNETTE.tooltip.8=utan någon fara. + +of.options.DYNAMIC_FOV=Dynamiskt synfält +of.options.DYNAMIC_FOV.tooltip.1=Dynamiskt synfält +of.options.DYNAMIC_FOV.tooltip.2= PÅ - aktivera dynamiskt synfält (standard) +of.options.DYNAMIC_FOV.tooltip.3= AV - inaktivera dynamiskt synfält +of.options.DYNAMIC_FOV.tooltip.4=Ändrar synfältet när du flyger, springer eller siktar +of.options.DYNAMIC_FOV.tooltip.5=med en pilbåge. + +of.options.DYNAMIC_LIGHTS=Dynamiskt ljus +of.options.DYNAMIC_LIGHTS.tooltip.1=Dynamiskt ljus +of.options.DYNAMIC_LIGHTS.tooltip.2= AV - inget dynamiskt ljus (standard) +of.options.DYNAMIC_LIGHTS.tooltip.3= Snabbt - snabbt dynamiskt ljus (uppdateras var 500ms) +of.options.DYNAMIC_LIGHTS.tooltip.4= Snyggt - snyggt dynamiskt ljus (uppdateras i realtid) +of.options.DYNAMIC_LIGHTS.tooltip.5=Låter föremål som avger ljus (facklor, glödsten, etc.) +of.options.DYNAMIC_LIGHTS.tooltip.6=lysa upp omgivningen när de antingen hålls av dig eller +of.options.DYNAMIC_LIGHTS.tooltip.7=andra spelare eller släpps ned på marken. + +# Performance + +of.options.SMOOTH_FPS=Jämn bildfrekvens +of.options.SMOOTH_FPS.tooltip.1=Stabiliserar bildfrekvensen genom att rensa +of.options.SMOOTH_FPS.tooltip.2=grafikdrivrutinernas buffrar. +of.options.SMOOTH_FPS.tooltip.3= AV - ingen stabilisering, bildfrekvensen kan variera +of.options.SMOOTH_FPS.tooltip.4= PÅ - bildfrekvensen stabiliseras +of.options.SMOOTH_FPS.tooltip.5=Beror på grafikdrivrutinerna och märks inte alltid. + +of.options.SMOOTH_WORLD=Jämn värld +of.options.SMOOTH_WORLD.tooltip.1=Tar bort lag spikes som orsakas av den interna servern. +of.options.SMOOTH_WORLD.tooltip.2= AV - ingen stabilisering, bildfrekvensen kan variera +of.options.SMOOTH_WORLD.tooltip.3= PÅ - stabiliserar bildfrekvensen +of.options.SMOOTH_WORLD.tooltip.4=Stabiliserar bildfrekvensen genom att fördela inläsningen +of.options.SMOOTH_WORLD.tooltip.5=av den interna servern. +of.options.SMOOTH_WORLD.tooltip.6=Fungerar endast på lokala världar (enspelarläge). + +of.options.FAST_RENDER=Snabb rendering +of.options.FAST_RENDER.tooltip.1=Snabb rendering +of.options.FAST_RENDER.tooltip.2= AV - standardrendering (standard) +of.options.FAST_RENDER.tooltip.3= PÅ - optimerad rendering (snabbare) +of.options.FAST_RENDER.tooltip.4=Använder en optimerad renderingsalgoritm som sänker +of.options.FAST_RENDER.tooltip.5=grafikprocessorns läsninghastighet och kan höja +of.options.FAST_RENDER.tooltip.6=bildfrekvensen avsevärt. + +of.options.FAST_MATH=Snabb matematik +of.options.FAST_MATH.tooltip.1=Snabb matematik +of.options.FAST_MATH.tooltip.2= AV - standardmatematik (standard) +of.options.FAST_MATH.tooltip.3= PÅ - snabbare matematik +of.options.FAST_MATH.tooltip.4=Använder optimerade sin()- och cos()-funktioner som kan +of.options.FAST_MATH.tooltip.5=utnyttja processorcachen mer och höja bildfrekvensen. + +of.options.CHUNK_UPDATES=Chunkuppdateringar +of.options.CHUNK_UPDATES.tooltip.1=Chunkuppdateringar +of.options.CHUNK_UPDATES.tooltip.2= 1 - långsammare inläsning, högre bildfrekvens (standard) +of.options.CHUNK_UPDATES.tooltip.3= 3 - snabbare inläsning, lägre bildfrekvens +of.options.CHUNK_UPDATES.tooltip.4= 5 - snabbaste inläsning, lägst bildfrekvens +of.options.CHUNK_UPDATES.tooltip.5=Antalet chunkuppdateringar per renderad bildruta. +of.options.CHUNK_UPDATES.tooltip.6=Högre värden kan göra bildfrekvensen ostabil. + +of.options.CHUNK_UPDATES_DYNAMIC=Dynamiska uppdateringar +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Dynamiska chunkuppdateringar +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= AV - standardantal uppdateringar per bildruta (standard) +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= PÅ - fler uppdateringar när spelaren står stilla +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Dynamiska uppdateringar tvingar fler chunkuppdateringar +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=när spelaren står stilla för att läsa in världen snabbare. + +of.options.LAZY_CHUNK_LOADING=Slö chunkinläsning +of.options.LAZY_CHUNK_LOADING.tooltip.1=Slö chunkinläsning +of.options.LAZY_CHUNK_LOADING.tooltip.2= AV - standardinläsning på servrar +of.options.LAZY_CHUNK_LOADING.tooltip.3= PÅ - slö chunkinläsning på servrar (stabilare) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Jämnar ut den integrerade chunkläsningen för servern +of.options.LAZY_CHUNK_LOADING.tooltip.5=genom att fördela chunkarna över flera tickningar. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Inaktivera om delar av världen inte läser in på rätt sätt. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Fungerar bara i lokala världar (enspelarläge). + +# Animations + +of.options.animation.allOn=Allt PÅ +of.options.animation.allOff=Allt AV +of.options.animation.dynamic=Dynamiskt + +of.options.ANIMATED_WATER=Animerat vatten +of.options.ANIMATED_LAVA=Animerad lava +of.options.ANIMATED_FIRE=Animerad eld +of.options.ANIMATED_PORTAL=Animerade portaler +of.options.ANIMATED_REDSTONE=Animerad redstone +of.options.ANIMATED_EXPLOSION=Animerade explosioner +of.options.ANIMATED_FLAME=Animerade eldflammor +of.options.ANIMATED_SMOKE=Animerad rök +of.options.VOID_PARTICLES=Voidpartiklar +of.options.WATER_PARTICLES=Vattenpartiklar +of.options.RAIN_SPLASH=Regnstänk +of.options.PORTAL_PARTICLES=Portalpartiklar +of.options.POTION_PARTICLES=Brygdpartiklar +of.options.DRIPPING_WATER_LAVA=Droppande vatten/lava +of.options.ANIMATED_TERRAIN=Animerad terräng +of.options.ANIMATED_TEXTURES=Animerade texturer +of.options.FIREWORK_PARTICLES=Fyrverkeripartiklar + +# Other + +of.options.LAGOMETER=Laggmätare +of.options.LAGOMETER.tooltip.1=Visar laggmätaren på felsökningsskärmen (F3). +of.options.LAGOMETER.tooltip.2= * Orange - Minnesskräpsamling +of.options.LAGOMETER.tooltip.3= * Turkos - Antal tickningar +of.options.LAGOMETER.tooltip.4= * Blå - Schemalagda körningar +of.options.LAGOMETER.tooltip.5= * Lila - Chunkuppladddningar +of.options.LAGOMETER.tooltip.6= * Röd - Chunkuppdateringar +of.options.LAGOMETER.tooltip.7= * Gul - Synlighetskontroller +of.options.LAGOMETER.tooltip.8= * Grön - Terrängrendering + +of.options.PROFILER=Felsökningsprofilerare +of.options.PROFILER.tooltip.1=Felsökningsprofilerare +of.options.PROFILER.tooltip.2= PÅ - felsökningsprofilerare är igång, långsammare +of.options.PROFILER.tooltip.3= AV - felsökningsprofilerare är inte igång, snabbare +of.options.PROFILER.tooltip.4=Felsökningsprofileraren samlar in och visar +of.options.PROFILER.tooltip.5=felsökningsinfo när felsökningsskärmen är öppen (F3). + +of.options.WEATHER=Väder +of.options.WEATHER.tooltip.1=Väder +of.options.WEATHER.tooltip.2= PÅ - väder är aktiverat, långsammare +of.options.WEATHER.tooltip.3= AV - väder är inaktiverat, snabbare +of.options.WEATHER.tooltip.4=Denna inställning omfattar regn, snö och åska. +of.options.WEATHER.tooltip.5=Detta fungerar bara i lokala världar. + +of.options.time.dayOnly=Endast dag +of.options.time.nightOnly=Endast natt + +of.options.TIME=Tid +of.options.TIME.tooltip.1=Tid +of.options.TIME.tooltip.2= Standard - vanliga dag/natt-cykler +of.options.TIME.tooltip.3= Endast dag - dag hela tiden +of.options.TIME.tooltip.4= Endast natt - natt hela tiden +of.options.TIME.tooltip.5=Tidsinställningen fungerar endast i KREATIVT läge och +of.options.TIME.tooltip.6=för lokala världar. + +options.fullscreen.tooltip.1=Fullskärm +options.fullscreen.tooltip.2= PÅ - använd fullskärmsläge +options.fullscreen.tooltip.3= AV - använd fönsterläge +options.fullscreen.tooltip.4=Fullskärmsläge kan vara snabbare eller långsammare än +options.fullscreen.tooltip.5=fönsterläge beroende på grafikkortet. + +of.options.FULLSCREEN_MODE=Fullskärmsläge +of.options.FULLSCREEN_MODE.tooltip.1=Fullskärmsläge +of.options.FULLSCREEN_MODE.tooltip.2= Standard - använd datorns upplösning, långsammare +of.options.FULLSCREEN_MODE.tooltip.3= BxH - använd anpassad upplösning, kan vara snabbare +of.options.FULLSCREEN_MODE.tooltip.4=Den valda upplösningen används i fullskärmsläge (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Lägre upplösningar bör vanligtvis vara snabbare. + +of.options.SHOW_FPS=Visa bildfrekvens +of.options.SHOW_FPS.tooltip.1=Visar kort information om bildfrekvens och rendering. +of.options.SHOW_FPS.tooltip.2= C: - antal chunkrenderingar +of.options.SHOW_FPS.tooltip.3= E: - antal renderade entiteter + blockentiteter +of.options.SHOW_FPS.tooltip.4= U: - antal chunkuppdateringar +of.options.SHOW_FPS.tooltip.5=Informationen visas endast när felsökningsskärmen (F3) +of.options.SHOW_FPS.tooltip.6=inte är öppen. + +of.options.save.default=Standard (2s) +of.options.save.20s=20s +of.options.save.3min=3min +of.options.save.30min=30min + +of.options.AUTOSAVE_TICKS=Autosparning +of.options.AUTOSAVE_TICKS.tooltip.1=Intervall för automatisk sparning. +of.options.AUTOSAVE_TICKS.tooltip.2=Standardintervallet (2s) REKOMMENDERAS INTE. +of.options.AUTOSAVE_TICKS.tooltip.3=Autosparning är ökänd för att orsaka lag spikes. + +of.options.SCREENSHOT_SIZE=Skärmdumpsstorlek +of.options.SCREENSHOT_SIZE.tooltip.1=Skärmdumpsstorlek +of.options.SCREENSHOT_SIZE.tooltip.2= Standard - standardstorlek för skärmdumpar +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - anpassad storlek för skärmdumpar +of.options.SCREENSHOT_SIZE.tooltip.4=Större skärmdumpar kan kräva mer minne. +of.options.SCREENSHOT_SIZE.tooltip.5=Inte kompatibel med Snabb rendering och Kantutjämning. +of.options.SCREENSHOT_SIZE.tooltip.6=Kräver att grafikprocessorn har stöd för framebuffer. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/uk_UA.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/uk_UA.lang new file mode 100644 index 0000000..c26a76d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/uk_UA.lang @@ -0,0 +1,678 @@ +#Translated by Cool_boy +# General +of.general.ambiguous=невизначений +of.general.custom=Користувацький +of.general.from=З +of.general.id=Id +of.general.restart=перезапуск +of.general.smart=Розумно + +# Keys +of.key.zoom=Приблизити + +# Message +of.message.aa.shaders1=Згладжування не сумісне з шейдерами. +of.message.aa.shaders2=Будь ласка, відключіть шейдери щоб увімкнути цю функцію. + +of.message.af.shaders1=Анізотропна фільтрація не сумісна з шейдерами. +of.message.af.shaders2=Будь ласка, відключіть шейдери щоб увімкнути цю функцію. + +of.message.fr.shaders1=Швидкий рендер не сумісний з шейдерами. +of.message.fr.shaders2=Будь ласка, вимкнуть шейдери щоб увімкнути цю функцію. + +of.message.an.shaders1=3D ефект не сумісний з шейдерами. +of.message.an.shaders2=Вимкніть шейдери щоб увімкнути цю функцію. + +of.message.shaders.aa1=Шейдери не сумісні зі згладжуванням. +of.message.shaders.aa2=Будь ласка, встановіть Якість -> Згладжування на Вимк і перезапустіть гру. + +of.message.shaders.af1=Шейдери не сумісні з анізотропною фільтрацією. +of.message.shaders.af2=Будь ласка, встановіть Якість -> Анізотропна фільтрація на Вимк і перезапустіть гру. + +of.message.shaders.fr1=Шейдери не сумісні з швидким рендером. +of.message.shaders.fr2=Будь ласка, встановіть Продуктивність -> Швидкий рендер на Вимк і перезапустіть гру. + +of.message.shaders.an1=Шейдери не сумісні з 3D анагліфом. +of.message.shaders.an2=Будь-ласка, встановіть Інші -> 3D ефект на Вимк. + +of.message.newVersion=Нова версія §eOptiFine§f доступна: §e%s§f +of.message.java64Bit=Встанови §e64-bit Java§f щоб покращити продуктивність +of.message.openglError=§eOpenGL Error§f: %s (%s) + +of.message.shaders.loading=Завантажуємо шейдери: %s + +of.message.other.reset=Встановити всі налаштування на їхні початкові значення? + +of.message.loadingVisibleChunks=Завантажування видимих чанків + +# Video settings + +options.graphics.tooltip.1=Візуальна якість +options.graphics.tooltip.2= Швидка - нижча якість, швидше +options.graphics.tooltip.3= Красива - вижча якість, повільніше +options.graphics.tooltip.4=Змінює зовнішній вигляд хмар, листя води +options.graphics.tooltip.5=тіней і сторін трави. + +of.options.renderDistance.tiny=Маленька +of.options.renderDistance.short=Коротка +of.options.renderDistance.normal=Нормальна +of.options.renderDistance.far=Далека +of.options.renderDistance.extreme=Екстримальна +of.options.renderDistance.insane=Шалена +of.options.renderDistance.ludicrous=Безглузда + +options.renderDistance.tooltip.1=Видима відстань +options.renderDistance.tooltip.2= 2 Маленька - 32м (Найшвидше) +options.renderDistance.tooltip.3= 4 Коротка - 64м (Швидша) +options.renderDistance.tooltip.4= 8 Нормальна - 128м +options.renderDistance.tooltip.5= 16 Далека - 256м (повільніше) +options.renderDistance.tooltip.6= 32 Надзвичайна - 512м (найповільніше!) +options.renderDistance.tooltip.7=Для Надзвичайної видимої відстані потрібна велика кількість ресурсів комп'ютера! +options.renderDistance.tooltip.8=Значення більша за 16 Далеко ефективні лиш для одиночних світів. + +options.ao.tooltip.1=М'яке освітлення +options.ao.tooltip.2= Вимк - без м'якого освітлення (Швидка) +options.ao.tooltip.3= Мінімум - просте м'яке освітлення (повільніше) +options.ao.tooltip.4= Максимум - комплексне м'яке освітлення (дуже повільно) + +options.framerateLimit.tooltip.1=Максимальна швидкість передачі кадрів +options.framerateLimit.tooltip.2= VSync - ліміт до максимальної кількості кадрів монітора (60, 30, 20) +options.framerateLimit.tooltip.3= 5-255 - змінні +options.framerateLimit.tooltip.4= Необмежено - без ліміту (Найшвидше) +options.framerateLimit.tooltip.5=Гранична частота зміни кадрів зменшує FPS навіть якщо +options.framerateLimit.tooltip.6=значення ліміту не досягнуто. +of.options.framerateLimit.vsync=VSync + +of.options.AO_LEVEL=Рівень м'якого освітлення +of.options.AO_LEVEL.tooltip.1=Рівень м'якого освітлення +of.options.AO_LEVEL.tooltip.2= Вимк - без тіней +of.options.AO_LEVEL.tooltip.3= 50%% - легкі тіні +of.options.AO_LEVEL.tooltip.4= 100%% - темні тіні + +options.viewBobbing.tooltip.1=Реалістичний рух +options.viewBobbing.tooltip.2=При використанні міпмапів встановіть його в положення Вимк для досягнення найкращих результатів. + +options.guiScale.tooltip.1=Розмір GUI +options.guiScale.tooltip.2= Авто - максимальний розмір +options.guiScale.tooltip.3= Малий, Нормальний, Великий - 1x до 3x +options.guiScale.tooltip.4= 4x до 10x - доступні на 4K дисплеях +options.guiScale.tooltip.5=Непарні значення (1x, 3x, 5x ...) не підтримуються юнікодом. +options.guiScale.tooltip.6=Менший GUI швидший. + +options.vbo.tooltip.1=Об'єкти буфера вершин +options.vbo.tooltip.2=Використовує альтернативну технологію рендерингу, що зазвичай +options.vbo.tooltip.3=швидше (5-10%%) чим простий рендер. + +options.gamma.tooltip.1=Зменшує яскравість темніших об'єктів +options.gamma.tooltip.2= Похмурий - Стандартна яскравість +options.gamma.tooltip.3= 1-99%% - змінні +options.gamma.tooltip.4= Яскраво - максимальна яскравість темних об'єктів +options.gamma.tooltip.5=Ця опція не змінює яскравість +options.gamma.tooltip.6=повністю чорних об'єктів + +options.anaglyph.tooltip.1=3D анагліф +options.anaglyph.tooltip.2=Вмикає стереоскопічний 3D ефекти використовуючи різні кольори +options.anaglyph.tooltip.3=для кожного ока. +options.anaglyph.tooltip.4=Потребує червоно-сині окуляри для перегляду. + +options.blockAlternatives.tooltip.1=Альтернативні блоки +options.blockAlternatives.tooltip.2=Використовує альтернативні моделі для деяких блоків. +options.blockAlternatives.tooltip.3=Базується на обраному ресурспаці. + +of.options.ALTERNATE_BLOCKS=Альтернативні блоки +of.options.ALTERNATE_BLOCKS.tooltip.1=Альтернативні блоки +of.options.ALTERNATE_BLOCKS.tooltip.2=Використовує альтернативні моделі для деяких блоків. +of.options.ALTERNATE_BLOCKS.tooltip.3=Базується на обраному ресурспаці. + +of.options.FOG_FANCY=Туман +of.options.FOG_FANCY.tooltip.1=Тип туману +of.options.FOG_FANCY.tooltip.2= Швидкий - Швидкий туман +of.options.FOG_FANCY.tooltip.3= Красивий - Повільніший туман, виглядає краще +of.options.FOG_FANCY.tooltip.4= Вимк - без туману, найшвидше +of.options.FOG_FANCY.tooltip.5=Красивий туман буде доступний лиш тоді, коли +of.options.FOG_FANCY.tooltip.6=його підтримує відеокарта. + +of.options.FOG_START=Поява туману +of.options.FOG_START.tooltip.1=Поява туману +of.options.FOG_START.tooltip.2= 0.2 - туман з'являється недалеко від гравця +of.options.FOG_START.tooltip.3= 0.8 - туман з'являється далеко від гравця +of.options.FOG_START.tooltip.4=Ця опція зазвичай не зменшує продуктивність. + +of.options.CHUNK_LOADING=Завантаження чанків +of.options.CHUNK_LOADING.tooltip.1=Завантаження чанків +of.options.CHUNK_LOADING.tooltip.2= Базове - нестабільше FPS коли завантажується чанк +of.options.CHUNK_LOADING.tooltip.3= Згладжене - стабільше FPS +of.options.CHUNK_LOADING.tooltip.4= Multi-Core - стабільше FPS, 3x швидше завантжаення світу +of.options.CHUNK_LOADING.tooltip.5=Згладжене і Multi-Core видаляють заікання і +of.options.CHUNK_LOADING.tooltip.6=фрізи спричинені завантаженням чанків. +of.options.CHUNK_LOADING.tooltip.7=Multi-Core може збільшити до 3 разів швидкість завантаження світу +of.options.CHUNK_LOADING.tooltip.8=збільшуючи FPS завдяки використання другого ядра процессора. +of.options.chunkLoading.smooth=Згладжене +of.options.chunkLoading.multiCore=Multi-Core + +of.options.shaders=Шейдери... +of.options.shadersTitle=Шейдери + +of.options.shaders.packNone=Вимк +of.options.shaders.packDefault=(внутрішній) + +of.options.shaders.ANTIALIASING=Згладжування +of.options.shaders.ANTIALIASING.tooltip.1=Згладжування +of.options.shaders.ANTIALIASING.tooltip.2= Вимк - (базово) без згладжування (швидше) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - згладжені лінії та краї (повільніше) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA це пост-ефект який згладжує +of.options.shaders.ANTIALIASING.tooltip.5=гострі краї та різкі зміни кольорів. +of.options.shaders.ANTIALIASING.tooltip.6=Це швидше ніж традиційне згладжування +of.options.shaders.ANTIALIASING.tooltip.7=і працює з Швидким Рендером. + +of.options.shaders.NORMAL_MAP=Нормальна мапа +of.options.shaders.NORMAL_MAP.tooltip.1=Нормальна мапа +of.options.shaders.NORMAL_MAP.tooltip.2= Увімк - (базово) дозволити нормальні мапи +of.options.shaders.NORMAL_MAP.tooltip.3= Вимк - вимкнути нормальні мапи +of.options.shaders.NORMAL_MAP.tooltip.4=Шейдер використовує нормальні мапи +of.options.shaders.NORMAL_MAP.tooltip.5=щоб симулювати 3D геометрію на плоских моделях. +of.options.shaders.NORMAL_MAP.tooltip.6=Нормальна мапа встановлюється +of.options.shaders.NORMAL_MAP.tooltip.7=обраним шейдером. + +of.options.shaders.SPECULAR_MAP=Дзеркальна мапа +of.options.shaders.SPECULAR_MAP.tooltip.1=Джеркальна мапа +of.options.shaders.SPECULAR_MAP.tooltip.2= Увімк - (базово) увімкнути дзеркальні мапи +of.options.shaders.SPECULAR_MAP.tooltip.3= Вимк - вимкнути дзеркальні мапи +of.options.shaders.SPECULAR_MAP.tooltip.4=Шейдер використовує дзеркальні мапи +of.options.shaders.SPECULAR_MAP.tooltip.5=щоб симулювати віддзеркалення. +of.options.shaders.SPECULAR_MAP.tooltip.6=Дзеркальна мапа встановлюється +of.options.shaders.SPECULAR_MAP.tooltip.7=обраним шейдером. + +of.options.shaders.RENDER_RES_MUL=Якість рендеру +of.options.shaders.RENDER_RES_MUL.tooltip.1=Якість рендеру +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - низька (швидка) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - стандартна (базова) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - висока (повільна) +of.options.shaders.RENDER_RES_MUL.tooltip.5=Якість рендеру контролює розмір текстури +of.options.shaders.RENDER_RES_MUL.tooltip.6=які шейдер використовує. +of.options.shaders.RENDER_RES_MUL.tooltip.7=Низька якість буде корисна для 4K дисплеїв. +of.options.shaders.RENDER_RES_MUL.tooltip.8=Висока якість працює як згладжування. + +of.options.shaders.SHADOW_RES_MUL=Якість тіней +of.options.shaders.SHADOW_RES_MUL.tooltip.1=Якість тіней +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - низька (швидка) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - стандартна (базова) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - висока (повільна) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=Якість тіней контролює розмір текстури +of.options.shaders.SHADOW_RES_MUL.tooltip.6=тіней яку використовує шейдер. +of.options.shaders.SHADOW_RES_MUL.tooltip.7=Низька якість = неточні, грубі тіні. +of.options.shaders.SHADOW_RES_MUL.tooltip.8=Висока якість = точні, красиві тіні. + +of.options.shaders.HAND_DEPTH_MUL=Глибина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=Глибина руки +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - рука коло камери +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (базово) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - рука далеко від камери +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=Глибина руки контролює наскільки далеко +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=знаходяться предмети в руці від камери. +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=Для шейдерів з глибоким розмиттям це змінить +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=розмиття предметів в руці. + +of.options.shaders.CLOUD_SHADOW=Тіні від хмар + +of.options.shaders.OLD_HAND_LIGHT=Старе освітл. руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=Старе освітлення руки +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= Базово - залежить від шейдера +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= Увімк - використовувати старе +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= Вимк - використовувати нове +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=Це дозволяє шейдерам які працюють лише з +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=оствіленням в основній руці працювати з +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=речима в другій. + +of.options.shaders.OLD_LIGHTING=Старе освітлення +of.options.shaders.OLD_LIGHTING.tooltip.1=Старе освітлення +of.options.shaders.OLD_LIGHTING.tooltip.2= Базово - залежить від шейдера +of.options.shaders.OLD_LIGHTING.tooltip.3= Увімк - використовувати старе +of.options.shaders.OLD_LIGHTING.tooltip.4= Вимк - не використовувати старе +of.options.shaders.OLD_LIGHTING.tooltip.5=Старе освітлення контролює фіксовану базову +of.options.shaders.OLD_LIGHTING.tooltip.6=освітленність сторони блока. +of.options.shaders.OLD_LIGHTING.tooltip.7=Шейдери зазвичай надають краще освітлення в +of.options.shaders.OLD_LIGHTING.tooltip.8=залежності від позиції сонця. + +of.options.shaders.SHADER_PACK=Шейдерпак + +of.options.shaders.shadersFolder=Папка з шейдерами +of.options.shaders.shaderOptions=Налаштування шейдерів... + +of.options.shaderOptionsTitle=Налаштування шейдерів + +of.options.quality=Якість... +of.options.qualityTitle=Налаштування якості + +of.options.details=Деталі... +of.options.detailsTitle=Налаштування деталей + +of.options.performance=Продуктивність... +of.options.performanceTitle=Налаштування продуктивності + +of.options.animations=Анімації... +of.options.animationsTitle=Налаштування анімації + +of.options.other=Інші... +of.options.otherTitle=Інші налаштування + +of.options.other.reset=Скинути всі налаштування... + +of.shaders.profile=Профіль + +# Quality + +of.options.mipmap.bilinear=Білінійна +of.options.mipmap.linear=Лінійна +of.options.mipmap.nearest=Найближча +of.options.mipmap.trilinear=Трилінійна + +options.mipmapLevels.tooltip.1=Візуальний ефект який змушує далекі об'єкти виглядати краще +options.mipmapLevels.tooltip.2=розмиваючи деталі текстур +options.mipmapLevels.tooltip.3= Вимк - без згладжування +options.mipmapLevels.tooltip.4= 1 - мінімальне згладжування +options.mipmapLevels.tooltip.5= 4 - максивальне згладжування +options.mipmapLevels.tooltip.6=Ця опція зазвичай не впливає на продуктивність. + +of.options.MIPMAP_TYPE=Тип Міпмап +of.options.MIPMAP_TYPE.tooltip.1=Візуальний ефект який змушує далекі об'єкти виглядати краще +of.options.MIPMAP_TYPE.tooltip.2=розмиваючи деталі текстур +of.options.MIPMAP_TYPE.tooltip.3= Найближчий - грубе згладжування (найшвидша) +of.options.MIPMAP_TYPE.tooltip.4= Лінійне - нормальне згладжування +of.options.MIPMAP_TYPE.tooltip.5= Білінійне - краще згладжування +of.options.MIPMAP_TYPE.tooltip.6= Трилінійне - найкраще згладжування (повільніше) + + +of.options.AA_LEVEL=Згладжування +of.options.AA_LEVEL.tooltip.1=Згладжування +of.options.AA_LEVEL.tooltip.2= Вимк - (базове) без згладжування (швидке) +of.options.AA_LEVEL.tooltip.3= 2-16 - згладжує лінії і границі (повільніше) +of.options.AA_LEVEL.tooltip.4=Згладжування розмиває зазубрені границі і +of.options.AA_LEVEL.tooltip.5=гострі зміни кольору. +of.options.AA_LEVEL.tooltip.6=Коли увімкнуто, то по суті зменшує FPS. +of.options.AA_LEVEL.tooltip.7=Не всі рівні підтримуються різними відеокартами. +of.options.AA_LEVEL.tooltip.8=Ефективне після ПЕРЕЗАПУСКУ! + +of.options.AF_LEVEL=Анізотропна фільтрація +of.options.AF_LEVEL.tooltip.1=Анізотропна фільтрація +of.options.AF_LEVEL.tooltip.2= Вимк - (базово) стандартна деталь текстури (швидка) +of.options.AF_LEVEL.tooltip.3= 2-16 - кращі деталі у Міпмап текстурах (повільніше) +of.options.AF_LEVEL.tooltip.4=Анізотропна фільтрація відновлює деталі у +of.options.AF_LEVEL.tooltip.5=Міпмап текстурах. +of.options.AF_LEVEL.tooltip.6=Коли ввімкнуто, зменшує FPS. + +of.options.CLEAR_WATER=Чиста вода +of.options.CLEAR_WATER.tooltip.1=Чиста вода +of.options.CLEAR_WATER.tooltip.2= Увімк - чиста, прозора вода +of.options.CLEAR_WATER.tooltip.3= Вимк - стандартна вода + +of.options.RANDOM_MOBS=Випадкові текстури мобів +of.options.RANDOM_MOBS.tooltip.1=Випадкові текстури мобів +of.options.RANDOM_MOBS.tooltip.2= Вимк - одна текстура для моба, швидше +of.options.RANDOM_MOBS.tooltip.3= Увімк - випадкові текстури, повільніше +of.options.RANDOM_MOBS.tooltip.4=Випадкові текстури мобів використовує різні текстури для моба. +of.options.RANDOM_MOBS.tooltip.5=Це потребує ресурспак з різними текстурами для одного моба. + +of.options.BETTER_GRASS=Краща трава +of.options.BETTER_GRASS.tooltip.1=Краща трава +of.options.BETTER_GRASS.tooltip.2= Вимк - базова текстура блока трави, швидше +of.options.BETTER_GRASS.tooltip.3= Швидка - зелена бокова текстура блока трави, повільніше +of.options.BETTER_GRASS.tooltip.4= Красива - динаміча текстура сторони блока, повільніше + +of.options.BETTER_SNOW=Кращий сніг +of.options.BETTER_SNOW.tooltip.1=Кращий сніг +of.options.BETTER_SNOW.tooltip.2= Вимк - базовий сніг, швидше +of.options.BETTER_SNOW.tooltip.3= Увімк - кращий сніг, повільніше +of.options.BETTER_SNOW.tooltip.4=Показує сніг під прозорими блоками (огорожа, висока трава) +of.options.BETTER_SNOW.tooltip.5=коли межує з блоком снігу + +of.options.CUSTOM_FONTS=Власні шрифти +of.options.CUSTOM_FONTS.tooltip.1=Власні шрифти +of.options.CUSTOM_FONTS.tooltip.2= Увімк - використовує власні шрифти (базово), повільніше +of.options.CUSTOM_FONTS.tooltip.3= Вимк - використовує базовий шрифт, швидше +of.options.CUSTOM_FONTS.tooltip.4=Власні шрифти встановлюються ресурспаком +of.options.CUSTOM_FONTS.tooltip.5= + +of.options.CUSTOM_COLORS=Власні кольори +of.options.CUSTOM_COLORS.tooltip.1=Custom Colors +of.options.CUSTOM_COLORS.tooltip.2= Увімк - використовує власні кольори (базово), повільніше +of.options.CUSTOM_COLORS.tooltip.3= Вимк - використовує базові кольори, швидше +of.options.CUSTOM_COLORS.tooltip.4=Власні кольори встановлюються ресурспаком +of.options.CUSTOM_COLORS.tooltip.5= + +of.options.SWAMP_COLORS=Кольори болота +of.options.SWAMP_COLORS.tooltip.1=Кольори болота +of.options.SWAMP_COLORS.tooltip.2= Увімк - використовуються кольори болота (базово), повільніше +of.options.SWAMP_COLORS.tooltip.3= Вимк - не використовує кольори болота, швидше +of.options.SWAMP_COLORS.tooltip.4=Кольори болота впливають на траву, листя, воду і ліани. + +of.options.SMOOTH_BIOMES=Плавні біоми +of.options.SMOOTH_BIOMES.tooltip.1=Плавні біоми +of.options.SMOOTH_BIOMES.tooltip.2= Увімк - згладжування границі біомів (базово), повільніше +of.options.SMOOTH_BIOMES.tooltip.3= Вимк - без згладжування границь біомів, швидше +of.options.SMOOTH_BIOMES.tooltip.4=Згладжування зміняє кольори декількох блоків на границі +of.options.SMOOTH_BIOMES.tooltip.5=щоб зменшити різку зміну кольорів. +of.options.SMOOTH_BIOMES.tooltip.6=Впливає на траву, листя, воду і ліани. + +of.options.CONNECTED_TEXTURES=З'єднані текстури +of.options.CONNECTED_TEXTURES.tooltip.1=З'єднані текстури +of.options.CONNECTED_TEXTURES.tooltip.2= Вимк - без поєднаних текстур (базово) +of.options.CONNECTED_TEXTURES.tooltip.3= Швидка - швидкі поєднані текстури +of.options.CONNECTED_TEXTURES.tooltip.4= Красива - красиві поєднані текстури +of.options.CONNECTED_TEXTURES.tooltip.5=З'єднані текстури впливають на скло, +of.options.CONNECTED_TEXTURES.tooltip.6=пісковик і полички, що розташовані +of.options.CONNECTED_TEXTURES.tooltip.7=разом. Приєднанні текстури підтримують +of.options.CONNECTED_TEXTURES.tooltip.8=обрані ресурспаки. + +of.options.NATURAL_TEXTURES=Натуральні текстури +of.options.NATURAL_TEXTURES.tooltip.1=Натуральні текстури +of.options.NATURAL_TEXTURES.tooltip.2= Вимк - без натуральних текстур (базово) +of.options.NATURAL_TEXTURES.tooltip.3= Увімк - використовує натуральні текстури +of.options.NATURAL_TEXTURES.tooltip.4=Натуральні текстури видаляють сітку як шаблон +of.options.NATURAL_TEXTURES.tooltip.5=створений повторенням блоків одного типу. +of.options.NATURAL_TEXTURES.tooltip.6=Це використовує перевернуті і повернуті текстури +of.options.NATURAL_TEXTURES.tooltip.7=блока. Налаштування натуральних текстур +of.options.NATURAL_TEXTURES.tooltip.8=надходить з обраного пакету текстур. + +of.options.EMISSIVE_TEXTURES=Випромінюючі текстури +of.options.EMISSIVE_TEXTURES.tooltip.1=Випромінюючі текстури +of.options.EMISSIVE_TEXTURES.tooltip.2= Увімк - використання випромінюючих текстур +of.options.EMISSIVE_TEXTURES.tooltip.3= Вимк - без випромінюючих текстур +of.options.EMISSIVE_TEXTURES.tooltip.4=Випрюмінюючі текстури завжди відображаються з повною яскравістю. +of.options.EMISSIVE_TEXTURES.tooltip.5=Їх можно використовувати для імітації випромінювання світла +of.options.EMISSIVE_TEXTURES.tooltip.6=частинами основної текстури. +of.options.EMISSIVE_TEXTURES.tooltip.7=Додається обраним ресурспаком. +of.options.EMISSIVE_TEXTURES.tooltip.8= + +of.options.CUSTOM_SKY=Власне небо +of.options.CUSTOM_SKY.tooltip.1=Власне небо +of.options.CUSTOM_SKY.tooltip.2= Увімк - власні текстури неба (базово), повільніше +of.options.CUSTOM_SKY.tooltip.3= Вимк - базове небо, швидше +of.options.CUSTOM_SKY.tooltip.4=Власна текстура неба може бути змінена +of.options.CUSTOM_SKY.tooltip.5=ресурспаком + +of.options.CUSTOM_ITEMS=Власні текстури речей +of.options.CUSTOM_ITEMS.tooltip.1=Власні текстури речей +of.options.CUSTOM_ITEMS.tooltip.2= Увімк - власні текстури речей (базово), повільніше +of.options.CUSTOM_ITEMS.tooltip.3= Вимк - базові речі, швидше +of.options.CUSTOM_ITEMS.tooltip.4=Власна текстура неба може бути змінена +of.options.CUSTOM_ITEMS.tooltip.5=ресурспаком + +of.options.CUSTOM_ENTITY_MODELS=Власні моделі істот +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=Власні моделі істот +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= Увімк - власні моделі для істот (базово), повільніше +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= Вимк - стандартні моделі істот, швидше +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=Моделі істот можуть бути змінені +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=ресурспаком + +of.options.CUSTOM_GUIS=Власні GUI +of.options.CUSTOM_GUIS.tooltip.1=Власні GUI +of.options.CUSTOM_GUIS.tooltip.2= Увімк - власні GUI (базово), повільніше +of.options.CUSTOM_GUIS.tooltip.3= Вимк - стандартні GUI, швидше +of.options.CUSTOM_GUIS.tooltip.4=Власні GUI встановлюються ресурспаком. + +# Details + +of.options.CLOUDS=Хмари +of.options.CLOUDS.tooltip.1=Хмари +of.options.CLOUDS.tooltip.2= Стандартні - як в налаштуваннях відео +of.options.CLOUDS.tooltip.3= Швидкі - нижча якість, швидше +of.options.CLOUDS.tooltip.4= Красива - вища якість, повільніше +of.options.CLOUDS.tooltip.5= Вимк - без хмар, найшвидше +of.options.CLOUDS.tooltip.6=Швидкі хмари відображаються у 2D. +of.options.CLOUDS.tooltip.7=Красиві хмари відображаються у 3D. + +of.options.CLOUD_HEIGHT=Висота хмар +of.options.CLOUD_HEIGHT.tooltip.1=Висота хмар +of.options.CLOUD_HEIGHT.tooltip.2= Вимк - стандартна висота +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - вище ліміту світу + +of.options.TREES=Дерева +of.options.TREES.tooltip.1=Дерева +of.options.TREES.tooltip.2= Стандартні - як в налаштуваннях відео +of.options.TREES.tooltip.3= Швидкі - нижча якість, швидше +of.options.TREES.tooltip.4= Розумні - вища якість, швидше +of.options.TREES.tooltip.5= Красива - найвища якість, повільніше +of.options.TREES.tooltip.6=Швидкі дерева мають непрозоре листя. +of.options.TREES.tooltip.7=Красиві дерева мають прозорі листя. + +of.options.RAIN=Дощ і сніг +of.options.RAIN.tooltip.1=Дощ і сніг +of.options.RAIN.tooltip.2= Стандартні - як в налаштуваннях відео +of.options.RAIN.tooltip.3= Швидкі - нижча якість, швидше +of.options.RAIN.tooltip.4= Красиві - важкий дощ/сніг, повільніше +of.options.RAIN.tooltip.5= Вимк - без дощу/снігу, найшвидше +of.options.RAIN.tooltip.6=Коли дощ вимкнено звуки крапель залишатимуться +of.options.RAIN.tooltip.7= + +of.options.SKY=Небо +of.options.SKY.tooltip.1=Небо +of.options.SKY.tooltip.2= Увімк - небо видиме, повільніше +of.options.SKY.tooltip.3= Вимк - небо невидиме, швидше +of.options.SKY.tooltip.4=Коли небо вимкнене, сонце і місяць досі помітні. + +of.options.STARS=Зірки +of.options.STARS.tooltip.1=Зірки +of.options.STARS.tooltip.2= Увімк - зірки видимі, повільніше +of.options.STARS.tooltip.3= Вимк - зірки невидимі, швидше + +of.options.SUN_MOON=Сонце і місяць +of.options.SUN_MOON.tooltip.1=Сонце і місяць +of.options.SUN_MOON.tooltip.2= Увімк - сонце і місяць видимі (базово) +of.options.SUN_MOON.tooltip.3= Вимк - сонце і місяць невидимі (швидше) + +of.options.SHOW_CAPES=Показувати плащі +of.options.SHOW_CAPES.tooltip.1=Показувати плащі +of.options.SHOW_CAPES.tooltip.2= Увімк - показувати плащі (базово) +of.options.SHOW_CAPES.tooltip.3= Вимк - не показувати плащі (швидше) + +of.options.TRANSLUCENT_BLOCKS=Напівпрозорі блоки +of.options.TRANSLUCENT_BLOCKS.tooltip.1=Напівпрозорі блоки +of.options.TRANSLUCENT_BLOCKS.tooltip.2= Красива - правильне змішування кольорів (базово) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= Швидка - швидше змішування кольорів (швидше) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=Контролює змішування кольорів напівпрозорих блоків +of.options.TRANSLUCENT_BLOCKS.tooltip.5=з різним кольором (скло, вода, лід) +of.options.TRANSLUCENT_BLOCKS.tooltip.6=коли між ними є повітря. + +of.options.HELD_ITEM_TOOLTIPS=Спливаючі підказки +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=Спливаючі підказки +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= Увімк - показувати спливаючі підказки (базово) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= Вимк - не показувати підказок + +of.options.ADVANCED_TOOLTIPS=Розширені підказки +of.options.ADVANCED_TOOLTIPS.tooltip.1=Розширені спливаючі підказки +of.options.ADVANCED_TOOLTIPS.tooltip.2= Увімк - показувати розширені підказки +of.options.ADVANCED_TOOLTIPS.tooltip.3= Вимк - не показувати розширені підказки (базово) +of.options.ADVANCED_TOOLTIPS.tooltip.4=Розширені підказки показують більше інформації про +of.options.ADVANCED_TOOLTIPS.tooltip.5=речі (id, міцність) і для налаштування шейдерів +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id, джерело, стандартне значення) + +of.options.DROPPED_ITEMS=Викинуті речі +of.options.DROPPED_ITEMS.tooltip.1=Викинуті речі +of.options.DROPPED_ITEMS.tooltip.2= Базові - як у налаштуваннях відео +of.options.DROPPED_ITEMS.tooltip.3= Швидка - викинуті речі у 2D, швидше +of.options.DROPPED_ITEMS.tooltip.4= Красива - викинуті речі у 3D, повільніше + +options.entityShadows.tooltip.1=Тіні сутностей +options.entityShadows.tooltip.2= Увімк - показувати тіні сутностей +options.entityShadows.tooltip.3= Вимк - вимкнути тіні сутностей + +of.options.VIGNETTE=Віньєтка +of.options.VIGNETTE.tooltip.1=Візуальний ефект який затемняє краї +of.options.VIGNETTE.tooltip.2= Базово - як в налаштуваннях графіки +of.options.VIGNETTE.tooltip.3= Швидка - віньтка вимкнена (швидша) +of.options.VIGNETTE.tooltip.4= Красива - віньєтка увімкнена (повільніше) +of.options.VIGNETTE.tooltip.5=Віньєтка може зробити істотний вплив на FPS, +of.options.VIGNETTE.tooltip.6=особливо при грі у повноекранному режимі. +of.options.VIGNETTE.tooltip.7=Ефект не дуже важливий і легко +of.options.VIGNETTE.tooltip.8=може бути вимкненим + +of.options.DYNAMIC_FOV=Динамічний FOV +of.options.DYNAMIC_FOV.tooltip.1=Динамічний FOV +of.options.DYNAMIC_FOV.tooltip.2= Увімк - динамічний FOV увімкнуто(базово) +of.options.DYNAMIC_FOV.tooltip.3= Вимк - динамічний FOV вимкнуто +of.options.DYNAMIC_FOV.tooltip.4=Змінює поле зору (FOV) коли літаємо, біжимо +of.options.DYNAMIC_FOV.tooltip.5=чи натягуємо лук. + +of.options.DYNAMIC_LIGHTS=Динамічне освітлення +of.options.DYNAMIC_LIGHTS.tooltip.1=Динамічне освітлення +of.options.DYNAMIC_LIGHTS.tooltip.2= Вимк - без динамічного освітлення (базово) +of.options.DYNAMIC_LIGHTS.tooltip.3= Швидка - швидке динамічне освітлення (оновлення кожні 500мс) +of.options.DYNAMIC_LIGHTS.tooltip.4= Красива - красиве динамічне освітлення (оновлення в реальному часу) +of.options.DYNAMIC_LIGHTS.tooltip.5=Дозволяє випромінювати світло речам (факел, світлокамінь, т.д.) +of.options.DYNAMIC_LIGHTS.tooltip.6=щоб освітлювати все навкруги, коли знаходяться в руці, +of.options.DYNAMIC_LIGHTS.tooltip.7=вдягнуті іншим гравцем або викинуті на землю. + +# Performance + +of.options.SMOOTH_FPS=Згладжене FPS +of.options.SMOOTH_FPS.tooltip.1=Стабілізує FPS промиванням графічних буферів драйвера +of.options.SMOOTH_FPS.tooltip.2= Вимк - нема стабілізації, FPS може коливатись +of.options.SMOOTH_FPS.tooltip.3= Увімк - FPS стабілізується +of.options.SMOOTH_FPS.tooltip.4=Цей параметр залежить від графічного драйвера +of.options.SMOOTH_FPS.tooltip.5=і його вплив не завжди помітний + +of.options.SMOOTH_WORLD=Згладжений світ +of.options.SMOOTH_WORLD.tooltip.1=Прибирає фрізи при завантаження чатків. +of.options.SMOOTH_WORLD.tooltip.2= Вимк - нема стабілізації, FPS може коливатись +of.options.SMOOTH_WORLD.tooltip.3= Увімк - FPS стабілізується +of.options.SMOOTH_WORLD.tooltip.4=Стабілізує FPS лише на одиночній грі. +of.options.SMOOTH_WORLD.tooltip.5= + +of.options.FAST_RENDER=Швидкий рендер +of.options.FAST_RENDER.tooltip.1=Швидки рендер +of.options.FAST_RENDER.tooltip.2= Вимк - стандартний рендер (базово) +of.options.FAST_RENDER.tooltip.3= Увімк - оптимізований рендер (швидший) +of.options.FAST_RENDER.tooltip.4=Використовує оптимізований алгоритм рендерингу +of.options.FAST_RENDER.tooltip.5=зменшує навантаження на процессор і збільшить FPS. + +of.options.FAST_MATH=Швидка математика +of.options.FAST_MATH.tooltip.1=Швидка математика +of.options.FAST_MATH.tooltip.2= Вимк - стандартна математика(базово) +of.options.FAST_MATH.tooltip.3= Увімк - швидша математика +of.options.FAST_MATH.tooltip.4=Використовує оптимізовані функції sin() і cos(), що може краще +of.options.FAST_MATH.tooltip.5=утилізовувати кеш, і збільшити FPS. + +of.options.CHUNK_UPDATES=Оновлення чанків +of.options.CHUNK_UPDATES.tooltip.1=Оновлення чанків +of.options.CHUNK_UPDATES.tooltip.2= 1 - Повільніше завантаження світу, більший FPS (базово) +of.options.CHUNK_UPDATES.tooltip.3= 3 - Швидше оновлення чанків, нижчий FPS +of.options.CHUNK_UPDATES.tooltip.4= 5 - Найшвидше оновлення чанків, найнижчий FPS +of.options.CHUNK_UPDATES.tooltip.5=Кількість оновленн чанку за один кадр, +of.options.CHUNK_UPDATES.tooltip.6=найбільші значення можуть зменшити FPS. + +of.options.CHUNK_UPDATES_DYNAMIC=Динамічні оновлення +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=Динамічні оновлення чанків +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= Вимк - (базово) стандартне оновлення чанків за кадр +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= Увімк - більше оновленнь коли гравець стоїть +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=Динамічні оновлення змушують виконувати більше оновлень чанків +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=коли гравець стоїть, світ провантажується швидше. + +of.options.LAZY_CHUNK_LOADING=Ліниве завантаження чанків +of.options.LAZY_CHUNK_LOADING.tooltip.1=Ліниве завантаження чанків +of.options.LAZY_CHUNK_LOADING.tooltip.2= Вимк - базове серверне завантаження чанків +of.options.LAZY_CHUNK_LOADING.tooltip.3= Увімк - ліниве завантаження серверних чанків (плавніше) +of.options.LAZY_CHUNK_LOADING.tooltip.4=Згладжує завантаження чанків вбудований сервером +of.options.LAZY_CHUNK_LOADING.tooltip.5=розподіляючи чанки на декілька тіків. +of.options.LAZY_CHUNK_LOADING.tooltip.6=Вимкніть це якщо деякі частини світу не завантажуються правильно. +of.options.LAZY_CHUNK_LOADING.tooltip.7=Ефективно тільки для локальних світів і одноядрених процессорів. + +# Animations + +of.options.animation.allOn=Всі Увімк +of.options.animation.allOff=Всі Вимк +of.options.animation.dynamic=Динамічні + +of.options.ANIMATED_WATER=Анімація води +of.options.ANIMATED_LAVA=Анімація лави +of.options.ANIMATED_FIRE=Анімація вогню +of.options.ANIMATED_PORTAL=Анімація порталу +of.options.ANIMATED_REDSTONE=Анімація редстоуну +of.options.ANIMATED_EXPLOSION=Анімація вибуху +of.options.ANIMATED_FLAME=Анімація полум'я +of.options.ANIMATED_SMOKE=Анімація диму +of.options.VOID_PARTICLES=Частинки безодні +of.options.WATER_PARTICLES=Частинки води +of.options.RAIN_SPLASH=Краплі дощу +of.options.PORTAL_PARTICLES=Чатинки порталу +of.options.POTION_PARTICLES=Частинки зілль +of.options.DRIPPING_WATER_LAVA=Капаюча лава/вода +of.options.ANIMATED_TERRAIN=Анімація місцевості +of.options.ANIMATED_TEXTURES=Анімація текстур +of.options.FIREWORK_PARTICLES=Частинки феєрверку + +# Other + +of.options.LAGOMETER=Лагометр +of.options.LAGOMETER.tooltip.1=Показує лагометр на екрані дебагу (F3). +of.options.LAGOMETER.tooltip.2=* Оранджевий - зберігання мусору в пам'яті +of.options.LAGOMETER.tooltip.3=* Блакитний - Тік +of.options.LAGOMETER.tooltip.4=* Синій - Заплановані дії +of.options.LAGOMETER.tooltip.5=* Фіолетовий - Завантаження чанків +of.options.LAGOMETER.tooltip.6=* Червоний - Оновлення чанків +of.options.LAGOMETER.tooltip.7=* Жовтий - Перевірка видимості +of.options.LAGOMETER.tooltip.8=* Зелений - Рендеринг місцевості + +of.options.PROFILER=Профіль дебагу +of.options.PROFILER.tooltip.1=Профіль дебагу +of.options.PROFILER.tooltip.2= Увімк - профіль дебагу увімкнуто, повільніше +of.options.PROFILER.tooltip.3= Вимк - профіль дебагу вимкнуто, швидше +of.options.PROFILER.tooltip.4=Профіль дебагу збирає інформацію і показує її на +of.options.PROFILER.tooltip.5=екрані дебагу (F3) + +of.options.WEATHER=Погода +of.options.WEATHER.tooltip.1=Погода +of.options.WEATHER.tooltip.2= Увімк - погода активна, повільніше +of.options.WEATHER.tooltip.3= Вимк - погода не активна, швидше +of.options.WEATHER.tooltip.4=Погода контролює дощі, грози і сніг. +of.options.WEATHER.tooltip.5=Працює лиш в ОДИНОЧНИХ СВІТАХ. + +of.options.time.dayOnly=Тільки день +of.options.time.nightOnly=Тільки ніч + +of.options.TIME=Час +of.options.TIME.tooltip.1=Час +of.options.TIME.tooltip.2= Базово - стандартний день +of.options.TIME.tooltip.3= Тільки день - тільки день +of.options.TIME.tooltip.4= Тільки ніч - тільки ніч +of.options.TIME.tooltip.5=Встановлення часу працює лиш для гравців у +of.options.TIME.tooltip.6=КРЕАТИВІ та у локальних світах. + +options.fullscreen.tooltip.1=Повноекранний режим +options.fullscreen.tooltip.2= Увімк - використовувати повноекранний режим +options.fullscreen.tooltip.3= Вимк - не використовувати повноекранний режим +options.fullscreen.tooltip.4=В залежності від відеокарти, може +options.fullscreen.tooltip.5=покращити продуктивність. + +of.options.FULLSCREEN_MODE=Роздільна здатність +of.options.FULLSCREEN_MODE.tooltip.1=Роздільна здатність +of.options.FULLSCREEN_MODE.tooltip.2= Базово - використовувати роздільну здатність монітора, повільніше +of.options.FULLSCREEN_MODE.tooltip.3= WxH - використовувати власну роздільну якість, може бути швидше +of.options.FULLSCREEN_MODE.tooltip.4=Обрана якість буде використовуватись в повноекраному режимі (F11). +of.options.FULLSCREEN_MODE.tooltip.5=Найнижча якість завжди швидша. + +of.options.SHOW_FPS=Показувати FPS +of.options.SHOW_FPS.tooltip.1=Показує компактно FPS і інформацію рендеру +of.options.SHOW_FPS.tooltip.2= C: - чанків рендериться +of.options.SHOW_FPS.tooltip.3= E: - сутностей в рендері + блоковано сутностей +of.options.SHOW_FPS.tooltip.4= U: - чанків оновлюється +of.options.SHOW_FPS.tooltip.5=Компактне FPS показується лиш коли +of.options.SHOW_FPS.tooltip.6=екран дебагу вимкнено. + +of.options.save.default=Базове (2с) +of.options.save.20s=20с +of.options.save.3min=3хв +of.options.save.30min=30хв + +of.options.AUTOSAVE_TICKS=Автозбереження +of.options.AUTOSAVE_TICKS.tooltip.1=Інтервал автозбереження +of.options.AUTOSAVE_TICKS.tooltip.2=Базовий інтервал збереження (2с) НЕ РЕКОМЕНДОВАНО. +of.options.AUTOSAVE_TICKS.tooltip.3=Автозбереження спричиняє "фріз смерті". + +of.options.SCREENSHOT_SIZE=Розмір знімку екрану +of.options.SCREENSHOT_SIZE.tooltip.1=Розмір скріншоту +of.options.SCREENSHOT_SIZE.tooltip.2= Базовий - стандартний розмір скріншоту +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - власний розмір скріншоту +of.options.SCREENSHOT_SIZE.tooltip.4=Зйомка більшого скріншоту потребує більше пам'яті +of.options.SCREENSHOT_SIZE.tooltip.5=Не сумісне з швидким рендером і згладжуванням +of.options.SCREENSHOT_SIZE.tooltip.6=Потребує підтримку фреймбуфера GPU. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/zh_CN.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/zh_CN.lang new file mode 100644 index 0000000..6d7f928 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/zh_CN.lang @@ -0,0 +1,682 @@ +# Contributors of Chinese localization # +# Degh_Cilon_ From WAWCraft 2016-2-18 ---- 2017-11-29 +# xuyu_staryG(gxy17886) From InfinityStudio 2016-1-18 ---- 2016-1-19 +# hukk From MCBBS 2013-7-13 ---- 2016-11-9 +# shengjing1 From MCBBS 2012-11-20 ---- 2013-4-20 +# Language File Begins Here... + +# General +of.general.ambiguous=模糊 +of.general.custom=自定义 +of.general.from=来自 +of.general.id=Id +of.general.restart=重启游戏 +of.general.smart=智能 + +# Keys +of.key.zoom=缩放 + +# Message +of.message.aa.shaders1=抗锯齿与光影不兼容。 +of.message.aa.shaders2=请关闭光影来启用这个选项。 + +of.message.af.shaders1=各向异性过滤与光影不兼容。 +of.message.af.shaders2=请关闭光影来启用这个选项。 + +of.message.fr.shaders1=快速渲染与光影不兼容。 +of.message.fr.shaders2=请关闭光影来启用这个选项。 + +of.message.an.shaders1=3D立体与光影不兼容。 +of.message.an.shaders2=请关闭光影来启用这个选项。 + +of.message.shaders.aa1=光影与抗锯齿不兼容。 +of.message.shaders.aa2=请把 品质 -> 抗锯齿 选项设置为 关 并重启您的游戏。 + +of.message.shaders.af1=光影与各向异性过滤不兼容。 +of.message.shaders.af2=请把 品质 -> 各向异性过滤 选项设置为 关。 + +of.message.shaders.fr1=光影与快速渲染不兼容。 +of.message.shaders.fr2=请把 性能 -> 快速渲染 选项设置为 关。 + +of.message.shaders.an1=光影与3D立体不兼容。 +of.message.shaders.an2=请把 其他 -> 3D立体 选项设置为 关。 + +of.message.newVersion=新的§eOptiFine§f版本现已可用:§e%s§f +of.message.java64Bit=您可以安装§e64位Java§f来提升性能。 +of.message.openglError=§eOpenGL错误§f:%s(%s) + +of.message.shaders.loading=载入光影:%s + +of.message.other.reset=确认重置所有视频设置为默认值吗? + +of.message.loadingVisibleChunks=正在加载可见区块 + +# Video settings + +options.graphics.tooltip.1=图像品质 +options.graphics.tooltip.2= 流畅 - 低品质,较快 +options.graphics.tooltip.3= 高品质 - 高品质,较慢 +options.graphics.tooltip.4=改变云、树叶、水、 +options.graphics.tooltip.5=阴影和草地的外观。 + +of.options.renderDistance.tiny=最近 +of.options.renderDistance.short=近 +of.options.renderDistance.normal=中等 +of.options.renderDistance.far=远 +of.options.renderDistance.extreme=极限 + +options.renderDistance.tooltip.1=能见度 +options.renderDistance.tooltip.2= 2 最近 - 32m(最快) +options.renderDistance.tooltip.3= 4 近 - 64m(较快) +options.renderDistance.tooltip.4= 8 中等 - 128m +options.renderDistance.tooltip.5= 16 远 - 256m(较慢) +options.renderDistance.tooltip.6= 32 极限 - 512m(最慢!) +options.renderDistance.tooltip.7=极限能见度非常消耗资源! +options.renderDistance.tooltip.8=超过 16 的能见度值只在本地世界有效。 + +options.ao.tooltip.1=平滑光照 +options.ao.tooltip.2= 关 - 没有平滑光照(较快) +options.ao.tooltip.3= 最小 - 简单流畅的平滑光照(较慢) +options.ao.tooltip.4= 最大 - 复杂柔和的平滑光照(最慢) + +options.framerateLimit.tooltip.1=最大帧率 +options.framerateLimit.tooltip.2= 垂直同步 - 受限于显示器帧率(60,30,20) +options.framerateLimit.tooltip.3= 5-255 - 可变 +options.framerateLimit.tooltip.4= 无限制 - 无限制(最快) +options.framerateLimit.tooltip.5=帧率上限将降低FPS +options.framerateLimit.tooltip.6=即使其未达上限值。 +of.options.framerateLimit.vsync=垂直同步 + +of.options.AO_LEVEL=平滑光照 +of.options.AO_LEVEL.tooltip.1=平滑光照 +of.options.AO_LEVEL.tooltip.2= 关 - 没有阴影 +of.options.AO_LEVEL.tooltip.3= 50%% - 明亮的阴影 +of.options.AO_LEVEL.tooltip.4= 100%% - 阴暗的阴影 + +options.viewBobbing.tooltip.1=更真实的运动。 +options.viewBobbing.tooltip.2=当使用多级纹理贴图时,关闭它以获得最佳效果。 + +options.guiScale.tooltip.1=界面尺寸 +options.guiScale.tooltip.2= 自动 - 最大尺寸 +options.guiScale.tooltip.3= 小,中,大 - 1x到3x +options.guiScale.tooltip.4= 4x到10x - 在4K分辨率下可用 +options.guiScale.tooltip.5=奇数值(1x,3x,5x之类)与Unicode不兼容。 +options.guiScale.tooltip.6=一个较小的界面或许会更快。 + +options.vbo.tooltip.1=启用缓冲区顶点对象 +options.vbo.tooltip.2=使用一种替选的渲染模式,通常 +options.vbo.tooltip.3=可以比默认渲染快(5-10%%)。 + +options.gamma.tooltip.1=增加较暗物体的亮度 +options.gamma.tooltip.2= 标准 - 标准亮度 +options.gamma.tooltip.3= 1-99%% - 可变亮度 +options.gamma.tooltip.4= 明亮 - 最大亮度 +options.gamma.tooltip.5=此选项不会改变 +options.gamma.tooltip.6=完全黑色的物体的亮度。 + +options.anaglyph.tooltip.1=3D立体 +options.anaglyph.tooltip.2=通过为每只眼睛分色 +options.anaglyph.tooltip.3=来启用3D立体效果。 +options.anaglyph.tooltip.4=需要使用红蓝眼镜正常观看. + +options.blockAlternatives.tooltip.1=替选方块 +options.blockAlternatives.tooltip.2=为一些方块使用备选的方块模型。 +options.blockAlternatives.tooltip.3=取决于所选的资源包。 + +of.options.ALTERNATE_BLOCKS=替选方块 +of.options.ALTERNATE_BLOCKS.tooltip.1=替选方块 +of.options.ALTERNATE_BLOCKS.tooltip.2=为一些方块使用备选的方块模型。 +of.options.ALTERNATE_BLOCKS.tooltip.3=取决于所选的资源包。 + +of.options.FOG_FANCY=迷雾 +of.options.FOG_FANCY.tooltip.1=迷雾类型 +of.options.FOG_FANCY.tooltip.2= 流畅 - 较流畅的迷雾 +of.options.FOG_FANCY.tooltip.3= 高品质 - 较慢的迷雾,质量更佳 +of.options.FOG_FANCY.tooltip.4= 关 - 无迷雾,最快 +of.options.FOG_FANCY.tooltip.5=细致的迷雾只在 +of.options.FOG_FANCY.tooltip.6=显卡支持下可用。 + +of.options.FOG_START=迷雾起始位置 +of.options.FOG_START.tooltip.1=迷雾起始位置 +of.options.FOG_START.tooltip.2= 0.2 - 迷雾起始于玩家周围 +of.options.FOG_START.tooltip.3= 0.8 - 迷雾在离玩家较远的地方起始 +of.options.FOG_START.tooltip.4=此选项通常不会影响性能。 + +of.options.CHUNK_LOADING=区块加载 +of.options.CHUNK_LOADING.tooltip.1=区块加载 +of.options.CHUNK_LOADING.tooltip.2= 默认 - 当加载区块时FPS不稳定 +of.options.CHUNK_LOADING.tooltip.3= 平滑 - 稳定FPS +of.options.CHUNK_LOADING.tooltip.4= 多核心 - 稳定FPS,3倍的世界加载速度 +of.options.CHUNK_LOADING.tooltip.5=平滑和多核心可消除由区块 +of.options.CHUNK_LOADING.tooltip.6=加载引起的延迟和卡顿。 +of.options.CHUNK_LOADING.tooltip.7=多核心可以令世界加载速度提升3倍 +of.options.CHUNK_LOADING.tooltip.8=并通过使用多个CPU核心来提升FPS。 +of.options.chunkLoading.smooth=平滑 +of.options.chunkLoading.multiCore=多核心 + +of.options.shaders=光影... +of.options.shadersTitle=光影 + +of.options.shaders.packNone=关闭 +of.options.shaders.packDefault=(内置) + +of.options.shaders.ANTIALIASING=抗锯齿 +of.options.shaders.ANTIALIASING.tooltip.1=抗锯齿 +of.options.shaders.ANTIALIASING.tooltip.2= 关 - (默认)不启用抗锯齿(较快) +of.options.shaders.ANTIALIASING.tooltip.3= FXAA 2x, 4x - 线边抗锯齿处理(较慢) +of.options.shaders.ANTIALIASING.tooltip.4=FXAA是一种平滑锯齿线和 +of.options.shaders.ANTIALIASING.tooltip.5=鲜明色彩过渡的后处理特效。 +of.options.shaders.ANTIALIASING.tooltip.6=这比传统的抗锯齿处理更快捷, +of.options.shaders.ANTIALIASING.tooltip.7=并且它与光影和快速渲染兼容。 + +of.options.shaders.NORMAL_MAP=法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.1=法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.2= 开 - (默认)启用法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.3= 关 - 禁用法线贴图 +of.options.shaders.NORMAL_MAP.tooltip.4=光影包可以使用法线贴图在 +of.options.shaders.NORMAL_MAP.tooltip.5=平面模型表面内模拟三维几何结构。 +of.options.shaders.NORMAL_MAP.tooltip.6=法线贴图材质一般由 +of.options.shaders.NORMAL_MAP.tooltip.7=当前的资源包提供。 + +of.options.shaders.SPECULAR_MAP=高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.1=高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.2= 开 - (默认)启用高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.3= 关 - 禁用高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.4=光影包可以使用高光贴图 +of.options.shaders.SPECULAR_MAP.tooltip.5=模拟特殊的反射效果。 +of.options.shaders.SPECULAR_MAP.tooltip.6=高光贴图材质一般由 +of.options.shaders.SPECULAR_MAP.tooltip.7=当前的资源包提供。 + +of.options.shaders.RENDER_RES_MUL=渲染精细度 +of.options.shaders.RENDER_RES_MUL.tooltip.1=渲染精细度 +of.options.shaders.RENDER_RES_MUL.tooltip.2= 0.5x - 低(最快) +of.options.shaders.RENDER_RES_MUL.tooltip.3= 1x - 标准(默认) +of.options.shaders.RENDER_RES_MUL.tooltip.4= 2x - 高(最慢) +of.options.shaders.RENDER_RES_MUL.tooltip.5=渲染精细度控制光影包 +of.options.shaders.RENDER_RES_MUL.tooltip.6=当前渲染的材质大小。 +of.options.shaders.RENDER_RES_MUL.tooltip.7=较低的值可能对4K显示有益。 +of.options.shaders.RENDER_RES_MUL.tooltip.8=较高的值作为抗混叠滤波器工作。 + +of.options.shaders.SHADOW_RES_MUL=阴影精细度 +of.options.shaders.SHADOW_RES_MUL.tooltip.1=阴影精细度 +of.options.shaders.SHADOW_RES_MUL.tooltip.2= 0.5x - 低(最快) +of.options.shaders.SHADOW_RES_MUL.tooltip.3= 1x - 标准(默认) +of.options.shaders.SHADOW_RES_MUL.tooltip.4= 2x - 高(最慢) +of.options.shaders.SHADOW_RES_MUL.tooltip.5=阴影精细度控制光影包 +of.options.shaders.SHADOW_RES_MUL.tooltip.6=使用的阴影映射贴图大小。 +of.options.shaders.SHADOW_RES_MUL.tooltip.7=较低的值 = 不精确的、粗糙的阴影。 +of.options.shaders.SHADOW_RES_MUL.tooltip.8=较高的值 = 细致的、更佳的阴影。 + +of.options.shaders.HAND_DEPTH_MUL=手部景深 +of.options.shaders.HAND_DEPTH_MUL.tooltip.1=手部景深 +of.options.shaders.HAND_DEPTH_MUL.tooltip.2= 0.5x - 手与镜头相距较近 +of.options.shaders.HAND_DEPTH_MUL.tooltip.3= 1x - (默认) +of.options.shaders.HAND_DEPTH_MUL.tooltip.4= 2x - 手与镜头相距较远 +of.options.shaders.HAND_DEPTH_MUL.tooltip.5=手部景深控制手持的物品 +of.options.shaders.HAND_DEPTH_MUL.tooltip.6=和镜头相距多远。 +of.options.shaders.HAND_DEPTH_MUL.tooltip.7=对于使用模糊景深的光影包, +of.options.shaders.HAND_DEPTH_MUL.tooltip.8=此选项应会改变手持物品的模糊程度。 + +of.options.shaders.CLOUD_SHADOW=云朵阴影 + +of.options.shaders.OLD_HAND_LIGHT=经典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.1=经典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.2= 默认 - 光影包控制 +of.options.shaders.OLD_HAND_LIGHT.tooltip.3= 开 - 使用经典手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.4= 关 - 使用新式手持光源 +of.options.shaders.OLD_HAND_LIGHT.tooltip.5=经典手持光源允许只能辨别 +of.options.shaders.OLD_HAND_LIGHT.tooltip.6=主手持有发光物品的光影包 +of.options.shaders.OLD_HAND_LIGHT.tooltip.7=同样在另一只手上工作。 + +of.options.shaders.OLD_LIGHTING=经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.1=经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.2= 默认 - 光影包控制 +of.options.shaders.OLD_LIGHTING.tooltip.3= 开 - 使用经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.4= 关 - 不使用经典光效 +of.options.shaders.OLD_LIGHTING.tooltip.5=经典光效控制原版使用的 +of.options.shaders.OLD_LIGHTING.tooltip.6=方块各面固定照明。 +of.options.shaders.OLD_LIGHTING.tooltip.7=使用阴影的光影包通常会提供 +of.options.shaders.OLD_LIGHTING.tooltip.8=更好的、取决于太阳位置的照明。 + +of.options.shaders.SHADER_PACK=光影包文件夹 + +of.options.shaders.shadersFolder=光影包文件夹 +of.options.shaders.shaderOptions=光影设置... + +of.options.shaderOptionsTitle=光影设置 + +of.options.quality=品质... +of.options.qualityTitle=品质设置 + +of.options.details=细节... +of.options.detailsTitle=细节设置 + +of.options.performance=性能... +of.options.performanceTitle=性能设置 + +of.options.animations=动画... +of.options.animationsTitle=动画设置 + +of.options.other=其他... +of.options.otherTitle=其他设置 + +of.options.other.reset=重置视频设置... + +of.shaders.profile=配置文件 + +# Quality + +of.options.mipmap.bilinear=双线性 +of.options.mipmap.linear=线性 +of.options.mipmap.nearest=最近 +of.options.mipmap.trilinear=三线性 + +options.mipmapLevels.tooltip.1=通过平滑材质细节,使远处的 +options.mipmapLevels.tooltip.2=物体获得更好的视觉效果。 +options.mipmapLevels.tooltip.3= 关 - 无平滑 +options.mipmapLevels.tooltip.4= 1 - 最小平滑 +options.mipmapLevels.tooltip.5= 4 - 最大平滑 +options.mipmapLevels.tooltip.6=此选项通常不影响性能。 + +of.options.MIPMAP_TYPE=多级渐进纹理过滤类型 +of.options.MIPMAP_TYPE.tooltip.1=通过平滑材质细节,使远处的 +of.options.MIPMAP_TYPE.tooltip.2=物体获得更好的视觉效果。 +of.options.MIPMAP_TYPE.tooltip.3= 最近 - 粗糙平滑(最快) +of.options.MIPMAP_TYPE.tooltip.4= 线性 - 正常平滑 +of.options.MIPMAP_TYPE.tooltip.5= 双线性 - 精细平滑 +of.options.MIPMAP_TYPE.tooltip.6= 三线性 - 最佳平滑(最慢) + + +of.options.AA_LEVEL=抗锯齿 +of.options.AA_LEVEL.tooltip.1=抗锯齿 +of.options.AA_LEVEL.tooltip.2= 关 - (默认)无抗锯齿(较快) +of.options.AA_LEVEL.tooltip.3= 2-16 - 对线和边缘使用抗锯齿(较慢) +of.options.AA_LEVEL.tooltip.4=抗锯齿将平滑锯齿线 +of.options.AA_LEVEL.tooltip.5=和锐利的色彩过渡。 +of.options.AA_LEVEL.tooltip.6=启用它可能会大幅降低FPS。 +of.options.AA_LEVEL.tooltip.7=并非所有级别都被显卡支持。 +of.options.AA_LEVEL.tooltip.8=重启后生效! + +of.options.AF_LEVEL=各向异性过滤 +of.options.AF_LEVEL.tooltip.1=各向异性过滤 +of.options.AF_LEVEL.tooltip.2= 关 - (默认)标准材质细节(较快) +of.options.AF_LEVEL.tooltip.3= 2-16 - 为多级纹理过滤后的材质提供精细细节(较慢) +of.options.AF_LEVEL.tooltip.4=各向异性过滤还原了经多级 +of.options.AF_LEVEL.tooltip.5=纹理过滤后的材质细节。 +of.options.AF_LEVEL.tooltip.6=启用它可能会大幅降低FPS。 + +of.options.CLEAR_WATER=清澈水体 +of.options.CLEAR_WATER.tooltip.1=清澈水体 +of.options.CLEAR_WATER.tooltip.2= 开 - 清澈、透明水体 +of.options.CLEAR_WATER.tooltip.3= 关 - 默认水体 + +of.options.RANDOM_MOBS=随机生物 +of.options.RANDOM_MOBS.tooltip.1=随机生物材质 +of.options.RANDOM_MOBS.tooltip.2= 关 - 关闭随机生物材质,较快 +of.options.RANDOM_MOBS.tooltip.3= 开 - 随机生物材质,较慢 +of.options.RANDOM_MOBS.tooltip.4=游戏中的生物材质使用随机的贴图。 +of.options.RANDOM_MOBS.tooltip.5=需要资源包内有多个生物贴图。 + +of.options.BETTER_GRASS=更好的草地 +of.options.BETTER_GRASS.tooltip.1=更好的草地 +of.options.BETTER_GRASS.tooltip.2= 关 - 默认草地材质,较快 +of.options.BETTER_GRASS.tooltip.3= 流畅 - 草方块侧面全部使用草地材质,较慢 +of.options.BETTER_GRASS.tooltip.4= 高品质 - 草方块侧面材质动态化,最慢 + +of.options.BETTER_SNOW=更好的雪地 +of.options.BETTER_SNOW.tooltip.1=更好的雪地 +of.options.BETTER_SNOW.tooltip.2= 关 - 默认的雪地,较快 +of.options.BETTER_SNOW.tooltip.3= 开 - 更好的雪地,较慢 +of.options.BETTER_SNOW.tooltip.4=在“透明方块”(如栅栏、高草) +of.options.BETTER_SNOW.tooltip.5=与雪接壤时,在其下显示雪。 + +of.options.CUSTOM_FONTS=自定义字体 +of.options.CUSTOM_FONTS.tooltip.1=自定义字体 +of.options.CUSTOM_FONTS.tooltip.2= 开 - 使用自定义字体(默认),较慢 +of.options.CUSTOM_FONTS.tooltip.3= 关 - 使用默认字体,较快 +of.options.CUSTOM_FONTS.tooltip.4=自定义字体一般由 +of.options.CUSTOM_FONTS.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_COLORS=自定义色彩 +of.options.CUSTOM_COLORS.tooltip.1=自定义色彩 +of.options.CUSTOM_COLORS.tooltip.2= 开 - 使用自定义色彩(默认),较慢 +of.options.CUSTOM_COLORS.tooltip.3= 关 - 使用默认色彩,较快 +of.options.CUSTOM_COLORS.tooltip.4=自定义色彩一般由 +of.options.CUSTOM_COLORS.tooltip.5=当前的资源包提供。 + +of.options.SWAMP_COLORS=沼泽颜色 +of.options.SWAMP_COLORS.tooltip.1=沼泽颜色 +of.options.SWAMP_COLORS.tooltip.2= 开 - 使用沼泽颜色(默认),较慢 +of.options.SWAMP_COLORS.tooltip.3= 关 - 不使用沼泽颜色,较快 +of.options.SWAMP_COLORS.tooltip.4=沼泽的颜色会影响草、树叶、藤蔓和水。 + +of.options.SMOOTH_BIOMES=平滑生物群系 +of.options.SMOOTH_BIOMES.tooltip.1=平滑生物群系 +of.options.SMOOTH_BIOMES.tooltip.2= 开 - 平滑生物群系的边界(默认),较慢 +of.options.SMOOTH_BIOMES.tooltip.3= 关 - 不平滑生物群系的边界,较快 +of.options.SMOOTH_BIOMES.tooltip.4=生物群系的边界平滑取样于 +of.options.SMOOTH_BIOMES.tooltip.5=附近所有方块颜色的平均值。 +of.options.SMOOTH_BIOMES.tooltip.6=草、树叶、藤蔓和水会被受到影响。 + +of.options.CONNECTED_TEXTURES=连接纹理 +of.options.CONNECTED_TEXTURES.tooltip.1=连接纹理 +of.options.CONNECTED_TEXTURES.tooltip.2= 关 - 关闭连接纹理(默认) +of.options.CONNECTED_TEXTURES.tooltip.3= 流畅 - 快速处理纹理连接 +of.options.CONNECTED_TEXTURES.tooltip.4= 高品质 - 精细处理纹理连接 +of.options.CONNECTED_TEXTURES.tooltip.5=连接纹理为玻璃、沙石和书架增加了连接材质, +of.options.CONNECTED_TEXTURES.tooltip.6=当它们互相放在一起时会将材质连接为一体。 +of.options.CONNECTED_TEXTURES.tooltip.7=连接材质一般由 +of.options.CONNECTED_TEXTURES.tooltip.8=当前的资源包提供。 + +of.options.NATURAL_TEXTURES=天然纹理 +of.options.NATURAL_TEXTURES.tooltip.1=天然纹理 +of.options.NATURAL_TEXTURES.tooltip.2= 关 - 关闭天然纹理(默认) +of.options.NATURAL_TEXTURES.tooltip.3= 开 - 使用天然纹理 +of.options.NATURAL_TEXTURES.tooltip.4=天然纹理会移除由同一类型的方块重复 +of.options.NATURAL_TEXTURES.tooltip.5=而创建的栅格状图案。它通过旋转和翻转 +of.options.NATURAL_TEXTURES.tooltip.6=方块的基础材质来创建材质变体。 +of.options.NATURAL_TEXTURES.tooltip.7=天然纹理的配置和材质一般由 +of.options.NATURAL_TEXTURES.tooltip.8=当前的资源包提供。 + +of.options.EMISSIVE_TEXTURES=光亮纹理 +of.options.EMISSIVE_TEXTURES.tooltip.1=光亮纹理 +of.options.EMISSIVE_TEXTURES.tooltip.2= 关 - 关闭光亮纹理(默认) +of.options.EMISSIVE_TEXTURES.tooltip.3= 开 - 使用光亮纹理 +of.options.EMISSIVE_TEXTURES.tooltip.4=光亮纹理被渲染为拥有 +of.options.EMISSIVE_TEXTURES.tooltip.5=全亮度的覆盖层。可用于 +of.options.EMISSIVE_TEXTURES.tooltip.6=模拟原材质的发光部分。 +of.options.EMISSIVE_TEXTURES.tooltip.7=光亮纹理一般由 +of.options.EMISSIVE_TEXTURES.tooltip.8=当前的资源包提供。 + +of.options.CUSTOM_SKY=自定义天空 +of.options.CUSTOM_SKY.tooltip.1=自定义天空 +of.options.CUSTOM_SKY.tooltip.2= 开 - 自定义天空材质(默认),较慢 +of.options.CUSTOM_SKY.tooltip.3= 关闭 - 默认天空材质,较快 +of.options.CUSTOM_SKY.tooltip.4=自定义天空的材质一般由 +of.options.CUSTOM_SKY.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_ITEMS=自定义物品 +of.options.CUSTOM_ITEMS.tooltip.1=自定义物品 +of.options.CUSTOM_ITEMS.tooltip.2= 开 - 自定义物品材质(默认),较慢 +of.options.CUSTOM_ITEMS.tooltip.3= 关 - 默认物品材质,较快 +of.options.CUSTOM_ITEMS.tooltip.4=自定义物品的材质一般由 +of.options.CUSTOM_ITEMS.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_ENTITY_MODELS=自定义实体模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=自定义实体模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= 开 - 自定义实体模型(默认),较慢 +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= 关 - 默的实体模型,较快 +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=自定义实体模型的材质一般由 +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=当前的资源包提供。 + +of.options.CUSTOM_GUIS=自定义GUI +of.options.CUSTOM_GUIS.tooltip.1=自定义GUI +of.options.CUSTOM_GUIS.tooltip.2= 开 - 自定义的图形用户界面(默认),较慢 +of.options.CUSTOM_GUIS.tooltip.3= 关 - 默认的图形用户界面,较快 +of.options.CUSTOM_GUIS.tooltip.4=自定义图形用户界面一般由当前的资源包提供。 + +# Details + +of.options.CLOUDS=云 +of.options.CLOUDS.tooltip.1=云 +of.options.CLOUDS.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.CLOUDS.tooltip.3= 流畅 - 低品质,较快 +of.options.CLOUDS.tooltip.4= 高品质 - 高品质,较慢 +of.options.CLOUDS.tooltip.5= 关闭 - 没有云,最快 +of.options.CLOUDS.tooltip.6=低品质云使用2D渲染, +of.options.CLOUDS.tooltip.7=高品质云使用3D渲染。 + +of.options.CLOUD_HEIGHT=云高度 +of.options.CLOUD_HEIGHT.tooltip.1=云高度 +of.options.CLOUD_HEIGHT.tooltip.2= 关闭 - 默认高度 +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - 超过世界限定高度 + +of.options.TREES=树 +of.options.TREES.tooltip.1=树 +of.options.TREES.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.TREES.tooltip.3= 流畅 - 低品质,最快 +of.options.TREES.tooltip.4= 智能 - 较高品质,较快 +of.options.TREES.tooltip.5= 高品质 - 高品质,较慢 +of.options.TREES.tooltip.6=低品质的树叶不透明, +of.options.TREES.tooltip.7=高品质的树叶透明镂空。 + +of.options.RAIN=雨雪 +of.options.RAIN.tooltip.1=雨雪 +of.options.RAIN.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.RAIN.tooltip.3= 流畅 - 少量的雨/雪,较快 +of.options.RAIN.tooltip.4= 高品质 - 大量的雨/雪,较慢 +of.options.RAIN.tooltip.5= 关闭 - 没有雨/雪,最快 +of.options.RAIN.tooltip.6=当雨雪选项为 关闭 时, +of.options.RAIN.tooltip.7=雨声仍然存在。 + +of.options.SKY=天空 +of.options.SKY.tooltip.1=天空 +of.options.SKY.tooltip.2= 开 - 天空可见,较慢 +of.options.SKY.tooltip.3= 关 - 天空不可见,较快 +of.options.SKY.tooltip.4=当天空关闭时,月亮和太阳依然可见。 + +of.options.STARS=星星 +of.options.STARS.tooltip.1=星星 +of.options.STARS.tooltip.2= 开 - 星星可见,较慢 +of.options.STARS.tooltip.3= 关 - 星星不可见,较快 + +of.options.SUN_MOON=日月 +of.options.SUN_MOON.tooltip.1=日月 +of.options.SUN_MOON.tooltip.2= 开 - 太阳和月亮可见(默认) +of.options.SUN_MOON.tooltip.3= 关 - 太阳和月亮不可见(较快) + +of.options.SHOW_CAPES=显示披风 +of.options.SHOW_CAPES.tooltip.1=显示披风 +of.options.SHOW_CAPES.tooltip.2= 开 - 显示玩家披风(默认) +of.options.SHOW_CAPES.tooltip.3= 关 - 不显示玩家披风 + +of.options.TRANSLUCENT_BLOCKS=半透明方块 +of.options.TRANSLUCENT_BLOCKS.tooltip.1=半透明方块 +of.options.TRANSLUCENT_BLOCKS.tooltip.2= 高品质 - 准确的混合颜色(默认) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 流畅 - 快速的混合颜色(较快) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=用于控制不同颜色的半透明 +of.options.TRANSLUCENT_BLOCKS.tooltip.5=方块(染色玻璃、水、冰)间 +of.options.TRANSLUCENT_BLOCKS.tooltip.6=有空气存在时,彼此颜色的混合。 + +of.options.HELD_ITEM_TOOLTIPS=持有物信息显示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=持有物信息显示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= 开 - 显示持有物信息(默认) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= 关 - 隐藏持有物信息 + +of.options.ADVANCED_TOOLTIPS=高级信息提示 +of.options.ADVANCED_TOOLTIPS.tooltip.1=高级信息提示 +of.options.ADVANCED_TOOLTIPS.tooltip.2= 开 - 显示高级信息提示 +of.options.ADVANCED_TOOLTIPS.tooltip.3= 关 - 隐藏高级信息提示(默认) +of.options.ADVANCED_TOOLTIPS.tooltip.4=高级信息提示显示物品 +of.options.ADVANCED_TOOLTIPS.tooltip.5=(ID、耐久度)和光影设置 +of.options.ADVANCED_TOOLTIPS.tooltip.6=(ID、源、默认值)的拓展信息。 + +of.options.DROPPED_ITEMS=掉落物品 +of.options.DROPPED_ITEMS.tooltip.1=掉落物品 +of.options.DROPPED_ITEMS.tooltip.2= 默认 - 以“图形品质”的设定为准 +of.options.DROPPED_ITEMS.tooltip.3= 流畅 - 2D掉落物品,较快 +of.options.DROPPED_ITEMS.tooltip.4= 高品质 - 3D掉落物品,较慢 + +options.entityShadows.tooltip.1=实体阴影 +options.entityShadows.tooltip.2= 开 - 显示实体阴影 +options.entityShadows.tooltip.3= 关 - 隐藏实体阴影 + +of.options.VIGNETTE=晕影 +of.options.VIGNETTE.tooltip.1=屏幕四角轻微变暗的视觉效果 +of.options.VIGNETTE.tooltip.2= 默认 - 以“图形品质”的设定为准(默认) +of.options.VIGNETTE.tooltip.3= 流畅 - 晕影关闭(较快) +of.options.VIGNETTE.tooltip.4= 高品质 - 晕影开启(较慢) +of.options.VIGNETTE.tooltip.5=晕影可能对FPS有显著的影响, +of.options.VIGNETTE.tooltip.6=尤其是全屏游戏的时候。 +of.options.VIGNETTE.tooltip.7=晕影的效果非常细微, +of.options.VIGNETTE.tooltip.8=并且可以被安全地禁用。 + +of.options.DYNAMIC_FOV=动态视场 +of.options.DYNAMIC_FOV.tooltip.1=动态视场 +of.options.DYNAMIC_FOV.tooltip.2= 开 - 启用动态视场(默认) +of.options.DYNAMIC_FOV.tooltip.3= 关 - 禁用动态视场 +of.options.DYNAMIC_FOV.tooltip.4=当正在飞行、疾跑或 +of.options.DYNAMIC_FOV.tooltip.5=拉弓时改变视场。 + +of.options.DYNAMIC_LIGHTS=动态光源 +of.options.DYNAMIC_LIGHTS.tooltip.1=动态光源 +of.options.DYNAMIC_LIGHTS.tooltip.2= 关 - 无动态光源(默认) +of.options.DYNAMIC_LIGHTS.tooltip.3= 流畅 - 较快的动态光源(每500ms更新一次) +of.options.DYNAMIC_LIGHTS.tooltip.4= 高品质 - 高品质的动态光源(实时更新) +of.options.DYNAMIC_LIGHTS.tooltip.5=允许发光的物品(火把、萤石等) +of.options.DYNAMIC_LIGHTS.tooltip.6=当被玩家左右手持握、装备或 +of.options.DYNAMIC_LIGHTS.tooltip.7=成为掉落物时照亮周围的一切。 + +# Performance + +of.options.SMOOTH_FPS=平滑FPS +of.options.SMOOTH_FPS.tooltip.1=通过清除显卡缓冲区来稳定FPS +of.options.SMOOTH_FPS.tooltip.2= 关 - 不稳定,FPS可能波动 +of.options.SMOOTH_FPS.tooltip.3= 开 - FPS稳定 +of.options.SMOOTH_FPS.tooltip.4=此选项依赖于显卡驱动, +of.options.SMOOTH_FPS.tooltip.5=通常效果并不明显。 + +of.options.SMOOTH_WORLD=平滑世界 +of.options.SMOOTH_WORLD.tooltip.1=移除内部服务造成的数据延时。 +of.options.SMOOTH_WORLD.tooltip.2= 关 - 不稳定,FPS可能波动 +of.options.SMOOTH_WORLD.tooltip.3= 开 - FPS稳定 +of.options.SMOOTH_WORLD.tooltip.4=分担内部服务器负载来稳定FPS。 +of.options.SMOOTH_WORLD.tooltip.5=只在本地世界(单人游戏)有效。 + +of.options.FAST_RENDER=快速渲染 +of.options.FAST_RENDER.tooltip.1=快速渲染 +of.options.FAST_RENDER.tooltip.2= 关 - 标准渲染(默认) +of.options.FAST_RENDER.tooltip.3= 开 - 优化渲染(较快) +of.options.FAST_RENDER.tooltip.4=采用优化渲染算法从而降低GPU的负载 +of.options.FAST_RENDER.tooltip.5=并且可能大幅提升FPS。 + +of.options.FAST_MATH=快速运算 +of.options.FAST_MATH.tooltip.1=快速运算 +of.options.FAST_MATH.tooltip.2= 关 - 标准的运算(默认) +of.options.FAST_MATH.tooltip.3= 开 - 更快的运算 +of.options.FAST_MATH.tooltip.4=采用优化的sin()和cos()函数可以 +of.options.FAST_MATH.tooltip.5=更好地利用CPU缓存并且提升FPS。 + +of.options.CHUNK_UPDATES=区块更新 +of.options.CHUNK_UPDATES.tooltip.1=区块更新 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 世界载入速度较慢,FPS较高(默认) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 世界载入速度较快,FPS较低 +of.options.CHUNK_UPDATES.tooltip.4= 5 - 世界载入速度最快,FPS最低 +of.options.CHUNK_UPDATES.tooltip.5=渲染每帧时更新的区块数, +of.options.CHUNK_UPDATES.tooltip.6=更高的值将会导致帧数不稳定。 + +of.options.CHUNK_UPDATES_DYNAMIC=动态更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=动态区块更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= 关 - (默认)每帧标准区块更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= 开 - 当玩家站立不动时更多的区块更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=当玩家站立不动时,强迫更多的 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=区块更新,使得世界加载更快。 + +of.options.LAZY_CHUNK_LOADING=缓慢区块加载 +of.options.LAZY_CHUNK_LOADING.tooltip.1=缓慢区块加载 +of.options.LAZY_CHUNK_LOADING.tooltip.2= 关 - 默认的服务器区块载入 +of.options.LAZY_CHUNK_LOADING.tooltip.3= 开 - 缓慢的服务器区块载入(更平滑) +of.options.LAZY_CHUNK_LOADING.tooltip.4=将区块分布在多个“游戏刻”进行加载 +of.options.LAZY_CHUNK_LOADING.tooltip.5=从而平滑服务器整体区块加载。 +of.options.LAZY_CHUNK_LOADING.tooltip.6=如果部分世界不能正确地载入,请把它设置为关。 +of.options.LAZY_CHUNK_LOADING.tooltip.7=仅适用于单玩家的本地世界。 + +# Animations + +of.options.animation.allOn=全部开启 +of.options.animation.allOff=全部关闭 +of.options.animation.dynamic=动态 + +of.options.ANIMATED_WATER=水面动画 +of.options.ANIMATED_LAVA=岩浆动画 +of.options.ANIMATED_FIRE=火焰动画 +of.options.ANIMATED_PORTAL=传送门动画 +of.options.ANIMATED_REDSTONE=红石动画 +of.options.ANIMATED_EXPLOSION=爆炸动画 +of.options.ANIMATED_FLAME=燃烧动画 +of.options.ANIMATED_SMOKE=烟雾动画 +of.options.VOID_PARTICLES=虚空粒子 +of.options.WATER_PARTICLES=水面粒子 +of.options.RAIN_SPLASH=雨滴飞溅 +of.options.PORTAL_PARTICLES=传送门粒子 +of.options.POTION_PARTICLES=药水粒子 +of.options.DRIPPING_WATER_LAVA=流动水/岩浆 +of.options.ANIMATED_TERRAIN=地形动画 +of.options.ANIMATED_TEXTURES=材质动画 +of.options.FIREWORK_PARTICLES=烟花粒子 + +# Other + +of.options.LAGOMETER=快速调试信息 +of.options.LAGOMETER.tooltip.1=在调试界面(F3)显示快速调试信息。 +of.options.LAGOMETER.tooltip.2=* 橙 - 内存垃圾回收 +of.options.LAGOMETER.tooltip.3=* 青 - 游戏刻 +of.options.LAGOMETER.tooltip.4=* 蓝 - 预定可执行 +of.options.LAGOMETER.tooltip.5=* 紫 - 区块加载 +of.options.LAGOMETER.tooltip.6=* 红 - 区块更新 +of.options.LAGOMETER.tooltip.7=* 黄 - 能见度检查 +of.options.LAGOMETER.tooltip.8=* 绿 - 渲染地形 + +of.options.PROFILER=调试分析器 +of.options.PROFILER.tooltip.1=调试分析器 +of.options.PROFILER.tooltip.2= 开 - 调试分析器启用,较慢 +of.options.PROFILER.tooltip.3= 关 - 调试分析器禁用,较快 +of.options.PROFILER.tooltip.4=在调试界面开启状态(F3)时 +of.options.PROFILER.tooltip.5=调试分析器收集并且显示调试信息。 + +of.options.WEATHER=天气 +of.options.WEATHER.tooltip.1=天气 +of.options.WEATHER.tooltip.2= 开 - 开启天气,较慢 +of.options.WEATHER.tooltip.3= 关 - 关闭天气,较快 +of.options.WEATHER.tooltip.4=天气选项影响雨,雪和雷电。 +of.options.WEATHER.tooltip.5=天气选项仅在本地游戏中生效。 + +of.options.time.dayOnly=只有白天 +of.options.time.nightOnly=只有夜晚 + +of.options.TIME=时间 +of.options.TIME.tooltip.1=时间 +of.options.TIME.tooltip.2= 默认 - 正常的日夜交替 +of.options.TIME.tooltip.3= 只有白天 - 只有白天 +of.options.TIME.tooltip.4= 只有夜晚 - 只有夜晚 +of.options.TIME.tooltip.5=时间设置只在创造模式下 +of.options.TIME.tooltip.6=且为本地游戏时有效。 + +options.fullscreen.tooltip.1=全屏 +options.fullscreen.tooltip.2= 开 - 使用全屏模式 +options.fullscreen.tooltip.3= 关 - 使用窗口模式 +options.fullscreen.tooltip.4=全屏模式可能比窗口模式更快 +options.fullscreen.tooltip.5=或者更慢,取决于显卡。 + +of.options.FULLSCREEN_MODE=全屏模式 +of.options.FULLSCREEN_MODE.tooltip.1=全屏模式 +of.options.FULLSCREEN_MODE.tooltip.2= 默认 - 使用桌面分辨率,较慢 +of.options.FULLSCREEN_MODE.tooltip.3= 自定义 - 使用自定义屏幕分辨率,可能会较快 +of.options.FULLSCREEN_MODE.tooltip.4=这个选项只有在全屏模式下生效(F11)。 +of.options.FULLSCREEN_MODE.tooltip.5=较低的分辨率通常会更快。 + +of.options.SHOW_FPS=显示FPS +of.options.SHOW_FPS.tooltip.1=显示迷你的FPS和渲染信息 +of.options.SHOW_FPS.tooltip.2= C:- 区块渲染器 +of.options.SHOW_FPS.tooltip.3= E:- 一般实体 + 方块实体 +of.options.SHOW_FPS.tooltip.4= U:- 区块更新 +of.options.SHOW_FPS.tooltip.5=只有调试屏幕隐藏时 +of.options.SHOW_FPS.tooltip.6=迷你FPS信息才会显示。 + +of.options.save.default=默认(2秒) +of.options.save.20s=20秒 +of.options.save.3min=3分钟 +of.options.save.30min=30分钟 + +of.options.AUTOSAVE_TICKS=自动保存 +of.options.AUTOSAVE_TICKS.tooltip.1=自动保存间隔 +of.options.AUTOSAVE_TICKS.tooltip.2=不推荐使用默认自动保存间隔(2秒)。 +of.options.AUTOSAVE_TICKS.tooltip.3=自动保存导致了著名的“死亡卡顿”。 + +of.options.SCREENSHOT_SIZE=截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.1=截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.2= 默认 - 默认的截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - 自定义截图尺寸 +of.options.SCREENSHOT_SIZE.tooltip.4=抓取更大的截图可能需要更多的内存。 +of.options.SCREENSHOT_SIZE.tooltip.5=与快速渲染和抗锯齿不兼容。 +of.options.SCREENSHOT_SIZE.tooltip.6=需要显卡帧缓冲区支持。 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/zh_TW.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/zh_TW.lang new file mode 100644 index 0000000..c780a03 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/lang/zh_TW.lang @@ -0,0 +1,613 @@ +# Contributors of Traditional Chinese localization # +# Degh_Cilon_ From WAWCraft 2016-02-18 ---- 2017-11-19 +# Shujinko_kun From MCHK 2016-02-25 ---- 2016-03-27 +# NatsuArashi 2016-03-03 ---- 2017-06-07 +##-------------- zh_TW --------------- + +# General +of.general.ambiguous=不明確 +of.general.custom=自定義 +of.general.from=來自 +of.general.id=Id +of.general.restart=重新啟動 +of.general.smart=智慧 + +# Keys +of.key.zoom=縮放 + +# Message +of.message.aa.shaders1=抗鋸齒與光影不相容。 +of.message.aa.shaders2=請關閉光影來啟用這個選項。 + +of.message.af.shaders1=各向異性過濾與光影不相容。 +of.message.af.shaders2=請關閉光影來啟用這個選項。 + +of.message.fr.shaders1=快速渲染與光影不相容。 +of.message.fr.shaders2=請關閉光影來啟用這個選項。 + +of.message.an.shaders1=3D立體與光影不相容。 +of.message.an.shaders2=請關閉光影來啟用這個選項。 + +of.message.shaders.aa1=光影與抗鋸齒不相容。 +of.message.shaders.aa2=請把 品質 -> 抗鋸齒 選項設定為 關閉 並且重啟你的遊戲。 + +of.message.shaders.af1=光影與各向異性過濾不相容。 +of.message.shaders.af2=請把 品質 -> 各向異性過濾 選項設置為 關閉。 + +of.message.shaders.fr1=光影與快速渲染不兼容. +of.message.shaders.fr2=請把 性能 -> 快速渲染 選項設定為 關閉. + +of.message.shaders.an1=光影與3D立體不兼容. +of.message.shaders.an2=請把 其他 -> 3D立體 選項設定為 關閉. + +of.message.newVersion=新的§eOptiFine§f版本可以使用了: §e%s§f +of.message.java64Bit=你可以安裝§e64位元Java§f來提升性能. +of.message.openglError=§eOpenGL錯誤§f: %s (%s) + +of.message.shaders.loading=載入光影: %s + +of.message.other.reset=確定要將所有描繪設定重置為預設值嗎? + +of.message.loadingVisibleChunks=正在載入可見區塊 + +# Video settings + +options.graphics.tooltip.1=圖像畫質 +options.graphics.tooltip.2= 性能優先 - 低畫質,較流暢 +options.graphics.tooltip.3= 畫質優先 - 高畫質,較慢 +options.graphics.tooltip.4=改變雲、樹葉、水、 +options.graphics.tooltip.5=陰影和草地的外觀。 + +of.options.renderDistance.tiny=最近 +of.options.renderDistance.short=近 +of.options.renderDistance.normal=中等 +of.options.renderDistance.far=遠 +of.options.renderDistance.extreme=最遠 + +options.renderDistance.tooltip.1=視野 +options.renderDistance.tooltip.2= 2 最近 - 32m (最快) +options.renderDistance.tooltip.3= 4 近 - 64m (較快) +options.renderDistance.tooltip.4= 8 中等 - 128m +options.renderDistance.tooltip.5= 16 遠 - 256m (較慢) +options.renderDistance.tooltip.6= 32 最遠 - 512m (最慢!) +options.renderDistance.tooltip.7=最遠的視野設定非常消耗資源! +options.renderDistance.tooltip.8= 16 以上的視野值只在本地世界有效。 + +options.ao.tooltip.1=柔和化照明效果 +options.ao.tooltip.2= 關閉 - 沒有柔和化照明 (較快) +options.ao.tooltip.3= 最小值 - 簡單柔和化照明 (較慢) +options.ao.tooltip.4= 最大值 - 複雜柔和化照明 (最慢) + +options.framerateLimit.tooltip.1=最大FPS +options.framerateLimit.tooltip.2= 垂直同步 - 受限於顯示器FPS(60,30,20) +options.framerateLimit.tooltip.3= 5-255 - 可變 +options.framerateLimit.tooltip.4= 無限制 - 無限制(最快) +options.framerateLimit.tooltip.5=即使未達FPS上限值 +options.framerateLimit.tooltip.6=上限仍會影響性能。 +of.options.framerateLimit.vsync=垂直同步 + +of.options.AO_LEVEL=柔和化照明等級 +of.options.AO_LEVEL.tooltip.1=柔和化照明等級 +of.options.AO_LEVEL.tooltip.2= 關閉 - 沒有陰影 +of.options.AO_LEVEL.tooltip.3= 50%% - 較亮的陰影 +of.options.AO_LEVEL.tooltip.4= 100%% - 較暗的陰影 + +options.viewBobbing.tooltip.1=更真實的移動。 +options.viewBobbing.tooltip.2=當使用多精度材質時,將它關閉以取得更佳效果。 + +options.guiScale.tooltip.1=介面大小 +options.guiScale.tooltip.2= 自動 - 最大尺寸 +options.guiScale.tooltip.3= 小,中,大 - 1x到3x +options.guiScale.tooltip.4= 4x到10x - 僅適用於4K解析度 +options.guiScale.tooltip.5=奇數值的放大倍數(1x,3x,5x等)與Unicode不相容。 +options.guiScale.tooltip.6=較小的介面或許會更流暢。 + +options.vbo.tooltip.1=啟用緩衝區頂點物件(VBO) +options.vbo.tooltip.2=使用一種常見的替代渲染模型 +options.vbo.tooltip.3=比預設渲染快(5-10%%)。 + +options.gamma.tooltip.1=增加較暗物體的亮度 +options.gamma.tooltip.2= 標準 - 標準亮度 +options.gamma.tooltip.3= 1-99%% - 可變亮度 +options.gamma.tooltip.4= 明亮 - 最大亮度 +options.gamma.tooltip.5=此選項不會改變 +options.gamma.tooltip.6=全黑物體的亮度。 + +options.anaglyph.tooltip.1=3D立體 +options.anaglyph.tooltip.2=透過為每隻眼睛分色 +options.anaglyph.tooltip.3=來產生3D立體效果。 +options.anaglyph.tooltip.4=需要使用紅藍眼鏡進行觀看。 + +options.blockAlternatives.tooltip.1=替選方塊 +options.blockAlternatives.tooltip.2=為一些方塊使用備選的方塊模型. +options.blockAlternatives.tooltip.3=取決於所選的資源包. + +of.options.ALTERNATE_BLOCKS=方塊替換 +of.options.ALTERNATE_BLOCKS.tooltip.1=方塊替換 +of.options.ALTERNATE_BLOCKS.tooltip.2=為一些方塊使用備用的方塊模型。 +of.options.ALTERNATE_BLOCKS.tooltip.3=取決於選用的資源包。 + +of.options.FOG_FANCY=迷霧 +of.options.FOG_FANCY.tooltip.1=迷霧類型 +of.options.FOG_FANCY.tooltip.2= 性能優先 - 較流暢的迷霧 +of.options.FOG_FANCY.tooltip.3= 畫質優先 - 較慢的迷霧,視覺效果較佳 +of.options.FOG_FANCY.tooltip.4= 關閉 - 無迷霧,最快 +of.options.FOG_FANCY.tooltip.5=畫質優先的迷霧僅當 +of.options.FOG_FANCY.tooltip.6=顯卡支援時可用。 + +of.options.FOG_START=迷霧起始位置 +of.options.FOG_START.tooltip.1=迷霧起始位置 +of.options.FOG_START.tooltip.2= 0.2 - 迷霧起始於玩家周圍 +of.options.FOG_START.tooltip.3= 0.8 - 迷霧在離玩家較遠的地方出現 +of.options.FOG_START.tooltip.4=此選項通常不會影響性能。 + +of.options.CHUNK_LOADING=區塊載入 +of.options.CHUNK_LOADING.tooltip.1=區塊載入 +of.options.CHUNK_LOADING.tooltip.2= 預設 - 當載入區塊時FPS不穩定 +of.options.CHUNK_LOADING.tooltip.3= 柔和化 - 穩定FPS +of.options.CHUNK_LOADING.tooltip.4= 多核心 - 穩定FPS,3倍的世界載入速度 +of.options.CHUNK_LOADING.tooltip.5=柔和化和多核心可消除由區塊 +of.options.CHUNK_LOADING.tooltip.6=載入引起的延遲和卡頓。 +of.options.CHUNK_LOADING.tooltip.7=多核心可以令世界載入速度提升3倍 +of.options.CHUNK_LOADING.tooltip.8=並通過使用多個CPU核心來提升FPS。 +of.options.chunkLoading.smooth=柔和化 +of.options.chunkLoading.multiCore=多核心 + +of.options.shaders=光影… +of.options.shadersTitle=光影 + +of.options.shaders.packNone=關閉 +of.options.shaders.packDefault=(內建) + + +of.options.shaders.ANTIALIASING=抗鋸齒 +of.options.shaders.NORMAL_MAP=法線貼圖 +of.options.shaders.SPECULAR_MAP=高光貼圖 +of.options.shaders.RENDER_RES_MUL=渲染精細度 +of.options.shaders.SHADOW_RES_MUL=陰影精細度 +of.options.shaders.HAND_DEPTH_MUL=手部景深 +of.options.shaders.CLOUD_SHADOW=雲的陰影 +of.options.shaders.OLD_HAND_LIGHT=經典手持光源 +of.options.shaders.OLD_LIGHTING=經典光照 +of.options.shaders.SHADER_PACK=光影包文件夾 + +of.options.shaders.shadersFolder=光影資料夾 +of.options.shaders.shaderOptions=光影設定… + +of.options.shaderOptionsTitle=光影設定 + +of.options.quality=品質… +of.options.qualityTitle=品質設置 + +of.options.details=細節… +of.options.detailsTitle=細節設置 + +of.options.performance=性能… +of.options.performanceTitle=性能設置 + +of.options.animations=動畫… +of.options.animationsTitle=動畫設置 + +of.options.other=其他… +of.options.otherTitle=其他設置 + +of.options.other.reset=重設視頻設定… + +of.shaders.profile=配置文件 + +# Quality + +of.options.mipmap.bilinear=雙線性 +of.options.mipmap.linear=線性 +of.options.mipmap.nearest=最近 +of.options.mipmap.trilinear=三線性 + +options.mipmapLevels.tooltip.1=使用多精度材質,使遠處的 +options.mipmapLevels.tooltip.2=物體看起來更好的視覺效果。 +options.mipmapLevels.tooltip.3= 關閉 - 無柔和化 +options.mipmapLevels.tooltip.4= 1 - 最小柔和化 +options.mipmapLevels.tooltip.5= 4 - 最大柔和化 +options.mipmapLevels.tooltip.6=此選項通常不影響性能。 + +of.options.MIPMAP_TYPE=多精度材質類型 +of.options.MIPMAP_TYPE.tooltip.1=使用多精度材質,使遠處的 +of.options.MIPMAP_TYPE.tooltip.2=物體看起來更好的視覺效果。 +of.options.MIPMAP_TYPE.tooltip.3= 最近 - 粗糙柔和化(最快) +of.options.MIPMAP_TYPE.tooltip.4= 線性 - 正常柔和化 +of.options.MIPMAP_TYPE.tooltip.5= 雙線性 - 精細 +of.options.MIPMAP_TYPE.tooltip.6= 三線性 - 最佳柔和化(最慢) + + +of.options.AA_LEVEL=抗鋸齒 +of.options.AA_LEVEL.tooltip.1=抗鋸齒 +of.options.AA_LEVEL.tooltip.2= 關閉 - (預設)無抗鋸齒(較快) +of.options.AA_LEVEL.tooltip.3= 2-16 - 對線和邊緣使用抗鋸齒(較慢) +of.options.AA_LEVEL.tooltip.4=反鋸齒將平滑鋸齒線 +of.options.AA_LEVEL.tooltip.5=和銳利的色彩過渡。 +of.options.AA_LEVEL.tooltip.6=啟用它可能會大幅降低FPS。 +of.options.AA_LEVEL.tooltip.7=並非所有等級都顯卡都支援。 +of.options.AA_LEVEL.tooltip.8=重啟後生效! + +of.options.AF_LEVEL=各向異性過濾 +of.options.AF_LEVEL.tooltip.1=各向異性過濾 +of.options.AF_LEVEL.tooltip.2= 關閉 - (預設)標準材質細節(較快) +of.options.AF_LEVEL.tooltip.3= 2-16 - 為多級材質過濾後的材質提供精細細節(較慢) +of.options.AF_LEVEL.tooltip.4=各向異性過濾還原了經多次 +of.options.AF_LEVEL.tooltip.5=材質過濾後的材質細節。 +of.options.AF_LEVEL.tooltip.6=啟用它可能會大幅降低FPS。 + +of.options.CLEAR_WATER=清澈水體 +of.options.CLEAR_WATER.tooltip.1=清澈水體 +of.options.CLEAR_WATER.tooltip.2= 開啟 - 清澈,透明水體 +of.options.CLEAR_WATER.tooltip.3= 關閉 - 預設水體 + +of.options.RANDOM_MOBS=隨機生物 +of.options.RANDOM_MOBS.tooltip.1=隨機生物 +of.options.RANDOM_MOBS.tooltip.2= 關閉 - 關閉隨機生物,較快 +of.options.RANDOM_MOBS.tooltip.3= 開啟 - 隨機生物,較慢 +of.options.RANDOM_MOBS.tooltip.4=遊戲中的生物、怪物材質使用隨機的貼圖。 +of.options.RANDOM_MOBS.tooltip.5=需要資源包內有多個生物、怪物貼圖。 + +of.options.BETTER_GRASS=更好的草地 +of.options.BETTER_GRASS.tooltip.1=更好的草地 +of.options.BETTER_GRASS.tooltip.2= 關閉 - 預設草地材質,較快 +of.options.BETTER_GRASS.tooltip.3= 性能優先 - 草方塊側面全部使用草地材質,較慢 +of.options.BETTER_GRASS.tooltip.4= 畫質優先 - 草方塊側面材質動態化,最慢 + +of.options.BETTER_SNOW=更好的雪地 +of.options.BETTER_SNOW.tooltip.1=更好的雪地 +of.options.BETTER_SNOW.tooltip.2= 關閉 - 預設的雪地,較快 +of.options.BETTER_SNOW.tooltip.3= 開啟 - 更好的雪地,較慢 +of.options.BETTER_SNOW.tooltip.4=在"透明方塊"(如柵欄,高草)與雪 +of.options.BETTER_SNOW.tooltip.5=接壤時在其下顯示雪。 + +of.options.CUSTOM_FONTS=自定義字體 +of.options.CUSTOM_FONTS.tooltip.1=自定義字體 +of.options.CUSTOM_FONTS.tooltip.2= 開啟 - 使用自定義字體(預設),較慢 +of.options.CUSTOM_FONTS.tooltip.3= 關閉 - 使用預設字體,較快 +of.options.CUSTOM_FONTS.tooltip.4=自定義字體一般由 +of.options.CUSTOM_FONTS.tooltip.5=當前的資源包提供。 + +of.options.CUSTOM_COLORS=自定義色彩 +of.options.CUSTOM_COLORS.tooltip.1=自定義色彩 +of.options.CUSTOM_COLORS.tooltip.2= 開啟 - 使用自定義色彩(預設),較慢 +of.options.CUSTOM_COLORS.tooltip.3= 關閉 - 使用預設色彩,較快 +of.options.CUSTOM_COLORS.tooltip.4=自定義色彩一般由 +of.options.CUSTOM_COLORS.tooltip.5=當前的資源包提供。 + +of.options.SWAMP_COLORS=沼澤顏色 +of.options.SWAMP_COLORS.tooltip.1=沼澤顏色 +of.options.SWAMP_COLORS.tooltip.2= 開啟 - 使用沼澤顏色(預設),較慢 +of.options.SWAMP_COLORS.tooltip.3= 關閉 - 不使用沼澤顏色,較快 +of.options.SWAMP_COLORS.tooltip.4=沼澤的顏色會影響草、樹葉、籐蔓和水。 + +of.options.SMOOTH_BIOMES=柔和化生物群落 +of.options.SMOOTH_BIOMES.tooltip.1=柔和化生物群落 +of.options.SMOOTH_BIOMES.tooltip.2= 開啟 - 柔和化生物群落的邊界(預設),較慢 +of.options.SMOOTH_BIOMES.tooltip.3= 關閉 - 不柔和化生物群落的邊界,較快 +of.options.SMOOTH_BIOMES.tooltip.4=柔和化生物群落的邊界平滑取樣於 +of.options.SMOOTH_BIOMES.tooltip.5=附近所有方塊顏色的平均值。 +of.options.SMOOTH_BIOMES.tooltip.6=草、樹葉、籐蔓和水將會受到影響。 + +of.options.CONNECTED_TEXTURES=連接材質 +of.options.CONNECTED_TEXTURES.tooltip.1=連接材質 +of.options.CONNECTED_TEXTURES.tooltip.2= 關閉 - 關閉連續材質(預設) +of.options.CONNECTED_TEXTURES.tooltip.3= 性能優先 - 快速處理連續材質 +of.options.CONNECTED_TEXTURES.tooltip.4= 畫質優先 - 精細處理連續材質 +of.options.CONNECTED_TEXTURES.tooltip.5=連接材質為玻璃、沙石和書架增加了連續材質, +of.options.CONNECTED_TEXTURES.tooltip.6=當它們互相放在一起時會將材質連接為一體。 +of.options.CONNECTED_TEXTURES.tooltip.7=連續材質一般由 +of.options.CONNECTED_TEXTURES.tooltip.8=當前的資源包提供。 + +of.options.NATURAL_TEXTURES=自然材質 +of.options.NATURAL_TEXTURES.tooltip.1=自然材質 +of.options.NATURAL_TEXTURES.tooltip.2= 關閉 - 關閉自然材質(預設) +of.options.NATURAL_TEXTURES.tooltip.3= 開啟 - 使用自然材質 +of.options.NATURAL_TEXTURES.tooltip.4=自然材質移除由同一類型的 +of.options.NATURAL_TEXTURES.tooltip.5=方塊重複產生的柵格狀圖案。 +of.options.NATURAL_TEXTURES.tooltip.6=它通過旋轉和翻轉方塊的基礎材質 +of.options.NATURAL_TEXTURES.tooltip.7=來產生材質變體。自然材質的配置和 +of.options.NATURAL_TEXTURES.tooltip.8=材質一般由當前的資源包提供。 + +of.options.EMISSIVE_TEXTURES=光亮材質 +of.options.EMISSIVE_TEXTURES.tooltip.1=光亮材質 +of.options.EMISSIVE_TEXTURES.tooltip.2= 關閉 - 關閉光亮材質(預設) +of.options.EMISSIVE_TEXTURES.tooltip.3= 開啟 - 使用光亮材質 +of.options.EMISSIVE_TEXTURES.tooltip.4=光亮材質被渲染為全亮度 +of.options.EMISSIVE_TEXTURES.tooltip.5=的覆蓋層。它們可以用來 +of.options.EMISSIVE_TEXTURES.tooltip.6=模擬基本材質的發光部分。 +of.options.EMISSIVE_TEXTURES.tooltip.7=光亮材質一般由 +of.options.EMISSIVE_TEXTURES.tooltip.8=當前的資源包提供。 + +of.options.CUSTOM_SKY=自定義天空 +of.options.CUSTOM_SKY.tooltip.1=自定義天空 +of.options.CUSTOM_SKY.tooltip.2= 開啟 - 自定義天空材質(預設),較慢 +of.options.CUSTOM_SKY.tooltip.3= 關閉 - 原版天空材質,較快 +of.options.CUSTOM_SKY.tooltip.4=自定義天空材質一般由 +of.options.CUSTOM_SKY.tooltip.5=當前的資源包提供。 + +of.options.CUSTOM_ITEMS=自定義物品 +of.options.CUSTOM_ITEMS.tooltip.1=自定義物品 +of.options.CUSTOM_ITEMS.tooltip.2= 開啟 - 自定義物品材質(預設),較慢 +of.options.CUSTOM_ITEMS.tooltip.3= 關閉 - 原版物品材質,較快 +of.options.CUSTOM_ITEMS.tooltip.4=自定義物品材質一般由 +of.options.CUSTOM_ITEMS.tooltip.5=當前的資源包提供。 + +of.options.CUSTOM_ENTITY_MODELS=自定義實體模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.1=自定義實體模型 +of.options.CUSTOM_ENTITY_MODELS.tooltip.2= 開啟 - 自定義實體模型(預設),較慢 +of.options.CUSTOM_ENTITY_MODELS.tooltip.3= 關閉 - 原版實體模型,較快 +of.options.CUSTOM_ENTITY_MODELS.tooltip.4=自定義實體模型材質一般由 +of.options.CUSTOM_ENTITY_MODELS.tooltip.5=當前的資源包提供。 + +of.options.CUSTOM_GUIS=自定義GUI +of.options.CUSTOM_GUIS.tooltip.1=自定義GUI +of.options.CUSTOM_GUIS.tooltip.2= 開啟 - 自定義GUI(預設),較慢 +of.options.CUSTOM_GUIS.tooltip.3= 關閉 - 原版GUI,較快 +of.options.CUSTOM_GUIS.tooltip.4=自定義GUI一般由當前的資源包提供。 + +# Details + +of.options.CLOUDS=雲塊 +of.options.CLOUDS.tooltip.1=雲塊 +of.options.CLOUDS.tooltip.2= 預設 - 以圖像畫質的設定為準 +of.options.CLOUDS.tooltip.3= 性能優先 - 低品質,較快 +of.options.CLOUDS.tooltip.4= 畫質優先 - 高品質,較慢 +of.options.CLOUDS.tooltip.5= 關閉 - 沒有雲,最快 +of.options.CLOUDS.tooltip.6=性能優先的雲塊使用2D渲染。 +of.options.CLOUDS.tooltip.7=畫質優先的雲塊使用3D渲染。 + +of.options.CLOUD_HEIGHT=雲層高度 +of.options.CLOUD_HEIGHT.tooltip.1=雲層高度 +of.options.CLOUD_HEIGHT.tooltip.2= 關閉 - 預設高度 +of.options.CLOUD_HEIGHT.tooltip.3= 100%% - 超過世界限制高度 + +of.options.TREES=樹 +of.options.TREES.tooltip.1=樹 +of.options.TREES.tooltip.2= 預設 - 以圖像畫質設定為標準 +of.options.TREES.tooltip.3= 性能優先 - 低品質,最快 +of.options.TREES.tooltip.4= 智慧 - 較高品質,較快 +of.options.TREES.tooltip.4= 畫質優先 - 高品質,較慢 +of.options.TREES.tooltip.5=性能優先的樹葉不透明。 +of.options.TREES.tooltip.6=畫質優先的樹葉透明。 + +of.options.RAIN=雨 & 雪 +of.options.RAIN.tooltip.1=雨 & 雪 +of.options.RAIN.tooltip.2= 預設 - 以圖像畫質的設定為準 +of.options.RAIN.tooltip.3= 性能優先 - 少量的雨/雪,較快 +of.options.RAIN.tooltip.4= 畫質優先 - 大量的雨/雪,較慢 +of.options.RAIN.tooltip.5= 關閉 - 沒有雨/雪,最快 +of.options.RAIN.tooltip.6=當雨雪選項為 關閉 時, +of.options.RAIN.tooltip.7=雨聲仍然存在。 + +of.options.SKY=天空 +of.options.SKY.tooltip.1=天空 +of.options.SKY.tooltip.2= 開啟 - 天空可見,較慢 +of.options.SKY.tooltip.3= 關閉 - 天空不可見,較快 +of.options.SKY.tooltip.4=當天空關閉時,月亮和太陽依然可見。 + +of.options.STARS=星星 +of.options.STARS.tooltip.1=星星 +of.options.STARS.tooltip.2= 開啟 - 星星可見,較慢 +of.options.STARS.tooltip.3= 關閉 - 星星不可見,較快 + +of.options.SUN_MOON=太陽 & 月亮 +of.options.SUN_MOON.tooltip.1=太陽 & 月亮 +of.options.SUN_MOON.tooltip.2= 開啟 - 太陽和月亮可見(預設) +of.options.SUN_MOON.tooltip.3= 關閉 - 太陽和月亮不可見(較快) + +of.options.SHOW_CAPES=顯示披風 +of.options.SHOW_CAPES.tooltip.1=顯示披風 +of.options.SHOW_CAPES.tooltip.2= 開啟 - 顯示玩家披風(預設) +of.options.SHOW_CAPES.tooltip.3= 關閉 - 不顯示玩家披風 + +of.options.TRANSLUCENT_BLOCKS=半透明方塊 +of.options.TRANSLUCENT_BLOCKS.tooltip.1=半透明方塊 +of.options.TRANSLUCENT_BLOCKS.tooltip.2= 畫質優先 - 準確的混合顏色(預設) +of.options.TRANSLUCENT_BLOCKS.tooltip.3= 性能優先 - 快速的混合顏色(較快) +of.options.TRANSLUCENT_BLOCKS.tooltip.4=控制有色的半透明方塊 +of.options.TRANSLUCENT_BLOCKS.tooltip.5=(彩色玻璃、水、冰)放在一起 +of.options.TRANSLUCENT_BLOCKS.tooltip.6=時或與空氣相隔時的顏色混和。 + +of.options.HELD_ITEM_TOOLTIPS=持有物信息顯示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.1=持有物信息顯示 +of.options.HELD_ITEM_TOOLTIPS.tooltip.2= 開啟 - 顯示持有物信息(預設) +of.options.HELD_ITEM_TOOLTIPS.tooltip.3= 關閉 - 隱藏持有物信息 + +of.options.ADVANCED_TOOLTIPS=高級資訊提示 +of.options.ADVANCED_TOOLTIPS.tooltip.1=高級資訊提示 +of.options.ADVANCED_TOOLTIPS.tooltip.2= 開啟 - 顯示高級資訊提示 +of.options.ADVANCED_TOOLTIPS.tooltip.3= 關閉 - 隱藏高級資訊提示(預設) +of.options.ADVANCED_TOOLTIPS.tooltip.4=高級資訊提示顯示物品 +of.options.ADVANCED_TOOLTIPS.tooltip.5=(ID、耐久度)和光影設定資料 +of.options.ADVANCED_TOOLTIPS.tooltip.6=(id,source,default value)。 + +of.options.DROPPED_ITEMS=掉落物品 +of.options.DROPPED_ITEMS.tooltip.1=掉落物品 +of.options.DROPPED_ITEMS.tooltip.2= 預設 - 以圖像畫質的設定為準 +of.options.DROPPED_ITEMS.tooltip.3= 性能優先 - 2D掉落物品,較快 +of.options.DROPPED_ITEMS.tooltip.4= 畫質優先 - 3D掉落物品,較慢 + +options.entityShadows.tooltip.1=實體陰影 +options.entityShadows.tooltip.2= 開啟 - 顯示實體陰影 +options.entityShadows.tooltip.3= 關閉 - 隱藏實體陰影 + +of.options.VIGNETTE=暈影 +of.options.VIGNETTE.tooltip.1=螢幕四角輕微變暗的視覺效果 +of.options.VIGNETTE.tooltip.2= 預設 - 以圖像畫質的設定為準(預設) +of.options.VIGNETTE.tooltip.3= 性能優先 - 暈影關閉(較快) +of.options.VIGNETTE.tooltip.4= 畫質優先 - 暈影開啟(較慢) +of.options.VIGNETTE.tooltip.5=暈影可能對FPS有明顯影響, +of.options.VIGNETTE.tooltip.6=尤其是全螢幕遊戲時 +of.options.VIGNETTE.tooltip.7=暈影的效果非常細微 +of.options.VIGNETTE.tooltip.8=且可以被安全地關閉。 + +of.options.DYNAMIC_FOV=動態視場 +of.options.DYNAMIC_FOV.tooltip.1=動態視場 +of.options.DYNAMIC_FOV.tooltip.2= 開啟 - 啟用動態視場(預設) +of.options.DYNAMIC_FOV.tooltip.3= 關閉 - 禁用動態視場 +of.options.DYNAMIC_FOV.tooltip.4=當正在飛行、疾跑或 +of.options.DYNAMIC_FOV.tooltip.5=拉弓時改變視場。 + +of.options.DYNAMIC_LIGHTS=動態光源 +of.options.DYNAMIC_LIGHTS.tooltip.1=動態光源 +of.options.DYNAMIC_LIGHTS.tooltip.2= 關閉 - 無動態光源(預設) +of.options.DYNAMIC_LIGHTS.tooltip.3= 性能優先 - 較流暢的動態光源(每500ms更新一次) +of.options.DYNAMIC_LIGHTS.tooltip.4= 畫質優先 - 高品質的動態光源(即時更新) +of.options.DYNAMIC_LIGHTS.tooltip.5=允許發光的物品(火把、螢石等) +of.options.DYNAMIC_LIGHTS.tooltip.6=當被玩家左右手持握、裝備或 +of.options.DYNAMIC_LIGHTS.tooltip.7=成爲掉落物時照亮周圍的一切。 + +# Performance + +of.options.SMOOTH_FPS=柔和化FPS +of.options.SMOOTH_FPS.tooltip.1=通過清除顯示卡緩衝區來穩定FPS +of.options.SMOOTH_FPS.tooltip.2= 關閉 - 不穩定,FPS可能波動 +of.options.SMOOTH_FPS.tooltip.3= 開啟 - FPS穩定 +of.options.SMOOTH_FPS.tooltip.4=此選項依賴於顯卡驅動 +of.options.SMOOTH_FPS.tooltip.5=不一定有明顯效果。 + +of.options.SMOOTH_WORLD=柔和化世界 +of.options.SMOOTH_WORLD.tooltip.1=移除內部伺服器造成的數據延遲。 +of.options.SMOOTH_WORLD.tooltip.2= 關閉 - 不穩定,FPS可能波動 +of.options.SMOOTH_WORLD.tooltip.3= 開啟 - FPS穩定 +of.options.SMOOTH_WORLD.tooltip.4=分擔內部伺服器負載來穩定FPS。 +of.options.SMOOTH_WORLD.tooltip.5=只在本地世界(單人遊戲)有效。 + +of.options.FAST_RENDER=快速渲染 +of.options.FAST_RENDER.tooltip.1=快速渲染 +of.options.FAST_RENDER.tooltip.2= 關閉 - 標準渲染(預設) +of.options.FAST_RENDER.tooltip.3= 開啟 - 優化渲染(較快) +of.options.FAST_RENDER.tooltip.4=採用優化渲染算法從而降低GPU的負載 +of.options.FAST_RENDER.tooltip.5=並且可能大幅提升FPS。 + +of.options.FAST_MATH=快速運算 +of.options.FAST_MATH.tooltip.1=快速運算 +of.options.FAST_MATH.tooltip.2= 關閉 - 標準的運算(預設) +of.options.FAST_MATH.tooltip.3= 開啟 - 更快的運算 +of.options.FAST_MATH.tooltip.4=採用優化的sin()和cos()函數可以 +of.options.FAST_MATH.tooltip.5=更好的利用CPU緩存並且提升FPS。 + +of.options.CHUNK_UPDATES=區塊更新 +of.options.CHUNK_UPDATES.tooltip.1=區塊更新 +of.options.CHUNK_UPDATES.tooltip.2= 1 - 世界載入速度較慢,FPS較高 (預設) +of.options.CHUNK_UPDATES.tooltip.3= 3 - 世界載入速度較快,FPS較低 +of.options.CHUNK_UPDATES.tooltip.4= 5 - 世界載入速度最快,FPS最低 +of.options.CHUNK_UPDATES.tooltip.5=渲染每幀時更新的區塊數, +of.options.CHUNK_UPDATES.tooltip.6=愈高的值將會導致FPS不穩定。 + +of.options.CHUNK_UPDATES_DYNAMIC=動態更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.1=動態更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.2= 關閉 - (預設)每幀標準區塊更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.3= 開啟 - 當玩家站立不動時更多的區塊更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.4=當玩家站定時會更新 +of.options.CHUNK_UPDATES_DYNAMIC.tooltip.5=更多區塊以加速世界載入。 + +of.options.LAZY_CHUNK_LOADING=平緩區塊更新 +of.options.LAZY_CHUNK_LOADING.tooltip.1=平緩區塊更新 +of.options.LAZY_CHUNK_LOADING.tooltip.2= 關閉 - 預設的伺服器區塊載入 +of.options.LAZY_CHUNK_LOADING.tooltip.3= 開啟 - 平緩伺服器區塊載入(更柔和) +of.options.LAZY_CHUNK_LOADING.tooltip.4=藉由將區塊分佈在多個ticks中讀取 +of.options.LAZY_CHUNK_LOADING.tooltip.5=來柔和化伺服器整體區塊載入。 +of.options.LAZY_CHUNK_LOADING.tooltip.6=如果世界無法正確的載入,請把它關閉。 +of.options.LAZY_CHUNK_LOADING.tooltip.7=僅適用於單玩家的本地世界。 + +# Animations + +of.options.animation.allOn=全部開啟 +of.options.animation.allOff=全部關閉 +of.options.animation.dynamic=動態 + +of.options.ANIMATED_WATER=水面動畫 +of.options.ANIMATED_LAVA=岩漿動畫 +of.options.ANIMATED_FIRE=火焰動畫 +of.options.ANIMATED_PORTAL=傳送門動畫 +of.options.ANIMATED_REDSTONE=紅石動畫 +of.options.ANIMATED_EXPLOSION=爆炸動畫 +of.options.ANIMATED_FLAME=燃燒動畫 +of.options.ANIMATED_SMOKE=煙霧動畫 +of.options.VOID_PARTICLES=虛空粒子 +of.options.WATER_PARTICLES=水濺粒子 +of.options.RAIN_SPLASH=雨滴飛濺 +of.options.PORTAL_PARTICLES=傳送門粒子 +of.options.POTION_PARTICLES=藥水粒子 +of.options.DRIPPING_WATER_LAVA=流動水/岩漿 +of.options.ANIMATED_TERRAIN=地形動畫 +of.options.ANIMATED_TEXTURES=材質動畫 +of.options.FIREWORK_PARTICLES=煙火粒子 + +# Other + +of.options.LAGOMETER=Lagometer +of.options.LAGOMETER.tooltip.1=Shows the lagometer on the debug screen (F3). +of.options.LAGOMETER.tooltip.2=* 橙 - Memory garbage collection +of.options.LAGOMETER.tooltip.3=* 青 - Tick +of.options.LAGOMETER.tooltip.4=* 藍 - Scheduled executables +of.options.LAGOMETER.tooltip.5=* 紫 - Chunk upload +of.options.LAGOMETER.tooltip.6=* 紅 - Chunk updates +of.options.LAGOMETER.tooltip.7=* 黃 - Visibility check +of.options.LAGOMETER.tooltip.8=* 綠 - Render terrain + +of.options.PROFILER=偵錯分析器 +of.options.PROFILER.tooltip.1=偵錯分析器 +of.options.PROFILER.tooltip.2= 開啟 - 偵錯分析器啟用,較慢 +of.options.PROFILER.tooltip.3= 關閉 - 偵錯分析器禁用,較快 +of.options.PROFILER.tooltip.4=偵錯分析器在偵錯界面開啟(F3)時 +of.options.PROFILER.tooltip.5=收集並且顯示偵錯信息。 + +of.options.WEATHER=天氣 +of.options.WEATHER.tooltip.1=天氣 +of.options.WEATHER.tooltip.2= 開啟 - 開啟天氣,較慢 +of.options.WEATHER.tooltip.3= 關閉 - 關閉天氣,較快 +of.options.WEATHER.tooltip.4=天氣選項影響雨,雪和雷電。 +of.options.WEATHER.tooltip.5=天氣選項僅在本地遊戲中生效。 + +of.options.time.dayOnly=只有白天 +of.options.time.nightOnly=只有夜晚 + +of.options.TIME=時間 +of.options.TIME.tooltip.1=時間 +of.options.TIME.tooltip.2= 預設 - 正常的日夜交替 +of.options.TIME.tooltip.3= 只有白天 - 只有白天 +of.options.TIME.tooltip.4= 只有夜晚 - 只有夜晚 +of.options.TIME.tooltip.5=時間設置只在創造模式下 +of.options.TIME.tooltip.6=且為本地遊戲時有效。 + +options.fullscreen.tooltip.1=全螢幕 +options.fullscreen.tooltip.2= 開啟 - 使用全螢幕模式 +options.fullscreen.tooltip.3= 關閉 - 使用視窗模式 +options.fullscreen.tooltip.4=全螢幕模式可能比視窗模式 +options.fullscreen.tooltip.5=更快或更慢,取決於顯卡。 + +of.options.FULLSCREEN_MODE=全螢幕模式 +of.options.FULLSCREEN_MODE.tooltip.1=全螢幕模式 +of.options.FULLSCREEN_MODE.tooltip.2= 預設 - 使用桌面解析度,較慢 +of.options.FULLSCREEN_MODE.tooltip.3= 自定義 - 使用自定義螢幕解析度,可能會較快 +of.options.FULLSCREEN_MODE.tooltip.4=此選項只在全螢幕模式下有效(F11)。 +of.options.FULLSCREEN_MODE.tooltip.5=較低的解析度通常會較快。 + +of.options.SHOW_FPS=顯示FPS +of.options.SHOW_FPS.tooltip.1=顯示精簡的FPS和渲染信息 +of.options.SHOW_FPS.tooltip.2= C: - 區塊渲染器 +of.options.SHOW_FPS.tooltip.3= E: - 一般實體 + 方塊實體 +of.options.SHOW_FPS.tooltip.4= U: - 區塊更新 +of.options.SHOW_FPS.tooltip.5=只有偵錯畫面隱藏時 +of.options.SHOW_FPS.tooltip.6=才會顯示精簡FPS信息。 + +of.options.save.default=預設(2秒) +of.options.save.20s=20秒 +of.options.save.3min=3分鐘 +of.options.save.30min=30分鐘 + +of.options.AUTOSAVE_TICKS=自動保存 +of.options.AUTOSAVE_TICKS.tooltip.1=自動保存間隔 +of.options.AUTOSAVE_TICKS.tooltip.2=不推薦使用預設自動保存間隔(2秒)。 +of.options.AUTOSAVE_TICKS.tooltip.3=自動保存會導致卡頓。 + +of.options.SCREENSHOT_SIZE=截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.1=截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.2= 預設 - 預設的截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.3= 2x-4x - 自定義截圖尺寸 +of.options.SCREENSHOT_SIZE.tooltip.4=抓取更大的截圖可能需要更多的記憶體。 +of.options.SCREENSHOT_SIZE.tooltip.5=與快速渲染及抗鋸齒不相容。 +of.options.SCREENSHOT_SIZE.tooltip.6=需要顯卡幀緩衝區支持。 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/template.natural.properties b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/template.natural.properties new file mode 100644 index 0000000..517ad46 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/optifine/template.natural.properties @@ -0,0 +1,96 @@ +# Template configuration for OptiFine's Natural Textures +# +# Rename this file to "natural.properties" to activate the configuration. +# +# Configuration format +# := +# +# Values +# 4 = Rotate x 90 (4 variations) +# 2 = Rotate x 180 (2 variations) +# F = Flip texture horizontally (2 variations) +# 4F = 4 + Flip (8 variations) +# 2F = 2 + Flip (4 variations) +# +# Example for grass texture which can rotate with 4 variations and flip +# /terrain.png:0=4F +# + +# Grass +grass_top=4F +# Stone +stone=2F +# Dirt +dirt=4F +# Grass side +grass_side=F +grass_side_overlay=F +# Slab +stoneslab_top=F +# Bedrock +bedrock=2F +# Sand +sand=4F +# Gravel +gravel=2 +# Wood side +tree_side=2F +# Wood top +tree_top=4F +# Ores (gold, iron, coal, diamond, redstone, lapis) +oreGold=2F +oreIron=2F +oreCoal=2F +oreDiamond=2F +oreRedstone=2F +oreLapis=2F +# Obsidian +obsidian=4F +# Leaves +leaves=2F +leaves_opaque=2F +# Jungle leaves +leaves_jungle=2 +leaves_jungle_opaque=2 +# Snow +snow=4F +# Snow grass side +snow_side=F +# Cactus side +cactus_side=2F +# Clay +clay=4F +# Mycelium side +mycel_side=F +# Mycelium top +mycel_top=4F +# Farmland hydrated +farmland_wet=2F +# Farmland +farmland_dry=2F +# Netherrack +hellrock=4F +# Soul sand +hellsand=4F +# Glowstone +lightgem=4 +# Pine side +tree_spruce=2F +# Birch side +tree_birch=F +# Pine leaves +leaves_spruce=2F +leaves_spruce_opaque=2F +# Jungle tree side +tree_jungle=2F +# Endstone +whiteStone=4 +# Sandstone top +sandstone_top=4 +# Sandstone bottom +sandstone_bottom=4F +# Redstone lamp +redstoneLight=4F +redstoneLight_lit=4F + + diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/black.png new file mode 100644 index 0000000..5b5b00f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/blue.png new file mode 100644 index 0000000..f802763 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/dark_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/dark_blue.png new file mode 100644 index 0000000..9df6d32 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/dark_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/green.png new file mode 100644 index 0000000..5347e70 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/purple.png new file mode 100644 index 0000000..53730f4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/red.png new file mode 100644 index 0000000..05e5c83 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/turquoise.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/turquoise.png new file mode 100644 index 0000000..a76406a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/turquoise.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/yellow.png new file mode 100644 index 0000000..042bbfa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/preview/client/wings/yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur.json new file mode 100644 index 0000000..fb572ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "animblur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur_full.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur_full.json new file mode 100644 index 0000000..d17c4bb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur_full.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "animblur_full", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur_full", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur_full", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + }, { + "name": "animblur_full", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 8.0 ] + } + ] + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur_horizontal.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur_horizontal.json new file mode 100644 index 0000000..97e1327 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/animblur_horizontal.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "animblur_horizontal", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, { + "name": "animblur_horizontal", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "animblur_horizontal", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "animblur_horizontal", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/antialias.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/antialias.json new file mode 100644 index 0000000..355680f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/antialias.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "antialias", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/art.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/art.json new file mode 100644 index 0000000..9f0eea4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/art.json @@ -0,0 +1,53 @@ +{ + "targets": [ + "0", + "1" + ], + "passes": [ { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "0" + }, { + "name": "outline_watercolor", + "intarget": "0", + "outtarget": "minecraft:main" + }, { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "1", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.8, 0.0 ] + }, { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, { + "name": "blur", + "intarget": "1", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 0.8 ] + }, { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, { + "name": "outline_combine", + "intarget": "0", + "outtarget": "1", + "auxtargets": [ { + "name": "OutlineSampler", + "id": "minecraft:main" + } + ] + }, { + "name": "blit", + "intarget": "1", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/bits.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/bits.json new file mode 100644 index 0000000..416b9a4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/bits.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "bits", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blobs.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blobs.json new file mode 100644 index 0000000..81841ec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blobs.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "blobs", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blobs2.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blobs2.json new file mode 100644 index 0000000..6a2b2d8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blobs2.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blur.json new file mode 100644 index 0000000..040b66e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/blur.json @@ -0,0 +1,31 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 20.0 ] + } + ] + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/bumpy.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/bumpy.json new file mode 100644 index 0000000..8fa587c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/bumpy.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "bumpy", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/color_convolve.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/color_convolve.json new file mode 100644 index 0000000..a4bdd77 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/color_convolve.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { "name": "Saturation", "values": [ 1.4 ] } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/deconverge.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/deconverge.json new file mode 100644 index 0000000..88c5e38 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/deconverge.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "deconverge", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/desaturate.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/desaturate.json new file mode 100644 index 0000000..6c79da2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/desaturate.json @@ -0,0 +1,20 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "Saturation", + "values": [ 0.2 ] + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json new file mode 100644 index 0000000..7851a67 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fade_in_blur.json @@ -0,0 +1,55 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "fade_in_blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, { + "name": "fade_in_blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "fade_in_blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + }, { + "name": "fade_in_blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 0.0 ] + } + ] + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/flip.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/flip.json new file mode 100644 index 0000000..5d3686c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/flip.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "flip", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa.json new file mode 100644 index 0000000..30655ec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "fxaa", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa_of_2x.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa_of_2x.json new file mode 100644 index 0000000..08754ff --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa_of_2x.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "fxaa_of_2x", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa_of_4x.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa_of_4x.json new file mode 100644 index 0000000..1935450 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/fxaa_of_4x.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "fxaa_of_4x", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/green.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/green.json new file mode 100644 index 0000000..7ecef9e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/green.json @@ -0,0 +1,34 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "RedMatrix", + "values": [ 0.0, 0.0, 0.0 ] + }, { + "name": "GreenMatrix", + "values": [ 0.3, 0.59, 0.11 ] + }, { + "name": "BlueMatrix", + "values": [ 0.0, 0.0, 0.0 ] + } + ] + }, { + "name": "bits", + "intarget": "swap", + "outtarget": "minecraft:main" + }, { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/invert.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/invert.json new file mode 100644 index 0000000..7f4ca03 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/invert.json @@ -0,0 +1,20 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "invert", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "InverseAmount", + "values": [ 0.8 ] + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/lunar_motionblur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/lunar_motionblur.json new file mode 100644 index 0000000..7bb33e7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/lunar_motionblur.json @@ -0,0 +1,30 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ { + "name": "lunar_motionblur", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ { + "name": "Phosphor", + "values": [ 0.95, 0.95, 0.95 ] + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/motionblur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/motionblur.json new file mode 100644 index 0000000..5df7dca --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/motionblur.json @@ -0,0 +1,30 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ { + "name": "phosphor", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ { + "name": "Phosphor", + "values": [ 0.9, 0.9, 0.9 ] + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/notch.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/notch.json new file mode 100644 index 0000000..4c8c647 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/notch.json @@ -0,0 +1,23 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "notch", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ { + "name": "DitherSampler", + "id": "dither", + "width": 4, + "height": 4, + "bilinear": false + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/ntsc.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/ntsc.json new file mode 100644 index 0000000..d0809a7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/ntsc.json @@ -0,0 +1,76 @@ +{ + "targets": [ + "swap", + "swap2", + "previous" + ], + "passes": [ { + "name": "ntsc_encode", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "ntsc_decode", + "intarget": "swap", + "outtarget": "swap2", + "auxtargets": [ { + "name": "BaseSampler", + "id": "minecraft:main" + } + ] + }, { + "name": "color_convolve", + "intarget": "swap2", + "outtarget": "swap" + }, { + "name": "deconverge", + "intarget": "swap", + "outtarget": "minecraft:main" + }, { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "phosphor", + "intarget": "swap", + "outtarget": "minecraft:main", + "auxtargets": [ { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ { + "name": "Phosphor", + "values": [ 0.4, 0.4, 0.4 ] + } + ] + }, { + "name": "blit", + "intarget": "minecraft:main", + "outtarget": "previous" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/outline.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/outline.json new file mode 100644 index 0000000..0f3f0c6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/outline.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "outline", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/pencil.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/pencil.json new file mode 100644 index 0000000..c613077 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/pencil.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "outline_soft", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/phosphor.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/phosphor.json new file mode 100644 index 0000000..88dbe84 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/phosphor.json @@ -0,0 +1,30 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ { + "name": "phosphor", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ { + "name": "Phosphor", + "values": [ 0.9, 0.9, 0.9 ] + } + ] + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/scan_pincushion.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/scan_pincushion.json new file mode 100644 index 0000000..22491ec --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/scan_pincushion.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/sobel.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/sobel.json new file mode 100644 index 0000000..47bef56 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/sobel.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "sobel", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/wobble.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/wobble.json new file mode 100644 index 0000000..842a2cb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/post/wobble.json @@ -0,0 +1,15 @@ +{ + "targets": [ + "swap" + ], + "passes": [ { + "name": "wobble", + "intarget": "minecraft:main", + "outtarget": "swap" + }, { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/animblur.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/animblur.fsh new file mode 100644 index 0000000..d81076c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/animblur.fsh @@ -0,0 +1,29 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec2 BlurDir; +uniform float Radius; +uniform float Progress; + +void main() { + vec4 blurred = vec4(0.0); + float totalStrength = 0.0; + float totalAlpha = 0.0; + float totalSamples = 0.0; + float progRadius = floor(Radius * Progress); + for(float r = -progRadius; r <= progRadius; r += 1.0) { + vec4 sample = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir); + totalAlpha = totalAlpha + sample.a; + totalSamples = totalSamples + 1.0; + float strength = 1.0 - abs(r / progRadius); + totalStrength = totalStrength + strength; + blurred = blurred + sample; + } + gl_FragColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), totalAlpha); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/animblur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/animblur.json new file mode 100644 index 0000000..cce7fed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/animblur.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "animblur", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] }, { "name": "Progress", "type": "float", "count": 1, "values": [ 0.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/antialias.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/antialias.fsh new file mode 100644 index 0000000..44b4141 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/antialias.fsh @@ -0,0 +1,29 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D (DiffuseSampler, texCoord); + vec4 u1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y )); + vec4 u2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y * 2.0)); + vec4 d1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y )); + vec4 d2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y * 2.0)); + vec4 l1 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x, 0.0)); + vec4 l2 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x * 2.0, 0.0)); + vec4 r1 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x, 0.0)); + vec4 r2 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x * 2.0, 0.0)); + + vec4 v1 = mix (c, mix (l1, l2, 0.667), 0.75); + vec4 v2 = mix (c, mix (r1, r2, 0.667), 0.75); + vec4 v3 = mix (c, mix (u1, u2, 0.667), 0.75); + vec4 v4 = mix (c, mix (d1, d2, 0.667), 0.75); + + vec4 v5 = mix (v1, v2, 0.5); + vec4 v6 = mix (v3, v4, 0.5); + + vec4 color = mix (v5, v6, 0.5); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/antialias.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/antialias.json new file mode 100644 index 0000000..4f13db2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/antialias.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "antialias", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bits.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bits.fsh new file mode 100644 index 0000000..96ef3cb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bits.fsh @@ -0,0 +1,26 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Resolution = 4.0; +uniform float Saturation = 1.5; +uniform float MosaicSize = 8.0; + +void main() { + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + + baseTexel = baseTexel - fract(baseTexel * Resolution) / Resolution; + float luma = dot(baseTexel.rgb, vec3(0.3, 0.59, 0.11)); + vec3 chroma = (baseTexel.rgb - luma) * Saturation; + baseTexel = vec4(luma + chroma, baseTexel.a); + + gl_FragColor = baseTexel; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bits.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bits.json new file mode 100644 index 0000000..68950a1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bits.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "bits", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Resolution", "type": "float", "count": 1, "values": [ 4.0 ] }, { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.5 ] }, { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 8.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.fsh new file mode 100644 index 0000000..a0d5e79 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.fsh @@ -0,0 +1,9 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; + +void main(){ + gl_FragColor = texture2D(DiffuseSampler, texCoord); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.json new file mode 100644 index 0000000..641a231 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.vsh new file mode 100644 index 0000000..01a16db --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blit.vsh @@ -0,0 +1,16 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.fsh new file mode 100644 index 0000000..82a1cc7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.fsh @@ -0,0 +1,43 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 v1 = min(l, r); + vec4 v2 = min(u, d); + vec4 v3 = min(v1, v2); + + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 dr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 dl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + + vec4 v4 = min(ul, dr); + vec4 v5 = min(ur, dl); + vec4 v6 = min(v4, v5); + + vec4 v7 = min(v3, v6); + + vec4 uu = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y * 2.0)); + vec4 dd = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y * 2.0)); + vec4 ll = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x * 2.0, 0.0)); + vec4 rr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x * 2.0, 0.0)); + + vec4 v8 = min(uu, dd); + vec4 v9 = min(ll, rr); + vec4 v10 = min(v8, v9); + + vec4 v11 = min(v7, v10); + + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 color = min(c, v11); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.json new file mode 100644 index 0000000..501edd5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs2.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs2.fsh new file mode 100644 index 0000000..1fb217d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs2.fsh @@ -0,0 +1,30 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float Radius; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 maxVal = c; + for(float u = 0.0; u <= Radius; u += 1.0) { + for(float v = 0.0; v <= Radius; v += 1.0) { + float weight = (((sqrt(u * u + v * v) / (Radius)) > 1.0) ? 0.0 : 1.0); + + vec4 s0 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, -v * oneTexel.y)); + vec4 s1 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, v * oneTexel.y)); + vec4 s2 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, v * oneTexel.y)); + vec4 s3 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, -v * oneTexel.y)); + + vec4 o0 = max(s0, s1); + vec4 o1 = max(s2, s3); + vec4 tempMax = max(o0, o1); + maxVal = mix(maxVal, max(maxVal, tempMax), weight); + } + } + + gl_FragColor = vec4(maxVal.rgb, c.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs2.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs2.json new file mode 100644 index 0000000..9ef7dc8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blobs2.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs2", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Radius", "type": "float", "count": 1, "values": [ 7.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bloom.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bloom.json new file mode 100644 index 0000000..c48593a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bloom.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "phosphor", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" }, { "name": "CycleSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blur.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blur.fsh new file mode 100644 index 0000000..1178391 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blur.fsh @@ -0,0 +1,23 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec2 BlurDir; +uniform float Radius; + +void main() { + vec4 blurred = vec4(0.0); + float totalStrength = 0.0; + for(float r = -Radius; r <= Radius; r += 1.0) { + float strength = abs(1.0 - r / Radius); + strength = strength * strength; + totalStrength = totalStrength + strength; + blurred = blurred + texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir) * strength; + } + gl_FragColor = vec4(blurred.rgb / totalStrength, texture2D(DiffuseSampler, texCoord).a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blur.json new file mode 100644 index 0000000..98d0bda --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/blur.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "blur", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.fsh new file mode 100644 index 0000000..56fd5a9 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.fsh @@ -0,0 +1,34 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 nc = normalize(c); + vec4 nu = normalize(u); + vec4 nd = normalize(d); + vec4 nl = normalize(l); + vec4 nr = normalize(r); + + float du = dot(nc, nu); + float dd = dot(nc, nd); + float dl = dot(nc, nl); + float dr = dot(nc, nr); + + float i = 64.0; + + float f = 1.0; + f += (du * i) - (dd * i); + f += (dr * i) - (dl * i); + + vec4 color = c * clamp(f, 0.5, 2); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.json new file mode 100644 index 0000000..c7ac06d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "bumpy", + "fragment": "bumpy", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/bumpy.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/color_convolve.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/color_convolve.fsh new file mode 100644 index 0000000..bfc3de5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/color_convolve.fsh @@ -0,0 +1,36 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Gray = vec3(0.3, 0.59, 0.11); +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); +uniform vec3 Offset = vec3(0.0, 0.0, 0.0); +uniform vec3 ColorScale = vec3(1.0, 1.0, 1.0); +uniform float Saturation = 1.8; + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + // Color Matrix + float RedValue = dot(InTexel.rgb, RedMatrix); + float GreenValue = dot(InTexel.rgb, GreenMatrix); + float BlueValue = dot(InTexel.rgb, BlueMatrix); + vec3 OutColor = vec3(RedValue, GreenValue, BlueValue); + + // Offset & Scale + OutColor = (OutColor * ColorScale) + Offset; + + // Saturation + float Luma = dot(OutColor, Gray); + vec3 Chroma = OutColor - Luma; + OutColor = (Chroma * Saturation) + Luma; + + gl_FragColor = vec4(OutColor, InTexel.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/color_convolve.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/color_convolve.json new file mode 100644 index 0000000..ad7deef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/color_convolve.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "color_convolve", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Gray", "type": "float", "count": 3, "values": [ 0.3, 0.59, 0.11 ] }, { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 0.0 ] }, { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] }, { "name": "Offset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] }, { "name": "ColorScale", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.8 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/deconverge.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/deconverge.fsh new file mode 100644 index 0000000..6b5a207 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/deconverge.fsh @@ -0,0 +1,28 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 ConvergeX = vec3(-1.0, 0.0, 0.5); +uniform vec3 ConvergeY = vec3( 0.0, -1.0, 0.5); +uniform vec3 RadialConvergeX = vec3(1.0, 1.0, 1.0); +uniform vec3 RadialConvergeY = vec3(1.0, 1.0, 1.0); + +void main() { + vec3 CoordX = texCoord.x * RadialConvergeX; + vec3 CoordY = texCoord.y * RadialConvergeY; + + CoordX += ConvergeX * oneTexel.x - (RadialConvergeX - 1.0) * 0.5; + CoordY += ConvergeY * oneTexel.y - (RadialConvergeY - 1.0) * 0.5; + + float RedValue = texture2D(DiffuseSampler, vec2(CoordX.x, CoordY.x)).r; + float GreenValue = texture2D(DiffuseSampler, vec2(CoordX.y, CoordY.y)).g; + float BlueValue = texture2D(DiffuseSampler, vec2(CoordX.z, CoordY.z)).b; + float AlphaValue = texture2D(DiffuseSampler, texCoord).a; + + gl_FragColor = vec4(RedValue, GreenValue, BlueValue, AlphaValue); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/deconverge.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/deconverge.json new file mode 100644 index 0000000..ce66ac3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/deconverge.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "deconverge", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "ConvergeX", "type": "float", "count": 3, "values": [ -4.0, 0.0, 2.0 ] }, { "name": "ConvergeY", "type": "float", "count": 3, "values": [ 0.0, -4.0, 2.0 ] }, { "name": "RadialConvergeX", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, { "name": "RadialConvergeY", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.fsh new file mode 100644 index 0000000..5502444 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.fsh @@ -0,0 +1,17 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +void main() { + vec3 Texel0 = texture2D(DiffuseSampler, texCoord).rgb; + vec3 Texel1 = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)).rgb; + vec3 Texel2 = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)).rgb; + vec3 Texel3 = texture2D(DiffuseSampler, texCoord + oneTexel).rgb; + + gl_FragColor = vec4((Texel0 + Texel1 + Texel2 + Texel3) * 0.25, Texel0.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.json new file mode 100644 index 0000000..2ca695f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "downscale", + "fragment": "downscale", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.vsh new file mode 100644 index 0000000..ec09759 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/downscale.vsh @@ -0,0 +1,19 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/flip.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/flip.json new file mode 100644 index 0000000..84f04c2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/flip.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "flip", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "ScreenSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/flip.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/flip.vsh new file mode 100644 index 0000000..bd0a4d3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/flip.vsh @@ -0,0 +1,22 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; +uniform vec2 ScreenSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 inOutRatio = OutSize / InSize; + vec2 inScreenRatio = ScreenSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * inOutRatio.x; + texCoord.y = texCoord.y * inOutRatio.y; + texCoord.y -= 1.0 - inScreenRatio.y; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.fsh new file mode 100644 index 0000000..a453da4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.fsh @@ -0,0 +1,83 @@ +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +uniform float VxOffset; +uniform float SpanMax; +uniform float ReduceMul; + +varying vec2 texCoord; +varying vec4 posPos; + +#define FxaaTex(t, p) texture2D(t, p) + +#if __VERSION__ >= 130 + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) textureOffset(t, p, o) +#elif defined(GL_EXT_gpu_shader4) + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) +#else + #define OffsetVec(a, b) vec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2D(t, p + o * r) +#endif + +vec3 FxaaPixelShader( + vec4 posPos, // Output of FxaaVertexShader interpolated across screen. + sampler2D tex, // Input texture. + vec2 rcpFrame) // Constant {1.0/frameWidth, 1.0/frameHeight}. { + + #define FXAA_REDUCE_MIN (1.0/128.0) + //#define FXAA_REDUCE_MUL (1.0/8.0) + //#define FXAA_SPAN_MAX 8.0 + + vec3 rgbNW = FxaaTex(tex, posPos.zw).xyz; + vec3 rgbNE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,0), rcpFrame.xy).xyz; + vec3 rgbSW = FxaaTexOff(tex, posPos.zw, OffsetVec(0,1), rcpFrame.xy).xyz; + vec3 rgbSE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,1), rcpFrame.xy).xyz; + + vec3 rgbM = FxaaTex(tex, posPos.xy).xyz; + + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max( + (lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * ReduceMul), + FXAA_REDUCE_MIN); + float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce); + dir = min(vec2( SpanMax, SpanMax), + max(vec2(-SpanMax, -SpanMax), + dir * rcpDirMin)) * rcpFrame.xy; + + vec3 rgbA = (1.0/2.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(1.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(2.0/3.0 - 0.5)).xyz); + vec3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(0.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(3.0/3.0 - 0.5)).xyz); + + float lumaB = dot(rgbB, luma); + + if ((lumaB < lumaMin) || (lumaB > lumaMax)) { + return rgbA; + } else { + return rgbB; + } +} + +void main() { + vec4 baseTexel = texture2D(DiffuseSampler, posPos.xy); + gl_FragColor = vec4(FxaaPixelShader(posPos, DiffuseSampler, 1.0 / OutSize), baseTexel.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.json new file mode 100644 index 0000000..5fa4ede --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa", + "fragment": "fxaa", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "SpanMax", "type": "float", "count": 1, "values": [ 8.0 ] }, { "name": "SubPixelShift", "type": "float", "count": 1, "values": [ 0.25 ] }, { "name": "ReduceMul", "type": "float", "count": 1, "values": [ 0.125 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.vsh new file mode 100644 index 0000000..9fe81ea --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa.vsh @@ -0,0 +1,21 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +uniform float SubPixelShift; + +varying vec2 texCoord; +varying vec4 posPos; + +void main() { + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; + posPos.xy = texCoord.xy; + posPos.zw = texCoord.xy - (1.0/OutSize * vec2(0.5 + SubPixelShift)); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.fsh new file mode 100644 index 0000000..bf66deb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.fsh @@ -0,0 +1,85 @@ +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +uniform float VxOffset; +uniform float SpanMax; +uniform float ReduceMul; + +varying vec2 texCoord; +varying vec4 posPos; + +#define FxaaTex(t, p) texture2D(t, p) + +#if __VERSION__ >= 130 + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) textureOffset(t, p, o) +#elif defined(GL_EXT_gpu_shader4) + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) +#else + #define OffsetVec(a, b) vec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2D(t, p + o * r) +#endif + +vec3 FxaaPixelShader( + vec4 posPos, // Output of FxaaVertexShader interpolated across screen. + sampler2D tex, // Input texture. + vec2 rcpFrame) // Constant {1.0/frameWidth, 1.0/frameHeight}. +{ + + #define FXAA_REDUCE_MIN (1.0/128.0) + //#define FXAA_REDUCE_MUL (1.0/8.0) + //#define FXAA_SPAN_MAX 8.0 + + vec3 rgbNW = FxaaTex(tex, posPos.zw).xyz; + vec3 rgbNE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,0), rcpFrame.xy).xyz; + vec3 rgbSW = FxaaTexOff(tex, posPos.zw, OffsetVec(0,1), rcpFrame.xy).xyz; + vec3 rgbSE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,1), rcpFrame.xy).xyz; + + vec3 rgbM = FxaaTex(tex, posPos.xy).xyz; + + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * ReduceMul), FXAA_REDUCE_MIN); + + float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce); + + dir = min(vec2( SpanMax, SpanMax), max(vec2(-SpanMax, -SpanMax), dir * rcpDirMin)) * rcpFrame.xy; + + vec3 rgbA = (1.0/2.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(1.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(2.0/3.0 - 0.5)).xyz); + + vec3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(0.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(3.0/3.0 - 0.5)).xyz); + + float lumaB = dot(rgbB, luma); + + if ((lumaB < lumaMin) || (lumaB > lumaMax)) + { + return rgbA; + } + // + return rgbB; +} + +void main() +{ + vec4 baseTexel = texture2D(DiffuseSampler, posPos.xy); + gl_FragColor = vec4(FxaaPixelShader(posPos, DiffuseSampler, 1.0 / OutSize), 1.0); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.json new file mode 100644 index 0000000..f4fa6fc --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa_of_2x", + "fragment": "fxaa_of_2x", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "SpanMax", "type": "float", "count": 1, "values": [ 8.0 ] }, + { "name": "SubPixelShift", "type": "float", "count": 1, "values": [ 0.25 ] }, + { "name": "ReduceMul", "type": "float", "count": 1, "values": [ 0.125 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.vsh new file mode 100644 index 0000000..63a9383 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_2x.vsh @@ -0,0 +1,23 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +uniform float SubPixelShift; + +varying vec2 texCoord; +varying vec4 posPos; + +void main() +{ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; + + posPos.xy = texCoord.xy + (0.5/OutSize * vec2(0.5 - SubPixelShift)); + posPos.zw = texCoord.xy - (0.5/OutSize * vec2(0.5 + SubPixelShift)); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.fsh new file mode 100644 index 0000000..3fc15ae --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.fsh @@ -0,0 +1,255 @@ +#version 120 + +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +varying vec2 texCoord; + +//#define FXAA_GREEN_AS_LUMA 1 +//#define FXAA_DISCARD 1 + +#ifndef FXAA_GREEN_AS_LUMA + // For those using non-linear color, + // and either not able to get luma in alpha, or not wanting to, + // this enables FXAA to run using green as a proxy for luma. + // So with this enabled, no need to pack luma in alpha. + // + // This will turn off AA on anything which lacks some amount of green. + // Pure red and blue or combination of only R and B, will get no AA. + // + // Might want to lower the settings for both, + // fxaaConsoleEdgeThresholdMin + // fxaaQualityEdgeThresholdMin + // In order to insure AA does not get turned off on colors + // which contain a minor amount of green. + // + // 1 = On. + // 0 = Off. + // + #define FXAA_GREEN_AS_LUMA 0 +#endif + +#ifndef FXAA_DISCARD + // 1 = Use discard on pixels which don't need AA. + // 0 = Return unchanged color on pixels which don't need AA. + #define FXAA_DISCARD 0 +#endif + +/*============================================================================ + API PORTING +============================================================================*/ + #define FxaaBool bool + #define FxaaDiscard discard + #define FxaaFloat float + #define FxaaFloat2 vec2 + #define FxaaFloat3 vec3 + #define FxaaFloat4 vec4 + #define FxaaHalf float + #define FxaaHalf2 vec2 + #define FxaaHalf3 vec3 + #define FxaaHalf4 vec4 + #define FxaaInt2 ivec2 + #define FxaaSat(x) clamp(x, 0.0, 1.0) + #define FxaaTex sampler2D +/*--------------------------------------------------------------------------*/ + + #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) + +/*============================================================================ + GREEN AS LUMA OPTION SUPPORT FUNCTION +============================================================================*/ +#if (FXAA_GREEN_AS_LUMA == 0) + // TODO Luma + FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return dot(rgba.xyz, vec3(0.299, 0.587, 0.114)); } +#else + FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } +#endif + +/*============================================================================ + FXAA3 CONSOLE - PC VERSION +============================================================================*/ +/*--------------------------------------------------------------------------*/ +FxaaFloat4 FxaaPixelShader( + // See FXAA Quality FxaaPixelShader() source for docs on Inputs! + // + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy} = center of pixel + FxaaFloat2 pos, + // + // Used only for FXAA Console, and not used on the 360 version. + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy__} = upper left of pixel + // {__zw} = lower right of pixel + FxaaFloat4 fxaaConsolePosPos, + // + // Input color texture. + // {rgb_} = color in linear or perceptual color space + // if (FXAA_GREEN_AS_LUMA == 0) + // {___a} = luma in perceptual color space (not linear) + FxaaTex tex, + // + // Only used on FXAA Console. + // This must be from a constant/uniform. + // This effects sub-pixel AA quality and inversely sharpness. + // Where N ranges between, + // N = 0.50 (default) + // N = 0.33 (sharper) + // {x___} = -N/screenWidthInPixels + // {_y__} = -N/screenHeightInPixels + // {__z_} = N/screenWidthInPixels + // {___w} = N/screenHeightInPixels + FxaaFloat4 fxaaConsoleRcpFrameOpt, + // + // Only used on FXAA Console. + // Not used on 360, but used on PS3 and PC. + // This must be from a constant/uniform. + // {x___} = -2.0/screenWidthInPixels + // {_y__} = -2.0/screenHeightInPixels + // {__z_} = 2.0/screenWidthInPixels + // {___w} = 2.0/screenHeightInPixels + FxaaFloat4 fxaaConsoleRcpFrameOpt2, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define. + // It is here now to allow easier tuning. + // This does not effect PS3, as this needs to be compiled in. + // Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3. + // Due to the PS3 being ALU bound, + // there are only three safe values here: 2 and 4 and 8. + // These options use the shaders ability to a free *|/ by 2|4|8. + // For all other platforms can be a non-power of two. + // 8.0 is sharper (default!!!) + // 4.0 is softer + // 2.0 is really soft (good only for vector graphics inputs) + FxaaFloat fxaaConsoleEdgeSharpness, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define. + // It is here now to allow easier tuning. + // This does not effect PS3, as this needs to be compiled in. + // Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3. + // Due to the PS3 being ALU bound, + // there are only two safe values here: 1/4 and 1/8. + // These options use the shaders ability to a free *|/ by 2|4|8. + // The console setting has a different mapping than the quality setting. + // Other platforms can use other values. + // 0.125 leaves less aliasing, but is softer (default!!!) + // 0.25 leaves more aliasing, and is sharper + FxaaFloat fxaaConsoleEdgeThreshold, + // + // Only used on FXAA Console. + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define. + // It is here now to allow easier tuning. + // Trims the algorithm from processing darks. + // The console setting has a different mapping than the quality setting. + // This does not apply to PS3, + // PS3 was simplified to avoid more shader instructions. + // 0.06 - faster but more aliasing in darks + // 0.05 - default + // 0.04 - slower and less aliasing in darks + // Special notes when using FXAA_GREEN_AS_LUMA, + // Likely want to set this to zero. + // As colors that are mostly not-green + // will appear very dark in the green channel! + // Tune by looking at mostly non-green content, + // then start at zero and increase until aliasing is a problem. + FxaaFloat fxaaConsoleEdgeThresholdMin +) { +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy)); + FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw)); + FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy)); + FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw)); +/*--------------------------------------------------------------------------*/ + FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy); + #if (FXAA_GREEN_AS_LUMA == 0) + // TODO Luma + FxaaFloat lumaM = FxaaLuma(rgbyM); + #else + FxaaFloat lumaM = rgbyM.y; + #endif +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw); + lumaNe += 1.0/384.0; + FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe); + FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw); + FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaMinM = min(lumaMin, lumaM); + FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled); + FxaaFloat lumaMaxM = max(lumaMax, lumaM); + FxaaFloat dirSwMinusNe = lumaSw - lumaNe; + FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM; + FxaaFloat dirSeMinusNw = lumaSe - lumaNw; + if(lumaMaxSubMinM < lumaMaxScaledClamped) + { + #if (FXAA_DISCARD == 1) + FxaaDiscard; + #else + return rgbyM; + #endif + } +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir; + dir.x = dirSwMinusNe + dirSeMinusNw; + dir.y = dirSwMinusNe - dirSeMinusNw; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir1 = normalize(dir.xy); + FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw); + FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw); +/*--------------------------------------------------------------------------*/ + FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness; + FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0); +/*--------------------------------------------------------------------------*/ + FxaaFloat2 dir2x = dir2 * fxaaConsoleRcpFrameOpt2.zw; + FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2x); + FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2x); +/*--------------------------------------------------------------------------*/ + FxaaFloat4 rgbyA = rgbyN1 + rgbyP1; + FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25); +/*--------------------------------------------------------------------------*/ + #if (FXAA_GREEN_AS_LUMA == 0) + // TODO Luma + float lumaB = FxaaLuma(rgbyB); + #else + float lumaB = rgbyB.y; + #endif + if((lumaB < lumaMin) || (lumaB > lumaMax)) + rgbyB.xyz = rgbyA.xyz * 0.5; + // + return rgbyB; +} +/*==========================================================================*/ + +void main() +{ + // PosPos {xy__} = upper left of pixel, {__zw} = lower right of pixel + vec4 posPos; + posPos.xy = texCoord - (0.6 / OutSize); + posPos.zw = texCoord + (0.6 / OutSize); + // rcpFrameOpt: N = 0.50 (default), N = 0.33 (sharper) + vec4 rcpFrameOpt; + rcpFrameOpt.xy = vec2(-0.50, -0.50) / OutSize; + rcpFrameOpt.zw = vec2( 0.50, 0.50) / OutSize; + // rcpFrameOpt2: N = 2; + vec4 rcpFrameOpt2; + rcpFrameOpt2.xy = vec2(-2.0, -2.0) / OutSize; + rcpFrameOpt2.zw = vec2( 2.0, 2.0) / OutSize; + // Edge sharpness: 8.0 (sharp, default) - 2.0 (soft) + float edgeSharpness = 8.0; + // Edge threshold: 0.125 (softer, def) - 0.25 (sharper) + float edgeThreshold = 0.125; + // 0.06 (faster, dark alias), 0.05 (def), 0.04 (slower, less dark alias) + float edgeThresholdMin = 0.05; + // + vec4 fxaaCol = FxaaPixelShader(texCoord, posPos, DiffuseSampler, rcpFrameOpt, rcpFrameOpt2, edgeSharpness, edgeThreshold, edgeThresholdMin); + gl_FragColor = vec4(fxaaCol.xyz, 1.0); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.json new file mode 100644 index 0000000..e783a0f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.json @@ -0,0 +1,17 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa_of_4x", + "fragment": "fxaa_of_4x", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.vsh new file mode 100644 index 0000000..b266005 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/fxaa_of_4x.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main() +{ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.fsh new file mode 100644 index 0000000..ab2b43b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.fsh @@ -0,0 +1,14 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; + +uniform float InverseAmount; + +void main(){ + vec4 diffuseColor = texture2D(DiffuseSampler, texCoord); + vec4 invertColor = 1.0 - diffuseColor; + vec4 outColor = mix(diffuseColor, invertColor, InverseAmount); + gl_FragColor = vec4(outColor.rgb, diffuseColor.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.json new file mode 100644 index 0000000..3648b30 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "invert", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "InverseAmount", "type": "float", "count": 1, "values": [ 0.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.vsh new file mode 100644 index 0000000..5110ef5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/invert.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 sizeRatio = OutSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * sizeRatio.x; + texCoord.y = texCoord.y * sizeRatio.y; + texCoord.y = sizeRatio.y - texCoord.y; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.fsh new file mode 100644 index 0000000..86990eb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.fsh @@ -0,0 +1,24 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D PrevSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Phosphor = vec3(0.7, 0.0, 0.0); +uniform float LerpFactor = 1.0; + +void main() { + vec4 CurrTexel = texture2D(DiffuseSampler, texCoord); + vec4 PrevTexel = texture2D(PrevSampler, texCoord); + float factor = Phosphor.r; + + if (Phosphor.g == 1) { + gl_FragColor = vec4(max(PrevTexel.rgb * vec3(factor), CurrTexel.rgb), 1.0); + } else { + gl_FragColor = vec4(mix(PrevTexel.rgb, CurrTexel.rgb, factor), 1.0); + } +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.json new file mode 100644 index 0000000..d18f1c7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/lunar_motionblur.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "lunar_motionblur", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" }, { "name": "PrevSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/notch.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/notch.fsh new file mode 100644 index 0000000..a732194 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/notch.fsh @@ -0,0 +1,23 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DitherSampler; + +varying vec2 texCoord; + +uniform vec2 InSize; + +void main() { + vec2 halfSize = InSize * 0.5; + + vec2 steppedCoord = texCoord; + steppedCoord.x = float(int(steppedCoord.x*halfSize.x)) / halfSize.x; + steppedCoord.y = float(int(steppedCoord.y*halfSize.y)) / halfSize.y; + + vec4 noise = texture2D(DitherSampler, steppedCoord * halfSize / 4.0); + vec4 col = texture2D(DiffuseSampler, steppedCoord) + noise * vec4(1.0/12.0, 1.0/12.0, 1.0/6.0, 1.0); + float r = float(int(col.r*8.0))/8.0; + float g = float(int(col.g*8.0))/8.0; + float b = float(int(col.b*4.0))/4.0; + gl_FragColor = vec4(r, g, b, col.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/notch.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/notch.json new file mode 100644 index 0000000..0eeb72e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/notch.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "notch", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" }, { "name": "DitherSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.fsh new file mode 100644 index 0000000..b1cfc34 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.fsh @@ -0,0 +1,131 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D BaseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 One = vec4(1.0); + +const float Pi = 3.1415926535; +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float NotchWidth = 2.0; +const float NotchUpperFrequency = 3.59754545 + NotchWidth; +const float NotchLowerFrequency = 3.59754545 - NotchWidth; +const float YFrequency = 6.0; +const float IFrequency = 1.2; +const float QFrequency = 0.6; +const float ScanTime = 52.6; +const vec3 YIQ2R = vec3(1.0, 0.956, 0.621); +const vec3 YIQ2G = vec3(1.0, -0.272, -0.647); +const vec3 YIQ2B = vec3(1.0, -1.106, 1.703); +const vec4 MinC = vec4(-1.1183); +const vec4 CRange = vec4(3.2366); +const float Pi2Length = Pi2 / 83.0; +const vec4 NotchOffset = vec4(0.0, 1.0, 2.0, 3.0); +const vec4 W = vec4(Pi2 * CCFrequency * ScanTime); + +void main() { + vec4 YAccum = Zero; + vec4 IAccum = Zero; + vec4 QAccum = Zero; + float QuadXSize = InSize.x * 4.0; + float TimePerSample = ScanTime / QuadXSize; + + // Frequency cutoffs for the individual portions of the signal that we extract. + // Y1 and Y2 are the positive and negative frequency limits of the notch filter on Y. + // Y3 is the center of the frequency response of the Y filter. + // I is the center of the frequency response of the I filter. + // Q is the center of the frequency response of the Q filter. + float Fc_y1 = NotchLowerFrequency * TimePerSample; + float Fc_y2 = NotchUpperFrequency * TimePerSample; + float Fc_y3 = YFrequency * TimePerSample; + float Fc_i = IFrequency * TimePerSample; + float Fc_q = QFrequency * TimePerSample; + float Pi2Fc_y1 = Fc_y1 * Pi2; + float Pi2Fc_y2 = Fc_y2 * Pi2; + float Pi2Fc_y3 = Fc_y3 * Pi2; + float Pi2Fc_i = Fc_i * Pi2; + float Pi2Fc_q = Fc_q * Pi2; + float Fc_y1_2 = Fc_y1 * 2.0; + float Fc_y2_2 = Fc_y2 * 2.0; + float Fc_y3_2 = Fc_y3 * 2.0; + float Fc_i_2 = Fc_i * 2.0; + float Fc_q_2 = Fc_q * 2.0; + vec4 CoordY = vec4(texCoord.y); + + vec4 BaseTexel = texture2D(DiffuseSampler, texCoord); + // 83 composite samples wide, 4 composite pixels per texel + for (float n = -41.0; n < 42.0; n += 4.0) { + vec4 n4 = n + NotchOffset; + vec4 CoordX = texCoord.x + oneTexel.x * n4 * 0.25; + vec2 TexCoord = vec2(CoordX.x, CoordY.y); + vec4 C = texture2D(DiffuseSampler, TexCoord) * CRange + MinC; + vec4 WT = W * (CoordX + A2 * CoordY * InSize.y + B); + vec4 Cosine = 0.54 + 0.46 * cos(Pi2Length * n4); + + vec4 SincYIn1 = Pi2Fc_y1 * n4; + vec4 SincYIn2 = Pi2Fc_y2 * n4; + vec4 SincYIn3 = Pi2Fc_y3 * n4; + vec4 SincY1 = sin(SincYIn1) / SincYIn1; + vec4 SincY2 = sin(SincYIn2) / SincYIn2; + vec4 SincY3 = sin(SincYIn3) / SincYIn3; + + // These zero-checks could be made more efficient, but we are trying to support + // downlevel GLSL + if(SincYIn1.x == 0.0) SincY1.x = 1.0; + if(SincYIn1.y == 0.0) SincY1.y = 1.0; + if(SincYIn1.z == 0.0) SincY1.z = 1.0; + if(SincYIn1.w == 0.0) SincY1.w = 1.0; + if(SincYIn2.x == 0.0) SincY2.x = 1.0; + if(SincYIn2.y == 0.0) SincY2.y = 1.0; + if(SincYIn2.z == 0.0) SincY2.z = 1.0; + if(SincYIn2.w == 0.0) SincY2.w = 1.0; + if(SincYIn3.x == 0.0) SincY3.x = 1.0; + if(SincYIn3.y == 0.0) SincY3.y = 1.0; + if(SincYIn3.z == 0.0) SincY3.z = 1.0; + if(SincYIn3.w == 0.0) SincY3.w = 1.0; + vec4 IdealY = (Fc_y1_2 * SincY1 - Fc_y2_2 * SincY2) + Fc_y3_2 * SincY3; + vec4 FilterY = Cosine * IdealY; + + vec4 SincIIn = Pi2Fc_i * n4; + vec4 SincI = sin(SincIIn) / SincIIn; + if(SincIIn.x == 0.0) SincI.x = 1.0; + if(SincIIn.y == 0.0) SincI.y = 1.0; + if(SincIIn.z == 0.0) SincI.z = 1.0; + if(SincIIn.w == 0.0) SincI.w = 1.0; + vec4 IdealI = Fc_i_2 * SincI; + vec4 FilterI = Cosine * IdealI; + + vec4 SincQIn = Pi2Fc_q * n4; + vec4 SincQ = sin(SincQIn) / SincQIn; + if(SincQIn.x == 0.0) SincQ.x = 1.0; + if(SincQIn.y == 0.0) SincQ.y = 1.0; + if(SincQIn.z == 0.0) SincQ.z = 1.0; + if(SincQIn.w == 0.0) SincQ.w = 1.0; + vec4 IdealQ = Fc_q_2 * SincQ; + vec4 FilterQ = Cosine * IdealQ; + + YAccum += C * FilterY; + IAccum += C * cos(WT) * FilterI; + QAccum += C * sin(WT) * FilterQ; + } + + float Y = dot(YAccum, One); + float I = dot(IAccum, One) * 2.0; + float Q = dot(QAccum, One) * 2.0; + + vec3 YIQ = vec3(Y, I, Q); + vec3 OutRGB = vec3(dot(YIQ, YIQ2R), dot(YIQ, YIQ2G), dot(YIQ, YIQ2B)); + + gl_FragColor = vec4(OutRGB, BaseTexel.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.json new file mode 100644 index 0000000..57078c3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_decode.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_decode", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" }, { "name": "BaseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.fsh new file mode 100644 index 0000000..450bc6d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.fsh @@ -0,0 +1,50 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float ScanTime = 52.6; +const float Pi2ScanTime = Pi2 * ScanTime; +const vec4 YTransform = vec4(0.299, 0.587, 0.114, 0.0); +const vec4 ITransform = vec4(0.595716, -0.274453, -0.321263, 0.0); +const vec4 QTransform = vec4(0.211456, -0.522591, 0.31135, 0.0); +const vec4 MinC = vec4(-1.1183); +const vec4 InvCRange = vec4(1.0 / 3.2366); + +void main() { + vec2 InverseP = vec2(P, 0.0) * oneTexel; + + // UVs for four linearly-interpolated samples spread 0.25 texels apart + vec2 C0 = texCoord; + vec2 C1 = texCoord + InverseP * 0.25; + vec2 C2 = texCoord + InverseP * 0.50; + vec2 C3 = texCoord + InverseP * 0.75; + vec4 Cx = vec4(C0.x, C1.x, C2.x, C3.x); + vec4 Cy = vec4(C0.y, C1.y, C2.y, C3.y); + + vec4 Texel0 = texture2D(DiffuseSampler, C0); + vec4 Texel1 = texture2D(DiffuseSampler, C1); + vec4 Texel2 = texture2D(DiffuseSampler, C2); + vec4 Texel3 = texture2D(DiffuseSampler, C3); + + // Calculate the expected time of the sample. + vec4 T = A2 * Cy * vec4(InSize.y) + B + Cx; + vec4 W = vec4(Pi2ScanTime * CCFrequency); + vec4 TW = T * W; + vec4 Y = vec4(dot(Texel0, YTransform), dot(Texel1, YTransform), dot(Texel2, YTransform), dot(Texel3, YTransform)); + vec4 I = vec4(dot(Texel0, ITransform), dot(Texel1, ITransform), dot(Texel2, ITransform), dot(Texel3, ITransform)); + vec4 Q = vec4(dot(Texel0, QTransform), dot(Texel1, QTransform), dot(Texel2, QTransform), dot(Texel3, QTransform)); + + vec4 Encoded = Y + I * cos(TW) + Q * sin(TW); + gl_FragColor = (Encoded - MinC) * InvCRange; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.json new file mode 100644 index 0000000..e000707 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/ntsc_encode.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_encode", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline.fsh new file mode 100644 index 0000000..6285820 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline.fsh @@ -0,0 +1,21 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 uDiff = center - up; + vec4 dDiff = center - down; + vec4 lDiff = center - left; + vec4 rDiff = center - right; + vec4 sum = uDiff + dDiff + lDiff + rDiff; + vec3 clamped = clamp(center.rgb - sum.rgb, 0.0, 1.0); + gl_FragColor = vec4(clamped, center.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline.json new file mode 100644 index 0000000..e4b77e1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_combine.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_combine.fsh new file mode 100644 index 0000000..d4b7682 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_combine.fsh @@ -0,0 +1,13 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OutlineSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 diffuseTexel = texture2D(DiffuseSampler, texCoord); + vec4 outlineTexel = texture2D(OutlineSampler, texCoord); + gl_FragColor = vec4(diffuseTexel.rgb + diffuseTexel.rgb * outlineTexel.rgb * vec3(0.75), diffuseTexel.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_combine.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_combine.json new file mode 100644 index 0000000..0c04b5c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_combine.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_combine", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" }, { "name": "OutlineSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_soft.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_soft.fsh new file mode 100644 index 0000000..92031c1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_soft.fsh @@ -0,0 +1,46 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; +uniform float LumaLevel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 uDiff = abs(center - up); + vec4 dDiff = abs(center - down); + vec4 lDiff = abs(center - left); + vec4 rDiff = abs(center - right); + vec4 u2Diff = abs(center - up2); + vec4 d2Diff = abs(center - down2); + vec4 l2Diff = abs(center - left2); + vec4 r2Diff = abs(center - right2); + vec4 sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff; + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float sumLuma = 1.0 - dot(clamp(sum, 0.0, 1.0), gray); + + // Get luminance of center pixel and adjust + float centerLuma = dot(center + (center - pow(center, vec4(LumaRamp))), gray); + + // Quantize the luma value + centerLuma = centerLuma - fract(centerLuma * LumaLevel) / LumaLevel; + + // Re-scale to full range + centerLuma = centerLuma * (LumaLevel / (LumaLevel - 1.0)); + + // Blend with outline + centerLuma = centerLuma * sumLuma; + + gl_FragColor = vec4(centerLuma, centerLuma, centerLuma, center.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_soft.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_soft.json new file mode 100644 index 0000000..c02b874 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_soft.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_soft", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] }, { "name": "LumaLevel", "type": "float", "count": 1, "values": [ 4.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.fsh new file mode 100644 index 0000000..b7d47d2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.fsh @@ -0,0 +1,41 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + vec4 bl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 br = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float uDiff = dot(abs(center - up), gray); + float dDiff = dot(abs(center - down), gray); + float lDiff = dot(abs(center - left), gray); + float rDiff = dot(abs(center - right), gray); + float u2Diff = dot(abs(center - up2), gray); + float d2Diff = dot(abs(center - down2), gray); + float l2Diff = dot(abs(center - left2), gray); + float r2Diff = dot(abs(center - right2), gray); + float ulDiff = dot(abs(center - ul), gray); + float urDiff = dot(abs(center - ur), gray); + float blDiff = dot(abs(center - bl), gray); + float brDiff = dot(abs(center - br), gray); + float sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff + ulDiff + urDiff + blDiff + brDiff; + float sumLuma = clamp(sum, 0.0, 1.0); + + gl_FragColor = vec4(sumLuma, sumLuma, sumLuma, center.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.json new file mode 100644 index 0000000..21759ed --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/outline_watercolor.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_watercolor", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/overlay.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/overlay.fsh new file mode 100644 index 0000000..311d26d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/overlay.fsh @@ -0,0 +1,26 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OverlaySampler; + +uniform vec2 InSize; + +varying vec2 texCoord; + +uniform float MosaicSize = 1.0; +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); + +void main(){ + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + float red = dot(baseTexel.rgb, RedMatrix); + float green = dot(baseTexel.rgb, GreenMatrix); + float blue = dot(baseTexel.rgb, BlueMatrix); + + vec4 overlayTexel = texture2D(OverlaySampler, vec2(texCoord.x, 1.0 - texCoord.y)); + gl_FragColor = mix(vec4(red, green, blue, baseTexel.a), overlayTexel, overlayTexel.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/overlay.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/overlay.json new file mode 100644 index 0000000..fd0fa15 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/overlay.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "overlay", + "attributes": [ "Position" ], + "samplers": [ { "name": "OverlaySampler" }, { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 1.0 ] }, { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 1.0 ] }, { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/phosphor.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/phosphor.fsh new file mode 100644 index 0000000..7721436 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/phosphor.fsh @@ -0,0 +1,19 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D PrevSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Phosphor = vec3(0.7, 0.7, 0.7); +uniform float LerpFactor = 1.0; + +void main() { + vec4 CurrTexel = texture2D(DiffuseSampler, texCoord); + vec4 PrevTexel = texture2D(PrevSampler, texCoord); + + gl_FragColor = vec4(max(PrevTexel.rgb * Phosphor, CurrTexel.rgb), CurrTexel.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/phosphor.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/phosphor.json new file mode 100644 index 0000000..2a8ca9f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/phosphor.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "phosphor", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" }, { "name": "PrevSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.fsh new file mode 100644 index 0000000..0911697 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.fsh @@ -0,0 +1,64 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 Half = vec4(0.5); +const vec4 One = vec4(1.0); +const vec4 Two = vec4(2.0); + +const float Pi = 3.1415926535; +const float PincushionAmount = 0.02; +const float CurvatureAmount = 0.02; +const float ScanlineAmount = 0.8; +const float ScanlineScale = 1.0; +const float ScanlineHeight = 1.0; +const float ScanlineBrightScale = 1.0; +const float ScanlineBrightOffset = 0.0; +const float ScanlineOffset = 0.0; +const vec3 Floor = vec3(0.05, 0.05, 0.05); +const vec3 Power = vec3(0.8, 0.8, 0.8); + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + vec2 PinUnitCoord = texCoord * Two.xy - One.xy; + float PincushionR2 = pow(length(PinUnitCoord), 2.0); + vec2 PincushionCurve = PinUnitCoord * PincushionAmount * PincushionR2; + vec2 ScanCoord = texCoord; + + ScanCoord *= One.xy - PincushionAmount * 0.2; + ScanCoord += PincushionAmount * 0.1; + ScanCoord += PincushionCurve; + + vec2 CurvatureClipCurve = PinUnitCoord * CurvatureAmount * PincushionR2; + vec2 ScreenClipCoord = texCoord; + ScreenClipCoord -= Half.xy; + ScreenClipCoord *= One.xy - CurvatureAmount * 0.2; + ScreenClipCoord += Half.xy; + ScreenClipCoord += CurvatureClipCurve; + + // -- Alpha Clipping -- + if (ScanCoord.x < 0.0) discard; + if (ScanCoord.y < 0.0) discard; + if (ScanCoord.x > 1.0) discard; + if (ScanCoord.y > 1.0) discard; + + // -- Scanline Simulation -- + float InnerSine = ScanCoord.y * InSize.y * ScanlineScale * 0.25; + float ScanBrightMod = sin(InnerSine * Pi + ScanlineOffset * InSize.y * 0.25); + float ScanBrightness = mix(1.0, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0) * 0.5, ScanlineAmount); + vec3 ScanlineTexel = InTexel.rgb * ScanBrightness; + + // -- Color Compression (increasing the floor of the signal without affecting the ceiling) -- + ScanlineTexel = Floor + (One.xyz - Floor) * ScanlineTexel; + + ScanlineTexel.rgb = pow(ScanlineTexel.rgb, Power); + + gl_FragColor = vec4(ScanlineTexel.rgb, InTexel.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.json new file mode 100644 index 0000000..8eb3616 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/scan_pincushion.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "scan_pincushion", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.fsh new file mode 100644 index 0000000..b17c769 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.fsh @@ -0,0 +1,20 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 left = texture2D(DiffuseSampler, texCoord - vec2(oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)); + vec4 up = texture2D(DiffuseSampler, texCoord - vec2(0.0, oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)); + vec4 leftDiff = center - left; + vec4 rightDiff = center - right; + vec4 upDiff = center - up; + vec4 downDiff = center - down; + vec4 total = clamp(leftDiff + rightDiff + upDiff + downDiff, 0.0, 1.0); + gl_FragColor = vec4(total.rgb, center.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.json new file mode 100644 index 0000000..ef1ef5a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "sobel", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.vsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.vsh new file mode 100644 index 0000000..21b1736 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/sobel.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/wobble.fsh b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/wobble.fsh new file mode 100644 index 0000000..54b87da --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/wobble.fsh @@ -0,0 +1,56 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Time; +uniform vec2 Frequency; +uniform vec2 WobbleAmount; + +vec3 hue(float h) { + float r = abs(h * 6.0 - 3.0) - 1.0; + float g = 2 - abs(h * 6.0 - 2.0); + float b = 2 - abs(h * 6.0 - 4.0); + return clamp(vec3(r,g,b), 0.0, 1.0); +} + +vec3 HSVtoRGB(vec3 hsv) { + return ((hue(hsv.x) - 1.0) * hsv.y + 1.0) * hsv.z; +} + +vec3 RGBtoHSV(vec3 rgb) { + vec3 hsv = vec3(0.0); + hsv.z = max(rgb.r, max(rgb.g, rgb.b)); + float min = min(rgb.r, min(rgb.g, rgb.b)); + float c = hsv.z - min; + + if (c != 0) { + hsv.y = c / hsv.z; + vec3 delta = (hsv.z - rgb) / c; + delta.rgb -= delta.brg; + delta.rg += vec2(2.0, 4.0); + if (rgb.r >= hsv.z) { + hsv.x = delta.b; + } else if (rgb.g >= hsv.z) { + hsv.x = delta.r; + } else { + hsv.x = delta.g; + } + hsv.x = fract(hsv.x / 6.0); + } + return hsv; +} + +void main() { + float xOffset = sin(texCoord.y * Frequency.x + Time * 3.1415926535 * 2.0) * WobbleAmount.x; + float yOffset = cos(texCoord.x * Frequency.y + Time * 3.1415926535 * 2.0) * WobbleAmount.y; + vec2 offset = vec2(xOffset, yOffset); + vec4 rgb = texture2D(DiffuseSampler, texCoord + offset); + vec3 hsv = RGBtoHSV(rgb.rgb); + hsv.x = fract(hsv.x + Time); + gl_FragColor = vec4(HSVtoRGB(hsv), rgb.a); +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/wobble.json b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/wobble.json new file mode 100644 index 0000000..17244a8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/shaders/program/wobble.json @@ -0,0 +1,14 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "wobble", + "attributes": [ "Position" ], + "samplers": [ { "name": "DiffuseSampler" } + ], + "uniforms": [ { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, { "name": "Frequency", "type": "float", "count": 2, "values": [ 512.0, 288.0 ] }, { "name": "WobbleAmount", "type": "float", "count": 2, "values": [ 0.002, 0.002 ] } + ] +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/credits.txt b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/credits.txt new file mode 100644 index 0000000..7396a16 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/credits.txt @@ -0,0 +1,66 @@ +[C]§f=============== +[C]§eMinecraft Credits +[C]§f=============== + +§7Created by: +§f Markus Persson + +§7Game design, programming and graphics: +§f Markus Persson +§f Jens Bergensten +§f Nathan Adams + +§7Programming: +§f Erik Broes + +§7Music and sound: +§f Daniel Rosenfeld + +§7Ingame artwork and paintings: +§f Kristoffer Zetterstrand + +§7End game narrative: +§f Julian Gough + +§7Website development: +§f Tobias Möllstam +§f Daniel Frisk +§f Leonard Axelsson +§f Jens Bergensten +§f Markus Persson + +§7Logo and promotional artwork: +§f Markus Toivonen + +§7Business and administration: +§f Carl Manneh +§f Daniel Kaplan + +§7Director of fun: +§f Lydia Winters + +§7Number crunching and statistics: +§f Patrick Geuder + +§7Additional programming: +§f Paul Spooner +§f Ryan 'Scaevolus' Hitchman +§f Elliot 'Hippoplatimus' Segal + +§7Developers of Mo' Creatures (horses etc): +§f John Olarte (DrZhark) +§f Kent Christian Jensen +§f Dan Roque + +§7Technologies used: +§f Java by Oracle +§f LWJGL by many talented people +§f "3d Sound System" by Paul Lamb +§f JOrbis by JCraft + + + + + + +§f"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." §7- Unknown \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/end.txt b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/end.txt new file mode 100644 index 0000000..7277524 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/end.txt @@ -0,0 +1,151 @@ +§3I see the player you mean. + +§2PLAYERNAME? + +§3Yes. Take care. It has reached a higher level now. It can read our thoughts. + +§2That doesn't matter. It thinks we are part of the game. + +§3I like this player. It played well. It did not give up. + +§2It is reading our thoughts as though they were words on a screen. + +§3That is how it chooses to imagine many things, when it is deep in the dream of a game. + +§2Words make a wonderful interface. Very flexible. And less terrifying than staring at the reality behind the screen. + +§3They used to hear voices. Before players could read. Back in the days when those who did not play called the players witches, and warlocks. And players dreamed they flew through the air, on sticks powered by demons. + +§2What did this player dream? + +§3This player dreamed of sunlight and trees. Of fire and water. It dreamed it created. And it dreamed it destroyed. It dreamed it hunted, and was hunted. It dreamed of shelter. + +§2Hah, the original interface. A million years old, and it still works. But what true structure did this player create, in the reality behind the screen? + +§3It worked, with a million others, to sculpt a true world in a fold of the §f§k§a§b§3, and created a §f§k§a§b§3 for §f§k§a§b§3, in the §f§k§a§b§3. + +§2It cannot read that thought. + +§3No. It has not yet achieved the highest level. That, it must achieve in the long dream of life, not the short dream of a game. + +§2Does it know that we love it? That the universe is kind? + +§3Sometimes, through the noise of its thoughts, it hears the universe, yes. + +§2But there are times it is sad, in the long dream. It creates worlds that have no summer, and it shivers under a black sun, and it takes its sad creation for reality. + +§3To cure it of sorrow would destroy it. The sorrow is part of its own private task. We cannot interfere. + +§2Sometimes when they are deep in dreams, I want to tell them, they are building true worlds in reality. Sometimes I want to tell them of their importance to the universe. Sometimes, when they have not made a true connection in a while, I want to help them to speak the word they fear. + +§3It reads our thoughts. + +§2Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely §f§k§a§b§2 and §f§k§a§b§2, I wish to tell them that they are §f§k§a§b§2 in the §f§k§a§b§2. They see so little of reality, in their long dream. + +§3And yet they play the game. + +§2But it would be so easy to tell them... + +§3Too strong for this dream. To tell them how to live is to prevent them living. + +§2I will not tell the player how to live. + +§3The player is growing restless. + +§2I will tell the player a story. + +§3But not the truth. + +§2No. A story that contains the truth safely, in a cage of words. Not the naked truth that can burn over any distance. + +§3Give it a body, again. + +§2Yes. Player... + +§3Use its name. + +§2PLAYERNAME. Player of games. + +§3Good. + +§2Take a breath, now. Take another. Feel air in your lungs. Let your limbs return. Yes, move your fingers. Have a body again, under gravity, in air. Respawn in the long dream. There you are. Your body touching the universe again at every point, as though you were separate things. As though we were separate things. + +§3Who are we? Once we were called the spirit of the mountain. Father sun, mother moon. Ancestral spirits, animal spirits. Jinn. Ghosts. The green man. Then gods, demons. Angels. Poltergeists. Aliens, extraterrestrials. Leptons, quarks. The words change. We do not change. + +§2We are the universe. We are everything you think isn't you. You are looking at us now, through your skin and your eyes. And why does the universe touch your skin, and throw light on you? To see you, player. To know you. And to be known. I shall tell you a story. + +§2Once upon a time, there was a player. + +§3The player was you, PLAYERNAME. + +§2Sometimes it thought itself human, on the thin crust of a spinning globe of molten rock. The ball of molten rock circled a ball of blazing gas that was three hundred and thirty thousand times more massive than it. They were so far apart that light took eight minutes to cross the gap. The light was information from a star, and it could burn your skin from a hundred and fifty million kilometres away. + +§2Sometimes the player dreamed it was a miner, on the surface of a world that was flat, and infinite. The sun was a square of white. The days were short; there was much to do; and death was a temporary inconvenience. + +§3Sometimes the player dreamed it was lost in a story. + +§2Sometimes the player dreamed it was other things, in other places. Sometimes these dreams were disturbing. Sometimes very beautiful indeed. Sometimes the player woke from one dream into another, then woke from that into a third. + +§3Sometimes the player dreamed it watched words on a screen. + +§2Let's go back. + +§2The atoms of the player were scattered in the grass, in the rivers, in the air, in the ground. A woman gathered the atoms; she drank and ate and inhaled; and the woman assembled the player, in her body. + +§2And the player awoke, from the warm, dark world of its mother's body, into the long dream. + +§2And the player was a new story, never told before, written in letters of DNA. And the player was a new program, never run before, generated by a sourcecode a billion years old. And the player was a new human, never alive before, made from nothing but milk and love. + +§3You are the player. The story. The program. The human. Made from nothing but milk and love. + +§2Let's go further back. + +§2The seven billion billion billion atoms of the player's body were created, long before this game, in the heart of a star. So the player, too, is information from a star. And the player moves through a story, which is a forest of information planted by a man called Julian, on a flat, infinite world created by a man called Markus, that exists inside a small, private world created by the player, who inhabits a universe created by... + +§3Shush. Sometimes the player created a small, private world that was soft and warm and simple. Sometimes hard, and cold, and complicated. Sometimes it built a model of the universe in its head; flecks of energy, moving through vast empty spaces. Sometimes it called those flecks "electrons" and "protons". + +§2Sometimes it called them "planets" and "stars". + +§2Sometimes it believed it was in a universe that was made of energy that was made of offs and ons; zeros and ones; lines of code. Sometimes it believed it was playing a game. Sometimes it believed it was reading words on a screen. + +§3You are the player, reading words... + +§2Shush... Sometimes the player read lines of code on a screen. Decoded them into words; decoded words into meaning; decoded meaning into feelings, emotions, theories, ideas, and the player started to breathe faster and deeper and realised it was alive, it was alive, those thousand deaths had not been real, the player was alive + +§3You. You. You are alive. + +§2and sometimes the player believed the universe had spoken to it through the sunlight that came through the shuffling leaves of the summer trees + +§3and sometimes the player believed the universe had spoken to it through the light that fell from the crisp night sky of winter, where a fleck of light in the corner of the player's eye might be a star a million times as massive as the sun, boiling its planets to plasma in order to be visible for a moment to the player, walking home at the far side of the universe, suddenly smelling food, almost at the familiar door, about to dream again + +§2and sometimes the player believed the universe had spoken to it through the zeros and ones, through the electricity of the world, through the scrolling words on a screen at the end of a dream + +§3and the universe said I love you + +§2and the universe said you have played the game well + +§3and the universe said everything you need is within you + +§2and the universe said you are stronger than you know + +§3and the universe said you are the daylight + +§2and the universe said you are the night + +§3and the universe said the darkness you fight is within you + +§2and the universe said the light you seek is within you + +§3and the universe said you are not alone + +§2and the universe said you are not separate from every other thing + +§3and the universe said you are the universe tasting itself, talking to itself, reading its own code + +§2and the universe said I love you because you are love. + +§3And the game was over and the player woke up from the dream. And the player began a new dream. And the player dreamed again, dreamed better. And the player was the universe. And the player was love. + +§3You are the player. + +§2Wake up. diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/splashes.txt b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/splashes.txt new file mode 100644 index 0000000..061ae98 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/texts/splashes.txt @@ -0,0 +1,322 @@ +As seen on TV! +Awesome! +100% pure! +May contain nuts! +Better than Prey! +More polygons! +Sexy! +Limited edition! +Flashing letters! +Made by Notch! +It's here! +Best in class! +It's finished! +Kind of dragon free! +Excitement! +More than 500 sold! +One of a kind! +Heaps of hits on YouTube! +Indev! +Spiders everywhere! +Check it out! +Holy cow, man! +It's a game! +Made in Sweden! +Uses LWJGL! +Reticulating splines! +Minecraft! +Yaaay! +Singleplayer! +Keyboard compatible! +Undocumented! +Ingots! +Exploding creepers! +That's no moon! +l33t! +Create! +Survive! +Dungeon! +Exclusive! +The bee's knees! +Down with O.P.P.! +Closed source! +Classy! +Wow! +Not on steam! +Oh man! +Awesome community! +Pixels! +Teetsuuuuoooo! +Kaaneeeedaaaa! +Now with difficulty! +Enhanced! +90% bug free! +Pretty! +12 herbs and spices! +Fat free! +Absolutely no memes! +Free dental! +Ask your doctor! +Minors welcome! +Cloud computing! +Legal in Finland! +Hard to label! +Technically good! +Bringing home the bacon! +Indie! +GOTY! +Ceci n'est pas une title screen! +Euclidian! +Now in 3D! +Inspirational! +Herregud! +Complex cellular automata! +Yes, sir! +Played by cowboys! +OpenGL 1.2! +Thousands of colors! +Try it! +Age of Wonders is better! +Try the mushroom stew! +Sensational! +Hot tamale, hot hot tamale! +Play him off, keyboard cat! +Guaranteed! +Macroscopic! +Bring it on! +Random splash! +Call your mother! +Monster infighting! +Loved by millions! +Ultimate edition! +Freaky! +You've got a brand new key! +Water proof! +Uninflammable! +Whoa, dude! +All inclusive! +Tell your friends! +NP is not in P! +Notch <3 ez! +Music by C418! +Livestreamed! +Haunted! +Polynomial! +Terrestrial! +All is full of love! +Full of stars! +Scientific! +Cooler than Spock! +Collaborate and listen! +Never dig down! +Take frequent breaks! +Not linear! +Han shot first! +Nice to meet you! +Buckets of lava! +Ride the pig! +Larger than Earth! +sqrt(-1) love you! +Phobos anomaly! +Punching wood! +Falling off cliffs! +0% sugar! +150% hyperbole! +Synecdoche! +Let's danec! +Seecret Friday update! +Reference implementation! +Lewd with two dudes with food! +Kiss the sky! +20 GOTO 10! +Verlet intregration! +Peter Griffin! +Do not distribute! +Cogito ergo sum! +4815162342 lines of code! +A skeleton popped out! +The Work of Notch! +The sum of its parts! +BTAF used to be good! +I miss ADOM! +umop-apisdn! +OICU812! +Bring me Ray Cokes! +Finger-licking! +Thematic! +Pneumatic! +Sublime! +Octagonal! +Une baguette! +Gargamel plays it! +Rita is the new top dog! +SWM forever! +Representing Edsbyn! +Matt Damon! +Supercalifragilisticexpialidocious! +Consummate V's! +Cow Tools! +Double buffered! +Fan fiction! +Flaxkikare! +Jason! Jason! Jason! +Hotter than the sun! +Internet enabled! +Autonomous! +Engage! +Fantasy! +DRR! DRR! DRR! +Kick it root down! +Regional resources! +Woo, facepunch! +Woo, somethingawful! +Woo, /v/! +Woo, tigsource! +Woo, minecraftforum! +Woo, worldofminecraft! +Woo, reddit! +Woo, 2pp! +Google anlyticsed! +Now supports åäö! +Give us Gordon! +Tip your waiter! +Very fun! +12345 is a bad password! +Vote for net neutrality! +Lives in a pineapple under the sea! +MAP11 has two names! +Omnipotent! +Gasp! +...! +Bees, bees, bees, bees! +Jag känner en bot! +This text is hard to read if you play the game at the default resolution, but at 1080p it's fine! +Haha, LOL! +Hampsterdance! +Switches and ores! +Menger sponge! +idspispopd! +Eple (original edit)! +So fresh, so clean! +Slow acting portals! +Try the Nether! +Don't look directly at the bugs! +Oh, ok, Pigmen! +Finally with ladders! +Scary! +Play Minecraft, Watch Topgear, Get Pig! +Twittered about! +Jump up, jump up, and get down! +Joel is neat! +A riddle, wrapped in a mystery! +Huge tracts of land! +Welcome to your Doom! +Stay a while, stay forever! +Stay a while and listen! +Treatment for your rash! +"Autological" is! +Information wants to be free! +"Almost never" is an interesting concept! +Lots of truthiness! +The creeper is a spy! +Turing complete! +It's groundbreaking! +Let our battle's begin! +The sky is the limit! +Jeb has amazing hair! +Ryan also has amazing hair! +Casual gaming! +Undefeated! +Kinda like Lemmings! +Follow the train, CJ! +Leveraging synergy! +This message will never appear on the splash screen, isn't that weird? +DungeonQuest is unfair! +110813! +90210! +Check out the far lands! +Tyrion would love it! +Also try VVVVVV! +Also try Super Meat Boy! +Also try Terraria! +Also try Mount And Blade! +Also try Project Zomboid! +Also try World of Goo! +Also try Limbo! +Also try Pixeljunk Shooter! +Also try Braid! +That's super! +Bread is pain! +Read more books! +Khaaaaaaaaan! +Less addictive than TV Tropes! +More addictive than lemonade! +Bigger than a bread box! +Millions of peaches! +Fnord! +This is my true form! +Totally forgot about Dre! +Don't bother with the clones! +Pumpkinhead! +Hobo humping slobo babe! +Made by Jeb! +Has an ending! +Finally complete! +Feature packed! +Boots with the fur! +Stop, hammertime! +Testificates! +Conventional! +Homeomorphic to a 3-sphere! +Doesn't avoid double negatives! +Place ALL the blocks! +Does barrel rolls! +Meeting expectations! +PC gaming since 1873! +Ghoughpteighbteau tchoghs! +Déjà vu! +Déjà vu! +Got your nose! +Haley loves Elan! +Afraid of the big, black bat! +Doesn't use the U-word! +Child's play! +See you next Friday or so! +From the streets of Södermalm! +150 bpm for 400000 minutes! +Technologic! +Funk soul brother! +Pumpa kungen! +日本ハロー! +한국 안녕하세요! +Helo Cymru! +Cześć Polsko! +你好中国! +Привет Россия! +Γεια σου Ελλάδα! +My life for Aiur! +Lennart lennart = new Lennart(); +I see your vocabulary has improved! +Who put it there? +You can't explain that! +if not ok then return end +§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac +§kFUNKY LOL +SOPA means LOSER in Swedish! +Big Pointy Teeth! +Bekarton guards the gate! +Mmmph, mmph! +Don't feed avocados to parrots! +Swords for everyone! +Plz reply to my tweet! +.party()! +Take her pillow! +Put that cookie down! +Pretty scary! +I have a suggestion. +Now with extra hugs! +Now java 6! +Woah. +HURNERJSGER? +What's up, Doc? +Now contains 32 random daily cats! \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_base.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_base.png new file mode 100644 index 0000000..cfc1fc8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_base.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png new file mode 100644 index 0000000..395dea4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png new file mode 100644 index 0000000..eddc47f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png new file mode 100644 index 0000000..6cade1f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/beacon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/beacon.png new file mode 100644 index 0000000..a69e59d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/beacon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_end.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_end.png new file mode 100644 index 0000000..6e1a4be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_end.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_side.png new file mode 100644 index 0000000..3ce06f3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_top.png new file mode 100644 index 0000000..b96d357 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_feet_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_end.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_end.png new file mode 100644 index 0000000..b684c9a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_end.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_side.png new file mode 100644 index 0000000..3270b4a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_top.png new file mode 100644 index 0000000..2ab1090 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bed_head_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bedrock.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bedrock.png new file mode 100644 index 0000000..1643c99 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bedrock.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bookshelf.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bookshelf.png new file mode 100644 index 0000000..4c87f0f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/bookshelf.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brewing_stand.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brewing_stand.png new file mode 100644 index 0000000..60832aa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brewing_stand.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brewing_stand_base.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brewing_stand_base.png new file mode 100644 index 0000000..0742fbf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brewing_stand_base.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brick.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brick.png new file mode 100644 index 0000000..fd6959c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/brick.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_bottom.png new file mode 100644 index 0000000..6f10bc0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_side.png new file mode 100644 index 0000000..9c55503 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_top.png new file mode 100644 index 0000000..f182e84 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cactus_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_bottom.png new file mode 100644 index 0000000..d93b15a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_inner.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_inner.png new file mode 100644 index 0000000..ce7ce69 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_inner.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_side.png new file mode 100644 index 0000000..343a023 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_top.png new file mode 100644 index 0000000..2947892 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cake_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_3.png new file mode 100644 index 0000000..2391be8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/carrots_stage_3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_bottom.png new file mode 100644 index 0000000..fb31385 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_inner.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_inner.png new file mode 100644 index 0000000..d5a30dd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_inner.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_side.png new file mode 100644 index 0000000..72b0e5a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_top.png new file mode 100644 index 0000000..3ed6171 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cauldron_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/clay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/clay.png new file mode 100644 index 0000000..c19e031 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/clay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/coal_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/coal_block.png new file mode 100644 index 0000000..024404b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/coal_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/coal_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/coal_ore.png new file mode 100644 index 0000000..49486d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/coal_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cobblestone.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cobblestone.png new file mode 100644 index 0000000..da3498c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cobblestone.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png new file mode 100644 index 0000000..29449e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png new file mode 100644 index 0000000..25892eb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png new file mode 100644 index 0000000..d0098ff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png new file mode 100644 index 0000000..db28c7b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/command_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/command_block.png new file mode 100644 index 0000000..4459675 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/command_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/comparator_off.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/comparator_off.png new file mode 100644 index 0000000..c9527bc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/comparator_off.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/comparator_on.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/comparator_on.png new file mode 100644 index 0000000..2e4fb7a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/comparator_on.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_front.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_front.png new file mode 100644 index 0000000..11986a4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_front.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_side.png new file mode 100644 index 0000000..1c678b4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_top.png new file mode 100644 index 0000000..5cd53a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/crafting_table_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_side.png new file mode 100644 index 0000000..ac273ea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_top.png new file mode 100644 index 0000000..3bfb2da Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/daylight_detector_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/deadbush.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/deadbush.png new file mode 100644 index 0000000..c64e079 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/deadbush.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_0.png new file mode 100644 index 0000000..f65b7ed Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_1.png new file mode 100644 index 0000000..7c91596 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_2.png new file mode 100644 index 0000000..dadd6b0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_3.png new file mode 100644 index 0000000..52a40b6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_4.png new file mode 100644 index 0000000..e37c88a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_5.png new file mode 100644 index 0000000..9590d2f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_6.png new file mode 100644 index 0000000..8e490c0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_7.png new file mode 100644 index 0000000..0b40c78 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_8.png new file mode 100644 index 0000000..c0bf1de Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_9.png new file mode 100644 index 0000000..e3185f8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/destroy_stage_9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/diamond_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/diamond_block.png new file mode 100644 index 0000000..f2e2e77 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/diamond_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/diamond_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/diamond_ore.png new file mode 100644 index 0000000..735ecda Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/diamond_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt.png new file mode 100644 index 0000000..617d353 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png new file mode 100644 index 0000000..5921d37 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png new file mode 100644 index 0000000..ebeda86 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png new file mode 100644 index 0000000..3e09fde Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png new file mode 100644 index 0000000..87a7837 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_iron_lower.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_iron_lower.png new file mode 100644 index 0000000..dbc33ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_iron_lower.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_iron_upper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_iron_upper.png new file mode 100644 index 0000000..56878fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_iron_upper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_wood_lower.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_wood_lower.png new file mode 100644 index 0000000..cc61731 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_wood_lower.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_wood_upper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_wood_upper.png new file mode 100644 index 0000000..93319d5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/door_wood_upper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png new file mode 100644 index 0000000..6a5fa6a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png new file mode 100644 index 0000000..393144c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png new file mode 100644 index 0000000..ec717f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png new file mode 100644 index 0000000..113d2b3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png new file mode 100644 index 0000000..21285f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png new file mode 100644 index 0000000..bc68241 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png new file mode 100644 index 0000000..4d59f44 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png new file mode 100644 index 0000000..028aa80 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png new file mode 100644 index 0000000..d488923 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png new file mode 100644 index 0000000..8a12ebe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png new file mode 100644 index 0000000..699e34f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png new file mode 100644 index 0000000..4d14203 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png new file mode 100644 index 0000000..5b880b5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png new file mode 100644 index 0000000..b00751f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dragon_egg.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dragon_egg.png new file mode 100644 index 0000000..02af123 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dragon_egg.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png new file mode 100644 index 0000000..7d5f260 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png new file mode 100644 index 0000000..68a56c8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/emerald_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/emerald_block.png new file mode 100644 index 0000000..dc214ee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/emerald_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/emerald_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/emerald_ore.png new file mode 100644 index 0000000..a26c35f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/emerald_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png new file mode 100644 index 0000000..0f492aa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_side.png new file mode 100644 index 0000000..f2f4614 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_top.png new file mode 100644 index 0000000..0d5f68f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/enchanting_table_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/end_stone.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/end_stone.png new file mode 100644 index 0000000..c2a91e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/end_stone.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_eye.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_eye.png new file mode 100644 index 0000000..afa1d5d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_eye.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_side.png new file mode 100644 index 0000000..e6cb567 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_top.png new file mode 100644 index 0000000..35215a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/endframe_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/farmland_dry.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/farmland_dry.png new file mode 100644 index 0000000..d03a0f4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/farmland_dry.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/farmland_wet.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/farmland_wet.png new file mode 100644 index 0000000..f8d460d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/farmland_wet.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fern.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fern.png new file mode 100644 index 0000000..fd76950 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fern.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png new file mode 100644 index 0000000..a401be1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta new file mode 100644 index 0000000..7644671 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta @@ -0,0 +1,38 @@ +{ + "animation": { + "frames": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ] + } +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png new file mode 100644 index 0000000..8c4af4b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_allium.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_allium.png new file mode 100644 index 0000000..b7b5a45 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_allium.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png new file mode 100644 index 0000000..51d7fd9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_dandelion.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_dandelion.png new file mode 100644 index 0000000..873e3f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_dandelion.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_houstonia.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_houstonia.png new file mode 100644 index 0000000..2f9127d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_houstonia.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png new file mode 100644 index 0000000..6d48913 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_paeonia.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_paeonia.png new file mode 100644 index 0000000..01a92ee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_paeonia.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_pot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_pot.png new file mode 100644 index 0000000..09c2523 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_pot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_rose.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_rose.png new file mode 100644 index 0000000..895d78f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_rose.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png new file mode 100644 index 0000000..6715a62 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png new file mode 100644 index 0000000..a757bf5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_red.png new file mode 100644 index 0000000..3048b63 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_white.png new file mode 100644 index 0000000..6aa12a9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/flower_tulip_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_front_off.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_front_off.png new file mode 100644 index 0000000..0570c3a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_front_off.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_front_on.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_front_on.png new file mode 100644 index 0000000..92c89f3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_front_on.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_side.png new file mode 100644 index 0000000..115f73d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_top.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/furnace_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass.png new file mode 100644 index 0000000..acadb01 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_black.png new file mode 100644 index 0000000..06f3427 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_blue.png new file mode 100644 index 0000000..38885de Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_brown.png new file mode 100644 index 0000000..259b61c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_cyan.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_cyan.png new file mode 100644 index 0000000..d30caa4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_cyan.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_gray.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_gray.png new file mode 100644 index 0000000..3f07a5d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_gray.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_green.png new file mode 100644 index 0000000..7c1f4e6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_light_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_light_blue.png new file mode 100644 index 0000000..b62703d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_light_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_lime.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_lime.png new file mode 100644 index 0000000..f1d3c46 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_lime.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_magenta.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_magenta.png new file mode 100644 index 0000000..5cd9945 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_magenta.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_orange.png new file mode 100644 index 0000000..3a29e31 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top.png new file mode 100644 index 0000000..02de587 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png new file mode 100644 index 0000000..43d60c5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png new file mode 100644 index 0000000..55c614f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png new file mode 100644 index 0000000..cbd791a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png new file mode 100644 index 0000000..9a34b84 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png new file mode 100644 index 0000000..bb06114 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png new file mode 100644 index 0000000..a7d9fc7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png new file mode 100644 index 0000000..6a0e661 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png new file mode 100644 index 0000000..0607d75 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png new file mode 100644 index 0000000..5419e52 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png new file mode 100644 index 0000000..2866571 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png new file mode 100644 index 0000000..6b6cd76 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png new file mode 100644 index 0000000..23e208e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png new file mode 100644 index 0000000..22b69db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png new file mode 100644 index 0000000..f226ecc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png new file mode 100644 index 0000000..9a273c3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png new file mode 100644 index 0000000..1c8580f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pink.png new file mode 100644 index 0000000..42d8739 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_purple.png new file mode 100644 index 0000000..fcae3d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_red.png new file mode 100644 index 0000000..db4c5eb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_silver.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_silver.png new file mode 100644 index 0000000..8461664 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_silver.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_white.png new file mode 100644 index 0000000..696c5aa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_yellow.png new file mode 100644 index 0000000..8e48e12 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glass_yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glowstone.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glowstone.png new file mode 100644 index 0000000..c7253b3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/glowstone.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gold_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gold_block.png new file mode 100644 index 0000000..174002e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gold_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gold_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gold_ore.png new file mode 100644 index 0000000..b1a7a55 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gold_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side.png new file mode 100644 index 0000000..a4975e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side_overlay.png new file mode 100644 index 0000000..fc3fa9d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side_snowed.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side_snowed.png new file mode 100644 index 0000000..41f6197 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_side_snowed.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_top.png new file mode 100644 index 0000000..eaa7e45 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/grass_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gravel.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gravel.png new file mode 100644 index 0000000..388e5c5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/gravel.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay.png new file mode 100644 index 0000000..2446380 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png new file mode 100644 index 0000000..59da22c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png new file mode 100644 index 0000000..7e38e27 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png new file mode 100644 index 0000000..f81745f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png new file mode 100644 index 0000000..b05428c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png new file mode 100644 index 0000000..8f86904 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png new file mode 100644 index 0000000..e89162e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png new file mode 100644 index 0000000..3d9ebea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png new file mode 100644 index 0000000..b459a0b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png new file mode 100644 index 0000000..9663106 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png new file mode 100644 index 0000000..40929db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png new file mode 100644 index 0000000..c21c0aa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png new file mode 100644 index 0000000..edece94 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png new file mode 100644 index 0000000..6561d12 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png new file mode 100644 index 0000000..eae07f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png new file mode 100644 index 0000000..8066af0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png new file mode 100644 index 0000000..5da4687 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hay_block_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hay_block_side.png new file mode 100644 index 0000000..a2b32db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hay_block_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hay_block_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hay_block_top.png new file mode 100644 index 0000000..1d35593 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hay_block_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_inside.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_inside.png new file mode 100644 index 0000000..24e8eae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_inside.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_outside.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_outside.png new file mode 100644 index 0000000..50ed8d5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_outside.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_top.png new file mode 100644 index 0000000..3ed6171 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/hopper_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ice.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ice.png new file mode 100644 index 0000000..ac946e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ice.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ice_packed.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ice_packed.png new file mode 100644 index 0000000..50f0f34 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ice_packed.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_bars.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_bars.png new file mode 100644 index 0000000..732807f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_bars.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_block.png new file mode 100644 index 0000000..7816799 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_ore.png new file mode 100644 index 0000000..250d8bb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/iron_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/itemframe_background.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/itemframe_background.png new file mode 100644 index 0000000..b40ad65 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/itemframe_background.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/jukebox_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/jukebox_side.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/jukebox_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/jukebox_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/jukebox_top.png new file mode 100644 index 0000000..92ddb15 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/jukebox_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ladder.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ladder.png new file mode 100644 index 0000000..e2ec5f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/ladder.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lapis_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lapis_block.png new file mode 100644 index 0000000..0271489 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lapis_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lapis_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lapis_ore.png new file mode 100644 index 0000000..6144236 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lapis_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png new file mode 100644 index 0000000..af07f91 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta new file mode 100644 index 0000000..8e55e43 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_still.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_still.png new file mode 100644 index 0000000..78bb29d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_still.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta new file mode 100644 index 0000000..7ceb363 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta @@ -0,0 +1,45 @@ +{ + "animation": { + "frametime": 2, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 18, + 17, + 16, + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ] + } +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia_opaque.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_acacia_opaque.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_birch.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_birch.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_birch.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_birch_opaque.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_birch_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_birch_opaque.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle.png new file mode 100644 index 0000000..e0cb935 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle_opaque.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle_opaque.png new file mode 100644 index 0000000..110a618 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_jungle_opaque.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_oak_opaque.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_oak_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_oak_opaque.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce.png new file mode 100644 index 0000000..602eab8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce_opaque.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce_opaque.png new file mode 100644 index 0000000..2e5228e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/leaves_spruce_opaque.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lever.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lever.png new file mode 100644 index 0000000..051187f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/lever.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_acacia.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_acacia.png new file mode 100644 index 0000000..d221210 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_acacia.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_acacia_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_acacia_top.png new file mode 100644 index 0000000..3d44878 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_acacia_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_big_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_big_oak.png new file mode 100644 index 0000000..d4da03e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_big_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_big_oak_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_big_oak_top.png new file mode 100644 index 0000000..99137b6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_big_oak_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_birch.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_birch.png new file mode 100644 index 0000000..bfb209d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_birch.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_birch_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_birch_top.png new file mode 100644 index 0000000..f9b94f4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_birch_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_jungle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_jungle.png new file mode 100644 index 0000000..0b7120a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_jungle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_jungle_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_jungle_top.png new file mode 100644 index 0000000..26b0361 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_jungle_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_oak.png new file mode 100644 index 0000000..914cb5f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_oak_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_oak_top.png new file mode 100644 index 0000000..7a44e77 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_oak_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_spruce.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_spruce.png new file mode 100644 index 0000000..dc1aa2f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_spruce.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_spruce_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_spruce_top.png new file mode 100644 index 0000000..280c64e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/log_spruce_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_side.png new file mode 100644 index 0000000..ec7b430 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_stem_connected.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_stem_connected.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_top.png new file mode 100644 index 0000000..65cf169 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/melon_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mob_spawner.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mob_spawner.png new file mode 100644 index 0000000..7d55217 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mob_spawner.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png new file mode 100644 index 0000000..f0e7a04 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png new file mode 100644 index 0000000..1f52ba8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png new file mode 100644 index 0000000..66cf12c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png new file mode 100644 index 0000000..83c0840 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_brown.png new file mode 100644 index 0000000..bf33d34 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_red.png new file mode 100644 index 0000000..1b332b7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mushroom_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mycelium_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mycelium_side.png new file mode 100644 index 0000000..5547425 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mycelium_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mycelium_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mycelium_top.png new file mode 100644 index 0000000..088a825 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/mycelium_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_brick.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_brick.png new file mode 100644 index 0000000..caaf66f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_brick.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png new file mode 100644 index 0000000..514a95b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png new file mode 100644 index 0000000..b4ad0d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png new file mode 100644 index 0000000..b9b6743 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/netherrack.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/netherrack.png new file mode 100644 index 0000000..88129c4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/netherrack.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/noteblock.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/noteblock.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/noteblock.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/obsidian.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/obsidian.png new file mode 100644 index 0000000..ff0a683 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/obsidian.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_bottom.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_inner.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_inner.png new file mode 100644 index 0000000..1043929 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_inner.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_side.png new file mode 100644 index 0000000..634f54a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_top_normal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_top_normal.png new file mode 100644 index 0000000..eeaadab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_top_normal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_top_sticky.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_top_sticky.png new file mode 100644 index 0000000..6ddd4ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/piston_top_sticky.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_acacia.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_acacia.png new file mode 100644 index 0000000..6858c51 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_acacia.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_big_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_big_oak.png new file mode 100644 index 0000000..e3fd4ea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_big_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_birch.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_birch.png new file mode 100644 index 0000000..b113e3a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_birch.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_jungle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_jungle.png new file mode 100644 index 0000000..e3fe82d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_jungle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_oak.png new file mode 100644 index 0000000..346f77d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_spruce.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_spruce.png new file mode 100644 index 0000000..f45fa94 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/planks_spruce.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/portal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/portal.png new file mode 100644 index 0000000..96859e2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/portal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/portal.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/portal.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/portal.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png new file mode 100644 index 0000000..d7e8185 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png new file mode 100644 index 0000000..ecef025 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png new file mode 100644 index 0000000..907f499 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_side.png new file mode 100644 index 0000000..75dfc47 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_top.png new file mode 100644 index 0000000..297ce3c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/pumpkin_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png new file mode 100644 index 0000000..7e16c7c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png new file mode 100644 index 0000000..80465a1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png new file mode 100644 index 0000000..44073e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines.png new file mode 100644 index 0000000..184ecd2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png new file mode 100644 index 0000000..6d20379 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_side.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_top.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_block_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_ore.png new file mode 100644 index 0000000..4d758c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/quartz_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_activator.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_activator.png new file mode 100644 index 0000000..ce115ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_activator.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_activator_powered.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_activator_powered.png new file mode 100644 index 0000000..a3aaca9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_activator_powered.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_detector.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_detector.png new file mode 100644 index 0000000..92c1466 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_detector.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_detector_powered.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_detector_powered.png new file mode 100644 index 0000000..a1c6e6b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_detector_powered.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_golden.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_golden.png new file mode 100644 index 0000000..1fc52c3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_golden.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_golden_powered.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_golden_powered.png new file mode 100644 index 0000000..bd343be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_golden_powered.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_normal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_normal.png new file mode 100644 index 0000000..d609236 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_normal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_normal_turned.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_normal_turned.png new file mode 100644 index 0000000..f394a23 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/rail_normal_turned.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/red_sand.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/red_sand.png new file mode 100644 index 0000000..b216a42 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/red_sand.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_block.png new file mode 100644 index 0000000..fcf6b40 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png new file mode 100644 index 0000000..dcec893 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png new file mode 100644 index 0000000..96729e1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line.png new file mode 100644 index 0000000..ff0fb23 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png new file mode 100644 index 0000000..96729e1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png new file mode 100644 index 0000000..522765b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png new file mode 100644 index 0000000..9562ef3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_ore.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_ore.png new file mode 100644 index 0000000..575a488 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_ore.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_off.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_off.png new file mode 100644 index 0000000..635eabd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_off.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_on.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_on.png new file mode 100644 index 0000000..2983d6c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/redstone_torch_on.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/reeds.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/reeds.png new file mode 100644 index 0000000..64bbfe0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/reeds.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/repeater_off.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/repeater_off.png new file mode 100644 index 0000000..8634669 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/repeater_off.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/repeater_on.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/repeater_on.png new file mode 100644 index 0000000..d71d0d9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/repeater_on.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sand.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sand.png new file mode 100644 index 0000000..86b9654 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sand.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_bottom.png new file mode 100644 index 0000000..e102220 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_carved.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_carved.png new file mode 100644 index 0000000..9bd7fa1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_carved.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_normal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_normal.png new file mode 100644 index 0000000..1b79145 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_normal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_smooth.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_smooth.png new file mode 100644 index 0000000..ef118bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_smooth.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_top.png new file mode 100644 index 0000000..bb5b157 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sandstone_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_acacia.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_acacia.png new file mode 100644 index 0000000..a1215cb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_acacia.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_birch.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_birch.png new file mode 100644 index 0000000..b0dacc5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_birch.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_jungle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_jungle.png new file mode 100644 index 0000000..4e10b35 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_jungle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_oak.png new file mode 100644 index 0000000..1bf1bfa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png new file mode 100644 index 0000000..dcf5588 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_spruce.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_spruce.png new file mode 100644 index 0000000..5767d48 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sapling_spruce.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/snow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/snow.png new file mode 100644 index 0000000..5c146cd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/snow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/soul_sand.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/soul_sand.png new file mode 100644 index 0000000..fca7e8f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/soul_sand.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sponge.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sponge.png new file mode 100644 index 0000000..a850804 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/sponge.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone.png new file mode 100644 index 0000000..87e19ff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone_slab_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone_slab_side.png new file mode 100644 index 0000000..fe2a204 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone_slab_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone_slab_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone_slab_top.png new file mode 100644 index 0000000..090657d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stone_slab_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick.png new file mode 100644 index 0000000..69138cf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_carved.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_carved.png new file mode 100644 index 0000000..b7e88db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_carved.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png new file mode 100644 index 0000000..918a884 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png new file mode 100644 index 0000000..5b9fe37 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tallgrass.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tallgrass.png new file mode 100644 index 0000000..65209fa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tallgrass.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_bottom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_bottom.png new file mode 100644 index 0000000..cc2e586 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_bottom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_side.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_side.png new file mode 100644 index 0000000..21109fb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_side.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_top.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_top.png new file mode 100644 index 0000000..ceb44b6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/tnt_top.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/torch_on.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/torch_on.png new file mode 100644 index 0000000..a2ce41b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/torch_on.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trapdoor.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trapdoor.png new file mode 100644 index 0000000..a7dcccc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trapdoor.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire.png new file mode 100644 index 0000000..6a9a72b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire_full.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire_full.png new file mode 100644 index 0000000..fd321f7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire_full.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire_source.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire_source.png new file mode 100644 index 0000000..fbd464d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/trip_wire_source.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/vine.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/vine.png new file mode 100644 index 0000000..df5e435 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/vine.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_flow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_flow.png new file mode 100644 index 0000000..e72280c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_flow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_still.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_still.png new file mode 100644 index 0000000..c7e90b0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_still.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/waterlily.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/waterlily.png new file mode 100644 index 0000000..f6c84f8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/waterlily.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/web.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/web.png new file mode 100644 index 0000000..7c097f1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/web.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_0.png new file mode 100644 index 0000000..185af6f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_1.png new file mode 100644 index 0000000..67588c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_2.png new file mode 100644 index 0000000..3d33792 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_3.png new file mode 100644 index 0000000..4649f78 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_4.png new file mode 100644 index 0000000..ac04b52 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_5.png new file mode 100644 index 0000000..1ea81ac Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_6.png new file mode 100644 index 0000000..cb5f195 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_7.png new file mode 100644 index 0000000..7acafb3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wheat_stage_7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_black.png new file mode 100644 index 0000000..b74d5c9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_blue.png new file mode 100644 index 0000000..ce9515f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_brown.png new file mode 100644 index 0000000..b4dc3c5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png new file mode 100644 index 0000000..ca0800a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_gray.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_gray.png new file mode 100644 index 0000000..6409ff2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_gray.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_green.png new file mode 100644 index 0000000..a7be6d7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png new file mode 100644 index 0000000..72d9d9e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_lime.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_lime.png new file mode 100644 index 0000000..bf56389 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_lime.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png new file mode 100644 index 0000000..3af6747 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_orange.png new file mode 100644 index 0000000..eefe6de Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_pink.png new file mode 100644 index 0000000..c2785af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_purple.png new file mode 100644 index 0000000..76f68d6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_red.png new file mode 100644 index 0000000..0cff7a9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_silver.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_silver.png new file mode 100644 index 0000000..756d9b0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_silver.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_white.png new file mode 100644 index 0000000..abc7999 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png new file mode 100644 index 0000000..4babaaa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/colormap/foliage.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/colormap/foliage.png new file mode 100644 index 0000000..dcc119e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/colormap/foliage.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/colormap/grass.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/colormap/grass.png new file mode 100644 index 0000000..484a9a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/colormap/grass.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/effect/dither.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/effect/dither.png new file mode 100644 index 0000000..19ba7e4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/effect/dither.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/arrow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/arrow.png new file mode 100644 index 0000000..3afa604 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/arrow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/bat.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/bat.png new file mode 100644 index 0000000..803860e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/bat.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/beacon_beam.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/beacon_beam.png new file mode 100644 index 0000000..67545b4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/beacon_beam.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/blaze.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/blaze.png new file mode 100644 index 0000000..19cdbb5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/blaze.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/boat.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/boat.png new file mode 100644 index 0000000..9b58965 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/boat.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/black.png new file mode 100644 index 0000000..422908f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/ocelot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/ocelot.png new file mode 100644 index 0000000..6b5064e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/ocelot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/red.png new file mode 100644 index 0000000..17b6de5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/siamese.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/siamese.png new file mode 100644 index 0000000..cfed948 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cat/siamese.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/christmas.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/christmas.png new file mode 100644 index 0000000..4459112 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/christmas.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/christmas_double.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/christmas_double.png new file mode 100644 index 0000000..9e44eeb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/christmas_double.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/ender.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/ender.png new file mode 100644 index 0000000..3631d0d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/ender.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/normal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/normal.png new file mode 100644 index 0000000..2e3d7fd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/normal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/normal_double.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/normal_double.png new file mode 100644 index 0000000..0168338 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/normal_double.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/trapped.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/trapped.png new file mode 100644 index 0000000..3aef190 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/trapped.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/trapped_double.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/trapped_double.png new file mode 100644 index 0000000..00eebe5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chest/trapped_double.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chicken.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chicken.png new file mode 100644 index 0000000..e24d550 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/chicken.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cow/cow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cow/cow.png new file mode 100644 index 0000000..f1320c3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cow/cow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cow/mooshroom.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cow/mooshroom.png new file mode 100644 index 0000000..905f160 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/cow/mooshroom.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/creeper/creeper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/creeper/creeper.png new file mode 100644 index 0000000..abdb540 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/creeper/creeper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png new file mode 100644 index 0000000..119f6ff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enchanting_table_book.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enchanting_table_book.png new file mode 100644 index 0000000..619e7a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enchanting_table_book.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/end_portal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/end_portal.png new file mode 100644 index 0000000..d5d8569 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/end_portal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png new file mode 100644 index 0000000..8b3668a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png new file mode 100644 index 0000000..1259a5d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon.png new file mode 100644 index 0000000..b8a680c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png new file mode 100644 index 0000000..ca5c949 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png new file mode 100644 index 0000000..147b303 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderman/enderman.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderman/enderman.png new file mode 100644 index 0000000..ab23cb9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderman/enderman.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png new file mode 100644 index 0000000..0804402 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/experience_orb.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/experience_orb.png new file mode 100644 index 0000000..92f9d0f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/experience_orb.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/explosion.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/explosion.png new file mode 100644 index 0000000..c309409 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/explosion.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/ghast/ghast.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/ghast/ghast.png new file mode 100644 index 0000000..dd63bc1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/ghast/ghast.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png new file mode 100644 index 0000000..5d9be29 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png new file mode 100644 index 0000000..39068f2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png new file mode 100644 index 0000000..4a0786d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png new file mode 100644 index 0000000..533b2dd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/donkey.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/donkey.png new file mode 100644 index 0000000..b94bc63 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/donkey.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_black.png new file mode 100644 index 0000000..dde716e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_brown.png new file mode 100644 index 0000000..ec0158f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png new file mode 100644 index 0000000..40322ff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_creamy.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_creamy.png new file mode 100644 index 0000000..bc42bcc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_creamy.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png new file mode 100644 index 0000000..b38e914 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_gray.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_gray.png new file mode 100644 index 0000000..4987532 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_gray.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png new file mode 100644 index 0000000..7320648 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png new file mode 100644 index 0000000..b1f0a69 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png new file mode 100644 index 0000000..20e1954 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png new file mode 100644 index 0000000..baa2c06 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png new file mode 100644 index 0000000..29d4ed5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_white.png new file mode 100644 index 0000000..e90e6e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_zombie.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_zombie.png new file mode 100644 index 0000000..22d55fa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/horse_zombie.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/mule.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/mule.png new file mode 100644 index 0000000..241bdaa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/horse/mule.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/iron_golem.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/iron_golem.png new file mode 100644 index 0000000..f9f6465 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/iron_golem.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/lead_knot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/lead_knot.png new file mode 100644 index 0000000..ab4d3b3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/lead_knot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/minecart.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/minecart.png new file mode 100644 index 0000000..7ad7b54 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/minecart.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/pig/pig.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/pig/pig.png new file mode 100644 index 0000000..0a9532f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/pig/pig.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/pig/pig_saddle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/pig/pig_saddle.png new file mode 100644 index 0000000..640ea76 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/pig/pig_saddle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sheep/sheep.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sheep/sheep.png new file mode 100644 index 0000000..d9fe93f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sheep/sheep.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png new file mode 100644 index 0000000..623340b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sign.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sign.png new file mode 100644 index 0000000..e22e2f7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/sign.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/silverfish.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/silverfish.png new file mode 100644 index 0000000..416fa16 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/silverfish.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/skeleton/skeleton.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/skeleton/skeleton.png new file mode 100644 index 0000000..184b585 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/skeleton/skeleton.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png new file mode 100644 index 0000000..b0db19d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/slime/magmacube.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/slime/magmacube.png new file mode 100644 index 0000000..c1b397f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/slime/magmacube.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/slime/slime.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/slime/slime.png new file mode 100644 index 0000000..96edcf6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/slime/slime.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/snowman.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/snowman.png new file mode 100644 index 0000000..568d5f6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/snowman.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider/cave_spider.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider/cave_spider.png new file mode 100644 index 0000000..934f1ea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider/cave_spider.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider/spider.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider/spider.png new file mode 100644 index 0000000..3a8c779 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider/spider.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider_eyes.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider_eyes.png new file mode 100644 index 0000000..6b80a06 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/spider_eyes.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/squid.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/squid.png new file mode 100644 index 0000000..f285388 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/squid.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/steve.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/steve.png new file mode 100644 index 0000000..6650185 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/steve.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/butcher.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/butcher.png new file mode 100644 index 0000000..f1c07d4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/butcher.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/farmer.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/farmer.png new file mode 100644 index 0000000..970c179 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/farmer.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/librarian.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/librarian.png new file mode 100644 index 0000000..b071cd3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/librarian.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/priest.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/priest.png new file mode 100644 index 0000000..35054ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/priest.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/smith.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/smith.png new file mode 100644 index 0000000..965da7f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/smith.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/villager.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/villager.png new file mode 100644 index 0000000..52de8e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/villager/villager.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/witch.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/witch.png new file mode 100644 index 0000000..2403570 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/witch.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither.png new file mode 100644 index 0000000..0882d05 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither_armor.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither_armor.png new file mode 100644 index 0000000..a6b5cf5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither_armor.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png new file mode 100644 index 0000000..717750b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf.png new file mode 100644 index 0000000..f37ef81 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png new file mode 100644 index 0000000..7891ce9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png new file mode 100644 index 0000000..ae1c920 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png new file mode 100644 index 0000000..f1236d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie/zombie.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie/zombie.png new file mode 100644 index 0000000..22ff8f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie/zombie.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png new file mode 100644 index 0000000..349f9c2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie_pigman.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie_pigman.png new file mode 100644 index 0000000..e95cc4c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/entity/zombie_pigman.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/clouds.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/clouds.png new file mode 100644 index 0000000..a67c44d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/clouds.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/end_sky.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/end_sky.png new file mode 100644 index 0000000..094b309 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/end_sky.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/moon_phases.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/moon_phases.png new file mode 100644 index 0000000..cdba8d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/moon_phases.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/rain.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/rain.png new file mode 100644 index 0000000..2dc4b1c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/rain.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/snow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/snow.png new file mode 100644 index 0000000..1898903 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/snow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/sun.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/sun.png new file mode 100644 index 0000000..08de644 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/environment/sun.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/ascii.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/ascii.png new file mode 100644 index 0000000..587966d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/ascii.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/ascii_sga.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/ascii_sga.png new file mode 100644 index 0000000..f443b4a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/ascii_sga.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_00.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_00.png new file mode 100644 index 0000000..44fd12f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_00.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_01.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_01.png new file mode 100644 index 0000000..ddac030 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_01.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_02.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_02.png new file mode 100644 index 0000000..dc1335a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_02.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_03.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_03.png new file mode 100644 index 0000000..6ff0257 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_03.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_04.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_04.png new file mode 100644 index 0000000..be3e833 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_04.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_05.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_05.png new file mode 100644 index 0000000..9b58804 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_05.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_06.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_06.png new file mode 100644 index 0000000..ed74e78 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_06.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_07.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_07.png new file mode 100644 index 0000000..b532177 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_07.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_09.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_09.png new file mode 100644 index 0000000..083b911 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_09.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0a.png new file mode 100644 index 0000000..0190c11 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0b.png new file mode 100644 index 0000000..4d0af48 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0c.png new file mode 100644 index 0000000..773297d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0d.png new file mode 100644 index 0000000..5f52231 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0e.png new file mode 100644 index 0000000..531ca7d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0f.png new file mode 100644 index 0000000..7b879fc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_0f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_10.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_10.png new file mode 100644 index 0000000..53f056c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_10.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_11.png new file mode 100644 index 0000000..a9d5c11 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_12.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_12.png new file mode 100644 index 0000000..d20a864 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_12.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_13.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_13.png new file mode 100644 index 0000000..bbb0641 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_13.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_14.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_14.png new file mode 100644 index 0000000..ffd8e42 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_14.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_15.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_15.png new file mode 100644 index 0000000..ccfcae6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_15.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_16.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_16.png new file mode 100644 index 0000000..d02c557 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_16.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_17.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_17.png new file mode 100644 index 0000000..fed5b6e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_17.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_18.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_18.png new file mode 100644 index 0000000..97394d0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_18.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_19.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_19.png new file mode 100644 index 0000000..6929413 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_19.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1a.png new file mode 100644 index 0000000..d3a1b98 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1b.png new file mode 100644 index 0000000..9e0adf7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1c.png new file mode 100644 index 0000000..14d4890 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1d.png new file mode 100644 index 0000000..1924226 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1e.png new file mode 100644 index 0000000..cce20e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1f.png new file mode 100644 index 0000000..bdaf22f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_1f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_20.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_20.png new file mode 100644 index 0000000..ba948e9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_20.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_21.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_21.png new file mode 100644 index 0000000..998f2f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_21.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_22.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_22.png new file mode 100644 index 0000000..c3fd5dd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_22.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_23.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_23.png new file mode 100644 index 0000000..9c2b2dc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_23.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_24.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_24.png new file mode 100644 index 0000000..d6cc8ae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_24.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_25.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_25.png new file mode 100644 index 0000000..ee7535d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_25.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_26.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_26.png new file mode 100644 index 0000000..93aa960 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_26.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_27.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_27.png new file mode 100644 index 0000000..92f4501 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_27.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_28.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_28.png new file mode 100644 index 0000000..5f96e1b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_28.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_29.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_29.png new file mode 100644 index 0000000..4558220 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_29.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2a.png new file mode 100644 index 0000000..87e0e0c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2b.png new file mode 100644 index 0000000..722edf0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2c.png new file mode 100644 index 0000000..51830f7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2d.png new file mode 100644 index 0000000..dfafa53 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2e.png new file mode 100644 index 0000000..2aea04b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2f.png new file mode 100644 index 0000000..bff5f8e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_2f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_30.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_30.png new file mode 100644 index 0000000..5ccba75 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_30.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_31.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_31.png new file mode 100644 index 0000000..44fc5e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_31.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_32.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_32.png new file mode 100644 index 0000000..4858d08 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_32.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_33.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_33.png new file mode 100644 index 0000000..ab67072 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_33.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_34.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_34.png new file mode 100644 index 0000000..fd8fca9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_34.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_35.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_35.png new file mode 100644 index 0000000..603dc02 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_35.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_36.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_36.png new file mode 100644 index 0000000..778c190 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_36.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_37.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_37.png new file mode 100644 index 0000000..3032a23 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_37.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_38.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_38.png new file mode 100644 index 0000000..9b637bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_38.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_39.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_39.png new file mode 100644 index 0000000..2f93850 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_39.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3a.png new file mode 100644 index 0000000..cdf4944 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3b.png new file mode 100644 index 0000000..10e8502 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3c.png new file mode 100644 index 0000000..022fea5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3d.png new file mode 100644 index 0000000..01ea1d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3e.png new file mode 100644 index 0000000..3bdf7f8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3f.png new file mode 100644 index 0000000..3fd5249 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_3f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_40.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_40.png new file mode 100644 index 0000000..544f89e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_40.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_41.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_41.png new file mode 100644 index 0000000..729fdaf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_41.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_42.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_42.png new file mode 100644 index 0000000..755e546 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_42.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_43.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_43.png new file mode 100644 index 0000000..6069d0d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_43.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_44.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_44.png new file mode 100644 index 0000000..845c364 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_44.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_45.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_45.png new file mode 100644 index 0000000..294c78d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_45.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_46.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_46.png new file mode 100644 index 0000000..ee5e629 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_46.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_47.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_47.png new file mode 100644 index 0000000..55cb0c0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_47.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_48.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_48.png new file mode 100644 index 0000000..7652211 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_48.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_49.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_49.png new file mode 100644 index 0000000..b736232 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_49.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4a.png new file mode 100644 index 0000000..d3419bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4b.png new file mode 100644 index 0000000..5e02ad3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4c.png new file mode 100644 index 0000000..11c6b31 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4d.png new file mode 100644 index 0000000..3eb224a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4e.png new file mode 100644 index 0000000..11a78ba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4f.png new file mode 100644 index 0000000..b4c9fab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_4f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_50.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_50.png new file mode 100644 index 0000000..ff73d23 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_50.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_51.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_51.png new file mode 100644 index 0000000..6e0eae9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_51.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_52.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_52.png new file mode 100644 index 0000000..6f10fcb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_52.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_53.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_53.png new file mode 100644 index 0000000..60d478e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_53.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_54.png new file mode 100644 index 0000000..ac75bdd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_55.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_55.png new file mode 100644 index 0000000..3d122d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_55.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_56.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_56.png new file mode 100644 index 0000000..576d07f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_56.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_57.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_57.png new file mode 100644 index 0000000..545da73 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_57.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_58.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_58.png new file mode 100644 index 0000000..941542e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_58.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_59.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_59.png new file mode 100644 index 0000000..56f0102 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_59.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5a.png new file mode 100644 index 0000000..c14f1b1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5b.png new file mode 100644 index 0000000..f418e4c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5c.png new file mode 100644 index 0000000..e7efae6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5d.png new file mode 100644 index 0000000..7355fd3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5e.png new file mode 100644 index 0000000..abfd3af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5f.png new file mode 100644 index 0000000..5a64b50 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_5f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_60.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_60.png new file mode 100644 index 0000000..8166f15 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_60.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_61.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_61.png new file mode 100644 index 0000000..d11cd8a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_61.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_62.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_62.png new file mode 100644 index 0000000..f7b9a5b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_62.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_63.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_63.png new file mode 100644 index 0000000..5d4a8cc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_63.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_64.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_64.png new file mode 100644 index 0000000..bc43210 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_64.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_65.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_65.png new file mode 100644 index 0000000..42144c1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_65.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_66.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_66.png new file mode 100644 index 0000000..a65f25e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_66.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_67.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_67.png new file mode 100644 index 0000000..a115bb8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_67.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_68.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_68.png new file mode 100644 index 0000000..d47938b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_68.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_69.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_69.png new file mode 100644 index 0000000..c36e640 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_69.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6a.png new file mode 100644 index 0000000..5265d07 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6b.png new file mode 100644 index 0000000..6f207cc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6c.png new file mode 100644 index 0000000..6ffad7e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6d.png new file mode 100644 index 0000000..0fa88e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6e.png new file mode 100644 index 0000000..301513e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6f.png new file mode 100644 index 0000000..a24cfff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_6f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_70.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_70.png new file mode 100644 index 0000000..2cec746 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_70.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_71.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_71.png new file mode 100644 index 0000000..1592ff4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_71.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_72.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_72.png new file mode 100644 index 0000000..856eedc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_72.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_73.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_73.png new file mode 100644 index 0000000..a7a2151 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_73.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_74.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_74.png new file mode 100644 index 0000000..a1b034a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_74.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_75.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_75.png new file mode 100644 index 0000000..512dc16 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_75.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_76.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_76.png new file mode 100644 index 0000000..12a45ff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_76.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_77.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_77.png new file mode 100644 index 0000000..d763fba Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_77.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_78.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_78.png new file mode 100644 index 0000000..846c060 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_78.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_79.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_79.png new file mode 100644 index 0000000..f887cae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_79.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7a.png new file mode 100644 index 0000000..90d5561 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7b.png new file mode 100644 index 0000000..2932cee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7c.png new file mode 100644 index 0000000..416a21b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7d.png new file mode 100644 index 0000000..2e12e13 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7e.png new file mode 100644 index 0000000..952bfab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7f.png new file mode 100644 index 0000000..d3d275c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_7f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_80.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_80.png new file mode 100644 index 0000000..044ac3e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_80.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_81.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_81.png new file mode 100644 index 0000000..913a4ca Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_81.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_82.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_82.png new file mode 100644 index 0000000..19b8ded Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_82.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_83.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_83.png new file mode 100644 index 0000000..ef2d794 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_83.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_84.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_84.png new file mode 100644 index 0000000..74a6a53 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_84.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_85.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_85.png new file mode 100644 index 0000000..73cb2f9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_85.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_86.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_86.png new file mode 100644 index 0000000..135d6fc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_86.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_87.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_87.png new file mode 100644 index 0000000..bef88db Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_87.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_88.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_88.png new file mode 100644 index 0000000..698ff80 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_88.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_89.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_89.png new file mode 100644 index 0000000..a3820ee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_89.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8a.png new file mode 100644 index 0000000..beb9024 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8b.png new file mode 100644 index 0000000..7f978ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8c.png new file mode 100644 index 0000000..3ed4594 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8d.png new file mode 100644 index 0000000..8d79123 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8e.png new file mode 100644 index 0000000..d82000b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8f.png new file mode 100644 index 0000000..b8c8328 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_8f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_90.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_90.png new file mode 100644 index 0000000..132974b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_90.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_91.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_91.png new file mode 100644 index 0000000..b8e09ae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_91.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_92.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_92.png new file mode 100644 index 0000000..9244661 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_92.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_93.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_93.png new file mode 100644 index 0000000..f71d835 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_93.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_94.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_94.png new file mode 100644 index 0000000..fa68d81 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_94.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_95.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_95.png new file mode 100644 index 0000000..346bc36 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_95.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_96.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_96.png new file mode 100644 index 0000000..bbd1772 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_96.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_97.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_97.png new file mode 100644 index 0000000..2fd136b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_97.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_98.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_98.png new file mode 100644 index 0000000..9319c0b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_98.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_99.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_99.png new file mode 100644 index 0000000..2bb7f3e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_99.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9a.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9a.png new file mode 100644 index 0000000..cbdd91e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9a.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9b.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9b.png new file mode 100644 index 0000000..8a96209 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9b.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9c.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9c.png new file mode 100644 index 0000000..8e977ff Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9c.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9d.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9d.png new file mode 100644 index 0000000..5041d6a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9d.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9e.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9e.png new file mode 100644 index 0000000..1cb0a5b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9e.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9f.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9f.png new file mode 100644 index 0000000..d987326 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_9f.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a0.png new file mode 100644 index 0000000..8c47db0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a1.png new file mode 100644 index 0000000..5ede7e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a2.png new file mode 100644 index 0000000..a8c6ac1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a3.png new file mode 100644 index 0000000..7cc8448 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a4.png new file mode 100644 index 0000000..dc00e27 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a5.png new file mode 100644 index 0000000..eccfa47 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a6.png new file mode 100644 index 0000000..dcac87f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a7.png new file mode 100644 index 0000000..76c1ce2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a8.png new file mode 100644 index 0000000..a022390 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a9.png new file mode 100644 index 0000000..a35159a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_a9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_aa.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_aa.png new file mode 100644 index 0000000..da1b615 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_aa.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ab.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ab.png new file mode 100644 index 0000000..0e45eae Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ab.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ac.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ac.png new file mode 100644 index 0000000..04d4d59 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ac.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ad.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ad.png new file mode 100644 index 0000000..3834337 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ad.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ae.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ae.png new file mode 100644 index 0000000..1445e68 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ae.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_af.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_af.png new file mode 100644 index 0000000..ea945dc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_af.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b0.png new file mode 100644 index 0000000..84b4885 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b1.png new file mode 100644 index 0000000..5f64672 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b2.png new file mode 100644 index 0000000..8551db8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b3.png new file mode 100644 index 0000000..b954159 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b4.png new file mode 100644 index 0000000..65991a4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b5.png new file mode 100644 index 0000000..3e6391b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b6.png new file mode 100644 index 0000000..df7c0f7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b7.png new file mode 100644 index 0000000..9142cad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b8.png new file mode 100644 index 0000000..5b18d12 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b9.png new file mode 100644 index 0000000..0d212f0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_b9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ba.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ba.png new file mode 100644 index 0000000..696cca9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ba.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bb.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bb.png new file mode 100644 index 0000000..5a2544c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bb.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bc.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bc.png new file mode 100644 index 0000000..df37526 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bc.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bd.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bd.png new file mode 100644 index 0000000..aed7803 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bd.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_be.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_be.png new file mode 100644 index 0000000..0da2254 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_be.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bf.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bf.png new file mode 100644 index 0000000..1f6a248 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_bf.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c0.png new file mode 100644 index 0000000..0610d67 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c1.png new file mode 100644 index 0000000..a95ca9b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c2.png new file mode 100644 index 0000000..f6a8961 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c3.png new file mode 100644 index 0000000..6470dd8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c4.png new file mode 100644 index 0000000..e8c3105 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c5.png new file mode 100644 index 0000000..d89f288 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c6.png new file mode 100644 index 0000000..004091d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c7.png new file mode 100644 index 0000000..f64f6b4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c8.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c8.png new file mode 100644 index 0000000..75f8a50 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c8.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c9.png new file mode 100644 index 0000000..fbd9435 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_c9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ca.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ca.png new file mode 100644 index 0000000..112b9c6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ca.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cb.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cb.png new file mode 100644 index 0000000..c0549b5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cb.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cc.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cc.png new file mode 100644 index 0000000..0684431 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cc.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cd.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cd.png new file mode 100644 index 0000000..9fdc54d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cd.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ce.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ce.png new file mode 100644 index 0000000..958a96b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ce.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cf.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cf.png new file mode 100644 index 0000000..4106f1b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_cf.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d0.png new file mode 100644 index 0000000..546b014 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d1.png new file mode 100644 index 0000000..6d67bf1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d2.png new file mode 100644 index 0000000..c4ae511 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d3.png new file mode 100644 index 0000000..576c9ea Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d4.png new file mode 100644 index 0000000..14be6c7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d5.png new file mode 100644 index 0000000..3c41836 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d6.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d6.png new file mode 100644 index 0000000..27424b1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d6.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d7.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d7.png new file mode 100644 index 0000000..d8772d8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_d7.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_f9.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_f9.png new file mode 100644 index 0000000..e723235 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_f9.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fa.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fa.png new file mode 100644 index 0000000..d78dcfe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fa.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fb.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fb.png new file mode 100644 index 0000000..5423c86 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fb.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fc.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fc.png new file mode 100644 index 0000000..8034140 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fc.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fd.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fd.png new file mode 100644 index 0000000..c31bd6f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fd.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fe.png new file mode 100644 index 0000000..42ed33e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_fe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ff.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ff.png new file mode 100644 index 0000000..f0ff742 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/font/unicode_page_ff.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_background.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_background.png new file mode 100644 index 0000000..921bce0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_background.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png new file mode 100644 index 0000000..8c4ae79 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/book.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/book.png new file mode 100644 index 0000000..3e4ba4e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/book.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/compass.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/compass.png new file mode 100644 index 0000000..e2f91cf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/compass.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/anvil.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/anvil.png new file mode 100644 index 0000000..34e8f9f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/anvil.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/beacon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/beacon.png new file mode 100644 index 0000000..f51a2ef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/beacon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/brewing_stand.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/brewing_stand.png new file mode 100644 index 0000000..e7dc203 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/brewing_stand.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/crafting_table.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/crafting_table.png new file mode 100644 index 0000000..254dacc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/crafting_table.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png new file mode 100644 index 0000000..c8d53a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png new file mode 100644 index 0000000..cc250e5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png new file mode 100644 index 0000000..38421f7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png new file mode 100644 index 0000000..1c44093 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/dispenser.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/dispenser.png new file mode 100644 index 0000000..0a6ebe7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/dispenser.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/enchanting_table.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/enchanting_table.png new file mode 100644 index 0000000..59aeb04 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/enchanting_table.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/furnace.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/furnace.png new file mode 100644 index 0000000..2255d0a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/furnace.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/generic_54.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/generic_54.png new file mode 100644 index 0000000..0b880ef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/generic_54.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/hopper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/hopper.png new file mode 100644 index 0000000..3d00547 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/hopper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/horse.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/horse.png new file mode 100644 index 0000000..194cc6b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/horse.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/inventory.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/inventory.png new file mode 100644 index 0000000..d553c4f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/inventory.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/stats_icons.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/stats_icons.png new file mode 100644 index 0000000..f13323b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/stats_icons.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/villager.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/villager.png new file mode 100644 index 0000000..3211a7a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/container/villager.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/demo_background.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/demo_background.png new file mode 100644 index 0000000..a7fd8be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/demo_background.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/icons.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/icons.png new file mode 100644 index 0000000..8aec716 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/icons.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/options_background.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/options_background.png new file mode 100644 index 0000000..cae5528 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/options_background.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/resource_packs.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/resource_packs.png new file mode 100644 index 0000000..15a80bd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/resource_packs.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/stream_indicator.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/stream_indicator.png new file mode 100644 index 0000000..b426b7e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/stream_indicator.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png new file mode 100644 index 0000000..27f015d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png new file mode 100644 index 0000000..c16841a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png new file mode 100644 index 0000000..0436d77 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png new file mode 100644 index 0000000..2c7ad77 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_3.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png new file mode 100644 index 0000000..0390096 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_4.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png new file mode 100644 index 0000000..0331ad4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/background/panorama_5.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/minecraft.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/minecraft.png new file mode 100644 index 0000000..b393bd9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/minecraft.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/mojang.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/mojang.png new file mode 100644 index 0000000..a82cf6c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/title/mojang.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/widgets.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/widgets.png new file mode 100644 index 0000000..e1194d4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/gui/widgets.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/apple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/apple.png new file mode 100644 index 0000000..3e2ee59 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/apple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/apple_golden.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/apple_golden.png new file mode 100644 index 0000000..6201989 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/apple_golden.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/arrow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/arrow.png new file mode 100644 index 0000000..4f748a0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/arrow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bed.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bed.png new file mode 100644 index 0000000..22a4cf0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bed.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/beef_cooked.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/beef_cooked.png new file mode 100644 index 0000000..a1c765a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/beef_cooked.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/beef_raw.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/beef_raw.png new file mode 100644 index 0000000..82af4e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/beef_raw.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/blaze_powder.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/blaze_powder.png new file mode 100644 index 0000000..89c57d6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/blaze_powder.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/blaze_rod.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/blaze_rod.png new file mode 100644 index 0000000..7050e10 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/blaze_rod.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/boat.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/boat.png new file mode 100644 index 0000000..235e0a2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/boat.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bone.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bone.png new file mode 100644 index 0000000..3faca89 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bone.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_enchanted.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_enchanted.png new file mode 100644 index 0000000..44215f6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_enchanted.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_normal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_normal.png new file mode 100644 index 0000000..f791ae4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_normal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_writable.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_writable.png new file mode 100644 index 0000000..fa95246 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_writable.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_written.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_written.png new file mode 100644 index 0000000..b2a2aa8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/book_written.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_0.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_0.png new file mode 100644 index 0000000..2022aab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_0.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_1.png new file mode 100644 index 0000000..a132079 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_2.png new file mode 100644 index 0000000..d459e68 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_pulling_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_standby.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_standby.png new file mode 100644 index 0000000..d709b9c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bow_standby.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bowl.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bowl.png new file mode 100644 index 0000000..63d16ad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bowl.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bread.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bread.png new file mode 100644 index 0000000..c833604 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bread.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/brewing_stand.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/brewing_stand.png new file mode 100644 index 0000000..97db9af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/brewing_stand.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/brick.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/brick.png new file mode 100644 index 0000000..11e74be Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/brick.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_empty.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_empty.png new file mode 100644 index 0000000..f8e5369 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_empty.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_lava.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_lava.png new file mode 100644 index 0000000..13a1957 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_lava.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_milk.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_milk.png new file mode 100644 index 0000000..c77d92c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_milk.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_water.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_water.png new file mode 100644 index 0000000..2f36acc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/bucket_water.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cake.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cake.png new file mode 100644 index 0000000..46e94b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cake.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot.png new file mode 100644 index 0000000..2d08aab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot_golden.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot_golden.png new file mode 100644 index 0000000..e0f1ea6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot_golden.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot_on_a_stick.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot_on_a_stick.png new file mode 100644 index 0000000..9e88571 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/carrot_on_a_stick.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cauldron.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cauldron.png new file mode 100644 index 0000000..e3186eb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cauldron.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_boots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_boots.png new file mode 100644 index 0000000..54a4a15 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_boots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_chestplate.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_chestplate.png new file mode 100644 index 0000000..cd2115a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_chestplate.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_helmet.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_helmet.png new file mode 100644 index 0000000..a143338 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_helmet.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_leggings.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_leggings.png new file mode 100644 index 0000000..dae4b26 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chainmail_leggings.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/charcoal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/charcoal.png new file mode 100644 index 0000000..20d5b25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/charcoal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chicken_cooked.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chicken_cooked.png new file mode 100644 index 0000000..890b5b3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chicken_cooked.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chicken_raw.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chicken_raw.png new file mode 100644 index 0000000..6d25922 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/chicken_raw.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clay_ball.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clay_ball.png new file mode 100644 index 0000000..5103d6c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clay_ball.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clock.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clock.png new file mode 100644 index 0000000..069a0ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clock.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clock.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clock.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/clock.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/coal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/coal.png new file mode 100644 index 0000000..5563b6f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/coal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/comparator.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/comparator.png new file mode 100644 index 0000000..28b8eec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/comparator.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/compass.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/compass.png new file mode 100644 index 0000000..9dcbdfe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/compass.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/compass.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/compass.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/compass.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cookie.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cookie.png new file mode 100644 index 0000000..01fe56b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/cookie.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond.png new file mode 100644 index 0000000..10e70a0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_axe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_axe.png new file mode 100644 index 0000000..7627f87 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_axe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_boots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_boots.png new file mode 100644 index 0000000..70d9e5f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_boots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_chestplate.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_chestplate.png new file mode 100644 index 0000000..afdff93 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_chestplate.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_helmet.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_helmet.png new file mode 100644 index 0000000..1c88592 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_helmet.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_hoe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_hoe.png new file mode 100644 index 0000000..c9a97e0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_hoe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_horse_armor.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_horse_armor.png new file mode 100644 index 0000000..b281aad Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_horse_armor.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_leggings.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_leggings.png new file mode 100644 index 0000000..a99c896 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_leggings.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_pickaxe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_pickaxe.png new file mode 100644 index 0000000..c279828 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_pickaxe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_shovel.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_shovel.png new file mode 100644 index 0000000..e4a8992 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_shovel.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_sword.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_sword.png new file mode 100644 index 0000000..2a1552d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/diamond_sword.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/door_iron.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/door_iron.png new file mode 100644 index 0000000..67877ab Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/door_iron.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/door_wood.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/door_wood.png new file mode 100644 index 0000000..750307f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/door_wood.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_black.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_black.png new file mode 100644 index 0000000..909bea5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_black.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_blue.png new file mode 100644 index 0000000..4713983 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_brown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_brown.png new file mode 100644 index 0000000..62eae8d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_brown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_cyan.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_cyan.png new file mode 100644 index 0000000..7b10c11 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_cyan.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_gray.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_gray.png new file mode 100644 index 0000000..4fce7e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_gray.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_green.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_green.png new file mode 100644 index 0000000..009e058 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_green.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_light_blue.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_light_blue.png new file mode 100644 index 0000000..a8b45c9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_light_blue.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_lime.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_lime.png new file mode 100644 index 0000000..7a78764 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_lime.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_magenta.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_magenta.png new file mode 100644 index 0000000..ea7342a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_magenta.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_orange.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_orange.png new file mode 100644 index 0000000..677a1aa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_orange.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_pink.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_pink.png new file mode 100644 index 0000000..1acc483 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_pink.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_purple.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_purple.png new file mode 100644 index 0000000..7d201c2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_purple.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_red.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_red.png new file mode 100644 index 0000000..2d1a742 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_red.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_silver.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_silver.png new file mode 100644 index 0000000..fa9e501 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_silver.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_white.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_white.png new file mode 100644 index 0000000..5b1833b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_white.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_yellow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_yellow.png new file mode 100644 index 0000000..95e0673 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/dye_powder_yellow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/egg.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/egg.png new file mode 100644 index 0000000..a6fe2bf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/egg.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/emerald.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/emerald.png new file mode 100644 index 0000000..98d953e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/emerald.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png new file mode 100644 index 0000000..fd7e05f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png new file mode 100644 index 0000000..6e632b9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png new file mode 100644 index 0000000..3a455f3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png new file mode 100644 index 0000000..28b2c49 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ender_eye.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ender_eye.png new file mode 100644 index 0000000..8c4ef4e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ender_eye.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ender_pearl.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ender_pearl.png new file mode 100644 index 0000000..4b752a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ender_pearl.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/experience_bottle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/experience_bottle.png new file mode 100644 index 0000000..ae4214f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/experience_bottle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/feather.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/feather.png new file mode 100644 index 0000000..d4c3be5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/feather.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireball.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireball.png new file mode 100644 index 0000000..d62a6f4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireball.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks.png new file mode 100644 index 0000000..f1e07fd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks_charge.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks_charge.png new file mode 100644 index 0000000..43a4a21 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks_charge.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png new file mode 100644 index 0000000..d8b91a9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_clownfish_raw.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_clownfish_raw.png new file mode 100644 index 0000000..41df72f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_clownfish_raw.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_cod_cooked.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_cod_cooked.png new file mode 100644 index 0000000..87564c7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_cod_cooked.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_cod_raw.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_cod_raw.png new file mode 100644 index 0000000..32996bf Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_cod_raw.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png new file mode 100644 index 0000000..aadbd88 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_salmon_cooked.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_salmon_cooked.png new file mode 100644 index 0000000..fb765ed Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_salmon_cooked.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_salmon_raw.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_salmon_raw.png new file mode 100644 index 0000000..68bcd69 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fish_salmon_raw.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fishing_rod_cast.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fishing_rod_cast.png new file mode 100644 index 0000000..a5ab378 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fishing_rod_cast.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fishing_rod_uncast.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fishing_rod_uncast.png new file mode 100644 index 0000000..d4b53f0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/fishing_rod_uncast.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flint.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flint.png new file mode 100644 index 0000000..5f51093 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flint.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flint_and_steel.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flint_and_steel.png new file mode 100644 index 0000000..77bc340 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flint_and_steel.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flower_pot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flower_pot.png new file mode 100644 index 0000000..c4f26d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/flower_pot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ghast_tear.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ghast_tear.png new file mode 100644 index 0000000..e5c741f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ghast_tear.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/glowstone_dust.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/glowstone_dust.png new file mode 100644 index 0000000..edd93a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/glowstone_dust.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_axe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_axe.png new file mode 100644 index 0000000..0f47b60 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_axe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_boots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_boots.png new file mode 100644 index 0000000..f6033d2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_boots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_chestplate.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_chestplate.png new file mode 100644 index 0000000..e36076a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_chestplate.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_helmet.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_helmet.png new file mode 100644 index 0000000..9eb89a0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_helmet.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_hoe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_hoe.png new file mode 100644 index 0000000..1685d47 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_hoe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_horse_armor.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_horse_armor.png new file mode 100644 index 0000000..7c5c3a5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_horse_armor.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_ingot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_ingot.png new file mode 100644 index 0000000..ea781e7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_ingot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_leggings.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_leggings.png new file mode 100644 index 0000000..da23771 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_leggings.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_nugget.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_nugget.png new file mode 100644 index 0000000..3a9a2fe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_nugget.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_pickaxe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_pickaxe.png new file mode 100644 index 0000000..ecccafe Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_pickaxe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_shovel.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_shovel.png new file mode 100644 index 0000000..150cbb9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_shovel.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_sword.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_sword.png new file mode 100644 index 0000000..0ddef04 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gold_sword.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gunpowder.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gunpowder.png new file mode 100644 index 0000000..73cadec Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/gunpowder.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/hopper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/hopper.png new file mode 100644 index 0000000..f8b244f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/hopper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_axe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_axe.png new file mode 100644 index 0000000..8bf133e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_axe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_boots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_boots.png new file mode 100644 index 0000000..b69ca05 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_boots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_chestplate.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_chestplate.png new file mode 100644 index 0000000..e7993ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_chestplate.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_helmet.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_helmet.png new file mode 100644 index 0000000..65e64cc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_helmet.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_hoe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_hoe.png new file mode 100644 index 0000000..28d4c36 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_hoe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_horse_armor.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_horse_armor.png new file mode 100644 index 0000000..5d697d1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_horse_armor.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_ingot.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_ingot.png new file mode 100644 index 0000000..3833fa0 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_ingot.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_leggings.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_leggings.png new file mode 100644 index 0000000..ad53673 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_leggings.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_pickaxe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_pickaxe.png new file mode 100644 index 0000000..d21440b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_pickaxe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_shovel.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_shovel.png new file mode 100644 index 0000000..079b236 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_shovel.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_sword.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_sword.png new file mode 100644 index 0000000..4d49c5a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/iron_sword.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/item_frame.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/item_frame.png new file mode 100644 index 0000000..261c98a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/item_frame.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/lead.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/lead.png new file mode 100644 index 0000000..0ef5312 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/lead.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather.png new file mode 100644 index 0000000..13dc199 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_boots.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_boots.png new file mode 100644 index 0000000..31c2132 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_boots.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_boots_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_boots_overlay.png new file mode 100644 index 0000000..b6896d8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_boots_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_chestplate.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_chestplate.png new file mode 100644 index 0000000..e534aef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_chestplate.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png new file mode 100644 index 0000000..125fd34 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_helmet.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_helmet.png new file mode 100644 index 0000000..da2cfa8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_helmet.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_helmet_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_helmet_overlay.png new file mode 100644 index 0000000..8040d77 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_helmet_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_leggings.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_leggings.png new file mode 100644 index 0000000..3ff24ee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_leggings.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_leggings_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_leggings_overlay.png new file mode 100644 index 0000000..813ba26 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/leather_leggings_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/magma_cream.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/magma_cream.png new file mode 100644 index 0000000..b2be210 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/magma_cream.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/map_empty.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/map_empty.png new file mode 100644 index 0000000..8dc6e58 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/map_empty.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/map_filled.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/map_filled.png new file mode 100644 index 0000000..1381e21 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/map_filled.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/melon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/melon.png new file mode 100644 index 0000000..590f47a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/melon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/melon_speckled.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/melon_speckled.png new file mode 100644 index 0000000..dee1bf5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/melon_speckled.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_chest.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_chest.png new file mode 100644 index 0000000..78a3778 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_chest.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_command_block.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_command_block.png new file mode 100644 index 0000000..c597ee7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_command_block.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_furnace.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_furnace.png new file mode 100644 index 0000000..5478f25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_furnace.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_hopper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_hopper.png new file mode 100644 index 0000000..8a138fb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_hopper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_normal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_normal.png new file mode 100644 index 0000000..2046f2b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_normal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_tnt.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_tnt.png new file mode 100644 index 0000000..561279b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/minecart_tnt.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/mushroom_stew.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/mushroom_stew.png new file mode 100644 index 0000000..5598bc7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/mushroom_stew.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/name_tag.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/name_tag.png new file mode 100644 index 0000000..a88f559 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/name_tag.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/nether_star.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/nether_star.png new file mode 100644 index 0000000..6b848af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/nether_star.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/nether_wart.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/nether_wart.png new file mode 100644 index 0000000..09da1e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/nether_wart.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/netherbrick.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/netherbrick.png new file mode 100644 index 0000000..e9c14ed Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/netherbrick.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/painting.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/painting.png new file mode 100644 index 0000000..b394f30 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/painting.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/paper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/paper.png new file mode 100644 index 0000000..a1d9c7e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/paper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/porkchop_cooked.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/porkchop_cooked.png new file mode 100644 index 0000000..605d3f5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/porkchop_cooked.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/porkchop_raw.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/porkchop_raw.png new file mode 100644 index 0000000..7e83c1a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/porkchop_raw.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato.png new file mode 100644 index 0000000..c1d8541 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato_baked.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato_baked.png new file mode 100644 index 0000000..e4d765b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato_baked.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato_poisonous.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato_poisonous.png new file mode 100644 index 0000000..6f154af Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potato_poisonous.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_empty.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_empty.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_empty.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_splash.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_splash.png new file mode 100644 index 0000000..03b1f90 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_bottle_splash.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_overlay.png new file mode 100644 index 0000000..1e6165e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/potion_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/pumpkin_pie.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/pumpkin_pie.png new file mode 100644 index 0000000..c21a032 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/pumpkin_pie.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/quartz.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/quartz.png new file mode 100644 index 0000000..e403446 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/quartz.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/quiver.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/quiver.png new file mode 100644 index 0000000..818f728 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/quiver.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_11.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_11.png new file mode 100644 index 0000000..07ac487 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_11.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_13.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_13.png new file mode 100644 index 0000000..ead0c61 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_13.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_blocks.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_blocks.png new file mode 100644 index 0000000..3732d6c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_blocks.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_cat.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_cat.png new file mode 100644 index 0000000..b3527ef Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_cat.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_chirp.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_chirp.png new file mode 100644 index 0000000..1b24e11 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_chirp.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_far.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_far.png new file mode 100644 index 0000000..2320efd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_far.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_mall.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_mall.png new file mode 100644 index 0000000..811d046 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_mall.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_mellohi.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_mellohi.png new file mode 100644 index 0000000..879b6a4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_mellohi.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_stal.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_stal.png new file mode 100644 index 0000000..c650d21 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_stal.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_strad.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_strad.png new file mode 100644 index 0000000..72d6e32 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_strad.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_wait.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_wait.png new file mode 100644 index 0000000..5306b51 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_wait.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_ward.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_ward.png new file mode 100644 index 0000000..b33b93d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/record_ward.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/redstone_dust.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/redstone_dust.png new file mode 100644 index 0000000..6da938b Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/redstone_dust.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/reeds.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/reeds.png new file mode 100644 index 0000000..40872c6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/reeds.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/repeater.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/repeater.png new file mode 100644 index 0000000..7a07381 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/repeater.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/rotten_flesh.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/rotten_flesh.png new file mode 100644 index 0000000..3f39998 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/rotten_flesh.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ruby.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ruby.png new file mode 100644 index 0000000..4f288d9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/ruby.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/saddle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/saddle.png new file mode 100644 index 0000000..b12eafa Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/saddle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_melon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_melon.png new file mode 100644 index 0000000..ef84499 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_melon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_pumpkin.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_pumpkin.png new file mode 100644 index 0000000..8d8f076 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_pumpkin.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_wheat.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_wheat.png new file mode 100644 index 0000000..83d23a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/seeds_wheat.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/shears.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/shears.png new file mode 100644 index 0000000..f9c6de1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/shears.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/sign.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/sign.png new file mode 100644 index 0000000..9b6e2ee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/sign.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_creeper.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_creeper.png new file mode 100644 index 0000000..c195fd5 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_creeper.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_skeleton.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_skeleton.png new file mode 100644 index 0000000..bf383fc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_skeleton.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_steve.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_steve.png new file mode 100644 index 0000000..e56f406 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_steve.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_wither.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_wither.png new file mode 100644 index 0000000..3571603 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_wither.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_zombie.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_zombie.png new file mode 100644 index 0000000..67d1347 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/skull_zombie.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/slimeball.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/slimeball.png new file mode 100644 index 0000000..46478ee Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/slimeball.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/snowball.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/snowball.png new file mode 100644 index 0000000..340c639 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/snowball.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spawn_egg.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spawn_egg.png new file mode 100644 index 0000000..23259c7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spawn_egg.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spawn_egg_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spawn_egg_overlay.png new file mode 100644 index 0000000..83ec78f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spawn_egg_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spider_eye.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spider_eye.png new file mode 100644 index 0000000..35d8584 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spider_eye.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spider_eye_fermented.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spider_eye_fermented.png new file mode 100644 index 0000000..226ffb8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/spider_eye_fermented.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stick.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stick.png new file mode 100644 index 0000000..6f8ce13 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stick.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_axe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_axe.png new file mode 100644 index 0000000..fb33584 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_axe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_hoe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_hoe.png new file mode 100644 index 0000000..d46b272 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_hoe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_pickaxe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_pickaxe.png new file mode 100644 index 0000000..19a8e50 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_pickaxe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_shovel.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_shovel.png new file mode 100644 index 0000000..8e1c0c2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_shovel.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_sword.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_sword.png new file mode 100644 index 0000000..5810dfd Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/stone_sword.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/string.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/string.png new file mode 100644 index 0000000..0b04ddb Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/string.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/sugar.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/sugar.png new file mode 100644 index 0000000..0864df9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/sugar.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wheat.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wheat.png new file mode 100644 index 0000000..bbd2fd9 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wheat.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_axe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_axe.png new file mode 100644 index 0000000..3a19203 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_axe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_hoe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_hoe.png new file mode 100644 index 0000000..de1c7a6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_hoe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_pickaxe.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_pickaxe.png new file mode 100644 index 0000000..ebc6756 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_pickaxe.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_shovel.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_shovel.png new file mode 100644 index 0000000..b057911 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_shovel.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_sword.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_sword.png new file mode 100644 index 0000000..c04dc0a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/items/wood_sword.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/map/map_background.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/map/map_background.png new file mode 100644 index 0000000..2783b50 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/map/map_background.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/map/map_icons.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/map/map_icons.png new file mode 100644 index 0000000..c2f35b8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/map/map_icons.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png new file mode 100644 index 0000000..f9ca97c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta new file mode 100644 index 0000000..e38a5ad --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta @@ -0,0 +1,5 @@ +{ + "texture": { + "blur": true + } +} diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/forcefield.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/forcefield.png new file mode 100644 index 0000000..3129f07 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/forcefield.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png new file mode 100644 index 0000000..d9725ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/shadow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/shadow.png new file mode 100644 index 0000000..b09fd47 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/shadow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/shadow.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/shadow.png.mcmeta new file mode 100644 index 0000000..8c6c7d1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/shadow.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "clamp": true + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/underwater.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/underwater.png new file mode 100644 index 0000000..2fc23b1 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/underwater.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/unknown_pack.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/unknown_pack.png new file mode 100644 index 0000000..16afade Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/unknown_pack.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/unknown_server.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/unknown_server.png new file mode 100644 index 0000000..16afade Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/unknown_server.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/vignette.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/vignette.png new file mode 100644 index 0000000..9c14e2d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/vignette.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/vignette.png.mcmeta b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/vignette.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/misc/vignette.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png new file mode 100644 index 0000000..9f84c18 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png new file mode 100644 index 0000000..117811c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png new file mode 100644 index 0000000..14fecf2 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png new file mode 100644 index 0000000..2cca056 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_1.png new file mode 100644 index 0000000..6802e06 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_2.png new file mode 100644 index 0000000..a7cf835 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/gold_layer_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_1.png new file mode 100644 index 0000000..6da6e84 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_2.png new file mode 100644 index 0000000..fab422a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/iron_layer_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1.png new file mode 100644 index 0000000..ebcfc41 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png new file mode 100644 index 0000000..546397d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2.png new file mode 100644 index 0000000..8d8bba6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png new file mode 100644 index 0000000..5655659 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png new file mode 100644 index 0000000..d7df7f6 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/particle/footprint.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/particle/footprint.png new file mode 100644 index 0000000..8d23f64 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/particle/footprint.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/particle/particles.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/particle/particles.png new file mode 100644 index 0000000..eec1f89 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/textures/particle/particles.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/circle.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/circle.png new file mode 100644 index 0000000..8f11e81 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/circle.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/colorPicker.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/colorPicker.png new file mode 100644 index 0000000..8c18131 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/colorPicker.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/crown.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/crown.png new file mode 100644 index 0000000..8d18f1c Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/crown.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/glow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/glow.png new file mode 100644 index 0000000..2e56d1d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/glow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/marker.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/marker.png new file mode 100644 index 0000000..1fd1227 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/marker.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerSmall.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerSmall.png new file mode 100644 index 0000000..612269d Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerSmall.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerskull.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerskull.png new file mode 100644 index 0000000..482a199 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerskull.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerskullSmall.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerskullSmall.png new file mode 100644 index 0000000..dba2704 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/markerskullSmall.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/mmarrow.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/mmarrow.png new file mode 100644 index 0000000..02b5f45 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/mmarrow.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/roundmap.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/roundmap.png new file mode 100644 index 0000000..a407dd8 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/roundmap.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/square.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/square.png new file mode 100644 index 0000000..4899fce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/square.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/squaremap.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/squaremap.png new file mode 100644 index 0000000..0f4e08a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/squaremap.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypoint.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypoint.png new file mode 100644 index 0000000..4e76465 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypoint.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointSmall.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointSmall.png new file mode 100644 index 0000000..a0ed5d4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointSmall.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointskull.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointskull.png new file mode 100644 index 0000000..482a199 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointskull.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointskullSmall.png b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointskullSmall.png new file mode 100644 index 0000000..dba2704 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/images/waypointskullSmall.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ar_SA.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ar_SA.lang new file mode 100644 index 0000000..2c117ee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ar_SA.lang @@ -0,0 +1,99 @@ +minimap.ui.welcome1=تم تعديله من قبل MamiyaOtaru +minimap.ui.welcome2=تمت الترجمة بواسطة xBCOLA +minimap.ui.welcome3=مرحبا بكم في VoxelMap، هناك +minimap.ui.welcome4=عدد من المميزات والأوامر المتوفرة لديك. +minimap.ui.welcome5a=للتكبير / وللتصغير +minimap.ui.welcome5b=خيارات +minimap.ui.welcome6=تبديل الخريطة كامل الشاشة. +minimap.ui.welcome7=إضافة إحداثية بسرعة. +minimap.ui.welcome8=إخفاء هذه الرسالة +minimap.ui.zoomlevel=مستوى التكبير: +minimap.ui.otheroptions=خيارات أخرى + +options.minimap.title=خيارات الخريطة +options.minimap.showcoordinates=عرض الأحداثيات +options.minimap.hideminimap=إخفاء الخريطة +options.minimap.cavemode=تمكين وضع الكهوف +options.minimap.dynamiclighting=إضاءة حيوية +options.minimap.terraindepth=تضاريس العمق +options.minimap.squaremap=الخريطة مربعة +options.minimap.oldnorth=قدم الشمال +options.minimap.ingamewaypoints=الإحداثيات في اللعبة +options.minimap.ingamewaypoints.beacons=منارات +options.minimap.ingamewaypoints.signs=علامات +options.minimap.ingamewaypoints.both=كلاهما +options.minimap.location=موقع الخريطة +options.minimap.location.topleft=أعلى اليسار +options.minimap.location.topright=أعلى اليمين +options.minimap.location.bottomright=أسفل اليمين +options.minimap.location.bottomleft=أسفل اليسار +options.minimap.size=حجم الخريطة +options.minimap.size.small=صغير +options.minimap.size.medium=متوسط +options.minimap.size.large=كبير +options.minimap.fontsize=حجم الخط +options.minimap.radar=رادار ... +options.minimap.radar.title=خيارات الرادار +options.minimap.radar.showradar=رادار +options.minimap.radar.showhostiles=مشاهدة المعادن +options.minimap.radar.showplayers=مشاهدة اللاعبين +options.minimap.radar.showneutrals=مشاهدة الحيوانات +options.minimap.radar.iconoutlines=خطوط الرموز عريضة +options.minimap.radar.iconfiltering=تصفية الرموز +options.minimap.radar.showplayernames=إظهار أسم اللاعب +options.minimap.radar.showplayerhelmets=مشاهدة خوذة اللاعب +options.minimap.radar.showmobhelmets=مشاهدة خوذ الموب +options.minimap.radar.randomobs=راندو موب +options.minimap.radar.selectmobs=عرض الموب ... +options.minimap.detailsperformance=تفاصيل / الأداء ... +options.minimap.terrain.height=ارتفاع +options.minimap.terrain.slope=منحدر +options.minimap.terrain.both=كلاهما +options.minimap.filtering=تصفية +options.minimap.watertransparency=شفافية المياه +options.minimap.blocktransparency=شفافية البلوك +options.minimap.biomes=المناطق الحيوية +options.minimap.biomeoverlay=تراكب المناطق الحيوية +options.minimap.biomeoverlay.transparent=شفافية +options.minimap.biomeoverlay.solid=صلب +options.minimap.chunkgrid=قطع شبكية +options.minimap.waypoints=الإحداثيات ... +options.minimap.waypoints.title=خيارات الإحداثيات +options.minimap.waypoints.distance=المسافة القصوى +options.minimap.waypoints.infinite=غير محدود +options.minimap.waypoints.deathpoints=نقاط الموت +options.minimap.waypoints.deathpoints.mostrecent=معظم الزوار +options.minimap.waypoints.deathpoints.all=كل +options.minimap.waypoints.deathpoints.tooltip=ساري المفعول في الموت القادم +options.minimap.waypoints.showwaypointnames=أسماء نقاط على الخريطة +options.minimap.mobs.title=إظهار أو إخفاء أنواع الموب الفردية +options.minimap.mobs.enable=تمكين الموب +options.minimap.mobs.disable=تعطيل الموب +options.minimap.mobs.enabled=عرض الموب ممكن +options.minimap.mobs.disabled=عرض الموب معطل + +controls.minimap.title=تحكم الخريطة +controls.minimap.unbind1=لتوثيق مفتاح، حدده ثم اضغط على 'Esc'. +controls.minimap.unbind2=(باستثناء مفتاح القائمة - لا يمكن أن يكون موجود) +key.minimap.zoom=تكبير +key.minimap.togglefullscreen=تبديل الخريطة كامل الشاشة. +key.minimap.menu=القائمة +key.minimap.togglemobs=تبديل الموب +key.minimap.waypointhotkey=مفتاح اختصار الإحداثيات +key.minimap.waypointmenu=قائمة الإحداثيات + +minimap.waypoints.title=الإحداثيات +minimap.waypoints.teleportto=انتقال فوري ل +minimap.waypoints.highlight=تسليط الضوء +minimap.waypoints.newwaypoint=إحداثية جديدة +minimap.waypoints.deleteconfirm=هل أنت متأكد أنك تريد إزالة هذه الإحداثية؟ +minimap.waypoints.edit=تعديل الإحداثية +minimap.waypoints.new=إحداثية جديدة +minimap.waypoints.name=إسم الإحداثية +minimap.waypoints.choosecolor=اختار اللون: +minimap.waypoints.enabled=تمكين: +minimap.waypoints.enable=تمكين الإحداثية +minimap.waypoints.disable=تعطيل الإحداثية +minimap.waypoints.applicabledimensions=الإبعاد التي سوف تكون فيها الإحداثيات واضحة +minimap.waypoints.dimension.applies=واضحة في هذا البعد +minimap.waypoints.dimension.notapplies=غير واضحة في هذا البعد \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/bg_BG.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/bg_BG.lang new file mode 100644 index 0000000..36a4adb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/bg_BG.lang @@ -0,0 +1,88 @@ +minimap.ui.welcome1=Поддръжка: MamiyaOtaru +minimap.ui.welcome2=Превод: f3n1xX +minimap.ui.welcome3=Добре Дошли във VoxelMap тук +minimap.ui.welcome4=редица функции и команди, достъпни за Вас. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Опции +minimap.ui.welcome6=Цял екран +minimap.ui.welcome7=Бързо добавяне на точка +minimap.ui.welcome8=Скрий това съобщение +minimap.ui.zoomlevel=Ниво на zoom: +minimap.ui.otheroptions=Други опции + +options.minimap.title=Опции на минимапа +options.minimap.showcoordinates=Показвай координати +options.minimap.hideminimap=Скрий минимапа +options.minimap.cavemode=Позволи Cave Mode +options.minimap.dynamiclighting=Динамична светлина +options.minimap.terraindepth=Ширина на терена +options.minimap.squaremap=Квадратна карта +options.minimap.oldnorth=Old North +options.minimap.ingamewaypoints=Игрови точки +options.minimap.ingamewaypoints.beacons=Beacons +options.minimap.ingamewaypoints.signs=Знаци +options.minimap.ingamewaypoints.both=И двете +options.minimap.location=Местоположение +options.minimap.location.topleft=Горно ляво +options.minimap.location.topright=Горно дясно +options.minimap.location.bottomright=Долен десен +options.minimap.location.bottomleft=Долен ляв +options.minimap.size=Размер +options.minimap.size.small=Малък +options.minimap.size.medium=Нормален +options.minimap.size.large=Голям +options.minimap.radar=Радар... +options.minimap.radar.title=Опции на радара +options.minimap.radar.showradar=Радар +options.minimap.radar.showhostiles=Показвай враговете (чудовища) +options.minimap.radar.showplayers=Показвай хората +options.minimap.radar.showneutrals=Показвай неутралните (животни) +options.minimap.radar.iconoutlines=Очертаване на икони +options.minimap.radar.iconfiltering=Филтриране на икони +options.minimap.radar.showplayerhelmets=Показвай хората +options.minimap.detailsperformance=Детайли/Производителност... +options.minimap.terrain.height=Височина +options.minimap.terrain.slope=Наклон +options.minimap.terrain.both=И двете +options.minimap.filtering=Филтриране +options.minimap.watertransparency=Прозрачност на водата +options.minimap.blocktransparency=Прозрачност на блоковете +options.minimap.biomes=Biomes +options.minimap.biomeoverlay=Biome Overlay +options.minimap.biomeoverlay.transparent=Прозрачен +options.minimap.biomeoverlay.solid=Солиден +options.minimap.chunkgrid=Chunk Grid +options.minimap.waypoints=Точки... +options.minimap.waypoints.title=Опции +options.minimap.waypoints.distance=Максимално разстояние +options.minimap.waypoints.infinite=Безкрайно +options.minimap.waypoints.deathpoints=Мъртва точка +options.minimap.waypoints.deathpoints.mostrecent=Последна смърт +options.minimap.waypoints.deathpoints.all=Всички +options.minimap.waypoints.deathpoints.tooltip=В сила при следващо умиране + +controls.minimap.title=Минимап контроли +controls.minimap.unbind1=За да премахнете копче, изберете го и натиснете "Escape". +controls.minimap.unbind2=(С изключение на клавиша за менюто - той не може да няма бутон) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Голяма карта +key.minimap.menu=Меню +key.minimap.togglemobs=Превключи чудовища +key.minimap.waypointhotkey=Бутон за нова точка +key.minimap.waypointmenu=Меню (точки) + +minimap.waypoints.title=Точки +minimap.waypoints.teleportto=Телепортирай в ... +minimap.waypoints.highlight=Маркиране +minimap.waypoints.newwaypoint=Нова точка +minimap.waypoints.deleteconfirm=Сигурен/а ли сте че искате да изтриете тази точка? +minimap.waypoints.edit=Редактиране на точка +minimap.waypoints.new=Нова точка +minimap.waypoints.name=Име на точка +minimap.waypoints.choosecolor=Изберете цвят: +minimap.waypoints.enabled=Режим: +minimap.waypoints.enable=Включи точка +minimap.waypoints.disable=Изключи точка +minimap.waypoints.applicabledimensions=Измерения където тази точка ще бъде видима +minimap.waypoints.dimension.applies=Видимо в това измерение +minimap.waypoints.dimension.notapplies=Невидимо в това измерение \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/cs_CZ.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/cs_CZ.lang new file mode 100644 index 0000000..15614ef --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/cs_CZ.lang @@ -0,0 +1,100 @@ +cs_CZ +minimap.ui.welcome1=Správa: MamiyaOtaru +minimap.ui.welcome2=Překlad: TabyCZ, Wonderman2_12 +minimap.ui.welcome3=Vítá tě VoxelMap, která ti nabízí +minimap.ui.welcome4=množství vlastností a příkazů. +minimap.ui.welcome5a=Přiblížit/Oddálit +minimap.ui.welcome5b=Možnosti +minimap.ui.welcome6=Mapa na celou obrazovku. +minimap.ui.welcome7=Rychlé přidání bodu. +minimap.ui.welcome8=Skrýt zprávu +minimap.ui.zoomlevel=Úroveň měřítka: +minimap.ui.otheroptions=Další možnosti + +options.minimap.title=Možnosti Minimapy +options.minimap.showcoordinates=Zobrazit souřadnice +options.minimap.hideminimap=Skrýt Minimapu +options.minimap.cavemode=Povolit jeskynní mód +options.minimap.dynamiclighting=Dynamické osvětlení +options.minimap.terraindepth=Hloubka terénu +options.minimap.squaremap=Čtvercová mapa +options.minimap.oldnorth=Starý sever +options.minimap.ingamewaypoints=Body ve hře +options.minimap.ingamewaypoints.beacons=Světelné signály +options.minimap.ingamewaypoints.signs=Štítky +options.minimap.ingamewaypoints.both=Oba +options.minimap.location=Umístění +options.minimap.location.topleft=Vlevo nahoře +options.minimap.location.topright=Vpravo nahoře +options.minimap.location.bottomright=Vpravo dole +options.minimap.location.bottomleft=Vlevo dole +options.minimap.size=Velikost +options.minimap.size.small=Malá +options.minimap.size.medium=Běžná +options.minimap.size.large=Velká +options.minimap.fontsize=Výška písma +options.minimap.radar=Radar... +options.minimap.radar.title=Možnosti radaru +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Ukázat nepřátele +options.minimap.radar.showplayers=Ukázat hráče +options.minimap.radar.showneutrals=Ukázat neutrální +options.minimap.radar.iconoutlines=Obrys ikony +options.minimap.radar.iconfiltering=Filtr ikon +options.minimap.radar.showplayernames=Ukázat jméno hráče +options.minimap.radar.showplayerhelmets=Ukázat hráčské přilby +options.minimap.radar.showmobhelmets=Ukázat přilby mobů +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Mobové k ukázání... +options.minimap.detailsperformance=Detaily/Výkon... +options.minimap.terrain.height=Výška +options.minimap.terrain.slope=Sklon +options.minimap.terrain.both=oba +options.minimap.filtering=Filtrování +options.minimap.watertransparency=Průhlednost vody +options.minimap.blocktransparency=Průhlednost kostek +options.minimap.biomes=Biomy +options.minimap.biomeoverlay=Přehled biomů +options.minimap.biomeoverlay.transparent=Průhledný +options.minimap.biomeoverlay.solid=Plný +options.minimap.chunkgrid=Hranice úseků +options.minimap.waypoints=Body... +options.minimap.waypoints.title=Možnosti bodů +options.minimap.waypoints.distance=Max. vzdálenost +options.minimap.waypoints.infinite=Nekonečno +options.minimap.waypoints.deathpoints=Místa úmrtí +options.minimap.waypoints.deathpoints.mostrecent=Poslední +options.minimap.waypoints.deathpoints.all=Všechny +options.minimap.waypoints.deathpoints.tooltip=Nabývá platnosti při další smrti +options.minimap.waypoints.showwaypointnames=Názvy bodů na mapě +options.minimap.mobs.title=Ukázat nebo skrýt jednotlivé typy mobů +options.minimap.mobs.enable=Povolit moba +options.minimap.mobs.disable=Zakázat moba +options.minimap.mobs.enabled=Zobrazení moba povoleno +options.minimap.mobs.disabled=Zobrazení moba zakázáno + +controls.minimap.title=Ovládání Minimapy +controls.minimap.unbind1=Pro odpojení klávesy ji vyber a stiskni 'Escape'. +controls.minimap.unbind2=(Vyjma klávesy pro Nabídku - ta nemůže být odpojena) +key.minimap.zoom=Změna měřítka +key.minimap.togglefullscreen=Přepínání na celou obrazovku +key.minimap.menu=Nabídka +key.minimap.togglemobs=Přepnout moby +key.minimap.waypointhotkey=Klávesová zkratka pro body +key.minimap.waypointmenu=Nabídka bodů + +minimap.waypoints.title=Body +minimap.waypoints.teleportto=Teleportovat na +minimap.waypoints.highlight=Zvýraznit +minimap.waypoints.newwaypoint=Nový bod +minimap.waypoints.deleteconfirm=Opravdu chceš odstranit tento bod? +minimap.waypoints.edit=Upravit bod +minimap.waypoints.new=Nový bod +minimap.waypoints.name=Název bodu +minimap.waypoints.choosecolor=Výběr barvy: +minimap.waypoints.enabled=Povoleno: +minimap.waypoints.enable=Povolit bod +minimap.waypoints.disable=Zakázat bod +minimap.waypoints.applicabledimensions=Dimenze, ve které bude bod viditelný +minimap.waypoints.dimension.applies=Viditelný v této dimenzi +minimap.waypoints.dimension.notapplies=Neviditelný v této dimenzi \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/da_DK.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/da_DK.lang new file mode 100644 index 0000000..687576b --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/da_DK.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Vedligeholdelse af MamiyaOtaru +minimap.ui.welcome2=Oversat af Xyoin +minimap.ui.welcome3=Velkommen til VoxelMap, der er et +minimap.ui.welcome4=antal af features og commands tilgængelig. +minimap.ui.welcome5a=Zoom ind/ud +minimap.ui.welcome5b=Indstillinger +minimap.ui.welcome6=Sæt full screen map til/fra. +minimap.ui.welcome7=Tilføj et hurtigt vejpunkt. +minimap.ui.welcome8=Skjul denne besked +minimap.ui.zoomlevel=Zoom Niveau: +minimap.ui.otheroptions=Andre Indstillinger + +options.minimap.title=Minimap Indstillinger +options.minimap.showcoordinates=Vis Koordinater +options.minimap.hideminimap=Skjul Minimap +options.minimap.cavemode=Sæt Grotte Mode til/fra +options.minimap.dynamiclighting=Dynamisk Belysning +options.minimap.terraindepth=Terræn Dybde +options.minimap.squaremap=Firkantet Kort +options.minimap.oldnorth=Gammel Nord +options.minimap.ingamewaypoints=In-game Vejpunkt +options.minimap.ingamewaypoints.beacons=Fyr +options.minimap.ingamewaypoints.signs=Skilte +options.minimap.ingamewaypoints.both=Begge +options.minimap.location=Lokation +options.minimap.location.topleft=Øverste venstre hjørne +options.minimap.location.topright=Øverste højre hjørne +options.minimap.location.bottomright=Nederste højre hjørne +options.minimap.location.bottomleft=Nederste venstre hjørne +options.minimap.size=Størrelse +options.minimap.size.small=Lille +options.minimap.size.medium=Normal +options.minimap.size.large=Stor +options.minimap.fontsize=Font Størrelse +options.minimap.radar=Radar... +options.minimap.radar.title=Radar Indstillinger +options.minimap.radar.showradar=Vis Radar +options.minimap.radar.showhostiles=Vis Fjendtlige +options.minimap.radar.showplayers=Vis Spillerer +options.minimap.radar.showneutrals=Vis Neutrale +options.minimap.radar.iconoutlines=Ikon Omrids +options.minimap.radar.iconfiltering=Ikon Filtrering +options.minimap.radar.showplayernames=Vis Spillernes navne +options.minimap.radar.showplayerhelmets=Vis Spillernes hjelme +options.minimap.radar.showmobhelmets=Vis Fjendtliges hjelme +options.minimap.radar.randomobs=ForskelliMobs +options.minimap.radar.selectmobs=Fjendtlige at Vise... +options.minimap.detailsperformance=Detaljer/Ydeevne... +options.minimap.terrain.height=Højde +options.minimap.terrain.slope=Skråning +options.minimap.terrain.both=Begge +options.minimap.filtering=Filtrering +options.minimap.watertransparency=Vand Gennemsigtighed +options.minimap.blocktransparency=Blok Gennemsigtighed +options.minimap.biomes=Biomer +options.minimap.biomeoverlay=Biom Overlay +options.minimap.biomeoverlay.transparent=Gennemsigtig +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Chunk Gitter +options.minimap.waypoints=Vejpunkter... +options.minimap.waypoints.title=Vejpunkt indstillinger +options.minimap.waypoints.distance=Max Distance +options.minimap.waypoints.infinite=Uendelig +options.minimap.waypoints.deathpoints=Dødssted(er) +options.minimap.waypoints.deathpoints.mostrecent=Seneste +options.minimap.waypoints.deathpoints.all=Alle +options.minimap.waypoints.deathpoints.tooltip=Tag effekt næste gang jeg dør +options.minimap.waypoints.showwaypointnames=Punkters Navne på Kortet +options.minimap.mobs.title=Vis/Skjul Individuelle Mob Typer +options.minimap.mobs.enable=Sæt Mobsne på kortet +options.minimap.mobs.disable=Få de Mobs væk fra mit kort +options.minimap.mobs.enabled=Mob Display Sat til +options.minimap.mobs.disabled=Mob Display Taget fra + +controls.minimap.title=Minimap Styring +controls.minimap.unbind1=For at ubinde en Tast, vælg den og tryk på 'Escape'. +controls.minimap.unbind2=(Undtagen for Menu Tasten - den kan ikke blive ubundet) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Sæt Fullscreen Map til/fra +key.minimap.menu=Menu +key.minimap.togglemobs=Sæt Mobsne til/fra +key.minimap.waypointhotkey=Vejpunkts Hotkey +key.minimap.waypointmenu=Vejpunktets Menu + +minimap.waypoints.title=Vejpunkter +minimap.waypoints.teleportto=Teleporter Til +minimap.waypoints.highlight=Highlight +minimap.waypoints.newwaypoint=Ny Vejpunkt +minimap.waypoints.deleteconfirm=Er du sikker på at du vil fjerne dette vejpunkt? +minimap.waypoints.edit=Rediger Vejpunkt +minimap.waypoints.new=Nyt Vejpunkt +minimap.waypoints.name=Vejpunkts Navn +minimap.waypoints.choosecolor=Vælg Farve: +minimap.waypoints.enabled=Sat til: +minimap.waypoints.enable=Brug Vejpunkt +minimap.waypoints.disable=Brug ikke Vejpunkt +minimap.waypoints.applicabledimensions=Dimensioner hvor dine vejpunkter vil blive vist +minimap.waypoints.dimension.applies=Synlig i denne dimension +minimap.waypoints.dimension.notapplies=Ikke synlig i denne dimension +minimap.general.name=Navn +minimap.general.distance=Distance +minimap.general.created=Skabt +minimap.general.color=Farve diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/de_DE.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/de_DE.lang new file mode 100644 index 0000000..2a6ab86 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/de_DE.lang @@ -0,0 +1,102 @@ +minimap.ui.welcome1=Verwaltet von MamiyaOtaru +minimap.ui.welcome2=Übersetzung: MamiyaOtaru +minimap.ui.welcome3=Wilkommen bei VoxelMap, es gibt einige Funktionen +minimap.ui.welcome4=und Befehle, die Ihnen zur Verfügung stehen +minimap.ui.welcome5a=Zoom ein/aus +minimap.ui.welcome5b=Optionen +minimap.ui.welcome6=Vollbildkarte schalten +minimap.ui.welcome7=Neuen Wegpunkt schnell erstellen +minimap.ui.welcome8=Diesen Hinweis Verstecken +minimap.ui.zoomlevel=Zoomstufe: +minimap.ui.otheroptions=Weitere Optionen + +options.minimap.title=Kartenoptionen +options.minimap.showcoordinates=Koordinaten Zeigen +options.minimap.hideminimap=Karte Verstecken +options.minimap.cavemode=Höhlenmodus +options.minimap.dynamiclighting=Beleuchtung +options.minimap.terraindepth=Gelände +options.minimap.squaremap=Rechteckige Karte +options.minimap.oldnorth=Original Nord +options.minimap.ingamewaypoints=In-game Wegpunkte +options.minimap.ingamewaypoints.beacons=Bake +options.minimap.ingamewaypoints.signs=Schild +options.minimap.ingamewaypoints.both=Beide +options.minimap.location=Lage +options.minimap.location.topleft=Oben Links +options.minimap.location.topright=Oben Rechts +options.minimap.location.bottomright=Unten Rechts +options.minimap.location.bottomleft=Unten Links +options.minimap.size=Größe +options.minimap.size.small=Kleiner +options.minimap.size.medium=Normal +options.minimap.size.large=Größer +options.minimap.fontsize=Schriftgröße +options.minimap.radar=Radar... +options.minimap.radar.title=Radaroptionenen +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Feinde Zeigen +options.minimap.radar.showplayers=Spieler Zeigen +options.minimap.radar.showneutrals=Neutralen Zeigen +options.minimap.radar.iconoutlines=Symbolen Umrissen +options.minimap.radar.iconfiltering=Symbolen Filtern +options.minimap.radar.showplayerhelmets=Spielerhelme Zeigen +options.minimap.radar.showmobhelmets=Mobhelme Zeigen +options.minimap.radar.showplayernames=Spielernamen Zeigen +options.minimap.radar.selectmobs=Gezeigte Mobs.. +options.minimap.detailsperformance=Details/Leistung... +options.minimap.terrain.height=Höhe +options.minimap.terrain.slope=Hang +options.minimap.terrain.both=Beide +options.minimap.filtering=Filtern +options.minimap.watertransparency=Wassertransparenz +options.minimap.blocktransparency=Blocktransparenz +options.minimap.biomes=Biome +options.minimap.biomeoverlay=Biomfolie +options.minimap.biomeoverlay.transparent=Transparent +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Chunkgitter +options.minimap.waypoints=Wegpunkte... +options.minimap.waypoints.title=Wegpunktoptionen +options.minimap.waypoints.distance=Maximalabstand +options.minimap.waypoints.infinite=Unbegrenzt +options.minimap.waypoints.deathpoints=Todesort(e) +options.minimap.waypoints.deathpoints.mostrecent=Jüngste +options.minimap.waypoints.deathpoints.all=Alle +options.minimap.waypoints.deathpoints.tooltip=Wirksam beim nächsten Tod +options.minimap.waypoints.showwaypointnames=Karte hat Wegpunktnamen +options.minimap.mobs.title=Zeig bzw. Verbirg Spezifische Mobsorten +options.minimap.mobs.enable=Symbol Zeigen +options.minimap.mobs.disable=Symbol Verbergen +options.minimap.mobs.enabled=Dieses Symbol wird gezeigt. +options.minimap.mobs.disabled=Dieses Symbol wird nicht gezeigt. + +controls.minimap.title=Kartensteuerung +controls.minimap.unbind1=Um eine Kontrolle loszubinden, sie auswählen und 'Esc' Taste drücken. +controls.minimap.unbind2=(Außer der Menütaste - sie kann nicht losgebunden werden) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Vollbildkarte Schalten +key.minimap.menu=Menü +key.minimap.togglemobs=Mobsymbolen Schalten +key.minimap.waypointhotkey=Wegpunkt Hotkey +key.minimap.waypointmenu=Wegpunktmenü + +minimap.waypoints.title=Wegpunkte +minimap.waypoints.teleportto=Hierzu Teleportieren +minimap.waypoints.highlight=Betonen +minimap.waypoints.newwaypoint=Neuer Wegpunkt +minimap.waypoints.deleteconfirm=Bist du sicher, dass du diesen Wegpunkt löschen möchtest? +minimap.waypoints.edit=Wegpunkt Bearbeiten +minimap.waypoints.new=Neuer Wegpunkt +minimap.waypoints.name=Wegpunkt Name +minimap.waypoints.choosecolor=Farbe Wählen: +minimap.waypoints.enabled=Aktiv: +minimap.waypoints.enable=Wegpunkt Anschalten +minimap.waypoints.disable=Wegpunkt Ausschalten +minimap.waypoints.applicabledimensions=Dimensionen, in derer dieser Wegpunkt sichtbar ist +minimap.waypoints.dimension.applies=In dieser Dimension sichtbar +minimap.waypoints.dimension.notapplies=In dieser Dimension nicht sichtbar +minimap.waypoints.sortbyname=Name +minimap.waypoints.sortbydistance=Entfernung +minimap.waypoints.sortbycreated=Datum +minimap.waypoints.sortbycolor=Farbe \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/el_GR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/el_GR.lang new file mode 100644 index 0000000..1afddb4 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/el_GR.lang @@ -0,0 +1,96 @@ +minimap.ui.welcome1=Συντηρείται από MamiyaOtaru +minimap.ui.welcome2=Μετάφραση: Αν αυτή δεν είναι η γλώσσα σας βοηθήστε στη μετάφραση! +minimap.ui.welcome3=Καλώς ήρθατε στο VoxelMap, υπάρχει +minimap.ui.welcome4=μεγαλος αριθμός δυνατότητων και εντολων στη διάθεσή σας. +minimap.ui.welcome5a=Μεγέθυνση/σμίκρυνση +minimap.ui.welcome5b=Ρυθμίσεις +minimap.ui.welcome6=Εναλλαγή πλήρους οθόνης χάρτη. +minimap.ui.welcome7=προσθέσετε γρήγορα ένα σημείο. +minimap.ui.welcome8=Απόκρυψη αυτού του μηνύματος +minimap.ui.zoomlevel=Επίπεδο Μεγέθυνσης: +minimap.ui.otheroptions=Άλλες Ρυθμίσεις + +options.minimap.title=Ρυθμίσεις χάρτη +options.minimap.showcoordinates= Ένδειξη Συντεταγμένων +options.minimap.hideminimap=Απόκρυψη Χάρτη +options.minimap.cavemode=Ενεργοποίηση Cave Mode +options.minimap.dynamiclighting=Δυναμικός φωτισμός +options.minimap.terraindepth= Βάθος Εδάφους +options.minimap.squaremap=Τετράγωνος χάρτης +options.minimap.oldnorth=Παλιός Βοριάς +options.minimap.ingamewaypoints=Εντός παιχνιδιού Waypoints +options.minimap.ingamewaypoints.beacons=Beacons +options.minimap.ingamewaypoints.signs=Πινακίδες +options.minimap.ingamewaypoints.both=Και τα δύο +options.minimap.location=Τοποθεσία +options.minimap.location.topleft=Πανώ Αριστερά +options.minimap.location.topright=Πάνω δεξιά +options.minimap.location.bottomright=Κάτω δεξιά +options.minimap.location.bottomleft=Κάτω αριστερά +options.minimap.size=Μέγεθος +options.minimap.size.small=Μικρό +options.minimap.size.medium=Μεσαίο +options.minimap.size.large=Μεγάλο +options.minimap.radar=Ραντάρ +options.minimap.radar.title=Ρυθμίσεις Ρανταρ +options.minimap.radar.showradar=Εμφάνιση Ρανταρ +options.minimap.radar.showhostiles=Εμφάνιση Εχθρών +options.minimap.radar.showplayers=Εμφάνιση Παίχτων +options.minimap.radar.showneutrals=Εμφάνιση Ουδέτερων +options.minimap.radar.iconoutlines=Icon Περιγράμματα +options.minimap.radar.iconfiltering=Icon φιλτράρισμα +options.minimap.radar.showplayerhelmets=Εμφάνιση Κράνων παιχτών +options.minimap.radar.showmobhelmets=Εμφάνιση Κράνων τεράτων +options.minimap.radar.randomobs=Randomobs +options.minimap.detailsperformance=Λεπτομέρειες / Performance ... +options.minimap.terrain.height=Ύψος +options.minimap.terrain.slope=Slope +options.minimap.terrain.both=Και τα δύο +options.minimap.filtering=φιλτράρισμα +options.minimap.watertransparency=διαφάνεια νερού +options.minimap.blocktransparency=Διαφάνεια Block +options.minimap.biomes=Biomes +options.minimap.biomeoverlay=Biome Overlay +options.minimap.biomeoverlay.transparent=Διαφανή +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=κομμάτι Grid +options.minimap.waypoints=Σημεία ... +options.minimap.waypoints.title=Επιλογές σημείου +options.minimap.waypoints.distance=Μέγιστη Απόσταση +options.minimap.waypoints.infinite=άπειρο +options.minimap.waypoints.deathpoints=Σημείο/α Θανάτου +options.minimap.waypoints.deathpoints.mostrecent=Πιο Πρόσφατα +options.minimap.waypoints.deathpoints.all=Όλα +options.minimap.waypoints.deathpoints.tooltip=Να ισχύει απο τον επόμενο θανάτο + +options.minimap.waypoints.showwaypointnames=Ονόματα Waypoint στον χάρτη +options.minimap.mobs.title=Ένδειξη ή απόκρυψη ξεχωριστά τα είδη Mob +options.minimap.mobs.enable=Ενεργοποίηση Mob +options.minimap.mobs.disable=Απενεργοποίηση Mob +options.minimap.mobs.enabled=Ένδειξη Mob +options.minimap.mobs.disabled=Απόκρυψη Mob +controls.minimap.title=Μικρός ελέγχου +controls.minimap.unbind1=Για να αποσυνδέσετε ένα πληκτρο, επιλέξτε το και πατήστε «Escape». +controls.minimap.unbind2=(Εκτός από το πλήκτρο μενού - δεν μπορεί να αλαχθει) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Εναλλαγή Fullscreen Χάρτη +key.minimap.menu=Μενού +key.minimap.togglemobs=Εναλλαγή Mob +key.minimap.waypointhotkey=Waypoint Hotkey +key.minimap.waypointmenu=Μενου Waypoint + +minimap.waypoints.title=Σημεία +minimap.waypoints.teleportto=Κάνε Teleport +minimap.waypoints.highlight=Highlight +minimap.waypoints.newwaypoint=Νέο σημείο +minimap.waypoints.deleteconfirm=Είστε βέβαιοι ότι θέλετε να καταργήσετε αυτό το σημείο; +minimap.waypoints.edit=Επεξεργασία σημείου +minimap.waypoints.new=Νέο σημείο +minimap.waypoints.name=Όνομα τοποθεσίας +minimap.waypoints.choosecolor=Επιλογή χρώματος: +minimap.waypoints.enabled=Ενεργοποιημένη: +minimap.waypoints.enable=Ενεργοποίηση Waypoint +minimap.waypoints.disable=Απενεργοποίηση Waypoint +minimap.waypoints.applicabledimensions=Διαστάσεις στο σημείο που θα είναι ορατό +minimap.waypoints.dimension.applies=Ορατό σε αυτή τη διάσταση +minimap.waypoints.dimension.notapplies=Αόρατο σε αυτή τη διάσταση diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/en_US.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/en_US.lang new file mode 100644 index 0000000..85698a6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/en_US.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Maintained by MamiyaOtaru +minimap.ui.welcome2=Translated by: If this is not your language, help translate! +minimap.ui.welcome3=Welcome to VoxelMap, there are a +minimap.ui.welcome4=number of features and commands available to you. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Options +minimap.ui.welcome6=Toggle full screen map. +minimap.ui.welcome7=Quickly add a waypoint. +minimap.ui.welcome8=Hide this message +minimap.ui.zoomlevel=Zoom Level: +minimap.ui.otheroptions=Other Options + +options.minimap.title=Minimap Options +options.minimap.showcoordinates=Display Coordinates +options.minimap.hideminimap=Hide Minimap +options.minimap.cavemode=Enable Cave Mode +options.minimap.dynamiclighting=Dynamic Lighting +options.minimap.terraindepth=Terrain Depth +options.minimap.squaremap=Square Map +options.minimap.oldnorth=Old North +options.minimap.ingamewaypoints=In-game Waypoints +options.minimap.ingamewaypoints.beacons=Beacons +options.minimap.ingamewaypoints.signs=Signs +options.minimap.ingamewaypoints.both=Both +options.minimap.location=Location +options.minimap.location.topleft=Top Left +options.minimap.location.topright=Top Right +options.minimap.location.bottomright=Bottom Right +options.minimap.location.bottomleft=Bottom Left +options.minimap.size=Size +options.minimap.size.small=Small +options.minimap.size.medium=Regular +options.minimap.size.large=Large +options.minimap.fontsize=Font Size +options.minimap.radar=Radar... +options.minimap.radar.title=Radar Options +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Show Hostiles +options.minimap.radar.showplayers=Show Players +options.minimap.radar.showneutrals=Show Neutrals +options.minimap.radar.iconoutlines=Icon Outlines +options.minimap.radar.iconfiltering=Icon Filtering +options.minimap.radar.showplayerhelmets=Show Player Helmets +options.minimap.radar.showmobhelmets=Show Mob Helmets +options.minimap.radar.showplayernames=Show Player Names +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Mobs to Display... +options.minimap.detailsperformance=Details/Performance... +options.minimap.terrain.height=Height +options.minimap.terrain.slope=Slope +options.minimap.terrain.both=Both +options.minimap.filtering=Filtering +options.minimap.watertransparency=Water Transparency +options.minimap.blocktransparency=Block Transparency +options.minimap.biomes=Biomes +options.minimap.biomeoverlay=Biome Overlay +options.minimap.biomeoverlay.transparent=Transparent +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Chunk Grid +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Waypoint Options +options.minimap.waypoints.distance=Max Distance +options.minimap.waypoints.infinite=Infinite +options.minimap.waypoints.deathpoints=Deathpoint(s) +options.minimap.waypoints.deathpoints.mostrecent=Most Recent +options.minimap.waypoints.deathpoints.all=All +options.minimap.waypoints.deathpoints.tooltip=Takes effect on next death +options.minimap.waypoints.showwaypointnames=Point Names on Map +options.minimap.mobs.title=Show or Hide Individual Mob Types +options.minimap.mobs.enable=Enable Mob Icon +options.minimap.mobs.disable=Disable Mob Icon +options.minimap.mobs.enabled=This icon is displayed. +options.minimap.mobs.disabled=This icon is not displayed. + +controls.minimap.title=Minimap Controls +controls.minimap.unbind1=To unbind a key, select it and press 'Escape'. +controls.minimap.unbind2=(Except for the Menu Key - it can't be unbound) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Toggle Fullscreen Map +key.minimap.voxelmapmenu=VoxelMap Menu +key.minimap.menu=Menu +key.minimap.waypointhotkey=Waypoint Hotkey +key.minimap.togglemobs=Toggle Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teleport To +minimap.waypoints.highlight=Highlight +minimap.waypoints.newwaypoint=New Waypoint +minimap.waypoints.deleteconfirm=Are you sure you want to remove this waypoint? +minimap.waypoints.edit=Edit Waypoint +minimap.waypoints.new=New Waypoint +minimap.waypoints.name=Waypoint Name +minimap.waypoints.choosecolor=Choose Color: +minimap.waypoints.enabled=Enabled: +minimap.waypoints.enable=Enable Waypoint +minimap.waypoints.disable=Disable Waypoint +minimap.waypoints.applicabledimensions=Dimensions in which this waypoint will be visible +minimap.waypoints.dimension.applies=Visible in this dimension +minimap.waypoints.dimension.notapplies=Not visible in this dimension +minimap.waypoints.sortbyname=Name +minimap.waypoints.sortbydistance=Distance +minimap.waypoints.sortbycreated=Created +minimap.waypoints.sortbycolor=Color diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_AR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_AR.lang new file mode 100644 index 0000000..d7e5881 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_AR.lang @@ -0,0 +1,104 @@ +es_AR +minimap.ui.welcome1=Hecho por MamiyaOtaru +minimap.ui.welcome2=Traducido por janitoalevic +minimap.ui.welcome3=Bienvenido a VoxelMap, hay +minimap.ui.welcome4=algunas opciones y controles disponibles para modificar. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Opciones +minimap.ui.welcome6=Mostrar mapa en pantalla completa +minimap.ui.welcome7=Creación rápida de waypoint. +minimap.ui.welcome8=Ocultar este mensaje +minimap.ui.zoomlevel=Nivel de Zoom: +minimap.ui.otheroptions=Otras Opciones + +options.minimap.title=Opciones de Mapa +options.minimap.showcoordinates=Mostrar coordenadas +options.minimap.hideminimap=Ocultar Minimapa +options.minimap.cavemode=Activar modo caverna +options.minimap.dynamiclighting=Iluminación dinámica +options.minimap.terraindepth=Desnivel de terreno +options.minimap.squaremap=Mapa cuadrado +options.minimap.oldnorth=Norte viejo +options.minimap.ingamewaypoints=Waypoints In-game +options.minimap.ingamewaypoints.beacons=Faros +options.minimap.ingamewaypoints.signs=Nombres +options.minimap.ingamewaypoints.both=Ambos +options.minimap.location=Ubicación +options.minimap.location.topleft=Superior Izquierdo +options.minimap.location.topright=Superior Derecho +options.minimap.location.bottomright=Inferior Derecho +options.minimap.location.bottomleft=Inferior Izquierdo +options.minimap.size=Tamaño +options.minimap.size.small=Pequeño +options.minimap.size.medium=Medio +options.minimap.size.large=Grande +options.minimap.fontsize=Tamaño de Letra +options.minimap.radar=Radar... +options.minimap.radar.title=Opciones de Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostrar Hostiles +options.minimap.radar.showplayers=Mostrar jugadores +options.minimap.radar.showneutrals=Mostrar Neutrales +options.minimap.radar.iconoutlines=Contorno de ícono +options.minimap.radar.iconfiltering=Filtraje de ícono +options.minimap.radar.showplayerhelmets=Mostrar Cascos de jugadores +options.minimap.radar.showmobhelmets=Mostrar Cascos de mobs +options.minimap.radar.showplayernames=Mostrar Nombres de jugadores +options.minimap.radar.randomobs=Cualquier Mob +options.minimap.radar.selectmobs=Mobs que Mostrar... +options.minimap.detailsperformance=Detalles/Funcionamiento... +options.minimap.terrain.height=Altura +options.minimap.terrain.slope=Bajada +options.minimap.terrain.both=Ambos +options.minimap.filtering=Filtraje +options.minimap.watertransparency=Transparencia de Agua +options.minimap.blocktransparency=Transparencia de Bloque +options.minimap.biomes=Biomas +options.minimap.biomeoverlay=Sobreposición de Bioma +options.minimap.biomeoverlay.transparent=Transparencia +options.minimap.biomeoverlay.solid=Sólido +options.minimap.chunkgrid=Cuadrícula de Chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Opciones de Waypoints +options.minimap.waypoints.distance=Distancia Máxima +options.minimap.waypoints.infinite=Infinita +options.minimap.waypoints.deathpoints=Puntos de Muerte +options.minimap.waypoints.deathpoints.mostrecent=Más reciente +options.minimap.waypoints.deathpoints.all=Todos +options.minimap.waypoints.deathpoints.tooltip=Tiene efecto en la próxima muerte +options.minimap.waypoints.showwaypointnames=Nombres de Puntos en el Mapa +options.minimap.mobs.title=Mostrar o Esconder Tipos de Mob. +options.minimap.mobs.enable=Activar ícono de Mob +options.minimap.mobs.disable=Desactivar ícono de Mob +options.minimap.mobs.enabled=Este ícono se está mostrando. +options.minimap.mobs.disabled=Este ícono no se está mostrando. + +controls.minimap.title=Controles de Minimapa +controls.minimap.unbind1=Para desasociar una clave, pulse 'Escape'. +controls.minimap.unbind2=(Excepto por la clave de Menú - No la puede desasociar) +key.minimap.zoom=Zoom de Minimapa +key.minimap.togglefullscreen=Mostrar mapa en pantalla completa +key.minimap.voxelmapmenu=Menú de Minimapa +key.minimap.menu=Menú +key.minimap.waypointhotkey=Tecla para waypoints +key.minimap.togglemobs=Activar Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teletransportar a +minimap.waypoints.highlight=Elegir +minimap.waypoints.newwaypoint=Nuevo Waypoint +minimap.waypoints.deleteconfirm=¿Estás seguro que deseas borrar este waypoint? +minimap.waypoints.edit=Editar Waypoint +minimap.waypoints.new=Nuevo Waypoint +minimap.waypoints.name=Nombre del Waypoint +minimap.waypoints.choosecolor=Elegir Color: +minimap.waypoints.enabled=Activados: +minimap.waypoints.enable=Activar Waypoint +minimap.waypoints.disable=Desactivar Waypoint +minimap.waypoints.applicabledimensions=Dimensiones donde este waypoint será visible +minimap.waypoints.dimension.applies=Visible en esta dimensión +minimap.waypoints.dimension.notapplies=No visible en esta dimensión +minimap.waypoints.sortbyname=Nombre +minimap.waypoints.sortbydistance=Distancia +minimap.waypoints.sortbycreated=Creado +minimap.waypoints.sortbycolor=Color \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_ES.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_ES.lang new file mode 100644 index 0000000..ba45b42 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_ES.lang @@ -0,0 +1,104 @@ +es_ES +minimap.ui.welcome1=Hecho por MamiyaOtaru +minimap.ui.welcome2=Traducido por janitoalevic +minimap.ui.welcome3=Bienvenido a VoxelMap, hay +minimap.ui.welcome4=algunas opciones y controles disponibles para modificar. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Opciones +minimap.ui.welcome6=Mostrar mapa en pantalla completa +minimap.ui.welcome7=Creación rápida de waypoint. +minimap.ui.welcome8=Ocultar este mensaje +minimap.ui.zoomlevel=Nivel de Zoom: +minimap.ui.otheroptions=Otras Opciones + +options.minimap.title=Opciones de Mapa +options.minimap.showcoordinates=Mostrar coordenadas +options.minimap.hideminimap=Ocultar Minimapa +options.minimap.cavemode=Activar modo caverna +options.minimap.dynamiclighting=Iluminación dinámica +options.minimap.terraindepth=Desnivel de terreno +options.minimap.squaremap=Mapa cuadrado +options.minimap.oldnorth=Norte viejo +options.minimap.ingamewaypoints=Waypoints In-game +options.minimap.ingamewaypoints.beacons=Faros +options.minimap.ingamewaypoints.signs=Nombres +options.minimap.ingamewaypoints.both=Ambos +options.minimap.location=Ubicación +options.minimap.location.topleft=Superior Izquierdo +options.minimap.location.topright=Superior Derecho +options.minimap.location.bottomright=Inferior Derecho +options.minimap.location.bottomleft=Inferior Izquierdo +options.minimap.size=Tamaño +options.minimap.size.small=Pequeño +options.minimap.size.medium=Medio +options.minimap.size.large=Grande +options.minimap.fontsize=Tamaño de Letra +options.minimap.radar=Radar... +options.minimap.radar.title=Opciones de Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostrar Hostiles +options.minimap.radar.showplayers=Mostrar jugadores +options.minimap.radar.showneutrals=Mostrar Neutrales +options.minimap.radar.iconoutlines=Contorno de ícono +options.minimap.radar.iconfiltering=Filtraje de ícono +options.minimap.radar.showplayerhelmets=Mostrar Cascos de jugadores +options.minimap.radar.showmobhelmets=Mostrar Cascos de mobs +options.minimap.radar.showplayernames=Mostrar Nombres de jugadores +options.minimap.radar.randomobs=Cualquier Mob +options.minimap.radar.selectmobs=Mobs que Mostrar... +options.minimap.detailsperformance=Detalles/Funcionamiento... +options.minimap.terrain.height=Altura +options.minimap.terrain.slope=Bajada +options.minimap.terrain.both=Ambos +options.minimap.filtering=Filtraje +options.minimap.watertransparency=Transparencia de Agua +options.minimap.blocktransparency=Transparencia de Bloque +options.minimap.biomes=Biomas +options.minimap.biomeoverlay=Sobreposición de Bioma +options.minimap.biomeoverlay.transparent=Transparencia +options.minimap.biomeoverlay.solid=Sólido +options.minimap.chunkgrid=Cuadrícula de Chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Opciones de Waypoints +options.minimap.waypoints.distance=Distancia Máxima +options.minimap.waypoints.infinite=Infinita +options.minimap.waypoints.deathpoints=Puntos de Muerte +options.minimap.waypoints.deathpoints.mostrecent=Más reciente +options.minimap.waypoints.deathpoints.all=Todos +options.minimap.waypoints.deathpoints.tooltip=Tiene efecto en la próxima muerte +options.minimap.waypoints.showwaypointnames=Nombres de Puntos en el Mapa +options.minimap.mobs.title=Mostrar o Esconder Tipos de Mob. +options.minimap.mobs.enable=Activar ícono de Mob +options.minimap.mobs.disable=Desactivar ícono de Mob +options.minimap.mobs.enabled=Este ícono se está mostrando. +options.minimap.mobs.disabled=Este ícono no se está mostrando. + +controls.minimap.title=Controles de Minimapa +controls.minimap.unbind1=Para desasociar una clave, pulse 'Escape'. +controls.minimap.unbind2=(Excepto por la clave de Menú - No la puede desasociar) +key.minimap.zoom=Zoom de Minimapa +key.minimap.togglefullscreen=Mostrar mapa en pantalla completa +key.minimap.voxelmapmenu=Menú de Minimapa +key.minimap.menu=Menú +key.minimap.waypointhotkey=Tecla para waypoints +key.minimap.togglemobs=Activar Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teletransportar a +minimap.waypoints.highlight=Elegir +minimap.waypoints.newwaypoint=Nuevo Waypoint +minimap.waypoints.deleteconfirm=¿Estás seguro que deseas borrar este waypoint? +minimap.waypoints.edit=Editar Waypoint +minimap.waypoints.new=Nuevo Waypoint +minimap.waypoints.name=Nombre del Waypoint +minimap.waypoints.choosecolor=Elegir Color: +minimap.waypoints.enabled=Activados: +minimap.waypoints.enable=Activar Waypoint +minimap.waypoints.disable=Desactivar Waypoint +minimap.waypoints.applicabledimensions=Dimensiones donde este waypoint será visible +minimap.waypoints.dimension.applies=Visible en esta dimensión +minimap.waypoints.dimension.notapplies=No visible en esta dimensión +minimap.waypoints.sortbyname=Nombre +minimap.waypoints.sortbydistance=Distancia +minimap.waypoints.sortbycreated=Creado +minimap.waypoints.sortbycolor=Color \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_MX.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_MX.lang new file mode 100644 index 0000000..55905f8 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_MX.lang @@ -0,0 +1,104 @@ +es_MX +minimap.ui.welcome1=Hecho por MamiyaOtaru +minimap.ui.welcome2=Traducido por janitoalevic +minimap.ui.welcome3=Bienvenido a VoxelMap, hay +minimap.ui.welcome4=algunas opciones y controles disponibles para modificar. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Opciones +minimap.ui.welcome6=Mostrar mapa en pantalla completa +minimap.ui.welcome7=Creación rápida de waypoint. +minimap.ui.welcome8=Ocultar este mensaje +minimap.ui.zoomlevel=Nivel de Zoom: +minimap.ui.otheroptions=Otras Opciones + +options.minimap.title=Opciones de Mapa +options.minimap.showcoordinates=Mostrar coordenadas +options.minimap.hideminimap=Ocultar Minimapa +options.minimap.cavemode=Activar modo caverna +options.minimap.dynamiclighting=Iluminación dinámica +options.minimap.terraindepth=Desnivel de terreno +options.minimap.squaremap=Mapa cuadrado +options.minimap.oldnorth=Norte viejo +options.minimap.ingamewaypoints=Waypoints In-game +options.minimap.ingamewaypoints.beacons=Faros +options.minimap.ingamewaypoints.signs=Nombres +options.minimap.ingamewaypoints.both=Ambos +options.minimap.location=Ubicación +options.minimap.location.topleft=Superior Izquierdo +options.minimap.location.topright=Superior Derecho +options.minimap.location.bottomright=Inferior Derecho +options.minimap.location.bottomleft=Inferior Izquierdo +options.minimap.size=Tamaño +options.minimap.size.small=Pequeño +options.minimap.size.medium=Medio +options.minimap.size.large=Grande +options.minimap.fontsize=Tamaño de Letra +options.minimap.radar=Radar... +options.minimap.radar.title=Opciones de Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostrar Hostiles +options.minimap.radar.showplayers=Mostrar jugadores +options.minimap.radar.showneutrals=Mostrar Neutrales +options.minimap.radar.iconoutlines=Contorno de ícono +options.minimap.radar.iconfiltering=Filtraje de ícono +options.minimap.radar.showplayerhelmets=Mostrar Cascos de jugadores +options.minimap.radar.showmobhelmets=Mostrar Cascos de mobs +options.minimap.radar.showplayernames=Mostrar Nombres de jugadores +options.minimap.radar.randomobs=Cualquier Mob +options.minimap.radar.selectmobs=Mobs que Mostrar... +options.minimap.detailsperformance=Detalles/Funcionamiento... +options.minimap.terrain.height=Altura +options.minimap.terrain.slope=Bajada +options.minimap.terrain.both=Ambos +options.minimap.filtering=Filtraje +options.minimap.watertransparency=Transparencia de Agua +options.minimap.blocktransparency=Transparencia de Bloque +options.minimap.biomes=Biomas +options.minimap.biomeoverlay=Sobreposición de Bioma +options.minimap.biomeoverlay.transparent=Transparencia +options.minimap.biomeoverlay.solid=Sólido +options.minimap.chunkgrid=Cuadrícula de Chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Opciones de Waypoints +options.minimap.waypoints.distance=Distancia Máxima +options.minimap.waypoints.infinite=Infinita +options.minimap.waypoints.deathpoints=Puntos de Muerte +options.minimap.waypoints.deathpoints.mostrecent=Más reciente +options.minimap.waypoints.deathpoints.all=Todos +options.minimap.waypoints.deathpoints.tooltip=Tiene efecto en la próxima muerte +options.minimap.waypoints.showwaypointnames=Nombres de Puntos en el Mapa +options.minimap.mobs.title=Mostrar o Esconder Tipos de Mob. +options.minimap.mobs.enable=Activar ícono de Mob +options.minimap.mobs.disable=Desactivar ícono de Mob +options.minimap.mobs.enabled=Este ícono se está mostrando. +options.minimap.mobs.disabled=Este ícono no se está mostrando. + +controls.minimap.title=Controles de Minimapa +controls.minimap.unbind1=Para desasociar una clave, pulse 'Escape'. +controls.minimap.unbind2=(Excepto por la clave de Menú - No la puede desasociar) +key.minimap.zoom=Zoom de Minimapa +key.minimap.togglefullscreen=Mostrar mapa en pantalla completa +key.minimap.voxelmapmenu=Menú de Minimapa +key.minimap.menu=Menú +key.minimap.waypointhotkey=Tecla para waypoints +key.minimap.togglemobs=Activar Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teletransportar a +minimap.waypoints.highlight=Elegir +minimap.waypoints.newwaypoint=Nuevo Waypoint +minimap.waypoints.deleteconfirm=¿Estás seguro que deseas borrar este waypoint? +minimap.waypoints.edit=Editar Waypoint +minimap.waypoints.new=Nuevo Waypoint +minimap.waypoints.name=Nombre del Waypoint +minimap.waypoints.choosecolor=Elegir Color: +minimap.waypoints.enabled=Activados: +minimap.waypoints.enable=Activar Waypoint +minimap.waypoints.disable=Desactivar Waypoint +minimap.waypoints.applicabledimensions=Dimensiones donde este waypoint será visible +minimap.waypoints.dimension.applies=Visible en esta dimensión +minimap.waypoints.dimension.notapplies=No visible en esta dimensión +minimap.waypoints.sortbyname=Nombre +minimap.waypoints.sortbydistance=Distancia +minimap.waypoints.sortbycreated=Creado +minimap.waypoints.sortbycolor=Color \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_UY.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_UY.lang new file mode 100644 index 0000000..f2444c7 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_UY.lang @@ -0,0 +1,104 @@ +es_UY +minimap.ui.welcome1=Hecho por MamiyaOtaru +minimap.ui.welcome2=Traducido por janitoalevic +minimap.ui.welcome3=Bienvenido a VoxelMap, hay +minimap.ui.welcome4=algunas opciones y controles disponibles para modificar. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Opciones +minimap.ui.welcome6=Mostrar mapa en pantalla completa +minimap.ui.welcome7=Creación rápida de waypoint. +minimap.ui.welcome8=Ocultar este mensaje +minimap.ui.zoomlevel=Nivel de Zoom: +minimap.ui.otheroptions=Otras Opciones + +options.minimap.title=Opciones de Mapa +options.minimap.showcoordinates=Mostrar coordenadas +options.minimap.hideminimap=Ocultar Minimapa +options.minimap.cavemode=Activar modo caverna +options.minimap.dynamiclighting=Iluminación dinámica +options.minimap.terraindepth=Desnivel de terreno +options.minimap.squaremap=Mapa cuadrado +options.minimap.oldnorth=Norte viejo +options.minimap.ingamewaypoints=Waypoints In-game +options.minimap.ingamewaypoints.beacons=Faros +options.minimap.ingamewaypoints.signs=Nombres +options.minimap.ingamewaypoints.both=Ambos +options.minimap.location=Ubicación +options.minimap.location.topleft=Superior Izquierdo +options.minimap.location.topright=Superior Derecho +options.minimap.location.bottomright=Inferior Derecho +options.minimap.location.bottomleft=Inferior Izquierdo +options.minimap.size=Tamaño +options.minimap.size.small=Pequeño +options.minimap.size.medium=Medio +options.minimap.size.large=Grande +options.minimap.fontsize=Tamaño de Letra +options.minimap.radar=Radar... +options.minimap.radar.title=Opciones de Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostrar Hostiles +options.minimap.radar.showplayers=Mostrar jugadores +options.minimap.radar.showneutrals=Mostrar Neutrales +options.minimap.radar.iconoutlines=Contorno de ícono +options.minimap.radar.iconfiltering=Filtraje de ícono +options.minimap.radar.showplayerhelmets=Mostrar Cascos de jugadores +options.minimap.radar.showmobhelmets=Mostrar Cascos de mobs +options.minimap.radar.showplayernames=Mostrar Nombres de jugadores +options.minimap.radar.randomobs=Cualquier Mob +options.minimap.radar.selectmobs=Mobs que Mostrar... +options.minimap.detailsperformance=Detalles/Funcionamiento... +options.minimap.terrain.height=Altura +options.minimap.terrain.slope=Bajada +options.minimap.terrain.both=Ambos +options.minimap.filtering=Filtraje +options.minimap.watertransparency=Transparencia de Agua +options.minimap.blocktransparency=Transparencia de Bloque +options.minimap.biomes=Biomas +options.minimap.biomeoverlay=Sobreposición de Bioma +options.minimap.biomeoverlay.transparent=Transparencia +options.minimap.biomeoverlay.solid=Sólido +options.minimap.chunkgrid=Cuadrícula de Chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Opciones de Waypoints +options.minimap.waypoints.distance=Distancia Máxima +options.minimap.waypoints.infinite=Infinita +options.minimap.waypoints.deathpoints=Puntos de Muerte +options.minimap.waypoints.deathpoints.mostrecent=Más reciente +options.minimap.waypoints.deathpoints.all=Todos +options.minimap.waypoints.deathpoints.tooltip=Tiene efecto en la próxima muerte +options.minimap.waypoints.showwaypointnames=Nombres de Puntos en el Mapa +options.minimap.mobs.title=Mostrar o Esconder Tipos de Mob. +options.minimap.mobs.enable=Activar ícono de Mob +options.minimap.mobs.disable=Desactivar ícono de Mob +options.minimap.mobs.enabled=Este ícono se está mostrando. +options.minimap.mobs.disabled=Este ícono no se está mostrando. + +controls.minimap.title=Controles de Minimapa +controls.minimap.unbind1=Para desasociar una clave, pulse 'Escape'. +controls.minimap.unbind2=(Excepto por la clave de Menú - No la puede desasociar) +key.minimap.zoom=Zoom de Minimapa +key.minimap.togglefullscreen=Mostrar mapa en pantalla completa +key.minimap.voxelmapmenu=Menú de Minimapa +key.minimap.menu=Menú +key.minimap.waypointhotkey=Tecla para waypoints +key.minimap.togglemobs=Activar Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teletransportar a +minimap.waypoints.highlight=Elegir +minimap.waypoints.newwaypoint=Nuevo Waypoint +minimap.waypoints.deleteconfirm=¿Estás seguro que deseas borrar este waypoint? +minimap.waypoints.edit=Editar Waypoint +minimap.waypoints.new=Nuevo Waypoint +minimap.waypoints.name=Nombre del Waypoint +minimap.waypoints.choosecolor=Elegir Color: +minimap.waypoints.enabled=Activados: +minimap.waypoints.enable=Activar Waypoint +minimap.waypoints.disable=Desactivar Waypoint +minimap.waypoints.applicabledimensions=Dimensiones donde este waypoint será visible +minimap.waypoints.dimension.applies=Visible en esta dimensión +minimap.waypoints.dimension.notapplies=No visible en esta dimensión +minimap.waypoints.sortbyname=Nombre +minimap.waypoints.sortbydistance=Distancia +minimap.waypoints.sortbycreated=Creado +minimap.waypoints.sortbycolor=Color \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_VE.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_VE.lang new file mode 100644 index 0000000..6729f42 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/es_VE.lang @@ -0,0 +1,104 @@ +es_VE +minimap.ui.welcome1=Hecho por MamiyaOtaru +minimap.ui.welcome2=Traducido por janitoalevic +minimap.ui.welcome3=Bienvenido a VoxelMap, hay +minimap.ui.welcome4=algunas opciones y controles disponibles para modificar. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Opciones +minimap.ui.welcome6=Mostrar mapa en pantalla completa +minimap.ui.welcome7=Creación rápida de waypoint. +minimap.ui.welcome8=Ocultar este mensaje +minimap.ui.zoomlevel=Nivel de Zoom: +minimap.ui.otheroptions=Otras Opciones + +options.minimap.title=Opciones de Mapa +options.minimap.showcoordinates=Mostrar coordenadas +options.minimap.hideminimap=Ocultar Minimapa +options.minimap.cavemode=Activar modo caverna +options.minimap.dynamiclighting=Iluminación dinámica +options.minimap.terraindepth=Desnivel de terreno +options.minimap.squaremap=Mapa cuadrado +options.minimap.oldnorth=Norte viejo +options.minimap.ingamewaypoints=Waypoints In-game +options.minimap.ingamewaypoints.beacons=Faros +options.minimap.ingamewaypoints.signs=Nombres +options.minimap.ingamewaypoints.both=Ambos +options.minimap.location=Ubicación +options.minimap.location.topleft=Superior Izquierdo +options.minimap.location.topright=Superior Derecho +options.minimap.location.bottomright=Inferior Derecho +options.minimap.location.bottomleft=Inferior Izquierdo +options.minimap.size=Tamaño +options.minimap.size.small=Pequeño +options.minimap.size.medium=Medio +options.minimap.size.large=Grande +options.minimap.fontsize=Tamaño de Letra +options.minimap.radar=Radar... +options.minimap.radar.title=Opciones de Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostrar Hostiles +options.minimap.radar.showplayers=Mostrar jugadores +options.minimap.radar.showneutrals=Mostrar Neutrales +options.minimap.radar.iconoutlines=Contorno de ícono +options.minimap.radar.iconfiltering=Filtraje de ícono +options.minimap.radar.showplayerhelmets=Mostrar Cascos de jugadores +options.minimap.radar.showmobhelmets=Mostrar Cascos de mobs +options.minimap.radar.showplayernames=Mostrar Nombres de jugadores +options.minimap.radar.randomobs=Cualquier Mob +options.minimap.radar.selectmobs=Mobs que Mostrar... +options.minimap.detailsperformance=Detalles/Funcionamiento... +options.minimap.terrain.height=Altura +options.minimap.terrain.slope=Bajada +options.minimap.terrain.both=Ambos +options.minimap.filtering=Filtraje +options.minimap.watertransparency=Transparencia de Agua +options.minimap.blocktransparency=Transparencia de Bloque +options.minimap.biomes=Biomas +options.minimap.biomeoverlay=Sobreposición de Bioma +options.minimap.biomeoverlay.transparent=Transparencia +options.minimap.biomeoverlay.solid=Sólido +options.minimap.chunkgrid=Cuadrícula de Chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Opciones de Waypoints +options.minimap.waypoints.distance=Distancia Máxima +options.minimap.waypoints.infinite=Infinita +options.minimap.waypoints.deathpoints=Puntos de Muerte +options.minimap.waypoints.deathpoints.mostrecent=Más reciente +options.minimap.waypoints.deathpoints.all=Todos +options.minimap.waypoints.deathpoints.tooltip=Tiene efecto en la próxima muerte +options.minimap.waypoints.showwaypointnames=Nombres de Puntos en el Mapa +options.minimap.mobs.title=Mostrar o Esconder Tipos de Mob. +options.minimap.mobs.enable=Activar ícono de Mob +options.minimap.mobs.disable=Desactivar ícono de Mob +options.minimap.mobs.enabled=Este ícono se está mostrando. +options.minimap.mobs.disabled=Este ícono no se está mostrando. + +controls.minimap.title=Controles de Minimapa +controls.minimap.unbind1=Para desasociar una clave, pulse 'Escape'. +controls.minimap.unbind2=(Excepto por la clave de Menú - No la puede desasociar) +key.minimap.zoom=Zoom de Minimapa +key.minimap.togglefullscreen=Mostrar mapa en pantalla completa +key.minimap.voxelmapmenu=Menú de Minimapa +key.minimap.menu=Menú +key.minimap.waypointhotkey=Tecla para waypoints +key.minimap.togglemobs=Activar Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teletransportar a +minimap.waypoints.highlight=Elegir +minimap.waypoints.newwaypoint=Nuevo Waypoint +minimap.waypoints.deleteconfirm=¿Estás seguro que deseas borrar este waypoint? +minimap.waypoints.edit=Editar Waypoint +minimap.waypoints.new=Nuevo Waypoint +minimap.waypoints.name=Nombre del Waypoint +minimap.waypoints.choosecolor=Elegir Color: +minimap.waypoints.enabled=Activados: +minimap.waypoints.enable=Activar Waypoint +minimap.waypoints.disable=Desactivar Waypoint +minimap.waypoints.applicabledimensions=Dimensiones donde este waypoint será visible +minimap.waypoints.dimension.applies=Visible en esta dimensión +minimap.waypoints.dimension.notapplies=No visible en esta dimensión +minimap.waypoints.sortbyname=Nombre +minimap.waypoints.sortbydistance=Distancia +minimap.waypoints.sortbycreated=Creado +minimap.waypoints.sortbycolor=Color \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/et_EE.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/et_EE.lang new file mode 100644 index 0000000..ed01679 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/et_EE.lang @@ -0,0 +1,99 @@ +minimap.ui.welcome1=Uuendatud MamiyaOtaru poolt +minimap.ui.welcome2=Tõlgitud robotkoera poolt. Kui mod on kuvatud vales keeles, aita tõlkida! +minimap.ui.welcome3=Tere tulemast VoxelMap'i, sellel modil on +minimap.ui.welcome4=sinu jaoks palju võimalusi ja käsklusi. +minimap.ui.welcome5a=Suurenda/vähenda +minimap.ui.welcome5b=Valikud +minimap.ui.welcome6=Lülita täisekraani kaart sisse/välja. +minimap.ui.welcome7=Lisa kiirelt teepunkt. +minimap.ui.welcome8=Peida see sõnum +minimap.ui.zoomlevel=Suurendustase: +minimap.ui.otheroptions=Lisavalikud + +options.minimap.title=Minikaardi valikud +options.minimap.showcoordinates=Näita koordinaate +options.minimap.hideminimap=Peida minikaart +options.minimap.cavemode=Luba kooparežiim +options.minimap.dynamiclighting=Dünaamiline valgustus +options.minimap.terraindepth=Maastiku sügavus +options.minimap.squaremap=Ruudukujuline kaart +options.minimap.oldnorth=Vana põhjasuund +options.minimap.ingamewaypoints=Mängusisesed teepunktid +options.minimap.ingamewaypoints.beacons=majakad +options.minimap.ingamewaypoints.signs=sildid +options.minimap.ingamewaypoints.both=mõlemad +options.minimap.location=Asukoht +options.minimap.location.topleft=Ülal vasakul +options.minimap.location.topright=Ülal paremal +options.minimap.location.bottomright=All paremal +options.minimap.location.bottomleft=All vasakul +options.minimap.size=Suurus +options.minimap.size.small=Väike +options.minimap.size.medium=Tavaline +options.minimap.size.large=Suur +options.minimap.fontsize=Teksti suurus +options.minimap.radar=Radar... +options.minimap.radar.title=Radari valikud +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Näita koletisi +options.minimap.radar.showplayers=Näita mängijaid +options.minimap.radar.showneutrals=Näita neutraalseid +options.minimap.radar.iconoutlines=Ikoonide kontuurid +options.minimap.radar.iconfiltering=Ikoonide silumine +options.minimap.radar.showplayernames=Näita mängijate nimesid +options.minimap.radar.showplayerhelmets=Näita mängijate kiivreid +options.minimap.radar.showmobhelmets=Näita elukate kiivreid +options.minimap.radar.randomobs=Randomobs'i tugi +options.minimap.radar.selectmobs=Vali näidatavad elukad... +options.minimap.detailsperformance=Detailid/jõudlus... +options.minimap.terrain.height=kõrgustikud +options.minimap.terrain.slope=kallakud +options.minimap.terrain.both=mõlemad +options.minimap.filtering=Silumine +options.minimap.watertransparency=Vee läbipaistvus +options.minimap.blocktransparency=Plokkide läbipaistvus +options.minimap.biomes=Bioomid +options.minimap.biomeoverlay=Bioomikiht +options.minimap.biomeoverlay.transparent=läbipaistev +options.minimap.biomeoverlay.solid=läbipaistmatu +options.minimap.chunkgrid=Chunk'ide ruudustik +options.minimap.waypoints=Teepunktid... +options.minimap.waypoints.title=Teepunktide valikud +options.minimap.waypoints.distance=Maksimaalne kaugus +options.minimap.waypoints.infinite=lõpmatu +options.minimap.waypoints.deathpoints=Suremiskoht(-ad) +options.minimap.waypoints.deathpoints.mostrecent=viimane +options.minimap.waypoints.deathpoints.all=kõik +options.minimap.waypoints.deathpoints.tooltip=Nähtav pärast järgmist surma +options.minimap.waypoints.showwaypointnames=Näita teepunktide nimesid kaardil +options.minimap.mobs.title=Näita või peida kindlaid elukaliike +options.minimap.mobs.enable=Luba elukas +options.minimap.mobs.disable=Keela elukas +options.minimap.mobs.enabled=Elukate näitamine lubatud +options.minimap.mobs.disabled=Elukate näitamine keelatud + +controls.minimap.title=Minikaardi klahvid +controls.minimap.unbind1=Klahvi vabastamiseks valige see ning vajutage klahvile Esc. +controls.minimap.unbind2=(Välja arvatud menüünupp - seda ei saa vabastada) +key.minimap.zoom=Suurendus +key.minimap.togglefullscreen=Lülita täisekraani kaart sisse/välja +key.minimap.menu=Menüü +key.minimap.togglemobs=Lülita elukate näitamine sisse/välja +key.minimap.waypointhotkey=Loo teepunkt +key.minimap.waypointmenu=Teepunktide menüü + +minimap.waypoints.title=Teepunktid +minimap.waypoints.teleportto=Telepordi +minimap.waypoints.highlight=Too esile +minimap.waypoints.newwaypoint=Uus teepunkt +minimap.waypoints.deleteconfirm=Kas soovid kindlasti valitud teepunkti eemaldada? +minimap.waypoints.edit=Muuda teepunkti +minimap.waypoints.new=Uus teepunkt +minimap.waypoints.name=Teepunkti nimi +minimap.waypoints.choosecolor=Vali värv: +minimap.waypoints.enabled=Nähtavus: +minimap.waypoints.enable=Näita teepunkti +minimap.waypoints.disable=Peida teepunkt +minimap.waypoints.applicabledimensions=Dimensioonid, kus see teepunkt on nähtav +minimap.waypoints.dimension.applies=Nähtav selles dimensioonis +minimap.waypoints.dimension.notapplies=Peidetud selles dimensioonis \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/fi_FI.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/fi_FI.lang new file mode 100644 index 0000000..ef4498d --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/fi_FI.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Ylläpitäjänä MamiyaOtaru +minimap.ui.welcome2=Kääntäjä: Featherweight -45 +minimap.ui.welcome3=Tervetuloa VoxelMapiin, jossa on +minimap.ui.welcome4=monia toimintoja ja komentoja sinun käytössäsi. +minimap.ui.welcome5a=Zoomaa sisään/ulos +minimap.ui.welcome5b=Asetukset +minimap.ui.welcome6=Vaihda koko-ruudun karttaan. +minimap.ui.welcome7=Lisää reittipiste nopeasti. +minimap.ui.welcome8=Piilota tämä viesti +minimap.ui.zoomlevel=Zoomin taso: +minimap.ui.otheroptions=Muut asetukset + +options.minimap.title=Kartan asetukset +options.minimap.showcoordinates=Näytä koordinaatit +options.minimap.hideminimap=Piilota kartta +options.minimap.cavemode=Kytke Luola-Moodi +options.minimap.dynamiclighting=Dynaaminen valaistus +options.minimap.terraindepth=Maaston syvyys +options.minimap.squaremap=Neliö-kartta +options.minimap.oldnorth=Wanha Pohjoinen +options.minimap.ingamewaypoints=Pelin sisäiset reittipisteet +options.minimap.ingamewaypoints.beacons=Merkkivalot +options.minimap.ingamewaypoints.signs=Kyltit +options.minimap.ingamewaypoints.both=Molemmat +options.minimap.location=Sijainti +options.minimap.location.topleft=Ylä-Vasen +options.minimap.location.topright=Ylä-Oikea +options.minimap.location.bottomright=Ala-Oikea +options.minimap.location.bottomleft=Ala-Vasen +options.minimap.size=Koko +options.minimap.size.small=Pieni +options.minimap.size.medium=Tavallinen +options.minimap.size.large=Suuri +options.minimap.fontsize=Fontti-koko +options.minimap.radar=Tutka... +options.minimap.radar.title=Tutkan asetukset +options.minimap.radar.showradar=Tutka +options.minimap.radar.showhostiles=Näytä viholliset +options.minimap.radar.showplayers=Näytä pelaajat +options.minimap.radar.showneutrals=Näytä neutraalit +options.minimap.radar.iconoutlines=Ikoni-rajaus +options.minimap.radar.iconfiltering=Ikoni-filtterointi +options.minimap.radar.showplayernames=Näytä pelaajien nimet +options.minimap.radar.showplayerhelmets=Näytä pelaajien kypärät +options.minimap.radar.showmobhelmets=Näytä olentojen kypärät +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Näytettävät olennot... +options.minimap.detailsperformance=Yksityiskohdat/Suorituskyky... +options.minimap.terrain.height=Korkeus +options.minimap.terrain.slope=Kaltevuus +options.minimap.terrain.both=Molemmat +options.minimap.filtering=Filtterointi +options.minimap.watertransparency=Veden läpinäkyvyys +options.minimap.blocktransparency=Palikoiden läpinäkyvyys +options.minimap.biomes=Biomit +options.minimap.biomeoverlay=Biomipäälyste +options.minimap.biomeoverlay.transparent=Läpinäkyvä +options.minimap.biomeoverlay.solid=Kiinteä +options.minimap.chunkgrid=Pala-verkosto +options.minimap.waypoints=Reittipisteet... +options.minimap.waypoints.title=Reittipiste-asetukset +options.minimap.waypoints.distance=Maximi-etäisuus +options.minimap.waypoints.infinite=Loputon +options.minimap.waypoints.deathpoints=Kuolemanpiste(et) +options.minimap.waypoints.deathpoints.mostrecent=Uusimmat +options.minimap.waypoints.deathpoints.all=Kaikki +options.minimap.waypoints.deathpoints.tooltip=Astuu voimaan seuraavan kuoleman jälkeen +options.minimap.waypoints.showwaypointnames=Osoita nimi kartalla +options.minimap.mobs.title=Näytä ja piilota tietyt olento-tyypit +options.minimap.mobs.enable=Aktivoi olento +options.minimap.mobs.disable=Deaktivoi olento +options.minimap.mobs.enabled=Olento-näkymä aktivoitu +options.minimap.mobs.disabled=Olento-näkymä deaktivoitu + +controls.minimap.title=Kartan näppäimet +controls.minimap.unbind1=Avataksesi näppäimen, valitse ja paina 'Escape'. +controls.minimap.unbind2=(Paitsi Valikko-näppäintä - sitä ei voi purkaa) +key.minimap.zoom=Zoomaus +key.minimap.togglefullscreen=Vaihda koko-ruudun karttaan +key.minimap.menu=Valikko +key.minimap.togglemobs=Aktivoi/Deaktivoi olennot +key.minimap.waypointhotkey=Reittipisteiden pikanäppäin +key.minimap.waypointmenu=Reittipiste-valikko + +minimap.waypoints.title=Reittipisteet +minimap.waypoints.teleportto=Teleporttaa +minimap.waypoints.highlight=Korosta +minimap.waypoints.newwaypoint=Uusi reittipiste +minimap.waypoints.deleteconfirm=Oletko varma että haluat poistaa tämän reittipisteen? +minimap.waypoints.edit=Muokkaa reittipistettä +minimap.waypoints.new=Uusi reittipiste +minimap.waypoints.name=Reittipisteen nimi +minimap.waypoints.choosecolor=Valitse väri: +minimap.waypoints.enabled=Aktivoitu: +minimap.waypoints.enable=Aktivoi reittipiste +minimap.waypoints.disable=Deaktivoi reittipiste +minimap.waypoints.applicabledimensions=Ulottuvuudet joissa tämä reittipiste on näkyvissä +minimap.waypoints.dimension.applies=Näkyvissä tässä ulottuvuudessa +minimap.waypoints.dimension.notapplies=Ei näkyvissä tässä ulottuvuudessa +minimap.waypoints.sortbyname=Nimi +minimap.waypoints.sortbydistance=Matka +minimap.waypoints.sortbycreated=Luotu +minimap.waypoints.sortbycolor=Väri diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/fr_FR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/fr_FR.lang new file mode 100644 index 0000000..c1a6b6c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/fr_FR.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Mod par MamiyaOtaru +minimap.ui.welcome2=Traduit par: Thegajout et Ntuttle +minimap.ui.welcome3=Bienvenue à VoxelMap, il y a +minimap.ui.welcome4=beaucoup de commandes pour vous +minimap.ui.welcome5a=Zoom Agrandir/Rétrécir +minimap.ui.welcome5b=Options +minimap.ui.welcome6=Mettre la map en plein écran +minimap.ui.welcome7=Ajouter un Waypoint rapidement +minimap.ui.welcome8=Cacher ce message +minimap.ui.zoomlevel=Niveau de zoom: +minimap.ui.otheroptions=Autres Options + +options.minimap.title=Options concernant la minimap +options.minimap.showcoordinates=Montrer les coordonés +options.minimap.hideminimap=Cacher la minimap +options.minimap.cavemode=Activer le mode caverne +options.minimap.dynamiclighting=Eclairage dynamique +options.minimap.terraindepth=Profondeur du terrain +options.minimap.squaremap=Map Carrée +options.minimap.oldnorth=Vieux nord +options.minimap.ingamewaypoints=Waypoints dans la jeu +options.minimap.ingamewaypoints.beacons=Balises +options.minimap.ingamewaypoints.signs=Panneaux +options.minimap.ingamewaypoints.both=Les deux +options.minimap.location=Locasilation +options.minimap.location.topleft=En haut à gauche +options.minimap.location.topright=En haut à droite +options.minimap.location.bottomright=En bas à droite +options.minimap.location.bottomleft=En haut à gauche +options.minimap.size=Taille +options.minimap.size.small=Petite +options.minimap.size.medium=Normale +options.minimap.size.large=Grande +options.minimap.fontsize=Taille de la police +options.minimap.radar=Radar... +options.minimap.radar.title=Options du radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Montrer les mobs hostiles +options.minimap.radar.showplayers=Montrer les joueurs +options.minimap.radar.showneutrals=Montrer les mobs passifs +options.minimap.radar.iconoutlines=Contour des icônes +options.minimap.radar.iconfiltering=Filtres des icônes +options.minimap.radar.showplayernames=Montrer les noms des joueurs +options.minimap.radar.showplayerhelmets=Montrer les casques des joueurs +options.minimap.radar.showmobhelmets=Montrer les casques des mobs +options.minimap.radar.randomobs=Mobs Aléatoires +options.minimap.radar.selectmobs=Mobs à afficher... +options.minimap.detailsperformance=Détails/Performance... +options.minimap.terrain.height=Hauteur +options.minimap.terrain.slope=Pente +options.minimap.terrain.both=Les deux +options.minimap.filtering=Filtres +options.minimap.watertransparency=Transparence de l'eau +options.minimap.blocktransparency=Transparence des blocs +options.minimap.biomes=Biomes +options.minimap.biomeoverlay=Montrer les biomes +options.minimap.biomeoverlay.transparent=Transparent +options.minimap.biomeoverlay.solid=Solide +options.minimap.chunkgrid=Grille des chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Options du Waypoint +options.minimap.waypoints.distance=Distance Maximale +options.minimap.waypoints.infinite=Infinie +options.minimap.waypoints.deathpoints=Point de mort +options.minimap.waypoints.deathpoints.mostrecent=Plus récent +options.minimap.waypoints.deathpoints.all=Tous +options.minimap.waypoints.deathpoints.tooltip=A de l'éffect sur la prochaine mort +options.minimap.waypoints.showwaypointnames=Noms des waypoints sur la carte +options.minimap.mobs.title=Montrer or Cacher les types de mobs individuels +options.minimap.mobs.enable=Activer mob +options.minimap.mobs.disable=Désactiver mob +options.minimap.mobs.enabled=Affichage des mobs activé +options.minimap.mobs.disabled=Affichage des mobs désactivé + +controls.minimap.title=Controles... +controls.minimap.unbind1=Pour changer un controle cliquer dessus, +controls.minimap.unbind2=et appuyer sur la touche désirée +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Mettre la map en plein écran +key.minimap.menu=Menu +key.minimap.togglemobs=Changer pour les mobs +key.minimap.waypointhotkey=Touche de raccourci pour le waypoint +key.minimap.waypointmenu=Menu du waypoint + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Aller à +minimap.waypoints.highlight=Surligner +minimap.waypoints.newwaypoint=Nouveau Waypoint +minimap.waypoints.deleteconfirm=Etes vous sur de vouloir supprimer ce waypoint? +minimap.waypoints.edit=Editer le Waypoint +minimap.waypoints.new=Nouveau Waypoint +minimap.waypoints.name=Nom du Waypoint +minimap.waypoints.choosecolor=Choisir la couleur Couleur: +minimap.waypoints.enabled=Activé: +minimap.waypoints.enable=Activer le Waypoint +minimap.waypoints.disable=Désactiver Waypoint +minimap.waypoints.applicabledimensions=Dimensions dans lesquelles ce waypoints sera visible +minimap.waypoints.dimension.applies=Visible dans cette dimension +minimap.waypoints.dimension.notapplies=Invisible dans cette dimension +minimap.waypoints.sortbyname=Nom +minimap.waypoints.sortbydistance=Distance +minimap.waypoints.sortbycreated=Date/Heure Crée +minimap.waypoints.sortbycolor=Couleur \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/hr_HR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/hr_HR.lang new file mode 100644 index 0000000..999f303 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/hr_HR.lang @@ -0,0 +1,99 @@ +minimap.ui.welcome1=Održava MamiyaOtaru +minimap.ui.welcome2=Preveo: NuclearBanana +minimap.ui.welcome3=Dobrodošli u VoxelMap, postoji +minimap.ui.welcome4=veliki broj komandi koje su vam dostupne. +minimap.ui.welcome5a=Zumiraj/Odzumiraj +minimap.ui.welcome5b=Podešavanja +minimap.ui.welcome6=Prebacivanje mape preko celog ekrana. +minimap.ui.welcome7=Dodaj putanju. +minimap.ui.welcome8=Sakrij ovu poruku +minimap.ui.zoomlevel=Nivo zumiranja: +minimap.ui.otheroptions=Ostala Podešavanja + +options.minimap.title=Podešavanja Minimape +options.minimap.showcoordinates=Prikaz Putanja +options.minimap.hideminimap=Sakrij Minimapu +options.minimap.cavemode=Omogući Prikaz Pećina +options.minimap.dynamiclighting=Dinamičko Osvetljenje +options.minimap.terraindepth=Dubina Terena +options.minimap.squaremap=Kvadratna Mapa +options.minimap.oldnorth=Stari Sever +options.minimap.ingamewaypoints=Putanje u Igri +options.minimap.ingamewaypoints.beacons=Svetionici +options.minimap.ingamewaypoints.signs=Znakovi +options.minimap.ingamewaypoints.both=Oba +options.minimap.location=Lokacija +options.minimap.location.topleft=Gore Levo +options.minimap.location.topright=Gore Desno +options.minimap.location.bottomright=Dole Desno +options.minimap.location.bottomleft=Dole Levo +options.minimap.size=Veličina +options.minimap.size.small=Malo +options.minimap.size.medium=Normalno +options.minimap.size.large=Veliko +options.minimap.fontsize=Velicina Slova +options.minimap.radar=Radar... +options.minimap.radar.title=Podešavanje Radara +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Prikaži Neprijatelje +options.minimap.radar.showplayers=Prikaži Igrače +options.minimap.radar.showneutrals=Prikaži Mirne +options.minimap.radar.iconoutlines=Nacrti Ikona +options.minimap.radar.iconfiltering=Filtriranje Ikona +options.minimap.radar.showplayernames=Prikaži Imena Igrača +options.minimap.radar.showplayerhelmets=Prikaži Šlemove Igrača +options.minimap.radar.showmobhelmets=Prikaži Šlemove Rulja +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Rulje za Prikaz... +options.minimap.detailsperformance=Detalji/Performance... +options.minimap.terrain.height=Visina +options.minimap.terrain.slope=Nagib +options.minimap.terrain.both=Oba +options.minimap.filtering=Filtriranje +options.minimap.watertransparency=Providnost Vode +options.minimap.blocktransparency=Providnost Kocki +options.minimap.biomes=Biomi +options.minimap.biomeoverlay=Preklapanje Bioma +options.minimap.biomeoverlay.transparent=Providan +options.minimap.biomeoverlay.solid=Čvrst +options.minimap.chunkgrid=Chunk Grid +options.minimap.waypoints=Putanje... +options.minimap.waypoints.title=Podešavanje Putanje +options.minimap.waypoints.distance=Najveća Razdaljina +options.minimap.waypoints.infinite=Beskonacan +options.minimap.waypoints.deathpoints=Mesto Smrti +options.minimap.waypoints.deathpoints.mostrecent=Najnoviji +options.minimap.waypoints.deathpoints.all=Sve +options.minimap.waypoints.deathpoints.tooltip=Ima uticaj na sledecu smrt +options.minimap.waypoints.showwaypointnames=Prikaži imena na mapi +options.minimap.mobs.title=Prikaži ili Sakrij Vrste Rulja +options.minimap.mobs.enable=Omogući Rulje +options.minimap.mobs.disable=Onemogući Rulje +options.minimap.mobs.enabled=Omogućeno Prikazivanje Rulja +options.minimap.mobs.disabled=Onemogućeno Prikazivanje Rulja + +controls.minimap.title=Kontrole Minimape +controls.minimap.unbind1=Da raskoraćite dugme, izaberite ga i pritisnite 'Escape'. +controls.minimap.unbind2=(Osim za Meni dugme - ne može se raskoračiti) +key.minimap.zoom=Zumiraj +key.minimap.togglefullscreen=Omogući Mapu Preko Celog Ekrana +key.minimap.menu=Meni +key.minimap.togglemobs=Omogući Rulje +key.minimap.waypointhotkey=Dugme za Putanje +key.minimap.waypointmenu=Meni Putanji + +minimap.waypoints.title=Putanje +minimap.waypoints.teleportto=Teleportuj se +minimap.waypoints.highlight=Osvetljenje +minimap.waypoints.newwaypoint=Nova Putanja +minimap.waypoints.deleteconfirm=DA li si siguran da želiš da ukoniš ovu putanju? +minimap.waypoints.edit=Uredi Putanju +minimap.waypoints.new=Nova Putanja +minimap.waypoints.name=Ime Putanje +minimap.waypoints.choosecolor=Izaberi Boju: +minimap.waypoints.enabled=Omogućeno: +minimap.waypoints.enable=Omogući Putanje +minimap.waypoints.disable=Onemogući Putanje +minimap.waypoints.applicabledimensions=Dimnzije u kojim će putanja biti vidljiva +minimap.waypoints.dimension.applies=Vidljiva u dimenzijama +minimap.waypoints.dimension.notapplies=Nije vidljiva u dimenzijama \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/hu_HU.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/hu_HU.lang new file mode 100644 index 0000000..b493251 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/hu_HU.lang @@ -0,0 +1,96 @@ +minimap.ui.welcome1=Karbantartó: MamiyaOtaru +minimap.ui.welcome2=Fordította: waltzer +minimap.ui.welcome3=Üdvözlet a VoxelMap-ban, ahol +minimap.ui.welcome4=számos funkciót és parancsot érhetsz el. +minimap.ui.welcome5a=Nagyítás / kicsinyítés +minimap.ui.welcome5b=Beállítások +minimap.ui.welcome6=Teljes képernyős térkép +minimap.ui.welcome7=Útpont gyors hozzáadása +minimap.ui.welcome8=Üzenet elrejtése +minimap.ui.zoomlevel=Nagyítási szint +minimap.ui.otheroptions=Egyéb beállítások +options.minimap.title=Minitérkép beállítások +options.minimap.showcoordinates=Koordináták kijelzése +options.minimap.hideminimap=Minitérkép rejtése +options.minimap.cavemode=Barlang mód engedélyezése +options.minimap.dynamiclighting=Dinamikus fények +options.minimap.terraindepth=Terep mélység +options.minimap.squaremap=Szögletes térkép +options.minimap.oldnorth=Régi Észak +options.minimap.ingamewaypoints=Útpontok a játékban +options.minimap.ingamewaypoints.beacons=Jelzőfények +options.minimap.ingamewaypoints.signs=Jelek +options.minimap.ingamewaypoints.both=Minden +options.minimap.location=Elhelyezés +options.minimap.location.topleft=Bal felső +options.minimap.location.topright=Jobb felső +options.minimap.location.bottomright=Jobb alsó +options.minimap.location.bottomleft=Bal alsó +options.minimap.size=Méret +options.minimap.size.small=Kicsi +options.minimap.size.medium=Közepes +options.minimap.size.large=Nagy +options.minimap.fontsize=Betűméret +options.minimap.radar=Radar... +options.minimap.radar.title=Radar beállítások +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Ellenség mutatása +options.minimap.radar.showplayers=Játékosok mutatása +options.minimap.radar.showneutrals=Semlegesek mutatása +options.minimap.radar.iconoutlines=Ikon körvonal +options.minimap.radar.iconfiltering=Ikon szűrés +options.minimap.radar.showplayerhelmets=Játékos páncélzat mutatása +options.minimap.radar.showmobhelmets=Mob páncélzat mutatása +options.minimap.radar.showplayernames=Játékos nevek mutatása +options.minimap.radar.randomobs=Véletlen mob +options.minimap.radar.selectmobs=Mobok kijelzése +options.minimap.detailsperformance=Részletek / teljesítmény ... +options.minimap.terrain.height=Magasság +options.minimap.terrain.slope=Lejtés +options.minimap.terrain.both=Minden +options.minimap.filtering=Szűrés +options.minimap.watertransparency=A víz átlátszósága +options.minimap.blocktransparency=Blokk átlátszóság +options.minimap.biomes=Életterek +options.minimap.biomeoverlay=Élettér réteg +options.minimap.biomeoverlay.transparent=Átlátszó +options.minimap.biomeoverlay.solid=Átlátszatlan +options.minimap.chunkgrid=Darab rács +options.minimap.waypoints=Útpontok... +options.minimap.waypoints.title=Útpont beállítások +options.minimap.waypoints.distance=Max. távolság +options.minimap.waypoints.infinite=Végtelen +options.minimap.waypoints.deathpoints=Halálpont(ok) +options.minimap.waypoints.deathpoints.mostrecent=Legutóbbi +options.minimap.waypoints.deathpoints.all=Mind +options.minimap.waypoints.deathpoints.tooltip=A következő haláltól érvényes +options.minimap.waypoints.showwaypointnames=Pont nevek a térképen +options.minimap.mobs.title=Egyéni mobtípusok mutatása vagy rejtése +options.minimap.mobs.enable=Mob ikon engedélyezése +options.minimap.mobs.disable=Mob ikon tiltása +options.minimap.mobs.enabled=Ez az ikon megjelenik +options.minimap.mobs.disabled=Ez az ikon nem jelenik meg +controls.minimap.title=Minitérkép kezelés +controls.minimap.unbind1=Törléshez válasszd ki a gombot, es nyomj 'ESC'-et. +controls.minimap.unbind2=(Kivéve a Menü-gomb, az nem változtatható) +key.minimap.zoom=Nagyítás +key.minimap.togglefullscreen=Teljes képernyős térkép +key.minimap.voxelmapmenu=VoxelMap Menü +key.minimap.menu=Menü +key.minimap.waypointhotkey=Útpont gyorsbillentyű +key.minimap.togglemobs=Lények kapcsolása +minimap.waypoints.title=Útpontok +minimap.waypoints.teleportto=Teleportálás ide +minimap.waypoints.highlight=Kiemelés +minimap.waypoints.newwaypoint=Új útpont +minimap.waypoints.deleteconfirm=Biztosan kitörlöd ezt az útpontot? +minimap.waypoints.edit=Útpont szerkesztés +minimap.waypoints.new=Új útpont +minimap.waypoints.name=Útpont neve +minimap.waypoints.choosecolor=Szín választás +minimap.waypoints.enabled=Engedélyezve: +minimap.waypoints.enable=Útpont engedélyezése +minimap.waypoints.disable=Útpont tiltása +minimap.waypoints.applicabledimensions=Dimenziók, amelyben ez a útpont látható +minimap.waypoints.dimension.applies=Látható ebben a dimenzióban +minimap.waypoints.dimension.notapplies=Nem látható ebben a dimenzióban diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/i18n.txt b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/i18n.txt new file mode 100644 index 0000000..7a9895e Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/i18n.txt differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/id_ID.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/id_ID.lang new file mode 100644 index 0000000..5210268 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/id_ID.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Dikembangkan oleh MamiyaOtaru +minimap.ui.welcome2=Diterjemahkan oleh Bobby Wibowo +minimap.ui.welcome3=Selamat datang di VoxelMap, ada beberapa +minimap.ui.welcome4=fitur dan perintah yang tersedia untuk anda. +minimap.ui.welcome5a=Perbesar/Perkecil +minimap.ui.welcome5b=Pengaturan +minimap.ui.welcome6=Beralih ke Peta Layar Penuh +minimap.ui.welcome7=Tambahkan Penanda Arah +minimap.ui.welcome8=Semunyikan pesan ini +minimap.ui.zoomlevel=Tingkat Perbesaran: +minimap.ui.otheroptions=Pengaturan Lainnya + +options.minimap.title=Pengaturan Minimap +options.minimap.showcoordinates=Tampilkan Koordinat +options.minimap.hideminimap=Sembunyikan Minimap +options.minimap.cavemode=Aktifkan Peta Gua +options.minimap.dynamiclighting=Pencahayaan Dinamis +options.minimap.terraindepth=Lokasi Kedalaman +options.minimap.squaremap=Peta Kotak +options.minimap.oldnorth=Utara Lama +options.minimap.ingamewaypoints=Waypoint permainan +options.minimap.ingamewaypoints.beacons=Beacons +options.minimap.ingamewaypoints.signs=Signs +options.minimap.ingamewaypoints.both=Keduanya +options.minimap.location=Lokasi +options.minimap.location.topleft=Kiri Atas +options.minimap.location.topright=Kanan Atas +options.minimap.location.bottomright=Kanan Bawah +options.minimap.location.bottomleft=Kiri Bawah +options.minimap.size=Ukuran +options.minimap.size.small=Kecil +options.minimap.size.medium=Biasa +options.minimap.size.large=Besar +options.minimap.fontsize=Ukuran Huruf +options.minimap.radar=Radar... +options.minimap.radar.title=Pengaturan Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Tampilkan Mob Jahat +options.minimap.radar.showplayers=Tampilkan Pemain +options.minimap.radar.showneutrals=Tampilkan Mob Netral +options.minimap.radar.iconoutlines=Garis Luar Ikon +options.minimap.radar.iconfiltering=Penyaringan Ikon +options.minimap.radar.showplayernames=Tampilkan Nama Pemain +options.minimap.radar.showplayerhelmets=Tampilkan Helem Pemain +options.minimap.radar.showmobhelmets=Tampilkan Helem Pemain +options.minimap.radar.randomobs=Mob Acak +options.minimap.radar.selectmobs=Mob yang akan ditampilkan... +options.minimap.detailsperformance=Keterangan/Performa... +options.minimap.terrain.height=Ketinggian +options.minimap.terrain.slope=Lereng +options.minimap.terrain.both=Keduanya +options.minimap.filtering=Penyaringan +options.minimap.watertransparency=Ketransparanan Air +options.minimap.blocktransparency=Ketransparanan Blok +options.minimap.biomes=Bioma +options.minimap.biomeoverlay=Hamparan Bioma +options.minimap.biomeoverlay.transparent=Transparan +options.minimap.biomeoverlay.solid=Padat +options.minimap.chunkgrid=Potongan Chunk +options.minimap.waypoints=Penunjuk Arah... +options.minimap.waypoints.title=Pengaturan Penunjuk Arah +options.minimap.waypoints.distance=Jarak Maksimal +options.minimap.waypoints.infinite=Tak Terbatas +options.minimap.waypoints.deathpoints=Titik Kematian(s) +options.minimap.waypoints.deathpoints.mostrecent=Paling Akhir +options.minimap.waypoints.deathpoints.all=Semua +options.minimap.waypoints.deathpoints.tooltip=Berfungsi setelah kematian berikutnya +options.minimap.waypoints.showwaypointnames=Nama Poin di Map +options.minimap.mobs.title=Tampilkan atau Sembunyikan Ikon-ikon Mob +options.minimap.mobs.enable=Tampilkan Mob +options.minimap.mobs.disable=Sembunyikan Mob +options.minimap.mobs.enabled=Tampilan Mob Dihidupkan +options.minimap.mobs.disabled=Tampilan Mob Dimatikan + +controls.minimap.title=Kontrol Minimap +controls.minimap.unbind1=Untuk mengubah penanda tombol, pilih dan tekan 'Escape/Esc'. +controls.minimap.unbind2=(Terkecuali untuk tombol Menu, tidak bisa diubah) +key.minimap.zoom=Perbesar +key.minimap.togglefullscreen=Beralih ke Peta Layar Penuh +key.minimap.menu=Menu +key.minimap.togglemobs=Alihkan Mob +key.minimap.waypointhotkey=Hotkey Penanda Arah +key.minimap.waypointmenu=Menu Penanda Arah + +minimap.waypoints.title=Penanda Arah +minimap.waypoints.teleportto=Berpindah Ke +minimap.waypoints.highlight=Sorot +minimap.waypoints.newwaypoint=Penanda Arah Baru +minimap.waypoints.deleteconfirm=Apakah anda yakin untuk menghapus penanda arah ini? +minimap.waypoints.edit=Ubah Penanda Arah +minimap.waypoints.new=Tambah Penanda Arah +minimap.waypoints.name=Nama Penambah Arah +minimap.waypoints.choosecolor=Pilih Warna: +minimap.waypoints.enabled=Diperbolehkan: +minimap.waypoints.enable=Perbolehkan Penanda Arah +minimap.waypoints.disable=Larang Penanda Arah +minimap.waypoints.applicabledimensions=Dimensi dimana penanda arah ini akan ditampilkan +minimap.waypoints.dimension.applies=Ditampilkan pada dimensi ini +minimap.waypoints.dimension.notapplies=Tidak ditampilkan pada dimensi ini +minimap.waypoints.sortbyname=Nama +minimap.waypoints.sortbydistance=Jarak +minimap.waypoints.sortbycreated=Dibuat +minimap.waypoints.sortbycolor=Warna \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/is_IS.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/is_IS.lang new file mode 100644 index 0000000..c9f15cb --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/is_IS.lang @@ -0,0 +1,89 @@ +minimap.ui.welcome1=Viðhaldið af MamiyaOtaru +minimap.ui.welcome2=Þýtt af: Ef þetta er ekki tungumál, hjálpa þýða! +minimap.ui.welcome3=Velkomin VoxelMap, það eru +minimap.ui.welcome4=fjöldi af lögun og skipanir í boði fyrir þig. +minimap.ui.welcome5a=Þysja inn / út +minimap.ui.welcome5b=Valkostir +minimap.ui.welcome6=Víxla fullur skjár kort. +minimap.ui.welcome7=bæta Fljótt waypoint. +minimap.ui.welcome8=Fela þessi skilaboð +minimap.ui.zoomlevel=Zoom Level: +minimap.ui.otheroptions=Annað Valkostir + +options.minimap.title=minimap Valkostir +options.minimap.showcoordinates=Display Hnit +options.minimap.hideminimap=Fela minimap +options.minimap.cavemode=Virkja Cave Mode +options.minimap.dynamiclighting=Dynamic Lýsing +options.minimap.terraindepth=Terrain Dýpt +options.minimap.squaremap=Square Map +options.minimap.oldnorth=Old North +options.minimap.ingamewaypoints=In-leikur punktar +options.minimap.ingamewaypoints.beacons=Beacons +options.minimap.ingamewaypoints.signs=Signs +options.minimap.ingamewaypoints.both=Báðir +options.minimap.location=Staðsetning +options.minimap.location.topleft=Top Vinstri +options.minimap.location.topright=Top Right +options.minimap.location.bottomright=Bottom Right +options.minimap.location.bottomleft=Bottom Left +options.minimap.size=stærð +options.minimap.size.small=Small +options.minimap.size.medium=Venjulegur +options.minimap.size.large=Large +options.minimap.radar=Radar ... +options.minimap.radar.title=Ratsjá Valkostir +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Sýna hostiles +options.minimap.radar.showplayers=Sýna Players +options.minimap.radar.showneutrals=Sýna hlutlaus +options.minimap.radar.iconoutlines=Táknmynd lýsir +options.minimap.radar.iconfiltering=Icon sía +options.minimap.radar.showplayerhelmets=Sýna Player Hjálmar +options.minimap.radar.showmobhelmets=Sýna Mob Hjálmar +options.minimap.radar.randomobs=Randomobs +options.minimap.detailsperformance=Upplýsingar / afköst ... +options.minimap.terrain.height=Hæð +options.minimap.terrain.slope=Halli +options.minimap.terrain.both=Báðir +options.minimap.filtering=Filtering +options.minimap.watertransparency=Vatn Transparency +options.minimap.blocktransparency=Block Transparency +options.minimap.biomes=biomes +options.minimap.biomeoverlay=Biome Yfirborð +options.minimap.biomeoverlay.transparent=Gegnsætt +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Klumpur Grid +options.minimap.waypoints=punktar ... +options.minimap.waypoints.title=Waypoint Valkostir +options.minimap.waypoints.distance=Max Fjarlægð +options.minimap.waypoints.infinite=Infinite +options.minimap.waypoints.deathpoints=Deathpoint (s) +options.minimap.waypoints.deathpoints.mostrecent=Nýjasta +options.minimap.waypoints.deathpoints.all=All +options.minimap.waypoints.deathpoints.tooltip=Tekur gildi á næstu dauða + +controls.minimap.title=minimap Stýrir +controls.minimap.unbind1=Til unbind lykil, velja það og ýta á 'Escape'. +controls.minimap.unbind2=(Nema fyrir á Valmynd takkann - það getur ekki verið óbundið) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Víxla Fullscreen Kort +key.minimap.menu=Valmynd +key.minimap.waypointhotkey=Waypoint Hotkey +key.minimap.togglemobs=Víxla lýði + +minimap.waypoints.title=punktar +minimap.waypoints.teleportto=teleport til +minimap.waypoints.highlight=Hápunktur +minimap.waypoints.newwaypoint=New Waypoint +minimap.waypoints.deleteconfirm=Ertu viss um að þú viljir fjarlægja þetta waypoint? +minimap.waypoints.edit=Breyta Waypoint +minimap.waypoints.new=New Waypoint +minimap.waypoints.name=Waypoint Name +minimap.waypoints.choosecolor=Veldu Litur: +minimap.waypoints.enabled=Alltaf: +minimap.waypoints.enable=Virkja Waypoint +minimap.waypoints.disable=Slökkva Waypoint +minimap.waypoints.applicabledimensions=Stærð sem þetta waypoint verður sýnilegt +minimap.waypoints.dimension.applies=Birtist í þessari vídd +minimap.waypoints.dimension.notapplies=Ekki sýnilegt í þessari vídd \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/it_IT.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/it_IT.lang new file mode 100644 index 0000000..077fca2 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/it_IT.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Mantenuto da MamiyaOtaru +minimap.ui.welcome2=Tradotto da: Sporadicamente e Alex3850 +minimap.ui.welcome3=Benvenuto in VoxelMap, ci sono +minimap.ui.welcome4=molte funzioni a tua disposizione. +minimap.ui.welcome5a=Zoom +/- +minimap.ui.welcome5b=Opzioni +minimap.ui.welcome6=Apri la mappa grande. +minimap.ui.welcome7=Aggiungi velocemente un Punto di Interesse. +minimap.ui.welcome8=Nascondi questo messaggio +minimap.ui.zoomlevel=Livello di zoom: +minimap.ui.otheroptions=Altre opzioni + +options.minimap.title=Opzioni Minimappa +options.minimap.showcoordinates=Mostra Coordinate +options.minimap.hideminimap=Nascondi Minimappa +options.minimap.cavemode=Abilita Modalita' Caverna +options.minimap.dynamiclighting=Luce Dinamica +options.minimap.terraindepth=Profondita' Terreno +options.minimap.squaremap=Mappa Quadrata +options.minimap.oldnorth=Vecchio Nord +options.minimap.ingamewaypoints=Punti di Interesse nel gioco +options.minimap.ingamewaypoints.beacons=Fari +options.minimap.ingamewaypoints.signs=Scritte +options.minimap.ingamewaypoints.both=Entrambi +options.minimap.location=Posizione +options.minimap.location.topleft=In Alto a Sinistra +options.minimap.location.topright=In Alto a Destra +options.minimap.location.bottomright=In Basso a Destra +options.minimap.location.bottomleft=In Basso a Sinistra +options.minimap.size=Grandezza +options.minimap.size.small=Piccola +options.minimap.size.medium=Normale +options.minimap.size.large=Grande +options.minimap.fontsize=Grandezza Carattere +options.minimap.radar=Radar... +options.minimap.radar.title=Opzioni Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostra Mob Aggressivi +options.minimap.radar.showplayers=Mostra Giocatori +options.minimap.radar.showneutrals=Mostra Mob Pacifici +options.minimap.radar.iconoutlines=Bordi Icone +options.minimap.radar.iconfiltering=Filtraggio Icone +options.minimap.radar.showplayernames=Mostra Nomi Giocatori +options.minimap.radar.showplayerhelmets=Mostra Elmetti Giocatori +options.minimap.radar.showmobhelmets=Mostra Elmetti Mob +options.minimap.radar.randomobs=Mob Casuali +options.minimap.radar.selectmobs=Seleziona Mob... +options.minimap.detailsperformance=Dettagli/Prestazioni... +options.minimap.terrain.height=Altezza +options.minimap.terrain.slope=Inclinazione +options.minimap.terrain.both=Entrambe +options.minimap.filtering=Filtraggio +options.minimap.watertransparency=Trasparenza Acqua +options.minimap.blocktransparency=Trasparenza Blocchi +options.minimap.biomes=Biomi +options.minimap.biomeoverlay=Copertura Biomi +options.minimap.biomeoverlay.transparent=Transparente +options.minimap.biomeoverlay.solid=Solido +options.minimap.chunkgrid=Griglia Chunk +options.minimap.waypoints=Punti di Interesse... +options.minimap.waypoints.title=Opzioni Punti di Interesse +options.minimap.waypoints.distance=Distanza Massima +options.minimap.waypoints.infinite=Infinito +options.minimap.waypoints.deathpoints=Punti di Morte +options.minimap.waypoints.deathpoints.mostrecent=Più Recenti +options.minimap.waypoints.deathpoints.all=Tutti +options.minimap.waypoints.deathpoints.tooltip=Hanno effetto nella prossima morte +options.minimap.waypoints.showwaypointnames=Mostra Nome Punti di Interesse +options.minimap.mobs.title=Mostra o Nascondi Ogni Singolo Tipo di Mob +options.minimap.mobs.enable=Abilita Mob +options.minimap.mobs.disable=Disabilita Mob +options.minimap.mobs.enabled=Schermo Mob Attivato +options.minimap.mobs.disabled=Schermo Mob Disattivato + +controls.minimap.title=Controlli Minimappa +controls.minimap.unbind1=Per cancellare un tasto, selezionalo e premi 'Esc'. +controls.minimap.unbind2=(Eccezione per il tasto Menu - non può essere cancellata) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Mostra/Nascondi Mappa Grande +key.minimap.menu=Menu +key.minimap.togglemobs=Mostra/Nascondi Mob +key.minimap.waypointhotkey=Tasto Rapido creazione Punto di Interesse +key.minimap.waypointmenu=Menu Punti di Interesse + +minimap.waypoints.title=Punti di interesse +minimap.waypoints.teleportto=Teletrasportati a +minimap.waypoints.highlight=Evidenzia +minimap.waypoints.newwaypoint=Nuovo Punto di Interesse +minimap.waypoints.deleteconfirm=Sei sicuro di voler rimuovere questo Punto di Interesse? +minimap.waypoints.edit=Modifica Punto di Interesse +minimap.waypoints.new=Nuovo Punto di Interesse +minimap.waypoints.name=Nome Punto di Interesse +minimap.waypoints.choosecolor=Seleziona Colore: +minimap.waypoints.enabled=Abilitato: +minimap.waypoints.enable=Abilita Punto di Interesse +minimap.waypoints.disable=Disabilita Punto di Interesse +minimap.waypoints.applicabledimensions=Mondi in cui può essere visibile questo Punto di Interesse +minimap.waypoints.dimension.applies=Visibile in questo mondo +minimap.waypoints.dimension.notapplies=Non visibile in questo mondo +minimap.waypoints.sortbyname=Nome +minimap.waypoints.sortbydistance=Distanza +minimap.waypoints.sortbycreated=Creato +minimap.waypoints.sortbycolor=Colore diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ja_JP.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ja_JP.lang new file mode 100644 index 0000000..183bd10 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ja_JP.lang @@ -0,0 +1,78 @@ +minimap.ui.welcome1=保守担当者: 間宮小樽 +minimap.ui.welcome2=訳:Ravenclaw572 +minimap.ui.welcome3=ミニマップへようこそ、 +minimap.ui.welcome4=あなたに利用可能な機能とコマンドの数があります。 +minimap.ui.welcome5a=ズームイン/アウト +minimap.ui.welcome5b=オプション +minimap.ui.welcome6=フルスクリーンマップを切り替え。 +minimap.ui.welcome7=迅速にウェイポイントを追加。 +minimap.ui.welcome8=このメッセージを非表示 +minimap.ui.zoomlevel=ズームレベル: +minimap.ui.otheroptions=その他のオプション + +options.minimap.title=ミニマップのオプション +options.minimap.showcoordinates=表示座標 +options.minimap.hideminimap=ミニマップを隠す +options.minimap.cavemode=洞窟モードを有効にする +options.minimap.dynamiclighting=ダイナミックライティング +options.minimap.terraindepth=地形の深さ +options.minimap.squaremap=スクエア地図 +options.minimap.oldnorth=オールドノース +options.minimap.ingamewaypoints=ゲーム内のウェイポイント +options.minimap.ingamewaypoints.beacons=ビーコン +options.minimap.ingamewaypoints.signs=兆し +options.minimap.ingamewaypoints.both=両方 +options.minimap.location=場所 +options.minimap.location.topleft=左上 +options.minimap.location.topright=右上 +options.minimap.location.bottomright=右下 +options.minimap.location.bottomleft=左下 +options.minimap.size=サイズ +options.minimap.size.small=小 +options.minimap.size.medium=通常のサイズ +options.minimap.size.large=大 +options.minimap.radar=レーダー... +options.minimap.radar.showradar=レーダー +options.minimap.radar.showhostiles=敵対を表示 +options.minimap.radar.showplayers=プレーヤーを表示 +options.minimap.radar.showneutrals=ショーニュートラル +options.minimap.radar.iconoutlines=アイコンのアウトライン +options.minimap.radar.iconfiltering=アイコンフィルタリング +options.minimap.radar.showplayerhelmets=プレイヤーのヘルメットを表示 +options.minimap.detailsperformance=パフォーマンスの詳細... +options.minimap.filtering=フィルタリング +options.minimap.watertransparency=水の透明度 +options.minimap.blocktransparency=ブロックの透明性 +options.minimap.biomes=バイオーム +options.minimap.biomeoverlay=バイオームオーバーレイ +options.minimap.biomeoverlay.transparent=透明な +options.minimap.biomeoverlay.solid=固体 +options.minimap.chunkgrid=チャンクグリッド +options.minimap.terrain.height=高さ +options.minimap.terrain.slope=スロープ +options.minimap.terrain.both=両方 +options.minimap.waypoints=ウェイポイント... + +controls.minimap.title=ミニマップコントロール +controls.minimap.unbind1=キーバインドを解除するには、それを選択して"エスケープ"を押してください。 +controls.minimap.unbind2=(メニューキーを除く - それはアンバインドできません) +key.minimap.zoom=ズーム +key.minimap.togglefullscreen=フルスクリーンマップを切り替える +key.minimap.menu=メニュー +key.minimap.waypointhotkey=ウェイポイントのホットキー +key.minimap.togglemobs=トグルモンスター + +minimap.waypoints.title=ウェイポイント +minimap.waypoints.teleportto=にテレポート +minimap.waypoints.newwaypoint=新しいウェイポイント +minimap.waypoints.deleteconfirm=あなたはこのウェイポイントを削除してもよろしいですか? +minimap.waypoints.edit=編集ウェイポイント +minimap.waypoints.new=新しいウェイポイント +minimap.waypoints.name=ウェイポイント名 +minimap.waypoints.choosecolor=色を選んでください: +minimap.waypoints.enabled=有効: +minimap.waypoints.enable=ウェイポイントを有効にする +minimap.waypoints.disable=ウェイポイントを無効にする +minimap.waypoints.applicabledimensions=このウェイポイントが表示された寸法 +minimap.waypoints.dimension.applies=この次元で可視 +minimap.waypoints.dimension.notapplies=この次元では見えない \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ko_KR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ko_KR.lang new file mode 100644 index 0000000..4b215fa --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ko_KR.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=모드 관리자: MamiyaOtaru +minimap.ui.welcome2=한글 번역: ENlGMA a.k.a 이니그마 +minimap.ui.welcome3=VoxelMap에 오신것을 환영합니다, +minimap.ui.welcome4=여러분의 편의를 위한 여러 기능들이 준비되어 있습니다. +minimap.ui.welcome5a=확대/축소 +minimap.ui.welcome5b=설정 +minimap.ui.welcome6=맵 전체화면 보기. +minimap.ui.welcome7=경유지 빠르게 추가. +minimap.ui.welcome8=이 메세지 감추기 +minimap.ui.zoomlevel=줌 배율: +minimap.ui.otheroptions=기타 설정 + +options.minimap.title=미니맵 설정 +options.minimap.showcoordinates=좌표 표시 +options.minimap.hideminimap=미니맵 감추기 +options.minimap.cavemode=동굴 모드 켜기 +options.minimap.dynamiclighting=다이나믹 라이팅 +options.minimap.terraindepth=지형 깊이 +options.minimap.squaremap=사각 지도 +options.minimap.oldnorth=베타버젼의 북쪽 표기법 사용 +options.minimap.ingamewaypoints=게임내 경유지 표시 +options.minimap.ingamewaypoints.beacons=비콘 표시 +options.minimap.ingamewaypoints.signs=표지판 표시 +options.minimap.ingamewaypoints.both=모두 표시 +options.minimap.location=장소 +options.minimap.location.topleft=왼쪽 위 +options.minimap.location.topright=오른쪽 위 +options.minimap.location.bottomright=오른쪽 아래 +options.minimap.location.bottomleft=왼쪽 아래 +options.minimap.size=크기 +options.minimap.size.small=작게 +options.minimap.size.medium=보통 +options.minimap.size.large=크게 +options.minimap.fontsize=폰트 크기 +options.minimap.radar=레이더... +options.minimap.radar.title=레이더 설정 +options.minimap.radar.showradar=레이더 표시 +options.minimap.radar.showhostiles=적 표시 +options.minimap.radar.showplayers=플레이어 표시 +options.minimap.radar.showneutrals=안전한 대상 표시 +options.minimap.radar.iconoutlines=아이콘 테두리 +options.minimap.radar.iconfiltering=아이콘 필터 +options.minimap.radar.showplayernames=플레이어 이름 표시 +options.minimap.radar.showplayerhelmets=플레이어 헬멧 표시 +options.minimap.radar.showmobhelmets=몹 헬멧 표시 +options.minimap.radar.randomobs=랜덤 몹 +options.minimap.radar.selectmobs=표시할 몹... +options.minimap.detailsperformance=세부사항/성능... +options.minimap.terrain.height=높이 표시 +options.minimap.terrain.slope=경사 표시 +options.minimap.terrain.both=모두 표시 +options.minimap.filtering=필터링 +options.minimap.watertransparency=물 투명도 +options.minimap.blocktransparency=블럭 투명도 +options.minimap.biomes=바이옴 +options.minimap.biomeoverlay=바이옴 오버레이 +options.minimap.biomeoverlay.transparent=투명도 +options.minimap.biomeoverlay.solid=솔리드 +options.minimap.chunkgrid=청크 격자무늬 +options.minimap.waypoints=경유지... +options.minimap.waypoints.title=경유지 설정 +options.minimap.waypoints.distance=최대 거리 +options.minimap.waypoints.infinite=무한 +options.minimap.waypoints.deathpoints=죽은 장소 표시 +options.minimap.waypoints.deathpoints.mostrecent=가장 최근 +options.minimap.waypoints.deathpoints.all=모두 +options.minimap.waypoints.deathpoints.tooltip=다음 리스폰 부터 적용됩니다 +options.minimap.waypoints.showwaypointnames=맵에 경유지 이름 표시 +options.minimap.mobs.title=각 몹의 종류를 표시 하거나 숨기기 +options.minimap.mobs.enable=몹 표시 끄기 +options.minimap.mobs.disable=몹 표시 켜기 +options.minimap.mobs.enabled=몹 표시 켜짐 +options.minimap.mobs.disabled=몹 표시 꺼짐 + +controls.minimap.title=미니맵 키설정 +controls.minimap.unbind1=키 설정을 해제 하시려면, 선택하시고 ESC 버튼을 눌러주세요. +controls.minimap.unbind2=(메뉴키 제외 - 메뉴키 설정은 해제 하실수 없습니다) +key.minimap.zoom=확대 +key.minimap.togglefullscreen=맵 전체화면 켜기 +key.minimap.menu=메뉴 +key.minimap.togglemobs=몹 표시 +key.minimap.waypointhotkey=경유지 핫키 +key.minimap.waypointmenu=경유지 메뉴 + +minimap.waypoints.title=경유지 +minimap.waypoints.teleportto=텔레포트 +minimap.waypoints.highlight=강조 +minimap.waypoints.newwaypoint=새로운 경유지 +minimap.waypoints.deleteconfirm=정말 이 경유지를 삭제하시겠습니까? +minimap.waypoints.edit=경유지 수정 +minimap.waypoints.new=새 경유지 +minimap.waypoints.name=경유지 이름 +minimap.waypoints.choosecolor=색을 고르세요: +minimap.waypoints.enabled=사용중인 경유지: +minimap.waypoints.enable=경유지 사용 +minimap.waypoints.disable=경유지 사용안함 +minimap.waypoints.applicabledimensions=이 경유지가 표시되는 월드(Dimensions) +minimap.waypoints.dimension.applies=이 월드(Dimension)에서 표시됩니다. +minimap.waypoints.dimension.notapplies=이 월드(Dimension)에서 표시되지 않습니다 +minimap.waypoints.sortbyname=이름 +minimap.waypoints.sortbydistance=거리 +minimap.waypoints.sortbycreated=날짜 +minimap.waypoints.sortbycolor=색깔 \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/lt_LT.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/lt_LT.lang new file mode 100644 index 0000000..b06bca6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/lt_LT.lang @@ -0,0 +1,99 @@ +minimap.ui.welcome1=Sukurta: MamiyaOtaru +minimap.ui.welcome2=Išversta: biwegas +minimap.ui.welcome3=Sveiki Atvyke į VoxelMap, cia yra +minimap.ui.welcome4=pilna funkciju ir komandu galimų tau. +minimap.ui.welcome5a=Pritraukti/Padidinti +minimap.ui.welcome5b=Parinktys +minimap.ui.welcome6=Įjungti per visa Ekraną. +minimap.ui.welcome7=Greitas Kelio taško pasirinkimas. +minimap.ui.welcome8=Slėpti šita žinutę +minimap.ui.zoomlevel=Pritraukimo Lygis: +minimap.ui.otheroptions=Kitos Parinktys + +options.minimap.title=Žemėlapio Parinktys +options.minimap.showcoordinates=Rodyti Koordinates +options.minimap.hideminimap=Slėpti Žemėlapį +options.minimap.cavemode=Įjungti Požemius. +options.minimap.dynamiclighting=Dynamic Lighting +options.minimap.terraindepth=Terrain Depth +options.minimap.squaremap=Keturkampis Žemėlapis +options.minimap.oldnorth=Sena Šiaurė +options.minimap.ingamewaypoints=Kelio taškai žaidime. +options.minimap.ingamewaypoints.beacons=Šviesos +options.minimap.ingamewaypoints.signs=Užrašai +options.minimap.ingamewaypoints.both=Kartu +options.minimap.location=Vieta +options.minimap.location.topleft=Viršui kairėje +options.minimap.location.topright=Viršui dešinėje +options.minimap.location.bottomright=Apačioje dešinėje +options.minimap.location.bottomleft=Apačioje kairėje +options.minimap.size=Dydis +options.minimap.size.small=Mažas +options.minimap.size.medium=Įprastas +options.minimap.size.large=Didlelis +options.minimap.fontsize=Šrifto dydis +options.minimap.radar=Radaras... +options.minimap.radar.title=Radaro Parinktys +options.minimap.radar.showradar=Radaras +options.minimap.radar.showhostiles=Rodyti Priešus +options.minimap.radar.showplayers=Rodyti Žaidėjus +options.minimap.radar.showneutrals=Rodyti Neutralius +options.minimap.radar.iconoutlines=Paryškintos Ikonos +options.minimap.radar.iconfiltering=Ikonų Filtravimas +options.minimap.radar.showplayerhelmets=Rodyti Žaidėjų kepures +options.minimap.radar.showmobhelmets=Rodyti Monstrų kepures +options.minimap.radar.showplayernames=Rodyti Žaidėju vardus +options.minimap.radar.randomobs=Įvairūs Monstrai + options.minimap.radar.selectmobs=Rodyti Monstrus... +options.minimap.detailsperformance=detalės/darbingumas... +options.minimap.terrain.height=Aukštis +options.minimap.terrain.slope=Nuolydis +options.minimap.terrain.both=Kartu +options.minimap.filtering=Filtravimas +options.minimap.watertransparency=Vandens Permatomumas +options.minimap.blocktransparency=Bloku Permatomumas +options.minimap.biomes=Biomai +options.minimap.biomeoverlay=Biomų Parodymas +options.minimap.biomeoverlay.transparent=Matomumas +options.minimap.biomeoverlay.solid=Solidus +options.minimap.chunkgrid=Chunk'u skirstymas +options.minimap.waypoints=Kelio Taškai... +options.minimap.waypoints.title=Kelio Taškų Parinktys +options.minimap.waypoints.distance=Didžiausias Atsumas +options.minimap.waypoints.infinite=Begalybė +options.minimap.waypoints.deathpoints=Mirties Taškas(-ai) +options.minimap.waypoints.deathpoints.mostrecent=Dažniausias +options.minimap.waypoints.deathpoints.all=Visi +options.minimap.waypoints.deathpoints.tooltip=Pasikeičia po kitos mirties +options.minimap.waypoints.showwaypointnames=Taškų pavadinimai žemėlapyje +options.minimap.mobs.title=Rodyti ar Slėpti atsikur Monstrų rūšys +options.minimap.mobs.enable=Leisti monstrą +options.minimap.mobs.disable=neleisti monstrą +options.minimap.mobs.enabled=Monstrų rodymas - leidžiama +options.minimap.mobs.disabled=Monstrų rodymas - neleidžiama + +controls.minimap.title=Žemėlapio Kontrolė +controls.minimap.unbind1=Kad atrinktum mygtuką, Pasarink jį ir spausk'Escape'. +controls.minimap.unbind2=(To negalima padaryti su Menu Mygtuku - nes jis neatrinkamas) +key.minimap.zoom=Pritraukimas +key.minimap.togglefullscreen=Pasirinkti žemėlapi per visą ekraną +key.minimap.menu=Menių +key.minimap.togglemobs=Įjungti Monstrus/Gyvūnus +key.minimap.waypointhotkey=Kelio taško greitasis Mygtukas +key.minimap.waypointmenu=Kelio taško Meniu + +minimap.waypoints.title=Kelio taškai +minimap.waypoints.teleportto=Teleportuotis į +minimap.waypoints.highlight=Paryškinti +minimap.waypoints.newwaypoint=Naujas kelio taškas +minimap.waypoints.deleteconfirm=Ar jūs tikrai norite ištrinti šį kelio tašką? +minimap.waypoints.edit=Redaguoti kelio tašką +minimap.waypoints.new=Naujas kelio taškas +minimap.waypoints.name=Kelio taško pavadinimas +minimap.waypoints.choosecolor=Pasirinkti spalvą: +minimap.waypoints.enabled=Įjungtas: +minimap.waypoints.enable=Įjungti Kelio tašką +minimap.waypoints.disable=Išjungti kelio tašką +minimap.waypoints.applicabledimensions=Dimensijos kuriuose matysis Kelio taškas: +minimap.waypoints.dimension.applies=Matomas šitoje dimensijoje +minimap.waypoints.dimension.notapplies=Nematomas šitoje dimensijoje \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/lv_LV.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/lv_LV.lang new file mode 100644 index 0000000..8a86246 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/lv_LV.lang @@ -0,0 +1,104 @@ +lv_LV +minimap.ui.welcome1=Izveidoja: MamiyaOtaru +minimap.ui.welcome2=Pārtulkoja: Niknais007 +minimap.ui.welcome3=Apsveicu Tevi ar VoxelMap ieinstalēšanu, šīs ir +minimap.ui.welcome4=tev pieejamas komandas. +minimap.ui.welcome5a=Pietuvināt/attālināt +minimap.ui.welcome5b=Uzstādijumi +minimap.ui.welcome6=Pilnekrāna karte +minimap.ui.welcome7=Pievienot punktu +minimap.ui.welcome8=Paslēpt šo ziņu +minimap.ui.zoomlevel=Pietuvināšanas līmenis: +minimap.ui.otheroptions=Citi uzstādijumi + +options.minimap.title=Minimapes uzstādijumi +options.minimap.showcoordinates=Rādīt koordinātes +options.minimap.hideminimap=Paslēpt minimapi +options.minimap.cavemode=Iespējot alu režīmu +options.minimap.dynamiclighting=Dinamiskais apgaismojums +options.minimap.terraindepth=Augsnes "dziļums" +options.minimap.squaremap=Kvadrāta mape +options.minimap.oldnorth="Vecie ziemeļi" +options.minimap.ingamewaypoints=Iekš-spēles punki +options.minimap.ingamewaypoints.beacons=Bākas +options.minimap.ingamewaypoints.signs=Zīmes +options.minimap.ingamewaypoints.both=Abi +options.minimap.location=Atrašanās vieta +options.minimap.location.topleft=Augšējā kreisajā +options.minimap.location.topright=Augšējā labajā +options.minimap.location.bottomright=Apakšējā labajā +options.minimap.location.bottomleft=Apakšējā kreisajā +options.minimap.size=Izmērs +options.minimap.size.small=Mazs +options.minimap.size.medium=Vidējs +options.minimap.size.large=Liels +options.minimap.fontsize=Fonta izmērs +options.minimap.radar=Radars... +options.minimap.radar.title=Radara Uzstādījumi +options.minimap.radar.showradar=Radars +options.minimap.radar.showhostiles=Rādīt agresīvos +options.minimap.radar.showplayers=Rādīt citus spēlētājus +options.minimap.radar.showneutrals=Rādīt neitrālos +options.minimap.radar.iconoutlines=Ikonu ārlīnijas +options.minimap.radar.iconfiltering=Ikonu filtrēšana +options.minimap.radar.showplayernames=Rādīt spēlētāju vārdus +options.minimap.radar.showplayerhelmets=Rādīt spēlētāju ķiveres +options.minimap.radar.showmobhelmets=Rādīt dzīvnieku ķiveres +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Dzīvnieki kurus rādīt... +options.minimap.detailsperformance=Kvalitāte/Ātrums... +options.minimap.terrain.height=Augstums +options.minimap.terrain.slope=Slīpums +options.minimap.terrain.both=Abi +options.minimap.filtering=Filtrēšana +options.minimap.watertransparency=Ūdens caurspīdīgums +options.minimap.blocktransparency=Bloku caurspīdīgums +options.minimap.biomes=Biomi +options.minimap.biomeoverlay=Biomu pārklājums +options.minimap.biomeoverlay.transparent=Caurspīdīgs +options.minimap.biomeoverlay.solid=Blīvs +options.minimap.chunkgrid=Chunk skala +options.minimap.waypoints=Punkti... +options.minimap.waypoints.title=Puktu uzstādījumi +options.minimap.waypoints.distance=Maksimālais attālums +options.minimap.waypoints.infinite=Bezgalīgs +options.minimap.waypoints.deathpoints=Nāvespunkts(i) +options.minimap.waypoints.deathpoints.mostrecent=Visjaunākais +options.minimap.waypoints.deathpoints.all=Visi +options.minimap.waypoints.deathpoints.tooltip=Iespējojas nākamajā nāvē +options.minimap.waypoints.showwaypointnames=Rādīt vārdus kartē +options.minimap.mobs.title=Rādīt/paslēpt individuālus dzīvnieku tipus +options.minimap.mobs.enable=Iespējot dzīvnieku +options.minimap.mobs.disable=Atspējot dzīvnieku +options.minimap.mobs.enabled=Dzīvnieka rādīšana iespējota +options.minimap.mobs.disabled=Dzīvnieka rādīšana atspējota + +controls.minimap.title=Minimapes kontroles +controls.minimap.unbind1=Lai atbindotu taustiņu, izvēlaties to un spiežat 'Escape'. +controls.minimap.unbind2=(Izņemot izvēlnes taustiņu - to nevar atbindot) +key.minimap.zoom=Pietuvināt +key.minimap.togglefullscreen=Iespējot pilnekrāna karti +key.minimap.menu=Izvēlne +key.minimap.togglemobs=Ispējot dzīvniekus +key.minimap.waypointhotkey=Punktu ātrpievienošanas taustiņš +key.minimap.waypointmenu=Punktu izvēlne + +minimap.waypoints.title=Punkti +minimap.waypoints.teleportto=Teleportēt uz +minimap.waypoints.highlight=Izcelt +minimap.waypoints.newwaypoint=Jauns punkts +minimap.waypoints.deleteconfirm=Vai esi pārliecināts, ka gribi izdzēst šo punktu? +minimap.waypoints.edit=Rediģet punktu +minimap.waypoints.new=Jauns punkts +minimap.waypoints.name=Punkta nosaukums +minimap.waypoints.choosecolor=Izvēlēties krāsu: +minimap.waypoints.enabled=Iespējots: +minimap.waypoints.enable=Iespējot punktu +minimap.waypoints.disable=Atspējot punktu +minimap.waypoints.applicabledimensions=Pasaules, kurās šis spunkts ir redzams +minimap.waypoints.dimension.applies=Redzams šijā pasaulē +minimap.waypoints.dimension.notapplies=Neredzams šijā pasaulē +minimap.waypoints.sortbyname=Nosaukums +minimap.waypoints.sortbydistance=Attālums +minimap.waypoints.sortbycreated=Izveidots +minimap.waypoints.sortbycolor=Krāsa \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/nl_NL.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/nl_NL.lang new file mode 100644 index 0000000..d8a4110 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/nl_NL.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Onderhouden door MamiyaOtaru +minimap.ui.welcome2=Vertaald door SmokingCrop +minimap.ui.welcome3=Welkom bij VoxelMap, er zijn een +minimap.ui.welcome4=aantal features en commando's beschikbaar voor je. +minimap.ui.welcome5a=Zoom in/uit +minimap.ui.welcome5b=Opties +minimap.ui.welcome6=Schakel schermvullende kaart in of uit. +minimap.ui.welcome7=Voeg snel een routepunt toe. +minimap.ui.welcome8=Verberg dit bericht +minimap.ui.zoomlevel=Zoom Niveau: +minimap.ui.otheroptions=Andere Opties + +options.minimap.title=Minikaart Opties +options.minimap.showcoordinates=Toon coördinaten +options.minimap.hideminimap=Verberg Minikaart +options.minimap.cavemode=Schakel Grotten-modus in +options.minimap.dynamiclighting=dynamische verlichting +options.minimap.terraindepth=Terrein Diepte +options.minimap.squaremap=Vierkante Kaart +options.minimap.oldnorth=Oude Noorden +options.minimap.ingamewaypoints=Routepunten +options.minimap.ingamewaypoints.beacons=Bakens +options.minimap.ingamewaypoints.signs=Borden +options.minimap.ingamewaypoints.both=Beide +options.minimap.location=Locatie +options.minimap.location.topleft=Linksboven +options.minimap.location.topright=Rechtsboven +options.minimap.location.bottomright=RechtsOnder +options.minimap.location.bottomleft=LinksOnder +options.minimap.size=Formaat +options.minimap.size.small=Klein +options.minimap.size.medium=Normaal +options.minimap.size.large=Groot +options.minimap.fontsize=Lettergrootte +options.minimap.radar=Radar... +options.minimap.radar.title=Radar Opties +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Toon vijanden +options.minimap.radar.showplayers=Toon Spelers +options.minimap.radar.showneutrals=Toon Neutralen +options.minimap.radar.iconoutlines=Icoon Omrandingen +options.minimap.radar.iconfiltering=Icoon Filtering +options.minimap.radar.showplayernames=Toon Speler Namen +options.minimap.radar.showplayerhelmets=Toon Speler Helmen +options.minimap.radar.showmobhelmets=Toon Vijand Helmen +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Weer te geven vijanden... +options.minimap.detailsperformance=Details/Prestatie... +options.minimap.terrain.height=Hoogte +options.minimap.terrain.slope=Helling +options.minimap.terrain.both=Beide +options.minimap.filtering=Filtering +options.minimap.watertransparency=Water Transparantie +options.minimap.blocktransparency=Blok Transparantie +options.minimap.biomes=Biomen +options.minimap.biomeoverlay=Bioom Bedekking +options.minimap.biomeoverlay.transparent=Transparant +options.minimap.biomeoverlay.solid=Stevig +options.minimap.chunkgrid=Chunk Raster +options.minimap.waypoints=Routepunt... +options.minimap.waypoints.title=Routepunt Opties +options.minimap.waypoints.distance=Max. Afstand +options.minimap.waypoints.infinite=Oneindig +options.minimap.waypoints.deathpoints=Sterfpunt(en) +options.minimap.waypoints.deathpoints.mostrecent=Meest Recente +options.minimap.waypoints.deathpoints.all=Alle +options.minimap.waypoints.deathpoints.tooltip=Wordt van kracht vanaf je volgende dood +options.minimap.waypoints.showwaypointnames=Toon Namen op kaart +options.minimap.mobs.title=Toon of Verberg Individuele Vijand Types +options.minimap.mobs.enable=Schakel Vijand in +options.minimap.mobs.disable=Schakel Vijand uit +options.minimap.mobs.enabled=Vijand Weergave is ingeschakeld +options.minimap.mobs.disabled=Vijand Weergave is uitgeschakeld + +controls.minimap.title=Minikaart Controles +controls.minimap.unbind1=Ontbind een toets door het te selecteren en op 'Esc' te drukken. +controls.minimap.unbind2=(Behalve voor de menu toets - die kan niet ontbonden worden) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Schakel schermvullende kaart in/uit +key.minimap.menu=Menu +key.minimap.togglemobs=Schakel Vijanden in/uit +key.minimap.waypointhotkey=Routepunt sneltoets +key.minimap.waypointmenu=Routepunt Menu + +minimap.waypoints.title=Routepunten +minimap.waypoints.teleportto=Teleporteer naar +minimap.waypoints.highlight=Selecteer +minimap.waypoints.newwaypoint=Nieuw Routepunt +minimap.waypoints.deleteconfirm=Weet je zeker dat je dit routepunt wilt verwijderen. +minimap.waypoints.edit=Bewerk Routepunt +minimap.waypoints.new=Nieuw Routepunt +minimap.waypoints.name=Routepunt Naam +minimap.waypoints.choosecolor=Kies Kleur: +minimap.waypoints.enabled=Ingeschakeld: +minimap.waypoints.enable=Schakel Routepunt in +minimap.waypoints.disable=Schakel Routepunt uit +minimap.waypoints.applicabledimensions=Dimensies waar dit routepunt zichtbaar zal zijn. +minimap.waypoints.dimension.applies=Zichtbaar in deze dimensie +minimap.waypoints.dimension.notapplies=Niet zichtbaar in deze dimensie +minimap.waypoints.sortbyname=Naam +minimap.waypoints.sortbydistance=Afstand +minimap.waypoints.sortbycreated=Gecreëerd +minimap.waypoints.sortbycolor=Kleur \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/nn_NO.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/nn_NO.lang new file mode 100644 index 0000000..2c9f4da --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/nn_NO.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Drives av MamiyaOtaru +minimap.ui.welcome2=Oversett av: tynnoel99 +minimap.ui.welcome3=Velkome til Zan's Minimap, det finst +minimap.ui.welcome4=mange funksjonar og kommandoar du kan bruke. +minimap.ui.welcome5a=Zoom inn/ut +minimap.ui.welcome5b=Instillingar +minimap.ui.welcome6=Fullskjermkart av/på. +minimap.ui.welcome7=Legg snøgt til et landemerke. +minimap.ui.welcome8=Skjul denne meldinga +minimap.ui.zoomlevel=Zoomnivå: +minimap.ui.otheroptions=Andre instillingar + +options.minimap.title=Minimap-Instillingar +options.minimap.showcoordinates=Vis Koordinatar +options.minimap.hideminimap=Skjul Minimap +options.minimap.cavemode=Skru på Hulemodus +options.minimap.dynamiclighting=Dynamisk Lyssetjing +options.minimap.terraindepth=Terrengdjupn +options.minimap.squaremap=Firkanta Kart +options.minimap.oldnorth=Gammal Nord +options.minimap.ingamewaypoints=Spill-Landemerker +options.minimap.location=Plassering +options.minimap.size=Storleik +options.minimap.fontsize=Skriftstorleik +options.minimap.filtering=Filtrering +options.minimap.watertransparency=Vann-Gjennomsiktigheit +options.minimap.blocktransparency=Blokk-Gjennomsiktigheit +options.minimap.biomes=Områdetype +options.minimap.biomeoverlay=Områdetype-Overlegg +options.minimap.biomeoverlay.transparent=Gjennomsiktig +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Chunk-Ruter +options.minimap.radar.showplayernames=Vis Spelernamn +options.minimap.radar.selectmobs=Monster som skal visast... +options.minimap.radar.showradar=Radar +options.minimap.radar.title=Radarval +options.minimap.radar.showhostiles=Vis Fiendar +options.minimap.radar.showplayers=Vis Spelare +options.minimap.radar.showneutrals=Vis Nøytrale +options.minimap.radar.iconoutlines=Ikonkantar +options.minimap.radar.iconfiltering=Ikonfiltrering +options.minimap.radar.showplayerhelmets=Vis Spillarane sine Hjelmer +options.minimap.radar.showmobhelmets=Vis Monstrane sine Hjelmer +options.minimap.radar.randomobs=Tilfeldige monstre +options.minimap.detailsperformance=Detaljar/Yting... +options.minimap.waypoints=Landemerker... +options.minimap.radar=Radar... +options.minimap.terrain.height=Høgde +options.minimap.terrain.slope=Skråning +options.minimap.terrain.both=Båe +options.minimap.ingamewaypoints.beacons=Fyrtårn +options.minimap.ingamewaypoints.signs=Skilt +options.minimap.ingamewaypoints.both=Båe +options.minimap.location.topleft=Topp Venstre +options.minimap.location.topright=Topp Høgre +options.minimap.location.bottomright=Botn Høgre +options.minimap.location.bottomleft=Botn Venstre +options.minimap.size.small=Liten +options.minimap.size.medium=Standard +options.minimap.size.large=Stor +options.minimap.waypoints.title=Landemerke-Val +options.minimap.waypoints.distance=Maks Avstand +options.minimap.waypoints.infinite=Uendeleg +options.minimap.waypoints.deathpoints=Dødsmerke +options.minimap.waypoints.deathpoints.mostrecent=Nyligst +options.minimap.waypoints.deathpoints.all=Alle +options.minimap.waypoints.deathpoints.tooltip=Aktiverast neste død +options.minimap.waypoints.showwaypointnames=Landemerke-Namn på Kartet +options.minimap.mobs.title=Vis eller skjul kvar enkelt Monstertype +options.minimap.mobs.enable=Aktiver Monster +options.minimap.mobs.disable=Deaktiver Monster +options.minimap.mobs.enabled=Monster-Skjerm Aktivert +options.minimap.mobs.disabled=Monster-Skjerm Deaktivert + +controls.minimap.title=Minimap-Kontroller +controls.minimap.unbind1=For å lauskople ein tast, vel den og trykk 'Escape'. +controls.minimap.unbind2=(Unntak for Menyknappen - den kan ikkje bli lauskopla) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Fullskjermkart av/på +key.minimap.menu=Meny +key.minimap.waypointhotkey=Hurtigtast Landemerke +key.minimap.togglemobs=Mobs av/på +key.minimap.waypointmenu=Landemerkemeny + +minimap.waypoints.title=Landemerker +minimap.waypoints.teleportto=Teleporter Til +minimap.waypoints.highlight=Lys opp +minimap.waypoints.newwaypoint=Nytt Landemerke +minimap.waypoints.deleteconfirm=Er du sikker på at du vil fjerne dette landemerket? +minimap.waypoints.edit=Rediger Landemerke +minimap.waypoints.new=Nytt landemerke +minimap.waypoints.name=Namn på Landemerke +minimap.waypoints.choosecolor=Vel farge: +minimap.waypoints.enabled=Aktivert: +minimap.waypoints.enable=Aktiver landemerke +minimap.waypoints.disable=Deaktiver landemerke +minimap.waypoints.applicabledimensions=Dimensjoner hvor dette landemerket er synlig +minimap.waypoints.dimension.applies=Synleg i denne dimensjonen +minimap.waypoints.dimension.notapplies=Ikkje synleg i denne dimensjonen +minimap.waypoints.sortbyname=Namn +minimap.waypoints.sortbydistance=Avstand +minimap.waypoints.sortbycreated=Skapa +minimap.waypoints.sortbycolor=Farge \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/no_NO.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/no_NO.lang new file mode 100644 index 0000000..8a5918f --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/no_NO.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Drives av MamiyaOtaru +minimap.ui.welcome2=Oversatt av: tynnoel99 +minimap.ui.welcome3=Velkommen til Zan's Minimap, det finnes +minimap.ui.welcome4=mange funksjoner og kommandoer du kan bruke. +minimap.ui.welcome5a=Zoom inn/ut +minimap.ui.welcome5b=Instillinger +minimap.ui.welcome6=Fullskjermkart av/på. +minimap.ui.welcome7=Legg til et landemerke hurtig. +minimap.ui.welcome8=Skjul denne meldingen +minimap.ui.zoomlevel=Zoom Level: +minimap.ui.otheroptions=Andre instillinger + +options.minimap.title=Minimap-Instillinger +options.minimap.showcoordinates=Vis Koordinater +options.minimap.hideminimap=Skjul Minimap +options.minimap.cavemode=Skru på Hulemodus +options.minimap.dynamiclighting=Dynamisk Lyssetting +options.minimap.terraindepth=Terrengdybde +options.minimap.squaremap=Firkantet Kart +options.minimap.oldnorth=Gammel Nord +options.minimap.ingamewaypoints=Spill-Landemerker +options.minimap.location=Plassering +options.minimap.location.topleft=Topp Venstre +options.minimap.location.topright=Topp Høyre +options.minimap.location.bottomright=Bunn Høyre +options.minimap.location.bottomleft=Bunn Venstre +options.minimap.size=Størrelse +options.minimap.size.small=Liten +options.minimap.size.medium=Standard +options.minimap.size.large=Stor +options.minimap.fontsize=Skriftstørrelse +options.minimap.ingamewaypoints.beacons=Fyrtårn +options.minimap.ingamewaypoints.signs=Skilt +options.minimap.ingamewaypoints.both=Begge +options.minimap.radar=Radar... +options.minimap.radar.title=Radarvalg +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Vis Fiender +options.minimap.radar.showplayers=Vis Spillere +options.minimap.radar.showneutrals=Vis Nøytrale +options.minimap.radar.iconoutlines=Ikonkanter +options.minimap.radar.iconfiltering=Ikonfiltrering +options.mimimap.radar.showplayernames= Vis spillernavn +options.minimap.radar.showplayerhelmets=Vis Spillerenes Hjelmer +options.minimap.radar.showmobhelmets=Vis Monstrenes Hjelmer +options.minimap.radar.randomobs=Tilfeldige monstre +options.mimimap.radar.selectmobs=Monstre som skal vises +options.minimap.detailsperformance=Detaljer/Ytelse... +options.minimap.filtering=Filtrering +options.minimap.watertransparency=Vann-Gjennomsiktighet +options.minimap.blocktransparency=Blokk-Gjennomsiktighet +options.minimap.biomes=Områdetype +options.minimap.biomeoverlay=Områdetype-Overlegg +options.minimap.biomeoverlay.transparent=Gjennomsiktig +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Chunk-Ruter +options.minimap.terrain.height=Høyde +options.minimap.terrain.slope=Skråning +options.minimap.terrain.both=Begge +options.minimap.waypoints=Landemerker... +options.minimap.waypoints.title=Landemerke-Valg +options.minimap.waypoints.distance=Maks Avstand +options.minimap.waypoints.infinite=Uendelig +options.minimap.waypoints.deathpoints=Dødsmerke(r) +options.minimap.waypoints.deathpoints.mostrecent=Nyligst +options.minimap.waypoints.deathpoints.all=Alle +options.minimap.waypoints.deathpoints.tooltip=Aktiveres neste død +options.minimap.waypoints.showwaypointnames=Vegpunktnavn på kartet +options.minimap.mobs.title=Vis eller Skjul enkelse monstertyper +options.minimap.mobs.enable=Aktiver Monstre +options.minimap.mobs.disable=Deaktiver Monstre +options.minimap.mobs.enabled=Monstervisning Aktivert +options.minimap.mobs.disabled=Monstervisning Deaktivert + +controls.minimap.title=Minimap-Kontroller +controls.minimap.unbind1=For å løskoble en tast, velg den og trykk 'Escape'. +controls.minimap.unbind2=(Unntak for Menyknappen - den kan ikke bli løskoblet) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Fullskjermkart av/på +key.minimap.menu=Meny +key.minimap.waypointhotkey=Hurtigtast Landemerke +key.minimap.togglemobs=Mobs av/på +key.minimap.waypointmenu=Landemerkemeny + +minimap.waypoints.title=Landemerker +minimap.waypoints.teleportto=Teleporter Til +minimap.waypoints.highlight=Lys opp +minimap.waypoints.newwaypoint=Nytt Landemerke +minimap.waypoints.deleteconfirm=Er du sikker på at du vil fjerne dette landemerket? +minimap.waypoints.edit=Rediger Landemerke +minimap.waypoints.new=Nytt landemerke +minimap.waypoints.name=Navn på Landemerke +minimap.waypoints.choosecolor=Velg farge: +minimap.waypoints.enabled=Aktivert: +minimap.waypoints.enable=Aktiver landemerke +minimap.waypoints.disable=Deaktiver landemerke +minimap.waypoints.applicabledimensions=Dimensjoner hvor dette landemerket er synlig +minimap.waypoints.dimension.applies=Synlig i denne dimensjonen +minimap.waypoints.dimension.notapplies=Ikke synlig i denne dimensjonen +minimap.waypoints.sortbyname=Navn +minimap.waypoints.sortbydistance=Avstand +minimap.waypoints.sortbycreated=Skapt +minimap.waypoints.sortbycolor=Farge \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pl_PL.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pl_PL.lang new file mode 100644 index 0000000..8187f92 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pl_PL.lang @@ -0,0 +1,90 @@ +minimap.ui.welcome1=Tworzony przez MamiyaOtaru +minimap.ui.welcome2=Tłumaczenie: Maczaz & krysztal +minimap.ui.welcome3=Witaj w VoxelMap, oto kilka +minimap.ui.welcome4=funkcji i poleceń, których możesz używać. +minimap.ui.welcome5a=Przybliżanie/oddalanie +minimap.ui.welcome5b=Opcje +minimap.ui.welcome6=Tryb mapy pełnoekranowej. +minimap.ui.welcome7=Szybkie dodawanie waypointów. +minimap.ui.welcome8=Ukryj ten komunikat +minimap.ui.zoomlevel=Poziom przybliżenia: +minimap.ui.otheroptions=Opcje dodatkowe + +options.minimap.title=Opcje minimapy +options.minimap.showcoordinates=Pokaż współrzędne +options.minimap.hideminimap=Ukryj minimapę +options.minimap.cavemode=Tryb jaskiniowy +options.minimap.dynamiclighting=Dynamiczne oświetlenie +options.minimap.terraindepth=Rzeźba terenu +options.minimap.squaremap=Kwadratowa mapa +options.minimap.oldnorth=Stare kierunki świata +options.minimap.ingamewaypoints=Waypointy w grze +options.minimap.ingamewaypoints.beacons=Słupy światła +options.minimap.ingamewaypoints.signs=Znaczniki +options.minimap.ingamewaypoints.both=Oba rodzaje +options.minimap.location=Pozycja mapy +options.minimap.location.topleft=Górny lewy róg +options.minimap.location.topright=Górny prawy róg +options.minimap.location.bottomright=Dolny prawy róg +options.minimap.location.bottomleft=Dolny lewy róg +options.minimap.size=Rozmiar +options.minimap.size.small=Mały +options.minimap.size.medium=Średni +options.minimap.size.large=Duży +options.minimap.radar=Znaczniki... +options.minimap.radar.title=Opcje znaczników +options.minimap.radar.showradar=Znaczniki +options.minimap.radar.showhostiles=Pokaż wrogów +options.minimap.radar.showplayers=Pokaż graczy +options.minimap.radar.showneutrals=Pokaż inne moby +options.minimap.radar.iconoutlines=Obwódka ikon +options.minimap.radar.iconfiltering=Filtrowanie ikon +options.minimap.radar.showplayerhelmets=Pokaż nakrycia głowy graczy +options.minimap.radar.showmobhelmets=Pokaż hełmy mobów +options.minimap.radar.randomobs=Losowe Moby +options.minimap.detailsperformance=Detale i wydajność... +options.minimap.filtering=Filtrowanie +options.minimap.watertransparency=Przeźroczystość wody +options.minimap.blocktransparency=Przeźroczystość bloków +options.minimap.biomes=Biomy +options.minimap.biomeoverlay=Pokaż Biomy +options.minimap.biomeoverlay.transparent=Półprzeźroczyste +options.minimap.biomeoverlay.solid=Wyraźne +options.minimap.chunkgrid=Siatka granic Chunk-ów +options.minimap.terrain.height=Wysokość +options.minimap.terrain.slope=Nachylenie +options.minimap.terrain.both=Pełna +options.minimap.waypoints=Waypoint-y... +options.minimap.waypoints.title=Opcje Waypointów +options.minimap.waypoints.distance=Maksymalna odległość +options.minimap.waypoints.infinite=Nieskończona +options.minimap.waypoints.deathpoints=Deathpoint(s) +options.minimap.waypoints.deathpoints.mostrecent=Aktualne +options.minimap.waypoints.deathpoints.all=Wszystkie +options.minimap.waypoints.deathpoints.tooltip=Efekt widoczny od następnej śmierci + +controls.minimap.title=Sterowanie +controls.minimap.unbind1=Jeśli nie chcesz używać klawisza, wybierz go i naciśnij 'Esc'. +controls.minimap.unbind2=(za wyjątkiem klawisza Menu) +key.minimap.zoom=Przybliżanie +key.minimap.togglefullscreen=Tryb pełnoekranowy +key.minimap.menu=Menu +key.minimap.waypointhotkey=Definiowanie waypoint-a +key.minimap.togglemobs=Włącz/wyłacz moby +key.minimap.waypointmenu=Menu Waypointów + +minimap.waypoints.title=Waypoint-y +minimap.waypoints.teleportto=Teleportuj do... +minimap.waypoints.highlight=Podświetl +minimap.waypoints.newwaypoint=Nowy waypoint +minimap.waypoints.deleteconfirm=Czy na pewno chcesz usunąć ten waypoint? +minimap.waypoints.edit=Edytuj waypoint +minimap.waypoints.new=Nowy waypoint +minimap.waypoints.name=Nazwa waypoint-u +minimap.waypoints.choosecolor=Wybierz kolor: +minimap.waypoints.enabled=Aktywny: +minimap.waypoints.enable=Aktywuj waypoint +minimap.waypoints.disable=Wyłącz waypoint +minimap.waypoints.applicabledimensions=Wymiary w którym waypoint będzie widoczny +minimap.waypoints.dimension.applies=Widoczny w tym wymiarze +minimap.waypoints.dimension.notapplies=Niewidoczny w tym wymiarze \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pt_BR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pt_BR.lang new file mode 100644 index 0000000..a2a680c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pt_BR.lang @@ -0,0 +1,99 @@ +pt_BR +minimap.ui.welcome1=Mantido por MamiyaOtaru +minimap.ui.welcome2=Traducido por: Farenheith +minimap.ui.welcome3=Bem vindo ao VoxelMap, há +minimap.ui.welcome4=há algumas opções e comandos disponíveis para você. +minimap.ui.welcome5a=Zoom in/out +minimap.ui.welcome5b=Opções +minimap.ui.welcome6=Alternar mapa en tela cheia +minimap.ui.welcome7=Adicão rápida de waypoint. +minimap.ui.welcome8=Ocultar esta mensagem +minimap.ui.zoomlevel=Nível de Zoom: +minimap.ui.otheroptions=Outras Opções + +options.minimap.title=Opções de Minimapa +options.minimap.showcoordinates=Mostrar coordenadas +options.minimap.hideminimap=Ocultar Minimapa +options.minimap.cavemode=Habilitar modo caverna +options.minimap.dynamiclighting=Iluminação Dinâmica +options.minimap.terraindepth=Nível de terreno +options.minimap.squaremap=Mapa Quadrado +options.minimap.oldnorth=Norte velho +options.minimap.ingamewaypoints=Waypoints In-game +options.minimap.ingamewaypoints.beacons=Beacons +options.minimap.ingamewaypoints.signs=Placas +options.minimap.ingamewaypoints.both=Ambos +options.minimap.location=Localização +options.minimap.location.topleft=Superior Esquerdo +options.minimap.location.topright=Superior Direito +options.minimap.location.bottomright=Inferior Direito +options.minimap.location.bottomleft=Inferior Esquerdo +options.minimap.size=Tamanho +options.minimap.size.small=Pequeno +options.minimap.size.medium=Médio +options.minimap.size.large=Grande +options.minimap.fontsize=Tamanho de fonte +options.minimap.radar=Radar... +options.minimap.radar.title=Opções de Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostrar Hostís +options.minimap.radar.showplayers=Mostrar Jogadores +options.minimap.radar.showneutrals=Mostar Neutros +options.minimap.radar.iconoutlines=Contorno de ícone +options.minimap.radar.iconfiltering=Filtragem de ícone +options.minimap.radar.showplayernames=Mostrar nome dos jogadores +options.minimap.radar.showplayerhelmets=Mostar elmos de jogadores +options.minimap.radar.showmobhelmets=Mostrar elmo de mobs +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Mobs visíveis +options.minimap.detailsperformance=Detalhes/Performance... +options.minimap.terrain.height=Altura +options.minimap.terrain.slope=Declive +options.minimap.terrain.both=Ambos +options.minimap.filtering=Filtragem +options.minimap.watertransparency=Transparência de Água +options.minimap.blocktransparency=Transparência de Bloco +options.minimap.biomes=Biomas +options.minimap.biomeoverlay=Sobreposición de Bioma +options.minimap.biomeoverlay.transparent=Transparência +options.minimap.biomeoverlay.solid=Sólido +options.minimap.chunkgrid=Grade de Chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Opções de Waypoints +options.minimap.waypoints.distance=Distância Máxima +options.minimap.waypoints.infinite=Infinita +options.minimap.waypoints.deathpoints=Pontos de morte(s) +options.minimap.waypoints.deathpoints.mostrecent=Más recente +options.minimap.waypoints.deathpoints.all=Todos +options.minimap.waypoints.deathpoints.tooltip=Tem efeito na próxima morte + +controls.minimap.title=Controles de Minimapa +controls.minimap.unbind1=Para desassociar uma tecla, pressione 'Esc'. +controls.minimap.unbind2=(Exceto a tecla de Menu - Não é permitido desassociá-la) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Alternar mapa em tela cheia +key.minimap.menu=Menu +key.minimap.waypointhotkey=Atalho para Waypoints +key.minimap.togglemobs=Alternar Mobs + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teleportar para +minimap.waypoints.highlight=Escolher +minimap.waypoints.newwaypoint=Novo Waypoint +minimap.waypoints.deleteconfirm=Deseja realmente excluir este waypoint? +minimap.waypoints.edit=Editar Waypoint +minimap.waypoints.new=Novo Waypoint +minimap.waypoints.name=Nome do Waypoint +minimap.waypoints.choosecolor=Escolher Color: +minimap.waypoints.enabled=Habilitada: +minimap.waypoints.enable=Habilitar Waypoint +minimap.waypoints.disable=Desabilitar Waypoint +minimap.waypoints.applicabledimensions=Dimensões onde o waypoint será visível +inimap.waypoints.dimension.applies=Visível nesta dimensão +minimap.waypoints.dimension.notapplies=Oculto nesta dimensão +options.minimap.waypoints.showwaypointnames=Nome de waypoints no mapa +options.minimap.mobs.title=Mostrar ou esconder tipos individuais de mob +options.minimap.mobs.enable=Habilitar mob +options.minimap.mobs.disable=Desabilitar mob +options.minimap.mobs.enabled=Ver mobs habilitado +options.minimap.mobs.disabled=Ver mobs desabilitado \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pt_PT.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pt_PT.lang new file mode 100644 index 0000000..599ecb3 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/pt_PT.lang @@ -0,0 +1,103 @@ +pt_PT +minimap.ui.welcome1=Mantido por MamiyaOtaru +minimap.ui.welcome2=Traduzido por: Sackboy3108 e i3lff +minimap.ui.welcome3=Bem vindo ao VoxelMap, existem +minimap.ui.welcome4=algumas opções e comandos disponí­veis para ti. +minimap.ui.welcome5a=Aumentar/Diminuir zoom +minimap.ui.welcome5b=Opções +minimap.ui.welcome6=Mostrar mapa de ecrã inteiro +minimap.ui.welcome7=Adição rápida de waypoints. +minimap.ui.welcome8=Ocultar esta mensagem +minimap.ui.zoomlevel=Nível de Zoom: +minimap.ui.otheroptions=Outras Opções + +options.minimap.title=Opções de Minimapa +options.minimap.showcoordinates=Mostrar coordenadas +options.minimap.hideminimap=Ocultar Minimapa +options.minimap.cavemode=Ativar modo caverna +options.minimap.dynamiclighting=Iluminação Dinãmica +options.minimap.terraindepth=Profundidade do terreno +options.minimap.squaremap=Mapa Quadrado +options.minimap.oldnorth=Norte velho +options.minimap.ingamewaypoints=Waypoints do jogo +options.minimap.ingamewaypoints.beacons=Sinal luminozo +options.minimap.ingamewaypoints.signs=Letreiros +options.minimap.ingamewaypoints.both=Ambos +options.minimap.location=Localização +options.minimap.location.topleft=Superior Esquerdo +options.minimap.location.topright=Superior Direito +options.minimap.location.bottomright=Inferior Direito +options.minimap.location.bottomleft=Inferior Esquerdo +options.minimap.size=Tamanho +options.minimap.size.small=Pequeno +options.minimap.size.medium=Médio +options.minimap.size.large=Grande +options.minimap.fontsize=Tamanho de letra +options.minimap.radar=Radar... +options.minimap.radar.title=Opções de Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Mostrar Hostis +options.minimap.radar.showplayers=Mostrar Jogadores +options.minimap.radar.showneutrals=Mostar Neutros +options.minimap.radar.iconoutlines=Contornos de ícone +options.minimap.radar.iconfiltering=Filtragem de ícone +options.minimap.radar.showplayernames=Mostrar nomes de jogadores +options.minimap.radar.showplayerhelmets=Mostar elmos de jogadores +options.minimap.radar.showmobhelmets=Mostrar elmo de mobs +options.minimap.radar.randomobs=Mobs aleatórios +options.minimap.radar.selectmobs=Mobs a visualizar... +options.minimap.detailsperformance=Detalhes/Performance... +options.minimap.terrain.height=Altura +options.minimap.terrain.slope=Declive +options.minimap.terrain.both=Ambos +options.minimap.filtering=Filtragem +options.minimap.watertransparency=Transparência da água +options.minimap.blocktransparency=Transparência dos Blocos +options.minimap.biomes=Biomas +options.minimap.biomeoverlay=Sobreposição dos biomas +options.minimap.biomeoverlay.transparent=Transparente +options.minimap.biomeoverlay.solid=Sólido +options.minimap.chunkgrid=Grelha de chunks +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Opções de Waypoints +options.minimap.waypoints.distance=Distãcia Máxima +options.minimap.waypoints.infinite=Infinita +options.minimap.waypoints.deathpoints=Ponto(s) de morte +options.minimap.waypoints.deathpoints.mostrecent=Mais recente +options.minimap.waypoints.deathpoints.all=Todos +options.minimap.waypoints.deathpoints.tooltip=Tem efeito na próxima morte +options.minimap.waypoints.showwaypointnames=Nome dos waypoints no mapa +options.minimap.mobs.title=Mostrar ou esconder tipos individuais de mobs +options.minimap.mobs.enable=Ativar mob +options.minimap.mobs.disable=Destivar Mob +options.minimap.mobs.enabled=Visualização de mobs ativada +options.minimap.mobs.disabled=Visualização de mobs desativada + +controls.minimap.title=Controlos do Minimapa +controls.minimap.unbind1=Para desassociar uma tecla, seleciona-a e prime 'Esc'. +controls.minimap.unbind2=(Exceto a tecla de menu - Essa não pode ser desassociada) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Mostrar mapa de ecrã inteiro +key.minimap.menu=Menu +key.minimap.waypointhotkey=Tecla para criar Waypoints +key.minimap.waypointmenu=Menu de Waypoints + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teletransportar para +minimap.waypoints.highlight=Realçar +minimap.waypoints.newwaypoint=Novo Waypoint +minimap.waypoints.deleteconfirm=Deseja realmente excluir este Waypoint? +minimap.waypoints.edit=Editar Waypoint +minimap.waypoints.new=Novo Waypoint +minimap.waypoints.name=Nome do Waypoint +minimap.waypoints.choosecolor=Escolher Cor: +minimap.waypoints.enabled=Ativado: +minimap.waypoints.enable=Ativar Waypoint +minimap.waypoints.disable=Desativar Waypoint +minimap.waypoints.applicabledimensions=Dimensões onde o Waypoint será visí­vel +inimap.waypoints.dimension.applies=Visi­vel nesta dimensão +minimap.waypoints.dimension.notapplies=Oculto nesta dimensão +minimap.waypoints.sortbyname=Nome +minimap.waypoints.sortbydistance=Distância +minimap.waypoints.sortbycreated=Criado +minimap.waypoints.sortbycolor=Cor diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ro_RO.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ro_RO.lang new file mode 100644 index 0000000..55200e6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ro_RO.lang @@ -0,0 +1,104 @@ +minimap.ui.welcome1=Mod menţinut de MamiyaOtaru +minimap.ui.welcome2=Tradus de : DreamersRO, contribuţie Pph9 +minimap.ui.welcome3=Bine ai venit pe VoxelMap, aici sunt +minimap.ui.welcome4=multe facilităţi si comenzi pentru tine. +minimap.ui.welcome5a=Măreşte înainte/înapoi +minimap.ui.welcome5b=Opţuni +minimap.ui.welcome6=Poziţionzează harta pe tot ecranul. +minimap.ui.welcome7=Marchează rapid un Punct de Referinţă pe hartă. +minimap.ui.welcome8=Ascunde acest mesaj. +minimap.ui.zoomlevel=Nivelul măririi: +minimap.ui.otheroptions=Alte opţiuni + +options.minimap.title=Opţiunile Minihărţii +options.minimap.showcoordinates=Arată coordonatele +options.minimap.hideminimap=Ascunde Miniharta +options.minimap.cavemode=Permite modul Subteran +options.minimap.dynamiclighting=Lumini mişcătoare +options.minimap.terraindepth=Adâncimea terenului +options.minimap.squaremap=Harta Pătrata +options.minimap.oldnorth=Nord Vechi +options.minimap.ingamewaypoints=Punct de Referinţa În-Joc +options.minimap.ingamewaypoints.beacons=Faruri +options.minimap.ingamewaypoints.signs=Semne +options.minimap.ingamewaypoints.both=Ambele +options.minimap.location=Locaţie +options.minimap.location.topleft=Colţul din Stânga Sus +options.minimap.location.topright=Colţul din Dreapta Sus +options.minimap.location.bottomright=Colţul din Dreapta Jos +options.minimap.location.bottomleft=Colţul din Stânga Jos +options.minimap.size=Mărime +options.minimap.size.small=Mic +options.minimap.size.medium=Regulat +options.minimap.size.large=Larg +options.minimap.fontsize=Mărimea Fondului +options.minimap.radar=Radar... +options.minimap.radar.title=Opţiunile Radarului +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Arată Inamicii +options.minimap.radar.showplayers=Arată Jucătorii +options.minimap.radar.showneutrals=Arată Neutralii +options.minimap.radar.iconoutlines=Conturul Pictogramei +options.minimap.radar.iconfiltering=Filtrare Pictogramă +options.minimap.radar.showplayernames=Arată Numele Jucătorilor +options.minimap.radar.showplayerhelmets=Arata Căştile Jucatorilor +options.minimap.radar.showmobhelmets=Arata Căştile Inamiciilor +options.minimap.radar.selectmobs=Ce inamici vor apărea pe minihartă... +options.minimap.radar.randomobs=Inamici la întamplare +options.minimap.detailsperformance=Detalii/Performanţă... +options.minimap.terrain.height=Înălţime +options.minimap.terrain.slope=Înclinare +options.minimap.terrain.both=Ambele +options.minimap.filtering=Filtrare +options.minimap.watertransparency=Transparenţa apei +options.minimap.blocktransparency=Transparenţa blocurilor +options.minimap.biomes=Climate +options.minimap.biomeoverlay=Suprapunerea Climatelor +options.minimap.biomeoverlay.transparent=Transparent +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Grila Chunk-urilor +options.minimap.waypoints=Punct de Referinţă +options.minimap.waypoints.title=Opţiunile Punctelor de Referinţă +options.minimap.waypoints.distance=Distanţă Maximă +options.minimap.waypoints.infinite=Infinit +options.minimap.waypoints.deathpoints=Punctul Morţii +options.minimap.waypoints.deathpoints.mostrecent=Cel mai Recent +options.minimap.waypoints.deathpoints.all=Toate +options.minimap.waypoints.deathpoints.tooltip=Ia efect la următoarea moarte +options.minimap.waypoints.showwaypointnames=Numele Punctelor de Referinţă pe Miniharta +options.minimap.mobs.title=Arată sau Ascunde Inamicii Individuali +options.minimap.mobs.enable=Arată Inamicii +options.minimap.mobs.disable=Nu Arăta Inamicii +options.minimap.mobs.enabled=Arată Creaturile +options.minimap.mobs.disabled=Nu Arăta Creaturile + + +controls.minimap.title=Controalele Minihărţii +controls.minimap.unbind1=Pentru a dezlega un buton, selectează-l şi apasă 'Escape'. +controls.minimap.unbind2=(Înafară de Butonul Meniului - nu poţi să îl dezlegi!) +key.minimap.zoom=Mareşte +key.minimap.togglefullscreen=Arată Harta pe tot Ecranul +key.minimap.menu=Meniu +key.minimap.togglemobs=Arată Monştrii +key.minimap.waypointhotkey=Buton pentru Punct de Referinţă +key.minimap.waypointmenu=Meniul Punctelor de Referinţă + +minimap.waypoints.title=Punct de Referinţă +minimap.waypoints.teleportto=Teleportează-te acolo! +minimap.waypoints.highlight=Evidenţiază +minimap.waypoints.newwaypoint=Nou Punct de Referinţă +minimap.waypoints.deleteconfirm=Eşti sigur că vrei să ştergi acest Punct de Referinţa? +minimap.waypoints.edit=Editează Punctul de Referinţă +minimap.waypoints.new=Nou Punct de Referinţă +minimap.waypoints.name=Numele Punctului de Referinta +minimap.waypoints.choosecolor=Alege Culoarea: +minimap.waypoints.enabled=Permite: +minimap.waypoints.enable=Permite Punct de Referinţă +minimap.waypoints.disable=Nu Permite Punct de Referinţă +minimap.waypoints.applicabledimensions=Dimensiunile în care Punctul de Referinţă va fi vizibil +minimap.waypoints.dimension.applies=Vizibil în aceasta dimensiune +minimap.waypoints.dimension.notapplies=Invizibil în aceasta dimensiune +minimap.waypoints.sortbyname=Nume +minimap.waypoints.sortbydistance=Distanţă +minimap.waypoints.sortbycreated=Creat +minimap.waypoints.sortbycolor=Culoare \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ru_RU.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ru_RU.lang new file mode 100644 index 0000000..1f73f15 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/ru_RU.lang @@ -0,0 +1,90 @@ +minimap.ui.welcome1=Разработчик: MamiyaOtaru +minimap.ui.welcome2=Перевели: Qerter, RussDragon, Satellence, VBB +minimap.ui.welcome3=Добро пожаловать в VoxelMap! +minimap.ui.welcome4=Доступные команды и настройки: +minimap.ui.welcome5a=Увеличение +/- +minimap.ui.welcome5b=Настройки +minimap.ui.welcome6=Полноэкранная карта +minimap.ui.welcome7=Добавить маркер +minimap.ui.welcome8=Спрятать это сообщение +minimap.ui.zoomlevel=Масштаб +minimap.ui.otheroptions=Другие настройки + +options.minimap.title=Настройки карты +options.minimap.showcoordinates=Показывать координаты +options.minimap.hideminimap=Скрыть карту +options.minimap.cavemode=Включить режим пещер +options.minimap.dynamiclighting=Динамичное освещение +options.minimap.terraindepth=Глубина ландшафта +options.minimap.squaremap=Квадратная карта +options.minimap.oldnorth=Старый север (beta) +options.minimap.ingamewaypoints=Маркеры в игре +options.minimap.ingamewaypoints.beacons=Маяки +options.minimap.ingamewaypoints.signs=Знаки +options.minimap.ingamewaypoints.both=Маяки и знаки +options.minimap.location=Расположние +options.minimap.location.topleft=Сверху слева +options.minimap.location.topright=Сверху справа +options.minimap.location.bottomright=Снизу справа +options.minimap.location.bottomleft=Снизу слева +options.minimap.size=Размер +options.minimap.size.small=Маленькая +options.minimap.size.medium=Средняя +options.minimap.size.large=Большая +options.minimap.radar=Радар... +options.minimap.radar.title=Настройки радара +options.minimap.radar.showradar=Радар +options.minimap.radar.showhostiles=Показать врагов +options.minimap.radar.showplayers=Показать игроков +options.minimap.radar.showneutrals=Другие существа +options.minimap.radar.iconoutlines=Рамка иконки +options.minimap.radar.iconfiltering=Прозрачность иконки +options.minimap.radar.showplayerhelmets=Показывать шлемы игроков +options.minimap.radar.showmobhelmets=Показывать шлемы существ +options.minimap.radar.randomobs=Случайные существа +options.minimap.detailsperformance=Детали/Производительность +options.minimap.filtering=Фильтрация +options.minimap.watertransparency=Прозрачность воды +options.minimap.blocktransparency=Прозрачность блоков +options.minimap.biomes=Биомы +options.minimap.biomeoverlay=Наложение биомов +options.minimap.biomeoverlay.transparent=Прозрачность +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Сетка чанков +options.minimap.terrain.height=Высота +options.minimap.terrain.slope=Склон +options.minimap.terrain.both=Высота и склон +options.minimap.waypoints=Маркеры... +options.minimap.waypoints.title=Настройки маркеров +options.minimap.waypoints.distance=Максимальная дистанция +options.minimap.waypoints.infinite=Не ограничено +options.minimap.waypoints.deathpoints=Маркер(-ы) смерти +options.minimap.waypoints.deathpoints.mostrecent=Только последняя +options.minimap.waypoints.deathpoints.all=Все +options.minimap.waypoints.deathpoints.tooltip=Вступит в силу после следующей смерти + +controls.minimap.title=Контроль карты +controls.minimap.unbind1=Для отмены привязки клавиши, выделите его и нажмите 'Esc' +controls.minimap.unbind2=(За исключением клавиши Меню - она не может быть отменена) +key.minimap.zoom=Увеличение +key.minimap.togglefullscreen=Включить полноэкранный режим карты +key.minimap.menu=Меню +key.minimap.togglemobs=Отображение существ +key.minimap.waypointhotkey=Установка маркера +key.minimap.waypointmenu=Меню маркеров + +minimap.waypoints.title=Маркеры (Waypoints) +minimap.waypoints.teleportto=Телепортироваться на... +minimap.waypoints.highlight=Выделение +minimap.waypoints.newwaypoint=Новый маркер +minimap.waypoints.deleteconfirm=Вы уверены, что хотите удалить этот маркер? +minimap.waypoints.edit=Редактировать маркер +minimap.waypoints.new=Новый маркер +minimap.waypoints.name=Имя маркера +minimap.waypoints.choosecolor=Выберите цвет: +minimap.waypoints.enabled=Включить: +minimap.waypoints.enable=Включить маркеры +minimap.waypoints.disable=Выключить маркеры +minimap.waypoints.applicabledimensions=Видимость маркера в измерениях +minimap.waypoints.dimension.applies=Видим в этом измерении +minimap.waypoints.dimension.notapplies=Скрыт в этом измерении \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sk_SK.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sk_SK.lang new file mode 100644 index 0000000..7965078 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sk_SK.lang @@ -0,0 +1,104 @@ +sk_SK +minimap.ui.welcome1=Spravuje MamiyaOtaru +minimap.ui.welcome2=Preložil: rufo123 +minimap.ui.welcome3=Víta ťa VoxelMap, ktorá ti ponúka +minimap.ui.welcome4=množstvo vlastností a príkazov. +minimap.ui.welcome5a=Priblížiť/Odddialiť +minimap.ui.welcome5b=Natavenia +minimap.ui.welcome6=Prepnúť mapu na celú obrazovku. +minimap.ui.welcome7=Rýchlo pridať waypoint. +minimap.ui.welcome8=Schovať túto správu +minimap.ui.zoomlevel=Priblíženie: +minimap.ui.otheroptions=Ostatné Nastavenia + +options.minimap.title=Možnosti Minimapy +options.minimap.showcoordinates=Zobraziť Súradnice +options.minimap.hideminimap=Schovať Minimapu +options.minimap.cavemode=Povoliť Jaskynný Mód +options.minimap.dynamiclighting=Vyhladené Tieňe +options.minimap.terraindepth=Hĺbka Terénu +options.minimap.squaremap=Štvorcová Mapa +options.minimap.oldnorth=Starý Sever +options.minimap.ingamewaypoints=In-game Waypointy +options.minimap.ingamewaypoints.beacons=Majáky +options.minimap.ingamewaypoints.signs=Značky +options.minimap.ingamewaypoints.both=Oboje +options.minimap.location=Umiestnenie +options.minimap.location.topleft=Vľavo Hore +options.minimap.location.topright=Vpravo Hore +options.minimap.location.bottomright=Vpravo Dole +options.minimap.location.bottomleft=Vľavo Dole +options.minimap.size=Veľkosť +options.minimap.size.small=Malá +options.minimap.size.medium=Stredná +options.minimap.size.large=Veľká +options.minimap.fontsize=Veľkosť písma +options.minimap.radar=Radar... +options.minimap.radar.title=Možnosti Radaru +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Zobraziť nepriateľských +options.minimap.radar.showplayers=Zobraziť hráčov +options.minimap.radar.showneutrals=Zobraziť neutrálnych +options.minimap.radar.iconoutlines=Obrysy Ikôn +options.minimap.radar.iconfiltering=Filtrovanie Ikôn +options.minimap.radar.showplayernames=Zobraziť Mená Hráčov +options.minimap.radar.showplayerhelmets=Zobraziť Helmy Hráčov +options.minimap.radar.showmobhelmets=Zobraziť Helmy Mobov +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Mobovia na zobrazenie... +options.minimap.detailsperformance=Detaily/Výkon... +options.minimap.terrain.height=Výška +options.minimap.terrain.slope=Sklon +options.minimap.terrain.both=Oboje +options.minimap.filtering=Filtrovanie +options.minimap.watertransparency=Priehľadnosť Vody +options.minimap.blocktransparency=Priehľadnosť Blokov +options.minimap.biomes=Biomy +options.minimap.biomeoverlay=Prekrytie Biomov +options.minimap.biomeoverlay.transparent=Priehľadné +options.minimap.biomeoverlay.solid=Nepriehľadné +options.minimap.chunkgrid=Mriežka Chunkov +options.minimap.waypoints=Waypointy... +options.minimap.waypoints.title=Nastavenie Waypointov +options.minimap.waypoints.distance=Maximálna Vzdialenosť +options.minimap.waypoints.infinite=Nekonečno +options.minimap.waypoints.deathpoints=Deathpoint(y) +options.minimap.waypoints.deathpoints.mostrecent=Najnovšie +options.minimap.waypoints.deathpoints.all=Všetky +options.minimap.waypoints.deathpoints.tooltip=Bude mať vplyv od budúcej smrti +options.minimap.waypoints.showwaypointnames=Zobraziť Názvy na Mape +options.minimap.mobs.title=Zobraziť alebo Skryť Individúalne Typy Mobov +options.minimap.mobs.enable=Povoliť Ikonku Mobov +options.minimap.mobs.disable=Zakázať Ikonku Mobov +options.minimap.mobs.enabled=Táto Ikona je Zobrazená +options.minimap.mobs.disabled=Táto Ikona nieje Zobrazená + +controls.minimap.title=Ovládanie Minimapy +controls.minimap.unbind1=Pre zrušenie nastavenej klávesy stlačte 'Escape'. +controls.minimap.unbind2=(S výnimkou klávesy Menu, ktorá nejde zrušiť) +key.minimap.zoom=Priblíženie +key.minimap.togglefullscreen=Prepnúť mapu na celú obrazovku +key.minimap.menu=Menu +key.minimap.togglemobs=Prepnúť zobrazenie Mobov +key.minimap.waypointhotkey=Tlačidlo na Waypointy +key.minimap.waypointmenu=Menu Waypointov + +minimap.waypoints.title=Waypointy +minimap.waypoints.teleportto=Teleportovať +minimap.waypoints.highlight=Zvýrazniť +minimap.waypoints.newwaypoint=Nový Waypoint +minimap.waypoints.deleteconfirm=Naozaj si prajete odstrániť tento Waypoint? +minimap.waypoints.edit=Upraviť Waypoint +minimap.waypoints.new=Nový Waypoint +minimap.waypoints.name=Meno Waypointu +minimap.waypoints.choosecolor=Nastaviť Farbu: +minimap.waypoints.enabled=Povolený: +minimap.waypoints.enable=Povoliť Waypoint +minimap.waypoints.disable=Zakázať Waypoint +minimap.waypoints.applicabledimensions=Dimenzia v ktorej buďe waypoint viditelný +minimap.waypoints.dimension.applies=Je viditeľný v tejto dimenzií +minimap.waypoints.dimension.notapplies=Nieje viditeľný +minimap.waypoints.sortbyname=Mena +minimap.waypoints.sortbydistance=Vzdiaľenosti +minimap.waypoints.sortbycreated=Vytvorenia +minimap.waypoints.sortbycolor=Farby \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sl_SI.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sl_SI.lang new file mode 100644 index 0000000..9956ba1 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sl_SI.lang @@ -0,0 +1,100 @@ +en_US +minimap.ui.welcome1=Vzdržuje MamiyaOtaru +minimap.ui.welcome2=Prevedel: fruit4all +minimap.ui.welcome3=Dobrodošel pri VoxelMapu, tukaj je +minimap.ui.welcome4=zelo veliko funkcij in komand, ki jih lahko uporabljaš. +minimap.ui.welcome5a=Približaj/Oddalji +minimap.ui.welcome5b=Nastavitve +minimap.ui.welcome6=Izključi ali priključi celotno-zaslonski zemlevid. +minimap.ui.welcome7=Hitro dodaj lokacijo. +minimap.ui.welcome8=Skrij to sporočilo +minimap.ui.zoomlevel=Velikost zooma: +minimap.ui.otheroptions=Ostale nastavitve + +options.minimap.title=Nastavitve Mini-zemljevida +options.minimap.showcoordinates=Pokaži koordinate +options.minimap.hideminimap=Skrij Mini-zemljevid +options.minimap.cavemode=Izključi ali priključi način z jamami +options.minimap.dynamiclighting=Dinamična osvetlitev +options.minimap.terraindepth=Globina terena +options.minimap.squaremap=Kvadraten zemljevid +options.minimap.oldnorth=Stari sever +options.minimap.ingamewaypoints=Lokacije v igri +options.minimap.ingamewaypoints.beacons=Luči +options.minimap.ingamewaypoints.signs=Znaki +options.minimap.ingamewaypoints.both=Oboje +options.minimap.location=Lokacija +options.minimap.location.topleft=Zgoraj Levo +options.minimap.location.topright=Zgoraj Desno +options.minimap.location.bottomright=Spodaj Desno +options.minimap.location.bottomleft=Spodaj Levo +options.minimap.size=Velikost +options.minimap.size.small=Majhna +options.minimap.size.medium=Standardna +options.minimap.size.large=Velika +options.minimap.fontsize=Velikost pisave +options.minimap.radar=Radar... +options.minimap.radar.title=Nastavitve Radarja +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Pokaži sovražnike +options.minimap.radar.showplayers=Pokaži igralce +options.minimap.radar.showneutrals=Pokaži nevtralne +options.minimap.radar.iconoutlines=Rob ikon +options.minimap.radar.iconfiltering=Filter ikon +options.minimap.radar.showplayernames=Pokaži imena igralcev +options.minimap.radar.showplayerhelmets=Pokaži čelade igralcev +options.minimap.radar.showmobhelmets=Pokaži čelade sovražnikov +options.minimap.radar.randomobs=Naključni sovražniki +options.minimap.radar.selectmobs=Pokažem katere sovražnike +options.minimap.detailsperformance=Detajli/Boljše izvajanje... +options.minimap.terrain.height=Višina +options.minimap.terrain.slope=Klančina +options.minimap.terrain.both=Oboje +options.minimap.filtering=Filtriranje +options.minimap.watertransparency=Transparentnos vode +options.minimap.blocktransparency=Transparentnos kock +options.minimap.biomes=Biomi +options.minimap.biomeoverlay=Prekrivanje biomov +options.minimap.biomeoverlay.transparent=Transparentnos +options.minimap.biomeoverlay.solid=Trdota +options.minimap.chunkgrid=Mreža +options.minimap.waypoints=Lokacije... +options.minimap.waypoints.title=Nastavitve lokacij +options.minimap.waypoints.distance=Maksimalna dolžina +options.minimap.waypoints.infinite=Neskončno +options.minimap.waypoints.deathpoints=Lokacija/e smrti +options.minimap.waypoints.deathpoints.mostrecent=Najnovejše +options.minimap.waypoints.deathpoints.all=Vse +options.minimap.waypoints.deathpoints.tooltip=Se ponastavi pri naslednji smrti +options.minimap.waypoints.showwaypointnames=Imena lokacij na zemljevidu +options.minimap.mobs.title=Pokaži ali skrij tipe sovražnikov +options.minimap.mobs.enable=Dovoli sovražnike +options.minimap.mobs.disable=Odstrani sovražnike +options.minimap.mobs.enabled=Kazanje sovražnikov priključeno +options.minimap.mobs.disabled=Kazanje sovražnikov izključeno + +controls.minimap.title=Kontrole mini-zemljevida +controls.minimap.unbind1=Da izbrišeš bližnjico, jo izberi in pritisni 'Escape'. +controls.minimap.unbind2=(Razen za tipko za meni - te ne moreš spremeniti) +key.minimap.zoom=Približaj +key.minimap.togglefullscreen=Priključi ali izključi celozaslonski zemljevid +key.minimap.menu=Meni +key.minimap.togglemobs=Priključi ali izključi kazanje sovražnikov +key.minimap.waypointhotkey=Bližnjica za lokacijo +key.minimap.waypointmenu=Meni za lokacije + +minimap.waypoints.title=Lokacija +minimap.waypoints.teleportto=Teleportiraj se do +minimap.waypoints.highlight=Izberi +minimap.waypoints.newwaypoint=Nova lokacija +minimap.waypoints.deleteconfirm=Ali si siguren, da bi rad izbrisal to lokacijo? +minimap.waypoints.edit=Spremeni lokacijo +minimap.waypoints.new=Nova lokacija +minimap.waypoints.name=Ime lokacije +minimap.waypoints.choosecolor=Izberi barvo: +minimap.waypoints.enabled=Dovoljeno: +minimap.waypoints.enable=Dovoli lokacijo +minimap.waypoints.disable=Ne dovoli lokacije +minimap.waypoints.applicabledimensions=Dimenzije, v katerih se bo to lokacijo videlo +minimap.waypoints.dimension.applies=Vidno v tej dimenziji +minimap.waypoints.dimension.notapplies=Ni vidno v tej dimenziji \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sr_SP.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sr_SP.lang new file mode 100644 index 0000000..8cf51de --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sr_SP.lang @@ -0,0 +1,99 @@ +minimap.ui.welcome1=Одржава MamiyaOtaru +minimap.ui.welcome2=Превео: NuclearBanana +minimap.ui.welcome3=Добродошли у VoxelMap, постоји +minimap.ui.welcome4=велики број команди које су вам доступне. +minimap.ui.welcome5a=Зумирај/Одзумирај +minimap.ui.welcome5b=Подешавања +minimap.ui.welcome6=Пребацивање мапе преко целог екрана. +minimap.ui.welcome7=Додај путању. +minimap.ui.welcome8=Сакриј ову поруку +minimap.ui.zoomlevel=Ниво зумирања: +minimap.ui.otheroptions=Остала Подешавања + +options.minimap.title=Подешавања Минимапе +options.minimap.showcoordinates=Приказ путања +options.minimap.hideminimap=Сакриј Минимапу +options.minimap.cavemode=Омогући Приказ Пећина +options.minimap.dynamiclighting=Динамичко Осветљење +options.minimap.terraindepth=Дубина Терена +options.minimap.squaremap=Квадратна Мапа +options.minimap.oldnorth=Стари Северoptions. +minimap.ingamewaypoints=Путање у Игри +options.minimap.ingamewaypoints.beacons=Светионици +options.minimap.ingamewaypoints.signs=Знакови +options.minimap.ingamewaypoints.both=Оба +options.minimap.location=Локација +options.minimap.location.topleft=Горе Лево +options.minimap.location.topright=Горе Десно +options.minimap.location.bottomright=Доле Десно +options.minimap.location.bottomleft=Доле Лево +options.minimap.size=Bеличина +options.minimap.size.small=Мало +options.minimap.size.medium=Нормално +options.minimap.size.large=Велико +options.minimap.fontsize=Величина Слова +options.minimap.radar=Радар... +options.minimap.radar.title=Подешавање Радара +options.minimap.radar.showradar=Радар +options.minimap.radar.showhostiles=Прикажи Непријатеље +options.minimap.radar.showplayers=Прикажи Играче +options.minimap.radar.showneutrals=Прикажи Мирне +options.minimap.radar.iconoutlines=Нацрти Икона +options.minimap.radar.iconfiltering=Филтрирање Икона +options.minimap.radar.showplayernames=Прикажи Имена Играча +options.minimap.radar.showplayerhelmets=Прикажи Шлемове Играча +options.minimap.radar.showmobhelmets=Прикажи Шлемове Руља +options.minimap.radar.randomobs=Randomobs +options.minimap.radar.selectmobs=Руље за Приказ... +options.minimap.detailsperformance=Детаљи/Перформанце... +options.minimap.terrain.height=Висина +options.minimap.terrain.slope=Нагиб +options.minimap.terrain.both=Оба +options.minimap.filtering=Филтрирање +options.minimap.watertransparency=Провидност Воде +options.minimap.blocktransparency=Провидност Коцки +options.minimap.biomes=Биоми +options.minimap.biomeoverlay=Преклапање Биома +options.minimap.biomeoverlay.transparent=Провидан +options.minimap.biomeoverlay.solid=Чврст +options.minimap.chunkgrid=Chunk Grid +options.minimap.waypoints=Путање... +options.minimap.waypoints.title=Подешавање Путање +options.minimap.waypoints.distance=Највећа Раздаљина +options.minimap.waypoints.infinite=Бесконачан +options.minimap.waypoints.deathpoints=Место Смрити +options.minimap.waypoints.deathpoints.mostrecent=Најновији +options.minimap.waypoints.deathpoints.all=Све +options.minimap.waypoints.deathpoints.tooltip=Има утицај на следећу смрт +options.minimap.waypoints.showwaypointnames=Прикажи имена на мапи +options.minimap.mobs.title=Прикажи или Сакриј Врсте Руља +options.minimap.mobs.enable=Омогући Руље +options.minimap.mobs.disable=Онемогући Руље +options.minimap.mobs.enabled=Омогућено Приказивање Руља +options.minimap.mobs.disabled=Омогућено Приказивање Руља + +controls.minimap.title=Контроле Минимапе +controls.minimap.unbind1=Дa раскорачите дугме, изаберите га и притисните 'Escape'. +controls.minimap.unbind2=(Осим за Мени дугме - не може се раскорачити) +key.minimap.zoom=Зумирај +key.minimap.togglefullscreen=Омогући мапу преко целог екрана +key.minimap.menu=Мени +key.minimap.togglemobs=Омогући Руље +key.minimap.waypointhotkey=Дугме за Путање +key.minimap.waypointmenu=Мени Путањи + +minimap.waypoints.title=Путање +minimap.waypoints.teleportto=Телепортуј се +minimap.waypoints.highlight=Осветљење +minimap.waypoints.newwaypoint=Нова Путања +minimap.waypoints.deleteconfirm=Да ли си сигуран да желиш да уклониш ову путању? +minimap.waypoints.edit=Уреди Путању +minimap.waypoints.new=Нова Путања +minimap.waypoints.name=Име Путање +minimap.waypoints.choosecolor=Изабери Боју: +minimap.waypoints.enabled=Омогућено: +minimap.waypoints.enable=Омогући Путање +minimap.waypoints.disable=Онемогући Путање +minimap.waypoints.applicabledimensions=Димензија у којима ће путања бити видљива +minimap.waypoints.dimension.applies=Бидљива у димензијама +minimap.waypoints.dimension.notapplies=Није видљива у димензијама \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sv_SE.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sv_SE.lang new file mode 100644 index 0000000..d0e25d0 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/sv_SE.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Upprätthållen av MamiyaOtaru +minimap.ui.welcome2=Översatt av: johnbohn, FiskFille +minimap.ui.welcome3=Välkommen till VoxelMap, det finns +minimap.ui.welcome4=ett antal funktioner och kommandon tillgängliga för dig. +minimap.ui.welcome5a=Zooma in/ut +minimap.ui.welcome5b=Inställningar +minimap.ui.welcome6=Öppna helskärmskarta +minimap.ui.welcome7=Snabbt lägga till en waypoint. +minimap.ui.welcome8=Dölj det här meddelandet +minimap.ui.zoomlevel=Zoom nivå: +minimap.ui.otheroptions=Andra Inställningar + +options.minimap.title=Minimap Inställningar +options.minimap.showcoordinates=Visa Koordinater +options.minimap.hideminimap=Dölj Minimap +options.minimap.cavemode=Sätt på Cave Mode +options.minimap.dynamiclighting=Dynamisk belysning +options.minimap.terraindepth=Terrängdjup +options.minimap.squaremap=Fyrkantig Minimap +options.minimap.oldnorth=Gamla Norr +options.minimap.ingamewaypoints=I-spelet Waypoints +options.minimap.ingamewaypoints.beacons=Fyrtorn +options.minimap.ingamewaypoints.signs=Skyltar +options.minimap.ingamewaypoints.both=Båda +options.minimap.location=Plats +options.minimap.location.topleft=Övre Vänstra +options.minimap.location.topright=Övre Högra +options.minimap.location.bottomright=Bottersta Högra +options.minimap.location.bottomleft=Bottersta Vänstra +options.minimap.size=Storlek +options.minimap.size.small=Liten +options.minimap.size.medium=Medium +options.minimap.size.large=Stor +options.minimap.fontsize=Font Strorlek +options.minimap.radar=Radar... +options.minimap.radar.title=Radar Alternativ +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Visa Fiender +options.minimap.radar.showplayers=Visa Spelare +options.minimap.radar.showneutrals=Visa Neutrala +options.minimap.radar.iconoutlines=Ikonbeskrivning +options.minimap.radar.iconfiltering=Ikonfiltering +options.minimap.radar.showplayernames=Visa Användarnamn +options.minimap.radar.showplayerhelmets=Visa spelarhjälmar +options.minimap.radar.showmobhelmets=Visa Monsters Hjälmar +options.minimap.radar.randomobs=Slumpmonster +options.minimap.radar.selectmobs=Monster att Visa... +options.minimap.detailsperformance=Detaljer/Prestanda... +options.minimap.filtering=Filtering +options.minimap.watertransparency=Vattenöppenhet +options.minimap.blocktransparency=Blocköppenhet +options.minimap.biomes=Biomes +options.minimap.biomeoverlay=Biomeöverlagring +options.minimap.biomeoverlay.transparent=Transparent +options.minimap.biomeoverlay.solid=Solid +options.minimap.chunkgrid=Chunkrutnät +options.minimap.terrain.height=Höjd +options.minimap.terrain.slope=Lutning +options.minimap.terrain.both=Båda +options.minimap.waypoints=Waypoints... +options.minimap.waypoints.title=Vägpunkts Alternativ +options.minimap.waypoints.distance=Max Avstånd +options.minimap.waypoints.infinite=Oändlig +options.minimap.waypoints.deathpoints=Dödsplats(er) +options.minimap.waypoints.deathpoints.mostrecent=Den Senaste +options.minimap.waypoints.deathpoints.all=Alla +options.minimap.waypoints.deathpoints.tooltip=Verkställs vid nästa död +options.minimap.waypoints.showwaypointnames=Punktnamn på Karta +options.minimap.mobs.title=Visa eller Göm Individuella Monstertyper +options.minimap.mobs.enable=Aktivera Monster +options.minimap.mobs.disable=Inaktivera Monster +options.minimap.mobs.enabled=Visa Monster Aktiverat +options.minimap.mobs.disabled=Visa Monster Inaktiverat + +controls.minimap.title=Minimap Kontroller +controls.minimap.unbind1=För att ta bort en kontroll, markera den och tryck på "esc" knappen. +controls.minimap.unbind2=(Med undantag för menyknappen - Den kan inte tas bort.) +key.minimap.zoom=Zooma +key.minimap.togglefullscreen=Aktivera helskärmskarta +key.minimap.menu=Meny +key.minimap.waypointhotkey=Waypoint-knapp +key.minimap.togglemobs=Aktivera Mobs +key.minimap.waypointmenu=Vägpunkts Meny + +minimap.waypoints.title=Waypoints +minimap.waypoints.teleportto=Teleportera till +minimap.waypoints.highlight=Markera +minimap.waypoints.newwaypoint=Ny Waypoint +minimap.waypoints.deleteconfirm=Är du säker på att ta bort den här waypointen? +minimap.waypoints.edit=Redigera Waypoint +minimap.waypoints.new=Ny Waypoint +minimap.waypoints.name=Waypointnamn +minimap.waypoints.choosecolor=Välj Färg: +minimap.waypoints.enabled=Aktivera: +minimap.waypoints.enable=Aktivera Waypoint +minimap.waypoints.disable=Avaktivera Waypoint +minimap.waypoints.applicabledimensions=Dimensioner där denna vägpunkt kommer at visas +minimap.waypoints.dimension.applies=Synlig i denna dimension +minimap.waypoints.dimension.notapplies=Inte synlig i denna dimension +minimap.waypoints.sortbyname=Namn +minimap.waypoints.sortbydistance=Distans +minimap.waypoints.sortbycreated=Skapad +minimap.waypoints.sortbycolor=Färg \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/th_TH.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/th_TH.lang new file mode 100644 index 0000000..f6c9470 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/th_TH.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=ดูแลโดย MamiyaOtaru +minimap.ui.welcome2=แปลโดย: MLSTS, INC. (MATIT LEESATHAPRON)! +minimap.ui.welcome3=ยินดีต้อนรับสู่ VoxelMap, +minimap.ui.welcome4=มีฟีเจอร์และคำสั่งที่สามารถใช้ได้คือ +minimap.ui.welcome5a=ซูมเข้า/ออก +minimap.ui.welcome5b=ตัวเลือก +minimap.ui.welcome6=สลับเป็นแผนที่เต็มหน้าจอ. +minimap.ui.welcome7=เพิ่มจุดเวย์พอยต์ทันที. +minimap.ui.welcome8=ซ่อนข้อความนี้ +minimap.ui.zoomlevel=ระดับการซูม: +minimap.ui.otheroptions=ตัวเลือกอื่นๆ + +options.minimap.title=ตัวเลือกแผนที่ขนาดย่อ +options.minimap.showcoordinates=แสดงพิกัด +options.minimap.hideminimap=ซ่อนแผนที่ขนาดย่อ +options.minimap.cavemode=แสดงแผนที่ภายในถ่ำ +options.minimap.dynamiclighting=แสงแบบไดนามิก +options.minimap.terraindepth=แสดงความลึกของภูมิประเทศ +options.minimap.squaremap=แผนที่แบบวงกลม +options.minimap.oldnorth=ทิศเหนือเก่า +options.minimap.ingamewaypoints=จุดเวย์พอยต์ในเกม +options.minimap.ingamewaypoints.beacons=แสงดวงประทีป (บีคอน) +options.minimap.ingamewaypoints.signs=ป้าย +options.minimap.ingamewaypoints.both=ทั้งคู่ +options.minimap.location=ตำแหน่ง +options.minimap.location.topleft=บนซ้าย +options.minimap.location.topright=บนขวา +options.minimap.location.bottomright=ล่างขวา +options.minimap.location.bottomleft=ล่างซ้าย +options.minimap.size=ขนาด +options.minimap.size.small=เล็ก +options.minimap.size.medium=ปกติ +options.minimap.size.large=ใหม่ +options.minimap.fontsize=ขนาดฟอนต์ +options.minimap.radar=เรดาร์... +options.minimap.radar.title=ตัวเลือกเรดาร์ +options.minimap.radar.showradar=เรดาร์ +options.minimap.radar.showhostiles=แสดงศัตรู +options.minimap.radar.showplayers=แสดงผู้เล่น +options.minimap.radar.showneutrals=แสดงสัตว์ +options.minimap.radar.iconoutlines=แสดงลายเส้นบนไอคอน +options.minimap.radar.iconfiltering=กรองไอคอน +options.minimap.radar.showplayernames=แสดงชื่อของผู้เล่น +options.minimap.radar.showplayerhelmets=แสดงหมวกผู้เล่นในแผนที่ +options.minimap.radar.showmobhelmets=แสดงหมวกม็อบในแผนที่ +options.minimap.radar.randomobs=สุ่มม็อบ +options.minimap.radar.selectmobs=เลือกม็อบที่จะแสดง... +options.minimap.detailsperformance=รายละเอียด/ประสิทธิภาพ... +options.minimap.terrain.height=ความสูง +options.minimap.terrain.slope=ความชัน +options.minimap.terrain.both=ทั้งคู่ +options.minimap.filtering=การกรอง +options.minimap.watertransparency=น้ำโปร่งใส +options.minimap.blocktransparency=บล็อกโปร่งใส +options.minimap.biomes=สิ่งแวดล้อม (ต้นไม้,ฯลฯ) +options.minimap.biomeoverlay=แสดงข้อมูลสิ่งแวดล้อมบนแผนที่ +options.minimap.biomeoverlay.transparent=ความโปร่งใส +options.minimap.biomeoverlay.solid=ของแข็ง +options.minimap.chunkgrid=ตาราง Chunk +options.minimap.waypoints=เวย์พอยต์... +options.minimap.waypoints.title=ตัวเลือกเวย์พอยต์ +options.minimap.waypoints.distance=ระยะสูงสุด +options.minimap.waypoints.infinite=ไม่จำกัด +options.minimap.waypoints.deathpoints=จุดที่ตาย +options.minimap.waypoints.deathpoints.mostrecent=ล่าสุด +options.minimap.waypoints.deathpoints.all=ทั้งหมด +options.minimap.waypoints.deathpoints.tooltip=มีผลในการตายครั้งต่อไป +options.minimap.waypoints.showwaypointnames=ชื่อจุดบนแผนที่ +options.minimap.mobs.title=แสดงหรือซ่อนม็อบแต่ละชนิด +options.minimap.mobs.enable=เปิดม็อบ +options.minimap.mobs.disable=ปิดม็อบ +options.minimap.mobs.enabled=เปิดระบบแสดงม็อบ +options.minimap.mobs.disabled=ปิดระบบแสดงม็อบ + +controls.minimap.title=ควบคุมแผนที่ขนาดเล็ก +controls.minimap.unbind1=หากต้องการนำปุ่มออก เลือกมันและกดปุ่ม 'Escape' +controls.minimap.unbind2=(ยกเว้นปุ่มเมนูเพราะมันไม่สามารถนำออกได้) +key.minimap.zoom=ซูม +key.minimap.togglefullscreen=สลับเป็นแผนที่เต็มหน้าจอ +key.minimap.menu=เมนู +key.minimap.togglemobs=สลับม็อบ +key.minimap.waypointhotkey=ปุ่มลัดเวย์พอยต์ +key.minimap.waypointmenu=เมนูเวย์พอยต์ + +minimap.waypoints.title=เวย์พอยต์ +minimap.waypoints.teleportto=วาร์ปไป +minimap.waypoints.highlight=จุดเด่น +minimap.waypoints.newwaypoint=เวย์พอยต์ใหม่ +minimap.waypoints.deleteconfirm=คุณแน่ใจหรือไม่ว่าต้องการลบเวย์พอยต์นี้? +minimap.waypoints.edit=แก้ไขเวย์พอยต์ +minimap.waypoints.new=เวย์พอยต์ใหม่ +minimap.waypoints.name=ชื่อเวย์พอยต์ +minimap.waypoints.choosecolor=เลือกสี: +minimap.waypoints.enabled=เปิด: +minimap.waypoints.enable=เปิดเวย์พอยต์ +minimap.waypoints.disable=ปิดเวย์พอยต์ +minimap.waypoints.applicabledimensions=มิติที่จะมองเห็นเวย์พอยต์นี้ได้ +minimap.waypoints.dimension.applies=มองเห็นในมิตินี้ +minimap.waypoints.dimension.notapplies=มองไม่เห็นในมิตินี้ +minimap.waypoints.sortbyname=ชื่อ +minimap.waypoints.sortbydistance=ระยะทาง +minimap.waypoints.sortbycreated=เวลาที่สร้าง +minimap.waypoints.sortbycolor=สี \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/tr_TR.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/tr_TR.lang new file mode 100644 index 0000000..93a4ce5 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/tr_TR.lang @@ -0,0 +1,99 @@ +minimap.ui.welcome1=Yapimci: MamiyaOtaru +minimap.ui.welcome2=Çeviren:iheartcookie, +minimap.ui.welcome3=VoxelMap'a hoşgeldiniz, size uygun bazı +minimap.ui.welcome4=özellikler ve komutlar var. +minimap.ui.welcome5a=Yakınlaş/Uzaklaş +minimap.ui.welcome5b=Ayarlar +minimap.ui.welcome6=Tam ekran haritayı aç/kapa. +minimap.ui.welcome7=Çabucak bir waypoint ekle. +minimap.ui.welcome8=Bu mesajı gizle +minimap.ui.zoomlevel=Zoom seviyesi: +minimap.ui.otheroptions=Diğer ayarlar + +options.minimap.title=Miniharita Ayarları +options.minimap.showcoordinates=Koordinatları Goster +options.minimap.hideminimap=Minimap'i Gizle +options.minimap.cavemode=Mağara Modu +options.minimap.dynamiclighting=Dinamik Işıklandirma +options.minimap.terraindepth=Arazi yuksekligi +options.minimap.squaremap=Kare harita +options.minimap.oldnorth=Eski Kuzey +options.minimap.ingamewaypoints=Oyun içi Waypoint'ler +options.minimap.ingamewaypoints.beacons=Fenerler +options.minimap.ingamewaypoints.signs=İşaretler +options.minimap.ingamewaypoints.both=Her ikisi de +options.minimap.location=Konum +options.minimap.location.topleft=Sol Üst +options.minimap.location.topright=Sağ Üst +options.minimap.location.bottomright=Sağ Alt +options.minimap.location.bottomleft=Sol Alt +options.minimap.size=Boyut +options.minimap.size.small=Küçük +options.minimap.size.medium=Orta +options.minimap.size.large=Büyük +options.minimap.fontsize=Yazı Tipi Büyüklüğü +options.minimap.radar=Radar... +options.minimap.radar.title=Radar Ayarları +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Saldırganları Göster +options.minimap.radar.showplayers=Oyuncuları Göster +options.minimap.radar.showneutrals=Nötrleri Göster +options.minimap.radar.iconoutlines=Simge Çerçevesi +options.minimap.radar.iconfiltering=Simge Filtreleme +options.minimap.radar.showplayerhelmets=Oyuncu Kasklari Göster +options.minimap.radar.showmobhelmets=Mob Kasklari Göster +options.minimap.radar.showplayernames=Oyuncu Adlarını Göster +options.minimap.radar.randomobs=Rastgele Moblar +options.minimap.radar.selectmobs=Mobları Göster... +options.minimap.detailsperformance=Detaylar/Performans... +options.minimap.terrain.height=Yükseklik +options.minimap.terrain.slope=Eğim +options.minimap.terrain.both=Her ikisi de +options.minimap.filtering=Filtreleme +options.minimap.watertransparency=Su saydamlığı +options.minimap.blocktransparency=Blok Saydamlığı +options.minimap.biomes=Biyomlar +options.minimap.biomeoverlay=Biyom Goruntusu +options.minimap.biomeoverlay.transparent=Şaydam +options.minimap.biomeoverlay.solid=Katı +options.minimap.chunkgrid=Toprak Izgarası +options.minimap.waypoints=Waypointlerim... +options.minimap.waypoints.title=Waypoint Ayarlari +options.minimap.waypoints.distance=Max Uzaklik +options.minimap.waypoints.infinite=Sinirsiz +options.minimap.waypoints.deathpoints=Olum Noktasi(s) +options.minimap.waypoints.deathpoints.mostrecent=En Yeni +options.minimap.waypoints.deathpoints.all=Hepsi +options.minimap.waypoints.deathpoints.tooltip=Oldugunuz yeri gosterir +options.minimap.waypoints.showwaypointnames=Haritadaki Noktaların Adları +options.minimap.mobs.title=Bireysel Mobları Göster Veya Gizle +options.minimap.mobs.enable=Mob Simgelerini Aç +options.minimap.mobs.disable=Mob Simgelerini Kapat +options.minimap.mobs.enabled=Bu simge görüntülenir. +options.minimap.mobs.disabled=Bu simge görüntülenmez. + +controls.minimap.title=Miniharita Kontrolleri +controls.minimap.unbind1=Bir tuşun bağlantısını kaldırmak için,tuşu seçin ve "ESC" tuşuna basın. +controls.minimap.unbind2=(Menü butonu dışında-onun bağlantısı kaldırılamaz) +key.minimap.zoom=Zoom +key.minimap.togglefullscreen=Tam Ekran Haritayı Aç/Kapa +key.minimap.menu=Menü +key.minimap.togglemobs=Mobları Aç/Kapa +key.minimap.waypointhotkey=Waypoint Kısayol Tuşu +key.minimap.waypointmenu=Waypoint Menusu + +minimap.waypoints.title=Waypointler +minimap.waypoints.teleportto=Şuna ışınlan +minimap.waypoints.highlight=Highlight +minimap.waypoints.newwaypoint=Yeni Waypoint +minimap.waypoints.deleteconfirm=Bu Waypoint'i kaldırmak istediğinizden emin misiniz? +minimap.waypoints.edit=Waypointi degistir +minimap.waypoints.new=Yeni Waypoint +minimap.waypoints.name=Waypoint ismi +minimap.waypoints.choosecolor=Rengini Seç: +minimap.waypoints.enabled=Görünür: +minimap.waypoints.enable=Waypoint'i göstermek +minimap.waypoints.disable=Waypoint'i gizlemek +minimap.waypoints.applicabledimensions=Hangi boyutta görünebilecek +minimap.waypoints.dimension.applies=Bu boyutta görünür +minimap.waypoints.dimension.notapplies=Bu boyutta görünmez \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/vi_VN.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/vi_VN.lang new file mode 100644 index 0000000..106d496 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/vi_VN.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=Maintained by MamiyaOtaru +minimap.ui.welcome2=Translated by: LuffyMonkie +minimap.ui.welcome3=Chào mừng tới VoxelMap, đây là +minimap.ui.welcome4=một số tính năng và câu lệnh có sẵn cho bạn. +minimap.ui.welcome5a=Phóng to/Thu nhỏ +minimap.ui.welcome5b=Tùy chọn +minimap.ui.welcome6=Chuyển đổi bản đồ toàn màn hình. +minimap.ui.welcome7=Thêm nhanh một điểm chỉ đường. +minimap.ui.welcome8=Ẩn tin nhắn này +minimap.ui.zoomlevel=Mức độ phóng đại: +minimap.ui.otheroptions=Tùy chọn khác + +options.minimap.title=Tùy chọn cho bản đồ +options.minimap.showcoordinates=Hiển thị tọa độ +options.minimap.hideminimap=Ẩn bản đồ +options.minimap.cavemode=Kích hoạt chế độ hang động +options.minimap.dynamiclighting=Ánh sáng động +options.minimap.terraindepth=Chiều sâu địa hình +options.minimap.squaremap=Bản đồ vuông +options.minimap.oldnorth=Phía bắc kiểu cũ +options.minimap.ingamewaypoints=Điểm chỉ đường trong game +options.minimap.ingamewaypoints.beacons=Cột sáng +options.minimap.ingamewaypoints.signs=Biển hiệu +options.minimap.ingamewaypoints.both=Cả hai +options.minimap.location=Vị trí +options.minimap.location.topleft=Trên - Trái +options.minimap.location.topright=Trên - Phải +options.minimap.location.bottomright=Dưới - Phải +options.minimap.location.bottomleft=Dưới - Trái +options.minimap.size=Kích cỡ +options.minimap.size.small=Nhỏ +options.minimap.size.medium=Thường +options.minimap.size.large=Lớn +options.minimap.fontsize=Cỡ chữ +options.minimap.radar=Radar... +options.minimap.radar.title=Tùy chọn Radar +options.minimap.radar.showradar=Radar +options.minimap.radar.showhostiles=Hiển thị quái vật +options.minimap.radar.showplayers=Hiển thị người chơi +options.minimap.radar.showneutrals=Hiển thị động vật +options.minimap.radar.iconoutlines=Viền ngoài biểu tượng +options.minimap.radar.iconfiltering=Lọc biểu tưởng +options.minimap.radar.showplayerhelmets=Hiển thị giáp người chơi +options.minimap.radar.showmobhelmets=Hiển thị giáp của Mob +options.minimap.radar.showplayernames=Hiển thị tên người chơi +options.minimap.radar.randomobs=Mob ngẫu nhiên +options.minimap.radar.selectmobs=Mob được hiển thị... +options.minimap.detailsperformance=Chi tiết/Trình bày... +options.minimap.terrain.height=Chiều cao +options.minimap.terrain.slope=Độ dốc +options.minimap.terrain.both=Cả hai +options.minimap.filtering=Lọc +options.minimap.watertransparency=Độ trong của nước +options.minimap.blocktransparency=Độ rõ của khối +options.minimap.biomes=Môi trường +options.minimap.biomeoverlay=Độ che phủ của môi trường +options.minimap.biomeoverlay.transparent=Trong suốt +options.minimap.biomeoverlay.solid=Dày đặc +options.minimap.chunkgrid=Tách đoạn +options.minimap.waypoints=Điểm chỉ đường... +options.minimap.waypoints.title=Tùy chọn +options.minimap.waypoints.distance=Khoảng cách tối đa +options.minimap.waypoints.infinite=Vô hạn +options.minimap.waypoints.deathpoints=Điểm tử vong +options.minimap.waypoints.deathpoints.mostrecent=Gần đây nhất +options.minimap.waypoints.deathpoints.all=Tất cả +options.minimap.waypoints.deathpoints.tooltip=Có hiệu lực từ lần tử vong sau +options.minimap.waypoints.showwaypointnames=Hiện tên điểm trên bản đồ +options.minimap.mobs.title=Hiển thị hoặc ẩn các loại Mob +options.minimap.mobs.enable=Hiển thị biểu tưởng Mob +options.minimap.mobs.disable=Ẩn biểu tượng Mob +options.minimap.mobs.enabled=Biểu tượng này đã được hiển thị +options.minimap.mobs.disabled=Biểu tượng này chưa được hiển thị. + +controls.minimap.title=Điều khiển bản đồ +controls.minimap.unbind1=Để hủy gán một phím, chọn nó và ấn phím "ESC". +controls.minimap.unbind2=(Ngoại trừ phím Menu - Nó không thể bị hủy gán) +key.minimap.zoom=Phóng đại +key.minimap.togglefullscreen=Chuyển đổi bản đồ toàn màn hình +key.minimap.voxelmapmenu=VoxelMap Menu +key.minimap.menu=Menu +key.minimap.waypointhotkey=Phím tắt chỉ đường +key.minimap.togglemobs=Chuyển đổi hiển thị Mob + +minimap.waypoints.title=Điểm chỉ đường +minimap.waypoints.teleportto=Dịch chuyển đến +minimap.waypoints.highlight=Làm nổi bật +minimap.waypoints.newwaypoint=Điểm chỉ đường mới +minimap.waypoints.deleteconfirm=Bạn có chắc muốn xóa điểm chỉ đường này? +minimap.waypoints.edit=Chỉnh sửa +minimap.waypoints.new=Điểm mới +minimap.waypoints.name=Tên điểm chỉ đường +minimap.waypoints.choosecolor=Chọn màu: +minimap.waypoints.enabled=Hiển thị: +minimap.waypoints.enable=Hiển thị điểm chỉ đường +minimap.waypoints.disable=Ẩn điểm chỉ đường +minimap.waypoints.applicabledimensions=Kiểu hiển thị của điểm chỉ đường +minimap.waypoints.dimension.applies=Hiển thị kiểu này +minimap.waypoints.dimension.notapplies=Không hiển thị kiểu này +minimap.waypoints.sortbyname=Tên +minimap.waypoints.sortbydistance=Khoảng cách +minimap.waypoints.sortbycreated=Thời gian tạo +minimap.waypoints.sortbycolor=Màu \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/zh_CN.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/zh_CN.lang new file mode 100644 index 0000000..5c2c641 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/zh_CN.lang @@ -0,0 +1,99 @@ +minimap.ui.welcome1=由MamiyaOtaru维护 +minimap.ui.welcome2=由zlainsama翻译 +minimap.ui.welcome3=欢迎使用VoxelMap, 这里有 +minimap.ui.welcome4=许多功能和指令供你使用. +minimap.ui.welcome5a=放大/缩小 +minimap.ui.welcome5b=选项 +minimap.ui.welcome6=切换大地图. +minimap.ui.welcome7=快速添加一个路径点. +minimap.ui.welcome8=隐藏此信息 +minimap.ui.zoomlevel=缩放级别: +minimap.ui.otheroptions=其他选项 + +options.minimap.title=小地图选项 +options.minimap.showcoordinates=显示坐标 +options.minimap.hideminimap=隐藏小地图 +options.minimap.cavemode=洞穴模式 +options.minimap.dynamiclighting=动态光照 +options.minimap.terraindepth=地形深度 +options.minimap.squaremap=方形地图 +options.minimap.oldnorth=日落北方 +options.minimap.ingamewaypoints=游戏内路径点 +options.minimap.ingamewaypoints.beacons=只显示光柱 +options.minimap.ingamewaypoints.signs=只显示标签 +options.minimap.ingamewaypoints.both=显示两者 +options.minimap.location=位置 +options.minimap.location.topleft=左上 +options.minimap.location.topright=右上 +options.minimap.location.bottomright=右下 +options.minimap.location.bottomleft=左下 +options.minimap.size=尺寸 +options.minimap.size.small=小 +options.minimap.size.medium=通常 +options.minimap.size.large=大 +options.minimap.fontsize=字体尺寸 +options.minimap.radar=雷达... +options.minimap.radar.title=雷达选项 +options.minimap.radar.showradar=雷达 +options.minimap.radar.showhostiles=显示敌对生物 +options.minimap.radar.showplayers=显示周围玩家 +options.minimap.radar.showneutrals=显示中立生物 +options.minimap.radar.iconoutlines=图标描边 +options.minimap.radar.iconfiltering=过滤图标 +options.minimap.radar.showplayernames=显示玩家名字 +options.minimap.radar.showplayerhelmets=显示玩家头盔 +options.minimap.radar.showmobhelmets=显示生物头盔 +options.minimap.radar.randomobs=随机生物 +options.minimap.radar.selectmobs=生物显示设置... +options.minimap.detailsperformance=细节/性能... +options.minimap.terrain.height=高度 +options.minimap.terrain.slope=坡度 +options.minimap.terrain.both=两者 +options.minimap.filtering=过滤渲染 +options.minimap.watertransparency=水域透明度 +options.minimap.blocktransparency=方块透明度 +options.minimap.biomes=生物群系 +options.minimap.biomeoverlay=生物群系显示 +options.minimap.biomeoverlay.transparent=透明 +options.minimap.biomeoverlay.solid=实心 +options.minimap.chunkgrid=区块边界 +options.minimap.waypoints=路径点... +options.minimap.waypoints.title=路径点选项 +options.minimap.waypoints.distance=最远距离 +options.minimap.waypoints.infinite=无限 +options.minimap.waypoints.deathpoints=死亡点 +options.minimap.waypoints.deathpoints.mostrecent=最近一次 +options.minimap.waypoints.deathpoints.all=所有 +options.minimap.waypoints.deathpoints.tooltip=在下一次死亡时生效 +options.minimap.waypoints.showwaypointnames=显示名字在地图上 +options.minimap.mobs.title=显示或隐藏个别生物类型 +options.minimap.mobs.enable=显示生物 +options.minimap.mobs.disable=隐藏生物 +options.minimap.mobs.enabled=生物显示已启用 +options.minimap.mobs.disabled=生物显示已禁用 + +controls.minimap.title=小地图按键控制 +controls.minimap.unbind1=要清除一个键位的话, 选中它然后按 'Escape' (ESC). +controls.minimap.unbind2=(除了菜单键 - 它不能被清除) +key.minimap.zoom=缩放 +key.minimap.togglefullscreen=切换大地图 +key.minimap.menu=菜单 +key.minimap.togglemobs=切换生物显示 +key.minimap.waypointhotkey=快速添加路径点 +key.minimap.waypointmenu=路径点菜单 + +minimap.waypoints.title=路径点 +minimap.waypoints.teleportto=传送至 +minimap.waypoints.highlight=高亮 +minimap.waypoints.newwaypoint=新路径点 +minimap.waypoints.deleteconfirm=你确定你想要删除这个路径点吗? +minimap.waypoints.edit=编辑路径点 +minimap.waypoints.new=新路径点 +minimap.waypoints.name=路径点名称 +minimap.waypoints.choosecolor=选择颜色: +minimap.waypoints.enabled=已启用: +minimap.waypoints.enable=启用路径点 +minimap.waypoints.disable=禁用路径点 +minimap.waypoints.applicabledimensions=这个路径点将会在这些位面可视 +minimap.waypoints.dimension.applies=在这个位面可视 +minimap.waypoints.dimension.notapplies=在这个位面不可视 \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/zh_TW.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/zh_TW.lang new file mode 100644 index 0000000..33b8c8c --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/minecraft/voxelmap/lang/zh_TW.lang @@ -0,0 +1,103 @@ +minimap.ui.welcome1=此軟體由 MamiyaOtaru 進行維護 +minimap.ui.welcome2=翻譯者: 無云(uno) +minimap.ui.welcome3=歡迎使用 VoxelMap +minimap.ui.welcome4=此軟體還有一些功能供您使用. +minimap.ui.welcome5a=放大/縮小 +minimap.ui.welcome5b=選項 +minimap.ui.welcome6=切換全螢幕地圖. +minimap.ui.welcome7=快速增加一個記錄點. +minimap.ui.welcome8=隱藏此訊息 +minimap.ui.zoomlevel=縮放等級: +minimap.ui.otheroptions=其他選項 + +options.minimap.title=小地圖選項 +options.minimap.showcoordinates=顯示座標 +options.minimap.hideminimap=隱藏小地圖 +options.minimap.cavemode=開啟洞窟模式 +options.minimap.dynamiclighting=動態光源 +options.minimap.terraindepth=地形深度 +options.minimap.squaremap=方形地圖 +options.minimap.oldnorth=日落方向為北 +options.minimap.ingamewaypoints=在遊戲中的記錄點 +options.minimap.ingamewaypoints.beacons=只有光柱 +options.minimap.ingamewaypoints.signs=只有標誌 +options.minimap.ingamewaypoints.both=兩者都有 +options.minimap.location=位置 +options.minimap.location.topleft=左上 +options.minimap.location.topright=右上 +options.minimap.location.bottomright=右下 +options.minimap.location.bottomleft=左下 +options.minimap.size=大小 +options.minimap.size.small=小型 +options.minimap.size.medium=普通 +options.minimap.size.large=大型 +options.minimap.fontsize=字型大小 +options.minimap.radar=雷達... +options.minimap.radar.title=雷達選項 +options.minimap.radar.showradar=雷達 +options.minimap.radar.showhostiles=顯示敵人 +options.minimap.radar.showplayers=顯示玩家 +options.minimap.radar.showneutrals=顯示中立生物 +options.minimap.radar.iconoutlines=頭像圖示有外框 +options.minimap.radar.iconfiltering=圖示濾鏡 +options.minimap.radar.showplayerhelmets=顯示玩家頭盔 +options.minimap.radar.showmobhelmets=顯示怪物頭盔 +options.minimap.radar.showplayernames=顯示玩家名字 +options.minimap.radar.randomobs=亂數產生怪物圖示 +options.minimap.radar.selectmobs=怪物圖示... +options.minimap.detailsperformance=設定細節... +options.minimap.terrain.height=高度 +options.minimap.terrain.slope=坡度 +options.minimap.terrain.both=兩者都有 +options.minimap.filtering=濾鏡 +options.minimap.watertransparency=水體透明 +options.minimap.blocktransparency=方塊透明 +options.minimap.biomes=生態系 +options.minimap.biomeoverlay=顯示生態系 +options.minimap.biomeoverlay.transparent=透明 +options.minimap.biomeoverlay.solid=實心 +options.minimap.chunkgrid=網格 +options.minimap.waypoints=記錄點... +options.minimap.waypoints.title=記錄點選項 +options.minimap.waypoints.distance=最大距離 +options.minimap.waypoints.infinite=無限 +options.minimap.waypoints.deathpoints=死亡點(s) +options.minimap.waypoints.deathpoints.mostrecent=最近的 +options.minimap.waypoints.deathpoints.all=全部 +options.minimap.waypoints.deathpoints.tooltip=下次死亡後才會產生效果 +options.minimap.waypoints.showwaypointnames=顯示座標名稱 +options.minimap.mobs.title=顯示或隱藏個別怪物類型 +options.minimap.mobs.enable=顯示怪物圖示 +options.minimap.mobs.disable=關閉怪物圖示 +options.minimap.mobs.enabled=此圖示已經設定顯示 +options.minimap.mobs.disabled=此圖示已經設定不顯示. + +controls.minimap.title=小地圖按鍵控制表 +controls.minimap.unbind1=如果要解除按鍵設置, 請在選擇該項目後按 Esc 鍵. +controls.minimap.unbind2=(選單鍵是不可解除的) +key.minimap.zoom=放大 +key.minimap.togglefullscreen=全螢幕地圖 +key.minimap.voxelmapmenu=小地圖選單 +key.minimap.menu=選單 +key.minimap.waypointhotkey=記錄點熱鍵 +key.minimap.togglemobs=顯示怪物圖示 + +minimap.waypoints.title=記錄點清單 +minimap.waypoints.teleportto=瞬移到選擇的記錄點 +minimap.waypoints.highlight=高亮度 +minimap.waypoints.newwaypoint=新記錄點 +minimap.waypoints.deleteconfirm=你確定要移除此記錄點? +minimap.waypoints.edit=編輯記錄點 +minimap.waypoints.new=新記錄點 +minimap.waypoints.name=記錄點名稱 +minimap.waypoints.choosecolor=選擇標示色彩: +minimap.waypoints.enabled=顯示: +minimap.waypoints.enable=顯示此記錄點 +minimap.waypoints.disable=不顯示此記錄點 +minimap.waypoints.applicabledimensions=一定距離內可看見記錄點位置 +minimap.waypoints.dimension.applies=在此空間顯示 +minimap.waypoints.dimension.notapplies=在此空間不顯示 +minimap.waypoints.sortbyname=依名稱排序 +minimap.waypoints.sortbydistance=依距離排序 +minimap.waypoints.sortbycreated=依建立時間排序 +minimap.waypoints.sortbycolor=依色彩排序 diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/lang/en_US.lang b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/lang/en_US.lang new file mode 100644 index 0000000..65fe4ee --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/lang/en_US.lang @@ -0,0 +1,189 @@ +language.name=English +language.region=US +language.code=en_US + +mco.terms.buttons.agree=Agree +mco.terms.buttons.disagree=Don't Agree +mco.terms.title=Realms Terms of Service +mco.terms.sentence.1=I agree to Minecraft Realms +mco.terms.sentence.2=Terms of Service + +mco.buy.realms.title=Buy a Realm +mco.buy.realms.buy=I want one! + +mco.selectServer.play=Play +mco.selectServer.configure=Configure +mco.selectServer.leave=Leave Realm +mco.selectServer.create=Create Realm +mco.selectServer.buy=Buy Realm +mco.selectServer.whatisrealms=What is Realms? + +mco.selectServer.expired=Expired Server +mco.selectServer.open=Open Server +mco.selectServer.closed=Closed Server +mco.selectServer.locked=Locked Server + +mco.selectServer.openserver=Open Server +mco.selectServer.closeserver=Close Server + +mco.selectServer.minigame=Mini Game: +mco.selectServer.uninitialized=Click to Create Realm! + +mco.selectServer.expires.days=Expires in %s days +mco.selectServer.expires.day=Expires in a day +mco.selectServer.expires.soon=Expires soon + +mco.configure.world.edit.title=Edit Realm +mco.configure.world.edit.subscreen.title=More Options + +mco.configure.world.title=Configure Realm +mco.configure.world.name=Name +mco.configure.world.description=Description +mco.configure.world.location=Location +mco.configure.world.invited=Invited +mco.configure.world.buttons.edit=Settings +mco.configure.world.buttons.reset=Reset Realm +mco.configure.world.buttons.done=Done +mco.configure.world.buttons.delete=Delete +mco.configure.world.buttons.open=Open Realm +mco.configure.world.buttons.close=Close Realm +mco.configure.world.buttons.invite=Invite +mco.configure.world.buttons.uninvite=Uninvite +mco.configure.world.buttons.backup=Backups +mco.configure.world.buttons.subscription=Subscription +mco.configure.world.buttons.startMiniGame=Switch to Mini Game +mco.configure.world.buttons.modifyMiniGame=End Mini Game +mco.configure.world.buttons.op=Op +mco.configure.world.buttons.deop=Deop +mco.configure.world.buttons.activity=Player Activity +mco.configure.world.buttons.moreoptions=More options +mco.configure.world.buttons.editworld=Edit World +mco.configure.world.invite.profile.name=Name +mco.configure.world.uninvite.question=Are you sure that you want to uninvite +mco.configure.world.status=Status +mco.configure.world.invites.ops.tooltip=Operator +mco.configure.world.invites.normal.tooltip=Normal user +mco.configure.world.invites.remove.tooltip=Remove + +mco.configure.world.subscription.title=Subscription Info +mco.configure.world.subscription.daysleft=Days Left +mco.configure.world.subscription.recurring.daysleft=Renewed automatically in +mco.configure.world.subscription.less_than_a_day=less than a day +mco.configure.world.subscription.start=Start Date +mco.configure.world.subscription.extend=Extend Subscription +mco.configure.world.subscription.extendHere=Extend subscription here: + +mco.configure.world.pvp=PVP +mco.configure.world.spawnAnimals=Spawn Animals +mco.configure.world.spawnNPCs=Spawn NPCs +mco.configure.world.spawnMonsters=Spawn Monsters +mco.configure.world.spawnProtection=Spawn protection +mco.configure.world.commandBlocks=Command Blocks + +mco.configure.world.on=On +mco.configure.world.off=Off + +mco.create.world.location.title=Locations +mco.create.world.location.warning=You may not get the exact location you select +mco.create.world.wait=Creating the realm... +mco.create.world.seed=Seed (Optional) + +mco.reset.world.title=Reset Realm +mco.reset.world.warning=This will permanently delete your realm! +mco.reset.world.seed=Seed (Optional) +mco.reset.world.resetting.screen.title=Resetting Realm... + +mco.minigame.world.title=Switch Realm to Mini Game +mco.minigame.world.info1=This will temporarily replace your world with a mini game! +mco.minigame.world.info2=You can later return to your original world without losing anything. +mco.minigame.world.selected=Selected mini game: +mco.minigame.world.noSelection=Please make a selection +mco.minigame.world.startButton=Switch +mco.minigame.world.starting.screen.title=Starting Mini Game... +mco.minigame.world.changeButton=Select Another Mini Game +mco.minigame.world.stopButton=End Mini Game +mco.minigame.world.modify.title=Modify Mini Game +mco.minigame.world.modify.new=Select another mini game? +mco.minigame.world.modify.end=End the mini game and restore your Realm? + +mco.minigame.world.restore.question.line1=The mini game will end and your Realm will be restored. +mco.minigame.world.restore.question.line2=Are you sure you want to do this? +mco.minigame.world.restore=Ending Mini Game... + +mco.configure.world.close.question.line1=Your realm will become unavailable. +mco.configure.world.close.question.line2=Are you sure you want to do this? + +mco.configure.world.leave.question.line1=If you leave this realm you won't see it unless invited again +mco.configure.world.leave.question.line2=Are you sure you want to do this? + +mco.configure.world.reset.question.line1=Your realm will be regenerated and your current realm will be lost +mco.configure.world.reset.question.line2=Are you sure you want to do this? + +mco.configure.world.restore.question.line1=Your realm will be restored to date '%s' (%s) +mco.configure.world.restore.question.line2=Are you sure you want to do this? + +mco.configure.world.restore.download.question.line1=The world will be downloaded and added to your single player worlds. +mco.configure.world.restore.download.question.line2=Do you want to continue? + +mco.more.info.question.line1=You will be redirected to your default browser to see the page. +mco.more.info.question.line2=Do you want to continue? + +mco.connect.connecting=Connecting to the online server... +mco.connect.authorizing=Logging in... +mco.connect.failed=Failed to connect to the online server + +mco.create.world=Create + +mco.client.outdated.title=Client Outdated! +mco.client.outdated.msg=Your client is outdated, please consider updating it to use Realms + +mco.backup.title=Edit World +mco.backup.backup=Backups +mco.backup.button.restore=Restore +mco.backup.restoring=Restoring your realm +mco.backup.button.download=Download Latest +mco.backup.changes.tooltip=Changes +mco.backup.nobackups=This realm doesn't have any backups currently. +mco.backup.button.upload=Upload world +mco.backup.button.reset=Reset world + + +mco.download.title=Downloading Latest World +mco.download.cancelled=Download cancelled +mco.download.failed=Download failed +mco.download.done=Download done +mco.download.downloading=Downloading +mco.download.extracting=Extracting +mco.download.preparing=Preparing Download + +mco.template.title=Realm Templates +mco.template.title.minigame=Realm Mini Games +mco.template.button.select=Select +mco.template.default.name=Select Template (Optional) +mco.template.name=Template + +mco.invites.button.accept=Accept +mco.invites.button.reject=Reject +mco.invites.title=Pending Invitations +mco.invites.pending=New invitations! +mco.invites.nopending=No pending invitations! + +mco.upload.select.world.title=Upload your world +mco.upload.button.name=Upload +mco.upload.verifying=Verifying your map +mco.upload.preparing=Preparing your world data +mco.upload.close.failure=Could not close your server, please try again later +mco.upload.size.failure=Selected world '%s' is too big! +mco.upload.uploading=Uploading '%s' +mco.upload.done=Upload done +mco.upload.failed=Upload failed! (%s) +mco.upload.cancelled=Upload cancelled + +mco.activity.title=Player Activity +mco.activity.noactivity=No activity for the past %s days + +mco.errorMessage.6001=Client outdated +mco.errorMessage.6002=ToS not accepted +mco.errorMessage.6003=Download limit reached +mco.errorMessage.6004=Upload limit reached +mco.errorMessage.6005=World is in admin lock state \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/cross_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/cross_icon.png new file mode 100644 index 0000000..255f4ce Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/cross_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/expired_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/expired_icon.png new file mode 100644 index 0000000..4343ad7 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/expired_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/invitation_icons.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/invitation_icons.png new file mode 100644 index 0000000..5e63f25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/invitation_icons.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/invite_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/invite_icon.png new file mode 100644 index 0000000..1188d25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/invite_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/off_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/off_icon.png new file mode 100644 index 0000000..b3e0f1a Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/off_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/on_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/on_icon.png new file mode 100644 index 0000000..12edd81 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/on_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/op_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/op_icon.png new file mode 100644 index 0000000..baac7e3 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/op_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/plus_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/plus_icon.png new file mode 100644 index 0000000..b9523a4 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/plus_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/restore_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/restore_icon.png new file mode 100644 index 0000000..6c5239f Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/restore_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/toggle_off_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/toggle_off_icon.png new file mode 100644 index 0000000..ae2d0dc Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/toggle_off_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/toggle_on_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/toggle_on_icon.png new file mode 100644 index 0000000..353ee10 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/toggle_on_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/user_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/user_icon.png new file mode 100644 index 0000000..cccab25 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/user_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/world_icon.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/world_icon.png new file mode 100644 index 0000000..244c589 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/realms/world_icon.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/title/realms.png b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/title/realms.png new file mode 100644 index 0000000..6610631 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/assets/realms/textures/gui/title/realms.png differ diff --git a/Tellinq-CB-1.7.10/src/main/resources/log4j2.xml b/Tellinq-CB-1.7.10/src/main/resources/log4j2.xml new file mode 100644 index 0000000..54f8b4e --- /dev/null +++ b/Tellinq-CB-1.7.10/src/main/resources/log4j2.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tellinq-CB-1.7.10/src/main/resources/pack.png b/Tellinq-CB-1.7.10/src/main/resources/pack.png new file mode 100644 index 0000000..cfaa986 Binary files /dev/null and b/Tellinq-CB-1.7.10/src/main/resources/pack.png differ diff --git a/Tellinq-CB-1.7.10/src/test/java/Start.java b/Tellinq-CB-1.7.10/src/test/java/Start.java new file mode 100644 index 0000000..e0ea1d6 --- /dev/null +++ b/Tellinq-CB-1.7.10/src/test/java/Start.java @@ -0,0 +1,56 @@ +import net.minecraft.client.main.Main; + +import java.io.File; +import java.util.Arrays; + +public class Start { + public static void main(final String[] args) { + String userHome = System.getProperty("user.home", "."); + File workingDirectory; + switch (getPlatform()) { + case LINUX: + workingDirectory = new File(userHome, ".minecraft/"); + break; + case WINDOWS: + String applicationData = System.getenv("APPDATA"); + String folder = applicationData != null ? applicationData : userHome; + workingDirectory = new File(folder, ".minecraft/"); + break; + case MACOS: + workingDirectory = new File(userHome, "Library/Application Support/minecraft"); + break; + default: + workingDirectory = new File(userHome, "minecraft/"); + } + + Main.main(concat(new String[] { + "--version", "CheatBreaker", + "--assetIndex", "1.7.10", + "--userProperties", "{}", + "--gameDir", new File(workingDirectory, ".").getAbsolutePath(), + "--assetsDir", new File(workingDirectory, "assets/").getAbsolutePath() + }, args)); + } + + public static T[] concat(final T[] first, final T[] second) { + final T[] result = Arrays.copyOf(first, first.length + second.length); + System.arraycopy(second, 0, result, first.length, second.length); + return result; + } + + private static OS getPlatform() { + String os = System.getProperty("os.name").toLowerCase(); + return os.contains("win") ? OS.WINDOWS : + (os.contains("mac") ? OS.MACOS : + (os.contains("solaris") || os.contains("sunos") ? OS.SOLARIS : + (os.contains("linux") || os.contains("unix") ? OS.LINUX : OS.UNKNOWN))); + } + + public enum OS { + LINUX, + MACOS, + SOLARIS, + UNKNOWN, + WINDOWS + } +}